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QXdhaXRzUmVzcG9uc2UoJnJlcGx5SUQpKTsKLQotICAgICAgICAgICAgc3A8QU1lc3NhZ2U+IHJlc3BvbnNlID0gbmV3IEFNZXNzYWdlOwotICAgICAgICAgICAgcmVzcG9uc2UtPnNldEludDMyKCJlcnIiLCBlcnIpOwotICAgICAgICAgICAgcmVzcG9uc2UtPnBvc3RSZXBseShyZXBseUlEKTsKLSAgICAgICAgICAgIGJyZWFrOwotICAgICAgICB9Ci0KLSAgICAgICAgY2FzZSBrV2hhdFNldFN1cmZhY2U6Ci0gICAgICAgIHsKLSAgICAgICAgICAgIHN0YXR1c190IGVycjsKLSAgICAgICAgICAgIGlmIChtU3RhdGUgIT0gVU5QUkVQQVJFRCkgewotICAgICAgICAgICAgICAgIGVyciA9IElOVkFMSURfT1BFUkFUSU9OOwotICAgICAgICAgICAgfSBlbHNlIHsKLSAgICAgICAgICAgICAgICBzcDxSZWZCYXNlPiBvYmo7Ci0gICAgICAgICAgICAgICAgQ0hFQ0sobXNnLT5maW5kT2JqZWN0KCJuYXRpdmUtd2luZG93IiwgJm9iaikpOwotCi0gICAgICAgICAgICAgICAgbU5hdGl2ZVdpbmRvdyA9IHN0YXRpY19jYXN0PE5hdGl2ZVdpbmRvd1dyYXBwZXIgKj4ob2JqLmdldCgpKTsKLQotICAgICAgICAgICAgICAgIGVyciA9IE9LOwotICAgICAgICAgICAgfQotCi0gICAgICAgICAgICB1aW50MzJfdCByZXBseUlEOwotICAgICAgICAgICAgQ0hFQ0sobXNnLT5zZW5kZXJBd2FpdHNSZXNwb25zZSgmcmVwbHlJRCkpOwotCi0gICAgICAgICAgICBzcDxBTWVzc2FnZT4gcmVzcG9uc2UgPSBuZXcgQU1lc3NhZ2U7Ci0gICAgICAgICAgICByZXNwb25zZS0+c2V0SW50MzIoImVyciIsIGVycik7Ci0gICAgICAgICAgICByZXNwb25zZS0+cG9zdFJlcGx5KHJlcGx5SUQpOwotICAgICAgICAgICAgYnJlYWs7Ci0gICAgICAgIH0KLQotICAgICAgICBjYXNlIGtXaGF0UHJlcGFyZToKLSAgICAgICAgewotICAgICAgICAgICAgc3RhdHVzX3QgZXJyOwotICAgICAgICAgICAgaWYgKG1TdGF0ZSAhPSBVTlBSRVBBUkVEKSB7Ci0gICAgICAgICAgICAgICAgZXJyID0gSU5WQUxJRF9PUEVSQVRJT047Ci0gICAgICAgICAgICB9IGVsc2UgewotICAgICAgICAgICAgICAgIGVyciA9IG9uUHJlcGFyZSgpOwotCi0gICAgICAgICAgICAgICAgaWYgKGVyciA9PSBPSykgewotICAgICAgICAgICAgICAgICAgICBtU3RhdGUgPSBTVE9QUEVEOwotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgdWludDMyX3QgcmVwbHlJRDsKLSAgICAgICAgICAgIENIRUNLKG1zZy0+c2VuZGVyQXdhaXRzUmVzcG9uc2UoJnJlcGx5SUQpKTsKLQotICAgICAgICAgICAgc3A8QU1lc3NhZ2U+IHJlc3BvbnNlID0gbmV3IEFNZXNzYWdlOwotICAgICAgICAgICAgcmVzcG9uc2UtPnNldEludDMyKCJlcnIiLCBlcnIpOwotICAgICAgICAgICAgcmVzcG9uc2UtPnBvc3RSZXBseShyZXBseUlEKTsKLSAgICAgICAgICAgIGJyZWFrOwotICAgICAgICB9Ci0KLSAgICAgICAgY2FzZSBrV2hhdFN0YXJ0OgotICAgICAgICB7Ci0gICAgICAgICAgICBzdGF0dXNfdCBlcnIgPSBPSzsKLQotICAgICAgICAgICAgaWYgKG1TdGF0ZSA9PSBVTlBSRVBBUkVEKSB7Ci0gICAgICAgICAgICAgICAgZXJyID0gb25QcmVwYXJlKCk7Ci0KLSAgICAgICAgICAgICAgICBpZiAoZXJyID09IE9LKSB7Ci0gICAgICAgICAgICAgICAgICAgIG1TdGF0ZSA9IFNUT1BQRUQ7Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgfQotCi0gICAgICAgICAgICBpZiAoZXJyID09IE9LKSB7Ci0gICAgICAgICAgICAgICAgaWYgKG1TdGF0ZSAhPSBTVE9QUEVEKSB7Ci0gICAgICAgICAgICAgICAgICAgIGVyciA9IElOVkFMSURfT1BFUkFUSU9OOwotICAgICAgICAgICAgICAgIH0gZWxzZSB7Ci0gICAgICAgICAgICAgICAgICAgIGVyciA9IG9uU3RhcnQoKTsKLQotICAgICAgICAgICAgICAgICAgICBpZiAoZXJyID09IE9LKSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICBtU3RhdGUgPSBTVEFSVEVEOwotICAgICAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgfQotCi0gICAgICAgICAgICB1aW50MzJfdCByZXBseUlEOwotICAgICAgICAgICAgQ0hFQ0sobXNnLT5zZW5kZXJBd2FpdHNSZXNwb25zZSgmcmVwbHlJRCkpOwotCi0gICAgICAgICAgICBzcDxBTWVzc2FnZT4gcmVzcG9uc2UgPSBuZXcgQU1lc3NhZ2U7Ci0gICAgICAgICAgICByZXNwb25zZS0+c2V0SW50MzIoImVyciIsIGVycik7Ci0gICAgICAgICAgICByZXNwb25zZS0+cG9zdFJlcGx5KHJlcGx5SUQpOwotICAgICAgICAgICAgYnJlYWs7Ci0gICAgICAgIH0KLQotICAgICAgICBjYXNlIGtXaGF0U3RvcDoKLSAgICAgICAgewotICAgICAgICAgICAgc3RhdHVzX3QgZXJyOwotCi0gICAgICAgICAgICBpZiAobVN0YXRlICE9IFNUQVJURUQpIHsKLSAgICAgICAgICAgICAgICBlcnIgPSBJTlZBTElEX09QRVJBVElPTjsKLSAgICAgICAgICAgIH0gZWxzZSB7Ci0gICAgICAgICAgICAgICAgZXJyID0gb25TdG9wKCk7Ci0KLSAgICAgICAgICAgICAgICBpZiAoZXJyID09IE9LKSB7Ci0gICAgICAgICAgICAgICAgICAgIG1TdGF0ZSA9IFNUT1BQRUQ7Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgfQotCi0gICAgICAgICAgICB1aW50MzJfdCByZXBseUlEOwotICAgICAgICAgICAgQ0hFQ0sobXNnLT5zZW5kZXJBd2FpdHNSZXNwb25zZSgmcmVwbHlJRCkpOwotCi0gICAgICAgICAgICBzcDxBTWVzc2FnZT4gcmVzcG9uc2UgPSBuZXcgQU1lc3NhZ2U7Ci0gICAgICAgICAgICByZXNwb25zZS0+c2V0SW50MzIoImVyciIsIGVycik7Ci0gICAgICAgICAgICByZXNwb25zZS0+cG9zdFJlcGx5KHJlcGx5SUQpOwotICAgICAgICAgICAgYnJlYWs7Ci0gICAgICAgIH0KLQotICAgICAgICBjYXNlIGtXaGF0UmVzZXQ6Ci0gICAgICAgIHsKLSAgICAgICAgICAgIHN0YXR1c190IGVyciA9IE9LOwotCi0gICAgICAgICAgICBpZiAobVN0YXRlID09IFNUQVJURUQpIHsKLSAgICAgICAgICAgICAgICBDSEVDS19FUShvblN0b3AoKSwgKHN0YXR1c190KU9LKTsKLSAgICAgICAgICAgICAgICBtU3RhdGUgPSBTVE9QUEVEOwotICAgICAgICAgICAgfQotCi0gICAgICAgICAgICBpZiAobVN0YXRlID09IFNUT1BQRUQpIHsKLSAgICAgICAgICAgICAgICBlcnIgPSBvblJlc2V0KCk7Ci0gICAgICAgICAgICAgICAgbVN0YXRlID0gVU5JTklUSUFMSVpFRDsKLSAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgdWludDMyX3QgcmVwbHlJRDsKLSAgICAgICAgICAgIENIRUNLKG1zZy0+c2VuZGVyQXdhaXRzUmVzcG9uc2UoJnJlcGx5SUQpKTsKLQotICAgICAgICAgICAgc3A8QU1lc3NhZ2U+IHJlc3BvbnNlID0gbmV3IEFNZXNzYWdlOwotICAgICAgICAgICAgcmVzcG9uc2UtPnNldEludDMyKCJlcnIiLCBlcnIpOwotICAgICAgICAgICAgcmVzcG9uc2UtPnBvc3RSZXBseShyZXBseUlEKTsKLSAgICAgICAgICAgIGJyZWFrOwotICAgICAgICB9Ci0KLSAgICAgICAgY2FzZSBrV2hhdERvTW9yZVN0dWZmOgotICAgICAgICB7Ci0gICAgICAgICAgICBpbnQzMl90IGdlbmVyYXRpb247Ci0gICAgICAgICAgICBDSEVDSyhtc2ctPmZpbmRJbnQzMigiZ2VuZXJhdGlvbiIsICZnZW5lcmF0aW9uKSk7Ci0KLSAgICAgICAgICAgIGlmIChnZW5lcmF0aW9uICE9IG1Eb01vcmVTdHVmZkdlbmVyYXRpb24pIHsKLSAgICAgICAgICAgICAgICBicmVhazsKLSAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgc3RhdHVzX3QgZXJyID0gb25Eb01vcmVTdHVmZigpOwotCi0gICAgICAgICAgICBpZiAoZXJyID09IE9LKSB7Ci0gICAgICAgICAgICAgICAgbXNnLT5wb3N0KDEwMDAwbGwpOwotICAgICAgICAgICAgfQotICAgICAgICAgICAgYnJlYWs7Ci0gICAgICAgIH0KLQotICAgICAgICBkZWZhdWx0OgotICAgICAgICAgICAgVFJFU1BBU1MoKTsKLSAgICB9Ci19Ci0KLXN0YXR1c190IFNpbXBsZVBsYXllcjo6b25QcmVwYXJlKCkgewotICAgIENIRUNLX0VRKG1TdGF0ZSwgVU5QUkVQQVJFRCk7Ci0KLSAgICBtRXh0cmFjdG9yID0gbmV3IE51TWVkaWFFeHRyYWN0b3I7Ci0KLSAgICBzdGF0dXNfdCBlcnIgPSBtRXh0cmFjdG9yLT5zZXREYXRhU291cmNlKG1QYXRoLmNfc3RyKCkpOwotCi0gICAgaWYgKGVyciAhPSBPSykgewotICAgICAgICBtRXh0cmFjdG9yLmNsZWFyKCk7Ci0gICAgICAgIHJldHVybiBlcnI7Ci0gICAgfQotCi0gICAgaWYgKG1Db2RlY0xvb3BlciA9PSBOVUxMKSB7Ci0gICAgICAgIG1Db2RlY0xvb3BlciA9IG5ldyBBTG9vcGVyOwotICAgICAgICBtQ29kZWNMb29wZXItPnN0YXJ0KCk7Ci0gICAgfQotCi0gICAgYm9vbCBoYXZlQXVkaW8gPSBmYWxzZTsKLSAgICBib29sIGhhdmVW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gICAgICAgICAgICAgICAgbVN0YXRlQnlUcmFja0luZGV4LmtleUF0KGkpLCBlcnIpOwotICAgICAgICAgICAgfQotICAgICAgICB9IHdoaWxlIChlcnIgPT0gT0spOwotCi0gICAgICAgIGRvIHsKLSAgICAgICAgICAgIEJ1ZmZlckluZm8gaW5mbzsKLSAgICAgICAgICAgIGVyciA9IHN0YXRlLT5tQ29kZWMtPmRlcXVldWVPdXRwdXRCdWZmZXIoCi0gICAgICAgICAgICAgICAgICAgICZpbmZvLm1JbmRleCwKLSAgICAgICAgICAgICAgICAgICAgJmluZm8ubU9mZnNldCwKLSAgICAgICAgICAgICAgICAgICAgJmluZm8ubVNpemUsCi0gICAgICAgICAgICAgICAgICAgICZpbmZvLm1QcmVzZW50YXRpb25UaW1lVXMsCi0gICAgICAgICAgICAgICAgICAgICZpbmZvLm1GbGFncyk7Ci0KLSAgICAgICAgICAgIGlmIChlcnIgPT0gT0spIHsKLSAgICAgICAgICAgICAgICBBTE9HVigiZGVxdWV1ZWQgb3V0cHV0IGJ1ZmZlciBvbiB0cmFjayAlZCIsCi0gICAgICAgICAgICAgICAgICAgICAgbVN0YXRlQnlUcmFja0luZGV4LmtleUF0KGkpKTsKLQotICAgICAgICAgICAgICAgIHN0YXRlLT5tQXZhaWxPdXRwdXRCdWZmZXJJbmZvcy5wdXNoX2JhY2soaW5mbyk7Ci0gICAgICAgICAgICB9IGVsc2UgaWYgKGVyciA9PSBJTkZPX0ZPUk1BVF9DSEFOR0VEKSB7Ci0gICAgICAgICAgICAgICAgZXJyID0gb25PdXRwdXRGb3JtYXRDaGFuZ2VkKG1TdGF0ZUJ5VHJhY2tJbmRleC5rZXlBdChpKSwgc3RhdGUpOwotICAgICAgICAgICAgICAgIENIRUNLX0VRKGVyciwgKHN0YXR1c190KU9LKTsKLSAgICAgICAgICAgIH0gZWxzZSBpZiAoZXJyID09IElORk9fT1VUUFVUX0JVRkZFUlNfQ0hBTkdFRCkgewotICAgICAgICAgICAgICAgIGVyciA9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nN0YXRlLT5tQXZhaWxJbnB1dEJ1ZmZlckluZGljZXMuYmVnaW4oKTsKLSAgICAgICAgICAgIHN0YXRlLT5tQXZhaWxJbnB1dEJ1ZmZlckluZGljZXMuZXJhc2UoCi0gICAgICAgICAgICAgICAgICAgIHN0YXRlLT5tQXZhaWxJbnB1dEJ1ZmZlckluZGljZXMuYmVnaW4oKSk7Ci0KLSAgICAgICAgICAgIGNvbnN0IHNwPEFCdWZmZXI+ICZkc3RCdWZmZXIgPQotICAgICAgICAgICAgICAgIHN0YXRlLT5tQnVmZmVyc1swXS5pdGVtQXQoaW5kZXgpOwotCi0gICAgICAgICAgICBlcnIgPSBtRXh0cmFjdG9yLT5yZWFkU2FtcGxlRGF0YShkc3RCdWZmZXIpOwotICAgICAgICAgICAgQ0hFQ0tfRVEoZXJyLCAoc3RhdHVzX3QpT0spOwotCi0gICAgICAgICAgICBpbnQ2NF90IHRpbWVVczsKLSAgICAgICAgICAgIENIRUNLX0VRKG1FeHRyYWN0b3ItPmdldFNhbXBsZVRpbWUoJnRpbWVVcyksIChzdGF0dXNfdClPSyk7Ci0KLSAgICAgICAgICAgIGVyciA9IHN0YXRlLT5tQ29kZWMtPnF1ZXVlSW5wdXRCdWZmZXIoCi0gICAgICAgICAgICAgICAgICAgIGluZGV4LAotICAgICAgICAgICAgICAgICAgICBkc3RCdWZmZXItPm9mZnNldCgpLAotICAgICAgICAgICAgICAgICAgICBkc3RCdWZmZXItPnNpemUoKSwKLSAgICAgICAgICAgICAgICAgICAgdGltZVVzLAotICAgICAgICAgICAgICAgICAgICAwKTsKLSAgICAgICAgICAgIENIRUNLX0VRKGVyciwgKHN0YXR1c190KU9LKTsKLQotICAgICAgICAgICAgQUxPR1YoImVucXVldWVkIGlucHV0IGRhdGEgb24gdHJhY2sgJWQiLCB0cmFja0luZGV4KTsKLQotICAgICAgICAgICAgZXJyID0gbUV4dHJhY3Rvci0+YWR2YW5jZSgpOwotICAgICAgICAgICAgQ0hFQ0tfRVEoZX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ZUJ5VXMpOwotICAgICAgICAgICAgICAgICAgICBzdGF0ZS0+bUNvZGVjLT5yZWxlYXNlT3V0cHV0QnVmZmVyKGluZm8tPm1JbmRleCk7Ci0gICAgICAgICAgICAgICAgfSBlbHNlIHsKLSAgICAgICAgICAgICAgICAgICAgaWYgKHN0YXRlLT5tQXVkaW9UcmFjayAhPSBOVUxMKSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICBjb25zdCBzcDxBQnVmZmVyPiAmc3JjQnVmZmVyID0KLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBzdGF0ZS0+bUJ1ZmZlcnNbMV0uaXRlbUF0KGluZm8tPm1JbmRleCk7Ci0KLSAgICAgICAgICAgICAgICAgICAgICAgIHJlbmRlckF1ZGlvKHN0YXRlLCBpbmZvLCBzcmNCdWZmZXIpOwotCi0gICAgICAgICAgICAgICAgICAgICAgICBpZiAoaW5mby0+bVNpemUgPiAwKSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgcmVsZWFzZSA9IGZhbHNlOwotICAgICAgICAgICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgICAgICAgICAgaWYgKHJlbGVhc2UpIHsKLSAgICAgICAgICAgICAgICAgICAgICAgIHN0YXRlLT5tQ29kZWMtPnJlbmRlck91dHB1dEJ1ZmZlckFuZFJlbGVhc2UoCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGluZm8tPm1JbmRleCk7Ci0gICAgICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgICAgICBpZiAocmVsZWFzZSkgewotICAgICAgICAgICAgICAgICAgICBzdGF0ZS0+bUF2YWlsT3V0cHV0QnVmZmVySW5mb3MuZXJhc2UoCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgc3RhdGUtPm1BdmFpbE91dHB1dEJ1ZmZlckluZm9zLmJlZ2luKCkpOwotCi0gICAgICAgICAgICAgICA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ZSgpLAotICAgICAgICAgICAgICAgICAgICAwbGwgLyogdGltZVVzICovLAotICAgICAgICAgICAgICAgICAgICBNZWRpYUNvZGVjOjpCVUZGRVJfRkxBR19DT0RFQ0NPTkZJRyk7Ci0KLSAgICAgICAgICAgIENIRUNLX0VRKGVyciwgKHN0YXR1c190KU9LKTsKLSAgICAgICAgfQotICAgIH0KLQotICAgIGJvb2wgc2F3SW5wdXRFT1MgPSBmYWxzZTsKLQotICAgIGZvciAoOzspIHsKLSAgICAgICAgaWYgKCFzYXdJbnB1dEVPUykgewotICAgICAgICAgICAgc2l6ZV90IHRyYWNrSW5kZXg7Ci0gICAgICAgICAgICBzdGF0dXNfdCBlcnIgPSBleHRyYWN0b3ItPmdldFNhbXBsZVRyYWNrSW5kZXgoJnRyYWNrSW5kZXgpOwotCi0gICAgICAgICAgICBpZiAoZXJyICE9IE9LKSB7Ci0gICAgICAgICAgICAgICAgQUxPR1YoInNhdyBpbnB1dCBlb3MiKTsKLSAgICAgICAgICAgICAgICBzYXdJbnB1dEVPUyA9IHRydWU7Ci0gICAgICAgICAgICB9IGVsc2UgewotICAgICAgICAgICAgICAgIENvZGVjU3RhdGUgKnN0YXRlID0gJnN0YXRlQnlUcmFjay5lZGl0VmFsdWVGb3IodHJhY2tJbmRleCk7Ci0KLSAgICAgICAgICAgICAgICBzaXplX3QgaW5kZXg7Ci0gICAgICAgICAgICAgICAgZXJyID0gc3RhdGUtPm1Db2RlYy0+ZGVxdWV1ZUlucHV0QnVmZmVyKCZpbmRleCwga1RpbWVvdXQpOwotCi0gICAgICAgICAgICAgICAgaWYgKGVyciA9PSBPSykgewotICAgICAgICAgICAgICAgICAgICBBTE9HVigiZmlsbGluZyBpbnB1dCBidWZmZXIgJWQiLCBpbmRleCk7Ci0KLSAgICAgICAgICAgICAgICAgICAgY29uc3Qgc3A8QUJ1ZmZlcj4gJmJ1ZmZlciA9IHN0YXRlLT5tSW5CdWZmZXJzLml0ZW1BdChpbmRleCk7Ci0KLSAgICAgICAgICAgICAgICAgICAgZXJyID0gZXh0cmFjdG9yLT5yZWFkU2FtcGxlRGF0YShidWZmZXIpOwotICAgICAgICAgICAgICAgICAgICBDSEVDS19FUShlcnIsIChzdGF0dXNfdClPSyk7Ci0KLSAgICAgICAgICAgICAgICAgICAgaW50NjRfdCB0aW1lVXM7Ci0gICAgICAgICAgICAgICAgICAgIGVyciA9IGV4dHJhY3Rvci0+Z2V0U2FtcGxlVGltZSgmdGltZVVzKTsKLSAgICAgICAgICAgICAgICAgICAgQ0hFQ0tfRVEoZXJyLCAoc3RhdHVzX3QpT0spOwotCi0gICAgICAgICAgICAgICAgICAgIHVpbnQzMl90IGJ1ZmZlckZsYWdzID0gMDsKLQotICAgICAgICAgICAgICAgICAgICB1aW50MzJfdCBzYW1wbGVGbGFnczsKLSAgICAgICAgICAgICAgICAgICAgZXJyID0gZXh0cmFjdG9yLT5nZXRTYW1wbGVGbGFncygmc2FtcGxlRmxhZ3MpOwotICAgICAgICAgICAgICAgICAgICBDSEVDS19FUShlcnIsIChzdGF0dXNfdClPSyk7Ci0KLSAgICAgICAgICAgICAgICAgICAgaWYgKHNhbXBsZUZsYWdzICYgTnVNZWRpYUV4dHJhY3Rvcjo6U0FNUExFX0ZMQUdfRU5DUllQVEVEKSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICBDSEVDSyhkZWNyeXB0SW5wdXRCdWZmZXJzKTsKLQotICAgICAgICAgICAgICAgICAgICAgICAgYnVmZmVyRmxhZ3MgfD0gTWVkaWFDb2RlYzo6QlVGRkVSX0ZMQUdfRU5DUllQVEVEOwotICAgICAgICAgICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgICAgICAgICAgZXJyID0gc3RhdGUtPm1Db2RlYy0+cXVldWVJbnB1dEJ1ZmZlcigKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBpbmRleCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAwIC8qIG9mZnNldCAqLywKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBidWZmZXItPnNpemUoKSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICB0aW1lVXMsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgYnVmZmVyRmxhZ3MpOwotCi0gICAgICAgICAgICAgICAgICAgIENIRUNLX0VRKGVyciwgKHN0YXR1c190KU9LKTsKLQotICAgICAgICAgICAgICAgICAgICBleHRyYWN0b3ItPmFkdmFuY2UoKTsKLSAgICAgICAgICAgICAgICB9IGVsc2UgewotICAgICAgICAgICAgICAgICAgICBDSEVDS19FUShlcnIsIC1FQUdBSU4pOwotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgIH0KLSAgICAgICAgfSBlbHNlIHsKLSAgICAgICAgICAgIGZvciAoc2l6ZV90IGkgPSAwOyBpIDwgc3RhdGVCeVRyYWNrLnNpemUoKTsgKytpKSB7Ci0gICAgICAgICAgICAgICAgQ29kZWNTdGF0ZSAqc3RhdGUgPSAmc3RhdGVCeVRyYWNrLmVkaXRWYWx1ZUF0KGkpOwotCi0gICAgICAgICAgICAgICAgaWYgKCFzdGF0ZS0+bVNpZ25hbGxlZElucHV0RU9TKSB7Ci0gICAgICAgICAgICAgICAgICAgIHNpemVfdCBpbmRleDsKLSAgICAgICAgICAgICAgICAgICAgc3RhdHVzX3QgZXJyID0KLSAgICAgICAgICAgICAgICAgICAgICAgIHN0YXRlLT5tQ29kZWMtPmRlcXVldWVJbnB1dEJ1ZmZlcigmaW5kZXgsIGtUaW1lb3V0KTsKLQotICAgICAgICAgICAgICAgICAgICBpZiAoZXJyID09IE9LKSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICBBTE9HVigic2lnbmFsbGluZyBpbnB1dCBFT1Mgb24gdHJhY2sgJWQiLCBpKTsKLQotICAgICAgICAgICAgICAgICAgICAgICAgZXJyID0gc3RhdGUtPm1Db2RlYy0+cXVldWVJbnB1dEJ1ZmZlcigKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaW5kZXgsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDAgLyogb2Zmc2V0ICovLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAwIC8qIHNpemUgKi8sCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDBsbCAvKiB0aW1lVXMgKi8sCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIE1lZGlhQ29kZWM6OkJVRkZFUl9GTEFHX0VPUyk7Ci0KLSAgICAgICAgICAgICAgICAgICAgICAgIENIRUNLX0VRKGVyciwgKHN0YXR1c190KU9LKTsKLQotICAgICAgICAgICAgICAgICAgICAgICAgc3RhdGUtPm1TaWduYWxsZWRJbnB1dEVPUyA9IHRydWU7Ci0gICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICBDSEVDS19FUShlcnIsIC1FQUdBSU4pOwotICAgICAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgfQotICAgICAgICB9Ci0KLSAgICAgICAgYm9vbCBzYXdPdXRwdXRFT1NPbkFsbFRyYWNrcyA9IHRydWU7Ci0gICAgICAgIGZvciAoc2l6ZV90IGkgPSAwOyBpIDwgc3RhdGVCeVRyYWNrLnNpemUoKTsgKytpKSB7Ci0gICAgICAgICAgICBDb2RlY1N0YXRlICpzdGF0ZSA9ICZzdGF0ZUJ5VHJhY2suZWRpdFZhbHVlQXQoaSk7Ci0gICAgICAgICAgICBpZiAoIXN0YXRlLT5tU2F3T3V0cHV0RU9TKSB7Ci0gICAgICAgICAgICAgICAgc2F3T3V0cHV0RU9TT25BbGxUcmFja3MgPSBmYWxzZTsKLSAgICAgICAgICAgICAgICBicmVhazsKLSAgICAgICAgICAgIH0KLSAgICAgICAgfQotCi0gICAgICAgIGlmIChzYXdPdXRwdXRFT1NPbkFsbFRyYWNrcykgewotICAgICAgICAgICAgYnJlYWs7Ci0gICAgICAgIH0KLQotICAgICAgICBmb3IgKHNpemVfdCBpID0gMDsgaSA8IHN0YXRlQnlUcmFjay5zaXplKCk7ICsraSkgewotICAgICAgICAgICAgQ29kZWNTdGF0ZSAqc3RhdGUgPSAmc3RhdGVCeVRyYWNrLmVkaXRWYWx1ZUF0KGkpOwotCi0gICAgICAgICAgICBpZiAoc3RhdGUtPm1TYXdPdXRwdXRFT1MpIHsKLSAgICAgICAgICAgICAgICBjb250aW51ZTsKLSAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgc2l6ZV90IGluZGV4OwotICAgICAgICAgICAgc2l6ZV90IG9mZnNldDsKLSAgICAgICAgICAgIHNpemVfdCBzaXplOwotICAgICAgICAgICAgaW50NjRfdCBwcmVzZW50YXRpb25UaW1lVXM7Ci0gICAgICAgICAgICB1aW50MzJfdCBmbGFnczsKLSAgICAgICAgICAgIHN0YXR1c190IGVyciA9IHN0YXRlLT5tQ29kZWMtPmRlcXVldWVPdXRwdXRCdWZmZXIoCi0gICAgICAgICAgICAgICAgICAgICZpbmRleCwgJm9mZnNldCwgJnNpemUsICZwcmVzZW50YXRpb25UaW1lVXMsICZmbGFncywKLSAgICAgICAgICAgICAgICAgICAga1RpbWVvdXQpOwotCi0gICAgICAgICAgICBpZiAoZXJyID09IE9LKSB7Ci0gICAgICAgICAgICAgICAgQUxPR1YoImRyYWluaW5nIG91dHB1dCBidWZmZXIgJWQsIHRpbWUgPSAlbGxkIHVzIiwKLSAgICAgICAgICAgICAgICAgICAgICBpbmRleCwgcHJlc2VudGF0aW9uVGltZVVzKTsKLQotICAgICAgICAgICAgICAgICsrc3RhdGUtPm1OdW1CdWZmZXJzRGVjb2RlZDsKLSAgICAgICAgICAgICAgICBzdGF0ZS0+bU51bUJ5dGVzRGVjb2RlZCArPSBzaXplOwotCi0gICAgICAgICAgICAgICAgZXJyID0gc3RhdGUtPm1Db2RlYy0+cmVsZWFzZU91dHB1dEJ1ZmZlcihpbmRleCk7Ci0gICAgICAgICAgICAgICAgQ0hFQ0tfRVEoZXJyLCAoc3RhdH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Y29kZWQsCi0gICAgICAgICAgICAgICAgICAgc3RhdGUtPm1OdW1CeXRlc0RlY29kZWQgKiAxRTYgLyAxMDI0IC8gZWxhcHNlZFRpbWVVcyk7Ci0gICAgICAgIH0KLSAgICB9Ci0KLSAgICByZXR1cm4gMDsKLX0KLQotaW50IG1haW4oaW50IGFyZ2MsIGNoYXIgKiphcmd2KSB7Ci0gICAgdXNpbmcgbmFtZXNwYWNlIGFuZHJvaWQ7Ci0KLSAgICBjb25zdCBjaGFyICptZSA9IGFyZ3ZbMF07Ci0KLSAgICBib29sIHVzZUF1ZGlvID0gZmFsc2U7Ci0gICAgYm9vbCB1c2VWaWRlbyA9IGZhbHNlOwotICAgIGJvb2wgcGxheWJhY2sgPSBmYWxzZTsKLSAgICBib29sIHVzZVN1cmZhY2UgPSBmYWxzZTsKLSAgICBib29sIGRlY3J5cHRJbnB1dEJ1ZmZlcnMgPSBmYWxzZTsKLQotICAgIGludCByZXM7Ci0gICAgd2hpbGUgKChyZXMgPSBnZXRvcHQoYXJnYywgYXJndiwgImhhdnBTRCIpKSA+PSAwKSB7Ci0gICAgICAgIHN3aXRjaCAocmVzKSB7Ci0gICAgICAgICAgICBjYXNlICdhJzoKLSAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICB1c2VBdWRpbyA9IHRydWU7Ci0gICAgICAgICAgICAgICAgYnJlYWs7Ci0gICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgIGNhc2UgJ3YnOgotICAgICAgICAgICAgewotICAgICAgICAgICAgICAgIHVzZVZpZGVvID0gdHJ1ZTsKLSAgICAgICAgICAgICAgICBicmVhazsKLSAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgY2FzZSAncCc6Ci0gICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgcGxheWJhY2sgPSB0cnVlOwotICAgICAgICAgICAgICAgIGJyZWFrOwotICAgICAgICAgICAgfQotCi0gICAgICAgICAgICBjYXNlICdTJzoKLSAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICB1c2VTdXJmYWNlID0gdHJ1ZTsKLSAgICAgICAgICAgICAgICBicmVhazsKLSAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgY2FzZSAnRCc6Ci0gICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgZGVjcnlwdElucHV0QnVmZmVycyA9IHRydWU7Ci0gICAgICAgICAgICAgICAgYnJlYWs7Ci0gICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgIGNhc2UgJz8nOgotICAgICAgICAgICAgY2FzZSAnaCc6Ci0gICAgICAgICAgICBkZWZhdWx0OgotICAgICAgICAgICAgewotICAgICAgICAgICAgICAgIHVzYWdlKG1lKTsKLSAgICAgICAgICAgIH0KLSAgICAgICAgfQotICAgIH0KLQotICAgIGFyZ2MgLT0gb3B0aW5kOwotICAgIGFyZ3YgKz0gb3B0aW5kOwotCi0gICAgaWYgKGFyZ2MgIT0gMSkgewotICAgICAgICB1c2FnZShtZSk7Ci0gICAgfQotCi0gICAgaWYgKCF1c2VBdWRpbyAmJiAhdXNlVmlkZW8pIHsKLSAgICAgICAgdXNlQXVkaW8gPSB1c2VWaWRlbyA9IHRydWU7Ci0gICAgfQotCi0gICAgUHJvY2Vzc1N0YXRlOjpzZWxmKCktPnN0YXJ0VGhyZWFkUG9vbCgpOwotCi0gICAgRGF0YVNvdXJjZTo6UmVnaXN0ZXJEZWZhdWx0U25pZmZlcnMoKTsKLQotICAgIHNwPEFMb29wZXI+IGxvb3BlciA9IG5ldyBBTG9vcGVyOwotICAgIGxvb3Blci0+c3RhcnQoKTsKLQotICAgIHNwPFN1cmZhY2VDb21wb3NlckNsaWVudD4gY29tcG9zZXJDbGllbnQ7Ci0gICAgc3A8U3VyZmFjZUNvbnRyb2w+IGNvbnRyb2w7Ci0gICAgc3A8U3VyZmFjZT4gc3VyZmFjZTsKLQotICAgIGlmIChwbGF5YmFjayB8fCAodXNlU3VyZmFjZSAmJiB1c2VWaWRlbykpIHsKLSAgICAgICAgY29tcG9zZXJDbGllbnQgPSBuZXcgU3VyZmFjZUNvbXBvc2VyQ2xpZW50OwotICAgICAgICBDSEVDS19FUShjb21wb3NlckNsaWVudC0+aW5pdENoZWNrKCksIChzdGF0dXNfdClPSyk7Ci0KLSAgICAgICAgc3NpemVfdCBkaXNwbGF5V2lkdGggPSBjb21wb3NlckNsaWVudC0+Z2V0RGlzcGxheVdpZHRoKDApOwotICAgICAgICBzc2l6ZV90IGRpc3BsYXlIZWlnaHQgPSBjb21wb3NlckNsaWVudC0+Z2V0RGlzcGxheUhlaWdodCgwKTsKLQotICAgICAgICBBTE9HVigiZGlzcGxheSBpcyAlbGQgeCAlbGRcbiIsIGRpc3BsYXlXaWR0aCwgZGlzcGxheUhlaWdodCk7Ci0KLSAgICAgICAgY29udHJvbCA9IGNvbXBvc2VyQ2xpZW50LT5jcmVhdGVTdXJmYWNlKAotICAgICAgICAgICAgICAgIFN0cmluZzgoIkEgU3VyZmFjZSIpLAotICAgICAgICAgICAgICAgIDAsCi0gICAgICAgICAgICAgICAgZGlzcGxheVdpZHRoLAotICAgICAgICAgICAgICAgIGRpc3BsYXlIZWlnaHQsCi0gICAgICAgICAgICAgICAgUElYRUxfRk9STUFUX1JHQl81NjUsCi0gICAgICAgICAgICAgICAgMCk7Ci0KLSAgICAgICAgQ0hFQ0soY29udHJvbCAhPSBOVUxMKTsKLSAgICAgICAgQ0hFQ0soY29udHJvbC0+aXNWYWxpZCgpKTsKLQotICAgICAgICBTdXJmYWNlQ29tcG9zZXJDbGllbnQ6Om9wZW5HbG9iYWxUcmFuc2FjdGlvbigpOwotICAgICAgICBDSEVDS19FUShjb250cm9sLT5zZXRMYXllcihJTlRfTUFYKSwgKHN0YXR1c190KU9LKTsKLSAgICAgICAgQ0hFQ0tfRVEoY29udHJvbC0+c2hvdygpLCAoc3RhdHVzX3QpT0spOwotICAgICAgICBTdXJmYWNlQ29tcG9zZXJDbGllbnQ6OmNsb3NlR2xvYmFsVHJhbnNhY3Rpb24oKTsKL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gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgIGJyZWFrOwotICAgICAgICAgICAgfQotCi0gICAgICAgICAgICBjYXNlICdmJzoKLSAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICBmcmFtZVJhdGVGcHMgPSBhdG9pKG9wdGFyZyk7Ci0gICAgICAgICAgICAgICAgYnJlYWs7Ci0gICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgIGNhc2UgJ2knOgotICAgICAgICAgICAgewotICAgICAgICAgICAgICAgIGlGcmFtZXNJbnRlcnZhbFNlY29uZHMgPSBhdG9pKG9wdGFyZyk7Ci0gICAgICAgICAgICAgICAgYnJlYWs7Ci0gICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgIGNhc2UgJ24nOgotICAgICAgICAgICAgewotICAgICAgICAgICAgICAgIG5GcmFtZXMgPSBhdG9pKG9wdGFyZyk7Ci0gICAgICAgICAgICAgICAgYnJlYWs7Ci0gICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgIGNhc2UgJ3cnOgotICAgICAgICAgICAgewotICAgICAgICAgICAgICAgIHdpZHRoID0gYXRvaShvcHRhcmcpOwotICAgICAgICAgICAgICAgIGJyZWFrOwotICAgICAgICAgICAgfQotCi0gICAgICAgICAgICBjYXNlICd0JzoKLSAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICBoZWlnaHQgPSBhdG9pKG9wdGFyZyk7Ci0gICAgICAgICAgICAgICAgYnJlYWs7Ci0gICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgIGNhc2UgJ2wnOgotICAgICAgICAgICAgewotICAgICAgICAgICAgICAgIGxldmVsID0gYXRvaShvcHRhcmcpOwotICAgICAgICAgICAgICAgIGJyZWFrOwotICAgICAgICAgICAgfQotCi0gICAgICAgICAgICBjYXNlICdwJzoKLSAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICBwcm9maWxlID0gYXRvaShvcHRhcmcpOwotICAgICAgICAgICAgICAgIGJyZWFrOwotICAgICAgICAgICAgfQotCi0gICAgICAgICAgICBjYXNlICd2JzoKLSAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICBjb2RlYyA9IGF0b2kob3B0YXJnKTsKLSAgICAgICAgICAgICAgICBpZiAoY29kZWMgPCAwIHx8IGNvZGVjID4gMikgewotICAgICAgICAgICAgICAgICAgICB1c2FnZShhcmd2WzBdKTsKLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgYnJlYWs7Ci0gICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgIGNhc2UgJ2gnOgotICAgICAgICAgICAgZGVmYXVsdDoKLSAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICB1c2FnZShhcmd2WzBdKTsKLSAgICAgICAgICAgICAgICBicmVhazsKLSAgICAgICAgICAgIH0KLSAgICAgICAgfQotICAgIH0KLQotICAgIE9NWENsaWVudCBjbGllbnQ7Ci0gICAgQ0hFQ0tfRVEoY2xpZW50LmNvbm5lY3QoKSwgKHN0YXR1c190KU9LKTsKLQotICAgIHN0YXR1c190IGVyciA9IE9LOwotICAgIHNwPE1lZGlhU291cmNlPiBzb3VyY2UgPQotICAgICAgICBuZXcgRHVtbXlTb3VyY2Uod2lkdGgsIGhlaWdodCwgbkZyYW1lcywgZnJhbWVSYXRlRnBzLCBjb2xvckZvcm1hdCk7Ci0KLSAgICBzcDxNZXRhRGF0YT4gZW5jX21ldGEgPSBuZXcgTWV0YURhdGE7Ci0gICAgc3dpdGNoIChjb2RlYykgewotICAgICAgICBjYXNlIDE6Ci0gICAgICAgICAgICBlbmNfbWV0YS0+c2V0Q1N0cmluZyhrS2V5TUlNRVR5cGUsIE1FRElBX01JTUVUWVBFX1ZJREVPX01QRUc0KTsKLSAgICAgICAgICAgIGJyZWFrOwotICAgICAgICBjYXNlIDI6Ci0gICAgICAgICAgICBlbmNfbWV0YS0+c2V0Q1N0cmluZyhrS2V5TUlNRVR5cGUsIE1FRElBX01JTUVUWVBFX1ZJREVPX0gyNjMpOwot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3BlciIpOwotICAgICAgICAgICAgICAgIG1EZWNvZGVMb29wZXItPnN0YXJ0KCk7Ci0jZW5kaWYKLQotICAgICAgICAgICAgICAgIHNwPERhdGFTb3VyY2U+IGRhdGFTb3VyY2UgPQotICAgICAgICAgICAgICAgICAgICBEYXRhU291cmNlOjpDcmVhdGVGcm9tVVJJKG1VUkkuY19zdHIoKSk7Ci0KLSAgICAgICAgICAgICAgICBzcDxNZWRpYUV4dHJhY3Rvcj4gZXh0cmFjdG9yID0KLSAgICAgICAgICAgICAgICAgICAgTWVkaWFFeHRyYWN0b3I6OkNyZWF0ZShkYXRhU291cmNlKTsKLQotICAgICAgICAgICAgICAgIGZvciAoc2l6ZV90IGkgPSAwOyBpIDwgZXh0cmFjdG9yLT5jb3VudFRyYWNrcygpOyArK2kpIHsKLSAgICAgICAgICAgICAgICAgICAgc3A8TWV0YURhdGE+IG1ldGEgPSBleHRyYWN0b3ItPmdldFRyYWNrTWV0YURhdGEoaSk7Ci0KLSAgICAgICAgICAgICAgICAgICAgY29uc3QgY2hhciAqbWltZTsKLSAgICAgICAgICAgICAgICAgICAgQ0hFQ0sobWV0YS0+ZmluZENTdHJpbmcoa0tleU1JTUVUeXBlLCAmbWltZSkpOwotCi0gICAgICAgICAgICAgICAgICAgIGlmICghc3RybmNhc2VjbXAobURlY29kZUF1ZGlvID8gImF1ZGlvLyIgOiAidmlkZW8vIiwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBtaW1lLCA2KSkgewotICAgICAgICAgICAgICAgICAgICAgICAgbVNvdXJjZSA9IGV4dHJhY3Rvci0+Z2V0VHJhY2soaSk7Ci0KLSAgICAgICAgICAgICAgICAgICAgICAgIGlmICghc3RyY2FzZWNtcChtaW1lLCBNRURJQV9NSU1FVFlQRV9BVURJT19WT1JCSVMpKSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgbUlzVm9yYmlzID0gdHJ1ZTsKLSAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgbUlzVm9yYmlzID0gZmFsc2U7Ci0gICAgICAgICAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKLSAgICAgICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICBDSEVDSyhtU291cmNlICE9IE5VTEwpOwotCi0gICAgICAgICAgICAgICAgQ0hFQ0tfRVEobVNvdXJjZS0+c3RhcnQoKSwgKHN0YXR1c190KU9LKTsKLQotICAgICAgICAgICAgICAgIG1EZWNvZGVMb29wZXItPnJlZ2lzdGVySGFuZGxlcihtQ29kZWMpOwotCi0gICAgICAgICAgICAgICAgbUNvZGVjLT5zZXROb3RpZmljYXRpb25NZXNzYWdlKAotICAgICAgICAgICAgICAgICAgICAgICAgbmV3IEFNZXNzYWdlKGtXaGF0Q29kZWNOb3RpZnksIGlkKCkpKTsKLQotICAgICAgICAgICAgICAgIHNwPEFNZXNzYWdlPiBmb3JtYXQgPSBtYWtlRm9ybWF0KG1Tb3VyY2UtPmdldEZvcm1hdCgpKTsKLQotICAgICAgICAgICAgICAgIGlmIChtU3VyZmFjZSAhPSBOVUxMKSB7Ci0gICAgICAgICAgICAgICAgICAgIGZvcm1hdC0+c2V0T2JqZWN0KAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICJuYXRpdmUtd2luZG93IiwgbmV3IE5hdGl2ZVdpbmRvd1dyYXBwZXIobVN1cmZhY2UpKTsKLSAgICAgICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgICAgICBtQ29kZWMtPmluaXRpYXRlU2V0dXAoZm9ybWF0KTsKLQotICAgICAgICAgICAgICAgIG1DU0RJbmRleCA9IDA7Ci0gICAgICAgICAgICAgICAgbVN0YXJ0VGltZVVzID0gQUxvb3Blcjo6R2V0Tm93VXMoKTsKLSAgICAgICAgICAgICAgICBtTnVtT3V0cHV0QnVmZmVyc1JlY2VpdmVkID0gMDsKLSAgICAgICAgICAgICAgICBtVG90YWxCeXRlc1JlY2VpdmVkID0gMDsKLSAgICAgICAgICAgICAgICBtTGVmdE92ZXJCdWZmZXIgPSBOVUxMOwotICAgICAgICAgICAgICAgIG1GaW5hbFJlc3VsdCA9IE9LOwotICAgICAgICAgICAgICAgIG1TZWVrU3RhdGUgPSBTRUVLX05PTkU7Ci0KLSAgICAgICAgICAgICAgICAvLyAobmV3IEFNZXNzYWdlKGtXaGF0U2VlaywgaWQoKSkpLT5wb3N0KDUwMDAwMDBsbCk7Ci0gICAgICAgICAgICAgICAgYnJlYWs7Ci0gICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgIGNhc2Uga1doYXRTZWVrOgotICAgICAgICAgICAgewotICAgICAgICAgICAgICAgIHByaW50ZigiKyIpOwotICAgICAgICAgICAgICAgIGZmbHVzaChzdGRvdXQpOwotCi0gICAgICAgICAgICAgICAgQ0hFQ0sobVNlZWtTdGF0ZSA9PSBTRUVLX05PTkUKLSAgICAgICAgICAgICAgICAgICAgICAgIHx8IG1TZWVrU3RhdGUgPT0gU0VFS19GTFVTSF9DT01QTEVURUQpOwotCi0gICAgICAgICAgICAgICAgaWYgKG1MZWZ0T3ZlckJ1ZmZlciAhPSBOVUxMKSB7Ci0gICAgICAgICAgICAgICAgICAgIG1MZWZ0T3ZlckJ1ZmZlci0+cmVsZWFzZSgpOwotICAgICAgICAgICAgICAgICAgICBtTGVmdE92ZXJCdWZmZXIgPSBOVUxMOwotICAgICAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgICAgIG1TZWVrU3RhdGUgPSBTRUVLX0ZMVVNISU5HOwotICAgICAgICAgICAgICAgIG1TZWVrVGltZVVzID0gMzAwMDAwMDBsbDsKLQotICAgICAgICAgICAgICAgIG1Db2RlYy0+c2lnbmFsRmx1c2goKTsKLSAgICAgICAgICAgICAgICBicmVhazsKLSAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgY2FzZSBrV2hhdFN0b3A6Ci0gICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgaWYgKG1MZWZ0T3ZlckJ1ZmZlciAhPSBOVUxMKSB7Ci0gICAgICAgICAgICAgICAgICAgIG1MZWZ0T3ZlckJ1ZmZlci0+cmVsZWFzZSgpOwotICAgICAgICAgICAgICAgICAgICBtTGVmdE92ZXJCdWZmZXIgPSBOVUxMOwotICAgICAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgICAgIENIRUNLX0VRKG1Tb3VyY2UtPnN0b3AoKSwgKHN0YXR1c190KU9LKTsKLSAgICAgICAgICAgICAgICBtU291cmNlLmNsZWFyKCk7Ci0KLSAgICAgICAgICAgICAgICBtQ29kZWMtPmluaXRpYXRlU2h1dGRvd24oKTsKLSAgICAgICAgICAgICAgICBicmVhazsKLSAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgY2FzZSBrV2hhdENvZGVjTm90aWZ5OgotICAgICAgICAgICAgewotICAgICAgICAgICAgICAgIGludDMyX3Qgd2hhdDsKLSAgICAgICAgICAgICAgICBDSEVDSyhtc2ctPmZpbmRJbnQzMigid2hhdCIsICZ3aGF0KSk7Ci0KLSAgICAgICAgICAgICAgICBpZiAod2hhdCA9PSBBQ29kZWM6OmtXaGF0RmlsbFRoaXNCdWZmZXIpIHsKLSAgICAgICAgICAgICAgICAgICAgb25GaWxsVGhpc0J1ZmZlcihtc2cpOwotICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAod2hhdCA9PSBBQ29kZWM6OmtXaGF0RHJhaW5UaGlzQnVmZmVyKSB7Ci0gICAgICAgICAgICAgICAgICAgIGlmICgobU51bU91dHB1dEJ1ZmZlcnNSZWNlaXZlZCsrICUgMTYpID09IDApIHsKLSAgICAgICAgICAgICAgICAgICAgICAgIHByaW50ZigiLiIpOwotICAgICAgICAgICAgICAgICAgICAgICAgZmZsdXNoKHN0ZG91dCk7Ci0gICAgICAgICAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgICAgICAgICBvbkRyYWluVGhpc0J1ZmZlcihtc2cpOwotICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAod2hhdCA9PSBBQ29kZWM6OmtXaGF0RU9TCi0gICAgICAgICAgICAgICAgICAgICAgICB8fCB3aGF0ID09IEFDb2RlYzo6a1doYXRFcnJvcikgewotICAgICAgICAgICAgICAgICAgICBwcmludGYoKHdoYXQgPT0gQUNvZGVjOjprV2hhdEVPUykgPyAiJFxuIiA6ICJFXG4iKTsKLQotICAgICAgICAgICAgICAgICAgICBpbnQ2NF90IGRlbGF5VXMgPSBBTG9vcGVyOjpHZXROb3dVcygpIC0gbVN0YXJ0VGltZVVzOwotCi0gICAgICAgICAgICAgICAgICAgIGlmIChtRGVjb2RlQXVkaW8pIHsKLSAgICAgICAgICAgICAgICAgICAgICAgIHByaW50ZigiJWxsZCBieXRlcyByZWNlaXZlZC4gJS4yZiBLQi9zZWNcbiIsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbVRvdGFsQnl0ZXNSZWNlaXZlZCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBtVG90YWxCeXRlc1JlY2VpdmVkICogMUU2IC8gMTAyNCAvIGRlbGF5VXMpOwotICAgICAgICAgICAgICAgICAgICB9IGVsc2UgewotICAgICAgICAgICAgICAgICAgICAgICAgcHJpbnRmKCIlZCBmcmFtZXMgZGVjb2RlZCwgJS4yZiBmcHMuICVsbGQgYnl0ZXMgIgotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICJyZWNlaXZlZC4gJS4yZiBLQi9zZWNcbiIsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbU51bU91dHB1dEJ1ZmZlcnNSZWNlaXZlZCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBtTnVtT3V0cHV0QnVmZmVyc1JlY2VpdmVkICogMUU2IC8gZGVsYXlVcywKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBtVG90YWxCeXRlc1JlY2VpdmVkLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1Ub3RhbEJ5dGVzUmVjZWl2ZWQgKiAxRTYgLyAxMDI0IC8gZGVsYXlVcyk7Ci0gICAgICAgICAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgICAgICAgICAobmV3IEFNZXNzYWdlKGtXaGF0U3RvcCwgaWQoKSkpLT5wb3N0KCk7Ci0gICAgICAgICAgICAgICAgfSBlbHNlIGlmICh3aGF0ID09IEFDb2RlYzo6a1doYXRGbHVzaENvbXBsZXRlZCkgewotICAgICAgICAgICAgICAgICAgICBtU2Vla1N0YXRlID0gU0VFS19GTFVTSF9DT01QTEVURUQ7Ci0gICAgICAgICAgICAgICAgICAgIG1Db2RlYy0+c2lnbmFsUmVzdW1lKCk7Ci0KLSAgICAgICAgICAgICAgICAgICAgKG5ldyBBTWVzc2FnZShrV2hhdFNlZWssIGlkKCkpKS0+cG9zdCg1MDAwMDAwbGwpOwotICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAod2hhdCA9PSBBQ29kZWM6OmtXaGF0T3V0cHV0Rm9ybWF0Q2hhbmdlZCkgewotICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAod2hhdCA9PSBBQ29kZWM6OmtXaGF0U2h1dGRvd25Db21wbGV0ZWQpIHsKLSAgICAgICAgICAgICAgICAgICAgbURlY29kZUxvb3Blci0+dW5yZWdpc3RlckhhbmRsZXIobUNvZGVjLT5pZCgpKTsKLQotICAgICAgICAgICAgICAgICAgICBpZiAobURlY29kZUxvb3BlciAhPSBsb29wZXIoKSkgewotICAgICAgICAgICAgICAgICAgICAgICAgbURlY29kZUxvb3Blci0+c3RvcCgpOwotICAgICAgICAgICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgICAgICAgICAgbG9vcGVyKCktPnN0b3AoKTsKLSAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKHdoYXQgPT0gQUNvZGVjOjprV2hhdEVycm9yKSB7Ci0gICAgICAgICAgICAgICAgICAgIEFMT0dFKCJzb21ldGhpbmcgd2Vud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IXN0cm5jYXNlY21wKCJhdWRpby8iLCBtaW1lLCA2KSk7Ci0KLSAgICAgICAgICAgIGludDMyX3QgbnVtQ2hhbm5lbHMsIHNhbXBsZVJhdGU7Ci0gICAgICAgICAgICBDSEVDSyhtZXRhLT5maW5kSW50MzIoa0tleUNoYW5uZWxDb3VudCwgJm51bUNoYW5uZWxzKSk7Ci0gICAgICAgICAgICBDSEVDSyhtZXRhLT5maW5kSW50MzIoa0tleVNhbXBsZVJhdGUsICZzYW1wbGVSYXRlKSk7Ci0KLSAgICAgICAgICAgIG1zZy0+c2V0SW50MzIoImNoYW5uZWwtY291bnQiLCBudW1DaGFubmVscyk7Ci0gICAgICAgICAgICBtc2ctPnNldEludDMyKCJzYW1wbGUtcmF0ZSIsIHNhbXBsZVJhdGUpOwotCi0gICAgICAgICAgICBpbnQzMl90IGlzQURUUzsKLSAgICAgICAgICAgIGlmIChtZXRhLT5maW5kSW50MzIoa0tleUlzQURUUywgJmlzQURUUykgJiYgaXNBRFRTICE9IDApIHsKLSAgICAgICAgICAgICAgICBtc2ctPnNldEludDMyKCJpcy1hZHRzIiwgdHJ1ZSk7Ci0gICAgICAgICAgICB9Ci0gICAgICAgIH0KLQotICAgICAgICB1aW50MzJfdCB0eXBlOwotICAgICAgICBjb25zdCB2b2lkICpkYXRhOwotICAgICAgICBzaXplX3Qgc2l6ZTsKLSAgICAgICAgaWYgKG1ldGEtPmZpbmREYXRhKGtLZXlBVkNDLCAmdHlwZSwgJmRhdGEsICZzaXplKSkgewotICAgICAgICAgICAgLy8gUGFyc2UgdGhlIEFWQ0RlY29kZXJDb25maWd1cmF0aW9uUmVjb3JkCi0KLSAgICAgICAgICAgIGNvbnN0IHVpbnQ4X3QgKnB0ciA9IChjb25zdCB1aW50OF90ICopZGF0YTsKLQotICAgICAgICAgICAgQ0hFQ0soc2l6ZSA+PSA3KTsKLSAgICAgICAgICAgIENIRUNLX0VRKCh1bnNpZ25lZClwdHJbMF0sIDF1KTsgIC8vIGNvbm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Z3RoID0gVTE2X0FUKHB0cik7Ci0KLSAgICAgICAgICAgICAgICBwdHIgKz0gMjsKLSAgICAgICAgICAgICAgICBzaXplIC09IDI7Ci0KLSAgICAgICAgICAgICAgICBDSEVDSyhzaXplID49IGxlbmd0aCk7Ci0KLSAgICAgICAgICAgICAgICBtZW1jcHkoYnVmZmVyLT5kYXRhKCkgKyBidWZmZXItPnNpemUoKSwgIlx4MDBceDAwXHgwMFx4MDEiLCA0KTsKLSAgICAgICAgICAgICAgICBtZW1jcHkoYnVmZmVyLT5kYXRhKCkgKyBidWZmZXItPnNpemUoKSArIDQsIHB0ciwgbGVuZ3RoKTsKLSAgICAgICAgICAgICAgICBidWZmZXItPnNldFJhbmdlKDAsIGJ1ZmZlci0+c2l6ZSgpICsgNCArIGxlbmd0aCk7Ci0KLSAgICAgICAgICAgICAgICBwdHIgKz0gbGVuZ3RoOwotICAgICAgICAgICAgICAgIHNpemUgLT0gbGVuZ3RoOwotICAgICAgICAgICAgfQotCi0gICAgICAgICAgICBidWZmZXItPm1ldGEoKS0+c2V0SW50MzIoImNzZCIsIHRydWUpOwotICAgICAgICAgICAgbUNTRC5wdXNoKGJ1ZmZlcik7Ci0KLSAgICAgICAgICAgIGJ1ZmZlciA9IG5ldyBBQnVmZmVyKDEwMjQpOwotICAgICAgICAgICAgYnVmZmVyLT5zZXRSYW5nZSgwLCAwKTsKLQotICAgICAgICAgICAgQ0hFQ0soc2l6ZSA+PSAxKTsKLSAgICAgICAgICAgIHNpemVfdCBudW1QaWN0dXJlUGFyYW1ldGVyU2V0cyA9ICpwdHI7Ci0gICAgICAgICAgICArK3B0cjsKLSAgICAgICAgICAgIC0tc2l6ZTsKLQotICAgICAgICAgICAgZm9yIChzaXplX3QgaSA9IDA7IGkgPCBudW1QaWN0dXJlUGFyYW1ldGVyU2V0czsgKytpKSB7Ci0gICAgICAgICAgICAgICAgQ0hFQ0soc2l6ZSA+PSAyKTsKLSAgICAgICAgICAgICAgICBzaXplX3QgbGVuZ3RoID0gVTE2X0FUKHB0cik7Ci0KLSAgICAgICAgICAgICAgICBwdHIgKz0gMjsKLSAgICAgICAgICAgICAgICBzaXplIC09IDI7Ci0KLSAgICAgICAgICAgICAgICBDSEVDSyhzaXplID49IGxlbmd0aCk7Ci0KLSAgICAgICAgICAgICAgICBtZW1jcHkoYnVmZmVyLT5kYXRhKCkgKyBidWZmZXItPnNpemUoKSwgIlx4MDBceDAwXHgwMFx4MDEiLCA0KTsKLSAgICAgICAgICAgICAgICBtZW1jcHkoYnVmZmVyLT5kYXRhKCkgKyBidWZmZXItPnNpemUoKSArIDQsIHB0ciwgbGVuZ3RoKTsKLSAgICAgICAgICAgICAgICBidWZmZXItPnNldFJhbmdlKDAsIGJ1ZmZlci0+c2l6ZSgpICsgNCArIGxlbmd0aCk7Ci0KLSAgICAgICAgICAgICAgICBwdHIgKz0gbGVuZ3RoOwotICAgICAgICAgICAgICAgIHNpemUgLT0gbGVuZ3RoOwotICAgICAgICAgICAgfQotCi0gICAgICAgICAgICBidWZmZXItPm1ldGEoKS0+c2V0SW50MzIoImNzZCIsIHRydWUpOwotICAgICAgICAgICAgbUNTRC5wdXNoKGJ1ZmZlcik7Ci0KLSAgICAgICAgICAgIG1zZy0+c2V0QnVmZmVyKCJjc2QiLCBidWZmZXIpOwotICAgICAgICB9IGVsc2UgaWYgKG1ldGEtPmZpbmREYXRhKGtLZXlFU0RTLCAmdHlwZSwgJmRhdGEsICZzaXplKSkgewotICAgICAgICAgICAgRVNEUyBlc2RzKChjb25zdCBjaGFyICopZGF0YSwgc2l6ZSk7Ci0gICAgICAgICAgICBDSEVDS19FUShlc2RzLkluaXRDaGVjaygpLCAoc3RhdHVzX3QpT0spOwotCi0gICAgICAgICAgICBjb25zdCB2b2lkICpjb2RlY19zcGVjaWZpY19kYXRhOwotICAgICAgICAgICAgc2l6ZV90IGNvZGVjX3NwZWNpZmljX2RhdGFfc2l6ZTsKLSAgICAgICAgICAgIGVzZHMuZ2V0Q29kZWNTcGV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XplTGVmdCA9IG91dEJ1ZmZlci0+Y2FwYWNpdHkoKTsKLSAgICAgICAgICAgIG91dEJ1ZmZlci0+c2V0UmFuZ2UoMCwgMCk7Ci0KLSAgICAgICAgICAgIGludDMyX3QgbiA9IDA7Ci0KLSAgICAgICAgICAgIGZvciAoOzspIHsKLSAgICAgICAgICAgICAgICBNZWRpYUJ1ZmZlciAqaW5CdWZmZXI7Ci0KLSAgICAgICAgICAgICAgICBpZiAobUxlZnRPdmVyQnVmZmVyICE9IE5VTEwpIHsKLSAgICAgICAgICAgICAgICAgICAgaW5CdWZmZXIgPSBtTGVmdE92ZXJCdWZmZXI7Ci0gICAgICAgICAgICAgICAgICAgIG1MZWZ0T3ZlckJ1ZmZlciA9IE5VTEw7Ci0gICAgICAgICAgICAgICAgfSBlbHNlIGlmIChtRmluYWxSZXN1bHQgIT0gT0spIHsKLSAgICAgICAgICAgICAgICAgICAgYnJlYWs7Ci0gICAgICAgICAgICAgICAgfSBlbHNlIHsKLSAgICAgICAgICAgICAgICAgICAgTWVkaWFTb3VyY2U6OlJlYWRPcHRpb25zIG9wdGlvbnM7Ci0gICAgICAgICAgICAgICAgICAgIGlmIChtU2Vla1N0YXRlID09IFNFRUtfRkxVU0hfQ09NUExFVEVEKSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICBvcHRpb25zLnNldFNlZWtUbyhtU2Vla1RpbWVVcyk7Ci0gICAgICAgICAgICAgICAgICAgICAgICBtU2Vla1N0YXRlID0gU0VFS19OT05FOwotICAgICAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgICAgIHN0YXR1c190IGVyciA9IG1Tb3VyY2UtPnJlYWQoJmluQnVmZmVyLCAmb3B0aW9ucyk7Ci0KLSAgICAgICAgICAgICAgICAgICAgaWYgKGVyciAhPSBPSykgewotICAgICAgICAgICAgICAgICAgICAgICAgbUZpbmFsUmVzdWx0ID0gZXJyOwotICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7Ci0gICAgICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgICAgICBzaXplX3Qgc2l6ZU5lZWRlZCA9IGluQnVmZmVyLT5yYW5nZV9sZW5ndGgoKTsKLSAgICAgICAgICAgICAgICBpZiAobUlzVm9yYmlzKSB7Ci0gICAgICAgICAgICAgICAgICAgIC8vIFZvcmJpcyBkYXRhIGlzIHN1ZmZpeGVkIHdpdGggdGhlIG51bWJlciBvZgotICAgICAgICAgICAgICAgICAgICAvLyB2YWxpZCBzYW1wbGVzIG9uIHRoZSBwYWdlLgotICAgICAgICAgICAgICAgICAgICBzaXplTmVlZGVkICs9IHNpemVvZihpbnQzMl90KTsKLSAgICAgICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgICAgICBpZiAoc2l6ZU5lZWRlZCA+IHNpemVMZWZ0KSB7Ci0gICAgICAgICAgICAgICAgICAgIGlmIChvdXRCdWZmZXItPnNpemUoKSA9PSAwKSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICBBTE9HRSgiVW5hYmxlIHRvIGZpdCBldmVuIGEgc2luZ2xlIGlucHV0IGJ1ZmZlciBvZiBzaXplICVkLiIsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNpemVOZWVkZWQpOwotICAgICAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgICAgIENIRUNLX0dUKG91dEJ1ZmZlci0+c2l6ZSgpLCAwdSk7Ci0KLSAgICAgICAgICAgICAgICAgICAgbUxlZnRPdmVyQnVmZmVyID0gaW5CdWZmZXI7Ci0gICAgICAgICAgICAgICAgICAgIGJyZWFrOwotICAgICAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgICAgICsrbjsKLQotICAgICAgICAgICAgICAgIGlmIChvdXRCdWZmZXItPnNpemUoKSA9PSAwKSB7Ci0gICAgICAgICAgICAgICAgICAgIGludDY0X3QgdGltZVVzOwotICAgICAgICAgICAgICAgICAgICBDSEVDSyhpbkJ1ZmZlci0+bWV0YV9kYXRhKCktPmZpbmRJbnQ2NChrS2V5VGltZSwgJnRpbWVVcykpOwotCi0gICAgICAgICAgICAgICAgICAgIG91dEJ1ZmZlci0+bWV0YSgpLT5zZXRJbnQ2NCgidGltZVVzIiwgdGltZVVzKTsKLSAgICAgICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgICAgICBtZW1jcHkob3V0QnVmZmVyLT5kYXRhKCkgKyBvdXRCdWZmZXItPnNpemUoKSwKLSAgICAgICAgICAgICAgICAgICAgICAgKGNvbnN0IHVpbnQ4X3QgKilpbkJ1ZmZlci0+ZGF0YSgpCi0gICAgICAgICAgICAgICAgICAgICAgICArIGluQnVmZmVyLT5yYW5nZV9vZmZzZXQoKSwKLSAgICAgICAgICAgICAgICAgICAgICAgaW5CdWZmZXItPnJhbmdlX2xlbmd0aCgpKTsKLQotICAgICAgICAgICAgICAgIGlmIChtSXNWb3JiaXMpIHsKLSAgICAgICAgICAgICAgICAgICAgaW50MzJfdCBudW1QYWdlU2FtcGxlczsKLSAgICAgICAgICAgICAgICAgICAgaWYgKCFpbkJ1ZmZlci0+bWV0YV9kYXRhKCktPmZpbmRJbnQzMigKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAga0tleVZhbGlkU2FtcGxlcywgJm51bVBhZ2VTYW1wbGVzKSkgewotICAgICAgICAgICAgICAgICAgICAgICAgbnVtUGFnZVNhbXBsZXMgPSAtMTsKLSAgICAgICAgICAgICAgICAgICAgfQotCi0gICAgICAgICAgICAgICAgICAgIG1lbWNweShvdXRCdWZmZXItPmRhdGEoKQotICAgICAgICAgICAgICAgICAgICAgICAgICAgICsgb3V0QnVmZmVyLT5zaXplKCkgKyBpbkJ1ZmZlci0+cmFuZ2VfbGVuZ3RoKCksCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAmbnVtUGFnZVNhbXBsZXMsIHNpemVvZihudW1QYWdlU2FtcGxlcykpOwotICAgICAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgICAgIG91dEJ1ZmZlci0+c2V0UmFuZ2UoCi0gICAgICAgICAgICAgICAgICAgICAgICAwLCBvdXRCdWZmZXItPnNpemUoKSArIHNpemVOZWVkZWQpOwotCi0gICAgICAgICAgICAgICAgc2l6ZUxlZnQgLT0gc2l6ZU5lZWRlZDsKLQotICAgICAgICAgICAgICAgIGluQnVmZmVyLT5yZWxlYXNlKCk7Ci0gICAgICAgICAgICAgICAgaW5CdWZmZXIgPSBOVUxMOwotCi0gICAgICAgICAgICAgICAgYnJlYWs7ICAvLyBEb24ndCBjb2FsZXNjZQotICAgICAgICAgICAgfQotCi0gICAgICAgICAgICBBTE9HVigiY29hbGVzY2VkICVkIGlucHV0IGJ1ZmZlcnMiLCBuKTsKLQotICAgICAgICAgICAgaWYgKG91dEJ1ZmZlci0+c2l6ZSgpID09IDApIHsKLSAgICAgICAgICAgICAgICBDSEVDS19ORShtRmluYWxSZXN1bHQsIChzdGF0dXNfdClPSyk7Ci0KLSAgICAgICAgICAgICAgICByZXBseS0+c2V0SW50MzIoImVyciIsIG1GaW5hbFJlc3VsdCk7Ci0gICAgICAgICAgICAgICAgcmVwbHktPnBvc3QoKTsKLSAgICAgICAgICAgICAgICByZXR1cm47Ci0gICAgICAgICAgICB9Ci0gICAgICAgIH0KLQotICAgICAgICByZXBseS0+c2V0QnVmZmVyKCJidWZmZXIiLCBvdXRCdWZmZXIpOwotICAgICAgICByZXBseS0+cG9zdCgpOwotICAgIH0KLQotICAgIHZvaWQgb25EcmFpblRoaXNCdWZmZXIoY29uc3Qgc3A8QU1lc3NhZ2U+ICZtc2cpIHsKLSAgICAgICAgc3A8QUJ1ZmZlcj4gYnVmZmVyOwotICAgICAgICBDSEVDSyhtc2ctPmZpbmRCdWZmZXIoImJ1ZmZlciIsICZidWZmZXIpKTsKLQotICAgICAgICBtVG90YWxCeXRlc1JlY2VpdmVkICs9IGJ1ZmZlci0+c2l6ZSgpOwotCi0gICAgICAgIHNwPEFNZXNzYWdlPiByZXBseTsKLSAgICAgICAgQ0hFQ0sobXNnLT5maW5kTWVzc2FnZSgicmVwbHkiLCAmcmVwbHkpKTsKLQotICAgICAgICBpZiAobVJlbmRlclRvU3VyZmFjZSkgewotICAgICAgICAgICAgcmVwbHktPnNldEludDMyKCJyZW5kZXIiLCAxKTsKLSAgICAgICAgfQotCi0gICAgICAgIHJlcGx5LT5wb3N0KCk7Ci0gICAgfQotCi0gICAgRElTQUxMT1dfRVZJTF9DT05TVFJVQ1RPUlMoQ29udHJvbGxlcik7Ci19OwotCi1zdGF0aWMgdm9pZCB1c2FnZShjb25zdCBjaGFyICptZSkgewotICAgIGZwcmludGYoc3RkZXJyLCAidXNhZ2U6ICVzXG4iLCBtZSk7Ci0gICAgZnByaW50ZihzdGRlcnIsICIgICAgICAgLWgoZWxwKVxuIik7Ci0gICAgZnByaW50ZihzdGRlcnIsICIgICAgICAgLWEodWRpbylcbiIpOwotCi0gICAgZnByaW50ZihzdGRlcnIsCi0gICAgICAgICAgICAiICAgICAgIC1TKHVyZmFjZSkgQWxsb2NhdGUgb3V0cHV0IGJ1ZmZlcnMgb24gYSBzdXJmYWNlLlxuIgotICAgICAgICAgICAgIiAgICAgICAtUihlbmRlcikgIFJlbmRlciBzdXJmYWNlLWFsbG9jYXRlZCBidWZmZXJzLlxuIik7Ci19Ci0KLWludCBtYWluKGludCBhcmdjLCBjaGFyICoqYXJndikgewotICAgIGFuZHJvaWQ6OlByb2Nlc3NTdGF0ZTo6c2VsZigpLT5zdGFydFRocmVhZFBvb2woKTsKLQotICAgIGJvb2wgZGVjb2RlQXVkaW8gPSBmYWxzZTsKLSAgICBib29sIHVzZVN1cmZhY2UgPSBmYWxzZTsKLSAgICBib29sIHJlbmRlclRvU3VyZmFjZSA9IGZhbHNlOwotCi0gICAgaW50IHJlczsKLSAgICB3aGlsZSAoKHJlcyA9IGdldG9wdChhcmdjLCBhcmd2LCAiaGFTUiIpKSA+PSAwKSB7Ci0gICAgICAgIHN3aXRjaCAocmVzKSB7Ci0gICAgICAgICAgICBjYXNlICdhJzoKLSAgICAgICAgICAgICAgICBkZWNvZGVBdWRpbyA9IHRydWU7Ci0gICAgICAgICAgICAgICAgYnJlYWs7Ci0KLSAgICAgICAgICAgIGNhc2UgJ1MnOgotICAgICAgICAgICAgICAgIHVzZVN1cmZhY2UgPSB0cnVlOwotICAgICAgICAgICAgICAgIGJyZWFrOwotCi0gICAgICAgICAgICBjYXNlICdSJzoKLSAgICAgICAgICAgICAgICByZW5kZXJUb1N1cmZhY2UgPSB0cnVlOwotICAgICAgICAgICAgICAgIGJyZWFrOwotCi0gICAgICAgICAgICBjYXNlICc/JzoKLSAgICAgICAgICAgIGNhc2UgJ2gnOgotICAgICAgICAgICAgZGVmYXVsdDoKLSAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICB1c2FnZShhcmd2WzBdKTsKLSAgICAgICAgICAgICAgICByZXR1cm4gMTsKLSAgICAgICAgICAgIH0KLSAgICAgICAgfQotICAgIH0KLQotICAgIGFyZ2MgLT0gb3B0aW5kOwotICAgIGFyZ3YgKz0gb3B0aW5kOwotCi0gICAgaWYgKGFyZ2MgIT0gMSkgewotICAgICAgICB1c2FnZShhcmd2Wy1vcHRpbmRdKTsKLSAgICAgICAgcmV0dXJuIDE7Ci0gICAgfQotCi0gICAgRGF0YVNvdXJjZTo6UmVnaXN0ZXJEZWZhdWx0U25pZmZlcnMoKTsKLQotICAgIHNwPEFMb29wZXI+IGxvb3BlciA9IG5ldyBBTG9vcGVyOwotICAgIGxvb3Blci0+c2V0TmFtZSgic2YyIik7Ci0KLSAgICBzcDxTdXJmYWNlQ29tcG9zZXJDbGllbnQ+IGNvbXBvc2VyQ2xpZW50OwotICAgIHNwPFN1cmZhY2VDb250cm9sPiBjb250cm9sOwotICAgIHNwPFN1cmZhY2U+IHN1cmZhY2U7Ci0KLSAgICBpZiAoIWRlY29kZUF1ZGlvICYmIHVzZVN1cmZhY2UpIHsKLSAgICAgICAgY29tcG9zZXJDbGllbnQgPSBuZXcgU3VyZmFjZUNvbXBvc2VyQ2xpZW50OwotICAgICAgICBDSEVDS19FUShjb21wb3NlckNsaWVudC0+aW5pdENoZWNrKCksIChzdGF0dXNfdClPSyk7Ci0KLSAgICAgICAgY29udHJvbCA9IGNvbXBvc2VyQ2xpZW50LT5jcmVhdGVTdXJmYWNlKAotICAgICAgICAgICAgICAgIFN0cmluZzgoIkEgU3VyZmFjZSIpLAotICAgICAgICAgICAgICAgIDAsCi0gICAgICAgICAgICAgICAgMTI4MCwKLSAgICAgICAgICAgICAgICA4MDAsCi0gICAgICAgICAgICAgICAgUElYRUxfRk9STUFUX1JHQl81NjUsCi0gICAgICAgICAgICAgICAgMCk7Ci0KLSAgICAgICAgQ0hFQ0soY29udHJvbCAhPSBOVUxMKTsKLSAgICAgICAgQ0hFQ0soY29udHJvbC0+aXNWYWxpZCgpKTsKLQotICAgICAgICBTdXJmYWNlQ29tcG9zZXJDbGllbnQ6Om9wZW5HbG9iYWxUcmFuc2FjdGlvbigpOwotICAgICAgICBDSEVDS19FUShjb250cm9sLT5zZXRMYXllcihJTlRfTUFYKSwgKHN0YXR1c190KU9LKTsKLSAgICAgICAgQ0hFQ0tfRVEoY29udHJvbC0+c2hvdygpLCAoc3RhdHVzX3QpT0spOwotICAgICAgICBTdXJmYWNlQ29tcG9zZXJDbGllbnQ6OmNsb3NlR2xvYmFsVHJhbnNhY3Rpb24oKTsKLQotICAgICAgICBzdXJmYWNlID0gY29udHJvbC0+Z2V0U3VyZmFjZSgpOwotICAgICAgICBDSEVDSyhzdXJmYWNlICE9IE5VTEwpOwotCi0gICAgICAgIENIRUNLX0VRKChzdGF0dXNfdClPSywKLSAgICAgICAgICAgICAgICAgbmF0aXZlX3dpbmRvd19hcGlfY29ubmVjdCgKLSAgICAgICAgICAgICAgICAgICAgIHN1cmZhY2UuZ2V0KCksIE5BVElWRV9XSU5ET1dfQVBJX01FRElBKSk7Ci0gICAgfQotCi0gICAgc3A8Q29udHJvbGxlcj4gY29udHJvbGxlciA9Ci0gICAg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S0+ZmluZENTdHJpbmcoa0tleU1JTUVUeXBlLCAmbWltZSkpOwotCi0gICAgc3A8TWVkaWFTb3VyY2U+IHJhd1NvdXJjZTsKLSAgICBpZiAoIXN0cmNhc2VjbXAoTUVESUFfTUlNRVRZUEVfQVVESU9fUkFXLCBtaW1lKSkgewotICAgICAgICByYXdTb3VyY2UgPSBzb3VyY2U7Ci0gICAgfSBlbHNlIHsKLSAgICAgICAgaW50IGZsYWdzID0gMDsKLSAgICAgICAgaWYgKGdQcmVmZXJTb2Z0d2FyZUNvZGVjKSB7Ci0gICAgICAgICAgICBmbGFncyB8PSBPTVhDb2RlYzo6a1ByZWZlclNvZnR3YXJlQ29kZWNzOwotICAgICAgICB9Ci0gICAgICAgIGlmIChnRm9yY2VUb1VzZUhhcmR3YXJlQ29kZWMpIHsKLSAgICAgICAgICAgIENIRUNLKCFnUHJlZmVyU29mdHdhcmVDb2RlYyk7Ci0gICAgICAgICAgICBmbGFncyB8PSBPTVhDb2RlYzo6a0hhcmR3YXJlQ29kZWNzT25seTsKLSAgICAgICAgfQotICAgICAgICByYXdTb3VyY2UgPSBPTVhDb2RlYzo6Q3JlYXRlKAotICAgICAgICAgICAgY2xpZW50LT5pbnRlcmZhY2UoKSwgbWV0YSwgZmFsc2UgLyogY3JlYXRlRW5jb2RlciAqLywgc291cmNlLAotICAgICAgICAgICAgTlVMTCAvKiBtYXRjaENvbXBvbmVudE5hbWUgKi8sCi0gICAgICAgICAgICBmbGFncywKLSAgICAgICAgICAgIGdTdXJmYWNlKTsKLQotICAgICAgICBpZiAocmF3U291cmNlID09IE5VTEwpIHsKLSAgICAgICAgICAgIGZwcmludGYoc3RkZXJyLCAiRmFpbGVkIHRvIGluc3RhbnRpYXRlIGRlY29kZXIgZm9yICclcycuXG4iLCBtaW1lKTsKLSAgICAgICAgICAgIHJldHVybjsKLSAgICAgICAgfQotICAgICAgICBkaXNwbGF5QVZDUHJvZmlsZUxldmVsSWZQb3NzaWJsZShtZXRhKTsKLSA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b25zOwotICAgICAgICBpbnQ2NF90IHNlZWtUaW1lVXMgPSAtMTsKLSAgICAgICAgZm9yICg7OykgewotICAgICAgICAgICAgZXJyID0gcmF3U291cmNlLT5yZWFkKCZidWZmZXIsICZvcHRpb25zKTsKLSAgICAgICAgICAgIG9wdGlvbnMuY2xlYXJTZWVrVG8oKTsKLQotICAgICAgICAgICAgYm9vbCBzaG91bGRTZWVrID0gZmFsc2U7Ci0gICAgICAgICAgICBpZiAoZXJyID09IElORk9fRk9STUFUX0NIQU5HRUQpIHsKLSAgICAgICAgICAgICAgICBDSEVDSyhidWZmZXIgPT0gTlVMTCk7Ci0KLSAgICAgICAgICAgICAgICBwcmludGYoImZvcm1hdCBjaGFuZ2VkLlxuIik7Ci0gICAgICAgICAgICAgICAgY29udGludWU7Ci0gICAgICAgICAgICB9IGVsc2UgaWYgKGVyciAhPSBPSykgewotICAgICAgICAgICAgICAgIHByaW50ZigicmVhY2hlZCBFT0YuXG4iKTsKLQotICAgICAgICAgICAgICAgIHNob3VsZFNlZWsgPSB0cnVlOwotICAgICAgICAgICAgfSBlbHNlIHsKLSAgICAgICAgICAgICAgICBpbnQ2NF90IHRpbWVzdGFtcFVzOwotICAgICAgICAgICAgICAgIENIRUNLKGJ1ZmZlci0+bWV0YV9kYXRhKCktPmZpbmRJbnQ2NChrS2V5VGltZSwgJnRpbWVzdGFtcFVzKSk7Ci0KLSAgICAgICAgICAgICAgICBib29sIGZhaWxlZCA9IGZhbHNlOwotCi0gICAgICAgICAgICAgICAgaWYgKHNlZWtUaW1lVXMgPj0gMCkgewotICAgICAgICAgICAgICAgICAgICBpbnQ2NF90IGRpZmYgPSB0aW1lc3RhbXBVcyAtIHNlZWtUaW1lVXM7Ci0KLSAgICAgICAgICAgICAgICAgICAgaWYgKGRpZmYgPCAwKSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICBkaWZmID0gLWRpZmY7Ci0gICAgICAgICAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgICAgICAgICBpZiAoKGdSZXByb2R1Y2VCdWcgPT0gNCAmJiBkaWZmID4gNTAwMDAwKQotICAgICAgICAgICAgICAgICAgICAgICAgfHwgKGdSZXByb2R1Y2VCdWcgPT0gNSAmJiB0aW1lc3RhbXBVcyA8IDApKSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICBwcmludGYoIndhbnRlZDogJS4yZiBzZWNzLCBnb3Q6ICUuMmYgc2Vjc1xuIiwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzZWVrVGltZVVzIC8gMUU2LCB0aW1lc3RhbXBVcyAvIDFFNik7Ci0KLSAgICAgICAgICAgICAgICAgICAgICAgIHByaW50ZigiRVJST1I6ICIpOwotICAgICAgICAgICAgICAgICAgICAgICAgZmFpbGVkID0gdHJ1ZTsKLSAgICAgICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgICAgIHByaW50ZigiYnVmZmVyIGhhcyB0aW1lc3RhbXAgJWxsZCB1cyAoJS4yZiBzZWNzKVxuIiwKLSAgICAgICAgICAgICAgICAgICAgICAgdGltZXN0YW1wVXMsIHRpbWVzdGFtcFVzIC8gMUU2KTsKLQotICAgICAgICAgICAgICAgIGJ1ZmZlci0+cmVsZWFzZSgpOwotICAgICAgICAgICAgICAgIGJ1ZmZlciA9IE5VTEw7Ci0KLSAgICAgICAgICAgICAgICBpZiAoZmFpbGVkKSB7Ci0gICAgICAgICAgICAgICAgICAgIGJyZWFrOwotICAgICAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgICAgIHNob3VsZFNlZWsgPSAoKGRvdWJsZSlyYW5kKCkgLyBSQU5EX01BWCkgPCAwLjE7Ci0KLSAgICAgICAgICAgICAgICBpZiAoZ1JlcHJvZHVjZUJ1ZyA9PSAzKSB7Ci0gICAgICAgICAgICAgICAgICAgIHNob3VsZFNlZWsgPSBmYWxzZTsKLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgIH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dGlvbnMpOwotICAgICAgICAgICAgaW50NjRfdCBkZWxheURlY29kZVVzID0gZ2V0Tm93VXMoKSAtIHN0YXJ0RGVjb2RlVXM7Ci0KLSAgICAgICAgICAgIG9wdGlvbnMuY2xlYXJTZWVrVG8oKTsKLQotICAgICAgICAgICAgaWYgKGVyciAhPSBPSykgewotICAgICAgICAgICAgICAgIENIRUNLKGJ1ZmZlciA9PSBOVUxMKTsKLQotICAgICAgICAgICAgICAgIGlmIChlcnIgPT0gSU5GT19GT1JNQVRfQ0hBTkdFRCkgewotICAgICAgICAgICAgICAgICAgICBwcmludGYoImZvcm1hdCBjaGFuZ2VkLlxuIik7Ci0gICAgICAgICAgICAgICAgICAgIGNvbnRpbnVlOwotICAgICAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgICAgIGJyZWFrOwotICAgICAgICAgICAgfQotCi0gICAgICAgICAgICBpZiAoYnVmZmVyLT5yYW5nZV9sZW5ndGgoKSA+IDApIHsKLSAgICAgICAgICAgICAgICBpZiAoZ0Rpc3BsYXlIaXN0b2dyYW0gJiYgbiA+IDApIHsKLSAgICAgICAgICAgICAgICAgICAgLy8gSWdub3JlIHRoZSBmaXJzdCB0aW1lIHNpbmNlIGl0IGluY2x1ZGVzIHNvbWUgc2V0dXAKLSAgICAgICAgICAgICAgICAgICAgLy8gY29zdC4KLSAgICAgICAgICAgICAgICAgICAgZGVjb2RlVGltZXNVcy5wdXNoKGRlbGF5RGVjb2RlVXMpOwotICAgICAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgICAgIGlmICgobisrICUgMTYpID09IDApIHsKLSAgICAgICAgICAgICAgICAgICAgcHJpbnRmKCIuIik7Ci0gICAgICAgICAgICAgICAgICAgIGZmbHVzaChzdGRvdXQpOwotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgc3VtRGVjb2RlVXMgKz0gZGVsYXlEZWNvZGVVczsKLSAgICAgICAgICAgIHRvdGFsQnl0ZXMgKz0gYnVmZmVyLT5yYW5nZV9sZW5ndGgoKTsKLQotICAgICAgICAgICAgYnVmZmVyLT5yZWxlYXNlKCk7Ci0gICAgICAgICAgICBidWZmZXIgPSBOVUxMOwotCi0gICAgICAgICAgICArK251bUZyYW1lczsKLSAgICAgICAgICAgIGlmIChnTWF4TnVtRnJhbWVzID4gMCAmJiBudW1GcmFtZXMgPT0gZ01heE51bUZyYW1lcykgewotICAgICAgICAgICAgICAgIGJyZWFrOwotICAgICAgICAgICAgfQotCi0gICAgICAgICAgICBpZiAoZ1JlcHJvZHVjZUJ1ZyA9PSAxICYmIG51bUZyYW1lcyA9PSA0MCkgewotICAgICAgICAgICAgICAgIHByaW50Zigic2Vla2luZyBwYXN0IHRoZSBlbmQgbm93LiIpOwotICAgICAgICAgICAgICAgIG9wdGlvbnMuc2V0U2Vla1RvKDB4N2ZmZmZmZmZMKTsKLSAgICAgICAgICAgIH0gZWxzZSBpZiAoZ1JlcHJvZHVjZUJ1ZyA9PSAyICYmIG51bUZyYW1lcyA9PSA0MCkgewotICAgICAgICAgICAgICAgIHByaW50Zigic2Vla2luZyB0byA1IHNlY3MuIik7Ci0gICAgICAgICAgICAgICAgb3B0aW9ucy5zZXRTZWVrVG8oNTAwMDAwMCk7Ci0gICAgICAgICAgICB9Ci0gICAgICAgIH0KLQotICAgICAgICBwcmludGYoIiQiKTsKLSAgICAgICAgZmZsdXNoKHN0ZG91dCk7Ci0KLSAgICAgICAgb3B0aW9ucy5zZXRTZWVrVG8oMCk7Ci0gICAgfQotCi0gICAgcmF3U291cmNlLT5zdG9wKCk7Ci0gICAgcHJpbnRmKCJcbiIpOwotCi0gICAgaW50NjRfdCBkZWxheSA9IGdldE5vd1VzKCkgLSBzdGFydFRpbWU7Ci0gICAgaWYgKCFzdHJuY2FzZWNtcCgidmlkZW8vIiwgbWltZSwgNikpIHsKLSAgICAgICAgcHJpbnRmKCJhdmcuICUuMmYgZnBzXG4iLCBuICogMUU2IC8gZGVsYXkpOwotCi0gICAgIC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AgZm9yICg7OykgewotICAgICAgICAgICAgZXJyID0gc291cmNlLT5yZWFkKCZidWZmZXIsICZvcHRpb25zKTsKLQotICAgICAgICAgICAgb3B0aW9ucy5jbGVhclNlZWtUbygpOwotCi0gICAgICAgICAgICBpZiAoZXJyID09IElORk9fRk9STUFUX0NIQU5HRUQpIHsKLSAgICAgICAgICAgICAgICBDSEVDSyhidWZmZXIgPT0gTlVMTCk7Ci0gICAgICAgICAgICAgICAgY29udGludWU7Ci0gICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgIGlmIChlcnIgIT0gT0spIHsKLSAgICAgICAgICAgICAgICBDSEVDSyhidWZmZXIgPT0gTlVMTCk7Ci0gICAgICAgICAgICAgICAgYnJlYWs7Ci0gICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgIGlmIChidWZmZXItPnJhbmdlX2xlbmd0aCgpID4gMCkgewotICAgICAgICAgICAgICAgIGJyZWFrOwotICAgICAgICAgICAgfQotCi0gICAgICAgICAgICBDSEVDSyhidWZmZXIgIT0gTlVMTCk7Ci0KLSAgICAgICAgICAgIGJ1ZmZlci0+cmVsZWFzZSgpOwotICAgICAgICAgICAgYnVmZmVyID0gTlVMTDsKLSAgICAgICAgfQotCi0gICAgICAgIGlmIChlcnIgPT0gT0spIHsKLSAgICAgICAgICAgIGludDY0X3QgdGltZVVzOwotICAgICAgICAgICAgQ0hFQ0soYnVmZmVyLT5tZXRhX2RhdGEoKS0+ZmluZEludDY0KGtLZXlUaW1lLCAmdGltZVVzKSk7Ci0KLSAgICAgICAgICAgIHByaW50ZigiJWxsZFx0JWxsZFx0JWxsZFxuIiwgc2Vla1RpbWVVcywgdGltZVVzLCBzZWVrVGltZVVzIC0gdGltZVVzKTsKLQotICAgICAgICAgICAgYnVmZmVyLT5yZWxlYXNlKCk7Ci0gICAgICAgICAgICBidWZmZXIgPSBOVUxMOwotICAgICAgICB9IGVsc2UgewotICAgICAgICAgICAgcHJpbnRmKCJFUlJPUlxuIik7Ci0gICAgICAgICAgICBicmVhazsKLSAgICAgICAgfQotICAgIH0KLQotICAgIENIRUNLX0VRKChzdGF0dXNfdClPSywgc291cmNlLT5zdG9wKCkpOwotfQotCi1zdGF0aWMgdm9pZCB1c2FnZShjb25zdCBjaGFyICptZSkgewotICAgIGZwcmludGYoc3RkZXJyLCAidXNhZ2U6ICVzXG4iLCBtZSk7Ci0gICAgZnByaW50ZihzdGRlcnIsICIgICAgICAgLWgoZWxwKVxuIik7Ci0gICAgZnByaW50ZihzdGRlcnIsICIgICAgICAgLWEodWRpbylcbiIpOwotICAgIGZwcmludGYoc3RkZXJyLCAiICAgICAgIC1uIHJlcGV0aXRpb25zXG4iKTsKLSAgICBmcHJpbnRmKHN0ZGVyciwgIiAgICAgICAtbChpc3QpIGNvbXBvbmVudHNcbiIpOwotICAgIGZwcmludGYoc3RkZXJyLCAiICAgICAgIC1tIG1heC1udW1iZXItb2YtZnJhbWVzLXRvLWRlY29kZSBpbiBlYWNoIHBhc3NcbiIpOwotICAgIGZwcmludGYoc3RkZXJyLCAiICAgICAgIC1iIGJ1ZyB0byByZXByb2R1Y2VcbiIpOwotICAgIGZwcmludGYoc3RkZXJyLCAiICAgICAgIC1wKHJvZmlsZXMpIGR1bXAgZGVjb2RlciBwcm9maWxlcyBzdXBwb3J0ZWRcbiIpOwotICAgIGZwcmludGYoc3RkZXJyLCAiICAgICAgIC10KGh1bWJuYWlsKSBleHRyYWN0IHZpZGVvIHRodW1ibmFpbCBvciBhbGJ1bSBhcnRcbiIpOwotICAgIGZwcmludGYoc3RkZXJyLCAiICAgICAgIC1zKG9mdHdhcmUpIHByZWZlciBzb2Z0d2FyZSBjb2RlY1xuIik7Ci0gICAgZnByaW50ZihzdGRlcnIsICIgICAgICAgLXIoaGFyZHdhcmUpIGZvcmNlIHRvIHVzZSBoYXJkd2FyZSBjb2RlY1xuIik7Ci0gICAgZnByaW50ZihzdGRlcnIsICIgICAgICAgLW8gcGxheWJhY2sgYXVkaW9cbiIpOwotICAgIGZwc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c2UgJ20nOgotICAgICAgICAgICAgY2FzZSAnbic6Ci0gICAgICAgICAgICBjYXNlICdiJzoKLSAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICBjaGFyICplbmQ7Ci0gICAgICAgICAgICAgICAgbG9uZyB4ID0gc3RydG9sKG9wdGFyZywgJmVuZCwgMTApOwotCi0gICAgICAgICAgICAgICAgaWYgKCplbmQgIT0gJ1wwJyB8fCBlbmQgPT0gb3B0YXJnIHx8IHggPD0gMCkgewotICAgICAgICAgICAgICAgICAgICB4ID0gMTsKLSAgICAgICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgICAgICBpZiAocmVzID09ICduJykgewotICAgICAgICAgICAgICAgICAgICBnTnVtUmVwZXRpdGlvbnMgPSB4OwotICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAocmVzID09ICdtJykgewotICAgICAgICAgICAgICAgICAgICBnTWF4TnVtRnJhbWVzID0geDsKLSAgICAgICAgICAgICAgICB9IGVsc2UgewotICAgICAgICAgICAgICAgICAgICBDSEVDS19FUShyZXMsICdiJyk7Ci0gICAgICAgICAgICAgICAgICAgIGdSZXByb2R1Y2VCdWcgPSB4OwotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICBicmVhazsKLSAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgY2FzZSAndyc6Ci0gICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgZ1dyaXRlTVA0ID0gdHJ1ZTsKLSAgICAgICAgICAgICAgICBnV3JpdGVNUDRGaWxlbmFtZS5zZXRUbyhvcHRhcmcpOwotICAgICAgICAgICAgICAgIGJyZWFrOwotICAgICAgICAgICAgfQotCi0gICAgICAgICAgICBjYXNlICdwJzoKLSAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICBkdW1wUHJvZmlsZXMgPSB0cnVlOwotICAgICAgICAgICAgICAgIGJyZWFrOwotICAgICAgICAgICAgfQotCi0gICAgICAgICAgICBjYXNlICd0JzoKLSAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICBleHRyYWN0VGh1bWJuYWlsID0gdHJ1ZTsKLSAgICAgICAgICAgICAgICBicmVhazsKLSAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgY2FzZSAncyc6Ci0gICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgZ1ByZWZlclNvZnR3YXJlQ29kZWMgPSB0cnVlOwotICAgICAgICAgICAgICAgIGJyZWFrOwotICAgICAgICAgICAgfQotCi0gICAgICAgICAgICBjYXNlICdyJzoKLSAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICBnRm9yY2VUb1VzZUhhcmR3YXJlQ29kZWMgPSB0cnVlOwotICAgICAgICAgICAgICAgIGJyZWFrOwotICAgICAgICAgICAgfQotCi0gICAgICAgICAgICBjYXNlICdvJzoKLSAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICBnUGxheWJhY2tBdWRpbyA9IHRydWU7Ci0gICAgICAgICAgICAgICAgYnJlYWs7Ci0gICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgIGNhc2UgJ2snOgotICAgICAgICAgICAgewotICAgICAgICAgICAgICAgIHNlZWtUZXN0ID0gdHJ1ZTsKLSAgICAgICAgICAgICAgICBicmVhazsKLSAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgY2FzZSAneCc6Ci0gICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgZ0Rpc3BsYXlIaXN0b2dyYW0gPSB0cnVlOwotICAgICAgICAgICAgICAgIGJyZWFrOwotICAgICAgICAgICAgfQotCi0gICAgICAgICAgICBjYXNlICdTJzoKLSAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICB1c2VTdXJmYWNlQWxsb2MgPSB0cnVlOwotICAgICAgICAgICAgICAgIGJyZWFrOwotICAgICAgICAgICAgfQotCi0gICAgICAgICAgICBjYXNlICdUJzoKLSAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICB1c2VTdXJmYWNlVGV4QWxsb2MgPSB0cnVlOwotICAgICAgICAgICAgICAgIGJyZWFrOwotICAgICAgICAgICAgfQotCi0gICAgICAgICAgICBjYXNlICc/JzoKLSAgICAgICAgICAgIGNhc2UgJ2gnOgotICAgICAgICAgICAgZGVmYXVsdDoKLSAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICB1c2FnZShhcmd2WzBdKTsKLSAgICAgICAgICAgICAgICBleGl0KDEpOwotICAgICAgICAgICAgICAgIGJyZWFrOwotICAgICAgICAgICAgfQotICAgICAgICB9Ci0gICAgfQotCi0gICAgaWYgKGdQbGF5YmFja0F1ZGlvICYmICFhdWRpb09ubHkpIHsKLSAgICAgICAgLy8gVGhpcyBkb2Vzbid0IG1ha2UgYW55IHNlbnNlIGlmIHdlJ3JlIGRlY29kaW5nIHRoZSB2aWRlbyB0cmFjay4KLSAgICAgICAgZ1BsYXliYWNrQXVkaW8gPSBmYWxzZTsKLSAgICB9Ci0KLSAgICBhcmdjIC09IG9wdGluZDsKLSAgICBhcmd2ICs9IG9wdGluZDsKLQotICAgIGlmIChleHRyYWN0VGh1bWJuYWlsKSB7Ci0gICAgICAgIHNwPElTZXJ2aWNlTWFuYWdlcj4gc20gPSBkZWZhdWx0U2VydmljZU1hbmFnZXIoKTsKLSAgICAgICAgc3A8SUJpbmRlcj4gYmluZGVyID0gc20tPmdldFNlcnZpY2UoU3RyaW5nMTYoIm1lZGlhLnBsYXllciIpKTsKLSAgICAgICAgc3A8SU1lZGlhUGxheWVyU2VydmljZT4gc2VydmljZSA9Ci0gICAgICAgICAgICBpbnRlcmZhY2VfY2FzdDxJTWVkaWFQbGF5ZXJTZXJ2aWNlPihiaW5kZXIpOwotCi0gICAgICAgIENIRUNLKHNlcnZpY2UuZ2V0KCkgIT0gTlVMTCk7Ci0KLSAgICAgICAgc3A8SU1lZGlhTWV0YWRhdGFSZXRyaWV2ZXI+IHJldHJpZXZlciA9Ci0gICAgICAgICAgICBzZXJ2aWNlLT5jcmVhdGVNZXRhZGF0YVJldHJpZXZlcihnZXRwaWQoKSk7Ci0KLSAgICAgICAgQ0hFQ0socmV0cmlldmVyICE9IE5VTEwpOwotCi0gICAgICAgIGZvciAoaW50IGsgPSAwOyBrIDwgYXJnYzsgKytrKSB7Ci0gICAgICAgICAgICBjb25zdCBjaGFyICpmaWxlbmFtZSA9IGFyZ3Zba107Ci0KLSAgICAgICAgICAgIGJvb2wgZmFpbGVkID0gdHJ1ZTsKLSAgICAgICAgICAgIENIRUNLX0VRKHJldHJpZXZlci0+c2V0RGF0YVNvdXJjZShmaWxlbmFtZSksIChzdGF0dXNfdClPSyk7Ci0gICAgICAgICAgICBzcDxJTWVtb3J5PiBtZW0gPQotICAgICAgICAgICAgICAgICAgICByZXRyaWV2ZXItPmdldEZyYW1lQXRUaW1lKC0xLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTWVkaWFTb3VyY2U6OlJlYWRPcHRpb25zOjpTRUVLX1BSRVZJT1VTX1NZTkMpOwotCi0gICAgICAgICAgICBpZiAobWVtICE9IE5VTEwpIHsKLSAgICAgICAgICAgICAgICBmYWlsZWQgPSBmYWxzZTsKLSAgICAgICAgICAgICAgICBwcmludGYoImdldEZyYW1lQXRUaW1lKCVzKSA9PiBPS1xuIiwgZmlsZW5hbWUpOwotCi0gICAgICAgICAgICAgICAgVmlkZW9GcmFtZSAqZnJhbWUgPSAoVmlkZW9GcmFtZSAqKW1lbS0+cG9pbnRlcigpOwotCi0gICAgICAgICAgICAgICAgQ0hFQ0tfRVEod3JpdGVKcGVnRmlsZSgiL3NkY2FyZC9vdXQuanBnIiwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAodWludDhfdCAqKWZyYW1lICsgc2l6ZW9mKFZpZGVvRnJhbWUpLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZyYW1lLT5tV2lkdGgsIGZyYW1lLT5tSGVpZ2h0KSwgMCk7Ci0gICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICBtZW0gPSByZXRyaWV2ZXItPmV4dHJhY3RBbGJ1bUFydCgpOwotCi0gICAgICAgICAgICAgICAgaWYgKG1lbSAhPSBOVUxMKSB7Ci0gICAgICAgICAgICAgICAgICAgIGZhaWxlZCA9IGZhbHNlOwotICAgICAgICAgICAgICAgICAgICBwcmludGYoImV4dHJhY3RBbGJ1bUFydCglcykgPT4gT0tcbiIsIGZpbGVuYW1lKTsKLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgIGlmIChmYWlsZWQpIHsKLSAgICAgICAgICAgICAgICBwcmludGYoImJvdGggZ2V0RnJhbWVBdFRpbWUgYW5kIGV4dHJhY3RBbGJ1bUFydCAiCi0gICAgICAgICAgICAgICAgICAgICJmYWlsZWQgb24gZmlsZSAnJXMnLlxuIiwgZmlsZW5hbWUpOwotICAgICAgICAgICAgfQotICAgICAgICB9Ci0KLSAgICAgICAgcmV0dXJuIDA7Ci0gICAgfQotCi0gICAgaWYgKGR1bXBQcm9maWxlcykgewotICAgICAgICBzcDxJU2VydmljZU1hbmFnZXI+IHNtID0gZGVmYXVsdFNlcnZpY2VNYW5hZ2VyKCk7Ci0gICAgICAgIHNwPElCaW5kZXI+IGJpbmRlciA9IHNtLT5nZXRTZXJ2aWNlKFN0cmluZzE2KCJtZWRpYS5wbGF5ZXIiKSk7Ci0gICAgICAgIHNwPElNZWRpYVBsYXllclNlcnZpY2U+IHNlcnZpY2UgPQotICAgICAgICAgICAgaW50ZXJmYWNlX2Nhc3Q8SU1lZGlhUGxheWVyU2VydmljZT4oYmluZGVyKTsKLQotICAgICAgICBDSEVDSyhzZXJ2aWNlLmdldCgpICE9IE5VTEwpOwotCi0gICAgICAgIHNwPElPTVg+IG9teCA9IHNlcnZpY2UtPmdldE9NWCgpOwotICAgICAgICBDSEVDSyhvbXguZ2V0KCkgIT0gTlVMTCk7Ci0KLSAgICAgICAgY29uc3QgY2hhciAqa01pbWVUeXBlc1tdID0gewotICAgICAgICAgICAgTUVESUFfTUlNRVRZUEVfVklERU9fQVZDLCBNRURJQV9NSU1FVFlQRV9WSURFT19NUEVHNCwKLSAgICAgICAgICAgIE1FRElBX01JTUVUWVBFX1ZJREVPX0gyNjMsIE1FRElBX01JTUVUWVBFX0FVRElPX0FBQywKLSAgICAgICAgICAgIE1FRElBX01JTUVUWVBFX0FVRElPX0FNUl9OQiwgTUVESUFfTUlNRVRZUEVfQVVESU9fQU1SX1dCLAotICAgICAgICAgICAgTUVESUFfTUlNRVRZUEVfQVVESU9fTVBFRywgTUVESUFfTUlNRVRZUEVfQVVESU9fRzcxMV9NTEFXLAotICAgICAgICAgICAgTUVESUFfTUlNRVRZUEVfQVVESU9fRzcxMV9BTEFXLCBNRURJQV9NSU1FVFlQRV9BVURJT19WT1JCSVMsCi0gICAgICAgICAgICBNRURJQV9NSU1FVFlQRV9WSURFT19WUFgKLSAgICAgICAgfTsKLQotICAgICAgICBmb3IgKHNpemVfdCBrID0gMDsgayA8IHNpemVvZihrTWltZVR5cGVzKSAvIHNpemVvZihrTWltZVR5cGVzWzBdKTsKLSAgICAgICAgICAgICArK2spIHsKLSAgICAgICAgICAgIHByaW50ZigidHlwZSAnJXMnOlxuIiwga01pbWVUeXBlc1trXSk7Ci0KLSAgICAgICAgICAgIFZlY3RvcjxDb2RlY0NhcGFiaWxpdGllcz4gcmVzdWx0czsKLSAgICAgICAgICAgIC8vIHdpbGwgcmV0cmlldmUgaGFyZHdhcmUgYW5kIHNvZnR3YXJlIGNvZGVjcwotICAgICAgICAgICAgQ0hFQ0tfRVEoUXVlcnlDb2RlY3Mob214LCBrTWltZVR5cGVzW2tdLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdHJ1ZSwgLy8gcXVlcnlEZWNvZGVycwotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJnJlc3VsdHMpLCAoc3RhdHVzX3QpT0spOwotCi0gICAgICAgICAgICBmb3IgKHNpemVfdCBpID0gMDsgaSA8IHJlc3VsdHMuc2l6ZSgpOyArK2kpIHsKLSAgICAgICAgICAgICAgICBwcmludGYoIiAgZGVjb2RlciAnJXMnIHN1cHBvcnRzICIsCi0gICAgICAgICAgICAgICAgICAgICAgIHJlc3VsdHNbaV0ubUNvbXBvbmVudE5hbWUuc3RyaW5nKCkpOwotCi0gICAgICAgICAgICAgICAgaWYgKHJlc3VsdHNbaV0ubVByb2ZpbGVMZXZlbHMuc2l6ZSgpID09IDApIHsKLSAgICAgICAgICAgICAgICAgICAgcHJpbnRmKCJOT1RISU5HLlxuIik7Ci0gICAgICAgICAgICAgICAgICAgIGNvbnRpbnVlOwotICAgICAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgICAgIGZvciAoc2l6ZV90IGogPSAwOyBqIDwgcmVzdWx0c1tpXS5tUHJvZmlsZUxldmVscy5zaXplKCk7ICsraikgewotICAgICAgICAgICAgICAgICAgICBjb25zdCBDb2RlY1Byb2ZpbGVMZXZlbCAmcHJvZmlsZUxldmVsID0KLSAgICAgICAgICAgICAgICAgICAgICAgIHJlc3VsdHNbaV0ubVByb2ZpbGVMZXZlbHNbal07Ci0KLSAgICAgICAgICAgICAgICAgICAgcHJpbnRmKCIlcyVsZC8lbGQiLCBqID4gMCA/ICIsICIgOiAiIiwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgIHByb2ZpbGVMZXZlbC5tUHJvZmlsZSwgcHJvZmlsZUxldmVsLm1MZXZlbCk7Ci0gICAgICAgICAgICAgICAgfQotCi0gICAgICAgICAgICAgICAgcHJpbnRmKCJcbiIpOwotICAgICAgICAgICAgfQotICAgICAgICB9Ci0gICAgfQotCi0gICAgaWYgKGxpc3RDb21wb25lbnRzKSB7Ci0gICAgICAgIHNwPElTZXJ2aWNlTWFuYWdlcj4gc20gPSBkZWZhdWx0U2VydmljZU1hbmFnZXIoKTsKLSAgICAgICAgc3A8SUJpbmRlcj4gYmluZGVyID0gc20tPmdldFNlcnZpY2UoU3RyaW5nMTYoIm1lZGlhLnBsYXllciIpK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ZVRleEFsbG9jKSAmJiAhYXVkaW9Pbmx5KSB7Ci0gICAgICAgIGlmICh1c2VTdXJmYWNlQWxsb2MpIHsKLSAgICAgICAgICAgIGNvbXBvc2VyQ2xpZW50ID0gbmV3IFN1cmZhY2VDb21wb3NlckNsaWVudDsKLSAgICAgICAgICAgIENIRUNLX0VRKGNvbXBvc2VyQ2xpZW50LT5pbml0Q2hlY2soKSwgKHN0YXR1c190KU9LKTsKLQotICAgICAgICAgICAgY29udHJvbCA9IGNvbXBvc2VyQ2xpZW50LT5jcmVhdGVTdXJmYWNlKAotICAgICAgICAgICAgICAgICAgICBTdHJpbmc4KCJBIFN1cmZhY2UiKSwKLSAgICAgICAgICAgICAgICAgICAgMCwKLSAgICAgICAgICAgICAgICAgICAgMTI4MCwKLSAgICAgICAgICAgICAgICAgICAgODAwLAotICAgICAgICAgICAgICAgICAgICBQSVhFTF9GT1JNQVRfUkdCXzU2NSwKLSAgICAgICAgICAgICAgICAgICAgMCk7Ci0KLSAgICAgICAgICAgIENIRUNLKGNvbnRyb2wgIT0gTlVMTCk7Ci0gICAgICAgICAgICBDSEVDSyhjb250cm9sLT5pc1ZhbGlkKCkpOwotCi0gICAgICAgICAgICBTdXJmYWNlQ29tcG9zZXJDbGllbnQ6Om9wZW5HbG9iYWxUcmFuc2FjdGlvbigpOwotICAgICAgICAgICAgQ0hFQ0tfRVEoY29udHJvbC0+c2V0TGF5ZXIoSU5UX01BWCksIChzdGF0dXNfdClPSyk7Ci0gICAgICAgICAgICBDSEVDS19FUShjb250cm9sLT5zaG93KCksIChzdGF0dXNfdClPSyk7Ci0gICAgICAgICAgICBTdXJmYWNlQ29tcG9zZXJDbGllbnQ6OmNsb3NlR2xvYmFsVHJhbnNhY3Rpb24oKTsKLQotICAgICAgICAgICAgZ1N1cmZhY2UgPSBjb250cm9sLT5nZXRTdXJmYWNlKCk7Ci0gICAgICAgICAgICBDSEVDSyhnU3VyZmFjZSAhPSBOVUxMKTsKLSAgICAgICAgfSBlb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ICAgICAgICAgICAgICBtZWRpYVNvdXJjZXMucHVzaChtZWRpYVNvdXJjZSk7Ci0gICAgICAgICAgICB9Ci0gICAgICAgIH0gZWxzZSB7Ci0gICAgICAgICAgICBzcDxNZWRpYUV4dHJhY3Rvcj4gZXh0cmFjdG9yOwotCi0gICAgICAgICAgICBpZiAoIXN0cm5jYXNlY21wKCJodHRwbGl2ZTovLyIsIGZpbGVuYW1lLCAxMSkpIHsKLSAgICAgICAgICAgICAgICBTdHJpbmc4IHVyaSgiaHR0cDovLyIpOwotICAgICAgICAgICAgICAgIHVyaS5hcHBlbmQoZmlsZW5hbWUgKyAxMSk7Ci0KLSAgICAgICAgICAgICAgICBpZiAobG9vcGVyID09IE5VTEwpIHsKLSAgICAgICAgICAgICAgICAgICAgbG9vcGVyID0gbmV3IEFMb29wZXI7Ci0gICAgICAgICAgICAgICAgICAgIGxvb3Blci0+c3RhcnQoKTsKLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgbGl2ZVNlc3Npb24gPSBuZXcgTGl2ZVNlc3Npb247Ci0gICAgICAgICAgICAgICAgbG9vcGVyLT5yZWdpc3RlckhhbmRsZXIobGl2ZVNlc3Npb24pOwotCi0gICAgICAgICAgICAgICAgbGl2ZVNlc3Npb24tPmNvbm5lY3QodXJpLnN0cmluZygpKTsKLSAgICAgICAgICAgICAgICBkYXRhU291cmNlID0gbGl2ZVNlc3Npb24tPmdldERhdGFTb3VyY2UoKTsKLQotICAgICAgICAgICAgICAgIGV4dHJhY3RvciA9Ci0gICAgICAgICAgICAgICAgICAgIE1lZGlhRXh0cmFjdG9yOjpDcmVhdGUoCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgZGF0YVNvdXJjZSwgTUVESUFfTUlNRVRZUEVfQ09OVEFJTkVSX01QRUcyVFMpOwotCi0gICAgICAgICAgICAgICAgc3luY0luZm9QcmVzZW50ID0gZmFsc2U7Ci0gICAgICAgICAgICB9IGVsc2UgewotICAgICAgICAgICAgICAgIGV4dHJhY3RvciA9IE1lZGlhRXh0cmFjdG9yOjpDcmVhdGUoZGF0YVNvdXJjZSk7Ci0KLSAgICAgICAgICAgICAgICBpZiAoZXh0cmFjdG9yID09IE5VTEwpIHsKLSAgICAgICAgICAgICAgICAgICAgZnByaW50ZihzdGRlcnIsICJjb3VsZCBub3QgY3JlYXRlIGV4dHJhY3Rvci5cbiIpOwotICAgICAgICAgICAgICAgICAgICByZXR1cm4gLTE7Ci0gICAgICAgICAgICAgICAgfQotCi0gICAgICAgICAgICAgICAgc3A8TWV0YURhdGE+IG1ldGEgPSBleHRyYWN0b3ItPmdldE1ldGFEYXRhKCk7Ci0KLSAgICAgICAgICAgICAgICBpZiAobWV0YSAhPSBOVUxMKSB7Ci0gICAgICAgICAgICAgICAgICAgIGNvbnN0IGNoYXIgKm1pbWU7Ci0gICAgICAgICAgICAgICAgICAgIENIRUNLKG1ldGEtPmZpbmRDU3RyaW5nKGtLZXlNSU1FVHlwZSwgJm1pbWUpKTsKLQotICAgICAgICAgICAgICAgICAgICBpZiAoIXN0cmNhc2VjbXAobWltZSwgTUVESUFfTUlNRVRZUEVfQ09OVEFJTkVSX01QRUcyVFMpKSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICBzeW5jSW5mb1ByZXNlbnQgPSBmYWxzZTsKLSAgICAgICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgc2l6ZV90IG51bVRyYWNrcyA9IGV4dHJhY3Rvci0+Y291bnRUcmFja3MoKTsKLQotICAgICAgICAgICAgaWYgKGdXcml0ZU1QNCkgewotICAgICAgICAgICAgICAgIGJvb2wgaGF2ZUF1ZGlvID0gZmFsc2U7Ci0gICAgICAgICAgICAgICAgYm9vbCBoYXZlVmlkZW8gPSBmYWxzZTsKLSAgICAgICAgICAgICAgICBmb3IgKHNpemVfdCBpID0gMDsgaSA8IG51bVRyYWNrczsgKytpKSB7Ci0gICAgICAgICAgICAgICAgICAgIHNwPE1lZGlhU291cmNlPiBzb3VyY2UgPSBleHRyYWN0b3ItPmdldFRyYWNrKGkpOwotCi0gICAgICAgICAgICAgICAgICAgIGNvbnN0IGNoYXIgKm1pbWU7Ci0gICAgICAgICAgICAgICAgICAgIENIRUNLKHNvdXJjZS0+Z2V0Rm9ybWF0KCktPmZpbmRDU3RyaW5nKAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBrS2V5TUlNRVR5cGUsICZtaW1lKSk7Ci0KLSAgICAgICAgICAgICAgICAgICAgYm9vbCB1c2VUcmFjayA9IGZhbHNlOwotICAgICAgICAgICAgICAgICAgICBpZiAoIWhhdmVBdWRpbyAmJiAhc3RybmNhc2VjbXAoImF1ZGlvLyIsIG1pbWUsIDYpKSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICBoYXZlQXVkaW8gPSB0cnVlOwotICAgICAgICAgICAgICAgICAgICAgICAgdXNlVHJhY2sgPSB0cnVlOwotICAgICAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKCFoYXZlVmlkZW8gJiYgIXN0cm5jYXNlY21wKCJ2aWRlby8iLCBtaW1lLCA2KSkgewotICAgICAgICAgICAgICAgICAgICAgICAgaGF2ZVZpZGVvID0gdHJ1ZTsKLSAgICAgICAgICAgICAgICAgICAgICAgIHVzZVRyYWNrID0gdHJ1ZTsKLSAgICAgICAgICAgICAgICAgICAgfQotCi0gICAgICAgICAgICAgICAgICAgIGlmICh1c2VUcmFjaykgewotICAgICAgICAgICAgICAgICAgICAgICAgbWVkaWFTb3VyY2VzLnB1c2goc291cmNlKTsKLQotICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGhhdmVBdWRpbyAmJiBoYXZlVmlkZW8pIHsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKLSAgICAgICAgICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgIH0gZWxzZSB7Ci0gICAgICAgICAgICAgICAgc3A8TWV0YURhdGE+IG1ldGE7Ci0gICAgICAgICAgICAgICAgc2l6ZV90IGk7Ci0gICAgICAgICAgICAgICAgZm9yIChpID0gMDsgaSA8IG51bVRyYWNrczsgKytpKSB7Ci0gICAgICAgICAgICAgICAgICAgIG1ldGEgPSBleHRyYWN0b3ItPmdldFRyYWNrTWV0YURhdGEoCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgaSwgTWVkaWFFeHRyYWN0b3I6OmtJbmNsdWRlRXh0ZW5zaXZlTWV0YURhdGEpOwotCi0gICAgICAgICAgICAgICAgICAgIGNvbnN0IGNoYXIgKm1pbWU7Ci0gICAgICAgICAgICAgICAgICAgIG1ldGEtPmZpbmRDU3RyaW5nKGtLZXlNSU1FVHlwZSwgJm1pbWUpOwotCi0gICAgICAgICAgICAgICAgICAgIGlmIChhdWRpb09ubHkgJiYgIXN0cm5jYXNlY21wKG1pbWUsICJhdWRpby8iLCA2KSkgewotICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7Ci0gICAgICAgICAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgICAgICAgICBpZiAoIWF1ZGlvT25seSAmJiAhc3RybmNhc2VjbXAobWltZSwgInZpZGVvLyIsIDYpKSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKLSAgICAgICAgICAgICAgICAgICAgfQotCi0gICAgICAgICAgICAgICAgICAgIG1ldGEgPSBOVUxMOwotICAgICAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgICAgIGlmIChtZXRhID09IE5VTEwpIHsKLSAgICAgICAgICAgICAgICAgICAgZnByaW50ZihzdGRlcnIsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgIk5vIHN1aXRhYmxlICVzIHRyYWNrIGZvdW5kLiBUaGUgJy1hJyBvcHRpb24gd2lsbCAiCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgInRhcmdldCBhdWRpbyB0cmFja3Mgb25seSwgdGhlIGRlZmF1bHQgaXMgdG8gdGFyZ2V0ICIKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAidmlkZW8gdHJhY2tzIG9ubHkuXG4iLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgIGF1ZGlvT25seSA/ICJhdWRpbyIgOiAidmlkZW8iKTsKLSAgICAgICAgICAgICAgICAgICAgcmV0dXJuIC0xOwotICAgICAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgICAgIGludDY0X3QgdGh1bWJUaW1lVXM7Ci0gICAgICAgICAgICAgICAgaWYgKG1ldGEtPmZpbmRJbnQ2NChrS2V5VGh1bWJuYWlsVGltZSwgJnRodW1iVGltZVVzKSkgewotICAgICAgICAgICAgICAgICAgICBwcmludGYoInRodW1ibmFpbFRpbWU6ICVsbGQgdXMgKCUuMmYgc2VjcylcbiIsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICB0aHVtYlRpbWVVcywgdGh1bWJUaW1lVXMgLyAxRTYpOwotICAgICAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgICAgIG1lZGlhU291cmNlID0gZXh0cmFjdG9yLT5nZXRUcmFjayhpKTsKLSAgICAgICAgICAgIH0KLSAgICAgICAgfQotCi0gICAgICAgIGlmIChnV3JpdGVNUDQpIHsKLSAgICAgICAgICAgIHdyaXRlU291cmNlc1RvTVA0KG1lZGlhU291cmNlcywgc3luY0luZm9QcmVzZW50KTsKLSAgICAgICAgfSBlbHNlIGlmIChkdW1wU3RyZWFtKSB7Ci0gICAgICAgICAgICBkdW1wU291cmNlKG1lZGlhU291cmNlLCBkdW1wU3RyZWFtRmlsZW5hbWUpOwotICAgICAgICB9IGVsc2UgaWYgKHNlZWtUZXN0KSB7Ci0gICAgICAgICAgICBwZXJmb3JtU2Vla1Rlc3QobWVkaWFTb3VyY2UpOwotICAgICAgICB9IGVsc2UgewotICAgICAgICAgICAgcGxheVNvdXJjZSgmY2xpZW50LCBtZWRpYVNvdXJjZSk7Ci0gICAgICAgIH0KLSAgICB9Ci0KLSAg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udEZpbHRlciB1c2VyRmlsdGVyID0gbmV3IEludGVudEZpbHRlcigpOworICAgICAgICB1c2VyRmlsdGVyLmFkZEFjdGlvbihJbnRlbnQuQUNUSU9OX1VTRVJfUkVNT1ZFRCk7CisgICAgICAgIG1Db250ZXh0LnJlZ2lzdGVyUmVjZWl2ZXIobmV3IEJyb2FkY2FzdFJlY2VpdmVyKCkgeworICAgICAgICAgICAgQE92ZXJyaWRlCisgICAgICAgICAgICBwdWJsaWMgdm9pZCBvblJlY2VpdmUoQ29udGV4dCBjb250ZXh0LCBJbnRlbnQgaW50ZW50KSB7CisgICAgICAgICAgICAgICAgb25Vc2VyUmVtb3ZlZChpbnRlbnQpOworICAgICAgICAgICAgfQorICAgICAgICB9LCB1c2VyRmlsdGVyKTsKICAgICB9CiAKICAgICBwcml2YXRlIFVzZXJBY2NvdW50cyBpbml0VXNlcihpbnQgdXNlcklkKSB7CkBAIC0zNDcsNiArMzU1LDI4IEBACiAgICAgICAgIH0KICAgICB9CiAKKyAgICBwcml2YXRlIHZvaWQgb25Vc2VyUmVtb3ZlZChJbnRlbnQgaW50ZW50KSB7CisgICAgICAgIGludCB1c2VySWQgPSBpbnRlbnQuZ2V0SW50RXh0cmEoSW50ZW50LkVYVFJBX1VTRVJJRCwgLTEpOworICAgICAgICBpZiAodXNlcklkIDwgMSkgcmV0dXJuOworCisgICAgICAgIFVzZXJBY2NvdW50cyBhY2NvdW50czsKKyAgICAgICAgc3luY2hyb25pemVkIChtVXNlcnMpIHsKKyAgICAgICAgICAgIGFjY291bnRzID0gbVVzZXJzLmdldCh1c2VySWQpOworICAgICAgICAgICAgbVVzZXJzLnJlbW92ZSh1c2VySWQpOworICAgICAgICB9CisgICAgICAgIGlmIChhY2NvdW50cyA9PSBudWxsKSB7CisgICAgICAgICAgICBGaWxlIGRiRmlsZSA9IG5ldyBGaWxlKGdldERhdGFiYXNlTmFtZSh1c2VySWQpKTsKKyAgICAgICAgICAgIGRiRmlsZS5kZWxldGUoKTsKK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51bGw7CisgICAgICAgIH0KKyAgICB9CisKKyAgICAvKioKKyAgICAgKiBAaGlkZQorICAgICAqLworICAgIEBPdmVycmlkZQogICAgIHB1YmxpYyBib29sZWFuIHJlbW92ZVVzZXIoaW50IGlkKSB7CiAgICAgICAgIHRyeSB7CiAgICAgICAgICAgICByZXR1cm4gbVBNLnJlbW92ZVVzZXIoaWQpOwpAQCAtMTIyOCw3ICsxMjQwLDEwIEBACiAgICAgICovCiAgICAgQE92ZXJyaWRlCiAgICAgcHVibGljIHZvaWQgdXBkYXRlVXNlck5hbWUoaW50IGlkLCBTdHJpbmcgbmFtZSkgewotICAgICAgICAvLyBUT0RPOgorICAgICAgICB0cnkgeworICAgICAgICAgICAgbVBNLnVwZGF0ZVVzZXJOYW1lKGlkLCBuYW1lKTsKKyAgICAgICAgfSBjYXRjaCAoUmVtb3RlRXhjZXB0aW9uIHJlKSB7CisgICAgICAgIH0KICAgICB9CiAKICAgICAvKioKZGlmZiAtLWdpdCBhL2NvcmUvamF2YS9hbmRyb2lkL2FwcC9Ob3RpZmljYXRpb24uamF2YSBiL2NvcmUvamF2YS9hbmRyb2lkL2FwcC9Ob3RpZmljYXRpb24uamF2YQppbmRleCAwNGFiNDA3Li5iYmI2YTRlIDEwMDY0NAotLS0gYS9jb3JlL2phdmEvYW5kcm9pZC9hcHAvTm90aWZpY2F0aW9uLmphdmEKKysrIGIvY29yZS9qYXZhL2FuZHJvaWQvYXBwL05vdGlmaWNhdGlvbi5qYXZhCkBAIC05MTgsNiArOTE4LDggQEAKICAgICAgICAgcHJpdmF0ZSBCdW5kbGUgbUV4dHJhczsKICAgICAgICAgcHJpdmF0ZSBpbnQgbVByaW9yaXR5OwogICAgICAgICBwcml2YXRlIEFycmF5TGlzdDxBY3Rpb24+IG1BY3Rpb25zID0gbmV3IEFycmF5TGlzdDxBY3Rpb24+KDMpOworICAgICAgICBwcml2YXRlIGJvb2xlYW4gbUNhbkhhc0ludHJ1ZGVyOworICAgICAgICBwcml2YXRlIGJvb2xlYW4gbUludHJ1ZGVyQWN0aW9uc1Nob3dUZXh0OwogCiAgICAgICAgIC8qKgogICAgICAgICAgKiBDb25zdHJ1Y3RzIGEgbmV3IEJ1aWxkZXIgd2l0aCB0aGUgZGVmYXVsdHM6CkBAIC0xMzEzLDYgKzEzMTUsMzggQEAKICAgICAgICAgICAgIHJldHVybiB0aGlzOwogICAgICAgICB9CiAKKyAgICAgICAgLyoqCisgICAgICAgICAqIFNwZWNpZnkgd2hldGhlciB0aGlzIG5vdGlmaWNhdGlvbiBzaG91bGQgcG9wIHVwIGFzIGFuCisgICAgICAgICAqICJpbnRydWRlciBhbGVydCIgKGEgc21hbGwgd2luZG93IHRoYXQgc2hhcmVzIHRoZSBzY3JlZW4gd2l0aCB0aGUKKyAgICAgICAgICogY3VycmVudCBhY3Rpdml0eSkuIFRoaXMgc29ydCBvZiBub3RpZmljYXRpb24gaXMgKGFzIHRoZSBuYW1lIGltcGxpZXMpCisgICAgICAgICAqIHZlcnkgaW50cnVzaXZlLCBzbyB1c2UgaXQgc3BhcmluZ2x5IGZvciBub3RpZmljYXRpb25zIHRoYXQgcmVxdWlyZQorICAgICAgICAgKiB0aGUgdXNlcidzIGF0dGVudGlvbi4KKyAgICAgICAgICoKKyAgICAgICAgICogTm90ZXM6CisgICAgICAgICAqIDx1bD4KKyAgICAgICAgICogPGxpPkludHJ1ZGVyIGFsZXJ0cyBvbmx5IHNob3cgd2hlbiB0aGUgc2NyZWVuIGlzIG9uLjwvbGk+CisgICAgICAgICAqIDxsaT5JbnRydWRlciBhbGVydHMgdGFrZSBwcmVjZWRlbmNlIG92ZXIgZnVsbFNjcmVlbkludGVudHMuPC9saT4KKyAgICAgICAgICogPC91bD4KKyAgICAgICAgICoKKyAgICAgICAgICogQHBhcmFtIGludHJ1ZGUgV2hldGhlciB0byBwb3AgdXAgYW4gaW50cnVkZXIgYWxlcnQgKGRlZmF1bHQgZmFsc2UpLgorICAgICAgICAgKi8KKyAgICAgICAgcHVibGljIEJ1aWxkZXIgc2V0VXNlc0ludHJ1ZGVyQWxlcnQoYm9vbGVhbiBpbnRydWRlKSB7CisgICAgICAgICAgICBtQ2FuSGFzSW50cnVkZXIgPSBpbnRydWRlOworICAgICAgICAgICAgcmV0dXJuIHRoaXM7CisgICAgICAgIH0KKworICAgICAgICAvKioKKyAgICAgICAgICogQ29udHJvbCB0ZXh0IG9uIGludHJ1ZGVyIGFsZXJ0IGFjdGlvbiBidXR0b25zLiBCeSBkZWZhdWx0LCBhY3Rpb24KKyAgICAgICAgICogYnV0dG9ucyBpbiBpbnRydWRlcnMgZG8gbm90IHNob3cgdGV4dHVhbCBsYWJlbHMuCisgICAgICAgICAqIAorICAgICAgICAgKiBAcGFyYW0gc2hvd0FjdGlvblRleHQgV2hldGhlciB0byBzaG93IHRleHQgbGFiZWxzIGJlbmVhdGggYWN0aW9uCisgICAgICAgICAqICAgICAgICAgICAgaWNvbnMgKGRlZmF1bHQgZmFsc2UpLgorICAgICAgICAgKi8KKyAgICAgICAgcHVibGljIEJ1aWxkZXIgc2V0SW50cnVkZXJBY3Rpb25zU2hvd1RleHQoYm9vbGVhbiBzaG93QWN0aW9uVGV4dCkgeworICAgICAgICAgICAgbUludHJ1ZGVyQWN0aW9uc1Nob3dUZXh0ID0gc2hvd0FjdGlvblRleHQ7CisgICAgICAgICAgICByZXR1cm4gdGhpczsKKyAgICAgICAgfQorCiAgICAgICAgIHByaXZhdGUgdm9pZCBzZXRGbGFnKGludCBtYXNrLCBib29sZWFuIHZhbHVlKSB7CiAgICAgICAgICAgICBpZiAodmFsdWUpIHsKICAgICAgICAgICAgICAgICBtRmxhZ3MgfD0gbWFzazsKQEAgLTEzOTQsNyArMTQyOCw3IEBACiAgICAgICAgICAgICB9CiAgICAgICAgIH0KIAotICAgICAgICBwcml2YXRlIFJlbW90ZVZpZXdzIG1ha2VJbnRydWRlclZpZXcoKSB7CisgICAgICAgIHByaXZhdGUgUmVtb3RlVmlld3MgbWFrZUludHJ1ZGVyVmlldyhib29sZWFuIHNob3dMYWJlbHMpIHsKICAgICAgICAgICAgIFJlbW90ZVZpZXdzIGludHJ1ZGVyVmlldyA9IG5ldyBSZW1vdGVWaWV3cyhtQ29udGV4dC5nZXRQYWNrYWdlTmFtZSgpLAogICAgICAgICAgICAgICAgICAgICBSLmxheW91dC5ub3RpZmljYXRpb25faW50cnVkZXJfY29udGVudCk7CiAgICAgICAgICAgICBpZiAobUxhcmdlSWNvbiAhPSBudWxsKSB7CkBAIC0xNDIyLDcgKzE0NTYsOCBAQAogICAgICAgICAgICAgICAgICAgICBmaW5hbCBpbnQgYnV0dG9uSWQgPSBCVVRUT05TW2ldOwogCiAgICAgICAgICAgICAgICAgICAgIGludHJ1ZGVyVmlldy5zZXRWaWV3VmlzaWJpbGl0eShidXR0b25JZCwgVmlldy5WSVNJQkxFKTsKLSAgICAgICAgICAgICAgICAgICAgaW50cnVkZXJWaWV3LnNldEltYWdlVmlld1Jlc291cmNlKGJ1dHRvbklkLCBhY3Rpb24uaWNvbik7CisgICAgICAgICAgICAgICAgICAgIGludHJ1ZGVyVmlldy5zZXRUZXh0Vmlld1RleHQoYnV0dG9uSWQsIHNob3dMYWJlbHMgPyBhY3Rpb24udGl0bGUgOiBudWxsKTsKKyAgICAgICAgICAgICAgICAgICAgaW50cnVkZXJWaWV3LnNldFRleHRWaWV3Q29tcG91bmREcmF3YWJsZXMoYnV0dG9uSWQsIDAsIGFjdGlvbi5pY29uLCAwLCAwKTsKICAgICAgICAgICAgICAgICAgICAgaW50cnVkZXJWaWV3LnNldENvbnRlbnREZXNjcmlwdGlvbihidXR0b25JZCwgYWN0aW9uLnRpdGxlKTsKICAgICAgICAgICAgICAgICAgICAgaW50cnVkZXJWaWV3LnNldE9uQ2xpY2tQZW5kaW5nSW50ZW50KGJ1dHRvbklkLCBhY3Rpb24uYWN0aW9uSW50ZW50KTsKICAgICAgICAgICAgICAgICB9CkBAIC0xNDU3LDcgKzE0OTIsOSBAQAogICAgICAgICAgICAgb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mcgYWN0aW9uID0gZ2V0QWN0aW9uKCk7CiAgICAgICAgIGlmIChBQ1RJT05fU0VORC5lcXVhbHMoYWN0aW9uKSkgewotICAgICAgICAgICAgZmluYWwgVXJpIHN0cmVhbSA9IGdldFBhcmNlbGFibGVFeHRyYShFWFRSQV9TVFJFQU0pOworICAgICAgICAgICAgZmluYWwgVXJpIHN0cmVhbTsKKyAgICAgICAgICAgIHRyeSB7CisgICAgICAgICAgICAgICAgc3RyZWFtID0gZ2V0UGFyY2VsYWJsZUV4dHJhKEVYVFJBX1NUUkVBTSk7CisgICAgICAgICAgICB9IGNhdGNoIChDbGFzc0Nhc3RFeGNlcHRpb24gZSkgeworICAgICAgICAgICAgICAgIHJldHVybjsKKyAgICAgICAgICAgIH0KICAgICAgICAgICAgIGlmIChzdHJlYW0gIT0gbnVsbCkgewogICAgICAgICAgICAgICAgIGZpbmFsIENsaXBEYXRhIGNsaXBEYXRhID0gbmV3IENsaXBEYXRhKAogICAgICAgICAgICAgICAgICAgICAgICAgbnVsbCwgbmV3IFN0cmluZ1tdIHsgZ2V0VHlwZSgpIH0sIG5ldyBDbGlwRGF0YS5JdGVtKHN0cmVhbSkpOwpAQCAtNjQ5Myw3ICs2NTI5LDEyIEBACiAgICAgICAgICAgICB9CiAKICAgICAgICAgfSBlbHNlIGlmIChBQ1RJT05fU0VORF9NVUxUSVBMRS5lcXVhbHMoYWN0aW9uKSkgewotICAgICAgICAgICAgZmluYWwgQXJyYXlMaXN0PFVyaT4gc3RyZWFtcyA9IGdldFBhcmNlbGFibGVBcnJheUxpc3RFeHRyYShFWFRSQV9TVFJFQU0pOworICAgICAgICAgICAgZmluYWwgQXJyYXlMaXN0PFVyaT4gc3RyZWFtczsKKyAgICAgICAgICAgIHRyeSB7CisgICAgICAgICAgICAgICAgc3RyZWFtcyA9IGdldFBhcmNlbGFibGVBcnJheUxpc3RFeHRyYShFWFRSQV9TVFJFQU0pOworICAgICAgICAgICAgfSBjYXRjaCAoQ2xhc3NDYX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XSA9IGdlbmVyYXRlQWN0aXZpdHlJbmZvKHAuYWN0aXZpdGllcy5nZXQoaSksIGZsYWdzLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB1c2VySWQpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzdG9wcGVkLCBlbmFibGVkU3RhdGUsIHVzZXJJZCk7CiAgICAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICB9CkBAIC0zMTEsNyArMzIwLDggQEAKICAgICAgICAgICAgICAgICAgICAgZmluYWwgQWN0aXZpdHkgYWN0aXZpdHkgPSBwLnJlY2VpdmVycy5nZXQoaSk7CiAgICAgICAgICAgICAgICAgICAgIGlmIChhY3Rpdml0eS5pbmZvLmVuYWJsZWQKICAgICAgICAgICAgICAgICAgICAgICAgIHx8IChmbGFncyZQYWNrYWdlTWFuYWdlci5HRVRfRElTQUJMRURfQ09NUE9ORU5UUykgIT0gMCkgewotICAgICAgICAgICAgICAgICAgICAgICAgcGkucmVjZWl2ZXJzW2orK10gPSBnZW5lcmF0ZUFjdGl2aXR5SW5mbyhwLnJlY2VpdmVycy5nZXQoaSksIGZsYWdzLCB1c2VySWQpOworICAgICAgICAgICAgICAgICAgICAgICAgcGkucmVjZWl2ZXJzW2orK10gPSBnZW5lcmF0ZUFjdGl2aXR5SW5mbyhwLnJlY2VpdmVycy5nZXQoaSksIGZsYWdzLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzdG9wcGVkLCBlbmFibGVkU3RhdGUsIHVzZXJJZCk7CiAgICAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICB9CkBAIC0zMzIsNyArMzQyLDggQEAKICAgICAgICAgICAgICAgICAgICAgZmluYWwgU2VydmljZSBzZXJ2aWNlID0gcC5zZXJ2aWNlcy5nZXQoaSk7CiAgICAgICAgICAgICAgICAgICAgIGlmIChzZXJ2aWNlLmluZm8uZW5hYmxlZAogICAgICAgICAgICAgICAgICAgICAgICAgfHwgKGZsYWdzJlBhY2thZ2VNYW5hZ2VyLkdFVF9ESVNBQkxFRF9DT01QT05FTlRTKSAhPSAwKSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICBwaS5zZXJ2aWNlc1tqKytdID0gZ2VuZXJhdGVTZXJ2aWNlSW5mbyhwLnNlcnZpY2VzLmdldChpKSwgZmxhZ3MsIHVzZXJJZCk7CisgICAgICAgICAgICAgICAgICAgICAgICBwaS5zZXJ2aWNlc1tqKytdID0gZ2VuZXJhdGVTZXJ2aWNlSW5mbyhwLnNlcnZpY2VzLmdldChpKSwgZmxhZ3MsIHN0b3BwZWQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGVuYWJsZWRTdGF0ZSwgdXNlcklkKTsKICAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgIH0KQEAgLTM1Myw3ICszNjQsOCBAQAogICAgICAgICAgICAgICAgICAgICBmaW5hbCBQcm92aWRlciBwcm92aWRlciA9IHAucHJvdmlkZXJzLmdldChpKTsKICAgICAgICAgICAgICAgICAgICAgaWYgKHByb3ZpZGVyLmluZm8uZW5hYmxlZAogICAgICAgICAgICAgICAgICAgICAgICAgfHwgKGZsYWdzJlBhY2thZ2VNYW5hZ2VyLkdFVF9ESVNBQkxFRF9DT01QT05FTlRTKSAhPSAwKSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICBwaS5wcm92aWRlcnNbaisrXSA9IGdlbmVyYXRlUHJvdmlkZXJJbmZvKHAucHJvdmlkZXJzLmdldChpKSwgZmxhZ3MsIHVzZXJJZCk7CisgICAgICAgICAgICAgICAgICAgICAgICBwaS5wcm92aWRlcnNbaisrXSA9IGdlbmVyYXRlUHJvdmlkZXJJbmZvKHAucHJvdmlkZXJzLmdldChpKSwgZmxhZ3MsIHN0b3BwZWQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGVuYWJsZWRTdGF0Z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BQkxFRF9TVEFURV9ESVNBQkxFRF9VU0VSKSB7CiAgICAgICAgICAgICAgICAgcC5hcHBsaWNhdGlvbkluZm8uZW5hYmxlZCA9IGZhbHNlOwogICAgICAgICAgICAgfQotICAgICAgICAgICAgcC5hcHBsaWNhdGlvbkluZm8uZW5hYmxlZFNldHRpbmcgPSBwLm1TZXRFbmFibGVkOworICAgICAgICAgICAgcC5hcHBsaWNhdGlvbkluZm8uZW5hYmxlZFNldHRpbmcgPSBlbmFibGVkU3RhdGU7CiAgICAgICAgICAgICByZXR1cm4gcC5hcHBsaWNhdGlvbkluZm87CiAgICAgICAgIH0KIApAQCAtMzM5NywxOCArMzQxMSwxOCBAQAogICAgICAgICBpZiAoIXNDb21wYXRpYmlsaXR5TW9kZUVuYWJsZWQpIHsKICAgICAgICAgICAgIGFpLmRpc2FibGVDb21wYXRpYmlsaXR5TW9kZSgpOwogICAgICAgICB9Ci0gICAgICAgIGlmIChwLm1TZXRTdG9wcGVkKSB7CisgICAgICAgIGlmIChzdG9wcGVkKSB7CiAgICAgICAgICAgICBwLmFwcGxpY2F0aW9uSW5mby5mbGFncyB8PSBBcHBsaWNhdGlvbkluZm8uRkxBR19TVE9QUEVEOwogICAgICAgICB9IGVsc2UgewogICAgICAgICAgICAgcC5hcHBsaWNhdGlvbkluZm8uZmxhZ3MgJj0gfkFwcGxpY2F0aW9uSW5mby5GTEFHX1NUT1BQRUQ7CiAgICAgICAgIH0KLSAgICAgICAgaWYgKHAubVNldEVuYWJsZWQgPT0gUGFja2FnZU1hbmFnZXIuQ09NUE9ORU5UX0VOQUJMRURfU1RBVEVfRU5BQkxFRCkgeworICAgICAgICBpZiAoZW5hYmxlZFN0YXRlID09IFBhY2thZ2VNYW5hZ2VyLkNPTVBPTkVOVF9FTkFCTEVEX1NUQVRFX0VOQUJMRUQpIHsKICAgICAgICAgICAgIGFpLmVuYWJsZWQgPSB0cnVlOwotICAgICAgICB9IGVsc2UgaWYgKHAubVNldEVuYWJsZWQgPT0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ldFNjcm9sbFkoKTsKLSAgICAgICAgICAgICAgICAgICAgZmluYWwgaW50IHJvb3RMZWZ0ID0gcm9vdC5nZXRTY3JvbGxYKCk7Ci0gICAgICAgICAgICAgICAgICAgIG1Gb2N1c2VkUmVjdC5zZXQocm9vdExlZnQsIHJvb3RUb3AsIHJvb3RMZWZ0LCByb290VG9wKTsKKyAgICAgICAgICAgICAgICAgICAgaWYgKGZvY3VzZWQgIT0gbnVsbCAmJiBmb2N1c2VkLmlzTGF5b3V0UnRsKCkpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIHNldEZvY3VzVG9wTGVmdChyb290KTsKKyAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIHNldEZvY3VzQm90dG9tUmlnaHQocm9vdCk7CisgICAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CiAKICAgICAgICAgICAgICAgICBjYXNlIFZpZXcuRk9DVVNfTEVGVDoKICAgICAgICAgICAgICAgICBjYXNlIFZpZXcuRk9DVVNfVVA6Ci0gICAgICAgICAgICAgICAgY2FzZSBWaWV3LkZPQ1VTX0JBQ0tXQVJEOgotICAgICAgICAgICAgICAgICAgICBmaW5hbCBpbnQgcm9vdEJvdHRvbSA9IHJvb3QuZ2V0U2Nyb2xsWSgpICsgcm9vdC5nZXRIZWlnaHQoKTsKLSAgICAgICAgICAgICAgICAgICAgZmluYWwgaW50IHJvb3RSaWdodCA9IHJvb3QuZ2V0U2Nyb2xsWCgpICsgcm9vdC5nZXRXaWR0aCgpOwotICAgICAgICAgICAgICAgICAgICBtRm9jdXNlZFJlY3Quc2V0KHJvb3RSaWdodCwgcm9vdEJvdHRvbSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICByb290UmlnaHQsIHJvb3RCb3R0b20pOworICAgICAgICAgICAgICAgICAgICBzZXRGb2N1c1RvcExlZnQocm9vdCk7CiAgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgIGNhc2UgVmlldy5GT0NVU19CQUNLV0FSRDoKKyAgICAgICAgICAgICAgICAgICAgaWYgKGZvY3VzZWQgIT0gbnVsbCAmJiBmb2N1c2VkLmlzTGF5b3V0UnRsKCkpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIHNldEZvY3VzQm90dG9tUmlnaHQocm9vdCk7CisgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICAgICAgICAgICAgICBzZXRGb2N1c1RvcExlZnQocm9vdCk7CisgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgIH0KICAgICAgICAgfQogICAgICAgICByZXR1cm4gZmluZE5leHRGb2N1cyhyb290LCBmb2N1c2VkLCBtRm9jdXNlZFJlY3QsIGRpcmVjdGlvbik7CiAgICAgfQogCisgICAgcHJpdmF0ZSB2b2lkIHNldEZvY3VzVG9wTGVmdChWaWV3R3JvdXAgcm9vdCkgeworICAgICAgICBmaW5hbCBpbnQgcm9vdEJvdHRvbSA9IHJvb3QuZ2V0U2Nyb2xsWSgpICsgcm9vdC5nZXRIZWlnaHQoKTsKKyAgICAgICAgZmluYWwgaW50IHJvb3RSaWdodCA9IHJvb3QuZ2V0U2Nyb2xsWCgpICsgcm9vdC5nZXRXaWR0aCgpOworICAgICAgICBtRm9jdXNlZFJlY3Quc2V0KHJvb3RSaWdodCwgcm9vdEJvdHRvbSwKKyAgICAgICAgICAgICAgICByb290UmlnaHQsIHJvb3RCb3R0b20pOworICAgIH0KKworICAgIHByaXZhdGUgdm9pZCBzZXRGb2N1c0JvdHRvbVJpZ2h0KFZpZXdHcm91cCByb290KSB7CisgICAgICAgIGZpbmFsIGludCByb290VG9wID0gcm9vdC5nZXRTY3JvbGxZKCk7CisgICAgICAgIGZpbmFsIGludCByb290TGVmdCA9IHJvb3QuZ2V0U2Nyb2xsWCgpOworICAgICAgICBtRm9jdXNlZFJlY3Quc2V0KHJvb3RMZWZ0LCByb290VG9wLCByb290TGVmdCwgcm9vdFRvcCk7CisgICAgfQorCiAgICAgLyoqCiAgICAgICogRmluZCB0aGUgbmV4dCB2aWV3IHRvIHRha2UgZm9jdXMgaW4gcm9vdCdzIGRlc2NlbmRhbnRzLCBzZWFyY2hpbmcgZnJvbQogICAgICAqIGEgcGFydGljdWxhciByZWN0YW5nbGUgaW4gcm9vdCdzIGNvb3JkaW5hdGVzLgpAQCAtMTM1LDIyICsxNTUsMTAgQEAKICAgICAgICAgICAgIGZpbmFsIGludCBjb3VudCA9IGZvY3VzYWJsZXMuc2l6ZSgpOwogICAgICAgICAgICAgc3dpdGNoIChkaXJlY3Rpb24pIHsKICAgICAgICAgICAgICAgICBjYXNlIFZpZXcuRk9DVVNfRk9SV0FSRDoKLSAgICAgICAgICAgICAgICAgICAgaWYgKGZvY3VzZWQgIT0gbnVsbCkgewotICAgICAgICAgICAgICAgICAgICAgICAgaW50IHBvc2l0aW9uID0gZm9jdXNhYmxlcy5sYXN0SW5kZXhPZihmb2N1c2VkKTsKLSAgICAgICAgICAgICAgICAgICAgICAgIGlmIChwb3NpdGlvbiA+PSAwICYmIHBvc2l0aW9uICsgMSA8IGNvdW50KSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGZvY3VzYWJsZXMuZ2V0KHBvc2l0aW9uICsgMSk7Ci0gICAgICAgICAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGZvY3VzYWJsZXMuZ2V0KDApOworICAgICAgICAgICAgICAgICAgICByZXR1cm4gZ2V0Rm9yd2FyZEZvY3VzYWJsZShmb2N1c2VkLCBmb2N1c2FibGVzLCBjb3VudCk7CiAKICAgICAgICAgICAgICAgICBjYXNlIFZpZXcuRk9DVVNfQkFDS1dBUkQ6Ci0gICAgICAgICAgICAgICAgICAgIGlmIChmb2N1c2VkICE9IG51bGwpIHsKLSAgICAgICAgICAgICAgICAgICAgICAgIGludCBwb3NpdGlvbiA9IGZvY3VzYWJsZXMuaW5kZXhPZihmb2N1c2VkKTsKLSAgICAgICAgICAgICAgICAgICAgICAgIGlmIChwb3NpdGlvbiA+IDApIHsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gZm9jdXNhYmxlcy5nZXQocG9zaXRpb24gLSAxKTsKLSAgICAgICAgICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgICAgICByZXR1cm4gZm9jdXNhYmxlcy5nZXQoY291bnQgLSAxKTsKKyAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGdldEJhY2t3YXJkRm9jdXNhYmxlKGZvY3VzZWQsIGZvY3VzYWJsZXMsIGNvdW50KTsKICAgICAgICAgICAgIH0KICAgICAgICAgICAgIHJldHVybiBudWxsOwogICAgICAgICB9CkBAIC0xOTMsNiArMjAxLDM4IEBACiAgICAgICAgIHJldHVybiBjbG9zZXN0OwogICAgIH0KIAorICAgIHByaXZhdGUgVmlldyBnZXRGb3J3YXJkRm9jdXNhYmxlKFZpZXcgZm9jdXNlZCwgQXJyYXlMaXN0PFZpZXc+IGZvY3VzYWJsZXMsIGludCBjb3VudCkgeworICAgICAgICByZXR1cm4gKGZvY3VzZWQgIT0gbnVsbCAmJiBmb2N1c2VkLmlzTGF5b3V0UnRsKCkpID8KKyAgICAgICAgICAgICAgICBnZXRQcmV2aW91c0ZvY3VzYWJsZShmb2N1c2VkLCBmb2N1c2FibGVzLCBjb3VudCkgOgorICAgICAgICAgICAgICAgIGdldE5leHRGb2N1c2FibGUoZm9jdXNlZCwgZm9jdXNhYmxlcywgY291bnQpOworICAgIH0KKworICAgIHByaXZhdGUgVmlldyBnZXROZXh0Rm9jdXNhYmxlKFZpZXcgZm9jdXNlZCwgQXJyYXlMaXN0PFZpZXc+IGZvY3VzYWJsZXMsIGludCBjb3VudCkgeworICAgICAgICBpZiAoZm9jdXNlZCAhPSBudWxsKSB7CisgICAgICAgICAgICBpbnQgcG9zaXRpb24gPSBmb2N1c2FibGVzLmxhc3RJbmRleE9mKGZvY3VzZWQpOworICAgICAgICAgICAgaWYgKHBvc2l0aW9uID49IDAgJiYgcG9zaXRpb24gKyAxIDwgY291bnQpIHsKKyAgICAgICAgICAgICAgICByZXR1cm4gZm9jdXNhYmxlcy5nZXQocG9zaXRpb24gKyAxKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgICAgICByZXR1cm4gZm9jdXNhYmxlcy5nZXQoMCk7CisgICAgfQorCisgICAgcHJpdmF0ZSBWaWV3IGdldEJhY2t3YXJkRm9jdXNhYmxlKFZpZXcgZm9jdXNlZCwgQXJyYXlMaXN0PFZpZXc+IGZvY3VzYWJsZXMsIGludCBjb3VudCkgeworICAgICAgICByZXR1cm4gKGZvY3VzZWQgIT0gbnVsbCAmJiBmb2N1c2VkLmlzTGF5b3V0UnRsKCkpID8KKyAgICAgICAgICAgICAgICBnZXROZXh0Rm9jdXNhYmxlKGZvY3VzZWQsIGZvY3VzYWJsZXMsIGNvdW50KSA6CisgICAgICAgICAgICAgICAgZ2V0UHJldmlvdXNGb2N1c2FibGUoZm9jdXNlZCwgZm9jdXNhYmxlcywgY291bnQpOworICAgIH0KKworICAgIHByaXZhdGUgVmlldyBnZXRQcmV2aW91c0ZvY3VzYWJsZShWaWV3IGZvY3VzZWQsIEFycmF5TGlzdDxWaWV3PiBmb2N1c2FibGVzLCBpbnQgY291bnQpIHsKKyAgICAgICAgaWYgKGZvY3VzZWQgIT0gbnVsbCkgeworICAgICAgICAgICAgaW50IHBvc2l0aW9uID0gZm9jdXNhYmxlcy5pbmRleE9mKGZvY3VzZWQpOworICAgICAgICAgICAgaWYgKHBvc2l0aW9uID4gMCkgeworICAgICAgICAgICAgICAgIHJldHVybiBmb2N1c2FibGVzLmdldChwb3NpdGlvbiAtIDEpOworICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgICAgIHJldHVybiBmb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F9CSVQgc2V0CiAgICAgICAgICAgICBpZiAoc0RpcnR5UmVnaW9ucykgewotICAgICAgICAgICAgICAgIGlmICghKG1EaXJ0eVJlZ2lvbnNFbmFibGVkID0gR0xFUzIwQ2FudmFzLnByZXNlcnZlQmFja0J1ZmZlcigpKSkgeworICAgICAgICAgICAgICAgIGlmICghKG1EaXJ0eVJlZ2lvbnNFbmFibGVkID0gcHJlc2VydmVCYWNrQnVmZmVyKCkpKSB7CiAgICAgICAgICAgICAgICAgICAgIExvZy53KExPR19UQUcsICJCYWNrYnVmZmVyIGNhbm5vdCBiZSBwcmVzZXJ2ZWQiKTsKICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICB9IGVsc2UgaWYgKHNEaXJ0eVJlZ2lvbnNSZXF1ZXN0ZWQpIHsKQEAgLTc4Nyw3ICs4MjQsNyBAQAogICAgICAgICAgICAgICAgIC8vIHdhbnQgdG8gc2V0IG1EaXJ0eVJlZ2lvbnMuIFdlIHRyeSB0byBkbyB0aGlzIG9ubHkgaWYgZGlydHkKICAgICAgICAgICAgICAgICAvLyByZWdpb25zIHdlcmUgaW5pdGlhbGx5IHJlcXVlc3RlZCBhcyBwYXJ0IG9mIHRoZSBkZXZpY2UKICAgICAgICAgICAgICAgICAvLyBjb25maWd1cmF0aW9uIChzZWUgUkVOREVSX0RJUlRZX1JFR0lPTlMpCi0gICAgICAgICAgICAgICAgbURpcnR5UmVnaW9uc0VuYWJsZWQgPSBHTEVTMjBDYW52YXMuaXNCYWNrQnVmZmVyUHJlc2VydmVkKCk7CisgICAgICAgICAgICAgICAgbURpcnR5UmVnaW9uc0VuYWJsZWQgPSBpc0JhY2tCdWZmZXJQcmVzZXJ2ZWQoKTsKICAgICAgICAgICAgIH0KICAgICAgICAgfQogCkBAIC05MjYsNyArOTYzLDYgQEAKICAgICAgICAgICAgICAgICAgICAgfQogCiAgICAgICAgICAgICAgICAgICAgIGJlZ2luRnJhbWUoKTsKLQogICAgICAgICAgICAgICAgICAgICBvblByZURyYXcoZGlydHkpOwogCiAgICAgICAgICAgICAgICAgICAgIEhhcmR3YXJlQ2FudmFzIGNhbnZhcyA9IG1DYW52YXM7CkBAIC05NjYsNyArMTAwMiw2IEBACiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIExvZy5kKCJETFByb3BlcnRpZXMiLCAiZ2V0RGlzcGxheUxpc3QoKTpcdCIgKwogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1Qcm9maWxlRGF0YVttUHJvZmlsZUN1cnJlbnRGcmFtZV0pOwogICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KLQogICAgICAgICAgICAgICAgICAgICAgICAgfQogCiAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoZGlzcGxheUxpc3QgIT0gbnVsbCkgewpAQCAtOTc1LDcgKzEwMTAsNyBAQAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBkcmF3RGlzcGxheUxpc3RTdGFydFRpbWUgPSBTeXN0ZW0ubmFub1RpbWUoKTsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CiAKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBib29sZWFuIGludmFsaWRhdGVOZWVkZWQgPSBjYW52YXMuZHJhd0Rpc3BsYXlMaXN0KGRpc3BsYXlMaXN0LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIGludCBzdGF0dXMgPSBjYW52YXMuZHJhd0Rpc3BsYXlMaXN0KGRpc3BsYXlMaXN0LAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdmlldy5nZXRXaWR0aCgpLCB2aWV3LmdldEhlaWdodCgpLCBtUmVkcmF3Q2xpcCwKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIERpc3BsYXlMaXN0LkZMQUdfQ0xJUF9DSElMRFJFTik7CiAKQEAgLTk4NiwxOSArMTAyMSwxOCBAQAogCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChWaWV3RGVidWcuREVCVUdfTEFURU5DWSkgewogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTG9nLmQoVmlld0RlYnVnLkRFQlVHX0xBVEVOQ1lfVEFHLCAiLSBkcmF3RGlzcGxheUxpc3QoKSB0b29rICIgKwotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0b3RhbCArICJtcywgaW52YWxpZGF0ZU5lZWRlZD0iICsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaW52YWxpZGF0ZU5lZWRlZCArICIuIik7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRvdGFsICsgIm1zLCBzdGF0dXM9IiArIHN0YXR1cyk7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CiAKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoaW52YWxpZGF0ZU5lZWRlZCkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChzdGF0dXMgIT0gRGlzcGxheUxpc3QuU1RBVFVTX0RPTkUpIHsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKG1SZWRyYXdDbGlwLmlzRW1wdHkoKSkgewogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYXR0YWNoSW5mby5tVmlld1Jvb3RJbXBsLmludmFsaWRhdGUoKTsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGF0dGFjaEluZm8ubVZpZXdSb290SW1wbC5pbnZhbGlkYXRlQ2hpbGRJblBhcmVudCgKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbnVsbCwgbVJlZHJhd0NsaXApOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbVJlZHJhd0NsaXAuc2V0RW1wdHkoKTsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBtUmVkcmF3Q2xpcC5zZXRFbXB0eSgpOwogICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gU2hvdWxkbid0IHJlYWNoIGhlcmUKQEAgLTEyMDUsNyArMTIzOSw3IEBACiAgICAgICAgIHZvaWQgc2V0dXAoaW50IHdpZHRoLCBpbnQgaGVpZ2h0KSB7CiAgICAgICAgICAgICBzdXBlci5zZXR1cCh3aWR0aCwgaGVpZ2h0KTsKICAgICAgICAgICAgIGlmIChtVnN5bmNEaXNhYmxlZCkgewotICAgICAgICAgICAgICAgIEdMRVMyMENhbnZhcy5kaXNhYmxlVnN5bmMoKTsKKyAgICAgICAgICAgICAgICBkaXNhYmxlVnN5bmMoKTsKICAgICAgICAgICAgIH0KICAgICAgICAgfQogCkBAIC0xMjQ5LDcgKzEyODMsNyBAQAogICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgIH0KICAgICAgICAgfQotICAgICAgICAKKwogICAgICAgICBAT3ZlcnJpZGUKICAgICAgICAgdm9pZCBkZXN0cm95SGFyZHdhcmVSZXNvdXJjZXMoVmlldyB2aWV3KSB7CiAgICAgICAgICAgICBpZiAodmlldyAhPSBudWxsKSB7CkBAIC0xMjY3LDcgKzEzMDEsNyBAQAogICAgICAgICAgICAgICAgIEdMRVMyMENhbnZhcy5mbHVzaENhY2hlcyhHTEVTMjBDYW52YXMuRkxVU0hfQ0FDSEVTX0xBWUVSUyk7CiAgICAgICAgICAgICB9CiAgICAgICAgIH0KLSAgICAgICAgCisKICAgICAgICAgcHJpdmF0ZSBzdGF0aWMgdm9pZCBkZXN0cm95UmVzb3VyY2VzKFZpZXcgdmlldykgewogICAgICAgICAgICAgdmlldy5kZXN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gICAgICEobVBhcmVudCBpbnN0YW5jZW9mIFZpZXdHcm91cCkgfHwgKChWaWV3R3JvdXApbVBhcmVudCkubURyYXdMYXllcnMpID8KICAgICAgICAgICAgICAgICAgICAgICAgIGdldExheWVyVHlwZSgpIDogTEFZRVJfVFlQRV9OT05FOwotICAgICAgICAgICAgICAgIGlmICghaXNMYXllciAmJiBsYXllclR5cGUgPT0gTEFZRVJfVFlQRV9IQVJEV0FSRSAmJiBVU0VfRElTUExBWV9MSVNUX1BST1BFUlRJRVMpIHsKLSAgICAgICAgICAgICAgICAgICAgZmluYWwgSGFyZHdhcmVMYXllciBsYXllciA9IGdldEhhcmR3YXJlTGF5ZXIoKTsKLSAgICAgICAgICAgICAgICAgICAgaWYgKGxheWVyICE9IG51bGwgJiYgbGF5ZXIuaXNWYWxpZCgpKSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICBjYW52YXMuZHJhd0hhcmR3YXJlTGF5ZXIobGF5ZXIsIDAsIDAsIG1MYXllclBhaW50KTsKKyAgICAgICAgICAgICAgICBpZiAoIWlzTGF5ZXIgJiYgbGF5ZXJUeXBlICE9IExBWUVSX1RZUEVfTk9ORSAmJiBVU0VfRElTUExBWV9MSVNUX1BST1BFUlRJRVMpIHsKKyAgICAgICAgICAgICAgICAgICAgaWYgKGxheWVyVHlwZSA9PSBMQVlFUl9UWVBFX0hBUkRXQVJFKSB7CisgICAgICAgICAgICAgICAgICAgICAgICBmaW5hbCBIYXJkd2FyZUxheWVyIGxheWVyID0gZ2V0SGFyZHdhcmVMYXllcigpOworICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGxheWVyICE9IG51bGwgJiYgbGF5ZXIuaXNWYWxpZCgpKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgY2FudmFzLmRyYXdIYXJkd2FyZUxheWVyKGxheWVyLCAwLCAwLCBtTGF5ZXJQYWludCk7CisgICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNhbnZhcy5zYXZlTGF5ZXIoMCwgMCwgbVJpZ2h0IC0gbUxlZnQsIG1Cb3R0b20gLSBtVG9wLCBtTGF5ZXJQYWludCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIENhbnZhcy5IQVNfQUxQSEFfTEFZRVJfU0FWRV9GTEFHIHwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgQ2FudmFzLkNMSVBfVE9fTEFZRVJfU0FWRV9GTEFHKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgICAgIGNhY2hpbmcgPSB0cnVlOwogICAgICAgICAgICAgICAgICAgICB9IGVsc2UgewotICAgICAgICAgICAgICAgICAgICAgICAgY2FudmFzLnNhdmVMYXllcigwLCAwLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBtUmlnaHQgLSBtTGVmdCwgbUJvdHRvbSAtIG1Ub3AsIG1MYXllclBhaW50LAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBDYW52YXMuSEFTX0FMUEhBX0xBWUVSX1NBVkVfRkxBRyB8IENhbnZhcy5DTElQX1RPX0xBWUVSX1NBVkVfRkxBRyk7CisgICAgICAgICAgICAgICAgICAgICAgICBidWlsZERyYXdpbmdDYWNoZSh0cnVlKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIEJpdG1hcCBjYWNoZSA9IGdldERyYXdpbmdDYWNoZSh0cnVlKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIGlmIChjYWNoZSAhPSBudWxsKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgY2FudmFzLmRyYXdCaXRtYXAoY2FjaGUsIDAsIDAsIG1MYXllclBhaW50KTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBjYWNoaW5nID0gdHJ1ZTsKKyAgICAgICAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgICAgICBjYWNoaW5nID0gdHJ1ZTsKICAgICAgICAgICAgICAgICB9IGVsc2UgewogCiAgICAgICAgICAgICAgICAgICAgIGNvbXB1dGVTY3JvbGwoKTsKQEAgLTExMzk1LDcgKzExNDA0LDExIEBACiAgICAgICAgICAgICAgICAgICAgICAgICBtVHJhbnNmb3JtYXRpb25JbmZvLm1Sb3RhdGlvbiwgbVRyYW5zZm9ybWF0aW9uSW5mby5tUm90YXRpb25YLAogICAgICAgICAgICAgICAgICAgICAgICAgbVRyYW5zZm9ybWF0aW9uSW5mby5tUm90YXRpb25ZLCBtVHJhbnNmb3JtYXRpb25JbmZvLm1TY2FsZVgsCiAgICAgICAgICAgICAgICAgICAgICAgICBtVHJhbnNmb3JtYXRpb25JbmZvLm1TY2FsZVkpOwotICAgICAgICAgICAgICAgIGRpc3BsYXlMaXN0LnNldENhbWVyYURpc3RhbmNlKGdldENhbWVyYURpc3RhbmNlKCkpOworICAgICAgICAgICAgICAgIGlmIChtVHJhbnNmb3JtYXRpb25JbmZvLm1DYW1lcmEgPT0gbnVsbCkgeworICAgICAgICAgICAgICAgICAgICBtVHJhbnNmb3JtYXRpb25JbmZvLm1DYW1lcmEgPSBuZXcgQ2FtZXJhKCk7CisgICAgICAgICAgICAgICAgICAgIG1UcmFuc2Zvcm1hdGlvbkluZm8ubWF0cml4M0QgPSBuZXcgTWF0cml4KCk7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIGRpc3BsYXlMaXN0LnNldENhbWVyYURpc3RhbmNlKG1UcmFuc2Zvcm1hdGlvbkluZm8ubUNhbWVyYS5nZXRMb2NhdGlvblooKSk7CiAgICAgICAgICAgICAgICAgaWYgKChtUHJpdmF0ZUZsYWdzICYgUElWT1RfRVhQTElDSVRMWV9TRVQpID09IFBJVk9UX0VYUExJQ0lUTFlfU0VUKSB7CiAgICAgICAgICAgICAgICAgICAgIGRpc3BsYXlMaXN0LnNldFBpdm90WChnZXRQaXZvdFgoKSk7CiAgICAgICAgICAgICAgICAgICAgIGRpc3BsYXlMaXN0LnNldFBpdm90WShnZXRQaXZvdFkoKSk7CkBAIC0xMTQ4OSw4ICsxMTUwMiwxMiBAQAogICAgICAgICAgICAgfSBlbHNlIHsKICAgICAgICAgICAgICAgICBzd2l0Y2ggKGxheWVyVHlwZSkgewogICAgICAgICAgICAgICAgICAgICBjYXNlIExBWUVSX1RZUEVfU09GVFdBUkU6Ci0gICAgICAgICAgICAgICAgICAgICAgICBidWlsZERyYXdpbmdDYWNoZSh0cnVlKTsKLSAgICAgICAgICAgICAgICAgICAgICAgIGNhY2hlID0gZ2V0RHJhd2luZ0NhY2hlKHRydWUpOworICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHVzZURpc3BsYXlMaXN0UHJvcGVydGllcykgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGhhc0Rpc3BsYXlMaXN0ID0gY2FuSGF2ZURpc3BsYXlMaXN0KCk7CisgICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJ1aWxkRHJhd2luZ0NhY2hlKHRydWUpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNhY2hlID0gZ2V0RHJhd2luZ0NhY2hlKHRydWUpOworICAgICAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CiAgICAgICAgICAgICAgICAgICAgIGNhc2UgTEFZRVJfVFlQRV9IQVJEV0FSRToKICAgICAgICAgICAgICAgICAgICAgICAgIGlmICh1c2VEaXNwbGF5TGlzdFByb3BlcnRpZXMpIHsKZGlmZiAtLWdpdCBhL2NvcmUvamF2YS9hbmRyb2lkL3ZpZXcvVmlld0dyb3VwLmphdmEgYi9jb3JlL2phdmEvYW5kcm9pZC92aWV3L1ZpZXdHcm91cC5qYXZhCmluZGV4IDZjY2FjNzguLjMwZDZlYzcgMTAwNjQ0Ci0tLSBhL2NvcmUvamF2YS9hbmRyb2lkL3ZpZXcvVmlld0dyb3VwLmphdmEKKysrIGIvY29yZS9qYXZhL2FuZHJvaWQvdmlldy9WaWV3R3JvdXAuamF2YQpAQCAtMzkwNiw5ICszOTA2LDE1IEBACiAgICAgICAgICAgICBkbyB7CiAgICAgICAgICAgICAgICAgaWYgKHBhcmVudCBpbnN0YW5jZW9mIFZpZXdHcm91cCkgewogICAgICAgICAgICAgICAgICAgICBWaWV3R3JvdXAgcGFyZW50VkcgPSAoVmlld0dyb3VwKSBwYXJlbnQ7Ci0gICAgICAgICAgICAgICAgICAgIHBhcmVudCA9IHBhcmVudFZHLmludmFsaWRhdGVDaGlsZEluUGFyZW50RmFzdChsZWZ0LCB0b3AsIGRpcnR5KTsKLSAgICAgICAgICAgICAgICAgICAgbGVmdCA9IHBhcmVudFZHLm1MZWZ0OwotICAgICAgICAgICAgICAgICAgICB0b3AgPSBwYXJlbnRWRy5tVG9wOworICAgICAgICAgICAgICAgICAgICBpZiAocGFyZW50VkcubUxheWVyVHlwZSAhPSBMQVlFUl9UWVBFX05PTkUpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIC8vIExheWVyZWQgcGFyZW50cyBzaG91bGQgYmUgcmVjcmVhdGVkLCBub3QganVzdCByZS1pc3N1ZWQKKyAgICAgICAgICAgICAgICAgICAgICAgIHBhcmVudFZHLmludmFsaWRhdGUoKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIHBhcmVudCA9IG51bGw7CisgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICAgICAgICAgICAgICBwYXJlbnQgPSBwYXJlbnRWRy5pbnZhbGlkYXRlQ2hpbGRJblBhcmVudEZhc3QobGVmdCwgdG9wLCBkaXJ0eSk7CisgICAgICAgICAgICAgICAgICAgICAgICBsZWZ0ID0gcGFyZW50VkcubUxlZnQ7CisgICAgICAgICAgICAgICAgICAgICAgICB0b3AgPSBwYXJlbnRWRy5tVG9wOworICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAg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sIHx8IHVybC5sZW5ndGgoKSA9PSAwKSB7CkBAIC03MzYsOCArNzMzLDYgQEAKICAgICAgICAgICAgICAgICBMb2cuZShMT0dUQUcsICJFeGNlcHRpb246ICIgKyB1cmwpOwogICAgICAgICAgICAgICAgIHJldHVybiBudWxsOwogICAgICAgICAgICAgfQotCi0gICAgICAgIC8vIGZpbGU6Ly8vYW5kcm9pZF9hc3NldAogICAgICAgICB9IGVsc2UgaWYgKHVybC5zdGFydHNXaXRoKEFORFJPSURfQVNTRVQpKSB7CiAgICAgICAgICAgICB1cmwgPSB1cmwucmVwbGFjZUZpcnN0KEFORFJPSURfQVNTRVQsICIiKTsKICAgICAgICAgICAgIHRyeSB7CkBAIC03NDcsOCArNzQyLDYgQEAKICAgICAgICAgICAgIH0gY2F0Y2ggKElPRXhjZXB0aW9uIGUpIHsKICAgICAgICAgICAgICAgICByZXR1cm4gbnVsbDsKICAgICAgICAgICAgIH0KLQotICAgICAgICAvLyBjb250ZW50Oi8vCiAgICAgICAgIH0gZWxzZSBpZiAobVNldHRpbmdzLmdldEFsbG93Q29udGVudEFjY2VzcygpICYmCiAgICAgICAgICAgICAgICAgICAgdXJsLnN0YXJ0c1dpdGgoQU5EUk9JRF9DT05URU5UKSkgewogICAgICAgICAgICAgdHJ5IHsKZGlmZiAtLWdpdCBhL2NvcmUvamF2YS9hbmRyb2lkL3dlYmtpdC9DYWNoZU1hbmFnZXIuamF2YSBiL2NvcmUvamF2YS9hbmRyb2lkL3dlYmtpdC9DYWNoZU1hbmFnZXIuamF2YQppbmRleCA2YTg1ZTAwLi42NzFjMDY0IDEwMDY0NAotLS0gYS9jb3JlL2phdmEvYW5kcm9pZC93ZWJraXQvQ2FjaGVNYW5hZ2VyLmphdmEKKysrIGIvY29yZS9qYXZhL2FuZHJvaWQvd2Via2l0L0NhY2hlTWFuYWdlci5qYXZhCkBAIC0xNywyNSArMTcsMTggQEAKIHBhY2thZ2UgYW5kcm9pZC53ZWJraXQ7CiAKIGltcG9yd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gIHN0YXRpYyBmaW5hbCBieXRlIE1PREVfUkVQTEFDRUQgPSAzOwotCi0gICAgICAgIFN0cmluZyBkb21haW47Ci0KLSAgICAgICAgU3RyaW5nIHBhdGg7Ci0KLSAgICAgICAgU3RyaW5nIG5hbWU7Ci0KLSAgICAgICAgU3RyaW5nIHZhbHVlOwotCi0gICAgICAgIGxvbmcgZXhwaXJlczsKLQotICAgICAgICBsb25nIGxhc3RBY2Vzc1RpbWU7Ci0KLSAgICAgICAgbG9uZyBsYXN0VXBkYXRlVGltZTsKLQotICAgICAgICBib29sZWFuIHNlY3VyZTsKLQotICAgICAgICBieXRlIG1vZGU7Ci0KLSAgICAgICAgQ29va2llKCkgewotICAgICAgICB9Ci0KLSAgICAgICAgQ29va2llKFN0cmluZyBkZWZhdWx0RG9tYWluLCBTdHJpbmcgZGVmYXVsdFBhdGgpIHsKLSAgICAgICAgICAgIGRvbWFpbiA9IGRlZmF1bHREb21haW47Ci0gICAgICAgICAgICBwYXRoID0gZGVmYXVsdFBhdGg7Ci0gICAgICAgICAgICBleHBpcmVzID0gLTE7Ci0gICAgICAgIH0KLQotICAgICAgICBib29sZWFuIGV4YWN0TWF0Y2goQ29va2llIGluKSB7Ci0gICAgICAgICAgICAvLyBBbiBleGFjdCBtYXRjaCBtZWFucyB0aGF0IGRvbWFpbiwgcGF0aCwgYW5kIG5hbWUgYXJlIGVxdWFsLiBJZgotICAgICAgICAgICAgLy8gYm90aCB2YWx1ZXMgYXJlIG51bGwsIHRoZSBjb29raWVzIG1hdGNoLiBJZiBib3RoIHZhbHVlcyBhcmUKLSAgICAgICAgICAgIC8vIG5vbi1udWxsLCB0aGUgY29va2llcyBtYXRjaC4gSWYgb25lIHZhbHVlIGlzIG51bGwgYW5kIHRoZSBvdGhlcgotICAgICAgICAgICAgLy8gaXMgbm9uLW51bGwsIHRoZSBjb29raWVzIGRvIG5vdCBtYXRjaCAoaS5lLiAiZm9vPTsiIGFuZCAiZm9vOyIpCi0gICAgICAgICAgICBib29sZWFuIHZhbHVlc01hdGNoID0gISgodmFsdWUgPT0gbnVsbCkgXiAoaW4udmFsdWUgPT0gbnVsbCkpOwotICAgICAgICAgICAgcmV0dXJuIGRvbWFpbi5lcXVhbHMoaW4uZG9tYWluKSAmJiBwYXRoLmVxdWFscyhpbi5wYXRoKSAmJgotICAgICAgICAgICAgICAgICAgICBuYW1lLmVxdWFscyhpbi5uYW1lKSAmJiB2YWx1ZXNNYXRjaDsKLSAgICAgICAgfQotCi0gICAgICAgIGJvb2xlYW4gZG9tYWluTWF0Y2goU3RyaW5nIHVybEhvc3QpIHsKLSAgICAgICAgICAgIGlmIChkb21haW4uc3RhcnRzV2l0aCgiLiIpKSB7Ci0gICAgICAgICAgICAgICAgaWYgKHVybEhvc3QuZW5kc1dpdGgoZG9tYWluLnN1YnN0cmluZygxKSkpIHsKLSAgICAgICAgICAgICAgICAgICAgaW50IGxlbiA9IGRvbWFpbi5sZW5ndGgoKTsKLSAgICAgICAgICAgICAgICAgICAgaW50IHVybExlbiA9IHVybEhvc3QubGVuZ3RoKCk7Ci0gICAgICAgICAgICAgICAgICAgIGlmICh1cmxMZW4gPiBsZW4gLSAxKSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICAvLyBtYWtlIHN1cmUgYmFyLmNvbSBkb2Vzbid0IG1hdGNoIC5hci5jb20KLSAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiB1cmxIb3N0LmNoYXJBdCh1cmxMZW4gLSBsZW4pID09IFBFUklPRDsKLSAgICAgICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgICAgICByZXR1cm4gdHJ1ZTsKLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgcmV0dXJuIGZhbHNlOwotICAgICAgICAgICAgfSBlbHNlIHsKLSAgICAgICAgICAgICAgICAvLyBleGFjdCBtYXRjaCBpZiBkb21haW4gaXMgbm90IGxlYWRpbmcgdy8gZG90Ci0gICAgICAgICAgICAgICAgcmV0dXJuIHVybEhvc3QuZXF1YWxzKGRvbWFpbik7Ci0gICAgICAgICAgICB9Ci0gICAgICAgIH0KLQotICAgICAgICBib29sZWFuIHBhdGhNYXRjaChTdHJpbmcgdXJsUGF0aCkgewotICAgICAgICAgICAgaWYgKHVybFBhdGguc3RhcnRzV2l0aChwYXRoKSkgewotICAgICAgICAgICAgICAgIGludCBsZW4gPSBwYXRoLmxlbmd0aCgpOwotICAgICAgICAgICAgICAgIGlmIChsZW4gPT0gMCkgewotICAgICAgICAgICAgICAgICAgICBMb2cudyhMT0dUQUcsICJFbXB0eSBjb29raWUgcGF0aCIpOwotICAgICAgICAgICAgICAgICAgICByZXR1cm4gZmFsc2U7Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgIGludCB1cmxMZW4gPSB1cmxQYXRoLmxlbmd0aCgpOwotICAgICAgICAgICAgICAgIGlmIChwYXRoLmNoYXJBdChsZW4tMSkgIT0gUEFUSF9ERUxJTSAmJiB1cmxMZW4gPiBsZW4pIHsKLSAgICAgICAgICAgICAgICAgICAgLy8gbWFrZSBzdXJlIC93ZWUgZG9lc24ndCBtYXRjaCAvd2UKLSAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHVybFBhdGguY2hhckF0KGxlbikgPT0gUEFUSF9ERUxJTTsKLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgcmV0dXJuIHRydWU7Ci0gICAgICAgICAgICB9Ci0gICAgICAgICAgICByZXR1cm4gZmFsc2U7Ci0gICAgICAgIH0KLQotICAgICAgICBwdWJsaWMgU3RyaW5nIHRvU3RyaW5nKCkgewotICAgICAgICAgICAgcmV0dXJuICJkb21haW46ICIgKyBkb21haW4gKyAiOyBwYXRoOiAiICsgcGF0aCArICI7IG5hbWU6ICIgKyBuYW1lCi0gICAgICAgICAgICAgICAgICAgICsgIjsgdmFsdWU6ICIgKyB2YWx1ZTsKLSAgICAgICAgfQotICAgIH0KLQotICAgIHByaXZhdGUgc3RhdGljIGZpbmFsIENvb2t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ZmY7Ci0KLSAgICAgICAgICAgIC8vIElmIGNvb2tpZTIgaGFzIGEgbnVsbCB2YWx1ZSwgaXQgc2hvdWxkIGNvbWUgbGF0ZXIgaW4KLSAgICAgICAgICAgIC8vIHRoZSBsaXN0LgotICAgICAgICAgICAgaWYgKGNvb2tpZTIudmFsdWUgPT0gbnVsbCkgewotICAgICAgICAgICAgICAgIC8vIElmIGJvdGggY29va2llcyBoYXZlIG51bGwgdmFsdWVzLCBmYWxsIGJhY2sgdG8gdXNpbmcgdGhlIG5hbWUKLSAgICAgICAgICAgICAgICAvLyBkaWZmZXJlbmNlLgotICAgICAgICAgICAgICAgIGlmIChjb29raWUxLnZhbHVlICE9IG51bGwpIHsKLSAgICAgICAgICAgICAgICAgICAgcmV0dXJuIC0xOwotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgIH0gZWxzZSBpZiAoY29va2llMS52YWx1ZSA9PSBudWxsKSB7Ci0gICAgICAgICAgICAgICAgLy8gTm93IHdlIGtub3cgdGhhdCBjb29raWUyIGRvZXMgbm90IGhhdmUgYSBudWxsIHZhbHVlLCBpZgotICAgICAgICAgICAgICAgIC8vIGNvb2tpZTEgaGFzIGEgbnVsbCB2YWx1ZSwgcGxhY2UgaXQgbGF0ZXIgaW4gdGhlIGxpc3QuCi0gICAgICAgICAgICAgICAgcmV0dXJuIDE7Ci0gICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgIC8vIEZhbGxiYWNrIHRvIGNvbXBhcmluZyB0aGUgbmFtZSB0byBlbnN1cmUgY29uc2lzdGVudCBvcmRlci4KLSAgICAgICAgICAgIHJldHVybiBjb29raWUxLm5hbWUuY29tcGFyZVRvKGNvb2tpZTIubmFtZSk7Ci0gICAgICAgIH0KLSAgICB9Ci0KICAgICBwcml2YXRlIENvb2tpZU1hbmFnZXIoKSB7CiAgICAgfQogCmRpZmYgLS1naXQgYS9jb3JlL2phdmEvYW5kcm9pZC93ZWJraXQvQ29va2llU3luY01hbmFnZXIuamF2YSB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AgKiBub3Qgd29yayBpZiB0aGUgcXVhZHJpbGF0ZXJhbCBpcyBzZWxmLWludGVyc2VjdGluZyBvciBpZiBhbnkgaW5uZXIKKyAgICAgKiBhbmdsZSBpcyByZWZsZXggKGdyZWF0ZXIgdGhhbiAxODAgZGVncmVlcykuCisgICAgICovCisgICAgcHVibGljIGJvb2xlYW4gY29udGFpbnNQb2ludChmbG9hdCB4LCBmbG9hdCB5KSB7CisgICAgICAgIHJldHVybiBpc1BvaW50SW5UcmlhbmdsZSh4LCB5LCBwMSwgcDIsIHAzKSB8fAorICAgICAgICAgICAgICAgIGlzUG9pbnRJblRyaWFuZ2xlKHgsIHksIHAxLCBwMywgcDQpOworICAgIH0KKworICAgIEBPdmVycmlkZQorICAgIHB1YmxpYyBTdHJpbmcgdG9TdHJpbmcoKSB7CisgICAgICAgIFN0cmluZ0J1aWxkZXIgcyA9IG5ldyBTdHJpbmdCdWlsZGVyKCJRdWFkRigiKTsKKyAgICAgICAgcy5hcHBlbmQocDEueCkuYXBwZW5kKCIsIikuYXBwZW5kKHAxLnkpOworICAgICAgICBzLmFwcGVuZCgiIC0gIik7CisgICAgICAgIHMuYXBwZW5kKHAyLngpLmFwcGVuZCgiLCIpLmFwcGVuZChwMi55KTsKKyAgICAgICAgcy5hcHBlbmQoIiAtICIpOworICAgICAgICBzLmFwcGVuZChwMy54KS5hcHBlbmQoIiwiKS5hcHBlbmQocDMueSk7CisgICAgICAgIHMuYXBwZW5kKCIgLSAiKTsKKyAgICAgICAgcy5hcHBlbmQocDQueCkuYXBwZW5kKCIsIikuYXBwZW5kKHA0LnkpOworICAgICAgICBzLmFwcGVuZCgiKSIpOworICAgICAgICByZXR1cm4gcy50b1N0cmluZygpOworICAgIH0KKworICAgIHByaXZhdGUgc3RhdGljIGJvb2xlYW4gaXNQb2ludEluVHJpYW5nbGUoZmxvYXQgeDAsIGZsb2F0IHkwLAorICAgICAgICAgICAgUG9pbnRGIHIxLCBQb2ludEYgcjIsIFBvaW50RiByMykgeworICAgICAgICAvLyBVc2UgdGhlIGJhcnljZW50cmljIHRlY2huaXF1ZQorICAgICAgICBmbG9hdCB4MTMgPSByMS54IC0gcjMueDsKKyAgICAgICAgZmxvYXQgeTEzID0gcjEueSAtIHIzLnk7CisgICAgICAgIGZsb2F0IHgyMyA9IHIyLnggLSByMy54OworICAgICAgICBmbG9hdCB5MjMgPSByMi55IC0gcjMueTsKKyAgICAgICAgZmxvYXQgeDAzID0geDAgLSByMy54OworICAgICAgICBmbG9hdCB5MDMgPSB5MCAtIHIzLnk7CisKKyAgICAgICAgZmxvYXQgZGV0ZXJtaW5hbnQgPSAoeTIzICogeDEzKSAtICh4MjMgKiB5MTMpOworICAgICAgICBmbG9hdCBsYW1iZGExID0gKCh5MjMgKiB4MDMpIC0gKHgyMyAqIHkwMykpL2RldGVybWluYW50OworICAgICAgICBmbG9hdCBsYW1iZGEyID0gKCh4MTMgKiB5MDMpIC0gKHkxMyAqIHgwMykpL2RldGVybWluYW50OworICAgICAgICBmbG9hdCBsYW1iZGEzID0gMSAtIGxhbWJkYTEgLSBsYW1iZGEyOworICAgICAgICByZXR1cm4gbGFtYmRhMSA+PSAwLjBmICYmIGxhbWJkYTIgPj0gMC4wZiAmJiBsYW1iZGEzID49IDAuMGY7CisgICAgfQorfQpkaWZmIC0tZ2l0IGEvY29yZS9qYXZhL2FuZHJvaWQvd2Via2l0L1VSTFV0aWwuamF2YSBiL2NvcmUvamF2YS9hbmRyb2lkL3dlYmtpdC9VUkxVdGlsLmphdmEKaW5kZXggOTk3MGM5My4uYjQ3ZjA0ZiAxMDA2NDQKLS0tIGEvY29yZS9qYXZhL2FuZHJvaWQvd2Via2l0L1VSTFV0aWwuamF2YQorKysgYi9jb3JlL2phdmEvYW5kcm9pZC93ZWJraXQvVVJMVXRpbC5qYXZhCkBAIC0zOCw2ICszOCw3IEBACiAgICAgc3RhdGljIGZpbmFsIFN0cmluZyBSRVNPVVJDRV9CQVNFID0gImZpbGU6Ly8vYW5kcm9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ICAgaW50IHdpZHRoID0gbUNvbnRlbnRWaWV3LmdldE1lYXN1cmVkV2lkdGgoKTsKICAgICAgICAgICAgIGludCBoZWlnaHQgPSBtQ29udGVudFZpZXcuZ2V0TWVhc3VyZWRIZWlnaHQoKTsKLSAgICAgICAgICAgIGludCB5ID0gY3Vyc29yUmVjdC50b3AgLSBoZWlnaHQ7CisgICAgICAgICAgICBpbnQgeSA9IGN1cnNvclRvcC55IC0gaGVpZ2h0OworICAgICAgICAgICAgaW50IHggPSBjdXJzb3JUb3AueCAtICh3aWR0aCAvIDIpOwogICAgICAgICAgICAgaWYgKHkgPCB3aW5kb3dUb3ApIHsKICAgICAgICAgICAgICAgICAvLyBUaGVyZSdzIG5vdCBlbm91Z2ggcm9vbSB2ZXJ0aWNhbGx5LCBtb3ZlIGl0IGJlbG93IHRoZQogICAgICAgICAgICAgICAgIC8vIGhhbmRsZS4KLSAgICAgICAgICAgICAgICAvLyBUaGUgc2VsZWN0aW9uIGhhbmRsZSBpcyB2ZXJ0aWNhbGx5IG9mZnNldCBieSAxLzQgb2YgdGhlCi0gICAgICAgICAgICAgICAgLy8gbGluZSBoZWlnaHQuCiAgICAgICAgICAgICAgICAgZW5zdXJlU2VsZWN0aW9uSGFuZGxlcygpOwotICAgICAgICAgICAgICAgIHkgPSBjdXJzb3JSZWN0LmJvdHRvbSAtIChjdXJzb3JSZWN0LmhlaWdodCgpIC8gNCkgKwotICAgICAgICAgICAgICAgICAgICAgICAgbVNlbGVjdEhhbmRsZUNlbnRlci5nZXRJbnRyaW5zaWNIZWlnaHQoKTsKKyAgICAgICAgICAgICAgICB5ID0gY3Vyc29yQm90dG9tLnkgKyBtU2VsZWN0SGFuZGxlQ2VudGVyLmdldEludHJpbnNpY0hlaWdodCgpOworICAgICAgICAgICAgICAgIHggPSBjdXJzb3JCb3R0b20ueCAtICh3aWR0aCAvIDIpOwogICAgICAgICAgICAgfQotICAgICAgICAgICAgaW50IHggPSBjdXJzb3JSZWN0LmNlbnRlclg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IGNvb3JkaW5hdGUgb2YgdGhlIHBvaW50IG5lYXIgc2VnbWVudCBBQiB0aGF0IGRldGVybWluZXMKKyAgICAgKiB0aGUgc2NhbGUgZmFjdG9yLgorICAgICAqIEBwYXJhbSBhIFRoZSBmaXJzdCBwb2ludCBvZiB0aGUgbGluZSBzZWdtZW50LgorICAgICAqIEBwYXJhbSBiIFRoZSBzZWNvbmQgcG9pbnQgb2YgdGhlIGxpbmUgc2VnbWVudC4KKyAgICAgKiBAcmV0dXJuIFRoZSBzY2FsZSBmYWN0b3IgQUMvQUIsIHdoZXJlIEMgaXMgdGhlIHBvaW50IG9uIEFCIGNsb3Nlc3QgdG8KKyAgICAgKiAgICAgICAgIHBvaW50LgorICAgICAqLworICAgIHByaXZhdGUgc3RhdGljIGZsb2F0IHNjYWxlQWxvbmdTZWdtZW50KGludCB4LCBpbnQgeSwgUG9pbnRGIGEsIFBvaW50RiBiKSB7CisgICAgICAgIC8vIFRoZSBib3R0b20gbGluZSBvZiB0aGUgdGV4dCBib3ggaXMgbGluZSBBQgorICAgICAgICBmbG9hdCBhYlggPSBiLnggLSBhLng7CisgICAgICAgIGZsb2F0IGFiWSA9IGIueSAtIGEueTsKKyAgICAgICAgZmxvYXQgYWIyID0gKGFiWCAqIGFiWCkgKyAoYWJZICogYWJZKTsKKworICAgICAgICAvLyBUaGUgbGluZSBmcm9tIGZpcnN0IHBvaW50IGluIHRleHQgYm91bmRzIHRvIGJvdHRvbSBpcyBBUAorICAgICAgICBmbG9hdCBhcFggPSB4IC0gYS54OworICAgICAgICBmbG9hdCBhcFkgPSB5IC0gYS55OworICAgICAgICBmbG9hdCBhYkRvdEFQID0gKGFwWCAqIGFiWCkgKyAoYXBZICogYWJZKTsKKyAgICAgICAgZmxvYXQgc2NhbGUgPSBhYkRvdEFQIC8gYWIyOworICAgICAgICByZXR1cm4gc2NhbGU7CisgICAgfQorCisgICAgLyoqCisgICAgICogQXNzdW1pbmcgYXJiaXRyYXJ5IHNoYXBlIG9m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TdGFydGVkID0gZmFsc2U7CiAgICAgICAgICAgICAgICAgICAgIGlmIChtU2VsZWN0aW5nVGV4dCkgeworICAgICAgICAgICAgICAgICAgICAgICAgZW5zdXJlU2VsZWN0aW9uSGFuZGxlcygpOwogICAgICAgICAgICAgICAgICAgICAgICAgaW50IHNoaWZ0ZWRZID0geSAtIGdldFRpdGxlSGVpZ2h0KCkgKyBnZXRTY3JvbGxZKCk7CiAgICAgICAgICAgICAgICAgICAgICAgICBpbnQgc2hpZnRlZFggPSB4ICsgZ2V0U2Nyb2xsWCgpOwogICAgICAgICAgICAgICAgICAgICAgICAgaWYgKG1TZWxlY3RIYW5kbGVDZW50ZXIgIT0gbnVsbCAmJiBtU2VsZWN0SGFuZGxlQ2VudGVyLmdldEJvdW5kcygpCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC5jb250YWlucyhzaGlmdGVkWCwgc2hpZnRlZFkpKSB7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbVNlbGVjdGlvblN0YXJ0ZWQgPSB0cnVlOwogICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1TZWxlY3REcmFnZ2luZ0N1cnNvciA9IG1TZWxlY3RDdXJzb3JCYXNlOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1TZWxlY3REcmFnZ2luZ09mZnNldCA9IG1TZWxlY3RIYW5kbGVDZW50ZXJPZmZzZXQ7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgbVNlbGVjdERyYWdnaW5nVGV4dFF1YWQgPSBtU2VsZWN0Q3Vyc29yQmFzZVRleHRRdWFkOwogICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1Qcml2YXRlSGFuZGxlci5yZW1vdmVNZXNzYWdlcyhDTEVBUl9DQVJFVF9IQU5ETEUpOwogICAgICAgICAgICAgICAgICAgICAgICAgICAgIGhpZGVQYXN0ZUJ1dHRvbigpOwogICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIGlmIChtU2VsZWN0SGFuZGxlTGVmdCAhPSBudWxsCkBAIC01OTgxLDE5ICs2MDkxLDE4IEBACiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAuY29udGFpbnMoc2hpZnRlZFgsIHNoaWZ0ZWRZKSkgewogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBtU2VsZWN0aW9uU3RhcnRlZCA9IHRydWU7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1TZWxlY3REcmFnZ2luZ0N1cnNvciA9IG1TZWxlY3RDdXJzb3JCYXNlOworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBtU2VsZWN0RHJhZ2dpbmdPZmZzZXQgPSBtU2VsZWN0SGFuZGxlTGVmdE9mZnNldDsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbVNlbGVjdERyYWdnaW5nVGV4dFF1YWQgPSBtU2VsZWN0Q3Vyc29yQmFzZVRleHRRdWFkOwogICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIGlmIChtU2VsZWN0SGFuZGxlUmlnaHQgIT0gbnVsbAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiBtU2VsZWN0SGFuZGxlUmlnaHQuZ2V0Qm91bmRzKCkKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLmNvbnRhaW5zKHNoaWZ0ZWRYLCBzaGlmdGVkWSkpIHsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICBtU2VsZWN0aW9uU3RhcnRlZCA9IHRydWU7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbVNlbGVjdERyYWdnaW5nQ3Vyc29yID0gbVNlbGVjdEN1cnNvckV4dGVudDsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBtU2VsZWN0RHJhZ2dpbmdPZmZzZXQgPSBtU2VsZWN0SGFuZGxlUmlnaHRPZmZzZXQ7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgbVNlbGVjdERyYWdnaW5nVGV4dFF1YWQgPSBtU2VsZWN0Q3Vyc29yRXh0ZW50VGV4dFF1YWQ7CiAgICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKG1Jc0NhcmV0U2VsZWN0aW9uKSB7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2VsZWN0aW9uRG9uZSgpOwogICAgICAgICAgICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgICAgICAgICAgaWYgKG1TZWxlY3REcmFnZ2luZ0N1cnNvciAhPSBudWxsKSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgbVNlbGVjdERyYWdnaW5nT2Zmc2V0LnNldCgKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1TZWxlY3REcmFnZ2luZ0N1cnNvci5sZWZ0IC0gY29udGVudFgsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBtU2VsZWN0RHJhZ2dpbmdDdXJzb3IudG9wIC0gY29udGVudFkpOwotICAgICAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgICAgICAgICAgaWYgKERlYnVnRmxhZ3MuV0VCX1ZJRVcpIHsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICBMb2cudihMT0dUQUcsICJzZWxlY3Q9IiArIGNvbnRlbnRYICsgIiwiICsgY29udGVudFkpOwogICAgICAgICAgICAgICAgICAgICAgICAgfQpAQCAtNjA3Myw5ICs2MTgyLDcgQEAKICAgICAgICAgICAgICAgICAgICAgICAgIHBhcmVudC5yZXF1ZXN0RGlzYWxsb3dJbnRlcmNlcHRUb3VjaEV2ZW50KHRydWUpOwogICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgICAgIGlmIChkZWx0YVggIT0gMCB8fCBkZWx0YVkgIT0gMCkgewotICAgICAgICAgICAgICAgICAgICAgICAgbVNlbGVjdERyYWdnaW5nQ3Vyc29yLm9mZnNldFRvKAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb250ZW50WCArIG1TZWxlY3REcmFnZ2luZ09mZnNldC54LAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb250ZW50WSArIG1TZWxlY3REcmFnZ2luZ09mZnNldC55KTsKKyAgICAgICAgICAgICAgICAgICAgICAgIHNuYXBEcmFnZ2luZ0N1cnNvcihjb250ZW50WCwgY29udGVudFkpOwogICAgICAgICAgICAgICAgICAgICAgICAgdXBkYXRlV2Via2l0U2VsZWN0aW9uKCk7CiAgICAgICAgICAgICAgICAgICAgICAgICBtTGFzdFRvdWNoWCA9IHg7CiAgICAgICAgICAgICAgICAgICAgICAgICBtTGFzdFRvdWNoWSA9IHk7CkBAIC02Njg0LDYgKzY3OTEsMzAgQEAKICAgICAgICAgbVRvdWNoTW9kZSA9IFRPVUNIX0RPTkVfTU9ERTsKICAgICB9CiAKKyAgICBwcml2YXRlIHZvaWQgc25hcERyYWdnaW5nQ3Vyc29yKGludCB4LCBpbnQgeSkgeworICAgICAgICB4ICs9IHZpZXdUb0NvbnRlbnREaW1lbnNpb24obVNlbGVjdERyYWdnaW5nT2Zmc2V0LngpOworICAgICAgICB5ICs9IHZpZXdUb0NvbnRlbnREaW1lbnNpb24obVNlbGVjdERyYWdnaW5nT2Zmc2V0LnkpOworICAgICAgICBpZiAobVNlbGVjdERyYWdnaW5nVGV4dFF1YWQuY29udGFpbnNQb2ludCh4LCB5KSkgeworICAgICAgICAgICAgZmxvYXQgc2NhbGUgPSBzY2FsZUFsb25nU2VnbWVudCh4LCB5LAorICAgICAgICAgICAgICAgICAgICBtU2VsZWN0RHJhZ2dpbmdUZXh0UXVhZC5wNCwgbVNlbGVjdERyYWdnaW5nVGV4dFF1YWQucDMpOworICAgICAgICAgICAgLy8gY2xhbXAgc2NhbGUgdG8gZW5zdXJlIHBvaW50IGlzIG9uIHRoZSBib3R0b20gc2VnbWVudAorICAgICAgICAgICAgc2NhbGUgPSBNYXRoLm1heCgwLjBmLCBzY2FsZSk7CisgICAgICAgICAgICBzY2FsZSA9I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gICAgICAgICBiLmxlZnQrIiwiK2IudG9wKyIsIitiLnJpZ2h0KyIsIitiLmJvdHRvbSsifSIpOwogICAgICAgICB9Ci0gICAgICAgIGludmFsaWRhdGVDb250ZW50UmVjdChkcmF3Lm1JbnZhbFJlZ2lvbi5nZXRCb3VuZHMoKSk7CisgICAgICAgIFJlY3QgaW52YWxCb3VuZHMgPSBkcmF3Lm1JbnZhbFJlZ2lvbi5nZXRCb3VuZHMoKTsKKyAgICAgICAgaWYgKCFpbnZhbEJvdW5kcy5pc0VtcHR5KCkpIHsKKyAgICAgICAgICAgIGludmFsaWRhdGVDb250ZW50UmVjdChpbnZhbEJvdW5kcyk7CisgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICBtV2ViVmlldy5pbnZhbGlkYXRlKCk7CisgICAgICAgIH0KIAogICAgICAgICBpZiAobVBpY3R1cmVMaXN0ZW5lciAhPSBudWxsKSB7CiAgICAgICAgICAgICBtUGljdHVyZUxpc3RlbmVyLm9uTmV3UGljdHVyZShnZXRXZWJWaWV3KCksIGNhcHR1cmVQaWN0dXJlKCkpOwpAQCAtODcyMCw2ICs4ODY2LDggQEAKICAgICAgICAgICAgICAgICAgICAgc2V0dXBXZWJraXRTZWxlY3QoKTsKICAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKCFtU2VsZWN0aW9uU3RhcnRlZCkgewogICAgICAgICAgICAgICAgICAgICBzeW5jU2VsZWN0aW9uQ3Vyc29ycygpOworICAgICAgICAgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICAgICAgICAgIGFkanVzdFNlbGVjdGlvbkN1cnNvcnMoKTsKICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgaWYgKG1Jc0NhcmV0U2VsZWN0aW9uKSB7CiAgICAgICAgICAgICAgICAgICAgIHJlc2V0Q2FyZXRUaW1lcigpOwpAQCAtOTM4Myw3ICs5NTMxLDcgQEAKICAgICBwcml2YXRlIHN0YXRpYyBuYXRpdmUgdm9pZCBuYX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0KLSAgICAgICAgICAgIGNhbnZhcy50cmFuc2xhdGUobVNjcm9sbFgsIG1TY3JvbGxZKTsKLSAgICAgICAgICAgIGludCBlbmRPZlByZXZpb3VzQmxvY2sgPSAtMTsKLSAgICAgICAgICAgIGludCBzZWFyY2hTdGFydEluZGV4ID0gMDsKLSAgICAgICAgICAgIGZvciAoaW50IGkgPSAwOyBpIDwgbnVtYmVyT2ZCbG9ja3M7IGkrKykgewotICAgICAgICAgICAgICAgIGludCBibG9ja0VuZCA9IGJsb2NrRW5kc1tpXTsKLSAgICAgICAgICAgICAgICBpbnQgYmxvY2tJbmRleCA9IGJsb2NrSW5kaWNlc1tpXTsKLQotICAgICAgICAgICAgICAgIGZpbmFsIGJvb2xlYW4gYmxvY2tJc0ludmFsaWQgPSBibG9ja0luZGV4ID09IER5bmFtaWNMYXlvdXQuSU5WQUxJRF9CTE9DS19JTkRFWDsKLSAgICAgICAgICAgICAgICBpZiAoYmxvY2tJc0ludmFsaWQpIHsKLSAgICAgICAgICAgICAgICAgICAgYmxvY2tJbmRleCA9IGdldEF2YWlsYWJsZURpc3BsYXlMaXN0SW5kZXgoYmxvY2tJbmRpY2VzLCBudW1iZXJPZkJsb2NrcywKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBzZWFyY2hTdGFydEluZGV4KTsKLSAgICAgICAgICAgICAgICAgICAgLy8gRHluYW1pYyBsYXlvdXQgaW50ZXJuYWwgYmxvY2sgaW5kaWNlcyBzdHJ1Y3R1cmUgaXMgdXBkYXRlZCBmcm9tIEVkaXRvcgotICAgICAgICAgICAgICAgICAgICBibG9ja0luZGljZXNbaV0gPSBibG9ja0luZGV4OwotICAgICAgICAgICAgICAgICAgICBzZWFyY2hTdGFydEluZGV4ID0gYmxvY2tJbmRleCArIDE7CisgICAgICAgICAgICBpZiAobGF5b3V0IGluc3RhbmNlb2YgRHluYW1pY0xheW91dCkgeworICAgICAgICAgICAgICAgIGlmIChtVGV4dERpc3BsYXlMaXN0cyA9PSBudWxsKSB7CisgICAgICAgICAgICAgICAgICAgIG1UZXh0RGlzcGxheUxpc3RzID0gbmV3IERpc3BsYXlMaXN0W0FycmF5VXRpbHMuaWRlYWxPYmplY3RBcnJheVNpemUoMCldOwogICAgICAgICAgICAgICAgIH0KIAotICAgICAgICAgICAgICAgIERpc3BsYXlMaXN0IGJsb2NrRGlzcGxheUxpc3QgPSBtVGV4dERpc3BsYXlMaXN0c1tibG9ja0luZGV4XTsKLSAgICAgICAgICAgICAgICBpZiAoYmxvY2tEaXNwbGF5TGlzdCA9PSBudWxsKSB7Ci0gICAgICAgICAgICAgICAgICAgIGJsb2NrRGlzcGxheUxpc3QgPSBtVGV4dERpc3BsYXlMaXN0c1tibG9ja0luZGV4XSA9Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgZ2V0SGFyZHdhcmVSZW5kZXJlcigpLmNyZWF0ZURpc3BsYXlMaXN0KCJUZXh0ICIgKyBibG9ja0luZGV4KTsKLSAgICAgICAgICAgICAgICB9IGVsc2UgewotICAgICAgICAgICAgICAgICAgICBpZiAoYmxvY2tJc0ludmFsaWQpIGJsb2NrRGlzcGxheUxpc3QuaW52YWxpZGF0ZSgpOwotICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICBEeW5hbWljTGF5b3V0IGR5bmFtaWNMYXlvdXQgPSAoRHluYW1pY0xheW91dCkgbGF5b3V0OworICAgICAgICAgICAgICAgIGludFtdIGJsb2NrRW5kcyA9IGR5bmFtaWNMYXlvdXQuZ2V0QmxvY2tFbmRzKCk7CisgICAgICAgICAgICAgICAgaW50W10gYmxvY2tJbmRpY2VzID0gZHluYW1pY0xheW91dC5nZXRCbG9ja0luZGljZXMoKTsKKyAgICAgICAgICAgICAgICBmaW5hbCBpbnQgbnVtYmVyT2ZCbG9ja3MgPSBkeW5hbWljTGF5b3V0LmdldE51bWJlck9mQmxvY2tzKCk7CiAKLSAgICAgICAgICAgICAgICBpZiAoIWJsb2NrRGlzcGxheUxpc3QuaXNWYWxpZCgpKSB7Ci0gICAgICAgICAgICAgICAgICAgIGZpbmFsIEhhcmR3YXJlQ2FudmFzIGhhcmR3YXJlQ2FudmFzID0gYmxvY2tEaXNwbGF5TGlzdC5zdGFydCgpOwotICAgICAgICAgICAgICAgICAgICB0cnkgewotICAgICAgICAgICAgICAgICAgICAgICAgaGFyZHdhcmVDYW52YXMuc2V0Vmlld3BvcnQod2lkdGgsIGhlaWdodCk7Ci0gICAgICAgICAgICAgICAgICAgICAgICAvLyBUaGUgZGlydHkgcmVjdCBzaG91bGQgYWx3YXlzIGJlIG51bGwgZm9yIGEgZGlzcGxheSBsaXN0Ci0gICAgICAgICAgICAgICAgICAgICAgICBoYXJkd2FyZUNhbnZhcy5vblByZURyYXcobnVsbCk7Ci0gICAgICAgICAgICAgICAgICAgICAgICBoYXJkd2FyZUNhbnZhcy50cmFuc2xhdGUoLW1TY3JvbGxYLCAtbVNjcm9sbFkpOwotICAgICAgICAgICAgICAgICAgICAgICAgbGF5b3V0LmRyYXdUZXh0KGhhcmR3YXJlQ2FudmFzLCBlbmRPZlByZXZpb3VzQmxvY2sgKyAxLCBibG9ja0VuZCk7Ci0gICAgICAgICAgICAgICAgICAgICAgICBoYXJkd2FyZUNhbnZhcy50cmFuc2xhdGUobVNjcm9sbFgsIG1TY3JvbGxZKTsKLSAgICAgICAgICAgICAgICAgICAgfSBmaW5hbGx5IHsKLSAgICAgICAgICAgICAgICAgICAgICAgIGhhcmR3YXJlQ2FudmFzLm9uUG9zdERyYXcoKTsKLSAgICAgICAgICAgICAgICAgICAgICAgIGJsb2NrRGlzcGxheUxpc3QuZW5kKCk7Ci0gICAgICAgICAgICAgICAgICAgICAgICBpZiAoVVNFX0RJU1BMQVlfTElTVF9QUk9QRVJUSUVTKSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgYmxvY2tEaXNwbGF5TGlzdC5zZXRMZWZ0VG9wUmlnaHRCb3R0b20obUxlZnQsIG1Ub3AsIG1SaWdodCwgbUJvdHRvbSk7CisgICAgICAgICAgICAgICAgY2FudmFzLnRyYW5zbGF0ZShtU2Nyb2xsWCwgbVNjcm9sbFkpOworICAgICAgICAgICAgICAgIGludCBlbmRPZlByZXZpb3VzQmxvY2sgPSAtMTsKKyAgICAgICAgICAgICAgICBpbnQgc2VhcmNoU3RhcnRJbmRleCA9IDA7CisgICAgICAgICAgICAgICAgZm9yIChpbnQgaSA9IDA7IGkgPCBudW1iZXJPZkJsb2NrczsgaSsrKSB7CisgICAgICAgICAgICAgICAgICAgIGludCBibG9ja0VuZCA9IGJsb2NrRW5kc1tpXTsKKyAgICAgICAgICAgICAgICAgICAgaW50IGJsb2NrSW5kZXggPSBibG9ja0luZGljZXNbaV07CisKKyAgICAgICAgICAgICAgICAgICAgZmluYWwgYm9vbGVhbiBibG9ja0lzSW52YWxpZCA9IGJsb2NrSW5kZXggPT0gRHluYW1pY0xheW91dC5JTlZBTElEX0JMT0NLX0lOREVYOworICAgICAgICAgICAgICAgICAgICBpZiAoYmxvY2tJc0ludmFsaWQpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIGJsb2NrSW5kZXggPSBnZXRBdmFpbGFibGVEaXNwbGF5TGlzdEluZGV4KGJsb2NrSW5kaWNlcywgbnVtYmVyT2ZCbG9ja3MsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNlYXJjaFN0YXJ0SW5kZXgpOworICAgICAgICAgICAgICAgICAgICAgICAgLy8gRHluYW1pYyBsYXlvdXQgaW50ZXJuYWwgYmxvY2sgaW5kaWNlcyBzdHJ1Y3R1cmUgaXMgdXBkYXRlZCBmcm9tIEVkaXRvcgorICAgICAgICAgICAgICAgICAgICAgICAgYmxvY2tJbmRpY2VzW2ldID0gYmxvY2tJbmRleDsKKyAgICAgICAgICAgICAgICAgICAgICAgIHNlYXJjaFN0YXJ0SW5kZXggPSBibG9ja0luZGV4ICsgMTsKKyAgICAgICAgICAgICAgICAgICAgfQorCisgICAgICAgICAgICAgICAgICAgIERpc3BsYXlMaXN0IGJsb2NrRGlzcGxheUxpc3QgPSBtVGV4dERpc3BsYXlMaXN0c1tibG9ja0luZGV4XTsKKyAgICAgICAgICAgICAgICAgICAgaWYgKGJsb2NrRGlzcGxheUxpc3QgPT0gbnVsbCkgeworICAgICAgICAgICAgICAgICAgICAgICAgYmxvY2tEaXNwbGF5TGlzdCA9IG1UZXh0RGlzcGxheUxpc3RzW2Jsb2NrSW5kZXhdID0KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZ2V0SGFyZHdhcmVSZW5kZXJlcigpLmNyZWF0ZURpc3BsYXlMaXN0KCJUZXh0ICIgKyBibG9ja0luZGV4KTsKKyAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIGlmIChibG9ja0lzSW52YWxpZCkgYmxvY2tEaXNwbGF5TGlzdC5pbnZhbGlkYXRlKCk7CisgICAgICAgICAgICAgICAgICAgIH0KKworICAgICAgICAgICAgICAgICAgICBpZiAoIWJsb2NrRGlzcGxheUxpc3QuaXNWYWxpZCgpKSB7CisgICAgICAgICAgICAgICAgICAgICAgICBmaW5hbCBIYXJkd2FyZUNhbnZhcyBoYXJkd2FyZUNhbnZhcyA9IGJsb2NrRGlzcGxheUxpc3Quc3RhcnQoKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIHRyeSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgaGFyZHdhcmVDYW52YXMuc2V0Vmlld3BvcnQod2lkdGgsIGhlaWdodCk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gVGhlIGRpcnR5IHJlY3Qgc2hvdWxkIGFsd2F5cyBiZSBudWxsIGZvciBhIGRpc3BsYXkgbGlzdAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIGhhcmR3YXJlQ2FudmFzLm9uUHJlRHJhdyhudWxsKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBoYXJkd2FyZUNhbnZhcy50cmFuc2xhdGUoLW1TY3JvbGxYLCAtbVNjcm9sbFkpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxheW91dC5kcmF3VGV4dChoYXJkd2FyZUNhbnZhcywgZW5kT2ZQcmV2aW91c0Jsb2NrICsgMSwgYmxvY2tFbmQpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGhhcmR3YXJlQ2FudmFzLnRyYW5zbGF0ZShtU2Nyb2xsWCwgbVNjcm9sbFkpOworICAgICAgICAgICAgICAgICAgICAgICAgfSBmaW5hbGx5IHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBoYXJkd2FyZUNhbnZhcy5vblBvc3REcmF3KCk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgYmxvY2tEaXNwbGF5TGlzdC5lbmQoKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoVVNFX0RJU1BMQVlfTElTVF9QUk9QRVJUSUVTKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJsb2NrRGlzcGxheUxpc3Quc2V0TGVmdFRvcFJpZ2h0Qm90dG9tKDAsIDAsIHdpZHRoLCBoZWlnaHQpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgIH0KIAotICAgICAgICAgICAgICAgICgoSGFyZHdhcmVDYW52YXMpIGNhbnZhcykuZHJhd0Rpc3BsYXlMaXN0KGJsb2NrRGlzcGxheUxpc3QsIHdpZHRoLCBoZWlnaHQsIG51bGwsCi0gICAgICAgICAgICAgICAgICAgICAgICBEaXNwbGF5TGlzdC5GTEFHX0NMSVBfQ0hJTERSRU4pOwotICAgICAgICAgICAgICAgIGVuZE9mUHJldmlvdXNCbG9jayA9IGJsb2NrRW5kOworICAgICAgICAgICAgICAgICAgICAoKEhhcmR3YXJlQ2FudmFzKSBjYW52YXMpLmRyYXdEaXNwbGF5TGlzdChibG9ja0Rpc3BsYX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1lc3NhZ2UgKi8KICAgICAgICAgcHJpdmF0ZSBNZXNzYWdlIG1Nc2c7CkBAIC03MjYsMTkgKzczMCwxOCBAQAogICAgICAgICAgICAgLyoqIFNhdmUgdGhlIGN1cnJlbnQgbWVzc2FnZSAqLwogICAgICAgICAgICAgbU1zZyA9IG1zZzsKIAotICAgICAgICAgICAgLyoqCi0gICAgICAgICAgICAgKiBDaGVjayB0aGF0IGNvbnN0cnVjdGlvbiB3YXMgY29tcGxldGVkCi0gICAgICAgICAgICAgKi8KLSAgICAgICAgICAgIGlmICghbUlzQ29uc3RydWN0aW9uQ29tcGxldGVkKSB7Ci0gICAgICAgICAgICAgICAgTG9nLmUoVEFHLCAiVGhlIHN0YXJ0IG1ldGhvZCBub3QgY2FsbGVkLCBpZ25vcmUgbXNnOiAiICsgbXNnKTsKLSAgICAgICAgICAgICAgICByZXR1cm47CisgICAgICAgICAgICBpZiAobUlzQ29uc3RydWN0aW9uQ29tcGxldGVkKSB7CisgICAgICAgICAgICAgICAgLyoqIE5vcm1hbCBwYXRoICovCisgICAgICAgICAgICAgICAgcHJvY2Vzc01zZyhtc2cpOworICAgICAgICAgICAgfSBlbHNlIGlmICghbUlzQ29uc3RydWN0aW9uQ29tcGxldGVkICYmCisgICAgICAgICAgICAgICAgICAgIChtTXNnLndoYXQgPT0gU01fSU5JVF9DTUQpICYmIChtTXNnLm9iaiA9PSBtU21IYW5kbGVyT2JqKSkgeworICAgICAgICAgICAgICAgIC8qKiBJbml0aWFsIG9uZSB0aW1lIHBhdGguICovCisgICAgICAgICAgICAgICAgbUlzQ29uc3RydWN0aW9uQ29tcGxldGVkID0gdHJ1ZTsKKyAgICAgICAgICAgICAgICBpbnZva2VFbnRlck1ldGhvZHMoMCk7CisgICAgICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgICAgIHRocm93IG5ldyBSdW50aW1lRXhjZXB0aW9uKCJTdGF0ZU1hY2hpbmUuaGFuZGxlTWVzc2FnZTogIiArCisgICAgICAgICAg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bUNvbnRleHQgPSBjb250ZXh0OwogICAgICAgICBtQ29udGVudFJlc29sdmVyID0gY29udGV4dC5nZXRDb250ZW50UmVzb2x2ZXIoKTsKKyAgICAgICAgbURybU1hbmFnZXJDbGllbnQgPSBuZXcgRHJtTWFuYWdlckNsaWVudChjb250ZXh0KTsKICAgICAgfQogCiAgICAgLyoqIEdldChvciBjcmVhdGUgaWYgbm90IGV4aXN0KSBhbiBpbnN0YW5jZSBvZiBQZHVQZXJzaXN0ZXIgKi8KQEAgLTc2MSw2ICs3NzAsOSBAQAogICAgICAgICAgICAgdGhyb3dzIE1tc0V4Y2VwdGlvbiB7CiAgICAgICAgIE91dHB1dFN0cmVhbSBvcyA9IG51bGw7CiAgICAgICAgIElucHV0U3RyZWFtIGlzID0gbnVsbDsKKyAgICAgICAgRHJtQ29udmVydFNlc3Npb24gZHJtQ29udmVydFNlc3Npb24gPSBudWxsOworICAgICAgICBVcmkgZGF0YVVyaSA9IG51bGw7CisgICAgICAgIFN0cmluZyBwYXRoID0gbnVsbDsKIAogICAgICAgICB0cnkgewogICAgICAgICAgICAgYnl0ZVtdIGRhdGEgPSBwYXJ0LmdldERhdGEoKTsKQEAgLTc3Myw5ICs3ODUsMzggQEAKICAgICAgICAgICAgICAgICAgICAgdGhyb3cgbmV3IE1tc0V4Y2VwdGlvbigidW5hYmxlIHRvIHVwZGF0ZSAiICsgdXJpLnRvU3RyaW5nKCkpOwogICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICAgICAgYm9vbGVhbiBpc0RybSA9IERvd25sb2FkRHJtSGVscGVyLmlzRHJtQ29udmVydE5lZWRlZChjb250ZW50VHlwZSk7CisgICAgICAgICAgICAgICAgaWYgKGlzRHJtKSB7CisgICAgICAgICAgICAgICAgICAgIGlmICh1cmkgIT0gbnVsbCkgeworICAgICAgICAgICAgICAgICAgICAgICAgdHJ5IHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBwYXRoID0gY29udmVydFVyaVRvUGF0aChtQ29udGV4dCwgdXJpKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoTE9DQUxfTE9HVikgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBMb2cudihUQUcsICJkcm0gdXJpOiAiICsgdXJpICsgIiBwYXRoOiAiICsgcGF0aCk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgICAgIEZpbGUgZiA9IG5ldyBGaWxlKHBhdGgpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxvbmcgbGVuID0gZi5sZW5ndGgoKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoTE9DQUxfTE9HVikgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBMb2cudihUQUcsICJkcm0gcGF0aDogIiArIHBhdGggKyAiIGxlbjogIiArIGxlbik7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChsZW4gPiAwKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vIHdlJ3JlIG5vdCBnb2luZyB0byByZS1wZXJzaXN0IGFuZCByZS1lbmNyeXB0IGFuIGFscmVhZHkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gY29udmVydGVkIGRybSBmaWxlCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybjsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICB9IGNhdGNoIChFeGNlcHRpb24gZSkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgIExvZy5lKFRBRywgIkNhbid0IGdldCBmaWxlIGluZm8gZm9yOiAiICsgcGFydC5nZXREYXRhVXJpKCksIGUpOworICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgIC8vIFdlIGhhdmVuJ3QgY29udmVydGVkIHRoZSBmaWxlIHlldCwgc3RhcnQgdGhlIGNvbnZlcnNpb24KKyAgICAgICAgICAgICAgICAgICAgZHJtQ29udmVydFNlc3Npb24gPSBEcm1Db252ZXJ0U2Vzc2lvbi5vcGVuKG1Db250ZXh0LCBjb250ZW50VHlwZSk7CisgICAgICAgICAgICAgICAgICAgIGlmIChkcm1Db252ZXJ0U2Vzc2lvbiA9PSBudWxsKSB7CisgICAgICAgICAgICAgICAgICAgICAgICB0aHJvdyBuZXcgTW1zRXhjZXB0aW9uKCJNaW1ldHlwZSAiICsgY29udGVudFR5cGUgKworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAiIGNhbiBub3QgYmUgY29udmVydGVkLiIpOworICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgIG9zID0gbUNvbnRlbnRSZXNvbHZlci5vcGVuT3V0cHV0U3RyZWFtKHVyaSk7CiAgICAgICAgICAgICAgICAgaWYgKGRhdGEgPT0gbnVsbCkgewotICAgICAgICAgICAgICAgICAgICBVcmkgZGF0YVVyaSA9IHBhcnQuZ2V0RGF0YVVyaSgpOworICAgICAgICAgICAgICAgICAgICBkYXRhVXJpID0gcGFydC5nZXREYXRhVXJpKCk7CiAgICAgICAgICAgICAgICAgICAgIGlmICgoZGF0YVVyaSA9PSBudWxsKSB8fCAoZGF0YVVyaSA9PSB1cmkpKSB7CiAgICAgICAgICAgICAgICAgICAgICAgICBMb2cudyhUQUcsICJDYW4ndCBmaW5kIGRhdGEgZm9yIHRoaXMgcGFydC4iKTsKICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybjsKQEAgLTc4OCwxMyArODI5LDMyIEBACiAKICAgICAgICAgICAgICAgICAgICAgYnl0ZVtdIGJ1ZmZlciA9IG5ldyBieXRlWzgxOTJdOwogICAgICAgICAgICAgICAgICAgICBmb3IgKGludCBsZW4gPSAwOyAobGVuID0gaXMucmVhZChidWZmZXIpKSAhPSAtMTsgKSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICBvcy53cml0ZShidWZmZXIsIDAsIGxlbik7CisgICAgICAgICAgICAgICAgICAgICAgICBpZiAoIWlzRHJtKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgb3Mud3JpdGUoYnVmZmVyLCAwLCBsZW4pOworICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBieXRlW10gY29udmVydGVkRGF0YSA9IGRybUNvbnZlcnRTZXNzaW9uLmNvbnZlcnQoYnVmZmVyLCBsZW4pOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChjb252ZXJ0ZWREYXRhICE9IG51bGwpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgb3Mud3JpdGUoY29udmVydGVkRGF0YSwgMCwgY29udmVydGVkRGF0YS5sZW5ndGgpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRocm93IG5ldyBNbXNFeGNlcHRpb24oIkVycm9yIGNvbnZlcnRpbmcgZHJtIGRhdGEuIik7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgfSBlbHNlIHsKICAgICAgICAgICAgICAgICAgICAgaWYgKExPQ0FMX0xPR1YpIHsKICAgICAgICAgICAgICAgICAgICAgICAgIExvZy52KFRBRywgIlNhdmluZyBkYXRhIHRvOiAiICsgdXJpKTsKICAgICAgICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgICAgICBvcy53cml0ZShkYXRhKTsKKyAgICAgICAgICAgICAgICAgICAgaWYgKCFpc0RybSkgeworICAgICAgICAgICAgICAgICAgICAgICAgb3Mud3JpdGUoZGF0YSk7CisgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICAgICAgICAgICAgICBkYXRhVXJpID0gdXJpOworICAgICAgICAgICAgICAgICAgICAgICAgYnl0ZVtdIGNvbnZlcnRlZERhdGEgPSBkcm1Db252ZXJ0U2Vzc2lvbi5jb252ZXJ0KGRhdGEsIGRhdGEubGVuZ3RoKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIGlmIChjb252ZXJ0ZWREYXRhICE9IG51bGwpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBvcy53cml0ZShjb252ZXJ0ZWREYXRhLCAwLCBjb252ZXJ0ZWREYXRhLmxlbmd0aCk7CisgICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRocm93IG5ldyBNbXNFeGNlcHRpb24oIkVycm9yIGNvbnZlcnRpbmcgZHJtIGRhdGEuIik7CisgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICB9CiAgICAgICAgIH0gY2F0Y2ggKEZpbGVOb3RGb3VuZEV4Y2VwdGlvbiBlKSB7CkBAIC04MTgsOSArODc4LDY3IEBACiAgICAgICAgICAgICAgICAgICAgIExvZy5lKFRBRywgIklPRXhjZXB0aW9uIHdoaWxlIGNsb3Npbmc6ICIgKyBpcywgZSk7CiAgICAgICAgICAgICAgICAgfSAvLyBJZ25vcmUKICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGlmIChkcm1Db252ZXJ0U2Vzc2lvbiAhPSBudWxsKSB7CisgICAgICAgICAgICAgICAgZHJtQ29udmVydFNlc3Npb24uY2xvc2UocGF0aCk7CisKKyAgICAgICAgICAgICAgICAvLyBSZXNldCB0aGUgcGVybWlzc2lvbnMgb24gdGhlIGVuY3J5cHRlZCBwYXJ0IGZpbGUgc28gZXZlcnlvbmUgaGFzIG9ubHkgcmVhZAorICAgICAgICAgICAgICAgIC8vIHBlcm1pc3Npb24uCisgICAgICAgICAgICAgICAgRmlsZSBmID0gbmV3IEZpbGUocGF0aCk7CisgICAgICAgICAgICAgICAgQ29udGVudFZhbHVlcyB2YWx1ZXMgPSBuZXcgQ29udGVudFZhbHVlcygwKTsKKyAgICAgICAgICAgICAgICBTcWxpdGVXcmFwcGVyLnVwZGF0ZShtQ29udGV4dCwgbUNvbnRlbnRSZXNvbHZlciwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBVcmkucGFyc2UoImNvbnRlbnQ6Ly9tbXMvcmVzZXRGaWxlUGVybS8iICsgZi5nZXROYW1lKCkpLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZhbHVlcywgbnVsbCwgbnVsbCk7CisgICAgICAgICAgICB9CiAgICAgICAgIH0KICAgICB9CiAKKyAgICAvKioKKyAgICAgKiBUaGlzIG1ldGhvZCBleHBlY3RzIHVyaSBpbiB0aGUgZm9sbG93aW5nIGZvcm1hdAorICAgICAqICAgICBjb250ZW50Oi8vbWVkaWEvPHRhYmxlX25hbWU+Lzxyb3dfaW5kZXg+IChvcikKKyAgICAgKiAgICAgZmlsZTovL3NkY2FyZC90ZXN0Lm1wNAorICAgICAqICAgICBodHRwOi8vdGVzdC5jb20vdGVzdC5tcDQKKyAgICAgKgorICAgICAqIEhlcmUgPHRhYmxlX25hbWU+IHNoYWxsIGJlICJ2aWRlbyIgb3IgImF1ZGlvIiBvciAiaW1hZ2VzIgorICAgICAqIDxyb3dfaW5kZXg+IHRoZSBpbmRleCBvZiB0aGUgY29udGVudCBpbiBnaXZlbiB0YWJsZQorICAgICAqLworICAgIHN0YXRpYyBwdWJsaWMgU3RyaW5nIGNvbnZlcnRVcmlUb1BhdGgoQ29udGV4dCBjb250ZXh0LCBVcmkgdXJpKSB7CisgICAgICAgIFN0cmluZyBwYXRoID0gbnVsbDsKKyAgICAgICAgaWYgKG51bGwgIT0gdXJpKSB7CisgICAgICAgICAgICBTdHJpbmcgc2NoZW1lID0gdXJpLmdldFNjaGVtZSgpOworICAgICAgICAgICAgaWYgKG51bGwgPT0gc2NoZW1lIHx8IHNjaGVtZS5lcXVhbHMoIiIpIHx8CisgICAgICAgICAgICAgICAgICAgIHNjaGVtZS5lcXVhbHMoQ29udGVudFJlc29sdmVyLlNDSEVNRV9GSUxFKSkgeworICAgICAgICAgICAgICAgIHBhdGggPSB1cmkuZ2V0UGF0aCgpOworCisgICAgICAgICAgICB9IGVsc2UgaWYgKHNjaGVtZS5lcXVhbHMoImh0dHAiKSkgeworICAgICAgICAgICAgICAgIHBhdGggPSB1cmkudG9TdHJpbmcoKTsKKworICAgICAgICAgICAgfSBlbHNlIGlmIChzY2hlbWUuZXF1YWxzKENvbnRlbnRSZXNvbHZlci5TQ0hFTUVfQ09OVEVOVCkpIHsKKyAgICAgICAgICAgICAgICBTdHJpbmdbXSBwcm9qZWN0aW9uID0gbmV3IFN0cmluZ1tdIHtNZWRpYVN0b3JlLk1lZGlhQ29sdW1ucy5EQVRBfTsKKyAgICAgICAgICAgICAgICBDdXJzb3IgY3Vyc29yID0gbnVsbDsKKyAgICAgICAgICAgICAgICB0cnkgeworICAgICAgICAgICAgICAgICAgICBjdXJzb3IgPSBjb250ZXh0LmdldENvbnRlbnRSZXNvbHZlcigpLnF1ZXJ5KHVyaSwgcHJvamVjdGlvbiwgbnVsbCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBudWxsLCBudWxsKTsKKyAgICAgICAgICAgICAgICAgICAgaWYgKG51bGwgPT0gY3Vyc29yIHx8IDAgPT0gY3Vyc29yLmdldENvdW50KCkgfHwgIWN1cnNvci5tb3ZlVG9GaXJzdCgpKSB7CisgICAgICAgICAgICAgICAgICAgICAgICB0aHJvdyBuZXcgSWxsZWdhbEFyZ3VtZW50RXhjZXB0aW9uKCJHaXZlbiBVcmkgY291bGQgbm90IGJlIGZvdW5kIiArCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICIgaW4gbWVkaWEgc3RvcmUiKTsKKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICBpbnQgcGF0aEluZGV4ID0gY3Vyc29yLmdldENvbHVtbkluZGV4T3JUaHJvdyhNZWRpYVN0b3JlLk1lZGlhQ29sdW1ucy5EQVRBKTsKKyAgICAgICAgICAgICAgICAgICAgcGF0aCA9IGN1cnNvci5nZXRTdHJpbmcocGF0aEluZGV4KTsKKyAgICAgICAgICAgICAgICB9IGNhdGNoIChTUUxpdGVFeGNlcHRpb24gZSkgeworICAgICAgICAgICAgICAgICAgICB0aHJvdyBuZXcgSWxsZWdhbEFyZ3VtZW50RXhjZXB0aW9uKCJHaXZlbiBVcmkgaXMgbm90IGZvcm1hdHRlZCBpbiBhIHdheSAiICsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAic28gdGhhdCBpdCBjYW4gYmUgZm91bmQgaW4gbWVkaWEgc3RvcmUuIik7CisgICAgICAgICAgICAgICAgfSBmaW5hbGx5IHsKKyAgICAgICAgICAgICAgICAgICAgaWYgKG51bGwgIT0gY3Vyc29yKSB7CisgICAgICAgICAgICAgICAgICAgICAgICBjdXJzb3IuY2xvc2UoKTsKKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICAgICAgdGhyb3cgbmV3IElsbGVnYWxBcmd1bWVudEV4Y2VwdGlvbigiR2l2ZW4gVXJpIHNjaGVtZSBpcyBub3Qgc3VwcG9ydGVkIik7CisgICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICAgICAgcmV0dXJuIHBhdGg7CisgICAgfQorCiAgICAgcHJpdmF0ZSB2b2lkIHVwZGF0ZUFkZHJlc3MoCiAgICAgICAgICAgICBsb25nIG1zZ0lkLCBpbnQgdHlwZSwgRW5jb2RlZFN0cmluZ1ZhbHVlW10gYXJyYXkpIHsKICAgICAgICAgLy8gRGVsZXRlIG9sZCBhZGRyZXNzIGluZm9ybWF0aW9u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WltZXR5cGUgTWVkaWEgVHlwZSB0byBjaGVjaworICAgICAqIEByZXR1cm4gVHJ1ZSBpZiB0aGUgTWVkaWEgVHlwZSBpcyBEUk0gZWxzZSBmYWxzZQorICAgICAqLworICAgIHB1YmxpYyBzdGF0aWMgYm9vbGVhbiBpc0RybU1pbWVUeXBlKENvbnRleHQgY29udGV4dCwgU3RyaW5nIG1pbWV0eXBlKSB7CisgICAgICAgIGJvb2xlYW4gcmVzdWx0ID0gZmFsc2U7CisgICAgICAgIGlmIChjb250ZXh0ICE9IG51bGwpIHsKKyAgICAgICAgICAgIHRyeSB7CisgICAgICAgICAgICAgICAgRHJtTWFuYWdlckNsaWVudCBkcm1DbGllbnQgPSBuZXcgRHJtTWFuYWdlckNsaWVudChjb250ZXh0KTsKKyAgICAgICAgICAgICAgICBpZiAoZHJtQ2xpZW50ICE9IG51bGwgJiYgbWltZXR5cGUgIT0gbnVsbCAmJiBtaW1ldHlwZS5sZW5ndGgoKSA+IDApIHsKKyAgICAgICAgICAgICAgICAgICAgcmVzdWx0ID0gZHJtQ2xpZW50LmNhbkhhbmRsZSgiIiwgbWltZXR5cGUpOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0gY2F0Y2ggKElsbGVnYWxBcmd1bWVudEV4Y2VwdGlvbiBlKSB7CisgICAgICAgICAgICAgICAgTG9nLncoVEFHLAorICAgICAgICAgICAgICAgICAgICAgICAgIkRybU1hbmFnZXJDbGllbnQgaW5zdGFuY2UgY291bGQgbm90IGJlIGNyZWF0ZWQsIGNvbnRleHQgaXMgSWxsZWdhbC4iKTsKKyAgICAgICAgICAgIH0gY2F0Y2ggKElsbGVnYWxTdGF0ZUV4Y2VwdGlvbiBlKSB7CisgICAgICAgICAgICAgICAgTG9nLncoVEFHLCAiRHJtTWFuYWdlckNsaWVudCBkaWRuJ3QgaW5pdGlhbGl6ZSBwcm9wZXJseS4iKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgICAgICByZXR1cm4gcmVzdWx0OworICAgIH0KKworICAgIC8qKgorICAgICAqIENoZWNrcyBpZiB0aGUgTWVkaWEgVHlwZSBuZWVkcyB0byBiZSBEUk0gY29udmVydGVkCisgICAgICoKKyAgICAgKiBAcGFyYW0gbWltZXR5cGUgTWVkaWEgdHlwZSBvZiB0aGUgY29udGVudAorICAgICAqIEByZXR1cm4gVHJ1ZSBpZiBjb252ZXJ0IGlzIG5lZWRlZCBlbHNlIGZhbHNlCisgICAgICovCisgICAgcHVibGljIHN0YXRpYyBib29sZWFuIGlzRHJtQ29udmVydE5lZWRlZChTdHJpbmcgbWltZXR5cGUpIHsKKyAgICAgICAgcmV0dXJuIE1JTUVUWVBFX0RSTV9NRVNTQUdFLmVxdWFscyhtaW1ldHlwZSk7CisgICAgfQorCisgICAgLyoqCisgICAgICogTW9kaWZpZXMgdGhlIGZpbGUgZXh0ZW5zaW9uIGZvciBhIERSTSBGb3J3YXJkIExvY2sgZmlsZSBOT1RFOiBUaGlzCisgICAgICogZnVuY3Rpb24gc2hvdWxkbid0IGJlIGNhbGxlZCBpZiB0aGUgZmlsZSBzaG91bGRuJ3QgYmUgRFJNIGNvbnZlcnRlZAorICAgICAqLworICAgIHB1YmxpYyBzdGF0aWMgU3RyaW5nIG1vZGlmeURybUZ3TG9ja0ZpbGVFeHRlbnNpb24oU3RyaW5nIGZpbGVuYW1lKSB7CisgICAgICAgIGlmIChmaWxlbmFtZSAhPSBudWxsKSB7CisgICAgICAgICAgICBpbnQgZXh0ZW5zaW9uSW5kZXg7CisgICAgICAgICAgICBleHRlbnNpb25JbmRleCA9IGZpbGVuYW1lLmxhc3RJbmRleE9mKCIuIik7CisgICAgICAgICAgICBpZiAoZXh0ZW5zaW9uSW5kZXggIT0gLTEpIHsKKyAgICAgICAgICAgICAgICBmaWxlbmFtZSA9IGZpbGVuYW1lLnN1YnN0cmluZygwLCBleHRlbnNpb25JbmRleCk7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBmaWxlbmFtZSA9IGZpbGVuYW1lLmNvbmNhdChFWFRFTlNJT05fSU5URVJOQUxfRldETCk7CisgICAgICAgIH0KKyAgICAgICAgcmV0dXJuIGZpbGVuYW1lOworICAgIH0KKworICAgIC8qKgorICAgICAqIEdldHMgdGhlIG9yaWdpbmFsIG1pbWUgdHlwZSBvZiBEUk0gcHJvdGVjdGVkIGNvbnRlbnQuCisgICAgICoKKyAgICAgKiBAcGFyYW0gY29udGV4dCBUaGUgY29udGV4dAorICAgICAqIEBwYXJhbSBwYXRoIFBhdGggdG8gdGhlIGZpbGUKKyAgICAgKiBAcGFyYW0gY29udGFpbmluZ01pbWUgVGhlIGN1cnJlbnQgbWltZSB0eXBlIG9mIG9mIHRoZSBmaWxlIGkuZS4gdGhlCisgICAgICogICAgICAgICAgICBjb250YWluaW5nIG1pbWUgdHlwZQorICAgICAqIEByZXR1cm4gVGhlIG9yaWdpbmFsIG1pbWUgdHlwZSBvZiB0aGUgZmlsZSBpZiBEUk0gcHJvdGVjdGVkIGVsc2UgdGhlCisgICAgICogICAgICAgICBjdXJyZW50TWltZQorICAgICAqLworICAgIHB1YmxpYyBzdGF0aWMgU3RyaW5nIGdldE9yaWdpbmFsTWltZVR5cGUoQ29udGV4dCBjb250ZXh0LCBTdHJpbmcgcGF0aCwgU3RyaW5nIGNvbnRhaW5pbmdNaW1lKSB7CisgICAgICAgIFN0cmluZyByZXN1bHQgPSBjb250YWluaW5nTWltZTsKKyAgICAgICAgRHJtTWFuYWdlckNsaWVudCBkcm1DbGllbnQgPSBuZXcgRHJtTWFuYWdlckNsaWVudChjb250ZXh0KTsKKyAgICAgICAgdHJ5IHsKKyAgICAgICAgICAgIGlmIChkcm1DbGllbnQuY2FuSGFuZGxlKHBhdGgsIG51bGwpKSB7CisgICAgICAgICAgICAgICAgcmVzdWx0ID0gZHJtQ2xpZW50LmdldE9yaWdpbmFsTWltZVR5cGUocGF0aCk7CisgICAgICAgICAgICB9CisgICAgICAgIH0gY2F0Y2ggKElsbGVnYWxBcmd1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FNlc3Npb25JZDsKKyAgICBwcml2YXRlIHN0YXRpYyBmaW5hbCBTdHJpbmcgVEFHID0gIkRybUNvbnZlcnRTZXNzaW9uIjsKKworICAgIHByaXZhdGUgRHJtQ29udmVydFNlc3Npb24oRHJtTWFuYWdlckNsaWVudCBkcm1DbGllbnQsIGludCBjb252ZXJ0U2Vzc2lvbklkKSB7CisgICAgICAgIG1Ecm1DbGllbnQgPSBkcm1DbGllbnQ7CisgICAgICAgIG1Db252ZXJ0U2Vzc2lvbklkID0gY29udmVydFNlc3Npb25JZDsKKyAgICB9CisKKyAgICAvKioKKyAgICAgKiBTdGFydCBvZiBjb252ZXJ0aW5nIGEgZmlsZS4KKyAgICAgKgorICAgICAqIEBwYXJhbSBjb250ZXh0IFRoZSBjb250ZXh0IG9mIHRoZSBhcHBsaWNhdGlvbiBydW5uaW5nIHRoZSBjb252ZXJ0IHNlc3Npb24uCisgICAgICogQHBhcmFtIG1pbWVUeXBlIE1pbWV0eXBlIG9mIGNvbnRlbnQgdGhhdCBzaGFsbCBiZSBjb252ZXJ0ZWQuCisgICAgICogQHJldHVybiBBIGNvbnZlcnQgc2Vzc2lvbiBvciBudWxsIGluIGNhc2UgYW4gZXJyb3Igb2NjdXJzLgorICAgICAqLworICAgIHB1YmxpYyBzdGF0aWMgRHJtQ29udmVydFNlc3Npb24gb3BlbihDb250ZXh0IGNvbnRleHQsIFN0cmluZyBtaW1lVHlwZSkgeworICAgICAgICBEcm1NYW5hZ2VyQ2xpZW50IGRybUNsaWVudCA9IG51bGw7CisgICAgICAgIGludCBjb252ZXJ0U2Vzc2lvbklkID0gLTE7CisgICAgICAgIGlmIChjb250ZXh0ICE9IG51bGwgJiYgbWltZVR5cGUgIT0gbnVsbCAmJiAhbWltZVR5cGUuZXF1YWxzKCIiKSkgeworICAgICAgICAgICAgdHJ5IHsKKyAgICAgICAgICAgICAgICBkcm1DbGllbnQgPSBuZXcgRHJtTWFuYWdlckNsaWVudChjb250ZXh0KTsKKyAgICAgICAgICAgICAgICB0cnkgeworICAgICAgICAgICAgICAgICAgICBjb252ZXJ0U2Vzc2lvbklkID0gZHJtQ2xpZW50Lm9wZW5Db252ZXJ0U2Vzc2lvbihtaW1lVHlwZSk7CisgICAgICAgICAgICAgICAgfSBjYXRjaCAoSWxsZWdhbEFyZ3VtZW50RXhjZXB0aW9uIGUpIHsKKyAgICAgICAgICAgICAgICAgICAgTG9nLncoVEFHLCAiQ29udmVyc2lvbiBvZiBNaW1ldHlwZTogIiArIG1pbWVUeXBlCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgKyAiIGlzIG5vdCBzdXBwb3J0ZWQuIiwgZSk7CisgICAgICAgICAgICAgICAgfSBjYXRjaCAoSWxsZWdhbFN0YXRlRXhjZXB0aW9uIGUpIHsKKyAgICAgICAgICAgICAgICAgICAgTG9nLncoVEFHLCAiQ291bGQgbm90IGFjY2VzcyBPcGVuIERybUZyYW1ld29yay4iLCBlKTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9IGNhdGNoIChJbGxlZ2FsQXJndW1lbnRFeGNlcHRpb24gZSkgeworICAgICAgICAgICAgICAgIExvZy53KFRBRywKKyAgICAgICAgICAgICAgICAgICAgICAgICJEcm1NYW5hZ2VyQ2xpZW50IGluc3RhbmNlIGNvdWxkIG5vdCBiZSBjcmVhdGVkLCBjb250ZXh0IGlzIElsbGVnYWwuIik7CisgICAgICAgICAgICB9IGNhdGNoIChJbGxlZ2FsU3RhdGVFeGNlcHRpb24gZSkgeworICAgICAgICAgICAgICAgIExvZy53KFRBRywgIkRybU1hbmFnZXJDbGllbnQgZGlkbid0IGluaXRpYWxpemUgcHJvcGVybHkuIik7CisgICAgICAgICAgICB9CisgICAgICAgIH0KKworICAgICAgICBpZiAoZHJtQ2xpZW50ID09IG51bGwgfHwgY29udmVydFNlc3Npb25JZCA8IDApIHsKKyAgICAgICAgICAgIHJldHVybiBudWxsOworICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgcmV0dXJuIG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gICAgICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgICAgICAgICBjb252ZXJ0ZWRTdGF0dXMgPSBtRHJtQ2xpZW50LmNvbnZlcnREYXRhKG1Db252ZXJ0U2Vzc2lvbklkLCBpbkJ1ZmZlcik7CisgICAgICAgICAgICAgICAgfQorCisgICAgICAgICAgICAgICAgaWYgKGNvbnZlcnRlZFN0YXR1cyAhPSBudWxsICYmCisgICAgICAgICAgICAgICAgICAgICAgICBjb252ZXJ0ZWRTdGF0dXMuc3RhdHVzQ29kZSA9PSBEcm1Db252ZXJ0ZWRTdGF0dXMuU1RBVFVTX09LICYmCisgICAgICAgICAgICAgICAgICAgICAgICBjb252ZXJ0ZWRTdGF0dXMuY29udmVydGVkRGF0YSAhPSBudWxsKSB7CisgICAgICAgICAgICAgICAgICAgIHJlc3VsdCA9IGNvbnZlcnRlZFN0YXR1cy5jb252ZXJ0ZWREYXRhOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0gY2F0Y2ggKElsbGVnYWxBcmd1bWVudEV4Y2VwdGlvbiBlKSB7CisgICAgICAgICAgICAgICAgTG9nLncoVEFHLCAiQnVmZmVyIHdpdGggZGF0YSB0byBjb252ZXJ0IGlzIGlsbGVnYWwuIENvbnZlcnRzZXNzaW9uOiAiCisgICAgICAgICAgICAgICAgICAgICAgICArIG1Db252ZXJ0U2Vzc2lvbklkLCBlKTsKKyAgICAgICAgICAgIH0gY2F0Y2ggKElsbGVnYWxTdGF0ZUV4Y2VwdGlvbiBlKSB7CisgICAgICAgICAgICAgICAgTG9nLncoVEFHLCAiQ291bGQgbm90IGNvbnZlcnQgZGF0YS4gQ29udmVydHNlc3Npb246ICIgKworICAgICAgICAgICAgICAgICAgICAgICAgbUNvbnZlcnRTZXNzaW9uSWQsIGUpOworICAgICAgICAgICAgfQorICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgdGhyb3cgbmV3IElsbGVnYWxBcmd1bWVudEV4Y2VwdGlvbigiUGFyYW1ldGVyIGluQnVmZmVyIGlzIG51bGwiKTsKKyAgICAgICAgfQorICAgICAgICByZXR1cm4gcmVzdWx0OworICAgIH0KKworICAgIC8qKgorICAgICAqIEVuZHMgYSBjb252ZXJzaW9uIHNlc3Npb24gb2YgYSBmaWxlLgorICAgICAqCisgICAgICogQHBhcmFtIGZpbGVOYW1lIFRoZSBmaWxlbmFtZSBvZiB0aGUgY29udmVydGVkIGZpbGUuCisgICAgICogQHJldHVybiBEb3dubG9hZHMuSW1wbC5TVEFUVVNfU1VDQ0VTUyBpZiBleGVjdXRpb24gaXMgb2suCisgICAgICogICAgICAgICBEb3dubG9hZHMuSW1wbC5TVEFUVVNfRklMRV9FUlJPUiBpbiBjYXNlIGNvbnZlcnRlZCBmaWxlIGNhbiBub3QKKyAgICAgKiAgICAgICAgIGJlIGFjY2Vzc2VkLiBEb3dubG9hZHMuSW1wbC5TVEFUVVNfTk9UX0FDQ0VQVEFCTEUgaWYgYSBwcm9ibGVtCisgICAgICogICAgICAgICBvY2N1cnMgd2hlbiBhY2Nlc3NpbmcgZHJtIGZyYW1ld29yay4KKyAgICAgKiAgICAgICAgIERvd25sb2Fkcy5JbXBsLlNUQVRVU19VTktOT1dOX0VSUk9SIGlmIGEgZ2VuZXJhbCBlcnJvciBvY2N1cnJlZC4KKyAgICAgKi8KKyAgICBwdWJsaWMgaW50IGNsb3NlKFN0cmluZyBmaWxlbmFtZSkgeworICAgICAgICBEcm1Db252ZXJ0ZWRTdGF0dXMgY29udmVydGVkU3RhdHVzID0gbnVsbDsKKyAgICAgICAgaW50IHJlc3VsdCA9IERvd25sb2Fkcy5JbXBsLlNUQVRVU19VTktOT1dOX0VSUk9SOworICAgICAgICBpZiAobURybUNsaWVudCAhPSBudWxsICYmIG1Db252ZXJ0U2Vzc2lvbklkID49IDApIHsKKyAgICAgICAgICAgIHRyeSB7CisgICAgICAgICAgICAgICAgY29udmVydGVkU3RhdHVzID0gbURybUNsaWVudC5jbG9zZUNvbnZlcnRTZXNzaW9uKG1Db252ZXJ0U2Vzc2lvbklkKTsKKyAgICAgICAgICAgICAgICBpZiAoY29udmVydGVkU3RhdHVzID09IG51bGwgfHwKKyAgICAgICAgICAgICAgICAgICAgICAgIGNvbnZlcnRlZFN0YXR1cy5zdGF0dXNDb2RlICE9IERybUNvbnZlcnRlZFN0YXR1cy5TVEFUVVNfT0sgfHwKKyAgICAgICAgICAgICAgICAgICAgICAgIGNvbnZlcnRlZFN0YXR1cy5jb252ZXJ0ZWREYXRhID09IG51bGwpIHsKKyAgICAgICAgICAgICAgICAgICAgcmVzdWx0ID0gRG93bmxvYWRzLkltcGwuU1RBVFVTX05PVF9BQ0NFUFRBQkxFOworICAgICAgICAgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICAgICAgICAgIFJhbmRvbUFjY2Vzc0ZpbGUgcm5kQWNjZXNzRmlsZSA9IG51bGw7CisgICAgICAgICAgICAgICAgICAgIHRyeSB7CisgICAgICAgICAgICAgICAgICAgICAgICBybmRBY2Nlc3NGaWxlID0gbmV3IFJhbmRvbUFjY2Vzc0ZpbGUoZmlsZW5hbWUsICJydyIpOworICAgICAgICAgICAgICAgICAgICAgICAgcm5kQWNjZXNzRmlsZS5zZWVrKGNvbnZlcnRlZFN0YXR1cy5vZmZzZXQpOworICAgICAgICAgICAgICAgICAgICAgICAgcm5kQWNjZXNzRmlsZS53cml0ZShjb252ZXJ0ZWRTdGF0dXMuY29udmVydGVkRGF0YSk7CisgICAgICAgICAgICAgICAgICAgICAgICByZXN1bHQgPSBEb3dubG9hZHMuSW1wbC5TVEFUVVNfU1VDQ0VTUzsKKyAgICAgICAgICAgICAgICAgICAgfSBjYXRjaCAoRmlsZU5vdEZvdW5kRXhjZXB0aW9uIGUpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIHJlc3VsdCA9IERvd25sb2Fkcy5JbXBsLlNUQVRVU19GSUxFX0VSUk9SOworICAgICAgICAgICAgICAgICAgICAgICAgTG9nLncoVEFHLCAiRmlsZTogIiArIGZpbGVuYW1lICsgIiBjb3VsZCBub3QgYmUgZm91bmQuIiwgZSk7CisgICAgICAgICAgICAgICAgICAgIH0gY2F0Y2ggKElPRXhjZXB0aW9uIGUpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIHJlc3VsdCA9IERvd25sb2Fkcy5JbXBsLlNUQVRVU19GSUxFX0VSUk9SOworICAgICAgICAgICAgICAgICAgICAgICAgTG9nLncoVEFHLCAiQ291bGQgbm90IGFjY2VzcyBGaWxlOiAiICsgZmlsZW5hbWUgKyAiIC4iLCBlKTsKKyAgICAgICAgICAgICAgICAgICAgfSBjYXRjaCAoSWxsZWdhbEFyZ3VtZW50RXhjZXB0aW9uIGUpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIHJlc3VsdCA9IERvd25sb2Fkcy5JbXBsLlNUQVRVU19GSUxFX0VSUk9SOworICAgICAgICAgICAgICAgICAgICAgICAgTG9nLncoVEFHLCAiQ291bGQgbm90IG9wZW4gZmlsZSBpbiBtb2RlOiBydyIsIGUpOworICAgICAgICAgICAgICAgICAgICB9IGNhdGNoIChTZWN1cml0eUV4Y2VwdGlvbiBlKSB7CisgICAgICAgICAgICAgICAgICAgICAgICBMb2cudyhUQUcsICJBY2Nlc3MgdG8gRmlsZTogIiArIGZpbGVuYW1lICsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIiB3YXMgZGVuaWVkIGRlbmllZCBieSBTZWN1cml0eU1hbmFnZXIuIiwgZSk7CisgICAgICAgICAgICAgICAgICAgIH0gZmluYWxseSB7CisgICAgICAgICAgICAgICAgICAgICAgICBpZiAocm5kQWNjZXNzRmlsZSAhPSBudWxsKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgdHJ5IHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcm5kQWNjZXNzRmlsZS5jbG9zZSgpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0gY2F0Y2ggKElPRXhjZXB0aW9uIGUpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmVzdWx0ID0gRG93bmxvYWRzLkltcGwuU1RBVFVTX0ZJTEVfRVJST1I7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIExvZy53KFRBRywgIkZhaWxlZCB0byBjbG9zZSBGaWxlOiIgKyBmaWxlbmFtZQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICsgIi4iLCBlKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9IGNhdGNoIChJbGxlZ2FsU3RhdGVFeGNlcHRpb24gZSkgeworICAgICAgICAgICAgICAgIExvZy53KFRBRywgIkNvdWxkIG5vdCBjbG9zZSBjb252ZXJ0c2Vzc2lvbi4gQ29udmVydHNlc3Npb246ICIgKworICAgICAgICAgICAgICAgICAgICAgICAgbUNvbnZlcnRTZXNzaW9uSWQsIGUpOworICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgICAgIHJldHVybiByZXN1bHQ7CisgICAgfQorfQpkaWZmIC0tZ2l0IGEvY29yZS9qbmkvQWN0aXZpdHlNYW5hZ2VyLmNwcCBiL2NvcmUvam5pL0FjdGl2aXR5TWFuYWdlci5jcHAKZGVsZXRlZCBmaWxlIG1vZGUgMTAwNjQ0CmluZGV4IDBmOWQwYmIuLjAwMDAwMDAKLS0tIGEvY29yZS9qbmkvQWN0aXZpdHlNYW5hZ2VyLmNwcAorKysgL2Rldi9udWxsCkBAIC0xLDYwICswLDAgQEAKLS8qCi0gKiBDb3B5cmlnaHQgKEMpIDIwMDYgVGhlIEFuZHJvaWQgT3BlbiBTb3VyY2UgUHJvamVjdAotICoKLSAqIExpY2Vuc2VkIHVuZGVyIHRoZSBBcGFjaGUgTGljZW5zZSwgVmVyc2lvbiAyLjAgKHRoZSAiTGljZW5zZSIpOwotICogeW91IG1he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RhIGZvbGxvd2luZy4KLSAgICAgICAgICAgICAgICBpZiAocmVwbHkucmVhZEludDMyKCkgIT0gMCkgewotICAgICAgICAgICAgICAgICAgICBmZCA9IGR1cChyZXBseS5yZWFkRmlsZURlc2NyaXB0b3IoKSk7Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgfSBlbHNlIHsKLSAgICAgICAgICAgICAgICAvLyBBbiBleGNlcHRpb24gd2FzIHRocm93biBiYWNrOyBmYWxsIHRocm91Z2ggdG8gcmV0dXJuIGZhaWx1cmUKLSAgICAgICAgICAgICAgICBBTE9HRCgib3BlbkNvbnRlbnRVcmkoJXMpIGNhdWdodCBleGNlcHRpb24gJWRcbiIsCi0gICAgICAgICAgICAgICAgICAgICAgICBTdHJpbmc4KHVyaSkuc3RyaW5nKCksIGV4Y2VwdGlvbkNvZGUpOwotICAgICAgICAgICAgfQotICAgICAgICB9Ci0gICAgfQotCi0gICAgcmV0dXJuIGZkOwotfQotCi19IC8qIG5hbWVzcGFjZSBhbmRyb2lkICovCmRpZmYgLS1naXQgYS9jb3JlL2puaS9BbmRyb2lkLm1rIGIvY29yZS9qbmkvQW5kcm9pZC5tawppbmRleCA1NjUwZDY4Li5lYzBmZTAwIDEwMDY0NAotLS0gYS9jb3JlL2puaS9BbmRyb2lkLm1rCisrKyBiL2NvcmUvam5pL0FuZHJvaWQubWsKQEAgLTI2LDcgKzI2LDYgQEAKIExPQ0FMX0NGTEFHUyArPSAtREdMX0dMRVhUX1BST1RPVFlQRVMgLURFR0xfRUdMRVhUX1BST1RPVFlQRVMKIAogTE9DQUxfU1JDX0ZJTEVTOj0gXAotCUFjdGl2aXR5TWFuYWdlci5jcHAgXAogCUFuZHJvaWRSdW50aW1lLmNwcCBcCiAJVGltZS5jcHAgXAogCWNvbV9hbmRyb2lkX2ludGVybmFsX2NvbnRlbnRfTmF0aXZlTGlicmFyeUhlbHBlci5jcHAgXApAQCAtMTY2LDYgKzE2NSw3IEBACiAJJChjYWxsIGluY2x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D4KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPC90ZD4KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDwvdHI+CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPHRyPgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA8dGQgY29sc3Bhbj0iMiI+PGRpdiBjbGFzcz0ic2VwZXJhdG9yIj4mbmJzcDs8L2Rpdj48L3RkPgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPC90cj4KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDx0cj4KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPHRkIGNsYXNzPSJpbWFnZUNlbGwiPjxhIGhyZWY9IntAZG9jUm9vdH1kZXNpZ24vaW5kZXguaHRtbCI+PGltZyBzcmM9IntAZG9jUm9vdH1hc3NldHMvaW1hZ2VzL2ljb25fZGVzaWduLnBuZyIgc3R5bGU9InBhZGRpbmc6NXB4IiAvPjwvYT48L3RkPgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA8dGQ+CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPGgyIGNsYXNzPSJncmVlbiI+RGVzaWduPC9oMj4KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA8cD5MZWFybiBhYm91dCBwcmluY2lwbGVzLCBidWlsZGluZyBibG9ja3MsIGFuZCBwYXR0ZXJucyBmb3IgY3JlYXRpbmcgd29ybGQtY2xhc3MgQW5kcm9pZCB1c2VyIGludGVyZmFjZXMuPC9wPgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDxwPjxhIGhyZWY9IntAZG9jUm9vdH1kZXNpZ24vaW5kZXguaHRtbCI+TGVhcm4gbW9yZSAmcmFxdW87PC9hPjwvcD4KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPC90ZD4KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDwvdHI+CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDx0cj4KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPHRkIGNvbHNwYW49IjIiPjxkaXYgY2xhc3M9InNlcGVyYXRvciI+Jm5ic3A7PC9kaXY+PC90ZD4KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDwvdHI+CkBAIC02NCwxNyArNzgsNyBAQAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDxwPjxhIGhyZWY9Imh0dHA6Ly9wbGF5Lmdvb2dsZS5jb20vYXBwcy9wdWJsaXNoIj5MZWFybiBtb3JlICZyYXF1bzs8L2E+PC9wPgogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA8L3RkPgogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPC90cj4KLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDx0cj4KLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPHRkIGNvbHNwYW49IjIiPjxkaXYgY2xhc3M9InNlcGVyYXRvciI+Jm5ic3A7PC9kaXY+PC90ZD4KLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDwvdHI+Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICA8dHI+Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDx0ZCBjbGFzcz0iaW1hZ2VDZWxsIj48YSBocmVmPSJodHRwOi8vc291cmNlLmFuZHJvaWQuY29tIj48aW1nIHNyYz0ie0Bkb2NSb290fWFzc2V0cy9pbWFnZXMvaWNvbl9jb250cmlidXRlLmpwZyIgc3R5bGU9InBhZGRpbmc6MCIgLz48L2E+PC90ZD4KLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPHRkPgotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDxoMiBjbGFzcz0iZ3JlZW4iPkNvbnRyaWJ1dGU8L2gyPgotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDxwPkFuZHJvaWQgT3BlbiBTb3VyY2UgUHJvamVjdCBnaXZlcyB5b3UgYWNjZXNzIHRvIHRoZSBlbnRpcmUgcGxhdGZvcm0gc291cmNlLjwvcD4KLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA8cD48YSBocmVmPSJodHRwOi8vc291cmNlLmFuZHJvaWQuY29tIj5MZWFybiBtb3JlICZyYXF1bzs8L2E+PC9wPgotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA8L3RkPgotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPC90cj4KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPHRyPgogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA8dGQgY29sc3Bhbj0iMiI+PGRpdiBjbGFzcz0ic2VwZXJhdG9yIj4mbmJzcDs8L2Rpdj48L3RkPgogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPC90cj4KZGlmZiAtLWdpdCBhL2RvY3MvaHRtbC9vZmZsaW5lLmpkIGIvZG9jcy9odG1sL29mZmxpbmUuamQKaW5kZXggNWY4ZTM3Y2UuLmVkZDhlYjAgMTAwNjQ0Ci0tLSBhL2RvY3MvaHRtbC9vZmZsaW5lLmpkCisrKyBiL2RvY3MvaHRtbC9vZmZsaW5lLmpkCkBAIC00MCw3ICs0MCw3IEBACiA8cD5Gb2xsb3cgdGhlIGd1aWRlIHRvIDxhIGhyZWY9IntAZG9jUm9vdH1zZG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AgICAgICAgIGNvbnN0IGludCBidWZmZXJTaXplID0gcmVwbHkucmVhZEludDMyKCk7Ci0gICAgICAgICAgICBjaGFyKiBkYXRhID0gTlVMTDsKLSAgICAgICAgICAgIGlmICgwIDwgYnVmZmVyU2l6ZSkgewotICAgICAgICAgICAgICAgIGRhdGEgPSBuZXcgY2hhcltidWZmZXJTaXplXTsKLSAgICAgICAgICAgICAgICByZXBseS5yZWFkKGRhdGEsIGJ1ZmZlclNpemUpOwotICAgICAgICAgICAgfQotICAgICAgICAgICAgZHJtQ29uc3RyYWludHMtPnB1dCgma2V5LCBkYXRhKTsKLSAgICAgICAgfQotICAgIH0KLSAgICByZXR1cm4gZHJtQ29uc3RyYWludHM7Ci19Ci0KLURybU1ldGFkYXRhKiBCcERybU1hbmFnZXJTZXJ2aWNlOjpnZXRNZXRhZGF0YShpbnQgdW5pcXVlSWQsIGNvbnN0IFN0cmluZzgqIHBhdGgpIHsKLSAgICBBTE9HVigiR2V0IE1ldGFkYXRhIik7Ci0gICAgUGFyY2VsIGRhdGEsIHJlcGx5OwotICAgIGRhdGEud3JpdGVJbnRlcmZhY2VUb2tlbihJRHJtTWFuYWdlclNlcnZpY2U6OmdldEludGVyZmFjZURlc2NyaXB0b3IoKSk7Ci0gICAgZGF0YS53cml0ZUludDMyKHVuaXF1ZUlkKTsKLQotICAgIERybU1ldGFkYXRhKiBkcm1NZXRhZGF0YSA9IE5VTEw7Ci0gICAgZGF0YS53cml0ZVN0cmluZzgoKnBhdGgpOwotICAgIHJlbW90ZSgpLT50cmFuc2FjdChHRVRfTUVUQURBVEFfRlJPTV9DT05URU5ULCBkYXRhLCAmcmVwbHkpOwotCi0gICAgaWYgKDAgIT0gcmVwbHkuZGF0YUF2YWlsKCkpIHsKLSAgICAgICAgLy9GaWxsaW5nIERybSBNZXRhZGF0YQotICAgICAgICBkcm1NZXRhZGF0YSA9IG5ldyBEcm1NZXRhZGF0YSgpOwotCi0gICAgICAgIGNvbnN0IGludCBzaXplID0gcmVwbHkucmVhZEludDMyKCk7Ci0gICAgICAgIGZvciAoaW50IGluZGV4ID0gMDsgaW5kZXggPCBzaXplOyArK2luZGV4KSB7Ci0gICAgICAgICAgICBjb25zdCBTdHJpbmc4IGtleShyZXBseS5yZWFkU3RyaW5nOCgpKTsKLSAgICAgICAgICAgIGNvbnN0IGludCBidWZmZXJTaXplID0gcmVwbHkucmVhZEludDMyKCk7Ci0gICAgICAgICAgICBjaGFyKiBkYXRhID0gTlVMTDsKLSAgICAgICAgICAgIGlmICgwIDwgYnVmZmVyU2l6ZSkgewotICAgICAgICAgICAgICAgIGRhdGEgPSBuZXcgY2hhcltidWZmZXJTaXplXTsKLSAgICAgICAgICAgICAgICByZXBseS5yZWFkKGRhdGEsIGJ1ZmZlclNpemUpOwotICAgICAgICAgICAgfQotICAgICAgICAgICAgZHJtTWV0YWRhdGEtPnB1dCgma2V5LCBkYXRhKTsKLSAgICAgICAgfQotICAgIH0KLSAgICByZXR1cm4gZHJtTWV0YWRhdGE7Ci19Ci0KLWJvb2wgQnBEcm1NYW5hZ2VyU2VydmljZTo6Y2FuSGFuZGxlKGludCB1bmlxdWVJZCwgY29uc3QgU3RyaW5nOCYgcGF0aCwgY29uc3QgU3RyaW5nOCYgbWltZVR5cGUpIHsKLSAgICBBTE9HVigiQ2FuIEhhbmRsZSIpOwotICAgIFBhcmNlbCBkYXRhLCByZXBseTsKLQotICAgIGRhdGEud3JpdGVJbnRlcmZhY2VUb2tlbihJRHJtTWFuYWdlclNlcnZpY2U6OmdldEludGVyZmFjZURlc2NyaXB0b3IoKSk7Ci0gICAgZGF0YS53cml0ZUludDMyKHVuaXF1ZUlkKTsKLQotICAgIGRhdGEud3JpdGVTdHJpbmc4KHBhdGgpOwotICAgIGRhdGEud3JpdGVTdHJpbmc4KG1pbWVUeXBlKTsKLQotICAgIHJlbW90ZSgpLT50cmFuc2FjdChDQU5fSEFORExFLCBkYXRhLCAmcmVwbHkpOwotCi0gICAgcmV0dXJuIHN0YXRpY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XkgPSBrZXlJdC5uZXh0KCk7Ci0gICAgICAgIGRhdGEud3JpdGVTdHJpbmc4KGtleSk7Ci0gICAgICAgIGNvbnN0IFN0cmluZzggdmFsdWUgPSBkcm1JbmZvLT5nZXQoa2V5KTsKLSAgICAgICAgZGF0YS53cml0ZVN0cmluZzgoKHZhbHVlID09IFN0cmluZzgoIiIpKSA/IFN0cmluZzgoIk5VTEwiKSA6IHZhbHVlKTsKLSAgICB9Ci0KLSAgICByZW1vdGUoKS0+dHJhbnNhY3QoUFJPQ0VTU19EUk1fSU5GTywgZGF0YSwgJnJlcGx5KTsKLQotICAgIERybUluZm9TdGF0dXMqIGRybUluZm9TdGF0dXMgPSBOVUxMOwotICAgIGlmICgwICE9IHJlcGx5LmRhdGFBdmFpbCgpKSB7Ci0gICAgICAgIC8vRmlsbGluZyBEUk0gSW5mbyBTdGF0dXMKLSAgICAgICAgY29uc3QgaW50IHN0YXR1c0NvZGUgPSByZXBseS5yZWFkSW50MzIoKTsKLSAgICAgICAgY29uc3QgaW50IGluZm9UeXBlID0gcmVwbHkucmVhZEludDMyKCk7Ci0gICAgICAgIGNvbnN0IFN0cmluZzggbWltZVR5cGUgPSByZXBseS5yZWFkU3RyaW5nOCgpOwotCi0gICAgICAgIERybUJ1ZmZlciogZHJtQnVmZmVyID0gTlVMTDsKLSAgICAgICAgaWYgKDAgIT0gcmVwbHkuZGF0YUF2YWlsKCkpIHsKLSAgICAgICAgICAgIGNvbnN0IGludCBidWZmZXJTaXplID0gcmVwbHkucmVhZEludDMyKCk7Ci0gICAgICAgICAgICBjaGFyKiBkYXRhID0gTlVMTDsKLSAgICAgICAgICAgIGlmICgwIDwgYnVmZmVyU2l6ZSkgewotICAgICAgICAgICAgICAgIGRhdGEgPSBuZXcgY2hhcltidWZmZXJTaXplXTsKLSAgICAgICAgICAgICAgICByZXBseS5yZWFkKGRhdGEsIGJ1ZmZlclNpemUpOwotICAgICAgICAgICAgfQotICAgICAgICAgICAgZHJtQnVmZmVyID0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V4IDwgYXJyYXlTaXplOyArK2luZGV4KSB7Ci0gICAgICAgICAgICBEcm1TdXBwb3J0SW5mbyBkcm1TdXBwb3J0SW5mbzsKLQotICAgICAgICAgICAgY29uc3QgaW50IGZpbGVTdWZmaXhWZWN0b3JTaXplID0gcmVwbHkucmVhZEludDMyKCk7Ci0gICAgICAgICAgICBmb3IgKGludCBpID0gMDsgaSA8IGZpbGVTdWZmaXhWZWN0b3JTaXplOyArK2kpIHsKLSAgICAgICAgICAgICAgICBkcm1TdXBwb3J0SW5mby5hZGRGaWxlU3VmZml4KHJlcGx5LnJlYWRTdHJpbmc4KCkpOwotICAgICAgICAgICAgfQotCi0gICAgICAgICAgICBjb25zdCBpbnQgbWltZVR5cGVWZWN0b3JTaXplID0gcmVwbHkucmVhZEludDMyKCk7Ci0gICAgICAgICAgICBmb3IgKGludCBpID0gMDsgaSA8IG1pbWVUeXBlVmVjdG9yU2l6ZTsgKytpKSB7Ci0gICAgICAgICAgICAgICAgZHJtU3VwcG9ydEluZm8uYWRkTWltZVR5cGUocmVwbHkucmVhZFN0cmluZzgoKSk7Ci0gICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgIGRybVN1cHBvcnRJbmZvLnNldERlc2NyaXB0aW9uKHJlcGx5LnJlYWRTdHJpbmc4KCkpOwotICAgICAgICAgICAgKCpkcm1TdXBwb3J0SW5mb0FycmF5KVtpbmRleF0gPSBkcm1TdXBwb3J0SW5mbzsKLSAgICAgICAgfQotICAgIH0KLSAgICAqbGVuZ3RoID0gYXJyYXlTaXplOwotICAgIHJldHVybiByZXBseS5yZWFkSW50MzIoKTsKLX0KLQotRGVjcnlwdEhhbmRsZSogQnBEcm1NYW5hZ2VyU2VydmljZTo6b3BlbkRlY3J5cHRTZXNzaW9uKAotICAgICAgICAgICAgaW50IHVuaXF1ZUlkLCBpbnQgZmQsIG9mZjY0X3Qgb2Zmc2V0LCBvZmY2NF90IGxlbmd0aCwgY29uc3QgY2hhciogbWltZSkgewotICAgIEFMT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SAgICAgICAgaWYgKE5VTEwgIT0gZHJtQ29uc3RyYWludHMpIHsKLSAgICAgICAgICAgIC8vRmlsbGluZyBEUk0gQ29uc3RyYWludHMgY29udGVudHMKLSAgICAgICAgICAgIHJlcGx5LT53cml0ZUludDMyKGRybUNvbnN0cmFpbnRzLT5nZXRDb3VudCgpKTsKLQotICAgICAgICAgICAgRHJtQ29uc3RyYWludHM6OktleUl0ZXJhdG9yIGtleUl0ID0gZHJtQ29uc3RyYWludHMtPmtleUl0ZXJhdG9yKCk7Ci0gICAgICAgICAgICB3aGlsZSAoa2V5SXQuaGFzTmV4dCgpKSB7Ci0gICAgICAgICAgICAgICAgY29uc3QgU3RyaW5nOCBrZXkgPSBrZXlJdC5uZXh0KCk7Ci0gICAgICAgICAgICAgICAgcmVwbHktPndyaXRlU3RyaW5nOChrZXkpOwotICAgICAgICAgICAgICAgIGNvbnN0IGNoYXIqIHZhbHVlID0gZHJtQ29uc3RyYWludHMtPmdldEFzQnl0ZUFycmF5KCZrZXkpOwotICAgICAgICAgICAgICAgIGludCBidWZmZXJTaXplID0gMDsKLSAgICAgICAgICAgICAgICBpZiAoTlVMTCAhPSB2YWx1ZSkgewotICAgICAgICAgICAgICAgICAgICBidWZmZXJTaXplID0gc3RybGVuKHZhbHVlKTsKLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgcmVwbHktPndyaXRlSW50MzIoYnVmZmVyU2l6ZSArIDEpOwotICAgICAgICAgICAgICAgIHJlcGx5LT53cml0ZSh2YWx1ZSwgYnVmZmVyU2l6ZSArIDEpOwotICAgICAgICAgICAgfQotICAgICAgICB9Ci0gICAgICAgIGRlbGV0ZSBkcm1Db25zdHJhaW50czsgZHJtQ29uc3RyYWludHMgPSBOVUxMOwotICAgICAgICByZXR1cm4gRFJNX05PX0VSUk9SOwotICAgIH0KLQotICAgIGNhc2UgR0VUX01FVEFEQVRBX0ZST01fQ09OVEVOVDoKLSAgICB7Ci0gICAgICAgIEFMT0dWKCJCbkRybU1hbmFnZXJTZXJ2aWNlOjpvblRyYW5zYWN0IDpHRVRfTUVUQURBVEFfRlJPTV9DT05URU5UIik7Ci0gICAgICAgIENIRUNLX0lOVEVSRkFDRShJRHJtTWFuYWdlclNlcnZpY2UsIGRhdGEsIHJlcGx5KTsKLQotICAgICAgICBjb25zdCBpbnQgdW5pcXVlSWQgPSBkYXRhLnJlYWRJbnQzMigpOwotICAgICAgICBjb25zdCBTdHJpbmc4IHBhdGggPSBkYXRhLnJlYWRTdHJpbmc4KCk7Ci0KLSAgICAgICAgRHJtTWV0YWRhdGEqIGRybU1ldGFkYXRhID0gZ2V0TWV0YWRhdGEodW5pcXVlSWQsICZwYXRoKTsKLSAgICAgICAgaWYgKE5VTEwgIT0gZHJtTWV0YWRhdGEpIHsKLSAgICAgICAgICAgIC8vRmlsbGluZyBEUk0gTWV0YWRhdGEgY29udGVudHMKLSAgICAgICAgICAgIHJlcGx5LT53cml0ZUludDMyKGRybU1ldGFkYXRhLT5nZXRDb3VudCgpKTsKLQotICAgICAgICAgICAgRHJtTWV0YWRhdGE6OktleUl0ZXJhdG9yIGtleUl0ID0gZHJtTWV0YWRhdGEtPmtleUl0ZXJhdG9yKCk7Ci0gICAgICAgICAgICB3aGlsZSAoa2V5SXQuaGFzTmV4dCgpKSB7Ci0gICAgICAgICAgICAgICAgY29uc3QgU3RyaW5nOCBrZXkgPSBrZXlJdC5uZXh0KCk7Ci0gICAgICAgICAgICAgICAgcmVwbHktPndyaXRlU3RyaW5nOChrZXkpOwotICAgICAgICAgICAgICAgIGNvbnN0IGNoYXIqIHZhbHVlID0gZHJtTWV0YWRhdGEtPmdldEFzQnl0ZUFycmF5KCZrZXkpOwotICAgICAgICAgICAgICAgIGludCBidWZmZXJTaXplID0gMDsKLSAgICAgICAgICAgICAgICBpZiAoTlVMTCAhPSB2YWx1ZSkgewotICAgICAgICAgICAgICAgICAgICBidWZmZXJTaXplID0gc3RybGVuKHZhbHVlKTsKLSAgICAgICAgICAgICAg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ybUluZm8qIGRybUluZm8gPSBhY3F1aXJlRHJtSW5mbyh1bmlxdWVJZCwgZHJtSW5mb1JlcXVlc3QpOwotCi0gICAgICAgIGlmIChOVUxMICE9IGRybUluZm8pIHsKLSAgICAgICAgICAgIC8vRmlsbGluZyBEUk0gSW5mbwotICAgICAgICAgICAgY29uc3QgRHJtQnVmZmVyIGRybUJ1ZmZlciA9IGRybUluZm8tPmdldERhdGEoKTsKLSAgICAgICAgICAgIHJlcGx5LT53cml0ZUludDMyKGRybUluZm8tPmdldEluZm9UeXBlKCkpOwotCi0gICAgICAgICAgICBjb25zdCBpbnQgYnVmZmVyU2l6ZSA9IGRybUJ1ZmZlci5sZW5ndGg7Ci0gICAgICAgICAgICByZXBseS0+d3JpdGVJbnQzMihidWZmZXJTaXplKTsKLSAgICAgICAgICAgIGlmICgwIDwgYnVmZmVyU2l6ZSkgewotICAgICAgICAgICAgICAgIHJlcGx5LT53cml0ZShkcm1CdWZmZXIuZGF0YSwgYnVmZmVyU2l6ZSk7Ci0gICAgICAgICAgICB9Ci0gICAgICAgICAgICByZXBseS0+d3JpdGVTdHJpbmc4KGRybUluZm8tPmdldE1pbWVUeXBlKCkpOwotICAgICAgICAgICAgcmVwbHktPndyaXRlSW50MzIoZHJtSW5mby0+Z2V0Q291bnQoKSk7Ci0KLSAgICAgICAgICAgIERybUluZm86OktleUl0ZXJhdG9yIGtleUl0ID0gZHJtSW5mby0+a2V5SXRlcmF0b3IoKTsKLSAgICAgICAgICAgIHdoaWxlIChrZXlJdC5oYXNOZXh0KCkpIHsKLSAgICAgICAgICAgICAgICBjb25zdCBTdHJpbmc4IGtleSA9IGtleUl0Lm5leHQoKTsKLSAgICAgICAgICAgICAgICByZXBseS0+d3JpdGVTdHJpbmc4KGtleSk7Ci0gICAgICAgICAgICAgICAgY29uc3QgU3RyaW5nOCB2YWx1ZSA9IGRybUluZm8tPmdldChrZXkpOwotICAgICAgICAgICAgICAgIHJlcGx5LT53cml0ZVN0cmluZzgoKHZ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VJbnQ2NChkcm1Db252ZXJ0ZWRTdGF0dXMtPm9mZnNldCk7Ci0KLSAgICAgICAgICAgIGlmIChOVUxMICE9IGRybUNvbnZlcnRlZFN0YXR1cy0+Y29udmVydGVkRGF0YSkgewotICAgICAgICAgICAgICAgIGNvbnN0IERybUJ1ZmZlciogY29udmVydGVkRGF0YSA9IGRybUNvbnZlcnRlZFN0YXR1cy0+Y29udmVydGVkRGF0YTsKLSAgICAgICAgICAgICAgICBjb25zdCBpbnQgYnVmZmVyU2l6ZSA9IGNvbnZlcnRlZERhdGEtPmxlbmd0aDsKLSAgICAgICAgICAgICAgICByZXBseS0+d3JpdGVJbnQzMihidWZmZXJTaXplKTsKLSAgICAgICAgICAgICAgICBpZiAoMCA8IGJ1ZmZlclNpemUpIHsKLSAgICAgICAgICAgICAgICAgICAgcmVwbHktPndyaXRlKGNvbnZlcnRlZERhdGEtPmRhdGEsIGJ1ZmZlclNpemUpOwotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICBkZWxldGUgW10gY29udmVydGVkRGF0YS0+ZGF0YTsKLSAgICAgICAgICAgICAgICBkZWxldGUgY29udmVydGVkRGF0YTsgY29udmVydGVkRGF0YSA9IE5VTEw7Ci0gICAgICAgICAgICB9Ci0gICAgICAgIH0KLSAgICAgICAgZGVsZXRlIGlucHV0RGF0YTsgaW5wdXREYXRhID0gTlVMTDsKLSAgICAgICAgZGVsZXRlIGRybUNvbnZlcnRlZFN0YXR1czsgZHJtQ29udmVydGVkU3RhdHVzID0gTlVMTDsKLSAgICAgICAgcmV0dXJuIERSTV9OT19FUlJPUjsKLSAgICB9Ci0KLSAgICBjYXNlIENMT1NFX0NPTlZFUlRfU0VTU0lPTjoKLSAgICB7Ci0gICAgICAgIEFMT0dWKCJCbkRybU1hbmFnZXJTZXJ2aWNlOjpvblRyYW5zYWN0IDpDTE9TRV9DT05WRVJUX1NFU1NJT04iKTsKLSAgICAgICAgQ0hFQ0tfSU5URVJGQUNFKElEcm1NYW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ZpeENvdW50KCkpOwotICAgICAgICAgICAgRHJtU3VwcG9ydEluZm86OkZpbGVTdWZmaXhJdGVyYXRvciBmaWxlU3VmZml4SXQKLSAgICAgICAgICAgICAgICA9IGRybVN1cHBvcnRJbmZvLmdldEZpbGVTdWZmaXhJdGVyYXRvcigpOwotICAgICAgICAgICAgd2hpbGUgKGZpbGVTdWZmaXhJdC5oYXNOZXh0KCkpIHsKLSAgICAgICAgICAgICAgICByZXBseS0+d3JpdGVTdHJpbmc4KGZpbGVTdWZmaXhJdC5uZXh0KCkpOwotICAgICAgICAgICAgfQotCi0gICAgICAgICAgICByZXBseS0+d3JpdGVJbnQzMihkcm1TdXBwb3J0SW5mby5nZXRNaW1lVHlwZUNvdW50KCkpOwotICAgICAgICAgICAgRHJtU3VwcG9ydEluZm86Ok1pbWVUeXBlSXRlcmF0b3IgbWltZVR5cGVJdCA9IGRybVN1cHBvcnRJbmZvLmdldE1pbWVUeXBlSXRlcmF0b3IoKTsKLSAgICAgICAgICAgIHdoaWxlIChtaW1lVHlwZUl0Lmhhc05leHQoKSkgewotICAgICAgICAgICAgICAgIHJlcGx5LT53cml0ZVN0cmluZzgobWltZVR5cGVJdC5uZXh0KCkpOwotICAgICAgICAgICAgfQotICAgICAgICAgICAgcmVwbHktPndyaXRlU3RyaW5nOChkcm1TdXBwb3J0SW5mby5nZXREZXNjcmlwdGlvbigpKTsKLSAgICAgICAgfQotICAgICAgICBkZWxldGUgW10gZHJtU3VwcG9ydEluZm9BcnJheTsgZHJtU3VwcG9ydEluZm9BcnJheSA9IE5VTEw7Ci0gICAgICAgIHJlcGx5LT53cml0ZUludDMyKHN0YXR1cyk7Ci0gICAgICAgIHJldHVybiBEUk1fTk9fRVJST1I7Ci0gICAgfQotCi0gICAgY2FzZSBPUEVOX0RFQ1JZUFRfU0VTU0lPTjoKLSAgICB7Ci0gICAgICAgIEFMT0dWKCJCbkRybU1hbmFnZXJTZXJ2aWNlOjpvblRyYW5zYWN0IDpPUEVOX0RFQ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ewotICAgICAgICBzbnByaW50ZihidWZmZXIsIFNJWkUsICJQZXJtaXNzaW9uIERlbmlhbDogIgotICAgICAgICAgICAgICAgICJjYW4ndCBkdW1wIERybU1hbmFnZXJTZXJ2aWNlIGZyb20gcGlkPSVkLCB1aWQ9JWRcbiIsCi0gICAgICAgICAgICAgICAgSVBDVGhyZWFkU3RhdGU6OnNlbGYoKS0+Z2V0Q2FsbGluZ1BpZCgpLAotICAgICAgICAgICAgICAgIElQQ1RocmVhZFN0YXRlOjpzZWxmKCktPmdldENhbGxpbmdVaWQoKSk7Ci0gICAgICAgIHJlc3VsdC5hcHBlbmQoYnVmZmVyKTsKLSAgICB9IGVsc2UgewotI2lmIERSTV9NRU1PUllfTEVBS19UUkFDSwotICAgICAgICBib29sIGR1bXBNZW0gPSBmYWxzZTsKLSAgICAgICAgZm9yIChzaXplX3QgaSA9IDA7IGkgPCBhcmdzLnNpemUoKTsgaSsrKSB7Ci0gICAgICAgICAgICBpZiAoYXJnc1tpXSA9PSBTdHJpbmcxNigiLW0iKSkgewotICAgICAgICAgICAgICAgIGR1bXBNZW0gPSB0cnVlOwotICAgICAgICAgICAgfQotICAgICAgICB9Ci0gICAgICAgIGlmIChkdW1wTWVtKSB7Ci0gICAgICAgICAgICBkdW1wTWVtb3J5QWRkcmVzc2VzKGZkKTsKLSAgICAgICAgfQotI2VuZGlmCi0gICAgfQotICAgIHdyaXRlKGZkLCByZXN1bHQuc3RyaW5nKCksIHJlc3VsdC5zaXplKCkpOwotICAgIHJldHVybiBOT19FUlJPUjsKLX0KLQpkaWZmIC0tZ2l0IGEvZHJtL2RybXNlcnZlci9tYWluX2RybXNlcnZlci5jcHAgYi9kcm0vZHJtc2VydmVyL21haW5fZHJtc2VydmVyLmNwcApkZWxldGVkIGZpbGUgbW9kZSAxMDA2NDQKaW5kZXggNDM0ZDU2MS4uMDAwMDAwMAotLS0gYS9kcm0vZHJtc2VydmVyL21haW5fZHJtc2VydmVyLmNwcAorKysgL2Rldi9udWx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gICAgICAgICBwUGx1Z0luQ29udGFpbmVyID0gTlVMTDsKLSAgICAgICAgICAgIHJldHVybjsKLSAgICAgICAgfQotICAgIH0KLQotICAgIC8qKgotICAgICAqIFVubG9hZCBhIHBsdWctaW4gc3RvcmVkIGluIHRoZSBzcGVjaWZpZWQgcGF0aAotICAgICAqCi0gICAgICogQHBhcmFtW2luXSByc1BsdWdJblBhdGgKLSAgICAgKiAgICAgUGx1Zy1pbiAoZHluYW1pYyBsaWJyYXJ5KSBmaWxlIHBhdGgKLSAgICAgKi8KLSAgICB2b2lkIHVubG9hZFBsdWdJbihjb25zdCBTdHJpbmc4JiByc1BsdWdJblBhdGgpIHsKLSAgICAgICAgaWYgKCFjb250YWlucyhyc1BsdWdJblBhdGgpKSB7Ci0gICAgICAgICAgICByZXR1cm47Ci0gICAgICAgIH0KLQotICAgICAgICBQbHVnSW5Db250YWluZXIqIHBQbHVnSW5Db250YWluZXIgPSBtX3BsdWdJbk1hcC52YWx1ZUZvcihyc1BsdWdJblBhdGgpOwotICAgICAgICBwUGx1Z0luQ29udGFpbmVyLT5mcERlc3RvcnkocFBsdWdJbkNvbnRhaW5lci0+cEluc3RhbmNlKTsKLSAgICAgICAgZGxjbG9zZShwUGx1Z0luQ29udGFpbmVyLT5oSGFuZGxlKTsKLQotICAgICAgICBtX3BsdWdJbk1hcC5yZW1vdmVJdGVtKHJzUGx1Z0luUGF0aCk7Ci0gICAgICAgIGRlbGV0ZSBwUGx1Z0luQ29udGFpbmVyOwotICAgICAgICBwUGx1Z0luQ29udGFpbmVyID0gTlVMTDsKLSAgICB9Ci0KLXByaXZhdGU6Ci0gICAgLyoqCi0gICAgICogVHJ1ZSBpZiBUUGx1Z0luTWFuYWdlciBjb250YWlucyByc1BsdWdJbklkCi0gICAgICovCi0gICAgYm9vbCBjb250YWlucyhjb25zdCBTdHJpbmc4JiByc1BsdWdJbklkKSB7Ci0gICAgICAgIHJldHVybiBtX3BsdWdJbk1hcC5pbmRleE9mS2V5KHJz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Ly8vLy8vLy8KLSAgICAvKioKLSAgICAgKiBHZXQgY29uc3RyYWludCBpbmZvcm1hdGlvbiBhc3NvY2lhdGVkIHdpdGggaW5wdXQgY29udGVudAotICAgICAqCi0gICAgICogQHBhcmFtW2luXSB1bmlxdWVJZCBVbmlxdWUgaWRlbnRpZmllciBmb3IgYSBzZXNzaW9uCi0gICAgICogQHBhcmFtW2luXSBwYXRoIFBhdGggb2YgdGhlIHByb3RlY3RlZCBjb250ZW50Ci0gICAgICogQHBhcmFtW2luXSBhY3Rpb24gQWN0aW9ucyBkZWZpbmVkIHN1Y2ggYXMsCi0gICAgICogICAgIEFjdGlvbjo6REVGQVVMVCwgQWN0aW9uOjpQTEFZLCBldGMKLSAgICAgKiBAcmV0dXJuIERybUNvbnN0cmFpbnRzCi0gICAgICogICAgIGtleS12YWx1ZSBwYWlycyBvZiBjb25zdHJhaW50IGFyZSBlbWJlZGRlZCBpbiBpdAotICAgICAqIEBub3RlCi0gICAgICogICAgIEluIGNhc2Ugb2YgZXJyb3IsIHJldHVybiBOVUxMCi0gICAgICovCi0gICAgdmlydHVhbCBEcm1Db25zdHJhaW50cyogb25HZXRDb25zdHJhaW50cygKLSAgICAgICAgICAgIGludCB1bmlxdWVJZCwgY29uc3QgU3RyaW5nOCogcGF0aCwgaW50IGFjdGlvbikgPSAwOwotCi0gICAgLyoqCi0gICAgICogR2V0IG1ldGFkYXRhIGluZm9ybWF0aW9uIGFzc29jaWF0ZWQgd2l0aCBpbnB1dCBjb250ZW50Ci0gICAgICoKLSAgICAgKiBAcGFyYW1baW5dIHVuaXF1ZUlkIFVuaXF1ZSBpZGVudGlmaWVyIGZvciBhIHNlc3Npb24KLSAgICAgKiBAcGFyYW1baW5dIHBhdGggUGF0aCBvZiB0aGUgcHJvdGVjdGVkIGNvbnRlbnQKLSAgICAgKiBAcmV0dXJuIERybU1ldGFkYXRhCi0gICAgICogICAgICAgICBrZXktdmFsdWUgcGFpcnMgb2YgbWV0YWRhdGEKLSAgICA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Y3RlZCBjb250ZW50Ci0gICAgICogQHBhcmFtW2luXSBhY3Rpb24gQWN0aW9ucyBkZWZpbmVkIHN1Y2ggYXMsCi0gICAgICogICAgIEFjdGlvbjo6REVGQVVMVCwgQWN0aW9uOjpQTEFZLCBldGMKLSAgICAgKiBAcmV0dXJuIERybUNvbnN0cmFpbnRzCi0gICAgICogICAgIGtleS12YWx1ZSBwYWlycyBvZiBjb25zdHJhaW50IGFyZSBlbWJlZGRlZCBpbiBpdAotICAgICAqIEBub3RlCi0gICAgICogICAgIEluIGNhc2Ugb2YgZXJyb3IsIHJldHVybiBOVUxMCi0gICAgICovCi0gICAgdmlydHVhbCBEcm1Db25zdHJhaW50cyogZ2V0Q29uc3RyYWludHMoCi0gICAgICAgICAgICBpbnQgdW5pcXVlSWQsIGNvbnN0IFN0cmluZzgqIHBhdGgsIGludCBhY3Rpb24pID0gMDsKLQotICAgIC8qKgotICAgICAqIEdldCBtZXRhZGF0YSBpbmZvcm1hdGlvbiBhc3NvY2lhdGVkIHdpdGggaW5wdXQgY29udGVudAotICAgICAqCi0gICAgICogQHBhcmFtW2luXSB1bmlxdWVJZCBVbmlxdWUgaWRlbnRpZmllciBmb3IgYSBzZXNzaW9uCi0gICAgICogQHBhcmFtW2luXSBwYXRoIFBhdGggb2YgdGhlIHByb3RlY3RlZCBjb250ZW50Ci0gICAgICogQHJldHVybiBEcm1NZXRhZGF0YQotICAgICAqICAgICAgICAga2V5LXZhbHVlIHBhaXJzIG9mIG1ldGFkYXRhCi0gICAgICogQG5vdGUKLSAgICAgKiAgICAgIEluIGNhc2Ugb2YgZXJyb3IsIHJldHVybiBOVUxMCi0gICAgICovCi0gICAgdmlydHVhbCBEcm1NZXRhZGF0YSogZ2V0TWV0YWRhdGEoaW50IHVuaXF1ZUlkLCBjb25zdCBTdHJpbmc4KiBwYXRoKSA9IDA7Ci0KLSAgICAvKioKLSAgICAgKiBHZXQgd2hldGhlciB0aGUgZ2l2ZW4gY29udGVudCBjYW4gYmUg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XBfYXBwbGljYXRpb24pLTF9LAotICAgIHtNSU1FVFlQRV9JTUFHRSwgICAgICAgbWltZV9ncm91cF9pbWFnZSwgICAgICAgIHNpemVvZihtaW1lX2dyb3VwX2ltYWdlKS0xfSwKLSAgICB7TUlNRVRZUEVfVklERU8sICAgICAgIG1pbWVfZ3JvdXBfdmlkZW8sICAgICAgICBzaXplb2YobWltZV9ncm91cF92aWRlbyktMX0sCi0gICAge01JTUVUWVBFX0xBU1QsICAgICAgICBOVUxMLCAgICAgICAgICAgICAgICAgICAgMH0gLy8gTXVzdCBiZSBsYXN0IGVudHJ5Ci19OwotCi0vLyBMaXN0IG9mIGFsbCBtaW1ldHlwZXMgdGhhdCBzaG91bGQgYmUgY29udmVydGVkLgotc3RhdGljIHN0cnVjdCBNaW1lVHlwZUxpc3QgbWltZVR5cGVMaXN0W10gPSB7Ci0gICAgLy8gTXAzIG1pbWUgdHlwZXMKLSAgICB7TUlNRVRZUEVfQVVESU8sICJtcDMiLCAgICAgICAgICBzaXplb2YoIm1wMyIpLTEsICAgICAgICAgbWltZV90eXBlX2F1ZGlvX21wZWd9LAotICAgIHtNSU1FVFlQRV9BVURJTywgIngtbXBlZyIsICAgICAgIHNpemVvZigieC1tcGVnIiktMSwgICAgICBtaW1lX3R5cGVfYXVkaW9fbXBlZ30sCi0gICAge01JTUVUWVBFX0FVRElPLCAieC1tcDMiLCAgICAgICAgc2l6ZW9mKCJ4LW1wMyIpLTEsICAgICAgIG1pbWVfdHlwZV9hdWRpb19tcGVnfSwKLSAgICB7TUlNRVRZUEVfQVVESU8sICJtcGciLCAgICAgICAgICBzaXplb2YoIm1wZyIpLTEsICAgICAgICAgbWltZV90eXBlX2F1ZGlvX21wZWd9LAotICAgIHtNSU1FVFlQRV9BVURJTywgIm1wZzMiLCAgICAgICAgIHNpemVvZigibXBnIiktMSwgICAgICAgICBtaW1lX3R5cGVfYXVkaW9fbXBlZ30sCi0gICAge01JTUVUWVBFX0FVRElPLCAieC1tcGciLCAg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VUxMICE9IHBNaW1lVHlwZSkgewotICAgICAgICBpZiAoKDAgPT0gc3RybmNtcChwTWltZVR5cGUsIG1pbWVfZ3JvdXBfYXVkaW8sIChzaXplb2YgbWltZV9ncm91cF9hdWRpbykgLSAxKSkgfHwKLSAgICAgICAgICAgICgwID09IHN0cm5jbXAocE1pbWVUeXBlLCBtaW1lX2dyb3VwX3ZpZGVvLCAoc2l6ZW9mIG1pbWVfZ3JvdXBfdmlkZW8pIC0gMSkpKSB7Ci0gICAgICAgICAgICAvKiBDaGVjayB3aGljaCBncm91cCB0aGUgbWltZXR5cGUgaXMgKi8KLSAgICAgICAgICAgIHBHcm91cCA9IG1pbWVHcm91cDsKLSAgICAgICAgICAgIHdoaWxlIChNSU1FVFlQRV9MQVNUICE9IHBHcm91cC0+dHlwZSkgewotICAgICAgICAgICAgICAgIGlmICgwID09IHN0cm5jbXAocE1pbWVUeXBlLCBwR3JvdXAtPnBHcm91cCwgcEdyb3VwLT5zaXplKSkgewotICAgICAgICAgICAgICAgICAgICBicmVhazsKLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgcEdyb3VwKys7Ci0gICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgIC8qIEdvIHRocm91Z2ggdGhlIG1pbWV0eXBlIGxpc3QuIE9ubHkgY2hlY2sgaXRlbXMgb2YgdGhlIGNvcnJlY3QgZ3JvdXAgKi8KLSAgICAgICAgICAgIGlmIChNSU1FVFlQRV9MQVNUICE9IHBHcm91cC0+dHlwZSkgewotICAgICAgICAgICAgICAgIHBNaW1lSXRlbSA9IG1pbWVUeXBlTGlzdDsKLSAgICAgICAgICAgICAgICBsZW4gPSBzdHJsZW4gKHBNaW1lVHlwZStwR3JvdXAtPnNpemUpOwotICAgICAgICAgICAgICAgIHdoaWxlIChNSU1FVFlQRV9MQVNUICE9IHBNaW1lSXRlbS0+dHlwZSkgewotICAgICAgICAgICAgICAgICAgICBpZiAoKHBHcm91cC0+dHlwZSA9PSBwTWltZUl0ZW0tPnR5cGUpICYmCi0gICAgICAgICAgICAgICAgICAgICAgICAobGVuID09IHBNaW1lSXRlbS0+c2l6ZSkgJiYKLSAgICAgICAgICAgICAgICAgICAgICAgICgwID09IHN0cmNtcChwTWltZVR5cGUrcEdyb3VwLT5zaXplLCBwTWltZUl0ZW0tPnBNaW1lRXh0KSkpIHsKLSAgICAgICAgICAgICAgICAgICAgICAgIHJlc3VsdCA9IFN0cmluZzgocE1pbWVJdGVtLT5wTWltZVR5cGUpOwotICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7Ci0gICAgICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICAgICAgcE1pbWVJdGVtKys7Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgfQotICAgICAgICB9IGVsc2UgewotICAgICAgICAgICAgcmVzdWx0ID0gU3RyaW5nOChtaW1lX3R5cGVfdW5zdXBwb3J0ZWQpOwotICAgICAgICB9Ci0gICAgICAgIExPR19ERUJVRygiY29udmVydE1pbWVUeXBlIGdvdCBtaW1ldHlwZSAlcywgY29udmVydGVkIGludG8gbWltZXR5cGUgJXMiLAotICAgICAgICAgICAgICAgIHBNaW1lVHlwZSwgcmVzdWx0LnN0cmluZygpKTsKLSAgICB9Ci0gICAgcmV0dXJuIHJlc3VsdDsKLX0KLX07CmRpZmYgLS1naXQgYS9kcm0vbGliZHJtZnJhbWV3b3JrL3BsdWdpbnMvZm9yd2FyZC1sb2NrL0FuZHJvaWQubWsgYi9kcm0vbGliZHJtZnJhbWV3b3JrL3BsdWdpbnMvZm9yd2FyZC1sb2NrL0FuZHJvaWQubWsKZGVsZXRlZCBmaWxlIG1vZGUgMTAwNjQ0CmluZGV4IDllZTc5NjEuLjAwMDAwMDAKLS0tIGEvZHJtL2xpYmRybWZyYW1ld29yay9wbHVnaW5zL2ZvcndhcmQtbG9jay9BbmRyb2lkLm1rCisrKyAvZGV2L251bGwKQEAgLTEsMTYgKzAsMCBAQAotIwotIyBDb3B5cm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UGxheWJhY2s6OlBBVVNFKQotICogQHBhcmFtIHBvc2l0aW9uIFBvc2l0aW9uIGluIHRoZSBmaWxlIChpbiBtaWxsaXNlY29uZHMpIHdoZXJlIHRoZSBzdGFydCBvY2N1cnMuCi0gKiAgICAgT25seSB2YWxpZCB0b2dldGhlciB3aXRoIFBsYXliYWNrOjpTVEFSVC4KLSAqIEByZXR1cm4gc3RhdHVzX3QKLSAqICAgICBSZXR1cm5zIERSTV9OT19FUlJPUiBmb3Igc3VjY2VzcywgRFJNX0VSUk9SX1VOS05PV04gZm9yIGZhaWx1cmUKLSAqLwotI2lmZGVmIFVTRV82NEJJVF9EUk1fQVBJCi1zdGF0dXNfdCBvblNldFBsYXliYWNrU3RhdHVzKGludCB1bmlxdWVJZCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgRGVjcnlwdEhhbmRsZSogZGVjcnlwdEhhbmRsZSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaW50IHBsYXliYWNrU3RhdHVzLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpbnQ2NF90IHBvc2l0aW9uKTsKLSNlbHNlCi1zdGF0dXNfdCBvblNldFBsYXliYWNrU3RhdHVzKGludCB1bmlxdWVJZCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgRGVjcnlwdEhhbmRsZSogZGVjcnlwdEhhbmRsZSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaW50IHBsYXliYWNrU3RhdHVzLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpbnQgcG9zaXRpb24pOwotI2VuZGlmCi0KLS8qKgotICogIFZhbGlkYXRlcyB3aGV0aGVyIGFuIGFjdGlvbiBvbiB0aGUgRFJNIGNvbnRlbnQgaXMgYWxsb3dlZCBvciBub3QuCi0gKgotICogQHBhcmFtIHVuaXF1ZUlkIFVuaXF1ZSBpZGVudGlmaWVyIGZvciBhIHNlc3Npb24KLSAqIEBwYXJhbSBwYXRoIFBhdGggb2YgdG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W9uOjpESVNQTEFZOgotICAgICAgICAgICAgICAgIHJlc3VsdCA9IFJpZ2h0c1N0YXR1czo6UklHSFRTX1ZBTElEOwotICAgICAgICAgICAgICAgIGJyZWFrOwotCi0gICAgICAgICAgICBjYXNlIEFjdGlvbjo6VFJBTlNGRVI6Ci0gICAgICAgICAgICBkZWZhdWx0OgotICAgICAgICAgICAgICAgIHJlc3VsdCA9IFJpZ2h0c1N0YXR1czo6UklHSFRTX0lOVkFMSUQ7Ci0gICAgICAgICAgICAgICAgYnJlYWs7Ci0gICAgICAgIH0KLSAgICB9Ci0KLSAgICByZXR1cm4gcmVzdWx0OwotfQotCi1zdGF0dXNfdCBGd2RMb2NrRW5naW5lOjpvbkNvbnN1bWVSaWdodHMoaW50IHVuaXF1ZUlkLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIERlY3J5cHRIYW5kbGUqIGRlY3J5cHRIYW5kbGUsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaW50IGFjdGlvbiwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBib29sIHJlc2VydmUpIHsKLSAgICAvLyBObyByaWdodHMgY29uc3VtcHRpb24KLSAgICBMT0dfVkVSQk9TRSgiRndkTG9ja0VuZ2luZTo6b25Db25zdW1lUmlnaHRzIik7Ci0gICAgcmV0dXJuIERSTV9OT19FUlJPUjsKLX0KLQotYm9vbCBGd2RMb2NrRW5naW5lOjpvblZhbGlkYXRlQWN0aW9uKGludCB1bmlxdWVJZCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb25zdCBTdHJpbmc4JiBwYXRoLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGludCBhY3Rpb24sCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY29uc3QgQWN0aW9uRGVzY3JpcHRpb24mIGRlc2NyaXB0aW9uKSB7Ci0gICAgTE9HX1ZF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UgbmV3U2Vzc2lvbjsKLSAgICAgICAgfQotICAgIH0KLSAgICByZXR1cm4gcmVzdWx0OwotfQotCi1Ecm1Db252ZXJ0ZWRTdGF0dXMqIEZ3ZExvY2tFbmdpbmU6Om9uQ29udmVydERhdGEoaW50IHVuaXF1ZUlkLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGludCBjb252ZXJ0SWQsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY29uc3QgRHJtQnVmZmVyKiBpbnB1dERhdGEpIHsKLSAgICBGd2RMb2NrQ29udl9TdGF0dXNfdCByZXRTdGF0dXMgPSBGd2RMb2NrQ29udl9TdGF0dXNfSW52YWxpZEFyZ3VtZW50OwotICAgIERybUJ1ZmZlciAqY29udlJlc3VsdCA9IG5ldyBEcm1CdWZmZXIoTlVMTCwgMCk7Ci0gICAgaW50IG9mZnNldCA9IC0xOwotCi0gICAgaWYgKE5VTEwgIT0gaW5wdXREYXRhICYmIGNvbnZlcnRTZXNzaW9uTWFwLmlzQ3JlYXRlZChjb252ZXJ0SWQpKSB7Ci0gICAgICAgIENvbnZlcnRTZXNzaW9uICpjb252U2Vzc2lvbiA9IGNvbnZlcnRTZXNzaW9uTWFwLmdldFZhbHVlKGNvbnZlcnRJZCk7Ci0KLSAgICAgICAgaWYgKE5VTEwgIT0gY29udlNlc3Npb24pIHsKLSAgICAgICAgICAgIHJldFN0YXR1cyA9IEZ3ZExvY2tDb252X0NvbnZlcnREYXRhKGNvbnZTZXNzaW9uLT51bmlxdWVJZCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlucHV0RGF0YS0+ZGF0YSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlucHV0RGF0YS0+bGVuZ3RoLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJihjb252U2Vzc2lvbi0+b3V0cHV0KSk7Ci0KLSAgICAgICAgICAgIGlmIChGd2RMb2NrQ29udl9TdGF0dXNfT0sgPT0gcmV0U3RhdHVzKSB7Ci0gICAgICAgICAgICAgICAgLy8gcmV0dXJuIGJ5dGVzIGZyb20gY29udmVyc2lvbiBpZiBhdmFpbGFibGUKLSAgICAgICAgICAgICAgICBpZiAoY29udlNlc3Npb24tPm91dHB1dC5mcm9tQ29udmVydERhdGEubnVtQnl0ZXMgPiAwKSB7Ci0gICAgICAgICAgICAgICAgICAgIGNvbnZSZXN1bHQtPmRhdGEgPSBuZXcgY2hhcltjb252U2Vzc2lvbi0+b3V0cHV0LmZyb21Db252ZXJ0RGF0YS5udW1CeXRlc107Ci0KLSAgICAgICAgICAgICAgICAgICAgaWYgKE5VTEwgIT0gY29udlJlc3VsdC0+ZGF0YSkgewotICAgICAgICAgICAgICAgICAgICAgICAgY29udlJlc3VsdC0+bGVuZ3RoID0gY29udlNlc3Npb24tPm91dHB1dC5mcm9tQ29udmVydERhdGEubnVtQnl0ZXM7Ci0gICAgICAgICAgICAgICAgICAgICAgICBtZW1jcHkoY29udlJlc3VsdC0+ZGF0YSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoY2hhciAqKWNvbnZTZXNzaW9uLT5vdXRwdXQuZnJvbUNvbnZlcnREYXRhLnBCdWZmZXIsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY29udlJlc3VsdC0+bGVuZ3RoKTsKLSAgICAgICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgIH0gZWxzZSB7Ci0gICAgICAgICAgICAgICAgb2Zmc2V0ID0gY29udlNlc3Npb24tPm91dHB1dC5mcm9tQ29udmVydERhdGEuZXJyb3JQb3M7Ci0gICAgICAgICAgICB9Ci0gICAgICAgIH0KLSAgICB9Ci0gICAgcmV0dXJuIG5ldyBEcm1Db252ZXJ0ZWRTdGF0dXMoZ2V0Q29udm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tPmRhdGEgPSBuZXcgY2hhcltGV0RfTE9DS19TSUdOQVRVUkVTX1NJWkVdOwotCi0gICAgICAgICAgICAgICAgaWYgKE5VTEwgIT0gY29udlJlc3VsdC0+ZGF0YSkgewotICAgICAgICAgICAgICAgICAgICAgIGNvbnZSZXN1bHQtPmxlbmd0aCA9IEZXRF9MT0NLX1NJR05BVFVSRVNfU0laRTsKLSAgICAgICAgICAgICAgICAgICAgICBtZW1jcHkoY29udlJlc3VsdC0+ZGF0YSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKGNoYXIgKiljb252U2Vzc2lvbi0+b3V0cHV0LmZyb21DbG9zZVNlc3Npb24uc2lnbmF0dXJlcywKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY29udlJlc3VsdC0+bGVuZ3RoKTsKLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICB9Ci0gICAgICAgIH0KLSAgICAgICAgY29udmVydFNlc3Npb25NYXAucmVtb3ZlVmFsdWUoY29udmVydElkKTsKLSAgICB9Ci0gICAgcmV0dXJuIG5ldyBEcm1Db252ZXJ0ZWRTdGF0dXMoZ2V0Q29udmVydGVkU3RhdHVzKHJldFN0YXR1cyksIGNvbnZSZXN1bHQsIG9mZnNldCk7Ci19Ci0KLSNpZmRlZiBVU0VfNjRCSVRfRFJNX0FQSQotc3RhdHVzX3QgRndkTG9ja0VuZ2luZTo6b25PcGVuRGVjcnlwdFNlc3Npb24oaW50IHVuaXF1ZUlkLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgRGVjcnlwdEhhbmRsZSogZGVjcnlwdEhhbmRsZSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGludCBmZCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG9mZjY0X3Qgb2Zmc2V0LAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgb2ZmNjRfdCBsZW5ndGgpIHsKLSNlbHNlCi1zdGF0dXNfdCBGd2RMb2NrRW5naW5lOjpvbk9wZW5EZWNyeXB0U2Vzc2lvbihpbnQgdW5pcXVlSWQsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBEZWNyeXB0SGFuZGxlKiBkZWNyeXB0SGFuZGxlLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaW50IGZkLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaW50IG9mZnNldCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGludCBsZW5ndGgpIHsKLSNlbmRpZgotICAgIHN0YXR1c190IHJlc3VsdCA9IERSTV9FUlJPUl9DQU5OT1RfSEFORExFOwotICAgIGludCBmaWxlRGVzYyA9IC0xOwotCi0gICAgTE9HX1ZFUkJPU0UoIkZ3ZExvY2tFbmdpbmU6Om9uT3BlbkRlY3J5cHRTZXNzaW9uIik7Ci0KLSAgICBpZiAoKC0xIDwgZmQpICYmCi0gICAgICAgIChOVUxMICE9IGRlY3J5cHRIYW5kbGUpICYmCi0gICAgICAgICghZGVjb2RlU2Vzc2lvbk1hcC5pc0NyZWF0ZWQoZGVjcnlwdEhhbmRsZS0+ZGVjcnlwdElkKSkpIHsKLSAgICAgICAgZmlsZURlc2MgPSBkdXAoZmQpOwotICAgIH0gZWxzZSB7Ci0gICAgICAgIEFMT0dFKCJGd2RMb2NrRW5naW5lOjpvbk9wZW5EZWNyeXB0U2Vzc2lvbiBwYXJhbWV0ZXIgZXJyb3IiKTsKLSAgICAgICAgcmV0dXJuIHJlc3VsdDsKLSAgICB9Ci0KLSAgICBpZiAoLTEgPCBmaWxlRGVzYyAmJgotICAgICAgICAtMSA8IDo6bHNlZWsoZmlsZURlc2MsIG9mZnNldCwgU0VFS19TRVQpICYmCi0gICAgICAgIC0xIDwgRndkTG9ja0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W5nOCB1cmlUYWcgPSBTdHJpbmc4KHVyaSk7Ci0gICAgICAgIHVyaVRhZy50b0xvd2VyKCk7Ci0KLSAgICAgICAgaWYgKDAgPT0gc3RybmNtcCh1cmlUYWcuc3RyaW5nKCksIGZpbGVUYWcsIHNpemVvZihmaWxlVGFnKSAtIDEpKSB7Ci0gICAgICAgICAgICBjb25zdCBjaGFyICpmaWxlUGF0aCA9IHN0cmNocih1cmkgKyBzaXplb2YoZmlsZVRhZykgLSAxLCAnLycpOwotICAgICAgICAgICAgaWYgKE5VTEwgIT0gZmlsZVBhdGggJiYgb25DYW5IYW5kbGUodW5pcXVlSWQsIFN0cmluZzgoZmlsZVBhdGgpKSkgewotICAgICAgICAgICAgICAgIGludCBmZCA9IG9wZW4oZmlsZVBhdGgsIE9fUkRPTkxZKTsKLQotICAgICAgICAgICAgICAgIGlmICgtMSA8IGZkKSB7Ci0gICAgICAgICAgICAgICAgICAgIC8vIG9mZnNldCBpcyBhbHdheXMgMCBhbmQgbGVuZ3RoIGlzIG5vdCB1c2VkLiBzbyBhbnkgcG9zaXRpdmUgc2l6ZS4KLSAgICAgICAgICAgICAgICAgICAgcmVzdWx0ID0gb25PcGVuRGVjcnlwdFNlc3Npb24odW5pcXVlSWQsIGRlY3J5cHRIYW5kbGUsIGZkLCAwLCAxKTsKLQotICAgICAgICAgICAgICAgICAgICAvLyBmZCBpcyBkdXBsaWNhdGVkIGFscmVhZHkgaWYgc3VjY2Vzcy4gY2xvc2luZyB0aGUgZmlsZQotICAgICAgICAgICAgICAgICAgICBjbG9zZShmZCk7Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgfQotICAgICAgICB9Ci0gICAgfQotCi0gICAgcmV0dXJuIHJlc3VsdDsKLX0KLQotc3RhdHVzX3QgRndkTG9ja0VuZ2luZTo6b25DbG9zZURlY3J5cHRTZXNzaW9uKGludCB1bmlxdWVJZCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB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2NrRW5naW5lOjpvbkRlY3J5cHQgaXMgbm90IHN1cHBvcnRlZCBmb3IgdGhpcyBEUk0gc2NoZW1lIik7Ci0gICAgcmV0dXJuIERSTV9FUlJPUl9VTktOT1dOOwotfQotCi1zdGF0dXNfdCBGd2RMb2NrRW5naW5lOjpvbkRlY3J5cHQoaW50IHVuaXF1ZUlkLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIERlY3J5cHRIYW5kbGUqIGRlY3J5cHRIYW5kbGUsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaW50IGRlY3J5cHRVbml0SWQsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY29uc3QgRHJtQnVmZmVyKiBlbmNCdWZmZXIsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgRHJtQnVmZmVyKiogZGVjQnVmZmVyKSB7Ci0gICAgQUxPR0UoIkZ3ZExvY2tFbmdpbmU6Om9uRGVjcnlwdCBpcyBub3Qgc3VwcG9ydGVkIGZvciB0aGlzIERSTSBzY2hlbWUiKTsKLSAgICByZXR1cm4gRFJNX0VSUk9SX1VOS05PV047Ci19Ci0KLXN0YXR1c190IEZ3ZExvY2tFbmdpbmU6Om9uRmluYWxpemVEZWNyeXB0VW5pdChpbnQgdW5pcXVlSWQsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgRGVjcnlwdEhhbmRsZSogZGVjcnlwdEhhbmRsZSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpbnQgZGVjcnlwdFVuaXRJZCkgewotICAgIEFMT0dFKCJGd2RMb2NrRW5naW5lOjpvbkZpbmFsaXplRGVjcnlwdFVuaXQgaXMgbm90IHN1cHBvcnRlZCBmb3IgdGhpcyBEUk0gc2NoZW1lIik7Ci0gICAgcmV0dXJuIERSTV9FUlJPUl9VTktOT1dOOwotfQotCi1zc2l6ZV90IEZ3ZExvY2tFb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ZmZlciArIGRhdGFTaWduYXR1cmVQb3MsIDAsCi0gICAgICAgICAgICAgICAgICAgU0hBMV9IQVNIX1NJWkUpOwotICAgICAgICAgICAgbWVtc2V0KChjaGFyICopcE91dHB1dC0+ZnJvbUNvbnZlcnREYXRhLnBCdWZmZXIgKyBoZWFkZXJTaWduYXR1cmVQb3MsIDAsCi0gICAgICAgICAgICAgICAgICAgU0hBMV9IQVNIX1NJWkUpOwotCi0gICAgICAgICAgICBwT3V0cHV0LT5mcm9tQ29udmVydERhdGEubnVtQnl0ZXMgPSBwU2Vzc2lvbi0+ZGF0YU9mZnNldDsKLSAgICAgICAgICAgIHN0YXR1cyA9IEZ3ZExvY2tDb252X1N0YXR1c19PSzsKLSAgICAgICAgfQotICAgIH0KLSAgICByZXR1cm4gc3RhdHVzOwotfQotCi0vKioKLSAqIE1hdGNoZXMgdGhlIE1JTUUgaGVhZGVycy4KLSAqCi0gKiBAcGFyYW1baW4sb3V0XSBwU2Vzc2lvbiBBIHJlZmVyZW5jZSB0byBhIGNvbnZlcnRlciBzZXNzaW9uLgotICogQHBhcmFtW2luXSBjaCBBIGNoYXJhY3Rlci4KLSAqIEBwYXJhbVtvdXRdIHBPdXRwdXQgVGhlIG91dHB1dCBmcm9tIHRoZSBjb252ZXJzaW9uIHByb2Nlc3MuCi0gKgotICogQHJldHVybiBBIHN0YXR1cyBjb2RlLgotICovCi1zdGF0aWMgRndkTG9ja0NvbnZfU3RhdHVzX3QgRndkTG9ja0NvbnZfTWF0Y2hNaW1lSGVhZGVycyhGd2RMb2NrQ29udl9TZXNzaW9uX3QgKnBTZXNzaW9uLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaW50IGNoLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgRndkTG9ja0NvbnZfT3V0cHV0X3QgKnBPdXRwdXQpIHsKLSAgICBGd2RMb2NrQ29udl9TdG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kTG9ja0NvbnZfU2Nhbm5lclN0YXRlX1dhbnRzTWltZUhlYWRlcnNFbmQ6Ci0gICAgICAgIGlmIChjaCA9PSAnXG4nKSB7Ci0gICAgICAgICAgICBzdGF0dXMgPSBGd2RMb2NrQ29udl9BcHBseURlZmF1bHRzKHBTZXNzaW9uKTsKLSAgICAgICAgICAgIGlmIChzdGF0dXMgPT0gRndkTG9ja0NvbnZfU3RhdHVzX09LKSB7Ci0gICAgICAgICAgICAgICAgc3RhdHVzID0gRndkTG9ja0NvbnZfVmVyaWZ5Q29udGVudFR5cGUocFNlc3Npb24pOwotICAgICAgICAgICAgfQotICAgICAgICAgICAgaWYgKHN0YXR1cyA9PSBGd2RMb2NrQ29udl9TdGF0dXNfT0spIHsKLSAgICAgICAgICAgICAgICBzdGF0dXMgPSBGd2RMb2NrQ29udl9Xcml0ZUhlYWRlcihwU2Vzc2lvbiwgcE91dHB1dCk7Ci0gICAgICAgICAgICB9Ci0gICAgICAgICAgICBpZiAoc3RhdHVzID09IEZ3ZExvY2tDb252X1N0YXR1c19PSykgewotICAgICAgICAgICAgICAgIGlmIChwU2Vzc2lvbi0+Y29udGVudFRyYW5zZmVyRW5jb2RpbmcgPT0KLSAgICAgICAgICAgICAgICAgICAgICAgIEZ3ZExvY2tDb252X0NvbnRlbnRUcmFuc2ZlckVuY29kaW5nX0JpbmFyeSkgewotICAgICAgICAgICAgICAgICAgICBwU2Vzc2lvbi0+cGFyc2VyU3RhdGUgPSBGd2RMb2NrQ29udl9QYXJzZXJTdGF0ZV9XYW50c0JpbmFyeUVuY29kZWREYXRhOwotICAgICAgICAgICAgICAgIH0gZWxzZSB7Ci0gICAgICAgICAgICAgICAgICAgIHBTZXNzaW9uLT5wYXJzZXJTdGF0ZSA9IEZ3ZExvY2tDb252X1BhcnNlclN0YXRlX1dhbnRzQmFzZTY0RW5jb2RlZERhdGE7Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgIHBTZXNzaW9uLT5zY2FubmVy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B9IGVsc2UgewotICAgICAgICAgICAgICAgIHBTZXNzaW9uLT5wRW5jcnlwdGVkU2Vzc2lvbktleSA9IG1hbGxvYyhwU2Vzc2lvbi0+ZW5jcnlwdGVkU2Vzc2lvbktleUxlbmd0aCk7Ci0gICAgICAgICAgICAgICAgaWYgKHBTZXNzaW9uLT5wRW5jcnlwdGVkU2Vzc2lvbktleSA9PSBOVUxMKSB7Ci0gICAgICAgICAgICAgICAgICAgIHN0YXR1cyA9IEZ3ZExvY2tDb252X1N0YXR1c19PdXRPZk1lbW9yeTsKLSAgICAgICAgICAgICAgICB9IGVsc2UgewotICAgICAgICAgICAgICAgICAgICBpZiAoIUZ3ZExvY2tHbHVlX0dldFJhbmRvbU51bWJlcihwU2Vzc2lvbi0+c2Vzc2lvbktleSwgS0VZX1NJWkUpKSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICBzdGF0dXMgPSBGd2RMb2NrQ29udl9TdGF0dXNfUmFuZG9tTnVtYmVyR2VuZXJhdGlvbkZhaWxlZDsKLSAgICAgICAgICAgICAgICAgICAgfSBlbHNlIGlmICghRndkTG9ja0dsdWVfRW5jcnlwdEtleShwU2Vzc2lvbi0+c2Vzc2lvbktleSwgS0VZX1NJWkUsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcFNlc3Npb24tPnBFbmNyeXB0ZWRTZXNzaW9uS2V5LAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBTZXNzaW9uLT5lbmNyeXB0ZWRTZXNzaW9uS2V5TGVuZ3RoKSkgewotICAgICAgICAgICAgICAgICAgICAgICAgc3RhdHVzID0gRndkTG9ja0NvbnZfU3RhdHVzX0tleUVuY3J5cHRpb25GYWlsZWQ7Ci0gICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICBzdGF0dXMgPSBGd2RMb2NrQ29udl9EZXJpdmVLZXlzKHBTZXNzaW9uKTsKLSAgICAgICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgICAgICBpZiAoc3RhdHVzID09IEZ3ZExvY2tDb252X1N0YXR1c19PSykgewotICAgICAgICAgICAgICAgICAgICAgICAgbWVtc2V0KHBTZXNzaW9uLT5zZXNzaW9uS2V5LCAwLCBLRVlfU0laRSk7IC8vIFplcm8gb3V0IGtleSBkYXRhLgotICAgICAgICAgICAgICAgICAgICAgICAgbWVtY3B5KHBTZXNzaW9uLT5jb3VudGVyLCBwU2Vzc2lvbi0+cEVuY3J5cHRlZFNlc3Npb25LZXksIEFFU19CTE9DS19TSVpFKTsKLSAgICAgICAgICAgICAgICAgICAgICAgIHBTZXNzaW9uLT5wYXJzZXJTdGF0ZSA9IEZ3ZExvY2tDb252X1BhcnNlclN0YXRlX1dhbnRzT3BlbkRlbGltaXRlcjsKLSAgICAgICAgICAgICAgICAgICAgICAgIHBTZXNzaW9uLT5zY2FubmVyU3RhdGUgPSBGd2RMb2NrQ29udl9TY2FubmVyU3RhdGVfV2FudHNGaXJzdERhc2g7Ci0gICAgICAgICAgICAgICAgICAgICAgICBwU2Vzc2lvbi0+bnVtQ2hhcnNDb25zdW1lZCA9IDA7Ci0gICAgICAgICAgICAgICAgICAgICAgICBwU2Vzc2lvbi0+ZGVsaW1pdGVyTWF0Y2hQb3MgPSAwOwotICAgICAgICAgICAgICAgICAgICAgICAgcFNlc3Npb24tPm1pbWVIZWFkZXJOYW1lID0gbnVsbFN0cmluZzsKLSAgICAgICAgICAgICAgICAgICAgICAgIHBTZXNzaW9uLT5jb250ZW50VHlwZSA9IG51bGxTdHJpbmc7Ci0gICAgICAgICAgICAgICAgICAgICAgICBwU2Vzc2lvbi0+Y29udGVudFRyYW5zZmVyRW5jb2RpbmcgPQotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBGd2RMb2NrQ29udl9Db250ZW50VHJhbnNmZXJFbmNvZGluZ19VbmRlZmluZWQ7Ci0gICAgICAgICAgICAgICAgICAgICAgICBwU2Vzc2lvbi0+a2V5U3RyZWFtSW5kZXggPSAtMTsKLSAgICAgICAgICAgICAgICAgICAgICAgIHBPdXRwdXQtPmZyb21Db252ZXJ0RGF0YS5wQnVmZmVyID0gTlVMTDsKLSAgICAgICAgICAgICAgICAgICAgICAgIHBPdXRwdXQtPmZyb21Db252ZXJ0RGF0YS5lcnJvclBvcyA9IElOVkFMSURfT0ZGU0VUOwotICAgICAgICAgICAgICAgICAgICB9IGVsc2UgewotICAgICAgICAgICAgICAgICAgICAgICAgZnJlZShwU2Vzc2lvbi0+cEVuY3J5cHRlZFNlc3Npb25LZXkpOwotICAgICAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgfQotICAgICAgICAgICAgaWYgKHN0YXR1cyAhPSBGd2RMb2NrQ29udl9TdGF0dXNfT0spIHsKLSAgICAgICAgICAgICAgICBGd2RMb2NrQ29udl9SZWxlYXNlU2Vzc2lvbigqcFNlc3Npb25JZCk7Ci0gICAgICAgICAgICAgICAgKnBTZXNzaW9uSWQgPSAtMTsKLSAgICAgICAgICAgIH0KLSAgICAgICAgfQotICAgIH0KLSAgICByZXR1cm4gc3RhdHVzOwotfQotCi1Gd2RMb2NrQ29udl9TdGF0dXNfdCBGd2RMb2NrQ29udl9Db252ZXJ0RGF0YShpbnQgc2Vzc2lvbklkLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY29uc3Qgdm9pZCAqcEJ1ZmZlciwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNpemVfdCBudW1CeXRlcywKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEZ3ZExvY2tDb252X091dHB1dF90ICpwT3V0cHV0KSB7Ci0gICAgRndkTG9ja0NvbnZfU3RhdHVzX3Qgc3RhdHVzOwotICAgIGlmICghRndkTG9ja0NvbnZfSXNWYWx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AgICAgICAgICBwU2Vzc2lvbi0+Y29udGVudFR5cGUubGVuZ3RoKTsKLSAgICAgICAgICAgICAgICBITUFDX1VwZGF0ZSgmcFNlc3Npb24tPnNpZ25pbmdDb250ZXh0LCBwU2Vzc2lvbi0+cEVuY3J5cHRlZFNlc3Npb25LZXksCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgcFNlc3Npb24tPmVuY3J5cHRlZFNlc3Npb25LZXlMZW5ndGgpOwotICAgICAgICAgICAgICAgIEhNQUNfVXBkYXRlKCZwU2Vzc2lvbi0+c2lnbmluZ0NvbnRleHQsIHBPdXRwdXQtPmZyb21DbG9zZVNlc3Npb24uc2lnbmF0dXJlcywKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBTSEExX0hBU0hfU0laRSk7Ci0gICAgICAgICAgICAgICAgSE1BQ19GaW5hbCgmcFNlc3Npb24tPnNpZ25pbmdDb250ZXh0LAotICAgICAgICAgICAgICAgICAgICAgICAgICAgJnBPdXRwdXQtPmZyb21DbG9zZVNlc3Npb24uc2lnbmF0dXJlc1tTSEExX0hBU0hfU0laRV0sICZzaWduYXR1cmVTaXplKTsKLSAgICAgICAgICAgICAgICBpZiAoc2lnbmF0dXJlU2l6ZSAhPSBTSEExX0hBU0hfU0laRSkgewotICAgICAgICAgICAgICAgICAgICBzdGF0dXMgPSBGd2RMb2NrQ29udl9TdGF0dXNfUHJvZ3JhbUVycm9yOwotICAgICAgICAgICAgICAgIH0gZWxzZSB7Ci0gICAgICAgICAgICAgICAgICAgIHBPdXRwdXQtPmZyb21DbG9zZVNlc3Npb24uZmlsZU9mZnNldCA9IFRPUF9IRUFERVJfU0laRSArCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgcFNlc3Npb24tPmNvbnRlbnRUeXBlLmxlbmd0aCArIHBTZXNzaW9uLT5lbmNyeXB0ZWRTZXNzaW9uS2V5TGVuZ3RoOwotICAgICAgICAgICAgICAgICAgICBzdGF0dXMgPSBGd2RMb2NrQ29udl9TdGF0dXNfT0s7Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgfQotICAgICAgICAgICAgcE91dHB1dC0+ZnJvbUNsb3NlU2Vzc2lvbi5lcnJvclBvcyA9IElOVkFMSURfT0ZGU0VUOwotICAgICAgICB9Ci0gICAgICAgIGZyZWUocFNlc3Npb24tPm1pbWVIZWFkZXJOYW1lLnB0cik7Ci0gICAgICAgIGZyZWUocFNlc3Npb24tPmNvbnRlbnRUeXBlLnB0cik7Ci0gICAgICAgIGZyZWUocFNlc3Npb24tPnBFbmNyeXB0ZWRTZXNzaW9uS2V5KTsKLSAgICAgICAgSE1BQ19DVFhfY2xlYW51cCgmcFNlc3Npb24tPnNpZ25pbmdDb250ZXh0KTsKLSAgICAgICAgRndkTG9ja0NvbnZfUmVsZWFzZVNlc3Npb24oc2Vzc2lvbklkKTsKLSAgICB9Ci0gICAgcmV0dXJuIHN0YXR1czsKLX0KLQotRndkTG9ja0NvbnZfU3RhdHVzX3QgRndkTG9ja0NvbnZfQ29udmVydE9wZW5GaWxlKGludCBpbnB1dEZpbGVEZXNjLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEZ3ZExvY2tDb252X1JlYWRGdW5jX3QgKmZwUmVhZEZ1bmMsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaW50IG91dHB1dEZpbGVEZXNjLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEZ3ZExvY2tDb252X1dyaXRlRnVuY190ICpmcFdyaXRlRnVuYywKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBGd2RMb2NrQ29udl9MU2Vla0Z1bmNfdCAqZnBMU2Vla0Z1bmMsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgb2ZmNjRfdCAqcEVycm9yUG9zKSB7Ci0gICAgRndkTG9ja0NvbnZfU3RhdHVzX3Qgc3RhdHVzOwotICAgIGlmIChwRXJyb3JQb3MgIT0gTlVMTCkgewotICAgICAgICAqcEVycm9yUG9zID0gSU5WQUxJRF9PRkZTRVQ7Ci0gICAgfQotICAgIGlmIChmcFJlYWRGdW5jID09IE5VTEwgfHwgZnBXcml0ZUZ1bmMgPT0gTlVMTCB8fCBmcExTZWVrRnVuYyA9PSBOVUxMIHx8IGlucHV0RmlsZURlc2MgPCAwIHx8Ci0gICAgICAgIG91dHB1dEZpbGVEZXNjIDwgMCkgewotICAgICAgICBzdGF0dXMgPSBGd2RMb2NrQ29udl9TdGF0dXNfSW52YWxpZEFyZ3VtZW50OwotICAgIH0gZWxzZSB7Ci0gICAgICAgIGNoYXIgKnBSZWFkQnVmZmVyID0gbWFsbG9jKFJFQURfQlVGRkVSX1NJWkUpOwotICAgICAgICBpZiAocFJlYWRCdWZmZXIgPT0gTlVMTCkgewotICAgICAgICAgICAgc3RhdHVzID0gRndkTG9ja0NvbnZfU3RhdHVzX091dE9mTWVtb3J5OwotICAgICAgICB9IGVsc2UgewotICAgICAgICAgICAgaW50IHNlc3Npb25JZDsKLSAgICAgICAgICAgIEZ3ZExvY2tDb252X091dHB1dF90IG91dHB1dDsKLSAgICAgICAgICAgIHN0YXR1cyA9IEZ3ZExvY2tDb252X09wZW5TZXNzaW9uKCZzZXNzaW9uSWQsICZvdXRwdXQpOwotICAgICAgICAgICAgaWYgKHN0YXR1cyA9PSBGd2RMb2NrQ29udl9TdGF0dXNfT0spIHsKLSAgICAgICAgICAgICAgICBzc2l6ZV90IG51bUJ5dGVzUmVhZDsKLSAgICAgICAgICAgICAgICBGd2RMb2NrQ29udl9TdGF0dXNfdCBjbG9zZVN0YXR1czsKLSAgICAgICAgICAgICAgICB3aGlsZSAoKG51bUJ5dGVzUmVhZCA9Ci0gICAgICAgICAgICAgICAgICAgICAgICBmcFJlYWRGdW5jKGlucHV0RmlsZURlc2MsIHBSZWFkQnVmZmVyLCBSRUFEX0JVRkZFUl9TSVpFKSkgPiAwKSB7Ci0gICAgICAgICAgICAgICAgICAgIHN0YXR1cyA9IEZ3ZExvY2tDb252X0NvbnZlcnREYXRhKHNlc3Npb25JZCwgcFJlYWRCdWZmZXIsIChzaXplX3QpbnVtQnl0ZXNSZWFkLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmb3V0cHV0KTsKLSAgICAgICAgICAgICAgICAgICAgaWYgKHN0YXR1cyA9PSBGd2RMb2NrQ29udl9TdGF0dXNfT0spIHsKLSAgICAgICAgICAgICAgICAgICAgICAgIGlmIChvdXRwdXQuZnJvbUNvbnZlcnREYXRhLnBCdWZmZXIgIT0gTlVMTCAmJgotICAgICAgICAgICAgICAgICAgICAgICAgICAgIG91dHB1dC5mcm9tQ29udmVydERhdGEubnVtQnl0ZXMgPiAwKSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgc3NpemVfdCBudW1CeXRlc1dyaXR0ZW4gPSBmcFdyaXRlRnVuYyhvdXRwdXRGaWxlRGVzYywKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG91dHB1dC5mcm9tQ29udmVydERhdGEucEJ1ZmZlciwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG91dHB1dC5mcm9tQ29udmVydERhdGEubnVtQnl0ZXMpOwotICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChudW1CeXRlc1dyaXR0ZW4gIT0gKHNzaXplX3Qpb3V0cHV0LmZyb21Db252ZXJ0RGF0YS5udW1CeXRlcykgewotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzdGF0dXMgPSBGd2RMb2NrQ29udl9TdGF0dXNfRmlsZVdyaXRlRXJyb3I7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOwotICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHsKLSAgICAgICAgICAgICAgICAgICAgICAgIGlmIChzdGF0dXMgPT0gRndkTG9ja0NvbnZfU3RhdHVzX1N5bnRheEVycm9yICYmIHBFcnJvclBvcyAhPSBOVUxMKSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgKnBFcnJvclBvcyA9IG91dHB1dC5mcm9tQ29udmVydERhdGEuZXJyb3JQb3M7Ci0gICAgICAgICAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKLSAgICAgICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgIH0gLy8gZW5kIHdoaWxlCi0gICAgICAgICAgICAgICAgaWYgKG51bUJ5dGVzUmVhZCA8IDApIHsKLSAgICAgICAgICAgICAgICAgICAgc3RhdHVzID0gRndkTG9ja0NvbnZfU3RhdHVzX0ZpbGVSZWFkRXJyb3I7Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgIGNsb3NlU3RhdHVzID0gRndkTG9ja0NvbnZfQ2xvc2VTZXNzaW9uKHNlc3Npb25JZCwgJm91dHB1dCk7Ci0gICAgICAgICAgICAgICAgaWYgKHN0YXR1cyA9PSBGd2RMb2NrQ29udl9TdGF0dXNfT0spIHsKLSAgICAgICAgICAgICAgICAgICAgaWYgKGNsb3NlU3RhdHVzICE9IEZ3ZExvY2tDb252X1N0YXR1c19PSykgewotICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGNsb3NlU3RhdHVzID09IEZ3ZExvY2tDb252X1N0YXR1c19TeW50YXhFcnJvciAmJiBwRXJyb3JQb3MgIT0gTlVMTCkgewotICAgICAgICAgICAgICAgICAgICAgICAgICAgICpwRXJyb3JQb3MgPSBvdXRwdXQuZnJvbUNsb3NlU2Vzc2lvbi5lcnJvclBvczsKLSAgICAgICAgICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICAgICAgICAgIHN0YXR1cyA9IGNsb3NlU3RhdHVzOwotICAgICAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKGZwTFNlZWtGdW5jKG91dHB1dEZpbGVEZXNjLCBvdXRwdXQuZnJvbUNsb3NlU2Vzc2lvbi5maWxlT2Zmc2V0LAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFNFRUtfU0VUKSA8IDApIHsKLSAgICAgICAgICAgICAgICAgICAgICAgIHN0YXR1cyA9IEZ3ZExvY2tDb252X1N0YXR1c19GaWxlU2Vla0Vycm9yOwotICAgICAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKGZwV3JpdGVGdW5jKG91dHB1dEZpbGVEZXNjLCBvdXRwdXQuZnJvbUNsb3NlU2Vzc2lvbi5zaWduYXR1cmVzLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEZXRF9MT0NLX1NJR05BVFVSRVNfU0laRSkgIT0gRldEX0xPQ0tfU0lHTkFUVVJFU19TSVpFKSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICBzdGF0dXMgPSBGd2RMb2NrQ29udl9TdGF0dXNfRmlsZVdyaXRlRXJyb3I7Ci0gICAgICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICB9Ci0gICAgICAgICAgICBmcmVlKHBSZWFkQnVmZmVyKTsKLSAgICAgICAgfQotICAgIH0KLSAgICByZXR1cm4gc3RhdHVzOwotfQotCi1Gd2RMb2NrQ29udl9TdGF0dXNfdCBGd2RMb2NrQ29udl9Db252ZXJ0RmlsZShjb25zdCBjaGFyICpwSW5wdXRGaWxlbmFtZSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbnN0IGNoYXIgKnBPdXRwdXRGaWxlbmFtZSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG9mZjY0X3QgKnBFcnJvclBvcykgewotICAgIEZ3ZExvY2tDb252X1N0YXR1c190IHN0YXR1czsKLSAgICBpZiAocEVycm9yUG9zICE9IE5VTEwpIHsKLSAgICAgICAgKnBFcnJvclBvcyA9IElOVkFMSURfT0ZGU0VUOwotICAgIH0KLSAgICBpZiAocElucHV0RmlsZW5hbWUgPT0gTlVMTCB8fCBwT3V0cHV0RmlsZW5hbWUgPT0gTlVMTCkgewotICAgICAgICBzdGF0dXMgPSBGd2RMb2NrQ29udl9TdGF0dXNfSW52YWxpZEFyZ3VtZW50OwotICAgIH0gZWxzZSB7Ci0gICAgICAgIGludCBpbnB1dEZpbGVEZXNjID0gb3BlbihwSW5wdXRGaWxlbmFtZSwgT19SRE9OTFkpOwotICAgICAgICBpZiAoaW5wdXRGaWxlRGVzYyA8IDApIHsKLSAgICAgICAgICAgIHN0YXR1cyA9IEZ3ZExvY2tDb252X1N0YXR1c19GaWxlTm90Rm91bmQ7Ci0gICAgICAgIH0gZWxzZSB7Ci0gICAgICAgICAgICBpbnQgb3V0cHV0RmlsZURlc2MgPSBvcGVuKHBPdXRwdXRGaWxlbmFtZSwgT19DUkVBVCB8IE9fVFJVTkMgfCBPX1dST05MWSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgU19JUlVTUiB8IFNfSVdVU1IgfCBTX0lSR1JQIHwgU19JUk9USCk7Ci0gICAgICAgICAgICBpZiAob3V0cHV0RmlsZURlc2MgPCAwKSB7Ci0gICAgICAgICAgICAgICAgc3RhdHVzID0gRndkTG9ja0NvbnZfU3RhdHVzX0ZpbGVDcmVhdGlvbkZhaWxlZDsKLSAgICAgICAgICAgIH0gZWxzZSB7Ci0gICAgICAgICAgICAgICAgc3RhdHVzID0gRndkTG9ja0NvbnZfQ29udmVydE9wZW5GaWxlKGlucHV0RmlsZURlc2MsIHJlYWQsIG91dHB1dEZpbGVEZXNjLCB3cml0ZSwKLSAgICAgICAgICAgICAgICA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R1c19LZXlFbmNyeXB0aW9uRmFpbGVkCi0gKiBAcmV0dmFsIEZ3ZExvY2tDb252X1N0YXR1c19EYXRhRW5jcnlwdGlvbkZhaWxlZAotICogQHJldHZhbCBGd2RMb2NrQ29udl9TdGF0dXNfSW50ZWdyaXR5UHJvdGVjdGlvbkZhaWxlZAotICogQHJldHZhbCBGd2RMb2NrQ29udl9TdGF0dXNfVG9vTWFueVNlc3Npb25zCi0gKi8KLUZ3ZExvY2tDb252X1N0YXR1c190IEZ3ZExvY2tDb252X0NvbnZlcnRPcGVuRmlsZShpbnQgaW5wdXRGaWxlRGVzYywKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBGd2RMb2NrQ29udl9SZWFkRnVuY190ICpmcFJlYWRGdW5jLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGludCBvdXRwdXRGaWxlRGVzYywKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBGd2RMb2NrQ29udl9Xcml0ZUZ1bmNfdCAqZnBXcml0ZUZ1bmMsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgRndkTG9ja0NvbnZfTFNlZWtGdW5jX3QgKmZwTFNlZWtGdW5jLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG9mZjY0X3QgKnBFcnJvclBvcyk7Ci0KLS8qKgotICogQ29udmVydHMgYW4gT01BIERSTSB2MSBGb3J3YXJkIExvY2sgZmlsZSB0byB0aGUgaW50ZXJuYWwgRm9yd2FyZCBMb2NrIGZpbGUgZm9ybWF0IGluIHB1bGwgbW9kZS4KLSAqCi0gKiBAcGFyYW1baW5dIHBJbnB1dEZpbGVuYW1lIEEgcmVmZXJlbmNlIHRvIHRoZSBpbnB1dCBmaWxlbmFtZS4KLSAqIEBwYXJhbVtpbl0gcE91dHB1dEZpbG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E7Ci0gICAgaWYgKGZpbGVEZXNjIDwgMCkgewotICAgICAgICBlcnJubyA9IEVCQURGOwotICAgIH0gZWxzZSB7Ci0gICAgICAgIGludCBpOwotICAgICAgICBwdGhyZWFkX211dGV4X2xvY2soJnNlc3Npb25BY3F1aXNpdGlvbk11dGV4KTsKLSAgICAgICAgZm9yIChpID0gMDsgaSA8IE1BWF9OVU1fU0VTU0lPTlM7ICsraSkgewotICAgICAgICAgICAgaW50IGNhbmRpZGF0ZVNlc3Npb25JZCA9IChmaWxlRGVzYyArIGkpICUgTUFYX05VTV9TRVNTSU9OUzsKLSAgICAgICAgICAgIGlmIChzZXNzaW9uUHRyc1tjYW5kaWRhdGVTZXNzaW9uSWRdID09IE5VTEwpIHsKLSAgICAgICAgICAgICAgICBzZXNzaW9uUHRyc1tjYW5kaWRhdGVTZXNzaW9uSWRdID0gbWFsbG9jKHNpemVvZiAqKnNlc3Npb25QdHJzKTsKLSAgICAgICAgICAgICAgICBpZiAoc2Vzc2lvblB0cnNbY2FuZGlkYXRlU2Vzc2lvbklkXSAhPSBOVUxMKSB7Ci0gICAgICAgICAgICAgICAgICAgIHNlc3Npb25QdHJzW2NhbmRpZGF0ZVNlc3Npb25JZF0tPmZpbGVEZXNjID0gZmlsZURlc2M7Ci0gICAgICAgICAgICAgICAgICAgIHNlc3Npb25QdHJzW2NhbmRpZGF0ZVNlc3Npb25JZF0tPnBDb250ZW50VHlwZSA9IE5VTEw7Ci0gICAgICAgICAgICAgICAgICAgIHNlc3Npb25QdHJzW2NhbmRpZGF0ZVNlc3Npb25JZF0tPnBFbmNyeXB0ZWRTZXNzaW9uS2V5ID0gTlVMTDsKLSAgICAgICAgICAgICAgICAgICAgc2Vzc2lvbklkID0gY2FuZGlkYXRlU2Vzc2lvbklkOwotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICBicmVhazsKLSAgICAgICAgICAgIH0KLSAgICAgICAgfQotICAgICAgICBwdGhyZWFkX211dGV4X3VubG9jaygm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9TSVpFKTsKLSAgICAgICAgaWYgKHJlc3VsdCkgewotICAgICAgICAgICAgaWYgKEFFU19zZXRfZW5jcnlwdF9rZXkocERhdGEtPmtleSwgS0VZX1NJWkVfSU5fQklUUywgJnBEYXRhLT5zZXNzaW9uUm91bmRLZXlzKSAhPSAwKSB7Ci0gICAgICAgICAgICAgICAgcmVzdWx0ID0gRkFMU0U7Ci0gICAgICAgICAgICB9IGVsc2UgewotICAgICAgICAgICAgICAgIC8vIEVuY3J5cHQgdGhlIDE2LWJ5dGUgdmFsdWUgezAsIDAsIC4uLiwgMH0gdG8gcHJvZHVjZSB0aGUgZW5jcnlwdGlvbiBrZXkuCi0gICAgICAgICAgICAgICAgbWVtc2V0KHBEYXRhLT52YWx1ZSwgMCwgS0VZX1NJWkUpOwotICAgICAgICAgICAgICAgIEFFU19lbmNyeXB0KHBEYXRhLT52YWx1ZSwgcERhdGEtPmtleSwgJnBEYXRhLT5zZXNzaW9uUm91bmRLZXlzKTsKLSAgICAgICAgICAgICAgICBpZiAoQUVTX3NldF9lbmNyeXB0X2tleShwRGF0YS0+a2V5LCBLRVlfU0laRV9JTl9CSVRTLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICZwU2Vzc2lvbi0+ZW5jcnlwdGlvblJvdW5kS2V5cykgIT0gMCkgewotICAgICAgICAgICAgICAgICAgICByZXN1bHQgPSBGQUxTRTsKLSAgICAgICAgICAgICAgICB9IGVsc2UgewotICAgICAgICAgICAgICAgICAgICAvLyBFbmNyeXB0IHRoZSAxNi1ieXRlIHZhbHVlIHsxLCAwLCAuLi4sIDB9IHRvIHByb2R1Y2UgdGhlIHNpZ25pbmcga2V5LgotICAgICAgICAgICAgICAgICAgICArK3BEYXRhLT52YWx1ZVswXTsKLSAgICAgICAgICAgICAgICAgICAgQUVTX2VuY3J5cHQocERhdGEtPnZhbHVlLCBwRGF0YS0+a2V5LCAmcERhdGEtPnNlc3Npb25Sb3VuZEtleXMpOwotICAgICAgICAgICAgICAgICAgICBITUFDX0NUWF9pbml0KCZwU2Vzc2lvbi0+c2lnbmluZ0NvbnRleHQpOwotICAgICAgICAgICAgICAgICAgICBITUFDX0luaXRfZXgoJnBTZXNzaW9uLT5zaWduaW5nQ29udGV4dCwgcERhdGEtPmtleSwgS0VZX1NJWkUsIEVWUF9zaGExKCksIE5VTEwpOwotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgIH0KLSAgICAgICAgfQotICAgICAgICBpZiAoIXJlc3VsdCkgewotICAgICAgICAgICAgZXJybm8gPSBFTk9TWVM7Ci0gICAgICAgIH0KLSAgICAgICAgbWVtc2V0KHBEYXRhLCAwLCBzaXplb2YgcERhdGEpOyAvLyBaZXJvIG91dCBrZXkgZGF0YS4KLSAgICAgICAgZnJlZShwRGF0YSk7Ci0gICAgfQotICAgIHJldHVybiByZXN1bHQ7Ci19Ci0KLS8qKgotICogQ2FsY3VsYXRlcyB0aGUgY291bnRlciwgdHJlYXRlZCBhcyBhIDE2LWJ5dGUgbGl0dGxlLWVuZGlhbiBudW1iZXIsIHVzZWQgdG8gZ2VuZXJhdGUgdGhlIGtleXN0cmVhbQotICogZm9yIHRoZSBnaXZlbiBibG9jay4KLSAqCi0gKiBAcGFyYW1baW5dIHBOb25jZSBBIHJlZmVyZW5jZSB0byB0aGUgbm9uY2UuCi0gKiBAcGFyYW1baW5dIGJsb2NrSW5kZXggVGhlIGluZGV4IG51bWJlciBvZiB0aGUgYmxvY2suCi0gKiBAcGFyYW1bb3V0XSBwQ291bnRlciBBIHJlZmVyZW5jZSB0byB0aGUgY291bnRlci4KLSAqLwotc3RhdGljIHZvaWQgRndkTG9ja0ZpbGVfQ2FsY3VsYXRlQ291bnRlcihjb25zdCB1bnNpZ25lZCBjaGFyICpwTm9uY2UsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHVpbnQ2NF90IGJsb2NrSW5kZXgsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC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V0UHJldmlld1RleHR1cmUoY29uc3Qgc3A8SVN1cmZhY2VUZXh0dXJlPiYgc3VyZmFjZVRleHR1cmUpOwotCi0gICAgICAgICAgICAvLyBzdGFydCBwcmV2aWV3IG1vZGUsIG11c3QgY2FsbCBzZXRQcmV2aWV3RGlzcGxheSBmaXJzdAotICAgICAgICAgICAgc3RhdHVzX3QgICAgc3RhcnRQcmV2aWV3KCk7Ci0KLSAgICAgICAgICAgIC8vIHN0b3AgcHJldmlldyBtb2RlCi0gICAgICAgICAgICB2b2lkICAgICAgICBzdG9wUHJldmlldygpOwotCi0gICAgICAgICAgICAvLyBnZXQgcHJldmlldyBzdGF0ZQotICAgICAgICAgICAgYm9vbCAgICAgICAgcHJldmlld0VuYWJsZWQoKTsKLQotICAgICAgICAgICAgLy8gc3RhcnQgcmVjb3JkaW5nIG1vZGUsIG11c3QgY2FsbCBzZXRQcmV2aWV3RGlzcGxheSBmaXJzdAotICAgICAgICAgICAgc3RhdHVzX3QgICAgc3RhcnRSZWNvcmRpbmcoKTsKLQotICAgICAgICAgICAgLy8gc3RvcCByZWNvcmRpbmcgbW9kZQotICAgICAgICAgICAgdm9pZCAgICAgICAgc3RvcFJlY29yZGluZygpOwotCi0gICAgICAgICAgICAvLyBnZXQgcmVjb3JkaW5nIHN0YXRlCi0gICAgICAgICAgICBib29sICAgICAgICByZWNvcmRpbmdFbmFibGVkKCk7Ci0KLSAgICAgICAgICAgIC8vIHJlbGVhc2UgYSByZWNvcmRpbmcgZnJhbWUKLSAgICAgICAgICAgIHZvaWQgICAgICAgIHJlbGVhc2VSZWNvcmRpbmdGcmFtZShjb25zdCBzcDxJTWVtb3J5PiYgbWVtKTsKLQotICAgICAgICAgICAgLy8gYXV0b0ZvY3VzIC0gc3RhdHVzIHJldHVybmVkIGZyb20gY2FsbGJhY2sKLSAgICAgICAgICAgIHN0YXR1c190ICAgIGF1dG9Gb2N1cygpOwotCi0gICAgICAgICAgICAvLyBjYW5jZWwgYXV0byBmb2N1cw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WNvcmRpbmdQcm94eUxpc3RlbmVyPiYgbGlzdGVuZXIpOwotICAgICAgICB2aXJ0dWFsIHZvaWQgc3RvcFJlY29yZGluZygpOwotICAgICAgICB2aXJ0dWFsIHZvaWQgcmVsZWFzZVJlY29yZGluZ0ZyYW1lKGNvbnN0IHNwPElNZW1vcnk+JiBtZW0pOwotCi0gICAgcHJpdmF0ZToKLSAgICAgICAgc3A8Q2FtZXJhPiAgICAgICAgIG1DYW1lcmE7Ci0gICAgfTsKLQotcHJpdmF0ZToKLSAgICAgICAgICAgICAgICAgICAgICAgIENhbWVyYSgpOwotICAgICAgICAgICAgICAgICAgICAgICAgQ2FtZXJhKGNvbnN0IENhbWVyYSYpOwotICAgICAgICAgICAgICAgICAgICAgICAgQ2FtZXJhJiBvcGVyYXRvcj0oY29uc3QgQ2FtZXJhKTsKLSAgICAgICAgICAgICAgICAgICAgICAgIHZpcnR1YWwgdm9pZCBiaW5kZXJEaWVkKGNvbnN0IHdwPElCaW5kZXI+JiB3aG8pOwotCi0gICAgICAgICAgICBjbGFzcyBEZWF0aE5vdGlmaWVyOiBwdWJsaWMgSUJpbmRlcjo6RGVhdGhSZWNpcGllbnQKLSAgICAgICAgICAgIHsKLSAgICAgICAgICAgIHB1YmxpYzoKLSAgICAgICAgICAgICAgICBEZWF0aE5vdGlmaWVyKCkgewotICAgICAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgICAgIHZpcnR1YWwgdm9pZCBiaW5kZXJEaWVkKGNvbnN0IHdwPElCaW5kZXI+JiB3aG8pOwotICAgICAgICAgICAgfTsKLQotICAgICAgICAgICAgc3RhdGljIHNwPERlYXRoTm90aWZpZXI+IG1EZWF0aE5vdGlmaWVyOwotCi0gICAgICAgICAgICAvLyBoZWxwZXIgZnVuY3Rpb24gdG8gb2J0YWluIGNhbWVyYSBzZXJ2aWNlIGhhbmRsZQotICAgICAgICAgICAgc3RhdGljIGNvbnN0IHNwPElDYW1lcmFTZXJ2aWNlPiYgZ2V0Q2Ft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ChOVUxMICE9IHZhbHVlKSB7Ci0gICAgICAgICAgICAgICAgICAgIGRlbGV0ZVtdIHZhbHVlOwotICAgICAgICAgICAgICAgICAgICB2YWx1ZSA9IE5VTEw7Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICB9Ci0gICAgICAgIG1Db25zdHJhaW50TWFwLmNsZWFyKCk7Ci0gICAgfQotcHVibGljOgotICAgIC8qKgotICAgICAqIFJldHVybnMgdGhlIG51bWJlciBvZiBjb25zdHJhaW50cyBjb250YWluZWQgaW4gdGhpcyBpbnN0YW5jZQotICAgICAqCi0gICAgICogQHJldHVybiBOdW1iZXIgb2YgY29uc3RyYWludHMKLSAgICAgKi8KLSAgICBpbnQgZ2V0Q291bnQodm9pZCkgY29uc3Q7Ci0KLSAgICAvKioKLSAgICAgKiBBZGRzIGNvbnN0cmFpbnQgaW5mb3JtYXRpb24gYXMgPGtleSwgdmFsdWU+IHBhaXIgdG8gdGhpcyBpbnN0YW5jZQotICAgICAqCi0gICAgICogQHBhcmFtW2luXSBrZXkgS2V5IHRvIGFkZAotICAgICAqIEBwYXJhbVtpbl0gdmFsdWUgVmFsdWUgdG8gYWRkCi0gICAgICogQHJldHVybiBSZXR1cm5zIERSTV9OT19FUlJPUiBmb3Igc3VjY2VzcywgRFJNX0VSUk9SX1VOS05PV04gZm9yIGZhaWx1cmUKLSAgICAgKi8KLSAgICBzdGF0dXNfdCBwdXQoY29uc3QgU3RyaW5nOCoga2V5LCBjb25zdCBjaGFyKiB2YWx1ZSk7Ci0KLSAgICAvKioKLSAgICAgKiBSZXRyaWV2ZXMgdGhlIHZhbHVlIG9mIGdpdmVuIGtleQotICAgICAqCi0gICAgICogQHBhcmFtIGtleSBLZXkgd2hvc2UgdmFsdWUgdG8gYmUgcmV0cmlldmVkCi0gICAgICogQHJldHVybiBUaGUgdmFsdWUKLSAgICAgKi8KLSAgICBTdHJpbmc4IGdldChjb25zdCBTdHJpbmc4JiBrZXkpIGNvbnN0OwotCi0gICAgIC8qKg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bmVyKTsKLQotICAgIC8qKgotICAgICAqIEdldCBjb25zdHJhaW50IGluZm9ybWF0aW9uIGFzc29jaWF0ZWQgd2l0aCBpbnB1dCBjb250ZW50Ci0gICAgICoKLSAgICAgKiBAcGFyYW1baW5dIHBhdGggUGF0aCBvZiB0aGUgcHJvdGVjdGVkIGNvbnRlbnQKLSAgICAgKiBAcGFyYW1baW5dIGFjdGlvbiBBY3Rpb25zIGRlZmluZWQgc3VjaCBhcywKLSAgICAgKiAgICAgICAgICAgICBBY3Rpb246OkRFRkFVTFQsIEFjdGlvbjo6UExBWSwgZXRjCi0gICAgICogQHJldHVybiBEcm1Db25zdHJhaW50cwotICAgICAqICAgICBrZXktdmFsdWUgcGFpcnMgb2YgY29uc3RyYWludCBhcmUgZW1iZWRkZWQgaW4gaXQKLSAgICAgKiBAbm90ZQotICAgICAqICAgICBJbiBjYXNlIG9mIGVycm9yLCByZXR1cm4gTlVMTAotICAgICAqLwotICAgIERybUNvbnN0cmFpbnRzKiBnZXRDb25zdHJhaW50cyhjb25zdCBTdHJpbmc4KiBwYXRoLCBjb25zdCBpbnQgYWN0aW9uKTsKLQotICAgIC8qKgotICAgICAqIEdldCBtZXRhZGF0YSBpbmZvcm1hdGlvbiBhc3NvY2lhdGVkIHdpdGggaW5wdXQgY29udGVudAotICAgICAqCi0gICAgICogQHBhcmFtW2luXSBwYXRoIFBhdGggb2YgdGhlIHByb3RlY3RlZCBjb250ZW50Ci0gICAgICogQHJldHVybiBEcm1NZXRhZGF0YQotICAgICAqICAgICAgICAga2V5LXZhbHVlIHBhaXJzIG9mIG1ldGFkYXRhCi0gICAgICogQG5vdGUKLSAgICAgKiAgICAgSW4gY2FzZSBvZiBlcnJvciwgcmV0dXJuIE5VTEwKLSAgICAgKi8KLSAgICBEcm1NZXRhZGF0YSogZ2V0TWV0YWRhdGEoY29uc3QgU3RyaW5nOCogcGF0aCk7Ci0KLSAgICAvKioKLSAgICAgKiBDaGVjayB3aGV0aGVyIHRoZSBnaX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dXRpbHMvU3RyaW5nOC5oPgotI2luY2x1ZGUgPHV0aWxzL0Vycm9ycy5oPgotCi0jZGVmaW5lIElOVkFMSURfVkFMVUUgLTEKLQotbmFtZXNwYWNlIGFuZHJvaWQgewotCi0vKioKLSAqIEVycm9yIGNvZGUgZm9yIERSTSBGcmFtZW93cmsKLSAqLwotZW51bSB7Ci0gICAgLy8gVGhlIGZvbGxvd2luZyBjb25zdGFudCB2YWx1ZXMgc2hvdWxkIGJlIGluIHN5bmMgd2l0aAotICAgIC8vIG1lZGlhL3N0YWdlZnJpZ2h0L01lZGlhRXJyb3JzLmgKLSAgICBFUlJPUl9CQVNFID0gLTIwMDAsCi0KLSAgICBEUk1fRVJST1JfVU5LTk9XTiAgICAgICAgICAgICAgICAgICAgICAgPSBFUlJPUl9CQVNFLAotICAgIERSTV9FUlJPUl9OT19MSUNFTlNFICAgICAgICAgICAgICAgICAgICA9IEVSUk9SX0JBU0UgLSAxLAotICAgIERSTV9FUlJPUl9MSUNFTlNFX0VYUElSRUQgICAgICAgICAgICAgICA9IEVSUk9SX0JBU0UgLSAyLAotICAgIERSTV9FUlJPUl9TRVNTSU9OX05PVF9PUEVORUQgICAgICAgICAgICA9IEVSUk9SX0JBU0UgLSAzLAotICAgIERSTV9FUlJPUl9ERUNSWVBUX1VOSVRfTk9UX0lOSVRJQUxJWkVEICA9IEVSUk9SX0JBU0UgLSA0LAotICAgIERSTV9FUlJPUl9ERUNSWVBUICAgICAgICAgICAgICAgICAgICAgICA9IEVSUk9SX0JBU0UgLSA1LAotICAgIERSTV9FUlJPUl9DQU5OT1RfSEFORExFICAgICAgICAgICAgICAgICA9IEVSUk9SX0JBU0UgLSA2LAotICAgIERSTV9FUlJPUl9UQU1QRVJfREVURUNURUQgICAgICAgICAgICAgICA9IEVSUk9SX0JBU0UgLSA3LAotICAgIERSTV9FUlJPUl9OT19QRVJNSVNTSU9OICAgICAgICAgICAgICAgICA9IEVSUk9SX0JBU0UgLSA4LAotCi0gICAgRFJ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Y29uZmlndXJhdGlvbikgOgotICAgICAgICBvdXRwdXRUeXBlKF9vdXRwdXRUeXBlKSwKLSAgICAgICAgY29uZmlndXJhdGlvbihfY29uZmlndXJhdGlvbikgewotICAgIH0KLQotcHVibGljOgotICAgIGludCBvdXRwdXRUeXBlOyAgIC8qIEJMVUVUT09USCAsIEhETUkqLwotICAgIGludCBjb25maWd1cmF0aW9uOyAvKiBSRVNPTFVUSU9OXzcyMF80ODAgLCBSRUNPUkRBQkxFIGV0Yy4qLwotfTsKLQotLyoqCi0gKiBEZWZpbmVzIGNvbnN0YW50cyByZWxhdGVkIHRvIERSTSB0eXBlcwotICovCi1jbGFzcyBEcm1PYmplY3RUeXBlIHsKLXByaXZhdGU6Ci0gICAgRHJtT2JqZWN0VHlwZSgpOwotCi1wdWJsaWM6Ci0gICAgLyoqCi0gICAgICogRmllbGQgc3BlY2lmaWVzIHRoZSB1bmtub3duIHR5cGUKLSAgICAgKi8KLSAgICBzdGF0aWMgY29uc3QgaW50IFVOS05PV04gPSAweDAwOwotICAgIC8qKgotICAgICAqIEZpZWxkIHNwZWNpZmllcyB0aGUgcHJvdGVjdGVkIGNvbnRlbnQgdHlwZQotICAgICAqLwotICAgIHN0YXRpYyBjb25zdCBpbnQgQ09OVEVOVCA9IDB4MDE7Ci0gICAgLyoqCi0gICAgICogRmllbGQgc3BlY2lmaWVzIHRoZSByaWdodHMgaW5mb3JtYXRpb24KLSAgICAgKi8KLSAgICBzdGF0aWMgY29uc3QgaW50IFJJR0hUU19PQkpFQ1QgPSAweDAyOwotICAgIC8qKgotICAgICAqIEZpZWxkIHNwZWNpZmllcyB0aGUgdHJpZ2dlciBpbmZvcm1hdGlvbgotICAgICAqLwotICAgIHN0YXRpYyBjb25zdCBpbnQgVFJJR0dFUl9PQkpFQ1QgPSAweDAzOwotfTsKLQotLyoqCi0gKiBEZWZpbmVzIGNvbnN0YW50cyByZWxhdGVkIHRvIHBsYXkgYmFjawotICovCi1jbGFzcyBQbGF5YmFjayB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0b3JzOiBhZGRyZXNzIHdoZXJlIHRoZSBlZmZlY3QgZGVzY3JpcHRvcnMgc2hvdWxkIGJlIHJldHVybmVkLgotICAgICAqICAgICAgY291bnQ6IGFzIGlucHV0LCB0aGUgbWF4aW11bSBudW1iZXIgb2YgZGVzY3JpcHRvciB0aGFuIHNob3VsZCBiZSByZXR1cm5lZAotICAgICAqICAgICAgICAgICAgIGFzIG91dHB1dCwgdGhlIG51bWJlciBvZiBkZXNjcmlwdG9yIHJldHVybmVkIGlmIHN0YXR1cyBpcyBOT19FUlJPUiBvciB0aGUgYWN0dWFsCi0gICAgICogICAgICAgICAgICAgbnVtYmVyIG9mIGVuYWJsZWQgcHJlIHByb2Nlc3NpbmdzIGlmIHN0YXR1cyBpcyBOT19NRU1PUlkKLSAgICAgKgotICAgICAqIFJldHVybmVkIHN0YXR1cyAoZnJvbSB1dGlscy9FcnJvcnMuaCkgY2FuIGJlOgotICAgICAqICAgICAgTk9fRVJST1IgICAgICAgIHN1Y2Nlc3NmdWwgb3BlcmF0aW9uLgotICAgICAqICAgICAgTk9fTUVNT1JZICAgICAgIHRoZSBudW1iZXIgb2YgZGVzY3JpcHRvciB0byByZXR1cm4gaXMgbW9yZSB0aGFuIHRoZSBtYXhpbXVtIG51bWJlcgotICAgICAqICAgICAgICAgICAgICAgICAgICAgIGluZGljYXRlZCBieSBjb3VudC4KLSAgICAgKiAgICAgIFBFUk1JU1NJT05fREVOSUVEIGNvdWxkIG5vdCBnZXQgQXVkaW9GbGluZ2VyIGludGVyZmFjZQotICAgICAqICAgICAgTk9fSU5JVCAgICAgICAgIGVmZmVjdCBsaWJyYXJ5IGZhaWxlZCB0byBpbml0aWFsaXplCi0gICAgICogICAgICBCQURfVkFMVUUgICAgICAgaW52YWxpZCBhdWRpbyBzZXNzaW9uIG9yIGRlc2NyaXB0b3IgcG9pbnRlcnMKLSAgICAgKgotICAgICAqIFJldHVybmVkIHZhbHVlCi0gICAgICogICAqZGVzY3JpcHRvciB1cGRhdGVkIHdpdGggZGVzY3JpcHRvcnMgb2YgcHJlIHByb2Nlc3NpbmdzIGVuYWJsZWQgYnkgZGVmYXVsdAotICAgICAqICAgKmNvdW50ICAgICAgbnVtYmVyIG9mIGRlc2NyaXB0b3JzIHJldHVybmVkIGlmIHJldHVybmVkIHN0YXR1cyBpcyBOX0VSUk9SLgotICAgICAqICAgICAgICAgICAgICAgdG90YWwgbnVtYmVyIG9mIHByZSBwcm9jZXNzaW5nIGVuYWJsZWQgYnkgZGVmYXVsdCBpZiByZXR1cm5lZCBzdGF0dXMgaXMKLSAgICAgKiAgICAgICAgICAgICAgIE5PX01FTU9SWS4gVGhpcyBoYXBwZW5zIGlmIHRoZSBjb3VudCBwYXNzZWQgYXMgaW5wdXQgaXMgbGVzcyB0aGFuIHRoZSBudW1iZXIKLSAgICAgKiAgICAgICAgICAgICAgIG9mIGRlc2NyaXB0b3JzIHRvIHJldHVybgotICAgICAqLwotICAgIHN0YXRpYyBzdGF0dXNfdCBxdWVyeURlZmF1bHRQcmVQcm9jZXNzaW5nKGludCBhdWRpb1Nlc3Npb24sCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZWZmZWN0X2Rlc2NyaXB0b3JfdCAqZGVzY3JpcHRvcnMsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdWludDMyX3QgKmNvdW50KTsKLQotICAgIC8qCi0gICAgICogRXZlbnRzIHVzZWQgYnkgY2FsbGJhY2sgZnVuY3Rpb24gKGVmZmVjdF9jYWxsYmFja190KS4KLSAgICAgKi8KLSAgICBlbnVtIGV2ZW50X3R5cGUgewotICAgICAgICBFVkVOVF9DT05UUk9MX1NUQVRVU19DSEFOR0VEID0gMCwKLSAgICAgICAgRVZFTlRfRU5BQkxFX1NUQVRVU19DSEFOR0VEID0gMSwKLSAgICAgICAgRVZFTlRfUEFSQU1FVEVSX0NIQU5HRUQgPSAyLAotICAgICAgICBFVkVOVF9FUl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hdHVzX3QgICAgc2V0KGNvbnN0IGVmZmVjdF91dWlkX3QgKnR5cGUsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgY29uc3QgZWZmZWN0X3V1aWRfdCAqdXVpZCA9IE5VTEwsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgaW50MzJfdCBwcmlvcml0eSA9IDAsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgZWZmZWN0X2NhbGxiYWNrX3QgY2JmID0gTlVMTCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICB2b2lkKiB1c2VyID0gTlVMTCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBpbnQgc2Vzc2lvbklkID0gMCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBhdWRpb19pb19oYW5kbGVfdCBpbyA9IDAKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICApOwotCi0gICAgLyogUmVzdWx0IG9mIGNvbnN0cnVjdGluZyB0aGUgQXVkaW9FZmZlY3QuIFRoaXMgbXVzdCBiZSBjaGVja2VkCi0gICAgICogYmVmb3JlIHVzaW5nIGFueSBBdWRpb0VmZmVjdCBBUEkuCi0gICAgICogaW5pdENoZWNrKCkgY2FuIHJldHVybjoKLSAgICAgKiAgLSBOT19FUlJPUjogICAgdGhlIGVmZmVjdCBlbmdpbmUgaXMgc3VjY2Vzc2Z1bGx5IGNyZWF0ZWQgYW5kIHRoZSBhcHBsaWNhdGlvbiBoYXMgY29udHJvbC4KLSAgICAgKiAgLSBBTFJFQURZX0VYSVNUUzogdGhlIGVmZmVjdCBlbmdpbmUgaXMgc3VjY2Vzc2Z1bGx5IGNyZWF0ZWQgYnV0IHRoZSBhcHBsaWNhdGlvbiBkb2VzIG5vdAotICAgICAqICAgICAgICAgICAgICBoYXZlIGNvbnRyb2wuCi0gICAgICogIC0gTk9fSU5JVDogICAgIHRoZSBlZmZlY3QgY3JlYXRpb24gZmFpbGVkLgotICAgICAqCi0gICAgICovCi0gICAgICAgICAgICB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gICAgICovCi0KLSAgICAgLyogQ29udmVydHMgdGhlIHN0cmluZyBwYXNzZWQgYXMgZmlyc3QgYXJndW1lbnQgdG8gdGhlIGVmZmVjdF91dWlkX3QKLSAgICAgICogcG9pbnRlZCB0byBieSBzZWNvbmQgYXJndW1lbnQKLSAgICAgICovCi0gICAgIHN0YXRpYyBzdGF0dXNfdCBzdHJpbmdUb0d1aWQoY29uc3QgY2hhciAqc3RyLCBlZmZlY3RfdXVpZF90ICpndWlkKTsKLSAgICAgLyogQ29udmVydHMgdGhlIGVmZmVjdF91dWlkX3QgcG9pbnRlZCB0byBieSBmaXJzdCBhcmd1bWVudCB0byB0aGUKLSAgICAgICogc3RyaW5nIHBhc3NlZCBhcyBzZWNvbmQgYXJndW1lbnQKLSAgICAgICovCi0gICAgIHN0YXRpYyBzdGF0dXNfdCBndWlkVG9TdHJpbmcoY29uc3QgZWZmZWN0X3V1aWRfdCAqZ3VpZCwgY2hhciAqc3RyLCBzaXplX3QgbWF4TGVuKTsKLQotcHJvdGVjdGVkOgotICAgICBib29sICAgICAgICAgICAgICAgICAgICBtRW5hYmxlZDsgICAgICAgICAgIC8vIGVuYWJsZSBzdGF0ZQotICAgICBpbnQzMl90ICAgICAgICAgICAgICAgICBtU2Vzc2lvbklkOyAgICAgICAgIC8vIGF1ZGlvIHNlc3Npb24gSUQKLSAgICAgaW50MzJfdCAgICAgICAgICAgICAgICAgbVByaW9yaXR5OyAgICAgICAgICAvLyBwcmlvcml0eSBmb3IgZWZmZWN0IGNvbnRyb2wKLSAgICAgc3RhdHVzX3QgICAgICAgICAgICAgICAgbVN0YXR1czsgICAgICAgICAgICAvLyBlZmZlY3Qgc3RhdHVzCi0gICAgIGVmZmVjdF9jYWxsYmFja190ICAgICAgIG1DYmY7ICAgICAgICAgICAgICAgLy8gY2FsbGJhY2sgZnVuY3Rpb24gZm9yIHN0YXR1cywgY29udHJvbCBhbmQKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg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KGJvb2wgZW5hYmxlZCkgewotICAgICAgICAgICAgbUVmZmVjdC0+ZW5hYmxlU3RhdHVzQ2hhbmdlZChlbmFibGVkKTsKLSAgICAgICAgfQotICAgICAgICB2aXJ0dWFsIHZvaWQgY29tbWFuZEV4ZWN1dGVkKHVpbnQzMl90IGNtZENvZGUsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdWludDMyX3QgY21kU2l6ZSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2b2lkICpwQ21kRGF0YSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB1aW50MzJfdCByZXBseVNpemUsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdm9pZCAqcFJlcGx5RGF0YSkgewotICAgICAgICAgICAgbUVmZmVjdC0+Y29tbWFuZEV4ZWN1dGVkKGNtZENvZGUsIGNtZFNpemUsIHBDbWREYXRhLCByZXBseVNpemUsIHBSZXBseURhdGEpOwotICAgICAgICB9Ci0KLSAgICAgICAgLy8gSUJpbmRlcjo6RGVhdGhSZWNpcGllbnQKLSAgICAgICAgdmlydHVhbCB2b2lkIGJpbmRlckRpZWQoY29uc3Qgd3A8SUJpbmRlcj4mIHdobykge21FZmZlY3QtPmJpbmRlckRpZWQoKTt9Ci0KLSAgICBwcml2YXRlOgotICAgICAgICBBdWRpb0VmZmVjdCAqbUVmZmVjdDsKLSAgICB9OwotCi0KLSAgICBmcmllbmQgY2xhc3MgRWZmZWN0Q2xpZW50OwotCi0gICAgLy8gSUVmZmVjdENsaWVudAotICAgIHZvaWQgY29udHJvbFN0YXR1c0NoYW5nZWQoYm9vbCBjb250cm9sR3JhbnRlZCk7Ci0gICAgdm9pZCBlbmFibGVTdGF0dXNDaGFuZ2VkKGJvb2wgZW5hYmxlZCk7Ci0gICAgdm9pZCBjb21tYW5kRXhlY3V0ZWQodWludDMyX3QgY21kQ29kZSwKLSAgICAgICAgICAgICAgICAgICAgIC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0aWxzL0Vycm9ycy5oKSBjYW4gYmU6Ci0gICAgICogIC0gTk9fRVJST1I6IHN1Y2Nlc3NmdWwgb3BlcmF0aW9uCi0gICAgICogIC0gTk9fSU5JVDogYXVkaW8gc2VydmVyIG9yIGF1ZGlvIGhhcmR3YXJlIG5vdCBpbml0aWFsaXplZAotICAgICAqICAtIEJBRF9WQUxVRTogdW5zdXBwb3J0ZWQgY29uZmlndXJhdGlvbgotICAgICAqLwotCi0gICAgIHN0YXRpYyBzdGF0dXNfdCBnZXRNaW5GcmFtZUNvdW50KGludCogZnJhbWVDb3VudCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdWludDMyX3Qgc2FtcGxlUmF0ZSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYXVkaW9fZm9ybWF0X3QgZm9ybWF0LAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpbnQgY2hhbm5lbENvdW50KTsKLQotICAgIC8qIENvbnN0cnVjdHMgYW4gdW5pbml0aWFsaXplZCBBdWRpb1JlY29yZC4gTm8gY29ubmVjdGlvbiB3aXRoCi0gICAgICogQXVkaW9GbGluZ2VyIHRha2VzIHBsYWNlLgotICAgICAqLwotICAgICAgICAgICAgICAgICAgICAgICAgQXVkaW9SZWNvcmQoKTsKLQotICAgIC8qIENyZWF0ZXMgYW4gQXVkaW9SZWNvcmQgdHJhY2sgYW5kIHJlZ2lzdGVycyBpdCB3aXRoIEF1ZGlvRmxpbmdlci4KLSAgICAgKiBPbmNlIGNyZWF0ZWQsIHRoZSB0cmFjayBuZWVkcyB0byBiZSBzdGFydGVkIGJlZm9yZSBpdCBjYW4gYmUgdXNlZC4KLSAgICAgKiBVbnNwZWNpZmllZCB2YWx1ZXMgYXJlIHNldCB0byB0aGUgYXVkaW8gaGFyZHdhcmUncyBjdXJyZW50Ci0gICAgICogdmFsdWVzLgotICAgICAqCi0gICAgICogUGFyYW1ldGVyczoKLSAgICAgK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m90aWZpY2F0aW9uRnJhbWVzIFBDTQotICAgICAqICAgICAgICAgICAgICAgICAgICAgZnJhbWVzIGFyZSByZWFkeSBpbiByZWNvcmQgdHJhY2sgb3V0cHV0IGJ1ZmZlci4KLSAgICAgKiB1c2VyICAgICAgICAgICAgICAgIENvbnRleHQgZm9yIHVzZSBieSB0aGUgY2FsbGJhY2sgcmVjZWl2ZXIuCi0gICAgICovCi0KLSAgICAgLy8gRklYTUUgY29uc2lkZXIgcmVtb3ZpbmcgdGhpcyBhbGlhcyBhbmQgcmVwbGFjaW5nIGl0IGJ5IGF1ZGlvX2luX2Fjb3VzdGljc190Ci0gICAgIC8vICAgICAgIG9yIHJlbW92aW5nIHRoZSBwYXJhbWV0ZXIgZW50aXJlbHkgaWYgaXQgaXMgdW51c2VkCi0gICAgIGVudW0gcmVjb3JkX2ZsYWdzIHsKLSAgICAgICAgIFJFQ09SRF9BR0NfRU5BQkxFID0gQVVESU9fSU5fQUNPVVNUSUNTX0FHQ19FTkFCTEUsCi0gICAgICAgICBSRUNPUkRfTlNfRU5BQkxFICA9IEFVRElPX0lOX0FDT1VTVElDU19OU19FTkFCTEUsCi0gICAgICAgICBSRUNPUkRfSUlSX0VOQUJMRSA9IEFVRElPX0lOX0FDT1VTVElDU19UWF9JSVJfRU5BQkxFLAotICAgICB9OwotCi0gICAgICAgICAgICAgICAgICAgICAgICBBdWRpb1JlY29yZChhdWRpb19zb3VyY2VfdCBpbnB1dFNvdXJjZSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHVpbnQzMl90IHNhbXBsZVJhdGUgPSAwLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYXVkaW9fZm9ybWF0X3QgZm9ybWF0ID0gQVVESU9fRk9STUFUX0RFRkFVTFQsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB1aW50MzJfdCBjaGFubmVsTWFzayA9IEFVRElPX0NIQU5ORUxfSU5fTU9OTywKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGludCBmcmFtZUNvdW50ICAgICAgPSAwLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmVjb3JkX2ZsYWdzIGZsYWdzICA9IChyZWNvcmRfZmxhZ3MpIDAsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjYWxsYmFja190IGNiZiA9IE5VTEwsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2b2lkKiB1c2VyID0gTlVMTCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGludCBub3RpZmljYXRpb25GcmFtZXMgPSAwLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaW50IHNlc3Npb25JZCA9IDApOwotCi0KLSAgICAvKiBUZXJtaW5hdGVzIHRoZSBBdWRpb1JlY29yZCBhbmQgdW5yZWdpc3RlcnMgaXQgZnJvbSBBdWRpb0ZsaW5nZXIuCi0gICAgICogQWxzbyBkZXN0cm95cyBhbGwgcmVzb3VyY2VzIGFzc290aWF0ZWQgd2l0aCB0aGUgQXVkaW9SZWNvcmQuCi0gICAgICovCi0gICAgICAgICAgICAgICAgICAgICAgICB+QXVkaW9SZWNvcmQoKTsKLQotCi0gICAgLyogSW5pdGlhbGl6ZSBhbiB1bmluaXRpYWxpemVkIEF1ZGlvUmVjb3JkLgotICAgICAqIFJldHVybmVkIHN0YXR1cyAoZnJvbSB1dGlscy9FcnJvcnMuaCkgY2FuIGJlOgotICAgICAqICAtIE5PX0VSUk9SOiBzdWNjZXNzZnVsIGludGlhbGl6YXRpb24KLSAgICAgKiAgLSBJTlZBTElEX09QRVJBVElPTjogQXVkaW9SZWNvcmQgaXMgYWxyZWFkeSBpbnRpdGlhbGl6ZWQgb3IgcmVjb3JkIGRldmljZSBpcyBhbHJlYWR5IGluIHVzZQotICAgICAqICAtIEJBRF9WQUxVRTogaW52YWxpZCBwYXJhbWV0ZXIgKGNoYW5uZWxzLCBmb3JtYXQsIHNhbXBsZVJhdGUuLi4pCi0gICAgICogIC0gTk9fSU5JVDogYXVkaW8gc2VydmVyIG9yIGF1ZGlvIGhhcmR3YXJlIG5vdCBpbml0aWFsaXplZAotICAgICAqICAtIFBFUk1JU1NJT05fREVOSUVEOiByZWNvcmRpbmcgaXMgbm90IGFsbG93ZWQgZm9yIHRoZSByZXF1ZXN0aW5nIHByb2Nlc3MKLSAgICAgKiAqLwotICAgICAgICAgICAgc3RhdHVzX3QgICAgc2V0KGF1ZGlvX3NvdXJjZV90IGlucHV0U291cmNlID0gQVVESU9fU09VUkNFX0RFRkFVTFQsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgdWludDMyX3Qgc2FtcGxlUmF0ZSA9IDAsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgYXVkaW9fZm9ybWF0X3QgZm9ybWF0ID0gQVVESU9fRk9STUFUX0RFRkFVTFQsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgdWludDMyX3QgY2hhbm5lbE1hc2sgPSBBVURJT19DSEFOTkVMX0lOX01PTk8sCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgaW50IGZyYW1lQ291bnQgICAgICA9IDAsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgcmVjb3JkX2ZsYWdzIGZsYWdzICA9IChyZWNvcmRfZmxhZ3MpIDAsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgY2FsbGJhY2tfdCBjYmYgPSBOVUxMLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZvaWQqIHVzZXIgPSBOVUxMLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgIGludCBub3RpZmljYXRpb25GcmFtZXMgPSAwLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJvb2wgdGhyZWFkQ2FuQ2FsbEphdmEgPSBmYWxzZSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBpbnQgc2Vzc2lvbklkID0gMCk7Ci0KLQotICAg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dmVyLCBib29sIGJDYW5DYWxsSmF2YSA9IGZhbHNlKTsKLSAgICBwcml2YXRlOgotICAgICAgICBmcmllbmQgY2xhc3MgQXVkaW9SZWNvcmQ7Ci0gICAgICAgIHZpcnR1YWwgYm9vbCAgICAgICAgdGhyZWFkTG9vcCgpOwotICAgICAgICB2aXJ0dWFsIHN0YXR1c190ICAgIHJlYWR5VG9SdW4oKTsKLSAgICAgICAgdmlydHVhbCB2b2lkICAgICAgICBvbkZpcnN0UmVmKCkge30KLSAgICAgICAgQXVkaW9SZWNvcmQmIG1SZWNlaXZlcjsKLSAgICB9OwotCi0gICAgICAgICAgICBib29sIHByb2Nlc3NBdWRpb0J1ZmZlcihjb25zdCBzcDxDbGllbnRSZWNvcmRUaHJlYWQ+JiB0aHJlYWQpOwotICAgICAgICAgICAgc3RhdHVzX3Qgb3BlblJlY29yZF9sKHVpbnQzMl90IHNhbXBsZVJhdGUsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGF1ZGlvX2Zvcm1hdF90IGZvcm1hdCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdWludDMyX3QgY2hhbm5lbE1hc2ssCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGludCBmcmFtZUNvdW50LAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBhdWRpb19pb19oYW5kbGVfdCBpbnB1dCk7Ci0gICAgICAgICAgICBhdWRpb19pb19oYW5kbGVfdCBnZXRJbnB1dF9sKCk7Ci0gICAgICAgICAgICBzdGF0dXNfdCByZXN0b3JlUmVjb3JkX2woYXVkaW9fdHJhY2tfY2Jsa190KiYgY2Jsayk7Ci0KLSAgICBzcDxJQXVkaW9SZWNvcmQ+ICAgICAgICBtQXVkaW9SZWNvcmQ7Ci0gICAgc3A8SU1lbW9yeT4gICAgICAgICAgICAgbUNibGtNZW1vcnk7Ci0gICAgc3A8Q2xpZW50UmVjb3JkVGhyZWFkPiAgbUNsaWVudFJlY29yZFRocmVhZDsKLSAgICBzdGF0dXNfdCAgICAgICAgICAgICAgICBtUmVhZHlUb1J1bjsKLSAgICBtdXRhYmxlIE11dGV4ICAgICAgICAgICBtTG9jazsKLSAgICBDb25kaXRpb24gICAgICAgICAgICAgICBtQ29uZGl0aW9uOwotCi0gICAgdWludDMyX3QgICAgICAgICAgICAgICAgbUZyYW1lQ291bnQ7Ci0KLSAgICBhdWRpb190cmFja19jYmxrX3QqICAgICBtQ2JsazsKLSAgICBhdWRpb19mb3JtYXRfdCAgICAgICAgICBtRm9ybWF0OwotICAgIHVpbnQ4X3QgICAgICAgICAgICAgICAgIG1DaGFubmVsQ291bnQ7Ci0gICAgYXVkaW9fc291cmNlX3QgICAgICAgICAgbUlucHV0U291cmNlOwotICAgIHN0YXR1c190ICAgICAgICAgICAgICAgIG1TdGF0dXM7Ci0gICAgdWludDMyX3QgICAgICAgICAgICAgICAgbUxhdGVuY3k7Ci0KLSAgICB2b2xhdGlsZSBpbnQzMl90ICAgICAgICBtQWN0aXZlOwotCi0gICAgY2FsbGJhY2tfdCAgICAgICAgICAgICAgbUNiZjsKLSAgICB2b2lkKiAgICAgICAgICAgICAgICAgICBtVXNlckRhdGE7Ci0gICAgdWludDMyX3QgICAgICAgICAgICAgICAgbU5vdGlmaWNhdGlvbkZyYW1lczsKLSAgICB1aW50MzJfdCAgICAgICAgICAgICAgICBtUmVtYWluaW5nRnJhbWVzOwotICAgIHVpbnQzMl90ICAgICAgICAgICAgICAgIG1NYXJrZXJQb3NpdGlvbjsKLSAgICBib29sICAgICAgICAgICAgICAgICAgICBtTWFya2VyUmVhY2hlZDsKLSAgICB1aW50MzJfdCAgICAgICAgICAgICAgICBtTmV3UG9zaXRpb247Ci0gICAgdWludDMyX3QgICAgICAgICAgICAgICAgbVVwZGF0ZVBlcmlvZDsKLSAgICByZWNvcmRfZmxhZ3MgICAgICAgICAgICBtRmxhZ3M7Ci0gICAgdWludDMyX3QgICAgICAgICAgICAgICAgbUNoYW5uZWxNYXNr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gICAgIGF1ZGlvX3N0cmVhbV90eXBlX3Qgc3RyZWFtLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpbnQgc2Vzc2lvbiA9IDApOwotICAgIHN0YXRpYyBzdGF0dXNfdCBzdG9wT3V0cHV0KGF1ZGlvX2lvX2hhbmRsZV90IG91dHB1dCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBhdWRpb19zdHJlYW1fdHlwZV90IHN0cmVhbSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpbnQgc2Vzc2lvbiA9IDApOwotICAgIHN0YXRpYyB2b2lkIHJlbGVhc2VPdXRwdXQoYXVkaW9faW9faGFuZGxlX3Qgb3V0cHV0KTsKLSAgICBzdGF0aWMgYXVkaW9faW9faGFuZGxlX3QgZ2V0SW5wdXQoYXVkaW9fc291cmNlX3QgaW5wdXRTb3VyY2UsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB1aW50MzJfdCBzYW1wbGluZ1JhdGUgPSAwLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYXVkaW9fZm9ybWF0X3QgZm9ybWF0ID0gQVVESU9fRk9STUFUX0RFRkFVTFQsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB1aW50MzJfdCBjaGFubmVscyA9IEFVRElPX0NIQU5ORUxfSU5fTU9OTywKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGF1ZGlvX2luX2Fjb3VzdGljc190IGFjb3VzdGljcyA9IChhdWRpb19pbl9hY291c3RpY3NfdCkwLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaW50IHNlc3Npb25JZCA9IDApOwotICAgIHN0YXRpYyBzdGF0dXNfdCBzdGFydElucHV0KGF1ZGlvX2lvX2hhbmRsZV90IGlucHV0KTsKLSAgICBzdGF0aWMgc3RhdHVzX3Qgc3RvcElucHV0KGF1ZGlvX2lvX2hhbmRsZV90IGlucHV0KTsKLSAgICBzdGF0aWMgdm9pZCByZWxlYXNlSW5wdXQoYXVkaW9faW9faGFuZGxlX3QgaW5wdXQpOwotICAgIHN0YXRpYyBzdGF0dXNfdCBpbml0U3RyZWFtVm9sdW1lKGF1ZGlvX3N0cmVhbV90eXBlX3Qgc3RyZWFtLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpbnQgaW5kZXhNaW4sCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGludCBpbmRleE1heCk7Ci0gICAgc3RhdGljIHN0YXR1c190IHNldFN0cmVhbVZvbHVtZUluZGV4KGF1ZGlvX3N0cmVhbV90eXBlX3Qgc3RyZWFtLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpbnQgaW5kZXgsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGF1ZGlvX2RldmljZXNfdCBkZXZpY2UpOwotICAgIHN0YXRpYyBzdGF0dXNfdCBnZXRTdHJlYW1Wb2x1bWVJbmRleChhdWRpb19zdHJlYW1fdHlwZV90IHN0cmVhbSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaW50ICppbmRleCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYXVkaW9fZGV2aWNlc190IGRldmljZSk7Ci0KLSAgICBzdGF0aWMgdWludDMyX3QgZ2V0U3RyYXRlZ3lGb3JTdHJlYW0oYXVkaW9fc3RyZWFtX3R5cGVfdCBzdHJlYW0pOwotICAgIHN0YXRpYyBhdWRpb19kZXZpY2VzX3QgZ2V0RGV2aWNlc0ZvclN0cmVhbShhdWRpb19zdHJlYW1fdHlwZV90IHN0cmVhbSk7Ci0KLSAgICBzdGF0aWMgYXVkaW9faW9faGFuZGxlX3QgZ2V0T3V0cHV0Rm9yRWZmZWN0KGVmZmVjdF9kZXNjcmlwdG9yX3QgKmRlc2MpOwotICAgIHN0YXRpY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rX3QgZm9yIEVWRU5UX01PUkVfREFUQS4KLSAgICAgKi8KLQotICAgIGNsYXNzIEJ1ZmZlcgotICAgIHsKLSAgICBwdWJsaWM6Ci0gICAgICAgIGVudW0gewotICAgICAgICAgICAgTVVURSAgICA9IDB4MDAwMDAwMDEKLSAgICAgICAgfTsKLSAgICAgICAgdWludDMyX3QgICAgZmxhZ3M7ICAgICAgICAvLyAwIG9yIE1VVEUKLSAgICAgICAgYXVkaW9fZm9ybWF0X3QgZm9ybWF0OyAvLyBidXQgQVVESU9fRk9STUFUX1BDTV84X0JJVCAtPiBBVURJT19GT1JNQVRfUENNXzE2X0JJVAotICAgICAgICAvLyBhY2Nlc3NlZCBkaXJlY3RseSBieSBXZWJLaXQgQU5QIGNhbGxiYWNrCi0gICAgICAgIGludCAgICAgICAgIGNoYW5uZWxDb3VudDsgLy8gd2lsbCBiZSByZW1vdmVkIGluIHRoZSBmdXR1cmUsIGRvIG5vdCB1c2UKLQotICAgICAgICBzaXplX3QgICAgICBmcmFtZUNvdW50OyAgIC8vIG51bWJlciBvZiBzYW1wbGUgZnJhbWVzIGNvcnJlc3BvbmRpbmcgdG8gc2l6ZTsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyBvbiBpbnB1dCBpdCBpcyB0aGUgbnVtYmVyIG9mIGZyYW1lcyBkZXNpcmVkLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vIG9uIG91dHB1dCBpcyB0aGUgbnVtYmVyIG9mIGZyYW1lcyBhY3R1YWxseSBmaWxsZWQKLQotICAgICAgICBzaXplX3QgICAgICBzaXplOyAgICAgICAgIC8vIGlucHV0L291dHB1dCBpbiBieXRlIHVuaXRzCi0gICAgICAgIHVuaW9uIHsKLSAgICAgICAgICAgIHZvaWQqICAgICAgIHJhdzsKLSAgICAgICAgICAgIHNob3J0KiAgICAgIGkxNjsgICAgLy8gc2lnbmVkIDE2LWJpdAotICAgICAgICAgICAgaW50OF90KiAgICAgaTg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ICAgICAgICBDaGFubmVsIG1hc2s6IHNlZSBhdWRpb19jaGFubmVsc190LgotICAgICAqIGZyYW1lQ291bnQ6ICAgICAgICAgTWluaW11bSBzaXplIG9mIHRyYWNrIFBDTSBidWZmZXIgaW4gZnJhbWVzLiBUaGlzIGRlZmluZXMgdGhlCi0gICAgICogICAgICAgICAgICAgICAgICAgICBsYXRlbmN5IG9mIHRoZSB0cmFjay4gVGhlIGFjdHVhbCBzaXplIHNlbGVjdGVkIGJ5IHRoZSBBdWRpb1RyYWNrIGNvdWxkIGJlCi0gICAgICogICAgICAgICAgICAgICAgICAgICBsYXJnZXIgaWYgdGhlIHJlcXVlc3RlZCBzaXplIGlzIG5vdCBjb21wYXRpYmxlIHdpdGggY3VycmVudCBhdWRpbyBIQUwKLSAgICAgKiAgICAgICAgICAgICAgICAgICAgIGxhdGVuY3kuCi0gICAgICogZmxhZ3M6ICAgICAgICAgICAgICBSZXNlcnZlZCBmb3IgZnV0dXJlIHVzZS4KLSAgICAgKiBjYmY6ICAgICAgICAgICAgICAgIENhbGxiYWNrIGZ1bmN0aW9uLiBJZiBub3QgbnVsbCwgdGhpcyBmdW5jdGlvbiBpcyBjYWxsZWQgcGVyaW9kaWNhbGx5Ci0gICAgICogICAgICAgICAgICAgICAgICAgICB0byByZXF1ZXN0IG5ldyBQQ00gZGF0YS4KLSAgICAgKiB1c2VyOiAgICAgICAgICAgICAgIENvbnRleHQgZm9yIHVzZSBieSB0aGUgY2FsbGJhY2sgcmVjZWl2ZXIuCi0gICAgICogbm90aWZpY2F0aW9uRnJhbWVzOiBUaGUgY2FsbGJhY2sgZnVuY3Rpb24gaXMgY2FsbGVkIGVhY2ggdGltZSBub3RpZmljYXRpb25GcmFtZXMgUENNCi0gICAgICogICAgICAgICAgICAgICAgICAgICBmcmFtZXMgaGF2ZSBiZWVuIGNvbnN1bWVkIGZyb20gdHJhY2sgaW5wdXQgYnVmZmVyLgotICAgICAqIHNlc3Npb25JZDogICAgICAgICAgU3BlY2lmaWMgc2Vzc2lvbiBJRCwgb3IgemVybyB0byB1c2UgZGVmYXVsdC4KLSAgICAgKi8KLQotICAgICAgICAgICAgICAgICAgICAgICAgQXVkaW9UcmFjayggYXVkaW9fc3RyZWFtX3R5cGVfdCBzdHJlYW1UeXBlLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdWludDMyX3Qgc2FtcGxlUmF0ZSAgPSAwLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYXVkaW9fZm9ybWF0X3QgZm9ybWF0ID0gQVVESU9fRk9STUFUX0RFRkFVTFQsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpbnQgY2hhbm5lbE1hc2sgICAgICA9IDAsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpbnQgZnJhbWVDb3VudCAgICAgICA9IDAsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBhdWRpb19wb2xpY3lfb3V0cHV0X2ZsYWdzX3QgZmxhZ3MgPSBBVURJT19QT0xJQ1lfT1VUUFVUX0ZMQUdfTk9ORSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNhbGxiYWNrX3QgY2JmICAgICAgID0gTlVMTCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZvaWQqIHVzZXIgICAgICAgICAgID0gTlVMTCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGludCBub3RpZmljYXRpb25GcmFtZXMgPSAwLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaW50IHNlc3Npb25JZCA9IDApOwotCi0gICAgICAgICAgICAgICAgICAgICAgICAvLyBERVBSRUNBVEVECi0gICAgICAgICAgICAgICAgICAgICAgICBleHBsaWNpdCBBdWRpb1RyYWNrKCBpbnQgc3RyZWFtVHlwZSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHVpbnQzMl90IHNhbXBsZVJhdGUgID0gMCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGludCBmb3JtYXQgPSBBVURJT19GT1JNQVRfREVGQVVMVCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGludCBjaGFubmVsTWFzayAgICAgID0gMCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGludCBmcmFtZUNvdW50ICAgICAgID0gMCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHVpbnQzMl90IGZsYWdzICAgICAgID0gKHVpbnQzMl90KSBBVURJT19QT0xJQ1lfT1VUUFVUX0ZMQUdfTk9ORSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNhbGxiYWNrX3QgY2JmICAgICAgID0gMCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZvaWQqIHVzZXIgICAgICAgICAgID0gMCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGludCBub3RpZmljYXRpb25GcmFtZXMgPSAwLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaW50IHNlc3Npb25JZCAgICAgICAgPSAwKTsKLQotICAgIC8qIENyZWF0ZXMgYW4gYXVkaW8gdHJhY2sgYW5kIHJlZ2lzdGVycyBpdCB3aXRoIEF1ZGlvRmxpbmdlci4gV2l0aCB0aGlzIGNvbnN0cnVjdG9yLAotICAgICAqIHRoZSBQQ00gZGF0YSB0byBiZSByZW5kZXJlZCBieSBBdWRpb1RyYWNrIGlzIHBhc3NlZCBpbiBhIHNoYXJlZCBtZW1vcnkgYnVmZmVyCi0gICAgICogaWRlbnRpZmllZCBieSB0aGUgYXJndW1lbnQgc2hhcmVkQnVmZmVyLiBUaGlzIHByb3RvdHlwZSBpcyBmb3Igc3RhdGljIGJ1ZmZlciBwbGF5YmFjay4KLSAgICAgKiBQQ00gZGF0YSBtdXN0IGJlIHByZXNlbnQgaW4gbWVtb3J5IGJlZm9yZSB0aGUgQXVkaW9UcmFjayBpcyBzdGFydGVkLgotICAgICAqIFRoZSB3cml0ZSgpIGFuZCBmbHVzaCgpIG1ldGhvZHMgYXJlIG5vdCBzdXBwb3J0ZWQgaW4gdGhpcyBjYXNlLgotICAgICAqIEl0IGlzIHJlY29tbWVuZGVkIHRvIHBhc3MgYSBjYWxsYmFjayBmdW5jdGlvbiB0byBiZSBub3RpZmllZCBvZiBwbGF5YmFjayBlbmQgYnkgYW4KLSAgICAgKiBFVkVOVF9VTkRFUlJVTiBldmVudC4KLSAgICAgKi8KLQotICAgICAgICAgICAgICAgICAgICAgICAgQXVkaW9UcmFjayggYXVkaW9fc3RyZWFtX3R5cGVfdCBzdHJlYW1UeXBlLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdWludDMyX3Qgc2FtcGxlUmF0ZSA9IDAsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBhdWRpb19mb3JtYXRfdCBmb3JtYXQgPSBBVURJT19GT1JNQVRfREVGQVVMVCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGludCBjaGFubmVsTWFzayAgICAgPSAwLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY29uc3Qgc3A8SU1lbW9yeT4mIHNoYXJlZEJ1ZmZlciA9IDAsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBhdWRpb19wb2xpY3lfb3V0cHV0X2ZsYWdzX3QgZmxhZ3MgPSBBVURJT19QT0xJQ1lfT1VUUFVUX0ZMQUdfTk9ORSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNhbGxiYWNrX3QgY2JmICAgICAgPSBOVUxMLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdm9pZCogdXNlciAgICAgICAgICA9IE5VTEwsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpbnQ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X0ZPUk1BVF9ERUZBVUxULAotICAgICAgICAgICAgICAgICAgICAgICAgICAgIGludCBjaGFubmVsTWFzayAgICAgPSAwLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgIGludCBmcmFtZUNvdW50ICAgICAgPSAwLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgIGF1ZGlvX3BvbGljeV9vdXRwdXRfZmxhZ3NfdCBmbGFncyA9IEFVRElPX1BPTElDWV9PVVRQVVRfRkxBR19OT05FLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNhbGxiYWNrX3QgY2JmICAgICAgPSBOVUxMLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZvaWQqIHVzZXIgICAgICAgICAgPSBOVUxMLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgIGludCBub3RpZmljYXRpb25GcmFtZXMgPSAwLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbnN0IHNwPElNZW1vcnk+JiBzaGFyZWRCdWZmZXIgPSAwLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJvb2wgdGhyZWFkQ2FuQ2FsbEphdmEgPSBmYWxzZSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBpbnQgc2Vzc2lvbklkICAgICAgID0gMCk7Ci0KLQotICAgIC8qIFJlc3VsdCBvZiBjb25zdHJ1Y3RpbmcgdGhlIEF1ZGlvVHJhY2suIFRoaXMgbXVzdCBiZSBjaGVja2VkCi0gICAgICogYmVmb3JlIHVzaW5nIGFueSBBdWRpb1RyYWNrIEFQSSAoZXhjZXB0IGZvciBzZXQoKSksIGJlY2F1c2UgdXNpbmcKLSAgICAgKiBhbiB1bmluaXRpYWxpemVkIEF1ZGlvVHJhY2sgcHJvZHVjZXMgdW5kZWZpbmVkIHJlc3VsdHMuCi0gICAgICogU2VlIHNldCgpIG1ldGhvZCBhYm92ZSBmb3IgcG9zc2libGUgcmV0dXJuIGNvZGVzLgotICAgICAqLwotICAgICAgICAgICAgc3RhdHVzX3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ZWFkeVRvUnVuKCk7Ci0gICAgICAgIHZpcnR1YWwgdm9pZCAgICAgICAgb25GaXJzdFJlZigpOwotICAgICAgICBBdWRpb1RyYWNrJiBtUmVjZWl2ZXI7Ci0gICAgfTsKLQotICAgICAgICAgICAgLy8gYm9keSBvZiBBdWRpb1RyYWNrVGhyZWFkOjp0aHJlYWRMb29wKCkKLSAgICAgICAgICAgIGJvb2wgcHJvY2Vzc0F1ZGlvQnVmZmVyKGNvbnN0IHNwPEF1ZGlvVHJhY2tUaHJlYWQ+JiB0aHJlYWQpOwotCi0gICAgICAgICAgICBzdGF0dXNfdCBjcmVhdGVUcmFja19sKGF1ZGlvX3N0cmVhbV90eXBlX3Qgc3RyZWFtVHlwZSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHVpbnQzMl90IHNhbXBsZVJhdGUsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBhdWRpb19mb3JtYXRfdCBmb3JtYXQsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB1aW50MzJfdCBjaGFubmVsTWFzaywKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGludCBmcmFtZUNvdW50LAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYXVkaW9fcG9saWN5X291dHB1dF9mbGFnc190IGZsYWdzLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY29uc3Qgc3A8SU1lbW9yeT4mIHNoYXJlZEJ1ZmZlciwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGF1ZGlvX2lvX2hhbmRsZV90IG91dHB1dCk7Ci0gICAgICAgICAgICB2b2lkIGZsdXNoX2woKTsKLSAgICAgICAgICAgIHN0YXR1c190IHNldExvb3BfbCh1aW50MzJfdCBsb29wU3RhcnQsIHVpbnQzMl90IGxvb3BFbmQsIGludCBsb29wQ291bnQpOwotICAgICAgICAgICAgYXVkaW9faW9faGFuZGxlX3QgZ2V0T3V0cHV0X2woKTsKLSAgICAgICAgICAgIHN0YXR1c190IHJlc3RvcmVUcmFja19sKGF1ZGlvX3RyYWNrX2NibGtfdComIGNibGssIGJvb2wgZnJvbVN0YXJ0KTsKLSAgICAgICAgICAgIGJvb2wgc3RvcHBlZF9sKCkgY29uc3QgeyByZXR1cm4gIW1BY3RpdmU7IH0KLQotICAgIHNwPElBdWRpb1RyYWNrPiAgICAgICAgIG1BdWRpb1RyYWNrOwotICAgIHNwPElNZW1vcnk+ICAgICAgICAgICAgIG1DYmxrTWVtb3J5OwotICAgIHNwPEF1ZGlvVHJhY2tUaHJlYWQ+ICAgIG1BdWRpb1RyYWNrVGhyZWFkOwotCi0gICAgZmxvYXQgICAgICAgICAgICAgICAgICAgbVZvbHVtZVsyXTsKLSAgICBmbG9hdCAgICAgICAgICAgICAgICAgICBtU2VuZExldmVsOwotICAgIHVpbnQzMl90ICAgICAgICAgICAgICAgIG1GcmFtZUNvdW50OwotCi0gICAgYXVkaW9fdHJhY2tfY2Jsa190KiAgICAgbUNibGs7Ci0gICAgYXVkaW9fZm9ybWF0X3QgICAgICAgICAgbUZvcm1hdDsKLSAgICBhdWRpb19zdHJlYW1fdHlwZV90ICAgICBtU3RyZWFtVHlwZTsKLSAgICB1aW50OF90ICAgICAgICAgICAgICAgICBtQ2hhbm5lbENvdW50OwotICAgIHVpbnQ4X3QgICAgICAgICAgICAgICAgIG1NdXRlZDsKLSAgICB1aW50OF90ICAgICAgICAgICAgICAgICBtUmVzZXJ2ZWQ7Ci0gICAgdWludDMyX3QgICAgICAgICAgICAgICAgbUNoYW5uZWxNYXNrOwotICAgIHN0YXR1c190ICAgICAgICAgICAgICAgIG1TdGF0dXM7Ci0gICAgdWludDMyX3QgICAgICAgICAgICAgICAgbUxhdGVuY3k7Ci0KLSAgICBib29sICAgICAgICAgICAgICAgICAgICBtQWN0aXZlOyAgICAgICAgICAgICAgICAvLyBwcm90ZWN0ZWQgYnkgbUxvY2sKLQotICAgIGNhbGxiYWNrX3QgICAgICAgICAgICAgIG1DYmY7ICAgICAgICAgICAgICAgICAgIC8vIGNhbGxiYWNrIGhhbmRsZXIgZm9yIGV2ZW50cywgb3IgTlVMTAotICAgIHZvaWQqICAgICAgICAgICAgICAgICAgIG1Vc2VyRGF0YTsKLSAgICB1aW50MzJfdCAgICAgICAgICAgICAgICBtTm90aWZpY2F0aW9uRnJhbWVzUmVxOyAvLyByZXF1ZXN0ZWQgbnVtYmVyIG9mIGZyYW1lcyBiZXR3ZWVuIGVhY2ggbm90aWZpY2F0aW9uIGNhbGxiYWNrCi0gICAgdWludDMyX3QgICAgICAgICAgICAgICAgbU5vdGlmaWNhdGlvbkZyYW1lc0FjdDsgLy8gYWN0dWFsIG51bWJlciBvZiBmcmFtZXMgYmV0d2VlbiBlYWNoIG5vdGlmaWNhdGlvbiBjYWxsYmFjawotICAgIHNwPElNZW1vcnk+ICAgICAgICAgICAgIG1TaGFyZWRCdWZmZXI7Ci0gICAgaW50ICAgICAgICAgICAgICAgICAgICAgbUxvb3BDb3VudDsKLSAgICB1aW50MzJfdCAgICAgICAgICAgICAgICBtUmVtYWluaW5nRnJhbWVzOwotICAgIHVpbnQzMl90ICAgICAgICAgICAgICAgIG1NYXJrZXJQb3NpdGlvbjsKLSAgICBib29sICAgICAgICAgICAgICAgICAgICBtTWFya2VyUmVhY2hlZDsKLSAgICB1aW50MzJfdCAgICAgICAgICAgICAgICBtTmV3UG9zaXRpb247Ci0gICAgdWludDMyX3QgICAgICAgICAgICAgICAgbVVwZGF0ZVBlcmlvZDsKLSAgICBib29sICAgICAgICAgICAgICAgICAgICBtRmx1c2hlZDsgLy8gRklYTUUgd2lsbCBiZSBtYWRlIG9ic29sZXRlIGJ5IG1ha2luZyBmbHVzaCgpIHN5bmNocm9ub3VzCi0gICAgYXVkaW9fcG9saWN5X291dHB1dF9mbGFnc190IG1GbGFnczsKLSAgICBpbnQgICAgICAgICAgICAgICAgICAgICBtU2Vzc2lvbklkOwotICAgIGludCAgICAgICAgICAgICAg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AgICAgICAgICAgICAgIGF1ZGlvX3N0cmVhbV90eXBlX3Qgc3RyZWFtVHlwZSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdWludDMyX3Qgc2FtcGxlUmF0ZSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYXVkaW9fZm9ybWF0X3QgZm9ybWF0LAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB1aW50MzJfdCBjaGFubmVsTWFzaywKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaW50IGZyYW1lQ291bnQsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRyYWNrX2ZsYWdzX3QgZmxhZ3MsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbnN0IHNwPElNZW1vcnk+JiBzaGFyZWRCdWZmZXIsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGF1ZGlvX2lvX2hhbmRsZV90IG91dHB1dCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaW50ICpzZXNzaW9uSWQsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHN0YXR1c190ICpzdGF0dXMpID0gMDsKLQotICAgIHZpcnR1YWwgc3A8SUF1ZGlvUmVjb3JkPiBvcGVuUmVjb3JkKAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwaWRfdCBwaWQsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGF1ZGlvX2lvX2hhbmRsZV90IGlucHV0LAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB1aW50MzJfdCBzYW1wbGVSYXRlLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBhdWRpb19mb3JtYXRfdCBmb3JtYXQsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHVpbnQzMl90IGNoYW5uZWxNYXNrLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpbnQgZnJhbWVDb3V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QzMl90ICpwRGV2aWNlcywKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHVpbnQzMl90ICpwU2FtcGxpbmdSYXRlLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYXVkaW9fZm9ybWF0X3QgKnBGb3JtYXQsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB1aW50MzJfdCAqcENoYW5uZWxzLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdWludDMyX3QgKnBMYXRlbmN5TXMsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBhdWRpb19wb2xpY3lfb3V0cHV0X2ZsYWdzX3QgZmxhZ3MpID0gMDsKLSAgICB2aXJ0dWFsIGF1ZGlvX2lvX2hhbmRsZV90IG9wZW5EdXBsaWNhdGVPdXRwdXQoYXVkaW9faW9faGFuZGxlX3Qgb3V0cHV0MSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGF1ZGlvX2lvX2hhbmRsZV90IG91dHB1dDIpID0gMDsKLSAgICB2aXJ0dWFsIHN0YXR1c190IGNsb3NlT3V0cHV0KGF1ZGlvX2lvX2hhbmRsZV90IG91dHB1dCkgPSAwOwotICAgIHZpcnR1YWwgc3RhdHVzX3Qgc3VzcGVuZE91dHB1dChhdWRpb19pb19oYW5kbGVfdCBvdXRwdXQpID0gMDsKLSAgICB2aXJ0dWFsIHN0YXR1c190IHJlc3RvcmVPdXRwdXQoYXVkaW9faW9faGFuZGxlX3Qgb3V0cHV0KSA9IDA7Ci0KLSAgICB2aXJ0dWFsIGF1ZGlvX2lvX2hhbmRsZV90IG9wZW5JbnB1dCh1aW50MzJfdCAqcERldmljZXMsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB1aW50MzJfdCAqcFNhbXBsaW5nUmF0ZSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGF1ZGlvX2Zvcm1hdF90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VmZmVjdHMpIGNvbnN0ID0gMDsKLQotICAgIHZpcnR1YWwgc3RhdHVzX3QgcXVlcnlFZmZlY3QodWludDMyX3QgaW5kZXgsIGVmZmVjdF9kZXNjcmlwdG9yX3QgKnBEZXNjcmlwdG9yKSBjb25zdCA9IDA7Ci0KLSAgICB2aXJ0dWFsIHN0YXR1c190IGdldEVmZmVjdERlc2NyaXB0b3IoY29uc3QgZWZmZWN0X3V1aWRfdCAqcEVmZmVjdFVVSUQsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZWZmZWN0X2Rlc2NyaXB0b3JfdCAqcERlc2NyaXB0b3IpIGNvbnN0ID0gMDsKLQotICAgIHZpcnR1YWwgc3A8SUVmZmVjdD4gY3JlYXRlRWZmZWN0KHBpZF90IHBpZCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGVmZmVjdF9kZXNjcmlwdG9yX3QgKnBEZXNjLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY29uc3Qgc3A8SUVmZmVjdENsaWVudD4mIGNsaWVudCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGludDMyX3QgcHJpb3JpdHksCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBhdWRpb19pb19oYW5kbGVfdCBvdXRwdXQsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpbnQgc2Vzc2lvbklkLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc3RhdHVzX3QgKnN0YXR1cywKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGludCAqaWQsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpbnQgKmVuYWJsZWQpID0gMDsKLQotICAgIHZpcnR1YWwgc3RhdHVzX3QgbW92ZUVmZmVjdHMoaW50IHNlc3Npb24sIGF1ZGlvX2lvX2hhbmRsZV90IHNyY091dHB1dCwKL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AgICB2aXJ0dWFsIHN0YXR1c190IHNldERldmljZUNvbm5lY3Rpb25TdGF0ZShhdWRpb19kZXZpY2VzX3QgZGV2aWNlLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGF1ZGlvX3BvbGljeV9kZXZfc3RhdGVfdCBzdGF0ZSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb25zdCBjaGFyICpkZXZpY2VfYWRkcmVzcykgPSAwOwotICAgIHZpcnR1YWwgYXVkaW9fcG9saWN5X2Rldl9zdGF0ZV90IGdldERldmljZUNvbm5lY3Rpb25TdGF0ZShhdWRpb19kZXZpY2VzX3QgZGV2aWNlLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb25zdCBjaGFyICpkZXZpY2VfYWRkcmVzcykgPSAwOwotICAgIHZpcnR1YWwgc3RhdHVzX3Qgc2V0UGhvbmVTdGF0ZShhdWRpb19tb2RlX3Qgc3RhdGUpID0gMDsKLSAgICB2aXJ0dWFsIHN0YXR1c190IHNldEZvcmNlVXNlKGF1ZGlvX3BvbGljeV9mb3JjZV91c2VfdCB1c2FnZSwgYXVkaW9fcG9saWN5X2ZvcmNlZF9jZmdfdCBjb25maWcpID0gMDsKLSAgICB2aXJ0dWFsIGF1ZGlvX3BvbGljeV9mb3JjZWRfY2ZnX3QgZ2V0Rm9yY2VVc2UoYXVkaW9fcG9saWN5X2ZvcmNlX3VzZV90IHVzYWdlKSA9IDA7Ci0gICAgdmlydHVhbCBhdWRpb19pb19oYW5kbGVfdCBnZXRPdXRwdXQoYXVkaW9fc3RyZWFtX3R5cGVfdCBzdHJlYW0sCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdWludDMyX3Qgc2FtcGxpbmdSYXRlID0gMCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBhdWRpb19mb3JtYXRfdCBmb3JtYXQgPSBBVURJT19GT1JNQVRfREVGQVVMVCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB1aW50MzJfdCBjaGFubmVscyA9IDAsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYXVkaW9fcG9saWN5X291dHB1dF9mbGFnc190IGZsYWdzID0gQVVESU9fUE9MSUNZX09VVFBVVF9GTEFHX05PTkUpID0gMDsKLSAgICB2aXJ0dWFsIHN0YXR1c190IHN0YXJ0T3V0cHV0KGF1ZGlvX2lvX2hhbmRsZV90IG91dHB1dCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGF1ZGlvX3N0cmVhbV90eXBlX3Qgc3RyZWFtLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaW50IHNlc3Npb24gPSAwKSA9IDA7Ci0gICAgdmlydHVhbCBzdGF0dXNfdCBzdG9wT3V0cHV0KGF1ZGlvX2lvX2hhbmRsZV90IG91dHB1dCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYXVkaW9fc3RyZWFtX3R5cGVfdCBzdHJlYW0sCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGludCBzZXNzaW9uID0gMCkgPSAwOwotICAgIHZpcnR1YWwgdm9pZCByZWxlYXNlT3V0cHV0KGF1ZGlvX2lvX2hhbmRsZV90IG91dHB1dCkgPSAwOwotICAgIHZpcnR1YWwgYXVkaW9faW9faGFuZGxlX3QgZ2V0SW5wdXQoYXVkaW9fc291cmNlX3QgaW5wdXRTb3VyY2UsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB1aW50MzJfdCBzYW1wbGluZ1JhdGUgPSAwLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYXVkaW9fZm9ybWF0X3QgZm9ybWF0ID0gQVVESU9fRk9STUFUX0RFRkFVTFQsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB1aW50MzJfdCBjaGFubmVscyA9IDAsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBhdWRpb19pbl9hY291c3RpY3NfdCBhY291c3RpY3MgPSAoYXVkaW9faW5fYWNvdXN0aWNzX3QpMCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGludCBhdWRpb1Nlc3Npb24gPSAwKSA9IDA7Ci0gICAgdmlydHVhbCBzdGF0dXNfdCBzdGFydElucHV0KGF1ZGlvX2lvX2hhbmRsZV90IGlucHV0KSA9IDA7Ci0gICAgdmlydHVhbCBzdGF0dXNfdCBzdG9wSW5wdXQoYXVkaW9faW9faGFuZGxlX3QgaW5wdXQpID0gMDsKLSAgICB2aXJ0dWFsIHZvaWQgcmVsZWFzZUlucHV0KGF1ZGlvX2lvX2hhbmRsZV90IGlucHV0KSA9IDA7Ci0gICAgdmlydHVhbCBzdGF0dXNfdCBpbml0U3RyZWFtVm9sdW1lKGF1ZGlvX3N0cmVhbV90eXBlX3Qgc3RyZWFtLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpbnQgaW5kZXhNaW4sCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGludCBpbmRleE1heCkgPSAwOwotICAgIHZpcnR1YWwgc3RhdHVzX3Qgc2V0U3RyZWFtVm9sdW1lSW5kZXgoYXVkaW9fc3RyZWFtX3R5cGVfdCBzdHJlYW0sCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpbnQgaW5kZXgsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBhdWRpb19kZXZpY2VzX3QgZGV2aWNlKSA9IDA7Ci0gICAgdmlydHVhbCBzdGF0dXNfdCBnZXRTdHJlYW1Wb2x1bWVJbmRleChhdWRpb19zdHJlYW1fdHlwZV90IHN0cmVhbSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGludCAqaW5kZXgsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBhdWRpb19kZXZpY2VzX3QgZGV2aWNlKSA9IDA7Ci0gICAgdmlydHVhbCB1aW50MzJfdCBnZXRTdHJhdGVneUZvclN0cmVhbShhdWRpb19zdHJlYW1fdHlwZV90IHN0cmVhbSkgPSAwOwotICAgIHZpcnR1YWwgYXVkaW9fZGV2aWNlc190IGdldERldmljZXNGb3JTdHJlYW0oYXVkaW9fc3RyZWFtX3R5cGVfdCBzdHJlYW0pID0gMDsKLSAgICB2aXJ0dWFsIGF1ZGlvX2lvX2hhbmRsZV90IGdldE91dHB1dEZvckVmZmVjdChlZmZlY3RfZGVzY3JpcHRvcl90ICpkZXNjKSA9IDA7Ci0gICAgdmlydHVhbCBzdGF0dXNfdCByZWdpc3RlckVmZmVjdChlZmZlY3RfZGVzY3JpcHRvcl90ICpkZXNjLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYXVkaW9faW9faGFuZGxlX3QgaW8sCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB1aW50MzJfdCBzdHJhdGVneSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGludCBzZXNzaW9uLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaW50IGlkKSA9IDA7Ci0gICAgdmlydHVhbCBzdGF0dXNfdCB1bnJlZ2lzdGVyRWZmZWN0KGludCBpZCkgPSAwOwotICAgIHZpcnR1YWwgc3RhdHVzX3Qgc2V0RWZmZWN0RW5hYmxlZChpbnQgaWQsIGJvb2wgZW5hYmxlZCkgPSAwOwotICAgIHZpcnR1YWwgYm9vbCAgICAgaXNTdHJlYW1BY3RpdmUoYXVkaW9fc3RyZWFtX3R5cGVfdCBzdHJlYW0sIHVpbnQzMl90IGluUGFzdE1zID0gMCkgY29uc3QgPSAwOwotICAgIHZpcnR1YWwgc3RhdH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HN0YXR1c190IGRpc2FibGUoKSA9IDA7Ci0KLSAgICB2aXJ0dWFsIHN0YXR1c190IGNvbW1hbmQodWludDMyX3QgY21kQ29kZSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdWludDMyX3QgY21kU2l6ZSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdm9pZCAqcENtZERhdGEsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgIHVpbnQzMl90ICpwUmVwbHlTaXplLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2b2lkICpwUmVwbHlEYXRhKSA9IDA7Ci0KLSAgICB2aXJ0dWFsIHZvaWQgZGlzY29ubmVjdCgpID0gMDsKLQotICAgIHZpcnR1YWwgc3A8SU1lbW9yeT4gZ2V0Q2JsaygpIGNvbnN0ID0gMDsKLX07Ci0KLS8vIC0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0KLQotY2xhc3MgQm5FZmZlY3Q6IHB1YmxpYyBCbkludGVyZmFjZTxJRWZmZWN0PgotewotcHVibGljOgotICAgIHZpcnR1YWwgc3RhdHVzX3QgICAgb25UcmFuc2FjdCggdWludDMyX3QgY29kZSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbnN0IFBhcmNlbCYgZGF0YSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFBhcmNlbCogcmVwbHksCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB1aW50MzJfdCBmbGFncyA9IDApOwotfTsKLQotfTsgLy8gbmFtZXNwYWNlIGFuZHJvaWQKLQotI2VuZGlmIC8vIEFORFJPSURfSUVGRkVDVF9ICmRpZmYgLS1naXQgYS9pbmNsdWRlL21lZGlhL0lFZmZlY3RDbGllbnQuaCBiL2luY2x1ZGUvbWVkaWEvSUVmZmVjdENsaWV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pZWQuCi0gICAgLy8gQHBhcmFtW291dF0gbWV0YWRhdGEgT24gZXhpdCBjb250YWlucyBhIHNldCAocG9zc2libHkgZW1wdHkpIG9mIG1ldGFkYXRhLgotICAgIC8vICAgICAgICAgICAgICAgICAgICAgIFZhbGlkIG9ubHkgaWYgdGhlIGNhbGwgcmV0dXJuZWQgT0suCi0gICAgLy8gQHJldHVybiBPSyBpZiB0aGUgaW52b2NhdGlvbiB3YXMgbWFkZSBzdWNjZXNzZnVsbHkuCi0gICAgdmlydHVhbCBzdGF0dXNfdCAgICAgICAgZ2V0TWV0YWRhdGEoYm9vbCB1cGRhdGVfb25seSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBib29sIGFwcGx5X2ZpbHRlciwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBQYXJjZWwgKm1ldGFkYXRhKSA9IDA7Ci19OwotCi0vLyAtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tCi0KLWNsYXNzIEJuTWVkaWFQbGF5ZXI6IHB1YmxpYyBCbkludGVyZmFjZTxJTWVkaWFQbGF5ZXI+Ci17Ci1wdWJsaWM6Ci0gICAgdmlydHVhbCBzdGF0dXNfdCAgICBvblRyYW5zYWN0KCB1aW50MzJfdCBjb2RlLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY29uc3QgUGFyY2VsJiBkYXRhLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgUGFyY2VsKiByZXBseSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHVpbnQzMl90IGZsYWdzID0gMCk7Ci19OwotCi19OyAvLyBuYW1lc3BhY2UgYW5kcm9pZAotCi0jZW5kaWYgLy8gQU5EUk9JRF9JTUVESUFQTEFZRVJfSApkaWZmIC0tZ2l0IGE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AgICBpbnQgbUNhbWVyYUlkOwotICAgICAgICBvdXRwdXRfZm9ybWF0IG1GaWxlRm9ybWF0OwotICAgICAgICBjYW1jb3JkZXJfcXVhbGl0eSBtUXVhbGl0eTsKLSAgICAgICAgaW50IG1EdXJhdGlvbjsKLSAgICAgICAgVmlkZW9Db2RlYyAqbVZpZGVvQ29kZWM7Ci0gICAgICAgIEF1ZGlvQ29kZWMgKm1BdWRpb0NvZGVjOwotICAgIH07Ci0KLSAgICBzdHJ1Y3QgVmlkZW9FbmNvZGVyQ2FwIHsKLSAgICAgICAgLy8gVWdseSBjb25zdHJ1Y3RvcgotICAgICAgICBWaWRlb0VuY29kZXJDYXAodmlkZW9fZW5jb2RlciBjb2RlYywKLSAgICAgICAgICAgICAgICAgICAgICAgIGludCBtaW5CaXRSYXRlLCBpbnQgbWF4Qml0UmF0ZSwKLSAgICAgICAgICAgICAgICAgICAgICAgIGludCBtaW5GcmFtZVdpZHRoLCBpbnQgbWF4RnJhbWVXaWR0aCwKLSAgICAgICAgICAgICAgICAgICAgICAgIGludCBtaW5GcmFtZUhlaWdodCwgaW50IG1heEZyYW1lSGVpZ2h0LAotICAgICAgICAgICAgICAgICAgICAgICAgaW50IG1pbkZyYW1lUmF0ZSwgaW50IG1heEZyYW1lUmF0ZSkKLSAgICAgICAgICAgIDogbUNvZGVjKGNvZGVjKSwKLSAgICAgICAgICAgICAgbU1pbkJpdFJhdGUobWluQml0UmF0ZSksIG1NYXhCaXRSYXRlKG1heEJpdFJhdGUpLAotICAgICAgICAgICAgICBtTWluRnJhbWVXaWR0aChtaW5GcmFtZVdpZHRoKSwgbU1heEZyYW1lV2lkdGgobWF4RnJhbWVXaWR0aCksCi0gICAgICAgICAgICAgIG1NaW5GcmFtZUhlaWdodChtaW5GcmFtZUhlaWdodCksIG1NYXhGcmFtZUhlaWdodChtYXhGcmFtZUhlaWdodCksCi0gICAgICAgICAgICAgIG1NaW5GcmFtZVJhdGUobWluRnJhbWVSYXRlKSwgbU1heE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mlzdWFsaXplcjogcHVibGljIEF1ZGlvRWZmZWN0IHsKLXB1YmxpYzoKLQotICAgIGVudW0gY2FsbGJhY2tfZmxhZ3MgewotICAgICAgICBDQVBUVVJFX1dBVkVGT1JNID0gMHgwMDAwMDAwMSwgIC8vIGNhcHR1cmUgY2FsbGJhY2sgcmV0dXJucyBhIFBDTSB3YXZlIGZvcm0KLSAgICAgICAgQ0FQVFVSRV9GRlQgPSAweDAwMDAwMDAyLCAgICAgICAvLyBhcHR1cmUgY2FsbGJhY2sgcmV0dXJucyBhIGZyZXF1ZW5jeSByZXByZXNlbnRhdGlvbgotICAgICAgICBDQVBUVVJFX0NBTExfSkFWQSA9IDB4MDAwMDAwMDQgIC8vIHRoZSBjYWxsYmFjayB0aHJlYWQgY2FuIGNhbGwgamF2YQotICAgIH07Ci0KLQotICAgIC8qIENvbnN0cnVjdG9yLgotICAgICAqIFNlZSBBdWRpb0VmZmVjdCBjb25zdHJ1Y3RvciBmb3IgZGV0YWlscyBvbiBwYXJhbWV0ZXJzLgotICAgICAqLwotICAgICAgICAgICAgICAgICAgICAgICAgVmlzdWFsaXplcihpbnQzMl90IHByaW9yaXR5ID0gMCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZWZmZWN0X2NhbGxiYWNrX3QgY2JmID0gTlVMTCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdm9pZCogdXNlciA9IE5VTEwsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGludCBzZXNzaW9uSWQgPSAwKTsKLQotICAgICAgICAgICAgICAgICAgICAgICAgflZpc3VhbGl6ZXIoKTsKLQotICAgIHZpcnR1YWwgc3RhdHVzX3QgICAgc2V0RW5hYmxlZChib29sIGVuYWJsZWQpOwotCi0gICAgLy8gbWF4aW11bSBjYXB0dXJlIHNpemUgaW4gc2FtcGxlcwotICAgIHN0YXRpYyB1aW50MzJfdCBnZXRNYXhDYXB0dXJlU2l6ZSgpIHsgc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Q0tfVFlQRV9VTktOT1dOID0gMCwKLSAgICBNRURJQV9UUkFDS19UWVBFX1ZJREVPID0gMSwKLSAgICBNRURJQV9UUkFDS19UWVBFX0FVRElPID0gMiwKLSAgICBNRURJQV9UUkFDS19UWVBFX1RJTUVEVEVYVCA9IDMsCi19OwotCi0vLyAtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tCi0vLyByZWYtY291bnRlZCBvYmplY3QgZm9yIGNhbGxiYWNrcwotY2xhc3MgTWVkaWFQbGF5ZXJMaXN0ZW5lcjogdmlydHVhbCBwdWJsaWMgUmVmQmFzZQotewotcHVibGljOgotICAgIHZpcnR1YWwgdm9pZCBub3RpZnkoaW50IG1zZywgaW50IGV4dDEsIGludCBleHQyLCBjb25zdCBQYXJjZWwgKm9iaikgPSAwOwotfTsKLQotY2xhc3MgTWVkaWFQbGF5ZXIgOiBwdWJsaWMgQm5NZWRpYVBsYXllckNsaWVudCwKLSAgICAgICAgICAgICAgICAgICAgcHVibGljIHZpcnR1YWwgSU1lZGlhRGVhdGhOb3RpZmllcgotewotcHVibGljOgotICAgIE1lZGlhUGxheWVyKCk7Ci0gICAgfk1lZGlhUGxheWVyKCk7Ci0gICAgICAgICAgICB2b2lkICAgICAgICAgICAgZGllZCgpOwotICAgICAgICAgICAgdm9pZCAgICAgICAgICAgIGRpc2Nvbm5lY3QoKTsKLQotICAgICAgICAgICAgc3RhdHVzX3QgICAgICAgIHNldERhdGFTb3VyY2UoCi0gICAgICAgICAgICAgICAgICAgIGNvbnN0IGNoYXIgKnVybCwKLSAgICAgICAgICAgICAgICAgICAgY29uc3QgS2V5ZWRWZWN0b3I8U3RyaW5nOCwgU3RyaW5nOD4gKmhlYWRlcnMpOwotCi0gICAgICAgICAgICBzdGF0dXNfdCAgICAgICAgc2V0RGF0YVNvdXJjZShpbnQgZmQsIGludDY0X3Qgb2Zmc2V0LCBpbnQ2NF90IGxlbmd0aCk7Ci0gICAgICAgICAgICBzdGF0dXNfdCAgICAgICAgc2V0RGF0YVNvdXJjZShjb25zdCBzcDxJU3RyZWFtU291cmNlPiAmc291cmNlKTsKLSAgICAgICAgICAgIHN0YXR1c190ICAgICAgICBzZXRWaWRlb1N1cmZhY2VUZXh0dXJlKAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY29uc3Qgc3A8SVN1cmZhY2VUZXh0dXJlPiYgc3VyZmFjZVRleHR1cmUpOwotICAgICAgICAgICAgc3RhdHVzX3QgICAgICAgIHNldExpc3RlbmVyKGNvbnN0IHNwPE1lZGlhUGxheWVyTGlzdGVuZXI+JiBsaXN0ZW5lcik7Ci0gICAgICAgICAgICBzdGF0dXNfdCAgICAgICAgcHJlcGFyZSgpOwotICAgICAgICAgICAgc3RhdHVzX3QgICAgICAgIHByZXBhcmVBc3luYygpOwotICAgICAgICAgICAgc3RhdHVzX3QgICAgICAgIHN0YXJ0KCk7Ci0gICAgICAgICAgICBzdGF0dXNfdCAgICAgICAgc3RvcCgpOwotICAgICAgICAgICAgc3RhdHVzX3QgICAgICAgIHBhdXNlKCk7Ci0gICAgICAgICAgICBib29sICAgICAgICAgICAgaXNQbGF5aW5nKCk7Ci0gICAgICAgICAgICBzdGF0dXNfdCAgICAgICAgZ2V0VmlkZW9XaWR0aChpbnQgKncpOwotICAgICAgICAgICAgc3RhdHVzX3QgICAgICAgIGdldFZpZGVvSGVpZ2h0KGludCAqaCk7Ci0gICAgICAgICAgICBzdGF0dXNfdCAgICAgICAgc2Vla1RvKGludCBtc2VjKTsKLSAgICAgICAgICAgIHN0YXR1c190ICAgICAgICBnZXRDdXJyZW50UG9zaXRpb24oaW50ICptc2VjKTsKLSAgICAgICAgICAgIHN0YXR1c190ICAgICAgICBnZXREdXJhdGlvbihpbnQgKm1zZWMpOwotICAgICAgICAgICAgc3RhdHVzX3QgICAgICAgIHJlc2V0KCk7Ci0gICAg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lbCAqbWV0YWRhdGEpOwotICAgICAgICAgICAgc3RhdHVzX3QgICAgICAgIHNldEF1ZGlvU2Vzc2lvbklkKGludCBzZXNzaW9uSWQpOwotICAgICAgICAgICAgaW50ICAgICAgICAgICAgIGdldEF1ZGlvU2Vzc2lvbklkKCk7Ci0gICAgICAgICAgICBzdGF0dXNfdCAgICAgICAgc2V0QXV4RWZmZWN0U2VuZExldmVsKGZsb2F0IGxldmVsKTsKLSAgICAgICAgICAgIHN0YXR1c190ICAgICAgICBhdHRhY2hBdXhFZmZlY3QoaW50IGVmZmVjdElkKTsKLSAgICAgICAgICAgIHN0YXR1c190ICAgICAgICBzZXRQYXJhbWV0ZXIoaW50IGtleSwgY29uc3QgUGFyY2VsJiByZXF1ZXN0KTsKLSAgICAgICAgICAgIHN0YXR1c190ICAgICAgICBnZXRQYXJhbWV0ZXIoaW50IGtleSwgUGFyY2VsKiByZXBseSk7Ci0gICAgICAgICAgICBzdGF0dXNfdCAgICAgICAgc2V0UmV0cmFuc21pdEVuZHBvaW50KGNvbnN0IGNoYXIqIGFkZHJTdHJpbmcsIHVpbnQxNl90IHBvcnQpOwotICAgICAgICAgICAgc3RhdHVzX3QgICAgICAgIHNldE5leHRNZWRpYVBsYXllcihjb25zdCBzcDxNZWRpYVBsYXllcj4mIHBsYXllcik7Ci0KLXByaXZhdGU6Ci0gICAgICAgICAgICB2b2lkICAgICAgICAgICAgY2xlYXJfbCgpOwotICAgICAgICAgICAgc3RhdHVzX3QgICAgICAgIHNlZWtUb19sKGludCBtc2VjKTsKLSAgICAgICAgICAgIHN0YXR1c190ICAgICAgICBwcmVwYXJlQXN5bmNfbCgpOwotICAgICAgICAgICAgc3RhdHVzX3QgICAgICAgIGdldER1cmF0aW9uX2woaW50ICptc2VjKTsKLSAgICAgICAgICAgIHN0YXR1c190ICAgICAgICBhdHRhY2hOZXdQbGF5ZXIoY29uc3Qgc3A8SU1lZGlhUGxheWVyPiYgcGxheWVyKTsKLSAgICAgICAgICAgIHN0YXR1c190ICAgICAgICByZXNldF9sKCk7Ci0gICAgICAgICAgICBzdGF0dXNfdCAgICAgICAgZG9TZXRSZXRyYW5zbWl0RW5kcG9pbnQoY29uc3Qgc3A8SU1lZGlhUGxheWVyPiYgcGxheWVyKTsKLQotICAgIHNwPElNZWRpYVBsYXllcj4gICAgICAgICAgICBtUGxheWVyOwotICAgIHRocmVhZF9pZF90ICAgICAgICAgICAgICAgICBtTG9ja1RocmVhZElkOwotICAgIE11dGV4ICAgICAgICAgICAgICAgICAgICAgICBtTG9jazsKLSAgICBNdXRleCAgICAgICAgICAgICAgICAgICAgICAgbU5vdGlmeUxvY2s7Ci0gICAgQ29uZGl0aW9uICAgICAgICAgICAgICAgICAgIG1TaWduYWw7Ci0gICAgc3A8TWVkaWFQbGF5ZXJMaXN0ZW5lcj4gICAgIG1MaXN0ZW5lcjsKLSAgICB2b2lkKiAgICAgICAgICAgICAgICAgICAgICAgbUNvb2tpZTsKLSAgICBtZWRpYV9wbGF5ZXJfc3RhdGVzICAgICAgICAgbUN1cnJlbnRTdGF0ZTsKLSAgICBpbnQgICAgICAgICAgICAgICAgICAgICAgICAgbUR1cmF0aW9uOwotICAgIGludCAgICAgICAgICAgICAgICAgICAgICAgICBtQ3VycmVudFBvc2l0aW9uOwotICAgIGludCAgICAgICAgICAgICAgICAgICAgICAgICBtU2Vla1Bvc2l0aW9uOwotICAgIGJvb2wgICAgICAgICAgICAgICAgICAgICAgICBtUHJlcGFyZVN5bmM7Ci0gICAgc3RhdHVzX3QgICAgICAgICAgICAgICAgICAgIG1QcmVwYXJlU3RhdHVzOwotICAgIGF1ZGlvX3N0cmVhbV90eXBlX3QgICAgICAgICBtU3RyZWFtVHlwZTsKLSAgICBib29sICAgICAgICAgICAgICAgICAgICAgICAgbUxvb3A7Ci0gICAgZmxvYXQgICAgICAgICAgICAgICAgICAgICAgIG1MZWZ0Vm9sdW1lOwotICAgIGZsb2F0ICAgICAgICAgICAgICAgICAgICAgICBtUmlnaHRWb2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gaXMgYWN0dWFsbHkgYmVpbmcgc3RvcmVkIGluIHZpZGVvIGJ1ZmZlcnMKLSAgICAgKiAgICAgICAgICBkdXJpbmcgcmVjb3JkaW5nLCBjYWxsIGlzTWV0YURhdGFTdG9yZWRJblZpZGVvQnVmZmVycygpLgotICAgICAqCi0gICAgICogQHJldHVybiBOVUxMIG9uIGVycm9yLgotICAgICAqLwotICAgIHN0YXRpYyBDYW1lcmFTb3VyY2UgKkNyZWF0ZUZyb21DYW1lcmEoY29uc3Qgc3A8SUNhbWVyYT4gJmNhbWVyYSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbnN0IHNwPElDYW1lcmFSZWNvcmRpbmdQcm94eT4gJnByb3h5LAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaW50MzJfdCBjYW1lcmFJZCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFNpemUgdmlkZW9TaXplLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaW50MzJfdCBmcmFtZVJhdGUsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb25zdCBzcDxTdXJmYWNlPiYgc3VyZmFjZSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJvb2wgc3RvcmVNZXRhRGF0YUluVmlkZW9CdWZmZXJzID0gZmFsc2UpOwotCi0gICAgdmlydHVhbCB+Q2FtZXJhU291cmNlKCk7Ci0KLSAgICB2aXJ0dWFsIHN0YXR1c190IHN0YXJ0KE1ldGFEYXRhICpwYXJhbXMgPSBOVUxMKTsKLSAgICB2aXJ0dWFsIHN0YXR1c190IHN0b3AoKSB7IHJldHVybiByZXNldCgpOyB9Ci0gICAgdmlydHVhbCBzdGF0dXNfdCByZWFkKAotICAgICAgICAgICAgTWVkaWFCdWZmZXIgKipidWZmZXIsIGNvbnN0IFJlYWRPc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Agc3RhdHVzX3QgZ2V0T3V0cHV0Rm9ybWF0KHNwPEFNZXNzYWdlPiAqZm9ybWF0KSBjb25zdDsKLQotICAgIHN0YXR1c190IGdldElucHV0QnVmZmVycyhWZWN0b3I8c3A8QUJ1ZmZlcj4gPiAqYnVmZmVycykgY29uc3Q7Ci0gICAgc3RhdHVzX3QgZ2V0T3V0cHV0QnVmZmVycyhWZWN0b3I8c3A8QUJ1ZmZlcj4gPiAqYnVmZmVycykgY29uc3Q7Ci0KLXByb3RlY3RlZDoKLSAgICB2aXJ0dWFsIH5NZWRpYUNvZGVjKCk7Ci0gICAgdmlydHVhbCB2b2lkIG9uTWVzc2FnZVJlY2VpdmVkKGNvbnN0IHNwPEFNZXNzYWdlPiAmbXNnKTsKLQotcHJpdmF0ZToKLSAgICBlbnVtIFN0YXRlIHsKLSAgICAgICAgVU5JTklUSUFMSVpFRCwKLSAgICAgICAgSU5JVElBTElaSU5HLAotICAgICAgICBJTklUSUFMSVpFRCwKLSAgICAgICAgQ09ORklHVVJJTkcsCi0gICAgICAgIENPTkZJR1VSRUQsCi0gICAgICAgIFNUQVJUSU5HLAotICAgICAgICBTVEFSVEVELAotICAgICAgICBGTFVTSElORywKLSAgICAgICAgU1RPUFBJTkcsCi0gICAgICAgIFJFTEVBU0lORywKLSAgICB9OwotCi0gICAgZW51bSB7Ci0gICAgICAgIGtQb3J0SW5kZXhJbnB1dCAgICAgICAgID0gMCwKLSAgICAgICAga1BvcnRJbmRleE91dHB1dCAgICAgICAgPSAxLAotICAgIH07Ci0KLSAgICBlbnVtIHsKLSAgICAgICAga1doYXRJbml0ICAgICAgICAgICAgICAgICAgICAgICA9ICdpbml0JywKLSAgICAgICAga1doYXRDb25maWd1cmUgICAgICAgICAgICAgICAgICA9ICdjb25mJywKLSAgICAgICAga1doYXRTdGFydCAgICAgICAgICAgICAgICAgICAgICA9ICdzdHJ0JywKLSAgICAgICAga1doYXRTdG9wICAgICAgICAgICAgICAgICAgICAgICA9ICdzdG9wJywKLSAgICAgICAga1doYXRSZWxlYXNlICAgICAgICAgICAgICAgICAgICA9ICdyZWxlJywKLSAgICAgICAga1doYXREZXF1ZXVlSW5wdXRCdWZmZXIgICAgICAgICA9ICdkZXFJJywKLSAgICAgICAga1doYXRRdWV1ZUlucHV0QnVmZmVyICAgICAgICAgICA9ICdxdWVJJywKLSAgICAgICAga1doYXREZXF1ZXVlT3V0cHV0QnVmZmVyICAgICAgICA9ICdkZXFPJywKLSAgICAgICAga1doYXRSZWxlYXNlT3V0cHV0QnVmZmVyICAgICAgICA9ICdyZWxPJywKLSAgICAgICAga1doYXRHZXRCdWZmZXJzICAgICAgICAgICAgICAgICA9ICdnZXRCJywKLSAgICAgICAga1doYXRGbHVzaCAgICAgICAgICAgICAgICAgICAgICA9ICdmbHVzJywKLSAgICAgICAga1doYXRHZXRPdXRwdXRGb3JtYXQgICAgICAgICAgICA9ICdnZXRPJywKLSAgICAgICAga1doYXREZXF1ZXVlSW5wdXRUaW1lZE91dCAgICAgICA9ICdkSVRPJywKLSAgICAgICAga1doYXREZXF1ZXVlT3V0cHV0VGltZWRPdXQgICAgICA9ICdkT1RPJywKLSAgICAgICAga1doYXRDb2RlY05vdGlmeSAgICAgICAgICAgICAgICA9ICdjb2RjJywKLSAgICB9OwotCi0gICAgZW51bSB7Ci0gICAgICAgIGtGbGFnSXNTb2Z0d2FyZUNvZGVjICAgICAgICAgICAgPSAxLAotICAgICAgICBrRmxhZ091dHB1dEZvcm1hdENoYW5nZWQgICAgICAgID0gMiwKLSAgICAgICAga0ZsYWdPdXRwdXRCdWZmZXJzQ2hhbmdlZCAgICAgICA9IDQsCi0gICAgICAgIGtGbGFnU3RpY2t5RXJyb3IgICAgICAgICAgICAgICAgPSA4LAotICAgICAgICBrRmxhZ0RlcXVldWVJbnB1dFBlbmRpbmcgICAgICAgID0gMTYsCi0gICAgICAgIGtGbGFnRGVxdWV1ZU91dHB1dFBlbmRpbmcgICAgICAgPSAzMiwKLSAgICAgICAga0ZsY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IGtLZXlTbGljZUhlaWdodCAgICAgICA9ICdzbGh0JywgIC8vIGludDMyX3QKLSAgICBrS2V5Q2hhbm5lbENvdW50ICAgICAgPSAnI2NobicsICAvLyBpbnQzMl90Ci0gICAga0tleUNoYW5uZWxNYXNrICAgICAgID0gJ2Nobm0nLCAgLy8gaW50MzJfdAotICAgIGtLZXlTYW1wbGVSYXRlICAgICAgICA9ICdzcnRlJywgIC8vIGludDMyX3QgKGF1ZGlvIHNhbXBsaW5nIHJhdGUgSHopCi0gICAga0tleUZyYW1lUmF0ZSAgICAgICAgID0gJ2ZybVInLCAgLy8gaW50MzJfdCAodmlkZW8gZnJhbWUgcmF0ZSBmcHMpCi0gICAga0tleUJpdFJhdGUgICAgICAgICAgID0gJ2JydGUnLCAgLy8gaW50MzJfdCAoYnBzKQotICAgIGtLZXlFU0RTICAgICAgICAgICAgICA9ICdlc2RzJywgIC8vIHJhdyBkYXRhCi0gICAga0tleUFWQ0MgICAgICAgICAgICAgID0gJ2F2Y2MnLCAgLy8gcmF3IGRhdGEKLSAgICBrS2V5RDI2MyAgICAgICAgICAgICAgPSAnZDI2MycsICAvLyByYXcgZGF0YQotICAgIGtLZXlWb3JiaXNJbmZvICAgICAgICA9ICd2aW5mJywgIC8vIHJhdyBkYXRhCi0gICAga0tleVZvcmJpc0Jvb2tzICAgICAgID0gJ3Zib28nLCAgLy8gcmF3IGRhdGEKLSAgICBrS2V5V2FudHNOQUxGcmFnbWVudHMgPSAnTkFMZicsCi0gICAga0tleUlzU3luY0ZyYW1lICAgICAgID0gJ3N5bmMnLCAgLy8gaW50MzJfdCAoYm9vbCkKLSAgICBrS2V5SXNDb2RlY0NvbmZpZyAgICAgPSAnY29uZicsICAvLyBpbnQzMl90IChib29sKQotICAgIGtLZXlUaW1lICAgICAgICAgICAgICA9ICd0aW1lJywgIC8vIGludDY0X3QgKHVzZWNzKQotICAgIGtLZXlEZWNvZGluZ1RpbWUgICAgICA9ICdkZWNUJywgIC8vIGludDY0X3QgKGRlY29kaW5nIHRpbWVzdGFtcCBpbiB1c2VjcykKLSAgICBrS2V5TlRQVGltZSAgICAgICAgICAgPSAnbnRwVCcsICAvLyB1aW50NjRfdCAobnRwLXRpbWVzdGFtcCkKLSAgICBrS2V5VGFyZ2V0VGltZSAgICAgICAgPSAndGFyVCcsICAvLyBpbnQ2NF90ICh1c2VjcykKLSAgICBrS2V5RHJpZnRUaW1lICAgICAgICAgPSAnZGZ0VCcsICAvLyBpbnQ2NF90ICh1c2VjcykKLSAgICBrS2V5QW5jaG9yVGltZSAgICAgICAgPSAnYW5jVCcsICAvLyBpbnQ2NF90ICh1c2VjcykKLSAgICBrS2V5RHVyYXRpb24gICAgICAgICAgPSAnZHVyYScsICAvLyBpbnQ2NF90ICh1c2VjcykKLSAgICBrS2V5Q29sb3JGb3JtYXQgICAgICAgPSAnY29sZicsCi0gICAga0tleVBsYXRmb3JtUHJpdmF0ZSAgID0gJ3ByaXYnLCAgLy8gcG9pbnRlcgotICAgIGtLZXlEZWNvZGVyQ29tcG9uZW50ICA9ICdkZWNDJywgIC8vIGNzdHJpbmcKLSAgICBrS2V5QnVmZmVySUQgICAgICAgICAgPSAnYmZJRCcsCi0gICAga0tleU1heElucHV0U2l6ZSAgICAgID0gJ2lucFMnLAotICAgIGtLZXlUaHVtYm5haWxUaW1lICAgICA9ICd0aGJUJywgIC8vIGludDY0X3QgKHVzZWNzKQotICAgIGtLZXlUcmFja0lEICAgICAgICAgICA9ICd0cklEJywKLSAgICBrS2V5SXNEUk0gICAgICAgICAgICAgPSAnaWRybScsICAvLyBpbnQzMl90IChib29sKQotICAgIGtLZXlFbmNvZGVyRGVsYXkgICAgICA9ICdlbmNkJywgIC8vIGludDMyX3QgKGZyYW1lcykKLSAgICBrS2V5RW5jb2RlclBhZGRpbmcgICAgPSAnZW5jcCcsICAvLyBpbnQzMl90IChmcmFtZXMpCi0KLSAgICBrS2V5QWxidW0gICAgICAgICAgICAgPSAnYWxidScsICAvLyBjc3RyaW5nCi0gICAga0tleUFydGlzdCAgICAgICAgICAgID0gJ2FydGknLCAgLy8gY3N0cmluZwotICAgIGtLZXlBbGJ1bUFydGlzdCAgICAgICA9ICdhYXJ0JywgIC8vIGNzdHJpbmcKLSAgICBrS2V5Q29tcG9zZXIgICAgICAgICAgPSAnY29tcCcsICAvLyBjc3RyaW5nCi0gICAga0tleUdlbnJlICAgICAgICAgICAgID0gJ2dlbnInLCAgLy8gY3N0cmluZwotICAgIGtLZXlUaXRsZSAgICAgICAgICAgICA9ICd0aXRsJywgIC8vIGNzdHJpbmcKLSAgICBrS2V5WWVhciAgICAgICAgICAgICAgPSAneWVhcicsICAvLyBjc3RyaW5nCi0gICAga0tleUFsYnVtQXJ0ICAgICAgICAgID0gJ2FsYkEnLCAgLy8gY29tcHJlc3NlZCBpbWFnZSBkYXRhCi0gICAga0tleUFsYnVtQXJ0TUlNRSAgICAgID0gJ2FsQU0nLCAgLy8gY3N0cmluZwotICAgIGtLZXlBdXRob3IgICAgICAgICAgICA9ICdhdXRoJywgIC8vIGNzdHJpbmcKLSAgICBrS2V5Q0RUcmFja051bWJlciAgICAgPSAnY2R0cicsICAvLyBjc3RyaW5nCi0gICAga0tleURpc2NOdW1iZXIgICAgICAgID0gJ2RudW0nLCAgLy8gY3N0cmluZwotICAgIGtLZXlEYXRlICAgICAgICAgICAgICA9ICdkYXRlJywgIC8vIGNzdHJpbmcKLSAgICBrS2V5V3JpdGVyICAgICAgICAgICAgPSAnd3JpdCcsICAvLyBjc3RyaW5nCi0gICAga0tleUNvbXBpbGF0aW9uICAgICAgID0gJ2NwaWwnLCAgLy8gY3N0cmluZwotICAgIGtLZXlMb2NhdGlvbiAgICAgICAgICA9ICdsb2MgJywgIC8vIGNzdHJpbmcKLSAgICBrS2V5VGltZVNjYWxlICAgICAgICAgPSAndG1zbCcsICAvLyBpbnQzMl90Ci0KLSAgICAvLyB2aWRlbyBwcm9maWxlIGFuZCBsZXZlbAotICAgIGtLZXlWaWRlb1Byb2ZpbGUg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F0YShjb25zdCBNZXRhRGF0YSAmZnJvbSk7Ci0KLSAgICBlbnVtIFR5cGUgewotICAgICAgICBUWVBFX05PTkUgICAgID0gJ25vbmUnLAotICAgICAgICBUWVBFX0NfU1RSSU5HID0gJ2NzdHInLAotICAgICAgICBUWVBFX0lOVDMyICAgID0gJ2luMzInLAotICAgICAgICBUWVBFX0lOVDY0ICAgID0gJ2luNjQnLAotICAgICAgICBUWVBFX0ZMT0FUICAgID0gJ2Zsb2EnLAotICAgICAgICBUWVBFX1BPSU5URVIgID0gJ3B0ciAnLAotICAgICAgICBUWVBFX1JFQ1QgICAgID0gJ3JlY3QnLAotICAgIH07Ci0KLSAgICB2b2lkIGNsZWFyKCk7Ci0gICAgYm9vbCByZW1vdmUodWludDMyX3Qga2V5KTsKLQotICAgIGJvb2wgc2V0Q1N0cmluZyh1aW50MzJfdCBrZXksIGNvbnN0IGNoYXIgKnZhbHVlKTsKLSAgICBib29sIHNldEludDMyKHVpbnQzMl90IGtleSwgaW50MzJfdCB2YWx1ZSk7Ci0gICAgYm9vbCBzZXRJbnQ2NCh1aW50MzJfdCBrZXksIGludDY0X3QgdmFsdWUpOwotICAgIGJvb2wgc2V0RmxvYXQodWludDMyX3Qga2V5LCBmbG9hdCB2YWx1ZSk7Ci0gICAgYm9vbCBzZXRQb2ludGVyKHVpbnQzMl90IGtleSwgdm9pZCAqdmFsdWUpOwotCi0gICAgYm9vbCBzZXRSZWN0KAotICAgICAgICAgICAgdWludDMyX3Qga2V5LAotICAgICAgICAgICAgaW50MzJfdCBsZWZ0LCBpbnQzMl90IHRvcCwKLSAgICAgICAgICAgIGludDMyX3QgcmlnaHQsIGludDMyX3QgYm90dG9tKTsKLQotICAgIGJvb2wgZmluZENTdHJpbmcodWludDMyX3Qga2V5LCBjb25zdCBjaGFyICoqdmFsdWUpOwotICAgIGJvb2wgZmluZEludDMyKHVpbnQzMl90IGtleSwgaW50MzJfdCAqdmFsdWUpOwotICAgIGJvb2wgZmluZEludDY0KHV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ICBFTkFCTEVELAotICAgICAgICBESVNBQkxJTkcsCi0gICAgICAgIERJU0FCTEVELAotICAgICAgICBFTkFCTElORywKLSAgICAgICAgU0hVVFRJTkdfRE9XTiwKLSAgICB9OwotCi0gICAgZW51bSBCdWZmZXJTdGF0dXMgewotICAgICAgICBPV05FRF9CWV9VUywKLSAgICAgICAgT1dORURfQllfQ09NUE9ORU5ULAotICAgICAgICBPV05FRF9CWV9OQVRJVkVfV0lORE9XLAotICAgICAgICBPV05FRF9CWV9DTElFTlQsCi0gICAgfTsKLQotICAgIHN0cnVjdCBCdWZmZXJJbmZvIHsKLSAgICAgICAgSU9NWDo6YnVmZmVyX2lkIG1CdWZmZXI7Ci0gICAgICAgIEJ1ZmZlclN0YXR1cyBtU3RhdHVzOwotICAgICAgICBzcDxJTWVtb3J5PiBtTWVtOwotICAgICAgICBzaXplX3QgbVNpemU7Ci0gICAgICAgIHZvaWQgKm1EYXRhOwotICAgICAgICBNZWRpYUJ1ZmZlciAqbU1lZGlhQnVmZmVyOwotICAgIH07Ci0KLSAgICBzdHJ1Y3QgQ29kZWNTcGVjaWZpY0RhdGEgewotICAgICAgICBzaXplX3QgbVNpemU7Ci0gICAgICAgIHVpbnQ4X3QgbURhdGFbMV07Ci0gICAgfTsKLQotICAgIHNwPElPTVg+IG1PTVg7Ci0gICAgYm9vbCBtT01YTGl2ZXNMb2NhbGx5OwotICAgIElPTVg6Om5vZGVfaWQgbU5vZGU7Ci0gICAgdWludDMyX3QgbVF1aXJrczsKLQotICAgIC8vIEZsYWdzIHNwZWNpZmllZCBpbiB0aGUgY3JlYXRpb24gb2YgdGhlIGNvZGVjLgotICAgIHVpbnQzMl90IG1GbGFnczsKLQotICAgIGJvb2wgbUlzRW5jb2RlcjsKLSAgICBib29sIG1Jc1ZpZGVvOwotICAgIGNoYXIgKm1NSU1FOwotICAgIGNoYXIgKm1Db21wb25lbnROYW1lOwotICAgIHNwPE1ldGFEYXRhPiBtT3V0cHV0Rm9ybWF0OwotICA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dGlvbi9BU3RyaW5nLmg+Ci0jaW5jbHVkZSA8dXRpbHMvTG9nLmg+Ci0KLW5hbWVzcGFjZSBhbmRyb2lkIHsKLQotI2RlZmluZSBMSVRFUkFMX1RPX1NUUklOR19JTlRFUk5BTCh4KSAgICAjeAotI2RlZmluZSBMSVRFUkFMX1RPX1NUUklORyh4KSBMSVRFUkFMX1RPX1NUUklOR19JTlRFUk5BTCh4KQotCi0jZGVmaW5lIENIRUNLKGNvbmRpdGlvbikgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFwKLSAgICBMT0dfQUxXQVlTX0ZBVEFMX0lGKCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXAotICAgICAgICAgICAgIShjb25kaXRpb24pLCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBcCi0gICAgICAgICAgICAiJXMiLCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFwKLSAgICAgICAgICAgIF9fRklMRV9fICI6IiBMSVRFUkFMX1RPX1NUUklORyhfX0xJTkVfXykgICAgXAotICAgICAgICAgICAgIiBDSEVDSygiICNjb25kaXRpb24gIikgZmFpbGVkLiIpCi0KLSNkZWZpbmUgTUFLRV9DT01QQVJBVE9SKHN1ZmZpeCxvcCkgICAgICAgICAgICAgICAgICAgICAgICAgIFwKLSAgICB0ZW1wbGF0ZTxjbGFzcyBBLCBjbGFzcyBCPiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFwKLSAgICBBU3RyaW5nIENvbXBhcmVfIyNzdWZmaXgoY29uc3QgQSAmYSwgY29uc3QgQiAmYikgeyAgICAgIFwKLSAgICAgICAgQVN0cmluZyByZXM7ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFwKLSAgICAgICAgaWYgKCEoYSBvcCBiKSkgeyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFwKLSAgICAgICAgICAgIHJlcy5hcHBlbmQoYSk7ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFwKLSAgICAgICAgICAgIHJlcy5hcHBlbmQoIiB2cy4gIik7ICAgICAgICAgICAgICAgICAgICAgICAgICAgIFwKLSAgICAgICAgICAgIHJlcy5hcHBlbmQoYik7ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFwKLSAgICAgICAgfSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFwKLSAgICAgICAgcmV0dXJuIHJlczsgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFwKLSAgICB9Ci0KLU1BS0VfQ09NUEFSQVRPUihFUSw9PSkKLU1BS0VfQ09NUEFSQVRPUihORSwhPSkKLU1BS0VfQ09NUEFSQVRPUihMRSw8PSkKLU1BS0VfQ09NUEFSQVRPUihHRSw+PSkKLU1BS0VfQ09NUEFSQVRPUihMVCw8KQotTUFLRV9DT01QQVJBVE9SKEdULD4pCi0KLSNkZWZpbmUgQ0hFQ0tfT1AoeCx5LHN1ZmZpeCxvcCkgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFwKLSAgICBkbyB7ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFwKLSAgICAgICAgQVN0cmluZyBfX19yZXMgPSBDb21wYXJlXyMjc3VmZml4KHgsIHkpOyAgICAgICAgICAgICAgICAgICAgICAgIFwKLSAgICAgICAgaWYgKCFfX19yZXMuZW1wdHkoKSkgeyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFwKLSAgICAgICAgICAgIEFTdHJpbmcgX19fZnVsbCA9ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFwKLSAgICAgICAgICAgICAgICBfX0ZJTEVfXyAiOiIgTElURVJBTF9UT19TVFJJTkcoX19MSU5FX18pICAgICAgICAgICAgICAgIFwKLSAgICAgICAgICAgICAgICAgICAgIiBDSEVDS18iICNzdWZmaXggIiggIiAjeCAiLCIgI3kgIikgZmFpbGVkOiAiOyAgICAgIFwKLSAgICAgICAgICAgIF9fX2Z1bGwuYXBwZW5kKF9fX3Jlcyk7ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFwKLSAgICAgICAgICAgIExPR19BTFdBWVNfRkFUQUwoIiVzIiwgX19fZnVsbC5jX3N0cigpKTsgICAgICAgICAgICAgICAgICAgIFwKLSAgICAgICAgfSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFwKLSAgICB9IHdoaWxlIChmYWxzZSkKLQotI2RlZmluZSBDSEVDS19FUSh4LHkpICAgQ0hFQ0tfT1AoeCx5LEVRLD09KQotI2RlZmluZSBDSEVDS19ORSh4LHkpICAgQ0hFQ0tfT1AoeCx5LE5FLCE9KQotI2RlZmluZSBDSEVDS19MRSh4LHkpICAgQ0hFQ0tfT1AoeCx5LExFLDw9KQotI2RlZmluZSBDSEVDS19MVCh4LHkpICAgQ0hFQ0tfT1AoeCx5LExULDwpCi0jZGVmaW5lIENIRUNLX0dFKHgseSkgICBDSEVDS19PUCh4LHksR0UsPj0pCi0jZGVmaW5lIENIRUNLX0dUKHgseSkgICBDSEVDS19PUCh4LHksR1QsPikKLQotI2RlZmluZSBUUkVTUEFTUygpIFwKLSAgICAgICAgTE9HX0FMV0FZU19GQVRBTCggICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBcCi0gICAgICAgICAgICBfX0ZJTEVfXyAiOiIgTElURVJBTF9UT19TVFJJTkcoX19MSU5FX18pICAgICAgICAgICAgXAotICAgICAgICAgICAgICAgICIgU2hvdWxkIG5vdCBiZSBoZXJlLiIpOwotCi19ICAvLyBuYW1lc3BhY2UgYW5kcm9pZAotCi0jZW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gICAgICAgdWludDMyX3QgICAgdXNlckJhc2U7Ci0gICAgICAgICAgICAgICAgdWludDMyX3QgICAgc2VydmVyQmFzZTsKLQotICAgICAgICAgICAgICAgIC8vIGlmIHRoZXJlIGlzIGEgc2hhcmVkIGJ1ZmZlciwgImJ1ZmZlcnMiIGlzIHRoZSB2YWx1ZSBvZiBwb2ludGVyKCkgZm9yIHRoZSBzaGFyZWQKLSAgICAgICAgICAgICAgICAvLyBidWZmZXIsIG90aGVyd2lzZSAiYnVmZmVycyIgcG9pbnRzIGltbWVkaWF0ZWx5IGFmdGVyIHRoZSBjb250cm9sIGJsb2NrCi0gICAgICAgICAgICAgICAgdm9pZCogICAgICAgYnVmZmVyczsKLSAgICAgICAgICAgICAgICB1aW50MzJfdCAgICBmcmFtZUNvdW50OwotCi0gICAgICAgICAgICAgICAgLy8gQ2FjaGUgbGluZSBib3VuZGFyeQotCi0gICAgICAgICAgICAgICAgdWludDMyX3QgICAgbG9vcFN0YXJ0OwotICAgICAgICAgICAgICAgIHVpbnQzMl90ICAgIGxvb3BFbmQ7ICAgICAgICAvLyByZWFkLW9ubHkgZm9yIHNlcnZlciwgcmVhZC93cml0ZSBmb3IgY2xpZW50Ci0gICAgICAgICAgICAgICAgaW50ICAgICAgICAgbG9vcENvdW50OyAgICAgIC8vIHJlYWQvd3JpdGUgZm9yIGNsaWVudAotCi0gICAgICAgICAgICAgICAgLy8gQ2hhbm5lbCB2b2x1bWVzIGFyZSBmaXhlZCBwb2ludCBVNC4xMiwgc28gMHgxMDAwIG1lYW5zIDEuMC4KLSAgICAgICAgICAgICAgICAvLyBMZWZ0IGNoYW5uZWwgaXMgaW4gWzA6MTVdLCByaWdodCBjaGFubmVsIGlzIGluIFsxNjozMV0uCi0gICAgICAgICAgICAgICAgLy8gQWx3YXlzIHJlYWQgYW5kIHdyaXRlIHRoZSBjb21iaW5lZCBwYWlyIGF0b21pY2FsbHkuCi0gICAgICAgICAgICAgICAgLy8gRm9yIEF1ZGlvVHJhY2sgb25seSwgbm90IHVzZWQgYnkgQXVkaW9SZWNvcmQuCi1wcml2YXRlOgotICAgICAgICAgICAgICAgIHVpbnQzMl90ICAgIG1Wb2x1bWVMUjsKLXB1YmxpYzoKLQotICAgICAgICAgICAgICAgIHVpbnQzMl90ICAgIHNhbXBsZVJhdGU7Ci0KLSAgICAgICAgICAgICAgICAvLyBOT1RFOiBhdWRpb190cmFja19jYmxrX3Q6OmZyYW1lU2l6ZSBpcyBub3QgZXF1YWwgdG8gQXVkaW9UcmFjazo6ZnJhbWVTaXplKCkgZm9yCi0gICAgICAgICAgICAgICAgLy8gOCBiaXQgUENNIGRhdGE6IGluIHRoaXMgY2FzZSwgIG1DYmxrLT5mcmFtZVNpemUgaXMgYmFzZWQgb24gYSBzYW1wbGUgc2l6ZSBvZgotICAgICAgICAgICAgICAgIC8vIDE2IGJpdCBiZWNhdXNlIGRhdGEgaXMgY29udmVydGVkIHRvIDE2IGJpdCBiZWZvcmUgYmVpbmcgc3RvcmVkIGluIGJ1ZmZlcgotCi0gICAgICAgICAgICAgICAgLy8gcmVhZC1vbmx5IGZvciBjbGllbnQsIHNlcnZlciB3cml0ZXMgb25jZSBhdCBpbml0aWFsaXphdGlvbiBhbmQgaXMgdGhlbiByZWFkLW9ubHkKLSAgICAgICAgICAgICAgICB1aW50OF90ICAgICBmcmFtZVNpemU7ICAgICAgIC8vIHdvdWxkIG5vcm1hbGx5IGJlIHNpemVfdCwgYnV0IDggYml0cyBpcyBwbGVudHkKLQotICAgICAgICAgICAgICAgIC8vIG5ldmVyIHVzZWQKLSAgICAgICAgICAgICAgICB1aW50OF90ICAgICBwYWQxOwotCi0gICAgICAgICAgICAgICAgLy8gdXNlZCBieSBjbGllbnQgb25seQotICAgICAgICAgICAgICAgIHVpbnQxNl90ICAgIGJ1ZmZlclRpbWVvdXRNczsgLy8gTWF4aW11bSBjdW11bGF0ZWQgdGltZW91dCBiZWZvcmUgcmVzdGFydGluZyBhdWRpb2ZsaW5nZXIKLQotICAgICAgICAgICAgICAgIHVpbnQxNl90ICAgIHdhaXRUaW1lTXM7ICAgICAgLy8gQ3VtdWxhdGVkIHdhaXQgdGltZSwgdXNlZCBieSBjbGllbnQgb25seQotcHJpdmF0ZToKLSAgICAgICAgICAgICAgICAvLyBjbGllbnQgd3JpdGUtb25seSwgc2VydmVyIHJlYWQtb25seQotICAgICAgICAgICAgICAgIHVpbnQxNl90ICAgIG1TZW5kTGV2ZWw7ICAgICAgLy8gRml4ZWQgcG9pbnQgVTQuMTIgc28gMHgxMDAwIG1lYW5zIDEuMAotcHVibGljOgotICAgIHZvbGF0aWxlICAgIGludDMyX3QgICAgIGZsYWdzOwotCi0gICAgICAgICAgICAgICAgLy8gQ2FjaGUgbGluZSBib3VuZGFyeSAoMzIgYnl0ZXMpCi0KLSAgICAgICAgICAgICAgICAvLyBTaW5jZSB0aGUgY29udHJvbCBibG9jayBpcyBhbHdheXMgbG9jYXRlZCBpbiBzaGFyZWQgbWVtb3J5LCB0aGlzIGNvbnN0cnVjdG9yCi0gICAgICAgICAgICAgICAgLy8gaXMgb25seSB1c2VkIGZvciBwbGFjZW1lbnQgbmV3KCkuICBJdCBpcyBuZXZlciB1c2VkIGZvciByZWd1bGFyIG5ldygpIG9yIHN0YWNrLgotICAgICAgICAgICAgICAgICAgICAgICAgICAgIGF1ZGlvX3RyYWNrX2NibGtfdCgpOwotICAgICAgICAgICAgICAgIHVpbnQzMl90ICAgIHN0ZXBVc2VyKHVpbnQzMl90IGZyYW1lQ291bnQpOyAgICAgIC8vIGNhbGxlZCBieSBjbGllbnQgb25seSwgd2hlcmUKLSAgICAgICAgICAgICAgICAvLyBjbGllbnQgaW5jbHVkZXMgcmVndWxhciBBdWRpb1RyYWNrIGFuZCBBdWRpb0ZsaW5nZXI6OlBsYXliYWNrVGhyZWFkOjpPdXRwdXRUcmFjawotICAgICAgICAgICAgICAgIGJvb2wgICAgICAgIHN0ZXBTZXJ2ZXIodWludDMyX3QgZnJhbWVDb3VudCk7ICA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uaD4KLSNpbmNsdWRlIDxzdGRsaWIuaD4KLSNpbmNsdWRlIDx1dGlscy9Mb2cuaD4KLQotbmFtZXNwYWNlIGFuZHJvaWQgewotCi0vLyBBIHNpbXBsZSBidWZmZXIgdG8gaG9sZCBiaW5hcnkgZGF0YQotY2xhc3MgTWVkaWFBbGJ1bUFydAotewotcHVibGljOgotICAgIE1lZGlhQWxidW1BcnQoKTogbVNpemUoMCksIG1EYXRhKDApIHt9Ci0KLSAgICBleHBsaWNpdCBNZWRpYUFsYnVtQXJ0KGNvbnN0IGNoYXIqIHVybCkgewotICAgICAgICBtU2l6ZSA9IDA7Ci0gICAgICAgIG1EYXRhID0gTlVMTDsKLSAgICAgICAgRklMRSAqaW4gPSBmb3Blbih1cmwsICJyIik7Ci0gICAgICAgIGlmICghaW4pIHsKLSAgICAgICAgICAgIHJldHVybjsKLSAgICAgICAgfQotICAgICAgICBmc2VlayhpbiwgMCwgU0VFS19FTkQpOwotICAgICAgICBtU2l6ZSA9IGZ0ZWxsKGluKTsgIC8vIEFsbG9jYXRpbmcgYnVmZmVyIG9mIHNpemUgZXF1YWxzIHRvIHRoZSBleHRlcm5hbCBmaWxlIHNpemUuCi0gICAgICAgIGlmIChtU2l6ZSA9PSAwIHx8IChtRGF0YSA9IG5ldyB1aW50OF90W21TaXplXSkgPT0gTlVMTCkgewotICAgICAgICAgICAgZmNsb3NlKGluKTsKLSAgICAgICAgICAgIGlmIChtU2l6ZSAhPSAwKSB7Ci0gICAgICAgICAgICAgICAgbVNpemUgPSAwOwotICAgICAgICAgICAgfQotICAgICAgICAgICAgcmV0dXJuOwotICAgICAgICB9Ci0gICAgICAgIHJld2luZChpbik7Ci0gICAgICAgIGlmIChmcmVhZChtRGF0YSwgMSwgbVNpemUsIGluKSAhPSBtU2l6ZSkgeyAgLy8gUmVhZCBmYWlsZWQuCi0gICAgICAgICAgICBkZWxldGVbXSBtRGF0YTsKLSAgICAgICAgICAgIG1EYXRhID0gTlVMTDsKLSAgICAgICAgICAgIG1TaXplID0gMDsKLSAgICAgICAgICAgIHJldHVybjsKLSAgICAgICAgfQotICAgICAgICBmY2xvc2UoaW4pOwotICAgIH0KLQotICAgIE1lZGlhQWxidW1BcnQoY29uc3QgTWVkaWFBbGJ1bUFydCYgY29weSkgewotICAgICAgICBtU2l6ZSA9IGNvcHkubVNpemU7Ci0gICAgICAgIG1EYXRhID0gTlVMTDsgIC8vIGluaXRpYWxpemUgaXQgZmlyc3QKLSAgICAgICAgaWYgKG1TaXplID4gMCAmJiBjb3B5Lm1EYXRhICE9IE5VTEwpIHsKLSAgICAgICAgICAgbURhdGEgPSBuZXcgdWludDhfdFtjb3B5Lm1TaXplXTsKLSAgICAgICAgICAgaWYgKG1EYXRhICE9IE5VTEwpIHsKLSAgICAgICAgICAgICAgIG1lbWNweShtRGF0YSwgY29weS5tRGF0YSwgbVNpemUpOwotICAgICAgICAgICB9IGVsc2UgewotICAgICAgICAgICAgICAgbVNpemUgPSAwOwotICAgICAgICAgICB9Ci0gICAgICAgIH0KLSAgICB9Ci0KLSAgICB+TWVkaWFBbGJ1bUFydCgpIHsKLSAgICAgICAgaWYgKG1EYXRhICE9IDApIHsKLSAgICAgICAgICAgIGRlbGV0ZVtdIG1EYXRhOwotICAgICAgICB9Ci0gICAgfQotCi0gICAgLy8gSW50ZW50aW9uYWwgcHVibGljIGFjY2VzcyBtb2RpZmllcjoKLSAgICAvLyBXZSBoYXZlIHRvIGtub3cgdGhlIGludGVybmFsIHN0cnVjdHVyZSBpbiBvcmRlciB0byBzaGFyZSBpdCBiZXR3ZWVuCi0gICAgLy8gcHJvY2Vzc2VzPwotICAgIHVpbnQzMl90IG1TaXplOyAgICAgICAgICAgIC8vIE51bWJlciBvZiBieXRlcyBpbiBtRGF0YQotICAgIHVpbnQ4X3QqIG1EYXRhOyAgICAgICAgICAgIC8vIEFjdHVhbCBiaW5hcnkgZGF0YQotfTsKLQotLy8gUmVwcmVzZW50cyBhIGNvbG9yIGNvbnZlcnRlZCAo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lJZCA9PSBudWxsKSB7CisgICAgICAgICAgICAgICAgdGhyb3cgbmV3IEtleUNoYWluRXhjZXB0aW9uKCJrZXlzdG9yZSBoYWQgYSBwcm9ibGVtIik7CisgICAgICAgICAgICB9CisKKyAgICAgICAgICAgIGZpbmFsIE9wZW5TU0xFbmdpbmUgZW5naW5lID0gT3BlblNTTEVuZ2luZS5nZXRJbnN0YW5jZSgia2V5c3RvcmUiKTsKKyAgICAgICAgICAgIHJldHVybiBlbmdpbmUuZ2V0UHJpdmF0ZUtleUJ5SWQoa2V5SWQpOwogICAgICAgICB9IGNhdGNoIChSZW1vdGVFeGNlcHRpb24gZSkgewogICAgICAgICAgICAgdGhyb3cgbmV3IEtleUNoYWluRXhjZXB0aW9uKGUpOwogICAgICAgICB9IGNhdGNoIChSdW50aW1lRXhjZXB0aW9uIGUpIHsKICAgICAgICAgICAgIC8vIG9ubHkgY2VydGFpbiBSdW50aW1lRXhjZXB0aW9ucyBjYW4gYmUgcHJvcGFnYXRlZCBhY3Jvc3MgdGhlIElLZXlDaGFpblNlcnZpY2UgY2FsbAogICAgICAgICAgICAgdGhyb3cgbmV3IEtleUNoYWluRXhjZXB0aW9uKGUpOworICAgICAgICB9IGNhdGNoIChJbnZhbGlkS2V5RXhjZXB0aW9uIGUpIHsKKyAgICAgICAgICAgIHRocm93IG5ldyBLZXlDaGFpbkV4Y2VwdGlvbihlKTsKICAgICAgICAgfSBmaW5hbGx5IHsKICAgICAgICAgICAgIGtleUNoYWluQ29ubmVjdGlvbi5jbG9zZSgpOwogICAgICAgICB9CkBAIC0zNTYsMTggKzM2Niw2IEBACiAgICAgICAgIH0KICAgICB9CiAKLSAgICBwcml2YXRlIHN0YXRpYyBQcml2YXRlS2V5IHRvUHJpdmF0ZUtleShieXRlW10gYnl0ZXMpIHsKLSAgICAgICAgaWYgKGJ5dGVzID09IG51bGwpIHsKLSAgICAgICAgICAgIHRocm93IG5ldyBJbGxlZ2FsQXJndW1lbnRFeGNlcHRpb24oImJ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NTV0QpKTsKKworICAgICAgICBhc3NlcnRUcnVlKCJTaG91bGQgYmUgYWJsZSB0byBpbXBvcnQga2V5IGZvciB0ZXN0Y2FzZSIsCisgICAgICAgICAgICAgICAgbUtleVN0b3JlLmltcG9ydEtleShURVNUX0tFWU5BTUUsIFBSSVZLRVlfQllURVMpKTsKKworICAgICAgICBhc3NlcnRUcnVlKCJTaG91bGQgYmUgYWJsZSB0byBncmFudCBrZXkgdG8gb3RoZXIgdXNlciIsIG1LZXlTdG9yZS5ncmFudChURVNUX0tFWU5BTUUsIDApKTsKKyAgICB9CisKKyAgICBwdWJsaWMgdm9pZCB0ZXN0R3JhbnRfTm9LZXlfRmFpbHVyZSgpIHRocm93cyBFeGNlcHRpb24geworICAgICAgICBhc3NlcnRUcnVlKCJTaG91bGQgYmUgYWJsZSB0byB1bmxvY2sga2V5c3RvcmUgZm9yIHRlc3QiLAorICAgICAgICAgICAgICAgIG1LZXlTdG9yZS5wYXNzd29yZChURVNUX1BBU1NXRCkpOworCisgICAgICAgIGFzc2VydEZhbHNlKCJTaG91bGQgbm90IGJlIGFibGUgdG8gZ3JhbnQgd2l0aG91dCBmaXJzdCBpbml0aWFsaXppbmcgdGhlIGtleXN0b3JlIiwKKyAgICAgICAgICAgICAgICBtS2V5U3RvcmUuZ3JhbnQoVEVTVF9LRVlOQU1FLCAwKSk7CisgICAgfQorCisgICAgcHVibGljIHZvaWQgdGVzdEdyYW50X05vdEluaXRpYWxpemVkX0ZhaWx1cmUoKSB0aHJvd3MgRXhjZXB0aW9uIHsKKyAgICAgICAgYXNzZXJ0RmFsc2UoIlNob3VsZCBub3QgYmUgYWJsZSB0byBncmFudCB3aXRob3V0IGZpcnN0IGluaXRpYWxpemluZyB0aGUga2V5c3RvcmUiLAorICAgICAgICAgICAgICAgIG1LZXlTdG9yZS5ncmFudChURVNUX0tFWU5BTUUsIDApKTsKKyAgICB9CisKKyAgICBwdWJsaWMgdm9pZCB0ZXN0VW5ncmFudF9HZW5lcmF0ZWRfU3VjY2VzcygpIHRocm93cyBFeGNlcHRpb24geworICAgICAgICBhc3NlcnRUcnVlKCJQYXNzd29yZCBzaG91bGQgd29yayBmb3Iga2V5c3RvcmUiLAorICAgICAgICAgICAgICAgIG1LZXlTdG9yZS5wYXNzd29yZChURVNUX1BBU1NXRCkpOworCisgICAgICAgIGFzc2VydFRydWUoIlNob3VsZCBiZSBhYmxlIHRvIGdlbmVyYXRlIGtleSBmb3IgdGVzdGNhc2UiLAorICAgICAgICAgICAgICAgIG1LZXlTdG9yZS5nZW5lcmF0ZShURVNUX0tFWU5BTUUpKTsKKworICAgICAgICBhc3NlcnRUcnVlKCJTaG91bGQgYmUgYWJsZSB0byBncmFudCBrZXkgdG8gb3RoZXIgdXNlciIsCisgICAgICAgICAgICAgICAgbUtleVN0b3JlLmdyYW50KFRFU1RfS0VZTkFNRSwgMCkpOworCisgICAgICAgIGFzc2VydFRydWUoIlNob3VsZCBiZSBhYmxlIHRvIHVuZ3JhbnQga2V5IHRvIG90aGVyIHVzZXIiLAorICAgICAgICAgICAgICAgIG1LZXlTdG9yZS51bmdyYW50KFRFU1RfS0VZTkFNRSwgMCkpOworICAgIH0KKworICAgIHB1YmxpYyB2b2lkIHRlc3RVbmdyYW50X0ltcG9ydGVkX1N1Y2Nlc3MoKSB0aHJvd3MgRXhjZXB0aW9uIHsKKyAgICAgICAgYXNzZXJ0VHJ1ZSgiUGFzc3dvcmQgc2hvdWxkIHdvcmsgZm9yIGtleXN0b3JlIiwKKyAgICAgICAgICAgICAgICBtS2V5U3RvcmUucGFzc3dvcmQoVEVTVF9QQVNTV0QpKTsKKworICAgICAgICBhc3NlcnRUcnVlKCJTaG91bGQgYmUgYWJsZSB0byBpbXBvcnQga2V5IGZvciB0ZXN0Y2FzZSIsCisgICAgICAgICAgICAgICAgbUtleVN0b3JlLmltcG9ydEtleShURVNUX0tFWU5BTUUsIFBSSVZLRVlfQllURVMpKTsKKworICAgICAgICBhc3NlcnRUcnVlKCJTaG91bGQ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mV2aWV3VGV4dHVyZShzdCkpOwotICAgICAgICAgICAgcmV0dXJuIE5PX0VSUk9SOwotICAgICAgICB9IGJyZWFrOwotICAgICAgICBjYXNlIFNFVF9QUkVWSUVXX0NBTExCQUNLX0ZMQUc6IHsKLSAgICAgICAgICAgIEFMT0dWKCJTRVRfUFJFVklFV19DQUxMQkFDS19UWVBFIik7Ci0gICAgICAgICAgICBDSEVDS19JTlRFUkZBQ0UoSUNhbWVyYSwgZGF0YSwgcmVwbHkpOwotICAgICAgICAgICAgaW50IGNhbGxiYWNrX2ZsYWcgPSBkYXRhLnJlYWRJbnQzMigpOwotICAgICAgICAgICAgc2V0UHJldmlld0NhbGxiYWNrRmxhZyhjYWxsYmFja19mbGFnKTsKLSAgICAgICAgICAgIHJldHVybiBOT19FUlJPUjsKLSAgICAgICAgfSBicmVhazsKLSAgICAgICAgY2FzZSBTVEFSVF9QUkVWSUVXOiB7Ci0gICAgICAgICAgICBBTE9HVigiU1RBUlRfUFJFVklFVyIpOwotICAgICAgICAgICAgQ0hFQ0tfSU5URVJGQUNFKElDYW1lcmEsIGRhdGEsIHJlcGx5KTsKLSAgICAgICAgICAgIHJlcGx5LT53cml0ZUludDMyKHN0YXJ0UHJldmlldygpKTsKLSAgICAgICAgICAgIHJldHVybiBOT19FUlJPUjsKLSAgICAgICAgfSBicmVhazsKLSAgICAgICAgY2FzZSBTVEFSVF9SRUNPUkRJTkc6IHsKLSAgICAgICAgICAgIEFMT0dWKCJTVEFSVF9SRUNPUkRJTkciKTsKLSAgICAgICAgICAgIENIRUNLX0lOVEVSRkFDRShJQ2FtZXJhLCBkYXRhLCByZXBseSk7Ci0gICAgICAgICAgICByZXBseS0+d3JpdGVJbnQzMihzdGFydFJlY29yZGluZygpKTsKLSAgICAgICAgICAgIHJldHVybiBOT19FUlJPUjsKLSAgICAgICAgfSBicmVhazsKLSAgICAgICAgY2FzZSBTVE9QX1BSRVZJRVc6IHsKLSAgICAgICAgICAgIEFMT0dWKCJTVE9QX1BSRVZJRVciKTsKLSAgICAgICAgICAgIENIRUNLX0lOVEVSRkFDRShJQ2FtZXJhLCBkYXRhLCByZXBseSk7Ci0gICAgICAgICAgICBzdG9wUHJldmlldygpOwotICAgICAgICAgICAgcmV0dXJuIE5PX0VSUk9SOwotICAgICAgICB9IGJyZWFrOwotICAgICAgICBjYXNlIFNUT1BfUkVDT1JESU5HOiB7Ci0gICAgICAgICAgICBBTE9HVigiU1RPUF9SRUNPUkRJTkciKTsKLSAgICAgICAgICAgIENIRUNLX0lOVEVSRkFDRShJQ2FtZXJhLCBkYXRhLCByZXBseSk7Ci0gICAgICAgICAgICBzdG9wUmVjb3JkaW5nKCk7Ci0gICAgICAgICAgICByZXR1cm4gTk9fRVJST1I7Ci0gICAgICAgIH0gYnJlYWs7Ci0gICAgICAgIGNhc2UgUkVMRUFTRV9SRUNPUkRJTkdfRlJBTUU6IHsKLSAgICAgICAgICAgIEFMT0dWKCJSRUxFQVNFX1JFQ09SRElOR19GUkFNRSIpOwotICAgICAgICAgICAgQ0hFQ0tfSU5URVJGQUNFKElDYW1lcmEsIGRhdGEsIHJlcGx5KTsKLSAgICAgICAgICAgIHNwPElNZW1vcnk+IG1lbSA9IGludGVyZmFjZV9jYXN0PElNZW1vcnk+KGRhdGEucmVhZFN0cm9uZ0JpbmRlcigpKTsKLSAgICAgICAgICAgIHJlbGVhc2VSZWNvcmRpbmdGcmFtZShtZW0pOwotICAgICAgICAgICAgcmV0dXJuIE5PX0VSUk9SOwotICAgICAgICB9IGJyZWFrOwotICAgICAgICBjYXNlIFNUT1JFX01FVEFfREFUQV9JTl9CVUZGRVJTOiB7Ci0gICAgICAgICAgICBBTE9HVigiU1RPUkVfTUVUQV9EQVRBX0lOX0JVRkZFUlMiKTsKLSAgICAgICAgICAgIENIRUNLX0lOVEVSRkFDRShJQ2FtZXJhLCBkYXRhLCByZXBseSk7Ci0gICAgICAgICAgICBib29sIGVuYWJsZWQgPSBkYXRhLnJlYWRJbnQzMigpOwotICAg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wotICAgICAgICAgICAgQ0hFQ0tfSU5URVJGQUNFKElDYW1lcmEsIGRhdGEsIHJlcGx5KTsKLSAgICAgICAgICAgIHJlcGx5LT53cml0ZUludDMyKGNhbmNlbEF1dG9Gb2N1cygpKTsKLSAgICAgICAgICAgIHJldHVybiBOT19FUlJPUjsKLSAgICAgICAgfSBicmVhazsKLSAgICAgICAgY2FzZSBUQUtFX1BJQ1RVUkU6IHsKLSAgICAgICAgICAgIEFMT0dWKCJUQUtFX1BJQ1RVUkUiKTsKLSAgICAgICAgICAgIENIRUNLX0lOVEVSRkFDRShJQ2FtZXJhLCBkYXRhLCByZXBseSk7Ci0gICAgICAgICAgICBpbnQgbXNnVHlwZSA9IGRhdGEucmVhZEludDMyKCk7Ci0gICAgICAgICAgICByZXBseS0+d3JpdGVJbnQzMih0YWtlUGljdHVyZShtc2dUeXBlKSk7Ci0gICAgICAgICAgICByZXR1cm4gTk9fRVJST1I7Ci0gICAgICAgIH0gYnJlYWs7Ci0gICAgICAgIGNhc2UgU0VUX1BBUkFNRVRFUlM6IHsKLSAgICAgICAgICAgIEFMT0dWKCJTRVRfUEFSQU1FVEVSUyIpOwotICAgICAgICAgICAgQ0hFQ0tfSU5URVJGQUNFKElDYW1lcmEsIGRhdGEsIHJlcGx5KTsKLSAgICAgICAgICAgIFN0cmluZzggcGFyYW1zKGRhdGEucmVhZFN0cmluZzgoKSk7Ci0gICAgICAgICAgICByZXBseS0+d3JpdGVJbnQzMihzZXRQYXJhbWV0ZXJzKHBhcmFtcykpOwotICAgICAgICAgICAgcmV0dXJuIE5PX0VSUk9SOwotICAgICAgICAgfSBicmVhazsKLSAgICAgICAgY2FzZSBHRVRfUEFSQU1FVEVSUzogewotICAgICAgICAgICAgQUxPR1YoIkdFVF9QQVJBTUVURVJTIik7Ci0gICAgICAgICAgICBDSEVDS19JTlRFUkZBQ0UoSUNhbWVyYSwgZGF0YSwgcmVwbHkpOwotICAgICAgICAgICAgIHJlcGx5LT53cml0ZVN0cmluZzgoZ2V0UGFyYW1ldGVycygpKTsKLSAgICAgICAgICAgIHJldHVybiBOT19FUlJPUjsKLSAgICAgICAgIH0gYnJlYWs7Ci0gICAgICAgIGNhc2UgU0VORF9DT01NQU5EOiB7Ci0gICAgICAgICAgICBBTE9HVigiU0VORF9DT01NQU5EIik7Ci0gICAgICAgICAgICBDSEVDS19JTlRFUkZBQ0UoSUNhbWVyYSwgZGF0YSwgcmVwbHkpOwotICAgICAgICAgICAgaW50IGNvbW1hbmQgPSBkYXRhLnJlYWRJbnQzMigpOwotICAgICAgICAgICAgaW50IGFyZzEgPSBkYXRhLnJlYWRJbnQzMigpOwotICAgICAgICAgICAgaW50IGFyZzIgPSBkYXRhLnJlYWRJbnQzMigpOwotICAgICAgICAgICAgcmVwbHktPndyaXRlSW50MzIoc2VuZENvbW1hbmQoY29tbWFuZCwgYXJnMSwgYXJnMikpOwotICAgICAgICAgICAgcmV0dXJuIE5PX0VSUk9SOwotICAgICAgICAgfSBicmVhazsKLSAgICAgICAgY2FzZSBDT05ORUNUOiB7Ci0gICAgICAgICAgICBDSEVDS19JTlRFUkZBQ0UoSUNhbWVyYSwgZGF0YSwgcmVwbHkpOwotICAgICAgICAgICAgc3A8SUNhbWVyYUNsaWVudD4gY2FtZXJhQ2xpZW50ID0gaW50ZXJmYWNlX2Nhc3Q8SUNhbWVyYUNsaWVudD4oZGF0YS5yZWFkU3Ryb25nQmluZGVyKCkpOwotICAgICAgICAgICAgcmVwbHktPndyaXRlSW50MzIoY29ubmVjdChjYW1lcmFDbGllbnQpKTsKLSAgICAgICAgICAgIHJldHVybiBOT19FUlJPUjsKLSAgICAgICAgfSBicmVhazsKLSAgICAgICAgY2FzZSBMT0NLOiB7Ci0gICAgICAgICAgICBDSEVDS19JTlRFUkZBQ0UoSUNhbWVyYSwgZGF0YSwgcmVwbHkpOwotICAgICAgICAgICAgcmVwbHktPndyaXRlSW50MzIobG9jaygpKTsKLSAgICAgICAgICAgIHJldHVybiBOT19FUlJPUjsK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FQ0tfSU5URVJGQUNFKElDYW1lcmFTZXJ2aWNlLCBkYXRhLCByZXBseSk7Ci0gICAgICAgICAgICBDYW1lcmFJbmZvIGNhbWVyYUluZm87Ci0gICAgICAgICAgICBtZW1zZXQoJmNhbWVyYUluZm8sIDAsIHNpemVvZihjYW1lcmFJbmZvKSk7Ci0gICAgICAgICAgICBzdGF0dXNfdCByZXN1bHQgPSBnZXRDYW1lcmFJbmZvKGRhdGEucmVhZEludDMyKCksICZjYW1lcmFJbmZvKTsKLSAgICAgICAgICAgIHJlcGx5LT53cml0ZUludDMyKGNhbWVyYUluZm8uZmFjaW5nKTsKLSAgICAgICAgICAgIHJlcGx5LT53cml0ZUludDMyKGNhbWVyYUluZm8ub3JpZW50YXRpb24pOwotICAgICAgICAgICAgcmVwbHktPndyaXRlSW50MzIocmVzdWx0KTsKLSAgICAgICAgICAgIHJldHVybiBOT19FUlJPUjsKLSAgICAgICAgfSBicmVhazsKLSAgICAgICAgY2FzZSBDT05ORUNUOiB7Ci0gICAgICAgICAgICBDSEVDS19JTlRFUkZBQ0UoSUNhbWVyYVNlcnZpY2UsIGRhdGEsIHJlcGx5KTsKLSAgICAgICAgICAgIHNwPElDYW1lcmFDbGllbnQ+IGNhbWVyYUNsaWVudCA9IGludGVyZmFjZV9jYXN0PElDYW1lcmFDbGllbnQ+KGRhdGEucmVhZFN0cm9uZ0JpbmRlcigpKTsKLSAgICAgICAgICAgIGNvbnN0IGludCBjYW1lcmFJZCA9IGRhdGEucmVhZEludDMyKCk7Ci0gICAgICAgICAgICBjb25zdCBpbnQgZm9yY2UgPSBkYXRhLnJlYWRJbnQzMigpOwotICAgICAgICAgICAgY29uc3QgaW50IGtlZXAgPSBkYXRhLnJlYWRJbnQzMigpOwotICAgICAgICAgICAgc3A8SUNhbWVyYT4gY2FtZXJhID0gY29ubmVjdChjYW1lcmFDbGllbnQsIGNhbWVyYUlkLCBmb3JjZSwga2VlcCk7Ci0gICAgICAgICAgICByZXBseS0+d3JpdGV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OjprU2VydmljZU5hbWUoImNvbW1vbl90aW1lLmNsb2NrIik7Ci1jb25zdCB1aW50NjRfdCBJQ29tbW9uQ2xvY2s6OmtJbnZhbGlkVGltZWxpbmVJRCA9IDA7Ci1jb25zdCBpbnQzMl90IElDb21tb25DbG9jazo6a0Vycm9yRXN0aW1hdGVVbmtub3duID0gMHg3RkZGRkZGRjsKLQotY2xhc3MgQnBDb21tb25DbG9jayA6IHB1YmxpYyBCcEludGVyZmFjZTxJQ29tbW9uQ2xvY2s+Ci17Ci0gIHB1YmxpYzoKLSAgICBCcENvbW1vbkNsb2NrKGNvbnN0IHNwPElCaW5kZXI+JiBpbXBsKQotICAgICAgICA6IEJwSW50ZXJmYWNlPElDb21tb25DbG9jaz4oaW1wbCkge30KLQotICAgIHZpcnR1YWwgc3RhdHVzX3QgaXNDb21tb25UaW1lVmFsaWQoYm9vbCogdmFsaWQsIHVpbnQzMl90KiB0aW1lbGluZUlEKSB7Ci0gICAgICAgIFBhcmNlbCBkYXRhLCByZXBseTsKLSAgICAgICAgZGF0YS53cml0ZUludGVyZmFjZVRva2VuKElDb21tb25DbG9jazo6Z2V0SW50ZXJmYWNlRGVzY3JpcHRvcigpKTsKLSAgICAgICAgc3RhdHVzX3Qgc3RhdHVzID0gcmVtb3RlKCktPnRyYW5zYWN0KElTX0NPTU1PTl9USU1FX1ZBTElELAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZGF0YSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICZyZXBseSk7Ci0gICAgICAgIGlmIChzdGF0dXMgPT0gT0spIHsKLSAgICAgICAgICAgIHN0YXR1cyA9IHJlcGx5LnJlYWRJbnQzMigpOwotICAgICAgICAgICAgaWYgKHN0YXR1cyA9PSBPSykgewotICAgICAgICAgICAgICAgICp2YWxpZCA9IHJlcGx5LnJlYWRJbnQzMigpOwotICAgICAgICAgICAgICAgICp0aW1lbGluZUlEID0gcmVwbHkucmVhZEludDMyKCk7Ci0gICAgICAgICAgICB9Ci0gICAgICAgIH0KLSAgICAgICAgcmV0dXJuIHN0YXR1czsKLSAgICB9Ci0KLSAgICB2aXJ0dWFsIHN0YXR1c190IGNvbW1vblRpbWVUb0xvY2FsVGltZShpbnQ2NF90IGNvbW1vblRpbWUsCi0gICAgICAgICAgICBpbnQ2NF90KiBsb2NhbFRpbWUpIHsKLSAgICAgICAgUGFyY2VsIGRhdGEsIHJlcGx5OwotICAgICAgICBkYXRhLndyaXRlSW50ZXJmYWNlVG9rZW4oSUNvbW1vbkNsb2NrOjpnZXRJbnRlcmZhY2VEZXNjcmlwdG9yKCkpOwotICAgICAgICBkYXRhLndyaXRlSW50NjQoY29tbW9uVGltZSk7Ci0gICAgICAgIHN0YXR1c190IHN0YXR1cyA9IHJlbW90ZSgpLT50cmFuc2FjdChDT01NT05fVElNRV9UT19MT0NBTF9USU1FLAotICAgICAgICAgICAgICAgIGRhdGEsICZyZXBseSk7Ci0gICAgICAgIGlmIChzdGF0dXMgPT0gT0spIHsKLSAgICAgICAgICAgIHN0YXR1cyA9IHJlcGx5LnJlYWRJbnQzMigpOwotICAgICAgICAgICAgaWYgKHN0YXR1cyA9PSBPSykgewotICAgICAgICAgICAgICAgICpsb2NhbFRpbWUgPSByZXBseS5yZWFkSW50NjQoKTsKLSAgICAgICAgICAgIH0KLSAgICAgICAgfQotICAgICAgICByZXR1cm4gc3RhdHVzOwotICAgIH0KLQotICAgIHZpcnR1YWwgc3RhdHVzX3QgbG9jYWxUaW1lVG9Db21tb25UaW1lKGludDY0X3QgbG9jYWxUaW1lLAotICAgICAgICAgICAgaW50NjRfdCogY29tbW9uVGltZSkgewotICAgICAgICBQYXJjZWwgZGF0YSwgcmVwbHk7Ci0gICAgICAgIGRhdGEud3JpdGVJbnRlcmZhY2VUb2tlbihJQ29tbW9uQ2xvY2s6OmdldEludGVyZmFjZURlc2NyaXB0b3IoKSk7Ci0gICAgICAgIGRhdGEud3JpdGVJbnQ2NChsb2NhbFRpbWUpOwotICAgICAgICBzdGF0dXNfdCBzdGF0dXMgPSByZW1vdGUoKS0+dHJhbnNhY3QoTE9DQUxfVElNRV9UT19DT01NT05fVElNRSwKLSAgICAgICAgICAgICAgICBkYXRhLCAmcmVwbHkpOwotICAgICAgICBpZiAoc3RhdHVzID09IE9LKSB7Ci0gICAgICAgICAgICBzdGF0dXMgPSByZXBseS5yZWFkSW50MzIoKTsKLSAgICAgICAgICAgIGlmIChzdGF0dXMgPT0gT0spIHsKLSAgICAgICAgICAgICAgICAqY29tbW9uVGltZSA9IHJlcGx5LnJlYWRJbnQ2NCgpOwotICAgICAgICAgICAgfQotICAgICAgICB9Ci0gICAgICAgIHJldHVybiBzdGF0dXM7Ci0gICAgfQotCi0gICAgdmlydHVhbCBzdGF0dXNfdCBnZXRDb21tb25UaW1lKGludDY0X3QqIGNvbW1vblRpbWUpIHsKLSAgICAgICAgUGFyY2VsIGRhdGEsIHJlcGx5OwotICAgICAgICBkYXRhLndyaXRlSW50ZXJmYWNlVG9rZW4oSUNvbW1vbkNsb2NrOjpnZXRJbnRlcmZhY2VEZXNjcmlwdG9yKCkpOwotICAgICAgICBzdGF0dXNfdCBzdGF0dXMgPSByZW1vdGUoKS0+dHJhbnNhY3QoR0VUX0NPTU1PTl9USU1FLCBkYXRhLCAmcmVwbHkpOwotICAgICAgICBpZiAoc3RhdHVzID09IE9LKSB7Ci0gICAgICAgICAgICBzdGF0dXMgPSByZXBseS5yZWFkSW50MzIoKTsKLSAgICAgICAgICAgIGlmIChzdGF0dXMgPT0gT0spIHsKLSAgICAgICAgICAgICAgICAqY29tbW9uVGltZSA9IHJlcGx5LnJlYWRJbnQ2NCgpOwotICAgICAgICAgICAgfQotICAgICAgICB9Ci0gICAgICAgIHJldHVybiBzdGF0dXM7Ci0gICAgfQotCi0gICAgdmlydHVhbCBzdGF0dXNfdCBnZXRDb21tb25GcmVxKHVpbnQ2NF90KiBmcmVxKSB7Ci0gICAgICAgIFBhcmNlbCBkYXRhLCByZXBseTsKLSAgICAgICAgZGF0YS53cml0ZUludGVyZmFjZVRva2VuKElDb21tb25DbG9jazo6Z2V0SW50ZXJmYWNlRGVzY3JpcHRvcigpKTsKLSAgICAgICAgc3RhdHVzX3Qgc3RhdHVzID0gcmVtb3RlKCktPnRyYW5zYWN0KEdFVF9DT01NT05fRlJFUSwgZGF0YSwgJnJlcGx5KTsKLSAgICAgICAgaWYgKHN0YXR1cyA9PSBPSykgewotICAgICAgICAgICAgc3RhdHVzID0gcmVwbHkucmVhZEludDMyKCk7Ci0gICAgICAgICAgICBpZiAoc3RhdHVzID09IE9LKSB7Ci0gICAgICAgICAgICAgICAgKmZyZXEgPSByZXBseS5yZWFkSW50NjQoKTsKLSAgICAgICAgICAgIH0KLSAgICAgICAgfQotICAgICAgICByZXR1cm4gc3RhdHVzOwotICAgIH0KLQotICAgIHZpcnR1YWwgc3RhdHVzX3QgZ2V0TG9jYWxUaW1lKGludDY0X3QqIGxvY2FsVGltZSkgewotICAgICAgICBQYXJjZWwgZGF0YSwgcmVwbHk7Ci0gICAgICAgIGRhdGEud3JpdGVJbnRlcmZhY2VUb2tlbihJQ29tbW9uQ2xvY2s6OmdldEludGVyZmFjZURlc2NyaXB0b3IoKSk7Ci0gICAgICAgIHN0YXR1c190IHN0YXR1cyA9IHJlbW90ZSgpLT50cmFuc2FjdChHRVRfTE9DQUxfVElNRSwgZGF0YSwgJnJlcGx5KTsKLSAgICAgICAgaWYgKHN0YXR1cyA9PSBPSykgewotICAgICAgICAgICAgc3RhdHVzID0gcmVwbHkucmVhZEludDMyKCk7Ci0gICAgICAgICAgICBpZiAoc3RhdHVzID09IE9LKSB7Ci0gICAgICAgICAgICAgICAgKmxvY2FsVGltZSA9IHJlcGx5LnJlYWRJbnQ2NCgpOwotICAgICAgICAgICAgfQotICAgICAgICB9Ci0gICAgICAgIHJldHVybiBzdGF0dXM7Ci0gICAgfQotCi0gICAgdmlydHVhbCBzdGF0dXNfdCBnZXRMb2NhbEZyZXEodWludDY0X3QqIGZyZXEpIHsKLSAgICAgICAgUGFyY2VsIGRhdGEsIHJlcGx5OwotICAgICAgICBkYXRhLndyaXRlSW50ZXJmYWNlVG9rZW4oSUNvbW1vbkNsb2NrOjpnZXRJbnRlcmZhY2VEZXNjcmlwdG9yKCkpOwotICAgICAgICBzdGF0dXNfdCBzdGF0dXMgPSByZW1vdGUoKS0+dHJhbnNhY3QoR0VUX0xPQ0FMX0ZSRVEsIGRhdGEsICZyZXBseSk7Ci0gICAgICAgIGlmIChzdGF0dXMgPT0gT0spIHsKLSAgICAgICAgICAgIHN0YXR1cyA9IHJlcGx5LnJlYWRJbnQzMigpOwotICAgICAgICAgICAgaWYgKHN0YXR1cyA9PSBPSykgewotICAgICAgICAgICAgICAgICpmcmVxID0gcmVwbHkucmVhZEludDY0KCk7Ci0gICAgICAgICAgICB9Ci0gICAgICAgIH0KLSAgICAgICAgcmV0dXJuIHN0YXR1czsKLSAgICB9Ci0KLSAgICB2aXJ0dWFsIHN0YXR1c190IGdldEVzdGltYXRlZEVycm9yKGludDMyX3QqIGVzdGltYXRlKSB7Ci0gICAgICAgIFBhcmNlbCBkYXRhLCByZXBseTsKLSAgICAgICAgZGF0YS53cml0ZUludGVyZmFjZVRva2VuKElDb21tb25DbG9jazo6Z2V0SW50ZXJmYWNlRGVzY3JpcHRvcigpKTsKLSAgICAgICAgc3RhdHVzX3Qgc3RhdHVzID0gcmVtb3RlKCktPnRyYW5zYWN0KEdFVF9FU1RJTUFURURfRVJST1IsIGRhdGEsICZyZXBseSk7Ci0gICAgICAgIGlmIChzdGF0dXMgPT0gT0spIHsKLSAgICAgICAgICAgIHN0YXR1cyA9IHJlcGx5LnJlYWRJbnQzMigpOwotICAgICAgICAgICAgaWYgKHN0YXR1cyA9PSBPSykgewotICAgICAgICAgICAgICAgICplc3RpbWF0ZSA9IHJlcGx5LnJlYWRJbnQzMigpOwotICAgICAgICAgICAgfQotICAgICAgICB9Ci0gICAgICAgIHJldH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Y2VsKiByZXBseSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdWludDMyX3QgZmxhZ3MpIHsKLSAgICBzd2l0Y2goY29kZSkgewotICAgICAgICBjYXNlIElTX0NPTU1PTl9USU1FX1ZBTElEOiB7Ci0gICAgICAgICAgICBDSEVDS19JTlRFUkZBQ0UoSUNvbW1vbkNsb2NrLCBkYXRhLCByZXBseSk7Ci0gICAgICAgICAgICBib29sIHZhbGlkOwotICAgICAgICAgICAgdWludDMyX3QgdGltZWxpbmVJRDsKLSAgICAgICAgICAgIHN0YXR1c190IHN0YXR1cyA9IGlzQ29tbW9uVGltZVZhbGlkKCZ2YWxpZCwgJnRpbWVsaW5lSUQpOwotICAgICAgICAgICAgcmVwbHktPndyaXRlSW50MzIoc3RhdHVzKTsKLSAgICAgICAgICAgIGlmIChzdGF0dXMgPT0gT0spIHsKLSAgICAgICAgICAgICAgICByZXBseS0+d3JpdGVJbnQzMih2YWxpZCk7Ci0gICAgICAgICAgICAgICAgcmVwbHktPndyaXRlSW50MzIodGltZWxpbmVJRCk7Ci0gICAgICAgICAgICB9Ci0gICAgICAgICAgICByZXR1cm4gT0s7Ci0gICAgICAgIH0gYnJlYWs7Ci0KLSAgICAgICAgY2FzZSBDT01NT05fVElNRV9UT19MT0NBTF9USU1FOiB7Ci0gICAgICAgICAgICBDSEVDS19JTlRFUkZBQ0UoSUNvbW1vbkNsb2NrLCBkYXRhLCByZXBseSk7Ci0gICAgICAgICAgICBpbnQ2NF90IGNvbW1vblRpbWUgPSBkYXRhLnJlYWRJbnQ2NCgpOwotICAgICAgICAgICAgaW50NjRfdCBsb2NhbFRpbWU7Ci0gICAgICAgICAgICBzdGF0dXNfdCBzdGF0dXMgPSBjb21tb25UaW1lVG9Mb2NhbFRpbWUoY29tbW9uVGltZSwgJmxvY2FsVGltZSk7Ci0gICAgICAgICAgICByZXBseS0+d3JpdGVJbnQzMihzdGF0dXMpOwotICAgICAgICAgICAgaWYgKHN0YXR1cyA9PSBPSykgewotICAgICAgICAgICAgICAgIHJlcGx5LT53cml0ZUludDY0KGxvY2FsVGltZSk7Ci0gICAgICAgICAgICB9Ci0gICAgICAgICAgICByZXR1cm4gT0s7Ci0gICAgICAgIH0gYnJlYWs7Ci0KLSAgICAgICAgY2FzZSBMT0NBTF9USU1FX1RPX0NPTU1PTl9USU1FOiB7Ci0gICAgICAgICAgICBDSEVDS19JTlRFUkZBQ0UoSUNvbW1vbkNsb2NrLCBkYXRhLCByZXBseSk7Ci0gICAgICAgICAgICBpbnQ2NF90IGxvY2FsVGltZSA9IGRhdGEucmVhZEludDY0KCk7Ci0gICAgICAgICAgICBpbnQ2NF90IGNvbW1vblRpbWU7Ci0gICAgICAgICAgICBzdGF0dXNfdCBzdGF0dXMgPSBsb2NhbFRpbWVUb0NvbW1vblRpbWUobG9jYWxUaW1lLCAmY29tbW9uVGltZSk7Ci0gICAgICAgICAgICByZXBseS0+d3JpdGVJbnQzMihzdGF0dXMpOwotICAgICAgICAgICAgaWYgKHN0YXR1cyA9PSBPSykgewotICAgICAgICAgICAgICAgIHJlcGx5LT53cml0ZUludDY0KGNvbW1vblRpbWUpOwotICAgICAgICAgICAgfQotICAgICAgICAgICAgcmV0dXJuIE9LOwotICAgICAgICB9IGJyZWFrOwotCi0gICAgICAgIGNhc2UgR0VUX0NPTU1PTl9USU1FOiB7Ci0gICAgICAgICAgICBDSEVDS19JTlRFUkZBQ0UoSUNvbW1vbkNsb2NrLCBkYXRhLCByZXBseSk7Ci0gICAgICAgICAgICBpbnQ2NF90IGNvbW1vblRpbWU7Ci0gICAgICAgICAgICBzdGF0dXNfdCBzdGF0dXMgPSBnZXRDb21tb25UaW1lKCZjb21tb25UaW1lKTsKLSAgICAgICAgICAgIHJlcGx5LT53cml0ZUludDMyKHN0YXR1cyk7Ci0gICAgICAgICAgICBpZiAoc3RhdHVzID09IE9LKSB7Ci0gICAgICAgICAgICAgICAgcmVwbHktPndyaXRlSW50NjQoY29tbW9uVGltZSk7Ci0gICAgICAgICAgICB9Ci0gICAgICAgICAgICByZXR1cm4gT0s7Ci0gICAgICAgIH0gYnJlYWs7Ci0KLSAgICAgICAgY2FzZSBHRVRfQ09NTU9OX0ZSRVE6IHsKLSAgICAgICAgICAgIENIRUNLX0lOVEVSRkFDRShJQ29tbW9uQ2xvY2ssIGRhdGEsIHJlcGx5KTsKLSAgICAgICAgICAgIHVpbnQ2NF90IGZyZXE7Ci0gICAgICAgICAgICBzdGF0dXNfdCBzdGF0dXMgPSBnZXRDb21tb25GcmVxKCZmcmVxKTsKLSAgICAgICAgICAgIHJlcGx5LT53cml0ZUludDMyKHN0YXR1cyk7Ci0gICAgICAgICAgICBpZiAoc3RhdHVzID09IE9LKSB7Ci0gICAgICAgICAgICAgICAgcmVwbHktPndyaXRlSW50NjQoZnJlcSk7Ci0gICAgICAgICAgICB9Ci0gICAgICAgICAgICByZXR1cm4gT0s7Ci0gICAgICAgIH0gYnJlYWs7Ci0KLSAgICAgICAgY2FzZSBHRVRfTE9DQUxfVElNRTogewotICAgICAgICAgICAgQ0hFQ0tfSU5URVJGQUNFKElDb21tb25DbG9jaywgZGF0YSwgcmVwbHkpOwotICAgICAgICAgICAgaW50NjRfdCBsb2NhbFRpbWU7Ci0gICAgICAgICAgICBzdGF0dXNfdCBzdGF0dXMgPSBnZXRMb2NhbFRpbWUoJmxvY2FsVGltZSk7Ci0gICAgICAgICAgICByZXBseS0+d3JpdGVJbnQzMihzdGF0dXMpOwotICAgICAgICAgICAgaWYgKHN0YXR1cyA9PSBPSykgewotICAgICAgICAgICAgICAgIHJlcGx5LT53cml0ZUludDY0KGxvY2FsVGltZSk7Ci0gICAgICAgICAgICB9Ci0gICAgICAgICAgICByZXR1cm4gT0s7Ci0gICAgICAgIH0gYnJlYWs7Ci0KLSAgICAgICAgY2FzZSBHRVRfTE9DQUxfRlJFUTogewotICAgICAgICAgICAgQ0hFQ0tfSU5URVJGQUNFKElDb21tb25DbG9jaywgZGF0YSwgcmVwbHkpOwotICAgICAgICAgICAgdWludDY0X3QgZnJlcTsKLSAgICAgICAgICAgIHN0YXR1c190IHN0YXR1cyA9IGdldExvY2FsRnJlcSgmZnJlcSk7Ci0gICAgICAgICAgICByZXBseS0+d3JpdGVJbnQzMihzdGF0dXMpOwotICAgICAgICAgICAgaWYgKHN0YXR1cyA9PSBPSykgewotICAgICAgICAgICAgICAgIHJlcGx5LT53cml0ZUludDY0KGZyZXEpOwotICAgICAgICAgICAgfQotICAgICAgICAgICAgcmV0dXJuIE9LOwotICAgICAgICB9IGJyZWFrOwotCi0gICAgICAgIGNhc2UgR0VUX0VTVElNQVRFRF9FUlJPUjogewotICAgICAgICAgICAgQ0hFQ0tfSU5URVJGQUNFKElDb21tb25DbG9jaywgZGF0YSwgcmVwbHkpOwotICAgICAgICAgICAgaW50MzJfdCBlcnJvcjsKLSAgICAgICAgICAgIHN0YXR1c190IHN0YXR1cyA9IGdldEVzdGltYXRlZEVycm9yKCZlcnJvcik7Ci0gICAgICAgICAgICByZXBseS0+d3JpdGVJbnQzMihzdGF0dXMpOwotICAgICAgICAgICAgaWYgKHN0YXR1cyA9PSBPSykgewotICAgICAgICAgICAgICAgIHJlcGx5LT53cml0ZUludDMyKGVycm9yKTsKLSAgICAgICAgICAgIH0KLSAgICAgICAgICAgIHJldHVybiBPSzsKLSAgICAgICAgfSBicmVhazsKLQotICAgICAgICBjYXNlIEdFVF9USU1FTElORV9JRDogewotICAgICAgICAgICAgQ0hFQ0tfSU5URVJGQUNFKElDb21tb25DbG9jaywgZGF0YSwgcmVwbHkpOwotICAgICAgICAgICAgdWludDY0X3QgaWQ7Ci0gICAgICAgICAgICBzdGF0dXNfdCBzdGF0dXMgPSBnZXRUaW1lbGluZUlEKCZpZCk7Ci0gICAgICAgICAgICByZXBseS0+d3JpdGVJbnQzMihzdGF0dXMpOwotICAgICAgICAgICAgaWYgKHN0YXR1cyA9PSBPSykgewotICAgICAgICAgICAgICAgIHJlcGx5LT53cml0ZUludDY0KHN0YXRpY19jYXN0PGludDY0X3Q+KGlkKSk7Ci0gICAgICAgICAgICB9Ci0gICAgICAgICAgICByZXR1cm4gT0s7Ci0gICAgICAgIH0gYnJlYWs7Ci0KLSAgICAgICAgY2FzZSBHRVRfU1RBVEU6IHsKLSAgICAgICAgICAgIENIRUNLX0lOVEVSRkFDRShJQ29tbW9uQ2xvY2ssIGRhdGEsIHJlcGx5KTsKLSAgICAgICAgICAgIFN0YXRlIHN0YXRlOwotICAgICAgICAgICAgc3RhdHVzX3Qgc3RhdHVzID0gZ2V0U3RhdGUoJnN0YXRlKTsKLSAgICAgICAgICAgIHJlcGx5LT53cml0ZUludDMyKHN0YXR1cyk7Ci0gICAgICAgICAgICBpZiAoc3RhdHVzID09IE9LKSB7Ci0gICAgICAgICAgICAgICAgcmVwbHktPndyaXRlSW50MzIoc3RhdGljX2Nhc3Q8aW50MzJfdD4oc3RhdGUpKTsKLSAgICAgICAgICAgIH0KLSAgICAgICAgICAgIHJldHVybiBPSzsKLSAgICAgICAgfSBicmVhazsKLQotICAgICAgICBjYXNlIEdFVF9NQVNURVJfQUREUkVTUzogewotICAgICAgICAgICAgQ0hFQ0tfSU5URVJGQUNFKElDb21tb25DbG9jaywgZGF0YSwgcmVwbHkpOwotICAgICAgICAgICAgc3RydWN0IHNvY2thZGRyX3N0b3JhZ2UgYWRkcjsKLSAgICAgICAgICAgIHN0YXR1c190IHN0YXR1cyA9IGdldE1hc3RlckFkZHIoJmFkZHIpOwotCi0gICAgICAgICAgICBpZiAoKHN0YXR1cyA9PSBPSykgJiYgIWNhblNlcmlhbGl6ZVNvY2thZGRyKCZhZGRyKSkgewotICAgICAgICAgICAgICAgIHN0YXR1cyA9IFVOS05PV05fRVJST1I7Ci0gICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgIHJlcGx5LT53cml0ZUludDMyKHN0YXR1cyk7Ci0KLSAgICAgICAgICAgIGlmIChzdGF0dXMgPT0gT0spIHsKLSAgICAgICAgICAgICAgICBzZXJpYWxpemVTb2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cmZhY2VEZXNjcmlwdG9yKCkpOwotICAgICAgICBzdGF0dXNfdCBzdGF0dXMgPSByZW1vdGUoKS0+dHJhbnNhY3QoR0VUX01BU1RFUl9FTEVDVElPTl9QUklPUklUWSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRhdGEsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmcmVwbHkpOwotICAgICAgICBpZiAoc3RhdHVzID09IE9LKSB7Ci0gICAgICAgICAgICBzdGF0dXMgPSByZXBseS5yZWFkSW50MzIoKTsKLSAgICAgICAgICAgIGlmIChzdGF0dXMgPT0gT0spIHsKLSAgICAgICAgICAgICAgICAqcHJpb3JpdHkgPSBzdGF0aWNfY2FzdDx1aW50OF90PihyZXBseS5yZWFkSW50MzIoKSk7Ci0gICAgICAgICAgICB9Ci0gICAgICAgIH0KLQotICAgICAgICByZXR1cm4gc3RhdHVzOwotICAgIH0KLQotICAgIHZpcnR1YWwgc3RhdHVzX3Qgc2V0TWFzdGVyRWxlY3Rpb25Qcmlvcml0eSh1aW50OF90IHByaW9yaXR5KSB7Ci0gICAgICAgIFBhcmNlbCBkYXRhLCByZXBseTsKLSAgICAgICAgZGF0YS53cml0ZUludGVyZmFjZVRva2VuKElDb21tb25UaW1lQ29uZmlnOjpnZXRJbnRlcmZhY2VEZXNjcmlwdG9yKCkpOwotICAgICAgICBkYXRhLndyaXRlSW50MzIoc3RhdGljX2Nhc3Q8aW50MzJfdD4ocHJpb3JpdHkpKTsKLSAgICAgICAgc3RhdHVzX3Qgc3RhdHVzID0gcmVtb3RlKCktPnRyYW5zYWN0KFNFVF9NQVNURVJfRUxFQ1RJT05fUFJJT1JJVFksCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBkYXRhLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJnJlcGx5KTsKLSAgICAgICAgaWYgKHN0YXR1cyA9PSBPSykgewotICAgICAgICAgICAgc3RhdHVzID0gcmVwbHkucmVhZEludDMyKCk7Ci0gICAgICAgIH0KLQotICAgICAgICByZXR1cm4gc3RhdHVzOwotICAgIH0KLQotICAgIHZpcnR1YWwgc3RhdHVzX3QgZ2V0TWFzdGVyRWxlY3Rpb25FbmRwb2ludChzdHJ1Y3Qgc29ja2FkZHJfc3RvcmFnZSAqYWRkcikgewotICAgICAgICBQYXJjZWwgZGF0YSwgcmVwbHk7Ci0gICAgICAgIGRhdGEud3JpdGVJbnRlcmZhY2VUb2tlbihJQ29tbW9uVGltZUNvbmZpZzo6Z2V0SW50ZXJmYWNlRGVzY3JpcHRvcigpKTsKLSAgICAgICAgc3RhdHVzX3Qgc3RhdHVzID0gcmVtb3RlKCktPnRyYW5zYWN0KEdFVF9NQVNURVJfRUxFQ1RJT05fRU5EUE9JTlQsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBkYXRhLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJnJlcGx5KTsKLSAgICAgICAgaWYgKHN0YXR1cyA9PSBPSykgewotICAgICAgICAgICAgc3RhdHVzID0gcmVwbHkucmVhZEludDMyKCk7Ci0gICAgICAgICAgICBpZiAoc3RhdHVzID09IE9LKSB7Ci0gICAgICAgICAgICAgICAgZGVzZXJpYWxpemVTb2NrYWRkcigmcmVwbHksIGFkZHIpOwotICAgICAgICAgICAgfQotICAgICAgICB9Ci0KLSAgICAgICAgcmV0dXJuIHN0YXR1czsKLSAgICB9Ci0KLSAgICB2aXJ0dWFsIHN0YXR1c190IHNldE1hc3RlckVsZWN0aW9uRW5kcG9pbnQoCi0gICAgICAgICAgICBjb25zdCBzdHJ1Y3Qgc29ja2FkZHJfc3RvcmFnZSAqYWRkcikgewotICAgICAgICBQYXJjZWwgZGF0YSwgcmVwbHk7Ci0gICAgICAgIGRhdGEud3JpdGVJbnRlcmZhY2VUb2tlbihJQ29tbW9uVGltZUNvbmZpZzo6Z2V0SW50ZXJmYWNlRGVzY3JpcHRvcigpKTsKLSAgICAgICAgaWYgKCFjYW5TZXJpYWxpemVTb2NrYWRkcihhZGRyKSkKLSAgICAgICAgICAgIHJldHVybiBCQURfVkFMVUU7Ci0gICAgICAgIGlmIChOVUxMID09IGFkZHIpIHsKLSAgICAgICAgICAgIGRhdGEud3JpdGVJbnQzMigwKTsKLSAgICAgICAgfSBlbHNlIHsKLSAgICAgICAgICAgIGRhdGEud3JpdGVJbnQzMigxKTsKLSAgICAgICAgICAgIHNlcmlhbGl6ZVNvY2thZGRyKCZkYXRhLCBhZGRyKTsKLSAgICAgICAgfQotICAgICAgICBzdGF0dXNfdCBzdGF0dXMgPSByZW1vdGUoKS0+dHJhbnNhY3QoU0VUX01BU1RFUl9FTEVDVElPTl9FTkRQT0lOVCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRhdGEsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmcmVwbHkpOwotICAgICAgICBpZiAoc3RhdHVzID09IE9LKSB7Ci0gICAgICAgICAgICBzdGF0dXMgPSByZXBseS5yZWFkSW50MzIoKTsKLSAgICAgICAgfQotCi0gICAgICAgIHJldHVybiBzdGF0dXM7Ci0gICAgfQotCi0gICAgdmlydHVhbCBzdGF0dXNfdCBnZXRNYXN0ZXJFbGVjdGlvbkdyb3VwSWQodWludDY0X3QgKmlkKSB7Ci0gICAgICAgIFBhcmNlbCBkYXRhLCByZXBseTsKLSAgICAgICAgZGF0YS53cml0ZUludGVyZmFjZVRva2VuKElDb21tb25UaW1lQ29uZmlnOjpnZXRJbnRlcmZhY2VEZXNjcmlwdG9yKCkpOwotICAgICAgICBzdGF0dXNfdCBzdGF0dXMgPSByZW1vdGUoKS0+dHJhbnNhY3QoR0VUX01BU1RFUl9FTEVDVElPTl9HUk9VUF9JRCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRhdGEsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmcmVwbHkpOwotCi0gICAgICAgIGlmIChzdGF0dXMgPT0gT0spIHsKLSAgICAgICAgICAgIHN0YXR1cyA9IHJlcGx5LnJlYWRJbnQzMigpOwotICAgICAgICAgICAgaWYgKHN0YXR1cyA9PSBPSykgewotICAgICAgICAgICAgICAgICppZCA9IHN0YXRpY19jYXN0PHVpbnQ2NF90PihyZXBseS5yZWFkSW50NjQoKSk7Ci0gICAgICAgICAgICB9Ci0gICAgICAgIH0KLQotICAgICAgICByZXR1cm4gc3RhdHVzOwotICAgIH0KLQotICAgIHZpcnR1YWwgc3RhdHVzX3Qgc2V0TWFzdGVyRWxlY3Rpb25Hcm91cElkKHVpbnQ2NF90IGlkKSB7Ci0gICAgICAgIFBhcmNlbCBkYXRhLCByZXBseTsKLSAgICAgICAgZGF0YS53cml0ZUludGVyZmFjZVRva2VuKElDb21tb25UaW1lQ29uZmlnOjpnZXRJbnRlcmZhY2VEZXNjcmlwdG9yKCkpOwotICAgICAgICBkYXRhLndyaXRlSW50NjQoaWQpOwotICAgICAgICBzdGF0dXNfdCBzdGF0dXMgPSByZW1vdGUoKS0+dHJhbnNhY3QoU0VUX01BU1RFUl9FTEVDVElPTl9HUk9VUF9JRCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRhdGEsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmcmVwbHkpOwotCi0gICAgICAgIGlmIChzdGF0dXMgPT0gT0spIHsKLSAgICAgICAgICAgIHN0YXR1cyA9IHJlcGx5LnJlYWRJbnQzMigpOwotICAgICAgICB9Ci0KLSAgICAgICAgcmV0dXJuIHN0YXR1czsKLSAgICB9Ci0KLSAgICB2aXJ0dWFsIHN0YXR1c190IGdldEludGVyZmFjZUJpbmRpbmcoU3RyaW5nMTYmIGlmYWNlTmFtZSkgewotICAgICAgICBQYXJjZWwgZGF0YSwgcmVwbHk7Ci0gICAgICAgIGRhdGEud3JpdGVJbnRlcmZhY2VUb2tlbihJQ29tbW9uVGltZUNvbmZpZzo6Z2V0SW50ZXJmYWNlRGVzY3JpcHRvcigpKTsKLSAgICAgICAgc3RhdHVzX3Qgc3RhdHVzID0gcmVtb3RlKCktPnRyYW5zYWN0KEdFVF9JTlRFUkZBQ0VfQklORElORywKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRhdGEsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmcmVwbHkpOwotICAgICAgICBpZiAoc3RhdHVzID09IE9LKSB7Ci0gICAgICAgICAgICBzdGF0dXMgPSByZXBseS5yZWFkSW50MzIoKTsKLSAgICAgICAgICAgIGlmIChzdGF0dXMgPT0gT0spIHsKLSAgICAgICAgICAgICAgICBpZmFjZU5hbWUgPSByZXBseS5yZWFkU3RyaW5nMTYoKTsKLSAgICAgICAgICAgIH0KLSAgICAgICAgfQotCi0gICAgICAgIHJldHVybiBzdGF0dXM7Ci0gICAgfQotCi0gICAgdmlydHVhbCBzdGF0dXNfdCBzZXRJbnRlcmZhY2VCaW5kaW5nKGNvbnN0IFN0cmluZzE2JiBpZmFjZU5hbWUpIHsKLSAgICAgICAgUGFyY2VsIGRhdGEsIHJlcGx5OwotICAgICAgICBkYXRhLndyaXRlSW50ZXJmYWNlVG9rZW4oSUNvbW1vblRpbWVDb25maWc6OmdldEludGVyZmFjZURlc2NyaXB0b3IoKSk7Ci0gICAgICAgIGRhdGEud3JpdGVTdHJpbmcxNihpZmFjZU5hbWUpOwotICAgICAgICBzdGF0dXNfdCBzdGF0dXMgPSByZW1vdGUoKS0+dHJhbnNhY3QoU0VUX0lOVEVSRkFDRV9CSU5ESU5HLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZGF0YSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICZyZXBseSk7Ci0gICAgICAgIGlmIChzdGF0dXMgPT0gT0spIHsKLSAgICAgICAgICAgIHN0YXR1cyA9IHJlcGx5LnJlYWRJbnQzMigpOwotICAgICAgICB9Ci0KLSAgICAgICAgcmV0dXJuIHN0YXR1czsKLSAgICB9Ci0KLSAgICB2aXJ0dWFsIHN0YXR1c190IGdldE1hc3RlckFubm91bmNlSW50ZXJ2YWwoaW50ICppbnRlcnZhbCkgewotICAgICAgICBQYXJjZWwgZGF0YSwgcmVwbHk7Ci0gICAgICAgIGRhdGEud3JpdGVJbnRlcmZhY2VUb2tlbihJQ29tbW9uVGltZUNvbmZpZzo6Z2V0SW50ZXJmYWNlRGVzY3JpcHRvcigpKTsKLSAgICAgICAgc3RhdHVzX3Qgc3RhdHVzID0gcmVtb3RlKCktPnRyYW5zYWN0KEdFVF9NQVNURVJfQU5OT1VOQ0VfSU5URVJWQUwsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBkYXRhLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJnJlcGx5KTsKLSAgICAgICAgaWYgKHN0YXR1cyA9PSBPSykgewotICAgICAgICAgICAgc3RhdHVzID0gcmVwbHkucmVhZEludDMyKCk7Ci0gICAgICAgICAgICBpZiAoc3RhdHVzID09IE9LKSB7Ci0gICAgICAgICAgICAgICAgKmludGVydmFsID0gcmVwbHkucmVhZEludDMyKCk7Ci0gICAgICAgICAgICB9Ci0gICAgICAgIH0KLQotICAgICAgICByZXR1cm4gc3RhdHVzOwotICAgIH0KLQotICAgIHZpcnR1YWwgc3RhdHVzX3Qgc2V0TWFzdGVyQW5ub3VuY2VJbnRlcnZhbChpbnQgaW50ZXJ2YWwpIHsKLSAgICAgICAgUGFyY2VsIGRhdGEsIHJlcGx5OwotICAgICAgICBkYXRhLndyaXRlSW50ZXJmYWNlVG9rZW4oSUNvbW1vblRpbWVDb25maWc6OmdldEludGVyZmFjZURlc2NyaXB0b3IoKSk7Ci0gICAgICAgIGRhdGEud3JpdGVJbnQzMihpbnRlcnZhbCk7Ci0gICAgICAgIHN0YXR1c190IHN0YXR1cyA9IHJlbW90ZSgpLT50cmFuc2FjdChTRVRfTUFTVEVSX0FOTk9VTkNFX0lOVEVSVkFMLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZGF0YSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICZyZXBseSk7Ci0gICAgICAgIGlmIChzdGF0dXMgPT0gT0spIHsKLSAgICAgICAgICAgIHN0YXR1cyA9IHJlcGx5LnJlYWRJbnQzMigpOwotICAgICAgICB9Ci0KLSAgICAgICAgcmV0dXJuIHN0YXR1czsKLSAgICB9Ci0KLSAgICB2aXJ0dWFsIHN0YXR1c190IGdldENsaWVudFN5bmNJbnRlcnZhbChpbnQgKmludGVydmFsKSB7Ci0gICAgICAgIFBhcmNlbCBkYXRhLCByZXBseTsKLSAgICAgICAgZGF0YS53cml0ZUludGVyZmFjZVRva2VuKElDb21tb25UaW1lQ29uZmlnOjpnZXRJbnRlcmZhY2VEZXNjcmlwdG9yKCkpOwotICAgICAgICBzdGF0dXNfdCBzdGF0dXMgPSByZW1vdGUoKS0+dHJhbnNhY3QoR0VUX0NMSUVOVF9TWU5DX0lOVEVSVkFMLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZGF0YSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICZyZXBseSk7Ci0gICAgICAgIGlmIChzdGF0dXMgPT0gT0spIHsKLSAgICAgICAgICAgIHN0YXR1cyA9IHJlcGx5LnJlYWRJbnQzMigpOwotICAgICAgICAgICAgaWYgKHN0YXR1cyA9PSBPSykgewotICAgICAgICAgICAgICAgICppbnRlcnZhbCA9IHJlcGx5LnJlYWRJbnQzMigpOwotICAgICAgICAgICAgfQotICAgICAgICB9Ci0KLSAgICAgICAgcmV0dXJuIHN0YXR1czsKLSAgICB9Ci0KLSAgICB2aXJ0dWFsIHN0YXR1c190IHNldENsaWVudFN5bmNJbnRlcnZhbChpbnQgaW50ZXJ2YWwpIHsKLSAgICAgICAgUGFyY2VsIGRhdGEsIHJlcGx5OwotICAgICAgICBkYXRhLndyaXRlSW50ZXJmYWNlVG9rZW4oSUNvbW1vblRpbWVDb25maWc6OmdldEludGVyZmFjZURlc2NyaXB0b3IoKSk7Ci0gICAgICAgIGRhdGEud3JpdGVJbnQzMihpbnRlcnZhbCk7Ci0gICAgICAgIHN0YXR1c190IHN0YXR1cyA9IHJlbW90ZSgpLT50cmFuc2FjdChTRVRfQ0xJRU5UX1NZTkNfSU5URVJWQUwsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBkYXRhLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJnJlcGx5KTsKLSAgICAgICAgaWYgKHN0YXR1cyA9PSBPSykgewotICAgICAgICAgICAgc3RhdHVzID0gcmVwbHkucmVhZEludDMyKCk7Ci0gICAgICAgIH0KLQotICAgICAgICByZXR1cm4gc3RhdHVzOwotICAgIH0KLQotICAgIHZpcnR1YWwgc3RhdHVzX3QgZ2V0UGFuaWNUaHJlc2hvbGQoaW50ICp0aHJlc2hvbGQpIHsKLSAgICAgICAgUGFyY2VsIGRhdGEsIHJlcGx5OwotICAgICAgICBkYXRhLndyaXRlSW50ZXJmYWNlVG9rZW4oSUNvbW1vblRpbWVDb25maWc6OmdldEludGVyZmFjZURlc2NyaXB0b3IoKSk7Ci0gICAgICAgIHN0YXR1c190IHN0YXR1cyA9IHJlbW90ZSgpLT50cmFuc2FjdChHRVRfUEFOSUNfVEhSRVNIT0xELAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZGF0YSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICZyZXBseSk7Ci0gICAgICAgIGlmIChzdGF0dXMgPT0gT0spIHsKLSAgICAgICAgICAgIHN0YXR1cyA9IHJlcGx5LnJlYWRJbnQzMigpOwotICAgICAgICAgICAgaWYgKHN0YXR1cyA9PSBPSykgewotICAgICAgICAgICAgICAgICp0aHJlc2hvbGQgPSByZXBseS5yZWFkSW50MzIoKTsKLSAgICAgICAgICAgIH0KLSAgICAgICAgfQotCi0gICAgICAgIHJldHVybiBzdGF0dXM7Ci0gICAgfQotCi0gICAgdmlydHVhbCBzdGF0dXNfdCBzZXRQYW5pY1RocmVzaG9sZChpbnQgdGhyZXNob2xkKSB7Ci0gICAgICAgIFBhcmNlbCBkYXRhLCByZXBseTsKLSAgICAgICAgZGF0YS53cml0ZUludGVyZmFjZVRva2VuKElDb21tb25UaW1lQ29uZmlnOjpnZXRJbnRlcmZhY2VEZXNjcmlwdG9yKCkpOwotICAgICAgICBkYXRhLndyaXRlSW50MzIodGhyZXNob2xkKTsKLSAgICAgICAgc3RhdHVzX3Qgc3RhdHVzID0gcmVtb3RlKCktPnRyYW5zYWN0KFNFVF9QQU5JQ19USFJFU0hPTEQsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBkYXRhLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJnJlcGx5KTsKLSAgICAgICAgaWYgKHN0YXR1cyA9PSBPSykgewotICAgICAgICAgICAgc3RhdHVzID0gcmVwbHkucmVhZEludDMyKCk7Ci0gICAgICAgIH0KLQotICAgICAgICByZXR1cm4gc3RhdHVzOwotICAgIH0KLQotICAgIHZpcnR1YWwgc3RhdHVzX3QgZ2V0QXV0b0Rpc2FibGUoYm9vbCAqYXV0b0Rpc2FibGUpIHsKLSAgICAgICAgUGFyY2VsIGRhdGEsIHJlcGx5OwotICAgICAgICBkYXRhLndyaXRlSW50ZXJmYWNlVG9rZW4oSUNvbW1vblRpbWVDb25maWc6OmdldEludGVyZmFjZURlc2NyaXB0b3IoKSk7Ci0gICAgICAgIHN0YXR1c190IHN0YXR1cyA9IHJlbW90ZSgpLT50cmFuc2FjdChHRVRfQVVUT19ESVNBQkxFLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZGF0YSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICZyZXBseSk7Ci0gICAgICAgIGlmIChzdGF0dXMgPT0gT0spIHsKLSAgICAgICAgICAgIHN0YXR1cyA9IHJlcGx5LnJlYWRJbnQzMigpOwotICAgICAgICAgICAgaWYgKHN0YXR1cyA9PSBPSykgewotICAgICAgICAgICAgICAgICphdXRvRGlzYWJsZSA9ICgwICE9IHJlcGx5LnJlYWRJbnQzMigpKTsKLSAgICAgICAgICAgIH0KLSAgICAgICAgfQotCi0gICAgICAgIHJldHVybiBzdGF0dXM7Ci0gICAgfQotCi0gICAgdmlydHVhbCBzdGF0dXNfdCBzZXRBdXRvRGlzYWJsZShib29sIGF1dG9EaXNhYmxlKSB7Ci0gICAgICAgIFBhcmNlbCBkYXRhLCByZXBseTsKLSAgICAgICAgZGF0YS53cml0ZUludGVyZmFjZVRva2VuKElDb21tb25UaW1lQ29uZmlnOjpnZXRJbnRlcmZhY2VEZXNjcmlwdG9yKCkpOwotICAgICAgICBkYXRhLndyaXRlSW50MzIoYXV0b0Rpc2FibGUgPyAxIDogMCk7Ci0gICAgICAgIHN0YXR1c190IHN0YXR1cyA9IHJlbW90ZSgpLT50cmFuc2FjdChTRVRfQVVUT19ESVNBQkxFLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZGF0YSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICZyZXBseSk7Ci0KLSAgICAgICAgaWYgKHN0YXR1cyA9PSBPSykgewotICAgICAgICAgICAgc3RhdHVzID0gcmVwbHkucmVhZEludDMyKCk7Ci0gICAgICAgIH0KLQotICAgICAgICByZXR1cm4gc3RhdHVzOwotICAgIH0KLQotICAgIHZpcnR1YWwgc3RhdHVzX3QgZm9yY2VOZXR3b3JrbGVzc01hc3Rlck1vZGUoKSB7Ci0gICAgICAgIFBhcmNlbCBkYXRhLCByZXBseTsKLSAgICAgICAgZGF0YS53cml0ZUludGVyZmFjZVRva2VuKElDb21tb25UaW1lQ29uZmlnOjpnZXRJbnRlcmZhY2VEZXNjcmlwdG9yKCkpOwotICAgICAgICBzdGF0dXNfdCBzdGF0dXMgPSByZW1vdGUoKS0+dHJhbnNhY3QoRk9SQ0VfTkVUV09SS0xFU1NfTUFTVEVSX01PREUsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBkYXRhLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJnJlcGx5KTsKLQotICAgICAgICBpZiAoc3RhdHVzID09IE9LKSB7Ci0gICAgICAgICAgICBzdGF0dXMgPSByZXBseS5yZWFkSW50MzIoKTsKLSAgICAgICAgfQotCi0gICAgICAgIHJldHVybiBzdGF0dXM7Ci0gICAgfQotfTsKLQotSU1QTEVNRU5UX01FVEFfSU5URVJGQUNFKENvbW1vblRpbWVDb25maWcsICJhbmRyb2lkLm9zLklDb21tb25UaW1lQ29uZmlnIik7Ci0KLXN0YXR1c190IEJuQ29tbW9uVGltZUNvbmZpZzo6b25UcmFuc2FjdCh1aW50MzJfdCBjb2RlLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb25zdCBQYXJjZWwmIGRhdGEsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFBhcmNlbCogcmVwbHksCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHVpbnQzMl90IGZsYWdzKSB7Ci0gICAgc3dpdGNoKGNvZGUpIHsKLSAgICAgICAgY2FzZSBHRVRfTUFTVEVSX0VMRUNUSU9OX1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b3JhZ2UgYWRkcjsKLSAgICAgICAgICAgIHN0YXR1c190IHN0YXR1cyA9IGdldE1hc3RlckVsZWN0aW9uRW5kcG9pbnQoJmFkZHIpOwotCi0gICAgICAgICAgICBpZiAoKHN0YXR1cyA9PSBPSykgJiYgIWNhblNlcmlhbGl6ZVNvY2thZGRyKCZhZGRyKSkgewotICAgICAgICAgICAgICAgIHN0YXR1cyA9IFVOS05PV05fRVJST1I7Ci0gICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgIHJlcGx5LT53cml0ZUludDMyKHN0YXR1cyk7Ci0KLSAgICAgICAgICAgIGlmIChzdGF0dXMgPT0gT0spIHsKLSAgICAgICAgICAgICAgICBzZXJpYWxpemVTb2NrYWRkcihyZXBseSwgJmFkZHIpOwotICAgICAgICAgICAgfQotCi0gICAgICAgICAgICByZXR1cm4gT0s7Ci0gICAgICAgIH0gYnJlYWs7Ci0KLSAgICAgICAgY2FzZSBTRVRfTUFTVEVSX0VMRUNUSU9OX0VORFBPSU5UOiB7Ci0gICAgICAgICAgICBDSEVDS19JTlRFUkZBQ0UoSUNvbW1vblRpbWVDb25maWcsIGRhdGEsIHJlcGx5KTsKLSAgICAgICAgICAgIHN0cnVjdCBzb2NrYWRkcl9zdG9yYWdlIGFkZHI7Ci0gICAgICAgICAgICBpbnQgaGFzQWRkciA9IGRhdGEucmVhZEludDMyKCk7Ci0KLSAgICAgICAgICAgIHN0YXR1c190IHN0YXR1czsKLSAgICAgICAgICAgIGlmIChoYXNBZGRyKSB7Ci0gICAgICAgICAgICAgICAgZGVzZXJpYWxpemVTb2NrYWRkcigmZGF0YSwgJmFkZHIpOwotICAgICAgICAgICAgICAgIHN0YXR1cyA9IHNldE1hc3RlckVsZWN0aW9uRW5kcG9pbnQoJmFkZHIpOwotICAgICAgICAgICAgfSBlbHNlIHsKLSAgICAgICAgICAgICAgICBzdGF0dXMgPSBzZXRNYXN0ZXJFbGVjdGlvbkVuZHBvaW50KCZhZGRyKTsKLSAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgcmVwbHktPndyaXRlSW50MzIoc3RhdHVzKTsKLSAgICAgICAgICAgIHJldHVybiBPSzsKLSAgICAgICAgfSBicmVhazsKLQotICAgICAgICBjYXNlIEdFVF9NQVNURVJfRUxFQ1RJT05fR1JPVVBfSUQ6IHsKLSAgICAgICAgICAgIENIRUNLX0lOVEVSRkFDRShJQ29tbW9uVGltZUNvbmZpZywgZGF0YSwgcmVwbHkpOwotICAgICAgICAgICAgdWludDY0X3QgaWQ7Ci0gICAgICAgICAgICBzdGF0dXNfdCBzdGF0dXMgPSBnZXRNYXN0ZXJFbGVjdGlvbkdyb3VwSWQoJmlkKTsKLSAgICAgICAgICAgIHJlcGx5LT53cml0ZUludDMyKHN0YXR1cyk7Ci0gICAgICAgICAgICBpZiAoc3RhdHVzID09IE9LKSB7Ci0gICAgICAgICAgICAgICAgcmVwbHktPndyaXRlSW50NjQoaWQpOwotICAgICAgICAgICAgfQotICAgICAgICAgICAgcmV0dXJuIE9LOwotICAgICAgICB9IGJyZWFrOwotCi0gICAgICAgIGNhc2UgU0VUX01BU1RFUl9FTEVDVElPTl9HUk9VUF9JRDogewotICAgICAgICAgICAgQ0hFQ0tfSU5URVJGQUNFKElDb21tb25UaW1lQ29uZmlnLCBkYXRhLCByZXBseSk7Ci0gICAgICAgICAgICB1aW50NjRfdCBpZCA9IHN0YXRpY19jYXN0PHVpbnQ2NF90PihkYXRhLnJlYWRJbnQ2NCgpKTsKLSAgICAgICAgICAgIHN0YXR1c190IHN0YXR1cyA9IHNldE1hc3RlckVsZWN0aW9uR3JvdXBJZChpZCk7Ci0gICAgICAgICAgICByZXBseS0+d3JpdGVJbnQzMihzdGF0dXMpOwotICAgICAgICAgICAgcmV0dXJuIE9LOwotICAgICAgICB9IGJyZWFrOwotCi0gICAgICAgIGNhc2UgR0VUX0lOVEVSRkFDRV9CSU5ESU5HOiB7Ci0gICAgICAgICAgICBDSEVDS19JTlRFUkZBQ0UoSUNvbW1vblRpbWVDb25maWcsIGRhdGEsIHJlcGx5KTsKLSAgICAgICAgICAgIFN0cmluZzE2IHJldDsKLSAgICAgICAgICAgIHN0YXR1c190IHN0YXR1cyA9IGdldEludGVyZmFjZUJpbmRpbmcocmV0KTsKLSAgICAgICAgICAgIHJlcGx5LT53cml0ZUludDMyKHN0YXR1cyk7Ci0gICAgICAgICAgICBpZiAoc3RhdHVzID09IE9LKSB7Ci0gICAgICAgICAgICAgICAgcmVwbHktPndyaXRlU3RyaW5nMTYocmV0KTsKLSAgICAgICAgICAgIH0KLSAgICAgICAgICAgIHJldHVybiBPSzsKLSAgICAgICAgfSBicmVhazsKLQotICAgICAgICBjYXNlIFNFVF9JTlRFUkZBQ0VfQklORElORzogewotICAgICAgICAgICAgQ0hFQ0tfSU5URVJGQUNFKElDb21tb25UaW1lQ29uZmlnLCBkYXRhLCByZXBseSk7Ci0gICAgICAgICAgICBTdHJpbmcxNiBpZmFjZU5hbWU7Ci0gICAgICAgICAgICBpZmFjZU5hbWUgPSBkYXRhLnJlYWRTdHJpbmcxNigpOwotICAgICAgICAgICAgc3RhdHVzX3Qgc3RhdHVzID0gc2V0SW50ZXJmYWNlQmluZGluZyhpZmFjZU5hbWUpOwotICAgICAgICAgICAgcmVwbHktPndyaXRlSW50MzIoc3RhdHVzKTsKLSAgICAgICAgICAgIHJldHVybiBPSzsKLSAgICAgICAgfSBicmVhazsKLQotICAgICAgICBjYXNlIEdFVF9NQVNURVJfQU5OT1VOQ0VfSU5URVJWQUw6IHsKLSAgICAgICAgICAgIENIRUNLX0lOVEVSRkFDRShJQ29tbW9uVGltZUNvbmZpZywgZGF0YSwgcmVwbHkpOwotICAgICAgICAgICAgaW50IGludGVydmFsOwotICAgICAgICAgICAgc3RhdHVzX3Qgc3RhdHVzID0gZ2V0TWFzdGVyQW5ub3VuY2VJbnRlcnZhbCgmaW50ZXJ2YWwpOwotICAgICAgICAgICAgcmVwbHktPndyaXRlSW50MzIoc3RhdHVzKTsKLSAgICAgICAgICAgIGlmIChzdGF0dXMgPT0gT0spIHsKLSAgICAgICAgICAgICAgICByZXBseS0+d3JpdGVJbnQzMihpbnRlcnZhbCk7Ci0gICAgICAgICAgICB9Ci0gICAgICAgICAgICByZXR1cm4gT0s7Ci0gICAgICAgIH0gYnJlYWs7Ci0KLSAgICAgICAgY2FzZSBTRVRfTUFTVEVSX0FOTk9VTkNFX0lOVEVSVkFMOiB7Ci0gICAgICAgICAgICBDSEVDS19JTlRFUkZBQ0UoSUNvbW1vblRpbWVDb25maWcsIGRhdGEsIHJlcGx5KTsKLSAgICAgICAgICAgIGludCBpbnRlcnZhbCA9IGRhdGEucmVhZEludDMyKCk7Ci0gICAgICAgICAgICBzdGF0dXNfdCBzdGF0dXMgPSBzZXRNYXN0ZXJBbm5vdW5jZUludGVydmFsKGludGVydmFsKTsKLSAgICAgICAgICAgIHJlcGx5LT53cml0ZUludDMyKHN0YXR1cyk7Ci0gICAgICAgICAgICByZXR1cm4gT0s7Ci0gICAgICAgIH0gYnJlYWs7Ci0KLSAgICAgICAgY2FzZSBHRVRfQ0xJRU5UX1NZTkNfSU5URVJWQUw6IHsKLSAgICAgICAgICAgIENIRUNLX0lOVEVSRkFDRShJQ29tbW9uVGltZUNvbmZpZywgZGF0YSwgcmVwbHkpOwotICAgICAgICAgICAgaW50IGludGVydmFsOwotICAgICAgICAgICAgc3RhdHVzX3Qgc3RhdHVzID0gZ2V0Q2xpZW50U3luY0ludGVydmFsKCZpbnRlcnZhbCk7Ci0gICAgICAgICAgICByZXBseS0+d3JpdGVJbnQzMihzdGF0dXMpOwotICAgICAgICAgICAgaWYgKHN0YXR1cyA9PSBPSykgewotICAgICAgICAgICAgICAgIHJlcGx5LT53cml0ZUludDMyKGludGVydmFsKTsKLSAgICAgICAgICAgIH0KLSAgICAgICAgICAgIHJldHVybiBPSzsKLSAgICAgICAgfSBicmVhazsKLQotICAgICAgICBjYXNlIFNFVF9DTElFTlRfU1lOQ19JTlRFUlZBTDogewotICAgICAgICAgICAgQ0hFQ0tfSU5URVJGQUNFKElDb21tb25UaW1lQ29uZmlnLCBkYXRhLCByZXBseSk7Ci0gICAgICAgICAgICBpbnQgaW50ZXJ2YWwgPSBkYXRhLnJlYWRJbnQzMigpOwotICAgICAgICAgICAgc3RhdHVzX3Qgc3RhdHVzID0gc2V0Q2xpZW50U3luY0ludGVydmFsKGludGVydmFsKTsKLSAgICAgICAgICAgIHJlcGx5LT53cml0ZUludDMyKHN0YXR1cyk7Ci0gICAgICAgICAgICByZXR1cm4gT0s7Ci0gICAgICAgIH0gYnJlYWs7Ci0KLSAgICAgICAgY2FzZSBHRVRfUEFOSUNfVEhSRVNIT0xEOiB7Ci0gICAgICAgICAgICBDSEVDS19JTlRFUkZBQ0UoSUNvbW1vblRpbWVDb25maWcsIGRhdGEsIHJlcGx5KTsKLSAgICAgICAgICAgIGludCB0aHJlc2hvbGQ7Ci0gICAgICAgICAgICBzdGF0dXNfdCBzdGF0dXMgPSBnZXRQYW5pY1RocmVzaG9sZCgmdGhyZXNob2xkKTsKLSAgICAgICAgICAgIHJlcGx5LT53cml0ZUludDMyKHN0YXR1cyk7Ci0gICAgICAgICAgICBpZiAoc3RhdHVzID09IE9LKSB7Ci0gICAgICAgICAgICAgICAgcmVwbHktPndyaXRlSW50MzIodGhyZXNob2xkKTsKLSAgICAgICAgICAgIH0KLSAgICAgICAgICAgIHJldHVybiBPSzsKLSAgICAgICAgfSBicmVhazsKLQotICAgICAgICBjYXNlIFNFVF9QQU5JQ19USFJFU0hPTEQ6IHsKLSAgICAgICAgICAgIENIRUNLX0lOVEVSRkFDRShJQ29tbW9uVGltZUNvbmZpZywgZGF0YSwgcmVwbHkpOwotICAgICAgICAgICAgaW50IHRocmVzaG9sZCA9IGRhdGEucmVhZEludDMyKCk7Ci0gICAgICAgICAgICBzdGF0dXNfdCBzdGF0dXMgPSBzZXRQYW5pY1RocmVzaG9sZCh0aHJlc2hvbGQpOwotICAgICAgICAgICAgcmVwbHktPndyaXRlSW50MzIoc3RhdHVzKTsKLSAgICAgICAgICAgIHJldHVybiBPSzsKLSAgICAgICAgfSBicmVhazsKLQotICAgICAgICBjYXNlIEdFVF9BVVRPX0RJU0FCTEU6IHsKLSAgICAgICAgICAgIENIRUNLX0lOVEVSRkFDRShJQ29tbW9uVGltZUNvbmZpZywgZGF0YSwgcmVwbHkpOwotICAgICAgICAgICAgYm9vbCBhdXRvRGlzYWJsZTsKLSAgICAgICAgICAgIHN0YXR1c190IHN0YXR1cyA9IGdldEF1dG9EaXNhYmxlKCZhdXRvRGlzYWJsZSk7Ci0gICAgICAgICAgICByZXBseS0+d3JpdGVJbnQzMihzdGF0dXMpOwotICAgICAgICAgICAgaWYgKHN0YXR1cyA9PSBPSykgewotICAgICAgICAgICAgICAgIHJlcGx5LT53cml0ZUludDMyKGF1dG9EaXNhYmxlID8gMSA6IDApOwotICAgICAgICAgICAgfQotICAgICAgICAgICAgcmV0dXJuIE9LOwotICAgICAgICB9IGJyZWFrOwotCi0gICAgICAgIGNhc2UgU0VUX0FVVE9fRElTQUJMRTogewotICAgICAgICAgICAgQ0hFQ0tfSU5URVJGQUNFKElDb21tb25UaW1lQ29uZmlnLCBkYXRhLCByZXBseSk7Ci0gICAgICAgICAgICBib29sIGF1dG9EaXNhYmxlID0gKDAgIT0gZGF0YS5yZWFkSW50MzIoKSk7Ci0gICAgICAgICAgICBzdGF0dXNfdCBzdGF0dXMgPSBzZXRBdXRvRGlzYWJsZShhdXRvRGlzYWJsZSk7Ci0gICAgICAgICAgICByZXBseS0+d3JpdGVJbnQzMihzdGF0dXMpOwotICAgICAgICAgICAgcmV0dXJuIE9LOwotICAgICAgICB9IGJyZWFrOwotCi0gICAgICAgIGNhc2UgRk9SQ0VfTkVUV09SS0xFU1NfTUFTVEVSX01PREU6IHsKLSAgICAgICAgICAgIENIRUNLX0lOVEVSRkFDRShJQ29tbW9uVGltZUNvbmZpZywgZGF0YSwgcmVwbHkpOwotICAgICAgICAgICAgc3RhdHVzX3Qgc3RhdHV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iB0aGUgc2Vjb25kIGF0dGVtcHQgZmFpbHMsIG9yIG5vIGNvbm5lY3Rpb24gY2FuIGJlIG1hZGUsIHRoZSB3ZSBsZXQgdGhlCi0vLyBlcnJvciBwcm9wYWdhdGUgdXAgdGhlIHN0YWNrIGFuZCBsZXQgdGhlIGNhbGxlciBkZWFsIHdpdGggdGhlIHNpdHVhdGlvbiBhcwotLy8gYmVzdCB0aGV5IGNhbi4KLSNkZWZpbmUgQ0NIRUxQRVJfTUVUSE9EKGRlY2wsIGNhbGwpICAgICAgICAgICAgICAgICBcCi0gICAgc3RhdHVzX3QgQ0NIZWxwZXI6OmRlY2wgeyAgICAgICAgICAgICAgICAgICAgICAgXAotICAgICAgICBNdXRleDo6QXV0b2xvY2sgbG9jaygmbG9ja18pOyAgICAgICAgICAgICAgIFwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBcCi0gICAgICAgIGlmICghdmVyaWZ5Q2xvY2tfbCgpKSAgICAgICAgICAgICAgICAgICAgICAgXAotICAgICAgICAgICAgcmV0dXJuIERFQURfT0JKRUNUOyAgICAgICAgICAgICAgICAgICAgIFwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBcCi0gICAgICAgIHN0YXR1c190IHN0YXR1cyA9IGNvbW1vbl9jbG9ja18tPmNhbGw7ICAgICAgXAotICAgICAgICBpZiAoREVBRF9PQkpFQ1QgPT0gc3RhdHVzKSB7ICAgICAgICAgICAgICAgIFwKLSAgICAgICAgICAgIGlmICghdmVyaWZ5Q2xvY2tfbCgpKSAgICAgICAgICAgICAgICAgICBcCi0gICAgICAgICAgICAgICAgcmV0dXJuIERFQURfT0JKRUNUOyAgICAgICAgICAgICAgICAgXAotICAgICAgICAgICAgc3RhdHVzID0gY29tbW9uX2Nsb2NrXy0+Y2FsbDsgICAgICAgICAgIFwKLSAgICAgICAgfSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBcCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXAotICAgICAgICByZXR1cm4gc3RhdHVzOyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFwKLSAgICB9Ci0KLSNkZWZpbmUgVkVSSUZZX0NMT0NLKCkKLQotQ0NIRUxQRVJfTUVUSE9EKGlzQ29tbW9uVGltZVZhbGlkKGJvb2wqIHZhbGlkLCB1aW50MzJfdCogdGltZWxpbmVJRCksCi0gICAgICAgICAgICAgICAgaXNDb21tb25UaW1lVmFsaWQodmFsaWQsIHRpbWVsaW5lSUQpKQotQ0NIRUxQRVJfTUVUSE9EKGNvbW1vblRpbWVUb0xvY2FsVGltZShpbnQ2NF90IGNvbW1vblRpbWUsIGludDY0X3QqIGxvY2FsVGltZSksCi0gICAgICAgICAgICAgICAgY29tbW9uVGltZVRvTG9jYWxUaW1lKGNvbW1vblRpbWUsIGxvY2FsVGltZSkpCi1DQ0hFTFBFUl9NRVRIT0QobG9jYWxUaW1lVG9Db21tb25UaW1lKGludDY0X3QgbG9jYWxUaW1lLCBpbnQ2NF90KiBjb21tb25UaW1lKSwKLSAgICAgICAgICAgICAgICBsb2NhbFRpbWVUb0NvbW1vblRpbWUobG9jYWxUaW1lLCBjb21tb25UaW1lKSkKLUNDSEVMUEVSX01FVEhPRChnZXRDb21tb25UaW1lKGludDY0X3QqIGNvbW1vblRpbWUpLAotICAgICAgICAgICAgICAgIGdldENvbW1vblRpbWUoY29tbW9uVGltZSkpCi1DQ0hFTFBFUl9NRVRIT0QoZ2V0Q29tbW9uRnJlcSh1aW50NjRfdCogZnJlcSksCi0gICAgICAgICAgICAgICAgZ2V0Q29tbW9uRnJlcShmcmVxKSkKLUNDSEVMUEVSX01FVEhPRChnZXRMb2NhbFRpbWUoaW50NjRfdCogbG9jYWxUaW1lKSwKLSAgICAgICAgICAgICAgICBnZXRMb2NhbFRpbWUobG9jYWxUaW1lKSkKLUNDSEVM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ja2FkZHJfaW4qIHMgPQotICAgICAgICAgICAgICAgIHJlaW50ZXJwcmV0X2Nhc3Q8Y29uc3Qgc3RydWN0IHNvY2thZGRyX2luKj4oYWRkcik7Ci0gICAgICAgICAgICBwLT53cml0ZUludDMyKEFGX0lORVQpOwotICAgICAgICAgICAgcC0+d3JpdGVJbnQzMihudG9obChzLT5zaW5fYWRkci5zX2FkZHIpKTsKLSAgICAgICAgICAgIHAtPndyaXRlSW50MzIoc3RhdGljX2Nhc3Q8aW50MzJfdD4obnRvaHMocy0+c2luX3BvcnQpKSk7Ci0gICAgICAgIH0gYnJlYWs7Ci0KLSAgICAgICAgY2FzZSBBRl9JTkVUNjogewotICAgICAgICAgICAgY29uc3Qgc3RydWN0IHNvY2thZGRyX2luNiogcyA9Ci0gICAgICAgICAgICAgICAgcmVpbnRlcnByZXRfY2FzdDxjb25zdCBzdHJ1Y3Qgc29ja2FkZHJfaW42Kj4oYWRkcik7Ci0gICAgICAgICAgICBjb25zdCBpbnQzMl90KiBhID0KLSAgICAgICAgICAgICAgICByZWludGVycHJldF9jYXN0PGNvbnN0IGludDMyX3QqPihzLT5zaW42X2FkZHIuczZfYWRkcik7Ci0gICAgICAgICAgICBwLT53cml0ZUludDMyKEFGX0lORVQ2KTsKLSAgICAgICAgICAgIHAtPndyaXRlSW50MzIobnRvaGwoYVswXSkpOwotICAgICAgICAgICAgcC0+d3JpdGVJbnQzMihudG9obChhWzFdKSk7Ci0gICAgICAgICAgICBwLT53cml0ZUludDMyKG50b2hsKGFbMl0pKTsKLSAgICAgICAgICAgIHAtPndyaXRlSW50MzIobnRvaGwoYVszXSkpOwotICAgICAgICAgICAgcC0+d3JpdGVJbnQzMihzdGF0aWNfY2FzdDxpbnQzMl90PihudG9ocyhzLT5zaW42X3BvcnQpKSk7Ci0gICAgICAgICAgICBwLT53cml0ZUludDMyKG50b2hsKHMtPnNpbjZfZmxvd2luZm8pKTsKLSAgICAgICAgICAgIHAtPndyaXRlSW50MzIobnRvaGwoc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gICAgICAgICAgICAgICAgICAgIGhlaWdodCwgZGlydHksIGZsYWdzLCBsZXZlbCArIDEpOwogICAgICAgICAgICAgfQogICAgICAgICAgICAgYnJlYWs7CkBAIC05NzIsNiArOTUzLDkgQEAKICAgICAgICAgICAgICAgICBmbG9hdCB4ID0gZ2V0RmxvYXQoKTsKICAgICAgICAgICAgICAgICBmbG9hdCB5ID0gZ2V0RmxvYXQoKTsKICAgICAgICAgICAgICAgICBTa1BhaW50KiBwYWludCA9IGdldFBhaW50KHJlbmRlcmVyKTsKKyAgICAgICAgICAgICAgICBpZiAobUNhY2hpbmcgJiYgbU11bHRpcGxpZWRBbHBoYSA8IDI1NSkgeworICAgICAgICAgICAgICAgICAgICBwYWludC0+c2V0QWxwaGEobU11bHRpcGxpZWRBbHBoYSk7CisgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgIERJU1BMQVlfTElTVF9MT0dEKCIlcyVzICVwLCAlLjJmLCAlLjJmLCAlcCIsIChjaGFyKikgaW5kZW50LCBPUF9OQU1FU1tvcF0sCiAgICAgICAgICAgICAgICAgICAgICAgICBiaXRtYXAsIHgsIHksIHBhaW50KTsKICAgICAgICAgICAgICAgICByZW5kZXJlci5kcmF3Qml0bWFwKGJpdG1hcCwgeCwgeSwgcGFpbnQpOwpAQCAtMTIzMyw4ICsxMjE3LDggQEAKICAgICByZW5kZXJlci5lbmRNYXJrKCk7CiAKICAgICBESVNQTEFZX0xJU1RfTE9HRCgiJXNEb25lICglcCwgJXMpLCByZXR1cm5pbmcgJWQiLCAoY2hhciopIGluZGVudCArIDIsIHRoaXMsIG1OYW1lLnN0cmluZygpLAotICAgICAgICAgICAgbmVlZHNJbnZhbGlkYXRlKTsKLSAgICByZXR1cm4gbmVlZHNJbnZhbGlkYXRlOworICAgICAgICAgICAgZHJhd0dsU3RhdHVzKTsKKyAgICByZXR1cm4gZHJhd0dsU3RhdHVzOwogfQogCiAvLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy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ICBpZiAoKHVzYWdlICYgfihSU19BTExPQ0FUSU9OX1VTQUdFX1NDUklQVCB8Ci0gICAgICAgICAgICAgICAgICAgUlNfQUxMT0NBVElPTl9VU0FHRV9HUkFQSElDU19URVhUVVJFIHwKLSAgICAgICAgICAgICAgICAgICBSU19BTExPQ0FUSU9OX1VTQUdFX0dSQVBISUNTX1ZFUlRFWCB8Ci0gICAgICAgICAgICAgICAgICAgUlNfQUxMT0NBVElPTl9VU0FHRV9HUkFQSElDU19DT05TVEFOVFMgfAotICAgICAgICAgICAgICAgICAgIFJTX0FMTE9DQVRJT05fVVNBR0VfR1JBUEhJQ1NfUkVOREVSX1RBUkdFVCB8Ci0gICAgICAgICAgICAgICAgICAgUlNfQUxMT0NBVElPTl9VU0FHRV9JT19JTlBVVCB8Ci0gICAgICAgICAgICAgICAgICAgUlNfQUxMT0NBVElPTl9VU0FHRV9JT19PVVRQVVQpKSAhPSAwKSB7Ci0gICAgICAgIEFMT0dFKCJVbmtub3duIHVzYWdlIHNwZWNpZmllZC4iKTsKLSAgICB9Ci0KLSAgICBpZiAoKHVzYWdlICYgUlNfQUxMT0NBVElPTl9VU0FHRV9JT19JTlBVVCkgIT0gMCkgewotICAgICAgICBtV3JpdGVBbGxvd2VkID0gZmFsc2U7Ci0gICAgICAgIGlmICgodXNhZ2UgJiB+KFJTX0FMTE9DQVRJT05fVVNBR0VfSU9fSU5QVVQgfAotICAgICAgICAgICAgICAgICAgICAgICBSU19BTExPQ0FUSU9OX1VTQUdFX0dSQVBISUNTX1RFWFRVUkUgfAotICAgICAgICAgICAgICAgICAgICAgICBSU19BTExPQ0FUSU9OX1VTQUdFX1NDUklQVCkpICE9IDApIHsKLSAgICAgICAgICAgIEFMT0dFKCJJbnZhbGlkIHVzYWdlIGNvbWJpbmF0aW9uLiIpOwotICAgICAgICB9Ci0gICAgfQotCi0gICAgbVR5cGUgPSB0OwotICAgIG1Vc2FnZSA9IHVzYWdlOwotCi0gICAgaWYgKHQgIT0gTlVMT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YXBSZXNvdXJjZShSZW5kZXJTY3JpcHQgcnMsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFJlc291cmNlcyByZXMsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGludCBpZCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTWlwbWFwQ29udHJvbCBtaXBzLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpbnQgdXNhZ2UpIHsKLQotICAgIHJzLnZhbGlkYXRlKCk7Ci0gICAgQml0bWFwIGIgPSBCaXRtYXBGYWN0b3J5LmRlY29kZVJlc291cmNlKHJlcywgaWQpOwotICAgIEFsbG9jYXRpb24gYWxsb2MgPSBjcmVhdGVGcm9tQml0bWFwKHJzLCBiLCBtaXBzLCB1c2FnZSk7Ci0gICAgYi5yZWN5Y2xlKCk7Ci0gICAgcmV0dXJuIGFsbG9jOwotfQotCi1zdGF0aWMgQWxsb2NhdGlvbiBjcmVhdGVGcm9tQml0bWFwUmVzb3VyY2UoUmVuZGVyU2NyaXB0IHJzLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBSZXNvdXJjZXMgcmVzLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpbnQgaWQpIHsKLSAgICByZXR1cm4gY3JlYXRlRnJvbUJpdG1hcFJlc291cmNlKHJzLCByZXMsIGlkLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTWlwbWFwQ29udHJvbC5NSVBNQVBfTk9ORSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFVTQUdFX0dSQVBISUNTX1RFWFRVUkUpOwotfQotCi1zdGF0aWMgQWxsb2NhdGlvbiBjcmVhdGVGcm9tU3RyaW5nKFJlbmRlclNjcmlwdCBycywKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFN0cmluZyBzdHIsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpbnQgdXNhZ2UpIHsKLSAgICBycy52YWxpZGF0ZSgpOwotICAgIGJ5dGVbXSBhbGxvY0FycmF5ID0gTlVMTDsKLSAgICB0cnkgewotICAgICAgICBhbGxvY0FycmF5ID0gc3RyLmdldEJ5dGVzKCJVVEYtOCIpOwotICAgICAgICBBbGxvY2F0aW9uIGFsbG9jID0gQWxsb2NhdGlvbi5jcmVhdGVTaXplZChycywgRWxlbWVudC5VOChycyksIGFsbG9jQXJyYXkubGVuZ3RoLCB1c2FnZSk7Ci0gICAgICAgIGFsbG9jLmNvcHlGcm9tKGFsbG9jQXJyYXkpOwotICAgICAgICByZXR1cm4gYWxsb2M7Ci0gICAgfQotICAgIGNhdGNoIChFeGNlcHRpb24gZSkgewotICAgICAgICB0aHJvdyBuZXcgUlNSdW50aW1lRXhjZXB0aW9uKCJDb3VsZCBub3QgY29udmVydCBzdHJpbmcgdG8gdXRmLTguIik7Ci0gICAgfQotfQotKi8KLQpkaWZmIC0tZ2l0IGEvbGlicy9ycy9BbGxvY2F0aW9uLmggYi9saWJzL3JzL0FsbG9jYXRpb24uaApkZWxldGVkIGZpbGUgbW9kZSAxMDA2NDQKaW5kZXggYzllMDBhNC4uMDAwMDAwMAotLS0gYS9saWJzL3JzL0FsbG9jYXRpb24uaAorKysgL2Rldi9udWxsCkBAIC0xLDEyNiArMCwwIEBACi0vKgotICogQ29weXJpZ2h0IChDKSAyMDA4LTIwMTIgVGhlIEFuZHJvaWQgT3BlbiBTb3VyY2UgUHJvamVjdAotICoKLSAqIExpY2Vuc2VkIHVuZGVyIHRoZSBBcGFjaGUgTGljZW5zZSwgVmVyc2lvbiAyLjAgKHRoZSAiTGljZW5zZSIpOwotICogeW91IG1heSBub3QgdXNlIHRoaXMgZmlsZSBleGNlcHQgaW4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ZXMoKSkgewotICAgICAgICBpZihkay5tSUQgPT0gZGF0YUJ1ZmZlclsxXSl7Ci0gICAgICAgICAgICBtS2luZCA9IGRrOwotICAgICAgICB9Ci0gICAgfQotCi0gICAgaW50IG51bVN1YkVsZW1lbnRzID0gZGF0YUJ1ZmZlcls0XTsKLSAgICBpZihudW1TdWJFbGVtZW50cyA+IDApIHsKLSAgICAgICAgbUVsZW1lbnRzID0gbmV3IEVsZW1lbnRbbnVtU3ViRWxlbWVudHNdOwotICAgICAgICBtRWxlbWVudE5hbWVzID0gbmV3IFN0cmluZ1tudW1TdWJFbGVtZW50c107Ci0gICAgICAgIG1BcnJheVNpemVzID0gbmV3IGludFtudW1TdWJFbGVtZW50c107Ci0gICAgICAgIG1PZmZzZXRJbkJ5dGVzID0gbmV3IGludFtudW1TdWJFbGVtZW50c107Ci0KLSAgICAgICAgaW50W10gc3ViRWxlbWVudElkcyA9IG5ldyBpbnRbbnVtU3ViRWxlbWVudHNdOwotICAgICAgICBtUlMubkVsZW1lbnRHZXRTdWJFbGVtZW50cyhnZXRJRCgpLCBzdWJFbGVtZW50SWRzLCBtRWxlbWVudE5hbWVzLCBtQXJyYXlTaXplcyk7Ci0gICAgICAgIGZvcihpbnQgaSA9IDA7IGkgPCBudW1TdWJFbGVtZW50czsgaSArKykgewotICAgICAgICAgICAgbUVsZW1lbnRzW2ldID0gbmV3IEVsZW1lbnQoc3ViRWxlbWVudElkc1tpXSwgbVJTKTsKLSAgICAgICAgICAgIG1FbGVtZW50c1tpXS51cGRhdGVGcm9tTmF0aXZlKCk7Ci0gICAgICAgICAgICBtT2Zmc2V0SW5CeXRlc1tpXSA9IG1TaXplOwotICAgICAgICAgICAgbVNpemUgKz0gbUVsZW1lbnRzW2ldLm1TaXplICogbUFycmF5U2l6ZXNbaV07Ci0gICAgICAgIH0KLSAgICB9Ci0gICAgKi8KLSAgICB1cGRhdGVWaXNpYmxlU3ViRWxlbWVudHMoKTsKLX0KLQotY29uc3QgRWxlbWVud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mVuZGVyU2NyaXB0Ojp0aHJlYWRQcm9jKHZvaWQgKnZyc2MpIHsKLSAgICBSZW5kZXJTY3JpcHQgKnJzID0gc3RhdGljX2Nhc3Q8UmVuZGVyU2NyaXB0ICo+KHZyc2MpOwotICAgIHNpemVfdCByYnVmX3NpemUgPSAyNTY7Ci0gICAgdm9pZCAqIHJidWYgPSBtYWxsb2MocmJ1Zl9zaXplKTsKLQotICAgIHJzQ29udGV4dEluaXRUb0NsaWVudChycy0+bUNvbnRleHQpOwotICAgIHJzLT5tTWVzc2FnZVJ1biA9IHRydWU7Ci0KLSAgICB3aGlsZSAocnMtPm1NZXNzYWdlUnVuKSB7Ci0gICAgICAgIHNpemVfdCByZWNlaXZlTGVuID0gMDsKLSAgICAgICAgdWludDMyX3QgdXNySUQgPSAwOwotICAgICAgICB1aW50MzJfdCBzdWJJRCA9IDA7Ci0gICAgICAgIFJzTWVzc2FnZVRvQ2xpZW50VHlwZSByID0gcnNDb250ZXh0UGVla01lc3NhZ2UocnMtPm1Db250ZXh0LAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICZyZWNlaXZlTGVuLCBzaXplb2YocmVjZWl2ZUxlbiksCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJnVzcklELCBzaXplb2YodXNySUQpKTsKLQotICAgICAgICBpZiAocmVjZWl2ZUxlbiA+PSByYnVmX3NpemUpIHsKLSAgICAgICAgICAgIHJidWZfc2l6ZSA9IHJlY2VpdmVMZW4gKyAzMjsKLSAgICAgICAgICAgIHJidWYgPSByZWFsbG9jKHJidWYsIHJidWZfc2l6ZSk7Ci0gICAgICAgIH0KLSAgICAgICAgaWYgKCFyYnVmKSB7Ci0gICAgICAgICAgICBBTE9HRSgiUmVuZGVyU2NyaXB0OjptZXNzYWdlIGhhbmRsZXIgcmVhbGxvYyBlcnJvciAlenUiLCByYnVmX3NpemUpOwotICAgICAgICAgICAgLy8gTm8gY2xlYW4gd2F5IHRvIHJlY292ZXIgbm93PwotICAgICAgICB9Ci0gICAgICAgIHJzQ29udGV4dEdldE1lc3NhZ2UocnMtPm1Db250ZXh0LCByYnVmLCByYnVmX3NpemUsICZyZWNlaXZlTGVuLCBzaXplb2YocmVjZWl2ZUxlbiksCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgJnN1YklELCBzaXplb2Yoc3ViSUQpKTsKLQotICAgICAgICBzd2l0Y2gocikgewotICAgICAgICBjYXNlIFJTX01FU1NBR0VfVE9fQ0xJRU5UX0VSUk9SOgotICAgICAgICAgICAgQUxPR0UoIlJTIEVycm9yICVzIiwgKGNvbnN0IGNoYXIgKilyYnVmKTsKLQotICAgICAgICAgICAgaWYocnMtPm1NZXNzYWdlRnVuYyAhPSBOVUxMKSB7Ci0gICAgICAgICAgICAgICAgcnMtPm1FcnJvckZ1bmModXNySUQsIChjb25zdCBjaGFyICopcmJ1Zik7Ci0gICAgICAgICAgICB9Ci0gICAgICAgICAgICBicmVhazsKLSAgICAgICAgY2FzZSBSU19NRVNTQUdFX1RPX0NMSUVOVF9FWENFUFRJT046Ci0gICAgICAgICAgICAvLyB0ZWFyZG93bi4gQnV0IHdlIHdhbnQgdG8gYXZvaWQgc3RhcnZpbmcgb3RoZXIgdGhyZWFkcyBkdXJpbmcKLSAgICAgICAgICAgIC8vIHRlYXJkb3duIGJ5IHlpZWxkaW5nIHVudGlsIHRoZSBuZXh0IGxpbmUgaW4gdGhlIGRlc3RydWN0b3IgY2FuCi0gICAgICAgICAgICAvLyBleGVjdXRlIHRvIHNldCBtUnVuID0gZmFsc2UKLSAgICAgICAgICAgIHVzbGVlcCgxMDAwKTsKLSAgICAgICAgICAgIGJyZWFrOwotICAgICAgICBjYXNlIFJTX01FU1NBR0VfVE9fQ0xJRU5UX1VTRVI6Ci0gICAgICAgICAgICBpZihycy0+bU1lc3NhZ2VGdW5jICE9IE5VTEwpIHsKLSAgICAgICAgICAgICAgICBycy0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vbiAqdmEsIHVpbnQzMl90IHNsb3QpIGNvbnN0OwotICAgIHZvaWQgc2V0VmFyKHVpbnQzMl90IGluZGV4LCBjb25zdCB2b2lkICosIHNpemVfdCBsZW4pIGNvbnN0OwotICAgIHZvaWQgc2V0VmFyKHVpbnQzMl90IGluZGV4LCBjb25zdCBCYXNlT2JqICpvKSBjb25zdDsKLSAgICB2b2lkIGludm9rZSh1aW50MzJfdCBzbG90LCBjb25zdCB2b2lkICp2LCBzaXplX3QgbGVuKSBjb25zdDsKLQotCi0gICAgdm9pZCBpbnZva2UodWludDMyX3Qgc2xvdCkgY29uc3QgewotICAgICAgICBpbnZva2Uoc2xvdCwgTlVMTCwgMCk7Ci0gICAgfQotICAgIHZvaWQgc2V0VmFyKHVpbnQzMl90IGluZGV4LCBmbG9hdCB2KSBjb25zdCB7Ci0gICAgICAgIHNldFZhcihpbmRleCwgJnYsIHNpemVvZih2KSk7Ci0gICAgfQotICAgIHZvaWQgc2V0VmFyKHVpbnQzMl90IGluZGV4LCBkb3VibGUgdikgY29uc3QgewotICAgICAgICBzZXRWYXIoaW5kZXgsICZ2LCBzaXplb2YodikpOwotICAgIH0KLSAgICB2b2lkIHNldFZhcih1aW50MzJfdCBpbmRleCwgaW50MzJfdCB2KSBjb25zdCB7Ci0gICAgICAgIHNldFZhcihpbmRleCwgJnYsIHNpemVvZih2KSk7Ci0gICAgfQotICAgIHZvaWQgc2V0VmFyKHVpbnQzMl90IGluZGV4LCBpbnQ2NF90IHYpIGNvbnN0IHsKLSAgICAgICAgc2V0VmFyKGluZGV4LCAmdiwgc2l6ZW9mKHYpKTsKLSAgICB9Ci0gICAgdm9pZCBzZXRWYXIodWludDMyX3QgaW5kZXgsIGJvb2wgdikgY29uc3QgewotICAgICAgICBzZXRWYXIoaW5kZXgsICZ2LCBzaXplb2YodikpOwotICAgIH0KLQotcHVibGljOgotICAgIGNsYXNzIEZpZWxkQmFzZSB7Ci0gICAgcHJvdGVjdGVkOgotICAgICAgICBjb25z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ICB2b2lkIGNhbGNFbGVtZW50Q291bnQoKTsKLSAgICB2aXJ0dWFsIHZvaWQgdXBkYXRlRnJvbU5hdGl2ZSgpOwotCi1wdWJsaWM6Ci0KLSAgICBjb25zdCBFbGVtZW50KiBnZXRFbGVtZW50KCkgY29uc3QgewotICAgICAgICByZXR1cm4gbUVsZW1lbnQ7Ci0gICAgfQotCi0gICAgdWludDMyX3QgZ2V0WCgpIGNvbnN0IHsKLSAgICAgICAgcmV0dXJuIG1EaW1YOwotICAgIH0KLQotICAgIHVpbnQzMl90IGdldFkoKSBjb25zdCB7Ci0gICAgICAgIHJldHVybiBtRGltWTsKLSAgICB9Ci0KLSAgICB1aW50MzJfdCBnZXRaKCkgY29uc3QgewotICAgICAgICByZXR1cm4gbURpbVo7Ci0gICAgfQotCi0gICAgYm9vbCBoYXNNaXBtYXBzKCkgY29uc3QgewotICAgICAgICByZXR1cm4gbURpbU1pcG1hcHM7Ci0gICAgfQotCi0gICAgYm9vbCBoYXNGYWNlcygpIGNvbnN0IHsKLSAgICAgICAgcmV0dXJuIG1EaW1GYWNlczsKLSAgICB9Ci0KLSAgICBzaXplX3QgZ2V0Q291bnQoKSBjb25zdCB7Ci0gICAgICAgIHJldHVybiBtRWxlbWVudENvdW50OwotICAgIH0KLQotICAgIHNpemVfdCBnZXRTaXplQnl0ZXMoKSBjb25zdCB7Ci0gICAgICAgIHJldHVybiBtRWxlbWVudENvdW50ICogbUVsZW1lbnQtPmdldFNpemVCeXRlcygpOwotICAgIH0KLQotCi0gICAgVHlwZSh2b2lkICppZCwgUmVuZGVyU2NyaXB0ICpycyk7Ci0KLQotICAgIGNsYXNzIEJ1aWxkZXIgewotICAgIHByb3RlY3RlZDoKLSAgICAgICAgUmVuZGVyU2NyaXB0ICptUlM7Ci0gICAgICAgIHVpbnQzMl90IG1EaW1YOwotICAgICAgICB1aW50MzJfdCBtRGltWTsKLSAgICAgICAgdWludDMyX3QgbURpbVo7Ci0gICAgICAgIGJvb2wgbURpbU1p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3QgbG9kLCBSc0FsbG9jYXRpb25DdWJlbWFwRmFjZSBmYWNlLAotICAgICAgICAgICAgICAgICAgICAgICAgIHVpbnQzMl90IHcsIHVpbnQzMl90IGgsIHVpbnQzMl90IGQsIGNvbnN0IHZvaWQgKmRhdGEsIHVpbnQzMl90IHNpemVCeXRlcykgewotCi19Ci0KLXZvaWQgcnNkQWxsb2NhdGlvbkRhdGExRF9hbGxvYyhjb25zdCBhbmRyb2lkOjpyZW5kZXJzY3JpcHQ6OkNvbnRleHQgKnJzYywKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb25zdCBhbmRyb2lkOjpyZW5kZXJzY3JpcHQ6OkFsbG9jYXRpb24gKmRzdEFsbG9jLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHVpbnQzMl90IGRzdFhvZmYsIHVpbnQzMl90IGRzdExvZCwgdWludDMyX3QgY291bnQsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY29uc3QgYW5kcm9pZDo6cmVuZGVyc2NyaXB0OjpBbGxvY2F0aW9uICpzcmNBbGxvYywKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB1aW50MzJfdCBzcmNYb2ZmLCB1aW50MzJfdCBzcmNMb2QpIHsKLX0KLQotdWludDhfdCAqZ2V0T2Zmc2V0UHRyKGNvbnN0IGFuZHJvaWQ6OnJlbmRlcnNjcmlwdDo6QWxsb2NhdGlvbiAqYWxsb2MsCi0gICAgICAgICAgICAgICAgICAgICAgdWludDMyX3QgeG9mZiwgdWludDMyX3QgeW9mZiwgdWludDMyX3QgbG9kLAotICAgICAgICAgICAgICAgICAgICAgIFJzQWxsb2NhdGlvbkN1YmVtYXBGYWNlIGZhY2UpIHsKLSAgICB1aW50OF90ICpwdHIgPSBzdGF0aWNfY2FzdDx1aW50OF90ICo+KGFsbG9jLT5nZXRQdHIoKSk7Ci0gICAgcHRyICs9IGFsbG9jLT5nZXRUeXBlKCktPmdldExPRE9mZnNldChsb2QsIHhvZmYsIHlvZmYpOwotCi0gICAgaWYgKGZhY2UgIT0gMCkgewotICAgICAgICB1aW50MzJfdCB0b3RhbFNpemVCeXRlcyA9IGFsbG9jLT5nZXRUeXBlKCktPmdldFNpemVCeXRlcygpOwotICAgICAgICB1aW50MzJfdCBmYWNlT2Zmc2V0ID0gdG90YWxTaXplQnl0ZXMgLyA2OwotICAgICAgICBwdHIgKz0gZmFjZU9mZnNldCAqICh1aW50MzJfdClmYWNlOwotICAgIH0KLSAgICByZXR1cm4gcHRyOwotfQotCi0KLXZvaWQgcnNkQWxsb2NhdGlvbkRhdGEyRF9hbGxvY19zY3JpcHQoY29uc3QgYW5kcm9pZDo6cmVuZGVyc2NyaXB0OjpDb250ZXh0ICpyc2MsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbnN0IGFuZHJvaWQ6OnJlbmRlcnNjcmlwdDo6QWxsb2NhdGlvbiAqZHN0QWxsb2MsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHVpbnQzMl90IGRzdFhvZmYsIHVpbnQzMl90IGRzdFlvZmYsIHVpbnQzMl90IGRzdExvZCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgUnNBbGxvY2F0aW9uQ3ViZW1hcEZhY2UgZHN0RmFjZSwgdWludDMyX3QgdywgdWludDMyX3QgaCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY29uc3QgYW5kcm9pZDo6cmVuZGVyc2NyaXB0OjpBbGxvY2F0aW9uICpzcmNBbGxvYywKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdWludDMyX3Qgc3JjWG9mZiwgdWludDMyX3Qgc3JjWW9mZiwgdWludDMyX3Qgc3JjTG9kLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBSc0FsbG9jYXRpb25DdWJlbWFwRmFjZSBzcmNGYWNlKSB7Ci0gICAgdWludDMyX3Qg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X3QgZHN0TG9kLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFJzQWxsb2NhdGlvbkN1YmVtYXBGYWNlIGRzdEZhY2UsIHVpbnQzMl90IHcsIHVpbnQzMl90IGgsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY29uc3QgYW5kcm9pZDo6cmVuZGVyc2NyaXB0OjpBbGxvY2F0aW9uICpzcmNBbGxvYywKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB1aW50MzJfdCBzcmNYb2ZmLCB1aW50MzJfdCBzcmNZb2ZmLCB1aW50MzJfdCBzcmNMb2QsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgUnNBbGxvY2F0aW9uQ3ViZW1hcEZhY2Ugc3JjRmFjZSkgewotICAgIGlmICghZHN0QWxsb2MtPmdldElzU2NyaXB0KCkgJiYgIXNyY0FsbG9jLT5nZXRJc1NjcmlwdCgpKSB7Ci0gICAgICAgIHJzYy0+c2V0RXJyb3IoUlNfRVJST1JfRkFUQUxfRFJJVkVSLCAiTm9uLXNjcmlwdCBhbGxvY2F0aW9uIGNvcGllcyBub3QgIgotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgInlldCBpbXBsZW1lbnRlZC4iKTsKLSAgICAgICAgcmV0dXJuOwotICAgIH0KLSAgICByc2RBbGxvY2F0aW9uRGF0YTJEX2FsbG9jX3NjcmlwdChyc2MsIGRzdEFsbG9jLCBkc3RYb2ZmLCBkc3RZb2ZmLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRzdExvZCwgZHN0RmFjZSwgdywgaCwgc3JjQWxsb2MsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc3JjWG9mZiwgc3JjWW9mZiwgc3JjTG9kLCBzcmNGYWNlKTsKLX0KLQotdm9pZCByc2RBbGxvY2F0aW9uRGF0YTNEX2FsbG9jKGNvbnN0IGFuZHJvaWQ6OnJlbmRlcnNjcmlwdDo6Q29udGV4dCAqcnNjLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbnN0IGFuZHJvaWQ6OnJlbmRlcnNjcmlwdDo6QWxsb2NhdGlvbiAqZHN0QWxsb2MsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdWludDMyX3QgZHN0WG9mZiwgdWludDMyX3QgZHN0WW9mZiwgdWludDMyX3QgZHN0Wm9mZiwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB1aW50MzJfdCBkc3RMb2QsIFJzQWxsb2NhdGlvbkN1YmVtYXBGYWNlIGRzdEZhY2UsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdWludDMyX3QgdywgdWludDMyX3QgaCwgdWludDMyX3QgZCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb25zdCBhbmRyb2lkOjpyZW5kZXJzY3JpcHQ6OkFsbG9jYXRpb24gKnNyY0FsbG9jLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHVpbnQzMl90IHNyY1hvZmYsIHVpbnQzMl90IHNyY1lvZmYsIHVpbnQzMl90IHNyY1pvZmYsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdWludDMyX3Qgc3JjTG9kLCBSc0FsbG9jYXRpb25DdWJlbWFwRmFjZSBzcmNGYWNlKSB7Ci19Ci0KLXZvaWQgcnNkQWxsb2NhdGlvbkVsZW1lbnREYXRhMUQoY29uc3QgQ29udGV4dCAqcnNjLCBjb25zdCBBbGxvY2F0aW9uICphbGxvYywKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdWludDMyX3QgeCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY29uc3Qgdm9pZCAqZGF0YSwgdWludDMyX3QgY0lkeCwgdWludDMyX3Qgc2l6ZUJ5dGVzKSB7Ci0gICAgRHJ2QWxsb2NhdGlvbiAqZHJ2ID0gKERydkFsbG9jYXRpb24gKilhbGxvYy0+b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RlcnNjcmlwdDo6Q29udGV4dCAqcnNjLAotICAgICAgICAgICAgICAgICAgICAgICAgIGNvbnN0IGFuZHJvaWQ6OnJlbmRlcnNjcmlwdDo6QWxsb2NhdGlvbiAqYWxsb2MsCi0gICAgICAgICAgICAgICAgICAgICAgICAgdWludDMyX3QgeG9mZiwgdWludDMyX3QgeW9mZiwgdWludDMyX3QgbG9kLCBSc0FsbG9jYXRpb25DdWJlbWFwRmFjZSBmYWNlLAotICAgICAgICAgICAgICAgICAgICAgICAgIHVpbnQzMl90IHcsIHVpbnQzMl90IGgsCi0gICAgICAgICAgICAgICAgICAgICAgICAgY29uc3Qgdm9pZCAqZGF0YSwgdWludDMyX3Qgc2l6ZUJ5dGVzKTsKLXZvaWQgcnNkQWxsb2NhdGlvbkRhdGEzRChjb25zdCBhbmRyb2lkOjpyZW5kZXJzY3JpcHQ6OkNvbnRleHQgKnJzYywKLSAgICAgICAgICAgICAgICAgICAgICAgICBjb25zdCBhbmRyb2lkOjpyZW5kZXJzY3JpcHQ6OkFsbG9jYXRpb24gKmFsbG9jLAotICAgICAgICAgICAgICAgICAgICAgICAgIHVpbnQzMl90IHhvZmYsIHVpbnQzMl90IHlvZmYsIHVpbnQzMl90IHpvZmYsCi0gICAgICAgICAgICAgICAgICAgICAgICAgdWludDMyX3QgbG9kLCBSc0FsbG9jYXRpb25DdWJlbWFwRmFjZSBmYWNlLAotICAgICAgICAgICAgICAgICAgICAgICAgIHVpbnQzMl90IHcsIHVpbnQzMl90IGgsIHVpbnQzMl90IGQsIGNvbnN0IHZvaWQgKmRhdGEsIHVpbnQzMl90IHNpemVCeXRlcyk7Ci0KLXZvaWQgcnNkQWxsb2NhdGlvbkRhdGExRF9hbGxvYyhjb25zdCBhbmRyb2lkOjpyZW5kZXJzY3JpcHQ6OkNvbnRleHQgKnJzYywKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb25zdCBhbmRyb2lkOjpyZW5kZXJzY3JpcHQ6OkFsbG9jYXRpb24gKmRzdEFsbG9jLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHVpbnQzMl90IGRzdFhvZmYsIHVpbnQzMl90IGRzdExvZCwgdWludDMyX3QgY291bnQsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY29uc3QgYW5kcm9pZDo6cmVuZGVyc2NyaXB0OjpBbGxvY2F0aW9uICpzcmNBbGxvYywKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB1aW50MzJfdCBzcmNYb2ZmLCB1aW50MzJfdCBzcmNMb2QpOwotdm9pZCByc2RBbGxvY2F0aW9uRGF0YTJEX2FsbG9jKGNvbnN0IGFuZHJvaWQ6OnJlbmRlcnNjcmlwdDo6Q29udGV4dCAqcnNjLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbnN0IGFuZHJvaWQ6OnJlbmRlcnNjcmlwdDo6QWxsb2NhdGlvbiAqZHN0QWxsb2MsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdWludDMyX3QgZHN0WG9mZiwgdWludDMyX3QgZHN0WW9mZiwgdWludDMyX3QgZHN0TG9kLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFJzQWxsb2NhdGlvbkN1YmVtYXBGYWNlIGRzdEZhY2UsIHVpbnQzMl90IHcsIHVpbnQzMl90IGgsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY29uc3QgYW5kcm9pZDo6cmVuZGVyc2NyaXB0OjpBbGxvY2F0aW9uICpzcmNBbGxvYywKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB1aW50MzJfdCBzcmNYb2ZmLCB1aW50MzJfdCBzcmNZb2ZmLCB1aW50MzJfdCBzcmNMb2QsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgUnNBbGxvY2F0aW9uQ3ViZW1hcEZhY2Ugc3JjRmFjZSk7Ci12b2lkIHJzZEFsbG9jYXRpb25EYXRhM0RfYWxsb2MoY29uc3QgYW5kcm9pZDo6cmVuZGVyc2NyaXB0OjpDb250ZXh0ICpyc2MsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY29uc3QgYW5kcm9pZDo6cmVuZGVyc2NyaXB0OjpBbGxvY2F0aW9uICpkc3RBbGxvYywKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB1aW50MzJfdCBkc3RYb2ZmLCB1aW50MzJfdCBkc3RZb2ZmLCB1aW50MzJfdCBkc3Rab2ZmLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHVpbnQzMl90IGRzdExvZCwgUnNBbGxvY2F0aW9uQ3ViZW1hcEZhY2UgZHN0RmFjZSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB1aW50MzJfdCB3LCB1aW50MzJfdCBoLCB1aW50MzJfdCBkLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbnN0IGFuZHJvaWQ6OnJlbmRlcnNjcmlwdDo6QWxsb2NhdGlvbiAqc3JjQWxsb2MsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdWludDMyX3Qgc3JjWG9mZiwgdWludDMyX3Qgc3JjWW9mZiwgdWludDMyX3Qgc3JjWm9mZiwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB1aW50MzJfdCBzcmNMb2QsIFJzQWxsb2NhdGlvbkN1YmVtYXBGYWNlIHNyY0ZhY2UpOwotCi12b2lkIHJzZEFsbG9jYXRpb25FbGVtZW50RGF0YTFEKGNvbnN0IGFuZHJvaWQ6OnJlbmRlcnNjcmlwdDo6Q29udGV4dCAqcnNjLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb25zdCBhbmRyb2lkOjpyZW5kZXJzY3JpcHQ6OkFsbG9jYXRpb24gKmFsbG9jLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB1aW50MzJfdCB4LAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb25zdCB2b2lkICpkYXRhLCB1aW50Mz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lICVpIGlkeCAlaSwgeCAlaSwlaSIsIHNsaWNlLCBpZHgsIHhTdGFydCwgeEVuZCk7Ci0gICAgICAgIC8vQUxPR0UoInVzciBwdHIgaW4gJXAsICBvdXQgJXAiLCBtdGxzLT5wdHJJbiwgbXRscy0+cHRyT3V0KTsKLQotICAgICAgICBwLm91dCA9IG10bHMtPnB0ck91dCArIChtdGxzLT5lU3RyaWRlT3V0ICogeFN0YXJ0KTsKLSAgICAgICAgcC5pbiA9IG10bHMtPnB0ckluICsgKG10bHMtPmVTdHJpZGVJbiAqIHhTdGFydCk7Ci0gICAgICAgIGZuKCZwLCB4U3RhcnQsIHhFbmQsIG10bHMtPmVTdHJpZGVJbiwgbXRscy0+ZVN0cmlkZU91dCk7Ci0gICAgfQotfQotCi12b2lkIHJzZFNjcmlwdEludm9rZUZvckVhY2goY29uc3QgQ29udGV4dCAqcnNjLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgIFNjcmlwdCAqcywKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICB1aW50MzJfdCBzbG90LAotICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbnN0IEFsbG9jYXRpb24gKiBhaW4sCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgQWxsb2NhdGlvbiAqIGFvdXQsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgY29uc3Qgdm9pZCAqIHVzciwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICB1aW50MzJfdCB1c3JMZW4sCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgY29uc3QgUnNTY3JpcHRDYWxsICpzYykgewotCi0gICAgUnNkSGFsICogZGMgPSAoUnNkSGFsICopcnNjLT5tSGFsLmRydjsKLQotICAgIE1UTGF1bmNoU3RydWN0IG10bHM7Ci0gICAgbWVtc2V0KCZtdGxzLCAwLCBzaXplb2YobXRscykpOwotCi0gICAgRHJ2U2NyaXB0ICpkcnYgPSAoRHJ2U2NyaXB0ICopcy0+bUhhbC5kcnY7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dGxzLnlFbmQgPSByc01heCgodWludDMyX3QpMSwgbXRscy55RW5kKTsKLSAgICBtdGxzLnpFbmQgPSByc01heCgodWludDMyX3QpMSwgbXRscy56RW5kKTsKLSAgICBtdGxzLmFycmF5RW5kID0gcnNNYXgoKHVpbnQzMl90KTEsIG10bHMuYXJyYXlFbmQpOwotCi0gICAgcnNBc3NlcnQoIWFpbiB8fCAoYWluLT5nZXRUeXBlKCktPmdldERpbVooKSA9PSAwKSk7Ci0KLSAgICBDb250ZXh0ICptcnNjID0gKENvbnRleHQgKilyc2M7Ci0gICAgU2NyaXB0ICogb2xkVExTID0gc2V0VExTKHMpOwotCi0gICAgbXRscy5yc2MgPSBtcnNjOwotICAgIG10bHMuYWluID0gYWluOwotICAgIG10bHMuYW91dCA9IGFvdXQ7Ci0gICAgbXRscy5zY3JpcHQgPSBzOwotICAgIG10bHMudXNyID0gdXNyOwotICAgIG10bHMudXNyTGVuID0gdXNyTGVuOwotICAgIG10bHMubVNsaWNlU2l6ZSA9IDEwOwotICAgIG10bHMubVNsaWNlTnVtID0gMDsKLQotICAgIG10bHMucHRySW4gPSBOVUxMOwotICAgIG10bHMuZVN0cmlkZUluID0gMDsKLSAgICBpZiAoYWluKSB7Ci0gICAgICAgIG10bHMucHRySW4gPSAoY29uc3QgdWludDhfdCAqKWFpbi0+Z2V0UHRyKCk7Ci0gICAgICAgIG10bHMuZVN0cmlkZUluID0gYWluLT5nZXRUeXBlKCktPmdldEVsZW1lbnRTaXplQnl0ZXMoKTsKLSAgICB9Ci0KLSAgICBtdGxzLnB0ck91dCA9IE5VTEw7Ci0gICAgbXRscy5lU3RyaWRlT3V0ID0gMDsKLSAgICBpZiAoYW91dCkgewotICAgICAgICBtdGxzLnB0ck91dCA9ICh1aW50OF90ICopYW91dC0+Z2V0UHRyKCk7Ci0gICAgICAgIG10bHMuZVN0cmlkZU91dCA9IGFvdXQtPmdldFR5cGUoKS0+Z2V0RWxlbWVudFNpemVCeXRlcygpOwotICAgIH0KLQotICAgIGlmICgoZGMtPm1Xb3JrZXJzLm1Db3VudCA+IDEpICYmIHMtPm1IYWwuaW5mby5pc1RocmVhZGFibGUpIHsKLSAgICAgICAgaWYgKG10bHMuZGltWSA+IDEpIHsKLSAgICAgICAgICAgIHJzZExhdW5jaFRocmVhZHMobXJzYywgd2NfeHksICZtdGxzKTsKLSAgICAgICAgfSBlbHNlIHsKLSAgICAgICAgICAgIHJzZExhdW5jaFRocmVhZHMobXJzYywgd2NfeCwgJm10bHMpOwotICAgICAgICB9Ci0KLSAgICAgICAgLy9BTE9HRSgibGF1bmNoIDEiKTsKLSAgICB9IGVsc2UgewotICAgICAgICBSc0ZvckVhY2hTdHViUGFyYW1TdHJ1Y3QgcDsKLSAgICAgICAgbWVtc2V0KCZwLCAwLCBzaXplb2YocCkpOwotICAgICAgICBwLnVzciA9IG10bHMudXNyOwotICAgICAgICBwLnVzcl9sZW4gPSBtdGxzLnVzckxlbjsKLSAgICAgICAgdWludDMyX3Qgc2lnID0gbXRscy5zaWc7Ci0KLSAgICAgICAgLy9BTE9HRSgibGF1bmNoIDMiKTsKLSAgICAgICAgb3V0ZXJfZm9yZWFjaF90IGZuID0gKG91dGVyX2ZvcmVhY2hfdCkgbXRscy5rZXJuZWw7Ci0gICAgICAgIGZvciAocC5hclswXSA9IG10bHMuYXJyYXlTdGFydDsgcC5hclswXSA8IG10bHMuYXJyYXlFbmQ7IHAuYXJbMF0rKykgewotICAgICAgICAgICAgZm9yIChwLnogPSBtdGxzLnpTdGFydDsgcC56IDwgbXRscy56RW5kOyBwLnorKykgewotICAgICAgICAgICAgICAgIGZvciAocC55ID0gbXRscy55U3RhcnQ7IHAueSA8IG10bHMueUVuZDsgcC55KyspIHsKLSAgICAgICAgICAgICAgICAgICAgdWludDMyX3Qgb2Zmc2V0ID0gbXRscy5kaW1YICogbXRscy5kaW1ZICogbXRscy5kaW1aICogcC5hclswXSArCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG10bHMuZGltWCAqIG10bHMuZGltWSAqIHAueiArCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG10bHMuZGltWCAqIHAueTsKLSAgICAgICAgICAgICAgICAgICAgcC5vdXQgPSBtdGxzLnB0ck91dCArIChtdGxzLmVTdHJpZGVPdXQgKiBvZmZzZXQpOwotICAgICAgICAgICAgICAgICAgICBwLmluID0gbXRscy5wdHJJbiArIChtdGxzLmVTdHJpZGVJbiAqIG9mZnNldCk7Ci0gICAgICAgICAgICAgICAgICAgIGZuKCZwLCBtdGxzLnhTdGFydCwgbXRscy54RW5kLCBtdGxzLmVTdHJpZGVJbiwKLSAgICAgICAgICAgICAgICAgICAgICAgbXRscy5lU3RyaWRlT3V0KTsKLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICB9Ci0gICAgICAgIH0KLSAgICB9Ci0KLSAgICBzZXRUTFMob2xkVExTKTsKLX0KLQotCi1pbnQgcnNkU2NyaXB0SW52b2tlUm9vdChjb25zdCBDb250ZXh0ICpkYywgU2NyaXB0ICpzY3JpcHQpIHsKLSAgICBEcnZTY3JpcHQgKmRydiA9IChEcnZTY3JpcHQgKilzY3JpcHQtPm1IYWwuZHJ2OwotCi0gICAgU2NyaXB0ICogb2xkVExTID0gc2V0VExTKHNjcmlwdCk7Ci0gICAgaW50IHJldCA9IGRydi0+bVJvb3QoKTsKLSAgICBzZXRUTFMob2xkVExTKTsKLQotICAgIHJldHVybiByZXQ7Ci19Ci0KLXZvaWQgcnNkU2NyaXB0SW52b2tlSW5pdChjb25zdCBDb250ZXh0ICpkYywgU2NyaXB0ICpzY3JpcHQpIHsKLSAgICBEcnZTY3JpcHQgKmRydiA9IChEcnZTY3JpcHQgKilzY3JpcHQtPm1IYWwuZHJ2OwotCi0gICAgaWYgKGRydi0+bUluaXQpIHsKLSAgICAgICAgZHJ2LT5tSW5pdCgpOwotICAgIH0KLX0KLQotdm9pZCByc2RTY3JpcHRJbnZva2VGcmVlQ2hpbGRyZW4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dCAqcywKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICB1aW50MzJfdCBzbG90LAotICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbnN0IGFuZHJvaWQ6OnJlbmRlcnNjcmlwdDo6QWxsb2NhdGlvbiAqIGFpbiwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBhbmRyb2lkOjpyZW5kZXJzY3JpcHQ6OkFsbG9jYXRpb24gKiBhb3V0LAotICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbnN0IHZvaWQgKiB1c3IsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgdWludDMyX3QgdXNyTGVuLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbnN0IFJzU2NyaXB0Q2FsbCAqc2MpOwotCi1pbnQgcnNkU2NyaXB0SW52b2tlUm9vdChjb25zdCBhbmRyb2lkOjpyZW5kZXJzY3JpcHQ6OkNvbnRleHQgKmRjLAotICAgICAgICAgICAgICAgICAgICAgICAgYW5kcm9pZDo6cmVuZGVyc2NyaXB0OjpTY3JpcHQgKnNjcmlwdCk7Ci12b2lkIHJzZFNjcmlwdEludm9rZUluaXQoY29uc3QgYW5kcm9pZDo6cmVuZGVyc2NyaXB0OjpDb250ZXh0ICpkYywKLSAgICAgICAgICAgICAgICAgICAgICAgICBhbmRyb2lkOjpyZW5kZXJzY3JpcHQ6OlNjcmlwdCAqc2NyaXB0KTsKLXZvaWQgcnNkU2NyaXB0SW52b2tlRnJlZUNoaWxkcmVuKGNvbnN0IGFuZHJvaWQ6OnJlbmRlcnNjcmlwdDo6Q29udGV4dCAqZGMsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBhbmRyb2lkOjpyZW5kZXJzY3JpcHQ6OlNjcmlwdCAqc2NyaXB0KTsKLQotdm9pZCByc2RTY3JpcHRTZXRHbG9iYWxWYXIoY29uc3QgYW5kcm9pZDo6cmVuZGVyc2NyaXB0OjpDb250ZXh0ICosCi0gICAgICAgICAgICAgICA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gRUdMX05PVF9JTklUSUFMSVpFRDogICByZXR1cm4gIkVHTF9OT1RfSU5JVElBTElaRUQiOwotICAgICAgICAgICAgICAgIGNhc2UgRUdMX0JBRF9BQ0NFU1M6ICAgICAgICByZXR1cm4gIkVHTF9CQURfQUNDRVNTIjsKLSAgICAgICAgICAgICAgICBjYXNlIEVHTF9CQURfQUxMT0M6ICAgICAgICAgcmV0dXJuICJFR0xfQkFEX0FMTE9DIjsKLSAgICAgICAgICAgICAgICBjYXNlIEVHTF9CQURfQVRUUklCVVRFOiAgICAgcmV0dXJuICJFR0xfQkFEX0FUVFJJQlVURSI7Ci0gICAgICAgICAgICAgICAgY2FzZSBFR0xfQkFEX0NPTkZJRzogICAgICAgIHJldHVybiAiRUdMX0JBRF9DT05GSUciOwotICAgICAgICAgICAgICAgIGNhc2UgRUdMX0JBRF9DT05URVhUOiAgICAgICByZXR1cm4gIkVHTF9CQURfQ09OVEVYVCI7Ci0gICAgICAgICAgICAgICAgY2FzZSBFR0xfQkFEX0NVUlJFTlRfU1VSRkFDRTogcmV0dXJuICJFR0xfQkFEX0NVUlJFTlRfU1VSRkFDRSI7Ci0gICAgICAgICAgICAgICAgY2FzZSBFR0xfQkFEX0RJU1BMQVk6ICAgICAgIHJldHVybiAiRUdMX0JBRF9ESVNQTEFZIjsKLSAgICAgICAgICAgICAgICBjYXNlIEVHTF9CQURfTUFUQ0g6ICAgICAgICAgcmV0dXJuICJFR0xfQkFEX01BVENIIjsKLSAgICAgICAgICAgICAgICBjYXNlIEVHTF9CQURfTkFUSVZFX1BJWE1BUDogcmV0dXJuICJFR0xfQkFEX05BVElWRV9QSVhNQVAiOwotICAgICAgICAgICAgICAgIGNhc2UgRUdMX0JBRF9OQVRJVkVfV0lORE9XOiByZXR1cm4gIkVHTF9CQURfTkFUSVZFX1dJTkRPVyI7Ci0gICAgICAgICAgICAgICAgY2FzZSBFR0xfQkFEX1BBUkFNRVRFUjogICAgIHJldHVybiAiRUdMX0JBRF9QQVJBTUV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AgICAvLyBnbyB0aHJvdWdoIHRoZSBsaXN0IGFuZCBza2lwIGNvbmZpZ3MgdGhhdCBvdmVyLXNhdGlzZnkgb3VyIG5lZWRzCi0gICAgICAgIGZvciAoaW50IGk9MCA7IGk8biA7IGkrKykgewotICAgICAgICAgICAgaWYgKHJzYy0+bVVzZXJTdXJmYWNlQ29uZmlnLmFscGhhTWluIDw9IDApIHsKLSAgICAgICAgICAgICAgICBFR0xpbnQgYWxwaGFTaXplOwotICAgICAgICAgICAgICAgIGVnbEdldENvbmZpZ0F0dHJpYihkYy0+Z2wuZWdsLmRpc3BsYXksCi0gICAgICAgICAgICAgICAgICAgICAgICBjb25maWdzW2ldLCBFR0xfQUxQSEFfU0laRSwgJmFscGhhU2l6ZSk7Ci0gICAgICAgICAgICAgICAgaWYgKGFscGhhU2l6ZSA+IDApIHsKLSAgICAgICAgICAgICAgICAgICAgY29udGludWU7Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgfQotCi0gICAgICAgICAgICBpZiAocnNjLT5tVXNlclN1cmZhY2VDb25maWcuZGVwdGhNaW4gPD0gMCkgewotICAgICAgICAgICAgICAgIEVHTGludCBkZXB0aFNpemU7Ci0gICAgICAgICAgICAgICAgZWdsR2V0Q29uZmlnQXR0cmliKGRjLT5nbC5lZ2wuZGlzcGxheSwKLSAgICAgICAgICAgICAgICAgICAgICAgIGNvbmZpZ3NbaV0sIEVHTF9ERVBUSF9TSVpFLCAmZGVwdGhTaXplKTsKLSAgICAgICAgICAgICAgICBpZiAoZGVwdGhTaXplID4gMCkgewotICAgICAgICAgICAgICAgICAgICBjb250aW51ZTsKLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgIC8vIEZvdW5kIG9uZSEKLSAgICAgICAgICAgIGRjLT5nbC5lZ2wuY29uZmlnID0gY29uZmlnc1tpXTsKLSAgICAgICAgICAgIGJyZWFrOwotICAgICAgICB9Ci0KLSAgICAgICAgZGVsZXRlIFt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EdldEludGVnZXJ2KEdMX01BWF9URVhUVVJFX0lNQUdFX1VOSVRTLCAmZGMtPmdsLmdsLm1heEZyYWdtZW50VGV4dHVyZUltYWdlVW5pdHMpOwotICAgIGdsR2V0SW50ZWdlcnYoR0xfTUFYX0ZSQUdNRU5UX1VOSUZPUk1fVkVDVE9SUywgJmRjLT5nbC5nbC5tYXhGcmFnbWVudFVuaWZvcm1WZWN0b3JzKTsKLQotICAgIGRjLT5nbC5nbC5PRVNfdGV4dHVyZV9ucG90ID0gTlVMTCAhPSBzdHJzdHIoKGNvbnN0IGNoYXIgKilkYy0+Z2wuZ2wuZXh0ZW5zaW9ucywKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICJHTF9PRVNfdGV4dHVyZV9ucG90Iik7Ci0gICAgZGMtPmdsLmdsLklNR190ZXh0dXJlX25wb3QgPSBOVUxMICE9IHN0cnN0cigoY29uc3QgY2hhciAqKWRjLT5nbC5nbC5leHRlbnNpb25zLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIkdMX0lNR190ZXh0dXJlX25wb3QiKTsKLSAgICBkYy0+Z2wuZ2wuTlZfdGV4dHVyZV9ucG90XzJEX21pcG1hcCA9IE5VTEwgIT0gc3Ryc3RyKChjb25zdCBjaGFyICopZGMtPmdsLmdsLmV4dGVuc2lvbnMsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAiR0xfTlZfdGV4dHVyZV9ucG90XzJEX21pcG1hcCIpOwotICAgIGRjLT5nbC5nbC5FWFRfdGV4dHVyZV9tYXhfYW5pc28gPSAxLjBmOwotICAgIGJvb2wgaGFzQW5pc28gPSBOVUxMICE9IHN0cnN0cigoY29uc3QgY2hhciAqKWRjLT5nbC5nbC5leHRlbnNpb25zLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAiR0xfRVhUX3RleHR1cmV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CBhLCBzb3VyY2UpOwotfQotCi1zdGF0aWMgdm9pZCBTQ19BbGxvY2F0aW9uU3luY0FsbChBbGxvY2F0aW9uICphKSB7Ci0gICAgR0VUX1RMUygpOwotICAgIHJzckFsbG9jYXRpb25TeW5jQWxsKHJzYywgc2MsIGEsIFJTX0FMTE9DQVRJT05fVVNBR0VfU0NSSVBUKTsKLX0KLQotc3RhdGljIHZvaWQgU0NfQWxsb2NhdGlvbkNvcHkxRFJhbmdlKEFsbG9jYXRpb24gKmRzdEFsbG9jLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHVpbnQzMl90IGRzdE9mZiwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB1aW50MzJfdCBkc3RNaXAsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdWludDMyX3QgY291bnQsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgQWxsb2NhdGlvbiAqc3JjQWxsb2MsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdWludDMyX3Qgc3JjT2ZmLCB1aW50MzJfdCBzcmNNaXApIHsKLSAgICBHRVRfVExTKCk7Ci0gICAgcnNyQWxsb2NhdGlvbkNvcHkxRFJhbmdlKHJzYywgZHN0QWxsb2MsIGRzdE9mZiwgZHN0TWlwLCBjb3VudCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc3JjQWxsb2MsIHNyY09mZiwgc3JjTWlwKTsKLX0KLQotc3RhdGljIHZvaWQgU0NfQWxsb2NhdGlvbkNvcHkyRFJhbmdlKEFsbG9jYXRpb24gKmRzdEFsbG9jLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHVpbnQzMl90IGRzdFhvZmYsIHVpbnQzMl90IGRzdFlvZmYsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdWludDMyX3QgZHN0TWlwLCB1aW50MzJfdCBkc3RGYWNlLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHVpbnQzMl90IHdpZHRoLCB1aW50MzJfdCBoZWlnaHQsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgQWxsb2NhdGlvbiAqc3JjQWxsb2MsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdWludDMyX3Qgc3JjWG9mZiwgdWludDMyX3Qgc3JjWW9mZiwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB1aW50MzJfdCBzcmNNaXAsIHVpbnQzMl90IHNyY0ZhY2UpIHsKLSAgICBHRVRfVExTKCk7Ci0gICAgcnNyQWxsb2NhdGlvbkNvcHkyRFJhbmdlKHJzYywgZHN0QWxsb2MsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRzdFhvZmYsIGRzdFlvZmYsIGRzdE1pcCwgZHN0RmFjZSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgd2lkdGgsIGhlaWdodCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc3JjQWxsb2MsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNyY1hvZmYsIHNyY1lvZmYsIHNyY01pcCwgc3JjRmFjZSk7Ci19Ci0KLQotLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vCi0vLyBDb250ZXh0Ci0vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8KLQotc3RhdGljIHZvaWQgU0NfQmluZFRleHR1cmUoUHJvZ3JhbUZyYWdtZW50ICpwZiwgdWludDMyX3Qgc2xvdCwgQWxsb2NhdGlvbiAqYSkgewotICAgIEdFVF9UTFMoKTsKLSAgICByc3JCaW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gICAgICAgICAgICAgICAgICAgICAgIEFsbG9jYXRpb24gKm91dCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb25zdCB2b2lkICp1c3IpIHsKLSAgICBHRVRfVExTKCk7Ci0gICAgcnNyRm9yRWFjaChyc2MsIHNjLCB0YXJnZXQsIGluLCBvdXQsIHVzciwgMCwgTlVMTCk7Ci19Ci0KLXN0YXRpYyB2b2lkIFNDX0ZvckVhY2hfU0FBVVMoU2NyaXB0ICp0YXJnZXQsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgIEFsbG9jYXRpb24gKmluLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICBBbGxvY2F0aW9uICpvdXQsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbnN0IHZvaWQgKnVzciwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY29uc3QgUnNTY3JpcHRDYWxsICpjYWxsKSB7Ci0gICAgR0VUX1RMUygpOwotICAgIHJzckZvckVhY2gocnNjLCBzYywgdGFyZ2V0LCBpbiwgb3V0LCB1c3IsIDAsIGNhbGwpOwotfQotCi1zdGF0aWMgdm9pZCBTQ19Gb3JFYWNoX1NBQVVMKFNjcmlwdCAqdGFyZ2V0LAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICBBbGxvY2F0aW9uICppbiwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgQWxsb2NhdGlvbiAqb3V0LAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb25zdCB2b2lkICp1c3IsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgIHVpbnQzMl90IHVzckxlbikgewotICAgIEdFVF9UTFMoKTsKLSAgICByc3JGb3JFYWNoKHJzYywgc2MsIHRhcmdldCwgaW4sIG91dCwgdXNyLCB1c3JMZW4sIE5VTEwpOwotfQotCi1zdGF0aWMgdm9pZCBTQ19Gb3JFYWNoX1NBQVVMUyhTY3JpcHQgKnRhcmdldCwKLSAgICAgICAgICAgICAgICA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NpZ25lZCBjaGFyCi0vLyAgICAgICAgICAgICAgICAgOjo9IHMgICMgc2hvcnQKLS8vICAgICAgICAgICAgICAgICA6Oj0gdCAgIyB1bnNpZ25lZCBzaG9ydAotLy8gICAgICAgICAgICAgICAgIDo6PSBpICAjIGludAotLy8gICAgICAgICAgICAgICAgIDo6PSBqICAjIHVuc2lnbmVkIGludAotLy8gICAgICAgICAgICAgICAgIDo6PSBsICAjIGxvbmcKLS8vICAgICAgICAgICAgICAgICA6Oj0gbSAgIyB1bnNpZ25lZCBsb25nCi0vLyAgICAgICAgICAgICAgICAgOjo9IHggICMgbG9uZyBsb25nLCBfX2ludDY0Ci0vLyAgICAgICAgICAgICAgICAgOjo9IHkgICMgdW5zaWduZWQgbG9uZyBsb25nLCBfX2ludDY0Ci0vLyAgICAgICAgICAgICAgICAgOjo9IGYgICMgZmxvYXQKLS8vICAgICAgICAgICAgICAgICA6Oj0gZCAgIyBkb3VibGUKLQotc3RhdGljIFJzZFN5bWJvbFRhYmxlIGdTeW1zW10gPSB7Ci0gICAgeyAibWVtc2V0IiwgKHZvaWQgKikmbWVtc2V0LCB0cnVlIH0sCi0gICAgeyAibWVtY3B5IiwgKHZvaWQgKikmbWVtY3B5LCB0cnVlIH0sCi0KLSAgICAvLyBSZWZjb3VudGluZwotICAgIHsgIl9aMTFyc1NldE9iamVjdFAxMHJzX2VsZW1lbnRTXyIsICh2b2lkICopJlNDX1NldE9iamVjdCwgdHJ1ZSB9LAotICAgIHsgIl9aMTNyc0NsZWFyT2JqZWN0UDEwcnNfZWxlbWVudCIsICh2b2lkICopJlNDX0NsZWFyT2JqZWN0LCB0cnVlIH0sCi0gICAgeyAiX1oxMHJzSXNPYmplY3QxMHJzX2VsZW1lbnQiLCAodm9pZCAqKSZTQ19Jc09iamVjdCwgdHJ1ZSB9LAotCi0gICAgeyAiX1oxMXJzU2V0T2JqZWN0UDdyc190eXBlU18iLCAodm9pZCAqKSZTQ19TZXRPYmplY3QsIHRydWUgfSwKLS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yBicmVhazsKLSAgICAgICAgICAgICAgICBkZWZhdWx0OgotICAgICAgICAgICAgICAgICAgICByc0Fzc2VydCgwKTsKLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgIG1TaGFkZXIuYXBwZW5kKGZuKTsKLSAgICAgICAgICAgIGlmIChlLT5tSGFsLnN0YXRlLmZpZWxkQXJyYXlTaXplc1tmaWVsZF0gPiAxKSB7Ci0gICAgICAgICAgICAgICAgbVNoYWRlci5hcHBlbmRGb3JtYXQoIlslZF0iLCBlLT5tSGFsLnN0YXRlLmZpZWxkQXJyYXlTaXplc1tmaWVsZF0pOwotICAgICAgICAgICAgfQotICAgICAgICAgICAgbVNoYWRlci5hcHBlbmQoIjtcbiIpOwotICAgICAgICB9Ci0gICAgfQotfQotCi12b2lkIFJzZFNoYWRlcjo6bG9nVW5pZm9ybShjb25zdCBFbGVtZW50ICpmaWVsZCwgY29uc3QgZmxvYXQgKmZkLCB1aW50MzJfdCBhcnJheVNpemUgKSB7Ci0gICAgUnNEYXRhVHlwZSBkYXRhVHlwZSA9IGZpZWxkLT5tSGFsLnN0YXRlLmRhdGFUeXBlOwotICAgIHVpbnQzMl90IGVsZW1lbnRTaXplID0gZmllbGQtPm1IYWwuc3RhdGUuZWxlbWVudFNpemVCeXRlcyAvIHNpemVvZihmbG9hdCk7Ci0gICAgZm9yICh1aW50MzJfdCBpID0gMDsgaSA8IGFycmF5U2l6ZTsgaSArKykgewotICAgICAgICBpZiAoYXJyYXlTaXplID4gMSkgewotICAgICAgICAgICAgQUxPR1YoIkFycmF5IEVsZW1lbnQgWyV1XSIsIGkpOwotICAgICAgICB9Ci0gICAgICAgIGlmIChkYXRhVHlwZSA9PSBSU19UWVBFX01BVFJJWF80WDQpIHsKLSAgICAgICAgICAgIEFMT0dWKCJNYXRyaXg0eDQiKTsKLSAgICAgICAgICAgIEFMT0dWKCJ7JWYsICVmLCAlZiwgJWYiLCAgZmRbMF0sIGZkWzRd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jYXNlIDI6Ci0gICAgICAgICAgICAgICAgQUxPR1YoIlVuaWZvcm0gMiA9ICVmICVmIiwgZmRbMF0sIGZkWzFdKTsKLSAgICAgICAgICAgICAgICBicmVhazsKLSAgICAgICAgICAgIGNhc2UgMzoKLSAgICAgICAgICAgICAgICBBTE9HVigiVW5pZm9ybSAzID0gJWYgJWYgJWYiLCBmZFswXSwgZmRbMV0sIGZkWzJdKTsKLSAgICAgICAgICAgICAgICBicmVhazsKLSAgICAgICAgICAgIGNhc2UgNDoKLSAgICAgICAgICAgICAgICBBTE9HVigiVW5pZm9ybSA0ID0gJWYgJWYgJWYgJWYiLCBmZFswXSwgZmRbMV0sIGZkWzJdLCBmZFszXSk7Ci0gICAgICAgICAgICAgICAgYnJlYWs7Ci0gICAgICAgICAgICBkZWZhdWx0OgotICAgICAgICAgICAgICAgIHJzQXNzZXJ0KDApOwotICAgICAgICAgICAgfQotICAgICAgICB9Ci0gICAgICAgIEFMT0dFKCJFbGVtZW50IHNpemUgJXUgZGF0YT0lcCIsIGVsZW1lbnRTaXplLCBmZCk7Ci0gICAgICAgIGZkICs9IGVsZW1lbnRTaXplOwotICAgICAgICBBTE9HRSgiTmV3IGRhdGE9JXAiLCBmZCk7Ci0gICAgfQotfQotCi12b2lkIFJzZFNoYWRlcjo6c2V0VW5pZm9ybShjb25zdCBDb250ZXh0ICpyc2MsIGNvbnN0IEVsZW1lbnQgKmZpZWxkLCBjb25zdCBmbG9hdCAqZmQsCi0gICAgICAgICAgICAgICAgICAgICAgICAgaW50MzJfdCBzbG90LCB1aW50MzJfdCBhcnJheVNpemUgKSB7Ci0gICAgUnNEYXRhVHlwZSBkYXRhVHlwZSA9IGZpZWxkLT5tSGFsLnN0YXRlLmRhdGFUeXBlOwotICAgIGlmIChkYXRhVHlwZSA9PSBSU19UWVBFX01BVFJJWF80WDQpIHsKLSAgICAgICAgUlNEX0NBTExfR0woZ2xVbmlmb3JtTWF0cml4NGZ2LCBzbG90LCBhcnJheVNpemUsI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2F0aW9uICopdGV4LT5tSGFsLmRydjsKLSAgICBjb25zdCBHTGVudW0gdGFyZ2V0ID0gZHJ2VGV4LT5nbFRhcmdldDsKLQotICAgIGlmICghZGMtPmdsLmdsLk9FU190ZXh0dXJlX25wb3QgJiYgdGV4LT5nZXRUeXBlKCktPmdldElzTnAyKCkpIHsKLSAgICAgICAgaWYgKHRleC0+Z2V0SGFzR3JhcGhpY3NNaXBtYXBzKCkgJiYKLSAgICAgICAgICAgIChkYy0+Z2wuZ2wuTlZfdGV4dHVyZV9ucG90XzJEX21pcG1hcCB8fCBkYy0+Z2wuZ2wuSU1HX3RleHR1cmVfbnBvdCkpIHsKLSAgICAgICAgICAgIGlmIChkYy0+Z2wuZ2wuTlZfdGV4dHVyZV9ucG90XzJEX21pcG1hcCkgewotICAgICAgICAgICAgICAgIFJTRF9DQUxMX0dMKGdsVGV4UGFyYW1ldGVyaSwgdGFyZ2V0LCBHTF9URVhUVVJFX01JTl9GSUxURVIsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgdHJhbnNbcy0+bUhhbC5zdGF0ZS5taW5GaWx0ZXJdKTsKLSAgICAgICAgICAgIH0gZWxzZSB7Ci0gICAgICAgICAgICAgICAgc3dpdGNoICh0cmFuc1tzLT5tSGFsLnN0YXRlLm1pbkZpbHRlcl0pIHsKLSAgICAgICAgICAgICAgICBjYXNlIEdMX0xJTkVBUl9NSVBNQVBfTElORUFSOgotICAgICAgICAgICAgICAgICAgICBSU0RfQ0FMTF9HTChnbFRleFBhcmFtZXRlcmksIHRhcmdldCwgR0xfVEVYVFVSRV9NSU5fRklMVEVSLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBHTF9MSU5FQVJfTUlQTUFQX05FQVJFU1QpOwotICAgICAgICAgICAgICAgICAgICBicmVhazsKLSAgICAgICAgICAgICAgICBkZWZhdWx0OgotICAgICAgICAgICAgICAgICAgICBSU0RfQ0FMTF9HTChnbFRleFBhcmFtZXRlcmksIHRhcmdldCwgR0x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ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJnVuaWZvcm1MaXN0W2N0XS0+YXJyYXlTaXplLCAmdW5pZm9ybUxpc3RbY3RdLT50eXBlLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdW5pZm9ybUxpc3RbY3RdLT5uYW1lKTsKLSAgICAgICAgICAgICAgICAgICAgLy9BTE9HRSgiR0wgVU5JIGlkeD0ldSwgYXJyYXlTaXplPSV1LCBuYW1lPSVzIiwgY3QsCi0gICAgICAgICAgICAgICAgICAgIC8vICAgICB1bmlmb3JtTGlzdFtjdF0tPmFycmF5U2l6ZSwgdW5pZm9ybUxpc3RbY3RdLT5uYW1lKTsKLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICB9Ci0gICAgICAgIH0KLQotICAgICAgICAvLyBXZSBub3cga25vdyB0aGUgaGlnaGVzdCBpbmRleCBvZiBhbGwgb2YgdGhlIGFycmF5IHVuaWZvcm1zCi0gICAgICAgIC8vIGFuZCB3ZSBuZWVkIHRvIHVwZGF0ZSBvdXIgY2FjaGUgdG8gcmVmbGVjdCB0aGF0Ci0gICAgICAgIC8vIHdlIG1heSBoYXZlIGRlY2xhcmVkIFtuXSwgYnV0IG9ubHkgbSA8IG4gZWxlbWVudHMgYXJlIHVzZWQKLSAgICAgICAgdXBkYXRlVW5pZm9ybUFycmF5RGF0YShyc2MsIHZ0eCwgcGdtLCBlLT52dHhVbmlmb3JtcywgInZ0eCIsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdW5pZm9ybUxpc3QsICh1aW50MzJfdCludW1Vbmlmb3Jtcyk7Ci0gICAgICAgIHVwZGF0ZVVuaWZvcm1BcnJheURhdGEocnNjLCBmcmFnLCBwZ20sIGUtPmZyYWdVbmlmb3JtcywgImZyYWciLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHVuaWZvcm1MaXN0LCAodWludDMyX3QpbnVtVW5pZm9ybXMpOwotCi0gICAgICAgIC8vIEN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IChpbnQzMl90IGN0ID0gMDsgY3QgPCBudW1FbnRyaWVzOyBjdCArKykgewotICAgICAgICBpZiAobUVudHJpZXNbY3RdLT52dHggPT0gaWQpIHsKLSAgICAgICAgICAgIGdsRGVsZXRlUHJvZ3JhbShtRW50cmllc1tjdF0tPnByb2dyYW0pOwotCi0gICAgICAgICAgICBkZWxldGUgbUVudHJpZXNbY3RdOwotICAgICAgICAgICAgbUVudHJpZXMucmVtb3ZlQXQoY3QpOwotICAgICAgICAgICAgbnVtRW50cmllcyA9IChpbnQzMl90KW1FbnRyaWVzLnNpemUoKTsKLSAgICAgICAgICAgIGN0IC0tOwotICAgICAgICB9Ci0gICAgfQotfQotCi12b2lkIFJzZFNoYWRlckNhY2hlOjpjbGVhbnVwRnJhZ21lbnQodWludDMyX3QgaWQpIHsKLSAgICBpbnQzMl90IG51bUVudHJpZXMgPSAoaW50MzJfdCltRW50cmllcy5zaXplKCk7Ci0gICAgZm9yIChpbnQzMl90IGN0ID0gMDsgY3QgPCBudW1FbnRyaWVzOyBjdCArKykgewotICAgICAgICBpZiAobUVudHJpZXNbY3RdLT5mcmFnID09IGlkKSB7Ci0gICAgICAgICAgICBnbERlbGV0ZVByb2dyYW0obUVudHJpZXNbY3RdLT5wcm9ncmFtKTsKLQotICAgICAgICAgICAgZGVsZXRlIG1FbnRyaWVzW2N0XTsKLSAgICAgICAgICAgIG1FbnRyaWVzLnJlbW92ZUF0KGN0KTsKLSAgICAgICAgICAgIG51bUVudHJpZXMgPSAoaW50MzJfdCltRW50cmllcy5zaXplKCk7Ci0gICAgICAgICAgICBjdCAtLTsKLSAgICAgICAgfQotICAgIH0KLX0KLQotdm9pZCBSc2RTaGFkZXJDYWNoZTo6Y2xlYW51cEFsbCgpIHsKLSAgICBmb3IgKHVpbnQzMl90IGN0PTA7IGN0IDwgbUVudHJpZXMuc2l6ZSgpOyBjdCsrKSB7Ci0gICAgICAgIGdsRGVsZXRlUHJvZ3JhbShtRW50cmllc1tjdF0tPnByb2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FtZTsKLSAgICAgICAgdWludDMyX3QgbmFtZUxlbmd0aDsKLSAgICAgICAgaW50MzJfdCB3cml0dGVuTGVuZ3RoOwotICAgICAgICBpbnQzMl90IGFycmF5U2l6ZTsKLSAgICAgICAgdWludDMyX3QgdHlwZTsKLSAgICAgICAgVW5pZm9ybVF1ZXJ5RGF0YSh1aW50MzJfdCBtYXhOYW1lKSB7Ci0gICAgICAgICAgICBuYW1lID0gTlVMTDsKLSAgICAgICAgICAgIG5hbWVMZW5ndGggPSBtYXhOYW1lOwotICAgICAgICAgICAgaWYgKG5hbWVMZW5ndGggPiAwICkgewotICAgICAgICAgICAgICAgIG5hbWUgPSBuZXcgY2hhcltuYW1lTGVuZ3RoXTsKLSAgICAgICAgICAgIH0KLSAgICAgICAgfQotICAgICAgICB+VW5pZm9ybVF1ZXJ5RGF0YSgpIHsKLSAgICAgICAgICAgIGlmIChuYW1lICE9IE5VTEwpIHsKLSAgICAgICAgICAgICAgICBkZWxldGVbXSBuYW1lOwotICAgICAgICAgICAgICAgIG5hbWUgPSBOVUxMOwotICAgICAgICAgICAgfQotICAgICAgICB9Ci0gICAgfTsKLSAgICBzdHJ1Y3QgVW5pZm9ybURhdGEgewotICAgICAgICBpbnQzMl90IHNsb3Q7Ci0gICAgICAgIHVpbnQzMl90IGFycmF5U2l6ZTsKLSAgICB9OwotICAgIHN0cnVjdCBBdHRyRGF0YSB7Ci0gICAgICAgIGludDMyX3Qgc2xvdDsKLSAgICAgICAgY29uc3QgY2hhciogbmFtZTsKLSAgICB9OwotICAgIHN0cnVjdCBQcm9ncmFtRW50cnkgewotICAgICAgICBQcm9ncmFtRW50cnkodWludDMyX3QgbnVtVnR4QXR0ciwgdWludDMyX3QgbnVtVnR4VW5pcywKLSAgICAgICAgICAgICAgICAgICAgIHVpbnQzMl90IG51bUZyYWdVbmlzKSA6IHZ0eCgwKSwgZnJhZygwKSwgcHJvZ3JhbSgwKSwgdnR4QXR0ckNvdW50KDApLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdnR4QXR0cnMoMCksIHZ0eFVuaWZvcm1zKDApLCBmcmFnVW5pZm9ybXMoMCksCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBmcmFnVW5pZm9ybUlzU1RPKDApIHsKLSAgICAgICAgICAgIHZ0eEF0dHJDb3VudCA9IG51bVZ0eEF0dHI7Ci0gICAgICAgICAgICBpZiAobnVtVnR4QXR0cikgewotICAgICAgICAgICAgICAgIHZ0eEF0dHJzID0gbmV3IEF0dHJEYXRhW251bVZ0eEF0dHJdOwotICAgICAgICAgICAgfQotICAgICAgICAgICAgaWYgKG51bVZ0eFVuaXMpIHsKLSAgICAgICAgICAgICAgICB2dHhVbmlmb3JtcyA9IG5ldyBVbmlmb3JtRGF0YVtudW1WdHhVbmlzXTsKLSAgICAgICAgICAgIH0KLSAgICAgICAgICAgIGlmIChudW1GcmFnVW5pcykgewotICAgICAgICAgICAgICAgIGZyYWdVbmlmb3JtcyA9IG5ldyBVbmlmb3JtRGF0YVtudW1GcmFnVW5pc107Ci0gICAgICAgICAgICAgICAgZnJhZ1VuaWZvcm1Jc1NUTyA9IG5ldyBib29sW251bUZyYWdVbmlzXTsKLSAgICAgICAgICAgIH0KLSAgICAgICAgfQotICAgICAgICB+UHJvZ3JhbUVudHJ5KCkgewotICAgICAgICAgICAgaWYgKHZ0eEF0dHJzKSB7Ci0gICAgICAgICAgICAgICAgZGVsZXRlW10gdnR4QXR0cnM7Ci0gICAgICAgICAgICAgICAgdnR4QXR0cnMgPSBOVUxMOwotICAgICAgICAgICAgfQotICAgICAgICAgICAgaWYgKHZ0eFVuaWZvcm1zKSB7Ci0gICAgICAgICAgICAgICAgZGVsZXRlW10gdnR4VW5pZm9ybXM7Ci0gICAgICAgICAgICAgICAgdnR4VW5pZm9ybXMgPSBOVUxMOwotICAgICAgICAgICAgfQotICAgICAgICAgICAgaWYgKGZyYWdVbmlmb3JtcykgewotICAgIC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1Db3VudDsgY3QrKykgewotICAgICAgICBpbnQzMl90IHNsb3QgPSBzYy0+dnR4QXR0cmliU2xvdChtQXR0cmlic1tjdF0ubmFtZSk7Ci0gICAgICAgIGlmIChyc2MtPnByb3BzLm1Mb2dTaGFkZXJzQXR0cikgewotICAgICAgICAgICAgbG9nQXR0cmliKGN0LCBzbG90KTsKLSAgICAgICAgfQotICAgICAgICBpZiAoc2xvdCA8IDAgfHwgc2xvdCA+PSAoaW50MzJfdCltYXhBdHRycykgewotICAgICAgICAgICAgY29udGludWU7Ci0gICAgICAgIH0KLSAgICAgICAgZ2xFbmFibGVWZXJ0ZXhBdHRyaWJBcnJheShzbG90KTsKLSAgICAgICAgc3RhdGUtPm1BdHRyc0VuYWJsZWRbc2xvdF0gPSB0cnVlOwotICAgICAgICBnbEJpbmRCdWZmZXIoR0xfQVJSQVlfQlVGRkVSLCBtQXR0cmlic1tjdF0uYnVmZmVyKTsKLSAgICAgICAgZ2xWZXJ0ZXhBdHRyaWJQb2ludGVyKHNsb3QsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICBtQXR0cmlic1tjdF0uc2l6ZSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1BdHRyaWJzW2N0XS50eXBlLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbUF0dHJpYnNbY3RdLm5vcm1hbGl6ZWQsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICBtQXR0cmlic1tjdF0uc3RyaWRlLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbUF0dHJpYnNbY3RdLnB0ciArIG1BdHRyaWJzW2N0XS5vZmZzZXQpOwotICAgIH0KLSAgICByc2RHTENoZWNrRXJyb3IocnNjLCAiUnNkVmVydGV4QXJyYXk6OnNldHVwIGRvbmUiKTsKLX0KLS8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vCi1Sc2RWZXJ0ZXhBcnJheVN0YXRlOj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3VyY2VQdHIgKz0gY29weVNpemU7Ci0gICAgfQotCi0gICAgaWYgKG1pcHMgPT0gUlNfQUxMT0NBVElPTl9NSVBNQVBfRlVMTCkgewotICAgICAgICBBbGxvY2F0aW9uR2VuZXJhdGVTY3JpcHRNaXBzKHJzYywgdGV4QWxsb2MpOwotICAgIH0KLQotICAgIHRleEFsbG9jLT5zZW5kRGlydHkocnNjKTsKLSAgICByZXR1cm4gdGV4QWxsb2M7Ci19Ci0KLXZvaWQgcnNpX0FsbG9jYXRpb25Db3B5MkRSYW5nZShDb250ZXh0ICpyc2MsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgUnNBbGxvY2F0aW9uIGRzdEFsbG9jLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHVpbnQzMl90IGRzdFhvZmYsIHVpbnQzMl90IGRzdFlvZmYsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdWludDMyX3QgZHN0TWlwLCB1aW50MzJfdCBkc3RGYWNlLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHVpbnQzMl90IHdpZHRoLCB1aW50MzJfdCBoZWlnaHQsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgUnNBbGxvY2F0aW9uIHNyY0FsbG9jLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHVpbnQzMl90IHNyY1hvZmYsIHVpbnQzMl90IHNyY1lvZmYsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdWludDMyX3Qgc3JjTWlwLCB1aW50MzJfdCBzcmNGYWNlKSB7Ci0gICAgQWxsb2NhdGlvbiAqZHN0ID0gc3RhdGljX2Nhc3Q8QWxsb2NhdGlvbiAqPihkc3RBbGxvYyk7Ci0gICAgQWxsb2NhdGlvbiAqc3JjPSBzdGF0aWNfY2FzdDxBbGxvY2F0aW9uICo+KHNyY0FsbG9jKTsKLSAgICByc2MtPm1IYWwuZnVuY3MuYWxsb2NhdGlvbi5hbGxvY0RhdGE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LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tCi1uYW1lc3BhY2UgYW5kcm9pZCB7Ci1jbGFzcyBTdXJmYWNlVGV4dHVyZTsKLQotbmFtZXNwYWNlIHJlbmRlcnNjcmlwdCB7Ci0KLWNsYXNzIFByb2dyYW07Ci0KLS8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgotICogQ0FVVElPTgotICoKLSAqIEFueSBsYXlvdXQgY2hhbmdlcyBmb3IgdGhpcyBjbGFzcyBtYXkgcmVxdWlyZSBhIGNvcnJlc3BvbmRpbmcgY2hhbmdlIHRvIGJlCi0gKiBtYWRlIHRvIGZyYW1ld29ya3MvY29tcGlsZS9saWJiY2MvbGliL1NjcmlwdENSVC9yc19jb3JlLmMsIHdoaWNoIGNvbnRhaW5zCi0gKiBhIHBhcnRpYWwgY29weSBvZiB0aGUgaW5mb3JtYXRpb24gYmVsb3cuCi0gKgotICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotY2xhc3MgQWxsb2NhdGlvbiA6IHB1YmxpYyBPYmplY3RCYXNlIHsKLSAgICAvLyBUaGUgZ3JhcGhpY3MgZXF1aXZhbGVudCBvZiBtYWxsb2MuICBUaGUgYWxsb2NhdGlvbiBjb250YWlucyBhIHN0cnVjdHVyZSBvZiBlbGVtZW50cy4KLQotcHVibGljOgotICAgIHN0cnVjdCBIYWwgewotICAgICAgICB2b2lkICogZHJ2OwotCi0gICAgICAgIHN0cnVjdCBTdGF0ZSB7Ci0gICAgICAgICAgICBjb25zdCBUeXBlICogdHlwZTsKLQotICAgICAgICAgICAgdWludDMyX3QgdXNhZ2VGbGFnczsKLSAgICAgICAgICAgIFJzQWxsb2NhdGlvbk1pcG1hcENvbnRyb2wgbWlwbWFwQ29udHJvbDsKLQotICAgICAgICAgICAgLy8gQ2FjaGVkIGZpZWxkcyBmcm9tIHRoZSBUeXBlIGFuZCBFbGVtZW50Ci0gICAgICAgICAgICAvLyB0byBwcmV2ZW50IHBvaW50ZXIgY2hhc2luZyBpbiBjcml0aWNhbCBsb29wcy4KLSAgICAgICAgICAgIHVpbnQzMl90IGRpbWVuc2lvblg7Ci0gICAgICAgICAgICB1aW50MzJfdCBkaW1lbnNpb25ZOwotICAgICAgICAgICAgdWludDMyX3QgZGltZW5zaW9uWjsKLSAgICAgICAgICAgIHVpbnQzMl90IGVsZW1lbnRTaXplQnl0ZXM7Ci0gICAgICAgICAgICBib29sIGhhc01pcG1hcHM7Ci0gICAgICAgICAgICBib29sIGhhc0ZhY2VzOwotICAgICAgICAgICAgYm9vbCBoYXNSZWZlcmVuY2VzOwotICAgICAgICAgICAgdm9pZCAqIHVzclB0cjsKLSAgICAgICAgICAgIGludDMyX3Qgc3VyZmFjZVRleHR1cmVJRDsKLSAgICAgICAgICAgIEFOYXRpdmVXaW5kb3cgKnduZFN1cmZhY2U7Ci0gICAgICAgICAgICBTdXJmYWNlVGV4dHVyZSAqc3VyZmFjZVRleHR1cmU7Ci0gICAgICAgIH07Ci0gICAgICAgIFN0YXRlIHN0YXRlOwotCi0gICAgICAgIHN0cnVjdCBEcnZTdGF0ZSB7Ci0gICAgICAgICAgICB2b2lkICogbWFsbG9jUHRyOwotICAgICAgICB9IGRydlN0YXRlOwotCi0gICAgfTsKLSAgICBIYWwgbUhhbDsKLQotICAgIHN0YXRpYyBBbGxvY2F0aW9uICogY3JlYXRlQWxsb2NhdGlvbihDb250ZXh0ICpyc2MsIGNvbnN0IFR5cGUgKiwgdWludDMyX3QgdXNhZ2VzLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBSc0FsbG9jYXRpb25NaXBtYXBDb250cm9sIG1jID0gUlNfQUxMT0NBVElPTl9NSVBNQVBfTk9ORSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA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ICAgICAgICAgICAgICAgZmxvYXQgdCA9IHZpbltjdC0xXTsKLSAgICAgICAgICAgICAgICB2aW5bY3QtMV0gPSB2aW5bY3RdOwotICAgICAgICAgICAgICAgIHZpbltjdF0gPSB0OwotICAgICAgICAgICAgICAgIHQgPSB2b3V0W2N0LTFdOwotICAgICAgICAgICAgICAgIHZvdXRbY3QtMV0gPSB2b3V0W2N0XTsKLSAgICAgICAgICAgICAgICB2b3V0W2N0XSA9IHQ7Ci0gICAgICAgICAgICAgICAgY2hhbmdlZCA9IHRydWU7Ci0gICAgICAgICAgICB9Ci0gICAgICAgIH0KLSAgICAgICAgaWYgKCFjaGFuZ2VkKSBicmVhazsKLSAgICB9Ci0KLSAgICByZXR1cm4gYTsKLX0KLSovCi0KLQotLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8KLS8vCi0KLW5hbWVzcGFjZSBhbmRyb2lkIHsKLW5hbWVzcGFjZSByZW5kZXJzY3JpcHQgewotCi1Sc0FuaW1hdGlvbiByc2lfQW5pbWF0aW9uQ3JlYXRlKENvbnRleHQgKnJzYywKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY29uc3QgZmxvYXQgKmluVmFsdWVzLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb25zdCBmbG9hdCAqb3V0VmFsdWVzLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB1aW50MzJfdCB2YWx1ZUNvdW50LAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBSc0FuaW1hdGlvbkludGVycG9sYXRpb24gaW50ZXJwLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBSc0FuaW1hdGlvbkVkZ2UgcHJlLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBSc0FuaW1hdGlvbkVkZ2UgcG9zdCkgewotICAgIC8vQUxPR0UoInJzaV9FbGVtZW50Q3JlYXRlICVpICVpICVpICVpIiwgZHQsIGR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gICAgYnJlYWs7Ci0gICAgY2FzZSBSU19LSU5EX1BJWEVMX1JHQkE6Ci0gICAgICAgIG1Jc1BpeGVsID0gdHJ1ZTsKLSAgICAgICAgcnNBc3NlcnQobVZlY3RvclNpemUgPT0gNCk7Ci0gICAgICAgIHJzQXNzZXJ0KG1Ob3JtYWxpemVkID09IHRydWUpOwotICAgICAgICBicmVhazsKLSAgICBkZWZhdWx0OgotICAgICAgICByc0Fzc2VydChtS2luZCAhPSBSU19LSU5EX0lOVkFMSUQpOwotICAgICAgICBicmVhazsKLSAgICB9Ci0KLSAgICBzd2l0Y2ggKG1UeXBlKSB7Ci0gICAgY2FzZSBSU19UWVBFX05PTkU6Ci0gICAgICAgIHJldHVybjsKLSAgICBjYXNlIFJTX1RZUEVfVU5TSUdORURfNV82XzU6Ci0gICAgICAgIG1WZWN0b3JTaXplID0gMzsKLSAgICAgICAgbUJpdHMgPSAxNjsKLSAgICAgICAgbU5vcm1hbGl6ZWQgPSB0cnVlOwotICAgICAgICByc0Fzc2VydChtS2luZCA9PSBSU19LSU5EX1BJWEVMX1JHQik7Ci0gICAgICAgIHJldHVybjsKLSAgICBjYXNlIFJTX1RZUEVfVU5TSUdORURfNV81XzVfMToKLSAgICAgICAgbVZlY3RvclNpemUgPSA0OwotICAgICAgICBtQml0cyA9IDE2OwotICAgICAgICBtTm9ybWFsaXplZCA9IHRydWU7Ci0gICAgICAgIHJzQXNzZXJ0KG1LaW5kID09IFJTX0tJTkRfUElYRUxfUkdCQSk7Ci0gICAgICAgIHJldHVybjsKLSAgICBjYXNlIFJTX1RZUEVfVU5TSUdORURfNF80XzRfNDoKLSAgICAgICAgbVZlY3RvclNpemUgPSA0OwotICAgICAgICBtQml0cyA9IDE2OwotICAgICAgICBtTm9ybWFsaXplZCA9IHRydWU7Ci0gICAgICAgIHJzQXNzZXJ0KG1LaW5kID09IFJTX0tJTkRfUElYRUxfUkdCQSk7Ci0gICAgICAgIHJldHVybjsKLQotICAgIGNhc2UgUlNfV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bmRzKHJzYywgLTEpOwotICAgICAgICAgICAgfQotCi0gICAgICAgICAgICBpZiAoKHJzYy0+bVJvb3RTY3JpcHQuZ2V0KCkgIT0gTlVMTCkgJiYgcnNjLT5tSGFzU3VyZmFjZSAmJgotICAgICAgICAgICAgICAgICh0YXJnZXRSYXRlIHx8IGRyYXdPbmNlKSAmJiAhcnNjLT5tUGF1c2VkKSB7Ci0KLSAgICAgICAgICAgICAgICBkcmF3T25jZSA9IGZhbHNlOwotICAgICAgICAgICAgICAgIHRhcmdldFJhdGUgPSAoKHJzYy0+cnVuUm9vdFNjcmlwdCgpICsgMTUpIC8gMTYpOwotCi0gICAgICAgICAgICAgICAgaWYgKHJzYy0+cHJvcHMubUxvZ1Zpc3VhbCkgewotICAgICAgICAgICAgICAgICAgICByc2MtPmRpc3BsYXlEZWJ1Z1N0YXRzKCk7Ci0gICAgICAgICAgICAgICAgfQotCi0gICAgICAgICAgICAgICAgcnNjLT50aW1lclNldChSU19USU1FUl9DTEVBUl9TV0FQKTsKLSAgICAgICAgICAgICAgICByc2MtPm1IYWwuZnVuY3Muc3dhcChyc2MpOwotICAgICAgICAgICAgICAgIHJzYy0+dGltZXJGcmFtZSgpOwotICAgICAgICAgICAgICAgIHJzYy0+dGltZXJTZXQoUlNfVElNRVJfSU5URVJOQUwpOwotICAgICAgICAgICAgICAgIHJzYy0+dGltZXJQcmludCgpOwotICAgICAgICAgICAgICAgIHJzYy0+dGltZXJSZXNldCgpOwotICAgICAgICAgICAgfQotICAgICAgICB9Ci0gICAgfQotCi0gICAgQUxPR1YoIiVwIFJTIFRocmVhZCBleGl0aW5nIiwgcnNjKTsKLQotICAgIGlmIChyc2MtPm1Jc0dyYXBoaWNzQ29udGV4dCkgewotICAgICAgICBwdGhyZWFkX211dGV4X2xvY2soJmdJbml0TXV0ZXgpOwotICAgICAgICByc2MtPmRlaW5pdEVHTCgpOwotICAgICAgICBwdGhyZWFkX211dGV4X3VubG9jaygmZ0luaXRNdXRleCk7Ci0g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0KLXZvaWQgcnNpX0NvbnRleHRJbml0VG9DbGllbnQoQ29udGV4dCAqcnNjKSB7Ci0gICAgcnNjLT5pbml0VG9DbGllbnQoKTsKLX0KLQotdm9pZCByc2lfQ29udGV4dERlaW5pdFRvQ2xpZW50KENvbnRleHQgKnJzYykgewotICAgIHJzYy0+ZGVpbml0VG9DbGllbnQoKTsKLX0KLQotfQotfQotCi1Sc0NvbnRleHQgcnNDb250ZXh0Q3JlYXRlKFJzRGV2aWNlIHZkZXYsIHVpbnQzMl90IHZlcnNpb24sCi0gICAgICAgICAgICAgICAgICAgICAgICAgIHVpbnQzMl90IHNka1ZlcnNpb24pIHsKLSAgICBBTE9HVigicnNDb250ZXh0Q3JlYXRlIGRldj0lcCIsIHZkZXYpOwotICAgIERldmljZSAqIGRldiA9IHN0YXRpY19jYXN0PERldmljZSAqPih2ZGV2KTsKLSAgICBDb250ZXh0ICpyc2MgPSBDb250ZXh0OjpjcmVhdGVDb250ZXh0KGRldiwgTlVMTCk7Ci0gICAgaWYgKHJzYykgewotICAgICAgICByc2MtPnNldFRhcmdldFNka1ZlcnNpb24oc2RrVmVyc2lvbik7Ci0gICAgfQotICAgIHJldHVybiByc2M7Ci19Ci0KLVJzQ29udGV4dCByc0NvbnRleHRDcmVhdGVHTChSc0RldmljZSB2ZGV2LCB1aW50MzJfdCB2ZXJzaW9uLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgIHVpbnQzMl90IHNka1ZlcnNpb24sIFJzU3VyZmFjZUNvbmZpZyBzYywKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICB1aW50MzJfdCBkcGkpIHsKLSAgICBBTE9HVigicnNDb250ZXh0Q3JlYXRlR0wgZGV2PSVwIiwgdmRldik7Ci0gICAgRGV2aWNlICogZGV2ID0gc3RhdGljX2Nhc3Q8RGV2aWNlICo+KHZkZXYpOwotICAgIENvbnRleHQgKnJzYyA9IENvbnRleHQ6OmNyZWF0ZUNvbnRleHQoZGV2LCAmc2MpOwotICAgIG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wb25lbnQ7Ci0gICAgY29tcG9uZW50LmxvYWRGcm9tU3RyZWFtKHN0cmVhbSk7Ci0KLSAgICB1aW50MzJfdCBmaWVsZENvdW50ID0gc3RyZWFtLT5sb2FkVTMyKCk7Ci0gICAgaWYgKCFmaWVsZENvdW50KSB7Ci0gICAgICAgIHJldHVybiAoRWxlbWVudCAqKUVsZW1lbnQ6OmNyZWF0ZShyc2MsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb21wb25lbnQuZ2V0VHlwZSgpLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY29tcG9uZW50LmdldEtpbmQoKSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbXBvbmVudC5nZXRJc05vcm1hbGl6ZWQoKSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbXBvbmVudC5nZXRWZWN0b3JTaXplKCkpOzsKLSAgICB9Ci0KLSAgICBjb25zdCBFbGVtZW50ICoqc3ViRWxlbXMgPSBuZXcgY29uc3QgRWxlbWVudCAqW2ZpZWxkQ291bnRdOwotICAgIGNvbnN0IGNoYXIgKipzdWJFbGVtTmFtZXMgPSBuZXcgY29uc3QgY2hhciAqW2ZpZWxkQ291bnRdOwotICAgIHNpemVfdCAqc3ViRWxlbU5hbWVzTGVuZ3RocyA9IG5ldyBzaXplX3RbZmllbGRDb3VudF07Ci0gICAgdWludDMyX3QgKmFycmF5U2l6ZXMgPSBuZXcgdWludDMyX3RbZmllbGRDb3VudF07Ci0KLSAgICBTdHJpbmc4IGVsZW1OYW1lOwotICAgIGZvciAodWludDMyX3QgY3QgPSAwOyBjdCA8IGZpZWxkQ291bnQ7IGN0ICsrKSB7Ci0gICAgICAgIHN0cmVhbS0+bG9hZFN0cmluZygmZWxlbU5hbWUpOwotICAgICAgICBzdWJFbGVtTmFtZXNMZW5ndGhzW2N0XSA9IGVsZW1OYW1l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JlZjxjb25zdCBFbGVtZW50PiByZXR1cm5SZWY7Ci0gICAgLy8gTG9vayBmb3IgYW4gZXhpc3RpbmcgbWF0Y2guCi0gICAgT2JqZWN0QmFzZTo6YXN5bmNMb2NrKCk7Ci0gICAgZm9yICh1aW50MzJfdCBjdD0wOyBjdCA8IHJzYy0+bVN0YXRlRWxlbWVudC5tRWxlbWVudHMuc2l6ZSgpOyBjdCsrKSB7Ci0gICAgICAgIGNvbnN0IEVsZW1lbnQgKmVlID0gcnNjLT5tU3RhdGVFbGVtZW50Lm1FbGVtZW50c1tjdF07Ci0gICAgICAgIGlmIChlZS0+Z2V0RmllbGRDb3VudCgpID09IGNvdW50KSB7Ci0gICAgICAgICAgICBib29sIG1hdGNoID0gdHJ1ZTsKLSAgICAgICAgICAgIGZvciAodWludDMyX3QgaT0wOyBpIDwgY291bnQ7IGkrKykgewotICAgICAgICAgICAgICAgIGlmICgoZWUtPm1GaWVsZHNbaV0uZS5nZXQoKSAhPSBlaW5baV0pIHx8Ci0gICAgICAgICAgICAgICAgICAgIChlZS0+bUZpZWxkc1tpXS5uYW1lLmxlbmd0aCgpICE9IGxlbmd0aHNbaV0pIHx8Ci0gICAgICAgICAgICAgICAgICAgIChlZS0+bUZpZWxkc1tpXS5uYW1lICE9IG5pbltpXSkgfHwKLSAgICAgICAgICAgICAgICAgICAgKGVlLT5tRmllbGRzW2ldLmFycmF5U2l6ZSAhPSBhc2luW2ldKSkgewotICAgICAgICAgICAgICAgICAgICBtYXRjaCA9IGZhbHNlOwotICAgICAgICAgICAgICAgICAgICBicmVhazsKLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICB9Ci0gICAgICAgICAgICBpZiAobWF0Y2gpIHsKLSAgICAgICAgICAgICAgICByZXR1cm5SZWYuc2V0KGVlKTsKLSAgICAgICAgICAgICAgICBPYmplY3RCYXNlOjphc3luY1VubG9jaygpOwotICAgICAgICAgICAgICAgIHJldHVybiByZXR1cm5SZWY7Ci0gICAgICAgICAgICB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XJuOwotICAgIH0KLQotICAgIGNvbnN0IHVpbnQ4X3QgKnAgPSBzdGF0aWNfY2FzdDxjb25zdCB1aW50OF90ICo+KHB0cik7Ci0gICAgZm9yICh1aW50MzJfdCBpPTA7IGkgPCBtRmllbGRDb3VudDsgaSsrKSB7Ci0gICAgICAgIGlmIChtRmllbGRzW2ldLmUtPm1IYXNSZWZlcmVuY2UpIHsKLSAgICAgICAgICAgIGNvbnN0IHVpbnQ4X3QgKnAyID0gJnBbbUZpZWxkc1tpXS5vZmZzZXRCaXRzID4+IDNdOwotICAgICAgICAgICAgZm9yICh1aW50MzJfdCBjdD0wOyBjdCA8IG1GaWVsZHNbaV0uYXJyYXlTaXplOyBjdCsrKSB7Ci0gICAgICAgICAgICAgICAgbUZpZWxkc1tpXS5lLT5pbmNSZWZzKHAyKTsKLSAgICAgICAgICAgICAgICBwMiArPSBtRmllbGRzW2ldLmUtPmdldFNpemVCeXRlcygpOwotICAgICAgICAgICAgfQotICAgICAgICB9Ci0gICAgfQotfQotCi12b2lkIEVsZW1lbnQ6OmRlY1JlZnMoY29uc3Qgdm9pZCAqcHRyKSBjb25zdCB7Ci0gICAgaWYgKCFtRmllbGRDb3VudCkgewotICAgICAgICBpZiAobUNvbXBvbmVudC5pc1JlZmVyZW5jZSgpKSB7Ci0gICAgICAgICAgICBPYmplY3RCYXNlICpjb25zdCpvYnAgPSBzdGF0aWNfY2FzdDxPYmplY3RCYXNlICpjb25zdCo+KHB0cik7Ci0gICAgICAgICAgICBPYmplY3RCYXNlICpvYiA9IG9icFswXTsKLSAgICAgICAgICAgIGlmIChvYikgb2ItPmRlY1N5c1JlZigpOwotICAgICAgICB9Ci0gICAgICAgIHJldHVybjsKLSAgICB9Ci0KLSAgICBjb25zdCB1aW50OF90ICpwID0gc3RhdGljX2Nhc3Q8Y29uc3QgdWludDhfdCAqPihwdHIpOwotICAgIGZvciAodWludDMyX3QgaT0wOyBpIDwgbUZpZWxkQ291bnQ7IGkrKykgewotICAgICAgICB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UgZHQsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgUnNEYXRhS2luZCBkaywKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBib29sIG5vcm0sCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgdWludDMyX3QgdmVjU2l6ZSkgewotICAgIHJldHVybiAoUnNFbGVtZW50KUVsZW1lbnQ6OmNyZWF0ZShyc2MsIGR0LCBkaywgbm9ybSwgdmVjU2l6ZSk7Ci19Ci0KLQotUnNFbGVtZW50IHJzaV9FbGVtZW50Q3JlYXRlMihDb250ZXh0ICpyc2MsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbnN0IFJzRWxlbWVudCAqIGVpbiwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2l6ZV90IGVpbl9sZW5ndGgsCi0KLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY29uc3QgY2hhciAqKiBuYW1lcywKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2l6ZV90IG5hbWVMZW5ndGhzX2xlbmd0aCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY29uc3Qgc2l6ZV90ICogbmFtZUxlbmd0aHMsCi0KLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY29uc3QgdWludDMyX3QgKiBhcnJheVNpemVzLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzaXplX3QgYXJyYXlTaXplc19sZW5ndGgpIHsKLSAgICByZXR1cm4gKFJzRWxlbWVudClFbGVtZW50OjpjcmVhdGUocnNjLCBlaW5fbGVuZ3RoLCAoY29uc3QgRWxlbWVudCAqKillaW4sCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG5hbWVzLCBuYW1lTGVuZ3RocywgYXJyYXlTaXplcyk7Ci19Ci0KLX0KLX0KLQotdm9pZCByc2FFbGVtZW50R2V0TmF0aXZlRGF0YShSc0NvbnRleHQgY29uLCBSc0VsZW1lbnQgZWxlbSwKLSAgICAgIC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fQotCi0gICAgdm9pZCBkdW1wTE9HVihjb25zdCBjaGFyICpwcmVmaXgpIGNvbnN0OwotICAgIHZpcnR1YWwgdm9pZCBzZXJpYWxpemUoT1N0cmVhbSAqc3RyZWFtKSBjb25zdDsKLSAgICB2aXJ0dWFsIFJzQTNEQ2xhc3NJRCBnZXRDbGFzc0lkKCkgY29uc3QgeyByZXR1cm4gUlNfQTNEX0NMQVNTX0lEX0VMRU1FTlQ7IH0KLSAgICBzdGF0aWMgRWxlbWVudCAqY3JlYXRlRnJvbVN0cmVhbShDb250ZXh0ICpyc2MsIElTdHJlYW0gKnN0cmVhbSk7Ci0KLSAgICBzdGF0aWMgT2JqZWN0QmFzZVJlZjxjb25zdCBFbGVtZW50PiBjcmVhdGVSZWYoQ29udGV4dCAqcnNjLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBSc0RhdGFUeXBlIGR0LAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBSc0RhdGFLaW5kIGRrLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBib29sIGlzTm9ybSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdWludDMyX3QgdmVjU2l6ZSk7Ci0gICAgc3RhdGljIE9iamVjdEJhc2VSZWY8Y29uc3QgRWxlbWVudD4gY3JlYXRlUmVmKENvbnRleHQgKnJzYywgc2l6ZV90IGNvdW50LAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb25zdCBFbGVtZW50ICoqLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb25zdCBjaGFyICoqLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb25zdCBzaXplX3QgKiBsZW5ndGhzLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb25zdCB1aW50MzJfdCAqYXNpbik7Ci0KLSAgICBzdGF0aWMgY29uc3QgRWxlbWVudCogY3JlYXRlKENvbnRleHQgKnJzYywKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFJzRGF0YVR5cGUgZHQsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBSc0RhdGFLaW5kIGRrLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYm9vbCBpc05vcm0sCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB1aW50MzJfdCB2ZWNTaXplKSB7Ci0gICAgICAgIE9iamVjdEJhc2VSZWY8Y29uc3QgRWxlbWVudD4gZWxlbSA9IGNyZWF0ZVJlZihyc2MsIGR0LCBkaywgaXNOb3JtLCB2ZWNTaXplKTsKLSAgICAgICAgZWxlbS0+aW5jVXNlclJlZigpOwotICAgICAgICByZXR1cm4gZWxlbS5nZXQoKTsKLSAgICB9Ci0gICAgc3RhdGljIGNvbnN0IEVsZW1lbnQqIGNyZWF0ZShDb250ZXh0ICpyc2MsIHNpemVfdCBjb3VudCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbnN0IEVsZW1lbnQgKiplaW4sCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb25zdCBjaGFyICoqbmluLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY29uc3Qgc2l6ZV90ICogbGVuZ3RocywKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbnN0IHVpbnQzMl90ICphc2luKSB7Ci0gICAgICAgIE9iamVjdEJhc2VSZWY8Y29uc3QgRWxlbWVudD4gZWxlbSA9IGNyZWF0ZVJlZihyc2MsIGNvdW50LCBlaW4sIG5pbiwgbGVuZ3RocywgYXNpbik7Ci0gICAgICAgIGVsZW0tPmluY1VzZXJSZWYoKTsKLSAgICAgICAgcmV0dX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EJhc2VSZWY8VHlwZT4gaW5wdXRUeXBlID0gVHlwZTo6Z2V0VHlwZVJlZihtUlNDLCBjb25zdElucHV0LmdldCgpLCAxLCAwLCAwLCBmYWxzZSwgZmFsc2UpOwotCi0gICAgdWludDMyX3QgdG1wWzRdOwotICAgIHRtcFswXSA9IFJTX1BST0dSQU1fUEFSQU1fQ09OU1RBTlQ7Ci0gICAgdG1wWzFdID0gKHVpbnQzMl90KWlucHV0VHlwZS5nZXQoKTsKLSAgICB0bXBbMl0gPSBSU19QUk9HUkFNX1BBUkFNX1RFWFRVUkVfVFlQRTsKLSAgICB0bXBbM10gPSBSU19URVhUVVJFXzJEOwotCi0gICAgbUZvbnRTaGFkZXJGQ29uc3RhbnQuc2V0KEFsbG9jYXRpb246OmNyZWF0ZUFsbG9jYXRpb24obVJTQywgaW5wdXRUeXBlLmdldCgpLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFJTX0FMTE9DQVRJT05fVVNBR0VfU0NSSVBUIHwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBSU19BTExPQ0FUSU9OX1VTQUdFX0dSQVBISUNTX0NPTlNUQU5UUykpOwotICAgIFByb2dyYW1GcmFnbWVudCAqcGYgPSBuZXcgUHJvZ3JhbUZyYWdtZW50KG1SU0MsIHNoYWRlclN0cmluZy5zdHJpbmcoKSwgc2hhZGVyU3RyaW5nLmxlbmd0aCgpLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRleHR1cmVOYW1lcywgbnVtVGV4dHVyZXMsIHRleHR1cmVOYW1lc0xlbmd0aHMsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdG1wLCA0KTsKLSAgICBtRm9udFNoYWRlckYuc2V0KHBmKTsKLSAgICBtRm9udFNoYWRlckYtPmJpbmRBbGxvY2F0aW9uKG1SU0MsIG1Gb250U2hhZGVyRkNvbnN0YW50LmdldCgpLCAwKTsKLQotICAgIG1Gb250U2FtcGxlci5zZXQoU2FtcGxlcjo6Z2V0U2FtcGxlcihtUlNDLCBSU19TQU1QTEVSX05FQVJFU1QsIFJTX1NBTVBMRVJfTkVBUkVTVCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgUlNfU0FNUExFUl9DTEFNUCwgUlNfU0FNUExFUl9DTEFNUCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgUlNfU0FNUExFUl9DTEFNUCkuZ2V0KCkpOwotICAgIG1Gb250U2hhZGVyRi0+YmluZFNhbXBsZXIobVJTQywgMCwgbUZvbnRTYW1wbGVyLmdldCgpKTsKLQotICAgIG1Gb250UHJvZ3JhbVN0b3JlLnNldChQcm9ncmFtU3RvcmU6OmdldFByb2dyYW1TdG9yZShtUlNDLCB0cnVlLCB0cnVlLCB0cnVlLCB0cnVlLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBmYWxzZSwgZmFsc2UsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFJTX0JMRU5EX1NSQ19TUkNfQUxQSEEsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFJTX0JMRU5EX0RTVF9PTkVfTUlOVVNfU1JDX0FMUEhBLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBSU19ERVBUSF9GVU5DX0FMV0FZUykuZ2V0KCkpOwotICAgIG1Gb250UHJvZ3JhbVN0b3JlLT5pbml0KCk7Ci19Ci0KLXZvaWQgRm9udFN0YXRlOjppbml0VGV4dFRleHR1cmUoKSB7Ci0gICAgT2JqZWN0QmFzZVJlZjxjb25zdCBFbGVtZW50PiBhbHBoYUVsZW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gICAgcmV0dXJuOwotICAgIH0KLQotICAgIG1NZXNoLT5yZW5kZXJQcmltaXRpdmVSYW5nZShtUlNDLCAwLCAwLCBtQ3VycmVudFF1YWRJbmRleCAqIDYpOwotfQotCi12b2lkIEZvbnRTdGF0ZTo6YXBwZW5kTWVzaFF1YWQoZmxvYXQgeDEsIGZsb2F0IHkxLCBmbG9hdCB6MSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBmbG9hdCB1MSwgZmxvYXQgdjEsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZmxvYXQgeDIsIGZsb2F0IHkyLCBmbG9hdCB6MiwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBmbG9hdCB1MiwgZmxvYXQgdjIsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZmxvYXQgeDMsIGZsb2F0IHkzLCBmbG9hdCB6MywKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBmbG9hdCB1MywgZmxvYXQgdjMsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZmxvYXQgeDQsIGZsb2F0IHk0LCBmbG9hdCB6NCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBmbG9hdCB1NCwgZmxvYXQgdjQpIHsKLSAgICBjb25zdCB1aW50MzJfdCB2ZXJ0c1BlclF1YWQgPSA0OwotICAgIGNvbnN0IHVpbnQzMl90IGZsb2F0c1BlclZlcnQgPSA2OwotICAgIGZsb2F0ICpjdXJyZW50UG9zID0gbVRleHRNZXNoUHRyICsgbUN1cnJlbnRRdWFkSW5kZXggKiB2ZXJ0c1BlclF1YWQgKiBmbG9hdHNQZXJWZXJ0OwotCi0gICAgaWYgKHgxID4gbVN1cmZhY2VXaWR0aCB8fCB5MSA8IDAuMGYgfHwgeDIgPCAwIHx8IHk0ID4gbVN1cmZhY2VIZWlnaHQpIHsKLSAgICAgICAgcmV0dXJuOwotICAgIH0KLQotICAgIC8qTE9HRSgiVjAgeDogJWYgeTogJWYgejogJWYiLCB4MSwgeTEsIHoxKTsKLSAgICBBTE9HRSgiVjEgeDogJWYgeTogJWYgejogJWYiLCB4MiwgeTIsIHoyKTsKLSAgICBBTE9HRSgiVjIgeDogJWYgeTogJWYgejogJWYiLCB4MywgeTMsIHozKTsKLSAgICBBTE9HRSgiVjMgeDogJWYgeTogJWYgejogJWYiLCB4NCwgeTQsIHo0KTsqLwotCi0gICAgKCpjdXJyZW50UG9zKyspID0geDE7Ci0gICAgKCpjdXJyZW50UG9zKyspID0geTE7Ci0gICAgKCpjdXJyZW50UG9zKyspID0gejE7Ci0gICAgKCpjdXJyZW50UG9zKyspID0gMDsKLSAgICAoKmN1cnJlbnRQb3MrKykgPSB1MTsKLSAgICAoKmN1cnJlbnRQb3MrKykgPSB2MTsKLQotICAgICgqY3VycmVudFBvcysrKSA9IHgyOwotICAgICgqY3VycmVudFBvcysrKSA9IHkyOwotICAgICgqY3VycmVudFBvcysrKSA9IHoyOwotICAgICgqY3VycmVudFBvcysrKSA9IDA7Ci0gICAgKCpjdXJyZW50UG9zKyspID0gdTI7Ci0gICAgKCpjdXJyZW50UG9zKyspID0gdjI7Ci0KLSAgICAoKmN1cnJlbnRQb3MrKykgPSB4MzsKLSAgICAoKmN1cnJlbnRQb3MrKykgPSB5MzsKLSAgICAoKmN1cnJlbnRQb3MrKykgPSB6MzsKLSAgICAoKmN1cnJlbnRQb3MrKykgPSAwOwotICAgICgqY3VycmVudFBvcysrKSA9IHUzOwotICAgICgqY3VycmVudFBvcysrKSA9IHYzOwotCi0gICAgKCpjdXJyZW50UG9zKyspID0geDQ7Ci0gICAgKCpjdXJyZW50UG9zKyspID0geTQ7Ci0gICAgKCpjdXJyZW50UG9zKyspID0gejQ7Ci0gICAgKCpjdXJyZW50UG9zKyspID0gMDsKLSAgICAoKmN1cnJlbnRQb3MrKykgPSB1NDsKLSAgICAoKmN1cnJlbnRQb3MrKykgPSB2NDsKLQotICAgIG1DdXJyZW50UXVhZEluZGV4ICs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HsKLSAgICAgICAgZm9udC0+Z2V0Q2FjaGVkVVRGQ2hhcigoaW50MzJfdCltTGF0aW5QcmVjYWNoZVtwcmVjYWNoZUlkeF0pOwotICAgICAgICByZW1haW5pbmdDYXBhY2l0eSA9IGdldFJlbWFpbmluZ0NhY2hlQ2FwYWNpdHkoKTsKLSAgICAgICAgcHJlY2FjaGVJZHggKys7Ci0gICAgfQotfQotCi0KLXZvaWQgRm9udFN0YXRlOjpyZW5kZXJUZXh0KGNvbnN0IGNoYXIgKnRleHQsIHVpbnQzMl90IGxlbiwgaW50MzJfdCB4LCBpbnQzMl90IHksCi0gICAgICAgICAgICAgICAgICAgICAgICAgICB1aW50MzJfdCBzdGFydEluZGV4LCBpbnQzMl90IG51bUdseXBocywKLSAgICAgICAgICAgICAgICAgICAgICAgICAgIEZvbnQ6OlJlbmRlck1vZGUgbW9kZSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgIEZvbnQ6OlJlY3QgKmJvdW5kcywKLSAgICAgICAgICAgICAgICAgICAgICAgICAgIHVpbnQ4X3QgKmJpdG1hcCwgdWludDMyX3QgYml0bWFwVywgdWludDMyX3QgYml0bWFwSCkgewotICAgIGNoZWNrSW5pdCgpOwotCi0gICAgLy8gUmVuZGVyIGNvZGUgaGVyZQotICAgIEZvbnQgKmN1cnJlbnRGb250ID0gbVJTQy0+Z2V0Rm9udCgpOwotICAgIGlmICghY3VycmVudEZvbnQpIHsKLSAgICAgICAgaWYgKCFtRGVmYXVsdC5nZXQoKSkgewotICAgICAgICAgICAgU3RyaW5nOCBmb250c0RpcigiL2ZvbnRzL1JvYm90by1SZWd1bGFyLnR0ZiIpOwotICAgICAgICAgICAgU3RyaW5nOCBmdWxsUGF0aChnZXRlbnYoIkFORFJPSURfUk9PVCIpKTsKLSAgICAgICAgICAgIGZ1bGxQYXRoICs9IGZvbnRzRGlyOwotCi0gICAgICAgICAgICBtRGVmYXVsdC5zZXQoRm9udDo6Y3JlYXRlKG1SU0MsIGZ1bGxQY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AqcmV0T3JpZ2luWSA9IG1DdXJyZW50Um93OwotICAgICAgICBtQ3VycmVudENvbCArPSBiaXRtYXAtPndpZHRoOwotICAgICAgICBtRGlydHkgPSB0cnVlOwotICAgICAgIHJldHVybiB0cnVlOwotICAgIH0KLQotICAgIHJldHVybiBmYWxzZTsKLX0KLSNlbmRpZiAvL0FORFJPSURfUlNfU0VSSUFMSVpFCi0KLW5hbWVzcGFjZSBhbmRyb2lkIHsKLW5hbWVzcGFjZSByZW5kZXJzY3JpcHQgewotCi1Sc0ZvbnQgcnNpX0ZvbnRDcmVhdGVGcm9tRmlsZShDb250ZXh0ICpyc2MsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjaGFyIGNvbnN0ICpuYW1lLCBzaXplX3QgbmFtZV9sZW5ndGgsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICBmbG9hdCBmb250U2l6ZSwgdWludDMyX3QgZHBpKSB7Ci0gICAgRm9udCAqbmV3Rm9udCA9IEZvbnQ6OmNyZWF0ZShyc2MsIG5hbWUsIGZvbnRTaXplLCBkcGkpOwotICAgIGlmIChuZXdGb250KSB7Ci0gICAgICAgIG5ld0ZvbnQtPmluY1VzZXJSZWYoKTsKLSAgICB9Ci0gICAgcmV0dXJuIG5ld0ZvbnQ7Ci19Ci0KLVJzRm9udCByc2lfRm9udENyZWF0ZUZyb21NZW1vcnkoQ29udGV4dCAqcnNjLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjaGFyIGNvbnN0ICpuYW1lLCBzaXplX3QgbmFtZV9sZW5ndGgsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZsb2F0IGZvbnRTaXplLCB1aW50MzJfdCBkcGksCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbnN0IHZvaWQgKmRhdGEsIHNpemVfdCBkYXRhX2xlbmd0aCkgewotICAgIEZvbnQgKm5ld0ZvbnQgPSBGb250OjpjcmVhdGUocnNjLCBuYW1lLCBm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ICAgICAgIGJvb2wgbUlzVmFsaWQ7Ci0gICAgICAgIC8vIExvY2F0aW9uIG9mIHRoZSBjYWNoZWQgZ2x5cGggaW4gdGhlIGJpdG1hcAotICAgICAgICAvLyBpbiBjYXNlIHdlIG5lZWQgdG8gcmVzaXplIHRoZSB0ZXh0dXJlCi0gICAgICAgIHVpbnQzMl90IG1CaXRtYXBNaW5YOwotICAgICAgICB1aW50MzJfdCBtQml0bWFwTWluWTsKLSAgICAgICAgdWludDMyX3QgbUJpdG1hcFdpZHRoOwotICAgICAgICB1aW50MzJfdCBtQml0bWFwSGVpZ2h0OwotICAgICAgICAvLyBBbHNvIGNhY2hlIHRleHR1cmUgY29vcmRzIGZvciB0aGUgcXVhZAotICAgICAgICBmbG9hdCBtQml0bWFwTWluVTsKLSAgICAgICAgZmxvYXQgbUJpdG1hcE1pblY7Ci0gICAgICAgIGZsb2F0IG1CaXRtYXBNYXhVOwotICAgICAgICBmbG9hdCBtQml0bWFwTWF4VjsKLSAgICAgICAgLy8gTWluaW1pemUgaG93IG11Y2ggd2UgY2FsbCBmcmVldHlwZQotICAgICAgICBpbnQzMl90IG1HbHlwaEluZGV4OwotICAgICAgICBpbnQzMl90IG1BZHZhbmNlWDsKLSAgICAgICAgaW50MzJfdCBtQWR2YW5jZVk7Ci0gICAgICAgIC8vIFZhbHVlcyBiZWxvdyBjb250YWluIGEgZ2x5cGgncyBvcmlnaW4gaW4gdGhlIGJpdG1hcAotICAgICAgICBpbnQzMl90IG1CaXRtYXBMZWZ0OwotICAgICAgICBpbnQzMl90IG1CaXRtYXBUb3A7Ci0gICAgfTsKLQotICAgIFN0cmluZzggbUZvbnROYW1lOwotICAgIGZsb2F0IG1Gb250U2l6ZTsKLSAgICB1aW50MzJfdCBtRHBpOwotCi0gICAgRm9udChDb250ZXh0ICpyc2MpOwotICAgIGJvb2wgaW5pdChjb25zdCBjaGFyICpuYW1lLCBmbG9hdCBmb250U2l6ZSwgdWludDMyX3QgZHBpLCBjb25zdCB2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MyAqdikgewotICAgIG1lbWNweShtLCB2LT5tLCBzaXplb2YobSkpOwotfQotCi12b2lkIE1hdHJpeDN4Mzo6bG9hZE11bHRpcGx5KGNvbnN0IHJzX21hdHJpeDN4MyAqbGhzLCBjb25zdCByc19tYXRyaXgzeDMgKnJocykgewotICAgIGZvciAoaW50IGk9MCA7IGk8MyA7IGkrKykgewotICAgICAgICBmbG9hdCByaTAgPSAwOwotICAgICAgICBmbG9hdCByaTEgPSAwOwotICAgICAgICBmbG9hdCByaTIgPSAwOwotICAgICAgICBmb3IgKGludCBqPTAgOyBqPDMgOyBqKyspIHsKLSAgICAgICAgICAgIGNvbnN0IGZsb2F0IHJoc19paiA9ICgoY29uc3QgTWF0cml4M3gzICopcmhzKS0+Z2V0KGksIGopOwotICAgICAgICAgICAgcmkwICs9ICgoY29uc3QgTWF0cml4M3gzICopbGhzKS0+Z2V0KGosIDApICogcmhzX2lqOwotICAgICAgICAgICAgcmkxICs9ICgoY29uc3QgTWF0cml4M3gzICopbGhzKS0+Z2V0KGosIDEpICogcmhzX2lqOwotICAgICAgICAgICAgcmkyICs9ICgoY29uc3QgTWF0cml4M3gzICopbGhzKS0+Z2V0KGosIDIpICogcmhzX2lqOwotICAgICAgICB9Ci0gICAgICAgIHNldChpLCAwLCByaTApOwotICAgICAgICBzZXQoaSwgMSwgcmkxKTsKLSAgICAgICAgc2V0KGksIDIsIHJpMik7Ci0gICAgfQotfQotCi12b2lkIE1hdHJpeDN4Mzo6dHJhbnNwb3NlKCkgewotICAgIGludCBpLCBqOwotICAgIGZsb2F0IHRlbXA7Ci0gICAgZm9yIChpID0gMDsgaSA8IDI7ICsraSkgewotICAgICAgICBmb3IgKGogPSBpICsgMTsgaiA8IDM7ICsraikgewotICAgICAgICAgICAgdGVtcCA9IGdldChpLCBqKTsKLSAgICAgICAgICAgIHNldChpLCBqLCBnZXQoaiwgaSkpOwotICAgICAgICAgICAgc2V0KGosIGksIHRlbXApOwotICAgICAgICB9Ci0gICAgfQotf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RvclNpemUoKTsKLSAgICAgICAgICAgICAgICBzdHJpZGUgPSBidWZmZXJFbGVtLT5nZXRTaXplQnl0ZXMoKSAvIHNpemVvZihmbG9hdCk7Ci0gICAgICAgICAgICAgICAgdWludDMyX3Qgb2Zmc2V0ID0gYnVmZmVyRWxlbS0+Z2V0RmllbGRPZmZzZXRCeXRlcyhjdCk7Ci0gICAgICAgICAgICAgICAgcG9zUHRyID0gKGZsb2F0KikoKHVpbnQ4X3QqKW1IYWwuc3RhdGUudmVydGV4QnVmZmVyc1tjdF0tPmdldFB0cigpICsgb2Zmc2V0KTsKLSAgICAgICAgICAgICAgICBudW1WZXJ0cyA9IGJ1ZmZlclR5cGUtPmdldERpbVgoKTsKLSAgICAgICAgICAgICAgICBicmVhazsKLSAgICAgICAgICAgIH0KLSAgICAgICAgfQotICAgICAgICBpZiAocG9zUHRyKSB7Ci0gICAgICAgICAgICBicmVhazsKLSAgICAgICAgfQotICAgIH0KLQotICAgIG1CQm94TWluWzBdID0gbUJCb3hNaW5bMV0gPSBtQkJveE1pblsyXSA9IDFlNjsKLSAgICBtQkJveE1heFswXSA9IG1CQm94TWF4WzFdID0gbUJCb3hNYXhbMl0gPSAtMWU2OwotICAgIGlmICghcG9zUHRyKSB7Ci0gICAgICAgIEFMT0dFKCJVbmFibGUgdG8gY29tcHV0ZSBib3VuZGluZyBib3giKTsKLSAgICAgICAgbUJCb3hNaW5bMF0gPSBtQkJveE1pblsxXSA9IG1CQm94TWluWzJdID0gMC4wZjsKLSAgICAgICAgbUJCb3hNYXhbMF0gPSBtQkJveE1heFsxXSA9IG1CQm94TWF4WzJdID0gMC4wZjsKLSAgICAgICAgcmV0dXJuOwotICAgIH0KLQotICAgIGZvciAodWludDMyX3QgaSA9IDA7IGkgPCBudW1WZXJ0czsgaSArKykgewotICAgICAgICBmb3IgKHVpbnQzMl90IHYgPSAwOyB2IDwgdmVjdG9yU2l6ZTsgdiArKykgewotICAgICAgICAgICAgbUJCb3hNaW5bdl0gPSByc01pbihtQkJveE1pblt2XSwgcG9zUHRyW3ZdKTsKLSAgICAgICAgICAgIG1CQm94TWF4W3ZdID0gcnNNYXgobUJCb3hNYXhbdl0sIHBvc1B0clt2XSk7Ci0gICAgICAgIH0KLSAgICAgICAgcG9zUHRyICs9IHN0cmlkZTsKLSAgICB9Ci19Ci0KLW5hbWVzcGFjZSBhbmRyb2lkIHsKLW5hbWVzcGFjZSByZW5kZXJzY3JpcHQgewotCi1Sc01lc2ggcnNpX01lc2hDcmVhdGUoQ29udGV4dCAqcnNjLAotICAgICAgICAgICAgICAgICAgICAgIFJzQWxsb2NhdGlvbiAqIHZ0eCwgc2l6ZV90IHZ0eENvdW50LAotICAgICAgICAgICAgICAgICAgICAgIFJzQWxsb2NhdGlvbiAqIGlkeCwgc2l6ZV90IGlkeENvdW50LAotICAgICAgICAgICAgICAgICAgICAgIHVpbnQzMl90ICogcHJpbVR5cGUsIHNpemVfdCBwcmltVHlwZUNvdW50KSB7Ci0gICAgcnNBc3NlcnQoaWR4Q291bnQgPT0gcHJpbVR5cGVDb3VudCk7Ci0gICAgTWVzaCAqc20gPSBuZXcgTWVzaChyc2MsIHZ0eENvdW50LCBpZHhDb3VudCk7Ci0gICAgc20tPmluY1VzZXJSZWYoKTsKLQotICAgIGZvciAodWludDMyX3QgaSA9IDA7IGkgPCB2dHhDb3VudDsgaSArKykgewotICAgICAgICBzbS0+c2V0VmVydGV4QnVmZmVyKChBbGxvY2F0aW9uKil2dHhbaV0sIGkpOwotICAgIH0KLQotICAgIGZvciAodWludDMyX3QgaSA9IDA7IGkgPCBpZHhDb3VudDsgaSArKykgewotICAgICAgICBzbS0+c2V0UHJpbWl0aXZlKChBbGxvY2F0aW9uKilpZHhbaV0sIChSc1ByaW1pdGl2ZSlwcmltVHlwZVtpXSwgaSk7Ci0gICAgfQotCi0gICAgc20tPmluaXQoKTsKLQotICAgIHJldHVybiBzbTsKLX0KLQotfX0KLQotdm9pZCByc2FNZXNoR2V0VmVydGV4QnVmZ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W5pdE11dGV4OwotCi0gICAgdm9pZCBhZGQoKSBjb25zdDsKLSAgICB2b2lkIHJlbW92ZSgpIGNvbnN0OwotCi0gICAgU3RyaW5nOCBtTmFtZTsKLSAgICBtdXRhYmxlIGludDMyX3QgbVN5c1JlZkNvdW50OwotICAgIG11dGFibGUgaW50MzJfdCBtVXNlclJlZkNvdW50OwotCi0gICAgbXV0YWJsZSBjb25zdCBPYmplY3RCYXNlICogbVByZXY7Ci0gICAgbXV0YWJsZSBjb25zdCBPYmplY3RCYXNlICogbU5leHQ7Ci0KLSNpZiBSU19PQkpFQ1RfREVCVUcKLSAgICBDYWxsU3RhY2sgbVN0YWNrOwotI2VuZGlmCi0KLX07Ci0KLXRlbXBsYXRlPGNsYXNzIFQ+Ci1jbGFzcyBPYmplY3RCYXNlUmVmIHsKLXB1YmxpYzoKLSAgICBPYmplY3RCYXNlUmVmKCkgewotICAgICAgICBtUmVmID0gTlVMTDsKLSAgICB9Ci0KLSAgICBPYmplY3RCYXNlUmVmKGNvbnN0IE9iamVjdEJhc2VSZWYgJnJlZikgewotICAgICAgICBtUmVmID0gcmVmLmdldCgpOwotICAgICAgICBpZiAobVJlZikgewotICAgICAgICAgICAgbVJlZi0+aW5jU3lzUmVmKCk7Ci0gICAgICAgIH0KLSAgICB9Ci0KLSAgICBPYmplY3RCYXNlUmVmKFQgKnJlZikgewotICAgICAgICBtUmVmID0gcmVmOwotICAgICAgICBpZiAobVJlZikgewotICAgICAgICAgICAgcmVmLT5pbmNTeXNSZWYoKTsKLSAgICAgICAgfQotICAgIH0KLQotICAgIE9iamVjdEJhc2VSZWYgJiBvcGVyYXRvcj0gKGNvbnN0IE9iamVjdEJhc2VSZWYgJnJlZikgewotICAgICAgICBpZiAoJnJlZiAhPSB0aGlzKSB7Ci0gICAgICAgICAgICBzZXQocmVmKTsKLSAgICAgICAgfQotICAgICAgICByZXR1cm4gKnRoaXM7Ci0gICAgfQotCi0gICAgfk9iamVjdEJhc2VSZWYoKSB7Ci0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cmFnbWVudChyc2MsIHNoYWRlclN0cmluZy5zdHJpbmcoKSwgc2hhZGVyU3RyaW5nLmxlbmd0aCgpLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIE5VTEwsIDAsIE5VTEwsIHRtcCwgMik7Ci0gICAgcGYtPmJpbmRBbGxvY2F0aW9uKHJzYywgY29uc3RBbGxvYywgMCk7Ci0gICAgcGYtPnNldENvbnN0YW50Q29sb3IocnNjLCAxLjBmLCAxLjBmLCAxLjBmLCAxLjBmKTsKLQotICAgIG1EZWZhdWx0LnNldChwZik7Ci19Ci0KLXZvaWQgUHJvZ3JhbUZyYWdtZW50U3RhdGU6OmRlaW5pdChDb250ZXh0ICpyc2MpIHsKLSAgICBtRGVmYXVsdC5jbGVhcigpOwotICAgIG1MYXN0LmNsZWFyKCk7Ci19Ci0KLW5hbWVzcGFjZSBhbmRyb2lkIHsKLW5hbWVzcGFjZSByZW5kZXJzY3JpcHQgewotCi1Sc1Byb2dyYW1GcmFnbWVudCByc2lfUHJvZ3JhbUZyYWdtZW50Q3JlYXRlKENvbnRleHQgKnJzYywgY29uc3QgY2hhciAqIHNoYWRlclRleHQsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNpemVfdCBzaGFkZXJMZW5ndGgsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbnN0IGNoYXIqKiB0ZXh0dXJlTmFtZXMsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNpemVfdCB0ZXh0dXJlTmFtZXNDb3VudCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY29uc3Qgc2l6ZV90ICp0ZXh0dXJlTmFtZXNMZW5ndGgsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbnN0IHVpbnQzMl90ICogcGFyYW1zLCBzaXplX3Qg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GF0ZTsKLS8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgotICogQ0FVVElPTgotICoKLSAqIEFueSBsYXlvdXQgY2hhbmdlcyBmb3IgdGhpcyBjbGFzcyBtYXkgcmVxdWlyZSBhIGNvcnJlc3BvbmRpbmcgY2hhbmdlIHRvIGJlCi0gKiBtYWRlIHRvIGZyYW1ld29ya3MvY29tcGlsZS9saWJiY2MvbGliL1NjcmlwdENSVC9yc19jb3JlLmMsIHdoaWNoIGNvbnRhaW5zCi0gKiBhIHBhcnRpYWwgY29weSBvZiB0aGUgaW5mb3JtYXRpb24gYmVsb3cuCi0gKgotICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotY2xhc3MgUHJvZ3JhbVJhc3RlciA6IHB1YmxpYyBQcm9ncmFtQmFzZSB7Ci1wdWJsaWM6Ci0gICAgc3RydWN0IEhhbCB7Ci0gICAgICAgIG11dGFibGUgdm9pZCAqZHJ2OwotCi0gICAgICAgIHN0cnVjdCBTdGF0ZSB7Ci0gICAgICAgICAgICBib29sIHBvaW50U3ByaXRlOwotICAgICAgICAgICAgUnNDdWxsTW9kZSBjdWxsOwotICAgICAgICB9OwotICAgICAgICBTdGF0ZSBzdGF0ZTsKLSAgICB9OwotICAgIEhhbCBtSGFsOwotCi0gICAgdmlydHVhbCB2b2lkIHNldHVwKGNvbnN0IENvbnRleHQgKiwgUHJvZ3JhbVJhc3RlclN0YXRlICopOwotICAgIHZpcnR1YWwgdm9pZCBzZXJpYWxpemUoT1N0cmVhbSAqc3RyZWFtKSBjb25zdDsKLSAgICB2aXJ0dWFsIFJzQTNEQ2xhc3NJRCBnZXRDbGFzc0lkKCkgY29uc3QgeyByZXR1cm4gUlNfQTNEX0NMQVNTX0lEX1BST0dSQU1fUkFTVEVSOyB9Ci0gICAgc3RhdG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0pIGNvbnN0IHsKLX0KLQotUHJvZ3JhbVN0b3JlICpQcm9ncmFtU3RvcmU6OmNyZWF0ZUZyb21TdHJlYW0oQ29udGV4dCAqcnNjLCBJU3RyZWFtICpzdHJlYW0pIHsKLSAgICByZXR1cm4gTlVMTDsKLX0KLQotdm9pZCBQcm9ncmFtU3RvcmU6OmluaXQoKSB7Ci0gICAgbVJTQy0+bUhhbC5mdW5jcy5zdG9yZS5pbml0KG1SU0MsIHRoaXMpOwotfQotCi1Qcm9ncmFtU3RvcmVTdGF0ZTo6UHJvZ3JhbVN0b3JlU3RhdGUoKSB7Ci19Ci0KLVByb2dyYW1TdG9yZVN0YXRlOjp+UHJvZ3JhbVN0b3JlU3RhdGUoKSB7Ci19Ci0KLU9iamVjdEJhc2VSZWY8UHJvZ3JhbVN0b3JlPiBQcm9ncmFtU3RvcmU6OmdldFByb2dyYW1TdG9yZShDb250ZXh0ICpyc2MsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYm9vbCBjb2xvck1hc2tSLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJvb2wgY29sb3JNYXNrRywKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBib29sIGNvbG9yTWFza0IsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYm9vbCBjb2xvck1hc2tBLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJvb2wgZGVwdGhNYXNrLCBib29sIGRpdGhlckVuYWJsZSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBSc0JsZW5kU3JjRnVuYyBzcmNGdW5jLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg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XN0aW5nLT5tSGFsLnN0YXRlLmJsZW5kRHN0ICE9IGRlc3RGdW5jKSBjb250aW51ZTsKLSAgICAgICAgaWYgKGV4aXN0aW5nLT5tSGFsLnN0YXRlLmRlcHRoV3JpdGVFbmFibGUgIT0gZGVwdGhNYXNrKSBjb250aW51ZTsKLSAgICAgICAgaWYgKGV4aXN0aW5nLT5tSGFsLnN0YXRlLmRlcHRoRnVuYyAhPSBkZXB0aEZ1bmMpIGNvbnRpbnVlOwotCi0gICAgICAgIHJldHVyblJlZi5zZXQoZXhpc3RpbmcpOwotICAgICAgICBPYmplY3RCYXNlOjphc3luY1VubG9jaygpOwotICAgICAgICByZXR1cm4gcmV0dXJuUmVmOwotICAgIH0KLSAgICBPYmplY3RCYXNlOjphc3luY1VubG9jaygpOwotCi0gICAgUHJvZ3JhbVN0b3JlICpwZnMgPSBuZXcgUHJvZ3JhbVN0b3JlKHJzYywKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY29sb3JNYXNrUiwgY29sb3JNYXNrRywgY29sb3JNYXNrQiwgY29sb3JNYXNrQSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZGVwdGhNYXNrLCBkaXRoZXJFbmFibGUsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNyY0Z1bmMsIGRlc3RGdW5jLCBkZXB0aEZ1bmMpOwotICAgIHJldHVyblJlZi5zZXQocGZzKTsKLQotICAgIHBmcy0+aW5pdCgpOwotCi0gICAgT2JqZWN0QmFzZTo6YXN5bmNMb2NrKCk7Ci0gICAgcnNjLT5tU3RhdGVGcmFnbWVudFN0b3JlLm1TdG9yZVByb2dyYW1zLnB1c2gocGZzKTsKLSAgICBPYmplY3RCYXNlOjphc3luY1VubG9jaygpOwotCi0gICAgcmV0dXJuIHJldHVyblJlZjsKLX0KLQotCi0KLXZvaWQgUHJvZ3JhbVN0b3JlU3RhdGU6OmluaXQoQ29udGV4dCAqcnNjKSB7Ci0gICAgbURlZmF1bHQuc2V0KFByb2dyYW1TdG9yZTo6Z2V0UHJvZ3JhbVN0b3JlKHJzYywKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdHJ1ZSwgdHJ1ZSwgdHJ1ZSwgdHJ1ZSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdHJ1ZSwgdHJ1ZSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgUlNfQkxFTkRfU1JDX09ORSwgUlNfQkxFTkRfRFNUX1pFUk8sCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFJTX0RFUFRIX0ZVTkNfTEVTUykuZ2V0KCkpOwotfQotCi12b2lkIFByb2dyYW1TdG9yZVN0YXRlOjpkZWluaXQoQ29udGV4dCAqcnNjKSB7Ci0gICAgbURlZmF1bHQuY2xlYXIoKTsKLSAgICBtTGFzdC5jbGVhcigpOwotfQotCi0KLW5hbWVzcGFjZSBhbmRyb2lkIHsKLW5hbWVzcGFjZSByZW5kZXJzY3JpcHQgewotCi1Sc1Byb2dyYW1TdG9yZSByc2lfUHJvZ3JhbVN0b3JlQ3JlYXRlKENvbnRleHQgKnJzYywKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYm9vbCBjb2xvck1hc2tSLCBib29sIGNvbG9yTWFza0csIGJvb2wgY29sb3JNYXNrQiwgYm9vbCBjb2xvck1hc2tBLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBib29sIGRlcHRoTWFzaywgYm9vbCBkaXRoZXJFbmFibGUsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFJzQmxlbmRTcmNGdW5jIHNyY0Z1bmMsIFJzQmxlbmREc3RGdW5jIGRlc3RGdW5jLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBSc0RlcHRoRnVuYyBkZXB0aEZ1bmMpIHsKLQotCi0gICAgT2JqZWN0QmFzZVJlZjxQcm9ncmFtU3RvcmU+IHBzID0gUHJvZ3JhbVN0b3JlOjpnZXRQcm9ncmFtU3RvcmUocnNjLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbG9yTWFza1IsIGNvbG9yTWFza0csCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY29sb3JNYXNrQiwgY29sb3JNYXNrQSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBkZXB0aE1hc2ssIGRpdGhlckVuYWJsZSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzcmNGdW5jLCBkZXN0RnVuYywgZGVwdGhGdW5jKTsKLSAgICBwcy0+aW5jVXNlclJlZigpOwotICAgIHJldHVybiBwcy5nZXQoKTsKLX0KLQotfQotfQpkaWZmIC0tZ2l0IGEvbGlicy9ycy9yc1Byb2dyYW1TdG9yZS5oIGIvbGlicy9ycy9yc1Byb2dyYW1TdG9yZS5oCmRlbGV0ZWQgZmlsZSBtb2RlIDEwMDY0NAppbmRleCA5YmIyNzk1Li4wMDAwMDAwCi0tLSBhL2xpYnMvcnMvcnNQcm9ncmFtU3RvcmUuaAorKysgL2Rldi9udWxsCkBAIC0xLDEwMyArMCwwIEBACi0vKgotICogQ29weXJpZ2h0IChDKSAyMDExIFRoZSBBbmRyb2lkIE9wZW4gU291cmNlIFByb2plY3QKLSAqCi0gKiBMaWNlbnNlZCB1bmRlciB0aGUgQXBhY2hlIExpY2Vuc2UsIFZlcnNpb24gMi4wICh0aGUgIkxpY2Vuc2UiKTsKLSAqIHlvdSBtYXkgbm90IH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KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCi0gKiBDQVVUSU9OCi0gKgotICogQW55IGxheW91dCBjaGFuZ2VzIGZvciB0aGlzIGNsYXNzIG1heSByZXF1aXJlIGEgY29ycmVzcG9uZGluZyBjaGFuZ2UgdG8gYmUKLSAqIG1hZGUgdG8gZnJhbWV3b3Jrcy9jb21waWxlL2xpYmJjYy9saWIvU2NyaXB0Q1JUL3JzX2NvcmUuYywgd2hpY2ggY29udGFpbnMKLSAqIGEgcGFydGlhbCBjb3B5IG9mIHRoZSBpbmZvcm1hdGlvbiBiZWxvdy4KLSAqCi0gKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi1jbGFzcyBQcm9ncmFtU3RvcmUgOiBwdWJsaWMgUHJvZ3JhbUJhc2UgewotcHVibGljOgotICAgIHN0cnVjdCBIYWwgewotICAgICAgICBtdXRhYmxlIHZvaWQgKmRydjsKLQotICAgICAgICBzdHJ1Y3QgU3RhdGUgewotICAgICAgICAgICAgYm9vbCBkaXRoZXJFbmFibGU7Ci0KLSAgICAgICAgICAgIC8vYm9vbCBibGVuZEVuYWJsZTsKLSAgICAgICAgICAgIGJvb2wgY29sb3JSV3JpdGVFbmFibGU7Ci0gICAgICAgICAgICBib29sIGNvbG9yR1dyaXRlRW5hYmxlOwotICAgICAgICAgICAgYm9vbCBjb2xvckJXcml0ZUVuYWJsZTsKLSAgICAgICAgICAgIGJvb2wgY29sb3JBV3JpdGVFbmFibGU7Ci0gICAgICAgICAgICBSc0JsZW5kU3JjRnVuYyBibGVuZFNyYzsKLSAgICAgICAgICAgIFJzQmxlbmREc3RGdW5jIGJsZW5kRHN0OwotCi0gICAgICAgICAgICAvL2Jvb2wgZGVwdGhUZXN0RW5hYmxlOwotICAgICAgICAgICAgYm9vbCBkZXB0aFdyaXRlRW5hYmxlOwotICAgICAgICAgICAgUnNEZXB0aEZ1bmMgZGVwdGhGdW5jOwotICAgICAgICB9OwotICAgICAgICBTdGF0ZSBzdGF0ZTsKLSAgICB9OwotICAgIEhhbCBtSGFsOwotCi0gICAgdmlydHVhbCB2b2lkIHNldHVwKGNvbnN0IENvbnRleHQgKiwgUHJvZ3JhbVN0b3JlU3RhdGUgKik7Ci0KLSAgICB2aXJ0dWFsIHZvaWQgc2VyaWFsaXplKE9TdHJlYW0gKnN0cmVhbSkgY29uc3Q7Ci0gICAgdmlydHVhbCBSc0EzRENsYXNzSUQgZ2V0Q2xhc3NJZCgpIGNvbnN0IHsgcmV0dXJuIFJTX0EzRF9DTEFTU19JRF9QUk9HUkFNX1NUT1JFOyB9Ci0gICAgc3RhdGljIFByb2dyYW1TdG9yZSAqY3JlYXRlRnJvbVN0cmVhbShDb250ZXh0ICpyc2MsIElTdHJlYW0gKnN0cmVhbSk7Ci0gICAgc3RhdGljIE9iamVjdEJhc2VSZWY8UHJvZ3JhbVN0b3JlPiBnZXRQcm9ncmFtU3RvcmUoQ29udGV4dCAqLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJvb2wgY29sb3JNYXNrUiwgYm9vbCBjb2xvck1hc2tHLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJvb2wgY29sb3JNYXNrQiwgYm9vbCBjb2xvck1hc2tBLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJvb2wgZGVwdGhNYXNrLCBib29sIGRpdGhlckVuYWJsZSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBSc0JsZW5kU3JjRnVuYyBzcmNGdW5jLCBSc0JsZW5kRHN0RnVuYyBkZXN0RnVuYywKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA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MyX3QgcHJpbUluZGV4LCB1aW50MzJfdCBzdGFydCwgdWludDMyX3QgbGVuKTsKLXZvaWQgcnNyTWVzaENvbXB1dGVCb3VuZGluZ0JveChDb250ZXh0ICosIFNjcmlwdCAqLCBNZXNoICosCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZmxvYXQgKm1pblgsIGZsb2F0ICptaW5ZLCBmbG9hdCAqbWluWiwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBmbG9hdCAqbWF4WCwgZmxvYXQgKm1heFksIGZsb2F0ICptYXhaKTsKLQotCi0vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8KLS8vCi0vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8KLQotCi12b2lkIHJzckNvbG9yKENvbnRleHQgKiwgU2NyaXB0ICosIGZsb2F0IHIsIGZsb2F0IGcsIGZsb2F0IGIsIGZsb2F0IGEpOwotdm9pZCByc3JBbGxvY2F0aW9uU3luY0FsbChDb250ZXh0ICosIFNjcmlwdCAqLCBBbGxvY2F0aW9uICopOwotCi12b2lkIHJzckFsbG9jYXRpb25Db3B5MURSYW5nZShDb250ZXh0ICosIEFsbG9jYXRpb24gKmRzdEFsbG9jLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdWludDMyX3QgZHN0T2ZmLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdWludDMyX3QgZHN0TWlwLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdWludDMyX3QgY291bnQsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICBBbGxvY2F0aW9uICpzcmNBbGxvYywKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHVpbnQzMl90IHNyY09mZiwgdWludDMyX3Qgc3JjTWlwKTsKLXZvaWQgcnNyQWxsb2NhdGlvbkNvcHkyRFJhbmdlKENvbnRleHQgKiwgQWxsb2NhdGlvbiAqZHN0QWxsb2MsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICB1aW50MzJfdCBkc3RYb2ZmLCB1aW50MzJfdCBkc3RZb2ZmLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdWludDMyX3QgZHN0TWlwLCB1aW50MzJfdCBkc3RGYWNlLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdWludDMyX3Qgd2lkdGgsIHVpbnQzMl90IGhlaWdodCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEFsbG9jYXRpb24gKnNyY0FsbG9jLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdWludDMyX3Qgc3JjWG9mZiwgdWludDMyX3Qgc3JjWW9mZiwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHVpbnQzMl90IHNyY01pcCwgdWludDMyX3Qgc3JjRmFjZSk7Ci0KLXZvaWQgcnNyUHJlcGFyZUNsZWFyKENvbnRleHQgKiwgU2NyaXB0ICopOwotdWludDMyX3QgcnNyR2V0V2lkdGgoQ29udGV4dCAqLCBTY3JpcHQgKik7Ci11aW50MzJfdCByc3JHZXRIZWlnaHQoQ29udGV4dCAqLCBTY3JpcHQgKik7Ci12b2lkIHJzckRyYXdUZXh0QWxsb2MoQ29udGV4dCAqLCBTY3JpcHQgKiwgQWxsb2NhdGlvbiAqLCBpbnQgeCwgaW50IHkpOwotdm9pZCByc3JEcmF3VGV4dChDb250ZXh0ICosIFNjcmlwdCAqLCBjb25zdCBjaGFyICp0ZXh0LCBpbnQgeCwgaW50IHkpOwotdm9pZCByc3JTZXRNZXRyaWNzKENvbnRleHQgKiwgU2NyaXB0ICosIEZvbnQ6OlJlY3QgKm1ldHJpY3MsCi0gICAgICAgICAgICAgICAgICAgaW50MzJfdCAqbGVmdC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AgICAgUnNTYW1wbGVyVmFsdWUgbWFnRmlsdGVyLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFJzU2FtcGxlclZhbHVlIG1pbkZpbHRlciwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBSc1NhbXBsZXJWYWx1ZSB3cmFwUywKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBSc1NhbXBsZXJWYWx1ZSB3cmFwVCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBSc1NhbXBsZXJWYWx1ZSB3cmFwUiwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBmbG9hdCBhbmlzbykgewotICAgIE9iamVjdEJhc2VSZWY8U2FtcGxlcj4gcmV0dXJuUmVmOwotICAgIE9iamVjdEJhc2U6OmFzeW5jTG9jaygpOwotICAgIGZvciAodWludDMyX3QgY3QgPSAwOyBjdCA8IHJzYy0+bVN0YXRlU2FtcGxlci5tQWxsU2FtcGxlcnMuc2l6ZSgpOyBjdCsrKSB7Ci0gICAgICAgIFNhbXBsZXIgKmV4aXN0aW5nID0gcnNjLT5tU3RhdGVTYW1wbGVyLm1BbGxTYW1wbGVyc1tjdF07Ci0gICAgICAgIGlmIChleGlzdGluZy0+bUhhbC5zdGF0ZS5tYWdGaWx0ZXIgIT0gbWFnRmlsdGVyKSBjb250aW51ZTsKLSAgICAgICAgaWYgKGV4aXN0aW5nLT5tSGFsLnN0YXRlLm1pbkZpbHRlciAhPSBtaW5GaWx0ZXIgKSBjb250aW51ZTsKLSAgICAgICAgaWYgKGV4aXN0aW5nLT5tSGFsLnN0YXRlLndyYXBTICE9IHdyYXBTKSBjb250aW51ZTsKLSAgICAgICAgaWYgKGV4aXN0aW5nLT5tSGFsLnN0YXRlLndyYXBUICE9IHdyYXBUKSBjb250aW51ZTsKLSAgICAgICAgaWYgKGV4aXN0aW5nLT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WlucwotICogYSBwYXJ0aWFsIGNvcHkgb2YgdGhlIGluZm9ybWF0aW9uIGJlbG93LgotICoKLSAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLWNsYXNzIFNhbXBsZXIgOiBwdWJsaWMgT2JqZWN0QmFzZSB7Ci1wdWJsaWM6Ci0gICAgc3RydWN0IEhhbCB7Ci0gICAgICAgIG11dGFibGUgdm9pZCAqZHJ2OwotCi0gICAgICAgIHN0cnVjdCBTdGF0ZSB7Ci0gICAgICAgICAgICBSc1NhbXBsZXJWYWx1ZSBtYWdGaWx0ZXI7Ci0gICAgICAgICAgICBSc1NhbXBsZXJWYWx1ZSBtaW5GaWx0ZXI7Ci0gICAgICAgICAgICBSc1NhbXBsZXJWYWx1ZSB3cmFwUzsKLSAgICAgICAgICAgIFJzU2FtcGxlclZhbHVlIHdyYXBUOwotICAgICAgICAgICAgUnNTYW1wbGVyVmFsdWUgd3JhcFI7Ci0gICAgICAgICAgICBmbG9hdCBhbmlzbzsKLSAgICAgICAgfTsKLSAgICAgICAgU3RhdGUgc3RhdGU7Ci0gICAgfTsKLSAgICBIYWwgbUhhbDsKLQotICAgIHN0YXRpYyBPYmplY3RCYXNlUmVmPFNhbXBsZXI+IGdldFNhbXBsZXIoQ29udGV4dCAqLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgUnNTYW1wbGVyVmFsdWUgbWFnRmlsdGVyLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgUnNTYW1wbGVyVmFsdWUgbWluRmlsdGVyLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgUnNTYW1wbGVyVmFsdWUgd3JhcFMsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBSc1NhbXBsZXJWYWx1ZSB3cmFwVCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFJzU2FtcGxlclZhbHVlIHdyYXBSLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZmxvYXQgYW5pc28gPSAxLjBmKTsKLSAgICB2b2lkIGJpbmRUb0NvbnRleHQoU2FtcGxlclN0YXRlICosIHVpbnQzMl90IHNsb3QpOwotICAgIHZvaWQgdW5iaW5kRnJvbUNvbnRleHQoU2FtcGxlclN0YXRlICopOwotCi0gICAgdmlydHVhbCB2b2lkIHNlcmlhbGl6ZShPU3RyZWFtICpzdHJlYW0pIGNvbnN0OwotICAgIHZpcnR1YWwgUnNBM0RDbGFzc0lEIGdldENsYXNzSWQoKSBjb25zdCB7IHJldHVybiBSU19BM0RfQ0xBU1NfSURfU0FNUExFUjsgfQotICAgIHN0YXRpYyBTYW1wbGVyICpjcmVhdGVGcm9tU3RyZWFtKENvbnRleHQgKnJzYywgSVN0cmVhbSAqc3RyZWFtKTsKLQotcHJvdGVjdGVkOgotICAgIGludDMyX3QgbUJvdW5kU2xvdDsKLQotICAgIHZpcnR1YWwgdm9pZCBwcmVEZXN0cm95KCkgY29uc3Q7Ci0gICAgdmlydHVhbCB+U2FtcGxlcigpOwotCi1wcml2YXRlOgotICAgIFNhbXBsZXIoQ29udGV4dCAqKTsKLSAgICBTYW1wbGVyKENvbnRleHQgKiwKLSAgICAgICAgICAgIFJzU2FtcGxlclZhbHVlIG1hZ0ZpbHRlciwKLSAgICAgICAgICAgIFJzU2FtcGxlclZhbHVlIG1pbkZpbHRlciwKLSAgICAgICAgICAgIFJzU2FtcGxlclZhbHVlIHdyYXBTLAotICAgICAgICAgICAgUnNTYW1wbGVyVmFsdWUgd3JhcFQsCi0gICAgICAgICAgICBSc1NhbXBsZXJWYWx1ZSB3cmFwUiwKLSAgICAgICAgICAgIGZsb2F0IGFuaXNvID0gMS4wZik7Ci19OwotCi0KLWNsYXNzIFNhbXBsZXJTdGF0ZSB7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udmlyb21lbnRfdCBtRW52aXJvbWVudDsKLQotICAgIHZvaWQgc2V0U2xvdCh1aW50MzJfdCBzbG90LCBBbGxvY2F0aW9uICphKTsKLSAgICB2b2lkIHNldFZhcih1aW50MzJfdCBzbG90LCBjb25zdCB2b2lkICp2YWwsIHNpemVfdCBsZW4pOwotICAgIHZvaWQgc2V0VmFyT2JqKHVpbnQzMl90IHNsb3QsIE9iamVjdEJhc2UgKnZhbCk7Ci0KLSAgICB2aXJ0dWFsIGJvb2wgZnJlZUNoaWxkcmVuKCk7Ci0KLSAgICB2aXJ0dWFsIHZvaWQgcnVuRm9yRWFjaChDb250ZXh0ICpyc2MsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgdWludDMyX3Qgc2xvdCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb25zdCBBbGxvY2F0aW9uICogYWluLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgIEFsbG9jYXRpb24gKiBhb3V0LAotICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbnN0IHZvaWQgKiB1c3IsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgc2l6ZV90IHVzckJ5dGVzLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbnN0IFJzU2NyaXB0Q2FsbCAqc2MgPSBOVUxMKSA9IDA7Ci0KLSAgICB2aXJ0dWFsIHZvaWQgSW52b2tlKENvbnRleHQgKnJzYywgdWludDMyX3Qgc2xvdCwgY29uc3Qgdm9pZCAqZGF0YSwgc2l6ZV90IGxlbikgPSAwOwotICAgIHZpcnR1YWwgdm9pZCBzZXR1cFNjcmlwdChDb250ZXh0ICpyc2MpID0gMDsKLSAgICB2aXJ0dWFsIHVpbnQzMl90IHJ1bihDb250ZXh0ICopID0gMDsKLXByb3RlY3RlZDoKLSAgICBib29sIG1Jbml0aWFsaXplZDsKLSAgICBPYmplY3RCYXNlUmVmPEFsbG9jYXRpb24+ICptU2xvdHM7Ci0gICAgT2JqZWN0QmFzZV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FtVmVydGV4KCkpOwotICAgIG1FbnZpcm9tZW50Lm1GcmFnbWVudFN0b3JlLnNldChyc2MtPmdldERlZmF1bHRQcm9ncmFtU3RvcmUoKSk7Ci0gICAgbUVudmlyb21lbnQubVJhc3Rlci5zZXQocnNjLT5nZXREZWZhdWx0UHJvZ3JhbVJhc3RlcigpKTsKLQotICAgIHJzYy0+bUhhbC5mdW5jcy5zY3JpcHQuaW52b2tlSW5pdChyc2MsIHRoaXMpOwotCi0gICAgZm9yIChzaXplX3QgaT0wOyBpIDwgbUhhbC5pbmZvLmV4cG9ydGVkUHJhZ21hQ291bnQ7ICsraSkgewotICAgICAgICBjb25zdCBjaGFyICoga2V5ID0gbUhhbC5pbmZvLmV4cG9ydGVkUHJhZ21hS2V5TGlzdFtpXTsKLSAgICAgICAgY29uc3QgY2hhciAqIHZhbHVlID0gbUhhbC5pbmZvLmV4cG9ydGVkUHJhZ21hVmFsdWVMaXN0W2ldOwotICAgICAgICAvL0FMT0dFKCJwcmFnbWEgJXMgJXMiLCBrZXlzW2ldLCB2YWx1ZXNbaV0pOwotICAgICAgICBpZiAoIXN0cmNtcChrZXksICJ2ZXJzaW9uIikpIHsKLSAgICAgICAgICAgIGlmICghc3RyY21wKHZhbHVlLCAiMSIpKSB7Ci0gICAgICAgICAgICAgICAgY29udGludWU7Ci0gICAgICAgICAgICB9Ci0gICAgICAgICAgICBBTE9HRSgiSW52YWxpZCB2ZXJzaW9uIHByYWdtYSB2YWx1ZTogJXNcbiIsIHZhbHVlKTsKLSAgICAgICAgICAgIHJldHVybiBmYWxzZTsKLSAgICAgICAgfQotCi0gICAgICAgIGlmICghc3RyY21wKGtleSwgInN0YXRlVmVydGV4IikpIHsKLSAgICAgICAgICAgIGlmICghc3RyY21wKHZhbHVlLCAiZGVmYXVsdCIpKSB7Ci0gICAgICAgICAgICAgICAgY29udGludWU7Ci0gICAgICAgICAgICB9Ci0gICAgICAgICAgICBpZiAoIXN0cmNtcCh2YWx1ZSwgInBhcmVudCIpKSB7Ci0gICAgICAgICAgICAgICAgbUVudmlyb21lbnQubVZlcnRleC5jbGVhcigpOwotICAgICAgICAgICAgICAgIGNvbnRpbnVlOwotICAgICAgICAgICAgfQotICAgICAgICAgICAgQUxPR0UoIlVucmVjb2duaXplZCB2YWx1ZSAlcyBwYXNzZWQgdG8gc3RhdGVWZXJ0ZXgiLCB2YWx1ZSk7Ci0gICAgICAgICAgICByZXR1cm4gZmFsc2U7Ci0gICAgICAgIH0KLQotICAgICAgICBpZiAoIXN0cmNtcChrZXksICJzdGF0ZVJhc3RlciIpKSB7Ci0gICAgICAgICAgICBpZiAoIXN0cmNtcCh2YWx1ZSwgImRlZmF1bHQiKSkgewotICAgICAgICAgICAgICAgIGNvbnRpbnVlOwotICAgICAgICAgICAgfQotICAgICAgICAgICAgaWYgKCFzdHJjbXAodmFsdWUsICJwYXJlbnQiKSkgewotICAgICAgICAgICAgICAgIG1FbnZpcm9tZW50Lm1SYXN0ZXIuY2xlYXIoKTsKLSAgICAgICAgICAgICAgICBjb250aW51ZTsKLSAgICAgICAgICAgIH0KLSAgICAgICAgICAgIEFMT0dFKCJVbnJlY29nbml6ZWQgdmFsdWUgJXMgcGFzc2VkIHRvIHN0YXRlUmFzdGVyIiwgdmFsdWUpOwotICAgICAgICAgICAgcmV0dXJuIGZhbHNlOwotICAgICAgICB9Ci0KLSAgICAgICAgaWYgKCFzdHJjbXAoa2V5LCAic3RhdGVGcmFnbWVudCIpKSB7Ci0gICAgICAgICAgICBpZiAoIXN0cmNtcCh2YWx1ZSwgImRlZmF1bHQiKSkgewotICAgICAgICAgICAgICAgIGNvbnRpbnVlOwotICAgICAgICAgICAgfQotICAgICAgICAgICAgaWYgKCFzdHJjbXAodmFsdWUsICJwYXJlbnQiKSkgewotICAgICAgICAgICAgICAgIG1FbnZpcm9tZW50Lm1GcmFnbWVudC5jbGVhcigpOwotICAgICAgICAgICAgICAgIGNvbnRpbnVlOwotICAgICAgICAgICAgfQotICAgICAgICAgICAgQUxPR0UoIlVucmVjb2duaXplZCB2YWx1ZSAlcyBwYXNzZWQgdG8gc3RhdGVGcmFnbWVudCIsIHZhbHVlKTsKLSAgICAgICAgICAgIHJldHVybiBmYWxzZTsKLSAgICAgICAgfQotCi0gICAgICAgIGlmICghc3RyY21wKGtleSwgInN0YXRlU3RvcmUiKSkgewotICAgICAgICAgICAgaWYgKCFzdHJjbXAodmFsdWUsICJkZWZhdWx0IikpIHsKLSAgICAgICAgICAgICAgICBjb250aW51ZTsKLSAgICAgICAgICAgIH0KLSAgICAgICAgICAgIGlmICghc3RyY21wKHZhbHVlLCAicGFyZW50IikpIHsKLSAgICAgICAgICAgICAgICBtRW52aXJvbWVudC5tRnJhZ21lbnRTdG9yZS5jbGVhcigpOwotICAgICAgICAgICAgICAgIGNvbnRpbnVlOwotICAgICAgICAgICAgfQotICAgICAgICAgICAgQUxPR0UoIlVucmVjb2duaXplZCB2YWx1ZSAlcyBwYXNzZWQgdG8gc3RhdGVTdG9yZSIsIHZhbHVlKTsKLSAgICAgICAgICAgIHJldHVybiBmYWxzZTsKLSAgICAgICAgfQotICAgIH0KLQotICAgIG1TbG90cyA9IG5ldyBPYmplY3RCYXNlUmVmPEFsbG9jYXRpb24+W21IYWwuaW5mby5leHBvcnRlZFZhcmlhYmxlQ291bnRdOwotICAgIG1UeXBlcyA9IG5ldyBPYmplY3RCYXNlUmVmPGNvbnN0IFR5cGU+W21IYWwuaW5mby5leHBvcnRlZFZhcmlhYmxlQ291bnRdOwotCi0gICAgcmV0dXJuIHRydWU7Ci19Ci0KLW5hbWVzcGFjZSBhbmRyb2lkIHsKLW5hbWVzcGFjZSByZW5kZXJzY3JpcHQgewotCi1Sc1NjcmlwdCByc2lfU2NyaXB0Q0NyZWF0ZShDb250ZXh0ICpyc2MsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICBjb25zdCBjaGFyICpyZXNOYW1lLCBzaXplX3QgcmVzTmFtZV9sZW5ndGgsCi0gICAgICAgICAgICAgICAgICAgICA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AgICAgICAgY29uc3QgUnNTY3JpcHRDYWxsICpjYWxsKSB7Ci0gICAgdGFyZ2V0LT5ydW5Gb3JFYWNoKHJzYywgLyogcm9vdCBzbG90ICovIDAsIGluLCBvdXQsIHVzciwgdXNyQnl0ZXMsIGNhbGwpOwotfQotCi12b2lkIHJzckFsbG9jYXRpb25TeW5jQWxsKENvbnRleHQgKnJzYywgU2NyaXB0ICpzYywgQWxsb2NhdGlvbiAqYSwgUnNBbGxvY2F0aW9uVXNhZ2VUeXBlIHVzYWdlKSB7Ci0gICAgYS0+c3luY0FsbChyc2MsIHVzYWdlKTsKLX0KLQotdm9pZCByc3JBbGxvY2F0aW9uQ29weTFEUmFuZ2UoQ29udGV4dCAqcnNjLCBBbGxvY2F0aW9uICpkc3RBbGxvYywKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHVpbnQzMl90IGRzdE9mZiwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHVpbnQzMl90IGRzdE1pcCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHVpbnQzMl90IGNvdW50LAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgQWxsb2NhdGlvbiAqc3JjQWxsb2MsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICB1aW50MzJfdCBzcmNPZmYsIHVpbnQzMl90IHNyY01pcCkgewotICAgIHJzaV9BbGxvY2F0aW9uQ29weTJEUmFuZ2UocnNjLCBkc3RBbGxvYywgZHN0T2ZmLCAwLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZHN0TWlwLCAwLCBjb3VudCwgMSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNyY0FsbG9jLCBzcmNPZmYsIDAsIHNyY01pcCwgMCk7Ci19Ci0KLXZvaWQgcnNyQWxsb2NhdGlvbkNvcHkyRFJhbmdlKENvbnRleHQgKnJzYywgQWxsb2NhdGlvbiAqZHN0QWxsb2MsCi0gICAgICAgICAgICAgICAgICAgICAgICA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nNldHVwQ2hlY2soKSkgewotICAgICAgICByZXR1cm47Ci0gICAgfQotICAgIHNtLT5yZW5kZXIocnNjKTsKLX0KLQotdm9pZCByc3JEcmF3TWVzaChDb250ZXh0ICpyc2MsIFNjcmlwdCAqc2MsIE1lc2ggKnNtKSB7Ci0gICAgQ0hFQ0tfT0JKKHNtKTsKLSAgICBpZiAoIXJzYy0+c2V0dXBDaGVjaygpKSB7Ci0gICAgICAgIHJldHVybjsKLSAgICB9Ci0gICAgc20tPnJlbmRlcihyc2MpOwotfQotCi12b2lkIHJzckRyYXdNZXNoUHJpbWl0aXZlKENvbnRleHQgKnJzYywgU2NyaXB0ICpzYywgTWVzaCAqc20sIHVpbnQzMl90IHByaW1JbmRleCkgewotICAgIENIRUNLX09CSihzbSk7Ci0gICAgaWYgKCFyc2MtPnNldHVwQ2hlY2soKSkgewotICAgICAgICByZXR1cm47Ci0gICAgfQotICAgIHNtLT5yZW5kZXJQcmltaXRpdmUocnNjLCBwcmltSW5kZXgpOwotfQotCi12b2lkIHJzckRyYXdNZXNoUHJpbWl0aXZlUmFuZ2UoQ29udGV4dCAqcnNjLCBTY3JpcHQgKnNjLCBNZXNoICpzbSwgdWludDMyX3QgcHJpbUluZGV4LAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHVpbnQzMl90IHN0YXJ0LCB1aW50MzJfdCBsZW4pIHsKLSAgICBDSEVDS19PQkooc20pOwotICAgIGlmICghcnNjLT5zZXR1cENoZWNrKCkpIHsKLSAgICAgICAgcmV0dXJuOwotICAgIH0KLSAgICBzbS0+cmVuZGVyUHJpbWl0aXZlUmFuZ2UocnNjLCBwcmltSW5kZXgsIHN0YXJ0LCBsZW4pOwotfQotCi12b2lkIHJzck1lc2hDb21wdXRlQm91bmRpbmdCb3goQ29udGV4dCAqcnNjLCBTY3JpcHQgKnNjLCBNZXNoICpzbSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBmbG9hdCAqbWluWCwgZmxvYXQgKm1pblksI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yIG9mIGJ5ZXMgd2Ugd3JpdGUgaXMgc3Vic3RhbnRpYWwKLSAgICB3aGlsZSAobVBvcyArIG51bUJ5dGVzID49IG1MZW5ndGgpIHsKLSAgICAgICAgZ3Jvd1NpemUoKTsKLSAgICB9Ci0gICAgbWVtY3B5KG1EYXRhICsgbVBvcywgc3JjLCBudW1CeXRlcyk7Ci0gICAgbVBvcyArPSBudW1CeXRlczsKLX0KLQotdm9pZCBPU3RyZWFtOjphZGRPZmZzZXQodWludDY0X3QgdikgewotICAgIGlmIChtVXNlNjQpIHsKLSAgICAgICAgbVBvcyA9IChtUG9zICsgNykgJiAofjcpOwotICAgICAgICBpZiAobVBvcyArIHNpemVvZih2KSA+PSBtTGVuZ3RoKSB7Ci0gICAgICAgICAgICBncm93U2l6ZSgpOwotICAgICAgICB9Ci0gICAgICAgIG1EYXRhW21Qb3MrK10gPSAodWludDhfdCkodiAmIDB4ZmYpOwotICAgICAgICBtRGF0YVttUG9zKytdID0gKHVpbnQ4X3QpKCh2ID4+IDgpICYgMHhmZik7Ci0gICAgICAgIG1EYXRhW21Qb3MrK10gPSAodWludDhfdCkoKHYgPj4gMTYpICYgMHhmZik7Ci0gICAgICAgIG1EYXRhW21Qb3MrK10gPSAodWludDhfdCkoKHYgPj4gMjQpICYgMHhmZik7Ci0gICAgICAgIG1EYXRhW21Qb3MrK10gPSAodWludDhfdCkoKHYgPj4gMzIpICYgMHhmZik7Ci0gICAgICAgIG1EYXRhW21Qb3MrK10gPSAodWludDhfdCkoKHYgPj4gNDApICYgMHhmZik7Ci0gICAgICAgIG1EYXRhW21Qb3MrK10gPSAodWludDhfdCkoKHYgPj4gNDgpICYgMHhmZik7Ci0gICAgICAgIG1EYXRhW21Qb3MrK10gPSAodWludDhfdCkoKHYgPj4gNTYpICYgMHhmZik7Ci0gICAgfSBlbHNlIHsKLSAgICAgICAgYWRkVTMyKHYpOwotICAgIH0KLX0KLQotdm9pZCBPU3RyZWFtOjphZGRTdHJpbmcoU3RyaW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WN0IHBvbGxmZCBwWzJdOwotICAgIHBbMF0uZmQgPSBtVG9Db3JlLmdldFJlYWRGZCgpOwotICAgIHBbMF0uZXZlbnRzID0gUE9MTElOOwotICAgIHBbMF0ucmV2ZW50cyA9IDA7Ci0gICAgcFsxXS5mZCA9IHdhaXRGZDsKLSAgICBwWzFdLmV2ZW50cyA9IFBPTExJTjsKLSAgICBwWzFdLnJldmVudHMgPSAwOwotICAgIGludCBwb2xsQ291bnQgPSAxOwotICAgIGlmICh3YWl0RmQgPj0gMCkgewotICAgICAgICBwb2xsQ291bnQgPSAyOwotICAgIH0KLQotICAgIGlmIChjb24tPnByb3BzLm1Mb2dUaW1lcykgewotICAgICAgICBjb24tPnRpbWVyU2V0KENvbnRleHQ6OlJTX1RJTUVSX0lETEUpOwotICAgIH0KLQotICAgIGludCB3YWl0VGltZSA9IC0xOwotICAgIHdoaWxlIChtUnVubmluZykgewotICAgICAgICBpbnQgcHIgPSBwb2xsKHAsIHBvbGxDb3VudCwgd2FpdFRpbWUpOwotICAgICAgICBpZiAocHIgPD0gMCkgewotICAgICAgICAgICAgYnJlYWs7Ci0gICAgICAgIH0KLQotICAgICAgICBpZiAocFswXS5yZXZlbnRzKSB7Ci0gICAgICAgICAgICBzaXplX3QgciA9IDA7Ci0gICAgICAgICAgICBpZiAoaXNMb2NhbCkgewotICAgICAgICAgICAgICAgIHIgPSBtVG9Db3JlLnJlYWQoJmJ1ZlswXSwgc2l6ZW9mKENvcmVDbWRIZWFkZXIpKTsKLSAgICAgICAgICAgICAgICBtVG9Db3JlLnJlYWQoJmJ1ZltzaXplb2YoQ29yZUNtZEhlYWRlcildLCBjbWQtPmJ5dGVzKTsKLSAgICAgICAgICAgICAgICBpZiAociAhPSBzaXplb2YoQ29yZUNtZEhlYWRlcikpIHsKLSAgICAgICAgICAgICAgICAgICAgLy8gZXhjZXB0aW9uIG9yIHRpbWVvdXQgb2NjdXJyZWQuCi0gICAgICAgICAgICAgICAgICAgIGJyZWFrOwotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgIH0gZWxzZSB7Ci0gICAgICAgICAgICAgICAgciA9IG1Ub0NvcmUucmVhZCgodm9pZCAqKSZjbWQtPmNtZElELCBzaXplb2YoY21kLT5jbWRJRCkpOwotICAgICAgICAgICAgfQotCi0KLSAgICAgICAgICAgIHJldCA9IHRydWU7Ci0gICAgICAgICAgICBpZiAoY29uLT5wcm9wcy5tTG9nVGltZXMpIHsKLSAgICAgICAgICAgICAgICBjb24tPnRpbWVyU2V0KENvbnRleHQ6OlJTX1RJTUVSX0lOVEVSTkFMKTsKLSAgICAgICAgICAgIH0KLSAgICAgICAgICAgIC8vQUxPR1YoInBsYXlDb3JlQ29tbWFuZHMgMyAlaSAlaSIsIGNtZC0+Y21kSUQsIGNtZC0+Ynl0ZXMpOwotCi0gICAgICAgICAgICBpZiAoY21kLT5jbWRJRCA+PSAoc2l6ZW9mKGdQbGF5YmFja0Z1bmNzKSAvIHNpemVvZih2b2lkICopKSkgewotICAgICAgICAgICAgICAgIHJzQXNzZXJ0KGNtZC0+Y21kSUQgPCAoc2l6ZW9mKGdQbGF5YmFja0Z1bmNzKSAvIHNpemVvZih2b2lkICopKSk7Ci0gICAgICAgICAgICAgICAgQUxPR0UoInBsYXlDb3JlQ29tbWFuZHMgZXJyb3IgY29uICVwLCBjbWQgJWkiLCBjb24sIGNtZC0+Y21kSUQpOwotICAgICAgICAgICAgfQotCi0gICAgICAgICAgICBpZiAoaXNMb2NhbCkgewotICAgICAgICAgICAgICAgIGdQbGF5YmFja0Z1bmNzW2NtZC0+Y21kSURdKGNvbiwgZGF0YSwgY21kLT5ieXRlcyk7Ci0gICAgICAgICAgICB9IGVsc2UgewotICAgICAgICAgICAgICAgIGdQbGF5YmFja1JlbW90ZUZ1bmNzW2NtZC0+Y21kSURdKGNvbiwgdGhpcyk7Ci0gICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgIGlmIChjb24tPnByb3BzLm1Mb2dUaW1lcykgewotICAgICAgIC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4LAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbUhhbC5zdGF0ZS5kaW1YLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbUhhbC5zdGF0ZS5kaW1ZLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbUhhbC5zdGF0ZS5kaW1aLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbUhhbC5zdGF0ZS5sb2RDb3VudCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1IYWwuc3RhdGUuZmFjZXMpOwotICAgIHNucHJpbnRmKGJ1Ziwgc2l6ZW9mKGJ1ZiksICIlcyBlbGVtZW50OiAiLCBwcmVmaXgpOwotICAgIG1FbGVtZW50LT5kdW1wTE9HVihidWYpOwotfQotCi12b2lkIFR5cGU6OnNlcmlhbGl6ZShPU3RyZWFtICpzdHJlYW0pIGNvbnN0IHsKLSAgICAvLyBOZWVkIHRvIGlkZW50aWZ5IG91cnNlbHZlcwotICAgIHN0cmVhbS0+YWRkVTMyKCh1aW50MzJfdClnZXRDbGFzc0lkKCkpOwotCi0gICAgU3RyaW5nOCBuYW1lKGdldE5hbWUoKSk7Ci0gICAgc3RyZWFtLT5hZGRTdHJpbmcoJm5hbWUpOwotCi0gICAgbUVsZW1lbnQtPnNlcmlhbGl6ZShzdHJlYW0pOwotCi0gICAgc3RyZWFtLT5hZGRVMzIobUhhbC5zdGF0ZS5kaW1YKTsKLSAgICBzdHJlYW0tPmFkZFUzMihtSGFsLnN0YXRlLmRpbVkpOwotICAgIHN0cmVhbS0+YWRkVTMyKG1IYWwuc3RhdGUuZGltWik7Ci0KLSAgICBzdHJlYW0tPmFkZFU4KCh1aW50OF90KShtSGFsLnN0YXRlLmxvZENvdW50ID8gMSA6ID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qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCi0gKiBDQVVUSU9OCi0gKgotICogQW55IGxheW91dCBjaGFuZ2VzIGZvciB0aGlzIGNsYXNzIG1heSByZXF1aXJlIGEgY29ycmVzcG9uZGluZyBjaGFuZ2UgdG8gYmUKLSAqIG1hZGUgdG8gZnJhbWV3b3Jrcy9jb21waWxlL2xpYmJjYy9saWIvU2NyaXB0Q1JUL3JzX2NvcmUuYywgd2hpY2ggY29udGFpbnMKLSAqIGEgcGFydGlhbCBjb3B5IG9mIHRoZSBpbmZvcm1hdGlvbiBiZWxvdy4KLSAqCi0gKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0KLWNsYXNzIFR5cGUgOiBwdWJsaWMgT2JqZWN0QmFzZSB7Ci1wdWJsaWM6Ci0gICAgc3RydWN0IEhhbCB7Ci0gICAgICAgIG11dGFibGUgdm9pZCAqZHJ2OwotCi0gICAgICAgIHN0cnVjdCBTdGF0ZSB7Ci0gICAgICAgICAgICBjb25zdCBFbGVtZW50ICogZWxlbWVudDsKLQotICAgICAgICAgICAgLy8gU2l6ZSBvZiB0aGUgc3RydWN0dXJlIGluIHRoZSB2YXJpb3VzIGRpbWVuc2lvbnMuICBBIG1pc3NpbmcgRGltZW5zaW9uIGlzCi0gICAgICAgICAgICAvLyBzcGVjaWZpZWQgYXMgYSAwIGFuZCBub3QgYSAxLgotICAgICAgICAgICAgdWludDMyX3QgZGltWDsKLSAgICAgICAgICAgIHVpbnQzMl90IGRpbVk7Ci0gICAgICAgICAgICB1aW50MzJfdCBkaW1aOwotICAgICAgICAgICAgdWludDMyX3QgKmxvZERpbVg7Ci0gICAgICAgICAgICB1aW50MzJfdCAqbG9kRGltWTsKLSAgICAgICAgICAgIHVpbnQzMl90ICpsb2REaW1aOwotICAgICAgICAgICAgdWludDMyX3QgKmxvZE9mZn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Vuc2lnbmVkIGludCAqbWFqb3IsIHVuc2lnbmVkIGludCAqbWlub3IpOwotICAgIHZvaWQgKCpzZXRQcmlvcml0eSkoY29uc3QgQ29udGV4dCAqLCBpbnQzMl90IHByaW9yaXR5KTsKLQotCi0KLSAgICBzdHJ1Y3QgewotICAgICAgICBib29sICgqaW5pdCkoY29uc3QgQ29udGV4dCAqcnNjLCBTY3JpcHRDICpzLAotICAgICAgICAgICAgICAgICAgICAgY2hhciBjb25zdCAqcmVzTmFtZSwKLSAgICAgICAgICAgICAgICAgICAgIGNoYXIgY29uc3QgKmNhY2hlRGlyLAotICAgICAgICAgICAgICAgICAgICAgdWludDhfdCBjb25zdCAqYml0Y29kZSwKLSAgICAgICAgICAgICAgICAgICAgIHNpemVfdCBiaXRjb2RlU2l6ZSwKLSAgICAgICAgICAgICAgICAgICAgIHVpbnQzMl90IGZsYWdzKTsKLQotICAgICAgICB2b2lkICgqaW52b2tlRnVuY3Rpb24pKGNvbnN0IENvbnRleHQgKnJzYywgU2NyaXB0ICpzLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHVpbnQzMl90IHNsb3QsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY29uc3Qgdm9pZCAqcGFyYW1zLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNpemVfdCBwYXJhbUxlbmd0aCk7Ci0gICAgICAgIGludCAoKmludm9rZVJvb3QpKGNvbnN0IENvbnRleHQgKnJzYywgU2NyaXB0ICpzKTsKLSAgICAgICAgdm9pZCAoKmludm9rZUZvckVhY2gpKGNvbnN0IENvbnRleHQgKnJzYywKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFNjcmlwdCAqcywKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHVpbnQzMl90IHNsb3QsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb25zdCBBbGxvY2F0aW9uICogYWluLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgQWxsb2NhdGlvbiAqIGFvdXQsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb25zdCB2b2lkICogdXNyLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdWludDMyX3QgdXNyTGVuLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY29uc3QgUnNTY3JpcHRDYWxsICpzYyk7Ci0gICAgICAgIHZvaWQgKCppbnZva2VJbml0KShjb25zdCBDb250ZXh0ICpyc2MsIFNjcmlwdCAqcyk7Ci0gICAgICAgIHZvaWQgKCppbnZva2VGcmVlQ2hpbGRyZW4pKGNvbnN0IENvbnRleHQgKnJzYywgU2NyaXB0ICpzKTsKLQotICAgICAgICB2b2lkICgqc2V0R2xvYmFsVmFyKShjb25zdCBDb250ZXh0ICpyc2MsIGNvbnN0IFNjcmlwdCAqcywKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdWludDMyX3Qgc2xvdCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdm9pZCAqZGF0YSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2l6ZV90IGRhdGFMZW5ndGgpOwotICAgICAgICB2b2lkICgqc2V0R2xvYmFsQmluZCkoY29uc3QgQ29udGV4dCAqcnNjLCBjb25zdCBTY3JpcHQgKnMsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICB1aW50MzJfdCBzbG90LAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdm9pZCAqZGF0YSk7Ci0gICAgICAgIHZvaWQgKCpzZXRHbG9iYWxPYmopKGNvbnN0IENvbnRleHQgKnJzYywgY29uc3QgU2NyaXB0ICpzLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICB1aW50MzJfdCBzbG90LAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICBPYmplY3RCYXNlICpkYXRhKTsKLQotICAgICAgICB2b2lkICgqZGVzdHJveSkoY29uc3QgQ29udGV4dCAqcnNjLCBTY3JpcHQgKnMpOwotICAgIH0gc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gKnJzYywgY29uc3QgQWxsb2NhdGlvbiAqYWxsb2MsCi0gICAgICAgICAgICAgICAgICAgICAgIHVpbnQzMl90IHhvZmYsIHVpbnQzMl90IGxvZCwgdWludDMyX3QgY291bnQsCi0gICAgICAgICAgICAgICAgICAgICAgIGNvbnN0IHZvaWQgKmRhdGEsIHNpemVfdCBzaXplQnl0ZXMpOwotICAgICAgICB2b2lkICgqZGF0YTJEKShjb25zdCBDb250ZXh0ICpyc2MsIGNvbnN0IEFsbG9jYXRpb24gKmFsbG9jLAotICAgICAgICAgICAgICAgICAgICAgICB1aW50MzJfdCB4b2ZmLCB1aW50MzJfdCB5b2ZmLCB1aW50MzJfdCBsb2QsCi0gICAgICAgICAgICAgICAgICAgICAgIFJzQWxsb2NhdGlvbkN1YmVtYXBGYWNlIGZhY2UsIHVpbnQzMl90IHcsIHVpbnQzMl90IGgsCi0gICAgICAgICAgICAgICAgICAgICAgIGNvbnN0IHZvaWQgKmRhdGEsIHNpemVfdCBzaXplQnl0ZXMpOwotICAgICAgICB2b2lkICgqZGF0YTNEKShjb25zdCBDb250ZXh0ICpyc2MsIGNvbnN0IEFsbG9jYXRpb24gKmFsbG9jLAotICAgICAgICAgICAgICAgICAgICAgICB1aW50MzJfdCB4b2ZmLCB1aW50MzJfdCB5b2ZmLCB1aW50MzJfdCB6b2ZmLAotICAgICAgICAgICAgICAgICAgICAgICB1aW50MzJfdCBsb2QsIFJzQWxsb2NhdGlvbkN1YmVtYXBGYWNlIGZhY2UsCi0gICAgICAgICAgICAgICAgICAgICAgIHVpbnQzMl90IHcsIHVpbnQzMl90IGgsIHVpbnQzMl90IGQsIGNvbnN0IHZvaWQgKmRhdGEsIHNpemVfdCBzaXplQnl0ZXMpOwotCi0gICAgICAgIC8vIEFsbG9jYXRpb24gdG8gYWxsb2NhdGlvbiBjb3BpZXMKLSAgICAgICAgdm9pZCAoKmFsbG9jRGF0YTFEKShjb25zdCBDb250ZXh0ICpyc2MsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgY29uc3QgQWxsb2NhdGlvbiAqZHN0QWxsb2MsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgdWludDMyX3QgZHN0WG9mZiwgdWludDMyX3QgZHN0TG9kLCB1aW50MzJfdCBjb3VudCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb25zdCBBbGxvY2F0aW9uICpzcmNBbGxvYywgdWludDMyX3Qgc3JjWG9mZiwgdWludDMyX3Qgc3JjTG9kKTsKLSAgICAgICAgdm9pZCAoKmFsbG9jRGF0YTJEKShjb25zdCBDb250ZXh0ICpyc2MsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgY29uc3QgQWxsb2NhdGlvbiAqZHN0QWxsb2MsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgdWludDMyX3QgZHN0WG9mZiwgdWludDMyX3QgZHN0WW9mZiwgdWludDMyX3QgZHN0TG9kLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgIFJzQWxsb2NhdGlvbkN1YmVtYXBGYWNlIGRzdEZhY2UsIHVpbnQzMl90IHcsIHVpbnQzMl90IGgsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgY29uc3QgQWxsb2NhdGlvbiAqc3JjQWxsb2MsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgdWludDMyX3Qgc3JjWG9mZiwgdWludDMyX3Qgc3JjWW9mZiwgdWludDMyX3Qgc3JjTG9kLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgIFJzQWxsb2NhdGlvbkN1YmVtYXBGYWNlIHNyY0ZhY2UpOwotICAgICAgICB2b2lkICgqYWxsb2NEYXRhM0QpKGNvbnN0IENvbnRleHQgKnJzYywKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb25zdCBBbGxvY2F0aW9uICpkc3RBbGxvYywKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICB1aW50MzJfdCBkc3RYb2ZmLCB1aW50MzJfdCBkc3RZb2ZmLCB1aW50MzJfdCBkc3Rab2ZmLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgIHVpbnQzMl90IGRzdExvZCwgUnNBbGxvY2F0aW9uQ3ViZW1hcEZhY2UgZHN0RmFjZSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICB1aW50MzJfdCB3LCB1aW50MzJfdCBoLCB1aW50MzJfdCBkLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbnN0IEFsbG9jYXRpb24gKnNyY0FsbG9jLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgIHVpbnQzMl90IHNyY1hvZmYsIHVpbnQzMl90IHNyY1lvZmYsIHVpbnQzMl90IHNyY1pvZmYsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgdWludDMyX3Qgc3JjTG9kLCBSc0FsbG9jYXRpb25DdWJlbWFwRmFjZSBzcmNGYWNlKTsKLQotICAgICAgICB2b2lkICgqZWxlbWVudERhdGExRCkoY29uc3QgQ29udGV4dCAqcnNjLCBjb25zdCBBbGxvY2F0aW9uICphbGxvYywgdWludDMyX3QgeCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbnN0IHZvaWQgKmRhdGEsIHVpbnQzMl90IGVsZW1lbnRPZmYsIHNpemVfdCBzaXplQnl0ZXMpOwotICAgICAgICB2b2lkICgqZWxlbWVudERhdGEyRCkoY29uc3QgQ29udGV4dCAqcnNjLCBjb25zdCBBbGxvY2F0aW9uICphbGxvYywgdWludDMyX3QgeCwgdWludDMyX3QgeSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbnN0IHZvaWQgKmRhdGEsIHVpbnQzMl90IGVsZW1lbnRPZmYsIHNpemVfdCBzaXplQnl0ZXMpOwotCi0KLSAgICB9IGFsbG9jYXRpb247Ci0KLSAgICBzdHJ1Y3QgewotICAgICAgICBib29sICgqaW5pdCkoY29uc3QgQ29udGV4dCAqcnNjLCBjb25zdCBQcm9ncmFtU3RvcmUgKnBzKTsKLSAgICAgICAgdm9pZCAoKnN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ICAgICAgZnByaW50ZihmLCAiI2RlZmluZSBSU19DTURfSURfJXMgJWlcbiIsIGFwaS0+bmFtZSwgY3QrMSk7Ci0gICAgICAgIGZwcmludGYoZiwgInN0cnVjdCBSU19DTURfJXNfcmVjIHtcbiIsIGFwaS0+bmFtZSk7Ci0gICAgICAgIC8vZnByaW50ZihmLCAiICAgIFJzQ29tbWFuZEhlYWRlciBfaGRyO1xuIik7Ci0KLSAgICAgICAgZm9yIChjdDI9MDsgY3QyIDwgYXBpLT5wYXJhbUNvdW50OyBjdDIrKykgewotICAgICAgICAgICAgZnByaW50ZihmLCAiICAgICIpOwotICAgICAgICAgICAgcHJpbnRWYXJUeXBlQW5kTmFtZShmLCAmYXBpLT5wYXJhbXNbY3QyXSk7Ci0gICAgICAgICAgICBmcHJpbnRmKGYsICI7XG4iKTsKLSAgICAgICAgfQotICAgICAgICBmcHJpbnRmKGYsICJ9O1xuXG4iKTsKLSAgICB9Ci19Ci0KLXZvaWQgcHJpbnRGdW5jRGVjbChGSUxFICpmLCBjb25zdCBBcGlFbnRyeSAqYXBpLCBjb25zdCBjaGFyICpwcmVmaXgsIGludCBhZGRDb250ZXh0LCBpbnQgaXNGblB0cikgewotICAgIHByaW50VmFyVHlwZUFuZE5hbWUoZiwgJmFwaS0+cmV0KTsKLSAgICBpZiAoaXNGblB0cikgewotICAgICAgICBjaGFyIHRbMTAyNF07Ci0gICAgICAgIHN0cmNweSh0LCBhcGktPm5hbWUpOwotICAgICAgICBpZiAoc3RybGVuKHByZWZpeCkgPT0gMCkgewotICAgICAgICAgICAgaWYgKHRbMF0gPiAnQScgJiYgdFswXSA8ICdaJykgewotICAgICAgICAgICAgICAgIHRbMF0gLT0gJ0EnIC0gJ2EnOwotICAgICAgICAgICAgfQotICAgICAgICB9Ci0gICAgICAgIGZwcmludGYoZiwgIiAoKiAlcyVzKSAoIiwgcHJlZml4LCBhcGktPm5hbWUpOwotICAgIH0gZWxzZSB7Ci0gICAgICAgIGZwcmludGYoZiwgIiAlcyVzICgiLCBwcmVmaXgsIGFwaS0+bmFtZSk7Ci0gICAgfQotICAgIGlmICghYXBpLT5ub2NvbnRleHQpIHsKLSAgICAgICAgaWYgKGFkZENvbnRleHQpIHsKLSAgICAgICAgICAgIGZwcmludGYoZiwgIkNvbnRleHQgKiIpOwotICAgICAgICB9IGVsc2UgewotICAgICAgICAgICAgZnByaW50ZihmLCAiUnNDb250ZXh0IHJzYyIpOwotICAgICAgICB9Ci0gICAgfQotICAgIHByaW50QXJnTGlzdChmLCBhcGksICFhcGktPm5vY29udGV4dCk7Ci0gICAgZnByaW50ZihmLCAiKSIpOwotfQotCi12b2lkIHByaW50RnVuY0RlY2xzKEZJTEUgKmYsIGNvbnN0IGNoYXIgKnByZWZpeCwgaW50IGFkZENvbnRleHQpIHsKLSAgICBpbnQgY3Q7Ci0gICAgZm9yIChjdD0wOyBjdCA8IGFwaUNvdW50OyBjdCsrKSB7Ci0gICAgICAgIHByaW50RnVuY0RlY2woZiwgJmFwaXNbY3RdLCBwcmVmaXgsIGFkZENvbnRleHQsIDApOwotICAgICAgICBmcHJpbnRmKGYsICI7XG4iKTsKLSAgICB9Ci0gICAgZnByaW50ZihmLCAiXG5cbiIpOwotfQotCi12b2lkIHByaW50RnVuY1BvaW50ZXJzKEZJTEUgKmYsIGludCBhZGRDb250ZXh0KSB7Ci0gICAgZnByaW50ZihmLCAiXG4iKTsKLSAgICBmcHJpbnRmKGYsICJ0eXBlZGVmIHN0cnVjdCBSc0FwaUVudHJ5cG9pbnRzIHtcbiIpOwotICAgIGludCBjdDsKLSAgICBmb3IgKGN0PTA7IGN0IDwgYXBpQ291bnQ7IGN0KyspIHsKLSAgICAgICAgZnByaW50ZihmLCAiICAgICIpOwotICAgICAgICBwcmludEZ1bmNEZWNsKGYsICZhcGlzW2N0XSwgIiIsIGFkZENvbnRleHQsIDEpOwotICAgICAgICBmcHJpbnRmKGYsICI7XG4iKTsKLSAgICB9Ci0gICAgZnByaW50ZihmLCAifSBSc0F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ICJzdGF0aWMgIik7Ci0gICAgICAgIHByaW50RnVuY0RlY2woZiwgYXBpLCAiTEZfIiwgMCwgMCk7Ci0gICAgICAgIGZwcmludGYoZiwgIlxue1xuIik7Ci0gICAgICAgIGlmIChhcGktPmRpcmVjdCkgewotICAgICAgICAgICAgZnByaW50ZihmLCAiICAgICIpOwotICAgICAgICAgICAgaWYgKGFwaS0+cmV0LnR5cGVOYW1lWzBdKSB7Ci0gICAgICAgICAgICAgICAgZnByaW50ZihmLCAicmV0dXJuICIpOwotICAgICAgICAgICAgfQotICAgICAgICAgICAgZnByaW50ZihmLCAicnNpXyVzKCIsIGFwaS0+bmFtZSk7Ci0gICAgICAgICAgICBpZiAoIWFwaS0+bm9jb250ZXh0KSB7Ci0gICAgICAgICAgICAgICAgZnByaW50ZihmLCAiKENvbnRleHQgKilyc2MiKTsKLSAgICAgICAgICAgIH0KLSAgICAgICAgICAgIGZvciAoY3QyPTA7IGN0MiA8IGFwaS0+cGFyYW1Db3VudDsgY3QyKyspIHsKLSAgICAgICAgICAgICAgICBjb25zdCBWYXJUeXBlICp2dCA9ICZhcGktPnBhcmFtc1tjdDJdOwotICAgICAgICAgICAgICAgIGlmIChjdDIgPiAwIHx8ICFhcGktPm5vY29udGV4dCkgewotICAgICAgICAgICAgICAgICAgICBmcHJpbnRmKGYsICIsICIpOwotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICBmcHJpbnRmKGYsICIlcyIsIHZ0LT5uYW1lKTsKLSAgICAgICAgICAgIH0KLSAgICAgICAgICAgIGZwcmludGYoZiwgIik7XG4iKTsKLSAgICAgICAgfSBlbHNlIHsKLSAgICAgICAgICAgIGZwcmludGYoZiwgIiAgICBUaHJlYWRJTyAqaW8gPSAmKChDb250ZXh0ICopcnNjKS0+bUlPO1xuIik7Ci0gICAgICAgICAgICBmcHJpbnRmKGYsICIgICAgY29uc3QgdWludDMyX3Qgc2l6ZSA9IHNpemVvZihSU19DTURfJXMpO1xuIiwgYXBpLT5uYW1lKTsKLSAgICAgICAgICAgIGlmIChoYXNJbmxpbmVEYXRhUG9pbnRlcnMoYXBpKSkgewotICAgICAgICAgICAgICAgIGZwcmludGYoZiwgIiAgICB1aW50MzJfdCBkYXRhU2l6ZSA9IDA7XG4iKTsKLSAgICAgICAgICAgICAgICBmb3IgKGN0Mj0wOyBjdDIgPCBhcGktPnBhcmFtQ291bnQ7IGN0MisrKSB7Ci0gICAgICAgICAgICAgICAgICAgIGNvbnN0IFZhclR5cGUgKnZ0ID0gJmFwaS0+cGFyYW1zW2N0Ml07Ci0gICAgICAgICAgICAgICAgICAgIGlmICh2dC0+aXNDb25zdCAmJiB2dC0+cHRyTGV2ZWwpIHsKLSAgICAgICAgICAgICAgICAgICAgICAgIGZwcmludGYoZiwgIiAgICBkYXRhU2l6ZSArPSAlc19sZW5ndGg7XG4iLCB2dC0+bmFtZSk7Ci0gICAgICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgIC8vZnByaW50ZihmLCAiICAgIEFMT0dFKFwiYWRkIGNvbW1hbmQgJXNcXG5cIik7XG4iLCBhcGktPm5hbWUpOwotICAgICAgICAgICAgaWYgKGhhc0lubGluZURhdGFQb2ludGVycyhhcGkpKSB7Ci0gICAgICAgICAgICAgICAgZnByaW50ZihmLCAiICAgIFJTX0NNRF8lcyAqY21kID0gTlVMTDtcbiIsIGFwaS0+bmFtZSk7Ci0gICAgICAgICAgICAgICAgZnByaW50ZihmLCAiICAgIGlmIChkYXRhU2l6ZSA8IGlvLT5nZXRNYXhJbmxpbmVTaXplKCkpIHs7XG4iKTsKLSAgICAgICAgICAgICAgICBmcHJpbnRmKGYsICIgICAgICAgIGNtZCA9IHN0YXRpY19jYXN0PFJTX0NNRF8lcyAqPihpby0+Y29yZUhlYWRlcihSU19DTURfSURfJXMsIGRhdGFTaXplICsgc2l6ZSkpO1xuIiwgYXBpLT5uYW1lLCBhcGktPm5hbWUpOwotICAgICAgICAgICAgICAgIGZwcmludGYoZiwgIiAgICB9IGVsc2Uge1xuIik7Ci0gICAgICAgICAgICAgICAgZnByaW50ZihmLCAiICAgICAgICBjbWQgPSBzdGF0aWNfY2FzdDxSU19DTURfJXMgKj4oaW8tPmNvcmVIZWFkZXIoUlNfQ01EX0lEXyVzLCBzaXplKSk7XG4iLCBhcGktPm5hbWUsIGFwaS0+bmFtZSk7Ci0gICAgICAgICAgICAgICAgZnByaW50ZihmLCAiICAgIH1cbiIpOwotICAgICAgICAgICAgICAgIGZwcmludGYoZiwgIiAgICB1aW50OF90ICpwYXlsb2FkID0gKHVpbnQ4X3QgKikmY21kWzFdO1xuIik7Ci0gICAgICAgICAgICB9IGVsc2UgewotICAgICAgICAgICAgICAgIGZwcmludGYoZiwgIiAgICBSU19DTURfJXMgKmNtZCA9IHN0YXRpY19jYXN0PFJTX0NNRF8lcyAqPihpby0+Y29yZUhlYWRlcihSU19DTURfSURfJXMsIHNpemUpKTtcbiIsIGFwaS0+bmFtZSwgYXBpLT5uYW1lLCBhcGktPm5hbWUpOwotICAgICAgICAgICAgfQotCi0gICAgICAgICAgICBmb3IgKGN0Mj0wOyBjdDIgPCBhcGktPnBhcmFtQ291bnQ7IGN0MisrKSB7Ci0gICAgICAgICAgICAgICAgY29uc3QgVmFyVHlwZSAqdnQgPSAmYXBpLT5wYXJhbXNbY3QyXTsKLSAgICAgICAgICAgICAgICBuZWVkRmx1c2ggKz0gdnQtPnB0ckxldmVsOwotICAgICAgICAgICAgICAgIGlmICh2dC0+cHRyTGV2ZWwgJiYgaGFzSW5saW5lRGF0YVBvaW50ZXJzKGFwaSkpIHsKLSAgICAgICAgICAgICAgICAgICAgZnByaW50ZihmLCAiICAgIGlmIChkYXRhU2l6ZSA8IGlvLT5nZXRNYXhJbmxpbmVTaXplKCkpIHtcbiIpOwotICAgICAgICAgICAgICAgICAgICBmcHJpbnRmKGYsICIgICAgICAgIG1lbWNweShwYXlsb2FkLCAlcywgJXNfbGVuZ3RoKTtcbiIsIHZ0LT5uYW1lLCB2dC0+bmFtZSk7Ci0gICAgICAgICAgICAgICAgICAgIGZwcmludGYoZiwgIiAgICAgICAgY21kLT4lcyA9ICgiLCB2dC0+bmFtZSk7Ci0gICAgICAgICAgICAgICAgICAgIHByaW50VmFyVHlwZShmLCB2dCk7Ci0gICAgICAgICAgICAgICAgICAgIGZwcmludGYoZiwgIikocGF5bG9hZCAtICgodWludDhfdCAqKSZjbWRbMV0pKTtcbiIpOwotICAgICAgICAgICAgICAgICAgICBmcHJpbnRmKGYsICIgICAgICAgIHBheWxvYWQgKz0gJXNfbGVuZ3RoO1xuIiwgdnQtPm5hbWUpOwotICAgICAgICAgICAgICAgICAgICBmcHJpbnRmKGYsICIgICAgfSBlbHNlIHtcbiIpOwotICAgICAgICAgICAgICAgICAgICBmcHJpbnRmKGYsICIgICAgICAgIGNtZC0+JXMgPSAlcztcbiIsIHZ0LT5uYW1lLCB2dC0+bmFtZSk7Ci0gICAgICAgICAgICAgICAgICAgIGZwcmludGYoZiwgIiAgICB9XG4iKTsKLQotICAgICAgICAgICAgICAgIH0gZWxzZSB7Ci0gICAgICAgICAgICAgICAgICAgIGZwcmludGYoZiwgIiAgICBjbWQtPiVzID0gJXM7XG4iLCB2dC0+bmFtZSwgdnQtPm5hbWUpOwotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgIH0KLSAgICAgICAgICAgIGlmIChhcGktPnJldC50eXBlTmFtZVswXSB8fCBhcGktPnN5bmMpIHsKLSAgICAgICAgICAgICAgICBuZWVkRmx1c2ggPSAxOwotICAgICAgICAgICAgfQotCi0gICAgICAgICAgICBmcHJpbnRmKGYsICIgICAgaW8tPmNvcmVDb21taXQoKTtcbiIpOwotICAgICAgICAgICAgaWYgKGhhc0lubGluZURhdGFQb2ludGVycyhhcGkpKSB7Ci0gICAgICAgICAgICAgICAgZnByaW50ZihmLCAiICAgIGlmIChkYXRhU2l6ZSA+PSBpby0+Z2V0TWF4SW5saW5lU2l6ZSgpKSB7XG4iKTsKLSAgICAgICAgICAgICAgICBmcHJpbnRmKGYsICIgICAgICAgIGlvLT5jb3JlR2V0UmV0dXJuKE5VTEwsIDApO1xuIik7Ci0gICAgICAgICAgICAgICAgZnByaW50ZihmLCAiICAgIH1cbiIpOwotICAgICAgICAgICAgfSBlbHNlIGlmIChhcGktPnJldC50eXBlTmFtZVswXSkgewotICAgICAgICAgICAgICAgIGZwcmludGYoZiwgIlxuICAgICIpOwotICAgICAgICAgICAgICAgIHByaW50VmFyVHlwZShmLCAmYXBpLT5yZXQpOwotICAgICAgICAgICAgICAgIGZwcmludGYoZiwgIiByZXQ7XG4iKTsKLSAgICAgICAgICAgICAgICBmcHJpbnRmKGYsICIgICAgaW8tPmNvcmVHZXRSZXR1cm4oJnJldCwgc2l6ZW9mKHJldCkpO1xuIik7Ci0gICAgICAgICAgICAgICAgZnByaW50ZihmLCAiICAgIHJldHVybiByZXQ7XG4iKTsKLSAgICAgICAgICAgIH0gZWxzZSBpZiAobmVlZEZsdXNoKSB7Ci0gICAgICAgICAgICAgICAgZnByaW50ZihmLCAiICAgIGlvLT5jb3JlR2V0UmV0dXJuKE5VTEwsIDApO1xuIik7Ci0gICAgICAgICAgICB9Ci0gICAgICAgIH0KLSAgICAgICAgZnByaW50ZihmLCAifTtcblxuIik7Ci0KLQotICAgICAgICAvLyBHZW5lcmF0ZSBhIHJlbW90ZSBzZW5kZXIgZnVuY3Rpb24KLSAgICAgICAgY29uc3QgY2hhciAqIHN0ciA9ICJjb3JlIjsKLSAgICAgICAgaWYgKGFwaS0+ZGlyZWN0KSB7Ci0gICAgICAgICAgICBzdHIgPSAiYXN5bmMiOwotICAgICAgICB9Ci0KLSAgICAgICAgZnByaW50ZihmLCAic3RhdGljICIpOwotICAgICAgICBwcmludEZ1bmNEZWNsKGYsIGFwaSwgIlJGXyIsIDAsIDApOwotICAgICAgICBmcHJpbnRmKGYsICJcbntcbiIpOwotICAgICAgICBmcHJpbnRmKGYsICIgICAgVGhyZWFkSU8gKmlvID0gJigoQ29udGV4dCAqKXJzYyktPm1JTztcbiIpOwotICAgICAgICBmcHJpbnRmKGYsICIgICAgY29uc3QgdWludDMyX3QgY21kSUQgPSBSU19DTURfSURfJXM7XG4iLCBhcGktPm5hbWUpOwotICAgICAgICBmcHJpbnRmKGYsICIgICAgaW8tPiVzV3JpdGUoJmNtZElELCBzaXplb2YoY21kSUQpKTtcblxuIiwgc3RyKTsKLQotICAgICAgICBmb3IgKGN0Mj0wOyBjdDIgPCBhcGktPnBhcmFtQ291bnQ7IGN0MisrKSB7Ci0gICAgICAgICAgICBjb25zdCBWYXJUeXBlICp2dCA9ICZhcGktPnBhcmFtc1tjdDJdOwotICAgICAgICAgICAgaWYgKHZ0LT5wdHJMZXZlbCA9PSAwKSB7Ci0gICAgICAgICAgICAgICAgZnByaW50ZihmLCAiICAgIGlvLT4lc1dyaXRlKCYgJXMsIHNpemVvZiglcykpO1xuIiwgc3RyLCB2dC0+bmFtZSwgdnQtPm5hbWUpOwotICAgICAgICAgICAgfQotICAgICAgICB9Ci0gICAgICAgIGZwcmludGYoZiwgIlxuIik7Ci0KLSAgICAgICAgZm9yIChjdDI9MDsgY3QyIDwgYXBpLT5wYXJhbUNvdW50OyBjdDIrKykgewotICAgICAgICAgICAgY29uc3QgVmFyVHlwZSAqdnQgPSAmYXBpLT5wYXJhbXNbY3QyXTsKLSAgICAgICAgICAgIGlmICgodnQtPnB0ckxldmVsID09IDEpICYmICh2dC0+aXNDb25zdCkpIHsKLSAgICAgICAgICAgICAgICBmcHJpbnRmKGYsICIgICAgaW8tPiVzV3JpdGUoJXMsICVzX2xlbmd0aCk7XG4iLCBzdHIsIHZ0LT5uYW1lLCB2dC0+bmFtZSk7Ci0gICAgICAgICAgICB9Ci0gICAgICAgIH0KLSAgICAgICAgZnByaW50ZihmLCAiXG4iKTsKLQotICAgICAgICBmb3IgKGN0Mj0wOyBjdDIgPCBhcGktPnBhcmFtQ291bnQ7IGN0MisrKSB7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ICAgIH0KLQotICAgIGZwcmludGYoZiwgIlxuIik7Ci0gICAgZnByaW50ZihmLCAic3RhdGljIFJzQXBpRW50cnlwb2ludHNfdCBzX0xvY2FsVGFibGUgPSB7XG4iKTsKLSAgICBmb3IgKGN0PTA7IGN0IDwgYXBpQ291bnQ7IGN0KyspIHsKLSAgICAgICAgZnByaW50ZihmLCAiICAgIExGXyVzLFxuIiwgYXBpc1tjdF0ubmFtZSk7Ci0gICAgfQotICAgIGZwcmludGYoZiwgIn07XG4iKTsKLQotICAgIGZwcmludGYoZiwgIlxuIik7Ci0gICAgZnByaW50ZihmLCAic3RhdGljIFJzQXBpRW50cnlwb2ludHNfdCBzX1JlbW90ZVRhYmxlID0ge1xuIik7Ci0gICAgZm9yIChjdD0wOyBjdCA8IGFwaUNvdW50OyBjdCsrKSB7Ci0gICAgICAgIGZwcmludGYoZiwgIiAgICBSRl8lcyxcbiIsIGFwaXNbY3RdLm5hbWUpOwotICAgIH0KLSAgICBmcHJpbnRmKGYsICJ9O1xuIik7Ci0KLSAgICBmcHJpbnRmKGYsICJzdGF0aWMgUnNBcGlFbnRyeXBvaW50c190ICpzX0N1cnJlbnRUYWJsZSA9ICZzX0xvY2FsVGFibGU7XG5cbiIpOwotICAgIGZvciAoY3Q9MDsgY3QgPCBhcGlDb3VudDsgY3QrKykgewotICAgICAgICBpbnQgbmVlZEZsdXNoID0gMDsKLSAgICAgICAgY29uc3QgQXBpRW50cnkgKiBhcGkgPSAmYXBpc1tjdF07Ci0KLSAgICAgICAgcHJpbnRGdW5jRGVjbChmLCBhcGksICJycyIsIDAsIDApOwotICAgICAgICBmcHJpbnRmKGYsICJcbntcbiIpOwotICAgICAgICBmcHJpbnRmKGYsICIgICAgIik7Ci0gICAgICAgIGlmIChhcGktPnJldC50eXBlTmFtZVswXSkgewotICAgICAgICAgICAgZnByaW50ZihmLCAicmV0dXJuICIpOwotICAgICAgICB9Ci0gICAgICAgIGZwcmludGYoZiwgInNfQ3VycmVudFRhYmxlL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pcHQge1xuIik7Ci0gICAgZnByaW50ZihmLCAiXG4iKTsKLQotICAgIGZvciAoY3Q9MDsgY3QgPCBhcGlDb3VudDsgY3QrKykgewotICAgICAgICBjb25zdCBBcGlFbnRyeSAqIGFwaSA9ICZhcGlzW2N0XTsKLSAgICAgICAgaW50IG5lZWRGbHVzaCA9IDA7Ci0KLSAgICAgICAgaWYgKGFwaS0+ZGlyZWN0KSB7Ci0gICAgICAgICAgICBjb250aW51ZTsKLSAgICAgICAgfQotCi0gICAgICAgIGZwcmludGYoZiwgInZvaWQgcnNwXyVzKENvbnRleHQgKmNvbiwgY29uc3Qgdm9pZCAqdnAsIHNpemVfdCBjbWRTaXplQnl0ZXMpIHtcbiIsIGFwaS0+bmFtZSk7Ci0gICAgICAgIGZwcmludGYoZiwgIiAgICBjb25zdCBSU19DTURfJXMgKmNtZCA9IHN0YXRpY19jYXN0PGNvbnN0IFJTX0NNRF8lcyAqPih2cCk7XG4iLCBhcGktPm5hbWUsIGFwaS0+bmFtZSk7Ci0KLSAgICAgICAgaWYgKGhhc0lubGluZURhdGFQb2ludGVycyhhcGkpKSB7Ci0gICAgICAgICAgICBmcHJpbnRmKGYsICIgICAgY29uc3QgdWludDhfdCAqYmFzZURhdGEgPSAwO1xuIik7Ci0gICAgICAgICAgICBmcHJpbnRmKGYsICIgICAgaWYgKGNtZFNpemVCeXRlcyAhPSBzaXplb2YoUlNfQ01EXyVzKSkge1xuIiwgYXBpLT5uYW1lKTsKLSAgICAgICAgICAgIGZwcmludGYoZiwgIiAgICAgICAgYmFzZURhdGEgPSAmKChjb25zdCB1aW50OF90ICopdnApW3NpemVvZigqY21kKV07XG4iKTsKLSAgICAgICAgICAgIGZwcmludGYoZiwgIiAgICB9XG4iKTsKLSAgICAgICAgfQotCi0gICAgICAgIGZwcmludGYoZiwgIiAgICAiKTsKLSAgICAgICAgaWYgKGFwaS0+cmV0LnR5cGVOYW1lWzBdKSB7Ci0gICAgICAgICAgICBmcHJpbnRmKGYsICJcbiAgICAiKTsKLSAgICAgICAgICAgIHByaW50VmFyVHlwZShmLCAmYXBpLT5yZXQpOwotICAgICAgICAgICAgZnByaW50ZihmLCAiIHJldCA9ICIpOwotICAgICAgICB9Ci0gICAgICAgIGZwcmludGYoZiwgInJzaV8lcyhjb24iLCBhcGktPm5hbWUpOwotICAgICAgICBmb3IgKGN0Mj0wOyBjdDIgPCBhcGktPnBhcmFtQ291bnQ7IGN0MisrKSB7Ci0gICAgICAgICAgICBjb25zdCBWYXJUeXBlICp2dCA9ICZhcGktPnBhcmFtc1tjdDJdOwotICAgICAgICAgICAgbmVlZEZsdXNoICs9IHZ0LT5wdHJMZXZlbDsKLQotICAgICAgICAgICAgaWYgKGhhc0lubGluZURhdGFQb2ludGVycyhhcGkpICYmIHZ0LT5wdHJMZXZlbCkgewotICAgICAgICAgICAgICAgIGZwcmludGYoZiwgIixcbiAgICAgICAgICAgKGNvbnN0ICVzICopJmJhc2VEYXRhWyhpbnRwdHJfdCljbWQtPiVzXSIsIHZ0LT50eXBlTmFtZSwgdnQtPm5hbWUpOwotICAgICAgICAgICAgfSBlbHNlIHsKLSAgICAgICAgICAgICAgICBmcHJpbnRmKGYsICIsXG4gICAgICAgICAgIGNtZC0+JXMiLCB2dC0+bmFtZSk7Ci0gICAgICAgICAgICB9Ci0gICAgICAgIH0KLSAgICAgICAgZnByaW50ZihmLCAiKTtcbiIpOwotCi0gICAgICAgIGlmIChoYXNJbmxpbmVEYXRhUG9pbnRlcnMoYXBpKSkgewotICAgICAgICAgICAgZnByaW50ZihmLCAiICAgIHNpemVfdCB0b3RhbFNpemUgPSAwO1xuIik7Ci0gICAgICAgICAgICBmb3IgKGN0Mj0wOyBjdDIgPCBhcGktPnBhcmFtQ291bnQ7IGN0MisrKSB7Ci0gICAgICAgICAgICAgICAgaWYgKGFwaS0+cGFyYW1zW2N0Ml0ucHRyTGV2ZWwpIHsKLSAgICAgICAgICAgICAgICAgICAgZnByaW50ZihmLCAiICAgIHRvdGFsU2l6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AgICAgICAgZm9yIChjdDI9MDsgY3QyIDwgYXBpLT5wYXJhbUNvdW50OyBjdDIrKykgewotICAgICAgICAgICAgY29uc3QgVmFyVHlwZSAqdnQgPSAmYXBpLT5wYXJhbXNbY3QyXTsKLSAgICAgICAgICAgIGlmICh2dC0+cHRyTGV2ZWwgPT0gMCkgewotICAgICAgICAgICAgICAgIGZwcmludGYoZiwgIiAgICBpby0+Y29yZVJlYWQoJmNtZC4lcywgc2l6ZW9mKGNtZC4lcykpO1xuIiwgdnQtPm5hbWUsIHZ0LT5uYW1lKTsKLSAgICAgICAgICAgIH0KLSAgICAgICAgfQotICAgICAgICBmcHJpbnRmKGYsICJcbiIpOwotCi0gICAgICAgIGZvciAoY3QyPTA7IGN0MiA8IGFwaS0+cGFyYW1Db3VudDsgY3QyKyspIHsKLSAgICAgICAgICAgIGNvbnN0IFZhclR5cGUgKnZ0ID0gJmFwaS0+cGFyYW1zW2N0Ml07Ci0gICAgICAgICAgICBpZiAodnQtPnB0ckxldmVsID09IDEpIHsKLSAgICAgICAgICAgICAgICBmcHJpbnRmKGYsICIgICAgY21kLiVzID0gKCIsIHZ0LT5uYW1lKTsKLSAgICAgICAgICAgICAgICBwcmludFZhclR5cGUoZiwgdnQpOwotICAgICAgICAgICAgICAgIGZwcmludGYoZiwgIiltYWxsb2MoY21kLiVzX2xlbmd0aCk7XG4iLCB2dC0+bmFtZSk7Ci0KLSAgICAgICAgICAgICAgICBpZiAodnQtPmlzQ29uc3QpIHsKLSAgICAgICAgICAgICAgICAgICAgZnByaW50ZihmLCAiICAgIGlmIChjbWQuJXNfbGVuZ3RoKSBpby0+Y29yZVJlYWQoKHZvaWQgKiljbWQuJXMsIGNtZC4lc19sZW5ndGgpO1xuIiwgdnQtPm5hbWUsIHZ0LT5uYW1lLCB2dC0+bmFtZSk7Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgfQotICAgICAgICB9Ci0gICAgICAgIGZwcmludGYoZiwgIlxuIik7Ci0KLSAgICAgICAgZm9yIChjdDI9MDsgY3QyIDwgYXBpLT5wYXJhbUNvdW50OyBjdDIrKykgewotICAgICAgICAgICAgY29uc3QgVmFyVHlwZSAqdnQgPSAmYXBpLT5wYXJhbXNbY3QyXTsKLSAgICAgICAgICAgIGlmICh2dC0+cHRyTGV2ZWwgPT0gMikgewotICAgICAgICAgICAgICAgIGZwcmludGYoZiwgIiAgICBmb3IgKHNpemVfdCBjdCA9IDA7IGN0IDwgKGNtZC4lc19sZW5ndGhfbGVuZ3RoIC8gc2l6ZW9mKGNtZC4lc19sZW5ndGgpKTsgY3QrKykge1xuIiwgdnQtPm5hbWUsIHZ0LT5uYW1lKTsKLSAgICAgICAgICAgICAgICBmcHJpbnRmKGYsICIgICAgICAgIGNtZC4lcyA9ICgiLCB2dC0+bmFtZSk7Ci0gICAgICAgICAgICAgICAgcHJpbnRWYXJUeXBlKGYsIHZ0KTsKLSAgICAgICAgICAgICAgICBmcHJpbnRmKGYsICIpbWFsbG9jKGNtZC4lc19sZW5ndGhbY3RdKTtcbiIsIHZ0LT5uYW1lKTsKLSAgICAgICAgICAgICAgICBmcHJpbnRmKGYsICIgICAgICAgIGlvLT5jb3JlUmVhZCgmIGNtZC4lcywgY21kLiVzX2xlbmd0aFtjdF0pO1xuIiwgdnQtPm5hbWUsIHZ0LT5uYW1lKTsKLSAgICAgICAgICAgICAgICBmcHJpbnRmKGYsICIgICAgfVxuIik7Ci0gICAgICAgICAgICB9Ci0gICAgICAgIH0KLSAgICAgICAgZnByaW50ZihmLCAiXG4iKTsKLQotICAgICAgICBpZiAoYXBpLT5yZXQudHlwZU5hbWVbMF0pIHsKLSAgICAgICAgICAgIGZwcmludGYoZiwgIiAgICAiKTsKLSAgICAgICAgICAgIHByaW50VmFyVHlwZShmLCAmYXBpLT5yZXQpOwotICAgICAgICAgICAgZnByaW50ZihmLCAiIHJldCA9XG4iKTsKLSAgICAgICAgfQotCi0gICAgICAgIGZwcmludGYoZiwgIiAgICByc2lfJXMoIiwgYXBpLT5uYW1lKTsKLSAgICAgICAgaWYgKCFhcGktPm5vY29udGV4dCkgewotICAgICAgICAgICAgZnByaW50ZihmLCAiY29uIik7Ci0gICAgICAgIH0KLSAgICAgICAgZm9yIChjdDI9MDsgY3QyIDwgYXBpLT5wYXJhbUNvdW50OyBjdDIrKykgewotICAgICAgICAgICAgY29uc3QgVmFyVHlwZSAqdnQgPSAmYXBpLT5wYXJhbXNbY3QyXTsKLSAgICAgICAgICAgIGlmIChjdDIgPiAwIHx8ICFhcGktPm5vY29udGV4dCkgewotICAgICAgICAgICAgICAgIGZwcmludGYoZiwgIixcbiIpOwotICAgICAgICAgICAgfQotICAgICAgICAgICAgZnByaW50ZihmLCAiICAgICAgICAgICBjbWQuJXMiLCB2dC0+bmFtZSk7Ci0gICAgICAgIH0KLSAgICAgICAgZnByaW50ZihmLCAiKTtcbiIpOwotCi0gICAgICAgIGZvciAoY3QyPTA7IGN0MiA8IGFwaS0+cGFyYW1Db3VudDsgY3QyKyspIHsKLSAgICAgICAgICAgIGNvbnN0IFZhclR5cGUgKnZ0ID0gJmFwaS0+cGFyYW1zW2N0Ml07Ci0gICAgICAgICAgICBpZiAoKHZ0LT5wdHJMZXZlbCA9PSAxKSAmJiAoIXZ0LT5pc0NvbnN0KSkgewotICAgICAgICAgICAgICAgIGZwcmludGYoZiwgIiAgICBpby0+Y29yZVNldFJldHVybigodm9pZCAqKWNtZC4lcywgY21kLiVzX2xlbmd0aCk7XG4iLCB2dC0+bmFtZSwgdnQtPm5hbWUpOwotICAgICAgICAgICAgfQotICAgICAgICB9Ci0KLSAgICAgICAgZm9yIChjdDI9MDsgY3QyIDwgYXBpLT5wYXJhbUNvdW50OyBjdDIrKykgewotICAgICAgICAgICAgY29uc3QgVmFyVHlwZSAqdnQgPSAmYXBpLT5wYXJhbXNbY3QyXTsKLSAgICAgICAgICAgIGlmICgodnQtPnB0ckxldmVsID09IDIpICYmICghdnQtPmlzQ29uc3QpKSB7Ci0gICAgICAgICAgICAgICAgZnByaW50ZihmLCAiICAgIGZvciAoc2l6ZV90IGN0ID0gMDsgY3QgPCAoY21kLiVzX2xlbmd0aF9sZW5ndGggLyBzaXplb2YoY21kLiVzX2xlbmd0aCkpOyBjdCsrKSB7XG4iLCB2dC0+bmFtZSwgdnQtPm5hbWUpOwotICAgICAgICAgICAgICAgIGZwcmludGYoZiwgIiAgICAgICAgaW8tPmNvcmVTZXRSZXR1cm4oKHZvaWQgKiljbWQuJXNbY3RdLCBjbWQuJXNfbGVuZ3RoW2N0XSk7XG4iLCB2dC0+bmFtZSwgdnQtPm5hbWUpOwotICAgICAgICAgICAgICAgIGZwcmludGYoZiwgIiAgICB9XG4iKTsKLSAgICAgICAgICAgIH0KLSAgICAgICAgfQotICAgICAgICBmcHJpbnRmKGYsICJcbiIpOwotCi0gICAgICAgIGlmIChhcGktPnJldC50eXBlTmFtZVswXSkgewotICAgICAgICAgICAgZnByaW50ZihmLCAiICAgIGlvLT5jb3JlU2V0UmV0dXJuKCZyZXQsIHNpemVvZihyZXQpKTtcbiIpOwotICAgICAgICB9IGVsc2UgLyppZiAobmVlZEZsdXNoKSovIHsKLSAgICAgICAgICAgIGZwcmludGYoZiwgIiAgICBpby0+Y29yZVNldFJldHVybihOVUxMLCAwKTtcbiIpOwotICAgICAgICB9Ci0KLSAgICAgICAgZm9yIChjdDI9MDsgY3QyIDwgYXBpLT5wYXJhbUNvdW50OyBjdDIrKykgewotICAgICAgICAgICAgY29uc3QgVmFyVHlwZSAqdnQgPSAmYXBpLT5wYXJhbXNbY3QyXTsKLSAgICAgICAgICAgIGlmICh2dC0+cHRyTGV2ZWwgPT0gMSkgewotICAgICAgICAgICAgICAgIGZwcmludGYoZiwgIiAgICBmcmVlKCh2b2lkICopY21kLiVzKTtcbiIsIHZ0LT5uYW1lKTsKLSAgICAgICAgICAgIH0KLSAgICAgICAgfQotICAgICAgICBmb3IgKGN0Mj0wOyBjdDIgPCBhcGktPnBhcmFtQ291bnQ7IGN0MisrKSB7Ci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Ci0gICAgICAgIGNhc2UgJzAnOiAvLyByc2dBcGlTdHJ1Y3RzLmgKLSAgICAgICAgewotICAgICAgICAgICAgZnByaW50ZihmLCAiXG4iKTsKLSAgICAgICAgICAgIGZwcmludGYoZiwgIiNpbmNsdWRlIFwicnNDb250ZXh0LmhcIlxuIik7Ci0gICAgICAgICAgICBmcHJpbnRmKGYsICIjaW5jbHVkZSBcInJzRmlmby5oXCJcbiIpOwotICAgICAgICAgICAgZnByaW50ZihmLCAiXG4iKTsKLSAgICAgICAgICAgIGZwcmludGYoZiwgIm5hbWVzcGFjZSBhbmRyb2lkIHtcbiIpOwotICAgICAgICAgICAgZnByaW50ZihmLCAibmFtZXNwYWNlIHJlbmRlcnNjcmlwdCB7XG4iKTsKLSAgICAgICAgICAgIHByaW50U3RydWN0dXJlcyhmKTsKLSAgICAgICAgICAgIHByaW50RnVuY0RlY2xzKGYsICJyc2lfIiwgMSk7Ci0gICAgICAgICAgICBwcmludFBsYXliYWNrRnVuY3MoZiwgInJzcF8iKTsKLSAgICAgICAgICAgIGZwcmludGYoZiwgIlxuXG50eXBlZGVmIHN0cnVjdCBSc1BsYXliYWNrUmVtb3RlSGVhZGVyUmVjIHtcbiIpOwotICAgICAgICAgICAgZnByaW50ZihmLCAiICAgIHVpbnQzMl90IGNvbW1hbmQ7XG4iKTsKLSAgICAgICAgICAgIGZwcmludGYoZiwgIiAgICB1aW50MzJfdCBzaXplO1xuIik7Ci0gICAgICAgICAgICBmcHJpbnRmKGYsICJ9IFJzUGxheWJhY2tSZW1vdGVIZWFkZXI7XG5cbiIpOwotICAgICAgICAgICAgZnByaW50ZihmLCAidHlwZWRlZiB2b2lkICgqUnNQbGF5YmFja0xvY2FsRnVuYykoQ29udGV4dCAqLCBjb25zdCB2b2lkICosIHNpemVfdCBzaXplQnl0ZXMpO1xuIik7Ci0gICAgICAgICAgICBmcHJpbnRmKGYsICJ0eXBlZGVmIHZvaWQgKCpSc1BsYXliYWNrUmVtb3RlRnVuYykoQ29udGV4dCAqLCBUaHJlYWRJTyAqKTtcbiIpOwotICAgICAgICAgICAgZnByaW50ZihmLCAiZXh0ZXJuIFJzUGxheWJhY2tMb2NhbEZ1bmMgZ1BsYXliYWNrRnVuY3NbJWldO1xuIiwgYXBpQ291bnQgKyAxKTsKLSAgICAgICAgICAgIGZwcmludGYoZiwgImV4dGVybiBSc1BsYXliYWNrUmVtb3RlRnVuYyBnUGxheWJhY2tSZW1vdGVGdW5jc1slaV07XG4iLCBhcGlDb3VudCArIDEpOwotCi0gICAgICAgICAgICBmcHJpbnRmKGYsICJ9XG4iKTsKLSAgICAgICAgICAgIGZwcmludGYoZiwgIn1cbiIpOwotICAgICAgICB9Ci0gICAgICAgIGJyZWFrOwotCi0gICAgICAgIGNhc2UgJzEnOiAvLyByc2dBcGlGdW5jRGVjbC5oCi0gICAgICAgIHsKLSAgICAgICAgICAgIHByaW50RnVuY0RlY2xzKGYsICJycyIsIDApOwotICAgICAgICB9Ci0gICAgICAgIGJyZWFrOwotCi0gICAgICAgIGNhc2UgJzInOiAvLyByc2dBcGkuY3BwCi0gICAgICAgIHsKLSAgICAgICAgICAgIHByaW50QXBpQ3BwKGYpOwotICAgICAgICB9Ci0gICAgICAgIGJyZWFrOwotCi0gICAgICAgIGNhc2UgJzMnOiAvLyByc2dBcGlSZXBsYXkuY3BwCi0gICAgICAgIHsKLSAgICAgICAgICAgIHByaW50RmlsZUhlYWRlcihmKTsKLSAgICAgICAgICAgIHByaW50UGxheWJhY2tDcHAoZik7Ci0gICAgICAgIH0KLSAgICAgICAgYnJlYWs7Ci0KLSAgICAgICAgY2FzZSAnNCc6IC8vIHJzZ0FwaVN0cmVhbS5jcHAKLSAgICAgICAgewotICAgICAgICAgICAgcHJpbnRGaWxlSGVhZGVyKGYpOwotICAgICAgICAgICAgcHJpbnRQbGF5YmFja0NwcChmKTsKLSAgICAgICAgfQotCi0gICAgICAgIGNhc2UgJzUnOiAvLyByc2dBcGlTdHJlYW1SZXBsYXkuY3Bw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ICAgICAgICAgICAgICAgICAgICAgQ1ZUX0ZVTkNfMih0eXBlLCBjaGFyKSAgICAgIFwKLSAgICAgICAgICAgICAgICAgICAgICAgIENWVF9GVU5DXzIodHlwZSwgdXNob3J0KSAgICBcCi0gICAgICAgICAgICAgICAgICAgICAgICBDVlRfRlVOQ18yKHR5cGUsIHNob3J0KSAgICAgXAotICAgICAgICAgICAgICAgICAgICAgICAgQ1ZUX0ZVTkNfMih0eXBlLCB1aW50KSAgICAgIFwKLSAgICAgICAgICAgICAgICAgICAgICAgIENWVF9GVU5DXzIodHlwZSwgaW50KSAgICAgICBcCi0gICAgICAgICAgICAgICAgICAgICAgICBDVlRfRlVOQ18yKHR5cGUsIGZsb2F0KQotCi1DVlRfRlVOQyhjaGFyKQotQ1ZUX0ZVTkModWNoYXIpCi1DVlRfRlVOQyhzaG9ydCkKLUNWVF9GVU5DKHVzaG9ydCkKLUNWVF9GVU5DKGludCkKLUNWVF9GVU5DKHVpbnQpCi1DVlRfRlVOQyhmbG9hdCkKLQotLy8gRmxvYXQgb3BzLCA2LjExLjIKLQotI2RlZmluZSBGTl9GVU5DX0ZOKGZuYykgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFwKLV9SU19SVU5USU1FIGZsb2F0MiBfX2F0dHJpYnV0ZV9fKChvdmVybG9hZGFibGUpKSBmbmMoZmxvYXQyIHYpOyAgXAotX1JTX1JVTlRJTUUgZmxvYXQzIF9fYXR0cmlidXRlX18oKG92ZXJsb2FkYWJsZSkpIGZuYyhmbG9hdDMgdik7ICBcCi1fUlNfUlVOVElNRSBmbG9hdDQgX19hdHRyaWJ1dGVfXygob3ZlcmxvYWRhYmxlKSkgZm5jKGZsb2F0NCB2KTsKLQotI2RlZmluZSBJTl9GVU5DX0ZOKGZuYykgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFwKLV9SU19SVU5USU1FIGludDIgX19hdHRyaWJ1dGVfXygob3ZlcmxvYWRhYmxlKS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Nlcy4KLSAqCi0gKiBSU18qIG9iamVjdHMuICAzMiBiaXQgb3BhcXVlIGhhbmRsZXMuCi0gKi8KLXR5cGVkZWYgZW51bSB7Ci0gICAgUlNfVFlQRV9OT05FICAgICAgICAgICAgID0gMCwKLSAgICAvL1JTX1RZUEVfRkxPQVRfMTYsCi0gICAgUlNfVFlQRV9GTE9BVF8zMiAgICAgICAgID0gMiwKLSAgICBSU19UWVBFX0ZMT0FUXzY0ICAgICAgICAgPSAzLAotICAgIFJTX1RZUEVfU0lHTkVEXzggICAgICAgICA9IDQsCi0gICAgUlNfVFlQRV9TSUdORURfMTYgICAgICAgID0gNSwKLSAgICBSU19UWVBFX1NJR05FRF8zMiAgICAgICAgPSA2LAotICAgIFJTX1RZUEVfU0lHTkVEXzY0ICAgICAgICA9IDcsCi0gICAgUlNfVFlQRV9VTlNJR05FRF84ICAgICAgID0gOCwKLSAgICBSU19UWVBFX1VOU0lHTkVEXzE2ICAgICAgPSA5LAotICAgIFJTX1RZUEVfVU5TSUdORURfMzIgICAgICA9IDEwLAotICAgIFJTX1RZUEVfVU5TSUdORURfNjQgICAgICA9IDExLAotCi0gICAgUlNfVFlQRV9CT09MRUFOICAgICAgICAgID0gMTIsCi0KLSAgICBSU19UWVBFX1VOU0lHTkVEXzVfNl81ICAgPSAxMywKLSAgICBSU19UWVBFX1VOU0lHTkVEXzVfNV81XzEgPSAxNCwKLSAgICBSU19UWVBFX1VOU0lHTkVEXzRfNF80XzQgPSAxNSwKLQotICAgIFJTX1RZUEVfTUFUUklYXzRYNCAgICAgICA9IDE2LAotICAgIFJTX1RZUEVfTUFUUklYXzNYMyAgICAgICA9IDE3LAotICAgIFJTX1RZUEVfTUFUUklYXzJYMiAgICAgICA9IDE4LAotCi0gICAgUlNfVFlQRV9FTEVNRU5UICAgICAgICAgID0gMTAwMCwKLSAgICBSU19UWVBFX1RZUEUgICAgICAgICAgICAgPSAxMDAxLAotICAgIFJTX1RZUEVfQUxMT0NBVElPTiAgICAgIC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ICAgPSA3LAotICAgIFJTX0JMRU5EX1NSQ19TUkNfQUxQSEFfU0FUVVJBVEUgICAgID0gOCwKLQotICAgIFJTX0JMRU5EX1NSQ19JTlZBTElEICAgICAgICAgICAgICAgID0gMTAwLAotfSByc19ibGVuZF9zcmNfZnVuYzsKLQotdHlwZWRlZiBlbnVtIHsKLSAgICBSU19CTEVORF9EU1RfWkVSTyAgICAgICAgICAgICAgICAgICA9IDAsCi0gICAgUlNfQkxFTkRfRFNUX09ORSAgICAgICAgICAgICAgICAgICAgPSAxLAotICAgIFJTX0JMRU5EX0RTVF9TUkNfQ09MT1IgICAgICAgICAgICAgID0gMiwKLSAgICBSU19CTEVORF9EU1RfT05FX01JTlVTX1NSQ19DT0xPUiAgICA9IDMsCi0gICAgUlNfQkxFTkRfRFNUX1NSQ19BTFBIQSAgICAgICAgICAgICAgPSA0LAotICAgIFJTX0JMRU5EX0RTVF9PTkVfTUlOVVNfU1JDX0FMUEhBICAgID0gNSwKLSAgICBSU19CTEVORF9EU1RfRFNUX0FMUEhBICAgICAgICAgICAgICA9IDYsCi0gICAgUlNfQkxFTkRfRFNUX09ORV9NSU5VU19EU1RfQUxQSEEgICAgPSA3LAotCi0gICAgUlNfQkxFTkRfRFNUX0lOVkFMSUQgICAgICAgICAgICAgICAgPSAxMDAsCi19IHJzX2JsZW5kX2RzdF9mdW5jOwotCi10eXBlZGVmIGVudW0gewotICAgIFJTX0NVTExfQkFDSyAgICAgPSAwLAotICAgIFJTX0NVTExfRlJPTlQgICAgPSAxLAotICAgIFJTX0NVTExfTk9ORSAgICAgPSAyLAotCi0gICAgUlNfQ1VMTF9JTlZBTElEICA9IDEwMCwKLX0gcnNfY3VsbF9tb2RlOwotCi10eXBlZGVmIGVudW0gewotICAgIFJTX1NBTVBMRVJfTkVBUkVTVCAgICAgICAgICAgICAgPSAwLAotICAgIFJTX1NBTVBMRVJfTElORUFSICAgICAgICAgICAgICAgPSAxLAotICAgIFJTX1NBTVBMRVJfTElORUFSX01J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GUtPnB0ckxldmVsKSB7Ci0gICAgICAgICAgIGN1cnJUeXBlID0gJmFwaXNbYXBpQ291bnRdLnBhcmFtc1thcGlzW2FwaUNvdW50XS5wYXJhbUNvdW50XTsKLSAgICAgICAgICAgY3VyclR5cGUtPnR5cGUgPSA0OwotICAgICAgICAgICBjdXJyVHlwZS0+cHRyTGV2ZWwgPSBjdXJQdHJMZXZlbDsKLSAgICAgICAgICAgaWYgKGN1cnJUeXBlLT5wdHJMZXZlbCA+IDApIHsKLSAgICAgICAgICAgICAgY3VyclR5cGUtPmlzQ29uc3QgPSAxOwotICAgICAgICAgICB9Ci0gICAgICAgICAgIHNwcmludGYoY3VyclR5cGUtPnR5cGVOYW1lLCAiJXMiLCAic2l6ZV90Iik7Ci0gICAgICAgICAgIHN3aXRjaChiYXNlVHlwZS0+cHRyTGV2ZWwgLSBjdXJQdHJMZXZlbCkgewotICAgICAgICAgICBjYXNlIDE6Ci0gICAgICAgICAgICAgIHNwcmludGYoY3VyclR5cGUtPm5hbWUsICIlc19sZW5ndGgiLCBiYXNlVHlwZS0+bmFtZSk7Ci0gICAgICAgICAgICAgIGJyZWFrOwotICAgICAgICAgICBjYXNlIDI6Ci0gICAgICAgICAgICAgIHNwcmludGYoY3VyclR5cGUtPm5hbWUsICIlc19sZW5ndGhfbGVuZ3RoIiwgYmFzZVR5cGUtPm5hbWUpOwotICAgICAgICAgICAgICBicmVhazsKLSAgICAgICAgICAgfQotICAgICAgICAgICBhcGlzW2FwaUNvdW50XS5wYXJhbUNvdW50Kys7Ci0gICAgICAgICAgIGN1clB0ckxldmVsICsrOwotICAgICAgIH0KLSAgIH0KLQotICAgZXh0ZXJuICJDIiBpbnQgeXlsZXgoKTsKLQotJSUKLQotIi8qIiAgICAgICAgIEJFR0lOKGNvbW1lbnQpOwotPGNvbW1lbnQ+W14qXG5dKiAgICAgICAgLyogZWF0IGFueXRoaW5nIHRoYXQncyBub3QgYSAnKicgKi8KLTxjb21tZW50PiIqIitbXiovXG5d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9ybWF0X2NoYW5uZWxzXyk7Ci0KLSAgICAgICAgICAgICAgICByZXMgPSByZW5kZXJlcl8tPnNldChBVURJT19TVFJFQU1fREVGQVVMVCwKLSAgICAgICAgICAgICAgICAgICAgICAgIGZvcm1hdF9zYW1wbGVfcmF0ZV8sCi0gICAgICAgICAgICAgICAgICAgICAgICBBVURJT19GT1JNQVRfUENNXzE2X0JJVCwKLSAgICAgICAgICAgICAgICAgICAgICAgIGNoX2Zvcm1hdCwKLSAgICAgICAgICAgICAgICAgICAgICAgIGZyYW1lQ291bnQpOwotICAgICAgICAgICAgICAgIGlmIChyZXMgIT0gT0spIHsKLSAgICAgICAgICAgICAgICAgICAgQUxPR0UoIkZhaWxlZCB0byBzZXR1cCBhdWRpbyByZW5kZXJlci4gKHJlcyA9ICVkKSIsIHJlcyk7Ci0gICAgICAgICAgICAgICAgICAgIGRlbGV0ZSByZW5kZXJlcl87Ci0gICAgICAgICAgICAgICAgICAgIHJlbmRlcmVyXyA9IE5VTEw7Ci0gICAgICAgICAgICAgICAgfSBlbHNlIHsKLSAgICAgICAgICAgICAgICAgICAgQ0hFQ0sobGFzdF90c190cmFuc2Zvcm1fdmFsaWRfKTsKLQotICAgICAgICAgICAgICAgICAgICByZXMgPSByZW5kZXJlcl8tPnNldE1lZGlhVGltZVRyYW5zZm9ybSgKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBsYXN0X3RzX3RyYW5zZm9ybV8sIFRpbWVkQXVkaW9UcmFjazo6Q09NTU9OX1RJTUUpOwotICAgICAgICAgICAgICAgICAgICBpZiAocmVzICE9IE5PX0VSUk9SKSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICBBTE9HRSgiRmFpbGVkIHRvIHNldCBtZWRpYSB0aW1lIHRyYW5zZm9ybSBvbiBBdWRpb1RyYWNrIgotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIiAocmVzID0gJWQpIiwgcmVzKTsKLSAgICAgICAgICAgICAgICAgICAgICAgIGRlbGV0ZSByZW5kZXJlcl87Ci0gICAgICAgICAgICAgICAgICAgICAgICByZW5kZXJlcl8gPSBOVUxMOwotICAgICAgICAgICAgICAgICAgICB9IGVsc2UgewotICAgICAgICAgICAgICAgICAgICAgICAgZmxvYXQgdm9sdW1lID0gc3RhdGljX2Nhc3Q8ZmxvYXQ+KGxhc3Rfdm9sdW1lXykKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvIDI1NS4wZjsKLSAgICAgICAgICAgICAgICAgICAgICAgIGlmIChyZW5kZXJlcl8tPnNldFZvbHVtZSh2b2x1bWUsIHZvbHVtZSkgIT0gT0spIHsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBBTE9HVygiJXM6IHNldFZvbHVtZSBmYWlsZWQiLCBfX0ZVTkNUSU9OX18pOwotICAgICAgICAgICAgICAgICAgICAgICAgfQotCi0gICAgICAgICAgICAgICAgICAgICAgICByZW5kZXJlcl8tPnN0YXJ0KCk7Ci0gICAgICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICB9IGVsc2UgewotICAgICAgICAgICAgICAgIEFMT0dFKCJGYWlsZWQgdG8gYWxsb2NhdGUgQXVkaW9UcmFjayB0byB1c2UgYXMgYSByZW5kZXJlci4iKTsKLSAgICAgICAgICAgIH0KLSAgICAgICAgfQotCi0gICAgICAgIGlmIChOVUxMICE9IHJlbmRlcmVyXykgewotICAgICAgICAgICAgdWludDhfdCogZGVjb2RlZF9kYXRhID0KLSAgICAgICAgICAgICAgICByZWludGVycHJldF9jYXN0PHVpbnQ4X3QqPihkZWNvZGVkX3NhbXBsZS0+ZGF0YSgpKTsKLSAgICAgICAgICAgIHVpbnQzMl90IGRlY29kZWRfYW10ICA9IGRlY29kZWRfc2FtcGxlLT5yYW5nZV9sZW5ndGgoKTsKLSAgICAgICAgICAgIGRlY29kZWRfZGF0YSArPSBkZWNvZGVkX3NhbXBsZS0+cmFuZ2Vfb2Zmc2V0KCk7Ci0KLSAgICAgICAgICAgIHNwPElNZW1vcnk+IHBjbV9wYXlsb2FkOwotICAgICAgICAgICAgcmVzID0gcmVuZGVyZXJfLT5hbGxvY2F0ZVRpbWVkQnVmZmVyKGRlY29kZWRfYW10LCAmcGNtX3BheWxvYWQpOwotICAgICAgICAgICAgaWYgKHJlcyAhPSBPSykgewotICAgICAgICAgICAgICAgIEFMT0dFKCJGYWlsZWQgdG8gYWxsb2NhdGUgJWQgYnl0ZSBhdWRpbyB0cmFjayBidWZmZXIuIgotICAgICAgICAgICAgICAgICAgICAgICIgKHJlcyA9ICVkKSIsIGRlY29kZWRfYW10LCByZXMpOwotICAgICAgICAgICAgfSBlbHNlIHsKLSAgICAgICAgICAgICAgICBtZW1jcHkocGNtX3BheWxvYWQtPnBvaW50ZXIoKSwgZGVjb2RlZF9kYXRhLCBkZWNvZGVkX2FtdCk7Ci0KLSAgICAgICAgICAgICAgICByZXMgPSByZW5kZXJlcl8tPnF1ZXVlVGltZWRCdWZmZXIocGNtX3BheWxvYWQsIHRzKTsKLSAgICAgICAgICAgICAgICBpZiAocmVzICE9IE9LKSB7Ci0gICAgICAgICAgICAgICAgICAgIEFMT0dFKCJGYWlsZWQgdG8gcXVldWUgJWQgYnl0ZSBhdWRpbyB0cmFjayBidWZmZXIgd2l0aCIKLSAgICAgICAgICAgICAgICAgICAgICAgICAgIiBtZWRpYSBQVFMgJWxsZC4gKHJlcyA9ICVkKSIsIGRlY29kZWRfYW10LCB0cywgcmVzKTsKLSAgICAgICAgICAgICAgICB9IGVsc2UgewotICAgICAgICAgICAgICAgICAgICBsYXN0X3F1ZXVlZF9wdHNfdmFsaWRfID0gdHJ1ZTsKLSAgICAgICAgICAgICAgICAgICAgbGFzdF9xdWV1ZWRfcHRzXyA9IHRzOwotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgIH0KLQotICAgICAgICB9IGVsc2UgewotICAgICAgICAgICAgQUxPR0UoIk5vIHJlbmRlcmVyLCBkcm9wcGluZyBhdWRpb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AotICAgICAgICAgICAgICAgICAgICBfX1BSRVRUWV9GVU5DVElPTl9fLCByZXMpOwotCi0gICAgICAgICAgICBpZiAoKGNvbnNlY3V0aXZlX2Vycm9ycyAgICAgID49IGtNYXhFcnJvcnNCZWZvcmVGYXRhbCkgfHwKLSAgICAgICAgICAgICAgICAoY29uc2VjdXRpdmVfbG9uZ19lcnJvcnMgPj0ga01heExvbmdFcnJvcnNCZWZvcmVGYXRhbCkpIHsKLSAgICAgICAgICAgICAgICBBTE9HRSgiJXM6IE1heGltdW0gZGVjb2RlIGVycm9yIHRocmVzaG9sZCBoYXMgYmVlbiByZWFjaGVkLiIKLSAgICAgICAgICAgICAgICAgICAgICAiIFRoZXJlIGhhdmUgYmVlbiAlZCBjb25zZWN1dGl2ZSBkZWNvZGUgZXJyb3JzLCBhbmQgJWQiCi0gICAgICAgICAgICAgICAgICAgICAgIiBjb25zZWN1dGl2ZSBkZWNvZGUgb3BlcmF0aW9ucyB3aGljaCByZXN1bHRlZCBpbiBlcnJvcnMiCi0gICAgICAgICAgICAgICAgICAgICAgIiBhbmQgdG9vayBtb3JlIHRoYW4gJWxsZCB1U2VjIHRvIHByb2Nlc3MuICBUaGUgbGFzdCIKLSAgICAgICAgICAgICAgICAgICAgICAiIGRlY29kZSBvcGVyYXRpb24gdG9vayAlbGxkIHVTZWMuIiwKLSAgICAgICAgICAgICAgICAgICAgICBfX1BSRVRUWV9GVU5DVElPTl9fLAotICAgICAgICAgICAgICAgICAgICAgIGNvbnNlY3V0aXZlX2Vycm9ycywgY29uc2VjdXRpdmVfbG9uZ19lcnJvcnMsCi0gICAgICAgICAgICAgICAgICAgICAga0xvbmdEZWNvZGVFcnJvclRocmVzaG9sZCwgZGVjb2RlX3RpbWVyLmR1cmF0aW9uVXNlY3MoKSk7Ci0gICAgICAgICAgICAgICAgdGhyZWFkX3N0YXR1c18gPSByZXM7Ci0gICAgICAgICAgICAgICAgYnJlYWs7Ci0gICAgICAgICAgICB9Ci0KLSAgICAgICA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UFIX1JYUGxheWVyOjpnZXRQYXJhbWV0ZXIoaW50IGtleSwgUGFyY2VsICpyZXBseSkgewotICAgIHJldHVybiBFUlJPUl9VTlNVUFBPUlRFRDsKLX0KLQotc3RhdHVzX3QgQUFIX1JYUGxheWVyOjppbnZva2UoY29uc3QgUGFyY2VsJiByZXF1ZXN0LCBQYXJjZWwgKnJlcGx5KSB7Ci0gICAgaWYgKCFyZXBseSkgewotICAgICAgICByZXR1cm4gQkFEX1ZBTFVFOwotICAgIH0KLQotICAgIGludDMyX3QgbWFnaWM7Ci0gICAgc3RhdHVzX3QgZXJyID0gcmVxdWVzdC5yZWFkSW50MzIoJm1hZ2ljKTsKLSAgICBpZiAoZXJyICE9IE9LKSB7Ci0gICAgICAgIHJlcGx5LT53cml0ZUludDMyKGVycik7Ci0gICAgICAgIHJldHVybiBPSzsKLSAgICB9Ci0KLSAgICBpZiAobWFnaWMgIT0gMHgxMjM0NSkgewotICAgICAgICByZXBseS0+d3JpdGVJbnQzMihCQURfVkFMVUUpOwotICAgICAgICByZXR1cm4gT0s7Ci0gICAgfQotCi0gICAgaW50MzJfdCBtZXRob2RJRDsKLSAgICBlcnIgPSByZXF1ZXN0LnJlYWRJbnQzMigmbWV0aG9kSUQpOwotICAgIGlmIChlcnIgIT0gT0spIHsKLSAgICAgICAgcmVwbHktPndyaXRlSW50MzIoZXJyKTsKLSAgICAgICAgcmV0dXJuIE9LOwotICAgIH0KLQotICAgIHN3aXRjaCAobWV0aG9kSUQpIHsKLSAgICAgICAgLy8gR2V0IFZvbHVtZQotICAgICAgICBjYXNlIElOVk9LRV9HRVRfTUFTVEVSX1ZPTFVNRTogewotICAgICAgICAgICAgaWYgKGF1ZGlvX2ZsaW5nZXJfICE9IE5VTEwpIHsKLSAgICAgICAgICAgICAgICByZXBseS0+d3JpdGVJbnQzMihPSyk7Ci0gICAgICAgICAgICAgICAgcmVwbHktPndyaXRlRmxvYXQoYXVkaW9fZmxpbmdlcl8tPm1hc3RlclZvbHVt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NfdCAgICBpbml0Q2hlY2soKTsKLSAgICB2aXJ0dWFsIHN0YXR1c190ICAgIHNldERhdGFTb3VyY2UoY29uc3QgY2hhciAqdXJsLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb25zdCBLZXllZFZlY3RvcjxTdHJpbmc4LCBTdHJpbmc4PioKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaGVhZGVycyk7Ci0gICAgdmlydHVhbCBzdGF0dXNfdCAgICBzZXREYXRhU291cmNlKGludCBmZCwgaW50NjRfdCBvZmZzZXQsIGludDY0X3QgbGVuZ3RoKTsKLSAgICB2aXJ0dWFsIHN0YXR1c190ICAgIHNldFZpZGVvU3VyZmFjZShjb25zdCBzcDxTdXJmYWNlPiYgc3VyZmFjZSk7Ci0gICAgdmlydHVhbCBzdGF0dXNfdCAgICBzZXRWaWRlb1N1cmZhY2VUZXh0dXJlKGNvbnN0IHNwPElTdXJmYWNlVGV4dHVyZT4mCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHN1cmZhY2VUZXh0dXJlKTsKLSAgICB2aXJ0dWFsIHN0YXR1c190ICAgIHByZXBhcmUoKTsKLSAgICB2aXJ0dWFsIHN0YXR1c190ICAgIHByZXBhcmVBc3luYygpOwotICAgIHZpcnR1YWwgc3RhdHVzX3QgICAgc3RhcnQoKTsKLSAgICB2aXJ0dWFsIHN0YXR1c190ICAgIHN0b3AoKTsKLSAgICB2aXJ0dWFsIHN0YXR1c190ICAgIHBhdXNlKCk7Ci0gICAgdmlydHVhbCBib29sICAgICAgICBpc1BsYXlpbmcoKTsKLSAgICB2aXJ0dWFsIHN0YXR1c190ICAgIHNlZWtUbyhpbnQgbXNlYyk7Ci0gICAgdmlydHVhbCBzdGF0dXNfdCAgICBnZXRDdXJyZW50UG9zaXRpb24oaW50ICptc2VjKTsKLSAgICB2aXJ0dWFsIHN0YXR1c190ICAgIGdldER1cmF0aW9uKGludCA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gICB1aW50MzJfdCAgICAgICB3cl87Ci0KLSAgICAgICAgdWludDE2X3QgICAgICAgcmRfc2VxXzsKLSAgICAgICAgYm9vbCAgICAgICAgICAgcmRfc2VxX2tub3duXzsKLSAgICAgICAgYm9vbCAgICAgICAgICAgd2FpdGluZ19mb3JfZmFzdF9zdGFydF87Ci0gICAgICAgIGJvb2wgICAgICAgICAgIGZldGNoZWRfZmlyc3RfcGFja2V0XzsKLQotICAgICAgICB1aW50NjRfdCAgICAgICBydHBfYWN0aXZpdHlfdGltZW91dF87Ci0gICAgICAgIGJvb2wgICAgICAgICAgIHJ0cF9hY3Rpdml0eV90aW1lb3V0X3ZhbGlkXzsKLQotICAgICAgICBESVNBTExPV19FVklMX0NPTlNUUlVDVE9SUyhSWFJpbmdCdWZmZXIpOwotICAgIH07Ci0KLSAgICBjbGFzcyBTdWJzdHJlYW0gOiBwdWJsaWMgdmlydHVhbCBSZWZCYXNlIHsKLSAgICAgIHB1YmxpYzoKLSAgICAgICAgU3Vic3RyZWFtKHVpbnQzMl90IHNzcmMsIE9NWENsaWVudCYgb214KTsKLQotICAgICAgICB2b2lkIGNsZWFudXBCdWZmZXJJblByb2dyZXNzKCk7Ci0gICAgICAgIHZvaWQgc2h1dGRvd24oKTsKLSAgICAgICAgdm9pZCBwcm9jZXNzUGF5bG9hZFN0YXJ0KHVpbnQ4X3QqIGJ1ZiwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHVpbnQzMl90IGFtdCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGludDMyX3QgdHNfbG93ZXIpOwotICAgICAgICB2b2lkIHByb2Nlc3NQYXlsb2FkQ29udCAodWludDhfdCogYnVmLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdWludDMyX3QgYW10KTsKLSAgICAgICAgdm9pZCBwcm9jZXNzVFNUcmFuc2Zvcm0oY29uc3QgTGluZWFyVHJhbnNmb3JtJiB0cmFucyk7Ci0KLSAgICAgICAgYm9vbCAgICAgaXNBYm91dFRvVW5kZXJmbG93KCk7Ci0gICAgICAgIHVpbnQzMl90IGdldFNTUkMoKSAgICAgIGNvbnN0IHsgcmV0dXJuIHNzcmNfOyB9Ci0gICAgICAgIHVpbnQxNl90IGdldFByb2dyYW1JRCgpIGNvbnN0IHsgcmV0dXJuIChzc3JjXyA+PiA1KSAmIDB4MUY7IH0KLSAgICAgICAgc3RhdHVzX3QgZ2V0U3RhdHVzKCkgY29uc3QgeyByZXR1cm4gc3RhdHVzXzsgfQotCi0gICAgICBwcm90ZWN0ZWQ6Ci0gICAgICAgIHZpcnR1YWwgflN1YnN0cmVhbSgpOwotCi0gICAgICBwcml2YXRlOgotICAgICAgICB2b2lkICAgICAgICAgICAgICAgIGNsZWFudXBEZWNvZGVyKCk7Ci0gICAgICAgIGJvb2wgICAgICAgICAgICAgICAgc2hvdWxkQWJvcnQoY29uc3QgY2hhciogbG9nX3RhZyk7Ci0gICAgICAgIHZvaWQgICAgICAgICAgICAgICAgcHJvY2Vzc0NvbXBsZXRlZEJ1ZmZlcigpOwotICAgICAgICBib29sICAgICAgICAgICAgICAgIHNldHVwU3Vic3RyZWFtTWV0YSgpOwotICAgICAgICBib29sICAgICAgICAgICAgICAgIHNldHVwTVAzU3Vic3RyZWFtTWV0YSgpOwotICAgICAgICBib29sICAgICAgICAgICAgICAgIHNldHVwQUFDU3Vic3RyZWFtTWV0YSgpOwotICAgICAgICBib29sICAgICAgICAgICAgICAgIHNldHVwU3Vic3RyZWFtVHlwZSh1aW50OF90IHN1YnN0cmVhbV90eXBlLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB1aW50OF90IGNvZGVjX3R5cGUpOwotCi0gICAgICAgIHVpbnQzMl90ICAgICAgICAgICAgc3NyY187Ci0gICAgICAgIGJvb2wgICAgICAgICAgICAgICAgd2FpdGluZ19mb3JfcmFwXzsKLSAgICAgICAgc3RhdHVzX3QgICAgICAgICAgICBzdGF0dXNfOwotCi0gICAgICAgIGJvb2wgICAgICAgICAgICAgICAgc3Vic3RyZWFtX2RldGFpbHNfa25vd25fOwotICAgICAgICB1aW50OF90ICAgICAgICAgICAgIHN1YnN0cmVhbV90eXBlXzsKLSAgICAgICAgdWludDhfdCAgICAgICAgICAgICBjb2RlY190eXBlXzsKLSAgICAgICAgY29uc3QgY2hhciogICAgICAgICBjb2RlY19taW1lX3R5cGVfOwotICAgICAgICBzcDxNZXRhRGF0YT4gICAgICAgIHN1YnN0cmVhbV9tZXRhXzsKLQotICAgICAgICBNZWRpYUJ1ZmZlciogICAgICAgIGJ1ZmZlcl9pbl9wcm9ncmVzc187Ci0gICAgICAgIHVpbnQzMl90ICAgICAgICAgICAgZXhwZWN0ZWRfYnVmZmVyX3NpemVfOwotICAgICAgICB1aW50MzJfdCAgICAgICAgICAgIGJ1ZmZlcl9maWxsZWRfOwotCi0gICAgICAgIFZlY3Rvcjx1aW50OF90PiAgICAgYXV4X2RhdGFfaW5fcHJvZ3Jlc3NfOwotICAgICAgICB1aW50MzJfdCAgICAgICAgICAgIGF1eF9kYXRhX2V4cGVjdGVkX3NpemVfOwotCi0gICAgICAgIHNwPEFBSF9EZWNvZGVyUHVtcD4gZGVjb2Rlcl87Ci0KLSAgICAgICAgc3RhdGljIGludDY0X3QgICAgICBrQWJvdXRUb1VuZGVyZmxvd1RocmVzaG9sZDsKLQotICAgICAgICBESVNBTExPV19FVklMX0NPTlNUUlVDVE9SUyhTdWJzdHJlYW0pOwotICAgIH07Ci0KLSAgICB0eXBlZGVmIERlZmF1bHRLZXllZFZlY3RvcjwgdWludDMyX3QsIHNwPFN1YnN0cmVhbT4gPiBTdWJzdHJlYW1WZWM7Ci0KLSAgICBzdGF0dXNfdCAgICAgICAgICAgIHN0YXJ0V29ya1RocmVhZCgpOwotICAgIHZvaWQgICAgICAgICAgICAgICAgc3RvcFdvcmtUaHJlYWQoKTsKLSAgICB2aXJ0dWFsIGJvb2wgICAgICAgIHRocmVhZExvb3AoKTsKLSAgICBib29sICAgICAgICAgICAgICAgIHNldHVwU29ja2V0KCk7Ci0gICAgdm9pZCAgICAgICAgICAgICAgICBjbGVhbnVwU29ja2V0KCk7Ci0gICAgdm9pZCAgICAgICAgICAgICAgICByZXNldFBpcGVsaW5lKCk7Ci0gICAgdm9pZCAgICAgICAgICAgICAgICByZXNldF9sKCk7Ci0gICAgYm9vbCAgICAgICAgICAgICAgICBwcm9jZXNzUlgoUGFja2V0QnVmZmVyKiBwYik7Ci0gICAgdm9pZCAgICAgICAgICAgICAgICBwcm9jZXNzUmluZ0J1ZmZlcigpOwotICAgIHZvaWQgICAgICAgICAgICAgICAgcHJvY2Vzc0NvbW1hbmRQYWNrZXQoUGFja2V0QnVmZmVyKiBwYik7Ci0gICAgYm9vbCAgICAgICAgICAgICAgICBwcm9jZXNzR2FwcygpOwotICAgIGludCAgICAgICAgICAgICAgICAgY29tcHV0ZU5leHRHYXBSZXRyYW5zbWl0VGltZW91dCgpOwotICAgIHZvaWQgICAgICAgICAgICAgICAgZmV0Y2hBdWRpb0ZsaW5nZXIoKTsKLQotICAgIFBpcGVFdmVudCAgICAgICAgICAgd2FrZXVwX3dvcmtfdGhyZWFkX2V2dF87Ci0gICAgc3A8VGhyZWFkV3JhcHBlcj4gICB0aHJlYWRfd3JhcHBlcl87Ci0gICAgTXV0ZXggICAgICAgICAgICAgICBhcGlfbG9ja187Ci0gICAgYm9vbCAgICAgICAgICAgICAgICBpc19wbGF5aW5nXzsKLSAgICBib29sICAgICAgICAgICAgICAgIGRhdGFfc291cmNlX3NldF87Ci0KLSAgICBzdHJ1Y3Qgc29ja2FkZHJfaW4gIGxpc3Rlbl9hZGRyXzsKLSAgICBpbnQgICAgICAgICAgICAgICAgIHNvY2tfZmRfOwotICAgIGJvb2wgICAgICAgICAgICAgICAgbXVsdGljYXN0X2pvaW5lZF87Ci0KLSAgICBzdHJ1Y3Qgc29ja2FkZHJfaW4gIHRyYW5zbWl0dGVyX2FkZHJfOwotICAgIGJv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SAwKSB7Ci0gICAgICAgIGlmIChtdWx0aWNhc3Rfam9pbmVkXykgewotICAgICAgICAgICAgaW50IHJlczsKLSAgICAgICAgICAgIHN0cnVjdCBpcF9tcmVxIG1yZXE7Ci0gICAgICAgICAgICBtcmVxLmltcl9tdWx0aWFkZHIgPSBsaXN0ZW5fYWRkcl8uc2luX2FkZHI7Ci0gICAgICAgICAgICBtcmVxLmltcl9pbnRlcmZhY2Uuc19hZGRyID0gaHRvbmwoSU5BRERSX0FOWSk7Ci0gICAgICAgICAgICByZXMgPSBzZXRzb2Nrb3B0KHNvY2tfZmRfLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICBJUFBST1RPX0lQLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICBJUF9EUk9QX01FTUJFUlNISVAsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICZtcmVxLCBzaXplb2YobXJlcSkpOwotICAgICAgICAgICAgaWYgKHJlcyA8IDApIHsKLSAgICAgICAgICAgICAgICBBTE9HVygiRmFpbGVkIHRvIGxlYXZlIG11bHRpY2FzdCBncm91cC4gKCVkLCAlZCkiLCByZXMsIGVycm5vKTsKLSAgICAgICAgICAgIH0KLSAgICAgICAgICAgIG11bHRpY2FzdF9qb2luZWRfID0gZmFsc2U7Ci0gICAgICAgIH0KLQotICAgICAgICBjbG9zZShzb2NrX2ZkXyk7Ci0gICAgICAgIHNvY2tfZmRfID0gLTE7Ci0gICAgfQotCi0gICAgcmVzZXRQaXBlbGluZSgpOwotfQotCi12b2lkIEFBSF9SWFBsYXllcjo6cmVzZXRQaXBlbGluZSgpIHsKLSAgICByaW5nX2J1ZmZlcl8ucmVzZXQoKTsKLQotICAgIC8vIEV4cGxpY2l0bHkgc2h1ZG93biBhbGwgb2YgdGhlIGFjdGl2ZSBzdWJzdHJlYW1zLCB0aGVuIGNhbGwgY2xlYXIgb3V0IHRoZQotICAgIC8vIGNvbGxlY3Rpb24uICBGYWlsdXJlIHRvIGNsZWFyIG91dCBhI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ChyZXMgPCAwKSB7Ci0gICAgICAgIEFMT0dFKCJGYWlsZWQgdG8gc2V0IHNvY2tldCAoJWQpIHRvIG5vbi1ibG9ja2luZyBtb2RlIChlcnJubyAlZCkiLAotICAgICAgICAgICAgICBzb2NrX2ZkXywgZXJybm8pOwotICAgICAgICBnb3RvIGJhaWxvdXQ7Ci0gICAgfQotCi0gICAgLy8gQmluZCB0byBvdXIgcG9ydAotICAgIHN0cnVjdCBzb2NrYWRkcl9pbiBiaW5kX2FkZHI7Ci0gICAgbWVtc2V0KCZiaW5kX2FkZHIsIDAsIHNpemVvZihiaW5kX2FkZHIpKTsKLSAgICBiaW5kX2FkZHIuc2luX2ZhbWlseSA9IEFGX0lORVQ7Ci0gICAgYmluZF9hZGRyLnNpbl9hZGRyLnNfYWRkciA9IElOQUREUl9BTlk7Ci0gICAgYmluZF9hZGRyLnNpbl9wb3J0ID0gbGlzdGVuX2FkZHJfLnNpbl9wb3J0OwotICAgIHJlcyA9IGJpbmQoc29ja19mZF8sCi0gICAgICAgICAgICAgICByZWludGVycHJldF9jYXN0PGNvbnN0IHNvY2thZGRyKj4oJmJpbmRfYWRkciksCi0gICAgICAgICAgICAgICBzaXplb2YoYmluZF9hZGRyKSk7Ci0gICAgaWYgKHJlcyA8IDApIHsKLSAgICAgICAgdWludDMyX3QgYSA9IG50b2hsKGJpbmRfYWRkci5zaW5fYWRkci5zX2FkZHIpOwotICAgICAgICB1aW50MTZfdCBwID0gbnRvaHMoYmluZF9hZGRyLnNpbl9wb3J0KTsKLSAgICAgICAgQUxPR0UoIkZhaWxlZCB0byBiaW5kIHNvY2tldCAoJWQpIHRvICVkLiVkLiVkLiVkOiVoZC4gKGVycm5vICVkKSIsCi0gICAgICAgICAgICAgIHNvY2tfZmRfLAotICAgICAgICAgICAgICAoYSA+PiAyNCkgJiAweEZGLAotICAgICAgICAgICAgICAoYSA+PiAxNikgJiAweEZGLAotICAgICAgICAgICAgICAoYSA+PiAgOCkgJiAweEZGLAotICAgICAgICAgICAgICAoYSAgICAgICkgJiAweEZGLAotICAgICAgICAgICAgICBwLAotICAgICAgICAgICAgICBlcnJubyk7Ci0KLSAgICAgICAgZ290byBiYWlsb3V0OwotICAgIH0KLQotICAgIGJ1Zl9zaXplID0gMSA8PCAxNjsgICAvLyA2NGsKLSAgICByZXMgPSBzZXRzb2Nrb3B0KHNvY2tfZmRfLAotICAgICAgICAgICAgICAgICAgICAgU09MX1NPQ0tFVCwgU09fUkNWQlVGLAotICAgICAgICAgICAgICAgICAgICAgJmJ1Zl9zaXplLCBzaXplb2YoYnVmX3NpemUpKTsKLSAgICBpZiAocmVzIDwgMCkgewotICAgICAgICBBTE9HVygiRmFpbGVkIHRvIGluY3JlYXNlIHNvY2tldCBidWZmZXIgc2l6ZSB0byAlZC4gIChlcnJubyAlZCkiLAotICAgICAgICAgICAgICBidWZfc2l6ZSwgZXJybm8pOwotICAgIH0KLQotICAgIGJ1Zl9zaXplID0gMDsKLSAgICBvcHRfc2l6ZSA9IHNpemVvZihidWZfc2l6ZSk7Ci0gICAgcmVzID0gZ2V0c29ja29wdChzb2NrX2ZkXywKLSAgICAgICAgICAgICAgICAgICAgIFNPTF9TT0NLRVQsIFNPX1JDVkJVRiwKLSAgICAgICAgICAgICAgICAgICAgICZidWZfc2l6ZSwgJm9wdF9zaXplKTsKLSAgICBpZiAocmVzIDwgMCkgewotICAgICAgICBBTE9HVygiRmFpbGVkIHRvIGZldGNoIHNvY2tldCBidWZmZXIgc2l6ZS4gIChlcnJubyAlZCkiLCBlcnJubyk7Ci0gICAgfSBlbHNlIHsKLSAgICAgICAgQUxPR0koIlJYIHNvY2tldCBidWZmZXIgc2l6ZSBpcyBub3cgJWQgYnl0ZXMiLCAgYnVmX3NpemUpOwotICAgIH0KLQotICAgIGlmIChsaXN0ZW5fYWRkcl8uc2luX2FkZHIuc19hZGRyKSB7Ci0gICAgICAgIC8vIEpvaW4gdGhlIG11bHRpY2FzdCBncm91cCBhbmQgd2Ugc2hvdWxkIGJ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dGVwIDE6IFdhaXQgdW50aWwgdGhlcmUgaXMgc29tZXRoaW5nIHRvIGRvLgotICAgICAgICBpbnQgZ2FwX3RpbWVvdXQgPSBjb21wdXRlTmV4dEdhcFJldHJhbnNtaXRUaW1lb3V0KCk7Ci0gICAgICAgIGludCByaW5nX3RpbWVvdXQgPSByaW5nX2J1ZmZlcl8uY29tcHV0ZUluYWN0aXZpdHlUaW1lb3V0KCk7Ci0gICAgICAgIGludCB0aW1lb3V0ID0gLTE7Ci0KLSAgICAgICAgaWYgKCFyaW5nX3RpbWVvdXQpIHsKLSAgICAgICAgICAgIEFMT0dXKCJSVFAgaW5hY3Rpdml0eSB0aW1lb3V0IHJlYWNoZWQsIHJlc2V0dGluZyBwaXBlbGluZS4iKTsKLSAgICAgICAgICAgIHJlc2V0UGlwZWxpbmUoKTsKLSAgICAgICAgICAgIHRpbWVvdXQgPSBnYXBfdGltZW91dDsKLSAgICAgICAgfSBlbHNlIHsKLSAgICAgICAgICAgIGlmIChnYXBfdGltZW91dCA8IDApIHsKLSAgICAgICAgICAgICAgICB0aW1lb3V0ID0gcmluZ190aW1lb3V0OwotICAgICAgICAgICAgfSBlbHNlIGlmIChyaW5nX3RpbWVvdXQgPCAwKSB7Ci0gICAgICAgICAgICAgICAgdGltZW91dCA9IGdhcF90aW1lb3V0OwotICAgICAgICAgICAgfSBlbHNlIHsKLSAgICAgICAgICAgICAgICB0aW1lb3V0ID0gKGdhcF90aW1lb3V0IDwgcmluZ190aW1lb3V0KSA/IGdhcF90aW1lb3V0Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOiByaW5nX3RpbWVvdXQ7Ci0gICAgICAgICAgICB9Ci0gICAgICAgIH0KLQotICAgICAgICBpZiAoKDAgIT0gdGltZW91dCkgJiYgKCFwcm9jZXNzX21vcmVfcmlnaHRfbm93KSkgewotICAgICAgICAgICAgLy8gU2V0IHVwIHRoZSBldmVudHMgdG8gd2FpdCBvb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AgICAgIHByb2Nlc3NfbW9yZV9yaWdodF9ub3cgPSBmYWxzZTsKLQotICAgICAgICAvLyBTdGVwIDI6IERvIHdlIGhhdmUgZGF0YSB3YWl0aW5nIGluIHRoZSBzb2NrZXQ/ICBJZiBzbywgZHJhaW4gdGhlCi0gICAgICAgIC8vIHNvY2tldCBtb3ZpbmcgdmFsaWQgUlRQIGluZm9ybWF0aW9uIGludG8gdGhlIHJpbmcgYnVmZmVyIHRvIGJlCi0gICAgICAgIC8vIHByb2Nlc3NlZC4KLSAgICAgICAgaWYgKHBvbGxfZmRzWzFdLnJldmVudHMpIHsKLSAgICAgICAgICAgIHN0cnVjdCBzb2NrYWRkcl9pbiBmcm9tOwotICAgICAgICAgICAgc29ja2xlbl90IGZyb21fbGVuOwotCi0gICAgICAgICAgICBzc2l6ZV90IHJlcyA9IDA7Ci0gICAgICAgICAgICB3aGlsZSAoIXRocmVhZF93cmFwcGVyXy0+ZXhpdFBlbmRpbmcoKSkgewotICAgICAgICAgICAgICAgIC8vIENoZWNrIHRoZSBzaXplIG9mIGFueSBwZW5kaW5nIHBhY2tldC4KLSAgICAgICAgICAgICAgICByZXMgPSByZWN2KHNvY2tfZmRfLCBOVUxMLCAwLCBNU0dfUEVFSyB8IE1TR19UUlVOQyk7Ci0KLSAgICAgICAgICAgICAgICAvLyBFcnJvcj8KLSAgICAgICAgICAgICAgICBpZiAocmVzIDwgMCkgewotICAgICAgICAgICAgICAgICAgICAvLyBJZiB0aGUgZXJyb3IgaXMgYW55dGhpbmcgb3RoZXIgdGhhbiB3b3VsZCBibG9jaywKLSAgICAgICAgICAgICAgICAgICAgLy8gc29tZXRoaW5nIGhhcyBnb25lIHZlcnkgd3JvbmcuCi0gICAgICAgICAgICAgICAgICAgIGlmICgoZXJybm8gIT0gRUFHQUlOKSAmJiAoZXJybm8gIT0gRVdPVUxEQkxPQ0spKSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICBBTE9HRSgiRmF0YWwgc29ja2V0IGVycm9yIGR1cmluZyByZWN2ZnJvbSAoJWQsICVkKSIsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoaW50KXJlcywgZXJybm8pOwotICAgICAgICAgICAgICAgICAgICAgICAgZ290byBiYWlsb3V0OwotICAgICAgICAgICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgICAgICAgICAgLy8gU29ja2V0IGlzIG91dCBvZiBkYXRhLCBqdXN0IGJyZWFrIG91dCBvZiBwcm9jZXNzaW5nIGFuZAotICAgICAgICAgICAgICAgICAgICAvLyB3YWl0IGZvciBtb3JlLgotICAgICAgICAgICAgICAgICAgICBicmVhazsKLSAgICAgICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgICAgICAvLyBBbGxvY2F0ZSBhIHBheWxvYWQuCi0gICAgICAgICAgICAgICAgUGFja2V0QnVmZmVyKiBwYiA9IFBhY2tldEJ1ZmZlcjo6YWxsb2NhdGUocmVzKTsKLSAgICAgICAgICAgICAgICBpZiAoTlVMTCA9PSBwYikgewotICAgICAgICAgICAgICAgICAgICBBTE9HRSgiRmF0YWwgZXJyb3IsIGZhaWxlZCB0byBhbGxvY2F0ZSBwYWNrZXQgYnVmZmVyIG9mIgotICAgICAgICAgICAgICAgICAgICAgICAgICAiIGxlbmd0aCAldSIsIHN0YXRpY19jYXN0PHVpbnQzMl90PihyZXMpKTsKLSAgICAgICAgICAgICAgICAgICAgZ290byBiYWlsb3V0OwotICAgICAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgICAgIC8vIEZldGNoIHRoZSBkYXRhLgotICAgICAgICAgICAgICAgIGZyb21fbGVuID0gc2l6ZW9mKGZyb20pOwotICAgICAgICAgICAgICAgIHJlcyA9IHJlY3Zmcm9tKHNvY2tfZmRfLCBwYi0+ZGF0YV8sIHBiLT5sZW5ndGhfLCAwLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJlaW50ZXJwcmV0X2Nhc3Q8c3RydWN0IHNvY2thZGRyKj4oJmZyb20pLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICZmcm9tX2xlbik7Ci0gICAgICAgICAgICAgICAgaWYgKHJlcyAhPSBwYi0+bGVuZ3RoXykgewotICAgICAgICAgICAgICAgICAgICBBTE9HRSgiRmF0YWwgZXJyb3IsIGZldGNoZWQgcGFja2V0IGxlbmd0aCAoJWQpIGRvZXMgbm90IgotICAgICAgICAgICAgICAgICAgICAgICAgICAiIG1hdGNoIHBlZWtlZCBwYWNrZXQgbGVuZ3RoICgldSkuICBUaGlzIHNob3VsZCBuZXZlciIKLSAgICAgICAgICAgICAgICAgICAgICAgICAgIiBoYXBwZW4uICAoZXJybm8gPSAlZCkiLAotICAgICAgICAgICAgICAgICAgICAgICAgICBzdGF0aWNfY2FzdDxpbnQ+KHJlcyksCi0gICAgICAgICAgICAgICAgICAgICAgICAgIHN0YXRpY19jYXN0PHVpbnQzMl90PihwYi0+bGVuZ3RoXyksCi0gICAgICAgICAgICAgICAgICAgICAgICAgIGVycm5vKTsKLSAgICAgICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgICAgICBib29sIGRyb3BfcGFja2V0ID0gZmFsc2U7Ci0gICAgICAgICAgICAgICAgaWYgKHRyYW5zbWl0dGVyX2tub3duXykgewotICAgICAgICAgICAgICAgICAgICBpZiAoZnJvbS5zaW5fYWRkci5zX2FkZHIgIT0KLSAgICAgICAgICAgICAgICAgICAgICAgIHRyYW5zbWl0dGVyX2FkZHJfLnNpbl9hZGRyLnNfYWRkcikgewotICAgICAgICAgICAgICAgICAgICAgICAgdWludDMyX3QgYSA9IG50b2hsKGZyb20uc2luX2FkZHIuc19hZGRyKTsKLSAgICAgICAgICAgICAgICAgICAgICAgIHVpbnQxNl90IHAgPSBudG9ocyhmcm9tLnNpbl9wb3J0KTsKLSAgICAgICAgICAgICAgICAgICAgICAgIEFMT0dWKCJEcm9wcGluZyBwYWNrZXQgZnJvbSB1bmtub3duIHRyYW5zbWl0dGVyIgotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIiAldS4ldS4ldS4ldTolaHUiLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKChhID4+IDI0KSAmIDB4RkYpLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKChhID4+IDE2KSAmIDB4RkYpLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKChhID4+ICA4KSAmIDB4RkYpLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKCBhICAgICAgICAmIDB4RkYpLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcCk7Ci0KLSAgICAgICAgICAgICAgICAgICAgICAgIGRyb3BfcGFja2V0ID0gdHJ1ZTsKLSAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHsKLSAgICAgICAgICAgICAgICAgICAgICAgIHRyYW5zbWl0dGVyX2FkZHJfLnNpbl9wb3J0ID0gZnJvbS5zaW5fcG9ydDsKLSAgICAgICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgIH0gZWxzZSB7Ci0gICAgICAgICAgICAgICAgICAgIG1lbWNweSgmdHJhbnNtaXR0ZXJfYWRkcl8sICZmcm9tLCBzaXplb2YoZnJvbSkpOwotICAgICAgICAgICAgICAgICAgICB0cmFuc21pdHRlcl9rbm93bl8gPSB0cnVlOwotICAgICAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgICAgIGlmICghZHJvcF9wYWNrZXQpIHsKLSAgICAgICAgICAgICAgICAgICAgYm9vbCBzZXJpb3VzX2Vycm9yID0gIXByb2Nlc3NSWChwYik7Ci0KLSAgICAgICAgICAgICAgICAgICAgaWYgKHNlcmlvdXNfZXJyb3IpIHsKLSAgICAgICAgICAgICAgICAgICAgICAgIC8vIFNvbWV0aGluZyB3ZW50ICJzZXJpb3VzbHkgd3JvbmciLiAgQ3VycmVudGx5LCB0aGUKLSAgICAgICAgICAgICAgICAgICAgICAgIC8vIG9ubHkgdHJpZ2dlciBmb3IgdGhpcyBzaG91bGQgYmUgYSByaW5nIGJ1ZmZlcgotICAgICAgICAgICAgICAgICAgICAgICAgLy8gb3ZlcmZsb3cuICBUaGUgY3VycmVudCBmYWlsc2FmZSBiZWhhdmlvciBmb3Igd2hlbgotICAgICAgICAgICAgICAgICAgICAgICAgLy8gc29tZXRoaW5nIGdvZXMgc2VyaW91c2x5IHdyb25nIGlzIHRvIGp1c3QgcmVzZXQgdGhlCi0gICAgICAgICAgICAgICAgICAgICAgICAvLyBwaXBlbGluZS4gIFRoZSBzeXN0ZW0gc2hvdWxkIGJlaGF2ZSBhcyBpZiB0aGlzCi0gICAgICAgICAgICAgICAgICAgICAgICAvLyBBQUhfUlhQbGF5ZXIgd2FzIGp1c3Qgc2V0IHVwIGZvciB0aGUgZmlyc3QgdGltZS4KLSAgICAgICAgICAgICAgICAgICAgICAgIEFMT0dFKCJTb21ldGhpbmcganVzdCB3ZW50IHNlcmlvdXNseSB3cm9uZyB3aXRoIHRoZSIKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICIgcGlwZWxpbmUuICBSZXNldHRpbmcuIik7Ci0gICAgICAgICAgICAgICAgICAgICAgICByZXNldFBpcGVsaW5lKCk7Ci0gICAgICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICB9IGVsc2UgewotICAgICAgICAgICAgICAgICAgICBQYWNrZXRCdWZmZXI6OmRlc3Ryb3kocGIpOwotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgIH0KLSAgICAgICAgfQotCi0gICAgICAgIC8vIFN0ZXAgMzogUHJvY2VzcyBhbnkgZGF0YSB3ZSBtYXZlIGhhdmUgYWNjdW11bGF0ZWQgaW4gdGhlIHJpbmcgYnVmZmVyCi0gICAgICAgIC8vIHNvIGZhci4KLSAgICAgICAgaWYgKCF0aHJlYWRfd3JhcHBlcl8tPmV4aXRQZW5kaW5nKCkpIHsKLSAgICAgICAgICAgIHByb2Nlc3NSaW5nQnVmZmVyKCk7Ci0gICAgICAgIH0KLQotICAgICAgICAvLyBTdGVwIDQ6IEF0IHRoaXMgcG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gICAgICAgICAgICBpZiAoMSAhPSB0cnRwX3ZlcnNpb24pIHsKLSAgICAgICAgICAgICAgICBBTE9HVigiRHJvcHBpbmcgcGFja2V0LCBiYWQgdHJ0cCB2ZXJzaW9uICVoaHUiLCB0cnRwX3ZlcnNpb24pOwotICAgICAgICAgICAgICAgIGdvdG8gcHJvY2Vzc19uZXh0X3BhY2tldDsKLSAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgLy8gSXMgdGhlcmUgYSB0aW1lc3RhbXAgdHJhbnNmb3JtYXRpb24gcHJlc2VudCBvbiB0aGlzIHBhY2tldD8gIElmCi0gICAgICAgICAgICAvLyBzbywgZXh0cmFjdCBpdCBhbmQgcGFzcyBpdCB0byB0aGUgYXBwcm9wcmlhdGUgc3Vic3RyZWFtcy4KLSAgICAgICAgICAgIGlmICh0cnRwX2ZsYWdzICYgMHgwMikgewotICAgICAgICAgICAgICAgIHNzaXplX3Qgb2Zmc2V0ID0gMTggKyAoKHRydHBfZmxhZ3MgJiAweDAxKSA/IDQgOiAwKTsKLSAgICAgICAgICAgICAgICBpZiAoYW10IDwgKG9mZnNldCArIDI0KSkgewotICAgICAgICAgICAgICAgICAgICBBTE9HVigiRHJvcHBpbmcgcGFja2V0LCB0b28gc2hvcnQgdG8gY29udGFpbiBUUlRQIFRpbWVzdGFtcCIKLSAgICAgICAgICAgICAgICAgICAgICAgICAgIiBUcmFuc2Zvcm1hdGlvbiAoJXUgYnl0ZXMpIiwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgc3RhdGljX2Nhc3Q8dWludDMyX3Q+KGFtdCkpOwotICAgICAgICAgICAgICAgICAgICBnb3RvIHByb2Nlc3NfbmV4dF9wYWNrZXQ7Ci0gICAgICAgICAgICAgICAgfQotCi0gICAgICAgICAgICAgICAgdHJhbnMuYV96ZXJvID0gZmV0Y2hJbnQ2NChkYXRhICsgb2Zmc2V0KTsKLSAgICAgICAgICAgICAgICB0cmFucy5iX3plcm8gPSBmZXRjaEludDY0KGRhdGEgKyBvZmZzZXQgKyAxNik7Ci0gICAgICAgICAgICAgICAgdHJhbnMuYV90b19iX251bWVyID0gc3RhdGljX2Nhc3Q8aW50MzJfdD4oCi0gICAgICAgICAgICAgICAgICAgICAgICBmZXRjaEludDMyIChkYXRhICsgb2Zmc2V0ICsgOCkpOwotICAgICAgICAgICAgICAgIHRyYW5zLmFfdG9fYl9kZW5vbSA9IFUzMl9BVChkYXRhICsgb2Zmc2V0ICsgMTIpOwotICAgICAgICAgICAgICAgIGZvdW5kVHJhbnMgPSB0cnVlOwotCi0gICAgICAgICAgICAgICAgdWludDMyX3QgcHJvZ3JhbV9pZCA9IChzc3JjID4+IDUpICYgMHgxRjsKLSAgICAgICAgICAgICAgICBmb3IgKHNpemVfdCBpID0gMDsgaSA8IHN1YnN0cmVhbXNfLnNpemUoKTsgKytpKSB7Ci0gICAgICAgICAgICAgICAgICAgIHNwPFN1YnN0cmVhbT4gaXRlciA9IHN1YnN0cmVhbXNfLnZhbHVlQXQoaSk7Ci0gICAgICAgICAgICAgICAgICAgIENIRUNLKGl0ZXIgIT0gTlVMTCk7Ci0KLSAgICAgICAgICAgICAgICAgICAgaWYgKGl0ZXItPmdldFByb2dyYW1JRCgpID09IHByb2dyYW1faWQpIHsKLSAgICAgICAgICAgICAgICAgICAgICAgIGl0ZXItPnByb2Nlc3NUU1RyYW5zZm9ybSh0cmFucyk7Ci0gICAgICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgIC8vIElzIHRoaXMgYSBjb21tYW5kIHBhY2tldD8gIElmIHNvLCBpdHMgbm90IG5lY2Vzc2FyaWx5IGFzc29jaWF0ZQotICAgICAgICAgICAgLy8gd2l0aCBvbmUgcGFydGljdWxhciBzdWJzdHJlYW0uICBKdXN0IGdpdmUgaXQgdG8gdGhlIGNvbW1hbmQKLSAgICAgICAgICAgIC8vIHBhY2tldCBoYW5kbGVyIGFuZCB0aGVuIG1v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CAoY29tbWFuZF9pZCkgewotICAgICAgICBjYXNlIFRSVFBDb250cm9sUGFja2V0OjprQ29tbWFuZE5vcDoKLSAgICAgICAgICAgIGJyZWFrOwotCi0gICAgICAgIGNhc2UgVFJUUENvbnRyb2xQYWNrZXQ6OmtDb21tYW5kRU9TOgotICAgICAgICBjYXNlIFRSVFBDb250cm9sUGFja2V0OjprQ29tbWFuZEZsdXNoOiB7Ci0gICAgICAgICAgICB1aW50MTZfdCBwcm9ncmFtX2lkID0gKFUzMl9BVChkYXRhICsgOCkgPj4gNSkgJiAweDFGOwotICAgICAgICAgICAgQUxPR0koIioqKiAlcyBmbHVzaGluZyBwcm9ncmFtX2lkPSVkIiwKLSAgICAgICAgICAgICAgICAgIF9fUFJFVFRZX0ZVTkNUSU9OX18sIHByb2dyYW1faWQpOwotCi0gICAgICAgICAgICBWZWN0b3I8dWludDMyX3Q+IHN1YnN0cmVhbXNfdG9fcmVtb3ZlOwotICAgICAgICAgICAgZm9yIChzaXplX3QgaSA9IDA7IGkgPCBzdWJzdHJlYW1zXy5zaXplKCk7ICsraSkgewotICAgICAgICAgICAgICAgIHNwPFN1YnN0cmVhbT4gaXRlciA9IHN1YnN0cmVhbXNfLnZhbHVlQXQoaSk7Ci0gICAgICAgICAgICAgICAgaWYgKGl0ZXItPmdldFByb2dyYW1JRCgpID09IHByb2dyYW1faWQpIHsKLSAgICAgICAgICAgICAgICAgICAgaXRlci0+c2h1dGRvd24oKTsKLSAgICAgICAgICAgICAgICAgICAgc3Vic3RyZWFtc190b19yZW1vdmUuYWRkKGl0ZXItPmdldFNTUkMoKSk7Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgfQotCi0gICAgICAgICAgICBmb3IgKHNpemVfdCBpID0gMDsgaSA8IHN1YnN0cmVhbXNfdG9fcmVtb3ZlLnNpemUoKTsgKytpKSB7Ci0gICAgICAgICAgICAgICAgc3Vic3RyZWFtc18ucmVtb3ZlSXRlbShzdWJzdHJlYW1zX3RvX3Jlb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CA9IG50b2hzKHRyYW5zbWl0dGVyX2FkZHJfLnNpbl9wb3J0KTsKLSAgICAgICAgICAgIEFMT0dWKCJTZW5kaW5nIHRvIHRyYW5zbWl0dGVyICV1LiV1LiV1LiV1OiVodSIsCi0gICAgICAgICAgICAgICAgICAgICgoYSA+PiAyNCkgJiAweEZGKSwKLSAgICAgICAgICAgICAgICAgICAgKChhID4+IDE2KSAmIDB4RkYpLAotICAgICAgICAgICAgICAgICAgICAoKGEgPj4gIDgpICYgMHhGRiksCi0gICAgICAgICAgICAgICAgICAgICggYSAgICAgICAgJiAweEZGKSwKLSAgICAgICAgICAgICAgICAgICAgcCk7Ci0gICAgICAgIH0KLQotICAgICAgICBpbnQgcmVzID0gc2VuZHRvKHNvY2tfZmRfLCAmcmVxLCBzaXplb2YocmVxKSwgMCwKLSAgICAgICAgICAgICAgICAgICAgICAgICByZWludGVycHJldF9jYXN0PHN0cnVjdCBzb2NrYWRkcio+KCZ0cmFuc21pdHRlcl9hZGRyXyksCi0gICAgICAgICAgICAgICAgICAgICAgICAgc2l6ZW9mKHRyYW5zbWl0dGVyX2FkZHJfKSk7Ci0gICAgICAgIGlmIChyZXMgPCAwKSB7Ci0gICAgICAgICAgICBBTE9HRSgiRXJyb3Igd2hlbiBzZW5kaW5nIHJldHJhbnNtaXQgcmVxdWVzdCAoJWQpIiwgZXJybm8pOwotICAgICAgICB9IGVsc2UgewotICAgICAgICAgICAgQUxPR1YoIiVzIHJlcXVlc3QgZm9yIHJhbmdlIFslaHUsICVodV0gc2VudCIsCi0gICAgICAgICAgICAgICAgICAoa0dTX0Zhc3RTdGFydEdhcCA9PSBnYXBfc3RhdHVzKSA/ICJGYXN0IFN0YXJ0IgotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOiAiUmV0cmFuc21pdCIsCi0gICAgICAgICAgICAgICAgICBnYXAuc3RhcnRfc2VxXywgZ2FwLmVuZF9zZXFfKTsKLSAgICAgICAgfQotCi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ZmVyKCk7Ci0gICAgfQotfQotCi12b2lkIEFBSF9SWFBsYXllcjo6U3Vic3RyZWFtOjpwcm9jZXNzUGF5bG9hZENvbnQodWludDhfdCogYnVmLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHVpbnQzMl90IGFtdCkgewotICAgIGlmIChzaG91bGRBYm9ydChfX1BSRVRUWV9GVU5DVElPTl9fKSkgewotICAgICAgICByZXR1cm47Ci0gICAgfQotCi0gICAgaWYgKE5VTEwgPT0gYnVmZmVyX2luX3Byb2dyZXNzXykgewotICAgICAgICBBTE9HVigiVFJUUCBSZWNlaXZlciBza2lwcGluZyBwYXlsb2FkIGNvbnRpbnVhdGlvbjsgbm8gYnVmZmVyIGN1cnJlbnRseSIKLSAgICAgICAgICAgICAgIiBpbiBwcm9ncmVzcy4iKTsKLSAgICAgICAgcmV0dXJuOwotICAgIH0KLQotICAgIENIRUNLKGF1eF9kYXRhX2luX3Byb2dyZXNzXy5zaXplKCkgPD0gYXV4X2RhdGFfZXhwZWN0ZWRfc2l6ZV8pOwotICAgIHVpbnQzMl90IGF1eF9sZWZ0ID0gYXV4X2RhdGFfZXhwZWN0ZWRfc2l6ZV8gLSBhdXhfZGF0YV9pbl9wcm9ncmVzc18uc2l6ZSgpOwotICAgIGlmIChhdXhfbGVmdCkgewotICAgICAgICB1aW50MzJfdCB0b2RvID0gbWluKGF1eF9sZWZ0LCBhbXQpOwotICAgICAgICBhdXhfZGF0YV9pbl9wcm9ncmVzc18uYXBwZW5kQXJyYXkoYnVmLCB0b2RvKTsKLSAgICAgICAgYW10IC09IHRvZG87Ci0gICAgICAgIGJ1ZiArPSB0b2RvOwotCi0gICAgICAgIGlmICghYW10KQotICAgICAgICAgICAgcmV0dXJuOwotICAgIH0KLQotICAgIENIRUNLKGJ1ZmZlcl9maWxsZWRfIDwgZXhwZWN0ZWRfYnVmZmVyX3NpemVfKTsKLSAgICB1aW50MzJfdCBidWZmZXJfbGVmdCA9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gaXMKLSAgICAvLyBQQ00gYW5kIHdlIGFyZSBzZW5kaW5nIHNhbXBsZSByYXRlL2NoYW5uZWwgY291bnQuIGFzIHdlbGwgYXMgaG93ZXZlciBsb25nCi0gICAgLy8gdGhlIGF1eCBkYXRhIChpZiBwcmVzZW50KSBpcy4KLQotICAgIGludCBwY21QYXJhbUxlbmd0aDsKLSAgICBzd2l0Y2gobUNvZGVjVHlwZSkgewotICAgICAgICBjYXNlIGtDb2RlY1BDTUJpZ0VuZGlhbjoKLSAgICAgICAgY2FzZSBrQ29kZWNQQ01MaXR0bGVFbmRpYW46Ci0gICAgICAgICAgICBwY21QYXJhbUxlbmd0aCA9IDU7Ci0gICAgICAgICAgICBicmVhazsKLQotICAgICAgICBkZWZhdWx0OgotICAgICAgICAgICAgcGNtUGFyYW1MZW5ndGggPSAwOwotICAgICAgICAgICAgYnJlYWs7Ci0gICAgfQotCi0KLSAgICBpbnQgYXV4RGF0YUxlbkZpZWxkID0gKE5VTEwgIT0gbUF1eERhdGEpID8gc2l6ZW9mKHVpbnQzMl90KSA6IDA7Ci0gICAgcmV0dXJuIFRSVFBQYWNrZXQ6OlRSVFBIZWFkZXJMZW4oKSArCi0gICAgICAgICAgIDMgKwotICAgICAgICAgICBhdXhEYXRhTGVuRmllbGQgKwotICAgICAgICAgICBwY21QYXJhbUxlbmd0aDsKLX0KLQotYm9vbCBUUlRQQ29udHJvbFBhY2tldDo6cGFjaygpIHsKLSAgICBpZiAobUlzUGFja2VkKSB7Ci0gICAgICAgIHJldHVybiBmYWxzZTsKLSAgICB9Ci0KLSAgICAvLyBjb21tYW5kIHBhY2tldHMgY29udGFpbiBhIDItYnl0ZSBjb21tYW5kIElECi0gICAgaW50IHBhY2tldExlbiA9IGtSVFBIZWFkZXJMZW4gKwotICAgICAgICAgICAgICAgICAgICBUUlRQSGVhZGVyTGVuKCkgKwotICAgICAgICAgICAgICAgICAgICAyOwotCi0gICAgbVBhY2tldCA9IG5ldyB1aW50OF90W3BhY2tld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vaWQgQUFIX1RYUGxheWVyOjpvbkJ1ZmZlcmluZ1VwZGF0ZSgpIHsKLSAgICBNdXRleDo6QXV0b2xvY2sgYXV0b0xvY2sobUxvY2spOwotICAgIGlmICghbUJ1ZmZlcmluZ0V2ZW50UGVuZGluZykgewotICAgICAgICByZXR1cm47Ci0gICAgfQotICAgIG1CdWZmZXJpbmdFdmVudFBlbmRpbmcgPSBmYWxzZTsKLQotICAgIGlmIChtQ2FjaGVkU291cmNlICE9IE5VTEwpIHsKLSAgICAgICAgc3RhdHVzX3QgZmluYWxTdGF0dXM7Ci0gICAgICAgIHNpemVfdCBjYWNoZWREYXRhUmVtYWluaW5nID0gbUNhY2hlZFNvdXJjZS0+YXBwcm94RGF0YVJlbWFpbmluZygKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmZmluYWxTdGF0dXMpOwotICAgICAgICBib29sIGVvcyA9IChmaW5hbFN0YXR1cyAhPSBPSyk7Ci0KLSAgICAgICAgaWYgKGVvcykgewotICAgICAgICAgICAgaWYgKGZpbmFsU3RhdHVzID09IEVSUk9SX0VORF9PRl9TVFJFQU0pIHsKLSAgICAgICAgICAgICAgICBub3RpZnlMaXN0ZW5lcl9sKE1FRElBX0JVRkZFUklOR19VUERBVEUsIDEwMCk7Ci0gICAgICAgICAgICB9Ci0gICAgICAgICAgICBpZiAobUZsYWdzICYgUFJFUEFSSU5HKSB7Ci0gICAgICAgICAgICAgICAgQUxPR1YoImNhY2hlIGhhcyByZWFjaGVkIEVPUywgcHJlcGFyZSBpcyBkb25lLiIpOwotICAgICAgICAgICAgICAgIGZpbmlzaEFzeW5jUHJlcGFyZV9sKCk7Ci0gICAgICAgICAgICB9Ci0gICAgICAgIH0gZWxzZSB7Ci0gICAgICAgICAgICBpbnQ2NF90IGJpdHJhdGU7Ci0gICAgICAgICAgICBpZiAoZ2V0Qml0cmF0ZV9sKCZiaXRyYXRlKSkgewotICAgICAgICAgICAgICAgIHNpemVfdCBjYWNoZWRTaXplID0gbUNhY2hlZFNvdXJjZS0+Y2FjaGVkU2l6ZSgpOwotICAgICAgICAgICAgICAgIGludDY0X3QgY2FjaGVkRHVyYXRpb25VcyA9IGNhY2hlZFNpemUgKiA4MDAwMDAwbGwgLyBiaXRyYXRlOwotCi0gICAgICAgICAgICAgICAgaW50IHBlcmNlbnRhZ2UgPSAoMTAwLjAgKiAoZG91YmxlKSBjYWNoZWREdXJhdGlvblVzKQotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8gbUR1cmF0aW9uVXM7Ci0gICAgICAgICAgICAgICAgaWYgKHBlcmNlbnRhZ2UgPiAxMDApIHsKLSAgICAgICAgICAgICAgICAgICAgcGVyY2VudGFnZSA9IDEwMDsKLSAgICAgICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgICAgICBub3RpZnlMaXN0ZW5lcl9sKE1FRElBX0JVRkZFUklOR19VUERBVEUsIHBlcmNlbnRhZ2UpOwotICAgICAgICAgICAgfSBlbHNlIHsKLSAgICAgICAgICAgICAgICAvLyBXZSBkb24ndCBrbm93IHRoZSBiaXRyYXRlIG9mIHRoZSBzdHJlYW0sIHVzZSBhYnNvbHV0ZSBzaXplCi0gICAgICAgICAgICAgICAgLy8gbGltaXRzIHRvIG1haW50YWluIHRoZSBjYWNoZS4KLQotICAgICAgICAgICAgICAgIGlmICgobUZsYWdzICYgUExBWUlORykgJiYKLSAgICAgICAgICAgICAgICAgICAgIWVvcyAmJgotICAgICAgICAgICAgICAgICAgICAoY2FjaGVkRGF0YVJlbWFpbmluZyA8IGtMb3dXYXRlck1hcmtCeXRlcykpIHsKLSAgICAgICAgICAgICAgICAgICAgQUxPR0koImNhY2hlIGlzIHJ1bm5pbmcgbG93ICg8ICVkKSAsIHBhdXNpbmcuIiwKLSAgICAgICAgICAgICAgICAgICAgICAgICAga0xvd1dhdGVyTWFya0J5dGVzKTsKLSAgICAgICAgICAgICAgICAgICAgbUZsYWdzIHw9IENBQ0hFX1VOREVSUlVOOwotICAgICAgICAgICAgICAgICAgICBwYXVzZV9sKCk7Ci0gICAgICAgICAgICAgICAgICAgIGVuc3VyZUNhY2hlSXNGZXRjaGluZ19sKCk7Ci0gICAgICAgICAgICAgICAgICAgIG5vdGlmeUxpc3RlbmVyX2woTUVESUFfSU5GTywgTUVESUFfSU5GT19CVUZGRVJJTkdfU1RBUlQpOwotICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAoZW9zIHx8IGNhY2hlZERhdGFSZW1haW5pbmcgPiBrSGlnaFdhdGVyTWFya0J5dGVzKSB7Ci0gICAgICAgICAgICAgICAgICAgIGlmIChtRmxhZ3MgJiBDQUNIRV9VTkRFUlJVTikgewotICAgICAgICAgICAgICAgICAgICAgICAgQUxPR0koImNhY2hlIGhhcyBmaWxsZWQgdXAgKD4gJWQpLCByZXN1bWluZy4iLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAga0hpZ2hXYXRlck1hcmtCeXRlcyk7Ci0gICAgICAgICAgICAgICAgICAgICAgICBtRmxhZ3MgJj0gfkNBQ0hFX1VOREVSUlVOOwotICAgICAgICAgICAgICAgICAgICAgICAgcGxheV9sKCk7Ci0gICAgICAgICAgICAgICAgICAgICAgICBub3RpZnlMaXN0ZW5lcl9sKE1FRElBX0lORk8sIE1FRElBX0lORk9fQlVGRkVSSU5HX0VORCk7Ci0gICAgICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAobUZsYWdzICYgUFJFUEFSSU5HKSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICBBTE9HVigiY2FjaGUgaGFzIGZpbGxlZCB1cCAoPiAlZCksIHByZXBhcmUgaXMgZG9uZSIsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICBrSGlnaFdhdGVyTWFya0J5dGVzKTsKLSAgICAgICAgICAgICAgICAgICAgICAgIGZpbmlzaEFzeW5jUHJlcGFyZV9sKCk7Ci0gICAgICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICB9Ci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hlciB0aGUgc2VydmljZSBpcyBkb3duIG9yIGNvbW1vbgotICAgICAgICAgICAgLy8gdGltZSBpcyBub3Qgc3luY2VkLiAgUmFpc2UgYW4gZXJyb3IgYW5kIHNodXRkb3duIHRoZSBwbGF5ZXIuCi0gICAgICAgICAgICBBTE9HRSgiKioqIENhbm5vdCBwdW1wIGF1ZGlvLCB1bmFibGUgdG8gZmV0Y2ggY29tbW9uIHRpbWUuIgotICAgICAgICAgICAgICAgICAgIiAgU2h1dHRpbmcgZG93bi4iKTsKLSAgICAgICAgICAgIG5vdGlmeUxpc3RlbmVyX2woTUVESUFfRVJST1IsIE1FRElBX0VSUk9SX1VOS05PV04sIFVOS05PV05fRVJST1IpOwotICAgICAgICAgICAgbVB1bXBBdWRpb0V2ZW50UGVuZGluZyA9IGZhbHNlOwotICAgICAgICAgICAgYnJlYWs7Ci0gICAgICAgIH0KLQotICAgICAgICBpZiAobUN1cnJlbnRDbG9ja1RyYW5zZm9ybVZhbGlkICYmIG1MYXN0UXVldWVkTWVkaWFUaW1lUFRTVmFsaWQpIHsKLSAgICAgICAgICAgIGludDY0X3QgbWVkaWFUaW1lTm93OwotICAgICAgICAgICAgYm9vbCBjb252ZXJzaW9uUmVzdWx0ID0gbUN1cnJlbnRDbG9ja1RyYW5zZm9ybS5kb1JldmVyc2VUcmFuc2Zvcm0oCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY29tbW9uVGltZU5vdywKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmbWVkaWFUaW1lTm93KTsKLSAgICAgICAgICAgIENIRUNLKGNvbnZlcnNpb25SZXN1bHQpOwotCi0gICAgICAgICAgICBpZiAoKG1lZGlhVGltZU5vdyArCi0gICAgICAgICAgICAgICAgIGtBQUhCdWZmZXJUaW1lVXMgLQotICAgICAgICAgICAgICAgICBtTGFzdFF1ZXVlZE1lZGlhVGltZVBUUykgPD0gMCkgewotICAgICAgICAgICAgICAgIGJyZWFrOwotICAgICAgICAgICAgfQotICAgICAgICB9Ci0KLSAgICAgICAgTWVkaWFTb3VyY2U6OlJlYWRPcHRpb25zIG9wdGlvbnM7Ci0gICAgICAgIGlmIChtSXNTZWVraW5nKSB7Ci0gICAgICAgICAgICBvcHRpb25zLnNldFNlZWtUbyhtU2Vla1RpbWVVcyk7Ci0gICAgICAgIH0KLQotICAgICAgICBNZWRpYUJ1ZmZlciogbWVkaWFCdWZmZXI7Ci0gICAgICAgIHN0YXR1c190IGVyciA9IG1BdWRpb1NvdXJjZS0+cmVhZCgmbWVkaWFCdWZmZXIsICZvcHRpb25zKTsKLSAgICAgICAgaWYgKGVyciAhPSBOT19FUlJPUikgewotICAgICAgICAgICAgaWYgKGVyciA9PSBFUlJPUl9FTkRfT0ZfU1RSRUFNKSB7Ci0gICAgICAgICAgICAgICAgQUxPR0koIioqKiAlcyByZWFjaGVkIGVuZCBvZiBzdHJlYW0iLCBfX1BSRVRUWV9GVU5DVElPTl9fKTsKLSAgICAgICAgICAgICAgICBub3RpZnlMaXN0ZW5lcl9sKE1FRElBX0JVRkZFUklOR19VUERBVEUsIDEwMCk7Ci0gICAgICAgICAgICAgICAgbm90aWZ5TGlzdGVuZXJfbChNRURJQV9QTEFZQkFDS19DT01QTEVURSk7Ci0gICAgICAgICAgICAgICAgcGF1c2VfbChmYWxzZSk7Ci0gICAgICAgICAgICAgICAgc2VuZEVPU19sKCk7Ci0gICAgICAgICAgICB9IGVsc2UgewotICAgICAgICAgICAgICAgIEFMT0dFKCIqKiogJXMgcmVhZCBmYWlsZWQgZXJyPSVkIiwgX19QUkVUVFlfRlVOQ1RJT05fXywgZXJyKTsKLSAgICAgICAgICAgIH0KLSAgICAgICAgICAgIHJldHVybjsKLSAgICAgICAgfQotCi0gICAgICAgIGlmIChtSXNTZWVraW5nKSB7Ci0gICAgICAgICAgICBtSXNTZWVraW5nID0gZmFsc2U7Ci0gICAgICAgICAgICBub3RpZnlMaXN0ZW5lcl9sKE1FRElBX1N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AgICAgICAgICAga0FBSFN0YXJ0dXBMZWFkVGltZVVzOwotICAgICAgICAgICAgICAgIG1DdXJyZW50Q2xvY2tUcmFuc2Zvcm0uYV90b19iX251bWVyID0gMTsKLSAgICAgICAgICAgICAgICBtQ3VycmVudENsb2NrVHJhbnNmb3JtLmFfdG9fYl9kZW5vbSA9IG1QbGF5UmF0ZUlzUGF1c2VkID8gMCA6IDE7Ci0gICAgICAgICAgICAgICAgbUN1cnJlbnRDbG9ja1RyYW5zZm9ybVZhbGlkID0gdHJ1ZTsKLSAgICAgICAgICAgIH0gZWxzZSB7Ci0gICAgICAgICAgICAgICAgLy8gRmFpbGVkIHRvIGdldCBjb21tb24gdGltZTsgZWl0aGVyIHRoZSBzZXJ2aWNlIGlzIGRvd24gb3IKLSAgICAgICAgICAgICAgICAvLyBjb21tb24gdGltZSBpcyBub3Qgc3luY2VkLiAgUmFpc2UgYW4gZXJyb3IgYW5kIHNodXRkb3duIHRoZQotICAgICAgICAgICAgICAgIC8vIHBsYXllci4KLSAgICAgICAgICAgICAgICBBTE9HRSgiKioqIENhbm5vdCBiZWdpbiB0cmFuc21pc3Npb24sIHVuYWJsZSB0byBmZXRjaCBjb21tb24iCi0gICAgICAgICAgICAgICAgICAgICAgIiB0aW1lLiBEcm9wcGluZyBzYW1wbGUgd2l0aCBwdHM9JWxsZCIsIG1lZGlhVGltZVVzKTsKLSAgICAgICAgICAgICAgICBub3RpZnlMaXN0ZW5lcl9sKE1FRElBX0VSUk9SLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTUVESUFfRVJST1JfVU5LTk9XTiwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFVOS05PV05fRVJST1IpOwotICAgICAgICAgICAgICAgIG1QdW1wQXVkaW9FdmVudFBlbmRpbmcgPSBmYWxzZTsKLSAgICAgICAgICAgICAgICBicmVhazsKLSAgICAgICAgICAgIH0KLSAgICAgICAgfQotCi0gICAgICAgIEFMT0dWKCIqKiogdHJhb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gdG8gY3JlYXRlIHNvY2tldCIsIF9fUFJFVFRZX0ZVTkNUSU9OX18pOwotICAgICAgICAgICAgcmV0dXJuIE5VTEw7Ci0gICAgICAgIH0KLQotICAgICAgICBzdHJ1Y3Qgc29ja2FkZHJfaW4gYmluZF9hZGRyOwotICAgICAgICBtZW1zZXQoJmJpbmRfYWRkciwgMCwgc2l6ZW9mKGJpbmRfYWRkcikpOwotICAgICAgICBiaW5kX2FkZHIuc2luX2ZhbWlseSA9IEFGX0lORVQ7Ci0gICAgICAgIGlmIChiaW5kKHNlbmRlci0+bVNvY2tldCwKLSAgICAgICAgICAgICAgICAgcmVpbnRlcnByZXRfY2FzdDxjb25zdCBzb2NrYWRkcio+KCZiaW5kX2FkZHIpLAotICAgICAgICAgICAgICAgICBzaXplb2YoYmluZF9hZGRyKSkgPCAwKSB7Ci0gICAgICAgICAgICBBTE9HVygiJXMgdW5hYmxlIHRvIGJpbmQgc29ja2V0IChlcnJubyAlZCkiLAotICAgICAgICAgICAgICAgICAgX19QUkVUVFlfRlVOQ1RJT05fXywgZXJybm8pOwotICAgICAgICAgICAgcmV0dXJuIE5VTEw7Ci0gICAgICAgIH0KLQotICAgICAgICBzZW5kZXItPm1SZXRyeVJlY2VpdmVyID0gbmV3IFJldHJ5UmVjZWl2ZXIoc2VuZGVyLmdldCgpKTsKLSAgICAgICAgaWYgKHNlbmRlci0+bVJldHJ5UmVjZWl2ZXIgPT0gTlVMTCkgewotICAgICAgICAgICAgcmV0dXJuIE5VTEw7Ci0gICAgICAgIH0KLQotICAgICAgICBzZW5kZXItPm1Mb29wZXItPnNldE5hbWUoIkFBSF9UWFNlbmRlciIpOwotICAgICAgICBzZW5kZXItPm1Mb29wZXItPnJlZ2lzdGVySGFuZGxlcihzZW5kZXItPm1SZWZsZWN0b3IpOwotICAgICAgICBzZW5kZXItPm1Mb29wZXItPnN0YXJ0KGZhbHNlLCBmYWxzZSwgUFJJT1JJVFlfQVVESU8pOwotCi0gICAgICAgIGlmIChz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SAgICAgICAgLy8gcGFja2V0IG11c3QgYmUgZGVhZC4KLSAgICAgICAgcmV0dXJuOwotICAgIH0KLQotICAgIC8vIGFzc2lnbiB0aGUgcGFja2V0J3Mgc2VxdWVuY2UgbnVtYmVyCi0gICAgcGFja2V0LT5zZXRFcG9jaChlcHMtPmVwb2NoKTsKLSAgICBwYWNrZXQtPnNldFNlcU51bWJlcihlcHMtPnRydHBTZXFOdW1iZXIrKyk7Ci0KLSAgICAvLyBhZGQgdGhlIHBhY2tldCB0byB0aGUgcmV0cnkgYnVmZmVyCi0gICAgUmV0cnlCdWZmZXImIHJldHJ5ID0gZXBzLT5yZXRyeTsKLSAgICByZXRyeS5wdXNoX2JhY2socGFja2V0KTsKLQotICAgIC8vIHNlbmQgdGhlIHBhY2tldAotICAgIHN0cnVjdCBzb2NrYWRkcl9pbiBhZGRyOwotICAgIG1lbXNldCgmYWRkciwgMCwgc2l6ZW9mKGFkZHIpKTsKLSAgICBhZGRyLnNpbl9mYW1pbHkgPSBBRl9JTkVUOwotICAgIGFkZHIuc2luX2FkZHIuc19hZGRyID0gZW5kcG9pbnQuYWRkcjsKLSAgICBhZGRyLnNpbl9wb3J0ID0gZW5kcG9pbnQucG9ydDsKLQotICAgIHNzaXplX3QgcmVzdWx0ID0gc2VuZHRvKG1Tb2NrZXQsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgcGFja2V0LT5nZXRQYWNrZXQoKSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBwYWNrZXQtPmdldFBhY2tldExlbigpLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgIDAsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgKGNvbnN0IHN0cnVjdCBzb2NrYWRkciAqKSAmYWRkciwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBzaXplb2YoYWRkcikpOwotICAgIGlmIChyZXN1bHQgPT0gLTEpIHsKLSAgICAgICAgQUxPR1coIiVzIHNlbmR0byBmYWlsZWQiLCBfX1BS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UFJFVFRZX0ZVTkNUSU9OX18pOwotICAgICAgICB9Ci0KLSAgICAgICAgZW5kSW5kZXggPSByZXRyeS5zaXplKCkgLSAxOwotICAgIH0KLQotICAgIC8vIHNlbmQgdGhlIHJldHJ5IHBhY2tldHMKLSAgICBmb3IgKGludCBpID0gc3RhcnRJbmRleDsgaSA8PSBlbmRJbmRleDsgaSsrKSB7Ci0gICAgICAgIGNvbnN0IHNwPFRSVFBQYWNrZXQ+JiByZXBseVBhY2tldCA9IHJldHJ5W2ldOwotCi0gICAgICAgIHJlc3VsdCA9IHNlbmR0byhtU2VuZGVyLT5tU29ja2V0LAotICAgICAgICAgICAgICAgICAgICAgICAgcmVwbHlQYWNrZXQtPmdldFBhY2tldCgpLAotICAgICAgICAgICAgICAgICAgICAgICAgcmVwbHlQYWNrZXQtPmdldFBhY2tldExlbigpLAotICAgICAgICAgICAgICAgICAgICAgICAgMCwKLSAgICAgICAgICAgICAgICAgICAgICAgICZyZXF1ZXN0U3JjQWRkciwKLSAgICAgICAgICAgICAgICAgICAgICAgIHJlcXVlc3RTcmNBZGRyTGVuKTsKLQotICAgICAgICBpZiAocmVzdWx0ID09IC0xKSB7Ci0gICAgICAgICAgICBBTE9HVygiJXMgc2VuZHRvIGZhaWxlZCIsIF9fUFJFVFRZX0ZVTkNUSU9OX18pOwotICAgICAgICB9Ci0gICAgfQotfQotCi0vLyBFbmRwb2ludAotCi1BQUhfVFhTZW5kZXI6OkVuZHBvaW50OjpFbmRwb2ludCgpCi0gICAgICAgIDogYWRkcigwKQotICAgICAgICAsIHBvcnQoMCkgeyB9Ci0KLUFBSF9UWFNlbmRlcjo6RW5kcG9pbnQ6OkVuZHBvaW50KHVpbnQzMl90IGEsIHVpbnQxNl90IHApCi0gICAgICAgIDogYWRkcihhKQotICAgICAgICAsIHBvcnQocCkge30KLQotYm9vbCBBQUhfVFhTZW5kZXI6OkVuZHBvaW50OjpvcGVyYXRvcjwoY29uc3QgRW5kcG9pbnQmIG90aGVyKSBj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vb2x8c3RyaW5nIDx2YWx1ZT4KLSMgICAgICAgICAgICAgICAgICAgICAgICBbIGludHxzaG9ydHxmbG9hdHxib29sfHN0cmluZyA8dmFsdWU+IF0KLSMgICAgICAgICAgICAgICAgICAgICAgICAuLi4KLSMgICAgICAgICAgICAgICAgICAgIH0KLSMgICAgICAgICAgICAgICAgICAgIHZhbHVlIHsKLSMgICAgICAgICAgICAgICAgICAgICAgICBpbnR8c2hvcnR8ZmxvYXR8Ym9vbHxzdHJpbmcgPHZhbHVlPgotIyAgICAgICAgICAgICAgICAgICAgICAgIFsgaW50fHNob3J0fGZsb2F0fGJvb2x8c3RyaW5nIDx2YWx1ZT4gXQotIyAgICAgICAgICAgICAgICAgICAgICAgIC4uLgotIyAgICAgICAgICAgICAgICAgICAgfQotIyAgICAgICAgICAgICAgICB9Ci0jICAgICAgICAgICAgICAgIDxwYXJhbSAyIG5hbWUgPiB7PHBhcmFtPiA8dmFsdWU+fQotIyAgICAgICAgICAgICAgICAuLi4KLSMgICAgICAgICAgICB9Ci0jICAgICAgICAgICAgLi4uCi0jICAgICAgICB9Ci0jICAgICAgICAuLi4KLSMgICAgfQotCi0jCi0jIFRPRE86IGFkZCBkZWZhdWx0IGF1ZGlvIHByZSBwcm9jZXNzb3IgY29uZmlndXJhdGlvbnMgYWZ0ZXIgZGVidWcgYW5kIHR1bmluZyBwaGFzZQotIwpkaWZmIC0tZ2l0IGEvbWVkaWEvbGliZWZmZWN0cy9kb3dubWl4L0FuZHJvaWQubWsgYi9tZWRpYS9saWJlZmZlY3RzL2Rvd25taXgvQW5kcm9pZC5tawpkZWxldGVkIGZpbGUgbW9kZSAxMDA2NDQKaW5kZXggOTVjYTZmZC4uMDAwMDAwMAotLS0gYS9tZWRpYS9saWJlZmZlY3RzL2Rvd25taXgvQW5kcm9pZC5taworKysgL2Rldi9udWxsCkBAIC0xLDI4ICswLDAgQEAKLUxPQ0FMX1BBVEg6PSAkKGNhbGwgbXktZGlyKQotCi0jIE11bHRpY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V90IG51bUZyYW1lcyA9IG91dEJ1ZmZlci0+ZnJhbWVDb3VudDsKLQotICAgIGNvbnN0IGJvb2wgYWNjdW11bGF0ZSA9Ci0gICAgICAgICAgICAocER3bU1vZHVsZS0+Y29uZmlnLm91dHB1dENmZy5hY2Nlc3NNb2RlID09IEVGRkVDVF9CVUZGRVJfQUNDRVNTX0FDQ1VNVUxBVEUpOwotCi0gICAgc3dpdGNoKHBEb3dubWl4ZXItPnR5cGUpIHsKLQotICAgICAgY2FzZSBET1dOTUlYX1RZUEVfU1RSSVA6Ci0gICAgICAgICAgaWYgKGFjY3VtdWxhdGUpIHsKLSAgICAgICAgICAgICAgd2hpbGUgKG51bUZyYW1lcykgewotICAgICAgICAgICAgICAgICAgcERzdFswXSA9IGNsYW1wMTYocERzdFswXSArIHBTcmNbMF0pOwotICAgICAgICAgICAgICAgICAgcERzdFsxXSA9IGNsYW1wMTYocERzdFsxXSArIHBTcmNbMV0pOwotICAgICAgICAgICAgICAgICAgcFNyYyArPSBwRG93bm1peGVyLT5pbnB1dF9jaGFubmVsX2NvdW50OwotICAgICAgICAgICAgICAgICAgcERzdCArPSAyOwotICAgICAgICAgICAgICAgICAgbnVtRnJhbWVzLS07Ci0gICAgICAgICAgICAgIH0KLSAgICAgICAgICB9IGVsc2UgewotICAgICAgICAgICAgICB3aGlsZSAobnVtRnJhbWVzKSB7Ci0gICAgICAgICAgICAgICAgICBwRHN0WzBdID0gcFNyY1swXTsKLSAgICAgICAgICAgICAgICAgIHBEc3RbMV0gPSBwU3JjWzFdOwotICAgICAgICAgICAgICAgICAgcFNyYyArPSBwRG93bm1peGVyLT5pbnB1dF9jaGFubmVsX2NvdW50OwotICAgICAgICAgICAgICAgICAgcERzdCArPSAyOwotICAgICAgICAgICAgICAgICAgbnVtRnJhbWVzLS07Ci0gICAgICAgICAgICAgIH0KLSAgICAgICAgICB9Ci0gICAgICAgICAgYnJlYWs7Ci0KLSAgICAgIGNhc2UgRE9XTk1JWF9UWVBFX0Z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otICAgICAgICBicmVhazsKLQotICAgICAgZGVmYXVsdDoKLSAgICAgICAgcmV0dXJuIC1FSU5WQUw7Ci0gICAgfQotCi0gICAgcmV0dXJuIDA7Ci19Ci0KLQotc3RhdGljIGludCBEb3dubWl4X0NvbW1hbmQoZWZmZWN0X2hhbmRsZV90IHNlbGYsIHVpbnQzMl90IGNtZENvZGUsIHVpbnQzMl90IGNtZFNpemUsCi0gICAgICAgIHZvaWQgKnBDbWREYXRhLCB1aW50MzJfdCAqcmVwbHlTaXplLCB2b2lkICpwUmVwbHlEYXRhKSB7Ci0KLSAgICBkb3dubWl4X21vZHVsZV90ICpwRHdtTW9kdWxlID0gKGRvd25taXhfbW9kdWxlX3QgKikgc2VsZjsKLSAgICBkb3dubWl4X29iamVjdF90ICpwRG93bm1peGVyOwotICAgIGludCByZXRzaXplOwotCi0gICAgaWYgKHBEd21Nb2R1bGUgPT0gTlVMTCB8fCBwRHdtTW9kdWxlLT5jb250ZXh0LnN0YXRlID09IERPV05NSVhfU1RBVEVfVU5JTklUSUFMSVpFRCkgewotICAgICAgICByZXR1cm4gLUVJTlZBTDsKLSAgICB9Ci0KLSAgICBwRG93bm1peGVyID0gKGRvd25taXhfb2JqZWN0X3QqKSAmcER3bU1vZHVsZS0+Y29udGV4dDsKLQotICAgIEFMT0dWKCJEb3dubWl4X0NvbW1hbmQgY29tbWFuZCAlZCBjbWRTaXplICVkIixjbWRDb2RlLCBjbWRTaXplKTsKLQotICAgIHN3aXRjaCAoY21kQ29kZSkgewotICAgIGNhc2UgRUZGRUNUX0NNRF9JTklUOgotICAgICAgICBpZiAocFJlcGx5RGF0YSA9PSBOVUxMIHx8ICpyZXBseVNpemUgIT0gc2l6ZW9mKGludCkpIHsKLSAgICAgICAgICAgIHJldHVybiAtRUlOVkFMOwotICAgICAgICB9Ci0gICAgICAgICooaW50ICopIHBSZXBseURhdGEgPSBEb3dubWl4X0luaXQocER3bU1vZHVsZSk7Ci0gICAgICAgIGJyZWFrOwotCi0gICAgY2FzZSBFRkZFQ1RfQ01EX1NFVF9DT05GSUc6Ci0gICAgICAgIGlmIChwQ21kRGF0YSA9PSBOVUxMIHx8IGNtZFNpemUgIT0gc2l6ZW9mKGVmZmVjdF9jb25maWdfdCkKLSAgICAgICAgICAgICAgICB8fCBwUmVwbHlEYXRhID09IE5VTEwgfHwgKnJlcGx5U2l6ZSAhPSBzaXplb2YoaW50KSkgewotICAgICAgICAgICAgcmV0dXJuIC1FSU5WQUw7Ci0gICAgICAgIH0KLSAgICAgICAgKihpbnQgKikgcFJlcGx5RGF0YSA9IERvd25taXhfQ29uZmlndXJlKHBEd21Nb2R1bGUsCi0gICAgICAgICAgICAgICAgKGVmZmVjdF9jb25maWdfdCAqKXBDbWREYXRhLCBmYWxzZSk7Ci0gICAgICAgIGJyZWFrOwotCi0gICAgY2FzZSBFRkZFQ1RfQ01EX1JFU0VUOgotICAgICAgICBEb3dubWl4X1Jlc2V0KHBEb3dubWl4ZXIsIGZhbHNlKTsKLSAgICAgICAgYnJlYWs7Ci0KLSAgICBjYXNlIEVGRkVDVF9DTURfR0VUX1BBUkFNOgotICAgICAgICBBTE9HVigiRG93bm1peF9Db21tYW5kIEVGRkVDVF9DTURfR0VUX1BBUkFNIHBDbWREYXRhICVwLCAqcmVwbHlTaXplICVkLCBwUmVwbHlEYXRhOiAlcCIsCi0gICAgICAgICAgICAgICAgcENtZERhdGEsICpyZXBseVNpemUsIHBSZXBseURhdGEpOwotICAgICAgICBpZiAocENtZERhdGEgPT0gTlVMTCB8fCBjbWRTaXplIDwgKGludCkoc2l6ZW9mKGVmZmVjdF9wYXJhbV90KSArIHNpemVvZihpbnQzMl90KSkgfHwKLSAgICAgICAgICAgICAgICBwUmVwbHlEYXRhID09IE5VTEwgfHwKLSAgICAgICAgICAgICAgICAqcmVwbHlTaXplIDwgKGludCkgc2l6ZW9mKGVmZmVjdF9wYXJhbV90KSArIDIgKiBzaXplb2YoaW50MzJfdCkpIHsKLSAgICAgICAgICAgIHJldHV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ZiAocERvd25taXhlci0+c3RhdGUgIT0gRE9XTk1JWF9TVEFURV9JTklUSUFMSVpFRCkgewotICAgICAgICAgICAgcmV0dXJuIC1FTk9TWVM7Ci0gICAgICAgIH0KLSAgICAgICAgcERvd25taXhlci0+c3RhdGUgPSBET1dOTUlYX1NUQVRFX0FDVElWRTsKLSAgICAgICAgQUxPR1YoIkVGRkVDVF9DTURfRU5BQkxFKCkgT0siKTsKLSAgICAgICAgKihpbnQgKilwUmVwbHlEYXRhID0gMDsKLSAgICAgICAgYnJlYWs7Ci0KLSAgICBjYXNlIEVGRkVDVF9DTURfRElTQUJMRToKLSAgICAgICAgaWYgKHBSZXBseURhdGEgPT0gTlVMTCB8fCAqcmVwbHlTaXplICE9IHNpemVvZihpbnQpKSB7Ci0gICAgICAgICAgICByZXR1cm4gLUVJTlZBTDsKLSAgICAgICAgfQotICAgICAgICBpZiAocERvd25taXhlci0+c3RhdGUgIT0gRE9XTk1JWF9TVEFURV9BQ1RJVkUpIHsKLSAgICAgICAgICAgIHJldHVybiAtRU5PU1lTOwotICAgICAgICB9Ci0gICAgICAgIHBEb3dubWl4ZXItPnN0YXRlID0gRE9XTk1JWF9TVEFURV9JTklUSUFMSVpFRDsKLSAgICAgICAgQUxPR1YoIkVGRkVDVF9DTURfRElTQUJMRSgpIE9LIik7Ci0gICAgICAgICooaW50ICopcFJlcGx5RGF0YSA9IDA7Ci0gICAgICAgIGJyZWFrOwotCi0gICAgY2FzZSBFRkZFQ1RfQ01EX1NFVF9ERVZJQ0U6Ci0gICAgICAgIGlmIChwQ21kRGF0YSA9PSBOVUxMIHx8IGNtZFNpemUgIT0gKGludClzaXplb2YodWludDMyX3QpKSB7Ci0gICAgICAgICAgICByZXR1cm4gLUVJTlZBTDsKLSAgICAgICAgfQotICAgICAgICAvLyBGSVhNRSBjaGFuZ2UgdHlwZSBpZiBwbGF5aW5nIG9uIGhlYWRzZXQgdnMgc3BlYWtlcgotICAgICAgICBBTE9HVigiRG93bm1peF9Db21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Ym9vbCBhY2N1bXVsYXRlKSB7Ci0gICAgLy8gc2FtcGxlIGF0IGluZGV4IDAgaXMgRkwKLSAgICAvLyBzYW1wbGUgYXQgaW5kZXggMSBpcyBGUgotICAgIC8vIHNhbXBsZSBhdCBpbmRleCAyIGlzIFJMCi0gICAgLy8gc2FtcGxlIGF0IGluZGV4IDMgaXMgUlIKLSAgICBpZiAoYWNjdW11bGF0ZSkgewotICAgICAgICB3aGlsZSAobnVtRnJhbWVzKSB7Ci0gICAgICAgICAgICAvLyBGTCArIFJMCi0gICAgICAgICAgICBwRHN0WzBdID0gY2xhbXAxNihwRHN0WzBdICsgcFNyY1swXSArIHBTcmNbMl0pOwotICAgICAgICAgICAgLy8gRlIgKyBSUgotICAgICAgICAgICAgcERzdFsxXSA9IGNsYW1wMTYocERzdFsxXSArIHBTcmNbMV0gKyBwU3JjWzNdKTsKLSAgICAgICAgICAgIHBTcmMgKz0gNDsKLSAgICAgICAgICAgIHBEc3QgKz0gMjsKLSAgICAgICAgICAgIG51bUZyYW1lcy0tOwotICAgICAgICB9Ci0gICAgfSBlbHNlIHsgLy8gc2FtZSBjb2RlIGFzIGFib3ZlIGJ1dCB3aXRob3V0IGFkZGluZyBhbmQgY2xhbXBpbmcgcERzdFtpXSB0byBpdHNlbGYKLSAgICAgICAgd2hpbGUgKG51bUZyYW1lcykgewotICAgICAgICAgICAgLy8gRkwgKyBSTAotICAgICAgICAgICAgcERzdFswXSA9IGNsYW1wMTYocFNyY1swXSArIHBTcmNbMl0pOwotICAgICAgICAgICAgLy8gRlIgKyBSUgotICAgICAgICAgICAgcERzdFsxXSA9IGNsYW1wMTYocFNyY1sxXSArIHBTcmNbM10pOwotICAgICAgICAgICAgcFNyYyArPSA0OwotICAgICAgICAgICAgcERzdCArPSAyOwotICAgICAgICAgICAgbnVtRnJhbWVzLS07Ci0gICAgICAgIH0KLSAgICB9Ci19Ci0KLQotLyotLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0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pIHsKLSAgICAgICAgd2hpbGUgKG51bUZyYW1lcykgewotICAgICAgICAgICAgLy8gY2VudGVyUGx1c1JlYXJDb250cmliID0gRkMoLTNkQikgKyBSQygtM2RCKQotICAgICAgICAgICAgY2VudGVyUGx1c1JlYXJDb250cmliID0gKHBTcmNbMl0gKiBNSU5VU18zX0RCX0lOX1ExOV8xMikgKyAocFNyY1szXSAqIE1JTlVTXzNfREJfSU5fUTE5XzEyKTsKLSAgICAgICAgICAgIC8vIEZMICsgY2VudGVyUGx1c1JlYXJDb250cmliCi0gICAgICAgICAgICBsdCA9IChwU3JjWzBdIDw8IDEyKSArIGNlbnRlclBsdXNSZWFyQ29udHJpYjsKLSAgICAgICAgICAgIC8vIEZSICsgY2VudGVyUGx1c1JlYXJDb250cmliCi0gICAgICAgICAgICBydCA9IChwU3JjWzFdIDw8IDEyKSArIGNlbnRlclBsdXNSZWFyQ29udHJpYjsKLSAgICAgICAgICAgIHBEc3RbMF0gPSBjbGFtcDE2KHBEc3RbMF0gKyAobHQgPj4gMTIpKTsKLSAgICAgICAgICAgIHBEc3RbMV0gPSBjbGFtcDE2KHBEc3RbMV0gKyAocnQgPj4gMTIpKTsKLSAgICAgICAgICAgIHBTcmMgKz0gNDsKLSAgICAgICAgICAgIHBEc3QgKz0gMjsKLSAgICAgICAgICAgIG51bUZyYW1lcy0tOwotICAgICAgICB9Ci0gICAgfSBlbHNlIHsgLy8gc2FtZSBjb2RlIGFzIGFib3ZlIGJ1dCB3aXRob3V0IGFkZGluZyBhbmQgY2xhbXBpbmcgcERzdFtpXSB0byBpdHNlbGYKLSAgICAgICAgd2hpbGUgKG51bUZyYW1lcykgewotICAgICAgICAgICAgLy8gY2VudGVyUGx1c1JlYXJDb250cmliID0gRkMoLTNkQikgKyBSQygtM2RCKQotICAgICAgICAgICAgY2VudGVyUGx1c1JlYXJDb250cmliID0gKHBTcmNbMl0gKiBNSU5VU18zX0RCX0lOX1ExOV8xMikgKyAocFNyY1szXSAqIE1JTlVT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ICsgUlIKLSAgICAgICAgICAgIHJ0ID0gKHBTcmNbMV0gPDwgMTIpICsgY2VudGVyUGx1c0xmZUNvbnRyaWIgKyAocFNyY1s1XSA8PCAxMik7Ci0gICAgICAgICAgICBwRHN0WzBdID0gY2xhbXAxNihwRHN0WzBdICsgKGx0ID4+IDEyKSk7Ci0gICAgICAgICAgICBwRHN0WzFdID0gY2xhbXAxNihwRHN0WzFdICsgKHJ0ID4+IDEyKSk7Ci0gICAgICAgICAgICBwU3JjICs9IDY7Ci0gICAgICAgICAgICBwRHN0ICs9IDI7Ci0gICAgICAgICAgICBudW1GcmFtZXMtLTsKLSAgICAgICAgfQotICAgIH0gZWxzZSB7IC8vIHNhbWUgY29kZSBhcyBhYm92ZSBidXQgd2l0aG91dCBhZGRpbmcgYW5kIGNsYW1waW5nIHBEc3RbaV0gdG8gaXRzZWxmCi0gICAgICAgIHdoaWxlIChudW1GcmFtZXMpIHsKLSAgICAgICAgICAgIC8vIGNlbnRlclBsdXNMZmVDb250cmliID0gRkMoLTNkQikgKyBMRkUoLTNkQikKLSAgICAgICAgICAgIGNlbnRlclBsdXNMZmVDb250cmliID0gKHBTcmNbMl0gKiBNSU5VU18zX0RCX0lOX1ExOV8xMikKLSAgICAgICAgICAgICAgICAgICAgKyAocFNyY1szXSAqIE1JTlVTXzNfREJfSU5fUTE5XzEyKTsKLSAgICAgICAgICAgIC8vIEZMICsgY2VudGVyUGx1c0xmZUNvbnRyaWIgKyBSTAotICAgICAgICAgICAgbHQgPSAocFNyY1swXSA8PCAxMikgKyBjZW50ZXJQbHVzTGZlQ29udHJpYiArIChwU3JjWzRdIDw8IDEyKTsKLSAgICAgICAgICAgIC8vIEZSICsgY2VudGVyUGx1c0xmZUNvbnRyaWIgKyBSUgotICAgICAgICAgICAgcnQgPSAocFNyY1sxXSA8PCAxMikgKyBjZW50ZXJQbHVzTGZlQ29udHJpYiArIChwU3JjWzVdIDw8IDEyKTsKLSAgICAgICAgICAgIHBEc3RbMF0gPSBj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AgICAgIHBEc3RbMV0gPSBjbGFtcDE2KHJ0ID4+IDEyKTsKLSAgICAgICAgICAgIHBTcmMgKz0gODsKLSAgICAgICAgICAgIHBEc3QgKz0gMjsKLSAgICAgICAgICAgIG51bUZyYW1lcy0tOwotICAgIH0KLSAgICB9IGVsc2UgeyAvLyBzYW1lIGNvZGUgYXMgYWJvdmUgYnV0IHdpdGhvdXQgYWRkaW5nIGFuZCBjbGFtcGluZyBwRHN0W2ldIHRvIGl0c2VsZgotICAgICAgICB3aGlsZSAobnVtRnJhbWVzKSB7Ci0gICAgICAgICAgICAvLyBjZW50ZXJQbHVzTGZlQ29udHJpYiA9IEZDKC0zZEIpICsgTEZFKC0zZEIpCi0gICAgICAgICAgICBjZW50ZXJQbHVzTGZlQ29udHJpYiA9IChwU3JjWzJdICogTUlOVVNfM19EQl9JTl9RMTlfMTIpCi0gICAgICAgICAgICAgICAgICAgICsgKHBTcmNbM10gKiBNSU5VU18zX0RCX0lOX1ExOV8xMik7Ci0gICAgICAgICAgICAvLyBGTCArIGNlbnRlclBsdXNMZmVDb250cmliICsgU0wgKyBSTAotICAgICAgICAgICAgbHQgPSAocFNyY1swXSA8PCAxMikgKyBjZW50ZXJQbHVzTGZlQ29udHJpYiArIChwU3JjWzZdIDw8IDEyKSArIChwU3JjWzRdIDw8IDEyKTsKLSAgICAgICAgICAgIC8vIEZSICsgY2VudGVyUGx1c0xmZUNvbnRyaWIgKyBTUiArIFJSCi0gICAgICAgICAgICBydCA9IChwU3JjWzFdIDw8IDEyKSArIGNlbnRlclBsdXNMZmVDb250cmliICsgKHBTcmNbN10gPDwgMTIpICsgKHBTcmNbNV0gPDwgMTIpOwotICAgICAgICAgICAgcERzdFswXSA9IGNsYW1wMTYocERzdFswXSArIChsdCA+PiAxMikpOwotICAgICAgICAgICAgcERzdFsxXSA9IGNsYW1wMTYocERzdFsxXSArIChydCA+PiAxMikpOwotICAgICAgICAgICAgcFNyYyArPSA4OwotICAgICAgICAgICAgcERzdCArPS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kCi0gKiBsaW1pdGF0aW9ucyB1bmRlciB0aGUgTGljZW5zZS4KLSAqLwotCi0vKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLS8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogICAgSGVhZGVyIGZpbGUgZm9yIHRoZSBhcHBsaWNhdGlvbiBsYXllciBpbnRlcmZhY2Ugb2YgRHluYW1pYyBCYXNzIEVuaGFuY2VtZW50ICAgICAgICovCi0vKiAgbW9kdWxlLiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogIFRoaXMgZmlsZXMgaW5jbHVkZXMgYWxsIGRlZmluaXRpb25zLCB0eXBlcywgc3RydWN0dXJlcyBhbmQgZnVuY3Rpb24gICAgICAgICAgICAgICAgICovCi0vKiAgcHJvdG90eXBlcyByZXF1aXJlZCBieSB0aGUgY2FsbGluZyBsYXllci4gQWxsIG90aGVyIHR5cGVzLCBzdHJ1Y3R1cmVzIGFuZCAgICAgICAgICAgKi8KLS8qICBmdW5jdGlvbnMgYXJlIHByaXZhdGUuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLS8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogICAgTm90ZTogMSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgICA9PT09PT09ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICAgIFRoZSBhbGdvcml0aG0gY2FuIGV4ZWN1dGUgZWl0aGVyIHdpdGggc2VwYXJhdGUgaW5wdXQgYW5kIG91dHB1dCBidWZmZXJzIG9yIHdpdGggICAqLwotLyogICAgYSBjb21tb24gYnVmZmVyLCBpLmUuIHRoZSBkYXRhIGlzIHByb2Nlc3NlZCBpbi1wbGFjZS4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotLyogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgICBOb3RlOiAyICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICAgID09PT09PT0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogICAgVGhlIER5bmFtaWMgQmFzcyBFbmhhbmNlbWVudCBhbGdvcml0aG0gYWx3YXlzIHByb2Nlc3NlcyBkYXRhIGFzIHN0ZXJlbyBpbnB1dC4gTW9ubyovCi0vKiAgZm9ybWF0IGRhdGEgaXMgbm90IHN1cHBvcnRlZC4gVGhlIGRhdGEgaXMgaW50ZXJsZWF2ZWQgYXMgZm9sbG93czogICAgICAgICAgICAgICAgICAgKi8KLS8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogICAgICAgICAgICAgIEJ5dGUgT2Zmc2V0ICAgICAgICAgU3RlcmVvIElucHV0ICAgICAgICAgTW9uby1Jbi1TdGVyZW8gSW5wdXQgICAgICAgICAgICovCi0vKiAgICAgICAgICAgICAgPT09PT09PT09PT0gICAgICAgICA9PT09PT09PT09PT0gICAgICAgICA9PT09PT09PT09PT09PT09PT09PSAgICAgICAgICAgKi8KLS8qICAgICAgICAgICAgICAgICAgMCAgICAgICAgICAgICAgIExlZnQgU2FtcGxlICMxICAgICAgICAgIE1vbm8gU2FtcGxlICMxICAgICAgICAgICAgICAqLwotLyogICAgICAgICAgICAgICAgICAyICAgICAgICAgICAgICAgUmlnaHQgU2FtcGxlICMxICAgICAgICAgTW9ubyBTYW1wbGUgIzEgICAgICAgICAgICAgICovCi0vKiAgICAgICAgICAgICAgICAgIDQgICAgICAgICAgICAgICBMZWZ0IFNhbXBsZSAjMiAgICAgICAgICBNb25vIFNhbXBsZSAjMiAgICAgICAgICAgICAgKi8KLS8qICAgICAgICAgICAgICAgICAgNiAgICAgICAgICAgICAgIFJpZ2h0IFNhbXBsZSAjMiAgICAgICAgIE1vbm8gU2FtcGxlICMyICAgICAgICAgICAgICAqLwotLyogICAgICAgICAgICAgICAgICAuICAgICAgICAgICAgICAgICAgICAgIC4gICAgICAgICAgICAgICAgICAgICAuICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgICAgICAgICAgICAgICAgIC4gICAgICAgICAgICAgICAgICAgICAgLiAgICAgICAgICAgICAgICAgICAgIC4gICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogIE1vbm8gZm9ybWF0IGRhdGEgaXMgbm90IHN1cHBvcnRlZCwgdGhlIGNhbGxpbmcgcm91dGluZSBtdXN0IGNvbnZlcnQgYSBNb25vIHN0cmVhbSAgICovCi0vKiAgICBpbiB0byBNb25vLUluLVN0ZXJlbyBmb3JtYXQuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0KLSNpZm5kZWYgX19MVkRCRV9IX18KLSNkZWZpbmUgX19MVkRCRV9IX18KLQotI2lmZGVmIF9fY3BsdXNwbHVzCi1leHRlcm4gIkMiIHsKLSNlbmRpZiAvKiBfX2NwbHVzcGx1cyAqLwotCi0KLS8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotLyogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgICBJbmNsdWRlcyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0KLSNpbmNsdWRlICJMVk1fVHlwZXMuaCIKLQotCi0vKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLS8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogICAgRGVmaW5pdGlvbnMgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotCi0vKiBNZW1vcnkgdGFibGUqLwotI2RlZmluZSBMVkRCRV9OUl9NRU1PUllfUkVHSU9OUyAgICAgICAgNCAgICAgICAgICAgICAgICAgICAgICAgICAgICAvKiBOdW1iZXIgb2YgbWVtb3J5IHJlZ2lvbnMgKi8KLQotLyogQmFzcyBFbmhhbmNlbWVudCBlZmZlY3QgbGV2ZWwgKi8KLSNkZWZpbmUgTFZEQkVfRUZGRUNUXzAzREIgICAgICAgICAgICAzICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLyogRWZmZWN0IGRlZmluZXMgZm9yIGJhY2t3YXJkcyBjb21wYXRpYmlsaXR5ICovCi0jZGVmaW5lIExWREJFX0VGRkVDVF8wNkRCICAgICAgICAgICAgNgotI2RlZmluZSBMVkRCRV9FRkZFQ1RfMDlEQiAgICAgICAgICAgIDkKLSNkZWZpbmUgTFZEQkVfRUZGRUNUXzEyREIgICAgICAgICAgICAxMgotI2RlZmluZSBMVkRCRV9FRkZFQ1RfMTVEQiAgICAgICAgICAgIDE1Ci0KLQotLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0vKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICAgIFR5cGVzICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLQotLyogSW5zdGFuY2UgaGFuZGxlICovCi10eXBlZGVmIHZvaWQgICAgKkxWREJFX0hhbmRsZV90OwotCi0KLS8qIE9wZXJhdGluZyBtb2RlcyAqLwotdHlwZWRlZiBlbnVtCi17Ci0gICAgTFZEQkVfT0ZGICAgICAgPSAwLAotICAgIExWREJFX09OICAgICAgID0gMSwKLSAgICBMVkRCRV9NT0RFX01BWCA9IExWTV9NQVhJTlRfMzIKLX0gTFZEQkVfTW9kZV9lbjsKLQotCi0vKiBIaWdoIHBhc3MgZmlsdGVyICovCi10eXBlZGVmIGVudW0KLXsKLSAgICBMVkRCRV9IUEZfT0ZGID0gMCwKLSAgICBMVkRCRV9IUEZfT04gID0gMSwKLSAgICBMVkRCRV9IUEZfTUFYID0gTFZNX01BWElOVF8zMgotfSBMVkRCRV9GaWx0ZXJTZWxlY3RfZW47Ci0KLQotLyogVm9sdW1lIGNvbnRyb2wgKi8KLXR5cGVkZWYgZW51bQotewotICAgIExWREJFX1ZPTFVNRV9PRkYgPSAwLAotICAgIExWREJFX1ZPTFVNRV9PTiAgPSAxLAotICAgIExWREJFX1ZPTFVNRV9NQVggPSBMVk1fTUFYSU5UXzMyCi19IExWREJFX1ZvbHVtZV9lbjsKLQotCi0vKiBNZW1vcnkgVHlwZXMgKi8KLXR5cGVkZWYgZW51bQotewotICAgIExWREJFX1BFUlNJU1RFTlQgICAgICA9IDAsCi0gICAgTFZEQkVfUEVSU0lTVEVOVF9EQVRBID0gMSwKLSAgICBMVkRCRV9QRVJTSVNURU5UX0NPRUYgPSAyLAotICAgIExWREJFX1NDUkFUQ0ggICAgICAgICA9IDMsCi0gICAgTFZEQkVfTUVNT1JZX01BWCAgICAgID0gTFZNX01BWElOVF8zMgotCi19IExWREJFX01lbW9yeVR5cGVzX2VuOwotCi0KLS8qIEZ1bmN0aW9uIHJldHVybiBzdGF0dXMgKi8KLXR5cGVkZWYgZW51bQotewotICAgIExWREJFX1NVQ0NFU1MgICAgICAgID0gMCwgICAgICAgICAgICAgICAgICAgICAgICAvKiBTdWNjZXNzZnVsIHJldHVybiBmcm9tIGEgcm91dGluZSAqLwotICAgIExWREJFX0FMSUdOTUVOVEVSUk9SID0gMSwgICAgICAgICAgICAgICAgICAgICAgICAvKiBNZW1vcnkgYWxpZ25tZW50IGVycm9yICovCi0gICAgTFZEQkVfTlVMTEFERFJFU1MgICAgPSAyLCAgICAgICAgICAgICAgICAgICAgICAgIC8qIE5VTEwgYWxsb2NhdGlvbiBhZGRyZXNzICovCi0gICAgTFZEQkVfVE9PTUFOWVNBTVBMRVMgPSAzLCAgICAgICAgICAgICAgICAgICAgICAgIC8qIE1heGltdW0gYmxvY2sgc2l6ZSBleGNlZWRlZCAqLwotICAgIExWREJFX1NJWkVFUlJPUiAgICAgID0gNCwgICAgICAgICAgICAgICAgICAgICAgICAvKiBJbmNvcnJlY3Qgc3RydWN0dXJlIHNpemUgKi8KLSAgICBMVkRCRV9TVEFUVVNfTUFYICAgICA9IExWTV9NQVhJTlRfMzIKLX0gTFZEQkVfUmV0dXJuU3RhdHVzX2VuOwotCi0KLS8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotLyogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgICBMaW5rZWQgZW51bWVyYXRlZCB0eXBlIGFuZCBjYXBhYmlsaXR5IGRlZmluaXRpb25zICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogIFRoZSBjYXBhYmlsaXR5IGRlZmluaXRpb25zIGFyZSB1c2VkIHRvIGRlZmluZSB0aGUgcmVxdWlyZWQgY2FwYWJpbGl0aWVzIGF0ICAgICAgICAgICovCi0vKiAgaW5pdGlhbGlzYXRpb24sIHRoZXNlIGFyZSBhZGRlZCB0b2dldGhlciB0byBnaXZlIHRoZSBjYXBhYmlsaXR5IHdvcmQuIFRoZSAgICAgICAgICAgKi8KLS8qICBlbnVtZXJhdGVkIHR5cGUgaXMgdXNlZCB0byBzZWxlY3QgdGhlIG1vZGUgdGhyb3VnaCBhIGNvbnRyb2wgZnVuY3Rpb24gYXQgcnVuIHRpbWUuICAqLwotLyogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgVGhlIGNhcGFiaWxpdHkgZGVmaW5pdGlvbiBpcyByZWxhdGVkIHRvIHRoZSBlbnVtZXJhdGVkIHR5cGUgdmFsdWUgYnkgdGhlIGVxdWF0aW9uOiAgKi8KLS8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogICAgICAgICAgQ2FwYWJpbGl0eV92YWx1ZSA9IDJeRW51bWVyYXRlZF92YWx1ZSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICBGb3IgZXhhbXBsZSwgYSBtb2R1bGUgY291bGQgYmUgY29uZmlndXJkIGF0IGluaXRpYWxpc2F0aW9uIHRvIHN1cHBvcnQgdHdvIHNhbXBsZSAgICAqLwotLyogIHJhdGVzIG9ubHkgYnkgY2FsbGluZyB0aGUgaW5pdCBmdW5jdGlvbiB3aXRoIHRoZSB2YWx1ZTogICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgICAgIENhcGFiaWxpdGllcy5TYW1wbGVSYXRlID0gTFZEQkVfQ0FQXzMyMDAwICsgTFZDU19EQkVfNDQxMDA7ICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogIGFuZCBhdCBydW4gdGltZSBpdCB3b3VsZCBiZSBwYXNzZWQgdGhlIHZhbHVlIExWREJFX0ZTXzMyMDAwIHRocm91Z2ggdGhlIGNvbnRyb2wgICAgICovCi0vKiAgZnVuY3Rpb24gdG8gc2VsZWN0IG9wZXJhdGlvbiBhdCAzMmtIeiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0KLS8qCi0gKiBCYXNzIEVuaGFuY2VtZW50IGNlbnRyZSBmcmVxdWVuY3kKLSAqLwotI2RlZmluZSBMVkRCRV9DQVBfQ0VOVFJFXzU1SHogICAgICAgMQotI2RlZmluZSBMVkRCRV9DQVBfQ0VOVFJFXzY2SHogICAgICAgMgotI2RlZmluZSBMVkRCRV9DQVBfQ0VOVFJFXzc4SHogICAgICAgNAotI2RlZmluZSBMVkRCRV9DQVBfQ0VOVFJFXzkwSHogICAgICAgOAotCi10eXBlZGVmIGVudW0KLXsKLSAgICBMVkRCRV9DRU5UUkVfNTVIWiA9IDAsCi0gICAgTFZEQkVfQ0VOVFJFXzY2SFogPSAxLAotICAgIExWREJFX0NFTlRSRV83OEhaID0gMiwKLSAgICBMVkRCRV9DRU5UUkVfOTBIWiA9IDMsCi0gICAgTFZEQkVfQ0VOVFJFX01BWCAgPSBMVk1fTUFYSU5UXzMyCi19IExWREJFX0NlbnRyZUZyZXFfZW47Ci0KLQotLyoKLSAqIFN1cHBvcnRlZCBzYW1wbGUgcmF0ZXMgaW4gc2FtcGxlcyBwZXIgc2Vjb25kCi0gKi8KLSNkZWZpbmUgTFZEQkVfQ0FQX0ZTXzgwMDAgICAgICAgICAgICAgICAgMQotI2RlZmluZSBMVkRCRV9DQVBfRlNfMTEwMjUgICAgICAgICAgICAgICAyCi0jZGVmaW5lIExWREJFX0NBUF9GU18xMjAwMCAgICAgICAgICAgICAgIDQKLSNkZWZpbmUgTFZEQkVfQ0FQX0ZTXzE2MDAwICAgICAgICAgICAgICAgOAotI2RlZmluZSBMVkRCRV9DQVBfRlNfMjIwNTAgICAgICAgICAgICAgICAxNgotI2RlZmluZSBMVkRCRV9DQVBfRlNfMjQwMDAgICAgICAgICAgICAgICAzMgotI2RlZmluZSBMVkRCRV9DQVBfRlNfMzIwMDAgICAgICAgICAgICAgICA2NAotI2RlZmluZSBMVkRCRV9DQVBfRlNfNDQxMDAgICAgICAgICAgICAgICAxMjgKLSNkZWZpbmUgTFZEQkVfQ0FQX0ZTXzQ4MDAwICAgICAgICAgICAgICAgMjU2Ci0KLXR5cGVkZWYgZW51bQotewotICAgIExWREJFX0ZTXzgwMDAgID0gMCwKLSAgICBMVkRCRV9GU18xMTAyNSA9IDEsCi0gICAgTFZEQkVfRlNfMTIwMDAgPSAyLAotICAgIExWREJFX0ZTXzE2MDAwID0gMywKLSAgICBMVkRCRV9GU18yMjA1MCA9IDQsCi0gICAgTFZEQkVfRlNfMjQwMDAgPSA1LAotICAgIExWREJFX0ZTXzMyMDAwID0gNiwKLSAgICBMVkRCRV9GU180NDEwMCA9IDcsCi0gICAgTFZEQkVfRlNfNDgwMDAgPSA4LAotICAgIExWREJFX0ZTX01BWCAgID0gTFZNX01BWElOVF8zMgotfSBMVkRCRV9Gc19lbjsKLQotCi0vKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLS8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogICAgU3RydWN0dXJlcyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotCi0vKiBNZW1vcnkgcmVnaW9uIGRlZmluaXRpb24gKi8KLXR5cGVkZWYgc3RydWN0Ci17Ci0gICAgTFZNX1VJTlQzMiAgICAgICAgICAgICAgICBTaXplOyAgICAgICAgICAgICAgICAgICAgICAgIC8qIFJlZ2lvbiBzaXplIGluIGJ5dGVzICovCi0gICAgTFZNX1VJTlQxNiAgICAgICAgICAgICAgICBBbGlnbm1lbnQ7ICAgICAgICAgICAgICAgICAgLyogUmVnaW9uIGFsaWdubWVudCBpbiBieXRlcyAqLwotICAgIExWREJFX01lbW9yeVR5cGVzX2VuICAgICAgVHlwZTsgICAgICAgICAgICAgICAgICAgICAgIC8qIFJlZ2lvbiB0eXBlICovCi0gICAgdm9pZCAgICAgICAgICAgICAgICAgICAgICAqcEJhc2VBZGRyZXNzOyAgICAgICAgICAgICAgLyogUG9pbnRlciB0byB0aGUgcmVnaW9uIGJhc2UgYWRkcmVzcyAqLwotfSBMVkRCRV9NZW1vcnlSZWdpb25fdDsKLQotCi0vKiBNZW1vcnkgdGFibGUgY29udGFpbmluZyB0aGUgcmVnaW9uIGRlZmluaXRpb25zICovCi10eXBlZGVmIHN0cnVjdAotewotICAgIExWREJFX01lbW9yeVJlZ2lvbl90ICAgIFJlZ2lvbltMVkRCRV9OUl9NRU1PUllfUkVHSU9OU107ICAvKiBPbmUgZGVmaW5pdGlvbiBmb3IgZWFjaCByZWdpb24gKi8KLX0gTFZEQkVfTWVtVGFiX3Q7Ci0KLQotLyogUGFyYW1ldGVyIHN0cnVjdHVyZSAqLwotdHlwZWRlZiBzdHJ1Y3QKLXsKLSAgICBMVkRCRV9Nb2RlX2VuICAgICAgICAgICBPcGVyYXRpbmdNb2RlOwotICAgIExWREJFX0ZzX2VuICAgICAgICAgICAgIFNhbXBsZVJhdGU7Ci0gICAgTFZNX0lOVDE2ICAgICAgICAgICAgICAgRWZmZWN0TGV2ZWw7Ci0gICAgTFZEQkVfQ2VudHJlRnJlcV9lbiAgICAgQ2VudHJlRnJlcXVlbmN5OwotICAgIExWREJFX0ZpbHRlclNlbGVjdF9lbiAgIEhQRlNlbGVjdDsKLSAgICBMVkRCRV9Wb2x1bWVfZW4gICAgICAgICBWb2x1bWVDb250cm9sOwotICAgIExWTV9JTlQxNiAgICAgICAgICAgICAgIFZvbHVtZWRCOwotICAgIExWTV9JTlQxNiAgICAgICAgICAgICAgIEhlYWRyb29tZEI7Ci0KLX0gTFZEQkVfUGFyYW1zX3Q7Ci0KLQotLyogQ2FwYWJpbGl0eSBzdHJ1Y3R1cmUgKi8KLXR5cGVkZWYgc3RydWN0Ci17Ci0gICAgICBMVk1fVUlOVDE2ICAgICAgICAgICAgICBTYW1wbGVSYXRlOyAgICAgICAgICAgICAgIC8qIFNhbXBsaW5nIHJhdGUgY2FwYWJpbGl0aWVzICovCi0gICAgICBMVk1fVUlOVDE2ICAgICAgICAgICAgICBDZW50cmVGcmVxdWVuY3k7ICAgICAgICAgIC8qIENlbnRyZSBmcmVxdWVuY3kgY2FwYWJpbGl0aWVzICovCi0gICAgICBMVk1fVUlOVDE2ICAgICAgICAgICAgICBNYXhCbG9ja1NpemU7ICAgICAgICAgICAgIC8qIE1heGltdW0gYmxvY2sgc2l6ZSBpbiBzYW1wbGUgcGFpcnMgKi8KLX0gTFZEQkVfQ2FwYWJpbGl0aWVzX3Q7Ci0KLQotLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0vKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICAgIEZ1bmN0aW9uIFByb3RvdHlwZXMgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLQotLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0vKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qIEZVTkNUSU9OOiAgICAgICAgICAgICAgICAgTFZEQkVfTWVtb3J5ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiBERVNDUklQVElPTjogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICAgIFRoaXMgZnVuY3Rpb24gaXMgdXNlZCBmb3IgbWVtb3J5IGFsbG9jYXRpb24gYW5kIGZyZWUuIEl0IGNhbiBiZSBjYWxsZWQgaW4gICAgICAgICAqLwotLyogICAgdHdvIHdheXM6ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICAgICAgICBoSW5zdGFuY2UgPSBOVUxMICAgICAgICAgICAgICAgIFJldHVybnMgdGhlIG1lbW9yeSByZXF1aXJlbWVudHMgICAgICAgICAgICAgICAqLwotLyogICAgICAgIGhJbnN0YW5jZSA9IEluc3RhbmNlIGhhbmRsZSAgICAgICAgUmV0dXJucyB0aGUgbWVtb3J5IHJlcXVpcmVtZW50cyBhbmQgICAgICAgICovCi0vKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBhbGxvY2F0ZWQgYmFzZSBhZGRyZXNzZXMgZm9yIHRoZSBpbnN0YW5jZSAgICAgKi8KLS8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogICAgV2hlbiB0aGlzIGZ1bmN0aW9uIGlzIGNhbGxlZCBmb3IgbWVtb3J5IGFsbG9jYXRpb24gKGhJbnN0YW5jZT1OVUxMKSB0aGUgbWVtb3J5ICAgICovCi0vKiAgYmFzZSBhZGRyZXNzIHBvaW50ZXJzIGFyZSBOVUxMIG9uIHJldHVybi4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogICAgV2hlbiB0aGUgZnVuY3Rpb24gaXMgY2FsbGVkIGZvciBmcmVlIChoSW5zdGFuY2UgPSBJbnN0YW5jZSBIYW5kbGUpIHRoZSBtZW1vcnkgICAgICovCi0vKiAgdGFibGUgcmV0dXJucyB0aGUgYWxsb2NhdGVkIG1lbW9yeSBhbmQgYmFzZSBhZGRyZXNzZXMgdXNlZCBkdXJpbmcgaW5pdGlhbGlzYXRpb24uICAgKi8KLS8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogUEFSQU1FVEVSUzogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgaEluc3RhbmNlICAgICAgICAgICAgICAgIEluc3RhbmNlIEhhbmRsZSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICBwTWVtb3J5VGFibGUgICAgICAgICAgICAgUG9pbnRlciB0byBhbiBlbXB0eSBtZW1vcnkgZGVmaW5pdGlvbiB0YWJsZSAgICAgICAgICAgICAgICAqLwotLyogICAgcENhcGFiaWxpdGllcyAgICAgICAgICAgIFBvaW50ZXIgdG8gdGhlIGRlZmF1bHQgY2FwYWJpbGl0ZXMgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qIFJFVFVSTlM6ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogIExWREJFX1NVQ0NFU1MgICAgICAgICAgICBTdWNjZWVkZWQgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qIE5PVEVTOiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogICAgMS4gICAgVGhpcyBmdW5jdGlvbiBtYXkgYmUgaW50ZXJydXB0ZWQgYnkgdGhlIExWREJFX1Byb2Nlc3MgZnVuY3Rpb24gICAgICAgICAgICAgICovCi0vKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotCi1MVkRCRV9SZXR1cm5TdGF0dXNfZW4gTFZEQkVfTWVtb3J5KExWREJFX0hhbmRsZV90ICAgICAgICAgICBoSW5zdGFuY2UsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIExWREJFX01lbVRhYl90ICAgICAgICAgICAqcE1lbW9yeVRhYmxlLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBMVkRCRV9DYXBhYmlsaXRpZXNfdCAgICAgKnBDYXBhYmlsaXRpZXMpOwotCi0KLS8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotLyogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiBGVU5DVElPTjogICAgICAgICAgICAgICAgIExWREJFX0luaXQgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogREVTQ1JJUFRJT046ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgICBDcmVhdGUgYW5kIGluaXRpYWxpc2F0aW9uIGZ1bmN0aW9uIGZvciB0aGUgQmFzcyBFbmhhbmNlbWVudCBtb2R1bGUgICAgICAgICAgICAgICAgKi8KLS8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogICAgVGhpcyBmdW5jdGlvbiBjYW4gYmUgdXNlZCB0byBjcmVhdGUgYW4gYWxnb3JpdGhtIGluc3RhbmNlIGJ5IGNhbGxpbmcgd2l0aCAgICAgICAgICovCi0vKiAgICBoSW5zdGFuY2Ugc2V0IHRvIE5VTEwuIEluIHRoaXMgY2FzZSB0aGUgYWxnb3JpdGhtIHJldHVybnMgdGhlIG5ldyBpbnN0YW5jZSAgICAgICAgKi8KLS8qICAgIGhhbmRsZS4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgICBUaGlzIGZ1bmN0aW9uIGNhbiBiZSB1c2VkIHRvIGZvcmNlIGEgZnVsbCByZS1pbml0aWFsaXNhdGlvbiBvZiB0aGUgYWxnb3JpdGhtICAgICAgKi8KLS8qICAgIGJ5IGNhbGxpbmcgd2l0aCBoSW5zdGFuY2UgPSBJbnN0YW5jZSBIYW5kbGUuIEluIHRoaXMgY2FzZSB0aGUgbWVtb3J5IHRhYmxlICAgICAgICAqLwotLyogICAgc2hvdWxkIGJlIGNvcnJlY3QgZm9yIHRoZSBpbnN0YW5jZSwgdGhpcyBjYW4gYmUgZW5zdXJlZCBieSBjYWxsaW5nIHRoZSBmdW5jdGlvbiAgICovCi0vKiAgICBMVkRCRV9NZW1vcnkgYmVmb3JlIGNhbGxpbmcgdGhpcyBmdW5jdGlvbi4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogUEFSQU1FVEVSUzogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgaEluc3RhbmNlICAgICAgICAgICAgICAgICAgSW5zdGFuY2UgaGFuZGxlICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICBwTWVtb3J5VGFibGUgICAgICAgICAgICAgUG9pbnRlciB0byB0aGUgbWVtb3J5IGRlZmluaXRpb24gdGFibGUgICAgICAgICAgICAgICAgICAgICAqLwotLyogIHBDYXBhYmlsaXRpZXMgICAgICAgICAgICBQb2ludGVyIHRvIHRoZSBpbml0aWFsaXNhdGlvbiBjYXBhYmlsaXRpZXMgICAgICAgICAgICAgICAgICovCi0vKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qIFJFVFVSTlM6ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogIExWREJFX1NVQ0NFU1MgICAgICAgICAgICAgICAgSW5pdGlhbGlzYXRpb24gc3VjY2VlZGVkICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgTFZEQkVfQUxJR05NRU5URVJST1IgICAgICAgIEluc3RhbmNlIG9yIHNjcmF0Y2ggbWVtb3J5IG9uIGluY29ycmVjdCBhbGlnbm1lbnQgICAgICAgKi8KLS8qICAgIExWREJFX05VTExBRERSRVNTICAgICAgICAgICAgT25lIG9yIG1vcmUgbWVtb3J5IGhhcyBhIE5VTEwgcG9pbnRlciAgICAgICAgICAgICAgICAqLwotLyogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiBOT1RFUzogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICAxLiAgICAgVGhlIGluc3RhbmNlIGhhbmRsZSBpcyB0aGUgcG9pbnRlciB0byB0aGUgYmFzZSBhZGRyZXNzIG9mIHRoZSBmaXJzdCBtZW1vcnkgICAqLwotLyogICAgICAgIHJlZ2lvbi4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgICAyLiAgICBUaGlzIGZ1bmN0aW9uIG11c3Qgbm90IGJlIGludGVycnVwdGVkIGJ5IHRoZSBMVkRCRV9Qcm9jZXNzIGZ1bmN0aW9uICAgICAgICAgKi8KLS8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0KLUxWREJFX1JldHVyblN0YXR1c19lbiBMVkRCRV9Jbml0KExWREJFX0hhbmRsZV90ICAgICAgICAgICAgICpwaEluc3RhbmNlLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBMVkRCRV9NZW1UYWJfdCAgICAgICAgICAgKnBNZW1vcnlUYWJsZSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTFZEQkVfQ2FwYWJpbGl0aWVzX3QgICAgICpwQ2FwYWJpbGl0aWVzKTsKLQotCi0vKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLS8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogRlVOQ1RJT046ICAgICAgICAgICAgICAgICAgTFZEQkVfR2V0UGFyYW1ldGVycyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qIERFU0NSSVBUSU9OOiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogICAgUmVxdWVzdCB0aGUgQmFzcyBFbmhhbmNlbWVudCBwYXJhbWV0ZXJzLiBUaGUgY3VycmVudCBwYXJhbWV0ZXIgc2V0IGlzIHJldHVybmVkICAgICovCi0vKiAgICB2aWEgdGhlIHBhcmFtZXRlciBwb2ludGVyLiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogUEFSQU1FVEVSUzogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgaEluc3RhbmNlICAgICAgICAgICAgICAgICAgIEluc3RhbmNlIGhhbmRsZSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICBwUGFyYW1zICAgICAgICAgICAgICAgICAgUG9pbnRlciB0byBhbiBlbXB0eSBwYXJhbWV0ZXIgc3RydWN0dXJlICAgICAgICAgICAgICAgICAgICAqLwotLyogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiBSRVRVUk5TOiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICBMVkRCRV9TVUNDRVNTICAgICAgICAgICAgIEFsd2F5cyBzdWNjZWVkcyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiBOT1RFUzogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICAxLiAgICBUaGlzIGZ1bmN0aW9uIG1heSBiZSBpbnRlcnJ1cHRlZCBieSB0aGUgTFZEQkVfUHJvY2VzcyBmdW5jdGlvbiAgICAgICAgICAgICAgICAqLwotLyogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLQotTFZEQkVfUmV0dXJuU3RhdHVzX2VuIExWREJFX0dldFBhcmFtZXRlcnMoTFZEQkVfSGFuZGxlX3QgICAgICAgIGhJbnN0YW5jZSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTFZEQkVfUGFyYW1zX3QgICAgICAqcFBhcmFtcyk7Ci0KLQotLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0vKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qIEZVTkNUSU9OOiAgICAgICAgICAgICAgICAgIExWREJFX0dldENhcGFiaWxpdGllcyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiBERVNDUklQVElPTjogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICAgIFJlcXVlc3QgdGhlIER5bmFtaWMgQmFzcyBFbmhhbmNlbWVudCBjYXBhYmlsaXRpZXMuIFRoZSBpbml0aWFsIGNhcGFiaWxpdGllcyBhcmUgICAqLwotLyogIHJldHVybmVkIHZpYSB0aGUgcG9pbnRlci4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qIFBBUkFNRVRFUlM6ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogIGhJbnN0YW5jZSAgICAgICAgICAgICAgICAgICBJbnN0YW5jZSBoYW5kbGUgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgcENhcGFiaWxpdGllcyAgICAgICAgICAgICAgUG9pbnRlciB0byBhbiBlbXB0eSBjYXBhYmlsaXRpeSBzdHJ1Y3R1cmUgICAgICAgICAgICAgICAgKi8KLS8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogUkVUVVJOUzogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgTFZEQkVfU3VjY2VzcyAgICAgICAgICAgICBBbHdheXMgc3VjY2VlZHMgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogTk9URVM6ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgMS4gICAgVGhpcyBmdW5jdGlvbiBtYXkgYmUgaW50ZXJydXB0ZWQgYnkgdGhlIExWREJFX1Byb2Nlc3MgZnVuY3Rpb24gICAgICAgICAgICAgICAgKi8KLS8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0KLUxWREJFX1JldHVyblN0YXR1c19lbiBMVkRCRV9HZXRDYXBhYmlsaXRpZXMoTFZEQkVfSGFuZGxlX3QgICAgICAgICAgICBoSW5zdGFuY2UsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTFZEQkVfQ2FwYWJpbGl0aWVzX3QgICAgKnBDYXBhYmlsaXRpZXMpOwotCi0KLS8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotLyogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiBGVU5DVElPTjogICAgICAgICAgICAgICAgTFZEQkVfQ29udHJvbCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogREVTQ1JJUFRJT046ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgU2V0cyBvciBjaGFuZ2VzIHRoZSBCYXNzIEVuaGFuY2VtZW50IHBhcmFtZXRlcnMuIENoYW5naW5nIHRoZSBwYXJhbWV0ZXJzIHdoaWxlIHRoZSAgKi8KLS8qICBtb2R1bGUgaXMgcHJvY2Vzc2luZyBzaWduYWxzIG1heSBoYXZlIHRoZSBmb2xsb3dpbmcgc2lkZSBlZmZlY3RzOiAgICAgICAgICAgICAgICAgICAqLwotLyogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgR2VuZXJhbCBwYXJhbWV0ZXJzOiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICA9PT09PT09PT09PT09PT09PT09ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogIE9wZXJhdGluZ01vZGU6ICAgICAgQ2hhbmdpbmcgdGhlIG1vZGUgb2Ygb3BlcmF0aW9uIG1heSBjYXVzZSBhIGNoYW5nZSBpbiB2b2x1bWUgICAgICovCi0vKiAgICAgICAgICAgICAgICAgICAgICBsZXZlbC4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogIFNhbXBsZVJhdGU6ICAgICAgICAgQ2hhbmdpbmcgdGhlIHNhbXBsZSByYXRlIG1heSBjYXVzZSBwb3BzIGFuZCBjbGlja3MuICAgICAgICAgICAgICovCi0vKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICBFZmZlY3RMZXZlbDogICAgICAgIENoYW5naW5nIHRoZSBlZmZlY3QgbGV2ZWwgc2V0dGluZyB3aWxsIGhhdmUgbm8gc2lkZSBlZmZlY3RzICAgICAqLwotLyogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgQ2VudHJlRnJlcXVlbmN5OiAgICBDaGFuZ2luZyB0aGUgY2VudHJlIGZyZXF1ZW5jeSBtYXkgY2F1c2UgcG9wcyBhbmQgY2xpY2tzICAgICAgICAgKi8KLS8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogIEhQRlNlbGVjdDogICAgICAgICAgU2VsZWN0aW5nL2RlLXNlbGVjdGluZyB0aGUgaGlnaCBwYXNzIGZpbHRlciBtYXkgY2F1c2UgcG9wcyBhbmQgICovCi0vKiAgICAgICAgICAgICAgICAgICAgICBjbGlja3MgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogIFZvbHVtZWRCICAgICAgICAgICAgQ2hhbmdpbmcgdGhlIHZvbHVtZSBzZXR0aW5nIHdpbGwgaGF2ZSBubyBzaWRlIGVmZmVjdHMgICAgICAgICAgICovCi0vKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogUEFSQU1FVEVSUzogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgaEluc3RhbmNlICAgICAgICAgICAgICAgSW5zdGFuY2UgaGFuZGxlICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICBwUGFyYW1zICAgICAgICAgICAgICAgICBQb2ludGVyIHRvIGEgcGFyYW1ldGVyIHN0cnVjdHVyZSAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiBSRVRVUk5TOiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICBMVkRCRV9TVUNDRVNTICAgICAgICAgICBBbHdheXMgc3VjY2VlZHMgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiBOT1RFUzogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICAxLiAgVGhpcyBmdW5jdGlvbiBtdXN0IG5vdCBiZSBpbnRlcnJ1cHRlZCBieSB0aGUgTFZEQkVfUHJvY2VzcyBmdW5jdGlvbiAgICAgICAgICAgICAqLwotLyogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLQotTFZEQkVfUmV0dXJuU3RhdHVzX2VuIExWREJFX0NvbnRyb2woTFZEQkVfSGFuZGxlX3QgICAgICBoSW5zdGFuY2UsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIExWREJFX1BhcmFtc190ICAgICpwUGFyYW1zKTsKLQotCi0vKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLS8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogRlVOQ1RJT046ICAgICAgICAgICAgICAgICBMVkRCRV9Qcm9jZXNzICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qIERFU0NSSVBUSU9OOiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogIFByb2Nlc3MgZnVuY3Rpb24gZm9yIHRoZSBCYXNzIEVuaGFuY2VtZW50IG1vZHVsZS4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qIFBBUkFNRVRFUlM6ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogIGhJbnN0YW5jZSAgICAgICAgICAgICAgICBJbnN0YW5jZSBoYW5kbGUgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgcEluRGF0YSAgICAgICAgICAgICAgICAgIFBvaW50ZXIgdG8gdGhlIGlucHV0IGRhdGEgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICBwT3V0RGF0YSAgICAgICAgICAgICAgICAgUG9pbnRlciB0byB0aGUgb3V0cHV0IGRhdGEgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogIE51bVNhbXBsZXMgICAgICAgICAgICAgIE51bWJlciBvZiBzYW1wbGVzIGluIHRoZSBpbnB1dCBidWZmZXIgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qIFJFVFVSTlM6ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogIExWREJFX1NVQ0NFU1MgICAgICAgICAgICAgU3VjY2VlZGVkICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgICBMVkRCRV9UT09NQU5ZU0FNUExFUyAgICBOdW1TYW1wbGVzIHdhcyBsYXJnZXIgdGhhbiB0aGUgbWF4aW11bSBibG9jayBzaXplICAgICAgICAgKi8KLS8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogTk9URVM6ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotCi1MVkRCRV9SZXR1cm5TdGF0dXNfZW4gTFZEQkVfUHJvY2VzcyhMVkRCRV9IYW5kbGVfdCAgICAgICAgICBoSW5zdGFuY2UsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb25zdCBMVk1fSU5UMTYgICAgICAqcEluRGF0YSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIExWTV9JTlQxNiAgICAgICAgICAgICpwT3V0RGF0YSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIExWTV9VSU5UMTYgICAgICAgICAgIE51bVNhbXBsZXMpOwotCi0KLSNpZmRlZiBfX2NwbHVzcGx1cwotfQotI2VuZGlmIC8qIF9fY3BsdXNwbHVzICovCi0KLSNlbmRpZiAvKiBfX0xWREJFX0hfXyAqLwpkaWZmIC0tZ2l0IGEvbWVkaWEv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Vuc2UgZm9yIHRoZSBzcGVjaWZpYyBsYW5ndWFnZSBnb3Zlcm5pbmcgcGVybWlzc2lvbnMgYW5kCi0gKiBsaW1pdGF0aW9ucyB1bmRlciB0aGUgTGljZW5zZS4KLSAqLwotCi0jaWZuZGVmIF9fTFZEQkVfQ09FRkZTX0hfXwotI2RlZmluZSBfX0xWREJFX0NPRUZGU19IX18KLQotCi0vKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotLyogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qIEdlbmVyYWwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLQotI2RlZmluZSBMVkRCRV9TQ0FMRVNISUZUICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMTAgICAgICAgICAvKiBBcyBhIHBvd2VyIG9mIDIgKi8KLQotCi0vKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotLyogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qIEhpZ2ggUGFzcyBGaWx0ZXIgY29lZmZpY2llbnRzICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLQotIC8qIENvZWZmaWNpZW50cyBmb3IgY2VudHJlIGZyZXF1ZW5jeSA1NUh6ICovCi0jZGVmaW5lIEhQRl9GczgwMDBfRmM1NV9BMCAgICAgICAgICAgICAgICAgICAgICAgICAxMDI5NTU2MzI4ICAgICAgICAgLyogRmxvYXRpbmcgcG9pbnQgdmFsdWUgMC45NTg4NDkgKi8KLSNkZWZpbmUgSFBGX0ZzODAwMF9GYzU1X0ExICAgICAgICAgICAgICAgICAgICAgICAgLTIwNTkxMTI2NTUgICAgICAgICAvKiBGbG9hdGluZyBwb2ludCB2YWx1ZSAtMS45MTc2OTggKi8KLSNkZWZpbmUgSFBGX0ZzODAwMF9GYzU1X0EyICAgICAgICAgICAgICAgICAgICAgICAgIDEwMjk1NTYzMjggICAgICAgICAvKiBGbG9hdGluZyBwb2ludCB2YWx1ZSAwLjk1ODg0OSAqLwotI2RlZmluZSBIUEZfRnM4MDAwX0ZjNTVfQjEgICAgICAgICAgICAgICAgICAgICAgICAtMjA4MTk4NjM3NSAgICAgICAgIC8qIEZsb2F0aW5nIHBvaW50IHZhbHVlIC0xLjkzOTAwMSAqLwotI2RlZmluZSBIUEZfRnM4MDAwX0ZjNTVfQjIgICAgICAgICAgICAgICAgICAgICAgICAgMTAxMDE4MzkxNCAgICAgICAgIC8qIEZsb2F0aW5nIHBvaW50IHZhbHVlIDAuOTQwODA3ICovCi0jZGVmaW5lIEhQRl9GczExMDI1X0ZjNTVfQTAgICAgICAgICAgICAgICAgICAgICAgICAxMDM4MjEwODMxICAgICAgICAgLyogRmxvYXRpbmcgcG9pbnQgdmFsdWUgM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RmM5MF9BMSAgICAgICAgICAgICAgICAgICAgICAgLTIxMDUzMTEyMzggICAgICAgICAvKiBGbG9hdGluZyBwb2ludCB2YWx1ZSAtMS45NjA3MjQgKi8KLSNkZWZpbmUgSFBGX0ZzNDgwMDBfRmM5MF9BMiAgICAgICAgICAgICAgICAgICAgICAgIDEwNTI2NTU2MTkgICAgICAgICAvKiBGbG9hdGluZyBwb2ludCB2YWx1ZSAwLjk4MDM2MiAqLwotI2RlZmluZSBIUEZfRnM0ODAwMF9GYzkwX0IxICAgICAgICAgICAgICAgICAgICAgICAtMjEyOTYxNTg3MSAgICAgICAgIC8qIEZsb2F0aW5nIHBvaW50IHZhbHVlIC0xLjk4MzM1OSAqLwotI2RlZmluZSBIUEZfRnM0ODAwMF9GYzkwX0IyICAgICAgICAgICAgICAgICAgICAgICAgMTA1NjAyMTQ5MiAgICAgICAgIC8qIEZsb2F0aW5nIHBvaW50IHZhbHVlIDAuOTgzNDk3ICovCi0KLQotLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLS8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiBCYW5kIFBhc3MgRmlsdGVyIGNvZWZmaWNpZW50cyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0KLSAvKiBDb2VmZmljaWVudHMgZm9yIGNlbnRyZSBmcmVxdWVuY3kgNTVIeiAqLwotI2RlZmluZSBCUEZfRnM4MDAwX0ZjNTVfQTAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOTg3NTI0NyAgICAgICAgIC8qIEZsb2F0aW5nIHBvaW50IHZhbHVlIDAuMDA5MTk3ICovCi0jZGVmaW5lIEJQRl9GczgwMDBfRmM1NV9BMSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAwICAgICAgICAgLyogRmxvYXRpbmcgcG9pbnQgdmFsdWUgMC4wMDAwMDAgKi8KLSNkZWZpbmUgQlBGX0ZzODAwMF9GYzU1X0EyICAgICAgICAgICAgICAgICAgICAgICAgICAgLTk4NzUyNDcgICAgICAgICAvKiBGbG9hdGluZyBwb2ludCB2YWx1ZSAtMC4wMDkxOTcgKi8KLSNkZWZpbmUgQlBGX0ZzODAwMF9GYzU1X0IxICAgICAgICAgICAgICAgICAgICAgICAgLTIxMjU1MTk4MzAgICAgICAgICAvKiBGbG9hdGluZyBwb2ludCB2YWx1ZSAtMS45Nzk1NDUgKi8KLSNkZWZpbmUgQlBGX0ZzODAwMF9GYzU1X0IyICAgICAgICAgICAgICAgICAgICAgICAgIDEwNTM3NjI2MjkgICAgICAgICAvKiBGbG9hdGluZyBwb2ludCB2YWx1ZSAwLjk4MTM5MyAqLwotI2RlZmluZSBCUEZfRnMxMTAyNV9GYzU1X0EwICAgICAgICAgICAgICAgICAgICAgICAgICAgNzE4Mzk1MiAgICAgICAgIC8qIEZsb2F0aW5nIHBvaW50IHZhbHVlIDAuMDA2NjkxICovCi0jZGVmaW5lIEJQRl9GczExMDI1X0ZjNTVfQTEgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAwICAgICAgICAgLyogRmxvYXRpbmcgcG9pbnQgdmFsdWUgMC4wMDAwMDAgKi8KLSNkZWZpbmUgQlBGX0ZzMTEwMjVfRmM1NV9BMiAgICAgICAgICAgICAgICAgICAgICAgICAgLTcxODM5NTIgICAgICAgICAvKiBGbG9hdGluZyBwb2ludCB2YWx1ZSAtMC4wMDY2O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MiAgICAgICAgICAgICAgICAgICAgICAgIDEwNzAwODk3NzAgICAgICAgICAvKiBGbG9hdGluZyBwb2ludCB2YWx1ZSAwLjk5NjU5OSAqLwotI2RlZmluZSBCUEZfRnM0ODAwMF9GYzU1X0EwICAgICAgICAgICAgICAgICAgICAgICAgICAgMTY1ODY4NyAgICAgICAgIC8qIEZsb2F0aW5nIHBvaW50IHZhbHVlIDAuMDAxNTQ1ICovCi0jZGVmaW5lIEJQRl9GczQ4MDAwX0ZjNTVfQTEgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAwICAgICAgICAgLyogRmxvYXRpbmcgcG9pbnQgdmFsdWUgMC4wMDAwMDAgKi8KLSNkZWZpbmUgQlBGX0ZzNDgwMDBfRmM1NV9BMiAgICAgICAgICAgICAgICAgICAgICAgICAgLTE2NTg2ODcgICAgICAgICAvKiBGbG9hdGluZyBwb2ludCB2YWx1ZSAtMC4wMDE1NDUgKi8KLSNkZWZpbmUgQlBGX0ZzNDgwMDBfRmM1NV9CMSAgICAgICAgICAgICAgICAgICAgICAgLTIxNDQwNzIyOTIgICAgICAgICAvKiBGbG9hdGluZyBwb2ludCB2YWx1ZSAtMS45OTY4MjMgKi8KLSNkZWZpbmUgQlBGX0ZzNDgwMDBfRmM1NV9CMiAgICAgICAgICAgICAgICAgICAgICAgIDEwNzAzODYwMzYgICAgICAgICAvKiBGbG9hdGluZyBwb2ludCB2YWx1ZSAwLjk5Njg3NSAqLwotCi0gLyogQ29lZmZpY2llbnRzIGZvciBjZW50cmUgZnJlcXVlbmN5IDY2SHogKi8KLSNkZWZpbmUgQlBGX0ZzODAwMF9GYzY2X0EwICAgICAgICAgICAgICAgICAgICAgICAgICAgMTM1ODAxODkgICAgICAgICAvKiBGbG9hdGluZyBwb2ludCB2YWx1ZSAwLjAxMjY0OCAqLwotI2RlZmluZSBCUEZfRnM4MDAwX0ZjNjZfQTEgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMCAgICAgICAgIC8qIEZ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M2Nl9BMCAgICAgICAgICAgICAgICAgICAgICAgICAgIDQ1NjU0NDUgICAgICAgICAvKiBGbG9hdGluZyBwb2ludCB2YWx1ZSAwLjAwNDI1MiAqLwotI2RlZmluZSBCUEZfRnMyNDAwMF9GYzY2X0ExICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMCAgICAgICAgIC8qIEZsb2F0aW5nIHBvaW50IHZhbHVlIDAuMDAwMDAwICovCi0jZGVmaW5lIEJQRl9GczI0MDAwX0ZjNjZfQTIgICAgICAgICAgICAgICAgICAgICAgICAgIC00NTY1NDQ1ICAgICAgICAgLyogRmxvYXRpbmcgcG9pbnQgdmFsdWUgLTAuMDA0MjUyICovCi0jZGVmaW5lIEJQRl9GczI0MDAwX0ZjNjZfQjEgICAgICAgICAgICAgICAgICAgICAgIC0yMTM3OTI3ODQyICAgICAgICAgLyogRmxvYXRpbmcgcG9pbnQgdmFsdWUgLTEuOTkxMTAwICovCi0jZGVmaW5lIEJQRl9GczI0MDAwX0ZjNjZfQjIgICAgICAgICAgICAgICAgICAgICAgICAxMDY0NTA1MjAyICAgICAgICAgLyogRmxvYXRpbmcgcG9pbnQgdmFsdWUgMC45OTEzOTggKi8KLSNkZWZpbmUgQlBGX0ZzMzIwMDBfRmM2Nl9BMCAgICAgICAgICAgICAgICAgICAgICAgICAgIDM0Mjc3NjEgICAgICAgICAvKiBGbG9hdGluZyBwb2ludCB2YWx1ZSAwLjAwMzE5MiAqLwotI2RlZmluZSBCUEZfRnMzMjAwMF9GYzY2X0ExICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMCAgICAgICAgIC8qIEZsb2F0aW5nIHBvaW50IHZhbHVlIDAuMDAwMDAwICovCi0jZGVmaW5lIEJQRl9GczMyMDAwX0ZjNjZfQTIgICAgICAgICAgICAgICAgICAgICAgICAgIC0zNDI3NzYxICAgICAgICAgLyogRmxvYXRpbmcgcG9pbnQgdmFsdWUgLTAuMDAzMTkyICovCi0jZGVmaW5lIEJQRl9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SAqLwotI2RlZmluZSBCUEZfRnM0ODAwMF9GYzY2X0ExICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMCAgICAgICAgIC8qIEZsb2F0aW5nIHBvaW50IHZhbHVlIDAuMDAwMDAwICovCi0jZGVmaW5lIEJQRl9GczQ4MDAwX0ZjNjZfQTIgICAgICAgICAgICAgICAgICAgICAgICAgIC0yMjg3NjMyICAgICAgICAgLyogRmxvYXRpbmcgcG9pbnQgdmFsdWUgLTAuMDAyMTMxICovCi0jZGVmaW5lIEJQRl9GczQ4MDAwX0ZjNjZfQjEgICAgICAgICAgICAgICAgICAgICAgIC0yMTQyNzc1NDM2ICAgICAgICAgLyogRmxvYXRpbmcgcG9pbnQgdmFsdWUgLTEuOTk1NjE1ICovCi0jZGVmaW5lIEJQRl9GczQ4MDAwX0ZjNjZfQjIgICAgICAgICAgICAgICAgICAgICAgICAxMDY5MTEzNTgxICAgICAgICAgLyogRmxvYXRpbmcgcG9pbnQgdmFsdWUgMC45OTU2OTAgKi8KLQotIC8qIENvZWZmaWNpZW50cyBmb3IgY2VudHJlIGZyZXF1ZW5jeSA3OEh6ICovCi0jZGVmaW5lIEJQRl9GczgwMDBfRmM3OF9BMCAgICAgICAgICAgICAgICAgICAgICAgICAgIDE5OTQxMTgwICAgICAgICAgLyogRmxvYXRpbmcgcG9pbnQgdmFsdWUgMC4wMTg1NzIgKi8KLSNkZWZpbmUgQlBGX0ZzODAwMF9GYzc4X0ExICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDAgICAgICAgICAvKiBGbG9hdGluZyBwb2ludCB2YWx1ZSAwLjAwMDAwMCAqLwotI2RlZmluZSBCUEZfRnM4MDAwX0ZjNzhfQTIgICAgICAgICAgICAgICAgICAgICAgICAgIC0xOTk0MTE4MCAgICAgICAgIC8qIEZsb2F0aW5nIHBvaW50IHZhbHVlIC0wLjAxODU3MiAqLwotI2RlZmluZSBCUEZfRnM4MDAwX0ZjNzhfQjEgICAgICAgICAgICAg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mM3OF9BMSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDAgICAgICAgICAvKiBGbG9hdGluZyBwb2ludCB2YWx1ZSAwLjAwMDAwMCAqLwotI2RlZmluZSBCUEZfRnMxMjAwMF9GYzc4X0EyICAgICAgICAgICAgICAgICAgICAgICAgIC0xMzM3Njk5OSAgICAgICAgIC8qIEZsb2F0aW5nIHBvaW50IHZhbHVlIC0wLjAxMjQ1OCAqLwotI2RlZmluZSBCUEZfRnMxMjAwMF9GYzc4X0IxICAgICAgICAgICAgICAgICAgICAgICAtMjExODY1MTcwOCAgICAgICAgIC8qIEZsb2F0aW5nIHBvaW50IHZhbHVlIC0xLjk3MzE0OCAqLwotI2RlZmluZSBCUEZfRnMxMjAwMF9GYzc4X0IyICAgICAgICAgICAgICAgICAgICAgICAgMTA0NjY3ODAyOSAgICAgICAgIC8qIEZsb2F0aW5nIHBvaW50IHZhbHVlIDAuOTc0Nzk1ICovCi0jZGVmaW5lIEJQRl9GczE2MDAwX0ZjNzhfQTAgICAgICAgICAgICAgICAgICAgICAgICAgIDEwMDY0MjIyICAgICAgICAgLyogRmxvYXRpbmcgcG9pbnQgdmFsdWUgMC4wMDkzNzMgKi8KLSNkZWZpbmUgQlBGX0ZzMTYwMDBfRmM3OF9BMSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDAgICAgICAgICAvKiBGbG9hdGluZyBwb2ludCB2YWx1ZSAwLjAwMDAwMCAqLwotI2RlZmluZSBCUEZfRnMxNjAwMF9GYzc4X0EyICAgICAgICAgICAgICAgICAgICAgICAgIC0xMDA2NDIyMiAgICAgICAgIC8qIEZsb2F0aW5nIHBvaW50IHZhbHVlIC0wLjAwOTM3MyAqLwotI2RlZmluZSBCUEZfRnMxNjAwMF9GYzc4X0IxICAgICAgICAgICAgICAgICAgICAgICAtMjEyNjEyNDM0MiAgICAgICAgIC8qIEZsb2F0aW5nIHBvaW50IHZhbHVlIC0xLjk4MDEwOCAqLwotI2RlZmluZSBCUEZfRnMxNjAwMF9GYzc4X0IyICAgICAgICAgICAgICAgICAgICAgICAgMTA1MzM4MDMwNCAgICAgICAgIC8qIEZsb2F0aW5nIHBvaW50IHZhbHVlIDAuOTgxMDM3ICovCi0jZGVmaW5lIEJQRl9GczIyMDUwX0ZjNzhfQTAgICAgICAgICAgICAgICAgICAgICAgICAgICA3MzIxNzgwICAgICAgICAgLyogRmxvYXRpbmcgcG9pbnQgdmFsdWUgMC4wMDY4MTkgKi8KLSNkZWZpbmUgQlBGX0ZzMjIwNTBfRmM3OF9BMSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDAgICAgICAgICAvKiBGbG9hdGluZyBwb2ludCB2YWx1ZSAwLjAwMDAwMCAqLwotI2RlZmluZSBCUEZfRnMyMjA1MF9GYzc4X0EyICAgICAgICAgICAgICAgICAgICAgICAgICAtNzMyMTc4MCAgICAgICAgIC8qIEZsb2F0aW5nIHBvaW50IHZhbHVlIC0wLjAwNjgxOSAqLwotI2RlZmluZSBCUEZfRnMyMjA1MF9GYzc4X0IxICAgICAgICAgICAgICAgICAgICAgICAtMjEzMjE0Mzc3MSAgICAgICAgIC8qIEZsb2F0aW5nIHBvaW50IHZhbHVlIC0xLjk4NTcxNCAqLwotI2RlZmluZSBCUEZfRnMyMjA1MF9GYzc4X0IyICAgICAgICAgICAgICAgICAgICAgICAgMTA1ODkyODcwMCAgICAgICAgIC8qIEZsb2F0aW5nIHBvaW50IHZhbHVlIDAuOTg2MjA0ICovCi0jZGVmaW5lIEJQRl9GczI0MDAwX0ZjNzhfQTAgICAgICAgICAgICAgICAgICAgICAgICAgICA2NzMwNjQwICAgICAgICAgLyogRmxvYXRpbmcgcG9pbnQgdmFsdWUgMC4wMDYyNjggKi8KLSNkZWZpbmUgQlBGX0ZzMjQwMDBfRmM3OF9BMSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDAgICAgICAgICAvKiBGbG9hdGluZyBwb2ludCB2YWx1ZSAwLjAwMDAwMCAqLwotI2RlZmluZSBCUEZfRnMyNDAwMF9GYzc4X0EyICAgICAgICAgICAgICAgICAgICAgICAgICAtNjczMDY0MCAgICAgICAgIC8qIEZsb2F0aW5nIHBvaW50IHZhbHVlIC0wLjAwNjI2OCAqLwotI2RlZmluZSBCUEZfRnMyNDAwMF9GYzc4X0IxICAgICAgICAgICAgICAgICAgICAgICAtMjEzMzQyMTYwNyAgICAgICAgIC8qIEZsb2F0aW5nIHBvaW50IHZhbHVlIC0xLjk4NjkwNCAqLwotI2RlZmluZSBCUEZfRnMyNDAwMF9GYzc4X0IyICAgICAgICAgICAgICAgICAgICAgICAgMTA2MDEyNDY2OSAgICAgICAgIC8qIEZsb2F0aW5nIHBvaW50IHZhbHVlIDAuOTg3MzE4ICovCi0jZGVmaW5lIEJQRl9GczMyMDAwX0ZjNzhfQTAgICAgICAgICAgICAgICAgICAgICAgICAgICA1MDU1OTY1ICAgICAgICAgLyogRmxvYXRpbmcgcG9pbnQgdmFsdWUgMC4wMDQ3MDkgKi8KLSNkZWZpbmUgQlBGX0ZzMzIwMDBfRmM3OF9BMSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDAgICAgICAgICAvKiBGbG9hdGluZyBwb2ludCB2YWx1ZSAwLjAwMDAwMCAqLwotI2RlZmluZSBCUEZfRnMzMjAwMF9GYzc4X0EyICAgICAgICAgICAgICAgICAgICAgICAgICAtNTA1NTk2NSAgICAgICAgIC8qIEZsb2F0aW5nIHBvaW50IHZhbHVlIC0wLjAwNDcwOSAqLwotI2RlZmluZSBCUEZfRnMzMjAwMF9GYzc4X0IxICAgICAgICAgICAgICAgICAgICAgICAtMjEzNzAwMzk3NyAgICAgICAgIC8qIEZsb2F0aW5nIHBvaW50IHZhbHVlIC0xLjk5MDI0MCAqLwotI2RlZmluZSBCUEZfRnMzMjAwMF9GYzc4X0IyICAgICAgICAgICAgICAgICAgICAgICAgMTA2MzUxMjgwMiAgICAgICAgIC8qIEZsb2F0aW5nIHBvaW50IHZhbHVlIDAuOTkwNDczICovCi0jZGVmaW5lIEJQRl9GczQ0MTAwX0ZjNzhfQTAgICAgICAgICAgICAgICAgICAgICAgICAgICAzNjczNTE2ICAgICAgICAgLyogRmxvYXRpbmcgcG9pbnQgdmFsdWUgMC4wMDM0MjEgKi8KLSNkZWZpbmUgQlBGX0ZzNDQxMDBfRmM3OF9BMSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDAgICAgICAgICAvKiBGbG9hdGluZyBwb2ludCB2YWx1ZSAwLjAwMDAwMCAqLwotI2RlZmluZSBCUEZfRnM0NDEwMF9GYzc4X0EyICAgICAgICAgICAgICAgICAgICAgICAgICAtMzY3MzUxNiAgICAgICAgIC8qIEZsb2F0aW5nIHBvaW50IHZhbHVlIC0wLjAwMzQyMSAqLwotI2RlZmluZSBCUEZfRnM0NDEwMF9GYzc4X0IxICAgICAgICAgICAgICAgICAgICAgICAtMjEzOTkxOTM5NCAgICAgICAgIC8qIEZsb2F0aW5nIHBvaW50IHZhbHVlIC0xLjk5Mjk1NSAqLwotI2RlZmluZSBCUEZfRnM0NDEwMF9GYzc4X0IyICAgICAgICAgICAgICAgICAgICAgICAgMTA2NjMwOTcxOCAgICAgICAgIC8qIEZsb2F0aW5nIHBvaW50IHZhbHVlIDAuOTkzMDc4ICovCi0jZGVmaW5lIEJQRl9GczQ4MDAwX0ZjNzhfQTAgICAgICAgICAgICAgICAgICAgICAgICAgICAzMzc1OTkwICAgICAgICAgLyogRmxvYXRpbmcgcG9pbnQgdmFsdWUgMC4wMDMxNDQgKi8KLSNkZWZpbmUgQlBGX0ZzNDgwMDBfRmM3OF9BMSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDAgICAgICAgICAvKiBGbG9hdGluZyBwb2ludCB2YWx1ZSAwLjAwMDAwMCAqLwotI2RlZmluZSBCUEZfRnM0ODAwMF9GYzc4X0EyICAgICAgICAgICAgICAgICAgICAgICAgICAtMzM3NTk5MCAgICAgICAgIC8qIEZsb2F0aW5nIH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AgICAgICAgICAgICAgICAgIDEwNjUzNDE2MjAgICAgICAgICAvKiBGbG9hdGluZyBwb2ludCB2YWx1ZSAwLjk5MjE3NyAqLwotCi0KLS8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0vKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogQXV0b21hdGljIEdhaW4gQ29udHJvbCB0aW1lIGNvbnN0YW50cyBhbmQgZ2FpbiBzZXR0aW5ncyAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotCi0vKiBBR0MgVGltZSBjb25zdGFudHMgKi8KLSNkZWZpbmUgQUdDX0FUVEFDS19GczgwMDAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMjc1NzEgICAgICAgICAvKiBGbG9hdGluZyBwb2ludCB2YWx1ZSAwLjg0MTM5NSAqLwotI2RlZmluZSBBR0NfQVRUQUNLX0ZzMTEwMjUgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAyODkwOSAgICAgICAgIC8qIEZsb2F0aW5nIHBvaW50IHZhbHVlIDAuODgyMjIzICovCi0jZGVmaW5lIEFHQ19BVFRBQ0tfRnMxMjAwMCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDI5MjA1ICAgICAgICAgLyogRmxvYXRpbmcgcG9pbnQgdmFsdWUgMC44OTEyNTEgKi8KLSNkZWZpbmUgQUdDX0FUVEFDS19GczE2MDAwICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMzAwNTcgICAgICAgICAvKiBGbG9hdGluZyBwb2ludCB2YWx1ZSAwLjkxNzI3NiAqLwotI2RlZmluZSBBR0NfQVRUQUNLX0ZzMjIwNTAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAzMDc3OCAgICAgICAgIC8qIEZsb2F0aW5nIHBvaW50IHZhbHVlIDAuOTM5MjY3ICovCi0jZGVmaW5lIEFHQ19BVFRBQ0tfRnMyNDAwMCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDMwOTM1ICAgICAgICAgLyogRmxvYXRpbmcgcG9pbnQgdmFsdWUgMC45NDQwNjEgKi8KLSNkZWZpbmUgQUdDX0FUVEFDS19GczMyMDAwICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMzEzODMgICAgICAgICAvKiBGbG9hdGluZyBwb2ludCB2YWx1ZSAwLjk1Nzc0NSAqLwotI2RlZmluZSBBR0NfQVRUQUNLX0ZzNDQxMDAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAzMTc1NyAgICAgICAgIC8qIEZsb2F0aW5nIHBvaW50IHZhbHVlIDAuOTY5MTU4ICovCi0jZGVmaW5lIEFHQ19BVFRBQ0tfRnM0ODAwMCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDMxODM4ICAgICAgICAgLyogRmxvYXRpbmcgcG9pbnQgdmFsdWUgMC45NzE2MjggKi8KLSNkZWZpbmUgREVDQVlfU0hJRlQgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMTAgICAgICAgICAvKiBBcyBhIHBvd2VyIG9mIDIgKi8KLSNkZWZpbmUgQUdDX0RFQ0FZX0ZzODAwMCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgNDQgICAgICAgICAvKiBGbG9hdGluZyBwb2ludCB2YWx1ZSAwLjAwMDA0MiAqLwotI2RlZmluZSBBR0NfREVDQVlfRnMxMTAyNSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAzMiAgICAgICAgIC8qIEZsb2F0aW5nIHBvaW50IHZhbHVlIDAuMDAwMDMwICovCi0jZGVmaW5lIEFHQ19ERUNBWV9GczEyMDAwICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDI5ICAgICAgICAgLyogRmxvYXRpbmcgcG9pbnQgdmFsdWUgMC4wMDAwMjggKi8KLSNkZWZpbmUgQUdDX0RFQ0FZX0ZzMTYwMDAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMjIgICAgICAgICAvKiBGbG9hdGluZyBwb2ludCB2YWx1ZSAwLjAwMDAyMSAqLwotI2RlZmluZSBBR0NfREVDQVlfRnMyMjA1MCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAxNiAgICAgICAgIC8qIEZsb2F0aW5nIHBvaW50IHZhbHVlIDAuMDAwMDE1ICovCi0jZGVmaW5lIEFHQ19ERUNBWV9GczI0MDAwICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDE1ICAgICAgICAgLyogRmxvYXRpbmcgcG9pbnQgdmFsdWUgMC4wMDAwMTQgKi8KLSNkZWZpbmUgQUdDX0RFQ0FZX0ZzMzIwMDAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMTEgICAgICAgICAvKiBGbG9hdGluZyBwb2ludCB2YWx1ZSAwLjAwMDAxMCAqLwotI2RlZmluZSBBR0NfREVDQVlfRnM0NDEwMCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOCAgICAgICAgIC8qIEZsb2F0aW5nIHBvaW50IHZhbHVlIDAuMDAwMDA4ICovCi0jZGVmaW5lIEFHQ19ERUNBWV9GczQ4MDAwICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA3ICAgICAgICAgLyogRmxvYXRpbmcgcG9pbnQgdmFsdWUgMC4wMDAwMDcgKi8KLQotLyogQUdDIEdhaW4gc2V0dGluZ3MgKi8KLSNkZWZpbmUgQUdDX0dBSU5fU0NBTEUgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMzEgICAgICAgICAvKiBBcyBhIHBvd2VyIG9mIDIgKi8KLSNkZWZpbmUgQUdDX0dBSU5fU0hJRlQgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDQgICAgICAgICAvKiBBcyBhIHBvd2VyIG9mIDIgKi8KLSNkZWZpbmUgQUdDX1RBUkdFVExFVkVMICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMzMxNzAzMzcgICAgICAgICAvKiBGbG9hdGluZyBwb2ludCB2YWx1ZSAtMC4xMDAwMDBkQiAqLwotI2RlZmluZSBBR0NfSFBGR0FJTl8wZEIgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDExMDczOTcwNCAgICAgICAgIC8qIEZsb2F0aW5nIHBvaW50IHZhbHVlIDAuNDEyNTM4ICovCi0jZGVmaW5lIEFHQ19HQUlOXzBkQiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAwICAgICAgICAgLyogRmxvYXRpbmcgcG9pbnQgdmFsdWUgMC4wMDAwMDAgKi8KLSNkZWZpbmUgQUdDX0hQRkdBSU5fMWRCICAgICAgICAgICAgICAgICAgICAgICAgICAgICAxNTcwMDYwNzEgICAgICAgICAvKiBGbG9hdGluZyBwb2ludCB2YWx1ZSAwLjU4NDg5MyAqLwotI2RlZmluZSBBR0NfR0FJTl8xZEIgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAzMjc1NDA3OSAgICAgICAgIC8qIEZsb2F0aW5nIHBvaW50IHZhbHVlIDAuMTIyMDE4ICovCi0jZGVmaW5lIEFHQ19IUEZHQUlOXzJkQiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMjA4OTE3Nzg4ICAgICAgICAgLyogRmxvYXRpbmcgcG9pbnQgdmFsdWUgMC43NzgyNzkgKi8KLSNkZWZpbmUgQUdDX0dBSU5fMmRCICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgNjk1MDQ3NjEgICAgICAgICAvKiBGbG9hdGluZyBwb2ludCB2YWx1ZSAwLjI1ODkyNSAqLwotI2RlZmluZSBBR0NfSFBGR0FJTl8zZEIgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDI2NzE2MzY5MyAgICAgICAgIC8qIEZsb2F0aW5nIHBvaW50IHZhbHVlIDAuOTk1MjYyICovCi0jZGVmaW5lIEFHQ19HQUlOXzNkQiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMTEwNzM5NzA0ICAgICAgICAgLyogRmxvYXRpbmcgcG9pbnQgdmFsdWUgMC40MTI1MzggKi8KLSNkZWZpbmUgQUdDX0hQRkdBSU5fNGRCICAgICAgICAgICAgICAgICAgICAgICAgICAgICAzMzI1MTY2NzQgICAgICAgICAvKiBGbG9hdGluZyBwb2ludCB2YWx1ZSAxLjIzODcyMSAqLwotI2RlZmluZSBBR0NfR0FJTl80ZEIgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDE1NzAwNjA3MSAgICAgICAgIC8qIEZsb2F0aW5nIHBvaW50IHZhbHVlIDAuNTg0ODkzICovCi0jZGVmaW5lIEFHQ19IUEZHQUlOXzVkQiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgNDA1ODQzOTI0ICAgICAgICAgLyogRmxvYXRpbmcgcG9pbnQgdmFsdWUgMS41MTE4ODYgKi8KLSNkZWZpbmUgQUdDX0dBSU5fNWRCICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAyMDg5MTc3ODggICAgICAgICAvKiBGbG9hdGluZyBwb2ludCB2YWx1ZSAwLjc3ODI3OSAqLwotI2RlZmluZSBBR0NfSFBGR0FJTl82ZEIgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDQ4ODExODQ1MSAgICAgICAgIC8qIEZsb2F0aW5nIHBvaW50IHZhbHVlIDEuODE4MzgzICovCi0jZGVmaW5lIEFHQ19HQUlOXzZkQiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMjY3MTYzNjkzICAgICAgICAgLyogRmxvYXRpbmcgcG9pbnQgdmFsdWUgMC45OTUyNjIgKi8KLSNkZWZpbmUgQUdDX0hQRkdBSU5fN2RCICAgICAgICAgICAgICAgICAgICAgICAgICAgICA1ODA0MzE5OTAgICAgICAgICAvKiBGbG9hdGluZyBwb2ludCB2YWx1ZSAyLjE2MjI3OCAqLwotI2RlZmluZSBBR0NfR0FJTl83ZEIgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDMzMjUxNjY3NCAgICAgICAgIC8qIEZsb2F0aW5nIHBvaW50IHZhbHVlIDEuMjM4NzIxICovCi0jZGVmaW5lIEFHQ19IUEZHQUlOXzhkQiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgNjg0MDA5NDgzICAgICAgICAgLyogRmxvYXRpbmcgcG9pbnQgdmFsdWUgMi41NDgxMzQgKi8KLSNkZWZpbmUgQUdDX0dBSU5fOGRCICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA0MDU4NDM5MjQgICAgICAgICAvKiBGbG9hdGluZyBwb2ludCB2YWx1ZSAxLjUxMTg4NiAqLwotI2RlZmluZSBBR0NfSFBGR0FJTl85ZEIgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDgwMDIyNTM0MyAgICAgICAgIC8qIEZsb2F0aW5nIHBvaW50IHZhbHVlIDIuOTgxMDcyICovCi0jZGVmaW5lIEFHQ19HQUlOXzlkQiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgNDg4MTE4NDUxICAgICAgICAgLyogRmxvYXRpbmcgcG9pbnQgdmFsdWUgMS44MTgzODMgKi8KLSNkZWZpbmUgQUdDX0hQRkdBSU5fMTBkQiAgICAgICAgICAgICAgICAgICAgICAgICAgICA5MzA2MjE2ODEgICAgICAgICAvKiBGbG9hdGluZyBwb2ludCB2YWx1ZSAzLjQ2NjgzNiAqLwotI2RlZmluZSBBR0NfR0FJTl8xMGRCICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDU4MDQzMTk5MCAgICAgICAgIC8qIEZsb2F0aW5nIHBvaW50IHZhbHVlIDIuMTYyMjc4ICovCi0jZGVmaW5lIEFHQ19IUEZHQUlOXzExZEIgICAgICAgICAgICAgICAgICAgICAgICAgICAxMDc2OTI4NzgwICAgICAgICAgLyogRmxvYXRpbmcgcG9pbnQgdmFsdWUgNC4wMTE4NzIgKi8KLSNkZWZpbmUgQUdDX0dBSU5fMTFkQiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA2ODQwMDk0ODMgICAgICAgICAvKiBGbG9hdGluZyBwb2ludCB2YWx1ZSAyLjU0ODEzNCAqLwotI2RlZmluZSBBR0NfSFBGR0FJTl8xMmRCICAgICAgICAgICAgICAgICAgICAgICAgICAgMTI0MTA4ODA0NSAgICAgICAgIC8qIEZsb2F0aW5nIHBvaW50IHZhbHVlIDQuNjIzNDEzICovCi0jZGVmaW5lIEFHQ19HQUlOXzEyZEIgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgODAwMjI1MzQzICAgICAgICAgLyogRmxvYXRpbmcgcG9pbnQgdmFsdWUgMi45ODEwNzIgKi8KLSNkZWZpbmUgQUdDX0hQRkdBSU5fMTNkQiAgICAgICAgICAgICAgICAgICAgICAgICAgIDE0MjUyNzc3NjkgICAgICAgICAvKiBGbG9hdGluZyBwb2ludCB2YWx1ZSA1LjMwOTU3MyAqLwotI2RlZmluZSBBR0NfR0FJTl8xM2RCICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDkzMDYyMTY4MSAgICAgICAgIC8qIEZsb2F0aW5nIHBvaW50IHZhbHVlIDMuNDY2ODM2ICovCi0jZGVmaW5lIEFHQ19IUEZHQUlOXzE0ZEIgICAgICAgICAgICAgICAgICAgICAgICAgICAxNjMxOTQyMDM5ICAgICAgICAgLyogRmxvYXRpbmcgcG9pbnQgdmFsdWUgNi4wNzk0NTggKi8KLSNkZWZpbmUgQUdDX0dBSU5fMTRkQiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDEwNzY5Mjg3ODAgICAgICAgICAvKiBGbG9hdGluZyBwb2ludCB2YWx1ZSA0LjAxMTg3MiAqLwotI2RlZmluZSBBR0NfSFBGR0FJTl8xNWRCICAgICAgICAgICAgICAgICAgICAgICAgICAgMTg2MzgyMzE2MyAgICAgICAgIC8qIEZsb2F0aW5nIHBvaW50IHZhbHVlIDYuOTQzMjgyICovCi0jZGVmaW5lIEFHQ19HQUlOXzE1ZEIgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAxMjQxMDg4MDQ1ICAgICAgICAgLyogRmxvYXRpbmcgcG9pbnQgdmFsdWUgNC42MjM0MTMgKi8KLQotCi0vKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotLyogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qIFZvbHVtZSBjb250cm9sICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLQotLyogVm9sdW1lIGNvbnRyb2wgZ2FpbiAqLwotI2RlZmluZSBWT0xVTUVfTUFYICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMCAgICAgICAgIC8qIEluIGRCcyAqLwotI2RlZmluZSBWT0xVTUVfU0hJRlQgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMCAgICAgICAgIC8qIEluIGRCcyAqLwotCi0vKiBWb2x1bWUgY29udHJvbCB0aW1lIGNvbnN0YW50cyAqLwotI2RlZmluZSBWT0xfVENfU0hJRlQgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAyMSAgICAgICAgIC8qIEFzIGEgcG93ZXIgb2YgMiAqLwotI2RlZmluZSBWT0xfVENfRnM4MDAwICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAyNTg4OSAgICAgICAgIC8qIEZsb2F0aW5nIHBvaW50IHZhbHVlIDAuMDI0NjkwICovCi0jZGVmaW5lIFZPTF9UQ19GczExMDI1ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDE4ODUwICAgICAgICAgLyogRmxvYXRpbmcgcG9pbnQgdmFsdWUgMC4wMTc5NzcgKi8KLSNkZWZpbmUgVk9MX1RDX0ZzMTIwMDAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMTczMzEgICAgICAgICAvKiBGbG9hdGluZyBwb2ludCB2YWx1ZSAwLjAxNjUyOSAqLwotI2RlZmluZSBWT0xfVENfRnMxNjAwMCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAxMzAyNiAgICAgICAgIC8qIEZsb2F0aW5nIHBvaW50IHZhbHVlIDAuMDEyNDIyICovCi0jZGVmaW5lIFZPTF9UQ19GczIyMDUwICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA5NDY4ICAgICAgICAgLyogRmxvYXRpbmcgcG9pbnQgdmFsdWUgMC4wMDkwMjkgKi8KLSNkZWZpbmUgVk9MX1RDX0ZzMjQwMDAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDg3MDIgICAgICAgICAvKiBGbG9hdGluZyBwb2ludCB2YWx1ZSAwLjAwODI5OSAqLwotI2RlZmluZSBWT0xfVENfRnMzMjAwMCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgNjUzMyAgICAgICAgIC8qIEZsb2F0aW5nIHBvaW50IHZhbHVlIDAuMDA2MjMxICovCi0jZGVmaW5lIFZPTF9UQ19GczQ0MTAwICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA0NzQ1ICAgICAgICAgLyogRmxvYXRpbmcgcG9pbnQgdmFsdWUgMC4wMDQ1MjUgKi8KLSNkZWZpbmUgVk9MX1RDX0ZzNDgwMDAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDQzNjAgICAgICAgICAvKiBGbG9hdGluZyBwb2ludCB2YWx1ZSAwLjAwNDE1OCAqLwotI2RlZmluZSBNSVhfVENfRnM4MDAwICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAyOTM2NSAgICAgICAgIC8qIEZsb2F0aW5nIHBvaW50IHZhbHVlIDAuODk2MTUxICovCi0jZGVmaW5lIE1JWF9UQ19GczExMDI1ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDMwMjMwICAgICAgICAgLyogRmxvYXRpbmcgcG9pbnQgdmFsdWUgMC45MjI1NDggKi8KLSNkZWZpbmUgTUlYX1RDX0ZzMTIwMDAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMzA0MjIgICAgICAgICAvKiBGbG9hdGluZyBwb2ludCB2YWx1ZSAwLjkyODQxNSAqLwotI2RlZmluZSBNSVhfVENfRnMxNjAwMCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAzMDk3OCAgICAgICAgIC8qIEZsb2F0aW5nIHBvaW50IHZhbHVlIDAuOTQ1Mzg3ICovCi0jZGVmaW5lIE1JWF9UQ19GczIyMDUwICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDMxNDUxICAgICAgICAgLyogRmxvYXRpbmcgcG9pbnQgdmFsdWUgMC45NTk4MDQgKi8KLSNkZWZpbmUgTUlYX1RDX0ZzMjQwMDAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMzE1NTQgICAgICAgICAvKiBGbG9hdGluZyBwb2ludCB2YWx1ZSAwLjk2Mjk1NiAqLwotI2RlZmluZSBNSVhfVENfRnMzMjAwMCAgICAgICAgICAgICAgICAgICAg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IGF0Ci0gKgotICogICAgICBodHRwOi8vd3d3LmFwYWNoZS5vcmcvbGljZW5zZXMvTElDRU5TRS0yLjAKLSAqCi0gKiBVbmxlc3MgcmVxdWlyZWQgYnkgYXBwbGljYWJsZSBsYXcgb3IgYWdyZWVkIHRvIGluIHdyaXRpbmcsIHNvZnR3YXJlCi0gKiBkaXN0cmlidXRlZCB1bmRlciB0aGUgTGljZW5zZSBpcyBkaXN0cmlidXRlZCBvbiBhbiAiQVMgSVMiIEJBU0lTLAotICogV0lUSE9VVCBXQVJSQU5USUVTIE9SIENPTkRJVElPTlMgT0YgQU5ZIEtJTkQsIGVpdGhlciBleHByZXNzIG9yIGltcGxpZWQuCi0gKiBTZWUgdGhlIExpY2Vuc2UgZm9yIHRoZSBzcGVjaWZpYyBsYW5ndWFnZSBnb3Zlcm5pbmcgcGVybWlzc2lvbnMgYW5kCi0gKiBsaW1pdGF0aW9ucyB1bmRlciB0aGUgTGljZW5zZS4KLSAqLwotCi0vKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLS8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogICAgSW5jbHVkZXMgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotCi0jaW5jbHVkZSAiTFZEQkUuaCIKLSNpbmNsdWRlICJMVkRCRV9Qcml2YXRlLmgiCi0jaW5jbHVkZSAiVmVjdG9yQXJpdGhtZXRpYy5oIgotI2luY2x1ZGUgIkxWREJFX0NvZWZmcy5oIgotI2luY2x1ZGUgIkxWREJFX1RhYmxlcy5oIgotCi0vKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLS8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogRlVOQ1RJT046ICAgICAgICAgICAgICAgICAgTFZEQkVfR2V0UGFyYW1ldGVycyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qIERFU0NSSVBUSU9OOiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogICAgUmVxdWVzdCB0aGUgRHluYW1pYyBCYXNzIEVuaGFuY2VtZW50IHBhcmFtZXRlcnMuIFRoZSBjdXJyZW50IHBhcmFtZXRlciBzZXQgaXMgICAgICovCi0vKiAgcmV0dXJuZWQgdmlhIHRoZSBwYXJhbWV0ZXIgcG9pbnRlci4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogUEFSQU1FVEVSUzogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgaEluc3RhbmNlICAgICAgICAgICAgICAgICAgIEluc3RhbmNlIGhhbmRsZSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICBwUGFyYW1zICAgICAgICAgICAgICAgICAgUG9pbnRlciB0byBhbiBlbXB0eSBwYXJhbWV0ZXIgc3RydWN0dXJlICAgICAgICAgICAgICAgICAgICAqLwotLyogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiBSRVRVUk5TOiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICBMVkRCRV9TVUNDRVNTICAgICAgICAgICAgQWx3YXlzIHN1Y2NlZWRzICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiBOT1RFUzogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICAxLiAgICBUaGlzIGZ1bmN0aW9uIG1heSBiZSBpbnRlcnJ1cHRlZCBieSB0aGUgTFZEQkVfUHJvY2VzcyBmdW5jdGlvbiAgICAgICAgICAgICAgICAqLwotLyogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLQotTFZEQkVfUmV0dXJuU3RhdHVzX2VuIExWREJFX0dldFBhcmFtZXRlcnMoTFZEQkVfSGFuZGxlX3QgICAgICAgIGhJbnN0YW5jZSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTFZEQkVfUGFyYW1zX3QgICAgICAgICpwUGFyYW1zKQotewotCi0gICAgTFZEQkVfSW5zdGFuY2VfdCAgICAqcEluc3RhbmNlID0oTFZEQkVfSW5zdGFuY2VfdCAgKiloSW5zdGFuY2U7Ci0KLSAgICAqcFBhcmFtcyA9IHBJbnN0YW5jZS0+UGFyYW1zOwotCi0gICAgcmV0dXJuKExWREJFX1NVQ0NFU1MpOwotfQotCi0KLS8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0vKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogRlVOQ1RJT046ICAgICAgICAgICAgICAgICAgTFZEQkVfR2V0Q2FwYWJpbGl0aWVzICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiBERVNDUklQVElPTjogRHluYW1pYyBCYXNzIEVuaG5hY2VtZW50IGNhcGFiaWxpdGllcy4gVGhlIGN1cnJlbnQgY2FwYWJpbGl0aWVzIGFyZSAqLwotLyogcmV0dXJuZWQgdmlhIHRoZSBwb2ludGVyLiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiBQQVJBTUVURVJTOiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogIGhJbnN0YW5jZSAgICAgICAgICAgICAgICAgICBJbnN0YW5jZSBoYW5kbGUgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICBwQ2FwYWJpbGl0aWVzICAgICAgICAgICAgICBQb2ludGVyIHRvIGFuIGVtcHR5IGNhcGFiaWxpdHkgc3RydWN0dXJlICAgICAgICAgICAgICovCi0vKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogUkVUVVJOUzogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICBMVkRCRV9TdWNjZXNzICAgICAgICAgICAgIEFsd2F5cyBzdWNjZWVkcyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogTk9URVM6ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICAxLiAgICBUaGlzIGZ1bmN0aW9uIG1heSBiZSBpbnRlcnJ1cHRlZCBieSB0aGUgTFZEQkVfUHJvY2VzcyBmdW5jdGlvbiAgICAgICAgICAgICovCi0vKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLQotTFZEQkVfUmV0dXJuU3RhdHVzX2VuIExWREJFX0dldENhcGFiaWxpdGllcyhMVkRCRV9IYW5kbGVfdCAgICAgICAgICAgIGhJbnN0YW5jZSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBMVkRCRV9DYXBhYmlsaXRpZXNfdCAgICAqcENhcGFiaWxpdGllcykKLXsKLQotICAgIExWREJFX0luc3RhbmNlX3QgICAgKnBJbnN0YW5jZSA9KExWREJFX0luc3RhbmNlX3QgICopaEluc3RhbmNlOwotCi0gICAgKnBDYXBhYmlsaXRpZXMgPSBwSW5zdGFuY2UtPkNhcGFiaWxpdGllczsKLQotICAgIHJldHVybihMVkRCRV9TVUNDRVNTKTsKLX0KLQotCi0vKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotLyogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qIEZVTkNUSU9OOiAgICAgICAgICAgIExWREJFX1NldEZpbHRlcnMgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogREVTQ1JJUFRJT046ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICBTZXRzIHRoZSBmaWx0ZXIgY29lZmZpY2llbnRzIGFuZCBjbGVhcnMgdGhlIGRhdGEgaGlzdG9yeSAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogUEFSQU1FVEVSUzogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICBwSW5zdGFuY2UgICAgICAgICAgIFBvaW50ZXIgdG8gdGhlIGluc3RhbmNlICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgcFBhcmFtcyAgICAgICAgICAgICBJbml0aWFsaXNhdGlvbiBwYXJhbWV0ZXJzICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0KLXZvaWQgICAgTFZEQkVfU2V0RmlsdGVycyhMVkRCRV9JbnN0YW5jZV90ICAgICAqcEluc3RhbmNlLAotICAgICAgICAgICAgICAgICAgICAgICAgIExWREJFX1BhcmFtc190ICAgICAgICpwUGFyYW1zKQotewotCi0gICAgLyoKLSAgICAgKiBDYWxjdWxhdGUgdGhlIHRhYmxlIG9mZnNldHMKLSAgICAgKi8KLSAgICBMVk1fVUlOVDE2IE9mZnNldCA9IChMVk1fVUlOVDE2KSgoTFZNX1VJTlQxNilwUGFyYW1zLT5TYW1wbGVSYXRlICsgKExWTV9VSU5UMTYpKHBQYXJhbXMtPkNlbnRyZUZyZXF1ZW5jeSAqICgxK0xWREJFX0ZTXzQ4MDAwKSkpOwotCi0KLSAgICAvKgotICAgICAqIFNldHVwIHRoZSBoaWdoIHBhc3MgZmlsdGVyCi0gICAgICovCi0gICAgTG9hZENvbnN0XzE2KDAsICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8qIENsZWFyIHRoZSBoaXN0b3J5LCB2YWx1ZSAwICovCi0gICAgICAgICAgICAgICAgICh2b2lkICopJnBJbnN0YW5jZS0+cERhdGEtPkhQRlRhcHMsICAgICAgICAgICAgICAgIC8qIERlc3RpbmF0aW9uIENhc3QgdG8gdm9pZDogXAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbm8gZGVyZWZlcmVuY2luZyBpbiBmdW5jdGlvbiovCi0gICAgICAgICAgICAgICAgIHNpemVvZihwSW5zdGFuY2UtPnBEYXRhLT5IUEZUYXBzKS9zaXplb2YoTFZNX0lOVDE2KSk7ICAgLyogTnVtYmVyIG9mIHdvcmRzICovCi0gICAgQlFfMklfRDMyRjMyQ2xsX1RSQ19XUkFfMDFfSW5pdCgmcEluc3RhbmNlLT5wQ29lZi0+SFBGSW5zdGFuY2UsICAgICAgICAgLyogSW5pdGlhbGlzZSB0aGUgZmlsdGVyICovCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmcEluc3RhbmNlLT5wRGF0YS0+SFBGVGFwcywKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChCUV9DMzJfQ29lZnNfdCAqKSZMVkRCRV9IUEZfVGFibGVbT2Zmc2V0XSk7Ci0KLQotICAgIC8qCi0gICAgICogU2V0dXAgdGhlIGJhbmQgcGFzcyBmaWx0ZXIKLSAgICAgKi8KLSAgICBMb2FkQ29uc3RfMTYoMCwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLyogQ2xlYXIgdGhlIGhpc3RvcnksIHZhbHVlIDAgKi8KLSAgICAgICAgICAgICAgICAgKHZvaWQgKikmcEluc3RhbmNlLT5wRGF0YS0+QlBGVGFwcywgICAgICAgICAgICAgICAgLyogRGVzdGluYXRpb24gQ2FzdCB0byB2b2lkOlwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG5vIGRlcmVmZXJlbmNpbmcgaW4gZnVuY3Rpb24qLwotICAgICAgICAgICAgICAgICBzaXplb2YocEluc3RhbmNlLT5wRGF0YS0+QlBGVGFwcykvc2l6ZW9mKExWTV9JTlQxNikpOyAgIC8qIE51bWJlciBvZiB3b3JkcyAqLwotICAgIEJQXzFJX0QzMkYzMkNsbF9UUkNfV1JBXzAyX0luaXQoJnBJbnN0YW5jZS0+cENvZWYtPkJQRkluc3RhbmNlLCAgICAgICAgIC8qIEluaXRpYWxpc2UgdGhlIGZpbHRlciAqLwotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJnBJbnN0YW5jZS0+cERhdGEtPkJQRlRhcHMsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoQlBfQzMyX0NvZWZzX3QgKikmTFZEQkVfQlBGX1RhYmxlW09mZnNldF0pOwotCi19Ci0KLQotCi0vKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotLyogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qIEZVTkNUSU9OOiAgICAgICAgICAgIExWREJFX1NldEFHQyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogREVTQ1JJUFRJT046ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICBTZXRzIHRoZSBBR0MgZ2FpbiBsZXZlbCBhbmQgYXR0YWNrIGFuZCBkZWNheSB0aW1lcyBjb25zdGFudHMuICAgICAgICAgICAgICAgICAgICovCi0vKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogUEFSQU1FVEVSUzogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICBwSW5zdGFuY2UgICAgICAgICAgIFBvaW50ZXIgdG8gdGhlIGluc3RhbmNlICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgcFBhcmFtcyAgICAgICAgICAgICBJbml0aWFsaXNhdGlvbiBwYXJhbWV0ZXJzICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0KLXZvaWQgICAgTFZEQkVfU2V0QUdDKExWREJFX0luc3RhbmNlX3QgICAgICpwSW5zdGFuY2UsCi0gICAgICAgICAgICAgICAgICAgICBMVkRCRV9QYXJhbXNfdCAgICAgICAqcFBhcmFtcykKLXsKLQotICAgIC8qCi0gICAgICogR2V0IHRoZSBhdHRhY2sgYW5kIGRlY2F5IHRpbWUgY29uc3RhbnRzCi0gICAgICovCi0gICAgcEluc3RhbmNlLT5wRGF0YS0+QUdDSW5zdGFuY2UuQUdDX0F0dGFjayA9IExWREJFX0FHQ19BVFRBQ0tfVGFibGVbKExWTV9VSU5UMTYpcFBhcmFtcy0+U2FtcGxlUmF0ZV07ICAvKiBBdHRhY2sgbXVsdGlwbGllciAqLwotICAgIHBJbnN0YW5jZS0+cERhdGEtPkFHQ0luc3RhbmNlLkFHQ19EZWNheSAgPSBMVkRCRV9BR0NfREVDQVlfVGFibGVbKExWTV9VSU5UMTYpcFBhcmFtcy0+U2FtcGxlUmF0ZV07ICAgLyogRGVjYXkgbXVsdGlwbGVyICovCi0KLQotICAgIC8qCi0gICAgICogR2V0IHRoZSBib29zdCBnYWluCi0gICAgICovCi0gICAgaWYgKHBQYXJhbXMtPkhQRlNlbGVjdCA9PSBMVkRCRV9IUEZfT04pCi0gICAgewotICAgICAgICBwSW5zdGFuY2UtPnBEYXRhLT5BR0NJbnN0YW5jZS5BR0NfTWF4R2FpbiAgID0gTFZEQkVfQUdDX0hQRkdBSU5fVGFibGVbKExWTV9VSU5UMTYpcFBhcmFtcy0+RWZmZWN0TGV2ZWxdOyAgLyogSGlnaCBwYXNzIGZpbHRlciBvbiAqLwotICAgIH0KLSAgICBlbHNlCi0gICAgewotICAgICAgICBwSW5zdGFuY2UtPnBEYXRhLT5BR0NJbnN0YW5jZS5BR0NfTWF4R2FpbiAgID0gTFZEQkVfQUdDX0dBSU5fVGFibGVbKExWTV9VSU5UMTYpcFBhcmFtcy0+RWZmZWN0TGV2ZWxdOyAgICAgLyogSGlnaCBwYXNzIGZpbHRlciBvZmYgKi8KLSAgICB9Ci0gICAgcEluc3RhbmNlLT5wRGF0YS0+QUdDSW5zdGFuY2UuQUdDX0dhaW5TaGlmdCA9IEFHQ19HQUlOX1NISUZUOwotICAgIHBJbnN0YW5jZS0+cERhdGEtPkFHQ0luc3RhbmNlLkFHQ19UYXJnZXQgPSBBR0NfVEFSR0VUTEVWRUw7Ci0KLX0KLQotCi0vKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotLyogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qIEZVTkNUSU9OOiAgICAgICAgICAgIExWREJFX1NldFZvbHVtZSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogREVTQ1JJUFRJT046ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICBDb252ZXJ0cyB0aGUgaW5wdXQgdm9sdW1lIGRlbWFuZCBmcm9tIGRCcyB0byBsaW5lYXIuICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogUEFSQU1FVEVSUzogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICBwSW5zdGFuY2UgICAgICAgICAgIFBvaW50ZXIgdG8gdGhlIGluc3RhbmNlICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgcFBhcmFtcyAgICAgICAgICAgICBJbml0aWFsaXNhdGlvbiBwYXJhbWV0ZXJzICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qIE5PVEVTOiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgMS4gVGhlIHZvbHVtZSBzaG91bGQgaGF2ZSB0aGUgZm9sbG93aW5nIHNldHRpbmdzOiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICAgICAgICAgIERCRSAgICAgICAgIFZvbCBDb250cm9sICAgICAgICAgICBWb2x1bWUgc2V0dGluZyAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgICAgICAgICA9PT0gICAgICAgICA9PT09PT09PT09PSAgICAgICAgID09PT09PT09PT09PT09PT09PT0gICAgICAgICAgICAgICAgICAgICAqLwotLyogICAgICAgICAgT2ZmICAgICAgICAgICAgIE9mZiAgICAgICAgICAgICAgICAgSGVhZHJvb21kQiAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICAgICAgICAgIE9mZiAgICAgICAgICAgICBPbiAgICAgICAgICAgICAgVm9sdW1lZEIrSGVhZHJvb21kQiAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgICAgICAgICBPbiAgICAgICAgICAgICAgT2ZmICAgICAgICAgICAgICAgICBIZWFkcm9vbWRCICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogICAgICAgICAgT24gICAgICAgICAgICAgIE9uICAgICAgICAgICAgICBWb2x1bWVkQitIZWFkcm9vbWRCICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotCi12b2lkICAgIExWREJFX1NldFZvbHVtZShMVkRCRV9JbnN0YW5jZV90ICAgICAqcEluc3RhbmNlLAotICAgICAgICAgICAgICAgICAgICAgICAgTFZEQkVfUGFyYW1zX3QgICAgICAgKnBQYXJhbXMpCi17Ci0KLSAgICBMVk1fVUlOVDE2ICAgICAgZEJTaGlmdHM7ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvKiA2ZEIgc2hpZnRzICovCi0gICAgTFZNX1VJTlQxNiAgICAgIGRCT2Zmc2V0OyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLyogVGFibGUgb2Zmc2V0ICovCi0gICAgTFZNX0lOVDE2ICAgICAgIFZvbHVtZSA9IDA7ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLyogUmVxdWlyZWQgdm9sdW1lIGluIGRCcyAqLwotCi0gICAgLyoKLSAgICAgKiBBcHBseSB0aGUgdm9sdW1lIGlmIGVuYWJsZWQKLSAgICAgKi8KLSAgICBpZiAocFBhcmFtcy0+Vm9sdW1lQ29udHJvbCA9PSBMVkRCRV9WT0xVTUVfT04pCi0gICAgewotICAgICAgICAvKgotICAgICAgICAgKiBMaW1pdCB0aGUgZ2FpbiB0byB0aGUgbWF4aW11bSBhbGxvd2VkCi0gICAgICAgICAqLwotICAgICAgICBpZiAgKHBQYXJhbXMtPlZvbHVtZWRCID4gVk9MVU1FX01BWCkKLSAgICAgICAgewotICAgICAgICAgICAgVm9sdW1lID0gVk9MVU1FX01BWDsKLSAgICAgICAgfQotICAgICAgICBlbHNlCi0gICAgICAgIHsKLSAgICAgICAgICAgIFZvbHVtZSA9IHBQYXJhbXMtPlZvbHVtZWRCOwotICAgICAgICB9Ci0gICAgfQotCi0KLSAgICAvKgotICAgICAqIENhbGN1bGF0ZSB0aGUgcmVxdWlyZWQgZ2FpbiBhbmQgc2hpZnRzCi0gICAgICovCi0gICAgZEJPZmZzZXQgPSAoTFZNX1VJTlQxNikoNiArIFZvbHVtZSAlIDYpOyAgICAgICAgICAgICAgICAgICAgLyogR2V0IHRoZSBkQnMgMC01ICovCi0gICAgZEJTaGlmdHMgPSAoTFZNX1VJTlQxNikoVm9sdW1lIC8gLTYpOyAgICAgICAgICAgICAgICAgICAgICAgLyogR2V0IHRoZSA2ZEIgc2hpZnRzICovCi0KLQotICAgIC8qCi0gICAgICogV2hlbiBEQkUgaXMgZW5hYmxlZCB1c2UgQUdDIHZvbHVtZQotICA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LT5wRGF0YS0+QnlwYXNzVm9sdW1lLk1peGVyU3RyZWFtWzBdLkNhbGxiYWNrU2V0ID0gMTsKLSAgICBMVkNfTWl4ZXJfVmFyU2xvcGVfU2V0VGltZUNvbnN0YW50KCZwSW5zdGFuY2UtPnBEYXRhLT5CeXBhc3NWb2x1bWUuTWl4ZXJTdHJlYW1bMF0sCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIExWREJFX01JWEVSX1RDLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoTFZNX0ZzX2VuKXBJbnN0YW5jZS0+UGFyYW1zLlNhbXBsZVJhdGUsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDIpOwotfQotCi0KLS8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotLyogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiBGVU5DVElPTjogICAgICAgICAgICAgICAgTFZEQkVfQ29udHJvbCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogREVTQ1JJUFRJT046ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgU2V0cyBvciBjaGFuZ2VzIHRoZSBCYXNzIEVuaGFuY2VtZW50IHBhcmFtZXRlcnMuIENoYW5naW5nIHRoZSBwYXJhbWV0ZXJzIHdoaWxlIHRoZSAgKi8KLS8qICBtb2R1bGUgaXMgcHJvY2Vzc2luZyBzaWduYWxzIG1heSBoYXZlIHRoZSBmb2xsb3dpbmcgc2lkZSBlZmZlY3RzOiAgICAgICAgICAgICAgICAgICAqLwotLyogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgR2VuZXJhbCBwYXJhbWV0ZXJzOiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICA9PT09PT09PT09PT09PT09PT09ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogIE9wZXJhdGluZ01vZGU6ICAgICAgQ2hhbmdpbmcgdGhlIG1vZGUgb2Ygb3BlcmF0aW9uIG1heSBjYXVzZSBhIGNoYW5nZSBpbiB2b2x1bWUgICAgICovCi0vKiAgICAgICAgICAgICAgICAgICAgICBsZXZlbCBvciBjYXVzZSBwb3BzIGFuZCBjbGlja3MuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogIFNhbXBsZVJhdGU6ICAgICAgICAgQ2hhbmdpbmcgdGhlIHNhbXBsZSByYXRlIG1heSBjYXVzZSBwb3BzIGFuZCBjbGlja3MuICAgICAgICAgICAgICovCi0vKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICBFZmZlY3RMZXZlbDogICAgICAgIENoYW5naW5nIHRoZSBlZmZlY3QgbGV2ZWwgbWF5IGNhdXNlIHBvcHMgYW5kIGNsaWNrcyAgICAgICAgICAgICAqLwotLyogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgQ2VudHJlRnJlcXVlbmN5OiAgICBDaGFuZ2luZyB0aGUgY2VudHJlIGZyZXF1ZW5jeSBtYXkgY2F1c2UgcG9wcyBhbmQgY2xpY2tzICAgICAgICAgKi8KLS8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogIEhQRlNlbGVjdDogICAgICAgICAgU2VsZWN0aW5nL2RlLXNlbGVjdGluZyB0aGUgaGlnaCBwYXNzIGZpbHRlciBtYXkgY2F1c2UgcG9wcyBhbmQgICovCi0vKiAgICAgICAgICAgICAgICAgICAgICBjbGlja3MgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogIFZvbHVtZWRCICAgICAgICAgICAgQ2hhbmdpbmcgdGhlIHZvbHVtZSBzZXR0aW5nIHdpbGwgaGF2ZSBubyBzaWRlIGVmZmVjdHMgICAgICAgICAgICovCi0vKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogUEFSQU1FVEVSUzogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgaEluc3RhbmNlICAgICAgICAgICAgICAgSW5zdGFuY2UgaGFuZGxlICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICBwUGFyYW1zICAgICAgICAgICAgICAgICBQb2ludGVyIHRvIGEgcGFyYW1ldGVyIHN0cnVjdHVyZSAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiBSRVRVUk5TOiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICBMVkRCRV9TVUNDRVNTICAgICAgICAgICBBbHdheXMgc3VjY2VlZHMgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiBOT1RFUzogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICAxLiAgVGhpcyBmdW5jdGlvbiBtdXN0IG5vdCBiZSBpbnRlcnJ1cHRlZCBieSB0aGUgTFZEQkVfUHJvY2VzcyBmdW5jdGlvbiAgICAgICAgICAgICAqLwotLyogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLQotTFZEQkVfUmV0dXJuU3RhdHVzX2VuIExWREJFX0NvbnRyb2woTFZEQkVfSGFuZGxlX3QgICAgICAgICBoSW5zdGFuY2UsCi0gICAgICAgICAgICAgICAgICAg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Zm9yIHRoZSBzcGVjaWZpYyBsYW5ndWFnZSBnb3Zlcm5pbmcgcGVybWlzc2lvbnMgYW5kCi0gKiBsaW1pdGF0aW9ucyB1bmRlciB0aGUgTGljZW5zZS4KLSAqLwotCi0vKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLS8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogICAgSW5jbHVkZXMgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotCi0jaW5jbHVkZSAiTFZEQkUuaCIKLSNpbmNsdWRlICJMVkRCRV9Qcml2YXRlLmgiCi0KLS8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotLyogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiBGVU5DVElPTjogICAgICAgICAgICAgICAgIExWREJFX01lbW9yeSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogREVTQ1JJUFRJT046ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgICBUaGlzIGZ1bmN0aW9uIGlzIHVzZWQgZm9yIG1lbW9yeSBhbGxvY2F0aW9uIGFuZCBmcmVlLiBJdCBjYW4gYmUgY2FsbGVkIGluICAgICAgICAgKi8KLS8qICAgIHR3byB3YXlzOiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgICAgICAgaEluc3RhbmNlID0gTlVMTCAgICAgICAgICAgICAgICBSZXR1cm5zIHRoZSBtZW1vcnkgcmVxdWlyZW1lbnRzICAgICAgICAgICAgICAgKi8KLS8qICAgICAgICBoSW5zdGFuY2UgPSBJbnN0YW5jZSBoYW5kbGUgICAgICAgIFJldHVybnMgdGhlIG1lbW9yeSByZXF1aXJlbWVudHMgYW5kICAgICAgICAqLwotLyogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYWxsb2NhdGVkIGJhc2UgYWRkcmVzc2VzIGZvciB0aGUgaW5zdGFuY2UgICAgICovCi0vKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICAgIFdoZW4gdGhpcyBmdW5jdGlvbiBpcyBjYWxsZWQgZm9yIG1lbW9yeSBhbGxvY2F0aW9uIChoSW5zdGFuY2U9TlVMTCkgdGhlIG1lbW9yeSAgICAqLwotLyogIGJhc2UgYWRkcmVzcyBwb2ludGVycyBhcmUgTlVMTCBvbiByZXR1cm4uICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICAgIFdoZW4gdGhlIGZ1bmN0aW9uIGlzIGNhbGxlZCBmb3IgZnJlZSAoaEluc3RhbmNlID0gSW5zdGFuY2UgSGFuZGxlKSB0aGUgbWVtb3J5ICAgICAqLwotLyogIHRhYmxlIHJldHVybnMgdGhlIGFsbG9jYXRlZCBtZW1vcnkgYW5kIGJhc2UgYWRkcmVzc2VzIHVzZWQgZHVyaW5nIGluaXRpYWxpc2F0aW9uLiAgICovCi0vKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qIFBBUkFNRVRFUlM6ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogIGhJbnN0YW5jZSAgICAgICAgICAgICAgICBJbnN0YW5jZSBIYW5kbGUgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgcE1lbW9yeVRhYmxlICAgICAgICAgICAgIFBvaW50ZXIgdG8gYW4gZW1wdHkgbWVtb3J5IGRlZmluaXRpb24gdGFibGUgICAgICAgICAgICAgICAgKi8KLS8qICAgIHBDYXBhYmlsaXRpZXMgICAgICAgICAgIFBvaW50ZXIgdG8gdGhlIGluc3RhbmNlIGNhcGFiaWxpdGllcyAgICAgICAgICAgICAgICAgICAgICAqLwotLyogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiBSRVRVUk5TOiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICBMVkRCRV9TVUNDRVNTICAgICAgICAgICAgU3VjY2VlZGVkICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiBOT1RFUzogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICAgIDEuICAgIFRoaXMgZnVuY3Rpb24gbWF5IGJlIGludGVycnVwdGVkIGJ5IHRoZSBMVkRCRV9Qcm9jZXNzIGZ1bmN0aW9uICAgICAgICAgICAgICAqLwotLyogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLQotTFZEQkVfUmV0dXJuU3RhdHVzX2VuIExWREJFX01lbW9yeShMVkRCRV9IYW5kbGVfdCAgICAgICAgICAgIGhJbnN0YW5jZSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTFZEQkVfTWVtVGFiX3QgICAgICAgICAgICAqcE1lbW9yeVRhYmxlLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBMVkRCRV9DYXBhYmlsaXRpZXNfdCAgICAgICpwQ2FwYWJpbGl0aWVzKQotewotCi0gICAgTFZNX1VJTlQzMiAgICAgICAgICBTY3JhdGNoU2l6ZTsKLSAgICBMVkRCRV9JbnN0YW5jZV90ICAgICpwSW5zdGFuY2UgPSAoTFZEQkVfSW5zdGFuY2VfdCAqKWhJbnN0YW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TsKLSAgICAgICAgcE1lbW9yeVRhYmxlLT5SZWdpb25bTFZEQkVfTUVNUkVHSU9OX1NDUkFUQ0hdLkFsaWdubWVudCAgICA9IExWREJFX1NDUkFUQ0hfQUxJR047Ci0gICAgICAgIHBNZW1vcnlUYWJsZS0+UmVnaW9uW0xWREJFX01FTVJFR0lPTl9TQ1JBVENIXS5UeXBlICAgICAgICAgPSBMVkRCRV9TQ1JBVENIOwotICAgICAgICBwTWVtb3J5VGFibGUtPlJlZ2lvbltMVkRCRV9NRU1SRUdJT05fU0NSQVRDSF0ucEJhc2VBZGRyZXNzID0gTFZNX05VTEw7Ci0gICAgfQotICAgIGVsc2UKLSAgICB7Ci0gICAgICAgIC8qIFJlYWQgYmFjayBtZW1vcnkgYWxsb2NhdGlvbiB0YWJsZSAqLwotICAgICAgICAqcE1lbW9yeVRhYmxlID0gcEluc3RhbmNlLT5NZW1vcnlUYWJsZTsKLSAgICB9Ci0KLSAgICByZXR1cm4oTFZEQkVfU1VDQ0VTUyk7Ci19Ci0KLQotLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0vKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qIEZVTkNUSU9OOiAgICAgICAgICAgICAgICAgTFZEQkVfSW5pdCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiBERVNDUklQVElPTjogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICAgIENyZWF0ZSBhbmQgaW5pdGlhbGlzYXRpb24gZnVuY3Rpb24gZm9yIHRoZSBEeW5hbWljIEJhc3MgRW5oYW5jZW1lbnQgbW9kdWxlICAgICAgICAqLwotLyogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgICBUaGlzIGZ1bmN0aW9uIGNhbiBiZSB1c2VkIHRvIGNyZWF0ZSBhbiBhbGdvcml0aG0gaW5zdGFuY2UgYnkgY2FsbGluZyB3aXRoICAgICAgICAgKi8KLS8qICAgIGhJbnN0YW5jZSBzZXQgdG8gTlVMTC4gSW4gdGhpcyBjYXNlIHRoZSBhbGdvcml0aG0gcmV0dXJucyB0aGUgbmV3IGluc3RhbmNlICAgICAgICAqLwotLyogICAgaGFuZGxlLiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICAgIFRoaXMgZnVuY3Rpb24gY2FuIGJlIHVzZWQgdG8gZm9yY2UgYSBmdWxsIHJlLWluaXRpYWxpc2F0aW9uIG9mIHRoZSBhbGdvcml0aG0gICAgICAqLwotLyogICAgYnkgY2FsbGluZyB3aXRoIGhJbnN0YW5jZSA9IEluc3RhbmNlIEhhbmRsZS4gSW4gdGhpcyBjYXNlIHRoZSBtZW1vcnkgdGFibGUgICAgICAgICovCi0vKiAgICBzaG91bGQgYmUgY29ycmVjdCBmb3IgdGhlIGluc3RhbmNlLCB0aGlzIGNhbiBiZSBlbnN1cmVkIGJ5IGNhbGxpbmcgdGhlIGZ1bmN0aW9uICAgKi8KLS8qICAgIERCRV9NZW1vcnkgYmVmb3JlIGNhbGxpbmcgdGhpcyBmdW5jdGlvbi4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiBQQVJBTUVURVJTOiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICBoSW5zdGFuY2UgICAgICAgICAgICAgICAgICBJbnN0YW5jZSBoYW5kbGUgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogIHBNZW1vcnlUYWJsZSAgICAgICAgICAgICBQb2ludGVyIHRvIHRoZSBtZW1vcnkgZGVmaW5pdGlvbiB0YWJsZSAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgcENhcGFiaWxpdGllcyAgICAgICAgICAgICAgUG9pbnRlciB0byB0aGUgaW5zdGFuY2UgY2FwYWJpbGl0aWVzICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogUkVUVVJOUzogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgTFZEQkVfU1VDQ0VTUyAgICAgICAgICAgIEluaXRpYWxpc2F0aW9uIHN1Y2NlZWRlZCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICBMVkRCRV9BTElHTk1FTlRFUlJPUiAgICBJbnN0YW5jZSBvciBzY3JhdGNoIG1lbW9yeSBvbiBpbmNvcnJlY3QgYWxpZ25tZW50ICAgICAgICAgICAqLwotLyogICAgTFZEQkVfTlVMTEFERFJFU1MgICAgICAgIEluc3RhbmNlIG9yIHNjcmF0Y2ggbWVtb3J5IGhhcyBhIE5VTEwgcG9pbnRlciAgICAgICAgICAgICovCi0vKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qIE5PVEVTOiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogIDEuICAgICBUaGUgaW5zdGFuY2UgaGFuZGxlIGlzIHRoZSBwb2ludGVyIHRvIHRoZSBiYXNlIGFkZHJlc3Mgb2YgdGhlIGZpcnN0IG1lbW9yeSAgICovCi0vKiAgICAgICAgcmVnaW9uLiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICAgIDIuICAgIFRoaXMgZnVuY3Rpb24gbXVzdCBub3QgYmUgaW50ZXJydXB0ZWQgYnkgdGhlIExWREJFX1Byb2Nlc3MgZnVuY3Rpb24gICAgICAgICAqLwotLyogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLQotTFZEQkVfUmV0dXJuU3RhdHVzX2VuIExWREJFX0luaXQoTFZEQkVfSGFuZGxlX3QgICAgICAgICAqcGhJbnN0YW5jZSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTFZEQkVfTWVtVGFiX3QgICAgICAgKnBNZW1vcnlUYWJsZSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTFZEQkVfQ2FwYWJpbGl0aWVzX3QgKnBDYXBhYmlsaXRpZXMpCi17Ci0KLSAgICBMVkRCRV9JbnN0YW5jZV90ICAgICAgKnBJbnN0YW5jZTsKLSAgICBMVk1peGVyM18xU3Rfc3QgICAgICAgKnBNaXhlcl9JbnN0YW5jZTsKLSAgICBMVk1peGVyM18yU3Rfc3QgICAgICAgKnBCeXBhc3NNaXhlcl9JbnN0YW5jZTsKLSAgICBMVk1fSU5UMTYgICAgICAgICAgICAgaTsKLSAgICBMVk1fSU5UMzIgICAgICAgICAgICAgTWl4R2FpbjsKLQotCi0gICAgLyoKLSAgICAgKiBTZXQgdGhlIGluc3RhbmNlIGhhbmRsZSBpZiBub3QgYWxyZWFkeSBpbml0aWFsaXNlZAotICAgICAqLwotICAgIGlmICgqcGhJbnN0YW5jZSA9PSBMVk1fTlVMTCkKLSAgICB7Ci0gICAgICAgICpwaEluc3RhbmNlID0gKExWREJFX0hhbmRsZV90KXBNZW1vcnlUYWJsZS0+UmVnaW9uW0xWREJFX01FTVJFR0lPTl9JTlNUQU5DRV0ucEJhc2VBZGRyZXNzOwotICAgIH0KLSAgICBwSW5zdGFuY2UgPShMVkRCRV9JbnN0YW5jZV90ICAqKSpwaEluc3RhbmNlOwotCi0KLSAgICAvKgotICAgICAqIENoZWNrIHRoZSBtZW1vcnkgdGFibGUgZm9yIE5VTEwgcG9pbnRlcnMgYW5kIGluY29ycmVjdGx5IGFsaWduZWQgZGF0YQotICAgICAqLwotICAgIGZvciAoaT0wOyBpPExWREJFX05SX01FTU9SWV9SRUdJT05TOyBpKyspCi0gICAgewotICAgICAgICBpZiAocE1lbW9yeVRhYmxlLT5SZWdpb25baV0uU2l6ZSE9MCkKLSAgICAgICAgewotICAgICAgICAgICAgaWYgKHBNZW1vcnlUYWJsZS0+UmVnaW9uW2ldLnBCYXNlQWRkcmVzcz09TFZNX05VTEwpCi0gICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgcmV0dXJuKExWREJFX05VTExBRERSRVNTKTsKLSAgICAgICAgICAgIH0KLSAgICAgICAgICAgIGlmICgoKExWTV9VSU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gZmlsZSBmb3IgdGhlIHByaXZhdGUgbGF5ZXIgaW50ZXJmYWNlIG9mIER5bmFtaWMgQmFzcyBFbmhhbmNlbWVudCBtb2R1bGUgICAgKi8KLS8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogIFRoaXMgZmlsZXMgaW5jbHVkZXMgYWxsIGRlZmluaXRpb25zLCB0eXBlcywgc3RydWN0dXJlcyBhbmQgZnVuY3Rpb24gICAgICAgICAgICAgICAgICovCi0vKiAgcHJvdG90eXBlcyByZXF1aXJlZCBieSB0aGUgZXhlY3V0aW9uIGxheWVyLiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0KLSNpZm5kZWYgX19MVkRCRV9QUklWQVRFX0hfXwotI2RlZmluZSBfX0xWREJFX1BSSVZBVEVfSF9fCi0KLSNpZmRlZiBfX2NwbHVzcGx1cwotZXh0ZXJuICJDIiB7Ci0jZW5kaWYgLyogX19jcGx1c3BsdXMgKi8KLQotCi0vKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLS8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogICAgSW5jbHVkZXMgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotCi0jaW5jbHVkZSAiTFZEQkUuaCIgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8qIENhbGxpbmcgb3IgQXBwbGljYXRpb24gbGF5ZXIgZGVmaW5pdGlvbnMgKi8KLSNpbmNsdWRlICJCSVFVQUQuaCIKLSNpbmNsdWRlICJMVkNfTWl4ZXIuaCIKLSNpbmNsdWRlICJBR0MuaCIKLQotCi0vKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLS8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogICAgRGVmaW5lcyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotCi0vKiBHZW5lcmFsICovCi0jZGVmaW5lICAgIExWREJFX0lOVkFMSUQgICAgICAgICAgICAweEZGRkYgICAgICAgIC8qIEludmFsaWQgaW5pdCBwYXJhbWV0ZXIgKi8KLQotLyogTWVtb3J5ICovCi0jZGVmaW5lI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CRV9NSVhFUl9UQyAgICAgICAgICAgICAgICAgICA1ICAgICAgIC8qIE1peGVyIHRpbWUgICovCi0jZGVmaW5lIExWREJFX0JZUEFTU19NSVhFUl9UQyAgICAgICAgICAgIDEwMCAgICAgLyogQnlwYXNzIG1peGVyIHRpbWUgKi8KLQotCi0vKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLS8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogICAgU3RydWN0dXJlcyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotCi0vKiBEYXRhIHN0cnVjdHVyZSAqLwotdHlwZWRlZiBzdHJ1Y3QKLXsKLSAgICAvKiBBR0MgcGFyYW1ldGVycyAqLwotICAgIEFHQ19NSVhfVk9MXzJTdDFNb25fRDMyX3QgICBBR0NJbnN0YW5jZTsgICAgICAgIC8qIEFHQyBpbnN0YW5jZSBwYXJhbWV0ZXJzICovCi0KLSAgICAvKiBQcm9jZXNzIHZhcmlhYmxlcyAqLwotICAgIEJpcXVhZF8ySV9PcmRlcjJfVGFwc190ICAgICBIUEZUYXBzOyAgICAgICAgICAgIC8qIEhpZ2ggcGFzcyBmaWx0ZXIgdGFwcyAqLwotICAgIEJpcXVhZF8xSV9PcmRlcjJfVGFwc190ICAgICBCUEZUYXBzOyAgICAgICAgICA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WVudCBwb2ludGVycyAqLwotICAgIExWREJFX0RhdGFfdCAgICAgICAgICAgICAgICAqcERhdGE7ICAgICAgICAgICAgICAgIC8qIEluc3RhbmNlIGRhdGEgKi8KLSAgICBMVkRCRV9Db2VmX3QgICAgICAgICAgICAgICAgKnBDb2VmOyAgICAgICAgICAgICAgICAvKiBJbnN0YW5jZSBjb2VmZmljaWVudHMgKi8KLX0gTFZEQkVfSW5zdGFuY2VfdDsKLQotCi0vKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLS8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogRnVuY3Rpb24gcHJvdG90eXBlcyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotCi12b2lkICAgIExWREJFX1NldEFHQyhMVkRCRV9JbnN0YW5jZV90ICAgICAgICpwSW5zdGFuY2UsCi0gICAgICAgICAgICAgICAgICAgICBMVkRCRV9QYXJhbXNfdCAgICAgICAgICpwUGFyYW1zKTsKLQotCi12b2lkICAgIExWREJFX1NldFZvbHVtZShMVkRCRV9JbnN0YW5jZV90ICAgICpwSW5zdGFuY2UsCi0gICAgICAgICAgICAgICAgICAgICAgICBMVkRCRV9QYXJhbXNfdCAgICAgICpwUGFyYW1zKTsKLQotCi12b2lkICAgIExWREJFX1NldEZpbHRlcnMoTFZEQkVfSW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BsYXcgb3IgYWdyZWVkIHRvIGluIHdyaXRpbmcsIHNvZnR3YXJlCi0gKiBkaXN0cmlidXRlZCB1bmRlciB0aGUgTGljZW5zZSBpcyBkaXN0cmlidXRlZCBvbiBhbiAiQVMgSVMiIEJBU0lTLAotICogV0lUSE9VVCBXQVJSQU5USUVTIE9SIENPTkRJVElPTlMgT0YgQU5ZIEtJTkQsIGVpdGhlciBleHByZXNzIG9yIGltcGxpZWQuCi0gKiBTZWUgdGhlIExpY2Vuc2UgZm9yIHRoZSBzcGVjaWZpYyBsYW5ndWFnZSBnb3Zlcm5pbmcgcGVybWlzc2lvbnMgYW5kCi0gKiBsaW1pdGF0aW9ucyB1bmRlciB0aGUgTGljZW5zZS4KLSAqLwotCi0vKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLS8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogICAgSW5jbHVkZXMgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotCi0jaW5jbHVkZSAiTFZEQkUuaCIKLSNpbmNsdWRlICJMVkRCRV9Qcml2YXRlLmgiCi0jaW5jbHVkZSAiVmVjdG9yQXJpdGhtZXRpYy5oIgotI2luY2x1ZGUgIkFHQy5oIgotI2luY2x1ZGUgIkxWREJFX0NvZWZmcy5oIiAgICAgICAgICAgICAgIC8qIEZpbHRlciBjb2VmZmljaWVudHMgKi8KLQotCi0vKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0vKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiBGVU5DVElPTjogICAgICAgICAgICAgICAgIExWREJFX1Byb2Nlc3MgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiBERVNDUklQVElPTjogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgUHJvY2VzcyBmdW5jdGlvbiBmb3IgdGhlIEJhc3MgRW5oYW5jZW1lbnQgbW9kdWxlLiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgRGF0YSBjYW4gYmUgcHJvY2Vzc2VkIGluIHR3byBmb3JtYXRzLCBzdGVyZW8gb3IgbW9uby1pbi1zdGVyZW8uIERhdGEgaW4gbW9ubyAgICAgICAgICAgICovCi0vKiAgZm9ybWF0IGlzIG5vdCBzdXBwb3J0ZWQsIHRoZSBjYWxsaW5nIHJvdXRpbmUgbXVzdCBjb252ZXJ0IHRoZSBtb25vIHN0cmVhbSB0byAgICAgICAgICAgICovCi0vKiAgbW9uby1pbi1zdGVyZW8uICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgX19fX19fX19fX18gICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgICAgICBfX19fX19fXyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8ICAgICAgICAgICB8ICAgIF9fX19fX19fICAgICAgICAgICovCi0vKiAgICAgIHwgICAgICAgIHwgICAgX19fX18gICB8LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLT58ICAgICAgICAgICB8ICAgfCAgICAgICAgfCAgICAgICAgICovCi0vKiAgICAgIHwgMTYtYml0IHwgICB8ICAgICB8ICB8ICAgIF9fX19fX19fICAgICAgICAgICAgICB8ICAgICAgICAgICB8ICAgfCAzMi1iaXQgfCAgICAgICAgICovCi0vKiAtKy0tPnwgICB0byAgIHwtLT58IEhQRiB8LS18ICAgfCAgICAgICAgfCAgICBfX19fXyAgICB8IEFHQyBNaXhlciB8LS0+fCAgIHRvICAgfC0tfCAgICAgICovCi0vKiAgfCAgIHwgMzItYml0IHwgICB8X19fX198ICB8ICAgfCBTdGVyZW8gfCAgIHwgICAgIHwgICB8ICAgICAgICAgICB8ICAgfCAxNi1iaXQgfCAgfCAgICAgICovCi0vKiAgfCAgIHxfX19fX19fX3wgICAgICAgICAgICB8LS0+fCAgIHRvICAgfC0tPnwgQlBGIHwtLT58ICAgICAgICAgICB8ICAgfF9fX19fX19ffCAgMCAgICAgICovCi0vKiAgfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfCAgTW9ubyAgfCAgIHxfX19fX3wgICB8X19fX19fX19fX198ICAgICAgICAgICAgICAgIFwtLT4gICovCi0vKiAgfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfF9fX19fX19ffCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgX19fX19fX19fICAgICAgICAgICAgICAgICAgMCAgICAgICovCi0vKiAgfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8ICAgICAgICAgfCAgICAgICAgICAgICAgICAgfCAgICAgICovCi0vKiAgfC0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS18IFZvbHVtZSAgfC0tLS0tLS0tLS0tLS0tLS0tfCAgICAgICovCi0vKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8IENvbnRyb2wgfCAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8X19fX19fX19ffCAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiBQQVJBTUVURVJTOiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgaEluc3RhbmNlICAgICAgICAgICAgICAgICBJbnN0YW5jZSBoYW5kbGUgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgcEluRGF0YSAgICAgICAgICAgICAgICAgIFBvaW50ZXIgdG8gdGhlIGlucHV0IGRhdGEgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgcE91dERhdGEgICAgICAgICAgICAgICAgIFBvaW50ZXIgdG8gdGhlIG91dHB1dCBkYXRhICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgTnVtU2FtcGxlcyAgICAgICAgICAgICAgICAgTnVtYmVyIG9mIHNhbXBsZXMgaW4gdGhlIGlucHV0IGJ1ZmZlciAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiBSRVRVUk5TOiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgTFZEQkVfU1VDQ0VTUyAgICAgICAgICAgIFN1Y2NlZWRlZCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgICBMVkRCRV9UT09NQU5ZU0FNUExFUyAgICBOdW1TYW1wbGVzIHdhcyBsYXJnZXIgdGhhbiB0aGUgbWF4aW11bSBibG9jayBzaXplICAgICAgICAgICAgICovCi0vKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiBOT1RFUzogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgMS4gVGhlIGlucHV0IGFuZCBvdXRwdXQgZGF0YSBtdXN0IGJlIDMyLWJpdCBmb3JtYXQuIFRoZSBpbnB1dCBpcyBzY2FsZWQgYnkgYSBzaGlmdCAgICAgICovCi0vKiAgICAgd2hlbiBjb252ZXJ0aW5nIGZyb20gMTYtYml0IGZvcm1hdCwgdGhpcyBzY2FsaW5nIGFsbG93cyBmb3IgaW50ZXJuYWwgaGVhZHJvb20gaW4gdGhlICovCi0vKiAgICAgYmFzcyBlbmhhbmNlbWVudCBhbGdvcml0aG0uICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgMi4gRm9yIGEgMTYtYml0IGltcGxlbWVudGF0aW9uIHRoZSBjb252ZXJzdGlvbiB0byAzMi1iaXQgaXMgcmVtb3ZlZCBhbmQgcmVwbGFjZWQgd2l0aCAgICovCi0vKiAgICAgdGhlIGhlYWRyb29tIGxvc3MuIFRoaXMgaGVhZHJvb20gbG9zcyBpcyBjb21wZW5zYXRlZCBpbiB0aGUgdm9sdW1lIGNvbnRyb2wgc28gdGhlICAgICovCi0vKiAgICAgb3ZlcmFsbCBlbmQgdG8gZW5kIGdhaW4gaXMgb2RCLiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0KLUxWREJFX1JldHVyblN0YXR1c19lbiBMVkRCRV9Qcm9jZXNzKExWREJFX0hhbmRsZV90ICAgICAgICAgICAgaEluc3RhbmNlLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY29uc3QgTFZNX0lOVDE2ICAgICAgICAgKnBJbkRhdGEsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBMVk1fSU5UMTYgICAgICAgICAgICAgICAqcE91dERhdGEsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBMVk1fVUlOVDE2ICAgICAgICAgICAgICAgICAgIE51bVNhbXBsZXMpCi17Ci0KLSAgICBMVkRCRV9JbnN0YW5jZV90ICAgICpwSW5zdGFuY2UgPShMVkRCRV9JbnN0YW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BwYXRoIGlzIHByb2Nlc3NlZCB3aGVuIERCRSBpcyBPTiBvciBkdXJpbmcgT24vT2ZmIHRyYW5zaXRpb25zICovCi0gICAgaWYgKChwSW5zdGFuY2UtPlBhcmFtcy5PcGVyYXRpbmdNb2RlID09IExWREJFX09OKXx8Ci0gICAgICAgIChMVkNfTWl4ZXJfR2V0Q3VycmVudCgmcEluc3RhbmNlLT5wRGF0YS0+QnlwYXNzTWl4ZXIuTWl4ZXJTdHJlYW1bMF0pCi0gICAgICAgICAhPUxWQ19NaXhlcl9HZXRUYXJnZXQoJnBJbnN0YW5jZS0+cERhdGEtPkJ5cGFzc01peGVyLk1peGVyU3RyZWFtWzBdKSkpCi0gICAgewotCi0gICAgICAgIC8qCi0gICAgICAgICAqIENvbnZlcnQgMTYtYml0IHNhbXBsZXMgdG8gMzItYml0IGFuZCBzY2FsZQotICAgICAgICAgKiAoRm9yIGEgMTYtYml0IGltcGxlbWVudGF0aW9uIGFwcGx5IGhlYWRyb29tIGxvc3MgaGVyZSkKLSAgICAgICAgICovCi0gICAgICAgIEludDE2TFNoaWZ0VG9JbnQzMl8xNngzMihwSW5wdXQsICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8qIFNvdXJjZSAxNi1iaXQgZGF0YSAgICAqLwotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcFNjcmF0Y2gsICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvKiBEZXN0LiAzMi1iaXQgZGF0YSAgICAgKi8KLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChMVk1fSU5UMTYpKDIqTnVtU2FtcGxlcyksICAgICAgICAgICAgLyogTGVmdCBhbmQgcmlnaHQgICAgICAgICovCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBMVkRCRV9TQ0FMRVNISUZUKTsgICAgICAgICAgICAgICAgICAgIC8qIFNoaWZ0IHNjYWxlICAgICAgICAgICAqLwotCi0KLSAgICAgICAgLyoKLSAgICAgICAgICogQXBwbHkgdGhlIGhpZ2ggcGFzcyBmaWx0ZXIgaWYgc2VsZWN0ZWQKLSAgICAgICAgICovCi0gICAgICAgIGlmIChwSW5zdGFuY2UtPlBhcmFtcy5IUEZTZWxlY3QgPT0gTFZEQkVfSFBGX09OKQotICAgICAgICB7Ci0gICAgICAgICAgICAgIEJRXzJJX0QzMkYzMkMzMF9UUkNfV1JBXzAxKCZwSW5zdGFuY2UtPnBDb2VmLT5IUEZJbnN0YW5jZSwvKiBGaWx0ZXIgaW5zdGFuY2UgICAgICAqLwotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKExWTV9JTlQzMiAqKXBTY3JhdGNoLCAgICAgICAgICAgLyogU291cmNlICAgICAgICAgICAgICAgKi8KLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChMVk1fSU5UMzIgKilwU2NyYXRjaCwgICAgICAgICAgIC8qIERlc3RpbmF0aW9uICAgICAgICAgICovCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoTFZNX0lOVDE2KU51bVNhbXBsZXMpOyAgICAgICAgICAvKiBOdW1iZXIgb2Ygc2FtcGxlcyAgICAqLwotICAgICAgICB9Ci0KLQotICAgICAgICAvKgotICAgICAgICAgKiBDcmVhdGUgdGhlIG1vbm8gc3RyZWFtCi0gICAgICAgICAqLwotICAgICAgICBGcm9tMmlUb01vbm9fMzIocFNjcmF0Y2gsICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvKiBTdGVyZW8gc291cmNlICAgICAgICAgKi8KLSAgICAgICAgICAgICAgICAgICAgICAgIHBNb25vLCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLyogTW9ubyBkZXN0aW5hdGlvbiAgICAgICovCi0gICAgICAgICAgICAgICAgICAgICAgICAoTFZNX0lOVDE2KU51bVNhbXBsZXMpOyAgICAgICAgICAgICAgICAgICAgICAgIC8qIE51bWJlciBvZiBzYW1wbGVzICAgICAqLwotCi0KLSAgICAgICAgLyoKLSAgICAgICAgICogQXBwbHkgdGhlIGJhbmQgcGFzcyBmaWx0ZXIKLSAgICAgICAgICovCi0gICAgICAgIEJQXzFJX0QzMkYzMkMzMF9UUkNfV1JBXzAyKCZwSW5zdGFuY2UtPnBDb2VmLT5CUEZJbnN0YW5jZSwgICAgIC8qIEZpbHRlciBpbnN0YW5jZSAgICAgICAqLwotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoTFZNX0lOVDMyICopcE1vbm8sICAgICAgICAgICAgICAgICAvKiBTb3VyY2UgICAgICAgICAgICAgICAgKi8KLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKExWTV9JTlQzMiAqKXBNb25vLCAgICAgICAgICAgICAgICAgLyogRGVzdGluYXRpb24gICAgICAgICAgICovCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChMVk1fSU5UMTYpTnVtU2FtcGxlcyk7ICAgICAgICAgICAgIC8qIE51bWJlciBvZiBzYW1wbGVzICAgICAqLwotCi0KLSAgICAgICAgLyoKLSAgICAgICAgICogQXBwbHkgdGhlIEFHQyBhbmQgbWl4Ci0gICAgICAgICAqLwotICAgICAgICBBR0NfTUlYX1ZPTF8yU3QxTW9uX0QzMl9XUkEoJnBJbnN0YW5jZS0+cERhdGEtPkFHQ0luc3RhbmNlLCAgICAvKiBJbnN0YW5jZSBwb2ludGVyICAgICAgKi8KLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBTY3JhdGNoLCAgICAgICAgICAgICAgICAgICAgICAgICAgLyogU3RlcmVvIHNvdXJjZSAgICAgICAgICovCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwTW9ubywgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8qIE1vbm8gYmFuZCBwYXNzIHNvdXJjZSAqLwotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcFNjcmF0Y2gsICAgICAgICAgICAgICAgICAgICAgICAgICAvKiBTdGVyZW8gZGVzdGluYXRpb24gICAgKi8KLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIE51bVNhbXBsZXMpOyAgICAgICAgICAgICAgICAgICAgICAgLyogTnVtYmVyIG9mIHNhbXBsZXMgICAgICovCi0KLSAgICAgICAgLyoKLSAgICAgICAgICogQ29udmVydCAzMi1iaXQgc2FtcGxlcyB0byAxNi1iaXQgYW5kIHNhdHVyYXRlCi0gICAgICAgICAqIChOb3QgcmVxdWlyZWQgZm9yIDE2LWJpdCBpbXBsZW1lbmF0aW9ucykKLSAgICAgICAgICovCi0gICAgICAgIEludDMyUlNoaWZ0VG9JbnQxNl9TYXRfMzJ4MTYocFNjcmF0Y2gsICAgICAgICAgICAgICAgICAgICAgICAgIC8qIFNvdXJjZSAzMi1iaXQgZGF0YSAgICAqLwotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChMVk1fSU5UMTYgKilwU2NyYXRjaCwgICAgICAgICAgICAvKiBEZXN0LiAxNi1iaXQgZGF0YSAgICAgKi8KLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoTFZNX0lOVDE2KSgyKk51bVNhbXBsZXMpLCAgICAgICAgLyogTGVmdCBhbmQgcmlnaHQgICAgICAgICovCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTFZEQkVfU0NBTEVTSElGVCk7ICAgICAgICAgICAgICAgIC8qIFNoaWZ0IHNjYWxlICAgICAgICAgICAqLwotCi0gICAgfQotCi0gICAgLyogQnlwYXNzIFZvbHVtZSBwYXRoIGlzIHByb2Nlc3NlZCB3aGVuIERCRSBpcyBPRkYgb3IgZHVyaW5nIE9uL09mZiB0cmFuc2l0aW9ucyAqLwotICAgIGlmICgocEluc3RhbmNlLT5QYXJhbXMuT3BlcmF0aW5nTW9kZSA9PSBMVkRCRV9PRkYpfHwKLSAgICAgICAgKExWQ19NaXhlcl9HZXRDdXJyZW50KCZwSW5zdGFuY2UtPnBEYXRhLT5CeXBhc3NNaXhlci5NaXhlclN0cmVhbVsxXSkKLSAgICAgICAgICE9TFZDX01peGVyX0dldFRhcmdldCgmcEluc3RhbmNlLT5wRGF0YS0+QnlwYXNzTWl4ZXIuTWl4ZXJTdHJlYW1bMV0pKSkKLSAgICB7Ci0KLSAgICAgICAgLyoKLSAgICAgICAgICogVGhlIGFsZ29yaXRobSBpcyBkaXNhYmxlZCBidXQgdm9sdW1lIG1hbmFnZW1lbnQgaXMgcmVxdWlyZWQgdG8gY29tcGVuc2F0ZSBmb3IKLSAgICAgICAgICogaGVhZHJvb20gYW5kIHZvbHVtZSAoaWYgZW5hYmxlZCkKLSAgICAgICAgICovCi0gICAgICAgIExWQ19NaXhTb2Z0XzFTdF9EMTZDMzFfU0FUKCZwSW5zdGFuY2UtPnBEYXRhLT5CeXBhc3NWb2x1bWUsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcEluRGF0YSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwU2NyYXRjaFZvbCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoTFZNX0lOVDE2KSgyKk51bVNhbXBsZXMpKTsgICAgICAgICAgIC8qIExlZnQgYW5kIHJpZ2h0ICAgICAgICAgICovCi0KLSAgICB9Ci0KLSAgICAvKgotICAgICAqIE1peCBEQkUgcHJvY2Vzc2VkIHBhdGggYW5kIGJ5cGFzcyB2b2x1bWUgcGF0aAotICAgICAqLwotICAgIExWQ19NaXhTb2Z0XzJTdF9EMTZDMzFfU0FUKCZwSW5zdGFuY2UtPnBEYXRhLT5CeXBhc3NNaXhlciwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChMVk1fSU5UMTYgKikgcFNjcmF0Y2gsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwU2NyYXRjaFZvbCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA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W5kZXIgdGhlIExpY2Vuc2UgaXMgZGlzdHJpYnV0ZWQgb24gYW4gIkFTIElTIiBCQVNJUywKLSAqIFdJVEhPVVQgV0FSUkFOVElFUyBPUiBDT05ESVRJT05TIE9GIEFOWSBLSU5ELCBlaXRoZXIgZXhwcmVzcyBvciBpbXBsaWVkLgotICogU2VlIHRoZSBMaWNlbnNlIGZvciB0aGUgc3BlY2lmaWMgbGFuZ3VhZ2UgZ292ZXJuaW5nIHBlcm1pc3Npb25zIGFuZAotICogbGltaXRhdGlvbnMgdW5kZXIgdGhlIExpY2Vuc2UuCi0gKi8KLQotCi0vKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotLyogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICAgIEluY2x1ZGVzICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLQotI2luY2x1ZGUgIkxWREJFLmgiCi0jaW5jbHVkZSAiTFZEQkVfQ29lZmZzLmgiICAgICAgICAgICAgICAgLyogRmlsdGVyIGNvZWZmaWNpZW50cyAqLwotI2luY2x1ZGUgIkJJUVVBRC5oIgotCi0KLS8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0vKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogICAgQ29lZmZpY2llbnRzIGNvbnN0YW50IHRhYmxlICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotCi0vKgotICogSGlnaCBQYXNzIEZpbHRlciBDb2VmZmljaWVudCB0YWJsZQotICovCi1jb25zdCBCUV9DMzJfQ29lZnNfdCBMVkRCRV9IUEZfVGFibGVbXSA9IHsKLSAgICAvKiBDb2VmZmljaWVudHMgZm9yIDU1SHogY2VudHJlIGZyZXF1ZW5jeSAqLwotICAgIHtIUEZfRnM4MDAwX0ZjNTVfQTIsICAgICAgICAgICAgICAgIC8qIDhrUy9zIGNvZWZmaWNpZW50cyAqLwotICAgICBIUEZfRnM4MDAwX0ZjNTVfQTEsCi0gICAgIEhQRl9GczgwMDBfRmM1NV9BMCwKLSAgICAgLUhQRl9GczgwMDBfRmM1NV9CMiwKLSAgICAgLUhQRl9GczgwMDBfRmM1NV9CMX0sCi0gICAge0hQRl9GczExMDI1X0ZjNTVfQTIsICAgICAgICAgICAgICAgIC8qIDExa1MvcyBjb2VmZmljaWVudHMgKi8KLSAgICAgSFBGX0ZzMTEwMjVfRmM1NV9BMSwKLSAgICAgSFBGX0ZzMTEwMjVfRmM1NV9BMCwKLSAgICAgLUhQRl9GczExMDI1X0ZjNTVfQjIsCi0gICAgIC1IUEZfRnMxMTAyNV9GYzU1X0IxfSwKLSAgICB7SFBGX0ZzMTIwMDBfRmM1NV9BMiwgICAgICAgICAgICAgICAgLyogMTJrUy9zIGNvZWZmaWNpZ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ZfRnMzMjAwMF9GYzkwX0IyLAotICAgICAtQlBGX0ZzMzIwMDBfRmM5MF9CMX0sCi0gICAge0JQRl9GczQ0MTAwX0ZjOTBfQTAsICAgICAgICAgICAgICAgIC8qIDQ0a1MvcyBjb2VmZmljaWVudHMgKi8KLSAgICAgLUJQRl9GczQ0MTAwX0ZjOTBfQjIsCi0gICAgIC1CUEZfRnM0NDEwMF9GYzkwX0IxfSwKLSAgICB7QlBGX0ZzNDgwMDBfRmM5MF9BMCwgICAgICAgICAgICAgICAgLyogNDhrUy9zIGNvZWZmaWNpZW50cyAqLwotICAgICAtQlBGX0ZzNDgwMDBfRmM5MF9CMiwKLSAgICAgLUJQRl9GczQ4MDAwX0ZjOTBfQjF9fTsKLQotCi0vKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotLyogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICAgIEFHQyBjb25zdGFudCB0YWJsZXMgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLQotLyogQXR0YWNrIHRpbWUgKHNpZ25hbCB0b28gbGFyZ2UpICovCi1jb25zdCBMVk1fSU5UMTYgTFZEQkVfQUdDX0FUVEFDS19UYWJsZVtdID0gewotICAgIEFHQ19BVFRBQ0tfRnM4MDAwLAotICAgIEFHQ19BVFRBQ0tfRnMxMTAyNSwKLSAgICBBR0NfQVRUQUNLX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FJTl8xMmRCLAotICAgIEFHQ19HQUlOXzEzZEIsCi0gICAgQUdDX0dBSU5fMTRkQiwKLSAgICBBR0NfR0FJTl8xNWRCfTsKLQotLyogR2FpbiBmb3IgdXNlIHdpdGggdGhlIGhpZ2ggcGFzcyBmaWx0ZXIgKi8KLWNvbnN0IExWTV9JTlQzMiBMVkRCRV9BR0NfSFBGR0FJTl9UYWJsZVtdID0gewotICAgIEFHQ19IUEZHQUlOXzBkQiwKLSAgICBBR0NfSFBGR0FJTl8xZEIsCi0gICAgQUdDX0hQRkdBSU5fMmRCLAotICAgIEFHQ19IUEZHQUlOXzNkQiwKLSAgICBBR0NfSFBGR0FJTl80ZEIsCi0gICAgQUdDX0hQRkdBSU5fNWRCLAotICAgIEFHQ19IUEZHQUlOXzZkQiwKLSAgICBBR0NfSFBGR0FJTl83ZEIsCi0gICAgQUdDX0hQRkdBSU5fOGRCLAotICAgIEFHQ19IUEZHQUlOXzlkQiwKLSAgICBBR0NfSFBGR0FJTl8xMGRCLAotICAgIEFHQ19IUEZHQUlOXzExZEIsCi0gICAgQUdDX0hQRkdBSU5fMTJkQiwKLSAgICBBR0NfSFBGR0FJTl8xM2RCLAotICAgIEFHQ19IUEZHQUlOXzE0ZEIsCi0gICAgQUdDX0hQRkdBSU5fMTVkQn07Ci0KLQotLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLS8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgICBWb2x1bWUgY29udHJvbCBnYWluIGFuZCB0aW1lIGNvbnN0YW50IHRhYmxlcyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0KLS8qIGRCIHRvIGxpbmVhciBjb252ZXJzaW9uIHRhYmxlICovCi1jb25zdCBMVk1fSU5UMTYgTFZEQkVfVm9sdW1lVGFibGVbXSA9IHsKLSAgICAweDQwMDAsICAgICAgICAgICAgIC8qIC02ZEIgKi8KLSAgICAweDQ3RkIsICAgICAgICAgICAgIC8qIC01ZEIgKi8KLSAgICAweDUwQzMsICAgICAgICAgICAgIC8qIC00ZEIgKi8KLSAgICAweDVBOUUsICAgICAgICAgICAgIC8qIC0zZEIgKi8KLSAgICAweDY1QUQsICAgICAgICAgICAgIC8qIC0yZEIgKi8KLSAgICAweDcyMTUsICAgICAgICAgICAgIC8qIC0xZEIgKi8KLSAgICAweDdGRkZ9OyAgICAgICAgICAgIC8qICAwZEIgKi8KLQotY29uc3QgTFZNX0lOVDE2IExWREJFX1ZvbHVtZVRDVGFibGVbXSA9IHsKLSAgICBWT0xfVENfRnM4MDAwLAotICAgIFZPTF9UQ19GczExMDI1LAotICAgIFZPTF9UQ19GczEyMDAwLAotICAgIFZPTF9UQ19GczE2MDAwLAotICAgIFZPTF9UQ19GczIyMDUwLAotICAgIFZPTF9UQ19GczI0MDAwLAotICAgIFZPTF9UQ19GczMyMDAwLAotICAgIFZPTF9UQ19GczQ0MTAwLAotICAgIFZPTF9UQ19GczQ4MDAwfTsKLQotY29uc3QgTFZNX0lOVDE2IExWREJFX01peGVyVENUYWJsZVtdID0gewotICAgIE1JWF9UQ19GczgwMDAsCi0gICAgTUlYX1RDX0ZzMTEwMjUsCi0gICAgTUlYX1RDX0ZzMTIwMDAsCi0gICAgTUlYX1RDX0ZzMTYwMDAsCi0gICAgTUlYX1RDX0ZzMjIwNTAsCi0gICAgTUlYX1RDX0ZzMjQwMDAsCi0gICAgTUlYX1RDX0ZzMzIwM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E9SIENPTkRJVElPTlMgT0YgQU5ZIEtJTkQsIGVpdGhlciBleHByZXNzIG9yIGltcGxpZWQuCi0gKiBTZWUgdGhlIExpY2Vuc2UgZm9yIHRoZSBzcGVjaWZpYyBsYW5ndWFnZSBnb3Zlcm5pbmcgcGVybWlzc2lvbnMgYW5kCi0gKiBsaW1pdGF0aW9ucyB1bmRlciB0aGUgTGljZW5zZS4KLSAqLwotCi0KLS8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0vKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogICAgSW5jbHVkZXMgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotI2lmbmRlZiBfX0xWQkRFX1RBQkxFU19IX18KLSNkZWZpbmUgX19MVkJERV9UQUJMRVNfSF9fCi0KLSNpZmRlZiBfX2NwbHVzcGx1cwotZXh0ZXJuICJDIiB7Ci0jZW5kaWYgLyogX19jcGx1c3BsdXMgKi8KLQotI2luY2x1ZGUgIkJJUVVBRC5oIgotI2luY2x1ZGUgIkxWTV9UeXBlcy5oIgotCi0vKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotLyogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICAgIENvZWZmaWNpZW50cyBjb25zdGFudCB0YWJsZSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLQotLyoKLSAqIEhpZ2ggUGFzcyBGaWx0ZXIgQ29lZmZpY2llbnQgdGFibGUKLSAqLwotZXh0ZXJuIGNvbnN0IEJRX0MzMl9Db2Vmc190IExWREJFX0hQRl9UYWJsZVtdOwotCi0vKgotICogQmFuZCBQYXNzIEZpbHRlciBjb2VmZmljaWVudCB0YWJsZQotICovCi1leHRlcm4gY29uc3QgQlBfQzMyX0NvZWZzX3QgTFZEQkVfQlBGX1RhYmxlW107Ci0KLS8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0vKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogICAgQUdDIGNvbnN0YW50IHRhYmxlcyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotCi0vKiBBdHRhY2sgdGltZSAoc2lnbmFsIHRvbyBsYXJnZSkgKi8KLWV4dGVybiBjb25zdCBMVk1fSU5UMTYgTFZEQkVfQUdDX0FUVEFDS19UYWJsZVtdOwotCi0vKiBEZWNheSB0aW1lIChzaWduYWwgdG9vIHNtYWxsKSAqLwotZXh0ZXJuIGNvbnN0IExWTV9JTlQxNiBMVkRCRV9BR0NfREVDQVlfVGFibGVbXTsKLQotLyogR2FpbiBmb3IgdXNlIHdpdGhvdXQgdGhlIGhpZ2ggcGFzcyBmaWx0ZXIgKi8KLWV4dGVybiBjb25zdCBMVk1fSU5UMzIgTFZEQkVfQUdDX0dBSU5fVGFibGVbXTsKLQotLyogR2FpbiBmb3IgdXNlIHdpdGggdGhlIGhpZ2ggcGFzcyBmaWx0ZXIgKi8KLWV4dGVybiBjb25zdCBMVk1fSU5UMzIgTFZEQkVfQUdDX0hQRkdBSU5fVGFibGVbXTsKLQotLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLS8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgICBWb2x1bWUgY29udHJvbCBnYWluIGFuZCB0aW1lIGNvbnN0YW50IHRhYmxlcyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0KLS8qIGRCIHRvIGxpbmVhciBjb252ZXJzaW9uIHRhYmxlICovCi1leHRlcm4gY29uc3QgTFZNX0lOVDE2IExWREJFX1ZvbHVtZVRhYmxl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QgdG8gaW4gd3JpdGluZywgc29mdHdhcmUKLSAqIGRpc3RyaWJ1dGVkIHVuZGVyIHRoZSBMaWNlbnNlIGlzIGRpc3RyaWJ1dGVkIG9uIGFuICJBUyBJUyIgQkFTSVMsCi0gKiBXSVRIT1VUIFdBUlJBTlRJRVMgT1IgQ09ORElUSU9OUyBPRiBBTlkgS0lORCwgZWl0aGVyIGV4cHJlc3Mgb3IgaW1wbGllZC4KLSAqIFNlZSB0aGUgTGljZW5zZSBmb3IgdGhlIHNwZWNpZmljIGxhbmd1YWdlIGdvdmVybmluZyBwZXJtaXNzaW9ucyBhbmQKLSAqIGxpbWl0YXRpb25zIHVuZGVyIHRoZSBMaWNlbnNlLgotICovCi0KLS8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotLyogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgSGVhZGVyIGZpbGUgZm9yIHRoZSBhcHBsaWNhdGlvbiBsYXllciBpbnRlcmZhY2Ugb2YgQ29uY2VydCBTb3VuZCwgQmFzcyBFbmhhbmNlbWVudCwgKi8KLS8qICBFcXVhbGl6ZXIsIFBvd2VyIFNwZWN0cnVtIEFuYWx5emVyLCBUcmViYmxlIEVuaGFuY2VtZW50IGFuZCB2b2x1bWUgbWFuYWdlbWVudCAgICAgICAqLwotLyogIGJ1bmRsZS4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICBUaGlzIGZpbGVzIGluY2x1ZGVzIGFsbCBkZWZpbml0aW9ucywgdHlwZXMsIHN0cnVjdHVyZXMgYW5kIGZ1bmN0aW9uICAgICAgICAgICAgICAgICAqLwotLyogIHByb3RvdHlwZXMgcmVxdWlyZWQgYnkgdGhlIGNhbGxpbmcgbGF5ZXIuIEFsbCBvdGhlciB0eXBlcywgc3RydWN0dXJlcyBhbmQgICAgICAgICAgICovCi0vKiAgZnVuY3Rpb25zIGFyZSBwcml2YXRlLiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0vKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICBOb3RlOiAxICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogID09PT09PT0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgVGhlIGFsZ29yaXRobSBjYW4gZXhlY3V0ZSBlaXRoZXIgd2l0aCBzZXBhcmF0ZSBpbnB1dCBhbmQgb3V0cHV0IGJ1ZmZlcnMgb3Igd2l0aCAgICAgKi8KLS8qICBhIGNvbW1vbiBidWZmZXIsIGkuZS4gdGhlIGRhdGEgaXMgcHJvY2Vzc2VkIGluLXBsYWNlLiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLS8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogIE5vdGU6IDIgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgPT09PT09PSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICBUaHJlZSBkYXRhIGZvcm1hdHMgYXJlIHN1cHBvcnQgU3RlcmVvLE1vbm8tSW4tU3RlcmVvIGFuZCBNb25vLiBUaGUgZGF0YSBpcyAgICAgICAgICAqLwotLyogIGludGVybGVhdmVkIGFzIGZvbGxvd3M6ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICBCeXRlIE9mZnNldCAgICAgICAgIFN0ZXJlbyBJbnB1dCAgICAgICAgIE1vbm8tSW4tU3RlcmVvIElucHV0ICAgICAgIE1vbm8gSW5wdXQgICAgICAqLwotLyogID09PT09PT09PT09ICAgICAgICAgPT09PT09PT09PT09ICAgICAgICAgPT09PT09PT09PT09PT09PT09PT0gICAgID09PT09PT09PT09PT09ICAgICovCi0vKiAgICAgIDAgICAgICAgICAgICAgICBMZWZ0IFNhbXBsZSAjMSAgICAgICAgICBNb25vIFNhbXBsZSAjMSAgICAgICAgTW9ubyBTYW1wbGUgIzEgICAgKi8KLS8qICAgICAgMiAgICAgICAgICAgICAgIFJpZ2h0IFNhbXBsZSAjMSAgICAgICAgIE1vbm8gU2FtcGxlICMxICAgICAgICBNb25vIFNhbXBsZSAjMiAgICAqLwotLyogICAgICA0ICAgICAgICAgICAgICAgTGVmdCBTYW1wbGUgIzIgICAgICAgICAgTW9ubyBTYW1wbGUgIzIgICAgICAgIE1vbm8gU2FtcGxlICMzICAgICovCi0vKiAgICAgIDYgICAgICAgICAgICAgICBSaWdodCBTYW1wbGUgIzIgICAgICAgICBNb25vIFNhbXBsZSAjMiAgICAgICAgTW9ubyBTYW1wbGUgIzQgICAgKi8KLS8qICAgICAgLiAgICAgICAgICAgICAgICAgICAgICAuICAgICAgICAgICAgICAgICAgICAgLiAgICAgICAgICAgICAgICAgICAgIC4gICAgICAgICAgICAqLwotLyogICAgICAuICAgICAgICAgICAgICAgICAgICAgIC4gICAgICAgICAgICAgICAgICAgICAuICAgICAgICAgICAgICAgICAgICAgLiAgICAgICAgICAgICovCi0vKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotCi0jaWZuZGVmIF9fTFZNX0hfXwotI2RlZmluZSBfX0xWTV9IX18KLQotI2lmZGVmIF9fY3BsdXNwbHVzCi1leHRlcm4gIkMiIHsKLSNlbmRpZiAvKiBfX2NwbHVzcGx1cyAqLwotCi0KLS8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotLyogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgSW5jbHVkZXMgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0KLSNpbmNsdWRlICJMVk1fVHlwZXMuaCIKLQotCi0vKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLS8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogIERlZmluaXRpb25zICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotCi0vKiBNZW1vcnkgdGFibGUqLwotI2RlZmluZSBMVk1fTlJfTUVNT1JZX1JFR0lPTlMgICAgICAgICAgICAgICAgIDQgICAgIC8qIE51bWJlciBvZiBtZW1vcnkgcmVnaW9ucyAqLwotCi0vKiBDb25jZXJ0IFNvdW5kIGVmZmVjdCBsZXZlbCBwcmVzZXRzICovCi0jZGVmaW5lIExWTV9DU19FRkZFQ1RfTk9ORSAgICAgICAgICAgICAgICAgICAgMCAgICAgLyogMCUgZWZmZWN0LCBtaW5pbXVtIHZhbHVlICovCi0jZGVmaW5lIExWTV9DU19FRkZFQ1RfTE9XICAgICAgICAgICAgICAgICAxNjM4NCAgICAgLyogNTAlIGVmZmVjdCAqLwotI2RlZmluZSBMVk1fQ1NfRUZGRUNUX01FRCAgICAgICAgICAgICAgICAgMjQ1NzYgICAgIC8qIDc1JSBlZmZlY3QgKi8KLSNkZWZpbmUgTFZNX0NTX0VGRkVDVF9ISUdIICAgICAgICAgICAgICAgIDMyNzY3ICAgICAvKiAxMDAlIGVmZmVjdCwgbWF4aW11bSB2YWx1ZSAqLwotCi0vKiBUcmVibGUgZW5oYW5jZW1lbnQgKi8KLSNkZWZpbmUgTFZNX1RFX0xPV19NSVBTICAgICAgICAgICAgICAgICAgIDMyNzY3Ci0KLS8qIEJhc3MgZW5oYW5jZW1lbnQgZWZmZWN0IGxldmVsIHByZXNldHMgKi8KLSNkZWZpbmUgTFZNX0JFXzBEQiAgICAgICAgICAgICAgICAgICAgICAgICAgICAwICAgICAvKiAwZEIgYm9vc3QsIG5vIGVmZmVjdCAqLwotI2RlZmluZSBMVk1fQkVfM0RCICAgICAgICAgICAgICAgICAgICAgICAgICAgIDMgICAgIC8qICszZEIgYm9vc3QgKi8KLSNkZWZpbmUgTFZNX0JFXzZEQiAgICAgICAgICAgICAgICAgICAgICAgICAgICA2ICAgICAvKiArNmRCIGJvb3N0ICovCi0jZGVmaW5lIExWTV9CRV85REIgICAgICAgICAgICAgICAgICAgICAgICAgICAgOSAgICAgLyogKzlkQiBib29zdCAqLwotI2RlZmluZSBMVk1fQkVfMTJEQiAgICAgICAgICAgICAgICAgICAgICAgICAgMTIgICAgIC8qICsxMmRCIGJvb3N0ICovCi0jZGVmaW5lIExWTV9CRV8xNURCICAgICAgICAgICAgICAgICAgICAgICAgICAxNSAgICAgLyogKzE1ZEIgYm9vc3QgKi8KLQotLyogTi1CYW5kIEVxdWFsaXplciAqLwotI2RlZmluZSBMVk1fRVFfTkJBTkRTICAgICAgICAgICAgICAgICAgICAgICAgIDUgICAgLyogTnVtYmVyIG9mIGJhbmRzIGZvciBlcXVhbGl6ZXIgKi8KLQotLyogSGVhZHJvb20gbWFuYWdlbWVudCAqLwotI2RlZmluZSBMVk1fSEVBRFJPT01fTUFYX05CQU5EUyAgICAgICAgICAgICAgIDUKLQotLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0vKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICBUeXBlcyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLQotLyogSW5zdGFuY2UgaGFuZGxlICovCi10eXBlZGVmIHZvaWQgKkxWTV9IYW5kbGVfdDsKLQotCi0vKiBTdGF0dXMgcmV0dXJuIHZhbHVlcyAqLwotdHlwZWRlZiBlbnVtCi17Ci0gICAgTFZNX1NVQ0NFU1MgICAgICAgICAgICA9IDAsICAgICAgICAgICAgICAgICAgICAgLyogU3VjY2Vzc2Z1bCByZXR1cm4gZnJvbSBhIHJvdXRpbmUgKi8KLSAgICBMVk1fQUxJR05NRU5URVJST1IgICAgID0gMSwgICAgICAgICAgICAgICAgICAgICAvKiBNZW1vcnkgYWxpZ25tZW50IGVycm9yICovCi0gICAgTFZNX05VTExBRERSRVNTICAgICAgICA9IDIsICAgICAgICAgICAgICAgICAgICAgLyogTlVMTCBhbGxvY2F0aW9uIGFkZHJlc3MgKi8KLSAgICBMVk1fT1VUT0ZSQU5HRSAgICAgICAgID0gMywgICAgICAgICAgICAgICAgICAgICAvKiBPdXQgb2YgcmFuZ2UgY29udHJvbCBwYXJhbWV0ZXIgKi8KLSAgICBMVk1fSU5WQUxJRE5VTVNBTVBMRVMgID0gNCwgICAgICAgICAgICAgICAgICAgICAvKiBJbnZhbGlkIG51bWJlciBvZiBzYW1wbGVzICovCi0gICAgTFZNX1dST05HQVVESU9USU1FICAgICA9IDUsICAgICAgICAgICAgICAgICAgICAgLyogV3JvbmcgdGltZSB2YWx1ZSBmb3IgYXVkaW8gdGltZSovCi0gICAgTFZNX0FMR09SSVRITURJU0FCTEVEICA9IDYsICAgICAgICAgICAgICAgICAgICAgLyogQWxnb3JpdGhtIGlzIGRpc2FibGVkKi8KLSAgICBMVk1fQUxHT1JJVEhNUFNBICAgICAgID0gNywgICAgICAgICAgICAgICAgICAgICAvKiBBbGdvcml0aG0gUFNBIHJldHVybnMgYW4gZXJyb3IgKi8KLSAgICBMVk1fUkVUVVJOU1RBVFVTX0RVTU1ZID0gTFZNX01BWEVOVU0KLX0gTFZNX1JldHVyblN0YXR1c19lbjsKLQotCi0vKiBCdWZmZXIgTWFuYWdlbWVudCBtb2RlICovCi10eXBlZGVmIGVudW0KLXsKLSAgICBMVk1fTUFOQUdFRF9CVUZGRVJTICAgPSAwLAotICAgIExWTV9VTk1BTkFHRURfQlVGRkVSUyA9IDEsCi0gICAgTFZNX0JVRkZFUlNfRFVNTVkgICAgID0gTFZNX01BWEVOVU0KLX0gTFZNX0J1ZmZlck1vZGVfZW47Ci0KLS8qIE91dHB1dCBkZXZpY2UgdHlwZSAqLwotdHlwZWRlZiBlbnVtCi17Ci0gICAgTFZNX0hFQURQSE9ORVMgICAgICAgICAgICAgPSAwLAotICAgIExWTV9FWF9IRUFE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ICAgICAgICAgICAgICAgLyogUGVhayBkZWNheWluZyBhdCBtZWRpdW0gc3BlZWQgKi8KLSAgICBMVk1fUFNBX1NQRUVEX0ZBU1QsICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8qIFBlYWsgZGVjYXlpbmcgYXQgZmFzdCBzcGVlZCAqLwotICAgIExWTV9QU0FfU1BFRURfRFVNTVkgPSBMVk1fTUFYRU5VTQotfSBMVk1fUFNBX0RlY2F5U3BlZWRfZW47Ci0KLXR5cGVkZWYgZW51bQotewotICAgIExWTV9QU0FfT0ZGICAgPSAwLAotICAgIExWTV9QU0FfT04gICAgPSAxLAotICAgIExWTV9QU0FfRFVNTVkgPSBMVk1fTUFYRU5VTQotfSBMVk1fUFNBX01vZGVfZW47Ci0KLS8qIFZlcnNpb24gaW5mb3JtYXRpb24gKi8KLXR5cGVkZWYgc3RydWN0Ci17Ci0gICAgTFZNX0NIQVIgICAgICAgICAgICAgICAgICAgICpwVmVyc2lvbk51bWJlcjsgICAgICAgIC8qIFBvaW50ZXIgdG8gdGhlIHZlcnNpb24gbnVtYmVyIGluIHRoZSBmb3JtYXQgWC5ZWS5aWiAqLwotICAgIExWTV9DSEFSICAgICAgICAgICAgICAgICAgICAqcFBsYXRmb3JtOyAgICAgICAgICAgICAvKiBQb2ludGVyIHRvIHRoZSBsaWJyYXJ5IHBsYXRmb3JtIHR5cGUgKi8KLX0gTFZNX1ZlcnNpb25JbmZvX3N0OwotCi0KLS8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotLyogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgU3RydWN0dXJlcyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0KLS8qIE1lbW9yeSB0YWJsZSBjb250YWluaW5nIHRoZSByZWdpb24gZGVmaW5pdGlvbnMgKi8KLXR5cGVkZWYgc3RydWN0Ci17Ci0gICAgTFZNX01lbW9yeVJlZ2lvbl9zdCAgICAgICAgIFJlZ2lvbltMVk1fTlJfTUVNT1JZX1JFR0lPTlNdOyAgLyogT25lIGRlZmluaXRpb24gZm9yIGVhY2ggcmVnaW9uICovCi19IExWTV9NZW1UYWJfdDsKLQotLyogTi1CYW5kIGVxdWFsaXNlciBiYW5kIGRlZmluaXRpb24gKi8KLXR5cGVkZWYgc3RydWN0Ci17Ci0gICAgTFZNX0lOVDE2ICAgICAgICAgICAgICAgICAgIEdhaW47ICAgICAgICAgICAgICAgICAgIC8qIEJhbmQgZ2FpbiBpbiBkQiAqLwotICAgIExWTV9VSU5UMTYgICAgICAgICAgICAgICAgICBGcmVxdWVuY3k7ICAgICAgICAgICAgICAvKiBCYW5kIGNlbnRyZSBmcmVxdWVuY3kgaW4gSHogKi8KLSAgICBMVk1fVUlOVDE2ICAgICAgICAgICAgICAgICAgUUZhY3RvcjsgICAgICAgICAgICAgICAgLyogQmFuZCBxdWFsaXR5IGZhY3RvciAoeDEwMCkgKi8KLX0gTFZNX0VRTkJfQmFuZERlZl90OwotCi0KLS8qIEhlYWRyb29tIGJhbmQgZGVmaW5pdGlvbiAqLwotdHlwZWRlZiBzdHJ1Y3QKLXsKLSAgICBMVk1fVUlOVDE2ICAgICAgICAgICAgICAgICAgTGltaXRfTG93OyAgICAgICAgICAgICAgLyogTG93IGZyZXF1ZW5jeSBsaW1pdCBvZi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gIExWTV9WaXJ0dWFsaXplclR5cGVfZW4gICAgICBWaXJ0dWFsaXplclR5cGU7ICAgICAgICAgIC8qIFZpcnR1YWxpemVyIHR5cGU6IENvbmNlcnRTb3VuZCAqLwotICAgIExWTV9VSU5UMTYgICAgICAgICAgICAgICAgICBWaXJ0dWFsaXplclJldmVyYkxldmVsOyAgIC8qIFZpcnR1YWxpemVyIHJldmVyYiBsZXZlbCBpbiAlICovCi0gICAgTFZNX0lOVDE2ICAgICAgICAgICAgICAgICAgIENTX0VmZmVjdExldmVsOyAgICAgICAgICAgLyogQ29uY2VydCBTb3VuZCBlZmZlY3QgbGV2ZWwgKi8KLQotICAgIC8qIE4tQmFuZCBFcXVhbGlzZXIgcGFyYW1ldGVycyAqLwotICAgIExWTV9FUU5CX01vZGVfZW4gICAgICAgICAgICBFUU5CX09wZXJhdGluZ01vZGU7ICAgICAvKiBOLUJhbmQgRXF1YWxpc2VyIG9wZXJhdGluZyBtb2RlICovCi0gICAgTFZNX1VJTlQxNiAgICAgICAgICAgICAgICAgIEVRTkJfTkJhbmRzOyAgICAgICAgICAgIC8qIE51bWJlciBvZiBiYW5kcyAqLwotICAgIExWTV9FUU5CX0JhbmREZWZfdCAgICAgICAgICAqcEVRTkJfQmFuZERlZmluaXRpb247ICAvKiBQb2ludGVyIHRvIGVxdWFsaXNlciBkZWZpbml0aW9ucyAqLwotCi0gICAgLyogQmFzcyBFbmhhbmNlbWVudCBwYXJhbWV0ZXJzICovCi0gICAgTFZNX0JFX01vZGVfZW4gICAgICAgICAgICAgIEJFX09wZXJhdGluZ01vZGU7ICAgICAgIC8qIEJhc3MgRW5oYW5jZW1lbnQgb3BlcmF0aW5nIG1vZGUgKi8KLSAgICBMVk1fSU5UMTYgICAgICAgICAgICAgICAgICAgQkVfRWZmZWN0TGV2ZWw7ICAgICAgICAgLyogQmFzcyBFbmhhbmNlbWVudCBlZmZlY3QgbGV2ZWwgKi8KLSAgICBMVk1fQkVfQ2VudHJlRnJlcV9lbiAgICAgICAgQkVfQ2VudHJlRnJlcTsgICAgICAgICAgLyogQmFzcyBFbmhhbmNlbWVudCBjZW50cmUgZnJlcXVlbmN5ICovCi0gICAgTFZNX0JFX0ZpbHRlclNlbGVjdF9lbiAgICAgIEJFX0hQRjsgICAgICAgICAgICAgICAgIC8qIEJhc3MgRW5oYW5jZW1lbnQgaGlnaCBwYXNzIGZpbHRlciBzZWxlY3RvciAqLwotCi0gICAgLyogVm9sdW1lIENvbnRyb2wgcGFyYW1ldGVycyAqLwotICAgIExWTV9JTlQxNiAgICAgICAgICAgICAgICAgICBWQ19FZmZlY3RMZXZlbDsgICAgICAgICAvKiBWb2x1bWUgQ29udHJvbCBzZXR0aW5nIGluIGRCcyAqLwotICAgIExWTV9JTlQxNiAgICAgICAgICAgICAgICAgICBWQ19CYWxhbmNlOyAgICAgICAgICAgICAvKiBMZWZ0IFJpZ2h0IEJhbGFuY2UgY29udHJvbCBpbiBkQiAoLTk2IHRvIDk2IGRCKSwgLXZlIHZhbHVlcyByZWR1Y2UKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgUmlnaHQgY2hhbm5lbCB3aGlsZSArdmUgdmFsdWUgcmVkdWNlcyBMZWZ0IGNoYW5uZWwqLwotCi0gICAgLyogVHJlYmxlIEVuaGFuY2VtZW50IHBhcmFtZXRlcnMgKi8KLSAgICBMVk1fVEVfTW9kZV9lbiAgICAgICAgICAgICAgVEVfT3BlcmF0aW5nTW9kZTsgICAgICAgLyogVHJlYmxlIEVuaGFuY2VtZW50IE9uL09mZiAqLwotICAgIExWTV9JTlQxNiAgICAgICAgICAgICAgICAgICBURV9FZmZlY3RMZXZlbDsgICAgICAgICAvKiBUcmVibGUgRW5oYW5jZW1lbnQgZ2FpbiBkQnMgKi8KLQotICAgIC8qIFNwZWN0cnVtIEFuYWx5emVyIHBhcmFtZXRlcnMgQ29udHJvbCAqLwotICAgIExWTV9QU0FfTW9kZV9lbiAgICA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AgIExWTV9IZWFkcm9vbUJhbmREZWZfdCAgICAgICAqcEhlYWRyb29tRGVmaW5pdGlvbjsgICAvKiBQb2ludGVyIHRvIGhlYWRyb29tIGJhbmRzIGRlZmluaXRpb24gKi8KLSAgICBMVk1fVUlOVDE2ICAgICAgICAgICAgICAgICAgTkhlYWRyb29tQmFuZHM7ICAgICAgICAgLyogTnVtYmVyIG9mIGhlYWRyb29tIGJhbmRzICovCi0KLX0gTFZNX0hlYWRyb29tUGFyYW1zX3Q7Ci0KLS8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotLyogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgRnVuY3Rpb24gUHJvdG90eXBlcyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0KLQotLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0vKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qIEZVTkNUSU9OOiAgICAgICAgICAgICAgICBMVk1fR2V0VmVyc2lvbkluZm8gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiBERVNDUklQVElPTjogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICBUaGlzIGZ1bmN0aW9uIGlzIHVzZWQgdG8gcmV0cmlldmUgaW5mb3JtYXRpb24gYWJvdXQgdGhlIGxpYnJhcnkncyB2ZXJzaW9uLiAgICAgICAgICAqLwotLyogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiBQQVJBTUVURVJTOiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICBwVmVyc2lvbiAgICAgICAgICAgICAgICBQb2ludGVyIHRvIGFuIGVtcHR5IHZlcnNpb24gaW5mbyBzdHJ1Y3R1cmUgICAgICAgICAgICAgICAgICAqLwotLyogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiBSRVRVUk5TOiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICBMVk1fU1VDQ0VTUyAgICAgICAgICAgICBTdWNjZWVkZWQgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogIExWTV9OVUxMQUREUkVTUyAgICAgICAgIHdoZW4gcFZlcnNpb24gaXMgTlVMTCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qIE5PVEVTOiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogIDEuICBUaGlzIGZ1bmN0aW9uIG1heSBiZSBpbnRlcnJ1cHRlZCBieSB0aGUgTFZNX1Byb2Nlc3MgZnVuY3Rpb24gICAgICAgICAgICAgICAgICAgICovCi0vKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotTFZNX1JldHVyblN0YXR1c19lbiBMVk1fR2V0VmVyc2lvbkluZm8oTFZNX1ZlcnNpb25JbmZvX3N0ICAqcFZlcnNpb24pOwotCi0KLS8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotLyogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiBGVU5DVElPTjogICAgICAgICAgICAgICAgTFZNX0dldE1lbW9yeVRhYmxlICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogREVTQ1JJUFRJT046ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgVGhpcyBmdW5jdGlvbiBpcyB1c2VkIGZvciBtZW1vcnkgYWxsb2NhdGlvbiBhbmQgZnJlZS4gSXQgY2FuIGJlIGNhbGxlZCBpbiAgICAgICAgICAgKi8KLS8qICB0d28gd2F5czogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgICAgIGhJbnN0YW5jZSA9IE5VTEwgICAgICAgICAgICAgICAgUmV0dXJucyB0aGUgbWVtb3J5IHJlcXVpcmVtZW50cyAgICAgICAgICAgICAgICAgKi8KLS8qICAgICAgaEluc3RhbmNlID0gSW5zdGFuY2UgaGFuZGxlICAgICBSZXR1cm5zIHRoZSBtZW1vcnkgcmVxdWlyZW1lbnRzIGFuZCAgICAgICAgICAgICAqLwotLyogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGFsbG9jYXRlZCBiYXNlIGFkZHJlc3NlcyBmb3IgdGhlIGluc3RhbmNlICAgICAgICovCi0vKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICBXaGVuIHRoaXMgZnVuY3Rpb24gaXMgY2FsbGVkIGZvciBtZW1vcnkgYWxsb2NhdGlvbiAoaEluc3RhbmNlPU5VTEwpIHRoZSBtZW1vcnkgICAgICAqLwotLyogIGJhc2UgYWRkcmVzcyBwb2ludGVycyBhcmUgTlVMTCBvbiByZXR1cm4uICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICBXaGVuIHRoZSBmdW5jdGlvbiBpcyBjYWxsZWQgZm9yIGZyZWUgKGhJbnN0YW5jZSA9IEluc3RhbmNlIEhhbmRsZSkgdGhlIG1lbW9yeSAgICAgICAqLwotLyogIHRhYmxlIHJldHVybnMgdGhlIGFsbG9jYXRlZCBtZW1vcnkgYW5kIGJhc2UgYWRkcmVzc2VzIHVzZWQgZHVyaW5nIGluaXRpYWxpc2F0aW9uLiAgICovCi0vKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qIFBBUkFNRVRFUlM6ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogIGhJbnN0YW5jZSAgICAgICAgICAgICAgIEluc3RhbmNlIEhhbmRsZSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgcE1lbW9yeVRhYmxlICAgICAgICAgICAgUG9pbnRlciB0byBhbiBlbXB0eSBtZW1vcnkgZGVmaW5pdGlvbiB0YWJsZSAgICAgICAgICAgICAgICAgKi8KLS8qICBwSW5zdFBhcmFtcyAgICAgICAgICAgICBQb2ludGVyIHRvIHRoZSBpbnN0YW5jZSBwYXJhbWV0ZXJzICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiBSRVRVUk5TOiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICBMVk1fU1VDQ0VTUyAgICAgICAgICAgICBTdWNjZWVkZWQgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogIExWTV9OVUxMQUREUkVTUyAgICAgICAgIFdoZW4gb25lIG9mIHBNZW1vcnlUYWJsZSBvciBwSW5zdFBhcmFtcyBpcyBOVUxMICAgICAgICAgICAgICovCi0vKiAgTFZNX09VVE9GUkFOR0UgICAgICAgICAgV2hlbiBhbnkgb2YgdGhlIEluc3RhbmNlIHBhcmFtZXRlcnMgYXJlIG91dCBvZiByYW5nZSAgICAgICAgKi8KLS8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogTk9URVM6ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgMS4gIFRoaXMgZnVuY3Rpb24gbWF5IGJlIGludGVycnVwdGVkIGJ5IHRoZSBMVk1fUHJvY2VzcyBmdW5jdGlvbiAgICAgICAgICAgICAgICAgICAgKi8KLS8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi1MVk1fUmV0dXJuU3RhdHVzX2VuIExWTV9HZXRNZW1vcnlUYWJsZShMVk1fSGFuZGxlX3QgICAgICAgICBoSW5zdGFuY2UsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBMVk1fTWVtVGFiX3QgICAgICAgICAqcE1lbW9yeVRhYmxlLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTFZNX0luc3RQYXJhbXNfdCAgICAgKnBJbnN0UGFyYW1zKTsKLQotCi0vKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLS8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogRlVOQ1RJT046ICAgICAgICAgICAgICAgIExWTV9HZXRJbnN0YW5jZUhhbmRsZSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qIERFU0NSSVBUSU9OOiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogIFRoaXMgZnVuY3Rpb24gaXMgdXNlZCB0byBjcmVhdGUgYSBidW5kbGUgaW5zdGFuY2UuIEl0IHJldHVybnMgdGhlIGNyZWF0ZWQgaW5zdGFuY2UgICovCi0vKiAgaGFuZGxlIHRocm91Z2ggcGhJbnN0YW5jZS4gQWxsIHBhcmFtZXRlcnMgYXJlIHNldCB0byB0aGVpciBkZWZhdWx0LCBpbmFjdGl2ZSBzdGF0ZS4gKi8KLS8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogUEFSQU1FVEVSUzogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgcGhJbnN0YW5jZSAgICAgICAgICAgICAgcG9pbnRlciB0byB0aGUgaW5zdGFuY2UgaGFuZGxlICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICBwTWVtb3J5VGFibGUgICAgICAgICAgICBQb2ludGVyIHRvIHRoZSBtZW1vcnkgZGVmaW5pdGlvbiB0YWJsZSAgICAgICAgICAgICAgICAgICAgICAqLwotLyogIHBJbnN0UGFyYW1zICAgICAgICAgICAgIFBvaW50ZXIgdG8gdGhlIGluc3RhbmNlIHBhcmFtZXRlcnMgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qIFJFVFVSTlM6ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogIExWTV9TVUNDRVNTICAgICAgICAgICAgIEluaXRpYWxpc2F0aW9uIHN1Y2NlZWRlZCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgTFZNX05VTExBRERSRVNTICAgICAgICAgT25lIG9yIG1vcmUgbWVtb3J5IGhhcyBhIE5VTEwgcG9pbnRlciAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICBMVk1fT1VUT0ZSQU5HRSAgICAgICAgICBXaGVuIGFueSBvZiB0aGUgSW5zdGFuY2UgcGFyYW1ldGVycyBhcmUgb3V0IG9mIHJhbmdlICAgICAgICAqLwotLyogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiBOT1RFUzogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICAxLiBUaGlzIGZ1bmN0aW9uIG11c3Qgbm90IGJlIGludGVycnVwdGVkIGJ5IHRoZSBMVk1fUHJvY2VzcyBmdW5jdGlvbiAgICAgICAgICAgICAgICAqLwotLyogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLUxWTV9SZXR1cm5TdGF0dXNfZW4gTFZNX0dldEluc3RhbmNlSGFuZGxlKExWTV9IYW5kbGVfdCAgICAgICAgKnBoSW5zdGFuY2UsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBMVk1fTWVtVGFiX3QgICAgICAgICpwTWVtb3J5VGFibGUsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBMVk1fSW5zdFBhcmFtc190ICAgICpwSW5zdFBhcmFtcyk7Ci0KLQotLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0vKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qIEZVTkNUSU9OOiAgICAgICAgICAgICAgICBMVk1fQ2xlYXJBdWRpb0J1ZmZlcnMgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiBERVNDUklQVElPTjogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICBUaGlzIGZ1bmN0aW9uIGlzIHVzZWQgdG8gY2xlYXIgdGhlIGludGVybmFsIGF1ZGlvIGJ1ZmZlcnMgb2YgdGhlIGJ1bmRsZS4gICAgICAgICAgICAqLwotLyogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiBQQVJBTUVURVJTOiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICBoSW5zdGFuY2UgICAgICAgICAgICAgICBJbnN0YW5jZSBoYW5kbGUgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiBSRVRVUk5TOiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICBMVk1fU1VDQ0VTUyAgICAgICAgICAgICBJbml0aWFsaXNhdGlvbiBzdWNjZWVkZWQgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogIExWTV9OVUxMQUREUkVTUyAgICAgICAgIEluc3RhbmNlIG1lbW9yeSBoYXMgYSBOVUxMIHBvaW50ZXIgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qIE5PVEVTOiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogIDEuIFRoaXMgZnVuY3Rpb24gbXVzdCBub3QgYmUgaW50ZXJydXB0ZWQgYnkgdGhlIExWTV9Qcm9jZXNzIGZ1bmN0aW9uICAgICAgICAgICAgICAgICovCi0vKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotTFZNX1JldHVyblN0YXR1c19lbiBMVk1fQ2xlYXJBdWRpb0J1ZmZlcnMoTFZNX0hhbmRsZV90ICBoSW5zdGFuY2UpOwotCi0KLS8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotLyogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiBGVU5DVElPTjogICAgICAgICAgICAgICAgIExWTV9HZXRDb250cm9sUGFyYW1ldGVycyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogREVTQ1JJUFRJT046ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgUmVxdWVzdCB0aGUgTGlmZVZpYmVzIG1vZHVsZSBwYXJhbWV0ZXJzLiBUaGUgY3VycmVudCBwYXJhbWV0ZXIgc2V0IGlzIHJldHVybmVkICAgICAgKi8KLS8qICB2aWEgdGhlIHBhcmFtZXRlciBwb2ludGVyLiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiBQQVJBTUVURVJTOiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICBoSW5zdGFuY2UgICAgICAgICAgICAgICAgSW5zdGFuY2UgaGFuZGxlICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogIHBQYXJhbXMgICAgICAgICAgICAgICAgICBQb2ludGVyIHRvIGFuIGVtcHR5IHBhcmFtZXRlciBzdHJ1Y3R1cmUgICAgICAgICAgICAgICAgICAgICovCi0vKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qIFJFVFVSTlM6ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogIExWTV9TVUNDRVNTICAgICAgICAgICAgIFN1Y2NlZWRlZCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgTFZNX05VTExBRERSRVNTICAgICAgICAgd2hlbiBhbnkgb2YgaEluc3RhbmNlIG9yIHBQYXJhbXMgaXMgTlVMTCAgICAgICAgICAgICAgICAgICAgKi8KLS8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogTk9URVM6ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgMS4gIFRoaXMgZnVuY3Rpb24gbWF5IGJlIGludGVycnVwdGVkIGJ5IHRoZSBMVk1fUHJvY2VzcyBmdW5jdGlvbiAgICAgICAgICAgICAgICAgICAgKi8KLS8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi1MVk1fUmV0dXJuU3RhdHVzX2VuIExWTV9HZXRDb250cm9sUGFyYW1ldGVycyhMVk1fSGFuZGxlX3QgICAgICAgICAgIGhJbnN0YW5jZSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIExWTV9Db250cm9sUGFyYW1zX3QgICAgKnBQYXJhbXMpOwotCi0KLS8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotLyogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiBGVU5DVElPTjogICAgICAgICAgICAgICAgTFZNX1NldENvbnRyb2xQYXJhbWV0ZXJzICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogREVTQ1JJUFRJT046ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgU2V0cyBvciBjaGFuZ2VzIHRoZSBMaWZlVmliZXMgbW9kdWxlIHBhcmFtZXRlcnMuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogUEFSQU1FVEVSUzogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgaEluc3RhbmNlICAgICAgICAgICAgICAgSW5zdGFuY2UgaGFuZGxlICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICBwUGFyYW1zICAgICAgICAgICAgICAgICBQb2ludGVyIHRvIGEgcGFyYW1ldGVyIHN0cnVjdHVyZSAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiBSRVRVUk5TOiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICBMVk1fU1VDQ0VTUyAgICAgICAgICAgICBTdWNjZWVkZWQgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogIExWTV9OVUxMQUREUkVTUyAgICAgICAgIFdoZW4gaEluc3RhbmNlLCBwUGFyYW1zIG9yIGFueSBjb250cm9sIHBvaW50ZXJzIGFyZSBOVUxMICAgICovCi0vKiAgTFZNX09VVE9GUkFOR0UgICAgICAgICAgV2hlbiBhbnkgb2YgdGhlIGNvbnRyb2wgcGFyYW1ldGVycyBhcmUgb3V0IG9mIHJhbmdlICAgICAgICAgKi8KLS8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogTk9URVM6ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgMS4gIFRoaXMgZnVuY3Rpb24gbWF5IGJlIGludGVycnVwdGVkIGJ5IHRoZSBMVk1fUHJvY2VzcyBmdW5jdGlvbiAgICAgICAgICAgICAgICAgICAgKi8KLS8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi1MVk1fUmV0dXJuU3RhdHVzX2VuIExWTV9TZXRDb250cm9sUGFyYW1ldGVycyhMVk1fSGFuZGxlX3QgICAgICAgICAgIGhJbnN0YW5jZSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIExWTV9Db250cm9sUGFyYW1zX3QgICAgKnBQYXJhbXMpOwotCi0KLS8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotLyogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiBGVU5DVElPTjogICAgICAgICAgICAgICAgTFZNX1Byb2Nlc3MgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogREVTQ1JJUFRJT046ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgUHJvY2VzcyBmdW5jdGlvbiBmb3IgdGhlIExpZmVWaWJlcyBtb2R1bGUuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogUEFSQU1FVEVSUzogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgaEluc3RhbmNlICAgICAgICAgICAgICAgSW5zdGFuY2UgaGFuZGxlICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICBwSW5EYXRhICAgICAgICAgICAgICAgICBQb2ludGVyIHRvIHRoZSBpbnB1dCBkYXRhICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogIHBPdXREYXRhICAgICAgICAgICAgICAgIFBvaW50ZXIgdG8gdGhlIG91dHB1dCBkYXRhICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgTnVtU2FtcGxlcyAgICAgICAgICAgICAgTnVtYmVyIG9mIHNhbXBsZXMgaW4gdGhlIGlucHV0IGJ1ZmZlciAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICBBdWRpb1RpbWUgICAgICAgICAgICAgICBBdWRpbyBUaW1lIG9mIHRoZSBjdXJyZW50IGlucHV0IGRhdGEgaW4gbWlsbGktc2Vjb25kcyAgICAgICAqLwotLyogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiBSRVRVUk5TOiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICBMVk1fU1VDQ0VTUyAgICAgICAgICAgIFN1Y2NlZWRlZCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogIExWTV9JTlZBTElETlVNU0FNUExFUyAgV2hlbiB0aGUgTnVtU2FtcGxlcyBpcyBub3QgYSB2YWxpZWQgbXVsdGlwbGUgaW4gdW5tYW5hZ2VkICAgICovCi0vKiAgICAgICAgICAgICAgICAgICAgICAgICBidWZmZXIgbW9kZSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICBMVk1fQUxJR05NRU5URVJST1IgICAgIFdoZW4gZWl0aGVyIHRoZSBpbnB1dCBvdXIgb3V0cHV0IGJ1ZmZlcnMgYXJlIG5vdCAzMi1iaXQgICAgICAqLwotLyogICAgICAgICAgICAgICAgICAgICAgICAgYWxpZ25lZCBpbiB1bm1hbmFnZWQgbW9kZSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgTFZNX05VTExBRERSRVNTICAgICAgICBXaGVuIG9uZSBvZiBoSW5zdGFuY2UsIHBJbkRhdGEgb3IgcE91dERhdGEgaXMgTlVMTCAgICAgICAgICAgKi8KLS8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogTk9URVM6ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgMS4gVGhlIGlucHV0IGFuZCBvdXRwdXQgYnVmZmVycyBtdXN0IGJlIDMyLWJpdCBhbGlnbmVkICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICAyLiBOdW1iZXIgb2Ygc2FtcGxlcyBpcyBkZWZpbmVkIGFzIGZvbGxvd3M6ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogICAgICBNT05PICAgICAgICAgICAgICAgIHRoZSBudW1iZXIgb2Ygc2FtcGxlcyBpbiB0aGUgYmxvY2sgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgICAgIE1PTk9JTlNURVJFTyAgICAgICAgdGhlIG51bWJlciBvZiBzYW1wbGUgcGFpcnMgaW4gdGhlIGJsb2NrICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICAgICAgU1RFUkVPICAgICAgICAgICAgICB0aGUgbnVtYmVyIG9mIHNhbXBsZSBwYWlycyBpbiB0aGUgYmxvY2sgICAgICAgICAgICAgICAgICAgICAqLwotLyogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLUxWTV9SZXR1cm5TdGF0dXNfZW4gTFZNX1Byb2Nlc3MoTFZNX0hhbmRsZV90ICAgICAgICAgICAgICAgIGhJbnN0YW5jZSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY29uc3QgTFZNX0lOVDE2ICAgICAgICAgICAgICpwSW5EYXRhLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBMVk1fSU5UMTYgICAgICAgICAgICAgICAgICAgKnBPdXREYXRhLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBMVk1fVUlOVDE2ICAgICAgICAgICAgICAgICAgTnVtU2FtcGxlcywKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTFZNX1VJTlQzMiAgICAgICAgICAgICAgICAgIEF1ZGlvVGltZSk7Ci0KLQotLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0vKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qIEZVTkNUSU9OOiAgICAgICAgICAgICAgICBMVk1fU2V0SGVhZHJvb21QYXJhbXMgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiBERVNDUklQVElPTjogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICBUaGlzIGZ1bmN0aW9uIGlzIHVzZWQgdG8gc2V0IHRoZSBhdXRvbWF0aWMgaGVhZHJvb20gbWFuYWdlbWVudCBwYXJhbWV0ZXJzLiAgICAgICAgICAqLwotLyogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiBQQVJBTUVURVJTOiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICBoSW5zdGFuY2UgICAgICAgICAgICAgICBJbnN0YW5jZSBIYW5kbGUgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogIHBIZWFkcm9vbVBhcmFtcyAgICAgICAgIFBvaW50ZXIgdG8gaGVhZHJvb20gcGFyYW1ldGVyIHN0cnVjdHVyZSAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qIFJFVFVSTlM6ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogIExWTV9OVUxMQUREUkVTUyAgICAgICAgIFdoZW4gaEluc3RhbmNlIG9yIHBIZWFkcm9vbVBhcmFtcyBpcyBOVUxMICAgICAgICAgICAgICAgICAgICovCi0vKiAgTFZNX1NVQ0NFU1MgICAgICAgICAgICAgU3VjY2VlZGVkICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogTk9URVM6ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgMS4gIFRoaXMgZnVuY3Rpb24gbWF5IGJlIGludGVycnVwdGVkIGJ5IHRoZSBMVk1fUHJvY2VzcyBmdW5jdGlvbiAgICAgICAgICAgICAgICAgICAgKi8KLS8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi1MVk1fUmV0dXJuU3RhdHVzX2VuIExWTV9TZXRIZWFkcm9vbVBhcmFtcyggIExWTV9IYW5kbGVfdCAgICAgICAgICAgIGhJbnN0YW5jZSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTFZNX0hlYWRyb29tUGFyYW1zX3QgICAgKnBIZWFkcm9vbVBhcmFtcyk7Ci0KLQotLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0vKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qIEZVTkNUSU9OOiAgICAgICAgICAgICAgICBMVk1fR2V0SGVhZHJvb21QYXJhbXMgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiBERVNDUklQVElPTjogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICBUaGlzIGZ1bmN0aW9uIGlzIHVzZWQgdG8gZ2V0IHRoZSBhdXRvbWF0aWMgaGVhZHJvb20gbWFuYWdlbWVudCBwYXJhbWV0ZXJzLiAgICAgICAgICAqLwotLyogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiBQQVJBTUVURVJTOiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICBoSW5zdGFuY2UgICAgICAgICAgICAgICBJbnN0YW5jZSBIYW5kbGUgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogIHBIZWFkcm9vbVBhcmFtcyAgICAgICAgIFBvaW50ZXIgdG8gaGVhZHJvb20gcGFyYW1ldGVyIHN0cnVjdHVyZSAob3V0cHV0KSAgICAgICAgICAgICovCi0vKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qIFJFVFVSTlM6ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogIExWTV9TVUNDRVNTICAgICAgICAgICAgIFN1Y2NlZWRlZCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgTFZNX05VTExBRERSRVNTICAgICAgICAgV2hlbiBoSW5zdGFuY2Ugb3IgcEhlYWRyb29tUGFyYW1zIGFyZSBOVUxMICAgICAgICAgICAgICAgICAgKi8KLS8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogTk9URVM6ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgMS4gIFRoaXMgZnVuY3Rpb24gbWF5IGJlIGludGVycnVwdGVkIGJ5IHRoZSBMVk1fUHJvY2VzcyBmdW5jdGlvbiAgICAgICAgICAgICAgICAgICAgKi8KLS8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi1MVk1fUmV0dXJuU3RhdHVzX2VuIExWTV9HZXRIZWFkcm9vbVBhcmFtcyggIExWTV9IYW5kbGVfdCAgICAgICAgICAgIGhJbnN0YW5jZSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTFZNX0hlYWRyb29tUGFyYW1zX3QgICAgKnBIZWFkcm9vbVBhcmFtcyk7Ci0KLQotLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0vKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qIEZVTkNUSU9OOiAgICAgICAgICAgICAgICBMVk1fR2V0U3BlY3RydW0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiBERVNDUklQVElPTjogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qIFRoaXMgZnVuY3Rpb24gaXMgdXNlZCB0byByZXRyaWV2ZSBTcGVjdHJhbCBpbmZvcm1hdGlvbiBhdCBhIGdpdmVuIEF1ZGlvIHRpbWUgICAgICAgICAqLwotLyogZm9yIGRpc3BsYXkgdXNhZ2UgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qIFBBUkFNRVRFUlM6ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogIGhJbnN0YW5jZSAgICAgICAgICAgICAgIEluc3RhbmNlIEhhbmRsZSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgcEN1cnJlbnRQZWFrcyAgICAgICAgICAgUG9pbnRlciB0byBsb2NhdGlvbiB3aGVyZSBjdXJyZW50cyBwZWFrcyBhcmUgdG8gYmUgc2F2ZWQgICAgKi8KLS8qICBwUGFzdFBlYWtzICAgICAgICAgICAgICBQb2ludGVyIHRvIGxvY2F0aW9uIHdoZXJlIHBhc3QgcGVha3MgYXJlIHRvIGJlIHNhdmVkICAgICAgICAqLwotLyogIHBDZW50cmVGcmVxcyAgICAgICAgICAgIFBvaW50ZXIgdG8gbG9jYXRpb24gd2hlcmUgY2VudHJlIGZyZXF1ZW5jeSBvZiBlYWNoIGJhbmQgaXMgICovCi0vKiAgICAgICAgICAgICAgICAgICAgICAgICAgdG8gYmUgc2F2ZWQgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICBBdWRpb1RpbWUgICAgICAgICAgICAgICBBdWRpbyB0aW1lIGF0IHdoaWNoIHRoZSBzcGVjdHJhbCBpbmZvcm1hdGlvbiBpcyBuZWVkZWQgICAgICAqLwotLyogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiBSRVRVUk5TOiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICBMVk1fU1VDQ0VTUyAgICAgICAgICAgICBTdWNjZWVkZWQgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogIExWTV9OVUxMQUREUkVTUyAgICAgICAgIElmIGFueSBvZiBpbnB1dCBhZGRyZXNzZXMgYXJlIE5VTEwgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgTFZNX1dST05HQVVESU9USU1FICAgICAgRmFpbHVyZSBkdWUgdG8gYXVkaW8gdGltZSBlcnJvciAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogTk9URVM6ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgMS4gVGhpcyBmdW5jdGlvbiBtYXkgYmUgaW50ZXJydXB0ZWQgYnkgdGhlIExWTV9Qcm9jZXNzIGZ1bmN0aW9uICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi1MVk1fUmV0dXJuU3RhdHVzX2VuIExWTV9HZXRTcGVjdHJ1bSggTFZNX0hhbmRsZV90ICAgICAgICAgICAgaEluc3RhbmNlLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIExWTV9VSU5UOCAgICAgICAgICAgICAgICpwQ3VycmVudFBlYWtzLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIExWTV9VSU5UOCAgICAgICAgICAgICAgICpwUGFzdFBlYWtzLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIExWTV9JTlQzMiAgICAgICAgICAgICAgIEF1ZGlvVGltZSk7Ci0KLS8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotLyogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiBGVU5DVElPTjogICAgICAgICAgICAgICAgTFZNX1NldFZvbHVtZU5vU21vb3RoaW5nICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogREVTQ1JJUFRJT046ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiBUaGlzIGZ1bmN0aW9uIGlzIHVzZWQgdG8gc2V0IG91dHB1dCB2b2x1bWUgd2l0aG91dCBhbnkgc21vb3RoaW5nICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogUEFSQU1FVEVSUzogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgaEluc3RhbmNlICAgICAgICAgICAgICAgSW5zdGFuY2UgSGFuZGxlICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICBwUGFyYW1zICAgICAgICAgICAgICAgICBDb250cm9sIFBhcmFtZXRlcnMsIG9ubHkgdm9sdW1lIHZhbHVlIGlzIHVzZWQgaGVyZSAgICAgICAgICAqLwotLyogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiBSRVRVUk5TOiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICBMVk1fU1VDQ0VTUyAgICAgICAgICAgICBTdWNjZWVkZWQgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogIExWTV9OVUxMQUREUkVTUyAgICAgICAgIElmIGFueSBvZiBpbnB1dCBhZGRyZXNzZXMgYXJlIE5VTEwgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgTFZNX09VVE9GUkFOR0UgICAgICAgICAgV2hlbiBhbnkgb2YgdGhlIGNvbnRyb2wgcGFyYW1ldGVycyBhcmUgb3V0IG9mIHJhbmdlICAgICAgICAgKi8KLS8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogTk9URVM6ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgMS4gVGhpcyBmdW5jdGlvbiBtYXkgYmUgaW50ZXJydXB0ZWQgYnkgdGhlIExWTV9Qcm9jZXNzIGZ1bmN0aW9uICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi1MVk1fUmV0dXJuU3RhdHVzX2VuIExWTV9TZXRWb2x1bWVOb1Ntb290aGluZyggTFZNX0hhbmRsZV90ICAgICAgICAgICBoSW5zdGFuY2UsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTFZNX0NvbnRyb2xQYXJhbXNfdCAgICAqcFBhcmFtcyk7Ci0KLQotI2lmZGVmIF9fY3BsdXNwbHVzCi19Ci0jZW5kaWYgLyogX19jcGx1c3BsdXMgKi8KLQotI2VuZGlmICAgICAgLyogX19MVk1fSF9fIC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U5ELCBlaXRoZXIgZXhwcmVzcyBvciBpbXBsaWVkLgotICogU2VlIHRoZSBMaWNlbnNlIGZvciB0aGUgc3BlY2lmaWMgbGFuZ3VhZ2UgZ292ZXJuaW5nIHBlcm1pc3Npb25zIGFuZAotICogbGltaXRhdGlvbnMgdW5kZXIgdGhlIExpY2Vuc2UuCi0gKi8KLQotCi0vKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLS8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogICAgSW5jbHVkZXMgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotCi0jaW5jbHVkZSAiTFZNX1ByaXZhdGUuaCIKLSNpbmNsdWRlICJMVk1fVGFibGVzLmgiCi0KLS8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotLyogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiBGVU5DVElPTjogICAgICAgICAgICAgICAgTFZNX0dldFNwZWN0cnVtICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogREVTQ1JJUFRJT046ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiBUaGlzIGZ1bmN0aW9uIGlzIHVzZWQgdG8gcmV0cmlldmUgU3BlY3RyYWwgaW5mb3JtYXRpb24gYXQgYSBnaXZlbiBBdWRpbyB0aW1lICAgICAgICAgKi8KLS8qIGZvciBkaXNwbGF5IHVzYWdlICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiBQQVJBTUVURVJTOiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICBoSW5zdGFuY2UgICAgICAgICAgICAgICBJbnN0YW5jZSBIYW5kbGUgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogIHBDdXJyZW50UGVha3MgICAgICAgICAgIFBvaW50ZXIgdG8gbG9jYXRpb24gd2hlcmUgY3VycmVudHMgcGVha3MgYXJlIHRvIGJlIHNhdmVkICAgICovCi0vKiAgcFBhc3RQZWFrcyAgICAgICAgICAgICAgUG9pbnRlciB0byBsb2NhdGlvbiB3aGVyZSBwYXN0IHBlYWtzIGFyZSB0byBiZSBzYXZlZCAgICAgICAgKi8KLS8qICBBdWRpb1RpbWUgICAgICAgICAgICAgICBBdWRpbyB0aW1lIGF0IHdoaWNoIHRoZSBzcGVjdHJhbCBpbmZvcm1hdGlvbiBpcyBuZWVkZWQgICAgICAqLwotLyogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiBSRVRVUk5TOiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICBMVk1fU1VDQ0VTUyAgICAgICAgICAgICBTdWNjZWVkZWQgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogIExWTV9OVUxMQUREUkVTUyAgICAgICAgIElmIGFueSBvZiBpbnB1dCBhZGRyZXNzZXMgYXJlIE5VTEwgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgTFZNX1dST05HQVVESU9USU1FICAgICAgRmFpbHVyZSBkdWUgdG8gYXVkaW8gdGltZSBlcnJvciAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogTk9URVM6ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgMS4gVGhpcyBmdW5jdGlvbiBtYXkgYmUgaW50ZXJydXB0ZWQgYnkgdGhlIExWTV9Qcm9jZXNzIGZ1bmN0aW9uICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi1MVk1fUmV0dXJuU3RhdHVzX2VuIExWTV9HZXRTcGVjdHJ1bSgKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIExWTV9IYW5kbGVfdCAgICAgICAgICAgIGhJbnN0YW5jZSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIExWTV9VSU5UOCAgICAgICAgICAgICAgICpwQ3VycmVudFBlYWtzLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTFZNX1VJTlQ4ICAgICAgICAgICAgICAgKnBQYXN0UGVha3MsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBMVk1fSU5UMzIgICAgICAgICAgICAgICBBdWRpb1RpbWUKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICkKLXsKLSAgICBMVk1fSW5zdGFuY2VfdCAgICAgICAgICAgKnBJbnN0YW5jZSAgID0gKExWTV9JbnN0YW5jZV90ICAqKWhJbnN0YW5jZTsKLQotICAgIHBMVlBTQV9IYW5kbGVfdCAgICAgICAgKmhQU0FJbnN0YW5jZTsKLSAgICBMVlBTQV9SRVRVUk4gICAgICAgICAgIExWUFNBX1N0YXR1czsKLQotCi0gICAgaWYocEluc3RhbmNlID09IExWTV9OVUxMKQotICAgIHsKLSAgICAgICAgcmV0dXJuIExWTV9OVUxMQUREUkVTUzsKLSAgICB9Ci0KLSAgICAvKklmIFBTQSBpcyBub3QgaW5jbHVkZWQgYXQgdGhlIHRpbWUgb2YgaW5zdGFuY2UgY3JlYXRpb24sIHJldHVybiB3aXRob3V0IGFueSBwcm9jZXNzaW5nKi8KLSAgICBpZihwSW5zdGFuY2UtPkluc3RQYXJhbXMuUFNBX0luY2x1ZGVkIT1MVk1fUFNBX09OKQotICAgIHsKLSAgICAgICAgcmV0dXJuIExWTV9TVUNDRVNTOwotICAgIH0KLQotICAgIGhQU0FJbnN0YW5jZSA9IHBJbnN0YW5jZS0+aFBTQUluc3RhbmNlOwotCi0gICAgaWYoKHBDdXJyZW50UGVha3MgPT0gTFZNX05VTEwpIHx8Ci0gICAgICAgIChwUGFzdFBlYWtzID09IExWTV9OVUxMKSkKLSAgICB7Ci0gICAgICAgIHJldHVybiBMVk1fTlVMTEFERFJFU1M7Ci0gICAgfQotCi0KLSAgICAvKgotICAgICAqIFVwZGF0ZSBuZXcgcGFyYW1ldGVycyBpZiBuZWNlc3NhcnkKLSAgICAgKi8KLSAgICBpZiAocEluc3RhbmNlLT5Db250cm9sUGVuZGluZyA9PSBMVk1fVFJVRSkKLSAgICB7Ci0gICAgICAgIExWTV9BcHBseU5ld1NldHRpbmdzKGhJbnN0YW5jZSk7Ci0gICAgfQotCi0gICAgLyogSWYgUFNBIG1vZHVsZSBpcyBkaXNhYmxlZCwgZG8gbm90aGluZyAqLwotICAgIGlmKHBJbnN0YW5jZS0+UGFyYW1zLlBTQV9FbmFibGU9PUxWTV9QU0FfT0ZGKQotICAgIHsKLSAgICAgICAgcmV0dXJuIExWTV9BTEdPUklUSE1ESVNBQkxFRDsKLSAgICB9Ci0KLSAgICBMVlBTQV9TdGF0dXMgPSBMVlBTQV9HZXRTcGVjdHJ1bShoUFNBSW5zdGFuY2UsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgKExWUFNBX1RpbWUpIChBdWRpb1RpbWUpLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgIChMVk1fVUlOVDgqKSBwQ3VycmVudFBlYWtzLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgIChMVk1fVUlOVDgqKSBwUGFzdFBlYWtzICk7Ci0KLSAgICBpZihMVlBTQV9TdGF0dXMgIT0gTFZQU0FfT0spCi0gICAgewotICAgICAgICBpZihMVlBTQV9TdGF0dXMgPT0gTFZQU0FfRVJST1JfV1JPTkdUSU1FKQotICAgICAgICB7Ci0gICAgICAgICAgICByZXR1cm4gKExWTV9SZXR1cm5TdGF0dXNfZW4pIExWTV9XUk9OR0FVRElPVElNRTsKLSAgICAgICAgfQotICAgICAgICBlbHNlCi0gICAgICAgIHsKLSAgICAgICAgICAgIHJldHVybiAoTFZNX1JldHVyblN0YXR1c19lbikgTFZNX05VTExBRERSRVNTOwotICAgICAgICB9Ci0gICAgfQotCi0gICAgcmV0dXJuKExWTV9TVUNDRVNTKTsKLX0KLQotCi0vKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLS8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogRlVOQ1RJT046ICAgICAgICAgICAgICAgIExWTV9TZXRWb2x1bWVOb1Ntb290aGluZyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qIERFU0NSSVBUSU9OOiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogVGhpcyBmdW5jdGlvbiBpcyB1c2VkIHRvIHNldCBvdXRwdXQgdm9sdW1lIHdpdGhvdXQgYW55IHNtb290aGluZyAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qIFBBUkFNRVRFUlM6ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogIGhJbnN0YW5jZSAgICAgICAgICAgICAgIEluc3RhbmNlIEhhbmRsZSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgcFBhcmFtcyAgICAgICAgICAgICAgICAgQ29udHJvbCBQYXJhbWV0ZXJzLCBvbmx5IHZvbHVtZSB2YWx1ZSBpcyB1c2VkIGhlcmUgICAgICAgICAgKi8KLS8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogUkVUVVJOUzogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgTFZNX1NVQ0NFU1MgICAgICAgICAgICAgU3VjY2VlZGVkICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICBMVk1fTlVMTEFERFJFU1MgICAgICAgICBJZiBhbnkgb2YgaW5wdXQgYWRkcmVzc2VzIGFyZSBOVUxMICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogIExWTV9PVVRPRlJBTkdFICAgICAgICAgIFdoZW4gYW55IG9mIHRoZSBjb250cm9sIHBhcmFtZXRlcnMgYXJlIG91dCBvZiByYW5nZSAgICAgICAgICovCi0vKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qIE5PVEVTOiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogIDEuIFRoaXMgZnVuY3Rpb24gbWF5IGJlIGludGVycnVwdGVkIGJ5IHRoZSBMVk1fUHJvY2VzcyBmdW5jdGlvbiAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq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WNlbnNlZCB1bmRlciB0aGUgQXBhY2hlIExpY2Vuc2UsIFZlcnNpb24gMi4wICh0aGUgIkxpY2Vuc2UiKTsKLSAqIHlvdSBtYXkgbm90IHVzZSB0aGlzIGZpbGUgZXhjZXB0IGluIGNvbXBsaWFuY2Ugd2l0aCB0aGUgTGljZW5zZS4KLSAqIFlvdSBtYXkgb2J0YWluIGEgY29weSBvZiB0aGUgTGljZW5zZSBhdAotICoKLSAqICAgICAgaHR0cDovL3d3dy5hcGFjaGUub3JnL2xpY2Vuc2VzL0xJQ0VOU0UtMi4wCi0gKgotICogVW5sZXNzIHJlcXVpcmVkIGJ5IGFwcGxpY2FibGUgbGF3IG9yIGFncmVlZCB0byBpbiB3cml0aW5nLCBzb2Z0d2FyZQotICogZGlzdHJpYnV0ZWQgdW5kZXIgdGhlIExpY2Vuc2UgaXMgZGlzdHJpYnV0ZWQgb24gYW4gIkFTIElTIiBCQVNJUywKLSAqIFdJVEhPVVQgV0FSUkFOVElFUyBPUiBDT05ESVRJT05TIE9GIEFOWSBLSU5ELCBlaXRoZXIgZXhwcmVzcyBvciBpbXBsaWVkLgotICogU2VlIHRoZSBMaWNlbnNlIGZvciB0aGUgc3BlY2lmaWMgbGFuZ3VhZ2UgZ292ZXJuaW5nIHBlcm1pc3Npb25zIGFuZAotICogbGltaXRhdGlvbnMgdW5kZXIgdGhlIExpY2Vuc2UuCi0gKi8KLQotCi0vKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLS8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgICBJbmNsdWRlcyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0KLSNpbmNsdWRlICJMVk1fUHJpdmF0ZS5oIgotI2luY2x1ZGUgIlZlY3RvckFyaXRobWV0aWMuaCIKLQotLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0vKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qIEZVTkNUSU9OOiAgICAgICAgICAgICAgICAgTFZNX0J1ZmZlck1hbmFnZWRJbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiBERVNDUklQVElPTjogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICAgIEZ1bGwgYnVmZmVyIG1hbmFnZW1lbnQgYWxsb3dpbmcgdGhlIHVzZXIgdG8gcHJvdmlkZSBpbnB1dCBhbmQgb3V0cHV0IGJ1ZmZlcnMgb24gICAqLwotLyogIGFueSBhbGlnbm1lbnQgYW5kIHdpdGggYW55IG51bWJlciBvZiBzYW1wbGVzLiBUaGUgYWxpZ25tZW50IGlzIGNvcnJlY3RlZCB3aXRoaW4gICAgICovCi0vKiAgdGhlIGJ1ZmZlciBtYW5hZ2VtZW50IGFuZCB0aGUgc2FtcGxlcyBhcmUgZ3JvdXBlZCBpbiB0byBibG9ja3Mgb2YgdGhlIGNvcnJlY3Qgc2l6ZSAgKi8KLS8qICBiZWZvcmUgcHJvY2Vzc2luZy4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiBQQVJBTUVURVJTOiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICAgIGhJbnN0YW5jZSAgICAgICAgLSAgICBJbnN0YW5jZSBoYW5kbGUgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogICAgcEluRGF0YSAgICAgICAgICAgIC0gICAgUG9pbnRlciB0byB0aGUgaW5wdXQgZGF0YSBzdHJlYW0gICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgKnBUb1Byb2Nlc3MgICAgICAgIC0gICAgUG9pbnRlciB0byBwb2ludGVyIHRvIHRoZSBzdGFydCBvZiBkYXRhIHByb2Nlc3NpbmcgICAgICAgICAgKi8KLS8qICAqcFByb2Nlc3NlZCAgICAgICAgLSAgICBQb2ludGVyIHRvIHBvaW50ZXIgdG8gdGhlIGRlc3RpbmF0aW9uIG9mIHRoZSBwcm9jZXNzZWQgZGF0YSAqLwotLyogICAgcE51bVNhbXBsZXMgICAgICAgIC0gICAgUG9pbnRlciB0byB0aGUgbnVtYmVyIG9mIHNhbXBsZXMgdG8gcHJvY2VzcyAgICAgICAgICAgICAgICovCi0vKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qIFJFVFVSTlM6ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogICAgTm9uZSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qIE5PVEVTOiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLQotdm9pZCBMVk1fQnVmZmVyTWFuYWdlZEluKExWTV9IYW5kbGVfdCAgICAgICBoSW5zdGFuY2UsCi0gICAgICAgICAgICAgICAgICAgICAgICAgY29uc3QgTFZNX0lOVDE2ICAgICpwSW5EYXRhLAotICAgICAgICAgICAgICAgICAgICAgICAgIExWTV9JTlQxNiAgICAgICAgICAqKnBUb1Byb2Nlc3MsCi0gICAgICAgICAgICAgICAgICAgICAgICAgTFZNX0lOVDE2ICAgICAgICAgICoqcFByb2Nlc3NlZCwKLSAgICAgICAgICAgICAgICAgICAgICAgICBMVk1fVUlOVDE2ICAgICAgICAgKnBOdW1TYW1wbGVzKQotewotCi0gICAgTFZNX0lOVDE2ICAgICAgICBTYW1wbGVDb3VudDsgICAgICAgICAgIC8qIE51bWJlciBvZiBzYW1wbGVzIHRvIGJlIHByb2Nlc3NlZCB0aGlzIGNhbGwgKi8KLSAgICBMVk1fSU5UMTYgICAg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U2FtcGxlcyAhPSAwKSkKLSAgICB7Ci0gICAgICAgIENvcHlfMTYoJnBCdWZmZXItPkluRGVsYXlCdWZmZXJbMF0sICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvKiBTb3VyY2UgKi8KLSAgICAgICAgICAgICAgICBwRGVzdCwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8qIERlc3RpbmF0aW9uICovCi0gICAgICAgICAgICAgICAgKExWTV9JTlQxNikoTnVtQ2hhbm5lbHMqcEJ1ZmZlci0+SW5EZWxheVNhbXBsZXMpKTsgICAgICAvKiBOdW1iZXIgb2YgZGVsYXkgc2FtcGxlcywgbGVmdCBhbmQgcmlnaHQgKi8KLSAgICAgICAgTnVtU2FtcGxlcyA9IChMVk1fSU5UMTYpKE51bVNhbXBsZXMgLSBwQnVmZmVyLT5JbkRlbGF5U2FtcGxlcyk7IC8qIFVwZGF0ZSBzYW1wbGUgY291bnQgKi8KLSAgICAgICAgcERlc3QgKz0gTnVtQ2hhbm5lbHMgKiBwQnVmZmVyLT5JbkRlbGF5U2FtcGxlczsgICAgICAgICAgICAgICAgIC8qIFVwZGF0ZSB0aGUgZGVzdGluYXRpb24gcG9pbnRlciAqLwotICAgIH0KLQotCi0gICAgLyoKLSAgICAgKiBDb3B5IHRoZSByZXN0IG9mIHRoZSBzYW1wbGVzIGZvciB0aGlzIGNhbGwgZnJvbSB0aGUgaW5wdXQgYnVmZmVyCi0gICAgICovCi0gICAgaWYgKE51bVNhbXBsZXMgPiAwKQotICAgIHsKLSAgICAgICAgQ29weV8xNihwU3RhcnQsICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLyogU291cmNlICovCi0gICAgICAgICAgICAgICAgcERlc3QsICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8qIERlc3RpbmF0aW9uICovCi0gICAgICAgICAgICAgICAgKExWTV9JTlQxNikoTnVtQ2hhbm5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GSVJTVExBU1RDQUxMKSB8fAotICAgICAgICAocEJ1ZmZlci0+QnVmZmVyU3RhdGUgPT0gTFZNX0xBU1RDQUxMKSkKLSAgICB7Ci0gICAgICAgIE51bVNhbXBsZXMgPSBwSW5zdGFuY2UtPlNhbXBsZXNUb1Byb2Nlc3M7Ci0gICAgICAgIHBTdGFydCAgICAgPSBwQnVmZmVyLT5wU2NyYXRjaDsgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8qIFN0YXJ0IG9mIHRoZSBidWZmZXIgKi8KLSAgICAgICAgcFN0YXJ0ICAgICs9IE51bUNoYW5uZWxzKlNhbXBsZUNvdW50OyAgICAgICAgICAgICAgICAgICAgICAgLyogT2Zmc2V0IGJ5IHRoZSBudW1iZXIgb2YgcHJvY2Vzc2VkIHNhbXBsZXMgKi8KLSAgICAgICAgaWYgKE51bVNhbXBsZXMgIT0gMCkKLSAgICAgICAgewotICAgICAgICAgICAgQ29weV8xNihwU3RhcnQsICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvKiBTb3VyY2UgKi8KLSAgICAgICAgICAgICAgICAgICAgJnBCdWZmZXItPkluRGVsYXlCdWZmZXJbMF0sICAgICAgICAgICAgICAgICAgICAgLyogRGVzdGluYXRpb24gKi8KLSAgICAgICAgICAgICAgICAgICAgKExWTV9JTlQxNikoTnVtQ2hhbm5lbHMqTnVtU2FtcGxlcykpOyAgICAgICAgICAgLyogTnVtYmVyIG9mIGlucHV0IHNhbXBsZXMgKi8KLSAgICAgICAgfQotCi0KLSAgICAgICAgLyoKLSAgICAgICAgICogVXBkYXRlIHRoZSBkZWxheSBzYW1wbGUgY291bnQKLSAgICAgICAgICovCi0gICAgICAgIHBCdWZmZXItPkluRGVsYXlTYW1wbGVzICAgICA9IE51bVNhbXBsZXM7ICAgICAgICAgICAgICAgICAgIC8qIE51bWJlciBvZiBkZWxheSBzYW1wbGUgcGFpcnMgKi8KLSAgICAgICAgcEluc3RhbmNlLT5TYW1wbGVzVG9Qcm9jZXNzID0gMDsgICAgICAgICAgICAgICAgICAgICAgICAgICAgLyogQWxsIFNhbXBsZXMgdXNlZCAqLwotICAgIH0KLX0KLQotCi0vKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLS8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogRlVOQ1RJT046ICAgICAgICAgICAgICAgICBMVk1fQnVmZmVyVW5tYW5hZ2VkSW4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qIERFU0NSSVBUSU9OOiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogICAgVGhpcyBtb2RlIGlzIHNlbGVjdGVkIGJ5IHRoZSB1c2VyIGNvZGUgYW5kIGRpc2FibGVzIHRoZSBidWZmZXIgbWFuYWdlbWVudCB3aXRoIHRoZSAqLwotLyogIGV4Y2VwdGlvbiBvZiB0aGUgbWF4aW11bSBibG9jayBzaXplIHByb2Nlc3NpbmcuIFRoZSB1c2VyIG11c3QgZW5zdXJlIHRoYXQgdGhlICAgICAgICovCi0vKiAgaW5wdXQgYW5kIG91dHB1dCBidWZmZXJzIGFyZSAzMi1iaXQgYWxpZ25lZCBhbmQgYWxzbyB0aGF0IHRoZSBudW1iZXIgb2Ygc2FtcGxlcyB0byAgKi8KLS8qICAgIHByb2Nlc3MgaXMgYSBjb3JyZWN0IG11bHRpcGxlIG9mIHNhbXBsZXMuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiBQQVJBTUVURVJTOiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICAgIGhJbnN0YW5jZSAgICAgICAgLSAgICBJbnN0YW5jZSBoYW5kbGUgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogICpwVG9Qcm9jZXNzICAgICAgICAtICAgIFBvaW50ZXIgdG8gdGhlIHN0YXJ0IG9mIGRhdGEgcHJvY2Vzc2luZyAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgKnBQcm9jZXNzZWQgICAgICAgIC0gICAgUG9pbnRlciB0byB0aGUgZGVzdGluYXRpb24gb2YgdGhlIHByb2Nlc3NlZCBkYXRhICAgICAgICAgICAgKi8KLS8qICAgIHBOdW1TYW1wbGVzICAgICAgICAtICAgIFBvaW50ZXIgdG8gdGhlIG51bWJlciBvZiBzYW1wbGVzIHRvIHByb2Nlc3MgICAgICAgICAgICAgICAqLwotLyogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiBSRVRVUk5TOiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICAgIE5vbmUgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiBOT1RFUzogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0KLXZvaWQgTFZNX0J1ZmZlclVubWFuYWdlZEluKExWTV9IYW5kbGVfdCAgICAgaEluc3RhbmNlLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgTFZNX0lOVDE2ICAgICAgICAqKnBUb1Byb2Nlc3MsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICBMVk1fSU5UMTYgICAgICAgICoqcFByb2Nlc3NlZCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgIExWTV9VSU5UMTYgICAgICAgKnBOdW1TYW1wbGVzKQotewotCi0gICAgTFZNX0luc3RhbmNlX3QgICAgKnBJbnN0YW5jZSA9IChMVk1fSW5zdGFuY2VfdCAgKiloSW5zdGFuY2U7Ci0KLQotICAgIC8qCi0gICAgICogQ2hlY2sgaWYgdGhpcyBpcyB0aGUgZmlyc3QgY2FsbCBvZiBhIGJsb2NrCi0gICAgICovCi0gICAgaWYgKHBJbnN0YW5jZS0+U2FtcGxlc1RvUHJvY2VzcyA9PSAwKQotICAgIHsKLSAgICAgICAgcEluc3RhbmNlLT5TYW1wbGVzVG9Qcm9jZXNzID0gKExWTV9JTlQxNikqcE51bVNhbXBsZXM7ICAgICAgIC8qIEdldCB0aGUgbnVtYmVyIG9mIHNhbXBsZXMgb24gZmlyc3QgY2FsbCAqLwotICAgICAgICBwSW5zdGFuY2UtPnBJbnB1dFNhbXBsZXMgICAgPSAqcFRvUHJvY2VzczsgICAgICAgICAgICAgICAgICAgLyogR2V0IHRoZSBJL08gcG9pbnRlcnMgKi8KLSAgICAgICAgcEluc3RhbmNlLT5wT3V0cHV0U2FtcGxlcyAgICA9ICpwUHJvY2Vzc2VkOwotCi0KLSAgICAgICAgLyoKLSAgICAgICAgICogU2V0IHRlIGJsb2NrIHNpemUgdG8gcHJvY2VzcwotICAgICAgICAgKi8KLSAgICAgICAgaWYgKHBJbnN0YW5jZS0+U2FtcGxlc1RvUHJvY2VzcyA+IHBJbnN0YW5jZS0+SW50ZXJuYWxCbG9ja1NpemUpCi0gICAgICAgIHsKLSAgICAgICAgICAgICpwTnVtU2FtcGxlcyA9IChMVk1fVUlOVDE2KXBJbnN0YW5jZS0+SW50ZXJuYWxCbG9ja1NpemU7Ci0gICAgICAgIH0KLSAgICAgICAgZWxzZQotICAgICAgICB7Ci0gICAgICAgICAgICAqcE51bVNhbXBsZXMgPSAoTFZNX1VJTlQxNilwSW5zdGFuY2UtPlNhbXBsZXNUb1Byb2Nlc3M7Ci0gICAgICAgIH0KLSAgICB9Ci0KLSAgICAvKgotICAgICAqIFNldCB0aGUgcHJvY2VzcyBwb2ludGVycwotICAgICAqLwotICAgICpwVG9Qcm9jZXNzID0gcEluc3RhbmNlLT5wSW5wdXRTYW1wbGVzOwotICAgICpwUHJvY2Vzc2VkID0gcEluc3RhbmNlLT5wT3V0cHV0U2FtcGxlczsKLX0KLQotCi0vKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLS8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogRlVOQ1RJT046ICAgICAgICAgICAgICAgICBMVk1fQnVmZmVyT3B0aW1pc2VkSW4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qIERFU0NSSVBUSU9OOiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogICAgT3B0aW1pc2VkIGJ1ZmZlciBtYW5hZ2VtZW50IGZvciB0aGUgY2FzZSB3aGVyZSB0aGUgZGF0YSBpcyBvdXRwbGFjZSBwcm9jZXNzaW5nLCAgICovCi0vKiAgICB0aGUgb3V0cHV0IGRhdGEgaXMgMzItYml0IGFsaWduZWQgYW5kIHRoZXJlIGFyZSBzdWZmaWNpZW50IHNhbXBsZXMgdG8gYWxsb3cgc29tZSAgKi8KLS8qICAgIHByb2Nlc3NpbmcgZGlyZWN0bHkgaW4gdGhlIG91dHB1dCBidWZmZXIuIFRoaXMgc2F2ZXMgb25lIGRhdGEgY29weSBwZXIgc2FtcGxlICAgICAqLwotLyogICAgY29tcGFyZWQgd2l0aCB0aGUgdW5vcHRpbXNlZCB2ZXJzaW9uLiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qIFBBUkFNRVRFUlM6ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogICAgaEluc3RhbmNlICAgICAgICAtICAgIEluc3RhbmNlIGhhbmRsZSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgICBwSW5EYXRhICAgICAgICAgICAgLSAgICBQb2ludGVyIHRvIHRoZSBpbnB1dCBkYXRhIHN0cmVhbSAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICAqcFRvUHJvY2VzcyAgICAgICAgLSAgICBQb2ludGVyIHRvIHRoZSBzdGFydCBvZiBkYXRhIHByb2Nlc3NpbmcgICAgICAgICAgICAgICAgICAgICAqLwotLyogICpwUHJvY2Vzc2VkICAgICAgICAtICAgIFBvaW50ZXIgdG8gdGhlIGRlc3RpbmF0aW9uIG9mIHRoZSBwcm9jZXNzZWQgZGF0YSAgICAgICAgICAgICovCi0vKiAgICBwTnVtU2FtcGxlcyAgICAgICAgLSAgICBQb2ludGVyIHRvIHRoZSBudW1iZXIgb2Ygc2FtcGxlcyB0byBwcm9jZXNzICAgICAgICAgICAgICAgKi8KLS8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogUkVUVVJOUzogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgICBOb25lICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogTk9URVM6ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotCi12b2lkIExWTV9CdWZmZXJPcHRpbWlzZWRJbihMVk1fSGFuZGxlX3QgICAgICAg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luc3RhbmNlLT5TYW1wbGVzVG9Qcm9jZXNzID0gKExWTV9JTlQxNikqcE51bVNhbXBsZXM7Ci0gICAgICAgIHBCdWZmZXItPlNhbXBsZXNUb091dHB1dCAgICA9IChMVk1fSU5UMTYpKnBOdW1TYW1wbGVzOwotICAgICAgICBwRGVzdCA9ICpwUHJvY2Vzc2VkOyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8qIFRoZSBzdGFydCBvZiB0aGUgb3V0cHV0IGJ1ZmZlciAqLwotCi0KLSAgICAgICAgLyoKLSAgICAgICAgICogQ29weSB0aGUgYWxyZWFkeSBwcm9jZXNzZWQgc2FtcGxlcyB0byB0aGUgb3V0cHV0IGJ1ZmZlcgotICAgICAgICAgKi8KLSAgICAgICAgaWYgKHBCdWZmZXItPk91dERlbGF5U2FtcGxlcyAhPSAwKQotICAgICAgICB7Ci0gICAgICAgICAgICBDb3B5XzE2KCZwQnVmZmVyLT5PdXREZWxheUJ1ZmZlclswXSwgICAgICAgICAgICAgICAgICAgIC8qIFNvdXJjZSAqLwotICAgICAgICAgICAgICAgICAgICBwRGVzdCwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvKiBEZXRzaW5hdGlvbiAqLwotICAgICAgICAgICAgICAgICAgICAoTFZNX0lOVDE2KSgyKnBCdWZmZXItPk91dERlbGF5U2FtcGxlcykpOyAgICAgICAvKiBOdW1iZXIgb2YgZGVsYXkgc2FtcGxlcyAqLwotICAgICAgICAgICAgcERlc3QgKz0gMiAqIHBCdWZmZXItPk91dERlbGF5U2FtcGxlczsgICAgICAgICAgICAgICAgICAvKiBVcGRhdGUgdGhlIG91dHB1dCBwb2ludGVyICovCi0gICAgICAgICAgICBwQnVmZmVyLT5TYW1wbGVzVG9PdXRwdXQgPSAoTFZNX0lOVDE2KShwQnVmZmVyLT5TYW1wbGVzVG9PdXRwdXQgLSBwQnVmZmVyLT5PdXREZWxheVNhbXBsZXMpOyAvKiBVcGRhdGUgdGhlIG51bWJyIG9mIHNhbXBsZXMgdG8gb3V0cHV0ICovCi0gICAgICAgIH0KLSAgICAgICAgKnBUb1Byb2Nlc3MgPSBwRGVzdDsgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvKiBTZXQgdGhlIGFkZHJlc3MgdG8gc3RhcnQgcHJvY2Vzc2luZyAqLwotICAgICAgICAqcFByb2Nlc3NlZCA9IHBEZXN0OyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8qIFByb2Nlc3MgaW4gdGhlIG91dHB1dCBidWZmZXIsIG5vdyBpbnBsYWNlICovCi0KLSAgICAgICAgLyoKLSAgICAgICAgICogQ29weSB0aGUgaW5wdXQgZGVsYXkgYnVmZmVyICh1bnByb2Nlc3NlZCkgc2FtcGxlcyB0byB0aGUgb3V0cHV0IGJ1ZmZlcgotICAgICAgICAgKi8KLSAgICAgICAgaWYgKHBCdWZmZXItPkluRGVsYXlTYW1wbGVzICE9IDApCi0gICAgICAgIHsKLSAgICAgICAgICAgIENvcHlfMTYoJnBCdWZmZXItPkluRGVsYXlCdWZmZXJbMF0sICAgICAgICAgICAgICAgICAgICAgLyogU291cmNlICovCi0gICAgICAgICAgICAgICAgICAgIHBEZXN0LCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8qIERlc3RpbmF0aW9uICovCi0gICAgICAgICAgICAgICAgICAgIChMVk1fSU5UMTYpKDIqcEJ1ZmZlci0+SW5EZWxheVNhbXBsZXMpKTsgICAgICAgIC8qIE51bWJlciBvZiBkZWxheSBzYW1wbGVzICovCi0gICAgICAgICAgICBwRGVzdCArPSAyICogcEJ1ZmZlci0+SW5EZWxheVNhbXBsZXM7ICAgICAgICAgICAgICAgICAgIC8qIFVwZGF0ZSB0aGUgb3V0cHV0IHBvaW50ZXIgKi8KLSAgICAgICAgfQotCi0KLSAgICAgICAgLyoKLSAgICAgICAgICogQ2FsY3VsYXRlIGhvdyBtYW55IGlucHV0IHNhbX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vIGNvcHkgZnJvbSB0aGUgaW5wdXQgKi8KLQotCi0gICAgICAgIC8qCi0gICAgICAgICAqIENvcHkgc2FtcGxlcyBmcm9tIHRoZSBpbnB1dCBidWZmZXIgYW5kIHVwZGF0ZSBjb3VudHMgYW5kIHBvaW50ZXJzCi0gICAgICAgICAqLwotICAgICAgICBDb3B5XzE2KHBJbnN0YW5jZS0+cElucHV0U2FtcGxlcywgICAgICAgICAgICAgICAgICAgICAgICAgICAvKiBTb3VyY2UgKi8KLSAgICAgICAgICAgICAgICBwRGVzdCwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLyogRGVzdGluYXRpb24gKi8KLSAgICAgICAgICAgICAgICAoTFZNX0lOVDE2KSgyKlNhbXBsZUNvdW50KSk7ICAgICAgICAgICAgICAgICAgICAgICAgLyogTnVtYmVyIG9mIGlucHV0IHNhbXBsZXMgKi8KLSAgICAgICAgcEluc3RhbmNlLT5wSW5wdXRTYW1wbGVzICs9IDIgKiBTYW1wbGVDb3VudDsgICAgICAgICAgICAgICAgLyogVXBkYXRlIHRoZSBpbnB1dCBwb2ludGVyICovCi0gICAgICAgIHBJbnN0YW5jZS0+cE91dHB1dFNhbXBsZXMgPSBwRGVzdCArICgyICogU2FtcGxlQ291bnQpOyAgICAgIC8qIFVwZGF0ZSB0aGUgb3V0cHV0IHBvaW50ZXIgKi8KLSAgICAgICAgcEluc3RhbmNlLT5TYW1wbGVzVG9Qcm9jZXNzID0gKExWTV9JTlQxNikocEluc3RhbmNlLT5TYW1wbGVzVG9Qcm9jZXNzIC0gU2FtcGxlQ291bnQpOyAvKiBTYW1wbGVzIGxlZnQgaW4gdGhlIGlucHV0IGJ1ZmZlciAqLwotICAgIH0KLSAgICBlbHNlCi0gICAgewotICAgICAgICAvKgotICAgICAgICAgKiBTZWNvbmQgb3Igc3Vic2VxdWVudCBjYWxsIGluIG9wdGltaXNlZCBtb2RlCi0gICAgICAgICAqLwotICAgICAgICBpZiAocEJ1ZmZlci0+U2FtcGxlc1RvT3V0cHV0ID49IE1JTl9JTlRFUk5BTF9CTE9DS1NJWkUpCi0gICAgICAgIHsKLSAgICAgICAgICAgIC8qCi0gICAgICAgICAgICAgKiBNb3JlIHNhbXBsZXMgY2FuIGJlIHByb2Nlc3NlZCBkaXJlY3RseSBpbiB0aGUgb3V0cHV0IGJ1ZmZlcgotICAgICAgICAgICAgICovCi0gICAgICAgICAgICAqcFRvUHJvY2VzcyA9IHBJbnN0YW5jZS0+cE91dHB1dFNhbXBsZXM7ICAgICAgICAgICAgICAgIC8qIFNldCB0aGUgYWRkcmVzcyB0byBzdGFydCBwcm9jZXNzaW5nICovCi0gICAgICAgICAgICAqcFByb2Nlc3NlZCA9IHBJbnN0YW5jZS0+cE91dHB1dFNhbXBsZXM7ICAgICAgICAgICAgICAgIC8qIFByb2Nlc3MgaW4gdGhlIG91dHB1dCBidWZmZXIsIG5vdyBpbnBsYWNlICovCi0gICAgICAgICAgICBOdW1TYW1wbGVzICA9IHBCdWZmZXItPlNhbXBsZXNUb091dHB1dDsgICAgICAgICAgICAgICAgIC8qIE51bWJlciB0aGF0IHdpbGwgZml0IGluIHRoZSBvdXRwdXQgYnVmZmVyICovCi0gICAgICAgICAgICBpZiAoTnVtU2FtcGxlcyA+PSBwSW5zdGFuY2UtPkludGVybmFsQmxvY2tTaXplKQotICAgICAgICAgICAgewotICAgICAgICAgICAgICAgIE51bVNhbXBsZXMgPSBwSW5zdGFuY2UtPkludGVybmFsQmxvY2tTaXplOwotICAgICAgICAgICAgfQotICAgICAgICAgICAgTnVtRnJhbWVzICAgICAgPSAoTFZNX0lOVDE2KShOdW1TYW1wbGVzID4+IE1JTl9JTlRFUk5BTF9CTE9DS1NISUZUKTsKLSAgICAgICAgICAgIFNhbXBsZUNvdW50ICAgPSAoTFZNX0lOVDE2KShOdW1GcmFtZXMgPDwgTUlOX0lOVEVSTkFMX0JMT0NLU0hJRlQpOwotICAgICAgICAgICAgKnBOdW1TYW1wbGVzICA9IChMVk1fVUlOVDE2KVNhbXBsZUNvdW50OyAgICAgICAgICAgIC8qIFRoZSBudW1iZXIgb2Ygc2FtcGxlcyB0byBwcm9jZXNzICovCi0KLQotICAgICAgICAgICAgLyoKLSAgICAgICAgICAgICAqIENvcHkgc2FtcGxlcyBmcm9tIHRoZSBpbnB1dCBidWZmZXIgYW5kIHVwZGF0ZSBjb3VudHMgYW5kIHBvaW50ZXJzCi0gICAgICAgICAgICAgKi8KLSAgICAgICAgICAgIENvcHlfMTYocEluc3RhbmNlLT5wSW5wdXRTYW1wbGVzLCAgICAgICAgICAgICAgICAgICAgICAgLyogU291cmNlICovCi0gICAgICAgICAgICAgICAgICAgIHBJbnN0YW5jZS0+cE91dHB1dFNhbXBsZXMsICAgICAgICAgICAgICAgICAgICAgIC8qIERlc3RpbmF0aW9uICovCi0gICAgICAgICAgICAgICAgICAgIChMVk1fSU5UMTYpKDIqU2FtcGxlQ291bnQpKTsgICAgICAgICAgICAgICAgICAgIC8qIE51bWJlciBvZiBpbnB1dCBzYW1wbGVzICovCi0gICAgICAgICAgICBwSW5zdGFuY2UtPnBJbnB1dFNhbXBsZXMgKz0gMiAqIFNhbXBsZUNvdW50OyAgICAgICAgICAgIC8qIFVwZGF0ZSB0aGUgaW5wdXQgcG9pbnRlciAqLwotICAgICAgICAgICAgcEluc3RhbmNlLT5wT3V0cHV0U2FtcGxlcyArPSAyICogU2FtcGxlQ291bnQ7ICAgICAgICAgICAvKiBVcGRhdGUgdGhlIG91dHB1dCBwb2ludGVyICovCi0gICAgICAgICAgICBwSW5zdGFuY2UtPlNhbXBsZXNUb1Byb2Nlc3MgPSAoTFZNX0lOVDE2KShwSW5zdGFuY2UtPlNhbXBsZXNUb1Byb2Nlc3MgLSBTYW1wbGVDb3VudCk7ICAgLyogU2FtcGxlcyBsZWZ0IGluIHRoZSBpbnB1dCBidWZmZXIgKi8KLSAgICAgICAgICAgIHBCdWZmZXItPlNhbXBsZXNUb091dHB1dCA9IChMVk1fSU5UMTYpKHBCdWZmZXItPlNhbXBsZXNUb091dHB1dCAtIFNhbXBsZUNvdW50KTsgICAgICAgICAvKiBOdW1iZXIgdGhhdCB3aWxsIGZpdCBpbiB0aGUgb3V0cHV0IGJ1ZmZlciAqLwotICAgICAgICB9Ci0gICAgICAgIGVsc2UKLSAgICAgICAgewotICAgICAgICAgICAgLyoKLSAgICAgICAgICAgICAqIFRoZSByZW1haW5pbmcgc2FtcGxlcyBjYW4gbm90IGJlIHByb2Nlc3NlZCBpbiB0aGUgb3V0cHV0IGJ1ZmZlcgotICAgICAgICAgICAgICovCi0gICAgICAgICAgICBwQnVmZmVyLT5CdWZmZXJTdGF0ZSA9IExWTV9MQVNUQ0FMTDsgICAgICAgICAgICAgICAgICAgIC8qIEluZGljYXRlIHRoaXMgaXMgdGhlIGxhc3QgYm9jayB0byBwcm9jZXNzICovCi0gICAgICAgICAgICAqcFRvUHJvY2VzcyAgPSBwQnVmZmVyLT5wU2NyYXRjaDsgICAgICAgICAgICAgICAgICAgICAgIC8qIFNldCB0aGUgYWRkcmVzcyB0byBzdGFydCBwcm9jZXNzaW5nICovCi0gICAgICAgICAgICAqcFByb2Nlc3NlZCAgPSBwQnVmZmVyLT5wU2NyYXRjaDsgICAgICAgICAgICAgICAgICAgICAgIC8qIFByb2Nlc3MgaW4gdGhlIG91dHB1dCBidWZmZXIsIG5vdyBpbnBsYWNlICovCi0gICAgICAgICAgICBOdW1TYW1wbGVzICAgPSBwSW5zdGFuY2UtPlNhbXBsZXNUb1Byb2Nlc3M7ICAgICAgICAgICAgIC8qIE51bWJlciBsZWZ0IHRvIGJlIHByb2Nlc3NlZCAqLwotICAgICAgICAgICAgTnVtRnJhbWVzICAgICA9IChMVk1fSU5UMTYpKE51bVNhbXBsZXMgPj4gTUlOX0lOVEVSTkFMX0JMT0NLU0hJRlQpOwotICAgICAgICAgICAgU2FtcGxlQ291bnQgID0gKExWTV9JTlQxNikoTnVtRnJhbWVzIDw8IE1JTl9JTlRFUk5BTF9CTE9DS1NISUZUKTsKLSAgICAgICAgICAgICpwTnVtU2FtcGxlcyA9IChMVk1fVUlOVDE2KVNhbXBsZUNvdW50OyAgICAgICAgICAgICAgICAvKiBUaGUgbnVtYmVyIG9mIHNhbXBsZXMgdG8gcHJvY2VzcyAqLwotCi0KLSAgICAgICAgICAgIC8qCi0gICAgICAgICAgICAgKiBDb3B5IHNhbXBsZXMgZnJvbSB0aGUgaW5wdXQgYnVmZmVyIGFuZCB1cGRhdGUgY291bnRzIGFuZCBwb2ludGVycwotICAgICAgICAgICAgICovCi0gICAgICAgICAgICBDb3B5XzE2KHBJbnN0YW5jZS0+cElucHV0U2FtcGxlcywgICAgICAgICAgICAgICAgICAgICAgIC8qIFNvdXJjZSAqLwotICAgICAgICAgICAgICAgICAgICBwQnVmZmVyLT5wU2NyYXRjaCwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvKiBEZXN0aW5hdGlvbiAqLwotICAgICAgICAgICAgICAgICAgICAoTFZNX0lOVDE2KSgyKlNhbXBsZUNvdW50KSk7ICAgICAgICAgICAgICAgICAgICAvKiBOdW1iZXIgb2YgaW5wdXQgc2FtcGxlcyAqLwotICAgICAgICAgICAgcEluc3RhbmNlLT5wSW5wdXRTYW1wbGVzICs9IDIgKiBTYW1wbGVDb3VudDsgICAgICAgICAgICAvKiBVcGRhdGUgdGhlIGlucHV0IHBvaW50ZXIgKi8KLSAgICAgICAgICAgIHBJbnN0YW5jZS0+U2FtcGxlc1RvUHJvY2VzcyA9IChMVk1fSU5UMTYpKHBJbnN0YW5jZS0+U2FtcGxlc1RvUHJvY2VzcyAtIFNhbXBsZUNvdW50KTsgLyogU2FtcGxlcyBsZWZ0IGluIHRoZSBpbnB1dCBidWZmZXIgKi8KLSAgICAgICAgfQotICAgIH0KLX0KLQotLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0vKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qIEZVTkNUSU9OOiAgICAgICAgICAgICAgICAgTFZNX0J1ZmZlckluICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiBERVNDUklQVElPTjogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICAgIFRoaXMgZnVuY3Rpb24gbWFuYWdlcyB0aGUgZGF0YSBpbnB1dCwgaXQgaGFzIHRoZSBmb2xsb3dpbmcgZmVhdHVyZXM6ICAgICAgICAgICAgICAqLwotLyogICAgICAgIC0gQWNjZXB0cyBkYXRhIGluIDE2LWJpdCBhbGlnbmVkIG1lbW9yeSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgICAgICAgLSBDb3BpZXMgdGhlIGRhdGEgdG8gMzItYml0IGFsaWduZWQgbWVtb3J5ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICAgICAgICAtIENvbnZlcnRzIE1vbm8gaW5wdXRzIHRvIE1vbm8taW4tU3RlcmVvICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogICAgICAgIC0gQWNjZXB0cyBhbnkgbnVtYmVyIG9mIHNhbXBsZXMgYXMgaW5wdXQsIGV4Y2VwdCAwICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgICAgICAgLSBCcmVha3MgdGhlIGlucHV0IHNhbXBsZSBzdHJlYW0gaW4gdG8gYmxvY2tzIG9mIHRoZSBjb25maWd1cmVkIGZyYW1lIHNpemUgb3IgKi8KLS8qICAgICAgICAgIG11bHRpcGxlcyBvZiB0aGUgZnJhbWUgc2l6ZSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogICAgICAgIC0gTGltaXRzIHRoZSBwcm9jZXNzaW5nIGJsb2NrIHNpemUgdG8gdGhlIG1heGltdW0gYmxvY2sgc2l6ZS4gICAgICAgICAgICAgICAgICovCi0vKiAgICAgICAgLSBXb3JrcyB3aXRoIGlucGxhY2Ugb3Igb3V0cGxhY2UgcHJvY2Vzc2luZyBhdXRvbWF0aWNhbGx5ICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogIFRvIG1hbmFnZSB0aGUgZGF0YSB0aGUgZnVuY3Rpb24gaGFzIGEgbnVtYmVyIG9mIG9wZXJhdGluZyBzdGF0ZXM6ICAgICAgICAgICAgICAgICAgICovCi0vKiAgICAgICAgTFZNX0ZJUlNUQ0FMTCAgICAgICAgLSBUaGUgZmlyc3QgY2FsbCBmb3IgdGhpcyBibG9jayBvZiBpbnB1dCBzYW1wbGVzICAgICAgICAgKi8KLS8qICAgICAgICBMVk1fTUFYQkxPQ0tDQUxMICAgIC0gVGhlIGN1cnJlbnQgYmxvY2sgaXMgdGhlIG1heGltdW0gc2l6ZS4gT25seSB1c2VkIGZvciB0aGUgKi8KLS8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2Vjb25kIGFuZCBzdWJzZXF1ZW50IGJsb2Nrcy4gICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogICAgICAgIExWTV9MQVNUQ0FMTCAgICAgICAgLSBUaGUgbGFzdCBjYWxsIGZvciB0aGlzIGJsb2NrIG9mIGlucHV0IHNhbXBsZXMgICAgICAgICAgICovCi0vKiAgICAgICAgTFZNX0ZJUlNUTEFTVENBTEwgICAgLSBUaGlzIGlzIHRoZSBmaXJzdCBhbmQgbGFzdCBjYWxsIGZvciB0aGlzIGJsb2NrIG9mIGlucHV0Ki8KLS8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2FtcGxlcywgdGhpcyBvY2N1cnMgd2hlbiB0aGUgbnVtYmVyIG9mIHNhbXBsZXMgdG8gICAgICAqLwotLyogICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwcm9jZXNzIGlzIGxlc3MgdGhhbiB0aGUgbWF4aW11bSBibG9jayBzaXplLiAgICAgICAgICAgICovCi0vKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICAgIFRoZSBmdW5jdGlvbiB1c2VzIGFuIGludGVybmFsIGRlbGF5IGJ1ZmZlciB0aGUgc2l6ZSBvZiB0aGUgbWluaW11bSBmcmFtZSwgdGhpcyBpcyAqLwotLyogIHVzZWQgdG8gdGVtcG9yYXJpbHkgaG9sZCBzYW1wbGVzIHdoZW4gdGhlIG51bWJlciBvZiBzYW1wbGVzIHRvIHByb2Nlc3MgaXMgbm90IGEgICAgICovCi0vKiAgbXVsdGlwbGUgb2YgdGhlIGZyYW1lIHNpemUuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogICAgVG8gZW5zdXJlIGNvcnJlY3Qgb3BlcmF0aW9uIHdpdGggaW5wbGFjZSBidWZmZXJpbmcgdGhlIG51bWJlciBvZiBzYW1wbGVzIHRvIG91dHB1dCovCi0vKiAgcGVyIGNhbGwgaXMgY2FsY3VsYXRlZCBpbiB0aGlzIGZ1bmN0aW9uIGFuZCBpcyBzZXQgdG8gdGhlIG51bWJlci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HRoYW4gdGhlICAgKi8KLS8qICBmcmFtZSBzaXplLiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiBQQVJBTUVURVJTOiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICAgIGhJbnN0YW5jZSAgICAgICAgLSAgICBJbnN0YW5jZSBoYW5kbGUgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogICAgcEluRGF0YSAgICAgICAgICAgIC0gICAgUG9pbnRlciB0byB0aGUgaW5wdXQgZGF0YSBzdHJlYW0gICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgKnBUb1Byb2Nlc3MgICAgICAgIC0gICAgUG9pbnRlciB0byB0aGUgc3RhcnQgb2YgZGF0YSBwcm9jZXNzaW5nICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICAqcFByb2Nlc3NlZCAgICAgICAgLSAgICBQb2ludGVyIHRvIHRoZSBkZXN0aW5hdGlvbiBvZiB0aGUgcHJvY2Vzc2VkIGRhdGEgICAgICAgICAgICAqLwotLyogICAgcE51bVNhbXBsZXMgICAgICAgIC0gICAgUG9pbnRlciB0byB0aGUgbnVtYmVyIG9mIHNhbXBsZXMgdG8gcHJvY2VzcyAgICAgICAgICAgICAgICovCi0vKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qIFJFVFVSTlM6ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogICAgTm9uZSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qIE5PVEVTOiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLQotdm9pZCBMVk1fQnVmZmVySW4oTFZNX0hhbmRsZV90ICAgICAgaEluc3RhbmNlLAotICAgICAgICAgICAgICAgICAgY29uc3QgTFZNX0lOVDE2ICAgKnBJbkRhdGEsCi0gICAgICAgICAgICAgICAgICBMVk1fSU5UMTYgICAgICAgICAqKnBUb1Byb2Nlc3MsCi0gICAgICAgICAgICAgICAgICBMVk1fSU5UMTYgICAgICAgICAqKnBQcm9jZXNzZWQsCi0gICAgICAgICAgICAgICAgICBMVk1fVUlOVDE2ICAgICAgICAqcE51bVNhbXBsZXMpCi17Ci0KLSAgICBMVk1fSW5zdGFuY2VfdCAgICAqcEluc3RhbmNlID0gKExWTV9JbnN0YW5jZV90ICAqKWhJbnN0YW5jZTsKLQotCi0gICAgLyoKLSAgICAgKiBDaGVjayB3aGljaCBtb2RlLCBtYW5hZ2VkIG9yIHVubWFuYWdlZAotICAgICAqLwotICAgIGlmIChwSW5zdGFuY2UtPkluc3RQYXJhbXMuQnVmZmVyTW9kZSA9PSBMVk1fTUFOQUdFRF9CVUZGRVJTKQotICAgIHsKLSAgICAgICAgTFZNX0J1ZmZlck1hbmFnZWRJbihoSW5zdGFuY2UsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgcEluRGF0YSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBwVG9Qcm9jZXNzLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBQcm9jZXNzZWQsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgcE51bVNhbXBsZXMpOwotICAgIH0KLSAgICBlbHNlCi0gICAgewotICAgICAgICBMVk1fQnVmZmVyVW5tYW5hZ2VkSW4oaEluc3RhbmNlLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcFRvUHJvY2VzcywKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBQcm9jZXNzZWQsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwTnVtU2FtcGxlcyk7Ci0gICAgfQotfQotCi0vKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLS8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogRlVOQ1RJT046ICAgICAgICAgICAgICAgICBMVk1fQnVmZmVyTWFuYWdlZE91dCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qIERFU0NSSVBUSU9OOiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogIEZ1bGwgYnVmZmVyIG1hbmFnZW1lbnQgb3V0cHV0LiBUaGlzIHdvcmtzIGluIGNvbmp1bmN0aW9uIHdpdGggdGhlIG1hbmFnZWQgaW5wdXQgICAgICovCi0vKiAgcm91dGluZSBhbmQgZW5zdXJlcyB0aGUgY29ycmVjdCBudW1iZXIgb2Ygc2FtcGxlcyBhcmUgYWx3YXlzIG91dHB1dCB0byB0aGUgb3V0cHV0ICAgKi8KLS8qICBidWZmZXIuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiBQQVJBTUVURVJTOiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICAgIGhJbnN0YW5jZSAgICAgICAgLSBJbnN0YW5jZSBoYW5kbGUgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogICAgcE91dERhdGEgICAgICAgIC0gUG9pbnRlciB0byB0aGUgb3V0cHV0IGRhdGEgc3RyZWFtICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgICBwTnVtU2FtcGxlcyAgICAgICAgLSBQb2ludGVyIHRvIHRoZSBudW1iZXIgb2Ygc2FtcGxlcyB0byBwcm9jZXNzICAgICAgICAgICAgICAgICAgKi8KLS8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogUkVUVVJOUzogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgICBOb25lICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogTk9URVM6ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotCi12b2lkIExWTV9CdWZmZXJNYW5hZ2VkT3V0KExWTV9IYW5kbGVfdCAgICAgICAgaEluc3RhbmNlLAotICAgICAgICAgICAgICAgICAgICAgICAgICBMVk1fSU5UMTYgICAgICAgICAgICAqcE91dERhdGEsCi0gICAgICAgICAgICAgICAgICAgICAgICAgIExWTV9VSU5UMTYgICAgICAgICpwTnVtU2FtcGxlcykKLXsKLQotICAgIExWTV9JbnN0YW5jZV90ICAqcEluc3RhbmNlICA9IChMVk1fSW5zdGFuY2VfdCAgKiloSW5zdGFuY2U7Ci0gICAgTFZNX0J1ZmZlcl90ICAgICpwQnVmZmVyICAgID0gcEluc3RhbmNlLT5wQnVmZmVyTWFuYWdlbWVudDsKLSAgICBMVk1fSU5UMTYgICAgICAgU2FtcGxlQ291bnQgPSAoTFZNX0lOVDE2KSpwTnVtU2FtcGxlczsKLSAgICBMVk1fSU5UMTYgICAgICAgTnVtU2FtcGxlczsKLSAgICBMVk1fSU5UMTYgICAgICAgKnBTdGFydDsKLSAgICBMVk1fSU5UMTYgICAgICAgKnBEZXN0OwotCi0KLSAgICAvKgotICAgICAqIFNldCB0aGUgcG9pbnRlcnMKLSAgICAgKi8KLSAgICBOdW1TYW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VyLT5PdXREZWxheVNhbXBsZXMgPD0gTnVtU2FtcGxlcykKLSAgICAgICAgewotICAgICAgICAgICAgLyoKLSAgICAgICAgICAgICAqIENvcHkgYWxsIG91dHB1dCBkZWxheSBzYW1wbGVzIHRvIHRoZSBvdXRwdXQKLSAgICAgICAgICAgICAqLwotICAgICAgICAgICAgQ29weV8xNigmcEJ1ZmZlci0+T3V0RGVsYXlCdWZmZXJbMF0sICAgICAgICAgICAgICAgICAgICAvKiBTb3VyY2UgKi8KLSAgICAgICAgICAgICAgICAgICAgcERlc3QsICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLyogRGV0c2luYXRpb24gKi8KLSAgICAgICAgICAgICAgICAgICAgKExWTV9JTlQxNikoMipwQnVmZmVyLT5PdXREZWxheVNhbXBsZXMpKTsgICAgICAgLyogTnVtYmVyIG9mIGRlbGF5IHNhbXBsZXMgKi8KLQotICAgICAgICAgICAgLyoKLSAgICAgICAgICAgICAqIFVwZGF0ZSB0aGUgcG9pbnRlciBhbmQgc2FtcGxlIGNvdW50cwotICAgICAgICAgICAgICovCi0gICAgICAgICAgICBwRGVzdCArPSAyKnBCdWZmZXItPk91dERlbGF5U2FtcGxlczsgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8qIE91dHB1dCBzYW1wbGUgcG9pbnRlciAqLwotICAgICAgICAgICAgTnVtU2FtcGxlcyA9IChMVk1fSU5UMTYpKE51bVNhbXBsZXMgLSBwQnVmZmVyLT5PdXREZWxheVNhbXBsZXMpOyAgICAvKiBTYW1wbGVzIGxlZnQgdG8gc2VuZCAqLwotICAgICAgICAgICAgcEJ1ZmZlci0+T3V0RGVsYXlTYW1wbGVzID0gMDsgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvKiBObyBzYW1wbGVzIGxlZnQgaW4gdGhlIGJ1ZmZlciAqLwotCi0gICAgICAgIH0KLSAgICAgICAgZWxzZQotICAgICAgICB7Ci0gICAgICAgICAgICAvKgotICAgICAgICAgICAgICogQ29weSBvbmx5IHNvbWUgb2YgdGhlIG91cHV0IGRlbGF5IHNhbXBsZXMgdG8gdGhlIG91dHB1dAotICAgICAgICAgICAgICovCi0gICAgICAgICAgICBDb3B5XzE2KCZwQnVmZmVyLT5PdXREZWxheUJ1ZmZlclswXSwgICAgICAgICAgICAgICAgICAgIC8qIFNvdXJjZSAqLwotICAgICAgICAgICAgICAgICAgICBwRGVzdCwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvKiBEZXRzaW5hdGlvbiAqLwotICAgICAgICAgICAgICAgICAgICAoTFZNX0lOVDE2KSgyKk51bVNhbXBsZXMpKTsgICAgICAgICAgICAgICAgICAgICAvKiBOdW1iZXIgb2YgZGVsYXkgc2FtcGxlcyAqLwotCi0gICAgICAgICAgICAvKgotICAgICAgICAgICAgICogVXBkYXRlIHRoZSBwb2ludGVyIGFuZCBzYW1wbGUgY291bnRzCi0gICAgICAgICAgICAgKi8KLSAgICAgICAgICAgIHBEZXN0ICs9IDIqTnVtU2FtcGxlczsgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8qIE91dHB1dCBzYW1wbGUgcG9pbnRlciAqLwotICAgICAgICAgICAgcEJ1ZmZlci0+T3V0RGVsYXlTYW1wbGVzID0gKExWTV9JTlQxNikocEJ1ZmZlci0+T3V0RGVsYXlTYW1wbGVzIC0gTnVtU2FtcGxlcyk7ICAgICAgLyogTm8gc2FtcGxlcyBsZWZ0IGluIHRoZSBidWZmZXIgKi8KLQotCi0gICAgICAgICAgICAvKgotICAgICAgICAgICAgICogUmVhbGlnbiB0aGUgZGVsYXkgYnVmZmVyIGRhdGEgdG8gYXZvaWQgdXNpbmcgY2lyY3VsYXIgYnVmZmVyIG1hbmFnZW1lbnQKLSAgICAgICAgICAgICAqLwotICAgICAgICAgICAgQ29weV8xNigmcEJ1ZmZlci0+T3V0RGVsYXlCdWZmZXJbMipOdW1TYW1wbGVzXSwgICAgICAgICAvKiBTb3VyY2UgKi8KLSAgICAgICAgICAgICAgICAgICAgJnBCdWZmZXItPk91dERlbGF5QnVmZmVyWzBdLCAgICAgICAgICAgICAgICAgICAgLyogRGVzdGluYXRpb24gKi8KLSAgICAgICAgICAgICAgICAgICAgKExWTV9JTlQxNikoMipwQnVmZmVyLT5PdXREZWxheVNhbXBsZXMpKTsgICAgICAgLyogTnVtYmVyIG9mIHNhbXBsZXMgdG8gbW92ZSAqLwotICAgICAgICAgICAgTnVtU2FtcGxlcyA9IDA7ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvKiBTYW1wbGVzIGxlZnQgdG8gc2VuZCAqLwotICAgICAgICB9Ci0gICAgfQotCi0KLSAgICAvKgotICAgICAqIENvcHkgdGhlIHByb2Nlc3NlZCByZXN1bHRzIHRvIHRoZSBvdXRwdXQKLSAgICAgKi8KLSAgICBpZiAoKE51bVNhbXBsZXMgIT0gMCkgJiYKLSAgICAgICAgKFNhbXBsZUNvdW50ICE9IDApKQotICAgIHsKLSAgICAgICAgaWYgKFNhbXBsZUNvdW50IDw9IE51bVNhbXBsZXMpCi0gICAgICAgIHsKLSAgICAgICAgICAgIC8qCi0gICAgICAgICAgICAgKiBDb3B5IGFsbCBwcm9jZXNzZWQgc2FtcGxlcyB0byB0aGUgb3V0cHV0Ci0gICAgICAgICAgICAgKi8KLSAgICAgICAgICAgIENvcHlfMTYocFN0YXJ0LCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLyogU291cmNlICovCi0gICAgICAgICAgICAgICAgICAgIHBEZXN0LCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8qIERldHNpbmF0aW9uICovCi0gICAgICAgICAgICAgICAgICAgIChMVk1fSU5UMTYpKDIqU2FtcGxlQ291bnQpKTsgICAgICAgICAgICAgICAgIC8qIE51bWJlciBvZiBwcm9jZXNzZWQgc2FtcGxlcyAqLwotCi0gICAgICAgICAgICAvKgotICAgICAgICAgICAgICogVXBkYXRlIHRoZSBwb2ludGVyIGFuZCBzYW1wbGUgY291bnRzCi0gICAgICAgICAgICAgKi8KLSAgICAgICAgICAgIHBEZXN0ICAgICAgKz0gMiAqIFNhbXBsZUNvdW50OyAgICAgICAgICAgICAgICAgICAgICAgICAgLyogT3V0cHV0IHNhbXBsZSBwb2ludGVyICovCi0gICAgICAgICAgICBOdW1TYW1wbGVzICA9IChMVk1fSU5UMTYpKE51bVNhbXBsZXMgLSBTYW1wbGVDb3VudCk7ICAgIC8qIFNhbXBsZXMgbGVmdCB0byBzZW5kICovCi0gICAgICAgICAgICBTYW1wbGVDb3VudCA9IDA7ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8qIE5vIHNhbXBsZXMgbGVmdCBpbiB0aGUgYnVmZmVyICovCi0gICAgICAgIH0KLSAgICAgICAgZWxzZQotICAgICAgICB7Ci0gICAgICAgICAgICAvKgotICAgICAgICAgICAgICogQ29weSBvbmx5IHNvbWUgcHJvY2Vzc2VkIHNhbXBsZXMgdG8gdGhlIG91dHB1dAotICAgICAgICAgICAgICovCi0gICAgICAgICAgICBDb3B5XzE2KHBTdGFydCwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8qIFNvdXJjZSAqLwotICAgICAgICAgICAgICAgICAgICBwRGVzdCwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvKiBEZXN0aW5hdGlvbiAqLwotICAgICAgICAgICAgICAgICAgICAoTFZNX0lOVDE2KSgyKk51bVNhbXBsZXMpKTsgICAgICAgICAgICAgICAgICAgICAvKiBOdW1iZXIgb2YgcHJvY2Vzc2VkIHNhbXBsZXMgKi8KLQotCi0gICAgICAgICAgICAvKgotICAgICAgICAgICAgICogVXBkYXRlIHRoZSBwb2ludGVycyBhbmQgc2FtcGxlIGNvdW50cwotICAgICAgICAgICAgICAgKi8KLSAgICAgICAgICAgIHBTdGFydCAgICAgICs9IDIgKiBOdW1TYW1wbGVzOyAgICAgICAgICAgICAgICAgICAgICAgICAgLyogUHJvY2Vzc2VkIHNhbXBsZSBwb2ludGVyICovCi0gICAgICAgICAgICBwRGVzdCAgICAgICAgKz0gMiAqIE51bVNhbXBsZXM7ICAgICAgICAgICAgICAgICAgICAgICAgIC8qIE91dHB1dCBzYW1wbGUgcG9pbnRlciAqLwotICAgICAgICAgICAgU2FtcGxlQ291bnQgID0gKExWTV9JTlQxNikoU2FtcGxlQ291bnQgLSBOdW1TYW1wbGVzKTsgICAvKiBQcm9jZXNzZWQgc2FtcGxlcyBsZWZ0ICovCi0gICAgICAgICAgICBOdW1TYW1wbGVzICAgPSAwOyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8qIENsZWFyIHRoZSBzYW1wbGUgY291bnQgKi8KLSAgICAgICAgfQotICAgIH0KLQotCi0gICAgLyoKLSAgICAgKiBDb3B5IHRoZSByZW1haW5pbmcgcHJvY2Vzc2VkIGRhdGEgdG8gdGhlIG91dHB1dCBkZWxheSBidWZmZXIKLSAgICAgKi8KLSAgICBpZiAoU2FtcGxlQ291bnQgIT0gMCkKLSAgICB7Ci0gICAgICAgIENvcHlfMTYocFN0YXJ0LCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvKiBTb3VyY2UgKi8KLSAgICAgICAgICAgICAgICAmcEJ1ZmZlci0+T3V0RGVsYXlCdWZmZXJbMipwQnVmZmVyLT5PdXREZWxheVNhbXBsZXNdLCAgIC8qIERlc3RpbmF0aW9uICovCi0gICAgICAgICAgICAgICAgKExWTV9JTlQxNikoMipTYW1wbGVDb3VudCkpOyAgICAgICAgICAgICAgICAgICAgICAgICAgICAvKiBOdW1iZXIgb2YgcHJvY2Vzc2VkIHNhbXBsZXMgKi8KLSAgICAgICAgcEJ1ZmZlci0+T3V0RGVsYXlTYW1wbGVzID0gKExWTV9JTlQxNikocEJ1ZmZlci0+T3V0RGVsYXlTYW1wbGVzICsgU2FtcGxlQ291bnQpOyAvKiBVcGRhdGUgdGhlIGJ1ZmZlciBjb3VudCAqLwotICAgIH0KLQotCi0gICAgLyoKLSAgICAgKiBwb2ludGVycywgY291bnRzIGFuZCBzZXQgZGVmYXVsdCBidWZmZXIgcHJvY2Vzc2luZwotICAgICAqLwotICAgIHBCdWZmZXItPlNhbXBsZXNUb091dHB1dCAgPSBOdW1TYW1wbGVzOyAgICAgICAgICAgICAgICAgICAgICAgICAvKiBTYW1wbGVzIGxlZnQgdG8gc2VuZCAqLwotICAgIHBJbnN0YW5jZS0+cE91dHB1dFNhbXBsZXMgPSBwRGVzdDsgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvKiBPdXRwdXQgc2FtcGxlIHBvaW50ZXIgKi8KLSAgICBwQnVmZmVyLT5CdWZmZXJTdGF0ZSAgICAgID0gTFZNX01BWEJMT0NLQ0FMTDsgICAgICAgICAgICAgICAgICAgLyogU2V0IGZvciB0aGUgZGVmYXVsdCBjYWxsIGJsb2NrIHNpemUgKi8KLSAgICAqcE51bVNhbXBsZXMgPSAoTFZNX1VJTlQxNilwSW5zdGFuY2UtPlNhbXBsZXNUb1Byb2Nlc3M7ICAgICAgICAgLyogVGhpcyB3aWxsIHRlcm1pbmF0ZSB0aGUgbG9vcCB3aGVuIGFsbCBzYW1wbGVzIHByb2Nlc3NlZCAqLwotfQotCi0KLS8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotLyogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiBGVU5DVElPTjogICAgICAgICAgICAgICAgIExWTV9CdWZmZXJVbm1hbmFnZWRPdXQgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogREVTQ1JJUFRJT046ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgVGhpcyB3b3JrcyBpbiBjb25qdW5jdGlvbiB3aXRoIHRoZSB1bm1hbmFnZWQgaW5wdXQgcm91dGluZSBhbmQgdXBkYXRlcyB0aGUgbnVtYmVyICAgKi8KLS8qICAgIG9mIHNhbXBsZXMgbGVmdCB0byBiZSBwcm9jZXNzZWQgICAgYW5kIGFkanVzdHMgdGhlIGJ1ZmZlciBwb2ludGVycy4gICAgICAgICAgICAgICAqLwotLyogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiBQQVJBTUVURVJTOiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICAgIGhJbnN0YW5jZSAgICAgICAgLSBJbnN0YW5jZSBoYW5kbGUgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogICAgcE51bVNhbXBsZXMgICAgICAgIC0gUG9pbnRlciB0byB0aGUgbnVtYmVyIG9mIHNhbXBsZXMgdG8gcHJvY2VzcyAgICAgICAgICAgICAgICAgICovCi0vKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qIFJFVFVSTlM6ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogICAgTm9uZSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qIE5PVEVTOiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLQotdm9pZCBMVk1fQnVmZmVyVW5tYW5hZ2VkT3V0KExWTV9IYW5kbGVfdCAgICAgICAgaEluc3RhbmNlLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgIExWTV9VSU5UMTYgICAgICAgICAgKnBOdW1TYW1wbGVzKQotewotCi0gICAgTFZNX0luc3RhbmNlX3QgICAgICAqcEluc3RhbmNlICA9IChMVk1fSW5zdGFuY2VfdCAgKiloSW5zdGFuY2U7Ci0gICAgTFZNX0lOVDE2ICAgICAgICAgICBOdW1DaGFubmVscyA9MjsKLQotCi0gICAgLyoKLSAgICAgKiBVcGRhdGUgc2FtcGxlIGNvdW50cwotICAgICAqLwotICAgIHBJbnN0YW5jZS0+cElucHV0U2FtcGxlcyAgICArPSAoTFZNX0lOVDE2KSgqcE51bVNhbXBsZXMgKiBOdW1DaGFubmVscyk7IC8qIFVwZGF0ZSB0aGUgSS9PIHBvaW50ZXJzICovCi0gICAgcEluc3RhbmNlLT5wT3V0cHV0U2FtcGxlcyAgICs9IChMVk1fSU5UMTYpKCpwTnVtU2FtcGxlcyAqIDIpOwotICAgIHBJbnN0YW5jZS0+U2FtcGxlc1RvUHJvY2VzcyAgPSAoTFZNX0lOVDE2KShwSW5zdGFuY2UtPlNhbXBsZXNUb1Byb2Nlc3MgLSAqcE51bVNhbXBsZXMpOyAvKiBVcGRhdGUgdGhlIHNhbXBsZSBjb3VudCAqLwotCi0gICAgLyoKLSAgICAgKiBTZXQgdGUgYmxvY2sgc2l6ZSB0byBwcm9jZXNzCi0gICAgICovCi0gICAgaWYgKHBJbnN0YW5jZS0+U2FtcGxlc1RvUHJvY2VzcyA+IHBJbnN0YW5jZS0+SW50ZXJuYWxCbG9ja1NpemUpCi0gICAgewotICAgICAgICAqcE51bVNhbXBsZXMgPSAoTFZNX1VJTlQxNilwSW5zdGFuY2UtPkludGVybmFsQmxvY2tTaXplOwotICAgIH0KLSAgICBlbHNlCi0gICAgewotICAgICAgICAqcE51bVNhbXBsZXMgPSAoTFZNX1VJTlQxNilwSW5zdGFuY2UtPlNhbXBsZXNUb1Byb2Nlc3M7Ci0gICAgfQotfQotCi0KLS8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotLyogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiBGVU5DVElPTjogICAgICAgICAgICAgICAgIExWTV9CdWZmZXJPcHRpbWlzZWRPdXQgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogREVTQ1JJUFRJT046ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgVGhpcyB3b3JrcyBpbiBjb25qdW5jdGlvbiB3aXRoIHRoZSBvcHRpbWlzZWQgaW5wdXQgcm91dGluZSBhbmQgY29waWVzIHRoZSBsYXN0IGZldyAgKi8KLS8qICBwcm9jZXNzZWQgYW5kIHVucHJvY2Vzc2VkIHNhbXBsZXMgdG8gdGhlaXIgcmVzcGVjdGl2ZSBidWZmZXJzLiAgICAgICAgICAgICAgICAgICAgICAqLwotLyogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiBQQVJBTUVURVJTOiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICAgIGhJbnN0YW5jZSAgICAgICAgLSBJbnN0YW5jZSBoYW5kbGUgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogICAgcE51bVNhbXBsZXMgICAgICAgIC0gUG9pbnRlciB0byB0aGUgbnVtYmVyIG9mIHNhbXBsZXMgdG8gcHJvY2VzcyAgICAgICAgICAgICAgICAgICovCi0vKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qIFJFVFVSTlM6ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogICAgTm9uZSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qIE5PVEVTOiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLQotdm9pZCBMVk1fQnVmZmVyT3B0aW1pc2VkT3V0KExWTV9IYW5kbGVfdCAgICBoSW5zdGFuY2UsCi0gICAgICAgICAgICAgIC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c3M7Ci0gICAgICAgICAgICBwSW5zdGFuY2UtPlNhbXBsZXNUb1Byb2Nlc3MgPSAwOwotICAgICAgICB9Ci0gICAgICAgIGVsc2UKLSAgICAgICAgewotICAgICAgICAgICAgcEJ1ZmZlci0+SW5EZWxheVNhbXBsZXMgPSAwOwotICAgICAgICB9Ci0KLQotICAgICAgICAvKgotICAgICAgICAgKiBGaWxsIHRoZSBsYXN0IGVtcHR5IHNwYWNlcyBpbiB0aGUgb3V0cHV0IGJ1ZmZlcgotICAgICAgICAgKi8KLSAgICAgICAgaWYgKHBCdWZmZXItPlNhbXBsZXNUb091dHB1dCAhPSAwKQotICAgICAgICB7Ci0gICAgICAgICAgICBDb3B5XzE2KHBTcmMsICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8qIFNvdXJjZSAqLwotICAgICAgICAgICAgICAgICAgICBwSW5zdGFuY2UtPnBPdXRwdXRTYW1wbGVzLCAgICAgICAgICAgICAgICAgICAgICAvKiBEZXN0aW5hdGlvbiAqLwotICAgICAgICAgICAgICAgICAgICAoTFZNX0lOVDE2KSgyKnBCdWZmZXItPlNhbXBsZXNUb091dHB1dCkpOyAgICAgICAvKiBOdW1iZXIgb2YgaW5wdXQgc2FtcGxlcyAqLwotICAgICAgICAgICAgKnBOdW1TYW1wbGVzID0gKExWTV9VSU5UMTYpKCpwTnVtU2FtcGxlcyAtIHBCdWZmZXItPlNhbXBsZXNUb091dHB1dCk7Ci0gICAgICAgICAgICBwU3JjICs9IDIgKiBwQnVmZmVyLT5TYW1wbGVzVG9PdXRwdXQ7ICAgICAgICAgICAgICAgICAgLyogVXBkYXRlIHNjcmF0Y2ggcG9pbnRlciAqLwotICAgICAgICAgICAgcEJ1ZmZlci0+U2FtcGxlc1RvT3V0cHV0ID0gMDsgICAgICAgICAgICAgICAgICAgICAgICAgIC8qIE5vIG1vcmUgc2FtcGxlcyBpbiB0aGlzIGJsb2NrICovCi0gICAgICAgIH0KLQotCi0gICAgICAgIC8qCi0gICAgICAgICAqIFNhdmUgYW55IHJlbWFpbmluZyBwcm9jZXNzZWQgc2FtcGxlcyBpbiB0aGUgb3V0cHV0IGRlbGF5IGJ1ZmZlcgotICAgICAgICAgKi8KLSAgICAgICAgaWYgKCpwTnVtU2FtcGxlcyAhPSAwKQotICAgICAgICB7Ci0gICAgICAgICAgICBDb3B5XzE2KHBTcmMsICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8qIFNvdXJjZSAqLwotICAgICAgICAgICAgICAgICAgICAmcEJ1ZmZlci0+T3V0RGVsYXlCdWZmZXJbMF0sICAgICAgICAgICAgICAgICAgICAvKiBEZXN0aW5hdGlvbiAqLwotICAgICAgICAgICAgICAgICAgICAoTFZNX0lOVDE2KSgyKipwTnVtU2FtcGxlcykpOyAgICAgICAgICAgICAgICAgICAvKiBOdW1iZXIgb2YgaW5wdXQgc2FtcGxlcyAqLwotCi0gICAgICAgICAgICBwQnVmZmVyLT5PdXREZWxheVNhbXBsZXMgPSAoTFZNX0lOVDE2KSpwTnVtU2FtcGxlczsKLQotICAgICAgICAgICAgKnBOdW1TYW1wbGVzID0gMDsgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8qIE5vIG1vcmUgc2FtcGxlcyBpbiB0aGlzIGJsb2NrICovCi0gICAgICAgIH0KLSAgICAgICAgZWxzZQotICAgICAgICB7Ci0gICAgICAgICAgICBwQnVmZmVyLT5PdXREZWxheVNhbXBsZXMgPSAwOwotICAgICAgICB9Ci0gICAgfQotfQotCi0KLS8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotLyogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiBGVU5DVElPTjogICAgICAgICAgICAgICAgIExWTV9CdWZmZXJPdXQgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogREVTQ1JJUFRJT046ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgVGhpcyBmdW5jdGlvbiBtYW5hZ2VzIHRoZSBkYXRhIG91dHB1dCwgaXQgaGFzIHRoZSBmb2xsb3dpbmcgZmVhdHVyZXM6ICAgICAgICAgICAgICAgKi8KLS8qICAgICAgICAtIE91dHB1dCBkYXRhIHRvIDE2LWJpdCBhbGlnbmVkIG1lbW9yeSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogICAgICAgIC0gUmVhZHMgZGF0YSBmcm9tIDMyLWJpdCBhbGlnbmVkIG1lbW9yeSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgICAgICAgLSBSZWFkcyBkYXRhIG9ubHkgaW4gYmxvY2tzIG9mIGZyYW1lIHNpemUgb3IgbXVsdGlwbGVzIG9mIGZyYW1lIHNpemUgICAgICAgICAgKi8KLS8qICAgICAgICAtIFdyaXRlcyB0aGUgc2FtZSBudW1iZXIgb2Ygc2FtcGxlcyBhcyB0aGUgTFZNX0J1ZmZlckluIGZ1bmN0aW9uIHJlYWRzICAgICAgICAqLwotLyogICAgICAgIC0gV29ya3Mgd2l0aCBpbnBsYWNlIG9yIG91dHBsYWNlIHByb2Nlc3NpbmcgYXV0b21hdGljYWxseSAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICBUbyBtYW5hZ2UgdGhlIGRhdGEgdGhlIGZ1bmN0aW9uIGhhcyBhIG51bWJlciBvZiBvcGVyYXRpbmcgc3RhdGVzOiAgICAgICAgICAgICAgICAgICAqLwotLyogICAgICAgIExWTV9GSVJTVENBTEwgICAgICAgIC0gVGhlIGZpcnN0IGNhbGwgZm9yIHRoaXMgYmxvY2sgb2YgaW5wdXQgc2FtcGxlcyAgICAgICAgICovCi0vKiAgICAgICAgTFZNX0ZJUlNUTEFTVENBTEwgICAgLSBUaGlzIGlzIHRoZSBmaXJzdCBhbmQgbGFzdCBjYWxsIGZvciB0aGlzIGJsb2NrIG9mIGlucHV0Ki8KLS8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2FtcGxlcywgdGhpcyBvY2N1cnMgd2hlbiB0aGUgbnVtYmVyIG9mIHNhbXBsZXMgdG8gICAgICAqLwotLyogICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwcm9jZXNzIGlzIGxlc3MgdGhhbiB0aGUgbWF4aW11bSBibG9jayBzaXplLiAgICAgICAgICAgICovCi0vKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICAgIFRoZSBmdW5jdGlvbiB1c2VzIGFuIGludGVybmFsIGRlbGF5IGJ1ZmZlciB0aGUgc2l6ZSBvZiB0aGUgbWluaW11bSBmcmFtZSwgdGhpcyBpcyAqLwotLyogIHVzZWQgdG8gdGVtcG9yYXJpbHkgaG9sZCBzYW1wbGVzIHdoZW4gdGhlIG51bWJlciBvZiBzYW1wbGVzIHRvIHdyaXRlIGlzIG5vdCBhICAgICAgICovCi0vKiAgbXVsdGlwbGUgb2YgdGhlIGZyYW1lIHNpemUuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogICAgVG8gZW5zdXJlIGNvcnJlY3Qgb3BlcmF0aW9uIHdpdGggaW5wbGFjZSBidWZmZXJpbmcgdGhlIG51bWJlciBvZiBzYW1wbGVzIHRvIG91dHB1dCovCi0vKiAgcGVyIGNhbGwgaXMgYWx3YXlzIHRoZSBzYW1lIGFzIHRoZSBudW1iZXIgb2Ygc2FtcGxlcyByZWFkIGZyb20gdGhlIGlucHV0IGJ1ZmZlci4gICAgKi8KLS8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogUEFSQU1FVEVSUzogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgICBoSW5zdGFuY2UgICAgICAgIC0gSW5zdGFuY2UgaGFuZGxlICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICAgIHBPdXREYXRhICAgICAgICAtIFBvaW50ZXIgdG8gdGhlIG91dHB1dCBkYXRhIHN0cmVhbSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogICAgcE51bVNhbXBsZXMgICAgICAgIC0gUG9pbnRlciB0byB0aGUgbnVtYmVyIG9mIHNhbXBsZXMgdG8gcHJvY2VzcyAgICAgICAgICAgICAgICAgICovCi0vKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qIFJFVFVSTlM6ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogICAgTm9uZSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qIE5PVEVTOiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLQotdm9pZCBMVk1fQnVmZmVyT3V0KExWTV9IYW5kbGVfdCAgICAgaEluc3RhbmNlLAotICAgICAgICAgICAgICAgICAgIExWTV9JTlQxNiAgICAgICAgKnBPdXREYXRhLAotICAgICAgICAgICAgICAgICAgIExWTV9VSU5UMTYgICAgICAgKnBOdW1TYW1wbGVzKQotewotCi0gICAgTFZNX0luc3RhbmNlX3QgICAgKnBJbnN0YW5jZSAgPSAoTFZNX0luc3RhbmNlX3QgICopaEluc3RhbmNlOwotCi0KLSAgICAvKgotICAgICAqIENoZWNrIHdoaWNoIG1vZGUsIG1hbmFnZWQgb3IgdW5tYW5hZ2VkCi0gICAgICovCi0gICAgaWYgKHBJbnN0YW5jZS0+SW5zdFBhcmFtcy5CdWZmZXJNb2RlID09IExWTV9NQU5BR0VEX0JVRkZFUlMpCi0gICAgewotICAgICAgICBMVk1fQnVmZmVyTWFuYWdlZE91dChoSW5zdGFuY2UsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBPdXREYXRhLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwTnVtU2FtcGxlcyk7Ci0gICAgfQotICAgIGVsc2UKLSAgICB7Ci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nV0ZWQgb24gYW4gIkFTIElTIiBCQVNJUywKLSAqIFdJVEhPVVQgV0FSUkFOVElFUyBPUiBDT05ESVRJT05TIE9GIEFOWSBLSU5ELCBlaXRoZXIgZXhwcmVzcyBvciBpbXBsaWVkLgotICogU2VlIHRoZSBMaWNlbnNlIGZvciB0aGUgc3BlY2lmaWMgbGFuZ3VhZ2UgZ292ZXJuaW5nIHBlcm1pc3Npb25zIGFuZAotICogbGltaXRhdGlvbnMgdW5kZXIgdGhlIExpY2Vuc2UuCi0gKi8KLQotI2lmbmRlZiBfX0xWTV9DT0VGRlNfSF9fCi0jZGVmaW5lIF9fTFZNX0NPRUZGU19IX18KLQotCi0vKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotLyogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qIEhpZ2ggUGFzcyBTaGVsdmluZyBGaWx0ZXIgY29lZmZpY2llbnRzICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLQotI2RlZmluZSBUcmVibGVCb29zdENvcm5lciAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA4MDAwCi0jZGVmaW5lIFRyZWJsZUJvb3N0TWluUmF0ZSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA0Ci0jZGVmaW5lIFRyZWJsZUJvb3N0U3RlcHMgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAxNQotCi0KLS8qIENvZWZmaWNpZW50cyBmb3Igc2FtcGxlIHJhdGUgMjIwNTBIeiAqLwotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvKiBHYWluID0gIDEuMDAwMDAwIGRCICovCi0jZGVmaW5lIEhQRl9GczIyMDUwX0dhaW4xX0EwICAgICAgICAgICAgICAgICAgICAgICAgICAgICA1MzgzICAgICAgICAgLyogRmxvYXRpbmcgcG9pbnQgdmFsdWUgMC4xNjQyOTEgKi8KLSNkZWZpbmUgSFBGX0ZzMjIwNTBfR2FpbjFfQTEgICAgICAgICAgICAgICAgICAgICAgICAgICAgMTY4NTkgICAgICAgICAvKiBGbG9hdGluZyBwb2ludCB2YWx1ZSAwLjUxNDQ5MiAqLwotI2RlZmluZSBIUEZfRnMyMjA1MF9HYWluMV9BMiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMCAgICAgICAgIC8qIEZsb2F0aW5nIHBvaW50IHZhbHVlIDAuMDAwMDAwICovCi0jZGVmaW5lIEhQRl9GczIyMDUwX0dhaW4xX0IxICAgICAgICAgICAgICAgICAgICAgICAgICAgIDEyMTI1ICAgICAgICAgLyogRmxvYXRpbmcgcG9pbnQgdmFsdWUgMC4zNzAwMzMgKi8KLSNkZWZpbmUgSFBGX0ZzMjIwNTBfR2FpbjFfQjIgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDAgICAgICAgICAvKiBGbG9hdGluZyBwb2ludCB2YWx1ZSAwLjAwMDAwMCAqLwotI2RlZmluZSBIUEZfRnMyMjA1MF9HYWluMV9TaGlmdCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMSAgICAgICAgIC8qIFNoaWZ0IHZhbHVlICovCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8qIEdhaW4gPSAgMi4wMDAwMDAgZEIgKi8KLSNkZWZpbmUgSFBGX0ZzMjIwNTBfR2FpbjJfQTAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDQ2ODMgICAgICAgICAvKiBGbG9hdGluZyBwb2ludCB2YWx1ZSAwLjE0MjkyNSAqLwotI2RlZmluZSBIUEZfRnMyMjA1MF9HYWluMl9BMSAgICAgICAgICAgICAgICAgICAgICAgICAgICAxNzU1OSAgICAgICAgIC8qIEZsb2F0aW5nIHBvaW50IHZhbHVlIDAuNTM1ODU4ICovCi0jZGVmaW5lIEhQRl9GczIyMDUwX0dhaW4yX0EyICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAwICAgICAgICAgLyogRmxvYXRpbmcgcG9pbnQgdmFsdWUgMC4wMDAwMDAgKi8KLSNkZWZpbmUgSFBGX0ZzMjIwNTBfR2FpbjJfQjEgICAgICAgICAgICAgICAgICAgICAgICAgICAgMTIxMjUgICAgICAgICAvKiBGbG9hdGluZyBwb2ludCB2YWx1ZSAwLjM3MDAzMyAqLwotI2RlZmluZSBIUEZfRnMyMjA1MF9HYWluMl9CMiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMCAgICAgICAgIC8qIEZsb2F0aW5nIHBvaW50IHZhbHVlIDAuMDAwMDAwICovCi0jZGVmaW5lIEhQRl9GczIyMDUwX0dhaW4yX1NoaWZ0ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAxICAgICAgICAgLyogU2hpZnQgdmFsdWUgKi8KLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLyogR2FpbiA9ICAzLjAwMDAwMCBkQiAqLwotI2RlZmluZSBIUEZfRnMyMjA1MF9HYWluM19BMCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMzg5OCAgICAgICAgIC8qIEZsb2F0aW5nIHBvaW50IHZhbHVlIDAuMTE4OTUzICovCi0jZGVmaW5lIEhQRl9GczIyMDUwX0dhaW4zX0ExICAgICAgICAgICAgICAgICAgICAgICAgICAgIDE4MzQ1ICAgICAgICAgLyogRmxvYXRpbmcgcG9pbnQgdmFsdWUgMC41NTk4MzAgKi8KLSNkZWZpbmUgSFBGX0ZzMjIwNTBfR2FpbjNfQTIgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDAgICAgICAgICAvKiBGbG9hdGluZyBwb2ludCB2YWx1ZSAwLjAwMDAwMCAqLwotI2RlZmluZSBIUEZfRnMyMjA1MF9HYWluM19CMSAgICAgICAgICAgICAgICAgICAgICAgICAgICAxMjEyNSAgICAgICAgIC8qIEZsb2F0aW5nIHBvaW50IHZhbHVlIDAuMzcwMDMzICovCi0jZGVmaW5lIEhQRl9GczIyMDUwX0dhaW4zX0IyICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAwICAgICAgICAgLyogRmxvYXRpbmcgcG9pbnQgdmFsdWUgMC4wMDAwMDAgKi8KLSNkZWZpbmUgSFBGX0ZzMjIwNTBfR2FpbjNfU2hpZnQgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDEgICAgICAgICAvKiBTaGlmdCB2YWx1ZSAqLwotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvKiBHYWluID0gIDQuMDAwMDAwIGRCICovCi0jZGVmaW5lIEhQRl9GczIyMDUwX0dhaW40X0EwICAgICAgICAgICAgICAgICAgICAgICAgICAgICAzMDE2ICAgICAgICAgLyogRmxvYXRpbmcgcG9pbnQgdmFsdWUgMC4wOTIwNTUgKi8KLSNkZWZpbmUgSFBGX0ZzMjIwNTBfR2FpbjRfQTEgICAgICAgICAgICAgICAgICAgICAgICAgICAgMTkyMjYgICAgICAgICAvKiBGbG9hdGluZyBwb2ludCB2YWx1ZSAwLjU4NjcyOCAqLwotI2RlZmluZSBIUEZfRnMyMjA1MF9HYWluNF9BMiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMCAgICAgICAgIC8qIEZsb2F0aW5nIHBvaW50IHZhbHVlIDAuMDAwMDAwICovCi0jZGVmaW5lIEhQRl9GczIyMDUwX0dhaW40X0IxICAgICAgICAgICAgICAgICAgICAgICAgICAgIDEyMTI1ICAgICAgICAgLyogRmxvYXRpbmcgcG9pbnQgdmFsdWUgMC4zNzAwMzMgKi8KLSNkZWZpbmUgSFBGX0ZzMjIwNTBfR2FpbjRfQjIgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDAgICAgICAgICAvKiBGbG9hdGluZyBwb2ludCB2YWx1ZSAwLjAwMDAwMCAqLwotI2RlZmluZSBIUEZfRnMyMjA1MF9HYWluNF9TaGlmdCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMSAgICAgICAgIC8qIFNoaWZ0IHZhbHVlICovCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8qIEdhaW4gPSAgNS4wMDAwMDAgZEIgKi8KLSNkZWZpbmUgSFBGX0ZzMjIwNTBfR2FpbjVfQTAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDIwMjggICAgICAgICAvKiBGbG9hdGluZyBwb2ludCB2YWx1ZSAwLjA2MTg3NiAqLwotI2RlZmluZSBIUEZfRnMyMjA1MF9HYWluNV9BMSAgICAgICAgICAgICAgICAgICAgICAgICAgICAyMDIxNSAgICAgICAgIC8qIEZsb2F0aW5nIHBvaW50IHZhbHVlIDAuNjE2OTA3ICovCi0jZGVmaW5lIEhQRl9GczIyMDUwX0dhaW41X0EyICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAwICAgICAgICAgLyogRmxvYXRpbmcgcG9pbnQgdmFsdWUgMC4wMDAwMDAgKi8KLSNkZWZpbmUgSFBGX0ZzMjIwNTBfR2FpbjVfQjEgICAgICAgICAgICAgICAgICAgICAgICAgICAgMTIxMjUgICAgICAgICAvKiBGbG9hdGluZyBwb2ludCB2YWx1ZSAwLjM3MDAzMyAqLwotI2RlZmluZSBIUEZfRnMyMjA1MF9HYWluNV9CMiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMCAgICAgICAgIC8qIEZsb2F0aW5nIHBvaW50IHZhbHVlIDAuMDAwMDAwICovCi0jZGVmaW5lIEhQRl9GczIyMDUwX0dhaW41X1NoaWZ0ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAxICAgICAgICAgLyogU2hpZnQgdmFsdWUgKi8KLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLyogR2FpbiA9ICA2LjAwMDAwMCBkQiAqLwotI2RlZmluZSBIUEZfRnMyMjA1MF9HYWluNl9BMCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDkxOCAgICAgICAgIC8qIEZsb2F0aW5nIHBvaW50IHZhbHVlIDAuMDI4MDEzICovCi0jZGVmaW5lIEhQRl9GczIyMDUwX0dhaW42X0ExICAgICAgICAgICAgICAgICAgICAgICAgICAgIDIxMzI0ICAgICAgICAgLyogRmxvYXRpbmcgcG9pbnQgdmFsdWUgMC42NTA3NzAgKi8KLSNkZWZpbmUgSFBGX0ZzMjIwNTBfR2FpbjZfQTIgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDAgICAgICAgICAvKiBGbG9hdGluZyBwb2ludCB2YWx1ZSAwLjAwMDAwMCAqLwotI2RlZmluZSBIUEZfRnMyMjA1MF9HYWluNl9CMSAgICAgICAgICAgICAgICAgICAgICAgICAgICAxMjEyNSAgICAgICAgIC8qIEZsb2F0aW5nIHBvaW50IHZhbHVlIDAuMzcwMDMzICovCi0jZGVmaW5lIEhQRl9GczIyMDUwX0dhaW42X0IyICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAwICAgICAgICAgLyogRmxvYXRpbmcgcG9pbnQgdmFsdWUgMC4wMDAwMDAgKi8KLSNkZWZpbmUgSFBGX0ZzMjIwNTBfR2FpbjZfU2hpZnQgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDEgICAgICAgICAvKiBTaGlmdCB2YWx1ZSAqLwotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvKiBHYWluID0gIDcuMDAwMDAwIGRCICovCi0jZGVmaW5lIEhQRl9GczIyMDUwX0dhaW43X0EwICAgICAgICAgICAgICAgICAgICAgICAgICAgICAtMTY0ICAgICAgICAgLyogRmxvYXRpbmcgcG9pbnQgdmFsdWUgLTAuMDA1MDAyICovCi0jZGVmaW5lIEhQRl9GczIyMDUwX0dhaW43X0ExICAgICAgICAgICAgICAgICAgICAgICAgICAgIDExMzExICAgICAgICAgLyogRmxvYXRpbmcgcG9pbnQgdmFsdWUgMC4zNDUxOTkgKi8KLSNkZWZpbmUgSFBGX0ZzMjIwNTBfR2FpbjdfQTIgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDAgICAgICAgICAvKiBGbG9hdGluZyBwb2ludCB2YWx1ZSAwLjAwMDAwMCAqLwotI2RlZmluZSBIUEZfRnMyMjA1MF9HYWluN19CMSAgICAgICAgICAgICAgICAgICAgICAgICAgICAxMjEyNSAgICAgICAgIC8qIEZsb2F0aW5nIHBvaW50IHZhbHVlIDAuMzcwMDMzICovCi0jZGVmaW5lIEhQRl9GczIyMDUwX0dhaW43X0IyICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAwICAgICAgICAgLyogRmxvYXRpbmcgcG9pbnQgdmFsdWUgMC4wMDAwMDAgKi8KLSNkZWZpbmUgSFBGX0ZzMjIwNTBfR2FpbjdfU2hpZnQgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDIgICAgICAgICAvKiBTaGlmdCB2YWx1ZSAqLwotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvKiBHYWluID0gIDguMDAwMDAwIGRCICovCi0jZGVmaW5lIEhQRl9GczIyMDUwX0dhaW44X0EwICAgICAgICAgICAgICAgICAgICAgICAgICAgICAtODY0ICAgICAgICAgLyogRmxvYXRpbmcgcG9pbnQgdmFsdWUgLTAuMDI2MzY4ICovCi0jZGVmaW5lIEhQRl9GczIyMDUwX0dhaW44X0ExICAgICAgICAgICAgICAgICAgICAgICAgICAgIDEyMDEyICAgICAgICAgLyogRmxvYXRpbmcgcG9pbnQgdmFsdWUgMC4zNjY1NjUgKi8KLSNkZWZpbmUgSFBGX0ZzMjIwNTBfR2FpbjhfQTIgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDAgICAgICAgICAvKiBGbG9hdGluZyBwb2ludCB2YWx1ZSAwLjAwMDAwMCAqLwotI2RlZmluZSBIUEZfRnMyMjA1MF9HYWluOF9CMSAgICAgICAgICAgICAgICAgICAgICAgICAgICAxMjEyNSAgICAgICAgIC8qIEZsb2F0aW5nIHBvaW50IHZhbHVlIDAuMzcwMDMzICovCi0jZGVmaW5lIEhQRl9GczIyMDUwX0dhaW44X0IyICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAwICAgICAgICAgLyogRmxvYXRpbmcgcG9pbnQgdmFsdWUgMC4wMDAwMDAgKi8KLSNkZWZpbmUgSFBGX0ZzMjIwNTBfR2FpbjhfU2hpZnQgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDIgICAgICAgICAvKiBTaGlmdCB2YWx1ZSAqLwotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvKiBHYWluID0gIDkuMDAwMDAwIGRCICovCi0jZGVmaW5lIEhQRl9GczIyMDUwX0dhaW45X0EwICAgICAgICAgICAgICAgICAgICAgICAgICAgIC0xNjUwICAgICAgICAgLyogRmxvYXRpbmcgcG9pbnQgdmFsdWUgLTAuMDUwMzQwICovCi0jZGVmaW5lIEhQRl9GczIyMDUwX0dhaW45X0ExICAgICAgICAgICAgICAgICAgICAgICAgICAgIDEyNzk3ICAgICAgICAgLyogRmxvYXRpbmcgcG9pbnQgdmFsdWUgMC4zOTA1MzcgKi8KLSNkZWZpbmUgSFBGX0ZzMjIwNTBfR2FpbjlfQTIgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDAgICAgICAgICAvKiBGbG9hdGluZyBwb2ludCB2YWx1ZSAwLjAwMDAwMCAqLwotI2RlZmluZSBIUEZfRnMyMjA1MF9HYWluOV9CMSAgICAgICAgICAgICAgICAgICAgICAgICAgICAxMjEyNSAgICAgICAgIC8qIEZsb2F0aW5nIHBvaW50IHZhbHVlIDAuMzcwMDMzICovCi0jZGVmaW5lIEhQRl9GczIyMDUwX0dhaW45X0IyICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAwICAgICAgICAgLyogRmxvYXRpbmcgcG9pbnQgdmFsdWUgMC4wMDAwMDAgKi8KLSNkZWZpbmUgSFBGX0ZzMjIwNTBfR2FpbjlfU2hpZnQgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDIgICAgICAgICAvKiBTaGlmdCB2YWx1ZSAqLwotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvKiBHYWluID0gIDEwLjAwMDAwMCBkQiAqLwotI2RlZmluZSBIUEZfRnMyMjA1MF9HYWluMTBfQTAgICAgICAgICAgICAgICAgICAgICAgICAgICAtMjUzMSAgICAgICAgIC8qIEZsb2F0aW5nIHBvaW50IHZhbHVlIC0wLjA3NzIzOCAqLwotI2RlZmluZSBIUEZfRnMyMjA1MF9HYWluMTBfQTEgICAgICAgICAgICAgICAgICAgICAgICAgICAxMzY3OSAgICAgICAgIC8qIEZsb2F0aW5nIHBvaW50IHZhbHVlIDAuNDE3NDM1ICovCi0jZGVmaW5lIEhQRl9GczIyMDUwX0dhaW4xMF9BMiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAwICAgICAgICAgLyogRmxvYXRpbmcgcG9pbnQgdmFsdWUgMC4wMDAwMDAgKi8KLSNkZWZpbmUgSFBGX0ZzMjIwNTBfR2FpbjEwX0IxICAgICAgICAgICAgICAgICAgICAgICAgICAgMTIxMjUgICAgICAgICAvKiBGbG9hdGluZyBwb2ludCB2YWx1ZSAwLjM3MDAzMyAqLwotI2RlZmluZSBIUEZfRnMyMjA1MF9HYWluMTBfQjIgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMCAgICAgICAgIC8qIEZsb2F0aW5nIHBvaW50IHZhbHVlIDAuMDAwMDAwICovCi0jZGVmaW5lIEhQRl9GczIyMDUwX0dhaW4xMF9TaGlmdCAgICAgICAgICAgICAgICAgICAgICAgICAgICAyICAgICAgICAgLyogU2hpZnQgdmFsdWUgKi8KLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLyogR2FpbiA9ICAxMS4wMDAwMDAgZEIgKi8KLSNkZWZpbmUgSFBGX0ZzMjIwNTBfR2FpbjExX0EwICAgICAgICAgICAgICAgICAgICAgICAgICAgLTM1MjAgICAgICAgICAvKiBGbG9hdGluZyBwb2ludCB2YWx1ZSAtMC4xMDc0MTcgKi8KLSNkZWZpbmUgSFBGX0ZzMjIwNTBfR2FpbjExX0ExICAgICAgICAgICAgICAgICAgICAgICAgICAgMTQ2NjcgICAgICAgICAvKiBGbG9hdGluZyBwb2ludCB2YWx1ZSAwLjQ0NzYxNSAqLwotI2RlZmluZSBIUEZfRnMyMjA1MF9HYWluMTFfQTIgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMCAgICAgICAgIC8qIEZsb2F0aW5nIHBvaW50IHZhbHVlIDAuMDAwMDAwICovCi0jZGVmaW5lIEhQRl9GczIyMDUwX0dhaW4xMV9CMSAgICAgICAgICAgICAgICAgICAgICAgICAgIDEyMTI1ICAgICAgICAgLyogRmxvYXRpbmcgcG9pbnQgdmFsdWUgMC4zNzAwMzMgKi8KLSNkZWZpbmUgSFBGX0ZzMjIwNTBfR2FpbjExX0IyICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDAgICAgICAgICAvKiBGbG9hdGluZyBwb2ludCB2YWx1ZSAwLjAwMDAwMCAqLwotI2RlZmluZSBIUEZfRnMyMjA1MF9HYWluMTFfU2hpZnQgICAgICAgICAgICAgICAgICAgICAgICAgICAgMiAgICAgICAgIC8qIFNoaWZ0IHZhbHVlICovCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8qIEdhaW4gPSAgMTIuMDAwMDAwIGRCICovCi0jZGVmaW5lIEhQRl9GczIyMDUwX0dhaW4xMl9BMCAgICAgICAgICAgICAgICAgICAgICAgICAgIC00NjI5ICAgICAgICAgLyogRmxvYXRpbmcgcG9pbnQgdmFsdWUgLTAuMTQxMjc5ICovCi0jZGVmaW5lIEhQRl9GczIyMDUwX0dhaW4xMl9BMSAgICAgICAgICAgICAgICAgICAgICAgICAgIDE1Nzc3ICAgICAgICAgLyogRmxvYXRpbmcgcG9pbnQgdmFsdWUgMC40ODE0NzcgKi8KLSNkZWZpbmUgSFBGX0ZzMjIwNTBfR2FpbjEyX0EyICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDAgICAgICAgICAvKiBGbG9hdGluZyBwb2ludCB2YWx1ZSAwLjAwMDAwMCAqLwotI2RlZmluZSBIUEZfRnMyMjA1MF9HYWluMTJfQjEgICAgICAgICAgICAgICAgICAgICAgICAgICAxMjEyNSAgICAgICAgIC8qIEZsb2F0aW5nIHBvaW50IHZhbHVlIDAuMzcwMDMzICovCi0jZGVmaW5lIEhQRl9GczIyMDUwX0dhaW4xMl9CMiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAwICAgICAgICAgLyogRmxvYXRpbmcgcG9pbnQgdmFsdWUgMC4wMDAwMDAgKi8KLSNkZWZpbmUgSFBGX0ZzMjIwNTBfR2FpbjEyX1NoaWZ0ICAgICAgICAgICAgICAgICAgICAgICAgICAgIDIgICAgICAgICAvKiBTaGlmdCB2YWx1ZSAqLwotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvKiBHYWluID0gIDEzLjAwMDAwMCBkQiAqLwotI2RlZmluZSBIUEZfRnMyMjA1MF9HYWluMTNfQTAgICAgICAgICAgICAgICAgICAgICAgICAgICAtMjk0NCAgICAgICAgIC8qIEZsb2F0aW5nIHBvaW50IHZhbHVlIC0wLjA4OTg0OSAqLwotI2RlZmluZSBIUEZfRnMyMjA1MF9HYWluMTNfQTEgICAgICAgICAgICAgICAgICAgICAgICAgICAgODUzMSAgICAgICAgIC8qIEZsb2F0aW5nIHBvaW50IHZhbHVlIDAuMjYwMzUyICovCi0jZGVmaW5lIEhQRl9GczIyMDUwX0dhaW4xM19BMiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAwICAgICAgICAgLyogRmxvYXRpbmcgcG9pbnQgdmFsdWUgMC4wMDAwMDAgKi8KLSNkZWZpbmUgSFBGX0ZzMjIwNTBfR2FpbjEzX0IxICAgICAgICAgICAgICAgICAgICAgICAgICAgMTIxMjUgICAgICAgICAvKiBGbG9hdGluZyBwb2ludCB2YWx1ZSAwLjM3MDAzMyAqLwotI2RlZmluZSBIUEZfRnMyMjA1MF9HYWluMTNfQjIgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMCAgICAgICAgIC8qIEZsb2F0aW5nIHBvaW50IHZhbHVlIDAuMDAwMDAwICovCi0jZGVmaW5lIEhQRl9GczIyMDUwX0dhaW4xM19TaGlmdCAgICAgICAgICAgICAgICAgICAgICAgICAgICAzICAgICAgICAgLyogU2hpZnQgdmFsdWUgKi8KLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLyogR2FpbiA9ICAxNC4wMDAwMDAgZEIgKi8KLSNkZWZpbmUgSFBGX0ZzMjIwNTBfR2FpbjE0X0EwICAgICAgICAgICAgICAgICAgICAgICAgICAgLTM2NDQgICAgICAgICAvKiBGbG9hdGluZyBwb2ludCB2YWx1ZSAtMC4xMTEyMTUgKi8KLSNkZWZpbmUgSFBGX0ZzMjIwNTBfR2FpbjE0X0ExICAgICAgICAgICAgICAgICAgICAgICAgICAgIDkyMzEgICAgICAgICAvKiBGbG9hdGluZyBwb2ludCB2YWx1ZSAwLjI4MTcxOCAqLwotI2RlZmluZSBIUEZfRnMyMjA1MF9HYWluMTRfQTIgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMCAgICAgICAgIC8qIEZsb2F0aW5nIHBvaW50IHZhbHVlIDAuMDAwMDAwICovCi0jZGVmaW5lIEhQRl9GczIyMDUwX0dhaW4xNF9CMSAgICAgICAgICAgICAgICAgICAgICAgICAgIDEyMTI1ICAgICAgICAgLyogRmxvYXRpbmcgcG9pbnQgdmFsdWUgMC4zNzAwMzMgKi8KLSNkZWZpbmUgSFBGX0ZzMjIwNTBfR2FpbjE0X0IyICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDAgICAgICAgICAvKiBGbG9hdGluZyBwb2ludCB2YWx1ZSAwLjAwMDAwMCAqLwotI2RlZmluZSBIUEZfRnMyMjA1MF9HYWluMTRfU2hpZnQgICAgICAgICAgICAgICAgICAgICAgICAgICAgMyAgICAgICAgIC8qIFNoaWZ0IHZhbHVlICovCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8qIEdhaW4gPSAgMTUuMDAwMDAwIGRCICovCi0jZGVmaW5lIEhQRl9GczIyMDUwX0dhaW4xNV9BMCAgICAgICAgICAgICAgICAgICAgICAgICAgIC00NDMwICAgICAgICAgLyogRmxvYXRpbmcgcG9pbnQgdmFsdWUgLTAuMTM1MTg3ICovCi0jZGVmaW5lIEhQRl9GczIyMDUwX0dhaW4xNV9BMSAgICAgICAgICAgICAgICAgICAgICAgICAgIDEwMDE3ICAgICAgICAgLyogRmxvYXRpbmcgcG9pbnQgdmFsdWUgMC4zMDU2OTAgKi8KLSNkZWZpbmUgSFBGX0ZzMjIwNTBfR2FpbjE1X0EyICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDAgICAgICAgICAvKiBGbG9hdGluZyBwb2ludCB2YWx1ZSAwLjAwMDAwMCAqLwotI2RlZmluZSBIUEZfRnMyMjA1MF9HYWluMTVfQjEgICAgICAgICAgICAgICAgICAgICAgICAgICAxMjEyNSAgICAgICAgIC8qIEZsb2F0aW5nIHBvaW50IHZhbHVlIDAuMzcwMDMzICovCi0jZGVmaW5lIEhQRl9GczIyMDUwX0dhaW4xNV9CMiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAwICAgICAgICAgLyogRmxvYXRpbmcgcG9pbnQgdmFsdWUgMC4wMDAwMDAgKi8KLSNkZWZpbmUgSFBGX0ZzMjIwNTBfR2FpbjE1X1NoaWZ0ICAgICAgICAgICAgICAgICAgICAgICAgICAgIDMgICAgICAgICAvKiBTaGlmdCB2YWx1ZSAqLwotCi0KLS8qIENvZWZmaWNpZW50cyBmb3Igc2FtcGxlIHJhdGUgMjQwMDBIeiAqLwotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvKiBHYWluID0gIDEuMDAwMDAwIGRCICovCi0jZGVmaW5lIEhQRl9GczI0MDAwX0dhaW4xX0EwICAgICAgICAgICAgICAgICAgICAgICAgICAgICAzNjI1ICAgICAgICAgLyogRmxvYXRpbmcgcG9pbnQgdmFsdWUgMC4xMTA2MjggKi8KLSNkZWZpbmUgSFBGX0ZzMjQwMDBfR2FpbjFfQTEgICAgICAgICAgICAgICAgICAgICAgICAgICAgMTY5NjAgICAgICAgICAvKiBGbG9hdGluZyBwb2ludCB2YWx1ZSAwLjUxNzU3OCAqLwotI2RlZmluZSBIUEZfRnMyNDAwMF9HYWluMV9BMiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMCAgICAgICAgIC8qIEZsb2F0aW5nIHBvaW50IHZhbHVlIDAuMDAwMDAwICovCi0jZGVmaW5lIEhQRl9GczI0MDAwX0dhaW4xX0IxICAgICAgICAgICAgICAgICAgICAgICAgICAgICA4NzgwICAgICAgICAgLyogRmxvYXRpbmcgcG9pbnQgdmFsdWUgMC4yNjc5NDkgKi8KLSNkZWZpbmUgSFBGX0ZzMjQwMDBfR2FpbjFfQjIgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDAgICAgICAgICAvKiBGbG9hdGluZyBwb2ludCB2YWx1ZSAwLjAwMDAwMCAqLwotI2RlZmluZSBIUEZfRnMyNDAwMF9HYWluMV9TaGlmdCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMSAgICAgICAgIC8qIFNoaWZ0IHZhbHVlICovCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8qIEdhaW4gPSAgMi4wMDAwMDAgZEIgKi8KLSNkZWZpbmUgSFBGX0ZzMjQwMDBfR2FpbjJfQTAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDI4MTEgICAgICAgICAvKiBGbG9hdGluZyBwb2ludCB2YWx1ZSAwLjA4NTgwMCAqLwotI2RlZmluZSBIUEZfRnMyNDAwMF9HYWluMl9BMSAgICAgICAgICAgICAgICAgICAgICAgICAgICAxNzc3NCAgICAgICAgIC8qIEZsb2F0aW5nIHBvaW50IHZhbHVlIDAuNTQyNDA2ICovCi0jZGVmaW5lIEhQRl9GczI0MDAwX0dhaW4yX0EyICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAwICAgICAgICAgLyogRmxvYXRpbmcgcG9pbnQgdmFsdWUgMC4wMDAwMDAgKi8KLSNkZWZpbmUgSFBGX0ZzMjQwMDBfR2FpbjJfQjEgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDg3ODAgICAgICAgICAvKiBGbG9hdGluZyBwb2ludCB2YWx1ZSAwLjI2Nzk0OSAqLwotI2RlZmluZSBIUEZfRnMyNDAwMF9HYWluMl9CMiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMCAgICAgICAgIC8qIEZsb2F0aW5nIHBvaW50IHZhbHVlIDAuMDAwMDAwICovCi0jZGVmaW5lIEhQRl9GczI0MDAwX0dhaW4yX1NoaWZ0ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAxICAgICAgICAgLyogU2hpZnQgdmFsdWUgKi8KLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLyogR2FpbiA9ICAzLjAwMDAwMCBkQiAqLwotI2RlZmluZSBIUEZfRnMyNDAwMF9HYWluM19BMCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMTg5OSAgICAgICAgIC8qIEZsb2F0aW5nIHBvaW50IHZhbHVlIDAuMDU3OTQzICovCi0jZGVmaW5lIEhQRl9GczI0MDAwX0dhaW4zX0ExICAgICAgICAgICAgICAgICAgICAgICAgICAgIDE4Njg2ICAgICAgICAgLyogRmxvYXRpbmcgcG9pbnQgdmFsdWUgMC41NzAyNjMgKi8KLSNkZWZpbmUgSFBGX0ZzMjQwMDBfR2FpbjNfQTIgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDAgICAgICAgICAvKiBGbG9hdGluZyBwb2ludCB2YWx1ZSAwLjAwMDAwMCAqLwotI2RlZmluZSBIUEZfRnMyNDAwMF9HYWluM19CMSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgODc4MCAgICAgICAgIC8qIEZsb2F0aW5nIHBvaW50IHZhbHVlIDAuMjY3OTQ5ICovCi0jZGVmaW5lIEhQRl9GczI0MDAwX0dhaW4zX0IyICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAwICAgICAgICAgLyogRmxvYXRpbmcgcG9pbnQgdmFsdWUgMC4wMDAwMDAgKi8KLSNkZWZpbmUgSFBGX0ZzMjQwMDBfR2FpbjNfU2hpZnQgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDEgICAgICAgICAvKiBTaGlmdCB2YWx1ZSAqLwotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvKiBHYWluID0gIDQuMDAwMDAwIGRCICovCi0jZGVmaW5lIEhQRl9GczI0MDAwX0dhaW40X0EwICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgODc0ICAgICAgICAgLyogRmxvYXRpbmcgcG9pbnQgdmFsdWUgMC4wMjY2ODcgKi8KLSNkZWZpbmUgSFBGX0ZzMjQwMDBfR2FpbjRfQTEgICAgICAgICAgICAgICAgICAgICAgICAgICAgMTk3MTEgICAgICAgICAvKiBGbG9hdGluZyBwb2ludCB2YWx1ZSAwLjYwMTUxOSAqLwotI2RlZmluZSBIUEZfRnMyNDAwMF9HYWluNF9BMiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMCAgICAgICAgIC8qIEZsb2F0aW5nIHBvaW50IHZhbHVlIDAuMDAwMDAwICovCi0jZGVmaW5lIEhQRl9GczI0MDAwX0dhaW40X0IxICAgICAgICAgICAgICAgICAgICAgICAgICAgICA4NzgwICAgICAgICAgLyogRmxvYXRpbmcgcG9pbnQgdmFsdWUgMC4yNjc5NDkgKi8KLSNkZWZpbmUgSFBGX0ZzMjQwMDBfR2FpbjRfQjIgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDAgICAgICAgICAvKiBGbG9hdGluZyBwb2ludCB2YWx1ZSAwLjAwMDAwMCAqLwotI2RlZmluZSBIUEZfRnMyNDAwMF9HYWluNF9TaGlmdCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMSAgICAgICAgIC8qIFNoaWZ0IHZhbHVlICovCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8qIEdhaW4gPSAgNS4wMDAwMDAgZEIgKi8KLSNkZWZpbmUgSFBGX0ZzMjQwMDBfR2FpbjVfQTAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC0yNzUgICAgICAgICAvKiBGbG9hdGluZyBwb2ludCB2YWx1ZSAtMC4wMDgzODMgKi8KLSNkZWZpbmUgSFBGX0ZzMjQwMDBfR2FpbjVfQTEgICAgICAgICAgICAgICAgICAgICAgICAgICAgMjA4NjAgICAgICAgICAvKiBGbG9hdGluZyBwb2ludCB2YWx1ZSAwLjYzNjU4OSAqLwotI2RlZmluZSBIUEZfRnMyNDAwMF9HYWluNV9BMiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMCAgICAgICAgIC8qIEZsb2F0aW5nIHBvaW50IHZhbHVlIDAuMDAwMDAwICovCi0jZGVmaW5lIEhQRl9GczI0MDAwX0dhaW41X0IxICAgICAgICAgICAgICAgICAgICAgICAgICAgICA4NzgwICAgICAgICAgLyogRmxvYXRpbmcgcG9pbnQgdmFsdWUgMC4yNjc5NDkgKi8KLSNkZWZpbmUgSFBGX0ZzMjQwMDBfR2FpbjVfQjIgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDAgICAgICAgICAvKiBGbG9hdGluZyBwb2ludCB2YWx1ZSAwLjAwMDAwMCAqLwotI2RlZmluZSBIUEZfRnMyNDAwMF9HYWluNV9TaGlmdCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMSAgICAgICAgIC8qIFNoaWZ0IHZhbHVlICovCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8qIEdhaW4gPSAgNi4wMDAwMDAgZEIgKi8KLSNkZWZpbmUgSFBGX0ZzMjQwMDBfR2FpbjZfQTAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLTE1NjQgICAgICAgICAvKiBGbG9hdGluZyBwb2ludCB2YWx1ZSAtMC4wNDc3MzMgKi8KLSNkZWZpbmUgSFBGX0ZzMjQwMDBfR2FpbjZfQTEgICAgICAgICAgICAgICAgICAgICAgICAgICAgMjIxNDkgICAgICAgICAvKiBGbG9hdGluZyBwb2ludCB2YWx1ZSAwLjY3NTkzOCAqLwotI2RlZmluZSBIUEZfRnMyNDAwMF9HYWluNl9BMiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMCAgICAgICAgIC8qIEZsb2F0aW5nIHBvaW50IHZhbHVlIDAuMDAwMDAwICovCi0jZGVmaW5lIEhQRl9GczI0MDAwX0dhaW42X0IxICAgICAgICAgICAgICAgICAgICAgICAgICAgICA4NzgwICAgICAgICAgLyogRmxvYXRpbmcgcG9pbnQgdmFsdWUgMC4yNjc5NDkgKi8KLSNkZWZpbmUgSFBGX0ZzMjQwMDBfR2FpbjZfQjIgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDAgICAgICAgICAvKiBGbG9hdGluZyBwb2ludCB2YWx1ZSAwLjAwMDAwMCAqLwotI2RlZmluZSBIUEZfRnMyNDAwMF9HYWluNl9TaGlmdCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMSAgICAgICAgIC8qIFNoaWZ0IHZhbHVlICovCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8qIEdhaW4gPSAgNy4wMDAwMDAgZEIgKi8KLSNkZWZpbmUgSFBGX0ZzMjQwMDBfR2FpbjdfQTAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLTE1MDkgICAgICAgICAvKiBGbG9hdGluZyBwb2ludCB2YWx1ZSAtMC4wNDYwNTEgKi8KLSNkZWZpbmUgSFBGX0ZzMjQwMDBfR2FpbjdfQTEgICAgICAgICAgICAgICAgICAgICAgICAgICAgMTE4MjYgICAgICAgICAvKiBGbG9hdGluZyBwb2ludCB2YWx1ZSAwLjM2MDg5OSAqLwotI2RlZmluZSBIUEZfRnMyNDAwMF9HYWluN19BMiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMCAgICAgICAgIC8qIEZsb2F0aW5nIHBvaW50IHZhbHVlIDAuMDAwMDAwICovCi0jZGVmaW5lIEhQRl9GczI0MDAwX0dhaW43X0IxICAgICAgICAgICAgICAgICAgICAgICAgICAgICA4NzgwICAgICAgICAgLyogRmxvYXRpbmcgcG9pbnQgdmFsdWUgMC4yNjc5NDkgKi8KLSNkZWZpbmUgSFBGX0ZzMjQwMDBfR2FpbjdfQjIgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDAgICAgICAgICAvKiBGbG9hdGluZyBwb2ludCB2YWx1ZSAwLjAwMDAwMCAqLwotI2RlZmluZSBIUEZfRnMyNDAwMF9HYWluN19TaGlmdCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMiAgICAgICAgIC8qIFNoaWZ0IHZhbHVlICovCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8qIEdhaW4gPSAgOC4wMDAwMDAgZEIgKi8KLSNkZWZpbmUgSFBGX0ZzMjQwMDBfR2FpbjhfQTAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLTIzMjMgICAgICAgICAvKiBGbG9hdGluZyBwb2ludCB2YWx1ZSAtMC4wNzA4NzggKi8KLSNkZWZpbmUgSFBGX0ZzMjQwMDBfR2FpbjhfQTEgICAgICAgICAgICAgICAgICAgICAgICAgICAgMTI2NDAgICAgICAgICAvKiBGbG9hdGluZyBwb2ludCB2YWx1ZSAwLjM4NTcyNyAqLwotI2RlZmluZSBIUEZfRnMyNDAwMF9HYWluOF9BMiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMCAgICAgICAgIC8qIEZsb2F0aW5nIHBvaW50IHZhbHVlIDAuMDAwMDAwICovCi0jZGVmaW5lIEhQRl9GczI0MDAwX0dhaW44X0IxICAgICAgICAgICAgICAgICAgICAgICAgICAgICA4NzgwICAgICAgICAgLyogRmxvYXRpbmcgcG9pbnQgdmFsdWUgMC4yNjc5NDkgKi8KLSNkZWZpbmUgSFBGX0ZzMjQwMDBfR2FpbjhfQjIgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDAgICAgICAgICAvKiBGbG9hdGluZyBwb2ludCB2YWx1ZSAwLjAwMDAwMCAqLwotI2RlZmluZSBIUEZfRnMyNDAwMF9HYWluOF9TaGlmdCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMiAgICAgICAgIC8qIFNoaWZ0IHZhbHVlICovCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8qIEdhaW4gPSAgOS4wMDAwMDAgZEIgKi8KLSNkZWZpbmUgSFBGX0ZzMjQwMDBfR2FpbjlfQTAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLTMyMzUgICAgICAgICAvKiBGbG9hdGluZyBwb2ludCB2YWx1ZSAtMC4wOTg3MzYgKi8KLSNkZWZpbmUgSFBGX0ZzMjQwMDBfR2FpbjlfQTEgICAgICAgICAgICAgICAgICAgICAgICAgICAgMTM1NTIgICAgICAgICAvKiBGbG9hdGluZyBwb2ludCB2YWx1ZSAwLjQxMzU4NCAqLwotI2RlZmluZSBIUEZfRnMyNDAwMF9HYWluOV9BMiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMCAgICAgICAgIC8qIEZsb2F0aW5nIHBvaW50IHZhbHVlIDAuMDAwMDAwICovCi0jZGVmaW5lIEhQRl9GczI0MDAwX0dhaW45X0IxICAgICAgICAgICAgICAgICAgICAgICAgICAgICA4NzgwICAgICAgICAgLyogRmxvYXRpbmcgcG9pbnQgdmFsdWUgMC4yNjc5NDkgKi8KLSNkZWZpbmUgSFBGX0ZzMjQwMDBfR2FpbjlfQjIgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDAgICAgICAgICAvKiBGbG9hdGluZyBwb2ludCB2YWx1ZSAwLjAwMDAwMCAqLwotI2RlZmluZSBIUEZfRnMyNDAwMF9HYWluOV9TaGlmdCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMiAgICAgICAgIC8qIFNoaWZ0IHZhbHVlICovCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8qIEdhaW4gPSAgMTAuMDAwMDAwIGRCICovCi0jZGVmaW5lIEhQRl9GczI0MDAwX0dhaW4xMF9BMCAgICAgICAgICAgICAgICAgICAgICAgICAgIC00MjYwICAgICAgICAgLyogRmxvYXRpbmcgcG9pbnQgdmFsdWUgLTAuMTI5OTkyICovCi0jZGVmaW5lIEhQRl9GczI0MDAwX0dhaW4xMF9BMSAgICAgICAgICAgICAgICAgICAgICAgICAgIDE0NTc3ICAgICAgICAgLyogRmxvYXRpbmcgcG9pbnQgdmFsdWUgMC40NDQ4NDEgKi8KLSNkZWZpbmUgSFBGX0ZzMjQwMDBfR2FpbjEwX0EyICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDAgICAgICAgICAvKiBGbG9hdGluZyBwb2ludCB2YWx1ZSAwLjAwMDAwMCAqLwotI2RlZmluZSBIUEZfRnMyNDAwMF9HYWluMTBfQjEgICAgICAgICAgICAgICAgICAgICAgICAgICAgODc4MCAgICAgICAgIC8qIEZsb2F0aW5nIHBvaW50IHZhbHVlIDAuMjY3OTQ5ICovCi0jZGVmaW5lIEhQRl9GczI0MDAwX0dhaW4xMF9CMiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAwICAgICAgICAgLyogRmxvYXRpbmcgcG9pbnQgdmFsdWUgMC4wMDAwMDAgKi8KLSNkZWZpbmUgSFBGX0ZzMjQwMDBfR2FpbjEwX1NoaWZ0ICAgICAgICAgICAgICAgICAgICAgICAgICAgIDIgICAgICAgICAvKiBTaGlmdCB2YWx1ZSAqLwotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvKiBHYWluID0gIDExLjAwMDAwMCBkQiAqLwotI2RlZmluZSBIUEZfRnMyNDAwMF9HYWluMTFfQTAgICAgICAgICAgICAgICAgICAgICAgICAgICAtNTQwOSAgICAgICAgIC8qIEZsb2F0aW5nIHBvaW50IHZhbHVlIC0wLjE2NTA2MiAqLwotI2RlZmluZSBIUEZfRnMyNDAwMF9HYWluMTFfQTEgICAgICAgICAgICAgICAgICAgICAgICAgICAxNTcyNiAgICAgICAgIC8qIEZsb2F0aW5nIHBvaW50IHZhbHVlIDAuNDc5OTExICovCi0jZGVmaW5lIEhQRl9GczI0MDAwX0dhaW4xMV9BMiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAwICAgICAgICAgLyogRmxvYXRpbmcgcG9pbnQgdmFsdWUgMC4wMDAwMDAgKi8KLSNkZWZpbmUgSFBGX0ZzMjQwMDBfR2FpbjExX0IxICAgICAgICAgICAgICAgICAgICAgICAgICAgIDg3ODAgICAgICAgICAvKiBGbG9hdGluZyBwb2ludCB2YWx1ZSAwLjI2Nzk0OSAqLwotI2RlZmluZSBIUEZfRnMyNDAwMF9HYWluMTFfQjIgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMCAgICAgICAgIC8qIEZsb2F0aW5nIHBvaW50IHZhbHVlIDAuMDAwMDAwICovCi0jZGVmaW5lIEhQRl9GczI0MDAwX0dhaW4xMV9TaGlmdCAgICAgICAgICAgICAgICAgICAgICAgICAgICAyICAgICAgICAgLyogU2hpZnQgdmFsdWUgKi8KLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLyogR2FpbiA9ICAxMi4wMDAwMDAgZEIgKi8KLSNkZWZpbmUgSFBGX0ZzMjQwMDBfR2FpbjEyX0EwICAgICAgICAgICAgICAgICAgICAgICAgICAgLTY2OTggICAgICAgICAvKiBGbG9hdGluZyBwb2ludCB2YWx1ZSAtMC4yMDQ0MTEgKi8KLSNkZWZpbmUgSFBGX0ZzMjQwMDBfR2FpbjEyX0ExICAgICAgICAgICAgICAgICAgICAgICAgICAgMTcwMTUgICAgICAgICAvKiBGbG9hdGluZyBwb2ludCB2YWx1ZSAwLjUxOTI2MCAqLwotI2RlZmluZSBIUEZfRnMyNDAwMF9HYWluMTJfQTIgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMCAgICAgICAgIC8qIEZsb2F0aW5nIHBvaW50IHZhbHVlIDAuMDAwMDAwICovCi0jZGVmaW5lIEhQRl9GczI0MDAwX0dhaW4xMl9CMSAgICAgICAgICAgICAgICAgICAgICAgICAgICA4NzgwICAgICAgICAgLyogRmxvYXRpbmcgcG9pbnQgdmFsdWUgMC4yNjc5NDkgKi8KLSNkZWZpbmUgSFBGX0ZzMjQwMDBfR2FpbjEyX0IyICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDAgICAgICAgICAvKiBGbG9hdGluZyBwb2ludCB2YWx1ZSAwLjAwMDAwMCAqLwotI2RlZmluZSBIUEZfRnMyNDAwMF9HYWluMTJfU2hpZnQgICAgICAgICAgICAgICAgICAgICAgICAgICAgMiAgICAgICAgIC8qIFNoaWZ0IHZhbHVlICovCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8qIEdhaW4gPSAgMTMuMDAwMDAwIGRCICovCi0jZGVmaW5lIEhQRl9GczI0MDAwX0dhaW4xM19BMCAgICAgICAgICAgICAgICAgICAgICAgICAgIC00MDgyICAgICAgICAgLyogRmxvYXRpbmcgcG9pbnQgdmFsdWUgLTAuMTI0NTc2ICovCi0jZGVmaW5lIEhQRl9GczI0MDAwX0dhaW4xM19BMSAgICAgICAgICAgICAgICAgICAgICAgICAgICA5MjUzICAgICAgICAgLyogRmxvYXRpbmcgcG9pbnQgdmFsdWUgMC4yODIzNzQgKi8KLSNkZWZpbmUgSFBGX0ZzMjQwMDBfR2FpbjEzX0EyICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDAgICAgICAgICAvKiBGbG9hdGluZyBwb2ludCB2YWx1ZSAwLjAwMDAwMCAqLwotI2RlZmluZSBIUEZfRnMyNDAwMF9HYWluMTNfQjEgICAgICAgICAgICAgICAgICAgICAgICAgICAgODc4MCAgICAgICAgIC8qIEZsb2F0aW5nIHBvaW50IHZhbHVlIDAuMjY3OTQ5ICovCi0jZGVmaW5lIEhQRl9GczI0MDAwX0dhaW4xM19CMiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAwICAgICAgICAgLyogRmxvYXRpbmcgcG9pbnQgdmFsdWUgMC4wMDAwMDAgKi8KLSNkZWZpbmUgSFBGX0ZzMjQwMDBfR2FpbjEzX1NoaWZ0ICAgICAgICAgICAgICAgICAgICAgICAgICAgIDMgICAgICAgICAvKiBTaGlmdCB2YWx1ZSAqLwotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvKiBHYWluID0gIDE0LjAwMDAwMCBkQiAqLwotI2RlZmluZSBIUEZfRnMyNDAwMF9HYWluMTRfQTAgICAgICAgICAgICAgICAgICAgICAgICAgICAtNDg5NiAgICAgICAgIC8qIEZsb2F0aW5nIHBvaW50IHZhbHVlIC0wLjE0OTQwNCAqLwotI2RlZmluZSBIUEZfRnMyNDAwMF9HYWluMTRfQTEgICAgICAgICAgICAgICAgICAgICAgICAgICAxMDA2NiAgICAgICAgIC8qIEZsb2F0aW5nIHBvaW50IHZhbHVlIDAuMzA3MjAyICovCi0jZGVmaW5lIEhQRl9GczI0MDAwX0dhaW4xNF9BMiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAwICAgICAgICAgLyogRmxvYXRpbmcgcG9pbnQgdmFsdWUgMC4wMDAwMDAgKi8KLSNkZWZpbmUgSFBGX0ZzMjQwMDBfR2FpbjE0X0IxICAgICAgICAgICAgICAgICAgICAgICAgICAgIDg3ODAgICAgICAgICAvKiBGbG9hdGluZyBwb2ludCB2YWx1ZSAwLjI2Nzk0OSAqLwotI2RlZmluZSBIUEZfRnMyNDAwMF9HYWluMTRfQjIgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMCAgICAgICAgIC8qIEZsb2F0aW5nIHBvaW50IHZhbHVlIDAuMDAwMDAwICovCi0jZGVmaW5lIEhQRl9GczI0MDAwX0dhaW4xNF9TaGlmdCAgICAgICAgICAgICAgICAgICAgICAgICAgICAzICAgICAgICAgLyogU2hpZnQgdmFsdWUgKi8KLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLyogR2FpbiA9ICAxNS4wMDAwMDAgZEIgKi8KLSNkZWZpbmUgSFBGX0ZzMjQwMDBfR2FpbjE1X0EwICAgICAgICAgICAgICAgICAgICAgICAgICAgLTU4MDggICAgICAgICAvKiBGbG9hdGluZyBwb2ludCB2YWx1ZSAtMC4xNzcyNjEgKi8KLSNkZWZpbmUgSFBGX0ZzMjQwMDBfR2FpbjE1X0ExICAgICAgICAgICAgICAgICAgICAgICAgICAgMTA5NzkgICAgICAgICAvKiBGbG9hdGluZyBwb2ludCB2YWx1ZSAwLjMzNTA1OSAqLwotI2RlZmluZSBIUEZfRnMyNDAwMF9HYWluMTVfQTIgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMCAgICAgICAgIC8qIEZsb2F0aW5nIHBvaW50IHZhbHVlIDAuMDAwMDAwICovCi0jZGVmaW5lIEhQRl9GczI0MDAwX0dhaW4xNV9CMSAgICAgICAgICAgICAgICAgICAgICAgICAgICA4NzgwICAgICAgICAgLyogRmxvYXRpbmcgcG9pbnQgdmFsdWUgMC4yNjc5NDkgKi8KLSNkZWZpbmUgSFBGX0ZzMjQwMDBfR2FpbjE1X0IyICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDAgICAgICAgICAvKiBGbG9hdGluZyBwb2ludCB2YWx1ZSAwLjAwMDAwMCAqLwotI2RlZmluZSBIUEZfRnMyNDAwMF9HYWluMTVfU2hpZnQgICAgICAgICAgICAgICAgICAgICAgICAgICAgMyAgICAgICAgIC8qIFNoaWZ0IHZhbHVlICovCi0KLQotLyogQ29lZmZpY2llbnRzIGZvciBzYW1wbGUgcmF0ZSAzMjAwMEh6ICovCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8qIEdhaW4gPSAgMS4wMDAwMDAgZEIgKi8KLSNkZWZpbmUgSFBGX0ZzMzIwMDBfR2FpbjFfQTAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMTcyMjUgICAgICAgICAvKiBGbG9hdGluZyBwb2ludCB2YWx1ZSAwLjUyNTY3NyAqLwotI2RlZmluZSBIUEZfRnMzMjAwMF9HYWluMV9BMSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLTk5MCAgICAgICAgIC8qIEZsb2F0aW5nIHBvaW50IHZhbHVlIC0wLjAzMDIyNyAqLwotI2RlZmluZSBIUEZfRnMzMjAwMF9HYWluMV9BMiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMCAgICAgICAgIC8qIEZsb2F0aW5nIHBvaW50IHZhbHVlIDAuMDAwMDAwICovCi0jZGVmaW5lIEhQRl9GczMyMDAwX0dhaW4xX0IxICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAwICAgICAgICAgLyogRmxvYXRpbmcgcG9pbnQgdmFsdWUgLTAuMDAwMDAwICovCi0jZGVmaW5lIEhQRl9GczMyMDAwX0dhaW4xX0IyICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAwICAgICAgICAgLyogRmxvYXRpbmcgcG9pbnQgdmFsdWUgMC4wMDAwMDAgKi8KLSNkZWZpbmUgSFBGX0ZzMzIwMDBfR2FpbjFfU2hpZnQgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDEgICAgICAgICAvKiBTaGlmdCB2YWx1ZSAqLwotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvKiBHYWluID0gIDIuMDAwMDAwIGRCICovCi0jZGVmaW5lIEhQRl9GczMyMDAwX0dhaW4yX0EwICAgICAgICAgICAgICAgICAgICAgICAgICAgIDE4MzM3ICAgICAgICAgLyogRmxvYXRpbmcgcG9pbnQgdmFsdWUgMC41NTk1OTMgKi8KLSNkZWZpbmUgSFBGX0ZzMzIwMDBfR2FpbjJfQTEgICAgICAgICAgICAgICAgICAgICAgICAgICAgLTIxMDIgICAgICAgICAvKiBGbG9hdGluZyBwb2ludCB2YWx1ZSAtMC4wNjQxNDIgKi8KLSNkZWZpbmUgSFBGX0ZzMzIwMDBfR2FpbjJfQTIgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDAgICAgICAgICAvKiBGbG9hdGluZyBwb2ludCB2YWx1ZSAwLjAwMDAwMCAqLwotI2RlZmluZSBIUEZfRnMzMjAwMF9HYWluMl9CMSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMCAgICAgICAgIC8qIEZsb2F0aW5nIHBvaW50IHZhbHVlIC0wLjAwMDAwMCAqLwotI2RlZmluZSBIUEZfRnMzMjAwMF9HYWluMl9CMiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMCAgICAgICAgIC8qIEZsb2F0aW5nIHBvaW50IHZhbHVlIDAuMDAwMDAwICovCi0jZGVmaW5lIEhQRl9GczMyMDAwX0dhaW4yX1NoaWZ0ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAxICAgICAgICAgLyogU2hpZnQgdmFsdWUgKi8KLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLyogR2FpbiA9ICAzLjAwMDAwMCBkQiAqLwotI2RlZmluZSBIUEZfRnMzMjAwMF9HYWluM19BMCAgICAgICAgICAgICAgICAgICAgICAgICAgICAxOTU4NCAgICAgICAgIC8qIEZsb2F0aW5nIHBvaW50IHZhbHVlIDAuNTk3NjQ2ICovCi0jZGVmaW5lIEhQRl9GczMyMDAwX0dhaW4zX0ExICAgICAgICAgICAgICAgICAgICAgICAgICAgIC0zMzQ5ICAgICAgICAgLyogRmxvYXRpbmcgcG9pbnQgdmFsdWUgLTAuMTAyMTk2ICovCi0jZGVmaW5lIEhQRl9GczMyMDAwX0dhaW4zX0EyICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAwICAgICAgICAgLyogRmxvYXRpbmcgcG9pbnQgdmFsdWUgMC4wMDAwMDAgKi8KLSNkZWZpbmUgSFBGX0ZzMzIwMDBfR2FpbjNfQjEgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDAgICAgICAgICAvKiBGbG9hdGluZyBwb2ludCB2YWx1ZSAtMC4wMDAwMDAgKi8KLSNkZWZpbmUgSFBGX0ZzMzIwMDBfR2FpbjNfQjIgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDAgICAgICAgICAvKiBGbG9hdGluZyBwb2ludCB2YWx1ZSAwLjAwMDAwMCAqLwotI2RlZmluZSBIUEZfRnMzMjAwMF9HYWluM19TaGlmdCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMSAgICAgICAgIC8qIFNoaWZ0IHZhbHVlICovCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8qIEdhaW4gPSAgNC4wMDAwMDAgZEIgKi8KLSNkZWZpbmUgSFBGX0ZzMzIwMDBfR2FpbjRfQTAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMjA5ODMgICAgICAgICAvKiBGbG9hdGluZyBwb2ludCB2YWx1ZSAwLjY0MDM0MyAqLwotI2RlZmluZSBIUEZfRnMzMjAwMF9HYWluNF9BMSAgICAgICAgICAgICAgICAgICAgICAgICAgICAtNDc0OCAgICAgICAgIC8qIEZsb2F0aW5nIHBvaW50IHZhbHVlIC0wLjE0NDg5MyAqLwotI2RlZmluZSBIUEZfRnMzMjAwMF9HYWluNF9BMiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMCAgICAgICAgIC8qIEZsb2F0aW5nIHBvaW50IHZhbHVlIDAuMDAwMDAwICovCi0jZGVmaW5lIEhQRl9GczMyMDAwX0dhaW40X0IxICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAwICAgICAgICAgLyogRmxvYXRpbmcgcG9pbnQgdmFsdWUgLTAuMDAwMDAwICovCi0jZGVmaW5lIEhQRl9GczMyMDAwX0dhaW40X0IyICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAwICAgICAgICAgLyogRmxvYXRpbmcgcG9pbnQgdmFsdWUgMC4wMDAwMDAgKi8KLSNkZWZpbmUgSFBGX0ZzMzIwMDBfR2FpbjRfU2hpZnQgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDEgICAgICAgICAvKiBTaGlmdCB2YWx1ZSAqLwotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvKiBHYWluID0gIDUuMDAwMDAwIGRCICovCi0jZGVmaW5lIEhQRl9GczMyMDAwX0dhaW41X0EwICAgICAgICAgICAgICAgICAgICAgICAgICAgIDIyNTUzICAgICAgICAgLyogRmxvYXRpbmcgcG9pbnQgdmFsdWUgMC42ODgyNTAgKi8KLSNkZWZpbmUgSFBGX0ZzMzIwMDBfR2FpbjVfQTEgICAgICAgICAgICAgICAgICAgICAgICAgICAgLTYzMTggICAgICAgICAvKiBGbG9hdGluZyBwb2ludCB2YWx1ZSAtMC4xOTI3OTkgKi8KLSNkZWZpbmUgSFBGX0ZzMzIwMDBfR2FpbjVfQTIgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDAgICAgICAgICAvKiBGbG9hdGluZyBwb2ludCB2YWx1ZSAwLjAwMDAwMCAqLwotI2RlZmluZSBIUEZfRnMzMjAwMF9HYWluNV9CMSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMCAgICAgICAgIC8qIEZsb2F0aW5nIHBvaW50IHZhbHVlIC0wLjAwMDAwMCAqLwotI2RlZmluZSBIUEZfRnMzMjAwMF9HYWluNV9CMiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMCAgICAgICAgIC8qIEZsb2F0aW5nIHBvaW50IHZhbHVlIDAuMDAwMDAwICovCi0jZGVmaW5lIEhQRl9GczMyMDAwX0dhaW41X1NoaWZ0ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAxICAgICAgICAgLyogU2hpZnQgdmFsdWUgKi8KLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLyogR2FpbiA9ICA2LjAwMDAwMCBkQiAqLwotI2RlZmluZSBIUEZfRnMzMjAwMF9HYWluNl9BMCAgICAgICAgICAgICAgICAgICAgICAgICAgICAyNDMxNCAgICAgICAgIC8qIEZsb2F0aW5nIHBvaW50IHZhbHVlIDAuNzQyMDAyICovCi0jZGVmaW5lIEhQRl9GczMyMDAwX0dhaW42X0ExICAgICAgICAgICAgICAgICAgICAgICAgICAgIC04MDc5ICAgICAgICAgLyogRmxvYXRpbmcgcG9pbnQgdmFsdWUgLTAuMjQ2NTUxICovCi0jZGVmaW5lIEhQRl9GczMyMDAwX0dhaW42X0EyICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAwICAgICAgICAgLyogRmxvYXRpbmcgcG9pbnQgdmFsdWUgMC4wMDAwMDAgKi8KLSNkZWZpbmUgSFBGX0ZzMzIwMDBfR2FpbjZfQjEgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDAgICAgICAgICAvKiBGbG9hdGluZyBwb2ludCB2YWx1ZSAtMC4wMDAwMDAgKi8KLSNkZWZpbmUgSFBGX0ZzMzIwMDBfR2FpbjZfQjIgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDAgICAgICAgICAvKiBGbG9hdGluZyBwb2ludCB2YWx1ZSAwLjAwMDAwMCAqLwotI2RlZmluZSBIUEZfRnMzMjAwMF9HYWluNl9TaGlmdCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMSAgICAgICAgIC8qIFNoaWZ0IHZhbHVlICovCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8qIEdhaW4gPSAgNy4wMDAwMDAgZEIgKi8KLSNkZWZpbmUgSFBGX0ZzMzIwMDBfR2FpbjdfQTAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMTMxNzYgICAgICAgICAvKiBGbG9hdGluZyBwb2ludCB2YWx1ZSAwLjQwMjEwOSAqLwotI2RlZmluZSBIUEZfRnMzMjAwMF9HYWluN19BMSAgICAgICAgICAgICAgICAgICAgICAgICAgICAtNTA0MCAgICAgICAgIC8qIEZsb2F0aW5nIHBvaW50IHZhbHVlIC0wLjE1Mzc5NSAqLwotI2RlZmluZSBIUEZfRnMzMjAwMF9HYWluN19BMiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMCAgICAgICAgIC8qIEZsb2F0aW5nIHBvaW50IHZhbHVlIDAuMDAwMDAwICovCi0jZGVmaW5lIEhQRl9GczMyMDAwX0dhaW43X0IxICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAwICAgICAgICAgLyogRmxvYXRpbmcgcG9pbnQgdmFsdWUgLTAuMDAwMDAwICovCi0jZGVmaW5lIEhQRl9GczMyMDAwX0dhaW43X0IyICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAwICAgICAgICAgLyogRmxvYXRpbmcgcG9pbnQgdmFsdWUgMC4wMDAwMDAgKi8KLSNkZWZpbmUgSFBGX0ZzMzIwMDBfR2FpbjdfU2hpZnQgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDIgICAgICAgICAvKiBTaGlmdCB2YWx1ZSAqLwotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvKiBHYWluID0gIDguMDAwMDAwIGRCICovCi0jZGVmaW5lIEhQRl9GczMyMDAwX0dhaW44X0EwICAgICAgICAgICAgICAgICAgICAgICAgICAgIDE0Mjg4ICAgICAgICAgLyogRmxvYXRpbmcgcG9pbnQgdmFsdWUgMC40MzYwMjQgKi8KLSNkZWZpbmUgSFBGX0ZzMzIwMDBfR2FpbjhfQTEgICAgICAgICAgICAgICAgICAgICAgICAgICAgLTYxNTEgICAgICAgICAvKiBGbG9hdGluZyBwb2ludCB2YWx1ZSAtMC4xODc3MTEgKi8KLSNkZWZpbmUgSFBGX0ZzMzIwMDBfR2FpbjhfQTIgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDAgICAgICAgICAvKiBGbG9hdGluZyBwb2ludCB2YWx1ZSAwLjAwMDAwMCAqLwotI2RlZmluZSBIUEZfRnMzMjAwMF9HYWluOF9CMSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMCAgICAgICAgIC8qIEZsb2F0aW5nIHBvaW50IHZhbHVlIC0wLjAwMDAwMCAqLwotI2RlZmluZSBIUEZfRnMzMjAwMF9HYWluOF9CMiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMCAgICAgICAgIC8qIEZsb2F0aW5nIHBvaW50IHZhbHVlIDAuMDAwMDAwICovCi0jZGVmaW5lIEhQRl9GczMyMDAwX0dhaW44X1NoaWZ0ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAyICAgICAgICAgLyogU2hpZnQgdmFsdWUgKi8KLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLyogR2FpbiA9ICA5LjAwMDAwMCBkQiAqLwotI2RlZmluZSBIUEZfRnMzMjAwMF9HYWluOV9BMCAgICAgICAgICAgICAgICAgICAgICAgICAgICAxNTUzNSAgICAgICAgIC8qIEZsb2F0aW5nIHBvaW50IHZhbHVlIDAuNDc0MDc4ICovCi0jZGVmaW5lIEhQRl9GczMyMDAwX0dhaW45X0ExICAgICAgICAgICAgICAgICAgICAgICAgICAgIC03Mzk4ICAgICAgICAgLyogRmxvYXRpbmcgcG9pbnQgdmFsdWUgLTAuMjI1NzY0ICovCi0jZGVmaW5lIEhQRl9GczMyMDAwX0dhaW45X0EyICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAwICAgICAgICAgLyogRmxvYXRpbmcgcG9pbnQgdmFsdWUgMC4wMDAwMDAgKi8KLSNkZWZpbmUgSFBGX0ZzMzIwMDBfR2FpbjlfQjEgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDAgICAgICAgICAvKiBGbG9hdGluZyBwb2ludCB2YWx1ZSAtMC4wMDAwMDAgKi8KLSNkZWZpbmUgSFBGX0ZzMzIwMDBfR2FpbjlfQjIgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDAgICAgICAgICAvKiBGbG9hdGluZyBwb2ludCB2YWx1ZSAwLjAwMDAwMCAqLwotI2RlZmluZSBIUEZfRnMzMjAwMF9HYWluOV9TaGlmdCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMiAgICAgICAgIC8qIFNoaWZ0IHZhbHVlICovCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8qIEdhaW4gPSAgMTAuMDAwMDAwIGRCICovCi0jZGVmaW5lIEhQRl9GczMyMDAwX0dhaW4xMF9BMCAgICAgICAgICAgICAgICAgICAgICAgICAgIDE2OTM0ICAgICAgICAgLyogRmxvYXRpbmcgcG9pbnQgdmFsdWUgMC41MTY3NzQgKi8KLSNkZWZpbmUgSFBGX0ZzMzIwMDBfR2FpbjEwX0ExICAgICAgICAgICAgICAgICAgICAgICAgICAgLTg3OTcgICAgICAgICAvKiBGbG9hdGluZyBwb2ludCB2YWx1ZSAtMC4yNjg0NjEgKi8KLSNkZWZpbmUgSFBGX0ZzMzIwMDBfR2FpbjEwX0EyICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDAgICAgICAgICAvKiBGbG9hdGluZyBwb2ludCB2YWx1ZSAwLjAwMDAwMCAqLwotI2RlZmluZSBIUEZfRnMzMjAwMF9HYWluMTBfQjEgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMCAgICAgICAgIC8qIEZsb2F0aW5nIHBvaW50IHZhbHVlIC0wLjAwMDAwMCAqLwotI2RlZmluZSBIUEZfRnMzMjAwMF9HYWluMTBfQjIgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMCAgICAgICAgIC8qIEZsb2F0aW5nIHBvaW50IHZhbHVlIDAuMDAwMDAwICovCi0jZGVmaW5lIEhQRl9GczMyMDAwX0dhaW4xMF9TaGlmdCAgICAgICAgICAgICAgICAgICAgICAgICAgICAyICAgICAgICAgLyogU2hpZnQgdmFsdWUgKi8KLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLyogR2FpbiA9ICAxMS4wMDAwMDAgZEIgKi8KLSNkZWZpbmUgSFBGX0ZzMzIwMDBfR2FpbjExX0EwICAgICAgICAgICAgICAgICAgICAgICAgICAgMTg1MDMgICAgICAgICAvKiBGbG9hdGluZyBwb2ludCB2YWx1ZSAwLjU2NDY4MSAqLwotI2RlZmluZSBIUEZfRnMzMjAwMF9HYWluMTFfQTEgICAgICAgICAgICAgICAgICAgICAgICAgIC0xMDM2NyAgICAgICAgIC8qIEZsb2F0aW5nIHBvaW50IHZhbHVlIC0wLjMxNjM2OCAqLwotI2RlZmluZSBIUEZfRnMzMjAwMF9HYWluMTFfQTIgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMCAgICAgICAgIC8qIEZsb2F0aW5nIHBvaW50IHZhbHVlIDAuMDAwMDAwICovCi0jZGVmaW5lIEhQRl9GczMyMDAwX0dhaW4xMV9CMSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAwICAgICAgICAgLyogRmxvYXRpbmcgcG9pbnQgdmFsdWUgLTAuMDAwMDAwICovCi0jZGVmaW5lIEhQRl9GczMyMDAwX0dhaW4xMV9CMiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAwICAgICAgICAgLyogRmxvYXRpbmcgcG9pbnQgdmFsdWUgMC4wMDAwMDAgKi8KLSNkZWZpbmUgSFBGX0ZzMzIwMDBfR2FpbjExX1NoaWZ0ICAgICAgICAgICAgICAgICAgICAgICAgICAgIDIgICAgICAgICAvKiBTaGlmdCB2YWx1ZSAqLwotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvKiBHYWluID0gIDEyLjAwMDAwMCBkQiAqLwotI2RlZmluZSBIUEZfRnMzMjAwMF9HYWluMTJfQTAgICAgICAgICAgICAgICAgICAgICAgICAgICAyMDI2NSAgICAgICAgIC8qIEZsb2F0aW5nIHBvaW50IHZhbHVlIDAuNjE4NDMzICovCi0jZGVmaW5lIEhQRl9GczMyMDAwX0dhaW4xMl9BMSAgICAgICAgICAgICAgICAgICAgICAgICAgLTEyMTI4ICAgICAgICAgLyogRmxvYXRpbmcgcG9pbnQgdmFsdWUgLTAuMzcwMTIwICovCi0jZGVmaW5lIEhQRl9GczMyMDAwX0dhaW4xMl9BMiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAwICAgICAgICAgLyogRmxvYXRpbmcgcG9pbnQgdmFsdWUgMC4wMDAwMDAgKi8KLSNkZWZpbmUgSFBGX0ZzMzIwMDBfR2FpbjEyX0IxICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDAgICAgICAgICAvKiBGbG9hdGluZyBwb2ludCB2YWx1ZSAtMC4wMDAwMDAgKi8KLSNkZWZpbmUgSFBGX0ZzMzIwMDBfR2FpbjEyX0IyICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDAgICAgICAgICAvKiBGbG9hdGluZyBwb2ludCB2YWx1ZSAwLjAwMDAwMCAqLwotI2RlZmluZSBIUEZfRnMzMjAwMF9HYWluMTJfU2hpZnQgICAgICAgICAgICAgICAgICAgICAgICAgICAgMiAgICAgICAgIC8qIFNoaWZ0IHZhbHVlICovCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8qIEdhaW4gPSAgMTMuMDAwMDAwIGRCICovCi0jZGVmaW5lIEhQRl9GczMyMDAwX0dhaW4xM19BMCAgICAgICAgICAgICAgICAgICAgICAgICAgIDExMTQ3ICAgICAgICAgLyogRmxvYXRpbmcgcG9pbnQgdmFsdWUgMC4zNDAxNzggKi8KLSNkZWZpbmUgSFBGX0ZzMzIwMDBfR2FpbjEzX0ExICAgICAgICAgICAgICAgICAgICAgICAgICAgLTcwNjkgICAgICAgICAvKiBGbG9hdGluZyBwb2ludCB2YWx1ZSAtMC4yMTU3MjYgKi8KLSNkZWZpbmUgSFBGX0ZzMzIwMDBfR2FpbjEzX0EyICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDAgICAgICAgICAvKiBGbG9hdGluZyBwb2ludCB2YWx1ZSAwLjAwMDAwMCAqLwotI2RlZmluZSBIUEZfRnMzMjAwMF9HYWluMTNfQjEgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMCAgICAgICAgIC8qIEZsb2F0aW5nIHBvaW50IHZhbHVlIC0wLjAwMDAwMCAqLwotI2RlZmluZSBIUEZfRnMzMjAwMF9HYWluMTNfQjIgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMCAgICAgICAgIC8qIEZsb2F0aW5nIHBvaW50IHZhbHVlIDAuMDAwMDAwICovCi0jZGVmaW5lIEhQRl9GczMyMDAwX0dhaW4xM19TaGlmdCAgICAgICAgICAgICAgICAgICAgICAgICAgICAzICAgICAgICAgLyogU2hpZnQgdmFsdWUgKi8KLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLyogR2FpbiA9ICAxNC4wMDAwMDAgZEIgKi8KLSNkZWZpbmUgSFBGX0ZzMzIwMDBfR2FpbjE0X0EwICAgICAgICAgICAgICAgICAgICAgICAgICAgMTIyNTggICAgICAgICAvKiBGbG9hdGluZyBwb2ludCB2YWx1ZSAwLjM3NDA5MyAqLwotI2RlZmluZSBIUEZfRnMzMjAwMF9HYWluMTRfQTEgICAgICAgICAgICAgICAgICAgICAgICAgICAtODE4MCAgICAgICAgIC8qIEZsb2F0aW5nIHBvaW50IHZhbHVlIC0wLjI0OTY0MiAqLwotI2RlZmluZSBIUEZfRnMzMjAwMF9HYWluMTRfQTIgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMCAgICAgICAgIC8qIEZsb2F0aW5nIHBvaW50IHZhbHVlIDAuMDAwMDAwICovCi0jZGVmaW5lIEhQRl9GczMyMDAwX0dhaW4xNF9CMSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAwICAgICAgICAgLyogRmxvYXRpbmcgcG9pbnQgdmFsdWUgLTAuMDAwMDAwICovCi0jZGVmaW5lIEhQRl9GczMyMDAwX0dhaW4xNF9CMiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAwICAgICAgICAgLyogRmxvYXRpbmcgcG9pbnQgdmFsdWUgMC4wMDAwMDAgKi8KLSNkZWZpbmUgSFBGX0ZzMzIwMDBfR2FpbjE0X1NoaWZ0ICAgICAgICAgICAgICAgICAgICAgICAgICAgIDMgICAgICAgICAvKiBTaGlmdCB2YWx1ZSAqLwotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvKiBHYWluID0gIDE1LjAwMDAwMCBkQiAqLwotI2RlZmluZSBIUEZfRnMzMjAwMF9HYWluMTVfQTAgICAgICAgICAgICAgICAgICAgICAgICAgICAxMzUwNSAgICAgICAgIC8qIEZsb2F0aW5nIHBvaW50IHZhbHVlIDAuNDEyMTQ3ICovCi0jZGVmaW5lIEhQRl9GczMyMDAwX0dhaW4xNV9BMSAgICAgICAgICAgICAgICAgICAgICAgICAgIC05NDI3ICAgICAgICAgLyogRmxvYXRpbmcgcG9pbnQgdmFsdWUgLTAuMjg3Njk1ICovCi0jZGVmaW5lIEhQRl9GczMyMDAwX0dhaW4xNV9BMiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAwICAgICAgICAgLyogRmxvYXRpbmcgcG9pbnQgdmFsdWUgMC4wMDAwMDAgKi8KLSNkZWZpbmUgSFBGX0ZzMzIwMDBfR2FpbjE1X0IxICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDAgICAgICAgICAvKiBGbG9hdGluZyBwb2ludCB2YWx1ZSAtMC4wMDAwMDAgKi8KLSNkZWZpbmUgSFBGX0ZzMzIwMDBfR2FpbjE1X0IyICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDAgICAgICAgICAvKiBGbG9hdGluZyBwb2ludCB2YWx1ZSAwLjAwMDAwMCAqLwotI2RlZmluZSBIUEZfRnMzMjAwMF9HYWluMTVfU2hpZnQgICAgICAgICAgICAgICAgICAgICAgICAgICAgMyAgICAgICAgIC8qIFNoaWZ0IHZhbHVlICovCi0KLQotLyogQ29lZmZpY2llbnRzIGZvciBzYW1wbGUgcmF0ZSA0NDEwMEh6ICovCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8qIEdhaW4gPSAgMS4wMDAwMDAgZEIgKi8KLSNkZWZpbmUgSFBGX0ZzNDQxMDBfR2FpbjFfQTAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMTc0NDIgICAgICAgICAvKiBGbG9hdGluZyBwb2ludCB2YWx1ZSAwLjUzMjI5NCAqLwotI2RlZmluZSBIUEZfRnM0NDEwMF9HYWluMV9BMSAgICAgICAgICAgICAgICAgICAgICAgICAgICAtNDc2MSAgICAgICAgIC8qIEZsb2F0aW5nIHBvaW50IHZhbHVlIC0wLjE0NTI5NCAqLwotI2RlZmluZSBIUEZfRnM0NDEwMF9HYWluMV9BMiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMCAgICAgICAgIC8qIEZsb2F0aW5nIHBvaW50IHZhbHVlIDAuMDAwMDAwICovCi0jZGVmaW5lIEhQRl9GczQ0MTAwX0dhaW4xX0IxICAgICAgICAgICAgICAgICAgICAgICAgICAgIC03MTczICAgICAgICAgLyogRmxvYXRpbmcgcG9pbnQgdmFsdWUgLTAuMjE4ODk0ICovCi0jZGVmaW5lIEhQRl9GczQ0MTAwX0dhaW4xX0IyICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAwICAgICAgICAgLyogRmxvYXRpbmcgcG9pbnQgdmFsdWUgMC4wMDAwMDAgKi8KLSNkZWZpbmUgSFBGX0ZzNDQxMDBfR2FpbjFfU2hpZnQgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDEgICAgICAgICAvKiBTaGlmdCB2YWx1ZSAqLwotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvKiBHYWluID0gIDIuMDAwMDAwIGRCICovCi0jZGVmaW5lIEhQRl9GczQ0MTAwX0dhaW4yX0EwICAgICAgICAgICAgICAgICAgICAgICAgICAgIDE4Nzk3ICAgICAgICAgLyogRmxvYXRpbmcgcG9pbnQgdmFsdWUgMC41NzM2MzMgKi8KLSNkZWZpbmUgSFBGX0ZzNDQxMDBfR2FpbjJfQTEgICAgICAgICAgICAgICAgICAgICAgICAgICAgLTYxMTYgICAgICAgICAvKiBGbG9hdGluZyBwb2ludCB2YWx1ZSAtMC4xODY2MzQgKi8KLSNkZWZpbmUgSFBGX0ZzNDQxMDBfR2FpbjJfQTIgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDAgICAgICAgICAvKiBGbG9hdGluZyBwb2ludCB2YWx1ZSAwLjAwMDAwMCAqLwotI2RlZmluZSBIUEZfRnM0NDEwMF9HYWluMl9CMSAgICAgICAgICAgICAgICAgICAgICAgICAgICAtNzE3MyAgICAgICAgIC8qIEZsb2F0aW5nIHBvaW50IHZhbHVlIC0wLjIxODg5NCAqLwotI2RlZmluZSBIUEZfRnM0NDEwMF9HYWluMl9CMiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMCAgICAgICAgIC8qIEZsb2F0aW5nIHBvaW50IHZhbHVlIDAuMDAwMDAwICovCi0jZGVmaW5lIEhQRl9GczQ0MTAwX0dhaW4yX1NoaWZ0ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAxICAgICAgICAgLyogU2hpZnQgdmFsdWUgKi8KLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLyogR2FpbiA9ICAzLjAwMDAwMCBkQiAqLwotI2RlZmluZSBIUEZfRnM0NDEwMF9HYWluM19BMCAgICAgICAgICAgICAgICAgICAgICAgICAgICAyMDMxNyAgICAgICAgIC8qIEZsb2F0aW5nIHBvaW50IHZhbHVlIDAuNjIwMDE2ICovCi0jZGVmaW5lIEhQRl9GczQ0MTAwX0dhaW4zX0ExICAgICAgICAgICAgICAgICAgICAgICAgICAgIC03NjM1ICAgICAgICAgLyogRmxvYXRpbmcgcG9pbnQgdmFsdWUgLTAuMjMzMDE3ICovCi0jZGVmaW5lIEhQRl9GczQ0MTAwX0dhaW4zX0EyICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAwICAgICAgICAgLyogRmxvYXRpbmcgcG9pbnQgdmFsdWUgMC4wMDAwMDAgKi8KLSNkZWZpbmUgSFBGX0ZzNDQxMDBfR2FpbjNfQjEgICAgICAgICAgICAgICAgICAgICAgICAgICAgLTcxNzMgICAgICAgICAvKiBGbG9hdGluZyBwb2ludCB2YWx1ZSAtMC4yMTg4OTQgKi8KLSNkZWZpbmUgSFBGX0ZzNDQxMDBfR2FpbjNfQjIgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDAgICAgICAgICAvKiBGbG9hdGluZyBwb2ludCB2YWx1ZSAwLjAwMDAwMCAqLwotI2RlZmluZSBIUEZfRnM0NDEwMF9HYWluM19TaGlmdCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMSAgICAgICAgIC8qIFNoaWZ0IHZhbHVlICovCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8qIEdhaW4gPSAgNC4wMDAwMDAgZEIgKi8KLSNkZWZpbmUgSFBGX0ZzNDQxMDBfR2FpbjRfQTAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMjIwMjIgICAgICAgICAvKiBGbG9hdGluZyBwb2ludCB2YWx1ZSAwLjY3MjA1OSAqLwotI2RlZmluZSBIUEZfRnM0NDEwMF9HYWluNF9BMSAgICAgICAgICAgICAgICAgICAgICAgICAgICAtOTM0MSAgICAgICAgIC8qIEZsb2F0aW5nIHBvaW50IHZhbHVlIC0wLjI4NTA2MCAqLwotI2RlZmluZSBIUEZfRnM0NDEwMF9HYWluNF9BMiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMCAgICAgICAgIC8qIEZsb2F0aW5nIHBvaW50IHZhbHVlIDAuMDAwMDAwICovCi0jZGVmaW5lIEhQRl9GczQ0MTAwX0dhaW40X0IxICAgICAgICAgICAgICAgICAgICAgICAgICAgIC03MTczICAgICAgICAgLyogRmxvYXRpbmcgcG9pbnQgdmFsdWUgLTAuMjE4ODk0ICovCi0jZGVmaW5lIEhQRl9GczQ0MTAwX0dhaW40X0IyICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAwICAgICAgICAgLyogRmxvYXRpbmcgcG9pbnQgdmFsdWUgMC4wMDAwMDAgKi8KLSNkZWZpbmUgSFBGX0ZzNDQxMDBfR2FpbjRfU2hpZnQgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDEgICAgICAgICAvKiBTaGlmdCB2YWx1ZSAqLwotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvKiBHYWluID0gIDUuMDAwMDAwIGRCICovCi0jZGVmaW5lIEhQRl9GczQ0MTAwX0dhaW41X0EwICAgICAgICAgICAgICAgICAgICAgICAgICAgIDIzOTM1ICAgICAgICAgLyogRmxvYXRpbmcgcG9pbnQgdmFsdWUgMC43MzA0NTIgKi8KLSNkZWZpbmUgSFBGX0ZzNDQxMDBfR2FpbjVfQTEgICAgICAgICAgICAgICAgICAgICAgICAgICAtMTEyNTQgICAgICAgICAvKiBGbG9hdGluZyBwb2ludCB2YWx1ZSAtMC4zNDM0NTMgKi8KLSNkZWZpbmUgSFBGX0ZzNDQxMDBfR2FpbjVfQTIgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDAgICAgICAgICAvKiBGbG9hdGluZyBwb2ludCB2YWx1ZSAwLjAwMDAwMCAqLwotI2RlZmluZSBIUEZfRnM0NDEwMF9HYWluNV9CMSAgICAgICAgICAgICAgICAgICAgICAgICAgICAtNzE3MyAgICAgICAgIC8qIEZsb2F0aW5nIHBvaW50IHZhbHVlIC0wLjIxODg5NCAqLwotI2RlZmluZSBIUEZfRnM0NDEwMF9HYWluNV9CMiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMCAgICAgICAgIC8qIEZsb2F0aW5nIHBvaW50IHZhbHVlIDAuMDAwMDAwICovCi0jZGVmaW5lIEhQRl9GczQ0MTAwX0dhaW41X1NoaWZ0ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAxICAgICAgICAgLyogU2hpZnQgdmFsdWUgKi8KLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLyogR2FpbiA9ICA2LjAwMDAwMCBkQiAqLwotI2RlZmluZSBIUEZfRnM0NDEwMF9HYWluNl9BMCAgICAgICAgICAgICAgICAgICAgICAgICAgICAyNjA4MiAgICAgICAgIC8qIEZsb2F0aW5nIHBvaW50IHZhbHVlIDAuNzk1OTcwICovCi0jZGVmaW5lIEhQRl9GczQ0MTAwX0dhaW42X0ExICAgICAgICAgICAgICAgICAgICAgICAgICAgLTEzNDAxICAgICAgICAgLyogRmxvYXRpbmcgcG9pbnQgdmFsdWUgLTAuNDA4OTcxICovCi0jZGVmaW5lIEhQRl9GczQ0MTAwX0dhaW42X0EyICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAwICAgICAgICAgLyogRmxvYXRpbmcgcG9pbnQgdmFsdWUgMC4wMDAwMDAgKi8KLSNkZWZpbmUgSFBGX0ZzNDQxMDBfR2FpbjZfQjEgICAgICAgICAgICAgICAgICAgICAgICAgICAgLTcxNzMgICAgICAgICAvKiBGbG9hdGluZyBwb2ludCB2YWx1ZSAtMC4yMTg4OTQgKi8KLSNkZWZpbmUgSFBGX0ZzNDQxMDBfR2FpbjZfQjIgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDAgICAgICAgICAvKiBGbG9hdGluZyBwb2ludCB2YWx1ZSAwLjAwMDAwMCAqLwotI2RlZmluZSBIUEZfRnM0NDEwMF9HYWluNl9TaGlmdCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMSAgICAgICAgIC8qIFNoaWZ0IHZhbHVlICovCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8qIEdhaW4gPSAgNy4wMDAwMDAgZEIgKi8KLSNkZWZpbmUgSFBGX0ZzNDQxMDBfR2FpbjdfQTAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMTQyNzkgICAgICAgICAvKiBGbG9hdGluZyBwb2ludCB2YWx1ZSAwLjQzNTc3NCAqLwotI2RlZmluZSBIUEZfRnM0NDEwMF9HYWluN19BMSAgICAgICAgICAgICAgICAgICAgICAgICAgICAtNzkyNCAgICAgICAgIC8qIEZsb2F0aW5nIHBvaW50IHZhbHVlIC0wLjI0MTgxNSAqLwotI2RlZmluZSBIUEZfRnM0NDEwMF9HYWluN19BMiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMCAgICAgICAgIC8qIEZsb2F0aW5nIHBvaW50IHZhbHVlIDAuMDAwMDAwICovCi0jZGVmaW5lIEhQRl9GczQ0MTAwX0dhaW43X0IxICAgICAgICAgICAgICAgICAgICAgICAgICAgIC03MTczICAgICAgICAgLyogRmxvYXRpbmcgcG9pbnQgdmFsdWUgLTAuMjE4ODk0ICovCi0jZGVmaW5lIEhQRl9GczQ0MTAwX0dhaW43X0IyICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAwICAgICAgICAgLyogRmxvYXRpbmcgcG9pbnQgdmFsdWUgMC4wMDAwMDAgKi8KLSNkZWZpbmUgSFBGX0ZzNDQxMDBfR2FpbjdfU2hpZnQgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDIgICAgICAgICAvKiBTaGlmdCB2YWx1ZSAqLwotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvKiBHYWluID0gIDguMDAwMDAwIGRCICovCi0jZGVmaW5lIEhQRl9GczQ0MTAwX0dhaW44X0EwICAgICAgICAgICAgICAgICAgICAgICAgICAgIDE1NjM0ICAgICAgICAgLyogRmxvYXRpbmcgcG9pbnQgdmFsdWUgMC40NzcxMTMgKi8KLSNkZWZpbmUgSFBGX0ZzNDQxMDBfR2FpbjhfQTEgICAgICAgICAgICAgICAgICAgICAgICAgICAgLTkyNzggICAgICAgICAvKiBGbG9hdGluZyBwb2ludCB2YWx1ZSAtMC4yODMxNTQgKi8KLSNkZWZpbmUgSFBGX0ZzNDQxMDBfR2FpbjhfQTIgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDAgICAgICAgICAvKiBGbG9hdGluZyBwb2ludCB2YWx1ZSAwLjAwMDAwMCAqLwotI2RlZmluZSBIUEZfRnM0NDEwMF9HYWluOF9CMSAgICAgICAgICAgICAgICAgICAgICAgICAgICAtNzE3MyAgICAgICAgIC8qIEZsb2F0aW5nIHBvaW50IHZhbHVlIC0wLjIxODg5NCAqLwotI2RlZmluZSBIUEZfRnM0NDEwMF9HYWluOF9CMiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMCAgICAgICAgIC8qIEZsb2F0aW5nIHBvaW50IHZhbHVlIDAuMDAwMDAwICovCi0jZGVmaW5lIEhQRl9GczQ0MTAwX0dhaW44X1NoaWZ0ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAyICAgICAgICAgLyogU2hpZnQgdmFsdWUgKi8KLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLyogR2FpbiA9ICA5LjAwMDAwMCBkQiAqLwotI2RlZmluZSBIUEZfRnM0NDEwMF9HYWluOV9BMCAgICAgICAgICAgICAgICAgICAgICAgICAgICAxNzE1NCAgICAgICAgIC8qIEZsb2F0aW5nIHBvaW50IHZhbHVlIDAuNTIzNDk2ICovCi0jZGVmaW5lIEhQRl9GczQ0MTAwX0dhaW45X0ExICAgICAgICAgICAgICAgICAgICAgICAgICAgLTEwNzk4ICAgICAgICAgLyogRmxvYXRpbmcgcG9pbnQgdmFsdWUgLTAuMzI5NTM3ICovCi0jZGVmaW5lIEhQRl9GczQ0MTAwX0dhaW45X0EyICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAwICAgICAgICAgLyogRmxvYXRpbmcgcG9pbnQgdmFsdWUgMC4wMDAwMDAgKi8KLSNkZWZpbmUgSFBGX0ZzNDQxMDBfR2FpbjlfQjEgICAgICAgICAgICAgICAgICAgICAgICAgICAgLTcxNzMgICAgICAgICAvKiBGbG9hdGluZyBwb2ludCB2YWx1ZSAtMC4yMTg4OTQgKi8KLSNkZWZpbmUgSFBGX0ZzNDQxMDBfR2FpbjlfQjIgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDAgICAgICAgICAvKiBGbG9hdGluZyBwb2ludCB2YWx1ZSAwLjAwMDAwMCAqLwotI2RlZmluZSBIUEZfRnM0NDEwMF9HYWluOV9TaGlmdCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMiAgICAgICAgIC8qIFNoaWZ0IHZhbHVlICovCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8qIEdhaW4gPSAgMTAuMDAwMDAwIGRCICovCi0jZGVmaW5lIEhQRl9GczQ0MTAwX0dhaW4xMF9BMCAgICAgICAgICAgICAgICAgICAgICAgICAgIDE4ODU5ICAgICAgICAgLyogRmxvYXRpbmcgcG9pbnQgdmFsdWUgMC41NzU1MzkgKi8KLSNkZWZpbmUgSFBGX0ZzNDQxMDBfR2FpbjEwX0ExICAgICAgICAgICAgICAgICAgICAgICAgICAtMTI1MDQgICAgICAgICAvKiBGbG9hdGluZyBwb2ludCB2YWx1ZSAtMC4zODE1ODAgKi8KLSNkZWZpbmUgSFBGX0ZzNDQxMDBfR2FpbjEwX0EyICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDAgICAgICAgICAvKiBGbG9hdGluZyBwb2ludCB2YWx1ZSAwLjAwMDAwMCAqLwotI2RlZmluZSBIUEZfRnM0NDEwMF9HYWluMTBfQjEgICAgICAgICAgICAgICAgICAgICAgICAgICAtNzE3MyAgICAgICAgIC8qIEZsb2F0aW5nIHBvaW50IHZhbHVlIC0wLjIxODg5NCAqLwotI2RlZmluZSBIUEZfRnM0NDEwMF9HYWluMTBfQjIgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMCAgICAgICAgIC8qIEZsb2F0aW5nIHBvaW50IHZhbHVlIDAuMDAwMDAwICovCi0jZGVmaW5lIEhQRl9GczQ0MTAwX0dhaW4xMF9TaGlmdCAgICAgICAgICAgICAgICAgICAgICAgICAgICAyICAgICAgICAgLyogU2hpZnQgdmFsdWUgKi8KLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLyogR2FpbiA9ICAxMS4wMDAwMDAgZEIgKi8KLSNkZWZpbmUgSFBGX0ZzNDQxMDBfR2FpbjExX0EwICAgICAgICAgICAgICAgICAgICAgICAgICAgMjA3NzMgICAgICAgICAvKiBGbG9hdGluZyBwb2ludCB2YWx1ZSAwLjYzMzkzMiAqLwotI2RlZmluZSBIUEZfRnM0NDEwMF9HYWluMTFfQTEgICAgICAgICAgICAgICAgICAgICAgICAgIC0xNDQxNyAgICAgICAgIC8qIEZsb2F0aW5nIHBvaW50IHZhbHVlIC0wLjQzOTk3MyAqLwotI2RlZmluZSBIUEZfRnM0NDEwMF9HYWluMTFfQTIgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMCAgICAgICAgIC8qIEZsb2F0aW5nIHBvaW50IHZhbHVlIDAuMDAwMDAwICovCi0jZGVmaW5lIEhQRl9GczQ0MTAwX0dhaW4xMV9CMSAgICAgICAgICAgICAgICAgICAgICAgICAgIC03MTczICAgICAgICAgLyogRmxvYXRpbmcgcG9pbnQgdmFsdWUgLTAuMjE4ODk0ICovCi0jZGVmaW5lIEhQRl9GczQ0MTAwX0dhaW4xMV9CMiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAwICAgICAgICAgLyogRmxvYXRpbmcgcG9pbnQgdmFsdWUgMC4wMDAwMDAgKi8KLSNkZWZpbmUgSFBGX0ZzNDQxMDBfR2FpbjExX1NoaWZ0ICAgICAgICAgICAgICAgICAgICAgICAgICAgIDIgICAgICAgICAvKiBTaGlmdCB2YWx1ZSAqLwotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvKiBHYWluID0gIDEyLjAwMDAwMCBkQiAqLwotI2RlZmluZSBIUEZfRnM0NDEwMF9HYWluMTJfQTAgICAgICAgICAgICAgICAgICAgICAgICAgICAyMjkyMCAgICAgICAgIC8qIEZsb2F0aW5nIHBvaW50IHZhbHVlIDAuNjk5NDUwICovCi0jZGVmaW5lIEhQRl9GczQ0MTAwX0dhaW4xMl9BMSAgICAgICAgICAgICAgICAgICAgICAgICAgLTE2NTY0ICAgICAgICAgLyogRmxvYXRpbmcgcG9pbnQgdmFsdWUgLTAuNTA1NDkxICovCi0jZGVmaW5lIEhQRl9GczQ0MTAwX0dhaW4xMl9BMiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAwICAgICAgICAgLyogRmxvYXRpbmcgcG9pbnQgdmFsdWUgMC4wMDAwMDAgKi8KLSNkZWZpbmUgSFBGX0ZzNDQxMDBfR2FpbjEyX0IxICAgICAgICAgICAgICAgICAgICAgICAgICAgLTcxNzMgICAgICAgICAvKiBGbG9hdGluZyBwb2ludCB2YWx1ZSAtMC4yMTg4OTQgKi8KLSNkZWZpbmUgSFBGX0ZzNDQxMDBfR2FpbjEyX0IyICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDAgICAgICAgICAvKiBGbG9hdGluZyBwb2ludCB2YWx1ZSAwLjAwMDAwMCAqLwotI2RlZmluZSBIUEZfRnM0NDEwMF9HYWluMTJfU2hpZnQgICAgICAgICAgICAgICAgICAgICAgICAgICAgMiAgICAgICAgIC8qIFNoaWZ0IHZhbHVlICovCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8qIEdhaW4gPSAgMTMuMDAwMDAwIGRCICovCi0jZGVmaW5lIEhQRl9GczQ0MTAwX0dhaW4xM19BMCAgICAgICAgICAgICAgICAgICAgICAgICAgIDEyNjk0ICAgICAgICAgLyogRmxvYXRpbmcgcG9pbnQgdmFsdWUgMC4zODczOTkgKi8KLSNkZWZpbmUgSFBGX0ZzNDQxMDBfR2FpbjEzX0ExICAgICAgICAgICAgICAgICAgICAgICAgICAgLTk1MDkgICAgICAgICAvKiBGbG9hdGluZyBwb2ludCB2YWx1ZSAtMC4yOTAxODkgKi8KLSNkZWZpbmUgSFBGX0ZzNDQxMDBfR2FpbjEzX0EyICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDAgICAgICAgICAvKiBGbG9hdGluZyBwb2ludCB2YWx1ZSAwLjAwMDAwMCAqLwotI2RlZmluZSBIUEZfRnM0NDEwMF9HYWluMTNfQjEgICAgICAgICAgICAgICAgICAgICAgICAgICAtNzE3MyAgICAgICAgIC8qIEZsb2F0aW5nIHBvaW50IHZhbHVlIC0wLjIxODg5NCAqLwotI2RlZmluZSBIUEZfRnM0NDEwMF9HYWluMTNfQjIgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMCAgICAgICAgIC8qIEZsb2F0aW5nIHBvaW50IHZhbHVlIDAuMDAwMDAwICovCi0jZGVmaW5lIEhQRl9GczQ0MTAwX0dhaW4xM19TaGlmdCAgICAgICAgICAgICAgICAgICAgICAgICAgICAzICAgICAgICAgLyogU2hpZnQgdmFsdWUgKi8KLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLyogR2FpbiA9ICAxNC4wMDAwMDAgZEIgKi8KLSNkZWZpbmUgSFBGX0ZzNDQxMDBfR2FpbjE0X0EwICAgICAgICAgICAgICAgICAgICAgICAgICAgMTQwNDkgICAgICAgICAvKiBGbG9hdGluZyBwb2ludCB2YWx1ZSAwLjQyODczOCAqLwotI2RlZmluZSBIUEZfRnM0NDEwMF9HYWluMTRfQTEgICAgICAgICAgICAgICAgICAgICAgICAgIC0xMDg2NCAgICAgICAgIC8qIEZsb2F0aW5nIHBvaW50IHZhbHVlIC0wLjMzMTUyOCAqLwotI2RlZmluZSBIUEZfRnM0NDEwMF9HYWluMTRfQTIgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMCAgICAgICAgIC8qIEZsb2F0aW5nIHBvaW50IHZhbHVlIDAuMDAwMDAwICovCi0jZGVmaW5lIEhQRl9GczQ0MTAwX0dhaW4xNF9CMSAgICAgICAgICAgICAgICAgICAgICAgICAgIC03MTczICAgICAgICAgLyogRmxvYXRpbmcgcG9pbnQgdmFsdWUgLTAuMjE4ODk0ICovCi0jZGVmaW5lIEhQRl9GczQ0MTAwX0dhaW4xNF9CMiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAwICAgICAgICAgLyogRmxvYXRpbmcgcG9pbnQgdmFsdWUgMC4wMDAwMDAgKi8KLSNkZWZpbmUgSFBGX0ZzNDQxMDBfR2FpbjE0X1NoaWZ0ICAgICAgICAgICAgICAgICAgICAgICAgICAgIDMgICAgICAgICAvKiBTaGlmdCB2YWx1ZSAqLwotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvKiBHYWluID0gIDE1LjAwMDAwMCBkQiAqLwotI2RlZmluZSBIUEZfRnM0NDEwMF9HYWluMTVfQTAgICAgICAgICAgICAgICAgICAgICAgICAgICAxNTU2OSAgICAgICAgIC8qIEZsb2F0aW5nIHBvaW50IHZhbHVlIDAuNDc1MTIxICovCi0jZGVmaW5lIEhQRl9GczQ0MTAwX0dhaW4xNV9BMSAgICAgICAgICAgICAgICAgICAgICAgICAgLTEyMzgzICAgICAgICAgLyogRmxvYXRpbmcgcG9pbnQgdmFsdWUgLTAuMzc3OTEyICovCi0jZGVmaW5lIEhQRl9GczQ0MTAwX0dhaW4xNV9BMiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAwICAgICAgICAgLyogRmxvYXRpbmcgcG9pbnQgdmFsdWUgMC4wMDAwMDAgKi8KLSNkZWZpbmUgSFBGX0ZzNDQxMDBfR2FpbjE1X0IxICAgICAgICAgICAgICAgICAgICAgICAgICAgLTcxNzMgICAgICAgICAvKiBGbG9hdGluZyBwb2ludCB2YWx1ZSAtMC4yMTg4OTQgKi8KLSNkZWZpbmUgSFBGX0ZzNDQxMDBfR2FpbjE1X0IyICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDAgICAgICAgICAvKiBGbG9hdGluZyBwb2ludCB2YWx1ZSAwLjAwMDAwMCAqLwotI2RlZmluZSBIUEZfRnM0NDEwMF9HYWluMTVfU2hpZnQgICAgICAgICAgICAgICAgICAgICAgICAgICAgMyAgICAgICAgIC8qIFNoaWZ0IHZhbHVlICovCi0KLQotLyogQ29lZmZpY2llbnRzIGZvciBzYW1wbGUgcmF0ZSA0ODAwMEh6ICovCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8qIEdhaW4gPSAgMS4wMDAwMDAgZEIgKi8KLSNkZWZpbmUgSFBGX0ZzNDgwMDBfR2FpbjFfQTAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMTc0OTEgICAgICAgICAvKiBGbG9hdGluZyBwb2ludCB2YWx1ZSAwLjUzMzc3NyAqLwotI2RlZmluZSBIUEZfRnM0ODAwMF9HYWluMV9BMSAgICAgICAgICAgICAgICAgICAgICAgICAgICAtNTYwNiAgICAgICAgIC8qIEZsb2F0aW5nIHBvaW50IHZhbHVlIC0wLjE3MTA4MiAqLwotI2RlZmluZSBIUEZfRnM0ODAwMF9HYWluMV9BMiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMCAgICAgICAgIC8qIEZsb2F0aW5nIHBvaW50IHZhbHVlIDAuMDAwMDAwICovCi0jZGVmaW5lIEhQRl9GczQ4MDAwX0dhaW4xX0IxICAgICAgICAgICAgICAgICAgICAgICAgICAgIC04NzgwICAgICAgICAgLyogRmxvYXRpbmcgcG9pbnQgdmFsdWUgLTAuMjY3OTQ5ICovCi0jZGVmaW5lIEhQRl9GczQ4MDAwX0dhaW4xX0IyICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAwICAgICAgICAgLyogRmxvYXRpbmcgcG9pbnQgdmFsdWUgMC4wMDAwMDAgKi8KLSNkZWZpbmUgSFBGX0ZzNDgwMDBfR2FpbjFfU2hpZnQgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDEgICAgICAgICAvKiBTaGlmdCB2YWx1ZSAqLwotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvKiBHYWluID0gIDIuMDAwMDAwIGRCICovCi0jZGVmaW5lIEhQRl9GczQ4MDAwX0dhaW4yX0EwICAgICAgICAgICAgICAgICAgICAgICAgICAgIDE4OTAwICAgICAgICAgLyogRmxvYXRpbmcgcG9pbnQgdmFsdWUgMC41NzY3NzkgKi8KLSNkZWZpbmUgSFBGX0ZzNDgwMDBfR2FpbjJfQTEgICAgICAgICAgICAgICAgICAgICAgICAgICAgLTcwMTUgICAgICAgICAvKiBGbG9hdGluZyBwb2ludCB2YWx1ZSAtMC4yMTQwODUgKi8KLSNkZWZpbmUgSFBGX0ZzNDgwMDBfR2FpbjJfQTIgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDAgICAgICAgICAvKiBGbG9hdGluZyBwb2ludCB2YWx1ZSAwLjAwMDAwMCAqLwotI2RlZmluZSBIUEZfRnM0ODAwMF9HYWluMl9CMSAgICAgICAgICAgICAgICAgICAgICAgICAgICAtODc4MCAgICAgICAgIC8qIEZsb2F0aW5nIHBvaW50IHZhbHVlIC0wLjI2Nzk0OSAqLwotI2RlZmluZSBIUEZfRnM0ODAwMF9HYWluMl9CMiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMCAgICAgICAgIC8qIEZsb2F0aW5nIHBvaW50IHZhbHVlIDAuMDAwMDAwICovCi0jZGVmaW5lIEhQRl9GczQ4MDAwX0dhaW4yX1NoaWZ0ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAxICAgICAgICAgLyogU2hpZnQgdmFsdWUgKi8KLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLyogR2FpbiA9ICAzLjAwMDAwMCBkQiAqLwotI2RlZmluZSBIUEZfRnM0ODAwMF9HYWluM19BMCAgICAgICAgICAgICAgICAgICAgICAgICAgICAyMDQ4MSAgICAgICAgIC8qIEZsb2F0aW5nIHBvaW50IHZhbHVlIDAuNjI1MDI5ICovCi0jZGVmaW5lIEhQRl9GczQ4MDAwX0dhaW4zX0ExICAgICAgICAgICAgICAgICAgICAgICAgICAgIC04NTk2ICAgICAgICAgLyogRmxvYXRpbmcgcG9pbnQgdmFsdWUgLTAuMjYyMzM1ICovCi0jZGVmaW5lIEhQRl9GczQ4MDAwX0dhaW4zX0EyICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAwICAgICAgICAgLyogRmxvYXRpbmcgcG9pbnQgdmFsdWUgMC4wMDAwMDAgKi8KLSNkZWZpbmUgSFBGX0ZzNDgwMDBfR2FpbjNfQjEgICAgICAgICAgICAgICAgICAgICAgICAgICAgLTg3ODAgICAgICAgICAvKiBGbG9hdGluZyBwb2ludCB2YWx1ZSAtMC4yNjc5NDkgKi8KLSNkZWZpbmUgSFBGX0ZzNDgwMDBfR2FpbjNfQjIgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDAgICAgICAgICAvKiBGbG9hdGluZyBwb2ludCB2YWx1ZSAwLjAwMDAwMCAqLwotI2RlZmluZSBIUEZfRnM0ODAwMF9HYWluM19TaGlmdCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMSAgICAgICAgIC8qIFNoaWZ0IHZhbHVlICovCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8qIEdhaW4gPSAgNC4wMDAwMDAgZEIgKi8KLSNkZWZpbmUgSFBGX0ZzNDgwMDBfR2FpbjRfQTAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMjIyNTUgICAgICAgICAvKiBGbG9hdGluZyBwb2ludCB2YWx1ZSAwLjY3OTE2NyAqLwotI2RlZmluZSBIUEZfRnM0ODAwMF9HYWluNF9BMSAgICAgICAgICAgICAgICAgICAgICAgICAgIC0xMDM3MCAgICAgICAgIC8qIEZsb2F0aW5nIHBvaW50IHZhbHVlIC0wLjMxNjQ3MiAqLwotI2RlZmluZSBIUEZfRnM0ODAwMF9HYWluNF9BMiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMCAgICAgICAgIC8qIEZsb2F0aW5nIHBvaW50IHZhbHVlIDAuMDAwMDAwICovCi0jZGVmaW5lIEhQRl9GczQ4MDAwX0dhaW40X0IxICAgICAgICAgICAgICAgICAgICAgICAgICAgIC04NzgwICAgICAgICAgLyogRmxvYXRpbmcgcG9pbnQgdmFsdWUgLTAuMjY3OTQ5ICovCi0jZGVmaW5lIEhQRl9GczQ4MDAwX0dhaW40X0IyICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAwICAgICAgICAgLyogRmxvYXRpbmcgcG9pbnQgdmFsdWUgMC4wMDAwMDAgKi8KLSNkZWZpbmUgSFBGX0ZzNDgwMDBfR2FpbjRfU2hpZnQgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDEgICAgICAgICAvKiBTaGlmdCB2YWx1ZSAqLwotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvKiBHYWluID0gIDUuMDAwMDAwIGRCICovCi0jZGVmaW5lIEhQRl9GczQ4MDAwX0dhaW41X0EwICAgICAgICAgICAgICAgICAgICAgICAgICAgIDI0MjQ1ICAgICAgICAgLyogRmxvYXRpbmcgcG9pbnQgdmFsdWUgMC43Mzk5MTAgKi8KLSNkZWZpbmUgSFBGX0ZzNDgwMDBfR2FpbjVfQTEgICAgICAgICAgICAgICAgICAgICAgICAgICAtMTIzNjEgICAgICAgICAvKiBGbG9hdGluZyBwb2ludCB2YWx1ZSAtMC4zNzcyMTUgKi8KLSNkZWZpbmUgSFBGX0ZzNDgwMDBfR2FpbjVfQTIgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDAgICAgICAgICAvKiBGbG9hdGluZyBwb2ludCB2YWx1ZSAwLjAwMDAwMCAqLwotI2RlZmluZSBIUEZfRnM0ODAwMF9HYWluNV9CMSAgICAgICAgICAgICAgICAgICAgICAgICAgICAtODc4MCAgICAgICAgIC8qIEZsb2F0aW5nIHBvaW50IHZhbHVlIC0wLjI2Nzk0OSAqLwotI2RlZmluZSBIUEZfRnM0ODAwMF9HYWluNV9CMiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMCAgICAgICAgIC8qIEZsb2F0aW5nIHBvaW50IHZhbHVlIDAuMDAwMDAwICovCi0jZGVmaW5lIEhQRl9GczQ4MDAwX0dhaW41X1NoaWZ0ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAxICAgICAgICAgLyogU2hpZnQgdmFsdWUgKi8KLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLyogR2FpbiA9ICA2LjAwMDAwMCBkQiAqLwotI2RlZmluZSBIUEZfRnM0ODAwMF9HYWluNl9BMCAgICAgICAgICAgICAgICAgICAgICAgICAgICAyNjQ3OSAgICAgICAgIC8qIEZsb2F0aW5nIHBvaW50IHZhbHVlIDAuODA4MDY1ICovCi0jZGVmaW5lIEhQRl9GczQ4MDAwX0dhaW42X0ExICAgICAgICAgICAgICAgICAgICAgICAgICAgLTE0NTk0ICAgICAgICAgLyogRmxvYXRpbmcgcG9pbnQgdmFsdWUgLTAuNDQ1MzcwICovCi0jZGVmaW5lIEhQRl9GczQ4MDAwX0dhaW42X0EyICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAwICAgICAgICAgLyogRmxvYXRpbmcgcG9pbnQgdmFsdWUgMC4wMDAwMDAgKi8KLSNkZWZpbmUgSFBGX0ZzNDgwMDBfR2FpbjZfQjEgICAgICAgICAgICAgICAgICAgICAgICAgICAgLTg3ODAgICAgICAgICAvKiBGbG9hdGluZyBwb2ludCB2YWx1ZSAtMC4yNjc5NDkgKi8KLSNkZWZpbmUgSFBGX0ZzNDgwMDBfR2FpbjZfQjIgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDAgICAgICAgICAvKiBGbG9hdGluZyBwb2ludCB2YWx1ZSAwLjAwMDAwMCAqLwotI2RlZmluZSBIUEZfRnM0ODAwMF9HYWluNl9TaGlmdCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMSAgICAgICAgIC8qIFNoaWZ0IHZhbHVlICovCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8qIEdhaW4gPSAgNy4wMDAwMDAgZEIgKi8KLSNkZWZpbmUgSFBGX0ZzNDgwMDBfR2FpbjdfQTAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMTQ1MjcgICAgICAgICAvKiBGbG9hdGluZyBwb2ludCB2YWx1ZSAwLjQ0MzMxOCAqLwotI2RlZmluZSBIUEZfRnM0ODAwMF9HYWluN19BMSAgICAgICAgICAgICAgICAgICAgICAgICAgICAtODU3MCAgICAgICAgIC8qIEZsb2F0aW5nIHBvaW50IHZhbHVlIC0wLjI2MTU0MCAqLwotI2RlZmluZSBIUEZfRnM0ODAwMF9HYWluN19BMiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMCAgICAgICAgIC8qIEZsb2F0aW5nIHBvaW50IHZhbHVlIDAuMDAwMDAwICovCi0jZGVmaW5lIEhQRl9GczQ4MDAwX0dhaW43X0IxICAgICAgICAgICAgICAgICAgICAgICAgICAgIC04NzgwICAgICAgICAgLyogRmxvYXRpbmcgcG9pbnQgdmFsdWUgLTAuMjY3OTQ5ICovCi0jZGVmaW5lIEhQRl9GczQ4MDAwX0dhaW43X0IyICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAwICAgICAgICAgLyogRmxvYXRpbmcgcG9pbnQgdmFsdWUgMC4wMDAwMDAgKi8KLSNkZWZpbmUgSFBGX0ZzNDgwMDBfR2FpbjdfU2hpZnQgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDIgICAgICAgICAvKiBTaGlmdCB2YWx1ZSAqLwotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvKiBHYWluID0gIDguMDAwMDAwIGRCICovCi0jZGVmaW5lIEhQRl9GczQ4MDAwX0dhaW44X0EwICAgICAgICAgICAgICAgICAgICAgICAgICAgIDE1OTM2ICAgICAgICAgLyogRmxvYXRpbmcgcG9pbnQgdmFsdWUgMC40ODYzMjEgKi8KLSNkZWZpbmUgSFBGX0ZzNDgwMDBfR2FpbjhfQTEgICAgICAgICAgICAgICAgICAgICAgICAgICAgLTk5NzkgICAgICAgICAvKiBGbG9hdGluZyBwb2ludCB2YWx1ZSAtMC4zMDQ1NDMgKi8KLSNkZWZpbmUgSFBGX0ZzNDgwMDBfR2FpbjhfQTIgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDAgICAgICAgICAvKiBGbG9hdGluZyBwb2ludCB2YWx1ZSAwLjAwMDAwMCAqLwotI2RlZmluZSBIUEZfRnM0ODAwMF9HYWluOF9CMSAgICAgICAgICAgICAgICAgICAgICAgICAgICAtODc4MCAgICAgICAgIC8qIEZsb2F0aW5nIHBvaW50IHZhbHVlIC0wLjI2Nzk0OSAqLwotI2RlZmluZSBIUEZfRnM0ODAwMF9HYWluOF9CMiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMCAgICAgICAgIC8qIEZsb2F0aW5nIHBvaW50IHZhbHVlIDAuMDAwMDAwICovCi0jZGVmaW5lIEhQRl9GczQ4MDAwX0dhaW44X1NoaWZ0ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAyICAgICAgICAgLyogU2hpZnQgdmFsdWUgKi8KLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLyogR2FpbiA9ICA5LjAwMDAwMCBkQiAqLwotI2RlZmluZSBIUEZfRnM0ODAwMF9HYWluOV9BMCAgICAgICAgICAgICAgICAgICAgICAgICAgICAxNzUxNyAgICAgICAgIC8qIEZsb2F0aW5nIHBvaW50IHZhbHVlIDAuNTM0NTcxICovCi0jZGVmaW5lIEhQRl9GczQ4MDAwX0dhaW45X0ExICAgICAgICAgICAgICAgICAgICAgICAgICAgLTExNTYwICAgICAgICAgLyogRmxvYXRpbmcgcG9pbnQgdmFsdWUgLTAuMzUyNzkzICovCi0jZGVmaW5lIEhQRl9GczQ4MDAwX0dhaW45X0EyICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAwICAgICAgICAgLyogRmxvYXRpbmcgcG9pbnQgdmFsdWUgMC4wMDAwMDAgKi8KLSNkZWZpbmUgSFBGX0ZzNDgwMDBfR2FpbjlfQjEgICAgICAgICAgICAgICAgICAgICAgICAgICAgLTg3ODAgICAgICAgICAvKiBGbG9hdGluZyBwb2ludCB2YWx1ZSAtMC4yNjc5NDkgKi8KLSNkZWZpbmUgSFBGX0ZzNDgwMDBfR2FpbjlfQjIgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDAgICAgICAgICAvKiBGbG9hdGluZyBwb2ludCB2YWx1ZSAwLjAwMDAwMCAqLwotI2RlZmluZSBIUEZfRnM0ODAwMF9HYWluOV9TaGlmdCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMiAgICAgICAgIC8qIFNoaWZ0IHZhbHVlICovCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8qIEdhaW4gPSAgMTAuMDAwMDAwIGRCICovCi0jZGVmaW5lIEhQRl9GczQ4MDAwX0dhaW4xMF9BMCAgICAgICAgICAgICAgICAgICAgICAgICAgIDE5MjkxICAgICAgICAgLyogRmxvYXRpbmcgcG9pbnQgdmFsdWUgMC41ODg3MDggKi8KLSNkZWZpbmUgSFBGX0ZzNDgwMDBfR2FpbjEwX0ExICAgICAgICAgICAgICAgICAgICAgICAgICAtMTMzMzQgICAgICAgICAvKiBGbG9hdGluZyBwb2ludCB2YWx1ZSAtMC40MDY5MzAgKi8KLSNkZWZpbmUgSFBGX0ZzNDgwMDBfR2FpbjEwX0EyICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDAgICAgICAgICAvKiBGbG9hdGluZyBwb2ludCB2YWx1ZSAwLjAwMDAwMCAqLwotI2RlZmluZSBIUEZfRnM0ODAwMF9HYWluMTBfQjEgICAgICAgICAgICAgICAgICAgICAgICAgICAtODc4MCAgICAgICAgIC8qIEZsb2F0aW5nIHBvaW50IHZhbHVlIC0wLjI2Nzk0OSAqLwotI2RlZmluZSBIUEZfRnM0ODAwMF9HYWluMTBfQjIgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMCAgICAgICAgIC8qIEZsb2F0aW5nIHBvaW50IHZhbHVlIDAuMDAwMDAwICovCi0jZGVmaW5lIEhQRl9GczQ4MDAwX0dhaW4xMF9TaGlmdCAgICAgICAgICAgICAgICAgICAgICAgICAgICAyICAgICAgICAgLyogU2hpZnQgdmFsdWUgKi8KLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLyogR2FpbiA9ICAxMS4wMDAwMDAgZEIgKi8KLSNkZWZpbmUgSFBGX0ZzNDgwMDBfR2FpbjExX0EwICAgICAgICAgICAgICAgICAgICAgICAgICAgMjEyODEgICAgICAgICAvKiBGbG9hdGluZyBwb2ludCB2YWx1ZSAwLjY0OTQ1MiAqLwotI2RlZmluZSBIUEZfRnM0ODAwMF9HYWluMTFfQTEgICAgICAgICAgICAgICAgICAgICAgICAgIC0xNTMyNSAgICAgICAgIC8qIEZsb2F0aW5nIHBvaW50IHZhbHVlIC0wLjQ2NzY3NCAqLwotI2RlZmluZSBIUEZfRnM0ODAwMF9HYWluMTFfQTIgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMCAgICAgICAgIC8qIEZsb2F0aW5nIHBvaW50IHZhbHVlIDAuMDAwMDAwICovCi0jZGVmaW5lIEhQRl9GczQ4MDAwX0dhaW4xMV9CMSAgICAgICAgICAgICAgICAgICAgICAgICAgIC04NzgwICAgICAgICAgLyogRmxvYXRpbmcgcG9pbnQgdmFsdWUgLTAuMjY3OTQ5ICovCi0jZGVmaW5lIEhQRl9GczQ4MDAwX0dhaW4xMV9CMiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAwICAgICAgICAgLyogRmxvYXRpbmcgcG9pbnQgdmFsdWUgMC4wMDAwMDAgKi8KLSNkZWZpbmUgSFBGX0ZzNDgwMDBfR2FpbjExX1NoaWZ0ICAgICAgICAgICAgICAgICAgICAgICAgICAgIDIgICAgICAgICAvKiBTaGlmdCB2YWx1ZSAqLwotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvKiBHYWluID0gIDEyLjAwMDAwMCBkQiAqLwotI2RlZmluZSBIUEZfRnM0ODAwMF9HYWluMTJfQTAgICAgICAgICAgICAgICAgICAgICAgICAgICAyMzUxNSAgICAgICAgIC8qIEZsb2F0aW5nIHBvaW50IHZhbHVlIDAuNzE3NjA3ICovCi0jZGVmaW5lIEhQRl9GczQ4MDAwX0dhaW4xMl9BMSAgICAgICAgICAgICAgICAgICAgICAgICAgLTE3NTU4ICAgICAgICAgLyogRmxvYXRpbmcgcG9pbnQgdmFsdWUgLTAuNTM1ODI5ICovCi0jZGVmaW5lIEhQRl9GczQ4MDAwX0dhaW4xMl9BMiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAwICAgICAgICAgLyogRmxvYXRpbmcgcG9pbnQgdmFsdWUgMC4wMDAwMDAgKi8KLSNkZWZpbmUgSFBGX0ZzNDgwMDBfR2FpbjEyX0IxICAgICAgICAgICAgICAgICAgICAgICAgICAgLTg3ODAgICAgICAgICAvKiBGbG9hdGluZyBwb2ludCB2YWx1ZSAtMC4yNjc5NDkgKi8KLSNkZWZpbmUgSFBGX0ZzNDgwMDBfR2FpbjEyX0IyICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDAgICAgICAgICAvKiBGbG9hdGluZyBwb2ludCB2YWx1ZSAwLjAwMDAwMCAqLwotI2RlZmluZSBIUEZfRnM0ODAwMF9HYWluMTJfU2hpZnQgICAgICAgICAgICAgICAgICAgICAgICAgICAgMiAgICAgICAgIC8qIFNoaWZ0IHZhbHVlICovCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8qIEdhaW4gPSAgMTMuMDAwMDAwIGRCICovCi0jZGVmaW5lIEhQRl9GczQ4MDAwX0dhaW4xM19BMCAgICAgICAgICAgICAgICAgICAgICAgICAgIDEzMDQxICAgICAgICAgLyogRmxvYXRpbmcgcG9pbnQgdmFsdWUgMC4zOTc5ODIgKi8KLSNkZWZpbmUgSFBGX0ZzNDgwMDBfR2FpbjEzX0ExICAgICAgICAgICAgICAgICAgICAgICAgICAtMTAwNTYgICAgICAgICAvKiBGbG9hdGluZyBwb2ludCB2YWx1ZSAtMC4zMDY4NzcgKi8KLSNkZWZpbmUgSFBGX0ZzNDgwMDBfR2FpbjEzX0EyICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDAgICAgICAgICAvKiBGbG9hdGluZyBwb2ludCB2YWx1ZSAwLjAwMDAwMCAqLwotI2RlZmluZSBIUEZfRnM0ODAwMF9HYWluMTNfQjEgICAgICAgICAgICAgICAgICAgICAgICAgICAtODc4MCAgICAgICAgIC8qIEZsb2F0aW5nIHBvaW50IHZhbHVlIC0wLjI2Nzk0OSAqLwotI2RlZmluZSBIUEZfRnM0ODAwMF9HYWluMTNfQjIgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMCAgICAgICAgIC8qIEZsb2F0aW5nIHBvaW50IHZhbHVlIDAuMDAwMDAwICovCi0jZGVmaW5lIEhQRl9GczQ4MDAwX0dhaW4xM19TaGlmdCAgICAgICAgICAgICAgICAgICAgICAgICAgICAzICAgICAgICAgLyogU2hpZnQgdmFsdWUgKi8KLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLyogR2FpbiA9ICAxNC4wMDAwMDAgZEIgKi8KLSNkZWZpbmUgSFBGX0ZzNDgwMDBfR2FpbjE0X0EwICAgICAgICAgICAgICAgICAgICAgICAgICAgMTQ0NTAgICAgICAgICAvKiBGbG9hdGluZyBwb2ludCB2YWx1ZSAwLjQ0MDk4NCAqLwotI2RlZmluZSBIUEZfRnM0ODAwMF9HYWluMTRfQTEgICAgICAgICAgICAgICAgICAgICAgICAgIC0xMTQ2NSAgICAgICAgIC8qIEZsb2F0aW5nIHBvaW50IHZhbHVlIC0wLjM0OTg4MCAqLwotI2RlZmluZSBIUEZfRnM0ODAwMF9HYWluMTRfQTIgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMCAgICAgICAgIC8qIEZsb2F0aW5nIHBvaW50IHZhbHVlIDAuMDAwMDAwICovCi0jZGVmaW5lIEhQRl9GczQ4MDAwX0dhaW4xNF9CMSAgICAgICAgICAgICAgICAgICAgICAgICAgIC04NzgwICAgICAgICAgLyogRmxvYXRpbmcgcG9pbnQgdmFsdWUgLTAuMjY3OTQ5ICovCi0jZGVmaW5lIEhQRl9GczQ4MDAwX0dhaW4xNF9CMiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAwICAgICAgICAgLyogRmxvYXRpbmcgcG9pbnQgdmFsdWUgMC4wMDAwMDAgKi8KLSNkZWZpbmUgSFBGX0ZzNDgwMDBfR2FpbjE0X1NoaWZ0ICAgICAgICAgICAgICAgICAgICAgICAgICAgIDMgICAgICAgICAvKiBTaGlmdCB2YWx1ZSAqLwotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvKiBHYWluID0gIDE1LjAwMDAwMCBkQiAqLwotI2RlZmluZSBIUEZfRnM0ODAwMF9HYWluMTVfQTAgICAgICAgICAgICAgICAgICAgICAgICAgICAxNjAzMSAgICAgICAgIC8qIEZsb2F0aW5nIHBvaW50IHZhbHVlIDAuNDg5MjM0ICovCi0jZGVmaW5lIEhQRl9GczQ4MDAwX0dhaW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JvaWQgT3BlbiBTb3VyY2UgUHJvamVjdAotICoKLSAqIExpY2Vuc2VkIHVuZGVyIHRoZSBBcGFjaGUgTGljZW5zZSwgVmVyc2lvbiAyLjAgKHRoZSAiTGljZW5zZSIpOwotICogeW91IG1heSBub3QgdXNlIHRoaXMgZmlsZSBleGNlcHQgaW4gY29tcGxpYW5jZSB3aXRoIHRoZSBMaWNlbnNlLgotICogWW91IG1heSBvYnRhaW4gYSBjb3B5IG9mIHRoZSBMaWNlbnNlIGF0Ci0gKgotICogICAgICBodHRwOi8vd3d3LmFwYWNoZS5vcmcvbGljZW5zZXMvTElDRU5TRS0yLjAKLSAqCi0gKiBVbmxlc3MgcmVxdWlyZWQgYnkgYXBwbGljYWJsZSBsYXcgb3IgYWdyZWVkIHRvIGluIHdyaXRpbmcsIHNvZnR3YXJlCi0gKiBkaXN0cmlidXRlZCB1bmRlciB0aGUgTGljZW5zZSBpcyBkaXN0cmlidXRlZCBvbiBhbiAiQVMgSVMiIEJBU0lTLAotICogV0lUSE9VVCBXQVJSQU5USUVTIE9SIENPTkRJVElPTlMgT0YgQU5ZIEtJTkQsIGVpdGhlciBleHByZXNzIG9yIGltcGxpZWQuCi0gKiBTZWUgdGhlIExpY2Vuc2UgZm9yIHRoZSBzcGVjaWZpYyBsYW5ndWFnZSBnb3Zlcm5pbmcgcGVybWlzc2lvbnMgYW5kCi0gKiBsaW1pdGF0aW9ucyB1bmRlciB0aGUgTGljZW5zZS4KLSAqLwotCi0KLS8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotLyogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiBJbmNsdWRlcyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0KLSNpbmNsdWRlICJWZWN0b3JBcml0aG1ldGljLmgiCi0jaW5jbHVkZSAiU2NhbGFyQXJpdGhtZXRpYy5oIgotI2luY2x1ZGUgIkxWTV9Db2VmZnMuaCIKLSNpbmNsdWRlICJMVk1fVGFibGVzLmgiCi0jaW5jbHVkZSAiTFZNX1ByaXZhdGUuaCIKLQotLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0vKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qIEZVTkNUSU9OOiAgICAgICAgICAgTFZNX1NldENvbnRyb2xQYXJhbWV0ZXJzICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiBERVNDUklQVElPTjogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICBTZXRzIG9yIGNoYW5nZXMgdGhlIExpZmVWaWJlcyBtb2R1bGUgcGFyYW1ldGVycy4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiBQQVJBTUVURVJTOiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICBoSW5zdGFuY2UgICAgICAgICAgSW5zdGFuY2UgaGFuZGxlICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogIHBQYXJhbXMgICAgICAgICAgICBQb2ludGVyIHRvIGEgcGFyYW1ldGVyIHN0cnVjdHVyZSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qIFJFVFVSTlM6ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogIExWTV9TVUNDRVNTICAgICAgICBTdWNjZWVkZWQgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgTFZNX05VTExBRERSRVNTICAgIFdoZW4gaEluc3RhbmNlLCBwUGFyYW1zIG9yIGFueSBjb250cm9sIHBvaW50ZXJzIGFyZSBOVUxMICAgICAgICAgKi8KLS8qICBMVk1fT1VUT0ZSQU5HRSAgICAgV2hlbiBhbnkgb2YgdGhlIGNvbnRyb2wgcGFyYW1ldGVycyBhcmUgb3V0IG9mIHJhbmdlICAgICAgICAgICAgICAqLwotLyogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiBOT1RFUzogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICAxLiBUaGlzIGZ1bmN0aW9uIG1heSBiZSBpbnRlcnJ1cHRlZCBieSB0aGUgTFZNX1Byb2Nlc3MgZnVuY3Rpb24gICAgICAgICAgICAgICAgICAgICAqLwotLyogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLQotTFZNX1JldHVyblN0YXR1c19lbiBMVk1fU2V0Q29udHJvbFBhcmFtZXRlcnMoTFZNX0hhbmRsZV90ICAgICAgICAgICBoSW5zdGFuY2UsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBMVk1fQ29udHJvbFBhcmFtc190ICAgICpwUGFyYW1zKQotewotICAgIExWTV9JbnN0YW5jZV90ICAgICpwSW5zdGFuY2UgPShMVk1fSW5zdGFuY2VfdCAgKiloSW5zdGFuY2U7Ci0KLQotICAgIGlmICgocFBhcmFtcyA9PSBMVk1fTlVMTCkgfHwgKGhJbnN0YW5jZSA9PSBMVk1fTlVMTCkpCi0gICAgewotICAgICAgICByZXR1cm4gKExWTV9OVUxMQUREUkVTUyk7Ci0gICAgfQotCi0gICAgcEluc3RhbmNlLT5OZXdQYXJhbXMgPSAqcFBhcmFtczsKLQotICAgIGlmKAotICAgICAgICAvKiBHZW5lcmFsIHBhcmFtZXRlcnMgKi8KLSAgICAgICAgKChwUGFyYW1zLT5PcGVyYXRpbmdNb2RlICE9IExWTV9NT0RFX09GRikgJiYgKHBQYXJhbXMtPk9wZXJhdGluZ01vZGUgIT0gTFZNX01PREVfT04pKSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfHwKLSAgICAgICAgKChwUGFyYW1zLT5TYW1wbG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OKSkKLSAgICB7Ci0gICAgICAgIHJldHVybiAoTFZNX09VVE9GUkFOR0UpOwotICAgIH0KLQotCi0gICAgLyoKLSAgICAqIFNldCB0aGUgZmxhZyB0byBpbmRpY2F0ZSB0aGVyZSBhcmUgbmV3IHBhcmFtZXRlcnMgdG8gdXNlCi0gICAgKgotICAgICogUHJvdGVjdCB0aGUgY29weSBvZiB0aGUgbmV3IHBhcmFtZXRlcnMgZnJvbSBpbnRlcnJ1cHRzIHRvIGF2b2lkIHBvc3NpYmxlIHByb2JsZW1zCi0gICAgKiB3aXRoIGxvc3MgY29udHJvbCBwYXJhbWV0ZXJzLiBUaGlzIHByb2JsZW0gY2FuIG9jY3VyIGlmIHRoaXMgY29udHJvbCBmdW5jdGlvbiBpcyBjYWxsZWQgbW9yZQotICAgICogdGhhbiBvbmNlIGJlZm9yZSBhIGNhbGwgdG8gdGhlIHByb2Nlc3MgZnVuY3Rpb24uIElmIHRoZSBwcm9jZXNzIGZ1bmN0aW9uIGludGVycnVwdHMKLSAgICAqIHRoZSBjb3B5IHRvIE5ld1BhcmFtcyB0aGVuIG9uZSBmcmFtZSBtYXkgaGF2ZSBtaXhlZCBwYXJhbWV0ZXJzLCBzb21lIG9sZCBhbmQgc29tZSBuZXcuCi0gICAgKi8KLSAgICBwSW5zdGFuY2UtPkNvbnRyb2xQZW5kaW5nID0gTFZNX1RSVUU7Ci0KLSAgICByZXR1cm4oTFZNX1NVQ0NFU1MpOwotfQotCi0KLS8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotLyogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiBGVU5DVElPTjogICAgICAgICAgICAgTFZNX0dldENvbnRyb2xQYXJhbWV0ZXJzICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogREVTQ1JJUFRJT046ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgUmVxdWVzdCB0aGUgTGlmZVZpYmVzIG1vZHVsZSBwYXJhbWV0ZXJzLiBUaGUgY3VycmVudCBwYXJhbWV0ZXIgc2V0IGlzIHJldHVybmVkICAgICAgKi8KLS8qICB2aWEgdGhlIHBhcmFtZXRlciBwb2ludGVyLiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiBQQVJBTUVURVJTOiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICBoSW5zdGFuY2UgICAgICAgICAgICBJbnN0YW5jZSBoYW5kbGUgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogIHBQYXJhbXMgICAgICAgICAgICAgIFBvaW50ZXIgdG8gYW4gZW1wdHkgcGFyYW1ldGVyIHN0cnVjdHVyZSAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qIFJFVFVSTlM6ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogIExWTV9TVUNDRVNTICAgICAgICAgIFN1Y2NlZWRlZCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgTFZNX05VTExBRERSRVNTICAgICAgd2hlbiBhbnkgb2YgaEluc3RhbmNlIG9yIHBQYXJhbXMgaXMgTlVMTCAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogTk9URVM6ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgMS4gVGhpcyBmdW5jdGlvbiBtYXkgYmUgaW50ZXJydXB0ZWQgYnkgdGhlIExWTV9Qcm9jZXNzIGZ1bmN0aW9uICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0KLUxWTV9SZXR1cm5TdGF0dXNfZW4gTFZNX0dldENvbnRyb2xQYXJhbWV0ZXJzKExWTV9IYW5kbGVfdCAgICAgICAgICAgaEluc3RhbmNlLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTFZNX0NvbnRyb2xQYXJhbXNfdCAgICAqcFBhcmFtcykKLXsKLSAgICBMVk1fSW5zdGFuY2VfdCAgICAqcEluc3RhbmNlID0oTFZNX0luc3RhbmNlX3QgICopaEluc3RhbmNlOwotCi0KLSAgICAvKgotICAgICAqIENoZWNrIHBvaW50ZXIKLSAgICAgKi8KLSAgICBpZiAoKHBQYXJhbXMgPT0gTFZNX05VTEwpIHx8IChoSW5zdGFuY2UgPT0gTFZNX05VTEwpKQotICAgIHsKLSAgICAgICAgcmV0dXJuIChMVk1fTlVMTEFERFJFU1MpOwotICAgIH0KLSAgICAqcFBhcmFtcyA9IHBJbnN0YW5jZS0+TmV3UGFyYW1zOwotCi0gICAgLyoKLSAgICAgKiBDb3B5IHRoZSBmaWx0ZXIgZGVmaW5pdGlvbnMgZm9yIHRoZSBFcXVhbGlzZXIKLSAgICAgKi8KLSAgICB7Ci0gICAgICAgIExWTV9JTlQxNiAgICAgICAgICAgaTsKLQotICAgICAgICBpZiAocEluc3RhbmNlLT5OZXdQYXJhbXMuRVFOQl9OQmFuZHMgIT0gMCkKLSAgICAgICAgZm9yIChpPTA7IGk8cEluc3RhbmNlLT5OZXdQYXJhbXMuRVFOQl9OQmFuZHM7IGkrKykKLSAgICAgICAgewotICAgICAgICAgICAgcEluc3RhbmNlLT5wRVFOQl9Vc2VyRGVmc1tpXSA9IHBJbnN0YW5jZS0+cEVRTkJfQmFuZERlZnNbaV07Ci0gICAgICAgIH0KLSAgICAgICAgcFBhcmFtcy0+cEVRTkJfQmFuZERlZmluaXRpb24gPSBwSW5zdGFuY2UtPnBFUU5CX1VzZXJEZWZzOwotICAgIH0KLQotICAgIHJldHVybihMVk1fU1VDQ0VTUyk7Ci19Ci0KLQotLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0vKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qIEZVTkNUSU9OOiAgICAgICAgICAgICAgICBMVk1fU2V0VHJlYmxlQm9vc3QgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiBERVNDUklQVElPTjogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICBFbmFibGUgdGhlIHRyZWJsZSBib29zdCB3aGVuIHRoZSBzZXR0aW5ncyBhcmUgYXBwcm9wcmlhdGUsIGkuZS4gbm9uLXplcm8gZ2FpbiAgICAgICAqLwotLyogIGFuZCB0aGUgc2FtcGxlIHJhdGUgaXMgaGlnaCBlbm91Z2ggZm9yIHRoZSBlZmZlY3QgdG8gYmUgaGVhcmQuICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qIFBBUkFNRVRFUlM6ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogIHBJbnN0YW5jZSAgICAgICAgICAgICAgIFBvaW50ZXIgdG8gdGhlIGluc3RhbmNlIHN0cnVjdHVyZSAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgcFBhcmFtcyAgICAgICAgICAgICAgICAgUG9pbnRlciB0byB0aGUgcGFyYW1ldGVycyB0byB1c2UgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi12b2lkIExWTV9TZXRUcmVibGVCb29zdChMVk1fSW5zdGFuY2VfdCAgICAgICAgICpwSW5zdGFuY2UsCi0gICAgICAgICAgICAgICAgICAgICAgICBMVk1fQ29udHJvbFBhcmFtc190ICAgICpwUGFyYW1zKQotewotICAgIGV4dGVybiBGT19DMTZfTFNoeF9Db2Vmc190ICBMVk1fVHJlYmxlQm9vc3RDb2Vmc1tdOwotICAgIExWTV9JTlQxNiAgICAgICAgICAgICAgIE9mZnNldDsKLSAgICBMVk1fSU5UMTYgICAgICAgICAgICAgICBFZmZlY3RMZXZlbCA9IDA7Ci0KLSAgICAvKgotICAgICAqIExvYWQgdGhlIGNvZWZmaWNpZW50cwotICAgICAqLwotICAgIGlmICgocFBhcmFtcy0+VEVfT3BlcmF0aW5nTW9kZSA9PSBMVk1fVEVfT04pICYmCi0gICAgICAgIChwUGFyYW1zLT5TYW1wbGVSYXRlID49IFRyZWJsZUJvb3N0TWluUmF0ZSkgJiYKLSAgICAgICAgKHBQYXJhbXMtPk9wZXJhdGluZ01vZGUgPT0gTFZNX01PREVfT04pICYmCi0gICAgICAgIChwUGFyYW1zLT5URV9FZmZlY3RMZXZlbCA+IDApKQotICAgIHsKLSAgICAgICAgaWYoKHBQYXJhbXMtPlRFX0VmZmVjdExldmVsID09IExWTV9URV9MT1dfTUlQUykgJiYKLSAgICAgICAgICAgICgocFBhcmFtcy0+U3BlYWtlclR5cGUgPT0gTFZNX0hFQURQSE9ORVMpfHwKLSAgICAgICAgICAgIChwUGFyYW1zLT5TcGVha2VyVHlwZSA9PSBMVk1fRVhfSEVBRFBIT05FUykpKQotICAgICAgICB7Ci0gICAgICAgICAgICBwSW5zdGFuY2UtPlRFX0FjdGl2ZSA9IExWTV9GQUxTRTsKLSAgICAgICAgfQotICAgICAgICBlbHNlCi0gICAgICAgIHsKLSAgICAgICAgICAgIEVmZmVjdExldmVsID0gcFBhcmFtcy0+VEVfRWZmZWN0TGV2ZWw7Ci0gICAgICAgICAgICBwSW5zdGFuY2UtPlRFX0FjdGl2ZSA9IExWTV9UUlVFOwotICAgICAgICB9Ci0KLSAgICAgICAgaWYocEluc3RhbmNlLT5URV9BY3RpdmUgPT0gTFZNX1RSVUUpCi0gICAgICAgIHsKLSAgICAgICAgICAgIC8qCi0gICAgICAgICAgICAgKiBMb2FkIHRoZSBjb2VmZmljaWVudHMgYW5kIGVuYWJsZWQgdGhlIHRyZWJsZSBib29zdAotICAgICAgICAgICAgICovCi0gICAgICAgICAgICBPZmZzZXQgPSAoTFZNX0lOVDE2KShFZmZlY3RMZXZlbCAtIDEgKyBUcmVibGVCb29zdFN0ZXBzICogKHBQYXJhbXMtPlNhbXBsZVJhdGUgLSBUcmVibGVCb29zdE1pblJhdGUpKTsKLSAgICAgICAgICAgIEZPXzJJX0QxNkYzMkNzc19MU2h4X1RSQ19XUkFfMDFfSW5pdCgmcEluc3RhbmNlLT5wVEVfU3RhdGUtPlRyZWJsZUJvb3N0X1N0YXRlLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmcEluc3RhbmNlLT5wVEVfVGFwcy0+VHJlYmxlQm9vc3RfVGFwcywKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJkxWTV9UcmVibGVCb29zdENvZWZzW09mZnNldF0pOwotCi0gICAgICAgICAgICAvKgotICAgICAgICAgICAgICogQ2xlYXIgdGhlIHRhcHMKLSAgICAgICAgICAgICAqLwotICAgICAgICAgICAgTG9hZENvbnN0XzE2KChMVk1fSU5UMTYpMCwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLyogVmFsdWUgKi8KLSAgICAgICAgICAgICAgICAgICAgICAgICAodm9pZCAqKSZwSW5zdGFuY2UtPnBURV9UYXBzLT5UcmVibGVCb29zdF9UYXBzLCAgLyogRGVzdGluYXRpb24uXAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBDYXN0IHRvIHZvaWQ6IG5vIGRlcmVmZXJlbmNpbmcgaW4gZnVuY3Rpb24gKi8KLSAgICAgICAgICAgICAgICAgICAgICAgICAoTFZNX1VJTlQxNikoc2l6ZW9mKHBJbnN0YW5jZS0+cFRFX1RhcHMtPlRyZWJsZUJvb3N0X1RhcHMpL3NpemVvZihMVk1fSU5UMTYpKSk7IC8qIE51bWJlciBvZiB3b3JkcyAqLwotICAgICAgICB9Ci0gICAgfQotICAgIGVsc2UKLSAgICB7Ci0gICAgICAgIC8qCi0gICAgICAgICAqIERpc2FibGUgdGhlIHRyZWJsZSBib29zdAotICAgICAgICAgKi8KLSAgICAgICAgcEluc3RhbmNlLT5URV9BY3RpdmUgPSBMVk1fRkFMU0U7Ci0gICAgfQotCi0gICAgcmV0dXJuOwotfQotCi0KLS8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0vKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogRlVOQ1RJT046ICAgICAgICAgICAgTFZNX1NldFZvbHVtZSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiBERVNDUklQVElPTjogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogIENvbnZlcnRzIHRoZSBpbnB1dCB2b2x1bWUgZGVtYW5kIGZyb20gZEJzIHRvIGxpbmVhci4gICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiBQQVJBTUVURVJTOiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogIHBJbnN0YW5jZSAgICAgICAgICAgUG9pbnRlciB0byB0aGUgaW5zdGFuY2UgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICBwUGFyYW1zICAgICAgICAgICAgIEluaXRpYWxpc2F0aW9uIHBhcmFtZXRlcnMgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLXZvaWQgICAgTFZNX1NldFZvbHVtZShMVk1fSW5zdGFuY2VfdCAgICAgICAgICpwSW5zdGFuY2UsCi0gICAgICAgICAgICAgICAgICAgICAgTFZNX0NvbnRyb2xQYXJhbXNfdCAgICAqcFBhcmFtcykKLXsKLQotICAgIExWTV9VSU5UMTYgICAgICBkQlNoaWZ0czsgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8qIDZkQiBzaGlmdHMgKi8KLSAgICBMVk1fVUlOVDE2ICAgICAgZEJPZmZzZXQ7ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvKiBUYWJsZSBvZmZzZXQgKi8KLSAgICBMVk1fSU5UMTYgICAgICAgVm9sdW1lID0gMDsgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvKiBSZXF1aXJlZCB2b2x1bWUgaW4gZEJzICovCi0KLSAgICAvKgotICAgICAqIExpbWl0IHRoZSBnYWluIHRvIHRoZSBtYXhpbXVtIGFsbG93ZWQKLSAgICAgKi8KLSAgICAgaWYgIChwUGFyYW1zLT5WQ19FZmZlY3RMZXZlbCA+IDApCi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ICAgICAoKChMVk1fSU5UMzIpTFZNX1ZvbHVtZVRhYmxlW2RCT2Zmc2V0XSk+PmRCU2hpZnRzKSk7Ci0gICAgfQotICAgIHBJbnN0YW5jZS0+VkNfVm9sdW1lLk1peGVyU3RyZWFtWzBdLkNhbGxiYWNrU2V0ID0gMTsKLSAgICBpZihwSW5zdGFuY2UtPk5vU21vb3RoVm9sdW1lID09IExWTV9UUlVFKQotICAgIHsKLSAgICAgICAgTFZDX01peGVyX1NldFRpbWVDb25zdGFudCgmcEluc3RhbmNlLT5WQ19Wb2x1bWUuTWl4ZXJTdHJlYW1bMF0sMCxwSW5zdGFuY2UtPlBhcmFtcy5TYW1wbGVSYXRlLDIpOwotICAgIH0KLSAgICBlbHNlCi0gICAgewotICAgICAgICBMVkNfTWl4ZXJfVmFyU2xvcGVfU2V0VGltZUNvbnN0YW50KCZwSW5zdGFuY2UtPlZDX1ZvbHVtZS5NaXhlclN0cmVhbVswXSxMVk1fVkNfTUlYRVJfVElNRSxwSW5zdGFuY2UtPlBhcmFtcy5TYW1wbGVSYXRlLDIpOwotICAgIH0KLX0KLQotCi0vKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotLyogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qIEZVTkNUSU9OOiAgICAgICAgICAgIExWTV9TZXRIZWFkcm9vbSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogREVTQ1JJUFRJT046ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICBGaW5kIHN1aXRhYmxlIGhlYWRyb29tIGJhc2VkIG9uIEVRIHNldHRpbmdzLiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogUEFSQU1FVEVSUzogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICBwSW5zdGFuY2UgICAgICAgICAgIFBvaW50ZXIgdG8gdGhlIGluc3RhbmNlICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgcFBhcmFtcyAgICAgICAgICAgICBJbml0aWFsaXNhdGlvbiBwYXJhbWV0ZXJzICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qIFJFVFVSTlM6ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgdm9pZCAgICAgICAgICAgICAgICBOb3RoaW5nICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qIE5PVEVTOiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLXZvaWQgICAgTFZNX1NldEhlYWRyb29tKExWTV9JbnN0YW5jZV90ICAgICAgICAgKnBJbnN0YW5jZSwKLSAgICAgICAgICAgICAgICAgICAgICAgIExWTV9Db250cm9sUGFyYW1zX3QgICAgKnBQYXJhbXMpCi17Ci0gICAgTFZNX0lOVDE2ICAgaWksIGpqOwotICAgIExWTV9JTlQxNiAgIEhlYWRyb29tID0gMDsKLSAgICBMVk1fSU5UMTYgICBNYXhHYWluID0gMDsKLQotCi0gICAgaWYgKChwUGFyYW1zLT5FUU5CX09wZXJhdGluZ01vZGUgPT0gTFZFUU5CX09OKSAmJiAocEluc3RhbmNlLT5IZWFkcm9vbVBhcmFtcy5IZWFkcm9vbV9PcGVyYXRpbmdNb2RlID09IExWTV9IRUFEUk9PTV9PTikpCi0gICAgewotICAgICAgICAvKiBGaW5kIHR5cGljYWwgaGVhZHJvb20gdmFsdWUgKi8KLSAgICAgICAgZm9yKGpqID0gMDsgamogPCBwSW5zdGFuY2UtPkhlYWRyb29tUGFyYW1zLk5IZWFkcm9vbUJhbmRzOyBqaisrKQotICAgICAgICB7Ci0gICAgICAgICAgICBNYXhHYWluID0gMDsKLSAgICAgICAgICAgIGZvciggaWkgPSAwOyBpaSA8IHBQYXJhbXMtPkVRTkJfTkJhbmRzOyBpaSsrKQotICAgICAgICAgICAgewotICAgICAgICAgICAgICAgIGlmKChwUGFyYW1zLT5wRVFOQl9CYW5kRGVmaW5pdGlvbltpaV0uRnJlcXVlbmN5ID49IHBJbnN0YW5jZS0+SGVhZHJvb21QYXJhbXMucEhlYWRyb29tRGVmaW5pdGlvbltqal0uTGltaXRfTG93KSAmJgotICAgICAgICAgICAgICAgICAgIChwUGFyYW1zLT5wRVFOQl9CYW5kRGVmaW5pdGlvbltpaV0uRnJlcXVlbmN5IDw9IHBJbnN0YW5jZS0+SGVhZHJvb21QYXJhbXMucEhlYWRyb29tRGVmaW5pdGlvbltqal0uTGltaXRfSGlnaCkpCi0gICAgICAgICAgICAgICAgewotICAgICAgICAgICAgICAgICAgICBpZihwUGFyYW1zLT5wRVFOQl9CYW5kRGVmaW5pdGlvbltpaV0uR2FpbiA+IE1heEdhaW4pCi0gICAgICAgICAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAgICAgICAgIE1heEdhaW4gPSBwUGFyYW1zLT5wRVFOQl9CYW5kRGVmaW5pdGlvbltpaV0uR2FpbjsKLSAgICAgICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgaWYoKE1heEdhaW4gLSBwSW5zdGFuY2UtPkhlYWRyb29tUGFyYW1zLnBIZWFkcm9vbURlZmluaXRpb25bampdLkhlYWRyb29tX09mZnNldCkgPiBIZWFkcm9vbSl7Ci0gICAgICAgICAgICAgICAgSGVhZHJvb20gPSAoTFZNX0lOVDE2KShNYXhHYWluIC0gcEluc3RhbmNlLT5IZWFkcm9vbVBhcmFtcy5wSGVhZHJvb21EZWZpbml0aW9uW2pqXS5IZWFkcm9vbV9PZmZzZXQpOwotICAgICAgICAgICAgfQotICAgICAgICB9Ci0KLSAgICAgICAgLyogU2F0dXJhdGUgKi8KLSAgICAgICAgaWYoSGVhZHJvb20gPCAwKQotICAgICAgICAgICAgSGVhZHJvb20gPSAwOwotICAgIH0KLSAgICBwSW5zdGFuY2UtPkhlYWRyb29tID0gKExWTV9VSU5UMTYpSGVhZHJvb20gOwotCi19Ci0KLQotLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0vKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qIEZVTkNUSU9OOiAgICAgICAgICAgICAgICBMVk1fQXBwbHlOZXdTZXR0aW5ncyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiBERVNDUklQVElPTjogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICBBcHBsaWVzIGNoYW5nZXMgdG8gcGFyYW1ldHJlcy4gVGhpcyBmdW5jdGlvbiBtYWtlcyBubyBhc3N1bXB0aW9ucyBhYm91dCB3aGF0ICAgICAgICAqLwotLyogIGVhY2ggbW9kdWxlIG5lZWRzIGZvciBpbml0aWFsaXNhdGlvbiBhbmQgaGVuY2UgcGFzc2VzIGFsbCBwYXJhbWV0ZXJzIHRvIGFsbCB0aGUgICAgICovCi0vKiAgdGhlIG1vZHVsZXMgaW4gdHVybi4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiBQQVJBTUVURVJTOiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICBoSW5zdGFuY2UgICAgICAgICAgICAgICBJbnN0YW5jZSBoYW5kbGUgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiBSRVRVUk5TOiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICBMVk1fU3VjY2VzcyAgICAgICAgICAgICBTdWNjZWVkZWQgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLQotTFZNX1JldHVyblN0YXR1c19lbiBMVk1fQXBwbHlOZXdTZXR0aW5ncyhMVk1fSGFuZGxlX3QgICBoSW5zdGFuY2UpCi17Ci0gICAgTFZNX0luc3RhbmNlX3QgICAgICAgICAqcEluc3RhbmNlID0oTFZNX0luc3RhbmNlX3QgKiloSW5zdGFuY2U7Ci0gICAgTFZNX0NvbnRyb2xQYXJhbXNfdCAgICBMb2NhbFBhcmFtczsKLSAgICBMVk1fSU5UMTYgICAgICAgICAgICAgIENvdW50ID0gNTsKLQotCi0gICAgLyoKLSAgICAgKiBDb3B5IHRoZSBuZXcgcGFyYW1ldGVycyBidXQgbWFrZSBzdXJlIHRoZXkgZGlkbid0IGNoYW5nZSB3aGlsZSBjb3B5aW5nCi0gICAgICovCi0gICAgZG8KLSAgICB7Ci0gICAgICAgIHBJbnN0YW5jZS0+Q29udHJvbFBlbmRpbmcgPSBMVk1fRkFMU0U7Ci0gICAgICAgIExvY2FsUGFyYW1zID0gcEluc3RhbmNlLT5OZXdQYXJhbXM7Ci0gICAgICAgIHBJbnN0YW5jZS0+SG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ewotICAgICAgICBMVk1fU2V0VHJlYmxlQm9vc3QocEluc3RhbmNlLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgJkxvY2FsUGFyYW1zKTsKLSAgICB9Ci0KLSAgICAvKgotICAgICAqIFVwZGF0ZSB0aGUgaGVhZHJvb20gaWYgcmVxdWlyZWQKLSAgICAgKi8KLSAgICAgICAgTFZNX1NldEhlYWRyb29tKHBJbnN0YW5jZSwgICAgICAgICAgICAgICAgICAgICAgLyogSW5zdGFuY2UgcG9pbnRlciAqLwotICAgICAgICAgICAgICAgICAgICAgICAgJkxvY2FsUGFyYW1zKTsgICAgICAgICAgICAgICAgICAvKiBOZXcgcGFyYW1ldGVycyAqLwotCi0gICAgLyoKLSAgICAgKiBVcGRhdGUgdGhlIHZvbHVtZSBpZiByZXF1aXJlZAotICAgICAqLwotICAgIHsKLSAgICAgICAgTFZNX1NldFZvbHVtZShwSW5zdGFuY2UsICAgICAgICAgICAgICAgICAgICAgIC8qIEluc3RhbmNlIHBvaW50ZXIgKi8KLSAgICAgICAgICAgICAgICAgICAgICAmTG9jYWxQYXJhbXMpOyAgICAgICAgICAgICAgICAgIC8qIE5ldyBwYXJhbWV0ZXJzICovCi0gICAgfQotICAgIC8qIEFwcGx5IGJhbGFuY2UgY2hhbmdlcyovCi0gICAgaWYocEluc3RhbmNlLT5QYXJhbXMuVkNfQmFsYW5jZSAhPSBMb2NhbFBhcmFtcy5WQ19CYWxhbmNlKQotICAgIHsKLSAgICAgICAgLyogQ29uZmlndXJlIE1peGVyIG1vZHVsZSBmb3IgZ3JhZHVhbCBjaGFuZ2VzIHRvIHZvbHVtZSovCi0gICAgICAgIGlmKExvY2FsUGFyYW1zLlZDX0JhbGFuY2UgPCAwKQotICAgICAgICB7Ci0gICAgICAgICAgICBMVk1fSU5UMzIgVGFyZ2V0OwotICAgICAgICAgICAgLyogRHJvcCBpbiByaWdodCBjaGFubmVsIHZvbHVtZSovCi0gICAgICAgICAgICBUYXJnZXQgPSBMVk1fT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JFX0VmZmVjdExldmVsOwotICAgICAgICBEQkVfUGFyYW1zLkNlbnRyZUZyZXF1ZW5jeSAgPSAoTFZEQkVfQ2VudHJlRnJlcV9lbilMb2NhbFBhcmFtcy5CRV9DZW50cmVGcmVxOwotICAgICAgICBEQkVfUGFyYW1zLkhQRlNlbGVjdCAgICAgICAgPSAoTFZEQkVfRmlsdGVyU2VsZWN0X2VuKUxvY2FsUGFyYW1zLkJFX0hQRjsKLSAgICAgICAgREJFX1BhcmFtcy5IZWFkcm9vbWRCICAgICAgID0gMDsKLSAgICAgICAgREJFX1BhcmFtcy5Wb2x1bWVDb250cm9sICAgID0gTFZEQkVfVk9MVU1FX09GRjsKLSAgICAgICAgREJFX1BhcmFtcy5Wb2x1bWVkQiAgICAgICAgID0gMDsKLQotICAgICAgICAvKgotICAgICAgICAgKiBNYWtlIHRoZSBjaGFuZ2VzCi0gICAgICAgICAqLwotICAgICAgICBEQkVfU3RhdHVzID0gTFZEQkVfQ29udHJvbChoREJFSW5zdGFuY2UsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICZEQkVfUGFyYW1zKTsKLQotCi0gICAgICAgIC8qCi0gICAgICAgICAqIFF1aXQgaWYgdGhlIGNoYW5nZXMgd2VyZSBub3QgYWNjZXB0ZWQKLSAgICAgICAgICovCi0gICAgICAgIGlmIChEQkVfU3RhdHVzICE9IExWREJFX1NVQ0NFU1MpCi0gICAgICAgIHsKLSAgICAgICAgICAgIHJldHVybigoTFZNX1JldHVyblN0YXR1c19lbilEQkVfU3RhdHVzKTsKLSAgICAgICAgfQotCi0KLSAgICAgICAgLyoKLSAgICAgICAgICogU2V0IHRoZSBjb250cm9sIGZsYWcKLSAgICAgICAgICovCi0gICAgICAgIHBJbnN0YW5jZS0+REJFX0FjdGl2ZSA9IExWTV9UUlVFOwotICAgIH0KLQotICAgIC8qCi0gICAgICogVXBkYXRlIHRoZSBOLUJhbmQgRXF1YWxpc2VyCi0gICAgICovCi0gICAgewotICAgICA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ICAgICAgICAgICBFUU5CX1BhcmFtcy5Tb3VyY2VGb3JtYXQgPSBMVkVRTkJfU1RFUkVPOwotICAgICAgICB9Ci0gICAgICAgIGVsc2UKLSAgICAgICAgewotICAgICAgICAgICAgRVFOQl9QYXJhbXMuU291cmNlRm9ybWF0ID0gTFZFUU5CX01PTk9JTlNURVJFTzsgICAgIC8qIEZvcmNlIHRvIE1vbm8taW4tU3RlcmVvIG1vZGUgKi8KLSAgICAgICAgfQotCi0KLSAgICAgICAgLyoKLSAgICAgICAgICogU2V0IHRoZSBjb250cm9sIGZsYWcKLSAgICAgICAgICovCi0gICAgICAgIGlmICgoTG9jYWxQYXJhbXMuT3BlcmF0aW5nTW9kZSA9PSBMVk1fTU9ERV9PTikgJiYKLSAgICAgICAgICAgIChMb2NhbFBhcmFtcy5FUU5CX09wZXJhdGluZ01vZGUgPT0gTFZNX0VRTkJfT04pKQotICAgICAgICB7Ci0gICAgICAgICAgICBwSW5zdGFuY2UtPkVRTkJfQWN0aXZlID0gTFZNX1RSVUU7Ci0gICAgICAgIH0KLSAgICAgICAgZWxzZQotICAgICAgICB7Ci0gICAgICAgICAgICBFUU5CX1BhcmFtcy5PcGVyYXRpbmdNb2RlID0gTFZFUU5CX0JZUEFTUzsKLSAgICAgICAgfQotCi0gICAgICAgIC8qCi0gICAgICAgICAqIE1ha2UgdGhlIGNoYW5nZXMKLSAgICAgICAgICovCi0gICAgICAgIEVRTkJfU3RhdHVzID0gTFZFUU5CX0NvbnRyb2woaEVRTkJJbnN0YW5jZSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmRVFOQl9QYXJhbXMpOwotCi0KLSAgICAgICAgLyoKLSAgICAgICAgICogUXVpdCBpZiB0aGUgY2hhbmdlcyB3ZXJlIG5vdCBhY2NlcHRlZAotICAgICAgICAgKi8KLSAgICAgICAgaWYgKEVRTkJfU3RhdHVzICE9IExWRVFOQl9TVUNDRVNTKQotICAgICAgICB7Ci0gICAgICAgICAgICByZXR1cm4oKExWTV9SZXR1cm5TdGF0dXNfZW4pRVFOQl9TdGF0dXMpOwotICAgICAgICB9Ci0KLSAgICB9Ci0KLQotICAgIC8qCi0gICAgICogVXBkYXRlIGNvbmNlcnQgc291bmQKLSAgICAgKi8KLSAgICB7Ci0gICAgICAgIExWQ1NfUmV0dXJuU3RhdHVzX2VuICAgICAgICBDU19TdGF0dXM7Ci0gICAgICAgIExWQ1NfUGFyYW1zX3QgICAgICAgICAgICAgICBDU19QYXJhbXM7Ci0gICAgICAgIExWQ1NfSGFuZGxlX3QgICAgICAgICAgICAgICAqaENTSW5zdGFuY2UgPSBwSW5zdGFuY2UtPmhDU0luc3RhbmNlOwotICAgICAgICBMVk1fTW9kZV9lbiAgICAgICAgICAgICAgICAgQ29tcHJlc3Nvck1vZGU9TFZNX01PREVfT047Ci0KLSAgICAgICAgLyoKLSAgICAgICAgICogU2V0IHRoZSBuZXcgcGFyYW1ldGVycwotICAgICAgICAgKi8KLSAgICAgICAgaWYoTG9jYWxQYXJhbXMuVmlydHVhbGl6ZXJPcGVyYXRpbmdNb2RlID09IExWTV9NT0RFX09OKQotICAgICAgICB7Ci0gICAgICAgICAgICBDU19QYXJhbXMuT3BlcmF0aW5nTW9kZSAgICA9IExWQ1NfT047Ci0gICAgICAgIH0KLSAgICAgICAgZWxzZQotICAgICAgICB7Ci0gICAgICAgICAgICBDU19QYXJhbXMuT3BlcmF0aW5nTW9kZSAgICA9IExWQ1NfT0ZGOwotICAgICAgICB9Ci0KLSAgICAgICAgaWYoKExvY2FsUGFyYW1zLlRFX09wZXJhdGluZ01vZGUgPT0gTFZNX1RFX09OKSAmJiAoTG9jYWxQYXJhbXMuVEVfRWZmZWN0TGV2ZWwgPT0gTFZNX1RFX0xPV19NSVBTKSkKLSAgICAgICAgewotICAgICAgICAgICAgQ1NfUGFyYW1zLlNwZWFrZXJUeXBlICA9IExWQ1NfRVhfSEVBRFBIT05FUzsKLSAgICAgICAgfQotICAgICAgICBlbHNlCi0gIC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gICB7Ci0gICAgICAgICAgICBDU19QYXJhbXMuT3BlcmF0aW5nTW9kZSA9IExWQ1NfT0ZGOwotICAgICAgICB9Ci0KLSAgICAgICAgQ1NfUGFyYW1zLkNvbXByZXNzb3JNb2RlPUNvbXByZXNzb3JNb2RlOwotCi0gICAgICAgIC8qCi0gICAgICAgICAqIE1ha2UgdGhlIGNoYW5nZXMKLSAgICAgICAgICovCi0gICAgICAgIENTX1N0YXR1cyA9IExWQ1NfQ29udHJvbChoQ1NJbnN0YW5jZSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICZDU19QYXJhbXMpOwotCi0KLSAgICAgICAgLyoKLSAgICAgICAgICogUXVpdCBpZiB0aGUgY2hhbmdlcyB3ZXJlIG5vdCBhY2NlcHRlZAotICAgICAgICAgKi8KLSAgICAgICAgaWYgKENTX1N0YXR1cyAhPSBMVkNTX1NVQ0NFU1MpCi0gICAgICAgIHsKLSAgICAgICAgICAgIHJldHVybigoTFZNX1JldHVyblN0YXR1c19lbilDU19TdGF0dXMpOwotICAgICAgICB9Ci0KLSAgICB9Ci0KLSAgICAvKgotICAgICAqIFVwZGF0ZSB0aGUgUG93ZXIgU3BlY3RydW0gQW5hbHlzZXIKLSAgICAgKi8KLSAgICB7Ci0gICAgICAgIExWUFNBX1JFVFVSTiAgICAgICAgICAgICAgICBQU0FfU3RhdHVzOwotICAgICAgICBMVlBTQV9Db250cm9sUGFyYW1zX3QgICAgICAgUFNBX1BhcmFtczsKLSAgICAgICAgcExWUFNBX0hhbmRsZV90ICAgICAgICAgICAgICpoUFNBSW5zdGFuY2UgPSBwSW5zdGFuY2UtPmhQU0FJbnN0YW5jZTsKLQotCi0gICAgICAgIC8qCi0gICAgICAgICAqIFNldCB0aGUgbmV3IHBhcmFtZXRlcnMKLSAgICAgICAgICovCi0gICAgICAgIFBTQV9QYXJhbXMuRnMgPSBMb2NhbFBhcmFtcy5TYW1wbGVSYXRlOwotICAgICAgICBQU0FfUGFyYW1zLkxldmVsRGV0ZWN0aW9uU3BlZWQgPSAoTFZQU0FfTGV2ZWxEZXRlY3RTcGVlZF9lbilMb2NhbFBhcmFtcy5QU0FfUGVha0RlY2F5UmF0ZTsKLQotICAgICAgICAvKgotICAgICAgICAgKiBNYWtlIHRoZSBjaGFuZ2VzCi0gICAgICAgICAqLwotICAgICAgICBpZihwSW5zdGFuY2UtPkluc3RQYXJhbXMuUFNBX0luY2x1ZGVkPT1MVk1fUFNBX09OKQotICAgICAgICB7Ci0gICAgICAgICAgICBQU0FfU3RhdHVzID0gTFZQU0FfQ29udHJvbChoUFNBSW5zdGFuY2UsCi0gICAgICAgICAgICAgICAgJlBTQV9QYXJhbXMpOwotCi0gICAgICAgICAgICBpZiAoUFNBX1N0YXR1cyAhPSBMVlBTQV9PSykKLSAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICByZXR1cm4oKExWTV9SZXR1cm5TdGF0dXNfZW4pUFNBX1N0YXR1cyk7Ci0gICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgIC8qCi0gICAgICAgICAgICAgKiBBcHBseSBuZXcgc2V0dGluZ3MKLSAgICAgICAgICAgICAqLwotICAgICAgICAgICAgUFNBX1N0YXR1cyA9IExWUFNBX0FwcGx5TmV3U2V0dGluZ3MgKChMVlBTQV9JbnN0YW5jZVByX3QqKWhQU0FJbnN0YW5jZSk7Ci0gICAgICAgICAgICBpZihQU0FfU3RhdHVzICE9IExWUFNBX09LKQotICAgICAgICAgICAgewotICAgICAgICAgICAgICAgIHJldHVybigoTFZNX1JldHVyblN0YXR1c19lbilQU0FfU3RhdHVzKTsKLSAgICAgICAgICAgIH0KLSAgICAgICAgfQotICAgIH0KLQotICAgIC8qCi0gICAgICogVXBkYXRlIHRoZSBwYXJhbWV0ZXJzIGFuZCBjbGVhciB0aGUgZmxhZwotICAgICAqLwotICAgIHBJbnN0YW5jZS0+Tm9TbW9vdGhWb2x1bWUgPSBMVk1fRkFMU0U7Ci0gICAgcEluc3RhbmNlLT5QYXJhbXMgPSAgTG9jYWxQYXJhbXM7Ci0KLQotICAgIHJldHVybihMVk1fU1VDQ0VTUyk7Ci19Ci0KLQotLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0vKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qIEZVTkNUSU9OOiAgICAgICAgICAgICAgICBMVk1fU2V0SGVhZHJvb21QYXJhbXMgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiBERVNDUklQVElPTjogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICBUaGlzIGZ1bmN0aW9uIGlzIHVzZWQgdG8gc2V0IHRoZSBhdXRvbWF0aXVjIGhlYWRyb29tIG1hbmFnZW1lbnQgcGFyYW1ldGVycy4gICAgICAgICAqLwotLyogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiBQQVJBTUVURVJTOiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICBoSW5zdGFuY2UgICAgICAgICAgICAgICBJbnN0YW5jZSBIYW5kbGUgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogIHBIZWFkcm9vbVBhcmFtcyAgICAgICAgIFBvaW50ZXIgdG8gaGVhZHJvb20gcGFyYW1ldGVyIHN0cnVjdHVyZSAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qIFJFVFVSTlM6ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogIExWTV9TdWNjZXNzICAgICAgICAgICAgIFN1Y2NlZWRlZCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qIE5PVEVTOiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogIDEuICBUaGlzIGZ1bmN0aW9uIG1heSBiZSBpbnRlcnJ1cHRlZCBieSB0aGUgTFZNX1Byb2Nlc3MgZnVuY3Rpb24gICAgICAgICAgICAgICAgICAgICovCi0vKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotCi1MVk1fUmV0dXJuU3RhdHVzX2VuIExWTV9TZXRIZWFkcm9vbVBhcmFtcyhMVk1fSGFuZGxlX3QgICAgICAgICAgICAgIGhJbnN0YW5jZSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIExWTV9IZWFkcm9vbVBhcmFtc190ICAgICAgKnBIZWFkcm9vbVBhcmF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AgIHBJbnN0YW5jZS0+cEhlYWRyb29tX0JhbmREZWZzW2lpXSA9IHBIZWFkcm9vbVBhcmFtcy0+cEhlYWRyb29tRGVmaW5pdGlvbltpaV07Ci0gICAgfQotCi0gICAgcEluc3RhbmNlLT5OZXdIZWFkcm9vbVBhcmFtcy5wSGVhZHJvb21EZWZpbml0aW9uID0gcEluc3RhbmNlLT5wSGVhZHJvb21fQmFuZERlZnM7Ci0gICAgcEluc3RhbmNlLT5OZXdIZWFkcm9vbVBhcmFtcy5IZWFkcm9vbV9PcGVyYXRpbmdNb2RlID0gcEhlYWRyb29tUGFyYW1zLT5IZWFkcm9vbV9PcGVyYXRpbmdNb2RlOwotICAgIHBJbnN0YW5jZS0+Q29udHJvbFBlbmRpbmcgPSBMVk1fVFJVRTsKLQotICAgIHJldHVybihMVk1fU1VDQ0VTUyk7Ci19Ci0KLS8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotLyogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiBGVU5DVElPTjogICAgICAgICAgICAgICAgTFZNX0dldEhlYWRyb29tUGFyYW1zICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogREVTQ1JJUFRJT046ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgVGhpcyBmdW5jdGlvbiBpcyB1c2VkIHRvIGdldCB0aGUgYXV0b21hdGljIGhlYWRyb29tIG1hbmFnZW1lbnQgcGFyYW1ldGVycy4gICAgICAgICAgKi8KLS8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogUEFSQU1FVEVSUzogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgaEluc3RhbmNlICAgICAgICAgICAgICAgSW5zdGFuY2UgSGFuZGxlICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICBwSGVhZHJvb21QYXJhbXMgICAgICAgICBQb2ludGVyIHRvIGhlYWRyb29tIHBhcmFtZXRlciBzdHJ1Y3R1cmUgKG91dHB1dCkgICAgICAgICAgICAqLwotLyogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiBSRVRVUk5TOiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICBMVk1fU1VDQ0VTUyAgICAgICAgICAgICBTdWNjZWVkZWQgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogIExWTV9OVUxMQUREUkVTUyAgICAgICAgIFdoZW4gaEluc3RhbmNlIG9yIHBIZWFkcm9vbVBhcmFtcyBhcmUgTlVMTCAgICAgICAgICAgICAgICAgICovCi0vKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qIE5PVEVTOiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogIDEuICBUaGlzIGZ1bmN0aW9uIG1heSBiZSBpbnRlcnJ1cHRlZCBieSB0aGUgTFZNX1Byb2Nlc3MgZnVuY3Rpb24gICAgICAgICAgICAgICAgICAgICovCi0vKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotCi1MVk1fUmV0dXJuU3RhdHVzX2VuIExWTV9HZXRIZWFkcm9vbVBhcmFtcyhMVk1fSGFuZGxlX3QgICAgICAgICAgaEluc3RhbmNlLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTFZNX0hlYWRyb29tUGFyYW1zX3QgICpwSGVhZHJvb21QYXJhbXMpCi17Ci0gICAgTFZNX0luc3RhbmNlX3QgICAgICAqcEluc3RhbmNlID0oTFZNX0luc3RhbmNlX3QgICopaEluc3RhbmNlOwotICAgIExWTV9VSU5UMTYgICAgICAgICAgaWk7Ci0KLSAgICAvKiBDaGVjayBmb3IgTlVMTCBwb2ludGVycyAqLwotICAgIGlmICgoaEluc3RhbmNlID09IExWTV9OVUxMKSB8fCAocEhlYWRyb29tUGFyYW1zID09IExWTV9OVUxMKSkKLSAgICB7Ci0gICAgICAgIHJldHVybiAoTFZNX05VTExBRERSRVNTKTsKLSAgICB9Ci0KLSAgICBwSGVhZHJvb21QYXJhbXMtPk5IZWFkcm9vbUJhbmRzID0gcEluc3RhbmNlLT5OZXdIZWFkcm9vbVBhcmFtcy5OSGVhZHJvb21CYW5kczsKLQotCi0gICAgLyogQ29weSBzZXR0aW5ncyBpbiBtZW1vcnkgKi8KLSAgICBmb3IoaWkgPSAwOyBpaSA8IHBJbnN0YW5jZS0+TmV3SGVhZHJvb21QYXJhbXMuTkhlYWRyb29tQmFuZHM7IGlpKyspCi0gICAgewotICAgICAgICBwSW5zdGFuY2UtPnBIZWFkcm9vbV9Vc2VyRGVmc1tpaV0gPSBwSW5zdGFuY2UtPnBIZWFkcm9vbV9CYW5kRGVmc1tpaV07Ci0gICAgfQotCi0KLSAgICBwSGVhZHJvb21QYXJhbXMtPnBIZWFkcm9vbURlZmluaXRpb24gPSBwSW5zdGFuY2UtPnBIZWFkcm9vbV9Vc2VyRGVmczsKLSAgICBwSGVhZHJvb21QYXJhbXMtPkhlYWRyb29tX09wZXJhdGluZ01vZGUgPSBwSW5zdGFuY2UtPk5ld0hlYWRyb29tUGFyYW1zLkhlYWRyb29tX09wZXJhdGluZ01vZGU7Ci0gICAgcmV0dXJuKExWTV9TVUNDRVNTKTsKLX0KLQotLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0vKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qIEZVTkNUSU9OOiAgICAgICAgICAgICAgICBMVk1fQWxnb0NhbGxCYWNrICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiBERVNDUklQVElPTjogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICBUaGlzIGlzIHRoZSBjYWxsYmFjayBmdW5jdGlvbiBvZiB0aGUgYWxnb3JpdGhtLiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiBQQVJBTUVURVJTOiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICBwQnVuZGxlSGFuZGxlICAgICAgICAgICBQb2ludGVyIHRvIHRoZSBJbnN0YW5jZSBIYW5kbGUgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogIHBEYXRhICAgICAgICAgICAgICAgICAgIFBvaW50ZXIgdG8gdGhlIGRhdGEgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgY2FsbGJhY2tJZCAgICAgICAgICAgICAgSUQgb2YgdGhlIGNhbGxiYWNrICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogTk9URVM6ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgMS4gIFRoaXMgZnVuY3Rpb24gbWF5IGJlIGludGVycnVwdGVkIGJ5IHRoZSBMVk1fUHJvY2VzcyBmdW5jdGlvbiAgICAgICAgICAgICAgICAgICAgKi8KLS8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi1MVk1fSU5UMzIgTFZNX0FsZ29DYWxsQmFjayggdm9pZCAgICAgICAgICAqcEJ1bmRsZUhhbmRsZSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICB2b2lkICAgICAgICAgICpwRGF0YSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBMVk1fSU5UMTYgICAgIGNhbGxiYWNrSWQpCi17Ci0gICAgTFZNX0luc3RhbmNlX3QgICAgICAqcEluc3RhbmNlID0oTFZNX0luc3RhbmNlX3QgICopcEJ1bmRsZUhhbmRsZTsKLQotICAgICh2b2lkKSBwRGF0YTsKLQotICAgIHN3aXRjaChjYWxsYmFja0lkICYgMHhGRjAwKXsKLSAgICAgICAgY2FzZSBBTEdPUklUSE1fQ1NfSUQ6Ci0gICAgICAgICAgICBzd2l0Y2goY2FsbGJhY2tJZCAmIDB4MDBGRikKLSAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICBjYXNlIExWQ1NfRVZFTlRfQUxHT0ZGOgotICAgICAgICAgICAgICAgICAgICBwSW5zdGFuY2UtPkNTX0FjdGl2ZSA9IExWTV9GQUxTRTsKLSAgICAgICAgICAgICAgICAgICAgYnJlYWs7Ci0gICAgICAgICAgICAgICAgZGVmYXVsdDoKLSAgICAgICAgICAgICAgICAgICAgYnJlYWs7Ci0gICAgICAgICAgICB9Ci0gICAgICAgICAgICBicmVhazsKLSAgICAgICAgY2FzZSBBTEdPUklUSE1fRVFOQl9JRDoKLSAgICAgICAgICAgIHN3aXRjaChjYWxsYmFja0lkICYgMHgwMEZGKQotICAgICAgICAgICAgewotICAgICAgICAgICAgICAgIGNhc2UgTFZFUU5CX0VWRU5UX0FMR09GRjoKLSAgICAgICAgICAgICAgICAgICAgcEluc3RhbmNlLT5FUU5CX0FjdGl2ZSA9IExWTV9GQUxTRTsKLSAgICAgICAgICAgICAgICAgICAgYnJlYWs7Ci0gICAgICAgICAgICAgICAgZGVmYXVsdDoKLSAgICAgICAgICAgICAgICAgICAgYnJlYWs7Ci0gICAgICAgICAgICB9Ci0gICAgICAgICAgICBicmVhazsKLSAgICAgICAgZGVmYXVsdDoKLSAgICAgICAgICAgIGJyZWFrOwotICAgIH0KLQotICAgIHJldHVybiAwOwotfQotCi0vKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLS8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogRlVOQ1RJT046ICAgICAgICAgICAgICAgIExWTV9WQ0NhbGxCYWNrICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qIERFU0NSSVBUSU9OOiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogIFRoaXMgaXMgdGhlIGNhbGxiYWNrIGZ1bmN0aW9uIG9mIHRoZSBWb2x1bWUgY29udHJvbC4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qIFBBUkFNRVRFUlM6ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogIHBCdW5kbGVIYW5kbGUgICAgICAgICAgIFBvaW50ZXIgdG8gdGhlIEluc3RhbmNlIEhhbmRsZSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgcEdlbmVyYWxQdXJwb3NlICAgICAgICAgUG9pbnRlciB0byB0aGUgZGF0YSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICBDYWxsQmFja1BhcmFtICAgICAgICAgICBJRCBvZiB0aGUgY2FsbGJhY2sgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiBOT1RFUzogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICAxLiAgVGhpcyBmdW5jdGlvbiBtYXkgYmUgaW50ZXJydXB0ZWQgYnkgdGhlIExWTV9Qcm9jZXNzIGZ1bmN0aW9uICAgICAgICAgICAgICAgICAgICAqLwotLyogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLUxWTV9JTlQzMiAgICBMVk1fVkNDYWxsQmFjayh2b2lkKiAgIHBCdW5kbGVIYW5kbGUsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgdm9pZCogICBwR2VuZXJhbFB1cnBvc2UsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgc2hvcnQgICBDYWxsQmFja1BhcmFtKQotewotICAgIExWTV9JbnN0YW5jZV90ICpwSW5zdGFuY2UgPShMVk1fSW5zdGFuY2VfdCAgKilwQnVuZGxlSGFuZGxlOwotICAgIExWTV9JTlQzMiAgICBUYXJnZXQ7Ci0KLSAgICAodm9pZCkgcEdlbmVyYWxQdXJwb3NlOwotICAgICh2b2lkKSBDYWxsQmFja1BhcmFtOwotCi0gICAgLyogV2hlbiB2b2x1bWUgbWl4ZXIgaGFzIHJlYWNoZWQgMCBkQiB0YXJnZXQgdGhlbiBzdG9wIG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Ci0gKiBVbmxlc3MgcmVxdWlyZWQgYnkgYXBwbGljYWJsZSBsYXcgb3IgYWdyZWVkIHRvIGluIHdyaXRpbmcsIHNvZnR3YXJlCi0gKiBkaXN0cmlidXRlZCB1bmRlciB0aGUgTGljZW5zZSBpcyBkaXN0cmlidXRlZCBvbiBhbiAiQVMgSVMiIEJBU0lTLAotICogV0lUSE9VVCBXQVJSQU5USUVTIE9SIENPTkRJVElPTlMgT0YgQU5ZIEtJTkQsIGVpdGhlciBleHByZXNzIG9yIGltcGxpZWQuCi0gKiBTZWUgdGhlIExpY2Vuc2UgZm9yIHRoZSBzcGVjaWZpYyBsYW5ndWFnZSBnb3Zlcm5pbmcgcGVybWlzc2lvbnMgYW5kCi0gKiBsaW1pdGF0aW9ucyB1bmRlciB0aGUgTGljZW5zZS4KLSAqLwotCi0vKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotLyogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICBJbmNsdWRlcyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLQotI2luY2x1ZGUgIkxWTV9Qcml2YXRlLmgiCi0jaW5jbHVkZSAiTFZNX1RhYmxlcy5oIgotI2luY2x1ZGUgIlZlY3RvckFyaXRobWV0aWMuaCIKLSNpbmNsdWRlICJJbnN0QWxsb2MuaCIKLQotLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0vKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qIEZVTkNUSU9OOiAgICAgICAgICAgICAgICBMVk1fR2V0TWVtb3J5VGFibGUgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiBERVNDUklQVElPTjogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICBUaGlzIGZ1bmN0aW9uIGlzIHVzZWQgZm9yIG1lbW9yeSBhbGxvY2F0aW9uIGFuZCBmcmVlLiBJdCBjYW4gYmUgY2FsbGVkIGluICAgICAgICAgICAqLwotLyogIHR3byB3YXlzOiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICAgICAgaEluc3RhbmNlID0gTlVMTCAgICAgICAgICAgICAgICBSZXR1cm5zIHRoZSBtZW1vcnkgcmVxdWlyZW1lbnRzICAgICAgICAgICAgICAgICAqLwotLyogICAgICBoSW5zdGFuY2UgPSBJbnN0YW5jZSBoYW5kbGUgICAgIFJldHVybnMgdGhlIG1lbW9yeSByZXF1aXJlbWVudHMgYW5kICAgICAgICAgICAgICovCi0vKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYWxsb2NhdGVkIGJhc2UgYWRkcmVzc2VzIGZvciB0aGUgaW5zdGFuY2UgICAgICAgKi8KLS8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogIFdoZW4gdGhpcyBmdW5jdGlvbiBpcyBjYWxsZWQgZm9yIG1lbW9yeSBhbGxvY2F0aW9uIChoSW5zdGFuY2U9TlVMTCkgdGhlIG1lbW9yeSAgICAgICovCi0vKiAgYmFzZSBhZGRyZXNzIHBvaW50ZXJzIGFyZSBOVUxMIG9uIHJldHVybi4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogIFdoZW4gdGhlIGZ1bmN0aW9uIGlzIGNhbGxlZCBmb3IgZnJlZSAoaEluc3RhbmNlID0gSW5zdGFuY2UgSGFuZGxlKSB0aGUgbWVtb3J5ICAgICAgICovCi0vKiAgdGFibGUgcmV0dXJucyB0aGUgYWxsb2NhdGVkIG1lbW9yeSBhbmQgYmFzZSBhZGRyZXNzZXMgdXNlZCBkdXJpbmcgaW5pdGlhbGlzYXRpb24uICAgKi8KLS8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogUEFSQU1FVEVSUzogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgaEluc3RhbmNlICAgICAgICAgICAgICAgSW5zdGFuY2UgSGFuZGxlICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICBwTWVtb3J5VGFibGUgICAgICAgICAgICBQb2ludGVyIHRvIGFuIGVtcHR5IG1lbW9yeSBkZWZpbml0aW9uIHRhYmxlICAgICAgICAgICAgICAgICAqLwotLyogIHBDYXBhYmlsaXRpZXMgICAgICAgICAgIFBvaW50ZXIgdG8gdGhlIGRlZmF1bHQgY2FwYWJpbGl0aWVzICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qIFJFVFVSTlM6ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogIExWTV9TVUNDRVNTICAgICAgICAgICAgIFN1Y2NlZWRlZCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgTFZNX05VTExBRERSRVNTICAgICAgICAgV2hlbiBvbmUgb2YgcE1lbW9yeVRhYmxlIG9yIHBJbnN0UGFyYW1zIGlzIE5VTEwgICAgICAgICAgICAgKi8KLS8qICBMVk1fT1VUT0ZSQU5HRSAgICAgICAgICBXaGVuIGFueSBvZiB0aGUgSW5zdGFuY2UgcGFyYW1ldGVycyBhcmUgb3V0IG9mIHJhbmdlICAgICAgICAqLwotLyogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiBOT1RFUzogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICAxLiAgVGhpcyBmdW5jdGlvbiBtYXkgYmUgaW50ZXJydXB0ZWQgYnkgdGhlIExWTV9Qcm9jZXNzIGZ1bmN0aW9uICAgICAgICAgICAgICAgICAgICAqLwotLyogIDIuICBUaGUgc2NyYXRjaCBtZW1vcnkgaXMgdGhlIGxhcmdlc3QgcmVxdWlyZWQgYnkgYW55IG9mIHRoZSBzdWItbW9kdWxlcyBwbHVzIGFueSAgICovCi0vKiAgICAgIGFkZGl0aW9uYWwgc2NyYXRjaCByZXF1aXJlbWVudHMgb2YgdGhlIGJ1bmRsZSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0KLUxWTV9SZXR1cm5TdGF0dXNfZW4gTFZNX0dldE1lbW9yeVRhYmxlKExWTV9IYW5kbGVfdCAgICAgICAgIGhJbnN0YW5jZSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIExWTV9NZW1UYWJfdCAgICAgICAgICpwTWVtb3J5VGFibGUsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBMVk1fSW5zdFBhcmFtc190ICAgICAqcEluc3RQYXJhbXMpCi17Ci0KLSAgICBMVk1fSW5zdGFuY2VfdCAgICAgICpwSW5zdGFuY2UgPSAoTFZNX0luc3RhbmNlX3QgKiloSW5zdGFuY2U7Ci0gICAgTFZNX1VJTlQzMiAgICAgICAgICBBbGdTY3JhdGNoU2l6ZTsKLSAgICBMVk1fVUlOVDMyICAgICAgICAgIEJ1bmRsZVNjcmF0Y2hTaXplOwotICAgIExWTV9VSU5UMTYgICAgICAgICAgSW50ZXJuYWxCbG9ja1NpemU7Ci0gICAgSU5TVF9BTExPQyAgICAgICAgICBBbGxvY01lbVtMVk1fTlJfTUVNT1JZX1JFR0lPTlNdOwotICAgIExWTV9JTlQxNiAgICAgICAgICAgaTs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ci0gICAgSW5zdEFsbG9jX0FkZE1lbWJlcigmQWxsb2NNZW1bTFZNX01FTVJFR0lPTl9QRVJTSVNURU5UX0ZBU1RfREFUQV0sICAgICAgLyogVXNlciBzdG9yYWdlICovCi0gICAgICAgICAgICAgICAgICAgICAgICAocEluc3RQYXJhbXMtPkVRTkJfTnVtQmFuZHMgKiBzaXplb2YoTFZNX0VRTkJfQmFuZERlZl90KSkpOwotCi0gICAgLyoKLSAgICAgKiBDb25jZXJ0IFNvdW5kIHJlcXVpcmVtZW50cwotICAgICAqLwotICAgIHsKLSAgICAgICAgTFZDU19NZW1UYWJfdCAgICAgICAgICAgQ1NfTWVtVGFiOwotICAgICAgICBMVkNTX0NhcGFiaWxpdGllc190ICAgICBDU19DYXBhYmlsaXRpZXM7Ci0KLSAgICAgICAgLyoKLSAgICAgICAgICogU2V0IHRoZSBjYXBhYmlsaXRpZXMKLSAgICAgICAgICovCi0gICAgICAgIENTX0NhcGFiaWxpdGllcy5NYXhCbG9ja1NpemUgICAgID0gSW50ZXJuYWxCbG9ja1NpemU7Ci0KLSAgICAgICAgLyoKLSAgICAgICAgICogR2V0IHRoZSBtZW1vcnkgcmVxdWlyZW1lbnRzCi0gICAgICAgICAqLwotICAgICAgICBMVkNTX01lbW9yeShMVk1fTlVMTCwKLSAgICAgICAgICAgICAgICAgICAgJkNTX01lbVRhYiwKLSAgICAgICAgICAgICAgICAgICAgJkNTX0NhcGFiaWxpdGllcyk7Ci0KLSAgICAgICAgLyoKLSAgICAgICAgICogVXBkYXRlIHRoZSBtZW1vcnkgYWxsb2NhdGlvbiBzdHJ1Y3R1cmVzCi0gICAgICAgICAqLwotICAgICAgICBJbnN0QWxsb2NfQWRkTWVtYmVyKCZBbGxvY01lbVtMVk1fTUVNUkVHSU9OX1BFUlNJU1RFTlRfRkFTVF9EQVRBXSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBDU19NZW1UYWIuUmVnaW9uW0xWTV9NRU1SRUdJT05fUEVSU0lTVE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TAwMDsKLSAgICAgICAgICAgIFBTQV9Jbml0UGFyYW1zLm5CYW5kcyAgICAgICAgICAgICAgICAgICAgICAgPSAoTFZNX1VJTlQxNikgOTsKLQotICAgICAgICAgICAgUFNBX0luaXRQYXJhbXMucEZpbHRlcnNQYXJhbXMgPSAmRmlsdGVyc1BhcmFtc1swXTsKLSAgICAgICAgICAgIGZvcihpID0gMDsgaSA8IFBTQV9Jbml0UGFyYW1zLm5CYW5kczsgaSsrKQotICAgICAgICAgICAgewotICAgICAgICAgICAgICAgIEZpbHRlcnNQYXJhbXNbaV0uQ2VudGVyRnJlcXVlbmN5ICAgID0gKExWTV9VSU5UMTYpIDEwMDA7Ci0gICAgICAgICAgICAgICAgRmlsdGVyc1BhcmFtc1tpXS5RRmFjdG9yICAgICAgICAgICAgPSAoTFZNX1VJTlQxNikgMjU7Ci0gICAgICAgICAgICAgICAgRmlsdGVyc1BhcmFtc1tpXS5Qb3N0R2FpbiAgICAgICAgICAgPSAoTFZNX0lOVDE2KSAgMDsKLSAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgLyoKLSAgICAgICAgICAgICogR2V0IHRoZSBtZW1vcnkgcmVxdWlyZW1lbnRzCi0gICAgICAgICAgICAqLwotICAgICAgICAgICAgUFNBX1N0YXR1cyA9IExWUFNBX01lbW9yeSAoaFBTQUluc3QsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJlBTQV9NZW1UYWIsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJlBTQV9Jbml0UGFyYW1zKTsKLQotICAgICAgICAgICAgaWYgKFBTQV9TdGF0dXMgIT0gTFZQU0FfT0spCi0gICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgcmV0dXJuKChMVk1fUmV0dXJuU3RhdHVzX2VuKSBMVk1fQUxHT1JJVEhNUFNBKTsKLSAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgLyoKLSAgICAgICAgICAgICogVXBkYXRlIH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lLT5SZWdpb25bTFZNX01FTVJFR0lPTl9URU1QT1JBUllfRkFTVF0uU2l6ZSAgICAgICAgICAgICA9IEluc3RBbGxvY19HZXRUb3RhbCgmQWxsb2NNZW1bTFZNX01FTVJFR0lPTl9URU1QT1JBUllfRkFTVF0pOwotICAgIHBNZW1vcnlUYWJsZS0+UmVnaW9uW0xWTV9NRU1SRUdJT05fVEVNUE9SQVJZX0ZBU1RdLlR5cGUgICAgICAgICAgICAgPSBMVk1fVEVNUE9SQVJZX0ZBU1Q7Ci0gICAgcE1lbW9yeVRhYmxlLT5SZWdpb25bTFZNX01FTVJFR0lPTl9URU1QT1JBUllfRkFTVF0ucEJhc2VBZGRyZXNzICAgICA9IExWTV9OVUxMOwotICAgIGlmIChwTWVtb3J5VGFibGUtPlJlZ2lvbltMVk1fTUVNUkVHSU9OX1RFTVBPUkFSWV9GQVNUXS5TaXplIDwgNCkKLSAgICB7Ci0gICAgICAgIHBNZW1vcnlUYWJsZS0+UmVnaW9uW0xWTV9NRU1SRUdJT05fVEVNUE9SQVJZX0ZBU1RdLlNpemUgPSAwOwotICAgIH0KLQotICAgIHJldHVybihMVk1fU1VDQ0VTUyk7Ci0KLX0KLQotCi0vKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLS8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogRlVOQ1RJT046ICAgICAgICAgICAgICAgIExWTV9HZXRJbnN0YW5jZUhhbmRsZSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qIERFU0NSSVBUSU9OOiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogIFRoaXMgZnVuY3Rpb24gaXMgdXNlZCB0byBjcmVhdGUgYSBidW5kbGUgaW5zdGFuY2UuIEl0IHJldHVybnMgdGhlIGNyZWF0ZWQgaW5zdGFuY2UgICovCi0vKiAgaGFuZGxlIHRocm91Z2ggcGhJbnN0YW5jZS4gQWxsIHBhcmFtZXRlcnMgYXJlIHNldCB0byB0aGVpciBkZWZhdWx0LCBpbmFjdGl2ZSBzdGF0ZS4gKi8KLS8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogUEFSQU1FVEVSUzogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgcGhJbnN0YW5jZSAgICAgICAgICAgICAgcG9pbnRlciB0byB0aGUgaW5zdGFuY2UgaGFuZGxlICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICBwTWVtb3J5VGFibGUgICAgICAgICAgICBQb2ludGVyIHRvIHRoZSBtZW1vcnkgZGVmaW5pdGlvbiB0YWJsZSAgICAgICAgICAgICAgICAgICAgICAqLwotLyogIHBJbnN0UGFyYW1zICAgICAgICAgICAgIFBvaW50ZXIgdG8gdGhlIGluaXRpYWxpc2F0aW9uIGNhcGFiaWxpdGllcyAgICAgICAgICAgICAgICAgICovCi0vKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qIFJFVFVSTlM6ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogIExWTV9TVUNDRVNTICAgICAgICAgICAgIEluaXRpYWxpc2F0aW9uIHN1Y2NlZWRlZCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgTFZNX09VVE9GUkFOR0UgICAgICAgICAgV2hlbiBhbnkgb2YgdGhlIEluc3RhbmNlIHBhcmFtZXRlcnMgYXJlIG91dCBvZiByYW5nZSAgICAgICAgKi8KLS8qICBMVk1fTlVMTEFERFJFU1MgICAgICAgICBXaGVuIG9uZSBvZiBwaEluc3RhbmNlLCBwTWVtb3J5VGFibGUgb3IgcEluc3RQYXJhbXMgYXJlIE5VTEwqLwotLyogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiBOT1RFUzogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICAxLiBUaGlzIGZ1bmN0aW9uIG11c3Qgbm90IGJlIGludGVycnVwdGVkIGJ5IHRoZSBMVk1fUHJvY2VzcyBmdW5jdGlvbiAgICAgICAgICAgICAgICAqLwotLyogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLQotTFZNX1JldHVyblN0YXR1c19lbiBMVk1fR2V0SW5zdGFuY2VIYW5kbGUoTFZNX0hhbmRsZV90ICAgICAgICAgICAqcGhJbnN0YW5jZSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIExWTV9NZW1UYWJfdCAgICAgICAgICAgKnBNZW1vcnlUYWJsZSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAg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i0gICAgICAgIHBJbnN0YW5jZS0+cEJ1ZmZlck1hbmFnZW1lbnQgPSBJbnN0QWxsb2NfQWRkTWVtYmVyKCZBbGxvY01lbVtMVk1fTUVNUkVHSU9OX1BFUlNJU1RFTlRfU0xPV19EQVRBXSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2l6ZW9mKExWTV9CdWZmZXJfdCkpOwotICAgICAgICBCdW5kbGVTY3JhdGNoU2l6ZSA9IChMVk1fSU5UMzIpKDYgKiAoTUlOX0lOVEVSTkFMX0JMT0NLU0laRSArIEludGVybmFsQmxvY2tTaXplKSAqIHNpemVvZihMVk1fSU5UMTYpKTsKLSAgICAgICAgcEluc3RhbmNlLT5wQnVmZmVyTWFuYWdlbWVudC0+cFNjcmF0Y2ggPSBJbnN0QWxsb2NfQWRkTWVtYmVyKCZBbGxvY01lbVtMVk1fTUVNUkVHSU9OX1RFTVBPUkFSWV9GQVNUXSwgICAvKiBTY3JhdGNoIDEgYnVmZmVyICovCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoTFZNX1VJTlQzMilCdW5kbGVTY3JhdGNoU2l6ZSk7Ci0KLSAgICAgICAgTG9hZENvbnN0XzE2KDAsICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvKiBDbGVhciB0aGUgaW5wdXQgZGVsYXkgYnVmZmVyICovCi0gICAgICAgICAgICAgICAgICAgICAoTFZNX0lOVDE2ICopJnBJbnN0YW5jZS0+cEJ1ZmZlck1hbmFnZW1lbnQtPkluRGVsYXlCdWZmZXIsCi0gICAgICAgICAgICAgICAgICAgICAoTFZNX0lOVDE2KSgyICogTUlOX0lOVEVSTkFMX0JMT0NLU0laRSkpOwotICAgICAgICBwSW5zdGFuY2UtPnBCdWZmZXJNYW5hZ2VtZW50LT5JbkRlbGF5U2F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0ZBU1RfQ09FRl0ucEJhc2VBZGRyZXNzID0gKHZvaWQgKilJbnN0QWxsb2NfQWRkTWVtYmVyKCZBbGxvY01lbVtMVk1fTUVNUkVHSU9OX1BFUlNJU1RFTlRfRkFTVF9DT0VGXSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIENTX01lbVRhYi5SZWdpb25bTFZDU19NRU1SRUdJT05fUEVSU0lTVEVOVF9GQVNUX0NPRUZdLlNpemUpOwotICAgICAgICBDU19NZW1UYWIuUmVnaW9uW0xWQ1NfTUVNUkVHSU9OX1RFTVBPUkFSWV9GQVNUXS5wQmFzZUFkZHJlc3MgICAgICAgPSAodm9pZCAqKUluc3RBbGxvY19BZGRNZW1iZXIoJkFsbG9jTWVtW0xWTV9NRU1SRUdJT05fVEVNUE9SQVJZX0ZBU1RdLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMCk7Ci0KLSAgICAgICAgLyoKLSAgICAgICAgICogSW5pdGlhbGlzZSB0aGUgQ29uY2VydCBTb3VuZCBpbnN0YW5jZSBhbmQgc2F2ZSB0aGUgaW5zdGFuY2UgaGFuZGxlCi0gICAgICAgICAqLwotICAgICAgICBoQ1NJbnN0YW5jZSA9IExWTV9OVUxMOyAgICAgICAgICAgICAgICAgICAgICAgICAgICAvKiBTZXQgdG8gTlVMTCB0byByZXR1cm4gaGFuZGxlICovCi0gICAgICAgIExWQ1NfU3RhdHVzID0gTFZDU19Jbml0KCZoQ1NJbnN0YW5jZSwgICAgICAgICAgICAgIC8qIEluaXRpYWlsc2UgKi8KLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJkNTX01lbVRhYiwKLSAgICAgICAgICAgICAgICAgICAgICA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FZEQkVfU3RhdHVzID0gTFZEQkVfTWVtb3J5KExWTV9OVUxMLCAgICAgICAgICAgICAgIC8qIEdldCB0aGUgbWVtb3J5IHJlcXVpcmVtZW50cyAqLwotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJkRCRV9NZW1UYWIsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmREJFX0NhcGFiaWxpdGllcyk7Ci0gICAgICAgIERCRV9NZW1UYWIuUmVnaW9uW0xWREJFX01FTVJFR0lPTl9JTlNUQU5DRV0ucEJhc2VBZGRyZXNzICAgICAgICA9ICZwSW5zdGFuY2UtPkRCRV9JbnN0YW5jZTsKLSAgICAgICAgREJFX01lbVRhYi5SZWdpb25bTFZEQkVfTUVNUkVHSU9OX1BFUlNJU1RFTlRfREFUQV0ucEJhc2VBZGRyZXNzID0gKHZvaWQgKilJbnN0QWxsb2NfQWRkTWVtYmVyKCZBbGxvY01lbVtMVk1fTUVNUkVHSU9OX1BFUlNJU1RFTlRfRkFTVF9EQVRBXSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIERCRV9NZW1UYWIuUmVnaW9uW0xWREJFX01FTVJFR0lPTl9QRVJTSVNURU5UX0RBVEFdLlNpemUpOwotICAgICAgICBEQkVfTWVtVGFiLlJlZ2lvbltMVkRCRV9NRU1SRUdJT05fUEVSU0lTVEVOVF9DT0VGXS5wQmFzZUFkZHJlc3MgPSAodm9pZCAqKUluc3RBbGxvY19BZGRNZW1iZXIoJkFsbG9jTWVtW0xWTV9NRU1SRUdJT05fUEVSU0lTVEVOVF9GQVNUX0NPRUZdLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgREJFX01lbVRhYi5SZWdpb25bTFZEQkVfTUVNUkVHSU9OX1BFUlNJU1RFTlRfQ09FRl0uU2l6ZSk7Ci0gICAgICAgIERCRV9NZW1UYWIuUmVnaW9uW0xWREJFX01FTVJFR0lPTl9TQ1JBVENIXS5wQmFzZUFkZHJlc3MgICAgICAgICA9ICh2b2lkICopSW5zdEFsbG9jX0FkZE1lbWJlcigmQWxsb2NNZW1bTFZNX01FTVJFR0lPTl9URU1QT1JBUllfRkFTVF0sCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAwKTsKLQotCi0gICAgICAgIC8qCi0gICAgICAgICAqIEluaXRpYWxpc2UgdGhlIER5bmFtaWMgQmFzcyBFbmhhbmNlbWVudCBpbnN0YW5jZSBhbmQgc2F2ZSB0aGUgaW5zdGFuY2UgaGFuZGxlCi0gICAgICAgICAqLwotICAgICAgICBoREJFSW5zdGFuY2UgPSBMVk1fTlVMTDsgICAgICAgICAgICAgICAgICAgICAgICAgICAgLyogU2V0IHRvIE5VTEwgdG8gcmV0dXJuIGhhbmRsZSAqLwotICAgICAgICBMVkRCRV9TdGF0dXMgPSBMVkRCRV9Jbml0KCZoREJFSW5zdGFuY2UsICAgICAgICAgICAgLyogSW5pdGlhaWxzZSAqLwotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICZEQkVfTWVtVGFiLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICZEQkVfQ2FwYWJpbGl0aWVzKTsKLSAgICAgICAgaWYgKExWREJFX1N0YXR1cyAhPSBMVkRCRV9TVUNDRVNTKSByZXR1cm4oKExWTV9SZXR1cm5TdGF0dXNfZW4pTFZEQkVfU3RhdHVzKTsKLSAgICAgICAgcEluc3RhbmNlLT5oREJFSW5zdGFuY2UgPSBoREJFSW5zdGFuY2U7ICAgICAgICAgICAgIC8qIFNhdmUgdGhlIGluc3RhbmNlIGhhbmRsZSAqLwotICAgIH0KLQotCi0gICAgLyoKLSAgICAgKiBJbml0aWFsaXNlIHRoZSBOLUJhbmQgRXF1YWxpc2VyIG1vZHVsZQotICAgICAqLwotICAgIHsKLSAgICAgICAgTFZFUU5CX0hhbmRsZV90ICAgICAgICAgIGhFUU5CSW5zdGFuY2U7ICAgICAgICAgICAgIC8qIEluc3RhbmNlIGhhbmRsZSAqLwotICAgICAgICBMVkVRTkJfTWVtVGFiX3QgICAgICAgICAgRVFOQl9NZW1UYWI7ICAgICAgICAgICAgICAgLyogTWVtb3J5IHRhYmxlICovCi0gICAgICAgIExWRVFOQl9DYXBhYmlsaXRpZXNfdCAgICBFUU5CX0NhcGFiaWxpdGllczsgICAgICAgICAvKiBJbml0aWFsIGNhcGFiaWxpdGllcyAqLwotICAgICAgICBMVkVRTkJfUmV0dXJuU3RhdHVzX2VuICAgTFZFUU5CX1N0YXR1czsgICAgICAgICAgICAgLyogRnVuY3Rpb24gY2FsbCBzdGF0dXMgKi8KLQotCi0gICAgICAgIC8qCi0gICAgICAgICAqIFNldCB0aGUgaW5pdGlhbGlzYXRpb24gcGFyYW1ldGVycwotICAgICAgICAgKi8KLSAgICAgICAgcEluc3RhbmNlLT5QYXJhbXMuRVFOQl9PcGVyYXRpbmdNb2RlICAgPSBMVk1fRVFOQl9PRkY7Ci0gICAgICAgIHBJbnN0YW5jZS0+UGFyYW1zLkVRTkJfTkJhbmRzICAgICAgICAgID0gMDsKLSAgICAgICAgcEluc3RhbmNlLT5QYXJhbXMucEVRTkJfQmFuZERlZmluaXRpb24gPSBMVk1fTlVMTDsKLSAgICAgICAgcEluc3RhbmNlLT5FUU5CX0FjdGl2ZSAgICAgICAgICAgICAgICAgPSBMVk1fRkFMU0U7Ci0KLQotICAgICAgICAvKgotICAgICAgICAgKiBTZXQgdGhlIGluaXRpYWxpc2F0aW9uIGNhcGFiaWxpdGllcwotICAgICAgICAgKi8KLSAgICAgICAgRVFOQl9DYXBhYmlsaXRpZX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gICAgICAgICAgICAgICAgICAgICAmRVFOQl9NZW1UYWIsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICZFUU5CX0NhcGFiaWxpdGllcyk7Ci0gICAgICAgIEVRTkJfTWVtVGFiLlJlZ2lvbltMVkVRTkJfTUVNUkVHSU9OX0lOU1RBTkNFXS5wQmFzZUFkZHJlc3MgICAgICAgID0gJnBJbnN0YW5jZS0+RVFOQl9JbnN0YW5jZTsKLSAgICAgICAgRVFOQl9NZW1UYWIuUmVnaW9uW0xWRVFOQl9NRU1SRUdJT05fUEVSU0lTVEVOVF9EQVRBXS5wQmFzZUFkZHJlc3MgPSAodm9pZCAqKUluc3RBbGxvY19BZGRNZW1iZXIoJkFsbG9jTWVtW0xWTV9NRU1SRUdJT05fUEVSU0lTVEVOVF9GQVNUX0RBVEFdLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBFUU5CX01lbVRhYi5SZWdpb25bTFZFUU5CX01FTVJFR0lPTl9QRVJTSVNURU5UX0RBVEFdLlNpemUpOwotICAgICAgICBFUU5CX01lbVRhYi5SZWdpb25bTFZFUU5CX01FTVJFR0lPTl9QRVJTSVNURU5UX0NPRUZdLnBCYXNlQWRkcmVzcyA9ICh2b2lkICopSW5zdEFsbG9jX0FkZE1lbWJlcigmQWxsb2NNZW1bTFZNX01FTVJFR0lPTl9QRVJTSVNURU5UX0ZBU1RfQ09FRl0sCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEVRTkJfTWVtVGFiLlJlZ2lvbltMVkVRTkJfTUVNUkVHSU9OX1BFUlNJU1RFTlRfQ09FRl0uU2l6ZSk7Ci0gICAgICAgIEVRTkJfTWVtVGFiLlJlZ2lvbltMVkVRTkJfTUVNUkVHSU9OX1NDUkFUQ0hdLnBCYXNlQWRkcmVzcyAgICAgICAgID0gKHZvaWQgKilJbnN0QWxsb2NfQWRkTWVtYmVyKCZBbGxvY01lbVtMVk1fTUVNUkVHSU9OX1RFTVBPUkFSWV9GQVNUXSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMCk7Ci0KLQotICAgICAgICAvKgotICAgICAgICAgKiBJbml0aWFsaXNlIHRoZSBEeW5hbWljIEJhc3MgRW5oYW5jZW1lbnQgaW5zdGFuY2UgYW5kIHNhdmUgdGhlIGluc3RhbmNlIGhhbmRsZQotICAgICAgICAgKi8KLSAgICAgICAgaEVRTkJJbnN0YW5jZSA9IExWTV9OVUxMOyAgICAgICAgICAgICAgICAgICAgICAgICAgIC8qIFNldCB0byBOVUxMIHRvIHJldHVybiBoYW5kbGUgKi8KLSAgICAgICAgTFZFUU5CX1N0YXR1cyA9IExWRVFOQl9Jbml0KCZoRVFOQkluc3RhbmNlLCAgICAgICAgIC8qIEluaXRpYWlsc2UgKi8KLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICZFUU5CX01lbVRhYiwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICZFUU5CX0NhcGFiaWxpdGllcyk7Ci0gICAgICAgIGlmIChMVkVRTkJfU3RhdHVzICE9IExWRVFOQl9TVUNDRVNTKSByZXR1cm4oKExWTV9SZXR1cm5TdGF0dXNfZW4pTFZFUU5CX1N0YXR1cyk7Ci0gICAgICAgIHBJbnN0YW5jZS0+aEVRTkJJbnN0YW5jZSA9IGhFUU5CSW5zdGFuY2U7ICAgICAgICAgICAvKiBTYXZlIHRoZSBpbnN0YW5jZSBoYW5kbGUgKi8KLSAgICB9Ci0KLSAgICAvKgotICAgICAqIEhlYWRyb29tIG1hbmFnZ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hbmNlLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJlBTQV9NZW1UYWIsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmcEluc3RhbmNlLT5QU0FfSW5pdFBhcmFtcyk7Ci0KLSAgICAgICAgICAgIGlmIChQU0FfU3RhdHVzICE9IExWUFNBX09LKQotICAgICAgICAgICAgewotICAgICAgICAgICAgICAgIHJldHVybigoTFZNX1JldHVyblN0YXR1c19lbikgTFZNX0FMR09SSVRITVBTQSk7Ci0gICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgIC8qIFNsb3cgRGF0YSAqLwotICAgICAgICAgICAgUFNBX01lbVRhYi5SZWdpb25bTFZNX1BFUlNJU1RFTlRfU0xPV19EQVRBXS5wQmFzZUFkZHJlc3MgPSAodm9pZCAqKUluc3RBbGxvY19BZGRNZW1iZXIoJkFsbG9jTWVtW0xWTV9NRU1SRUdJT05fUEVSU0lTVEVOVF9TTE9XX0RBVEFdLAotICAgICAgICAgICAgICAgIFBTQV9NZW1UYWIuUmVnaW9uW0xWTV9QRVJTSVNURU5UX1NMT1dfREFUQV0uU2l6ZSk7Ci0KLQotICAgICAgICAgICAgLyogRmFzdCBEYXRhICovCi0gICAgICAgICAgICBQU0FfTWVtVGFiLlJlZ2lvbltMVk1fUEVSU0lTVEVOVF9GQVNUX0RBVEFdLnBCYXNlQWRkcmVzcyA9ICh2b2lkICopSW5zdEFsbG9jX0FkZE1lbWJlcigmQWxsb2NNZW1bTFZNX01FTVJFR0lPTl9QRVJTSVNURU5UX0ZBU1RfREFUQV0sCi0gICAgICAgICAgICAgICAgUFNBX01lbVRhYi5SZWdpb25bTFZNX1BFUlNJU1RFTlRfRkFTVF9EQVRBXS5TaXplKTsKLQotCi0gICAgICAgICAgICAvKiBGYXN0IENvZWYgKi8KLSAgICAgICAgICAgIFBTQV9NZW1UYWIuUmVnaW9uW0xWTV9QRVJTSVNURU5UX0ZBU1RfQ09FR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SwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICZwSW5zdGFuY2UtPlBTQV9Jbml0UGFyYW1zLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJnBJbnN0YW5jZS0+UFNBX0NvbnRyb2xQYXJhbXMsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmUFNBX01lbVRhYik7Ci0KLSAgICAgICAgICAgIGlmIChQU0FfU3RhdHVzICE9IExWUFNBX09LKQotICAgICAgICAgICAgewotICAgICAgICAgICAgICAgIHJldHVybigoTFZNX1JldHVyblN0YXR1c19lbikgTFZNX0FMR09SSVRITVBTQSk7Ci0gICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgIHBJbnN0YW5jZS0+aFBTQUluc3RhbmNlID0gaFBTQUluc3RhbmNlOyAgICAgICAvKiBTYXZlIHRoZSBpbnN0YW5jZSBoYW5kbGUgKi8KLSAgICAgICAgICAgIHBJbnN0YW5jZS0+UFNBX0dhaW5PZmZzZXQgPSAwOwotICAgICAgICB9Ci0gICAgICAgIGVsc2UKLSAgICAgICAgewotICAgICAgICAgICAgcEluc3RhbmNlLT5oUFNBSW5zdGFuY2UgPSBMVk1fTlVMTDsKLSAgICAgICAgfQotCi0gICAgICAgIC8qCi0gICAgICAgICAqIFNldCB0aGUgaW5pdGlhbGlzYXRpb24gcGFyYW1ldGVycy4KLSAgICAgICAgICovCi0gICAgICAgIHBJbnN0YW5jZS0+UGFyYW1zLlBTQV9QZWFrRGVjYXlSYXRlICAgPSBMVk1fUFNBX1NQRUVEX01FRElVTTsKLSAgICAgICAgcEluc3RhbmNlLT5QYXJhbXMuUFNBX0VuYWJsZSAgICAgICAgICA9IExWTV9QU0FfT0ZGOwotICAgIH0KLQotICAgIC8qCi0gICAgICogQ29weSB0aGUgaW5pdGlhbCBwYXJhbWV0ZXJzIHRvIHRoZSBuZXcgcGFyYW1ldGVycyBmb3IgY29ycmVjdCByZWFkYmFjayBvZgotICAgIC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sKLSAgICAgICAgcEluc3RhbmNlLT5CbGlja1NpemVNdWx0aXBsZSAgICA9IDE7Ci0gICAgfQotCi0gICAgcmV0dXJuKFN0YXR1cyk7Ci19Ci0KLQotLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0vKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qIEZVTkNUSU9OOiAgICAgICAgICAgICAgICBMVk1fQ2xlYXJBdWRpb0J1ZmZlcnMgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiBERVNDUklQVElPTjogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICBUaGlzIGZ1bmN0aW9uIGlzIHVzZWQgdG8gY2xlYXIgdGhlIGludGVybmFsIGF1ZGlvIGJ1ZmZlcnMgb2YgdGhlIGJ1bmRsZS4gICAgICAgICAgICAqLwotLyogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiBQQVJBTUVURVJTOiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICBoSW5zdGFuY2UgICAgICAgICAgICAgICBJbnN0YW5jZSBoYW5kbGUgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiBSRVRVUk5TOiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICBMVk1fU1VDQ0VTUyAgICAgICAgICAgICBJbml0aWFsaXNhdGlvbiBzdWNjZWVkZWQgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogIExWTV9OVUxMQUREUkVTUyAgICAgICAgIEluc3RhbmNlIG9yIHNjcmF0Y2ggbWVtb3J5IGhhcyBhIE5VTEwgcG9pbnRlciAgICAgICAgICAgICAgICovCi0vKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qIE5PVEVTOiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogIDEuIFRoaXMgZnVuY3Rpb24gbXVzdCBub3QgYmUgaW50ZXJydXB0ZWQgYnkgdGhlIExWTV9Qcm9jZXNzIGZ1bmN0aW9uICAgICAgICAgICAgICAgICovCi0vKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotCi1MVk1fUmV0dXJuU3RhdHVzX2VuIExWTV9DbGVhckF1ZGlvQnVmZmVycyhMVk1fSGFuZGxlX3QgIGhJbnN0YW5jZSkKLXsKLSAgICBMVk1fTWVtVGFiX3QgICAgICAgICAgICBNZW1UYWI7ICAgICAgICAgICAgICAgICAg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AgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgVGhpcyBmaWxlcyBpbmNsdWRlcyBhbGwgZGVmaW5pdGlvbnMsIHR5cGVzLCBzdHJ1Y3R1cmVzIGFuZCBmdW5jdGlvbiAgICAgICAgICAgICAqLwotLyogIHByb3RvdHlwZXMgcmVxdWlyZWQgYnkgdGhlIGV4ZWN1dGlvbiBsYXllci4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotCi0jaWZuZGVmIF9fTFZNX1BSSVZBVEVfSF9fCi0jZGVmaW5lIF9fTFZNX1BSSVZBVEVfSF9fCi0KLSNpZmRlZiBfX2NwbHVzcGx1cwotZXh0ZXJuICJDIiB7Ci0jZW5kaWYgLyogX19jcGx1c3BsdXMgKi8KLQotCi0vKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotLyogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICBJbmNsdWRlcyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLQotI2luY2x1ZGUgIkxWTS5oIiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLyogTGlmZVZpYmVzICovCi0jaW5jbHVkZSAiTFZNX0NvbW1vbi5oIiAgICAgICAgICAgICAgICAgICAgICAgICAvKiBMaWZlVmliZXMgY29tbW9uICovCi0jaW5jbHVkZSAiQklRVUFELmgiICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvKiBCaXF1YWQgbGlicmFyeSAqLwotI2luY2x1ZGUgIkxWQ19NaXhlci5oIiAgICAgICAgICAgICAgICAgICAgICAgICAgLyogTWl4ZXIgbGlicmFyeSAqLwotI2luY2x1ZGUgIkxWQ1NfUHJpdmF0ZS5oIiAgICAgICAgICAgICAgICAgICAgICAgLyogQ29uY2VydCBTb3VuZCAqLwotI2luY2x1ZGUgIkxWREJFX1ByaXZhdGUuaCIgICAgICAgICAgICAgICAgICAgICAgLyogRHluYW1pYyBCYXNzIEVuaGFuY2VtZW50ICovCi0jaW5jbHVkZSAiTFZFUU5CX1ByaXZhdGUuaCIgICAgICAgICAgICAgICAgICAgICAvKiBOLUJhbmQgZXF1YWxpc2VyICovCi0jaW5jbHVkZSAiTFZQU0FfUHJpdmF0ZS5oIiAgICAgICAgICAgICAgICAgICAgICAvKiBQYXJhbWV0cmljIFNwZWN0cnVtIEFuYWx5emVyICovCi0KLQotLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLS8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgRGVmaW5lcyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0KLS8qIEdlbmVyYWwgKi8KLSNkZWZpbmUgTFZNX0lOVkFMSUQgICAgICAgICAgICAgICAgICAgICAweEZGRkYgICAgLyogSW52YWxpZCBpbml0IHBhcmFtZXRlciAqLwotCi0vKiBNZW1vcnkgKi8KLSNkZWZpbmUgTFZNX0lOU1RBTkNFX0FMSUdOICAgICAgICAgICAgICA0ICAgICAgICAgLyogMzItYml0IGZvciBzdHJ1Y3R1cmVzICovCi0jZGVmaW5lIExWTV9GSVJTVENBTEwgICAgICAgICAgICAgICAgICAgMCAgICAgICAgIC8qIEZpcnN0IGNhbGwgdG8gdGhlIGJ1ZmZlciAqLwotI2RlZmluZSBMVk1fTUFYQkxPQ0tDQUxMICAgICAgICAgICAgICAgIDEgICAgICAgICAvKiBNYXhpbXVtIGJsb2NrIHNpemUgY2FsbHMgdG8gdGhlIGJ1ZmZlciAqLwotI2RlZmluZSBMVk1fTEFTVENBTEwgICAgICAgICAgICAgICAgICAgIDIgICAgICAgICAvKiBMYXN0IGNhbGwgdG8gdGhlIGJ1ZmZlciAqLwotI2RlZmluZSBMVk1fRklSU1RMQVNUQ0FMTCAgICAgICAgICAgICAgIDMgICAgICAgICAvKiBTaW5nbGUgY2FsbCBmb3Igc21hbGwgbnVtYmVyIG9mIHNhbXBsZXMgKi8KLQotLyogQmxvY2sgU2l6ZSAqLwotI2RlZmluZSBMVk1fTUlOX01BWEJMT0NLU0laRSAgICAgICAgICAgIDE2ICAgICAgICAvKiBNaW5pbXVtIE1heEJsb2NrU2l6ZSBMaW1pdCovCi0jZGVmaW5lIExWTV9NQU5BR0VEX01BWF9NQVhCTE9DS1NJWkUgICAgODE5MSAgICAgIC8qIE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QVNLICAgICAgICAgICAgICAgICAgICAgMQotI2RlZmluZSBMVk1fRVFOQl9NQVNLICAgICAgICAgICAgICAgICAgIDIKLSNkZWZpbmUgTFZNX0RCRV9NQVNLICAgICAgICAgICAgICAgICAgICA0Ci0jZGVmaW5lIExWTV9WQ19NQVNLICAgICAgICAgICAgICAgICAgICAgMTYKLSNkZWZpbmUgTFZNX1RFX01BU0sgICAgICAgICAgICAgICAgICAgICAzMgotI2RlZmluZSBMVk1fUFNBX01BU0sgICAgICAgICAgICAgICAgICAgIDIwNDgKLQotCi0vKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotLyogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICBTdHJ1Y3R1cmVzICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLQotLyogTWVtb3J5IHJlZ2lvbiBkZWZpbml0aW9uICovCi10eXBlZGVmIHN0cnVjdAotewotICAgIExWTV9VSU5UMzIgICAgICAgICAgICAgIFNpemU7ICAgICAgICAgICAgICAgLyogUmVnaW9uIHNpemUgaW4gYnl0ZXMgKi8KLSAgICBMVk1fVUlOVDE2ICAgICAgICAgICAgICBBbGlnbm1lbnQ7ICAgICAgICAgIC8qIEJ5dGUgYWxpZ25tZW50ICovCi0gICAgTFZNX01lbW9yeVR5cGVzX2VuICAgICAgVHlwZTsgICAgICAg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XZhdGUgcGFyYW1ldGVycyAqLwotICAgIExWTV9VSU5UMTYgICAgICAgICAgICAgIENvbnRyb2xQZW5kaW5nOyAgICAgLyogQ29udHJvbCBmbGFnIHRvIGluZGljYXRlIHVwZGF0ZSBwZW5kaW5nICovCi0gICAgTFZNX0NvbnRyb2xQYXJhbXNfdCAgICAgTmV3UGFyYW1zOyAgICAgICAgICAvKiBOZXcgY29udHJvbCBwYXJhbWV0ZXJzIHBlbmRpbmcgdXBkYXRlICovCi0KLSAgICAvKiBCdWZmZXIgY29udHJvbCAqLwotICAgIExWTV9JTlQxNiAgICAgICAgICAgICAgIEludGVybmFsQmxvY2tTaXplOyAgLyogTWF4aW11bSBpbnRlcm5hbCBibG9jayBzaXplICovCi0gICAgTFZNX0J1ZmZlcl90ICAgICAgICAgICAgKnBCdWZmZXJNYW5hZ2VtZW50OyAvKiBCdWZmZXIgbWFuYWdlbWVudCB2YXJpYWJsZXMgKi8KLSAgICBMVk1fSU5UMTYgICAgICAgICAgICAgICBTYW1wbGVzVG9Qcm9jZXNzOyAgIC8qIElucHV0IHNhbXBsZXMgbGVmdCB0byBwcm9jZXNzICovCi0gICAgTFZNX0lOVDE2ICAgICAgICAgICAgICAgKnBJbnB1dFNhbXBsZXM7ICAgICAvKiBFeHRlcm5hbCBpbnB1dCBzYW1wbGUgcG9pbnRlciAqLwotICAgIExWTV9JTlQxNiAgICAgICAgICAgICAgICpwT3V0cHV0U2FtcGxlczsgICAgLyogRXh0ZXJuYWwgb3V0cHV0IHNhbXBsZSBwb2ludGVyICovCi0KLSAgICAvKiBDb25maWd1cmF0aW9uIG51bWJlciAqLwotICAgIExWTV9JTlQzMiAgICAgICAgICAgICAgIENvbmZpZ3VyYXRpb25OdW1iZXI7Ci0gICAgTFZNX0lOVDMyICAgICAgICAgICAgICAgQmxpY2tTaXplTXVsdGlwbGU7Ci0KLSAgICAvKiBEQyByZW1vdmFsICovCi0gICAgQmlxdWFkX0luc3RhbmNlX3QgICAgICAgRENfUmVtb3ZhbEluc3RhbmNlOyAvKiBEQyByZW1vdmFsIGZpbHRlciBpbnN0YW5jZSAqLwotCi0gICAgLyogQ29uY2VydCBTb3VuZCAqLwotICAgIExWQ1NfSGFuZGxlX3QgICAgICAgICAgIGhDU0luc3RhbmNlOyAgICAgICAgLyogQ29uY2VydCBTb3VuZCBpbnN0YW5jZSBoYW5kbGUgKi8KLSAgICBMVkNTX0luc3RhbmNlX3QgICAgICAgICBDU19JbnN0YW5jZTsgICAgICAgIC8qIENvbmNlcnQgU291bmQgaW5zdGFuY2UgKi8KLSAgICBMVk1fSU5UMTYgICAgICAgICAgICAgICBDU19BY3RpdmU7ICAgICAgICAgIC8qIENvbnRyb2wgZmxhZyAqLwotCi0gICAgLyogRXF1YWxpemVyICovCi0gICAgTFZFUU5CX0hhbmRsZV90ICAgICAgICAgaEVRTkJJbnN0YW5jZTsgICAgICAvKiBOLUJhbmQgRXF1YWxpc2VyIGluc3RhbmNlIGhhbmRsZSAqLwotICAgIExWRVFOQl9JbnN0YW5jZV90ICAgICAgIEVRTkJfSW5zdGFuY2U7ICAgICAgLyogTi1CYW5kIEVxdWFsaXNlciBpbnN0YW5jZSAqLwotICAgIExWTV9FUU5CX0JhbmREZWZfdCAgICAgICpwRVFOQl9CYW5kRGVmczsgICAgLyogTG9jYWwgc3RvcmFnZSBmb3IgbmV3IGRlZmluaXRpb25zICovCi0gICAgTFZNX0VRTkJfQmFuZERlZl90ICAgICAgKnBFUU5CX1VzZXJEZWZzOyAgICAvKiBMb2NhbCBzdG9yYWdlIGZvciB0aGUgdXNlcidzIGRlZmluaXRpb25zICovCi0gICAgTFZNX0lOVDE2ICAgICAgICAgICAgICAgRVFOQl9BY3RpdmU7ICAgICAgICAvKiBDb250cm9sIGZsYWcgKi8KLQotICAgIC8qIER5bmFtaWMgQmFzcyBFbmhhbmNlbWVudCAqLwotICAgIExWREJFX0hhbmRsZV90ICAgICAgICAgIGhEQkVJbnN0YW5jZTsgICAgICAgLyogRHluYW1pYyBCYXNzIEVuaGFuY2VtZW50IGluc3RhbmNlIGhhbmRsZSAqLwotICAgIExWREJFX0luc3RhbmNlX3QgICAgICAgIERCRV9JbnN0YW5jZTsgICAgICAgLyogRHluYW1pYyBCYXNzIEVuaGFuY2VtZW50IGluc3RhbmNlICovCi0gICAgTFZNX0lOVDE2ICAgICAgICAgICAgICAgREJFX0FjdGl2ZTsgICAgICAgICAvKiBDb250cm9sIGZsYWcgKi8KLQotICAgIC8qIFZvbHVtZSBDb250cm9sICovCi0gICAgTFZNaXhlcjNfMVN0X3N0ICAgICAgICAgVkNfVm9sdW1lOyAgICAgICAgICAvKiBWb2x1bWUgc2NhbGVyICovCi0gICAgTFZNaXhlcjNfMlN0X3N0ICAgICAgICAgVkNfQmFsYW5jZU1peDsgICAgICAvKiBWQyBiYWxhbmNlIG1peGVyICovCi0gICAgTFZNX0lOVDE2ICAgICAgICAgICAgICAgVkNfVm9sdW1lZEI7ICAgICAgICAvKiBHYWluIGluIGRCICovCi0gICAgTFZNX0lOVDE2ICAgICAgICAgICAgICAgVkNfQWN0aXZlOyAgICAgICAgICAvKiBDb250cm9sIGZsYWcgKi8KLSAgICBMVk1fSU5UMTYgICAgICAgICAgICAgICBWQ19BVkxGaXhlZFZvbHVtZTsgIC8qIEFWTCBmaXhlZCB2b2x1bWUgKi8KLQotICAgIC8qIFRyZWJsZSBFbmhhbmNlbWVudCAqLwotICAgIExWTV9URV9EYXRhX3QgICAgICAgICAgICpwVEVfVGFwczsgICAgICAgICAgLyogVHJlYmxlIGJvb3N0IFRhcHMgKi8KLSAgICBMVk1fVEVfQ29lZnNfdCAgICAgICAgICAqcFRFX1N0YXRlOyAgICAgICAgIC8qIFN0YXRlIGZvciB0aGUgdHJlYmxlIGJvb3N0IGZpbHRlciAqLwotICAgIExWTV9JTlQxNiAgICAgICAgICAgICAgIFRFX0FjdGl2ZTsgICAgICAgICAgLyogQ29udHJvbCBmbGFnICovCi0KLSAgICAvKiBIZWFkcm9vbSAqLwotICA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GFyYW1ldGVycyAqLwotICAgIExWTV9JTlQxNiAgICAgICAgICAgICAgIFBTQV9HYWluT2Zmc2V0OyAgICAgLyogVG9uZSBjb250cm9sIGZsYWcgKi8KLSAgICBMVk1fQ2FsbGJhY2sgICAgICAgICAgICBDYWxsQmFjazsKLSAgICBMVk1fSU5UMTYgICAgICAgICAgICAgICAqcFBTQUlucHV0OyAgICAgICAgIC8qIFBTQSBpbnB1dCBwb2ludGVyICovCi0KLSAgICBMVk1fSU5UMTYgICAgICAgICAgICAgIE5vU21vb3RoVm9sdW1lOyAgICAgIC8qIEVuYWJsZSBvciBkaXNhYmxlIHNtb290aCB2b2x1bWUgY2hhbmdlcyovCi0KLX0gTFZNX0luc3RhbmNlX3Q7Ci0KLQotLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLS8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgRnVuY3Rpb24gUHJvdG90eXBlcyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0KLUxWTV9SZXR1cm5TdGF0dXNfZW4gTFZNX0FwcGx5TmV3U2V0dGluZ3MoTFZNX0hhbmRsZV90ICAgICAgIGhJbnN0YW5jZSk7Ci0KLXZvaWQgICAgTFZNX1NldFRyZWJsZUJvb3N0KCBMVk1fSW5zdGFuY2VfdCAgICAgICAgICpwSW5zdGFuY2UsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgTFZNX0NvbnRyb2xQYXJhbXNfdCAgICAqcFBhcmFtcyk7Ci0KLXZvaWQgICAgTFZNX1NldFZvbHVtZSggIExWTV9JbnN0YW5jZV90ICAgICAgICAgKnBJbnN0YW5jZSwKLSAgICAgICAgICAgICAgICAgICAgICAgIExWTV9Db250cm9sUGFyYW1zX3QgICAgKnBQYXJhbXMpOwotCi1MVk1fSU5UMzIgICAgTFZNX1ZDQ2FsbEJhY2sodm9pZCogICBwQnVuZGxlSGFuZGxlLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZvaWQqICAgcEdlbmVyYWxQdXJwb3NlLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNob3J0ICAgQ2FsbEJhY2tQYXJhbSk7Ci0KLXZvaWQgICAgTFZNX1NldEhlYWRyb29tKCAgICBMVk1fSW5zdGFuY2VfdCAgICAgICAgICpwSW5zdGFuY2UsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgTFZNX0NvbnRyb2xQYXJhbXNfdCAgICAqcFBhcmFtcyk7Ci0KLXZvaWQgICAgTFZNX0J1ZmZlckluKCAgIExWTV9IYW5kbGVfdCAgICAgIGhJbnN0YW5jZSwKLSAgICAgICAgICAgICAgICAgICAgICAgIGNvbnN0IExWTV9JTlQxNiAgICpwSW5EYXRhLAotICAgICAgICAgICAgICAgICAgICAgICAgTFZNX0lOVDE2ICAgICAgICAgKipwVG9Qcm9jZXNzLAotICAgICAgICAgICAgICAgICAgICAgICAgTFZNX0lOVDE2ICAgICAgICAgKipwUHJvY2Vzc2VkLAotICAgICAgICAgICAgICAgICAgICAgICAgTFZNX1VJTlQxNiAgICAgICAgKnBOdW1TYW1wbGVzKTsKLQotdm9pZCAgICBMVk1fQnVmZmVyT3V0KCAgTFZNX0hhbmRsZV90ICAgICBoSW5zdGFuY2UsCi0gICAgICAgICAgICAgICAgICAgICAgICBMVk1fSU5UMTYgICAgICAgICpwT3V0RGF0YSwKLSAg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nRhaW4gYSBjb3B5IG9mIHRoZSBMaWNlbnNlIGF0Ci0gKgotICogICAgICBodHRwOi8vd3d3LmFwYWNoZS5vcmcvbGljZW5zZXMvTElDRU5TRS0yLjAKLSAqCi0gKiBVbmxlc3MgcmVxdWlyZWQgYnkgYXBwbGljYWJsZSBsYXcgb3IgYWdyZWVkIHRvIGluIHdyaXRpbmcsIHNvZnR3YXJlCi0gKiBkaXN0cmlidXRlZCB1bmRlciB0aGUgTGljZW5zZSBpcyBkaXN0cmlidXRlZCBvbiBhbiAiQVMgSVMiIEJBU0lTLAotICogV0lUSE9VVCBXQVJSQU5USUVTIE9SIENPTkRJVElPTlMgT0YgQU5ZIEtJTkQsIGVpdGhlciBleHByZXNzIG9yIGltcGxpZWQuCi0gKiBTZWUgdGhlIExpY2Vuc2UgZm9yIHRoZSBzcGVjaWZpYyBsYW5ndWFnZSBnb3Zlcm5pbmcgcGVybWlzc2lvbnMgYW5kCi0gKiBsaW1pdGF0aW9ucyB1bmRlciB0aGUgTGljZW5zZS4KLSAqLwotCi0KLS8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotLyogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgSW5jbHVkZXMgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0KLSNpbmNsdWRlICJMVk1fUHJpdmF0ZS5oIgotI2luY2x1ZGUgIlZlY3RvckFyaXRobWV0aWMuaCIKLSNpbmNsdWRlICJMVk1fQ29lZmZzLmgiCi0KLS8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotLyogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiBGVU5DVElPTjogICAgICAgICAgICAgICAgTFZNX1Byb2Nlc3MgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogREVTQ1JJUFRJT046ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgUHJvY2VzcyBmdW5jdGlvbiBmb3IgdGhlIExpZmVWaWJlcyBtb2R1bGUuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogUEFSQU1FVEVSUzogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgaEluc3RhbmNlICAgICAgICAgICAgICAgSW5zdGFuY2UgaGFuZGxlICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICBwSW5EYXRhICAgICAgICAgICAgICAgICBQb2ludGVyIHRvIHRoZSBpbnB1dCBkYXRhICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogIHBPdXREYXRhICAgICAgICAgICAgICAgIFBvaW50ZXIgdG8gdGhlIG91dHB1dCBkYXRhICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgTnVtU2FtcGxlcyAgICAgICAgICAgICAgTnVtYmVyIG9mIHNhbXBsZXMgaW4gdGhlIGlucHV0IGJ1ZmZlciAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICBBdWRpb1RpbWUgICAgICAgICAgICAgICBBdWRpbyBUaW1lIG9mIHRoZSBjdXJyZW50IGlucHV0IGJ1ZmZlciBpbiBtcyAgICAgICAgICAgICAgICAqLwotLyogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiBSRVRVUk5TOiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICBMVk1fU1VDQ0VTUyAgICAgICAgICAgIFN1Y2NlZWRlZCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogIExWTV9JTlZBTElETlVNU0FNUExFUyAgV2hlbiB0aGUgTnVtU2FtcGxlcyBpcyBub3QgYSB2YWxpZWQgbXVsdGlwbGUgaW4gdW5tYW5hZ2VkICAgICovCi0vKiAgICAgICAgICAgICAgICAgICAgICAgICBidWZmZXIgbW9kZSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICBMVk1fQUxJR05NRU5URVJST1IgICAgIFdoZW4gZWl0aGVyIHRoZSBpbnB1dCBvdXIgb3V0cHV0IGJ1ZmZlcnMgYXJlIG5vdCAzMi1iaXQgICAgICAqLwotLyogICAgICAgICAgICAgICAgICAgICAgICAgYWxpZ25lZCBpbiB1bm1hbmFnZWQgbW9kZSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgTFZNX05VTExBRERSRVNTICAgICAgICBXaGVuIG9uZSBvZiBoSW5zdGFuY2UsIHBJbkRhdGEgb3IgcE91dERhdGEgaXMgTlVMTCAgICAgICAgICAgKi8KLS8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogTk9URVM6ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotCi1MVk1fUmV0dXJuU3RhdHVzX2VuIExWTV9Qcm9jZXNzKExWTV9IYW5kbGVfdCAgICAgICAgICAgICAgICBoSW5zdGFuY2UsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbnN0IExWTV9JTlQxNiAgICAgICAgICAgICAqcEluRGF0YSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTFZNX0lOVDE2ICAgICAgICAgICAgICAgICAgICpwT3V0RGF0YSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTFZNX1VJTlQxNiAgICAgICAgICAgICAgICAgIE51bVNhbXBsZXMsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIExWTV9VSU5UMzIgICAgICAgICAgICAgICAgICBBdWRpb1RpbWUpCi17Ci0KLSAgICBMVk1fSW5zdGFuY2VfdCAgICAgICpwSW5zdGFuY2UgID0gKExWTV9Jb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vbmx5KQotICAgICAgICAgKi8KLSAgICAgICAgaWYoKE51bVNhbXBsZXMgJSBwSW5zdGFuY2UtPkJsaWNrU2l6ZU11bHRpcGxlKSAhPSAwKQotICAgICAgICB7Ci0gICAgICAgICAgICByZXR1cm4oTFZNX0lOVkFMSUROVU1TQU1QTEVTKTsKLSAgICAgICAgfQotCi0gICAgICAgIC8qCi0gICAgICAgICAqIENoZWNrIHRoZSBidWZmZXIgYWxpZ25tZW50Ci0gICAgICAgICAqLwotICAgICAgICBpZigoKChMVk1fVUlOVDMyKXBJbkRhdGEgJSA0KSAhPSAwKSB8fCAoKChMVk1fVUlOVDMyKXBPdXREYXRhICUgNCkgIT0gMCkpCi0gICAgICAgIHsKLSAgICAgICAgICAgIHJldHVybihMVk1fQUxJR05NRU5URVJST1IpOwotICAgICAgICB9Ci0gICAgfQotCi0KLSAgICAvKgotICAgICAqIFVwZGF0ZSBuZXcgcGFyYW1ldGVycyBpZiBuZWNlc3NhcnkKLSAgICAgKi8KLSAgICBpZiAocEluc3RhbmNlLT5Db250cm9sUGVuZGluZyA9PSBMVk1fVFJVRSkKLSAgICB7Ci0gICAgICAgIFN0YXR1cyA9IExWTV9BcHBseU5ld1NldHRpbmdzKGhJbnN0YW5jZSk7Ci0KLSAgICAgICAgaWYoU3RhdHVzICE9IExWTV9TVUNDRVNTKQotICAgICAgICB7Ci0gICAgICAgICAgICByZXR1cm4gU3RhdHVzOwotICAgICAgICB9Ci0gICAgfQotCi0KLSAgICAvKgotICAgICAqIENvbnZlcnQgZnJvbSBNb25vIGlmIG5lY2Vzc2FyeQotICAgICAqLwotICAgIGlmIChwSW5zdGFuY2UtPlBhcmFtcy5Tb3VyY2VGb3JtYXQgPT0gTFZNX01PTk8pCi0gICAgewotICAgICAgICBNb25vVG8ySV8xNihwSW5EYXRhLCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLyogU291cmNlICovCi0gICAgICAgICAgICAgICAgICAgIHBPdXREYXRhLCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvKiBEZXN0aW5hdGlvbiAqLwotICAgICAgICAgICAgICAgICAgICAoTFZNX0lOVDE2KU51bVNhbXBsZXMpOyAgICAgICAgICAgICAgICAgLyogTnVtYmVyIG9mIGlucHV0IHNhbXBsZXMgKi8KLSAgICAgICAgcElucHV0ICAgICA9IHBPdXREYXRhOwotICAgICAgICBwVG9Qcm9jZXNzID0gcE91dERhdGE7Ci0gICAgfQotCi0KLSAgICAvKgotICAgICAqIFByb2Nlc3MgdGhlIGRhdGEgd2l0aCBtYW5hZ2VkIGJ1ZmZlcnMKLSAgICAgKi8KLSAgICB3aGlsZSAoU2FtcGxlQ291bnQgIT0gMCkKLSAgICB7Ci0gICAgICAgIC8qCi0gICAgICAgICAqIE1hbmFnZSB0aGUgaW5wdXQgYnVmZmVyIGFuZCBmcmFtZSBwcm9jZXNzaW5nCi0gICAgICAgICAqLwotICAgICAgICBMVk1fQnVmZmVySW4oaEluc3RhbmNlLAotICAgICAgICAgICAgICAgICAgICAgcElucHV0LAotICAgICAgICAgICAgICAgICAgICAgJnBUb1Byb2Nlc3MsCi0gICAgICAgICAgICAgICAgICAgICAmcFByb2Nlc3NlZCwKLSAgICAgICAgICAgICAgICAgICAgICZTYW1wbGVDb3VudCk7Ci0KLSAgICAgICAgLyoKLSAgICAgICAgICogT25seSBwcm9jZXNzIGRhdGEgd2hlbiBTYW1wbGVDb3VudCBpcyBub25lIHplcm8sIGEgemVybyBjb3VudCBjYW4gb2NjdXIgd2hlbgotICAgICAgICAgKiB0aGUgQnVmZmVySW4gcm91dGluZSBpcyB3b3JraW5nIGluIG1hbmFnZWQgbW9kZS4KLSAgICAgICAgICovCi0gICAgICAgIGlmIChTYW1wbGVDb3VudCAhPSAwKQotICAgICAgICB7Ci0KLSAgICAgICAgICAgIC8qCi0gICAgICAgICAgICAgKiBBcHBseSBDb25jZXJ0U291bmQgaWYgcmVxdWlyZWQKLSAgICAgICAgICAgICAqLwotICAgICAgICAgICAgaWYgKHBJbnN0YW5jZS0+Q1NfQWN0aXZlID09IExWTV9UUlVFKQotICAgICAgICAgICAgewotICAgICAgICAgICAgICAgICh2b2lkKUxWQ1NfUHJvY2VzcyhwSW5zdGFuY2UtPmhDU0luc3RhbmNlLCAgICAgICAgICAvKiBDb25jZXJ0IFNvdW5kIGluc3RhbmNlIGhhbmRsZSAqLwotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwVG9Qcm9jZXNzLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwUHJvY2Vzc2VkLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBTYW1wbGVDb3VudCk7Ci0gICAgICAgICAgICAgICAgcFRvUHJvY2VzcyA9IHBQcm9jZXNzZWQ7Ci0gICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgIC8qCi0gICAgICAgICAgICAgKiBBcHBseSB2b2x1bWUgaWYgcmVxdWlyZWQKLSAgICAgICAgICAgICAqLwotICAgICAgICAgICAgaWYgKHBJbnN0YW5jZS0+VkNfQWN0aXZlIT0wKQotICAgICAgICAgICAgewotICAgICAgICAgICAgICAgIExWQ19NaXhTb2Z0XzFTdF9EMTZDMzFfU0FUKCZwSW5zdGFuY2UtPlZDX1ZvbHVtZSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBUb1Byb2Nlc3MsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwUHJvY2Vzc2VkLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKExWTV9JTlQxNikoMipTYW1wbGVDb3VudCkpOyAgICAgLyogTGVmdCBhbmQgcmlnaHQqLwotICAgICAgICAgICAgICAgIHBUb1Byb2Nlc3MgPSBwUHJvY2Vzc2VkOwotICAgICAgICAgICAgfQotCi0gICAgICAgICAgICAvKgotICAgICAgICAgICAgICogQ2FsbCBOLUJhbmQgZXF1YWxpc2VyIGlmIGVuYWJsZWQKLSAgICAgICAgICAgICAqLwotICAgICAgICAgICAgaWYgKHBJbnN0YW5jZS0+RVFOQl9BY3RpdmUgPT0gTFZNX1RSVUUpCi0gICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgTFZFUU5CX1Byb2Nlc3MocEluc3RhbmNlLT5oRVFOQkluc3RhbmNlLCAgICAgICAgLyogTi1CYW5kIGVxdWFsaXNlciBpbnN0YW5jZSBoYW5kbGUgKi8KLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwVG9Qcm9jZXNzLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBQcm9jZXNzZWQsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgU2FtcGxlQ291bnQpOwotICAgICAgICAgICAgICAgIHBUb1Byb2Nlc3MgPSBwUHJvY2Vzc2VkOwotICAgICAgICAgICAgfQotCi0gICAgICAgICAgICAvKgotICAgICAgICAgICAgICogQ2FsbCBiYXNzIGVuaGFuY2VtZW50IGlmIGVuYWJsZWQKLSAgICAgICAgICAgICAqLwotICAgICAgICAgICAgaWYgKHBJbnN0YW5jZS0+REJFX0FjdGl2ZSA9PSBMVk1fVFJVRSkKLSAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICBMVkRCRV9Qcm9jZXNzKHBJbnN0YW5jZS0+aERCRUluc3RhbmNlLCAgICAgICAgICAvKiBEeW5hbWljIEJhc3MgRW5oYW5jZW1lbnQgaW5zdGFuY2UgaGFuZGxlICovCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwVG9Qcm9jZXNzLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcFByb2Nlc3NlZCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFNhbXBsZUNvdW50KTsKLSAgICAgICAgICAgICAgICBwVG9Qcm9jZXNzID0gcFByb2Nlc3NlZDsKLSAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgLyoKLSAgICAgICAgICAgICAqIEJ5cGFzcyBtb2RlIG9yIGV2ZXJ5dGhpbmcgb2ZmLCBzbyBjb3B5IHRoZSBpbnB1dCB0byB0aGUgb3V0cHV0Ci0gICAgICAgICAgICAgKi8KLSAgICAgICAgICAgIGlmIChwVG9Qcm9jZXNzICE9IHBQcm9jZXNzZWQpCi0gICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgQ29weV8xNihwVG9Qcm9jZXNzLCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLyogU291cmNlICovCi0gICAgICAgICAgICAgICAgICAgICAgICBwUHJvY2Vzc2VkLCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLyogRGVzdGluYXRpb24gKi8KLSAgICAgICAgICAgICAgICAgICAgICAgIChMVk1fSU5UMTYpKDIqU2FtcGxlQ291bnQpKTsgICAgICAgICAgICAvKiBMZWZ0IGFuZCByaWdodCAqLwotICAgICAgICAgICAgfQotCi0gICAgICAgICAgICAvKgotICAgICAgICAgICAgICogQXBwbHkgdHJlYmxlIGJvb3N0IGlmIHJlcXVpcmVkCi0gICAgICAgICAgICAgKi8KLSAgICAgICAgICAgIGlmIChwSW5zdGFuY2UtPlRFX0FjdGl2ZSA9PSBMVk1fVFJVRSkKLSAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAvKgotICAgICAgICAgICAgICAgICAqIEFwcGx5IHRoZSBmaWx0ZXIKLSAgICAgICAgICAgICAgICAgKi8KLSAgICAgICAgICAgICAgICBGT18ySV9EMTZGMzJDMTVfTFNoeF9UUkNfV1JBXzAxKCZwSW5zdGFuY2UtPnBURV9TdGF0ZS0+VHJlYmxlQm9vc3RfU3RhdGUsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcFByb2Nlc3NlZCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwUHJvY2Vzc2VkLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChMVk1fSU5UMTYpU2FtcGxlQ291bnQpOwotCi0gICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgIC8qCi0gICAgICAgICAgICAgKiBWb2x1bWUgYmFsYW5jZQotICAgICAgICAgICAgICovCi0gICAgICAgICAgICBMVkNfTWl4U29mdF8xU3RfMmlfRDE2QzMxX1NBVCgmcEluc3RhbmNlLT5WQ19CYWxhbmNlTWl4LAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwUHJvY2Vzc2VkLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwUHJvY2Vzc2VkLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBTYW1wbGVDb3VudCk7Ci0KLSAgICAgICAgICAgIC8qCi0gICAgICAgICAgICAgKiBQZXJmb3JtIFBhcmFtZXRyaWMgU3BlY3R1bSBBbmFseXNpcwotICAgICAgICAgICAgICovCi0gICAgICAgICAgICBpZiAoKHBJbnN0YW5jZS0+UGFyYW1zLlBTQV9FbmFibGUgPT0gTFZNX1BTQV9PTikmJihwSW5zdGFuY2UtPkluc3RQYXJhbXMuUFNBX0luY2x1ZGVkPT1MVk1fUFNBX09OKSkKLSAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAgICAgRnJvbTJpVG9Nb25vXzE2KHBQcm9jZXNzZWQsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBJbnN0YW5jZS0+cFBTQUlucHV0LAotICAgICAgICAgICAgICAgICAgICAgICAgICAgIChMVk1fSU5UMTYpIChTYW1wbGVDb3VudCkpOwotCi0gICAgICAgICAgICAgICAgICAgIExWUFNBX1Byb2Nlc3MocEluc3RhbmNlLT5oUFNBSW5zdGFuY2UsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgcEluc3RhbmNlLT5wUFNBSW5wdXQsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgKExWTV9VSU5UMTYpIChTYW1wbGVDb3VudCksCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgQXVkaW9UaW1lKTsKLSAgICAgICAgICAgIH0KLQotCi0gICAgICAgICAgICAvKgotICAgICAgICAgICAgICogREMgcmVtb3ZhbAotICAgICAgICAgICAgICovCi0gICAgICAgICAgICBEQ18ySV9EMTZfVFJDX1dSQV8wMSgmcEluc3RhbmNlLT5EQ19SZW1vdmFsSW5zdGFuY2UsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwUHJvY2Vzc2VkLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcFByb2Nlc3NlZCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChMVk1fSU5UMTYpU2FtcGxlQ291bnQpOwotCi0KLSAgICAgICAgfQotCi0gICAgICAgIC8qCi0gICAgICAgICAqIE1hbmFnZSB0aGUgb3V0cHV0IGJ1ZmZlcgotICAgICAgICAgKi8KLSAgICAgICAgTFZNX0J1ZmZlck91dChoSW5zdGFuY2UsCi0gICAgICAgICAgICAgICAgICAgICAgcE91dERhdGEsCi0gICAgICAgICAgICAgICAgICAgICAgJlNhbXBsZUNvdW50KTsKLQotICAgIH0KLQotICAgIHJldHVybihMVk1fU1VDQ0VTUyk7Ci19CmRpZmYgLS1naXQgYS9tZWRpYS9saWJlZmZlY3RzL2x2bS9saWIvQnVuZGxlL3NyYy9MVk1fVGFibGVzLmMgYi9tZWRpYS9saWJlZmZlY3RzL2x2bS9saWIvQnVuZGxlL3NyYy9MVk1fVGFibGVzLmMKZGVsZXRlZCBmaWxlIG1vZGUgMTAwNjQ0CmluZGV4IGUxNGY5MDkuLjAwMDAwMDAKLS0tIGEvbWVkaWEvbGliZWZmZWN0cy9sdm0vbGliL0J1bmRsZS9zcmMvTFZNX1RhYmxlcy5jCisrKyAvZGV2L251bGwKQEAgLTEsMzg5ICswLDAgQEAKLS8qCi0gKiBDb3B5cmlnaHQgKEMpIDIwMDQtMjAxMCBOWFAgU29mdHdhcmUKLSAqIENvcHlyaWdodCAoQykgMjAxMCBUaGU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AgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotCi0jaW5jbHVkZSAiTFZNX1RhYmxlcy5oIgotI2luY2x1ZGUgIkxWTV9Db2VmZnMuaCIKLQotLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLS8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgICBUcmVibGUgQm9vc3QgRmlsdGVyIENvZWZmaWNpZW50cyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0KLUZPX0MxNl9MU2h4X0NvZWZzX3QgICAgTFZNX1RyZWJsZUJvb3N0Q29lZnNbXSA9IHsKLQotICAgICAgICAgICAgICAgICAgICAvKiAyMmtIeiBzYW1wbGluZyByYXRlICovCi0gICAgICAgICAgICAgICAgICAgIHtIUEZfRnMyMjA1MF9HYWluMV9BMSwgICAgICAgICAgICAgLyogR2FpbiBzZXR0aW5nIDEgKi8KLSAgICAgICAgICAgICAgICAgICAgIEhQRl9GczIyMDUwX0dhaW4xX0EwLAotICAgICAgICAgICAgICAgICAgICAgLUhQRl9GczIyMDUwX0dhaW4xX0IxLAotICAgICAgICAgICAgICAgICAgICBIUEZfRnMyMjA1MF9HYWluMV9TaGlmdH0sCi0gICAgICAgICAgICAgICAgICAgIHtIUEZfRnMyMjA1MF9HYWluMl9BMSwgICAgICAgICAgICAgLyogR2FpbiBzZXR0aW5nIDIgKi8KLSAgICAgICAgICAgICAgICAgICAgIEhQRl9GczIyMDUwX0dhaW4yX0EwLAotICAgICAgICAgICAgICAgICAgICAgLUhQRl9GczIyMDUwX0dhaW4yX0IxLAotICAgICAgICAgICAgICAgICAgICBIUEZfRnMyMjA1MF9HYWluMl9TaGlmdH0sCi0gICAgICAgICAgICAgICAgICAgIHtIUEZfRnMyMjA1MF9HYWluM19BMSwgICAgICAgICAgICAgLyogR2FpbiBzZXR0aW5nIDMgKi8KLSAgICAgICAgICAgICAgICAgICAgIEhQRl9GczIyMDUwX0dhaW4zX0EwLAotICAgICAgICAgICAgICAgICAgICAgLUhQRl9GczIyMDUwX0dhaW4zX0IxLAotICAgICAgICAgICAgICAgICAgICBIUEZfRnMyMjA1MF9HYWluM19TaGlmdH0sCi0gICAgICAgICAgICAgICAgICAgIHtIUEZfRnMyMjA1MF9HYWluNF9BMSwgICAgICAgICAgICAgLyogR2FpbiBzZXR0aW5nIDQgKi8KLSAgICAgICAgICAgICAgICAgICAgIEhQRl9GczIyMDUwX0dhaW40X0EwLAotICAgICAgICAgICAgICAgICAgICAgLUhQRl9GczIyMDUwX0dhaW40X0IxLAotICAgICAgICAgICAgICAgICAgICBIUEZfRnMyMjA1MF9HYWluNF9TaGlmdH0sCi0gICAgICAgICAgICAgICAgICAgIHtIUEZfRnMyMjA1MF9HYWluNV9BMSwgICAgICAgICAgICAgLyogR2FpbiBzZXR0aW5nIDUgKi8KLSAgICAgICAgICAgICAgICAgICAgIEhQRl9GczIyMDUwX0dhaW41X0EwLAotICAgICAgICAgICAgICAgICAgICAgLUhQRl9GczIyMDUwX0dhaW41X0IxLAotICAgICAgICAgICAgICAgICAgICBIUEZfRnMyMjA1MF9HYWluNV9TaGlmdH0sCi0gICAgICAgICAgICAgICAgICAgIHtIUEZfRnMyMjA1MF9HYWluNl9BMSwgICAgICAgICAgICAgLyogR2FpbiBzZXR0aW5nIDYgKi8KLSAgICAgICAgICAgICAgICAgICAgIEhQRl9GczIyMDUwX0dhaW42X0EwLAotICAgICAgICAgICAgICAgICAgICAgLUhQRl9GczIyMDUwX0dhaW42X0IxLAotICAgICAgICAgICAgICAgICAgICBIUEZfRnMyMjA1MF9HYWluNl9TaGlmdH0sCi0gICAgICAgICAgICAgICAgICAgIHtIUEZfRnMyMjA1MF9HYWluN19BMSwgICAgICAgICAgICAgLyogR2FpbiBzZXR0aW5nIDcgKi8KLSAgICAgICAgICAgICAgICAgICAgIEhQRl9GczIyMDUwX0dhaW43X0EwLAotICAgICAgICAgICAgICAgICAgICAgLUhQRl9GczIyMDUwX0dhaW43X0IxLAotICAgICAgICAgICAgICAgICAgICBIUEZfRnMyMjA1MF9HYWluN19TaGlmdH0sCi0gICAgICAgICAgICAgICAgICAgIHtIUEZfRnMyMjA1MF9HYWluOF9BMSwgICAgICAgICAgICAgLyogR2FpbiBzZXR0aW5nIDggKi8KLSAgICAgICAgICAgICAgICAgICAgIEhQRl9GczIyMDUwX0dhaW44X0EwLAotICAgICAgICAgICAgICAgICAgICAgLUhQRl9GczIyMDUwX0dhaW44X0IxLAotICAgICAgICAgICAgICAgICAgICBIUEZfRnMyMjA1MF9HYWluOF9TaGlmdH0sCi0gICAgICAgICAgICAgICAgICAgIHtIUEZfRnMyMjA1MF9HYWluOV9BMSwgICAgICAgICAgICAgLyogR2FpbiBzZXR0aW5nIDkgKi8KLSAgICAgICAgICAgICAgICAgICAgIEhQRl9GczIyMDUwX0dhaW45X0EwLAotICAgICAgICAgICAgICAgICAgICAgLUhQRl9GczIyMDUwX0dhaW45X0IxLAotICAgICAgICAgICAgICAgICAgICBIUEZfRnMyMjA1MF9HYWluOV9TaGlmdH0sCi0gICAgICAgICAgICAgICAgICAgIHtIUEZfRnMyMjA1MF9HYWluMTBfQTEsICAgICAgICAgICAgIC8qIEdhaW4gc2V0dGluZyAxMCAqLwotICAgICAgICAgICAgICAgICAgICAgSFBGX0ZzMjIwNTBfR2FpbjEwX0EwLAotICAgICAgICAgICAgICAgICAgICAgLUhQRl9GczIyMDUwX0dhaW4xMF9CMSwKLSAgICAgICAgICAgICAgICAgICAgSFBGX0ZzMjIwNTBfR2FpbjEwX1NoaWZ0fSwKLSAgICAgICAgICAgICAgICAgICAge0hQRl9GczIyMDUwX0dhaW4xMV9BMSwgICAgICAgICAgICAgLyogR2FpbiBzZXR0aW5nIDExICovCi0gICAgICAgICAgICAgICAgICAgICBIUEZfRnMyMjA1MF9HYWluMTFfQTAsCi0gICAgICAgICAgICAgICAgICAgICAtSFBGX0ZzMjIwNTBfR2FpbjExX0IxLAotICAgICAgICAgICAgICAgICAgICBIUEZfRnMyMjA1MF9HYWluMTFfU2hpZnR9LAotICAgICAgICAgICAgICAgICAgICB7SFBGX0ZzMjIwNTBfR2FpbjEyX0ExLCAgICAgICAgICAgICAvKiBHYWluIHNldHRpbmcgMTIgKi8KLSAgICAgICAgICAgICAgICAgICAgIEhQRl9GczIyMDUwX0dhaW4xMl9BMCwKLSAgICAgICAgICAgICAgICAgICAgIC1IUEZfRnMyMjA1MF9HYWluMTJfQjEsCi0gICAgICAgICAgICAgICAgICAgIEhQRl9GczIyMDUwX0dhaW4xMl9TaGlmdH0sCi0gICAgICAgICAgICAgICAgICAgIHtIUEZfRnMyMjA1MF9HYWluMTNfQTEsICAgICAgICAgICAgIC8qIEdhaW4gc2V0dGluZyAxMyAqLwotICAgICAgICAgICAgICAgICAgICAgSFBGX0ZzMjIwNTBfR2FpbjEzX0EwLAotICAgICAgICAgICAgICAgICAgICAgLUhQRl9GczIyMDUwX0dhaW4xM19CMSwKLSAgICAgICAgICAgICAgICAgICAgSFBGX0ZzMjIwNTBfR2FpbjEzX1NoaWZ0fSwKLSAgICAgICAgICAgICAgICAgICAge0hQRl9GczIyMDUwX0dhaW4xNF9BMSwgICAgICAgICAgICAgLyogR2FpbiBzZXR0aW5nIDE0ICovCi0gICAgICAgICAgICAgICAgICAgICBIUEZfRnMyMjA1MF9HYWluMTRfQTAsCi0gICAgICAgICAgICAgICAgICAgICAtSFBGX0ZzMjIwNTBfR2FpbjE0X0IxLAotICAgICAgICAgICAgICAgICAgICBIUEZfRnMyMjA1MF9HYWluMTRfU2hpZnR9LAotICAgICAgICAgICAgICAgICAgICB7SFBGX0ZzMjIwNTBfR2FpbjE1X0ExLCAgICAgICAgICAgICAvKiBHYWluIHNldHRpbmcgMTUgKi8KLSAgICAgICAgICAgICAgICAgICAgIEhQRl9GczIyMDUwX0dhaW4xNV9BMCwKLSAgICAgICAgICAgICAgICAgICAgIC1IUEZfRnMyMjA1MF9HYWluMTVfQjEsCi0gICAgICAgICAgICAgICAgICAgIEhQRl9GczIyMDUwX0dhaW4xNV9TaGlmdH0sCi0KLSAgICAgICAgICAgICAgICAgICAgLyogMjRrSHogc2FtcGxpbmcgcmF0ZSAqLwotICAgICAgICAgICAgICAgICAgICB7SFBGX0ZzMjQwMDBfR2FpbjFfQTEsICAgICAgICAgICAgIC8qIEdhaW4gc2V0dGluZyAxICovCi0gICAgICAgICAgICAgICAgICAgICBIUEZfRnMyNDAwMF9HYWluMV9BMCwKLSAgICAgICAgICAgICAgICAgICAgIC1IUEZfRnMyNDAwMF9HYWluMV9CMSwKLSAgICAgICAgICAgICAgICAgICAgIEhQRl9GczI0MDAwX0dhaW4xX1NoaWZ0fSwKLSAgICAgICAgICAgICAgICAgICAge0hQRl9GczI0MDAwX0dhaW4yX0ExLCAgICAgICAgICAgICAvKiBHYWluIHNldHRpbmcgMiAqLwotICAgICAgICAgICAgICAgICAgICAgSFBGX0ZzMjQwMDBfR2FpbjJfQTAsCi0gICAgICAgICAgICAgICAgICAgICAtSFBGX0ZzMjQwMDBfR2FpbjJfQjEsCi0gICAgICAgICAgICAgICAgICAgICBIUEZfRnMyNDAwMF9HYWluMl9TaGlmdH0sCi0gICAgICAgICAgICAgICAgICAgIHtIUEZfRnMyNDAwMF9HYWluM19BMSwgICAgICAgICAgICAgLyogR2FpbiBzZXR0aW5nIDMgKi8KLSAgICAgICAgICAgICAgICAgICAgIEhQRl9GczI0MDAwX0dhaW4zX0EwLAotICAgICAgICAgICAgICAgICAgICAgLUhQRl9GczI0MDAwX0dhaW4zX0IxLAotICAgICAgICAgICAgICAgICAgICAgSFBGX0ZzMjQwMDBfR2FpbjNfU2hpZnR9LAotICAgICAgICAgICAgICAgICAgICB7SFBGX0ZzMjQwMDBfR2FpbjRfQTEsICAgICAgICAgICAgIC8qIEdhaW4gc2V0dGluZyA0ICovCi0gICAgICAgICAgICAgICAgICAgICBIUEZfRnMyNDAwMF9HYWluNF9BMCwKLSAgICAgICAgICAgICAgICAgICAgIC1IUEZfRnMyNDAwMF9HYWluNF9CMSwKLSAgICAgICAgICAgICAgICAgICAgIEhQRl9GczI0MDAwX0dhaW40X1NoaWZ0fSwKLSAgICAgICAgICAgICAgICAgICAge0hQRl9GczI0MDAwX0dhaW41X0ExLCAgICAgICAgICAgICAvKiBHYWluIHNldHRpbmcgNSAqLwotICAgICAgICAgICAgICAgICAgICAgSFBGX0ZzMjQwMDBfR2FpbjVfQTAsCi0gICAgICAgICAgICAgICAgICAgICAtSFBGX0ZzMjQwMDBfR2FpbjVfQjEsCi0gICAgICAgICAgICAgICAgICAgICBIUEZfRnMyNDAwMF9HYWluNV9TaGlmdH0sCi0gICAgICAgICAgICAgICAgICAgIHtIUEZfRnMyNDAwMF9HYWluNl9BMSwgICAgICAgICAgICAgLyogR2FpbiBzZXR0aW5nIDYgKi8KLSAgICAgICAgICAgICAgICAgICAgIEhQRl9GczI0MDAwX0dhaW42X0EwLAotICAgICAgICAgICAgICAgICAgICAgLUhQRl9GczI0MDAwX0dhaW42X0IxLAotICAgICAgICAgICAgICAgICAgICAgSFBGX0ZzMjQwMDBfR2FpbjZfU2hpZnR9LAotICAgICAgICAgICAgICAgICAgICB7SFBGX0ZzMjQwMDBfR2FpbjdfQTEsICAgICAgICAgICAgIC8qIEdhaW4gc2V0dGluZyA3ICovCi0gICAgICAgICAgICAgICAgICAgICBIUEZfRnMyNDAwMF9HYWluN19BMCwKLSAgICAgICAgICAgICAgICAgICAgIC1IUEZfRnMyNDAwMF9HYWluN19CMSwKLSAgICAgICAgICAgICAgICAgICAgIEhQRl9GczI0MDAwX0dhaW43X1NoaWZ0fSwKLSAgICAgICAgICAgICAgICAgICAge0hQRl9GczI0MDAwX0dhaW44X0ExLCAgICAgICAgICAgICAvKiBHYWluIHNldHRpbmcgOCAqLwotICAgICAgICAgICAgICAgICAgICAgSFBGX0ZzMjQwMDBfR2FpbjhfQTAsCi0gICAgICAgICAgICAgICAgICAgICAtSFBGX0ZzMjQwMDBfR2FpbjhfQjEsCi0gICAgICAgICAgICAgICAgICAgICBIUEZfRnMyNDAwMF9HYWluOF9TaGlmdH0sCi0gICAgICAgICAgICAgICAgICAgIHtIUEZfRnMyNDAwMF9HYWluOV9BMSwgICAgICAgICAgICAgLyogR2FpbiBzZXR0aW5nIDkgKi8KLSAgICAgICAgICAgICAgICAgICAgIEhQRl9GczI0MDAwX0dhaW45X0EwLAotICAgICAgICAgICAgICAgICAgICAgLUhQRl9GczI0MDAwX0dhaW45X0IxLAotICAgICAgICAgICAgICAgICAgICAgSFBGX0ZzMjQwMDBfR2FpbjlfU2hpZnR9LAotICAgICAgICAgICAgICAgICAgICB7SFBGX0ZzMjQwMDBfR2FpbjEwX0ExLCAgICAgICAgICAgICAvKiBHYWluIHNldHRpbmcgMTAgKi8KLSAgICAgICAgICAgICAgICAgICAgIEhQRl9GczI0MDAwX0dhaW4xMF9BMCwKLSAgICAgICAgICAgICAgICAgICAgIC1IUEZfRnMyNDAwMF9HYWluMTBfQjEsCi0gICAgICAgICAgICAgICAgICAgICBIUEZfRnMyNDAwMF9HYWluMTBfU2hpZnR9LAotICAgICAgICAgICAgICAgICAgICB7SFBGX0ZzMjQwMDBfR2FpbjExX0ExLCAgICAgICAgICAgICAvKiBHYWluIHNldHRpbmcgMTEgKi8KLSAgICAgICAgICAgICAgICAgICAgIEhQRl9GczI0MDAwX0dhaW4xMV9BMCwKLSAgICAgICAgICAgICAgICAgICAgIC1IUEZfRnMyNDAwMF9HYWluMTFfQjEsCi0gICAgICAgICAgICAgICAgICAgICBIUEZfRnMyNDAwMF9HYWluMTFfU2hpZnR9LAotICAgICAgICAgICAgICAgICAgICB7SFBGX0ZzMjQwMDBfR2FpbjEyX0ExLCAgICAgICAgICAgICAvKiBHYWluIHNldHRpbmcgMTIgKi8KLSAgICAgICAgICAgICAgICAgICAgIEhQRl9GczI0MDAwX0dhaW4xMl9BMCwKLSAgICAgICAgICAgICAgICAgICAgIC1IUEZfRnMyNDAwMF9HYWluMTJfQjEsCi0gICAgICAgICAgICAgICAgICAgICBIUEZfRnMyNDAwMF9HYWluMTJfU2hpZnR9LAotICAgICAgICAgICAgICAgICAgICB7SFBGX0ZzMjQwMDBfR2FpbjEzX0ExLCAgICAgICAgICAgICAvKiBHYWluIHNldHRpbmcgMTMgKi8KLSAgICAgICAgICAgICAgICAgICAgIEhQRl9GczI0MDAwX0dhaW4xM19BMCwKLSAgICAgICAgICAgICAgICAgICAgIC1IUEZfRnMyNDAwMF9HYWluMTNfQjEsCi0gICAgICAgICAgICAgICAgICAgICBIUEZfRnMyNDAwMF9HYWluMTNfU2hpZnR9LAotICAgICAgICAgICAgICAgICAgICB7SFBGX0ZzMjQwMDBfR2FpbjE0X0ExLCAgICAgICAgICAgICAvKiBHYWluIHNldHRpbmcgMTQgKi8KLSAgICAgICAgICAgICAgICAgICAgIEhQRl9GczI0MDAwX0dhaW4xNF9BMCwKLSAgICAgICAgICAgICAgICAgICAgIC1IUEZfRnMyNDAwMF9HYWluMTRfQjEsCi0gICAgICAgICAgICAgICAgICAgICBIUEZfRnMyNDAwMF9HYWluMTRfU2hpZnR9LAotICAgICAgICAgICAgICAgICAgICB7SFBGX0ZzMjQwMDBfR2FpbjE1X0ExLCAgICAgICAgICAgICAvKiBHYWluIHNldHRpbmcgMTUgKi8KLSAgICAgICAgICAgICAgICAgICAgIEhQRl9GczI0MDAwX0dhaW4xNV9BMCwKLSAgICAgICAgICAgICAgICAgICAgIC1IUEZfRnMyNDAwMF9HYWluMTVfQjEsCi0gICAgICAgICAgICAgICAgICAgICBIUEZfRnMyNDAwMF9HYWluMTVfU2hpZnR9LAotCi0gICAgICAgICAgICAgICAgICAgIC8qIDMya0h6IHNhbXBsaW5nIHJhdGUgKi8KLSAgICAgICAgICAgICAgICAgICAge0hQRl9GczMyMDAwX0dhaW4xX0ExLCAgICAgICAgICAgICAvKiBHYWluIHNldHRpbmcgMSAqLwotICAgICAgICAgICAgICAgICAgICAgSFBGX0ZzMzIwMDBfR2FpbjFfQTAsCi0gICAgICAgICAgICAgICAgICAgICAtSFBGX0ZzMzIwMDBfR2FpbjFfQjEsCi0gICAgICAgICAgICAgICAgICAgIEhQRl9GczMyMDAwX0dhaW4xX1NoaWZ0fSwKLSAgICAgICAgICAgICAgICAgICAge0hQRl9GczMyMDAwX0dhaW4yX0ExLCAgICAgICAgICAgICAvKiBHYWluIHNldHRpbmcgMiAqLwotICAgICAgICAgICAgICAgICAgICAgSFBGX0ZzMzIwMDBfR2FpbjJfQTAsCi0gICAgICAgICAgICAgICAgICAgICAtSFBGX0ZzMzIwMDBfR2FpbjJfQjEsCi0gICAgICAgICAgICAgICAgICAgIEhQRl9GczMyMDAwX0dhaW4yX1NoaWZ0fSwKLSAgICAgICAgICAgICAgICAgICAge0hQRl9GczMyMDAwX0dhaW4zX0ExLCAgICAgICAgICAgICAvKiBHYWluIHNldHRpbmcgMyAqLwotICAgICAgICAgICAgICAgICAgICAgSFBGX0ZzMzIwMDBfR2FpbjNfQTAsCi0gICAgICAgICAgICAgICAgICAgICAtSFBGX0ZzMzIwMDBfR2FpbjNfQjEsCi0gICAgICAgICAgICAgICAgICAgIEhQRl9GczMyMDAwX0dhaW4zX1NoaWZ0fSwKLSAgICAgICAgICAgICAgICAgICAge0hQRl9GczMyMDAwX0dhaW40X0ExLCAgICAgICAgICAgICAvKiBHYWluIHNldHRpbmcgNCAqLwotICAgICAgICAgICAgICAgICAgICAgSFBGX0ZzMzIwMDBfR2FpbjRfQTAsCi0gICAgICAgICAgICAgICAgICAgICAtSFBGX0ZzMzIwMDBfR2FpbjRfQjEsCi0gICAgICAgICAgICAgICAgICAgIEhQRl9GczMyMDAwX0dhaW40X1NoaWZ0fSwKLSAgICAgICAgICAgICAgICAgICAge0hQRl9GczMyMDAwX0dhaW41X0ExLCAgICAgICAgICAgICAvKiBHYWluIHNldHRpbmcgNSAqLwotICAgICAgICAgICAgICAgICAgICAgSFBGX0ZzMzIwMDBfR2FpbjVfQTAsCi0gICAgICAgICAgICAgICAgICAgICAtSFBGX0ZzMzIwMDBfR2FpbjVfQjEsCi0gICAgICAgICAgICAgICAgICAgIEhQRl9GczMyMDAwX0dhaW41X1NoaWZ0fSwKLSAgICAgICAgICAgICAgICAgICAge0hQRl9GczMyMDAwX0dhaW42X0ExLCAgICAgICAgICAgICAvKiBHYWluIHNldHRpbmcgNiAqLwotICAgICAgICAgICAgICAgICAgICAgSFBGX0ZzMzIwMDBfR2FpbjZfQTAsCi0gICAgICAgICAgICAgICAgICAgICAtSFBGX0ZzMzIwMDBfR2FpbjZfQjEsCi0gICAgICAgICAgICAgICAgICAgIEhQRl9GczMyMDAwX0dhaW42X1NoaWZ0fSwKLSAgICAgICAgICAgICAgICAgICAge0hQRl9GczMyMDAwX0dhaW43X0ExLCAgICAgICAgICAgICAvKiBHYWluIHNldHRpbmcgNyAqLwotICAgICAgICAgICAgICAgICAgICAgSFBGX0ZzMzIwMDBfR2FpbjdfQTAsCi0gICAgICAgICAgICAgICAgICAgICAtSFBGX0ZzMzIwMDBfR2FpbjdfQjEsCi0gICAgICAgICAgICAgICAgICAgIEhQRl9GczMyMDAwX0dhaW43X1NoaWZ0fSwKLSAgICAgICAgICAgICAgICAgICAge0hQRl9GczMyMDAwX0dhaW44X0ExLCAgICAgICAgICAgICAvKiBHYWluIHNldHRpbmcgOCAqLwotICAgICAgICAgICAgICAgICAgICAgSFBGX0ZzMzIwMDBfR2FpbjhfQTAsCi0gICAgICAgICAgICAgICAgICAgICAtSFBGX0ZzMzIwMDBfR2FpbjhfQjEsCi0gICAgICAgICAgICAgICAgICAgIEhQRl9GczMyMDAwX0dhaW44X1NoaWZ0fSwKLSAgICAgICAgICAgICAgICAgICAge0hQRl9GczMyMDAwX0dhaW45X0ExLCAgICAgICAgICAgICAvKiBHYWluIHNldHRpbmcgOSAqLwotICAgICAgICAgICAgICAgICAgICAgSFBGX0ZzMzIwMDBfR2FpbjlfQTAsCi0gICAgICAgICAgICAgICAgICAgICAtSFBGX0ZzMzIwMDBfR2FpbjlfQjEsCi0gICAgICAgICAgICAgICAgICAgIEhQRl9GczMyMDAwX0dhaW45X1NoaWZ0fSwKLSAgICAgICAgICAgICAgICAgICAge0hQRl9GczMyMDAwX0dhaW4xMF9BMSwgICAgICAgICAgICAgLyogR2FpbiBzZXR0aW5nIDEwICovCi0gICAgICAgICAgICAgICAgICAgICBIUEZfRnMzMjAwMF9HYWluMTBfQTAsCi0gICAgICAgICAgICAgICAgICAgICAtSFBGX0ZzMzIwMDBfR2FpbjEwX0IxLAotICAgICAgICAgICAgICAgICAgICBIUEZfRnMzMjAwMF9HYWluMTBfU2hpZnR9LAotICAgICAgICAgICAgICAgICAgICB7SFBGX0ZzMzIwMDBfR2FpbjExX0ExLCAgICAgICAgICAgICAvKiBHYWluIHNldHRpbmcgMTEgKi8KLSAgICAgICAgICAgICAgICAgICAgIEhQRl9GczMyMDAwX0dhaW4xMV9BMCwKLSAgICAgICAgICAgICAgICAgICAgIC1IUEZfRnMzMjAwMF9HYWluMTFfQjEsCi0gICAgICAgICAgICAgICAgICAgIEhQRl9GczMyMDAwX0dhaW4xMV9TaGlmdH0sCi0gICAgICAgICAgICAgICAgICAgIHtIUEZfRnMzMjAwMF9HYWluMTJfQTEsICAgICAgICAgICAgIC8qIEdhaW4gc2V0dGluZyAxMiAqLwotICAgICAgICAgICAgICAgICAgICAgSFBGX0ZzMzIwMDBfR2FpbjEyX0EwLAotICAgICAgICAgICAgICAgICAgICAgLUhQRl9GczMyMDAwX0dhaW4xMl9CMSwKLSAgICAgICAgICAgICAgICAgICAgSFBGX0ZzMzIwMDBfR2FpbjEyX1NoaWZ0fSwKLSAgICAgICAgICAgICAgICAgICAge0hQRl9GczMyMDAwX0dhaW4xM19BMSwgICAgICAgICAgICAgLyogR2FpbiBzZXR0aW5nIDEzICovCi0gICAgICAgICAgICAgICAgICAgICBIUEZfRnMzMjAwMF9HYWluMTNfQTAsCi0gICAgICAgICAgICAgICAgICAgICAtSFBGX0ZzMzIwMDBfR2FpbjEzX0IxLAotICAgICAgICAgICAgICAgICAgICBIUEZfRnMzMjAwMF9HYWluMTNfU2hpZnR9LAotICAgICAgICAgICAgICAgICAgICB7SFBGX0ZzMzIwMDBfR2FpbjE0X0ExLCAgICAgICAgICAgICAvKiBHYWluIHNldHRpbmcgMTQgKi8KLSAgICAgICAgICAgICAgICAgICAgIEhQRl9GczMyMDAwX0dhaW4xNF9BMCwKLSAgICAgICAgICAgICAgICAgICAgIC1IUEZfRnMzMjAwMF9HYWluMTRfQjEsCi0gICAgICAgICAgICAgICAgICAgIEhQRl9GczMyMDAwX0dhaW4xNF9TaGlmdH0sCi0gICAgICAgICAgICAgICAgICAgIHtIUEZfRnMzMjAwMF9HYWluMTVfQTEsICAgICAgICAgICAgIC8qIEdhaW4gc2V0dGluZyAxNSAqLwotICAgICAgICAgICAgICAgICAgICAgSFBGX0ZzMzIwMDBfR2FpbjE1X0EwLAotICAgICAgICAgICAgICAgICAgICAgLUhQRl9GczMyMDAwX0dhaW4xNV9CMSwKLSAgICAgICAgICAgICAgICAgICAgSFBGX0ZzMzIwMDBfR2FpbjE1X1NoaWZ0fSwKLQotICAgICAgICAgICAgICAgICAgICAvKiA0NGtIeiBzYW1wbGluZyByYXRlICovCi0gICAgICAgICAgICAgICAgICAgIHtIUEZfRnM0NDEwMF9HYWluMV9BMSwgICAgICAgICAgICAgLyogR2FpbiBzZXR0aW5nIDEgKi8KLSAgICAgICAgICAgICAgICAgICAgIEhQRl9GczQ0MTAwX0dhaW4xX0EwLAotICAgICAgICAgICAgICAgICAgICAgLUhQRl9GczQ0MTAwX0dhaW4xX0IxLAotICAgICAgICAgICAgICAgICAgICAgSFBGX0ZzNDQxMDBfR2FpbjFfU2hpZnR9LAotICAgICAgICAgICAgICAgICAgICB7SFBGX0ZzNDQxMDBfR2FpbjJfQTEsICAgICAgICAgICAgIC8qIEdhaW4gc2V0dGluZyAyICovCi0gICAgICAgICAgICAgICAgICAgICBIUEZfRnM0NDEwMF9HYWluMl9BMCwKLSAgICAgICAgICAgICAgICAgICAgIC1IUEZfRnM0NDEwMF9HYWluMl9CMSwKLSAgICAgICAgICAgICAgICAgICAgIEhQRl9GczQ0MTAwX0dhaW4yX1NoaWZ0fSwKLSAgICAgICAgICAgICAgICAgICAge0hQRl9GczQ0MTAwX0dhaW4zX0ExLCAgICAgICAgICAgICAvKiBHYWluIHNldHRpbmcgMyAqLwotICAgICAgICAgICAgICAgICAgICAgSFBGX0ZzNDQxMDBfR2FpbjNfQTAsCi0gICAgICAgICAgICAgICAgICAgICAtSFBGX0ZzNDQxMDBfR2FpbjNfQjEsCi0gICAgICAgICAgICAgICAgICAgICBIUEZfRnM0NDEwMF9HYWluM19TaGlmdH0sCi0gICAgICAgICAgICAgICAgICAgIHtIUEZfRnM0NDEwMF9HYWluNF9BMSwgICAgICAgICAgICAgLyogR2FpbiBzZXR0aW5nIDQgKi8KLSAgICAgICAgICAgICAgICAgICAgIEhQRl9GczQ0MTAwX0dhaW40X0EwLAotICAgICAgICAgICAgICAgICAgICAgLUhQRl9GczQ0MTAwX0dhaW40X0IxLAotICAgICAgICAgICAgICAgICAgICAgSFBGX0ZzNDQxMDBfR2FpbjRfU2hpZnR9LAotICAgICAgICAgICAgICAgICAgICB7SFBGX0ZzNDQxMDBfR2FpbjVfQTEsICAgICAgICAgICAgIC8qIEdhaW4gc2V0dGluZyA1ICovCi0gICAgICAgICAgICAgICAgICAgICBIUEZfRnM0NDEwMF9HYWluNV9BMCwKLSAgICAgICAgICAgICAgICAgICAgIC1IUEZfRnM0NDEwMF9HYWluNV9CMSwKLSAgICAgICAgICAgICAgICAgICAgIEhQRl9GczQ0MTAwX0dhaW41X1NoaWZ0fSwKLSAgICAgICAgICAgICAgICAgICAge0hQRl9GczQ0MTAwX0dhaW42X0ExLCAgICAgICAgICAgICAvKiBHYWluIHNldHRpbmcgNiAqLwotICAgICAgICAgICAgICAgICAgICAgSFBGX0ZzNDQxMDBfR2FpbjZfQTAsCi0gICAgICAgICAgICAgICAgICAgICAtSFBGX0ZzNDQxMDBfR2FpbjZfQjEsCi0gICAgICAgICAgICAgICAgICAgICBIUEZfRnM0NDEwMF9HYWluNl9TaGlmdH0sCi0gICAgICAgICAgICAgICAgICAgIHtIUEZfRnM0NDEwMF9HYWluN19BMSwgICAgICAgICAgICAgLyogR2FpbiBzZXR0aW5nIDcgKi8KLSAgICAgICAgICAgICAgICAgICAgIEhQRl9GczQ0MTAwX0dhaW43X0EwLAotICAgICAgICAgICAgICAgICAgICAgLUhQRl9GczQ0MTAwX0dhaW43X0IxLAotICAgICAgICAgICAgICAgICAgICAgSFBGX0ZzNDQxMDBfR2FpbjdfU2hpZnR9LAotICAgICAgICAgICAgICAgICAgICB7SFBGX0ZzNDQxMDBfR2FpbjhfQTEsICAgICAgICAgICAgIC8qIEdhaW4gc2V0dGluZyA4ICovCi0gICAgICAgICAgICAgICAgICAgICBIUEZfRnM0NDEwMF9HYWluOF9BMCwKLSAgICAgICAgICAgICAgICAgICAgIC1IUEZfRnM0NDEwMF9HYWluOF9CMSwKLSAgICAgICAgICAgICAgICAgICAgIEhQRl9GczQ0MTAwX0dhaW44X1NoaWZ0fSwKLSAgICAgICAgICAgICAgICAgICAge0hQRl9GczQ0MTAwX0dhaW45X0ExLCAgICAgICAgICAgICAvKiBHYWluIHNldHRpbmcgOSAqLwotICAgICAgICAgICAgICAgICAgICAgSFBGX0ZzNDQxMDBfR2FpbjlfQTAsCi0gICAgICAgICAgICAgICAgICAgICAtSFBGX0ZzNDQxMDBfR2FpbjlfQjEsCi0gICAgICAgICAgICAgICAgICAgICBIUEZfRnM0NDEwMF9HYWluOV9TaGlmdH0sCi0gICAgICAgICAgICAgICAgICAgIHtIUEZfRnM0NDEwMF9HYWluMTBfQTEsICAgICAgICAgICAgIC8qIEdhaW4gc2V0dGluZyAxMCAqLwotICAgICAgICAgICAgICAgICAgICAgSFBGX0ZzNDQxMDBfR2FpbjEwX0EwLAotICAgICAgICAgICAgICAgICAgICAgLUhQRl9GczQ0MTAwX0dhaW4xMF9CMSwKLSAgICAgICAgICAgICAgICAgICAgIEhQRl9GczQ0MTAwX0dhaW4xMF9TaGlmdH0sCi0gICAgICAgICAgICAgICAgICAgIHtIUEZfRnM0NDEwMF9HYWluMTFfQTEsICAgICAgICAgICAgIC8qIEdhaW4gc2V0dGluZyAxMSAqLwotICAgICAgICAgICAgICAgICAgICAgSFBGX0ZzNDQxMDBfR2FpbjExX0EwLAotICAgICAgICAgICAgICAgICAgICAgLUhQRl9GczQ0MTAwX0dhaW4xMV9CMSwKLSAgICAgICAgICAgICAgICAgICAgIEhQRl9GczQ0MTAwX0dhaW4xMV9TaGlmdH0sCi0gICAgICAgICAgICAgICAgICAgIHtIUEZfRnM0NDEwMF9HYWluMTJfQTEsICAgICAgICAgICAgIC8qIEdhaW4gc2V0dGluZyAxMiAqLwotICAgICAgICAgICAgICAgICAgICAgSFBGX0ZzNDQxMDBfR2FpbjEyX0EwLAotICAgICAgICAgICAgICAgICAgICAgLUhQRl9GczQ0MTAwX0dhaW4xMl9CMSwKLSAgICAgICAgICAgICAgICAgICAgIEhQRl9GczQ0MTAwX0dhaW4xMl9TaGlmdH0sCi0gICAgICAgICAgICAgICAgICAgIHtIUEZfRnM0NDEwMF9HYWluMTNfQTEsICAgICAgICAgICAgIC8qIEdhaW4gc2V0dGluZyAxMyAqLwotICAgICAgICAgICAgICAgICAgICAgSFBGX0ZzNDQxMDBfR2FpbjEzX0EwLAotICAgICAgICAgICAgICAgICAgICAgLUhQRl9GczQ0MTAwX0dhaW4xM19CMSwKLSAgICAgICAgICAgICAgICAgICAgIEhQRl9GczQ0MTAwX0dhaW4xM19TaGlmdH0sCi0gICAgICAgICAgICAgICAgICAgIHtIUEZfRnM0NDEwMF9HYWluMTRfQTEsICAgICAgICAgICAgIC8qIEdhaW4gc2V0dGluZyAxNCAqLwotICAgICAgICAgICAgICAgICAgICAgSFBGX0ZzNDQxMDBfR2FpbjE0X0EwLAotICAgICAgICAgICAgICAgICAgICAgLUhQRl9GczQ0MTAwX0dhaW4xNF9CMSwKLSAgICAgICAgICAgICAgICAgICAgIEhQRl9GczQ0MTAwX0dhaW4xNF9TaGlmdH0sCi0gICAgICAgICAgICAgICAgICAgIHtIUEZfRnM0NDEwMF9HYWluMTVfQTEsICAgICAgICAgICAgIC8qIEdhaW4gc2V0dGluZyAxNSAqLwotICAgICAgICAgICAgICAgICAgICAgSFBGX0ZzNDQxMDBfR2FpbjE1X0EwLAotICAgICAgICAgICAgICAgICAgICAgLUhQRl9GczQ0MTAwX0dhaW4xNV9CMSwKLSAgICAgICAgICAgICAgICAgICAgIEhQRl9GczQ0MTAwX0dhaW4xNV9TaGlmdH0sCi0KLSAgICAgICAgICAgICAgICAgICAgLyogNDhrSHogc2FtcGxpbmcgcmF0ZSAqLwotICAgICAgICAgICAgICAgICAgICB7SFBGX0ZzNDgwMDBfR2FpbjFfQTEsICAgICAgICAgICAgIC8qIEdhaW4gc2V0dGluZyAxICovCi0gICAgICAgICAgICAgICAgICAgICBIUEZfRnM0ODAwMF9HYWluMV9BMCwKLSAgICAgICAgICAgICAgICAgICAgIC1IUEZfRnM0ODAwMF9HYWluMV9CMSwKLSAgICAgICAgICAgICAgICAgICAgIEhQRl9GczQ4MDAwX0dhaW4xX1NoaWZ0fSwKLSAgICAgICAgICAgICAgICAgICAge0hQRl9GczQ4MDAwX0dhaW4yX0ExLCAgICAgICAgICAgICAvKiBHYWluIHNldHRpbmcgMiAqLwotICAgICAgICAgICAgICAgICAgICAgSFBGX0ZzNDgwMDBfR2FpbjJfQTAsCi0gICAgICAgICAgICAgICAgICAgICAtSFBGX0ZzNDgwMDBfR2FpbjJfQjEsCi0gICAgICAgICAgICAgICAgICAgICBIUEZfRnM0ODAwMF9HYWluMl9TaGlmdH0sCi0gICAgICAgICAgICAgICAgICAgIHtIUEZfRnM0ODAwMF9HYWluM19BMSwgICAgICAgICAgICAgLyogR2FpbiBzZXR0aW5nIDMgKi8KLSAgICAgICAgICAgICAgICAgICAgIEhQRl9GczQ4MDAwX0dhaW4zX0EwLAotICAgICAgICAgICAgICAgICAgICAgLUhQRl9GczQ4MDAwX0dhaW4zX0IxLAotICAgICAgICAgICAgICAgICAgICAgSFBGX0ZzNDgwMDBfR2FpbjNfU2hpZnR9LAotICAgICAgICAgICAgICAgICAgICB7SFBGX0ZzNDgwMDBfR2FpbjRfQTEsICAgICAgICAgICAgIC8qIEdhaW4gc2V0dGluZyA0ICovCi0gICAgICAgICAgICAgICAgICAgICBIUEZfRnM0ODAwMF9HYWluNF9BMCwKLSAgICAgICAgICAgICAgICAgICAgIC1IUEZfRnM0ODAwMF9HYWluNF9CMSwKLSAgICAgICAgICAgICAgICAgICAgIEhQRl9GczQ4MDAwX0dhaW40X1NoaWZ0fSwKLSAgICAgICAgICAgICAgICAgICAge0hQRl9GczQ4MDAwX0dhaW41X0ExLCAgICAgICAgICAgICAvKiBHYWluIHNldHRpbmcgNSAqLwotICAgICAgICAgICAgICAgICAgICAgSFBGX0ZzNDgwMDBfR2FpbjVfQTAsCi0gICAgICAgICAgICAgICAgICAgICAtSFBGX0ZzNDgwMDBfR2FpbjVfQjEsCi0gICAgICAgICAgICAgICAgICAgICBIUEZfRnM0ODAwMF9HYWluNV9TaGlmdH0sCi0gICAgICAgICAgICAgICAgICAgIHtIUEZfRnM0ODAwMF9HYWluNl9BMSwgICAgICAgICAgICAgLyogR2FpbiBzZXR0aW5nIDYgKi8KLSAgICAgICAgICAgICAgICAgICAgIEhQRl9GczQ4MDAwX0dhaW42X0EwLAotICAgICAgICAgICAgICAgICAgICAgLUhQRl9GczQ4MDAwX0dhaW42X0IxLAotICAgICAgICAgICAgICAgICAgICAgSFBGX0ZzNDgwMDBfR2FpbjZfU2hpZnR9LAotICAgICAgICAgICAgICAgICAgICB7SFBGX0ZzNDgwMDBfR2FpbjdfQTEsICAgICAgICAgICAgIC8qIEdhaW4gc2V0dGluZyA3ICovCi0gICAgICAgICAgICAgICAgICAgICBIUEZfRnM0ODAwMF9HYWluN19BMCwKLSAgICAgICAgICAgICAgICAgICAgIC1IUEZfRnM0ODAwMF9HYWluN19CMSwKLSAgICAgICAgICAgICAgICAgICAgIEhQRl9GczQ4MDAwX0dhaW43X1NoaWZ0fSwKLSAgICAgICAgICAgICAgICAgICAge0hQRl9GczQ4MDAwX0dhaW44X0ExLCAgICAgICAgICAgICAvKiBHYWluIHNldHRpbmcgOCAqLwotICAgICAgICAgICAgICAgICAgICAgSFBGX0ZzNDgwMDBfR2FpbjhfQTAsCi0gICAgICAgICAgICAgICAgICAgICAtSFBGX0ZzNDgwMDBfR2FpbjhfQjEsCi0gICAgICAgICAgICAgICAgICAgICBIUEZfRnM0ODAwMF9HYWluOF9TaGlmdH0sCi0gICAgICAgICAgICAgICAgICAgIHtIUEZfRnM0ODAwMF9HYWluOV9BMSwgICAgICAgICAgICAgLyogR2FpbiBzZXR0aW5nIDkgKi8KLSAgICAgICAgICAgICAgICAgICAgIEhQRl9GczQ4MDAwX0dhaW45X0EwLAotICAgICAgICAgICAgICAgICAgICAgLUhQRl9GczQ4MDAwX0dhaW45X0IxLAotICAgICAgICAgICAgICAgICAgICAgSFBGX0ZzNDgwMDBfR2FpbjlfU2hpZnR9LAotICAgICAgICAgICAgICAgICAgICB7SFBGX0ZzNDgwMDBfR2FpbjEwX0ExLCAgICAgICAgICAgICAvKiBHYWluIHNldHRpbmcgMTAgKi8KLSAgICAgICAgICAgICAgICAgICAgIEhQRl9GczQ4MDAwX0dhaW4xMF9BMCwKLSAgICAgICAgICAgICAgICAgICAgIC1IUEZfRnM0ODAwMF9HYWluMTBfQjEsCi0gICAgICAgICAgICAgICAgICAgICBIUEZfRnM0ODAwMF9HYWluMTBfU2hpZnR9LAotICAgICAgICAgICAgICAgICAgICB7SFBGX0ZzNDgwMDBfR2FpbjExX0ExLCAgICAgICAgICAgICAvKiBHYWluIHNldHRpbmcgMTEgKi8KLSAgICAgICAgICAgICAgICAgICAgIEhQRl9GczQ4MDAwX0dhaW4xMV9BMCwKLSAgICAgICAgICAgICAgICAgICAgIC1IUEZfRnM0ODAwMF9HYWluMTFfQjEsCi0gICAgICAgICAgICAgICAgICAgICBIUEZfRnM0ODAwMF9HYWluMTFfU2hpZnR9LAotICAgICAgICAgICAgICAgICAgICB7SFBGX0ZzNDgwMDBfR2FpbjEyX0ExLCAgICAgICAgICAgICAvKiBHYWluIHNldHRpbmcgMTIgKi8KLSAgICAgICAgICAgICAgICAgICAgIEhQRl9GczQ4MDAwX0dhaW4xMl9BMCwKLSAgICAgICAgICAgICAgICAgICAgIC1IUEZfRnM0ODAwMF9HYWluMTJfQjEsCi0gICAgICAgICAgICAgICAgICAgICBIUEZfRnM0ODAwMF9HYWluMTJfU2hpZnR9LAotICAgICAgICAgICAgICAgICAgICB7SFBGX0ZzNDgwMDBfR2FpbjEzX0ExLCAgICAgICAgICAgICAvKiBHYWluIHNldHRpbmcgMTMgKi8KLSAgICAgICAgICAgICAgICAgICAgIEhQRl9GczQ4MDAwX0dhaW4xM19BMCwKLSAgICAgICAgICAgICAgICAgICAgIC1IUEZfRnM0ODAwMF9HYWluMTNfQjEsCi0gICAgICAgICAgICAgICAgICAgICBIUEZfRnM0ODAwMF9HYWluMTNfU2hpZnR9LAotICAgICAgICAgICAgICAgICAgICB7SFBGX0ZzNDgwMDBfR2FpbjE0X0ExLCAgICAgICAgICAgICAvKiBHYWluIHNldHRpbmcgMTQgKi8KLSAgICAgICAgICAgICAgICAgICAgIEhQRl9GczQ4MDAwX0dhaW4xNF9BMCwKLSAgICAgICAgICAgICAgICAgICAgIC1IUEZfRnM0ODAwMF9HYWluMTRfQjEsCi0gICAgICAgICAgICAgICAgICAgICBIUEZfRnM0ODAwMF9HYWluMTRfU2hpZnR9LAotICAgICAgICAgICAgICAgICAgICB7SFBGX0ZzNDgwMDBfR2FpbjE1X0ExLCAgICAgICAgICAgICAvKiBHYWluIHNldHRpbmcgMTUgKi8KLSAgICAgICAgICAgICAgICAgICAgIEhQRl9GczQ4MDAwX0dhaW4xNV9BMCwKLSAgICAgICAgICAgICAgICAgICAgIC1IUEZfRnM0ODAwMF9HYWluMTVfQjEsCi0gICAgICAgICAgICAgICAgICAgICBIUEZfRnM0ODAwMF9HYWluMTVfU2hpZnR9fTsKLQotCi0vKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotLyogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogICAgVm9sdW1lIGNvbnRyb2wgZ2FpbiBhbmQgdGltZSBjb25zdGFudCB0YWJsZXMgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLQotLyogZEIgdG8gbGluZWFyIGNvbnZlcnNpb24gdGFibGUgKi8KLWNvbnN0IExWTV9JTlQxNiBMVk1fVm9sdW1lVGFibGVbXSA9IHsKLSAgICAweDdGRkYsICAgICAgICAgICAgIC8qICAwZEIgKi8KLSAgICAweDcyMTUsICAgICAgICAgICAgIC8qIC0xZEIgKi8KLSAgICAweDY1QUQsICAgICAgICAgICAgIC8qIC0yZEIgKi8KLSAgICAweDVBOUUsICAgICAgICAgICAgIC8qIC0zZEIgKi8KLSAgICAweDUwQzMsICAgICAgICAgICAgIC8qIC00ZEIgKi8KLSAgICAweDQ3RkIsICAgICAgICAgICAgIC8qIC01ZEIgKi8KLSAgICAweDQwMDB9OyAgICAgICAgICAgIC8qIC02ZEIgKi8KLQotLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLS8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgVm9sdW1lIG1peGVyIHRpbWUgY29uc3RhbnRzICgxMDBtcykgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0KLSNkZWZpbmUgTFZNX01JWF9UQ19GczgwMDAgICAgICAzMjU4MCAgICAgICAgIC8qIEZsb2F0aW5nIHBvaW50IHZhbHVlIDAuOTk0MjYyNjk1ICovCi0jZGVmaW5lIExWTV9NSVhfVENfRnMxMTAyNSAgICAgMzI2MzIgICAgICAgICAvKiBGbG9hdGluZyBwb2ludCB2YWx1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0FSUkFOVElFUyBPUiBDT05ESVRJT05TIE9GIEFOWSBLSU5ELCBlaXRoZXIgZXhwcmVzcyBvciBpbXBsaWVkLgotICogU2VlIHRoZSBMaWNlbnNlIGZvciB0aGUgc3BlY2lmaWMgbGFuZ3VhZ2UgZ292ZXJuaW5nIHBlcm1pc3Npb25zIGFuZAotICogbGltaXRhdGlvbnMgdW5kZXIgdGhlIExpY2Vuc2UuCi0gKi8KLQotI2lmbmRlZiBfX0xWTV9UQUJMRVNfSF9fCi0jZGVmaW5lIF9fTFZNX1RBQkxFU19IX18KLQotI2lmZGVmIF9fY3BsdXNwbHVzCi1leHRlcm4gIkMiIHsKLSNlbmRpZiAvKiBfX2NwbHVzcGx1cyAqLwotCi0vKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotLyogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICAgIEluY2x1ZGVzICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLQotI2luY2x1ZGUgIkJJUVVBRC5oIgotI2luY2x1ZGUgIkxWTV9UeXBlcy5oIgotCi0vKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotLyogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICAgIFRyZWJsZSBCb29zdCBGaWx0ZXIgQ29lZmZpY2llbnRzICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLQotZXh0ZXJuIEZPX0MxNl9MU2h4X0NvZWZzX3QgICAgIExWTV9UcmVibGVCb29zdENvZWZzW107Ci0KLQotLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLS8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgICBWb2x1bWUgY29udHJvbCBnYWluIGFuZCB0aW1lIGNvbnN0YW50IHRhYmxlcyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0KLWV4dGVybiBjb25zdCBMVk1fSU5UMTYgTFZNX1ZvbHVtZVRhYmxlW107Ci1leHRlcm4gY29uc3QgTFZNX0lOVDE2IExWTV9NaXhlclRDVGFibGVbXTsKLQotCi0jaWZkZWYgX19jcGx1c3BsdXMKLX0KLSNlbmRpZiAvKiBfX2NwbHVzcGx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leHByZXNzIG9yIGltcGxpZWQuCi0gKiBTZWUgdGhlIExpY2Vuc2UgZm9yIHRoZSBzcGVjaWZpYyBsYW5ndWFnZSBnb3Zlcm5pbmcgcGVybWlzc2lvbnMgYW5kCi0gKiBsaW1pdGF0aW9ucyB1bmRlciB0aGUgTGljZW5zZS4KLSAqLwotCi0jaWZuZGVmIF9fQUdDX0hfXwotI2RlZmluZSBfX0FHQ19IX18KLQotCi0jaWZkZWYgX19jcGx1c3BsdXMKLWV4dGVybiAiQyIgewotI2VuZGlmIC8qIF9fY3BsdXNwbHVzICovCi0KLS8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotLyogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgICBJbmNsdWRlcyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0KLSNpbmNsdWRlICJMVk1fVHlwZXMuaCIKLQotCi0vKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLS8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogICAgVHlwZXMgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotCi10eXBlZGVmIHN0cnVjdAotewotICAgIExWTV9JTlQzMiAgQUdDX0dhaW47ICAgICAgICAgICAgICAgICAgICAgICAgLyogVGhlIGN1cnJlbnQgQUdDIGdhaW4gKi8KLSAgICBMVk1fSU5UMzIgIEFHQ19NYXhHYWluOyAgICAgICAgICAgICAgICAgICAgIC8qIFRoZSBtYXhpbXVtIEFHQyBnYWluICovCi0gICAgTFZNX0lOVDMyICBWb2x1bWU7ICAgICAgICAgICAgICAgICAgICAgICAgICAvKiBUaGUgY3VycmVudCB2b2x1bWUgc2V0dGluZyAqLwotICAgIExWTV9JTlQzMiAgVGFyZ2V0OyAgICAgICAgICAgICAgICAgICAgICAgICAgLyogVGhlIHRhcmdldCB2b2x1bWUgc2V0dGluZyAqLwotICAgIExWTV9JTlQzMiAgQUdDX1RhcmdldDsgICAgICAgICAgICAgICAgICAgICAgLyogQUdDIHRhcmdldCBsZXZlbCAqLwotICAgIExWTV9JTlQxNiAgQUdDX0F0dGFjazsgICAgICAgICAgICAgICAgICAgICAgLyogQUdDIGF0dGFjayBzY2FsZXIgKi8KLSAgICBMVk1fSU5UMTYgIEFHQ19EZWNheTsgICAgICAgICAgICAgICAgICAgICAgIC8qIEFHQyBkZWNheSBzY2FsZXIgKi8KLSAgICBMVk1fSU5UMTYgIEFHQ19HYWluU2hpZnQ7ICAgICAgICAgICAgICAgICAgIC8qIFRoZSBnYWluIHNoaWZ0ICovCi0gICAgTFZNX0lOVDE2ICBWb2x1bWVTaGlmdDsgICAgICAgICAgICAgICAgICAgICAvKiBWb2x1bWUgc2hpZnQgc2NhbGluZyAqLwotICAgIExWTV9JTlQxNiAgVm9sdW1lVEM7ICAgICAgICAgICAgICAgICAgICAgICAgLyogVm9sdW1lIHVwZGF0ZSB0aW1lIGNvbnN0YW50ICovCi0KLX0gQUdDX01JWF9WT0xfMlN0MU1vbl9EMzJfdDsKLQotCi0vKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLS8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogICAgRnVuY3Rpb24gUHJvdG90eXBlcyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0KLXZvaWQgQUdDX01JWF9WT0xfMlN0MU1vbl9EMzJfV1JBKEFHQ19NSVhfVk9MXzJTdDFNb25fRDMyX3QgICpwSW5zdGFuY2UsICAgICAvKiBJbnN0YW5jZSBwb2ludGVyICovCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb25zdCBMVk1fSU5UMzIgICAgICAgICAgICAqcFN0U3JjLCAgICAgICAgLyogU3RlcmVvIHNvdXJjZSAqLwotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY29uc3QgTFZNX0lOVDMyICAgICAgICAgICAgKnBNb25vU3JjLCAgICAgIC8qIE1vbm8gc291cmNlICovCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBMVk1fSU5UMzIgICAgICAgICAgICAgICAgICAqcERzdCwgICAgICAgICAgLyogU3RlcmVvIGR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ieSBhcHBsaWNhYmxlIGxhdyBvciBhZ3JlZWQgdG8gaW4gd3JpdGluZywgc29mdHdhcmUKLSAqIGRpc3RyaWJ1dGVkIHVuZGVyIHRoZSBMaWNlbnNlIGlzIGRpc3RyaWJ1dGVkIG9uIGFuICJBUyBJUyIgQkFTSVMsCi0gKiBXSVRIT1VUIFdBUlJBTlRJRVMgT1IgQ09ORElUSU9OUyBPRiBBTlkgS0lORCwgZWl0aGVyIGV4cHJlc3Mgb3IgaW1wbGllZC4KLSAqIFNlZSB0aGUgTGljZW5zZSBmb3IgdGhlIHNwZWNpZmljIGxhbmd1YWdlIGdvdmVybmluZyBwZXJtaXNzaW9ucyBhbmQKLSAqIGxpbWl0YXRpb25zIHVuZGVyIHRoZSBMaWNlbnNlLgotICovCi0KLSNpZm5kZWYgX0JJUVVBRF9IXwotI2RlZmluZSBfQklRVUFEX0hfCi0KLQotI2lmZGVmIF9fY3BsdXNwbHVzCi1leHRlcm4gIkMiIHsKLSNlbmRpZiAvKiBfX2NwbHVzcGx1cyAqLwotCi0jaW5jbHVkZSAiTFZNX1R5cGVzLmgiCi0vKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgotICAgSU5TVEFOQ0UgTUVNT1JZIFRZUEUgREVGSU5JVElPTgotKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0KLXR5cGVkZWYgc3RydWN0Ci17Ci0gICAgTFZNX0lOVDMyIFN0b3JhZ2VbNl07Ci0KLX0gQmlxdWFkX0luc3RhbmNlX3Q7Ci0KLQotLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKLSAgIENPRUZGSUNJRU5UIFRZUEUgREVGSU5JVElPTlMKLSoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotCi0vKioqIEJpcXVhZCBjb2VmZmljaWVudHMgKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLXR5cGVkZWYgc3RydWN0Ci17Ci0gICAgTFZNX0lOVDE2IEEyOyAgIC8qICBhMiAgKi8KLSAgICBMVk1fSU5UMTYgQTE7ICAgLyogIGExICAqLwotICAgIExWTV9JTlQxNiBBMDsgICAvKiAgYTAgICovCi0gICAgTFZNX0lOVDE2IEIyOyAgIC8qIC1iMiEgKi8KLSAgICBMVk1fSU5UMTYgQjE7ICAgLyogLWIxISAqLwotfSBCUV9DMTZfQ29lZnNfdDsKLQotdHlwZWRlZiBzdHJ1Y3QKLXsKLSAgICBMVk1fSU5UMzIgIEEyOyAgIC8qICBhMiAgKi8KLSAgICBMVk1fSU5UMzIgIEExOyAgIC8qICBhMSAgKi8KLSAgICBMVk1fSU5UMzIgIEEwOyAgIC8qICBhMCAgKi8KLSAgICBMVk1fSU5UMzIgIEIyOyAgIC8qIC1iMiEgKi8KLSAgICBMVk1fSU5UMzIgIEIxOyAgIC8qIC1iMSEgKi8KLX0gQlFfQzMyX0NvZWZzX3Q7Ci0KLS8qKiogRmlyc3Qgb3JkZXIgY29lZmZpY2llbnRzICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotdHlwZWRlZiBzdHJ1Y3QKLXsKLSAgICBMVk1fSU5UMTYgQTE7ICAgLyogIGExICAqLwotICAgIExWTV9JTlQxNiBBMDsgICAvKiAgYTAgICovCi0gICAgTFZNX0lOVDE2IEIxOyAgIC8qIC1iMSEgKi8KLX0gRk9fQzE2X0NvZWZzX3Q7Ci0KLXR5cGVkZWYgc3RydWN0Ci17Ci0gICAgTFZNX0lOVDMyICBBMTsgICAvKiAgYTEgICovCi0gICAgTFZNX0lOVDMyICBBMDsgICAvKiAgYTAgICovCi0gICAgTFZNX0lOVDMyICBCMTsgICAvKiAtYjEhICovCi19IEZPX0MzMl9Db2Vmc190OwotCi0vKioqIEZpcnN0IG9yZGVyIGNvZWZmaWNpZW50cyB3aXRoIFNoaWZ0KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi10eXBlZGVmIHN0cnVjdAotewotICAgIExWTV9JTlQxNiBBMTsgICAgLyogIGExICAqLwotICAgIExWTV9JTlQxNiBBMDsgICAgLyogIGEwICAqLwotICAgIExWTV9JTlQxNiBCMTsgICAgLyogLWIxISAqLwotICAgIExWTV9JTlQxNiBTaGlmdDsgLyogU2hpZnQgKi8KLX0gRk9fQzE2X0xTaHhfQ29lZnNfdDsKLQotLyoqKiBCYW5kIHBhc3MgY29lZmZpY2llbnRzICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi10eXBlZGVmIHN0cnVjdAotewotICAgIExWTV9JTlQxNiBBMDsgICAvKiAgYTAgICovCi0gICAgTFZNX0lOVDE2IEIyOyAgIC8qIC1iMiEgKi8KLSAgICBMVk1fSU5UMTYgQjE7ICAgLyogLWIxISAqLwotfSBCUF9DMTZfQ29lZnNfdDsKLQotdHlwZWRlZiBzdHJ1Y3QKLXsKLSAgICBMVk1fSU5UMzIgIEEwOyAgIC8qICBhMCAgKi8KLSAgICBMVk1fSU5UMzIgIEIyOyAgIC8qIC1iMiEgKi8KLSAgICBMVk1fSU5UMzIgIEIxOyAgIC8qIC1iMSEgKi8KLX0gQlBfQzMyX0NvZWZzX3Q7Ci0KLS8qKiogUGVha2luZyBjb2VmZmljaWVudHMgKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotdHlwZWRlZiBzdHJ1Y3QKLXsKLSAgICBMVk1fSU5UMTYgQTA7ICAgLyogIGEwICAqLwotICAgIExWTV9JTlQxNiBCMjsgICAvKiAtYjIhICovCi0gICAgTFZNX0lOVDE2IEIxOyAgIC8qIC1iMSEgKi8KLSAgICBMVk1fSU5UMTYgIEc7ICAgLyogR2FpbiAqLwotfSBQS19DMTZfQ29lZnNfdDsKLQotdHlwZWRlZiBzdHJ1Y3QKLXsKLSAgICBMVk1fSU5UMzIgIEEwOyAgIC8qICBhMCAgKi8KLSAgICBMVk1fSU5UMzIgIEIyOyAgIC8qIC1iMiEgKi8KLSAgICBMVk1fSU5UMzIgIEIxOyAgIC8qIC1iMSEgKi8KLSAgICBMVk1fSU5UMTYgIEc7ICAgLyogR2FpbiAqLwotfSBQS19DMzJfQ29lZnNfdDsKLQotCi0vKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgotICAgVEFQUyBUWVBFIERFRklOSVRJT05TCi0qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLQotLyoqKiBUeXBlcyB1c2VkIGZvciBmaXJzdCBvcmRlciBhbmQgc2hlbHZpbmcgZmlsdGVyICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0KLXR5cGVkZWYgc3RydWN0Ci17Ci0gICAgTFZNX0lOVDMyIFN0b3JhZ2VbICgxKjIpIF07ICAvKiBPbmUgY2hhbm5lbCwgdHdvIHRhcHMgb2Ygc2l6ZSBMVk1fSU5UMzIgKi8KLX0gQmlxdWFkXzFJX09yZGVyMV9UYXBzX3Q7Ci0KLXR5cGVkZWYgc3RydWN0Ci17Ci0gICAgTFZNX0lOVDMyIFN0b3JhZ2VbICgyKjIpIF07ICAvKiBUd28gY2hhbm5lbHMsIHR3byB0YXBzIG9mIHNpemUgTFZNX0lOVDMyICovCi19IEJpcXVhZF8ySV9PcmRlcjFfVGFwc190OwotCi0KLS8qKiogVHlwZXMgdXNlZCBmb3IgYmlxdWFkLCBiYW5kIHBhc3MgYW5kIHBlYWtpbmcgZmlsdGVyICoqKioqKioqKioqKioqKioqKioqKioqKioqLwotCi10eXBlZGVmIHN0cnVjdAotewotICAgIExWTV9JTlQzMiBTdG9yYWdlWyAoMSo0KSBdOyAgLyogT25lIGNoYW5uZWwsIGZvdXIgdGFwcyBvZiBzaXplIExWTV9JTlQzMiAqLwotfSBCaXF1YWRfMUlfT3JkZXIyX1RhcHNfdDsKLQotdHlwZWRlZiBzdHJ1Y3QKLXsKLSAgICBMVk1fSU5UMzIgU3RvcmFnZVsgKDIqNCkgXTsgIC8qIFR3byBjaGFubmVscywgZm91ciB0YXBzIG9mIHNpemUgTFZNX0lOVDMyICovCi19IEJpcXVhZF8ySV9PcmRlcjJfVGFwc190OwotCi0vKiBUaGUgbmFtZXMgb2YgdGhlIGZ1bmN0aW9ucyBhcmUgY2hhbmdlZCB0byBzYXRpc2Z5IFFBQyBydWxlczogTmFtZSBzaG91bGQgYmUgVW5pcXVlIHdpdGhpbmcgMTYgY2hhcmFjdGVycyovCi0jZGVmaW5lIEJRXzJJX0QzMkYzMkNsbF9UUkNfV1JBXzAxX0luaXQgIEluaXRfQlFfMklfRDMyRjMyQ2xsX1RSQ19XUkFfMDEKLSNkZWZpbmUgQlBfMUlfRDMyRjMyQzMwX1RSQ19XUkFfMDIgICAgICAgVFdPX0JQXzFJX0QzMkYzMkMzMF9UUkNfV1JBXzAyCi0KLS8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCi0gICBGVU5DVElPTiBQUk9UT1RZUEVTOiBCSVFVQUQgRklMVEVSUwotKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0KLS8qKiogMTYgYml0IGRhdGEgcGF0aCAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotCi12b2lkIEJRXzJJX0QxNkYzMkNzc19UUkNfV1JBXzAxX0luaXQgKCAgICAgIEJpcXVhZF9JbnN0YW5jZV90ICAgICAgICpwSW5zdGFuY2UsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEJpcXVhZF8ySV9PcmRlcjJfVGFwc190ICpwVGFwcywKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgQlFfQzE2X0NvZWZzX3QgICAgICAgICAgKnBDb2VmKTsKLQotdm9pZCBCUV8ySV9EMTZGMzJDMTVfVFJDX1dSQV8wMSAoICAgICAgICAgICBCaXF1YWRfSW5zdGFuY2VfdCAgICAgICAqcEluc3RhbmNlLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBMVk1fSU5UMTYgICAgICAgICAgICAgICAgICAgICpwRGF0YUluLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBMVk1fSU5UMTYgICAgICAgICAgICAgICAgICAgICpwRGF0YU91dCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTFZNX0lOVDE2ICAgICAgICAgICAgICAgICAgICBOclNhbXBsZXMpOwotCi12b2lkIEJRXzJJX0QxNkYzMkMxNF9UUkNfV1JBXzAxICggICAgICAgICAgIEJpcXVhZF9JbnN0YW5jZV90ICAgICAgICpwSW5zdGFuY2UsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIExWTV9JTlQxNiAgICAgICAgICAgICAgICAgICAgKnBEYXRhSW4sCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIExWTV9JTlQxNiAgICAgICAgICAgICAgICAgICAgKnBEYXRhT3V0LAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBMVk1fSU5UMTYgICAgICAgICAgICAgICAgICAgIE5yU2FtcGxlcyk7Ci0KLXZvaWQgQlFfMklfRDE2RjMyQzEzX1RSQ19XUkFfMDEgKCAgICAgICAgICAgQmlxdWFkX0luc3RhbmNlX3QgICAgICAgKnBJbnN0YW5jZSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTFZNX0lOVDE2ICAgICAgICAgICAgICAgICAgICAqcERhdGFJbiwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTFZNX0lOVDE2ICAgICAgICAgICAgICAgICAgICAqcERhdGFPdXQsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIExWTV9JTlQxNiAgICAgICAgICAgICAgICAgICAgTnJTYW1wbGVzKTsKLQotdm9pZCBCUV8ySV9EMTZGMTZDc3NfVFJDX1dSQV8wMV9Jbml0ICggICAgICBCaXF1YWRfSW5zdGFuY2VfdCAgICAgICAqcEluc3RhbmNlLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBCaXF1YWRfMklfT3JkZXIyX1RhcHNfdCAqcFRhcHMsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEJRX0MxNl9Db2Vmc190ICAgICAgICAgICpwQ29lZik7Ci0KLXZvaWQgQlFfMklfRDE2RjE2QzE1X1RSQ19XUkFfMDEoICAgICAgICAgICAgQmlxdWFkX0luc3RhbmNlX3QgICAgICAgKnBJbnN0YW5jZSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTFZNX0lOVDE2ICAgICAgICAgICAgICAgICAgICpwRGF0YUluLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBMVk1fSU5UMTYgICAgICAgICAgICAgICAgICAgKnBEYXRhT3V0LAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBMVk1fSU5UMTYgICAgICAgICAgICAgICAgICAgTnJTYW1wbGVzKTsKLQotdm9pZCBCUV8ySV9EMTZGMTZDMTRfVFJDX1dSQV8wMSggICAgICAgICAgICBCaXF1YWRfSW5zdGFuY2VfdCAgICAgICAqcEluc3RhbmNlLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBMVk1fSU5UMTYgICAgICAgICAgICAgICAgICAgKnBEYXRhSW4sCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIExWTV9JTlQxNiAgICAgICAgICAgICAgICAgICAqcERhdGFPdXQsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIExWTV9JTlQxNiAgICAgICAgICAgICAgICAgICBOclNhbXBsZXMpOwotCi12b2lkIEJRXzFJX0QxNkYxNkNzc19UUkNfV1JBXzAxX0luaXQgKCAgICAgIEJpcXVhZF9JbnN0YW5jZV90ICAgICAgICpwSW5zdGFuY2UsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEJpcXVhZF8xSV9PcmRlcjJfVGFwc190ICpwVGFwcywKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgQlFfQzE2X0NvZWZzX3QgICAgICAgICAgKnBDb2VmKTsKLQotdm9pZCBCUV8xSV9EMTZGMTZDMTVfVFJDX1dSQV8wMSggICAgICAgICAgICBCaXF1YWRfSW5zdGFuY2VfdCAgICAgICAqcEluc3RhbmNlLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBMVk1fSU5UMTYgICAgICAgICAgICAgICAgICAgKnBEYXRhSW4sCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIExWTV9JTlQxNiAgICAgICAgICAgICAgICAgICAqcERhdGFPdXQsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIExWTV9JTlQxNiAgICAgICAgICAgICAgICAgICBOclNhbXBsZXMpOwotCi12b2lkIEJRXzFJX0QxNkYzMkNzc19UUkNfV1JBXzAxX0luaXQgKCAgICAgIEJpcXVhZF9JbnN0YW5jZV90ICAgICAgICpwSW5zdGFuY2UsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEJpcXVhZF8xSV9PcmRlcjJfVGFwc190ICpwVGFwcywKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgQlFfQzE2X0NvZWZzX3QgICAgICAgICAgKnBDb2VmKTsKLQotdm9pZCBCUV8xSV9EMTZGMzJDMTRfVFJDX1dSQV8wMSAoICAgICAgICAgICBCaXF1YWRfSW5zdGFuY2VfdCAgICAgICAqcEluc3RhbmNlLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBMVk1fSU5UMTYgICAgICAgICAgICAgICAgICAgICpwRGF0YUluLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBMVk1fSU5UMTYgICAgICAgICAgICAgICAgICAgICpwRGF0YU91dCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTFZNX0lOVDE2ICAgICAgICAgICAgICAgICAgICBOclNhbXBsZXMpOwotCi0vKioqIDMyIGJpdCBkYXRhIHBhdGggKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLQotdm9pZCBCUV8ySV9EMzJGMzJDbGxfVFJDX1dSQV8wMV9Jbml0ICggICAgICBCaXF1YWRfSW5zdGFuY2VfdCAgICAgICAqcEluc3RhbmNlLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBCaXF1YWRfMklfT3JkZXIyX1RhcHNfdCAqcFRhcHMsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEJRX0MzMl9Db2Vmc190ICAgICAgICAgICpwQ29lZik7Ci0KLXZvaWQgQlFfMklfRDMyRjMyQzMwX1RSQ19XUkFfMDEgKCAgICAgICAgICAgQmlxdWFkX0luc3RhbmNlX3QgICAgICAgKnBJbnN0YW5jZSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTFZNX0lOVDMyICAgICAgICAgICAgICAgICAgICAqcERhdGFJbiwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTFZNX0lOVDMyICAgICAgICAgICAgICAgICAgICAqcERhdGFPdXQsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIExWTV9JTlQxNiAgICAgICAgICAgICAgICAgICAgTnJTYW1wbGVzKTsKLQotLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKLSAgIEZVTkNUSU9OIFBST1RPVFlQRVM6IEZJUlNUIE9SREVSIEZJTFRFUlMKLSoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotCi0vKioqIDE2IGJpdCBkYXRhIHBhdGggKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLQotdm9pZCBGT18xSV9EMTZGMTZDc3NfVFJDX1dSQV8wMV9Jbml0KCAgICAgICBCaXF1YWRfSW5zdGFuY2VfdCAgICAgICAqcEluc3RhbmNlLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBCaXF1YWRfMUlfT3JkZXIxX1RhcHNfdCAqcFRhcHMsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEZPX0MxNl9Db2Vmc190ICAgICAgICAgICpwQ29lZik7Ci0KLXZvaWQgRk9fMUlfRDE2RjE2QzE1X1RSQ19XUkFfMDEoICAgICAgICAgICAgQmlxdWFkX0luc3RhbmNlX3QgICAgICAgKnBJbnN0YW5jZSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTFZNX0lOVDE2ICAgICAgICAgICAgICAgICAgICpwRGF0YUluLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBMVk1fSU5UMTYgICAgICAgICAgICAgICAgICAgKnBEYXRhT3V0LAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBMVk1fSU5UMTYgICAgICAgICAgICAgICAgICAgTnJTYW1wbGVzKTsKLQotdm9pZCBGT18ySV9EMTZGMzJDc3NfTFNoeF9UUkNfV1JBXzAxX0luaXQoQmlxdWFkX0luc3RhbmNlX3QgICAgICAgKnBJbnN0YW5jZSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEJpcXVhZF8ySV9PcmRlcjFfVGFwc190ICpwVGFwcywKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEZPX0MxNl9MU2h4X0NvZWZzX3QgICAgICpwQ29lZik7Ci0KLXZvaWQgRk9fMklfRDE2RjMyQzE1X0xTaHhfVFJDX1dSQV8wMShCaXF1YWRfSW5zdGFuY2VfdCAgICAgICAqcEluc3RhbmNlLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIExWTV9JTlQxNiAgICAgICAgICAgICAgICpwRGF0YUluLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIExWTV9JTlQxNiAgICAgICAgICAgICAgICpwRGF0YU91dCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBMVk1fSU5UMTYgICAgICAgICAgICAgICBOclNhbXBsZXMpOwotCi0vKioqIDMyIGJpdCBkYXRhIHBhdGggKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLQotdm9pZCBGT18xSV9EMzJGMzJDbGxfVFJDX1dSQV8wMV9Jbml0KCAgICAgICBCaXF1YWRfSW5zdGFuY2VfdCAgICAgICAqcEluc3RhbmNlLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBCaXF1YWRfMUlfT3JkZXIxX1RhcHNfdCAqcFRhcHMsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEZPX0MzMl9Db2Vmc190ICAgICAgICAgICpwQ29lZik7Ci0KLXZvaWQgRk9fMUlfRDMyRjMyQzMxX1RSQ19XUkFfMDEoICAgICAgICAgICAgQmlxdWFkX0luc3RhbmNlX3QgICAgICAgKnBJbnN0YW5jZSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTFZNX0lOVDMyICAgICAgICAgICAgICAgKnBEYXRhSW4sCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIExWTV9JTlQzMiAgICAgICAgICAgICAgICpwRGF0YU91dCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTFZNX0lOVDE2ICAgICAgICAgICAgICAgTnJTYW1wbGVzKTsKLQotLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKLSAgIEZVTkNUSU9OIFBST1RPVFlQRVM6IEJBTkQgUEFTUyBGSUxURVJTCi0qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLQotLyoqKiAxNiBiaXQgZGF0YSBwYXRoICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0KLXZvaWQgQlBfMUlfRDE2RjE2Q3NzX1RSQ19XUkFfMDFfSW5pdCAoICAgICAgQmlxdWFkX0luc3RhbmNlX3QgICAgICAgKnBJbnN0YW5jZSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgQmlxdWFkXzFJX09yZGVyMl9UYXBzX3QgKnBUYXBzLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBCUF9DMTZfQ29lZnNfdCAgICAgICAgICAqcENvZWYpOwotCi12b2lkIEJQXzFJX0QxNkYxNkMxNF9UUkNfV1JBXzAxICggICAgICAgICAgIEJpcXVhZF9JbnN0YW5jZV90ICAgICAgICpwSW5zdGFuY2UsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIExWTV9JTlQxNiAgICAgICAgICAgICAgICAgICAgKnBEYXRhSW4sCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIExWTV9JTlQxNiAgICAgICAgICAgICAgICAgICAgKnBEYXRhT3V0LAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBMVk1fSU5UMTYgICAgICAgICAgICAgICAgICAgIE5yU2FtcGxlcyk7Ci0KLXZvaWQgQlBfMUlfRDE2RjMyQ2xsX1RSQ19XUkFfMDFfSW5pdCAoICAgICAgQmlxdWFkX0luc3RhbmNlX3QgICAgICAgKnBJbnN0YW5jZSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgQmlxdWFkXzFJX09yZGVyMl9UYXBzX3QgKnBUYXBzLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBCUF9DMzJfQ29lZnNfdCAgICAgICAgICAqcENvZWYpOwotCi12b2lkIEJQXzFJX0QxNkYzMkMzMF9UUkNfV1JBXzAxICggICAgICAgICAgIEJpcXVhZF9JbnN0YW5jZV90ICAgICAgICpwSW5zdGFuY2UsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIExWTV9JTlQxNiAgICAgICAgICAgICAgICAgICAgKnBEYXRhSW4sCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIExWTV9JTlQxNiAgICAgICAgICAgICAgICAgICAgKnBEYXRhT3V0LAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBMVk1fSU5UMTYgICAgICAgICAgICAgICAgICAgIE5yU2FtcGxlcyk7Ci0KLQotLyoqKiAzMiBiaXQgZGF0YSBwYXRoICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0KLXZvaWQgQlBfMUlfRDMyRjMyQ2xsX1RSQ19XUkFfMDJfSW5pdCAoICAgICAgQmlxdWFkX0luc3RhbmNlX3QgICAgICAgKnBJbnN0YW5jZSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgQmlxdWFkXzFJX09yZGVyMl9UYXBzX3QgKnBUYXBzLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBCUF9DMzJfQ29lZnNfdCAgICAgICAgICAqcENvZWYpOwotCi12b2lkIEJQXzFJX0QzMkYzMkMzMF9UUkNfV1JBXzAyKCAgICAgICAgICAgIEJpcXVhZF9JbnN0YW5jZV90ICAgICAgICpwSW5zdGFuY2UsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIExWTV9JTlQzMiAgICAgICAgICAgICAgICAgICAgKnBEYXRhSW4sCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIExWTV9JTlQzMiAgICAgICAgICAgICAgICAgICAgKnBEYXRhT3V0LAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBMVk1fSU5UMTYgICAgICAgICAgICAgICAgICAgIE5yU2FtcGxlcyk7Ci0KLQotLyoqKiAzMiBiaXQgZGF0YSBwYXRoIFNURVJFTyAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0KLXZvaWQgUEtfMklfRDMyRjMyQ2xsR3NzX1RSQ19XUkFfMDFfSW5pdCAoICAgQmlxdWFkX0luc3RhbmNlX3QgICAgICAgKnBJbnN0YW5jZSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgQmlxdWFkXzJJX09yZGVyMl9UYXBzX3QgKnBUYXBzLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBQS19DMzJfQ29lZnNfdCAgICAgICAgICAqcENvZWYpOwotCi12b2lkIFBLXzJJX0QzMkYzMkMzMEcxMV9UUkNfV1JBXzAxICggICAgICAgIEJpcXVhZF9JbnN0YW5jZV90ICAgICAgICpwSW5zdGFuY2UsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIExWTV9JTlQzMiAgICAgICAgICAgICAgICAgICAgKnBEYXRhSW4sCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIExWTV9JTlQzMiAgICAgICAgICAgICAgICAgICAgKnBEYXRhT3V0LAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBMVk1fSU5UMTYgICAgICAgICAgICAgICAgICAgIE5yU2FtcGxlcyk7Ci0KLXZvaWQgUEtfMklfRDMyRjMyQ3NzR3NzX1RSQ19XUkFfMDFfSW5pdCAoICAgQmlxdWFkX0luc3RhbmNlX3QgICAgICAgKnBJbnN0YW5jZSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgQmlxdWFkXzJJX09yZGVyMl9UYXBzX3QgKnBUYXBzLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBQS19DMTZfQ29lZnNfdCAgICAgICAgICAqcENvZWYpOwotCi12b2lkIFBLXzJJX0QzMkYzMkMxNEcxMV9UUkNfV1JBXzAxICggICAgICAgIEJpcXVhZF9JbnN0YW5jZV90ICAgICAgICpwSW5zdGFuY2UsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIExWTV9JTlQzMiAgICAgICAgICAgICAgICAgICAgKnBEYXRhSW4sCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIExWTV9JTlQzMiAgICAgICAgICAgICAgICAgICAgKnBEYXRhT3V0LAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBMVk1fSU5UMTYgICAgICAgICAgICAgICAgICAgIE5yU2FtcGxlcyk7Ci0KLQotLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKLSAgIEZVTkNUSU9OIFBST1RPVFlQRVM6IERDIFJFTU9WQUwgRklMVEVSUwotKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0KLS8qKiogMTYgYml0IGRhdGEgcGF0aCBTVEVSRU8gKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotCi12b2lkIERDXzJJX0QxNl9UUkNfV1JBXzAxX0luaXQgICAgICggICAgICAgIEJpcXVhZF9JbnN0YW5jZV90ICAgICAgICpwSW5zdGFuY2UpOwotCi12b2lkIERDXzJJX0QxNl9UUkNfV1JBXzAxICAgICAgICAgICggICAgICAgIEJpcXVhZF9JbnN0YW5jZV90ICAgICAgICpwSW5zdGFuY2UsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIExWTV9JTlQxNiAgICAgICAgICAgICAgICpwRGF0YUluLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBMVk1fSU5UMTYgICAgICAgICAgICAgICAqcERhdGFPdXQsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIExWTV9JTlQxNiAgICAgICAgICAgICAgIE5yU2FtcGxlcyk7Ci0KLSNpZmRlZiBfX2NwbHVzcGx1cwotfQotI2VuZGlmIC8qIF9fY3BsdXNwbHVzICovCi0KLQotLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0KLSNlbmRpZiAgLyoqIF9CSVFVQURfSF8gKiovCi0KZGlmZiAtLWdpdCBhL21lZGlhL2xpYmVmZmVjdHMvbHZtL2xpYi9Db21tb24vbGliL0NvbXBMaW0uaCBiL21lZGlhL2xpYmVmZmVjdHMvbHZtL2xpYi9Db21tb24vbGliL0NvbXBMaW0uaApkZWxldGVkIGZpbGUgbW9kZSAxMDA2NDQKaW5kZXggNGNiOGFhMi4uMDAwMDAwMAotLS0gYS9tZWRpYS9saWJlZmZlY3RzL2x2bS9saWIvQ29tbW9uL2xpYi9Db21wTGltLmgKKysrIC9kZXYvbnVsbApAQCAtMSw4MyArMCwwIEBACi0vKgotICogQ29weXJpZ2h0IChDKSAyMDA0LTIwMTAgTlhQIFNvZnR3YXJlCi0gKiBDb3B5cmlnaHQgKEMpIDIwMTAgVGhlIEFuZHJvaWQgT3BlbiBTb3VyY2UgUHJvamVjdAotICoKLSAqIExpY2Vuc2VkIHVuZGVyIHRoZSBBcGFjaGUgTGljZW5zZSwgVmVyc2lvbiAyLjAgKHRoZSAiTGljZW5zZSIpOwotICogeW91IG1heSBub3QgdXNlIHRoaXMgZmlsZSBleGNlcHQgaW4gY29tcGxpYW5jZSB3aXRoIHRoZSBMaWNlbnNlLgotICogWW91IG1heSBvYnRhaW4gYSBjb3B5IG9mIHRoZSBMaWNlbnNlIGF0Ci0gKgotICogICAgICBodHRwOi8vd3d3LmFwYWNoZS5vcmcvbGljZW5zZXMvTElDRU5TRS0yLjAKLSAqCi0gKiBVbmxlc3MgcmVxdWlyZWQgYnkgYXBwbGljYWJsZSBsYXcgb3IgYWdyZWVkIHRvIGluIHdyaXRpbmcsIHNvZnR3YXJlCi0gKiBkaXN0cmlidXRlZCB1bmRlciB0aGUgTGljZW5zZSBpcyBkaXN0cmlidXRlZCBvbiBhbiAiQVMgSVMiIEJBU0lTLAotICogV0lUSE9VVCBXQVJSQU5USUVTIE9SIENPTkRJVElPTlMgT0YgQU5ZIEtJTkQsIGVpdGhlciBleHByZXNzIG9yIGltcGxpZWQuCi0gKiBTZWUgdGhlIExpY2Vuc2UgZm9yIHRoZSBzcGVjaWZpYyBsYW5ndWFnZSBnb3Zlcm5pbmcgcGVybWlzc2lvbnMgYW5kCi0gKiBsaW1pdGF0aW9ucyB1bmRlciB0aGUgTGljZW5zZS4KLSAqLwotCi0jaWZuZGVmIF9DT01QX0xJTV9ICi0jZGVmaW5lIF9DT01QX0xJTV9ICi0KLSNpZmRlZiBfX2NwbHVzcGx1cwotZXh0ZXJuICJDIiB7Ci0jZW5kaWYgLyogX19jcGx1c3BsdXMgKi8KLQotCi0vKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotLyogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICBJbmNsdWRlcyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLQotI2luY2x1ZGUgIkxWTV9UeXBlcy5oIgotCi0KLS8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0vKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogIFN0cnVjdHVyZXMgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotCi10eXBlZGVmIHN0cnVjdCAvKiBDb21wcmVzc29yIHN0YXRlICovCi17Ci0gICAgLyogTm9ybWFsaXNlciAqLwotICAgIExWTV9JTlQxNiAgIE5vcm1fQXR0YWNrOyAgICAgICAgLyogQXR0YWNrIHRpbWUgY29uc3RhbnQgb2YgdGhlIE5vcm1hbGlzZXIgaW50ZWdyYXRvciAqLwotICAgIExWTV9JTlQxNiAgIE5vcm1fRGVjYXk7ICAgICAgICAgLyogRGVjYXkgdGltZSBjb25zdGFudCBvZiB0aGUgTm9ybWFsaXNlciBpbnRlZ3JhdG9yICovCi0gICAgTFZNX0lOVDMyICAgTm9ybUludDsgICAgICAgICAgICAvKiBOb3JtYWxpc2VyIGludGVncmF0b3IgY3VycmVudCB2YWx1ZSAqLwotICAgIExWTV9JTlQxNiAgIFNoaWZ0OyAgICAgICAgICAgICAgLyogU2hpZnQgZ2FpbiAqLwotICAgIExWTV9JTlQxNiAgIFRocmVzaG9sZDsgICAgICAgICAgLyogVGFyZ2V0IHRocmVzaG9sZCAqLwotCi0gICAgLyogQ29tcHJlc3NvciAqLwotICAgIExWTV9JTlQxNiAgIENvbXBfQXR0ZW47ICAgICAgICAgLyogQXR0ZW51YXRpb24gYXBwbGllZCBiZWZvcmUgc29mdCBrbmVlIGNvbXByZXNzb3IgKi8KLSAgICBMVk1fSU5UMTYgICBDb21wX0F0dGFja19TOyAgICAgIC8qIEF0dGFjayB0aW1lIGNvbnN0YW50IG9mIHRoZSBzbG93IGludGVncmF0b3IgKi8KLSAgICBMVk1fSU5UMTYgICBDb21wX0RlY2F5X1M7ICAgICAgIC8qIERlY2F5IHRpbWUgY29uc3RhbnQgb2Ygc2xvdyB0aGUgaW50ZWdyYXRvciAqLwotICAgIExWTV9JTlQxNiAgIENvbXBfQXR0YWNrX0Y7ICAgICAgLyogQXR0YWNrIHRpbWUgY29uc3RhbnQgb2YgZmFzdCB0aGUgaW50ZWdyYXRvciAqLwotICAgIExWTV9JTlQxNiAgIENvbXBfRGVjYXlfRjsgICAgICAgLyogRGVjYXkgdGltZSBjb25zdGFudCBvZiBmYXN0IHRoZSBpbnRlZ3JhdG9yICovCi0gICAgTFZNX0lOVDE2ICAgU29mdENsaXBHYWluOyAgICAgICAvKiBTb2Z0IGNsaXAgZ2FpbiBjb250cm9sICovCi0gICAgTFZNX0lOVDMyICAgQ29tcEludFNsb3c7ICAgICAgICAvKiBDb21wcmVzc29yIHNsb3cgaW50ZWdyYXRvciBjdXJyZW50IHZhbHVlICovCi0gICAgTFZNX0lOVDMyICAgQ29tcEludEZhc3Q7ICAgICAgICAvKiBDb21wcmVzc29yIGZhc3QgaW50ZWdyYXRvciBjdXJyZW50IHZhbHVlICovCi0KLQotfSBDb21wTGltX0luc3RhbmNlX3Q7Ci0KLQotLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLS8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgRnVuY3Rpb24gUHJvdG90eXBlcyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0KLXZvaWQgTm9uTGluQ29tcF9EMTYoTFZNX0lOVDE2ICAgICAgICBHYWluLAotICAgICAgICAgICAgICAgICAgICBMVk1fSU5UMTYgICAgICAgICpwU3RlckJmSW4sCi0gICAgICAgICAgICAgICAgICAgIExWTV9JTlQxNiAgICAgICAgKnBTdGVyQmZPdXQsCi0gICAgICAgICAgICAgICAgICAgIExWTV9JTlQzMiAgICAgICAgQmxvY2tMZW5ndGgpOwotCi0KLSNpZmRlZiBfX2NwbHVzcGx1cwotfQotI2VuZGlmIC8qIF9fY3BsdXNwbHVzICovCi0KLSNlbmRpZiAvKiAjaWZuZGVmIF9DT01QX0xJTV9IICovCi0KLQotCmRpZmYgLS1naXQgYS9tZWRpYS9saWJlZmZlY3RzL2x2bS9saWIvQ29tbW9uL2xpYi9GaWx0ZXIuaCBiL21lZGlhL2xpYmVmZmVjdHMvbHZtL2xpYi9Db21tb24vbGliL0ZpbHRlci5oCmRlbGV0ZWQgZmlsZSBtb2RlIDEwMDY0NAppbmRleCAyMjk3MDFhLi4wMDAwMDAwCi0tLSBhL21lZGlhL2xpYmVmZmVjdHMvbHZtL2xpYi9Db21tb24vbGliL0ZpbHRlci5oCisrKyAvZGV2L251bGwKQEAgLTEsNjIgKzAsMCBAQ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qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgotICAgSU5DTFVERVMKLSoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotI2luY2x1ZGUgIkxWTV9UeXBlcy5oIgotI2luY2x1ZGUgIkJJUVVBRC5oIgotCi0KLS8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCi0gICBERUZJTkVTCi0qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLSNkZWZpbmUgRklMVEVSX0xPU1MgICAgIDMyNzMwICAgICAgIC8qIC0wLjAxZEIgbG9zcyB0byBhdm9pZCB3cmFwcGluZyBkdWUgdG8gYmFuZCByaXBwbGUgKi8KLQotLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKLSAgIEZVTkNUSU9OIFBST1RPVFlQRVMKLSoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotCi1MVk1fSU5UMzIgTFZNX1BvbHlub21pYWwoTFZNX1VJTlQxNiBOLAotICAgICAgICAgICAgICAgICAgICAgICAgIExWTV9JTlQzMiAgKnBDb2VmZmljaWVudHMsCi0gICAgICAgICAgICAgICAgICAgICAgICAgTFZNX0lOVDMyICBYKTsKLQotTFZNX0lOVDMyIExWTV9Qb3dlcjEwKCAgIExWTV9JTlQzMiAgWCk7Ci0KLUxWTV9JTlQzMiBMVk1fRk9fTFBGKCAgICBMVk1fSU5UMzIgIHcsCi0gICAgICAgICAgICAgICAgICAgIC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RoZSBpbnN0YW5jZSBtZW1vcnkKLSAqICBSZXR1cm5zICAgICA6IEVycm9yIGNvZGUKLSAqICBEZXNjcmlwdGlvbiA6IEluaXRpYWxpemVzIHRoZSBpbnN0YW5jZSBkaXN0cmlidXRpb24gYW5kIG1lbW9yeSBzaXplIGNhbGN1bGF0aW9uIGZ1bmN0aW9uCi0gKiAgUmVtYXJrcyAgICAgOgotICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0KLXZvaWQgICBJbnN0QWxsb2NfSW5pdCggSU5TVF9BTExPQyAqcG1zLCB2b2lkICpTdGFydEFkZHIgKTsKLQotCi0vKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgotICogIE5hbWUgICAgICAgIDogSW5zdEFsbG9jX0FkZE1lbWJlcigpCi0gKiAgSW5wdXQgICAgICAgOiBwbXMgIC0gUG9pbnRlciB0byB0aGUgSU5TVF9BTExPQyBpbnN0YW5jZQotICAgICAgICAgICAgICAgICAgU2l6ZSAtIFRoZSBzaXplIGluIGJ5dGVzIG9mIHRoZSBuZXcgYWRkZWQgbWVtYmVyCi0gKiAgUmV0dXJucyAgICAgOiBBIHBvaW50ZXIgdG8gdGhlIG5ldyBhZGRlZCBtZW1iZXIKLSAqICBEZXNjcmlwdGlvbiA6IEFsbG9jYXRlcyBzcGFjZSBmb3IgYSBuZXcgbWVtYmVyIGluIHRoZSBpbnN0YW5jZSBtZW1vcnkgYW5kIHJldHVybnMKLSAgICAgICAgICAgICAgICAgIGEgcG9pbnRlciB0byB0aGlzIG5ldyBtZW1iZXIuICBUaGUgc3RhcnQgYWRkcmVzcyBvZiBhbGwgbWVtYmVycyB3aWxsCi0gICAgICAgICAgICAgICAgICBiZSAzMiBiaXQgYWxsaWduZWQuCi0gKiAgUmVtYXJrcyAgICAgOgotICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0KLXZvaWQqIEluc3RBbGxvY19BZGRNZW1iZXIoIElOU1RfQUxMT0MgKnBtcywgTFZNX1VJTlQzMiBTaXplICk7Ci0KLS8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCi0gKiAgTmFtZSAgICAgICAgOiBJbnN0QWxsb2NfR2V0VG90YWwoKQotICogIElucHV0ICAgICAgIDogcG1zICAtIFBvaW50ZXIgdG8gdGhlIElOU1RfQUxMT0MgaW5zdGFuY2UKLSAqICBSZXR1cm5zICAgICA6IFRoZSBpbnN0YW5jZSBtZW1vcnkgc2l6ZQotICogIERlc2NyaXB0aW9uIDogVGhpcyBmdW5jdGlvbnMgcmV0dXJucyB0aGUgY2FsY3VsYXRlZCBpbnN0YW5jZSBtZW1vcnkgc2l6ZQotICogIFJlbWFya3MgICAgIDoKLSAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotCi1MVk1fVUlOVDMyIEluc3RBbGxvY19HZXRUb3RhbCggSU5TVF9BTExPQyAqcG1zKTsKLQotdm9pZCogICBJbnN0QWxsb2NfQWRkTWVtYmVyQWxsUmV0KCAgICAgSU5TVF9BTExPQyAgICAgICAgICAgICAgICAgKnBtcywKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBMVk1fVUlOVDMyICAgICAgICAgICAgICAgU2l6ZVtdLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZvaWQgICAgICAgICAgICAgICAgICAgICoqcHRyKTsKLQotdm9pZCogICBJbnN0QWxsb2NfQWRkTWVtYmVyQWxsKCBJTlNUX0FMTE9DICAgICAgICAgICAgICAgICAgICAgKnBtcywKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIExWTV9VSU5UMzIgICAgICAgICAgICAgICAgICAgU2l6ZVtdLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTFZNX01lbW9yeVRhYmxlX3N0ICAgICAgICAgICAqcE1lbW9yeVRhYmxlKTsKLQotdm9pZCAgICBJbnN0QWxsb2NfSW5pdEFsbCggSU5TVF9BTExPQyAgICAgICAgICAgICAgICAgICAgICAqcG1zLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgTFZNX01lbW9yeVRhYmxlX3N0ICAgICAgICAgICAgICpwTWVtb3J5VGFibGUpOwotCi12b2lkICAgIEluc3RBbGxvY19Jbml0QWxsX05VTEwoIElOU1RfQUxMT0MgICAgICAgICAgICAgICpwbXMpOwotCi0jaWZkZWYgX19jcGx1c3BsdXMKLX0KLSNlbmRpZiAvKiBfX2NwbHVzcGx1cyAqLwotCi0jZW5kaWYgLyogX19KQlNfSU5TVEFMTE9DX0hfXyAqLwpkaWZmIC0tZ2l0IGEvbWVkaWEvbGliZWZmZWN0cy9sdm0vbGliL0NvbW1vbi9saWIvTFZNX0NvbW1vbi5oIGIvbWVkaWEvbGliZWZmZWN0cy9sdm0vbGliL0NvbW1vbi9saWIvTFZNX0NvbW1vbi5oCmRlbGV0ZWQgZmlsZSBtb2RlIDEwMDY0NAppbmRleCBjZWNjZDdiLi4wMDAwMDAwCi0tLSBhL21lZGlhL2xpYmVmZmVjdHMvbHZtL2xpYi9Db21tb24vbGliL0xWTV9Db21tb24uaAorKysgL2Rldi9udWxsCkBAIC0xLDYxICswLDAgQEAKLS8qCi0gKiBDb3B5cmlnaHQgKEMpIDIwMDQtMjAxMCBOWFAgU29mdHdhcmUKLSAqIENvcHlyaWdodCAoQykgMjAxMCBUaGUgQW5kcm9pZCBPcGVuIFNvdXJjZSBQcm9qZWN0Ci0gKgotICogTGljZW5zZWQgd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Ki8KLS8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogIFRoaXMgZmlsZXMgaW5jbHVkZXMgYWxsIGRlZmluaXRpb25zLCB0eXBlcywgc3RydWN0dXJlcyBhbmQgZnVuY3Rpb24gcHJvdG90eXBlcy4gICAgICovCi0vKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotCi0KLSNpZm5kZWYgX19MVk1fQ09NTU9OX0hfXwotI2RlZmluZSBfX0xWTV9DT01NT05fSF9fCi0KLSNpZmRlZiBfX2NwbHVzcGx1cwotZXh0ZXJuICJDIiB7Ci0jZW5kaWYgLyogX19jcGx1c3BsdXMgKi8KLQotCi0vKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLS8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogIEluY2x1ZGVzICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotI2luY2x1ZGUgIkxWTV9UeXBlcy5oIgotCi0KLS8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotLyogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgRGVmaW5pdGlvbnMgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0vKiBBbGdvcml0aG0gaWRlbnRpZmljYXRpb24gKi8KLSNkZWZpbmUgQUxHT1JJVEhNX05PTkVfSUQgICAgICAweDAwMDAKLSNkZWZpbmUgQUxHT1JJVEhNX0NTX0lEICAgICAgICAweDAxMDAKLSNkZWZpbmUgQUxHT1JJVEhNX0VRTkJfSUQgICAgICAweDAyMDAKLSNkZWZpbmUgQUxHT1JJVEhNX0RCRV9JRCAgICAgICAweDAzMDAKLSNkZWZpbmUgQUxHT1JJVEhNX1ZDX0lEICAgICAgICAweDA1MDAKLSNkZWZpbmUgQUxHT1JJVEhNX1RFX0lEICAgICAgICAweDA2MDAKLQotI2lmZGVmIF9fY3BsdXNwbHVzCi19Ci0jZW5kaWYgLyogX19jcGx1c3BsdXMgKi8KLQotI2VuZGlmICAgICAgLyogX19MVk1fQ09NTU9OX0hfXyAqLwotCmRpZmYgLS1naXQgYS9tZWRpYS9saWJlZmZlY3RzL2x2bS9saWIvQ29tbW9uL2xpYi9MVk1fTWFjcm9zLmgg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Ml9ISCsoTFZNX0lOVDMyKShNVUwzMngxNklOVE8zMl9MTD4+c2hpZnRWYWx1ZSk7XAotICAgICAgICB9XAotICAgICAgICBlbHNlIGlmKHNoaWZ0VmFsdWU8MzIpIHtcCi0gICAgICAgIE1VTDMyeDE2SU5UTzMyX0hIPShMVk1fSU5UMzIpKE1VTDMyeDE2SU5UTzMyX0hIPj4oc2hpZnRWYWx1ZS0xNikpO1wKLSAgICAgICAgKEMpPU1VTDMyeDE2SU5UTzMyX0hIKyhMVk1fSU5UMzIpKE1VTDMyeDE2SU5UTzMyX0xMPj5zaGlmdFZhbHVlKTtcCi0gICAgICAgIH1cCi0gICAgICAgIGVsc2Uge1wKLSAgICAgICAgKEMpPU1VTDMyeDE2SU5UTzMyX0hIPj4oc2hpZnRWYWx1ZS0xNik7fVwKLSAgICAgICAgfQotI2VuZGlmCi0KLS8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCi0gICBBREQyX1NBVF8zMngzMihBLEIsQykKLSAgICAgICAgQyA9IFNBVChBICsgQikKLQotICAgICAgICBBLEIgYW5kIEMgYXJlIDMyIGJpdCBTSUdORUQgbnVtYmVycy4KLSoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotI2lmbmRlZiBBREQyX1NBVF8zMngzMgotI2RlZmluZSBBREQyX1NBVF8zMngzMihBLEIsQykgICBcCi0gICAgICAgIHsoQyk9KEEpKyhCKTtcCi0gICAgICAgICBpZiAoKCgoQykgXiAoQSkpICYgKChDKSBeIChCKSkpID4+IDMxKVwKLSAgICAgICAgICAgIHtcCi0gICAgICAgICAgICAgICAgaWYoKEEpPDApXAotICAgICAgICAgICAgICAgICAgICAoQyk9MHg4MDAwMDAwMGw7XAotICAgICAgICAgICAgICAgIGVsc2VcCi0gICAgICAgICAgICAg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HJlcXVpcmVkIGJ5IGFwcGxpY2FibGUgbGF3IG9yIGFncmVlZCB0byBpbiB3cml0aW5nLCBzb2Z0d2FyZQotICogZGlzdHJpYnV0ZWQgdW5kZXIgdGhlIExpY2Vuc2UgaXMgZGlzdHJpYnV0ZWQgb24gYW4gIkFTIElTIiBCQVNJUywKLSAqIFdJVEhPVVQgV0FSUkFOVElFUyBPUiBDT05ESVRJT05TIE9GIEFOWSBLSU5ELCBlaXRoZXIgZXhwcmVzcyBvciBpbXBsaWVkLgotICogU2VlIHRoZSBMaWNlbnNlIGZvciB0aGUgc3BlY2lmaWMgbGFuZ3VhZ2UgZ292ZXJuaW5nIHBlcm1pc3Npb25zIGFuZAotICogbGltaXRhdGlvbnMgdW5kZXIgdGhlIExpY2Vuc2UuCi0gKi8KLQotI2lmbmRlZiBfX0xWTV9USU1FUl9IX18KLSNkZWZpbmUgX19MVk1fVElNRVJfSF9fCi0KLSNpbmNsdWRlICJMVk1fVHlwZXMuaCIKLQotLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0vKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICBIZWFkZXIgZmlsZSBmb3IgdGhlIExWTV9UaW1lciBsaWJyYXJ5ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgRnVuY3Rpb25hbGl0eTogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICBUaGUgdGltZXIgd2lsbCBjb3VudCBkb3duIGEgbnVtYmVyIG9mIG1zLCBiYXNlZCBvbiB0aGUgbnVtYmVyIG9mIHNhbXBsZXMgaXQgICAgICAgICAqLwotLyogIHNlZXMgYW5kIHRoZSBjdXJlbnQgc2FtcGxpbmcgcmF0ZS4gIFdoZW4gdGhlIHRpbWVyIGV4cGlyZXMsIGEgcmVnaXN0ZXJlZCAgICAgICAgICAgICovCi0vKiAgY2FsbGJhY2sgZnVuY3Rpb24gd2lsbCBiZSBjYWxsZWQuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICBUaGUgbWF4aW1hbCBudW1iZXIgb2Ygc2FtcGxlc3MgdGhhdCBjYW4gYmUgY2FsbGVkIGJ5IHRoZSB0aW1lciBpcyAyXjMyLCB3aGljaCAgICAgICAqLwotLyogIGNvcnJlc3BvbmRzIHRvIDI0LjggaG91cnMgYXQgYSBzYW1wbGluZyByYXRlIG9mIDQ4IGtIeiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgVGhlIHRpbWVyIGN1cnJlbnRseSBkb2VzIG5vdCBzdXBvcnQgY2hhbmdlcyBpbiBzYW1wbGluZyByYXRlIHdoaWxlIHRpbWluZy4gICAgICAgICAgKi8KLS8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotCi0KLSNpZmRlZiBfX2NwbHVzcGx1cwotZXh0ZXJuICJDIiB7Ci0jZW5kaWYgLyogX19jcGx1c3BsdXMgKi8KLQotLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0vKiAgVFlQRSBERUZJTklUSU9OUyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotCi10eXBlZGVmIHN0cnVjdAotewotICAgIExWTV9JTlQzMiBTdG9yYWdlWzZdOwotCi19IExWTV9UaW1lcl9JbnN0YW5jZV90OwotCi10eXBlZGVmIHN0cnVjdAotewotICAgIExWTV9JTlQzMiAgU2FtcGxpbmdSYXRlOwotICAgIExWTV9JTlQxNiAgVGltZUluTXM7Ci0gICAgTFZNX0lOVDMyICBDYWxsQmFja1BhcmFtOwotICAgIHZvaWQgICAgICAgKnBDYWxsQmFja1BhcmFtczsKLSAgICB2b2lkICAgICAgICpwQ2FsbGJhY2tJbnN0YW5jZTsKLSAgICB2b2lkICAgICAgICgqcENhbGxCYWNrKSh2b2lkKix2b2lkKixMVk1fSU5UMzIpOwotCi19IExWTV9UaW1lcl9QYXJhbXNfdDsKLQotLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0vKiAgRlVOQ1RJT04gUFJPVE9UWVBFUyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotCi12b2lkIExWTV9UaW1lcl9Jbml0ICggICBMVk1fVGltZXJfSW5zdGFuY2VfdCAgICAgICAqcEluc3RhbmNlLAotICAgICAgICAgICAgICAgICAgICAgICAgTFZNX1RpbWVyX1BhcmFtc190ICAgICAgICAgKnBQYXJhbXMgICAgICk7Ci0KLQotdm9pZCBMVk1fVGltZXIgICAgICAoICAgTFZNX1RpbWVyX0luc3RhbmNlX3QgICAgICAgKnBJbnN0YW5jZSwKLSAgICAgICAgICAgICAgICAgICAgICAgIExWTV9JTlQxNiAgICAgICAgICAgICAgICAgICAgICAgQmxvY2tTaXplICk7Ci0KLQotLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0vKiAgRU5EIE9GIEhFQURFUiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotCi0jaWZkZWYgX19jcGx1c3BsdXMKLX0KLSNlbmRpZiAvKiBfX2NwbHVzcGx1cyAqLwotCi0jZW5kaWYgIC8qIF9fTFZNX1RJTUVSX0hfXyAqLwpkaWZmIC0tZ2l0IGEvbWVkaWEvbGliZWZmZWN0cy9sdm0vbGliL0NvbW1vbi9saWIvTFZNX1R5cGVzLmggYi9tZWRpYS9saWJlZmZlY3RzL2x2bS9saWIvQ29tbW9uL2xpYi9MVk1fVHlwZXMuaApkZWxldGVkIGZpbGUgbW9kZSAxMDA2NDQKaW5kZXggODE2NTVkZC4uMDAwMDAwMAotLS0gYS9tZWRpYS9saWJlZmZlY3RzL2x2bS9saWIvQ29tbW9uL2xpYi9MVk1fVHlwZXMuaAorKysgL2Rldi9udWxsCkBAIC0xLDE4NyArMCwwIEBACi0vKgotICogQ29weXJpZ2h0IChDKSAyMDA0LTIwMTAgTlhQIFNvZnR3YXJlCi0gKiBDb3B5cmlnaHQgKEMpIDIwMTAgVGhlIEFuZHJvaWQgT3BlbiBTb3VyY2UgUHJvamVjdAotICoKLSAqIExpY2Vuc2VkIHVuZGVyIHRoZSBBcGFjaGUgTGljZW5zZSwgVmVyc2lvbiAyLjAgKHRoZSAiTGljZW5zZSIpOwotICogeW91IG1heSBub3QgdXNlIHRoaXMgZmlsZSBleGNlcHQgaW4gY29tcGxpYW5jZSB3aXRoIHRoZSBMaWNlbnNlLgotICogWW91IG1heSBvYnRhaW4gYSBjb3B5IG9mIHRoZSBMaWNlbnNlIGF0Ci0gKgotICogICAgICBodHRwOi8vd3d3LmFwYWNoZS5vcmcvbGljZW5zZXMvTElDRU5TRS0yLjAKLSAqCi0gKiBVbmxlc3MgcmVxdWlyZWQgYnkgYXBwbGljYWJsZSBsYXcgb3IgYWdyZWVkIHRvIGluIHdyaXRpbmcsIHNvZnR3YXJlCi0gKiBkaXN0cmlidXRlZCB1bmRlciB0aGUgTGljZW5zZSBpcyBkaXN0cmlidXRlZCBvbiBhbiAiQVMgSVMiIEJBU0lTLAotICogV0lUSE9VVCBXQVJSQU5USUVTIE9SIENPTkRJVElPTlMgT0YgQU5ZIEtJTkQsIGVpdGhlciBleHByZXNzIG9yIGltcGxpZWQuCi0gKiBTZWUgdGhlIExpY2Vuc2UgZm9yIHRoZSBzcGVjaWZpYyBsYW5ndWFnZSBnb3Zlcm5pbmcgcGVybWlzc2lvbnMgYW5kCi0gKiBsaW1pdGF0aW9ucyB1bmRlciB0aGUgTGljZW5zZS4KLSAqLwotCi0vKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLS8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogIEhlYWRlciBmaWxlIGRlZmluaW5nIHRoZSBzdGFuZGFyZCBMaWZlVmliZXMgdHlwZXMgZm9yIHVzZSBpbiB0aGUgYXBwbGljYXRpb24gbGF5ZXIgICovCi0vKiAgaW50ZXJmYWNlIG9mIGFsbCBMaWZlVmliZXMgbW9kdWxlcyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0KLSNpZm5kZWYgTFZNX1RZUEVTX0gKLSNkZWZpbmUgTFZNX1RZUEVTX0gKLQotI2lmZGVmIF9fY3BsdXNwbHVzCi1leHRlcm4gIkMiIHsKLSNlbmRpZiAvKiBfX2NwbHVzcGx1cyAqLwotCi0KLS8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotLyogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgZGVmaW5pdGlvbnMgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0KLSNkZWZpbmUgTFZNX05VTEwgICAgICAgICAgICAgICAgMCAgICAgICAgICAgICAgICAgICAvKiBOVUxMIHBvaW50ZXIgKi8KLQotI2RlZmluZSBMVk1fVFJVRSAgICAgICAgICAgICAgICAxICAgICAgICAgICAgICAgICAgIC8qIEJvb2xlYW5zICovCi0jZGVmaW5lIExWTV9GQUxTRSAgICAgICAgICAgICAgIDAKLQotI2RlZmluZSBMVk1fTUFYSU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hcnkgbWVtb3J5IHJlZ2lvbiAqLwotCi0jZGVmaW5lIExWTV9OUl9NRU1PUllfUkVHSU9OUyAgICAgICAgICAgICAgICAgICA0ICAgLyogTnVtYmVyIG9mIG1lbW9yeSByZWdpb25zICovCi0KLS8qIE1lbW9yeSBwYXJ0aXRpb24gdHlwZSAqLwotI2RlZmluZSBMVk1fTUVNX1BBUlRJVElPTjAgICAgICAwICAgICAgICAgICAgICAgICAgIC8qIDFzdCBtZW1vcnkgcGFydGl0aW9uICovCi0jZGVmaW5lIExWTV9NRU1fUEFSVElUSU9OMSAgICAgIDEgICAgICAgICAgICAgICAgICAgLyogMm5kIG1lbW9yeSBwYXJ0aXRpb24gKi8KLSNkZWZpbmUgTFZNX01FTV9QQVJUSVRJT04yICAgICAgMiAgICAgICAgICAgICAgICAgICAvKiAzcmQgbWVtb3J5IHBhcnRpdGlvbiAqLwotI2RlZmluZSBMVk1fTUVNX1BBUlRJVElPTjMgICAgICAzICAgICAgICAgICAgICAgICAgIC8qIDR0aCBtZW1vcnkgcGFydGl0aW9uICovCi0KLS8qIFVzZSB0eXBlICovCi0jZGVmaW5lIExWTV9NRU1fUEVSU0lTVEVOVCAgICAgIDAgICAgICAgICAgICAgICAgICAgLyogUGVyc2lzdGVudCBtZW1vcnkgdHlwZSAqLwotI2RlZmluZSBMVk1fTUVNX1NDUkFUQ0ggICAgICAgICA0ICAgICAgICAgICAgICAgICAgIC8qIFNjcmF0Y2ggIG1lbW9yeSB0eXBlICovCi0KLS8qIEFjY2VzcyB0eXBlICovCi0jZGVmaW5lIExWTV9NRU1fSU5URVJOQUwgICAgICAgIDAgICAgICAgICAgICAgICAgICAgLyogSW50ZXJuYWwgKGZhc3QpIGFjY2VzcyBtZW1vcnkgKi8KLSNkZWZpbmUgTFZNX01FTV9FWFRFUk5BTCAgICAgICAgOCAgICAgICAgICAgICAgICAgICAvKiBFeHRlcm5hbCAoc2xvdykgYWNjZXNzIG1lbW9yeSAqLwotCi0vKiBQbGF0Zm9ybSBzcGVjaWZpYyAqLwotI2RlZmluZSBMVk1fUEVSU0lTVEVOVCAgICAgICAgICBMVk1fTUVNX1BBUlRJVElPTjArTFZNX01FTV9QRVJTSVNURU5UK0xWTV9NRU1fSU5URVJOQUwKLSNkZWZpbmUgTFZNX1BFUlNJU1RFTlRfREFUQSAgICAgTFZNX01FTV9QQVJUSVRJT04xK0xWTV9NRU1fUEVSU0lTVEVOVCtMVk1fTUVNX0lOVEVSTkFMCi0jZGVmaW5lIExWTV9QRVJTSVNURU5UX0NPRUYgICAgIExWTV9NRU1fUEFSVElUSU9OMitMVk1fTUVNX1BFUlNJU1RFTlQrTFZNX01FTV9JTlRFUk5BTAotI2RlZmluZSBMVk1fU0NSQVRDSCAgICAgICAgICAgICBMVk1fTUVNX1BBUlRJVElPTjMrTFZNX01FTV9TQ1JBVENIK0xWTV9NRU1fSU5URVJOQUwKLQotLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0vKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICBCYXNpYyB0eXBlcyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLQotdHlwZWRlZiAgICAgY2hhciAgICAgICAgICAgICAgICBMVk1fQ0hBUjsgICAgICAgICAgIC8qIEFTQ0lJIGNoYXJhY3RlciAqLwotCi10eXBlZGVmICAgICBjaGFyICAgICAgICAgICAgICAgIExWTV9JTlQ4OyAgICAgICAgICAgLyogU2lnbmVkIDgtYml0IHdvcmQgKi8KLXR5cGVkZWYgICAgIHVuc2lnbmVkIGNoYXIgICAgICAgTFZNX1VJTlQ4OyAgICAgICAgICAvKiBVbnNpZ25lZCA4LWJpdCB3b3JkICovCi0KLXR5cGVkZWYgICAgIHNob3J0ICAgICAgICAgICAgICAgTFZNX0lOVDE2OyAgICAgICAgICAvKiBTaWduZWQgMTYtYml0IHdvcmQgKi8KLXR5cGVkZWYgICAgIHVuc2lnbmVkIHNob3J0ICAgICAgTFZNX1VJTlQxNjsgICAgICAgICAvKiBVbnNpZ25lZCAxNi1iaXQgd29yZCAqLwotCi10eXBlZGVmICAgICBsb25nICAgICAgICAgICAgICAgIExWTV9JTlQzMjsgICAgICAgICAgLyogU2lnbmVkIDMyLWJpdCB3b3JkICovCi10eXBlZGVmICAgICB1bnNpZ25lZCBsb25nICAgICAgIExWTV9VSU5UMzI7ICAgICAgICAgLyogVW5zaWduZWQgMzItYml0IHdvcmQgKi8KLQotCi0vKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLS8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogIFN0YW5kYXJkIEVudW1lcmF0ZWQgdHlwZXMgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKio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ICAgPSBMVk1fTUVNUkVHSU9OX1BFUlNJU1RFTlRfRkFTVF9EQVRBLAotICAgIExWTV9QRVJTSVNURU5UX0ZBU1RfQ09FRiAgICA9IExWTV9NRU1SRUdJT05fUEVSU0lTVEVOVF9GQVNUX0NPRUYsCi0gICAgTFZNX1RFTVBPUkFSWV9GQVNUICAgICAgICAgID0gTFZNX01FTVJFR0lPTl9URU1QT1JBUllfRkFTVCwKLSAgICBMVk1fTUVNT1JZVFlQRV9EVU1NWSAgICAgICAgPSBMVk1fTUFYRU5VTQotfSBMVk1fTWVtb3J5VHlwZXNfZW47Ci0KLQotLyogTWVtb3J5IHJlZ2lvbiBkZWZpbml0aW9uICovCi10eXBlZGVmIHN0cnVjdAotewotICAgIExWTV9VSU5UMzIgICAgICAgICAgICAgICAgICBTaXplOyAgICAgICAgICAgICAgICAgICAvKiBSZWdpb24gc2l6ZSBpbiBieXRlcyAqLwotICAgIExWTV9NZW1vcnlUeXBlc19lbiAgICAgICAgICBUeXBlOyAgICAgICAgICAgICAgICAgICAvKiBSZWdpb24gdHlwZSAqLwotICAgIHZvaWQgICAgICAgICAgICAgICAgICAgICAgICAqcEJhc2VBZGRyZXNzOyAgICAgICAgICAvKiBQb2ludGVyIHRvIHRoZSByZWdpb24gYmFzZSBhZGRyZXNzICovCi19IExWTV9NZW1vcnlSZWdpb25fc3Q7Ci0KLQotLyogTWVtb3J5IHRhYmxlIGNvbnRhaW5pbmcgdGhlIHJlZ2lvbiBkZWZpbml0aW9ucyAqLwotdHlwZWRlZiBzdHJ1Y3QKLXsKLSAgICBMVk1fTWVtb3J5UmVnaW9uX3N0ICAgICAgICAgUmVnaW9uW0xWTV9OUl9NRU1PUllfUkVHSU9OU107ICAvKiBPbmUgZGVmaW5pdGlvbiBmb3IgZWFjaCByZWdpb24gKi8KLX0gTFZNX01lbW9yeVRhYmxlX3N0OwotCi0KLS8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotLyogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgU3RhbmRhcmQgRnVuY3Rpb24gUHJvdG90eXBlcyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi10eXBlZGVmIExWTV9JTlQzMiAoKkxWTV9DYWxsYmFjaykodm9pZCAgICAgICAgICAqcENhbGxiYWNrRGF0YSwgICAgIC8qIFBvaW50ZXIgdG8gdGhlIGNhbGxiYWNrIGRhdGEgc3RydWN0dXJlICovCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdm9pZCAgICAgICAgICAqcEdlbmVyYWxQdXJwb3NlLCAgIC8qIEdlbmVyYWwgcHVycG9zZSBwb2ludGVyIChlLmcuIHRvIGEgZGF0YSBzdHJ1Y3R1cmUgbmVlZGVkIGluIHRoZSBjYWxsYmFjaykgKi8KLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBMVk1fSU5UMTYgICAgIEdlbmVyYWxQdXJwb3NlICk7ICAgLyogR2VuZXJhbCBwdXJwb3NlIHZhcmlhYmxlIChlLmcuIHRvIGJlIHVzZWQgYXMgY2FsbGJhY2sgSUQpICovCi0KLQotLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0vKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICBFbmQgb2YgZmlsZSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLQotI2lmZGVmIF9fY3BsdXNwbHVzCi19Ci0jZW5kaWYgLyogX19jcGx1c3BsdXMgKi8KLQotI2VuZGlmICAvKiBMVk1fVFlQRVNfSCAqLwpkaWZmIC0tZ2l0IGEvbWVkaWEvbGliZWZmZWN0cy9sdm0vbGliL0NvbW1vbi9saWIvTWl4ZXIuaCBiL21lZGlhL2xpYmVmZmVjdHMvbHZtL2xpYi9Db21tb24vbGliL01peGVyLmgKZGVsZXRlZCBmaWxlIG1vZGUgMTAwNjQ0CmluZGV4IDg5ZGViMGQuLjAwMDAwMDAKLS0tIGEvbWVkaWEvbGliZWZmZWN0cy9sdm0vbGliL0NvbW1vbi9saWIvTWl4ZXIuaAorKysgL2Rldi9udWxsCkBAIC0xLDEyNyArMCwwIEBACi0vKgotICogQ29weXJpZ2h0IChDKSAyMDA0LTIwMTAgTlhQIFNvZnR3YXJlCi0gKiBDb3B5cmlnaHQgKEMpIDIwMTAgVGhlIEFuZHJvaWQgT3BlbiBTb3VyY2UgUHJvamVjdAotICoKLSAqIExpY2Vuc2VkIHVuZGVyIHRoZSBBcGFjaGUgTGljZW5zZSwgVmVyc2lvbiAyLjAgKHRoZSAiTGljZW5zZSIpOwotICogeW91IG1heSBub3QgdXNlIHRoaXMgZmlsZSBleGNlcHQgaW4gY29tcGxpYW5j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VUlOVDE2ICAgRnMsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTFZNX1VJTlQxNiAgIE51bUNoYW5uZWxzKTsKLQotCi12b2lkIE1peFNvZnRfMVN0X0QzMkMzMV9XUkEoICAgIE1peF8xU3RfQ2xsX3QgICAgICAgKnBJbnN0YW5jZSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY29uc3QgTFZNX0lOVDMyICAgICAqc3JjLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBMVk1fSU5UMzIgICAgICpkc3QsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIExWTV9JTlQxNiAgICAgbik7Ci0KLXZvaWQgTWl4U29mdF8yU3RfRDMyQzMxX1NBVCggICAgTWl4XzJTdF9DbGxfdCAgICAgICAqcEluc3RhbmNlLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb25zdCBMVk1fSU5UMzIgICAgICpzcmMxLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb25zdCBMVk1fSU5UMzIgICAgICpzcmMyLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBMVk1fSU5UMzIgICAgICpkc3QsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIExWTV9JTlQxNiAgICAgbik7Ci0KLXZvaWQgTWl4SW5Tb2Z0X0QzMkMzMV9TQVQoICAgICAgTWl4XzFTdF9DbGxfdCAgICAgICAqcEluc3RhbmNlLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb25zdCBMVk1fSU5UMzIgICAgICpzcmMsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIExWTV9JTlQzMiAgICAgKmRzdCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTFZNX0lOVDE2ICAgICBuKTsKLQotLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKLSAgIEZVTkNUSU9OIFBST1RPVFlQRVMgKExPVyBMRVZFTCBTVUJGVU5DVElPTlMpCi0qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLQotdm9pZCBDb3JlX01peFNvZnRfMVN0X0QzMkMzMV9XUkEoICAgTWl4XzFTdF9DbGxfdCAgICAgICAqcEluc3RhbmNlLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY29uc3QgTFZNX0lOVDMyICAgICAqc3JjLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTFZNX0lOVDMyICAgICAqZHN0LAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTFZNX0lOVDE2ICAgICBuKTsKLQotdm9pZCBDb3JlX01peEhhcmRfMlN0X0QzMkMzMV9TQVQoICAgTWl4XzJTdF9DbGxfdCAgICAgICAqcEluc3RhbmNlLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY29uc3QgTFZNX0lOVDMyICAgICAqc3JjMSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbnN0IExWTV9JTlQzMiAgICAgKnNyYzIsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBMVk1fSU5UMzIgICAgICpkc3QsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBMVk1fSU5UMTYgICAgIG4pOwotCi12b2lkIENvcmVfTWl4SW5Tb2Z0X0QzMkMzMV9TQVQoICAgICBNaXhfMVN0X0NsbF90ICAgICAgICpwSW5zdGFuY2UsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb25zdCBMVk1fSU5UMzIgICAgICpzcmMsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBMVk1fSU5UMzIgICAgICpkc3QsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBMVk1fSU5UMTYgICAgIG4pOwotI2lmZGVmIF9fY3BsdXNwbHVzCi19Ci0jZW5kaWYgLyogX19jcGx1c3BsdXMgKi8KLQotCi0vKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLQotI2VuZGlmIC8qIF9fTUlYRVJfSF9fICovCi0KLQotCi0KLQotCi0KLQotCi0KZGlmZiAtLWdpdCBhL21lZGlhL2xpYmVmZmVjdHMvbHZtL2xpYi9Db21tb24vbGliL1NjYWxhckFyaXRobWV0aWMuaCBiL21lZGlhL2xpYmVmZmVjdHMvbHZtL2xpYi9Db21tb24vbGliL1NjYWxhckFyaXRobWV0aWMuaApkZWxldGVkIGZpbGUgbW9kZSAxMDA2NDQKaW5kZXggM2Q2MjcwNC4uMDAwMDAwMAotLS0gYS9tZWRpYS9saWJlZmZlY3RzL2x2bS9saWIvQ29tbW9uL2xpYi9TY2FsYXJBcml0aG1ldGljLmgKKysrIC9kZXYvbnVsbApAQCAtMSw2MCArMCwwIEBACi0vKgotICogQ29weXJpZ2h0IChDKSAyMDA0LTIwMTAgTlhQIFNvZnR3YXJlCi0gKiBDb3B5cmlnaHQgKEMpIDIwMTAgVGhlIEFuZHJvaWQgT3BlbiBTb3VyY2UgUHJvamVjdAotICoKLSAqIExpY2Vuc2VkIHVuZGVyIHRoZSBBcGFjaGUgTGljZW5zZSwgVmVyc2lvbiAyLjAgKHRoZSAiTGljZW5zZSIpOwotICogeW91IG1heSBub3QgdXNlIHRoaXMgZmlsZSBleGNlcHQgaW4gY29tcGxpYW5jZSB3aXRoIHRoZSBMaWNlbnNlLgotICogWW91IG1heSBvYnRhaW4gYSBjb3B5IG9mIHRoZSBMaWNlbnNlIGF0Ci0gKgotICogIC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mgiCi0KLS8qIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMqLwotLyogIEV4dGVybiBmdW5jdGlvbiBwcm90b3R5cGVzICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjKi8KLQotLyogQWJzb2x1dGUgdmFsdWUgaW5jbHVkaW5nIHRoZSBjb3JuZXIgY2FzZSBmb3IgdGhlIGV4dHJlbWUgbmVnYXRpdmUgdmFsdWUgKi8KLUxWTV9JTlQzMiAgIEFic18zMihMVk1fSU5UMzIgICAgIGlucHV0KTsKLQotLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKLSAqICBOYW1lICAgICAgICA6IGRCX3RvX0xpbjMyKCkKLSAqICBJbnB1dCAgICAgICA6IFNpZ25lZCAxNi1iaXQgaW50ZWdlcgotICogICAgICAgICAgICAgICAgICBNU0IgKDE2KSA9IHNpZ24gYml0Ci0gKiAgICAgICAgICAgICAgICAgICgxNS0+MDUpID0gaW50ZWdlciBwYXJ0Ci0gKiAgICAgICAgICAgICAgICAgICgwNC0+MDEpID0gZGVjaW1hbCBwYXJ0Ci0gKiAgT3V0cHV0ICAgICAgOiBTaWduZWQgMzItYml0IGludGVnZXIKLSAqICAgICAgICAgICAgICAgICAgTVNCICgzMikgPSBzaWduIGJpdAotICogICAgICAgICAgICAgICAgICAoMzEtPjE2KSA9IGludGVnZXIgcGFydAotICogICAgICAgICAgICAgICAgICAoMTUtPjAxKSA9IG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bnNlIGF0Ci0gKgotICogICAgICBodHRwOi8vd3d3LmFwYWNoZS5vcmcvbGljZW5zZXMvTElDRU5TRS0yLjAKLSAqCi0gKiBVbmxlc3MgcmVxdWlyZWQgYnkgYXBwbGljYWJsZSBsYXcgb3IgYWdyZWVkIHRvIGluIHdyaXRpbmcsIHNvZnR3YXJlCi0gKiBkaXN0cmlidXRlZCB1bmRlciB0aGUgTGljZW5zZSBpcyBkaXN0cmlidXRlZCBvbiBhbiAiQVMgSVMiIEJBU0lTLAotICogV0lUSE9VVCBXQVJSQU5USUVTIE9SIENPTkRJVElPTlMgT0YgQU5ZIEtJTkQsIGVpdGhlciBleHByZXNzIG9yIGltcGxpZWQuCi0gKiBTZWUgdGhlIExpY2Vuc2UgZm9yIHRoZSBzcGVjaWZpYyBsYW5ndWFnZSBnb3Zlcm5pbmcgcGVybWlzc2lvbnMgYW5kCi0gKiBsaW1pdGF0aW9ucyB1bmRlciB0aGUgTGljZW5zZS4KLSAqLwotCi0jaWZuZGVmIF9WRUNUT1JfQVJJVEhNRVRJQ19IXwotI2RlZmluZSBfVkVDVE9SX0FSSVRITUVUSUNfSF8KLQotCi0jaWZkZWYgX19jcGx1c3BsdXMKLWV4dGVybiAiQyIgewotI2VuZGlmIC8qIF9fY3BsdXNwbHVzICovCi0KLSNpbmNsdWRlICJMVk1fVHlwZXMuaCIKLQotLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKLSAgICBWQVJJT1VTIEZVTkNUSU9OUwotKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0KLXZvaWQgTG9hZENvbnN0XzE2KCAgICAgICAgICAgIGNvbnN0IExWTV9JTlQxNiB2YWwsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBMVk1fSU5UMTYgKmRzdCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIExWTV9JTlQxNiBuICk7Ci0KLXZvaWQgTG9hZENvbnN0XzMyKCAgICAgICAgICAgIGNvbnN0IExWTV9JTlQzMiB2YWwsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBMVk1fSU5UMzIgKmRzdCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIExWTV9JTlQxNiBuICk7Ci0KLXZvaWQgQ29weV8xNiggICAgICAgICAgICAgICAgIGNvbnN0IExWTV9JTlQxNiAqc3JjLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTFZNX0lOVDE2ICpkc3QsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBMVk1fSU5UMTYgbiApOwotCi0vKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCi0gKiBub3RlOiBJbiBNdWx0M3NfMTZ4MTYoKSBzYXR1cmF0aW9uIG9mIHJlc3VsdCBpcyBub3QgdGFrZW4gY2FyZSB3aGVuICAgICAgICAgICAqCi0gKiAgICAgICBvdmVyZmxvdyBvY2N1cnMuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqCi0gKiAgICAgICBGb3IgZXhhbXBsZSB3aGVuICpzcmMgPSAweDgwMDAsIHZhbCA9ICoweDgwMDAgICAgICAgICAgICAgICAgICAgICAgICAgICAqCi0gKiAgICAgICBUaGUgZnVuY3Rpb24gZ2l2ZXMgdGhlIG91dHB1dCBhcyAweDgwMDAgaW5zdGVhZCBvZiAweDdmZmYgICAgICAgICAgICAgICAqCi0gKiAgICAgICBUaGlzIGlzIHRoZSBvbmx5IGNhc2Ugd2hpY2ggd2lsbCBnaXZlIHdyb25nIHJlc3VsdC4gICAgICAgICAgICAgICAgICAgICAqCi0gKiAgICAgICBGb3IgbW9yZSBpbmZvcm1hdGlvbiByZWZlciB0byBWZWN0b3JfQXJpdGhtZXRpYy5kb2MgaW4gL2RvYyBmb2xkZXIgICAgICAqCi0gKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotdm9pZCBNdWx0M3NfMTZ4MTYoICAgICAgICAgICAgY29uc3QgTFZNX0lOVDE2ICpzcmMsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb25zdCBMVk1fSU5UMTYgdmFsLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTFZNX0lOVDE2ICpkc3QsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBMVk1fSU5UMTYgbik7Ci0KLS8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKLSAqIG5vdGU6IEluIE11bHQzc18zMngxNigpIHNhdHVyYXRpb24gb2YgcmVzdWx0IGlzIG5vdCB0YWtlbiBjYXJlIHdoZW4gICAgICAgICAgICoKLSAqICAgICAgIG92ZXJmbG93IG9jY3Vycy4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICoKLSAqICAgICAgIEZvciBleGFtcGxlIHdoZW4gKnNyYyA9IDB4ODAwMDAwMCwgdmFsID0gKjB4ODAwMCAgICAgICAgICAgICAgICAgICAgICAgICoKLSAqICAgICAgIFRoZSBmdW5jdGlvbiBnaXZlcyB0aGUgb3V0cHV0IGFzIDB4ODAwMDAwMCBpbnN0ZWFkIG9mIDB4N2ZmZmZmZmYgICAgICAgICoKLSAqICAgICAgIFRoaXMgaXMgdGhlIG9ubHkgZXh0cmVtZSBjb25kaXRpb24gd2hpY2ggaXMgZ2l2aW5nIHVuZXhwZWN0ZWQgcmVzdWx0ICAgICoKLSAqICAgICAgIEZvciBtb3JlIGluZm9ybWF0aW9uIHJlZmVyIHRvIFZlY3Rvcl9Bcml0aG1ldGljLmRvYyBpbiAvZG9jIGZvbGRlciAgICAgICoKLSAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi12b2lkIE11bHQzc18zMngxNiggICAgICAgICAgICBjb25zdCBMVk1fSU5UMzIgICpzcmMsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb25zdCBMVk1fSU5UMTYgdmFsLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTFZNX0lOVDMyICAqZHN0LAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTFZNX0lOVDE2IG4pOwotCi12b2lkIERlbGF5TWl4XzE2eDE2KCAgICAgICAgICBjb25zdCBMVk1fSU5UMTYgKnNyYywKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIExWTV9JTlQxNiAqZGVsYXksCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBMVk1fSU5UMTYgc2l6ZSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIExWTV9JTlQxNiAqZHN0LAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTFZNX0lOVDE2ICpwT2Zmc2V0LAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTFZNX0lOVDE2IG4pOwotCi12b2lkIERlbGF5V3JpdGVfMzIoICAgICAgICAgICBjb25zdCBMVk1fSU5UMzIgICpzcmMsICAgICAgICAgICAgICAgLyogU291cmNlIDEsIHRvIGJlIGRlbGF5ZWQgKi8KLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIExWTV9JTlQzMiAgKmRlbGF5LCAgICAgICAgICAgICAvKiBEZWxheSBidWZmZXIgKi8KLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIExWTV9VSU5UMTYgc2l6ZSwgICAgICAgICAgICAgICAvKiBEZWxheSBzaXplICovCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBMVk1fVUlOVDE2ICpwT2Zmc2V0LCAgICAgICAgICAgLyogRGVsYXkgb2Zmc2V0ICovCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBMVk1fSU5UMTYgbik7Ci0KLXZvaWQgQWRkMl9TYXRfMTZ4MTYoICAgICAgICAgIGNvbnN0IExWTV9JTlQxNiAqc3JjLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTFZNX0lOVDE2ICpkc3QsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBMVk1fSU5UMTYgbiApOwotCi12b2lkIEFkZDJfU2F0XzMyeDMyKCAgICAgICAgICBjb25zdCBMVk1fSU5UMzIgICpzcmMsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBMVk1fSU5UMzIgICpkc3QsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBMVk1fSU5UMTYgbiApOwotCi12b2lkIE1hYzNzX1NhdF8xNngxNiggICAgICAgICBjb25zdCBMVk1fSU5UMTYgKnNyYywKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbnN0IExWTV9JTlQxNiB2YWwsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBMVk1fSU5UMTYgKmRzdCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIExWTV9JTlQxNiBuKTsKLQotdm9pZCBNYWMzc19TYXRfMzJ4MTYoICAgICAgICAgY29uc3QgTFZNX0lOVDMyICAqc3JjLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY29uc3QgTFZNX0lOVDE2IHZhbCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIExWTV9JTlQzMiAgKmRzdCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIExWTV9JTlQxNiBuKTsKLQotdm9pZCBEZWxheUFsbFBhc3NfU2F0XzMyeDE2VG8zMiggICAgTFZNX0lOVDMyICAqZGVsYXksICAgICAgICAgICAgICAvKiBEZWxheSBidWZmZXIgKi8KLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIExWTV9VSU5UMTYgc2l6ZSwgICAgICAgICAgICAgICAgLyogRGVsYXkgc2l6ZSAqLwotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTFZNX0lOVDE2IGNvZWZmLCAgICAgICAgICAgICAgICAvKiBBbGwgcGFzcyBmaWx0ZXIgY29lZmZpY2llbnQgKi8KLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIExWTV9VSU5UMTYgRGVsYXlPZmZzZXQsICAgICAgICAgLyogU2ltcGxlIGRlbGF5IG9mZnNldCAqLwotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTFZNX1VJTlQxNiAqcEFsbFBhc3NPZmZzZXQsICAgICAvKiBBbGwgcGFzcyBmaWx0ZXIgZGVsYXkgb2Zmc2V0ICovCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBMVk1fSU5UMzIgICpkc3QsICAgICAgICAgICAgICAgIC8qIFNvdXJjZS9kZXN0aW5hdGlvbiAqLwotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTFZNX0lOVDE2IG4pOwotCi0vKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgotICAgIFNISUZUIEZVTkNUSU9OUwotKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0KLXZvaWQgU2hpZnRfU2F0X3YxNnh2MTYgKCAgICAgIGNvbnN0IExWTV9JTlQxNiB2YWwsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb25zdCBMVk1fSU5UMTYgKnNyYywKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIExWTV9JTlQxNiAqZHN0LAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTFZNX0lOVDE2IG4pOwotCi12b2lkIFNoaWZ0X1NhdF92MzJ4djMyICggICAgICBjb25zdCBMVk1fSU5UMTYgdmFsLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY29uc3QgTFZNX0lOVDMyICpzcmMsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBMVk1fSU5UMzIgKmRzdCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIExWTV9JTlQxNiBuKTsKLQotLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKLSAgICBBVURJTyBGT1JNQVQgQ09OVkVSU0lPTiBGVU5DVElPTlMKLSoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotCi12b2lkIE1vbm9UbzJJXzE2KCAgICAgICAgICAgICBjb25zdCBMVk1fSU5UMTYgKnNyYywKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIExWTV9JTlQxNiAqZHN0LAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTFZNX0lOVDE2IG4pOwotCi12b2lkIE1vbm9UbzJJXzMyKCAgICAgICAgICAgICBjb25zdCBMVk1fSU5UMzIgICpzcmMsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBMVk1fSU5UMzIgICpkc3QsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBMVk1fSU5UMTYgbik7Ci0KLXZvaWQgRnJvbTJpVG9Nb25vXzMyKCAgICAgICAgIGNvbnN0IExWTV9JTlQzMiAgKnNyYywKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIExWTV9JTlQzMiAgKmRzdCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIExWTV9JTlQxNiBuKTsKLQotdm9pZCBNU1RvMmlfU2F0XzE2eDE2KCAgICAgICAgY29uc3QgTFZNX0lOVDE2ICpzcmNNLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY29uc3QgTFZNX0lOVDE2ICpzcmNTLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTFZNX0lOVDE2ICpkc3QsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBMVk1fSU5UMTYgbiApOwotCi12b2lkIEZyb20yaVRvTVNfMTZ4MTYoICAgICAgICBjb25zdCBMVk1fSU5UMTYgKnNyYywKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIExWTV9JTlQxNiAqZHN0TSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIExWTV9JTlQxNiAqZHN0UywKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIExWTV9JTlQxNiBuICk7Ci0KLXZvaWQgRnJvbTJpVG9Nb25vXzE2KCAgICAgICAgIGNvbnN0IExWTV9JTlQxNiAqc3JjLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTFZNX0lOVDE2ICpkc3QsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBMVk1fSU5UMTYgbik7Ci0KLXZvaWQgSm9pblRvMmlfMzJ4MzIoICAgICAgICAgIGNvbnN0IExWTV9JTlQzMiAgKnNyY0wsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb25zdCBMVk1fSU5UMzIgICpzcmNSLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTFZNX0lOVDMyICAqZHN0LAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTFZNX0lOVDE2IG4gKTsKLQotLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKLSAgICBEQVRBIFRZUEUgQ09OVkVSU0lPTiBGVU5DVElPTlMKLSoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotCi12b2lkIEludDE2TFNoaWZ0VG9JbnQzMl8xNngzMihjb25zdCBMVk1fSU5UMTYgKnNyYywKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIExWTV9JTlQzMiAgKmRzdCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIExWTV9JTlQxNiBuLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTFZNX0lOVDE2IHNoaWZ0ICk7Ci0KLXZvaWQgSW50MzJSU2hpZnRUb0ludDE2X1NhdF8zMngxNihjb25zdCAgTFZNX0lOVDMyICAqc3JjLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTFZNX0lOVDE2ICpkc3QsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBMVk1fSU5UMTYgbiwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIExWTV9JTlQxNiBzaGlmdCApOwotCi0jaWZkZWYgX19jcGx1c3BsdXMKLX0KLSNlbmRpZiAvKiBfX2NwbHVzcGx1cyAqLwotCi0KLS8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotCi0jZW5kaWYgIC8qIF9WRUNUT1JfQVJJVEhNRVRJQ19IXyAqLwotCi0vKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq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V0ZWQgb24gYW4gIkFTIElTIiBCQVNJUywKLSAqIFdJVEhPVVQgV0FSUkFOVElFUyBPUiBDT05ESVRJT05TIE9GIEFOWSBLSU5ELCBlaXRoZXIgZXhwcmVzcyBvciBpbXBsaWVkLgotICogU2VlIHRoZSBMaWNlbnNlIGZvciB0aGUgc3BlY2lmaWMgbGFuZ3VhZ2UgZ292ZXJuaW5nIHBlcm1pc3Npb25zIGFuZAotICogbGltaXRhdGlvbnMgdW5kZXIgdGhlIExpY2Vuc2UuCi0gKi8KLQotLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0vKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICAgIEluY2x1ZGVzICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLQotI2luY2x1ZGUgIkFHQy5oIgotI2luY2x1ZGUgIlNjYWxhckFyaXRobWV0aWMuaCIKLQotCi0vKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLS8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogICAgRGVmaW5lcyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotCi0jZGVmaW5lIFZPTF9UQ19TSElGVCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAyMSAgICAgICAgICAvKiBBcyBhIHBvd2VyIG9mIDIgKi8KLSNkZWZpbmUgREVDQVlfU0hJRlQgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMTAgICAgICAgICAgIC8qIEFzIGEgcG93ZXIgb2YgMiAqLwotCi0KLS8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotLyogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiBGVU5DVElPTjogICAgICAgICAgICAgICAgICBBR0NfTUlYX1ZPTF8yU3QxTW9uX0QzMl9XUkEgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogREVTQ1JJUFRJT046ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgICBBcHBseSBBR0MgYW5kIG1peCBzaWduYWxzICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgU3RTcmMgICAtLS0tLS0tLS0tLS0tLS0tLS18ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogICAgICAgICAgICAgIF9fX19fXyAgICAgICBffF8gICAgICAgIF9fX19fX19fICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgICAgICAgICAgICB8ICAgICAgfCAgICAgfCAgIHwgICAgICB8ICAgICAgICB8ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICBNb25vU3JjIC0tPnwgQUdDICB8LS0tLT58ICsgfC0tLS0tPnwgVm9sdW1lIHwtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0rLS0tPiAgICAqLwotLyogICAgICAgICAgICAgfCBHYWluIHwgICAgIHxfX198ICAgICAgfCBHYWluICAgfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwgICAgICAgICovCi0vKiAgICAgICAgICAgICB8X19fX19ffCAgICAgICAgICAgICAgICB8X19fX19fX198ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfCAgICAgICAgKi8KLS8qICAgICAgICAgICAgICAgIC98XCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBfX19fX19fX19fICAgICBfX19fX19fXyAgICB8ICAgICAgICAqLwotLyogICAgICAgICAgICAgICAgIHwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfCAgICAgICAgICB8ICAgfCAgICAgICAgfCAgIHwgICAgICAgICovCi0vKiAgICAgICAgICAgICAgICAgfC0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS18IEFHQyBHYWluIHw8LS18IFBlYWsgICB8PC0tfCAgICAgICAgKi8KLS8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwgVXBkYXRlICAgfCAgIHwgRGV0ZWN0IHwgICAgICAgICAgICAqLwotLyogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfF9fX19fX19fX198ICAgfF9fX19fX19ffCAgICAgICAgICAgICovCi0vKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogUEFSQU1FVEVSUzogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgcEluc3RhbmNlICAgICAgICAgICAgICAgSW5zdGFuY2UgcG9pbnRlciAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICBwU3RlcmVvSW4gICAgICAgICAgICAgICBTdGVyZW8gc291cmNlICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogIHBNb25vSW4gICAgICAgICAgICAgICAgIE1vbm8gYmFuZCBwYXNzIHNvdXJjZSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgcFN0ZXJlb091dCAgICAgICAgICAgICAgU3RlcmVvIGRlc3RpbmF0aW9uICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogUkVUVVJOUzogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgVm9pZCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogTk9URVM6ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotCi12b2lkIEFHQ19NSVhfVk9MXzJTdDFNb25fRDMyX1dSQShBR0NfTUlYX1ZPTF8yU3QxTW9uX0QzMl90ICAqcEluc3RhbmNlLCAgICAgLyogSW5zdGFuY2UgcG9pbnRlciAqLwotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY29uc3QgTFZNX0lOVDMyICAgICAgICAgICAgKnBTdFNyYywgICAgICAgIC8qIFN0ZXJlbyBzb3VyY2UgKi8KLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbnN0IExWTV9JTlQzMiAgICAgICAgICAgICpwTW9ub1NyYywgICAgICAvKiBNb25vIHNvdXJjZSAqLwotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTFZNX0lOVDMyICAgICAgICAgICAgICAgICAgKnBEc3QsICAgICAgICAgIC8qIFN0ZXJlbyBkZXN0aW5hdGlvbiAqLwotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTFZNX1VJTlQxNiAgICAgICAgICAgICAgICAgTnVtU2FtcGxlcykgICAgIC8qIE51bWJlciBvZiBzYW1wbGVzICovCi17Ci0KLSAgICAvKgotICAgICAqIEdlbmVyYWwgdmFyaWFibGVzCi0gICAgICovCi0gICAgTFZNX1VJTlQxNiAgICAgIGk7ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLyogU2FtcGxlIGluZGV4ICovCi0gICAgTFZNX0lOVDMyICAgICAgIExlZnQ7ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLyogTGVmdCBzYW1wbGUgKi8KLSAgICBMVk1fSU5UMzIgICAgICAgUmlnaHQ7ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvKiBSaWdodCBzYW1wbGUgKi8KLSAgICBMVk1fSU5UMzIgICAgICAgTW9ubzsgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvKiBNb25vIHNhbXBsZSAqLwotICAgIExWTV9JTlQzMiAgICAgICBBYnNQZWFrOyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8qIEFic29sdXRlIHBlYWsgc2lnbmFsICovCi0gICAgTFZNX0lOVDMyICAgICAgIEhpZ2hXb3JkOyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLyogSGlnaCB3b3JkIGluIGludGVybWVkaWF0ZSBjYWxjdWxhdGlvbnMgKi8KLSAgICBMVk1fSU5UMzIgICAgICAgTG93V29yZDsgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvKiBMb3cgd29yZCBp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Wb2x1bWU7ICAgICAgICAgICAvKiBBY3R1YWwgdm9sdW1lIHNldHRpbmcgKi8KLSAgICBMVk1fSU5UMzIgICAgICBWb2xfVGFyZ2V0ICAgID0gcEluc3RhbmNlLT5UYXJnZXQ7ICAgICAgICAgICAvKiBUYXJnZXQgdm9sdW1lIHNldHRpbmcgKi8KLSAgICBMVk1fSU5UMTYgICAgICBWb2xfU2hpZnQgICAgID0gcEluc3RhbmNlLT5Wb2x1bWVTaGlmdDsgICAgICAvKiBWb2x1bWUgc2hpZnQgc2NhbGluZyAqLwotICAgIExWTV9JTlQxNiAgICAgIFZvbF9UQyAgICAgICAgPSBwSW5zdGFuY2UtPlZvbHVtZVRDOyAgICAgICAgIC8qIFRpbWUgY29uc3RhbnQgKi8KLQotCi0gICAgLyoKLSAgICAgKiBQcm9jZXNzIG9uIGEgc2FtcGxlIGJ5IHNhbXBsZSBiYXNpcwotICAgICAqLwotICAgIGZvciAoaT0wO2k8TnVtU2FtcGxlcztpKyspICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8qIEZvciBlYWNoIHNhbXBsZSAqLwotICAgIHsKLQotICAgICAgICAvKgotICAgICAgICAgKiBHZXQgdGhlIHNob3J0IHNjYWxlcnMKLSAgICAgICAgICovCi0gICAgICAgIEFHQ19NdWx0ICAgID0gKExWTV9JTlQxNikoQUdDX0dhaW4gPj4gMTYpOyAgICAgICAgICAgICAgLyogR2V0IHRoZSBzaG9ydCBBR0MgZ2FpbiAqLwotICAgICAgICBWb2xfTXVsdCAgICA9IChMVk1fSU5UMTYpKFZvbF9DdXJyZW50ID4+IDE2KTsgICAgICAgICAgIC8qIEdldCB0aGUgc2hvcnQgdm9sdW1lIGdhaW4gKi8KLQotCi0gICAgICAgIC8qCi0gICAgICAgICAqIEdldCB0aGUgaW5wdXQgc2FtcGxlcwotICAgICAgICAgKi8KLSAgICAgICAgTGVmdCAgPSAqcFN0U3JjKys7ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvKiBHZXQgdGhlIGxlZnQgc2FtcGxlICovCi0gICAgICAgIFJpZ2h0ID0gKnBTdFNyYysrOyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLyogR2V0IHRoZSByaWdodCBzYW1wbGUgKi8KLSAgICAgICAgTW9ubyAgPSAqcE1vbm9TcmMrKzsgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvKiBHZXQgdGhlIG1vbm8gc2FtcGxlICovCi0KLQotICAgICAgICAvKgotICAgICAgICAgKiBBcHBseSB0aGUgQUdDIGdhaW4gdG8gdGhlIG1vbm8gaW5wdXQgYW5kIG1peCB3aXRoIHRoZSBzdGVyZW8gc2lnbmFsCi0gICAgICAgICAqLwotICAgICAgICBIaWdoV29yZCA9IChBR0NfTXVsdCAqIChNb25vID4+IDE2KSk7ICAgICAgICAgICAgICAgICAgIC8qIHNpZ25lZCBsb25nIChNb25vKSBieSB1bnNpZ25lZCBzaG9ydCAoQUdDX011bHQpIG11bHRpcGx5ICovCi0gICAgICAgIExvd1dvcmQgPSAoQUdDX011bHQgKiAoTW9ubyAmIDB4ZmZmZikpOwotICAgICAgICBNb25vID0gKEhpZ2hXb3JkICsgKExvd1dvcmQgPj4gMTYpKSA8PCAoQUdDX0dhaW5TaGlmdCk7Ci0gICAgICAgIExlZnQgICs9IE1vbm87ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLyogTWl4IGluIHRoZSBtb25vIHNpZ25hbCAqLwotICAgICAgICBSaWdodCArPSBNb25vOwotCi0KLSAgICAgICAgLyoKLSAgICAgICAgICogQXBwbHkgdGhlIHZvbHVtZSBhbmQgd3JpdGUgdG8gdGhlIG91dHB1dCBzdHJlYW0KLSAgICAgICAgICovCi0gICAgICAgIEhpZ2hXb3JkID0gKFZvbF9NdWx0ICogKExlZnQgPj4gMTYpKTsgICAgICAgICAgICAgICAgICAgLyogc2lnbmVkIGxvbmcgKExlZnQpIGJ5IHVuc2lnbmVkIHNob3J0IChWb2xfTXVsdCkgbXVsdGlwbHkgKi8KLSAgICAgICAgTG93V29yZCA9IChWb2xfTXVsdCAqIChMZWZ0ICYgMHhmZmZmKSk7Ci0gICAgICAgIExlZnQgPSAoSGlnaFdvcmQgKyAoTG93V29yZCA+PiAxNikpIDw8IChWb2xfU2hpZnQpOwotICAgICAgICBIaWdoV29yZCA9IChWb2xfTXVsdCAqIChSaWdodCA+PiAxNikpOyAgICAgICAgICAgICAgICAgIC8qIHNpZ25lZCBsb25nIChSaWdodCkgYnkgdW5zaWduZWQgc2hvcnQgKFZvbF9NdWx0KSBtdWx0aXBseSAqLwotICAgICAgICBMb3dXb3JkID0gKFZvbF9NdWx0ICogKFJpZ2h0ICYgMHhmZmZmKSk7Ci0gICAgICAgIFJpZ2h0ID0gKEhpZ2hXb3JkICsgKExvd1dvcmQgPj4gMTYpKSA8PCAoVm9sX1NoaWZ0KTsKLSAgICAgICAgKnBEc3QrKyA9IExlZnQ7ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvKiBTYXZlIHRoZSByZXN1bHRzICovCi0gICAgICAgICpwRHN0KysgPSBSaWdodDsKLQotCi0gICAgICAgIC8qCi0gICAgICAgICAqIFVwZGF0ZSB0aGUgQUdDIGdhaW4KLSAgICAgICAgICovCi0gICAgICAgIEFic1BlYWsgPSAoQWJzXzMyKExlZnQpPkFic18zMihSaWdodCkpID8gQWJzXzMyKExlZnQpIDogQWJzXzMyKFJpZ2h0KTsgIC8qIEdldCB0aGUgYWJzb2x1dGUgcGVhayAqLwotICAgICAgICBpZiAoQWJzUGVhayA+IEFHQ19UYXJnZXQpCi0gICAgICAgIHsKLSAgICAgICAgICAgIC8qCi0gICAgICAgICAgICAgKiBUaGUgc2lnbmFsIGlzIHRvbyBsYXJnZSBzbyBkZWNyZWFzZSB0aGUgZ2FpbgotICAgICAgICAgICAgICovCi0gICAgICAgICAgICBIaWdoV29yZCA9IChBR0NfQXR0YWNrICogKEFHQ19HYWluID4+IDE2KSk7ICAgICAgICAgLyogc2lnbmVkIGxvbmcgKEFHQ19HYWluKSBieSB1bnNpZ25lZCBzaG9ydCAoQUdDX0F0dGFjaykgbXVsdGlwbHkgKi8KLSAgICAgICAgICAgIExvd1dvcmQgPSAoQUdDX0F0dGFjayAqIChBR0NfR2FpbiAmIDB4ZmZmZikpOwotICAgICAgICAgICAgQUdDX0dhaW4gPSAoSGlnaFdvcmQgKyAoTG93V29yZCA+PiAxNikpIDw8IDE7Ci0gICAgICAgIH0KLSAgICAgICAgZWxzZQotICAgICAgICB7Ci0gICAgICAgICAgICAvKgotICAgICAgICAgICAgICogVGhlIHNpZ25hbCBpcyB0b28gc21hbGwgc28gaW5jcmVhc2UgdGhlIGdhaW4KLSAgICAgICAgICAgICAqLwotICAgICAgICAgICAgaWYgKEFHQ19HYWluID4gQUdDX01heEdhaW4pCi0gICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgQUdDX0dhaW4gLT0gKEFHQ19EZWNheSA8PCBERUNBWV9TSElGVCk7Ci0gICAgICAgICAgICB9Ci0gICAgICAgICAgICBlbHNlCi0gICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgQUdDX0dhaW4gKz0gKEFHQ19EZWNheSA8PCBERUNBWV9TSElGVCk7Ci0gICAgICAgICAgICB9Ci0gICAgICAgIH0KLQotICAgICAgICAvKgotICAgICAgICAgKiBVcGRhdGUgdGhlIGdhaW4KLSAgICAgICAgICovCi0gICAgICAgIFZvbF9DdXJyZW50ICs9IFZvbF9UQyAqICgoVm9sX1RhcmdldCAtIFZvbF9DdXJyZW50KSA+PiBWT0xfVENfU0hJRlQpOwotICAgIH0KLQotCi0gICAgLyoKLSAgICAgKiBVcGRhdGUgdGhlIHBhcmFtZXRlcnMKLSAgICAgKi8KLSAgICBwSW5zdGFuY2UtPlZvbHVtZSA9IFZvbF9DdXJyZW50OyAgICAgICAgICAgICAgICAgICAgICAgICAgICAvKiBBY3R1YWwgdm9sdW1lIHNldH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SIENPTkRJVElPTlMgT0YgQU5ZIEtJTkQsIGVpdGhlciBleHByZXNzIG9yIGltcGxpZWQuCi0gKiBTZWUgdGhlIExpY2Vuc2UgZm9yIHRoZSBzcGVjaWZpYyBsYW5ndWFnZSBnb3Zlcm5pbmcgcGVybWlzc2lvbnMgYW5kCi0gKiBsaW1pdGF0aW9ucyB1bmRlciB0aGUgTGljZW5zZS4KLSAqLwotCi0vKiMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjKi8KLS8qICBJbmNsdWRlIGZpbGVzICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyojIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyovCi0KLSNpbmNsdWRlICAgICJTY2FsYXJBcml0aG1ldGljLmgiCi0KLS8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCi0gKiAgTmFtZSAgICAgICAgOiBBYnNfMzIoKQotICogIElucHV0ICAgICAgIDogU2lnbmVkIDMyLWJpdCBpbnRlZ2VyCi0gKiAgT3V0cHV0ICAgICAgOgotICogIFJldHVybnMgICAgIDogQWJzb2x1dGUgdmFsdWUKLSAqICBEZXNjcmlwdGlvbiA6IEFic29sdXRlIHZhbHVlIHdpdGggbWF4aW11bSBuZWdhdGl2ZSB2YWx1ZSBjb3JuZXIgY2FzZQotICogIFJlbWFya3MgICAgIDoKLSAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqK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IExpY2Vuc2UsIFZlcnNpb24gMi4wICh0aGUgIkxpY2Vuc2UiKTsKLSAqIHlvdSBtYXkgbm90IHVzZSB0aGlzIGZpbGUgZXhjZXB0IGluIGNvbXBsaWFuY2Ugd2l0aCB0aGUgTGljZW5zZS4KLSAqIFlvdSBtYXkgb2J0YWluIGEgY29weSBvZiB0aGUgTGljZW5zZSBhdAotICoKLSAqICAgICAgaHR0cDovL3d3dy5hcGFjaGUub3JnL2xpY2Vuc2VzL0xJQ0VOU0UtMi4wCi0gKgotICogVW5sZXNzIHJlcXVpcmVkIGJ5IGFwcGxpY2FibGUgbGF3IG9yIGFncmVlZCB0byBpbiB3cml0aW5nLCBzb2Z0d2FyZQotICogZGlzdHJpYnV0ZWQgdW5kZXIgdGhlIExpY2Vuc2UgaXMgZGlzdHJpYnV0ZWQgb24gYW4gIkFTIElTIiBCQVNJUywKLSAqIFdJVEhPVVQgV0FSUkFOVElFUyBPUiBDT05ESVRJT05TIE9GIEFOWSBLSU5ELCBlaXRoZXIgZXhwcmVzcyBvciBpbXBsaWVkLgotICogU2VlIHRoZSBMaWNlbnNlIGZvciB0aGUgc3BlY2lmaWMgbGFuZ3VhZ2UgZ292ZXJuaW5nIHBlcm1pc3Npb25zIGFuZAotICogbGltaXRhdGlvbnMgdW5kZXIgdGhlIExpY2Vuc2UuCi0gKi8KLQotLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKLSAgIElOQ0xVREUgRklMRVMKLSoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotCi0jaW5jbHVkZSAiVmVjdG9yQXJpdGhtZXRpYy5oIgotCi0vKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgotICAgRlVOQ1RJT04gQUREMl9TQVRfMTZYMTYKLSoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotCi12b2lkIEFkZDJfU2F0XzE2eDE2KCBjb25zdCBMVk1fSU5UMTYgKnNyYywKLSAgICAgICAgICAgICAgICAgICAgICAgICAgIExWTV9JTlQxNiAqZHN0LAotICAgICAgICAgICAgICAgICAgICAgICAgICAgTFZNX0lOVDE2ICBuICkKLXsKLSAgICBMVk1fSU5UMzIgVGVtcDsKLSAgICBMVk1fSU5UMTYgaWk7Ci0gICAgZm9yIChpaSA9IG47IGlpICE9IDA7IGlpLS0pCi0gICAgewotICAgICAgICBUZW1wID0gKChMVk1fSU5UMzIpICpzcmMpICsgKChMVk1fSU5UMzIpICpkc3QpOwotICAgICAgICBzcmMrKzsKLQotICAgICAgICBpZiAoVGVtcCA+IDB4MDAwMDdGRkYpCi0gICAgICAgIHsKLSAgICAgICAgICAgICpkc3QgPSAweDdGRkY7Ci0gICAgICAgIH0KLSAgICAgICAgZWxzZSBpZiAoVGVtcCA8IC0weDAwMDA4MDAwKQotICAgICAgICB7Ci0gICAgICAgICAgICAqZHN0ID0gLSAweDgwMDA7Ci0gICAgICAgIH0KLSAgICAgICAgZWxzZQotICAgICAgICB7Ci0gICAgICAgICAgICAqZHN0ID0gKExWTV9JTlQxNilUZW1wOwotICAgICAgICB9Ci0gICAgICAgIGRzdCsrOwotICAgIH0KLSAgICByZXR1cm47Ci19Ci0KLS8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwpkaWZmIC0tZ2l0IGEvbWVkaWEvbGliZWZmZWN0cy9sdm0vbGliL0NvbW1vbi9zcmMvQWRkMl9TYXRfMzJ4MzIuYyBiL21lZGlhL2xpYmVmZmVjdHMvbHZtL2xpYi9Db21tb24vc3JjL0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AqIGxpbWl0YXRpb25zIHVuZGVyIHRoZSBMaWNlbnNlLgotICovCi0KLS8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCi0gICBJTkNMVURFIEZJTEVTCi0qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLQotI2luY2x1ZGUgIlZlY3RvckFyaXRobWV0aWMuaCIKLQotCi0vKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgotICAgRlVOQ1RJT04gQUREMl9TQVRfMzJYMzIKLSoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotCi12b2lkIEFkZDJfU2F0XzMyeDMyKCBjb25zdCBMVk1fSU5UMzIgICpzcmMsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICBMVk1fSU5UMzIgICpkc3QsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICBMVk1fSU5UMTYgIG4gKQotewotICAgIExWTV9JTlQzMiBhLGIsYzsKLSAgICBMVk1fSU5UMTYgaWk7Ci0gICAgZm9yIChpaSA9IG47IGlpICE9IDA7IGlpLS0pCi0gICAgewotICAgICAgICBhPSpzcmM7Ci0gICAgICAgIHNyYysrOwotCi0gICAgICAgIGI9KmRzdDsKLSAgICAgICAgYz1hK2I7Ci0gICAgICAgIGlmICgoKChjIF4gYSkgJiAoYyBeIGIpKSA+PiAzMSkhPTApICAgICAvKiBvdmVyZmxvdyAvIHVuZGVyZmxvdyAqLwotICAgICAgICB7Ci0gICAgICAgICAgICBpZihhPDApCi0gICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgYz0weDgwMDAwMDAwbDsKLSAg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zWzFdIGlzIHgobi0yKUwgaW4gUTAgZm9ybWF0Ci0gcEJpcXVhZFN0YXRlLT5wRGVsYXlzWzJdIGlzIHkobi0xKUwgaW4gUTAgZm9ybWF0Ci0gcEJpcXVhZFN0YXRlLT5wRGVsYXlzWzNdIGlzIHkobi0yKUwgaW4gUTAgZm9ybWF0Ci0qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0KLXZvaWQgQlBfMUlfRDE2RjE2QzE0X1RSQ19XUkFfMDEgKCBCaXF1YWRfSW5zdGFuY2VfdCAgICAgICAqcEluc3RhbmNlLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIExWTV9JTlQxNiAgICAgICAgICAgICAgICpwRGF0YUluLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIExWTV9JTlQxNiAgICAgICAgICAgICAgICpwRGF0YU91dCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBMVk1fSU5UMTYgICAgICAgICAgICAgICBOclNhbXBsZXMpCi0KLQotICAgIHsKLSAgICAgICAgTFZNX0lOVDMyIHluTDsKLSAgICAgICAgTFZNX0lOVDE2IGlpOwotICAgICAgICBQRmlsdGVyX1N0YXRlIHBCaXF1YWRTdGF0ZSA9IChQRmlsdGVyX1N0YXRlKSBwSW5zdGFuY2U7Ci0KLSAgICAgICAgIGZvciAoaWkgPSBOclNhbXBsZXM7IGlpICE9IDA7IGlpLS0pCi0gICAgICAgICB7Ci0KLQotICAgICAgICAgICAgLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgUFJPQ0VTU0lORyBPRiBUSEUgTEVGVCBDSEFOTkVMCi0gICAgICAgICAgICAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0gICAgICAgICAgICAvLyB5bkw9IChBMCAoUTE0KSAqICh4KG4pTCAoUTApIC0geChuLTIpTCAoUTApICkgKSAgaW4gUTE0Ci0gICAgICAgICAgICB5bkw9KExWTV9JTlQzMilwQmlxdWFkU3RhdGUtPmNvZWZzWzBdKiAoKCpwRGF0YUluKS1wQmlxdWFkU3RhdGUtPnBEZWxheXNbMV0pOwotCi0gICAgICAgICAgICAvLyB5bkwrPSAoKC1CMiAoUTE0KSAqIHkobi0yKUwgKFEwKSApICkgaW4gUTE0Ci0gICAgICAgICAgICB5bkwrPShMVk1fSU5UMzIpcEJpcXVhZFN0YXRlLT5jb2Vmc1sxXSpwQmlxdWFkU3RhdGUtPnBEZWxheXNbM107Ci0KLSAgICAgICAgICAgIC8vIHluTCs9ICgoLUIxIChRMzApICogeShuLTEpTCAoUTApICkgKSBpbiBRMTQKLSAgICAgICAgICAgIHluTCs9KExWTV9JTlQzMilwQmlxdWFkU3RhdGUtPmNvZWZzWzJdKnBCaXF1YWRTdGF0ZS0+cERlbGF5c1syXTsKLQotICAgICAgICAgICAgeW5MPShMVk1fSU5UMTYpKHluTD4+MTQpOyAvLyB5bkwgaW4gUTAKLSAgICAgICAgICAgIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgotICAgICAgICAgICAgICAgICAgICAgICAgICAgIFVQREFUSU5HIFRIRSBERUxBWVMKLSAgICAgICAgICAgICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLSAgICAgICAgICAgIHBCaXF1YWRTdGF0ZS0+cERlbGF5c1szXT1wQmlxdWFkU3RhdGUtPnBEZWxheXNbMl07IC8vIHkobi0yKUw9eShuLTEpTAotICAgICAgICAgICAgcEJpcXVhZFN0YXRlLT5wRGVsYXlzWzFdPXBCaXF1YWRTdGF0ZS0+cERlbGF5c1swXTsgLy8geChuLTIpTD14KG4tMSlMCi0gICAgICAgICAgICBwQmlxdWFkU3RhdGUtPnBEZWxheXNbMl09eW5MOyAvLyBVcGRhdGUgeShuLTEpTCBpbiBRMAotICAgICAgICAgICAgcEJpcXVhZFN0YXRlLT5wRGVsYXlzWzBdPSgqcERhdGFJbisrKTsgLy8gVXBkYXRlIHgobi0xKUwgaW4gUTAKLQotICAgICAgICAgICAgLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgV1JJVElORyBUSEUgT1VUUFVUCi0gICAgICAgICAgICAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0gICAgICAgICAgICAqcERhdGFPdXQrKz0oTFZNX0lOVDE2KXluTDsgLy8gV3JpdGUgTGVmdCBvdXRwdXQgaW4gUTAKLQotICAgICAgICB9Ci0KLSAgICB9Ci0KZGlmZiAtLWdpdCBhL21lZGlhL2xpYmVmZmVjdHMvbHZtL2xpYi9Db21tb24vc3JjL0JQXzFJX0QxNkYxNkNzc19UUkNfV1JBXzAxX0luaXQuYyBiL21lZGlhL2xpYmVmZmVjdHMvbHZtL2xpYi9Db21tb24vc3JjL0JQXzFJX0QxNkYxNkNzc19UUkNfV1JBXzAxX0luaXQuYwpkZWxldGVkIGZpbGUgbW9kZSAxMDA2NDQKaW5kZXggODg5MTRhZC4uMDAwMDAwMAotLS0gYS9tZWRpYS9saWJlZmZlY3RzL2x2bS9saWIvQ29tbW9uL3NyYy9CUF8xSV9EMTZGMTZDc3NfVFJDX1dSQV8wMV9Jbml0LmMKKysrIC9kZXYvbnVsbApAQCAtMSw1NCArMCwwIEBACi0vKgotICogQ29weXJpZ2h0IChDKSAyMDA0LTIwMTAgTlhQIFNvZnR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0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0qLwotLyogRlVOQ1RJT046ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICAgQlBfMUlfRDE2RjE2Q3NzX1RSQ19XUkFfMDFfSW5pdCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogREVTQ1JJUFRJT046ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICAgVGhlc2UgZnVuY3Rpb25zIGluaXRpYWxpemVzIGEgQklRVUFEIGZpbHRlciBkZWZpbmVkIGFzIGEgY2FzY2FkZSBvZiAgICovCi0vKiAgIGJpcXVhZHJhdGljIEZpbHRlciBTZWN0aW9ucy4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qIFBBUkFNRVRFUlM6ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgIHBJbnN0YW5jZSAgICAtIG91dHB1dCwgcmV0dXJucyB0aGUgcG9pbnRlciB0byB0aGUgU3RhdGUgVmFyaWFibGUgICAgICAqLwotLyogICAgICAgICAgICAgICAgICAgVGhpcyBzdGF0ZSBwb2ludGVyIG11c3QgYmUgcGFzc2VkIHRvIGFueSBzdWJzZXF1ZW50ICAgKi8KLS8qICAgICAgICAgICAgICAgICAgIGNhbGwgdG8gIkJpcXVhZCIgZnVuY3Rpb25zLiAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgIHBUYXBzICAgICAgICAgLSBpbnB1dCwgcG9pbnRlciB0byB0aGUgdGFwcyBtZW1vcnkgICAgICAgICAgICAgICAgICAgICAqLwotLyogICBwQ29lZiAgICAgICAgIC0gaW5wdXQsIHBvaW50ZXIgdG8gdGhlIGNvZWZmaWNpZW50IHN0cnVjdHVyZSAgICAgICAgICAgKi8KLS8qICAgTiAgICAgICAgICAgICAtIE0gY29lZmZpY2llbnQgZmFjdG9yIG9mIFFNLk4gICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiBSRVRVUk5TOiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogICB2b2lkIHJldHVybiBjb2RlICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSovCi12b2lkIEJQXzFJX0QxNkYxNkNzc19UUkNfV1JBXzAxX0luaXQgKCAgIEJpcXVhZF9JbnN0YW5jZV90ICAgICAgICAgKnBJbnN0YW5jZSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgQmlxdWFkXzFJX09yZGVyMl9UYXBzX3QgICAqcFRhcHMsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEJQX0MxNl9Db2Vmc190ICAgICAgICAgICAgKnBDb2VmKQotewotICBQRmlsdGVyX1N0YXRlIHBCaXF1YWRTdGF0ZSA9IChQRmlsdGVyX1N0YXRlKSBwSW5zdGFuY2U7Ci0gIHBCaXF1YWRTdGF0ZS0+cERlbGF5cyAgICAgID0oTFZNX0lOVDMyICopIHBUYXBzOwotCi0gIHBCaXF1YWRTdGF0ZS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FEwIGZvcm1hdAotIHBCaXF1YWRTdGF0ZS0+cERlbGF5c1sxXSBpcyB4KG4tMilMIGluIFEwIGZvcm1hdAotIHBCaXF1YWRTdGF0ZS0+cERlbGF5c1syXSBpcyB5KG4tMSlMIGluIFExNiBmb3JtYXQKLSBwQmlxdWFkU3RhdGUtPnBEZWxheXNbM10gaXMgeShuLTIpTCBpbiBRMTYgZm9ybWF0Ci0qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0KLXZvaWQgQlBfMUlfRDE2RjMyQzMwX1RSQ19XUkFfMDEgKCBCaXF1YWRfSW5zdGFuY2VfdCAgICAgICAqcEluc3RhbmNlLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIExWTV9JTlQxNiAgICAgICAgICAgICAgICpwRGF0YUluLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIExWTV9JTlQxNiAgICAgICAgICAgICAgICpwRGF0YU91dCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBMVk1fSU5UMTYgICAgICAgICAgICAgICBOclNhbXBsZXMpCi0KLQotICAgIHsKLSAgICAgICAgTFZNX0lOVDMyIHluTCx0ZW1wbDsKLSAgICAgICAgTFZNX0lOVDE2IGlpOwotICAgICAgICBQRmlsdGVyX1N0YXRlIHBCaXF1YWRTdGF0ZSA9IChQRmlsdGVyX1N0YXRlKSBwSW5zdGFuY2U7Ci0KLSAgICAgICAgIGZvciAoaWkgPSBOclNhbXBsZXM7IGlpICE9IDA7IGlpLS0pCi0gICAgICAgICB7Ci0KLQotICAgICAgICAgICAgLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgUFJPQ0VTU0lORyBPRiBUSEUgTEVGVCBDSEFOTkVMCi0gICAgICAgICAgICAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0gICAgICAgICAgICAvLyB5bkw9IChBMCAoUTMwKSAqICh4KG4pTCAoUTApIC0geChuLTIpTCAoUTApICkgPj4xNCkgIGluIFExNgotICAgICAgICAgICAgdGVtcGw9IChMVk1fSU5UMzIpICpwRGF0YUluLXBCaXF1YWRTdGF0ZS0+cERlbGF5c1sxXTsKLSAgICAgICAgICAgIE1VTDMyeDMySU5UTzMyKHBCaXF1YWRTdGF0ZS0+Y29lZnNbMF0sdGVtcGwseW5MLDE0KQotCi0gICAgICAgICAgICAvLyB5bkwrPSAoKC1CMiAoUTMwKSAqIHkobi0yKUwgKFExNikgKSA+PjMwKSBpbiBRMTYKLSAgICAgICAgICAgIE1VTDMyeDMySU5UTzMyKHBCaXF1YWRTdGF0ZS0+Y29lZnNbMV0scEJpcXVhZFN0YXRlLT5wRGVsYXlzWzNdLHRlbXBsLDMwKQotICAgICAgICAgICAgeW5MKz10ZW1wbDsKLQotICAgICAgICAgICAgLy8geW5MKz0gKCgtQjEgKFEzMCkgKiB5KG4tMSlMIChRMTYpICkgPj4zMCkgaW4gUTE2Ci0gICAgICAgICAgICBNVUwzMngzMklOVE8zMihwQmlxdWFkU3RhdGUtPmNvZWZzWzJdLHBCaXF1YWRTdGF0ZS0+cERlbGF5c1syXSx0ZW1wbCwzMCkKLSAgICAgICAgICAgIHluTCs9dGVtcGw7Ci0KLSAgICAgICAgICAgIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgotICAgICAgICAgICAgICAgICAgICAgICAgICAgIFVQREFUSU5HIFRIRSBERUxBWVMKLSAgICAgICAgICAgICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLSAgICAgICAgICAgIHBCaXF1YWRTdGF0ZS0+cERlbGF5c1szXT1wQmlxdWFkU3RhdGUtPnBEZWxheXNbMl07IC8vIHkobi0yKUw9eShuLTEpTAotICAgICAgICAgICAgcEJpcXVhZFN0YXRlLT5wRGVsYXlzWzFdPXBCaXF1YWRTdGF0ZS0+cERlbGF5c1swXTsgLy8geChuLTIpTD14KG4tMSlMCi0gICAgICAgICAgICBwQmlxdWFkU3RhdGUtPnBEZWxheXNbMl09eW5MOyAvLyBVcGRhdGUgeShuLTEpTCBpbiBRMTYKLSAgICAgICAgICAgIHBCaXF1YWRTdGF0ZS0+cERlbGF5c1swXT0oKnBEYXRhSW4rKyk7IC8vIFVwZGF0ZSB4KG4tMSlMIGluIFEwCi0KLSAgICAgICAgICAgIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgotICAgICAgICAgICAgICAgICAgICAgICAgICAgIFdSSVRJTkcgVEhFIE9VVFBVVAotICAgICAgICAgICAgKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotICAgICAgICAgICAgKnBEYXRhT3V0Kys9KExWTV9JTlQxNikoeW5MPj4xNik7IC8vIFdyaXRlIExlZnQgb3V0cHV0IGluIFEwCi0KLSAgICAgICAgfQotCi0gICAgfQotCmRpZmYgLS1naXQgYS9tZWRpYS9saWJlZmZlY3RzL2x2bS9saWIvQ29tbW9uL3NyYy9CUF8xSV9EMTZGMzJDbGxfVFJDX1dSQV8wMV9Jbml0LmMgYi9tZWRpYS9saWJlZmZlY3RzL2x2bS9saWIvQ29tbW9uL3NyYy9CUF8xSV9EMTZGMzJDbGxfVFJDX1dSQV8wMV9Jbml0LmMKZGVsZXRlZCBmaWxlIG1vZGUgMTAwNjQ0CmluZGV4IGU4MzMyMTguLjAwMDAwMDAKLS0tIGEvbWVkaWEvbGliZWZmZWN0cy9sdm0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tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tKi8KLSNpbmNsdWRlICJCSVFVQUQuaCIKLSNpbmNsdWRlICJCUF8xSV9EMTZGMzJDbGxfVFJDX1dSQV8wMV9Qcml2YXRlLmgiCi0KLQotLyotLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tKi8KLS8qIEZVTkNUSU9OOiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgIEJQXzFJX0QxNkYzMkNsbF9UUkNfV1JBXzAxX0luaXQgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qIERFU0NSSVBUSU9OOiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgIFRoZXNlIGZ1bmN0aW9ucyBpbml0aWFsaXplcyBhIEJhbmQgcGFzcyBmaWx0ZXIgKEJJUVVBRCkgICAgICAgICAgICAgICAqLwotLyogICBiaXF1YWRyYXRpYyBGaWx0ZXIgU2VjdGlvbnMuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiBQQVJBTUVURVJTOiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogICBwSW5zdGFuY2UgICAgLSBvdXRwdXQsIHJldHVybnMgdGhlIHBvaW50ZXIgdG8gdGhlIFN0YXRlIFZhcmlhYmxlICAgICAgKi8KLS8qICAgICAgICAgICAgICAgICAgIFRoaXMgc3RhdGUgcG9pbnRlciBtdXN0IGJlIHBhc3NlZCB0byBhbnkgc3Vic2VxdWVudCAgICovCi0vKiAgICAgICAgICAgICAgICAgICBjYWxsIHRvICJCaXF1YWQiIGZ1bmN0aW9ucy4gICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogICBwVGFwcyAgICAgICAgIC0gaW5wdXQsIHBvaW50ZXIgdG8gdGhlIHRhcHMgbWVtb3J5ICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICAgcENvZWYgICAgICAgICAtIGlucHV0LCBwb2ludGVyIHRvIHRoZSBjb2VmZmljaWVudCBzdHJ1Y3R1cmUgICAgICAgICAgICovCi0vKiAgIE4gICAgICAgICAgICAgLSBNIGNvZWZmaWNpZW50IGZhY3RvciBvZiBRTS5OICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICAgICAgICBUaGUgY29lZmZpY2llbnRzIGFyZSBtb2RpZmllZCBpbiB0aGUgaW5pdCgpIGZ1bmN0aW9uIHN1Y2ggdGhhdCBsb3dlciAgICAgICAgICAgICAgICovCi0vKiAgICAgICAgaGFsZiB3b3JkIGlzIHJpZ2h0IHNoaWZ0ZWQgYnkgb25lIGFuZCBtb3N0IHNpZ25pZmljYW50IGJpdCBvZiB0aGUgbG93ZXIgICAgICAgICAgICAqLwotLyogICAgICAgIHdvcmQgaXMgbWFkZSB0byBiZSB6ZXJvLiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgICAgICBSZWFzb246IEZvciBNSVBTIGVmZmNpZW5jeSx3ZSBhcmUgdXNpbmcgRFNQIDMyKjE2IG11bHRpcGxpY2F0aW9uICAgICAgICAgICAgICAgICAgICAqLwotLyogICAgICAgaW5zdHJ1Y3Rpb24uIEJ1dCB3ZSBoYXZlIDMyKjMyIG11bHRpcGxpY2F0aW9uLiBUaGlzIGNhbiBiZSByZWFsaXplZCBieSB0d28gMzIqMTYgICAgKi8KLS8qICAgICAgIG11bHRpcGxpY2F0aW9uLiBCdXQgMTZ0aCBiaXQgaW4gdGhlIDMyIGJpdCB3b3JkIGlzIG5vdCBhIHNpZ24gYml0LiBTbyB0aGlzIGlzIGRvbmUgICovCi0vKiAgICAgICBieSBwdXR0aW5nIDE2dGggYml0IHRvIHplcm8gYW5kIGxvc3Npbmcgb25lIGJpdCBwcmVjaXNpb24gYnkgZGl2aXNpb24gb2YgbG93ZXIgICAgICAqLwotLyogICAgICAgaGFsZiB3b3JkIGJ5IDIuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qIFJFVFVSTlM6ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgIHZvaWQgcmV0dXJuIGNvZGUgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyotLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tKi8KLXZvaWQgQlBfMUlfRDE2RjMyQ2xsX1RSQ19XUkFfMDFfSW5pdCAoICAgQmlxdWFkX0luc3RhbmNlX3QgICAgICAgICAqcEluc3RhbmNlLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBCaXF1YWRfMUlfT3JkZXIyX1RhcHNfdCAgICpwVGFwcywKLSAgIC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FkU3RhdGUtPmNvZWZzWzBdIGlzIEEwLAotIHBCaXF1YWRTdGF0ZS0+Y29lZnNbMV0gaXMgLUIyLAotIHBCaXF1YWRTdGF0ZS0+Y29lZnNbMl0gaXMgLUIxLCB0aGVzZSBhcmUgaW4gUTMwIGZvcm1hdAotCi0gREVMQVlTLQotIHBCaXF1YWRTdGF0ZS0+cERlbGF5c1swXSBpcyB4KG4tMSlMIGluIFEwIGZvcm1hdAotIHBCaXF1YWRTdGF0ZS0+cERlbGF5c1sxXSBpcyB4KG4tMilMIGluIFEwIGZvcm1hdAotIHBCaXF1YWRTdGF0ZS0+cERlbGF5c1syXSBpcyB5KG4tMSlMIGluIFEwIGZvcm1hdAotIHBCaXF1YWRTdGF0ZS0+cERlbGF5c1szXSBpcyB5KG4tMilMIGluIFEwIGZvcm1hdAotKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotCi12b2lkIEJQXzFJX0QzMkYzMkMzMF9UUkNfV1JBXzAyICggQmlxdWFkX0luc3RhbmNlX3QgICAgICAgKnBJbnN0YW5jZSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBMVk1fSU5UMzIgICAgICAgICAgICAgICAqcERhdGFJbiwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBMVk1fSU5UMzIgICAgICAgICAgICAgICAqcERhdGFPdXQsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTFZNX0lOVDE2ICAgICAgICAgICAgICAgTnJTYW1wbGVzKQotICAgIHsKLSAgICAgICAgTFZNX0lOVDMyIHluTCx0ZW1wbDsKLSAgICAgICAgTFZNX0lOVDE2IGlpOwotICAgICAgICBQRmlsdGVyX1N0YXRlIHBCaXF1YWRTdGF0ZSA9IChQRmlsdGVyX1N0YXRlKSBwSW5zdGFuY2U7Ci0KLSAgICAgICAgZm9yIChpaSA9IE5yU2FtcGxlczsgaWkgIT0gMDsgaWktLSkKLSAgICAgICAgewotCi0KLSAgICAgICAgICAgIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgotICAgICAgICAgICAgICAgICAgICAgICAgICAgIFBST0NFU1NJTkcgT0YgVEhFIExFRlQgQ0hBTk5FTAotICAgICAgICAgICAgKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotICAgICAgICAgICAgLy8geW5MPSAoQTAgKFEzMCkgKiAoeChuKUwgKFEwKSAtIHgobi0yKUwgKFEwKSApID4+MzApICBpbiBRMAotICAgICAgICAgICAgdGVtcGw9KCpwRGF0YUluKS1wQmlxdWFkU3RhdGUtPnBEZWxheXNbMV07Ci0gICAgICAgICAgICBNVUwzMngzMklOVE8zMihwQmlxdWFkU3RhdGUtPmNvZWZzWzBdLHRlbXBsLHluTCwzMCkKLQotICAgICAgICAgICAgLy8geW5MKz0gKCgtQjIgKFEzMCkgKiB5KG4tMilMIChRMCkgKSA+PjMwKSBpbiBRMAotICAgICAgICAgICAgTVVMMzJ4MzJJTlRPMzIocEJpcXVhZFN0YXRlLT5jb2Vmc1sxXSxwQmlxdWFkU3RhdGUtPnBEZWxheXNbM10sdGVtcGwsMzApCi0gICAgICAgICAgICB5bkwrPXRlbXBsOwotCi0gICAgICAgICAgICAvLyB5bkwrPSAoKC1CMSAoUTMwKSAqIHkobi0xKUwgKFEwKSApID4+MzApIGluIFEwCi0gICAgICAgICAgICBNVUwzMngzMklOVE8zMihwQmlxdWFkU3RhdGUtPmNvZWZzWzJdLHBCaXF1YWRTdGF0ZS0+cERlbGF5c1syXSx0ZW1wbCwzMCkKLSAgICAgICAgICAgIHluTCs9dGVtcGw7Ci0KLSAgICAgICAgICAgIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgotICAgICAgICAgICAgICAgICAgICAgICAgICAgIFVQREFUSU5HIFRIRSBERUxBWVMKLSAgICAgICAgICAgICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLSAgICAgICAgICAgIHBCaXF1YWRTdGF0ZS0+cERlbGF5c1szXT1wQmlxdWFkU3RhdGUtPnBEZWxheXNbMl07IC8vIHkobi0yKUw9eShuLTEpTAotICAgICAgICAgICAgcEJpcXVhZFN0YXRlLT5wRGVsYXlzWzFdPXBCaXF1YWRTdGF0ZS0+cERlbGF5c1swXTsgLy8geChuLTIpTD14KG4tMSlMCi0gICAgICAgICAgICBwQmlxdWFkU3RhdGUtPnBEZWxheXNbMl09eW5MOyAvLyBVcGRhdGUgeShuLTEpTCBpbiBRMAotICAgICAgICAgICAgcEJpcXVhZFN0YXRlLT5wRGVsYXlzWzBdPSgqcERhdGFJbisrKTsgLy8gVXBkYXRlIHgobi0xKUwgaW4gUTAKLQotICAgICAgICAgICAgLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgV1JJVElORyBUSEUgT1VUUFVUCi0gICAgICAgICAgICAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0gICAgICAgICAgICAqcERhdGFPdXQrKz15bkw7IC8vIFdyaXRlIExlZnQgb3V0cHV0IGluIFEwCi0KLSAgICAgICAgfQotCi0gICAgfQotCmRpZmYgLS1naXQgYS9tZWRpYS9saWJlZmZlY3RzL2x2bS9saWIvQ29tbW9uL3NyYy9CUF8xSV9EMzJGMzJDbGxfVFJDX1dSQV8wMl9Jbml0LmMgYi9tZWRpYS9saWJlZmZlY3RzL2x2bS9saWIvQ29tbW9uL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Z2UgZ292ZXJuaW5nIHBlcm1pc3Npb25zIGFuZAotICogbGltaXRhdGlvbnMgdW5kZXIgdGhlIExpY2Vuc2UuCi0gKi8KLQotLyotLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tKi8KLSNpbmNsdWRlICJCSVFVQUQuaCIKLSNpbmNsdWRlICJCUF8xSV9EMzJGMzJDbGxfVFJDX1dSQV8wMl9Qcml2YXRlLmgiCi0KLS8qLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSovCi0vKiBGVU5DVElPTjogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogICBCUF8xSV9EMzJGMzJDbGxfVFJDX1dSQV8wMl9Jbml0ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiBERVNDUklQVElPTjogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogICBUaGVzZSBmdW5jdGlvbnMgaW5pdGlhbGl6ZXMgYSBCSVFVQUQgZmlsdGVyIGRlZmluZWQgYXMgYSBjYXNjYWRlIG9mICAgKi8KLS8qICAgYmlxdWFkcmF0aWMgRmlsdGVyIFNlY3Rpb25zLiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogUEFSQU1FVEVSUzogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICAgcEluc3RhbmNlICAgIC0gb3V0cHV0LCByZXR1cm5zIHRoZSBwb2ludGVyIHRvIHRoZSBTdGF0ZSBWYXJpYWJsZSAgICAgICovCi0vKiAgICAgICAgICAgICAgICAgICBUaGlzIHN0YXRlIHBvaW50ZXIgbXVzdCBiZSBwYXNzZWQgdG8gYW55IHN1YnNlcXVlbnQgICAqLwotLyogICAgICAgICAgICAgICAgICAgY2FsbCB0byAiQmlxdWFkIiBmdW5jdGlvbnMuICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICAgcFRhcHMgICAgICAgICAtIGlucHV0LCBwb2ludGVyIHRvIHRoZSB0YXBzIG1lbW9yeSAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgIHBDb2VmICAgICAgICAgLSBpbnB1dCwgcG9pbnRlciB0byB0aGUgY29lZmZpY2llbnQgc3RydWN0dXJlICAgICAgICAgICAqLwotLyogICBOICAgICAgICAgICAgIC0gTSBjb2VmZmljaWVudCBmYWN0b3Igb2YgUU0uTiAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qIFJFVFVSTlM6ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgIHZvaWQgcmV0dXJuIGNvZGUgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyotLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tKi8KLXZvaWQgQlBfMUlfRDMyRjMyQ2xsX1RSQ19XUkFfMDJfSW5pdCAoICAgQmlxdWFkX0luc3RhbmNlX3QgICAgICAgICAqcEluc3RhbmNlLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg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ioqKioqKioqKioqKioqKioqKioqKioqKgotIEFTU1VNUFRJT05TOgotIENPRUZTLQotIHBCaXF1YWRTdGF0ZS0+Y29lZnNbMF0gaXMgQTIsIHBCaXF1YWRTdGF0ZS0+Y29lZnNbMV0gaXMgQTEKLSBwQmlxdWFkU3RhdGUtPmNvZWZzWzJdIGlzIEEwLCBwQmlxdWFkU3RhdGUtPmNvZWZzWzNdIGlzIC1CMgotIHBCaXF1YWRTdGF0ZS0+Y29lZnNbNF0gaXMgLUIxLCB0aGVzZSBhcmUgaW4gUTE1IGZvcm1hdAotCi0gREVMQVlTLQotIHBCaXF1YWRTdGF0ZS0+cERlbGF5c1swXSBpcyB4KG4tMSlMIGluIFEwIGZvcm1hdAotIHBCaXF1YWRTdGF0ZS0+cERlbGF5c1sxXSBpcyB4KG4tMilMIGluIFEwIGZvcm1hdAotIHBCaXF1YWRTdGF0ZS0+cERlbGF5c1syXSBpcyB5KG4tMSlMIGluIFEwIGZvcm1hdAotIHBCaXF1YWRTdGF0ZS0+cERlbGF5c1szXSBpcyB5KG4tMilMIGluIFEwIGZvcm1hdAotKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotCi12b2lkIEJRXzFJX0QxNkYxNkMxNV9UUkNfV1JBXzAxICggQmlxdWFkX0luc3RhbmNlX3QgICAgICAgKnBJbnN0YW5jZSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBMVk1fSU5UMTYgICAgICAgICAgICAgICAqcERhdGFJbiwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBMVk1fSU5UMTYgICAgICAgICAgICAgICAqcERhdGFPdXQsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTFZNX0lOVDE2ICAgICAgICAgICAgICAgTnJTYW1wbGVzKQotICAgIHsKLSAgICAgICAgTFZNX0lOVDMyICB5bkw7Ci0gICAgICAgIExWTV9JTlQxNiBpaTsKLSAgICAgICAgUEZpbHRlcl9TdGF0ZSBwQmlxdWFkU3RhdGUgPSAoUEZpbHRlcl9TdGF0ZSkgcEluc3RhbmNlOwotCi0gICAgICAgICBmb3IgKGlpID0gTnJTYW1wbGVzOyBpaSAhPSAwOyBpaS0tKQotICAgICAgICAgewotCi0KLSAgICAgICAgICAgIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgotICAgICAgICAgICAgICAgICAgICAgICAgICAgIFBST0NFU1NJTkcgT0YgVEhFIExFRlQgQ0hBTk5FTAotICAgICAgICAgICAgKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotICAgICAgICAgICAgLy8geW5MPUEyIChRMTUpICogeChuLTIpTCAoUTApIGluIFExNQotICAgICAgICAgICAgeW5MPShMVk1fSU5UMzIpcEJpcXVhZFN0YXRlLT5jb2Vmc1swXSogcEJpcXVhZFN0YXRlLT5wRGVsYXlzWzFdOwotCi0gICAgICAgICAgICAvLyB5bkwrPUExIChRMTUpICogeChuLTEpTCAoUTApIGluIFExNQotICAgICAgICAgICAgeW5MKz0oTFZNX0lOVDMyKXBCaXF1YWRTdGF0ZS0+Y29lZnNbMV0qIHBCaXF1YWRTdGF0ZS0+cERlbGF5c1swXTsKLQotICAgICAgICAgICAgLy8geW5MKz1BMCAoUTE1KSAqIHgobilMIChRMCkgaW4gUTE1Ci0gICAgICAgICAgICB5bkwrPShMVk1fSU5UMzIpcEJpcXVhZFN0YXRlLT5jb2Vmc1syXSogKCpwRGF0YUluKTsKLQotICAgICAgICAgICAgLy8geW5MKz0gICgtQjIgKFExNSkgKiB5KG4tMilMIChRMCkgKSBpbiBRMTUKLSAgICAgICAgICAgIHluTCs9KExWTV9JTlQzMilwQmlxdWFkU3RhdGUtPmNvZWZzWzNdKnBCaXF1YWRTdGF0ZS0+cERlbGF5c1szXTsKLQotICAgICAgICAgICAgLy8geW5MKz0gKC1CMSAoUTE1KSAqIHkobi0xKUwgKFEwKSApIGluIFExNQotICAgICAgICAgICAgeW5MKz0oTFZNX0lOVDMyKXBCaXF1YWRTdGF0ZS0+Y29lZnNbNF0qcEJpcXVhZFN0YXRlLT5wRGVsYXlzWzJdOwotCi0gICAgICAgICAgICB5bkw9eW5MPj4xNTsgLy8geW5MIGluIFEwIGZvcm1hdAotICAgICAgICAgICAgLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgVVBEQVRJTkcgVEhFIERFTEFZUwotICAgICAgICAgICAgKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotICAgICAgICAgICAgcEJpcXVhZFN0YXRlLT5wRGVsYXlzWzNdPXBCaXF1YWRTdGF0ZS0+cERlbGF5c1syXTsgLy8geShuLTIpTD15KG4tMSlMCi0gICAgICAgICAgICBwQmlxdWFkU3RhdGUtPnBEZWxheXNbMV09cEJpcXVhZFN0YXRlLT5wRGVsYXlzWzBdOyAvLyB4KG4tMilMPXgobi0xKUwKLSAgICAgICAgICAgIHBCaXF1YWRTdGF0ZS0+cERlbGF5c1syXT15bkw7IC8vIFVwZGF0ZSB5KG4tMSlMIGluIFEwCi0gICAgICAgICAgICBwQmlxdWFkU3RhdGUtPnBEZWxheXNbMF09KCpwRGF0YUluKyspOyAvLyBVcGRhdGUgeChuLTEpTCBpbiBRMAotCi0gICAgICAgICAgICAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBXUklUSU5HIFRIRSBPVVRQVVQKLSAgICAgICAgICAgICoqKioqKioqK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AgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogICBUaGVzZSBmdW5jdGlvbnMgaW5pdGlhbGl6ZXMgYSBCSVFVQUQgZmlsdGVyIGRlZmluZWQgYXMgYSBjYXNjYWRlIG9mICAgKi8KLS8qICAgYmlxdWFkcmF0aWMgRmlsdGVyIFNlY3Rpb25zLiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogUEFSQU1FVEVSUzogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICAgcEluc3RhbmNlICAgIC0gb3V0cHV0LCByZXR1cm5zIHRoZSBwb2ludGVyIHRvIHRoZSBTdGF0ZSBWYXJpYWJsZSAgICAgICovCi0vKiAgICAgICAgICAgICAgICAgICBUaGlzIHN0YXRlIHBvaW50ZXIgbXVzdCBiZSBwYXNzZWQgdG8gYW55IHN1YnNlcXVlbnQgICAqLwotLyogICAgICAgICAgICAgICAgICAgY2FsbCB0byAiQmlxdWFkIiBmdW5jdGlvbnMuICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICAgcFRhcHMgICAgICAgICAtIGlucHV0LCBwb2ludGVyIHRvIHRoZSB0YXBzIG1lbW9yeSAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgIHBDb2VmICAgICAgICAgLSBpbnB1dCwgcG9pbnRlciB0byB0aGUgY29lZmZpY2llbnQgc3RydWN0dXJlICAgICAgICAgICAqLwotLyogICBOICAgICAgICAgICAgIC0gTSBjb2VmZmljaWVudCBmYWN0b3Igb2YgUU0uTiAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qIFJFVFVSTlM6ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA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YXQKLSBwQmlxdWFkU3RhdGUtPnBEZWxheXNbM10gaXMgeShuLTIpTCBpbiBRMTYgZm9ybWF0Ci0qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0KLXZvaWQgQlFfMUlfRDE2RjMyQzE0X1RSQ19XUkFfMDEgKCBCaXF1YWRfSW5zdGFuY2VfdCAgICAgICAqcEluc3RhbmNlLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIExWTV9JTlQxNiAgICAgICAgICAgICAgICpwRGF0YUluLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIExWTV9JTlQxNiAgICAgICAgICAgICAgICpwRGF0YU91dCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBMVk1fSU5UMTYgICAgICAgICAgICAgICBOclNhbXBsZXMpCi0gICAgewotICAgICAgICBMVk1fSU5UMzIgIHluTCx0ZW1wbDsKLSAgICAgICAgTFZNX0lOVDE2IGlpOwotICAgICAgICBQRmlsdGVyX1N0YXRlIHBCaXF1YWRTdGF0ZSA9IChQRmlsdGVyX1N0YXRlKSBwSW5zdGFuY2U7Ci0KLSAgICAgICAgIGZvciAoaWkgPSBOclNhbXBsZXM7IGlpICE9IDA7IGlpLS0pCi0gICAgICAgICB7Ci0KLQotICAgICAgICAgICAgLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgUFJPQ0VTU0lORyBPRiBUSEUgTEVGVCBDSEFOTkVMCi0gICAgICAgICAgICAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0gICAgICAgICAgICAvLyB5bkw9QTIgKFExNCkgKiB4KG4tMilMIChRMCkgaW4gUTE0Ci0gICAgICAgICAgICB5bkw9KExWTV9JTlQzMilwQmlxdWFkU3RhdGUtPmNvZWZzWzBdKiBwQmlxdWFkU3RhdGUtPnBEZWxheXNbMV07Ci0KLSAgICAgICAgICAgIC8vIHluTCs9QTEgKFExNCkgKiB4KG4tMSlMIChRMCkgaW4gUTE0Ci0gICAgICAgICAgICB5bkwrPShMVk1fSU5UMzIpcEJpcXVhZFN0YXRlLT5jb2Vmc1sxXSogcEJpcXVhZFN0YXRlLT5wRGVsYXlzWzBdOwotCi0gICAgICAgICAgICAvLyB5bkwrPUEwIChRMTQpICogeChuKUwgKFEwKSBpbiBRMTQKLSAgICAgICAgICAgIHluTCs9KExWTV9JTlQzMilwQmlxdWFkU3RhdGUtPmNvZWZzWzJdKiAoKnBEYXRhSW4pOwotCi0gICAgICAgICAgICAvLyB5bkwrPSAoICgtQjIgKFExNCkgKiB5KG4tMilMIChRMTYpICk+PjE2KSBpbiBRMTQKLSAgICAgICAgICAgIE1VTDMyeDE2SU5UTzMyKHBCaXF1YWRTdGF0ZS0+cERlbGF5c1szXSxwQmlxdWFkU3RhdGUtPmNvZWZzWzNdLHRlbXBsLDE2KQotICAgICAgICAgICAgeW5MKz10ZW1wbDsKLQotICAgICAgICAgICAgLy8geW5MKz0gKCAoLUIxIChRMTQpICogeShuLTEpTCAoUTE2KSApPj4xNikgaW4gUTE0Ci0gICAgICAgICAgICBNVUwzMngxNklOVE8zMihwQmlxdWFkU3RhdGUtPnBEZWxheXNbMl0scEJpcXVhZFN0YXRlLT5jb2Vmc1s0XSx0ZW1wbCwxNikKLSAgICAgICAgICAgIHluTCs9dGVtcGw7Ci0KLSAgICAgICAgICAgIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgotICAgICAgICAgICAgICAgICAgICAgICAgICAgIFVQREFUSU5HIFRIRSBERUxBWVMKLSAgICAgICAgICAgICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLSAgICAgICAgICAgIHBCaXF1YWRTdGF0ZS0+cERlbGF5c1szXT1wQmlxdWFkU3RhdGUtPnBEZWxheXNbMl07ICAvLyB5KG4tMilMPXkobi0xKUwKLSAgICAgICAgICAgIHBCaXF1YWRTdGF0ZS0+cERlbGF5c1sxXT1wQmlxdWFkU3RhdGUtPnBEZWxheXNbMF07ICAvLyB4KG4tMilMPXgobi0xKUwKLSAgICAgICAgICAgIHBCaXF1YWRTdGF0ZS0+cERlbGF5c1syXT15bkw8PDI7ICAgICAgICAgICAgICAgICAgICAvLyBVcGRhdGUgeShuLTEpTCBpbiBRMTYKLSAgICAgICAgICAgIHBCaXF1YWRTdGF0ZS0+cERlbGF5c1swXT0oKnBEYXRhSW4rKyk7ICAgICAgICAgICAgICAvLyBVcGRhdGUgeChuLTEpTCBpbiBRMAotCi0gICAgICAgICAgICAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBXUklUSU5HIFRIRSBPVVRQVVQKLSAgICAgICAgICAgICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLSAgICAgICAgICAgICpwRGF0YU91dCsrPShMVk1fSU5UMTYpKHluTD4+MTQpOyAvLyBXcml0ZSBMZWZ0IG91dHB1dCBpbiBRMAotCi0gICAgICAgIH0KLSAgICB9Ci0KZGlmZiAtLWdpdCBhL21lZGlhL2xpYmVmZmVjdHMvbHZtL2xpYi9Db21tb24vc3JjL0JRXzFJX0QxNkYzMkNzc19UUkNfV1JBXzAxX1ByaXZhdGUuaCBiL21lZGlhL2xpYmVmZmVjdHMvbHZtL2xpYi9Db21tb24vc3JjL0JRXzFJX0QxNkYzMkNzc19UUkNfV1JBXzAxX1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otLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tKi8KLSNpbmNsdWRlICJCSVFVQUQuaCIKLSNpbmNsdWRlICJCUV8xSV9EMTZGMzJDc3NfVFJDX1dSQV8wMV9Qcml2YXRlLmgiCi0KLQotLyotLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tKi8KLS8qIEZVTkNUSU9OOiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgIEJRXzFJX0QxNkYzMkNzc19UUkNfV1JBXzAxX0luaXQgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qIERFU0NSSVBUSU9OOiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgIFRoZXNlIGZ1bmN0aW9ucyBpbml0aWFsaXplcyBhIEJJUVVBRCBmaWx0ZXIgZGVmaW5lZCBhcyBhIGNhc2NhZGUgb2YgICAqLwotLyogICBiaXF1YWRyYXRpYyBGaWx0ZXIgU2VjdGlvbnMuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiBQQVJBTUVURVJTOiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogICBwSW5zdGFuY2UgICAgLSBvdXRwdXQsIHJldHVybnMgdGhlIHBvaW50ZXIgdG8gdGhlIFN0YXRlIFZhcmlhYmxlICAgICAgKi8KLS8qICAgICAgICAgICAgICAgICAgIFRoaXMgc3RhdGUgcG9pbnRlciBtdXN0IGJlIHBhc3NlZCB0byBhbnkgc3Vic2VxdWVudCAgICovCi0vKiAgICAgICAgICAgICAgICAgICBjYWxsIHRvICJCaXF1YWQiIGZ1bmN0aW9ucy4gICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogICBwVGFwcyAgICAgICAgIC0gaW5wdXQsIHBvaW50ZXIgdG8gdGhlIHRhcHMgbWVtb3J5ICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICAgcENvZWYgICAgICAgICAtIGlucHV0LCBwb2ludGVyIHRvIHRoZSBjb2VmZmljaWVudCBzdHJ1Y3R1cmUgICAgICAgICAgICovCi0vKiAgIE4gICAgICAgICAgICAgLSBNIGNvZWZmaWNpZW50IGZhY3RvciBvZiBRTS5OICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogUkVUVVJOUzogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICAgdm9pZCByZXR1cm4gY29kZSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKi0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0qLwotdm9pZCBCUV8xSV9EMTZGMzJDc3NfVFJDX1dSQV8wMV9Jbml0ICggICBCaXF1YWRfSW5zdGFuY2VfdCAgICAgICAgICpwSW5zdGFuY2UsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEJpcXVhZF8xSV9PcmRlcjJfVGFwc190ICAgKnBUYXBzLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg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0qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0KLXZvaWQgQlFfMklfRDE2RjE2QzE0X1RSQ19XUkFfMDEgKCBCaXF1YWRfSW5zdGFuY2VfdCAgICAgICAqcEluc3RhbmNlLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIExWTV9JTlQxNiAgICAgICAgICAgICAgICpwRGF0YUluLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIExWTV9JTlQxNiAgICAgICAgICAgICAgICpwRGF0YU91dCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBMVk1fSU5UMTYgICAgICAgICAgICAgICBOclNhbXBsZXMpCi0gICAgewotICAgICAgICBMVk1fSU5UMzIgIHluTCx5blI7Ci0gICAgICAgIExWTV9JTlQxNiBpaTsKLSAgICAgICAgUEZpbHRlcl9TdGF0ZSBwQmlxdWFkU3RhdGUgPSAoUEZpbHRlcl9TdGF0ZSkgcEluc3RhbmNlOwotCi0gICAgICAgICBmb3IgKGlpID0gTnJTYW1wbGVzOyBpaSAhPSAwOyBpaS0tKQotICAgICAgICAgewotCi0gICAgICAgICAgICAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBQUk9DRVNTSU5HIE9GIFRIRSBMRUZUIENIQU5ORUwKLSAgICAgICAgICAgICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLSAgICAgICAgICAgIC8vIHluTD1BMiAoUTE0KSAqIHgobi0yKUwgKFEwKSBpbiBRMTQKLSAgICAgICAgICAgIHluTD0oTFZNX0lOVDMyKXBCaXF1YWRTdGF0ZS0+Y29lZnNbMF0qIHBCaXF1YWRTdGF0ZS0+cERlbGF5c1syXTsKLQotICAgICAgICAgICAgLy8geW5MKz1BMSAoUTE0KSAqIHgobi0xKUwgKFEwKSBpbiBRMTQKLSAgICAgICAgICAgIHluTCs9KExWTV9JTlQzMilwQmlxdWFkU3RhdGUtPmNvZWZzWzFdKiBwQmlxdWFkU3RhdGUtPnBEZWxheXNbMF07Ci0KLSAgICAgICAgICAgIC8vIHluTCs9QTAgKFExNCkgKiB4KG4pTCAoUTApIGluIFExNAotICAgICAgICAgICAgeW5MKz0oTFZNX0lOVDMyKXBCaXF1YWRTdGF0ZS0+Y29lZnNbMl0qICgqcERhdGFJbik7Ci0KLSAgICAgICAgICAgIC8vIHluTCs9ICggLUIyIChRMTQpICogeShuLTIpTCAoUTApICkgaW4gUTE0Ci0gICAgICAgICAgICB5bkwrPShMVk1fSU5UMzIpcEJpcXVhZFN0YXRlLT5jb2Vmc1szXSpwQmlxdWFkU3RhdGUtPnBEZWxheXNbNl07Ci0KLSAgICAgICAgICAgIC8vIHluTCs9KCAtQjEgKFExNCkgKiB5KG4tMSlMIChRMCkgKSBpbiBRMTQKLSAgICAgICAgICAgIHluTCs9KExWTV9JTlQzMilwQmlxdWFkU3RhdGUtPmNvZWZzWzRdKnBCaXF1YWRTdGF0ZS0+cERlbGF5c1s0XTsKLQotICAgICAgICAgICAgeW5MPXluTD4+MTQ7IC8vIHluTCBpbiBRMCBmb3JtYXQKLQotICAgICAgICAgICAgLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgUFJPQ0VTU0lORyBPRiBUSEUgUklHSFQgQ0hBTk5FTAotICAgICAgICAgICAgKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotICAgICAgICAgICAgLy8geW5SPUEyIChRMTQpICogeChuLTIpUiAoUTApIGluIFExNAotICAgICAgICAgICAgeW5SPShMVk1fSU5UMzIpcEJpcXVhZFN0YXRlLT5jb2Vmc1swXSpwQmlxdWFkU3RhdGUtPnBEZWxheXNbM107Ci0KLSAgICAgICAgICAgIC8vIHluUis9QTEgKFExNCkgKiB4KG4tMSlSIChRMCkgaW4gUTE0Ci0gICAgICAgICAgICB5blIrPShMVk1fSU5UMzIpcEJpcXVhZFN0YXRlLT5jb2Vmc1sxXSpwQmlxdWFkU3RhdGUtPnBEZWxheXNbMV07Ci0KLSAgICAgICAgICAgIC8vIHluUis9QTAgKFExNCkgKiB4KG4pUiAoUTApIGluIFExNAotICAgICAgICAgICAgeW5SKz0oTFZNX0lOVDMyKXBCaXF1YWRTdGF0ZS0+Y29lZnNbMl0qKCoocERhdGFJbisxKSk7Ci0KLSAgICAgICAgICAgIC8vIHluUis9ICggLUIyIChRMTQpICogeShuLTIpUiAoUTApICkgaW4gUTE0Ci0gICAgICAgICAgICB5blIrPShMVk1fSU5UMzIpcEJpcXVhZFN0YXRlLT5jb2Vmc1szXSpwQmlxdWFkU3RhdGUtPnBEZWxheXNbN107Ci0KLSAgICAgICAgICAgIC8vIHluUis9KCAtQjEgKFExNCkgKiB5KG4tMSlSIChRMCkgKSBpbiBRMTQKLSAgICAgICAgICAgIHluUis9KExWTV9JTlQzMilwQmlxdWFkU3RhdGUtPmNvZWZzWzRdKnBCaXF1YWRTdGF0ZS0+cERlbGF5c1s1XTsKLQotICAgICAgICAgICAgeW5SPXluUj4+MTQ7IC8vIHluTCBpbiBRMCBmb3JtYXQKLSAgICAgICAgICAgIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgotICAgICAgICAgICAgICAgICAgICAgICAgICAgIFVQREFUSU5HIFRIRSBERUxBWVMKLSAgICAgICAgICAgICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLSAgICAgICAgICAgIHBCaXF1YWRTdGF0ZS0+cERlbGF5c1s3XT1wQmlxdWFkU3RhdGUtPnBEZWxheXNbNV07ICAvLyB5KG4tMilSPXkobi0xKVIKLSAgICAgICAgICAgIHBCaXF1YWRTdGF0ZS0+cERlbGF5c1s2XT1wQmlxdWFkU3RhdGUtPnBEZWxheXNbNF07ICAvLyB5KG4tMilMPXkobi0xKUwKLSAgICAgICAgICAgIHBCaXF1YWRTdGF0ZS0+cERlbGF5c1szXT1wQmlxdWFkU3RhdGUtPnBEZWxheXNbMV07ICAvLyB4KG4tMilSPXgobi0xKVIKLSAgICAgICAgICAgIHBCaXF1YWRTdGF0ZS0+cERlbGF5c1syXT1wQmlxdWFkU3RhdGUtPnBEZWxheXNbMF07ICAvLyB4KG4tMilMPXgobi0xKUwKLSAgICAgICAgICAgIHBCaXF1YWRTdGF0ZS0+cERlbGF5c1s1XT15blI7ICAgICAgICAgICAgICAgICAgICAgICAvLyBVcGRhdGUgeShuLTEpUiBpbiBRMAotICAgICAgICAgICAgcEJpcXVhZFN0YXRlLT5wRGVsYXlzWzRdPXluTDsgICAgICAgICAgICAgICAgICAgICAgIC8vIFVwZGF0ZSB5KG4tMSlMIGluIFEwCi0gICAgICAgICAgICBwQmlxdWFkU3RhdGUtPnBEZWxheXNbMF09KCpwRGF0YUluKyspOyAgICAgICAgICAgICAgLy8gVXBkYXRlIHgobi0xKUwgaW4gUTAKLSAgICAgICAgICAgIHBCaXF1YWRTdGF0ZS0+cERlbGF5c1sxXT0oKnBEYXRhSW4rKyk7ICAgICAgICAgICAgICAvLyBVcGRhdGUgeChuLTEpUiBpbiBRMAotCi0gICAgICAgICAgICAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBXUklUSU5HIFRIRSBPVVRQVVQKLSAgICAgICAgICAgICoqKioqKioqKioq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l9TdGF0ZSkgcEluc3RhbmNlOwotCi0gICAgICAgICBmb3IgKGlpID0gTnJTYW1wbGVzOyBpaSAhPSAwOyBpaS0tKQotICAgICAgICAgewotCi0KLSAgICAgICAgICAgIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgotICAgICAgICAgICAgICAgICAgICAgICAgICAgIFBST0NFU1NJTkcgT0YgVEhFIExFRlQgQ0hBTk5FTAotICAgICAgICAgICAgKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotICAgICAgICAgICAgLy8geW5MPUEyIChRMTUpICogeChuLTIpTCAoUTApIGluIFExNQotICAgICAgICAgICAgeW5MPShMVk1fSU5UMzIpcEJpcXVhZFN0YXRlLT5jb2Vmc1swXSogcEJpcXVhZFN0YXRlLT5wRGVsYXlzWzJdOwotCi0gICAgICAgICAgICAvLyB5bkwrPUExIChRMTUpICogeChuLTEpTCAoUTApIGluIFExNQotICAgICAgICAgICAgeW5MKz0oTFZNX0lOVDMyKXBCaXF1YWRTdGF0ZS0+Y29lZnNbMV0qIHBCaXF1YWRTdGF0ZS0+cERlbGF5c1swXTsKLQotICAgICAgICAgICAgLy8geW5MKz1BMCAoUTE1KSAqIHgobilMIChRMCkgaW4gUTE1Ci0gICAgICAgICAgICB5bkwrPShMVk1fSU5UMzIpcEJpcXVhZFN0YXRlLT5jb2Vmc1syXSogKCpwRGF0YUluKTsKLQotICAgICAgICAgICAgLy8geW5MKz0gKCAtQjIgKFExNSkgKiB5KG4tMilMIChRMCkgKSBpbiBRMTUKLSAgICAgICAgICAgIHluTCs9KExWTV9JTlQzMilwQmlxdWFkU3RhdGUtPmNvZWZzWzNdKnBCaXF1YWRTdGF0ZS0+cERlbGF5c1s2XTsKLQotICAgICAgICAgICAgLy8geW5MKz0oIC1CMSAoUTE1KSAqIHkobi0xKUwgKFEwKSApIGluIFExNQotICAgICAgICAgICAgeW5MKz0oTFZNX0lOVDMyKXBCaXF1YWRTdGF0ZS0+Y29lZnNbNF0qcEJpcXVhZFN0YXRlLT5wRGVsYXlzWzRdOwotCi0gICAgICAgICAgICB5bkw9eW5MPj4xNTsgLy8geW5MIGluIFEwIGZvcm1hdAotCi0gICAgICAgICAgICAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBQUk9DRVNTSU5HIE9GIFRIRSBSSUdIVCBDSEFOTkVMCi0gICAgICAgICAgICAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0gICAgICAgICAgICAvLyB5blI9QTIgKFExNSkgKiB4KG4tMilSIChRMCkgaW4gUTE1Ci0gICAgICAgICAgICB5blI9KExWTV9JTlQzMilwQmlxdWFkU3RhdGUtPmNvZWZzWzBdKnBCaXF1YWRTdGF0ZS0+cERlbGF5c1szXTsKLQotICAgICAgICAgICAgLy8geW5SKz1BMSAoUTE1KSAqIHgobi0xKVIgKFEwKSBpbiBRMTUKLSAgICAgICAgICAgIHluUis9KExWTV9JTlQzMilwQmlxdWFkU3RhdGUtPmNvZWZzWzFdKnBCaXF1YWRTdGF0ZS0+cERlbGF5c1sxXTsKLQotICAgICAgICAgICAgLy8geW5SKz1BMCAoUTE1KSAqIHgobilSIChRMCkgaW4gUTE1Ci0gICAgICAgICAgICB5blIrPShMVk1fSU5UMzIpcEJpcXVhZFN0YXRlLT5jb2Vmc1syXSooKihwRGF0YUluKzEpKTsKLQotICAgICAgICAgICAgLy8geW5SKz0gKCAtQjIgKFExNSkgKiB5KG4tMilSIChRMCkgKSBpbiBRMTUKLSAgICAgICAgICAgIHluUis9KExWTV9JTlQzMilwQmlxdWFkU3RhdGUtPmNvZWZzWzNdKnBCaXF1YWRTdGF0ZS0+cERlbGF5c1s3XTsKLQotICAgICAgICAgICAgLy8geW5SKz0oIC1CMSAoUTE1KSAqIHkobi0xKVIgKFEwKSApIGluIFExNQotICAgICAgICAgICAgeW5SKz0oTFZNX0lOVDMyKXBCaXF1YWRTdGF0ZS0+Y29lZnNbNF0qcEJpcXVhZFN0YXRlLT5wRGVsYXlzWzVdOwotCi0gICAgICAgICAgICB5blI9eW5SPj4xNTsgLy8geW5MIGluIFEwIGZvcm1hdAotICAgICAgICAgICAgLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgVVBEQVRJTkcgVEhFIERFTEFZUwotICAgICAgICAgICAgKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotICAgICAgICAgICAgcEJpcXVhZFN0YXRlLT5wRGVsYXlzWzddPXBCaXF1YWRTdGF0ZS0+cERlbGF5c1s1XTsgIC8vIHkobi0yKVI9eShuLTEpUgotICAgICAgICAgICAgcEJpcXVhZFN0YXRlLT5wRGVsYXlzWzZdPXBCaXF1YWRTdGF0ZS0+cERlbGF5c1s0XTsgIC8vIHkobi0yKUw9eShuLTEpTAotICAgICAgICAgICAgcEJpcXVhZFN0YXRlLT5wRGVsYXlzWzNdPXBCaXF1YWRTdGF0ZS0+cERlbGF5c1sxXTsgIC8vIHgobi0yKVI9eChuLTEpUgotICAgICAgICAgICAgcEJpcXVhZFN0YXRlLT5wRGVsYXlzWzJdPXBCaXF1YWRTdGF0ZS0+cERlbGF5c1swXTsgIC8vIHgobi0yKUw9eChuLTEpTAotICAgICAgICAgICAgcEJpcXVhZFN0YXRlLT5wRGVsYXlzWzVdPXluUjsgICAgICAgICAgICAgICAgICAgICAgIC8vIFVwZGF0ZSB5KG4tMSlSIGluIFEwCi0gICAgICAgICAgICBwQmlxdWFkU3RhdGUtPnBEZWxheXNbNF09eW5MOyAgICAgICAgICAgICAgICAgICAgICAgLy8gVXBkYXRlIHkobi0xKUwgaW4gUTAKLSAgICAgICAgICAgIHBCaXF1YWRTdGF0ZS0+cERlbGF5c1swXT0oKnBEYXRhSW4rKyk7ICAgICAgICAgICAgICAvLyBVcGRhdGUgeChuLTEpTCBpbiBRMAotICAgICAgICAgICAgcEJpcXVhZFN0YXRlLT5wRGVsYXlzWzFdPSgqcERhdGFJbisrKTsgICAgICAgICAgICAgIC8vIFVwZGF0ZSB4KG4tMSlSIGluIFEwCi0KLSAgICAgICAgICAgIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgotICAgICAgICAgICAgICAgICAgICAgICAgICAgIFdSSVRJTkcgVEhFIE9VVFBVVAotICAgICAgICAgICAgKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotICAgICAgICAgICAgKnBEYXRhT3V0Kys9KExWTV9JTlQxNil5bkw7IC8vIFdyaXRlIExlZnQgb3V0cHV0IGluIFEwCi0gICAgICAgICAgICAqcERhdGFPdXQrKz0oTFZNX0lOVDE2KXluUjsgLy8gV3JpdGUgUmlnaHQgb3VwdXQgaW4gUTAKLQotICAgICAgICB9Ci0KLSAgICB9Ci0KZGlmZiAtLWdpdCBhL21lZGlhL2xpYmVmZmVjdHMvbHZtL2xpYi9Db21tb24vc3JjL0JRXzJJX0QxNkYxNkNzc19UUkNfV1JBXzAxX0luaXQuYyBiL21lZGlhL2xpYmVmZmVjdHMvbHZtL2xpYi9Db21tb24vc3JjL0JRXzJJX0QxNkYxNkNzc19UUkNfV1JBXzAxX0luaXQuYwpkZWxldGVkIGZpbGUgbW9kZSAxMDA2NDQKaW5kZXggMGE4YWMzNS4uMDAwMDAwMAotLS0gYS9tZWRpYS9saW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0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0qLwotI2luY2x1ZGUgIkJJUVVBRC5oIgotI2luY2x1ZGUgIkJRXzJJX0QxNkYxNkNzc19UUkNfV1JBXzAxX1ByaXZhdGUuaCIKLQotCi0vKi0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0qLwotLyogRlVOQ1RJT046ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICAgQlFfMklfRDE2RjE2Q3NzX1RSQ19XUkFfMDFfSW5pdCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogREVTQ1JJUFRJT046ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICAgVGhlc2UgZnVuY3Rpb25zIGluaXRpYWxpemVzIGEgQklRVUFEIGZpbHRlciBkZWZpbmVkIGFzIGEgY2FzY2FkZSBvZiAgICovCi0vKiAgIGJpcXVhZHJhdGljIEZpbHRlciBTZWN0aW9ucy4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qIFBBUkFNRVRFUlM6ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgIHBJbnN0YW5jZSAgICAtIG91dHB1dCwgcmV0dXJucyB0aGUgcG9pbnRlciB0byB0aGUgU3RhdGUgVmFyaWFibGUgICAgICAqLwotLyogICAgICAgICAgICAgICAgICAgVGhpcyBzdGF0ZSBwb2ludGVyIG11c3QgYmUgcGFzc2VkIHRvIGFueSBzdWJzZXF1ZW50ICAgKi8KLS8qICAgICAgICAgICAgICAgICAgIGNhbGwgdG8gIkJpcXVhZCIgZnVuY3Rpb25zLiAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgIHBUYXBzICAgICAgICAgLSBpbnB1dCwgcG9pbnRlciB0byB0aGUgdGFwcyBtZW1vcnkgICAgICAgICAgICAgICAgICAgICAqLwotLyogICBwQ29lZiAgICAgICAgIC0gaW5wdXQsIHBvaW50ZXIgdG8gdGhlIGNvZWZmaWNpZW50IHN0cnVjdHVyZSAgICAgICAgICAgKi8KLS8qICAgTiAgICAgICAgICAgICAtIE0gY29lZmZpY2llbnQgZmFjdG9yIG9mIFFNLk4gICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiBSRVRVUk5TOiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogICB2b2lkIHJldHVybiBjb2RlICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSovCi12b2lkIEJRXzJJX0QxNkYxNkNzc19UUkNfV1JBXzAxX0luaXQgKCAgIEJpcXVhZF9JbnN0YW5jZV90ICAgICAgICAgKnBJbnN0YW5jZSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgQmlxdWFkXzJJX09yZGVyMl9UYXBzX3QgICAqcFRhcHMsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEJRX0MxNl9Db2Vmc190ICAgICAgICAgICAgKnBDb2VmKQotew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0QxNkYzMkMxM19UUkNfV1JBXzAxICggICAgICAgICAgIEJpcXVhZF9JbnN0YW5jZV90ICAgICAgICpwSW5zdGFuY2UsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIExWTV9JTlQxNiAgICAgICAgICAgICAgICAgICAgKnBEYXRhSW4sCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIExWTV9JTlQxNiAgICAgICAgICAgICAgICAgICAgKnBEYXRhT3V0LAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBMVk1fSU5UMTYgICAgICAgICAgICAgICAgICAgIE5yU2FtcGxlcykKLSAgICB7Ci0gICAgICAgIExWTV9JTlQzMiAgeW5MLHluUix0ZW1wbDsKLSAgICAgICAgTFZNX0lOVDE2IGlpOwotICAgICAgICBQRmlsdGVyX1N0YXRlIHBCaXF1YWRTdGF0ZSA9IChQRmlsdGVyX1N0YXRlKSBwSW5zdGFuY2U7Ci0KLSAgICAgICAgIGZvciAoaWkgPSBOclNhbXBsZXM7IGlpICE9IDA7IGlpLS0pCi0gICAgICAgICB7Ci0KLQotICAgICAgICAgICAgLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgUFJPQ0VTU0lORyBPRiBUSEUgTEVGVCBDSEFOTkVMCi0gICAgICAgICAgICAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0gICAgICAgICAgICAvKiB5bkw9QTIgKFExMykgKiB4KG4tMilMIChRMCkgaW4gUTEzKi8KLSAgICAgICAgICAgIHluTD0oTFZNX0lOVDMyKXBCaXF1YWRTdGF0ZS0+Y29lZnNbMF0qIHBCaXF1YWRTdGF0ZS0+cERlbGF5c1syXTsKLQotICAgICAgICAgICAgLyogeW5MKz1BMSAoUTEzKSAqIHgobi0xKUwgKFEwKSBpbiBRMTMqLwotICAgICAgICAgICAgeW5MKz0oTFZNX0lOVDMyKXBCaXF1YWRTdGF0ZS0+Y29lZnNbMV0qIHBCaXF1YWRTdGF0ZS0+cERlbGF5c1swXTsKLQotICAgICAgICAgICAgLyogeW5MKz1BMCAoUTEzKSAqIHgobilMIChRMCkgaW4gUTEzKi8KLSAgICAgICAgICAgIHluTCs9KExWTV9JTlQzMilwQmlxdWFkU3RhdGUtPmNvZWZzWzJdKiAoKnBEYXRhSW4pOwotCi0gICAgICAgICAgICAvKiB5bkwrPSAoICgtQjIgKFExMykgKiB5KG4tMilMIChRMTYpICk+PjE2KSBpbiBRMTMgKi8KLSAgICAgICAgICAgIE1VTDMyeDE2SU5UTzMyKHBCaXF1YWRTdGF0ZS0+cERlbGF5c1s2XSxwQmlxdWFkU3RhdGUtPmNvZWZzWzNdLHRlbXBsLDE2KQotICAgICAgICAgICAgeW5MKz10ZW1wbDsKLQotICAgICAgICAgICAgLyogeW5MKz0oICgtQjEgKFExMykgKiB5KG4tMSlMIChRMTYpICk+PjE2KSBpbiBRMTMgKi8KLSAgICAgICAgICAgIE1VTDMyeDE2SU5UTzMyKHBCaXF1YWRTdGF0ZS0+cERlbGF5c1s0XSxwQmlxdWFkU3RhdGUtPmNvZWZzWzRdLHRlbXBsLDE2KQotICAgICAgICAgICAgeW5MKz10ZW1wbDsKLQotICAgICAgICAgICAgLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgUFJPQ0VTU0lORyBPRiBUSEUgUklHSFQgQ0hBTk5FTAotICAgICAgICAgICAgKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotICAgICAgICAgICAgLyogeW5SPUEyIChRMTMpICogeChuLTIpUiAoUTApIGluIFExMyovCi0gICAgICAgICAgICB5blI9KExWTV9JTlQzMilwQmlxdWFkU3RhdGUtPmNvZWZzWzBdKnBCaXF1YWRTdGF0ZS0+cERlbGF5c1szXTsKLQotICAgICAgICAgICAgLyogeW5SKz1BMSAoUTEzKSAqIHgobi0xKVIgKFEwKSBpbiBRMTMqLwotICAgICAgICAgICAgeW5SKz0oTFZNX0lOVDMyKXBCaXF1YWRTdGF0ZS0+Y29lZnNbMV0qcEJpcXVhZFN0YXRlLT5wRGVsYXlzWzFdOwotCi0gICAgICAgICAgICAvKiB5blIrPUEwIChRMTMpICogeChuKVIgKFEwKSBpbiBRMTMqLwotICAgICAgICAgICAgeW5SKz0oTFZNX0lOVDMyKXBCaXF1YWRTdGF0ZS0+Y29lZnNbMl0qKCoocERhdGFJbisxKSk7Ci0KLSAgICAgICAgICAgIC8qIHluUis9ICggKC1CMiAoUTEzKSAqIHkobi0yKVIgKFExNikgKT4+MTYpIGluIFExMyovCi0gICAgICAgICAgICBNVUwzMngxNklOVE8zMihwQmlxdWFkU3RhdGUtPnBEZWxheXNbN10scEJpcXVhZFN0YXRlLT5jb2Vmc1szXSx0ZW1wbCwxNikKLSAgICAgICAgICAgIHluUis9dGVtcGw7Ci0KLSAgICAgICAgICAgIC8qIHluUis9KCAoLUIxIChRMTMpICogeShuLTEpUiAoUTE2KSApPj4xNikgaW4gUTEzICovCi0gICAgICAgICAgICBNVUwzMngxNklOVE8zMihwQmlxdWFkU3RhdGUtPnBEZWxheXNbNV0scEJpcXVhZFN0YXRlLT5jb2Vmc1s0XSx0ZW1wbCwxNikKLSAgICAgICAgICAgIHluUis9dGVtcGw7Ci0KLSAgICAgICAgICAgIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgotICAgICAgICAgICAgICAgICAgICAgICAgICAgIFVQREFUSU5HIFRIRSBERUxBWVMKLSAgICAgICAgICAgICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLSAgICAgICAgICAgIHBCaXF1YWRTdGF0ZS0+cERlbGF5c1s3XT1wQmlxdWFkU3RhdGUtPnBEZWxheXNbNV07ICAvKiB5KG4tMilSPXkobi0xKVIqLwotICAgICAgICAgICAgcEJpcXVhZFN0YXRlLT5wRGVsYXlzWzZdPXBCaXF1YWRTdGF0ZS0+cERlbGF5c1s0XTsgIC8qIHkobi0yKUw9eShuLTEpTCovCi0gICAgICAgICAgICBwQmlxdWFkU3RhdGUtPnBEZWxheXNbM109cEJpcXVhZFN0YXRlLT5wRGVsYXlzWzFdOyAgLyogeChuLTIpUj14KG4tMSlSKi8KLSAgICAgICAgICAgIHBCaXF1YWRTdGF0ZS0+cERlbGF5c1syXT1wQmlxdWFkU3RhdGUtPnBEZWxheXNbMF07ICAvKiB4KG4tMilMPXgobi0xKUwqLwotICAgICAgICAgICAgcEJpcXVhZFN0YXRlLT5wRGVsYXlzWzVdPXluUjw8MzsgICAgICAgICAgICAgICAgICAgIC8qIFVwZGF0ZSB5KG4tMSlSIGluIFExNiovCi0gICAgICAgICAgICBwQmlxdWFkU3RhdGUtPnBEZWxheXNbNF09eW5MPDwzOyAgICAgICAgICAgICAgICAgICAgLyogVXBkYXRlIHkobi0xKUwgaW4gUTE2Ki8KLSAgICAgICAgICAgIHBCaXF1YWRTdGF0ZS0+cERlbGF5c1swXT0oKnBEYXRhSW4pOyAgICAgICAgICAgICAgICAvKiBVcGRhdGUgeChuLTEpTCBpbiBRMCovCi0gICAgICAgICAgICBwRGF0YUluKys7Ci0gICAgICAgICAgICBwQmlxdWFkU3RhdGUtPnBEZWxheXNbMV09KCpwRGF0YUluKTsgICAgICAgICAgICAgICAgLyogVXBkYXRlIHgobi0xKVIgaW4gUTAqLwotICAgICAgICAgICAgcERhdGFJbisrOwotCi0gICAgICAgICAgICAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBXUklUSU5HIFRIRSBPVVRQVVQKLSAgICAgICAgICAgICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLSAgICAgICAgICAgICpwRGF0YU91dD0oTFZNX0lOVDE2KSh5bkw+PjEzKTsgLyogV3JpdGUgTGVmdCBvdXRwdXQgaW4gUTAqLwotICAgICAgICAgICAgcERhdGFPdXQrKzsKLSAgICAgICAgICAgICpwRGF0YU91dD0oTFZNX0lOVDE2KSh5blI+PjEzKTsgLyogV3JpdGUgUmlnaHQgb3VwdXQgaW4gUTAqLwotICAgICAgICAgICAgcERhdGFPdXQrKzsKLSAgICAgICAgfQotCi0gICAgfQotCmRpZmYgLS1naXQgYS9tZWRpYS9saWJlZmZlY3RzL2x2bS9saWIvQ29tbW9uL3NyYy9CUV8ySV9EMTZGMzJDMTRfVFJDX1dSQV8wMS5jIGIvbWVkaWEvbGliZWZmZWN0cy9sdm0vbGliL0NvbW1vbi9zcmMvQlFfMklfRDE2RjMyQzE0X1RSQ19XUkFfMDEuYwpkZWxldGVkIGZpbGUgbW9kZSAxMDA2NDQKaW5kZXggMDUyZTJhMC4uMDAwMDAwMAotLS0gYS9tZWRpYS9saWJlZmZlY3RzL2x2bS9saWIvQ29tbW9uL3NyYy9CUV8ySV9EMTZGMzJDMTRfVFJDX1dSQV8wMS5jCisrKyAvZGV2L251bGwKQEAgLTEsMTE3ICswLDAgQEAKLS8qCi0gKiBDb3B5cmlnaHQgKEMpIDIwMDQtMjAxMCBOWFAgU29mdHdhcmUKLSAqIENvcHlyaWdodCAoQykgMjAxMCBUaGUgQW5kcm9pZCBPcGVuIFNvdXJjZSBQcm9qZWN0Ci0gKgotICogTGljZW5zZWQgdW5kZXIgdGhlIEFwYWN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NX0lOVDE2ICAgICAgICAgICAgICAgICAgICAqcERhdGFPdXQsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIExWTV9JTlQxNiAgICAgICAgICAgICAgICAgICAgTnJTYW1wbGVzKQotICAgIHsKLSAgICAgICAgTFZNX0lOVDMyICB5bkwseW5SLHRlbXBsOwotICAgICAgICBMVk1fSU5UMTYgaWk7Ci0gICAgICAgIFBGaWx0ZXJfU3RhdGUgcEJpcXVhZFN0YXRlID0gKFBGaWx0ZXJfU3RhdGUpIHBJbnN0YW5jZTsKLQotICAgICAgICBmb3IgKGlpID0gTnJTYW1wbGVzOyBpaSAhPSAwOyBpaS0tKQotICAgICAgICB7Ci0KLQotICAgICAgICAgICAgLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgUFJPQ0VTU0lORyBPRiBUSEUgTEVGVCBDSEFOTkVMCi0gICAgICAgICAgICAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0gICAgICAgICAgICAvKiB5bkw9QTIgKFExNCkgKiB4KG4tMilMIChRMCkgaW4gUTE0Ki8KLSAgICAgICAgICAgIHluTD0oTFZNX0lOVDMyKXBCaXF1YWRTdGF0ZS0+Y29lZnNbMF0qIHBCaXF1YWRTdGF0ZS0+cERlbGF5c1syXTsKLQotICAgICAgICAgICAgLyogeW5MKz1BMSAoUTE0KSAqIHgobi0xKUwgKFEwKSBpbiBRMTQqLwotICAgICAgICAgICAgeW5MKz0oTFZNX0lOVDMyKXBCaXF1YWRTdGF0ZS0+Y29lZnNbMV0qIHBCaXF1YWRTdGF0ZS0+cERlbGF5c1swXTsKLQotICAgICAgICAgICAgLyogeW5MKz1BMCAoUTE0KSAqIHgobilMIChRMCkgaW4gUTE0Ki8KLSAgICAgICAgICAgIHluTCs9KExWTV9JTlQzMilwQmlxdWFkU3RhdGUtPmNvZWZzWzJdKiAoKnBEYXRhSW4pOwotCi0gICAgICAgICAgICAvKiB5bkwrPSAoICgtQjIgKFExNCkgKiB5KG4tMilMIChRMTYpICk+PjE2KSBpbiBRMTQgKi8KLSAgICAgICAgICAgIE1VTDMyeDE2SU5UTzMyKHBCaXF1YWRTdGF0ZS0+cERlbGF5c1s2XSxwQmlxdWFkU3RhdGUtPmNvZWZzWzNdLHRlbXBsLDE2KQotICAgICAgICAgICAgeW5MKz10ZW1wbDsKLQotICAgICAgICAgICAgLyogeW5MKz0oICgtQjEgKFExNCkgKiB5KG4tMSlMIChRMTYpICk+PjE2KSBpbiBRMTQgKi8KLSAgICAgICAgICAgIE1VTDMyeDE2SU5UTzMyKHBCaXF1YWRTdGF0ZS0+cERlbGF5c1s0XSxwQmlxdWFkU3RhdGUtPmNvZWZzWzRdLHRlbXBsLDE2KQotICAgICAgICAgICAgeW5MKz10ZW1wbDsKLQotICAgICAgICAgICAgLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgUFJPQ0VTU0lORyBPRiBUSEUgUklHSFQgQ0hBTk5FTAotICAgICAgICAgICAgKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotICAgICAgICAgICAgLyogeW5SPUEyIChRMTQpICogeChuLTIpUiAoUTApIGluIFExNCovCi0gICAgICAgICAgICB5blI9KExWTV9JTlQzMilwQmlxdWFkU3RhdGUtPmNvZWZzWzBdKnBCaXF1YWRTdGF0ZS0+cERlbGF5c1szXTsKLQotICAgICAgICAgICAgLyogeW5SKz1BMSAoUTE0KSAqIHgobi0xKVIgKFEwKSBpbiBRMTQqLwotICAgICAgICAgICAgeW5SKz0oTFZNX0lOVDMyKXBCaXF1YWRTdGF0ZS0+Y29lZnNbMV0qcEJpcXVhZFN0YXRlLT5wRGVsYXlzWzFdOwotCi0gICAgICAgICAgICAvKiB5blIrPUEwIChRMTQpICogeChuKVIgKFEwKSBpbiBRMTQqLwotICAgICAgICAgICAgeW5SKz0oTFZNX0lOVDMyKXBCaXF1YWRTdGF0ZS0+Y29lZnNbMl0qKCoocERhdGFJbisxKSk7Ci0KLSAgICAgICAgICAgIC8qIHluUis9ICggKC1CMiAoUTE0KSAqIHkobi0yKVIgKFExNikgKT4+MTYpIGluIFExNCovCi0gICAgICAgICAgICBNVUwzMngxNklOVE8zMihwQmlxdWFkU3RhdGUtPnBEZWxheXNbN10scEJpcXVhZFN0YXRlLT5jb2Vmc1szXSx0ZW1wbCwxNikKLSAgICAgICAgICAgIHluUis9dGVtcGw7Ci0KLSAgICAgICAgICAgIC8qIHluUis9KCAoLUIxIChRMTQpICogeShuLTEpUiAoUTE2KSApPj4xNikgaW4gUTE0ICovCi0gICAgICAgICAgICBNVUwzMngxNklOVE8zMihwQmlxdWFkU3RhdGUtPnBEZWxheXNbNV0scEJpcXVhZFN0YXRlLT5jb2Vmc1s0XSx0ZW1wbCwxNikKLSAgICAgICAgICAgIHluUis9dGVtcGw7Ci0KLSAgICAgICAgICAgIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgotICAgICAgICAgICAgICAgICAgICAgICAgICAgIFVQREFUSU5HIFRIRSBERUxBWVMKLSAgICAgICAgICAgICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLSAgICAgICAgICAgIHBCaXF1YWRTdGF0ZS0+cERlbGF5c1s3XT1wQmlxdWFkU3RhdGUtPnBEZWxheXNbNV07ICAvKiB5KG4tMilSPXkobi0xKVIqLwotICAgICAgICAgICAgcEJpcXVhZFN0YXRlLT5wRGVsYXlzWzZdPXBCaXF1YWRTdGF0ZS0+cERlbGF5c1s0XTsgIC8qIHkobi0yKUw9eShuLTEpTCovCi0gICAgICAgICAgICBwQmlxdWFkU3RhdGUtPnBEZWxheXNbM109cEJpcXVhZFN0YXRlLT5wRGVsYXlzWzFdOyAgLyogeChuLTIpUj14KG4tMSlSKi8KLSAgICAgICAgICAgIHBCaXF1YWRTdGF0ZS0+cERlbGF5c1syXT1wQmlxdWFkU3RhdGUtPnBEZWxheXNbMF07ICAvKiB4KG4tMilMPXgobi0xKUwqLwotICAgICAgICAgICAgcEJpcXVhZFN0YXRlLT5wRGVsYXlzWzVdPXluUjw8MjsgICAgICAgICAgICAgICAgICAgIC8qIFVwZGF0ZSB5KG4tMSlSIGluIFExNiovCi0gICAgICAgICAgICBwQmlxdWFkU3RhdGUtPnBEZWxheXNbNF09eW5MPDwyOyAgICAgICAgICAgICAgICAgICAgLyogVXBkYXRlIHkobi0xKUwgaW4gUTE2Ki8KLSAgICAgICAgICAgIHBCaXF1YWRTdGF0ZS0+cERlbGF5c1swXT0oKnBEYXRhSW4pOyAgICAgICAgICAgICAgICAvKiBVcGRhdGUgeChuLTEpTCBpbiBRMCovCi0gICAgICAgICAgICBwRGF0YUluKys7Ci0gICAgICAgICAgICBwQmlxdWFkU3RhdGUtPnBEZWxheXNbMV09KCpwRGF0YUluKTsgICAgICAgICAgICAgICAgLyogVXBkYXRlIHgobi0xKVIgaW4gUTAqLwotICAgICAgICAgICAgcERhdGFJbisrOwotCi0gICAgICAgICAgICAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBXUklUSU5HIFRIRSBPVVRQVVQKLSAgICAgICAgICAgICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLSAgICAg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iBRMCBmb3JtYXQKLSBwQmlxdWFkU3RhdGUtPnBEZWxheXNbMV0gaXMgeChuLTEpUiBpbiBRMCBmb3JtYXQKLSBwQmlxdWFkU3RhdGUtPnBEZWxheXNbMl0gaXMgeChuLTIpTCBpbiBRMCBmb3JtYXQKLSBwQmlxdWFkU3RhdGUtPnBEZWxheXNbM10gaXMgeChuLTIpUiBpbiBRMCBmb3JtYXQKLSBwQmlxdWFkU3RhdGUtPnBEZWxheXNbNF0gaXMgeShuLTEpTCBpbiBRMTYgZm9ybWF0Ci0gcEJpcXVhZFN0YXRlLT5wRGVsYXlzWzVdIGlzIHkobi0xKVIgaW4gUTE2IGZvcm1hdAotIHBCaXF1YWRTdGF0ZS0+cERlbGF5c1s2XSBpcyB5KG4tMilMIGluIFExNiBmb3JtYXQKLSBwQmlxdWFkU3RhdGUtPnBEZWxheXNbN10gaXMgeShuLTIpUiBpbiBRMTYgZm9ybWF0Ci0qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0KLXZvaWQgQlFfMklfRDE2RjMyQzE1X1RSQ19XUkFfMDEgKCAgICAgICAgICAgQmlxdWFkX0luc3RhbmNlX3QgICAgICAgKnBJbnN0YW5jZSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTFZNX0lOVDE2ICAgICAgICAgICAgICAgICAgICAqcERhdGFJbiwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTFZNX0lOVDE2ICAgICAgICAgICAgICAgICAgICAqcERhdGFPdXQsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIExWTV9JTlQxNiAgICAgICAgICAgICAgICAgICAgTnJTYW1wbGVzKQotICAgIHsKLSAgICAgICAgTFZNX0lOVDMyICB5bkwseW5SLHRlbXBsOwotICAgICAgICBMVk1fSU5UMTYgaWk7Ci0gICAgICAgIFBGaWx0ZXJfU3RhdGUgcEJpcXVhZFN0YXRlID0gKFBGaWx0ZXJfU3RhdGUpIHBJbnN0YW5jZTsKLQotICAgICAgICAgZm9yIChpaSA9IE5yU2FtcGxlczsgaWkgIT0gMDsgaWktLSkKLSAgICAgICAgIHsKLQotCi0gICAgICAgICAgICAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBQUk9DRVNTSU5HIE9GIFRIRSBMRUZUIENIQU5ORUwKLSAgICAgICAgICAgICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLSAgICAgICAgICAgIC8qIHluTD1BMiAoUTE1KSAqIHgobi0yKUwgKFEwKSBpbiBRMTUqLwotICAgICAgICAgICAgeW5MPShMVk1fSU5UMzIpcEJpcXVhZFN0YXRlLT5jb2Vmc1swXSogcEJpcXVhZFN0YXRlLT5wRGVsYXlzWzJdOwotCi0gICAgICAgICAgICAvKiB5bkwrPUExIChRMTUpICogeChuLTEpTCAoUTApIGluIFExNSovCi0gICAgICAgICAgICB5bkwrPShMVk1fSU5UMzIpcEJpcXVhZFN0YXRlLT5jb2Vmc1sxXSogcEJpcXVhZFN0YXRlLT5wRGVsYXlzWzBdOwotCi0gICAgICAgICAgICAvKiB5bkwrPUEwIChRMTUpICogeChuKUwgKFEwKSBpbiBRMTUqLwotICAgICAgICAgICAgeW5MKz0oTFZNX0lOVDMyKXBCaXF1YWRTdGF0ZS0+Y29lZnNbMl0qICgqcERhdGFJbik7Ci0KLSAgICAgICAgICAgIC8qIHluTCs9ICggKC1CMiAoUTE1KSAqIHkobi0yKUwgKFExNikgKT4+MTYpIGluIFExNSAqLwotICAgICAgICAgICAgTVVMMzJ4MTZJTlRPMzIocEJpcXVhZFN0YXRlLT5wRGVsYXlzWzZdLHBCaXF1YWRTdGF0ZS0+Y29lZnNbM10sdGVtcGwsMTYpCi0gICAgICAgICAgICB5bkwrPXRlbXBsOwotCi0gICAgICAgICAgICAvKiB5bkwrPSggKC1CMSAoUTE1KSAqIHkobi0xKUwgKFExNikgKT4+MTYpIGluIFExNSAqLwotICAgICAgICAgICAgTVVMMzJ4MTZJTlRPMzIocEJpcXVhZFN0YXRlLT5wRGVsYXlzWzRdLHBCaXF1YWRTdGF0ZS0+Y29lZnNbNF0sdGVtcGwsMTYpCi0gICAgICAgICAgICB5bkwrPXRlbXBsOwotCi0gICAgICAgICAgICAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBQUk9DRVNTSU5HIE9GIFRIRSBSSUdIVCBDSEFOTkVMCi0gICAgICAgICAgICAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0gICAgICAgICAgICAvKiB5blI9QTIgKFExNSkgKiB4KG4tMilSIChRMCkgaW4gUTE1Ki8KLSAgICAgICAgICAgIHluUj0oTFZNX0lOVDMyKXBCaXF1YWRTdGF0ZS0+Y29lZnNbMF0qcEJpcXVhZFN0YXRlLT5wRGVsYXlzWzNdOwotCi0gICAgICAgICAgICAvKiB5blIrPUExIChRMTUpICogeChuLTEpUiAoUTApIGluIFExNSovCi0gICAgICAgICAgICB5blIrPShMVk1fSU5UMzIpcEJpcXVhZFN0YXRlLT5jb2Vmc1sxXSpwQmlxdWFkU3RhdGUtPnBEZWxheXNbMV07Ci0KLSAgICAgICAgICAgIC8qIHluUis9QTAgKFExNSkgKiB4KG4pUiAoUTApIGluIFExNSovCi0gICAgICAgICAgICB5blIrPShMVk1fSU5UMzIpcEJpcXVhZFN0YXRlLT5jb2Vmc1syXSooKihwRGF0YUluKzEpKTsKLQotICAgICAgICAgICAgLyogeW5SKz0gKCAoLUIyIChRMTUpICogeShuLTIpUiAoUTE2KSApPj4xNikgaW4gUTE1ICovCi0gICAgICAgICAgICBNVUwzMngxNklOVE8zMihwQmlxdWFkU3RhdGUtPnBEZWxheXNbN10scEJpcXVhZFN0YXRlLT5jb2Vmc1szXSx0ZW1wbCwxNikKLSAgICAgICAgICAgIHluUis9dGVtcGw7Ci0KLSAgICAgICAgICAgIC8qIHluUis9KCAoLUIxIChRMTUpICogeShuLTEpUiAoUTE2KSApPj4xNikgaW4gUTE1ICovCi0gICAgICAgICAgICBNVUwzMngxNklOVE8zMihwQmlxdWFkU3RhdGUtPnBEZWxheXNbNV0scEJpcXVhZFN0YXRlLT5jb2Vmc1s0XSx0ZW1wbCwxNikKLSAgICAgICAgICAgIHluUis9dGVtcGw7Ci0KLSAgICAgICAgICAgIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgotICAgICAgICAgICAgICAgICAgICAgICAgICAgIFVQREFUSU5HIFRIRSBERUxBWVMKLSAgICAgICAgICAgICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLSAgICAgICAgICAgIHBCaXF1YWRTdGF0ZS0+cERlbGF5c1s3XT1wQmlxdWFkU3RhdGUtPnBEZWxheXNbNV07IC8qIHkobi0yKVI9eShuLTEpUiovCi0gICAgICAgICAgICBwQmlxdWFkU3RhdGUtPnBEZWxheXNbNl09cEJpcXVhZFN0YXRlLT5wRGVsYXlzWzRdOyAvKiB5KG4tMilMPXkobi0xKUwqLwotICAgICAgICAgICAgcEJpcXVhZFN0YXRlLT5wRGVsYXlzWzNdPXBCaXF1YWRTdGF0ZS0+cERlbGF5c1sxXTsgLyogeChuLTIpUj14KG4tMSlSKi8KLSAgICAgICAgICAgIHBCaXF1YWRTdGF0ZS0+cERlbGF5c1syXT1wQmlxdWFkU3RhdGUtPnBEZWxheXNbMF07IC8qIHgobi0yKUw9eChuLTEpTCovCi0gICAgICAgICAgICBwQmlxdWFkU3RhdGUtPnBEZWxheXNbNV09eW5SPDwxOyAvKiBVcGRhdGUgeShuLTEpUiBpbiBRMTYqLwotICAgICAgICAgICAgcEJpcXVhZFN0YXRlLT5wRGVsYXlzWzRdPXluTDw8MTsgLyogVXBkYXRlIHkobi0xKUwgaW4gUTE2Ki8KLSAgICAgICAgICAgIHBCaXF1YWRTdGF0ZS0+cERlbGF5c1swXT0oKnBEYXRhSW4pOyAvKiBVcGRhdGUgeChuLTEpTCBpbiBRMCovCi0gICAgICAgICAgICBwRGF0YUluKys7Ci0gICAgICAgICAgICBwQmlxdWFkU3RhdGUtPnBEZWxheXNbMV09KCpwRGF0YUluKTsgLyogVXBkYXRlIHgobi0xKVIgaW4gUTAqLwotICAgICAgICAgICAgcERhdGFJbisrOwotCi0gICAgICAgICAgICAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBXUklUSU5HIFRIRSBPVVRQVVQKLSAgICAgICAgICAgICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLSAgICAgICAgICAgICpwRGF0YU91dD0oTFZNX0lOVDE2KSh5bkw+PjE1KTsgLyogV3JpdGUgTGVmdCBvdXRwdXQgaW4gUTAqLwotICAgICAgICAgICAgcERhdGFPdXQrKzsKLSAgICAgICAgICAgICpwRGF0YU91dD0oTFZNX0lOVDE2KSh5blI+PjE1KTsgLyogV3JpdGUgUmlnaHQgb3VwdXQgaW4gUTAqLwotICAgICAgICAgICAgcERhdGFPdXQrKzsKLSAgICAgICAgfQotCi0gICAgfQotCmRpZmYgLS1naXQgYS9tZWRpYS9saWJlZmZlY3RzL2x2bS9saWIvQ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JBTlRJRVMgT1IgQ09ORElUSU9OUyBPRiBBTlkgS0lORCwgZWl0aGVyIGV4cHJlc3Mgb3IgaW1wbGllZC4KLSAqIFNlZSB0aGUgTGljZW5zZSBmb3IgdGhlIHNwZWNpZmljIGxhbmd1YWdlIGdvdmVybmluZyBwZXJtaXNzaW9ucyBhbmQKLSAqIGxpbWl0YXRpb25zIHVuZGVyIHRoZSBMaWNlbnNlLgotICovCi0KLSNpbmNsdWRlICJCSVFVQUQuaCIKLSNpbmNsdWRlICJCUV8ySV9EMTZGMzJDc3NfVFJDX1dSQV8wMV9Qcml2YXRlLmgiCi0KLQotLyotLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tKi8KLS8qIEZVTkNUSU9OOiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgIEJRXzJJX0QxNkYzMkNzc19UUkNfV1JBXzAxX0luaXQgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qIERFU0NSSVBUSU9OOiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgIFRoZXNlIGZ1bmN0aW9ucyBpbml0aWFsaXplcyBhIEJJUVVBRCBmaWx0ZXIgZGVmaW5lZCBhcyBhIGNhc2NhZGUgb2YgICAqLwotLyogICBiaXF1YWRyYXRpYyBGaWx0ZXIgU2VjdGlvbnMuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiBQQVJBTUVURVJTOiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogICBwSW5zdGFuY2UgICAgLSBvdXRwdXQsIHJldHVybnMgdGhlIHBvaW50ZXIgdG8gdGhlIFN0YXRlIFZhcmlhYmxlICAgICAgKi8KLS8qICAgICAgICAgICAgICAgICAgIFRoaXMgc3RhdGUgcG9pbnRlciBtdXN0IGJlIHBhc3NlZCB0byBhbnkgc3Vic2VxdWVudCAgICovCi0vKiAgICAgICAgICAgICAgICAgICBjYWxsIHRvICJCaXF1YWQiIGZ1bmN0aW9ucy4gICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogICBwVGFwcyAgICAgICAgIC0gaW5wdXQsIHBvaW50ZXIgdG8gdGhlIHRhcHMgbWVtb3J5ICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICAgcENvZWYgICAgICAgICAtIGlucHV0LCBwb2ludGVyIHRvIHRoZSBjb2VmZmljaWVudCBzdHJ1Y3R1cmUgICAgICAgICAgICovCi0vKiAgIE4gICAgICAgICAgICAgLSBNIGNvZWZmaWNpZW50IGZhY3RvciBvZiBRTS5OICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogUkVUVVJOUzogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICAgdm9pZCByZXR1cm4gY29kZSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKi0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0qLwotdm9pZCBCUV8ySV9EMTZGMzJDc3NfVFJDX1dSQV8wMV9Jbml0ICggICBCaXF1YWRfSW5zdGFuY2VfdCAgICAgICAgICpwSW5zdGFuY2UsC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B5KG4tMilMIGluIFEwIGZvcm1hdAotIHBCaXF1YWRTdGF0ZS0+cERlbGF5c1s3XSBpcyB5KG4tMilSIGluIFEwIGZvcm1hdAotKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotCi12b2lkIEJRXzJJX0QzMkYzMkMzMF9UUkNfV1JBXzAxICggICAgICAgICAgIEJpcXVhZF9JbnN0YW5jZV90ICAgICAgICpwSW5zdGFuY2UsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIExWTV9JTlQzMiAgICAgICAgICAgICAgICAgICAgKnBEYXRhSW4sCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIExWTV9JTlQzMiAgICAgICAgICAgICAgICAgICAgKnBEYXRhT3V0LAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBMVk1fSU5UMTYgICAgICAgICAgICAgICAgICAgIE5yU2FtcGxlcykKLQotCi0gICAgewotICAgICAgICBMVk1fSU5UMzIgeW5MLHluUix0ZW1wbCx0ZW1wZDsKLSAgICAgICAgTFZNX0lOVDE2IGlpOwotICAgICAgICBQRmlsdGVyX1N0YXRlIHBCaXF1YWRTdGF0ZSA9IChQRmlsdGVyX1N0YXRlKSBwSW5zdGFuY2U7Ci0KLSAgICAgICAgIGZvciAoaWkgPSBOclNhbXBsZXM7IGlpICE9IDA7IGlpLS0pCi0gICAgICAgICB7Ci0KLQotICAgICAgICAgICAgLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgUFJPQ0VTU0lORyBPRiBUSEUgTEVGVCBDSEFOTkVMCi0gICAgICAgICAgICAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKio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0gICAgICAgICAgICB5bkwrPXRlbXBsOwotCi0gICAgICAgICAgICAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBQUk9DRVNTSU5HIE9GIFRIRSBSSUdIVCBDSEFOTkVMCi0gICAgICAgICAgICAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0gICAgICAgICAgICAvKiB5blI9ICggQTIgKFEzMCkgKiB4KG4tMilSIChRMCkgKSA+PiAzMCBpbiBRMCovCi0gICAgICAgICAgICBNVUwzMngzMklOVE8zMihwQmlxdWFkU3RhdGUtPmNvZWZzWzBdLHBCaXF1YWRTdGF0ZS0+cERlbGF5c1szXSx5blIsMzApCi0KLSAgICAgICAgICAgIC8qIHluUis9ICggQTEgKFEzMCkgKiB4KG4tMSlSIChRMCkgKSA+PiAzMCAgaW4gUTAqLwotICAgICAgICAgICAgTVVMMzJ4MzJJTlRPMzIocEJpcXVhZFN0YXRlLT5jb2Vmc1sxXSxwQmlxdWFkU3RhdGUtPnBEZWxheXNbMV0sdGVtcGwsMzApCi0gICAgICAgICAgICB5blIrPXRlbXBsOwotCi0gICAgICAgICAgICAvKiB5blIrPSAoIEEwIChRMzApICogeChuKVIgKFEwKSApID4+IDMwIGluIFEwKi8KLSAgICAgICAgICAgIHRlbXBkPSoocERhdGFJbisxKTsKLSAgICAgICAgICAgIE1VTDMyeDMySU5UTzMyKHBCaXF1YWRTdGF0ZS0+Y29lZnNbMl0sdGVtcGQsdGVtcGwsMzApCi0gICAgICAgICAgICB5blIrPXRlbXBsOwotCi0gICAgICAgICAgICAvKiB5blIrPSAoLUIyIChRMzApICogeShuLTIpUiAoUTApICkgPj4gMzAgaW4gUTAqLwotICAgICAgICAgICAgTVVMMzJ4MzJJTlRPMzIocEJpcXVhZFN0YXRlLT5jb2Vmc1szXSxwQmlxdWFkU3RhdGUtPnBEZWxheXNbN10sdGVtcGwsMzApCi0gICAgICAgICAgICB5blIrPXRlbXBsOwotCi0gICAgICAgICAgICAvKiB5blIrPSAoLUIxIChRMzApICogeShuLTEpUiAoUTApICkgPj4gMzAgaW4gUTAgKi8KLSAgICAgICAgICAgIE1VTDMyeDMySU5UTzMyKHBCaXF1YWRTdGF0ZS0+Y29lZnNbNF0scEJpcXVhZFN0YXRlLT5wRGVsYXlzWzVdLHRlbXBsLDMwKQotICAgICAgICAgICAgeW5SKz10ZW1wbDsKLQotICAgICAgICAgICAgLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgVVBEQVRJTkcgVEhFIERFTEFZUwotICAgICAgICAgICAgKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotICAgICAgICAgICAgcEJpcXVhZFN0YXRlLT5wRGVsYXlzWzddPXBCaXF1YWRTdGF0ZS0+cERlbGF5c1s1XTsgLyogeShuLTIpUj15KG4tMSlSKi8KLSAgICAgICAgICAgIHBCaXF1YWRTdGF0ZS0+cERlbGF5c1s2XT1wQmlxdWFkU3RhdGUtPnBEZWxheXNbNF07IC8qIHkobi0yKUw9eShuLTEpTCovCi0gICAgICAgICAgICBwQmlxdWFkU3RhdGUtPnBEZWxheXNbM109cEJpcXVhZFN0YXRlLT5wRGVsYXlzWzFdOyAvKiB4KG4tMilSPXgobi0xKVIqLwotICAgICAgICAgICAgcEJpcXVhZFN0YXRlLT5wRGVsYXlzWzJdPXBCaXF1YWRTdGF0ZS0+cERlbGF5c1swXTsgLyogeChuLTIpTD14KG4tMSlMKi8KLSAgICAgICAgICAgIHBCaXF1YWRTdGF0ZS0+cERlbGF5c1s1XT0oTFZNX0lOVDMyKXluUjsgLyogVXBkYXRlIHkobi0xKVIgaW4gUTAqLwotICAgICAgICAgICAgcEJpcXVhZFN0YXRlLT5wRGVsYXlzWzRdPShMVk1fSU5UMzIpeW5MOyAvKiBVcGRhdGUgeShuLTEpTCBpbiBRMCovCi0gICAgICAgICAgICBwQmlxdWFkU3RhdGUtPnBEZWxheXNbMF09KCpwRGF0YUluKTsgLyogVXBkYXRlIHgobi0xKUwgaW4gUTAqLwotICAgICAgICAgICAgcERhdGFJbisrOwotICAgICAgICAgICAgcEJpcXVhZFN0YXRlLT5wRGVsYXlzWzFdPSgqcERhdGFJbik7IC8qIFVwZGF0ZSB4KG4tMSlSIGluIFEwKi8KLSAgICAgICAgICAgIHBEYXRhSW4rKzsKLQotICAgICAgICAgICAgLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgV1JJVElORyBUSEUgT1VUUFVUCi0gICAgICAgICAgICAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0gICAgICAgICAgICAqcERhdGFPdXQ9KExWTV9JTlQzMil5bkw7IC8qIFdyaXRlIExlZnQgb3V0cHV0IGluIFEwKi8KLSAgICAgICAgICAgIHBEYXRhT3V0Kys7Ci0gICAgICAgICAgICAqcERhdGFPdXQ9KExWTV9JTlQzMil5blI7IC8qIFdyaXRlIFJpZ2h0IG91cHV0IGluIFEwKi8KLSAgICAgICAgICAgIHBEYXRhT3V0Kys7Ci0KLQotICAgICAgICB9Ci0KLSAgICB9Ci0KZGlmZiAtLWdpdCBhL21lZGlhL2xpYmVmZmVjdHMvbHZtL2xpYi9Db21tb24vc3JjL0JRXzJJX0QzMkYzMkNsbF9UUkNfV1JBXzAxX0luaXQuYyBiL21lZGlhL2xpYmVmZmVjdHMvbHZtL2xpYi9Db21tb24vc3J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bmcgcGVybWlzc2lvbnMgYW5kCi0gKiBsaW1pdGF0aW9ucyB1bmRlciB0aGUgTGljZW5zZS4KLSAqLwotCi0vKi0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0qLwotI2luY2x1ZGUgIkJJUVVBRC5oIgotI2luY2x1ZGUgIkJRXzJJX0QzMkYzMkNsbF9UUkNfV1JBXzAxX1ByaXZhdGUuaCIKLQotLyotLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tKi8KLS8qIEZVTkNUSU9OOiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgIEJRXzJJX0QzMkYzMkNsbF9UUkNfV1JBXzAxX0luaXQgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qIERFU0NSSVBUSU9OOiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgIFRoZXNlIGZ1bmN0aW9ucyBpbml0aWFsaXplcyBhIEJJUVVBRCBmaWx0ZXIgZGVmaW5lZCBhcyBhIGNhc2NhZGUgb2YgICAqLwotLyogICBiaXF1YWRyYXRpYyBGaWx0ZXIgU2VjdGlvbnMuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiBQQVJBTUVURVJTOiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogICBwSW5zdGFuY2UgICAgLSBvdXRwdXQsIHJldHVybnMgdGhlIHBvaW50ZXIgdG8gdGhlIFN0YXRlIFZhcmlhYmxlICAgICAgKi8KLS8qICAgICAgICAgICAgICAgICAgIFRoaXMgc3RhdGUgcG9pbnRlciBtdXN0IGJlIHBhc3NlZCB0byBhbnkgc3Vic2VxdWVudCAgICovCi0vKiAgICAgICAgICAgICAgICAgICBjYWxsIHRvICJCaXF1YWQiIGZ1bmN0aW9ucy4gICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogICBwVGFwcyAgICAgICAgIC0gaW5wdXQsIHBvaW50ZXIgdG8gdGhlIHRhcHMgbWVtb3J5ICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICAgcENvZWYgICAgICAgICAtIGlucHV0LCBwb2ludGVyIHRvIHRoZSBjb2VmZmljaWVudCBzdHJ1Y3R1cmUgICAgICAgICAgICovCi0vKiAgIE4gICAgICAgICAgICAgLSBNIGNvZWZmaWNpZW50IGZhY3RvciBvZiBRTS5OICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogUkVUVVJOUzogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICAgdm9pZCByZXR1cm4gY29kZSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKi0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0qLwotdm9pZCBCUV8ySV9EMzJGMzJDbGxfVFJDX1dSQV8wMV9Jbml0ICggICBCaXF1YWRfSW5zdGFuY2VfdCAgICAgICAgICpwSW5zdGFuY2UsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgI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gKiBsaW1pdGF0aW9ucyB1bmRlciB0aGUgTGljZW5zZS4KLSAqLwotCi0jaWZuZGVmIF9DT01QX0xJTV9QUklWQVRFXwotI2RlZmluZSBfQ09NUF9MSU1fUFJJVkFURV8KLQotLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKLSAgIElOQ0xVREUgRklMRVMKLSoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotCi0jaW5jbHVkZSAiQ29tcExpbS5oIgotCi0vKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgotICAgREVGSU5JVElPTlMKLSoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotCi0jZGVmaW5lIEZTXzQ4SyAgICAgIDQ4MDAwCi0KLSNkZWZpbmUgSU5URUdFUl8xNiAgMHhGRkZGIC8qICAgNjU1MzUqLwotI2RlZmluZSBJTlRFR0VSXzE1ICAweDdGRkYgLyogICAzMjc2NyovCi0KLSNkZWZpbmUgR0FJTl82REIgICAgMQotI2RlZmluZSBHQUlOXzEyREIgICAyCi0jZGVmaW5lIEdBSU5fMThEQiAgIDMKLSNkZWZpbmUgR0FJTl8yNERCICAgNAotCi0jZW5kaWYgLyogI2lmbmRlZiBfQ09NUF9MSU1fUFJJVkFURV8gKi8KLQotLyoqKiBFbmQgb2YgZmlsZSAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0KZGlmZiAtLWdpdCBhL21lZGlhL2xpYmVmZmVjdHMvbHZtL2xpYi9Db21tb24vc3JjL0NvcHlfMTYu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bnMgYW5kCi0gKiBsaW1pdGF0aW9ucyB1bmRlciB0aGUgTGljZW5zZS4KLSAqLwotCi0vKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgotICAgSU5DTFVERSBGSUxFUwotKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0KLSNpbmNsdWRlICJWZWN0b3JBcml0aG1ldGljLmgiCi0KLS8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCi0gICBGVU5DVElPTiBDT1BZXzE2Ci0qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLQotdm9pZCBDb3B5XzE2KCBjb25zdCBMVk1fSU5UMTYgKnNyYywKLSAgICAgICAgICAgICAgICAgICAgTFZNX0lOVDE2ICpkc3QsCi0gICAgICAgICAgICAgICAgICAgIExWTV9JTlQxNiAgbiApCi17Ci0gICAgTFZNX0lOVDE2IGlpOwotCi0gICAgaWYgKHNyYyA+IGRzdCkKLSAgICB7Ci0gICAgICAgIGZvciAoaWkgPSBuOyBpaSAhPSAwOyBpaS0tKQotICAgICAgICB7Ci0gICAgICAgICAgICAqZHN0ID0gKnNyYzsKLSAgICAgICAgICAgIGRzdCsrOwotICAgICAgICAgICAgc3JjKys7Ci0gICAgICAgIH0KLSAgICB9Ci0gICAgZWxzZQotICAgIHsKLSAgICAgICAgc3JjICs9IG4gLSAxOwotICAgICAgICBkc3QgKz0gbiAtIDE7Ci0gICAgICAgIGZvciAoaWkgPSBuOyBpaSAhPSAwOyBpaS0tKQotICAgICAgICB7Ci0gICAgICAgICAgICAqZHN0ID0gKnNyYzsKLSAgICAg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hcHBsaWNhYmxlIGxhdyBvciBhZ3JlZWQgdG8gaW4gd3JpdGluZywgc29mdHdhcmUKLSAqIGRpc3RyaWJ1dGVkIHVuZGVyIHRoZSBMaWNlbnNlIGlzIGRpc3RyaWJ1dGVkIG9uIGFuICJBUyBJUyIgQkFTSVMsCi0gKiBXSVRIT1VUIFdBUlJBTlRJRVMgT1IgQ09ORElUSU9OUyBPRiBBTlkgS0lORCwgZWl0aGVyIGV4cHJlc3Mgb3IgaW1wbGllZC4KLSAqIFNlZSB0aGUgTGljZW5zZSBmb3IgdGhlIHNwZWNpZmljIGxhbmd1YWdlIGdvdmVybmluZyBwZXJtaXNzaW9ucyBhbmQKLSAqIGxpbWl0YXRpb25zIHVuZGVyIHRoZSBMaWNlbnNlLgotICovCi0KLS8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCi0gICBJTkNMVURFIEZJTEVTCi0qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLQotI2luY2x1ZGUgIk1peGVyX3ByaXZhdGUuaCIKLSNpbmNsdWRlICJMVk1fTWFjcm9zLmgiCi0KLS8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCi0gICBGVU5DVElPTiBDT1JFX01JWEhBUkRfMlNUX0QzMkMzMV9TQVQKLSoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotCi12b2lkIENvcmVfTWl4SGFyZF8yU3RfRDMyQzMxX1NBVCggICBNaXhfMlN0X0NsbF90ICAgICAgICpwSW5zdGFuY2UsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb25zdCBMVk1fSU5UMzIgICAgICpzcmMxLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY29uc3QgTFZNX0lOVDMyICAgICAqc3JjMiwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIExWTV9JTlQzMiAgICAgKmRzdCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIExWTV9JTlQxNiAgICAgbikKLXsKLSAgICBMVk1fSU5UMzIgIFRlbXAxLFRlbXAyLFRlbXAzOwotICAgIExWTV9JTlQxNiBpaTsKLSAgICBMVk1fSU5UMTYgQ3VycmVudDFTaG9ydDsKLSAgICBMVk1fSU5UMTYgQ3VycmVudDJTaG9ydDsKLQotICAgIEN1cnJlbnQxU2hvcnQgPSAoTFZNX0lOVDE2KShwSW5zdGFuY2UtPkN1cnJlbnQxID4+IDE2KTsKLSAgICBDdXJyZW50MlNob3J0ID0gKExWTV9JTlQxNikocEluc3RhbmNlLT5DdXJyZW50MiA+PiAxNik7Ci0KLSAgICBmb3IgKGlpID0gbjsgaWkgIT0gMDsgaWktLSl7Ci0gICAgICAgIFRlbXAxPSpzcmMxKys7Ci0gICAgICAgIE1VTDMyeDE2SU5UTzMyKFRlbXAxLEN1cnJlbnQxU2hvcnQsVGVtcDMsMTUpCi0gICAgICAgIFRlbXAyPSpzcmMyKys7Ci0gICAgICAgIE1VTDMyeDE2SU5UTzMyKFRlbXAyLEN1cnJlbnQyU2hvcnQsVGVtcDEsMTUpCi0gICAgICAgIFRlbXAyPShUZW1wMT4+MSkrKFRlbXAzPj4xKTsKLSAgICAgICAgaWYgKFRlbXAyID4gMHgzRkZGRkZGRikKLSAgICAgICAgICAgIFRlbXAyID0gMHg3RkZGRkZGRjsKLSAgICAgICAgZWxzZSBpZiAoVGVtcDIgPCAtIDB4NDAwMDAwMDApCi0gICAgICAgICAgICBUZW1wMiA9ICAweDgwMDAwMDAwOwotICAgICAgICBlbHNlCi0gICAgICAgICAgIC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lIGxhdyBvciBhZ3JlZWQgdG8gaW4gd3JpdGluZywgc29mdHdhcmUKLSAqIGRpc3RyaWJ1dGVkIHVuZGVyIHRoZSBMaWNlbnNlIGlzIGRpc3RyaWJ1dGVkIG9uIGFuICJBUyBJUyIgQkFTSVMsCi0gKiBXSVRIT1VUIFdBUlJBTlRJRVMgT1IgQ09ORElUSU9OUyBPRiBBTlkgS0lORCwgZWl0aGVyIGV4cHJlc3Mgb3IgaW1wbGllZC4KLSAqIFNlZSB0aGUgTGljZW5zZSBmb3IgdGhlIHNwZWNpZmljIGxhbmd1YWdlIGdvdmVybmluZyBwZXJtaXNzaW9ucyBhbmQKLSAqIGxpbWl0YXRpb25zIHVuZGVyIHRoZSBMaWNlbnNlLgotICovCi0KLS8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCi0gICBJTkNMVURFIEZJTEVTCi0qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLQotI2luY2x1ZGUgIk1peGVyX3ByaXZhdGUuaCIKLSNpbmNsdWRlICJMVk1fTWFjcm9zLmgiCi0KLS8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCi0gICBGVU5DVElPTiBDT1JFX01JWFNPRlRfMVNUX0QzMkMzMV9XUkEKLSoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotCi12b2lkIENvcmVfTWl4SW5Tb2Z0X0QzMkMzMV9TQVQoICAgICBNaXhfMVN0X0NsbF90ICAgICAgICpwSW5zdGFuY2UsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb25zdCBMVk1fSU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gIHBJbnN0YW5jZS0+Q3VycmVudCA9IFRhcmdldFRpbWVzT25lTWluQWxwaGEgKyBDdXJyZW50VGltZXNBbHBoYTsgICAgICAgICAgICAgICAgLyogUTAgKyBRMCBpbnRvIFEwKi8KLSAgICAgICAgQ3VycmVudFNob3J0ID0gKExWTV9JTlQxNikocEluc3RhbmNlLT5DdXJyZW50Pj4xNik7ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvKiBGcm9tIFEzMSB0byBRMTUqLwotCi0gICAgICAgIGZvciAoaWkgPSBPdXRMb29wOyBpaSAhPSAwOyBpaS0tKXsKLSAgICAgICAgVGVtcDE9KnNyYysrOwotICAgICAgICBUZW1wMj0qZHN0OwotICAgICAgICBNVUwzMngxNklOVE8zMihUZW1wMSxDdXJyZW50U2hvcnQsVGVtcDMsMTUpCi0gICAgICAgIFRlbXAxPShUZW1wMj4+MSkrKFRlbXAzPj4xKTsKLQotICAgICAgICBpZiAoVGVtcDEgPiAweDNGRkZGRkZGKQotICAgICAgICAgICAgVGVtcDEgPSAweDdGRkZGRkZGOwotICAgICAgICBlbHNlIGlmIChUZW1wMSA8IC0gMHg0MDAwMDAwMCkKLSAgICAgICAgICAgIFRlbXAxID0gIDB4ODAwMDAwMDA7Ci0gICAgICAgIGVsc2UKLSAgICAgICAgICAgIFRlbXAxPShUZW1wMTw8MSk7Ci0gICAgICAgICAgICAqZHN0KysgPSBUZW1wMTsKLSAgICAgICAgfQotICAgIH0KLQotICAgIGZvciAoaWkgPSBJbkxvb3A7IGlpICE9IDA7IGlpLS0pewotICAgICAgICBNVUwzMngzMklOVE8zMihwSW5zdGFuY2UtPkN1cnJlbnQscEluc3RhbmNlLT5BbHBoYSxDdXJyZW50VGltZXNBbHBoYSwzMSk7ICAgICAgIC8qIFEwICogUTMxIGluIFEwICovCi0gICAgICAgIHBJbnN0YW5jZS0+Q3VycmVudCA9IFRhcmdldFRpbWVzT25lTWluQWxwaGEgKyBDdXJyZW50VGltZXNBbHBoYTsgICAgICAgICAgICAgICAgLyogUTAgKyBRMCBpbnRvIFEwKi8KLSAgICAgICAgQ3VycmVudFNob3J0ID0gKExWTV9JTlQxNikocEluc3RhbmNlLT5DdXJyZW50Pj4xNik7ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvKiBGcm9tIFEzMSB0byBRMTUqLwotCi0gICAgICAgIGZvciAoamogPSA0OyBqaiE9MCA7IGpqLS0pewotICAgICAgICBUZW1wMT0qc3JjKys7Ci0gICAgICAgIFRlbXAyPSpkc3Q7Ci0gICAgICAgIE1VTDMyeDE2SU5UTzMyKFRlbXAxLEN1cnJlbnRTaG9ydCxUZW1wMywxNSkKLSAgICAgICAgVGVtcDE9KFRlbXAyPj4xKSsoVGVtcDM+PjEpOwotCi0gICAgICAgIGlmIChUZW1wMSA+IDB4M0ZGRkZGRkYpCi0gICAgICAgICAgICBUZW1wMSA9IDB4N0ZGRkZGRkY7Ci0gICAgICAgIGVsc2UgaWYgKFRlbXAxIDwgLSAweDQwMDAwMDAwKQotICAgICAgICAgICAgVGVtcDEgPSAgMHg4MDAwMDAwMDsKLSAgICAgICAgZWxzZQotICAgICAgICAgICAgVGVtcDE9KFRlbXAxPDwxKTsKLSAgICAgICAgICAgICpkc3QrKyA9IFRlbXAxOwotICAgICAgICB9Ci0gICAgfQotfQotCi0KLS8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwpkaWZmIC0tZ2l0IGEvbWVkaWEvbGliZWZmZWN0cy9sdm0vbGliL0NvbW1vbi9zcmMvQ29yZV9NaXhTb2Z0XzFTdF9EMzJDMzFfV1JBLmMgYi9tZWRpYS9saWJlZmZlY3RzL2x2bS9saWIvQ29tbW9uL3NyYy9Db3JlX01peFNvZnRfMVN0X0QzMkMzMV9XUkEuYwpkZWxldGVkIGZpbGUgbW9kZSAxMDA2NDQKaW5kZXggNzA5YzMwNC4uMDAwMDAwMAotLS0gYS9tZ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ioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgotICAgSU5DTFVERSBGSUxFUwotKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0KLSNpbmNsdWRlICJNaXhlcl9wcml2YXRlLmgiCi0jaW5jbHVkZSAiTFZNX01hY3Jvcy5oIgotCi0vKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgotICAgRlVOQ1RJT04gQ09SRV9NSVhTT0ZUXzFTVF9EMzJDMzFfV1JBCi0qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLQotdm9pZCBDb3JlX01peFNvZnRfMVN0X0QzMkMzMV9XUkEoICAgTWl4XzFTdF9DbGxfdCAgICAgICAqcEluc3RhbmNlLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY29uc3QgTFZNX0lOVDMyICAgICAqc3JjLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTFZNX0lOVDMyICAgICAqZHN0LAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTFZNX0lOVDE2ICAgICBuKQotewotICAgIExWTV9JTlQzMiAgVGVtcDEsVGVtcDI7Ci0gICAgTFZNX0lOVDE2IE91dExvb3A7Ci0gICAgTFZNX0lOVDE2IEluTG9vcDsKLSAgICBMVk1fSU5UMzIgIFRhcmdldFRpbWVzT25lTWluQWxwaGE7Ci0gICAgTFZNX0lOVDMyICBDdXJyZW50VGltZXNBbHBoYTsKLSAgICBMVk1fSU5UMTYgQ3VycmVudFNob3J0OwotICAgIExWTV9JTlQxNiBpaTsKLQotICAgIEluTG9vcCA9IChMVk1fSU5UMTYpKG4gPj4gMik7I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yOwotICAgICAgICAgICAgZHN0Kys7Ci0gICAgICAgIH0KLSAgICB9Ci0KLSAgICBmb3IgKGlpID0gSW5Mb29wOyBpaSAhPSAwOyBpaS0tKQotICAgIHsKLSAgICAgICAgTVVMMzJ4MzJJTlRPMzIocEluc3RhbmNlLT5DdXJyZW50LHBJbnN0YW5jZS0+QWxwaGEsQ3VycmVudFRpbWVzQWxwaGEsMzEpICAvKiBRMzEgKiBRMzEgaW4gUTMxICovCi0gICAgICAgIHBJbnN0YW5jZS0+Q3VycmVudCA9IFRhcmdldFRpbWVzT25lTWluQWxwaGEgKyBDdXJyZW50VGltZXNBbHBoYTsgICAgICAgICAgLyogUTMxICsgUTMxIGludG8gUTMxKi8KLSAgICAgICAgQ3VycmVudFNob3J0ID0gKExWTV9JTlQxNikocEluc3RhbmNlLT5DdXJyZW50Pj4xNik7ICAgICAgICAgICAgICAgICAgICAgICAvKiBGcm9tIFEzMSB0byBRMTUqLwotICAgICAgICAgICAgVGVtcDE9KnNyYzsKLSAgICAgICAgICAgIHNyYysrOwotCi0gICAgICAgICAgICBNVUwzMngxNklOVE8zMihUZW1wMSxDdXJyZW50U2hvcnQsVGVtcDIsMTUpCi0gICAgICAgICAgICAqZHN0ID0gVGVtcDI7Ci0gICAgICAgICAgICBkc3QrKzsKLQotICAgICAgICAgICAgVGVtcDE9KnNyYzsKLSAgICAgICAgICAgIHNyYysrOwotCi0gICAgICAgICAgICBNVUwzMngxNklOVE8zMihUZW1wMSxDdXJyZW50U2hvcnQsVGVtcDIsMTUpCi0gICAgICAgICAgICAqZHN0ID0gVGVtcDI7Ci0gICAgICAgICAgICBkc3QrKzsKLQotICAgICAgICAgICAgVGVtcDE9KnNyYzsKLSAgICAgICAgICAgIHNyYysrOwotCi0gICAgICAgICAgICBNVUwzMngxNklOVE8zMihUZW1wMSxDdXJyZW50U2hvcnQsVGVtcDIsMTUpCi0gICAgICAgICAgICAqZHN0ID0gVGVtcDI7Ci0gICAgICAgICAgICBkc3QrKzsK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BwQmlxdWFkU3RhdGUgPSAoUEZpbHRlcl9TdGF0ZSkgcEluc3RhbmNlOwotCi0gICAgICAgIExlZnREQyAgPSAgIHBCaXF1YWRTdGF0ZS0+TGVmdERDOwotICAgICAgICBSaWdodERDID0gICBwQmlxdWFkU3RhdGUtPlJpZ2h0REM7Ci0gICAgICAgIGZvcihqPU5yU2FtcGxlcy0xO2o+PTA7ai0tKQotICAgICAgICB7Ci0gICAgICAgICAgICAvKiBTdWJ0cmFjdCBEQyBhbiBzYXR1cmF0ZSAqLwotICAgICAgICAgICAgRGlmZj0qKHBEYXRhSW4rKyktKExlZnREQz4+MTYpOwotICAgICAgICAgICAgaWYgKERpZmYgPiAzMjc2NykgewotICAgICAgICAgICAgICAgIERpZmYgPSAzMjc2NzsgfQotICAgICAgICAgICAgZWxzZSBpZiAoRGlmZiA8IC0zMjc2OCkgewotICAgICAgICAgICAgICAgIERpZmYgPSAtMzI3Njg7IH0KLSAgICAgICAgICAgICoocERhdGFPdXQrKyk9KExWTV9JTlQxNilEaWZmOwotICAgICAgICAgICAgaWYgKERpZmYgPCAwKSB7Ci0gICAgICAgICAgICAgICAgTGVmdERDIC09IERDX0QxNl9TVEVQOyB9Ci0gICAgICAgICAgICBlbHNlIHsKLSAgICAgICAgICAgICAgICBMZWZ0REMgKz0gRENfRDE2X1NURVA7IH0KLQotCi0gICAgICAgICAgICAvKiBTdWJ0cmFjdCBEQyBhbiBzYXR1cmF0ZSAqLwotICAgICAgICAgICAgRGlmZj0qKHBEYXRhSW4rKyktKFJpZ2h0REM+PjE2KTsKLSAgICAgICAgICAgIGlmIChEaWZmID4gMzI3NjcpIHsKLSAgICAgICAgICAgICAgICBEaWZmID0gMzI3Njc7IH0KLSAgICAgICAgICAgIGVsc2UgaWYgKERpZmYgPCAtMzI3NjgpIHsKLSAgICAgICAgICAgICAgICBEaWZmID0gLTMyNzY4OyB9Ci0gICAgICAgICAgICAqKHBEYXRhT3V0KyspPShMVk1fSU5UMTYpRGlmZjsK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qKioqKioqKioqKioqKioKLSAgIElOQ0xVREUgRklMRVMKLSoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotCi0jaW5jbHVkZSAiTFZNX1R5cGVzLmgiCi0jaW5jbHVkZSAiTFZNX01hY3Jvcy5oIgotI2luY2x1ZGUgIlZlY3RvckFyaXRobWV0aWMuaCIKLQotLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKLSAgIEZVTkNUSU9OIERlbGF5QWxsUGFzc18zMngzMgotKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0KLXZvaWQgRGVsYXlBbGxQYXNzX1NhdF8zMngxNlRvMzIoICBMVk1fSU5UMzIgICpkZWxheSwgICAgICAgICAgICAgICAgICAgIC8qIERlbGF5IGJ1ZmZlciAqLwotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIExWTV9VSU5UMTYgc2l6ZSwgICAgICAgICAgICAgICAgICAgICAgLyogRGVsYXkgc2l6ZSAqLwotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIExWTV9JTlQxNiBjb2VmZiwgICAgICAgICAgICAgICAgICAgICAgLyogQWxsIHBhc3MgZmlsdGVyIGNvZWZmaWNpZW50ICovCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTFZNX1VJTlQxNiBEZWxheU9mZnNldCwgICAgICAgICAgICAgICAvKiBTaW1wbGUgZGVsYXkgb2Zmc2V0ICovCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTFZNX1VJTlQxNiAqcEFsbFBhc3NPZmZzZXQsICAgICAgICAgICAvKiBBbGwgcGFzcyBmaWx0ZXIgZGVsYXkgb2Zmc2V0ICovCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTFZNX0lOVDMyICAqZHN0LCAgICAgICAgICAgICAgICAgICAgICAvKiBTb3VyY2UvZGVzdGluYXRpb24gKi8KLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBMVk1fSU5UMTYgbikgICAgICAgICAgICAgICAgICAgICAgICAgIC8qIE51bWJlciBvZiAgc2FtcGxlcyAqLwotewotICAgIExWTV9JTlQxNiAgIGk7Ci0gICAgTFZNX1VJTlQxNiAgIEFsbFBhc3NPZmZzZXQgPSAqcEFsbFBhc3NPZmZzZXQ7Ci0gICAgTFZNX0lOVDMyICAgIHRlbXA7Ci0gICAgTFZNX0lOVDMyICAgIGEsYixjOwotCi0gICAgZm9yIChpID0gMDsgaSA8IG47IGkrKykKLSAgICB7Ci0KLSAgICAgICAgTVVMMzJ4MTZJTlRPMzIoZGVsYXlbQWxsUGFzc09mZnNldF0sIGNvZWZmLCB0ZW1wLCAxNSkKLSAgICAgICAgYSA9IHRlbXA7Ci0gICAgICAgIGIgPSBkZWxheVtEZWxheU9mZnNldF07Ci0gICAgICAgIERlbGF5T2Zmc2V0Kys7Ci0KLSAgICAgICAgYyA9IGEgKyBiOwotICAgICAgICBpZiAoKCgoYyBeIGEpICYgKGMgXiBiKSkgPj4gMzEpICE9IDApICAvKiBvdmVyZmxvdyAvIHVuZGVyZmxvdyAqLwotICAgICAgICB7Ci0gICAgICAgICAgICBpZihhIDwgMCkKLSAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICBjID0gMHg4MDAwMDAwMGw7Ci0gICAgICAgICAgICB9Ci0gICAgICAgICAgICBlbHNlCi0gICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgYyA9IDB4N0ZGRkZGRkZsOwotICAgICAgICAgICAgfQotICAgICAgICB9Ci0gICAgICAgICpkc3QgPSBjOwotICAgICAgICBkc3QrKzsKLQotCi0gICAgICAgIE1VTDMyeDE2SU5UTzMyKGMsIC1jb2VmZiwgdGVtcCwgMTUpCi0gICAgICAgIGEgPSB0ZW1wOwotICAgICAgICBiID0gZGVsYXlbQWxsUGFzc09mZnNldF07Ci0gICAgICAgIGMgPSBhICsgYjsKLSAgICAgICAgaWYgKCgoKGMgXiBhKSAmIChjIF4gYikpID4+IDMxKSE9MCkgIC8qIG92ZXJmbG93IC8gdW5kZXJmbG93ICovCi0gICAgICAgIHsKLSAgICAgICAgICAgIGlmKGEgPCAwKQotICAgICAgICAgICAgewotICAgICAgICAgICAgICAgIGMgPSAweDgwMDAwMDAwbDsKLSAgICAgICAgICAgIH0KLSAgICAgICAgICAgIGVsc2UKLSAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICBjID0gMHg3RkZGRkZGRmw7Ci0gICAgICAgICAgICB9Ci0gICAgICAgIH0KLSAgICAgICAgZGVsYXlbQWxsUGFzc09mZnNldF0gPSBjOwotICAgICAgICBBbGxQYXNzT2Zmc2V0Kys7Ci0KLSAgICAgICAgLyogTWFrZSB0aGUgZGVsYXkgYnVmZmVyIGEgY2lyY3VsYXIgYnVmZmVyICovCi0gICAgICAgIGlmIChEZWxheU9mZnNldCA+PSBzaXplKQotICAgICAgICB7Ci0gICAgICAgICAgICBEZWxheU9mZnNldCA9IDA7Ci0gICAgICAgIH0KLQotICAgICAgICBpZiAoQWxsUGFzc09mZnNldCA+PSBzaXplKQotICAgICAgICB7Ci0gICAgICAgICAgICBBbGxQYXNzT2Zmc2V0ID0gMDsKLSAgICAgICAgfQotICAgIH0KLQotICAgIC8qIFVwZGF0ZSB0aGUgb2Zmc2V0ICovCi0gICAgKnBBbGxQYXNzT2Zmc2V0ID0gQWxsUGFzc09mZnNldDsKLQotICAgIHJldHVybjsKLX0KLQotLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0KZGlmZiAtLWdpdCBhL21lZGlhL2xpYmVmZmVjdHMvbHZtL2xpYi9Db21tb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jaWZpYyBsYW5ndWFnZSBnb3Zlcm5pbmcgcGVybWlzc2lvbnMgYW5kCi0gKiBsaW1pdGF0aW9ucyB1bmRlciB0aGUgTGljZW5zZS4KLSAqLwotCi0vKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgotICAgSU5DTFVERSBGSUxFUwotKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0KLSNpbmNsdWRlICJWZWN0b3JBcml0aG1ldGljLmgiCi0KLS8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCi0gICBGVU5DVElPTiBEZWxheU1peF8xNngxNgotKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0KLXZvaWQgRGVsYXlNaXhfMTZ4MTYoY29uc3QgTFZNX0lOVDE2ICpzcmMsICAgICAgICAgICAvKiBTb3VyY2UgMSwgdG8gYmUgZGVsYXllZCAqLwotICAgICAgICAgICAgICAgICAgICAgICAgICBMVk1fSU5UMTYgKmRlbGF5LCAgICAgICAgIC8qIERlbGF5IGJ1ZmZlciAqLwotICAgICAgICAgICAgICAgICAgICAgICAgICBMVk1fSU5UMTYgc2l6ZSwgICAgICAgICAgIC8qIERlbGF5IHNpemUgKi8KLSAgICAgICAgICAgICAgICAgICAgICAgICAgTFZNX0lOVDE2ICpkc3QsICAgICAgICAgICAvKiBTb3VyY2UvZGVzdGluYXRpb24gKi8KLSAgICAgICAgICAgICAgICAgICAgICAgICAgTFZNX0lOVDE2ICpwT2Zmc2V0LCAgICAgICAvKiBEZWxheSBvZmZzZXQgKi8KLSAgICAgICAgICAgICAgICAgICAgICAgICAg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lzdHJpYnV0ZWQgdW5kZXIgdGhlIExpY2Vuc2UgaXMgZGlzdHJpYnV0ZWQgb24gYW4gIkFTIElTIiBCQVNJUywKLSAqIFdJVEhPVVQgV0FSUkFOVElFUyBPUiBDT05ESVRJT05TIE9GIEFOWSBLSU5ELCBlaXRoZXIgZXhwcmVzcyBvciBpbXBsaWVkLgotICogU2VlIHRoZSBMaWNlbnNlIGZvciB0aGUgc3BlY2lmaWMgbGFuZ3VhZ2UgZ292ZXJuaW5nIHBlcm1pc3Npb25zIGFuZAotICogbGltaXRhdGlvbnMgdW5kZXIgdGhlIExpY2Vuc2UuCi0gKi8KLQotLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKLSAgIElOQ0xVREUgRklMRVMKLSoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotCi0jaW5jbHVkZSAiVmVjdG9yQXJpdGhtZXRpYy5oIgotCi0vKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgotICAgRlVOQ1RJT04gRGVsYXlNaXhfMTZ4MTYKLSoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotCi12b2lkIERlbGF5V3JpdGVfMzIoY29uc3QgTFZNX0lOVDMyICAqc3JjLCAgICAgICAgICAgICAgIC8qIFNvdXJjZSAxLCB0byBiZSBkZWxheWVkICovCi0gICAgICAgICAgICAgICAgICAgICAgICAgTFZNX0lOVDMyICAqZGVsYXksICAgICAgICAgICAgIC8qIERlbGF5IGJ1ZmZlciAqLwotICAgICAgICAgICAgICAgICAgICAgICAgIExWTV9VSU5UMTYgc2l6ZSwgICAgICAgICAgICAgICAvKiBEZWxheSBzaXplICovCi0gICAgICAgICAgICAgICAgICAgICAgICAgTFZNX1VJTlQxNiAqcE9mZnNldCwgICAgICAgICAgIC8qIERlbGF5IG9mZnNldCAqLwotICAgICAgICAgICAgICAgICAgICAgICAgIExWTV9JTlQxNiAgbikgICAgICAgICAgICAgICAgICAvKiBOdW1iZXIgb2Ygc2FtcGxlcyAqLwotewotICAgIExWTV9JTlQxNiAgIGk7Ci0gICAgTFZNX0lOVDE2ICAgT2Zmc2V0ICA9IChMVk1fSU5UMTYpKnBPZmZzZXQ7Ci0KLSAgICBmb3IgKGk9MDsgaTxuOyBpKyspCi0gICAgewotICAgICAgICBkZWxheVtPZmZzZXRdID0gKnNyYzsKLSAgICAgICAgT2Zmc2V0Kys7Ci0gICAgICAgIHNyYysrOwotCi0gICAgICAgIC8qIE1ha2UgdGhlIGRlbGF5IGJ1ZmZlciBhIGNpcmN1bGFyIGJ1ZmZlciAqLwotICAgICAgICBpZiAoT2Zmc2V0ID49IHNpemUpCi0gICAgICAgIHsKLSAgICAgICAgICAgIE9mZnNldCA9IDA7Ci0gICAgICAgIH0KLSAgICB9Ci0KLSAgICAvKiBVcGRhdGUgdGhlIG9mZnNldCAqLwotICAgICpwT2Zmc2V0ID0gKExWTV9VSU5UMTYpT2Zmc2V0OwotCi0gICAgcmV0dXJuOwotfQotCi0vKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLQpkaWZmIC0tZ2l0IGEvbWVkaWEvbGliZWZmZWN0cy9sdm0vbGliL0NvbW1vbi9zcmMvRk9fMUlfRDE2RjE2QzE1X1RSQ19XUkFfMDEuYyBiL21lZGlhL2xpYmVmZmVjdHMvbHZtL2xpYi9Db21tb24vc3JjL0ZPXzFJX0QxNkYxNkMxNV9UUkNfV1JBXzAxLmMKZGVsZXRlZCBmaWxlIG1vZGUgMTAwNjQ0CmluZGV4IG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LSNpbmNsdWRlICJCSVFVQUQuaCIKLSNpbmNsdWRlICJGT18xSV9EMTZGMTZDc3NfVFJDX1dSQV8wMV9Qcml2YXRlLmgiCi0jaW5jbHVkZSAiTFZNX01hY3Jvcy5oIgotCi0vKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKLSBBU1NVTVBUSU9OUzoKLSBDT0VGUy0KLSBwQmlxdWFkU3RhdGUtPmNvZWZzWzBdIGlzIEExLAotIHBCaXF1YWRTdGF0ZS0+Y29lZnNbMV0gaXMgQTAsCi0gcEJpcXVhZFN0YXRlLT5jb2Vmc1syXSBpcyAtQjEsIHRoZXNlIGFyZSBpbiBRMTUgZm9ybWF0Ci0KLSBERUxBWVMtCi0gcEJpcXVhZFN0YXRlLT5wRGVsYXlzWzBdIGlzIHgobi0xKUwgaW4gUTAgZm9ybWF0Ci0gcEJpcXVhZFN0YXRlLT5wRGVsYXlzWzFdIGlzIHkobi0xKUwgaW4gUTAgZm9ybWF0Ci0qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0KLXZvaWQgRk9fMUlfRDE2RjE2QzE1X1RSQ19XUkFfMDEoIEJpcXVhZF9JbnN0YW5jZV90ICAgICAgICpwSW5zdGFuY2UsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBMVk1fSU5UMTYgICAgICAgICAgICAgICAqcERhdGFJbiwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIExWTV9JTlQxNiAgICAgICAgICAgICAgICpwRGF0YU91dCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIExWTV9JTlQxNiAgICAgICAgICAgICAgIE5yU2FtcGxlcykKLSAgICB7Ci0gICAgICAgIExWTV9JTlQzMiAgeW5MOwotICAgICAgICBMVk1fSU5UMTYgaWk7Ci0gICAgICAgIFBGaWx0ZXJfU3RhdGUgcEJpcXVhZFN0YXRlID0gKFBGaWx0ZXJfU3RhdGUpIHBJbnN0YW5jZTsKLQotICAgICAgICAgZm9yIChpaSA9IE5yU2FtcGxlczsgaWkgIT0gMDsgaWktLSkKLSAgICAgICAgIHsKLQotICAgICAgICAgICAgLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgUFJPQ0VTU0lORyBPRiBUSEUgTEVGVCBDSEFOTkVMCi0gICAgICAgICAgICAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0gICAgICAgICAgICAvLyB5bkw9QTEgKFExNSkgKiB4KG4tMSlMIChRMCkgaW4gUTE1Ci0gICAgICAgICAgICB5bkw9KExWTV9JTlQzMilwQmlxdWFkU3RhdGUtPmNvZWZzWzBdKiBwQmlxdWFkU3RhdGUtPnBEZWxheXNbMF07Ci0KLSAgICAgICAgICAgIC8vIHluTCs9QTAgKFExNSkgKiB4KG4pTCAoUTApIGluIFExNQotICAgICAgICAgICAgeW5MKz0oTFZNX0lOVDMyKXBCaXF1YWRTdGF0ZS0+Y29lZnNbMV0qICgqcERhdGFJbik7Ci0KLSAgICAgICAgICAgIC8vIHluTCs9ICAoLUIxIChRMTUpICogeShuLTEpTCAoUTApICkgaW4gUTE1Ci0gICAgICAgICAgICB5bkwrPShMVk1fSU5UMzIpcEJpcXVhZFN0YXRlLT5jb2Vmc1syXSpwQmlxdWFkU3RhdGUtPnBEZWxheXNbMV07Ci0KLQotICAgICAgICAgICAgeW5MPShMVk1fSU5UMTYpKHluTD4+MTUpOyAvLyB5bkwgaW4gUTAgZm9ybWF0Ci0gICAgICAgICAgICAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBVUERBVElORyBUSEUgREVMQVlTCi0gICAgICAgICAgICAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0gICAgICAgICAgICBwQmlxdWFkU3RhdGUtPnBEZWxheXNbMV09eW5MOyAvLyBVcGRhdGUgeShuLTEpTCBpbiBRMAotICAgICAgICAgICAgcEJpcXVhZFN0YXRlLT5wRGVsYXlzWzBdPSgqcERhdGFJbisrKTsgLy8gVXBkYXRlIHgobi0xKUwgaW4gUTAKLQotICAgICAgICAgICAgLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgV1JJVElORyBUSEUgT1VUUFVUCi0gICAgICAgICAgICAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0gICAgICAgICAgICAqcERhdGFPdXQrKz0oTFZNX0lOVDE2KXluTDsgLy8gV3JpdGUgTGVmdCBvdXRwdXQgaW4gUTAKLQotICAgICAgICB9Ci0KLSAgICB9Ci0KZGlmZiAtLWdpdCBhL21lZGlhL2xpYmVmZmVjdHMvbHZtL2xpYi9Db21tb24vc3JjL0ZPXzFJX0QxNkYxNkNzc19UUkNfV1JBXzAxX0luaXQuYyBiL21lZGlhL2xpYmVmZmVjdHMvbHZtL2xpYi9Db21tb24vc3JjL0ZPXzFJX0QxNkYxNkNzc19UUkNfV1JBXzAxX0luaXQuYwpkZWxldGVkIGZpbGUgbW9kZSAxMDA2NDQKaW5kZXggOTYyNTJjYy4uMDAwMDAwMAotLS0gYS9tZWRpYS9saWJlZmZlY3RzL2x2bS9saWIvQ29tbW9uL3NyYy9GT18xSV9EMTZGMTZDc3NfVFJDX1dS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ZGUgIkJJUVVBRC5oIgotI2luY2x1ZGUgIkZPXzFJX0QxNkYxNkNzc19UUkNfV1JBXzAxX1ByaXZhdGUuaCIKLQotCi0vKi0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0qLwotLyogRlVOQ1RJT046ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICAgRk9fMUlfRDE2RjE2Q3NzX1RSQ19XUkFfMDFfSW5pdCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogREVTQ1JJUFRJT046ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICAgVGhlc2UgZnVuY3Rpb25zIGluaXRpYWxpemVzIGEgQklRVUFEIGZpbHRlciBkZWZpbmVkIGFzIGEgY2FzY2FkZSBvZiAgICovCi0vKiAgIGJpcXVhZHJhdGljIEZpbHRlciBTZWN0aW9ucy4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qIFBBUkFNRVRFUlM6ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgIHBJbnN0YW5jZSAgICAtIG91dHB1dCwgcmV0dXJucyB0aGUgcG9pbnRlciB0byB0aGUgU3RhdGUgVmFyaWFibGUgICAgICAqLwotLyogICAgICAgICAgICAgICAgICAgVGhpcyBzdGF0ZSBwb2ludGVyIG11c3QgYmUgcGFzc2VkIHRvIGFueSBzdWJzZXF1ZW50ICAgKi8KLS8qICAgICAgICAgICAgICAgICAgIGNhbGwgdG8gIkJpcXVhZCIgZnVuY3Rpb25zLiAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgIHBUYXBzICAgICAgICAgLSBpbnB1dCwgcG9pbnRlciB0byB0aGUgdGFwcyBtZW1vcnkgICAgICAgICAgICAgICAgICAgICAqLwotLyogICBwQ29lZiAgICAgICAgIC0gaW5wdXQsIHBvaW50ZXIgdG8gdGhlIGNvZWZmaWNpZW50IHN0cnVjdHVyZSAgICAgICAgICAgKi8KLS8qICAgTiAgICAgICAgICAgICAtIE0gY29lZmZpY2llbnQgZmFjdG9yIG9mIFFNLk4gICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiBSRVRVUk5TOiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogICB2b2lkIHJldHVybiBjb2RlICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSovCi12b2lkIEZPXzFJX0QxNkYxNkNzc19UUkNfV1JBXzAxX0luaXQoICAgIEJpcXVhZF9JbnN0YW5jZV90ICAgICAgICAgKnBJbnN0YW5jZSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgQmlxdWFkXzFJX09yZGVyMV9UYXBzX3QgICAqcFRhcHMsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEZPX0MxNl9Db2Vmc190ICAgICAgICAgICAgKnBDb2VmKQotewotICBMVk1fSU5UMTYgdGVtcDsKLSAgUEZpbHRlcl9TdGF0ZSBwQmlxdWFkU3RhdGUg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hcmUgaW4gUTMxIGZvcm1hdAotCi0gREVMQVlTLQotIHBCaXF1YWRTdGF0ZS0+cERlbGF5c1swXSBpcyB4KG4tMSlMIGluIFEwIGZvcm1hdAotIHBCaXF1YWRTdGF0ZS0+cERlbGF5c1sxXSBpcyB5KG4tMSlMIGluIFEwIGZvcm1hdAotKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotCi12b2lkIEZPXzFJX0QzMkYzMkMzMV9UUkNfV1JBXzAxKCBCaXF1YWRfSW5zdGFuY2VfdCAgICAgICAqcEluc3RhbmNlLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTFZNX0lOVDMyICAgICAgICAgICAgICAgKnBEYXRhSW4sCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBMVk1fSU5UMzIgICAgICAgICAgICAgICAqcERhdGFPdXQsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBMVk1fSU5UMTYgICAgICAgICAgICAgICBOclNhbXBsZXMpCi0gICAgewotICAgICAgICBMVk1fSU5UMzIgIHluTCx0ZW1wbDsKLSAgICAgICAgTFZNX0lOVDE2ICBpaTsKLSAgICAgICAgUEZpbHRlcl9TdGF0ZSBwQmlxdWFkU3RhdGUgPSAoUEZpbHRlcl9TdGF0ZSkgcEluc3RhbmNlOwotCi0gICAgICAgIGZvciAoaWkgPSBOclNhbXBsZXM7IGlpICE9IDA7IGlpLS0pCi0gICAgICAgIHsKLQotICAgICAgICAgICAgLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgUFJPQ0VTU0lORyBPRiBUSEUgTEVGVCBDSEFOTkVMCi0gICAgICAgICAgICAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0gICAgICAgICAgICAvLyB5bkw9QTEgKFEzMSkgKiB4KG4tMSlMIChRMCkgPj4zMSBpbiBRMAotICAgICAgICAgICAgTVVMMzJ4MzJJTlRPMzIocEJpcXVhZFN0YXRlLT5jb2Vmc1swXSxwQmlxdWFkU3RhdGUtPnBEZWxheXNbMF0seW5MLDMxKQotCi0gICAgICAgICAgICAvLyB5bkwrPUEwIChRMzEpICogeChuKUwgKFEwKSA+PiAzMSBpbiBRMAotICAgICAgICAgICAgTVVMMzJ4MzJJTlRPMzIocEJpcXVhZFN0YXRlLT5jb2Vmc1sxXSwqcERhdGFJbix0ZW1wbCwzMSkKLSAgICAgICAgICAgIHluTCs9dGVtcGw7Ci0KLSAgICAgICAgICAgIC8vIHluTCs9ICAoLUIxIChRMzEpICogeShuLTEpTCAoUTApICkgPj4gMzEgaW4gUTAKLSAgICAgICAgICAgIE1VTDMyeDMySU5UTzMyKHBCaXF1YWRTdGF0ZS0+Y29lZnNbMl0scEJpcXVhZFN0YXRlLT5wRGVsYXlzWzFdLHRlbXBsLDMxKQotICAgICAgICAgICAgeW5MKz10ZW1wbDsKLQotICAgICAgICAgICAgLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgVVBEQVRJTkcgVEhFIERFTEFZUwotICAgICAgICAgICAgKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotICAgICAgICAgICAgcEJpcXVhZFN0YXRlLT5wRGVsYXlzWzFdPXluTDsgLy8gVXBkYXRlIHkobi0xKUwgaW4gUTAKLSAgICAgICAgICAgIHBCaXF1YWRTdGF0ZS0+cERlbGF5c1swXT0oKnBEYXRhSW4rKyk7IC8vIFVwZGF0ZSB4KG4tMSlMIGluIFEwCi0KLSAgICAgIC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gICAgICAgICAgICAgKi8KLS8qIERFU0NSSVBUSU9OOiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgIFRoZXNlIGZ1bmN0aW9ucyBpbml0aWFsaXplcyBhIEJJUVVBRCBmaWx0ZXIgZGVmaW5lZCBhcyBhIGNhc2NhZGUgb2YgICAqLwotLyogICBiaXF1YWRyYXRpYyBGaWx0ZXIgU2VjdGlvbnMuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiBQQVJBTUVURVJTOiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogICBwSW5zdGFuY2UgICAgLSBvdXRwdXQsIHJldHVybnMgdGhlIHBvaW50ZXIgdG8gdGhlIFN0YXRlIFZhcmlhYmxlICAgICAgKi8KLS8qICAgICAgICAgICAgICAgICAgIFRoaXMgc3RhdGUgcG9pbnRlciBtdXN0IGJlIHBhc3NlZCB0byBhbnkgc3Vic2VxdWVudCAgICovCi0vKiAgICAgICAgICAgICAgICAgICBjYWxsIHRvICJCaXF1YWQiIGZ1bmN0aW9ucy4gICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogICBwVGFwcyAgICAgICAgIC0gaW5wdXQsIHBvaW50ZXIgdG8gdGhlIHRhcHMgbWVtb3J5ICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICAgcENvZWYgICAgICAgICAtIGlucHV0LCBwb2ludGVyIHRvIHRoZSBjb2VmZmljaWVudCBzdHJ1Y3R1cmUgICAgICAgICAgICovCi0vKiAgIE4gICAgICAgICAgICAgLSBNIGNvZWZmaWNpZW50IGZhY3RvciBvZiBRTS5OICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogUkV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KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0KLXZvaWQgRk9fMklfRDE2RjMyQzE1X0xTaHhfVFJDX1dSQV8wMShCaXF1YWRfSW5zdGFuY2VfdCAgICAgICAqcEluc3RhbmNlLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIExWTV9JTlQxNiAgICAgICAgICAgICAgICpwRGF0YUluLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIExWTV9JTlQxNiAgICAgICAgICAgICAgICpwRGF0YU91dCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBMVk1fSU5UMTYgICAgICAgICAgICAgICBOclNhbXBsZXMpCi0gICAgewotICAgICAgICBMVk1fSU5UMzIgICB5bkwseW5SOwotICAgICAgICBMVk1fSU5UMzIgICBUZW1wOwotICAgICAgICBMVk1fSU5UMzIgICBOZWdTYXRWYWx1ZTsKLSAgICAgICAgTFZNX0lOVDE2ICAgaWk7Ci0gICAgICAgIExWTV9JTlQxNiAgIFNoaWZ0OwotICAgICAgICBQRmlsdGVyX1N0YXRlIHBCaXF1YWRTdGF0ZSA9IChQRmlsdGVyX1N0YXRlKSBwSW5zdGFuY2U7Ci0KLSAgICAgICAgTmVnU2F0VmFsdWUgPSBMVk1fTUFYSU5UXzE2ICsxOwotICAgICAgICBOZWdTYXRWYWx1ZSA9IC1OZWdTYXRWYWx1ZTsKLQotICAgICAgICBTaGlmdCA9IHBCaXF1YWRTdGF0ZS0+U2hpZnQ7Ci0KLQotICAgICAgICBmb3IgKGlpID0gTnJTYW1wbGVzOyBpaSAhPSAwOyBpaS0tKQotICAgICAgICB7Ci0KLSAgICAgICAgICAgIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgotICAgICAgICAgICAgICAgICAgICAgICAgICAgIFBST0NFU1NJTkcgT0YgVEhFIExFRlQgQ0hBTk5FTAotICAgICAgICAgICAgKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotCi0gICAgICAgICAgICAvLyB5bkwgPUExIChRMTUpICogeChuLTEpTCAoUTE1KSBpbiBRMzAKLSAgICAgICAgICAgIHluTD0oTFZNX0lOVDMyKXBCaXF1YWRTdGF0ZS0+Y29lZnNbMF0qIHBCaXF1YWRTdGF0ZS0+cERlbGF5c1swXTsKLSAgICAgICAgICAgIC8vIHluUiA9QTEgKFExNSkgKiB4KG4tMSlSIChRMTUpIGluIFEzMAotICAgICAgICAgICAgeW5SPShMVk1fSU5UMzIpcEJpcXVhZFN0YXRlLT5jb2Vmc1swXSogcEJpcXVhZFN0YXRlLT5wRGVsYXlzWzJdOwotCi0KLSAgICAgICAgICAgIC8vIHluTCs9QTAgKFExNSkgKiB4KG4pTCAoUTE1KSBpbiBRMzAKLSAgICAgICAgICAgIHluTCs9KExWTV9JTlQzMilwQmlxdWFkU3RhdGUtPmNvZWZzWzFdKiAoKnBEYXRhSW4pOwotICAgICAgICAgICAgLy8geW5SKz1BMCAoUTE1KSAqIHgobilMIChRMTUpIGluIFEzMAotICAgICAgICAgICAgeW5SKz0oTFZNX0lOVDMyKXBCaXF1YWRTdGF0ZS0+Y29lZnNbMV0qICgqKHBEYXRhSW4rMSkpOwotCi0KLSAgICAgICAgICAgIC8vIHluTCArPSAgKC1CMSAoUTE1KSAqIHkobi0xKUwgKFEzMCkgKSBpbiBRMzAKLSAgICAgICAgICAgIE1VTDMyeDE2SU5UTzMyKHBCaXF1YWRTdGF0ZS0+cERlbGF5c1sxXSxwQmlxdWFkU3RhdGUtPmNvZWZzWzJdLFRlbXAsMTUpOwotICAgICAgICAgICAgeW5MICs9VGVtcDsKLSAgICAgICAgICAgIC8vIHluUiArPSAgKC1CMSAoUTE1KSAqIHkobi0xKVIgKFEzMCkgKSBpbiBRMzAKLSAgICAgICAgICAgIE1VTDMyeDE2SU5UTzMyKHBCaXF1YWRTdGF0ZS0+cERlbGF5c1szXSxwQmlxdWFkU3RhdGUtPmNvZWZzWzJdLFRlbXAsMTUpOwotICAgICAgICAgICAgeW5SICs9VGVtcDsKLQotCi0gICAgICAgICAgICAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBVUERBVElORyBUSEUgREVMQVlTCi0gICAgICAgICAgICAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0gICAgICAgICAgICBwQmlxdWFkU3RhdGUtPnBEZWxheXNbMV09eW5MOyAvLyBVcGRhdGUgeShuLTEpTCBpbiBRMzAKLSAgICAgICAgICAgIHBCaXF1YWRTdGF0ZS0+cERlbGF5c1swXT0oKnBEYXRhSW4rKyk7IC8vIFVwZGF0ZSB4KG4tMSlMIGluIFExNQotCi0gICAgICAgICAgICBwQmlxdWFkU3RhdGUtPnBEZWxheXNbM109eW5SOyAvLyBVcGRhdGUgeShuLTEpUiBpbiBRMzAKLSAgICAgICAgICAgIHBCaXF1YWRTdGF0ZS0+cERlbGF5c1syXT0oKnBEYXRhSW4rKyk7IC8vIFVwZGF0ZSB4KG4tMSlSIGluIFExNQotCi0gICAgICAgICAgICAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBXUklUSU5HIFRIRSBPVVRQVVQKLSAgICAgICAgICAgICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLSAgICAgICAgICAgIC8qQXBwbHkgc2hpZnQ6IEluc3RlYWQgb2YgbGVmdCBzaGlmdCBvbiAxNi1iaXQgcmVzdWx0LCByaWdodCBzaGlmdCBvZiAoMTUtc2hpZnQpIGlzIGFwcGxpZWQKLSAgICAgICAgICAgICAgZm9yIGJldHRlciBTTlIqLwotICAgICAgICAgICAgeW5MID0geW5MPj4oMTUtU2hpZnQpOwotICAgICAgICAgICAgeW5SID0geW5SPj4oMTUtU2hpZnQpOwotCi0gICAgICAgICAgICAvKlNhdHVyYXRlIHJlc3VsdHMqLwotICAgICAgICAgICAgaWYoeW5MID4gTFZNX01BWElOVF8xNikKLSAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICB5bkwgPSBMVk1fTUFYSU5UXzE2OwotICAgICAgICAgICAgfQotICAgICAgICAgICAgZWxzZQotICAgICAgICAgICAgewotICAgICAgICAgICAgICAgIGlmKHluTCA8IE5lZ1NhdFZhbHVlKQotICAgICAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAgICAgeW5MID0gTmVnU2F0VmFsdWU7Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgfQotCi0gICAgICAgICAgICBpZih5blIgPiBMVk1fTUFYSU5UXzE2KQotICAgICAgICAgICAgewotICAgICAgICAgICAgICAgIHluUiA9IExWTV9NQVhJTlRfMTY7Ci0gICAgICAgICAgICB9Ci0gICAgICAgICAgICBlbHNlCi0gICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgaWYoeW5SIDwgTmVnU2F0VmFsdWUpCi0gICAgICAgICAgICAgICAgewotICAgICAgICAgICAgICAgICAgICB5blIgPSBOZWdTYXRWYWx1ZTsKLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgICpwRGF0YU91dCsrPShMVk1fSU5UMTYpeW5MOwotICAgICAgICAgICAgKnBEYXRhT3V0Kys9KExWTV9JTlQxNil5blI7Ci0gICAgICAgIH0KLQotICAgIH0KLQpkaWZmIC0tZ2l0IGEvbWVkaWEvbGliZWZmZWN0cy9sdm0vbGliL0NvbW1vbi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ORElUSU9OUyBPRiBBTlkgS0lORCwgZWl0aGVyIGV4cHJlc3Mgb3IgaW1wbGllZC4KLSAqIFNlZSB0aGUgTGljZW5zZSBmb3IgdGhlIHNwZWNpZmljIGxhbmd1YWdlIGdvdmVybmluZyBwZXJtaXNzaW9ucyBhbmQKLSAqIGxpbWl0YXRpb25zIHVuZGVyIHRoZSBMaWNlbnNlLgotICovCi0KLS8qLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSovCi0jaW5jbHVkZSAiQklRVUFELmgiCi0jaW5jbHVkZSAiRk9fMklfRDE2RjMyQ3NzX0xTaHhfVFJDX1dSQV8wMV9Qcml2YXRlLmgiCi0KLS8qLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSovCi0vKiBGVU5DVElPTjogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogICBGT18ySV9EMTZGMzJDc3NfTFNoeF9UUkNfV1JBXzAxX0luaXQgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiBERVNDUklQVElPTjogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogICBUaGVzZSBmdW5jdGlvbnMgaW5pdGlhbGl6ZXMgYSBCSVFVQUQgZmlsdGVyIGRlZmluZWQgYXMgYSBjYXNjYWRlIG9mICAgKi8KLS8qICAgYmlxdWFkcmF0aWMgRmlsdGVyIFNlY3Rpb25zLiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogUEFSQU1FVEVSUzogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICAgcEluc3RhbmNlICAgIC0gb3V0cHV0LCByZXR1cm5zIHRoZSBwb2ludGVyIHRvIHRoZSBTdGF0ZSBWYXJpYWJsZSAgICAgICovCi0vKiAgICAgICAgICAgICAgICAgICBUaGlzIHN0YXRlIHBvaW50ZXIgbXVzdCBiZSBwYXNzZWQgdG8gYW55IHN1YnNlcXVlbnQgICAqLwotLyogICAgICAgICAgICAgICAgICAgY2FsbCB0byAiQmlxdWFkIiBmdW5jdGlvbnMuICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICAgcFRhcHMgICAgICAgICAtIGlucHV0LCBwb2ludGVyIHRvIHRoZSB0YXBzIG1lbW9yeSAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgIHBDb2VmICAgICAgICAgLSBpbnB1dCwgcG9pbnRlciB0byB0aGUgY29lZmZpY2llbnQgc3RydWN0dXJlICAgICAgICAgICAqLwotLyogICBOICAgICAgICAgICAgIC0gTSBjb2VmZmljaWVudCBmYWN0b3Igb2YgUU0uTiAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qIFJFVFVSTlM6ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgIHZvaWQgcmV0dXJuIGNvZGUgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyotLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tKi8KLXZvaWQgRk9fMklf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IFNlZSB0aGUgTGljZW5zZSBmb3IgdGhlIHNwZWNpZmljIGxhbmd1YWdlIGdvdmVybmluZyBwZXJtaXNzaW9ucyBhbmQKLSAqIGxpbWl0YXRpb25zIHVuZGVyIHRoZSBMaWNlbnNlLgotICovCi0KLSNpZm5kZWYgRklMVEVSU19ICi0jZGVmaW5lIEZJTFRFUlNfSAotCi0jaWZkZWYgX19jcGx1c3BsdXMKLWV4dGVybiAiQyIgewotI2VuZGlmIC8qIF9fY3BsdXNwbHVzICovCi0KLSNpbmNsdWRlICJMVk1fVHlwZXMuaCIKLQotLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLS8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgICBTdHJ1Y3R1cmVzICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0KLS8qCi0gKiBCaXF1YWQgd2l0aCBjb2VmZmljaWVudHMgQTAsIEExLCBBMiwgQjEgYW5kIEIyIGNvZWZmaWNpZW50cwotICovCi0vKiBTaW5nbGUgcHJlY2lzaW9uICgxNi1iaXQpIEJpcXVhZCBzZWN0aW9uIGNvZWZmaWNpZW50cyAqLwotdHlwZWRlZiBzdHJ1Y3QKLXsKLSAgICAgICAgTFZNX0lOVDE2ICAgQTA7Ci0gICAgICAgIExWTV9JTlQxNiAgIEExOwotICAgICAgICBMVk1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hlIEFuZHJvaWQgT3BlbiBTb3VyY2UgUHJvamVjdAotICoKLSAqIExpY2Vuc2VkIHVuZGVyIHRoZSBBcGFjaGUgTGljZW5zZSwgVmVyc2lvbiAyLjAgKHRoZSAiTGljZW5zZSIpOwotICogeW91IG1heSBub3QgdXNlIHRoaXMgZmlsZSBleGNlcHQgaW4gY29tcGxpYW5jZSB3aXRoIHRoZSBMaWNlbnNlLgotICogWW91IG1heSBvYnRhaW4gYSBjb3B5IG9mIHRoZSBMaWNlbnNlIGF0Ci0gKgotICogICAgICBodHRwOi8vd3d3LmFwYWNoZS5vcmcvbGljZW5zZXMvTElDRU5TRS0yLjAKLSAqCi0gKiBVbmxlc3MgcmVxdWlyZWQgYnkgYXBwbGljYWJsZSBsYXcgb3IgYWdyZWVkIHRvIGluIHdyaXRpbmcsIHNvZnR3YXJlCi0gKiBkaXN0cmlidXRlZCB1bmRlciB0aGUgTGljZW5zZSBpcyBkaXN0cmlidXRlZCBvbiBhbiAiQVMgSVMiIEJBU0lTLAotICogV0lUSE9VVCBXQVJSQU5USUVTIE9SIENPTkRJVElPTlMgT0YgQU5ZIEtJTkQsIGVpdGhlciBleHByZXNzIG9yIGltcGxpZWQuCi0gKiBTZWUgdGhlIExpY2Vuc2UgZm9yIHRoZSBzcGVjaWZpYyBsYW5ndWFnZSBnb3Zlcm5pbmcgcGVybWlzc2lvbnMgYW5kCi0gKiBsaW1pdGF0aW9ucyB1bmRlciB0aGUgTGljZW5zZS4KLSAqLwotCi0vKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgotICAgSU5DTFVERSBGSUxFUwotKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0KLSNpbmNsdWRlICJWZWN0b3JBcml0aG1ldGljLmgiCi0KLS8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCi0gICBGVU5DVElPTiAgRnJvbTJpVG9NU18xNngxNgotKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0KLXZvaWQgRnJvbTJpVG9NU18xNngxNiggY29uc3QgTFZNX0lOVDE2ICAqc3JjLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICBMVk1fSU5UMTYgICpkc3RNLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICBMVk1fSU5UMTYgICpkc3RTLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICBMVk1fSU5UMTYgIG4gKQotewotICAgIExWTV9JTlQzMiB0ZW1wMSxsZWZ0LHJpZ2h0OwotICAgIExWTV9JTlQxNiBpaTsKLSAgICBmb3IgKGlpID0gbjsgaWkgIT0gMDsgaWktLSkKLSAgICB7Ci0gICAgICAgIGxlZnQgPSAoTFZNX0lOVDMyKSpzcmM7Ci0gICAgICAgIHNyYysrOwotCi0gICAgICAgIHJpZ2h0ID0gKExWTV9JTlQzMikqc3JjOwotICAgICAgICBzcmMrKzsKLQotICAgICAgICAvKiBDb21wdXRlIE0gc2lnbmFsKi8KLSAgICAgICAgdGVtcDEgPSAgKGxlZnQrcmlnaHQpPj4xOwotICAgICAgICAqZHN0TSA9IChMVk1fSU5UMTYpdGVtcDE7Ci0gICAgICAgIGRzdE0rKzsKLQotICAgICAgICAvKiBDb21wdXRlIFMgc2lnbmFsKi8KLSAgICAgICAgdGVtcDEgPSAgKGxlZnQtcmlnaHQpPj4xOwotICAgICAgICAqZHN0UyA9IChMVk1fSU5UMTYpdGVtcDE7Ci0gICAgICAgIGRzdFMrKzsKLSAgICB9Ci0KLSAgICByZXR1cm47Ci19Ci0KLS8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqK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lJBTlRJRVMgT1IgQ09ORElUSU9OUyBPRiBBTlkgS0lORCwgZWl0aGVyIGV4cHJlc3Mgb3IgaW1wbGllZC4KLSAqIFNlZSB0aGUgTGljZW5zZSBmb3IgdGhlIHNwZWNpZmljIGxhbmd1YWdlIGdvdmVybmluZyBwZXJtaXNzaW9ucyBhbmQKLSAqIGxpbWl0YXRpb25zIHVuZGVyIHRoZSBMaWNlbnNlLgotICovCi0KLS8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCi0gICBJTkNMVURFIEZJTEVTCi0qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLQotI2luY2x1ZGUgIlZlY3RvckFyaXRobWV0aWMuaCIKLQotLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKLSAgIEZVTkNUSU9OIEZyb20yaVRvTW9ub18xNgotKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0KLXZvaWQgRnJvbTJpVG9Nb25vXzE2KCBjb25zdCBMVk1fSU5UMTYgKnNyYywKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBMVk1fSU5UMTYgKmRzdCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBMVk1fSU5UMTYgbikKLXsKLSAgICBMVk1fSU5UMTYgaWk7Ci0gICAgTFZNX0lOVDMyIFRlbXA7Ci0gICAgZm9yIChpaSA9IG47IGlpICE9IDA7IGlpLS0pCi0gICAgewotICAgICAgICBUZW1wID0gKExWTV9JTlQzMikqc3JjOwotICAgICAgICBzcmMrKzsKLQotICAgICAgICBUZW1wICs9IChMVk1fSU5UMzIpK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FibGUgbGF3IG9yIGFncmVlZCB0byBpbiB3cml0aW5nLCBzb2Z0d2FyZQotICogZGlzdHJpYnV0ZWQgdW5kZXIgdGhlIExpY2Vuc2UgaXMgZGlzdHJpYnV0ZWQgb24gYW4gIkFTIElTIiBCQVNJUywKLSAqIFdJVEhPVVQgV0FSUkFOVElFUyBPUiBDT05ESVRJT05TIE9GIEFOWSBLSU5ELCBlaXRoZXIgZXhwcmVzcyBvciBpbXBsaWVkLgotICogU2VlIHRoZSBMaWNlbnNlIGZvciB0aGUgc3BlY2lmaWMgbGFuZ3VhZ2UgZ292ZXJuaW5nIHBlcm1pc3Npb25zIGFuZAotICogbGltaXRhdGlvbnMgdW5kZXIgdGhlIExpY2Vuc2UuCi0gKi8KLQotLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKLSAgIElOQ0xVREUgRklMRVMKLSoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotCi0jaW5jbHVkZSAiVmVjdG9yQXJpdGhtZXRpYy5oIgotCi0vKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgotICAgRlVOQ1RJT04gRnJvbTJpVG9Nb25vXzMyCi0qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLQotdm9pZCBGcm9tMmlUb01vbm9fMzIoIGNvbnN0IExWTV9JTlQzMiAqc3JjLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgIExWTV9JTlQzMiAqZHN0LAotICAgICAgICAgICAgICAgICAgICAgICAgICAgIExWTV9JTlQxNiBuKQotewotICAgIExWTV9JTlQxNiBpaTsKLSAgICBMVk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ioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLQotdm9pZCAgICBJbnN0QWxsb2NfSW5pdCggSU5TVF9BTExPQyAgICAgICpwbXMsCi0gICAgICAgICAgICAgICAgICAgICAgICB2b2lkICAgICAgICAgICAgKlN0YXJ0QWRkciApCi17Ci0gICAgcG1zLT5Ub3RhbFNpemUgPSAzOwotICAgIHBtcy0+cE5leHRNZW1iZXIgPSAoTFZNX1VJTlQzMikoKChMVk1fVUlOVDMyKVN0YXJ0QWRkciArIDMpICYgMHhGRkZGRkZGQyk7LyogVGhpcyBjb2RlIHdpbGwgZmFpbCBpZiB0aGUgcGxhdGZvcm0gYWRkcmVzcyBzcGFjZSBpcyBtb3JlIHRoYW4gMzItYml0cyovCi19Ci0KLQotLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKLSAqICBOYW1lICAgICAgICA6IEluc3RBbGxvY19BZGRNZW1iZXIoKQotICogIElucHV0ICAgICAgIDogcG1zICAtIFBvaW50ZXIgdG8gdGhlIElOU1RfQUxMT0MgaW5zdGFuY2UKLSAgICAgICAgICAgICAgICAgIFNpemUgLSBUaGUgc2l6ZSBpbiBieXRlcyBvZiB0aGUgbmV3IGFkZGVkIG1lbWJlcgotICogIFJldHVybnMgICAgIDogQSBwb2ludGVyIHRvIHRoZSBuZXcgYWRkZWQgbWVtYmVyCi0gKiAgRGVzY3JpcHRpb24gOiBBbGxvY2F0ZXMgc3BhY2UgZm9yIGEgbmV3IG1lbWJlciBpbiB0aGUgaW5zdGFuY2UgbWVtb3J5IGFuZCByZXR1cm5zCi0gICAgICAgICAgICAgICAgICBhIHBvaW50ZXIgdG8gdGhpcyBuZXcgbWVtYmVyLiAgVGhlIHN0YXJ0IGFkZHJlc3Mgb2YgYWxsIG1lbWJlcnMgd2lsbAotICAgICAgICAgICAgICAgICAgYmUgMzIgYml0IGFsbGlnbmVkLgotICogIFJlbWFya3MgICAgIDoKLSAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotCi12b2lkKiAgIEluc3RBbGxvY19BZGRNZW1iZXIoIElOU1RfQUxMT0MgICAgICAgICAqcG1zLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICBMVk1fVUlOVDMyICAgICAgICAgICBTaXplICkKLXsKLSAgICB2b2lkICpOZXdNZW1iZXJBZGRyZXNzOyAvKiBWYXJpYWJsZSB0byB0ZW1wb3JhcmlseSBzdG9yZSB0aGUgcmV0dXJuIHZhbHVlICovCi0gICAgTmV3TWVtYmVyQWRkcmVzcyA9ICh2b2lkKilwbXMtPnBOZXh0TWVtYmVyOwotCi0gICAgU2l6ZSA9ICgoU2l6ZSArIDMpICYgMHhGRkZGRkZGQyk7IC8qIENlaWwgdGhlIHNpemUgdG8gYSBtdWx0aXBsZSBvZiBmb3VyICovCi0KLSAgICBwbXMtPlRvdGFsU2l6ZSArPSBTaXplOwotICAgIHBtcy0+cE5leHRNZW1iZXIgKz0gU2l6ZTsKLQotICAgIHJldHVybihOZXdNZW1iZXJBZGRyZXNzKTsKLX0KLQotCi0vKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgotICogIE5hbWUgICAgICAgIDogSW5zdEFsbG9jX0dldFRvdGFsKCkKLSAqICBJbnB1dCAgICAgICA6IHBtcyAgLSBQb2ludGVyIHRvIHRoZSBJTlNUX0FMTE9DIGluc3RhbmNlCi0gKiAgUmV0dXJucyAgICAgOiBUaGUgaW5zdGFuY2UgbWVtb3J5IHNpemUKLSAqICBEZXNjcmlwdGlvbiA6IFRoaXMgZnVuY3Rpb25zIHJldHVybnMgdGhlIGNhbGN1bGF0ZWQgaW5zdGFuY2UgbWVtb3J5IHNpemUKLSAqICBSZW1hcmtzICAgICA6Ci0gKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLQotTFZNX1VJTlQzMiBJbnN0QWxsb2NfR2V0VG90YWwoIElOU1RfQUxMT0MgKnBtcykKLXsKLSAgICBpZiAocG1zLT5Ub3RhbFNpemUgPiAzKQotICAgIHsKLSAgICAgICAgcmV0dXJuKHBtcy0+VG90YWxTaXplKTsKLSAgICB9Ci0gICAgZWxzZQotICAgIHsKLSAgICAgICAgcmV0dXJuIDA7ICAgICAgICAgICAvKiBObyBtZW1vcnkgYWRkZWQgKi8KLSAgICB9Ci19Ci0KLQotdm9pZCAgICBJbnN0QWxsb2NfSW5pdEFsbCggSU5TVF9BTExPQyAgICAgICAgICAgICAgICAgICAgICAqcG1zLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgTFZNX01lbW9yeVRhYmxlX3N0ICAgICAgICAgICAgICpwTWVtb3J5VGFibGUpCi17Ci0gICAgTFZNX1VJTlQzMiBTdGFydEFkZHI7Ci0KLSAgICBTdGFydEFkZHIgPSAoTFZNX1VJTlQzMilwTWVtb3J5VGFibGUtPlJlZ2lvbltMVk1fUEVSU0lTVEVOVF9TTE9XX0RBVEFdLnBCYXNlQWRkcmVzczsKLQotICAgIHBtc1swXS5Ub3RhbFNpemUgPSAzOwotICAgIHBtc1swXS5wTmV4dE1lbWJlciA9IChMVk1fVUlOVDMyKSgoKExWTV9VSU5UMzIpU3RhcnRBZGRyICsgMykgJiAweEZGRkZGRkZDKTsKLQotCi0gICAgU3RhcnRBZGRyID0gKExWTV9VSU5UMzIpcE1lbW9yeVRhYmxlLT5SZWdpb25bTFZNX1BFUlNJU1RFTlRfRkFTVF9EQVRBXS5wQmFzZUFkZHJlc3M7Ci0KLSAgICBwbXNbMV0uVG90YWxTaXplID0gMzsKLSA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XplcyBwTmV4dE1lbWJlciBmb3IgYWxsIHJlZ2lvbnMgdG8gMAotICogIFJlbWFya3MgICAgIDoKLSAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotCi12b2lkICAgIEluc3RBbGxvY19Jbml0QWxsX05VTEwoIElOU1RfQUxMT0MgICpwbXMpCi17Ci0gICAgcG1zWzBdLlRvdGFsU2l6ZSA9IDM7Ci0gICAgcG1zWzBdLnBOZXh0TWVtYmVyID0gMDsKLQotCi0gICAgcG1zWzFdLlRvdGFsU2l6ZSA9IDM7Ci0gICAgcG1zWzFdLnBOZXh0TWVtYmVyID0gMDsKLQotICAgIHBtc1syXS5Ub3RhbFNpemUgPSAzOwotICAgIHBtc1syXS5wTmV4dE1lbWJlciA9IDA7Ci0KLSAgICBwbXNbM10uVG90YWxTaXplID0gMzsKLSAgICBwbXNbM10ucE5leHRNZW1iZXIgPSAwOwotCi19Ci0KLQotdm9pZCogICBJbnN0QWxsb2NfQWRkTWVtYmVyQWxsKCBJTlNUX0FMTE9DICAgICAgICAgICAgICAgICAgICAgKnBtcywKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIExWTV9VSU5UMzIgICAgICAgICAgICAgICAgICAgU2l6ZVtdLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTFZNX01lbW9yeVRhYmxlX3N0ICAgICAgICAgICAqcE1lbW9yeVRhYmxlKQotewotICAgIHZvaWQgKk5ld01lbWJlckFkZHJlc3M7IC8qIFZhcmlhYmxlIHRvIHRlbXBvcmFyaWx5IHN0b3JlIHRoZSByZXR1cm4gdmFsdWUgKi8KLQotICAgIC8qIGNvdmVyaXR5W3JldHVybmVkX3BvaW50ZXJdIElnbm9yZSBjb3Zlcml0eSB3YXJuaW5nIHRoYXQgcHRyIGlzIG5vdCB1c2VkICovCi0gICAgTmV3TWVtYmVyQWRkcmVzcyA9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qKioqKioqKioqKioqKioqKioqKioqKioqKgotICAgSU5DTFVERSBGSUxFUwotKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0KLSNpbmNsdWRlICJWZWN0b3JBcml0aG1ldGljLmgiCi0KLS8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCi0gICBGVU5DVElPTiBJTlQxNkxTSElGVFRPSU5UMzJfMTZYMzIKLSoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotCi12b2lkIEludDE2TFNoaWZ0VG9JbnQzMl8xNngzMihjb25zdCBMVk1fSU5UMTYgICAqc3JjLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTFZNX0lOVDMyICAgICAgICAgKmRzdCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIExWTV9JTlQxNiAgICAgICAgIG4sCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICBMVk1fSU5UMTYgICAgICAgICBzaGlmdCApCi17Ci0gICAgTFZNX0lOVDE2IGlpOwotCi0gICAgc3JjICs9IG4tMTsKLSAgICBkc3QgKz0gbi0xOwotCi0gICAgZm9yIChpaSA9IG47IGlpICE9IDA7IGlpLS0pCi0gICAgewotICAgICAgICAqZHN0ID0gKCAoKExWTV9JTlQzMikqc3JjKSA8PCBzaGlmdCk7Ci0gICAgICAgIHNyYy0tOwotICAgICAgICBkc3QtLTsKLSAgICB9Ci0KLSAgICByZXR1cm47Ci19Ci0KLS8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwpkaWZmIC0tZ2l0IGEvbWVkaWEvbGliZWZmZWN0cy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RiBBTlkgS0lORCwgZWl0aGVyIGV4cHJlc3Mgb3IgaW1wbGllZC4KLSAqIFNlZSB0aGUgTGljZW5zZSBmb3IgdGhlIHNwZWNpZmljIGxhbmd1YWdlIGdvdmVybmluZyBwZXJtaXNzaW9ucyBhbmQKLSAqIGxpbWl0YXRpb25zIHVuZGVyIHRoZSBMaWNlbnNlLgotICovCi0KLS8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCi0gICBJTkNMVURFIEZJTEVTCi0qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLQotI2luY2x1ZGUgIlZlY3RvckFyaXRobWV0aWMuaCIKLQotLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKLSAgIEZVTkNUSU9OIElOVDMyUlNISUZUVE9JTlQxNl9TQVRfMzJYMTYKLSoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotCi12b2lkIEludDMyUlNoaWZ0VG9JbnQxNl9TYXRfMzJ4MTYoY29uc3QgTFZNX0lOVDMyICAqc3JjLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIExWTV9JTlQxNiAqZHN0LAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIExWTV9JTlQxNiBuLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIExWTV9JTlQxNiBzaGlmdCApCi17Ci0gICAgTFZNX0lOVDMyIHRlbXA7Ci0gICAgTFZNX0lOVDE2IGlpOwotCi0gICAgZm9yIChpaSA9IG47IGlpICE9IDA7IGlpLS0pCi0gICAgewotICAgICAgICB0ZW1wID0gKnNyYyA+PiBzaGlmdDsKLSAgICAgICAgc3JjKys7Ci0KLSAgICAgICAgaWYgKHRlbXAgPiAweDAwMDA3RkZGKQotICAgICAgICB7Ci0gICAgICAgICAgICAqZHN0ID0gMHg3RkZGOwotICAgICAgICB9Ci0gICAgICAgIGVsc2UgaWYgKHRlbXAgPCAtMHgwMDAwODAwMCkKLSAgICAgICAgewotICAgICAgICAgICAgKmRzdCA9IC0gMHg4MDAwOwotICAgICAgICB9Ci0gICAgICAgIGVsc2UKLSAgICAgICAgewotICAgICAgICAgICAgKmRzdCA9IChMVk1fSU5UMTYpdGVtcDsKLSAgICAgICAgfQotCi0gICAgICAgIGRzdCsrOwotICAgIH0KLQotICAgIHJldHVybjsKLX0KLQotLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCmRpZmYgLS1naXQgYS9tZWRpYS9saWJlZmZlY3RzL2x2bS9saWIvQ29tbW9uL3NyYy9Kb2luVG8yaV8zMngzMi5jIGIvbWVkaWEvbGliZWZmZWN0cy9sdm0vbGliL0NvbW1vbi9zcmMvSm9pblRvMmlfMzJ4MzIuYwpkZWxldGVkIGZpbGUgbW9kZSAxMDA2NDQKaW5kZXggOWI5MzhiZC4uMDAwMDAwMAotLS0gYS9tZWRpYS9saWJlZmZlY3RzL2x2bS9saWIvQ29tbW9uL3NyYy9Kb2luVG8yaV8zMngzMi5jCisrKyAvZGV2L251bGwKQEAgLTEsNTQgKzAsMCBAQAotLyoKLSAqIENvcHlyaWdodCAoQykgMjAwNC0yMDEwIE5YUCBTb2Z0d2FyZQotICogQ29weXJpZ2h0IChDKSAyMDEwIFRoZSBBbmRyb2lkIE9wZW4gU291cmNlIFByb2plY3QKLSAqCi0gKiBMaWNlbnNlZCB1bmRlciB0aGUgQXBhY2hlIExpY2Vuc2UsIFZlcnNpb24gMi4wICh0aGUgIkxpY2Vuc2UiKTsKLSAqIHlvdSBtYXkgbm90IHVzZSB0aGlzIGZpbGUgZXhjZXB0IGluIGNvbXBsaWFuY2Ugd2l0aCB0aGUgTGljZW5zZS4KLSAqIFlvdSBtYXkgb2J0YWluIGEgY29weSBvZiB0aGUgTGljZW5zZSBhdAotICoKLSAqICAgICAgaHR0cDovL3d3dy5hcGFjaGUub3JnL2xpY2Vuc2VzL0xJQ0VOU0UtMi4wCi0gKgotICogVW5sZXNzIHJlcXVpcmVkIGJ5IGFwcGxpY2FibGUgbGF3IG9yIGFncmVlZCB0byBpbiB3cml0aW5nLCBzb2Z0d2FyZQotICogZGlzdHJpYnV0ZWQgdW5kZXIgdGhlIExpY2Vuc2UgaXMgZGlzdHJpYnV0ZWQgb24gYW4gIkFTIElTIiBCQVNJUywKLSAqIFdJVEhPVVQgV0FSUkFOVElFUyBPUiBDT05ESVRJT05TIE9GIEFOWSBLSU5ELCBlaXRoZXIgZXhwcmVzcyBvciBpbXBsaWVkLgotICogU2VlIHRoZSBMaWNlbnNlIGZvciB0aGUgc3BlY2lmaWMgbGFuZ3VhZ2UgZ292ZXJuaW5nIHBlcm1pc3Npb25zIGFuZAotICogbGltaXRhdGlvbnMgdW5kZXIgdGhlIExpY2Vuc2UuCi0gKi8KLQotLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKLSAgIElOQ0xVREUgRklMRVMKLSoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotCi0jaW5jbHVkZSAiVmVjdG9yQXJpdGhtZXRpYy5oIgotCi0vKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgotICAgRlVOQ1RJT04gSm9pblRvMmlfMzJ4MzIKLSoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotCi12b2lkIEpvaW5UbzJpXzMyeDMyKCBjb25zdCBMVk1fSU5UMzIgICAgKnNyY0wsCi0gICAgICAgICAgICAgICAgICAgICBjb25zdCBMVk1fSU5UMzIgICAgKnNyY1IsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICBMVk1fSU5UMzIgICAgKmRzdCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgIExWTV9JTlQxNiAgICBuICkKLXsKLSAgICBMVk1fSU5UMTYgaWk7Ci0KLSAgICBzcmNMICs9IG4tMTsKLSAgICBzcmNSICs9IG4tMTsKLSAgICBkc3QgICs9ICgoMipuKS0xKTsKLQotICAgIGZvciAoaWkgPSBuOyBpaSAhPSAwOyBpaS0tKQotICAgIHsKLSAgICAgICAgKmRzdCA9ICpzcmNSOwotICAgICAgICBkc3QtLTsKLSAgICAgICAgc3JjUi0tOwotCi0gICAgICAgICpkc3QgPSAqc3JjTDsKLSAgICAgICAgZHN0LS07Ci0gICAgICAgIHNyY0wtLTsKLSAgICB9Ci0KLSAgICByZXR1cm47Ci19Ci0KLS8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotCmRpZmYgLS1naXQgYS9tZWRpYS9saWJlZmZlY3RzL2x2bS9saWIvQ29tbW9uL3NyYy9MVkNfQ29yZV9NaXhIYXJkXzFTdF8yaV9EMTZDMzFfU0FULmMgYi9tZWRpYS9saWJlZmZlY3RzL2x2bS9saWIvQ29tbW9uL3NyYy9MVkNfQ29yZV9NaXhIYXJkXzFTdF8yaV9EMTZDMzFfU0FULmMKZGVsZXRlZCBmaWxlIG1vZGUgMTAwNjQ0CmluZGV4IDNkMzliOTMuLjAwMDAwMDAKLS0tIGEvbWVkaWEvbGliZWZmZWN0cy9sdm0vbGliL0NvbW1vbi9zcmMvTFZDX0N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KioKLSAgIElOQ0xVREUgRklMRVMKLSoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotCi0jaW5jbHVkZSAiTFZDX01peGVyX1ByaXZhdGUuaCIKLSNpbmNsdWRlICJMVk1fTWFjcm9zLmgiCi0jaW5jbHVkZSAiU2NhbGFyQXJpdGhtZXRpYy5oIgotCi0KLS8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCi0gICBGVU5DVElPTiBMVkNfQ29yZV9NaXhIYXJkXzFTdF8yaV9EMTZDMzFfU0FUCi0qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLQotdm9pZCBMVkNfQ29yZV9NaXhIYXJkXzFTdF8yaV9EMTZDMzFfU0FUKCBMVk1peGVyM19zdCAgICAgICAgKnB0ckluc3RhbmNlMSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTFZNaXhlcjNfc3QgICAgICAgICpwdHJJbnN0YW5jZTIsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbnN0IExWTV9JTlQxNiAgICAqc3JjLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBMVk1fSU5UMTYgICAgICAgICAgKmRzdCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTFZNX0lOVDE2ICAgICAgICAgIG4pCi17Ci0gICAgTFZNX0lOVDMyICBUZW1wOwotICAgIExWTV9JTlQxNiBpaTsKLSAgICBMVk1fSU5UMTYgQ3VycmVudDFTaG9ydDsKLSAgICBMVk1fSU5UMTYgQ3VycmVudDJTaG9ydDsKLSAgICBNaXhfUHJpdmF0ZV9zdC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Rpc3RyaWJ1dGVkIHVuZGVyIHRoZSBMaWNlbnNlIGlzIGRpc3RyaWJ1dGVkIG9uIGFuICJBUyBJUyIgQkFTSVMsCi0gKiBXSVRIT1VUIFdBUlJBTlRJRVMgT1IgQ09ORElUSU9OUyBPRiBBTlkgS0lORCwgZWl0aGVyIGV4cHJlc3Mgb3IgaW1wbGllZC4KLSAqIFNlZSB0aGUgTGljZW5zZSBmb3IgdGhlIHNwZWNpZmljIGxhbmd1YWdlIGdvdmVybmluZyBwZXJtaXNzaW9ucyBhbmQKLSAqIGxpbWl0YXRpb25zIHVuZGVyIHRoZSBMaWNlbnNlLgotICovCi0KLS8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCi0gICBJTkNMVURFIEZJTEVTCi0qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLQotI2luY2x1ZGUgIkxWQ19NaXhlcl9Qcml2YXRlLmgiCi0KLS8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCi0gICBGVU5DVElPTiBMVkNvcmVfTUlYSEFSRF8yU1RfRDE2QzMxX1NBVAotKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0KLXZvaWQgTFZDX0NvcmVfTWl4SGFyZF8yU3RfRDE2QzMxX1NBVCggTFZNaXhlcjNfc3QgKnB0ckluc3RhbmNlMSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIExWTWl4ZXIzX3N0ICAgICAgICAgKnB0ckluc3RhbmNlMiwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbnN0IExWTV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FjaGUub3JnL2xpY2Vuc2VzL0xJQ0VOU0UtMi4wCi0gKgotICogVW5sZXNzIHJlcXVpcmVkIGJ5IGFwcGxpY2FibGUgbGF3IG9yIGFncmVlZCB0byBpbiB3cml0aW5nLCBzb2Z0d2FyZQotICogZGlzdHJpYnV0ZWQgdW5kZXIgdGhlIExpY2Vuc2UgaXMgZGlzdHJpYnV0ZWQgb24gYW4gIkFTIElTIiBCQVNJUywKLSAqIFdJVEhPVVQgV0FSUkFOVElFUyBPUiBDT05ESVRJT05TIE9GIEFOWSBLSU5ELCBlaXRoZXIgZXhwcmVzcyBvciBpbXBsaWVkLgotICogU2VlIHRoZSBMaWNlbnNlIGZvciB0aGUgc3BlY2lmaWMgbGFuZ3VhZ2UgZ292ZXJuaW5nIHBlcm1pc3Npb25zIGFuZAotICogbGltaXRhdGlvbnMgdW5kZXIgdGhlIExpY2Vuc2UuCi0gKi8KLQotLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKLSAgIElOQ0xVREUgRklMRVMKLSoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotCi0jaW5jbHVkZSAiTFZDX01peGVyX1ByaXZhdGUuaCIKLSNpbmNsdWRlICJMVk1fTWFjcm9zLmgiCi0KLS8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCi0gICBGVU5DVElPTiBMVkNvcmVfTUlYU09GVF8xU1RfRDE2QzMxX1dSQQotKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0KLXZvaWQgTFZDX0NvcmVfTWl4SW5Tb2Z0X0QxNkMzMV9TQVQoIExWTWl4ZXIzX3N0ICpwdHJJbnN0YW5jZSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbnN0IExWTV9JTlQxNiAgICAgKnNyYywKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIExWTV9JTlQxNiAgICAgKmRzdCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIExWTV9JTlQxNiAgICAgbikKLXsKLQotICAgIExWTV9JTlQxNiAgIE91dExvb3A7Ci0gICAgTFZNX0lOVDE2ICAgSW5Mb29wOwotICAgIExWTV9JTlQxNiAgIEN1cnJlbnRTaG9ydDsKLSAgICBMVk1fSU5UMzIgICBpaSxqajsKLSAgICBNaXhfUHJpdmF0ZV9zdCAgKnBJbnN0YW5jZT0oTWl4X1ByaXZhdGVfc3QgKikocHRySW5zdGFuY2UtPlByaXZhdGVQYXJhbXMpOwotICAgIExWTV9JTlQzMiAgIERlbHRhPXBJbnN0YW5jZS0+RGVsdGE7Ci0gICAgTFZNX0lOVDMyICAgQ3VycmVudD1wSW5zdGFuY2UtPkN1cnJlbnQ7Ci0gICAgTFZNX0lOVDMyICAgVGFyZ2V0PXBJbnN0YW5jZS0+VGFyZ2V0OwotICAgIExWTV9JTlQzMiAgIFRlbXA7Ci0KLSAgICBJbkxvb3AgPSAoTFZNX0lOVDE2KShuID4+IDIpOyAvKiBQcm9jZXNzIHBlciA0IHNhbXBsZXMgKi8KLSAgICBPdXRMb29wID0gKExWTV9JTlQxNikobiAtIChJbkxvb3AgPDwgMikpOwotCi0gICAgaWYoQ3VycmVudDxUYXJnZXQpewotICAgICAgICBpZiAoT3V0TG9vcCl7Ci0gICAgICAgICAgICBBREQyX1NBVF8zMngzMihDdXJyZW50LERlbHRhLFRlbXApOyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLyogUTMxICsgUTMxIGludG8gUTMxKi8KLSAgICAgICAgICAgIEN1cnJlbnQ9VGVtcDsKLSAgICAgICAgICAgIGlmIChDdXJyZW50ID4gVGFyZ2V0KQotICAgICAgICAgICAgICAgIEN1cnJlbnQgPSBUYXJnZXQ7Ci0KLSAgICAgICAgICAgIEN1cnJlbnRTaG9ydCA9IChMVk1fSU5UMTYpKEN1cnJlbnQ+PjE2KTsgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvKiBGcm9tIFEzMSB0byBRMTUqLwotCi0gICAgICAgICAgICBmb3IgKGlpID0gT3V0TG9vcDsgaWkgIT0gMDsgaWktLSl7Ci0gICAgICAgICAgICAgICAgVGVtcCA9ICgoTFZNX0lOVDMyKSpkc3QpICsgKCgoTFZNX0lOVDMyKSooc3JjKyspICogQ3VycmVudFNob3J0KT4+MTUpOyAgICAgIC8qIFExNSArIFExNSpRMTU+PjE1IGludG8gUTE1ICovCi0gICAgICAgICAgICAgICAgaWYgKFRlbXAgPiAweDAwMDA3RkZGKQotICAgICAgICAgICAgICAgICAgICAqZHN0KysgPSAweDdGRkY7Ci0gICAgICAgICAgICAgICAgZWxzZSBpZiAoVGVtcCA8IC0weDAwMDA4MDAwKQotICAgICAgICAgICAgICAgICAgICAqZHN0KysgPSAtIDB4ODAwMDsKLSAgICAgICAgICAgICAgICBlbHNlCi0gICAgICAgICAgICAgICAgICAgICpkc3QrKyA9IChMVk1fSU5UMTYpVGVtcDsKLSAgICAgICAgICAgIH0KLSAgICAgICAgfQotCi0gICAgICAgIGZvciAoaWkgPSBJbkxvb3A7IGlpICE9IDA7IGlpLS0pewotICAgICAgICAgICAgQUREMl9TQVRfMzJ4MzIoQ3VycmVudCxEZWx0YSxUZW1wKTsgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8qIFEzMSArIFEzMSBpbnRvIFEzMSovCi0gICAgICAgICAgICBDdXJyZW50PVRlbXA7Ci0gICAgICAgICAgICBpZiAoQ3VycmVudCA+IFRhcmdldCkKLSAgICAgICAgICAgICAgICBDdXJyZW50ID0gVGFyZ2V0OwotCi0gICAgICAgICAgICBDdXJyZW50U2hvcnQgPSAoTFZNX0lOVDE2KShDdXJyZW50Pj4xNik7ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLyogRnJvbSBRMzEgdG8gUTE1Ki8KLQotICAgICAgICAgICAgZm9yIChqaiA9IDQ7IGpqIT0wIDsgamotLSl7Ci0gICAgICAgICAgICAgICAgVGVtcCA9ICgoTFZNX0lOVDMyKSpkc3QpICsgKCgoTFZNX0lOVDMyKSooc3JjKyspICogQ3VycmVudFNob3J0KT4+MTUpOyAgICAgIC8qIFExNSArIFExNSpRMTU+PjE1IGludG8gUTE1ICovCi0gICAgICAgICAgICAgICAgaWYgKFRlbXAgPiAweDAwMDA3RkZGKQotICAgICAgICAgICAgICAgICAgICAqZHN0KysgPSAweDdGRkY7Ci0gICAgICAgICAgICAgICAgZWxzZSBpZiAoVGVtcCA8IC0weDAwMDA4MDAwKQotICAgICAgICAgICAgICAgICAgICAqZHN0KysgPSAtIDB4ODAwMDsKLSAgICAgICAgICAgICAgICBlbHNlCi0gICAgICAgICAgICAgICAgICAgICpkc3QrKyA9IChMVk1fSU5UMTYpVGVtcDsKLSAgICAgICAgICAgIH0KLSAgICAgICAgfQotICAgIH0KLSAgICBlbHNlewotICAgICAgICBpZiAoT3V0TG9vcCl7Ci0gICAgICAgICAgICBDdXJyZW50IC09IERlbHRhOyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLyogUTMxICsgUTMxIGludG8gUTMxKi8KLSAgICAgICAgICAgIGlmIChDdXJyZW50IDwgVGFyZ2V0KQotICAgICAgICAgICAgICAgIEN1cnJlbnQgPSBUYXJnZXQ7Ci0KLSAgICAgICAgICAgIEN1cnJlbnRTaG9ydCA9IChMVk1fSU5UMTYpKEN1cnJlbnQ+PjE2KTsgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvKiBGcm9tIFEzMSB0byBRMTUqLwotCi0gICAgICAgICAgICBmb3IgKGlpID0gT3V0TG9vcDsgaWkgIT0gMDsgaWktLSl7Ci0gICAgICAgICAgICAgICAgVGVtcCA9ICgoTFZNX0lOVDMyKSpkc3QpICsgKCgoTFZNX0lOVDMyKSooc3JjKyspICogQ3VycmVudFNob3J0KT4+MTUpOyAgICAgIC8qIFExNSArIFExNSpRMTU+PjE1IGludG8gUTE1ICovCi0gICAgICAgICAgICAgICAgaWYgKFRlbXAgPiAweDAwMDA3RkZGKQotICAgICAgICAgICAgICAgICAgICAqZHN0KysgPSAweDdGRkY7Ci0gICAgICAgICAgICAgICAgZWxzZSBpZiAoVGVtcCA8IC0weDAwMDA4MDAwKQotICAgICAgICAgICAgICAgICAgICAqZHN0KysgPSAtIDB4ODAwMDsKLSAgICAgICAgICAgICAgICBlbHNlCi0gICAgICAgICAgICAgICAgICAgICpkc3QrKyA9IChMVk1fSU5UMTYpVGVtcDsKLSAgICAgICAgICAgIH0KLSAgICAgICAgfQotCi0gICAgICAgIGZvciAoaWkgPSBJbkxvb3A7IGlpICE9IDA7IGlpLS0pewotICAgICAgICAgICAgQ3VycmVudCAtPSBEZWx0YTsgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8qIFEzMSArIFEzMSBpbnRvIFEzMSovCi0gICAgICAgICAgICBpZiAoQ3VycmVudCA8IFRhcmdldCkKLSAgICAgICAgICAgICAgICBDdXJyZW50ID0gVGFyZ2V0OwotCi0gICAgICAgICAgICBDdXJyZW50U2hvcnQgPSAoTFZNX0lOVDE2KShDdXJyZW50Pj4xNik7ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLyogRnJvbSBRMzEgdG8gUTE1Ki8KLQotICAgICAgICAgICAgZm9yIChqaiA9IDQ7IGpqIT0wIDsgamotLSl7Ci0gICAgICAgICAgICAgICAgVGVtcCA9ICgoTFZNX0lOVDMyKSpkc3QpICsgKCgoTFZNX0lOVDMyKSooc3JjKyspICogQ3VycmVudFNob3J0KT4+MTUpOyAgICAgIC8qIFExNSArIFExNSpRMTU+PjE1IGludG8gUTE1ICovCi0gICAgICAgICAgICAgICAgaWYgKFRlbXAgPiAweDAwMDA3RkZGKQotICAgICAgICAgICAgICAgICAgICAqZHN0KysgPSAweDdGRkY7Ci0gICAgICAgICAgICAgICAgZWxzZSBpZiAoVGVtcCA8IC0weDAwMDA4MDAwKQotICAgICAgICAgICAgICAgICAgICAqZHN0KysgPSAtIDB4ODAwMDsKLSAgICAgICAgICAgICAgICBlbHNlCi0gICAgICAgICAgICAgICAgICAgICpkc3QrKyA9IChMVk1fSU5UMTYpVGVtcDsKLSAgICAgICAgICAgIH0KLSAgICAgICAgfQotICAgIH0KLSAgICBwSW5zdGFuY2UtPkN1cnJlbnQ9Q3VycmVudDsKLX0KLQotCi0vKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KZGlmZiAtLWdpdCBhL21lZGlhL2xpYmVmZmVjdHMvbHZtL2xpYi9Db21tb24vc3JjL0xWQ19Db3JlX01peFNvZnRfMVN0XzJpX0QxNkMzMV9XUkEuYyBiL21lZGlhL2xpYmVmZmVjdHMvbHZtL2xpYi9Db21tb24vc3JjL0xWQ19Db3JlX01peFNvZnRfMVN0XzJpX0QxNkMzMV9XUkEuYwpkZWxldGVkIGZpbGUgbW9kZSAxMDA2NDQKaW5kZXggMDllYzQyNy4uMDAwMDAwMAotLS0gYS9tZWRpYS9saWJlZmZlY3RzL2x2bS9saWIvQ29tbW9uL3NyYy9MVkNfQ29yZV9NaXhTb2Z0XzFTdF8yaV9EMTZDMzFfV1JBLmMKKysrIC9kZXYvbnVsbApAQCAtMSwxNDMgKzAsMCBAQAotLyoKLSAqIENvcHlyaWdodCAoQykgMjAwNC0yMDEwIE5YUCBTb2Z0d2FyZQotICogQ29weXJpZ2h0IChDKSAyMDEwIFRoZSBBbmRyb2lkIE9wZW4gU291cmNlIFByb2plY3QKLSAqC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TFZNX01hY3Jvcy5oIgotCi0vKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgotICAgRlVOQ1RJT04gTFZDX0NvcmVfTWl4U29mdF8xU3RfMmlfRDE2QzMxX1dSQQotKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0KLXZvaWQgTFZDX0NvcmVfTWl4U29mdF8xU3RfMmlfRDE2QzMxX1dSQSggTFZNaXhlcjNfc3QgICAgICAgICpwdHJJbnN0YW5jZTEsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIExWTWl4ZXIzX3N0ICAgICAgICAqcHRySW5zdGFuY2UyLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb25zdCBMVk1fSU5UMTYgICAgKnNyYywKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTFZNX0lOVDE2ICAgICAgICAgICpkc3QsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIExWTV9JTlQxNiAgICAgICAgICBuKQotewotICAgIExWTV9JTlQxNiAgIE91dExvb3A7Ci0gICAgTFZNX0lOVDE2ICAgSW5Mb29wOwotICAgIExWTV9JTlQxNiAgIEN1cnJlbnRTaG9ydEw7Ci0gICAgTFZNX0lOVDE2ICAgQ3VycmVudFNob3J0UjsKLSAgICBMVk1fSU5UMzIgICBpaTsKLSAgICBNaXhfUHJpdmF0ZV9zdCAgKnBJbnN0YW5jZUw9KE1peF9Qcml2YXRlX3N0ICopKHB0ckluc3RhbmNlMS0+UHJpdmF0ZVBhcmFtcyk7Ci0gICAgTWl4X1ByaXZhdGVfc3QgICpwSW5zdGFuY2VSPShNaXhfUHJpdmF0ZV9zdCAqKShwdHJJbnN0YW5jZTItPlByaXZhdGVQYXJhbXMpOwotCi0gICAgTFZNX0lOVDMyICAgRGVsdGFMPXBJbnN0YW5jZUwtPkRlbHRhOwotICAgIExWTV9JTlQzMiAgIEN1cnJlbnRMPXBJbnN0YW5jZUwtPkN1cnJlbnQ7Ci0gICAgTFZNX0lOVDMyICAgVGFyZ2V0TD1wSW5zdGFuY2VMLT5UYXJnZXQ7Ci0KLSAgICBMVk1fSU5UMzIgICBEZWx0YVI9cEluc3RhbmNlUi0+RGVsdGE7Ci0gICAgTFZNX0lOVDMyICAgQ3VycmVudFI9cEluc3RhbmNlUi0+Q3VycmVudDsKLSAgICBMVk1fSU5UMzIgICBUYXJnZXRSPXBJbnN0YW5jZVItPlRhcmdldDsKLQotICAgIExWTV9JTlQzMiAgIFRlbXA7Ci0KLSAgICBJbkxvb3AgPSAoTFZNX0lOVDE2KShuID4+IDIpOyAvKiBQcm9jZXNzIHBlciA0IHNhbXBsZXMgKi8KLSAgICBPdXRMb29wID0gKExWTV9JTlQxNikobiAtIChJbkxvb3AgPDwgMikpOwotCi0gICAgaWYgKE91dExvb3ApCi0gICAgewotICAgICAgICBpZihDdXJyZW50TDxUYXJnZXRMKQotICAgICAgICB7Ci0gICAgICAgICAgICBBREQyX1NBVF8zMngzMihDdXJyZW50TCxEZWx0YUwsVGVtcCk7ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvKiBRMzEgKyBRMzEgaW50byBRMzEqLwotICAgICAgICAgICAgQ3VycmVudEw9VGVtcDsKLSAgICAgICAgICAgIGlmIChDdXJyZW50TCA+IFRhcmdldEwpCi0gICAgICAgICAgICAgICAgQ3VycmVudEwgPSBUYXJnZXRMOwotICAgICAgICB9Ci0gICAgICAgIGVsc2UKLSAgICAgICAgewotICAgICAgICAgICAgQ3VycmVudEwgLT0gRGVsdGFMOyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLyogUTMxICsgUTMxIGludG8gUTMxKi8KLSAgICAgICAgICAgIGlmIChDdXJyZW50TCA8IFRhcmdldEwpCi0gICAgICAgICAgICAgICAgQ3VycmVudEwgPSBUYXJnZXRMOwotICAgICAgICB9Ci0KLSAgICAgICAgaWYoQ3VycmVudFI8VGFyZ2V0UikKLSAgICAgICAgewotICAgICAgICAgICAgQUREMl9TQVRfMzJ4MzIoQ3VycmVudFIsRGVsdGFSLFRlbXApOyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLyogUTMxICsgUTMxIGludG8gUTMxKi8KLSAgICAgICAgICAgIEN1cnJlbnRSPVRlbXA7Ci0gICAgICAgICAgICBpZiAoQ3VycmVudFIgPiBUYXJnZXRSKQotICAgICAgICAgICAgICAgIEN1cnJlbnRSID0gVGFyZ2V0UjsKLSAgICAgICAgfQotICAgICAgICBlbHNlCi0gICAgICAgIHsKLSAgICAgICAgICAgIEN1cnJlbnRSIC09IERlbHRhUjsgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8qIFEzMSArIFEzMSBpbnRvIFEzMSovCi0gICAgICAgICAgICBpZiAoQ3VycmVudFIgPCBUYXJnZXRSKQotICAgICAgICAgICAgICAgIEN1cnJlbnRSID0gVGFyZ2V0UjsKLSAgICAgICAgfQotCi0gICAgICAgIEN1cnJlbnRTaG9ydEwgPSAoTFZNX0lOVDE2KShDdXJyZW50TD4+MTYpOyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8qIEZyb20gUTMxIHRvIFExNSovCi0gICAgICAgIEN1cnJlbnRTaG9ydFIgPSAoTFZNX0lOVDE2KShDdXJyZW50Uj4+MTYpOyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8qIEZyb20gUTMxIHRvIFExNSovCi0KLSAgICAgICAgZm9yIChpaSA9IE91dExvb3AqMjsgaWkgIT0gMDsgaWktPTIpCi0gICAgICAgIHsKLSAgICAgICAgICAgICooZHN0KyspID0gKExWTV9JTlQxNikoKChMVk1fSU5UMzIpKihzcmMrKykgKiAoTFZNX0lOVDMyKUN1cnJlbnRTaG9ydEwpPj4xNSk7ICAgIC8qIFExNSpRMTU+PjE1IGludG8gUTE1ICovCi0gICAgICAgICAgICAqKGRzdCsrKSA9IChMVk1fSU5UMTYpKCgoTFZNX0lOVDMyKSooc3JjKyspICogKExWTV9JTlQzMilDdXJyZW50U2hvcnRSKT4+MTUpOyAgICAvKiBRMTUqUTE1Pj4xNSBpbnRvIFExNSAqLwotICAgICAgICB9Ci0gICAgfQotCi0gICAgZm9yIChpaSA9IEluTG9vcCoyOyBpaSAhPSAwOyBpaS09MikKLSAgICB7Ci0gICAgICAgIGlmKEN1cnJlbnRMPFRhcmdldEwpCi0gICAgICAgIHsKLSAgICAgICAgICAgIEFERDJfU0FUXzMyeDMyKEN1cnJlbnRMLERlbHRhTCxUZW1wKTsgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8qIFEzMSArIFEzMSBpbnRvIFEzMSovCi0gICAgICAgICAgICBDdXJyZW50TD1UZW1wOwotICAgICAgICAgICAgaWYgKEN1cnJlbnRMID4gVGFyZ2V0TCkKLSAgICAgICAgICAgICAgICBDdXJyZW50TCA9IFRhcmdldEw7Ci0gICAgICAgIH0KLSAgICAgICAgZWxzZQotICAgICAgICB7Ci0gICAgICAgICAgICBDdXJyZW50TCAtPSBEZWx0YUw7ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvKiBRMzEgKyBRMzEgaW50byBRMzEqLwotICAgICAgICAgICAgaWYgKEN1cnJlbnRMIDwgVGFyZ2V0TCkKLSAgICAgICAgICAgICAgICBDdXJyZW50TCA9IFRhcmdldEw7Ci0gICAgICAgIH0KLQotICAgICAgICBpZihDdXJyZW50UjxUYXJnZXRSKQotICAgICAgICB7Ci0gICAgICAgICAgICBBREQyX1NBVF8zMngzMihDdXJyZW50UixEZWx0YVIsVGVtcCk7ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvKiBRMzEgKyBRMzEgaW50byBRMzEqLwotICAgICAgICAgICAgQ3VycmVudFI9VGVtcDsKLSAgICAgICAgICAgIGlmIChDdXJyZW50UiA+IFRhcmdldFIpCi0gICAgICAgICAgICAgICAgQ3VycmVudFIgPSBUYXJnZXRSOwotICAgICAgICB9Ci0gICAgICAgIGVsc2UKLSAgICAgICAgewotICAgICAgICAgICAgQ3VycmVudFIgLT0gRGVsdGFSOyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLyogUTMxICsgUTMxIGludG8gUTMxKi8KLSAgICAgICAgICAgIGlmIChDdXJyZW50UiA8IFRhcmdldFIpCi0gICAgICAgICAgICAgICAgQ3VycmVudFIgPSBUYXJnZXRSOwotICAgICAgICB9Ci0KLSAgICAgICAgQ3VycmVudFNob3J0TCA9IChMVk1fSU5UMTYpKEN1cnJlbnRMPj4xNik7ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLyogRnJvbSBRMzEgdG8gUTE1Ki8KLSAgICAgICAgQ3VycmVudFNob3J0UiA9IChMVk1fSU5UMTYpKEN1cnJlbnRSPj4xNik7ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLyogRnJvbSBRMzEgdG8gUTE1Ki8KLQotICAgICAgICAqKGRzdCsrKSA9IChMVk1fSU5UMTYpKCgoTFZNX0lOVDMyKSooc3JjKyspICogKExWTV9JTlQzMilDdXJyZW50U2hvcnRMKT4+MTUpOyAgICAvKiBRMTUqUTE1Pj4xNSBpbnRvIFExNSAqLwotICAgICAgICAqKGRzdCsrKSA9IChMVk1fSU5UMTYpKCgoTFZNX0lOVDMyKSooc3JjKyspICogKExWTV9JTlQzMilDdXJyZW50U2hvcnRSKT4+MTUpOyAgICAvKiBRMTUqUTE1Pj4xNSBpbnRvIFExNSAqLwotICAgICAgICAqKGRzdCsrKSA9IChMVk1fSU5UMTYpKCgoTFZNX0lOVDMyKSooc3JjKyspICogKExW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KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgotICAgSU5DTFVERSBGSUxFUwotKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0KLSNpbmNsdWRlICJMVkNfTWl4ZXJfUHJpdmF0ZS5oIgotI2luY2x1ZGUgIkxWTV9NYWNyb3MuaCIKLSNpbmNsdWRlICJTY2FsYXJBcml0aG1ldGljLmgiCi0KLS8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCi0gICBGVU5DVElPTiBMVkNvcmVfTUlYU09GVF8xU1RfRDE2QzMxX1dSQQotKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0KLXZvaWQgTFZDX0NvcmVfTWl4U29mdF8xU3RfRDE2QzMxX1dSQSggTFZNaXhlcjNfc3QgKnB0ckluc3RhbmNlLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY29uc3QgTFZNX0lOVDE2ICAgICAqc3JjLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTFZNX0lOVDE2ICAgICAqZHN0LAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTFZNX0lOVDE2ICAgICBuKQotewotICAgIExWTV9JTlQxNiAgIE91dExvb3A7Ci0gICAgTFZNX0lOVDE2ICAgSW5Mb29wOwotICAgIExWTV9JTlQxNiAgIEN1cnJlbnRTaG9ydDsKLSAgICBMVk1fSU5UMzIgICBpaTsKLSAgICBNaXhfUHJpdmF0ZV9zdCAgKnBJbnN0YW5jZT0oTWl4X1ByaXZhdGVfc3QgKikocHRySW5zdGFuY2UtPlByaXZhdGVQYXJhbXMpOwotICAgIExWTV9JTlQzMiAgIERlbHRhPXBJbnN0YW5jZS0+RGVsdGE7Ci0gICAgTFZNX0lOVDMyICAgQ3VycmVudD1wSW5zdGFuY2UtPkN1cnJlbnQ7Ci0gICAgTFZNX0lOVDMyICAgVGFyZ2V0PXBJbnN0YW5jZS0+VGFyZ2V0OwotICAgIExWTV9JTlQzMiAgIFRlbXA7Ci0KLSAgICBJbkxvb3AgPSAoTFZNX0lOVDE2KShuID4+IDIpOyAvKiBQcm9jZXNzIHBlciA0IHNhbXBsZXMgKi8KLSAgICBPdXRMb29wID0gKExWTV9JTlQxNikobiAtIChJbkxvb3AgPDwgMikpOwotCi0gICAgaWYoQ3VycmVudDxUYXJnZXQpewotICAgICAgICBpZiAoT3V0TG9vcCl7Ci0gICAgICAgICAgICBBREQyX1NBVF8zMngzMihDdXJyZW50LERlbHRhLFRlbXApOyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLyogUTMxICsgUTMxIGludG8gUTMxKi8KLSAgICAgICAgICAgIEN1cnJlbnQ9VGVtcDsKLSAgICAgICAgICAgIGlmIChDdXJyZW50ID4gVGFyZ2V0KQotICAgICAgICAgICAgICAgIEN1cnJlbnQgPSBUYXJnZXQ7Ci0KLSAgICAgICAgICAgIEN1cnJlbnRTaG9ydCA9IChMVk1fSU5UMTYpKEN1cnJlbnQ+PjE2KTsgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvKiBGcm9tIFEzMSB0byBRMTUqLwotCi0gICAgICAgICAgICBmb3IgKGlpID0gT3V0TG9vcDsgaWkgIT0gMDsgaWktLSl7Ci0gICAgICAgICAgICAgICAgKihkc3QrKykgPSAoTFZNX0lOVDE2KSgoKExWTV9JTlQzMikqKHNyYysrKSAqIChMVk1fSU5UMzIpQ3VycmVudFNob3J0KT4+MTUpOyAgICAvKiBRMTUqUTE1Pj4xNSBpbnRvIFExNSAqLwotICAgICAgICAgICAgfQotICAgICAgICB9Ci0KLSAgICAgICAgZm9yIChpaSA9IEluTG9vcDsgaWkgIT0gMDsgaWktLSl7Ci0gICAgICAgICAgICBBREQyX1NBVF8zMngzMihDdXJyZW50LERlbHRhLFRlbXApOyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLyogUTMxICsgUTMxIGludG8gUTMxKi8KLSAgICAgICAgICAgIEN1cnJlbnQ9VGVtcDsKLSAgICAgICAgICAgIGlmIChDdXJyZW50ID4gVGFyZ2V0KQotICAgICAgICAgICAgICAgIEN1cnJlbnQgPSBUYXJnZXQ7Ci0KLSAgICAgICAgICAgIEN1cnJlbnRTaG9ydCA9IChMVk1fSU5UMTYpKEN1cnJlbnQ+PjE2KTsgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvKiBGcm9tIFEzMSB0byBRMTUqLwotCi0gICAgICAgICAgICAqKGRzdCsrKSA9IChMVk1fSU5UMTYpKCgoTFZNX0lOVDMyKSooc3JjKyspICogKExWTV9JTlQzMilDdXJyZW50U2hvcnQpPj4xNSk7ICAgIC8qIFExNSpRMTU+PjE1IGludG8gUTE1ICovCi0gICAgICAgICAgICAqKGRzdCsrKSA9IChMVk1fSU5UMTYpKCgoTFZNX0lOVDMyKSooc3JjKyspICogKExWTV9JTlQzMilDdXJyZW50U2hvcnQpPj4xNSk7Ci0gICAgICAgICAgICAqKGRzdCsrKSA9IChMVk1fSU5UMTYpKCgoTFZNX0lOVDMyKSooc3JjKyspICogKExWTV9JTlQzMilDdXJyZW50U2hvcnQpPj4xNSk7Ci0gICAgICAgICAgICAqKGRzdCsrKSA9IChMVk1fSU5UMTYpKCgoTFZNX0lOVDMyKSooc3JjKyspICogKExWTV9JTlQzMilDdXJyZW50U2hvcnQpPj4xNSk7Ci0gICAgICAgIH0KLSAgICB9Ci0gICAgZWxzZXsKLSAgICAgICAgaWYgKE91dExvb3ApewotICAgICAgICAgICAgQ3VycmVudCAtPSBEZWx0YTsgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8qIFEzMSArIFEzMSBpbnRvIFEzMSovCi0gICAgICAgICAgICBpZiAoQ3VycmVudCA8IFRhcmdldCkKLSAgICAgICAgICAgICAgICBDdXJyZW50ID0gVGFyZ2V0OwotCi0gICAgICAgICAgICBDdXJyZW50U2hvcnQgPSAoTFZNX0lOVDE2KShDdXJyZW50Pj4xNik7ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLyogRnJvbSBRMzEgdG8gUTE1Ki8KLQotICAgICAgICAgICAgZm9yIChpaSA9IE91dExvb3A7IGlpICE9IDA7IGlpLS0pewotICAgICAgICAgICAgICAgICooZHN0KyspID0gKExWTV9JTlQxNikoKChMVk1fSU5UMzIpKihzcmMrKykgKiAoTFZNX0lOVDMyKUN1cnJlbnRTaG9ydCk+PjE1KTsgICAgLyogUTE1KlExNT4+MTUgaW50byBRMTUgKi8KLSAgICAgICAgICAgIH0KLSAgICAgICAgfQotCi0gICAgICAgIGZvciAoaWkgPSBJbkxvb3A7IGlpICE9IDA7IGlpLS0pewotICAgICAgICAgICAgQ3VycmVudCAtPSBEZWx0YTsgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8qIFEzMSArIFEzMSBpbnRvIFEzMSovCi0gICAgICAgICAgICBpZiAoQ3VycmVudCA8IFRhcmdldCkKLSAgICAgICAgICAgICAgICBDdXJyZW50ID0gVGFyZ2V0OwotCi0gICAgICAgICAgICBDdXJyZW50U2hvcnQgPSAoTFZNX0lOVDE2KShDdXJyZW50Pj4xNik7ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLyogRnJvbSBRMzEgdG8gUTE1Ki8KLQotICAgICAgICAgICAgKihkc3QrKykgPSAoTFZNX0lOVDE2KSgoKExWTV9JTlQzMikqKHNyYysrKSAqIChMVk1fSU5UMzIpQ3VycmVudFNob3J0KT4+MTUpOyAgICAvKiBRMTUqUTE1Pj4xNSBpbnRvIFExNSAqLwotICAgICAgICAgICAgKihkc3QrKykgPS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oZSAiTGljZW5zZSIpOwotICogeW91IG1heSBub3QgdXNlIHRoaXMgZmlsZSBleGNlcHQgaW4gY29tcGxpYW5jZSB3aXRoIHRoZSBMaWNlbnNlLgotICogWW91IG1heSBvYnRhaW4gYSBjb3B5IG9mIHRoZSBMaWNlbnNlIGF0Ci0gKgotICogICAgICBodHRwOi8vd3d3LmFwYWNoZS5vcmcvbGljZW5zZXMvTElDRU5TRS0yLjAKLSAqCi0gKiBVbmxlc3MgcmVxdWlyZWQgYnkgYXBwbGljYWJsZSBsYXcgb3IgYWdyZWVkIHRvIGluIHdyaXRpbmcsIHNvZnR3YXJlCi0gKiBkaXN0cmlidXRlZCB1bmRlciB0aGUgTGljZW5zZSBpcyBkaXN0cmlidXRlZCBvbiBhbiAiQVMgSVMiIEJBU0lTLAotICogV0lUSE9VVCBXQVJSQU5USUVTIE9SIENPTkRJVElPTlMgT0YgQU5ZIEtJTkQsIGVpdGhlciBleHByZXNzIG9yIGltcGxpZWQuCi0gKiBTZWUgdGhlIExpY2Vuc2UgZm9yIHRoZSBzcGVjaWZpYyBsYW5ndWFnZSBnb3Zlcm5pbmcgcGVybWlzc2lvbnMgYW5kCi0gKiBsaW1pdGF0aW9ucyB1bmRlciB0aGUgTGljZW5zZS4KLSAqLwotCi0vKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgotICAgSU5DTFVERSBGSUxFUwotKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0KLSNpbmNsdWRlICJMVkNfTWl4ZXJfUHJpdmF0ZS5oIgotI2luY2x1ZGUgIlZlY3RvckFyaXRobWV0aWMuaCIKLSNpbmNsdWRlICJTY2FsYXJBcml0aG1ldGljLmgiCi0KLS8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCi0gICBERUZJTklUSU9OUwotKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0KLSNkZWZpbmUgVFJVRSAgICAgICAgICAxCi0jZGVmaW5lIEZBTFNFICAgICAgICAgMAotCi0vKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgotICAgRlVOQ1RJT04gTUlYSU5TT0ZUX0QxNkMzMV9TQVQKLSoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotCi12b2lkIExWQ19NaXhJblNvZnRfRDE2QzMxX1NBVCggTFZNaXhlcjNfMVN0X3N0ICpwdHJJbnN0YW5jZSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIExWTV9JTlQxNiAgICAgICAgICAgICAqc3JjLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTFZNX0lOVDE2ICAgICAgICAgICAgICpkc3QsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBMVk1fSU5UMTYgICAgICAgICAgICAgbikKLXsKLSAgICBjaGFyICAgICAgICBIYXJkTWl4aW5nID0gVFJVRTsKLSAgICBMVk1fSU5UMzIgICBUYXJnZXRHYWluOwotICAgIE1peF9Qcml2YXRlX3N0ICAqcEluc3RhbmNlPShNaXhfUHJpdmF0ZV9zdCAqKShwdHJJbnN0YW5jZS0+TWl4ZXJTdHJlYW1bMF0uUHJpdmF0ZVBhcmFtcyk7Ci0KLSAgICBpZihuPD0wKSAgICByZXR1cm47Ci0KLSAgICAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKio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ICAgfWVsc2V7Ci0gICAgICAgICAgICAvKiBTb2Z0IG1peGluZyBoYXMgdG8gYmUgYXBwbGllZCAqLwotICAgICAgICAgICAgSGFyZE1peGluZyA9IEZBTFNFOwotICAgICAgICAgICAgaWYocEluc3RhbmNlLT5TaGlmdCE9MCl7Ci0gICAgICAgICAgICAgICAgU2hpZnRfU2F0X3YxNnh2MTYgKChMVk1fSU5UMTYpcEluc3RhbmNlLT5TaGlmdCxzcmMsc3JjLG4pOwotICAgICAgICAgICAgICAgIExWQ19Db3JlX01peEluU29mdF9EMTZDMzFfU0FUKCAmKHB0ckluc3RhbmNlLT5NaXhlclN0cmVhbVswXSksIHNyYywgZHN0LCBuKTsKLSAgICAgICAgICAgIH0KLSAgICAgICAgICAgIGVsc2UKLSAgICAgICAgICAgICAgICBMVkNfQ29yZV9NaXhJblNvZnRfRDE2QzMxX1NBVCggJihwdHJJbnN0YW5jZS0+TWl4ZXJTdHJlYW1bMF0pLCBzcmMsIGRzdCwgbik7Ci0gICAgICAgIH0KLSAgICB9Ci0KLSAgICAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCi0gICAgICAgSEFSRCBNSVhJTkcKLSAgICAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotCi0gICAgaWYgKEhhcmRNaXhpbmcpewotICAgICAgICBpZiAocEluc3RhbmNlLT5UYXJnZXQgIT0gMCl7IC8qIE5vdGhpbmcgdG8gZG8gaW4gY2FzZSBUYXJnZXQgPSAwICovCi0gICAgICAgICAgICBpZiAoKHBJbnN0YW5jZS0+VGFyZ2V0Pj4xNikgPT0gMHg3RkZGKXsKLSAgICAgICAgICAgICAgICBpZihwSW5zdGFuY2UtPlNoaWZ0IT0wKQotICAgICAgICAgICAgICAgICAgICBTaGlmdF9TYXRfdjE2eHYxNiAoKExWTV9JTlQxNilwSW5zdGFuY2UtPlNoaWZ0LHNyYyxzcmMsbik7Ci0gICAgICAgICAgICAgICAgQWRkMl9TYXRfMTZ4MTYoIHNyYywgZHN0LCBuICk7Ci0gICAgICAgICAgICB9Ci0gICAgICAgICAgICBlbHNlewotICAgICAgICAgICAgICAgIGlmKHBJbnN0YW5jZS0+U2hpZnQhPTApCi0gICAgICAgICAgICAgICAgICAgIFNoaWZ0X1NhdF92MTZ4djE2ICgoTFZNX0lOVDE2KXBJbnN0YW5jZS0+U2hpZnQsc3JjLHNyYyxuKTsKLSAgICAgICAgICAgICAgICBNYWMzc19TYXRfMTZ4MTYoc3JjLChMVk1fSU5UMTYpKHBJbnN0YW5jZS0+VGFyZ2V0Pj4xNiksZHN0LG4pOwotICAgICAgICAgICAgICAgIHBJbnN0YW5jZS0+Q3VycmVudCA9IHBJbnN0YW5jZS0+VGFyZ2V0OyAvKiBJbiBjYXNlIHRoZSBMVkNvcmUgZnVuY3Rpb24gd291bGQgaGF2ZSBjaGFuZ2VkIHRoZSBDdXJyZW50IHZhbHVlICovCi0gICAgICAgICAgICB9Ci0gICAgICAgIH0KLSAgICB9Ci0KLQotICAgIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKLSAgICAgICBDQUxMIEJBQ0sKLSAgICAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotCi0gICAgaWYgKHB0ckluc3RhbmNlLT5NaXhlclN0cmVhbVswXS5DYWxsYmFja1NldCl7Ci0gICAgICAgIGlmIChBYnNfMzIocEluc3RhbmNlLT5DdXJyZW50LXBJbnN0YW5jZS0+VGFyZ2V0KSA8IHBJbnN0YW5jZS0+RGVsdGEpewotICAgICAgICAgICAgcEluc3RhbmNlLT5DdXJyZW50ID0gcEluc3RhbmNlLT5UYXJnZX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ZW5zZS4KLSAqLwotCi0vKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgotICAgSU5DTFVERSBGSUxFUwotKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0KLSNpbmNsdWRlICJMVkNfTWl4ZXJfUHJpdmF0ZS5oIgotI2luY2x1ZGUgIlZlY3RvckFyaXRobWV0aWMuaCIKLSNpbmNsdWRlICJTY2FsYXJBcml0aG1ldGljLmgiCi0KLS8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCi0gICBERUZJTklUSU9OUwotKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0KLSNkZWZpbmUgVFJVRSAgICAgICAgICAxCi0jZGVmaW5lIEZBTFNFICAgICAgICAgMAotCi0vKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgotICAgRlVOQ1RJT04gTFZDX01peFNvZnRfMVN0XzJpX0QxNkMzMV9TQVQKLSoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotCi12b2lkIExWQ19NaXhTb2Z0XzFTdF8yaV9EMTZDMzFfU0FUKCBMVk1peGVyM18yU3Rfc3QgKnB0ckluc3RhbmNlLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbnN0IExWTV9JTlQxNiAgICAgICAgICAgICAqc3JjLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIExWTV9JTlQxNiAgICAgICAgICAgICAqZHN0LAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIExWTV9JTlQxNiAgICAgICAgICAgICBuKQotewotICAgIGNoYXIgICAgICAgIEhhcmRNaXhpbmcgPSBUUlVFOwotICAgIExWTV9JTlQzMiAgIFRhcmdldEdhaW47Ci0gICAgTWl4X1ByaXZhdGVfc3QgICpwSW5zdGFuY2UxPShNaXhfUHJpdmF0ZV9zdCAqKShwdHJJbnN0YW5jZS0+TWl4ZXJTdHJlYW1bMF0uUHJpdmF0ZVBhcmFtcyk7Ci0gICAgTWl4X1ByaXZhdGVfc3QgICpwSW5zdGFuY2UyPShNaXhfUHJpdmF0ZV9zdCAqKShwdHJJbnN0YW5jZS0+TWl4ZXJTdHJlYW1bMV0uUHJpdmF0ZVBhcmFtcyk7Ci0KLSAgICBpZihuPD0wKSAgICByZXR1cm47Ci0KLSAgICAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCi0gICAgICAgU09GVCBNSVhJTkcKLSAgICAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotICAgIGlmICgocEluc3RhbmNlMS0+Q3VycmVudCAhPSBwSW5zdGFuY2UxLT5UYXJnZXQpfHwocEluc3RhbmNlMi0+Q3VycmVudCAhPSBwSW5zdGFuY2UyLT5UYXJnZXQpKQotICAgIHsKLSAgICAgICAgaWYocEluc3RhbmNlMS0+RGVsdGEgPT0gMHg3RkZGRkZGRikKLSAgICAgICAgewotICAgICAgICAgICAgcEluc3RhbmNlMS0+Q3VycmVudCA9IHBJbnN0YW5jZTEtPlRhcmdldDsKLSAgICAgICAgICAgIFRhcmdldEdhaW49cEluc3RhbmNlMS0+VGFyZ2V0Pj4xNjsgIC8vIFRhcmdldEdhaW4gaW4gUTE2LjE1IGZ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l4ZXJTdHJlYW1bMF0pLCYocHRySW5zdGFuY2UtPk1peGVyU3RyZWFtWzFdKSwgc3JjLCBkc3QsIG4pOwotICAgICAgICB9Ci0gICAgfQotCi0gICAgLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgotICAgICAgIEhBUkQgTUlYSU5HCi0gICAgKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLQotICAgIGlmIChIYXJkTWl4aW5nKQotICAgIHsKLSAgICAgICAgaWYgKCgocEluc3RhbmNlMS0+VGFyZ2V0Pj4xNikgPT0gMHg3RkZGKSYmKChwSW5zdGFuY2UyLT5UYXJnZXQ+PjE2KSA9PSAweDdGRkYpKQotICAgICAgICB7Ci0gICAgICAgICAgICBpZihzcmMhPWRzdCkKLSAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICBDb3B5XzE2KHNyYywgZHN0LCBuKTsKLSAgICAgICAgICAgIH0KLSAgICAgICAgfQotICAgICAgICBlbHNlCi0gICAgICAgIHsKLSAgICAgICAgICAgIExWQ19Db3JlX01peEhhcmRfMVN0XzJpX0QxNkMzMV9TQVQoJihwdHJJbnN0YW5jZS0+TWl4ZXJTdHJlYW1bMF0pLCYocHRySW5zdGFuY2UtPk1peGVyU3RyZWFtWzFdKSwgc3JjLCBkc3QsIG4pOwotICAgICAgICB9Ci0gICAgfQotCi0gICAgLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgotICAgICAgIENBTEwgQkFDSwotICAgICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0KLSAgICBpZiAocHRySW5zdGFuY2UtPk1peGVyU3RyZWF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ICJBUyBJUyIgQkFTSVMsCi0gKiBXSVRIT1VUIFdBUlJBTlRJRVMgT1IgQ09ORElUSU9OUyBPRiBBTlkgS0lORCwgZWl0aGVyIGV4cHJlc3Mgb3IgaW1wbGllZC4KLSAqIFNlZSB0aGUgTGljZW5zZSBmb3IgdGhlIHNwZWNpZmljIGxhbmd1YWdlIGdvdmVybmluZyBwZXJtaXNzaW9ucyBhbmQKLSAqIGxpbWl0YXRpb25zIHVuZGVyIHRoZSBMaWNlbnNlLgotICovCi0KLS8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCi0gICBJTkNMVURFIEZJTEVTCi0qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLQotI2luY2x1ZGUgIkxWQ19NaXhlcl9Qcml2YXRlLmgiCi0jaW5jbHVkZSAiVmVjdG9yQXJpdGhtZXRpYy5oIgotI2luY2x1ZGUgIlNjYWxhckFyaXRobWV0aWMuaCIKLQotLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKLSAgIERFRklOSVRJT05TCi0qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLQotI2RlZmluZSBUUlVFICAgICAgICAgIDEKLSNkZWZpbmUgRkFMU0UgICAgICAgICAwCi0KLS8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCi0gICBGVU5DVElPTiBMVk1peGVyM19NSVhTT0ZUXzFTVF9EMTZDMzFfU0FUCi0qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLQotdm9pZCBMVkNfTWl4U29mdF8xU3RfRDE2QzMxX1NBVCggTFZNaXhlcjNfMVN0X3N0ICpwdHJJbnN0YW5jZSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb25zdCBMVk1fSU5UMTYgICAgICAgICAgICAgKnNyYywKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBMVk1fSU5UMTYgICAgICAgICAgICAgKmRzdCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBMVk1fSU5UMTYgICAgICAgICAgICAgbikKLXsKLSAgICBjaGFyICAgICAgICBIYXJkTWl4aW5nID0gVFJVRTsKLSAgICBMVk1fSU5UMzIgICBUYXJnZXRHYWluOwotICAgIE1peF9Qcml2YXRlX3N0ICAqcEluc3RhbmNlPShNaXhfUHJpdmF0ZV9zdCAqKShwdHJJbnN0YW5jZS0+TWl4ZXJTdHJlYW1bMF0uUHJpdmF0ZVBhcmFtcyk7Ci0KLSAgICBpZihuPD0wKSAgICByZXR1cm47Ci0KLSAgICAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCi0gICAgICAgU09GVCBNSVhJTkcKLSAgICAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotICAgIGlmIChwSW5zdGFuY2UtPkN1cnJlbnQgIT0gcEluc3RhbmNlLT5UYXJnZXQpCi0gICAgewotICAgICAgICBpZihwSW5zdGFuY2UtPkRlbHRhID09IDB4N0ZGRkZGRkYpewotICAgICAgICAgICAgcEluc3RhbmNlLT5DdXJyZW50ID0gcEluc3RhbmNlLT5UYXJnZXQ7Ci0gICAgICAgICAgICBUYXJnZXRHYWluPXBJbnN0YW5jZS0+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QsIG4pOwotICAgICAgICAgICAgfQotICAgICAgICAgICAgZWxzZQotICAgICAgICAgICAgICAgIExWQ19Db3JlX01peFNvZnRfMVN0X0QxNkMzMV9XUkEoICYocHRySW5zdGFuY2UtPk1peGVyU3RyZWFtWzBdKSwgc3JjLCBkc3QsIG4pOwotICAgICAgICB9Ci0gICAgfQotCi0gICAgLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgotICAgICAgIEhBUkQgTUlYSU5HCi0gICAgKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLQotICAgIGlmIChIYXJkTWl4aW5nKXsKLSAgICAgICAgaWYgKHBJbnN0YW5jZS0+VGFyZ2V0ID09IDApCi0gICAgICAgICAgICBMb2FkQ29uc3RfMTYoMCwgZHN0LCBuKTsKLSAgICAgICAgZWxzZSBpZihwSW5zdGFuY2UtPlNoaWZ0IT0wKXsKLSAgICAgICAgICAgIFNoaWZ0X1NhdF92MTZ4djE2ICgoTFZNX0lOVDE2KXBJbnN0YW5jZS0+U2hpZnQsc3JjLGRzdCxuKTsKLSAgICAgICAgICAgIGlmICgocEluc3RhbmNlLT5UYXJnZXQ+PjE2KSAhPSAweDdGRkYpCi0gICAgICAgICAgICAgICAgTXVsdDNzXzE2eDE2KCBkc3QsIChMVk1fSU5UMTYpKHBJbnN0YW5jZS0+VGFyZ2V0Pj4xNiksIGRzdCwgbiApOwotICAgICAgICB9Ci0gICAgICAgIGVsc2UgewotICAgICAgICAgICAgaWYgKChwSW5zdGFuY2UtPlRhcmdldD4+MTYpICE9IDB4N0ZGRikKLSAgICAgICAgICAgICAgICBNdWx0M3NfMTZ4MTYoIHNyYywgKExWTV9JTlQxNikocEluc3RhbmNlLT5UYXJnZXQ+PjE2KSwgZHN0LCBuICk7Ci0gICAgICAgICAgICBlbHNlIGlmKHNyYyE9ZHN0KQotICAgICAgICAgICAgICAgIENvcHlfMTYoc3JjLCBkc3QsIG4pOwotICAgICAgICB9Ci0KLSAgICB9Ci0KLSAgICAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCi0gICAgICAgQ0FMTCBCQUNLCi0gICAgKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLQotICAgIGlmIChwdHJJbnN0YW5jZS0+TWl4ZXJTdHJlYW1bMF0uQ2FsbGJhY2tTZXQpewotICAgICAgICBpZiAoQWJzXzMyKHBJbnN0YW5jZS0+Q3VycmVudC1wSW5zdGFuY2UtPlRhcmdldCkgPCBwSW5zdGFuY2UtPkRlbHRhKXsKLSAgICAgICAgICAgIHBJbnN0YW5jZS0+Q3VycmVudCA9IHBJbnN0YW5jZS0+VGFyZ2V0OyAvKiBEaWZmZXJlbmNlIGlzIG5vdCBzaWduaWZpY2FudCBhbnltb3JlLiAgTWFrZSB0aGVtIGVxdWFsLiAqLwotICAgICAgICAgICAgVGFyZ2V0R2Fpbj1wSW5zdGFuY2UtPlRhcmdldD4+KDE2LXBJbnN0YW5jZS0+U2hpZnQpOyAgLy8gVGFyZ2V0R2FpbiBpbiBRMTYuMTUgZm9ybWF0Ci0gICAgICAgICAgICBMVkNfTWl4ZXJfU2V0VGFyZ2V0KHB0ckluc3RhbmNlLT5NaXhlclN0cmVhbSxUYXJnZXRHYWluKTsKLSAgICAgICAgICAgIHB0ckluc3RhbmNlLT5NaXhlclN0cmVhbVswXS5DYWxsYmFja1NldCA9IEZBTFNFOwotICAgICAgICAgICAgaWYgKHB0ckluc3RhbmNlLT5NaXhlclN0cmVhbVswXS5wQ2FsbEJhY2sgIT0gMCl7Ci0gICAgICAgICAgICAgICAgKCpwdHJJbnN0YW5jZS0+TWl4ZXJTdHJlYW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J0YWluIGEgY29weSBvZiB0aGUgTGljZW5zZSBhdAotICoKLSAqICAgICAgaHR0cDovL3d3dy5hcGFjaGUub3JnL2xpY2Vuc2VzL0xJQ0VOU0UtMi4wCi0gKgotICogVW5sZXNzIHJlcXVpcmVkIGJ5IGFwcGxpY2FibGUgbGF3IG9yIGFncmVlZCB0byBpbiB3cml0aW5nLCBzb2Z0d2FyZQotICogZGlzdHJpYnV0ZWQgdW5kZXIgdGhlIExpY2Vuc2UgaXMgZGlzdHJpYnV0ZWQgb24gYW4gIkFTIElTIiBCQVNJUywKLSAqIFdJVEhPVVQgV0FSUkFOVElFUyBPUiBDT05ESVRJT05TIE9GIEFOWSBLSU5ELCBlaXRoZXIgZXhwcmVzcyBvciBpbXBsaWVkLgotICogU2VlIHRoZSBMaWNlbnNlIGZvciB0aGUgc3BlY2lmaWMgbGFuZ3VhZ2UgZ292ZXJuaW5nIHBlcm1pc3Npb25zIGFuZAotICogbGltaXRhdGlvbnMgdW5kZXIgdGhlIExpY2Vuc2UuCi0gKi8KLQotLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKLSAgIElOQ0xVREUgRklMRVMKLSoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotCi0jaW5jbHVkZSAiTFZDX01peGVyX1ByaXZhdGUuaCIKLSNpbmNsdWRlICJWZWN0b3JBcml0aG1ldGljLmgiCi0KLS8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCi0gICBGVU5DVElPTiBMVkNfTWl4U29mdF8yU3RfRDE2QzMxX1NBVC5jCi0qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLQotdm9pZCBMVkNfTWl4U29mdF8yU3RfRDE2QzMxX1NBVCggTFZNaXhlcjNfMlN0X3N0ICpwdHJJbnN0YW5jZSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbnN0ICAgTFZNX0lOVDE2ICAgICAgICpzcmMxLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBMVk1fSU5UMTYgICAgICAgKnNyYzIsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIExWTV9JTlQxNiAgICAgICAqZHN0LAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBMVk1fSU5UMTYgICAgICAgbikKLXsKLSAgICBNaXhfUHJpdmF0ZV9zdCAgKnBJbnN0YW5jZTE9KE1peF9Qcml2YXRlX3N0ICopKHB0ckluc3RhbmNlLT5NaXhlclN0cmVhbVswXS5Qcml2YXRlUGFyYW1zKTsKLSAgICBNaXhfUHJpdmF0ZV9zdCAgKnBJbnN0YW5jZTI9KE1peF9Qcml2YXRlX3N0ICopKHB0ckluc3RhbmNlLT5NaXhlclN0cmVhbVsxXS5Qcml2YXRlUGFyYW1zKTsKLQotICAgIGlmKG48PTApICAgIHJldHVybjsKLQotICAgIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKLSAgICAgICBTT0ZUIE1JWElORwotICAgICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0gICAgaWYgKChwSW5zdGFuY2UxLT5DdXJyZW50ID09IHBJbnN0YW5jZTEtPlRhcmdldCkmJihwSW5zdGFuY2UxLT5DdXJyZW50ID09IDApKXsKLSAgICAgICAgTFZDX01peFNvZnRfMVN0X0QxNkMzMV9TQVQoIChMVk1peGVyM18xU3Rfc3QgKikoJnB0ckluc3RhbmNlLT5NaXhlclN0cmVhbVsxXSksIHNyYzIsIGRzdCwgbik7Ci0gICAgfQotICAgIGVsc2UgaWYgKChwSW5zdGFuY2UyLT5DdXJyZW50ID09IHBJbnN0YW5jZTItPlRhcmdldCkmJihwSW5zdGFuY2UyLT5DdXJyZW50ID09IDApKXsKLSAgICAgICAgTFZDX01peFNvZnRfMVN0X0QxNkMzMV9TQVQoIChMVk1peGVyM18xU3Rfc3QgKikoJnB0ckluc3RhbmNlLT5NaXhlclN0cmVhbVswXSksIHNyYzEsIGRzdCwgbik7Ci0gICAgfQotICAgIGVsc2UgaWYgKChwSW5zdGFuY2UxLT5DdXJyZW50ICE9IHBJbnN0YW5jZTEtPlRhcmdldCkgfHwgKHBJbnN0YW5jZTItPkN1cnJlbnQgIT0gcEluc3RhbmNlMi0+VGFyZ2V0KSkKLSAgICB7Ci0gICAgICAgIExWQ19NaXhTb2Z0XzFTdF9EMTZDMzFfU0FUKChMVk1peGVyM18xU3Rfc3QgKikoJnB0ckluc3RhbmNlLT5NaXhlclN0cmVhbVswXSksIHNyYzEsIGRzdCwgbik7Ci0gICAgICAgIExWQ19NaXhJblNvZnRfRDE2QzMxX1NBVCggKExWTWl4ZXIzXzFTdF9zdCAqKSgmcHRySW5zdGFuY2UtPk1peGVyU3RyZWFtWzFdKSwgc3JjMiwgZHN0LCBuKTsKLSAgICB9Ci0gICAgZWxzZXsKLSAgICAgICAgLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgotICAgICAgICAgICBIQVJEIE1JWElORwotICAgICAgICAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotICAgICAgICBpZihwSW5zdGFuY2UyLT5TaGlmdCE9MCkKLSAgICAgICAgICAgIFNoaWZ0X1NhdF92MT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IGZ1bmN0aW9uICovCi19IExWTWl4ZXIzX3N0OwotCi10eXBlZGVmIHN0cnVjdAotewotICAgIExWTWl4ZXIzX3N0ICAgICBNaXhlclN0cmVhbVsxXTsgICAgLyogSW5zdGFuY2UgUGFyYW1zIGZvciBvbmUgQXVkaW8gU3RyZWFtICovCi19IExWTWl4ZXIzXzFTdF9zdDsKLQotdHlwZWRlZiBzdHJ1Y3QKLXsKLSAgICBMVk1peGVyM19zdCAgICAgTWl4ZXJTdHJlYW1bMl07ICAgIC8qIEluc3RhbmNlIFBhcmFtcyBmb3IgdHdvIEF1ZGlvIFN0cmVhbXMgKi8KLX0gTFZNaXhlcjNfMlN0X3N0OwotCi10eXBlZGVmIHN0cnVjdAotewotICAgIExWTWl4ZXIzX3N0ICAgICBNaXhlclN0cmVhbVszXTsgICAgLyogSW5zdGFuY2UgUGFyYW1zIGZvciB0aHJlZSBBdWRpbyBTdHJlYW1zICovCi19IExWTWl4ZXIzXzNTdF9zdDsKLQotLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKLSAgIEZVTkNUSU9OIFBST1RPVFlQRVMgKEhJR0ggTEVWRUwgRlVOQ1RJT05TKQotKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0KLS8qIEZ1bmN0aW9uIG5hbWVzIHNob3VsZCBiZSB1bmlxdWUgd2l0aGluIGZpcnN0IDE2IGNoYXJhY3RlcnMgICovCi0jZGVmaW5lICAgIExWTWl4ZXIzX01peFNvZnRfMVN0X0QxNkMzMV9TQVQgICBMVk1peGVyM18xU3RfRDE2QzMxX1NBVF9NaXhTb2Z0Ci0jZGVmaW5lICAgIExWTWl4ZXIzX01peEluU29mdF9EMTZDMzFfU0FUICAgICBMVk1peGVyM19EMTZDMzFfU0FUX01peEluU29mdAotI2RlZmluZSAgICBMVk1peGVyM19NaXhTb2Z0XzJTdF9EMTZDMzFfU0FUICAgTFZNaXhlcjNfMlN0X0QxNkMzMV9TQVRfTWl4U29mdAotI2RlZmluZSAgICBMVk1peGVyM19NaXhTb2Z0XzNTdF9EMTZDMzFfU0FUICAgTFZNaXhlcjNfM1N0X0QxNkMzMV9TQVRfTWl4U29mdAotCi0KLS8qKiogR2VuZXJhbCBmdW5jdGlvbnMgKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotCi0vKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLS8qIFRoaXMgdGltZSBjb25zdGFudCBjYWxjdWxhdGlvbiBmdW5jdGlvbiBhc3N1bWVzIHRoZSBtaXhlciB3aWxsIGJlIGNhbGxlZCB3aXRoICAqLwotLyogbGFyZ2UgYmxvY2sgc2l6ZXMuIFdoZW4gdGhlIGJsb2NrIHNpemUgaXMgc21hbGwsIGVzcGVjaWFsbHkgaWYgbGVzcyB0aGFuIDQsICAgICovCi0vKiB0aGVuIHRoZSBjYWxjdWxhdGlvbiB3aWxsIGdpdmUgYW4gaW5jb3JyZWN0IHZhbHVlIGZvciBhbHBoYSwgc2VlIHRoZSBtaXhlciAgICAgKi8KLS8qIGRvY3VtZW50YXRpb24gZm9yIGZ1cnRoZXIgZGV0YWlscy4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi12b2lkIExWQ19NaXhlcl9TZXRUYXJnZXQoIExWTWl4ZXIzX3N0ICpwU3RyZWFtLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBMVk1fSU5UMzIgICAgICAgICAgIFRhcmdldEdhaW4pOwotCi1MVk1fSU5UMzIgTFZDX01peGVyX0dldFRhcmdldCggTFZNaXhlcjNfc3QgKnBTdHJlYW0pOwotCi1MVk1fSU5UMzIgTFZDX01peGVyX0dldEN1cnJlbnQoIExWTWl4ZXIzX3N0ICpwU3RyZWFtKTsKLQotdm9pZCBMVkNfTWl4ZXJfSW5pdCggTFZNaXhlcjNfc3QgKnBTdHJlYW0sCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIExWTV9JTlQzMiAgICAgICAgICAgVGFyZ2V0R2FpbiwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTFZNX0lOVDMyICAgICAgICAgICBDdXJyZW50R2Fpbik7Ci0KLXZvaWQgTFZDX01peGVyX1NldFRpbWVDb25zdGFudCggTFZNaXhlcjNfc3QgKnBTdHJlYW0sCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIExWTV9JTlQzMiAgICAgICAgICAgVGNfbWlsbGlzZWMsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIExWTV9Gc19lbiAgICAgICAgICAgRnMsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIExWTV9JTlQxNiAgICAgICAgICAgTnVtQ2hhbm5lbHMpOwotCi12b2lkIExWQ19NaXhlcl9WYXJTbG9wZV9TZXRUaW1lQ29uc3RhbnQoIExWTWl4ZXIzX3N0ICpwU3RyZWFtLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIExWTV9JTlQzMiAgICAgICAgICAgVGNfbWlsbGlzZWMsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTFZNX0ZzX2VuICAgICAgICAgICBGcywKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBMVk1fSU5UMTYgICAgICAgICAgIE51bUNoYW5uZWxzKTsKLQotLyoqKiAxNiBiaXQgZnVuY3Rpb25zICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0KLXZvaWQgTFZDX01peFNvZnRfMVN0X0QxNkMzMV9TQVQoIExWTWl4ZXIzXzFTdF9zdCAqcEluc3RhbmNlLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbnN0IExWTV9JTlQxNiAgICAgICAgICAgKnNyYywKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBMVk1fSU5UMTYgICAgICAgICAgICpkc3QsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTFZNX0lOVDE2ICAgICAgICAgICBuKTsKLQotdm9pZCBMVkNfTWl4SW5Tb2Z0X0QxNkMzMV9TQVQoIExWTWl4ZXIzXzFTdF9zdCAqcEluc3RhbmNlLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIExWTV9JTlQxNiAgICAgICAgICAgKnNyYywKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBMVk1fSU5UMTYgICAgICAgICAgICpkc3QsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTFZNX0lOVDE2ICAgICAgICAgICBuKTsKLQotdm9pZCBMVkNfTWl4U29mdF8yU3RfRDE2QzMxX1NBVCggTFZNaXhlcjNfMlN0X3N0ICpwSW5zdGFuY2UsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbnN0IExWTV9JTlQxNiAgICAgICAgICAgICAqc3JjMSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTFZNX0lOVDE2ICAgICAgICAgICAgICpzcmMyLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBMVk1fSU5UMTYgICAgICAgICAgICAgKmRzdCwgIC8qIGRzdCBjYW5ub3QgYmUgZXF1YWwgdG8gc3JjMiAqLwotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBMVk1fSU5UMTYgICAgICAgICAgICAgbik7Ci0KLS8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotLyogRm9yIGFwcGx5aW5nIGRpZmZlcmVudCBnYWlucyB0byBMZWZ0IGFuZCByaWdodCBjaGVubmFscyAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiBNaXhlclN0cmVhbVswXSBhcHBsaWVzIHRvIExlZnQgY2hhbm5lbCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qIE1peGVyU3RyZWFtWzFdIGFwcGxpZXMgdG8gUmlnaHQgY2hhbm5lbCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogR2FpbiB2YWx1ZXMgc2hvdWxkIG5vdCBiZSBtb3JlIHRoYXQgMS4wICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLXZvaWQgTFZDX01peFNvZnRfMVN0XzJpX0QxNkMzMV9TQVQoIExWTWl4ZXIzXzJTdF9zdCAgICAgICAgICpwSW5zdGFuY2UsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbnN0ICAgTFZNX0lOVDE2ICAgICAgICAgICAqc3JjLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIExWTV9JTlQxNiAgICAgICAgICAgKmRzdCwgICAvKiBkc3QgY2FuIGJlIGVxdWFsIHRvIHNyYyAqLwotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIExWTV9JTlQxNiAgICAgICAgICAgbik7ICAgICAvKiBOdW1iZXIgb2Ygc3RlcmVvIHNhbXBsZXMgKi8KLQotCi0jaWZkZWYgX19jcGx1c3BsdXMKLX0KLSN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QgdG8gaW4gd3JpdGluZywgc29mdHdhcmUKLSAqIGRpc3RyaWJ1dGVkIHVuZGVyIHRoZSBMaWNlbnNlIGlzIGRpc3RyaWJ1dGVkIG9uIGFuICJBUyBJUyIgQkFTSVMsCi0gKiBXSVRIT1VUIFdBUlJBTlRJRVMgT1IgQ09ORElUSU9OUyBPRiBBTlkgS0lORCwgZWl0aGVyIGV4cHJlc3Mgb3IgaW1wbGllZC4KLSAqIFNlZSB0aGUgTGljZW5zZSBmb3IgdGhlIHNwZWNpZmljIGxhbmd1YWdlIGdvdmVybmluZyBwZXJtaXNzaW9ucyBhbmQKLSAqIGxpbWl0YXRpb25zIHVuZGVyIHRoZSBMaWNlbnNlLgotICovCi0KLSNpbmNsdWRlICJMVk1fVHlwZXMuaCIKLSNpbmNsdWRlICJMVk1fTWFjcm9zLmgiCi0jaW5jbHVkZSAiTFZDX01peGVyX1ByaXZhdGUuaCIKLQotCi0vKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotLyogRlVOQ1RJT046ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICAgTFZNaXhlcjNfR2V0Q3VycmVudCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogREVTQ1JJUFRJT046ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICBUaGlzIGZ1bmN0aW9uIHJldHVybnMgdGhlIEN1cnJlbnRHYWluIGluIFExNi4xNSBmb3JtYXQgICAgICAgICAgICAgICovCi0vKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogUkVUVVJOUzogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICBDdXJyZW50R2FpbiAgICAgIC0gQ3VycmVudEdhaW4gdmFsdWUgaW4gUSAxNi4xNSBmb3JtYXQgICAgICAgICAgICAgICovCi0vKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLQotTFZNX0lOVDMyIExWQ19NaXhlcl9HZXRDdXJyZW50KCBMVk1peGVyM19zdCAqcFN0cmVhbSkKLXsKLSAgICBMVk1fSU5UMzIgICAgICAgQ3VycmVudEdhaW47Ci0gICAgTWl4X1ByaXZhdGVfc3QgICpwSW5zdGFuY2U9KE1peF9Qcml2YXRlX3N0ICopcFN0cmVhbS0+UHJpdmF0ZVBhcmFtczsKLSAgICBDdXJyZW50R2Fpbj1wSW5zdGFuY2UtPkN1cnJlbnQ+PigxNi1wSW5zdGFuY2UtPlNoaWZ0KTsgIC8vIEN1cnJlbnRHYWluIGluIFExNi4xNSBmb3JtYXQKLSAgICByZXR1cm4gQ3VycmVudEdhaW47Ci19CmRpZmYgLS1naXQgYS9tZWRpYS9saWJlZmZlY3RzL2x2bS9saWIvQ29tbW9uL3NyYy9MVkNfTWl4ZXJfR2V0VGFyZ2V0LmMgYi9tZWRpYS9saWJlZmZlY3RzL2x2bS9saWIvQ29tbW9uL3NyYy9MVkNfTWl4ZXJfR2V0VGFyZ2V0LmMKZGVsZXRlZCBmaWxlIG1vZGUgMTAwNjQ0CmluZGV4IGRjMmY4ZTkuLjAwMDAwMDAKLS0tIGEvbWVkaWEvbGliZWZmZWN0cy9sdm0vbGliL0NvbW1vbi9zcmMvTFZDX01peGVyX0dldFRhcmdld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KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotLyogRlVOQ1RJT046ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICAgTFZNaXhlcjNfR2V0VGFyZ2V0ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogREVTQ1JJUFRJT046ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICBUaGlzIGZ1bmN0aW9uIHJldHVybnMgdGhlIFRhcmdldEdhaW4gaW4gUTE2LjE1IGZvcm1hdCAgICAgICAgICAgICAgICovCi0vKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogUkVUVVJOUzogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICBUYXJnZXRHYWluICAgICAgLSBUYXJnZXRHYWluIHZhbHVlIGluIFEgMTYuMTUgZm9ybWF0ICAgICAgICAgICAgICAgICovCi0vKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLQotTFZNX0lOVDMyIExWQ19NaXhlcl9HZXRUYXJnZXQoIExWTWl4ZXIzX3N0ICpwU3RyZWFtKQotewotICAgIExWTV9JTlQzMiAgICAgICBUYXJnZXRHYWluOwotICAgIE1peF9Qcml2YXRlX3N0ICAqcEluc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WNhYmxlIGxhdyBvciBhZ3JlZWQgdG8gaW4gd3JpdGluZywgc29mdHdhcmUKLSAqIGRpc3RyaWJ1dGVkIHVuZGVyIHRoZSBMaWNlbnNlIGlzIGRpc3RyaWJ1dGVkIG9uIGFuICJBUyBJUyIgQkFTSVMsCi0gKiBXSVRIT1VUIFdBUlJBTlRJRVMgT1IgQ09ORElUSU9OUyBPRiBBTlkgS0lORCwgZWl0aGVyIGV4cHJlc3Mgb3IgaW1wbGllZC4KLSAqIFNlZSB0aGUgTGljZW5zZSBmb3IgdGhlIHNwZWNpZmljIGxhbmd1YWdlIGdvdmVybmluZyBwZXJtaXNzaW9ucyBhbmQKLSAqIGxpbWl0YXRpb25zIHVuZGVyIHRoZSBMaWNlbnNlLgotICovCi0KLSNpbmNsdWRlICJMVk1fVHlwZXMuaCIKLSNpbmNsdWRlICJMVk1fTWFjcm9zLmgiCi0jaW5jbHVkZSAiTFZDX01peGVyX1ByaXZhdGUuaCIKLQotLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLS8qIEZVTkNUSU9OOiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgIExWTWl4ZXIzX0luaXQgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qIERFU0NSSVBUSU9OOiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgVGhpcyBpbnRpYWxpemF0aW9uIGZ1bmN0aW9uIGludGlhbGl6ZXMgdGhlIHByaXZhdGUgaW5zdGFuY2UgICAgICAgICAqLwotLyogIHBhcmFtdGVycyBmb3IgYSBnaXZlbiBBdWRpbyBTdHJlYW0gYmFzZWQgb24gVGFyZ2V0R2FpbiBhbmQgICAgICAgICAgKi8KLS8qICBDdXJyZW50R2FpbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgVGhpcyBmdW5jdGlvbiBjYWNsdWxhdGVzIHRoZSAiU2hpZnQiIHJlcXVpcmVkIHRvIHByb3ZpZGUgdGhlICAgICAgICAqLwotLyogIGludGVnZXIgcGFydCBvZiBUYXJnZXRHYWluIGFuZCBmcmFjdGlvbmFsIGdhaW4gdmFsdWVzICJUYXJnZXQiIGFuZCAgKi8KLS8qICAiQ3VycmVudCIgYmFzZWQgb24gbWF4aW11bShUYXJnZXRHYWluLEN1cnJlbnRHYWluKSAgICAgICAgICAgICAgICAgICovCi0vKiAgRS5nLiBDdXJyZW50R2Fpbj0xLjkgYW5kIFRhcmdldEdhaW49Mi41IHRoZW4gYmFzZWQgb24gICAgICAgICAgICAgICAqLwotLyogIE1heEdhaW4gb2YgMi41LCBTaGlmdCA9IDIsIEN1cnJlbnQ9MS45LzQ9MC40NzUsIFRhcmdldD0yLjUvND0wLjYyNSAgKi8KLS8qICBUaGVyZWZvcmUgaW50ZWdlciBnYWluIG9mIDQgaXMgcHJvdmlkZWQgYnkgTGVmdCBTaGlmdCBvZiAyIGFuZCAgICAgICovCi0vKiAgZnJhY3Rpb24gZ2FpbiBpcyBwcm92aWRlZCB0aHJvdWdoIEN1cnJlbnQ9MC40NzUgYW5kIFRhcmdldD0wLjYyNSAgICAqLwotLyogUEFSQU1FVEVSUzogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICBwU3RyZWFtICAgICAtIHB0ciB0byBJbnN0YW5jZSBQYXJhbWV0ZXIgU3RydWN0dXJlIExWTWl4ZXIzX3N0IGZvciBhbiovCi0vKiAgICAgICAgICAgICAgICBBdWRpbyBTdHJlYW0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogIFRhcmdldEdhaW4gIC0gVGFyZ2V0R2FpbiB2YWx1ZSBpbiBRIDE2LjE1IGZvcm1hdCAgICAgICAgICAgICAgICAgICAgKi8KLS8qICBDdXJyZW50R2FpbiAtIEN1cnJlbnRHYWluIHZhbHVlIGluIFEgMTYuMTUgZm9ybWF0ICAgICAgICAgICAgICAgICAgICovCi0vKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogUkVUVVJOUzogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICB2b2lkICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLQotdm9pZCBMVkNfTWl4ZXJfSW5pdCggTFZNaXhlcjNfc3QgKnBTdHJlYW0sCi0gICAgICAgICAgICAgICAgICAgIExWTV9JTlQzMiAgICAgICAgICAgVGFyZ2V0R2FpbiwKLSAgICAgICAgICAgICAgICAgICAgTFZNX0lOVDMyICAgICAgICAgICBDdXJyZW50R2FpbikKLXsKLSAgICBMVk1fSU5UMTYgICAgICAgU2hpZnQ9MDsKLSAgICBMVk1fSU5UMzIgICAgICAgTWF4R2Fpbj1UYXJnZXRHYWluOyAgICAgICAgIC8vIE1heEdhaW4gaXMgaW4gUTE2LjE1IGZvcm1hdAotICAgIE1peF9Qcml2YXRlX3N0ICAqcEluc3RhbmNlPShNaXhfUHJpdmF0ZV9zdCAqKXBTdHJlYW0tPlByaXZhdGV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fCi0KLS8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCi0gICBJTkNMVURFIEZJTEVTCi0qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLQotI2luY2x1ZGUgIkxWQ19NaXhlci5oIgotI2luY2x1ZGUgIlZlY3RvckFyaXRobWV0aWMuaCIKLQotLyogSW5zdGFuY2UgcGFyYW1ldGVyIHN0cnVjdHVyZSAqLwotdHlwZWRlZiBzdHJ1Y3QKLXsKLSAgICAvKiBHZW5lcmFsICovCi0gICAgTFZNX0lOVDMyICAgICAgICAgICAgICAgICAgICAgICBUYXJnZXQ7ICAgICAgICAgICAgICAgICAvKiAzMiBiaXQgbnVtYmVyIHNwZWNpZnlpbmcgZnJhY3Rpb25hbCB2YWx1ZSBvZiBUYXJnZXQgR2FpbiAqLwotICAgIExWTV9JTlQzMiAgICAgICAgICAgICAgICAgICAgICAgQ3VycmVudDsgICAgICAgICAgICAgICAgLyogMzIgYml0IG51bWJlciBzcGVjaWZ5aW5nIGZyYWN0aW9uYWwgdmFsdWRlIG9mIEN1cnJlbnQgR2FpbiAqLwotICAgIExWTV9JTlQzMiAgICAgICAgICAgICAgICAgICAgICAgU2hpZnQ7ICAgICAgICAgICAgICAgICAgLyogTGVmdCBTaGlmdCBmb3IgSW50ZWdlciBwYXJ0IG9mIEdhaW4gKi8KLSAgICBMVk1fSU5UMzIgICAgICAgICAgICAgICAgICAgICAgIERlbHRhOyAgICAgICAgICAgICAgICAgIC8qIDMyIGJpdCBudW1iZXIgc3BlY2lmeWluZyB0aGUgZnJhY3Rpb25hbCB2YWx1ZSBvZiBEZWx0YSBHYWluICovCi19IE1peF9Qcml2YXRlX3N0OwotCi0KLQotLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKLSAgIERFRklOSVRJT05TCi0qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLSNkZWZpbmUgTFZDb3JlX01peEluU29mdF9EMzJDMzFfU0FUICAgIExWQ29yZV9JblNvZnRfRDMyQzMxX1NBVAotI2RlZmluZSBMVkNvcmVfTWl4U29mdF8xU3RfRDMyQzMxX1dSQSAgTFZDb3JlX1NvZnRfMVN0X0QzMkMzMV9XUkEKLSNkZWZpbmUgTFZDb3JlX01peEhhcmRfMlN0X0QzMkMzMV9TQVQgIExWQ29yZV9IYXJkXzJTdF9EMzJDMzFfU0FUCi0KLS8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCi0gICBGVU5DVElPTiBQUk9UT1RZUEVTIChMT1cgTEVWRUwgU1VCRlVOQ1RJT05TKQotKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0KLS8qKiogMTYgYml0IGZ1bmN0aW9ucyAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotCi12b2lkIExWQ19Db3JlX01peEluU29mdF9EMTZDMzFfU0FUKCBMVk1peGVyM19zdCAqcEluc3RhbmNlLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY29uc3QgTFZNX0lOVDE2ICAgICAqc3JjLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTFZNX0lOVDE2ICAgICAqZHN0LAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTFZNX0lOVDE2ICAgICBuKTsKLQotdm9pZCBMVkNfQ29yZV9NaXhTb2Z0XzFTdF9EMTZDMzFfV1JBKCBMVk1peGVyM19zdCAqcEluc3RhbmNlLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY29uc3QgTFZNX0lOVDE2ICAgICAqc3JjLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTFZNX0lOVDE2ICAgICAqZHN0LAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTFZNX0lOVDE2ICAgICBuKTsKLQotdm9pZCBMVkNfQ29yZV9NaXhIYXJkXzJTdF9EMTZDMzFfU0FUKCBMVk1peGVyM19zdCAqcEluc3RhbmNlMSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIExWTWl4ZXIzX3N0ICAgICAgICAgKnBJbnN0YW5jZTIsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb25zdCBMVk1fSU5UMTYgICAgICpzcmMxLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY29uc3QgTFZNX0lOVDE2ICAgICAqc3JjMiwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIExWTV9JTlQxNiAgICAgKmRzdCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIExWTV9JTlQxNiAgICAgbik7Ci0KLS8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotLyogRm9yIGFwcGx5aW5nIGRpZmZlcmVudCBnYWlucyB0byBMZWZ0IGFuZCByaWdodCBjaGVubmFscyAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiBwdHJJbnN0YW5jZTEgYXBwbGllcyB0byBMZWZ0IGNoYW5uZWwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qIHB0ckluc3RhbmNlMiBhcHBsaWVzIHRvIFJpZ2h0IGNoYW5uZWwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogR2FpbiB2YWx1ZXMgc2hvdWxkIG5vdCBiZSBtb3JlIHRoYXQgMS4wICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLQotdm9pZCBMVkNfQ29yZV9NaXhTb2Z0XzFTdF8yaV9EMTZDMzFfV1JBKCBMVk1peGVyM19zdCAgICAgICAgKnB0ckluc3RhbmNlMSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTFZNaXhlcjNfc3QgICAgICAgICpwdHJJbnN0YW5jZTIsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbnN0IExWTV9JTlQxNiAgICAqc3JjLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBMVk1fSU5UMTYgICAgICAgICAgKmRzdCwgICAvKiBkc3QgY2FuIGJlIGVxdWFsIHRvIHNyYyAqLwotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBMVk1fSU5UMTYgICAgICAgICAgbik7ICAgICAvKiBOdW1iZXIgb2Ygc3RlcmVvIHNhbXBsZXMgKi8KLQotLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0vKiBGb3IgYXBwbHlpbmcgZGlmZmVyZW50IGdhaW5zIHRvIExlZnQgYW5kIHJpZ2h0IGNoZW5uYWxzICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qIHB0ckluc3RhbmNlMSBhcHBsaWVzIHRvIExlZnQgY2hhbm5lbCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogcHRySW5zdGFuY2UyIGFwcGxpZXMgdG8gUmlnaHQgY2hhbm5lbCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiBHYWluIHZhbHVlcyBzaG91bGQgbm90IGJlIG1vcmUgdGhhdCAxLjAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotdm9pZCBMVkNfQ29yZV9NaXhIYXJkXzFTdF8yaV9EMTZDMzFfU0FUKCBMVk1peGVyM19zdCAgICAgICAgKnB0ckluc3RhbmNlMSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTFZNaXhlcjNfc3QgICAgICAgICpwdHJJbnN0YW5jZTIsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbnN0IExWTV9JTlQxNiAgICAqc3JjLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBMVk1fSU5UMTYgICAgICAgICAgKmRzdCwgICAgLyogZHN0IGNhbiBiZSBlcXVhbCB0byBzcmMgKi8KLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTFZNX0lOVDE2ICAgICAgICAgIG4pOyAgICAgIC8qIE51bWJlciBvZiBzdGVyZW8gc2FtcGxlcyAqLwotCi0KLQotLyoqKiAzMiBiaXQgZnVuY3Rpb25zICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0KLXZvaWQgTFZDX0NvcmVfTWl4SW5Tb2Z0X0QzMkMzMV9TQVQoIExWTWl4ZXIzX3N0ICpwSW5zdGFuY2UsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb25zdCBMVk1fSU5UMzIgICAgICpzcmMsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBMVk1fSU5UMzIgICAgICpkc3QsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBMVk1fSU5UMTYgICAgIG4pOwotCi12b2lkIExWQ19Db3JlX01peFNvZnRfMVN0X0QzMkMzMV9XUkEoIExWTWl4ZXIzX3N0ICpwSW5zdGFuY2UsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb25zdCBMVk1fSU5UMzIgICAgICpzcmMsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBMVk1fSU5UMzIgICAgICpkc3QsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBMVk1fSU5UMTYgICAgIG4pOwotCi12b2lkIExWQ19Db3JlX01peEhhcmRfMlN0X0QzMkMzMV9TQVQoIExWTWl4ZXIzX3N0ICpwSW5zdGFuY2UxLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTFZNaXhlcjNfc3QgICAgICAgICAqcEluc3RhbmNlMiwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbnN0IExWTV9JTlQzMiAgICAgKnNyYzEsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb25zdCBMVk1fSU5UMzIgICAgICpzcmMyLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTFZNX0lOVDMyICAgICAqZHN0LAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTFZNX0lOVDE2ICAgICBuKTsKLQotLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0KLSNlbmRpZiAvLyNpZm5kZWYgX19MVkNfTUlYRVJfUFJJVkFURV9IX18KLQotCi0KLQotCi0K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ORElUSU9OUyBPRiBBTlkgS0lORCwgZWl0aGVyIGV4cHJlc3Mgb3IgaW1wbGllZC4KLSAqIFNlZSB0aGUgTGljZW5zZSBmb3IgdGhlIHNwZWNpZmljIGxhbmd1YWdlIGdvdmVybmluZyBwZXJtaXNzaW9ucyBhbmQKLSAqIGxpbWl0YXRpb25zIHVuZGVyIHRoZSBMaWNlbnNlLgotICovCi0KLSNpbmNsdWRlICJMVk1fVHlwZXMuaCIKLSNpbmNsdWRlICJMVk1fTWFjcm9zLmgiCi0jaW5jbHVkZSAiTFZDX01peGVyX1ByaXZhdGUuaCIKLQotLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLS8qIEZVTkNUSU9OOiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgIExWTWl4ZXIzX1NldFRhcmdldCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qIERFU0NSSVBUSU9OOiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgVGhpcyBmdW5jdGlvbiB1cGRhdGVzIHRoZSBwcml2YXRlIGluc3RhbmNlIHBhcmFtZXRlcnM6IFNoaWZ0LFRhcmdldCwqLwotLyogIEN1cnJlbnQgZm9yIGEgZ2l2ZW4gQXVkaW8gU3RyZWFtIGJhc2VkIG9uIG5ldyB2YWx1ZSBvZiBUYXJnZXRHYWluICAgKi8KLS8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgVGhpcyBmdW5jdGlvbiBjYWNsdWxhdGVzIHRoZSAiU2hpZnQiIHJlcXVpcmVkIHRvIHByb3ZpZGUgdGhlICAgICAgICAqLwotLyogIGludGVnZXIgcGFydCBvZiBUYXJnZXRHYWluIGFuZCBmcmFjdGlvbmFsIGdhaW4gdmFsdWVzICJUYXJnZXQiIGFuZCAgKi8KLS8qICAiQ3VycmVudCIgYmFzZWQgb24gbWF4aW11bShUYXJnZXRHYWluLEN1cnJlbnRHYWluKSAgICAgICAgICAgICAgICAgICovCi0vKiAgRS5nLiBDdXJyZW50R2Fpbj0xLjkgYW5kIFRhcmdldEdhaW49Mi41IHRoZW4gYmFzZWQgb24gICAgICAgICAgICAgICAqLwotLyogIE1heEdhaW4gb2YgMi41LCBTaGlmdCA9IDIsIEN1cnJlbnQ9MS45LzQ9MC40NzUsIFRhcmdldD0yLjUvND0wLjYyNSAgKi8KLS8qICBUaGVyZWZvcmUgaW50ZWdlciBnYWluIG9mIDQgaXMgcHJvdmlkZWQgYnkgTGVmdCBTaGlmdCBvZiAyIGFuZCAgICAgICovCi0vKiAgZnJhY3Rpb24gZ2FpbiBpcyBwcm92aWRlZCB0aHJvdWdoIEN1cnJlbnQ9MC40NzUgYW5kIFRhcmdldD0wLjYyNSAgICAqLwotLyogUEFSQU1FVEVSUzogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICBwU3RyZWFtICAgICAgICAgLSBwdHIgdG8gSW5zdGFuY2UgUGFyYW1ldGVyIFN0cnVjdHVyZSBMVk1peGVyM19zdCAgICovCi0vKiAgICAgICAgICAgICAgICAgICAgZm9yIGFuIEF1ZGlvIFN0cmVhbSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogIFRhcmdldEdhaW4gICAgICAtIFRhcmdldEdhaW4gdmFsdWUgaW4gUSAxNi4xNSBmb3JtYXQgICAgICAgICAgICAgICAgKi8KLS8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiBSRVRVUk5TOiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogIHZvaWQgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotCi12b2lkIExWQ19NaXhlcl9TZXRUYXJnZXQoTFZNaXhlcjNfc3QgKnBTdHJlYW0sCi0gICAgICAgICAgICAgICAgICAgICAgICBMVk1fSU5UMzIgICAgICAgICAgIFRhcmdldEdhaW4pCi17Ci0gICAgTFZNX0lOVDMyICAgICAgIFNoaWZ0PTA7Ci0gICAgTFZNX0lOVDMyICAgICAgIEN1cnJlbnRHYWluOwotICAgIExWTV9JTlQzMiAgICAgICBNYXhHYWluPVRhcmdldEdhaW47ICAgICAgICAgICAgICAgICAgICAgLy8gTWF4R2FpbiBpcyBpbiBRMTYuMTUgZm9ybWF0Ci0gICAgTWl4X1ByaXZhdGVfc3QgICpwSW5zdGFuY2U9KE1peF9Qcml2YXRlX3N0ICopcFN0cmVhbS0+UHJpdmF0ZVBhcmFtczsKLSAgICBDdXJyZW50R2Fpbj1wSW5zdGFuY2UtPkN1cnJlbnQ+PigxNi1wSW5zdGFuY2UtPlNoaWZ0KTsgIC8vIEN1cnJlbnRHYWluIGluIFExNi4xNSBmb3JtYXQKLSAgICBpZihDdXJyZW50R2Fpbj5NYXhHYWluKQotICAgICAgICBNYXhHYWluPUN1cnJlbnRHYWluOyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gTWF4R2Fpbj1tYXgoQ3VycmVudEdhaW4sVGFyZ2V0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KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLS8qIEZVTkNUSU9OOiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgIExWTWl4ZXIzX1NldFRpbWVDb25zdGFudCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qIERFU0NSSVBUSU9OOiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgVGhpcyBmdW5jdGlvbiBjYWxjdWxhdGVzIHRoZSBzdGVwIGNoYW5nZSBmb3IgZnJhY3Rpb25hbCBnYWluIGZvciBhICAqLwotLyogIGdpdmVuIHRpbWUgY29uc3RhbnQsIHNhbXBsZSByYXRlIGFuZCBudW0gY2hhbm5lbHMgICAgICAgICAgICAgICAgICAgKi8KLS8qICBEZWx0YT0oMjE0NzQ4MzY0Nyo0KjEwMDApLyhOdW1DaGFubmVscypTYW1wbGVSYXRlKlRjX21pbGxpc2VjKSAgICAgICovCi0vKiAgaW4gUSAwLjMxIGZvcm1hdCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qIFBBUkFNRVRFUlM6ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgcFN0cmVhbSAgICAgLSBwdHIgdG8gSW5zdGFuY2UgUGFyYW1ldGVyIFN0cnVjdHVyZSBMVk1peGVyM19zdCBmb3IgYW4qLwotLyogICAgICAgICAgICAgICAgQXVkaW8gU3RyZWFtICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICBUY19taWxsaXNlYyAtIFRpbWVDb25zdGFudCBpLmUgdGltZSByZXF1aXJlZCBpbiBtaWxsaSBzZWNvbmQgdG8gICAgICovCi0vKiAgICAgICAgICAgICAgICBnbyBmcm9tIGxpbmVhciBmcmFjdGlvbmFsIGdhaW4gb2YgMCB0byAwLjk5OTk5OTk5ICAgICAqLwotLyogIEZzICAgICAgICAgIC0gTFZNX0ZzX2VuIGVudW1lcmF0b3IgZm9yIFNhbXBsaW5nIEZyZXF1ZW5jeSAgICAgICAgICAgKi8KLS8qICBOdW1DaGFubmVscyAtIE51bWJlciBvZiBjaGFubmVscyBpbiBBdWRpbyBTdHJlYW0gMT1Nb25vLCAyPVN0ZXJlbyAgICovCi0vKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogVVBEQVRFUzogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICBEZWx0YSAgICAgICAtIHRoZSBzdGVwIGNoYW5nZSBmb3IgZnJhY3Rpb25hbCBnYWluIHBlciA0IHNhbXBsZXMgICAgICovCi0vKiAgICAgICAgICAgICAgICBpbiBRMC4zMSBmb3JtYXQgZm9yIGEgZ2l2ZW4gVGltZSBDb25zdGFudCwgICAgICAgICAgICAqLwotLyogICAgICAgICAgICAgICAgU2FtcGxlIFJhdGUgYW5kIE51bUNoYW5uZWxzICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qIFJFVFVSTlM6ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgdm9pZCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLQotdm9pZCBMVkNfTWl4ZXJfU2V0VGltZUNvbnN0YW50KExWTWl4ZXIzX3N0ICpwU3RyZWFtLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgIExWTV9JTlQzMiAgICAgICAgICAgVGNfbWlsbGlzZWMsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgTFZNX0ZzX2VuICAgICAgICAgICBGcywKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBMVk1fSU5UMTYgICAgICAgICAgIE51bUNoYW5uZWxzKQotewotICAgIExWTV9JTlQzMiAgIERlbHRhVGFibGVbOV09ezEwNzM3NDE4MjQsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgNzc5MTMyMzg5LAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDcxNTgyNzg4MiwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA1MzY4NzA5MTIsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMzg5NTY2MTk0LAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDM1NzkxMzk0MSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAyNjg0MzU0NTYsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMTk0NzgzMDk3LAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDE3ODk1Njk3MX07Ci0gICAgTWl4X1ByaXZhdGVfc3QgICpwSW5zdGFuY2U9KE1peF9Qcml2YXRlX3N0ICopcFN0cmVhbS0+UHJpdmF0ZVBhcmFtczsKLSAgICBMVk1fSU5UMzIgICBEZWx0YT1EZWx0YVRhYmxlW0ZzXTsKLSAgICBEZWx0YT1EZWx0YT4+KE51bUNoYW5uZWxzLTEpOwotCi0gICAgaWYoVGNfbWlsbGlzZWM9PTApCi0gICAgICAgIERlbHRhPTB4N0ZGRkZGRkY7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IGZpbGUgZXhjZXB0IGluIGNvbXBsaWFuY2Ugd2l0aCB0aGUgTGljZW5zZS4KLSAqIFlvdSBtYXkgb2J0YWluIGEgY29weSBvZiB0aGUgTGljZW5zZSBhdAotICoKLSAqICAgICAgaHR0cDovL3d3dy5hcGFjaGUub3JnL2xpY2Vuc2VzL0xJQ0VOU0UtMi4wCi0gKgotICogVW5sZXNzIHJlcXVpcmVkIGJ5IGFwcGxpY2FibGUgbGF3IG9yIGFncmVlZCB0byBpbiB3cml0aW5nLCBzb2Z0d2FyZQotICogZGlzdHJpYnV0ZWQgdW5kZXIgdGhlIExpY2Vuc2UgaXMgZGlzdHJpYnV0ZWQgb24gYW4gIkFTIElTIiBCQVNJUywKLSAqIFdJVEhPVVQgV0FSUkFOVElFUyBPUiBDT05ESVRJT05TIE9GIEFOWSBLSU5ELCBlaXRoZXIgZXhwcmVzcyBvciBpbXBsaWVkLgotICogU2VlIHRoZSBMaWNlbnNlIGZvciB0aGUgc3BlY2lmaWMgbGFuZ3VhZ2UgZ292ZXJuaW5nIHBlcm1pc3Npb25zIGFuZAotICogbGltaXRhdGlvbnMgdW5kZXIgdGhlIExpY2Vuc2UuCi0gKi8KLQotI2luY2x1ZGUgIkxWTV9UeXBlcy5oIgotI2luY2x1ZGUgIkxWTV9NYWNyb3MuaCIKLSNpbmNsdWRlICJMVkNfTWl4ZXJfUHJpdmF0ZS5oIgotCi0KLS8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0vKiBGVU5DVElPTjogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogICBMVk1peGVyM19WYXJTbG9wZV9TZXRUaW1lQ29uc3RhbnQgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiBERVNDUklQVElPTjogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogIFRoaXMgZnVuY3Rpb24gY2FsY3VsYXRlcyB0aGUgc3RlcCBjaGFuZ2UgZm9yIGZyYWN0aW9uYWwgZ2FpbiBmb3IgYSAgKi8KLS8qICBnaXZlbiB0aW1lIGNvbnN0YW50LCBzYW1wbGUgcmF0ZSBhbmQgbnVtIGNoYW5uZWxzICAgICAgICAgICAgICAgICAgICovCi0vKiAgRGVsdGE9KDIxNDc0ODM2NDcqNCoxMDAwKS8oTnVtQ2hhbm5lbHMqU2FtcGxlUmF0ZSpUY19taWxsaXNlYykgICAgICAqLwotLyogIGluIFEgMC4zMSBmb3JtYXQgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiBQQVJBTUVURVJTOiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogIHBTdHJlYW0gICAgIC0gcHRyIHRvIEluc3RhbmNlIFBhcmFtZXRlciBTdHJ1Y3R1cmUgTFZNaXhlcjNfc3QgZm9yIGFuKi8KLS8qICAgICAgICAgICAgICAgIEF1ZGlvIFN0cmVhbSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgVGNfbWlsbGlzZWMgLSBUaW1lQ29uc3RhbnQgaS5lIHRpbWUgcmVxdWlyZWQgaW4gbWlsbGkgc2Vjb25kIHRvICAgICAqLwotLyogICAgICAgICAgICAgICAgZ28gZnJvbSBsaW5lYXIgZnJhY3Rpb25hbCBnYWluIG9mIDAgdG8gMC45OTk5OTk5OSAgICAgKi8KLS8qICBGcyAgICAgICAgICAtIExWTV9Gc19lbiBlbnVtZXJhdG9yIGZvciBTYW1wbGluZyBGcmVxdWVuY3kgICAgICAgICAgICovCi0vKiAgTnVtQ2hhbm5lbHMgLSBOdW1iZXIgb2YgY2hhbm5lbHMgaW4gQXVkaW8gU3RyZWFtIDE9TW9ubywgMj1TdGVyZW8gICAqLwotLyogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qIFVQREFURVM6ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgRGVsdGEgICAgICAgLSB0aGUgc3RlcCBjaGFuZ2UgZm9yIGZyYWN0aW9uYWwgZ2FpbiBwZXIgNCBzYW1wbGVzICAgICAqLwotLyogICAgICAgICAgICAgICAgaW4gUTAuMzEgZm9ybWF0IGZvciBhIGdpdmVuIFRpbWUgQ29uc3RhbnQsICAgICAgICAgICAgKi8KLS8qICAgICAgICAgICAgICAgIFNhbXBsZSBSYXRlIGFuZCBOdW1DaGFubmVscyAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiBSRVRVUk5TOiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogIHZvaWQgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0KLXZvaWQgTFZDX01peGVyX1ZhclNsb3BlX1NldFRpbWVDb25zdGFudCggTFZNaXhlcjNfc3QgKnBTdHJlYW0sCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTFZNX0lOVDMyICAgICAgICAgICBUY19taWxsaXNlYywKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBMVk1fRnNfZW4gICAgICAgICAgIEZzLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIExWTV9JTlQxNiAgICAgICAgICAgTnVtQ2hhbm5lbHMpCi17Ci0gICAgTFZNX0lOVDMyICAgRGVsdGFUYWJsZVs5XT17MTA3Mzc0MTgyNCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA3NzkxMzIzODksCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgNzE1ODI3ODgyLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDUzNjg3MDkxMiwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAzODk1NjYxOTQsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMzU3OTEzOTQxLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDI2ODQzNTQ1NiwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAxOTQ3ODMwOTcsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMTc4OTU2OTcxfTsKLSAgICBNaXhfUHJpdmF0ZV9zdCAgKnBJbnN0YW5jZT0oTWl4X1ByaXZhdGVfc3QgKilwU3RyZWFtLT5Qcml2YXRlUGFyYW1zOwotICAgIExWTV9JTlQzMiAgIERlbHRhPURlbHRhVGFibGVbRnNdOwotCi0gICAgTFZNX0lOVDMyICAgQ3VycmVudDsKLSAgICBMVk1fSU5UMzIgICBUYXJnZXQ7Ci0KLSAgICBEZWx0YT1EZWx0YT4+KE51bUNoYW5uZWxzLTEpOwotCi0gICAgLyogIEdldCBnYWluIHZhbHVlcyAgKi8KLSAgICBDdXJyZW50ID0gTFZDX01peGVyX0dldEN1cnJlbnQoIHBTdHJlYW0gKTsKLSAgICBUYXJnZXQgPSBMVkNfTWl4ZXJfR2V0VGFyZ2V0KCBwU3RyZWFtICk7Ci0KLSAgICBpZiAoQ3VycmVudCAhPSBUYXJnZXQpCi0gICAgewotICAgICAg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XJBcml0aG1ldGljLmgiCi0jaW5jbHVkZSAiQklRVUFELmgiCi0jaW5jbHVkZSAiRmlsdGVyLmgiCi0KLQotLyotLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tKi8KLS8qIEZVTkNUSU9OOiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgIHZvaWQgTFZNX0ZPX0xQRiggICBMVk1fSU5UMzIgICAgICAgdyAsICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogICAgICAgICAgICAgICAgICAgICAgRk9fQzMyX0NvZWZzX3QgICpwQ29lZmZzKTsgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogREVTQ1JJUFRJT046ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICAgIFRoaXMgZnVuY3Rpb24gY2FsY3VsYXRlcyB0aGUgY29lZmZpY2llbnQgb2YgZmlyc3Qgb3JkZXIgbG93IHBhc3MgICAgICovCi0vKiAgICBmaWx0ZXIuIEl0IHVzZXMgdGhlIGVxdWF0aW9uczogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICAgIEIxICAgID0gKHRhbih3LzIpIC0gMSApICAvICAodGFuKHcvMikgKyAxICkgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgICBBMCAgICA9ICgxIC0gQjEpIC8gMiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogICAgQTEgICAgPSBBMCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgICBUaGUgdmFsdWUgb2YgQjEgaXMgdGhlbiBjYWxjdWxhdGVkIGRpcmVjdGx5IGZyb20gdGhlIHZhbHVlIHcgYnkgYSAgICAqLwotLyogICAgcG9seW5vbWlhbCBleHBhbnNpb24gdXNpbmcgYSA5dGggb3JkZXIgcG9seW5vbWlhbC4gSXQgdXNlcyB0aGUgICAgICAgKi8KLS8qICAgIGZvbGxvd2luZyB0YWJsZSBvZiAzMi1iaXQgaW50ZWdlciBwb2x5bm9taWFsIGNvZWZmaWNpZW50czogICAgICAgICAgICovCi0vKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogICBDb2VmZmljaWVudCAgICBWYWx1ZSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICAgQTAgICAgICAgICAgICAgLTgzODg1NzEgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgIEExICAgICAgICAgICAgIDMzNTQ3NzQ0ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogICBBMiAgICAgICAgICAgICAtNjY4MTY3OTEgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICAgQTMgICAgICAgICAgICAgMTczMzc1MzA4ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgIEE0ICAgICAgICAgICAgIC0zODg0Mzc1NzMgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogICBBNSAgICAgICAgICAgICA3NTI5NzUzODMgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICAgQTYgICAgICAgICAgICAgLTExMDMwMTY2NjMgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgIEE3ICAgICAgICAgICAgIDExMjE4NDg1NjcgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogICBBOCAgICAgICAgICAgICAtNjg4MDc4MTU5ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICAgQTkgICAgICAgICAgICAgMTk0NjY5NTc3ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgIEExMCAgICAgICAgICAgIDggICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICBZID0gKEEwICsgQTEqWCArIEEyKlgyICsgQTMqWDMgKyCFLi4gKyBBTip4TikgPDwgQU4rMSAgICAgICAgICAgICAgICAgICovCi0vKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qIFBBUkFNRVRFUlM6ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogIHcgICAgICAgICAgICAgICBTYW1wbGUgcmF0ZSBpbiByYWRpYW5zLCAgd2hlcmU6ICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICAgICAgICAgICAgICAgICAgdyA9IDIgKiBQaSAqIEZjIC8gRnMgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgICAgICAgICAgICAgICAgIEZjICAgaXMgdGhlIGNvcm5lciBmcmVxdWVuY3kgaW4gSHogICAgICAgICAgICAgICAgICAgICAqLwotLyogICAgICAgICAgICAgICAgICBGcyAgIGlzIHRoZSBzYW1wbGUgcmF0ZSBpbiBIeiAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICAgICAgICAgICAgICAgICAgdyBpcyBpbiBRMi4yOSBmb3JtYXQgYW5kIGRhdGEgcmFuZ2UgaXMgWzAgUGldICAgICAgICAgICovCi0vKiAgcENvZWZmcyAgICAgICAgIFBvaW50cyB0byB0aGUgZmlsdGVyIGNvZWZmaWNpZW50cyBjYWxjdWxhdGVkIGhlcmUgICAgICAqLwotLyogICAgICAgICAgICAgICAgICBpbiBRMS4zMCBmb3JtYXQgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qIFJFVFVSTlM6ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyotLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tKi8KLQotTFZNX0lOVDMyIExWTV9GT19IUEYoICAgTFZNX0lOVDMyICAgICAgIHcsCi0gICAgICAgICAgICAgICAgICAgICAgICBGT19DMzJfQ29lZnNfdCAgKnBDb2VmZnMpCi17Ci0gICAgTFZNX0lOVDMyIFksQ29lZmZpY2llbnRzWzEzXT17ICAtODM4ODU3MSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDMzNTQ3NzQ0LAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLTY2ODE2NzkxLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMTczMzc1MzA4LAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLTM4ODQzNzU3MywKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDc1Mjk3NTM4MywKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC0xMTAzMDE2NjYzLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMTEyMTg0ODU2NywKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC02ODgwNzgxNTksCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAxOTQ2Njk1NzcsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA4LAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDB9OwotICAgIFk9TFZNX1BvbHlub21pYWwoICAgICAgICAgICAoTFZNX1VJTlQxNik5LAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgQ29lZmZpY2llbnRzLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdyk7Ci0gICAgcENvZWZmcy0+QjE9LVk7ICAgICAgICAgLyogU3RvcmUgLUIxIGluIGZpbHRlciBzdHJ1Y3R1cmUgaW5zdGVhZCBvZiBCMSEqLwotICAgICAgICAgICAgICAgICAgICAgICAgICAgIC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2Vmc190ICAqcENvZWZmcyk7ICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qIERFU0NSSVBUSU9OOiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgICBUaGlzIGZ1bmN0aW9uIGNhbGN1bGF0ZXMgdGhlIGNvZWZmaWNpZW50IG9mIGZpcnN0IG9yZGVyIGxvdyBwYXNzICAgICAqLwotLyogICAgZmlsdGVyLiBJdCB1c2VzIHRoZSBlcXVhdGlvbnM6ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgICBCMSAgICA9ICh0YW4ody8yKSAtIDEgKSAgLyAgKHRhbih3LzIpICsgMSApICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogICAgQTAgICAgPSAoMSArIEIxKSAvIDIgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICAgIEExICAgID0gQTAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogICAgVGhlIHZhbHVlIG9mIEIxIGlzIHRoZW4gY2FsY3VsYXRlZCBkaXJlY3RseSBmcm9tIHRoZSB2YWx1ZSB3IGJ5IGEgICAgKi8KLS8qICAgIHBvbHlub21pYWwgZXhwYW5zaW9uIHVzaW5nIGEgOXRoIG9yZGVyIHBvbHlub21pYWwuIEl0IHVzZXMgdGhlICAgICAgICovCi0vKiAgICBmb2xsb3dpbmcgdGFibGUgb2YgMzItYml0IGludGVnZXIgcG9seW5vbWlhbCBjb2VmZmljaWVudHM6ICAgICAgICAgICAqLwotLyogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICAgQ29lZmZpY2llbnQgICAgVmFsdWUgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgIEEwICAgICAgICAgICAgIC04Mzg4NTcxICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogICBBMSAgICAgICAgICAgICAzMzU0Nzc0NCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICAgQTIgICAgICAgICAgICAgLTY2ODE2NzkxICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgIEEzICAgICAgICAgICAgIDE3MzM3NTMwOCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogICBBNCAgICAgICAgICAgICAtMzg4NDM3NTczICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICAgQTUgICAgICAgICAgICAgNzUyOTc1MzgzICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgIEE2ICAgICAgICAgICAgIC0xMTAzMDE2NjYzICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogICBBNyAgICAgICAgICAgICAxMTIxODQ4NTY3ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICAgQTggICAgICAgICAgICAgLTY4ODA3ODE1OSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgIEE5ICAgICAgICAgICAgIDE5NDY2OTU3NyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogICBBMTAgICAgICAgICAgICA4ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgWSA9IChBMCArIEExKlggKyBBMipYMiArIEEzKlgzICsghS4uICsgQU4qeE4pIDw8IEFOKzEgICAgICAgICAgICAgICAgICAqLwotLyogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiBQQVJBTUVURVJTOiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICB3ICAgICAgICAgICAgICAgU2FtcGxlIHJhdGUgaW4gcmFkaWFucywgIHdoZXJlOiAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgICAgICAgICAgICAgICAgIHcgPSAyICogUGkgKiBGYyAvIEZzICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogICAgICAgICAgICAgICAgICBGYyAgIGlzIHRoZSBjb3JuZXIgZnJlcXVlbmN5IGluIEh6ICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICAgICAgICAgICAgICAgICAgRnMgICBpcyB0aGUgc2FtcGxlIHJhdGUgaW4gSHogICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgICAgICAgICAgICAgICAgIHcgaXMgaW4gUTIuMjkgZm9ybWF0IGFuZCBkYXRhIHJhbmdlIGlzIFswIFBpXSAgICAgICAgICAqLwotLyogIHBDb2VmZnMgICAgICAgICBQb2ludHMgdG8gdGhlIGZpbHRlciBjb2VmZmljaWVudHMgY2FsY3VsYXRlZCBoZXJlICAgICAgKi8KLS8qICAgICAgICAgICAgICAgICAgaW4gUTEuMzAgZm9ybWF0ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiBSRVRVUk5TOiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSovCi0KLUxWTV9JTlQzMiBMVk1fRk9fTFBGKCAgIExWTV9JTlQzMiAgICAgICB3LAotICAgICAgICAgICAgICAgICAgICAgICAgRk9fQzMyX0NvZWZzX3QgICpwQ29lZmZzKQotewotICAgIExWTV9JTlQzMiBZLENvZWZmaWNpZW50c1sxM109eyAgLTgzODg1NzEsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAzMzU0Nzc0NCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC02NjgxNjc5MSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDE3MzM3NTMwOCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC0zODg0Mzc1NzMsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA3NTI5NzUzODMsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAtMTEwMzAxNjY2MywKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDExMjE4NDg1NjcsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAtNjg4MDc4MTU5LAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMTk0NjY5NTc3LAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOH07Ci0gICAgWT1MVk1fUG9seW5vbWlhbCggICAgICAgICAgIChMVk1fVUlOVDE2KTksCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBDb2VmZmljaWVudHMsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB3KTsKLSAgICBwQ29lZmZzLT5CMT0tWTsgICAgIC8vIFN0b3JlIC1CMSBpbiBmaWx0ZXIgc3RydWN0dXJlIGluc3RlYWQgb2YgQjEhCi0gICAgICAgICAgICAgICAgICAgICAgICAvLyBBMD0oMStCMSkvMj0gQjEvMiArIDAuNQotICAgIFk9WT4+MTsgICAgICAgICAgICAgLy8gQTA9WT1CMS8yCi0gICAgWT1ZKzB4NDAwMDAwMDA7ICAgICAvLyBBMD1ZPShCMS8yICsgMC41KQotICAgIE1VTDMyeDE2SU5UTzMyKFksIEZJTFRFUl9MT1NTICxwQ29lZmZzLT5BMCAsMTUpICAgIC8vIEFwcGx5IGxvc3MgdG8gYXZvaWQgb3ZlcmZsb3cKLSAgICBwQ29lZmZzLT5BMT1wQ29lZmZzLT5BMDsKLSAgICByZXR1cm4gMTsKLX0KLQpkaWZmIC0tZ2l0IGEvbWVkaWEvbGliZWZmZWN0cy9sdm0vbGliL0NvbW1vbi9zcmMvTFZNX0dldE9tZWdhLmMgYi9tZWRpYS9saWJlZmZlY3RzL2x2bS9saWIvQ29tbW9uL3NyYy9MVk1fR2V0T21lZ2EuYwpkZWxldGVkIGZpbGUgbW9kZSA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pbmNsdWRlICJMVk1fVHlwZXMuaCIKLSNpbmNsdWRlICJGaWx0ZXIuaCIKLSNpbmNsdWRlICJMVk1fTWFjcm9zLmgiCi0KLS8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0vKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogRGVmaW5lcyBhbmQgVGFibGVzIGZvciAyKlBpL0ZzICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotCi0jZGVmaW5lIExWVkRMXzJQaUJ5XzgwMDAgICAgICAgIDE3MjcxMDg4MjYgIC8qIEluIFE0MSBmb3JtYXQgKi8KLSNkZWZpbmUgTFZWRExfMlBpQnlfMTEwMjUgICAgICAgMTI1MzIzMDg5NCAgLyogSW4gUTQxIGZvcm1hdCAqLwotI2RlZmluZSBMVlZETF8yUGlCeV8xMjAwMCAgICAgICAxMTUxNDA1ODg0ICAvKiBJbiBRNDEgZm9ybWF0ICovCi0KLSNkZWZpbmUgTFZWRExfMlBpQnlGc19TSElGVDEgICAgMTIgICAgICAgICAgLyogUWZvcm1hdCBzaGlmdCBmb3IgOGtIeiwgMTEuMDI1a0h6IGFuZCAxMmtIeiBpLmUuIDEyPTQxLTI5ICovCi0jZGVmaW5lIExWVkRMXzJQaUJ5RnNfU0hJRlQyICAgIDEzICAgICAgICAgIC8qIFFmb3JtYXQgc2hpZnQgZm9yIDE2a0h6LCAyMi4wNTBrSHogYW5kIDI0a0h6IGkuZS4gMTM9NDItMjkgKi8KLSNkZWZpbmUgTFZWRExfMlBpQnlGc19TSElGVDMgICAgMTQgICAgICAgICAgLyogUWZvcm1hdCBzaGlmdCBmb3IgMzJrSHosIDQ0LjFrSHogYW5kIDQ4a0h6IGkuZS4gMTQ9NDMtMjkgKi8KLQotY29uc3QgTFZNX0lOVDMyICAgICBMVlZETF8yUGlPbkZzVGFibGVbXSA9ICB7TFZWRExfMlBpQnlfODAwMCAsIC8qIDhrSHogaW4gUTQxLCAxNmtIeiBpbiBRNDIsIDMya0h6IGluIFE0MyAqLwotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBMVlZETF8yUGlCeV8xMTAyNSwgIC8qIDExMDI1IEh6IGluIFE0MSwgMjIwNTBIeiBpbiBRNDIsIDQ0MTAwIEh6IGluIFE0MyovCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIExWVkRMXzJQaUJ5XzEyMDAwfTsgLyogMTJrSHogaW4gUTQxLCAyNGtIeiBpbiBRNDIsIDQ4a0h6IGluIFE0MyAqLwotCi0KLWNvbnN0IExWTV9JTlQzMiAgICAgTFZWRExfMlBpT25Gc1NoaWZ0VGFibGVbXT17TFZWRExfMlBpQnlGc19TSElGVDEgLCAgICAgICAgIC8qIDhrSHosIDExMDI1SHosIDEya0h6ICovCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIExWVkRMXzJQaUJ5RnNfU0hJRlQyLCAgICAgICAgICAvKiAxNmtIeiwgMjIwNTBIeiwgMjRrSHoqLwotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBMVlZETF8yUGlCeUZzX1NISUZUM307ICAgICAgICAgLyogMzJrSHosIDQ0MTAwSHosIDQ4a0h6ICovCi0KLS8qLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSovCi0vKiBGVU5DVElPTjogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogICBMVk1fR2V0T21lZ2EgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiBMVk1fSU5UMzIgTFZNX0dldE9tZWdhKExWTV9VSU5UMTYgICAgICAgICAgICAgICAgICBGYywgICAgICAgICAgICAgICAgICAqLwotLyogICAgICAgICAgICAgICAgICAgICAgICBMVk1fRnNfZW4gICAgICAgICAgICAgICAgICAgRnMpICAgICAgICAgICAgICAgICAgKi8KLS8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiBERVNDUklQVElPTjogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogICBUaGlzIGZ1bmN0aW9uIGNhbGN1bGF0ZXMgdGhlIHZhbHVlIG9mIHcgdXNpbmcgRmMgYW5kIEZzICAgICAgICAgICAgICAgKi8KLS8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiBQQVJBTUVURVJTOiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICBMVk1fVUlOVDE2ICAgICAgICAgIEZjICAgICBUaGUgY29ybm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AgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogTWl4ZXIgbGlicmFyeSB0YWJsZXMgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiBDb2VmZmljaWVudHMgYW5kIHRhYmxlIHZhbHVlcyBmb3IgdGhlIG1peGVyIGxpYnJhcnksIGdlbmVyYXRlZCBieSB0aGUgTWF0bGFiICAgICAqLwotLyogU2NyaXB0OiBNaXhlcl9HZW5lcmF0ZUNvZWZmcy5tICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotCi0jaWZuZGVmIF9fTFZNX01JWEVSX0ZJTFRFUl9DT0VGRlNfSF9fCi0jZGVmaW5lIF9fTFZNX01JWEVSX0ZJTFRFUl9DT0VGRlNfSF9fCi0KLQotLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLS8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiBBbHBoYSBUaW1lIENvbnN0YW50IHRhYmxlICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0KLSNkZWZpbmUgQWxwaGFfVGFibGVTaXplICAgICAgICAgICAgICAgICAgICAgICAgNTAgICAgICAvKiBUaGUgbnVtYmVyIG9mIHRhYmxlIGVudGlyZXMgKi8KLSNkZWZpbmUgQUxQSEFfMCAgICAgICAgICAgICAgICAgICAgICAgIDIxNDc0ODA3NjkgICAgICAvKiBGbG9hdGluZyBwb2ludCBBbHBoYSA9IDAuOTk5OTk5ICovCi0jZGVmaW5lIEFMUEhBXzEgICAgICAgICAgICAgICAgICAgICAgICAyMTQ3NDc5NTc3ICAgICAgLyogRmxvYXRpbmcgcG9pbnQgQWxwaGEgPSAwLjk5OTk5OCAqLwotI2RlZmluZSBBTFBIQV8yICAgICAgICAgICAgICAgICAgICAgICAgMjE0NzQ3Nzg5MiAgICAgIC8qIEZsb2F0aW5nIHBvaW50IEFscGhhID0gMC45OTk5OTcgKi8KLSNkZWZpbmUgQUxQSEFfMyAgICAgICAgICAgICAgICAgICAgICAgIDIxNDc0NzU1MTAgICAgICAvKiBGbG9hdGluZyBwb2ludCBBbHBoYSA9IDAuOTk5OTk2ICovCi0jZGVmaW5lIEFMUEhBXzQgICAgICAgICAgICAgICAgICAgICAgICAyMTQ3NDcyMTQxICAgICAgLyogRmxvYXRpbmcgcG9pbnQgQWxwaGEgPSAwLjk5OTk5NSAqLwotI2RlZmluZSBBTFBIQV81ICAgICAgICAgICAgICAgICAgICAgICAgMjE0NzQ2NzM3NyAgICAgIC8qIEZsb2F0aW5nIHBvaW50IEFscGhhID0gMC45OTk5OTIgKi8KLSNkZWZpbmUgQUxQSEFfNiAgICAgICAgICAgICAgICAgICAgICAgIDIxNDc0NjA2NDIgICAgICAvKiBGbG9hdGluZyBwb2ludCBBbHBoYSA9IDAuOTk5OTg5ICovCi0jZGVmaW5lIEFMUEhBXzcgICAgICAgICAgICAgICAgICAgICAgICAyMTQ3NDUxMTE4ICAgICAgLyogRmxvYXRpbmcgcG9pbnQgQWxwaGEgPSAwLjk5OTk4NSAqLwotI2RlZmluZSBBTFBIQV84ICAgICAgICAgICAgICAgICAgICAgICAgMjE0NzQzNzY1MSAgICAgIC8qIEZsb2F0aW5nIHBvaW50IEFscGhhID0gMC45OTk5NzkgKi8KLSNkZWZpbmUgQUxQSEFfOSAgICAgICAgICAgICAgICAgICAgICAgIDIxNDc0MTg2MDggICAgICAvKiBGbG9hdGluZyBwb2ludCBBbHBoYSA9IDAuOTk5OTcwICovCi0jZGVmaW5lIEFMUEhBXzEwICAgICAgICAgICAgICAgICAgICAgICAyMTQ3MzkxNjgzICAgICAgLyogRmxvYXRpbmcgcG9pbnQgQWxwaGEgPSAwLjk5OTk1NyAqLwotI2RlZmluZSBBTFBIQV8xMSAgICAgICAgICAgICAgICAgICAgICAgMjE0NzM1MzYxMSAgICAgIC8qIEZsb2F0aW5nIHBvaW50IEFscGhhID0gMC45OTk5MzkgKi8KLSNkZWZpbmUgQUxQSEFfMTIgICAgICAgICAgICAgICAgICAgICAgIDIxNDcyOTk3NzkgICAgICAvKiBGbG9hdGluZyBwb2ludCBBbHBoYSA9IDAuOTk5OTE0ICovCi0jZGVmaW5lIEFMUEhBXzEzICAgICAgICAgICAgICAgICAgICAgICAyMTQ3MjIzNjYyICAgICAgLyogRmxvYXRpbmcgcG9pbnQgQWxwaGEgPSAwLjk5OTg3OSAqLwotI2RlZmluZSBBTFBIQV8xNCAgICAgICAgICAgICAgICAgICAgICAgMjE0NzExNjAzNyAgICAgIC8qIEZsb2F0aW5nIHBvaW50IEFscGhhID0gMC45OTk4MjkgKi8KLSNkZWZpbmUgQUxQSEFfMTUgICAgICAgICAgICAgICAgICAgICAgIDIxNDY5NjM4NjUgICAgICAvKiBGbG9hdGluZyBwb2ludCBBbHBoYSA9IDAuOTk5NzU4ICovCi0jZGVmaW5lIEFMUEhBXzE2ICAgICAgICAgICAgICAgICAgICAgICAyMTQ2NzQ4NzEyICAgICAgLyogRmxvYXRpbmcgcG9pbnQgQWxwaGEgPSAwLjk5OTY1OCAqLwotI2RlZmluZSBBTFBIQV8xNyAgICAgICAgICAgICAgICAgICAgICAgMjE0NjQ0NDUyMiAgICAgIC8qIEZsb2F0aW5nIHBvaW50IEFscGhhID0gMC45OTk1MTYgKi8KLSNkZWZpbmUgQUxQSEFfMTggICAgICAgICAgICAgICAgICAgICAgIDIxNDYwMTQ0NzIgICAgICAvKiBGbG9hdGluZyBwb2ludCBBbHBoYSA9IDAuOTk5MzE2ICovCi0jZGVmaW5lIEFMUEhBXzE5ICAgICAgICAgICAgICAgICAgICAgICAyMTQ1NDA2NTI3ICAgICAgLyogRmxvYXRpbmcgcG9pbnQgQWxwaGEgPSAwLjk5OTAzMyAqLwotI2RlZmluZSBBTFBIQV8yMCAgICAgICAgICAgICAgICAgICAgICAgMjE0NDU0NzE4OCAgICAgIC8qIEZsb2F0aW5nIHBvaW50IEFscGhhID0gMC45OTg2MzMgKi8KLSNkZWZpbmUgQUxQSEFfMjEgICAgICAgICAgICAgICAgICAgICAgIDIxNDMzMzI2NjkgICAgICAvKiBGbG9hdGluZyBwb2ludCBBbHBoYSA9IDAuOTk4MDY3ICovCi0jZGVmaW5lIEFMUEhBXzIyICAgICAgICAgICAgICAgICAgICAgICAyMTQxNjE2NTE0ICAgICAgLyogRmxvYXRpbmcgcG9pbnQgQWxwaGEgPSAwLjk5NzI2OCAqLwotI2RlZmluZSBBTFBIQV8yMyAgICAgICAgICAgICAgICAgICAgICAgMjEzOTE5MjIxNSAgICAgIC8qIEZsb2F0aW5nIHBvaW50IEFscGhhID0gMC45OTYxMzkgKi8KLSNkZWZpbmUgQUxQSEFfMjQgICAgICAgICAgICAgICAgICAgICAgIDIxMzU3Njg5MzkgICAgICAvKiBGbG9hdGluZyBwb2ludCBBbHBoYSA9IDAuOTk0NTQ1ICovCi0jZGVmaW5lIEFMUEhBXzI1ICAgICAgICAgICAgICAgICAgICAgICAyMTMwOTM3Nzc0ICAgICAgLyogRmxvYXRpbmcgcG9pbnQgQWxwaGEgPSAwLjk5MjI5NSAqLwotI2RlZmluZSBBTFBIQV8yNiAgICAgICAgICAgICAgICAgICAgICAgMjEyNDEyNTE1MyAgICAgIC8qIEZsb2F0aW5nIHBvaW50IEFscGhhID0gMC45ODkxMjMgKi8KLSNkZWZpbmUgQUxQSEFfMjcgICAgICAgICAgICAgICAgICAgICAgIDIxMTQ1MjkyNjMgICAgICAvKiBGbG9hdGluZyBwb2ludCBBbHBoYSA9IDAuOTg0NjU0ICovCi0jZGVmaW5lIEFMUEhBXzI4ICAgICAgICAgICAgICAgICAgICAgICAyMTAxMDM0NjEyICAgICAgLyogRmxvYXRpbmcgcG9pbnQgQWxwaGEgPSAwLjk3ODM3MCAqLwotI2RlZmluZSBBTFBIQV8yOSAgICAgICAgICAgICAgICAgICAgICAgMjA4MjEwMDAzMCAgICAgIC8qIEZsb2F0aW5nIHBvaW50IEFscGhhID0gMC45Njk1NTMgKi8KLSNkZWZpbmUgQUxQSEFfMzAgICAgICAgICAgICAgICAgICAgICAgIDIwNTU2MTczOTggICAgICAvKiBGbG9hdGluZyBwb2ludCBBbHBoYSA9IDAuOTU3MjIxICovCi0jZGVmaW5lIEFMUEhBXzMxICAgICAgICAgICAgICAgICAgICAgICAyMDE4NzQ0ODI0ICAgICAgLyogRmxvYXRpbmcgcG9pbnQgQWxwaGEgPSAwLjk0MDA1MSAqLwotI2RlZmluZSBBTFBIQV8zMiAgICAgICAgICAgICAgICAgICAgICAgMTk2NzczMzAxNSAgICAgIC8qIEZsb2F0aW5nIHBvaW50IEFscGhhID0gMC45MTYyOTcgKi8KLSNkZWZpbmUgQUxQSEFfMzMgICAgICAgICAgICAgICAgICAgICAgIDE4OTc3OTQ1ODcgICAgICAvKiBGbG9hdGluZyBwb2ludCBBbHBoYSA9IDAuODgzNzI5ICovCi0jZGVmaW5lIEFMUEhBXzM0ICAgICAgICAgICAgICAgICAgICAgICAxODAzMTIzMjM0ICAgICAgLyogRmxvYXRpbmcgcG9pbnQgQWxwaGEgPSAwLjgzOTY0NSAqLwotI2RlZmluZSBBTFBIQV8zNSAgICAgICAgICAgICAgICAgICAgICAgMTY3NzI2MjIyMCAgICAgIC8qIEZsb2F0aW5nIHBvaW50IEFscGhhID0gMC43ODEwMzYgKi8KLSNkZWZpbmUgQUxQSEFfMzYgICAgICAgICAgICAgICAgICAgICAgIDE1MTQxNDI2NzUgICAgICAvKiBGbG9hdGluZyBwb2ludCBBbHBoYSA9IDAuNzA1MDc4ICovCi0jZGVmaW5lIEFMUEhBXzM3ICAgICAgICAgICAgICAgICAgICAgICAxMzEwMTk3ODc1ICAgICAgLyogRmxvYXRpbmcgcG9pbnQgQWxwaGEgPSAwLjYxMDEwOCAqLwotI2RlZmluZSBBTFBIQV8zOCAgICAgICAgICAgICAgICAgICAgICAgMTA2NzgxMzQ4MCAgICAgIC8qIEZsb2F0aW5nIHBvaW50IEFscGhhID0gMC40OTcyMzkgKi8KLSNkZWZpbmUgQUxQSEFfMzkgICAgICAgICAgICAgICAgICAgICAgICA3OTk2MDEzNzEgICAgICAvKiBGbG9hdGluZyBwb2ludCBBbHBoYSA9IDAuMzcyMzQzICovCi0jZGVmaW5lIEFMUEhBXzQwICAgICAgICAgICAgICAgICAgICAgICAgNTMxMTgzMDQ5ICAgICAgLyogRmxvYXRpbmcgcG9pbnQgQWxwaGEgPSAwLjI0NzM1MSAqLwotI2RlZmluZSBBTFBIQV80MSAgICAgICAgICAgICAgICAgICAgICAgIDI5NzkwNDAwNyAgICAgIC8qIEZsb2F0aW5nIHBvaW50IEFscGhhID0gMC4xMzg3MjIgKi8KLSNkZWZpbmUgQUxQSEFfNDIgICAgICAgICAgICAgICAgICAgICAgICAxMzE0OTk3NjggICAgICAvKiBGbG9hdGluZyBwb2ludCBBbHBoYSA9IDAuMDYxMjM0ICovCi0jZGVmaW5lIEFMUEhBXzQzICAgICAgICAgICAgICAgICAgICAgICAgIDQxMzc1MjgyICAgICAgLyogRmxvYXRpbmcgcG9pbnQgQWxwaGEgPSAwLjAxOTI2NyAqLwotI2RlZmluZSBBTFBIQV80NCAgICAgICAgICAgICAgICAgICAgICAgICAgODA2NTg5OSAgICAgIC8qIEZsb2F0aW5nIHBvaW50IEFscGhhID0gMC4wMDM3NTYgKi8KLSNkZWZpbmUgQUxQSEFfNDUgICAgICAgICAgICAgICAgICAgICAgICAgICA3OTkwNzYgICAgICAvKiBGbG9hdGluZyBwb2ludCBBbHBoYSA9IDAuMDAwMzcyICovCi0jZGVmaW5lIEFMUEhBXzQ2ICAgICAgICAgICAgICAgICAgICAgICAgICAgIDMwMzk4ICAgICAgLyogRmxvYXRpbmcgcG9pbnQgQWxwaGEgPSAwLjAwMDAxNCAqLwotI2RlZmluZSBBTFBIQV80NyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDI5OSAgICAgIC8qIEZsb2F0aW5nIHBvaW50IEFscGhhID0gMC4wMDAwMDAgKi8KLSNkZWZpbmUgQUxQSEFfNDggICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDAgICAgICAvKiBGbG9hdGluZyBwb2ludCBBbHBoYSA9IDAuMDAwMDAwICovCi0jZGVmaW5lIEFMUEhBXzQ5ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAwICAgICAgLyogRmxvYXRpbmcgcG9pbnQgQWxwaGEgPSAwLjAwMDAwMCAqLwotI2RlZmluZSBBTFBIQV81MCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMCAgICAgIC8qIEZsb2F0aW5nIHBvaW50IEFscGhhID0gMC4wMDAwMDAgKi8KLQotCi0jZW5kaWYKZGlmZiAtLWdpdCBhL21lZGlhL2xpYmVmZmVjdHMvbHZtL2xpYi9Db21tb24v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ICogU2VlIHRoZSBMaWNlbnNlIGZvciB0aGUgc3BlY2lmaWMgbGFuZ3VhZ2UgZ292ZXJuaW5nIHBlcm1pc3Npb25zIGFuZAotICogbGltaXRhdGlvbnMgdW5kZXIgdGhlIExpY2Vuc2UuCi0gKi8KLQotI2luY2x1ZGUgIkxWTV9UeXBlcy5oIgotI2luY2x1ZGUgIkxWTV9NYWNyb3MuaCIKLSNpbmNsdWRlICJNaXhlci5oIgotI2luY2x1ZGUgIkxWTV9NaXhlcl9GaWx0ZXJDb2VmZnMuaCIKLQotCi0vKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotLyogRlVOQ1RJT046ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICAgTFZNX01peF9HZXRUaW1lQ29uc3RhbnQgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogREVTQ1JJUFRJT046ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICBUaGlzIGZ1bmN0aW9uIGNhbGN1bGF0ZXMgdGhlIGZpbHRlciBjb2VmZmljaWVudCB1c2luZyB0aGUgZm9sbG93aW5nICovCi0vKiAgZXF1YXRpb246ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogICAgICAgQWxwaGEgPSBleHAobG4oMC4xKS8gKHRjICogVXBkYXRlICsgMS4wKSkgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgVGhpcyBpcyB0byBiZSB1c2VkIHdpdGggdGhlIGZvbGxvdyBmaXJzdCBvcmRlciBmaWx0ZXIsIGNhbGxlZCBhdCBhICAqLwotLyogIHJhdGUgb2YgVXBkYXRlIHRpbWVzIGEgc2Vjb25kLiB0YyBpcyB0aGUgcmVxdWlyZWQgdGltZSBjb25zdGFudCBpbiAgKi8KLS8qICB1bml0cyBvZiAxMDB1cy4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogICAgICAgT3V0cHV0KG4pID0gQWxwaGEgKiBPdXRwdXQobi0xKSArICgxIC0gQWxwaGEpICogVGFyZ2V0KG4pICAgICAgKi8KLS8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgVGhlIGZ1bmN0aW9uIGFzc3VtZXMgdGhlIGJsb2NrIHNpemUgaXMgbGFyZ2UsIGkuZS4gdGhlIHVwZGF0ZSByYXRlICAqLwotLyogIGlzIGFwcHJveGltYXRlbHkgYSBmaXhlZCwgYW5kIGNvcnJlY3QgZmFjdG9yIG9mIHRoZSB2YWx1ZSBvZiBGcyAgICAgKi8KLS8qICBnaXZlbiBpbiB0aGUgY2FsbC4gVGhpcyBpcyBlc3BlY2lhbGx5IG5vdCB0cnVlIHdoZW4gdGhlIGJsb2NrIHNpemUgICovCi0vKiAgaXMgdmVyeSBzbWFsbCwgc2VlIHRoZSBtaXhlciBkb2N1bWVudGF0aW9uIGZvciBmdXJ0aGVyIGRldGFpbHMuICAgICAqLwotLyogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICBUaGUgZnVuY3Rpb24gZG9lcyBub3Qgc3VwcG9ydCBhbGwgcG9zc2libGUgY29tYmluYXRpb25zIG9mIGlucHV0ICAgICovCi0vKiAgdmFsdWVzOiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICAxLiBOdW1DaGFubmVscyBpcyBsaW1pdGVkIHRvIHRoZSB2YWx1ZXMgMSAoTW9ubykgYW5kIDIgKFN0ZXJlbykgICAgICovCi0vKiAgMi4gVGhlIHByb2R1Y3QgdGMgKiBGcyBpcyBsaW1pdGVkIGFwcHJveGltYXRlbHkgdG8gdGhlIHJhbmdlICAgICAgICAqLwotLyogICAgICA4IDwgKHRjICogRnMpIDwgMl4zNSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiBQQVJBTUVURVJTOiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogIHRjICAgICAgICAgICAgICAtIHRoZSB0aW1lIGNvbnN0YW50IGluIDEwMHVzIHN0ZXBzLCBpLmUuIDEwID0gMW1zICAgKi8KLS8qICBGcyAgICAgICAgICAgICAgLSB0aGUgZmlsdGVyIHVwZGF0ZSByYXRlIGluIEh6ICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgTnVtQ2hhbm5lbHMgICAgIC0gTnVtYmVyIG9mIGNoYW5uZWxzIDE9TW9ubywgMj1TdGVyZW8gICAgICAgICAgICAgICAqLwotLyogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qIFJFVFVSTlM6ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgQWxwaGEgICAtIHRoZSBmaWx0ZXIgY29lZmZpY2llbnQgUTMxIGZvcm1hdCAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0KLUxWTV9VSU5UMzIgTFZNX01peGVyX1RpbWVDb25zdGFudChMVk1fVUlOVDMyICAgdGMsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTFZNX1VJTlQxNiAgIEZzLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIExWTV9VSU5UMTYgICBOdW1DaGFubmVscykKLXsKLQotICAgIExWTV9VSU5UMzIgIFByb2R1Y3Q7Ci0gICAgTFZNX0lOVDE2ICAgSW50ZXJwb2xhdGU7Ci0gICAgTFZNX1VJTlQxNiAgU2hpZnQ7Ci0gICAgTFZNX0lOVDMyICAgRGlmZjsKLSAgICBMVk1fVUlOVDMyICBUYWJsZVtdID0ge0FMUEhBXzAsICAgICAgICAgICAgIC8qIExvZyBzcGFjZWQgbG9vay11cCB0YWJsZSAqLwotICAgICAgICAgICAgICAgICAgICAgICAgICAgQUxQSEFfMSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgIEFMUEhBXzIsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICBBTFBIQV8zLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgQUxQSEFfNCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgIEFMUEhBXzUsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICBBTFBIQV82LAotICAgICAgICAgICAgICAgICAgICAgICAgICAgQUxQSEFfNywKLSAgICAgICAgICAgICAgICAgICAgICAgICAgIEFMUEhBXzgsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICBBTFBIQV85LAotICAgICAgICAgICAgICAgICAgICAgICAgICAgQUxQSEFfMTAsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICBBTFBIQV8xMSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgIEFMUEhBXzEyLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgQUxQSEFfMTMsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICBBTFBIQV8xNCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgIEFMUEhBXzE1LAotICAgICAgICAgICAgICAgICAgICAgICAgICAgQUxQSEFfMTYsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICBBTFBIQV8xNywKLSAgICAgICAgICAgICAgICAgICAgICAgICAgIEFMUEhBXzE4LAotICAgICAgICAgICAgICAgICAgICAgICAgICAgQUxQSEFfMTksCi0gICAgICAgICAgICAgICAgICAgICAgICAgICBBTFBIQV8yMCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgIEFMUEhBXzIxLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgQUxQSEFfMjIsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICBBTFBIQV8yMywKLSAgICAgICAgICAgICAgICAgICAgICAgICAgIEFMUEhBXzI0LAotICAgICAgICAgICAgICAgICAgICAgICAgICAgQUxQSEFfMjUsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICBBTFBIQV8yNiwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgIEFMUEhBXzI3LAotICAgICAgICAgICAgICAgICAgICAgICAgICAgQUxQSEFfMjgsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICBBTFBIQV8yOSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgIEFMUEhBXzMwLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgQUxQSEFfMzEsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICBBTFBIQV8zMiwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgIEFMUEhBXzMzLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgQUxQSEFfMzQsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICBBTFBIQV8zNSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgIEFMUEhBXzM2LAotICAgICAgICAgICAgICAgICAgICAgICAgICAgQUxQSEFfMzcsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICBBTFBIQV8zOCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgIEFMUEhBXzM5LAotICAgICAgICAgICAgICAgICAgICAgICAgICAgQUxQSEFfNDAsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICBBTFBIQV80MSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgIEFMUEhBXzQyLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgQUxQSEFfNDMsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICBBTFBIQV80NCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgIEFMUEhBXzQ1LAotICAgICAgICAgICAgICAgICAgICAgICAgICAgQUxQSEFfNDYsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICBBTFBIQV80NywKLSAgICAgICAgICAgICAgICAgICAgICAgICAgIEFMUEhBXzQ4LAotICAgICAgICAgICAgICAgICAgICAgICAgICAgQUxQSEFfNDksCi0gICAgICAgICAgICAgICAgICAgICAgICAgICBBTFBIQV81MH07Ci0KLQotICAgIC8qIENhbGN1bGF0ZSB0aGUgcHJvZHVjdCBvZiB0aGUgdGltZSBjb25zdGFudCBhbmQgdGhlIHNhbXBsZSByYXRlICovCi0gICAgUHJvZHVjdCA9ICgodGMgPj4gMTYpICogKExWTV9VSU5UMzIpRnMpIDw8IDEzOyAgLyogU3RlcmVvIHZhbHVlICovCi0gICAgUHJvZHVjdCA9IFByb2R1Y3QgKyAoKCh0YyAmIDB4MDAwMEZGRkYpICogKExWTV9VSU5UMzIpRnMpID4+IDMpOwotCi0gICAgaWYgKE51bUN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GUgTGljZW5zZS4KLSAqLwotCi0jaW5jbHVkZSAiTFZNX1R5cGVzLmgiCi0jaW5jbHVkZSAiTFZNX01hY3Jvcy5oIgotI2luY2x1ZGUgIlNjYWxhckFyaXRobWV0aWMuaCIKLQotLyotLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tKi8KLS8qIEZVTkNUSU9OOiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgIExWTV9Qb2x5bm9taWFsICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qIERFU0NSSVBUSU9OOiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgIFRoaXMgZnVuY3Rpb24gcGVyZm9ybXMgcG9seW5vbWlhbCBleHBhbnNpb24gICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogIFkgPSAoQTAgKyBBMSpYICsgQTIqWDIgKyBBMypYMyArIIUuLiArIEFOKnhOKSA8PCBBTisxICAgICAgICAgICAgICAgICAgKi8KLS8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgTFZNX0lOVDMyIExWTV9Qb2x5bm9taWFsKExWTV9VSU5UMTYgICAgTiwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogICAgICAgICAgICAgICAgICAgICAgICAgICBMVk1fSU5UMzIgICAgKnBDb2VmZmljaWVudHMsICAgICAgICAgICAgICAgICAgKi8KLS8qICAgICAgICAgICAgICAgICAgICAgICAgICAgTFZNX0lOVDMyICAgIFgpICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogUEFSQU1FVEVSUzogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgTiAgICAgICAgICAgICAgICBpcyB0aGUgcG9seW5vbWlhbCBvcmRlciAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogIHBDb2VmZmljaWVudHMgICAgaXMgdGhlIHB0ciB0byBwb2x5bm9taWFsIGNvZWZmaWNpZW50cyBBMCxBMS4uIGluIFEuMzEgKi8KLS8qICBYICAgICAgICAgICAgICAgIGlzIHRoZSBpbnB1dCB2YXJpYWJsZSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogUkVUVVJOUzogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICAgVGhlIHJlc3VsdCBvZiB0aGUgcG9seW5vbWlhbCBleHBhbnNpb24gaW4gUTEuMzEgZm9ybWF0ICAgICAgICAgICAgICAgICovCi0vKi0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0qLwotCi1MVk1fSU5UMzIgTFZNX1BvbHlub21pYWwoTFZNX1VJTlQxNiAgICBOLAotICAgICAgICAgICAgICAgICAgICAgICAgIExWTV9JTlQzMiAgICAqcENvZWZmaWNpZW50cywKLSAgICAgICAgICAgICAgICAgICAgICAgICBMVk1fSU5UMzIgICAgWCkKLXsKLSAgICBMVk1fSU5UMzIgaTsKLSAgICBMVk1fSU5UMzIgWSxBLFhUZW1wLFRlbXAsc2lnbjsKLQotICAgIFk9KnBDb2VmZmljaWVudHM7IC8qIFk9QTAqLwotICAgIHBDb2VmZmljaWVudHMrKzsKLQotICAgIGlmKChMVk1fVUlOVDMyKVg9PTB4ODAwMDAwMDApCi0gICAgewotICAgICAgICBUZW1wPS0xOwotICAgICAgICBzaWduPVRlbXA7Ci0gICAgICAgIGZvcihpPTE7aTw9TjtpKyspCi0gICAgICAgIHsKLSAgICAgICAgICAgIFkrPSgoKnBDb2VmZmljaWVudHMpKnNpZ24pOwotICAgICAgICAgICAgcENvZWZmaWNpZW50cysrOwotICAgICAgICAgICAgc2lnbio9VGVtcDsKLSAgICAgICAgfQotCi0KLSAgICB9Ci0gICAgZWxzZQotICAgIHsKLSAgICAgICAgWFRlbXA9WDsKLSAgICAgICAgZm9yKGk9Ti0xO2k+PTA7aS0tKQotICAgICAgICB7Ci0gICAgICAgICAgICBBPSpwQ29lZmZpY2llbnRzOwotICAgICAgICAgICAgcENvZWZmaWNpZW50cysrOwotCi0gICAgICAgICAgICBNVUwzMngzMklOVE8zMihBLFhUZW1wLFRlbXAsMzEpCi0gICAgICAgICAgICBZKz1UZW1wOwotCi0gICAgICAgICAgICBNVUwzMngzMklOVE8zMihYVGVtcCxYLFRlbXAsMzEpCi0gICAgICAgICAgICBYVGVtcD1UZW1wOwotICAgICAgICB9Ci0gICAgfQotICAgIEE9KnBDb2VmZmljaWVudHM7Ci0gICAgcENvZWZmaWNpZW50cysrOwotCi0gICAgaWYoQTwwKQotICAgIHsKLSAgICAgICAgQT1BYnNfMzIoQSk7Ci0gICAgICAgIFk9WT4+QTsKLSAgICB9Ci0gICAgZWxzZQotICAgIHsKLSAgICAgICAgWSA9IFk8PEE7Ci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SU5ELCBlaXRoZXIgZXhwcmVzcyBvciBpbXBsaWVkLgotICogU2VlIHRoZSBMaWNlbnNlIGZvciB0aGUgc3BlY2lmaWMgbGFuZ3VhZ2UgZ292ZXJuaW5nIHBlcm1pc3Npb25zIGFuZAotICogbGltaXRhdGlvbnMgdW5kZXIgdGhlIExpY2Vuc2UuCi0gKi8KLQotI2luY2x1ZGUgIkxWTV9UeXBlcy5oIgotI2luY2x1ZGUgIkxWTV9NYWNyb3MuaCIKLSNpbmNsdWRlICJTY2FsYXJBcml0aG1ldGljLmgiCi0jaW5jbHVkZSAiRmlsdGVyLmgiCi0KLQotLyotLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tKi8KLS8qIEZVTkNUSU9OOiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgIExWTV9Qb3dlcjEwICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qIERFU0NSSVBUSU9OOiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgIFRoaXMgZnVuY3Rpb24gY2FsY3VsYXRlcyAxMFggdXNpbmcgYW4gMTF0aCBvcmRlciBwb2x5bm9taWFsLiBJdCB1c2VzICAqLwotLyogICB0aGUgZm9sbG93aW5nIHRhYmxlIG9mIDMyLWJpdCBpbnRlZ2VyIHBvbHlub21pYWwgY29lZmZpY2llbnRzOiAgICAgICAgKi8KLS8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgIENvZWZmaWNpZW50ICAgIFZhbHVlICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogICBBMCAgICAgICAgICAgICA2NzEwMjU0MyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICAgQTEgICAgICAgICAgICAgMzA5MDMyOTk1ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgIEEyICAgICAgICAgICAgIDcxMjA5NjEyNyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogICBBMyAgICAgICAgICAgICAxMDkyNzk3MzMxICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICAgQTQgICAgICAgICAgICAgMTI1MTYyNTEzNyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgIEE1ICAgICAgICAgICAgIDExNTQ2NDk0NjAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogICBBNiAgICAgICAgICAgICA5MTU2NTQ4MDAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICAgQTcgICAgICAgICAgICAgNTk3ODgzNjgzICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgIEE4ICAgICAgICAgICAgIDI4NDM3ODIzMCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogICBBOSAgICAgICAgICAgICAxNTAyNjIwOTcgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICAgQTEwICAgICAgICAgICAgMTI0ODk0NDcxICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgIEExMSAgICAgICAgICAgIDUwNDc3MjQ0ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogICBBMTIgICAgICAgICAgICAtMiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgWSA9IChBMCArIEExKlggKyBBMipYMiArIEEzKlgzICsghS4uICsgQU4qeE4pIDw8IEFOKzEgICAgICAgICAgICAgICAgICAqLwotLyogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiBQQVJBTUVURVJTOiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICBYICAgICAgICAgICAgICAgaXMgdGhlIGlucHV0IHZhcmlhYmxlIGluIFEyLjMwIGZvcm1hdCAgICAgICAgICAgICAgICAgICovCi0vKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogUkVUVVJOUzogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICAgVGhlIHJlc3VsdCBvZiB0aGUgMTB4IGV4cGFuc2lvbiBpbiBROC4yNCBmb3JtYXQgICAgICAgICAgICAgICAgICAgICAgICovCi0vKi0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0qLwotCi1MVk1fSU5UMzIgTFZNX1Bvd2VyMTAoTFZNX0lOVDMyICAgICBYKQotewotICAgIExWTV9JTlQzMiBZLENvZWZmaWNpZW50c1sxM109eyAgMTY3NzU2MzYsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgNzcyNTgyNDksCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAxNzgwMjQwMzIsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAyNzMxOTkzMzMsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAzMTI5MDYyODQsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAyODg2NjIzNjUsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAyMjg5MTM3MDAsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAxNDk0NzA5MjEsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgNzEwOTQ1NTgsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMzc1NjU1MjQsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMzEyMjM2MTgsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMTI2MTkzMTEsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMH07Ci0gICAgWT1MVk1fUG9seW5vbWlhbCgoTFZNX1VJTlQxNikxMSwKLSAgICAgICAgICAgICAgICAgICAgICAgIENvZWZmaWNpZW50cywKLSAgICAgICAgICAgICAgICAgICAgICAgIFgpOwotICAgIHJldHVybiBZOwotfQotCmRpZmYgLS1naXQgYS9tZWRpYS9saWJlZmZ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GUgc3BlY2lmaWMgbGFuZ3VhZ2UgZ292ZXJuaW5nIHBlcm1pc3Npb25zIGFuZAotICogbGltaXRhdGlvbnMgdW5kZXIgdGhlIExpY2Vuc2UuCi0gKi8KLQotLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0vKiAgSU5DTFVERSBGSUxFUyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotCi0jaW5jbHVkZSAiTFZNX1RpbWVyLmgiCi0jaW5jbHVkZSAiTFZNX1RpbWVyX1ByaXZhdGUuaCIKLQotLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0vKiAgVElNRVIgRlVOQ1RJT04gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotCi12b2lkIExWTV9UaW1lciAgICAgICggICBMVk1fVGltZXJfSW5zdGFuY2VfdCAgICAgICAqcEluc3RhbmNlLAotICAgICAgICAgICAgICAgICAgICAgICAgTFZNX0lOVDE2ICAgICAgICAgICAgICAgICAgQmxvY2tTaXplICl7Ci0KLSAgICBMVk1fVGltZXJfSW5zdGFuY2VfUHJpdmF0ZV90ICpwSW5zdGFuY2VQcjsKLSAgICBwSW5zdGFuY2VQciA9IChMVk1fVGltZXJfSW5zdGFuY2VfUHJpdmF0ZV90ICopcEluc3RhbmNlOwotCi0gICAgaWYgKHBJbnN0YW5jZVByLT5UaW1lckFybWVkKXsKLSAgICAgICAgcEluc3RhbmNlUHItPlJlbWFpbmluZ1RpbWVJblNhbXBsZXMgLT0gQmxvY2tTaXplOwotICAgICAgICBpZiAocEluc3RhbmNlUHItPlJlbWFpbmluZ1RpbWVJblNhbXBsZXMgPD0gMCl7Ci0gICAgICAgICAgICBwSW5zdGFuY2VQci0+VGltZXJBcm1lZCA9IDA7Ci0gICAgICAgICAgICAoKnBJbnN0YW5jZVByLT5wQ2FsbEJhY2spICggcEluc3RhbmNlUHItPnBDYWxsYmFja0luc3RhbmNlLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBJbnN0YW5jZVByLT5wQ2FsbEJhY2tQYXJhbXMsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcEluc3RhbmNlUHItPkNhbGxCYWNrUGFyYW0gKTsKLSAgICAgICAgfQotICAgIH0KLX0KLQotLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0vKiAgRU5EIE9GIEZJTEUgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwpkaWZmIC0tZ2l0IGEvbWVkaWEvbGliZWZmZWN0cy9sdm0vbGliL0NvbW1vbi9zcmMvTFZNX1RpbWVyX0luaXQuYyBiL21lZGlhL2xpYmVmZmVjdHMvbHZtL2xpYi9Db21tb24vc3JjL0xWTV9UaW1lcl9Jbml0LmMKZGVsZXRlZCBmaWxlIG1vZGUgMTAwNjQ0CmluZGV4IGE5M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KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotLyogIElOQ0xVREUgRklMRVMgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLQotI2luY2x1ZGUgIkxWTV9UaW1lci5oIgotI2luY2x1ZGUgIkxWTV9UaW1lcl9Qcml2YXRlLmgiCi0jaW5jbHVkZSAiTFZNX01hY3Jvcy5oIgotCi0vKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLS8qICBERUZJTklUSU9OUyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0KLSNkZWZpbmUgT25lT3ZlclRob3VzYW5kSW5RMjQgMTY3NzcKLQotLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0vKiAgSU5JVCBGVU5DVElPTiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotCi12b2lkIExWTV9UaW1lcl9Jbml0ICggICBMVk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uMAotICoKLSAqIFVubGVzcyByZXF1aXJlZCBieSBhcHBsaWNhYmxlIGxhdyBvciBhZ3JlZWQgdG8gaW4gd3JpdGluZywgc29mdHdhcmUKLSAqIGRpc3RyaWJ1dGVkIHVuZGVyIHRoZSBMaWNlbnNlIGlzIGRpc3RyaWJ1dGVkIG9uIGFuICJBUyBJUyIgQkFTSVMsCi0gKiBXSVRIT1VUIFdBUlJBTlRJRVMgT1IgQ09ORElUSU9OUyBPRiBBTlkgS0lORCwgZWl0aGVyIGV4cHJlc3Mgb3IgaW1wbGllZC4KLSAqIFNlZSB0aGUgTGljZW5zZSBmb3IgdGhlIHNwZWNpZmljIGxhbmd1YWdlIGdvdmVybmluZyBwZXJtaXNzaW9ucyBhbmQKLSAqIGxpbWl0YXRpb25zIHVuZGVyIHRoZSBMaWNlbnNlLgotICovCi0KLSNpZm5kZWYgTFZNX1RJTUVSX1BSSVZBVEVfSAotI2RlZmluZSBMVk1fVElNRVJfUFJJVkFURV9ICi0KLQotI2lmZGVmIF9fY3BsdXNwbHVzCi1leHRlcm4gIkMiIHsKLSNlbmRpZiAvKiBfX2NwbHVzcGx1cyAqLwotCi0KLSNpbmNsdWRlICJMVk1fVHlwZXMuaCIKLQotLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0vKiAgVFlQRSBERUZJTklUSU9OUyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotCi10eXBlZGVmIHN0cnVjdAotewotICAgIExWTV9JTlQzMiAgUmVtYWluaW5nVGltZUluU2FtcGxlczsKLSAgICBMVk1fSU5UMzIgIENhbGxCYWNrUGFyYW07Ci0gICAgTFZNX0lOVDMyICAqcENhbGxCYWNrUGFyYW1zOwotICAgIHZvaWQgICpwQ2FsbGJhY2tJbnN0YW5jZTsKLSAgICB2b2lkICAoKnBDYWxsQmFjaykodm9pZCosdm9pZCosTFZNX0lOVDMyKTsKLSAgICBMVk1fSU5UMTYgVGltZXJBcm1lZDsgICAgICAgICAgICAgICAgICAgICAgICAvKiBCb29sZWFuLCB0cnVlIGJldHdlZW4gaW5pdCBhbmQgY2FsbGJhY2sgKi8KLQotfSBMVk1fVGltZXJfSW5zdGFuY2VfUHJpdmF0ZV90OwotCi0vKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLS8qICBFTkQgT0YgSEVBREVSICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0KLSNpZmRlZiBfX2NwbHVzcGx1cwotfQotI2VuZGlmIC8qIF9fY3BsdXNwbHVzICovCi0KLSNlbmRpZiAgLyogTFZNX1RJTUVSX1BSSVZBVEVfSCAqLwpkaWZmIC0tZ2l0IGEvbWVkaWEvbGliZWZmZWN0cy9sdm0vbGliL0NvbW1vbi9zcmMvTG9hZENvbnN0XzE2LmMgYi9tZWRpYS9saWJlZmZlY3RzL2x2bS9saWIvQ29tbW9uL3NyYy9Mb2FkQ29uc3RfMTYuYwpkZWxldGVkIGZpbGUgbW9kZSAxMDA2NDQKaW5kZXggZjg4Y2EwZS4uMDAwMDAwMAotLS0gYS9tZWRpYS9saWJlZmZlY3RzL2x2bS9saWIvQ29tbW9uL3NyYy9Mb2FkQ29uc3RfMTYuYworKysgL2Rldi9udWxsCkBAIC0xLDQzICswLDAgQEAK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KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLQotI2luY2x1ZGUgIlZlY3RvckFyaXRobWV0aWMuaCIKLQotLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKLSAgIEZVTkNUSU9OIExvYWRDb25zdF8xNgotKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0KLXZvaWQgTG9hZENvbnN0XzE2KGNvbnN0IExWTV9JTlQxNiB2YWwsCi0gICAgICAgICAgICAgICAgICBMVk1fSU5UMTYgKmRzdCwKLSAgICAgICAgICAgICAgICAgIExWTV9JTlQxNiBuICkKLXsKLSAgICBMVk1fSU5UMTYgaWk7Ci0KLSAgICBmb3IgKGlpID0gbjsgaWkgIT0gMDsgaWktLSkKLSAgICB7Ci0gICAgICAgICpkc3QgPSB2YWw7Ci0gICAgICAgIGRzdCsrOwotICAgIH0KLQotICAgIHJldHVybjsKLX0KLQotLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCmRpZmYgLS1naXQgYS9tZWRpYS9saWJlZmZlY3RzL2x2bS9saWIvQ29tbW9uL3NyYy9Mb2FkQ29uc3RfMzIuYyBiL21lZGlhL2xpYmVmZmVjdHMvbHZtL2xpYi9Db21tb24vc3JjL0xvYWRDb25zdF8zMi5jCmRlbGV0ZWQgZmlsZSBtb2RlIDEwMDY0NAppbmRleCAyZjFlNTkxLi4wMDAwMDAwCi0tLSBhL21lZGlhL2xpYmVmZmVjdHMvbHZtL2xpYi9Db21tb24vc3JjL0xvYWRDb25zdF8zMi5jCisrKyAvZGV2L251bGwKQEAgLTEsNDMgKzAsMCBAQAotLyoKLSAqIENvcHlyaWdodCAoQykgMjAwNC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otCi0jaW5jbHVkZSAiVmVjdG9yQXJpdGhtZXRpYy5oIgotCi0vKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgotICAgRlVOQ1RJT04gTG9hZENvbnN0XzMyCi0qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLQotdm9pZCBMb2FkQ29uc3RfMzIoY29uc3QgTFZNX0lOVDMyICAgdmFsLAotICAgICAgICAgICAgICAgICAgICAgICAgTFZNX0lOVDMyICAqZHN0LAotICAgICAgICAgICAgICAgICAgICAgICAgTFZNX0lOVDE2IG4gKQotewotICAgIExWTV9JTlQxNiBpaTsKLQotICAgIGZvciAoaWkgPSBuOyBpaSAhPSAwOyBpaS0tKQotICAgIHsKLSAgICAgICAgKmRzdCA9IHZhbDsKLSAgICAgICAgZHN0Kys7Ci0gICAgfQotCi0gICAgcmV0dXJuOwotfQotCi0vKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KZGlmZiAtLWdpdCBhL21lZGlhL2xpYmVmZmVjdHMvbHZtL2xpYi9Db21tb24vc3JjL01TVG8yaV9TYXRfMTZ4MTYuYyBiL21lZGlhL2xpYmVmZmVjdHMvbHZtL2xpYi9Db21tb24vc3JjL01TVG8yaV9TYXRfMTZ4MTYuYwpkZWxldGVkIGZpbGUgbW9kZSAxMDA2NDQKaW5kZXggMjYyOTdlNy4uMDAwMDAwMAotLS0gYS9tZWRpYS9saWJlZmZlY3RzL2x2bS9saWIvQ29tbW9uL3NyYy9NU1RvMmlfU2F0XzE2eDE2LmMKKysrIC9kZXYvbnVsbApAQCAtMSw4MCArMCwwIEBACi0vKgotICogQ29weXJpZ2h0IChDKSAyMDA0LTIwMTAgTlhQIFNvZnR3YXJlCi0gKiBDb3B5cmlnaHQgKEMpIDIwMTAgVGhlIEFuZHJvaWQgT3BlbiBTb3VyY2UgUHJvamVjdAotICoKLSAqIExpY2Vuc2VkIHVuZGVyIHRoZSBBcGFjaGUgTGljZW5zZSwgVmVyc2lvbiAyLjAgKHRoZSAiTGljZW5zZSIpOwotICogeW91IG1heSBub3QgdXNlIHRoaXMgZmlsZSBleGNlcHQgaW4gY29tcGxpYW5jZSB3aXRoIHRoZSBMaWNlbnNlLgotICogWW91IG1heSBvYnRhaW4gYSBjb3B5IG9mIHRoZSBMaWNlbnNlIGF0Ci0gKgotICogICAgICBodHRwOi8vd3d3LmFwYWNoZS5vcmcvbGljZW5zZXMvTElDRU5TRS0yLjAKLSAqCi0gKiBVbmxlc3MgcmVxdWlyZWQgYnkgYXBwbGljYWJsZSBsYXcgb3IgYWdyZWVkIHRvIGluIHdyaXRpbmcsIHNvZnR3YXJlCi0gKiBkaXN0cmlidXRlZCB1bmRlciB0aGUgTGljZW5zZSBpcyBkaXN0cmlidXRlZCBvbiBhbiAiQVMgSVMiIEJBU0lTLAotICogV0lUSE9VVCBXQVJSQU5USUVTIE9SIENPTkRJVElPTlMgT0YgQU5ZIEtJTkQsIGVpdGhlciBleHByZXNzIG9yIGltcGxpZWQuCi0gKiBTZWUgdGhlIExpY2Vuc2UgZm9yIHRoZSBzcGVjaWZpYyBsYW5ndWFnZSBnb3Zlcm5pbmcgcGVybWlzc2lvbnMgYW5kCi0gKiBsaW1pdGF0aW9ucyB1bmRlciB0aGUgTGljZW5zZS4KLSAqLwotCi0vKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgotICAgSU5DTFVERSBGSUxFUwotKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0KLSNpbmNsdWRlICJWZWN0b3JBcml0aG1ldGljLmgiCi0KLS8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCi0gICBGVU5DVElPTiAgTVNUTzJJX1NBVF8xNlgxNgotKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0KLXZvaWQgTVNUbzJpX1NhdF8xNngxNihjb25zdCBMVk1fSU5UMTYgICpzcmNNLAotICAgICAgICAgICAgICAgICAgICAgIGNvbnN0IExWTV9JTlQxNiAgKnNyY1MsCi0gICAgICAgICAgICAgICAgICAgICAgTFZNX0lOVDE2ICAqZHN0LAotICAgICAgICAgICAgICAgICAgICAgIExWTV9JTlQxNiAgbiApCi17Ci0gICAgTFZNX0lOVDMyIHRlbXAsbVZhbCxzVmFsOwotICAgIExWTV9JTlQxNiBpaTsKLQotCi0gICAgZm9yIChpaSA9IG47IGlpICE9IDA7IGlpLS0pCi0gICAgewotICAgICAgICBtVmFsPShMVk1fSU5UMzIpKnNyY007Ci0gICAgICAgIHNyY00rKzsKLQotICAgICAgICBzVmFsPShMVk1fSU5UMzIpKnNyY1M7Ci0gICAgICAgIHNyY1MrKzsKLQotICAgICAgICB0ZW1wID0gbVZhbCArIHNWYWw7Ci0KLSAgICAgICAgaWYgKHRlbXAgPiAweDAwMDA3RkZGKQotICAgICAgICB7Ci0gICAgICAgICAgICAqZHN0ID0gMHg3RkZGOwotICAgICAgICB9Ci0gICAgICAgIGVsc2UgaWYgKHRlbXAgPCAtMHgwMDAwODAwMCkKLSAgICAgICAgewotICAgICAgICAgICAgKmRzdCA9IC0gMHg4MDAwOwotICAgICAgICB9Ci0gICAgICAgIGVsc2UKLSAgICAgICAgewotICAgICAgICAgICAgKmRzdCA9IChMVk1fSU5UMTYpdGVtcDsKLSAgICAgICAgfQotICAgICAgICBkc3QrKzsKLQotICAgICAgIC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gdXNlIHRoaXMgZmlsZSBleGNlcHQgaW4gY29tcGxpYW5jZSB3aXRoIHRoZSBMaWNlbnNlLgotICogWW91IG1heSBvYnRhaW4gYSBjb3B5IG9mIHRoZSBMaWNlbnNlIGF0Ci0gKgotICogICAgICBodHRwOi8vd3d3LmFwYWNoZS5vcmcvbGljZW5zZXMvTElDRU5TRS0yLjAKLSAqCi0gKiBVbmxlc3MgcmVxdWlyZWQgYnkgYXBwbGljYWJsZSBsYXcgb3IgYWdyZWVkIHRvIGluIHdyaXRpbmcsIHNvZnR3YXJlCi0gKiBkaXN0cmlidXRlZCB1bmRlciB0aGUgTGljZW5zZSBpcyBkaXN0cmlidXRlZCBvbiBhbiAiQVMgSVMiIEJBU0lTLAotICogV0lUSE9VVCBXQVJSQU5USUVTIE9SIENPTkRJVElPTlMgT0YgQU5ZIEtJTkQsIGVpdGhlciBleHByZXNzIG9yIGltcGxpZWQuCi0gKiBTZWUgdGhlIExpY2Vuc2UgZm9yIHRoZSBzcGVjaWZpYyBsYW5ndWFnZSBnb3Zlcm5pbmcgcGVybWlzc2lvbnMgYW5kCi0gKiBsaW1pdGF0aW9ucyB1bmRlciB0aGUgTGljZW5zZS4KLSAqLwotCi0vKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgotCi0gICAgICVjcmVhdGVkX2J5OiAgICBzcmEgJSAoQ00vUykKLSAgICAgJW5hbWU6ICAgICAgICAgIE1hYzNzX1NhdF8xNngxNi5jICUgKENNL1MpCi0gICAgICV2ZXJzaW9uOiAgICAgICAxICUgKENNL1MpCi0gICAgICVkYXRlX2NyZWF0ZWQ6ICBGcmkgTm92IDEzIDEyOjA3OjEzIDIwMDkgJSAoQ00vUykKLQotKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0KLS8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCi0gICBJTkNMVURFIEZJTEVTCi0qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLQotI2luY2x1ZGUgIlZlY3RvckFyaXRobWV0aWMuaCIKLSNpbmNsdWRlICJMVk1fTWFjcm9zLmgiCi0KLS8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCi0gICBGVU5DVElPTiBNYWMzU18xNlgxNgotKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0KLXZvaWQgTWFjM3NfU2F0XzE2eDE2KCBjb25zdCBMVk1fSU5UMTYgKnNyYywKLSAgICAgICAgICAgICAgICAgICAgIGNvbnN0IExWTV9JTlQxNiB2YWwsCi0gICAgICAgICAgICAgICAgICAgICBMVk1fSU5UMTYgKmRzdCwKLSAgICAgICAgICAgICAgICAgICAgIExWTV9JTlQxNiBuKQotewotICAgIExWTV9JTlQxNiBpaTsKLSAgICBMVk1fSU5UMTYgc3JjdmFsOwotICAgIExWTV9JTlQzMiBUZW1wLGRJblZhbDsKLQotCi0gICAgZm9yIChpaSA9IG47IGlpICE9IDA7IGlpLS0pCi0gICAgewotICAgICAgICBzcmN2YWw9KnNyYzsKLSAgICAgICAgc3JjKys7Ci0KLSAgICAgICAgVGVtcCA9IChzcmN2YWwgKnZhbCk+PjE1OwotCi0gICAgICAgIGRJblZhbCAgPSAoTFZNX0lOVDMyKSpkc3Q7Ci0KLSAgICAgICAgVGVtcCA9IFRlbXAgKyBkSW5WYWw7Ci0KLSAgICAgICAgaWYgKFRlbXAgPiAweDAwMDA3RkZGKQotICAgICAgICB7Ci0gICAgICAgICAgICAqZHN0ID0gMHg3RkZGOwotICAgICAgICB9Ci0gICAgICAgIGVsc2UgaWYgKFRlbXAgPCAtMHgwMDAwODAwMCkKLSAgICAgICAgewotICAgICAgICAgICAgKmRzdCA9IC0gMHg4MDAwOwotICAgICAgICB9Ci0gICAgICAgIGVsc2UKLSAgICAgICAgewotICAgICAgICAgICAgKmRzdCA9IChMVk1fSU5UMTYpVGVtcDsKLSAgICAgICAgfQotCi0gICAgICAgIGRzdCsrOwotICAgIH0KLQotICAgIHJldHVybjsKLX0KLQotLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0KLQotCmRpZmYgLS1naXQgYS9tZWRpYS9saWJlZmZlY3RzL2x2bS9saWIvQ29tbW9uL3NyYy9NYWMzc19TYXRfMzJ4MTYuYyBiL21lZGlhL2xpYmVmZmVjdHMvbHZtL2xpYi9Db21tb24vc3JjL01hYzNzX1NhdF8zMngxNi5jCmRlbGV0ZWQgZmlsZSBtb2RlIDEwMDY0NAppbmRleCBmMjhmMzY2Li4wMDAwMDAwCi0tLSBhL21lZGlhL2xpYmVmZmVjdHMvbHZtL2xpYi9Db21tb24vc3JjL01hYzNzX1NhdF8zMngxNi5jCisrKyAvZGV2L251bGwKQEAgLTEsNzEgKzAsMCBAQAotLyoKLSAqIENvcHlyaWdodCAoQykgMjAwNC0yMDEwIE5YUCBTb2Z0d2FyZQotICogQ29weXJpZ2h0IChDKSAyMDEwIFRoZSBBbmRyb2lkIE9wZW4gU291cmNlIFByb2plY3QKLSAqCi0gKiBMaWNlbnNlZCB1bmRlciB0aGUgQXBhY2hlIExpY2Vuc2UsIFZlcnNpb24gMi4wICh0aGUgIkxpY2Vuc2UiKTsKLSAqIHlvdSBtYXkgbm90IHVzZSB0aGlzIGZpbGUgZXhjZXB0IGluIGNvbXBsaWFuY2Ugd2l0aCB0aGUgTGljZW5zZS4KLSAqIFlvdSBtYXkgb2J0YWluIGEgY29weSBvZiB0aGUgTGljZW5zZSBhdAotICoKLSAqICAgICAgaHR0cDovL3d3dy5hcGFjaGUub3JnL2xpY2Vuc2VzL0xJQ0VOU0UtMi4wCi0gKgotICogVW5sZXNzIHJlcXVpcmVkIGJ5IGFwcGxpY2FibGUgbGF3IG9yIGFncmVlZCB0byBpbiB3cml0aW5nLCBzb2Z0d2FyZQotICogZGlzdHJpYnV0ZWQgdW5kZXIgdGhlIExpY2Vuc2UgaXMgZGlzdHJpYnV0ZWQgb24gYW4gIkFTIElTIiBCQVNJUywKLSAqIFdJVEhPVVQgV0FSUkFOVElFUyBPUiBDT05ESVRJT05TIE9GIEFOWSBLSU5ELCBlaXRoZXIgZXhwcmVzcyBvciBpbXBsaWVkLgotICogU2VlIHRoZSBMaWNlbnNlIGZvciB0aGUgc3BlY2lmaWMgbGFuZ3VhZ2UgZ292ZXJuaW5nIHBlcm1pc3Npb25zIGFuZAotICogbGltaXRhdGlvbnMgdW5kZXIgdGhlIExpY2Vuc2UuCi0gKi8KLQotLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKLSAgIElOQ0xVREUgRklMRVMKLSoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotCi0jaW5jbHVkZSAiVmVjdG9yQXJpdGhtZXRpYy5oIgotI2luY2x1ZGUgIkxWTV9NYWNyb3MuaCIKLQotLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKLSAgIEZVTkNUSU9OIE1BQzNTXzE2WDE2Ci0qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLQotdm9pZCBNYWMzc19TYXRfMzJ4MTYoICBjb25zdCBMVk1fSU5UMzIgKnNyYywKLSAgICAgICAgICAgICAgICAgICAgIGNvbnN0IExWTV9JTlQxNiB2YWwsCi0gICAgICAgICAgICAgICAgICAgICBMVk1fSU5UMzIgKmRzdCwKLSAgICAgICAgICAgICAgICAgICAgIExWTV9JTlQxNiBuKQotewotICAgIExWTV9JTlQxNiBpaTsKLSAgICBMVk1fSU5UMzIgc3JjdmFsLHRlbXAsIGRJblZhbCwgZE91dFZhbDsKLQotCi0gICAgZm9yIChpaSA9IG47IGlpICE9IDA7IGlpLS0pCi0gICAgewotICAgICAgICBzcmN2YWw9KnNyYzsKLSAgICAgICAgc3JjKys7Ci0KLSAgICAgICAgTVVMMzJ4MTZJTlRPMzIoc3JjdmFsLHZhbCx0ZW1wLDE1KQotCi0gICAgICAgICAgICBkSW5WYWwgID0gKmRzdDsKLSAgICAgICAgZE91dFZhbCA9IHRlbXAgKyBkSW5WYWw7Ci0KLQotICAgICAgICBpZiAoKCgoZE91dFZhbCBeIHRlbXApICYgKGRPdXRWYWwgXiBkSW5WYWwpKSA+PiAzMSkhPTApICAgICAvKiBvdmVyZmxvdyAvIHVuZGVyZmxvdyAqLwotICAgICAgICB7Ci0gICAgICAgICAgICBpZih0ZW1wPDApCi0gICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgZE91dFZhbD0weDgwMDAwMDAwbDsKLSAgICAgICAgICAgIH0KLSAgICAgICAgICAgIGVsc2UKLSAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICBkT3V0VmFsPTB4N0ZGRkZGRkZsOwotICAgICAgICAgICAgfQotICAgICAgICB9Ci0KLSAgICAgICAgKmRzdCA9IGRPdXRWYWw7Ci0gICAgICAgIGRzdCsrOwotICAgIH0KLQotICAgIHJldHVybjsKLX0KLQotLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKio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0FSUkFOVElFUyBPUiBDT05ESVRJT05TIE9GIEFOWSBLSU5ELCBlaXRoZXIgZXhwcmVzcyBvciBpbXBsaWVkLgotICogU2VlIHRoZSBMaWNlbnNlIGZvciB0aGUgc3BlY2lmaWMgbGFuZ3VhZ2UgZ292ZXJuaW5nIHBlcm1pc3Npb25zIGFuZAotICogbGltaXRhdGlvbnMgdW5kZXIgdGhlIExpY2Vuc2UuCi0gKi8KLQotLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKLSAgIElOQ0xVREUgRklMRVMKLSoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotCi0jaW5jbHVkZSAiTWl4ZXJfcHJpdmF0ZS5oIgotI2luY2x1ZGUgIlZlY3RvckFyaXRobWV0aWMuaCIKLQotLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKLSAgIERFRklOSVRJT05TCi0qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLQotI2RlZmluZSBUUlVFICAgICAgICAgIDEKLSNkZWZpbmUgRkFMU0UgICAgICAgICAwCi0KLS8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCi0gICBGVU5DVElPTiBNSVhJTlNPRlRfRDMyQzMxX1NBVAotKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0KLXZvaWQgTWl4SW5Tb2Z0X0QzMkMzMV9TQVQoIE1peF8xU3RfQ2xsX3QgICAgICAgICpwSW5zdGFuY2UsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICBjb25zdCBMVk1fSU5UMzIgICAgICAqc3JjLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTFZNX0lOVDMyICAgICAgKmRzdCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIExWTV9JTlQxNiAgICAgIG4pCi17Ci0gICAgY2hhciBIYXJkTWl4aW5nID0gVFJVRTsKLQotICAgIGlmKG48PTApICAgIHJldHVybjsKLQotICAgIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKLSAgICAgICBTT0ZUIE1JWElORwotICAgICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0gICAgaWYgKHBJbnN0YW5jZS0+Q3VycmVudCAhPSBwSW5zdGFuY2UtPlRhcmdldCkKLSAgICB7Ci0gICAgICAgIGlmKHBJbnN0YW5jZS0+QWxwaGEgPT0gMCl7Ci0gICAgICAgICAgICBwSW5zdGFuY2UtPkN1cnJlbnQgPSBwSW5zdGFuY2UtPlRhcmdldDsKLSAgICAgICAgfWVsc2UgaWYgKChwSW5zdGFuY2UtPkN1cnJlbnQtcEluc3RhbmNlLT5UYXJnZXQgPFBPSU5UX1pFUk9fT05FX0RCKSYmCi0gICAgICAgICAgICAgICAgIChwSW5zdGFuY2UtPkN1cnJlbnQtcEluc3RhbmNlLT5UYXJnZXQgPiAtUE9JTlRfWkVST19PTkVfREIpKXsKLSAgICAgICAgICAgIHBJbnN0YW5jZS0+Q3VycmVudCA9IHBJbnN0YW5jZS0+VGFyZ2V0OyAvKiBEaWZmZXJlbmNlIGlzIG5vdCBzaWduaWZpY2FudCBhbnltb3JlLiAgTWFrZSB0aGVtIGVxdWFsLiAqLwotICAgICAgICB9ZWxzZXsKLSAgICAgICAgICAgIC8qIFNvZnQgbWl4aW5nIGhhcyB0byBiZSBhcHBsaWVkICovCi0gICAgICAgICAgICBIYXJkTWl4aW5nID0gRkFMU0U7Ci0gICAgICAgICAgICBDb3JlX01peEluU29mdF9EMzJDMzFfU0FUKCBwSW5zdGFuY2UsIHNyYywgZHN0LCBuKTsKLSAgICAgICAgfQotICAgIH0KLQotICAgIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKLSAgICAgICBIQVJEIE1JWElORwotICAgICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0KLSAgICBpZiAoSGFyZE1peGluZyl7Ci0gICAgICAgIGlmIChwSW5zdGFuY2UtPlRhcmdldCAhPSAwKXsgLyogTm90aGluZyB0byBkbyBpbiBjYXNlIFRhcmdldCA9IDAgKi8KLSAgICAgICAgICAgIGlmICgocEluc3RhbmNlLT5UYXJnZXQ+PjE2KSA9PSAweDdGRkYpCi0gICAgICAgICAgICAgICAgQWRkMl9TYXRfMzJ4MzIoIHNyYywgZHN0LCBuICk7Ci0gICAgICAgICAgICBlbHNlewotICAgICAgICAgICAgICAgIENvcmVfTWl4SW5Tb2Z0X0QzMkMzMV9TQVQoIHBJbnN0YW5jZSwgc3JjLCBkc3QsIG4pOwotICAgICAgICAgICAgICAgIHBJbnN0YW5jZS0+Q3VycmVudCA9IHBJbnN0YW5jZS0+VGFyZ2V0OyAvKiBJbiBjYXNlIHRoZSBjb3JlIGZ1bmN0aW9uIHdvdWxkIGhhdmUgY2hhbmdlZCB0aGUgQ3VycmVudCB2YWx1ZSAqLwotICAgICAgICAgICAgfQotICAgICAgICB9Ci0gICAgfQotCi0gICAgLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgotICAgICAgIENBTEwgQkFDSwotICAgICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0gICAgLyogQ2FsbCBiYWNrIGJlZm9yZSB0aGUgaGFyZCBtaXhpbmcsIGJlY2F1c2UgaW4gdGhpcyBjYXNlLCBoYXJkIG1peGluZyBtYWtlcwotICAgICAgIHVzZSBvZiB0aGUgY29yZSBzb2Z0IG1peCBmdW5jdGlvbiB3aGljaCBjYW4gY2hhbmdlIHRoZSBDdXJyZW50IHZhbHVlISAgICAgICovCi0KLSAgICBpZiAocEluc3RhbmNlLT5DYWxsYmFja1NldCl7Ci0gICAgICAgIGlmICgocEluc3RhbmNlLT5DdXJyZW50LXBJbnN0YW5jZS0+VGFyZ2V0IDxQT0lOVF9aRVJPX09ORV9EQikmJgotICAgICAgICAgICAgKHBJbnN0YW5jZS0+Q3VycmVudC1wSW5zdGFuY2UtPlRhcmdldCA+IC1QT0lOVF9aRVJPX09ORV9EQikpewotICAgICAgICAgICAgcEluc3RhbmNlLT5DdXJyZW50ID0gcEluc3RhbmNlLT5UYXJnZXQ7IC8qIERpZmZlcmVuY2UgaXMgbm90IHNpZ25pZmljYW50IGFueW1vcmUuICBNYWtlIHRoZW0gZXF1YWwuICovCi0gICAgICAgICAgICBwSW5zdGFuY2UtPkNhbGxiYWNrU2V0ID0gRkFMU0U7Ci0gICAgICAgICAgICBpZiAocEluc3RhbmNlLT5wQ2FsbEJhY2sgIT0gMCl7Ci0gICAgICAgICAgICAgICAgKCpwSW5zdGFuY2UtPnBDYWxsQmFjaykgKCBwSW5zdGFuY2UtPnBDYWxsYmFja0hhbmRsZSwgcEluc3RhbmNlLT5wR2VuZXJhbFB1cnBvc2UscEluc3RhbmNlLT5DYWxsYmFja1BhcmFtICk7Ci0gICAgICAgICAgICB9Ci0gICAgICAgIH0KLSAgICB9Ci19Ci0KLS8qKioqKioqKioqKio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RyaWJ1dGVkIG9uIGFuICJBUyBJUyIgQkFTSVMsCi0gKiBXSVRIT1VUIFdBUlJBTlRJRVMgT1IgQ09ORElUSU9OUyBPRiBBTlkgS0lORCwgZWl0aGVyIGV4cHJlc3Mgb3IgaW1wbGllZC4KLSAqIFNlZSB0aGUgTGljZW5zZSBmb3IgdGhlIHNwZWNpZmljIGxhbmd1YWdlIGdvdmVybmluZyBwZXJtaXNzaW9ucyBhbmQKLSAqIGxpbWl0YXRpb25zIHVuZGVyIHRoZSBMaWNlbnNlLgotICovCi0KLS8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCi0gICBJTkNMVURFIEZJTEVTCi0qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLQotI2luY2x1ZGUgIk1peGVyX3ByaXZhdGUuaCIKLSNpbmNsdWRlICJWZWN0b3JBcml0aG1ldGljLmgiCi0KLS8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCi0gICBERUZJTklUSU9OUwotKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0KLSNkZWZpbmUgVFJVRSAgICAgICAgICAxCi0jZGVmaW5lIEZBTFNFICAgICAgICAgMAotCi0KLQotLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKLSAgIEZVTkNUSU9OIE1JWFNPRlRfMVNUX0QzMkMzMV9XUkEKLSoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotCi12b2lkIE1peFNvZnRfMVN0X0QzMkMzMV9XUkEoICAgIE1peF8xU3RfQ2xsX3QgICAgICAgKnBJbnN0YW5jZSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY29uc3QgTFZNX0lOVDMyICAgICAqc3JjLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBMVk1fSU5UMzIgICAgICpkc3QsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIExWTV9JTlQxNiAgICAgbikKLXsKLSAgICBjaGFyIEhhcmRNaXhpbmcgPSBUUlVFOwotCi0gICAgaWYobjw9MCkgICAgcmV0dXJuOwotCi0gICAgLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgotICAgICAgIFNPRlQgTUlYSU5HCi0gICAgKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLSAgICBpZiAocEluc3RhbmNlLT5DdXJyZW50ICE9IHBJbnN0YW5jZS0+VGFyZ2V0KQotICAgIHsKLSAgICAgICAgaWYocEluc3RhbmNlLT5BbHBoYSA9PSAwKXsKLSAgICAgICAgICAgIHBJbnN0YW5jZS0+Q3VycmVudCA9IHBJbnN0YW5jZS0+VGFyZ2V0OwotICAgICAgICB9ZWxzZSBpZiAoKHBJbnN0YW5jZS0+Q3VycmVudC1wSW5zdGFuY2UtPlRhcmdldCA8UE9JTlRfWkVST19PTkVfREIpJiYKLSAgICAgICAgICAgICAgICAgKHBJbnN0YW5jZS0+Q3VycmVudC1wSW5zdGFuY2UtPlRhcmdldCA+IC1QT0lOVF9aRVJPX09ORV9EQikpewotICAgICAgICAgICAgcEluc3RhbmNlLT5DdXJyZW50ID0gcEluc3RhbmNlLT5UYXJnZXQ7IC8qIERpZmZlcmVuY2UgaXMgbm90IHNpZ25pZmljYW50IGFueW1vcmUuICBNYWtlIHRoZW0gZXF1YWwuICovCi0gICAgICAgIH1lbHNlewotICAgICAgICAgICAgLyogU29mdCBtaXhpbmcgaGFzIHRvIGJlIGFwcGxpZWQgKi8KLSAgICAgICAgICAgIEhhcmRNaXhpbmcgPSBGQUxTRTsKLSAgICAgICAgICAgIENvcmVfTWl4U29mdF8xU3RfRDMyQzMxX1dSQSggcEluc3RhbmNlLCBzcmMsIGRzdCwgbik7Ci0gICAgICAgIH0KLSAgICB9Ci0KLSAgICAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCi0gICAgICAgSEFSRCBNSVhJTkcKLSAgICAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotCi0gICAgaWYgKEhhcmRNaXhpbmcpewotICAgICAgICBpZiAocEluc3RhbmNlLT5UYXJnZXQgPT0gMCkKLSAgICAgICAgICAgIExvYWRDb25zdF8zMigwLCBkc3QsIG4pOwotICAgICAgICBlbHNlIGlmICgocEluc3RhbmNlLT5UYXJnZXQ+PjE2KSA9PSAweDdGRkYpewotICAgICAgICAgICAgaWYgKHNyYyAhPSBkc3QpCi0gICAgICAgICAgICAgICAgQ29weV8xNigoTFZNX0lOVDE2KilzcmMsIChMVk1fSU5UMTYqKWRzdCwgKExWTV9JTlQxNikobiAqIDIpKTsKLSAgICAgICAgfQotICAgICAgICBlbHNlCi0gICAgICAgICAgICBNdWx0M3NfMzJ4MTYoIHNyYywgKExWTV9JTlQxNikocEluc3RhbmNlLT5DdXJyZW50Pj4xNiksIGRzdCwgbiApOwotICAgIH0KLQotICAgIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKLSAgICAgICBDQUxMIEJBQ0sKLSAgICAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotCi0gICAgaWYgKHBJbnN0YW5jZS0+Q2FsbGJhY2tTZXQpewotICAgICAgICBpZiAoKHBJbnN0YW5jZS0+Q3VycmVudC1wSW5zdGFuY2UtPlRhcmdldCA8UE9JTlRfWkVST19PTkVfREIpJiYKLSAgICAgICAgICAgIChwSW5zdGFuY2UtPkN1cnJlbnQtcEluc3RhbmNlLT5UYXJnZXQgPiAtUE9JTlRfWkVST19PTkVfREIpKXsKLSAgICAgICAgICAgIHBJbnN0YW5jZS0+Q3VycmVudCA9IHBJbnN0YW5jZS0+VGFyZ2V0OyAvKiBEaWZmZXJlbmNlIGlzIG5vdCBzaWduaWZpY2FudCBhbnltb3JlLiAgTWFrZSB0aGVtIGVxdWFsLiAqLwotICAgICAgICAgICAgcEluc3RhbmNlLT5DYWxsYmFja1NldCA9IEZBTFNFOwotICAgICAgICAgICAgaWYgKHBJbnN0YW5jZS0+cENhbGxCYWNrICE9IDApewotICAgICAgICAgICAgICAgICgqcEluc3RhbmNlLT5wQ2FsbEJhY2spICggcEluc3RhbmNlLT5wQ2FsbGJhY2tIYW5kbGUsIHBJbnN0YW5jZS0+cEdlbmVyYWxQdXJwb3NlLHBJbnN0YW5jZS0+Q2FsbGJhY2tQYXJhbSApOwotICAgICAgICAgICAgfQotICAgICAgICB9Ci0gICAgfQotfQotCi0vKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KZGlmZiAtLWdpdCBhL21lZGlhL2xpYmVmZmVjdHMvbHZtL2xpYi9Db21tb24vc3JjL01peFNvZnRfMlN0X0QzMkMzMV9TQVQuYyBiL21lZGlhL2xpYmVmZmVjdHMvbHZtL2xpYi9Db21tb24vc3JjL01peFNvZnRfMlN0X0QzMkMzMV9TQVQ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GUgTGljZW5zZS4KLSAqLwotCi0vKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgotICAgSU5DTFVERSBGSUxFUwotKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0KLSNpbmNsdWRlICJNaXhlcl9wcml2YXRlLmgiCi0jaW5jbHVkZSAiVmVjdG9yQXJpdGhtZXRpYy5oIgotCi0KLS8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCi0gICBGVU5DVElPTiBNSVhTT0ZUXzJTVF9EMzJDMzFfU0FUCi0qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLQotdm9pZCBNaXhTb2Z0XzJTdF9EMzJDMzFfU0FUKCAgICBNaXhfMlN0X0NsbF90ICAgICAgICpwSW5zdGFuY2UsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbnN0IExWTV9JTlQzMiAgICAgKnNyYzEsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbnN0IExWTV9JTlQzMiAgICAgKnNyYzIsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIExWTV9JTlQzMiAgICAgKmRzdCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTFZNX0lOVDE2ICAgICBuKQotewotCi0gICAgaWYobjw9MCkgICAgcmV0dXJuOwotCi0gICAgLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgotICAgICAgIFNPRlQgTUlYSU5HCi0gICAgKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLSAgICBpZiAoKHBJbnN0YW5jZS0+Q3VycmVudDEgIT0gcEluc3RhbmNlLT5UYXJnZXQxKSB8fCAocEluc3RhbmNlLT5DdXJyZW50MiAhPSBwSW5zdGFuY2UtPlRhcmdldDIpKQotICAgIHsKLSAgICAgICAgTWl4U29mdF8xU3RfRDMyQzMxX1dSQSggKE1peF8xU3RfQ2xsX3QqKSBwSW5zdGFuY2UsIHNyYzEsIGRzdCwgbik7Ci0gICAgICAgIE1peEluU29mdF9EMzJDMzFfU0FUKCAodm9pZCAqKSAmcEluc3RhbmNlLT5BbHBoYTIsICAgICAvKiBDYXN0IHRvIHZvaWQ6IG5vIGRlcmVmZXJlbmNpbmcgaW4gZnVuY3Rpb24qLwotICAgICAgICAgICAgc3JjMiwgZHN0LCBuKTsKLSAgICB9Ci0KLSAgICAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCi0gICAgICAgSEFSRCBNSVhJTkcKLSAgICAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotCi0gICAgZWxzZQotICAgIHsKLSAgICAgICAgaWYgKHBJbnN0YW5jZS0+Q3VycmVudDEgPT0gMCkKLSAgICAgICAgICAgIE1peFNvZnRfMVN0X0QzMkMzMV9XUkEoICh2b2lkICopICZwSW5zdGFuY2UtPkFscGhhMiwgLyogQ2FzdCB0byB2b2lkOiBubyBkZXJlZmVyZW5jaW5nIGluIGZ1bmN0aW9uKi8KLSAgICAgICAgICAgIHNyYzIsIGRzdCwgbik7Ci0gICAgICAgIGVsc2UgaWYgKHBJbnN0YW5jZS0+Q3VycmVudDIgPT0gMCkKLSAgICAgICAgICAgIE1peFNvZnRfMVN0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9yZy9saWNlbnNlcy9MSUNFTlNFLTIuMAotICoKLSAqIFVubGVzcyByZXF1aXJlZCBieSBhcHBsaWNhYmxlIGxhdyBvciBhZ3JlZWQgdG8gaW4gd3JpdGluZywgc29mdHdhcmUKLSAqIGRpc3RyaWJ1dGVkIHVuZGVyIHRoZSBMaWNlbnNlIGlzIGRpc3RyaWJ1dGVkIG9uIGFuICJBUyBJUyIgQkFTSVMsCi0gKiBXSVRIT1VUIFdBUlJBTlRJRVMgT1IgQ09ORElUSU9OUyBPRiBBTlkgS0lORCwgZWl0aGVyIGV4cHJlc3Mgb3IgaW1wbGllZC4KLSAqIFNlZSB0aGUgTGljZW5zZSBmb3IgdGhlIHNwZWNpZmljIGxhbmd1YWdlIGdvdmVybmluZyBwZXJtaXNzaW9ucyBhbmQKLSAqIGxpbWl0YXRpb25zIHVuZGVyIHRoZSBMaWNlbnNlLgotICovCi0KLSNpZm5kZWYgX19NSVhFUl9QUklWQVRFX0hfXwotI2RlZmluZSBfX01JWEVSX1BSSVZBVEVfSF9fCi0KLS8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCi0gICBJTkNMVURFIEZJTEVTCi0qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLQotI2luY2x1ZGUgIk1peGVyLmgiCi0KLSNkZWZpbmUgUE9JTlRfWkVST19PTkVfREIgMjQ3MzgwNSAvKiAwLjAxIGRCIG9uIGEgZnVsbCBzY2FsZSBzaWduYWwgPSAoMTBeKDAuMDEvMjApIC0xKSAqIDJeMzEgKi8KLQotLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKLSAgIERFRklOSVRJT05TCi0qKioqKioqKioqKioqKioqKioqKioqK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byBpbiB3cml0aW5nLCBzb2Z0d2FyZQotICogZGlzdHJpYnV0ZWQgdW5kZXIgdGhlIExpY2Vuc2UgaXMgZGlzdHJpYnV0ZWQgb24gYW4gIkFTIElTIiBCQVNJUywKLSAqIFdJVEhPVVQgV0FSUkFOVElFUyBPUiBDT05ESVRJT05TIE9GIEFOWSBLSU5ELCBlaXRoZXIgZXhwcmVzcyBvciBpbXBsaWVkLgotICogU2VlIHRoZSBMaWNlbnNlIGZvciB0aGUgc3BlY2lmaWMgbGFuZ3VhZ2UgZ292ZXJuaW5nIHBlcm1pc3Npb25zIGFuZAotICogbGltaXRhdGlvbnMgdW5kZXIgdGhlIExpY2Vuc2UuCi0gKi8KLQotLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKLSAgIElOQ0xVREUgRklMRVMKLSoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotCi0jaW5jbHVkZSAiVmVjdG9yQXJpdGhtZXRpYy5oIgotCi0vKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgotICAgRlVOQ1RJT04gTW9ub1RvMklfMTYKLSoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotCi12b2lkIE1vbm9UbzJJXzE2KCBjb25zdCBMVk1fSU5UMTYgKnNyYywKLSAgICAgICAgICAgICAgICAgTFZNX0lOVDE2ICpkc3QsCi0gICAgICAgICAgICAgICAgIExWTV9JTlQxNiBuKQotewotICAgIExWTV9JTlQxNiBpaTsKLSAgICBzcmMgKz0gKG4tMSk7Ci0gICAgZHN0ICs9ICgobioyKS0xKTsKLQotICAgIGZvci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BVbmxlc3MgcmVxdWlyZWQgYnkgYXBwbGljYWJsZSBsYXcgb3IgYWdyZWVkIHRvIGluIHdyaXRpbmcsIHNvZnR3YXJlCi0gKiBkaXN0cmlidXRlZCB1bmRlciB0aGUgTGljZW5zZSBpcyBkaXN0cmlidXRlZCBvbiBhbiAiQVMgSVMiIEJBU0lTLAotICogV0lUSE9VVCBXQVJSQU5USUVTIE9SIENPTkRJVElPTlMgT0YgQU5ZIEtJTkQsIGVpdGhlciBleHByZXNzIG9yIGltcGxpZWQuCi0gKiBTZWUgdGhlIExpY2Vuc2UgZm9yIHRoZSBzcGVjaWZpYyBsYW5ndWFnZSBnb3Zlcm5pbmcgcGVybWlzc2lvbnMgYW5kCi0gKiBsaW1pdGF0aW9ucyB1bmRlciB0aGUgTGljZW5zZS4KLSAqLwotCi0vKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgotICAgSU5DTFVERSBGSUxFUwotKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0KLSNpbmNsdWRlICJWZWN0b3JBcml0aG1ldGljLmgiCi0KLS8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCi0gICBGVU5DVElPTiBNb25vVG8ySV8zMgotKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0KLXZvaWQgTW9ub1RvMklfMzIoIGNvbnN0IExWTV9JTlQzMiAgKnNyYywKLSAgICAgICAgICAgICAgICAgTFZNX0lOVDMyICAqZHN0LAotICAgICAgICAgICAgICAgICBMVk1fSU5UMTYgbikKLXsKLSAgICBMVk1fSU5UMTYgaWk7Ci0gICA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L3d3dy5hcGFjaGUub3JnL2xpY2Vuc2VzL0xJQ0VOU0UtMi4wCi0gKgotICogVW5sZXNzIHJlcXVpcmVkIGJ5IGFwcGxpY2FibGUgbGF3IG9yIGFncmVlZCB0byBpbiB3cml0aW5nLCBzb2Z0d2FyZQotICogZGlzdHJpYnV0ZWQgdW5kZXIgdGhlIExpY2Vuc2UgaXMgZGlzdHJpYnV0ZWQgb24gYW4gIkFTIElTIiBCQVNJUywKLSAqIFdJVEhPVVQgV0FSUkFOVElFUyBPUiBDT05ESVRJT05TIE9GIEFOWSBLSU5ELCBlaXRoZXIgZXhwcmVzcyBvciBpbXBsaWVkLgotICogU2VlIHRoZSBMaWNlbnNlIGZvciB0aGUgc3BlY2lmaWMgbGFuZ3VhZ2UgZ292ZXJuaW5nIHBlcm1pc3Npb25zIGFuZAotICogbGltaXRhdGlvbnMgdW5kZXIgdGhlIExpY2Vuc2UuCi0gKi8KLQotLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKLSAgIElOQ0xVREUgRklMRVMKLSoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotCi0jaW5jbHVkZSAiVmVjdG9yQXJpdGhtZXRpYy5oIgotI2luY2x1ZGUgIkxWTV9NYWNyb3MuaCIKLQotLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKLUZVTkNUSU9OIE1VTFQzU18xNlgxNgotKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0KLXZvaWQgTXVsdDNzXzMyeDE2KCBjb25zdCBMVk1fSU5UMzIgKnNyYywKLSAgICAgICAgICAgIC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hlICJMaWNlbnNlIik7Ci0gKiB5b3UgbWF5IG5vdCB1c2UgdGhpcyBmaWxlIGV4Y2VwdCBpbiBjb21wbGlhbmNlIHdpdGggdGhlIExpY2Vuc2UuCi0gKiBZb3UgbWF5IG9idGFpbiBhIGNvcHkgb2YgdGhlIExpY2Vuc2UgYXQKLSAqCi0gKiAgICAgIGh0dHA6Ly93d3cuYXBhY2hlLm9yZy9saWNlbnNlcy9MSUNFTlNFLTIuMAotICoKLSAqIFVubGVzcyByZXF1aXJlZCBieSBhcHBsaWNhYmxlIGxhdyBvciBhZ3JlZWQgdG8gaW4gd3JpdGluZywgc29mdHdhcmUKLSAqIGRpc3RyaWJ1dGVkIHVuZGVyIHRoZSBMaWNlbnNlIGlzIGRpc3RyaWJ1dGVkIG9uIGFuICJBUyBJUyIgQkFTSVMsCi0gKiBXSVRIT1VUIFdBUlJBTlRJRVMgT1IgQ09ORElUSU9OUyBPRiBBTlkgS0lORCwgZWl0aGVyIGV4cHJlc3Mgb3IgaW1wbGllZC4KLSAqIFNlZSB0aGUgTGljZW5zZSBmb3IgdGhlIHNwZWNpZmljIGxhbmd1YWdlIGdvdmVybmluZyBwZXJtaXNzaW9ucyBhbmQKLSAqIGxpbWl0YXRpb25zIHVuZGVyIHRoZSBMaWNlbnNlLgotICovCi0KLS8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotLyogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgICBJbmNsdWRlcyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0KLSNpbmNsdWRlICJDb21wTGltX3ByaXZhdGUuaCIKLQotLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0vKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qIEZVTkNUSU9OOiAgICAgICAgICAgICAgICAgTm9uTGluQ29tcF9EMTYgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiBERVNDUklQVElPTjogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICBOb24tbGluZWFyIGNvbXByZXNzaW9uIGJ5IGNvbXBhbmRpbmcuIFRoZSBmdW5jdGlvbiB3b3JrcyBvbiBhIHNhbXBsZSBieSBzYW1wbGUgICAgICAqLwotLyogIGJhc2lzIGJ5IGluY3JlYXNpbmcgdGhlIGxldmVsIG5lYXIgdGhlIHplcm8gY3Jvc3NpbmcuIFRoaXMgZ2l2ZXMgYSB0dHJhZGUtb2ZmICAgICAgICovCi0vKiAgYmV0d2VlbiBUSEQgYW5kIGNvbXByZXNzaW9uLiBJdCB1c2VzIHRoZSBlcXVhdGlvbjogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogICAgICAgIE91dHB1dCA9IElucHV0ICsgSyAqIChJbnB1dCAtIElucHV0XjIpICAgICAgICBpZiBJbnB1dCA+ICAwICAgICAgICAgICAgICAgICAgICovCi0vKiAgICAgICAgICAgICAgID0gSW5wdXQgKyBLICogKElucHV0ICsgSW5wdXReMikgICAgICBpZiBJbnB1dCA8PSAwICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogICAgVGhlIHZhbHVlIG9mIEsgY29udHJvbHMgdGhlIGFtb3VudCBvZiBjb21wcmVzc2lvbiBhbmQgYXMgYSBzaWRlIGVmZmVjdCB0aGUgYW1vdW50ICovCi0vKiAgZGlzdG9ydGlvbiBpbnRyb2R1Y2VkLiBUaGUgYW1vdW50IG9mIGNvbXByZXNzaW9uIGlzIHNpZ25hbCBkZXBlbmRlbnQgYW5kIHRoZSB2YWx1ZXMgKi8KLS8qICBnaXZlbiBiZWxvdyBhcmUgYXBwcm94aW1hdGUuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgICAgICAgR2FpbiAoZnJhY3Rpb25hbCkgIEdhaW4gKGludGVnZXIpICAgIENvbXByZXNzaW9uICAgICAgICAgIFBrLVBrIFRIRCAgICAgICAgICAgKi8KLS8qICAgICAgICAgICAgMS4wICAgICAgICAgICAgICAgICAzMjc2NyAgICAgICAgICAgICs2ZEIgICAgICAgICAgICAxNmRCICAgICAgICAgICAgICAgICAqLwotLyogICAgICAgICAgICAwLjc4ICAgICAgICAgICAgICAgIDI1NTU5ICAgICAgICAgICAgKzVkQiAgICAgICAgICAgIDE5ZEIgICAgICAgICAgICAgICAgICovCi0vKiAgICAgICAgICAgIDAuNiAgICAgICAgICAgICAgICAgMTk2NjEgICAgICAgICAgICArNGRCICAgICAgICAgICAgMjFkQiAgICAgICAgICAgICAgICAgKi8KLS8qICAgICAgICAgICAgMC40MSAgICAgICAgICAgICAgICAxMzQzNSAgICAgICAgICAgICszZEIgICAgICAgICAgICAyNGRCICAgICAgICAgICAgICAgICAqLwotLyogICAgICAgICAgICAwLjI2ICAgICAgICAgICAgICAgICA4NTIwICAgICAgICAgICAgKzJkQiAgICAgICAgICAgIDI4ZEIgICAgICAgICAgICAgICAgICovCi0vKiAgICAgICAgICAgIDAuMTIgICAgICAgICAgICAgICAgIDM5MzIgICAgICAgICAgICArMWRCICAgICAgICAgICAgMzRkQiAgICAgICAgICAgICAgICAgKi8KLS8qICAgICAgICAgICAgMC4wICAgICAgICAgICAgICAgICAgICAgMCAgICAgICAgICAgICswZEIgICAgICAgICAgICA5OGRCICAgICAgICAgICAgICAgICAqLwotLyogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiBQQVJBTUVURVJTOiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICAgIEdhaW4gICAgICAgICAgICAtICAgIGNvbXByZXNzaW9uIGNvbnRyb2wgcGFyYW1ldGVyICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogICAgcERhdGFJbiAgICAgICAgIC0gICAgcG9pbnRlciB0byB0aGUgaW5wdXQgZGF0YSBidWZmZXIgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgICBwRGF0YU91dCAgICAgICAgLSAgICBwb2ludGVyIHRvIHRoZSBvdXRwdXQgZGF0YSBidWZmZXIgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICAgIEJsb2NrTGVuZ3RoICAgICAtICAgIG51bWJlciBvZiBzYW1wbGVzIHRvIHByb2Nlc3MgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiBSRVRVUk5TOiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICAgIE5vbmUgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiBOT1RFUzogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0KLXZvaWQgTm9uTGluQ29tcF9EMTYoTFZNX0lOVDE2ICAgICAgICBHYWluLAotICAgICAgICAgICAgICAgICAgICAgIExWTV9JTlQxNiAgICAgICAgKnBEYXRhSW4sCi0gICAgICAgICAgICAgICAgICAgIExWTV9JTlQxNiAgICAgICAgKnBEYXRhT3V0LAotICAgICAgICAgICAgICAgICAgICBMVk1fSU5UMzIgICAgICAgIEJsb2NrTGVuZ3RoKQotewotCi0gICAgTFZNX0lOVDE2ICAgICAgICAgICAgU2FtcGxlOyAgICAgICAgICAgICAgICAgICAgLyogSW5wdXQgc2FtcGxlcyAqLwotICAgIExWTV9JTlQzMiAgICAgICAgICAgIFNhbXBsZU5vOyAgICAgICAgICAgICAgICAvKiBTYW1wbGUgaW5kZXggKi8KLSAgICBMVk1fSU5UMTYgICAgICAgICAgICBUZW1wOwotCi0KLSAgICAvKgotICAgICAqIFByb2Nlc3MgYSBibG9jayBvZiBzYW1wbGVzCi0gICAgICovCi0gICAgZm9yKFNhbXBsZU5vID0gMDsgU2FtcGxlTm88QmxvY2tMZW5ndGg7IFNhbXBsZU5vKyspCi0gICAgewotCi0gICAgICAgIC8qCi0gICAgICAgICAqIFJlYWQgdGhlIGlucHV0Ci0gICAgICAgICAqLwotICAgICAgICBTYW1wbGUgPSAqcERhdGFJbjsKLSAgICAgICAgcERhdGFJbisrOwotCi0KLSAgICAgICAgLyoKLSAgICAgICAgICogQXBwbHkgdGhlIGNvbXBhbmRlciwgdGhpcyBjb21wcmVzc2VzIHRoZSBzaWduYWwgYXQgdGhlIGV4cGVuc2Ugb2YKLSAgICAgICAgICogaGFybW9uaWMgZGlzdG9ydGlvbi4gVGhlIGFtb3VudCBvZiBjb21wcmVzc2lvbiBpcyBjb250cm9sIGJ5IHRoZQotICAgICAgICAgKiBnYWluIGZhY3RvcgotICAgICAgICAgKi8KLSAgICAgICAgaWYgKChMVk1fSU5UMzIpU2FtcGxlICE9IC0zMjc2OCkKLSAgICAgICAgewotICAgICAgICAgICAgVGVtcCA9IChMVk1fSU5UMTYpKChTYW1wbGUgKiBTYW1wbGUpID4+IDE1KTsKLSAgICAgICAgICAgIGlmKFNhbXBsZSA+MCkKLSAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICBTYW1wbGUgPSAoTFZNX0lOVDE2KShTYW1wbGUgKyAoKEdhaW4gKiAoU2FtcGxlIC0gVGVtcCkpID4+IDE1KSk7Ci0gICAgICAgICAgICB9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xdWFkU3RhdGUtPnBEZWxheXNbMF0gaXMgeChuLTEpTCBpbiBRMCBmb3JtYXQKLSBwQmlxdWFkU3RhdGUtPnBEZWxheXNbMV0gaXMgeChuLTEpUiBpbiBRMCBmb3JtYXQKLSBwQmlxdWFkU3RhdGUtPnBEZWxheXNbMl0gaXMgeChuLTIpTCBpbiBRMCBmb3JtYXQKLSBwQmlxdWFkU3RhdGUtPnBEZWxheXNbM10gaXMgeChuLTIpUiBpbiBRMCBmb3JtYXQKLSBwQmlxdWFkU3RhdGUtPnBEZWxheXNbNF0gaXMgeShuLTEpTCBpbiBRMCBmb3JtYXQKLSBwQmlxdWFkU3RhdGUtPnBEZWxheXNbNV0gaXMgeShuLTEpUiBpbiBRMCBmb3JtYXQKLSBwQmlxdWFkU3RhdGUtPnBEZWxheXNbNl0gaXMgeShuLTIpTCBpbiBRMCBmb3JtYXQKLSBwQmlxdWFkU3RhdGUtPnBEZWxheXNbN10gaXMgeShuLTIpUiBpbiBRMCBmb3JtYXQKLSoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLXZvaWQgUEtfMklfRDMyRjMyQzE0RzExX1RSQ19XUkFfMDEgKCBCaXF1YWRfSW5zdGFuY2VfdCAgICAgICAqcEluc3RhbmNlLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIExWTV9JTlQzMiAgICAgICAgICAgICAgICpwRGF0YUluLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIExWTV9JTlQzMiAgICAgICAgICAgICAgICpwRGF0YU91dCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBMVk1fSU5UMTYgICAgICAgICAgICAgICBOclNhbXBsZXMpCi0gICAgewotICAgICAgICBMVk1fSU5UMzIgeW5MLHluUix5bkxPLHluUk8sdGVtcGw7Ci0gICAgICAgIExWTV9JTlQxNiBpaTsKLSAgICAgICAgUEZpbHRlcl9TdGF0ZSBwQmlxdWFkU3RhdGUgPSAoUEZpbHRlcl9TdGF0ZSkgcEluc3RhbmNlOwotCi0gICAgICAgICBmb3IgKGlpID0gTnJTYW1wbGVzOyBpaSAhPSAwOyBpaS0tKQotICAgICAgICAgewotCi0KLSAgICAgICAgICAgIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgotICAgICAgICAgICAgICAgICAgICAgICAgICAgIFBST0NFU1NJTkcgT0YgVEhFIExFRlQgQ0hBTk5FTAotICAgICAgICAgICAgKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotICAgICAgICAgICAgLyogeW5MPSAoQTAgKFExNCkgKiAoeChuKUwgKFEwKSAtIHgobi0yKUwgKFEwKSApID4+MTQpICBpbiBRMCovCi0gICAgICAgICAgICB0ZW1wbD0oKnBEYXRhSW4pLXBCaXF1YWRTdGF0ZS0+cERlbGF5c1syXTsKLSAgICAgICAgICAgIE1VTDMyeDE2SU5UTzMyKHRlbXBsLHBCaXF1YWRTdGF0ZS0+Y29lZnNbMF0seW5MLDE0KQotCi0gICAgICAgICAgICAvKiB5bkwrPSAoKC1CMiAoUTE0KSAqIHkobi0yKUwgKFEwKSApID4+MTQpIGluIFEwKi8KLSAgICAgICAgICAgIE1VTDMyeDE2SU5UTzMyKHBCaXF1YWRTdGF0ZS0+cERlbGF5c1s2XSxwQmlxdWFkU3RhdGUtPmNvZWZzWzFdLHRlbXBsLDE0KQotICAgICAgICAgICAgeW5MKz10ZW1wbDsKLQotICAgICAgICAgICAgLyogeW5MKz0gKCgtQjEgKFExNCkgKiB5KG4tMSlMIChRMCkgKSA+PjE0KSBpbiBRMCAqLwotICAgICAgICAgICAgTVVMMzJ4MTZJTlRPMzIocEJpcXVhZFN0YXRlLT5wRGVsYXlzWzRdLHBCaXF1YWRTdGF0ZS0+Y29lZnNbMl0sdGVtcGwsMTQpCi0gICAgICAgICAgICB5bkwrPXRlbXBsOwotCi0gICAgICAgICAgICAvKiB5bkxPPSAoKEdhaW4gKFExMSkgKiB5bkwgKFEwKSk+PjExKSBpbiBRMCovCi0gICAgICAgICAgICBNVUwzMngxNklOVE8zMih5bkwscEJpcXVhZFN0YXRlLT5jb2Vmc1szXSx5bkxPLDExKQotCi0gICAgICAgICAgICAvKiB5bkxPPSggeW5MTyhRMCkgKyB4KG4pTCAoUTApICkgaW4gUTAqLwotICAgICAgICAgICAgeW5MTys9ICgqcERhdGFJbik7Ci0KLSAgICAgICAgICAgIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgotICAgICAgICAgICAgICAgICAgICAgICAgICAgIFBST0NFU1NJTkcgT0YgVEhFIFJJR0hUIENIQU5ORUwKLSAgICAgICAgICAgICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLSAgICAgICAgICAgIC8qIHluUj0gKEEwIChRMTQpICogKHgobilSIChRMCkgLSB4KG4tMilSIChRMCkgKSA+PjE0KSAgIGluIFEwKi8KLSAgICAgICAgICAgIHRlbXBsPSgqKHBEYXRhSW4rMSkpLXBCaXF1YWRTdGF0ZS0+cERlbGF5c1szXTsKLSAgICAgICAgICAgIE1VTDMyeDE2SU5UTzMyKHRlbXBsLHBCaXF1YWRTdGF0ZS0+Y29lZnNbMF0seW5SLDE0KQotCi0gICAgICAgICAgICAvKiB5blIrPSAoKC1CMiAoUTE0KSAqIHkobi0yKVIgKFEwKSApID4+MTQpICBpbiBRMCovCi0gICAgICAgICAgICBNVUwzMngxNklOVE8zMihwQmlxdWFkU3RhdGUtPnBEZWxheXNbN10scEJpcXVhZFN0YXRlLT5jb2Vmc1sxXSx0ZW1wbCwxNCkKLSAgICAgICAgICAgIHluUis9dGVtcGw7Ci0KLSAgICAgICAgICAgIC8qIHluUis9ICgoLUIxIChRMTQpICogeShuLTEpUiAoUTApICkgPj4xNCkgIGluIFEwICovCi0gICAgICAgICAgICBNVUwzMngxNklOVE8zMihwQmlxdWFkU3RhdGUtPnBEZWxheXNbNV0scEJpcXVhZFN0YXRlLT5jb2Vmc1syXSx0ZW1wbCwxNCkKLSAgICAgICAgICAgIHluUis9dGVtcGw7Ci0KLSAgICAgICAgICAgIC8qIHluUk89ICgoR2FpbiAoUTExKSAqIHluUiAoUTApKT4+MTEpIGluIFEwKi8KLSAgICAgICAgICAgIE1VTDMyeDE2SU5UTzMyKHluUixwQmlxdWFkU3RhdGUtPmNvZWZzWzNdLHluUk8sMTEpCi0KLSAgICAgICAgICAgIC8qIHluUk89KCB5blJPKFEwKSArIHgobilSIChRMCkgKSBpbiBRMCovCi0gICAgICAgICAgICB5blJPKz0gKCoocERhdGFJbisxKSk7Ci0KLSAgICAgICAgICAgIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgotICAgICAgICAgICAgICAgICAgICAgICAgICAgIFVQREFUSU5HIFRIRSBERUxBWVMKLSAgICAgICAgICAgICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLSAgICAgICAgICAgIHBCaXF1YWRTdGF0ZS0+cERlbGF5c1s3XT1wQmlxdWFkU3RhdGUtPnBEZWxheXNbNV07IC8qIHkobi0yKVI9eShuLTEpUiovCi0gICAgICAgICAgICBwQmlxdWFkU3RhdGUtPnBEZWxheXNbNl09cEJpcXVhZFN0YXRlLT5wRGVsYXlzWzRdOyAvKiB5KG4tMilMPXkobi0xKUwqLwotICAgICAgICAgICAgcEJpcXVhZFN0YXRlLT5wRGVsYXlzWzNdPXBCaXF1YWRTdGF0ZS0+cERlbGF5c1sxXTsgLyogeChuLTIpUj14KG4tMSlSKi8KLSAgICAgICAgICAgIHBCaXF1YWRTdGF0ZS0+cERlbGF5c1syXT1wQmlxdWFkU3RhdGUtPnBEZWxheXNbMF07IC8qIHgobi0yKUw9eChuLTEpTCovCi0gICAgICAgICAgICBwQmlxdWFkU3RhdGUtPnBEZWxheXNbNV09eW5SOyAvKiBVcGRhdGUgeShuLTEpUiBpbiBRMCovCi0gICAgICAgICAgICBwQmlxdWFkU3RhdGUtPnBEZWxheXNbNF09eW5MOyAvKiBVcGRhdGUgeShuLTEpTCBpbiBRMCovCi0gICAgICAgICAgICBwQmlxdWFkU3RhdGUtPnBEZWxheXNbMF09KCpwRGF0YUluKTsgLyogVXBkYXRlIHgobi0xKUwgaW4gUTAqLwotICAgICAgICAgICAgcERhdGFJbisrOwotICAgICAgICAgICAgcEJpcXVhZFN0YXRlLT5wRGVsYXlzWzFdPSgqcERhdGFJbik7IC8qIFVwZGF0ZSB4KG4tMSlSIGluIFEwKi8KLSAgICAgICAgICAgIHBEYXRhSW4rKzsKLQotICAgICAgICAgICAgLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgV1JJVElORyBUSEUgT1VUUFVUCi0gICAgICAgICAgICAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0gICAgICAgICAgICAqcERhdGFPdXQ9eW5MTzsgLyogV3JpdGUgTGVmdCBvdXRwdXQgaW4gUTAqLwotICAgICAgICAgICAgcERhdGFPdXQrKzsKLSAgICAgICAgICAgICpwRGF0YU91dD15blJPOyAvKiBXcml0ZSBSaWdodCBvdXB1dCBpbiBRMCovCi0gICAgICAgICAgICBwRGF0YU91dCsrOwotCi0gICAgICAgIH0KLQotICAgIH0KLQpkaWZmIC0tZ2l0IGEvbWVkaWEvbGliZW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F5c1s1XSBpcyB5KG4tMSlSIGluIFEwIGZvcm1hdAotIHBCaXF1YWRTdGF0ZS0+cERlbGF5c1s2XSBpcyB5KG4tMilMIGluIFEwIGZvcm1hdAotIHBCaXF1YWRTdGF0ZS0+cERlbGF5c1s3XSBpcyB5KG4tMilSIGluIFEwIGZvcm1hdAotKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotdm9pZCBQS18ySV9EMzJGMzJDMzBHMTFfVFJDX1dSQV8wMSAoIEJpcXVhZF9JbnN0YW5jZV90ICAgICAgICpwSW5zdGFuY2UsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTFZNX0lOVDMyICAgICAgICAgICAgICAgKnBEYXRhSW4sCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTFZNX0lOVDMyICAgICAgICAgICAgICAgKnBEYXRhT3V0LAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIExWTV9JTlQxNiAgICAgICAgICAgICAgIE5yU2FtcGxlcykKLSAgICB7Ci0gICAgICAgIExWTV9JTlQzMiB5bkwseW5SLHluTE8seW5STyx0ZW1wbDsKLSAgICAgICAgTFZNX0lOVDE2IGlpOwotICAgICAgICBQRmlsdGVyX1N0YXRlIHBCaXF1YWRTdGF0ZSA9IChQRmlsdGVyX1N0YXRlKSBwSW5zdGFuY2U7Ci0KLSAgICAgICAgIGZvciAoaWkgPSBOclNhbXBsZXM7IGlpICE9IDA7IGlpLS0pCi0gICAgICAgICB7Ci0KLQotICAgICAgICAgICAgLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgUFJPQ0VTU0lORyBPRiBUSEUgTEVGVCBDSEFOTkVMCi0gICAgICAgICAgICAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0gICAgICAgICAgICAvKiB5bkw9IChBMCAoUTMwKSAqICh4KG4pTCAoUTApIC0geChuLTIpTCAoUTApICkgPj4zMCkgIGluIFEwKi8KLSAgICAgICAgICAgIHRlbXBsPSgqcERhdGFJbiktcEJpcXVhZFN0YXRlLT5wRGVsYXlzWzJdOwotICAgICAgICAgICAgTVVMMzJ4MzJJTlRPMzIodGVtcGwscEJpcXVhZFN0YXRlLT5jb2Vmc1swXSx5bkwsMzApCi0KLSAgICAgICAgICAgIC8qIHluTCs9ICgoLUIyIChRMzApICogeShuLTIpTCAoUTApICkgPj4zMCkgaW4gUTAqLwotICAgICAgICAgICAgTVVMMzJ4MzJJTlRPMzIocEJpcXVhZFN0YXRlLT5wRGVsYXlzWzZdLHBCaXF1YWRTdGF0ZS0+Y29lZnNbMV0sdGVtcGwsMzApCi0gICAgICAgICAgICB5bkwrPXRlbXBsOwotCi0gICAgICAgICAgICAvKiB5bkwrPSAoKC1CMSAoUTMwKSAqIHkobi0xKUwgKFEwKSApID4+MzApIGluIFEwICovCi0gICAgICAgICAgICBNVUwzMngzMklOVE8zMihwQmlxdWFkU3RhdGUtPnBEZWxheXNbNF0scEJpcXVhZFN0YXRlLT5jb2Vmc1syXSx0ZW1wbCwzMCkKLSAgICAgICAgICAgIHluTCs9dGVtcGw7Ci0KLSAgICAgICAgICAgIC8qIHluTE89ICgoR2FpbiAoUTExKSAqIHluTCAoUTApKT4+MTEpIGluIFEwKi8KLSAgICAgICAgICAgIE1VTDMyeDE2SU5UTzMyKHluTCxwQmlxdWFkU3RhdGUtPmNvZWZzWzNdLHluTE8sMTEpCi0gICAgICAgICAgICAvKiB5bkxPPSggeW5MTyhRMCkgKyB4KG4pTCAoUTApICkgaW4gUTAqLwotICAgICAgICAgICAgeW5MTys9ICgqcERhdGFJbik7Ci0KLSAgICAgICAgICAgIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgotICAgICAgICAgICAgICAgICAgICAgICAgICAgIFBST0NFU1NJTkcgT0YgVEhFIFJJR0hUIENIQU5ORUwKLSAgICAgICAgICAgICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLSAgICAgICAgICAgIC8qIHluUj0gKEEwIChRMzApICogKHgobilSIChRMCkgLSB4KG4tMilSIChRMCkgKSA+PjMwKSAgIGluIFEwKi8KLSAgICAgICAgICAgIHRlbXBsPSgqKHBEYXRhSW4rMSkpLXBCaXF1YWRTdGF0ZS0+cERlbGF5c1szXTsKLSAgICAgICAgICAgIE1VTDMyeDMySU5UTzMyKHRlbXBsLHBCaXF1YWRTdGF0ZS0+Y29lZnNbMF0seW5SLDMwKQotCi0gICAgICAgICAgICAvKiB5blIrPSAoKC1CMiAoUTMwKSAqIHkobi0yKVIgKFEwKSApID4+MzApICBpbiBRMCovCi0gICAgICAgICAgICBNVUwzMngzMklOVE8zMihwQmlxdWFkU3RhdGUtPnBEZWxheXNbN10scEJpcXVhZFN0YXRlLT5jb2Vmc1sxXSx0ZW1wbCwzMCkKLSAgICAgICAgICAgIHluUis9dGVtcGw7Ci0KLSAgICAgICAgICAgIC8qIHluUis9ICgoLUIxIChRMzApICogeShuLTEpUiAoUTApICkgPj4zMCkgIGluIFEwICovCi0gICAgICAgICAgICBNVUwzMngzMklOVE8zMihwQmlxdWFkU3RhdGUtPnBEZWxheXNbNV0scEJpcXVhZFN0YXRlLT5jb2Vmc1syXSx0ZW1wbCwzMCkKLSAgICAgICAgICAgIHluUis9dGVtcGw7Ci0KLSAgICAgICAgICAgIC8qIHluUk89ICgoR2FpbiAoUTExKSAqIHluUiAoUTApKT4+MTEpIGluIFEwKi8KLSAgICAgICAgICAgIE1VTDMyeDE2SU5UTzMyKHluUixwQmlxdWFkU3RhdGUtPmNvZWZzWzNdLHluUk8sMTEpCi0KLSAgICAgICAgICAgIC8qIHluUk89KCB5blJPKFEwKSArIHgobilSIChRMCkgKSBpbiBRMCovCi0gICAgICAgICAgICB5blJPKz0gKCoocERhdGFJbisxKSk7Ci0KLSAgICAgICAgICAgIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgotICAgICAgICAgICAgICAgICAgICAgICAgICAgIFVQREFUSU5HIFRIRSBERUxBWVMKLSAgICAgICAgICAgICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLSAgICAgICAgICAgIHBCaXF1YWRTdGF0ZS0+cERlbGF5c1s3XT1wQmlxdWFkU3RhdGUtPnBEZWxheXNbNV07IC8qIHkobi0yKVI9eShuLTEpUiovCi0gICAgICAgICAgICBwQmlxdWFkU3RhdGUtPnBEZWxheXNbNl09cEJpcXVhZFN0YXRlLT5wRGVsYXlzWzRdOyAvKiB5KG4tMilMPXkobi0xKUwqLwotICAgICAgICAgICAgcEJpcXVhZFN0YXRlLT5wRGVsYXlzWzNdPXBCaXF1YWRTdGF0ZS0+cERlbGF5c1sxXTsgLyogeChuLTIpUj14KG4tMSlSKi8KLSAgICAgICAgICAgIHBCaXF1YWRTdGF0ZS0+cERlbGF5c1syXT1wQmlxdWFkU3RhdGUtPnBEZWxheXNbMF07IC8qIHgobi0yKUw9eChuLTEpTCovCi0gICAgICAgICAgICBwQmlxdWFkU3RhdGUtPnBEZWxheXNbNV09eW5SOyAvKiBVcGRhdGUgeShuLTEpUiBpbiBRMCovCi0gICAgICAgICAgICBwQmlxdWFkU3RhdGUtPnBEZWxheXNbNF09eW5MOyAvKiBVcGRhdGUgeShuLTEpTCBpbiBRMCovCi0gICAgICAgICAgICBwQmlxdWFkU3RhdGUtPnBEZWxheXNbMF09KCpwRGF0YUluKTsgLyogVXBkYXRlIHgobi0xKUwgaW4gUTAqLwotICAgICAgICAgICAgcERhdGFJbisrOwotICAgICAgICAgICAgcEJpcXVhZFN0YXRlLT5wRGVsYXlzWzFdPSgqcERhdGFJbik7IC8qIFVwZGF0ZSB4KG4tMSlSIGluIFEwKi8KLSAgICAgICAgICAgIHBEYXRhSW4rKzsKLQotICAgICAgICAgICAgLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgV1JJVElORyBUSEUgT1VUUFVUCi0gICAgICAgICAgICAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0gICAgICAgICAgICAqcERhdGFPdXQ9eW5MTzsgLyogV3JpdGUgTGVmdCBvdXRwdXQgaW4gUTAqLwotICAgICAgICAgICAgcERhdGFPdXQrKzsKLSAgICAgICAgICAgICpwRGF0YU91dD15blJPOyAvKiBXcml0ZSBSaWdodCBvdXB1dCBpbiBRMCovCi0gICAgICAgICAgICBwRGF0YU91dCsrOwotICAgICAgICB9Ci0KLSAgICB9Ci0KZGlmZiAtLWdpdCBhL21lZGlhL2xpYmVmZmVjdHMvbHZtL2xpYi9Db21tb24vc3JjL1BLXzJJX0QzMkYzMkNsbEdzc19UUkNfV1JBXzAxX0luaXQuYyBiL21lZGlhL2xpYmVmZmVjdHMvbHZtL2xpYi9Db21tb24vc3JjL1BLXzJJX0QzMkYzMkNsbEdzc19UUkNfV1JBXzAxX0luaXQuYwpkZWxldGVkIGZpbGUgbW9kZSAxMDA2NDQKaW5kZXggMWQ2MTQyYy4uMDAwMDAwMAotLS0gYS9tZWRpYS9saWJlZmZlY3RzL2x2bS9saWIvQ29tbW9uL3NyYy9QS18ySV9EMzJGMzJDbGxHc3NfVFJDX1dSQV8wMV9Jbml0LmMKKysrIC9kZXYvbnVsbApAQC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pY2Vuc2VkIHVuZGVyIHRoZSBBcGFjaGUgTGljZW5zZSwgVmVyc2lvbiAyLjAgKHRoZSAiTGljZW5zZSIpOwotICogeW91IG1heSBub3QgdXNlIHRoaXMgZmlsZSBleGNlcHQgaW4gY29tcGxpYW5jZSB3aXRoIHRoZSBMaWNlbnNlLgotICogWW91IG1heSBvYnRhaW4gYSBjb3B5IG9mIHRoZSBMaWNlbnNlIGF0Ci0gKgotICogICAgICBodHRwOi8vd3d3LmFwYWNoZS5vcmcvbGljZW5zZXMvTElDRU5TRS0yLjAKLSAqCi0gKiBVbmxlc3MgcmVxdWlyZWQgYnkgYXBwbGljYWJsZSBsYXcgb3IgYWdyZWVkIHRvIGluIHdyaXRpbmcsIHNvZnR3YXJlCi0gKiBkaXN0cmlidXRlZCB1bmRlciB0aGUgTGljZW5zZSBpcyBkaXN0cmlidXRlZCBvbiBhbiAiQVMgSVMiIEJBU0lTLAotICogV0lUSE9VVCBXQVJSQU5USUVTIE9SIENPTkRJVElPTlMgT0YgQU5ZIEtJTkQsIGVpdGhlciBleHByZXNzIG9yIGltcGxpZWQuCi0gKiBTZWUgdGhlIExpY2Vuc2UgZm9yIHRoZSBzcGVjaWZpYyBsYW5ndWFnZSBnb3Zlcm5pbmcgcGVybWlzc2lvbnMgYW5kCi0gKiBsaW1pdGF0aW9ucyB1bmRlciB0aGUgTGljZW5zZS4KLSAqLwotCi0vKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgotICAgSU5DTFVERSBGSUxFUwotKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0KLSNpbmNsdWRlICJWZWN0b3JBcml0aG1ldGljLmgiCi0KLS8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCi0gICBGVU5DVElPTiBTaGlmdF9TYXRfdjE2eHYxNgotKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0KLXZvaWQgU2hpZnRfU2F0X3YxNnh2MTYgKGNvbnN0ICAgTFZNX0lOVDE2ICAgdmFsLAotICAgICAgICAgICAgICAgICAgICAgICAgY29uc3QgICBMVk1fSU5UMTYgICAqc3JjLAotICAgICAgICAgICAgICAgICAgICAgICAgTFZNX0lOVDE2ICAgKmRzdCwKLSAgICAgICAgICAgICAgICAgICAgICAgIExWTV9JTlQxNiAgIG4pCi17Ci0gICAgTFZNX0lOVDMyICAgdGVtcDsKLSAgICBMVk1fSU5UMzIgICBpaTsKLSAgICBMVk1fSU5UMTYgICBSU2hpZnQ7Ci0gICAgaWYodmFsPjApCi0gICAgewotICAgICAgICBmb3IgKGlpID0gbjsgaWkgIT0gMDsgaWktLSkKLSAgICAgICAgewotICAgICAgICAgICAgdGVtcCA9IChMVk1fSU5UMzIpKnNyYzsKLSAgICAgICAgICAgIHNyYysrOwotCi0gICAgICAgICAgICB0ZW1wID0gdGVtcCA8PCB2YWw7Ci0KLSAgICAgICAgICAgIGlmICh0ZW1wID4gMHgwMDAwN0ZGRikKLSAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAqZHN0ID0gMHg3RkZGOwotICAgICAgICAgICAgfQotICAgICAgICAgICAgZWxzZSBpZiAodGVtcCA8IC0weDAwMDA4MDAwKQotICAgICAgICAgICAgewotICAgICAgICAgICAgICAgICpkc3QgPSAtIDB4ODAwMDsKLSAgICAgICAgICAgIH0KLSAgICAgICAgICAgIGVsc2UKLSAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAqZHN0ID0gKExWTV9JTlQxNil0ZW1wOwotICAgICAgICAgICAgfQotICAgICAgICAgICAgZHN0Kys7Ci0gICAgICAgIH0KLSAgICB9Ci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XJzaW9uIDIuMCAodGhlICJMaWNlbnNlIik7Ci0gKiB5b3UgbWF5IG5vdCB1c2UgdGhpcyBmaWxlIGV4Y2VwdCBpbiBjb21wbGlhbmNlIHdpdGggdGhlIExpY2Vuc2UuCi0gKiBZb3UgbWF5IG9idGFpbiBhIGNvcHkgb2YgdGhlIExpY2Vuc2UgYXQKLSAqCi0gKiAgICAgIGh0dHA6Ly93d3cuYXBhY2hlLm9yZy9saWNlbnNlcy9MSUNFTlNFLTIuMAotICoKLSAqIFVubGVzcyByZXF1aXJlZCBieSBhcHBsaWNhYmxlIGxhdyBvciBhZ3JlZWQgdG8gaW4gd3JpdGluZywgc29mdHdhcmUKLSAqIGRpc3RyaWJ1dGVkIHVuZGVyIHRoZSBMaWNlbnNlIGlzIGRpc3RyaWJ1dGVkIG9uIGFuICJBUyBJUyIgQkFTSVMsCi0gKiBXSVRIT1VUIFdBUlJBTlRJRVMgT1IgQ09ORElUSU9OUyBPRiBBTlkgS0lORCwgZWl0aGVyIGV4cHJlc3Mgb3IgaW1wbGllZC4KLSAqIFNlZSB0aGUgTGljZW5zZSBmb3IgdGhlIHNwZWNpZmljIGxhbmd1YWdlIGdvdmVybmluZyBwZXJtaXNzaW9ucyBhbmQKLSAqIGxpbWl0YXRpb25zIHVuZGVyIHRoZSBMaWNlbnNlLgotICovCi0KLS8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCi0gICBJTkNMVURFIEZJTEVTCi0qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLQotI2luY2x1ZGUgIlZlY3RvckFyaXRobWV0aWMuaCIKLQotLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKLSAgIEZVTkNUSU9OIFNoaWZ0X1NhdF92MzJ4djMyCi0qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLQotdm9pZCBTaGlmdF9TYXRfdjMyeHYzMiAoY29uc3QgICBMVk1fSU5UMTYgICB2YWwsCi0gICAgICAgICAgICAgICAgICAgICAgICBjb25zdCAgIExWTV9JTlQzMiAgICpzcmMsCi0gICAgICAgICAgICAgICAgICAgICAgICBMVk1fSU5UMzIgICAqZHN0LAotICAgICAgICAgICAgICAgICAgICAgICAgTFZNX0lOVDE2ICAgbikKLXsKLSAgICBMVk1fSU5UMzIgICBpaTsKLSAgICBMVk1fSU5UMTYgICBSU2hpZnQ7Ci0KLSAgICBpZih2YWw+MCkKLSAgICB7Ci0gICAgICAgIExWTV9JTlQzMiBhLGI7Ci0KLSAgICAgICAgZm9yIChpaSA9IG47IGlpICE9IDA7IGlpLS0pCi0gICAgICAgIHsKLSAgICAgICAgICAgIGE9KnNyYzsKLSAgICAgICAgICAgIHNyYysrOwotCi0gICAgICAgICAgICBiPShhPDx2YWwpOwotCi0gICAgICAgICAgICBpZiggKGI+PnZhbCkgIT0gYSApIC8qIGlmIG92ZXJmbG93IG9jY3VyZWQsIHJpZ2h0IHNoaWZ0IHdpbGwgc2hvdyBkaWZmZXJlbmNlKi8KLSAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICBpZihhPDApCi0gICAgICAgICAgICAgICAgewotICAgICAgICAgICAgICAgICAgICBiPTB4ODAwMDAwMDBsOwotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICBlbHNlCi0gICAgICAgICAgICAgICAgewotICAgICAgICAgICAgICAgICAgICBiPTB4N0ZGRkZGRkZsOwotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgKmRzdCA9IGI7Ci0gICAgICAgICAgICBkc3QrKzsKLSAgICAgICAgfQotICAgI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iAgV2VkIEp1biAxOCAxMToyNzo0NiAyMDA4ICUgKENNL1MpKi8KLS8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotCi0vKiMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjKi8KLS8qICBJbmNsdWRlIGZpbGVzICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyojIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyovCi0KLSNpbmNsdWRlICJTY2FsYXJBcml0aG1ldGljLmgiCi0KLQotLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKLSAqICBOYW1lICAgICAgICA6IGRCX3RvX0xpbjMyKCkKLSAqICBJbnB1dCAgICAgICA6IFNpZ25lZCAxNi1iaXQgaW50ZWdlcgotICogICAgICAgICAgICAgICAgICBNU0IgKDE2KSA9IHNpZ24gYml0Ci0gKiAgICAgICAgICAgICAgICAgICgxNS0+MDUpID0gaW50ZWdlciBwYXJ0Ci0gKiAgICAgICAgICAgICAgICAgICgwNC0+MDEpID0gZGVjaW1hbCBwYXJ0Ci0gKiAgT3V0cHV0ICAgICAgOiBTaWduZWQgMzItYml0IGludGVnZXIKLSAqICAgICAgICAgICAgICAgICAgTVNCICgzMikgPSBzaWduIGJpdAotICogICAgICAgICAgICAgICAgICAoMzEtPjE2KSA9IGludGVnZXIgcGFydAotICogICAgICAgICAgICAgICAgICAoMTUtPjAxKSA9IGRlY2ltYWwgcGFydAotICogIFJldHVybnMgICAgIDogTGluIHZhbHVlIGZvcm1hdCAxLjE2LjE1Ci0gKiAgRGVzY3JpcHRpb24gOgotICogIFJlbWFya3MgICAgIDogIE1ha2VzIGFuIGFwcHJveGltYXRpb24gdG8gdGhlIGNvbnZlcnNpb24gYnkgY291bnRpbmcgdGhlIG51bWJlcgotICogICAgICAgICAgICAgICAgIG9mIDZkQiBzdGVwcyBmb3IgdXNlIGFzIHNoaWZ0cyBhbmQgdGhlbiBpbnRlcnBvbGF0ZXMgd2l0aCBhIHJlbWFpbmRlcgotICogICAgICAgICAgICAgICAgIHdpdGggdGhlIGVxdWF0aW9uOgotICoKLSAqICAgICAgICAgICAgICAgICBDb3JyZWN0aW9uID0gKFJlbWFpbmRlciAvIDEuNTAyOSkgLSAoUmVtYWluZGVyXjIgLyA2KQotICoKLSAqICAgICAgICAgICAgICAgICBUaGUgdHdvIGNvZWZmaWNpZW50cyBhcmUgc2NhbGVkIGZyb20gMHg0MDAwMDAwMCBpbiA5NiBzdGVwcyBhbmQgY2FsY3VsYXRlZAotICogICAgICAgICAgICAgICAgIGFzIGZvbGxvd3M6Ci0gKgotICogICAgICAgICAgICAgICAgIEZJUlNUX0NPRUYgID0gMHg4MDAwMDAwMCAvICg5NiAqIDEuNTAyOSkKLSAqICAgICAgICAgICAgICAgICBTRUNPTkRfQ09FRiA9IDB4ODAwMDAwMDAgLyAoOTZeMiAqIDYpCi0gKgotICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0KLSNkZWZpbmUgRk9VUl9PVkVSX1NJWCAgICAyMTg0NiAgICAgICAgICAgICAgICAgIC8qICg0IC8gNikgKiAyXjE1ICovCi0jZGVmaW5lIFNJWF9EQiAgICAgICAgICAgOTYgICAgICAgICAgICAgICAgICAgICAvKiA2ICogMTYgb3IgNmRCIGluIFExMS40IGZvcm1hdCAqLwotI2RlZmluZSBGSVJTVF9DT0VGX05FRyAgIDE0ODg0MzA1Ci0jZGVmaW5lIEZJUlNUX0NPRUZfUE9TICAgNzQ0MjE1MiAgICAgICAgICAgICAgICAvKiBGSVJTVF9DT0VGX05FRyAvIDIgKi8KLSNkZWZpbmUgU0VDT05EX0NPRUYgICAgICAzODgzNgotI2RlZmluZSBNQVhfVkFMVUUgICAgICAgIDE1MzYgICAgICAgICAgICAgICAgICAgLyogOTYgKiAxNiAqLwotCi1MVk1fSU5UMzIgICBkQl90b19MaW4zMihMVk1fSU5UMTYgICAgZGJfZml4KQotewotICAgIExWTV9JTlQzMiBMaW5fdmFsXzMyOwotICAgIExWTV9JTlQxNiBTaGlmdDsKLSAgICBMVk1fSU5UMzIgUmVtYWluOwotCi0KLSAgICAvKgotICAgICAqIENoZWNrIHNpZ24gb2YgdGhlIGlucHV0Ci0gICAgICovCi0gICAgaWYgKGRiX2ZpeDwwKQotICAgIHsKLSAgICAgICAgaWYgKGRiX2ZpeCA+IC1NQVhfVkFMVUUpCi0gICAgICAgIHsKLSAgICAgICAgICAgIFNoaWZ0ICA9IChMVk1fSU5UMTYpKCgoKExWTV9VSU5UMzIpKC1kYl9maXgpID4+IDQpICogRk9VUl9PVkVSX1NJWCkgPj4gMTcpOyAgICAgICAgLyogTnVtYmVyIG9mIDZkQiBzdGVwcyBpbiBRMTEuNCBmb3JtYXQgKi8KLSAgICAgICAgICAgIFJlbWFpbiA9IC1kYl9maXggLSAoU2hpZnQgKiBTSVhfREIpOwotICAgICAgICAgICAgUmVtYWluID0gKDB4N0ZGRkZGRkYgLSAoUmVtYWluICogRklSU1RfQ09FRl9ORUcpKSArIChSZW1haW4gKiBSZW1haW4gKiBTRUNPTkRfQ09FRik7Ci0gICAgICAgICAgICBMaW5fdmFsXzMyID0gKExWTV9JTlQz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qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCi0gICBJTkNMVURFIEZJTEVTCi0qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLQotI2luY2x1ZGUgIlZlY3RvckFyaXRobWV0aWMuaCIKLQotLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKLSAgIEZVTkNUSU9OIE1VTFQzU18xNlgxNgotKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0KLXZvaWQgTXVsdDNzXzE2eDE2KCBjb25zdCBMVk1fSU5UMTYgKnNyYywKLSAgICAgICAgICAgICAgICAgIGNvbnN0IExWTV9JTlQxNiB2YWwsCi0gICAgICAgICAgICAgICAgICBMVk1fSU5UMTYgKmRzdCwKLSAgICAgICAgICAgICAgICAgIExWTV9JTlQxNiBuKQotewotICAgIExWTV9JTlQxNiBpaTsKLSAgICBMVk1fSU5UMzIgdGVtcDsKLQotICAgIGZvciAoaWkgPSBuOyBpaSAhPSAwOyBpaS0tKQotICAgIHsKLSAgICAgICAgdGVtcCA9IChMVk1fSU5UMzIpKCpzcmMpICogKExWTV9JTlQzMil2YWw7Ci0gICAgICAgIHNyYysrOwotCi0gICAgICAgICpkc3QgPSAoTFZNX0lOVDE2KSh0ZW1wID4+IDE1KTsKLSAgICAgICAgZHN0Kys7Ci0gICAgfQotCi0gICAgcmV0dXJuOwotfQotCi0vKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KZGlmZiAtLWdpdCBhL21lZGlhL2xpYmVmZmVjdHMvbHZt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ZXJuaW5nIHBlcm1pc3Npb25zIGFuZAotICogbGltaXRhdGlvbnMgdW5kZXIgdGhlIExpY2Vuc2UuCi0gKi8KLQotLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0vKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICBIZWFkZXIgZmlsZSBmb3IgdGhlIGFwcGxpY2F0aW9uIGxheWVyIGludGVyZmFjZSBvZiB0aGUgTi1CYW5kIGVxdWFsaXNlci4gICAgICAgICAgICAqLwotLyogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgVGhpcyBmaWxlcyBpbmNsdWRlcyBhbGwgZGVmaW5pdGlvbnMsIHR5cGVzLCBzdHJ1Y3R1cmVzIGFuZCBmdW5jdGlvbiAgICAgICAgICAgICAgICAgKi8KLS8qICBwcm90b3R5cGVzIHJlcXVpcmVkIGJ5IHRoZSBjYWxsaW5nIGxheWVyLiBBbGwgb3RoZXIgdHlwZXMsIHN0cnVjdHVyZXMgYW5kICAgICAgICAgICAqLwotLyogIGZ1bmN0aW9ucyBhcmUgcHJpdmF0ZS4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotLyogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgTm90ZTogMSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICA9PT09PT09ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogIFRoZSBhbGdvcml0aG0gY2FuIGV4ZWN1dGUgZWl0aGVyIHdpdGggc2VwYXJhdGUgaW5wdXQgYW5kIG91dHB1dCBidWZmZXJzIG9yIHdpdGggICAgICovCi0vKiAgYSBjb21tb24gYnVmZmVyLCBpLmUuIHRoZSBkYXRhIGlzIHByb2Nlc3NlZCBpbi1wbGFjZS4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0vKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICBOb3RlOiAyICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogID09PT09PT0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgVHdvIGRhdGEgZm9ybWF0cyBhcmUgc3VwcG9ydCBTdGVyZW8gYW5kIE1vbm8tSW4tU3RlcmVvLiBUaGUgZGF0YSBpcyBpbnRlcmxlYXZlZCBhcyAgKi8KLS8qICBmb2xsb3dzOiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogICAgICAgICAgICAgIEJ5dGUgT2Zmc2V0ICAgICAgICAgU3RlcmVvIElucHV0ICAgICAgICAgTW9uby1Jbi1TdGVyZW8gSW5wdXQgICAgICAgICAgICovCi0vKiAgICAgICAgICAgICAgPT09PT09PT09PT0gICAgICAgICA9PT09PT09PT09PT0gICAgICAgICA9PT09PT09PT09PT09PT09PT09PSAgICAgICAgICAgKi8KLS8qICAgICAgICAgICAgICAgICAgMCAgICAgICAgICAgICAgIExlZnQgU2FtcGxlICMxICAgICAgICAgIE1vbm8gU2FtcGxlICMxICAgICAgICAgICAgICAqLwotLyogICAgICAgICAgICAgICAgICAyICAgICAgICAgICAgICAgUmlnaHQgU2FtcGxlICMxICAgICAgICAgTW9ubyBTYW1wbGUgIzEgICAgICAgICAgICAgICovCi0vKiAgICAgICAgICAgICAgICAgIDQgICAgICAgICAgICAgICBMZWZ0IFNhbXBsZSAjMiAgICAgICAgICBNb25vIFNhbXBsZSAjMiAgICAgICAgICAgICAgKi8KLS8qICAgICAgICAgICAgICAgICAgNiAgICAgICAgICAgICAgIFJpZ2h0IFNhbXBsZSAjMiAgICAgICAgIE1vbm8gU2FtcGxlICMyICAgICAgICAgICAgICAqLwotLyogICAgICAgICAgICAgICAgICAuICAgICAgICAgICAgICAgICAgICAgIC4gICAgICAgICAgICAgICAgICAgICAuICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgICAgICAgICAgICAgICAgIC4gICAgICAgICAgICAgICAgICAgICAgLiAgICAgICAgICAgICAgICAgICAgIC4gICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogIE1vbm8gZm9ybWF0IGRhdGEgaXMgbm90IHN1cHBvcnRlZCwgdGhlIGNhbGxpbmcgcm91dGluZSBtdXN0IGNvbnZlcnQgYSBNb25vIHN0cmVhbSAgICovCi0vKiAgaW4gdG8gTW9uby1Jbi1TdGVyZW8gZm9ybWF0LiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0vKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICBOb3RlOiAzICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogID09PT09PT0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgVGhlIGZvcm1hdCBvZiB0aGUgZGF0YSBpbiB0aGUgZmlsdGVyIGJhbmQgZGVmaW5pdGlvbiBzdHJ1Y3R1cmUgaXMgYXMgZm9sbG93czogICAgICAgKi8KLS8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogICAgICBHYWluICAgICAgICBpcyBpbiBpbnRlZ2VyIGRCLCByYW5nZSAtMTVkQiB0byArMTVkQiBpbmNsdXNpdmUgICAgICAgICAgICAgICAgICAgICovCi0vKiAgICAgIEZyZXF1ZW5jeSAgIGlzIHRoZSBjZW50cmUgZnJlcXVlbmN5IGluIEh6LCByYW5nZSBEQyB0byBOeXF1aXN0ICAgICAgICAgICAgICAgICAgKi8KLS8qICAgICAgUUZhY3RvciAgICAgaXMgdGhlIFEgbXVsdGlwbGllZCBieSAxMDAsIHJhbmdlIDAuMjUgKDI1KSB0byAxMiAoMTIwMCkgICAgICAgICAgICAqLwotLyogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgRXhhbXBsZTogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICAgICAgR2FpbiA9IDcgICAgICAgICAgICA3ZEIgZ2FpbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogICAgICBGcmVxdWVuY3kgPSAyNDY3ICAgIENlbnRyZSBmcmVxdWVuY3kgPSAyLjQ2N2tIeiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgICAgIFFGYWN0b3IgPSAxMDg5ICAgICAgUSA9IDEwLjg5ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogIFRoZSBlcXVhbGlzZXIgZmlsdGVycyBhcmUgcGFzc2VkIGFzIGEgcG9pbnRlciB0byBhbmQgYXJyYXkgb2YgZmlsdGVyIGJhbmQgICAgICAgICAgICovCi0vKiAgZGVmaW5pdGlvbnMgc3RydWN0dXJlcy4gVGhlcmUgbXVzdCBiZSBvbmUgZmlsdGVyIGRlZmluaXRpb24gZm9yIGVhY2ggYmFuZC4gICAgICAgICAgKi8KLS8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0KLQotI2lmbmRlZiBfX0xWRVFOQl9IX18KLSNkZWZpbmUgX19MVkVRTkJfSF9fCi0KLSNpZmRlZiBfX2NwbHVzcGx1cwotZXh0ZXJuICJDIiB7Ci0jZW5kaWYgLyogX19jcGx1c3BsdXMgKi8KLQotCi0vKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLS8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogIEluY2x1ZGVzICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotCi0jaW5jbHVkZSAiTFZNX1R5cGVzLmgiCi0jaW5jbHVkZSAiTFZNX0NvbW1vbi5oIgotCi0vKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLS8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogIERlZmluaXRpb25zICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotCi0vKiBNZW1vcnkgdGFibGUgKi8KLSNkZWZpbmUgTFZFUU5CX01FTVJFR0lPTl9JTlNUQU5DRSAgICAgICAgICAwICAgLyogT2Zmc2V0IHRvIHRoZSBpbnN0YW5jZSBtZW1vcnkgcmVnaW9uICovCi0jZGVmaW5lIExWRVFOQl9NRU1SRUdJT05fUEVSU0lTVEVOVF9EQVRBICAgMSAgIC8qIE9mZnNldCB0byBwZXJzaXN0ZW50IGRhdGEgbWVtb3J5IHJlZ2lvbiAqLwotI2RlZmluZSBMVkVRTkJfTUVNUkVHSU9OX1BFUlNJU1RFTlRfQ09FRiAgIDIgICAvKiBPZmZzZXQgdG8gcGVyc2lzdGVudCBjb2VmZmljaWVudCByZWdpb24gKi8KLSNkZWZpbmUgTFZFUU5CX01FTVJFR0lPTl9TQ1JBVENIICAgICAgICAgICAzICAgLyogT2Zmc2V0IHRvIGRhdGEgc2NyYXRjaCBtZW1vcnkgcmVnaW9uICovCi0jZGVmaW5lIExWRVFOQl9OUl9NRU1PUllfUkVHSU9OUyAgICAgICAgICAgNCAgIC8qIE51bWJlciBvZiBtZW1vcnkgcmVnaW9ucyAqLwotCi0vKiBDYWxsYmFjayBldmVudHMgKi8KLSNkZWZpbmUgTFZFUU5CX0VWRU5UX05PTkUgICAgICAgICAgICAgICAgICAgMHgwMDAwICAgIC8qIE5vdCBhIHZhbGlkIGV2ZW50ICovCi0jZGVmaW5lIExWRVFOQl9FVkVOVF9BTEdPRkYgICAgICAgICAgICAgICAgIDB4MDAwMSAgICAvKiBFUU5CIGhhcyBjb21wbGV0ZWQgc3dpdGNoIG9mZiAqLwotCi0vKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLS8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogIFR5cGVzICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotCi0vKiBJbnN0YW5jZSBoYW5kbGUgKi8KLXR5cGVkZWYgdm9pZCAqTFZFUU5CX0hhbmRsZV90OwotCi0KLS8qIE9wZXJhdGluZyBtb2RlcyAqLwotdHlwZWRlZiBlbnVtCi17Ci0gICAgTFZFUU5CX0JZUEFTUyAgID0gMCwKLSAgICBMVkVRTkJfT04gICAgICAgPSAxLAotICAgIExWRVFOQl9NT0RFX01BWCA9IExWTV9NQVhJTlRfMzIKLX0gTFZFUU5CX01vZGVfZW47Ci0KLQotLyogRmlsdGVyIG1vZGUgY29udHJvbCAqLwotdHlwZWRlZiBlbnVtCi17Ci0gICAgTFZFUU5CX0ZJTFRFUl9PRkYgICA9IDAsCi0gICAgTFZFUU5CX0ZJTFRFUl9PTiAgICA9IDEsCi0gICAgTFZFUU5CX0ZJTFRFUl9EVU1NWSA9IExWTV9NQVhJTlRfMzIKLX0gTFZFUU5CX0ZpbHRlck1vZGVfZW47Ci0KLQotLyogTWVtb3J5IFR5cGVzICovCi10eXBlZGVmIGVudW0KLXsKLSAgICBMVkVRTkJfUEVSU0lTVEVOVCAgICAgID0gMCwKLSAgICBMVkVRTkJfUEVSU0lTVEVOVF9EQVRBID0gMSwKLSAgICBMVkVRTkJfUEVSU0lTVEVOVF9DT0VGID0gMiwKLSAgICBMVkVRTkJfU0NSQVRDSCAgICAgICAgID0gMywKLSAgICBMVkVRTkJfTUVNT1JZX01BWCAgICAgID0gTFZNX01BWElOVF8zMgotfSBMVkVRTkJfTWVtb3J5VHlwZXNfZW47Ci0KLQotLyogRnVuY3Rpb24gcmV0dXJuIHN0YXR1cyAqLwotdHlwZWRlZiBlbnVtCi17Ci0gICAgTFZFUU5CX1NVQ0NFU1MgICAgICAgID0gMCwgICAgICAgICAgICAgICAgICAgICAgICAgIC8qIFN1Y2Nlc3NmdWwgcmV0dXJuIGZyb20gYSByb3V0aW5lICovCi0gICAgTFZFUU5CX0FMSUdOTUVOVEVSUk9SID0gMSwgICAgICAgICAgICAgICAgICAgICAgICAgIC8qIE1lbW9yeSBhbGlnbm1lbnQgZXJyb3IgKi8KLSAgICBMVkVRTkJfTlVMTEFERFJFU1MgICAgPSAyLCAgICAgICAgICAgICAgICAgICAgICAgICAgLyogTlVMTCBhbGxvY2F0aW9uIGFkZHJlc3MgKi8KLSAgICBMVkVRTkJfVE9PTUFOWVNBTVBMRVMgPSAzLCAgICAgICAgICAgICAgICAgICAgICAgICAgLyogTWF4aW11bSBibG9jayBzaXplIGV4Y2VlZGVkICovCi0gICAgTFZFUU5CX1NUQVRVU19NQVggICAgID0gTFZNX01BWElOVF8zMgotfSBMVkVRTkJfUmV0dXJuU3RhdHVzX2VuOwotCi0KLS8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotLyogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgTGlua2VkIGVudW1lcmF0ZWQgdHlwZSBhbmQgY2FwYWJpbGl0eSBkZWZpbml0aW9ucyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogIFRoZSBjYXBhYmlsaXR5IGRlZmluaXRpb25zIGFyZSB1c2VkIHRvIGRlZmluZSB0aGUgcmVxdWlyZWQgY2FwYWJpbGl0aWVzIGF0ICAgICAgICAgICovCi0vKiAgaW5pdGlhbGlzYXRpb24sIHRoZXNlIGFyZSBhZGRlZCB0b2dldGhlciB0byBnaXZlIHRoZSBjYXBhYmlsaXR5IHdvcmQuIFRoZSAgICAgICAgICAgKi8KLS8qICBlbnVtZXJhdGVkIHR5cGUgaXMgdXNlZCB0byBzZWxlY3QgdGhlIG1vZGUgdGhyb3VnaCBhIGNvbnRyb2wgZnVuY3Rpb24gYXQgcnVuIHRpbWUuICAqLwotLyogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgVGhlIGNhcGFiaWxpdHkgZGVmaW5pdGlvbiBpcyByZWxhdGVkIHRvIHRoZSBlbnVtZXJhdGVkIHR5cGUgdmFsdWUgYnkgdGhlIGVxdWF0aW9uOiAgKi8KLS8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogICAgICAgICAgQ2FwYWJpbGl0eV92YWx1ZSA9IDJeRW51bWVyYXRlZF92YWx1ZSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICBGb3IgZXhhbXBsZSwgYSBtb2R1bGUgY291bGQgYmUgY29uZmlndXJkIGF0IGluaXRpYWxpc2F0aW9uIHRvIHN1cHBvcnQgdHdvIHNhbXBsZSAgICAqLwotLyogIHJhdGVzIG9ubHkgYnkgY2FsbGluZyB0aGUgaW5pdCBmdW5jdGlvbiB3aXRoIHRoZSB2YWx1ZTogICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgICAgIENhcGFiaWxpdGllcy5TYW1wbGVSYXRlID0gTFZFUU5CX0NBUF8zMjAwMCArIExWRVFOQl9DQVBfNDQxMDA7ICAgICAgICAgICAgICAgICAgKi8KLS8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogIGFuZCBhdCBydW4gdGltZSBpdCB3b3VsZCBiZSBwYXNzZWQgdGhlIHZhbHVlIExWRVFOQl9GU18zMjAwMCB0aHJvdWdoIHRoZSBjb250cm9sICAgICovCi0vKiAgZnVuY3Rpb24gdG8gc2VsZWN0IG9wZXJhdGlvbiBhdCAzMmtIeiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0KLS8qCi0gKiBTdXBwb3J0ZWQgc291cmN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i0gICAgTFZFUU5CX0ZTXzE2MDAwID0gMywKLSAgICBMVkVRTkJfRlNfMjIwNTAgPSA0LAotICAgIExWRVFOQl9GU18yNDAwMCA9IDUsCi0gICAgTFZFUU5CX0ZTXzMyMDAwID0gNiwKLSAgICBMVkVRTkJfRlNfNDQxMDAgPSA3LAotICAgIExWRVFOQl9GU180ODAwMCA9IDgsCi0gICAgTFZFUU5CX0ZTX01BWCAgID0gTFZNX01BWElOVF8zMgotfSBMVkVRTkJfRnNfZW47Ci0KLQotLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0vKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICBTdHJ1Y3R1cmVzICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLQotLyogTWVtb3J5IHJlZ2lvbiBkZWZpbml0aW9uICovCi10eXBlZGVmIHN0cnVjdAotewotICAgIExWTV9VSU5UMzIgICAgICAgICAgICAgICAgICBTaXplOyAgICAgICAgICAgICAgICAgICAvKiBSZWdpb24gc2l6ZSBpbiBieXRlcyAqLwotICAgIExWTV9VSU5UMTYgICAgICAgICAgICAgICAgICBBbGlnbm1lbnQ7ICAgICAgICAgICAgICAvKiBSZWdpb24gYWxpZ25tZW50IGluIGJ5dGVzICovCi0gICAgTFZFUU5CX01lbW9yeVR5cGVzX2VuICAgICAgIFR5cGU7ICAgICAgICAgICAgICAgICAgIC8qIFJlZ2lvbiB0eXBlICovCi0gICAgdm9pZCAgICAgICAgICAgICAgICAgICAgICAgICpwQmFzZUFkZHJlc3M7ICAgICAgICAgIC8qIFBvaW50ZXIgdG8gdGhlIHJlZ2lvbiBiYXNlIGFkZHJlc3MgKi8KLX0gTFZFUU5CX01lbW9yeVJlZ2lvbl90OwotCi0KLS8qIE1lbW9yeSB0YWJsZSBjb250YWluaW5nIHRoZSByZWdpb24gZGVmaW5pdGlvbnMgKi8KLXR5cGVkZWYgc3RydWN0Ci17Ci0gICAgTFZFUU5CX01lbW9yeVJlZ2lvbl90ICAgICAgIFJlZ2lvbltMVkVRTkJfTlJfTUVNT1JZX1JFR0lPTlNdOyAgLyogT25lIGRlZmluaXRpb24gZm9yIGVhY2ggcmVnaW9uICovCi19IExWRVFOQl9NZW1UYWJfdDsKLQotCi0vKiBFcXVhbGlzZXIgYmFuZCBkZWZpbml0aW9uICovCi10eXBlZGVmIHN0cnVjdAotewotICAgIExWTV9JTlQxNiAgICAgICAgICAgICAgICAgICBHYWluOyAgICAgICAgICAgICAgICAgICAvKiBCYW5kIGdhaW4gaW4gZEIgKi8KLSAgICBMVk1fVUlOVDE2ICAgICAgICAgICAgICAgICAgRnJlcXVlbmN5OyAgICAgICAgICAgICAgLyogQmFuZCBjZW50cmUgZnJlcXVlbmN5IGluIEh6ICovCi0gICAgTFZNX1VJTlQxNiAgICAgICAgICAgICAgICAgIFFGYWN0b3I7ICAgICAgICAgICAgICAgIC8qIEJhbmQgcXVhbGl0eSBmYWN0b3IgKi8KLX0gTFZFUU5CX0JhbmREZWZfdDsKLQotCi0vKiBQYXJhbWV0ZXIgc3RydWN0dXJlICovCi10eXBlZGVmIHN0cnVjdAotewotICAgIC8qIEdlbmVyYWwgcGFyYW1ldGVycyAqLwotICAgIExWRVFOQl9Nb2RlX2VuICAgICAgICAgICAgICBPcGVyYXRpbmdNb2RlOwotICAgIExW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ioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0vKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICBGdW5jdGlvbiBQcm90b3R5cGVzICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLQotLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0vKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qIEZVTkNUSU9OOiAgICAgICAgICAgICAgICBMVkVRTkJfTWVtb3J5ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiBERVNDUklQVElPTjogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICBUaGlzIGZ1bmN0aW9uIGlzIHVzZWQgZm9yIG1lbW9yeSBhbGxvY2F0aW9uIGFuZCBmcmVlLiBJdCBjYW4gYmUgY2FsbGVkIGluICAgICAgICAgICAqLwotLyogIHR3byB3YXlzOiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICAgICAgaEluc3RhbmNlID0gTlVMTCAgICAgICAgICAgICAgICBSZXR1cm5zIHRoZSBtZW1vcnkgcmVxdWlyZW1lbnRzICAgICAgICAgICAgICAgICAqLwotLyogICAgICBoSW5zdGFuY2UgPSBJbnN0YW5jZSBoYW5kbGUgICAgIFJldHVybnMgdGhlIG1lbW9yeSByZXF1aXJlbWVudHMgYW5kICAgICAgICAgICAgICovCi0vKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYWxsb2NhdGVkIGJhc2UgYWRkcmVzc2VzIGZvciB0aGUgaW5zdGFuY2UgICAgICAgKi8KLS8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogIFdoZW4gdGhpcyBmdW5jdGlvbiBpcyBjYWxsZWQgZm9yIG1lbW9yeSBhbGxvY2F0aW9uIChoSW5zdGFuY2U9TlVMTCkgdGhlIG1lbW9yeSAgICAgICovCi0vKiAgYmFzZSBhZGRyZXNzIHBvaW50ZXJzIGFyZSBOVUxMIG9uIHJldHVybi4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogIFdoZW4gdGhlIGZ1bmN0aW9uIGlzIGNhbGxlZCBmb3IgZnJlZSAoaEluc3RhbmNlID0gSW5zdGFuY2UgSGFuZGxlKSB0aGUgbWVtb3J5ICAgICAgICovCi0vKiAgdGFibGUgcmV0dXJucyB0aGUgYWxsb2NhdGVkIG1lbW9yeSBhbmQgYmFzZSBhZGRyZXNzZXMgdXNlZCBkdXJpbmcgaW5pdGlhbGlzYXRpb24uICAgKi8KLS8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogUEFSQU1FVEVSUzogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgaEluc3RhbmNlICAgICAgICAgICAgICAgSW5zdGFuY2UgSGFuZGxlICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICBwTWVtb3J5VGFibGUgICAgICAgICAgICBQb2ludGVyIHRvIGFuIGVtcHR5IG1lbW9yeSBkZWZpbml0aW9uIHRhYmxlICAgICAgICAgICAgICAgICAqLwotLyogIHBDYXBhYmlsaXRpZXMgICAgICAgICAgIFBvaW50ZXIgdG8gdGhlIGRlZmF1bHQgY2FwYWJpbGl0aWVzICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qIFJFVFVSTlM6ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogIExWRVFOQl9TVUNDRVNTICAgICAgICAgIFN1Y2NlZWRlZCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgTFZFUU5CX05VTExBRERSRVNTICAgICAgV2hlbiBhbnkgb2YgcE1lbW9yeVRhYmxlIGFuZCBwQ2FwYWJpbGl0aWVzIGlzIE5VTEwgYWRkcmVzcyAgKi8KLS8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogTk9URVM6ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgMS4gIFRoaXMgZnVuY3Rpb24gbWF5IGJlIGludGVycnVwdGVkIGJ5IHRoZSBMVkVRTkJfUHJvY2VzcyBmdW5jdGlvbiAgICAgICAgICAgICAgICAgKi8KLS8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0KLUxWRVFOQl9SZXR1cm5TdGF0dXNfZW4gTFZFUU5CX01lbW9yeShMVkVRTkJfSGFuZGxlX3QgICAgICAgICAgICBoSW5zdGFuY2UsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTFZFUU5CX01lbVRhYl90ICAgICAgICAgICAgKnBNZW1vcnlUYWJsZSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBMVkVRTkJfQ2FwYWJpbGl0aWVzX3QgICAgICAqcENhcGFiaWxpdGllcyk7Ci0KLQotLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0vKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qIEZVTkNUSU9OOiAgICAgICAgICAgICAgICBMVkVRTkJfSW5pdCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiBERVNDUklQVElPTjogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICBDcmVhdGUgYW5kIGluaXRpYWxpc2F0aW9uIGZ1bmN0aW9uIGZvciB0aGUgTi1CYW5kIGVxdWFsbGlzZXIgbW9kdWxlICAgICAgICAgICAgICAgICAqLwotLyogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgVGhpcyBmdW5jdGlvbiBjYW4gYmUgdXNlZCB0byBjcmVhdGUgYW4gYWxnb3JpdGhtIGluc3RhbmNlIGJ5IGNhbGxpbmcgd2l0aCAgICAgICAgICAgKi8KLS8qICBoSW5zdGFuY2Ugc2V0IHRvIE5VTEwuIEluIHRoaXMgY2FzZSB0aGUgYWxnb3JpdGhtIHJldHVybnMgdGhlIG5ldyBpbnN0YW5jZSAgICAgICAgICAqLwotLyogIGhhbmRsZS4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICBUaGlzIGZ1bmN0aW9uIGNhbiBiZSB1c2VkIHRvIGZvcmNlIGEgZnVsbCByZS1pbml0aWFsaXNhdGlvbiBvZiB0aGUgYWxnb3JpdGhtICAgICAgICAqLwotLyogIGJ5IGNhbGxpbmcgd2l0aCBoSW5zdGFuY2UgPSBJbnN0YW5jZSBIYW5kbGUuIEluIHRoaXMgY2FzZSB0aGUgbWVtb3J5IHRhYmxlICAgICAgICAgICovCi0vKiAgc2hvdWxkIGJlIGNvcnJlY3QgZm9yIHRoZSBpbnN0YW5jZSwgdGhpcyBjYW4gYmUgZW5zdXJlZCBieSBjYWxsaW5nIHRoZSBmdW5jdGlvbiAgICAgKi8KLS8qICBMVkVRTkJfTWVtb3J5IGJlZm9yZSBjYWxsaW5nIHRoaXMgZnVuY3Rpb24uICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiBQQVJBTUVURVJTOiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICBoSW5zdGFuY2UgICAgICAgICAgICAgICBJbnN0YW5jZSBoYW5kbGUgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogIHBNZW1vcnlUYWJsZSAgICAgICAgICAgIFBvaW50ZXIgdG8gdGhlIG1lbW9yeSBkZWZpbml0aW9uIHRhYmxlICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgcENhcGFiaWxpdGllcyAgICAgICAgICAgUG9pbnRlciB0byB0aGUgaW5pdGlhbGlzYXRpb24gY2FwYWJpbGl0aWVzICAgICAgICAgICAgICAgICAgKi8KLS8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogUkVUVVJOUzogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgTFZFUU5CX1NVQ0NFU1MgICAgICAgICAgSW5pdGlhbGlzYXRpb24gc3VjY2VlZGVkICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICBMVkVRTkJfTlVMTEFERFJFU1MgICAgICAgIFdoZW4gcENhcGFiaWxpdGllcyBvciBwTWVtb3J5VGFibGVpcyBvciBwaEluc3RhbmNlIGFyZSBOVUxMICovCi0vKiAgTFZFUU5CX05VTExBRERSRVNTICAgICAgICBPbmUgb3IgbW9yZSBvZiB0aGUgbWVtb3J5IHJlZ2lvbnMgaGFzIGEgTlVMTCBiYXNlIGFkZHJlc3MgICAqLwotLyogICAgICAgICAgICAgICAgICAgICAgICAgIHBvaW50ZXIgZm9yIGEgbWVtb3J5IHJlZ2lvbiB3aXRoIGEgbm9uLXplcm8gc2l6ZS4gICAgICAgICAgICovCi0vKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogTk9URVM6ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgMS4gIFRoZSBpbnN0YW5jZSBoYW5kbGUgaXMgdGhlIHBvaW50ZXIgdG8gdGhlIGJhc2UgYWRkcmVzcyBvZiB0aGUgZmlyc3QgbWVtb3J5ICAgICAgKi8KLS8qICAgICAgcmVnaW9uLiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogIDIuICBUaGlzIGZ1bmN0aW9uIG11c3Qgbm90IGJlIGludGVycnVwdGVkIGJ5IHRoZSBMVkVRTkJfUHJvY2VzcyBmdW5jdGlvbiAgICAgICAgICAgICovCi0vKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotCi1MVkVRTkJfUmV0dXJuU3RhdHVzX2VuIExWRVFOQl9Jbml0KExWRVFOQl9IYW5kbGVfdCAgICAgICAgICAqcGhJbnN0YW5jZSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTFZFUU5CX01lbVRhYl90ICAgICAgICAgICpwTWVtb3J5VGFibGUsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIExWRVFOQl9DYXBhYmlsaXRpZXNfdCAgICAqcENhcGFiaWxpdGllcyk7Ci0KLQotLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0vKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qIEZVTkNUSU9OOiAgICAgICAgICAgICAgICAgTFZFUU5CX0dldFBhcmFtZXRlcnMgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiBERVNDUklQVElPTjogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICBSZXF1ZXN0IHRoZSBlcXVhbGlzZXIgbW9kdWxlIHBhcmFtZXRlcnMuIFRoZSBjdXJyZW50IHBhcmFtZXRlciBzZXQgaXMgcmV0dXJuZWQgICAgICAqLwotLyogIHZpYSB0aGUgcGFyYW1ldGVyIHBvaW50ZXIuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qIFBBUkFNRVRFUlM6ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogIGhJbnN0YW5jZSAgICAgICAgICAgICAgICBJbnN0YW5jZSBoYW5kbGUgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgcFBhcmFtcyAgICAgICAgICAgICAgICAgIFBvaW50ZXIgdG8gYW4gZW1wdHkgcGFyYW1ldGVyIHN0cnVjdHVyZSAgICAgICAgICAgICAgICAgICAgKi8KLS8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogUkVUVVJOUzogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgTFZFUU5CX1NVQ0NFU1MgICAgICAgICAgIFN1Y2NlZWRzICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICBMVkVRTkJfTlVMTEFERFJFU1MgICAgICAgSW5zdGFuY2Ugb3IgcFBhcmFtcyAgaXMgTlVMTCBwb2ludGVyICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiBOT1RFUzogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICAxLiAgVGhpcyBmdW5jdGlvbiBtYXkgYmUgaW50ZXJydXB0ZWQgYnkgdGhlIExWRVFOQl9Qcm9jZXNzIGZ1bmN0aW9uICAgICAgICAgICAgICAgICAqLwotLyogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLQotTFZFUU5CX1JldHVyblN0YXR1c19lbiBMVkVRTkJfR2V0UGFyYW1ldGVycyhMVkVRTkJfSGFuZGxlX3QgICAgIGhJbnN0YW5jZSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTFZFUU5CX1BhcmFtc190ICAgICAqcFBhcmFtcyk7Ci0KLQotLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0vKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qIEZVTkNUSU9OOiAgICAgICAgICAgICAgICAgTFZFUU5CX0dldENhcGFiaWxpdGllcyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiBERVNDUklQVElPTjogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICBSZXF1ZXN0IHRoZSBlcXVhbGlzZXIgbW9kdWxlIGNhcGFiaWxpdGllcy4gVGhlIGNhcGFiaWxpdGllcyBzZXQgaXMgcmV0dXJuZWQgICAgICAgICAqLwotLyogIHZpYSB0aGUgcG9pbnRlci4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qIFBBUkFNRVRFUlM6ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogIGhJbnN0YW5jZSAgICAgICAgICAgICAgICBJbnN0YW5jZSBoYW5kbGUgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgcENhcGFiaWxpdGllcyAgICAgICAgICAgIFBvaW50ZXIgdG8gYW4gZW1wdHkgY2FwYWJpbGl0eSBzdHJ1Y3R1cmUgICAgICAgICAgICAgICAgICAgKi8KLS8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogUkVUVVJOUzogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgTFZFUU5CX1NVQ0NFU1MgICAgICAgICAgIFN1Y2NlZWRzICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICBMVkVRTkJfTlVMTEFERFJFU1MgICAgICAgaEluc3RhbmNlIG9yIHBDYXBhYmlsaXRpZXMgaXMgTlVMTCAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiBOT1RFUzogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICAxLiAgVGhpcyBmdW5jdGlvbiBtYXkgYmUgaW50ZXJydXB0ZWQgYnkgdGhlIExWRVFOQl9Qcm9jZXNzIGZ1bmN0aW9uICAgICAgICAgICAgICAgICAqLwotLyogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLQotTFZFUU5CX1JldHVyblN0YXR1c19lbiBMVkVRTkJfR2V0Q2FwYWJpbGl0aWVzKExWRVFOQl9IYW5kbGVfdCAgICAgICAgICAgaEluc3RhbmNlLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIExWRVFOQl9DYXBhYmlsaXRpZXNfdCAgICAgKnBDYXBhYmlsaXRpZXMpOwotCi0KLS8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotLyogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiBGVU5DVElPTjogICAgICAgICAgICAgICAgTFZFUU5CX0NvbnRyb2wgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogREVTQ1JJUFRJT046ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgU2V0cyBvciBjaGFuZ2VzIHRoZSBlcXVhbGlzZXIgbW9kdWxlIHBhcmFtZXRlcnMuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogUEFSQU1FVEVSUzogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgaEluc3RhbmNlICAgICAgICAgICAgICAgSW5zdGFuY2UgaGFuZGxlICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICBwUGFyYW1zICAgICAgICAgICAgICAgICBQb2ludGVyIHRvIGEgcGFyYW1ldGVyIHN0cnVjdHVyZSAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiBSRVRVUk5TOiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICBMVkVRTkJfU1VDQ0VTUyAgICAgICAgICBTdWNjZWVkZWQgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogIExWRVFOQl9OVUxMQUREUkVTUyAgICAgIEluc3RhbmNlIG9yIHBQYXJhbXMgIGlzIE5VTEwgcG9pbnRlciAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgTFZFUU5CX05VTExBRERSRVNTICAgICAgTlVMTCBhZGRyZXNzIGZvciB0aGUgZXF1YWxpc2VyIGZpbHRlciBkZWZpbml0aW9ucyBhbmQgdGhlICAgKi8KLS8qICAgICAgICAgICAgICAgICAgICAgICAgICBudW1iZXIgb2YgYmFuZHMgaXMgbm9uLXplcm8gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiBOT1RFUzogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICAxLiAgVGhpcyBmdW5jdGlvbiBtYXkgYmUgaW50ZXJydXB0ZWQgYnkgdGhlIExWRVFOQl9Qcm9jZXNzIGZ1bmN0aW9uICAgICAgICAgICAgICAgICAqLwotLyogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLQotTFZFUU5CX1JldHVyblN0YXR1c19lbiBMVkVRTkJfQ29udHJvbChMVkVRTkJfSGFuZGxlX3QgICAgICAgaEluc3RhbmNlLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBMVkVRTkJfUGFyYW1zX3QgICAgICAgKnBQYXJhbXMpOwotCi0KLS8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotLyogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiBGVU5DVElPTjogICAgICAgICAgICAgICAgTFZFUU5CX1Byb2Nlc3MgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogREVTQ1JJUFRJT046ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgUHJvY2VzcyBmdW5jdGlvbiBmb3IgdGhlIExpZmVWaWJlcyBtb2R1bGUuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogUEFSQU1FVEVSUzogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgaEluc3RhbmNlICAgICAgICAgICAgICAgSW5zdGFuY2UgaGFuZGxlICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICBwSW5EYXRhICAgICAgICAgICAgICAgICBQb2ludGVyIHRvIHRoZSBpbnB1dCBkYXRhICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogIHBPdXREYXRhICAgICAgICAgICAgICAgIFBvaW50ZXIgdG8gdGhlIG91dHB1dCBkYXRhICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgTnVtU2FtcGxlcyAgICAgICAgICAgICAgTnVtYmVyIG9mIHNhbXBsZXMgaW4gdGhlIGlucHV0IGJ1ZmZlciAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogUkVUVVJOUzogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgTFZFUU5CX1NVQ0NFU1MgICAgICAgICAgU3VjY2VlZGVkICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICBMVkVRTkJfTlVMTEFERFJFU1MgICAgICBXaGVuIGhJbnN0YW5jZSwgcEluRGF0YSBvciBwT3V0RGF0YSBhcmUgTlVMTCAgICAgICAgICAgICAgICAqLwotLyogIExWRVFOQl9BTElHTk1FTlRFUlJPUiAgIFdoZW4gcEluRGF0YSBvciBwT3V0RGF0YSBhcmUgbm90IDMyLWJpdCBhbGlnbmVkICAgICAgICAgICAgICovCi0vKiAgTFZFUU5CX1RPT01BTllTQU1QTEVTICAgTnVtU2FtcGxlcyB3YXMgbGFyZ2VyIHRoYW4gdGhlIG1heGltdW0gYmxvY2sgc2l6ZSAgICAgICAgICAgKi8KLS8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogTk9URVM6ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotCi1MVkVRTkJfUmV0dXJuU3RhdHVzX2VuIExWRVFOQl9Qcm9jZXNzKExWRVFOQl9IYW5kbGVfdCAgICAgICBoSW5zdGFuY2UsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbnN0IExWTV9JTlQxNiAgICAgICAqcEluRGF0YSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTFZNX0lOVDE2ICAgICAgICAgICAgICpwT3V0RGF0YSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTFZNX1VJTlQxNiAgICAgICAgICAgIE51bVNhbXBsZXMpOwotCi0KLQotI2lmZGVmIF9fY3BsdXNwbHVzCi19Ci0jZW5kaWYgLyogX19jcGx1c3BsdXMgKi8KLQotI2VuZGlmICAgICAgLyogX19MVkVRTkJfXyAqLwotCmRpZmYgLS1naXQgYS9tZWRpYS9saWJlZmZlY3RzL2x2bS9saWIvRXEvc3JjL0xWRVFOQl9DYWxjQ29lZi5jIGIvbWVkaWEvbGliZWZmZWN0cy9sdm0vbGliL0VxL3NyYy9MVkVRTkJfQ2FsY0NvZWYuYwpkZWxldGVkIGZpbGUgbW9kZSAxMDA2NDQKaW5kZXggZmRkZWRiOS4uMDAwMDAwMAotLS0gYS9tZWRpYS9saWJlZmZlY3RzL2x2bS9saWIvRXEvc3JjL0xWRVFOQl9DYWxjQ29lZi5jCisrKyAvZGV2L251bGwKQEAgLTEsMjk4ICswLDAgQEAKLS8qCi0gKiBDb3B5cmlnaHQgKEMpIDIwMDQtMjAxMCBOWFAgU29mdHdhcmUKLSAqIENvcHlyaWdodCAoQykgMjAxMCBUaGUgQW5kcm9pZCBPcGVuIFNvdXJjZSBQcm9qZWN0Ci0gKgotICogTGljZW5zZWQgdW5kZXIgdGhlIEFwYWNoZSBMaWNlbnNlLCBWZXJzaW9uIDIuMCAodGhlICJMaWNlbnNlIik7Ci0gKiB5b3UgbWF5IG5vdCB1c2UgdGhpcyBmaWxlIGV4Y2VwdCBpbiBjb21wbGlhbmNlIHdpdGggdGhlIExpY2Vuc2UuCi0gKiBZb3UgbWF5IG9idGFpbiBhIGNvcHkgb2YgdGhlIExpY2Vuc2UgYXQKLSAqCi0gKiAgICAgIGh0dHA6Ly93d3cuYXBhY2hlLm9yZy9saWNlbnNlcy9MSUNFTlNFLTIuMAotICoKLSAqIFVubGVzcyByZXF1aXJlZCBieSBhcHBsaWNhYmxlIGxhdyBvciBhZ3JlZWQgdG8gaW4gd3JpdGluZywgc29mdHdhcmUKLSAqIGRpc3RyaWJ1dGVkIHVuZGVyIHRoZSBMaWNlbnNlIGlzIGRpc3RyaWJ1dGVkIG9uIGFuICJBUyBJUyIgQkFTSVMsCi0gKiBXSVRIT1VUIFdBUlJBTlRJRVMgT1IgQ09ORElUSU9OUyBPRiBBTlkgS0lORCwgZWl0aGVyIGV4cHJlc3Mgb3IgaW1wbGllZC4KLSAqIFNlZSB0aGUgTGljZW5zZSBmb3IgdGhlIHNwZWNpZmljIGxhbmd1YWdlIGdvdmVybmluZyBwZXJtaXNzaW9ucyBhbmQKLSAqIGxpbWl0YXRpb25zIHVuZGVyIHRoZSBMaWNlbnNlLgotICovCi0KLS8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotLyogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgICBJbmNsdWRlcyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0KLSNpbmNsdWRlICJMVkVRTkJfUHJpdmF0ZS5oIgotCi0KLS8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotLyogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgICBEZWZpbmVzICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0KLSNkZWZpbmUgUEkgMy4xNDE1OTI2NTM1ODk3OQotCi0vKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLS8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogRlVOQ1RJT046ICAgICAgICAgICAgICAgICAgTFZFUU5CX0RvdWJsZVByZWNDb2VmcyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qIERFU0NSSVBUSU9OOiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogICAgQ2FsY3VsYXRlIGRvdWJsZSBwcmVjaXNpb24gY29lZmZpY2llbnRzICAgIGZvciBhIHBlYWtpbmcgZmlsdGVyICAgICAgICAgICAgICAgICAgICovCi0vKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qIFBBUkFNRVRFUlM6ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogIEZzICAgICAgICAgICAgICAgICAgICAgICAgICAgU2FtcGxpbmcgZnJlcXVlbmN5IGluZGV4ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgcEZpbHRlckRlZmluaXRpb24gICAgICAgICAgUG9pbnRlciB0byB0aGUgZmlsdGVyIGRlZmluaXRpb24gICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICBwQ29lZmZpY2llbnRzICAgICAgICAgICAgUG9pbnRlciB0byB0aGUgY29lZmZpY2llbnRzICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiBSRVRVUk5TOiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICBMVkVRTkJfU1VDQ0VTUyAgICAgICAgICAgIEFsd2F5cyBzdWNjZWVkcyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiBOT1RFUzogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICAxLiBUaGUgZXF1YXRpb25zIHVzZWQgYXJlIGFzIGZvbGxvd3M6ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgICAgIEcgID0gMTBeKEdhaW5kQi8yMCkgLSAxICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICAgICAgdDAgPSAyICogUGkgKiBGYyAvIEZzICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogICAgICBEICA9IDEgICAgICAgICAgICAgICAgICBpZiBHYWluZEIgPj0gMCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgICAgIEQgID0gMSAvICgxICsgRykgICAgICAgIGlmIEdhaW5kQiA8ICAwICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogICAgICBiMiA9IC0wLjUgKiAoMlEgLSBEICogdDApIC8gKDJRICsgRCAqIHQwKSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgICAgIGIxID0gKDAuNSAtIGIyKSAqICgxIC0gY29zZXJyKHQwKSkgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICAgICAgYTAgPSAoMC41ICsgYjIpIC8gMiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgV2hlcmU6ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICAgICAgR2FpbmRCICAgICAgaXMgdGhlIGdhaW4gaW4gZEJzLCByYW5nZSAtMTVkQiB0byArMTVkQiAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogICAgICBGYyAgICAgICAgICBpcyB0aGUgY2VudHJlIGZyZXF1ZW5jeSwgREMgdG8gRnMvNTAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgICAgIEZzICAgICAgICAgIGlzIHRoZSBzYW1wbGUgZnJlcXVlbmN5LCA4MDAwIHRvIDQ4MDAwIGluIGRlc2NyZXRlIHN0ZXBzICAgICAgICAgICAgKi8KLS8qICAgICAgUSAgICAgICAgICAgaXMgdGhlIFEgZmFjdG9yLCAwLjI1IHRvIDEyIChyZXByZXNlbnRlZCBieSAyNSB0byAxMjAwKSAgICAgICAgICAgICAqLwotLyogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgMi4gVGhlIGRvdWJsZSBwcmVjaXNpb24gY29lZmZpY2llbnRzIGFyZSBvbmx5IHVzZWQgd2hlbiBmYyBpcyBsZXNzIHRoYW4gZnMvODUsIHNvICAgKi8KLS8qICAgICB0aGUgY29zaW5lIG9mIHQwIGlzIGFsd2F5cyBjbG9zZSB0byAxLjAuIEluc3RlYWQgb2YgY2FsY3VsYXRpbmcgdGhlIGNvc2luZSAgICAgICAqLwotLyogICAgIGl0c2VsZiB0aGUgZGlmZmVyZW5jZSBmcm9tIHRoZSB2YWx1ZSAxLjAgaXMgY2FsY3VsYXRlZCwgdGhpcyBjYW4gYmUgZG9uZSB3aXRoICAgICovCi0vKiAgICAgbG93ZXIgcHJlY2lzaW9uIG1hdGhzLiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogIDMuIFRoZSB2YWx1ZSBvZiB0aGUgQjIgY29lZmZpY2llbnQgaXMgb25seSBjYWxjdWxhdGVkIGFzIGEgc2luZ2xlIHByZWNpc2lvbiB2YWx1ZSwgICovCi0vKiAgICAgc21hbGwgZXJyb3JzIGluIHRoaXMgdmFsdWUgaGF2ZSBhIGNvbWJpbmVkIGVmZmVjdCBvbiB0aGUgUSBhbmQgR2FpbiBidXQgbm90IHRoZSAgKi8KLS8qICAgICB0aGUgZnJlcXVlbmN5IG9mIHRoZSBmaWx0ZXIuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLQotCi1MVkVRTkJfUmV0dXJuU3RhdHVzX2VuIExWRVFOQl9Eb3VibGVQcmVjQ29lZnMoTFZNX1VJTlQxNiAgICAgICAgRnMsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTFZFUU5CX0JhbmREZWZfdCAgKnBGaWx0ZXJEZWZpbml0aW9uLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFBLX0MzMl9Db2Vmc190ICAgICpwQ29lZmZpY2llbnRzKQotewotCi0gICAgZXh0ZXJuIExWTV9JTlQxNiAgICBMVkVRTkJfR2FpblRhYmxlW107Ci0gICAgZXh0ZXJuIExWTV9JTlQxNiAgICBMVkVRTkJfVHdvUGlPbkZzVGFibGVbXTsKLSAgICBleHRlcm4gTFZNX0lOVDE2ICAgIExWRVFOQl9EVGFibGVbXTsKLSAgICBleHRlcm4gTFZNX0lOVDE2ICAgIExWRVFOQl9EUENvc0NvZWZbXTsKLQotICAgIC8qCi0gICAgICogR2V0IHRoZSBmaWx0ZXIgZGVmaW5pdGlvbgotICAgICAqLwotICAgIExWTV9JTlQxNiAgICAgICAgICAgR2FpbiAgICAgICAgPSBwRmlsdGVyRGVmaW5pdGlvbi0+R2FpbjsKLSAgICBMVk1fVUlOVDE2ICAgICAgICAgIEZyZXF1ZW5jeSAgID0gcEZpbHRlckRlZmluaXRpb24tPkZyZXF1ZW5jeTsKLSAgICBMVk1fVUlOVDE2ICAgICAgICAgIFFGYWN0b3IgICAgID0gcEZpbHRlckRlZmluaXRpb24tPlFGYWN0b3I7Ci0KLSAgICAvKgotICAgICAqIEludGVybWVkaWF0ZSB2YXJpYWJsZXMgYW5kIHRlbXBvcmFyeSB2YWx1ZXMKLSAgICAgKi8KLSAgICBMVk1fSU5UMzIgICAgICAgICAgIFQwOwotICAgIExWTV9JTlQxNiAgICAgICAgICAgRDsKLSAgICBMVk1fSU5UMzIgICAgICAgICAgIEEwOwotICAgIExWTV9JTlQzMiAgICAgICAgICAgQjE7Ci0gICAgTFZNX0lOVDMyICAgICAgICAgICBCMjsKLSAgICBMVk1fSU5UMzIgICAgICAgICAgIER0MDsKLSAgICBMVk1fSU5UMzIgICAgICAgICAgIEIyX0RlbjsKLSAgICBMVk1fSU5UMzIgICAgICAgICAgIEIyX051bTsKLSAgICBMVk1fSU5UMzIgICAgICAgICAgIENvc0VycjsKLSAgICBMVk1fSU5UMTYgICAgICAgICAgIGNvZWY7Ci0gICAgTFZNX0lOVDMyICAgICAgICAgICBmYWN0b3I7Ci0gICAgTFZNX0lOVDE2ICAgICAgICAgICB0MDsKLSAgICBMVk1fSU5UMTYgICAgICAgICAgIGk7Ci0KLSAgICAvKgotICAgICAqIENhbGN1bGF0aW5nIHRoZSBpbnRlcm1lZGlhdGUgdmFsdWVzCi0gICAgICovCi0gICAgVDAgPSAoTFZNX0lOVDMyKUZyZXF1ZW5jeSAqIExWRVFOQl9Ud29QaU9uRnNUYWJsZVtGc107ICAgICAgICAvKiBUMCA9IDIgKiBQaSAqIEZjIC8gRnMgKi8KLSAgICBpZiAoR2FpbiA+PSAwKQotICAgIHsKLSAgICAgICAgRCA9IExWRVFOQl9EVGFibGVbMTVdOyAgICAgICAgICAgICAgICAgICAgICAgICAvKiBEID0gMSAgICAgICAgICAgIGlmIEdhaW5kQiA+PSAwICovCi0gICAgfQotICAgIGVsc2UKLSAgICB7Ci0gICAgICAgIEQgPSBMVkVRTkJfRFRhYmxlW0dhaW4rMTVdOyAgICAgICAgICAgICAgICAgICAgLyogRCA9IDEgLyAoMSArIEcpICBpZiBHYWluZEIgPCAgMCAqLwotICAgIH0KLQotICAgIC8qCi0gICAgICogQ2FsY3VsYXRlIHRoZSBCMiBjb2VmZmljaWVudAotICAgICAqLwotICAgIER0MCA9IEQgKiAoVDAgPj4gMTApOwotICAgIEIyX0RlbiA9ICgoTFZNX0lOVDMyKVFGYWN0b3IgPDwgMTkpICsgKER0MCA+PiAyKTsKLSAgICBCMl9OdW0gPSAoRHQwID4+IDMpIC0gKChMVk1fSU5UMzIpUUZhY3RvciA8PCAxOCk7Ci0gICAgQjIgPSAoQjJfTnVtIC8gKEIyX0RlbiA+PiAxNikpIDw8IDE1OwotCi0gICAgLyoKLSAgICAgKiBDYWxjdWxhdGUgdGhlIGNvc2luZSBlcnJvciBieSBhIHBvbHlub21pYWwgZXhwYW5zaW9uIHVzaW5nIHRoZSBlcXVhdGlvbjoKLSAgICAgKgotICAgICAqICBDb3NFcnIgKz0gY29lZihuKSAqIHQwXm4gICAgICAgICAgICAgICAgRm9yIG4gPSAwIHRvIDQKLSAgICAgKi8KLSAgICBUMCA9IChUMCA+PiA2KSAqIDB4N2Y1MzsgICAgICAgICAgICAgICAgICAgIC8qIFNjYWxlIHRvIDEuMCBpbiAxNi1iaXQgZm9yIHJhbmdlIDAgdG8gZnMvNTAgKi8KLSAgICB0MCA9IChMVk1fSU5UMTYpKFQwID4+IDE2KTsKLSAgICBmYWN0b3IgPSAweDdmZmY7ICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8qIEluaXRpYWxpc2UgdG8gMS4wIGZvciB0aGUgYTAgY29lZmZpY2llbnQgKi8KLSAgICBDb3NFcnIgPSAwOyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8qIEluaXRpYWxpc2UgdGhlIGVycm9yIHRvIHplcm8gKi8KLSAgICBmb3IgKGk9MTsgaTw1OyBpKyspCi0gICAgewotICAgICAgICBjb2VmID0gTFZFUU5CX0RQQ29zQ29lZltpXTsgICAgICAgICAgICAgLyogR2V0IHRoZSBudGggY29lZmZpY2llbnQgKi8KLSAgICAgICAgQ29zRXJyICs9IChmYWN0b3IgKiBjb2VmKSA+PiA1OyAgICAgICAgIC8qIFRoZSBudGggcGFydGlhbCBzdW0gKi8KLSAgICAgICAgZmFjdG9yID0gKGZhY3RvciAqIHQwKSA+PiAxNTsgICAgICAgICAgIC8qIENhbGN1bGF0ZSB0MF5uICovCi0gICAgfQotICAgIENvc0VyciA9IENvc0VyciA8PCAoTFZFUU5CX0RQQ29zQ29lZlswXSk7ICAgLyogQ29ycmVjdCB0aGUgc2NhbGluZyAqLwotCi0gICAgLyoKLSAgICAgKiBDYWxjdWxhdGUgdGhlIEIxIGFuZCBBMCBjb2VmZmljaWVudHMKLSAgICAgKi8KLSAgICBCMSA9ICgweDQwMDAwMDAwIC0gQjIpOyAgICAgICAgICAgICAgICAgICAgIC8qIEIxID0gKDAuNSAtIGIyLzIpICovCi0gICAgQTAgPSAoKEIxID4+IDE2KSAqIChDb3NFcnIgPj4gMTApKSA+PiA2OyAgICAvKiBUZW1wb3Jhcnkgc3RvcmFnZSBmb3IgKDAuNSAtIGIyLzIpICogY29zZXJyKHQwKSAqLwotICAgIEIxIC09IEEwOyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLyogQjEgPSAoMC41IC0gYjIvMikgKiAoMSAtIGNvc2Vycih0MCkpICAqLwotICAgIEEwID0gKDB4NDAwMDAwMDAgKyBCMikgPj4gMTsgICAgICAgICAgICAgICAgLyogQTAgPSAoMC41ICsgYjIpICovCi0KLSAgICAvKgotICAgICAqIFdyaXRlIGNvZWZmIGludG8gdGhlIGRhdGEgc3RydWN0dXJlCi0gICAgICovCi0gICAgcENvZWZmaWNpZW50cy0+QTAgPSBBMDsKLSAgICBwQ29lZmZpY2llbnRzLT5CMSA9IEIxOwotICAgIHBDb2VmZmljaWVudHMtPkIyID0gQjI7Ci0gICAgcENvZWZmaWNpZW50cy0+RyAgPSBMVkVRTkJfR2FpblRhYmxlW0dhaW4rMTVdOwotCi0gICAgcmV0dXJuKExWRVFOQl9TVUNDRVNTKTsKLQotfQotCi0KLS8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotLyogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiBGVU5DVElPTjogICAgICAgICAgICAgICAgICBMVkVRTkJfU2luZ2xlUHJlY0NvZWZzICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogREVTQ1JJUFRJT046ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgICBDYWxjdWxhdGUgc2luZ2xlIHByZWNpc2lvbiBjb2VmZmljaWVudHMgICAgZm9yIGEgcGVha2luZyBmaWx0ZXIgICAgICAgICAgICAgICAgICAgKi8KLS8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogUEFSQU1FVEVSUzogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgRnMgICAgICAgICAgICAgICAgICAgICAgICAgICBTYW1wbGluZyBmcmVxdWVuY3kgaW5kZXggICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICBwRmlsdGVyRGVmaW5pdGlvbiAgICAgICAgICBQb2ludGVyIHRvIHRoZSBmaWx0ZXIgZGVmaW5pdGlvbiAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogIHBDb2VmZmljaWVudHMgICAgICAgICAgICBQb2ludGVyIHRvIHRoZSBjb2VmZmljaWVudHMgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qIFJFVFVSTlM6ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogIExWRVFOQl9TVUNDRVNTICAgICAgICAgICAgQWx3YXlzIHN1Y2NlZWRzICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qIE5PVEVTOiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogIDEuIFRoZSBlcXVhdGlvbnMgdXNlZCBhcmUgYXMgZm9sbG93czogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICAgICAgRyAgPSAxMF4oR2FpbmRCLzIwKSAtIDEgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogICAgICB0MCA9IDIgKiBQaSAqIEZjIC8gRnMgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgICAgIEQgID0gMSAgICAgICAgICAgICAgICAgIGlmIEdhaW5kQiA+PSAwICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICAgICAgRCAgPSAxIC8gKDEgKyBHKSAgICAgICAgaWYgR2FpbmRCIDwgIDAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgICAgIGIyID0gLTAuNSAqICgyUSAtIEQgKiB0MCkgLyAoMlEgKyBEICogdDApICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICAgICAgYjEgPSAoMC41IC0gYjIpICogY29zKHQwKSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogICAgICBhMCA9ICgwLjUgKyBiMikgLyAyICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICBXaGVyZTogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogICAgICBHYWluZEIgICAgICBpcyB0aGUgZ2FpbiBpbiBkQnMsIHJhbmdlIC0xNWRCIHRvICsxNWRCICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgICAgIEZjICAgICAgICAgIGlzIHRoZSBjZW50cmUgZnJlcXVlbmN5LCBEQyB0byBOeXF1aXN0ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICAgICAgRnMgICAgICAgICAgaXMgdGhlIHNhbXBsZSBmcmVxdWVuY3ksIDgwMDAgdG8gNDgwMDAgaW4gZGVzY3JldGUgc3RlcHMgICAgICAgICAgICAqLwotLyogICAgICBRICAgICAgICAgICBpcyB0aGUgUSBmYWN0b3IsIDAuMjUgdG8gMTIgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotCi0KLUxWRVFOQl9SZXR1cm5TdGF0dXNfZW4gTFZFUU5CX1NpbmdsZVByZWNDb2VmcyhMVk1fVUlOVDE2ICAgICAgICBGcywKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBMVkVRTkJfQmFuZERlZl90ICAqcEZpbHRlckRlZmluaXRpb24sCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgUEtfQzE2X0NvZWZzX3QgICAgKnBDb2VmZmljaWVudHMpCi17Ci0KLSAgICBleHRlcm4gTFZNX0lOVDE2ICAgIExWRVFOQl9HYWluVGFibGVbXTsKLSAgICBleHRlcm4gTFZNX0lOVDE2ICAgIExWRVFOQl9Ud29QaU9uRnNUYWJsZVtdOwotICAgIGV4dGVybiBMVk1fSU5UMTYgICAgTFZFUU5CX0RUYWJsZVtdOwotICAgIGV4dGVybiBMVk1fSU5UMTYgICAgTFZFUU5CX0Nvc0NvZWZbXTsKLQotCi0gICAgLyoKLSAgICAgKiBHZXQgdGhlIGZpbHRlciBkZWZpbml0aW9uCi0gICAgICovCi0gICAgTFZNX0lOVDE2ICAgICAgICAgICBHYWluICAgICAgICA9IHBGaWx0ZXJEZWZpbml0aW9uLT5HYWluOwotICAgIExWTV9VSU5UMTYgICAgICAgICAgRnJlcXVlbmN5ICAgPSBwRmlsdGVyRGVmaW5pdGlvbi0+RnJlcXVlbmN5OwotICAgIExWTV9VSU5UMTYgICAgICAgICAgUUZhY3RvciAgICAgPSBwRmlsdGVyRGVmaW5pdGlvbi0+UUZhY3RvcjsKLQotCi0gICAgLyoKLSAgICAgKiBJbnRlcm1lZGlhdGUgdmFyaWFibGVzIGFuZCB0ZW1wb3JhcnkgdmFsdWVzCi0gICAgICovCi0gICAgTFZNX0lOVDMyICAgICAgICAgICBUMDsKLSAgICBMVk1fSU5UMTYgICAgICAgICAgIEQ7Ci0gICAgTFZNX0lOVDMyICAgICAgICAgICBBMDsKLSAgICBMVk1fSU5UMzIgICAgICAgICAgIEIxOwotICAgIExWTV9JTlQzMiAgICAgICAgICAgQjI7Ci0gICAgTFZNX0lOVDMyICAgICAgICAgICBEdDA7Ci0gICAgTFZNX0lOVDMyICAgICAgICAgICBCMl9EZW47Ci0gICAgTFZNX0lOVDMyICAgICAgICAgICBCMl9OdW07Ci0gICAgTFZNX0lOVDMyICAgICAgICAgICBDT1NfVDA7Ci0gICAgTFZNX0lOVDE2ICAgICAgICAgICBjb2VmOwotICAgIExWTV9JTlQzMiAgICAgICAgICAgZmFjdG9yOwotICAgIExWTV9JTlQxNiAgICAgICAgICAgdDA7Ci0gICAgTFZNX0lOVDE2ICAgICAgICAgICBpOwotCi0gICAgLyoKLSAgICAgKiBDYWxjdWxhdGluZyB0aGUgaW50ZXJtZWRpYXRlIHZhbHVlcwotICAgICAqLwotICAgIFQwID0gKExWTV9JTlQzMilGcmVxdWVuY3kgKiBMVkVRTkJfVHdvUGlPbkZzVGFibGVbRnNdOyAgICAgICAgLyogVDAgPSAyICogUGkgKiBGYyAvIEZzICovCi0gICAgaWYgKEdhaW4gPj0gMCkKLSAgICB7Ci0gICAgICAgIEQgPSBMVkVRTkJfRFRhYmxlWzE1XTsgICAgICAgICAgICAgICAgICAgICAgICAgLyogRCA9IDEgICAgICAgICAgICBpZiBHYWluZEIgPj0gMCAqLwotICAgIH0KLSAgICBlbHNlCi0gICAgewotICAgICAgICBEID0gTFZFUU5CX0RUYWJsZVtHYWluKzE1XTsgICAgICAgICAgICAgICAgICAgIC8qIEQgPSAxIC8gKDEgKyBHKSAgaWYgR2FpbmRCIDwgIDAgKi8KLSAgICB9Ci0KLSAgICAvKgotICAgICAqIENhbGN1bGF0ZSB0aGUgQjIgY29lZmZpY2llbnQKLSAgICAgKi8KLSAgICBEdDAgPSBEICogKFQwID4+IDEwKTsKLSAgICBCMl9EZW4gPSAoKExWTV9JTlQzMilRRmFjdG9yIDw8IDE5KSArIChEdDAgPj4gMik7Ci0gICAgQjJfTnVtID0gKER0MCA+PiAzKSAtICgoTFZNX0lOVDMyKVFGYWN0b3IgPDwgMTgpOwotICAgIEIyID0gKEIyX051bSAvIChCMl9EZW4gPj4gMTYpKSA8PCAxNTsKLQotICAgIC8qCi0gICAgICogQ2FsY3VsYXRlIHRoZSBjb3NpbmUgYnkgYSBwb2x5bm9taWFsIGV4cGFuc2lvbiB1c2luZyB0aGUgZXF1YXRpb246Ci0gICAgICoKLSAgICAgKiAgQ29zICs9IGNvZWYobikgKiB0MF5uICAgICAgICAgICAgICAgICAgIEZvciBuID0gMCB0byA2Ci0gICAgICovCi0gICAgVDAgPSAoVDAgPj4gMTApICogMjA4NTk7ICAgICAgICAgICAgICAgICAgICAvKiBTY2FsZSB0byAxLjAgaW4gMTYtYml0IGZvciByYW5nZSAwIHRvIGZzLzIgKi8KLSAgICB0MCA9IChMVk1fSU5UMTYpKFQwID4+IDE2KTsKLSAgICBmYWN0b3IgPSAweDdmZmY7ICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8qIEluaXRpYWxpc2UgdG8gMS4wIGZvciB0aGUgYTAgY29lZmZpY2llbnQgKi8KLSAgICBDT1NfVDAgPSAwOyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8qIEluaXRpYWxpc2UgdGhlIGVycm9yIHRvIHplcm8gKi8KLSAgICBmb3IgKGk9MTsgaTw3OyBpKyspCi0gICAgewotICAgICAgICBjb2VmID0gTFZFUU5CX0Nvc0NvZWZbaV07ICAgICAgICAgICAgICAgLyogR2V0IHRoZSBudGggY29lZmZpY2llbnQgKi8KLSAgICAgICAgQ09TX1QwICs9IChmYWN0b3IgKiBjb2VmKSA+PiA1OyAgICAgICAgIC8qIFRoZSBudGggcGFydGlhbCBzdW0gKi8KLSAgICAgICAgZmFjdG9yID0gKGZhY3RvciAqIHQwKSA+PiAxNTsgICAgICAgICAgIC8qIENhbGN1bGF0ZSB0MF5uICovC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gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiBHYWluIHRhYmxlIGZvciAoMTBeKEdhaW4vMjApIC0gMSkgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0KLSNkZWZpbmUgTFZFUU5CX0dBSU5TSElGVCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMTEgICAgICAgICAvKiBBcyBhIHBvd2VyIG9mIDIgKi8KLSNkZWZpbmUgTFZFUU5CX0dhaW5fTmVnMTVfZEIgICAgICAgICAgICAgICAgICAgICAgICAgICAgLTE2ODQgICAgICAgICAvKiBGbG9hdGluZyBwb2ludCB2YWx1ZSAtMC44MjIxNzIgKi8KLSNkZWZpbmUgTFZFUU5CX0dhaW5fTmVnMTRfZEIgICAgICAgICAgICAgICAgICAgICAgICAgICAgLTE2MzkgICAgICAgICAvKiBGbG9hdGluZyBwb2ludCB2YWx1ZSAtMC44MDA0NzQgKi8KLSNkZWZpbmUgTFZFUU5CX0dhaW5fTmVnMTNfZEIgICAgICAgICAgICAgICAgICAgICAgICAgICAgLTE1OTAgICAgICAgICAvKiBGbG9hdGluZyBwb2ludCB2YWx1ZSAtMC43NzYxMjggKi8KLSNkZWZpbmUgTFZFUU5CX0dhaW5fTmVnMTJfZEIgICAgICAgICAgICAgICAgICAgICAgICAgICAgLTE1MzQgICAgICAgICAvKiBGbG9hdGluZyBwb2ludCB2YWx1ZSAtMC43NDg4MTEgKi8KLSNkZWZpbmUgTFZFUU5CX0dhaW5fTmVnMTFfZEIgICAgICAgICAgICAgICAgICAgICAgICAgICAgLTE0NzEgICAgICAgICAvKiBGbG9hdGluZyBwb2ludCB2YWx1ZSAtMC43MTgxNjIgKi8KLSNkZWZpbmUgTFZFUU5CX0dhaW5fTmVnMTBfZEIgICAgICAgICAgICAgICAgICAgICAgICAgICAgLTE0MDAgICAgICAgICAvKiBGbG9hdGluZyBwb2ludCB2YWx1ZSAtMC42ODM3NzIgKi8KLSNkZWZpbmUgTFZFUU5CX0dhaW5fTmVnOV9kQiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLTEzMjEgICAgICAgICAvKiBGbG9hdGluZyBwb2ludCB2YWx1ZSAtMC42NDUxODcgKi8KLSNkZWZpbmUgTFZFUU5CX0dhaW5fTmVnOF9kQiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLTEyMzMgICAgICAgICAvKiBGbG9hdGluZyBwb2ludCB2YWx1ZSAtMC42MDE4OTMgKi8KLSNkZWZpbmUgTFZFUU5CX0dhaW5fTmVnN19kQiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLTExMzMgICAgICAgICAvKiBGbG9hdGluZyBwb2ludCB2YWx1ZSAtMC41NTMzMTYgKi8KLSNkZWZpbmUgTFZFUU5CX0dhaW5fTmVnNl9kQiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLTEwMjIgICAgICAgICAvKiBGbG9hdGluZyBwb2ludCB2YWx1ZSAtMC40OTg4MTMgKi8KLSNkZWZpbmUgTFZFUU5CX0dhaW5fTmVnNV9kQiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC04OTYgICAgICAgICAvKiBGbG9hdGluZyBwb2ludCB2YWx1ZSAtMC40Mzc2NTkgKi8KLSNkZWZpbmUgTFZFUU5CX0dhaW5fTmVnNF9kQiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC03NTYgICAgICAgICAvKiBGbG9hdGluZyBwb2ludCB2YWx1ZSAtMC4zNjkwNDMgKi8KLSNkZWZpbmUgTFZFUU5CX0dhaW5fTmVnM19kQiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC01OTggICAgICAgICAvKiBGbG9hdGluZyBwb2ludCB2YWx1ZSAtMC4yOTIwNTQgKi8KLSNkZWZpbmUgTFZFUU5CX0dhaW5fTmVnMl9kQiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC00MjEgICAgICAgICAvKiBGbG9hdGluZyBwb2ludCB2YWx1ZSAtMC4yMDU2NzIgKi8KLSNkZWZpbmUgTFZFUU5CX0dhaW5fTmVnMV9kQiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC0yMjMgICAgICAgICAvKiBGbG9hdGluZyBwb2ludCB2YWx1ZSAtMC4xMDg3NDkgKi8KLSNkZWZpbmUgTFZFUU5CX0dhaW5fMF9kQiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDAgICAgICAgICAvKiBGbG9hdGluZyBwb2ludCB2YWx1ZSAwLjAwMDAwMCAqLwotI2RlZmluZSBMVkVRTkJfR2Fpbl8xX2RCICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDI1MCAgICAgICAgIC8qIEZsb2F0aW5nIHBvaW50IHZhbHVlIDAuMTIyMDE4ICovCi0jZGVmaW5lIExWRVFOQl9HYWluXzJfZEIgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgNTMwICAgICAgICAgLyogRmxvYXRpbmcgcG9pbnQgdmFsdWUgMC4yNTg5MjUgKi8KLSNkZWZpbmUgTFZFUU5CX0dhaW5fM19kQiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA4NDUgICAgICAgICAvKiBGbG9hdGluZyBwb2ludCB2YWx1ZSAwLjQxMjUzOCAqLwotI2RlZmluZSBMVkVRTkJfR2Fpbl80X2RCICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMTE5OCAgICAgICAgIC8qIEZsb2F0aW5nIHBvaW50IHZhbHVlIDAuNTg0ODkzICovCi0jZGVmaW5lIExWRVFOQl9HYWluXzVfZEIgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAxNTk0ICAgICAgICAgLyogRmxvYXRpbmcgcG9pbnQgdmFsdWUgMC43NzgyNzkgKi8KLSNkZWZpbmUgTFZFUU5CX0dhaW5fNl9kQiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDIwMzggICAgICAgICAvKiBGbG9hdGluZyBwb2ludCB2YWx1ZSAwLjk5NTI2MiAqLwotI2RlZmluZSBMVkVRTkJfR2Fpbl83X2RCICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMjUzNyAgICAgICAgIC8qIEZsb2F0aW5nIHBvaW50IHZhbHVlIDEuMjM4NzIxICovCi0jZGVmaW5lIExWRVFOQl9HYWluXzhfZEIgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAzMDk2ICAgICAgICAgLyogRmxvYXRpbmcgcG9pbnQgdmFsdWUgMS41MTE4ODYgKi8KLSNkZWZpbmUgTFZFUU5CX0dhaW5fOV9kQiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDM3MjQgICAgICAgICAvKiBGbG9hdGluZyBwb2ludCB2YWx1ZSAxLjgxODM4MyAqLwotI2RlZmluZSBMVkVRTkJfR2Fpbl8xMF9kQiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgNDQyOCAgICAgICAgIC8qIEZsb2F0aW5nIHBvaW50IHZhbHVlIDIuMTYyMjc4ICovCi0jZGVmaW5lIExWRVFOQl9HYWluXzExX2RCICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA1MjE5ICAgICAgICAgLyogRmxvYXRpbmcgcG9pbnQgdmFsdWUgMi41NDgxMzQgKi8KLSNkZWZpbmUgTFZFUU5CX0dhaW5fMTJfZEIgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDYxMDUgICAgICAgICAvKiBGbG9hdGluZyBwb2ludCB2YWx1ZSAyLjk4MTA3MiAqLwotI2RlZmluZSBMVkVRTkJfR2Fpbl8xM19kQiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgNzEwMCAgICAgICAgIC8qIEZsb2F0aW5nIHBvaW50IHZhbHVlIDMuNDY2ODM2ICovCi0jZGVmaW5lIExWRVFOQl9HYWluXzE0X2RCICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA4MjE2ICAgICAgICAgLyogRmxvYXRpbmcgcG9pbnQgdmFsdWUgNC4wMTE4NzIgKi8KLSNkZWZpbmUgTFZFUU5CX0dhaW5fMTVfZEIgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDk0NjkgICAgICAgICAvKiBGbG9hdGluZyBwb2ludCB2YWx1ZSA0LjYyMzQxMyAqLwotCi0KLS8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0vKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogRnJlcXVlbmN5IHRhYmxlIGZvciAyKlBpL0ZzICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotCi0jZGVmaW5lIExWRVFOQl9GUkVRU0hJRlQgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDI1ICAgICAgICAgLyogQXMgYSBwb3dlciBvZiAyICovCi0jZGVmaW5lIExWRVFOQl8yUGlPbl84MDAwICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDI2MzU0ICAgICAgICAgLyogRmxvYXRpbmcgcG9pbnQgdmFsdWUgMC4wMDA3ODUgKi8KLSNkZWZpbmUgTFZFUU5CXzJQaU9uXzExMDI1ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMTkxMjMgICAgICAgICAvKiBGbG9hdGluZyBwb2ludCB2YWx1ZSAwLjAwMDU3MCAqLwotI2RlZmluZSBMVkVRTkJfMlBpT25fMTIwMDAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAxNzU2OSAgICAgICAgIC8qIEZsb2F0aW5nIHBvaW50IHZhbHVlIDAuMDAwNTI0ICovCi0jZGVmaW5lIExWRVFOQl8yUGlPbl8xNjAwMCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDEzMTc3ICAgICAgICAgLyogRmxvYXRpbmcgcG9pbnQgdmFsdWUgMC4wMDAzOTMgKi8KLSNkZWZpbmUgTFZFUU5CXzJQaU9uXzIyMDUwICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDk1NjEgICAgICAgICAvKiBGbG9hdGluZyBwb2ludCB2YWx1ZSAwLjAwMDI4NSAqLwotI2RlZmluZSBMVkVRTkJfMlBpT25fMjQwMDAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgODc4NSAgICAgICAgIC8qIEZsb2F0aW5nIHBvaW50IHZhbHVlIDAuMDAwMjYyICovCi0jZGVmaW5lIExWRVFOQl8yUGlPbl8zMjAwMCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA2NTg4ICAgICAgICAgLyogRmxvYXRpbmcgcG9pbnQgdmFsdWUgMC4wMDAxOTYgKi8KLSNkZWZpbmUgTFZFUU5CXzJQaU9uXzQ0MTAwICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDQ3ODEgICAgICAgICAvKiBGbG9hdGluZyBwb2ludCB2YWx1ZSAwLjAwMDE0MiAqLwotI2RlZmluZSBMVkVRTkJfMlBpT25fNDgwMDAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgNDM5MiAgICAgICAgIC8qIEZsb2F0aW5nIHBvaW50IHZhbHVlIDAuMDAwMTMxICovCi0KLQotLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLS8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiA1MEQgdGFibGUgZm9yIDUwIC8gKCAxICsgR2FpbiApICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0KLSNkZWZpbmUgTFZFUU5CXzEwMERTSElGVCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDUgICAgICAgICAvKiBBcyBhIHBvd2VyIG9mIDIgKi8KLSNkZWZpbmUgTFZFUU5CXzEwMERfTmVnMTVfZEIgICAgICAgICAgICAgICAgICAgICAgICAgICAgMTc5OTUgICAgICAgICAvKiBGbG9hdGluZyBwb2ludCB2YWx1ZSA1LjYyMzQxMyAqLwotI2RlZmluZSBMVkVRTkJfMTAwRF9OZWcxNF9kQiAgICAgICAgICAgICAgICAgICAgICAgICAgICAxNjAzOCAgICAgICAgIC8qIEZsb2F0aW5nIHBvaW50IHZhbHVlIDUuMDExODcyICovCi0jZGVmaW5lIExWRVFOQl8xMDBEX05lZzEzX2RCICAgICAgICAgICAgICAgICAgICAgICAgICAgIDE0Mjk0ICAgICAgICAgLyogRmxvYXRpbmcgcG9pbnQgdmFsdWUgNC40NjY4MzYgKi8KLSNkZWZpbmUgTFZFUU5CXzEwMERfTmVnMTJfZEIgICAgICAgICAgICAgICAgICAgICAgICAgICAgMTI3MzkgICAgICAgICAvKiBGbG9hdGluZyBwb2ludCB2YWx1ZSAzLjk4MTA3MiAqLwotI2RlZmluZSBMVkVRTkJfMTAwRF9OZWcxMV9kQiAgICAgICAgICAgICAgICAgICAgICAgICAgICAxMTM1NCAgICAgICAgIC8qIEZsb2F0aW5nIHBvaW50IHZhbHVlIDMuNTQ4MTM0ICovCi0jZGVmaW5lIExWRVFOQl8xMDBEX05lZzEwX2RCICAgICAgICAgICAgICAgICAgICAgICAgICAgIDEwMTE5ICAgICAgICAgLyogRmxvYXRpbmcgcG9pbnQgdmFsdWUgMy4xNjIyNzggKi8KLSNkZWZpbmUgTFZFUU5CXzEwMERfTmVnOV9kQiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDkwMTkgICAgICAgICAvKiBGbG9hdGluZyBwb2ludCB2YWx1ZSAyLjgxODM4MyAqLwotI2RlZmluZSBMVkVRTkJfMTAwRF9OZWc4X2RCICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgODAzOCAgICAgICAgIC8qIEZsb2F0aW5nIHBvaW50IHZhbHVlIDIuNTExODg2ICovCi0jZGVmaW5lIExWRVFOQl8xMDBEX05lZzdfZEIgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA3MTY0ICAgICAgICAgLyogRmxvYXRpbmcgcG9pbnQgdmFsdWUgMi4yMzg3MjEgKi8KLSNkZWZpbmUgTFZFUU5CXzEwMERfTmVnNl9kQiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDYzODUgICAgICAgICAvKiBGbG9hdGluZyBwb2ludCB2YWx1ZSAxLjk5NTI2MiAqLwotI2RlZmluZSBMVkVRTkJfMTAwRF9OZWc1X2RCICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgNTY5MCAgICAgICAgIC8qIEZsb2F0aW5nIHBvaW50IHZhbHVlIDEuNzc4Mjc5ICovCi0jZGVmaW5lIExWRVFOQl8xMDBEX05lZzRfZEIgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA1MDcyICAgICAgICAgLyogRmxvYXRp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2VkIHVuZGVyIHRoZSBBcGFjaGUgTGljZW5zZSwgVmVyc2lvbiAyLjAgKHRoZSAiTGljZW5zZSIpOwotICogeW91IG1heSBub3QgdXNlIHRoaXMgZmlsZSBleGNlcHQgaW4gY29tcGxpYW5jZSB3aXRoIHRoZSBMaWNlbnNlLgotICogWW91IG1heSBvYnRhaW4gYSBjb3B5IG9mIHRoZSBMaWNlbnNlIGF0Ci0gKgotICogICAgICBodHRwOi8vd3d3LmFwYWNoZS5vcmcvbGljZW5zZXMvTElDRU5TRS0yLjAKLSAqCi0gKiBVbmxlc3MgcmVxdWlyZWQgYnkgYXBwbGljYWJsZSBsYXcgb3IgYWdyZWVkIHRvIGluIHdyaXRpbmcsIHNvZnR3YXJlCi0gKiBkaXN0cmlidXRlZCB1bmRlciB0aGUgTGljZW5zZSBpcyBkaXN0cmlidXRlZCBvbiBhbiAiQVMgSVMiIEJBU0lTLAotICogV0lUSE9VVCBXQVJSQU5USUVTIE9SIENPTkRJVElPTlMgT0YgQU5ZIEtJTkQsIGVpdGhlciBleHByZXNzIG9yIGltcGxpZWQuCi0gKiBTZWUgdGhlIExpY2Vuc2UgZm9yIHRoZSBzcGVjaWZpYyBsYW5ndWFnZSBnb3Zlcm5pbmcgcGVybWlzc2lvbnMgYW5kCi0gKiBsaW1pdGF0aW9ucyB1bmRlciB0aGUgTGljZW5zZS4KLSAqLwotCi0vKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLS8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogIEluY2x1ZGVzICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotCi0jaW5jbHVkZSAiTFZFUU5CLmgiCi0jaW5jbHVkZSAiTFZFUU5CX1ByaXZhdGUuaCIKLSNpbmNsdWRlICJWZWN0b3JBcml0aG1ldGljLmgiCi0jaW5jbHVkZSAiQklRVUFELmgiCi0KLQotLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0vKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICBEZWZpbmVzICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLQotI2RlZmluZSAgICAgTE9XX0ZSRVEgICAgICAgICAgICAyOTggICAgICAgICAgICAgLyogMzI3NjgvMTEwIGZvciBsb3cgdGVzdCBmcmVxdWVuY3kgKi8KLSNkZWZpbmUgICAgIEhJR0hfRlJFUSAgICAgICAgICAgMzg2ICAgICAgICAgICAgIC8qIDMyNzY4Lzg1IGZvciBoaWdoIHRlc3QgZnJlcXVlbmN5ICovCi0KLS8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotLyogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiBGVU5DVElPTjogICAgICAgICAgICAgICAgIExWRVFOQl9HZXRQYXJhbWV0ZXJzICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogREVTQ1JJUFRJT046ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgUmVxdWVzdCB0aGUgTi1CYW5kIGVxdWFsaXNlciBwYXJhbWV0ZXJzLiBUaGUgY3VycmVudCBwYXJhbWV0ZXIgc2V0IGlzIHJldHVybmVkIHZpYSAgKi8KLS8qICB0aGUgcGFyYW1ldGVyIHBvaW50ZXIuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiBQQVJBTUVURVJTOiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICBoSW5zdGFuY2UgICAgICAgICAgICAgICAgSW5zdGFuY2UgaGFuZGxlICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogIHBQYXJhbXMgICAgICAgICAgICAgICAgICBQb2ludGVyIHRvIGFuIGVtcHR5IHBhcmFtZXRlciBzdHJ1Y3R1cmUgICAgICAgICAgICAgICAgICAgICovCi0vKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qIFJFVFVSTlM6ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogIExWRVFOQl9TVUNDRVNTICAgICAgICAgIFN1Y2NlZWRzICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgTFZFUU5CX05VTExBRERSRVNTICAgICAgSW5zdGFuY2Ugb3IgcFBhcmFtcyAgaXMgTlVMTCBwb2ludGVyICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogTk9URVM6ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgMS4gIFRoaXMgZnVuY3Rpb24gbWF5IGJlIGludGVycnVwdGVkIGJ5IHRoZSBMVkVRTkJfUHJvY2VzcyBmdW5jdGlvbiAgICAgICAgICAgICAgICAgKi8KLS8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0KLUxWRVFOQl9SZXR1cm5TdGF0dXNfZW4gTFZFUU5CX0dldFBhcmFtZXRlcnMoTFZFUU5CX0hhbmRsZV90ICAgICBoSW5zdGFuY2UsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIExWRVFOQl9QYXJhbXNfdCAgICAgKnBQYXJhbXMpCi17Ci0KLSAgICBMVkVRTkJfSW5zdGFuY2VfdCAgICAqcEluc3RhbmNlID0oTFZFUU5CX0luc3RhbmNlX3QgICopaEluc3RhbmNlOwotCi0gICAvKgotICAgICAqIENoZWNrIGZvciBlcnJvciBjb25kaXRpb25zCi0gICAgICovCi0gICAgaWYoKGhJbnN0YW5jZSA9PSBMVk1fTlVMTCkgfHwgKHBQYXJhbXMgPT0gTFZNX05VTEwpKQotICAgIHsKLSAgICAgICAgcmV0dXJuIExWRVFOQl9OVUxMQUREUkVTUzsKLSAgICB9Ci0KLSAgICAqcFBhcmFtcyA9IHBJbnN0YW5jZS0+UGFyYW1zOwotCi0gICAgcmV0dXJuKExWRVFOQl9TVUNDRVNTKTsKLX0KLQotCi0vKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotLyogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qIEZVTkNUSU9OOiAgICAgICAgICAgICAgICAgTFZFUU5CX0dldENhcGFiaWxpdGllcyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogREVTQ1JJUFRJT046ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICBHZXQgdGhlIE4tQmFuZCBlcXVhbGlzZXIgY2FwYWJpbGl0aWVzLiBUaGUgY3VycmVudCBjYXBhYmlsaXRpZXMgYXJlIHJldHVybmVkICAgICovCi0vKiAgdmlhIHRoZSBwb2ludGVyLiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qIFBBUkFNRVRFUlM6ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgaEluc3RhbmNlICAgICAgICAgICAgICAgIEluc3RhbmNlIGhhbmRsZSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogIHBDYXBhYmlsaXRpZXMgICAgICAgICAgICBQb2ludGVyIHRvIGFuIGVtcHR5IGNhcGFiaWxpdHkgc3RydWN0dXJlICAgICAgICAgICAgICAgKi8KLS8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiBSRVRVUk5TOiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogIExWRVFOQl9TdWNjZXNzICAgICAgICAgICBTdWNjZWVkcyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICBMVkVRTkJfTlVMTEFERFJFU1MgICAgICAgaEluc3RhbmNlIG9yIHBDYXBhYmlsaXRpZXMgaXMgTlVMTCAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogTk9URVM6ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICAxLiAgVGhpcyBmdW5jdGlvbiBtYXkgYmUgaW50ZXJydXB0ZWQgYnkgdGhlIExWRVFOQl9Qcm9jZXNzIGZ1bmN0aW9uICAgICAgICAgICAgICovCi0vKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLQotTFZFUU5CX1JldHVyblN0YXR1c19lbiBMVkVRTkJfR2V0Q2FwYWJpbGl0aWVzKExWRVFOQl9IYW5kbGVfdCAgICAgICAgICAgaEluc3RhbmNlLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIExWRVFOQl9DYXBhYmlsaXRpZXNfdCAgICAgKnBDYXBhYmlsaXRpZXMpCi17Ci0KLSAgICBMVkVRTkJfSW5zdGFuY2VfdCAgICAqcEluc3RhbmNlID0oTFZFUU5CX0luc3RhbmNlX3QgICopaEluc3RhbmNlOwotCi0gICAgaWYoKGhJbnN0YW5jZSA9PSBMVk1fTlVMTCkgfHwgKHBDYXBhYmlsaXRpZXMgPT0gTFZNX05VTEwpKQotICAgIHsKLSAgICAgICAgcmV0dXJuIExWRVFOQl9OVUxMQUREUkVTUzsKLSAgICB9Ci0KLSAgICAqcENhcGFiaWxpdGllcyA9IHBJbnN0YW5jZS0+Q2FwYWJpbGl0aWVzOwotCi0gICAgcmV0dXJuKExWRVFOQl9TVUNDRVNTKTsKLX0KLQotCi0vKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotLyogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qIEZVTkNUSU9OOiAgICAgICAgICAgIExWRVFOQl9TZXRGaWx0ZXJzICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogREVTQ1JJUFRJT046ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICBTZXRzIHRoZSBmaWx0ZXIgdHlwZSBiYXNlZCBvbiB0aGUgZGVmaW5pdGlvbi4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogUEFSQU1FVEVSUzogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICBwSW5zdGFuY2UgICAgICAgICAgIFBvaW50ZXIgdG8gdGhlIGluc3RhbmNlICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgcFBhcmFtcyAgICAgICAgICAgICBJbml0aWFsaXNhdGlvbiBwYXJhbWV0ZXJzICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qIFJFVFVSTlM6ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgdm9pZCAgICAgICAgICAgICAgICBOb3RoaW5nICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qIE5PVEVTOiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgMS4gVG8gc2VsZWN0IHRoZSBiaXF1YWQgdHlwZSB0aGUgZm9sbG93IHJ1bGVzIGFyZSBhcHBsaWVkOiAgICAgICAgICAgICAgICAgICAgICAqLwotLyogICAgICAgICAgRG91YmxlIHByZWNpc2lvbiAgICBpZiAoZmMgPD0gZnMvMTEwKSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICAgICAgICAgIERvdWJsZSBwcmVjaXNpb24gICAgaWYgKGZzLzExMCA8IGZjIDwgZnMvODUpICYgKFE+MykgICAgICAgICAgICAgICAgICAgICovCi0vKiAgICAgICAgICBTaW5nbGUgcHJlY2lzaW9uICAgIG90aGVyd2lzZSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0KLXZvaWQgICAgTFZFUU5CX1NldEZpbHRlcnMoTFZFUU5CX0luc3RhbmNlX3QgICAgICpwSW5zdGFuY2UsCi0gICAgICAgICAgICAgICAgICAgICAgICAgIExWRVFOQl9QYXJhbXNfdCAgICAgICAqcFBhcmFtcykKLXsKLQotICAgIGV4dGVybiBjb25zdCBMVk1fVUlOVDE2ICAgTFZFUU5CX1NhbXBsZVJhdGVUYWJbXTsgICAgICAgICAgIC8qIFNhbXBsZSByYXRlIHRhYmxlICovCi0gICAgTFZNX1VJTlQxNiAgICAgICAgICBpOyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLyogRmlsdGVyIGJhbmQgaW5kZXggKi8KLSAgICBMVk1fVUlOVDMyICAgICAgICAgIGZzID0gKExWTV9VSU5UMzIpTFZFUU5CX1NhbXBsZVJhdGVUYWJbKExWTV9VSU5UMTYpcFBhcmFtcy0+U2FtcGxlUmF0ZV07ICAvKiBTYW1wbGUgcmF0ZSAqLwotICAgIExWTV9VSU5UMzIgICAgICAgICAgZmM7ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8qIEZpbHRlciBjZW50cmUgZnJlcXVlbmN5ICovCi0gICAgTFZNX0lOVDE2ICAgICAgICAgICBRRmFjdG9yOyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLyogRmlsdGVyIFEgZmFjdG9yICovCi0KLQotICAgIHBJbnN0YW5jZS0+TkJhbmRzID0gcFBhcmFtcy0+TkJhbmRzOwotCi0gICAgZm9yIChpPTA7IGk8cFBhcmFtcy0+TkJhbmRzOyBpKyspCi0gICAgewotICAgICAgICAvKgotICAgICAgICAgKiBHZXQgdGhlIGZpbHRlciBzZXR0aW5ncwotICAgICAgICAgKi8KLSAgICAgICAgZmMgPSAoTFZNX1VJTlQzMilwUGFyYW1zLT5wQmFuZERlZmluaXRpb25baV0uRnJlcXVlbmN5OyAgICAgLyogR2V0IHRoZSBiYW5kIGNlbnRyZSBmcmVxdWVuY3kgKi8KLSAgICAgICAgUUZhY3RvciA9IChMVk1fSU5UMTYpcFBhcmFtcy0+cEJhbmREZWZpbml0aW9uW2ldLlFGYWN0b3I7ICAgLyogR2V0IHRoZSBiYW5kIFEgZmFjdG9yICovCi0KLQotICAgICAgICAvKgotICAgICAgICAgKiBGb3IgZWFjaCBmaWx0ZXIgc2V0IHRoZSB0eXBlIG9mIGJpcXVhZCByZXF1aXJlZAotICAgICAgICAgKi8KLSAgICAgICAgcEluc3RhbmNlLT5wQmlxdWFkVHlwZVtpXSA9IExWRVFOQl9TaW5nbGVQcmVjaXNpb247ICAgICAgICAgLyogRGVmYXVsdCB0byBzaW5nbGUgcHJlY2lzaW9uICovCi0gICAgICAgIGlmICgoZmMgPDwgMTUpIDw9IChMT1dfRlJFUSAqIGZzKSkKLSAgICAgICAgewotICAgICAgICAgICAgLyoKLSAgICAgICAgICAgICAqIGZjIDw9IGZzLzExMAotICAgICAgICAgICAgICovCi0gICAgICAgICAgICBwSW5zdGFuY2UtPnBCaXF1YWRUeXBlW2ldID0gTFZFUU5CX0RvdWJsZVByZWNpc2lvbjsKLSAgICAgICAgfQotICAgICAgICBlbHNlIGlmICgoKGZjIDw8IDE1KSA8PSAoSElHSF9GUkVRICogZnMpKSAmJiAoUUZhY3RvciA+IDMwMCkpCi0gICAgICAgIHsKLSAgICAgICAgICAgIC8qCi0gICAgICAgICAgICAgKiAoZnMvMTEwIDwgZmMgPCBmcy84NSkgJiAoUT4zKQotICAgICAgICAgICAgICovCi0gICAgICAgICAgICBwSW5zdGFuY2UtPnBCaXF1YWRUeXBlW2ldID0gTFZFUU5CX0RvdWJsZVByZWNpc2lvbjsKLSAgICAgICAgfQotCi0KLSAgICAgICAgLyoKLSAgICAgICAgICogQ2hlY2sgZm9yIG91dCBvZiByYW5nZSBmcmVxdWVuY2llcwotICAgICAgICAgKi8KLSAgICAgICAgaWYgKGZjID4gKGZzID4+IDEpKQotICAgICAgICB7Ci0gICAgICAgICAgICBwSW5zdGFuY2UtPnBCaXF1YWRUeXBlW2ldID0gTFZFUU5CX091dE9mUmFuZ2U7Ci0gICAgICAgIH0KLQotCi0gICAgICAgIC8qCi0gICAgICAgICAqIENvcHkgdGhlIGZpbHRlciBkZWZpbml0aW9uIHRvIHBlcnNpc3RhbnQgbWVtb3J5Ci0gICAgICAgICAqLwotICAgICAgICBwSW5zdGFuY2UtPnBCYW5kRGVmaW5pdGlvbnNbaV0gPSBwUGFyYW1zLT5wQmFuZERlZmluaXRpb25baV07Ci0KLSAgICB9Ci19Ci0KLQotLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLS8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiBGVU5DVElPTjogICAgICAgICAgICBMVkVRTkJfU2V0Q29lZmZpY2llbnRzICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qIERFU0NSSVBUSU9OOiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgU2V0cyB0aGUgZmlsdGVyIGNvZWZmaWNpZW50cy4gVGhpcyB1c2VzIHRoZSB0eXBlIHRvIHNlbGVjdCBzaW5nbGUgb3IgZG91YmxlICAgICAqLwotLyogIHByZWNpc2lvbiBjb2VmZmljaWVudHMuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiBQQVJBTUVURVJTOiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogIHBJbnN0YW5jZSAgICAgICAgICAgUG9pbnRlciB0byB0aGUgaW5zdGFuY2UgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICBwUGFyYW1zICAgICAgICAgICAgIEluaXRpYWxpc2F0aW9uIHBhcmFtZXRlcnMgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLQotdm9pZCAgICBMVkVRTkJfU2V0Q29lZmZpY2llbnRzKExWRVFOQl9JbnN0YW5jZV90ICAgICAqcEluc3RhbmNlKQotewotCi0gICAgTFZNX1VJTlQxNiAgICAgICAgICAgICAgaTsgICAgICAgICAgICAgICAgICAgICAgICAgIC8qIEZpbHRlciBiYW5kIGluZGV4ICovCi0gICAgTFZFUU5CX0JpcXVhZFR5cGVfZW4gICAgQmlxdWFkVHlwZTsgICAgICAgICAgICAgICAgIC8qIEZpbHRlciBiaXF1YWQgdHlwZSAqLwotCi0KLSAgICAvKgotICAgICAqIFNldCB0aGUgY29lZmZpY2llbnRzIGZvciBlYWNoIGJhbmQgYnkgdGhlIGluaXQgZnVuY3Rpb24KLSAgICAgKi8KLSAgICBmb3IgKGk9MDsgaTxwSW5zdGFuY2UtPlBhcmFtcy5OQmFuZHM7IGkrKykKLSAgICB7Ci0KLSAgICAgICAgLyoKLSAgICAgICAgICogQ2hlY2sgYmFuZCB0eXBlIGZvciBjb3JyZWN0IGluaXRpYWxpc2F0aW9uIG1ldGhvZCBhbmQgcmVjYWxjdWxhdGUgdGhlIGNvZWZmaWNpZW50cwotICAgICAgICAgKi8KLSAgICAgICAgQmlxdWFkVHlwZSA9IHBJbnN0YW5jZS0+cEJpcXVhZFR5cGVbaV07Ci0gICAgICAgIHN3aXRjaCAgKEJpcXVhZFR5cGUpCi0gICAgICAgIHsKLSAgICAgICAgICAgIGNhc2UgICAgTFZFUU5CX0RvdWJsZVByZWNpc2lvbjoKLSAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICBQS19DMzJfQ29lZnNfdCAgICAgIENvZWZmaWNpZW50czsKLQotICAgICAgICAgICAgICAgIC8qCi0gICAgICAgICAgICAgICAgICogQ2FsY3VsYXRlIHRoZSBkb3VibGUgcHJlY2lzaW9uIGNvZWZmaWNpZW50cwotICAgICAgICAgICAgICAgICAqLwotICAgICAgICAgICAgICAgIExWRVFOQl9Eb3VibGVQcmVjQ29lZnMoKExWTV9VSU5UMTYpcEluc3RhbmNlLT5QYXJhbXMuU2FtcGxlUmF0ZSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICZwSW5zdGFuY2UtPnBCYW5kRGVmaW5pdGlvbnNbaV0sCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmQ29lZmZpY2llbnRzKTsKLQotICAgICAgICAgICAgICAgIC8qCi0gICAgICAgICAgICAgICAgICogU2V0IHRoZSBjb2VmZmljaWVudHMKLSAgICAgICAgICAgICAgICAgKi8KLSAgICAgICAgICAgICAgICBQS18ySV9EMzJGMzJDbGxHc3NfVFJDX1dSQV8wMV9Jbml0KCZwSW5zdGFuY2UtPnBFUU5CX0ZpbHRlclN0YXRlW2ldLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJnBJbnN0YW5jZS0+cEVRTkJfVGFwc1tpXSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICZDb2VmZmljaWVudHMpOwotICAgICAgICAgICAgICAgIGJyZWFrOwotICAgICAgICAgICAgfQotCi0gICAgICAgICAgICBjYXNlICAgIExWRVFOQl9TaW5nbGVQcmVjaXNpb246Ci0gICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgUEtfQzE2X0NvZWZzX3QgICAgICBDb2VmZmljaWVudHM7Ci0KLSAgICAgICAgICAgICAgICAvKgotICAgICAgICAgICAgICAgICAqIENhbGN1bGF0ZSB0aGUgc2luZ2xlIHByZWNpc2lvbiBjb2VmZmljaWVudHMKLSAgICAgICAgICAgICAgICAgKi8KLSAgICAgICAgICAgICAgICBMVkVRTkJfU2luZ2xlUHJlY0NvZWZzKChMVk1fVUlOVDE2KXBJbnN0YW5jZS0+UGFyYW1zLlNhbXBsZVJhdGUsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmcEluc3RhbmNlLT5wQmFuZERlZmluaXRpb25zW2ldLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJkNvZWZmaWNpZW50cyk7Ci0KLSAgICAgICAgICAgICAgICAvKgotICAgICAgICAgICAgICAgICAqIFNldCB0aGUgY29lZmZpY2llbnRzCi0gICAgICAgICAgICAgICAgICovCi0gICAgICAgICAgICAgICAgUEtfMklfRDMyRjMyQ3NzR3NzX1RSQ19XUkFfMDFfSW5pdCgmcEluc3RhbmNlLT5wRVFOQl9GaWx0ZXJTdGF0ZVtpXSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICZwSW5zdGFuY2UtPnBFUU5CX1RhcHNbaV0sCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmQ29lZmZpY2llbnRzKTsKLSAgICAgICAgICAgICAgICBicmVhazsKLSAgICAgICAgICAgIH0KLSAgICAgICAgICAgIGRlZmF1bHQ6Ci0gICAgICAgICAgICAgICAgYnJlYWs7Ci0gICAgICAgIH0KLSAgICB9Ci0KLX0KLQotCi0vKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotLyogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qIEZVTkNUSU9OOiAgICAgICAgICAgIExWRVFOQl9DbGVhckZpbHRlckhpc3RvcnkgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogREVTQ1JJUFRJT046ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICBDbGVhcnMgdGhlIGZpbHRlciBkYXRhIGhpc3RvcnkgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogUEFSQU1FVEVSUzogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICBwSW5zdGFuY2UgICAgICAgICAgIFBvaW50ZXIgdG8gdGhlIGluc3RhbmNlICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLQotdm9pZCAgICBMVkVRTkJfQ2xlYXJGaWx0ZXJIaXN0b3J5KExWRVFOQl9JbnN0YW5jZV90ICAgICAqcEluc3RhbmNlKQotewotICAgIExWTV9JTlQxNiAgICAgICAqcFRhcEFkZHJlc3M7Ci0gICAgTFZNX0lOVDE2ICAgICAgIE51bVRhcHM7Ci0KLQotICAgIHBUYXBBZGRyZXNzID0gKExWTV9JTlQxNiAqKXBJbnN0YW5jZS0+cEVRTkJfVGFwczsKLSAgICBOdW1UYXBzICAgICA9IChMVk1fSU5UMTYpKChwSW5zdGFuY2UtPkNhcGFiaWxpdGllcy5NYXhCYW5kcyAqIHNpemVvZihCaXF1YWRfMklfT3JkZXIyX1RhcHNfdCkpL3NpemVvZihMVk1fSU5UMTYpKTsKLQotICAgIGlmIChOdW1UYXBzICE9IDApCi0gICAgewotICAgICAgICBMb2FkQ29uc3RfMTYoMCwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvKiBDbGVhciB0aGUgaGlzdG9yeSwgdmFsdWUgMCAqLwotICAgICAgICAgICAgICAgICAgICAgcFRhcEFkZHJlc3MsICAgICAgICAgICAgICAgICAgICAgICAvKiBEZXN0aW5hdGlvbiAqLwotICAgICAgICAgICAgICAgICAgICAgTnVtVGFwcyk7ICAgICAgICAgICAgICAgICAgICAgICAgICAvKiBOdW1iZXIgb2Ygd29yZHMgKi8KLSAgICB9Ci19Ci0KLQotLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0vKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qIEZVTkNUSU9OOiAgICAgICAgICAgICAgICBMVkVRTkJfQ29udHJvbCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiBERVNDUklQVElPTjogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICBTZXRzIG9yIGNoYW5nZXMgdGhlIExpZmVWaWJlcyBtb2R1bGUgcGFyYW1ldGVycy4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiBQQVJBTUVURVJTOiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICBoSW5zdGFuY2UgICAgICAgICAgICAgICBJbnN0YW5jZSBoYW5kbGUgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogIHBQYXJhbXMgICAgICAgICAgICAgICAgIFBvaW50ZXIgdG8gYSBwYXJhbWV0ZXIgc3RydWN0dXJlICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qIFJFVFVSTlM6ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogIExWRVFOQl9TdWNjZXNzICAgICAgICAgIEFsd2F5cyBzdWNjZWVkcyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgTFZFUU5CX05VTExBRERSRVNTICAgICAgSW5zdGFuY2Ugb3IgcFBhcmFtcyAgaXMgTlVMTCBwb2ludGVyICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICBMVkVRTkJfTlVMTEFERFJFU1MgICAgICBOVUxMIGFkZHJlc3MgZm9yIHRoZSBlcXVhbGlzZXIgZmlsdGVyIGRlZmluaXRpb25zIGFuZCB0aGUgICAqLwotLyogICAgICAgICAgICAgICAgICAgICAgICAgIG51bWJlciBvZiBiYW5kcyBpcyBub24temVybyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qIE5PVEVTOiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogIDEuICBUaGlzIGZ1bmN0aW9uIG1heSBiZSBpbnRlcnJ1cHRlZCBieSB0aGUgTFZFUU5CX1Byb2Nlc3MgZnVuY3Rpb24gICAgICAgICAgICAgICAgICovCi0vKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotCi1MVkVRTkJfUmV0dXJuU3RhdHVzX2VuIExWRVFOQl9Db250cm9sKExWRVFOQl9IYW5kbGVfdCAgICAgICAgaEluc3RhbmNlLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBMVkVRTkJfUGFyYW1zX3QgICAgICAgICpwUGFyYW1zKQotewotCi0gICAgTFZFUU5CX0luc3RhbmNlX3QgICAgKnBJbnN0YW5jZSA9IChMVkVRTkJfSW5zdGFuY2VfdCAgKiloSW5zdGFuY2U7Ci0gICAgTFZNX0lOVDE2ICAgICAgICAgICAgYkNoYW5nZSAgICA9IExWTV9GQUxTRTsKLSAgICBMVk1fSU5UMTYgICAgICAgICAgICBpID0gMDsKLSAgICBMVkVRTkJfTW9kZV9lbiAgICAgICBPcGVyYXRpbmdNb2RlU2F2ZSA7Ci0KLSAgICAvKgotICAgICAqIENoZWNrIGZvciBlcnJvciBjb25kaXRpb25zCi0gICAgIC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AgICAgLyoKLSAgICAgICAgICogSWYgdGhlIHNhbXBsZSByYXRlIGhhcyBjaGFuZ2VkIGNsZWFyIHRoZSBoaXN0b3J5Ci0gICAgICAgICAqLwotICAgICAgICBpZiAocEluc3RhbmNlLT5QYXJhbXMuU2FtcGxlUmF0ZSAhPSBwUGFyYW1zLT5TYW1wbGVSYXRlKQotICAgICAgICB7Ci0gICAgICAgICAgICBMVkVRTkJfQ2xlYXJGaWx0ZXJIaXN0b3J5KHBJbnN0YW5jZSk7ICAgICAgICAgICAvKiBDbGVhciB0aGUgaGlzdG9yeSAqLwotICAgICAgICB9Ci0KLSAgICAgICAgLyoKLSAgICAgICAgICogVXBkYXRlIHRoZSBpbnN0YW5jZSBwYXJhbWV0ZXJzCi0gICAgICAgICAqLwotICAgICAgICBwSW5zdGFuY2UtPlBhcmFtcyA9ICpwUGFyYW1zOwotCi0KLSAgICAgICAgLyoKLSAgICAgICAgICogUmVzZXQgdGhlIGZpbHRlcnMgZXhjZXB0IGlmIHRoZSBhbGdvIGlzIHN3aXRjaGVkIG9mZgotICAgICAgICAgKi8KLSAgICAgICAgaWYocFBhcmFtcy0+T3BlcmF0aW5nTW9kZSAhPSBMVkVRTkJfQllQQVNTKXsKLSAgICAgICAgICAgIC8qCi0gICAgICAgICAgICAgKiBSZXNldCB0aGUgZmlsdGVycyBhcyBhbGwgcGFyYW1ldGVycyBjb3VsZCBoYXZlIGNoYW5nZWQKLSAgICAgICAgICAgICAqLwotICAgICAgICAgICAgTFZFUU5CX1NldEZpbHRlcnMocEluc3RhbmNlLCAgICAgICAgICAgICAgICAgICAgICAgIC8qIEluc3RhbmNlIHBvaW50ZXIgKi8KLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBQYXJhbXMpOyAgICAgICAgICAgICAgICAgICAgICAgICAvKiBOZXcgcGFyYW1ldGVycyAqLwotCi0gICAgICAgICAgICAvKgotICAgICAgICAgICAgICogVXBkYXRlIHRoZSBmaWx0ZXJzCi0gICAgICAgICAgICAgKi8KLSAgICAgICAgICAgIExWRVFOQl9TZXRDb2VmZmljaWVudHMocEluc3RhbmNlKTsgICAgICAgICAgICAgICAgICAvKiBJbnN0YW5jZSBwb2ludGVyICovCi0gICAgICAgIH0KLQotICAgICAgICBpZihwUGFyYW1zLT5PcGVyYXRpbmdNb2RlICE9IE9wZXJhdGluZ01vZGVTYXZlKQotICAgICAgICB7Ci0gICAgICAgICAgICBpZihwUGFyYW1zLT5PcGVyYXRpbmdNb2RlID09IExWRVFOQl9PTikKLSAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICBMVkNfTWl4ZXJfU2V0VGFyZ2V0KCZwSW5zdGFuY2UtPkJ5cGFzc01peGVyLk1peGVyU3RyZWFtWzBdLExWTV9NQVhJTlRfMTYpOwotICAgICAgICAgICAgICAgIExWQ19NaXhlcl9TZXRUYXJnZXQoJnBJbnN0YW5jZS0+QnlwYXNzTWl4ZXIuTWl4ZXJTdHJlYW1bMV0sMCk7Ci0KLSAgICAgICAgICAgICAgICBwSW5zdGFuY2UtPkJ5cGFzc01peGVyLk1peGVyU3RyZWFtWzBdLkNhbGxiYWNrU2V0ICAgICAgICA9IDE7Ci0gICAgICAgICAgICAgICAgcEluc3RhbmNlLT5CeXBhc3NNaXhlci5NaXhlclN0cmVhbVsxXS5DYWxsYmFja1NldCAgICAgICAgPSAxOwotICAgICAgICAgICAgfQotICAgICAgICAgICAgZWxzZQotICAgICAgICAgICAgewotICAgICAgICAgICAgICAgIC8qIFN0YXkgb24gdGhlIE9OIG9wZXJhdGluZyBtb2RlIHVudGlsIHRoZSB0cmFuc2l0aW9uIGlzIGRvbmUgKi8KLSAgICAgICAgICAgICAgICBwSW5zdGFuY2UtPlBhcmFtcy5PcGVyYXRpbmdNb2RlID0gTFZFUU5CX09OOwotCi0gICAgICAgICAgICAgICAgTFZDX01peGVyX1NldFRhcmdldCgmcEluc3RhbmNlLT5CeXBhc3NNaXhlci5NaXhlclN0cmVhbVswXSwwKTsKLSAgICAgICAgICAgICAgICBMVkNfTWl4ZXJfU2V0VGFyZ2V0KCZwSW5zdGFuY2UtPkJ5cGFzc01peGVyLk1peGVyU3RyZWFtWzFdLExWTV9NQVhJTlRfMTYpOwotICAgICAgICAgICAgICAgIHBJbnN0YW5jZS0+QnlwYXNzTWl4ZXIuTWl4ZXJTdHJlYW1bMF0uQ2FsbGJhY2tTZXQgICAgICAgID0gMTsKLSAgICAgICAgICAgICAgICBwSW5zdGFuY2UtPkJ5cGFzc01peGVyLk1peGVyU3RyZWFtWzFdLkNhbGxiYWNrU2V0ICAgICAgICA9IDE7Ci0gICAgICAgICAgICB9Ci0gICAgICAgICAgICBMVkNfTWl4ZXJfVmFyU2xvcGVfU2V0VGltZUNvbnN0YW50KCZwSW5zdGFuY2UtPkJ5cGFzc01peGVyLk1peGVyU3RyZWFtWzBdLExWRVFOQl9CWVBBU1NfTUlYRVJfVEMsKExWTV9Gc19lbilwUGFyYW1zLT5TYW1wbGVSYXRlLDIpOwotICAgICAgICAgICAgTFZDX01peGVyX1ZhclNsb3BlX1NldFRpbWVDb25zdGFudCgmcEluc3RhbmNlLT5CeXBhc3NNaXhlci5NaXhlclN0cmVhbVsxXSxMVkVRTkJfQllQQVNTX01JWEVSX1RDLChMVk1fRnNfZW4pcFBhcmFtcy0+U2FtcGxlUmF0ZSwyKTsKLQotICAgICAgICAgICAgcEluc3RhbmNlLT5iSW5PcGVyYXRpbmdNb2RlVHJhbnNpdGlvbiA9IExWTV9UUlVFOwotICAgICAgICB9Ci0KLSAgICB9Ci0gICAgcmV0dXJuKExWRVFOQl9TVUNDRVNTKTsKLX0KLQotCi0vKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLS8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogRlVOQ1RJT046ICAgICAgICAgICAgICAgIExWRVFOQl9CeXBhc3NNaXhlckNhbGxCYWNrICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qIERFU0NSSVBUSU9OOiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogIENhbGxCYWNrIGZ1bmN0aW9uIG9mIHRoZSBtaXhlciAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgdHJhbnNpdGlvbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi1MVk1fSU5UMzIgTFZFUU5CX0J5cGFzc01peGVyQ2FsbEJhY2sgKHZvaWQqIGhJbnN0YW5jZSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdm9pZCAqcEdlbmVyYWxQdXJwb3NlLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBMVk1fSU5UMTYgQ2FsbGJhY2tQYXJhbSkKLXsKLSAgICBMVkVRTkJfSW5zdGFuY2VfdCAgICAgICpwSW5zdGFuY2UgPShMVkVRTkJfSW5zdGFuY2VfdCAgKiloSW5zdGFuY2U7Ci0gICAgTFZNX0NhbGxiYWNrICAgICAgICAgICAgQ2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KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLS8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogIEluY2x1ZGVzICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotCi0jaW5jbHVkZSAiTFZFUU5CLmgiCi0jaW5jbHVkZSAiTFZFUU5CX1ByaXZhdGUuaCIKLSNpbmNsdWRlICJJbnN0QWxsb2MuaCIKLQotLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0vKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qIEZVTkNUSU9OOiAgICAgICAgICAgICAgICBMVkVRTkJfTWVtb3J5ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiBERVNDUklQVElPTjogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICBUaGlzIGZ1bmN0aW9uIGlzIHVzZWQgZm9yIG1lbW9yeSBhbGxvY2F0aW9uIGFuZCBmcmVlLiBJdCBjYW4gYmUgY2FsbGVkIGluICAgICAgICAgICAqLwotLyogIHR3byB3YXlzOiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICAgICAgaEluc3RhbmNlID0gTlVMTCAgICAgICAgICAgICAgICBSZXR1cm5zIHRoZSBtZW1vcnkgcmVxdWlyZW1lbnRzICAgICAgICAgICAgICAgICAqLwotLyogICAgICBoSW5zdGFuY2UgPSBJbnN0YW5jZSBoYW5kbGUgICAgIFJldHVybnMgdGhlIG1lbW9yeSByZXF1aXJlbWVudHMgYW5kICAgICAgICAgICAgICovCi0vKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYWxsb2NhdGVkIGJhc2UgYWRkcmVzc2VzIGZvciB0aGUgaW5zdGFuY2UgICAgICAgKi8KLS8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogIFdoZW4gdGhpcyBmdW5jdGlvbiBpcyBjYWxsZWQgZm9yIG1lbW9yeSBhbGxvY2F0aW9uIChoSW5zdGFuY2U9TlVMTCkgdGhlIG1lbW9yeSAgICAgICovCi0vKiAgYmFzZSBhZGRyZXNzIHBvaW50ZXJzIGFyZSBOVUxMIG9uIHJldHVybi4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogIFdoZW4gdGhlIGZ1bmN0aW9uIGlzIGNhbGxlZCBmb3IgZnJlZSAoaEluc3RhbmNlID0gSW5zdGFuY2UgSGFuZGxlKSB0aGUgbWVtb3J5ICAgICAgICovCi0vKiAgdGFibGUgcmV0dXJucyB0aGUgYWxsb2NhdGVkIG1lbW9yeSBhbmQgYmFzZSBhZGRyZXNzZXMgdXNlZCBkdXJpbmcgaW5pdGlhbGlzYXRpb24uICAgKi8KLS8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogUEFSQU1FVEVSUzogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgaEluc3RhbmNlICAgICAgICAgICAgICAgSW5zdGFuY2UgSGFuZGxlICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICBwTWVtb3J5VGFibGUgICAgICAgICAgICBQb2ludGVyIHRvIGFuIGVtcHR5IG1lbW9yeSBkZWZpbml0aW9uIHRhYmxlICAgICAgICAgICAgICAgICAqLwotLyogIHBDYXBhYmlsaXRpZXMgICAgICAgICAgIFBvaW50ZXIgdG8gdGhlIGluc3RhbmNlIGNhcGFiaWxpdGllcyAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qIFJFVFVSTlM6ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogIExWRVFOQl9TVUNDRVNTICAgICAgICAgIFN1Y2NlZWRlZCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgTFZFUU5CX05VTExBRERSRVNTICAgICAgV2hlbiBhbnkgb2YgcE1lbW9yeVRhYmxlIGFuZCBwQ2FwYWJpbGl0aWVzIGlzIE5VTEwgYWRkcmVzcyAgKi8KLS8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogTk9URVM6ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgMS4gIFRoaXMgZnVuY3Rpb24gbWF5IGJlIGludGVycnVwdGVkIGJ5IHRoZSBMVkVRTkJfUHJvY2VzcyBmdW5jdGlvbiAgICAgICAgICAgICAgICAgKi8KLS8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0KLUxWRVFOQl9SZXR1cm5TdGF0dXNfZW4gTFZFUU5CX01lbW9yeShMVkVRTkJfSGFuZGxlX3QgICAgICAgICAgICBoSW5zdGFuY2UsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTFZFUU5CX01lbVRhYl90ICAgICAgICAgICAgKnBNZW1vcnlUYWJsZSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBMVkVRTkJfQ2FwYWJpbGl0aWVzX3QgICAgICAqcENhcGFiaWxpdGllcykKLXsKLQotICAgIElOU1RfQUxMT0MgICAgICAgICAgQWxsb2NNZW07Ci0gICAgTFZFUU5CX0luc3RhbmNlX3QgICAqcEluc3RhbmNlID0gKExWRVFOQl9JbnN0YW5jZV90ICopaEluc3RhbmNlOwotCi0KLSAgICBpZigocE1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i0KLSAgICAgICAgLyoKLSAgICAgICAgICogUGVyc2lzdGFudCBkYXRhIG1lbW9yeQotICAgICAgICAgKi8KLSAgICAgICAgSW5zdEFsbG9jX0luaXQoJkFsbG9jTWVtLAotICAgICAgICAgICAgICAgICAgICAgICBMVk1fTlVMTCk7Ci0gICAgICAgIEluc3RBbGxvY19BZGRNZW1iZXIoJkFsbG9jTWVtLCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8qIExvdyBwYXNzIGZpbHRlciAqLwotICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNpemVvZihCaXF1YWRfMklfT3JkZXIyX1RhcHNfdCkpOwotICAgICAgICBJbnN0QWxsb2NfQWRkTWVtYmVyKCZBbGxvY01lbSwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvKiBIaWdoIHBhc3MgZmlsdGVyICovCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgc2l6ZW9mKEJpcXVhZF8ySV9PcmRlcjJfVGFwc190KSk7Ci0gICAgICAgIEluc3RBbGxvY19BZGRNZW1iZXIoJkFsbG9jTWVtLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgIChwQ2FwYWJpbGl0aWVzLT5NYXhCYW5kcyAqIHNpemVvZihCaXF1YWRfMklfT3JkZXIyX1RhcHNfdCkpKTsgLyogRXF1YWxpc2VyIEJpcXVhZCBUYXBzICovCi0gICAgICAgIEluc3RBbGxvY19BZGRNZW1iZXIoJkFsbG9jTWVtLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgIChwQ2FwYWJpbGl0aWVzLT5NYXhCYW5kcyAqIHNpemVvZihMVkVRTkJfQmFuZERlZl90KSkpOyAgICAgICAgLyogRmlsdGVyIGRlZmluaXRpb25zICovCi0gICAgICAgIEluc3RBbGxvY19BZGRNZW1iZXIoJkFsbG9jTWVtLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgIChwQ2FwYWJpbGl0aWVzLT5NYXhCYW5kcyAqIHNpemVvZihMVkVRTkJfQmlxdWFkVHlwZV9lbikpKTsgICAgLyogQmlxdWFkIHR5cGVzICovCi0gICAgICAgIHBNZW1vcnlUYWJsZS0+UmVnaW9uW0xWRVFOQl9NRU1SRUdJT05fUEVSU0lTVEVOVF9EQVRBXS5TaXplICAgICAgICAgPSBJbnN0QWxsb2NfR2V0VG90YWwoJkFsbG9jTWVtKTsKLSAgICAgICAgcE1lbW9yeVRhYmxlLT5SZWdpb25bTFZFUU5CX01FTVJFR0lPTl9QRVJTSVNURU5UX0RBVEFdLkFsaWdubWVudCAgICA9IExWRVFOQl9EQVRBX0FMSUdOOwotICAgICAgICBwTWVtb3J5VGFibGUtPlJlZ2lvbltMVkVRTkJfTUVNUkVHSU9OX1BFUlNJU1RFTlRfREFUQV0uVHlwZSAgICAgICAgID0gTFZFUU5CX1BFUlNJU1RFTlRfREFUQTsKLSAgICAgICAgcE1lbW9yeVRhYmxlLT5SZWdpb25bTFZFUU5CX01FTVJFR0lPTl9QRVJTSVNURU5UX0RBVEFdLnBCYXNlQWRkcmVzcyA9IExWTV9OVUxMOwotCi0gICAgICAgIC8qCi0gICAgICAgICAqIFBlcnNpc3RhbnQgY29lZmZpY2llbnQgbWVtb3J5Ci0gICAgICAgICAqLwotICAgICAgICBJbnN0QWxsb2NfSW5pdCgmQWxsb2NNZW0sCi0gICAgICAgICAgICAgICAgICAgICAgIExWTV9OVUxMKTsKLSAgICAgICAgSW5zdEFsbG9jX0FkZE1lbWJlcigmQWxsb2NNZW0sICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLyogTG93IHBhc3MgZmlsdGVyICovCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgc2l6ZW9mKEJpcXVhZF9JbnN0YW5jZV90KSk7Ci0gICAgICAgIEluc3RBbGxvY19BZGRNZW1iZXIoJkFsbG9jTWVtLCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8qIEhpZ2ggcGFzcyBmaWx0ZXIgKi8KLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBzaXpl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QlVGRkVSUypzaXplb2YoTFZNX0lOVDE2KSpwQ2FwYWJpbGl0aWVzLT5NYXhCbG9ja1NpemUpOwotICAgICAgICBwTWVtb3J5VGFibGUtPlJlZ2lvbltMVkVRTkJfTUVNUkVHSU9OX1NDUkFUQ0hdLlNpemUgICAgICAgICAgICAgID0gSW5zdEFsbG9jX0dldFRvdGFsKCZBbGxvY01lbSk7Ci0gICAgICAgIHBNZW1vcnlUYWJsZS0+UmVnaW9uW0xWRVFOQl9NRU1SRUdJT05fU0NSQVRDSF0uQWxpZ25tZW50ICAgICAgICAgPSBMVkVRTkJfU0NSQVRDSF9BTElHTjsKLSAgICAgICAgcE1lbW9yeVRhYmxlLT5SZWdpb25bTFZFUU5CX01FTVJFR0lPTl9TQ1JBVENIXS5UeXBlICAgICAgICAgICAgICA9IExWRVFOQl9TQ1JBVENIOwotICAgICAgICBwTWVtb3J5VGFibGUtPlJlZ2lvbltMVkVRTkJfTUVNUkVHSU9OX1NDUkFUQ0hdLnBCYXNlQWRkcmVzcyAgICAgID0gTFZNX05VTEw7Ci0gICAgfQotICAgIGVsc2UKLSAgICB7Ci0gICAgICAgIC8qIFJlYWQgYmFjayBtZW1vcnkgYWxsb2NhdGlvbiB0YWJsZSAqLwotICAgICAgICAqcE1lbW9yeVRhYmxlID0gcEluc3RhbmNlLT5NZW1vcnlUYWJsZTsKLSAgICB9Ci0KLSAgICByZXR1cm4oTFZFUU5CX1NVQ0NFU1MpOwotfQotCi0KLS8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotLyogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiBGVU5DVElPTjogICAgICAgICAgICAgICAgTFZFUU5CX0luaXQgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogREVTQ1JJUFRJT046ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgQ3JlYXRlIGFuZCBpbml0aWFsaXNhdGlvbiBmdW5jdGlvbiBmb3IgdGhlIE4tQmFuZCBlcXVhbGlzZXIgbW9kdWxlICAgICAgICAgICAgICAgICAgKi8KLS8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogIFRoaXMgZnVuY3Rpb24gY2FuIGJlIHVzZWQgdG8gY3JlYXRlIGFuIGFsZ29yaXRobSBpbnN0YW5jZSBieSBjYWxsaW5nIHdpdGggICAgICAgICAgICovCi0vKiAgaEluc3RhbmNlIHNldCB0byBOVUxMLiBJbiB0aGlzIGNhc2UgdGhlIGFsZ29yaXRobSByZXR1cm5zIHRoZSBuZXcgaW5zdGFuY2UgICAgICAgICAgKi8KLS8qICBoYW5kbGUuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgVGhpcyBmdW5jdGlvbiBjYW4gYmUgdXNlZCB0byBmb3JjZSBhIGZ1bGwgcmUtaW5pdGlhbGlzYXRpb24gb2YgdGhlIGFsZ29yaXRobSAgICAgICAgKi8KLS8qICBieSBjYWxsaW5nIHdpdGggaEluc3RhbmNlID0gSW5zdGFuY2UgSGFuZGxlLiBJbiB0aGlzIGNhc2UgdGhlIG1lbW9yeSB0YWJsZSAgICAgICAgICAqLwotLyogIHNob3VsZCBiZSBjb3JyZWN0IGZvciB0aGUgaW5zdGFuY2UsIHRoaXMgY2FuIGJlIGVuc3VyZWQgYnkgY2FsbGluZyB0aGUgZnVuY3Rpb24gICAgICovCi0vKiAgREJFX01lbW9yeSBiZWZvcmUgY2FsbGluZyB0aGlzIGZ1bmN0aW9uLiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogUEFSQU1FVEVSUzogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgaEluc3RhbmNlICAgICAgICAgICAgICAgSW5zdGFuY2UgaGFuZGxlICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICBwTWVtb3J5VGFibGUgICAgICAgICAgICBQb2ludGVyIHRvIHRoZSBtZW1vcnkgZGVmaW5pdGlvbiB0YWJsZSAgICAgICAgICAgICAgICAgICAgICAqLwotLyogIHBDYXBhYmlsaXRpZXMgICAgICAgICAgIFBvaW50ZXIgdG8gdGhlIGluc3RhbmNlIGNhcGFiaWxpdGllcyAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qIFJFVFVSTlM6ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogIExWRVFOQl9TVUNDRVNTICAgICAgICAgIEluaXRpYWxpc2F0aW9uIHN1Y2NlZWRlZCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgTFZFUU5CX05VTExBRERSRVNTICAgICAgICBXaGVuIHBDYXBhYmlsaXRpZXMgb3IgcE1lbW9yeVRhYmxlaXMgb3IgcGhJbnN0YW5jZSBhcmUgTlVMTCAqLwotLyogIExWRVFOQl9OVUxMQUREUkVTUyAgICAgICAgT25lIG9yIG1vcmUgb2YgdGhlIG1lbW9yeSByZWdpb25zIGhhcyBhIE5VTEwgYmFzZSBhZGRyZXNzICAgKi8KLS8qICAgICAgICAgICAgICAgICAgICAgICAgICBwb2ludGVyIGZvciBhIG1lbW9yeSByZWdpb24gd2l0aCBhIG5vbi16ZXJvIHNpemUuICAgICAgICAgICAqLwotLyogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiBOT1RFUzogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICAxLiAgVGhlIGluc3RhbmNlIGhhbmRsZSBpcyB0aGUgcG9pbnRlciB0byB0aGUgYmFzZSBhZGRyZXNzIG9mIHRoZSBmaXJzdCBtZW1vcnkgICAgICAqLwotLyogICAgICByZWdpb24uICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgMi4gIFRoaXMgZnVuY3Rpb24gbXVzdCBub3QgYmUgaW50ZXJydXB0ZWQgYnkgdGhlIExWRVFOQl9Qcm9jZXNzIGZ1bmN0aW9uICAgICAgICAgICAgKi8KLS8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0KLUxWRVFOQl9SZXR1cm5TdGF0dXNfZW4gTFZFUU5CX0luaXQoTFZFUU5CX0hhbmRsZV90ICAgICAgICAgICpwaEluc3RhbmNlLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBMVkVRTkJfTWVtVGFiX3QgICAgICAgICAgKnBNZW1vcnlUYWJsZSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTFZFUU5CX0NhcGFiaWxpdGllc190ICAgICpwQ2FwYWJpbGl0aWVzKQotewotCi0gICAgTFZFUU5CX0luc3RhbmNlX3QgICAqcEluc3RhbmNlOwotICAgIExWTV9VSU5UMzIgICAgICAgICAgTWVtU2l6ZTsKLSAgICBJTlNUX0FMTE9DICAgICAgICAgIEFsbG9jTWVtOwotICAgIExWTV9JTlQzMiAgICAgICAgICAgaTsKLQotICAgIC8qCi0gICAgICogQ2hlY2sgZm9yIE5VTEwgcG9pbnRlcnMKLSAgICAgKi8KLSAgICBpZigocGhJbnN0YW5jZSA9PSBMVk1fTlVMTCkgfHwgKHBNZW1vcnlUYWJsZSA9PSBMVk1fTlVMTCkgfHwgKHBDYXBhYmlsaXRpZXMgPT0gTFZNX05VTEwpKQotICAgIHsKLSAgICAgICAgcmV0dXJuIExWRVFOQl9OVUxMQUREUkVTUzsKLSAgICB9Ci0KLSAgICAvKgotICAgICAqIENoZWNrIHRoZSBtZW1vcnkgdGFibGUgZm9yIE5VTEwgcG9pbnRlcnMKLSAgICAgKi8KLSAgICBmb3IgKGkgPSAwOyBpIDwgTFZFUU5CX05SX01FTU9SWV9SRUdJT05TOyBpKyspCi0gICAgewotICAgICAgICBpZiAocE1lbW9yeVRhYmxlLT5SZWdpb25baV0uU2l6ZSE9MCkKLSAgICAgICAgewotICAgICAgICAgICAgaWYgKHBNZW1vcnlUYWJsZS0+UmVnaW9uW2ldLnBCYXNlQWRkcmVzcz09TFZNX05V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5CX0JhbmREZWZfdCAqKUluc3RBbGxvY19BZGRNZW1iZXIoJkFsbG9jTWVtLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTWVtU2l6ZSk7Ci0gICAgTWVtU2l6ZSA9IChwQ2FwYWJpbGl0aWVzLT5NYXhCYW5kcyAqIHNpemVvZihMVkVRTkJfQmlxdWFkVHlwZV9lbikpOwotICAgIHBJbnN0YW5jZS0+cEJpcXVhZFR5cGUgPSAoTFZFUU5CX0JpcXVhZFR5cGVfZW4gKilJbnN0QWxsb2NfQWRkTWVtYmVyKCZBbGxvY01lbSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBNZW1TaXplKTsKLQotCi0gICAgLyoKLSAgICAgKiBJbnRlcm5hbGx5IG1hcCwgc3RydWN0dXJlIGFuZCBhbGxpZ24gc2NyYXRjaCBtZW1vcnkKLSAgICAgKi8KLSAgICBJbnN0QWxsb2NfSW5pdCgmQWxsb2NNZW0sCi0gICAgICAgICAgICAgICAgICAgcE1lbW9yeVRhYmxlLT5SZWdpb25bTFZFUU5CX01FTVJFR0lPTl9TQ1JBVENIXS5wQmFzZUFkZHJlc3MpOwotCi0gICAgcEluc3RhbmNlLT5wRmFzdFRlbXBvcmFyeSA9IChMVk1fSU5UMTYgKilJbnN0QWxsb2NfQWRkTWVtYmVyKCZBbGxvY01lbSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2l6ZW9mKExWTV9JTlQxNikpOwotCi0gICAgLyoKLSAgICAgKiBVcGRhdGUgdGhlIGluc3RhbmNlIHBhcmFtZXRlcnMKLSAgICAgKi8KLSAgICBwSW5zdGFuY2UtPlBhcmFtcy5OQmFuZHMgICAgICAgICAgPSAwOwotICAgIHBJbnN0YW5jZS0+UG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b3IgaW1wbGllZC4KLSAqIFNlZSB0aGUgTGljZW5zZSBmb3IgdGhlIHNwZWNpZmljIGxhbmd1YWdlIGdvdmVybmluZyBwZXJtaXNzaW9ucyBhbmQKLSAqIGxpbWl0YXRpb25zIHVuZGVyIHRoZSBMaWNlbnNlLgotICovCi0KLSNpZm5kZWYgX19MVkVRTkJfUFJJVkFURV9IX18KLSNkZWZpbmUgX19MVkVRTkJfUFJJVkFURV9IX18KLQotI2lmZGVmIF9fY3BsdXNwbHVzCi1leHRlcm4gIkMiIHsKLSNlbmRpZiAvKiBfX2NwbHVzcGx1cyAqLwotCi0KLS8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotLyogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgSW5jbHVkZXMgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0KLSNpbmNsdWRlICJMVkVRTkIuaCIgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLyogQ2FsbGluZyBvciBBcHBsaWNhdGlvbiBsYXllciBkZWZpbml0aW9ucyAqLwotI2luY2x1ZGUgIkJJUVVBRC5oIgotI2luY2x1ZGUgIkxWQ19NaXhlci5oIgotCi0vKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLS8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogIERlZmluZXMgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotCi0vKiBHZW5lcmFsICovCi0jZGVmaW5lIExWRVFOQl9JTlZBTElEICAgICAgICAgICAgICAweEZGRkYgICAgICAgICAgICAgIC8qIEludmFsaWQgaW5pdCBwYXJhbWV0ZXIgKi8KLQotLyogTWVtb3J5ICovCi0jZGVmaW5lIExWRVFOQl9JTlNUQU5DRV9BTElHTiAgICAgICA0ICAgICAgICAgICAgICAgICAgIC8qIDMyLWJpdCBhbGlnbm1lbnQgZm9yIGluc3RhbmNlIHN0cnVjdHVyZXMgKi8KLSNkZWZpbmUgTFZFUU5CX0RBVEFfQUxJR04gICAgICAgICAgIDQgICAgICAgICAgICAgICAgICAgLyogMzItYml0IGFsaWdubWVudCBmb3Igc3RydWN0dXJlcyAqLwotI2RlZmluZSBMVkVRTkJfQ09FRl9BTElHTiAgICAgICAgICAgNCAgICAgICAgICAgICAgICAgICAvKiAzMi1iaXQgYWxpZ25tZW50IGZvciBsb25nIHdvcmRzICovCi0jZGVmaW5lIExWRVFOQl9TQ1JBVENIQlVGRkVSUyAgICAgICA0ICAgICAgICAgICAgICAgICAgIC8qIE51bWJlciBvZiBidWZmZXJzIHJlcXVpcmVkIGZvciBpbnBsYWNlIHByb2Nlc3NpbmcgKi8KLSNkZWZpbmUgTFZFUU5CX1NDUkFUQ0hfQUxJR04gICAgICAgIDQgICAgICAgICAgICAgICAgICAgLyogMzItYml0IGFsaWdubWVudCBmb3IgbG9uZyBkYXRhICovCi0KLSNkZWZpbmUgTFZFUU5CX0JZUEFTU19NSVhFUl9UQyAgICAgIDEwMCAgICAgICAgICAgICAgICAgLyogQnlwYXNzIE1peGVyIFRDICovCi0KLS8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotLyogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgVHlwZXMgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0KLS8qIEZpbHRlciBiaXF1YWQgdHlwZXMgKi8KLXR5cGVkZWYgZW51bQotewotICAgIExWRVFOQl9TaW5nbGVQcmVjaXNpb24gPSAwLAotICAgIExWRVFOQl9Eb3VibGVQcmVjaXNpb24gPSAxLAotICAgIExWRVFOQl9PdXRPZlJhbmdlICAgICAgPSAyLAotICAgIExWRVFOQl9CSVFVQURUWVBFX01BWCAgPSBMVk1fTUFYSU5UXzMyCi19IExWRVFOQl9CaXF1YWRUeXBlX2VuOwotCi0KLS8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotLyogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgU3RydWN0dXJlcyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0KLQotCi0vKiBJbnN0YW5jZSBzdHJ1Y3R1cmUgKi8KLXR5cGVkZWYgc3RydWN0Ci17Ci0gICAgLyogUHVibGljIHBhcmFtZXRlcnMgKi8KLSAgICBMVkVRTkJfTWVtVGFiX3QgICAgICAgICAgICAgICAgIE1lbW9yeVRhYmxlOyAgICAgICAgLyogSW5zdGFuY2UgbWVtb3J5IGFsbG9jYXRpb24gdGFibGUgKi8KLSAgICBMVkVRTkJfUGFyYW1zX3QgICAgICAgICAgICAgICAgIFBhcmFtczsgICAgICAgICAgICAgLyogSW5zdGFuY2UgcGFyYW1ldGVycyAqLwotICAgIExWRVFOQl9DYXBhYmlsaXRpZXNfdCAgICAgICAgICAgQ2FwYWJpbGl0aWVzOyAgICAgICAvKiBJbnN0YW5jZSBjYXBhYmlsaXRpZXMgKi8KLQotICAgIC8qIEFsaWduZWQgbWVtb3J5IHBvaW50ZXJzICovCi0gICAgTFZNX0lOVDE2ICAgICAgICAgICAgICAgICAgICAgICpwRmFzdFRlbXBvcmFyeTsgICAgICAgIC8qIEZhc3QgdGVtcG9yYXJ5IGRhdGEgYmFzZSBhZGRyZXNzICovCi0KLSAgICAvKiBQcm9jZXNzIHZhcmlhYmxlcyAqLwotICAgIEJpcXVhZF8ySV9PcmRlcjJfVGFwc190ICAgICAgICAgKnBFUU5CX1RhcHM7ICAgICAgICAvKiBFcXVhbGlzZXIgVGFwcyAqLwotICAgIEJpcXVhZF9JbnN0YW5jZV90ICAgICAgICAgICAgICAgKnBFUU5CX0ZpbHRlclN0YXRlOyAvKiBTdGF0ZSBmb3IgZWFjaCBmaWx0ZXIgYmFuZCAqLwotCi0gICAgLyogRmlsdGVyIGRlZmluaXRpb25zIGFuZCBjYWxsIGJhY2sgKi8KLSAgICBMVk1fVUlOVDE2ICAgICAgICAgICAgICAgICAgICAgIE5CYW5kczsgICAgICAgICAgICAgLyogTnVtYmVyIG9mIGJhbmRzICovCi0gICAgTFZFUU5CX0JhbmREZWZfdCAgICAgICAgICAgICAgICAqcEJhbmREZWZpbml0aW9uczsgIC8qIEZpbHRlciBiYW5kIGRlZmluaXRpb25zICovCi0gICAgTFZFUU5CX0JpcXVhZFR5cGVfZW4gICAgICAgICAgICAqcEJpcXVhZFR5cGU7ICAgICAgIC8qIEZpbHRlciBiaXF1YWQgdHlwZXMgKi8KLQotICAgIC8qIEJ5cGFzcyB2YXJpYWJsZSAqLwotICAgIExWTWl4ZXIzXzJTdF9zdCAgICAgICAgICAgQnlwYXNzTWl4ZXI7ICAgICAgICAgICAgICAvKiBCeXBhc3MgbWl4ZXIgdXNlZCBpbiB0cmFuc2l0aW9ucyAqLwotICAgIExWTV9JTlQxNiAgICAgICAgICAgICAgIGJJbk9wZXJhdGluZ01vZGVUcmFuc2l0aW9uOyAvKiBPcGVyYXRpbmcgbW9kZSB0cmFuc2l0aW9uIGZsYWcgKi8KLQotfSBMVkVRTkJfSW5zdGFuY2VfdDsKLQotCi0vKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLS8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogRnVuY3Rpb24gcHJvdG90eXBlcyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotCi12b2lkICAgIExWRVFOQl9TZXRGaWx0ZXJzKExWRVFOQl9JbnN0YW5jZV90ICAgKnBJbnN0YW5jZSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgTFZFUU5CX1BhcmFtc190ICAgICAqcFBhcmFtcyk7Ci0KLXZvaWQgICAgTFZFUU5CX1NldENvZWZmaWNpZW50cyhMVkVRTkJfSW5zdGFuY2VfdCAgICAqcEluc3RhbmNlKTsKLQotdm9pZCAgICBMVkVRTkJfQ2xlYXJGaWx0ZXJIaXN0b3J5KExWRVFOQl9JbnN0YW5jZV90ICpwSW5zdGFuY2UpOwotCi1MVkVRTkJfUmV0dXJuU3RhdHVzX2VuIExWRVFOQl9TaW5nbGVQcmVjQ29lZnMoTFZNX1VJTlQxNiAgICAgICAgRnMsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTFZFUU5CX0JhbmREZWZfdCAgKnBGaWx0ZXJEZWZpbml0aW9uLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFBLX0MxNl9Db2Vmc190ICAgICpwQ29lZmZpY2llbnRzKTsKLQotTFZFUU5CX1JldHVyblN0YXR1c19lbiBMVkVRTkJfRG91YmxlUHJlY0NvZWZzKExWTV9VSU5UMTYgICAgICAgIEZzLAotICAgICAgICAgICA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saWFuY2Ugd2l0aCB0aGUgTGljZW5zZS4KLSAqIFlvdSBtYXkgb2J0YWluIGEgY29weSBvZiB0aGUgTGljZW5zZSBhdAotICoKLSAqICAgICAgaHR0cDovL3d3dy5hcGFjaGUub3JnL2xpY2Vuc2VzL0xJQ0VOU0UtMi4wCi0gKgotICogVW5sZXNzIHJlcXVpcmVkIGJ5IGFwcGxpY2FibGUgbGF3IG9yIGFncmVlZCB0byBpbiB3cml0aW5nLCBzb2Z0d2FyZQotICogZGlzdHJpYnV0ZWQgdW5kZXIgdGhlIExpY2Vuc2UgaXMgZGlzdHJpYnV0ZWQgb24gYW4gIkFTIElTIiBCQVNJUywKLSAqIFdJVEhPVVQgV0FSUkFOVElFUyBPUiBDT05ESVRJT05TIE9GIEFOWSBLSU5ELCBlaXRoZXIgZXhwcmVzcyBvciBpbXBsaWVkLgotICogU2VlIHRoZSBMaWNlbnNlIGZvciB0aGUgc3BlY2lmaWMgbGFuZ3VhZ2UgZ292ZXJuaW5nIHBlcm1pc3Npb25zIGFuZAotICogbGltaXRhdGlvbnMgdW5kZXIgdGhlIExpY2Vuc2UuCi0gKi8KLQotLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0vKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICBJbmNsdWRlcyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLQotI2luY2x1ZGUgIkxWRVFOQi5oIgotI2luY2x1ZGUgIkxWRVFOQl9Qcml2YXRlLmgiCi0jaW5jbHVkZSAiVmVjdG9yQXJpdGhtZXRpYy5oIgotI2luY2x1ZGUgIkJJUVVBRC5oIgotCi0KLS8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotLyogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgRGVmaW5lcyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0KLSNkZWZpbmUgU0hJRlQgICAgICAgMTMKLQotLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0vKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qIEZVTkNUSU9OOiAgICAgICAgICAgICAgICBMVkVRTkJfUHJvY2VzcyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiBERVNDUklQVElPTjogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICBQcm9jZXNzIGZ1bmN0aW9uIGZvciB0aGUgTi1CYW5kIEVxdWFsaXNlciBtb2R1bGUuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiBQQVJBTUVURVJTOiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICBoSW5zdGFuY2UgICAgICAgICAgICAgICBJbnN0YW5jZSBoYW5kbGUgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogIHBJbkRhdGEgICAgICAgICAgICAgICAgIFBvaW50ZXIgdG8gdGhlIGlucHV0IGRhdGEgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgcE91dERhdGEgICAgICAgICAgICAgICAgUG9pbnRlciB0byB0aGUgb3V0cHV0IGRhdGEgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICBOdW1TYW1wbGVzICAgICAgICAgICAgICBOdW1iZXIgb2Ygc2FtcGxlcyBpbiB0aGUgaW5wdXQgYnVmZmVyICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiBSRVRVUk5TOiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICBMVkVRTkJfU1VDQ0VTUyAgICAgICAgICBTdWNjZWVkZWQgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogIExWRVFOQl9OVUxMQUREUkVTUyAgICAgIFdoZW4gaEluc3RhbmNlLCBwSW5EYXRhIG9yIHBPdXREYXRhIGFyZSBOVUxMICAgICAgICAgICAgICAgICovCi0vKiAgTFZFUU5CX0FMSUdOTUVOVEVSUk9SICAgV2hlbiBwSW5EYXRhIG9yIHBPdXREYXRhIGFyZSBub3QgMzItYml0IGFsaWduZWQgICAgICAgICAgICAgKi8KLS8qICBMVkVRTkJfVE9PTUFOWVNBTVBMRVMgICBOdW1TYW1wbGVzIHdhcyBsYXJnZXIgdGhhbiB0aGUgbWF4aW11bSBibG9jayBzaXplICAgICAgICAgICAqLwotLyogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiBOT1RFUzogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0KLUxWRVFOQl9SZXR1cm5TdGF0dXNfZW4gTFZFUU5CX1Byb2Nlc3MoTFZFUU5CX0hhbmRsZV90ICAgICAgIGhJbnN0YW5jZSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY29uc3QgTFZNX0lOVDE2ICAgICAgICpwSW5EYXRhLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg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WVzLk1heEJsb2NrU2l6ZSkKLSAgICB7Ci0gICAgICAgIHJldHVybihMVkVRTkJfVE9PTUFOWVNBTVBMRVMpOwotICAgIH0KLQotICAgIGlmIChwSW5zdGFuY2UtPlBhcmFtcy5PcGVyYXRpbmdNb2RlID09IExWRVFOQl9PTikKLSAgICB7Ci0gICAgICAgIC8qCi0gICAgICAgICAqIENvbnZlcnQgZnJvbSAxNi1iaXQgdG8gMzItYml0Ci0gICAgICAgICAqLwotICAgICAgICBJbnQxNkxTaGlmdFRvSW50MzJfMTZ4MzIoKExWTV9JTlQxNiAqKXBJbkRhdGEsICAgICAgLyogU291cmNlICovCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwU2NyYXRjaCwgICAgICAgICAgICAgICAgICAvKiBEZXN0aW5hdGlvbiAqLwotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKExWTV9JTlQxNikoMipOdW1TYW1wbGVzKSwgLyogTGVmdCBhbmQgUmlnaHQgKi8KLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFNISUZUKTsgICAgICAgICAgICAgICAgICAgIC8qIFNjYWxpbmcgc2hpZnQgKi8KLQotICAgICAgICAvKgotICAgICAgICAgKiBGb3IgZWFjaCBzZWN0aW9uIGV4ZWN0ZSB0aGUgZmlsdGVyIHVubGVzcyB0aGUgZ2FpbiBpcyAwZEIKLSAgICAgICAgICovCi0gICAgICAgIGlmIChwSW5zdGFuY2UtPk5CYW5kcyAhPSAwKQotICAgICAgICB7Ci0gICAgICAgICAgICBmb3IgKGk9MDsgaTxwSW5zdGFuY2UtPk5CYW5kczsgaSsrKQotICAgICAgICAgICAgewotICAgICAgICAgICAgICAgIC8qCi0gICAgICAgICAgICAgICAgICogQ2hlY2sgaWYgYmFuZCBpcyBub24temVybyBkQiBnYWluCi0gICAgICAgICAgICAgICAgICovCi0gICAgICAgICAgICAgICAgaWYgKHBJbnN0YW5jZS0+cEJhbmREZWZpbml0aW9uc1tpXS5HYWluICE9IDApCi0gICAgICAgICAgICAgICAgewotICAgICAgICAgICAgICAgICAgICAvKgotICAgICAgICAgICAgICAgICAgICAgKiBHZXQgdGhlIGFkZHJlc3Mgb2YgdGhlIGJpcXVhZCBpbnN0YW5jZQotICAgICAgICAgICAgICAgICAgICAgKi8KLSAgICAgICAgICAgICAgICAgICAgcEJpcXVhZCA9ICZwSW5zdGFuY2UtPnBFUU5CX0ZpbHRlclN0YXRlW2ldOwotCi0KLSAgICAgICAgICAgICAgICAgICAgLyoKLSAgICAgICAgICAgICAgICAgICAgICogU2VsZWN0IHNpbmdsZSBvciBkb3VibGUgcHJlY2lzaW9uIGFzIHJlcXVpcmVkCi0gICAgICAgICAgICAgICAgICAgICAqLwotICAgICAgICAgICAgICAgICAgICBzd2l0Y2ggKHBJbnN0YW5jZS0+cEJpcXVhZFR5cGVbaV0pCi0gICAgICAgICAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAgICAgICAgIGNhc2UgTFZFUU5CX1NpbmdsZVByZWNpc2lvbjoKLSAgICAgICAgICAgICAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBQS18ySV9EMzJGMzJDMTRHMTFfVFJDX1dSQV8wMShwQmlxdWFkLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChMVk1fSU5UMzIgKilwU2NyYXRjaCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoTFZNX0lOVDMyICopcFNjcmF0Y2gsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKExWTV9JTlQxNilOdW1TYW1wbGVzKTsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKLSAgICAgICAgICAgICAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgICAgICAgICAgICAgY2FzZSBMVkVRTkJfRG91YmxlUHJlY2lzaW9uOgotICAgICAgICAgICAgICAgICAgICAgICAgewotICAgICAgICAgICAgICAgICAgICAgICAgICAgIFBLXzJJX0QzMkYzMkMzMEcxMV9UUkNfV1JBXzAxKHBCaXF1YWQsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKExWTV9JTlQzMiAqKXBTY3JhdGNoLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChMVk1fSU5UMzIgKilwU2NyYXRjaCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoTFZNX0lOVDE2KU51bVNhbXBsZXMpOwotICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOwotICAgICAgICAgICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgICAgICAgICAgZGVmYXVsdDoKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKLSAgICAgICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgIH0KLSAgICAgICAgfQotCi0KLSAgICAgICAgaWYocEluc3RhbmNlLT5iSW5PcGVyYXRpbmdNb2RlVHJhbnNpdGlvbiA9PSBMVk1fVFJVRSl7Ci0gICAgICAgICAgICAgICAgLyoKLSAgICAgICAgICAgICAgICAgKiBDb252ZXJ0IGZyb20gMzItYml0IHRvIDE2LSBiaXQgYW5kIHNhdHVyYXRlCi0gICAgICAgICAgICAgICAgICovCi0gICAgICAgICAgICAgICAgSW50MzJSU2hpZnRUb0ludDE2X1NhdF8zMngxNihwU2NyYXRjaCwgICAgICAgICAgICAgICAgICAgICAgLyogU291cmNlICovCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoTFZNX0lOVDE2ICopcFNjcmF0Y2gsICAgICAgICAgLyogRGVzdGluYXRpb24gKi8KLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChMVk1fSU5UMTYpKDIqTnVtU2FtcGxlcyksICAgICAvKiBMZWZ0IGFuZCBSaWdodCAqLwotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgU0hJRlQpOyAgICAgICAgICAgICAgICAgICAgICAgIC8qIFNjYWxpbmcgc2hpZnQgKi8KLQotICAgICAgICAgICAgICAgIExWQ19NaXhTb2Z0XzJTdF9EMTZDMzFfU0FUKCZwSW5zdGFuY2UtPkJ5cGFzc01peGVyLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKExWTV9JTlQxNiAqKXBTY3JhdGNoLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKExWTV9JTlQxNiAqKXBJbkRhdGEsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoTFZNX0lOVDE2ICopcFNjcmF0Y2gsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoTFZNX0lOVDE2KSgyKk51bVNhbXBsZXMpKTsKLQotICAgICAgICAgICAgICAgIENvcHlfMTYoKExWTV9JTlQxNiopcFNjcmF0Y2gsICAgICAgICAgICAgICAgICAgICAgICAgICAgLyogU291cmNlICovCi0gICAgICAgICAgICAgICAgICAgICAgICBwT3V0RGF0YSwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvKiBEZXN0aW5hdGlvbiAqLwotICAgICAgICAgICAgICAgICAgICAgICAgKExWTV9JTlQxNikoMipOdW1TYW1wbGVzKSk7ICAgICAgICAgICAgICAgICAgICAgLyogTGVmdCBhbmQgUmlnaHQgc2FtcGxlcyAqLwotICAgICAgICB9Ci0gICAgICAgIGVsc2V7Ci0KLSAgICAgICAgICAgIC8qCi0gICAgICAgICAgICAgKiBDb252ZXJ0IGZyb20gMzItYml0IHRvIDE2LSBiaXQgYW5kIHNhdHVyYXRlCi0gICAgICAgICAgICAgKi8KLSAgICAgICAgICAgIEludDMyUlNoaWZ0VG9JbnQxNl9TYXRfMzJ4MTYocFNjcmF0Y2gsICAgICAgICAgICAgICAvKiBTb3VyY2UgKi8KLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcE91dERhdGEsICAgICAgICAgICAgICAvKiBEZXN0aW5hdGlvbiAqLwotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoTFZNX0lOVDE2ICkoMipOdW1TYW1wbGVzKSwgLyogTGVmdCBhbmQgUmlnaHQgKi8KLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgU0hJRlQpOyAgICAgICAgICAgICAgICAvKiBTY2FsaW5nIHNoaWZ0ICovCi0gICAgICAgIH0KLSAgICB9Ci0gICAgZWxzZQotICAgIHsKLSAgICAgICAgLyoKLSAgICAgICAgICogTW9kZSBpcyBPRkYgc28gY29weSB0aGUgZGF0YSBpZiBuZWNlc3NhcnkKLSAgICAgICAgICovCi0gICAgICAgIGlmIChwSW5EYXRhICE9IHBPdXREYXRhKQotICAgICAgICB7Ci0gICAgICAgICAgICBDb3B5XzE2KHBJbkRhdGEsICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLyogU291cmNlICovCi0gICAgICAgICAgICAgICAgICAgIHBPdXREYXRhLCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLyogRGVzdGluYXRpb24gKi8KLSAgICAgICAgICAgICAgICAgICAgKExWTV9JTlQxNikoMipOdW1TYW1wbGVzKSk7ICAgICAgICAgICAgICAgICAvKiBMZWZ0IGFuZCBSaWdodCBzYW1wbGVzICovCi0gICAgICAgIH0KLSAgICB9Ci0KLQotCi0gICAgcmV0dXJuKExWRVFOQl9TVUNDRVNTKTsKLQotfQpkaWZmIC0tZ2l0IGEvbWVkaWEvbGliZWZmZWN0cy9sdm0vbGliL0VxL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nZSBnb3Zlcm5pbmcgcGVybWlzc2lvbnMgYW5kCi0gKiBsaW1pdGF0aW9ucyB1bmRlciB0aGUgTGljZW5zZS4KLSAqLwotCi0KLS8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0vKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogICAgSW5jbHVkZXMgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotCi0jaW5jbHVkZSAiTFZFUU5CLmgiCi0jaW5jbHVkZSAiTFZFUU5CX0NvZWZmcy5oIgotCi0KLS8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0vKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogICAgU2FtcGxlIHJhdGUgdGFibGUgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotCi0vKgotICogU2FtcGxlIHJhdGUgdGFibGUgZm9yIGNvbnZlcnRpbmcgYmV0d2VlbiB0aGUgZW51bWVyYXRlZCB0eXBlIGFuZCB0aGUgYWN0dWFsCi0gKiBmcmVxdWVuY3kKLSAqLwotY29uc3QgTFZNX1VJTlQxNiAgICBMVkVRTkJfU2FtcGxlUmF0ZVRhYltdID0gezgwMDAsICAgICAgICAgICAgICAgICAgICAvKiA4a1MvcyAgKi8KLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAxMTAyNSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAxMjAwMCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAxNjAwMCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAyMjA1MCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAyNDAwMCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAzMjAwMCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA0NDEwMCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA0ODAwMH07ICAgICAgICAgICAgICAgICAgLyogNDhrUy9zICovCi0KLQotLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLS8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgICBDb2VmZmljaWVudCBjYWxjdWxhdGlvbiB0YWJsZXMgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0KLS8qCi0gKiBUYWJsZSBmb3IgMiAqIFBpIC8gRnMKLSAqLwotY29uc3QgTFZNX0lOVDE2ICAgICBMVkVRTkJfVHdvUGlPbkZzVGFibGVbXSA9IHtMVkVRTkJfMlBpT25fODAwMCwgICAgICAvKiA4a1MvcyAqLwotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBMVkVRTkJfMlBpT25fMTEwMjUsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIExWRVFOQl8yUGlPbl8xMjAwMCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTFZFUU5CXzJQaU9uXzE2MDAwLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBMVkVRTkJfMlBpT25fMjIwNTAsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIExWRVFOQl8yUGlPbl8yNDAwMCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTFZFUU5CXzJQaU9uXzMyMDAwLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBMVkVRTkJfMlBpT25fNDQxMDAsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIExWRVFOQl8yUGlPbl80ODAwMH07ICAgIC8qIDQ4a1MvcyAqLwotCi0vKgotICogR2FpbiB0YWJsZQotICovCi1jb25zdCBMVk1fSU5UMTYgICAgIExWRVFOQl9HYWluVGFibGVbXSA9IHtMVkVRTkJfR2Fpbl9OZWcxNV9kQiwgICAgICAgIC8qIC0xNWRCIGdhaW4gKi8KLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIExWRVFOQl9HYWluX05lZzE0X2RCLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTFZFUU5CX0dhaW5fTmVnMTNfZEIsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBMVkVRTkJfR2Fpbl9OZWcxMl9kQiwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIExWRVFOQl9HYWluX05lZzExX2RCLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTFZFUU5CX0dhaW5fTmVnMTBfZEIsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBMVkVRTkJfR2Fpbl9OZWc5X2RCLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTFZFUU5CX0dhaW5fTmVnOF9kQiwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIExWRVFOQl9HYWluX05lZzdfZEIsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBMVkVRTkJfR2Fpbl9OZWc2X2RCLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTFZFUU5CX0dhaW5fTmVnNV9kQiwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIExWRVFOQl9HYWluX05lZzRfZEIsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBMVkVRTkJfR2Fpbl9OZWczX2RCLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTFZFUU5CX0dhaW5fTmVnMl9kQiwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIExWRVFOQl9HYWluX05lZzFfZEIsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBMVkVRTkJfR2Fpbl8wX2RCLCAgICAgICAgICAgIC8qIDBkQiBnYWluICovCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBMVkVRTkJfR2Fpbl8xX2RCLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTFZFUU5CX0dhaW5fMl9kQiwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIExWRVFOQl9HYWluXzNfZEIsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBMVkVRTkJfR2Fpbl80X2RCLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTFZFUU5CX0dhaW5fNV9kQiwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIExWRVFOQl9HYWluXzZfZEIsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBMVkVRTkJfR2Fpbl83X2RCLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTFZFUU5CX0dhaW5fOF9kQiwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIExWRVFOQl9HYWluXzlfZEIsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBMVkVRTkJfR2Fpbl8xMF9kQiwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIExWRVFOQl9HYWluXzExX2RCLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTFZFUU5CX0dhaW5fMTJfZEIsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBMVkVRTkJfR2Fpbl8xM19kQiwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIExWRVFOQl9HYWluXzE0X2RCLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTFZFUU5CX0dhaW5fMTVfZEJ9OyAgICAgICAgICAvKiArMTVkQiBnYWluICovCi0KLQotLyoKLSAqIEQgdGFibGUgZm9yIDEwMCAvIChHYWluICsgMSkKLSAqLwotY29uc3QgTFZNX0lOVDE2ICAgIExWRVFOQl9EVGFibGVbXSA9IHtMVkVRTkJfMTAwRF9OZWcxNV9kQiwgICAgICAgICAgICAvKiAtMTVkQiBnYWluICovCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIExWRVFOQl8xMDBEX05lZzE0X2RCLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBMVkVRTkJfMTAwRF9OZWcxM19kQiwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTFZFUU5CXzEwMERfTmVnMTJfZEIsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIExWRVFOQl8xMDBEX05lZzExX2RCLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBMVkVRTkJfMTAwRF9OZWcxMF9kQiwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTFZFUU5CXzEwMERfTmVnOV9kQiwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTFZFUU5CXzEwMERfTmVnOF9kQiwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTFZFUU5CXzEwMERfTmVnN19kQiwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTFZFUU5CXzEwMERfTmVnNl9kQiwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTFZFUU5CXzEwMERfTmVnNV9kQiwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTFZFUU5CXzEwMERfTmVnNF9kQiwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTFZFUU5CXzEwMERfTmVnM19kQiwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTFZFUU5CXzEwMERfTmVnMl9kQiwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTFZFUU5CXzEwMERfTmVnMV9kQiwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTFZFUU5CXzEwMERfMF9kQn07ICAgICAgICAgICAgICAgLyogMGRCIGdhaW4gKi8KLQotCi0vKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotLyogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICAgIEZpbHRlciBwb2x5bm9taWFsIGNvZWZmaWNpZW50cyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLQotLyoKLSAqIENvZWZmaWNpZW50cyBmb3IgY2FsY3VsYXRpbmcgdGhlIGNvc2luZSB3aXRoIHRoZSBlcXVhdGlvbjoKLSAqCi0gKiAgQ29zKHgpID0gKDJeU2hpZnRzKSooYTAgKyBhMSp4ICsgYTIqeF4yICsgYTMqeF4zICsgYTQqeF40ICsgYTUqeF41KQotICoKLSAqIFRoZXNlIGNvZWZmaWNpZW50cyBleHBlY3QgdGhlIGlucHV0LCB4LCB0byBiZSBpbiB0aGUgcmFuZ2UgMCB0byAzMjc2OCByZXNwcmVzZW50aW5nCi0gKiBhIHJhbmdlIG9mIDAgdG8gUGkuIFRoZSBvdXRwdXQgaXMgaW4gdGhlIHJhbmdlIDMyNzY3IHRvIC0zMjc2OCByZXByZXNlbnRpbmcgdGhlIHJhbmdlCi0gKiArMS4wIHRvIC0xLjAKLSAqLwotY29uc3QgTFZNX0lOVDE2ICAgICBMVkVRTkJfQ29zQ29lZltdID0gezMsICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvKiBTaGlmdHMgKi8KLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA0MDk2LCAgICAgICAgICAgICAgICAgICAgICAgICAgLyogYTAgKi8KLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAtMzYsICAgICAgICAgICAgICAgICAgICAgICAgICAgLyogYTEgKi8KLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAtMTk3MjUsICAgICAgICAgICAgICAgICAgICAgICAgLyogYTIgKi8KLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAtMjY3MSwgICAgICAgICAgICAgICAgICAgICAgICAgLyogYTMgKi8KLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAyMzczMCwgICAgICAgICAgICAgICAgICAgICAgICAgLyogYTQgKi8KLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAtOTQ5MH07ICAgICAgICAgICAgICAgICAgICAgICAgLyogYTUgKi8KLQotLyoKLSAqIENvZWZmaWNpZW50cyBmb3IgY2FsY3VsYXRpbmcgdGhlIGNvc2luZSBlcnJvciB3aXRoIHRoZSBlcXVhdGlvbjoKLSAqCi0gKiAgQ29zRXJyKHgpID0gKDJeU2hpZnRzKSooYTAgKyBhMSp4ICsgYTIqeF4yICsgYTMqeF4zKQotICoKLSAqIFRoZXNlIGNvZWZmaWNpZW50cyBleHBlY3QgdGhlIGlucHV0LCB4LCB0byBiZSBpbiB0aGUgcmFuZ2UgMCB0byAzMjc2OCByZXNwcmVzZW50aW5nCi0gKiBhIHJhbmdlIG9mIDAgdG8gUGkvMjUuIFRoZSBvdXRwdXQgaXMgaW4gdGhlIHJhbmdlIDAgdG8gMzI3NjcgcmVwcmVzZW50aW5nIHRoZSByYW5nZQotICogMC4wIHRvIDAuMDA3ODg1Mjk4NgotICoKLSAqIFRoaXMgaXMgdXNlZCB0byBnaXZlIGEgZG91YmxlIHByZWNpc2lvbiBjb3NpbmUgb3ZlciB0aGUgcmFuZ2UgMCB0byBQaS8yNSB1c2luZyB0aGUKLSAqIHRoZSBlcXVhdGlvbjoKLSAqCi0gKiBDb3MoeCkgPSAxLjAgLSBDb3NFcnIoeCkKLSAqLwotY29uc3QgTFZNX0lOVDE2ICAgICBMVkVRTkJfRFBDb3NDb2VmW10gPSB7MSwgICAgICAgICAgICAgICAgICAgICAgICAgICAvKiBTaGlmdHMgKi8KLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDAsICAgICAgICAgICAgICAgICAgICAgICAgICAgLyogYTAgKi8KLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC02LCAgICAgICAgICAgICAgICAgICAgICAgICAgLyogYTEgKi8KLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDE2NTg2LCAgICAgICAgICAgICAgICAgICAgICAgLyogYTIgKi8KLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC00NH07ICAgICAgICAgICAgICAgICAgICAgICAgLyogYTMgKi8KLQotLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLS8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgQnlwYXNzIG1peGVyIHRpbWUgY29uc3RhbnRzICgxMDBtcykgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0KLSNkZWZpbmUgTFZFUU5CX01JWF9UQ19GczgwMDAgICAgMzI1ODAgICAgICAgICAvKiBGbG9hdGluZyBwb2ludCB2YWx1ZSAwLjk5NDI2MjY5NSAqLwotI2RlZmluZSBMVkVRTkJfTUlYX1RDX0ZzMTEwMjUgICAzMjYzMiAgICAgICAgIC8qIEZsb2F0aW5nIHBvaW50IHZhbHVlIDAuOTk1ODQ5NjA5ICovCi0jZGVmaW5lIExWRVFOQl9NSVhfVENfRnMxMjAwMCAgIDMyNjQzICAgICAgICAgLyogRmxvYXRpbmcgcG9pbnQgdmFsdWUgMC45OTYxODUzMDMgKi8KLSNkZWZpbmUgTFZFUU5CX01JWF9UQ19GczE2MDAwICAgMzI2NzQgICAgICAgICAvKiBGbG9hdGluZyBwb2ludCB2YWx1ZSAwLjk5NzEzMTM0OCAqLwotI2RlZmluZSBMVkVRTkJfTUlYX1RDX0ZzMjIwNTAgICAzMjcwMCAgICAgICAgIC8qIEZsb2F0aW5nIHBvaW50IHZhbHVlIDAuOTk3OTI0ODA1ICovCi0jZGVmaW5lIExWRVFOQl9NSVhfVENfRnMyNDAwMCAgIDMyNzA1ICAgICAgICAgLyogRmxvYXRpbmcgcG9pbnQgdmFsdWUgMC45OTgwNzczOTMgKi8KLSNkZWZpbmUgTFZFUU5CX01JWF9UQ19GczMyMDAwICAgMzI3MjEgICAgICAgICAvKiBGbG9hdG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gT3BlbiBTb3VyY2UgUHJvamVjdAotICoKLSAqIExpY2Vuc2VkIHVuZGVyIHRoZSBBcGFjaGUgTGljZW5zZSwgVmVyc2lvbiAyLjAgKHRoZSAiTGljZW5zZSIpOwotICogeW91IG1heSBub3QgdXNlIHRoaXMgZmlsZSBleGNlcHQgaW4gY29tcGxpYW5jZSB3aXRoIHRoZSBMaWNlbnNlLgotICogWW91IG1heSBvYnRhaW4gYSBjb3B5IG9mIHRoZSBMaWNlbnNlIGF0Ci0gKgotICogICAgICBodHRwOi8vd3d3LmFwYWNoZS5vcmcvbGljZW5zZXMvTElDRU5TRS0yLjAKLSAqCi0gKiBVbmxlc3MgcmVxdWlyZWQgYnkgYXBwbGljYWJsZSBsYXcgb3IgYWdyZWVkIHRvIGluIHdyaXRpbmcsIHNvZnR3YXJlCi0gKiBkaXN0cmlidXRlZCB1bmRlciB0aGUgTGljZW5zZSBpcyBkaXN0cmlidXRlZCBvbiBhbiAiQVMgSVMiIEJBU0lTLAotICogV0lUSE9VVCBXQVJSQU5USUVTIE9SIENPTkRJVElPTlMgT0YgQU5ZIEtJTkQsIGVpdGhlciBleHByZXNzIG9yIGltcGxpZWQuCi0gKiBTZWUgdGhlIExpY2Vuc2UgZm9yIHRoZSBzcGVjaWZpYyBsYW5ndWFnZSBnb3Zlcm5pbmcgcGVybWlzc2lvbnMgYW5kCi0gKiBsaW1pdGF0aW9ucyB1bmRlciB0aGUgTGljZW5zZS4KLSAqLwotCi0vKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLS8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogIEhlYWRlciBmaWxlIGZvciB0aGUgYXBwbGljYXRpb24gbGF5ZXIgaW50ZXJmYWNlIG9mIHRoZSBMVlJFViBtb2R1bGUgICAgICAgICAgICAgICAgICovCi0vKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICBUaGlzIGZpbGVzIGluY2x1ZGVzIGFsbCBkZWZpbml0aW9ucywgdHlwZXMsIHN0cnVjdHVyZXMgYW5kIGZ1bmN0aW9uIHByb3RvdHlwZXMgICAgICAqLwotLyogIHJlcXVpcmVkIGJ5IHRoZSBjYWxsaW5nIGxheWVyLiBBbGwgb3RoZXIgdHlwZXMsIHN0cnVjdHVyZXMgYW5kIGZ1bmN0aW9ucyBhcmUgICAgICAgICovCi0vKiAgcHJpdmF0ZS4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0KLSNpZm5kZWYgX19MVlJFVl9IX18KLSNkZWZpbmUgX19MVlJFVl9IX18KLQotI2lmZGVmIF9fY3BsdXNwbHVzCi1leHRlcm4gIkMiIHsKLSNlbmRpZiAvKiBfX2NwbHVzcGx1cyAqLwotCi0KLS8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotLyogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgSW5jbHVkZXMgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0jaW5jbHVkZSAiTFZNX1R5cGVzLmgiCi0KLQotLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0vKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICBEZWZpbml0aW9ucyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLS8qIEdlbmVyYWwgKi8KLSNkZWZpbmUgTFZSRVZfQkxPQ0tTSVpFX01VTFRJUExFICAgICAgICAgICAgICAgIDEgICAgICAgLyogUHJvY2Vzc2luZyBibG9jayBzaXplIG11bHRpcGxlICovCi0jZGVmaW5lIExWUkVWX01BWF9UNjAgICAgICAgICAgICAgICAgICAgICAgICA3MDAwICAgICAgIC8qIE1heGltdW0gZGVjYXkgdGltZSBpcyA3MDAwbXMgKi8KLQotLyogTWVtb3J5IHRhYmxlKi8KLSNkZWZpbmUgTFZSRVZfTlJfTUVNT1JZX1JFR0lPTlMgICAgICAgICAgICAgICAgIDQgICAgICAgLyogTnVtYmVyIG9mIG1lbW9yeSByZWdpb25zICovCi0KLQotLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0vKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICBUeXBlcyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLS8qIEluc3RhbmNlIGhhbmRsZSAqLwotdHlwZWRlZiB2b2lkICpMVlJFVl9IYW5kbGVfdDsKLQotCi0vKiBTdGF0dXMgcmV0dXJuIHZhbHVlcyAqLwotdHlwZWRlZiBlbnVtCi17Ci0gICAgTFZSRVZfU1VDQ0VTUyAgICAgICAgICAgID0gMCwgICAgICAgICAgICAgICAgICAgICAgIC8qIFN1Y2Nlc3NmdWwgcmV0dXJuIGZyb20gYSByb3V0aW5lICovCi0gICAgTFZSRVZfTlVMTEFERFJFU1MgICAgICAgID0gMSwgICAgICAgICAgICAgICAgICAgICAgIC8qIE5VTEwgYWxsb2NhdGlvbiBhZGRyZXNzICovCi0gICAgTFZSRVZfT1VUT0ZSQU5HRSAgICAgICAgID0gMiwgICAgICAgICAgICAgICAgICAgICAgIC8qIE91dCBvZiByYW5nZSBjb250cm9sIHBhcmFtZXRlciAqLwotICAgIExWUkVWX0lOVkFMSUROVU1TQU1QTEVTICA9IDMsICAgICAgICAgICAgICAgICAgICAgICAvKiBJbnZhbGlkIG51bWJlciBvZiBzYW1wbGVzICovCi0gICAgTFZSRVZfUkVUVVJOU1RBVFVTX0RVTU1ZID0gTFZNX01BWEVOVU0KLX0gTFZSRVZfUmV0dXJuU3RhdHVzX2VuOwotCi0KLS8qIFJldmVyYiBkZWxheSBsaW5lcyAqLwotdHlwZWRlZiBlbnVtCi17Ci0gICAgTFZSRVZfREVMQVlMSU5FU18xICAgICA9IDEsICAgICAgICAgICAgICAgICAgICAgICAgIC8qIE9uZSBkZWxheSBsaW5lICovCi0gICAgTFZSRVZfREVMQVlMSU5FU18yICAgICA9IDIsICAgICAgICAgICAgICAgICAgICAgICAgIC8qIFR3byBkZWxheSBsaW5lcyAqLwotICAgIExWUkVWX0RFTEFZTElORVNfNCAgICAgPSA0LCAgICAgICAgICAgICAgICAgICAgICAgICAvKiBGb3VyIGRlbGF5IGxpbmVzICovCi0gICAgTFZSRVZfREVMQVlMSU5FU19EVU1NWSA9IExWTV9NQVhFTlVNCi19IExWUkVWX051bURlbGF5TGluZXNfZW47Ci0KLQotLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0vKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICBTdHJ1Y3R1cmVzICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLQotLyogTWVtb3J5IHRhYmxlIGNvbnRhaW5pbmcgdGhlIHJlZ2lvbiBkZWZpbml0aW9ucyAqLwotdHlwZWRlZiBzdHJ1Y3QKLXsKLSAgICBMVk1fTWVtb3J5UmVnaW9uX3N0ICAgICAgICBSZWdpb25bTFZSRVZfTlJfTUVNT1JZX1JFR0lPTlNdOyAgLyogT25lIGRlZmluaXRpb24gZm9yIGVhY2ggcmVnaW9uICovCi19IExWUkVWX01lbW9yeVRhYmxlX3N0OwotCi0KLS8qIENvbnRyb2wgUGFyYW1ldGVyIHN0cnVjdHVyZSAqLwotdHlwZWRlZiBzdHJ1Y3QKLXsKLSAgICAvKiBHZW5lcmFsIHBhcmFtZXRlcnMgKi8KLSAgICBMVk1fTW9kZV9lbiAgICAgICAgICAgICAgICAgT3BlcmF0aW5nTW9kZTsgICAgICAgICAgLyogT3BlcmF0aW5nIG1vZGUgKi8KLSAgICBMVk1fRnNfZW4gICAgICAgICAgICAgICAgICAgU2FtcGxlUmF0ZTsgICAgICAgICAgICAgLyogU2FtcGxlIHJhdGUgKi8KLSAgICBMVk1fRm9ybWF0X2VuICAgICAgICAgICAgICAgU291cmNlRm9ybWF0OyAgICAgICAgICAgLyogU291cmNlIGRhdGEgZm9ybWF0ICovCi0KLSAgICAvKiBQYXJhbWV0ZXJzIGZvciBSRVYgKi8KLSAgICBMVk1fVUlOVDE2ICAgICAgICAgICAgICAgICAgTGV2ZWw7ICAgICAgICAgICAgICAgICAgLyogTGV2ZWwsIDAgdG8gMTAwIHJlcHJlc2VudGluZyBwZXJjZW50YWdlIG9mIHJldmVyYiAqLwotICAgIExWTV9VSU5UMTYgICAgICAgICAgICAgICAgICBMUEY7ICAgICAgICAgICAgICAgICAgICAvKiBMb3cgcGFzcyBmaWx0ZXIsIGluIEh6ICovCi0gICAgTFZNX1VJTlQxNiAgICAgICAgICAgICAgICAgIEhQRjsgICAgICAgICAgICAgICAgICAgIC8qIEhpZ2ggcGFzcyBmaWx0ZXIsIGluIEh6ICovCi0gICAgTFZNX1VJTlQxNiAgICAgICAgICAgICAgICAgIFQ2MDsgICAgICAgICAgICAgICAgICAgIC8qIERlY2F5IHRpbWUgY29uc3RhbnQsIGluIG1zICovCi0gICAgTFZNX1VJTlQxNiAgICAgICAgICAgICAgICAgIERlbnNpdHk7ICAgICAgICAgICAgICAgIC8qIEVjaG8gZGVuc2l0eSwgMCB0byAxMDAgZm9yIG1pbmltdW0gdG8gbWF4aW11bSBkZW5zaXR5ICovCi0gICAgTFZNX1VJTlQxNiAgICAgICAgICAgICAgICAgIERhbXBpbmc7ICAgICAgICAgICAgICAgIC8qIERhbXBpbmcgKi8KLSAgICBMVk1fVUlOVDE2ICAgICAgICAgICAgICAgICAgUm9vbVNpemU7ICAgICAgICAgICAgICAgLyogU2ltdWxhdGVkIHJvb20gc2l6ZSwgMSB0byAxMDAgZm9yIG1pbmltdW0gdG8gbWF4aW11bSBzaXplICovCi0KLX0gTFZSRVZfQ29udHJvbFBhcmFtc19zdDsKLQotCi0vKiBJbnN0YW5jZSBQYXJhbWV0ZXIgc3RydWN0dXJlICovCi10eXBlZGVmIHN0cnVjdAotewotICAgIC8qIEdlbmVyYWwgKi8KLSAgICBMVk1fVUlOVDE2ICAgICAgICAgICAgICAgICAgTWF4QmxvY2tTaXplOyAgICAgICAgICAgLyogTWF4aW11bSBwcm9jZXNzaW5nIGJsb2NrIHNpemUgKi8KLQotICAgIC8qIFJldmVyYiAqLwotICAgIExWTV9Gb3JtYXRfZW4gICAgICAgICAgICAgICBTb3VyY2VGb3JtYXQ7ICAgICAgICAgICAvKiBTb3VyY2UgZGF0YSBmb3JtYXRzIHRvIHN1cHBvcnQgKi8KLSAgICBMVlJFVl9OdW1EZWxheUxpbmVzX2VuICAgICAgTnVtRGVsYXlzOyAgICAgICAgICAgICAgLyogVGhlIG51bWJlciBvZiBkZWxheSBsaW5lcywgMSwgMiBvciA0ICovCi0KLX0gTFZSRVZfSW5zdGFuY2VQYXJhbXNfc3Q7Ci0KLQotLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0vKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICBGdW5jdGlvbiBQcm90b3R5cGVzICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLQotLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0vKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qIEZVTkNUSU9OOiAgICAgICAgICAgICAgICBMVlJFVl9HZXRNZW1vcnlUYWJsZSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiBERVNDUklQVElPTjogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICBUaGlzIGZ1bmN0aW9uIGlzIHVzZWQgdG8gb2J0YWluIHRoZSBMVlJFViBtb2R1bGUgbWVtb3J5IHJlcXVpcmVtZW50cyB0byBzdXBwb3J0ICAgICAqLwotLyogIG1lbW9yeSBhbGxvY2F0aW9uLiBJdCBjYW4gYWxzbyBiZSB1c2VkIHRvIHJldHVybiB0aGUgbWVtb3J5IGJhc2UgYWRkcmVzcyBwcm92aWRlZCAgICovCi0vKiAgZHVyaW5nIG1lbW9yeSBhbGxvY2F0aW9uIHRvIHN1cHBvcnQgZnJlZWluZyBvZiBtZW1vcnkgd2hlbiB0aGUgTFZSRVYgbW9kdWxlIGlzIG5vICAgKi8KLS8qICBsb25nZXIgcmVxdWlyZWQuIEl0IGlzIGNhbGxlZCBpbiB0d28gd2F5czogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgaEluc3RhbmNlID0gTlVMTCAgICAgICAgICAgICAgICBSZXR1cm5zIHRoZSBtZW1vcnkgcmVxdWlyZW1lbnRzICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICBoSW5zdGFuY2UgPSBJbnN0YW5jZSBoYW5kbGUgICAgIFJldHVybnMgdGhlIG1lbW9yeSByZXF1aXJlbWVudHMgYW5kIGFsbG9jYXRlZCAgICAgICAqLwotLyogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYmFzZSBhZGRyZXNzZXMuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICBXaGVuIHRoaXMgZnVuY3Rpb24gaXMgY2FsbGVkIHdpdGggaEluc3RhbmNlID0gTlVMTCB0aGUgbWVtb3J5IGJhc2UgYWRkcmVzcyBwb2ludGVycyAqLwotLyogIHdpbGwgYmUgTlVMTCBvbiByZXR1cm4uICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICBXaGVuIHRoZSBmdW5jdGlvbiBpcyBjYWxsZWQgZm9yIGZyZWVpbmcgbWVtb3J5LCBoSW5zdGFuY2UgPSBJbnN0YW5jZSBIYW5kbGUgdGhlICAgICAqLwotLyogIG1lbW9yeSB0YWJsZSByZXR1cm5zIHRoZSBhbGxvY2F0ZWQgbWVtb3J5IGFuZCBiYXNlIGFkZHJlc3NlcyB1c2VkIGR1cmluZyAgICAgICAgICAgICovCi0vKiAgaW5pdGlhbGlzYXRpb24uICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogUEFSQU1FVEVSUzogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgaEluc3RhbmNlICAgICAgICAgICAgICAgSW5zdGFuY2UgSGFuZGxlICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICBwTWVtb3J5VGFibGUgICAgICAgICAgICBQb2ludGVyIHRvIGFuIGVtcHR5IG1lbW9yeSB0YWJsZSAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogIHBJbnN0YW5jZVBhcmFtcyAgICAgICAgIFBvaW50ZXIgdG8gdGhlIGluc3RhbmNlIHBhcmFtZXRlcnMgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qIFJFVFVSTlM6ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogIExWUkVWX1NVQ0NFU1MgICAgICAgICAgIFN1Y2NlZWRlZCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgTFZSRVZfTlVMTEFERFJFU1MgICAgICAgV2hlbiBwTWVtb3J5VGFibGUgaXMgTlVMTCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICBMVlJFVl9OVUxMQUREUkVTUyAgICAgICBXaGVuIHJlcXVlc3RpbmcgbWVtb3J5IHJlcXVpcmVtZW50cyBhbmQgcEluc3RhbmNlUGFyYW1zICAgICAqLwotLyogICAgICAgICAgICAgICAgICAgICAgICAgIGlzIE5VTEwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qIE5PVEVTOiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogIDEuICBUaGlzIGZ1bmN0aW9uIG1heSBiZSBpbnRlcnJ1cHRlZCBieSB0aGUgTFZSRVZfUHJvY2VzcyBmdW5jdGlvbiAgICAgICAgICAgICAgICAgICovCi0vKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotTFZSRVZfUmV0dXJuU3RhdHVzX2VuIExWUkVWX0dldE1lbW9yeVRhYmxlKExWUkVWX0hhbmRsZV90ICAgICAgICAgICBoSW5zdGFuY2UsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTFZSRVZfTWVtb3J5VGFibGVfc3QgICAgICpwTWVtb3J5VGFibGUsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTFZSRVZfSW5zdGFuY2VQYXJhbXNfc3QgICpwSW5zdGFuY2VQYXJhbXMpOwotCi0KLS8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotLyogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiBGVU5DVElPTjogICAgICAgICAgICAgICAgTFZSRVZfR2V0SW5zdGFuY2VIYW5kbGUgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogREVTQ1JJUFRJT046ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgVGhpcyBmdW5jdGlvbiBpcyB1c2VkIHRvIGNyZWF0ZSBhIExWUkVWIG1vZHVsZSBpbnN0YW5jZS4gSXQgcmV0dXJucyB0aGUgY3JlYXRlZCAgICAgKi8KLS8qICBpbnN0YW5jZSBoYW5kbGUgdGhyb3VnaCBwaEluc3RhbmNlLiBBbGwgcGFyYW1ldGVycyBhcmUgc2V0IHRvIGludmFsaWQgdmFsdWVzLCB0aGUgICAqLwotLyogIExWUkVWX1NldENvbnRyb2xQYXJhbWV0ZXJzIGZ1bmN0aW9uIG11c3QgYmUgY2FsbGVkIHdpdGggYSBzZXQgb2YgdmFsaWQgY29udHJvbCAgICAgICovCi0vKiAgcGFyYW1ldGVycyBiZWZvcmUgdGhlIExWUkVWX1Byb2Nlc3MgZnVuY3Rpb24gY2FuIGJlIGNhbGxlZC4gICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogIFRoZSBtZW1vcnkgYWxsb2NhdGlvbiBtdXN0IGJlIHByb3ZpZGVkIGJ5IHRoZSBhcHBsaWNhdGlvbiBieSBmaWxsaW5nIGluIHRoZSBtZW1vcnkgICovCi0vKiAgcmVnaW9uIGJhc2UgYWRkcmVzc2VzIGluIHRoZSBtZW1vcnkgdGFibGUgYmVmb3JlIGNhbGxpbmcgdGhpcyBmdW5jdGlvbi4gICAgICAgICAgICAgKi8KLS8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogUEFSQU1FVEVSUzogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgcGhJbnN0YW5jZSAgICAgICAgICAgICAgUG9pbnRlciB0byB0aGUgaW5zdGFuY2UgaGFuZGxlICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICBwTWVtb3J5VGFibGUgICAgICAgICAgICBQb2ludGVyIHRvIHRoZSBtZW1vcnkgZGVmaW5pdGlvbiB0YWJsZSAgICAgICAgICAgICAgICAgICAgICAqLwotLyogIHBJbnN0YW5jZVBhcmFtcyAgICAgICAgIFBvaW50ZXIgdG8gdGhlIGluc3RhbmNlIHBhcmFtZXRlcnMgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qIFJFVFVSTlM6ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogIExWUkVWX1NVQ0NFU1MgICAgICAgICAgIFN1Y2NlZWRlZCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgTFZSRVZfTlVMTEFERFJFU1MgICAgICAgV2hlbiBwaEluc3RhbmNlIG9yIHBNZW1vcnlUYWJsZSBvciBwSW5zdGFuY2VQYXJhbXMgaXMgTlVMTCAgKi8KLS8qICBMVlJFVl9OVUxMQUREUkVTUyAgICAgICBXaGVuIG9uZSBvZiB0aGUgbWVtb3J5IHJlZ2lvbnMgaGFzIGEgTlVMTCBwb2ludGVyICAgICAgICAgICAqLwotLyogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiBOT1RFUzogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi1MVlJFVl9SZXR1cm5TdGF0dXNfZW4gTFZSRVZfR2V0SW5zdGFuY2VIYW5kbGUoTFZSRVZfSGFuZGxlX3QgICAgICAgICAgICAqcGhJbnN0YW5jZSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBMVlJFVl9NZW1vcnlUYWJsZV9zdCAgICAgICpwTWVtb3J5VGFibGUsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTFZSRVZfSW5zdGFuY2VQYXJhbXNfc3QgICAqcEluc3RhbmNlUGFyYW1zKTsKLQotCi0vKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLS8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogRlVOQ1RJT046ICAgICAgICAgICAgICAgIExWWFhfR2V0Q29udHJvbFBhcmFtZXRlcnMgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qIERFU0NSSVBUSU9OOiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogIFJlcXVlc3QgdGhlIExWUkVWIG1vZHVsZSBjb250cm9sIHBhcmFtZXRlcnMuIFRoZSBjdXJyZW50IHBhcmFtZXRlciBzZXQgaXMgcmV0dXJuZWQgICovCi0vKiAgdmlhIHRoZSBwYXJhbWV0ZXIgcG9pbnRlci4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogUEFSQU1FVEVSUzogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgaEluc3RhbmNlICAgICAgICAgICAgICAgSW5zdGFuY2UgaGFuZGxlICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICBwQ29udHJvbFBhcmFtcyAgICAgICAgICBQb2ludGVyIHRvIGFuIGVtcHR5IHBhcmFtZXRlciBzdHJ1Y3R1cmUgICAgICAgICAgICAgICAgICAgICAqLwotLyogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiBSRVRVUk5TOiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICBMVlJFVl9TVUNDRVNTICAgICAgICAgICBTdWNjZWVkZWQgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogIExWUkVWX05VTExBRERSRVNTICAgICAgIFdoZW4gaEluc3RhbmNlIG9yIHBDb250cm9sUGFyYW1zIGlzIE5VTEwgICAgICAgICAgICAgICAgICAgICovCi0vKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qIE5PVEVTOiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogIDEuICBUaGlzIGZ1bmN0aW9uIG1heSBiZSBpbnRlcnJ1cHRlZCBieSB0aGUgTFZSRVZfUHJvY2VzcyBmdW5jdGlvbiAgICAgICAgICAgICAgICAgICovCi0vKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotTFZSRVZfUmV0dXJuU3RhdHVzX2VuIExWUkVWX0dldENvbnRyb2xQYXJhbWV0ZXJzKExWUkVWX0hhbmRsZV90ICAgICAgICAgICBoSW5zdGFuY2UsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTFZSRVZfQ29udHJvbFBhcmFtc19zdCAgICpwQ29udHJvbFBhcmFtcyk7Ci0KLQotLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0vKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qIEZVTkNUSU9OOiAgICAgICAgICAgICAgICBMVlJFVl9TZXRDb250cm9sUGFyYW1ldGVycyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiBERVNDUklQVElPTjogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICBTZXRzIG9yIGNoYW5nZXMgdGhlIExWUkVWIG1vZHVsZSBwYXJhbWV0ZXJzLiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiBQQVJBTUVURVJTOiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICBoSW5zdGFuY2UgICAgICAgICAgICAgICBJbnN0YW5jZSBoYW5kbGUgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogIHBOZXdQYXJhbXMgICAgICAgICAgICAgIFBvaW50ZXIgdG8gYSBwYXJhbWV0ZXIgc3RydWN0dXJlICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qIFJFVFVSTlM6ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogIExWUkVWX1NVQ0NFU1MgICAgICAgICAgIFN1Y2NlZWRlZCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgTFZSRVZfTlVMTEFERFJFU1MgICAgICAgV2hlbiBoSW5zdGFuY2Ugb3IgcE5ld1BhcmFtcyBpcyBOVUxMICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogTk9URVM6ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgMS4gIFRoaXMgZnVuY3Rpb24gbWF5IGJlIGludGVycnVwdGVkIGJ5IHRoZSBMVlJFVl9Qcm9jZXNzIGZ1bmN0aW9uICAgICAgICAgICAgICAgICAgKi8KLS8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi1MVlJFVl9SZXR1cm5TdGF0dXNfZW4gTFZSRVZfU2V0Q29udHJvbFBhcmFtZXRlcnMoTFZSRVZfSGFuZGxlX3QgICAgICAgICAgIGhJbnN0YW5jZSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBMVlJFVl9Db250cm9sUGFyYW1zX3N0ICAgKnBOZXdQYXJhbXMpOwotCi0KLS8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotLyogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiBGVU5DVElPTjogICAgICAgICAgICAgICAgTFZSRVZfQ2xlYXJBdWRpb0J1ZmZlcnMgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogREVTQ1JJUFRJT046ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgVGhpcyBmdW5jdGlvbiBpcyB1c2VkIHRvIGNsZWFyIHRoZSBpbnRlcm5hbCBhdWRpbyBidWZmZXJzIG9mIHRoZSBtb2R1bGUuICAgICAgICAgICAgKi8KLS8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogUEFSQU1FVEVSUzogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgaEluc3RhbmNlICAgICAgICAgICAgICAgSW5zdGFuY2UgaGFuZGxlICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogUkVUVVJOUzogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgTFZSRVZfU1VDQ0VTUyAgICAgICAgICBJbml0aWFsaXNhdGlvbiBzdWNjZWVkZWQgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICBMVlJFVl9OVUxMQUREUkVTUyAgICAgIEluc3RhbmNlIGlzIE5VTEwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiBOT1RFUzogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICAxLiBUaGlzIGZ1bmN0aW9uIG11c3Qgbm90IGJlIGludGVycnVwdGVkIGJ5IHRoZSBMVlJFVl9Qcm9jZXNzIGZ1bmN0aW9uICAgICAgICAgICAgICAqLwotLyogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLUxWUkVWX1JldHVyblN0YXR1c19lbiBMVlJFVl9DbGVhckF1ZGlvQnVmZmVycyhMVlJFVl9IYW5kbGVfdCAgaEluc3RhbmNlKTsKLQotCi0vKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLS8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogRlVOQ1RJT046ICAgICAgICAgICAgICAgIExWUkVWX1Byb2Nlc3MgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qIERFU0NSSVBUSU9OOiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogIFByb2Nlc3MgZnVuY3Rpb24gZm9yIHRoZSBMVlJFViBtb2R1bGUuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qIFBBUkFNRVRFUlM6ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogIGhJbnN0YW5jZSAgICAgICAgICAgICAgIEluc3RhbmNlIGhhbmRsZSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgcEluRGF0YSAgICAgICAgICAgICAgICAgUG9pbnRlciB0byB0aGUgaW5wdXQgZGF0YSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICBwT3V0RGF0YSAgICAgICAgICAgICAgICBQb2ludGVyIHRvIHRoZSBvdXRwdXQgZGF0YSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogIE51bVNhbXBsZXMgICAgICAgICAgICAgIE51bWJlciBvZiBzYW1wbGVzIGluIHRoZSBpbnB1dCBidWZmZXIgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qIFJFVFVSTlM6ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogIExWUkVWX1NVQ0NFU1MgICAgICAgICAgIFN1Y2NlZWRlZCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgTFZSRVZfSU5WQUxJRE5VTVNBTVBMRVMgTnVtU2FtcGxlcyB3YXMgbGFyZ2VyIHRoYW4gdGhlIG1heGltdW0gYmxvY2sgc2l6ZSAgICAgICAgICAgKi8KLS8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogTk9URVM6ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgMS4gVGhlIGlucHV0IGFuZCBvdXRwdXQgYnVmZmVycyBtdXN0IGJlIDMyLWJpdCBhbGlnbmVkICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi1MVlJFVl9SZXR1cm5TdGF0dXNfZW4gTFZSRVZfUHJvY2VzcyhMVlJFVl9IYW5kbGVfdCAgICAgIGhJbnN0YW5jZSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbnN0IExWTV9JTlQzMiAgICAgKnBJbkRhdGEsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBMVk1fSU5UMzIgICAgICAgICAgICpwT3V0RGF0YSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbnN0IExWTV9VSU5UMTYgICAgICAgICAgTnVtU2FtcGxlcyk7Ci0KLQotI2lmZGVmIF9fY3BsdXNwbHVzCi19Ci0jZW5kaWYgLyogX19jcGx1c3BsdXMgKi8KLQotI2VuZGlmICAgICAgLyogX19MVlJFVl9IX18gKi8KLQotLyogRW5kIG9mIGZpbGUgKi8KZGlmZiAtLWdpdCBhL21lZGlhL2xpYmVmZmVjdHMvbHZtL2xpYi9SZXZlcmIvc3JjL0xWUkVWX0FwcGx5TmV3U2V0dGluZ3MuYyBiL21lZGlhL2xpYmVmZmVjdHMvbHZtL2xpYi9SZXZlcmIvc3JjL0xWUkVWX0FwcGx5TmV3U2V0dGluZ3MuYwpkZWxldG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Y2Vuc2UuCi0gKi8KLQotLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0vKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICBJbmNsdWRlcyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLSNpbmNsdWRlICJMVlJFVl9Qcml2YXRlLmgiCi0jaW5jbHVkZSAiRmlsdGVyLmgiCi0KLS8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotLyogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiBGVU5DVElPTjogICAgICAgICAgICAgICAgTFZSRVZfQXBwbHlOZXdTZXR0aW5ncyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogREVTQ1JJUFRJT046ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgQXBwbGllcyB0aGUgbmV3IGNvbnRyb2wgcGFyYW1ldGVycyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogUEFSQU1FVEVSUzogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgcFByaXZhdGUgICAgICAgICAgICAgICAgUG9pbnRlciB0byB0aGUgaW5zdGFuY2UgcHJpdmF0ZSBwYXJhbWV0ZXJzICAgICAgICAgICAgICAgICAgKi8KLS8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogUkVUVVJOUzogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgTFZSRVZfU3VjY2VzcyAgICAgICAgICAgU3VjY2VlZGVkICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICBMVlJFVl9OVUxMQUREUkVTUyAgICAgICBXaGVuIHBQcml2YXRlIGlzIE5VTEwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiBOT1RFUzogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0KLUxWUkVWX1JldHVyblN0YXR1c19lbiBMVlJFVl9BcHBseU5ld1NldHRpbmdzIChMVlJFVl9JbnN0YW5jZV9zdCAgICAgKnBQcml2YXRlKQotewotCi0gICAgTFZNX01vZGVfZW4gIE9wZXJhdGluZ01vZGU7Ci0gICAgTFZNX0lOVDMyICAgIE51bWJlck9mRGVsYXlMaW5lczsKLQotCi0gICAgLyogQ2hlY2sgZm9yIE5VTEwgcG9pbnRlciAqLwotICAgIGlmKHBQcml2YXRlID09IExWTV9OVUxMKQotICAgIHsKLSAgICAgICAgcmV0dXJuIExWUkVWX05VTExBRERSRVNTOwotICAgIH0KLQotICAgIE9wZXJhdGluZ01vZGUgPSBwUHJpdmF0ZS0+TmV3UGFyYW1zLk9wZXJhdGluZ01vZGU7Ci0KLSAgICBpZihwUHJpdmF0ZS0+SW5zdGFuY2VQYXJhbXMuTnVtRGVsYXlzID09IExWUkVWX0RFTEFZTElORVNfNCkKLSAgICB7Ci0gICAgICAgIE51bWJlck9mRGVsYXlMaW5lcyA9IDQ7Ci0gICAgfQotICAgIGVsc2UgaWYocFByaXZhdGUtPkluc3RhbmNlUGFyYW1zLk51bURlbGF5cyA9PSBMVlJFVl9ERUxBWUxJTkVTXzIpCi0gICAgewotICAgICAgICBOdW1iZXJPZkRlbGF5TGluZXMgPSAyOwotICAgIH0KLSAgICBlbHNlCi0gICAgewotICAgICAgICBOdW1iZXJPZkRlbGF5TGluZXMgPSAxOwotICAgIH0KLQotICAgIC8qCi0gICAgICogVXBkYXRlIHRoZSBoaWdoIHBhc3MgZmlsdGVyIGNvZWZmaWNpZW50cwotICAgICAqLwotICAgIGlmKChwUHJpdmF0ZS0+TmV3UGFyYW1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Gk9MDsgaTxOdW1iZXJPZkRlbGF5TGluZXM7IGkrKykKLSAgICAgICAgewotICAgICAgICAgICAgaWYgKGkgIT0gMCkKLSAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICBMVk1fSU5UMzIgVGVtcDE7ICAvKiB0byBhdm9pZCBRQUMgd2FybmluZyBvbiB0eXBlIGNvbnZlcnNpb24gKi8KLSAgICAgICAgICAgICAgICBMVk1fSU5UMzIgVGVtcDI7ICAvKiB0byBhdm9pZCBRQUMgd2FybmluZyBvbiB0eXBlIGNvbnZlcnNpb24gKi8KLQotICAgICAgICAgICAgICAgIFRlbXAyPShMVk1fSU5UMzIpRGVsYXlMZW5ndGhTYW1wbGVzOwotICAgICAgICAgICAgICAgIE1VTDMyeDE2SU5UTzMyKFRlbXAyLCBTY2FsZVRhYmxlW2ldLCBUZW1wMSwgMTUpCi0gICAgICAgICAgICAgICAgVGVtcD0oTFZNX1VJTlQzMilUZW1wMTsKLSAgICAgICAgICAgIH0KLSAgICAgICAgICAgIGVsc2UKLSAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgIFRlbXAgPSBEZWxheUxlbmd0aFNhbXBsZXM7Ci0gICAgICAgICAgICB9Ci0gICAgICAgICAgICBBUERlbGF5U2l6ZSA9IFRlbXAgIC8gMTUwMDsKLQotCi0gICAgICAgICAgICAvKgotICAgICAgICAgICAgICogU2V0IHRoZSBmaXhlZCBkZWxheQotICAgICAgICAgICAgICovCi0gICAgICAgICAgICBUZW1wICAgICAgICAgICAgICAgICAgPSAoTWF4VF9EZWxheVtpXSAtIE1heEFQX0RlbGF5W2ldKSAqIEZzIC8gNDgwMDA7Ci0gICAgICAgICAgICBwUHJpdmF0ZS0+RGVsYXlfQVBbaV0gPSBwUHJpdmF0ZS0+VFtpXSAtIFRlbXA7Ci0KLQotICAgICAgICAgICAgLyoKLSAgICAgICAgICAgICAqIFNldCB0aGUgdGFwIHNlbGVjdGlvbgotICAgICAgICAgICAgICovCi0gICAgICAgICAgICBpZiAocFByaXZhdGUtPkFCX1NlbGVjdGlvbikKLSAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAvKiBTbW9vdGggZnJvbSB0YXAgQSB0byB0YXAgQiAqLwotICAgICAgICAgICAgICAgIHBQcml2YXRlLT5wT2Zmc2V0QltpXSAgICAgICAgICAgICA9ICZwUHJpdmF0ZS0+cERlbGF5X1RbaV1bcFByaXZhdGUtPlRbaV0gLSBUZW1wIC0gQVBEZWxheVNpemVdOwotICAgICAgICAgICAgICAgIHBQcml2YXRlLT5CX0RlbGF5U2l6ZVtpXSAgICAgICAgICA9IEFQRGVsYXlTaXplOwotICAgICAgICAgICAgICAgIHBQcml2YXRlLT5NaXhlcl9BUFRhcHNbaV0uVGFyZ2V0MSA9IDA7Ci0gICAgICAgICAgICAgICAgcFByaXZhdGUtPk1peGVyX0FQVGFwc1tpXS5UYXJnZXQyID0gMHg3ZmZmZmZmZjsKLSAgICAgICAgICAgIH0KLSAgICAgICAgICAgIGVsc2UKLSAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAvKiBTbW9vdGggZnJvbSB0YXAgQiB0byB0YXAgQSAqLwotICAgICAgICAgICAgICAgIHBQcml2YXRlLT5wT2Zmc2V0QVtpXSAgICAgICAgICAgICA9ICZwUHJpdmF0ZS0+cERlbGF5X1RbaV1bcFByaXZhdGUtPlRbaV0gLSBUZW1wIC0gQVBEZWxheVNpemVdOwotICAgICAgICAgICAgICAgIHBQcml2YXRlLT5BX0RlbGF5U2l6ZVtpXSAgICAgICAgICA9IEFQRGVsYXlTaXplOwotICAgICAgICAgICAgICAgIHBQcml2YXRlLT5NaXhlcl9BUFRhcHNbaV0uVGFyZ2V0MiA9IDA7Ci0gICAgICAgICAgICAgICAgcFByaXZhdGUtPk1peGVyX0FQVGFwc1tpXS5UYXJnZXQxID0gMHg3ZmZmZmZmZjsKLSAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgLyoKLSAgICAgICAgICAgICAqIFNldCB0aGUgbWF4aW11bSBibG9jayBzaXplIHRvIHRoZSBzbWFsbGVzdCBkZWxheSBzaXplCi0gICAgICAgICAgICAgKi8KLSAgICAgICAgICAgIHBQcml2YXRlLT5NYXhCbGtMZW4gICA9IFRlbXA7Ci0gICAgICAgICAgICBpZiAocFByaXZhdGUtPk1heEJsa0xlbiA+IHBQcml2YXRlLT5BX0RlbGF5U2l6ZVtpXSkKLSAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICBwUHJpdmF0ZS0+TWF4QmxrTGVuID0gcFByaXZhdGUtPkFfRGVsYXlTaXplW2ldOwotICAgICAgICAgICAgfQotICAgICAgICAgICAgaWYgKHBQcml2YXRlLT5NYXhCbGtMZW4gPiBwUHJpdmF0ZS0+Ql9EZWxheVNpemVbaV0pCi0gICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgcFByaXZhdGUtPk1heEJsa0xlbiA9IHBQcml2YXRlLT5CX0RlbGF5U2l6ZVtpXTsKLSAgICAgICAgICAgIH0KLSAgICAgICAgfQotICAgICAgICBpZiAocFByaXZhdGUtPkFCX1NlbGVjdGlvbikKLSAgICAgICAgewotICAgICAgICAgICAgcFByaXZhdGUtPkFCX1NlbGVjdGlvbiA9IDA7Ci0gICAgICAgIH0KLSAgICAgICAgZWxzZQotICAgICAgICB7Ci0gICAgICAgICAgICBwUHJpdmF0ZS0+QUJfU2VsZWN0aW9uID0gMTsKLSAgICAgICAgfQotCi0KLSAgICAgICAgLyoKLSAgICAgICAgICogTGltaXQgdGhlIG1heGltdW0gYmxvY2sgbGVuZ3RoCi0gICAgICAgICAqLwotICAgICAgICBwUHJpdmF0ZS0+TWF4QmxrTGVuPXBQcml2YXRlLT5NYXhCbGtMZW4tMjsgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLyogSnVzdCBhcyBhIHByZWNhdXNpb24sIGJ1dCBubyBwcm9ibGVtIGlmIHdlIHJlbW92ZSB0aGlzIGxpbmUgICAgICAqLwotICAgICAgICBpZihwUHJpdmF0ZS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Ci0gICAgICAgICAqIEZvciBlYWNoIGZpbHRlcgotICAgICAgICAgKi8KLSAgICAgICAgZm9yIChpPTA7IGk8TnVtYmVyT2ZEZWxheUxpbmVzOyBpKyspCi0gICAgICAgIHsKLSAgICAgICAgICAgIGlmIChpICE9IDApCi0gICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgTVVMMzJ4MTZJTlRPMzIoU2NhbGVUYWJsZVtpXSwgRGFtcGluZywgVGVtcCwgMTUpCi0gICAgICAgICAgICB9Ci0gICAgICAgICAgICBlbHNlCi0gICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgVGVtcCA9IERhbXBpbmc7Ci0gICAgICAgICAgICB9Ci0gICAgICAgICAgICBpZihUZW1wIDw9IChMVk1fRnNUYWJsZVtwUHJpdmF0ZS0+TmV3UGFyYW1zLlNhbXBsZVJhdGVdID4+IDEpKQotICAgICAgICAgICAgewotICAgICAgICAgICAgICAgIE9tZWdhID0gTFZNX0dldE9tZWdhKChMVk1fVUlOVDE2KVRlbXAsIHBQcml2YXRlLT5OZXdQYXJhbXMuU2FtcGxlUmF0ZSk7Ci0gICAgICAgICAgICAgICAgTFZNX0ZPX0xQRihPbWVnYSwgJkNvZWZmcyk7Ci0gICAgICAgICAgICB9Ci0gICAgICAgICAgICBlbHNlCi0gICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgQ29lZmZzLkEwID0gMHg3RkYwMDAwMDsKLSAgICAgICAgICAgICAgICBDb2VmZnMuQTEgPSAwOwotICAgICAgICAgICAgICAgIENvZWZmcy5CMSA9IDA7Ci0gICAgICAgICAgICB9Ci0gICAgICAgICAgICBGT18xSV9EMzJGMzJDbGxfVFJDX1dSQV8wMV9Jbml0KCZwUHJpdmF0ZS0+cEZhc3RDb2VmLT5SZXZMUENvZWZzW2ldLCAmcFByaXZhdGUtPnBGYXN0RGF0YS0+UmV2TFBUYXBzW2ldLCAmQ29lZmZzKTsKLSAgICAgICAgfQotICAgIH0KLQotCi0gICAgLyoKL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YmFja1tpXS5BbHBoYSAgICA9IEFscGhhOwotICAgICAgICAgICAgcFByaXZhdGUtPk1peGVyX1NHRmVlZGZvcndhcmRbaV0uQWxwaGEgPSBBbHBoYTsKLSAgICAgICAgfQotICAgIH0KLQotCi0gICAgLyoKLSAgICAgKiBVcGRhdGUgdGhlIGZlZWQgYmFjayBnYWluCi0gICAgICovCi0gICAgaWYoIChwUHJpdmF0ZS0+TmV3UGFyYW1zLlJvb21TaXplICAgIT0gcFByaXZhdGUtPkN1cnJlbnRQYXJhbXMuUm9vbVNpemUpICAgfHwKLSAgICAgICAgKHBQcml2YXRlLT5OZXdQYXJhbXMuU2FtcGxlUmF0ZSAhPSBwUHJpdmF0ZS0+Q3VycmVudFBhcmFtcy5TYW1wbGVSYXRlKSB8fAotICAgICAgICAocFByaXZhdGUtPk5ld1BhcmFtcy5UNjAgICAgICAgICE9IHBQcml2YXRlLT5DdXJyZW50UGFyYW1zLlQ2MCkgICAgICAgIHx8Ci0gICAgICAgIChwUHJpdmF0ZS0+YkZpcnN0Q29udHJvbCAgICAgICAgPT0gTFZNX1RSVUUpKQotICAgIHsKLQotICAgICAgICBMVk1fSU5UMzIgICAgICAgICAgICAgICBHWzRdOyAgICAgICAgICAgICAgICAgICAgICAgLyogRmVlZGJhY2sgZ2FpbiAoUTcuMjQpICovCi0KLSAgICAgICAgaWYocFByaXZhdGUtPk5ld1BhcmFtcy5UNjAgPT0gMCkKLSAgICAgICAgewotICAgICAgICAgICAgR1szXSA9IDA7Ci0gICAgICAgICAgICBHWzJdID0gMDsKLSAgICAgICAgICAgIEdbMV0gPSAwOwotICAgICAgICAgICAgR1swXSA9IDA7Ci0gICAgICAgIH0KLSAgICAgICAgZWxzZQotICAgICAgICB7Ci0gICAgICAgICAgICBMVk1fSU5UMzIgICBUZW1wMTsKLSAgICAgICAgICAgIExWTV9JTlQzMiAgIFRlbXAyOwotICAgICAgICAgICAgTFZNX0lOVDE2ICAgaTsKLSAgICAgICAgICAgIExWTV9JTlQxNiAgIFNjYWxlVGFibGVbXSA9IHtMVlJFVl9UXzNfUG93ZXJfbWludXMwX29uXzQsIExWUkVWX1RfM19Qb3dlcl9taW51czFfb25fNCwgTFZSRVZfVF8zX1Bvd2VyX21pbnVzMl9vbl80LCBMVlJFVl9UXzNfUG93ZXJfbWludXMzX29uXzR9OwotCi0KLSAgICAgICAgICAgIC8qCi0gICAgICAgICAgICAgKiBGb3IgZWFjaCBkZWxheSBsaW5lCi0gICAgICAgICAgICAgKi8KLSAgICAgICAgICAgIGZvciAoaT0wOyBpPE51bWJlck9mRGVsYXlMaW5lczsgaSsrKQotICAgICAgICAgICAgewotICAgICAgICAgICAgICAgIFRlbXAxID0gKDMgKiBwUHJpdmF0ZS0+Um9vbVNpemVJbm1zICogU2NhbGVUYWJsZVtpXSkgLyBwUHJpdmF0ZS0+TmV3UGFyYW1zLlQ2MDsKLSAgICAgICAgICAgICAgICBpZihUZW1wMSA+PSAoNCA8PCAxNSkpCi0gICAgICAgICAgICAgICAgewotICAgICAgICAgICAgICAgICAgICBHW2ldID0gMDsKLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgZWxzZSBpZigoVGVtcDEgPj0gKDIgPDwgMTUpKSkKLSAgICAgICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgICAgIFRlbXAyID0gTFZNX1Bvd2VyMTAoLShUZW1wMSA8PCAxNCkpOwotICAgICAgICAgICAgICAgICAgICBUZW1wMSA9IExWTV9Qb3dlcjEwKC0oVGVtcDEgPDwgMTQpKTsKLSAgICAgICAgICAgICAgICAgICAgTVVMMzJ4MzJJTlRPMzIoVGVtcDEsVGVtcDIsVGVtcDEsMjQpCi0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgIGVsc2UKLSAgICAgICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgICAgIFRlbXAxID0gTFZNX1Bvd2VyMTAoLShUZW1wMSA8PCAxNSkpOwotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICBpZiAoTnVtYmVyT2ZEZWxheUxpbmVzID09IDEpCi0gICAgICAgICAgICAgICAgewotICAgICAgICAgICAgICAgICAgICBHW2ldID0gVGVtcDE7Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgIGVsc2UKLSAgICAgICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgICAgIExWTV9JTlQzMiAgIFRlbXBHOwotICAgICAgICAgICAgICAgICAgICBNVUwzMngxNklOVE8zMihUZW1wMSxPTkVfT1ZFUl9TUVJUX1RXTyxUZW1wRywxNSkKLSAgICAgICAgICAgICAgICAgICAgR1tpXT1UZW1wRzsKLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICB9Ci0gICAgICAgIH0KLQotICAgICAgICAvKiBTZXQgdXAgdGhlIGZlZWRiYWNrIG1peGVycyBmb3IgZm91ciBkZWxheSBsaW5lcyAqLwotICAgICAgICBwUHJpdmF0ZS0+RmVlZGJhY2tNaXhlclswXS5UYXJnZXQ9R1swXTw8NzsKLSAgICAgICAgcFByaXZhdGUtPkZlZWRiYWNrTWl4ZXJbMV0uVGFyZ2V0PUdbMV08PDc7Ci0gICAgICAgIHBQcml2YXRlLT5GZWVkYmFja01peGVyWzJdLlRhcmdldD1HWzJdPDw3OwotICAgICAgICBwUHJpdmF0ZS0+RmVlZGJhY2tNaXhlclszXS5UYXJnZXQ9R1szXTw8NzsKLSAgICB9Ci0KLQotICAgIC8qCi0gICAgICogQ2FsY3VsYXRlIHRoZSBnYWluIGNvcnJlY3Rpb24KLSAgICAgKi8KLSAgICBpZigocFByaXZhdGUtPk5ld1BhcmFtcy5Sb29tU2l6ZSAhPSBwUHJpdmF0ZS0+Q3VycmVudFBhcmFtcy5Sb29tU2l6ZSkgfHwKLSAgICAgICAocFByaXZhdGUtPk5ld1BhcmFtcy5MZXZlbCAgICAhPSBwUHJpdmF0ZS0+Q3VycmVudFBhcmFtcy5MZXZlbCkgICAgfHwKLSAgICAgICAocFByaXZhdGUtPk5ld1BhcmFtcy5UNjAgICAgICAhPSBwUHJpdmF0ZS0+Q3VycmVudFBhcmFtcy5UNjApICkKLSAgICB7Ci0gICAgICAgIExWTV9JTlQzMiBJbmRleD0wOwotICAgICAgICBMVk1fSU5UMzIgaT0wOwotICAgICAgICBMVk1fSU5UMzIgR2Fpbj0wOwotICAgICAgICBMVk1fSU5UMzIgUm9vbVNpemU9MDsKLSAgICAgICAgTFZNX0lOVDMyIFQ2MDsKLSAgICAgICAgTFZNX0lOVDMyIENvZWZzWzVdOwotCi0gICAgICAgIGlmKHBQcml2YXRlLT5OZXdQYXJhbXMuUm9vbVNpemU9PTApCi0gICAgICAgIHsKLSAgICAgICAgICAgIFJvb21TaXplPTE7Ci0gICAgICAgIH0KLSAgICAgICAgZWxzZQotICAgICAgICB7Ci0gICAgICAgICAgICBSb29tU2l6ZT0oTFZNX0lOVDMyKXBQcml2YXRlLT5OZXdQYXJhbXMuUm9vbVNpemU7Ci0gICAgICAgIH0KLQotICAgICAgICBpZihwUHJpdmF0ZS0+TmV3UGFyYW1zLlQ2MDwxMDApCi0gICAgICAgIHsKLSAgICAgICAgICAgIFQ2MCA9IDEwMCAqIExWUkVWX1Q2MF9TQ0FMRTsKLSAgICAgICAgfQotICAgICAgICBlbHNlCi0gICAgICAgIHsKLSAgICAgICAgICAgIFQ2MCA9IHBQcml2YXRlLT5OZXdQYXJhbXMuVDYwICogTFZSRVZfVDYwX1NDQUxFOwotICAgICAgICB9Ci0KLSAgICAgICAgLyogRmluZCB0aGUgbmVhcmVzdCByb29tIHNpemUgaW4gdGFibGUgKi8KLSAgICAgICAgZm9yKGk9MDtpPDI0O2krKykKLSAgICAgICAgewotICAgICAgICAgICAgaWYoUm9vbVNpemU8PSBMVlJFVl9HYWluUG9seVRhYmxlW2ldWzBdKQotICAgICAgICAgICAgewotICAgICAgICAgICAgICAgIEluZGV4PWk7Ci0gICAgICAgICAgICAgICAgYnJlYWs7Ci0gICAgICAgICAgICB9Ci0gICAgICAgIH0KLQotCi0gICAgICAgIGlmKFJvb21TaXplPT1MVlJFVl9HYWluUG9seVRhYmxlW0luZGV4XVswXSkKLSAgICAgICAgewotICAgICAgICAgICAgLyogVGFrZSB0YWJsZSB2YWx1ZXMgaWYgdGhlIHJvb20gc2l6ZSBpcyBpbiB0YWJsZSAqLwotICAgICAgICAgICAgZm9yKGk9MTtpPDU7aSsrKQotICAgICAgICAgICAgewotICAgICAgICAgICAgICAgIENvZWZzW2ktMV09TFZSRVZfR2FpblBvbHlUYWJsZVtJbmRleF1baV07Ci0gICAgICAgICAgICB9Ci0gICAgICAgICAgICBDb2Vmc1s0XT0wOwotICAgICAgICAgICAgR2Fpbj1MVk1fUG9seW5vbWlhbCgzLENvZWZzLFQ2MCk7ICAgICAgIC8qIFEuMjQgcmVzdWx0ICovCi0gICAgICAgIH0KLSAgICAgICAgZWxzZQotICAgICAgICB7Ci0gICAgICAgICAgICAvKiBJbnRlcnBvbGF0ZSB0aGUgZ2FpbiBiZXR3ZWVuIG5lYXJlc3Qgcm9vbSBzaXplcyAqLwotCi0gICAgICAgICAgICBMVk1fSU5UMzIgR2FpbjEsR2FpbjI7Ci0gICAgICAgICAgICBMVk1fSU5UMzIgVG90X0Rpc3QsRGlzdDsKLQotICAgICAgICAgICAgVG90X0Rpc3Q9TFZSRVZfR2FpblBvbHlUYWJsZVtJbmRleF1bMF0tTFZSRVZfR2FpblBvbHlUYWJsZVtJbmRleC0xXVswXTsKLSAgICAgICAgICAgIERpc3Q9Um9vbVNpemUtTFZSRVZfR2FpblBvbHlUYWJsZVtJbmRleC0xXVswXTsKLQotCi0gICAgICAgICAgICAvKiBHZXQgZ2FpbiBmb3IgZmlyc3QgKi8KLSAgICAgICAgICAgIGZvcihpPTE7aTw1O2krKykKLSAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICBDb2Vmc1tpLTFdPUxWUkVWX0dhaW5Qb2x5VGFibGVbSW5kZXgtMV1baV07Ci0gICAgICAgICAgICB9Ci0gICAgICAgICAgICBDb2Vmc1s0XT0wOwotCi0gICAgICAgICAgICBHYWluMT1MVk1fUG9seW5vbWlhbCgzLENvZWZzLFQ2MCk7ICAgICAgLyogUS4yNCByZXN1bHQgKi8KLQotICAgICAgICAgICAgLyogR2V0IGdhaW4gZm9yIHNlY29uZCAqLwotICAgICAgICAgICAgZm9yKGk9MTtpPDU7aSsrKQotICAgICAgICAgICAgewotICAgICAgICAgICAgICAgIENvZWZzW2ktMV09TFZSRVZfR2FpblBvbHlUYWJsZVtJbmRleF1baV07Ci0gICAgICAgICAgICB9Ci0gICAgICAgICAgICBDb2Vmc1s0XT0wOwotCi0gICAgICAgICAgICBHYWluMj1MVk1fUG9seW5vbWlhbCgzLENvZWZzLFQ2MCk7ICAgICAgLyogUS4yNCByZXN1bHQgKi8KLQotICAgICAgICAgICAgLyogTGluZWFyIEludGVycG9sYXRlIHRoZSBnYWluICovCi0gICAgICAgICAgICBHYWluID0gR2FpbjErICgoKEdhaW4yLUdhaW4xKSpEaXN0KS8oVG90X0Rpc3QpKTsKLSAgICAgICAgfQotCi0KLSAgICAgICAgLyoKLSAgICAgICAgICogR2V0IHRoZSBpbnZlcnNlIG9mIGdhaW46IFEuMTUKLSAgICAgICAgICogR2FpbiBpcyBtb3N0bHkgYWJvdmUgb25lIGV4Y2VwdCBmZXcgY2FzZXMsIHRha2Ugb25seSBnYWlucyBhYm92ZSAxCi0gICAgICAgICAqLwotICAgICAgICBpZihHYWluIDwgMTY3NzcyMTZMKQotICAgICAgICB7Ci0gICAgICAgICAgICBwUHJpdmF0ZS0+R2Fpbj0gMzI3Njc7Ci0gICAgICAgIH0KLSAgICAgICAgZWxzZQotICAgICAgICB7Ci0gICAgICAgICAgICBwUHJpdmF0ZS0+R2Fpbj0oTFZNX0lOVDE2KShMVk1fTUFYSU5UXzMyLyhHYWluPj44KSk7Ci0gICAgICAgIH0KLQotCi0gICAgICAgIEluZGV4PSgoMzI3NjcqMTAwKS8oMTAwK3BQcml2YXRlLT5OZ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ZNX01PREVfT04pCi0gICAgICAgIHsKLSAgICAgICAgICAgIHBQcml2YXRlLT5CeXBhc3NNaXhlci5UYXJnZXQyID0gKChMVk1fSU5UMzIpKHBQcml2YXRlLT5OZXdQYXJhbXMuTGV2ZWwgKiAzMjc2NykvMTAwKTw8MTY7Ci0gICAgICAgICAgICBwUHJpdmF0ZS0+QnlwYXNzTWl4ZXIuVGFyZ2V0MSA9IDB4MDAwMDAwMDA7Ci0KLSAgICAgICAgICAgIHBQcml2YXRlLT5CeXBhc3NNaXhlci5DYWxsYmFja1NldDIgPSBMVk1fRkFMU0U7Ci0gICAgICAgICAgICBPcGVyYXRpbmdNb2RlICAgICAgICAgICAgICAgICAgICAgID0gTFZNX01PREVfT047Ci0gICAgICAgICAgICBpZiAocFByaXZhdGUtPk5ld1BhcmFtcy5MZXZlbCA9PSAwKQotICAgICAgICAgICAgewotICAgICAgICAgICAgICAgIHBQcml2YXRlLT5iRGlzYWJsZVJldmVyYiA9IExWTV9UUlVFOwotICAgICAgICAgICAgfQotICAgICAgICAgICAgZWxzZQotICAgICAgICAgICAgewotICAgICAgICAgICAgICAgIHBQcml2YXRlLT5iRGlzYWJsZVJldmVyYiA9IExWTV9GQUxTRTsKLSAgICAgICAgICAgIH0KLSAgICAgICAgfQotICAgICAgICBlbHNlIGlmIChwUHJpdmF0ZS0+YkZpcnN0Q29udHJvbCA9PSBMVk1fRkFMU0UpCi0gICAgICAgIHsKLSAgICAgICAgICAgIHBQcml2YXRlLT5CeXBhc3NNaXhlci5UYXJnZXQyID0gMHgwMDAwMDAwMDsKLSAgICAgICAgICAgIHBQcml2YXRlLT5CeXBhc3NNaXhlci5UYXJnZXQxID0gMHgwMDAwMDAwMDsKLSAgICAgICAgICAgIHBQcml2YXRlLT5CeXBhc3NNaXhlci5DYWxsYmFja1NldDIgPSBMVk1fVFJVRTsKLSAgICAgICAgICAgIHBQcml2YXRlLT5HYWluTWl4ZXIuVGFyZ2V0ICAgID0gMHgwM0ZGRkZGRjs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KLQotCi0vKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLS8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogRlVOQ1RJT046ICAgICAgICAgICAgICAgIEJ5cGFzc01peGVyX0NhbGxiYWNrICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qIERFU0NSSVBUSU9OOiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogIENvbnRyb2xzIHRoZSBPbiB0byBPZmYgb3BlcmF0aW5nIG1vZGUgdHJhbnNpdGlvbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qIFBBUkFNRVRFUlM6ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogIHBQcml2YXRlICAgICAgICAgICAgICAgIFBvaW50ZXIgdG8gdGhlIGluc3RhbmNlIHByaXZhdGUgcGFyYW1ldGVycyAgICAgICAgICAgICAgICAgICovCi0vKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qIFJFVFVSTlM6ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogIExWUkVWX1N1Y2Nlc3MgICAgICAgICAgIFN1Y2NlZWRlZCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgTFZSRVZfTlVMTEFERFJFU1MgICAgICAgV2hlbiBwUHJpdmF0ZSBpcyBOVUxMICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogTk9URVM6ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotTFZNX0lOVDMyIEJ5cGFzc01peGVyX0NhbGxiYWNrICh2b2lkICpwQ2FsbGJhY2tEYXRhLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2b2lkICpwR2VuZXJhbFB1cnBvc2UsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIExWTV9JTlQxNiBHZW5lcmFsUHVycG9zZSApCi17Ci0KLSAgICBMVlJFVl9JbnN0YW5jZV9zdCAgICAgKnBMVlJFVl9Qcml2YXRlID0gKExWUkVWX0luc3RhbmNlX3N0ICopcENhbGxiYWNrRGF0YTsKLQotCi0gICAgLyoKLSAgICAgKiBBdm9pZCBidWlsZCB3YXJuaW5ncwotICAgICAqLwotICAgICh2b2lkKXBHZW5l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GluIGNvbXBsaWFuY2Ugd2l0aCB0aGUgTGljZW5zZS4KLSAqIFlvdSBtYXkgb2J0YWluIGEgY29weSBvZiB0aGUgTGljZW5zZSBhdAotICoKLSAqICAgICAgaHR0cDovL3d3dy5hcGFjaGUub3JnL2xpY2Vuc2VzL0xJQ0VOU0UtMi4wCi0gKgotICogVW5sZXNzIHJlcXVpcmVkIGJ5IGFwcGxpY2FibGUgbGF3IG9yIGFncmVlZCB0byBpbiB3cml0aW5nLCBzb2Z0d2FyZQotICogZGlzdHJpYnV0ZWQgdW5kZXIgdGhlIExpY2Vuc2UgaXMgZGlzdHJpYnV0ZWQgb24gYW4gIkFTIElTIiBCQVNJUywKLSAqIFdJVEhPVVQgV0FSUkFOVElFUyBPUiBDT05ESVRJT05TIE9GIEFOWSBLSU5ELCBlaXRoZXIgZXhwcmVzcyBvciBpbXBsaWVkLgotICogU2VlIHRoZSBMaWNlbnNlIGZvciB0aGUgc3BlY2lmaWMgbGFuZ3VhZ2UgZ292ZXJuaW5nIHBlcm1pc3Npb25zIGFuZAotICogbGltaXRhdGlvbnMgdW5kZXIgdGhlIExpY2Vuc2UuCi0gKi8KLQotLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0vKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qIEluY2x1ZGVzICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLSNpbmNsdWRlICJMVlJFVl9Qcml2YXRlLmgiCi0jaW5jbHVkZSAiVmVjdG9yQXJpdGhtZXRpYy5oIgotCi0KLS8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotLyogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiBGVU5DVElPTjogICAgICAgICAgICAgICAgTFZSRVZfQ2xlYXJBdWRpb0J1ZmZlcnMgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogREVTQ1JJUFRJT046ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgVGhpcyBmdW5jdGlvbiBpcyB1c2VkIHRvIGNsZWFyIHRoZSBpbnRlcm5hbCBhdWRpbyBidWZmZXJzIG9mIHRoZSBtb2R1bGUuICAgICAgICAgICAgKi8KLS8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogUEFSQU1FVEVSUzogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgaEluc3RhbmNlICAgICAgICAgICAgICAgSW5zdGFuY2UgaGFuZGxlICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogUkVUVVJOUzogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgTFZSRVZfU1VDQ0VTUyAgICAgICAgICBJbml0aWFsaXNhdGlvbiBzdWNjZWVkZWQgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICBMVlJFVl9OVUxMQUREUkVTUyAgICAgIEluc3RhbmNlIGlzIE5VTEwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiBOT1RFUzogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICAxLiBUaGlzIGZ1bmN0aW9uIG11c3Qgbm90IGJlIGludGVycnVwdGVkIGJ5IHRoZSBMVk1fUHJvY2VzcyBmdW5jdGlvbiAgICAgICAgICAgICAgICAqLwotLyogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLUxWUkVWX1JldHVyblN0YXR1c19lbiBMVlJFVl9DbGVhckF1ZGlvQnVmZmVycyhMVlJFVl9IYW5kbGVfdCAgaEluc3RhbmNlKQotewotCi0gICBMVlJFVl9JbnN0YW5jZV9zdCAgICAgKnBMVlJFVl9Qcml2YXRlID0gKExWUk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ICAgICAqLwotLyogIEluY2x1ZGVzICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotI2luY2x1ZGUgIkxWUkVWX1ByaXZhdGUuaCIKLQotCi0vKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLS8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogRlVOQ1RJT046ICAgICAgICAgICAgICAgIExWUkVWX0dldENvbnRyb2xQYXJhbWV0ZXJzICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qIERFU0NSSVBUSU9OOiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogIFJlcXVlc3QgdGhlIExWUkVWIG1vZHVsZSBjb250cm9sIHBhcmFtZXRlcnMuIFRoZSBjdXJyZW50IHBhcmFtZXRlciBzZXQgaXMgcmV0dXJuZWQgICovCi0vKiAgdmlhIHRoZSBwYXJhbWV0ZXIgcG9pbnRlci4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogUEFSQU1FVEVSUzogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgaEluc3RhbmNlICAgICAgICAgICAgICAgSW5zdGFuY2UgaGFuZGxlICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICBwQ29udHJvbFBhcmFtcyAgICAgICAgICBQb2ludGVyIHRvIGFuIGVtcHR5IHBhcmFtZXRlciBzdHJ1Y3R1cmUgICAgICAgICAgICAgICAgICAgICAqLwotLyogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiBSRVRVUk5TOiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICBMVlJFVl9TdWNjZXNzICAgICAgICAgICBTdWNjZWVkZWQgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogIExWUkVWX05VTExBRERSRVNTICAgICAgIFdoZW4gaEluc3RhbmNlIG9yIHBDb250cm9sUGFyYW1zIGlzIE5VTEwgICAgICAgICAgICAgICAgICAgICovCi0vKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qIE5PVEVTOiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogIDEuICBUaGlzIGZ1bmN0aW9uIG1heSBiZSBpbnRlcnJ1cHRlZCBieSB0aGUgTFZSRVZfUHJvY2VzcyBmdW5jdGlvbiAgICAgICAgICAgICAgICAgICovCi0vKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotTFZSRVZfUmV0dXJuU3RhdHVzX2VuIExWUkVWX0dldENvbnRyb2xQYXJhbWV0ZXJzKExWUkVWX0hhbmRsZV90ICAgICAgICAgICBoSW5zdGFuY2UsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTFZSRVZfQ29udHJvbFBhcmFtc19zdCAgICpwQ29udHJvbFBhcmFtcykKLXsKLQotICAgIExWUkVWX0luc3RhbmNlX3N0ICAqcExWUkVWX1ByaXZhdGUgPSAoTFZSRVZfSW5zdGFuY2Vfc3QgKiloSW5zdGFuY2U7Ci0KLQotICAgIC8qCi0gICAgICogQ2hlY2sgZm9yIGVycm9yIGNvbmRpdGlvbnMKLSAgICAgKi8KLSAgICBpZigoaEluc3RhbmNlID09IExWTV9OVUxMKSB8fCAocENvbnRyb2xQYXJhbXMgPT0gTFZNX05VTEwpKQotICAgIHsKLSAgICAgICAgcmV0dXJuIExWUkVWX05VTExBRERSRVNTOwotICAgIH0KLQotICAgIC8qCi0gICAgICogUmV0dXJuIHRoZSBjdXJyZW50IHBhcmFtZXRlcnMKLSAgICAgKi8KLSAgICAqcENvbnRyb2xQYXJhbXMgPSBwTFZSRVZfUHJpdmF0ZS0+TmV3UGFyYW1zOwotCi0gICAgcmV0dXJuIExWUkVWX1NVQ0NFU1M7Ci19Ci0KLS8qIEVuZCBvZiBmaWxlICovCmRpZmYgLS1naXQgYS9tZWRpYS9saWJlZmZlY3RzL2x2bS9sa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VyIGV4cHJlc3Mgb3IgaW1wbGllZC4KLSAqIFNlZSB0aGUgTGljZW5zZSBmb3IgdGhlIHNwZWNpZmljIGxhbmd1YWdlIGdvdmVybmluZyBwZXJtaXNzaW9ucyBhbmQKLSAqIGxpbWl0YXRpb25zIHVuZGVyIHRoZSBMaWNlbnNlLgotICovCi0KLS8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotLyogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgSW5jbHVkZXMgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0jaW5jbHVkZSAiTFZSRVZfUHJpdmF0ZS5oIgotI2luY2x1ZGUgIkluc3RBbGxvYy5oIgotCi0KLS8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotLyogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiBGVU5DVElPTjogICAgICAgICAgICAgICAgTFZSRVZfR2V0SW5zdGFuY2VIYW5kbGUgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogREVTQ1JJUFRJT046ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgVGhpcyBmdW5jdGlvbiBpcyB1c2VkIHRvIGNyZWF0ZSBhIExWUkVWIG1vZHVsZSBpbnN0YW5jZS4gSXQgcmV0dXJucyB0aGUgY3JlYXRlZCAgICAgKi8KLS8qICBpbnN0YW5jZSBoYW5kbGUgdGhyb3VnaCBwaEluc3RhbmNlLiBBbGwgcGFyYW1ldGVycyBhcmUgc2V0IHRvIHRoZWlyIGRlZmF1bHQsICAgICAgICAqLwotLyogIGluYWN0aXZlIHN0YXRlLiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qIFBBUkFNRVRFUlM6ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogIHBoSW5zdGFuY2UgICAgICAgICAgICAgIHBvaW50ZXIgdG8gdGhlIGluc3RhbmNlIGhhbmRsZSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgcE1lbW9yeVRhYmxlICAgICAgICAgICAgUG9pbnRlciB0byB0aGUgbWVtb3J5IGRlZmluaXRpb24gdGFibGUgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICBwSW5zdGFuY2VQYXJhbXMgICAgICAgICBQb2ludGVyIHRvIHRoZSBpbnN0YW5jZSBwYXJhbWV0ZXJzICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiBSRVRVUk5TOiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICBMVlJFVl9TVUNDRVNTICAgICAgICAgICBTdWNjZWVkZWQgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogIExWUkVWX05VTExBRERSRVNTICAgICAgIFdoZW4gcGhJbnN0YW5jZSBvciBwTWVtb3J5VGFibGUgb3IgcEluc3RhbmNlUGFyYW1zIGlzIE5VTEwgICovCi0vKiAgTFZSRVZfTlVMTEFERFJFU1MgICAgICAgV2hlbiBvbmUgb2YgdGhlIG1lbW9yeSByZWdpb25zIGhhcyBhIE5VTEwgcG9pbnRlciAgICAgICAgICAgKi8KLS8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogTk9URVM6ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotTFZSRVZfUmV0dXJuU3RhdHVzX2VuIExWUkVWX0dldEluc3RhbmNlSGFuZGxlKExWUkVWX0hhbmRsZV90ICAgICAgICAgICAgKnBoSW5zdGFuY2UsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTFZSRVZfTWVtb3J5VGFibGVfc3QgICAgICAqcE1lbW9yeVRhYmxlLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIExWUkVWX0luc3RhbmNlUGFyYW1zX3N0ICAgKnBJbnN0YW5jZVBhcmFtcykKLXsKLQotICAgIElOU1RfQUxMT0MgICAgICAgICAgICAgIFNsb3dEYXRhOwotICAgIElOU1RfQUxMT0MgICAgICAgICAgICAgIEZhc3REYXRhOwotICAgIElOU1RfQUxMT0MgICAgICAgICAgICAgIEZhc3RDb2VmOwotICAgIElOU1RfQUxMT0MgICAgICAgICAgICAgIFRlbXBvcmFyeTsKLSAgICBMVlJFVl9JbnN0YW5jZV9zdCAgICAgICAqcExWUkVWX1ByaXZhdGU7Ci0gICAgTFZNX0lOVDE2ICAgICAgICAgICAgICAgaTsKLSAgICBMVk1fVUlOVDE2ICAgICAgICAgICAgICBNYXhCbG9ja1NpemU7Ci0KLQotICAgIC8qCi0gICAgICogQ2hlY2sgZm9yIGVycm9yIGNvbmRpdGlvbnMKLSAgICAgKi8KLSAgICAvKiBDaGVjayBmb3IgTlVMTCBwb2ludGVycyAqLwotICAgIGlmKChwaEluc3RhbmNlID09IExWTV9OVUxMKSB8fCAocE1lbW9yeVRhYmxlID09IExWTV9OVUxMKSB8fCAocEluc3RhbmNlUGFyYW1zID09IExWTV9OVUxMKSkKLSAgICB7Ci0gICAgICAgIHJldHVybiBMVlJFVl9OVUxMQUREUkVTUzsKLSAgICB9Ci0gICAgLyogQ2hlY2sgdGhlIG1lbW9yeSB0YWJsZSBmb3IgTlVMTCBwb2ludGVycyAqLwotICAgIGZvciAoaSA9IDA7IGkgPCBMVlJFVl9OUl9NRU1PUllfUkVHSU9OUzsgaSsrKQotICAgIHsKLSAgICAgICAgaWYgKHBNZW1vcnlUYWJsZS0+UmVnaW9uW2ldLlNpemUhPTApCi0gICAgICAgIHsKLSAgICAgICAgICAgIGlmIChwTWVtb3J5VGFibGUtP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QotICogZGlzdHJpYnV0ZWQgdW5kZXIgdGhlIExpY2Vuc2UgaXMgZGlzdHJpYnV0ZWQgb24gYW4gIkFTIElTIiBCQVNJUywKLSAqIFdJVEhPVVQgV0FSUkFOVElFUyBPUiBDT05ESVRJT05TIE9GIEFOWSBLSU5ELCBlaXRoZXIgZXhwcmVzcyBvciBpbXBsaWVkLgotICogU2VlIHRoZSBMaWNlbnNlIGZvciB0aGUgc3BlY2lmaWMgbGFuZ3VhZ2UgZ292ZXJuaW5nIHBlcm1pc3Npb25zIGFuZAotICogbGltaXRhdGlvbnMgdW5kZXIgdGhlIExpY2Vuc2UuCi0gKi8KLQotLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0vKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICBJbmNsdWRlcyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLSNpbmNsdWRlICJMVlJFVl9Qcml2YXRlLmgiCi0jaW5jbHVkZSAiSW5zdEFsbG9jLmgiCi0KLS8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotLyogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiBGVU5DVElPTjogICAgICAgICAgICAgICAgTFZSRVZfR2V0TWVtb3J5VGFibGUgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogREVTQ1JJUFRJT046ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgVGhpcyBmdW5jdGlvbiBpcyB1c2VkIGZvciBtZW1vcnkgYWxsb2NhdGlvbiBhbmQgZnJlZS4gSXQgY2FuIGJlIGNhbGxlZCBpbiAgICAgICAgICAgKi8KLS8qICB0d28gd2F5czogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgaEluc3RhbmNlID0gTlVMTCAgICAgICAgICAgICAgICBSZXR1cm5zIHRoZSBtZW1vcnkgcmVxdWlyZW1lbnRzICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICBoSW5zdGFuY2UgPSBJbnN0YW5jZSBoYW5kbGUgICAgIFJldHVybnMgdGhlIG1lbW9yeSByZXF1aXJlbWVudHMgYW5kIGFsbG9jYXRlZCAgICAgICAqLwotLyogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYmFzZSBhZGRyZXNzZXMuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICBXaGVuIHRoaXMgZnVuY3Rpb24gaXMgY2FsbGVkIGZvciBtZW1vcnkgYWxsb2NhdGlvbiAoaEluc3RhbmNlPU5VTEwpIHRoZSBtZW1vcnkgICAgICAqLwotLyogIGJhc2UgYWRkcmVzcyBwb2ludGVycyBhcmUgTlVMTCBvbiByZXR1cm4uICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICBXaGVuIHRoZSBmdW5jdGlvbiBpcyBjYWxsZWQgZm9yIGZyZWUgKGhJbnN0YW5jZSA9IEluc3RhbmNlIEhhbmRsZSkgdGhlIG1lbW9yeSAgICAgICAqLwotLyogIHRhYmxlIHJldHVybnMgdGhlIGFsbG9jYXRlZCBtZW1vcnkgYW5kIGJhc2UgYWRkcmVzc2VzIHVzZWQgZHVyaW5nIGluaXRpYWxpc2F0aW9uLiAgICovCi0vKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qIFBBUkFNRVRFUlM6ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogIGhJbnN0YW5jZSAgICAgICAgICAgICAgIEluc3RhbmNlIEhhbmRsZSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgcE1lbW9yeVRhYmxlICAgICAgICAgICAgUG9pbnRlciB0byBhbiBlbXB0eSBtZW1vcnkgdGFibGUgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICBwSW5zdGFuY2VQYXJhbXMgICAgICAgICBQb2ludGVyIHRvIHRoZSBpbnN0YW5jZSBwYXJhbWV0ZXJzICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiBSRVRVUk5TOiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICBMVlJFVl9TdWNjZXNzICAgICAgICAgICBTdWNjZWVkZWQgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogIExWUkVWX05VTExBRERSRVNTICAgICAgIFdoZW4gcE1lbW9yeVRhYmxlIGlzIE5VTEwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgTFZSRVZfTlVMTEFERFJFU1MgICAgICAgV2hlbiByZXF1ZXN0aW5nIG1lbW9yeSByZXF1aXJlbWVudHMgYW5kIHBJbnN0YW5jZVBhcmFtcyAgICAgKi8KLS8qICAgICAgICAgICAgICAgICAgICAgICAgICBpcyBOVUxMICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiBOT1RFUzogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICAxLiAgVGhpcyBmdW5jdGlvbiBtYXkgYmUgaW50ZXJydXB0ZWQgYnkgdGhlIExWUkVWX1Byb2Nlc3MgZnVuY3Rpb24gICAgICAgICAgICAgICAgICAqLwotLyogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLUxWUkVWX1JldHVyblN0YXR1c19lbiBMVlJFVl9HZXRNZW1vcnlUYWJsZShMVlJFVl9IYW5kbGVfdCAgICAgICAgICAgaEluc3RhbmNlLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIExWUkVWX01lbW9yeVRhYmxlX3N0ICAgICAqcE1lbW9yeVRhYmxlLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIExWUkVWX0luc3RhbmNlUGFyYW1zX3N0ICAqcEluc3RhbmNlUGFyYW1zKQotewotCi0gICAgSU5TVF9BTExPQyAgICAgICAgICAgICAgU2xvd0RhdGE7Ci0gICAgSU5TVF9BTExPQyAgICAgICAgICAgICAgRmFzdERhdGE7Ci0gICAgSU5TVF9BTExPQyAgICAgICAgICAgICAgRmFzdENvZWY7Ci0gICAgSU5TVF9BTExPQyAgICAgICAgICAgICAgVGVtcG9yYXJ5OwotICAgIExWTV9JTlQxNiAgICAgICAgICAgICAgIGk7Ci0gICAgTFZNX1VJTlQxNiAgICAgICAgICAgICAgTWF4QmxvY2tTaXplOwotCi0KLSAgICAvKgotICAgICAqIENoZWNrIGZvciBlcnJvciBjb25kaXRpb25zCi0gICAgICovCi0gICAgLyogQ2hlY2sgZm9yIE5VTEwgcG9pbnRlciAqLwotICAgIGlmIChwTWVtb3J5VGFibGUgPT0gTFZNX05VTEwpCi0gICAgewotICAgICAgICByZXR1cm4oTFZSRVZfTlVMTEFERFJFU1MpOwotICAgIH0KLQotICAgIC8qCi0gICAgICogQ2hlY2sgYWxsIGluc3RhbmNlIHBhcmFtZXRlcnMgYXJlIGluIHJhbmdlCi0gICAgICovCi0gICAgaWYgKHBJbnN0YW5jZVBhcmFtcyAhPSBMVk1fTlVMTCkKLS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Ck7Ci0KLQotICAgIC8qCi0gICAgICogRmlsbCBpbiB0aGUgbWVtb3J5IHRhYmxlCi0gICAgICovCi0gICAgaWYgKGhJbnN0YW5jZSA9PSBMVk1fTlVMTCkKLSAgICB7Ci0gICAgICAgIC8qCi0gICAgICAgICAqIENoZWNrIGZvciBudWxsIHBvaW50ZXJzCi0gICAgICAgICAqLwotICAgICAgICBpZiAocEluc3RhbmNlUGFyYW1zID09IExWTV9OVUxMKQotICAgICAgICB7Ci0gICAgICAgICAgICByZXR1cm4oTFZSRVZfTlVMTEFERFJFU1MpOwotICAgICAgICB9Ci0KLQotICAgICAgICAvKgotICAgICAgICAgKiBTZWxlY3QgdGhlIG1heGltdW0gaW50ZXJuYWwgYmxvY2sgc2l6ZQotICAgICAgICAgKi8KLSAgICAgICAgaWYocEluc3RhbmNlUGFyYW1zLT5OdW1EZWxheXMgPT1MVlJFVl9ERUxBWUxJTkVTXzQpCi0gICAgICAgIHsKLSAgICAgICAgICAgIE1heEJsb2NrU2l6ZSA9IExWUkVWX01BWF9BUDNfREVMQVk7Ci0gICAgICAgIH0KLSAgICAgICAgZWxzZSBpZihwSW5zdGFuY2VQYXJhbXMtPk51bURlbGF5cyA9PUxWUkVWX0RFTEFZTElORVNfMikKLSAgICAgICAgewotICAgICAgICAgICAgTWF4QmxvY2tTaXplID0gTFZSRVZfTUFYX0FQMV9ERUxBWTsKLSAgICAgICAgfQotICAgICAgICBlbHNlCi0gICAgICAgIHsKLSAgICAgICAgICAgIE1heEJsb2NrU2l6ZSA9IExWUkVWX01BWF9BUDBfREVMQVk7Ci0gICAgICAgIH0KLQotICAgICAgICBpZihNYXhCbG9ja1NpemU+cEluc3RhbmNlUGFyYW1zLT5NYXhCbG9ja1NpemUpCi0gICAgICAgIHsKLSAgICAgICAgICAgIE1heEJsb2NrU2l6ZT1wSW5zdGFuY2VQYXJhbXMtPk1heEJsb2NrU2l6ZTsKLSAgICAgICAgfQotCi0KLSAgICAgICAgLyoKLSAgICAgICAgIC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i0gICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgSW5zdEFsbG9jX0FkZE1lbWJlcigmVGVtcG9yYXJ5LCBzaXplb2YoTFZNX0lOVDMyKSAqIE1heEJsb2NrU2l6ZSk7ICAgICAgLyogQSBTY3JhdGNoIGJ1ZmZlciBmb3IgZWFjaCBkZWxheSBsaW5lICovCi0gICAgICAgICAgICB9Ci0gICAgICAgIH0KLQotICAgICAgICBpZihwSW5zdGFuY2VQYXJhbXMtPk51bURlbGF5cyA9PSBMVlJFVl9ERUxBWUxJTkVTXzIpCi0gICAgICAgIHsKLSAgICAgICAgICAgIGZvcihpPTA7IGk8MjsgaSsrKQotICAgICAgICAgICAgewotICAgICAgICAgICAgICAgIEluc3RBbGxvY19BZGRNZW1iZXIoJlRlbXBvcmFyeSwgc2l6ZW9mKExWTV9JTlQzMikgKiBNYXhCbG9ja1NpemUpOyAgICAgIC8qIEEgU2NyYXRjaCBidWZmZXIgZm9yIGVhY2ggZGVsYXkgbGluZSAqLwotICAgICAgICAgICAgfQotICAgICAgICB9Ci0KLSAgICAgICAgaWYocEluc3RhbmNlUGFyYW1zLT5OdW1EZWxheXMgPT0gTFZSRVZfREVMQVlMSU5FU18xKQotICAgICAgICB7Ci0gICAgICAgICAgICBmb3IoaT0wOyBpPDE7IGkrKykKLSAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICBJbnN0QWxsb2NfQWRkTWVtYmVyKCZUZW1wb3JhcnksIHNpemVvZihMVk1fSU5UMzIpICogTWF4QmxvY2tTaXplKTsgICAgICAvKiBBIFNjcmF0Y2ggYnVmZmVyIGZvciBlYWNoIGRlbGF5IGxpbmUgKi8KLSAgICAgICAgICAgIH0KLSAgICAgICAgfQotCi0gICAgICAgIHBNZW1vcnlUYWJsZS0+UmVnaW9uW0xWTV9URU1QT1JBUllfRkFTVF0uU2l6ZSAgICAgICAgID0gSW5zdEFsbG9jX0dldFRvdGFsKCZUZW1wb3JhcnkpOwotICAgICAgICBwTWVtb3J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ICAgICAgICAgICAgICovCi0vKiAgSW5jbHVkZXMgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0jaW5jbHVkZSAiTFZSRVYuaCIKLSNpbmNsdWRlICJMVlJFVl9UYWJsZXMuaCIKLSNpbmNsdWRlICJCSVFVQUQuaCIKLSNpbmNsdWRlICJGaWx0ZXIuaCIKLSNpbmNsdWRlICJWZWN0b3JBcml0aG1ldGljLmgiCi0jaW5jbHVkZSAiTWl4ZXIuaCIKLSNpbmNsdWRlICJMVk1fTWFjcm9zLmgiCi0KLQotLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0vKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICBEZWZpbmVzICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLS8qIEdlbmVyYWwgKi8KLSNkZWZpbmUgT05FX09WRVJfU1FSVF9UV08gICAgICAgICAgICAgICAyMzE3MCAgICAgICAgICAgLyogMS9zcXJ0KDIpICogMl4xNSAqLwotI2RlZmluZSBMVlJFVl9CXzhfb25fMTAwMCAgICAgICAgICAgIDE3MTc5ODY5ICAgICAgICAgICAvKiAwLjggKiAyXjMxICovCi0jZGVmaW5lIExWUkVWX0hFQURST09NICAgICAgICAgICAgICAgICAgIDgxOTIgICAgICAgICAgIC8qIC0xMmRCICogMl4xNSAqLwotI2RlZmluZSBMVlJFVl8yXzlfSU5RMjkgICAgICAgICAgIDE1ODM3NjkxOTBMICAgICAgICAgICAvKiAyLjkgaW4gUTI5IGZvcm1hdCAqLwotI2RlZmluZSBMVlJFVl9NSU4zREIgICAgICAgICAgICAgICAgICAgMHg1QTgyICAgICAgICAgICAvKiAtM2RCIGluIFExNSBmb3JtYXQgKi8KLQotLyogSW50ZW5hbCBjb25zdGFudHMgKi8KLSNkZWZpbmUgTFZSRVZfTFBfUG9seV9PcmRlciAgICAgICAgICAgICAgICAgNAotI2RlZmluZSBMVlJFVl9MUF9Qb2x5X1NoaWZ0ICAgICAgICAgICAgICAgICA1Ci0jZGVmaW5lIExWUkVWX1RfM19Qb3dlcl8wX29uXzQgICAgICAgICAgMzI3NjgKLSNkZWZpbmUgTFZSRVZfVF8zX1Bvd2VyXzFfb25fNCAgICAgICAgICA0MzEyNQotI2RlZmluZSBMVlJFVl9UXzNfUG93ZXJfMl9vbl80ICAgICAgICAgIDU2NzU1Ci0jZGVmaW5lIExWUkVWX1RfM19Qb3dlcl8zX29uXzQgICAgICAgICAgNzQ2OTQKLSNkZWZpbmUgTFZSRVZfVDYwX1NDQUxFICAgICAgICAgICAgICAgIDMwNjc3NCAgICAgICAgICAgLyooMzI3NjcvNzAwMCk8PDE2ICovCi0jZGVmaW5lIExWUkVWX1RfM19Qb3dlcl9taW51czBfb25fNCAgICAgMzI3NjcgICAgICAgICAgIC8qIDNeKC0wLzQpICogMl4xNSAqLwotI2RlZmluZSBMVlJFVl9UXzNfUG93ZXJfbWludXMxX29uXzQgICAgIDI0ODk4ICAgICAgICAgICAvKiAzXigtMS80KSAqIDJeMTUgKi8KLSNkZWZpbmUgTFZSRVZfVF8zX1Bvd2VyX21pbnVzMl9vbl80ICAgICAxODkxOSAgICAgICAgICAgLyogM14oLTIvNCkgKiAyXjE1ICovCi0jZGVmaW5lIExWUkVWX1RfM19Qb3dlcl9taW51czNfb25fNCAgICAgMTQzNzUgICAgICAgICAgIC8qIDNeKC0zLzQpICogMl4xNSAqLwotI2RlZmluZSBMVlJFVl9NQVhfVDNfREVMQVkgICAgICAgICAgICAgICAyNTI3ICAgICAgICAgICAvKiAoKDQ4MDAwICogMTIwICogTFZSRVZfVF8zX1Bvd2VyX21pbnVzM19vbl80KSA+PiAxNSkgLyAxMDAwICovCi0jZGVmaW5lIExWUkVWX01BWF9UMl9ERUxBWSAgICAgICAgICAgICAgIDMzMjYgICAgICAgICAgIC8qICgoNDgwMDAgKiAxMjAgKiBMVlJFVl9UXzNfUG93ZXJfbWludXMyX29uXzQpID4+IDE1KSAvIDEwMDAgKi8KLSNkZWZpbmUgTFZSRVZfTUFYX1QxX0RFTEFZICAgICAgICAgICAgICAgNDM3NyAgICAgICAgICAgLyogKCg0ODAwMCAqIDEyMCAqIExWUkVWX1RfM19Qb3dlcl9taW51czFfb25fNCkgPj4gMTUpIC8gMTAwMCAqLwotI2RlZmluZSBMVlJFVl9NQVhfVDBfREVMQVkgICAgICAgICAgICAgICA1NzYwICAgICAgICAgICAvKiAoKDQ4MDAwICogMTIwICogTFZSRVZfVF8zX1Bvd2VyX21pbnVzMF9vbl80KSA+PiAxNSkgLyAxMDAwICovCi0jZGVmaW5lIExWUkVWX01BWF9BUDNfREVMQVkgICAgICAgICAgICAgIDE2ODUgICAgICAgICAgIC8qICgoNDgwMDAgKiAxMjAgKiBMVlJFVl9UXzNfUG93ZXJfbWludXMzX29uXzQpID4+IDE1KSAvIDE1MDAgKi8KLSNkZWZpbmUgTFZSRVZfTUFYX0FQMl9ERUxBWSAgICAgICAgICAgICAgMjIxOCAgICAgICAgICAgLyogKCg0ODAwMCAqIDEyMCAqIExWUkVWX1RfM19Qb3dlcl9taW51czJfb25fNCkgPj4gMTUpIC8gMTUwMCAqLwotI2RlZmluZSBMVlJFVl9NQVhfQVAxX0RFTEFZICAgICAgICAgICAgICAyOTE4ICAgICAgICAgICAvKiAoKDQ4MDAwICogMTIwICogTFZSRVZfVF8zX1Bvd2VyX21pbnVzMV9vbl80KSA+PiAxNSkgLyAxNTAwICovCi0jZGVmaW5lIExWUkVWX01BWF9BUDBfREVMQVkgICAgICAgICAgICAgIDM4NDAgICAgICAgICAgIC8qICgoNDgwMDAgKiAxMjAgKiBMVlJFVl9UXzNfUG93ZXJfbWludXMwX29uXzQpID4+IDE1KSAvIDE1MDAgKi8KLSNkZWZpbmUgTFZSRVZfQllQQVNTTUlYRVJfVEMgICAgICAgICAgICAgMTAwMCAgICAgICAgICAgLyogQnlwYXNzIG1peGVyIHRpbWUgY29uc3RhbnQqLwotI2RlZmluZSBMVlJFVl9BTExQQVNTX1RDICAgICAgICAgICAgICAgICAxMDAwICAgICAgICAgICAvKiBBbGwtcGFzcyBmaWx0ZXIgdGltZSBjb25zdGFudCAqLwotI2RlZmluZSBMVlJFVl9BTExQQVNTX1RBUF9UQyAgICAgICAgICAgICAxMDAwMCAgICAgICAgICAgLyogQWxsLXBhc3MgZmlsdGVyIGRlbHkgdGFwIGNoYW5nZSAqLwotI2RlZmluZSBMVlJFVl9GRUVEQkFDS01JWEVSX1RDICAgICAgICAgICAgMTAwICAgICAgICAgICAvKiBGZWVkYmFjayBtaXhlciB0aW1lIGNvbnN0YW50Ki8KLSNkZWZpbmUgTFZSRVZfT1VUUFVUR0FJTl9TSElGVCAgICAgICAgICAgICAgNSAgICAgICAgICAgLyogQml0cyBzaGlmdCBmb3Igb3V0cHV0IGdhaW4gY29ycmVjdGlvbiAqLwotCi0vKiBQYXJhbWV0ZXIgbGltaXRzICovCi0jZGVmaW5lIExWUkVWX05VTV9GUyAgICAgICAgICAgICAgICAgICAgICAgIDkgICAgICAgICAgIC8qIE51bWJlciBvZiBzdXBwb3J0ZWQgc2FtcGxlIHJhdGVzICovCi0jZGVmaW5lIExWUkVWX01BWEJMS1NJWkVfTElNSVQgICAgICAgICAgICAgNjQgICAgICAgICAgIC8qIE1heGltdW0gYmxvY2sgc2l6ZSBsb3cgbGltaXQgKi8KLSNkZWZpbmUgTFZSRVZfTUFYX0xFVkVMICAgICAgICAgICAgICAgICAgIDEwMCAgICAgICAgICAgLyogTWF4aW11bSBsZXZlbCwgMTAwJSAqLwotI2RlZmluZSBMVlJFVl9NSU5fTFBGX0NPUk5FUiAgICAgICAgICAgICAgIDUwICAgICAgICAgICAvKiBMb3cgcGFzcyBmaWx0ZXIgbGltaXRzICovCi0jZGVmaW5lIExWUkVWX01BWF9MUEZfQ09STkVSICAgICAgICAgICAgMjM5OTkKLSNkZWZpbmUgTFZSRVZfTUlOX0hQRl9DT1JORVIgICAgICAgICAgICAgICAyMCAgICAgICAgICAgLyogSGlnaCBwYXNzIGZpbHJlciBsaW1pdHMgKi8KLSNkZWZpbmUgTFZSRVZfTUFYX0hQRl9DT1JORVIgICAgICAgICAgICAgMTAwMAotI2RlZmluZSBMVlJFVl9NQVhfVDYwICAgICAgICAgICAgICAgICAgICA3MDAwICAgICAgICAgICAvKiBNYXhpbXVtIFQ2MCB0aW1lIGluIG1zICovCi0jZGVmaW5lIExWUkVWX01BWF9ERU5TSVRZICAgICAgICAgICAgICAgICAxMDAgICAgICAgICAgIC8qIE1heGltdW0gZGVuc2l0eSwgMTAwJSAqLwotI2RlZmluZSBMVlJFVl9NQVhfREFNUElORyAgICAgICAgICAgICAgICAgMTAwICAgICAgICAgICAvKiBNYXhpbXVtIGRhbXBpbmcsIDEwMCUgKi8KLSNkZWZpbmUgTFZSRVZfTUFYX1JPT01TSVpFICAgICAgICAgICAgICAgIDEwMCAgICAgICAgICAgLyogTWF4aW11bSByb29tIHNpemUsIDEwMCUgKi8KLQotCi0KLS8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotLyogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgU3RydWN0dXJlcyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0vKiBGYXN0IGRhdGEgc3RydWN0dXJlICovCi10eXBlZGVmIHN0cnVjdAotewotCi0gICAgQmlxdWFkXzFJX09yZGVyMV9UYXBzX3QgSFBUYXBzOyAgICAgICAgICAgICAgICAgICAgIC8qIEhpZ2ggcGFzcyBmaWx0ZXIgdGFwcyAqLwotICAgIEJpcXVhZF8xSV9PcmRlcjFfVGFwc190IExQVGFwczsgICAgICAgICAgICAgICAgICAgICAvKiBMb3cgcGFzcyBmaWx0ZXIgdGFwcyAqLwotICAgIEJpcXVhZF8xSV9PcmRlcjFfVGFwc190IFJldkxQVGFwc1s0XTsgICAgICAgICAgICAgICAvKiBSZXZlcmIgbG93IHBhc3MgZmlsdGVycyB0YXBzICovCi0KLX0gTFZSRVZfRmFzdERhdGFfc3Q7Ci0KLQotLyogRmFzdCBjb2VmZmljaWVudCBzdHJ1Y3R1cmUgKi8KLXR5cGVkZWYgc3RydWN0Ci17Ci0KLSAgICBCaXF1YWRfSW5zdGFuY2VfdCAgICAgICBIUENvZW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c2NyYXRjaCAqLwotICAgIExWTV9JTlQzMiAgICAgICAgICAgICAgICpwSW5wdXRTYXZlOyAgICAgICAgICAgICAgICAvKiBSZXZlcmIgYmxvY2sgaW5wdXQgc2F2ZSBmb3IgZHJ5L3dldCBtaXhpbmcqLwotCi0gICAgLyogRmVlZGJhY2sgbWF0cml4ICovCi0gICAgTWl4XzFTdF9DbGxfdCAgICAgICAgICAgRmVlZGJhY2tNaXhlcls0XTsgICAgICAgICAgIC8qIE1peGVyIGZvciBQb3AgYW5kIENsaWNrIFN1cHJlc3Npb24gY2F1c2VkIGJ5IGZlZWRiYWNrIEdhaW4gKi8KLQotICAgIC8qIEFsbC1QYXNzIEZpbHRlciAqLwotICAgIExWTV9JTlQzMiAgICAgICAgICAgICAgIFRbNF07ICAgICAgICAgICAgICAgICAgICAgICAvKiBNYXhpbXVtIGRlbGF5IHNpemUgb2YgYnVmZmVyICovCi0gICAgTFZNX0lOVDMyICAgICAgICAgICAgICAgKnBEZWxheV9UWzRdOyAgICAgICAgICAgICAgIC8qIFBvaW50ZXIgdG8gZGVsYXkgYnVmZmVycyAqLwotICAgIExWTV9JTlQzMiAgICAgICAgICAgICAgIERlbGF5X0FQWzRdOyAgICAgICAgICAgICAgICAvKiBPZmZzZXQgdG8gQVAgZGVsYXkgYnVmZmVyIHN0YXJ0ICovCi0gICAgTFZNX0lOVDE2ICAgICAgICAgICAgICAgQUJfU2VsZWN0aW9uOyAgICAgICAgICAgICAgIC8qIFNtb290aCBmcm9tIHRhcCBBIHRvIEIgd2hlbiAxIG90aGVyd2lzZSBCIHRvIEEgKi8KLSAgICBMVk1fSU5UMzIgICAgICAgICAgICAgICBBX0RlbGF5U2l6ZVs0XTsgICAgICAgICAgICAgLyogQSBkZWxheSBsZW5ndGggaW4gc2FtcGxlcyAqLwotICAgIExWTV9JTlQzMiAgICAgICAgICAgICAgIEJfRGVsYXlTaXplWzRdOyAgICAgICAgICAgICAvKiBCIGRlbGF5IGxlbmd0aCBpbiBzYW1wbGVzICovCi0gICAgTFZNX0lOVDMyICAgICAgICAgICAgICAgKnBPZmZzZXRBWzRdOyAgICAgICAgICAgICAgIC8qIE9mZnNldCBmb3IgdGhlIEEgZGVsYXkgdGFwICovCi0gICAgTFZNX0lOVDMyICAgICAgICAgICAgICAgKnBPZmZzZXRCWzRdOyAgICAgICAgICAgICAgIC8qIE9mZnNldCBmb3IgdGhlIEIgZGVsYXkgdGFwICovCi0gICAgTWl4XzJTdF9DbGxfdCAgICAgICAgICAgTWl4ZXJfQVBUYXBzWzRdOyAgICAgICAgICAgIC8qIFNtb290aGVkIEFQIGRlbGF5IG1peGVyICovCi0gICAgTWl4XzFTdF9DbGxfdCAgICAgICAgICAgTWl4ZXJfU0dGZWVkYmFja1s0XTsgICAgICAgIC8qIFNtb290aGVkIFNBZmVlZGJhY2sgZ2FpbiAqLwotICAgIE1peF8xU3RfQ2xsX3QgICAgICAgICAgIE1peGVyX1NHRmVlZGZvcndhcmRbNF07ICAgICAvKiBTbW9vdGhlZCBBUCBmZWVkZm9yd2FyZCBnYWluICovCi0KLSAgICAvKiBPdXRwdXQgZ2FpbiAqLwotICAgIE1peF8yU3RfQ2xsX3QgICAgICAgICAgIEJ5cGFzc01peGVyOyAgICAgICAgICAgICAgICAvKiBEcnkvd2V0IG1peGVyICovCi0gICAgTFZNX0lOVDE2ICAgICAgICAgICAgICAgR2FpbjsgICAgICAgICAgICAgICAgICAgICAgIC8qIEdhaW4gYXBwbGllZCB0byBvdXRwdXQgdG8gbWFpbnRhaW4gYXZlcmFnZSBzaWduYWwgcG93ZXIgKi8KLSAgICBNaXhfMVN0X0NsbF90ICAgICAgICAgICBHYWluTWl4ZXI7ICAgICAgICAgICAgICAgICAgLyogR2FpbiBzbW9vdGhpbmcgKi8KLQotfSBMVlJFVl9JbnN0YW5jZV9zdDsKLQotCi0vKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLS8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogIEZ1bmN0aW9uIHByb3RvdHlwZXMgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotCi1MVlJFVl9SZXR1cm5TdGF0dXNfZW4gICBMVlJFVl9BcHBseU5ld1NldHRpbmdzKExWUkVWX0luc3RhbmNlX3N0ICAgICAqcFByaXZhdGUpOwotCi12b2lkICAgICAgICAgICAgICAgICAgICBSZXZlcmJCbG9jayhMVk1fSU5UMzIgICAgICAgICAgICpwSW5wdXQsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBMVk1fSU5UMzIgICAgICAgICAgICpwT3V0cHV0LAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTFZSRVZfSW5zdGFuY2Vfc3QgICAqcFByaXZhdGUsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBMVk1fVUlOVDE2ICAgICAgICAgIE51bVNhbXBsZXMpOwotCi1MVk1fSU5UMzIgICAgICAgICAgICAgICBCeXBhc3NNaXhlcl9DYWxsYmFjayh2b2lkICAgICAgICpwQ2FsbGJhY2tEYXRhLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdm9pZCAgICAgICAqcEdlbmVyYWxQdXJwb3NlLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTFZN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AqIGRpc3RyaWJ1dGVkIHVuZGVyIHRoZSBMaWNlbnNlIGlzIGRpc3RyaWJ1dGVkIG9uIGFuICJBUyBJUyIgQkFTSVMsCi0gKiBXSVRIT1VUIFdBUlJBTlRJRVMgT1IgQ09ORElUSU9OUyBPRiBBTlkgS0lORCwgZWl0aGVyIGV4cHJlc3Mgb3IgaW1wbGllZC4KLSAqIFNlZSB0aGUgTGljZW5zZSBmb3IgdGhlIHNwZWNpZmljIGxhbmd1YWdlIGdvdmVybmluZyBwZXJtaXNzaW9ucyBhbmQKLSAqIGxpbWl0YXRpb25zIHVuZGVyIHRoZSBMaWNlbnNlLgotICovCi0KLS8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotLyogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiBJbmNsdWRlcyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0jaW5jbHVkZSAiTFZSRVZfUHJpdmF0ZS5oIgotI2luY2x1ZGUgIlZlY3RvckFyaXRobWV0aWMuaCIKLQotCi0vKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLS8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogRlVOQ1RJT046ICAgICAgICAgICAgICAgIExWUkVWX1Byb2Nlc3MgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qIERFU0NSSVBUSU9OOiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogIFByb2Nlc3MgZnVuY3Rpb24gZm9yIHRoZSBMVlJFViBtb2R1bGUuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qIFBBUkFNRVRFUlM6ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogIGhJbnN0YW5jZSAgICAgICAgICAgICAgIEluc3RhbmNlIGhhbmRsZSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgcEluRGF0YSAgICAgICAgICAgICAgICAgUG9pbnRlciB0byB0aGUgaW5wdXQgZGF0YSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICBwT3V0RGF0YSAgICAgICAgICAgICAgICBQb2ludGVyIHRvIHRoZSBvdXRwdXQgZGF0YSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogIE51bVNhbXBsZXMgICAgICAgICAgICAgIE51bWJlciBvZiBzYW1wbGVzIGluIHRoZSBpbnB1dCBidWZmZXIgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qIFJFVFVSTlM6ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogIExWUkVWX1N1Y2Nlc3MgICAgICAgICAgIFN1Y2NlZWRlZCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgTFZSRVZfSU5WQUxJRE5VTVNBTVBMRVMgTnVtU2FtcGxlcyB3YXMgbGFyZ2VyIHRoYW4gdGhlIG1heGltdW0gYmxvY2sgc2l6ZSAgICAgICAgICAgKi8KLS8qICBMVlJFVl9OVUxMQUREUkVTUyAgICAgICBXaGVuIG9uZSBvZiBoSW5zdGFuY2UsIHBJbkRhdGEgb3IgcE91dERhdGEgaXMgTlVMTCAgICAgICAgICAqLwotLyogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiBOT1RFUzogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICAxLiBUaGUgaW5wdXQgYW5kIG91dHB1dCBidWZmZXJzIG11c3QgYmUgMzItYml0IGFsaWduZWQgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLUxWUkVWX1JldHVyblN0YXR1c19lbiBMVlJFVl9Qcm9jZXNzKExWUkVWX0hhbmRsZV90ICAgICAgaEluc3RhbmNlLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY29uc3QgTFZNX0lOVDMyICAgICAqcEluRGF0YSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIExWTV9JTlQzMiAgICAgICAgICAgKnBPdXREYXRhLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY29uc3QgTFZNX1VJTlQxNiAgICBOdW1TYW1wbGVzKQotewotICAgTFZSRVZfSW5zdGFuY2Vfc3QgICAgICpwTFZSRVZfUHJpdmF0ZSA9IChMVlJFVl9JbnN0YW5jZV9zdCAqKWhJbnN0YW5jZTsKLSAgIExWTV9JTlQzMiAgICAgICAgICAgICAqcElucHV0ICA9IChMVk1fSU5UMzIgKilwSW5EYXRhOwotICAgTFZNX0lOVDMyICAgICAgICAgICAgICpwT3V0cHV0ID0gcE91dERhdGE7Ci0gICBMVk1fSU5UMzIgICAgICAgICAgICAgU2FtcGxlc1RvUHJvY2VzcywgUmVtYWluaW5nU2FtcGxlczsKLSAgIExWTV9JTlQzMiAgICAgICAgICAgICBmb3JtYXQgPSAxOwotCi0gICAgLyoKLSAgICAgKiBDaGVjayBmb3IgZXJyb3IgY29uZGl0aW9ucwotICAgICAqLwotCi0gICAgLyogQ2hlY2sgZm9yIE5VTEwgcG9pbnRlcnMgKi8KLSAgICBpZigoaEluc3RhbmNlID09IExWTV9OVUxMKSB8fCAocEluRGF0YSA9PSBMVk1fTlVMTCkgfHwgKHBPdXREYXRhID09IExWTV9OVUxMKSkKLSAgICB7Ci0gICAgICAgIHJldHVybiBMVlJFVl9OVUxMQUREUkVTUzsKLSAgICB9Ci0KLSAgICAvKgotICAgICAqIEFwcGx5IHRoZSBuZXcgY29udHJvbHMgc2V0dGluZ3MgaWYgcmVxdWlyZWQKLSAgICAgKi8KLSAgICBpZ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MgcmVxdWlyZWQKLSAgICAgICAgICAgICAqLwotCi0gICAgICAgICAgICBpZihwTFZSRVZfUHJpdmF0ZS0+Q3VycmVudFBhcmFtcy5Tb3VyY2VGb3JtYXQgPT0gTFZNX01PTk8pewotICAgICAgICAgICAgICAgIE1vbm9UbzJJXzMyKHBJbnB1dCwgcE91dHB1dCwgTnVtU2FtcGxlcyk7Ci0gICAgICAgICAgICB9IGVsc2UgewotICAgICAgICAgICAgICAgIENvcHlfMTYoKExWTV9JTlQxNiAqKXBJbnB1dCwKLSAgICAgICAgICAgICAgICAgICAgICAgIChMVk1fSU5UMTYgKilwT3V0cHV0LAotICAgICAgICAgICAgICAgICAgICAgICAgKExWTV9JTlQxNikoTnVtU2FtcGxlcyA8PCAyKSk7IC8vIDMyIGJpdCBkYXRhLCBzdGVyZW8KLSAgICAgICAgICAgIH0KLSAgICAgICAgfQotCi0gICAgICAgIHJldHVybiBMVlJFVl9TVUNDRVNTOwotICAgIH0KLQotICAgIFJlbWFpbmluZ1NhbXBsZXMgPSAoTFZNX0lOVDMyKU51bVNhbXBsZXM7Ci0KLSAgICBpZiAocExWUkVWX1ByaXZhdGUtPkN1cnJlbnRQYXJhbXMuU291cmNlRm9ybWF0ICE9IExWTV9NT05PKQotICAgIHsKLSAgICAgICAgZm9ybWF0ID0gMjsKLSAgICB9Ci0KLSAgICB3aGlsZSAoUmVtYWluaW5nU2FtcGxlcyE9MCkKLSAgICB7Ci0gICAgICAgIC8qCi0gICAgICAgICAqIFByb2Nlc3MgdGhlIGRhdGEKLSAgICAgICAgICovCi0KLSAgICAgICAgaWYoUmVtYWluaW5nU2FtcGxlcyA+ICBwTFZSRVZfUHJpdmF0ZS0+TWF4QmxrTGVuKQotICAgICAgICB7Ci0gICAgICAgICAgICBTYW1wbGVzVG9Qcm9jZXNzID0gIHBMVlJFVl9Qcml2YXRlLT5NYXhCbGtMZW47Ci0gICAgICAgICAgICBSZW1haW5pbmdTYW1wbGVzID0gKExWTV9JTlQxNikoUmVtYWluaW5nU2FtcGxlcyAtIFNhbXBsZXNUb1Byb2Nlc3MpOwotICAgICAgICB9Ci0gICAgICAgIGVsc2UKLSAgICAgICAgewotICAgICAgICAgICAgU2FtcGxlc1RvUHJvY2VzcyA9IFJlbWFpbmluZ1NhbXBsZXM7Ci0gICAgICAgICAgICBSZW1haW5pbmdTYW1wbGVzID0gMDsKLSAgICAgICAgfQotCi0gICAgICAgIFJldmVyYkJsb2NrKHBJbnB1dCwgcE91dHB1dCwgcExWUkVWX1ByaXZhdGUsIChMVk1fVUlOVDE2KVNhbXBsZXNUb1Byb2Nlc3MpOwotCi0gICAgICAgIHBJbnB1dCAgPSAoTFZNX0lOVDMyICopKHBJbnB1dCArKFNhbXBsZXNUb1Byb2Nlc3MqZm9ybWF0KSk7Ci0gICAgICAgIHBPdXRwdXQgPSAoTFZNX0lOVDMyICopKHBPdXRwdXQrKFNhbXBsZXNUb1Byb2Nlc3MqMikpOyAgICAgIC8vIEFsd2F5cyBzdGVyZW8gb3V0cHV0Ci0gICAgfQotCi0gICAgcmV0dXJuIExWUkVWX1NVQ0NFU1M7Ci19Ci0KLQotCi0vKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLS8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogRlVOQ1RJT046ICAgICAgICAgICAgICAgIFJldmVyYkJsb2NrICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qIERFU0NSSVBUSU9OOiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogIFByb2Nlc3MgZnVuY3Rpb24gZm9yIHRoZSBMVlJFViBtb2R1bGUuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qIFBBUkFNRVRFUlM6ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogIGhJbnN0YW5jZSAgICAgICAgICAgICAgIEluc3RhbmNlIGhhbmRsZSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgcEluRGF0YSAgICAgICAgICAgICAgICAgUG9pbnRlciB0byB0aGUgaW5wdXQgZGF0YSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICBwT3V0RGF0YSAgICAgICAgICAgICAgICBQb2ludGVyIHRvIHRoZSBvdXRwdXQgZGF0YSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogIE51bVNhbXBsZXMgICAgICAgICAgICAgIE51bWJlciBvZiBzYW1wbGVzIGluIHRoZSBpbnB1dCBidWZmZXIgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qIFJFVFVSTlM6ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogIExWUkVWX1N1Y2Nlc3MgICAgICAgICAgIFN1Y2NlZWRlZCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgTFZSRVZfSU5WQUxJRE5VTVNBTVBMRVMgTnVtU2FtcGxlcyB3YXMgbGFyZ2VyIHRoYW4gdGhlIG1heGltdW0gYmxvY2sgc2l6ZSAgICAgICAgICAgKi8KLS8qICBMVlJFVl9OVUxMQUREUkVTUyAgICAgICBXaGVuIG9uZSBvZiBoSW5zdGFuY2UsIHBJbkRhdGEgb3IgcE91dERhdGEgaXMgTlVMTCAgICAgICAgICAqLwotLyogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiBOT1RFUzogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICAxLiBUaGUgaW5wdXQgYW5kIG91dHB1dCBidWZmZXJzIG11c3QgYmUgMzItYml0IGFsaWduZWQgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLQotdm9pZCBSZXZlcmJCbG9jayhMVk1fSU5UMzIgKnBJbnB1dCwgTFZNX0lOVDMyICpwT3V0cHV0LCBMVlJFVl9JbnN0YW5jZV9zdCAqcFByaXZhdGUsIExWTV9VSU5UMTYgTnVtU2FtcGxlcykKLXsKLSAgICBMVk1fSU5UMTYgICBqLCBzaXplOwotICAgIExWTV9JTlQzMiAgICpwRGVsYXlMaW5lOwotICAgIExWTV9JTlQzMiAgICpwRGVsYXlMaW5lSW5wdXQgPSBwUHJpdmF0ZS0+cFNjcmF0Y2g7Ci0gICAgTFZNX0lOVDMyICAgKnBTY3JhdGNoID0gcFByaXZhdGUtPnBTY3JhdGNoOwotICAgIExWTV9JTlQzMiAgICpwSW47Ci0gICAgTFZNX0lOVDMyICAgKnBUZW1wID0gcFByaXZhdGUtPnBJbnB1dFNhdmU7Ci0gICAgTFZNX0lOVDMyICAgTnVtYmVyT2ZEZWxheUxpbmVzOwotCi0gICAgLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgotICAgICAqIEFsbCBjYWxjdWxhdGlvbnMgd2lsbCBnbyBpbnRvIHRoZSBidWZmZXIgcG9pbnRlZCB0byBieSBwVGVtcCwgdGhpcyB3aWxsICAgICoKLSAgICAgKiB0aGVuIGJlIG1peGVkIHdpdGggdGhlIG9yaWdpbmFsIGlucHV0IHRvIGNyZWF0ZSB0aGUgZmluYWwgb3V0cHV0LiAgICAgICAgICAqCi0gICAgICogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKgotICAgICAqIFdoZW4gSU5QTEFDRSBwcm9jZXNzaW5nIGlzIHNlbGVjdGVkIHRoaXMgbXVzdCBiZSBhIHRlbXBvcmFyeSBidWZmZXIgYW5kICAgICoKLSAgICAgKiBoZW5jZSB0aGlzIGlzIHRoZSB3b3JzdCBjYXNlLCBzbyBmb3Igc2ltcGxpY2l0eSB0aGlzIHdpbGwgQUxXQVlTIGJlIHNvICAgICAqCi0gICAgICogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKgotICAgICAqIFRoZSBpbnB1dCBidWZmZXIgd2lsbCByZW1haW4gdW50b3VjaGVkIHVudGlsIHRoZSBvdXRwdXQgb2YgdGhlIG1peGVyIGlmICAgICoKLSAgICAgKiBJTlBMQUNFIHByb2Nlc3NpbmcgaXMgc2VsZWN0ZWQuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqCi0gICAgICogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKgotICAgICAqIFRoZSB0ZW1wIGJ1ZmZlciB3aWxsIGFsd2F5cyBiZSBOdW1TYW1wbGVzIGluIHNpemUgcmVnYXJkbGVzcyBvZiBNT05PIG9yICAgICoKLSAgICAgKiBTVEVSRU8gaW5wdXQuIEluIHRoZSBjYXNlIG9mIHN0ZXJlbyBpbnB1dCBhbGwgcHJvY2Vzc2luZyBpcyBkb25lIGluIE1PTk8gICAqCi0gICAgICogYW5kIHRoZSBmaW5hbCBvdXRwdXQgaXMgY29udmVydGVkIHRvIFNURVJFTyBhZnRlciB0aGUgbWl4ZXIgICAgICAgICAgICAgICAgKgotICAgICAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0KLSAgICBpZihwUHJpdmF0ZS0+SW5zdGFuY2VQYXJhbXMuTnVtRGVsYXlzID09IExWUkVWX0RFTEFZTElORVNfNCApCi0gICAgewotICAgICAgICBOdW1iZXJPZkRlbGF5TGluZXMgPSA0OwotICAgIH0KLSAgICBlbHNlIGlmKHBQcml2YXRlLT5JbnN0YW5jZVBhcmFtcy5OdW1EZWxheXMgPT0gTFZSRVZfREVMQVlMSU5FU18yICkKLSAgICB7Ci0gICAgICAgIE51bWJlck9mRGVsYXlMaW5lcyA9IDI7Ci0gICAgfQotICAgIGVsc2UKLSAgICB7Ci0gICAgICAgIE51bWJlck9mRGVsYXlMaW5lcyA9IDE7Ci0gICAgfQotCi0gICAgaWYocFByaXZhdGUtPkN1cnJlbnRQYXJhbXMuU291cmNlRm9ybWF0ID09IExWTV9NT05PKQotICAgIHsKLSAgICAgICAgcEluID0gcElucHV0OwotICAgIH0KLSAgICBlbHNlCi0gICAgewotICAgICAgICAvKgotICAgICAgICAgKiAgU3RlcmVvIHRvIG1vbm8gY29udmVyc2lvbgotICAgICAgICAgKi8KLQotICAgICAgICBGcm9tMmlUb01vbm9fMzIoIHBJbnB1dCwKLSAgICAgICAgICAgICAgICAgICAgICAgICBwVGVtcCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAoTFZNX0lOVDE2KU51bVNhbXBsZXMpOwotCi0gICAgICAgIHBJbiA9IHBUZW1wOwotICAgIH0KLQotICAgIE11bHQzc18zMngxNihwSW4sCi0gICAgICAgICAgICAgICAgIChMVk1fSU5UMTYpTFZSRVZfSEVBRFJPT00sCi0gICAgICAgICAgICAgICAgIHBUZW1wLAotICAgICAgICAgICAgICAgICAoTFZNX0lOVDE2KU51bVNhbXBsZXMpOwotCi0gICAgLyoKLSAgICAgKiAgSGlnaCBwYXNzIGZpbHRlcgotICAgICAqLwotICAgIEZPXzFJX0QzMkYzMkMzMV9UUkNfV1JBXzAxKCAmcFByaXZhdGUtPnBGYXN0Q29lZi0+SFBDb2VmcywKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcFRlbXAsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBUZW1wLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoTFZNX0lOVDE2KU51bVNhbXBsZXMpOwotICAgIC8qCi0gICAgICogIExvdyBwYXNzIGZpbHRlcgotICAgICAqLwotICAgIEZPXzFJX0QzMkYzMkMzMV9UUkNfV1JBXzAxKCAmcFByaXZhdGUtPnBGYXN0Q29lZi0+TFBDb2VmcywKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcFRlbXAsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBUZW1wLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoTFZNX0lOVDE2KU51bVNhbXBsZXMpOwotCi0gICAgLyoKLSAgICAgKiAgUHJvY2VzcyBhbGwgZGVsYXkgbGluZXMKLSAgICAgKi8KLQotICAgIGZvcihqID0gMDsgaiA8IE51bWJlck9mRGVsYXlMaW5lczsgaisrKQotICAgIHsKLSAgICAgICAgcERlbGF5TGluZSA9IHBQcml2YXRlLT5wU2NyYXRjaERlbGF5TGluZVtqXTsKLQotICAgICAgICAvKgotICAgICAgICAgKiBBbGwtcGFzcyBmaWx0ZXIgd2l0aCBwb3AgYW5kIGNsaWNrIHN1cHByZXNzaW9uCi0gICAgICAgICAqLwotICAgICAgICAvKiBHZXQgdGhlIHNtb290aGVkLCBkZWxheWVkIG91dHB1dC4gUHV0IGl0IGluIHRoZSBvdXRwdXQgYnVmZmVyICovCi0gICAgICAgIE1peFNvZnRfMlN0X0QzMkMzMV9TQVQoJnBQcml2YXRlLT5NaXhlcl9BUFRhcHNbal0sCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcFByaXZhdGUtPnBPZmZzZXRBW2pdLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBQcml2YXRlLT5wT2Zmc2V0QltqXSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwRGVsYXlMaW5lLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChMVk1fSU5UMTYpTnVtU2FtcGxlcyk7Ci0gICAgICAgIC8qIFJlLWFsaWduIHRoZSBhbGwgcGFzcyBmaWx0ZXIgZGVsYXkgYnVmZmVyIGFuZCBjb3B5aW5nIHRoZSBmaXhlZCBkZWxheSBkYXRhIHRvIHRoZSBBUCBkZWxheSBpbiB0aGUgcHJvY2VzcyAqLwotICAgICAgICBDb3B5XzE2KChMVk1fSU5UMTYgKikmcFByaXZhdGUtPnBEZWxheV9UW2pdW051bVNhbXBsZXNdLAotICAgICAgICAgICAgICAgIChMVk1fSU5UMTYgKilwUHJpdmF0ZS0+cERlbGF5X1Rbal0sCi0gICAgICAgICAgICAgICAgKExWTV9JTlQxNikoKHBQcml2YXRlLT5UW2pdLU51bVNhbXBsZXMpIDw8IDEpKTsgICAgICAgICAvKiAzMi1iaXQgZGF0YSAqLwotICAgICAgICAvKiBBcHBseSB0aGUgc21vb3RoZWQgZmVlZGJhY2sgYW5kIHNhdmUgdG8gZml4ZWQgZGVsYXkgaW5wdXQgKGN1cnJlbnRseSBlbXB0eSkgKi8KLSAgICAgICAgTWl4U29mdF8xU3RfRDMyQzMxX1dSQSgmcFByaXZhdGUtPk1peGVyX1NHRmVlZGJhY2tbal0sCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcERlbGF5TGluZSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmcFByaXZhdGUtPnBEZWxheV9UW2pdW3BQcml2YXRlLT5UW2pdLU51bVNhbXBsZXNdLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChMVk1fSU5UMTYpTnVtU2FtcGxlcyk7Ci0gICAgICAgIC8qIFN1bSBpbnRvIHRoZSBBUCBkZWxheSBsaW5lICovCi0gICAgICAgIE1hYzNzX1NhdF8zMngxNigmcFByaXZhdGUtPnBEZWxheV9UW2pdW3BQcml2YXRlLT5UW2pdLU51bVNhbXBsZXNdLAotICAgICAgICAgICAgICAgICAgICAgICAgLTB4N2ZmZiwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLyogSW52ZXJ0IHNpbmNlIHRoZSBmZWVkYmFjayBjb2VmZmljaWVudCBpcyBuZWdhdGl2ZSAqLwotICAgICAgICAgICAgICAgICAgICAgICAgJnBQcml2YXRlLT5wRGVsYXlfVFtqXVtwUHJpdmF0ZS0+RGVsYXlfQVBbal0tTnVtU2FtcGxlc10sCi0gICAgICAgICAgICAgICAgICAgICAgICAoTFZNX0lOVDE2KU51bVNhbXBsZXMpOwotICAgICAgICAvKiBBcHBseSBzbW9vdGhlZCBmZWVkZm9yd2FyZCBzYW5kIHNhdmUgdG8gZml4ZWQgZGVsYXkgaW5wdXQgKGN1cnJlbnRseSBlbXB0eSkgKi8KLSAgICAgICAgTWl4U29mdF8xU3RfRDMyQzMxX1dSQSgmcFByaXZhdGUtPk1peGVyX1NHRmVlZGZvcndhcmRbal0sCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJnBQcml2YXRlLT5wRGVsYXlfVFtqXVtwUHJpdmF0ZS0+RGVsYXlfQVBbal0tTnVtU2FtcGxlc10sCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJnBQcml2YXRlLT5wRGVsYXlfVFtqXVtwUHJpdmF0ZS0+VFtqXS1OdW1TYW1wbGVzXSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoTFZNX0lOVDE2KU51bVNhbXBsZXMpOwotICAgICAgICAvKiBTdW0gaW50byB0aGUgQVAgb3V0cHV0ICovCi0gICAgICAgIE1hYzNzX1NhdF8zMngxNigmcFByaXZhdGUtPnBEZWxheV9UW2pdW3BQcml2YXRlLT5UW2pdLU51bVNhbXBsZXNdLAotICAgICAgICAgICAgICAgICAgICAgICAgMHg3ZmZmLAotICAgICAgICAgICAgICAgICAgICAgICAgcERlbGF5TGluZSwKLSAgICAgICAgICAgICAgICAgICAgICAgIChMVk1fSU5UMTYpTnVtU2FtcGxlcyk7Ci0KLSAgICAgICAgLyoKLSAgICAgICAgICogIEZlZWRiYWNrIGdhaW4KLSAgICAgICAgICovCi0gICAgICAgIE1peFNvZnRfMVN0X0QzMkMzMV9XUkEoJnBQcml2YXRlLT5GZWVkYmFja01peGVyW2pdLCBwRGVsYXlMaW5lLCBwRGVsYXlMaW5lLCBOdW1TYW1wbGVzKTsKLQotICAgICAgICAvKgotICAgICAgICAgKiAgTG93IHBhc3MgZmlsdGVyCi0gICAgICAgICAqLwotICAgICAgICBGT18xSV9EMzJGMzJDMzFfVFJDX1dSQV8wMSggJnBQcml2YXRlLT5wRmFzdENvZWYtPlJldkxQQ29lZnNbal0sCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwRGVsYXlMaW5lLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcERlbGF5TGluZSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChMVk1fSU5UMTYpTnVtU2FtcGxlcyk7Ci0gICAgfQotCi0gICAgLyoKLSAgICAgKiAgQXBwbHkgcm90YXRpb24gbWF0cml4IGFuZCBkZWxheSBzYW1wbGVzCi0gICAgICovCi0gICAgZm9yKGogPSAwOyBqIDwgTnVtYmVyT2ZEZWxheUxpbmVzOyBqKyspCi0gICAgewotCi0gICAgICAgIENvcHlfMTYoIChMVk1fSU5UMTYqKShwVGVtcCksCi0gICAgICAgICAgICAgICAgIChMVk1fSU5UMTYqKShwRGVsYXlMaW5lSW5wdXQpLAotICAgICAgICAgICAgICAgICAoTFZNX0lOVDE2KShOdW1TYW1wbGVzIDw8IDEpKTsKLQotICAgICAgICAvKgotICAgICAgICAgKiAgUm90YXRpb24gbWF0cml4IG1peAotICAgICAgICAgKi8KLSAgICAgICAgc3dpdGNoKGopCi0gICAgICAgIHsKLSAgICAgICAgICAgIGNhc2UgMzoKLSAgICAgICAgICAgICAgICAvKgotICAgICAgICAgICAgICAgICAqICBBZGQgZGVsYXkgbGluZSAxIGFuZCAyIGNvbnRyaWJ1dGlvbgotICAgICAgICAgICAgICAgICAqLwotICAgICAgICAgICAgICAgICBNYWMzc19TYXRfMzJ4MTYocFByaXZhdGUtPnBTY3JhdGNoRGVsYXlMaW5lWzFdLCAtMHg4MDAwLCBwRGVsYXlMaW5lSW5wdXQsIChMVk1fSU5UMTYpTnVtU2FtcGxlcyk7Ci0gICAgICAgICAgICAgICAgIE1hYzNzX1NhdF8zMngxNihwUHJpdmF0ZS0+cFNjcmF0Y2hEZWxheUxpbmVbMl0sIC0weDgwMDAsIHBEZWxheUxpbmVJbnB1dCwgKExWTV9JTlQxNilOdW1TYW1wbGVzKTsKLQotICAgICAgICAgICAgICAgIGJyZWFrOwotICAgICAgICAgICAgY2FzZSAyOgotCi0gICAgICAgICAgICAgICAgLyoKLSAgICAgICAgICAgICAgICAgKiAgQWRkIGRlbGF5IGxpbmUgMCBhbmQgMyBjb250cmlidXRpb24KLSAgICAgICAgICAgICAgICAgKi8KLSAgICAgICAgICAgICAgICAgTWFjM3NfU2F0XzMyeDE2KHBQcml2YXRlLT5wU2NyYXRjaERlbGF5TGluZVswXSwgLTB4ODAwMCwgcERlbGF5TGluZUlucHV0LCAoTFZNX0lOVDE2KU51bVNhbXBsZXMpOwotICAgICAgICAgICAgICAgICBNYWMzc19TYXRfMzJ4MTYocFByaXZhdGUtPnBTY3JhdGNoRGVsYXlMaW5lWzNdLCAtMHg4MDAwLCBwRGVsYXlMaW5lSW5wdXQsIChMVk1fSU5UMTYpTnVtU2FtcGxlcyk7Ci0KLSAgICAgICAgICAgICAgICBicmVhazsKLSAgICAgICAgICAgIGNhc2UgMToKLSAgICAgICAgICAgICAgICBpZihwUHJpdmF0ZS0+SW5zdGFuY2VQYXJhbXMuTnVtRGVsYXlzID09IExWUkVWX0RFTEFZTElORVNfNCkKLSAgICAgICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgICAgIC8qCi0gICAgICAgICAgICAgICAgICAgICAqICBBZGQgZGVsYXkgbGluZSAwIGFuZCAzIGNvbnRyaWJ1dGlvbgotICAgICAgICAgICAgICAgICAgICAgKi8KLSAgICAgICAgICAgICAgICAgICAgTWFjM3NfU2F0XzMyeDE2KHBQcml2YXRlLT5wU2NyYXRjaERlbGF5TGluZVswXSwgLTB4ODAwMCwgcERlbGF5TGluZUlucHV0LCAoTFZNX0lOVDE2KU51bVNhbXBsZXMpOwotICAgICAgICAgICAgICAgICAgICBBZGQyX1NhdF8zMngzMihwUHJpdmF0ZS0+cFNjcmF0Y2hEZWxheUxpbmVbM10sIHBEZWxheUxpbmVJbnB1dCwgKExWTV9JTlQxNilOdW1TYW1wbGVzKTsKLQotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICBlbHNlCi0gICAgICAgICAgICAgICAgewotICAgICAgICAgICAgICAgICAgICAvKgotICAgICAgICAgICAgICAgICAgICAgKiAgQWRkIGRlbGF5IGxpbmUgMCBhbmQgMSBjb250cmlidXRpb24KLSAgICAgICAgICAgICAgICAgICAgICovCi0gICAgICAgICAgICAgICAgICAgICBNYWMzc19TYXRfMzJ4MTYocFByaXZhdGUtPnBTY3JhdGNoRGVsYXlMaW5lWzBdLCAtMHg4MDAwLCBwRGVsYXlMaW5lSW5wdXQsIChMVk1fSU5UMTYpTnVtU2FtcGxlcyk7Ci0gICAgICAgICAgICAgICAgICAgICBNYWMzc19TYXRfMzJ4MTYocFByaXZhdGUtPnBTY3JhdGNoRGVsYXlMaW5lWzFdLCAtMHg4MDAwLCBwRGVsYXlMaW5lSW5wdXQsIChMVk1fSU5UMTYpTnVtU2FtcGxlcyk7Ci0KLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgYnJlYWs7Ci0gICAgICAgICAgICBjYXNlIDA6Ci0gICAgICAgICAgICAgICAgaWYocFByaXZhdGUtPkluc3RhbmNlUGFyYW1zLk51bURlbGF5cyA9PSBMVlJFVl9ERUxBWUxJTkVTXzQpCi0gICAgICAgICAgICAgICAgewotICAgICAgICAgICAgICAgICAgICAvKgotICAgICAgICAgICAgICAgICAgICAgKiAgQWRkIGRlbGF5IGxpbmUgMSBhbmQgMiBjb250cmlidXRpb24KLSAgICAgICAgICAgICAgICAgICAgICovCi0gICAgICAgICAgICAgICAgICAgIE1hYzNzX1NhdF8zMngxNihwUHJpdmF0ZS0+cFNjcmF0Y2hEZWxheUxpbmVbMV0sIC0weDgwMDAsIHBEZWxheUxpbmVJbnB1dCwgKExWTV9JTlQxNilOdW1TYW1wbGVzKTsKLSAgICAgICAgICAgICAgICAgICAgQWRkMl9TYXRfMzJ4MzIocFByaXZhdGUtPnBTY3JhdGNoRGVsYXlMaW5lWzJdLCBwRGVsYXlMaW5lSW5wdXQsIChMVk1fSU5UMTYpTnVtU2FtcGxlcyk7Ci0KLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgZWxzZSBpZihwUHJpdmF0ZS0+SW5zdGFuY2VQYXJhbXMuTnVtRGVsYXlzID09IExWUkVWX0RFTEFZTElORVNfMikKLSAgICAgICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgICAgIC8qCi0gICAgICAgICAgICAgICAgICAgICAqICBBZGQgZGVsYXkgbGluZSAwIGFuZCAxIGNvbnRyaWJ1dGlvbgotICAgICAgICAgICAgICAgICAgICAgKi8KLSAgICAgICAgICAgICAgICAgICAgQWRkMl9TYXRfMzJ4MzIocFByaXZhdGUtPnBTY3JhdGNoRGVsYXlMaW5lWzBdLCBwRGVsYXlMaW5lSW5wdXQsIChMVk1fSU5UMTYpTnVtU2FtcGxlcyk7Ci0gICAgICAgICAgICAgICAgICAgIE1hYzNzX1NhdF8zMngxNihwUHJpdmF0ZS0+cFNjcmF0Y2hEZWxheUxpbmVbMV0sIC0weDgwMDAsIHBEZWxheUxpbmVJbnB1dCwgKExWTV9JTlQxNilOdW1TYW1wbGVzKTsKLQotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICBlbHNlCi0gICAgICAgICAgICAgICAgewotICAgICAgICAgICAgICAgICAgICAvKgotICAgICAgICAgICAgICAgICAgICAgKiAgQWRkIGRlbGF5IGxpbmUgMCBjb250cmlidXRpb24KLSAgICAgICAgICAgICAgICAgICAgICovCi0KLSAgICAgICAgICAgICAgICAgICAgLyogICAgICAgICAgICAgU09VUkNFICAgICAgICAgICAgICAgICAgICAgICAgICBERVNUSU5BVElPTiovCi0gICAgICAgICAgICAgICAgICAgIEFkZDJfU2F0XzMyeDMyKHBQcml2YXRlLT5wU2NyYXRjaERlbGF5TGluZVswXSwgcERlbGF5TGluZUlucHV0LCAoTFZNX0lOVDE2KU51bVNhbXBsZXMpOwotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICBicmVhazsKLSAgICAgICAgICAgIGRlZmF1bHQ6Ci0gICAgICAgICAgICAgICAgYnJlYWs7Ci0gICAgICAgIH0KLQotICAgICAgICAvKgotICAgICAgICAgKiAgRGVsYXkgc2FtcGxlcwotICAgICAgICAgKi8KLSAgICAgICAgQ29weV8xNigoTFZNX0lOVDE2ICopcERlbGF5TGluZUlucHV0LAotICAgICAgICAgICAgICAgIChMVk1fSU5UMTYgKikmcFByaXZhdGUtPnBEZWxheV9UW2pdW3BQcml2YXRlLT5UW2pdLU51bVNhbXBsZXNdLAotICAgICAgICAgICAgICAgIChMVk1fSU5UMTYpKE51bVNhbXBsZXMgPDwgMSkpOyAgICAgICAgICAgICAgLyogMzItYml0IGRhdGEgKi8KLQotICAgIH0KLQotCi0gICAgLyoKLSAgICAgKiAgQ3JlYXRlIHN0ZXJlbyBvdXRwdXQKLSAgICAgKi8KLSAgICBzd2l0Y2gocFByaXZhdGUtPkluc3RhbmNlUGFyYW1zLk51bURlbGF5cykKLSAgICB7Ci0gICAgICAgIGNhc2UgTFZSRVZfREVMQVlMSU5FU180OgotICAgICAgICAgICAgIEFkZDJfU2F0XzMyeDMyKHBQcml2YXRlLT5wU2NyYXRjaERlbGF5TGluZVszXSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBwUHJpdmF0ZS0+cFNjcmF0Y2hEZWxheUxpbmVbMF0sCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgKExWTV9JTlQxNilOdW1TYW1wbGVzKTsKLSAgICAgICAgICAgICBBZGQyX1NhdF8zMngzMihwUHJpdmF0ZS0+cFNjcmF0Y2hEZWxheUxpbmVbMl0sCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgcFByaXZhdGUtPnBTY3JhdGNoRGVsYXlMaW5lWzFdLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgIChMVk1fSU5UMTYpTnVtU2FtcGxlcyk7Ci0KLQotICAgICAgICAgICAgSm9pblRvMmlfMzJ4MzIocFByaXZhdGUtPnBTY3JhdGNoRGVsYXlMaW5lWzBdLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgcFByaXZhdGUtPnBTY3JhdGNoRGVsYXlMaW5lWzFdLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgcFRlbXAsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAoTFZNX0lOVDE2KU51bVNhbXBsZXMpOwotCi0KLSAgICAgICAgICAgIGJyZWFrOwotICAgICAgICBjYXNlIExWUkVWX0RFTEFZTElORVNfMjoKLQotICAgICAgICAgICAgIENvcHlfMTYoIChMVk1fSU5UMTYqKXBQcml2YXRlLT5wU2NyYXRjaERlbGF5TGluZVsxXSwKLSAgICAgICAgICAgICAgICAgICAgICAoTFZNX0lOVDE2KilwU2NyYXRjaCwKLSAgICAgICAgICAgICAgICAgICAgICAoTFZNX0lOVDE2KShOdW1TYW1wbGVzIDw8IDEpKTsKLQotICAgICAgICAgICAgTWFjM3NfU2F0XzMyeDE2KHBQcml2YXRlLT5wU2NyYXRjaERlbGF5TGluZVswXSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAtMHg4MDAwLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBTY3JhdGNoLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgIChMVk1fSU5UMTYpTnVtU2FtcGxlcyk7Ci0KLSAgICAgICAgICAgICBBZGQyX1NhdF8zMngzMihwUHJpdmF0ZS0+cFNjcmF0Y2hEZWxheUxpbmVbMV0sCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgcFByaXZhdGUtPnBTY3JhdGNoRGVsYXlMaW5lWzBdLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgIChMVk1fSU5UMTYpTnVtU2FtcGxlcyk7Ci0KLQotICAgICAgICAgICAgIEpvaW5UbzJpXzMyeDMyKHBQcml2YXRlLT5wU2NyYXRjaERlbGF5TGluZVswXSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBwU2NyYXRjaCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBwVGVtcCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAoTFZNX0lOVDE2KU51bVNhbXBsZXMpOwotICAgICAgICAgICAgYnJlYWs7Ci0gICAgICAgIGNhc2UgTFZSRVZfREVMQVlMSU5FU18xOgotICAgICAgICAgICAgTW9ub1RvMklfMzIocFByaXZhdGUtPnBTY3JhdGNoRGVsYXlMaW5lWzBdLAotICAgICAgICAgICAgICAgICAgICAgICAgcFRlbXAsCi0gICAgICAgICAgICAgICAgICAgICAgICAoTFZNX0lOVDE2KU51bVNhbXBsZXMpOwotICAgICAgICAgICAgYnJlYWs7Ci0gICAgICAgIGRlZmF1bHQ6Ci0gICAgICAgICAgICBicmVhazsKLSAgICB9Ci0KLQotICAgIC8qCi0gICAgICogIERyeS93ZXQgbWl4ZXIKLSAgICAgKi8KLQotICAgIHNpemUgPSAoTFZNX0lOVDE2KShOdW1TYW1wbGVzIDw8IDEpOwotICAgIE1peFNvZnRfMlN0X0QzMkMzMV9TQVQoJnBQcml2YXRlLT5CeXBhc3NNaXhlciwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgIHBUZW1wLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgcFRlbXAsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICBwT3V0cHV0LAotICAgICAgICAgICAgICAgICAgICAgICAgICAgc2l6ZSk7Ci0KLSAgICAvKiBBcHBseSBHYWluKi8KLQotICAgIFNoaWZ0X1NhdF92MzJ4djMyIChMVlJFVl9PVVRQVVRHQUlOX1NISUZULAotICAgICAgICAgICAgICAgICAgICAgICBwT3V0cHV0LAotICAgICAgICAgICAgICAgICAgICAgICBwT3V0cHV0LAotICAgICAgICAgICAgICAgICAgICAgICBzaXplKTsKLQotICAgIE1peFNvZnRfMVN0X0QzMkMzMV9XUkEoJnBQcml2YXRlLT5HYWluTWl4ZXIsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICBwT3V0cHV0LAotICAgICAgICAgICAgICAgICAgICAgICAgICAgcE91dHB1dCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgIHNpemUpOwotCi0gICAgcmV0dXJuOwotfQotCi0KLS8qIEV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IFdJVEhPVVQgV0FSUkFOVElFUyBPUiBDT05ESVRJT05TIE9GIEFOWSBLSU5ELCBlaXRoZXIgZXhwcmVzcyBvciBpbXBsaWVkLgotICogU2VlIHRoZSBMaWNlbnNlIGZvciB0aGUgc3BlY2lmaWMgbGFuZ3VhZ2UgZ292ZXJuaW5nIHBlcm1pc3Npb25zIGFuZAotICogbGltaXRhdGlvbnMgdW5kZXIgdGhlIExpY2Vuc2UuCi0gKi8KLQotLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0vKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICBJbmNsdWRlcyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLSNpbmNsdWRlICJMVlJFVl9Qcml2YXRlLmgiCi0KLS8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotLyogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiBGVU5DVElPTjogICAgICAgICAgICAgICAgTFZSRVZfU2V0Q29udHJvbFBhcmFtZXRlcnMgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogREVTQ1JJUFRJT046ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgU2V0cyBvciBjaGFuZ2VzIHRoZSBMVlJFViBtb2R1bGUgcGFyYW1ldGVycy4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogUEFSQU1FVEVSUzogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgaEluc3RhbmNlICAgICAgICAgICAgICAgSW5zdGFuY2UgaGFuZGxlICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICBwTmV3UGFyYW1zICAgICAgICAgICAgICBQb2ludGVyIHRvIGEgcGFyYW1ldGVyIHN0cnVjdHVyZSAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiBSRVRVUk5TOiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICBMVk1fU3VjY2VzcyAgICAgICAgICAgICBTdWNjZWVkZWQgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogIExWUkVWX05VTExBRERSRVNTICAgICAgIFdoZW4gaEluc3RhbmNlIG9yIHBOZXdQYXJhbXMgaXMgTlVMTCAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgTFZSRVZfT1VUT0ZSQU5HRSAgICAgICAgV2hlbiBhbnkgb2YgdGhlIG5ldyBwYXJhbWV0ZXJzIGlzIG91dCBvZiByYW5nZSAgICAgICAgICAgICAgKi8KLS8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogTk9URVM6ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgMS4gIFRoaXMgZnVuY3Rpb24gbWF5IGJlIGludGVycnVwdGVkIGJ5IHRoZSBMVlJFVl9Qcm9jZXNzIGZ1bmN0aW9uICAgICAgICAgICAgICAgICAgKi8KLS8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi1MVlJFVl9SZXR1cm5TdGF0dXNfZW4gTFZSRVZfU2V0Q29udHJvbFBhcmFtZXRlcnMoTFZSRVZfSGFuZGxlX3QgICAgICAgICAgIGhJbnN0YW5jZSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBMVlJFVl9Db250cm9sUGFyYW1zX3N0ICAgKnBOZXdQYXJhbXMpCi17Ci0KLSAgICBMVlJFVl9JbnN0YW5jZV9zdCAgICAgKnBMVlJFVl9Qcml2YXRlID0gKExWUkVWX0luc3RhbmNlX3N0ICopaEluc3RhbmNlOwotCi0KLSAgICAvKgotICAgICAqIENoZWNrIGZvciBl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SIpOwotICogeW91IG1heSBub3QgdXNlIHRoaXMgZmlsZSBleGNlcHQgaW4gY29tcGxpYW5jZSB3aXRoIHRoZSBMaWNlbnNlLgotICogWW91IG1heSBvYnRhaW4gYSBjb3B5IG9mIHRoZSBMaWNlbnNlIGF0Ci0gKgotICogICAgICBodHRwOi8vd3d3LmFwYWNoZS5vcmcvbGljZW5zZXMvTElDRU5TRS0yLjAKLSAqCi0gKiBVbmxlc3MgcmVxdWlyZWQgYnkgYXBwbGljYWJsZSBsYXcgb3IgYWdyZWVkIHRvIGluIHdyaXRpbmcsIHNvZnR3YXJlCi0gKiBkaXN0cmlidXRlZCB1bmRlciB0aGUgTGljZW5zZSBpcyBkaXN0cmlidXRlZCBvbiBhbiAiQVMgSVMiIEJBU0lTLAotICogV0lUSE9VVCBXQVJSQU5USUVTIE9SIENPTkRJVElPTlMgT0YgQU5ZIEtJTkQsIGVpdGhlciBleHByZXNzIG9yIGltcGxpZWQuCi0gKiBTZWUgdGhlIExpY2Vuc2UgZm9yIHRoZSBzcGVjaWZpYyBsYW5ndWFnZSBnb3Zlcm5pbmcgcGVybWlzc2lvbnMgYW5kCi0gKiBsaW1pdGF0aW9ucyB1bmRlciB0aGUgTGljZW5zZS4KLSAqLwotCi0vKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLS8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogIEluY2x1ZGVzICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotI2luY2x1ZGUgIkxWUkVWLmgiCi0KLS8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotLyogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgVGFibGVzICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0KLS8qIFRhYmxlIHdpdGggc3VwcG9ydGVkIHNhbXBsaW5nIHJhdGVzLiAgVGhlIHRhYmxlIGNhbiBiZSBpbmRleGVkIHVzaW5nIExWTV9Gc19lbiAgICAgICAqLwotY29uc3QgTFZNX1VJTlQxNiBMVk1fRnNUYWJsZVtdID0gewotICAgIDgwMDAgLAotICAgIDExMDI1LAotICAgIDEyMDAwLAotICAgIDE2MDAwLAotICAgIDIyMDUwLAotICAgIDI0MDAwLAotICAgIDMyMDAwLAotICAgIDQ0MTAwLAotICAgIDQ4MDAwCi19OwotCi0vKiBUYWJsZSB3aXRoIHN1cHBvcnRlZCBzYW1wbGluZyByYXRlcy4gIFRoZSB0YWJsZSBjYW4gYmUgaW5kZXhlZCB1c2luZyBMVk1fRnNfZW4gICAgICAgKi8KLUxWTV9VSU5UMTYgTFZNX0dldEZzR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QotICAqLwotCi0vKiBOb3JtYWxpemluZyBvdXRwdXQgaW5jbHVkaW5nIFJldmVyYiBMZXZlbCBwYXJ0IChvbmx5IHNoaWZ0IHVwKSovCi1jb25zdCBMVk1fSU5UMzIgTFZSRVZfR2FpblBvbHlUYWJsZVsyNF1bNV09e3sxLDE3NTQ3NDM0LDEyODg2NzQzNCwtMTIwOTg4ODk2LDUwNzYxMjI4LH0sCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHsyLDE4MjU2ODY5LDE3MjY2NjkwMiwtMTkzMTY5MjkyLDg4MzQ1NzQ0LH0sCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHszLDE2NTkxMzExLDEzOTI1MDE1MSwtMTQ5NjY3MjM0LDY2NzcwMDU5LH0sCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHs0LDE3Mzc5OTc3LDE3MDgzNTEzMSwtMTczNTc5MzIxLDc2Mjc4MTYzLH0sCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHs1LDE4OTYzNTEyLDIxMDM2NDkzNCwtMjI4NjIzNTE5LDEwMzQzNTAyMix9LAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB7NiwxNzc5NjMxOCwxMzU3NTY0MTcsLTE0NDA4NDA1Myw2NDMyNzY5OCx9LAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB7NywxNzQ1NDY5NSwxNzQ1OTMyMTQsLTE4NzUxMzA2NCw4NTE0NjU4Mix9LAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB7OCwxNzIyOTI1NywxNDA3MTU1NzAsLTE0NTc5MDU4OCw2NTM2MTc0MCx9LAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB7OSwxNzAwMDU0NywxNjMxOTU5NDYsLTE3NjczMzk2OSw3OTU2MjEzMCx9LAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB7MTAsMTY3MTE2OTksMTQyNDc2MzA0LC0xMzMzMzk4ODcsNTgzNjY1NDcsfSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgezEzLDE4MTA4NDE5LDE0OTIyMzY5NywtMTYxNzYyMDIwLDc0Mzk3NTg5LH0sCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHsxNSwxNjY4MjA0MywxMjQ4NDQ4ODQsLTEzNDI4NDQ4Nyw2MDA4MjE4MCx9LAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB7MTcsMTY2MjczNDYsMTIwOTM2NDMwLC0xMjE3NjY2NzQsNTMxNDY0MjEsfSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgezIwLDE3MzM4MzI1LDEyNTQzMjY5NCwtMTI2NjE2OTgzLDU2NTM0MjM3LH0sCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHsyNSwxNjQ4OTE0Niw5OTIxODIxNywtOTQ1OTc0NjcsNDA2MTY1MDYsfSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgezMwLDE1NTgyMzczLDg0NDc5MDQzLC03NTM2NTAwNiwzMDk1MjM0OCx9LAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB7NDAsMTYwMDA2NjksODQ4OTY2MTEsLTc1MDMxMTI3LDMwNjk2MzA2LH0sCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHs1MCwxNTA4NzA1NCw3MTY5NTAzMSwtNTkzNDkyNjgsMjMyNzk2NjksfSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgezYwLDE1ODMwNzE0LDY4NjcyOTcxLC01ODIxMTIwMSwyMzY3MTE1OCx9LAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB7NzAsMTU1MzYwNjEsNjY2NTc5NzIsLTU1OTAxNDM3LDIyNTYwMTUzLH0sCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHs3NSwxNTAxMzE0NSw0ODE3OTkxNywtMjQxMzgzNTQsNTIzMjA3NCx9LAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB7ODAsMTU2ODg3MzgsNTAxOTUwMzYsLTM0MjA2NzYwLDExNTE1NzkyLH0sCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHs5MCwxNjAwMzMyMiw0ODMyMzY2MSwtMzU2MDczNzgsMTMxNTM4NzIsfSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgezEwMCwxNTk1NTIyMyw0ODU1ODIwMSwtMzM3MDY4NjUsMTE3MTU3OTIsfSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfTsKLQotLyogRW5kIG9mIGZpbGUgKi8KLQpkaWZmIC0tZ2l0IGEvbWVkaWEvbGliZWZmZWN0cy9sdm0vbGliL1JldmVyYi9zcmMvTFZSRVZfVGFibGVzLmggYi9tZWRpYS9saWJlZmZlY3RzL2x2bS9saWIvUmV2ZXJiL3NyYy9MVlJFVl9UYWJsZXMuaApkZWxldGVkIGZpbGUgbW9kZSAxMDA2NDQKaW5kZXggNWY5OTNiZC4uMDAwMDAwMAotLS0gYS9tZWRpYS9saWJlZmZlY3RzL2x2bS9saWIvUmV2ZXJiL3NyYy9MVlJFVl9UYWJsZXMuaAorKysgL2Rldi9udWxsCkBAIC0xLDUwICswLDAgQEAKLS8qCi0gKiBDb3B5cmlnaHQgKEMpIDIwMDQtMjAxMCBOWFAgU29mdHd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qKioqKioqKioqKioqKioqKioqLwotLyogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgSW5jbHVkZXMgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0jaW5jbHVkZSAiTFZSRVZfUHJpdmF0ZS5oIgotCi0vKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLS8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogIERlZmluaXRpb25zICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotCi1leHRlcm4gY29uc3QgICAgTFZNX1VJTlQxNiAgTFZNX0ZzVGFibGVbXTsKLWV4dGVybiAgICAgICAgICBMVk1fVUlOVDE2ICBMVk1fR2V0RnNGcm9tVGFibGUoTFZN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ZWVkIHRvIGluIHdyaXRpbmcsIHNvZnR3YXJlCi0gKiBkaXN0cmlidXRlZCB1bmRlciB0aGUgTGljZW5zZSBpcyBkaXN0cmlidXRlZCBvbiBhbiAiQVMgSVMiIEJBU0lTLAotICogV0lUSE9VVCBXQVJSQU5USUVTIE9SIENPTkRJVElPTlMgT0YgQU5ZIEtJTkQsIGVpdGhlciBleHByZXNzIG9yIGltcGxpZWQuCi0gKiBTZWUgdGhlIExpY2Vuc2UgZm9yIHRoZSBzcGVjaWZpYyBsYW5ndWFnZSBnb3Zlcm5pbmcgcGVybWlzc2lvbnMgYW5kCi0gKiBsaW1pdGF0aW9ucyB1bmRlciB0aGUgTGljZW5zZS4KLSAqLwotCi0jaWZuZGVmIF9MVlBTQV9IXwotI2RlZmluZSBfTFZQU0FfSF8KLQotCi0jaW5jbHVkZSAiTFZNX1R5cGVzLmgiCi0KLQotI2lmZGVmIF9fY3BsdXNwbHVzCi1leHRlcm4gIkMiIHsKLSNlbmRpZiAvKiBfX2NwbHVzcGx1cyAqLwotCi0vKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLS8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogIENPTlNUQU5UUyBERUZJTklUSU9OUyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotCi0vKiBNZW1vcnkgdGFibGUqLwotI2RlZmluZSAgICAgTFZQU0FfTlJfTUVNT1JZX1JFR0lPTlMgICAgICAgICAgICAgICAgICA0ICAgICAgLyogTnVtYmVyIG9mIG1lbW9yeSByZWdpb25zICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLQotLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0vKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICBUWVBFUyBERUZJTklUSU9OUyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLS8qIE1lbW9yeSBUeXBlcyAqLwotdHlwZWRlZiBlbnVtCi17Ci0gICAgTFZQU0FfUEVSU0lTVEVOVCAgICAgID0gTFZNX1BFUlNJU1RFTlQsCi0gICAgTFZQU0FfUEVSU0lTVEVOVF9EQVRBID0gTFZNX1BFUlNJU1RFTlRfREFUQSwKLSAgICBMVlBTQV9QRVJTSVNURU5UX0NPRUYgPSBMVk1fUEVSU0lTVEVOVF9DT0VGLAotICAgIExWUFNBX1NDUkFUQ0ggICAgICAgICA9IExWTV9TQ1JBVENILAotICAgIExWUFNBX01FTU9SWV9EVU1NWSA9IExWTV9NQVhJTlRfMzIgICAgICAgICAgICAgICAgICAgICAgLyogRm9yY2UgMzIgYml0cyBlbnVtLCBkb24ndCB1c2UgaXQhICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLX0gTFZQU0FfTWVtb3J5VHlwZXNfZW47Ci0KLS8qIExldmVsIGRldGVjdGlvbiBzcGVlZCBjb250cm9sIHBhcmFtZXRlcnMgKi8KLXR5cGVkZWYgZW51bQotewotICAgIExWUFNBX1NQRUVEX0xPVywgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLyogTG93IHNwZWVkIGxldmVsICAgZGV0ZWN0aW9uICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLSAgICBMVlBTQV9TUEVFRF9NRURJVU0sICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8qIE1lZGl1bSBzcGVlZCBsZXZlbCAgIGRldGVjdGlvbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0gICAgTFZQU0FfU1BFRURfSElHSCwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvKiBIaWdoIHNwZWVkIGxldmVsICAgZGV0ZWN0aW9uICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotICAgIExWUFNBX1NQRUVEX0RVTU1ZID0gTFZNX01BWElOVF8zMiAgICAgICAgICAgICAgICAgICAgICAgLyogRm9yY2UgMzIgYml0cyBlbnVtLCBkb24ndCB1c2UgaXQhICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLX0gTFZQU0FfTGV2ZWxEZXRlY3RTcGVlZF9lbjsKLQotLyogRmlsdGVyIGNvbnRyb2wgcGFyYW1ldGVycyAqLwotdHlwZWRlZiBzdHJ1Y3QKLXsKLSAgICBMVk1fVUlOVDE2ICAgICAgICAgICAgICAgICBDZW50ZXJGcmVxdWVuY3k7ICAgICAgICAgICAgIC8qIENlbnRlciBmcmVxdWVuY3kgb2YgdGhlIGJhbmQtcGFzcyBmaWx0ZXIgKGluIEh6KSAgICAgICAgICAgICAgICAgICovCi0gICAgTFZNX1VJTlQxNiAgICAgICAgICAgICAgICAgUUZhY3RvcjsgICAgICAgICAgICAgICAgICAgICAvKiBRdWFsaXR5IGZhY3RvciBvZiB0aGUgZmlsdGVyICAgICAgICAgICAgIChpbiAxLzEwMCkgICAgICAgICAgICAgICAqLwotICAgIExWTV9JTlQxNiAgICAgICAgICAgICAgICAgIFBvc3RHYWluOyAgICAgICAgICAgICAgICAgICAgLyogUG9zdGdhaW4gdG8gYXBwbHkgYWZ0ZXIgdGhlIGZpbHRlcmluZyAgICAoaW4gZEIgUTE2LjApICAgICAgICAgICAgKi8KLQotfSBMVlBTQV9GaWx0ZXJQYXJhbV90OwotCi0vKiBMVlBTQSBpbml0aWFsaXphdGlvbiBwYXJhbWV0ZXJzICovCi10eXBlZGVmIHN0cnVjdAotewotICAgIExWTV9VSU5UMTYgICAgICAgICAgICAgICAgIFNwZWN0cmFsRGF0YUJ1ZmZlckR1cmF0aW9uOyAgLyogU3BlY3RyYWwgZGF0YSBidWZmZXIgZHVyYXRpb24gaW4gdGltZSAobXMgaW4gUTE2LjApICAgICAgICAgICAgICAgKi8KLSAgICBMVk1fVUlOVDE2ICAgICAgICAgICAgICAgICBNYXhJbnB1dEJsb2NrU2l6ZTsgICAgICAgICAgIC8qIE1heGltdW0gZXhwZWN0ZWQgaW5wdXQgYmxvY2sgc2l6ZSAoaW4gc2FtcGxlcykgICAgICAgICAgICAgICAgICAgICovCi0gICAgTFZNX1VJTlQxNiAgICAgICAgICAgICAgICAgbkJhbmRzOyAgICAgICAgICAgICAgICAgICAgICAvKiBOdW1iZXIgb2YgYmFuZHMgb2YgdGhlIFNBICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotICAgIExWUFNBX0ZpbHRlclBhcmFtX3QgICAgICAgKnBGaWx0ZXJzUGFyYW1zOyAgICAgICAgICAgICAgLyogUG9pbnRzIHRvIG5CYW5kcyBmaWx0ZXIgcGFyYW0gc3RydWN0dXJlcyBmb3IgZmlsdGVycyBzZXR0aW5ncyAgICAgKi8KLQotfSBMVlBTQV9Jbml0UGFyYW1zX3QsICpwTFZQU0FfSW5pdFBhcmFtc190OwotCi0vKiBMVlBTQSBjb250cm9sIHBhcmFtZXRlcnMgKi8KLXR5cGVkZWYgc3RydWN0Ci17Ci0gICAgTFZNX0ZzX2VuICAgICAgICAgICAgICAgICAgRnM7ICAgICAgICAgICAgICAgICAgICAgICAgICAvKiBJbnB1dCBzYW1wbGluZyByYXRlICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotICAgIExWUFNBX0xldmVsRGV0ZWN0U3BlZWRfZW4gIExldmVsRGV0ZWN0aW9uU3BlZWQ7ICAgICAgICAgLyogTGV2ZWwgZGV0ZWN0aW9uIHNwZWVkICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLQotfSBMVlBTQV9Db250cm9sUGFyYW1zX3QsICpwTFZQU0FfQ29udHJvbFBhcmFtc190OwotCi0vKiBNZW1vcnkgcmVnaW9uIGRlZmluaXRpb24gKi8KLXR5cGVkZWYgc3RydWN0Ci17Ci0gICAgTFZNX1VJTlQzMiAgICAgICAgICAgICAgICAgU2l6ZTsgICAgICAgICAgICAgICAgICAgICAgICAvKiBSZWdpb24gc2l6ZSBpbiBieXRlcyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotICAgIExWUFNBX01lbW9yeVR5cGVzX2VuICAgICAgIFR5cGU7ICAgICAgICAgICAgICAgICAgICAgICAgLyogUmVnaW9uIHR5cGUgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLSAgICB2b2lkICAgICAgICAgICAgICAgICAgICAgICAqcEJhc2VBZGRyZXNzOyAgICAgICAgICAgICAgIC8qIFBvaW50ZXIgdG8gdGhlIHJlZ2lvbiBiYXNlIGFkZHJlc3MgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi19IExWUFNBX01lbW9yeVJlZ2lvbl90OwotCi0vKiBNZW1vcnkgdGFibGUgY29udGFpbmluZyB0aGUgcmVnaW9uIGRlZmluaXRpb25zICovCi10eXBlZGVmIHN0cnVjdAotewotICAgIExWUFNBX01lbW9yeVJlZ2lvbl90ICAgICAgIFJlZ2lvbltMVlBTQV9OUl9NRU1PUllfUkVHSU9OU107LyogT25lIGRlZmluaXRpb24gZm9yIGVhY2ggcmVnaW9uICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLX0gTFZQU0FfTWVtVGFiX3Q7Ci0KLS8qIEF1ZGlvIHRpbWUgdHlwZSAqLwotdHlwZWRlZiBMVk1fSU5UMzIgTFZQU0FfVGltZTsKLQotLyogTW9kdWxlIGluc3RhbmNlIEhhbmRsZSAqLwotdHlwZWRlZiB2b2lkICpwTFZQU0FfSGFuZGxlX3Q7Ci0KLS8qIExWUFNBIHJldHVybiBjb2RlcyAqLwotdHlwZWRlZiBlbnVtCi17Ci0gICAgTFZQU0FfT0ssICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvKiBUaGUgZnVuY3Rpb24gcmFuIHdpdGhvdXQgYW55IHByb2JsZW0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotICAgIExWUFNBX0VSUk9SX0lOVkFMSURQQVJBTSwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLyogQSBwYXJhbWV0ZXIgaXMgaW5jb3JyZWN0ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLSAgICBMVlBTQV9FUlJPUl9XUk9OR1RJTUUsICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8qIEFuIGluY29ycmVjdCBBdWRpb1RpbWUgaXMgdXNlZCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0gICAgTFZQU0FfRVJST1JfTlVMTEFERFJFU1MsICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvKiBBIHBvaW50ZXIgaGFzIGEgTlVMTCB2YWx1ZSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotICAgIExWUFNBX1JFVFVSTl9EVU1NWSA9IExWTV9NQVhJTlRfMzIgICAgICAgICAgICAgICAgICAgICAgLyogRm9yY2UgMzIgYml0cyBlbnVtLCBkb24ndCB1c2UgaXQhICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLX0gTFZQU0FfUkVUVVJOOwotCi0KLQotLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgotICAgRlVOQ1RJT05TIFBST1RPVFlQRQotKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLS8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0vKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogRlVOQ1RJT046ICAgICAgICAgICAgTFZQU0FfTWVtb3J5ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qIERFU0NSSVBUSU9OOiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgVGhpcyBmdW5jdGlvbiBpcyB1c2VkIGZvciBtZW1vcnkgYWxsb2NhdGlvbiBhbmQgZnJlZS4gSXQgY2FuIGJlIGNhbGxlZCBpbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogIHR3byB3YXlzOiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgICAgIGhJbnN0YW5jZSA9IE5VTEwgICAgICAgICAgICAgICAgUmV0dXJucyB0aGUgbWVtb3J5IHJlcXVpcmVtZW50cyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogICAgICBoSW5zdGFuY2UgPSBJbnN0YW5jZSBoYW5kbGUgICAgIFJldHVybnMgdGhlIG1lbW9yeSByZXF1aXJlbWVudHMgYW5kICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBhbGxvY2F0ZWQgYmFzZSBhZGRyZXNzZXMgZm9yIHRoZSBpbnN0YW5jZSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogIFdoZW4gdGhpcyBmdW5jdGlvbiBpcyBjYWxsZWQgZm9yIG1lbW9yeSBhbGxvY2F0aW9uIChoSW5zdGFuY2U9TlVMTCkgdGhlIG1lbW9yeSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICBiYXNlIGFkZHJlc3MgcG9pbnRlcnMgYXJlIE5VTEwgb24gcmV0dXJuLiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogIFdoZW4gdGhlIGZ1bmN0aW9uIGlzIGNhbGxlZCBmb3IgZnJlZSAoaEluc3RhbmNlID0gSW5zdGFuY2UgSGFuZGxlKSB0aGUgbWVtb3J5ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICB0YWJsZSByZXR1cm5zIHRoZSBhbGxvY2F0ZWQgbWVtb3J5IGFuZCBiYXNlIGFkZHJlc3NlcyB1c2VkIGR1cmluZyBpbml0aWFsaXNhdGlvbi4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogUEFSQU1FVEVSUzogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICBoSW5zdGFuY2UgICAgICAgICAgIEluc3RhbmNlIEhhbmRsZSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgcE1lbW9yeVRhYmxlICAgICAgICBQb2ludGVyIHRvIGFuIGVtcHR5IG1lbW9yeSBkZWZpbml0aW9uIHRhYmxlICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogIHBJbml0UGFyYW1zICAgICAgICAgUG9pbnRlciB0byB0aGUgaW5zdGFuY2UgaW5pdCBwYXJhbWV0ZXJzICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiBSRVRVUk5TOiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogIExWUFNBX09LICAgICAgICAgICAgU3VjY2VlZHMgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICBvdGhlcndpc2UgICAgICAgICAgIEVycm9yIGR1ZSB0byBiYWQgcGFyYW1ldGVycyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLUxWUFNBX1JFVFVSTiBMVlBTQV9NZW1vcnkgICAgICAgICAgICAoIHBMVlBTQV9IYW5kbGVfdCAgICAgICAgICAgICBoSW5zdGFuY2UsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBMVlBTQV9NZW1UYWJfdCAgICAgICAgICAgICAqcE1lbW9yeVRhYmxlLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTFZQU0FfSW5pdFBhcmFtc190ICAgICAgICAgKnBJbml0UGFyYW1zICAgICk7Ci0KLS8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0vKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogRlVOQ1RJT046ICAgICAgICAgICAgTFZQU0FfSW5pdCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiBERVNDUklQVElPTjogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogIEluaXRpYWxpemVzIHRoZSBMVlBTQSBtb2R1bGUuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogUEFSQU1FVEVSUzogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICBwaEluc3RhbmNlICAgICAgICAgIFBvaW50ZXIgdG8gdGhlIGluc3RhbmNlIEhhbmRsZSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgcEluaXRQYXJhbXMgICAgICAgICBQb2ludGVyIHRvIHRoZSBpbnN0YW5jZSBpbml0IHBhcmFtZXRlcnMgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogIHBDb250cm9sUGFyYW1zICAgICAgUG9pbnRlciB0byB0aGUgaW5zdGFuY2UgY29udHJvbCBwYXJhbWV0ZXJzICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICBwTWVtb3J5VGFibGUgICAgICAgIFBvaW50ZXIgdG8gdGhlIG1lbW9yeSBkZWZpbml0aW9uIHRhYmxlICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qIFJFVFVSTlM6ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgTFZQU0FfT0sgICAgICAgICAgICBTdWNjZWVkcyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogIG90aGVyd2lzZSAgICAgICAgICAgRXJyb3IgZHVlIHRvIGJhZCBwYXJhbWV0ZXJzICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotTFZQU0FfUkVUVVJOIExWUFNBX0luaXQgICAgICAgICAgICAgICggcExWUFNBX0hhbmRsZV90ICAgICAgICAgICAgICpwaEluc3RhbmNlLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTFZQU0FfSW5pdFBhcmFtc190ICAgICAgICAgICpwSW5pdFBhcmFtcywKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIExWUFNBX0NvbnRyb2xQYXJhbXNfdCAgICAgICAqcENvbnRyb2xQYXJhbXMsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBMVlBTQV9NZW1UYWJfdCAgICAgICAgICAgICAgKnBNZW1vcnlUYWJsZSAgKTsKLQotLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLS8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiBGVU5DVElPTjogICAgICAgICAgICBMVlBTQV9Db250cm9sICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qIERFU0NSSVBUSU9OOiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgQ29udHJvbHMgdGhlIExWUFNBIG1vZHVsZS4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qIFBBUkFNRVRFUlM6ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgaEluc3RhbmNlICAgICAgICAgICBJbnN0YW5jZSBIYW5kbGUgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogIHBOZXdQYXJhbXMgICAgICAgICAgUG9pbnRlciB0byB0aGUgaW5zdGFuY2UgbmV3IGNvbnRyb2wgcGFyYW1ldGVycyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiBSRVRVUk5TOiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogIExWUFNBX09LICAgICAgICAgICAgU3VjY2VlZHMgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICBvdGhlcndpc2UgICAgICAgICAgIEVycm9yIGR1ZSB0byBiYWQgcGFyYW1ldGVycyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLUxWUFNBX1JFVFVSTiBMVlBTQV9Db250cm9sICAgICAgICAgICAoIHBMVlBTQV9IYW5kbGVfdCAgICAgICAgICAgICBoSW5zdGFuY2UsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBMVlBTQV9Db250cm9sUGFyYW1zX3QgICAgICAqcE5ld1BhcmFtcyAgICAgKTsKLQotLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLS8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiBGVU5DVElPTjogICAgICAgICAgICBMVlBTQV9Qcm9jZXNzICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qIERFU0NSSVBUSU9OOiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgVGhlIHByb2Nlc3MgY2FsY3VsYXRlcyB0aGUgbGV2ZWxzIG9mIHRoZSBmcmVxdWVuY3kgYmFuZHMuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qIFBBUkFNRVRFUlM6ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgaEluc3RhbmNlICAgICAgICAgICBJbnN0YW5jZSBIYW5kbGUgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogIHBMVlBTQV9JbnB1dFNhbXBsZXMgUG9pbnRlciB0byB0aGUgaW5wdXQgc2FtcGxlcyBidWZmZXIgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICBJbnB1dEJsb2NrU2l6ZSAgICAgIE51bWJlciBvZiBtb25vIHNhbXBsZXMgdG8gcHJvY2VzcyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgQXVkaW9UaW1lICAgICAgICAgICBQbGF5YmFjayB0aW1lIG9mIHRoZSBmaXJzdCBpbnB1dCBzYW1wbGUgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiBSRVRVUk5TOiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogIExWUFNBX09LICAgICAgICAgICAgU3VjY2VlZHMgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICBvdGhlcndpc2UgICAgICAgICAgIEVycm9yIGR1ZSB0byBiYWQgcGFyYW1ldGVycyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLUxWUFNBX1JFVFVSTiBMVlBTQV9Qcm9jZXNzICAgICAgICAgICAoIHBMVlBTQV9IYW5kbGVfdCAgICAgIGhJbnN0YW5jZSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIExWTV9JTlQxNiAgICAgICAgICAgKnBMVlBTQV9JbnB1dFNhbXBsZXMsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBMVk1fVUlOVDE2ICAgICAgICAgICBJbnB1dEJsb2NrU2l6ZSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIExWUFNBX1RpbWUgICAgICAgICAgIEF1ZGlvVGltZSAgICAgICAgICAgICApOwotCi0vKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotLyogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qIEZVTkNUSU9OOiAgICAgICAgICAgIExWUFNBX0dldFNwZWN0cnVtICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogREVTQ1JJUFRJT046ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICBUaGlzIGZ1bmN0aW9uIGlzIHVzZWQgZm9yIG1lbW9yeSBhbGxvY2F0aW9uIGFuZCBmcmVlLiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qIFBBUkFNRVRFUlM6ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgaEluc3RhbmNlICAgICAgICAgICAgSW5zdGFuY2UgSGFuZGxlICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogIEdldFNwZWN0cnVtQXVkaW9UaW1lIFRpbWUgdG8gcmV0cmlldmUgdGhlIHZhbHVlcyBhdCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICBwQ3VycmVudFZhbHVlcyAgICAgICBQb2ludGVyIHRvIGFuIGVtcHR5IGJ1ZmZlciA6IEN1cnJlbnQgbGV2ZWwgdmFsdWVzIG91dHB1dCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgcFBlYWtWYWx1ZXMgICAgICAgICAgUG9pbnRlciB0byBhbiBlbXB0eSBidWZmZXIgOiBQZWFrIGxldmVsIHZhbHVlcyBvdXRwdXQgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiBSRVRVUk5TOiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogIExWUFNBX09LICAgICAgICAgICAgU3VjY2VlZHMgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICBvdGhlcndpc2UgICAgICAgICAgIEVycm9yIGR1ZSB0byBiYWQgcGFyYW1ldGVycyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLUxWUFNBX1JFVFVSTiBMVlBTQV9HZXRTcGVjdHJ1bSAgICAgICAoIHBMVlBTQV9IYW5kbGVfdCAgICAgIGhJbnN0YW5jZSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIExWUFNBX1RpbWUgICAgICAgICAgIEdldFNwZWN0cnVtQXVkaW9UaW1lLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTFZNX1VJTlQ4ICAgICAgICAgICAqcEN1cnJlbnRWYWx1ZXMsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBMVk1fVUlOVDggICAgICAgICAgICpwUGVha1ZhbHVlcyAgICAgICAgICAgKTsKLQotLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLS8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiBGVU5DVElPTjogICAgICAgICAgICBMVlBTQV9HZXRDb250cm9sUGFyYW1zICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qIERFU0NSSVBUSU9OOiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgR2V0IHRoZSBjdXJyZW50IGNvbnRyb2wgcGFyYW1ldGVycyBvZiB0aGUgTFZQU0EgbW9kdWxlLiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qIFBBUkFNRVRFUlM6ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgaEluc3RhbmNlICAgICAgICAgICBJbnN0YW5jZSBIYW5kbGUgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogIHBQYXJhbXMgICAgICAgICAgICAgUG9pbnRlciB0byBhbiBlbXB0eSBjb250cm9sIHBhcmFtZXRlcnMgc3RydWN0dXJlICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qIFJFVFVSTlM6ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgTFZQU0FfT0sgICAgICAgICAgICBTdWNjZWVkcyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogIG90aGVyd2lzZSAgICAgICAgICAgRXJyb3IgZHVlIHRvIGJhZCBwYXJhbWV0ZXJzICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotTFZQU0FfUkVUVVJOIExWUFNBX0dldENvbnRyb2xQYXJhbXMgICggICAgcExWUFNBX0hhbmRsZV90ICAgICAgICAgICAgaEluc3RhbmNlLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTFZQU0FfQ29udHJvbFBhcmFtc190ICAgICAqcFBhcmFtcyAgICAgICk7Ci0KLS8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0vKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogRlVOQ1RJT046ICAgICAgICAgICAgTFZQU0FfR2V0SW5pdFBhcmFtcyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiBERVNDUklQVElPTjogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogIEdldCB0aGUgaW5pdGlhbGl6YXRpb24gcGFyYW1ldGVycyBvZiB0aGUgTFZQU0EgbW9kdWxlLiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiBQQVJBTUVURVJTOiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogIGhJbnN0YW5jZSAgICAgICAgICAgSW5zdGFuY2UgSGFuZGxlICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICBwUGFyYW1zICAgICAgICAgICAgIFBvaW50ZXIgdG8gYW4gZW1wdHkgaW5pdCBwYXJhbWV0ZXJzIHN0cnVjdHVyZSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiBSRVRVUk5TOiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogIExWUFNBX09LICAgICAgICAgICAgU3VjY2VlZHMgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICBvdGhlcndpc2UgICAgICAgICAgIEVycm9yIGR1ZSB0byBiYWQgcGFyYW1ldGVycyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLUxWUFNBX1JFVFVSTiBMVlBTQV9HZXRJbml0UGFyYW1zICAgICAoICAgIHBMVlBTQV9IYW5kbGVfdCAgICAgICAgICAgIGhJbnN0YW5jZSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIExWUFNBX0luaXRQYXJhbXNfdCAgICAgICAgKnBQYXJhbXMgICAgICApOwotCi0KLSNpZmRlZiBfX2NwbHVzcGx1cwotfQotI2VuZGlmIC8qIF9fY3BsdXNwbHVzICovCi0KLSNlbmRpZiAvKiBfTFZQU0FfSCAqLwpkaWZmIC0tZ2l0IGEvbWVkaWEvbGliZWZmZWN0cy9sdm0vbGliL1NwZWN0cnVtQW5hbHl6ZXIvc3JjL0xWUFNBX0NvbnRyb2wuYyBiL21lZGlhL2xpYmVmZmVjdHMvbHZtL2xpYi9TcGVjdHJ1bUFuYWx5emVyL3NyYy9MVlBTQV9Db250cm9sLmMKZGVsZXRlZCBmaWxlIG1vZGUgMTAwNjQ0CmluZGV4IGNkNWY2OWMuLjAwMDAwMDAKLS0tIG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MVlBTQV9Qcml2YXRlLmgiCi0jaW5jbHVkZSAgICAiVmVjdG9yQXJpdGhtZXRpYy5oIgotCi0jZGVmaW5lICAgICBMT1dfRlJFUSAgICAgICAgICAgIDI5OCAgICAgICAgICAgICAvKiAzMjc2OC8xMTAgZm9yIGxvdyB0ZXN0IGZyZXF1ZW5jeSAqLwotI2RlZmluZSAgICAgSElHSF9GUkVRICAgICAgICAgICAzODYgICAgICAgICAgICAgLyogMzI3NjgvODUgZm9yIGhpZ2ggdGVzdCBmcmVxdWVuY3kgKi8KLQotTFZQU0FfUkVUVVJOIExWUFNBX1NldEJQRmlsdGVyc1R5cGUgKCAgTFZQU0FfSW5zdGFuY2VQcl90ICAgICAgICAqcEluc3QsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBMVlBTQV9Db250cm9sUGFyYW1zX3QgICAgICAqcFBhcmFtcyAgKTsKLQotTFZQU0FfUkVUVVJOIExWUFNBX1NldFFQRkNvZWZmaWNpZW50cyggTFZQU0FfSW5zdGFuY2VQcl90ICAgICAgICAqcEluc3QsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBMVlBTQV9Db250cm9sUGFyYW1zX3QgICAgICAqcFBhcmFtcyAgKTsKLQotTFZQU0FfUkVUVVJOIExWUFNBX0JQU2luZ2xlUHJlY0NvZWZzKCAgTFZNX1VJTlQxNiAgICAgICAgICAgICBGcywKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIExWUFNBX0ZpbHRlclBhcmFtX3QgICAqcEZpbHRlclBhcmFtcywKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEJQX0MxNl9Db2Vmc190ICAgICAgICAqcENvZWZmaWNpZW50cyk7Ci0KLUxWUFNBX1JFVFVSTiBMVlBTQV9CUERvdWJsZVByZWNDb2VmcyggIExWTV9VSU5UMTYgICAgICAgICAgICBGcywKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIExWUFNBX0ZpbHRlclBhcmFtX3QgICpwRmlsdGVyUGFyYW1zLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgQlBfQzMyX0NvZWZzX3QgICAgICAgKnBDb2VmZmljaWVudHMpOwotCi1MVlBTQV9SRVRVUk4gTFZQU0FfQlBEb3VibGVQcmVjQ29lZnMoICBMVk1fVUlOVDE2ICAgICAgICAgICAgICBGcywKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIExWUFNBX0ZpbHRlclBhcmFtX3QgICAgICpwRmlsdGVyUGFyYW1zLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgQlBfQzMyX0NvZWZzX3QgICAgICAgICAgKnBDb2VmZmljaWVudHMpOwotCi1MVlBTQV9SRVRVUk4gTFZQU0FfU2V0QlBGQ29lZmZpY2llbnRzKCBMVlBTQV9JbnN0YW5jZVByX3QgICAgICAgICpwSW5zdCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIExWUFNBX0NvbnRyb2xQYXJhbXNfdCAgICAgICpwUGFyYW1zICApOwotCi1MVlBTQV9SRVRVUk4gTFZQU0FfQ2xlYXJGaWx0ZXJIaXN0b3J5KCBMVlBTQV9JbnN0YW5jZVByX3QgICAgICAgICpwSW5zdCk7Ci0KLQotCi0KLS8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0vKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogRlVOQ1RJT046ICAgICAgICAgICAgTFZQU0FfQ29udHJvbCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiBERVNDUklQVElPTjogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogIEdpdmUgc29tZSBuZXcgY29udHJvbCBwYXJhbWV0ZXJzIHRvIHRoZSBtb2R1bGUuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiBQQVJBTUVURVJTOiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogIGhJbnN0YW5jZSAgICAgICAgICAgUG9pbnRlciB0byB0aGUgaW5zdGFuY2UgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICBOZXdQYXJhbXMgICAgICAgICAgIFN0cnVjdHVyZSB0aGF0IGNvbnRhaW5zIHRoZSBuZXcgcGFyYW1ldGVycyAgICAgICAgICAgICAgICAgICovCi0vKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogUkVUVVJOUzogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICBMVlBTQV9PSyAgICAgICAgICAgIFN1Y2NlZWRzICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgb3RoZXJ3aXNlICAgICAgICAgICBFcnJvciBkdWUgdG8gYmFkIHBhcmFtZXRlcnMgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi1MVlBTQV9SRVRVUk4gTFZQU0FfQ29udHJvbCAgICAgICAgICAgKCBwTFZQU0FfSGFuZGxlX3QgICAgICAgICAgICAgaEluc3RhbmNlLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTFZQU0FfQ29udHJvbFBhcmFtc190ICAgICAgKnBOZXdQYXJhbXMgICAgICkKLXsKLQotICAgIExWUFNBX0luc3RhbmNlUHJfdCAgICAgKnBMVlBTQV9JbnN0ICAgID0gKExWUFNBX0luc3RhbmNlUHJfdCopaEluc3RhbmNlOwotCi0gICAgaWYoKGhJbnN0YW5jZSA9PSBMVk1fTlVMTCkgfHwgKHBOZXdQYXJhbXMgPT0gTFZNX05VTEwpKQotICAgIHsKLSAgICAgICAgcmV0dXJuKExWUFNBX0VSUk9SX05VTExBRERSRVNTKTsKLSAgICB9Ci0gICAgaWYocE5ld1BhcmFtcy0+RnMgPj0gTFZQU0FfTlJfU1VQUE9SVEVEX1JBVEUpCi0gICAgewotICAgICAgICByZXR1cm4oTFZQU0FfRVJST1JfSU5WQUxJRFBBUkFNKTsKLSAgICB9Ci0gICAgaWYocE5ld1BhcmFtcy0+TGV2ZWxEZXRlY3Rpb25TcGVlZCA+PSBMVlBTQV9OUl9TVVBQT1JURURfU1BFRUQpCi0gICAgewotICAgICAgICByZXR1cm4oTFZQU0FfRVJST1JfSU5WQUxJRFBBUkFNKTsKLSAgICB9Ci0KLSAgICBwTFZQU0FfSW5zdC0+TmV3UGFyYW1zID0gKnBOZXdQYXJhbXM7Ci0gICAgcExWUFNBX0luc3QtPmJDb250cm9sUGVuZGluZyA9IExWTV9UUlVFOwotCi0gICAgcmV0dXJuKExWUFNBX09LKTsKLX0KLQotLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLS8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiBGVU5DVElPTjogICAgICAgICAgICBMVlBTQV9HZXRDb250cm9sUGFyYW1zICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qIERFU0NSSVBUSU9OOiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgR2V0IHRoZSBjdXJyZW50IGNvbnRyb2wgcGFyYW1ldGVycyBvZiB0aGUgbW9kdWxlICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qIFBBUkFNRVRFUlM6ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgaEluc3RhbmNlICAgICAgIFBvaW50ZXIgdG8gdGhlIGluc3RhbmNlICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogIHBQYXJhbXMgICAgICAgICBQb2ludGVyIHRvIGFuIGVtcHR5IGNvbnRyb2wgc3RydWN0dXJlICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qIFJFVFVSTlM6ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgTFZQU0FfT0sgICAgICAgICAgICBTdWNjZWVkcyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogIG90aGVyd2lzZSAgICAgICAgICAgRXJyb3IgZHVlIHRvIGJhZCBwYXJhbWV0ZXJzICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotTFZQU0FfUkVUVVJOIExWUFNBX0dldENvbnRyb2xQYXJhbXMgICAgICAgICAoICAgIHBMVlBTQV9IYW5kbGVfdCAgICAgICAgICAgIGhJbnN0YW5jZSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBMVlBTQV9Db250cm9sUGFyYW1zX3QgICAgICpwUGFyYW1zICkKLXsKLSAgICBMVlBTQV9JbnN0YW5jZVByX3QgICAgICpwTFZQU0FfSW5zdCAgICA9IChMVlBTQV9JbnN0YW5jZVByX3QqKWhJbnN0YW5jZTsKLQotICAgIGlmKChoSW5zdGFuY2UgPT0gTFZNX05VTEwpIHx8IChwUGFyYW1zID09IExWTV9OVUxMKSkKLSAgICB7Ci0gICAgICAgIHJldHVybihMVlBTQV9FUlJPUl9OVUxMQUREUkVTUyk7Ci0gICAgfQotCi0gICAgcFBhcmFtcy0+RnMgICAgICAgICAgICAgICAgICAgICA9IHBMVlBTQV9JbnN0LT5DdXJyZW50UGFyYW1zLkZzOwotICAgIHBQYXJhbXMtPkxldmVsRGV0ZWN0aW9uU3BlZWQgICAgPSBwTFZQU0FfSW5zdC0+Q3VycmVudFBhcmFtcy5MZXZlbERldGVjdGlvblNwZWVkOwotCi0gICAgcmV0dXJuKExWUFNBX09LKTsKLX0KLQotCi0vKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotLyogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qIEZVTkNUSU9OOiAgICAgICAgICAgIExWUFNBX0dldEluaXRQYXJhbXMgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogREVTQ1JJUFRJT046ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICBHZXQgdGhlIGluaXRpYWxpemF0aW9uIHBhcmFtZXRlcnMgb2YgdGhlIG1vZHVsZSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogUEFSQU1FVEVSUzogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICBoSW5zdGFuY2UgICAgICAgUG9pbnRlciB0byB0aGUgaW5zdGFuY2UgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgcFBhcmFtcyAgICAgICAgIFBvaW50ZXIgdG8gYW4gZW1wdHkgY29udHJvbCBzdHJ1Y3R1cmUgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogUkVUVVJOUzogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICBMVlBTQV9PSyAgICAgICAgICAgIFN1Y2NlZWRzICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgb3RoZXJ3aXNlICAgICAgICAgICBFcnJvciBkdWUgdG8gYmFkIHBhcmFtZXRlcnMgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi1MVlBTQV9SRVRVUk4gTFZQU0FfR2V0SW5pdFBhcmFtcyAgICAgICAgICggICAgcExWUFNBX0hhbmRsZV90ICAgICAgICAgICAgaEluc3RhbmNlLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIExWUFNBX0luaXRQYXJhbXNfdCAgICAgICAgKnBQYXJhbXMgKQotewotICAgIExWUFNBX0luc3RhbmNlUHJfdCAgICAgKnBMVlBTQV9JbnN0ICAgID0gKExWUFNBX0luc3RhbmNlUHJfdCopaEluc3RhbmNlOwotCi0gICAgaWYoKGhJbnN0YW5jZSA9PSBMVk1fTlVMTCkgfHwgKHBQYXJhbXMgPT0gTFZNX05VTEwpKQotICAgIHsKLSAgICAgICAgcmV0dXJuKExWUFNBX0VSUk9SX05VTExBRERSRVNTKTsKLSAgICB9Ci0KLSAgICBwUGFyYW1zLT5TcGVjdHJhbERhdGFCdWZmZXJEdXJhdGlvbiAgID0gcExWUFNBX0luc3QtPlNwZWN0cmFsRGF0YUJ1ZmZlckR1cmF0aW9uOwotICAgIHBQYXJhbXMtPk1heElucHV0QmxvY2tTaXplICAgICAgICAgICAgPSBwTFZQU0FfSW5zdC0+TWF4SW5wdXRCbG9ja1NpemU7Ci0gICAgcFBhcmFtcy0+bkJhbmRzICAgICAgICAgICAgICAgICAgICAgICA9IHBMVlBTQV9JbnN0LT5uQmFuZHM7Ci0gICAgcFBhcmFtcy0+cEZpbHRlcnNQYXJhbXMgICAgICAgICAgICAgICA9IHBMVlBTQV9JbnN0LT5wRmlsdGVyc1BhcmFtczsKLQotICAgIHJldHVybihMVlBTQV9PSyk7Ci19Ci0KLQotLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLS8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiBGVU5DVElPTjogICAgICAgICAgICBMVlBTQV9BcHBseU5ld1NldHRpbmdzICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qIERFU0NSSVBUSU9OOiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgUmVpbml0aWFsaXplIHNvbWUgcGFyYW1ldGVycyBhbmQgY2hhbmdlcyBmaWx0ZXJzJyBjb2VmZmljaWVudHMgaWYgICAgICAgICAgICAgICAqLwotLyogIHNvbWUgY29udHJvbCBwYXJhbWV0ZXJzIGhhdmUgY2hhbmdlZC4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiBQQVJBTUVURVJTOiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogIHBJbnN0ICAgICAgICAgICAgICAgUG9pbnRlciB0byB0aGUgaW5zdGFuY2UgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiBSRVRVUk5TOiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogIExWUFNBX09LICAgICAgICAgICAgU3VjY2VlZHMgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICBvdGhlcndpc2UgICAgICAgICAgIEVycm9yIGR1ZSB0byBiYWQgcGFyYW1ldGVycyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogTk9URVM6ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotTFZQU0FfUkVUVVJOIExWUFNBX0FwcGx5TmV3U2V0dGluZ3MgKExWUFNBX0luc3RhbmNlUHJfdCAgICAgKnBJbnN0KQotewotICAgIExWTV9VSU5UMTYgaWk7Ci0gICAg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B7Ci0gICAgICAgICAgICBwSW5zdC0+cEZpbHRlcnNQYXJhbXNbaWktMV0uQ2VudGVyRnJlcXVlbmN5ID0gKExWTV9VSU5UMTYpIChGcmVxICogaWkpOwotICAgICAgICB9Ci0KLSAgICAgICAgLyogQ291bnQgdGhlIG51bWJlciBvZiByZWxldmFudCBmaWx0ZXJzLiBJZiB0aGUgY2VudGVyIGZyZXF1ZW5jeSBvZiB0aGUgZmlsdGVyIGlzCi0gICAgICAgICAgIGJpZ2dlciB0aGFuIHRoZSBueXF1aXN0IGZyZXF1ZW5jeSwgdGhlbiB0aGUgZmlsdGVyIGlzIG5vdCByZWxldmFudCBhbmQgZG9lc24ndAotICAgICAgICAgICBuZWVkIHRvIGJlIHVzZWQgKi8KLSAgICAgICAgZm9yKGlpID0gcEluc3QtPm5CYW5kczsgaWkgPiAwOyBpaS0tKQotICAgICAgICB7Ci0gICAgICAgICAgICBpZihwSW5zdC0+cEZpbHRlcnNQYXJhbXNbaWktMV0uQ2VudGVyRnJlcXVlbmN5IDwgKExWUFNBX1NhbXBsZVJhdGVUYWJbcEluc3QtPkN1cnJlbnRQYXJhbXMuRnNdPj4xKSkKLSAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICBwSW5zdC0+blJlbGV2YW50RmlsdGVycyA9IGlpOwotICAgICAgICAgICAgICAgIGJyZWFrOwotICAgICAgICAgICAgfQotICAgICAgICB9Ci0gICAgICAgIExWUFNBX1NldEJQRmlsdGVyc1R5cGUocEluc3QsICZQYXJhbXMpOwotICAgICAgICBMVlBTQV9TZXRCUEZDb2VmZmljaWVudHMocEluc3QsICZQYXJhbXMpOwotICAgICAgICBMVlBTQV9TZXRRUEZDb2VmZmljaWVudHMocEluc3QsICZQYXJhbXMpOwotICAgICAgICBMVlBTQV9DbGVhckZpbHRlckhpc3RvcnkocEluc3QpOwotICAgICAgICBwSW5zdC0+blNhbXBsZXNCdWZmZXJVcGRhdGUgPSAoTFZNX1VJTlQxNilMVlBTQV9uU2FtcGxlc0J1ZmZlclVwZGF0ZVtQYXJhbXMuRnNdOwotICAgICAgICBwSW5zdC0+QnVmZmVyVXBkYXRlU2FtcGxlc0NvdW50ID0gMDsKLSAgICAgICAgcEluc3QtPkRvd25TYW1wbGluZ0ZhY3RvciA9IExWUFNBX0Rvd25TYW1wbGluZ0ZhY3RvcltQYXJhbXMuRnNdOwotICAgICAgICBwSW5zdC0+RG93blNhbXBsaW5nQ291bnQgPSAwOwotICAgICAgICBmb3IoaWkgPSAwOyBpaSA8IChwSW5zdC0+bkJhbmRzICogcEluc3QtPlNwZWN0cmFsRGF0YUJ1ZmZlckxlbmd0aCk7IGlpKyspCi0gICAgICAgIHsKLSAgICAgICAgICAgIHBJbnN0LT5wU3BlY3RyYWxEYXRhQnVmZmVyU3RhcnRbaWldID0gMDsKLSAgICAgICAgfQotICAgICAgICBmb3IoaWkgPSAwOyBpaSA8IHBJbnN0LT5uQmFuZHM7IGlpKyspCi0gICAgICAgIHsKLSAgICAgICAgICAgIHBJbnN0LT5wUHJldmlvdXNQZWFrc1tpaV0gPSAwOwotICAgICAgICB9Ci0gICAgfQotICAgIGVsc2UKLSAgICB7Ci0gICAgICAgIGlmKFBhcmFtcy5MZXZlbERldGVjdGlvblNwZWVkICE9IHBJbnN0LT5DdXJyZW50UGFyYW1zLkxldmVsRGV0ZWN0aW9uU3BlZWQpCi0gICAgICAgIHsKLSAgICAgICAgICAgIExWUFNBX1NldFFQRkNvZWZmaWNpZW50cyhwSW5zdCwgJlBhcmFtcyk7Ci0gICAgICAgIH0KLSAgICB9Ci0KLSAgICBwSW5zdC0+Q3VycmVudFBhcmFtcyA9IHBJbnN0LT5OZXdQYXJhbXM7Ci0KLSAgICByZXR1cm4gKExWUFNBX09LKTsKLX0KLS8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0vKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogRlVOQ1RJT046ICAgICAgICAgICAgTFZQU0FfU2V0QlBGaWx0ZXJzVHlwZSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiBERVNDUklQVElPTjogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogIFNldHMgdGhlIGZpbHRlciB0eXBlIGJhc2VkIG9uIHRoZSBCUEZpbHRlclR5cGUuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiBQQVJBTUVURVJTOiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogIHBJbnN0ICAgICAgICAgICAgICAgUG9pbnRlciB0byB0aGUgaW5zdGFuY2UgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICBwUGFyYW1zICAgICAgICAgICAgIFBvbml0ZXIgdG8gY29ucm9sIHBhcmFtZXRlcnMgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogUkVUVVJOUzogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICBMVlBTQV9PSyAgICAgICAgICAgIEFsd2F5cyBzdWNjZWVkcyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogTk9URVM6ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICAxLiBUbyBzZWxlY3QgdGhlIGJpcXVhZCB0eXBlIHRoZSBmb2xsb3cgcnVsZXMgYXJlIGFwcGxpZWQ6ICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgICAgICAgICBEb3VibGUgcHJlY2lzaW9uICAgIGlmIChmYyA8PSBmcy8xMTApICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogICAgICAgICAgRG91YmxlIHByZWNpc2lvbiAgICBpZiAoZnMvMTEwIDwgZmMgPCBmcy84NSkgJiAoUT4zKSAgICAgICAgICAgICAgICAgICAgKi8KLS8qICAgICAgICAgIFNpbmdsZSBwcmVjaXNpb24gICAgb3RoZXJ3aXNlICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLUxWUFNBX1JFVFVSTiBMVlBTQV9TZXRCUEZpbHRlcnNUeXBlICggICBMVlBTQV9JbnN0YW5jZVByX3QgICAgICAgICpwSW5zdCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBMVlBTQV9Db250cm9sUGFyYW1zX3QgICAgICAqcFBhcmFtcyAgKQotewotCi0gICAgZXh0ZXJuIExWTV9VSU5UMTYgICBMVlBTQV9TYW1wbGVSYXRlVGFiW107ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvKiBTYW1wbGUgcmF0ZSB0YWJsZSAqLwotICAgIExWTV9VSU5UMTYgICAgICAgICAgaWk7ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLyogRmlsdGVyIGJhbmQgaW5kZXggKi8KLSAgICBMVk1fVUlOVDMyICAgICAgICAgIGZzID0gKExWTV9VSU5UMzIpTFZQU0FfU2FtcGxlUmF0ZVRhYlsoTFZNX1VJTlQxNilwUGFyYW1zLT5Gc107ICAgICAgLyogU2FtcGxlIHJhdGUgKi8KLSAgICBMVk1fVUlOVDMyICAgICAgICAgIGZjOyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8qIEZpbHRlciBjZW50cmUgZnJlcXVlbmN5ICovCi0gICAgTFZNX0lOVDE2ICAgICAgICAgICBRRmFjdG9yOyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvKiBGaWx0ZXIgUSBmYWN0b3IgKi8KLQotICAgIGZvciAoaWkgPSAwOyBpaSA8IHBJbnN0LT5uUmVsZXZhbnRGaWx0ZXJzOyBpaSsrKQotICAgIHsKLSAgICAgICAgLyoKLSAgICAgICAgICogR2V0IHRoZSBmaWx0ZXIgc2V0dGluZ3MKLSAgICAgICAgICovCi0gICAgICAgIGZjID0gKExWTV9VSU5UMzIpcEluc3QtPnBGaWx0ZXJzUGFyYW1zW2lpXS5DZW50ZXJGcmVxdWVuY3k7ICAgICAvKiBHZXQgdGhlIGJhbmQgY2VudHJlIGZyZXF1ZW5jeSAqLwotICAgICAgICBRRmFjdG9yID0oTFZNX0lOVDE2KSBwSW5zdC0+cEZpbHRlcnNQYXJhbXNbaWldLlFGYWN0b3I7ICAgICAgICAgICAgICAgICAgICAvKiBHZXQgdGhlIGJhbmQgUSBmYWN0b3IgKi8KLQotCi0gICAgICAgIC8qCi0gICAgICAgICAqIEZvciBlYWNoIGZpbHRlciBzZXQgdGhlIHR5cGUgb2YgYmlxdWFkIHJlcXVpcmVkCi0gICAgICAgICAqLwotICAgICAgICBwSW5zdC0+cEJQRmlsdGVyc1ByZWNpc2lvbltpaV0gPSBMVlBTQV9TaW1wbGVQcmVjaXNpb25GaWx0ZXI7ICAgICAvKiBEZWZhdWx0IHRvIHNpbmdsZSBwcmVjaXNpb24gKi8KLSAgICAgICAgaWYgKChMT1dfRlJFUSAqIGZzKSA+PSAoZmMgPDwgMTUpKQotICAgICAgICB7Ci0gICAgICAgICAgICAvKgotICAgICAgICAgICAgICogZmMgPD0gZnMvMTEwCi0gICAgICAgICAgICAgKi8KLSAgICAgICAgICAgIHBJbnN0LT5wQlBGaWx0ZXJzUHJlY2lzaW9uW2lpXSA9IExWUFNBX0RvdWJsZVByZWNpc2lvbkZpbHRlcjsKLSAgICAgICAgfQotICAgICAgICBlbHNlCi0gICAgICAgIHsKLSAgICAgICAgICAgIGlmICgoKExPV19GUkVRICogZnMpIDwgKGZjIDw8IDE1KSkgJiYgKChmYyA8PCAxNSkgPCAoSElHSF9GUkVRICogZnMpKSAmJiAoUUZhY3RvciA+IDMwMCkpCi0gICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgLyoKLSAgICAgICAgICAgICAgICAqIChmcy8xMTAgPCBmYyA8IGZzLzg1KSAmIChRPjMpCi0gICAgICAgICAgICAgICAgKi8KLSAgICAgICAgICAgICAgICBwSW5zdC0+cEJQRmlsdGVyc1ByZWNpc2lvbltpaV0gPSBMVlBTQV9Eb3VibGVQcmVjaXNpb25GaWx0ZXI7Ci0gICAgICAgICAgICB9Ci0gICAgICAgIH0KLSAgICB9Ci0KLSAgICByZXR1cm4oTFZQU0FfT0spOwotfQotCi0vKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotLyogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qIEZVTkNUSU9OOiAgICAgICAgICAgIExWUFNBX1NldEJQRkNvZWZmaWNpZW50cyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogREVTQ1JJUFRJT046ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICBTZXRzIHRoZSBiYW5kIHBhc3MgZmlsdGVyIGNvZWZmaWNpZW50cy4gVGhpcyB1c2VzIHRoZSB0eXBlIHRvIHNlbGVjdCAgICAgICAgICAgICovCi0vKiAgc2luZ2xlIG9yIGRvdWJsZSBwcmVjaXNpb24gY29lZmZpY2llbnRzLiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qIFBBUkFNRVRFUlM6ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgcEluc3QgICAgICAgICAgICAgICBQb2ludGVyIHRvIHRoZSBpbnN0YW5jZSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogIFBhcmFtcyAgICAgICAgICAgICAgSW5pdGlhbGlzYXRpb24gcGFyYW1ldGVycyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiBSRVRVUk5TOiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogIExWUFNBX09LICAgICAgICAgICAgQWx3YXlzIHN1Y2NlZWRzICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiBOT1RFUzogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi1MVlBTQV9SRVRVUk4gTFZQU0FfU2V0QlBGQ29lZmZpY2llbnRzKCAgTFZQU0FfSW5zdGFuY2VQcl90ICAgICAgICAqcEluc3QsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTFZQU0FfQ29udHJvbFBhcmFtc190ICAgICAgKnBQYXJhbXMpCi17Ci0KLSAgICBMVk1fVUlOVDE2ICAgICAgICAgICAgICAgICAgICAgIGlpOwotCi0gICAgLyoKLSAgICAgKiBTZXQgdGhlIGNvZWZmaWNpZW50cyBmb3IgZWFjaCBiYW5kIGJ5IHRoZSBpbml0IGZ1bmN0aW9uCi0gICAgICovCi0gICAgZm9yIChpaSA9IDA7IGlpIDwgcEluc3QtPm5SZWxldmFudEZpbHRlcnM7IGlpKyspCi0gICAgewotICAgICAgICBzd2l0Y2ggIChwSW5zdC0+cEJQRmlsdGVyc1ByZWNpc2lvbltpaV0pCi0gICAgICAgIHsKLSAgICAgICAgICAgIGNhc2UgICAgTFZQU0FfRG91YmxlUHJlY2lzaW9uRmlsdGVyOgotICAgICAgICAgICAgewotICAgICAgICAgICAgICAgIEJQX0MzMl9Db2Vmc190ICAgICAgQ29lZmZpY2llbnRzOwotCi0gICAgICAgICAgICAgICAgLyoKLSAgICAgICAgICAgICAgICAgKiBDYWxjdWxhdGUgdGhlIGRvdWJsZSBwcmVjaXNpb24gY29lZmZpY2llbnRzCi0gICAgICAgICAgICAgICAgICovCi0gICAgICAgICAgICAgICAgTFZQU0FfQlBEb3VibGVQcmVjQ29lZnMoKExWTV9VSU5UMTYpcFBhcmFtcy0+RnMsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmcEluc3QtPnBGaWx0ZXJzUGFyYW1zW2lpXSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICZDb2VmZmljaWVudHMpOwotCi0gICAgICAgICAgICAgICAgLyoKLSAgICAgICAgICAgICAgICAgKiBTZXQgdGhlIGNvZWZmaWNpZW50cwotICAgICAgICAgICAgICAgICAqLwotICAgICAgICAgICAgICAgIEJQXzFJX0QxNkYzMkNsbF9UUkNfV1JBXzAxX0luaXQgKCAmcEluc3QtPnBCUF9JbnN0YW5jZXNbaWldLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmcEluc3QtPnBCUF9UYXBzW2lpXSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJkNvZWZmaWNpZW50cyk7Ci0gICAgICAgICAgICAgICAgYnJlYWs7Ci0gICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgIGNhc2UgICAgTFZQU0FfU2ltcGxlUHJlY2lzaW9uRmlsdGVyOgotICAgICAgICAgICAgewotICAgICAgICAgICAgICAgIEJQX0MxNl9Db2Vmc190ICAgICAgQ29lZmZpY2llbnRzOwotCi0gICAgICAgICAgICAgICAgLyoKLSAgICAgICAgICAgICAgICAgKiBDYWxjdWxhdGUgdGhlIHNpbmdsZSBwcmVjaXNpb24gY29lZmZpY2llbnRzCi0gICAgICAgICAgICAgICAgICovCi0gICAgICAgICAgICAgICAgTFZQU0FfQlBTaW5nbGVQcmVjQ29lZnMoKExWTV9VSU5UMTYpcFBhcmFtcy0+RnMsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmcEluc3QtPnBGaWx0ZXJzUGFyYW1zW2lpXSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICZDb2VmZmljaWVudHMpOwotCi0gICAgICAgICAgICAgICAgLyoKLSAgICAgICAgICAgICAgICAgKiBTZXQgdGhlIGNvZWZmaWNpZW50cwotICAgICAgICAgICAgICAgICAqLwotICAgICAgICAgICAgICAgIEJQXzFJX0QxNkYxNkNzc19UUkNfV1JBXzAxX0luaXQgKCAmcEluc3QtPnBCUF9JbnN0YW5jZXNbaWldLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmcEluc3QtPnBCUF9UYXBzW2lpXSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJkNvZWZmaWNpZW50cyk7Ci0gICAgICAgICAgICAgICAgYnJlYWs7Ci0gICAgICAgICAgICB9Ci0gICAgICAgIH0KLSAgICB9Ci0KLSAgICByZXR1cm4oTFZQU0FfT0spOwotfQotCi0KLS8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0vKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogRlVOQ1RJT046ICAgICAgICAgICAgTFZQU0FfU2V0UVBGQ29lZmZpY2llbnRzICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiBERVNDUklQVElPTjogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogIFNldHMgdGhlIHF1YXNpIHBlYWsgZmlsdGVycyBjb2VmZmljaWVudHMuIFRoaXMgdXNlcyB0aGUgY2hvc2VuICAgICAgICAgICAgICAgICAgKi8KLS8qICBMZXZlbERldGVjdGlvblNwZWVkIGZyb20gdGhlIGNvbnRyb2wgcGFyYW1ldGVycy4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogUEFSQU1FVEVSUzogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICBwSW5zdCAgICAgICAgICAgICAgIFBvaW50ZXIgdG8gdGhlIGluc3RhbmNlICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgUGFyYW1zICAgICAgICAgICAgICBDb250cm9sIHBhcmFtZXRlcnMgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qIFJFVFVSTlM6ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgTFZQU0FfT0sgICAgICAgICAgICBBbHdheXMgc3VjY2VlZHMgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qIE5PVEVTOiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLUxWUFNBX1JFVFVSTiBMVlBTQV9TZXRRUEZDb2VmZmljaWVudHMoICAgTFZQU0FfSW5zdGFuY2VQcl90ICAgICAgICAqcEluc3QsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIExWUFNBX0NvbnRyb2xQYXJhbXNfdCAgICAgICpwUGFyYW1zICApCi17Ci0gICAgTFZNX1VJTlQxNiAgICAgaWk7Ci0gICAgTFZNX0ZzX2VuICAgICAgRnMgPSBwUGFyYW1zLT5GczsKLSAgICBRUERfQzMyX0NvZWZzICAqcENvZWZmaWNpZW50czsKLSAgICBleHRlcm4gICAgICAgICBRUERfQzMyX0NvZWZzICAgICBMVlBTQV9RUERfQ29lZnNbXTsKLQotCi0gICAgcENvZWZmaWNpZW50cyA9ICZMVlBTQV9RUERfQ29lZnNbKHBQYXJhbXMtPkxldmVsRGV0ZWN0aW9uU3BlZWQgKiBMVlBTQV9OUl9TVVBQT1JURURfUkFURSkgKyBGc107Ci0KLQotICAgIGZvciAoaWkgPSAwOyBpaSA8IHBJbnN0LT5uUmVsZXZhbnRGaWx0ZXJzOyBpaSsrKQotICAgIHsKLSAgICAgICAgICAgIExWUFNBX1FQRF9Jbml0ICgmcEluc3QtPnBRUERfU3RhdGVzW2lpXSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAmcEluc3QtPnBRUERfVGFwc1tpaV0sCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgcENvZWZmaWNpZW50cyApOwotICAgIH0KLQotICAgIHJldHVybihMVlBTQV9PSyk7Ci0KLX0KLQotLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0vKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qIEZVTkNUSU9OOiAgICAgICAgICAgICAgICAgTFZQU0FfQlBTaW5nbGVQcmVjQ29lZnMgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiBERVNDUklQVElPTjogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICBDYWxjdWxhdGUgc2luZ2xlIHByZWNpc2lvbiBjb2VmZmljaWVudHMgZm9yIGEgYmFuZCBwYXNzIGZpbHRlciAgICAgICAgICAgICAgICAgICAgICAqLwotLyogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiBQQVJBTUVURVJTOiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICBGcyAgICAgICAgICAgICAgICAgICAgICAgU2FtcGxpbmcgZnJlcXVlbmN5IGluZGV4ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogIHBGaWx0ZXJQYXJhbXMgICAgICAgICAgICBQb2ludGVyIHRvIHRoZSBmaWx0ZXIgZGVmaW5pdGlvbiAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgcENvZWZmaWNpZW50cyAgICAgICAgICAgIFBvaW50ZXIgdG8gdGhlIGNvZWZmaWNpZW50cyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogUkVUVVJOUzogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgTFZQU0FfT0sgICAgICAgICBBbHdheXMgc3VjY2VlZHMgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogTk9URVM6ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgMS4gVGhlIGVxdWF0aW9ucyB1c2VkIGFyZSBhcyBmb2xsb3dzOiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogICAgICB0MCA9IDIgKiBQaSAqIEZjIC8gRnMgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICAgICAgYjIgPSAtMC41ICogKDJRIC0gdDApIC8gKDJRICsgdDApICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogICAgICBiMSA9ICgwLjUgLSBiMikgKiBjb3ModDApICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgICAgIGEwID0gKDAuNSArIGIyKSAvIDIgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogIFdoZXJlOiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgICAgIEZjICAgICAgICAgIGlzIHRoZSBjZW50cmUgZnJlcXVlbmN5LCBEQyB0byBOeXF1aXN0ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICAgICAgRnMgICAgICAgICAgaXMgdGhlIHNhbXBsZSBmcmVxdWVuY3ksIDgwMDAgdG8gNDgwMDAgaW4gZGVzY3JldGUgc3RlcHMgICAgICAgICAgICAqLwotLyogICAgICBRICAgICAgICAgICBpcyB0aGUgUSBmYWN0b3IsIDAuMjUgdG8gMTIgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICAyLiBUaGlzIGZ1bmN0aW9uIGlzIGVudGlyZWx5IGJhc2VkIG9uIHRoZSBMVkVRTkJfU2luZ2xlUHJlY0NvZWZzIGZ1bmN0aW9uICAgICAgICAgICAqLwotLyogICAgIG9mIHRoZSBuIGJhbmRzIGVxdWFsaXplciAoTFZFUU5CICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotTFZQU0FfUkVUVVJOIExWUFNBX0JQU2luZ2xlUHJlY0NvZWZzKCAgICBMVk1fVUlOVDE2ICAgICAgICAgICAgICBGcywKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTFZQU0FfRmlsdGVyUGFyYW1fdCAgICAqcEZpbHRlclBhcmFtcywKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgQlBfQzE2X0NvZWZzX3QgICAgICAgICAqcENvZWZmaWNpZW50cykKLXsKLQotICAgIGV4dGVybiBMVk1fSU5UMTYgICAgTFZQU0FfVHdvUGlPbkZzVGFibGVbXTsKLSAgICBleHRlcm4gTFZNX0lOVDE2ICAgIExWUFNBX0Nvc0NvZWZbXTsKLQotCi0gICAgLyoKLSAgICAgKiBJbnRlcm1lZGlhdGUgdmFyaWFibGVzIGFuZCB0ZW1wb3JhcnkgdmFsdWVzCi0gICAgICovCi0gICAgTFZNX0lOVDMyICAgICAgICAgICBUMDsKLSAgICBMVk1fSU5UMTYgICAgICAgICAgIEQ7Ci0gICAgTFZNX0lOVDMyICAgICAgICAgICBBMDsKLSAgICBMVk1fSU5UMzIgICAgICAgICAgIEIxOwotICAgIExWTV9JTlQzMiAgICAgICAgICAgQjI7Ci0gICAgTFZNX0lOVDMyICAgICAgICAgICBEdDA7Ci0gICAgTFZNX0lOVDMyICAgICAgICAgICBCMl9EZW47Ci0gICAgTFZNX0lOVDMyICAgICAgICAgICBCMl9OdW07Ci0gICAgTFZNX0lOVDMyICAgICAgICAgICBDT1NfVDA7Ci0gICAgTFZNX0lOVDE2ICAgICAgICAgICBjb2VmOwotICAgIExWTV9JTlQzMiAgICAgICAgICAgZmFjdG9yOwotICAgIExWTV9JTlQxNiAgICAgICAgICAgdDA7Ci0gICAgTFZNX0lOVDE2ICAgICAgICAgICBpOwotCi0KLSAgICAvKgotICAgICAqIEdldCB0aGUgZmlsdGVyIGRlZmluaXRpb24KLSAgICAgKi8KLSAgICBMVk1fVUlOVDE2ICAgICAgICAgIEZyZXF1ZW5jeSAgID0gcEZpbHRlclBhcmFtcy0+Q2VudGVyRnJlcXVlbmN5OwotICAgIExWTV9VSU5UMTYgICAgICAgICAgUUZhY3RvciAgICAgPSBwRmlsdGVyUGFyYW1zLT5RRmFjdG9yOwotCi0KLSAgICAvKgotICAgICAqIENhbGN1bGF0aW5nIHRoZSBpbnRlcm1lZGlhdGUgdmFsdWVzCi0gICAgICovCi0gICAgVDAgPSAoTFZNX0lOVDMyKUZyZXF1ZW5jeSAqIExWUFNBX1R3b1BpT25Gc1RhYmxlW0ZzXTsgICAvKiBUMCA9IDIgKiBQaSAqIEZjIC8gRnMgKi8KLSAgICBEID0gMzIwMDsgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8qIEZsb2F0aW5nIHBvaW50IHZhbHVlIDEuMDAwMDAwICgxKjEwMCoyXjUpICovCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvKiBGb3JjZSBEID0gMSA6IHRoZSBmdW5jdGlvbiB3YXMgb3JpZ2luYWxseSB1c2VkIGZvciBhIHBlYWtpbmcgZmlsdGVyLgotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgVGhlIEQgcGFyYW1ldGVyIGRvIG5vdCBleGlzdCBmb3IgYSBCYW5kUGFzcyBmaWx0ZXIgY29lZmZpY2llbnRzICovCi0KLSAgICAvKgotICAgICAqIENhbGN1bGF0ZSB0aGUgQjIgY29lZmZpY2llbnQKLSAgICAgKi8KLSAgICBEdDAgPSBEICogKFQwID4+IDEwKTsKLSAgICBCMl9EZW4gPSAoTFZNX0lOVDMyKSgoKExWTV9VSU5UMzIpUUZhY3RvciA8PCAxOSkgKyAoTFZNX1VJTlQzMikoRHQwID4+IDIpKTsKLSAgICBCMl9OdW0gPSAoTFZNX0lOVDMyKSgoTFZNX1VJTlQzMikoRHQwID4+IDMpIC0gKChMVk1fVUlOVDMyKVFGYWN0b3IgPDwgMTgpKTsKLSAgICBCMiA9IChCMl9OdW0gLyAoQjJfRGVuID4+IDE2KSkgPDwgMTU7Ci0KLSAgICAvKgotICAgICAqIENhbGN1bGF0ZSB0aGUgY29zaW5lIGJ5IGEgcG9seW5vbWlhbCBleHBhbnNpb24gdXNpbmcgdGhlIGVxdWF0aW9uOgotICAgICAqCi0gICAgICogIENvcyArPSBjb2VmKG4pICogdDBebiAgICAgICAgICAgICAgICAgICBGb3IgbiA9IDAgdG8gNgotICAgICAqLwotICAgIFQwID0gKFQwID4+IDEwKSAqIDIwODU5OyAgICAgICAgICAgICAgICAgICAgLyogU2NhbGUgdG8gMS4wIGluIDE2LWJpdCBmb3IgcmFuZ2UgMCB0byBmcy8yICovCi0gICAgdDAgPSAoTFZNX0lOVDE2KShUMCA+PiAxNik7Ci0gICAgZmFjdG9yID0gMHg3ZmZmOyAgICAgICAgICAgICAgICAgICAgICAgICAgICAvKiBJbml0aWFsaXNlIHRvIDEuMCBmb3IgdGhlIGEwIGNvZWZmaWNpZW50ICovCi0gICAgQ09TX1QwID0gMDsgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvKiBJbml0aWFsaXNlIHRoZSBlcnJvciB0byB6ZXJvICovCi0gICAgZm9yIChpPTE7IGk8NzsgaSsrKQotICAgIHsKLSAgICAgICAgY29lZiA9IExWUFNBX0Nvc0NvZWZbaV07ICAgICAgICAgICAgICAgIC8qIEdldCB0aGUgbnRoIGNvZWZmaWNpZW50ICovCi0gICAgICAgIENPU19UMCArPSAoZmFjdG9yICogY29lZikgPj4gNTsgICAgICAgICAvKiBUaGUgbnRoIHBhcnRpYWwgc3VtICovCi0gICAgICAgIGZhY3RvciA9IChmYWN0b3IgKiB0MCkgPj4gMTU7ICAgICAgICAgICAvKiBDYWxjdWxhdGUgdDBebiAqLwotICAgIH0KLSAgICBDT1NfVDAgPSBDT1NfVDAgPDwgKExWUFNBX0Nvc0NvZWZbMF0rNik7ICAgICAgICAgIC8qIENvcnJlY3QgdGhlIHNjYWxpbmcgKi8KLQotCi0gICAgQjEgPSAoKDB4NDAwMDAwMDAgLSBCMikgPj4gMTYpICogKENPU19UMCA+PiAxNik7ICAgIC8qIEIxID0gKDAuNSAtIGIyKSAqIGNvcyh0MCkgKi8KLSAgICBBMCA9ICgweDQwMDAwMDAwICsgQjIpID4+IDE7ICAgICAgICAgICAgICAgICAgICAgICAgLyogQTAgPSAoMC41ICsgYjIpIC8gMiAqLwotCi0gICAgLyoKLSAgICAgKiBXcml0ZSBjb2VmZiBpbnRvIHRoZSBkYXRhIHN0cnVjdHVyZQotICAgICAqLwotICAgIHBDb2VmZmljaWVudHMtPkEwID0gKExWTV9JTlQxNikoQTA+PjE2KTsKLSAgICBwQ29lZmZpY2llbnRzLT5CMSA9IChMVk1fSU5UMTYpKEIxPj4xNSk7Ci0gICAgcENvZWZmaWNpZW50cy0+QjIgPSAoTFZNX0lOVDE2KShCMj4+MTYpOwotCi0KLSAgICByZXR1cm4oTFZQU0FfT0spOwotfQotCi0vKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLS8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogRlVOQ1RJT046ICAgICAgICAgICAgICAgICBMVlBTQV9CUERvdWJsZVByZWNDb2VmcyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qIERFU0NSSVBUSU9OOiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogIENhbGN1bGF0ZSBkb3VibGUgcHJlY2lzaW9uIGNvZWZmaWNpZW50cyBmb3IgYSBiYW5kIHBhc3MgZmlsdGVyICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qIFBBUkFNRVRFUlM6ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogIEZzICAgICAgICAgICAgICAgICAgICAgICBTYW1wbGluZyBmcmVxdWVuY3kgaW5kZXggICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgcEZpbHRlclBhcmFtcyAgICAgICAgICAgIFBvaW50ZXIgdG8gdGhlIGZpbHRlciBkZWZpbml0aW9uICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICBwQ29lZmZpY2llbnRzICAgICAgICAgICAgUG9pbnRlciB0byB0aGUgY29lZmZpY2llbnRzICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiBSRVRVUk5TOiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICBMVlBTQV9PSyAgICAgICAgICAgICAgICAgQWx3YXlzIHN1Y2NlZWRzICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiBOT1RFUzogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICAxLiBUaGUgZXF1YXRpb25zIHVzZWQgYXJlIGFzIGZvbGxvd3M6ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgICAgIHQwID0gMiAqIFBpICogRmMgLyBGcyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogICAgICBiMiA9IC0wLjUgKiAoMlEgLSB0MCkgLyAoMlEgKyB0MCkgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgICAgIGIxID0gKDAuNSAtIGIyKSAqICgxIC0gY29zZXJyKHQwKSkgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICAgICAgYTAgPSAoMC41ICsgYjIpIC8gMiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgV2hlcmU6ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICAgICAgRmMgICAgICAgICAgaXMgdGhlIGNlbnRyZSBmcmVxdWVuY3ksIERDIHRvIEZzLzUwICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogICAgICBGcyAgICAgICAgICBpcyB0aGUgc2FtcGxlIGZyZXF1ZW5jeSwgODAwMCB0byA0ODAwMCBpbiBkZXNjcmV0ZSBzdGVwcyAgICAgICAgICAgICovCi0vKiAgICAgIFEgICAgICAgICAgIGlzIHRoZSBRIGZhY3RvciwgMC4yNSB0byAxMiAocmVwcmVzZW50ZWQgYnkgMjUgdG8gMTIwMCkgICAgICAgICAgICAgKi8KLS8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogIDIuIFRoZSBkb3VibGUgcHJlY2lzaW9uIGNvZWZmaWNpZW50cyBhcmUgb25seSB1c2VkIHdoZW4gZmMgaXMgbGVzcyB0aGFuIGZzLzg1LCBzbyAgICovCi0vKiAgICAgdGhlIGNvc2luZSBvZiB0MCBpcyBhbHdheXMgY2xvc2UgdG8gMS4wLiBJbnN0ZWFkIG9mIGNhbGN1bGF0aW5nIHRoZSBjb3NpbmUgICAgICAgKi8KLS8qICAgICBpdHNlbGYgdGhlIGRpZmZlcmVuY2UgZnJvbSB0aGUgdmFsdWUgMS4wIGlzIGNhbGN1bGF0ZWQsIHRoaXMgY2FuIGJlIGRvbmUgd2l0aCAgICAqLwotLyogICAgIGxvd2VyIHByZWNpc2lvbiBtYXRocy4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICAzLiBUaGUgdmFsdWUgb2YgdGhlIEIyIGNvZWZmaWNpZW50IGlzIG9ubHkgY2FsY3VsYXRlZCBhcyBhIHNpbmdsZSBwcmVjaXNpb24gdmFsdWUsICAqLwotLyogICAgIHNtYWxsIGVycm9ycyBpbiB0aGlzIHZhbHVlIGhhdmUgYSBjb21iaW5lZCBlZmZlY3Qgb24gdGhlIFEgYW5kIEdhaW4gYnV0IG5vdCB0aGUgICovCi0vKiAgICAgdGhlIGZyZXF1ZW5jeSBvZiB0aGUgZmlsdGVyLiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogIDQuIFRoaXMgZnVuY3Rpb24gaXMgZW50aXJlbHkgYmFzZWQgb24gdGhlIExWRVFOQl9Eb3VibGVQcmVjQ29lZnMgZnVuY3Rpb24gICAgICAgICAgICovCi0vKiAgICAgb2YgdGhlIG4gYmFuZHMgZXF1YWxpemVyIChMVkVRTkIgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi1MVlBTQV9SRVRVUk4gTFZQU0FfQlBEb3VibGVQcmVjQ29lZnMoICAgTFZNX1VJTlQxNiAgICAgICAgICAgIEZzLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIExWUFNBX0ZpbHRlclBhcmFtX3QgICpwRmlsdGVyUGFyYW1zLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEJQX0MzMl9Db2Vmc190ICAgICAgICpwQ29lZmZpY2llbnRzKQotewotCi0gICAgZXh0ZXJuIExWTV9JTlQxNiAgICBMVlBTQV9Ud29QaU9uRnNUYWJsZVtdOwotICAgIGV4dGVybiBMVk1fSU5UMTYgICAgTFZQU0FfRFBDb3NDb2VmW107Ci0KLSAgICAvKgotICAgICAqIEludGVybWVkaWF0ZSB2YXJpYWJsZXMgYW5kIHRlbXBvcmFyeSB2YWx1ZXMKLSAgICAgKi8KLSAgICBMVk1fSU5UMzIgICAgICAgICAgIFQwOwotICAgIExWTV9JTlQxNiAgICAgICAgICAgRDsKLSAgICBMVk1fSU5UMzIgICAgICAgICAgIEEwOwotICAgIExWTV9JTlQzMiAgICAgICAgICAgQjE7Ci0gICAgTFZNX0lOVDMyICAgICAgICAgICBCMjsKLSAgICBMVk1fSU5UMzIgICAgICAgICAgIER0MDsKLSAgICBMVk1fSU5UMzIgICAgICAgICAgIEIyX0RlbjsKLSAgICBMVk1fSU5UMzIgICAgICAgICAgIEIyX051bTsKLSAgICBMVk1fSU5UMzIgICAgICAgICAgIENvc0VycjsKLSAgICBMVk1fSU5UMTYgICAgICAgICAgIGNvZWY7Ci0gICAgTFZNX0lOVDMyICAgICAgICAgICBmYWN0b3I7Ci0gICAgTFZNX0lOVDE2ICAgICAgICAgICB0MDsKLSAgICBMVk1fSU5UMTYgICAgICAgICAgIGk7Ci0KLSAgICAvKgotICAgICAqIEdldCB0aGUgZmlsdGVyIGRlZmluaXRpb24KLSAgICAgKi8KLSAgICBMVk1fVUlOVDE2ICAgICAgICAgIEZyZXF1ZW5jeSAgID0gcEZpbHRlclBhcmFtcy0+Q2VudGVyRnJlcXVlbmN5OwotICAgIExWTV9VSU5UMTYgICAgICAgICAgUUZhY3RvciAgICAgPSBwRmlsdGVyUGFyYW1zLT5RRmFjdG9yOwotCi0KLSAgICAvKgotICAgICAqIENhbGN1bGF0aW5nIHRoZSBpbnRlcm1lZGlhdGUgdmFsdWVzCi0gICAgICovCi0gICAgVDAgPSAoTFZNX0lOVDMyKUZyZXF1ZW5jeSAqIExWUFNBX1R3b1BpT25Gc1RhYmxlW0ZzXTsgICAvKiBUMCA9IDIgKiBQaSAqIEZjIC8gRnMgKi8KLSAgICBEID0gMzIwMDsgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8qIEZsb2F0aW5nIHBvaW50IHZhbHVlIDEuMDAwMDAwICgxKjEwMCoyXjUpICovCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvKiBGb3JjZSBEID0gMSA6IHRoZSBmdW5jdGlvbiB3YXMgb3JpZ2luYWxseSB1c2VkIGZvciBhIHBlYWtpbmcgZmlsdGVyLgotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgVGhlIEQgcGFyYW1ldGVyIGRvIG5vdCBleGlzdCBmb3IgYSBCYW5kUGFzcyBmaWx0ZXIgY29lZmZpY2llbnRzICovCi0KLSAgICAvKgotICAgICAqIENhbGN1bGF0ZSB0aGUgQjIgY29lZmZpY2llbnQKLSAgICAgKi8KLSAgICBEdDAgPSBEICogKFQwID4+IDEwKTsKLSAgICBCMl9EZW4gPSAoTFZNX0lOVDMyKSgoKExWTV9VSU5UMzIpUUZhY3RvciA8PCAxOSkgKyAoTFZNX1VJTlQzMikoRHQwID4+IDIpKTsKLSAgICBCMl9OdW0gPSAoTFZNX0lOVDMyKSgoTFZNX1VJTlQzMikoRHQwID4+IDMpIC0gKChMVk1fVUlOVDMyKVFGYWN0b3IgPDwgMTgpKTsKLSAgICBCMiA9IChCMl9OdW0gLyAoQjJfRGVuID4+IDE2KSkgPDwgMTU7Ci0KLSAgICAvKgotICAgICAqIENhbGN1bGF0ZSB0aGUgY29zaW5lIGVycm9yIGJ5IGEgcG9seW5vbWlhbCBleHBhbnNpb24gdXNpbmcgdGhlIGVxdWF0aW9uOgotICAgICAqCi0gICAgICogIENvc0VyciArPSBjb2VmKG4pICogdDBebiAgICAgICAgICAgICAgICBGb3IgbiA9IDAgdG8gNAotICAgICAqLwotICAgIFQwID0gKFQwID4+IDYpICogMHg3ZjUzOyAgICAgICAgICAgICAgICAgICAgLyogU2NhbGUgdG8gMS4wIGluIDE2LWJpdCBmb3IgcmFuZ2UgMCB0byBmcy81MCAqLwotICAgIHQwID0gKExWTV9JTlQxNikoVDAgPj4gMTYpOwotICAgIGZhY3RvciA9IDB4N2ZmZjsgICAgICAgICAgICAgICAgICAgICAgICAgICAgLyogSW5pdGlhbGlzZSB0byAxLjAgZm9yIHRoZSBhMCBjb2VmZmljaWVudCAqLwotICAgIENvc0VyciA9IDA7ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLyogSW5pdGlhbGlzZSB0aGUgZXJyb3IgdG8gemVybyAqLwotICAgIGZvciAoaT0xOyBpPDU7IGkrKykKLSAgICB7Ci0gICAgICAgIGNvZWYgPSBMVlBTQV9EUENvc0NvZWZbaV07ICAgICAgICAgICAgICAvKiBHZXQgdGhlIG50aCBjb2VmZmljaWVudCAqLwotICAgICAgICBDb3NFcnIgKz0gKGZhY3RvciAqIGNvZWYpID4+IDU7ICAgICAgICAgLyogVGhlIG50aCBwYXJ0aWFsIHN1bSAqLwotICAgICAgICBmYWN0b3IgPSAoZmFjdG9yICogdDApID4+IDE1OyAgICAgICAgICAgLyogQ2FsY3VsYXRlIHQwXm4gKi8KLSAgICB9Ci0gICAgQ29zRXJyID0gQ29zRXJyIDw8IChMVlBTQV9EUENvc0NvZWZbMF0pOyAgICAgICAgICAvKiBDb3JyZWN0IHRoZSBzY2FsaW5nICovCi0KLSAgICAvKgotICAgICAqIENhbGN1bGF0ZSB0aGUgQjEgYW5kIEEwIGNvZWZmaWNpZW50cwotICAgICAqLwotICAgIEIxID0gKDB4NDAwMDAwMDAgLSBCMik7ICAgICAgICAgICAgICAgICAgICAgLyogQjEgPSAoMC41IC0gYjIpICovCi0gICAgQTAgPSAoKEIxID4+IDE2KSAqIChDb3NFcnIgPj4gMTApKSA+PiA2OyAgICAvKiBUZW1wb3Jhcnkgc3RvcmFnZSBmb3IgKDAuNSAtIGIyKSAqIGNvc2Vycih0MCkgKi8KLSAgICBCMSAtPSBBMDsgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8qIEIxID0gKDAuNSAtIGIyKSAqICgxIC0gY29zZXJyKHQwKSkgICovCi0gICAgQTAgPSAoMHg0MDAwMDAwMCArIEIyKSA+PiAxOyAgICAgICAgICAgICAgICAvKiBBMCA9ICgwLjUgKyBiMikgLyAyICovCi0KLSAgICAvKgotICAgICAqIFdyaXRlIGNvZWZmIGludG8gdGhlIGRhdGEgc3RydWN0dXJlCi0gICAgICovCi0gICAgcENvZWZmaWNpZW50cy0+QTAgPSBBMDsKLSAgICBwQ29lZmZpY2llbnRzLT5CMSA9IEIxOwotICAgIHBDb2VmZmljaWVudHMtPkIyID0gQjI7Ci0KLSAgICByZXR1cm4oTFZQU0FfT0spOwotfQotCi0vKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotLyogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qIEZVTkNUSU9OOiAgICAgICAgICAgIExWUFNBX0NsZWFyRmlsdGVySGlzdG9yeSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogREVTQ1JJUFRJT046ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICBDbGVhcnMgdGhlIGZpbHRlcnMnIGRhdGEgaGlzdG9yeSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogUEFSQU1FVEVSUzogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICBwSW5zdCAgICAgICAgICAgUG9pbnRlciB0byB0aGUgaW5zdGFuY2UgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogUkVUVVJOUzogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICBMVlBTQV9PSyAgICAgICAgIEFsd2F5cyBzdWNjZWVkcyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogTk9URVM6ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotTFZQU0FfUkVUVVJOIExWUFNBX0NsZWFyRmlsdGVySGlzdG9yeShMVlBTQV9JbnN0YW5jZVByX3QgICAgICAgICpwSW5zdCkKLXsKLSAgICBMVk1fSU5UOCAgICAgICAqcFRhcEFkZHJlc3M7Ci0gICAgTFZNX1VJTlQzMiAgICAgICBpOwotCi0gICAgLyogQmFuZCBQYXNzIGZpbHRlcnMgdGFwcyAqLwotICAgIHBUYXBBZGRyZXNzID0gKExWTV9JTlQ4ICopcEluc3QtPnBCUF9UYXBzOwotICAgIGZvcihpID0gMDsgaSA8IHBJbnN0LT5uQmFuZHMgKiBzaXplb2YoQmlxdWFkXzFJX09yZGVyMl9UYXBzX3QpOyBpKyspCi0gICAgewotICAgICAgICBwVGFwQWRkcmVzc1tpXSA9IDA7Ci0gICAgfQotCi0gICAgLyogUXVhc2ktcGVhayBmaWx0ZXJzIHRhcHMgKi8KLSAgICBwVGFwQWRkcmVzcyA9IChMVk1fSU5UOCAqKXBJbnN0LT5wUVBEX1RhcHM7Ci0gICAgZm9yKGkgPSAwOyBpIDwgcEluc3QtPm5CYW5kcyAqIHNpemVvZihRUERfVGFwc190KTsgaSsrKQotICAgIHsKLSAgICAgICAgcFRhcEFkZHJlc3NbaV0gPSAwOwotICAgIH0KLQotICAgIHJldHVybihMVlBTQV9PSyk7Ci19Ci0KZGlmZiAtLWdpd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ELCBlaXRoZXIgZXhwcmVzcyBvciBpbXBsaWVkLgotICogU2VlIHRoZSBMaWNlbnNlIGZvciB0aGUgc3BlY2lmaWMgbGFuZ3VhZ2UgZ292ZXJuaW5nIHBlcm1pc3Npb25zIGFuZAotICogbGltaXRhdGlvbnMgdW5kZXIgdGhlIExpY2Vuc2UuCi0gKi8KLQotI2luY2x1ZGUgICAgIkxWUFNBLmgiCi0jaW5jbHVkZSAgICAiTFZQU0FfUHJpdmF0ZS5oIgotI2luY2x1ZGUgICAgIkluc3RBbGxvYy5oIgotCi0vKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotLyogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qIEZVTkNUSU9OOiAgICAgICAgICAgIExWUFNBX0luaXQgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogREVTQ1JJUFRJT046ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICBJbml0aWFsaXplIHRoZSBMVlBTQSBtb2R1bGUgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qIFBBUkFNRVRFUlM6ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgcGhJbnN0YW5jZSAgICAgICAgICBQb2ludGVyIHRvIHBvaW50ZXIgdG8gdGhlIGluc3RhbmNlICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogIEluaXRQYXJhbXMgICAgICAgICAgSW5pdCBwYXJhbWV0ZXJzIHN0cnVjdHVyZSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICBDb250cm9sUGFyYW1zICAgICAgIENvbnRyb2wgcGFyYW1ldGVycyBzdHJ1Y3R1cmUgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgcE1lbW9yeVRhYmxlICAgICAgICBNZW1vcnkgdGFibGUgdGhhdCBjb250YWlucyBtZW1vcnkgYXJlYXMgZGVmaW5pdGlvbiAgICAgICAgICAqLwotLyogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiBSRVRVUk5TOiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogIExWUFNBX09LICAgICAgICAgICAgU3VjY2VlZHMgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICBvdGhlcndpc2UgICAgICAgICAgIEVycm9yIGR1ZSB0byBiYWQgcGFyYW1ldGVycyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLUxWUFNBX1JFVFVSTiBMVlBTQV9Jbml0ICAgICAgICAgICAgICAoIHBMVlBTQV9IYW5kbGVfdCAgICAgICAgICAgICAqcGhJbnN0YW5jZSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIExWUFNBX0luaXRQYXJhbXNfdCAgICAgICAgICAqcEluaXRQYXJhbXMsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBMVlBTQV9Db250cm9sUGFyYW1zX3QgICAgICAgKnBDb250cm9sUGFyYW1zLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTFZQU0FfTWVtVGFiX3QgICAgICAgICAgICAgICpwTWVtb3J5VGFibGUgKQotewotICAgIExWUFNBX0luc3RhbmNlUHJfdCAgICAgICAgICAqcExWUFNBX0luc3Q7Ci0gICAgTFZQU0FfUkVUVVJOICAgICAgICAgICAgICAgIGVycm9yQ29kZSAgICAgICA9IExWUFNBX09LOwotICAgIExWTV9VSU5UMzIgICAgICAgICAgICAgICAgICBpaTsKLSAgICBleHRlcm4gTFZNX0lOVDE2ICAgICAgICAgICAgTFZQU0FfR2FpblRhYmxlW107Ci0gICAgTFZNX1VJTlQzMiAgICAgICAgICAgICAgICAgIEJ1ZmZlckxlbmd0aCA9IDA7Ci0KLSAgICAvKiBJbnRzX0FsbG9jIGluc3RhbmNlcywgbmVlZGVkIGZvciBtZW1vcnkgYWxpZ25tZW50IG1hbmFnZW1lbnQgKi8KLSAgICBJTlNUX0FMTE9DICAgICAgICAgIEluc3RhbmNlOwotICAgIElOU1RfQUxMT0MgICAgICAgICAgU2NyYXRjaDsKLSAgICBJTlNUX0FMTE9DICAgICAgICAgIERhdGE7Ci0gICAgSU5TVF9BTExPQyAgICAgICAgICBDb2VmOwotCi0gICAgLyogQ2hlY2sgcGFyYW1ldGVycyAqLwotICAgIGlmKChwaEluc3RhbmNlID09IExWTV9OVUxMKSB8fCAocEluaXRQYXJhbXMgPT0gTFZNX05VTEwpIHx8IChwQ29udHJvbFBhcmFtcyA9PSBMVk1fTlVMTCkgfHwgKHBNZW1vcnlUYWJsZSA9PSBMVk1fTlVMTCkpCi0gICAgewotICAgICAgICByZXR1cm4oTFZQU0FfRVJST1JfTlVMTEFERFJFU1MpOwotICAgIH0KLSAgICBpZiggKHBJbml0UGFyYW1zLT5TcGVjdHJhbERhdGFCdWZmZXJEdXJhdGlvbiA+IExWUFNBX01BWEJVRkZFUkRVUkFUSU9OKSAgIHx8Ci0gICAgICAgIChwSW5pdFBhcmFtcy0+U3BlY3RyYWxEYXRhQnVmZmVyRHVyYXRpb24gPT0gMCkgICAgICAgICAgICAgICAgICAgICAgICB8fAotICAgICAgICAocEluaXRQYXJhbXMtPk1heElucHV0QmxvY2tTaXplID4gTFZQU0FfTUFYSU5QVVRCTE9DS1NJWkUpICAgICAgfHwKLSAgICAgICAgKHBJbml0UGFyYW1zLT5NYXhJbnB1dEJsb2NrU2l6ZSA9PSAwKSAgICAgICAgICAgICAgICAgICAgICAgICAgIHx8Ci0gICAgICAgIChwSW5pdFBhcmFtcy0+bkJhbmRzIDwgTFZQU0FfTkJBTkRTTUlOKSAgICAgICAgICAgICAgICAgICAgICAgICB8fAotICAgICAgICAocEluaXRQYXJhbXMtPm5CYW5kcyA+IExWUFNBX05CQU5EU01BWCkgICAgICAgICAgICAgICAgICAgICAgICAgfHwKLSAgICAgICAgKHBJbml0UGFyYW1zLT5wRmlsdGVyc1BhcmFtcyA9PSAwKSkKLSAgICB7Ci0gICAgICAgIHJldHVybihMVlBTQV9FUlJPUl9JTlZBTElEUEFSQU0pOwotICAgIH0KLSAgICBmb3IoaWkgPSAwOyBpaSA8IHBJbml0UGFyYW1zLT5uQmFuZHM7IGlpKyspCi0gICAgewotICAgICAgIC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GxvYy5oIgotCi0vKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLS8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogRlVOQ1RJT046ICAgICAgICAgICAgICAgIExWRVFOQl9NZW1vcnkgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qIERFU0NSSVBUSU9OOiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogIFRoaXMgZnVuY3Rpb24gaXMgdXNlZCBmb3IgbWVtb3J5IGFsbG9jYXRpb24gYW5kIGZyZWUuIEl0IGNhbiBiZSBjYWxsZWQgaW4gICAgICAgICAgICovCi0vKiAgdHdvIHdheXM6ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogICAgICBoSW5zdGFuY2UgPSBOVUxMICAgICAgICAgUmV0dXJucyB0aGUgbWVtb3J5IHJlcXVpcmVtZW50cyAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgICAgIGhJbnN0YW5jZSA9IEluc3RhbmNlIGhhbmRsZSAgICAgUmV0dXJucyB0aGUgbWVtb3J5IHJlcXVpcmVtZW50cyBhbmQgICAgICAgICAgICAgKi8KLS8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBhbGxvY2F0ZWQgYmFzZSBhZGRyZXNzZXMgZm9yIHRoZSBpbnN0YW5jZSAgICAgICAqLwotLyogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgV2hlbiB0aGlzIGZ1bmN0aW9uIGlzIGNhbGxlZCBmb3IgbWVtb3J5IGFsbG9jYXRpb24gKGhJbnN0YW5jZT1OVUxMKSB0aGUgbWVtb3J5ICAgICAgKi8KLS8qICBiYXNlIGFkZHJlc3MgcG9pbnRlcnMgYXJlIE5VTEwgb24gcmV0dXJuLiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgV2hlbiB0aGUgZnVuY3Rpb24gaXMgY2FsbGVkIGZvciBmcmVlIChoSW5zdGFuY2UgPSBJbnN0YW5jZSBIYW5kbGUpIHRoZSBtZW1vcnkgICAgICAgKi8KLS8qICB0YWJsZSByZXR1cm5zIHRoZSBhbGxvY2F0ZWQgbWVtb3J5IGFuZCBiYXNlIGFkZHJlc3NlcyB1c2VkIGR1cmluZyBpbml0aWFsaXNhdGlvbi4gICAqLwotLyogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiBQQVJBTUVURVJTOiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICBoSW5zdGFuY2UgICAgICAgICAgICAgICBJbnN0YW5jZSBIYW5kbGUgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogIHBNZW1vcnlUYWJsZSAgICAgICAgICAgIFBvaW50ZXIgdG8gYW4gZW1wdHkgbWVtb3J5IGRlZmluaXRpb24gdGFibGUgICAgICAgICAgICAgICAgICovCi0vKiAgSW5pdFBhcmFtcyAgICAgICAgICAgICAgUG9pbnRlciB0byB0aGUgaW5zdGFuY2UgaW5pdCBwYXJhbWV0ZXJzICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogUkVUVVJOUzogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgTFZQU0FfT0sgICAgICAgICAgICBTdWNjZWVkcyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICBvdGhlcndpc2UgICAgICAgICAgIEVycm9yIGR1ZSB0byBiYWQgcGFyYW1ldGVycyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLUxWUFNBX1JFVFVSTiBMVlBTQV9NZW1vcnkgICAgICAgICAgICAoIHBMVlBTQV9IYW5kbGVfdCAgICAgICAgICAgICBoSW5zdGFuY2UsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBMVlBTQV9NZW1UYWJfdCAgICAgICAgICAgICAqcE1lbW9yeVRhYmxlLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg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VJEVVJBVElPTikgICB8fAotICAgICAgICAgICAgKHBJbml0UGFyYW1zLT5TcGVjdHJhbERhdGFCdWZmZXJEdXJhdGlvbiA9PSAwKSAgICAgICAgICAgICAgICAgICAgICAgIHx8Ci0gICAgICAgICAgICAocEluaXRQYXJhbXMtPk1heElucHV0QmxvY2tTaXplID4gTFZQU0FfTUFYSU5QVVRCTE9DS1NJWkUpICAgICAgfHwKLSAgICAgICAgICAgIChwSW5pdFBhcmFtcy0+TWF4SW5wdXRCbG9ja1NpemUgPT0gMCkgICAgICAgICAgICAgICAgICAgICAgICAgICB8fAotICAgICAgICAgICAgKHBJbml0UGFyYW1zLT5uQmFuZHMgPCBMVlBTQV9OQkFORFNNSU4pICAgICAgICAgICAgICAgICAgICAgICAgIHx8Ci0gICAgICAgICAgICAocEluaXRQYXJhbXMtPm5CYW5kcyA+IExWUFNBX05CQU5EU01BWCkgICAgICAgICAgICAgICAgICAgICAgICAgfHwKLSAgICAgICAgICAgIChwSW5pdFBhcmFtcy0+cEZpbHRlcnNQYXJhbXMgPT0gMCkpCi0gICAgICAgIHsKLSAgICAgICAgICAgIHJldHVybihMVlBTQV9FUlJPUl9JTlZBTElEUEFSQU0pOwotICAgICAgICB9Ci0gICAgICAgIGZvcihpaSA9IDA7IGlpIDwgcEluaXRQYXJhbXMtPm5CYW5kczsgaWkrKykKLSAgICAgICAgewotICAgICAgICAgICAgaWYoKHBJbml0UGFyYW1zLT5wRmlsdGVyc1BhcmFtc1tpaV0uQ2VudGVyRnJlcXVlbmN5ID4gTFZQU0FfTUFYQ0VOVEVSRlJFUSkgfHwKLSAgICAgICAgICAgICAgIChwSW5pdFBhcmFtcy0+cEZpbHRlcnNQYXJhbXNbaWldLlBvc3RHYWluICAgICAgICA+IExWUFNBX01BWFBPU1RHQUlOKSAgIHx8Ci0gICAgICAgICAgICAgICAocEluaXRQYXJhbXMtPnBGaWx0ZXJzUGFyYW1zW2lpXS5Qb3N0R2FpbiAgICAgICAgPCBMVlBTQV9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U0lTLAotICogV0lUSE9VVCBXQVJSQU5USUVTIE9SIENPTkRJVElPTlMgT0YgQU5ZIEtJTkQsIGVpdGhlciBleHByZXNzIG9yIGltcGxpZWQuCi0gKiBTZWUgdGhlIExpY2Vuc2UgZm9yIHRoZSBzcGVjaWZpYyBsYW5ndWFnZSBnb3Zlcm5pbmcgcGVybWlzc2lvbnMgYW5kCi0gKiBsaW1pdGF0aW9ucyB1bmRlciB0aGUgTGljZW5zZS4KLSAqLwotCi0jaWZuZGVmIF9MVlBTQV9QUklWQVRFX0hfCi0jZGVmaW5lIF9MVlBTQV9QUklWQVRFX0hfCi0KLSNpbmNsdWRlICJMVlBTQS5oIgotI2luY2x1ZGUgIkJJUVVBRC5oIgotI2luY2x1ZGUgIkxWUFNBX1FQRC5oIgotI2luY2x1ZGUgIkxWTV9NYWNyb3MuaCIKLQotCi0KLSNpZmRlZiBfX2NwbHVzcGx1cwotZXh0ZXJuICJDIiB7Ci0jZW5kaWYgLyogX19jcGx1c3BsdXMgKi8KLQotLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKLSAgIENPTlNUQU5UIERFRklOSVRJT05TCi0qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLQotLyogTWVtb3J5ICovCi0jZGVmaW5lIExWUFNBX0lOU1RBTkNFX0FMSUdOICAgICAgICAgICAgIDQgICAgICAvKiAzMi1iaXQgYWxpZ25tZW50IGZvciBzdHJ1Y3R1cmVzICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0jZGVmaW5lIExWUFNBX1NDUkFUQ0hfQUxJR04gICAgICAgICAgICAgIDQgICAgICAvKiAzMi1iaXQgYWxpZ25tZW50IGZvciBsb25nIGRhdGEgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0jZGVmaW5lIExWUFNBX0NPRUZfQUxJR04gICAgICAgICAgICAgICAgIDQgICAgICAvKiAzMi1iaXQgYWxpZ25tZW50IGZvciBsb25nIHdvcmRzICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0jZGVmaW5lIExWUFNBX0RBVEFfQUxJR04gICAgICAgICAgICAgICAgIDQgICAgICAvKiAzMi1iaXQgYWxpZ25tZW50IGZvciBsb25nIGRhdGEgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0KLSNkZWZpbmUgTFZQU0FfTUVNUkVHSU9OX0lOU1RBTkNFICAgICAgICAgMCAgICAgIC8qIE9mZnNldCB0byBpbnN0YW5jZSBtZW1vcnkgcmVnaW9uIGluIG1lbW9yeSB0YWJsZSAgICAgICAgICAgICAgICAgKi8KLSNkZWZpbmUgTFZQU0FfTUVNUkVHSU9OX1BFUlNJU1RFTlRfQ09FRiAgMSAgICAgIC8qIE9mZnNldCB0byBwZXJzaXN0ZW50IGNvZWZmaWNpZW50cyAgbWVtb3J5IHJlZ2lvbiBpbiBtZW1vcnkgdGFibGUgKi8KLSNkZWZpbmUgTFZQU0FfTUVNUkVHSU9OX1BFUlNJU1RFTlRfREFUQSAgMiAgICAgIC8qIE9mZnNldCB0byBwZXJzaXN0ZW50IHRhcHMgIG1lbW9yeSByZWdpb24gaW4gbWVtb3J5IHRhYmxlICAgICAgICAgKi8KLSNkZWZpbmUgTFZQU0FfTUVNUkVHSU9OX1NDUkFUQ0ggICAgICAgICAgMyAgICAgIC8qIE9mZnNldCB0byBzY3JhdGNoICBtZW1vcnkgcmVnaW9uIGluIG1lbW9yeSB0YWJsZSAgICAgICAgICAgICAgICAgKi8KLQotI2RlZmluZSBMVlBTQV9OUl9TVVBQT1JURURfUkFURSAgICAgICAgICA5ICAgICAgLyogRnJvbSA4MDAwSHogdG8gNDgwMDBIeiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotI2RlZmluZSBMVlBTQV9OUl9TVVBQT1JURURfU1BFRUQgICAgICAgICAzICAgICAgLyogTE9XLCBNRURJVU0sIEhJR0ggICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotCi0jZGVmaW5lIExWUFNBX01BWEJVRkZFUkRVUkFUSU9OICAgICAgICAgIDQwMDAgICAvKiBNYXhpbXVtIGxlbmd0aCBpbiBtcyBvZiB0aGUgbGV2ZWxzIGJ1ZmZlciAgICAgICAgICAgICAgICAgICAgICAgICovCi0jZGVmaW5lIExWUFNBX01BWElOUFVUQkxPQ0tTSVpFICAgICAgICAgIDUwMDAgICAvKiBNYXhpbXVtIGxlbmd0aCBpbiBtb25vIHNhbXBsZXMgb2YgdGhlIGJsb2NrIHRvIHByb2Nlc3MgICAgICAgICAgICovCi0jZGVmaW5lIExWUFNBX05CQU5EU01JTiAgICAgICAgICAgICAgICAgIDEgICAgICAvKiBNaW5pbXVtIG51bWJlciBvZiBmcmVxdWVuY3kgYmFuZCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0jZGVmaW5lIExWUFNBX05CQU5EU01BWCAgICAgICAgICAgICAgICAgIDMwICAgICAvKiBNYXhpbXVtIG51bWJlciBvZiBmcmVxdWVuY3kgYmFuZCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0jZGVmaW5lIExWUFNBX01BWENFTlRFUkZSRVEgICAgICAgICAgICAgIDIwMDAwICAvKiBNYXhpbXVtIHBvc3NpYmxlIGNlbnRlciBmcmVxdWVuY3kgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0jZGVmaW5lIExWUFNBX01JTlBPU1RHQUlOICAgICAgICAgICAgICAgIC0xNSAgICAvKiBNaW5pbXVtIHBvc3NpYmxlIHBvc3QgZ2FpbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0jZGVmaW5lIExWUFNBX01BWFBPU1RHQUlOICAgICAgICAgICAgICAgIDE1ICAgICAvKiBNYXhpbXVtIHBvc3NpYmxlIHBvc3QgZ2FpbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0jZGVmaW5lIExWUFNBX01JTlFGQUNUT1IgICAgICAgICAgICAgICAgIDI1ICAgICAvKiBNaW5pbXVtIHBvc3NpYmxlIFEgZmFjdG9yICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0jZGVmaW5lIExWUFNBX01BWFFGQUNUT1IgICAgICAgICAgICAgICAgIDEyMDAgICAvKiBNYXhpbXVtIHBvc3NpYmxlIFEgZmFjdG9yICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0KLSNkZWZpbmUgTFZQU0FfTUFYTEVWRUxERUNBWUZBQ1RPUiAgICAgICAgMHg0MTExIC8qIERlY2F5IGZhY3RvciBmb3IgdGhlIG1heGltdW0gdmFsdWVzIGNhbGN1bGF0aW9uICAgICAgICAgICAgICAgICAgKi8KLSNkZWZpbmUgTFZQU0FfTUFYTEVWRUxERUNBWVNISUZUICAgICAgICAgMTQgICAgIC8qIERlY2F5IHNoaWZ0IGZvciB0aGUgbWF4aW11bSB2YWx1ZXMgY2FsY3VsYXRpb24gICAgICAgICAgICAgICAgICAgKi8KLQotI2RlZmluZSBMVlBTQV9NQVhVTlNJR05FRENIQVIgICAgICAgICAgICAweEZGCi0KLSNkZWZpbmUgTFZQU0FfRnNJbnZlcnRTaGlmdCAgICAgICAgICAgICAgMzEKLSNkZWZpbmUgTFZQU0FfR0FJTlNISUZUICAgICAgICAgICAgICAgICAgMTEKLSNkZWZpbmUgTFZQU0FfRlJFUVNISUZUICAgICAgICAgICAgICAgICAgMjUKLQotLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKLSAgIFRZUEVTIERFRklOSVRJT05TCi0qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLQotI2RlZmluZSBMVlBTQV9JbnRlcm5hbFJlZnJlc2hUaW1lICAgICAgIDB4MDAxNCAgICAvKiAyMCBtcyAoNTBIeikgaW4gUTE2LjAgICAgICAqLwotI2RlZmluZSBMVlBTQV9JbnRlcm5hbFJlZnJlc2hUaW1lSW52ICAgIDB4MDY2NiAgICAvKiAxLzIwbXMgbGVmdCBzaGlmdGVkIGJ5IDE1ICAqLwotI2RlZmluZSBMVlBTQV9JbnRlcm5hbFJlZnJlc2hUaW1lU2hpZnQgIDE1Ci0KLQotLyogUHJlY2lzaW9uIG9mIHRoZSBmaWx0ZXIgKi8KLXR5cGVkZWYgZW51bQotewotICAgIExWUFNBX1NpbXBsZVByZWNpc2lvbkZpbHRlciwgICAgLyogU2ltcGxlIHByZWNpc2lvbiAqLwotICAgIExWUFNBX0RvdWJsZVByZWNpc2lvbkZpbHRlciAgICAgLyogRG91YmxlIHByZWNpc2lvbiAqLwotfSBMVlBTQV9CUEZpbHRlclByZWNpc2lvbl9lbjsKLQotdHlwZWRlZiBzdHJ1Y3QKLXsKLSAgICBMVk1fQ0hBUiAgICAgICAgICAgICAgICAgICAgYkNvbnRyb2xQZW5kaW5nOyAgICAgICAgICAgICAgICAgICAgLyogRmxhZyBpbmNhdGluZyBhIGNoYW5nZSBvZiB0aGUgY29udHJvbCBwYXJhbWV0ZXJzICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLSAgICBMVk1fVUlOVDE2ICAgICAgICAgICAgICAgICAgbkJhbmRzOyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLyogTnVtYmVyIG9mIGJhbmRzIG9mIHRoZSBzcGVjdHJ1bSBhbmFseXplciAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLSAgICBMVk1fVUlOVDE2ICAgICAgICAgICAgICAgICAgTWF4SW5wdXRCbG9ja1NpemU7ICAgICAgICAgICAgICAgICAgLyogTWF4aW11bSBpbnB1dCBkYXRhIGJ1ZmZlciBzaXplICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLQotICAgIExWUFNBX0NvbnRyb2xQYXJhbXNfdCAgICAgICBDdXJyZW50UGFyYW1zOyAgICAgICAgICAgICAgICAgICAgICAvKiBDdXJyZW50IGNvbnRyb2wgcGFyYW1ldGVycyBvZiB0aGUgbW9kdWxlICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotICAgIExWUFNBX0NvbnRyb2xQYXJhbXNfdCAgICAgICBOZXdQYXJhbXM7ICAgICAgICAgICAgICAgICAgICAgICAgICAvKiBOZXcgY29udHJvbCBwYXJhbWV0ZXJzIGdpdmVuIGJ5IHRoZSB1c2VyICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotICAgIExWUFNBX01lbVRhYl90ICAgICAgICAgICAgICBNZW1vcnlUYWJsZTsKLQotICAgIExWUFNBX0JQRmlsdGVyUHJlY2lzaW9uX2VuICpwQlBGaWx0ZXJzUHJlY2lzaW9uOyAgICAgICAgICAgICAgICAvKiBQb2ludHMgYSBuQmFuZHMgZWxlbWVudHMgYXJyYXkgdGhhdCBjb250YWlucyB0aGUgZmlsdGVyIHByZWNpc2lvbiBmb3IgZWFjaCBiYW5kICAgICAgICAgICAgICAqLwotICAgIEJpcXVhZF9JbnN0YW5jZV90ICAgICAgICAgICpwQlBfSW5zdGFuY2VzOyAgICAgICAgICAgICAgICAgICAgICAvKiBQb2ludHMgYSBuQmFuZHMgZWxlbWVudHMgYXJyYXkgdGhhdCBjb250YWlucyB0aGUgYmFuZCBwYXNzIGZpbHRlciBpbnN0YW5jZSBmb3IgZWFjaCBiYW5kICAgICAqLwotICAgIEJpcXVhZF8xSV9PcmRlcjJfVGFwc190ICAgICpwQlBfVGFwczsgICAgICAgICAgICAgICAgICAgICAgICAgICAvKiBQb2ludHMgYSBuQmFuZHMgZWxlbWVudHMgYXJyYXkgdGhhdCBjb250YWlucyB0aGUgYmFuZCBwYXNzIGZpbHRlciB0YXBzIGZvciBlYWNoIGJhbmQgICAgICAgICAqLwotICAgIFFQRF9TdGF0ZV90ICAgICAgICAgICAgICAgICpwUVBEX1N0YXRlczsgICAgICAgICAgICAgICAgICAgICAgICAvKiBQb2ludHMgYSBuQmFuZHMgZWxlbWVudHMgYXJyYXkgdGhhdCBjb250YWlucyB0aGUgUVBEIGZpbHRlciBpbnN0YW5jZSBmb3IgZWFjaCBiYW5kICAgICAgICAgICAqLwotICAgIFFQRF9UYXBzX3QgICAgICAgICAgICAgICAgICpwUVBEX1RhcHM7ICAgICAgICAgICAgICAgICAgICAgICAgICAvKiBQb2ludHMgYSBuQmFuZHMgZWxlbWVudHMgYXJyYXkgdGhhdCBjb250YWlucyB0aGUgUVBEIGZpbHRlciB0YXBzIGZvciBlYWNoIGJhbmQgICAgICAgICAgICAgICAqLwotICAgIExWTV9VSU5UMTYgICAgICAgICAgICAgICAgICpwUG9zdEdhaW5zOyAgICAgICAgICAgICAgICAgICAgICAgICAvKiBQb2ludHMgYSBuQmFuZHMgZWxlbWVudHMgYXJyYXkgdGhhdCBjb250YWlucyB0aGUgcG9zdC1maWx0ZXIgZ2FpbnMgZm9yIGVhY2ggYmFuZCAgICAgICAgICAgICAqLwotCi0gICAgTFZQU0FfRmlsdGVyUGFyYW1fdCAgICAgICAgKnBGaWx0ZXJzUGFyYW1zOyAgICAgICAgICAgICAgICAgICAgIC8qIENvcHkgb2YgdGhlIGZpbHRlcnMgcGFyYW1ldGVycyBmcm9tIHRoZSBpbnB1dCBwYXJhbWV0ZXJzICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0KLQotICAgIExWTV9VSU5UMTYgICAgICAgICAgICAgICAgICBuU2FtcGxlc0J1ZmZlclVwZGF0ZTsgICAgICAgICAgICAgICAvKiBOdW1iZXIgb2Ygc2FtcGxlcyB0byBtYWtlIDIwbXMgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotICAgIExWTV9JTlQzMiAgICAgICAgICAgICAgICAgICBCdWZmZXJVcGRhdGVTYW1wbGVzQ291bnQ7ICAgICAgICAgICAvKiBDb3VudGVyIHVzZWQgdG8ga25vdyB3aGVuIHRvIHB1dCBhIG5ldyB2YWx1ZSBpbiB0aGUgYnVmZmVyICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotICAgIExWTV9VSU5UMTYgICAgICAgICAgICAgICAgICBuUmVsZXZhbnRGaWx0ZXJzOyAgICAgICAgICAgICAgICAgICAvKiBOdW1iZXIgb2YgcmVsZXZlbnQgZmlsdGVycyBkZXBlbmRpbmcgb24gc2FtcGxpbmcgZnJlcXVlbmN5IGFuZCBiYW5kcyBjZW50ZXIgZnJlcXVlbmN5ICAgICAgICAqLwotICAgIExWTV9VSU5UMTYgICAgICAgICAgICAgICAgICBMb2NhbFNhbXBsZXNDb3VudDsgICAgICAgICAgICAgICAgICAvKiBDb3VudGVyIHVzZWQgdG8gdXBkYXRlIHRoZSBTcGVjdHJhbERhdGFCdWZmZXJBdWRpb1RpbWUgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotCi0gICAgTFZNX1VJTlQxNiAgICAgICAgICAgICAgICAgIERvd25TYW1wbGluZ0ZhY3RvcjsgICAgICAgICAgICAgICAgIC8qIERvd24gc2FtcGxpbmcgZmFjdG9yIGRlcGVuZGluZyBvbiB0aGUgc2FtcGxpbmcgZnJlcXVlbmN5ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0gICAgTFZNX1VJTlQxNiAgICAgICAgICAgICAgICAgIERvd25TYW1wbGluZ0NvdW50OyAgICAgICAgICAgICAgICAgIC8qIENvdW50ZXIgdXNlZCBmb3IgdGhlIGRvd25zYW1wbGluZyBoYW5kbGluZyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0KLSAgICBMVk1fVUlOVDE2ICAgICAgICAgICAgICAgICAgU3BlY3RyYWxEYXRhQnVmZmVyRHVyYXRpb247ICAgICAgICAgLyogTGVuZ3RoIG9mIHRoZSBidWZmZXIgaW4gdGltZSAobXMpIGRlZmluZWQgYnkgdGhlIGFwcGxpY2F0aW9uICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLSAgICBMVk1fVUlOVDggICAgICAgICAgICAgICAgICAqcFNwZWN0cmFsRGF0YUJ1ZmZlclN0YXJ0OyAgICAgICAgICAgLyogU3RhcnRpbmcgYWRkcmVzcyBvZiB0aGUgYnVmZmVyICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLSAgICBMVk1fVUlOVDggICAgICAgICAgICAgICAgICAqcFNwZWN0cmFsRGF0YUJ1ZmZlcldyaXRlUG9pbnRlcjsgICAgLyogQ3VycmVudCBwb3NpdGlvbiBvZiB0aGUgd3JpdHRpbmcgcG9pbnRlciBvZiB0aGUgYnVmZmVyICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLSAgICBMVlBTQV9UaW1lICAgICAgICAgICAgICAgICAgU3BlY3RyYWxEYXRhQnVmZmVyQXVkaW9UaW1lOyAgICAgICAgLyogQXVkaW9UaW1lIGF0IHdoaWNoIHRoZSBsYXN0IHZhbHVlIHNhdmUgb2NjdXJlZCBpbiB0aGUgYnVmZmVyICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLSAgICBMVk1fVUlOVDMyICAgICAgICAgICAgICAgICAgU3BlY3RyYWxEYXRhQnVmZmVyTGVuZ3RoOyAgICAgICAgICAgLyogTnVtYmVyIG9mIHNwZWN0cnVtIGRhdGEgdmFsdWUgdGhhdCB0aGUgYnVmZmVyIGNhbiBjb250YWluIChwZXIgYmFuZCkKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPSBTcGVjdHJhbERhdGFCdWZmZXJEdXJhdGlvbi8yMG1zICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLQotICAgIExWTV9VSU5UOCAgICAgICAgICAgICAgICAgICpwUHJldmlvdXNQZWFrczsgICAgICAgICAgICAgICAgICAgICAvKiBQb2ludHMgdG8gYSBuQmFuZHMgZWxlbWVudHMgYXJyYXkgdGhhdCBjb250YWlucyB0aGUgcHJldmlvdXMgcGVhayB2YWx1ZSBvZiB0aGUgbGV2ZWwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRldGVjdGlvbi4gVGhvc2UgdmFsdWVzIGFyZSBkZWNyZW1lbnRlZCBhZnRlciBlYWNoIGNhbGwgdG8gdGhlIEdldFNwZWN0cnVtIGZ1bmN0aW9uICAgICAgICAgICovCi0KLX1MVlBTQV9JbnN0YW5jZVByX3QsICpwTFZQU0FfSW5zdGFuY2VQcl90OwotCi0KLQotLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKLSAgIEZVTkNUSU9OUyBQUk9UT1RZUEUKLSoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLS8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiBGVU5DVElPTjogICAgICAgICAgICBMVlBTQV9BcHBseU5ld1NldHRpbmdzICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qIERFU0NSSVBUSU9OOiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgUmVpbml0aWFsaXplIHNvbWUgcGFyYW1ldGVycyBhbmQgY2hhbmdlcyBmaWx0ZXJzJyBjb2VmZmljaWVudHMgaWYgICAgICAgICAgICAgICAqLwotLyogIHNvbWUgY29udHJvbCBwYXJhbWV0ZXJzIGhhdmUgY2hhbmdlZC4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiBQQVJBTUVURVJTOiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogIHBJbnN0ICAgICAgICAgICAgICAgUG9pbnRlciB0byB0aGUgaW5zdGFuY2UgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiBSRVRVUk5TOiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogIExWUFNBX09LICAgICAgICAgICAgQWx3YXlzIHN1Y2NlZW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kNUSU9OOiAgICAgICAgICAgIExWUFNBX1Byb2Nlc3MgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogREVTQ1JJUFRJT046ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICBUaGUgcHJvY2VzcyBhcHBsaWVzIGJhbmQgcGFzcyBmaWx0ZXJzIHRvIHRoZSBzaWduYWwuIEVhY2ggb3V0cHV0ICAgICAgICAgICAgICAgICovCi0vKiAgZmVlZHMgYSBxdWFzaSBwZWFrIGZpbHRlciBmb3IgbGV2ZWwgZGV0ZWN0aW9uLiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qIFBBUkFNRVRFUlM6ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgaEluc3RhbmNlICAgICAgICAgICBQb2ludGVyIHRvIHRoZSBpbnN0YW5jZSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogIHBMVlBTQV9JbnB1dFNhbXBsZXMgUG9pbnRlciB0byB0aGUgaW5wdXQgc2FtcGxlcyBidWZmZXIgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICBJbnB1dEJsb2NrU2l6ZSAgICAgIE51bWJlciBvZiBtb25vIHNhbXBsZXMgdG8gcHJvY2VzcyAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgQXVkaW9UaW1lICAgICAgICAgICBQbGF5YmFjayB0aW1lIG9mIHRoZSBpbnB1dCBzYW1wbGVzICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiBSRVRVUk5TOiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogIExWUFNBX09LICAgICAgICAgICAgU3VjY2VlZHMgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICBvdGhlcndpc2UgICAgICAgICAgIEVycm9yIGR1ZSB0byBiYWQgcGFyYW1ldGVycyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLUxWUFNBX1JFVFVSTiBMVlBTQV9Qcm9jZXNzICAgICAgICAgICAoIHBMVlBTQV9IYW5kbGVfdCAgICAgIGhJbnN0YW5jZSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIExWTV9JTlQxNiAgICAgICAgICAgKnBMVlBTQV9JbnB1dFNhbXBsZXMsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBMVk1fVUlOVDE2ICAgICAgICAgICBJbnB1dEJsb2NrU2l6ZSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIExWUFNBX1RpbWUgICAgICAgICAgIEF1ZGlvVGltZSAgICAgICAgICAgICkKLQotewotICAgIExWUFNBX0luc3RhbmNlUHJfdCAgICAgKnBMVlBTQV9JbnN0ID0gKExWUFNBX0luc3RhbmNlUHJfdCopaEluc3RhbmNlOwotICAgIExWTV9JTlQxNiAgICAgICAgICAgICAgICpwU2NyYXRjaDsKLSAgICBMVk1fSU5UMTYgICAgICAgICAgICAgICBpaTsKLSAgICBMVk1fSU5UMzIgICAgICAgICAgICAgICBBdWRpb1RpbWVJbmM7Ci0gICAgZXh0ZXJuIExWTV9VSU5UMzIgICAgICAgTFZQU0FfU2FtcGxlUmF0ZUludlRhYltdOwotICAgIExWTV9VSU5UOCAgICAgICAgICAgICAgICpwV3JpdGVfU2F2ZTsgICAgICAgICAvKiBQb3NpdGlvbiBvZiB0aGUgd3JpdGUgcG9pbnRlciBhdCB0aGUgYmVnaW5uaW5nIG9mIHRoZSBwcm9jZXNzICAqLwotCi0gICAgLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgotICAgICAgIENIRUNLIFBBUkFNRVRFUlMKLSAgICAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotICAgIGlmKGhJbnN0YW5jZSA9PSBMVk1fTlVMTCB8fCBwTFZQU0FfSW5wdXRTYW1wbGVzID09IExWTV9OVUxMKQotICAgIHsKLSAgICAgICAgcmV0dXJuKExWUFNBX0VSUk9SX05VTExBRERSRVNTKTsKLSAgICB9Ci0gICAgaWYoSW5wdXRCbG9ja1NpemUgPT0gMCB8fCBJbnB1dEJsb2NrU2l6ZSA+IHBMVlBTQV9JbnN0LT5NYXhJbnB1dEJsb2NrU2l6ZSkKLSAgICB7Ci0gICAgICAgIHJldHVybihMVlBTQV9FUlJPUl9JTlZBTElEUEFSQU0pOwotICAgIH0KLQotICAgIHBTY3JhdGNoID0gKExWTV9JTlQxNiopcExWUFNBX0luc3QtPk1lbW9yeVRhYmxlLlJlZ2lvbltMVlBTQV9NRU1SRUdJT05fU0NSQVRDSF0ucEJhc2VBZGRyZXNzOwotICAgIHBXcml0ZV9TYXZlID0gcExWUFNBX0luc3QtPnBTcGVjdHJhbERhdGFCdWZmZXJXcml0ZVBvaW50ZXI7Ci0KLSAgICAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCi0gICAgICAgQVBQTFkgTkVXIFNFVFRJTkdTIElGIE5FRURFRAotICAgICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0gICAgaWYgKHBMVlBTQV9JbnN0LT5iQ29udHJvbFBlbmRpbmcgPT0gTFZNX1RSVUUpCi0gICAgewotICAgICAgICBwTFZQU0FfSW5zdC0+YkNvbnRyb2xQZW5kaW5nID0gMDsKLSAgICAgICAgTFZQU0FfQXBwbHlOZXdTZXR0aW5ncyggcExWUFNBX0luc3QpOwotICAgIH0KLQotICAgIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKLSAgICAgICBQUk9DRVNTIFNBTVBMRVMKLSAgICAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotICAgIC8qIFB1dCBzYW1wbGVzIGluIHJhbmdlIFstMC41OzAuNVsgZm9yIEJQIGZpbHRlcnMgKHNlZSBCaXF1YWRzIGRvY3VtZW50YXRpb24pICovCi0gICAgQ29weV8xNiggcExWUFNBX0lucHV0U2FtcGxlcyxwU2NyYXRjaCwoTFZNX0lOVDE2KUlucHV0QmxvY2tTaXplKTsKLSAgICBTaGlmdF9TYXRfdjE2eHYxNigtMSxwU2NyYXRjaCxwU2NyYXRjaCwoTFZNX0lOVDE2KUlucHV0QmxvY2tTaXplKTsKLQotICAgIGZvciAoaWkgPSAwOyBpaSA8IHBMVlBTQV9JbnN0LT5uUmVsZXZhbnRGaWx0ZXJzOyBpaSsrKQotICAgIHsKLSAgICAgICAgc3dpdGNoKHBMVlBTQV9JbnN0LT5wQlBGaWx0ZXJzUHJlY2lzaW9uW2lpXSkKLSAgICAgICAgewotICAgICAgICAgICAgY2FzZSBMVlBTQV9TaW1wbGVQcmVjaXNpb25GaWx0ZXI6Ci0gICAgICAgICAgICAgICAgQlBfMUlfRDE2RjE2QzE0X1RSQ19XUkFfMDEgICggJnBMVlBTQV9JbnN0LT5wQlBfSW5zdGFuY2VzW2lpXSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwU2NyYXRjaCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwU2NyYXRjaCArIElucHV0QmxvY2tTaXplLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChMVk1fSU5UMTYpSW5wdXRCbG9ja1NpemUpOwotICAgICAgICAgICAgICAgIGJyZWFrOwotCi0gICAgICAgICAgICBjYXNlIExWUFNBX0RvdWJsZVByZWNpc2lvbkZpbHRlcjoKLSAgICAgICAgICAgICAgICBCUF8xSV9EMTZGMzJDMzBfVFJDX1dSQV8wMSAgKCAmcExWUFNBX0luc3QtPnBCUF9JbnN0YW5jZXNbaWldLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBTY3JhdGNoLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBTY3JhdGNoICsgSW5wdXRCbG9ja1NpemUsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKExWTV9JTlQxNilJbnB1dEJsb2NrU2l6ZSk7Ci0gICAgICAgICAgICAgICAgYnJlYWs7Ci0gICAgICAgICAgICBkZWZhdWx0OgotICAgICAgICAgICAgICAgIGJyZWFrOwotICAgICAgICB9Ci0KLQotICAgICAgICBMVlBTQV9RUERfUHJvY2VzcyAgICggcExWUFNBX0luc3QsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwU2NyYXRjaCArIElucHV0QmxvY2tTaXplLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKExWTV9JTlQxNilJbnB1dEJsb2NrU2l6ZSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlpKTsKLSAgICB9Ci0KLSAgICAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCi0gICAgICAgVVBEQVRFIFNwZWN0cmFsRGF0YUJ1ZmZlckF1ZGlvVGltZQotICAgICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0KLSAgICBpZihwTFZQU0FfSW5zdC0+cFNwZWN0cmFsRGF0YUJ1ZmZlcldyaXRlUG9pbnRlciAhPSBwV3JpdGVfU2F2ZSkKLSAgICB7Ci0gICAgICAgIE1VTDMyeDMySU5UTzMyKChBdWRpb1RpbWUgKyAoTFZNX0lOVDMyKSgoTFZNX0lOVDMyKXBMVlBTQV9JbnN0LT5Mb2NhbFNhbXBsZXNDb3VudCoxMDAwKSksCi0gICAgICAgICAgICAgICAgICAgICAgICAoTFZNX0lOVDMyKUxWUFNBX1NhbXBsZVJhdGVJbnZUYWJbcExWUFNBX0luc3QtPkN1cnJlbnRQYXJhbXMuRnNdLAotICAgICAgICAgICAgICAgICAgICAgICAgQXVkaW9UaW1lSW5jLAotICAgICAgICAgICAgICAgICAgICAgICAgTFZQU0FfRnNJbnZlcnRTaGlmdCkKLSAgICAgICAgcExWUFNBX0luc3QtPlNwZWN0cmFsRGF0YUJ1ZmZlckF1ZGlvVGltZSA9IEF1ZGlvVGltZSArIEF1ZGlvVGltZUluYzsKLSAgICB9Ci0KLSAgICByZXR1cm4oTFZQU0FfT0spOwotfQotCi0KLS8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0vKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogRlVOQ1RJT046ICAgICAgICAgICAgTFZQU0FfR2V0U3BlY3RydW0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiBERVNDUklQVElPTjogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogIEdldHMgdGhlIGxldmVscyB2YWx1ZXMgYXQgYSBjZXJ0YWluIHBvaW50IGluIHRpbWUgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogUEFSQU1FVEVSUzogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICBoSW5zdGFuY2UgICAgICAgICAgICBQb2ludGVyIHRvIHRoZSBpbnN0YW5jZSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgR2V0U3BlY3RydW1BdWRpb1RpbWUgUmV0cmlldmUgdGhlIHZhbHVlcyBhdCB0aGlzIHRpbWUgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogIHBDdXJyZW50VmFsdWVzICAgICAgIFBvaW50ZXIgdG8gYSBidWZmZXIgdGhhdCB3aWxsIGNvbnRhaW4gbGV2ZWxzJyB2YWx1ZXMgICAgICAgKi8KLS8qICBwTWF4VmFsdWVzICAgICAgICAgICBQb2ludGVyIHRvIGEgYnVmZmVyIHRoYXQgd2lsbCBjb250YWluIG1heCBsZXZlbHMnIHZhbHVlcyAgICovCi0vKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qIFJFVFVSTlM6ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgTFZQU0FfT0sgICAgICAgICAgICBTdWNjZWVkcyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogIG90aGVyd2lzZSAgICAgICAgICAgRXJyb3IgZHVlIHRvIGJhZCBwYXJhbWV0ZXJzICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotTFZQU0FfUkVUVVJOIExWUFNBX0dldFNwZWN0cnVtICAgICAgICggcExWUFNBX0hhbmRsZV90ICAgICAgaEluc3RhbmNlLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTFZQU0FfVGltZSAgICAgICAgICAgR2V0U3BlY3RydW1BdWRpb1RpbWUsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBMVk1fVUlOVDggICAgICAgICAgICpwQ3VycmVudFZhbHVlcywKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIExWTV9VSU5UOCAgICAgICAgICAgKnBQZWFrVmFsdWVzICAgICAgICAgICApCi0KLXsKLQotICAgIExWUFNBX0luc3RhbmNlUHJfdCAgICAgICpwTFZQU0FfSW5zdCA9IChMVlBTQV9JbnN0YW5jZVByX3QqKWhJbnN0YW5jZTsKLSAgICBMVk1fSU5UMzIgICAgICAgICAgICAgICBTdGF0dXNEZWx0YSwgaWk7Ci0gICAgTFZNX1VJTlQ4ICAgICAgICAgICAgICAgKnBSZWFkOwotCi0gICAgaWYoaEluc3RhbmNlID09IExWTV9OVUxMIHx8IHBDdXJyZW50VmFsdWVzID09IExWTV9OVUxMIHx8IHBQZWFrVmFsdWVzID09IExWTV9OVUxMKQotICAgIHsKLSAgICAgICAgcmV0dXJuKExWUFNBX0VSUk9SX05VTExBRERSRVNTKTsKLSAgICB9Ci0KLQotICAgIC8qIEZpcnN0IGZpbmQgdGhlIHBsYWNlIHdoZXJlIHRvIGxvb2sgaW4gdGhlIHN0YXR1cyBidWZmZXIgKi8KLSAgICBpZihHZXRTcGVjdHJ1bUF1ZGlvVGltZSA8PSBwTFZQU0FfSW5zdC0+U3BlY3RyYWxEYXRhQnVmZmVyQXVkaW9UaW1lKQotICAgIHsKLSAgICAgICAgTVVMMzJ4MzJJTlRPMzIoKHBMVlBTQV9JbnN0LT5TcGVjdHJhbERhdGFCdWZmZXJBdWRpb1RpbWUgLSBHZXRTcGVjdHJ1bUF1ZGlvVGltZSksTFZQU0Ff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sbCB0aGUgb3V0cHV0IGJ1ZmZlcnMgKi8KLSAgICBmb3IoaWkgPSAwOyBpaSA8IHBMVlBTQV9JbnN0LT5uQmFuZHM7IGlpKyspCi0gICAgewotICAgICAgICBwQ3VycmVudFZhbHVlc1tpaV0gPSBwUmVhZFtpaV07Ci0gICAgICAgIGlmKHBMVlBTQV9JbnN0LT5wUHJldmlvdXNQZWFrc1tpaV0gPD0gcFJlYWRbaWldKQotICAgICAgICB7Ci0gICAgICAgICAgICBwTFZQU0FfSW5zdC0+cFByZXZpb3VzUGVha3NbaWldID0gcFJlYWRbaWldOwotICAgICAgICB9Ci0gICAgICAgIGVsc2UgaWYocExWUFNBX0luc3QtPnBQcmV2aW91c1BlYWtzW2lpXSAhPSAwKQotICAgICAgICB7Ci0gICAgICAgICAgICBMVk1fSU5UMzIgdGVtcDsKLSAgICAgICAgICAgIC8qUmUtY29tcHV0ZSBtYXggdmFsdWVzIGZvciBkZWNheSAqLwotICAgICAgICAgICAgdGVtcCA9IChMVk1fSU5UMzIpKExWUFNBX01BWFVOU0lHTkVEQ0hBUiAtIHBMVlBTQV9JbnN0LT5wUHJldmlvdXNQZWFrc1tpaV0pOwotICAgICAgICAgICAgdGVtcCA9ICgodGVtcCAqIExWUFNBX01BWExFVkVMREVDQVlGQUNUT1IpPj5MVlBTQV9NQVhMRVZFTERFQ0FZU0hJRlQpOwotICAgICAgICAgICAgLyogSWYgdGhlIGdhaW4gaGFzIG5vIGVmZmVjdCwgImhlbHAiIHRoZSB2YWx1ZSB0byBpbmNyZWFzZSAqLwotICAgICAgICAgICAgaWYodGVtcCA9PSAoTFZQU0FfTUFYVU5TSUdORURDSEFSIC0gcExWUFNBX0luc3QtPnBQcmV2aW91c1BlYWtzW2lpXSkpCi0gICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgdGVtcCArPSAxOwotICAgICAgICAgICAgfQotICAgICAgICAgICAgLyogU2F0dXJhdGUgKi8KLSAgICAgICAgICAgIHRlbXAgPSAodGVt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TdGF0ZV90OwotCi10eXBlZGVmIHN0cnVjdAotewotICAgIExWTV9JTlQzMiBLUDsgICAgLypzaG91bGQgc3RvcmUgYTAqLwotICAgIExWTV9JTlQzMiBLTTsgICAgLypzaG91bGQgc3RvcmUgYjIqLwotCi19IFFQRF9DMzJfQ29lZnMsICpQUVBEX0MzMl9Db2VmczsKLQotdHlwZWRlZiBzdHJ1Y3QKLXsKLSAgICBMVk1fSU5UMzIgU3RvcmFnZVsxXTsKLQotfSBRUERfVGFwc190LCAqcFFQRF9UYXBzX3Q7Ci0KLS8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0vKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogRlVOQ1RJT046ICAgICAgICAgICAgTFZQU0FfUVBEX1Byb2Nlc3MgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiBERVNDUklQVElPTjogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogIEFwcGx5IGRvd25zYW1wbGluZywgcG9zdCBnYWluLCBxdWFzaSBwZWFrIGZpbHRlcmluZyBhbmQgd3JpdGUgdGhlIGxldmVscyB2YWx1ZXMgKi8KLS8qICBpbiB0aGUgYnVmZmVyIGV2ZXJ5IDIwIG1zLiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogUEFSQU1FVEVSUzogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiBSRVRVUk5TOiAgICAgICAgICAgICB2b2lkICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi12b2lkIExWUFNBX1FQRF9Qcm9jZXNzICggICAgICAgICAgICB2b2lkICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICpoSW5zdGFuY2UsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBMVk1fSU5UMTYgICAgICAgICAgICAgICAgICAgICAgICAgICpwSW5TYW1wcywKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIExWTV9JTlQxNiAgICAgICAgICAgICAgICAgICAgICAgICAgIG51bVNhbXBsZXMsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBMVk1fSU5UMTYgICAgICAgICAgICAgICAgICAgICAgICAgICBCYW5kSW5kZXgpOwotCi0vKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotLyogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qIEZVTkNUSU9OOiAgICAgICAgICAgIExWUFNBX1FQRF9Jbml0ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogREVTQ1JJUFRJT046ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICBJbml0aWFsaXplIGEgcXVhc2kgcGVhayBmaWx0ZXIgaW5zdGFuY2UuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogUEFSQU1FVEVSUzogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICBwSW5zdGFuY2UgICAgICAgICAgIFBvaW50ZXIgdG8gdGhlIGluc3RhbmNlICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgIHBUYXBzICAgICAgICAgICAgICAgUG9pbnRlciB0byB0aGUgZmlsdGVyJ3MgdGFwcyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogICBwQ29lZiAgICAgICAgICAgICAgIFBvaW50ZXIgdG8gdGhlIGZpbHRlcidzIGNvZWZmaWNpZW50cyAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiBSRVRVUk5TOiAgICAgdm9pZCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi12b2lkIExWUFNBX1FQRF9Jbml0ICggICBRUERfU3RhdGVfdCAgICAgICAqcEluc3RhbmNlLAotICAgICAgICAgICAgICAgICAgICAgICAgUVBEX1RhcHNfdCAgICAgICAgKnBUYXBzLAotICAgICAgICAgICAgICAgICAgICAgICAgUVBEX0MzMl9Db2VmcyAgICAgKnBDb2VmICAgICApOwotCi0KLSNpZmRlZiBfX2NwbHVzcGx1cwotfQotI2VuZGlmIC8qIF9fY3BsdXNwbHVzICovCi0KLSNlbmRpZgotCmRpZmYgLS1naXQgYS9tZWRpYS9saWJlZmZlY3RzL2x2bS9saWIvU3BlY3RydW1BbmFseXplci9zcmMvTFZQU0FfUVBEX0luaXQuYyBiL21lZGlhL2xpYmVmZmVjdHMvbHZtL2xpYi9TcGVjdHJ1bUFuYWx5emVyL3NyYy9MVlBTQV9RUERfSW5pdC5jCmRlbGV0ZWQgZmlsZSBtb2RlIDEwMDY0NAppbmRleCA1MGUwYTgwMi4uMDAwMDAwMAotLS0gYS9tZWRpYS9saWJlZmZlY3RzL2x2bS9saWIvU3BlY3RydW1BbmFseXplci9zcmMvTFZQU0FfUVBEX0luaXQuYworKysgL2Rldi9udWxsCkBAIC0xLDQyICswLDAgQEAKLS8qCi0gKiBDb3B5cmlnaHQgKEMpIDIwMDQtMjAxMCBOWFAgU29mdHdhcmUKLSAqIENvcHlyaWdodCAoQykgMjAxMCBUaGUgQW5kcm9pZCBPcGVuIFNvdXJjZSBQcm9qZWN0Ci0gKgotICogTGljZW5zZWQgdW5kZXIgdGhlIEFwYWNoZSBMaWNlbnNlLCBWZXJzaW9uIDIuMCAodGhlICJMaWNlbnNlIik7Ci0gKiB5b3UgbWF5IG5vdCB1c2UgdGhpcyBmaWxlIGV4Y2VwdCBpbiBjb21wbGlhbmNlIHdpdGggdGhlIExpY2Vuc2UuCi0gKiBZb3UgbWF5IG9idGFpbiBhIGNvcHkgb2YgdGhlIExpY2Vuc2UgYXQKLSAqCi0gKiAgICAgIGh0dHA6Ly93d3cuYXBhY2hlLm9yZy9saWNlbnNlcy9MSUNFTlNFLTIuMAotICoKLSAqIFVubGVzcyByZXF1aXJlZCBieSBhcHBsaWNhYmxlIGxhdyBvciBhZ3JlZWQgdG8gaW4gd3JpdGluZywgc29mdHdhcmUKLSAqIGRpc3RyaWJ1dGVkIHVuZGVyIHRoZSBMaWNlbnNlIGlzIGRpc3RyaWJ1dGVkIG9uIGFuICJBUyBJUyIgQkFTSVMsCi0gKiBXSVRIT1VUIFdBUlJBTlRJRVMgT1IgQ09ORElUSU9OUyBPRiBBTlkgS0lORCwgZWl0aGVyIGV4cHJlc3Mgb3IgaW1wbGllZC4KLSAqIFNlZSB0aGUgTGljZW5zZSBmb3IgdGhlIHNwZWNpZmljIGxhbmd1YWdlIGdvdmVybmluZyBwZXJtaXNzaW9ucyBhbmQKLSAqIGxpbWl0YXRpb25zIHVuZGVyIHRoZSBMaWNlbnNlLgotICovCi0KLSNpbmNsdWRlICJMVlBTQV9RUEQuaCIKLQotLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLS8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiBGVU5DVElPTjogICAgICAgICAgICBMVlBTQV9RUERfSW5pdCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qIERFU0NSSVBUSU9OOiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgSW5pdGlhbGl6ZSBhIHF1YXNpIHBlYWsgZmlsdGVyIGluc3RhbmNlLiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qIFBBUkFNRVRFUlM6ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgcFFQRF9TdGF0ZSAgICAgICAgICBQb2ludGVyIHRvIHRoZSBmaWx0ZXIgc3RhdGUgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogICBwVGFwcyAgICAgICAgICAgICAgIFBvaW50ZXIgdG8gdGhlIGZpbHRlcidzIHRhcHMgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICAgcENvZWYgICAgICAgICAgICAgICBQb2ludGVyIHRvIHRoZSBmaWx0ZXIncyBjb2VmZmljaWVudHMgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogUkVUVVJOUzogICAgIHZvaWQgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq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HlvdSBtYXkgbm90IHVzZSB0aGlzIGZpbGUgZXhjZXB0IGluIGNvbXBsaWFuY2Ugd2l0aCB0aGUgTGljZW5zZS4KLSAqIFlvdSBtYXkgb2J0YWluIGEgY29weSBvZiB0aGUgTGljZW5zZSBhdAotICoKLSAqICAgICAgaHR0cDovL3d3dy5hcGFjaGUub3JnL2xpY2Vuc2VzL0xJQ0VOU0UtMi4wCi0gKgotICogVW5sZXNzIHJlcXVpcmVkIGJ5IGFwcGxpY2FibGUgbGF3IG9yIGFncmVlZCB0byBpbiB3cml0aW5nLCBzb2Z0d2FyZQotICogZGlzdHJpYnV0ZWQgdW5kZXIgdGhlIExpY2Vuc2UgaXMgZGlzdHJpYnV0ZWQgb24gYW4gIkFTIElTIiBCQVNJUywKLSAqIFdJVEhPVVQgV0FSUkFOVElFUyBPUiBDT05ESVRJT05TIE9GIEFOWSBLSU5ELCBlaXRoZXIgZXhwcmVzcyBvciBpbXBsaWVkLgotICogU2VlIHRoZSBMaWNlbnNlIGZvciB0aGUgc3BlY2lmaWMgbGFuZ3VhZ2UgZ292ZXJuaW5nIHBlcm1pc3Npb25zIGFuZAotICogbGltaXRhdGlvbnMgdW5kZXIgdGhlIExpY2Vuc2UuCi0gKi8KLQotI2luY2x1ZGUgIkxWUFNBX1FQRC5oIgotI2luY2x1ZGUgIkxWUFNBX1ByaXZhdGUuaCIKLQotLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLS8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiBGVU5DVElPTjogICAgICAgICAgICBMVlBTQV9RUERfV3JpdGVQZWFrICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qIERFU0NSSVBUSU9OOiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgV3JpdGUgYSBsZXZlbCB2YWx1ZSBpbiB0aGUgYnVmZmVyIGluIHRoZSBjb3JyZXNwb25kaW5nIGJhbmQuICAgICAgICAgICAgICAgICAgICAqLwotLyogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qIFBBUkFNRVRFUlM6ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgcEluc3QgICAgICAgICAgICAgICBQb2ludGVyIHRvIHRoZSBMVlBTQSBpbnN0YW5jZSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogIHBwV3JpdGUgICAgICAgICAgICAgUG9pbnRlciB0byBwb2ludGVyIHRvIHRoZSBidWZmZXIgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICBDYWxsTnVtYmVyICAgICAgICAgIE51bWJlciBvZiB0aGUgYmFuZCB0aGUgdmFsdWUgc2hvdWxkIGJlIHdyaXR0ZW4gaW4gICAgICAgICAgICovCi0vKiAgVmFsdWUgICAgICAgICAgICAgICBWYWx1ZSB0byB3cml0ZSBpbiB0aGUgYnVmZmVyICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qIFJFVFVSTlM6ICAgICAgICAgICAgIHZvaWQgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLXZvaWQgTFZQU0FfUVBEX1dyaXRlUGVhayggICBwTFZQU0FfSW5zdGFuY2VQcl90ICAgICAgIHBMVlBTQV9JbnN0LAotICAgICAgICAgICAgICAgICAgICAgICAgICAgIExWTV9VSU5UOCAgICAgICAgICAgICAqKnBwV3JpdGUsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgTFZNX0lOVDE2ICAgICAgICAgICAgICAgQmFuZEluZGV4LAotICAgICAgICAgICAgICAgICAgICAgICAgICAgIExWTV9JTlQxNiAgICAgICAgICAgICAgIFZhbHVlICAgKTsKLQotCi0KLS8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0vKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogRlVOQ1RJT046ICAgICAgICAgICAgTFZQU0FfUVBEX1Byb2Nlc3MgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiBERVNDUklQVElPTjogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogIEFwcGx5IGRvd25zYW1wbGluZywgcG9zdCBnYWluLCBxdWFzaSBwZWFrIGZpbHRlcmluZyBhbmQgd3JpdGUgdGhlIGxldmVscyB2YWx1ZXMgKi8KLS8qICBpbiB0aGUgYnVmZmVyIGV2ZXJ5IDIwIG1zLiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogUEFSQU1FVEVSUzogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiBSRVRVUk5TOiAgICAgICAgICAgICB2b2lkICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi12b2lkIExWUFNBX1FQRF9Qcm9jZXNzICggICAgICAgICAgICB2b2lkICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICpoSW5zdGFuY2UsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBMVk1fSU5UMTYgICAgICAgICAgICAgICAgICAgICAgICAgICpwSW5TYW1wcywKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIExWTV9JTlQxNiAgICAgICAgICAgICAgICAgICAgICAgICAgIG51bVNhbXBsZXMsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBMVk1fSU5UMTYgICAgICAgICAgICAgICAgICAgICAgICAgICBCYW5kSW5kZXgpCi17Ci0KLSAgICAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCi0gICAgICAgUEFSQU1FVEVSUwotICAgICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0gICAgTFZQU0FfSW5zdGFuY2VQcl90ICAgICAqcExWUFNBX0luc3QgPSAoTFZQU0FfSW5zdGFuY2VQcl90KiloSW5zdGFuY2U7Ci0gICAgUVBEX1N0YXRlX3QgKnBRUERTdGF0ZSA9ICAoUVBEX1N0YXRlX3QqKSZwTFZQU0FfSW5zdC0+cFFQRF9TdGF0ZXNbQmFuZEluZGV4XTsKLQotICAgIC8qIFBvaW50ZXIgdG8gdGFwcyAqLwotICAgIExWTV9JTlQzMiogcERlbGF5ICA9IHBRUERTdGF0ZS0+cERlbGF5OwotCi0gICAgLyogUGFyYW1ldGVycyBuZWVkZWQgZHVyaW5nIHF1YXNpIHBlYWsgY2FsY3VsYXRpb25zICovCi0gICAgTFZNX0lOVDMyICAgWDA7Ci0gICAgTFZNX0lOVDMyICAgdGVtcCx0ZW1wMjsKLSAgICBMVk1fSU5UMzIgICBhY2N1OwotICAgIExWTV9JTlQxNiAgIFhnMDsKLSAgICBMVk1fSU5UMTYgICBEMDsKLSAgICBMVk1fSU5UMTYgICBWMCA9IChMVk1fSU5UMTYpKCpwRGVsYXkpOwotCi0gICAgLyogRmlsdGVyJ3MgY29lZiAqLwotICAgIExWTV9JTlQzMiAgIEtwID0gcFFQRFN0YXRlLT5Db2Vmc1swXTsKLSAgICBMVk1fSU5UMzIgICBLbSA9IHBRUERTdGF0ZS0+Q29lZnNbMV07Ci0KLSAgICBMVk1fSU5UMTYgICBpaSA9IG51bVNhbXBsZXM7Ci0KLSAgICBMVk1fVUlOVDggICpwV3JpdGUgPSBwTFZQU0FfSW5zdC0+cFNwZWN0cmFsRGF0YUJ1ZmZlcldyaXRlUG9pbnRlcjsKLSAgICBMVk1fSU5UMzIgICBCdWZmZXJVcGRhdGVTYW1wbGVzQ291bnQgPSBwTFZQU0FfSW5zdC0+QnVmZmVyVXBkYXRlU2FtcGxlc0NvdW50OwotICAgIExWTV9VSU5UMTYgIERvd25TYW1wbGluZ0ZhY3RvciA9IHBMVlBTQV9JbnN0LT5Eb3duU2FtcGxpbmdGYWN0b3I7Ci0KLSAgICAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCi0gICAgICAgSU5JVElBTElaQVRJT04KLSAgICAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotICAgIC8qIENvcnJlY3QgdGhlIHBvaW50ZXIgdG8gdGFrZSB0aGUgZmlyc3QgZG93biBzYW1wbGVkIHNpZ25hbCBzYW1wbGUgKi8KLSAgICBwSW5TYW1wcyArPSBwTFZQU0FfSW5zdC0+RG93blNhbXBsaW5nQ291bnQ7Ci0gICAgLyogQ29ycmVjdCBhbHNvIHRoZSBudW1iZXIgb2Ygc2FtcGxlcyAqLwotICAgIGlpID0gKExWTV9JTlQxNikoaWkgLSAoTFZNX0lOVDE2KXBMVlBTQV9JbnN0LT5Eb3duU2FtcGxpbmdDb3VudCk7Ci0KLSAgICB3aGlsZSAoaWkgPiAwKQotICAgIHsKLSAgICAgICAgLyogQXBwbHkgcG9zdCBnYWluICovCi0gICAgICAgIFgwID0gKCgqcEluU2FtcHMpICogcExWUFNBX0luc3QtPnBQb3N0R2FpbnNbQmFuZEluZGV4XSkgPj4gKExWUFNBX0dBSU5TSElGVC0xKTsgLyogLSAxIHRvIGNvbXBlbnNhdGUgc2NhbGluZyBpbiBwcm9jZXNzIGZ1bmN0aW9uKi8KLSAgICAgICAgcEluU2FtcHMgPSBwSW5TYW1wc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GlzIG5vcm1hbGx5Ci0gICAgICAgICAgIHRoZSBleGFjdCBudW1iZXIgb2Ygc2FtcGxlcyBmb3IgMjBtcy4qLwotICAgICAgICBpZigocExWUFNBX0luc3QtPnBTcGVjdHJhbERhdGFCdWZmZXJXcml0ZVBvaW50ZXIgIT0gcFdyaXRlKSYmKHBMVlBTQV9JbnN0LT5DdXJyZW50UGFyYW1zLkZzID09IExWTV9GU18xMTAyNSkpCi0gICAgICAgIHsKLSAgICAgICAgICAgIGlmKHBMVlBTQV9JbnN0LT5uU2FtcGxlc0J1ZmZlclVwZGF0ZSA9PSAyMjApCi0gICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgcExWUFNBX0luc3QtPm5TYW1wbGVzQnVmZmVyVXBkYXRlID0gMjIxOwotICAgICAgICAgICAgfQotICAgICAgICAgICAgZWxzZQotICAgICAgICAgICAgewotICAgICAgICAgICAgICAgIHBMVlBTQV9JbnN0LT5uU2FtcGxlc0J1ZmZlclVwZGF0ZSA9IDIyMDsKLSAgICAgICAgICAgIH0KLSAgICAgICAgfQotICAgICAgICBwTFZQU0FfSW5zdC0+cFNwZWN0cmFsRGF0YUJ1ZmZlcldyaXRlUG9pbnRlciA9IHBXcml0ZTsKLSAgICAgICAgcExWUFNBX0luc3QtPkJ1ZmZlclVwZGF0ZVNhbXBsZXNDb3VudCA9IEJ1ZmZlclVwZGF0ZVNhbXBsZXNDb3VudDsKLSAgICAgICAgcExWUFNBX0luc3QtPkRvd25TYW1wbGluZ0NvdW50ID0gKExWTV9VSU5UMTYpKC1paSk7Ci0gICAgfQotfQotCi0vKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotLyogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qIEZVTkNUSU9OOiAgICAgICAgICAgIExWUFNBX1FQRF9Xcml0ZVBlYWsgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogREVTQ1JJUFRJT046ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICBXcml0ZSBhIGxldmVsIHZhbHVlIGluIHRoZSBzcGVjdHJ1bSBkYXRhIGJ1ZmZlciBpbiB0aGUgY29ycmVzcG9uZGluZyBiYW5kLiAgICAgICovCi0vKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogUEFSQU1FVEVSUzogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICBwTFZQU0FfSW5zdCAgICAgICAgICAgICAgIFBvaW50ZXIgdG8gdGhlIExWUFNBIGluc3RhbmNlICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgcHBXcml0ZSAgICAgICAgICAgICBQb2ludGVyIHRvIHBvaW50ZXIgdG8gdGhlIGJ1ZmZlciAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogIENhbGxOdW1iZXIgICAgICAgICAgTnVtYmVyIG9mIHRoZSBiYW5kIHRoZSB2YWx1ZSBzaG91bGQgYmUgd3JpdHRlbiBpbiAgICAgICAgICAgKi8KLS8qICBWYWx1ZSAgICAgICAgICAgICAgIFZhbHVlIHRvIHdyaXRlIGluIHRoZSBzcGVjdHJ1bSBkYXRhIGJ1ZmZlciAgICAgICAgICAgICAgICAgICovCi0vKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogUkVUVVJOUzogICAgICAgICAgICAgdm9pZCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotdm9pZCBMVlBTQV9RUERfV3JpdGVQZWFrKCAgIHBMVlBTQV9JbnN0YW5jZVByX3QgICAgICAgcExWUFNBX0luc3QsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgTFZNX1VJTlQ4ICAgICAgICAgICAgICoqcHBXcml0ZSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBMVk1fSU5UMTYgICAgICAgICAgICAgICBCYW5kSW5kZXgsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgTFZNX0lOVDE2ICAgICAgICAgICAgICAgVmFsdWUgICApCi17Ci0gICAgTFZNX1VJTlQ4ICpwV3JpdGUgPSAqcHBXcml0ZTsKLQotCi0gICAgLyogV3JpdGUgdGhlIHZhbHVlIGFuZCB1cGRhdGUgdGhlIHdyaXRlIHBvaW50ZXIgKi8KLSAgICAqKHBXcml0ZSArIEJhbmRJbmRleCkgPSAoTFZNX1VJTlQ4KShWYWx1ZT4+Nyk7Ci0gICAgcFdyaXRlICs9IHBMVlBTQV9JbnN0LT5uQmFuZHM7Ci0gICAgaWYgKHBXcml0ZSA9PSAocExWUFNBX0luc3QtPnBTcGVjdHJhbERhdGFCdWZmZXJTdGFydCArIHBMVlBTQV9JbnN0LT5uQmFuZHMgKiBwTFZQU0FfSW5zdC0+U3BlY3RyYWxEYXRhQnVmZmVyTGVuZ3RoKSkKLSAgICB7Ci0gICAgICAgIHBXcml0Z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CB1bmRlciB0aGUgTGljZW5zZSBpcyBkaXN0cmlidXRlZCBvbiBhbiAiQVMgSVMiIEJBU0lTLAotICogV0lUSE9VVCBXQVJSQU5USUVTIE9SIENPTkRJVElPTlMgT0YgQU5ZIEtJTkQsIGVpdGhlciBleHByZXNzIG9yIGltcGxpZWQuCi0gKiBTZWUgdGhlIExpY2Vuc2UgZm9yIHRoZSBzcGVjaWZpYyBsYW5ndWFnZSBnb3Zlcm5pbmcgcGVybWlzc2lvbnMgYW5kCi0gKiBsaW1pdGF0aW9ucyB1bmRlciB0aGUgTGljZW5zZS4KLSAqLwotCi0KLS8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0vKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogIEluY2x1ZGVzICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotCi0jaW5jbHVkZSAiTFZQU0EuaCIKLSNpbmNsdWRlICJMVlBTQV9RUEQuaCIKLS8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0vKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogIFNhbXBsZSByYXRlIHRhYmxlICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotCi0vKgotICogU2FtcGxlIHJhdGUgdGFibGUgZm9yIGNvbnZlcnRpbmcgYmV0d2VlbiB0aGUgZW51bWVyYXRlZCB0eXBlIGFuZCB0aGUgYWN0dWFsCi0gKiBmcmVxdWVuY3kKLSAqLwotY29uc3QgTFZNX1VJTlQxNiAgICBMVlBTQV9TYW1wbGVSYXRlVGFiW10gPSB7ICAgODAwMCwgICAgICAgICAgICAgICAgICAgIC8qIDhrUy9zICAqLwotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMTEwMjUsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAxMjAwMCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDE2MDAwLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMjIwNTAsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAyNDAwMCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDMyMDAwLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgNDQxMDAsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA0ODAwMH07ICAgICAgICAgICAgICAgICAgLyogNDhrUy9zICovCi0KLS8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0vKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogIFNhbXBsZSByYXRlIGludmVyc2UgdGFibGUgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotCi0vKgotICogU2FtcGxlIHJhdGUgdGFibGUgZm9yIGNvbnZlcnRpbmcgYmV0d2VlbiB0aGUgZW51bWVyYXRlZCB0eXBlIGFuZCB0aGUgYWN0dWFsCi0gKiBmcmVxdWVuY3kKLSAqLwotY29uc3QgTFZNX1VJTlQzMiAgICBMVlBTQV9TYW1wbGVSYXRlSW52VGFiW10gPSB7ICAgIDI2ODQzNSwgICAgICAgICAgICAgICAgICAgIC8qIDhrUy9zICAqLwotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDE5NDc4MywKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAxNzg5NTcsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMTM0MjE4LAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDk3MzkxLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDg5NDc4LAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDY3MTA5LAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDQ4Njk2LAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDQ0NzM5fTsgICAgICAgICAgICAgICAgICAvKiA0OGtTL3MgKi8KLQotCi0KLS8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0vKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogIE51bWJlciBvZiBzYW1wbGVzIGluIDIwbXMgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotCi0vKgotICogVGFibGUgZm9yIGNvbnZlcnRpbmcgYmV0d2VlbiB0aGUgZW51bWVyYXRlZCB0eXBlIGFuZCB0aGUgbnVtYmVyIG9mIHNhbXBsZXMKLSAqIGR1cmluZyAyMG1zCi0gKi8KLWNvbnN0IExWTV9VSU5UMTYgICAgTFZQU0FfblNhbXBsZXNCdWZmZXJVcGRhdGVbXSAgPSB7ICAgMTYwLCAgICAgICAgICAgICAgICAgICAvKiA4a1MvcyAgKi8KLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMjIwLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAyNDAsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDMyMCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgNDQxLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA0ODAsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDY0MCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgODgyLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA5NjB9OyAgICAgICAgICAgICAgICAgIC8qIDQ4a1MvcyAqLwotLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLS8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgRG93biBzYW1wbGluZyBmYWN0b3JzICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0KLS8qCi0gKiBUYWJsZSBmb3IgY29udmVydGluZyBiZXR3ZWVuIHRoZSBlbnVtZXJhdGVkIHR5cGUgYW5kIHRoZSBkb3duIHNhbXBsaW5nIGZhY3RvcgotICovCi1jb25zdCBMVk1fVUlOVDE2ICAgIExWUFNBX0Rvd25TYW1wbGluZ0ZhY3RvcltdICA9IHsgICAgIDUsICAgICAgICAgICAgICAgICAgICAvKiA4MDAwICBTL3MgICovCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDcsICAgICAgICAgICAgICAgICAgICAvKiAxMTAyNSBTL3MgICovCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDgsICAgICAgICAgICAgICAgICAgICAvKiAxMjAwMCBTL3MgICovCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDEwLCAgICAgICAgICAgICAgICAgICAvKiAxNjAwMCBTL3MgICovCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDE1LCAgICAgICAgICAgICAgICAgICAvKiAyMjA1MCBTL3MgICovCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDE2LCAgICAgICAgICAgICAgICAgICAvKiAyNDAwMCBTL3MgICovCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDIxLCAgICAgICAgICAgICAgICAgICAvKiAzMjAwMCBTL3MgICovCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDMwLCAgICAgICAgICAgICAgICAgICAvKiA0NDEwMCBTL3MgICovCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDMyfTsgICAgICAgICAgICAgICAgICAvKiA0ODAwMCBTL3MgICovCi0KLQotLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLS8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgQ29lZmZpY2llbnQgY2FsY3VsYXRpb24gdGFibGVzICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0KLS8qCi0gKiBUYWJsZSBmb3IgMiAqIFBpIC8gRnMKLSAqLwotY29uc3QgTFZNX0lOVDE2ICAgICBMVlBTQV9Ud29QaU9uRnNUYWJsZVtdID0geyAgMjYzNTQsICAgICAgLyogOGtTL3MgKi8KLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDE5MTIzLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMTc1NjksCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAxMzE3NywKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA5NTYxLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDg3ODUsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgNjU4OCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA0NzgxLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDQzOTJ9OyAgICAvKiA0OGtTL3MgKi8KLQotLyoKLSAqIEdhaW4gdGFibGUKLSAqLwotY29uc3QgTFZNX0lOVDE2ICAgICBMVlBTQV9HYWluVGFibGVbXSA9IHsgICAzNjQsICAgICAgICAgIC8qIC0xNWRCIGdhaW4gKi8KLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgNDA4LAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA0NTgsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDUxNCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgNTc3LAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA2NDcsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDcyNiwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgODE1LAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA5MTQsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDEwMjYsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDExNTEsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDEyOTIsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDE0NDksCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDE2MjYsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDE4MjUsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDIwNDgsICAgICAgICAgLyogMGRCIGdhaW4gKi8KLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMjI5NywKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMjU3OCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMjg5MiwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMzI0NSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMzY0MSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgNDA5NiwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgNDU4NCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgNTE0NCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgNTc3MiwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgNjQ3NiwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgNzI2NiwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgODE1MywKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOTE0OCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMTAyNjQsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDExNTc2fTsgICAgICAgIC8qICsxNWRCIGdhaW4gKi8KLQotLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLS8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgQ29zb25lIHBvbHlub21pYWwgY29lZmZpY2llbnRzICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0KLS8qCi0gKiBDb2VmZmljaWVudHMgZm9yIGNhbGN1bGF0aW5nIHRoZSBjb3NpbmUgd2l0aCB0aGUgZXF1YXRpb246Ci0gKgotICogIENvcyh4KSA9ICgyXlNoaWZ0cykqKGEwICsgYTEqeCArIGEyKnheMiArIGEzKnheMyArIGE0KnheNCArIGE1KnheNSkKLSAqCi0gKiBUaGVzZSBjb2VmZmljaWVudHMgZXhwZWN0IHRoZSBpbnB1dCwgeCwgdG8gYmUgaW4gdGhlIHJhbmdlIDAgdG8gMzI3NjggcmVzcHJlc2VudGluZwotICogYSByYW5nZSBvZiAwIHRvIFBpLiBUaGUgb3V0cHV0IGlzIGluIHRoZSByYW5nZSAzMjc2NyB0byAtMzI3NjggcmVwcmVzZW50aW5nIHRoZSByYW5nZQotICogKzEuMCB0byAtMS4wCi0gKi8KLWNvbnN0IExWTV9JTlQxNiAgICAgTFZQU0FfQ29zQ29lZltdID0geyAzLCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLyogU2hpZnRzICovCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgNDA5NiwgICAgICAgICAgICAgICAgICAgICAgICAgIC8qIGEwICovCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLTM2LCAgICAgICAgICAgICAgICAgICAgICAgICAgIC8qIGExICovCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLTE5NzI1LCAgICAgICAgICAgICAgICAgICAgICAgIC8qIGEyICovCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLTI2NzEsICAgICAgICAgICAgICAgICAgICAgICAgIC8qIGEzICovCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMjM3MzAsICAgICAgICAgICAgICAgICAgICAgICAgIC8qIGE0ICovCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLTk0OTB9OyAgICAgICAgICAgICAgICAgICAgICAgIC8qIGE1ICovCi0KLS8qCi0gKiBDb2VmZmljaWVudHMgZm9yIGNhbGN1bGF0aW5nIHRoZSBjb3NpbmUgZXJyb3Igd2l0aCB0aGUgZXF1YXRpb246Ci0gKgotICogIENvc0Vycih4KSA9ICgyXlNoaWZ0cykqKGEwICsgYTEqeCArIGEyKnheMiArIGEzKnheMykKLSAqCi0gKiBUaGVzZSBjb2VmZmljaWVudHMgZXhwZWN0IHRoZSBpbnB1dCwgeCwgdG8gYmUgaW4gdGhlIHJhbmdlIDAgdG8gMzI3NjggcmVzcHJlc2VudGluZwotICogYSByYW5nZSBvZiAwIHRvIFBpLzI1LiBUaGUgb3V0cHV0IGlzIGluIHRoZSByYW5nZSAwIHRvIDMyNzY3IHJlcHJlc2VudGluZyB0aGUgcmFuZ2UKLSAqIDAuMCB0byAwLjAwNzg4NTI5ODYKLSAqCi0gKiBUaGlzIGlzIHVzZWQgdG8gZ2l2ZSBhIGRvdWJsZSBwcmVjaXNpb24gY29zaW5lIG92ZXIgdGhlIHJhbmdlIDAgdG8gUGkvMjUgdXNpbmcgdGhlCi0gKiB0aGUgZXF1YXRpb246Ci0gKgotICogQ29zKHgpID0gMS4wIC0gQ29zRXJyKHgpCi0gKi8KLWNvbnN0IExWTV9JTlQxNiAgICAgTFZQU0FfRFBDb3NDb2VmW10gPSB7ICAgMSwgICAgICAgICAgICAgICAgICAgICAgICAgICAvKiBTaGlmdHMgKi8KLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMCwgICAgICAgICAgICAgICAgICAgICAgICAgICAvKiBhMCAqLwotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAtNiwgICAgICAgICAgICAgICAgICAgICAgICAgIC8qIGExICovCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDE2NTg2LCAgICAgICAgICAgICAgICAgICAgICAgLyogYTIgKi8KLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLTQ0fTsgICAgICAgICAgICAgICAgICAgICAgICAvKiBhMyAqLwotCi0vKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotLyogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICBRdWFzaSBwZWFrIGZpbHRlciBjb2VmZmljaWVudHMgdGFibGUgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLWNvbnN0IFFQRF9DMzJfQ29lZnMgICAgIExWUFNBX1FQRF9Db2Vmc1tdID0gewotCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHsweDgwQ0VGRDJCLDB4MDBDQjlCMTd9LCAgLyogOGtTL3MgICovICAgIC8qIExWUFNBX1NQRUVEX0xPVyAgICovCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHsweDgwRDI0MkU3LDB4MDBDRUQxMUR9LAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB7MHg4MERDQkFGNSwweDAwRDkxNjc5fSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgezB4ODBDRUZEMkIsMHgwMENCOUIxN30sCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHsweDgwRTEzNzM5LDB4MDBERDdDRDN9LAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB7MHg4MERDQkFGNSwweDAwRDkxNjc5fSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgezB4ODBEOTRCQUYsMHgwMEQ1QjdFN30sCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHsweDgwRTEzNzM5LDB4MDBERDdDRDN9LAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB7MHg4MERDQkFGNSwweDAwRDkxNjc5fSwgIC8qIDQ4a1MvcyAqLwotCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHsweDg1ODc1MTNELDB4MDU1QzIyQ0Z9LCAgLyogOGtTL3MgICovICAgIC8qIExWUFNBX1NQRUVEX01FRElVTSAgICAgICovCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHsweDg1OUQyOTY3LDB4MDU3MEYwMDd9LAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB7MHg4NUUyRUZBQywweDA1QjM0RDc5fSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgezB4ODU4NzUxM0QsMHgwNTVDMjJDRn0sCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHsweDg2MDBDN0I5LDB4MDVDRkE2Q0Z9LAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB7MHg4NUUyRUZBQywweDA1QjM0RDc5fSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgezB4ODVDQzEwMTgsMHgwNTlEOEY2OX0sCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHsweDg2MDBDN0I5LDB4MDVDRkE2Q0Z9LC8vezB4ODYwMEM3QjksMHgwNUNGQTZDRn0sCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHsweDg1RTJFRkFDLDB4MDVCMzRENzl9LCAgLyogNDhrUy9zICovCi0KLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgezB4QTExNUVBN0EsMHgxQ0RCM0Y1Q30sICAvKiA4a1MvcyAgKi8gICAvKiBMVlBTQV9TUEVFRF9ISUdIICAgICAgKi8KLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgezB4QTE4NDc1RjAsMHgxRDJDODNBMn0sCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHsweEEyRTFFOTUwLDB4MUUyQTUzMkV9LAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB7MHhBMTE1RUE3QSwweDFDREIzRjVDfSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgezB4QTM3NUIyQzYsMHgxRTk0M0JCQ30sCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHsweEEyRTFFOTUwLDB4MUUyQTUzMkV9LAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB7MHhBMjZGRjZCRCwweDFERDgxNTMwfSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgezB4QTM3NUIyQzYsMHgxRTk0M0JCQ30sCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHsweEEyRTFFOTUwLDB4MUUyQTUzMkV9fTsgLyogNDhrUy9zICovCi0KZGlmZiAtLWdpdCBhL21lZGlhL2xpYmVmZmVjdHMvbHZtL2xpYi9TdGVyZW9XaWRlbmluZy9saWIvTFZDUy5oIGIvbWVkaWEvbGliZWZmZWN0cy9sdm0vbGliL1N0ZXJlb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GlvbnMgdW5kZXIgdGhlIExpY2Vuc2UuCi0gKi8KLQotLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0vKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICBIZWFkZXIgZmlsZSBmb3IgdGhlIGFwcGxpY2F0aW9uIGxheWVyIGludGVyZmFjZSBvZiBDb25jZXJ0IFNvdW5kIGFuZCBDb25jZXJ0ICAgICAgICAqLwotLyogIFNvdW5kIEVYLiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICBUaGlzIGZpbGVzIGluY2x1ZGVzIGFsbCBkZWZpbml0aW9ucywgdHlwZXMsIHN0cnVjdHVyZXMgYW5kIGZ1bmN0aW9uICAgICAgICAgICAgICAgICAqLwotLyogIHByb3RvdHlwZXMgcmVxdWlyZWQgYnkgdGhlIGNhbGxpbmcgbGF5ZXIuIEFsbCBvdGhlciB0eXBlcywgc3RydWN0dXJlcyBhbmQgICAgICAgICAgICovCi0vKiAgZnVuY3Rpb25zIGFyZSBwcml2YXRlLiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0vKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICBOb3RlOiAxICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogID09PT09PT0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgVGhlIGFsZ29yaXRobSBjYW4gZXhlY3V0ZSBlaXRoZXIgd2l0aCBzZXBhcmF0ZSBpbnB1dCBhbmQgb3V0cHV0IGJ1ZmZlcnMgb3Igd2l0aCAgICAgKi8KLS8qICBhIGNvbW1vbiBidWZmZXIsIGkuZS4gdGhlIGRhdGEgaXMgcHJvY2Vzc2VkIGluLXBsYWNlLiBJZiB0aGUgYnVmZmVycyBhcmUgdGhlICAgICAgICAqLwotLyogIHNhbWUgdGhlbiB0aGUgTUlQcyB3aWxsIGJlIHNsaWdodGx5IGhpZ2hlciBhbmQgYW4gZXh0cmEgc3RlcmVvIHNjcmF0Y2ggYnVmZmVyIGlzICAgICovCi0vKiAgcmVxdWlyZWQuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0vKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICBOb3RlOiAyICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogID09PT09PT0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgVHdvIGRhdGEgZm9ybWF0cyBhcmUgc3VwcG9ydCBTdGVyZW8gYW5kIE1vbm8tSW4tU3RlcmVvLiBUaGUgZGF0YSBpcyBpbnRlcmxlYXZlZCBhcyAgKi8KLS8qICBmb2xsb3dzOiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogICAgICAgICAgICAgIEJ5dGUgT2Zmc2V0ICAgICAgICAgU3RlcmVvIElucHV0ICAgICAgICAgTW9uby1Jbi1TdGVyZW8gSW5wdXQgICAgICAgICAgICovCi0vKiAgICAgICAgICAgICAgPT09PT09PT09PT0gICAgICAgICA9PT09PT09PT09PT0gICAgICAgICA9PT09PT09PT09PT09PT09PT09PSAgICAgICAgICAgKi8KLS8qICAgICAgICAgICAgICAgICAgMCAgICAgICAgICAgICAgIExlZnQgU2FtcGxlICMxICAgICAgICAgIE1vbm8gU2FtcGxlICMxICAgICAgICAgICAgICAqLwotLyogICAgICAgICAgICAgICAgICAyICAgICAgICAgICAgICAgUmlnaHQgU2FtcGxlICMxICAgICAgICAgTW9ubyBTYW1wbGUgIzEgICAgICAgICAgICAgICovCi0vKiAgICAgICAgICAgICAgICAgIDQgICAgICAgICAgICAgICBMZWZ0IFNhbXBsZSAjMiAgICAgICAgICBNb25vIFNhbXBsZSAjMiAgICAgICAgICAgICAgKi8KLS8qICAgICAgICAgICAgICAgICAgNiAgICAgICAgICAgICAgIFJpZ2h0IFNhbXBsZSAjMiAgICAgICAgIE1vbm8gU2FtcGxlICMyICAgICAgICAgICAgICAqLwotLyogICAgICAgICAgICAgICAgICAuICAgICAgICAgICAgICAgICAgICAgIC4gICAgICAgICAgICAgICAgICAgICAuICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgICAgICAgICAgICAgICAgIC4gICAgICAgICAgICAgICAgICAgICAgLiAgICAgICAgICAgICAgICAgICAgIC4gICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogIE1vbm8gZm9ybWF0IGRhdGEgaXMgbm90IHN1cHBvcnRlZCwgdGhlIGNhbGxpbmcgcm91dGluZSBtdXN0IGNvbnZlcnQgYSBNb25vIHN0cmVhbSAgICovCi0vKiAgaW4gdG8gTW9uby1Jbi1TdGVyZW8gZm9ybWF0LiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0KLSNpZm5kZWYgTFZDU19ICi0jZGVmaW5lIExWQ1NfSAotCi0jaWZkZWYgX19jcGx1c3BsdXMKLWV4dGVybiAiQyIgewotI2VuZGlmIC8qIF9fY3BsdXNwbHVzICovCi0KLQotLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0vKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICBJbmNsdWRlcyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLQotI2luY2x1ZGUgIkxWTV9UeXBlcy5oIgotI2luY2x1ZGUgIkxWTV9Db21tb24uaCIKLQotCi0vKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLS8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogIERlZmluaXRpb25zICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotCi0vKiBNZW1vcnkgdGFibGUgKi8KLSNkZWZpbmUgTFZDU19NRU1SRUdJT05fUEVSU0lTVEVOVF9TTE9XX0RBVEEgICAgMCAgICAvKiBPZmZzZXQgdG8gdGhlIGluc3RhbmNlIG1lbW9yeSByZWdpb24gKi8KLSNkZWZpbmUgTFZDU19NRU1SRUdJT05fUEVSU0lTVEVOVF9GQVNUX0RBVEEgICAg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ioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotLyogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgVHlwZXMgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0KLS8qIEluc3RhbmNlIGhhbmRsZSAqLwotdHlwZWRlZiB2b2lkICpMVkNTX0hhbmRsZV90OwotCi0KLS8qIE9wZXJhdGluZyBtb2RlcyAqLwotdHlwZWRlZiBlbnVtCi17Ci0gICAgTFZDU19PRkYgPSAwLAotICAgIExWQ1NfT04gID0gMTUsCi0gICAgTFZDU19NQVggPSBMVk1fTUFYRU5VTQotfSBMVkNTX01vZGVzX2VuOwotCi0KLS8qIE1lbW9yeSBUeXBlcyAqLwotdHlwZWRlZiBlbnVtCi17Ci0gICAgTFZDU19TQ1JBVENIICAgICAgICA9IDAsCi0gICAgTFZDU19EQVRBICAgICAgICAgICA9IDEsCi0gICAgTFZDU19DT0VGRklDSUVOVCAgICA9IDIsCi0gICAgTFZDU19QRVJTSVNURU5UICAgICA9IDMsCi0gICAgTFZDU19NRU1PUllUWVBFX01BWCA9IExWTV9NQVhFTlVNCi19IExWQ1NfTWVtb3J5VHlwZXNfZW47Ci0KLQotLyogRnVuY3Rpb24gcmV0dXJuIHN0YXR1cyAqLwotdHlwZWRlZiBlbnVtCi17Ci0gICAgTFZDU19TVUNDRVNTICAgICAgICA9IDAsICAgICAgICAgIC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S8qCi0gKiBTcGVha2VyIENvZWZmaWNpZW50cyBUYWJsZQotICovCi10eXBlZGVmIHN0cnVjdAotewotICAgIHZvaWQgICAgKnBUYWJsZTE7Ci0gICAgdm9pZCAgICAqcFRhYmxlMjsKLSAgICB2b2lkICAgICpwVGFibGUzOwotICAgIHZvaWQgICAgKnBUYWJsZTQ7Ci0gICAgdm9pZCAgICAqcFRhYmxlNTsKLSAgICB2b2lkICAgICpwVGFibGU2OwotICAgIHZvaWQgICAgKnBUYWJsZTc7Ci0gICAgdm9pZCAgICAqcFRhYmxlODsKLX0gTFZDU19DU01TX0NvZWZfVGFibGVzX3Q7Ci0KLQotLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0vKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICBTdHJ1Y3R1cmVzICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLQotLyogTWVtb3J5IHJlZ2lvbiBkZWZpbml0aW9uICovCi10eXBlZGVmIHN0cnVjdAotewotICAgIExWTV9VSU5UMzIgICAgICAgICAgICAgIFNpemU7ICAgICAgICAgICAgICAgICAgIC8qIFJlZ2lvbiBzaXplIGluIGJ5dGVzICovCi0gICAgTFZDU19NZW1vcnlUeXBlc19lbiAgICAgVHlwZTsgICAgICAgICAgICAgICAgICAgLyogUmVnaW9uIHR5cGUgKi8KLSAgICB2b2lkICAgICAgICAgICAgICAgICAgICAqcEJhc2VBZGRyZXNzOyAgICAgICAgICAvKiBQb2ludGVyIHRvIHRoZSByZWdpb24gYmFzZSBhZGRyZXNzICovCi19IExWQ1NfTWVtb3J5UmVnaW9uX3Q7Ci0KLQotLyogTWVtb3J5IHRhYmxlIGNvbnRhaW5pbmcgdGhlIHJlZ2lvbiBkZWZpbml0aW9ucyAqLwotdHlwZWRlZiBzdHJ1Y3QKLXsKLSAgICBMVkNTX01lbW9yeVJlZ2lvbl90IFJlZ2lvbltMVkNTX05SX01FTU9SWV9SRUdJT05TXTsgLyogT25lIGRlZmluaXRpb24gZm9yIGVhY2ggcmVnaW9uICovCi19IExWQ1NfTWVtVGFiX3Q7Ci0KLQotLyogQ29uY2VydCBTb3VuZCBwYXJhbWV0ZXIgc3RydWN0dXJlICovCi10eXBlZGVmIHN0cnVjdAotewotICAgIExWQ1NfTW9kZXNfZW4gICAgICAgICAgIE9wZXJhdGluZ01vZGU7ICAgICAgICAgIC8qIEFsZ29yaXRobSBtb2RlICovCi0gICAgTFZDU19TcGVha2VyVHlwZV9lbiAgICAgU3BlYWtlclR5cGU7ICAgICAgICAgICAgLyogT3V0cHV0IGRldmljZSB0eXBlICovCi0gICAgTFZDU19Tb3VyY2VGb3JtYXRfZW4gICAgU291cmNlRm9ybWF0OyAgICAgICAgICAgLyogU291cmNlIGRhdGEgZm9ybWF0ICovCi0gICAgTFZNX01vZGVfZW4gICAgICAgICAgICAgQ29tcHJlc3Nvck1vZGU7ICAgICAgICAgLyogTm9uLUxpbmVhciBDb21wcmVzc29yIE1vZGUgKi8KLSAgICBMVk1fRnNfZW4gICAgICAgICAgICAgICBTYW1wbGVSYXRlOyAgICAgICAgICAgICAvKiBTYW1wbGluZyByYXRlICovCi0gICAgTFZNX0lOVDE2ICAgICAgICAgICAgICAgRWZmZWN0TGV2ZWw7ICAgICAgICAgICAgLyogRWZmZWN0IGxldmVsICovCi0gICAgTFZNX1VJTlQxNiAgICAgICAgICAgICAgUmV2ZXJiTGV2ZWw7ICAgICAgICAgICAgLyogUmV2ZXJiIGxldmVsIGluICUgKi8KLX0gTFZDU19QYXJhbXNfdDsKLQotCi0vKiBDb25jZXJ0IFNvdW5kIENhcGFiaWxpdHkgc3RydWN0dXJlICovCi10eXBlZGVmIHN0cnVjdAotewotICAgIC8qIEdlbmVyYWwgcGFyYW1ldGVycyAqLwotICAgIExWTV9VSU5UMTYgICAgICAgICAgICAgIE1heEJsb2NrU2l6ZTsgICAgICAgICAgIC8qIE1heGltdW0gYmxvY2sgc2l6ZSBpbiBzYW1wbGUgcGFpcnMgKi8KLQotICAgIC8qIENhbGxiYWNrIHBhcmFtZXRlcnMgKi8KLSAgICBMVk1fQ2FsbGJhY2sgICAgICAgICAgICBDYWxsQmFjazsgICAgICAgICAgICAgICAvKiBCdW5kbGUgY2FsbGJhY2sgKi8KLSAgICB2b2lkICAgICAgICAgICAgICAgICAgICAqcEJ1bmRsZUluc3RhbmNlOyAgICAgICAvKiBCdW5kbGUgaW5zdGFuY2UgaGFuZGxlICovCi0KLX0gTFZDU19DYXBhYmlsaXRpZXNfdDsKLQotCi0vKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLS8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogIEZ1bmN0aW9uIFByb3RvdHlwZXMgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotCi0vKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLS8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogRlVOQ1RJT046ICAgICAgICAgICAgICAgIExWQ1NfTWVtb3J5ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qIERFU0NSSVBUSU9OOiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogIFRoaXMgZnVuY3Rpb24gaXMgdXNlZCBmb3IgbWVtb3J5IGFsbG9jYXRpb24gYW5kIGZyZWUuIEl0IGNhbiBiZSBjYWxsZWQgaW4gICAgICAgICAgICovCi0vKiAgdHdvIHdheXM6ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogICAgICBoSW5zdGFuY2UgPSBOVUxMICAgICAgICAgICAgICAgIFJldHVybnMgdGhlIG1lbW9yeSByZXF1aXJlbWVudHMgICAgICAgICAgICAgICAgICovCi0vKiAgICAgIGhJbnN0YW5jZSA9IEluc3RhbmNlIGhhbmRsZSAgICAgUmV0dXJucyB0aGUgbWVtb3J5IHJlcXVpcmVtZW50cyBhbmQgICAgICAgICAgICAgKi8KLS8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBhbGxvY2F0ZWQgYmFzZSBhZGRyZXNzZXMgZm9yIHRoZSBpbnN0YW5jZSAgICAgICAqLwotLyogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgV2hlbiB0aGlzIGZ1bmN0aW9uIGlzIGNhbGxlZCBmb3IgbWVtb3J5IGFsbG9jYXRpb24gKGhJbnN0YW5jZT1OVUxMKSBpdCBpcyAgICAgICAgICAgKi8KLS8qICBwYXNzZWQgdGhlIGRlZmF1bHQgY2FwYWJpbGl0aWVzLCBvZiB0aGVzZSBvbmx5IHRoZSBidWZmZXIgcHJvY2Vzc2luZyBzZXR0aW5nIGlzICAgICAqLwotLyogIHVzZWQuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICBXaGVuIGNhbGxlZCBmb3IgbWVtb3J5IGFsbG9jYXRpb24gdGhlIG1lbW9yeSBiYXNlIGFkZHJlc3MgcG9pbnRlcnMgYXJlIE5VTEwgb24gICAgICAqLwotLyogIHJldHVybi4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICBXaGVuIHRoZSBmdW5jdGlvbiBpcyBjYWxsZWQgZm9yIGZyZWUgKGhJbnN0YW5jZSA9IEluc3RhbmNlIEhhbmRsZSkgdGhlICAgICAgICAgICAgICAqLwotLyogIGNhcGFiaWxpdGllcyBhcmUgaWdub3JlZCBhbmQgdGhlIG1lbW9yeSB0YWJsZSByZXR1cm5zIHRoZSBhbGxvY2F0ZWQgbWVtb3J5IGFuZCAgICAgICovCi0vKiAgYmFzZSBhZGRyZXNzZXMgdXNlZCBkdXJpbmcgaW5pdGlhbGlzYXRpb24uICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogUEFSQU1FVEVSUzogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgaEluc3RhbmNlICAgICAgICAgICAgICAgSW5zdGFuY2UgSGFuZGxlICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICBwTWVtb3J5VGFibGUgICAgICAgICAgICBQb2ludGVyIHRvIGFuIGVtcHR5IG1lbW9yeSBkZWZpbml0aW9uIHRhYmxlICAgICAgICAgICAgICAgICAqLwotLyogIHBDYXBhYmlsaXRpZXMgICAgICAgICAgIFBvaW50ZXIgdG8gdGhlIGRlZmF1bHQgY2FwYWJpbGl0ZXMgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qIFJFVFVSTlM6ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogIExWQ1NfU3VjY2VzcyAgICAgICAgICAgIFN1Y2NlZWRlZCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qIE5PVEVTOiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogIDEuICBUaGlzIGZ1bmN0aW9uIG1heSBiZSBpbnRlcnJ1cHRlZCBieSB0aGUgTFZDU19Qcm9jZXNzIGZ1bmN0aW9uICAgICAgICAgICAgICAgICAgICovCi0vKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotCi1MVkNTX1JldHVyblN0YXR1c19lbiBMVkNTX01lbW9yeShMVkNTX0hhbmRsZV90ICAgICAgICAgIGhJbnN0YW5jZSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIExWQ1NfTWVtVGFiX3QgICAgICAgICAgKnBNZW1vcnlUYWJsZSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIExWQ1NfQ2FwYWJpbGl0aWVzX3QgICAgKnBDYXBhYmlsaXRpZXMpOwotCi0KLS8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotLyogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiBGVU5DVElPTjogICAgICAgICAgICAgICAgTFZDU19Jbml0ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogREVTQ1JJUFRJT046ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgQ3JlYXRlIGFuZCBpbml0aWFsaXNhdGlvbiBmdW5jdGlvbiBmb3IgdGhlIENvbmNlcnQgU291bmQgbW9kdWxlICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogIFRoaXMgZnVuY3Rpb24gY2FuIGJlIHVzZWQgdG8gY3JlYXRlIGFuIGFsZ29yaXRobSBpbnN0YW5jZSBieSBjYWxsaW5nIHdpdGggICAgICAgICAgICovCi0vKiAgaEluc3RhbmNlIHNldCB0byBOVUxMLiBJbiB0aGlzIGNhc2UgdGhlIGFsZ29yaXRobSByZXR1cm5zIHRoZSBuZXcgaW5zdGFuY2UgICAgICAgICAgKi8KLS8qICBoYW5kbGUuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgVGhpcyBmdW5jdGlvbiBjYW4gYmUgdXNlZCB0byBmb3JjZSBhIGZ1bGwgcmUtaW5pdGlhbGlzYXRpb24gb2YgdGhlIGFsZ29yaXRobSAgICAgICAgKi8KLS8qICBieSBjYWxsaW5nIHdpdGggaEluc3RhbmNlID0gSW5zdGFuY2UgSGFuZGxlLiBJbiB0aGlzIGNhc2UgdGhlIG1lbW9yeSB0YWJsZSAgICAgICAgICAqLwotLyogIHNob3VsZCBiZSBjb3JyZWN0IGZvciB0aGUgaW5zdGFuY2UsIHRoaXMgY2FuIGJlIGVuc3VyZWQgYnkgY2FsbGluZyB0aGUgZnVuY3Rpb24gICAgICovCi0vKiAgTFZDU19NZW1vcnkgYmVmb3JlIGNhbGxpbmcgdGhpcyBmdW5jdGlvbi4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogUEFSQU1FVEVSUzogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgaEluc3RhbmNlICAgICAgICAgICAgICAgSW5zdGFuY2UgaGFuZGxlICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICBwTWVtb3J5VGFibGUgICAgICAgICAgICBQb2ludGVyIHRvIHRoZSBtZW1vcnkgZGVmaW5pdGlvbiB0YWJsZSAgICAgICAgICAgICAgICAgICAgICAqLwotLyogIHBDYXBhYmlsaXRpZXMgICAgICAgICAgIFBvaW50ZXIgdG8gdGhlIGluaXRpYWxpc2F0aW9uIGNhcGFiaWxpdGllcyAgICAgICAgICAgICAgICAgICovCi0vKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qIFJFVFVSTlM6ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogIExWQ1NfU3VjY2VzcyAgICAgICAgICAgIEluaXRpYWxpc2F0aW9uIHN1Y2NlZWRlZCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgTFZDU19BbGlnbm1lbnRFcnJvciAgICAgSW5zdGFuY2Ugb3Igc2NyYXRjaCBtZW1vcnkgb24gaW5jb3JyZWN0IGFsaWdubWVudCAgICAgICAgICAgKi8KLS8qICBMVkNTX051bGxBZGRyZXNzICAgICAgICBJbnN0YW5jZSBvciBzY3JhdGNoIG1lbW9yeSBoYXMgYSBOVUxMIHBvaW50ZXIgICAgICAgICAgICAgICAqLwotLyogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiBOT1RFUzogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICAxLiAgVGhlIGluc3RhbmNlIGhhbmRsZSBpcyB0aGUgcG9pbnRlciB0byB0aGUgYmFzZSBhZGRyZXNzIG9mIHRoZSBmaXJzdCBtZW1vcnkgICAgICAqLwotLyogICAgICByZWdpb24uICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgMi4gIFRoaXMgZnVuY3Rpb24gbXVzdCBub3QgYmUgaW50ZXJydXB0ZWQgYnkgdGhlIExWQ1NfUHJvY2VzcyBmdW5jdGlvbiAgICAgICAgICAgICAgKi8KLS8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0KLUxWQ1NfUmV0dXJuU3RhdHVzX2VuIExWQ1NfSW5pdChMVkNTX0hhbmRsZV90ICAgICAgICAgICAgKnBoSW5zdGFuY2UsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTFZDU19NZW1UYWJfdCAgICAgICAgICAgICpwTWVtb3J5VGFibGUsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTFZDU19DYXBhYmlsaXRpZXNfdCAgICAgICpwQ2FwYWJpbGl0aWVzKTsKLQotCi0vKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLS8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogRlVOQ1RJT046ICAgICAgICAgICAgICAgICBMVkNTX0dldFBhcmFtZXRlcnMgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qIERFU0NSSVBUSU9OOiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogIFJlcXVlc3QgdGhlIENvbmNlcnQgU291bmQgcGFyYW1ldGVycy4gVGhlIGN1cnJlbnQgcGFyYW1ldGVyIHNldCBpcyByZXR1cm5lZCAgICAgICAgICovCi0vKiAgdmlhIHRoZSBwYXJhbWV0ZXIgcG9pbnRlci4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogUEFSQU1FVEVSUzogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgaEluc3RhbmNlICAgICAgICAgICAgICAgIEluc3RhbmNlIGhhbmRsZSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICBwUGFyYW1zICAgICAgICAgICAgICAgICAgUG9pbnRlciB0byBhbiBlbXB0eSBwYXJhbWV0ZXIgc3RydWN0dXJlICAgICAgICAgICAgICAgICAgICAqLwotLyogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiBSRVRVUk5TOiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICBMVkNTX1N1Y2Nlc3MgICAgICAgICAgICAgQWx3YXlzIHN1Y2NlZWRzICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiBOT1RFUzogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICAxLiAgVGhpcyBmdW5jdGlvbiBtYXkgYmUgaW50ZXJydXB0ZWQgYnkgdGhlIExWQ1NfUHJvY2VzcyBmdW5jdGlvbiAgICAgICAgICAgICAgICAgICAqLwotLyogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLQotTFZDU19SZXR1cm5TdGF0dXNfZW4gTFZDU19HZXRQYXJhbWV0ZXJzKExWQ1NfSGFuZGxlX3QgICBoSW5zdGFuY2UsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTFZDU19QYXJhbXNfdCAgICpwUGFyYW1zKTsKLQotCi0vKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLS8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogRlVOQ1RJT046ICAgICAgICAgICAgICAgIExWQ1NfQ29udHJvbCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qIERFU0NSSVBUSU9OOiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogIFNldHMgb3IgY2hhbmdlcyB0aGUgQ29uY2VydCBTb3VuZCBwYXJhbWV0ZXJzLiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qIFBBUkFNRVRFUlM6ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogIGhJbnN0YW5jZSAgICAgICAgICAgICAgIEluc3RhbmNlIGhhbmRsZSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgcFBhcmFtcyAgICAgICAgICAgICAgICAgUG9pbnRlciB0byBhIHBhcmFtZXRlciBzdHJ1Y3R1cmUgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogUkVUVVJOUzogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgTFZDU19TdWNjZXNzICAgICAgICAgICAgU3VjY2VlZGVkICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogTk9URVM6ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgMS4gIFRoaXMgZnVuY3Rpb24gbXVzdCBub3QgYmUgaW50ZXJydXB0ZWQgYnkgdGhlIExWQ1NfUHJvY2VzcyBmdW5jdGlvbiAgICAgICAgICAgICAgKi8KLS8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0KLUxWQ1NfUmV0dXJuU3RhdHVzX2VuIExWQ1NfQ29udHJvbChMVkNTX0hhbmRsZV90ICAgICBoSW5zdGFuY2UsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTFZDU19QYXJhbXNfdCAgICAgKnBQYXJhbXMpOwotCi0KLS8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotLyogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiBGVU5DVElPTjogICAgICAgICAgICAgICAgTFZDU19Qcm9jZXNzICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogREVTQ1JJUFRJT046ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgUHJvY2VzcyBmdW5jdGlvbiBmb3IgdGhlIENvbmNlcnQgU291bmQgbW9kdWxlLiBUaGUgaW1wbGVtZW50YXRpb24gc3VwcG9ydHMgdHdvICAgICAgKi8KLS8qICB2YXJpYW50cyBvZiB0aGUgYWxnb3JpdGhtLCBvbmUgZm9yIGhlYWRwaG9uZXMgYW5kIG9uZSBmb3IgbW9iaWxlIHNwZWFrZXJzLiAgICAgICAgICAqLwotLyogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiBQQVJBTUVURVJTOiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICBoSW5zdGFuY2UgICAgICAgICAgICAgICBJbnN0YW5jZSBoYW5kbGUgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogIHBJbkRhdGEgICAgICAgICAgICAgICAgIFBvaW50ZXIgdG8gdGhlIGlucHV0IGRhdGEgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgcE91dERhdGEgICAgICAgICAgICAgICAgUG9pbnRlciB0byB0aGUgb3V0cHV0IGRhdGEgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICBOdW1TYW1wbGVzICAgICAgICAgICAgICBOdW1iZXIgb2Ygc2FtcGxlcyBpbiB0aGUgaW5wdXQgYnVmZmVyICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiBSRVRVUk5TOiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICBMVkNTX1N1Y2Nlc3MgICAgICAgICAgICBTdWNjZWVkZWQgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogIExWQ1NfVG9vTWFueVNhbXBsZXMgICAgIE51bVNhbXBsZXMgd2FzIGxhcmdlciB0aGFuIHRoZSBtYXhpbXVtIGJsb2NrIHNpemUgICAgICAgICAgICovCi0vKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qIE5PVEVTOiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLQotTFZDU19SZXR1cm5TdGF0dXNfZW4gTFZDU19Qcm9jZXNzKExWQ1NfSGFuZGxlX3QgICAgICAgICAgICAgaEluc3RhbmNlLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbnN0IExWTV9JTlQxNiAgICAgICAgICAgKnBJbkRhdGEsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTFZNX0lOVDE2ICAgICAgICAgICAgICAgICAqcE91dERhdGEsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTFZNX1VJTlQxNiAgICAgICAgICAgICAgICBOdW1TYW1wbGVzKTsKLQotCi0jaWZkZWYgX19jcGx1c3BsdXMKLX0KLSNlbmRpZiAvKiBfX2NwbHVzcGx1cyAqLwotCi0jZW5kaWYgIC8qIExWQ1NfSCAqLwpkaWZmIC0tZ2l0IGEvbWVkaWEvbGliZWZmZWN0cy9sdm0vbGliL1N0ZXJlb1dpZGVuaW5nL3NyYy9MVkNTX0J5cGFzc01peC5jIGIvbWVkaWEvbGliZWZmZWN0cy9sdm0vbGliL1N0ZXJlb1dpZGVuaW5nL3NyYy9MVkNTX0J5cGFzc01peC5jCmRlbGV0ZWQgZmlsZSBtb2RlIDEwMDY0NAppbmRleCAzZTQ4YzdlLi4wMDAwMDAwCi0tLSBhL21lZGlhL2xpYmVmZmVjdHMvbHZtL2xpYi9TdGVyZW9XaWRlbmluZy9zcmMvTFZDU19CeXBhc3NNaXguYworKysgL2Rldi9udWxsCkBAIC0xLDI5MyArMCwwIEBACi0vKgotICogQ29weXJpZ2h0IChDKSAyMDA0LTIwMTAgTlhQIFNvZnR3YXJlCi0gKiBDb3B5cmlnaHQgKEMpIDIwMTAgVGhlIEFuZHJvaWQgT3BlbiBTb3VyY2UgUHJvamVjdAotICoKLSAqIExpY2Vuc2VkIHVuZGVyIHRoZSBBcGFjaGUgTGljZW5zZSwgVmVyc2lvbiAyLjAgKHRoZSAiTGljZW5zZSIpOwotICogeW91IG1heSBub3QgdXNlIHRoaXMgZmlsZSBleGNlcHQgaW4gY29tcGxpYW5jZSB3aXRoIHRoZSBMaWNlbnNlLgotICogWW91IG1heSBvYnRhaW4gYSBjb3B5IG9mIHRoZSBMaWNlbnNlIGF0Ci0gKgotICogICAgICBodHRwOi8vd3d3LmFwYWNoZS5vcmcvbGljZW5zZXMvTElDRU5TRS0yLjAKLSAqCi0gKiBVbmxlc3MgcmVxdWlyZWQgYnkgYXBwbGljYWJsZSBsYXcgb3IgYWdyZWVkIHRvIGluIHdyaXRpbmcsIHNvZnR3YXJlCi0gKiBkaXN0cmlidXRlZCB1bmRlciB0aGUgTGljZW5zZSBpcyBkaXN0cmlidXRlZCBvbiBhbiAiQVMgSVMiIEJBU0lTLAotICogV0lUSE9VVCBXQVJSQU5USUVTIE9SIENPTkRJVElPTlMgT0YgQU5ZIEtJTkQsIGVpdGhlciBleHByZXNzIG9yIGltcGxpZWQuCi0gKiBTZWUgdGhlIExpY2Vuc2UgZm9yIHRoZSBzcGVjaWZpYyBsYW5ndWFnZSBnb3Zlcm5pbmcgcGVybWlzc2lvbnMgYW5kCi0gKiBsaW1pdGF0aW9ucyB1bmRlciB0aGUgTGljZW5zZS4KLSAqLwotCi0vKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotLyogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICBJbmNsdWRlcyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLQotI2luY2x1ZGUgIkxWQ1MuaCIKLSNpbmNsdWRlICJMVkNTX1ByaXZhdGUuaCIKLSNpbmNsdWRlICJMVkNTX0J5cGFzc01peC5oIgotI2luY2x1ZGUgIlZlY3RvckFyaXRobWV0aWMuaCIKLSNpbmNsdWRlICJMVkNTX1RhYmxlcy5oIgotCi0vKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLS8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogIEZ1bmN0aW9uIFByb3RvdHlwZXMgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotTFZNX0lOVDMyIExWQ1NfTWl4ZXJDYWxsYmFjayggICBMVkNTX0hhbmRsZV90ICAgaEluc3RhbmNlLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2b2lkICAgICAgICAgICAgKnBHZW5lcmFsUHVycG9zZSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTFZNX0lOVDE2ICAgICAgIENhbGxiYWNrUGFyYW0pOwotCi0vKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotLyogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qIEZVTkNUSU9OOiAgICAgICAgICAgICAgICBMVkNTX0J5cGFzc01peEluaXQgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogREVTQ1JJUFRJT046ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICBJbml0aWFsaXNlcyB0aGUgYnlwYXNzIG1peGVyIG1vZHVsZSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogIFRoZSBvdmVyYWxsIGdhaW4gb2YgdGhlIHByb2Nlc3NlZCBwYXRoIGlzIHNldCBieSB0aGUgZ2FpbnMgaW4gdGhlIGluZGl2aWR1YWwgICAgKi8KLS8qICBwcm9jZXNzaW5nIGJsb2NrcyBhbmQgYnkgdGhlIGVmZmVjdCBsZXZlbCBnYWluLiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogIFRoZSB1bnByb2Nlc3NlZCBwYXRoIG11c3QgaGF2ZSBtYXRjaGluZyBnYWluIGZvciB0aGUgcHJvY2Vzc2VkIHBhdGggdG8gZW5zdXJlICAgKi8KLS8qICBhcyB0aGV5IGFyZSBtaXhlZCB0b2dldGhlciB0aGUgY29ycmVjdCBlZmZlY3QgaXMgYWNoaWV2ZWQsIHRoaXMgaXMgdGhlIHZhbHVlICAgICovCi0vKiAgVW5wcm9jTG9zcy4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICBUaGUgb3ZlcmFsbCBnYWluIGlzIGNvcnJlY3RlZCBieSBhIGNvbWJpbmF0aW9uIG9mIGEgc2hpZnQgd2l0aCBzYXR1cmF0aW9uIGFuZCBhICovCi0vKiAgbGluZWFyIHNjYWxlciwgbG9zcy4gVGhlIGxvc3MgZW5zdXJlcyB0aGUgc3VtIGluIHRoZSBtaXhlciBkb2VzIG5vdCBzYXR1cmF0ZSAgICAqLwotLyogIGFuZCBhbHNvIGNvcnJlY3RzIGZvciBhbnkgZXhjZXNzIGdhaW4gaW4gdGhlIHNoaWZ0LiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiBQQVJBTUVURVJTOiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogIGhJbnN0YW5jZSAgICAgICAgICAgICAgIEluc3RhbmNlIEhhbmRsZSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICBwUGFyYW1zICAgICAgICAgICAgICAgICBJbml0aWFsaXNhdGlvbiBwYXJhbWV0ZXJzICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogUkVUVVJOUzogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICBMVkNTX1N1Y2Nlc3MgICAgICAgICAgICBBbHdheXMgc3VjY2VlZHMgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogTk9URVM6ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotCi1MVkNTX1JldHVyblN0YXR1c19lbiBMVkNTX0J5cGFzc01peEluaXQoTFZDU19IYW5kbGVfdCAgICAgICBoSW5zdGFuY2UsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTFZDU19QYXJhbXNfdCAgICAgICAqcFBhcmFtcykKLXsKLQotICAgIExWTV9VSU5UMTYgICAgICAgICAgT2Zmc2V0OwotICAgIExWTV9VSU5UMzIgICAgICAgICAgR2FpbjsKLSAgICBMVkNTX0luc3RhbmNlX3QgICAgICpwSW5zdGFuY2UgPSAoTFZDU19JbnN0YW5jZV90ICAqKWhJbnN0YW5jZTsKLSAgICBMVkNTX0J5cGFzc01peF90ICAgICpwQ29uZmlnICAgPSAoTFZDU19CeXBhc3NNaXhfdCAqKSZwSW5zdGFuY2UtPkJ5cGFzc01peDsKLSAgICBjb25zdCBHYWluX3QgICAgICAgICpwT3V0cHV0R2FpblRhYmxlOwotICAgIExWTV9JTlQzMiAgICAgICAgICAgQ3VycmVudDsKLQotCi0gICAgLyoKLSAgICAgKiBTZXQgdGhlIHRyYW5zaXRpb24gZ2FpbgotICAgICAqLwotICAgIGlmICgocFBhcmFtcy0+T3BlcmF0aW5nTW9kZSA9PSBMVkNTX09OKSAmJgotICAgICAgICAocEluc3RhbmNlLT5iVGltZXJEb25lID09IExWTV9UUlVFKQotICAgICAgICAmJiAocEluc3RhbmNlLT5NU1RhcmdldDEgIT0gMHg3RkZGKSAvKiB0aGlzIGluZGljYXRlcyBhbiBvZmYtPm9uIHRyYW5zdGlvbiAqLwotICAgICAgICApCi0gICAgewotICAgICAgICBwSW5zdGFuY2UtPlRyYW5zaXRpb25HYWluID0gcFBhcmFtcy0+RWZmZWN0TGV2ZWw7Ci0gICAgfQotICAgIGVsc2UKLSAgICB7Ci0gICAgICAgIC8qIFNlbGVjdCBubyBlZmZlY3QgbGV2ZWwgKi8KLSAgICAgICAgcEluc3RhbmNlLT5UcmFuc2l0aW9uR2FpbiA9IDA7Ci0gICAgfQotCi0gICAgLyoKLSAgICAgKiBDYWxjdWxhdGUgdGhlIG91dHB1dCBnYWluIHRhYmxlIG9mZnNldAotICAgICAqLwotICAgIE9mZnNldCA9IChMVk1fVUlOVDE2KShwUGFyYW1zLT5TcGVha2VyVHlwZSArIChwUGFyYW1zLT5Tb3VyY2VGb3JtYXQqKDErTFZDU19FWF9IRUFEUEhPTkVTKSkpOwotICAgIHBPdXRwdXRHYWluVGFibGUgPSAoR2Fpbl90KikmTFZDU19PdXRwdXRHYWluVGFibGVbMF07Ci0KLSAgICAvKgotICAgICAqIFNldHVwIHRoZSBtaXh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ICAgICAqIENvcnJlY3QgZ2FpbiBmb3IgdGhlIGVmZmVjdCBsZXZlbAotICAgICAqLwotICAgIHsKLQotICAgICAgICBMVk1fSU5UMTYgICAgICAgICAgIEdhaW5Db3JyZWN0OwotICAgICAgICBMVk1fSU5UMzIgICAgICAgICAgIEdhaW4xOwotICAgICAgICBMVk1fSU5UMzIgICAgICAgICAgIEdhaW4yOwotCi0gICAgICAgIEdhaW4xID0gTFZDX01peGVyX0dldFRhcmdldCgmcENvbmZpZy0+TWl4ZXJfSW5zdGFuY2UuTWl4ZXJTdHJlYW1bMF0pOwotICAgICAgICBHYWluMiA9IExWQ19NaXhlcl9HZXRUYXJnZXQoJnBDb25maWctPk1peGVyX0luc3RhbmNlLk1peGVyU3RyZWFtWzFdKTsKLSAgICAgICAgLyoKLSAgICAgICAgICogQ2FsY3VsYXRlIHRoZSBnYWluIGNvcnJlY3Rpb24KLSAgICAgICAgICovCi0gICAgICAgIGlmIChwSW5zdGFuY2UtPlBhcmFtcy5Db21wcmVzc29yTW9kZSA9PSBMVk1fTU9ERV9PTikKLSAgICAgICAgewotICAgICAgICBHYWluQ29ycmVjdCA9IChMVk1fSU5UMTYpKCAgcEluc3RhbmNlLT5Wb2xDb3JyZWN0LkdhaW5NaW4KLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC0gKCgoTFZNX0lOVDMyKXBJbnN0YW5jZS0+Vm9sQ29ycmVjdC5HYWluTWluICogKExWTV9JTlQzMilwSW5zdGFuY2UtPlRyYW5zaXRpb25HYWluKSA+PiAxNSkKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICsgKCgoTFZNX0lOVDMyKXBJbnN0YW5jZS0+Vm9sQ29ycmVjdC5HYWluRnVsbCAqIChMVk1fSU5UMzIpcEluc3RhbmNlLT5UcmFuc2l0aW9uR2FpbikgPj4gMTUpICk7Ci0KLSAgICAgICAgLyoKLSAgICAgICAgICogQXBwbHkgdGhlIGdhaW4gY29ycmVjdGlv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DQ0VTUyk7Ci0KLX0KLQotLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLS8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiBGVU5DVElPTjogICAgICAgICAgICAgICAgTFZDU19CeXBhc3NNaXhlciAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qIERFU0NSSVBUSU9OOiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgQXBwbHkgQnlwYXNzIE1peC4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICBUaGlzIG1peGVzIHRoZSBwcm9jZXNzZWQgYW5kIHVucHJvY2Vzc2VkIGRhdGEgc3RyZWFtcyB0b2dldGhlciB0byBjb3JyZWN0IHRoZSAgICovCi0vKiAgb3ZlcmFsbCBzeXN0ZW0gZ2FpbiBhbmQgYWxsb3cgcHJvZ3Jlc3NpdmUgY29udHJvbCBvZiB0aGUgQ29uY2VydCBTb3VuZCBlZmZlY3QuICAqLwotLyogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICBXaGVuIHRoZSBieXBhc3MgbWl4ZXIgaXMgZW5hYmxlZCB0aGUgb3V0cHV0IGlzIHRoZSBwcm9jZXNzZWQgc2lnbmFsIG9ubHkgYW5kICAgICovCi0vKiAgd2l0aG91dCBnYWluIGNvcnJlY3Rpb24uICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qIFBBUkFNRVRFUlM6ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgaEluc3RhbmNlICAgICAgICAgICAgICAgSW5zdGFuY2UgSGFuZGxlICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogIHBQcm9jZXNzZWQgICAgICAgICAgICAgIFBvaW50ZXIgdG8gdGhlIHByb2Nlc3NlZCBkYXRhICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICBwVW5wcm9jZXNzZWQgICAgICAgICAgICBQb2ludGVyIHRvIHRoZSB1bnByb2Nlc3NlZCBkYXRhICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgcE91dERhdGEgICAgICAgICAgICAgICAgUG9pbnRlciB0byB0aGUgb3V0cHV0IGRhdGEgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogIE51bVNhbXBsZXMgICAgICAgICAgICAgIE51bWJlciBvZiBzYW1wbGVzIHRvIHByb2Nlc3MgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiBSRVRVUk5TOiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogIExWQ1NfU3VjY2VzcyAgICAgICAgICAgIEFsd2F5cyBzdWNjZWVkcyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiBOT1RFUzogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0KLUxWQ1NfUmV0dXJuU3RhdHVzX2VuIExWQ1NfQnlwYXNzTWl4ZXIoTFZDU19IYW5kbGVfdCAgICAgICAgIGhJbnN0YW5jZSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY29uc3QgTFZNX0lOVDE2ICAgICAgICpwUHJvY2Vzc2VkLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb25zdCBMVk1fSU5UMTYgICAgICAgKnBVbnByb2Nlc3NlZCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTFZNX0lOVDE2ICAgICAgICAgICAgICpwT3V0RGF0YSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTFZNX1VJTlQxNiAgICAgICAgICAgIE51bVNhbXBsZXMpCi17Ci0KLSAgICBMVkNTX0luc3RhbmNlX3QgICAgICpwSW5zdGFuY2UgICAgICA9IChMVkNTX0luc3RhbmNlX3QgICopaEluc3RhbmNlOwotICAgIExWQ1NfQnlwYXNzTWl4X3QgICAgKnBDb25maWcgICAgICAgID0gKExWQ1NfQnlwYXNzTWl4X3QgKikmcEluc3RhbmNlLT5CeXBhc3NNaXg7Ci0KLSAgICAvKgotICAgICAqIENoZWNrIGlmIHRoZSBieXBhc3MgbWl4ZXIgaXMgZW5hYmxlZAotICAgICAqLwotICAgIGlmICgocEluc3RhbmNlLT5QYXJhbXMuT3BlcmF0aW5nTW9kZSAmIExWQ1NfQllQQVNTTUlYU1dJVENIKSAhPSAwKQotICAgIHsKLSAgICAgICAgLyoKLSAgICAgICAgICogQXBwbHkgdGhlIGJ5cGFzcyBtaXgKLSAgICAgICAgICovCi0gICAgICAgIExWQ19NaXhTb2Z0XzJTdF9EMTZDMzFfU0FUKCZwQ29uZmlnLT5NaXhlcl9JbnN0YW5jZSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwUHJvY2Vzc2VkLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChMVk1fSU5UMTYgKikgcFVucHJvY2Vzc2VkLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBPdXREYXRhLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChMVk1fSU5UMTYpKDIqTnVtU2FtcGxlcykpOwotCi0gICAgICAgIC8qCi0gICAgICAgICAqIEFwcGx5IG91dHB1dCBnYWluIGNvcnJlY3Rpb24gc2hpZnQKLSAgICAgICAgICovCi0gICAgICAgIFNoaWZ0X1NhdF92MTZ4djE2ICgoTFZNX0lOVDE2KXBDb25maWctPk91dHB1dF9TaGlmdCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgKExWTV9JTlQxNiopcE91dERhdGEsCi0gICAgICAgICAgICAgICAgICAgICAgICAgIChMVk1fSU5UMTYqKXBPdXREYXRhLAotICAgICAgICAgICAgICAgICAgICAgICAgICAoTFZNX0lOVDE2KSgyKk51bVNhbXBsZXMpKTsgICAgICAgICAgLyogTGVmdCBhbmQgcmlnaHQqLwotICAgIH0KLQotICAgIHJldHVybihMVkNTX1NVQ0NFU1MpOwotfQotCi0KLS8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0vKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogRlVOQ1RJT046ICAgICAgICAgICAgICAgIExWQ1NfTWl4ZXJDYWxsYmFjayAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotTFZNX0lOVDMyIExWQ1NfTWl4ZXJDYWxsYmFjayhMVkNTX0hhbmRsZV90ICAgICAgaEluc3RhbmNlLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZvaWQgICAgICAgICAgICAgICAgKnBHZW5lcmFsUHVycG9zZSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBMVk1fSU5UMTYgICAgICAgICAgIENhbGxiYWNrUGFyYW0pCi17Ci0gICAgTFZDU19JbnN0YW5jZV90ICAgICAqcEluc3RhbmNlID0gKExWQ1NfSW5zdGFuY2VfdCAgKiloSW5zdGFuY2U7Ci0KLSAgICh2b2lkKXBHZW5lcmFsUHVycG9zZTsKLQotICAgIC8qCi0gICAgICogT2ZmIHRyYW5zaXRpb24gaGFzIGNvbXBsZXRlZCBpbiBIZWFkcGhvbmUgbW9kZQotICAgICAqLwotICAgIGlmICgocEluc3RhbmNlLT5PdXRwdXREZXZpY2UgPT0gTFZDU19IRUFEUEhPTkUpICYmCi0gICAgICAgIChwSW5zdGFuY2UtPmJJbk9wZXJhdGluZ01vZGVUcmFuc2l0aW9uKSAgICAgJiYKLSAgICAgICAgKHBJbnN0YW5jZS0+TVNUYXJnZXQwID09IDB4MDAwMCkmJiAgLyogdGhpcyBpbmRpY2F0ZXMgYW4gb24tPm9mZiB0cmFuc2l0aW9uICovCi0gICAgICAgIChDYWxsYmFja1BhcmFtID09IDApKQotICAgIHsKLSAgICAgICAgLyogU2V0IG9wZXJhdGluZyBtb2RlIHRvIE9GRiAqLwotICAgICAgICBwSW5zdGFuY2UtPlBhcmFtcy5PcGVyYXRpbmdNb2RlID0gTFZDU19PRkY7Ci0KLSAgICAgICAgLyogRXhpdCB0cmFuc2l0aW9uIHN0YXRlICovCi0gICAgICAgIHBJbnN0YW5jZS0+YkluT3BlcmF0aW5nTW9kZVRyYW5zaXRpb24gPSBMVk1fRkFMU0U7Ci0KLSAgICAgICAgLyogU2lnbmFsIHRvIHRoZSBidW5kbGUgKi8KLSAgICAgICAgaWYoKCpwSW5zdGFuY2UtPkNhcGFiaWxpdGllcy5DYWxsQmFjaykgIT0gTFZNX05VTEwpewotICAgICAgICAgICAgKCpwSW5zdGFuY2UtPkNhcGFiaWxpdGllcy5DYWxsQmFjaykocEluc3RhbmNlLT5DYXBhYmlsaXRpZXMucEJ1bmRsZUluc3RhbmNlLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTFZNX05VTEwsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoQUxHT1JJVEhNX0NTX0lEIHwgTFZDU19FVkVOVF9BTEdPRkYpKTsKLSAgICAgICAgfQotICAgIH0KLQotCi0gICAgaWYgKChwSW5zdGFuY2UtPk91dHB1dERldmljZSA9PSBMVkNTX0hFQURQSE9ORSkgICYmCi0gICAgICAgIChwSW5zdGFuY2UtPk1TVGFyZ2V0MCA9PSAxKSAmJgotICAgICAgICAocEluc3RhbmNlLT5iVGltZXJEb25lID09IExWTV9UUl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G9yIGFncmVlZCB0byBpbiB3cml0aW5nLCBzb2Z0d2FyZQotICogZGlzdHJpYnV0ZWQgdW5kZXIgdGhlIExpY2Vuc2UgaXMgZGlzdHJpYnV0ZWQgb24gYW4gIkFTIElTIiBCQVNJUywKLSAqIFdJVEhPVVQgV0FSUkFOVElFUyBPUiBDT05ESVRJT05TIE9GIEFOWSBLSU5ELCBlaXRoZXIgZXhwcmVzcyBvciBpbXBsaWVkLgotICogU2VlIHRoZSBMaWNlbnNlIGZvciB0aGUgc3BlY2lmaWMgbGFuZ3VhZ2UgZ292ZXJuaW5nIHBlcm1pc3Npb25zIGFuZAotICogbGltaXRhdGlvbnMgdW5kZXIgdGhlIExpY2Vuc2UuCi0gKi8KLQotI2lmbmRlZiBfX0xWQ1NfQllQQVNTTUlYX0hfXwotI2RlZmluZSBfX0xWQ1NfQllQQVNTTUlYX0hfXwotCi0jaWZkZWYgX19jcGx1c3BsdXMKLWV4dGVybiAiQyIgewotI2VuZGlmIC8qIF9fY3BsdXNwbHVzICovCi0KLQotLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLS8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgICBJbmNsdWRlcyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0KLSNpbmNsdWRlICJMVkNfTWl4ZXIuaCIKLQotCi0vKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotLyogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICAgIFN0cnVjdHVyZXMgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLQotLyogQnlwYXNzIG1peGVyIHN0cnVjdHVyZSAqLwotdHlwZWRlZiBzdHJ1Y3QKLXsKLSAgICAvKiBNaXhlciBzZXR0aW5ncyAqLwotICAgIExWTWl4ZXIzXzJTdF9zdCAgICAgICAgIE1peGVyX0luc3RhbmNlOyAgICAgICAgICAgICAvKiBNaXhlciBpbnN0YW5jZSAqLwotICAgIExWTV9VSU5UMTYgICAgICAgICAgICAgIE91dHB1dF9TaGlmdDsgICAgICAgICAgICAgICAvKiBDb3JyZWN0aW5nIGdhaW4gb3V0cHV0IHNoaWZ0ICovCi0KLX0gTFZDU19CeXBhc3NNaXhfdDsKLQotCi0vKiBPdXRwdXQgZ2FpbiB0eXBlICovCi10eXBlZGVmIHN0cnVjdAotewotICAgIC8qIE91dHB1dCBnYWluIHNldHRpbmdzLCBHYWluID0gKExvc3MvMzI3NjgpICogMl5TaGlmdCAqLwotICAgIExWTV9VSU5UMTYgICAgICAgICAgICAgIFNoaWZ0OyAgICAgICAgICAgICAgICAgICAgICAvKiBMZWZ0IHNoaWZ0cyByZXF1aXJlZCAqLwotICAgIExWTV9VSU5UMTYgICAgICAgICAgICAgIExvc3M7ICAgICAgICAgICAgICAgICAgICAgICAvKiBMb3NzIHJlcXVpcmVkICovCi0gICAgTFZNX1VJTlQxNiAgICAgICAgICAgICAgVW5wcm9jTG9zczsgICAgICAgICAgICAgICAgIC8qIFVucHJvY2Vzc2VkIHBhdGggbG9zcyAqLwotfSBHYWluX3Q7Ci0KLQotLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLS8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICAgIEZ1bmN0aW9uIHByb3RvdHlwZXMgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0KLUxWQ1NfUmV0dXJuU3RhdHVzX2VuIExWQ1NfQnlwYXNzTWl4SW5pdChMVkNTX0hhbmRsZV90ICAgICAgIGhJbnN0YW5jZSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBMVkNTX1BhcmFtc190ICAgICpwUGFyYW1zKTsKLQotCi1MVkNTX1JldHVyblN0YXR1c19lbiBMVkNTX0J5cGFzc01peGVyKExWQ1NfSGFuZGxlX3QgICAgICAgICBoSW5zdGFuY2UsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbnN0IExWTV9JTlQxNiAgICAgICAqcFByb2Nlc3NlZCwKLSAgICAgICAgICAgIC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biBhIGNvcHkgb2YgdGhlIExpY2Vuc2UgYXQKLSAqCi0gKiAgICAgIGh0dHA6Ly93d3cuYXBhY2hlLm9yZy9saWNlbnNlcy9MSUNFTlNFLTIuMAotICoKLSAqIFVubGVzcyByZXF1aXJlZCBieSBhcHBsaWNhYmxlIGxhdyBvciBhZ3JlZWQgdG8gaW4gd3JpdGluZywgc29mdHdhcmUKLSAqIGRpc3RyaWJ1dGVkIHVuZGVyIHRoZSBMaWNlbnNlIGlzIGRpc3RyaWJ1dGVkIG9uIGFuICJBUyBJUyIgQkFTSVMsCi0gKiBXSVRIT1VUIFdBUlJBTlRJRVMgT1IgQ09ORElUSU9OUyBPRiBBTlkgS0lORCwgZWl0aGVyIGV4cHJlc3Mgb3IgaW1wbGllZC4KLSAqIFNlZSB0aGUgTGljZW5zZSBmb3IgdGhlIHNwZWNpZmljIGxhbmd1YWdlIGdvdmVybmluZyBwZXJtaXNzaW9ucyBhbmQKLSAqIGxpbWl0YXRpb25zIHVuZGVyIHRoZSBMaWNlbnNlLgotICovCi0KLS8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0vKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogIEluY2x1ZGVzICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotCi0jaW5jbHVkZSAiTFZDUy5oIgotI2luY2x1ZGUgIkxWQ1NfUHJpdmF0ZS5oIgotI2luY2x1ZGUgIkxWQ1NfVGFibGVzLmgiCi0KLS8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0vKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogRlVOQ1RJT046ICAgICAgICAgICAgICAgICBMVkNTX0dldFBhcmFtZXRlcnMgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiBERVNDUklQVElPTjogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogIFJlcXVlc3QgdGhlIENvbmNlcnQgU291bmQgcGFyYW1ldGVycy4gVGhlIGN1cnJlbnQgcGFyYW1ldGVyIHNldCBpcyByZXR1cm5lZCAgICAgKi8KLS8qICB2aWEgdGhlIHBhcmFtZXRlciBwb2ludGVyLiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogUEFSQU1FVEVSUzogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICBoSW5zdGFuY2UgICAgICAgICAgICAgICAgSW5zdGFuY2UgaGFuZGxlICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgcFBhcmFtcyAgICAgICAgICAgICAgICAgIFBvaW50ZXIgdG8gYW4gZW1wdHkgcGFyYW1ldGVyIHN0cnVjdHVyZSAgICAgICAgICAgICAgICAqLwotLyogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qIFJFVFVSTlM6ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgTFZDU19TdWNjZXNzICAgICAgICAgICAgIEFsd2F5cyBzdWNjZWVkcyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qIE5PVEVTOiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgMS4gIFRoaXMgZnVuY3Rpb24gbWF5IGJlIGludGVycnVwdGVkIGJ5IHRoZSBMVkNTX1Byb2Nlc3MgZnVuY3Rpb24gICAgICAgICAgICAgICAqLwotLyogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0KLUxWQ1NfUmV0dXJuU3RhdHVzX2VuIExWQ1NfR2V0UGFyYW1ldGVycyhMVkNTX0hhbmRsZV90ICAgaEluc3RhbmNlLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIExWQ1NfUGFyYW1zX3QgICAqcFBhcmFtcykKLXsKLQotICAgIExWQ1NfSW5zdGFuY2VfdCAgICAgKnBJbnN0YW5jZSA9KExWQ1NfSW5zdGFuY2VfdCAgKiloSW5zdGFuY2U7Ci0KLSAgICAqcFBhcmFtcyA9IHBJbnN0YW5jZS0+UGFyYW1zOwotCi0gICAgcmV0dXJuKExWQ1NfU1VDQ0VTUyk7Ci19Ci0KLQotLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLS8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiBGVU5DVElPTjogICAgICAgICAgICAgICAgTFZDU19Db250cm9sICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qIERFU0NSSVBUSU9OOiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgU2V0cyBvciBjaGFuZ2VzIHRoZSBDb25jZXJ0IFNvdW5kIHBhcmFtZXRlcnMuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qIFBBUkFNRVRFUlM6ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgaEluc3RhbmNlICAgICAgICAgICAgICAgSW5zdGFuY2UgaGFuZGxlICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogIHBQYXJhbXMgICAgICAgICAgICAgICAgIFBvaW50ZXIgdG8gYSBwYXJhbWV0ZXIgc3RydWN0dXJlICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiBSRVRVUk5TOiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogIExWQ1NfU3VjY2VzcyAgICAgICAgICAgIFN1Y2NlZWRlZCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiBOT1RFUzogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogIDEuICBUaGlzIGZ1bmN0aW9uIG11c3Qgbm90IGJlIGludGVycnVwdGVkIGJ5IHRoZSBMVkNTX1Byb2Nlc3MgZnVuY3Rpb24gICAgICAgICAgKi8KLS8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotCi1MVkNTX1JldHVyblN0YXR1c19lbiBMVkNTX0NvbnRyb2woTFZDU19IYW5kbGVfdCAgICAgIGhJbnN0YW5jZSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBMVkNTX1BhcmFtc190ICAgICAgKnBQYXJhbXMpCi17Ci0gICAgTFZNX0lOVDE2ICAgICAgICAgICAgICAgICAgIE9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otICAgIHsKLSAgICAgICAgY29uc3QgTFZDU19Wb2xDb3JyZWN0X3QgKnBMVkNTX1ZvbENvcnJlY3RUYWJsZTsKLQotICAgICAgICAvKgotICAgICAgICAgKiBPdXRwdXQgZGV2aWNlCi0gICAgICAgICAqLwotICAgICAgICBwSW5zdGFuY2UtPk91dHB1dERldmljZSA9IExWQ1NfSEVBRFBIT05FOwotCi0gICAgICAgIC8qCi0gICAgICAgICAqIEdldCB0aGUgdm9sdW1lIGNvcnJlY3Rpb24gcGFyYW1ldGVycwotICAgICAgICAgKi8KLSAgICAgICAgLyogVXNlIGludGVybmFsIGNvZWZmaWNpZW50IHRhYmxlICovCi0gICAgICAgIHBMVkNTX1ZvbENvcnJlY3RUYWJsZSA9IChMVkNTX1ZvbENvcnJlY3RfdCopJkxWQ1NfVm9sQ29ycmVjdFRhYmxlWzBdOwotICAgICAgICBPZmZzZXQgPSAoTFZNX0lOVDE2KShwUGFyYW1zLT5TcGVha2VyVHlwZSArIHBQYXJhbXMtPlNvdXJjZUZvcm1hdCooMStMVkNTX0VYX0hFQURQSE9ORVMpKTsKLQotICAgICAgICBwSW5zdGFuY2UtPlZvbENvcnJlY3QgPSBwTFZDU19Wb2xDb3JyZWN0VGFibGVbT2Zmc2V0XTsKLQotICAgICAgICBwSW5zdGFuY2UtPkNvbXByZXNzR2FpbiA9IHBJbnN0YW5jZS0+Vm9sQ29ycmVjdC5Db21wTWluOwotCi0gICAgICAgIExWQ19NaXhlcl9Jbml0KCZwSW5zdGFuY2UtPkJ5cGFzc01peC5NaXhlcl9JbnN0YW5jZS5NaXhlclN0cmVhbVswXSwwLDApOwotCi0KLSAgICAgICAgewotICAgICAgICAgICAgTFZNX1VJTlQzMiAgICAgICAgICBHYWluOwotICAgICAgICAgICAgY29uc3QgR2Fpbl90ICAgICAgICAqcE91dHB1dEdhaW5UYWJsZSA9IChHYWluX3QqKSZMVkNTX091dHB1dEdhaW5UYWJsZVswXTsKLSAgICAgICAgICAgIEdhaW4gPS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ICAgICAgICAgIHBJbnN0YW5jZS0+TVNUYXJnZXQxPUxWTV9NQVhJTlRfMTY7Ci0gICAgICAgICAgICBwSW5zdGFuY2UtPk1TVGFyZ2V0MD0wOwotICAgICAgICB9Ci0KLQotICAgICAgICAvKiBTZXQgdHJhbnNpdGlvbiBmbGFnICovCi0gICAgICAgIHBJbnN0YW5jZS0+YkluT3BlcmF0aW5nTW9kZVRyYW5zaXRpb24gPSBMVk1fVFJVRTsKLSAgICB9Ci0KLSAgICByZXR1cm4oTFZDU19TVUNDRVNTKTsKLX0KLQotLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0vKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qIEZVTkNUSU9OOiAgICAgICAgICAgICAgICBMVkNTX1RpbWVyQ2FsbEJhY2sgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiBERVNDUklQVElPTjogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICBDYWxsQmFjayBmdW5jdGlvbiBvZiB0aGUgVGltZXIuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKio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ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotCi0jaW5jbHVkZSAiTFZDUy5oIgotI2luY2x1ZGUgIkxWQ1NfUHJpdmF0ZS5oIgotI2luY2x1ZGUgIkxWQ1NfRXF1YWxpc2VyLmgiCi0jaW5jbHVkZSAiQklRVUFELmgiCi0jaW5jbHVkZSAiVmVjdG9yQXJpdGhtZXRpYy5oIgotI2luY2x1ZGUgIkxWQ1NfVGFibGVzLmgiCi0KLS8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0vKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogRlVOQ1RJT046ICAgICAgICAgICAgICAgIExWQ1NfRXF1YWxpc2VySW5pdCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiBERVNDUklQVElPTjogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogIEluaXRpYWxpc2VzIHRoZSBlcXVhbGlzZXIgbW9kdWxlICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgVGhlIGZ1bmN0aW9uIHNlbGVjdHMgdGhlIGNvZWZmaWNpZW50cyBmb3IgdGhlIGZpbHRlcnMgYW5kIGNsZWFycyB0aGUgZGF0YSAgICAgICAqLwotLyogIGhpc3RvcnkuIEl0IGlzIGFsc28gdXNlZCBmb3IgcmUtaW5pdGlhbGlzYXRpb24gd2hlbiBvbmUgb2YgdGhlIHN5c3RlbSBjb250cm9sICAgKi8KLS8qICBwYXJhbWV0ZXJzIGNoYW5nZXMgYnV0IHdpbGwgb25seSBjaGFuZ2UgdGhlIGNvZWZmaWNpZW50cyBhbmQgY2xlYXIgdGhlIGhpc3RvcnkgICovCi0vKiAgaWYgdGhlIHNhbXBsZSByYXRlIG9yIHNwZWFrZXIgdHlwZSBoYXMgY2hhbmdlZC4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICBUbyBhdm9pZCBleGNlc3NpdmUgdGVzdGluZyBkdXJpbmcgdGhlIHNhbXBsZSBwcm9jZXNzaW5nIHRoZSBiaXF1YWQgdHlwZSBpcyAgICAgICovCi0vKiAgc2V0IGFzIGEgY2FsbGJhY2sgZnVuY3Rpb24gaW4gdGhlIGluaXQgcm91dGluZS4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qIFBBUkFNRVRFUlM6ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgaEluc3RhbmNlICAgICAgICAgICAgICAgSW5zdGFuY2UgSGFuZGxlICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogIHBQYXJhbXMgICAgICAgICAgICAgICAgIEluaXRpYWxpc2F0aW9uIHBhcmFtZXRlcnMgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiBSRVRVUk5TOiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogIExWQ1NfU3VjY2VzcyAgICAgICAgICAgIEFsd2F5cyBzdWNjZWVkcyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiBOT1RFUzogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0KLUxWQ1NfUmV0dXJuU3RhdHVzX2VuIExWQ1NfRXF1YWxpc2VySW5pdChMVkNTX0hhbmRsZV90ICAgICAgIGhJbnN0YW5jZSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBMVkNTX1BhcmFtc190ICAgICAgICpwUGFyYW1zKQotewotCi0gICAgTFZNX1VJTlQxNiAgICAgICAgICBPZm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ci0gICAgICAgICAqLwotICAgICAgICBPZmZzZXQgPSAoTFZNX1VJTlQxNikocFBhcmFtcy0+U2FtcGxlUmF0ZSArIChwUGFyYW1zLT5TcGVha2VyVHlwZSAqICgxK0xWTV9GU180ODAwMCkpKTsKLSAgICAgICAgcEVxdWFsaXNlckNvZWZUYWJsZSA9IChCaXF1YWRBMDEyQjEyQ29lZnNTUF90KikmTFZDU19FcXVhbGlzZXJDb2VmVGFibGVbMF07Ci0KLSAgICAgICAgLyogTGVmdCBhbmQgcmlnaHQgZmlsdGVycyAqLwotICAgICAgICAvKiBDb252ZXJ0IGluY29taW5nIGNvZWZmaWNpZW50cyB0byB0aGUgcmVxdWlyZWQgZm9ybWF0L29yZGVyaW5nICovCi0gICAgICAgIENvZWZmcy5BMCA9IChMVk1fSU5UMTYpIHBFcXVhbGlzZXJDb2VmVGFibGVbT2Zmc2V0XS5BMDsKLSAgICAgICAgQ29lZmZzLkExID0gKExWTV9JTlQxNikgcEVxdWFsaXNlckNvZWZUYWJsZVtPZmZzZXRdLkExOwotICAgICAgICBDb2VmZnMuQTIgPSAoTFZNX0lOVDE2KSBwRXF1YWxpc2VyQ29lZlRhYmxlW09mZnNldF0uQTI7Ci0gICAgICAgIENvZWZmcy5CMSA9IChMVk1fSU5UMTYpLXBFcXVhbGlzZXJDb2VmVGFibGVbT2Zmc2V0XS5CMTsKLSAgICAgICAgQ29lZmZzLkIyID0gKExWTV9JTlQxNiktcEVxdWFsaXNlckNvZWZUYWJsZVtPZmZzZXRdLkIyOwotCi0gICAgICAgIExvYWRDb25zdF8xNigoTFZNX0lOVDE2KTAsICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8qIFZhbHVlICovCi0gICAgICAgICAgICAgICAgICAgICAodm9pZCAqKSZwRGF0YS0+RXF1YWxpc2VyQmlxdWFkVGFwcywgICAvKiBEZXN0aW5hdGlvbiBDYXN0IHRvIHZvaWQ6XAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbm8gZGVyZWZlcmVuY2luZyBpbiBmdW5jdGlvbiovCi0gICAgICAgICAgICAgICAgICAgICAoTFZNX1VJTlQxNikoc2l6ZW9mKHBEYXRhLT5FcXVhbGlzZXJCaXF1YWRUYXBzKS9zaXplb2YoTFZNX0lOVDE2KSkpOyAgICAvKiBOdW1iZXIgb2Ygd29yZHMgKi8KLQotICAgICAgICBCUV8ySV9EMTZGMzJDc3NfVFJDX1dSQV8wMV9Jbml0KCZwQ29lZmZpY2llbnRzLT5FcXVhbGlzZXJCaXF1YWRJbnN0YW5jZSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmcERhdGEtPkVxdWFsaXNlckJpcXVhZFRhcHMsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJkNvZWZmcyk7Ci0KLSAgICAgICAgLyogQ2FsbGJhY2tzICovCi0gICAgICAgIHN3aXRjaChwRXF1YWxpc2VyQ29lZlRhYmxlW09mZnNldF0uU2NhbGUpCi0gICAgICAgIHsKLSAgICAgICAgICAgIGNhc2UgMTM6Ci0gICAgICAgICAgICAgICAgcENvbmZpZy0+cEJpcXVhZENhbGxCYWNrICA9IEJRXzJJX0QxNkYzMkMxM19UUkNfV1JBXzAxOwotICAgICAgICAgICAgICAgIGJyZWFrOwotICAgICAgICAgICAgY2FzZSAxNDoKLSAgICAgICAgICAgICAgICBwQ29uZmlnLT5wQmlxdWFkQ2FsbEJhY2sgID0gQlFfMklfRDE2RjMyQzE0X1RSQ19XUkFfMDE7Ci0gICAgICAgICAgICAgICAgYnJlYWs7Ci0gICAgICAgICAgICBjYXNlIDE1OgotICAgICAgICAgICAgICAgIHBDb25maWctPnBCaXF1YWRDYWxsQmFjayAgPSBCUV8ySV9EMTZGMzJDMTVfVFJDX1dSQV8wMTsKLSAgICAgICAgICAgICAgICBicmVhazsKLSAgICAgICAgfQotICAgIH0KLQotICAgIHJldHVybihMVkNTX1NVQ0NFU1MpOwotfQotCi0vKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotLyogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qIEZVTkNUSU9OOiAgICAgICAgICAgICAgICBMVkNTX0VxdWFsaXNlciAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogREVTQ1JJUFRJT046ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICBBcHBseSB0aGUgZXF1YWxpc2VyIGZpbHRlci4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogUEFSQU1FVEVSUzogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICBoSW5zdGFuY2UgICAgICAgICAgICAgICBJbnN0YW5jZSBIYW5kbGUgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgcElucHV0T3V0cHV0ICAgICAgICAgICAgUG9pbnRlciB0byB0aGUgaW5wdXQvb3V0cHV0IGJ1ZmZlciAgICAgICAgICAgICAgICAgICAgICAqLwotLyogIE51bVNhbXBsZXMgICAgICAgICAgICAgIFRoZSBudW1iZXIgb2Ygc2FtcGxlcyB0byBwcm9jZXNzICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiBSRVRVUk5TOiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogIExWQ1NfU3VjY2VzcyAgICAgICAgICAgIEFsd2F5cyBzdWNjZWVkcyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiBOT1RFUzogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogIDEuICBBbHdheXMgcHJvY2Vzc2VzIGluIHBsYWNlLiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotCi1MVkNTX1JldHVyblN0YXR1c19lbiBMVkNTX0VxdWFsaXNlcihMVkNTX0hhbmRsZV90ICAgICAgIGhJbnN0YW5jZSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIExWTV9JTlQxNiAgICAgICAgICAgKnBJbnB1dE91dHB1dCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIExWTV9VSU5UMTYgICAgICAgICAgTnVtU2Ft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ORElUSU9OUyBPRiBBTlkgS0lORCwgZWl0aGVyIGV4cHJlc3Mgb3IgaW1wbGllZC4KLSAqIFNlZSB0aGUgTGljZW5zZSBmb3IgdGhlIHNwZWNpZmljIGxhbmd1YWdlIGdvdmVybmluZyBwZXJtaXNzaW9ucyBhbmQKLSAqIGxpbWl0YXRpb25zIHVuZGVyIHRoZSBMaWNlbnNlLgotICovCi0KLSNpZm5kZWYgX19MVkNTX0VRVUFMSVNFUl9IX18KLSNkZWZpbmUgX19MVkNTX0VRVUFMSVNFUl9IX18KLQotI2lmZGVmIF9fY3BsdXNwbHVzCi1leHRlcm4gIkMiIHsKLSNlbmRpZiAvKiBfX2NwbHVzcGx1cyAqLwotCi0KLS8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0vKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogICAgU3RydWN0dXJlcyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotCi0vKiBFcXVhbGlzZXIgc3RydWN0dXJlICovCi10eXBlZGVmIHN0cnVjdAotewotICAgIHZvaWQgKCpwQmlxdWFkQ2FsbEJhY2spIChCaXF1YWRfSW5zdGFuY2VfdCosIExWTV9JTlQxNiosIExWTV9JTlQxNiosIExWTV9JTlQxNik7Ci0KLX0gTFZDU19FcXVhbGlzZXJfdDsKLQotCi0vKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotLyogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICAgIEZ1bmN0aW9uIHByb3RvdHlwZXMgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLQotTFZDU19SZXR1cm5TdGF0dXNfZW4gTFZDU19FcXVhbGlzZXJJbml0KExWQ1NfSGFuZGxlX3QgICAgICAgaEluc3RhbmNlLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIExWQ1NfUGFyYW1zX3QgICAgICAgKnBQYXJhbXMpOwotCi1MVkNTX1JldHVyblN0YXR1c19lbiBMVkNTX0VxdWFsaXNlcihMVkNTX0hhbmRsZV90ICAgICAgICAgICAgaEluc3RhbmNlLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTFZNX0lOVDE2ICAgICAgICAgICAgICAgICpwSW5wdXRPdXRwdXQsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBMVk1fVUlOVDE2ICAgICAgICAgICAgICAgIE51bVNhbXBsZXMpOwotCi0KLSNpZmRlZiBfX2NwbHVzcGx1cwotfQotI2VuZGlmIC8qIF9fY3BsdXNwbHVzICovCi0KLSNlbmRpZiAgLyogRVFVQUxJU0VSX0ggKi8KZGlmZiAtLWdpdCBhL21lZGlhL2xpYmVmZmVjdHMvbHZtL2xpY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CBlaXRoZXIgZXhwcmVzcyBvciBpbXBsaWVkLgotICogU2VlIHRoZSBMaWNlbnNlIGZvciB0aGUgc3BlY2lmaWMgbGFuZ3VhZ2UgZ292ZXJuaW5nIHBlcm1pc3Npb25zIGFuZAotICogbGltaXRhdGlvbnMgdW5kZXIgdGhlIExpY2Vuc2UuCi0gKi8KLQotI2lmbmRlZiBfX0xWQ1NfSEVBRFBIT05FX0NPRUZGU19IX18KLSNkZWZpbmUgX19MVkNTX0hFQURQSE9ORV9DT0VGRlNfSF9fCi0KLQotLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLS8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiBUaGUgU3RlcmVvIEVuaGFuY2VyICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0KLS8qIFN0ZXJlbyBFbmhhbmNlciBjb2VmZmljaWVudHMgZm9yIDgwMDAgSHogc2FtcGxlIHJhdGUsIHNjYWxlZCB3aXRoIDAuMTYxMjU4ICovCi0jZGVmaW5lIENTX01JRERMRV84MDAwX0EwICAgICAgICAgICAgICAgICAgICAgICAgICA3NDYyICAgICAgICAgLyogRmxvYXRpbmcgcG9pbnQgdmFsdWUgMC4yMjc3MjAgKi8KLSNkZWZpbmUgQ1NfTUlERExFXzgwMDBfQTEgICAgICAgICAgICAgICAgICAgICAgICAgLTcwNDkgICAgICAgICAvKiBGbG9hdGluZyBwb2ludCB2YWx1ZSAtMC4yMTUxMjUgKi8KLSNkZWZpbmUgQ1NfTUlERExFXzgwMDBfQTIgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDAgICAgICAgICAvKiBGbG9hdGluZyBwb2ludCB2YWx1ZSAwLjAwMDAwMCAqLwotI2RlZmluZSBDU19NSURETEVfODAwMF9CMSAgICAgICAgICAgICAgICAgICAgICAgIC0zMDIwOSAgICAgICAgIC8qIEZsb2F0aW5nIHBvaW50IHZhbHVlIC0wLjkyMTg5OSAqLwotI2RlZmluZSBDU19NSURETEVfODAwMF9CMiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMCAgICAgICAgIC8qIEZsb2F0aW5nIHBvaW50IHZhbHVlIDAuMDAwMDAwICovCi0jZGVmaW5lIENTX01JRERMRV84MDAwX1NDQUxFICAgICAgICAgICAgICAgICAgICAgICAgIDE1Ci0jZGVmaW5lIENTX1NJREVfODAwMF9BMCAgICAgICAgICAgICAgICAgICAgICAgICAgIDIwMDM2ICAgICAgICAgLyogRmxvYXRpbmcgcG9pbnQgdmFsdWUgMC42MTE0NDEgKi8KLSNkZWZpbmUgQ1NfU0lERV84MDAwX0ExICAgICAgICAgICAgICAgICAgICAgICAgICAtMTI0NjMgICAgICAgICAvKiBGbG9hdGluZyBwb2ludCB2YWx1ZSAtMC4zODAzNDQgKi8KLSNkZWZpbmUgQ1NfU0lERV84MDAwX0EyICAgICAgICAgICAgICAgICAgICAgICAgICAgLTc1NzMgICAgICAgICAvKiBGbG9hdGluZyBwb2ludCB2YWx1ZSAtMC4yMzEwOTcgKi8KLSNkZWZpbmUgQ1NfU0lERV84MDAwX0IxICAgICAgICAgICAgICAgICAgICAgICAgICAtMjAzOTcgICAgICAgICAvKiBGbG9hdGluZyBwb2ludCB2YWx1ZSAtMC42MjI0NzAgKi8KLSNkZWZpbmUgQ1NfU0lERV84MDAwX0IyICAgICAgICAgICAgICAgICAgICAgICAgICAgLTQyODUgICAgICAgICAvKiBGbG9hdGluZyBwb2ludCB2YWx1ZSAtMC4xMzA3NTkgKi8KLSNkZWZpbmUgQ1NfU0lERV84MDAwX1NDQUxFICAgICAgICAgICAgICAgICAgICAgICAgICAgMTUKLQotLyogU3RlcmVvIEVuaGFuY2VyIGNvZWZmaWNpZW50cyBmb3IgMTEwMjVIeiBzYW1wbGUgcmF0ZSwgc2NhbGVkIHdpdGggMC4xNjI5NDMgKi8KLSNkZWZpbmUgQ1NfTUlERExFXzExMDI1X0EwICAgICAgICAgICAgICAgICAgICAgICAgIDc1NjQgICAgICAgICAvKiBGbG9hdGluZyBwb2ludCB2YWx1ZSAwLjIzMDgzOCAqLwotI2RlZmluZSBDU19NSURETEVfMTEwMjVfQTEgICAgICAgICAgICAgICAgICAgICAgICAtNzI2MCAgICAgICAgIC8qIEZsb2F0aW5nIHBvaW50IHZhbHVlIC0wLjIyMTU1OSAqLwotI2RlZmluZSBDU19NSURETEVfMTEwMjVfQTIgICAgICAgICAgICAgICAgICAgICAgICAgICAgMCAgICAgICAgIC8qIEZsb2F0aW5nIHBvaW50IHZhbHVlIDAuMDAwMDAwICovCi0jZGVmaW5lIENTX01JRERMRV8xMTAyNV9CMSAgICAgICAgICAgICAgICAgICAgICAgLTMwOTAyICAgICAgICAgLyogRmxvYXRpbmcgcG9pbnQgdmFsdWUgLTAuOTQzMDU2ICovCi0jZGVmaW5lIENTX01JRERMRV8xMTAyNV9CMiAgICAgICAgICAgICAgICAgICAgICAgICAgICAwICAgICAgICAgLyogRmxvYXRpbmcgcG9pbnQgdmFsdWUgMC4wMDAwMDAgKi8KLSNkZWZpbmUgQ1NfTUlERExFXzExMDI1X1NDQUxFICAgICAgICAgICAgICAgICAgICAgICAgMTUKLSNkZWZpbmUgQ1NfU0lERV8xMTAyNV9BMCAgICAgICAgICAgICAgICAgICAgICAgICAgMTgyNjQgICAgICAgICAvKiBGbG9hdGluZyBwb2ludCB2YWx1ZSAwLjU1NzM3MiAqLwotI2RlZmluZSBDU19TSURFXzExMDI1X0ExICAgICAgICAgICAgICAgICAgICAgICAgIC0xMjgyOCAgICAgICAgIC8qIEZsb2F0aW5nIHBvaW50IHZhbHVlIC0wLjM5MTQ5MCAqLwotI2RlZmluZSBDU19TSURFXzExMDI1X0EyICAgICAgICAgICAgICAgICAgICAgICAgICAtNTQzNiAgICAgICAgIC8qIEZsb2F0aW5nIHBvaW50IHZhbHVlIC0wLjE2NTg4MSAqLwotI2RlZmluZSBDU19TSURFXzExMDI1X0IxICAgICAgICAgICAgICAgICAgICAgICAgIC0yODg1NiAgICAgICAgIC8qIEZsb2F0aW5nIHBvaW50IHZhbHVlIC0wLjg4MDYwOCAqLwotI2RlZmluZSBDU19TSURFXzExMDI1X0IyICAgICAgICAgICAgICAgICAgICAgICAgICAgMTA2MiAgICAgICAgIC8qIEZsb2F0aW5nIHBvaW50IHZhbHVlIDAuMDMyMzk3ICovCi0jZGVmaW5lIENTX1NJREVfMTEwMjVfU0NBTEUgICAgICAgICAgICAgICAgICAgICAgICAgIDE1Ci0KLS8qIFN0ZXJlbyBFbmhhbmNlciBjb2VmZmljaWVudHMgZm9yIDEyMDAwSHogc2FtcGxlIHJhdGUsIHNjYWxlZCB3aXRoIDAuMTYyMTkxICovCi0jZGVmaW5lIENTX01JRERMRV8xMjAwMF9BMCAgICAgICAgICAgICAgICAgICAgICAgICA3NTM0ICAgICAgICAgLyogRmxvYXRpbmcgcG9pbnQgdmFsdWUgMC4yMjk5MzIgKi8KLSNkZWZpbmUgQ1NfTUlERExFXzEyMDAwX0ExICAgICAgICAgICAgICAgICAgICAgICAgLTcyNTYgICAgICAgICAvKiBGbG9hdGluZyBwb2ludCB2YWx1ZSAtMC4yMjE0MzYgKi8KLSNkZWZpbmUgQ1NfTUlERExFXzEyMDAwX0EyICAgICAgICAgICAgICAgICAgICAgICAgICAgIDAgICAgICAgICAvKiBGbG9hdGluZyBwb2ludCB2YWx1ZSAwLjAwMDAwMCAqLwotI2RlZmluZSBDU19NSURETEVfMTIwMDBfQjEgICAgICAgICAgICAgICAgICAgICAgIC0zMTA1MSAgICAgICAgIC8qIEZsb2F0aW5nIHBvaW50IHZhbHVlIC0wLjk0NzYxNiAqLwotI2RlZmluZSBDU19NSURETEVfMTIwMDBfQjIgICAgICAgICAgICAgICAgICAgICAgICAgICAgMCAgICAgICAgIC8qIEZsb2F0aW5nIHBvaW50IHZhbHVlIDAuMDAwMDAwICovCi0jZGVmaW5lIENTX01JRERMRV8xMjAwMF9TQ0FMRSAgICAgICAgICAgICAgICAgICAgICAgIDE1Ci0jZGVmaW5lIENTX1NJREVfMTIwMDBfQTAgICAgICAgICAgICAgICAgICAgICAgICAgIDE4Mjk4ICAgICAgICAgLyogRmxvYXRpbmcgcG9pbnQgdmFsdWUgMC41NTgzOTggKi8KLSNkZWZpbmUgQ1NfU0lERV8xMjAwMF9BMSAgICAgICAgICAgICAgICAgICAgICAgICAtMTI4NTIgICAgICAgICAvKiBGbG9hdGluZyBwb2ludCB2YWx1ZSAtMC4zOTIyMTEgKi8KLSNkZWZpbmUgQ1NfU0lERV8xMjAwMF9BMiAgICAgICAgICAgICAgICAgICAgICAgICAgLTU0NDYgICAgICAgICAvKiBGbG9hdGluZyBwb2ludCB2YWx1ZSAtMC4xNjYxODcgKi8KLSNkZWZpbmUgQ1NfU0lERV8xMjAwMF9CMSAgICAgICAgICAgICAgICAgICAgICAgICAtMjkyNDcgICAgICAgICAvKiBGbG9hdGluZyBwb2ludCB2YWx1ZSAtMC44OTI1NTAgKi8KLSNkZWZpbmUgQ1NfU0lERV8xMjAwMF9CMiAgICAgICAgICAgICAgICAgICAgICAgICAgIDEwNzcgICAgICAgICAvKiBGbG9hdGluZyBwb2ludCB2YWx1ZSAwLjAzMjg1NiAqLwotI2RlZmluZSBDU19TSURFXzEyMDAwX1NDQUxFICAgICAgICAgICAgICAgICAgICAgICAgICAxNQotCi0vKiBTdGVyZW8gRW5oYW5jZXIgY29lZmZpY2llbnRzIGZvciAxNjAwMEh6IHNhbXBsZSByYXRlLCBzY2FsZWQgd2l0aCAwLjE2MjM3MSAqLwotI2RlZmluZSBDU19NSURETEVfMTYwMDBfQTAgICAgICAgICAgICAgICAgICAgICAgICAgNzU1OCAgICAgICAgIC8qIEZsb2F0aW5nIHBvaW50IHZhbHVlIDAuMjMwNjM4ICovCi0jZGVmaW5lIENTX01JRERMRV8xNjAwMF9BMSAgICAgICAgICAgICAgICAgICAgICAgIC03MzQ4ICAgICAgICAgLyogRmxvYXRpbmcgcG9pbnQgdmFsdWUgLTAuMjI0MjMyICovCi0jZGVmaW5lIENTX01JRERMRV8xNjAwMF9BMiAgICAgICAgICAgICAgICAgICAgICAgICAgICAwICAgICAgICAgLyogRmxvYXRpbmcgcG9pbnQgdmFsdWUgMC4wMDAwMDAgKi8KLSNkZWZpbmUgQ1NfTUlERExFXzE2MDAwX0IxICAgICAgICAgICAgICAgICAgICAgICAtMzE0NzUgICAgICAgICAvKiBGbG9hdGluZyBwb2ludCB2YWx1ZSAtMC45NjA1NTAgKi8KLSNkZWZpbmUgQ1NfTUlERExFXzE2MDAwX0IyICAgICAgICAgICAgICAgICAgICAgICAgICAgIDAgICAgICAgICAvKiBGbG9hdGluZyBwb2ludCB2YWx1ZSAwLjAwMDAwMCAqLwotI2RlZmluZSBDU19NSURETEVfMTYwMDBfU0NBTEUgICAgICAgICAgICAgICAgICAgICAgICAxNQotI2RlZmluZSBDU19TSURFXzE2MDAwX0EwICAgICAgICAgICAgICAgICAgICAgICAgICAgODE4NyAgICAgICAgIC8qIEZsb2F0aW5nIHBvaW50IHZhbHVlIDAuNDk5Njk1ICovCi0jZGVmaW5lIENTX1NJREVfMTYwMDBfQTEgICAgICAgICAgICAgICAgICAgICAgICAgIC01ODI1ICAgICAgICAgLyogRmxvYXRpbmcgcG9pbnQgdmFsdWUgLTAuMzU1NTQzICovCi0jZGVmaW5lIENTX1NJREVfMTYwMDBfQTIgICAgICAgICAgICAgICAgICAgICAgICAgIC0yMzYyICAgICAgICAgLyogRmxvYXRpbmcgcG9pbnQgdmFsdWUgLTAuMTQ0MTUyICovCi0jZGVmaW5lIENTX1NJREVfMTYwMDBfQjEgICAgICAgICAgICAgICAgICAgICAgICAgLTE3MjE2ICAgICAgICAgLyogRmxvYXRpbmcgcG9pbnQgdmFsdWUgLTEuMDUwNzg4ICovCi0jZGVmaW5lIENTX1NJREVfMTYwMDBfQjIgICAgICAgICAgICAgICAgICAgICAgICAgICAyMzYxICAgICAgICAgLyogRmxvYXRpbmcgcG9pbnQgdmFsdWUgMC4xNDQxMDQgKi8KLSNkZWZpbmUgQ1NfU0lERV8xNjAwMF9TQ0FMRSAgICAgICAgICAgICAgICAgICAgICAgICAgMTQKLQotLyogU3RlcmVvIEVuaGFuY2VyIGNvZWZmaWNpZW50cyBmb3IgMjIwNTBIeiBzYW1wbGUgcmF0ZSwgc2NhbGVkIHdpdGggMC4xNjA3ODEgKi8KLSNkZWZpbmUgQ1NfTUlERExFXzIyMDUwX0EwICAgICAgICAgICAgICAgICAgICAgICAgIDc0OTYgICAgICAgICAvKiBGbG9hdGluZyBwb2ludCB2YWx1ZSAwLjIyODc0OSAqLwotI2RlZmluZSBDU19NSURETEVfMjIwNTBfQTEgICAgICAgICAgICAgICAgICAgICAgICAtNzM0NCAgICAgICAgIC8qIEZsb2F0aW5nIHBvaW50IHZhbHVlIC0wLjIyNDEyOCAqLwotI2RlZmluZSBDU19NSURETEVfMjIwNTBfQTIgICAgICAgICAgICAgICAgICAgICAgICAgICAgMCAgICAgICAgIC8qIEZsb2F0aW5nIHBvaW50IHZhbHVlIDAuMDAwMDAwICovCi0jZGVmaW5lIENTX01JRERMRV8yMjA1MF9CMSAgICAgICAgICAgICAgICAgICAgICAgLTMxODI2ICAgICAgICAgLyogRmxvYXRpbmcgcG9pbnQgdmFsdWUgLTAuOTcxMjYyICovCi0jZGVmaW5lIENTX01JRERMRV8yMjA1MF9CMiAgICAgICAgICAgICAgICAgICAgICAgICAgICAwICAgICAgICAgLyogRmxvYXRpbmcgcG9pbnQgdmFsdWUgMC4wMDAwMDAgKi8KLSNkZWZpbmUgQ1NfTUlERExFXzIyMDUwX1NDQUxFICAgICAgICAgICAgICAgICAgICAgICAgMTUKLSNkZWZpbmUgQ1NfU0lERV8yMjA1MF9BMCAgICAgICAgICAgICAgICAgICAgICAgICAgIDcyMTEgICAgICAgICAvKiBGbG9hdGluZyBwb2ludCB2YWx1ZSAwLjQ0MDExMiAqLwotI2RlZmluZSBDU19TSURFXzIyMDUwX0ExICAgICAgICAgICAgICAgICAgICAgICAgICAtNDI3OCAgICAgICAgIC8qIEZsb2F0aW5nIHBvaW50IHZhbHVlIC0wLjI2MTA5NiAqLwotI2RlZmluZSBDU19TSURFXzIyMDUwX0EyICAgICAgICAgICAgICAgICAgICAgICAgICAtMjkzMyAgICAgICAgIC8qIEZsb2F0aW5nIHBvaW50IHZhbHVlIC0wLjE3OTAxNiAqLwotI2RlZmluZSBDU19TSURFXzIyMDUwX0IxICAgICAgICAgICAgICAgICAgICAgICAgIC0xODI5NyAgICAgICAgIC8qIEZsb2F0aW5nIHBvaW50IHZhbHVlIC0xLjExNjc4NiAqLwotI2RlZmluZSBDU19TSURFXzIyMDUwX0IyICAgICAgICAgICAgICAgICAgICAgICAgICAgMjk5MCAgICAgICAgIC8qIEZsb2F0aW5nIHBvaW50IHZhbHVlIDAuMTgyNTA3ICovCi0jZGVmaW5lIENTX1NJREVfMjIwNTBfU0NBTEUgICAgICAgICAgICAgICAgICAgICAgICAgIDE0Ci0KLS8qIFN0ZXJlbyBFbmhhbmNlciBjb2VmZmljaWVudHMgZm9yIDI0MDAwSHogc2FtcGxlIHJhdGUsIHNjYWxlZCB3aXRoIDAuMTYxODgyICovCi0jZGVmaW5lIENTX01JRERMRV8yNDAwMF9BMCAgICAgICAgICAgICAgICAgICAgICAgICA3NTUwICAgICAgICAgLyogRmxvYXRpbmcgcG9pbnQgdmFsdWUgMC4yMzAzOTUgKi8KLSNkZWZpbmUgQ1NfTUlERExFXzI0MDAwX0ExICAgICAgICAgICAgICAgICAgICAgICAgLTc0MDkgICAgICAgICAvKiBGbG9hdGluZyBwb2ludCB2YWx1ZSAtMC4yMjYxMTcgKi8KLSNkZWZpbmUgQ1NfTUlERExFXzI0MDAwX0EyICAgICAgICAgICAgICAgICAgICAgICAgICAgIDAgICAgICAgICAvKiBGbG9hdGluZyBwb2ludCB2YWx1ZSAwLjAwMDAwMCAqLwotI2RlZmluZSBDU19NSURETEVfMjQwMDBfQjEgICAgICAgICAgICAgICAgICAgICAgIC0zMTkwMiAgICAgICAgIC8qIEZsb2F0aW5nIHBvaW50IHZhbHVlIC0wLjk3MzU3MyAqLwotI2RlZmluZSBDU19NSURETEVfMjQwMDBfQjIgICAgICAgICAgICAgICAgICAgICAgICAgICAgMCAgICAgICAgIC8qIEZsb2F0aW5nIHBvaW50IHZhbHVlIDAuMDAwMDAwICovCi0jZGVmaW5lIENTX01JRERMRV8yNDAwMF9TQ0FMRSAgICAgICAgICAgICAgICAgICAgICAgIDE1Ci0jZGVmaW5lIENTX1NJREVfMjQwMDBfQTAgICAgICAgICAgICAgICAgICAgICAgICAgICA2Nzk2ICAgICAgICAgLyogRmxvYXRpbmcgcG9pbnQgdmFsdWUgMC40MTQ3NzAgKi8KLSNkZWZpbmUgQ1NfU0lERV8yNDAwMF9BMSAgICAgICAgICAgICAgICAgICAgICAgICAgLTQ3MDUgICAgICAgICAvKiBGbG9hdGluZyBwb2ludCB2YWx1ZSAtMC4yODcxODIgKi8KLSNkZWZpbmUgQ1NfU0lERV8yNDAwMF9BMiAgICAgICAgICAgICAgICAgICAgICAgICAgLTIwOTAgICAgICAgICAvKiBGbG9hdGluZyBwb2ludCB2YWx1ZSAtMC4xMjc1ODggKi8KLSNkZWZpbmUgQ1NfU0lERV8yNDAwMF9CMSAgICAgICAgICAgICAgICAgICAgICAgICAtMjAxNDcgICAgICAgICAvKiBGbG9hdGluZyBwb2ludCB2YWx1ZSAtMS4yMjk2NDggKi8KLSNkZWZpbmUgQ1NfU0lERV8yNDAwMF9CMiAgICAgICAgICAgICAgICAgICAgICAgICAgIDQ2MjMgICAgICAgICAvKiBGbG9hdGluZyBwb2ludCB2YWx1ZSAwLjI4MjE3NyAqLwotI2RlZmluZSBDU19TSURFXzI0MDAwX1NDQUxFICAgICAgICAgICAgICAgICAgICAgICAgICAxNAotCi0vKiBTdGVyZW8gRW5oYW5jZXIgY29lZmZpY2llbnRzIGZvciAzMjAwMEh6IHNhbXBsZSByYXRlLCBzY2FsZWQgd2l0aCAwLjE2MDMyMiAqLwotI2RlZmluZSBDU19NSURETEVfMzIwMDBfQTAgICAgICAgICAgICAgICAgICAgICAgICAgNzQ4NCAgICAgICAgIC8qIEZsb2F0aW5nIHBvaW50IHZhbHVlIDAuMjI4NDAwICovCi0jZGVmaW5lIENTX01JRERMRV8zMjAwMF9BMSAgICAgICAgICAgICAgICAgICAgICAgIC03MzgwICAgICAgICAgLyogRmxvYXRpbmcgcG9pbnQgdmFsdWUgLTAuMjI1MjE0ICovCi0jZGVmaW5lIENTX01JRERMRV8zMjAwMF9BMiAgICAgICAgICAgICAgICAgICAgICAgICAgICAwICAgICAgICAgLyogRmxvYXRpbmcgcG9pbnQgdmFsdWUgMC4wMDAwMDAgKi8KLSNkZWZpbmUgQ1NfTUlERExFXzMyMDAwX0IxICAgICAgICAgICAgICAgICAgICAgICAtMzIxMTcgICAgICAgICAvKiBGbG9hdGluZyBwb2ludCB2YWx1ZSAtMC45ODAxMjYgKi8KLSNkZWZpbmUgQ1NfTUlERExFXzMyMDAwX0IyICAgICAgICAgICAgICAgICAgICAgICAgICAgIDAgICAgICAgICAvKiBGbG9hdGluZyBwb2ludCB2YWx1ZSAwLjAwMDAwMCAqLwotI2RlZmluZSBDU19NSURETEVfMzIwMDBfU0NBTEUgICAgICAgICAgICAgICAgICAgICAgICAxNQotI2RlZmluZSBDU19TSURFXzMyMDAwX0EwICAgICAgICAgICAgICAgICAgICAgICAgICAgNTk3MyAgICAgICAgIC8qIEZsb2F0aW5nIHBvaW50IHZhbHVlIDAuMzY0NTc5ICovCi0jZGVmaW5lIENTX1NJREVfMzIwMDBfQTEgICAgICAgICAgICAgICAgICAgICAgICAgIC0zMzk3ICAgICAgICAgLyogRmxvYXRpbmcgcG9pbnQgdmFsdWUgLTAuMjA3MzU1ICovCi0jZGVmaW5lIENTX1NJREVfMzIwMDBfQTIgICAgICAgICAgICAgICAgICAgICAgICAgIC0yNTc2ICAgICAgICAgLyogRmxvYXRpbmcgcG9pbnQgdmFsdWUgLTAuMTU3MjI0ICovCi0jZGVmaW5lIENTX1NJREVfMzIwMDBfQjEgICAgICAgICAgICAgICAgICAgICAgICAgLTIwODc3ICAgICAgICAgLyogRmxvYXRpbmcgcG9pbnQgdmFsdWUgLTEuMjc0MjMxICovCi0jZGVmaW5lIENTX1NJREVfMzIwMDBfQjIgICAgICAgICAgICAgICAgICAgICAgICAgICA1MTIwICAgICAgICAgLyogRmxvYXRpbmcgcG9pbnQgdmFsdWUgMC4zMTI0OTUgKi8KLSNkZWZpbmUgQ1NfU0lERV8zMjAwMF9TQ0FMRSAgICAgICAgICAgICAgICAgICAgICAgICAgMTQKLQotLyogU3RlcmVvIEVuaGFuY2VyIGNvZWZmaWNpZW50cyBmb3IgNDQxMDBIeiBzYW1wbGUgcmF0ZSwgc2NhbGVkIHdpdGggMC4xNjM4MzQgKi8KLSNkZWZpbmUgQ1NfTUlERExFXzQ0MTAwX0EwICAgICAgICAgICAgICAgICAgICAgICAgIDc2NTQgICAgICAgICAvKiBGbG9hdGluZyBwb2ludCB2YWx1ZSAwLjIzMzU5MyAqLwotI2RlZmluZSBDU19NSURETEVfNDQxMDBfQTEgICAgICAgICAgICAgICAgICAgICAgICAtNzU3NyAgICAgICAgIC8qIEZsb2F0aW5nIHBvaW50IHZhbHVlIC0wLjIzMTIyNSAqLwotI2RlZmluZSBDU19NSURETEVfNDQxMDBfQTIgICAgICAgICAgICAgICAgICAgICAgICAgICAgMCAgICAgICAgIC8qIEZsb2F0aW5nIHBvaW50IHZhbHVlIDAuMDAwMDAwICovCi0jZGVmaW5lIENTX01JRERMRV80NDEwMF9CMSAgICAgICAgICAgICAgICAgICAgICAgLTMyMjk0ICAgICAgICAgLyogRmxvYXRpbmcgcG9pbnQgdmFsdWUgLTAuOTg1NTQ1ICovCi0jZGVmaW5lIENTX01JRERMRV80NDEwMF9CMiAgICAgICAgICAgICAgICAgICAgICAgICAgICAwICAgICAgICAgLyogRmxvYXRpbmcgcG9pbnQgdmFsdWUgMC4wMDAwMDAgKi8KLSNkZWZpbmUgQ1NfTUlERExFXzQ0MTAwX1NDQUxFICAgICAgICAgICAgICAgICAgICAgICAgMTUKLSNkZWZpbmUgQ1NfU0lERV80NDEwMF9BMCAgICAgICAgICAgICAgICAgICAgICAgICAgIDQ2NjIgICAgICAgICAvKiBGbG9hdGluZyBwb2ludCB2YWx1ZSAwLjI4NDU3MyAqLwotI2RlZmluZSBDU19TSURFXzQ0MTAwX0ExICAgICAgICAgICAgICAgICAgICAgICAgICAtNDI0MiAgICAgICAgIC8qIEZsb2F0aW5nIHBvaW50IHZhbHVlIC0wLjI1ODkxMCAqLwotI2RlZmluZSBDU19TSURFXzQ0MTAwX0EyICAgICAgICAgICAgICAgICAgICAgICAgICAgLTQyMCAgICAgICAgIC8qIEZsb2F0aW5nIHBvaW50IHZhbHVlIC0wLjAyNTY2MiAqLwotI2RlZmluZSBDU19TSURFXzQ0MTAwX0IxICAgICAgICAgICAgICAgICAgICAgICAgIC0yNTc2MCAgICAgICAgIC8qIEZsb2F0aW5nIHBvaW50IHZhbHVlIC0xLjU3MjI0OCAqLwotI2RlZmluZSBDU19TSURFXzQ0MTAwX0IyICAgICAgICAgICAgICAgICAgICAgICAgICAgOTY0MCAgICAgICAgIC8qIEZsb2F0aW5nIHBvaW50IHZhbHVlIDAuNTg4Mzk5ICovCi0jZGVmaW5lIENTX1NJREVfNDQxMDBfU0NBTEUgICAgICAgICAgICAgICAgICAgICAgICAgIDE0Ci0KLS8qIFN0ZXJlbyBFbmhhbmNlciBjb2VmZmljaWVudHMgZm9yIDQ4MDAwSHogc2FtcGxlIHJhdGUsIHNjYWxlZCB3aXRoIDAuMTY0NDAyICovCi0jZGVmaW5lIENTX01JRERMRV80ODAwMF9BMCAgICAgICAgICAgICAgICAgICAgICAgICA3NjgyICAgICAgICAgLyogRmxvYXRpbmcgcG9pbnQgdmFsdWUgMC4yMzQ0NDUgKi8KLSNkZWZpbmUgQ1NfTUlERExFXzQ4MDAwX0ExICAgICAgICAgICAgICAgICAgICAgICAgLTc2MTEgICAgICAgICAvKiBGbG9hdGluZyBwb2ludCB2YWx1ZSAtMC4yMzIyNjEgKi8KLSNkZWZpbmUgQ1NfTUlERExFXzQ4MDAwX0EyICAgICAgICAgICAgICAgICAgICAgICAgICAgIDAgICAgICAgICAvKiBGbG9hdGluZyBwb2ludCB2YWx1ZSAwLjAwMDAwMCAqLwotI2RlZmluZSBDU19NSURETEVfNDgwMDBfQjEgICAgICAgICAgICAgICAgICAgICAgIC0zMjMzMyAgICAgICAgIC8qIEZsb2F0aW5nIHBvaW50IHZhbHVlIC0wLjk4NjcxMyAqLwotI2RlZmluZSBDU19NSURETEVfNDgwMDBfQjIgICAgICAgICAgICAgICAgICAgICAgICAgICAgMCAgICAgICAgIC8qIEZsb2F0aW5nIHBvaW50IHZhbHVlIDAuMDAwMDAwICovCi0jZGVmaW5lIENTX01JRERMRV80ODAwMF9TQ0FMRSAgICAgICAgICAgICAgICAgICAgICAgIDE1Ci0jZGVmaW5lIENTX1NJREVfNDgwMDBfQTAgICAgICAgICAgICAgICAgICAgICAgICAgICA0NDY2ICAgICAgICAgLyogRmxvYXRpbmcgcG9pbnQgdmFsdWUgMC4yNzI2MDYgKi8KLSNkZWZpbmUgQ1NfU0lERV80ODAwMF9BMSAgICAgICAgICAgICAgICAgICAgICAgICAgLTQzNzQgICAgICAgICAvKiBGbG9hdGluZyBwb2ludCB2YWx1ZSAtMC4yNjY5NTIgKi8KLSNkZWZpbmUgQ1NfU0lERV80ODAwMF9BMiAgICAgICAgICAgICAgICAgICAgICAgICAgICAtOTMgICAgICAgICAvKiBGbG9hdGluZyBwb2ludCB2YWx1ZSAtMC4wMDU2NTQgKi8KLSNkZWZpbmUgQ1NfU0lERV80ODAwMF9CMSAgICAgICAgICAgICAgICAgICAgICAgICAtMjY0OTUgICAgICAgICAvKiBGbG9hdGluZyBwb2ludCB2YWx1ZSAtMS42MTcxNDEgKi8KLSNkZWZpbmUgQ1NfU0lERV80ODAwMF9CMiAgICAgICAgICAgICAgICAgICAgICAgICAgMTAzMjkgICAgICAgICAvKiBGbG9hdGluZyBwb2ludCB2YWx1ZSAwLjYzMDQwNSAqLwotI2RlZmluZSBDU19TSURFXzQ4MDAwX1NDQUxFICAgICAgICAgICAgICAgICAgICAgICAgICAxNAotCi0KLS8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0vKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogVGhlIFJldmVyYiBVbml0ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotCi0vKiBSZXZlcmIgZGVsYXkgc2V0dGluZ3MgaW4gc2FtcGxlcyAqLwotI2RlZmluZSBMVkNTX1NURVJFT0RFTEFZX0NTXzhLSFogICAgICAgICAgICAgICAgICAgICA5MyAgICAgICAgIC8qIFNhbXBsZSByYXRlIDhrUy9zICovCi0jZGVmaW5lIExWQ1NfU1RFUkVPREVMQVlfQ1NfMTFLSFogICAgICAgICAgICAgICAgICAgMTI4ICAgICAgICAgLyogU2FtcGxlIHJhdGUgMTFrUy9zICovCi0jZGVmaW5lIExWQ1NfU1RFUkVPREVMQVlfQ1NfMTJLSFogICAgICAgICAgICAgICAgICAgMTM5ICAgICAgICAgLyogU2FtcGxlIHJhdGUgMTJrUy9zICovCi0jZGVmaW5lIExWQ1NfU1RFUkVPREVMQVlfQ1NfMTZLSFogICAgICAgICAgICAgICAgICAgMTg2ICAgICAgICAgLyogU2FtcGxlIHJhdGUgMTZrUy9zICovCi0jZGVmaW5lIExWQ1NfU1RFUkVPREVMQVlfQ1NfMjJLSFogICAgICAgICAgICAgICAgICAgMjU2ICAgICAgICAgLyogU2FtcGxlIHJhdGUgMjJrUy9zICovCi0jZGVmaW5lIExWQ1NfU1RFUkVPREVMQVlfQ1NfMjRLSFogICAgICAgICAgICAgICAgICAgMjc5ICAgICAgICAgLyogU2FtcGxlIHJhdGUgMjRrUy9zICovCi0jZGVmaW5lIExWQ1NfU1RFUkVPREVMQVlfQ1NfMzJLSFogICAgICAgICAgICAgICAgICAgMzcyICAgICAgICAgLyogU2FtcGxlIHJhdGUgMzJrUy9zICovCi0jZGVmaW5lIExWQ1NfU1RFUkVPREVMQVlfQ1NfNDRLSFogICAgICAgICAgICAgICAgICAgNTEyICAgICAgICAgLyogU2FtcGxlIHJhdGUgNDRrUy9zICovCi0jZGVmaW5lIExWQ1NfU1RFUkVPREVMQVlfQ1NfNDhLSFogICAgICAgICAgICAgICAgICAgNTEyICAgICAgICAgLyogU2FtcGxlIHJhdGUgNDhrUy9zICovCi0KLS8qIFJldmVyYiBjb2VmZmljaWVudHMgZm9yIDgwMDAgSHogc2FtcGxlIHJhdGUsIHNjYWxlZCB3aXRoIDEuMDM4MDMwICovCi0jZGVmaW5lIENTX1JFVkVSQl84MDAwX0EwICAgICAgICAgICAgICAgICAgICAgICAgIDIxODY1ICAgICAgICAgLyogRmxvYXRpbmcgcG9pbnQgdmFsdWUgMC42NjcyNzEgKi8KLSNkZWZpbmUgQ1NfUkVWRVJCXzgwMDBfQTEgICAgICAgICAgICAgICAgICAgICAgICAtMjE4NjUgICAgICAgICAvKiBGbG9hdGluZyBwb2ludCB2YWx1ZSAtMC42NjcyNzEgKi8KLSNkZWZpbmUgQ1NfUkVWRVJCXzgwMDBfQTIgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDAgICAgICAgICAvKiBGbG9hdGluZyBwb2ludCB2YWx1ZSAwLjAwMDAwMCAqLwotI2RlZmluZSBDU19SRVZFUkJfODAwMF9CMSAgICAgICAgICAgICAgICAgICAgICAgIC0yMTg5NSAgICAgICAgIC8qIEZsb2F0aW5nIHBvaW50IHZhbHVlIC0wLjY2ODE3OSAqLwotI2RlZmluZSBDU19SRVZFUkJfODAwMF9CMiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMCAgICAgICAgIC8qIEZsb2F0aW5nIHBvaW50IHZhbHVlIDAuMDAwMDAwICovCi0jZGVmaW5lIENTX1JFVkVSQl84MDAwX1NDQUxFICAgICAgICAgICAgICAgICAgICAgICAgIDE1Ci0KLS8qIFJldmVyYiBjb2VmZmljaWVudHMgZm9yIDExMDI1SHogc2FtcGxlIHJhdGUsIHNjYWxlZCB3aXRoIDEuMDM4MDMwICovCi0jZGVmaW5lIENTX1JFVkVSQl8xMTAyNV9BMCAgICAgICAgICAgICAgICAgICAgICAgIDIyOTI2ICAgICAgICAgLyogRmxvYXRpbmcgcG9pbnQgdmFsdWUgMC42OTk2MzggKi8KLSNkZWZpbmUgQ1NfUkVWRVJCXzExMDI1X0ExICAgICAgICAgICAgICAgICAgICAgICAtMjI5MjYgICAgICAgICAvKiBGbG9hdGluZyBwb2ludCB2YWx1ZSAtMC42OTk2MzggKi8KLSNkZWZpbmUgQ1NfUkVWRVJCXzExMDI1X0EyICAgICAgICAgICAgICAgICAgICAgICAgICAgIDAgICAgICAgICAvKiBGbG9hdGluZyBwb2ludCB2YWx1ZSAwLjAwMDAwMCAqLwotI2RlZmluZSBDU19SRVZFUkJfMTEwMjVfQjEgICAgICAgICAgICAgICAgICAgICAgIC0yNDU0NiAgICAgICAgIC8qIEZsb2F0aW5nIHBvaW50IHZhbHVlIC0wLjc0OTA5NiAqLwotI2RlZmluZSBDU19SRVZFUkJfMTEwMjVfQjIgICAgICAgICAgICAgICAgICAgICAgICAgICAgMCAgICAgICAgIC8qIEZsb2F0aW5nIHBvaW50IHZhbHVlIDAuMDAwMDAwICovCi0jZGVmaW5lIENTX1JFVkVSQl8xMTAyNV9TQ0FMRSAgICAgICAgICAgICAgICAgICAgICAgIDE1Ci0KLS8qIFJldmVyYiBjb2VmZmljaWVudHMgZm9yIDEyMDAwSHogc2FtcGxlIHJhdGUsIHNjYWxlZCB3aXRoIDEuMDM4MDMwICovCi0jZGVmaW5lIENTX1JFVkVSQl8xMjAwMF9BMCAgICAgICAgICAgICAgICAgICAgICAgIDIzMTY1ICAgICAgICAgLyogRmxvYXRpbmcgcG9pbnQgdmFsdWUgMC43MDY5MzEgKi8KLSNkZWZpbmUgQ1NfUkVWRVJCXzEyMDAwX0ExICAgICAgICAgICAgICAgICAgICAgICAtMjMxNjUgICAgICAgICAvKiBGbG9hdGluZyBwb2ludCB2YWx1ZSAtMC43MDY5MzEgKi8KLSNkZWZpbmUgQ1NfUkVWRVJCXzEyMDAwX0EyICAgICAgICAgICAgICAgICAgICAgICAgICAgIDAgICAgICAgICAvKiBGbG9hdGluZyBwb2ludCB2YWx1ZSAwLjAwMDAwMCAqLwotI2RlZmluZSBDU19SRVZFUkJfMTIwMDBfQjEgICAgICAgICAgICAgICAgICAgICAgIC0yNTE0NCAgICAgICAgIC8qIEZsb2F0aW5nIHBvaW50IHZhbHVlIC0wLjc2NzMyNyAqLwotI2RlZmluZSBDU19SRVZFUkJfMTIwMDBfQjIgICAgICAgICAgICAgICAgICAgICAgICAgICAgMCAgICAgICAgIC8qIEZsb2F0aW5nI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gIDE2OTIxICAgICAgICAgLyogRmxvYXRpbmcgcG9pbnQgdmFsdWUgMC41MTYzOTYgKi8KLSNkZWZpbmUgQ1NfUkVWRVJCXzIyMDUwX0ExICAgICAgICAgICAgICAgICAgICAgICAgICAgIDAgICAgICAgICAvKiBGbG9hdGluZyBwb2ludCB2YWx1ZSAwLjAwMDAwMCAqLwotI2RlZmluZSBDU19SRVZFUkJfMjIwNTBfQTIgICAgICAgICAgICAgICAgICAgICAgIC0xNjkyMSAgICAgICAgIC8qIEZsb2F0aW5nIHBvaW50IHZhbHVlIC0wLjUxNjM5NiAqLwotI2RlZmluZSBDU19SRVZFUkJfMjIwNTBfQjEgICAgICAgICAgICAgICAgICAgICAgIC0xNjk5MSAgICAgICAgIC8qIEZsb2F0aW5nIHBvaW50IHZhbHVlIC0wLjUxODUxMiAqLwotI2RlZmluZSBDU19SRVZFUkJfMjIwNTBfQjIgICAgICAgICAgICAgICAgICAgICAgICAtOTUzNSAgICAgICAgIC8qIEZsb2F0aW5nIHBvaW50IHZhbHVlIC0wLjI5MDk5MCAqLwotI2RlZmluZSBDU19SRVZFUkJfMjIwNTBfU0NBTEUgICAgICAgICAgICAgICAgICAgICAgICAxNQotCi0vKiBSZXZlcmIgY29lZmZpY2llbnRzIGZvciAyNDAwMEh6IHNhbXBsZSByYXRlLCBzY2FsZWQgd2l0aCAxLjAzODAzMCAqLwotI2RlZmluZSBDU19SRVZFUkJfMjQwMDBfQTAgICAgICAgICAgICAgICAgICAgICAgICAxNTcxNCAgICAgICAgIC8qIEZsb2F0aW5nIHBvaW50IHZhbHVlIDAuNDc5NTY1ICovCi0jZGVmaW5lIENTX1JFVkVSQl8yNDAwMF9BMSAgICAgICAgICAgICAgICAgICAgICAgICAgICAwICAgICAgICAgLyogRmxvYXRpbmcgcG9pbnQgdmFsdWUgMC4wMDAwMDAgKi8KLSNkZWZpbmUgQ1NfUkVWRVJCXzI0MDAwX0EyICAgICAgICAgICAgICAgICAgICAgICAtMTU3MTQgICA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4MDAwX0EwICAgICAgICAgICAgICAgICAgICAgICAgIDQ1NjYgICAgICAgICAvKiBGbG9hdGluZyBwb2ludCB2YWx1ZSAwLjI3ODY2MSAqLwotI2RlZmluZSBDU19SRVZFUkJfNDgwMDBfQTEgICAgICAgICAgICAgICAgICAgICAgICAgICAgMCAgICAgICAgIC8qIEZsb2F0aW5nIHBvaW50IHZhbHVlIDAuMDAwMDAwICovCi0jZGVmaW5lIENTX1JFVkVSQl80ODAwMF9BMiAgICAgICAgICAgICAgICAgICAgICAgIC00NTY2ICAgICAgICAgLyogRmxvYXRpbmcgcG9pbnQgdmFsdWUgLTAuMjc4NjYxICovCi0jZGVmaW5lIENTX1JFVkVSQl80ODAwMF9CMSAgICAgICAgICAgICAgICAgICAgICAgLTIwNTYyICAgICAgICAgLyogRmxvYXRpbmcgcG9pbnQgdmFsdWUgLTEuMjU0OTkzICovCi0jZGVmaW5lIENTX1JFVkVSQl80ODAwMF9CMiAgICAgICAgICAgICAgICAgICAgICAgICA0OTcwICAgICAgICAgLyogRmxvYXRpbmcgcG9pbnQgdmFsdWUgMC4zMDMzNDcgKi8KLSNkZWZpbmUgQ1NfUkVWRVJCXzQ4MDAwX1NDQUxFICAgICAgICAgICAgICAgICAgICAgICAgMTQKLQotLyogUmV2ZXJiIEdhaW4gU2V0dGluZ3MgKi8KLSNkZWZpbmUgTFZDU19IRUFEUEhPTkVfREVMQVlHQUlOICAgICAgICAgICAgICAgMC44MDAwMDAgICAgICAgICAvKiBBbGdvcml0aG0gZGVsYXkgcGF0aCBnYWluICovCi0jZGVmaW5lIExWQ1NfSEVBRFBIT05FX09VVFBVVEdBSU4gICAgICAgICAgICAgIDEuMDAwMDAwICAgICAgICAgLyogQWxnb3JpdGhtIG91dHB1dCBnYWluICovCi0jZGVmaW5lIExWQ1NfSEVBRFBIT05FX1BST0NHQUlOICAgICAgICAgICAgICAgICAgIDE4NDAzICAgICAgICAgLyogUHJvY2Vzc2VkIHBhdGggZ2FpbiAqLwotI2RlZmluZSBMVkNTX0hFQURQSE9ORV9VTlBST0NHQUlOICAgICAgICAgICAgICAgICAxODQwMyAgICAgICAgIC8qIFVucHJvY2Vzc2VkIHBhdGggZ2FpbiAqLwotI2RlZmluZSBMVkNTX0hFQURQSE9ORV9HQUlOQ09SUkVDVCAgICAgICAgICAgICAxLjAwOTM0MyAgICAgICAgIC8qIERlbGF5IG1peGVyIGdhaW4gY29ycmVjdGlvbiAqLwotCi0KLS8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0vKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogVGhlIEVxdWFsaXNlciAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotCi0vKiBFcXVhbGlzZXIgY29lZmZpY2llbnRzIGZvciA4MDAwIEh6IHNhbXBsZSByYXRlLCBDUyBzY2FsZWQgd2l0aCAxLjAzODQ5NyBhbmQgQ1NFWCBzY2FsZWQgd2l0aCAwLjc3NTQ4MCAqLwotI2RlZmluZSBDU19FUVVBTElTRVJfODAwMF9BMCAgICAgICAgICAgICAgICAgICAgICAyMDY5OCAgICAgICAgIC8qIEZsb2F0aW5nIHBvaW50IHZhbHVlIDEuMjYzMzEyICovCi0jZGVmaW5lIENTX0VRVUFMSVNFUl84MDAwX0ExICAgICAgICAgICAgICAgICAgICAgIC05ODU5ICAgICAgICAgLyogR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ICAgICAgICAgICAgICAgIDYzODYgICAgICAgICAvKiBGbG9hdGluZyBwb2ludCB2YWx1ZSAwLjM4OTc0MSAqLwotI2RlZmluZSBDU19FUVVBTElTRVJfMzIwMDBfQjEgICAgICAgICAgICAgICAgICAgIC0xNDg2NyAgICAgICAgIC8qIEZsb2F0aW5nIHBvaW50IHZhbHVlIC0wLjkwNzQxMCAqLwotI2RlZmluZSBDU19FUVVBTElTRVJfMzIwMDBfQjIgICAgICAgICAgICAgICAgICAgICAtMTE1NSAgICAgICAgIC8qIEZsb2F0aW5nIHBvaW50IHZhbHVlIC0wLjA3MDQ4OSAqLwotI2RlZmluZSBDU19FUVVBTElTRVJfMzIwMDBfU0NBTEUgICAgICAgICAgICAgICAgICAgICAxNAotI2RlZmluZSBDU0VYX0VRVUFMSVNFUl8zMjAwMF9BMCAgICAgICAgICAgICAgICAgICAxNDYyMyAgICAgICAgIC8qIEZsb2F0aW5nIHBvaW50IHZhbHVlIDEuNzg1MDQ5ICovCi0jZGVmaW5lIENTRVhfRVFVQUxJU0VSXzMyMDAwX0ExICAgICAgICAgICAgICAgICAgLTE4Mjk3ICAgICAgICAgLyogRmxvYXRpbmcgcG9pbnQgdmFsdWUgLTIuMjMzNDk3ICovCi0jZGVmaW5lIENTRVhfRVFVQUxJU0VSXzMyMDAwX0EyICAgICAgICAgICAgICAgICAgICA0MzEzICAgICAgICAgLyogRmxvYXRpbmcgcG9pbnQgdmFsdWUgMC41MjY0MzEgKi8KLSNkZWZpbmUgQ1NFWF9FUVVBTElTRVJfMzIwMDBfQjEgICAgICAgICAgICAgICAgICAgLTM2NTMgICAgICAgICAvKiBGbG9hdGluZyBwb2ludCB2YWx1ZSAtMC40NDU5MzkgKi8KLSNkZWZpbmUgQ1NFWF9FUVVBTElTRVJfMzIwMDBfQjIgICAgICAgICAgICAgICAgICAgLTQyODAgICAgICAgICAvKiBGbG9hdGluZyBwb2ludCB2YWx1ZSAtMC41MjI0NDYgKi8KLSNkZWZpbmUgQ1N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ICAgICAgICAgICAgICAxMwotCi0KLS8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0vKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogVGhlIE91dHB1dCBHYWluIENvcnJlY3Rpb24gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotCi0jZGVmaW5lIExWQ1NfSEVBRFBIT05FX1NISUZUICAgICAgICAgICAgICAgICAgICAgICAgICAyICAgICAgICAgICAgICAvKiBPdXRwdXQgU2hpZnQgKi8KLSNkZWZpbmUgTFZDU19IRUFEUEhPTkVfU0hJRlRMT1NTICAgICAgICAgICAgICAgICAgMjc3NzkgICAgICAgICAgICAgIC8qIE91dHB1dCBTaGlmdCBsb3NzICovCi0jZGVmaW5lIExWQ1NfSEVBRFBIT05FX0dBSU4gICAgICAgICAgICAgICAgICAgICAgICA2ODQwICAgICAgICAgICAgICAvKiBVbnByb2Nlc3NlZCBwYXRoIGdhaW4gKi8KLSNkZWZpbmUgTFZDU19FWF9IRUFEUEhPTkVfU0hJRlQgICAgICAgICAgICAgICAgICAgICAgIDMgICAgICAgICAgICAgIC8qIEVYIE91dHB1dCBTaGlmdCAqLwotI2RlZmluZSBMVkNTX0VYX0hFQURQSE9ORV9TSElGVExPU1MgICAgICAgICAgICAgICAxODYwMCAgICAgICAgICAgICAgLyogRVggT3V0cHV0IFNoaWZ0IGxvc3M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zdHJpYnV0ZWQgdW5kZXIgdGhlIExpY2Vuc2UgaXMgZGlzdHJpYnV0ZWQgb24gYW4gIkFTIElTIiBCQVNJUywKLSAqIFdJVEhPVVQgV0FSUkFOVElFUyBPUiBDT05ESVRJT05TIE9GIEFOWSBLSU5ELCBlaXRoZXIgZXhwcmVzcyBvciBpbXBsaWVkLgotICogU2VlIHRoZSBMaWNlbnNlIGZvciB0aGUgc3BlY2lmaWMgbGFuZ3VhZ2UgZ292ZXJuaW5nIHBlcm1pc3Npb25zIGFuZAotICogbGltaXRhdGlvbnMgdW5kZXIgdGhlIExpY2Vuc2UuCi0gKi8KLQotLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLS8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgSW5jbHVkZXMgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0KLSNpbmNsdWRlICJMVkNTLmgiCi0jaW5jbHVkZSAiTFZDU19Qcml2YXRlLmgiCi0jaW5jbHVkZSAiTFZDU19UYWJsZXMuaCIKLQotLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0vKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qIEZVTkNUSU9OOiAgICAgICAgICAgICAgICBMVkNTX01lbW9yeSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiBERVNDUklQVElPTjogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICBUaGlzIGZ1bmN0aW9uIGlzIHVzZWQgZm9yIG1lbW9yeSBhbGxvY2F0aW9uIGFuZCBmcmVlLiBJdCBjYW4gYmUgY2FsbGVkIGluICAgICAgICAgICAqLwotLyogIHR3byB3YXlzOiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICAgICAgaEluc3RhbmNlID0gTlVMTCAgICAgICAgICAgICAgICBSZXR1cm5zIHRoZSBtZW1vcnkgcmVxdWlyZW1lbnRzICAgICAgICAgICAgICAgICAqLwotLyogICAgICBoSW5zdGFuY2UgPSBJbnN0YW5jZSBoYW5kbGUgICAgIFJldHVybnMgdGhlIG1lbW9yeSByZXF1aXJlbWVudHMgYW5kICAgICAgICAgICAgICovCi0vKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYWxsb2NhdGVkIGJhc2UgYWRkcmVzc2VzIGZvciB0aGUgaW5zdGFuY2UgICAgICAgKi8KLS8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogIFdoZW4gdGhpcyBmdW5jdGlvbiBpcyBjYWxsZWQgZm9yIG1lbW9yeSBhbGxvY2F0aW9uIChoSW5zdGFuY2U9TlVMTCkgaXQgaXMgICAgICAgICAgICovCi0vKiAgcGFzc2VkIHRoZSBkZWZhdWx0IGNhcGFiaWxpdGllcy4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogIFdoZW4gY2FsbGVkIGZvciBtZW1vcnkgYWxsb2NhdGlvbiB0aGUgbWVtb3J5IGJhc2UgYWRkcmVzcyBwb2ludGVycyBhcmUgTlVMTCBvbiAgICAgICovCi0vKiAgcmV0dXJuLiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogIFdoZW4gdGhlIGZ1bmN0aW9uIGlzIGNhbGxlZCBmb3IgZnJlZSAoaEluc3RhbmNlID0gSW5zdGFuY2UgSGFuZGxlKSB0aGUgICAgICAgICAgICAgICovCi0vKiAgY2FwYWJpbGl0aWVzIGFyZSBpZ25vcmVkIGFuZCB0aGUgbWVtb3J5IHRhYmxlIHJldHVybnMgdGhlIGFsbG9jYXRlZCBtZW1vcnkgYW5kICAgICAgKi8KLS8qICBiYXNlIGFkZHJlc3NlcyB1c2VkIGR1cmluZyBpbml0aWFsaXNhdGlvbi4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiBQQVJBTUVURVJTOiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICBoSW5zdGFuY2UgICAgICAgICAgICAgICBJbnN0YW5jZSBIYW5kbGUgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogIHBNZW1vcnlUYWJsZSAgICAgICAgICAgIFBvaW50ZXIgdG8gYW4gZW1wdHkgbWVtb3J5IGRlZmluaXRpb24gdGFibGUgICAgICAgICAgICAgICAgICovCi0vKiAgcENhcGFiaWxpdGllcyAgICAgICAgICAgUG9pbnRlciB0byB0aGUgZGVmYXVsdCBjYXBhYmlsaXRlcyAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogUkVUVVJOUzogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgTFZDU19TdWNjZXNzICAgICAgICAgICAgU3VjY2VlZGVkICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogTk9URVM6ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgMS4gIFRoaXMgZnVuY3Rpb24gbWF5IGJlIGludGVycnVwdGVkIGJ5IHRoZSBMVkNTX1Byb2Nlc3MgZnVuY3Rpb24gICAgICAgICAgICAgICAgICAgKi8KLS8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0KLUxWQ1NfUmV0dXJuU3RhdHVzX2VuIExWQ1NfTWVtb3J5KExWQ1NfSGFuZGxlX3QgICAgICAgICAgaEluc3RhbmNlLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTFZDU19NZW1UYWJfdCAgICAgICAgICAqcE1lbW9yeVRhYmxlLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTFZDU19DYXBhYmlsaXRpZXNfdCAgICAqcENhcGFiaWxpdGllcykKLXsKLQotICAgIExWTV9VSU5UMzIgICAgICAgICAgU2NyYXRjaFNpemU7Ci0gICAgTFZDU19JbnN0YW5jZV90ICAgICAqcEluc3RhbmNlID0gKExWQ1NfSW5zdGFuY2VfdCAqKWhJbnN0YW5jZTsKLQotCi0gICAgLyoKLSAgICAgKiBGaWxsIGluIHRoZSBtZW1vcnkgdGFibGUKLSAgICAgKi8KLSAgICBpZiAoaEluc3RhbmNlID09IExWTV9OVUxMKQotICAgIHsKLSAgICAgICAgLyoKLSAgICAgICAgICogSW5zdGFuY2UgbWVtb3J5Ci0gICAgICAgICAqLwotICAgICAgICBwTWVtb3J5VGFibGUtPlJlZ2lvbltMVkNTX01FTVJFR0lPTl9QRVJTSVNURU5UX1NMT1dfREFUQV0uU2l6ZSAgICAgICAgID0gKExWTV9VSU5UMzIpc2l6ZW9mKExWQ1NfSW5zdGFuY2VfdCk7Ci0gICAgICAgIHBNZW1vcnlUYWJsZS0+UmVnaW9uW0xWQ1NfTUVNUkVHSU9OX1BFUlNJU1RFTlRfU0xPV19EQVRBXS5UeXBlICAgICAgICAg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FzZUFkZHJlc3MgPSBMVk1fTlVMTDsKLQotICAgICAgICAvKgotICAgICAgICAgKiBTY3JhdGNoIG1lbW9yeQotICAgICAgICAgKi8KLSAgICAgICAgU2NyYXRjaFNpemUgPSAoTFZNX1VJTlQzMikoTFZDU19TQ1JBVENIQlVGRkVSUypzaXplb2YoTFZNX0lOVDE2KSpwQ2FwYWJpbGl0aWVzLT5NYXhCbG9ja1NpemUpOyAgICAgLyogSW5wbGFjZSBwcm9jZXNzaW5nICovCi0gICAgICAgIHBNZW1vcnlUYWJsZS0+UmVnaW9uW0xWQ1NfTUVNUkVHSU9OX1RFTVBPUkFSWV9GQVNUXS5TaXplICAgICAgICAgPSBTY3JhdGNoU2l6ZTsKLSAgICAgICAgcE1lbW9yeVRhYmxlLT5SZWdpb25bTFZDU19NRU1SRUdJT05fVEVNUE9SQVJZX0ZBU1RdLlR5cGUgICAgICAgICA9IExWQ1NfU0NSQVRDSDsKLSAgICAgICAgcE1lbW9yeVRhYmxlLT5SZWdpb25bTFZDU19NRU1SRUdJT05fVEVNUE9SQVJZX0ZBU1RdLnBCYXNlQWRkcmVzcyA9IExWTV9OVUxMOwotICAgIH0KLSAgICBlbHNlCi0gICAgewotICAgICAgICAvKiBSZWFkIGJhY2sgbWVtb3J5IGFsbG9jYXRpb24gdGFibGUgKi8KLSAgICAgICAgKnBNZW1vcnlUYWJsZSA9IHBJbnN0YW5jZS0+TWVtb3J5VGFibGU7Ci0gICAgfQotCi0gICAgcmV0dXJuKExWQ1NfU1VDQ0VTUyk7Ci19Ci0KLQotLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLS8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiBGVU5DVElPTjogICAgICAgICAgICAgICAgTFZDU19Jbml0ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qIERFU0NSSVBUSU9OOiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgQ3JlYXRlIGFuZCBpbml0aWFsaXNhdGlvbiBmdW5jdGlvbiBmb3IgdGhlIENvbmNlcnQgU291bmQgbW9kdWxlICAgICAgICAgICAgICAgICAqLwotLyogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICBUaGlzIGZ1bmN0aW9uIGNhbiBiZSB1c2VkIHRvIGNyZWF0ZSBhbiBhbGdvcml0aG0gaW5zdGFuY2UgYnkgY2FsbGluZyB3aXRoICAgICAgICovCi0vKiAgaEluc3RhbmNlIHNldCB0byBMVk1fTlVMTC4gSW4gdGhpcyBjYXNlIHRoZSBhbGdvcml0aG0gcmV0dXJucyB0aGUgbmV3IGluc3RhbmNlICAqLwotLyogIGhhbmRsZS4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgVGhpcyBmdW5jdGlvbiBjYW4gYmUgdXNlZCB0byBmb3JjZSBhIGZ1bGwgcmUtaW5pdGlhbGlzYXRpb24gb2YgdGhlIGFsZ29yaXRobSAgICAqLwotLyogIGJ5IGNhbGxpbmcgd2l0aCBoSW5zdGFuY2UgPSBJbnN0YW5jZSBIYW5kbGUuIEluIHRoaXMgY2FzZSB0aGUgbWVtb3J5IHRhYmxlICAgICAgKi8KLS8qICBzaG91bGQgYmUgY29ycmVjdCBmb3IgdGhlIGluc3RhbmNlLCB0aGlzIGNhbiBiZSBlbnN1cmVkIGJ5IGNhbGxpbmcgdGhlIGZ1bmN0aW9uICovCi0vKiAgTFZDU19NZW1vcnkgYmVmb3JlIGNhbGxpbmcgdGhpcyBmdW5jdGlvbi4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qIFBBUkFNRVRFUlM6ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgaEluc3RhbmNlICAgICAgICAgICAgICAgSW5zdGFuY2UgaGFuZGxlICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogIHBNZW1vcnlUYWJsZSAgICAgICAgICAgIFBvaW50ZXIgdG8gdGhlIG1lbW9yeSBkZWZpbml0aW9uIHRhYmxlICAgICAgICAgICAgICAgICAgKi8KLS8qICBwQ2FwYWJpbGl0aWVzICAgICAgICAgICBQb2ludGVyIHRvIHRoZSBjYXBhYmlsaXRpZXMgc3RydWN0dXJlICAgICAgICAgICAgICAgICAgICovCi0vKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogUkVUVVJOUzogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICBMVkNTX1N1Y2Nlc3MgICAgICAgICAgICBJbml0aWFsaXNhdGlvbiBzdWNjZWVkZWQgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogTk9URVM6ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICAxLiAgVGhlIGluc3RhbmNlIGhhbmRsZSBpcyB0aGUgcG9pbnRlciB0byB0aGUgYmFzZSBhZGRyZXNzIG9mIHRoZSBmaXJzdCBtZW1vcnkgICovCi0vKiAgICAgIHJlZ2lvbi4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogIDIuICBUaGlzIGZ1bmN0aW9uIG11c3Qgbm90IGJlIGludGVycnVwdGVkIGJ5IHRoZSBMVkNTX1Byb2Nlc3MgZnVuY3Rpb24gICAgICAgICAgKi8KLS8qICAzLiAgVGhpcyBmdW5jdGlvbiBtdXN0IGJlIGNhbGxlZCB3aXRoIHRoZSBzYW1lIGNhcGFiaWxpdGllcyBhcyB1c2VkIGZvciB0aGUgICAgICovCi0vKiAgICAgIGNhbGwgdG8gdGhlIG1lbW9yeSBmdW5jdGlvbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0KLUxWQ1NfUmV0dXJuU3RhdHVzX2VuIExWQ1NfSW5pdChMVkNTX0hhbmRsZV90ICAgICAgICAgKnBoSW5zdGFuY2UsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTFZDU19NZW1UYWJfdCAgICAgIC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UuCi0gKi8KLQotLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLS8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgSGVhZGVyIGZpbGUgZm9yIHRoZSBwcml2YXRlIGxheWVyIGludGVyZmFjZSBvZiBjb25jZXJ0IHNvdW5kLiAgICAgICAgICAgICAgICAgICAqLwotLyogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICBUaGlzIGZpbGVzIGluY2x1ZGVzIGFsbCBkZWZpbml0aW9ucywgdHlwZXMsIHN0cnVjdHVyZXMgYW5kIGZ1bmN0aW9uICAgICAgICAgICAgICovCi0vKiAgcHJvdG90eXBlcyByZXF1aXJlZCBieSB0aGUgZXhlY3V0aW9uIGxheWVyLiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0KLSNpZm5kZWYgX19MVkNTX1BSSVZBVEVfSF9fCi0jZGVmaW5lIF9fTFZDU19QUklWQVRFX0hfXwotCi0jaWZkZWYgX19jcGx1c3BsdXMKLWV4dGVybiAiQyIgewotI2VuZGlmIC8qIF9fY3BsdXNwbHVzICovCi0KLQotLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLS8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgSW5jbHVkZXMgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0KLSNpbmNsdWRlICJMVkNTLmgiICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8qIENhbGxpbmcgb3IgQXBwbGljYXRpb24gbGF5ZXIgZGVmaW5pdGlvbnMgKi8KLSNpbmNsdWRlICJMVkNTX1N0ZXJlb0VuaGFuY2VyLmgiICAgICAgICAgICAgICAgIC8qIFN0ZXJlbyBlbmhhbmNlciBtb2R1bGUgZGVmaW5pdGlvbnMgKi8KLSNpbmNsdWRlICJMVkNTX1JldmVyYkdlbmVyYXRvci5oIiAgICAgICAgICAgICAgIC8qIFJldmVyYmVyYXRpb24gbW9kdWxlIGRlZmluaXRpb25zICovCi0jaW5jbHVkZSAiTFZDU19FcXVhbGlzZXIuaCIgICAgICAgICAgICAgICAgICAgICAvKiBFcXVhbGlzZXIgbW9kdWxlIGRlZmluaXRpb25zICovCi0jaW5jbHVkZSAiTFZDU19CeXBhc3NNaXguaCIgICAgICAgICAgICAgICAgICAgICAvKiBCeXBhc3MgTWl4ZXIgbW9kdWxlIGRlZmluaXRpb25zICovCi0jaW5jbHVkZSAiTFZNX1RpbWVyLmgiCi0KLQotLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLS8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgRGVmaW5lcyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0KLS8qIENvbmZpZ3VyYXRpb24gc3dpdGNoIGNvbnRyb2xzICovCi0jZGVmaW5lIExWQ1NfU1RFUkVPRU5IQU5DRVNXSVRDSCAgICAweDAwMDEgICAgICAvKiBTdGVyZW8gZW5oYW5jZW1lbnQgZW5hYmxlIGNvbnRyb2wgKi8KLSNkZWZpbmUgTFZDU19SRVZFUkJTV0lUQ0ggICAgICAgICAgIDB4MDAwMiAgICAgIC8qIFJldmVyYmVyYXRpb24gZW5hYmxlIGNvbnRyb2wgKi8KLSNkZWZpbmUgTFZDU19FUVVBTElTRVJTV0lUQ0ggICAgICAgIDB4MDAwNCAgICAgIC8qIEVxdWFsaXNlciBlbmFibGUgY29udHJvbCAqLwotI2RlZmluZSBMVkNTX0JZUEFTU01JWFNXSVRDSCAgICAgICAgMHgwMDA4ICAgICAgLyogQnlwYXNzIG1peGVyIGVuYWJsZSBjb250cm9sICovCi0jZGVmaW5lIExWQ1NfQ09NUEdBSU5GUkFNRSAgICAgICAgICA2NCAgICAgICAgICAvKiBDb21wcmVzc29yIGdhaW4gdXBkYXRlIGludGVydmFsICovCi0KLS8qIE1lbW9yeSAqLwotI2RlZmluZSBMVkNTX1NDUkFUQ0hCVUZGRVJTICAgICAgICAgICAgICA2ICAgICAgLyogTnVtYmVyIG9mIGJ1ZmZlcnMgcmVxdWlyZWQgZm9yIGlucGxhY2UgcHJvY2Vzc2luZyAqLwotCi0vKiBHZW5lcmFsICovCi0jZGVmaW5lIExWQ1NfSU5WQUxJRCAgICAgICAgICAgICAgICAweEZGRkYgICAgICAvKiBJbnZhbGlkIGluaXQgcGFyYW1ldGVyICovCi0jZGVmaW5lIExWQ1NfQllQQVNTX01JWEVSX1RDICAgICAgICAxMDAgICAgICAgICAvKiBCeXBhc3MgbWl4ZXIgdGltZSAqLwotCi0vKiBBY2Nlc3MgdG8gZXh0ZXJuYWwgY29lZmZpY2llbnRzIHRhYmxlICovCi0jZGVmaW5lIExWQ1NfTlJfT0ZfRlMgICAgICAgICAgICAgICAgICAgIDkKLSNkZWZpbmUgTFZDU19OUl9PRl9DSEFOX0NGRyAgICAgICAgICAgICAgMgotCi0KLS8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0vKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogIFR5cGVzICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotCi10eXBlZGVmIExWTV9VSU5UMTYgIExWQ1NfQ29uZmlndXJhdGlvbl90OyAgICAgICAvKiBJbnRlcm5hbCBhbGdvcml0aG0gY29uZmlndXJhdGlvbiAqLwotCi10eXBlZGVmIGVudW0KLXsKLSAgICBMVkNTX0hFQURQSE9ORSAgPSAwLAotICAgIExWQ1NfREVWSUNFX01BWCA9IExWTV9NQVhFTlVNCi19IExWQ1NfT3V0cHV0RGV2aWNlX2VuOwotCi0KLS8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0vKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogIFN0cnVjdHVyZXMgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotCi0vKiBWb2x1bWUgY29ycmVjdGlvbiBzdHJ1Y3R1cmUgKi8KLXR5cGVkZWYgc3RydWN0Ci17Ci0gICAgTFZNX0lOVDE2ICAgQ29tcEZ1bGw7ICAgICAgICAgICAgICAgICAgICAgICAvKiBQb3N0IENTIGNvbXByZXNzaW9uIDEwMCUgZWZmZWN0ICovCi0gICAgTFZNX0lOVDE2ICAgQ29tcE1pbjsgICAgICAgICAgICAgICAgICAgICAgICAvKiBQb3N0IENTIGNvbXByZXNzaW9uIDAlIGVmZmVjdCAqLwotICAgIExWTV9JTlQxNiAgIEdhaW5GdWxsOyAgICAgICAgICAgICAgICAgICAgICAgLyogQ1MgZ2FpbiBjb3JyZWN0IDEwMCUgZWZmZWN0ICovCi0gICAgTFZNX0lOVDE2ICAgR2Fpbk1pbjsgICAgICAgICAgICAgICAgICAgICAgICAvKiBDUyBnYWluIGNvcnJlY3QgMCUgZWZmZWN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kdlbmVyYXRvcl90ICBSZXZlcmJlcmF0aW9uOyAgICAgIC8qIFJldmVyYmVyYXRpb24gY29uZmlndXJhdGlvbiAqLwotICAgIExWQ1NfRXF1YWxpc2VyX3QgICAgICAgIEVxdWFsaXNlcjsgICAgICAgICAgLyogRXF1YWxpc2VyIGNvbmZpZ3VyYXRpb24gKi8KLSAgICBMVkNTX0J5cGFzc01peF90ICAgICAgICBCeXBhc3NNaXg7ICAgICAgICAgIC8qIEJ5cGFzcyBtaXhlciBjb25maWd1cmF0aW9uICovCi0KLSAgICAvKiBCeXBhc3MgdmFyaWFibGUgKi8KLSAgICBMVk1fSU5UMTYgICAgICAgICAgICAgICBNU1RhcmdldDA7ICAgICAgICAgICAgICAgICAgICAgICAgICAvKiBNaXhlciBzdGF0ZSBjb250cm9sIHZhcmlhYmxlIGZvciBzbW9vdGggdHJhbnN0aW9uICovCi0gICAgTFZNX0lOVDE2ICAgICAgICAgICAgICAgTVNUYXJnZXQxOyAgICAgICAgICAgICAgICAgICAgICAgICAgLyogTWl4ZXIgc3RhdGUgY29udHJvbCB2YXJpYWJsZSBmb3Igc21vb3RoIHRyYW5zdGlvbiAqLwotICAgIExWTV9JTlQxNiAgICAgICAgICAgICAgIGJJbk9wZXJhdGluZ01vZGVUcmFuc2l0aW9uOyAgICAgICAgIC8qIE9wZXJhdGluZyBtb2RlIHRyYW5zaXRpb24gZmxhZyAqLwotICAgIExWTV9JTlQxNiAgICAgICAgICAgICAgIGJUaW1lckRvbmU7ICAgICAgICAgICAgICAgICAgICAgICAgIC8qIFRpbWVyIGNvbXBsZXRpb24gZmxhZyAqLwotICAgIExWTV9UaW1lcl9QYXJhbXNfdCAgICAgIFRpbWVyUGFyYW1zOyAgICAgICAgICAgICAgICAgICAgICAgIC8qIFRpbWVyIHBhcmFtZXRlcnMgKi8KLSAgICBMVk1fVGltZXJfSW5zdGFuY2VfdCAgICBUaW1lckluc3RhbmNlOyAgICAgICAgICAgICAgICAgICAgICAvKiBUaW1lci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FOWSBLSU5ELCBlaXRoZXIgZXhwcmVzcyBvciBpbXBsaWVkLgotICogU2VlIHRoZSBMaWNlbnNlIGZvciB0aGUgc3BlY2lmaWMgbGFuZ3VhZ2UgZ292ZXJuaW5nIHBlcm1pc3Npb25zIGFuZAotICogbGltaXRhdGlvbnMgdW5kZXIgdGhlIExpY2Vuc2UuCi0gKi8KLQotCi0vKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotLyogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICBJbmNsdWRlcyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLQotI2luY2x1ZGUgIkxWQ1MuaCIKLSNpbmNsdWRlICJMVkNTX1ByaXZhdGUuaCIKLSNpbmNsdWRlICJWZWN0b3JBcml0aG1ldGljLmgiCi0jaW5jbHVkZSAiQ29tcExpbS5oIgotCi0vKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotLyogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qIEZVTkNUSU9OOiAgICAgICAgICAgICAgICBMVkNTX1Byb2Nlc3NfQ1MgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogREVTQ1JJUFRJT046ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICBQcm9jZXNzIGZ1bmN0aW9uIGZvciB0aGUgQ29uY2VydCBTb3VuZCBtb2R1bGUgYmFzZWQgb24gdGhlIGZvbGxvd2luZyBibG9jayAgICAgICovCi0vKiAgZGlhZ3JhbTogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogICAgICAgICAgICBfX19fX19fX18gICAgX19fX19fX18gICAgX19fX18gICAgX19fX19fXyAgICAgX19fICAgX19fX19fICAgICAgICAgICAgKi8KLS8qICAgICAgICAgICB8ICAgICAgICAgfCAgfCAgICAgICAgfCAgfCAgICAgfCAgfCAgICAgICB8ICAgfCAgIHwgfCAgICAgIHwgICAgICAgICAgICovCi0vKiAgICAgLS0tLS0+fCBTdGVyZW8gIHwtPnwgUmV2ZXJiIHwtPnwgRXF1IHwtPnwgQWxwaGEgfC0tPnwgKyB8LXwgR2FpbiB8LS0tLT4gICAgICAqLwotLyogICAgICAgIHwgIHwgRW5oYW5jZSB8ICB8X19fX19fX198ICB8X19fX198ICB8X19fX19fX3wgICB8X19ffCB8X19fX19ffCAgICAgICAgICAgKi8KLS8qICAgICAgICB8ICB8X19fX19fX19ffCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8ICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgICAgICAgfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIF9fX19fX19fX19fICAgICAgfCAgICAgICAgICAgICAgICAgICAgICAqLwotLyogICAgICAgIHwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwgICAgICAgICAgIHwgICAgIHwgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICAgICAgICB8LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLT58IDEgLSBBbHBoYSB8LS0tLS18ICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfF9fX19fX19fX19ffCAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICBUaGUgU3RlcmVvIEVuaGFuY2VyLCBSZXZlcmIgYW5kIEVxdWFsaXNlciBibG9ja3MgYXJlIGVhY2ggY29uZmlndXJlZCB0byBoYXZlICAgICovCi0vKiAgdGhlaXIgZ2FpbiB0byBnaXZlIGEgbmVhciBwZWFrIHRvIHBlYWsgb3V0cHV0ICgtMC4xZEJGUykgd2l0aCBhIHdvcnN0IGNhc2UgICAgICAqLwotLyogIGlucHV0IHNpZ25hbC4gVGhlIGdhaW5zIG9mIHRoZXNlIGJsb2NrcyBhcmUgcmUtY29tYmluZWQgaW4gdGhlIEFscGhhIG1peGVyIGFuZCAgKi8KLS8qICB0aGUgZ2FpbiBibG9jayBmb2xsb2luZyB0aGUgc3VtLiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogIFRoZSBwcm9jZXNzaW5nIHVzZXMgdGhlIG91dHB1dCBidWZmZXIgZm9yIGRhdGEgc3RvcmFnZSBhZnRlciBlYWNoIHByb2Nlc3NpbmcgICAgKi8KLS8qICBibG9jay4gV2hlbiBwcm9jZXNzaW5nIGlzIGlucGxhY2UgYSBjb3B5IG9mIHRoZSBpbnB1dCBzaWduYWwgaXMgbWFkZSBpbiBzY3JhdGNoICovCi0vKiAgbWVtb3J5IGZvciB0aGUgMS1BbHBoYSBwYXRoLiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiBQQVJBTUVURVJTOiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogIGhJbnN0YW5jZSAgICAgICAgICAgICAgIEluc3RhbmNlIGhhbmRsZSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICBwSW5EYXRhICAgICAgICAgICAgICAgICBQb2ludGVyIHRvIHRoZSBpbnB1dCBkYXRhICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgcE91dERhdGEgICAgICAgICAgICAgICAgUG9pbnRlciB0byB0aGUgb3V0cHV0IGRhdGEgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogIE51bVNhbXBsZXMgICAgICAgICAgICAgIE51bWJlciBvZiBzYW1wbGVzIGluIHRoZSBpbnB1dCBidWZmZXIgICAgICAgICAgICAgICAgICAgKi8KLS8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiBSRVRVUk5TOiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogIExWQ1NfU3VjY2VzcyAgICAgICAgICAgIFN1Y2NlZWRlZCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiBOT1RFUzogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0KLUxWQ1NfUmV0dXJuU3RhdHVzX2VuIExWQ1NfUHJvY2Vzc19DUyhMVkNTX0hhbmRsZV90ICAgICAgICAgICAgICBoSW5zdGFuY2UsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY29uc3QgTFZNX0lOVDE2ICAgICAgICAgICAgKnBJbkRhdGEsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTFZNX0lOVDE2ICAgICAgICAgICAgICAgICAgKnBPdXREYXRhLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIExWTV9VSU5UMTYgICAgICAgICAgICAgICAgIE51bVNhbXBsZXMpCi17Ci0gICAgY29uc3QgTFZNX0lOVDE2ICAgICAqcElucHV0OwotICAgIExWQ1NfSW5zdGFuY2VfdCAgICAgKnBJbnN0YW5jZSA9IChMVkNTX0luc3RhbmNlX3QgICopaEluc3RhbmNlOwotICAgIExWTV9JTlQxNiAgICAgICAgICAgKnBTY3JhdGNoICA9IChMVk1fSU5UMTYgKilwSW5zdGFuY2UtPk1lbW9yeVRhYmxlLlJlZ2lvbltMVkNTX01FTVJFR0lPTl9URU1QT1JBUllfRkFTVF0ucEJhc2VBZGRyZXNzOwotICAgIExWQ1NfUmV0dXJuU3RhdHVzX2VuIGVycjsKLQotICAgIC8qCi0gICAgICogQ2hlY2sgaWYgdGhlIHByb2Nlc3NpbmcgaXMgaW5wbGFjZQotICAgICAqLwotICAgIGlmIChwSW5EYXRhID09IHBPdXREYXRhKQotICAgIHsKLSAgICAgICAgLyogUHJvY2Vzc2luZyBpbnBsYWNlICovCi0gICAgICAgIHBJbnB1dCA9IHBTY3JhdGNoICsgKDIqTnVtU2FtcGxlcyk7Ci0gICAgICAgIENvcHlfMTYoKExWTV9JTlQxNiAqKXBJbkRhdGEsICAgICAgICAgICAvKiBTb3VyY2UgKi8KLSAgICAgICAgICAgICAgICAoTFZNX0lOVDE2ICopcElucHV0LCAgICAgICAgICAgIC8qIERlc3RpbmF0aW9uICovCi0gICAgICAgICAgICAgICAgKExWTV9JTlQxNikoMipOdW1TYW1wbGVzKSk7ICAgICAvKiBMZWZ0IGFuZCByaWdodCAqLwotICAgIH0KLSAgICBlbHNlCi0gICAgewotICAgICAgICAvKiBQcm9jZXNzaW5nIG91dHBsYWNlICovCi0gICAgICAgIHBJbnB1dCA9IHBJbkRhdGE7Ci0gICAgfQotCi0gICAgLyoKLSAgICAgKiBDYWxsIHRoZSBzdGVyZW8gZW5oYW5jZXIKLSAgICAgKi8KLSAgICBlcnI9TFZDU19TdGVyZW9FbmhhbmNlcihoSW5zdGFuY2UsICAgICAgICAgICAgICAvKiBJbnN0YW5jZSBoYW5kbGUgKi8KLSAgICAgICAgICAgICAgICAgICAgICAgIHBJbkRhdGEsICAgICAgICAgICAgICAgICAgICAvKiBQb2ludGVyIHRvIHRoZSBpbnB1dCBkYXRhICovCi0gICAgICAgICAgICAgICAgICAgICAgICBwT3V0RGF0YSwgICAgICAgICAgICAgICAgICAgLyogUG9pbnRlciB0byB0aGUgb3V0cHV0IGRhdGEgKi8KLSAgICAgICAgICAgICAgICAgICAgICAgIE51bVNhbXBsZXMpOyAgICAgICAgICAgICAgICAvKiBOdW1iZXIgb2Ygc2FtcGxlcyB0byBwcm9jZXNzICovCi0KLSAgICAvKgotICAgICAqIENhbGwgdGhlIHJldmVyYiBnZW5lcmF0b3IKLSAgICAgKi8KLSAgICBlcnI9TFZDU19SZXZlcmJHZW5lcmF0b3IoaEluc3RhbmNlLCAgICAgICAgICAgICAvKiBJbnN0YW5jZSBoYW5kbGUgKi8KLSAgICAgICAgICAgICAgICAgICAgICAgICBwT3V0RGF0YSwgICAgICAgICAgICAgICAgICAvKiBQb2ludGVyIHRvIHRoZSBpbnB1dCBkYXRhICovCi0gICAgICAgICAgICAgICAgICAgICAgICAgcE91dERhdGEsICAgICAgICAgICAgICAgICAgLyogUG9pbnRlciB0byB0aGUgb3V0cHV0IGRhdGEgKi8KLSAgICAgICAgICAgICAgICAgICAgICAgICBOdW1TYW1wbGVzKTsgICAgICAgICAgICAgICAvKiBOdW1iZXIgb2Ygc2FtcGxlcyB0byBwcm9jZXNzICovCi0KLSAgICAvKgotICAgICAqIENhbGwgdGhlIGVxdWFsaXNlcgotICAgICAqLwotICAgIGVycj1MVkNTX0VxdWFsaXNlcihoSW5zdGFuY2UsICAgICAgICAgICAgICAgICAgIC8qIEluc3RhbmNlIGhhbmRsZSAqLwotICAgICAgICAgICAgICAgICAgIHBPdXREYXRhLCAgICAgICAgICAgICAgICAgICAgICAgIC8qIFBvaW50ZXIgdG8gdGhlIGlucHV0IGRhdGEgKi8KLSAgICAgICAgICAgICAgICAgICBOdW1TYW1wbGVzKTsgICAgICAgICAgICAgICAgICAgICAvKiBOdW1iZXIgb2Ygc2FtcGxlcyB0byBwcm9jZXNzICovCi0KLSAgICAvKgotICAgICAqIENhbGwgdGhlIGJ5cGFzcyBtaXhlcgotICAgICAqLwotICAgIGVycj1MVkNTX0J5cGFzc01peGVyKGhJbnN0YW5jZSwgICAgICAgICAgICAgICAgIC8qIEluc3RhbmNlIGhhbmRsZSAqLwotICAgICAgICAgICAgICAgICAgICAgcE91dERhdGEsICAgICAgICAgICAgICAgICAgICAgIC8qIFBvaW50ZXIgdG8gdGhlIHByb2Nlc3NlZCBkYXRhICovCi0gICAgICAgICAgICAgICAgICAgICBwSW5wdXQsICAgICAgICAgICAgICAgICAgICAgICAgLyogUG9pbnRlciB0byB0aGUgaW5wdXQgKHVucHJvY2Vzc2VkKSBkYXRhICovCi0gICAgICAgICAgICAgICAgICAgICBwT3V0RGF0YSwgICAgICAgICAgICAgICAgICAgICAgLyogUG9pbnRlciB0byB0aGUgb3V0cHV0IGRhdGEgKi8KLSAgICAgICAgICAgICAgICAgICAgIE51bVNhbXBsZXMpOyAgICAgICAgICAgICAgICAgICAvKiBOdW1iZXIgb2Ygc2FtcGxlcyB0byBwcm9jZXNzICovCi0KLSAgICBpZihlcnIgIT1MVkNTX1NVQ0NFU1MpCi0gICAgewotICAgICAgICByZXR1cm4gZXJyOwotICAgIH0KLQotICAgIHJldHVybihMVkNTX1NVQ0NFU1MpOwotfQotCi0vKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotLyogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qIEZVTkNUSU9OOiAgICAgICAgICAgICAgICBMVkNTX1Byb2Nlc3MgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogREVTQ1JJUFRJT046ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICBQcm9jZXNzIGZ1bmN0aW9uIGZvciB0aGUgQ29uY2VydCBTb3VuZCBtb2R1bGUuIFRoZSBpbXBsZW1lbnRhdGlvbiBzdXBwb3J0cyB0d28gICovCi0vKiAgdmFyaWFudHMgb2YgdGhlIGFsZ29yaXRobSwgb25lIGZvciBoZWFkcGhvbmVzIGFuZCBvbmUgZm9yIG1vYmlsZSBzcGVha2Vycy4gICAgICAqLwotLyogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICBEYXRhIGNhbiBiZSBwcm9jZXNzZWQgaW4gdHdvIGZvcm1hdHMsIHN0ZXJlbyBvciBtb25vLWluLXN0ZXJlby4gRGF0YSBpbiBtb25vICAgICovCi0vKiAgZm9ybWF0IGlzIG5vdCBzdXBwb3J0ZWQsIHRoZSBjYWxsaW5nIHJvdXRpbmUgbXVzdCBjb252ZXJ0IHRoZSBtb25vIHN0cmVhbSB0byAgICAqLwotLyogIG1vbm8taW4tc3RlcmVvLiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogUEFSQU1FVEVSUzogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICBoSW5zdGFuY2UgICAgICAgICAgICAgICBJbnN0YW5jZSBoYW5kbGUgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgcEluRGF0YSAgICAgICAgICAgICAgICAgUG9pbnRlciB0byB0aGUgaW5wdXQgZGF0YSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogIHBPdXREYXRhICAgICAgICAgICAgICAgIFBvaW50ZXIgdG8gdGhlIG91dHB1dCBkYXRhICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICBOdW1TYW1wbGVzICAgICAgICAgICAgICBOdW1iZXIgb2Ygc2FtcGxlcyBpbiB0aGUgaW5wdXQgYnVmZmVyICAgICAgICAgICAgICAgICAgICovCi0vKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogUkVUVVJOUzogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICBMVkNTX1N1Y2Nlc3MgICAgICAgICAgICBTdWNjZWVkZWQgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgTFZDU19Ub29NYW55U2FtcGxlcyAgICAgTnVtU2FtcGxlcyB3YXMgbGFyZ2VyIHRoYW4gdGhlIG1heGltdW0gYmxvY2sgc2l6ZSAgICAgICAqLwotLyogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qIE5PVEVTOiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLQotTFZDU19SZXR1cm5TdGF0dXNfZW4gTFZDU19Qcm9jZXNzKExWQ1NfSGFuZGxlX3QgICAgICAgICAgICAgaEluc3RhbmNlLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbnN0IExWTV9JTlQxNiAgICAgICAgICAgKnBJbkRhdGEsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTFZNX0lOVDE2ICAgICAgICAgICAgICAgICAqcE91dERhdGEsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTFZNX1VJTlQxNiAgICAgICAgICAgICAgICBOdW1TYW1wbGVzKQotewotCi0gICAgTFZDU19JbnN0YW5jZV90ICpwSW5zdGFuY2UgPShMVkNTX0luc3RhbmNlX3QgICopaEluc3RhbmNlOwotICAgIExWQ1NfUmV0dXJuU3RhdHVzX2VuIGVycjsKLQotICAgIC8qCi0gICAgICogQ2hlY2sgdGhlIG51bWJlciBvZiBzYW1wbGVzIGlzIG5vdCB0b28gbGFyZ2UKLSAgICAgKi8KLSAgICBpZiAoTnVtU2FtcGxlcyA+IHBJbnN0YW5jZS0+Q2FwYWJpbGl0aWVzLk1heEJsb2NrU2l6ZSkKLSAgICB7Ci0gICAgICAgIHJldHVybihMVkNTX1RPT01BTllTQU1QTEVTKTsKLSAgICB9Ci0KLSAgICAvKgotICAgICAqIENoZWNrIGlmIHRoZSBhbGdvcml0aG0gaXMgZW5hYmxlZAotICAgICAqLwotICAgIGlmIChwSW5zdGFuY2UtPlBhcmFtcy5PcGVyYXRpbmdNb2RlICE9IExWQ1NfT0ZGKQotICAgIHsKLSAgICAgICAgLyoKLSAgICAgICAgICogQ2FsbCBDUyBwcm9jZXNzIGZ1bmN0aW9uCi0gICAgICAgICAqLwotICAgICAgICAgICAgZXJyPUxWQ1NfUHJvY2Vzc19DUyhoSW5zdGFuY2UsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgcEluRGF0YSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBwT3V0RGF0YSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBOdW1TYW1wbGVzKTsKLQotICAgICAgICAvKgotICAgICAgICAgKiBDb21wcmVzcyB0byByZWR1Y2UgZXhwYW5zaW9uIGVmZmVjdCBvZiBDb25jZXJ0IFNvdW5kIGFuZCBjb3JyZWN0IHZvbHVtZQotICAgICAgICAgKiBkaWZmZXJlbmNlcyBmb3IgZGlmZmVyZW5jZSBzZXR0aW5ncy4gTm90IGFwcGxpZWQgaW4gdGVzdCBtb2RlcwotICAgICAgICAgKi8KLSAgICAgICAgaWYgKChwSW5zdGFuY2UtPlBhcmFtcy5PcGVyYXRpbmdNb2RlID09IExWQ1NfT04pJiYocEluc3RhbmNlLT5QYXJhbXMuQ29tcHJlc3Nvck1vZGUgPT0gTFZNX01PREVfT04pKQotICAgICAgICB7Ci0gICAgICAgICAgICBMVk1fSU5UMTYgR2FpbiA9IHBJbnN0YW5jZS0+Vm9sQ29ycmVjdC5Db21wTWluOwotICAgICAgICAgICAgTFZNX0lOVDMyIEN1cnJlbnQxOwotCi0gICAgICAgICAgICBDdXJyZW50MSA9IExWQ19NaXhlcl9HZXRDdXJyZW50KCZwSW5zdGFuY2UtPkJ5cGFzc01peC5NaXhlcl9JbnN0YW5jZS5NaXhlclN0cmVhbVswXSk7Ci0gICAgICAgICAgICBHYWluID0gKExWTV9JTlQxNikoICBwSW5zdGFuY2UtPlZvbENvcnJlY3QuQ29tcE1pbgotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC0gKCgoTFZNX0lOVDMyKXBJbnN0YW5jZS0+Vm9sQ29ycmVjdC5Db21wTWluICAqIChDdXJyZW50MSkpID4+IDE1KQotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICsgKCgoTFZNX0lOVDMyKXBJbnN0YW5jZS0+Vm9sQ29ycmVjdC5Db21wRnVsbCAqIChDdXJyZW50MSkpID4+IDE1KSApOwotCi0gICAgICAgICAgICBpZihOdW1TYW1wbGVzIDwgTFZDU19DT01QR0FJTkZSQU1FKQotICAgICAgICAgICAgewotICAgICAgICAgICAgICAgIE5vbkxpbkNvbXBfRDE2KEdhaW4sICAgICAgICAgICAgICAgICAgICAvKiBDb21wcmVzc29yIGdhaW4gc2V0dGluZyAqLwotICAgICAgICAgICAgICAgICAgICBwT3V0RGF0YSwKLSAgICAgICAgICAgICAgICAgICAgcE91dERhdGEsCi0gICAgICAgICAgICAgICAgICAgIChMVk1fSU5UMzIpKDIqTnVtU2FtcGxlcykpOwotICAgICAgICAgICAgfQotICAgICAgICAgICAgZWxzZQotICAgICAgICAgICAgewotICAgICAgICAgICAgICAgIExWTV9JTlQxNiAgR2FpblN0ZXA7Ci0gICAgICAgICAgICAgICAgTFZNX0lOVDE2ICBGaW5hbEdhaW47Ci0gICAgICAgICAgICAgICAgTFZNX0lOVDE2ICBTYW1wbGVUb1Byb2Nlc3MgPSBOdW1TYW1wbGVzOwotICAgICAgICAgICAgICAgIExWTV9JTlQxNiAgKnBPdXRQdHI7Ci0KLSAgICAgICAgICAgICAgICAvKiBMYXJnZSBjaGFuZ2VzIGluIEdhaW4gY2FuIGNhdXNlIGNsaWNrcyBpbiBvdXRwdXQKLSAgICAgICAgICAgICAgICAgICBTcGxpdCBkYXRhIGludG8gc21hbGwgYmxvY2tzIGFuZCB1c2UgaW50ZXJwb2xhdGVkIGdhaW4gdmFsdWVzICovCi0KLSAgICAgICAgICAgICAgICBHYWluU3RlcCA9IChMVk1fSU5UMTYpKCgoR2Fpbi1wSW5zdGFuY2UtPkNvbXByZXNzR2FpbikgKiBMVkNTX0NPTVBHQUlORlJBTUUpL051bVNhbXBsZXMpOwotCi0gICAgICAgICAgICAgICAgaWYoKEdhaW5TdGVwID09MCkmJihwSW5zdGFuY2UtPkNvbXByZXNzR2FpbiA8IEdhaW4pKQotICAgICAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAgICAgR2FpblN0ZXA9MTsKLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgZWxzZQotICAgICAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAgICAgaWYoKEdhaW5TdGVwID09MCkmJihwSW5zdGFuY2UtPkNvbXByZXNzR2FpbiA+IEdhaW4pKQotICAgICAgICAgICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgICAgICAgICBHYWluU3RlcD0tMTsKLSAgICAgICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgICAgIEZpbmFsR2FpbiA9IEdhaW47Ci0gICAgICAgICAgICAgICAgR2FpbiA9IHBJbnN0YW5jZS0+Q29tcHJlc3NHYWluOwotICAgICAgICAgICAgICAgIHBPdXRQdHIgPSBwT3V0RGF0YTsKLQotICAgICAgICAgICAgICAgIHdoaWxlKFNhbXBsZVRvUHJvY2VzcyA+IDApCi0gICAgICAgICAgICAgICAgewotICAgICAgICAgICAgICAgICAgICBHYWluID0gKExWTV9JTlQxNikoR2FpbiArIEdhaW5TdGVwKTsKLSAgICAgICAgICAgICAgICAgICAgaWYoKEdhaW5TdGVwID4gMCkmJiAoRmluYWxHYWluIDw9IEdhaW4pKQotICAgICAgICAgICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgICAgICAgICBHYWluID0gRmluYWxHYWluOwotICAgICAgICAgICAgICAgICAgICAgICAgR2FpblN0ZXAgPTA7Ci0gICAgICAgICAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgICAgICAgICBpZigoR2FpblN0ZXAgPCAwKSYmIChGaW5hbEdhaW4gPiBHYWluKSkKLSAgICAgICAgICAgICAgICAgICAgewotICAgICAgICAgICAgICAgICAgICAgICAgR2FpbiA9IEZpbmFsR2FpbjsKLSAgICAgICAgICAgICAgICAgICAgICAgIEdhaW5TdGVwID0wOwotICAgICAgICAgICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgICAgICAgICAgaWYoU2FtcGxlVG9Qcm9jZXNzID4gTFZDU19DT01QR0FJTkZSQU1FKQotICAgICAgICAgICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgICAgICAgICBOb25MaW5Db21wX0QxNihHYWluLCAgICAgICAgICAgICAgICAgICAgLyogQ29tcHJlc3NvciBnYWluIHNldHRpbmcgKi8KLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBwT3V0UHRyLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBPdXRQdHIsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgKExWTV9JTlQzMikoMipMVkNTX0NPTVBHQUlORlJBTUUpKTsKLSAgICAgICAgICAgICAgICAgICAgICAgIHBPdXRQdHIgKz0oMipMVkNTX0NPTVBHQUlORlJBTUUpOwotICAgICAgICAgICAgICAgICAgICAgICAgU2FtcGxlVG9Qcm9jZXNzID0gKExWTV9JTlQxNikoU2FtcGxlVG9Qcm9jZXNzLUxWQ1NfQ09NUEdBSU5GUkFNRSk7Ci0gICAgICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICAgICAgZWxzZQotICAgICAgICAgICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgICAgICAgICBOb25MaW5Db21wX0QxNihHYWluLCAgICAgICAgICAgICAgICAgICAgLyogQ29tcHJlc3NvciBnYWluIHNldHRpbmcgKi8KLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBwT3V0UHRyLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBPdXRQdHIsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgKExWTV9JTlQzMikoMipTYW1wbGVUb1Byb2Nlc3MpKTsKLQotICAgICAgICAgICAgICAgICAgICAgICAgU2FtcGxlVG9Qcm9jZXNzID0gMDsKLSAgICAgICAgICAgICAgICAgICAgfQotCi0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgfQotCi0gICAgICAgICAgICAvKiBTdG9yZSBnYWluIHZhbHVlKi8KLSAgICAgICAgICAgIHBJbnN0YW5jZS0+Q29tcHJlc3NHYWluID0gR2FpbjsKLSAgICAgICAgfQotCi0KLSAgICAgICAgaWYocEluc3RhbmNlLT5iSW5PcGVyYXRpbmdNb2RlVHJhbnNpdGlvbiA9PSBMVk1fVFJVRSl7Ci0KLSAgICAgICAgICAgIC8qCi0gICAgICAgICAgICAgKiBSZS1pbml0IGJ5cGFzcyBtaXggd2hlbiB0aW1lciBoYXMgY29tcGxldGVkCi0gICAgICAgICAgICAgKi8KLSAgICAgICAgICAgIGlmICgocEluc3RhbmNlLT5iVGltZXJEb25lID09IExWTV9UUlVFKSAmJgotICAgICAgICAgICAgICAgIChwSW5zdGFuY2UtPkJ5cGFzc01peC5NaXhlcl9JbnN0YW5jZS5NaXhlclN0cmVhbVsxXS5DYWxsYmFja1NldCA9PSAwKSkKLSAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICBlcnI9TFZDU19CeXBhc3NNaXhJbml0KGhJbnN0YW5jZSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJnBJbnN0YW5jZS0+UGFyYW1zKTsKLQotICAgICAgICAgICAgICAgIGlmKGVyciAhPSBMVkNTX1NVQ0NFU1MpCi0gICAgICAgICAgICAgICAgewotICAgICAgICAgICAgICAgICAgICByZXR1cm4gZXJyOwotICAgICAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgfQotICAgICAgICAgICAgZWxzZXsKLSAgICAgICAgICAgICAgICBMVk1fVGltZXIgKCAmcEluc3RhbmNlLT5UaW1lckluc3RhbmNlLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgIChMVk1fSU5UMTYpTnVtU2FtcGxlcyk7Ci0gICAgICAgICAgICB9Ci0gICAgICAgIH0KLSAgICB9Ci0gICAgZWxzZQotICAgIHsKLSAgICAgICAgaWYgKHBJbkRhdGEgIT0gcE91dERhdGEpCi0gICAgICAgIHsKLSAgICAgICAgICAgIC8qCi0gICAgICAgICAgICAgKiBUaGUgYWxnb3JpdGhtIGlzIGRpc2FibGVkIHNvIGp1c3QgY29weSB0aGUgZGF0YQotICAgICAgICAgICAgICovCi0gICAgICAgICAgICBDb3B5XzE2KChMVk1fSU5UMTYgKil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B5IG9mIHRoZSBMaWNlbnNlIGF0Ci0gKgotICogICAgICBodHRwOi8vd3d3LmFwYWNoZS5vcmcvbGljZW5zZXMvTElDRU5TRS0yLjAKLSAqCi0gKiBVbmxlc3MgcmVxdWlyZWQgYnkgYXBwbGljYWJsZSBsYXcgb3IgYWdyZWVkIHRvIGluIHdyaXRpbmcsIHNvZnR3YXJlCi0gKiBkaXN0cmlidXRlZCB1bmRlciB0aGUgTGljZW5zZSBpcyBkaXN0cmlidXRlZCBvbiBhbiAiQVMgSVMiIEJBU0lTLAotICogV0lUSE9VVCBXQVJSQU5USUVTIE9SIENPTkRJVElPTlMgT0YgQU5ZIEtJTkQsIGVpdGhlciBleHByZXNzIG9yIGltcGxpZWQuCi0gKiBTZWUgdGhlIExpY2Vuc2UgZm9yIHRoZSBzcGVjaWZpYyBsYW5ndWFnZSBnb3Zlcm5pbmcgcGVybWlzc2lvbnMgYW5kCi0gKiBsaW1pdGF0aW9ucyB1bmRlciB0aGUgTGljZW5zZS4KLSAqLwotCi0vKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotLyogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICBJbmNsdWRlcyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLQotI2luY2x1ZGUgIkxWQ1MuaCIKLSNpbmNsdWRlICJMVkNTX1ByaXZhdGUuaCIKLSNpbmNsdWRlICJMVkNTX1JldmVyYkdlbmVyYXRvci5oIgotI2luY2x1ZGUgIkxWQ19NaXhlci5oIgotI2luY2x1ZGUgIlZlY3RvckFyaXRobWV0aWMuaCIKLSNpbmNsdWRlICJCSVFVQUQuaCIKLSNpbmNsdWRlICJMVkNTX1RhYmxlcy5oIgotCi0vKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotLyogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qIEZVTkNUSU9OOiAgICAgICAgICAgICAgICBMVkNTX1JldmVyYkdlbmVyYXRvckluaXQgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogREVTQ1JJUFRJT046ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICBJbml0aWFsaXNlcyB0aGUgcmV2ZXJiIG1vZHVsZS4gVGhlIGRlbGF5IGJ1ZmZlciBzaXplIGlzIGNvbmZpZ3VyZWQgZm9yIHRoZSAgICAgICovCi0vKiAgc2FtcGxlIHJhdGUgYW5kIHRoZSBzcGVha2VyIHR5cGUuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICBUaGUgcm91dGluZSBtYXkgYWxzbyBiZSBjYWxsZWQgZm9yIHJlLWluaXRpYWxpc2F0aW9uLCBpLmUuIHdoZW4gb25lIG9mIHRoZSAgICAgICovCi0vKiAgY29udHJvbCBwYXJhbWV0ZXJzIGhhcyBjaGFuZ2VkLiBJbiB0aGlzIGNhc2UgdGhlIGRlbGF5IGFuZCBmaWx0ZXJzIGFyZSBvbmx5ICAgICAqLwotLyogIHJlLWluaXRpYWxpc2VkIGlmIG9uZSBvZiB0aGUgZm9sbG93aW5nIHR3byBjb25kaXRpb25zIGlzIG1ldDogICAgICAgICAgICAgICAgICAgKi8KLS8qICAgICAgLSAgIHRoZSBzYW1wbGUgcmF0ZSBoYXMgY2hhbmdlZCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgICAgIC0gICB0aGUgc3BlYWtlciB0eXBlIGNoYW5nZXMgdG8vZnJvbSB0aGUgbW9iaWxlIHNwZWFrZXIgICAgICAgICAgICAgICAgICAgICAqLwotLyogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiBQQVJBTUVURVJTOiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogIGhJbnN0YW5jZSAgICAgICAgICAgICAgIEluc3RhbmNlIEhhbmRsZSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICBwUGFyYW1zICAgICAgICAgICAgICAgICBQb2ludGVyIHRvIHRoZSBpbmlhbGlzYXRpb24gcGFyYW1ldGVycyAgICAgICAgICAgICAgICAgICovCi0vKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogUkVUVVJOUzogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICBMVkNTX1N1Y2Nlc3MgICAgICAgICAgICBBbHdheXMgc3VjY2VlZHMgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogTk9URVM6ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICAxLiAgSW4gdGhlIGRlbGF5IHNldHRpbmdzICdTYW1wbGVzJyBpcyB0aGUgbnVtYmVyIG9mIHNhbXBsZXMgdG8gdGhlIGVuZCBvZiB0aGUgICovCi0vKiAgICAgIGJ1ZmZlci4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogIDIuICBUaGUgbnVtZXJhdG9yIGNvZWZmaWNpZW50cyBvZiB0aGUgZmlsdGVyIGFyZSBuZWdhdGVkIHRvIGNhdXNlIGFuIGludmVyc2lvbi4gKi8KLS8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotCi1MVkNTX1JldHVyblN0YXR1c19lbiBMVkNTX1JldmVyYkdlbmVyYXRvckluaXQoTFZDU19IYW5kbGVfdCAgICAgaEluc3RhbmNlLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIExWQ1NfUGFyYW1zX3QgICAgIC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Eluc3RhbmNlLT5QYXJhbXMuU2FtcGxlUmF0ZSAhPSBwUGFyYW1zLT5TYW1wbGVSYXRlICkgICAgICAvKiBTYW1wbGUgcmF0ZSBjaGFuZ2UgdGVzdCAqLwotCi0gICAgewotICAgICAgICAvKgotICAgICAgICAgKiBTZXR1cCB0aGUgZGVsYXkKLSAgICAgICAgICovCi0gICAgICAgIERlbGF5ID0gKExWTV9VSU5UMTYpTFZDU19TdGVyZW9EZWxheUNTWyhMVk1fVUlOVDE2KXBQYXJhbXMtPlNhbXBsZVJhdGVdOwotCi0KLSAgICAgICAgcENvbmZpZy0+RGVsYXlTaXplICAgICAgPSAoTFZNX0lOVDE2KSgyICogRGVsYXkpOwotICAgICAgICBwQ29uZmlnLT5EZWxheU9mZnNldCAgICA9IDA7Ci0gICAgICAgIExvYWRDb25zdF8xNigwLCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLyogVmFsdWUgKi8KLSAgICAgICAgICAgICAgICAgICAgIChMVk1fSU5UMTYgKikmcENvbmZpZy0+U3RlcmVvU2FtcGxlc1swXSwgICAgICAgICAgICAgICAgICAgICAgICAgICAvKiBEZXN0aW5hdGlvbiAqLwotICAgICAgICAgICAgICAgICAgICAgKExWTV9VSU5UMTYpKHNpemVvZihwQ29uZmlnLT5TdGVyZW9TYW1wbGVzKS9zaXplb2YoTFZNX0lOVDE2KSkpOyAgIC8qIE51bWJlciBvZiB3b3JkcyAqLwotCi0gICAgICAgIC8qCi0gICAgICAgICAqIFNldHVwIHRoZSBmaWx0ZXJzCi0gICAgICAgICAqLwotICAgICAgICBPZmZzZXQgPSAoTFZNX1VJTlQxNilwUGFyYW1zLT5TYW1wbGVSYXRlOwotICAgICAgICBwUmV2ZXJiQ29lZlRhYmxlID0gKEJpcXVhZEEwMTJCMTJDb2Vmc1NQX3QqKSZMVkNTX1JldmVyYkNvZWZUYWJsZVswXTsKLQotICAgICAgICAvKiBDb252ZXJ0IGluY29taW5nIGNvZWZmaWNpZW50cyB0byB0aGUgcmVxdWlyZWQgZm9ybWF0L29yZGVyaW5nICovCi0gICAgICAgIENvZWZmcy5BMCA9IChMVk1fSU5UMTYpcFJldmVyYkNvZWZUYWJsZVtPZmZzZXRdLkEwOwotICAgICAgICBDb2VmZnMuQTEgPSAoTFZNX0lOVDE2KXBSZXZlcmJDb2VmVGFibGVbT2Zmc2V0XS5BMTsKLSAgICAgICAgQ29lZmZzLkEyID0gKExWTV9JTlQxNilwUmV2ZXJiQ29lZlRhYmxlW09mZnNldF0uQTI7Ci0gICAgICAgIENvZWZmcy5CMSA9IChMVk1fSU5UMTYpLXBSZXZlcmJDb2VmVGFibGVbT2Zmc2V0XS5CMTsKLSAgICAgICAgQ29lZmZzLkIyID0gKExWTV9JTlQxNiktcFJldmVyYkNvZWZUYWJsZVtPZmZzZXRdLkIyOwotCi0gICAgICAgIExvYWRDb25zdF8xNigwLCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLyogVmFsdWUgKi8KLSAgICAgICAgICAgICAgICAgICAgICh2b2lkICopJnBEYXRhLT5SZXZlcmJCaXF1YWRUYXBzLCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLyogRGVzdGluYXRpb24gQ2FzdCB0byB2b2lkOiBubyBkZXJlZmVyZW5jaW5nIGluIGZ1bmN0aW9uKi8KLSAgICAgICAgICAgICAgICAgICAgIChMVk1fVUlOVDE2KShzaXplb2YocERhdGEtPlJldmVyYkJpcXVhZFRhcHMpL3NpemVvZihMVk1fSU5UMTYpKSk7ICAvKiBOdW1iZXIgb2Ygd29yZHMgKi8KLQotICAgICAgICBCUV8ySV9EMTZGMTZDc3NfVFJDX1dSQV8wMV9Jbml0KCZwQ29lZmZpY2llbnRzLT5SZXZlcmJCaXF1YWRJbnN0YW5jZSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmcERhdGEt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AgICAvLyBBY3R1YWwgUmV2ZXJiIExldmVsIGluIFEgMjMgZm9ybWF0Ci0gICAgICAgIHBDb25maWctPlJldmVyYkxldmVsPShMVk1fSU5UMTYpKFJldmVyYlBlcmNlbnRhZ2U+PjgpOyAgLy8gUmV2ZXJiIExldmVsIGluIFEgMTUgZm9ybWF0Ci0gICAgfQotCi0gICAgcmV0dXJuKExWQ1NfU1VDQ0VTUyk7Ci19Ci0KLS8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0vKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogRlVOQ1RJT046ICAgICAgICAgICAgICAgIExWQ1NfUmV2ZXJiICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiBERVNDUklQVElPTjogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogIENyZWF0ZSByZXZlcmIgdXNpbmcgdGhlIGJsb2NrIG9mIGlucHV0IHNhbXBsZXMgYmFzZWQgb24gdGhlIGZvbGxvd2luZyBibG9jayAgICAgKi8KLS8qICBkaWFncmFtOiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgICAgICAgICAgICAgICAgICAgICAgICAgIF9fX19fX19fICAgICAgICAgICAgICBfX19fX19fXyAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogICAgICAgICAgICAgICAgICAgICAgICAgIHwgICAgICAgIHwgICAgICAgICAgICB8ICAgICAgICB8ICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICAgICBfX19fXyAgICAgX19fX19fXyAgICB8ICAgICAgICB8LS0tLS0tLS0tLS0+fCAgICAgICAgfCAgICBfX19fX18gICAgIF9fXyAgICAgICovCi0vKiAgICB8ICAgICB8ICAgfCAgICAgICB8ICAgfCBTdGVyZW8gfCAgICAgICAgICAgIHwgTCAmIFIgIHwgICB8ICAgICAgfCAgIHwgICB8ICAgICAqLwotLyogLS0+fCBMUEYgfC0tPnwgRGVsYXkgfC0tPnwgICB0byAgIHwgICAgX19fXyAgICB8ICAgdG8gICB8LS0+fCBHYWluIHwtLT58ICsgfC0tPiAgKi8KLS8qICB8IHxfX19fX3wgICB8X19fX19fX3wgICB8IEwgJiBSICB8ICAgfCAgICB8ICAgfCBTdGVyZW8gfCAgIHxfX19fX198ICAgfF9fX3wgICAgICovCi0vKiAgfCAgICAgICAgICAgICAgICAgICAgICAgfCAgICAgICAgfC0tPnwgLTEgfC0tPnwgICAgICAgIHwgICAgICAgICAgICAgICAgfCAgICAgICAqLwotLyogIHwgICAgICAgICAgICAgICAgICAgICAgIHxfX19fX19fX3wgICB8X19fX3wgICB8X19fX19fX198ICAgICAgICAgICAgICAgIHwgICAgICAgKi8KLS8qICB8ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8ICAgICAgICovCi0vKiAgfC0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tfCAgICAgICAqLwotLyogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICBUaGUgaW5wdXQgYnVmZmVyIGlzIGJyb2tlbiBpbiB0byBzdWItYmxvY2tzIG9mIHRoZSBzaXplIG9mIHRoZSBkZWxheSBvciBsZXNzLiAgICovCi0vKiAgVGhpcyBhbGxvd3MgdGhlIGRlbGF5IGJ1ZmZlciB0byBiZSB0cmVhdGVkIGFzIGEgY2lyY3VsYXIgYnVmZmVyIGJ1dCBwcm9jZXNzZWQgICAqLwotLyogIGFzIGEgbGluZWFyIGJ1ZmZlci4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogUEFSQU1FVEVSUzogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICBoSW5zdGFuY2UgICAgICAgICAgICAgICBJbnN0YW5jZSBIYW5kbGUgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgcEluRGF0YSAgICAgICAgICAgICAgICAgUG9pbnRlciB0byB0aGUgaW5wdXQgYnVmZmVyICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogIHBPdXREYXRhICAgICAgICAgICAgICAgIFBvaW50ZXIgdG8gdGhlIG91dHB1dCBidWZmZXIgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICBOdW1TYW1wbGVzICAgICAgICAgICAgICBOdW1iZXIgb2Ygc2FtcGxlcyB0byBwcm9jZXNzICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogUkVUVVJOUzogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICBMVkNTX1N1Y2Nlc3MgICAgICAgICAgICBBbHdheXMgc3VjY2VlZHMgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogTk9URVM6ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICAxLiAgUHJvY2VzcyBpbiBibG9ja3Mgb2Ygc2FtcGxlcyB0aGUgc2l6ZSBvZiB0aGUgZGVsYXkgd2hlcmUgcG9zc2libGUsIGlmIG5vdCAgICovCi0vKiAgICAgIHRoZSBudW1iZXIgb2Ygc2FtcGxlcyBsZWZ0IG92ZXIgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogIDIuICBUaGUgR2FpbiBpcyBjb21iaW5lZCB3aXRoIHRoZSBMUEYgYW5kIGluY29ycG9yYXRlZCBpbiB0byB0aGUgY29lZmZpY2llbnRzICAgKi8KLS8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotCi1MVkNTX1JldHVyblN0YXR1c19lbiBMVkNTX1JldmVyYkdlbmVyYXRvcihMVkNTX0hhbmRsZV90ICAgICAgICAgaEluc3RhbmNlLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY29uc3QgTFZNX0lOVDE2ICAgICAgICpwSW5EYXRhLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTFZNX0lOVDE2ICAgICAgICAgICAgICpwT3V0RGF0YSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIExWTV9VSU5UMTYgICAgICAgICAgICBOdW1TYW1wbGVzKQotewotCi0gICAgTFZDU19JbnN0YW5jZV90ICAgICAgICAgKnBJbnN0YW5jZSA9IChMVkNTX0luc3RhbmNlX3QgICopaEluc3RhbmNlOwotICAgIExWQ1NfUmV2ZXJiR2VuZXJhdG9yX3QgICpwQ29uZmlnICAgPSAoTFZDU19SZXZlcmJHZW5lcmF0b3JfdCAqKSZwSW5zdGFuY2UtPlJldmVyYmVyYXRpb247Ci0gICAgTFZDU19Db2VmZmljaWVudF90ICAgICAgKnBDb2VmZmljaWVudHMgPSAoTFZDU19Db2VmZmljaWVudF90ICopcEluc3RhbmNlLT5NZW1vcnlUYWJsZS5SZWdpb25bTFZDU19NRU1SRUdJT05fUEVSU0lTVEVOVF9GQVNUX0NPRUZdLnBCYXNlQWRkcmVzczsKLSAgICBMVk1fSU5UMTYgICAgICAgICAgICAgICAqcFNjcmF0Y2ggID0gKExWTV9JTlQxNiAqKXBJbnN0YW5jZS0+TWVtb3J5VGFibGUuUmVnaW9uW0xWQ1NfTUVNUkVHSU9OX1RFTVBPUkFSWV9GQVNUXS5wQmFzZUFkZHJlc3M7Ci0KLQotICAgIC8qCi0gICAgICogQ29weSB0aGUgZGF0YSB0byB0aGUgb3V0cHV0IGluIG91dHBsYWNlIHByb2Nlc3NpbmcKLSAgICAgKi8KLSAgICBpZiAocEluRGF0YSAhPSBwT3V0RGF0YSkKLSAgICB7Ci0gICAgICAgIC8qCi0gICAgICAgICAqIFJldmVyYiBub3QgcmVxdWlyZWQgc28ganVzdCBjb3B5IHRoZSBkYXRhCi0gICAgICAgICAqLwotICAgICAgICBDb3B5XzE2KChMVk1fSU5UMTYgKilwSW5EYXRhLCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8qIFNvdXJjZSAqLwotICAgICAgICAgICAgICAgIChMVk1fSU5UMTYgKilwT3V0RGF0YSwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8qIERlc3RpbmF0aW9uICovCi0gICAgICAgICAgICAgICAgKExWTV9JTlQxNikoMipOdW1TYW1wbGVzKSk7ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLyogTGVmdCBhbmQgcmlnaHQgKi8KLSAgICB9Ci0KLQotICAgIC8qCi0gICAgICogQ2hlY2sgaWYgdGhlIHJldmVyYiBpcyByZXF1aXJlZAotICAgICAqLwotICAgIGlmICgoKHBJbnN0YW5jZS0+UGFyYW1zLlNwZWFrZXJUeXBlID09IExWQ1NfSEVBRFBIT05FKSB8fCAgICAgICAgICAgLyogRGlzYWJsZSB3aGVuIENTNE1TIGluIHN0ZXJlbyBtb2RlICovCi0gICAgICAgICAocEluc3RhbmNlLT5QYXJhbXMuU3BlYWtlclR5cGUgPT0gTFZDU19FWF9IRUFEUEhPTkVTKSB8fAotICAgICAgICAgKHBJbnN0YW5jZS0+UGFyYW1zLlNvdXJjZUZvcm1hdCAhPSBMVkNTX1NURVJFTykpICAmJgotICAgICAgICAoKHBJbnN0YW5jZS0+UGFyYW1zLk9wZXJhdGluZ01vZGUgJiBMVkNTX1JFVkVSQlNXSVRDSCkgIT0wKSkgICAgLyogRm9yIHZhbGlkYXRpb24gdGVzdGluZyAqLwotICAgIHsKLSAgICAgICAgLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotICAgICAgICAvKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0gICAgICAgIC8qIENvcHkgdGhlIGlucHV0IGRhdGEgdG8gc2NyYXRjaCBtZW1vcnkgYW5kIGZpbHRlciBpdCAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLSAgICAgICAgLyogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotICAgICAgICAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0KLSAgICAgICAgLyoKLSAgICAgICAgICogQ29weSB0aGUgaW5wdXQgZGF0YSB0byB0aGUgc2NyYXRjaCBtZW1vcnkKLSAgICAgICAgICovCi0gICAgICAgIENvcHlfMTYoKExWTV9JTlQxNiAqKXBJbkRhdGEsICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8qIFNvdXJjZSAqLwotICAgICAgICAgICAgICAgIChMVk1fSU5UMTYgKilwU2NyYXRjaCwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvKiBEZXN0aW5hdGlvbiAqLwotICAgICAgICAgICAgICAgIChMVk1fSU5UMTYpKDIqTnVtU2FtcGxlcykpOyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvKiBMZWZ0IGFuZCByaWdodCAqLwotCi0KLSAgICAgICAgLyoKLSAgICAgICAgICogRmlsdGVyIHRoZSBkYXRhCi0gICAgICAgICAqLwotICAgICAgICAocENvbmZpZy0+cEJpcXVhZENhbGxCYWNrKSgoQmlxdWFkX0luc3RhbmNlX3QqKSZwQ29lZmZpY2llbnRzLT5SZXZlcmJCaXF1YWRJbnN0YW5jZSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKExWTV9JTlQxNiAqKXBTY3JhdGNoLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoTFZNX0lOVDE2ICopcFNjcmF0Y2gsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChMVk1fSU5UMTYpTnVtU2FtcGxlcyk7Ci0KLSAgICA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ybiAiQyIgewotI2VuZGlmIC8qIF9fY3BsdXNwbHVzICovCi0KLQotLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLS8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgICBJbmNsdWRlcyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0KLSNpbmNsdWRlICJMVkNfTWl4ZXIuaCIKLQotCi0vKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotLyogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICAgIERlZmluZXMgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLQotI2RlZmluZSAgICAgSEVBRFBIT05FR0FJTlBST0MgICAgICAgICAgIExWQ1NfSEVBRFBIT05FX1BST0NHQUlOCi0jZGVmaW5lICAgICBIRUFEUEhPTkVHQUlOVU5QUk9DICAgICAgICAgTFZDU19IRUFEUEhPTkVfVU5QUk9DR0FJTgotCi0KLS8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0vKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogICAgU3RydWN0dXJlcyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotCi0KLS8qIFJldmVyYmVyYXRpb24gbW9kdWxlIHN0cnVjdHVyZSAqLwotdHlwZWRlZiBzdHJ1Y3QKLXsKLQotICAgIC8qIFN0ZXJlbyBkZWxheSAqLwotICAgIExWTV9JTlQxNiAgICAgICAgICAgICAgICAgICBEZWxheVNpemU7Ci0gICAgTFZNX0lOVDE2ICAgICAgICAgICAgICAgICAgIERlbGF5T2Zmc2V0OwotICAgIExWTV9JTlQxNiAgICAgICAgICAgICAgICAgICBQcm9jR2FpbjsKLSAgICBMVk1fSU5UMTYgICAgICAgICAgICAgICAgICAgVW5wcm9jR2FpbjsKLSAgICBMVk1fSU5UMTYgICAgICAgICAgICAgICAgICAgIFN0ZXJlb1NhbXBsZXNbMipMVkNTX1NURVJFT0RFTEFZX0NTXzQ4S0haXTsKLQotICAgIC8qIFJldmVyYiBMZXZlbCAqLwotICAgIExWTV9JTlQxNiAgICAgICAgICAgICAgICAgICBSZXZlcmJMZXZlbDsKLQotICAgIC8qIEZpbHRlciAqLwotICAgIHZvaWQgICAgICAgICAgICAgICAgICAgICAgICAoKnBCaXF1YWRDYWxsQmFjaykgKEJpcXVhZF9JbnN0YW5jZV90KiwgTFZNX0lOVDE2KiwgTFZNX0lOVDE2KiwgTFZNX0lOVDE2KTsKLQotfSBMVkNTX1JldmVyYkdlbmVyYXRvcl90OwotCi0KLS8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0vKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgICBGdW5jdGlvbiBwcm90b3R5cGVzICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotCi1MVkNTX1JldHVyblN0YXR1c19lbiBMVkNTX1JldmVyYkdlbmVyYXRvckluaXQoTFZDU19IYW5kbGVfdCAgICAgaEluc3RhbmNlLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIExWQ1NfUGFyYW1zX3QgICpwUGFyYW1zKTsKLQotTFZDU19SZXR1cm5TdGF0dXNfZW4gTFZDU19SZXZlcmJHZW5lcmF0b3IoTFZDU19IYW5kbGVfdCAgICAgICAgIGhJbnN0YW5jZSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGN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kgb2YgdGhlIExpY2Vuc2UgYXQKLSAqCi0gKiAgICAgIGh0dHA6Ly93d3cuYXBhY2hlLm9yZy9saWNlbnNlcy9MSUNFTlNFLTIuMAotICoKLSAqIFVubGVzcyByZXF1aXJlZCBieSBhcHBsaWNhYmxlIGxhdyBvciBhZ3JlZWQgdG8gaW4gd3JpdGluZywgc29mdHdhcmUKLSAqIGRpc3RyaWJ1dGVkIHVuZGVyIHRoZSBMaWNlbnNlIGlzIGRpc3RyaWJ1dGVkIG9uIGFuICJBUyBJUyIgQkFTSVMsCi0gKiBXSVRIT1VUIFdBUlJBTlRJRVMgT1IgQ09ORElUSU9OUyBPRiBBTlkgS0lORCwgZWl0aGVyIGV4cHJlc3Mgb3IgaW1wbGllZC4KLSAqIFNlZSB0aGUgTGljZW5zZSBmb3IgdGhlIHNwZWNpZmljIGxhbmd1YWdlIGdvdmVybmluZyBwZXJtaXNzaW9ucyBhbmQKLSAqIGxpbWl0YXRpb25zIHVuZGVyIHRoZSBMaWNlbnNlLgotICovCi0KLS8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0vKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogIEluY2x1ZGVzICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotCi0jaW5jbHVkZSAiTFZDUy5oIgotI2luY2x1ZGUgIkxWQ1NfUHJpdmF0ZS5oIgotI2luY2x1ZGUgIkxWQ1NfU3RlcmVvRW5oYW5jZXIuaCIKLSNpbmNsdWRlICJWZWN0b3JBcml0aG1ldGljLmgiCi0jaW5jbHVkZSAiTFZDU19UYWJsZXMuaCIKLQotLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLS8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiBGVU5DVElPTjogICAgICAgICAgICAgICAgTFZDU19TdGVyZW9FbmhhbmNlSW5pdCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qIERFU0NSSVBUSU9OOiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgSW5pdGlhbGlzZXMgdGhlIHN0ZXJlbyBlbmhhbmNlbWVudCBtb2R1bGUgYmFzZWQgb24gdGhlIHNhbXBsZSByYXRlLiAgICAgICAgICAgICAqLwotLyogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICBUaGUgZnVuY3Rpb24gc2VsZWN0cyB0aGUgY29lZmZpY2llbnRzIGZvciB0aGUgZmlsdGVycyBhbmQgY2xlYXJzIHRoZSBkYXRhICAgICAgICovCi0vKiAgaGlzdG9yeS4gSXQgaXMgYWxzbyB1c2VkIGZvciByZS1pbml0aWFsaXNhdGlvbiB3aGVuIG9uZSBvZiB0aGUgc3lzdGVtIGNvbnRyb2wgICAqLwotLyogIHBhcmFtZXRlcnMgY2hhbmdlcyBidXQgd2lsbCBvbmx5IGNoYW5nZSB0aGUgY29lZmZpY2llbnRzIGFuZCBjbGVhciB0aGUgaGlzdG9yeSAgKi8KLS8qICBpZiB0aGUgc2FtcGxlIHJhdGUgb3Igc3BlYWtlciB0eXBlIGhhcyBjaGFuZ2VkLiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogUEFSQU1FVEVSUzogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICBoSW5zdGFuY2UgICAgICAgICAgICAgICBJbnN0YW5jZSBIYW5kbGUgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgcFBhcmFtcyAgICAgICAgICAgICAgICAgSW5pdGlhbGlzYXRpb24gcGFyYW1ldGVycyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qIFJFVFVSTlM6ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgTFZDU19TdWNjZXNzICAgICAgICAgICAgQWx3YXlzIHN1Y2NlZWRzICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qIE5PVEVTOiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLQotTFZDU19SZXR1cm5TdGF0dXNfZW4gTFZDU19TRW5oYW5jZXJJbml0KExWQ1NfSGFuZGxlX3QgICAgICAgaEluc3RhbmNlLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIExWQ1NfUGFyYW1zX3QgICAgICAgKnBQYXJhbXMpCi17Ci0KLSAgICBMVk1fVUlOVDE2ICAgICAgICAgICAgICBPZmZzZXQ7Ci0gICAgTFZDU19JbnN0YW5jZV90ICAgICAgICAgKnBJbnN0YW5jZSA9IChMVkNTX0luc3RhbmNlX3QgICopaEluc3RhbmNlOwotICAgIExWQ1NfU3RlcmVvRW5oYW5jZXJfdCAgICpwQ29uZmlnICAgPSAoTFZDU19TdGVyZW9FbmhhbmNlcl90ICopJnBJbnN0YW5jZS0+U3RlcmVvRW5oYW5jZXI7Ci0gICAgTFZDU19EYXRhX3QgICAgICAgICAgICAgKnBEYXRhICAgICA9IChMVkNTX0RhdGFfdCAqKXBJbnN0YW5jZS0+TWVtb3J5VGFibGUuUmVnaW9uW0xWQ1NfTUVNUkVHSU9OX1BFUlNJU1RFTlRfRkFTVF9EQVRBXS5wQmFzZUFkZHJlc3M7Ci0gICAgTFZDU19Db2VmZmljaWVudF90ICAgICAgKnBDb2VmZmljaWVudCA9IChMVkNTX0NvZWZmaWNpZW50X3QgKilwSW5zdGFuY2UtPk1lbW9yeVRhYmxlLlJlZ2lvbltMVkNTX01FTVJFR0lPTl9QRVJTSVNURU5UX0ZBU1RfQ09FRl0ucEJhc2VBZGRyZXNzOwotICAgIEZPX0MxNl9Db2Vmc190ICAgICA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Ki8KLSAgICAgICAgTG9hZENvbnN0XzE2KDAsICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvKiBWYWx1ZSAqLwotICAgICAgICAgICAgICAgICAgICAgKHZvaWQgKikmcERhdGEtPlNFQmlxdWFkVGFwc01pZCwgICAgICAgICAgICAgIC8qIERlc3RpbmF0aW9uIENhc3QgdG8gdm9pZDpcCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbm8gZGVyZWZlcmVuY2luZyBpbiBmdW5jdGlvbiovCi0gICAgICAgICAgICAgICAgICAgICAoTFZNX1VJTlQxNikoc2l6ZW9mKHBEYXRhLT5TRUJpcXVhZFRhcHNNaWQpL3NpemVvZihMVk1fVUlOVDE2KSkpOyAgLyogTnVtYmVyIG9mIHdvcmRzICovCi0KLSAgICAgICAgRk9fMUlfRDE2RjE2Q3NzX1RSQ19XUkFfMDFfSW5pdCgmcENvZWZmaWNpZW50LT5TRUJpcXVhZEluc3RhbmNlTWlkLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICZwRGF0YS0+U0VCaXF1YWRUYXBzTWlkLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICZDb2VmZnNNaWQpOwotCi0gICAgICAgIC8qIENhbGxiYWNrcyAqLwotICAgICAgICBpZihMVkNTX1NFTWlkQ29lZlRhYmxlW09mZnNldF0uU2NhbGU9PTE1KQotICAgICAgICB7Ci0gICAgICAgICAgICBwQ29uZmlnLT5wQmlxdWFkQ2FsbEJhY2tfTWlkICA9IEZPXzFJX0QxNkYxNkMxNV9UUkNfV1JBXzAxOwotICAgICAgICB9Ci0KLSAgICAgICAgT2Zmc2V0ID0gKExWTV9VSU5UMTYpKHBQYXJhbXMtPlNhbXBsZVJhdGUpOwotICAgICAgICBwU0VTaWRlQ29lZnMgPSAoQmlxdWFkQTAxMkIxMkNvZWZzU1BfdCopJkxWQ1NfU0VTaWRlQ29lZlRhYmxlWzBdOwotCi0gICAgICAgIC8qIFNpZGUgZmlsdGVyICovCi0gICAgICAgIC8qIENvbnZlcnQgaW5jb21pbmcgY29lZmZpY2llbnRzIHRvIHRoZSByZXF1aXJlZCBmb3JtYXQvb3JkZXJpbmcgKi8KLSAgICAgICAgQ29lZmZzU2lkZS5BMCA9IChMVk1fSU5UMTYpIHBTRVNpZGVDb2Vmc1tPZmZzZXRdLkEwOwotICAgICAgICBDb2VmZnNTaWRlLkExID0gKExWTV9JTlQxNikgcFNFU2lkZUNvZWZzW09mZnNldF0uQTE7Ci0gICAgICAgIENvZWZmc1NpZGUuQTIgPSAoTFZNX0lOVDE2KSBwU0VTaWRlQ29lZnNbT2Zmc2V0XS5BMjsKLSAgICAgICAgQ29lZmZzU2lkZS5CMSA9IChMVk1fSU5UMTYpLXBTRVNpZGVDb2Vmc1tPZmZzZXRdLkIxOwotICAgICAgICBDb2VmZnNTaWRlLkIyID0gKExWTV9JTlQxNiktcFNFU2lkZUNvZWZzW09mZnNldF0uQjI7Ci0KLSAgICAgICAgLyogQ2xlYXIgdGhlIHRhcHMgKi8KLSAgICAgICAgTG9hZENvbnN0XzE2KDAsICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvKiBWYWx1ZSAqLwotICAgICAgICAgICAgICAgICAgICAgKHZvaWQgKikmcERhdGEtPlNFQmlxdWFkVGFwc1NpZGUsICAgICAgICAgICAgIC8qIERlc3RpbmF0aW9uIENhc3QgdG8gdm9pZDpcCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbm8gZGVyZWZlcmVuY2luZyBpbiBmdW5jdGlvbiovCi0gICAgICAgICAgICAgICAgICAgICAoTFZNX1VJTlQxNikoc2l6ZW9mKHBEYXRhLT5TRUJpcXVhZFRhcHNTaWRlKS9zaXplb2YoTFZNX1VJTlQxNikpKTsgLyogTnVtYmVyIG9mIHdvcmRzICovCi0KLQotICAgICAgICAvKiBDYWxsYmFja3MgKi8KLSAgICAgICAgc3dpdGNoKHBTRVNpZGVDb2Vmc1tPZmZzZXRdLlNjYWxlKQotICAgICAgICB7Ci0gICAgICAgICAgICBjYXNlIDE0OgotICAgICAgICAgICAgICAgIEJRXzFJX0QxNkYzMkNzc19UUkNfV1JBXzAxX0luaXQoJnBDb2VmZmljaWVudC0+U0VCaXF1YWRJbnN0YW5jZVNpZGUsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmcERhdGEtPlNFQmlxdWFkVGFwc1NpZGUsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmQ29lZmZzU2lkZSk7Ci0KLSAgICAgICAgICAgICAgICBwQ29uZmlnLT5wQmlxdWFkQ2FsbEJhY2tfU2lkZSAgPSBCUV8xSV9EMTZGMzJDMTRfVFJDX1dSQV8wMTsKLSAgICAgICAgICAgICAgICBicmVhazsKLSAgICAgICAgICAgIGNhc2UgMTU6Ci0gICAgICAgICAgICAgICAgQlFfMUlfRDE2RjE2Q3NzX1RSQ19XUkFfMDFfSW5pdCgmcENvZWZmaWNpZW50LT5TRUJpcXVhZEluc3RhbmNlU2lkZSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICZwRGF0YS0+U0VCaXF1YWRUYXBzU2lkZSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICZDb2VmZnNTaWRlKTsKLQotICAgICAgICAgICAgICAgIHBDb25maWctPnBCaXF1YWRDYWxsQmFja19TaWRlICA9IEJRXzFJX0QxNkYxNkMxNV9UUkNfV1JBXzAxOwotICAgICAgICAgICAgICAgIGJyZWFrOwotICAgICAgICB9Ci0KLSAgICB9Ci0KLQotICAgIHJldHVybihMVkNTX1NVQ0NFU1MpOwotfQotCi0vKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotLyogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qIEZVTkNUSU9OOiAgICAgICAgICAgICAgICBMVkNTX1N0ZXJlb0VuaGFuY2UgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogREVTQ1JJUFRJT046ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICBFbmhhbmNlIHRoZSBzdGVyZW8gaW1hZ2UgaW4gdGhlIGlucHV0IHNhbXBsZXMgYmFzZWQgb24gdGhlIGZvbGxvd2luZyBibG9jayAgICAgICovCi0vKiAgZGlhZ3JhbTogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIF9fX19fX19fICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgICAgICAgICBfX19fX19fXyAgICAgICAgICAgIHwgICAgICAgIHwgICAgICAgICAgX19fX19fX18gICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogICAgICAgICB8ICAgICAgICB8ICBNaWRkbGUgICB8IFRyZWJsZSB8ICAgICAgICAgfCAgICAgICAgfCAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICAgICAgICAgfCAgICAgICAgfC0tLS0tLS0tLS0+fCBCb29zdCAgfC0tLS0tLS0tPnwgICAgICAgIHwgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgICAgICAgIHwgU3RlcmVvIHwgICAgICAgICAgIHxfX19fX19fX3wgICAgICAgICB8IE0gJiBTICB8ICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogICAgICAtLT58ICAgdG8gICB8ICAgICAgICAgICAgX19fX19fX18gICAgICAgICAgfCAgIHRvICAgfC0tPiAgICAgICAgICAgICAgICAgICAgKi8KLS8qICAgICAgICAgfCBNICYgUyAgfCAgU2lkZSAgICAgfCAgICAgICAgfCAgICAgICAgIHwgU3RlcmVvIHwgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgICAgICAgIHwgICAgICAgIHwtLS0tLS0tLS0tPnwgU2lkZSAgIHwtLS0tLS0tLT58ICAgICAgICB8ICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogICAgICAgICB8X19fX19fX198ICAgICAgICAgICB8IEJvb3N0ICB8ICAgICAgICAgfF9fX19fX19ffCAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfF9fX19fX19ffCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICBJZiB0aGUgaW5wdXQgc2lnbmFsIGlzIGEgbW9ubyBzaWduYWwgdGhlcmUgd2lsbCBiZSBubyBzaWRlIHNpZ25hbCBhbmQgaGVuY2UgICAgICovCi0vKiAgdGhlIHNpZGUgZmlsdGVyIHdpbGwgbm90IGJlIHJ1bi4gSW4gbW9iaWxlIHNwZWFrZXIgbW9kZSB0aGUgbWlkZGxlIGZpbHRlciBpcyAgICAqLwotLyogIG5vdCByZXF1aXJlZCBhbmQgdGhlIFRyZWJibGUgYm9vc3QgZmlsdGVyIGlzIHJlcGxhY2VkIGJ5IGEgc2ltcGxlIGdhaW4gYmxvY2suICAgKi8KLS8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogUEFSQU1FVEVSUzogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICBoSW5zdGFuY2UgICAgICAgICAgICAgICBJbnN0YW5jZSBIYW5kbGUgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgcEluRGF0YSAgICAgICAgICAgICAgICAgUG9pbnRlciB0byB0aGUgaW5wdXQgZGF0YSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogIHBPdXREYXRhICAgICAgICAgICAgICAgIFBvaW50ZXIgdG8gdGhlIG91dHB1dCBkYXRhICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICBOdW1TYW1wbGVzICAgICAgICAgICAgICBOdW1iZXIgb2Ygc2FtcGxlcyB0byBwcm9jZXNzICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogUkVUVVJOUzogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICBMVkNTX1N1Y2Nlc3MgICAgICAgICAgICBBbHdheXMgc3VjY2VlZHMgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogTk9URVM6ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICAxLiAgVGhlIHNpZGUgZmlsdGVyIGlzIG5vdCB1c2VkIGluIE1vYmlsZSBTcGVha2VyIG1vZGUgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLQotTFZDU19SZXR1cm5TdGF0dXNfZW4gTFZDU19TdGVyZW9FbmhhbmNlcihMVkNTX0hhbmRsZV90ICAgICAgICAgIGhJbnN0YW5jZSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY29uc3QgTFZNX0lOVDE2ICAgICAgICAqcEluRGF0YSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTFZNX0lOVDE2ICAgICAgICAgICAgICAqcE91dERhdGEsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIExWTV9VSU5UMTYgICAgICAgICAgICAgTnVtU2FtcGxlcykKLXsKLQotICAgIExWQ1NfSW5zdGFuY2VfdCAgICAgICAgICpwSW5zdGFuY2UgPSAoTFZDU19JbnN0YW5jZV90ICAq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WwKLSAgICAgICAgICovCi0gICAgICAgIGlmIChwSW5zdGFuY2UtPk91dHB1dERldmljZSA9PSBMVkNTX0hFQURQSE9ORSkKLSAgICAgICAgewotICAgICAgICAgICAgKHBDb25maWctPnBCaXF1YWRDYWxsQmFja19NaWQpKChCaXF1YWRfSW5zdGFuY2VfdCopJnBDb2VmZmljaWVudC0+U0VCaXF1YWRJbnN0YW5jZU1pZCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoTFZNX0lOVDE2ICopcFNjcmF0Y2gsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKExWTV9JTlQxNiAqKXBTY3JhdGNoLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChMVk1fSU5UMTYpTnVtU2FtcGxlcyk7Ci0gICAgICAgIH0KLSAgICAgICAgZWxzZQotICAgICAgICB7Ci0gICAgICAgICAgICBNdWx0M3NfMTZ4MTYocFNjcmF0Y2gsICAgICAgICAgICAgICAvKiBTb3VyY2UgKi8KLSAgICAgICAgICAgICAgICAgICAgICAgICAoTFZNX0lOVDE2KXBDb25maWctPk1pZEdhaW4sICAgICAgLyogR2FpbiAqLwotICAgICAgICAgICAgICAgICAgICAgICAgIHBTY3JhdGNoLCAgICAgICAgICAgICAgLyogRGVzdGluYXRpb24gKi8KLSAgICAgICAgICAgICAgICAgICAgICAgICAoTFZNX0lOVDE2KU51bVNhbXBsZXMpOyAgICAgICAgICAgLyogTnVtYmVyIG9mIHNhbXBsZXMgKi8KLSAgICAgICAgfQotCi0gICAgICAgIC8qCi0gICAgICAgICAqIEFwcGx5IHRoZSBmaWx0ZXIgdGhlIHNpZGUgc2lnbmFsIG9ubHkgaW4gc3RlcmVvIG1vZGUgZm9yIGhlYWRwaG9uZXMKLSAgICAgICAgICogYW5kIGluIGFsbCBtb2RlcyBmb3IgbW9iaWxlIHNwZWFrZXJzCi0gICAgICAgICAqLwotICAgICAgICBpZiAocEluc3RhbmNlLT5QYXJhbXMuU291cmNlRm9ybWF0ID09IExWQ1NfU1RFUkVPKQotICAgICAgICB7Ci0gICAgICAgICAgICAocENvbmZpZy0+cEJpcXVhZENhbGxCYWNrX1NpZGUpKChCaXF1YWRfSW5zdGFuY2VfdCopJnBDb2VmZmljaWVudC0+U0VCaXF1YWRJbnN0YW5jZVNpZGUsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChMVk1fSU5UMTYgKikocFNjcmF0Y2ggKyBOdW1TYW1wbGVzKSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKExWTV9JTlQxNiAqKShwU2NyYXRjaCArIE51bVNhbXBsZXMpLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoTFZNX0lOVDE2KU51bVNhbXBsZXMpOwotICAgICAgICB9Ci0KLSAgICAgICAgLyoKLSAgICAgICAgICogQ29udmVydCBmcm9tIG1pZGRsZSBhbmQgc2lkZSB0byBzdGVyZW8KLSAgICAgICAgICovCi0gICAgICAgIE1TVG8yaV9TYXRfMTZ4MTYocFNjcmF0Y2gsCi0gICAgICAgICAgICAgICAgICAgICAgICAgcFNjcmF0Y2grTnVtU2FtcGxlcywKLSAgICAgICAgICAgICAgICAgICAgICAgICBwT3V0RGF0YSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAoTFZNX0lOVDE2KU51bVNhbXBsZXMpOwotCi0gICAgfQotICAgIGVsc2UKLSAgICB7Ci0gICAgICAgIC8qCi0gICAgICAgICAqIFRoZSBzdGVyZW8gZW5oYW5jZXIgaXMgZGlzYWJsZWQgc28ganVzdCBjb3B5IHRoZSBkYXRhCi0gICAgICAgICAqLwotICAgICAgICBDb3B5XzE2KChMVk1fSU5UMTYgKilwSW5EYXRhLCAgICAgICAgICAgLyogU291cmNlICovCi0gICAgICAgICAgICAgICAgKExWTV9JTlQxNiAqKXBPdXREYXRhLCAgICAg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2FibGUgbGF3IG9yIGFncmVlZCB0byBpbiB3cml0aW5nLCBzb2Z0d2FyZQotICogZGlzdHJpYnV0ZWQgdW5kZXIgdGhlIExpY2Vuc2UgaXMgZGlzdHJpYnV0ZWQgb24gYW4gIkFTIElTIiBCQVNJUywKLSAqIFdJVEhPVVQgV0FSUkFOVElFUyBPUiBDT05ESVRJT05TIE9GIEFOWSBLSU5ELCBlaXRoZXIgZXhwcmVzcyBvciBpbXBsaWVkLgotICogU2VlIHRoZSBMaWNlbnNlIGZvciB0aGUgc3BlY2lmaWMgbGFuZ3VhZ2UgZ292ZXJuaW5nIHBlcm1pc3Npb25zIGFuZAotICogbGltaXRhdGlvbnMgdW5kZXIgdGhlIExpY2Vuc2UuCi0gKi8KLQotI2lmbmRlZiBfX0xWQ1NfU1RFUkVPRU5IQU5DRVJfSF9fCi0jZGVmaW5lIF9fTFZDU19TVEVSRU9FTkhBTkNFUl9IX18KLQotI2lmZGVmIF9fY3BsdXNwbHVzCi1leHRlcm4gIkMiIHsKLSNlbmRpZiAvKiBfX2NwbHVzcGx1cyAqLwotCi0KLS8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0vKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogICAgSW5jbHVkZXMgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotCi0jaW5jbHVkZSAiRmlsdGVycy5oIiAgICAgICAgICAgICAgICAgICAgICAgIC8qIEZpbHRlciBkZWZpbml0aW9ucyAqLwotI2luY2x1ZGUgIkxWQ1NfSGVhZHBob25lX0NvZWZmcy5oIiAgICAgICAgICAvKiBIZWFkcGhvbmUgY29lZmZpY2llbnRzICovCi0jaW5jbHVkZSAiQklRVUFELmgiCi0KLQotLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLS8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgICBTdHJ1Y3R1cmVzICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0KLS8qIFN0ZXJlbyBlbmhhbmNlciBzdHJ1Y3R1cmUgKi8KLXR5cGVkZWYgc3RydWN0Ci17Ci0gICAgLyoKLSAgICAgKiBNaWRkbGUgZmlsdGVyCi0gICAgICovCi0gICAgdm9pZCAgICAgICAgICAgICAgICAgICAgKCpwQmlxdWFkQ2FsbEJhY2tfTWlkKShCaXF1YWRfSW5zdGFuY2VfdCosIExWTV9JTlQxNiosIExWTV9JTlQxNiosIExWTV9JTlQxNik7Ci0KLSAgICAvKgotICAgICAqIFNpZGUgZmlsdGVyCi0gICAgICovCi0gICAgdm9pZCAgICAgICAgICAgICAgICAgICAgKCpwQmlxdWFkQ2FsbEJhY2tfU2lkZSkoQmlxdWFkX0luc3RhbmNlX3QqLCBMVk1fSU5UMTYqLCBMVk1fSU5UMTYqLCBMVk1fSU5UMTYpOwotCi0gICAgICBMVk1fVUlOVDE2ICAgICAgICAgICAgICBNaWRHYWluOyAgICAgICAgICAgIC8qIE1pZGRsZSBnYWluIGluIG1vYmlsZSBzcGVha2VyIG1vZGUgKi8KLQotfSBMVkNTX1N0ZXJlb0VuaGFuY2VyX3Q7Ci0KLQotLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLS8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgICBGdW5jdGlvbiBwcm90b3R5cGVzICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0KLUxWQ1NfUmV0dXJuU3RhdHVzX2VuIExWQ1NfU0VuaGFuY2VySW5pdChMVkNTX0hhbmRsZV90ICAgICAgICBoSW5zdGFuY2UsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTFZDU19QYXJhbXNfdCAgICAgICAgKnBQYXJhbXMpOwotCi1MVkNTX1JldHVyblN0YXR1c19lbiBMVkNTX1N0ZXJlb0VuaGFuY2VyKExWQ1NfSGFuZGxlX3QgICAgICAgIGhJbnN0YW5jZSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY29uc3QgTFZNX0lOVDE2ICAgICpwSW5EYXRhLAotICAgICAgIC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GljZW5zZXMvTElDRU5TRS0yLjAKLSAqCi0gKiBVbmxlc3MgcmVxdWlyZWQgYnkgYXBwbGljYWJsZSBsYXcgb3IgYWdyZWVkIHRvIGluIHdyaXRpbmcsIHNvZnR3YXJlCi0gKiBkaXN0cmlidXRlZCB1bmRlciB0aGUgTGljZW5zZSBpcyBkaXN0cmlidXRlZCBvbiBhbiAiQVMgSVMiIEJBU0lTLAotICogV0lUSE9VVCBXQVJSQU5USUVTIE9SIENPTkRJVElPTlMgT0YgQU5ZIEtJTkQsIGVpdGhlciBleHByZXNzIG9yIGltcGxpZWQuCi0gKiBTZWUgdGhlIExpY2Vuc2UgZm9yIHRoZSBzcGVjaWZpYyBsYW5ndWFnZSBnb3Zlcm5pbmcgcGVybWlzc2lvbnMgYW5kCi0gKiBsaW1pdGF0aW9ucyB1bmRlciB0aGUgTGljZW5zZS4KLSAqLwotCi0KLS8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0vKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogIEluY2x1ZGVzICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotCi0jaW5jbHVkZSAiTFZDU19Qcml2YXRlLmgiCi0jaW5jbHVkZSAiRmlsdGVycy5oIiAgICAgICAgICAgICAgICAgICAgICAgICAgICAvKiBGaWx0ZXIgZGVmaW5pdGlvbnMgKi8KLSNpbmNsdWRlICJCSVFVQUQuaCIgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8qIEJpcXVhZCBkZWZpbml0aW9ucyAqLwotI2luY2x1ZGUgIkxWQ1NfSGVhZHBob25lX0NvZWZmcy5oIiAgICAgICAgICAgICAgLyogSGVhZHBob25lIGNvZWZmaWNpZW50cyAqLwotCi0KLS8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0vKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogIFN0ZXJlbyBFbmhhbmNlciBjb2VmZmljaWVudCBjb25zdGFudCB0YWJsZXMgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotCi0vKiBDb2VmZmljaWVudCB0YWJsZSBmb3IgdGhlIG1pZGRsZSBmaWx0ZXIgKi8KLWNvbnN0IEJpcXVhZEEwMUIxQ29lZnNTUF90IExWQ1NfU0VNaWRDb2VmVGFibGVbXSA9IHsKLSAgICB7Q1NfTUlERExFXzgwMDBfQTAsICAgICAgICAgLyogOGtTL3MgY29lZmZpY2llbnRzICovCi0gICAgIENTX01JRERMRV84MDAwX0ExLAotICAgICBDU19NSURETEVfODAwMF9CMSwKLSAgICAgKExWTV9VSU5UMTYgKUNTX01JRERMRV84MDAwX1NDQUxFfSwKLSAgICB7Q1NfTUlERExFXzExMDI1X0EwLCAgICAgICAgLyogMTFrUy9zIGNvZWZmaWNpZW50cyAqLwotICAgICBDU19NSURETEVfMTEwMjVfQTEsCi0gICAgIENTX01JRERMRV8xMTAyNV9CMSwKLSAgICAgKExWTV9VSU5UMTYgKUNTX01JRERMRV8xMTAyNV9TQ0FMRX0sCi0gICAge0NTX01JRERMRV8xMjAwMF9BMCwgICAgICAgIC8qIDEya1MvcyBjb2VmZmljaWVudHMgKi8KLSAgICAgQ1NfTUlERExFXzEyMDAwX0ExLAotICAgICBDU19NSURETEVfMTIwMDBfQjEsCi0gICAgIChMVk1fVUlOVDE2IClDU19NSURETEVfMTIwMDBfU0NBTEV9LAotICAgIHtDU19NSURETEVfMTYwMDBfQTAsICAgICAgICAvKiAxNmtTL3MgY29lZmZpY2llbnRzICovCi0gICAgIENTX01JRERMRV8xNjAwMF9BMSwKLSAgICAgQ1NfTUlERExFXzE2MDAwX0IxLAotICAgICAoTFZNX1VJTlQxNiApQ1NfTUlERExFXzE2MDAwX1NDQUxFfSwKLSAgICB7Q1NfTUlERExFXzIyMDUwX0EwLCAgICAgICAgLyogMjJrUy9zIGNvZWZmaWNpZW50cyAqLwotICAgICBDU19NSURETEVfMjIwNTBfQTEsCi0gICAgIENTX01JRERMRV8yMjA1MF9CMSwKLSAgICAgKExWTV9VSU5UMTYgKUNTX01JRERMRV8yMjA1MF9TQ0FMRX0sCi0gICAge0NTX01JRERMRV8yNDAwMF9BMCwgICAgICAgIC8qIDI0a1MvcyBjb2VmZmljaWVudHMgKi8KLSAgICAgQ1NfTUlERExFXzI0MDAwX0ExLAotICAgICBDU19NSURETEVfMjQwMDBfQjEsCi0gICAgIChMVk1fVUlOVDE2IClDU19NSURETEVfMjQwMDBfU0NBTEV9LAotICAgIHtDU19NSURETEVfMzIwMDBfQTAsICAgICAgICAvKiAzMmtTL3MgY29lZmZpY2llbnRzICovCi0gICAgIENTX01JRERMRV8zMjAwMF9BMSwKLSAgICAgQ1NfTUlERExFXzMyMDAwX0IxLAotICAgICAoTFZNX1VJTlQxNiApQ1NfTUlERExFXzMyMDAwX1NDQUxFfSwKLSAgICB7Q1NfTUlERExFXzQ0MTAwX0EwLCAgICAgICAgLyogNDRrUy9zIGNvZWZmaWNpZW50cyAqLwotICAgICBDU19NSURETEVfNDQxMDBfQTEsCi0gICAgIENTX01JRERMRV80NDEwMF9CMSwKLSAgICAgKExWTV9VSU5UMTYgKUNTX01JRERMRV80NDEwMF9TQ0FMRX0sCi0gICAge0NTX01JRERMRV80ODAwMF9BMCwgICAgICAgIC8qIDQ4a1MvcyBjb2VmZmljaWVudHMgKi8KLSAgICAgQ1NfTUlERExFXzQ4MDAwX0ExLAotICAgICBDU19NSURETEVfNDgwMDBfQjEsCi0gICAgIChMVk1fVUlOVDE2IClDU19NSURETEVfNDgwMDBfU0NBTEV9fTsKLQotLyogQ29lZmZpY2llbnQgdGFibGUgZm9yIHRoZSBzaWRlIGZpbHRlciAqLwotY29uc3QgQmlxdWFkQTAxMkIxMkNvZWZzU1BfdCBMVkNTX1NFU2lkZUNvZWZUYWJsZVtdID0gewotICAgIC8qIEhlYWRwaG9uZSBTaWRlIGNvZWZmaWNpZW50cyAqLwotICAgIHtDU19TSURFXzgwMDBfQTAsICAgICAgICAgICAvKiA4a1MvcyBjb2VmZmljaWVudHMgKi8KLSAgICAgQ1NfU0lERV84MDAwX0ExLAotICAgICBDU19TSURFXzgwMDBfQTIsCi0gICAgIENTX1NJREVfODAwMF9CMSwKLSAgICAgQ1NfU0lERV84MDAwX0IyLAotICAgICAoTFZNX1VJTlQxNiApQ1NfU0lERV84MDAwX1NDQUxFfSwKLSAgICB7Q1NfU0lERV8xMTAyNV9BMCwgICAgICAgICAgLyogMTFrUy9zIGNvZWZmaWNpZW50cyAqLwotICAgICBDU19TSURFXzExMDI1X0ExLAotICAgICBDU19TSURFXzExMDI1X0EyLAotICAgICBDU19TSURFXzExMDI1X0IxLAotICAgICBDU19TSURFXzExMDI1X0IyLAotICAgICAoTFZNX1VJTlQxNiApQ1NfU0lERV8xMTAyNV9TQ0FMRX0sCi0gICAge0N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ENTX1NJREVfMzIwMDBfQTEsCi0gICAgIENTX1NJREVfMzIwMDBfQTIsCi0gICAgIENTX1NJREVfMzIwMDBfQjEsCi0gICAgIENTX1NJREVfMzIwMDBfQjIsCi0gICAgIChMVk1fVUlOVDE2IClDU19TSURFXzMyMDAwX1NDQUxFfSwKLSAgICB7Q1NfU0lERV80NDEwMF9BMCwgICAgICAgICAgLyogNDRrUy9zIGNvZWZmaWNpZW50cyAqLwotICAgICBDU19TSURFXzQ0MTAwX0ExLAotICAgICBDU19TSURFXzQ0MTAwX0EyLAotICAgICBDU19TSURFXzQ0MTAwX0IxLAotICAgICBDU19TSURFXzQ0MTAwX0IyLAotICAgICAoTFZNX1VJTlQxNiApQ1NfU0lERV80NDEwMF9TQ0FMRX0sCi0gICAge0NTX1NJREVfNDgwMDBfQTAsICAgICAgICAgIC8qIDQ4a1MvcyBjb2VmZmljaWVudHMgKi8KLSAgICAgQ1NfU0lERV80ODAwMF9BMSwKLSAgICAgQ1NfU0lERV80ODAwMF9BMiwKLSAgICAgQ1NfU0lERV80ODAwMF9CMSwKLSAgICAgQ1NfU0lERV80ODAwMF9CMiwKLSAgICAgKExWTV9VSU5UMTYgKUNTX1NJREVfNDgwMDBfU0NBTEV9Ci19OwotCi0KLS8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0vKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogIEVxdWFsaXNlciBjb2VmZmljaWVudCBjb25zdGFudCB0YWJsZXMgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKioqKioqKioqKioq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MvcyBjb2VmZmljaWVudHMgKi8KLSAgICAgQ1NFWF9FUVVBTElTRVJfNDgwMDBfQTEsCi0gICAgIENTRVhfRVFVQUxJU0VSXzQ4MDAwX0EyLAotICAgICBDU0VYX0VRVUFMSVNFUl80ODAwMF9CMSwKLSAgICAgQ1NFWF9FUVVBTElTRVJfNDgwMDBfQjIsCi0gICAgIChMVk1fVUlOVDE2IClDU0VYX0VRVUFMSVNFUl80ODAwMF9TQ0FMRX0KLX07Ci0KLQotLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLS8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgUmV2ZXJiIGRlbGF5IGNvbnN0YW50IHRhYmxlcyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0KLS8qIFN0ZXJlbyBkZWxheSB0YWJsZSBmb3IgQ29uY2VydCBTb3VuZCAqLwotY29uc3QgTFZNX1VJTlQxNiAgICBMVkNTX1N0ZXJlb0RlbGF5Q1NbXSA9IHsKLSAgICBMVkNTX1NURVJFT0RFTEFZX0NTXzhLSFosCi0gICAgTFZDU19TVEVSRU9ERUxBWV9DU18xMUtIWiwKLSAgICBMVkNTX1NURVJFT0RFTEFZX0NTXzEyS0haLAotICAgIExWQ1NfU1RFUkVPREVMQVlfQ1NfMTZLSFosCi0gICAgTFZDU19TVEVSRU9ERUxBWV9DU18yMktIWiwKLSAgICBMVkNTX1NURVJFT0RFTEFZX0NTXzI0S0haLAotICAgIExWQ1NfU1RFUkVPREVMQVlfQ1NfMzJLSFosCi0gICAgTFZDU19TVEVSRU9ERUxBWV9DU180NEtIWiwKLSAgICBMVkNTX1NURVJFT0RFTEFZX0NTXzQ4S0hafTsKLQotLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLS8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgUmV2ZXJiIGNvZWZmaWNpZW50cyBjb25zdGFudCB0YWJsZSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0KLWNvbnN0IEJpcXVhZEEwMTJCMTJDb2Vmc1NQX3QgTFZDU19SZXZlcmJDb2VmVGFibGVbXSA9IHsKLSAgICAvKiBIZWFkcGhvbmUgY29lZmZpY2llbnRzICovCi0gICAge0NTX1JFVkVSQl84MDAwX0EwLCAgICAgICAgICAgICAvKiA4a1MvcyBjb2VmZmljaWVudHMgKi8KLSAgICAgQ1NfUkVWRVJCXzgwMDBfQTEsCi0gICAgIENTX1JFVkVSQl84MDAwX0EyLAotICAgICBDU19SRVZFUkJfODAwMF9CMSwKLSAgICAgQ1NfUkVWRVJCXzgwMDBfQjIsCi0gICAgIChMVk1fVUlOVDE2IClDU19SRVZFUkJfODAwMF9TQ0FMRX0sCi0gICAge0NTX1JFVkVSQl8xMTAyNV9BMCwgICAg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ci0KLQotLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLS8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgQnlwYXNzIG1peGVyIGNvbnN0YW50IHRhYmxlcyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0KLWNvbnN0IEdhaW5fdCBMVkNTX091dHB1dEdhaW5UYWJsZVtdID0gewotICAgIHtMVkNTX0hFQURQSE9ORV9TSElGVCwgICAgICAgICAvKiBIZWFkcGhvbmUsIHN0ZXJlbyBtb2RlICovCi0gICAgIExWQ1NfSEVBRFBIT05FX1NISUZUTE9TUywKLSAgICAgTFZDU19IRUFEUEhPTkVfR0FJTn0sCi0gICAge0xWQ1NfRVhfSEVBRFBIT05FX1NISUZULCAgICAgIC8qIEVYIEhlYWRwaG9uZSwgc3RlcmVvIG1vZGUgKi8KLSAgICAgTFZDU19FWF9IRUFEUEhPTkVfU0hJRlRMT1NTLAotICAgICBMVkNTX0VYX0hFQURQSE9ORV9HQUlOfSwKLSAgICB7TFZDU19IRUFEUEhPTkVfU0hJRlQsICAgICAgICAgLyogSGVhZHBob25lLCBtb25vIG1vZGUgKi8KLSAgICAgTFZDU19IRUFEUEhPTkVfU0hJRlRMT1NTLAotICAgICBMVkNTX0hFQURQSE9ORV9HQUlOfSwKLSAgICB7TFZDU19FWF9IRUFEUEhPTkVfU0hJRlQsICAgICAgLyogRVggSGVhZHBob25lLCBtb25vIG1vZGUgKi8KLSAgICAgTFZDU19FWF9IRUFEUEhPTkVfU0hJRlRMT1NTLAotICAgICBMVkNTX0VYX0hFQURQSE9ORV9HQUlOfQotfTsKLQotCi0vKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotLyogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICBWb2x1bWUgY29ycmVjdGlvbiB0YWJsZSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogIENvZWZmaWNpZW50IG9yZGVyOiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICAgICAgQ29tcHJlc3Npb24gMTAwJSBlZmZlY3QgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgICAgIENvbXByZXNzaW9uIDAlIGVmZmVjdCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogICAgICBHYWluIDEwMCUgZWZmZWN0ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICAgICAgR2FpbiAwJSBlZmZlY3QgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogIFRoZSBDb21wcmVzc2lvbiBnYWluIGlzIHJlcHJlc2VudGVkIGJ5IGEgUTEuMTUgbnVtYmVyIHRvIGdpdmUgYSByYW5nZSBvZiAwZEIgICAgKi8KLS8qICB0byArNmRCLCBFLmcuOiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgICAgICAgICAwICAgICAgIGlzIDBkQiBjb21wcmVzc2lvbiAobm8gZWZmZWN0KSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogICAgICAgICAgNTQ2MSAgICBpcyAxZEIgY29tcHJlc3Npb24gZ2FpbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICAgICAgICAgIDEwOTIzICAgaXMgMmRCIGNvbXByZXNzaW9uIGdhaW4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgICAgICAgICAzMjc2NyAgIGlzIDZkQiBjb21wcmVzc2lvbiBnYWluICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICBUaGUgR2FpbiBpcyByZXByZXNlbnRlZCBhcyBhIFEzLjEzIG51bWJlciB0byBnaXZlIGEgcmFuZ2Ugb2YgKzggdG8gLWluZmluaXR5ICAgICovCi0vKiAgRS5nLjogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogICAgICAgICAgMCAgICAgICBpcyAtaW5maW5pdHkgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICAgICAgICAgIDMyNzY3ICAgaXMgKzE4ZEIgKHg4KSBnYWluICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgICAgICAgICA0MDk2ICAgIGlzIDBkQiBnYWluICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogICAgICAgICAgMTAyNCAgICBpcyAtMTJkQiBnYWluICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotY29uc3QgTFZDU19Wb2xDb3JyZWN0X3QgTFZDU19Wb2xDb3JyZWN0VGFibGVbXSA9IHsKLSAgICB7MTQyMDAsICAgICAgICAgIC8qIEhlYWRwaG9uZSwgc3RlcmVvIG1vZGUgKi8KLSAgICAgMCwKLSAgICAgNDA5NiwKLSAgICAgNTc4Nn0sCi0gICAgezE0MjAwLCAgICAgICAgICAvKiBFWCBIZWFkcGhvbmUsIHN0ZXJlbyBtb2RlICovCi0gICAgIDAsCi0gICAgIDQwOTYsCi0gICAgIDU3ODZ9LAotICAgIHszMjc2NywgICAgICAgICAvKiBIZWFkcGhvbmUsIG1vbm8gbW9kZSAqLwotICAgICAwLAotICAgICA0MDk2LAotICAgICA1Nzg2fSwKLSAgICB7MzI3NjcsICAgICAgICAgLyogRVggSGVhZHBob25lLCBtb25vIG1vZGUgKi8KLSAgICAgMCwKLSAgICAgNDA5NiwKLSAgICAgNTc4Nn0KLX07Ci0KLS8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0vKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogIE1peGVyIHRpbWUgY29uc3RhbnRzLCAxMDBtcyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotCi0jZGVmaW5lIExWQ1NfVk9MX1RDX0ZzODAwMCAgICAgIDMyNTgwICAgICAgIC8qIEZsb2F0aW5nIHBvaW50IHZhbHVlIDAuOTk0MjYyNjk1ICovCi0jZGVmaW5lIExWQ1NfVk9MX1RDX0ZzMTEwMjUgICAgIDMyNjMyICAgICAgIC8qIEZsb2F0aW5nIHBvaW50IHZhbHVlIDAuOTk1ODQ5NjA5ICovCi0jZGVmaW5lIExWQ1NfVk9MX1RDX0ZzMTIwMDAgICAgIDMyNjQzICAgICAgIC8qIEZsb2F0aW5nIHBvaW50IHZhbHVlIDAuOTk2MTg1MzAzICovCi0jZGVmaW5lIExWQ1NfVk9MX1RDX0ZzMTYwMDAgICAgIDMyNjc0ICAgICAgIC8qIEZsb2F0aW5nIHBvaW50IHZhbHVlIDAuOTk3MTMxMzQ4ICovCi0jZGVmaW5lIExWQ1NfVk9MX1RDX0ZzMjIwNTAgICAgIDMyNzAwICAgICAgIC8qIEZsb2F0aW5nIHBvaW50IHZhbHVlIDAuOTk3OTI0ODA1ICovCi0jZGVmaW5lIExWQ1NfVk9MX1RDX0ZzMjQwMDAgICAgIDMyNzA1ICAgICAgIC8qIEZsb2F0aW5nIHBvaW50IHZhbHVlIDAuOTk4MDc3MzkzICovCi0jZGVmaW5lIExWQ1NfVk9MX1RDX0ZzMzIwMDAgICAgIDMyNzIxICAgICAgIC8qIEZsb2F0aW5nIHBvaW50IHZhbHVlIDAuOTk4NTY1Njc0ICovCi0jZGVmaW5lIExWQ1NfVk9MX1RDX0ZzNDQxMDAgICAgIDMyNzM0ICAgICAgIC8qIEZsb2F0aW5nIHBvaW50IHZhbHVlIDAuOTk4OTYyNDAyICovCi0jZGVmaW5lIExWQ1NfVk9MX1RDX0ZzNDgwMDAgICAgIDMyNzM3ICAgICAgIC8qIEZsb2F0aW5nIHBvaW50IHZhbHVlIDAuOTk5MDUzOTU1ICovCi0KLQotY29uc3QgTFZNX0lOVDE2IExWQ1NfVm9sdW1lVENUYWJsZVs5XSA9IHtMVkNTX1ZPTF9UQ19GczgwMDAsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTFZDU19WT0xfVENfRnMxMTAyNSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBMVkNTX1ZPTF9UQ19GczEyMDAwLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIExWQ1NfVk9MX1RDX0ZzMTYwMDAsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTFZDU19WT0xfVENfRnMyMjA1MCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBMVkNTX1ZPTF9UQ19GczI0MDAwLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIExWQ1NfVk9MX1RDX0ZzMzIwMDAsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTFZDU19WT0xfVENfRnM0NDEwMCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBMVkNTX1ZPTF9UQ19GczQ4MDAwfTsKLQotLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLS8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgU2FtcGxlIHJhdGUgdGFibGUgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0KLWNvbnN0IExWTV9JTlQzMiAgIExWQ1NfU2FtcGxlUmF0ZVRhYmxlWzldID0gezgwMDAsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDExMDI1LAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAxMjAwMCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMTYwMDAsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDIyMDUwLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAyNDAwMCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMzIwMDAsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDQ0MTAwLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA0ODAwMH07Ci0KZGlmZiAtLWdpdCBhL21lZGlhL2xpYmVmZmVjdHMvbHZtL2xpYi9TdGVyZW9XaWRlbmluZy9zcmMvTFZDU19UYWJsZXMuaCBiL21lZGlhL2xpYmVmZmVjdHMvbHZtL2xpYi9TdGVyZW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FuZAotICogbGltaXRhdGlvbnMgdW5kZXIgdGhlIExpY2Vuc2UuCi0gKi8KLQotI2lmbmRlZiBfX0xWQ1NfVEFCTEVTX0hfXwotI2RlZmluZSBfX0xWQ1NfVEFCTEVTX0hfXwotCi0jaWZkZWYgX19jcGx1c3BsdXMKLWV4dGVybiAiQyIgewotI2VuZGlmIC8qIF9fY3BsdXNwbHVzICovCi0KLS8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0vKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogIEluY2x1ZGVzICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotCi0jaW5jbHVkZSAiQklRVUFELmgiICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvKiBCaXF1YWQgZGVmaW5pdGlvbnMgKi8KLQotLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLS8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgU3RlcmVvIEVuaGFuY2VyIGNvZWZmaWNpZW50IGNvbnN0YW50IHRhYmxlcyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0KLS8qIENvZWZmaWNpZW50IHRhYmxlIGZvciB0aGUgbWlkZGxlIGZpbHRlciAqLwotZXh0ZXJuIGNvbnN0IEJpcXVhZEEwMUIxQ29lZnNTUF90IExWQ1NfU0VNaWRDb2VmVGFibGVbXTsKLQotLyogQ29lZmZpY2llbnQgdGFibGUgZm9yIHRoZSBzaWRlIGZpbHRlciAqLwotZXh0ZXJuIGNvbnN0IEJpcXVhZEEwMTJCMTJDb2Vmc1NQX3QgTFZDU19TRVNpZGVDb2VmVGFibGVbXTsKLQotLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLS8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgRXF1YWxpc2VyIGNvZWZmaWNpZW50IGNvbnN0YW50IHRhYmxlcyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0KLWV4dGVybiBjb25zdCBCaXF1YWRBMDEyQjEyQ29lZnNTUF90IExWQ1NfRXF1YWxpc2VyQ29lZlRhYmxlW107Ci0KLS8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0vKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogIFJldmVyYiBkZWxheSBjb25zdGFudCB0YWJsZXMgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotCi0vKiBTdGVyZW8gZGVsYXkgdGFibGUgZm9yIENvbmNlcnQgU291bmQgKi8KLWV4dGVybiBjb25zdCBMVk1fVUlOVDE2IExWQ1NfU3RlcmVvRGVsYXlDU1tdOwotCi0vKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotLyogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICBSZXZlcmIgY29lZmZpY2llbnRzIGNvbnN0YW50IHRhYmxlICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLQotZXh0ZXJuIGNvbnN0IEJpcXVhZEEwMTJCMTJDb2Vmc1NQX3QgTFZDU19SZXZlcmJDb2VmVGFibGVbXTsKLQotLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLS8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgQnlwYXNzIG1peGVyIGNvbnN0YW50IHRhYmxlcyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0KLWV4dGVybiBjb25zdCBHYWluX3QgTFZDU19PdXRwdXRHYWluVGFibGVbXTsKLQotLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLS8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgVm9sdW1lIGNvcnJlY3Rpb24gdGFibGUgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICBDb2VmZmljaWVudCBvcmRlcjogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgICAgIENvbXByZXNzaW9uIDEwMCUgZWZmZWN0ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogICAgICBDb21wcmVzc2lvbiAwJSBlZmZlY3QgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICAgICAgR2FpbiAxMDAlIGVmZmVjdCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgICAgIEdhaW4gMCUgZWZmZWN0ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICBUaGUgQ29tcHJlc3Npb24gZ2FpbiBpcyByZXByZXNlbnRlZCBieSBhIFExLjE1IG51bWJlciB0byBnaXZlIGEgcmFuZ2Ugb2YgMGRCICAgICovCi0vKiAgdG8gKzZkQiwgRS5nLjogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogICAgICAgICAgMCAgICAgICBpcyAwZEIgY29tcHJlc3Npb24gKG5vIGVmZmVjdCkgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICAgICAgICAgIDU0NjEgICAgaXMgMWRCIGNvbXByZXNzaW9uIGdhaW4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgICAgICAgICAxMDkyMyAgIGlzIDJkQiBjb21wcmVzc2lvbiBnYWluICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogICAgICAgICAgMzI3NjcgICBpcyA2ZEIgY29tcHJlc3Npb24gZ2FpbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgVGhlIEdhaW4gaXMgcmVwcmVzZW50ZWQgYXMgYSBRMy4xMyBudW1iZXIgdG8gZ2l2ZSBhIHJhbmdlIG9mICs4IHRvIC1pbmZpbml0eSAgICAqLwotLyogIEUuZy46ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICAgICAgICAgIDAgICAgICAgaXMgLWluZmluaXR5ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgICAgICAgICAzMjc2NyAgIGlzICsxOGRCICh4OCkgZ2FpbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogICAgICAgICAgNDA5NiAgICBpcyAwZEIgZ2FpbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICAgICAgICAgIDEwMjQgICAgaXMgLTEyZEIgZ2FpbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLQotZXh0ZXJuIGNvbnN0IExWQ1NfVm9sQ29ycmVjdF90IExWQ1NfVm9sQ29ycmVjdFRhYmxlW107Ci1leHRlcm4gY29uc3QgTFZNX0lOVDE2IExWQ1NfVm9sdW1lVENUYWJsZVtdOwotCi0KLS8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0vKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogIFNhbXBsZSByYXRlcyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotCi1leHRlcm4gTFZNX0lOVDMyICAgICAgICAgICAgICAgIExWQ1NfU2FtcGxlUmF0ZVRhYmxlW107Ci0KLQotLypTcGVha2VyIGNvZWZmaWVudCB0YWJsZXMqLwotZXh0ZXJuIExWTV9VSU5UMTYgICAgICAgICAgICAgICBMVkNTX01TX1NtYWxsX1NFTWlkZGxlR2FpblRhYmxlW107Ci1leHRlcm4gQmlxdWFkQTAxMkIxMkNvZWZzU1BfdCAgIExWQ1NfTVNfU21hbGxfU0VTaWRlQ29lZlRhYmxlW107Ci1leHRlcm4gQmlxdWFkQTAxMkIxMkNvZWZzU1BfdCAgIExWQ1NfTVNfU21hbGxfRXF1YWxpc2VyQ29lZlRhYmxlW107Ci1leHRlcm4gQmlxdWFkQTAxMkIxMkNvZWZzU1BfdCAgIExWQ1NfTVNfU21hbGxfUmV2ZXJiQ29lZlRhYmxlW10gOwotZXh0ZXJuIExWTV9VSU5UMTYgICAgICAgICAgICAgICBMVkNTX01TX1NtYWxsX1N0ZXJlb0RlbGF5Q1M0TVNbXTsKLWV4dGVybiBHYWluX3Q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V4dCAqcENvbnRleHQpOwotaW50ICBFZmZlY3Rfc2V0Q29uZmlnICAgICAgICAgIChFZmZlY3RDb250ZXh0ICpwQ29udGV4dCwgZWZmZWN0X2NvbmZpZ190ICpwQ29uZmlnKTsKLXZvaWQgRWZmZWN0X2dldENvbmZpZyAgICAgICAgICAoRWZmZWN0Q29udGV4dCAqcENvbnRleHQsIGVmZmVjdF9jb25maWdfdCAqcENvbmZpZyk7Ci1pbnQgIEJhc3NCb29zdF9zZXRQYXJhbWV0ZXIgICAgKEVmZmVjdENvbnRleHQgKnBDb250ZXh0LCB2b2lkICpwUGFyYW0sIHZvaWQgKnBWYWx1ZSk7Ci1pbnQgIEJhc3NCb29zdF9nZXRQYXJhbWV0ZXIgICAgKEVmZmVjdENvbnRleHQgKnBDb250ZXh0LAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZvaWQgICAgICAgICAgICpwUGFyYW0sCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2l6ZV90ICAgICAgICAgKnBWYWx1ZVNpemUsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdm9pZCAgICAgICAgICAgKnBWYWx1ZSk7Ci1pbnQgIFZpcnR1YWxpemVyX3NldFBhcmFtZXRlciAgKEVmZmVjdENvbnRleHQgKnBDb250ZXh0LCB2b2lkICpwUGFyYW0sIHZvaWQgKnBWYWx1ZSk7Ci1pbnQgIFZpcnR1YWxpemVyX2dldFBhcmFtZXRlciAgKEVmZmVjdENvbnRleHQgKnBDb250ZXh0LAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZvaWQgICAgICAgICAgICpwUGFyYW0sCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2l6ZV90ICAgICAgICAgKnBWYWx1ZVNpemUsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdm9pZCAgICAgICAgICAgKnBWYWx1ZSk7Ci1pbnQgIEVxdWFsaXplcl9zZXRQYXJhbWV0ZXIgICAgKEVmZmVjdENvbnRleHQgKnBDb250ZXh0LCB2b2lkICpwUGFyYW0sIHZvaWQgKnBWYWx1ZSk7Ci1pbnQgIEVxdWFsaXplcl9nZXRQYXJhbWV0ZXIgICAgKEVmZmVjdENvbnRleHQgKnBDb250ZXh0LAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2b2lkICAgICAgICAgICpwUGFyYW0sCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNpemVfdCAgICAgICAgKnBWYWx1ZVNpemUsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZvaWQgICAgICAgICAgKnBWYWx1ZSk7Ci1pbnQgIFZvbHVtZV9zZXRQYXJhbWV0ZXIgICAgICAgKEVmZmVjdENvbnRleHQgKnBDb250ZXh0LCB2b2lkICpwUGFyYW0sIHZvaWQgKnBWYWx1ZSk7Ci1pbnQgIFZvbHVtZV9nZXRQYXJhbWV0ZXIgICAgICAgKEVmZmVjdENvbnRleHQgKnBDb250ZXh0LAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2b2lkICAgICAgICAgICpwUGFyYW0sCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNpemVfdCAgICAgICAgKnBWYWx1ZVNpemUsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZvaWQgICAgICAgICAgKnBWYWx1ZSk7Ci1pbnQgRWZmZWN0X3NldEVuYWJsZWQoRWZmZWN0Q29udGV4dCAqcENvbnRleHQsIGJvb2wgZW5hYmxlZCk7Ci0KLS8qIEVmZmVjdCBMaWJyYXJ5IEludGVyZmFjZSBJbXBsZW1lbnRhdGlvbiAqLwotZXh0ZXJuICJDIiBpbnQgRWZmZWN0UXVlcnlOdW1iZXJFZmZlY3RzKHVpbnQzMl90ICpwTnVtRWZmZWN0cyl7Ci0gICAgQUxPR1YoIlxuXHRFZmZlY3RRdWVyeU51bWJlckVmZmVjdHMgc3RhcnQiKTsKLSAgICAqcE51bUVmZmVj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KLSAgICAgICAgQUxPR1YoIlx0THZtQnVuZGxlX2luaXQgcENvbnRleHQtPnBCYXNzQm9vc3QgIT0gTlVMTCAiCi0gICAgICAgICAgICAgICAgIi0+IENhbGxlZCBwQ29udGV4dC0+cEJhc3NCb29zdC0+ZnJlZSgpIik7Ci0gICAgfQotCi0gICAgTFZNX1JldHVyblN0YXR1c19lbiAgICAgTHZtU3RhdHVzPUxWTV9TVUNDRVNTOyAgICAgICAgICAvKiBGdW5jdGlvbiBjYWxsIHN0YXR1cyAqLwotICAgIExWTV9Db250cm9sUGFyYW1zX3QgICAgIHBhcmFtczsgICAgICAgICAgICAgICAgICAgICAgICAgLyogQ29udHJvbCBQYXJhbWV0ZXJzICovCi0gICAgTFZNX0luc3RQYXJhbXNfdCAgICAgICAgSW5zdFBhcmFtczsgICAgICAgICAgICAgICAgICAgICAvKiBJbnN0YW5jZSBwYXJhbWV0ZXJzICovCi0gICAgTFZNX0VRTkJfQmFuZERlZl90ICAgICAgQmFuZERlZnNbTUFYX05VTV9CQU5EU107ICAgICAgICAvKiBFcXVhbGlzZXIgYmFuZCBkZWZpbml0aW9ucyAqLwotICAgIExWTV9IZWFkcm9vbVBhcmFtc190ICAgIEhlYWRyb29tUGFyYW1zOyAgICAgICAgICAgICAgICAgLyogSGVhZHJvb20gcGFyYW1ldGVycyAqLwotICAgIExWTV9IZWFkcm9vbUJhbmREZWZfdCAgIEhlYWRyb29tQmFuZERlZltMVk1fSEVBRFJPT01fTUFYX05CQU5EU107Ci0gICAgTFZNX01lbVRhYl90ICAgICAgICAgICAgTWVtVGFiOyAgICAgICAgICAgICAgICAgICAgICAgICAvKiBNZW1vcnkgYWxsb2NhdGlvbiB0YWJsZSAqLwotICAgIGJvb2wgICAgICAgICAgICAgICAgICAgIGJNYWxsb2NGYWlsdXJlID0gTFZNX0ZBTFNFOwotCi0gICAgLyogU2V0IHRoZSBjYXBhYmlsaXRpZXMgKi8KLSAgICBJbnN0UGFyYW1zLkJ1ZmZlck1vZ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ICAgICAgICAgICAgICAgLyogSW5wdXQgYnVmZmVyICovCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgcE91dFRtcCwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvKiBPdXRwdXQgYnVmZmVyICovCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgKExWTV9VSU5UMTYpZnJhbWVDb3VudCwgICAgICAgICAgICAgICAvKiBOdW1iZXIgb2Ygc2FtcGxlcyB0byByZWFkICovCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgMCk7ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvKiBBdWRvIFRpbWUgKi8KLQotICAgIExWTV9FUlJPUl9DSEVDSyhMdm1TdGF0dXMsICJMVk1fUHJvY2VzcyIsICJMdm1CdW5kbGVfcHJvY2VzcyIpCi0gICAgaWYoTHZtU3RhdHVzICE9IExWTV9TVUNDRVNTKSByZXR1cm4gLUVJTlZBTDsKLQotICAgICNpZmRlZiBMVk1fUENNCi0gICAgZndyaXRlKHBPdXRUbXAsIGZyYW1lQ291bnQqc2l6ZW9mKExWTV9JTlQxNikqMiwgMSwgcENvbnRleHQtPnBCdW5kbGVkQ29udGV4dC0+UGNtT3V0UHRyKTsKLSAgICBmZmx1c2gocENvbnRleHQtPnBCdW5kbGVkQ29udGV4dC0+UGNtT3V0UHRyKTsKLSAgICAjZW5kaWYKLQotICAgIGlmIChwQ29udGV4dC0+Y29uZmlnLm91dHB1dENmZy5hY2Nlc3NNb2RlID09IEVGRkVDVF9CVUZGRVJfQUNDRVNTX0FDQ1VNVUxBVEUpewotICAgICAgICBmb3IgKGludCBpPTA7IGk8ZnJhbWVDb3VudCoyOyBpKyspewotICAgICAgICAgICAgcE91dFtpXSA9IGNsYW1wMTYoKExWTV9JTlQzMilwT3V0W2ldICsgKExWTV9JTlQzMilwT3V0VG1wW2ldKTsKLSAgICAgICAgfQotICAgIH0KLSAgICByZXR1cm4gMDsKLX0gICAgLyogZW5kIEx2bUJ1bmRs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tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tCi0KLWludCBCYXNzQm9vc3RfZ2V0UGFyYW1ldGVyKEVmZmVjdENvbnRleHQgICAgICpwQ29udGV4dCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgIHZvaWQgICAgICAgICAgICAgICpwUGFyYW0sCi0gICAgICAgICAgICAgICAgICAgICAgICAgICBzaXplX3QgICAgICAgICAgICAqcFZhbHVlU2l6ZSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgIHZvaWQgICAgICAgICAgICAgICpwVmFsdWUpewotICAgIGludCBzdGF0dXMgPSAwOwotICAgIGludDMyX3QgKnBQYXJhbVRlbXAgPSAoaW50MzJfdCAqKXBQYXJhbTsKLSAgICBpbnQzMl90IHBhcmFtID0gKnBQYXJhbVRlbXArKzsKLSAgICBpbnQzMl90IHBhcmFtMjsKLSAgICBjaGFyICpuYW1lOwotCi0gICAgLy9BTE9HVigiXHRCYXNzQm9vc3RfZ2V0UGFyYW1ldGVyIHN0YXJ0Iik7Ci0KLSAgICBzd2l0Y2ggKHBhcmFtKXsKLSAgICAgICAgY2FzZSBCQVNTQk9PU1RfUEFSQU1fU1RSRU5HVEhfU1VQUE9SVEVEOgotICAgICAgICAgICAgaWYgKCpwVmFsdWVTaXplICE9IHNpemVvZih1aW50MzJfdCkpewotICAgICAgICAgICAgICAgIEFMT0dWKCJcdExWTV9FUlJPUiA6IEJhc3NCb29zdF9nZXRQYXJhbWV0ZXIoKSBpbnZhbGlkIHBWYWx1ZVNpemUxICVkIiwgKnBWYWx1ZVNpemUpOwotICAgICAgICAgICAgICAgIHJldHVybiAtRUlOVkFMOwotICAgICAgICAgICAgfQotICAgICAgICAgICAgKnBWYWx1ZVNpemUgPSBzaXplb2YodWludDMyX3QpOwotICAgICAgICAgICAgYnJlYWs7Ci0gICAgICAgIGNhc2UgQkFTU0JPT1NUX1B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ZlY3RzOgotLy8KLS8vLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLQotCi1pbnQgVmlydHVhbGl6ZXJfZ2V0UGFyYW1ldGVyKEVmZmVjdENvbnRleHQgICAgICAgICpwQ29udGV4dCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdm9pZCAgICAgICAgICAgICAgICAgKnBQYXJhbSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2l6ZV90ICAgICAgICAgICAgICAgKnBWYWx1ZVNpemUsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZvaWQgICAgICAgICAgICAgICAgICpwVmFsdWUpewotICAgIGludCBzdGF0dXMgPSAwOwotICAgIGludDMyX3QgKnBQYXJhbVRlbXAgPSAoaW50MzJfdCAqKXBQYXJhbTsKLSAgICBpbnQzMl90IHBhcmFtID0gKnBQYXJhbVRlbXArKzsKLSAgICBpbnQzMl90IHBhcmFtMjsKLSAgICBjaGFyICpuYW1lOwotCi0gICAgLy9BTE9HVigiXHRWaXJ0dWFsaXplcl9nZXRQYXJhbWV0ZXIgc3RhcnQiKTsKLQotICAgIHN3aXRjaCAocGFyYW0pewotICAgICAgICBjYXNlIFZJUlRVQUxJWkVSX1BBUkFNX1NUUkVOR1RIX1NVUFBPUlRFRDoKLSAgICAgICAgICAgIGlmICgqcFZhbHVlU2l6ZSAhPSBzaXplb2YodWludDMyX3QpKXsKLSAgICAgICAgICAgICAgICBBTE9HVigiXHRMVk1fRVJST1IgOiBWaXJ0dWFsaXplcl9nZXRQYXJhbWV0ZXIoKSBpbnZhbGlkIHBWYWx1ZVNpemUgJWQiLCpwVmFsdWVTaXplKTsKLSAgICAgICAgICAgICAgICByZXR1cm4gLUVJTlZBTDsKLSAgICAgICAgICAgIH0KLSAgICAgICAgICAgICpwVmFsdWVTaXplID0gc2l6ZW9mKHVpbnQzMl90KTsKLSAgICAgICAgICAgIGJyZWFrOwotICAgICAgICBjYXNlIFZJUlRVQUxJWkVSX1BBUkFNX1NUUkVOR1RIOgotICAgICAgICAgICAgaWYgKCpwVmFsdWVTaXplICE9IHNpemVvZihpbnQxNl90KSl7Ci0gICAgICAgICAgICAgICAgQUxPR1YoIlx0TFZNX0VSUk9SIDogVmlydHVhbGl6ZXJfZ2V0UGFyYW1ldGVyKCkgaW52YWxpZCBwVmFsdWVTaXplMiAlZCIsKnBWYWx1ZVNpemUpOwotICAgICAgICAgICAgICAgIHJldHVybiAtRUlOVkFMOwotICAgICAgICAgICAgfQotICAgICAgICAgICAgKnBWYWx1ZVNpemUgPSBzaXplb2YoaW50MTZfdCk7Ci0gICAgICAgICAgICBicmVhazsKLQotICAgICAgICBkZWZhdWx0OgotICAgICAgICAgICAgQUxPR1YoIlx0TFZNX0VSUk9SIDogVmlydHVhbGl6ZXJfZ2V0UGFyYW1ldGVyKCkgaW52YWxpZCBwYXJhbSAlZCIsIHBhcmFtKTsKLSAgICAgICAgICAgIHJldHVybiAtRUlOVkFMOwotICAgIH0KLQotICAgIHN3aXRjaCAocGFyYW0pewotICAgICAgICBjYXNlIFZJUlRVQUxJWkVSX1BBUkFNX1NUUkVOR1RIX1NVUFBPUlRFRDoKLSAgICAgICAgICAgICoodWludDMyX3QgKilwVmFsdWUgPSAxOwotCi0gICAgICAgICAgICAvL0FMT0dWKCJcdFZpcnR1YWxpemVyX2dldFBhcmFtZXRlcigpIFZJUlRVQUxJWkVSX1BBUkFNX1NUUkVOR1RIX1NVUFBPUlRFRCBWYWx1ZSBpcyAlZCIsCi0gICAgICAgICAgICAvLyAgICAgICAgKih1aW50MzJfdCAqKXBWYWx1ZSk7Ci0gICAgICAgICAgICBicmVhazsKLQotICAgICAgICBjYXNlIFZJUlRVQUxJWkVSX1BBUkFNX1NUUkVOR1RIOgotICAgICAgICAgICAgKihpbnQxNl90ICopcFZhbHVlID0gVmlydHVhbGl6ZXJHZXRTd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DRU5URVJfRlJFUToKLSAgICAgICAgcGFyYW0yID0gKnBQYXJhbVRlbXA7Ci0gICAgICAgIGlmIChwYXJhbTIgPj0gRklWRUJBTkRfTlVNQkFORFMpIHsKLSAgICAgICAgICAgIHN0YXR1cyA9IC1FSU5WQUw7Ci0gICAgICAgICAgICBicmVhazsKLSAgICAgICAgfQotICAgICAgICAqKGludDMyX3QgKilwVmFsdWUgPSBFcXVhbGl6ZXJHZXRDZW50cmVGcmVxdWVuY3kocENvbnRleHQsIHBhcmFtMik7Ci0gICAgICAgIC8vQUxPR1YoIlx0RXF1YWxpemVyX2dldFBhcmFtZXRlcigpIEVRX1BBUkFNX0NFTlRFUl9GUkVRIGJhbmQgJWQsIGZyZXF1ZW5jeSAlZCIsCi0gICAgICAgIC8vICAgICAgcGFyYW0yLCAqKGludDMyX3QgKilwVmFsdWUpOwotICAgICAgICBicmVhazsKLQotICAgIGNhc2UgRVFfUEFSQU1fQkFORF9GUkVRX1JBTkdFOgotICAgICAgICBwYXJhbTIgPSAqcFBhcmFtVGVtcDsKLSAgICAgICAgaWYgKHBhcmFtMiA+PSBGSVZFQkFORF9OVU1CQU5EUykgewotICAgICAgICAgICAgc3RhdHVzID0gLUVJTlZBTDsKLSAgICAgICAgICAgIGJyZWFrOwotICAgICAgICB9Ci0gICAgICAgIEVxdWFsaXplckdldEJhbmRGcmVxUmFuZ2UocENvbnRleHQsIHBhcmFtMiwgKHVpbnQzMl90ICopcFZhbHVlLCAoKHVpbnQzMl90ICopcFZhbHVlICsgMSkpOwotICAgICAgICAvL0FMT0dWKCJcdEVxdWFsaXplcl9nZXRQYXJhbWV0ZXIoKSBFUV9QQVJBTV9CQU5EX0ZSRVFfUkFOR0UgYmFuZCAlZCwgbWluICVkLCBtYXggJWQiLAotICAgICAgICAvLyAgICAgIHBhcmFtMiwgKihpbnQzMl90ICopcFZhbHVlLCAqKChpbnQzMl90ICopcFZhbHVlICsgMSkpOwotICAgICAgICBicmVhazsKLQotICAgIGNhc2U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gYmFuZCwgbGV2ZWwpOwotICAgICAgICBpZiAoYmFuZCA+PSBGSVZFQkFORF9OVU1CQU5EUykgewotICAgICAgICAgICAgc3RhdHVzID0gLUVJTlZBTDsKLSAgICAgICAgICAgIGJyZWFrOwotICAgICAgICB9Ci0gICAgICAgIEVxdWFsaXplclNldEJhbmRMZXZlbChwQ29udGV4dCwgYmFuZCwgbGV2ZWwpOwotICAgICAgICBicmVhazsKLSAgICBjYXNlIEVRX1BBUkFNX1BST1BFUlRJRVM6IHsKLSAgICAgICAgLy9BTE9HVigiXHRFcXVhbGl6ZXJfc2V0UGFyYW1ldGVyKCkgRVFfUEFSQU1fUFJPUEVSVElFUyIpOwotICAgICAgICBpbnQxNl90ICpwID0gKGludDE2X3QgKilwVmFsdWU7Ci0gICAgICAgIGlmICgoaW50KXBbMF0gPj0gRXF1YWxpemVyR2V0TnVtUHJlc2V0cygpKSB7Ci0gICAgICAgICAgICBzdGF0dXMgPSAtRUlOVkFMOwotICAgICAgICAgICAgYnJlYWs7Ci0gICAgICAgIH0KLSAgICAgICAgaWYgKHBbMF0gPj0gMCkgewotICAgICAgICAgICAgRXF1YWxpemVyU2V0UHJlc2V0KHBDb250ZXh0LCAoaW50KXBbMF0pOwotICAgICAgICB9IGVsc2UgewotICAgICAgICAgICAgaWYgKChpbnQpcFsxXSAhPSBGSVZFQkFORF9OVU1CQU5EUykgewotICAgICAgICAgICAgICAgIHN0YXR1cyA9IC1FSU5WQUw7Ci0gICAgICAgICAgICAgICAgYnJlYWs7Ci0gICAgICAgICAgICB9Ci0gICAgICAgICAgICBmb3IgKGludCBpID0gMDsgaSA8IEZJVkVCQU5EX05VTUJBTkRTOyBpKyspIHsKLSAgICAgICAgICAgICAgICBFcXVhbGl6ZXJTZXRCYW5kTGV2ZWwocENvbnRleHQsIGksIChpbnQpcFsyICsgaV0pOwotICAgICAgICAgICAgfQotICAgICAgICB9Ci0gICAgfSBicmVhazsKLSAgICBkZWZhdWx0OgotICAgICAgICBBTE9H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MOwotICAgICAgICAgICAgfQotICAgICAgICAgICAgKnBWYWx1ZVNpemUgPSBzaXplb2YoaW50MTZfdCk7Ci0gICAgICAgICAgICBicmVhazsKLQotICAgICAgICBjYXNlIFZPTFVNRV9QQVJBTV9NVVRFOgotICAgICAgICBjYXNlIFZPTFVNRV9QQVJBTV9FTkFCTEVTVEVSRU9QT1NJVElPTjoKLSAgICAgICAgICAgIGlmICgqcFZhbHVlU2l6ZSA8IHNpemVvZihpbnQzMl90KSl7Ci0gICAgICAgICAgICAgICAgQUxPR1YoIlx0TFZNX0VSUk9SIDogVm9sdW1lX2dldFBhcmFtZXRlcigpIGludmFsaWQgcFZhbHVlU2l6ZSAyICAlZCIsICpwVmFsdWVTaXplKTsKLSAgICAgICAgICAgICAgICByZXR1cm4gLUVJTlZBTDsKLSAgICAgICAgICAgIH0KLSAgICAgICAgICAgICpwVmFsdWVTaXplID0gc2l6ZW9mKGludDMyX3QpOwotICAgICAgICAgICAgYnJlYWs7Ci0KLSAgICAgICAgZGVmYXVsdDoKLSAgICAgICAgICAgIEFMT0dWKCJcdExWTV9FUlJPUiA6IFZvbHVtZV9nZXRQYXJhbWV0ZXIgdW5rbm93biBwYXJhbSAlZCIsIHBhcmFtKTsKLSAgICAgICAgICAgIHJldHVybiAtRUlOVkFMOwotICAgIH0KLQotICAgIHN3aXRjaCAocGFyYW0pewotICAgICAgICBjYXNlIFZPTFVNRV9QQVJBTV9MRVZFTDoKLSAgICAgICAgICAgIHN0YXR1cyA9IFZvbHVtZUdldFZvbHVtZUxldmVsKHBDb250ZXh0LCAoaW50MTZfdCAqKShwVmFsdWUpKTsKLSAgICAgICAgICAgIC8vQUxPR1YoIlx0Vm9sdW1lX2dldFBhcmFtZXRlcigpIFZPTFVNRV9QQVJBTV9MRVZFTCBWYWx1ZSBpcyAlZCIsCi0gICAgICAgICAgICAvLyAgICAgICAgKihpbnQxNl90ICopcFZhbHVlKTsKLSAgICAgICAgICAgIGJyZWFrOwotCi0gICAgICAgIG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QgaW50ZWdlcgotICogIE91dHB1dCAgICAgIDogU2lnbmVkIDE2LWJpdCBpbnRlZ2VyCi0gKiAgICAgICAgICAgICAgICAgIE1TQiAoMTYpID0gc2lnbiBiaXQKLSAqICAgICAgICAgICAgICAgICAgKDE1LT4wNSkgPSBpbnRlZ2VyIHBhcnQKLSAqICAgICAgICAgICAgICAgICAgKDA0LT4wMSkgPSBkZWNpbWFsIHBhcnQKLSAqICBSZXR1cm5zICAgICA6IERiIHZhbHVlIHdpdGggcmVzcGVjdCB0byBmdWxsIHNjYWxlCi0gKiAgRGVzY3JpcHRpb24gOgotICogIFJlbWFya3MgICAgIDoKLSAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotCi1MVk1fSU5UMTYgTFZDX1RvREJfczMyVG9zMTYoTFZNX0lOVDMyIExpbl9maXgpCi17Ci0gICAgTFZNX0lOVDE2ICAgZGJfZml4OwotICAgIExWTV9JTlQxNiAgIFNoaWZ0OwotICAgIExWTV9JTlQxNiAgIFNtYWxsUmVtYWluZGVyOwotICAgIExWTV9VSU5UMzIgIFJlbWFpbmRlciA9IChMVk1fVUlOVDMyKUxpbl9maXg7Ci0KLSAgICAvKiBDb3VudCBsZWFkaW5nIGJpdHMsIDEgY3ljbGUgaW4gYXNzZW1ibHkqLwotICAgIGZvciAoU2hpZnQgPSAwOyBTaGlmdDwzMjsgU2hpZnQrKykKLSAgICB7Ci0gICAgICAgIGlmICgoUmVtYWluZGVyICYgMHg4MDAwMDAwMFUpIT0wKQotICAgICAgICB7Ci0gICAgICAgICAgICBicmVhazsKLSAgICAgICAgfQotICAgICAgICBSZW1haW5kZXIgPSBSZW1haW5kZXIgPDwgMTsKLSAgICB9Ci0KLSAgICAvKgotICAgICAqIEJhc2VkIG9uIHRoZSBhcHByb3hpbWF0aW9uIGVxdWF0aW9uIChmb3IgUTExLjQgZm9ybWF0KToKLSA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AgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgIGlmKHBDb250ZXh0LT5wQnVuZGxlZENvbnRleHQtPlNhbXBsZXNUb0V4aXRDb3VudEJiIDw9IDApewotICAgICAgICAgICAgICAgICAgICBwQ29udGV4dC0+cEJ1bmRsZWRDb250ZXh0LT5OdW1iZXJFZmZlY3RzRW5hYmxlZCsrOwotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICBwQ29udGV4dC0+cEJ1bmRsZWRDb250ZXh0LT5TYW1wbGVzVG9FeGl0Q291bnRCYiA9Ci0gICAgICAgICAgICAgICAgICAgICAoTFZNX0lOVDMyKShwQ29udGV4dC0+cEJ1bmRsZWRDb250ZXh0LT5TYW1wbGVzUGVyU2Vjb25kKjAuMSk7Ci0gICAgICAgICAgICAgICAgcENvbnRleHQtPnBCdW5kbGVkQ29udGV4dC0+YkJhc3NFbmFibGVkID0gTFZNX1RSVUU7Ci0gICAgICAgICAgICAgICAgdGVtcERpc2FibGVkID0gcENvbnRleHQtPnBCdW5kbGVkQ29udGV4dC0+YkJhc3NUZW1wRGlzYWJsZWQ7Ci0gICAgICAgICAgICAgICAgYnJlYWs7Ci0gICAgICAgICAgICBjYXNlIExWTV9FUVVBTElaRVI6Ci0gICAgICAgICAgICAgICAgaWYgKHBDb250ZXh0LT5wQnVuZGxlZENvbnRleHQtPmJFcXVhbGl6ZXJFbmFibGVkID09IExWTV9UUlVFKSB7Ci0gICAgICAgICAgICAgICAgICAgIEFMT0dWKCJcdEVmZmVjdF9zZXRFbmFibGVkKCkgTFZNX0VRVUFMSVpFUiBpcyBhbHJlYWR5IGVuYWJsZWQiKTsKLSAgICAgICAgICAgICAgICAgICAgcmV0dXJuIC1FSU5WQUw7Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgIGlmKHBDb250ZXh0LT5wQnVuZGxlZENvbnRleHQtPlNhbXBsZXNUb0V4aXRDb3VudEVxIDw9IDApewotICAgICAgICAgICAgICAgICAgICBwQ29udGV4dC0+cEJ1bmRsZWRDb250ZXh0LT5OdW1iZXJFZmZlY3RzRW5hYmxlZCsrOwotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICBwQ29udGV4dC0+cEJ1bmRsZWRDb250ZXh0LT5TYW1wbGVzVG9FeGl0Q291bnRFcSA9Ci0gICAgICAgICAgICAgICAgICAgICAoTFZNX0lOVDMyKShwQ29udGV4dC0+cEJ1bmRsZWRDb250ZXh0LT5TYW1wbGVzUGVyU2Vjb25kKjAuMSk7Ci0gICAgICAgICAgICAgICAgcENvbnRleHQtPnBCdW5kbGVkQ29udGV4dC0+YkVxdWFsaXplckVuYWJsZWQgPSBMVk1fVFJVRTsKLSAgICAgICAgICAgICAgICBicmVhazsKLSAgICAgICAgICAgIGNhc2UgTFZNX1ZJUlRVQUxJWkVSOgotICAgICAgICAgICAgICAgIGlmIChwQ29udGV4dC0+cEJ1bmRsZWRDb250ZXh0LT5iVmlydHVhbGl6ZXJFbmFibGVkID09IExWTV9UUlVFKSB7Ci0gICAgICAgICAgICAgICAgICAgIEFMT0dWKCJcdEVmZmVjdF9zZXRFbmFibGVkKCkgTFZNX1ZJUlRVQUxJWkVSIGlzIGFscmVhZHkgZW5hYmxlZCIpOwotICAgICAgICAgICAgICAgICAgICByZXR1cm4gLUVJTlZBTDsKLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgaWYocENvbnRleHQtPnBCdW5kbGVkQ29udGV4dC0+U2FtcGxlc1RvRXhpdENvdW50VmlydCA8PSAwKXsKLSAgICAgICAgICAgICAgICAgICAgcENvbnRleHQtPnBCdW5kbGVkQ29udGV4dC0+TnVtYmVyRWZmZWN0c0VuYWJsZWQrKzsKLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgcENvbnRleHQtPnBCdW5kbGVkQ29udGV4dC0+U2FtcGxlc1RvRXhpdENvdW50VmlydCA9Ci0gICAgICAgICAgICAgICAgICAgICAoTFZNX0lOVDMyKShwQ29udGV4dC0+cEJ1bmRsZWRDb250ZXh0LT5TYW1wbGVzUGVyU2Vjb25kKjAuMSk7Ci0gICAgICAgICAgICAgICAgcENvbnRleHQtPnBCdW5kbGVkQ29udGV4dC0+YlZpcnR1YWxpemVyRW5hYmxlZCA9IExWTV9UUlVFOwotICAgICAgICAgICAgICAgIHRlbXBEaXNhYmxlZCA9IHBDb250ZXh0LT5wQnVuZGxlZENvbnRleHQtPmJWaXJ0dWFsaXplclRlbXBEaXNhYmxlZDsKLSAgICAgICAgICAgICAgICBicmVhazsKLSAgICAgICAgICAgIGNhc2UgTFZNX1ZPTFVNRToKLSAgICAgICAgICAgICAgICBpZiAocENvbnRleHQtPnBCdW5kbGVkQ29udGV4dC0+YlZvbHVtZUVuYWJsZWQgPT0gTFZNX1RSVUUpIHsKLSAgICAgICAgICAgICAgICAgICAgQUxPR1YoIlx0RWZmZWN0X3NldEVuYWJsZWQoKSBMVk1fVk9MVU1FIGlzIGFscmVhZHkgZW5hYmxlZCIpOwotICAgICAgICAgICAgICAgICAgICByZXR1cm4gLUVJTlZBTDsKLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgcENvbnRleHQtPnBCdW5kbGVkQ29udGV4dC0+TnVtYmVyRWZmZWN0c0VuYWJsZWQrKzsKLSAgICAgICAgICAgICAgICBwQ29udGV4dC0+cEJ1bmRsZWRDb250ZXh0LT5iVm9sdW1lRW5hYmxlZCA9IExWTV9UUlVFOwotICAgICAgICAgICAgICAgIGJyZWFrOwotICAgICAgICAgICAgZGVmYXVsdDoKLSAgICAgICAgICAgICAgICBBTE9HVigiXHRFZmZlY3Rfc2V0RW5hYmxlZCgpIGludmFsaWQgZWZmZWN0IHR5cGUiKTsKLSAgICAgICAgICAgICAgICByZXR1cm4gLUVJTlZBTDsKLSAgICAgICAgfQotICAgICAgICBpZiAoIXRlbXBEaXNhYmxlZCkgewotICAgICAgICAgICAgTHZtRWZmZWN0X2VuYWJsZShwQ29udGV4dCk7Ci0gICAgICAgIH0KLSAgICB9IGVsc2UgewotICAgICAgICBzd2l0Y2ggKHBDb250ZXh0LT5FZmZlY3RUeXBlKSB7Ci0gICAgICAgICAgICBjYXNlIExWTV9CQVNTX0JPT1NUOgotICAgICAgICAgICAgICAgIGlmIChwQ29udGV4dC0+cEJ1bmRsZWRDb250ZXh0LT5iQmFzc0VuYWJsZWQgPT0gTFZNX0ZBTFNFKSB7Ci0gICAgICAgICAgICAgICAgICAgIEFMT0dWKCJcdEVmZmVjdF9zZXRFbmFibGVkKCkgTFZNX0JBU1NfQk9PU1QgaXMgYWxyZWFkeSBkaXNhYmxlZCIpOwotICAgICAgICAgICAgICAgICAgICByZXR1cm4gLUVJTlZBTDsKLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgcENvbnRleHQtPnBCdW5kbGVkQ29udGV4dC0+YkJhc3NFbmFibGVkID0gTFZNX0ZBTFNFOwotICAgICAgICAgICAgICAgIGJyZWFrOwotICAgICAgICAgICAgY2FzZSBMVk1fRVFVQUxJWkVSOgotICAgICAgICAgICAgICAgIGlmIChwQ29udGV4dC0+cEJ1bmRsZWRDb250ZXh0LT5iRXF1YWxpemVyRW5hYmxlZCA9PSBMVk1fRkFMU0UpIHsKLSAgICAgICAgICAgICAgICAgICAgQUxPR1YoIlx0RWZmZWN0X3NldEVuYWJsZWQoKSBMVk1fRVFVQUxJWkVSIGlzIGFscmVhZHkgZGlzYWJsZWQiKTsKLSAgICAgICAgICAgICAgICAgICAgcmV0dXJuIC1FSU5WQUw7Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgIHBDb250ZXh0LT5wQnVuZGxlZENvbnRleHQtPmJFcXVhbGl6ZXJFbmFibGVkID0gTFZNX0ZBTFNFOwotICAgICAgICAgICAgICAgIGJyZWFrOwotICAgICAgICAgICAgY2FzZSBMVk1fVklSVFVBTElaRVI6Ci0gICAgICAgICAgICAgICAgaWYgKHBDb250ZXh0LT5wQnVuZGxlZENvbnRleHQtPmJWaXJ0dWFsaXplckVuYWJsZWQgPT0gTFZNX0ZBTFNFKSB7Ci0gICAgICAgICAgICAgICAgICAgIEFMT0dWKCJcdEVmZmVjdF9zZXRFbmFibGVkKCkgTFZNX1ZJUlRVQUxJWkVSIGlzIGFscmVhZHkgZGlzYWJsZWQiKTsKLSAgICAgICAgICAgICAgICAgICAgcmV0dXJuIC1FSU5WQUw7Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgIHBDb250ZXh0LT5wQnVuZGxlZENvbnRleHQtPmJWaXJ0dWFsaXplckVuYWJsZWQgPSBMVk1fRkFMU0U7Ci0gICAgICAgICAgICAgICAgYnJlYWs7Ci0gICAgICAgICAgICBjYXNlIExWTV9WT0xVTUU6Ci0gICAgICAgICAgICAgICAgaWYgKHBDb250ZXh0LT5wQnVuZGxlZENvbnRleHQtPmJWb2x1bWVFbmFibGVkID09IExWTV9GQUxTRSkgewotICAgICAgICAgICAgICAgICAgICBBTE9HVigiXHRFZmZlY3Rfc2V0RW5hYmxlZCgpIExWTV9WT0xVTUUgaXMgYWxyZWFkeSBkaXNhYmxlZCIpOwotICAgICAgICAgICAgICAgICAgICByZXR1cm4gLUVJTlZBTDsKLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgcENvbnRleHQtPnBCdW5kbGVkQ29udGV4dC0+YlZvbHVtZUVuYWJsZWQgPSBMVk1fRkFMU0U7Ci0gICAgICAgICAgICAgICAgYnJlYWs7Ci0gICAgICAgICAgICBkZWZhdWx0OgotICAgICAgICAgICAgICAgIEFMT0dWKCJcdEVmZmVjdF9zZXRFbmFibGVkKCkgaW52YWxpZCBlZmZlY3QgdHlwZSIpOwotICAgICAgICAgICAgICAgIHJldHVybiAtRUlOVkFMOwotICAgICAgICB9Ci0gICAgICAgIEx2bUVmZmVjdF9kaXNhYmxlKHBDb250ZXh0KTsKLSAgICB9Ci0KLSAgICByZXR1cm4gMDsKLX0KLQotLy8tLS0tLS0tLS0tLS0tLS0tLS0tL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bGVfcHJvY2VzcyggICAgKExWTV9JTlQxNiAqKWluQnVmZmVyLT5yYXcsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoTFZNX0lOVDE2ICopb3V0QnVmZmVyLT5yYXcsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBvdXRCdWZmZXItPmZyYW1lQ291bnQsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwQ29udGV4dCk7Ci0gICAgICAgIGlmKGx2bVN0YXR1cyAhPSBMVk1fU1VDQ0VTUyl7Ci0gICAgICAgICAgICBBTE9HVigiXHRMVk1fRVJST1IgOiBMdm1CdW5kbGVfcHJvY2VzcyByZXR1cm5lZCBlcnJvciAlZCIsIGx2bVN0YXR1cyk7Ci0gICAgICAgICAgICByZXR1cm4gbHZtU3RhdHVzOwotICAgICAgICB9Ci0gICAgfSBlbHNlIHsKLSAgICAgICAgLy9BTE9HVigiXHRFZmZlY3RfcHJvY2VzcyBOb3QgQ2FsbGluZyBwcm9jZXNzIHdpdGggJWQgZWZmZWN0cyBlbmFibGVkLCAlZCBjYWxsZWQ6IEVmZmVjdCAlZCIsCi0gICAgICAgIC8vcENvbnRleHQtPnBCdW5kbGVkQ29udGV4dC0+TnVtYmVyRWZmZWN0c0VuYWJsZWQsCi0gICAgICAgIC8vcENvbnRleHQtPnBCdW5kbGVkQ29udGV4dC0+TnVtYmVyRWZmZWN0c0NhbGxlZCwgcENvbnRleHQtPkVmZmVjdFR5cGUpOwotICAgICAgICAvLyAyIGlzIGZvciBzdGVyZW8gaW5wdXQKLSAgICAgICAgaWYgKHBDb250ZXh0LT5jb25maWcub3V0cHV0Q2ZnLmFjY2Vzc01vZGUgPT0gRUZGRUNUX0JVRkZFUl9BQ0NFU1NfQUNDVU1VTEFURSkgewotICAgICAgICAgICAgZm9yIChzaXplX3QgaT0wOyBpIDwgb3V0QnVmZmVyLT5mcmFtZUNvdW50KjI7IGkrKyl7Ci0gICAgICAgICAgICAgICAgb3V0QnVmZmVyLT5zMTZbaV0gPQotICAgICAgICAgICAgICAgICAgICAgICAgY2xhbXAxNigoTFZNX0lOVDMyKW91dEJ1ZmZlci0+czE2W2ldICsgKExWTV9JTlQzMilpbkJ1ZmZlci0+czE2W2ldKTsKLSAgICAgICAgICAgIH0KLSAgICAgICAgfSBlbHNlIHsKLSAgICAgICAgICAgIG1lbWNweShvdXRCdWZmZXItPnJhdywgaW5CdWZmZXItPnJhdywgb3V0QnVmZmVyLT5mcmFtZUNvdW50KnNpemVvZihMVk1fSU5UMTYpKjIpOwotICAgICAgICB9Ci0gICAgfQotCi0gICAgcmV0dXJuIHN0YXR1czsKLX0gICAvKiBlbmQgRWZmZWN0X3Byb2Nlc3MgKi8KLQotLyogRWZmZWN0IENvbnRyb2wgSW50ZXJmYWNlIEltcGxlbWVudGF0aW9uOiBDb21tYW5kICovCi1pbnQgRWZmZWN0X2NvbW1hbmQoZWZmZWN0X2hhbmRsZV90ICBzZWxmLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdWludDMyX3QgICAgICAgICAgICBjbWRDb2RlLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdWludDMyX3QgICAgICAgICAgICBjbWRTaXplLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdm9pZCAgICAgICAgICAgICAgICAqcENtZERhdGEsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICB1aW50MzJfdCAgICAgICAgICAgICpyZXBseVNpemUsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2b2lkICAgICAgICAgICAgICAgICpwUmVwbHlEYXRhKXsKLSAgICBFZmZlY3RDb250ZXh0ICogcENvbnRleHQgPSAoRWZmZWN0Q29udGV4dCAqKSBzZWxmOwotICAgIGludCByZXRzaXplOwotCi0gICAgLy9BTE9HVigiXHRcbkVmZmVjdF9jb21tYW5kIHN0YXJ0Iik7Ci0KLSAg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NUX0NNRF9JTklUIGZvciBMVk1fQkFTU19CT09TVCIpOwotICAgICAgICAgICAgICAgIGFuZHJvaWQ6OkJhc3NTZXRTdHJlbmd0aChwQ29udGV4dCwgMCk7Ci0gICAgICAgICAgICB9Ci0gICAgICAgICAgICBpZihwQ29udGV4dC0+RWZmZWN0VHlwZSA9PSBMVk1fVklSVFVBTElaRVIpewotICAgICAgICAgICAgICAgIC8vQUxPR1YoIlx0RWZmZWN0X2NvbW1hbmQgY21kQ29kZSBDYXNlOiBFRkZFQ1RfQ01EX0lOSVQgZm9yIExWTV9WSVJUVUFMSVpFUiIpOwotICAgICAgICAgICAgICAgIGFuZHJvaWQ6OlZpcnR1YWxpemVyU2V0U3RyZW5ndGgocENvbnRleHQsIDApOwotICAgICAgICAgICAgfQotICAgICAgICAgICAgaWYocENvbnRleHQtPkVmZmVjdFR5cGUgPT0gTFZNX0VRVUFMSVpFUil7Ci0gICAgICAgICAgICAgICAgLy9BTE9HVigiXHRFZmZlY3RfY29tbWFuZCBjbWRDb2RlIENhc2U6IEVGRkVDVF9DTURfSU5JVCBmb3IgTFZNX0VRVUFMSVpFUiIpOwotICAgICAgICAgICAgICAgIGFuZHJvaWQ6OkVxdWFsaXplclNldFByZXNldChwQ29udGV4dCwgMCk7Ci0gICAgICAgICAgICB9Ci0gICAgICAgICAgICBpZihwQ29udGV4dC0+RWZmZWN0VHlwZSA9PSBMVk1fVk9MVU1FKXsKLSAgICAgICAgICAgICAgICAvL0FMT0dWKCJcdEVmZmVjdF9jb21tYW5kIGNtZENvZGUgQ2FzZTogRUZGRUNUX0NNRF9JTklUIGZvciBMVk1fVk9MVU1FIik7Ci0gICAgICAgICAgICAgICAgKihpbnQgKikgcFJlcGx5RGF0YSA9IGFuZHJvaWQ6OlZvbHVtZVNldFZvbHVtZUxldmVsKHBDb250ZXh0LCAwKTsKLSAgICAgICAgICAgIH0KLSAgICAgICAgICAgIGJyZWFrOwotCi0gICAgICAgIGNhc2UgRUZGRUNUX0NNRF9TRVRfQ09ORklHOgotICAgICAgICAgICAgLy9BTE9HVigiXHRFZmZlY3RfY29tbWFuZCBjbWRDb2RlIENhc2U6IEVGRkVDVF9DTURfU0VUX0NPTkZJRyBzdGFydCIpOwotICAgICAgICAgICAgaWYgKHBDbWREYXRhICAgID09IE5VTEx8fAotICAgICAgICAgICAgICAgIGNtZFNpemUgICAgICE9IHNpemVvZihlZmZlY3RfY29uZmlnX3QpfHwKLSAgICAgICAgICAgICAgICBwUmVwbHlEYXRhICA9PSBOVUxMfHwKLSAgICAgICAgICAgICAgICAqcmVwbHlTaXplICAhPSBzaXplb2YoaW50KSl7Ci0gICAgICAgICAgICAgICAgQUxPR1YoIlx0TFZNX0VSUk9SIDogRWZmZWN0X2NvbW1hbmQgY21kQ29kZSBDYXNlOiAiCi0gICAgICAgICAgICAgICAgICAgICAgICAiRUZGRUNUX0NNRF9TRVRfQ09ORklHOiBFUlJPUiIpOwotICAgICAgICAgICAgICAgIHJldHVybiAtRUlOVkFMOwotICAgICAgICAgICAgfQotICAgICAgICAgICAgKihpbnQgKikgcFJlcGx5RGF0YSA9IGFuZHJvaWQ6OkVmZmVjdF9zZXRDb25maWcocENvbnRleHQsIChlZmZlY3RfY29uZmlnX3QgKikgcENtZERhdGEpOwotICAgICAgICAgICAgLy9BTE9HVigiXHRFZmZlY3RfY29tbWFuZCBjbWRDb2RlIENhc2U6IEVGRkVDVF9DTURfU0VUX0NPTkZJRyBlbmQiKTsKLSAgICAgICAgICAgIGJyZWFrOwotCi0gICAgICAgIGNhc2UgRUZGRUNUX0NNRF9HRVRfQ09ORklHOgotICAgICAgICAgICAgaWYgKHBSZXBseURhdGEgPT0gTlVMTCB8fAotICAgICAgICAgICAgICAgICpyZXBseVNpemUgIT0gc2l6ZW9mKGVmZmVjdF9jb25maWdfdCkpIHsKLSAgICAgICAgICAgICAgICBBTE9HVigiXHRMVk1fRVJST1IgOiBFZmZlY3RfY29tbWFuZCBjbWRDb2RlIENhc2U6ICIKLSAgICAg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AgICAgICAgICAgICAgICAgICAgICAgICpyZXBseVNpemUgPCAoaW50KSAoc2l6ZW9mKGVmZmVjdF9wYXJhbV90KSArIHNpemVvZihpbnQzMl90KSkpewotICAgICAgICAgICAgICAgICAgICBBTE9HVigiXHRMVk1fRVJST1IgOiBCYXNzQm9vc3RfY29tbWFuZCBjbWRDb2RlIENhc2U6ICIKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAiRUZGRUNUX0NNRF9HRVRfUEFSQU06IEVSUk9SIik7Ci0gICAgICAgICAgICAgICAgICAgIHJldHVybiAtRUlOVkFMOwotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICBlZmZlY3RfcGFyYW1fdCAqcCA9IChlZmZlY3RfcGFyYW1fdCAqKXBDbWREYXRhOwotCi0gICAgICAgICAgICAgICAgbWVtY3B5KHBSZXBseURhdGEsIHBDbWREYXRhLCBzaXplb2YoZWZmZWN0X3BhcmFtX3QpICsgcC0+cHNpemUpOwotCi0gICAgICAgICAgICAgICAgcCA9IChlZmZlY3RfcGFyYW1fdCAqKXBSZXBseURhdGE7Ci0KLSAgICAgICAgICAgICAgICBpbnQgdm9mZnNldCA9ICgocC0+cHNpemUgLSAxKSAvIHNpemVvZihpbnQzMl90KSArIDEpICogc2l6ZW9mKGludDMyX3QpOwotCi0gICAgICAgICAgICAgICAgcC0+c3RhdHVzID0gYW5kcm9pZDo6QmFzc0Jvb3N0X2dldFBhcmFtZXRlcihwQ29udGV4dCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHAtPmRhdGEsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoc2l6ZV90ICAqKSZwLT52c2l6ZSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHAtPmRhdGEgKyB2b2Zmc2V0KTsKLQotICAgICAgICAgICAgICAgICpyZXBseVNpemUgPSBzaXplb2YoZWZmZWN0X3BhcmFtX3QpICsgdm9mZnNldCArIHAtPnZzaXplOwotCi0gICAgICAgICAgICAgICAgLy9BTE9HVigiXHRCYXNzQm9vc3RfY29tbWFuZCBFRkZFQ1RfQ01EX0dFVF9QQVJBTSAiCi0gICAgICAgICAgICAgICAgLy8gICAgICAgICIqcENtZERhdGEgJWQsICpyZXBseVNpemUgJWQsICpwUmVwbHlEYXRhICVkICIsCi0gICAgICAgICAgICAgICAgLy8gICAgICAgICooaW50MzJfdCAqKSgoY2hhciAqKXBDbWREYXRhICsgc2l6ZW9mKGVmZmVjdF9wYXJhbV90KSksCi0gICAgICAgICAgICAgICAgLy8gICAgICAgICpyZXBseVNpemUsCi0gICAgICAgICAgICAgICAgLy8gICAgICAgICooaW50MTZfdCAqKSgoY2hhciAqKXBSZXBseURhdGEgKyBzaXplb2YoZWZmZWN0X3BhcmFtX3QpICsgdm9mZnNldCkpOwotICAgICAgICAgICAgfQotCi0gICAgICAgICAgICBpZihwQ29udGV4dC0+RWZmZWN0VHlwZSA9PSBMVk1fVklSVFVBTElaRVIpewotICAgICAgICAgICAgICAgIGlmIChwQ21kRGF0YSA9PSBOVUxMIHx8Ci0gICAgICAgICAgICAgICAgICAgICAgICBjbWRTaXplIDwgKGludCkoc2l6ZW9mKGVmZmVjdF9wYXJhbV90KSArIHNpemVvZihpbnQzMl90KSkgfHwKLSAgICAgICAgICAgICAgICAgICAgICAgIHBSZXBseURhdGEgPT0gTlVMTCB8fAotICAgICAgICAgICAgICAgICAgICAgICAgKnJlcGx5U2l6ZSA8IChpbnQpIChzaXplb2YoZWZmZWN0X3BhcmFtX3QpICsgc2l6ZW9mKGludDMyX3QpKSl7Ci0gICAgICAgICAgICAgICAgICAgIEFMT0dWKCJcdExWTV9FUlJPUiA6IFZpcnR1YWxpemVyX2NvbW1hbmQgY21kQ29kZSBDYXNlOiAiCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgIkVGRkVDVF9DTURfR0VUX1BBUkFNOiBFUlJPUiIpOwotICAgICAgICAgICAgICAgICAgICByZXR1cm4gLUVJTlZBTDsKLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgZWZmZWN0X3BhcmFtX3QgKnAgPSAoZWZmZWN0X3BhcmFtX3QgKilwQ21kRGF0YTsKLQotICAgICAgICAgICAgICAgIG1lbWNweShwUmVwbHlEYXRhLCBwQ21kRGF0YSwgc2l6ZW9mKGVmZmVjdF9wYXJhbV90KSArIHAtPnBzaXplKTsKLQotICAgICAgICAgICAgICAgIHAgPSAoZWZmZWN0X3BhcmFtX3QgKilwUmVwbHlEYXRhOwotCi0gICAgICAgICAgICAgICAgaW50IHZvZmZzZXQgPSAoKHAtPnBzaXplIC0gMSkgLyBzaXplb2YoaW50MzJfdCkgKyAxKSAqIHNpemVvZihpbnQzMl90KTsKLQotICAgICAgICAgICAgICAgIHAtPnN0YXR1cyA9IGFuZHJvaWQ6OlZpcnR1YWxpemVyX2dldFBhcmFtZXRlcihwQ29udGV4dCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAodm9pZCAqKXAtPmRhdGEsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKHNpemVfdCAgKikmcC0+dnNpemUsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHAtPmRhdGEgKyB2b2Zmc2V0KTsKLQotICAgICAgICAgICAgICAgICpyZXBseVNpemUgPSBzaXplb2YoZWZmZWN0X3BhcmFtX3QpICsgdm9mZnNldCArIHAtPnZzaXplOwotCi0gICAgICAgICAgICAgICAgLy9BTE9HVigiXHRWaXJ0dWFsaXplcl9jb21tYW5kIEVGRkVDVF9DTURfR0VUX1BBUkFNICIKLSAgICAgICAgICAgICAgICAvLyAgICAgICAgIipwQ21kRGF0YSAlZCwgKnJlcGx5U2l6ZSAlZCwgKnBSZXBseURhdGEgJWQgIiwKLSAgICAgICAgICAgICAgICAvLyAgICAgICAgKihpbnQzMl90ICopKChjaGFyICopcENtZERhdGEgKyBzaXplb2YoZWZmZWN0X3BhcmFtX3QpKSwKLSAgICAgICAgICAgICAgICAvLyAgICAgICAgKnJlcGx5U2l6ZSwKLSAgICAgICAgICAgICAgICAvLyAgICAgICAgKihpbnQxNl90ICopKChjaGFyICopcFJlcGx5RGF0YSArIHNpemVvZihlZmZlY3RfcGFyYW1fdCkgKyB2b2Zmc2V0KSk7Ci0gICAgICAgICAgICB9Ci0gICAgICAgICAgICBpZihwQ29udGV4dC0+RWZmZWN0VHlwZSA9PSBMVk1fRVFVQUxJWkVSKXsKLSAgICAgICAgICAgICAgICAvL0FMT0dWKCJcdEVxdWFsaXplcl9jb21tYW5kIGNtZENvZGUgQ2FzZTogIgotICAgICAgICAgICAgICAgIC8vICAgICAgICAiRUZGRUNUX0NNRF9HRVRfUEFSQU0gc3RhcnQiKTsKLSAgICAgICAgICAgICAgICBpZiAocENtZERhdGEgPT0gTlVMTCB8fAotICAgICAgICAgICAgICAgICAgICBjbWRTaXplIDwgKGludCkoc2l6ZW9mKGVmZmVjdF9wYXJhbV90KSArIHNpemVvZihpbnQzMl90KSkgfHwKLSAgICAgICAgICAgICAgICAgICAgcFJlcGx5RGF0YSA9PSBOVUxMIHx8Ci0gICAgICAgICAgICAgICAgICAgICpyZXBseVNpemUgPCAoaW50KSAoc2l6ZW9mKGVmZmVjdF9wYXJhbV90KSArIHNpemVvZihpbnQzMl90KSkpIHsKLSAgICAgICAgICAgICAgICAgICAgQUxPR1YoIlx0TFZNX0VSUk9SIDogRXF1YWxpemVyX2NvbW1hbmQgY21kQ29kZSBDYXNlOiAiCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgIkVGRkVDVF9DTURfR0VUX1BBUkFNIik7Ci0gICAgICAgICAgICAgICAgICAgIHJldHVybiAtRUlOVkFMOwotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICBlZmZlY3RfcGFyYW1fdCAqcCA9IChlZmZlY3RfcGFyYW1fdCAqKXBDbWREYXRhOwotCi0gICAgICAgICAgICAgICAgbWVtY3B5KHBSZXBseURhdGEsIHBDbWREYXRhLCBzaXplb2YoZWZmZWN0X3BhcmFtX3QpICsgcC0+cHNpemUpOwotCi0gICAgICAgICAgICAgICAgcCA9IChlZmZlY3RfcGFyYW1fdCAqKXBSZXBseURhdGE7Ci0KLSAgICAgICAgICAgICAgICBpbnQgdm9mZnNldCA9ICgocC0+cHNpemUgLSAxKSAvIHNpemVvZihpbnQzMl90KSArIDEpICogc2l6ZW9mKGludDMyX3QpOwotCi0gICAgICAgICAgICAgICAgcC0+c3RhdHVzID0gYW5kcm9pZDo6RXF1YWxpemVyX2dldFBhcmFtZXRlcihwQ29udGV4dCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHAtPmRhdGEsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmcC0+dnNpemUsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwLT5kYXRhICsgdm9mZnNldCk7Ci0KLSAgICAgICAgICAgICAgICAqcmVwbHlTaXplID0gc2l6ZW9mKGVmZmVjdF9wYXJhbV90KSArIHZvZmZzZXQgKyBwLT52c2l6ZTsKLQotICAgICAgICAgICAgICAgIC8vQUxPR1YoIlx0RXF1YWxpemVyX2NvbW1hbmQgRUZGRUNUX0NNRF9HRVRfUEFSQU0gKnBDbWREYXRhICVkLCAqcmVwbHlTaXplICVkLCAiCi0gICAgICAgICAgICAgICAgLy8gICAgICAgIipwUmVwbHlEYXRhICUwOHggJTA4eCIsCi0gICAgICAgICAgICAgICAgLy8gICAgICAgICooaW50MzJfdCAqKSgoY2hhciAqKXBDbWREYXRhICsgc2l6ZW9mKGVmZmVjdF9wYXJhbV90KSksICpyZXBseVNpemUsCi0gICAgICAgICAgICAgICAgLy8gICAgICAgICooaW50MzJfdCAqKSgoY2hhciAqKXBSZXBseURhdGEgKyBzaXplb2YoZWZmZWN0X3BhcmFtX3QpICsgdm9mZnNldCksCi0gICAgICAgICAgICAgICAgLy8gICAgICAgICooaW50MzJfdCAqKSgoY2hhciAqKXBSZXBseURhdGEgKyBzaXplb2YoZWZmZWN0X3BhcmFtX3QpICsgdm9mZnNldCArCi0gICAgICAgICAgICAgICAgLy8gICAgICAgIHNpemVvZihpbnQzMl90KSkpOwotICAgICAgICAgICAgfQotICAgICAgICAgICAgaWYocENvbnRleHQtPkVmZmVjdFR5cGUgPT0gTFZNX1ZPTFVNRSl7Ci0gICAgICAgICAgICAgICAgLy9BTE9HVigiXHRWb2x1bWVfY29tbWFuZCBjbWRDb2RlIENhc2U6IEVGRkVDVF9DTURfR0VUX1BBUkFNIHN0YXJ0Iik7Ci0gICAgICAgICAgICAgICAgaWYgKHBDbWREYXRhID09IE5VTEwgfHwKLSAgICAgICAgICAgICAgICAgICAgICAgIGNtZFNpemUgPCAoaW50KShzaXplb2YoZWZmZWN0X3BhcmFtX3QpICsgc2l6ZW9mKGludDMyX3QpKSB8fAotICAgICAgICAgICAgICAgICAgICAgICAgcFJlcGx5RGF0YSA9PSBOVUxMIHx8Ci0gICAgICAgICAgICAgICAgICAgICAgICAqcmVwbHlTaXplIDwgKGludCkgKHNpemVvZihlZmZlY3RfcGFyYW1fdCkgKyBzaXplb2YoaW50MzJfdCkpKXsKLSAgICAgICAgICAgICAgICAgICAgQUxPR1YoIlx0TFZNX0VSUk9SIDogVm9sdW1lX2NvbW1hbmQgY21kQ29kZSBDYXNlOiAiCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgIkVGRkVDVF9DTURfR0VUX1BBUkFNOiBFUlJPUiIpOwotICAgICAgICAgICAgICAgICAgICByZXR1cm4gLUVJTlZBTDsKLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgZWZmZWN0X3BhcmFtX3QgKnAgPSAoZWZmZWN0X3BhcmFtX3QgKilwQ21kRGF0YTsKLQotICAgICAgICAgICAgICAgIG1lbWNweShwUmVwbHlEYXRhLCBwQ21kRGF0YSwgc2l6ZW9mKGVmZmVjdF9wYXJhbV90KSArIHAtPnBzaXplKTsKLQotICAgICAgICAgICAgICAgIHAgPSAoZWZmZWN0X3BhcmFtX3QgKilwUmVwbHlEYXRhOwotCi0gICAgICAgICAgICAgICAgaW50IHZvZmZzZXQgPSAoKHAtPnBzaXplIC0gMSkgLyBzaXplb2YoaW50MzJfdCkgKyAxKSAqIHNpemVvZihpbnQzMl90KTsKLQotICAgICAgICAgICAgICAgIHAtPnN0YXR1cyA9IGFuZHJvaWQ6OlZvbHVtZV9nZXRQYXJhbWV0ZXIocENvbnRleHQsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAodm9pZCAqKXAtPmRhdGEsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoc2l6ZV90ICAqKSZwLT52c2l6ZSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHAtPmRhdGEgKyB2b2Zmc2V0KTsKLQotICAgICAgICAgICAgICAgICpyZXBseVNpemUgPSBzaXplb2YoZWZmZWN0X3BhcmFtX3QpICsgdm9mZnNldCArIHAtPnZzaXplOwotCi0gICAgICAgICAgICAgICAgLy9BTE9HVigiXHRWb2x1bWVfY29tbWFuZCBFRkZFQ1RfQ01EX0dFVF9QQVJBTSAiCi0gICAgICAgICAgICAgICAgLy8gICAgICAgICIqcENtZERhdGEgJWQsICpyZXBseVNpemUgJWQsICpwUmVwbHlEYXRhICVkICIsCi0gICAgICAgICAgICAgICAgLy8gICAgICAgICooaW50MzJfdCAqKSgoY2hhciAqKXBDbWREYXRhICsgc2l6ZW9mKGVmZmVjdF9wYXJhbV90KSksCi0gICAgICAgICAgICAgICAgLy8gICAgICAgICpyZXBseVNpemUsCi0gICAgICAgICAgICAgICAgLy8gICAgICAgICooaW50MTZfdCAqKSgoY2hhciAqKXBSZXBseURhdGEgKyBzaXplb2YoZWZmZWN0X3BhcmFtX3QpICsgdm9mZnNldCkpOwotICAgICAgICAgICAgfQotICAgICAgICAgICAgLy9BTE9HVigiXHRFZmZlY3RfY29tbWFuZCBjbWRDb2RlIENhc2U6IEVGRkVDVF9DTURfR0VUX1BBUkFNIGVuZCIpOwotICAgICAgICB9IGJyZWFrOwotICAgICAgICBjYXNlIEVGRkVDVF9DTURfU0VUX1BBUkFNOnsKLSAgICAgICAgICAgIC8vQUxPR1YoIlx0RWZmZWN0X2NvbW1hbmQgY21kQ29kZSBDYXNlOiBFRkZFQ1RfQ01EX1NFVF9QQVJBTSBzdGFydCIpOwotICAgICAgICAgICAgaWYocENvbnRleHQtPkVmZmVjdFR5cGUgPT0gTFZNX0JBU1NfQk9PU1QpewotICAgICAgICAgICAgICAgIC8vQUxPR1YoIlx0QmFzc0Jvb3N0X2NvbW1hbmQgRUZGRUNUX0NNRF9TRVRfUEFSQU0gcGFyYW0gJWQsICpyZXBseVNpemUgJWQsIHZhbHVlICVkIiwKLSAgICAgICAgICAgICAgICAvLyAgICAgICAqKGludDMyX3QgKikoKGNoYXIgKilwQ21kRGF0YSArIHNpemVvZihlZmZlY3RfcGFyYW1fdCkpLAotICAgICAgICAgICAgICAgIC8vICAgICAgICpyZXBseVNpemUsCi0gICAgICAgICAgICAgICAgLy8gICAgICAgKihpbnQxNl90ICopKChjaGFyICopcENtZERhdGEgKyBzaXplb2YoZWZmZWN0X3BhcmFtX3QpICsgc2l6ZW9mKGludDMyX3QpKSk7Ci0KLSAgICAgICAgICAgICAgICBpZiAocENtZERhdGEgICA9PSBOVUxMfHwKLSAgICAgICAgICAgICAgICAgICAgY21kU2l6ZSAgICAhPSAoaW50KShzaXplb2YoZWZmZWN0X3BhcmFtX3QpICsgc2l6ZW9mKGludDMyX3QpICtzaXplb2YoaW50MTZfdCkpfHwKLSAgICAgICAgICAgICAgICAgICAgcFJlcGx5RGF0YSA9PSBOVUxMfHwKLSAgICAgICAgICAgICAgICAgICAgKnJlcGx5U2l6ZSAhPSBzaXplb2YoaW50MzJfdCkpewotICAgICAgICAgICAgICAgICAgICBBTE9HVigiXHRMVk1fRVJST1IgOiBCYXNzQm9vc3RfY29tbWFuZCBjbWRDb2RlIENhc2U6ICIKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAiRUZGRUNUX0NNRF9TRVRfUEFSQU06IEVSUk9SIik7Ci0gICAgICAgICAgICAgICAgICAgIHJldHVybiAtRUlOVkFMOwotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICBlZmZlY3RfcGFyYW1fdCAqcCA9IChlZmZlY3RfcGFyYW1fdCAqKSBwQ21kRGF0YTsKLQotICAgICAgICAgICAgICAgIGlmIChwLT5wc2l6ZSAhPSBzaXplb2YoaW50MzJfdCkpewotICAgICAgICAgICAgICAgICAgICBBTE9HVigiXHRMVk1fRVJST1IgOiBCYXNzQm9vc3RfY29tbWFuZCBjbWRDb2RlIENhc2U6ICIKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAiRUZGRUNUX0NNRF9TRVRfUEFSQU06IEVSUk9SLCBwc2l6ZSBpcyBub3Qgc2l6ZW9mKGludDMyX3QpIik7Ci0gICAgICAgICAgICAgICAgICAgIHJldHVybiAtRUlOVkFMOwotICAgICAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgICAgIC8vQUxPR1YoIlx0bkJhc3NCb29zdF9jb21tYW5kIGNtZFNpemUgaXMgJWRcbiIKLSAgICAgICAgICAgICAgICAvLyAgICAgICAgIlx0c2l6ZW9mKGVmZmVjdF9wYXJhbV90KSBpcyAgJWRcbiIKLSAgICAgICAgICAgICAgICAvLyAgICAgICAgIlx0cC0+cHNpemUgaXMgJWRcbiIKLSAgICAgICAgICAgICAgICAvLyAgICAgICAgIlx0cC0+dnNpemUgaXMgJWQiCi0gICAgICAgICAgICAgICAgLy8gICAgICAgICJcbiIsCi0gICAgICAgICAgICAgICAgLy8gICAgICAgIGNtZFNpemUsIHNpemVvZihlZmZlY3RfcGFyYW1fdCksIHAtPnBzaXplLCBwLT52c2l6ZSApOwotCi0gICAgICAgICAgICAgICAgKihpbnQgKilwUmVwbHlEYXRhID0gYW5kcm9pZDo6QmFzc0Jvb3N0X3NldFBhcmFtZXRlcihwQ29udGV4dCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKHZvaWQgKilwLT5kYXRhLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwLT5kYXRhICsgcC0+cHNpemUpOwotICAgICAgICAgICAgfQotICAgICAgICAgICAgaWYocENvbnRleHQtPkVmZmVjdFR5cGUgPT0gTFZNX1ZJUlRVQUxJWkVSKXsKLSAgICAgICAgICAgICAgLy9BTE9HVigiXHRWaXJ0dWFsaXplcl9jb21tYW5kIEVGRkVDVF9DTURfU0VUX1BBUkFNIHBhcmFtICVkLCAqcmVwbHlTaXplICVkLCB2YWx1ZSAlZCIsCi0gICAgICAgICAgICAgIC8vICAgICAgICAqKGludDMyX3QgKikoKGNoYXIgKilwQ21kRGF0YSArIHNpemVvZihlZmZlY3RfcGFyYW1fdCkpLAotICAgICAgICAgICAgICAvLyAgICAgICAgKnJlcGx5U2l6ZSwKLSAgICAgICAgICAgICAgLy8gICAgICAgICooaW50MTZfdCAqKSgoY2hhciAqKXBDbWREYXRhICsgc2l6ZW9mKGVmZmVjdF9wYXJhbV90KSArIHNpemVvZihpbnQzMl90KSkpOwotCi0gICAgICAgICAgICAgICAgaWYgKHBDbWREYXRhICAgPT0gTlVMTHx8Ci0gICAgICAgICAgICAgICAgICAgIGNtZFNpemUgICAgIT0gKGludCkoc2l6ZW9mKGVmZmVjdF9wYXJhbV90KSArIHNpemVvZihpbnQzMl90KSArc2l6ZW9mKGludDE2X3QpKXx8Ci0gICAgICAgICAgICAgICAgICAgIHBSZXBseURhdGEgPT0gTlVMTHx8Ci0gICAgICAgICAgICAgICAgICAgICpyZXBseVNpemUgIT0gc2l6ZW9mKGludDMyX3QpKXsKLSAgICAgICAgICAgICAgICAgICAgQUxPR1YoIlx0TFZNX0VSUk9SIDogVmlydHVhbGl6ZXJfY29tbWFuZCBjbWRDb2RlIENhc2U6ICIKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAiRUZGRUNUX0NNRF9TRVRfUEFSQU06IEVSUk9SIik7Ci0gICAgICAgICAgICAgICAgICAgIHJldHVybiAtRUlOVkFMOwotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICBlZmZlY3RfcGFyYW1fdCAqcCA9IChlZmZlY3RfcGFyYW1fdCAqKSBwQ21kRGF0YTsKLQotICAgICAgICAgICAgICAgIGlmIChwLT5wc2l6ZSAhPSBzaXplb2YoaW50MzJfdCkpewotICAgICAgICAgICAgICAgICAgICBBTE9HVigiXHRMVk1fRVJST1IgOiBWaXJ0dWFsaXplcl9jb21tYW5kIGNtZENvZGUgQ2FzZTogIgotICAgICAgICAgICAgICAgICAgICAgICAgICAgICJFRkZFQ1RfQ01EX1NFVF9QQVJBTTogRVJST1IsIHBzaXplIGlzIG5vdCBzaXplb2YoaW50MzJfdCkiKTsKLSAgICAgICAgICAgICAgICAgICAgcmV0dXJuIC1FSU5WQUw7Ci0gICAgICAgICAgICAgICAgfQotCi0gICAgICAgICAgICAgICAgLy9BTE9HVigiXHRuVmlydHVhbGl6ZXJfY29tbWFuZCBjbWRTaXplIGlzICVkXG4iCi0gICAgICAgICAgICAgICAgLy8gICAgICAgICJcdHNpemVvZihlZmZlY3RfcGFyYW1fdCkgaXMgICVkXG4iCi0gICAgICAgICAgICAgICAgLy8gICAgICAgICJcdHAtPnBzaXplIGlzICVkXG4iCi0gICAgICAgICAgICAgICAgLy8gICAgICAgICJcdHAtPnZzaXplIGlzICVkIgotICAgICAgICAgICAgICAgIC8vICAgICAgICAiXG4iLAotICAgICAgICAgICAgICAgIC8vICAgICAgICBjbWRTaXplLCBzaXplb2YoZWZmZWN0X3BhcmFtX3QpLCBwLT5wc2l6ZSwgcC0+dnNpemUgKTsKLQotICAgICAgICAgICAgICAgICooaW50ICopcFJlcGx5RGF0YSA9IGFuZHJvaWQ6OlZpcnR1YWxpemVyX3NldFBhcmFtZXRlcihwQ29udGV4dCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAodm9pZCAqKXAtPmRhdGEsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHAtPmRhdGEgKyBwLT5wc2l6ZSk7Ci0gICAgICAgICAgICB9Ci0gICAgICAgICAgICBpZihwQ29udGV4dC0+RWZmZWN0VHlwZSA9PSBMVk1fRVFVQUxJWkVSKXsKLSAgICAgICAgICAgICAgIC8vQUxPR1YoIlx0RXF1YWxpemVyX2NvbW1hbmQgY21kQ29kZSBDYXNlOiAiCi0gICAgICAgICAgICAgICAvLyAgICAgICAgIkVGRkVDVF9DTURfU0VUX1BBUkFNIHN0YXJ0Iik7Ci0gICAgICAgICAgICAgICAvL0FMT0dWKCJcdEVxdWFsaXplcl9jb21tYW5kIEVGRkVDVF9DTURfU0VUX1BBUkFNIHBhcmFtICVkLCAqcmVwbHlTaXplICVkLCB2YWx1ZSAlZCAiLAotICAgICAgICAgICAgICAgLy8gICAgICAgICooaW50MzJfdCAqKSgoY2hhciAqKXBDbWREYXRhICsgc2l6ZW9mKGVmZmVjdF9wYXJhbV90KSksCi0gICAgICAgICAgICAgICAvLyAgICAgICAgKnJlcGx5U2l6ZSwKLSAgICAgICAgICAgICAgIC8vICAgICAgICAqKGludDE2X3QgKikoKGNoYXIgKilwQ21kRGF0YSArIHNpemVvZihlZmZlY3RfcGFyYW1fdCkgKyBzaXplb2YoaW50MzJfdCkpKTsKLQotICAgICAgICAgICAgICAgIGlmIChwQ21kRGF0YSA9PSBOVUxMIHx8IGNtZFNpemUgPCAoaW50KShzaXplb2YoZWZmZWN0X3BhcmFtX3QpICsgc2l6ZW9mKGludDMyX3QpKSB8fAotICAgICAgICAgICAgICAgICAgICBwUmVwbHlEYXRhID09IE5VTEwgfHwgKnJlcGx5U2l6ZSAhPSBzaXplb2YoaW50MzJfdCkpIHsKLSAgICAgICAgICAgICAgICAgICAgQUxPR1YoIlx0TFZNX0VSUk9SIDogRXF1YWxpemVyX2NvbW1hbmQgY21kQ29kZSBDYXNlOiAiCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgIkVGRkVDVF9DTURfU0VUX1BBUkFNOiBFUlJPUiIpOwotICAgICAgICAgICAgICAgICAgICByZXR1cm4gLUVJTlZBTDsKLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgZWZmZWN0X3BhcmFtX3QgKnAgPSAoZWZmZWN0X3BhcmFtX3QgKikgcENtZERhdGE7Ci0KLSAgICAgICAgICAgICAgICAqKGludCAqKXBSZXBseURhdGEgPSBhbmRyb2lkOjpFcXVhbGl6ZXJfc2V0UGFyYW1ldGVyKHBDb250ZXh0LAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAodm9pZCAqKXAtPmRhdGEsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwLT5kYXRhICsgcC0+cHNpemUpOwotICAgICAgICAgICAgfQotICAgICAgICAgICAgaWYocENvbnRleHQtPkVmZmVjdFR5cGUgPT0gTFZNX1ZPTFVNRSl7Ci0gICAgICAgICAgICAgICAgLy9BTE9HVigiXHRWb2x1bWVfY29tbWFuZCBjbWRDb2RlIENhc2U6IEVGRkVDVF9DTURfU0VUX1BBUkFNIHN0YXJ0Iik7Ci0gICAgICAgICAgICAgICAgLy9BTE9HVigiXHRWb2x1bWVfY29tbWFuZCBFRkZFQ1RfQ01EX1NFVF9QQVJBTSBwYXJhbSAlZCwgKnJlcGx5U2l6ZSAlZCwgdmFsdWUgJWQgIiwKLSAgICAgICAgICAgICAgICAvLyAgICAgICAgKihpbnQzMl90ICopKChjaGFyICopcENtZERhdGEgKyBzaXplb2YoZWZmZWN0X3BhcmFtX3QpKSwKLSAgICAgICAgICAgICAgICAvLyAgICAgICAgKnJlcGx5U2l6ZSwKLSAgICAgICAgICAgICAgICAvLyAgICAgICAgKihpbnQxNl90ICopKChjaGFyICopcENtZERhdGEgKyBzaXplb2YoZWZmZWN0X3BhcmFtX3QpICtzaXplb2YoaW50MzJfdCkpKTsKLQotICAgICAgICAgICAgICAgIGlmICggICAgcENtZERhdGEgICA9PSBOVUxMfHwKLSAgICAgICAgICAgICAgICAgICAgICAgIGNtZFNpemUgICAgPCAoaW50KShzaXplb2YoZWZmZWN0X3BhcmFtX3QpICsgc2l6ZW9mKGludDMyX3QpKXx8Ci0gICAgICAgICAgICAgICAgICAgICAgICBwUmVwbHlEYXRhID09IE5VTEx8fAotICAgICAgICAgICAgICAgICAgICAgICAgKnJlcGx5U2l6ZSAhPSBzaXplb2YoaW50MzJfdCkpewotICAgICAgICAgICAgICAgICAgICBBTE9HVigiXHRMVk1fRVJST1IgOiBWb2x1bWVfY29tbWFuZCBjbWRDb2RlIENhc2U6ICIKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAiRUZGRUNUX0NNRF9TRVRfUEFSQU06IEVSUk9SIik7Ci0gICAgICAgICAgICAgICAgICAgIHJldHVybiAtRUlOVkFMOwotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICBlZmZlY3RfcGFyYW1fdCAqcCA9IChlZmZlY3RfcGFyYW1fdCAqKSBwQ21kRGF0YTsKLQotICAgICAgICAgICAgICAgICooaW50ICopcFJlcGx5RGF0YSA9IGFuZHJvaWQ6OlZvbHVtZV9zZXRQYXJhbWV0ZXIocENvbnRleHQsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICh2b2lkICopcC0+ZGF0YSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcC0+ZGF0YSArIHAtPnBzaXplKTsKLSAgICAgICAgICAgIH0KLSAgICAgICAgICAgIC8vQUxPR1YoIlx0RWZmZWN0X2NvbW1hbmQgY21kQ29kZSBDYXNlOiBFRkZFQ1RfQ01EX1NFVF9QQVJBTSBlbmQiKTsKLSAgICAgICAgfSBicmVhazsKLQotICAgICAgICBjYXNlIEVGRkVDVF9DTURfRU5BQkxFOgotICAgICAgICAgICAgQUxPR1YoIlx0RWZmZWN0X2NvbW1hbmQgY21kQ29kZSBDYXNlOiBFRkZFQ1RfQ01EX0VOQUJMRSBzdGFydCIpOwotICAgICAgICAgICAgaWYgKHBSZXBseURhdGEgPT0gTlVMTCB8fCAqcmVwbHlTaXplICE9IHNpemVvZihpbnQpKXsKLSAgICAgICAgICAgICAgICBBTE9HVigiXHRMVk1fRVJST1IgOiBFZmZlY3RfY29tbWFuZCBjbWRDb2RlIENhc2U6IEVGRkVDVF9DTURfRU5BQkxFOiBFUlJPUiIpOwotICAgICAgICAgICAgICAgIHJldHVybiAtRUlOVkFMOwotICAgICAgICAgICAgfQotCi0gICAgICAgICAgICAqKGludCAqKXBSZXBseURhdGEgPSBhbmRyb2lkOjpFZmZlY3Rfc2V0RW5hYmxlZChwQ29udGV4dCwgTFZNX1RSVUUpOwotICAgICAgICAgICAgYnJlYWs7Ci0KLSAgICAgICAgY2FzZSBFRkZFQ1RfQ01EX0RJU0FCTEU6Ci0gICAgICAgICAgICAvL0FMT0dWKCJcdEVmZmVjdF9jb21tYW5kIGNtZENvZGUgQ2FzZTogRUZGRUNUX0NNRF9ESVNBQkxFIHN0YXJ0Iik7Ci0gICAgICAgICAgICBpZiAocFJlcGx5RGF0YSA9PSBOVUxMIHx8ICpyZXBseVNpemUgIT0gc2l6ZW9mKGludCkpewotICAgICAgICAgICAgICAgIEFMT0dWKCJcdExWTV9FUlJPUiA6IEVmZmVjdF9jb21tYW5kIGNtZENvZGUgQ2FzZTogRUZGRUNUX0NNRF9ESVNBQkxFOiBFUlJPUiIpOwotICAgICAgICAgICAgICAgIHJldHVybiAtRUlOVkFMOwotICAgICAgICAgICAgfQotICAgICAgICAgICAgKihpbnQgKilwUmVwbHlEYXRhID0gYW5kcm9pZDo6RWZmZWN0X3NldEVuYWJsZWQocENvbnRleHQsIExWTV9GQUxTRSk7Ci0gICAgICAgICAgICBicmVhazsKLQotICAgICAgICBjYXNlIEVGRkVDVF9DTURfU0VUX0RFVklDRToKLSAgICAgICAgewotICAgICAgICAgICAgQUxPR1YoIlx0RWZmZWN0X2NvbW1hbmQgY21kQ29kZSBDYXNlOiBFRkZFQ1RfQ01EX1NFVF9ERVZJQ0Ugc3RhcnQiKTsKLSAgICAgICAgICAgIHVpbnQzMl90IGRldmljZSA9ICoodWludDMyX3QgKilwQ21kRGF0YTsKLQotICAgICAgICAgICAgaWYgKHBDb250ZXh0LT5FZmZlY3RUeXBlID09IExWTV9CQVNTX0JPT1NUKSB7Ci0gICAgICAgICAgICAgICAgaWYoKGRldmljZSA9PSBBVURJT19ERVZJQ0VfT1VUX1NQRUFLRVIpIHx8Ci0gICAgICAgICAgICAgICAgICAgICAgICAoZGV2aWNlID09IEFVRElPX0RFVklDRV9PVVRfQkxVRVRPT1RIX1NDT19DQVJLSVQpIHx8Ci0gICAgICAgICAgICAgICAgICAgICAgICAoZGV2aWNlID09IEFVRElPX0RFVklDRV9PVVRfQkxVRVRPT1RIX0EyRFBfU1BFQUtFUikpewotICAgICAgICAgICAgICAgICAgICBBTE9HVigiXHRFRkZFQ1RfQ01EX1NFVF9ERVZJQ0UgZGV2aWNlIGlzIGludmFsaWQgZm9yIExWTV9CQVNTX0JPT1NUICVkIiwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgKihpbnQzMl90ICopcENtZERhdGEpOwotICAgICAgICAgICAgICAgICAgICBBTE9HVigiXHRFRkZFQ1RfQ01EX1NFVF9ERVZJQ0UgdGVtcG9yYXJ5IGRpc2FibGUgTFZNX0JBU19CT09TVCIpOwotCi0gICAgICAgICAgICAgICAgICAgIC8vIElmIGEgZGV2aWNlIGRvZXNudCBzdXBwb3J0IGJhc3Nib29zdCB0aGUgZWZmZWN0IG11c3QgYmUgdGVtcG9yYXJpbHkgZGlzYWJsZWQKLSAgICAgICAgICAgICAgICAgICAgLy8gdGhlIGVmZmVjdCBtdXN0IHN0aWxsIHJlcG9ydCBpdHMgb3JpZ2luYWwgc3RhdGUgYXMgdGhpcyBjYW4gb25seSBiZSBjaGFuZ2VkCi0gICAgICAgICAgICAgICAgICAgIC8vIGJ5IHRoZSBFTkFCTEUvRElTQUJMRSBjb21tYW5kCi0KLSAgICAgICAgICAgICAgICAgICAgaWYgKHBDb250ZXh0LT5wQnVuZGxlZENvbnRleHQtPmJCYXNzRW5hYmxlZCA9PSBMVk1fVFJVRSkgewotICAgICAgICAgICAgICAgICAgICAgICAgQUxPR1YoIlx0RUZGRUNUX0NNRF9TRVRfREVWSUNFIGRpc2FibGUgTFZNX0JBU1NfQk9PU1QgJWQiLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqKGludDMyX3QgKilwQ21kRGF0YSk7Ci0gICAgICAgICAgICAgICAgICAgICAgICBhbmRyb2lkOjpMdm1FZmZlY3RfZGlzYWJsZShwQ29udGV4dCk7Ci0gICAgICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICAgICAgcENvbnRleHQtPnBCdW5kbGVkQ29udGV4dC0+YkJhc3NUZW1wRGlzYWJsZWQgPSBMVk1fVFJVRTsKLSAgICAgICAgICAgICAgICB9IGVsc2UgewotICAgICAgICAgICAgICAgICAgICBBTE9HVigiXHRFRkZFQ1RfQ01EX1NFVF9ERVZJQ0UgZGV2aWNlIGlzIHZhbGlkIGZvciBMVk1fQkFTU19CT09TVCAlZCIsCi0gICAgICAgICAgICAgICAgICAgICAgICAgKihpbnQzMl90ICopcENtZERhdGEpOwotCi0gICAgICAgICAgICAgICAgICAgIC8vIElmIGEgZGV2aWNlIHN1cHBvcnRzIGJhc3Nib29zdCBhbmQgdGhlIGVmZmVjdCBoYXMgYmVlbiB0ZW1wb3JhcmlseSBkaXNhYmxlZAotICAgICAgICAgICAgICAgICAgICAvLyBwcmV2aW91c2x5IHRoZW4gcmUtZW5hYmxlIGl0Ci0KLSAgICAgICAgICAgICAgICAgICAgaWYgKHBDb250ZXh0LT5wQnVuZGxlZENvbnRleHQtPmJCYXNzRW5hYmxlZCA9PSBMVk1fVFJVRSkgewotICAgICAgICAgICAgICAgICAgICAgICAgQUxPR1YoIlx0RUZGRUNUX0NNRF9TRVRfREVWSUNFIHJlLWVuYWJsZSBMVk1fQkFTU19CT09TVCAlZCIsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICooaW50MzJfdCAqKXBDbWREYXRhKTsKLSAgICAgICAgICAgICAgICAgICAgICAgIGFuZHJvaWQ6Okx2bUVmZmVjdF9lbmFibGUocENvbnRleHQpOwotICAgICAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgICAgIHBDb250ZXh0LT5wQnVuZGxlZENvbnRleHQtPmJCYXNzVGVtcERpc2FibGVkID0gTFZNX0ZBTFNFOwotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgIH0KLSAgICAgICAgICAgIGlmIChwQ29udGV4dC0+RWZmZWN0VHlwZSA9PSBMVk1fVklSVFVBTElaRVIpIHsKLSAgICAgICAgICAgICAgICBpZigoZGV2aWNlID09IEFVRElPX0RFVklDRV9PVVRfU1BFQUtFUil8fAotICAgICAgICAgICAgICAgICAgICAgICAgKGRldmljZSA9PSBBVURJT19ERVZJQ0VfT1VUX0JMVUVUT09USF9TQ09fQ0FSS0lUKXx8Ci0gICAgICAgICAgICAgICAgICAgICAgICAoZGV2aWNlID09IEFVRElPX0RFVklDRV9PVVRfQkxVRVRPT1RIX0EyRFBfU1BFQUtFUikpewotICAgICAgICAgICAgICAgICAgICBBTE9HVigiXHRFRkZFQ1RfQ01EX1NFVF9ERVZJQ0UgZGV2aWNlIGlzIGludmFsaWQgZm9yIExWTV9WSVJUVUFMSVpFUiAlZCIsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICooaW50MzJfdCAqKXBDbWREYXRhKTsKLSAgICAgICAgICAgICAgICAgICAgQUxPR1YoIlx0RUZGRUNUX0NNRF9TRVRfREVWSUNFIHRlbXBvcmFyeSBkaXNhYmxlIExWTV9WSVJUVUFMSVpFUiIpOwotCi0gICAgICAgICAgICAgICAgICAgIC8vSWYgYSBkZXZpY2UgZG9lc250IHN1cHBvcnQgdmlydHVhbGl6ZXIgdGhlIGVmZmVjdCBtdXN0IGJlIHRlbXBvcmFyaWx5IGRpc2FibGVkCi0gICAgICAgICAgICAgICAgICAgIC8vIHRoZSBlZmZlY3QgbXVzdCBzdGlsbCByZXBvcnQgaXRzIG9yaWdpbmFsIHN0YXRlIGFzIHRoaXMgY2FuIG9ubHkgYmUgY2hhbmdlZAotICAgICAgICAgICAgICAgICAgICAvLyBieSB0aGUgRU5BQkxFL0RJU0FCTEUgY29tbWFuZAotCi0gICAgICAgICAgICAgICAgICAgIGlmIChwQ29udGV4dC0+cEJ1bmRsZWRDb250ZXh0LT5iVmlydHVhbGl6ZXJFbmFibGVkID09IExWTV9UUlVFKSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICBBTE9HVigiXHRFRkZFQ1RfQ01EX1NFVF9ERVZJQ0UgZGlzYWJsZSBMVk1fVklSVFVBTElaRVIgJWQiLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKihpbnQzMl90ICopcENtZERhdGEpOwotICAgICAgICAgICAgICAgICAgICAgICAgYW5kcm9pZDo6THZtRWZmZWN0X2Rpc2FibGUocENvbnRleHQpOwotICAgICAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgICAgIHBDb250ZXh0LT5wQnVuZGxlZENvbnRleHQtPmJWaXJ0dWFsaXplclRlbXBEaXNhYmxlZCA9IExWTV9UUlVFOwotICAgICAgICAgICAgICAgIH0gZWxzZSB7Ci0gICAgICAgICAgICAgICAgICAgIEFMT0dWKCJcdEVGRkVDVF9DTURfU0VUX0RFVklDRSBkZXZpY2UgaXMgdmFsaWQgZm9yIExWTV9WSVJUVUFMSVpFUiAlZCIsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICooaW50MzJfdCAqKXBDbWREYXRhKTsKLQotICAgICAgICAgICAgICAgICAgICAvLyBJZiBhIGRldmljZSBzdXBwb3J0cyB2aXJ0dWFsaXplciBhbmQgdGhlIGVmZmVjdCBoYXMgYmVlbiB0ZW1wb3JhcmlseSBkaXNhYmxlZAotICAgICAgICAgICAgICAgICAgICAvLyBwcmV2aW91c2x5IHRoZW4gcmUtZW5hYmxlIGl0Ci0KLSAgICAgICAgICAgICAgICAgICAgaWYocENvbnRleHQtPnBCdW5kbGVkQ29udGV4dC0+YlZpcnR1YWxpemVyRW5hYmxlZCA9PSBMVk1fVFJVRSl7Ci0gICAgICAgICAgICAgICAgICAgICAgICBBTE9HVigiXHRFRkZFQ1RfQ01EX1NFVF9ERVZJQ0UgcmUtZW5hYmxlIExWTV9WSVJUVUFMSVpFUiAlZCIsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqKGludDMyX3QgKilwQ21kRGF0YSk7Ci0gICAgICAgICAgICAgICAgICAgICAgICBhbmRyb2lkOjpMdm1FZmZlY3RfZW5hYmxlKHBDb250ZXh0KTsKLSAgICAgICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgICAgICBwQ29udGV4dC0+cEJ1bmRsZWRDb250ZXh0LT5iVmlydHVhbGl6ZXJUZW1wRGlzYWJsZWQgPSBMVk1fRkFMU0U7Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgfQotICAgICAgICAgICAgQUxPR1YoIlx0RWZmZWN0X2NvbW1hbmQgY21kQ29kZSBDYXNlOiBFRkZFQ1RfQ01EX1NFVF9ERVZJQ0UgZW5kIik7Ci0gICAgICAgICAgICBicmVhazsKLSAgICAgICAgfQotICAgICAgICBjYXNlIEVGRkVDVF9DTURfU0VUX1ZPTFVNRToKLSAgICAgICAgewotICAgICAgICAgICAgdWludDMyX3QgbGVmdFZvbHVtZSwgcmlnaHRWb2x1bWU7Ci0gICAgICAgICAgICBpbnQxNl90ICBsZWZ0ZEIsIHJpZ2h0ZEI7Ci0gICAgICAgICAgICBpbnQxNl90ICBtYXhkQiwgcGFuZEI7Ci0gICAgICAgICAgICBpbnQzMl90ICB2b2xfcmV0WzJdID0gezE8PDI0LDE8PDI0fTsgLy8gQXBwbHkgbm8gdm9sdW1lCi0gICAgICAgICAgICBpbnQgICAgICBzdGF0dXMgPSAwOwotICAgICAgICAgICAgTFZNX0NvbnRyb2xQYXJhbXNfdCAgICAgQWN0aXZlUGFyYW1zOyAgICAgICAgICAgLyogQ3VycmVudCBjb250cm9sIFBhcmFtZXRlcnMgKi8KLSAgICAgICAgICAgIExWTV9SZXR1cm5TdGF0dXNfZW4gICAgIEx2bVN0YXR1cz1MVk1fU1VDQ0VTUzsgIC8qIEZ1bmN0aW9uIGNhbGwgc3RhdHVzICovCi0KLSAgICAgICAgICAgIC8vIGlmIHBSZXBseURhdGEgaXMgTlVMTCwgVk9MX0NUUkwgaXMgZGVsZWdhdGVkIHRvIGFub3RoZXIgZWZmZWN0Ci0gICAgICAgICAgICBpZihwUmVwbHlEYXRhID09IExWTV9OVUxMKXsKLSAgICAgICAgICAgICAgICBicmVhazsKLSAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgaWYgKHBDbWREYXRhID09IE5VTEwgfHwKLSAgICAgICAgICAgICAgICBjbWRTaXplICE9IDIgKiBzaXplb2YodWludDMyX3QpKSB7Ci0gICAgICAgICAgICAgICAgQUxPR1YoIlx0TFZNX0VSUk9SIDogRWZmZWN0X2NvbW1hbmQgY21kQ29kZSBDYXNlOiAiCi0gICAgICAgICAgICAgICAgICAgICAgICAiRUZGRUNUX0NNRF9TRVRfVk9MVU1FOiBFUlJPUiIpOwotICAgICAgICAgICAgICAgIHJldHVybiAtRUlOVkFMOwotICAgICAgICAgICAgfQotCi0gICAgICAgICAgICBsZWZ0Vm9sdW1lICA9ICgoKih1aW50MzJfdCAqKXBDbWREYXRhKSk7Ci0gICAgICAgICAgICByaWdodFZvbHVtZSA9ICgoKigodWludDMyX3QgKilwQ21kRGF0YSArIDEpKSk7Ci0KLSAgICAgICAgICAgIGlmKGxlZnRWb2x1bWUgPT0gMHgxMDAwMDAwKXsKLSAgICAgICAgICAgICAgICBsZWZ0Vm9sdW1lIC09IDE7Ci0gICAgICAgICAgICB9Ci0gICAgICAgICAgICBpZihyaWdodFZvbHVtZSA9PSAweDEwMDAwMDApewotICAgICAgICAgICAgICAgIHJpZ2h0Vm9sdW1lIC09IDE7Ci0gICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgIC8vIENvbnZlcnQgdm9sdW1lIHRvIGRCCi0gICAgICAgICAgICBsZWZ0ZEIgID0gYW5kcm9pZDo6TFZDX0NvbnZlcnRfVm9sVG9EYihsZWZ0Vm9sdW1lKTsKLSAgICAgICAgICAgIHJpZ2h0ZEIgPSBhbmRyb2lkOjpMVkNfQ29udmVydF9Wb2xUb0RiKHJpZ2h0Vm9sdW1lKTsKLQotICAgICAgICAgICAgcGFuZEIgPSByaWdodGRCIC0gbGVmdGRCOwotCi0gICAgICAgICAgICAvLyBDYWxjdWxhdGUgbWF4IHZvbHVtZSBpbiBkQgotICAgICAgICAgICAgbWF4ZEIgPSBsZWZ0ZEI7Ci0gICAgICAgICAgICBpZihyaWdodGRCID4gbWF4ZEIpewotICAgICAgICAgICA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gZWFjaCBlbGVtZW50IGlzIGEgY29uZmlndXJhdGlvbiBmb3IgdGhlCi0gICAgLy8gY29ycmVzcG9uZGluZyBiYW5kLgotICAgIC8vY29uc3QgQmFuZENvbmZpZyAqIGJhbmRDb25maWdzOwotfTsKLQotLyogQnVuZGxlZEVmZmVjdENvbnRleHQgOiBPbmUgcGVyIHNlc3Npb24gKi8KLXN0cnVjdCBCdW5kbGVkRWZmZWN0Q29udGV4dHsKLSAgICBMVk1fSGFuZGxlX3QgICAgICAgICAgICAgICAgICAgIGhJbnN0YW5jZTsgICAgICAgICAgICAgICAgLyogSW5zdGFuY2UgaGFuZGxlICovCi0gICAgaW50ICAgICAgICAgICAgICAgICAgICAgICAgICAgICBTZXNzaW9uTm87ICAgICAgICAgICAgICAgIC8qIEN1cnJlbnQgc2Vzc2lvbiBudW1iZXIgKi8KLSAgICBpbnQgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFNlc3Npb25JZDsgICAgICAgICAgICAgICAgLyogQ3VycmVudCBzZXNzaW9uIGlkICovCi0gICAgYm9vbCAgICAgICAgICAgICAgICAgICAgICAgICAgICBiVm9sdW1lRW5hYmxlZDsgICAgICAgICAgIC8qIEZsYWcgZm9yIFZvbHVtZSAqLwotICAgIGJvb2wgICAgICAgICAgICAgICAgICAgICAgICAgICAgYkVxdWFsaXplckVuYWJsZWQ7ICAgICAgICAvKiBGbGFnIGZvciBFUSAqLwotICAgIGJvb2wgICAgICAgICAgICAgICAgICAgICAgICAgICAgYkJhc3NFbmFibGVkOyAgICAgICAgICAgICAvKiBGbGFnIGZvciBCYXNzICovCi0gICAgYm9vbCAgICAgICAgICAgICAgICAgICAgICAgICAgICBiQmFzc1RlbXBEaXNhYmxlZDsgICAgICAgIC8qIEZsYWcgZm9yIEJhc3MgdG8gYmUgcmUtZW5hYmxlZCAqLwotICAgIGJvb2wgICAgICAgICAgICAgICAgICAgICAgICAgICAgYlZpcnR1YWxpemVyRW5hYmxlZDsgICAgICAvKiBGbGFnIGZvciBWaXJ0dWFsaXplciAqLwotICAgIGJvb2wgICAgICAgICAgICAgICAgICAgICAgICAgICAgYlZpcnR1YWxpemVyVGVtcERpc2FibGVkOyAvKiBGbGFnIGZvciBlZmZlY3QgdG8gYmUgcmUtZW5hYmxlZCAqLwotICAgIGludCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTnVtYmVyRWZmZWN0c0VuYWJsZWQ7ICAgICAvKiBFZmZlY3RzIGluIHRoaXMgc2Vzc2lvbiAqLwotICAgIGludCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTnVtYmVyRWZmZWN0c0NhbGxlZDsgICAgICAvKiBFZmZlY3RzIGNhbGxlZCBzbyBmYXIgKi8KLSAgICBib29sICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZpcnN0Vm9sdW1lOyAgICAgICAgICAgICAgLyogTm8gc21vb3RoaW5nIG9uIGZpcnN0IFZvbCBjaGFuZ2UgKi8KLSAgICAvLyBTYXZlZCBwYXJhbWV0ZXJzIGZvciBlYWNoIGVmZmVjdCAqLwotICAgIC8vIEJhc3MgQm9vc3QKLSAgICBpbnQgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEJhc3NTdHJlbmd0aFNhdmVkOyAgICAgICAgLyogQ29udmVyc2lvbiBiZXR3ZWVuIEdldC9TZXQgKi8KLSAgICAvLyBFcXVhbGl6ZXIKLSAgICBpbnQgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEN1clByZXNldDsgICAgICAgICAgICAgICAgLyogQ3VycmVudCBwcmVzZXQgYmVpbmcgdXNlZCAqLwotICAgIC8vIFZpcnR1YWx6ZXIKLSAgICBpbnQgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFZpcnRTdHJlbmd0aFNhdmVkOyAgICAgICAgLyogQ29udmVyc2lvbiBiZXR3ZWVuIEdldC9TZXQgKi8KLSAgICAvLyBWb2x1bWUKLSAgICBpbnQgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxldmVsU2F2ZWQ7ICAgICAvKiBmb3Igd2hlbiBtdXRlIGlzIHNldCwgbGV2ZWwgbXVzdCBiZSBzYXZlZCAqLwotICAgIGludCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcG9zaXRpb25TYXZlZDsKLSAgICBib29sICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJNdXRlRW5hYmxlZDsgICAvKiBNdXN0IHN0b3JlIGFzIG11dGUgPSAtOTZkQiBsZXZlbCAqLwotICAgIGJvb2wgICAgICAgICAgICAgICAgICAgICAgICAgICAgYlN0ZXJlb1Bvc2l0aW9uRW5hYmxlZDsKLSAgICBMVk1fRnNfZW4gICAgICAgICAgICAgICAgICAgICAgIFNhbXBsZVJhdGU7Ci0gICAgaW50ICAgICAgICAgICAgICAgICAgICAgICAgICAgICBTYW1wbGVzUGVyU2Vjb25kOwotICAgIGludCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgU2FtcGxlc1RvRXhpdENvdW50RXE7Ci0gICAgaW50ICAgICAgICAgICAgICAgICAgICAgICAgICAgICBTYW1wbGVzVG9FeGl0Q291bnRCYjsKLSAgICBpbnQgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFNhbXBsZXNUb0V4aXRDb3VudFZpcnQ7Ci0gICAgTFZNX0lOVDE2ICAgICAgICAgICAgICAgICAgICAgICAqd29ya0J1ZmZlcjsKLSAgICBpbnQgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZyYW1lQ291bnQ7Ci0gICAgI2lmZGVmIExWTV9QQ00KLSAgICBGSUxFICAgICAgICAgICAgICAgICAgICAgICAgICAgICpQY21JblB0cjsKLSAgICBGSUxFICAgICAgICAgICAgICAgICAgICAgICAgICAgICpQY21PdXRQdHI7Ci0gICAgI2VuZGlmCi19OwotCi0vKiBTZXNzaW9uQ29udGV4dCA6IE9uZSBzZXNzaW9uICovCi1zdHJ1Y3QgU2Vzc2lvbkNvbnRleHR7Ci0gICAgYm9vbCAgICAgICAgICAgICAgICAgICAgICAgICAgICBiQnVuZGxlZEVmZmVjdHNFbmFibGVkOwotICAgIGJvb2wgICAgICAgICAgICAgICAgICAgICAgICAgICAgYlZvbHVtZUluc3RhbnRpYXRlZDsKLSAgICBib29sICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJFcXVhbGl6ZXJJbnN0YW50aWF0ZWQ7Ci0gICAgYm9vbCAgICAgICAgICAgICAgICAgICAgICAgICAgICBiQmFzc0luc3RhbnRpYXRlZDsKLSAgICBib29sICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJWaXJ0dWFsaXplckluc3RhbnRpYXRlZDsKLSAgICBCdW5kbGVkRWZmZWN0Q29udGV4dCAgICAgICAgICAgICpwQnVuZGxlZENvbnRleHQ7Ci19OwotCi1zdHJ1Y3QgRWZmZWN0Q29udGV4dHsKLSAgICBjb25zdCBzdHJ1Y3QgZWZmZWN0X2ludGVyZmFjZV9zICppdGZlOwotICAgIGVmZmVjdF9jb25maWdfdCAgICAgICAgICAgICAgICAgY29uZmlnOwotICAgIGx2bV9lZmZlY3RfZW4gICAgICAgICAgICAgICAgICAgRWZmZWN0VHlwZTsKLSAgICBCdW5kbGVkRWZmZWN0Q29udGV4dCAgICAgICAgICAgICpwQnVuZGxlZENvbnRleHQ7Ci19OwotCi0KLS8qIGVudW1lcmF0ZWQgcGFyYW1ldGVyIHNldHRpbmdzIGZvciBWb2x1bWUgZWZmZWN0ICovCi10eXBlZGVmIGVudW0KLXsKLSAgICBWT0xVTUVfUEFSQU1fTEVWRUwsICAgICAgICAgICAgICAgICAgICAgICAvLyB0eXBlIFNMbWlsbGliZWwgPSB0eXBlZGVmIFNMdWludDE2IChzZXQgJiBnZXQpCi0gICAgVk9MVU1FX1BBUkFNX01BWExFVkVMLCAgICAgICAgICAgICAgICAgICAgLy8gdHlwZSBTTG1pbGxpYmVsID0gdHlwZWRlZiBTTHVpbnQxNiAoZ2V0KQotICAgIFZPTFVNRV9QQVJBTV9NVVRFLCAgICAgICAgICAgICAgICAgICAgICAgIC8vIHR5cGUgU0xib29sZWFuICA9IHR5cGVkZWYgU0x1aW50MzIgKHNldCAmIGdldCkKLSAgICBWT0xVTUVfUEFSQU1fRU5BQkxFU1RFUkVPUE9TSVRJT04sICAgICAgICAvLyB0eXBlIFNMYm9vbGVhbiAgPSB0eXBlZGVmIFNMdWludDMyIChzZXQgJiBnZXQpCi0gICAgVk9MVU1FX1BBUkFNX1NURVJFT1BPU0lUSU9OLCAgICAgICAgICAgICAgLy8gdHlwZSBTTHBlcm1pbGxlID0gdHlwZWRlZiBTTHVpbnQxNiAoc2V0ICYgZ2V0KQotfSB0X3ZvbHVtZV9wYXJhbXM7Ci0KLXN0YXRpYyBjb25zdCBpbnQgUFJFU0VUX0NVU1RPTSA9IC0xOwotCi1zdGF0aWMgY29uc3QgdWludDMyX3QgYmFuZEZyZXFSYW5nZVtGSVZFQkFORF9OVU1CQU5EU11bMl0gPSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB7MzAwMDAsIDEyMDAwMH0sCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB7MTIwMDAxLCA0NjAwMDB9LAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgezQ2MDAwMSwgMTgwMDAwMH0sCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB7MTgwMDAwMSwgNzAwMDAwMH0sCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB7NzAwMDAwMSwgMX19OwotCi1zdGF0aWMgY29uc3QgTFZNX1VJTlQxNiAgRVFOQl81QmFuZFByZXNldHNGcmVxdWVuY2llc1tdID0gewotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgNjAsICAgICAgICAgICAvKiBGcmVxdWVuY2llcyBpbiBIeiAqLwotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMjMwLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOTEwLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMzYwMCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDE0MDAwfTsKLQotc3RhdGljIGNvbnN0IExWTV9VSU5UMTYgRVFOQl81QmFuZFByZXNldHNRRmFjdG9yc1tdID0gewotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOTYsICAgICAgICAgICAgICAgLyogUSBmYWN0b3IgbXVsdGlwbGllZCBieSAxMDAgKi8KLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDk2LAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOTYsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA5NiwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDk2fTsKLQotc3RhdGljIGNvbnN0IExWTV9JTlQxNiBFUU5CXzVCYW5kTm9ybWFsUHJlc2V0c1tdID0gewotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMywgMCwgMCwgMCwgMywgICAgICAgLyogTm9ybWFsIFByZXNldCAqLwotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOCwgNSwgLTMsIDUsIDYsICAgICAgLyogQ2xhc3NpY2FsIFByZXNldCAqLwotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMTUsIC02LCA3LCAxMywgMTAsICAgLyogRGFuY2UgUHJlc2V0ICovCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAwLCAwLCAwLCAwLCAwLCAgICAgICAvKiBGbGF0IFByZXNldCAqLwotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgNiwgLTIsIC0yLCA2LCAtMywgICAgLyogRm9sayBQcmVzZXQgKi8KLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDgsIC04LCAxMywgLTEsIC00LCAgIC8qIEhlYXZ5IE1ldGFsIFByZXNldCAqLwotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMTAsIDYsIC00LCA1LCA4LCAgICAgLyogSGlwIEhvcCBQcmVzZXQgKi8KLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDgsIDUsIC00LCA1LCA5LCAgICAgIC8qIEphenogUHJlc2V0ICovCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC02LCA0LCA5LCA0LCAtNSwgICAgICAvKiBQb3AgUHJlc2V0ICovCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAxMCwgNiwgLTEsIDgsIDEwfTsgICAvKiBSb2NrIFByZXNldCAqLwotCi1zdGF0aWMgY29uc3QgTFZNX0lOVDE2IEVRTkJfNUJhbmRTb2Z0UHJlc2V0c1tdID0gewotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDMsIDAsIDAsIDAsIDMsICAgICAgLyogTm9ybWFsIFByZXNldCAqLwotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDUsIDMsIC0yLCA0LCA0LCAgICAgLyogQ2xhc3NpY2FsIFByZXNldCAqLwotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDYsIDAsIDIsIDQsIDEsICAgICAgLyogRGFuY2UgUHJlc2V0ICovCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMCwgMCwgMCwgMCwgMCwgICAgICAvKiBGbGF0IFByZXNldCAqLwotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDMsIDAsIDAsIDIsIC0xLCAgICAgLyogRm9sayBQcmVzZXQgKi8KLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA0LCAxLCA5LCAzLCAwLCAgICAgIC8qIEhlYXZ5IE1ldGFsIFByZXNldCAqLwotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDUsIDMsIDAsIDEsIDMsICAgICAgLyogSGlwIEhvcCBQcmVzZXQgKi8KLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA0LCAyLCAtMiwgMiwgNSwgICAgIC8qIEphenogUHJlc2V0ICovCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAtMSwgMiwgNSwgMSwgLTIsICAgICAvKiBQb3AgUHJlc2V0ICovCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgNSwgMywgLTEsIDMsIDV9OyAgICAvKiBSb2NrIFByZXNldCAqLwotCi1zdGF0aWMgY29uc3QgUHJlc2V0Q29uZmlnIGdFcXVhbGl6ZXJQcmVzZXRzW10gPSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgeyJOb3JtYWwifSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB7IkNsYXNzaWNhbCJ9LAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHsiRGFuY2UifSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB7IkZsYXQifSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB7IkZvbGsifSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB7IkhlYXZ5IE1ldGFsIn0sCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgeyJIaXAgSG9wIn0sCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgeyJKYXp6In0sCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgeyJQb3AifSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB7IlJvY2sifX07Ci0KLSNpZiBfX2NwbHVzcGx1cwotfSAgLy8gZXh0Z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JuZWQgYnkgJXMgaW4gJXNcblxuXG5cbiIsIGNhbGxpbmdGdW5jLCBjYWxsZWRGdW5jKTtcCi0gICAgICAgIH1cCi0gICAgICAgIGlmIChMdm1TdGF0dXMgPT0gTFZSRVZfSU5WQUxJRE5VTVNBTVBMRVMpe1wKLSAgICAgICAgICAgIEFMT0dWKCJcdExWUkVWX0VSUk9SIDogUGFyYW1ldGVyIGVycm9yIC0gIlwKLSAgICAgICAgICAgICAgICAgICAgImJhZCBudW1iZXIgb2Ygc2FtcGxlcyByZXR1cm5lZCBieSAlcyBpbiAlc1xuXG5cblxuIiwgY2FsbGluZ0Z1bmMsIGNhbGxlZEZ1bmMpO1wKLSAgICAgICAgfVwKLSAgICAgICAgaWYgKEx2bVN0YXR1cyA9PSBMVlJFVl9PVVRPRlJBTkdFKXtcCi0gICAgICAgICAgICBBTE9HVigiXHRMVlJFVl9FUlJPUiA6IFBhcmFtZXRlciBlcnJvciAtICJcCi0gICAgICAgICAgICAgICAgICAgICJvdXQgb2YgcmFuZ2UgcmV0dXJuZWQgYnkgJXMgaW4gJXNcbiIsIGNhbGxpbmdGdW5jLCBjYWxsZWRGdW5jKTtcCi0gICAgICAgIH1cCi0gICAgfQotCi0vLyBOYW1lc3BhY2VzCi1uYW1lc3BhY2UgYW5kcm9pZCB7Ci1uYW1lc3BhY2UgewotCi0vKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotLyogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qIFByZXNldCBkZWZpbml0aW9ucyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC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ICAgICAgICAgICAgICAgY29uZmlnOwotICAgIExWUkVWX0hhbmRsZV90ICAgICAgICAgICAgICAgICAgaEluc3RhbmNlOwotICAgIGludDE2X3QgICAgICAgICAgICAgICAgICAgICAgICAgU2F2ZWRSb29tTGV2ZWw7Ci0gICAgaW50MTZfdCAgICAgICAgICAgICAgICAgICAgICAgICBTYXZlZEhmTGV2ZWw7Ci0gICAgaW50MTZfdCAgICAgICAgICAgICAgICAgICAgICAgICBTYXZlZERlY2F5VGltZTsKLSAgICBpbnQxNl90ICAgICAgICAgICAgICAgICAgICAgICAgIFNhdmVkRGVjYXlIZlJhdGlvOwotICAgIGludDE2X3QgICAgICAgICAgICAgICAgICAgICAgICAgU2F2ZWRSZXZlcmJMZXZlbDsKLSAgICBpbnQxNl90ICAgICAgICAgICAgICAgICAgICAgICAgIFNhdmVkRGlmZnVzaW9uOwotICAgIGludDE2X3QgICAgICAgICAgICAgICAgICAgICAgICAgU2F2ZWREZW5zaXR5OwotICAgIGJvb2wgICAgICAgICAgICAgICAgICAgICAgICAgICAgYkVuYWJsZWQ7Ci0gICAgI2lmZGVmIExWTV9QQ00KLSAgICBGSUxFICAgICAgICAgICAgICAgICAgICAgICAgICAgICpQY21JblB0cjsKLSAgICBGSUxFICAgICAgICAgICAgICAgICAgICAgICAgICAgICpQY21PdXRQdHI7Ci0gICAgI2VuZGlmCi0gICAgTFZNX0ZzX2VuICAgICAgICAgICAgICAgICAgICAgICBTYW1wbGVSYXRlOwotICAgIExWTV9JTlQzMiAgICAgICAgICAgICAgICAgICAgICAgKkluRnJhbWVzMzI7Ci0gICAgTFZNX0lOVDMyICAgICAgICAgICAgICAgICAgICAgICAqT3V0RnJhbWVzMzI7Ci0gICAgYm9vbCAgICAgICAgICAgICAgICAgICAgICAgICAgICBhdXhpbGlhcnk7Ci0gICAgYm9vbCAgICAgICAgICAgICAgICAgICAgICAgICAgICBwcmVzZXQ7Ci0gICAgdWludDE2X3QgICAgICAgICAgICAgICAgICAgICAgICBjd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0gICAgaWYgKHBDb250ZXh0LT5wcmVzZXQgJiYgcENvbnRleHQtPmN1clByZXNldCA9PSBSRVZFUkJfUFJFU0VUX05PTkUpIHsKLSAgICAgICAgbWVtc2V0KHBDb250ZXh0LT5PdXRGcmFtZXMzMiwgMCwgZnJhbWVDb3VudCAqIHNpemVvZihMVk1fSU5UMzIpICogMik7IC8vYWx3YXlzIHN0ZXJlbyBoZXJlCi0gICAgfSBlbHNlIHsKLSAgICAgICAgaWYocENvbnRleHQtPmJFbmFibGVkID09IExWTV9GQUxTRSAmJiBwQ29udGV4dC0+U2FtcGxlc1RvRXhpdENvdW50ID4gMCkgewotICAgICAgICAgICAgbWVtc2V0KHBDb250ZXh0LT5JbkZyYW1lczMyLDAsZnJhbWVDb3VudCAqIHNpemVvZihMVk1fSU5UMzIpICogc2FtcGxlc1BlckZyYW1lKTsKLSAgICAgICAgICAgIEFMT0dWKCJcdFplcm9pbmcgJWQgc2FtcGxlcyBwZXIgZnJhbWUgYXQgdGhlIGVuZCBvZiBjYWxsIiwgc2FtcGxlc1BlckZyYW1lKTsKLSAgICAgICAgfQotCi0gICAgICAgIC8qIFByb2Nlc3MgdGhlIHNhbXBsZXMsIHByb2R1Y2luZyBhIHN0ZXJlbyBvdXRwdXQgKi8KLSAgICAgICAgTHZtU3RhdHVzID0gTFZSRVZfUHJvY2VzcyhwQ29udGV4dC0+aEluc3RhbmNlLCAgICAgIC8qIEluc3RhbmNlIGhhbmRsZSAqLwotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBDb250ZXh0LT5JbkZyYW1lczMyLCAgICAgLyogSW5wdXQgYnVmZmVyICovCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcENvbnRleHQtPk91dEZyYW1lczMyLCAgICAvKiBPdXRwdXQgYnVmZmVyICovCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZnJhbWVDb3VudCk7ICAgICAgICAgICAgICAvKiBOdW1iZXIgb2Ygc2Ftc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FZvbHVtZSA8PCAxNjsKLSAgICAgICAgICAgIExWTV9JTlQzMiBpbmNsID0gKCgoTFZNX0lOVDMyKXBDb250ZXh0LT5sZWZ0Vm9sdW1lIDw8IDE2KSAtIHZsKSAvIGZyYW1lQ291bnQ7Ci0gICAgICAgICAgICBMVk1fSU5UMzIgdnIgPSAoTFZNX0lOVDMyKXBDb250ZXh0LT5wcmV2UmlnaHRWb2x1bWUgPDwgMTY7Ci0gICAgICAgICAgICBMVk1fSU5UMzIgaW5jciA9ICgoKExWTV9JTlQzMilwQ29udGV4dC0+cmlnaHRWb2x1bWUgPDwgMTYpIC0gdnIpIC8gZnJhbWVDb3VudDsKLQotICAgICAgICAgICAgZm9yIChpbnQgaSA9IDA7IGkgPCBmcmFtZUNvdW50OyBpKyspIHsKLSAgICAgICAgICAgICAgICBPdXRGcmFtZXMxNlsyKmldID0KLSAgICAgICAgICAgICAgICAgICAgICAgIGNsYW1wMTYoKExWTV9JTlQzMikoKHZsID4+IDE2KSAqIE91dEZyYW1lczE2WzIqaV0pID4+IDEyKTsKLSAgICAgICAgICAgICAgICBPdXRGcmFtZXMxNlsyKmkrMV0gPQotICAgICAgICAgICAgICAgICAgICAgICAgY2xhbXAxNigoTFZNX0lOVDMyKSgodnIgPj4gMTYpICogT3V0RnJhbWVzMTZbMippKzFdKSA+PiAxMik7Ci0KLSAgICAgICAgICAgICAgICB2bCArPSBpbmNsOwotICAgICAgICAgICAgICAgIHZyICs9IGluY3I7Ci0gICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgIHBDb250ZXh0LT5wcmV2TGVmdFZvbHVtZSA9IHBDb250ZXh0LT5sZWZ0Vm9sdW1lOwotICAgICAgICAgICAgcENvbnRleHQtPnByZXZSaWdodFZvbHVtZSA9IHBDb250ZXh0LT5yaWdodFZvbHVtZTsKLSAgICAgICAgfSBlbHNlIGlmIChwQ29udGV4dC0+dm9sdW1lTW9kZSAhPSBSRVZFUkJfVk9MVU1FX09GRikgewotICAgICAgICAgICAgaWYgKHBDb250ZXh0LT5sZWZ0Vm9sdW1lICE9IFJFVkVSQl9VTklUX1ZPTFVNRSB8fAotICAgICAgICAgICAgICAgIHBDb250ZXh0LT5yaWdodFZvbHVtZSAhPSBSRVZFUkJfVU5JVF9WT0xVTUUpIHsKLSAgICAgICAgICAgICAgICBmb3IgKGludCBpID0gMDsgaSA8IGZyYW1lQ291bnQ7IGkrKykgewotICAgICAgICAgICAgICAgICAgICBPdXRGcmFtZXMxNlsyKmldID0KLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBjbGFtcDE2KChMVk1fSU5UMzIpKHBDb250ZXh0LT5sZWZ0Vm9sdW1lICogT3V0RnJhbWVzMTZbMippXSkgPj4gMTIpOwotICAgICAgICAgICAgICAgICAgICBPdXRGcmFtZXMxNlsyKmkrMV0gPQotICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNsYW1wMTYoKExWTV9JTlQzMikocENvbnRleHQtPnJpZ2h0Vm9sdW1lICogT3V0RnJhbWVzMTZbMippKzFdKSA+PiAxMik7Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgfQotICAgICAgICAgICAgcENvbnRleHQtPnByZXZMZWZ0Vm9sdW1lID0gcENvbnRleHQtPmxlZnRWb2x1bWU7Ci0gICAgICAgICAgICBwQ29udGV4dC0+cHJldlJpZ2h0Vm9sdW1lID0gcENvbnRleHQtPnJpZ2h0Vm9sdW1lOwotICAgICAgICAgICAgcENvbnRleHQtPnZvbHVtZU1vZGUgPSBSRVZFUkJfVk9MVU1FX1JBTVA7Ci0gICAgICAgIH0KLSAgICB9Ci0KLSAgICAjaWZkZWYgTFZNX1BDTQotICAgIGZ3cml0ZShPdXRGcmFtZXMxNiwgZnJhbWVDb3VudCpzaXplb2YoTFZNX0lOVDE2KSoyLCAxLCBwQ29udGV4dC0+UGNtT3V0UHRyKTsKLSAgICBmZmx1c2gocENvbnRleHQtPlBjbU91dFB0cik7Ci0gICAgI2VuZGlmCi0KLSAgICAvLyBBY2N1b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RleHQtPmNvbmZpZy5pbnB1dENmZy5idWZmZXJQcm92aWRlci5jb29raWUgICAgICAgICA9IE5VTEw7Ci0gICAgcENvbnRleHQtPmNvbmZpZy5pbnB1dENmZy5tYXNrICAgICAgICAgICAgICAgICAgICAgICAgICA9IEVGRkVDVF9DT05GSUdfQUxMOwotICAgIHBDb250ZXh0LT5jb25maWcub3V0cHV0Q2ZnLmFjY2Vzc01vZGUgICAgICAgICAgICAgICAgICAgPSBFRkZFQ1RfQlVGRkVSX0FDQ0VTU19BQ0NVTVVMQVRFOwotICAgIHBDb250ZXh0LT5jb25maWcub3V0cHV0Q2ZnLmNoYW5uZWxzICAgICAgICAgICAgICAgICAgICAgPSBBVURJT19DSEFOTkVMX09VVF9TVEVSRU87Ci0gICAgcENvbnRleHQtPmNvbmZpZy5vdXRwdXRDZmcuZm9ybWF0ICAgICAgICAgICAgICAgICAgICAgICA9IEFVRElPX0ZPUk1BVF9QQ01fMTZfQklUOwotICAgIHBDb250ZXh0LT5jb25maWcub3V0cHV0Q2ZnLnNhbXBsaW5nUmF0ZSAgICAgICAgICAgICAgICAgPSA0NDEwMDsKLSAgICBwQ29udGV4dC0+Y29uZmlnLm91dHB1dENmZy5idWZmZXJQcm92aWRlci5nZXRCdWZmZXIgICAgID0gTlVMTDsKLSAgICBwQ29udGV4dC0+Y29uZmlnLm91dHB1dENmZy5idWZmZXJQcm92aWRlci5yZWxlYXNlQnVmZmVyID0gTlVMTDsKLSAgICBwQ29udGV4dC0+Y29uZmlnLm91dHB1dENmZy5idWZmZXJQcm92aWRlci5jb29raWUgICAgICAgID0gTlVMTDsKLSAgICBwQ29udGV4dC0+Y29uZmlnLm91dHB1dENmZy5tYXNrICAgICAgICAgICAgICAgICAgICAgICAgID0gRUZGRUNUX0NPTkZJR19BTEw7Ci0KLSAgICBwQ29udGV4dC0+bGVmdFZvbHVtZSA9IFJFVkVSQl9VTklUX1ZPTFVNRTsKLSAgICBwQ29udGV4dC0+cmlnaHRWb2x1bWUg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udGV4dC0+bmV4dFByZXNldDsKLSAgICAgICAgQUxPR1YoImdldCBSRVZFUkJfUEFSQU1fUFJFU0VULCBwcmVzZXQgJWQiLCBwQ29udGV4dC0+bmV4dFByZXNldCk7Ci0gICAgICAgIHJldHVybiAwOwotICAgIH0KLQotICAgIHN3aXRjaCAocGFyYW0pewotICAgICAgICBjYXNlIFJFVkVSQl9QQVJBTV9ST09NX0xFVkVMOgotICAgICAgICAgICAgaWYgKCpwVmFsdWVTaXplICE9IHNpemVvZihpbnQxNl90KSl7Ci0gICAgICAgICAgICAgICAgQUxPR1YoIlx0TFZNX0VSUk9SIDogUmV2ZXJiX2dldFBhcmFtZXRlcigpIGludmFsaWQgcFZhbHVlU2l6ZTEgJWQiLCAqcFZhbHVlU2l6ZSk7Ci0gICAgICAgICAgICAgICAgcmV0dXJuIC1FSU5WQUw7Ci0gICAgICAgICAgICB9Ci0gICAgICAgICAgICAqcFZhbHVlU2l6ZSA9IHNpemVvZihpbnQxNl90KTsKLSAgICAgICAgICAgIGJyZWFrOwotICAgICAgICBjYXNlIFJFVkVSQl9QQVJBTV9ST09NX0hGX0xFVkVMOgotICAgICAgICAgICAgaWYgKCpwVmFsdWVTaXplICE9IHNpemVvZihpbnQxNl90KSl7Ci0gICAgICAgICAgICAgICAgQUxPR1YoIlx0TFZNX0VSUk9SIDogUmV2ZXJiX2dldFBhcmFtZXRlcigpIGludmFsaWQgcFZhbHVlU2l6ZTEyICVkIiwgKnBWYWx1ZVNpemUpOwotICAgICAgICAgICAgICAgIHJldHVybiAtRUlOVkFMOwotICAgICAgICAgICAgfQotICAgICAgICAgICAgKnBWYWx1ZVNpemUgPSBzaXplb2YoaW50MTZfdCk7Ci0gICAgICAgICAgICBicmVhazsKLSAgICAgICAgY2FzZSBSRVZFUkJfUEFSQU1fREVDQVlfVElNRToKLSAgICAgICAgICAgIGlmICgqcFZhbHVlU2l6ZSAhPSBzaXplb2YodWludDMyX3QpKXsKLSAgICAgICAgICAgICAgICBBTE9HVigiXHRMVk1fRVJST1IgOiBSZXZlcmJfZ2V0UGFyYW1ldGVyKCkgaW52YWxpZCBwVmFsdWVTaXplMyAlZCIsICpwVmFsdWVTaXplKTsKLSAgICAgICAgICAgICAgICByZXR1cm4gLUVJTlZBTDsKLSAgICAgICAgICAgIH0KLSAgICAgICAgICAgICpwVmFsdWVTaXplID0gc2l6ZW9mKHVpbnQzMl90KTsKLSAgICAgICAgICAgIGJyZWFrOwotICAgICAgICBjYXNlIFJFVkVSQl9QQVJBTV9ERUNBWV9IRl9SQVRJTzoKLSAgICAgICAgICAgIGlmICgqcFZhbHVlU2l6ZSAhPSBzaXplb2YoaW50MTZfdCkpewotICAgICAgICAgICAgICAgIEFMT0dWKCJcdExWTV9FUlJPUiA6IFJldmVyYl9nZXRQYXJhbWV0ZXIoKSBpbnZhbGlkIHBWYWx1ZVNpemU0ICVkIiwgKnBWYWx1ZVNpemUpOwotICAgICAgICAgICAgICAgIHJldHVybiAtRUlOVkFMOwotICAgICAgICAgICAgfQotICAgICAgICAgICAgKnBWYWx1ZVNpemUgPSBzaXplb2YoaW50MTZfdCk7Ci0gICAgICAgICAgICBicmVhazsKLSAgICAgICAgY2FzZSBSRVZFUkJfUEFSQU1fUkVGTEVDVElPTlNfTEVWRUw6Ci0gICAgICAgICAgICBpZiAoKnBWYWx1ZVNpemUgIT0gc2l6ZW9mKGludDE2X3QpKXsKLSAgICAgICAgICAgICAgICBBTE9HVigiXHRMVk1fRVJST1IgOiBSZXZlcmJfZ2V0UGFyYW1ldGVyKCkgaW52YWxpZCBwVmFsdWVTaXplNSAlZCIsICpwVmFsdWVTaXplKTsKLSAgICAgICAgICAgICAgICByZXR1cm4gLUVJTlZBTDsKLSAgICAgICAgICAgIH0KLSAgICAgICAgICAgICpwVmFsdWVTaXplID0gc2l6ZW9mKGludDE2X3QpOwotICAgICAgICAgICAgYnJlYWs7Ci0gICAgICAgIGNhc2UgUkVWRVJCX1BBUkFNX1JFRkxFQ1RJT05TX0RFTEFZOgotICAgICAgICAgICAgaWYgKCpwVmFsdWVTaXplICE9IHNpemVvZih1aW50MzJfdCkpewotICAgICAgICAgICAgICAgIEFMT0dWKCJcdExWTV9FUlJPUiA6IFJldmVyYl9nZXRQYXJhbWV0ZXIoKSBpbnZhbGlkIHBWYWx1ZVNpemU2ICVkIiwgKnBWYWx1ZVNpemUpOwotICAgICAgICAgICAgICAgIHJldHVybiAtRUlOVkFMOwotICAgICAgICAgICAgfQotICAgICAgICAgICAgKnBWYWx1ZVNpemUgPSBzaXplb2YodWludDMyX3QpOwotICAgICAgICAgICAgYnJlYWs7Ci0gICAgICAgIGNhc2UgUkVWRVJCX1BBUkFNX1JFVkVSQl9MRVZFTDoKLSAgICAgICAgICAgIGlmICgqcFZhbHVlU2l6ZSAhPSBzaXplb2YoaW50MTZfdCkpewotICAgICAgICAgICAgICAgIEFMT0dWKCJcdExWTV9FUlJPUiA6IFJldmVyYl9nZXRQYXJhbWV0ZXIoKSBpbnZhbGlkIHBWYWx1ZVNpemU3ICVkIiwgKnBWYWx1ZVNpemUpOwotICAgICAgICAgICAgICAgIHJldHVybiAtRUlOVkFMOwotICAgICAgICAgICAgfQotICAgICAgICAgICAgKnBWYWx1ZVNpemUgPSBzaXplb2YoaW50MTZfdCk7Ci0gICAgICAgICAgICBicmVhazsKLSAgICAgICAgY2FzZSBSRVZFUkJfUEFSQU1fUkVWRVJCX0RFTEFZOgotICAgICAgICAgICAgaWYgKCpwVmFsdWVTaXplICE9IHNpemVvZih1aW50MzJfdCkpewotICAgICAgICAgICAgICAgIEFMT0dWKCJcdExWTV9FUlJPUiA6IFJldmVyYl9nZXRQYXJhbWV0ZXIoKSBpbnZhbGlkIHBWYWx1ZVNpemU4ICVkIiwgKnBWYWx1ZVNpemUpOwotICAgICAgICAgICAgICAgIHJldHVybiAtRUlOVkFMOwotICAgICAgICAgICAgfQotICAgICAgICAgICAgKnBWYWx1ZVNpemUgPSBzaXplb2YodWludDMyX3QpOwotICAgICAgICAgICAgYnJlYWs7Ci0gICAgICAgIGNhc2UgUkVWRVJCX1BBUkFNX0RJRkZVU0lPTjoKLSAgICAgICAgICAgIGlmICgqcFZhbHVlU2l6ZSAhPSBzaXplb2YoaW50MTZfdCkpewotICAgICAgICAgICAgICAgIEFMT0dWKCJcdExWTV9FUlJPUiA6IFJldmVyYl9nZXRQYXJhbWV0ZXIoKSBpbnZhbGlkIHBWYWx1ZVNpemU5ICVkIiwgKnBWYWx1ZVNpemUpOwotICAgICAgICAgICAgICAgIHJldHVybiAtRUlOVkFMOwotICAgICAgICAgICAgfQotICAgICAgICAgICAgKnBWYWx1ZVNpemUgPSBzaXplb2YoaW50MTZfdCk7Ci0gICAgICAgICAgICBicmVhazsKLSAgICAgICAgY2FzZSBSRVZFUkJfUEFSQU1fREVOU0lUWToKLSAgICAgICAgICAgIGlmICgqcFZhbHVlU2l6ZSAhPSBzaXplb2YoaW50MTZfdCkpewotICAgICAgICAgICAgICAgIEFMT0dWKCJcdExWTV9FUlJPUiA6IFJldmVyYl9nZXRQYXJhbWV0ZXIoKSBpbnZhbGlkIHBWYWx1ZVNpemUxMCAlZCIsICpwVmFsdWVTaXplKTsKLSAgICAgICAgICAgICAgICByZXR1cm4gLUVJTlZBTDsKLSAgICAgICAgICAgIH0KLSAgICAgICAgICAgICpwVmFsdWVTaXplID0gc2l6ZW9mKGludDE2X3QpOwotICAgICAgICAgICAgYnJlYWs7Ci0gICAgICAgIGNhc2UgUkVWRVJCX1BBUkFNX1BST1BFUlRJRVM6Ci0gICAgICAgICAgICBpZiAoKnBWYWx1ZVNpemUgIT0gc2l6ZW9mKHRfcmV2ZXJiX3NldHRpbmdzKSl7Ci0gICAgICAgICAgICAgICAgQUxPR1YoIlx0TFZNX0VSUk9SIDogUmV2ZXJiX2dldFBhcmFtZXRlcigpIGludmFsaWQgcFZhbHVlU2l6ZTExICVkIiwgKnBWYWx1ZVNpemUpOwotICAgICAgICAgICAgICAgIHJldHVybiAtRUlOVkFMOwotICAgICAgICAgICAg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sKHBDb250ZXh0KTsKLQotICAgICAgICAgICAgLy9BTE9HVigiXHRSZXZlcmJfZ2V0UGFyYW1ldGVyKCkgUkVWRVJCX1BBUkFNX1JPT01fTEVWRUwgVmFsdWUgaXMgJWQiLAotICAgICAgICAgICAgLy8gICAgICAgICooaW50MTZfdCAqKXBWYWx1ZSk7Ci0gICAgICAgICAgICBicmVhazsKLSAgICAgICAgY2FzZSBSRVZFUkJfUEFSQU1fUk9PTV9IRl9MRVZFTDoKLSAgICAgICAgICAgICooaW50MTZfdCAqKXBWYWx1ZSA9IFJldmVyYkdldFJvb21IZkxldmVsKHBDb250ZXh0KTsKLQotICAgICAgICAgICAgLy9BTE9HVigiXHRSZXZlcmJfZ2V0UGFyYW1ldGVyKCkgUkVWRVJCX1BBUkFNX1JPT01fSEZfTEVWRUwgVmFsdWUgaXMgJWQiLAotICAgICAgICAgICAgLy8gICAgICAgICooaW50MTZfdCAqKXBWYWx1ZSk7Ci0gICAgICAgICAgICBicmVhazsKLSAgICAgICAgY2FzZSBSRVZFUkJfUEFSQU1fREVDQVlfVElNRToKLSAgICAgICAgICAgICoodWludDMyX3QgKilwVmFsdWUgPSBSZXZlcmJHZXREZWNheVRpbWUocENvbnRleHQpOwotCi0gICAgICAgICAgICAvL0FMT0dWKCJcdFJldmVyYl9nZXRQYXJhbWV0ZXIoKSBSRVZFUkJfUEFSQU1fREVDQVlfVElNRSBWYWx1ZSBpcyAlZCIsCi0gICAgICAgICAgICAvLyAgICAgICAgKihpbnQzMl90ICopcFZhbHVlKTsKLSAgICAgICAgICAgIGJyZWFrOwotICAgICAgICBjYXNlIFJFVkVSQl9QQVJBTV9ERUNBWV9IRl9SQVRJTzoKLSAgICAgICAgICAgICooaW50MTZfdCAqKXBWYWx1ZSA9IFJldmVyYkdldERlY2F5SGZSYXRpbyhwQ29udGV4dCk7Ci0KLSAgICAgICAgICAgIC8vQUxPR1YoIlx0UmV2ZXJiX2dldFBhcmFtZXRlcigpIFJFVkVSQl9QQVJBTV9ERUNBWV9IRl9SQVRJT04gVmFsdWUgaXMgJWQiLAotICAgICAgICAgICAgLy8gICAgICAgICooaW50MTZfdCAqKXBWYWx1ZSk7Ci0gICAgICAgICAgICBicmVhazsKLSAgICAgICAgY2FzZSBSRVZFUkJfUEFSQU1fUkVWRVJCX0xFVkVMOgotICAgICAgICAgICAgICooaW50MTZfdCAqKXBWYWx1ZSA9IFJldmVyYkdldFJldmVyYkxldmVsKHBDb250ZXh0KTsKLQotICAgICAgICAgICAgLy9BTE9HVigiXHRSZXZlcmJfZ2V0UGFyYW1ldGVyKCkgUkVWRVJCX1BBUkFNX1JFVkVSQl9MRVZFTCBWYWx1ZSBpcyAlZCIsCi0gICAgICAgICAgICAvLyAgICAgICAgKihpbnQxNl90ICopcFZhbHVlKTsKLSAgICAgICAgICAgIGJyZWFrOwotICAgICAgICBjYXNlIFJFVkVSQl9QQVJBTV9ESUZGVVNJT046Ci0gICAgICAgICAgICAqKGludDE2X3QgKilwVmFsdWUgPSBSZXZlcmJHZXREaWZmdXNpb24ocENvbnRleHQpOwotCi0gICAgICAgICAgICAvL0FMT0dWKCJcdFJldmVyYl9nZXRQYXJhbWV0ZXIoKSBSRVZFUkJfUEFSQU1fREVDQVlfRElGRlVTSU9OIFZhbHVlIGlzICVkIiwKLSAgICAgICAgICAgIC8vICAgICAgICAqKGludDE2X3QgKilwVmFsdWUpOwotICAgICAgICAgICAgYnJlYWs7Ci0gICAgICAgIGNhc2UgUkVWRVJCX1BBUkFNX0RFTlNJVFk6Ci0gICAgICAgICAgICAqKHVpbnQxNl90ICopcFZhbHVlID0gMDsKLSAgICAgICAgICAgICooaW50MTZfdCAqKXBWYWx1ZSA9IFJldmVyYkdldERlbnNpdHkocENvbnRleHQpOwotICAgICAgICAgICAgLy9BTE9HVigiXHRSZXZlcmJfZ2V0UGFyYW1ldGVyKCkgUkVWRVJCX1BBUkFNX0RFTlNJVFkgVmFsdWUgaXMgJWQiLAotICAgICAgICAgICAgLy8gICAgICAgIC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GlzIGhhbmRsZWQgaW50ZXJuYWxMWSBieSB0aGUgTFZNIGJ1bmRsZSAqLwotICAgIHN0YXR1cyA9IHByb2Nlc3MoICAgIChMVk1fSU5UMTYgKilpbkJ1ZmZlci0+cmF3LAotICAgICAgICAgICAgICAgICAgICAgICAgIChMVk1fSU5UMTYgKilvdXRCdWZmZXItPnJhdywKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgb3V0QnVmZmVyLT5mcmFtZUNvdW50LAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwQ29udGV4dCk7Ci0KLSAgICBpZiAocENvbnRleHQtPmJFbmFibGVkID09IExWTV9GQUxTRSkgewotICAgICAgICBpZiAocENvbnRleHQtPlNhbXBsZXNUb0V4aXRDb3VudCA+IDApIHsKLSAgICAgICAgICAgIHBDb250ZXh0LT5TYW1wbGVzVG9FeGl0Q291bnQgLT0gb3V0QnVmZmVyLT5mcmFtZUNvdW50OwotICAgICAgICB9IGVsc2UgewotICAgICAgICAgICAgc3RhdHVzID0gLUVOT0RBVEE7Ci0gICAgICAgIH0KLSAgICB9Ci0KLSAgICByZXR1cm4gc3RhdHVzOwotfSAgIC8qIGVuZCBSZXZlcmJfcHJvY2VzcyAqLwotCi0vKiBFZmZlY3QgQ29udHJvbCBJbnRlcmZhY2UgSW1wbGVtZW50YXRpb246IENvbW1hbmQgKi8KLWludCBSZXZlcmJfY29tbWFuZChlZmZlY3RfaGFuZGxlX3QgIHNlbGYsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICB1aW50MzJfdCAgICAgICAgICAgIGNtZENvZGUsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICB1aW50MzJfdCAgICAgICAgICAgIGNtZFNpemUsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2b2lkICAgICAgICAgICAgICAgICpwQ21kRGF0YSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHVpbnQzMl90ICAgICAgICAgICAgK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fY29tbWFuZCBjbWRDb2RlIENhc2U6ICIKLSAgICAgICAgICAgICAgICAgICAgICAgICJFRkZFQ1RfQ01EX0lOSVQ6IEVSUk9SIik7Ci0gICAgICAgICAgICAgICAgcmV0dXJuIC1FSU5WQUw7Ci0gICAgICAgICAgICB9Ci0gICAgICAgICAgICAqKGludCAqKSBwUmVwbHlEYXRhID0gMDsKLSAgICAgICAgICAgIGJyZWFrOwotCi0gICAgICAgIGNhc2UgRUZGRUNUX0NNRF9TRVRfQ09ORklHOgotICAgICAgICAgICAgLy9BTE9HVigiXHRSZXZlcmJfY29tbWFuZCBjbWRDb2RlIENhc2U6ICIKLSAgICAgICAgICAgIC8vICAgICAgICAiRUZGRUNUX0NNRF9TRVRfQ09ORklHIHN0YXJ0Iik7Ci0gICAgICAgICAgICBpZiAocENtZERhdGEgPT0gTlVMTCB8fAotICAgICAgICAgICAgICAgIGNtZFNpemUgIT0gc2l6ZW9mKGVmZmVjdF9jb25maWdfdCkgfHwKLSAgICAgICAgICAgICAgICBwUmVwbHlEYXRhID09IE5VTEwgfHwKLSAgICAgICAgICAgICAgICAqcmVwbHlTaXplICE9IHNpemVvZihpbnQpKSB7Ci0gICAgICAgICAgICAgICAgQUxPR1YoIlx0TFZNX0VSUk9SIDogUmV2ZXJiX2NvbW1hbmQgY21kQ29kZSBDYXNlOiAiCi0gICAgICAgICAgICAgICAgICAgICAgICAiRUZGRUNUX0NNRF9TRVRfQ09ORklHOiBFUlJPUiIpOwotICAgICAgICAgICAgICAgIHJldHVybiAtRUlOVkFMOwotICAgICAgICAgICAgfQotICAgICAgICAgICAgKihpbnQgKikgcFJlcGx5RGF0YSA9IGFuZHJvaWQ6OlJldmVyYl9zZXRDb25maWcocENvbnRleHQsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoZWZmZWN0X2NvbmZpZ190ICopIHBDbWREYXRhKTsKLSAgICAgICAgICAgIGJyZWFrOwotCi0gICAgICAgIGNhc2UgRUZGRUNUX0NNRF9HRVRfQ09ORklHOgotICAgICAgICAgICAgaWYgKHBSZXBseURhdGEgPT0gTlVMTCB8fAotICAgICAgICAgICAgICAgICpyZXBseVNpemUgIT0gc2l6ZW9mKGVmZmVjdF9jb25maWdfdCkpIHsKLSAgICAgICAgICAgICAgICBBTE9HVigiXHRMVk1fRVJST1IgOiBSZXZlcmJfY29tbWFuZCBjbWRDb2RlIENhc2U6ICIKLSAgICAgICAgICAgICAgICAgICAgICAgICJFRkZFQ1RfQ01EX0dFVF9DT05GSUc6IEVSUk9SIik7Ci0gICAgICAgICAgICAgICAgcmV0dXJuIC1FSU5WQUw7Ci0gICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgIGFuZHJvaWQ6OlJldmVyYl9nZXRDb25maWcocENvbnRleHQsIChlZmZlY3RfY29uZmlnX3QgKilwUmVwbHlEYXRhKTsKLSAgICAgICAgICAgIGJyZWFrOwotCi0gICAgICAgIGNhc2UgRUZGRUNUX0NNRF9SRVNFVDoKLSAgICAgICAgICAgIC8vQUxPR1YoIlx0UmV2ZXJiX2NvbW1hbmQgY21kQ29kZSBDYXNlOiAiCi0gICAgICAgICAgICAvLyAgICAgICAgIkVGRkVDVF9DTURfUkVTRVQgc3RhcnQiKTsKLSAgICAgICAgICAgIFJldmVyYl9zZXRDb25maWcocENvbnRleHQsICZwQ29udGV4dC0+Y29uZmlnKTsKLSAgICAgICAgICAgIGJyZWFrOwotCi0gICAgICAgIGNhc2UgRUZGRUNUX0NNRF9HRVRfUEFSQU06ewotICAgICAgICAgICAgLy9BTE9HVigiXHRSZXZlcmJfY29tbWFuZCBjbWRDb2RlIENhc2U6ICIKLSAgICAgICAgICAgIC8vICAgICAgICAiRUZGRUNUX0NNRF9HRVRfUEFSQU0gc3RhcnQiKTsKLSAgICAgICAgICAgIGlmIChwQ21kRGF0YSA9PSBOVUxMIHx8Ci0gICAgICAgICAgICAgICAgICAgIGNtZFNpemUgPCAoaW50KShzaXplb2YoZWZmZWN0X3BhcmFtX3QpICsgc2l6ZW9mKGludDMyX3QpKSB8fAotICAgICAgICAgICAgICAgICAgICBwUmVwbHlEYXRhID09IE5VTEwgfHwKLSAgICAgICAgICAgICAgICAgICAgKnJlcGx5U2l6ZSA8IChpbnQpIChzaXplb2YoZWZmZWN0X3BhcmFtX3QpICsgc2l6ZW9mKGludDMyX3QpKSl7Ci0gICAgICAgICAgICAgICAgQUxPR1YoIlx0TFZNX0VSUk9SIDogUmV2ZXJiX2NvbW1hbmQgY21kQ29kZSBDYXNlOiAiCi0gICAgICAgICAgICAgICAgICAgICAgICAiRUZGRUNUX0NNRF9HRVRfUEFSQU06IEVSUk9SIik7Ci0gICAgICAgICAgICAgICAgcmV0dXJuIC1FSU5WQUw7Ci0gICAgICAgICAgICB9Ci0gICAgICAgICAgICBlZmZlY3RfcGFyYW1fdCAqcCA9IChlZmZlY3RfcGFyYW1fdCAqKXBDbWREYXRhOwotCi0gICAgICAgICAgICBtZW1jcHkocFJlcGx5RGF0YSwgcENtZERhdGEsIHNpemVvZihlZmZlY3RfcGFyYW1fdCkgKyBwLT5wc2l6ZSk7Ci0KLSAgICAgICAgICAgIHAgPSAoZWZmZWN0X3BhcmFtX3QgKilwUmVwbHlEYXRhOwotCi0gICAgICAgICAgICBpbnQgdm9mZnNldCA9ICgocC0+cHNpemUgLSAxKSAvIHNpemVvZihpbnQzMl90KSArIDEpICogc2l6ZW9mKGludDMyX3QpOwotCi0gICAgICAgICAgICBwLT5zdGF0dXMgPSBhbmRyb2lkOjpSZXZlcmJfZ2V0UGFyYW1ldGVyKHBDb250ZXh0LAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKHZvaWQgKilwLT5kYXRhLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKHNpemVfdCAgKikmcC0+dnNpemUsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcC0+ZGF0YSArIHZvZmZzZXQpOwotCi0gICAgICAgICAgICAqcmVwbHlTaXplID0gc2l6ZW9mKGVmZmVjdF9wYXJhbV90KSArIHZvZmZzZXQgKyBwLT52c2l6ZTsKLQotICAgICAgICAgICAgLy9BTE9HVigiXHRSZXZlcmJfY29tbWFuZCBFRkZFQ1RfQ01EX0dFVF9QQVJBTSAiCi0gICAgICAgICAgICAvLyAgICAgICAgIipwQ21kRGF0YSAlZCwgKnJlcGx5U2l6ZSAlZCwgKnBSZXBseURhdGEgJWQgIiwKLSAgICAgICAgICAgIC8vICAgICAgICAqKGludDMyX3QgKikoKGNoYXIgKilwQ21kRGF0YSArIHNpemVvZihlZmZlY3RfcGFyYW1fdCkpLAotICAgICAgICAgICAgLy8gICAgICAgICpyZXBseVNpemUsCi0gICAgICAgICAgICAvLyAgICAgICAgKihpbnQxNl90ICopKChjaGFyICopcFJlcGx5RGF0YSArIHNpemVvZihlZmZlY3RfcGFyYW1fdCkgKyB2b2Zmc2V0KSk7Ci0KLSAgICAgICAgfSBicmVhazsKLSAgICAgICAgY2FzZSBFRkZFQ1RfQ01EX1NFVF9QQVJBTTp7Ci0KLSAgICAgICAgICAgIC8vQUxPR1YoIlx0UmV2ZXJiX2NvbW1hbmQgY21kQ29kZSBDYXNlOiAiCi0gICAgICAgICAgICAvLyAgICAgICAgIkVGRkVDVF9DTURfU0VUX1BBUkFNIHN0YXJ0Iik7Ci0gICAgICAgICAgICAvL0FMT0dWKCJcdFJldmVyYl9jb21tYW5kIEVGRkVDVF9DTURfU0VUX1BBUkFNIHBhcmFtICVkLCAqcmVwbHlTaXplICVkLCB2YWx1ZSAlZCAiLAotICAgICAgICAgICAgLy8gICAgICAgICooaW50MzJfdCAqKSgoY2hhciAqKXBDbWREYXRhICsgc2l6ZW9mKGVmZmVjdF9wYXJhbV90KSksCi0gICAgICAgICAgICAvLyAgICAgICAgKnJlcGx5U2l6ZSwKLSAgICAgICAgICAgIC8vICAgICAgICAqKGludDE2X3QgKikoKGNoYXIgKilwQ21kRGF0YSArIHNpemVvZihlZmZlY3RfcGFyYW1fdCkgKyBzaXplb2YoaW50MzJfdCkpKTsKLQotICAgICAgICAgICAgaWYgKHBDbWREYXRhID09IE5VTEwgfHwgKGNtZFNpemUgPCAoaW50KShzaXplb2YoZWZmZWN0X3BhcmFtX3QpICsgc2l6ZW9mKGludDMyX3QpKSkKLSAgICAgICAgICAgICAgICAgICAgfHwgcFJlcGx5RGF0YSA9PSBOVUxMIHx8ICpyZXBseVNpemUgIT0gKGludClzaXplb2YoaW50MzJfdCkpIHsKLSAgICAgICAgICAgICAgICBBTE9HVigiXHRMVk1fRVJST1IgOiBSZXZlcmJfY29tbWFuZCBjbWRDb2RlIENhc2U6ICIKLSAgICAgICAgICAgICAgICAgICAgICAgICJFRkZFQ1RfQ01EX1NFVF9QQVJBTTogRVJST1IiKTsKLSAgICAgICAgICAgICAgICByZXR1cm4gLUVJTlZBTDsKLSAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgZWZmZWN0X3BhcmFtX3QgKnAgPSAoZWZmZWN0X3BhcmFtX3QgKikgcENtZERhdGE7Ci0KLSAgICAgICAgICAgIGlmIChwLT5wc2l6ZSAhPSBzaXplb2YoaW50MzJfdCkpewotICAgICAgICAgICAgICAgIEFMT0dWKCJcdDRMVk1fRVJST1IgOiBSZXZlcmJfY29tbWFuZCBjbWRDb2RlIENhc2U6ICIKLSAgICAgICAgICAgICAgICAgICAgICAgICJFRkZFQ1RfQ01EX1NFVF9QQVJBTTogRVJST1IsIHBzaXplIGlzIG5vdCBzaXplb2YoaW50MzJfdCkiKTsKLSAgICAgICAgICAgICAgICByZXR1cm4gLUVJTlZBTDsKLSAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgLy9BTE9HVigiXHRuNVJldmVyYl9jb21tYW5kIGNtZFNpemUgaXMgJWRcbiIKLSAgICAgICAgICAgIC8vICAgICAgICAiXHRzaXplb2YoZWZmZWN0X3BhcmFtX3QpIGlzICAlZFxuIgotICAgICAgICAgICAgLy8gICAgICAgICJcdHAtPnBzaXplIGlzICVkXG4iCi0gICAgICAgICAgICAvLyAgICAgICAgIlx0cC0+dnNpemUgaXMgJWQiCi0gICAgICAgICAgICAvLyAgICAgICAgIlxuIiwKLSAgICAgICAgICAgIC8vICAgICAgICBjbWRTaXplLCBzaXplb2YoZWZmZWN0X3BhcmFtX3QpLCBwLT5wc2l6ZSwgcC0+dnNpemUgKTsKLQotICAgICAgICAgICAgKihpbnQgKilwUmVwbHlEYXRhID0gYW5kcm9pZDo6UmV2ZXJiX3NldFBhcmFtZXRlcihwQ29udGV4dCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAodm9pZCAqKXAtPmRhdGEsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHAtPmRhdGEgKyBwLT5wc2l6ZSk7Ci0gICAgICAgIH0gYnJlYWs7Ci0KLSAgICAgICAgY2FzZSBFRkZFQ1RfQ01EX0VOQUJMRToKLSAgICAgICAgICAgIC8vQUxPR1YoIlx0UmV2ZXJiX2NvbW1hbmQgY21kQ29kZSBDYXNlOiAiCi0gICAgICAgICAgICAvLyAgICAgICAgIkVGRkVDVF9DTURfRU5BQkxFIHN0YXJ0Iik7Ci0KLSAgICAgICAgICAgIGlmIChwUmVwbHlEYXRhID09IE5VTEwgfHwgKnJlcGx5U2l6ZSAhPSBzaXplb2YoaW50KSl7Ci0gICAgICAgICAgICAgICAgQUxPR1YoIlx0TFZNX0VSUk9SIDogUmV2ZXJiX2NvbW1hbmQgY21kQ29kZSBDYXNlOiAiCi0gICAgICAgICAgICAgICAgICAgICAgICAiRUZGRUNUX0NNRF9FTkFCTEU6IEVSUk9SIik7Ci0gICAgICAgICAgICAgICAgcmV0dXJuIC1FSU5WQUw7Ci0gICAgICAgICAgICB9Ci0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otICAgICAgICAgICAgLy9BTE9HVigiXHRFRkZFQ1RfQ01EX0VOQUJMRSBTYW1wbGVzVG9FeGl0Q291bnQgPSAlZCIsIHBDb250ZXh0LT5TYW1wbGVzVG9FeGl0Q291bnQpOwotICAgICAgICAgICAgYnJlYWs7Ci0gICAgICAgIGNhc2UgRUZGRUNUX0NNRF9ESVNBQkxFOgotICAgICAgICAgICAgLy9BTE9HVigiXHRSZXZlcmJfY29tbWFuZCBjbWRDb2RlIENhc2U6ICIKLSAgICAgICAgICAgIC8vICAgICAgICAiRUZGRUNUX0NNRF9ESVNBQkxFIHN0YXJ0Iik7Ci0KLSAgICAgICAgICAgIGlmIChwUmVwbHlEYXRhID09IE5VTEwgfHwgKnJlcGx5U2l6ZSAhPSBzaXplb2YoaW50KSl7Ci0gICAgICAgICAgICAgICAgQUxPR1YoIlx0TFZNX0VSUk9SIDogUmV2ZXJiX2NvbW1hbmQgY21kQ29kZSBDYXNlOiAiCi0gICAgICAgICAgICAgICAgICAgICAgICAiRUZGRUNUX0NNRF9ESVNBQkxFOiBFUlJPUiIpOwotICAgICAgICAgICAgICAgIHJldHVybiAtRUlOVkFMOwotICAgICAgICAgICAgfQotICAgICAgICAgICAgaWYocENvbnRleHQtPmJFbmFibGVkID09IExWTV9GQUxTRSl7Ci0gICAgICAgICAgICAgICAgIEFMT0dWKCJcdExWTV9FUlJPUiA6IFJldmVyYl9jb21tYW5kIGNtZENvZGUgQ2FzZTogIgotICAgICAgICAgICAgICAgICAgICAgICAgICJFRkZFQ1RfQ01EX0RJU0FCTEU6IEVSUk9SLUVmZmVjdCBpcyBub3QgeWV0IGVuYWJsZWQiKTsKLSAgICAgICAgICAgICAgICAgcmV0dXJuIC1FSU5WQUw7Ci0gICAgICAgICAgICAgfQotICAgICAgICAgICAgKihpbnQgKilwUmVwbHlEYXRhID0gMDsKLSAgICAgICAgICAgIHBDb250ZXh0LT5iRW5hYmxlZCA9IExWTV9GQUxTRTsKLSAgICAgICAgICAgIGJyZWFrOwotCi0gICAgICAgIGNhc2UgRUZGRUNUX0NNRF9TRVRfVk9MVU1FOgotICAgICAgICAgICAgaWYgKHBDbWREYXRhID09IE5VTEwgfHwKLSAgICAgICAgICAgICAgICBjbWRTaXplICE9IDIgKiBzaXplb2YodWludDMyX3QpKSB7Ci0gICAgICAgICAgICAgICAgQUxPR1YoIlx0TFZNX0VSUk9SIDogUmV2ZXJiX2NvbW1hbmQgY21kQ29kZSBDYXNlOiAiCi0gICAgICAgICAgICAgICAgICAgICAgICAiRUZGRUNUX0NNRF9TRVRfVk9MVU1FOiBFUlJPUiIpOwotICAgICAgICAgICAgICAgIHJldHVybiAtRUlOVkFMOwotICAgICAgICAgICAgfQotCi0KLSAgICAgICAgICAgIGlmIChwUmVwbHlEYXRhICE9IE5VTEwpIHsgLy8gd2UgaGF2ZSB2b2x1bWUgY29udHJvbAotICAgICAgICAgICAgICAgIHBDb250ZXh0LT5sZWZ0Vm9sdW1lID0gKExWTV9JTlQxNikoKCoodWludDMyX3QgKilwQ21kRGF0YSArICgxIDw8IDExKSkgPj4gMTIpOwotICAgICAgICAgICAgICAgIHBDb250ZXh0LT5yaWdodFZvbHVtZSA9IChMVk1fSU5UMTYpKCgqKCh1aW50MzJfdCAqKXBDbWREYXRhICsgMSkgKyAoMSA8PCAxMSkpID4+IDEyKTsKLSAgICAgICAgICAgICAgICAqKHVpbnQzMl90ICopcFJlcGx5RGF0YSA9ICgxIDw8IDI0KTsKLSAgICAgICAgICAgICAgICAqKCh1aW50MzJfdCAqKXBSZXBseURhdGEgKyAxKSA9ICgxIDw8IDI0KTsKLSAgICAgICAgICAgICAgICBpZiAocENvbnRleHQtPnZvbHVtZU1vZGUgPT0gYW5kcm9pZDo6UkVWRVJCX1ZPTFVNRV9PRkYpIHsKLSAgICAgICAgICAgICAgICAgICAgLy8gZm9yY2Ugbm8gdm9sdW1lIHJhbXAgZm9yIGZpcnN0IGJ1ZmZlciBwcm9jZXNzZWQgYWZ0ZXIgZ2V0dGluZy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AgICBzcGVleF9yZXNhbXBsZXJfZGVzdHJveShzZXNzaW9uLT5yZXZSZXNhbXBsZXIpOwotICAgICAgICBzZXNzaW9uLT5yZXZSZXNhbXBsZXIgPSBOVUxMOwotICAgIH0KLSAgICBpZiAoc2Vzc2lvbi0+c2FtcGxpbmdSYXRlICE9IHNlc3Npb24tPmFwbVNhbXBsaW5nUmF0ZSkgewotICAgICAgICBpbnQgZXJyb3I7Ci0gICAgICAgIHNlc3Npb24tPmluUmVzYW1wbGVyID0gc3BlZXhfcmVzYW1wbGVyX2luaXQoc2Vzc2lvbi0+aW5DaGFubmVsQ291bnQsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2Vzc2lvbi0+c2FtcGxpbmdSYXRlLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNlc3Npb24tPmFwbVNhbXBsaW5nUmF0ZSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBSRVNBTVBMRVJfUVVBTElUWSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmZXJyb3IpOwotICAgICAgICBpZiAoc2Vzc2lvbi0+aW5SZXNhbXBsZXIgPT0gTlVMTCkgewotICAgICAgICAgICAgQUxPR1coIlNlc3Npb25fU2V0Q29uZmlnIENhbm5vdCBjcmVhdGUgc3BlZXggcmVzYW1wbGVyOiAlcyIsCi0gICAgICAgICAgICAgICAgIHNwZWV4X3Jlc2FtcGxlcl9zdHJlcnJvcihlcnJvcikpOwotICAgICAgICAgICAgcmV0dXJuIC1FSU5WQUw7Ci0gICAgICAgIH0KLSAgICAgICAgc2Vzc2lvbi0+b3V0UmVzYW1wbGVyID0gc3BlZXhfcmVzYW1wbGVyX2luaXQoc2Vzc2lvbi0+b3V0Q2hhbm5lbENvdW50LAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNlc3Npb24tPmFwbVNhbXBsaW5nUmF0ZSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzZXNzaW9uLT5zYW1wbGluZ1JhdGUsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgUkVTQU1QTEVSX1FVQUxJVFksCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJmVycm9yKTsKLSAgICAgICAgaWYgKHNlc3Npb24tPm91dFJlc2FtcGxlciA9PSBOVUxMKSB7Ci0gICAgICAgICAgICBBTE9HVygiU2Vzc2lvbl9TZXRDb25maWcgQ2Fubm90IGNyZWF0ZSBzcGVleCByZXNhbXBsZXI6ICVzIiwKLSAgICAgICAgICAgICAgICAgc3BlZXhfcmVzYW1wbGVyX3N0cmVycm9yKGVycm9yKSk7Ci0gICAgICAgICAgICBzcGVleF9yZXNhbXBsZXJfZGVzdHJveShzZXNzaW9uLT5pblJlc2FtcGxlcik7Ci0gICAgICAgICAgICBzZXNzaW9uLT5pblJlc2FtcGxlciA9IE5VTEw7Ci0gICAgICAgICAgICByZXR1cm4gLUVJTlZBTDsKLSAgICAgICAgfQotICAgICAgICBzZXNzaW9uLT5yZXZSZXNhbXBsZXIgPSBzcGVleF9yZXNhbXBsZXJfaW5pdChzZXNzaW9uLT5pbkNoYW5uZWxDb3VudCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzZXNzaW9uLT5zYW1wbGluZ1JhdGUsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2Vzc2lvbi0+YXBtU2FtcGxpbmdSYXRlLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFJFU0FNUExFUl9RVUFMSVRZLAotICAgICA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AgICAgICAgICAgICAgIHNlc3Npb24tPmluQnVmU2l6ZSAqIHNlc3Npb24tPmluQ2hhbm5lbENvdW50ICogc2l6ZW9mKGludDE2X3QpKTsKLSAgICAgICAgICAgIH0KLSAgICAgICAgICAgIG1lbWNweShzZXNzaW9uLT5pbkJ1ZiArIHNlc3Npb24tPmZyYW1lc0luICogc2Vzc2lvbi0+aW5DaGFubmVsQ291bnQsCi0gICAgICAgICAgICAgICAgICAgaW5CdWZmZXItPnMxNiwKLSAgICAgICAgICAgICAgICAgICBmciAqIHNlc3Npb24tPmluQ2hhbm5lbENvdW50ICogc2l6ZW9mKGludDE2X3QpKTsKLQotICAgICAgICAgICAgc2Vzc2lvbi0+ZnJhbWVzSW4gKz0gZnI7Ci0gICAgICAgICAgICBpbkJ1ZmZlci0+ZnJhbWVDb3VudCA9IGZyOwotICAgICAgICAgICAgaWYgKHNlc3Npb24tPmZyYW1lc0luIDwgc2Vzc2lvbi0+ZnJhbWVDb3VudCkgewotICAgICAgICAgICAgICAgIHJldHVybiAwOwotICAgICAgICAgICAgfQotICAgICAgICAgICAgc2l6ZV90IGZySW4gPSBzZXNzaW9uLT5mcmFtZXNJbjsKLSAgICAgICAgICAgIHNpemVfdCBmck91dCA9IHNlc3Npb24tPmFwbUZyYW1lQ291bnQ7Ci0gICAgICAgICAgICBpZiAoc2Vzc2lvbi0+aW5DaGFubmVsQ291bnQgPT0gMSkgewotICAgICAgICAgICAgICAgIHNwZWV4X3Jlc2FtcGxlcl9wcm9jZXNzX2ludChzZXNzaW9uLT5pblJlc2FtcGxlciwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2Vzc2lvbi0+aW5CdWYsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICZmckluLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzZXNzaW9uLT5wcm9jRnJhbWUtPl9wYXlsb2FkRGF0YSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJmZyT3V0KTsKLSAgICAgICAgICAgIH0gZWxzZSB7Ci0gICAgICAgICAgICAgICAgc3BlZXhfcmVzYW1wbGVyX3Byb2Nlc3NfaW50ZXJsZWF2ZWRfaW50KHNlc3Npb24tPmluUmVzYW1wbGVyLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzZXNzaW9uLT5pbkJ1ZiwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJmZySW4sCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNlc3Npb24tPnByb2NGcmFtZS0+X3BheWxvYWREYXRhLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmZnJPdXQpOwotICAgICAgICAgICAgfQotICAgICAgICAgICAgbWVtY3B5KHNlc3Npb24tPmluQnVmLAotICAgICAgICAgICAgICAgICAgIHNlc3Npb24tPmluQnVmICsgZnJJbiAqIHNlc3Npb24tPmluQ2hhbm5lbENvdW50LAotICAgICAgICAgICAgICAgICAgIChzZXNzaW9uLT5mcmFtZXNJbiAtIGZySW4pICogc2Vzc2lvbi0+aW5DaGFubmVsQ291bnQgKiBzaXplb2YoaW50MTZfdCkpOwotICAgICAgICAgICAgc2Vzc2lvbi0+ZnJhbWVzSW4gLT0gZnJJbjsKLSAgICAgICAgfSBlbHNlIHsKLSAgICAgICAgICAgIHNpemVfdCBmciA9IHNlc3Npb24tPmZyYW1lQ291bnQgLSBzZXNzaW9uLT5mcmFtZXNJbjsKLSAgICAgICAgICAgIGlmIChpbkJ1ZmZlci0+ZnJhbWVDb3VudCA8IGZyKSB7Ci0gICAgICAgICAgICAgICAgZnIgPS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3Npb24tPm91dEJ1ZiA9IChpbnQxNl90ICopcmVhbGxvYyhzZXNzaW9uLT5vdXRCdWYsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzZXNzaW9uLT5vdXRCdWZTaXplICogc2Vzc2lvbi0+b3V0Q2hhbm5lbENvdW50ICogc2l6ZW9mKGludDE2X3QpKTsKLSAgICAgICAgfQotCi0gICAgICAgIGlmIChzZXNzaW9uLT5vdXRSZXNhbXBsZXIgIT0gTlVMTCkgewotICAgICAgICAgICAgc2l6ZV90IGZySW4gPSBzZXNzaW9uLT5hcG1GcmFtZUNvdW50OwotICAgICAgICAgICAgc2l6ZV90IGZyT3V0ID0gc2Vzc2lvbi0+ZnJhbWVDb3VudDsKLSAgICAgICAgICAgIGlmIChzZXNzaW9uLT5pbkNoYW5uZWxDb3VudCA9PSAxKSB7Ci0gICAgICAgICAgICAgICAgc3BlZXhfcmVzYW1wbGVyX3Byb2Nlc3NfaW50KHNlc3Npb24tPm91dFJlc2FtcGxlciwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDAsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzZXNzaW9uLT5wcm9jRnJhbWUtPl9wYXlsb2FkRGF0YSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICZmckluLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2Vzc2lvbi0+b3V0QnVmICsgc2Vzc2lvbi0+ZnJhbWVzT3V0ICogc2Vzc2lvbi0+b3V0Q2hhbm5lbENvdW50LAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJmZyT3V0KTsKLSAgICAgICAgICAgIH0gZWxzZSB7Ci0gICAgICAgICAgICAgICAgc3BlZXhfcmVzYW1wbGVyX3Byb2Nlc3NfaW50ZXJsZWF2ZWRfaW50KHNlc3Npb24tPm91dFJlc2FtcGxlciwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNlc3Npb24tPnByb2NGcmFtZS0+X3BheWxvYWREYXRhLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJmZySW4sCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzZXNzaW9uLT5vdXRCdWYgKyBzZXNzaW9uLT5mcmFtZXNPdXQgKiBzZXNzaW9uLT5vdXRDaGFubmVsQ291bnQsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmZnJPdXQpOwotICAgICAgICAgICAgfQotICAgICAgICAgICAgc2Vzc2lvbi0+ZnJhbWVzT3V0ICs9IGZyT3V0OwotICAgICAgICB9IGVsc2UgewotICAgICAgICAgICAgbWVtY3B5KHNlc3Npb24tPm91dEJ1ZiArIHNlc3Npb24tPmZyYW1lc091dCAqIHNlc3Npb24tPm91dENoYW5uZWxDb3VudCwKLSAgICAgICAgICAgICAgICAgICBzZXNzaW9uLT5wcm9jRnJhbWUtPl9wYXlsb2FkRGF0YSwKLSAgICAgICAgICAgICAgICAgICBzZXNzaW9uLT5mcmFtZUNvdW50ICogc2Vzc2lvbi0+b3V0Q2hhbm5lbENvdW50ICogc2l6ZW9mKGludDE2X3QpKTsKLSAgICAgICAgICAgIHNlc3Npb24tPmZyYW1lc091dCArPSBzZXNzaW9uLT5mcmFtZUNvdW50OwotICAgICAgICB9Ci0gICAgICAgIHNpemVfdCBmciA9IHNlc3Npb24tPmZyYW1lc091dDsKLSAgICAgICAgaWYgKGZyYW1lc1JxIC0gZnJhbWVzV3IgPCBmcikgewotICAgICAgICAgICAgZnIgPSBmcmFtZXNScSAtIGZyYW1lc1dyOwotICAgICAgICB9Ci0gICAgICAgIG1lbWNweShvdXRCdWZmZXItPnMxNiArIGZyYW1lc1dyICogc2Vzc2lvbi0+b3V0Q2hhbm5lbENvdW50LAotICAgICAgICAgICAgICBzZXNzaW9uLT5vdXRCdWYsCi0gICAgICAgICAgICAgIGZyICogc2Vzc2lvbi0+b3V0Q2hhbm5lbENvdW50ICogc2l6ZW9mKGludDE2X3QpKTsKLSAgICAgICAgbWVtY3B5KHNlc3Npb24tPm91dEJ1ZiwKLSAgICAgICAgICAgICAgc2Vzc2lvbi0+b3V0QnVmICsgZnIgKiBzZXNzaW9uLT5vdXRDaGFubmVsQ291bnQsCi0gICAgICAgICAgICAgIChzZXNzaW9uLT5mcmFtZXNPdXQgLSBmcikgKiBzZXNzaW9uLT5vdXRDaGFubmVsQ291bnQgKiBzaXplb2YoaW50MTZfdCkpOwotICAgICAgICBzZXNzaW9uLT5mcmFtZXNPdXQgLT0gZnI7Ci0gICAgICAgIG91dEJ1ZmZlci0+ZnJhbWVDb3VudCArPSBmcjsKLQotICAgICAgICByZXR1cm4gMDsKLSAgICB9IGVsc2UgewotICAgICAgICByZXR1cm4gLUVOT0RBVEE7Ci0gICAgfQotfQotCi1pbnQgUHJlUHJvY2Vzc2luZ0Z4X0NvbW1hbmQoZWZmZWN0X2hhbmRsZV90ICBzZWxmLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgIHVpbnQzMl90ICAgICAgICAgICAgY21kQ29kZSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICB1aW50MzJfdCAgICAgICAgICAgIGNtZFNpemUsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgdm9pZCAgICAgICAgICAgICAgICAqcENtZERhdGEsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgdWludDMyX3QgICAgICAgICAgICAqcmVwbHlTaXplLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZvaWQgICAgICAgICAgICAgICAgKnBSZXBseURhdGEpCi17Ci0gICAgcHJlcHJvY19lZmZlY3RfdCAqIGVmZmVjdCA9IChwcmVwcm9jX2VmZmVjdF90ICopIHNlbGY7Ci0gICAgaW50IHJldHNpemU7Ci0gICAgaW50IHN0YXR1czsKLQotICAgIGlmIChlZmZlY3QgPT0gTlVMTCl7Ci0gICAgICAgIHJldHVybiAtRUlOVkFMOwotICAgIH0KLQotICAgIC8vQUxPR1YoIlByZVByb2Nlc3NpbmdGeF9Db21tYW5kOiBjb21tYW5kICVkIGNtZFNpemUgJWQiLGNtZENvZGUsIGNtZFNpemUpOwotCi0gICAgc3dpdGNoIChjbWRDb2RlKXsKLSAgICAgICAgY2FzZSBFRkZFQ1RfQ01EX0lOSVQ6Ci0gICAgICAgICAgICBpZiAocFJlcGx5RGF0YSA9PSBOVUxMIHx8ICpyZXBseVNpemUgIT0gc2l6ZW9mKGludCkpewotICAgICAgICAgICAgICAgIHJldHVybiAtRUlOVkFMOwotICAgICAgICAgICAgfQotICAgICAgICAgICAgaWYgKGVmZmVjdC0+b3BzLT5pbml0KSB7Ci0gICAgICAgICAgICAgICAgZWZmZWN0LT5vcHMtPmluaXQoZWZmZWN0KTsKLSAgICAgICAgICAgIH0KLSAgICAgICAgICAgICooaW50ICopcFJlcGx5RGF0YSA9IDA7Ci0gICAgICAgICAgICBicmVhazsKLQotICAgICAgICBjYXNlIEVGRkVDVF9DTURfU0VUX0NPTkZJRzoKLSAgICAgICAgICAgIGlmIChwQ21kRGF0YSAgICA9PSBOVUxMfHwKLSAgICAgICAgICAgICAgICBjbWRTaXplICAgICAhPSBzaXplb2YoZWZmZWN0X2NvbmZpZ190KXx8Ci0gICAgICAgICAgICAgICAgcFJlcGx5RGF0YSAgPT0gTlVMTHx8Ci0gICAgICAgICAgICAgICAgKnJlcGx5U2l6ZSAgIT0gc2l6ZW9mKGludCkpewotICAgICAgICAgICAgICAgIEFMT0dWKCJQcmVQcm9jZXNzaW5nRnhfQ29tbWFuZCBjbWRDb2RlIENhc2U6ICIKLSAgICAgICAgICAgICAgICAgICAgICAgICJFRkZFQ1RfQ01EX1NFVF9DT05GSUc6IEVSUk9SIik7Ci0gICAgICAgICAgICAgICAgcmV0dXJuIC1FSU5WQUw7Ci0gICAgICAgICAgICB9Ci0gICAgICAgICAgICAqKGludCAqKXBSZXBseURhdGEgPSBTZXNzaW9uX1NldENvbmZpZyhlZmZlY3QtPnNlc3Npb24sIChlZmZlY3RfY29uZmlnX3QgKilwQ21kRGF0YSk7Ci0gICAgICAgICAgICBpZiAoKihpbnQgKilwUmVwbHlEYXRhICE9IDApIHsKLSAgICAgICAgICAgICAgICBicmVhazsKLSAgICAgICAgICAgIH0KLSAgICAgICAgICAgIGlmIChlZmZlY3QtPnN0YXRlICE9IFBSRVBST0NfRUZGRUNUX1NUQVRFX0FDVElWRSkgewotICAgICAgICAgICAgICAgICooaW50ICopcFJlcGx5RGF0YSA9IEVmZmVjdF9TZXRTdGF0ZShlZmZlY3QsIFBSRVBST0NfRUZGRUNUX1NUQVRFX0NPTkZJRyk7Ci0gICAgICAgICAgICB9Ci0gICAgICAgICAgICBicmVhazsKLQotICAgICAgICBjYXNlIEVGRkVDVF9DTURfR0VUX0NPTkZJRzoKLSAgICAgICAgICAgIGlmIChwUmVwbHlEYXRhID09IE5VTEwgfHwKLSAgICAgICAgICAgICAgICAqcmVwbHlTaXplICE9IHNpemVvZihlZmZlY3RfY29uZmlnX3QpKSB7Ci0gICAgICAgICAgICAgICAgQUxPR1YoIlx0TFZNX0VSUk9SIDogUHJlUHJvY2Vzc2luZ0Z4X0NvbW1hbmQgY21kQ29kZSBDYXNlOiAiCi0gICAgICAgICAgICAgICAgICAgICAgICAiRUZGRUNUX0NNRF9HRVRfQ09ORklHOiBFUlJPUiIpOwotICAgICAgICAgICAgICAgIHJldHVybiAtRUlOVkFMOwotICAgICAgICAgICAgfQotCi0gICAgICAgICAgICBTZXNzaW9uX0dldENvbmZpZyhlZmZlY3QtPnNlc3Npb24sIChlZmZlY3RfY29uZmlnX3QgKilwUmVwbHlEYXRhKTsKLSAgICAgICAgICAgIGJyZWFrOwotCi0gICAgICAgIGNhc2UgRUZGRUNUX0NNRF9TRVRfQ09ORklHX1JFVkVSU0U6Ci0gICAgICAgICAgICBpZiAocENtZERhdGEgPT0gTlVMTCB8fAotICAgICAgICAgICAgICAgIGNtZFNpemUgIT0gc2l6ZW9mKGVmZmVjdF9jb25maWdfdCkgfHwKLSAgICAgICAgICAgICAgICBwUmVwbHlEYXRhID09IE5VTEwgfHwKLSAgICAgICAgICAgICAgICAqcmVwbHlTaXplICE9IHNpemVvZihpbnQpKSB7Ci0gICAgICAgICAgICAgICAgQUxPR1YoIlByZVByb2Nlc3NpbmdGeF9Db21tYW5kIGNtZENvZGUgQ2FzZTogIgotICAgICAgICAgICAgICAgICAgICAgICAgIkVGRkVDVF9DTURfU0VUX0NPTkZJR19SRVZFUlNFOiBFUlJPUiIpOwotICAgICAgICAgICAgICAgIHJldHVybiAtRUlOVkFMOwotICAgICAgICAgICAgfQotICAgICAgICAgICAgKihpbnQgKilwUmVwbHlEYXRhID0gU2Vzc2lvbl9TZXRSZXZlcnNlQ29uZmlnKGVmZmVjdC0+c2Vzc2lvbiwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoZWZmZWN0X2NvbmZpZ190ICopcENtZERhdGEpOwotICAgICAgICAgICAgaWYgKCooaW50ICopcFJlcGx5RGF0YSAhPSAwKSB7Ci0gICAgICAgICAgICAgICAgYnJlYWs7Ci0gICAgICAgICAgICB9Ci0gICAgICAgICAgICBicmVhazsKLQotICAgICAgICBjYXNlIEVGRkVDVF9DTURfR0VUX0NPTkZJR19SRVZFUlNFOgotICAgICAgICAgICAgaWYgKHBSZXBseURhdGEgPT0gTlVMTCB8fAotICAgICAgICAgICAgICAgICpyZXBseVNpemUgIT0gc2l6ZW9mKGVmZmVjdF9jb25maWdfdCkpewotICAgICAgICAgICAgICAgIEFMT0dWKCJQcmVQcm9jZXNzaW5nRnhfQ29tbWFuZCBjbWRDb2RlIENhc2U6ICIKLSAgICAgICAgICAgICAgICAgICAgICAgICJFRkZFQ1RfQ01EX0dFVF9DT05GSUdfUkVWRVJTRTogRVJST1IiKTsKLSAgICAgICAgICAgICAgICByZXR1cm4gLUVJTlZBTDsKLSAgICAgICAgICAgIH0KLSAgICAgICAgICAgIFNlc3Npb25fR2V0UmV2ZXJzZUNvbmZpZyhlZmZlY3QtPnNlc3Npb24sIChlZmZlY3RfY29uZmlnX3QgKilwQ21kRGF0YSk7Ci0gICAgICAgICAgICBicmVhazsKLQotICAgICAgICBjYXNlIEVGRkVDVF9DTURfUkVTRVQ6Ci0gICAgICAgICAgICBpZiAoZWZmZWN0LT5vcHMtPnJlc2V0KSB7Ci0gICAgICAgICAgICAgICAgZWZmZWN0LT5vcHMtPnJlc2V0KGVmZmVjdCk7Ci0gICAgICAgICAgICB9Ci0gICAgICAgICAgICBicmVhazsKLQotICAgICAgICBjYXNlIEVGRkVDVF9DTURfR0VUX1BBUkFNOnsKLSAgICAgICAgICAgIGlmIChwQ21kRGF0YSA9PSBOVUxMIHx8Ci0gICAgICAgICAgICAgICAgICAgIGNtZFNpemUgPCAoaW50KXNpemVvZihlZmZlY3RfcGFyYW1fdCkgfHwKLSAgICAgICAgICAgICAgICAgICAgcFJlcGx5RGF0YSA9PSBOVUxMIHx8Ci0gICAgICAgICAgICAgICAgICAgICpyZXBseVNpemUgPCAoaW50KXNpemVvZihlZmZlY3RfcGFyYW1fdCkpewotICAgICAgICAgICAgICAgIEFMT0dWKCJQcmVQcm9jZXNzaW5nRnhfQ29tbWFuZCBjbWRDb2RlIENhc2U6ICIKLSAgICAgICAgICAgICAgICAgICAgICAgICJFRkZFQ1RfQ01EX0dFVF9QQVJBTTogRVJST1IiKTsKLSAgICAgICAgICAgICAgICByZXR1cm4gLUVJTlZBTDsKLSAgICAgICAgICAgIH0KLSAgICAgICAgICAgIGVmZmVjdF9wYXJhbV90ICpwID0gKGVmZmVjdF9wYXJhbV90ICopcENtZERhdGE7Ci0KLSAgICAgICAgICAgIG1lbWNweShwUmVwbHlEYXRhLCBwQ21kRGF0YSwgc2l6ZW9mKGVmZmVjdF9wYXJhbV90KSArIHAtPnBzaXplKTsKLQotICAgICAgICAgICAgcCA9IChlZmZlY3RfcGFyYW1fdCAqKXBSZXBseURhdGE7Ci0KLSAgICAgICAgICAgIGludCB2b2Zmc2V0ID0gKChwLT5wc2l6ZSAtIDEpIC8gc2l6ZW9mKGludDMyX3QpICsgMSkgKiBzaXplb2YoaW50MzJfdCk7Ci0KLSAgICAgICAgICAgIGlmIChlZmZlY3QtPm9wcy0+Z2V0X3BhcmFtZXRlcikgewotICAgICAgICAgICAgICAgIHAtPnN0YXR1cyA9IGVmZmVjdC0+b3BzLT5nZXRfcGFyYW1ldGVyKGVmZmVjdCwgcC0+ZGF0YSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoc2l6ZV90ICAqKSZwLT52c2l6ZSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwLT5kYXRhICsgdm9mZnNldCk7Ci0gICAgICAgICAgICAgICAgKnJlcGx5U2l6ZSA9IHNpemVvZihlZmZlY3RfcGFyYW1fdCkgKyB2b2Zmc2V0ICsgcC0+dnNpemU7Ci0gICAgICAgICAgICB9Ci0gICAgICAgIH0gYnJlYWs7Ci0KLSAgICAgICAgY2FzZSBFRkZFQ1RfQ01EX1NFVF9QQVJBTTp7Ci0gICAgICAgICAgICBpZiAocENtZERhdGEgPT0gTlVMTHx8Ci0gICAgICAgICAgICAgICAgICAgIGNtZFNpemUgPCAoaW50KXNpemVvZihlZmZlY3RfcGFyYW1fdCkgfHwKLSAgICAgICAgICAgICAgICAgICAgcFJlcGx5RGF0YSA9PSBOVUxMIHx8Ci0gICAgICAgICAgICAgICAgICAgICpyZXBseVNpemUgIT0gc2l6ZW9mKGludDMyX3QpKXsKLSAgICAgICAgICAgICAgICBBTE9HVigiUHJlUHJvY2Vzc2luZ0Z4X0NvbW1hbmQgY21kQ29kZSBDYXNlOiAiCi0gICAgICAgICAgICAgICAgICAgICAgICAiRUZGRUNUX0NNRF9TRVRfUEFSQU06IEVSUk9SIik7Ci0gICAgICAgICAgICAgICAgcmV0dXJuIC1FSU5WQUw7Ci0gICAgICAgICAgICB9Ci0gICAgICAgICAgICBlZmZlY3RfcGFyYW1fdCAqcCA9IChlZmZlY3RfcGFyYW1fdCAqKSBwQ21kRGF0YTsKLQotICAgICAgICAgICAgaWYgKHAtPnBzaXplICE9IHNpemVvZihpbnQzMl90KSl7Ci0gICAgICAgICAgICAgICAgQUxPR1YoIlByZVByb2Nlc3NpbmdGeF9Db21tYW5kIGNtZENvZGUgQ2FzZTogIgotICAgICAgICAgICAgICAgICAgICAgICAgIkVGRkVDVF9DTURfU0VUX1BBUkFNOiBFUlJPUiwgcHNpemUgaXMgbm90IHNpemVvZihpbnQzMl90KSIpOwotICAgICAgICAgICAgICAgIHJldHVybiAtRUlOVkFMOwotICAgICAgICAgICAgfQotICAgICAgICAgICAgaWYgKGVmZmVjdC0+b3BzLT5zZXRfcGFyYW1ldGVyKSB7Ci0gICAgICAgICAgICAgICAgKihpbnQgKilwUmVwbHlEYXRhID0gZWZmZWN0LT5vcHMtPnNldF9wYXJhbWV0ZXIoZWZmZWN0LAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICh2b2lkICopcC0+ZGF0YSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwLT5kYXRhICsgcC0+cHNpemUpOwotICAgICAgICAgICAgfQotICAgICAgICB9IGJyZWFrOwotCi0gICAgICAgIGNhc2UgRUZGRUNUX0NNRF9FTkFCTEU6Ci0gICAgICAgICAgICBpZiAocFJlcGx5RGF0YSA9PSBOVUxMIHx8ICpyZXBseVNpemUgIT0gc2l6ZW9mKGludCkpewotICAgICAgICAgICAgICAgIEFMT0dWKCJQcmVQcm9jZXNzaW5nRnhfQ29tbWFuZCBjbWRDb2RlIENhc2U6IEVGRkVDVF9DTURfRU5BQkxFOiBFUlJPUiIpOwotICAgICAgICAgICAgICAgIHJldHVybiAtRUlOVkFMOwotICAgICAgICAgICAgfQotICAgICAgICAgICAgKihpbnQgKilwUmVwbHlEYXRhID0gRWZmZWN0X1NldFN0YXRlKGVmZmVjdCwgUFJFUFJPQ19FRkZFQ1RfU1RBVEVfQUNUSVZFKTsKLSAgICAgICAgICAgIGJyZWFrOwotCi0gICAgICAgIGNhc2UgRUZGRUNUX0NNRF9ESVNBQkxFOgotICAgICAgICAgICAgaWYgKHBSZXBseURhdGEgPT0gTlVMTCB8fCAqcmVwbHlTaXplICE9IHNpemVvZihpbnQpKXsKLSAgICAgICAgICAgICAgICBBTE9HVigiUHJlUHJvY2Vzc2luZ0Z4X0NvbW1hbmQgY21kQ29kZSBDYXNlOiBFRkZFQ1RfQ01EX0RJU0FCTEU6IEVSUk9SIik7Ci0gICAgICAgICAgICAgICAgcmV0dXJuIC1FSU5WQUw7Ci0gICAgICAgICAgICB9Ci0gICAgICAgICAgICAqKGludCAqKXBSZXBseURhdGEgID0gRWZmZWN0X1NldFN0YXRlKGVmZmVjdCwgUFJFUFJPQ19FRkZFQ1RfU1RBVEVfQ09ORklHKTsKLSAgICAgICAgICAgIGJyZWFrOwotCi0gICAgICAgIGNhc2UgRUZGRUNUX0NNRF9TRVRfREVWSUNFOgotICAgICAgICBjYXNlIEVGRkVDVF9DTURfU0VUX0lOUFVUX0RFVklDRToKLSAgICAgICAgICAgIGlmIChwQ21kRGF0YSA9PSBOVUxMIHx8Ci0gICAgICAgICAgICAgICAgY21kU2l6ZSAhPSBzaXplb2YodWludDMyX3QpKSB7Ci0gICAgICAgICAgICAgICAgQUxPR1YoIlByZVByb2Nlc3NpbmdGeF9Db21tYW5kIGNtZENvZGUgQ2FzZTogRUZGRUNUX0NNRF9TRVRfREVWSUNFOiBFUlJPUiIpOwotICAgICAgICAgICAgICAgIHJldHVybiAtRUlOVkFMOwotICAgICAgICAgICAgfQotCi0gICAgICAgICAgICBpZiAoZWZmZWN0LT5vcHMtPnNldF9kZXZpY2UpIHsKLSAgICAgICAgICAgICAgICBlZmZlY3QtPm9wcy0+c2V0X2RldmljZShlZmZlY3QsICoodWludDMyX3QgKilwQ21kRGF0YSk7Ci0gICAgICAgICAgICB9Ci0gICAgICAgICAgICBicmVhazsKLQotICAgICAgICBjYXNlIEVGRkVDVF9DTURfU0VUX1ZPTFVNRToKLSAgICAgICAgY2FzZSBFRkZFQ1RfQ01EX1NFVF9BVURJT19NT0RFOgotICAgICAgICAgICAgYnJlYWs7Ci0KLSAgICAgICAgZGVmYXVsdDoKLSAgICAgICAgICAgIHJldHVybiAtRUlOVkFMOwotICAgIH0KLSAgICByZXR1cm4gMDsKLX0KLQotCi1pbnQgUHJlUHJvY2Vzc2luZ0Z4X0dldERlc2NyaXB0b3IoZWZmZWN0X2hhbmRsZV90ICAgc2VsZiwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBlZmZlY3RfZGVzY3JpcHRvcl90ICpwRGVzY3JpcHRvcikKLXsKLSAgICBwcmVwcm9jX2VmZmVjdF90ICogZWZmZWN0ID0gKHByZXByb2NfZWZmZWN0X3QgKikgc2VsZjsKLQotICAgIGlmIChlZmZlY3QgPT0gTlVMTCB8fCBwRGVzY3JpcHRvciA9PSBOVUxMKSB7Ci0gICAgICAgIHJldHVybiAtRUlOVkFMOwotICAgIH0KLQotICAgIG1lbWNweShwRGVzY3JpcHRvciwgc0Rlc2NyaXB0b3JzW2VmZmVjdC0+cHJvY0lkXSwgc2l6ZW9mKGVmZmVjdF9kZXNjcmlwdG9yX3QpKTsKLQotICAgIHJldHVybiAwOwotfQotCi1pbnQgUHJlUHJvY2Vzc2luZ0Z4X1Byb2Nlc3NSZXZlcnNlKGVmZmVjdF9oYW5kbGVfdCAgICAgc2VsZiwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYXVkaW9fYnVmZmVyX3QgICAgKmluQnVmZmVyLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBhdWRpb19idWZmZXJfdCAgICAqb3V0QnVmZmVyKQotewotICAgIHByZXByb2NfZWZmZW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1lc1JldiA8IHNlc3Npb24tPmZyYW1lQ291bnQpIHsKLSAgICAgICAgICAgICAgICByZXR1cm4gMDsKLSAgICAgICAgICAgIH0KLSAgICAgICAgICAgIHNpemVfdCBmckluID0gc2Vzc2lvbi0+ZnJhbWVzUmV2OwotICAgICAgICAgICAgc2l6ZV90IGZyT3V0ID0gc2Vzc2lvbi0+YXBtRnJhbWVDb3VudDsKLSAgICAgICAgICAgIGlmIChzZXNzaW9uLT5pbkNoYW5uZWxDb3VudCA9PSAxKSB7Ci0gICAgICAgICAgICAgICAgc3BlZXhfcmVzYW1wbGVyX3Byb2Nlc3NfaW50KHNlc3Npb24tPnJldlJlc2FtcGxlciwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2Vzc2lvbi0+cmV2QnVmLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmZnJJbiwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2Vzc2lvbi0+cmV2RnJhbWUtPl9wYXlsb2FkRGF0YSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJmZyT3V0KTsKLSAgICAgICAgICAgIH0gZWxzZSB7Ci0gICAgICAgICAgICAgICAgc3BlZXhfcmVzYW1wbGVyX3Byb2Nlc3NfaW50ZXJsZWF2ZWRfaW50KHNlc3Npb24tPnJldlJlc2FtcGxlciwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2Vzc2lvbi0+cmV2QnVmLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmZnJJbiwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2Vzc2lvbi0+cmV2RnJhbWUtPl9wYXlsb2FkRGF0YSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJmZyT3V0KTsKLSAgICAgICAgICAgIH0KLSAgICAgICAgICAgIG1lbWNweShzZXNzaW9uLT5yZXZCdWYsCi0gICAgICAgICAgICAgICAgICAgc2Vzc2lvbi0+cmV2QnVmICsgZnJJbiAqIHNlc3Npb24tPmluQ2hhbm5lbENvdW50LAotICAgICAgICAgICAgICAgICAgIChzZXNzaW9uLT5mcmFtZXNSZXYgLSBmckluKSAqIHNlc3Npb24tPmluQ2hhbm5lbENvdW50ICogc2l6ZW9mKGludDE2X3QpKTsKLSAgICAgICAgICAgIHNlc3Npb24tPmZyYW1lc1JldiAtPSBmckluOwotICAgICAgICB9IGVsc2UgewotICAgICAgICAgICAgc2l6ZV90IGZyID0gc2Vzc2lvbi0+ZnJhbWVDb3VudCAtIHNlc3Npb24tPmZyYW1lc1JldjsKLSAgICAgICAgICAgIGlmIChpbkJ1ZmZlci0+ZnJhbWVDb3VudCA8IGZyKSB7Ci0gICAgICAgICAgICAgICAgZnIgPSBpbkJ1ZmZlci0+ZnJhbWVDb3VudDsKLSAgICAgICAgICAgIH0KLSAgICAgICAgICAgIG1lbWNweShzZXNzaW9uLT5yZXZGcmFtZS0+X3BheWxvYWREYXRhICsgc2Vzc2lvbi0+ZnJhbWVzUmV2ICogc2Vzc2lvbi0+aW5DaGFubmVsQ291bnQsCi0gICAgICAgICAgICAgICAgICAgaW5CdWZmZXItPnMxNiwKLSAgICAgICAgICAgICAgICAgICBmciAqIHNlc3Npb24tPmluQ2hhbm5lbENvdW50ICogc2l6ZW9mKGludDE2X3QpKTsKLSAgICAgICAgICAgIHNlc3Npb24tPmZyYW1lc1JldiArPSBmcjsKLSAgICAgICAgICAgIGluQnVmZmVyLT5mcmFtZUNvdW50ID0gZnI7Ci0gICAgICAgICAgICBpZiAoc2Vzc2lvbi0+ZnJhbWVzUmV2IDwgc2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XNzaW5nTGliX0NyZWF0ZShjb25zdCBlZmZlY3RfdXVpZF90ICp1dWlkLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgIGludDMyX3QgICAgICAgICAgICAgc2Vzc2lvbklkLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgIGludDMyX3QgICAgICAgICAgICAgaW9JZCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBlZmZlY3RfaGFuZGxlX3QgICpwSW50ZXJmYWNlKQotewotICAgIEFMT0dWKCJFZmZlY3RDcmVhdGU6IHV1aWQ6ICUwOHggc2Vzc2lvbiAlZCBJTzogJWQiLCB1dWlkLT50aW1lTG93LCBzZXNzaW9uSWQsIGlvSWQpOwotCi0gICAgaW50IHN0YXR1czsKLSAgICBjb25zdCBlZmZlY3RfZGVzY3JpcHRvcl90ICpkZXNjOwotICAgIHByZXByb2Nfc2Vzc2lvbl90ICpzZXNzaW9uOwotICAgIHVpbnQzMl90IHByb2NJZDsKLQotICAgIGlmIChQcmVQcm9jX0luaXQoKSAhPSAwKSB7Ci0gICAgICAgIHJldHVybiBzSW5pdFN0YXR1czsKLSAgICB9Ci0gICAgZGVzYyA9ICBQcmVQcm9jX0dldERlc2NyaXB0b3IodXVpZCk7Ci0gICAgaWYgKGRlc2MgPT0gTlVMTCkgewotICAgICAgICBBTE9HVygiRWZmZWN0Q3JlYXRlOiBmeCBub3QgZm91bmQgdXVpZDogJTA4eCIsIHV1aWQtPnRpbWVMb3cpOwotICAgICAgICByZXR1cm4gLUVJTlZBTDsKLSAgICB9Ci0gICAgcHJvY0lkID0gVXVpZFRvUHJvY0lkKCZkZXNjLT50eXBlKTsKLQotICAgIHNlc3Npb24gPSBQcmVQcm9jX0dldFNlc3Npb24ocHJvY0lkLCBzZXNzaW9uSWQsIGlvSWQpOwotICAgIGlmIChzZXNzaW9uID09IE5VTEwpIHsKLSAgICAgICAgQUxPR1coIkVmZmVjdENyZWF0ZTogbm8gbW9yZSBzZXNzaW9uIGF2YWlsYWJs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sdGVyOjpwcm9jZXNzX25vcm1hbF9tdWx0aTsKLSAgICAgIH0KLSAgICAgIGJyZWFrOwotICAgIH0KLSAgICBtU3RhdGUgPSBzdGF0ZTsKLX0KLQotYm9vbCBBdWRpb0JpcXVhZEZpbHRlcjo6dXBkYXRlQ29lZnMoY29uc3QgYXVkaW9fY29lZl90IGNvZWZzW05VTV9DT0VGU10sCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpbnQgZnJhbWVDb3VudCkgewotICAgIGludDY0X3QgbWF4RGVsdGEgPSBtTWF4RGVsdGEgKiBmcmFtZUNvdW50OwotICAgIGZvciAoaW50IGkgPSAwOyBpIDwgTlVNX0NPRUZTOyArK2kpIHsKLSAgICAgICAgaWYgKG1Db2VmRGlydHlCaXRzICYgKDE8PGkpKSB7Ci0gICAgICAgICAgICBhdWRpb19jb2VmX3QgZGlmZiA9IGNvZWZzW2ldIC0gbUNvZWZzW2ldOwotICAgICAgICAgICAgaWYgKGRpZmYgPiBtYXhEZWx0YSkgewotICAgICAgICAgICAgICAgIG1Db2Vmc1tpXSArPSBtYXhEZWx0YTsKLSAgICAgICAgICAgIH0gZWxzZSBpZiAoZGlmZiA8IC1tYXhEZWx0YSkgewotICAgICAgICAgICAgICAgIG1Db2Vmc1tpXSAtPSBtYXhEZWx0YTsKLSAgICAgICAgICAgIH0gZWxzZSB7Ci0gICAgICAgICAgICAgICAgbUNvZWZzW2ldID0gY29lZnNbaV07Ci0gICAgICAgICAgICAgICAgbUNvZWZEaXJ0eUJpdHMgXj0gKDE8PGkpOwotICAgICAgICAgICAgfQotICAgICAgICB9Ci0gICAgfQotICAgIHJldHVybiBtQ29lZkRpcnR5Qml0cyA9PSAwOwotfQotCi12b2lkIEF1ZGlvQmlxdWFkRmlsdGVyOjpwcm9jZXNzX2J5cGFzcyhjb25zdCBhdWRpb19zYW1wbGVfdCAqIGluLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYXVkaW9fc2Ft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ICBjb25zdCBhdWRpb19jb2VmX3QgYTIgPSBtQ29lZnNbNF07Ci0gICAgd2hpbGUgKG5GcmFtZXMtLSA+IDApIHsKLSAgICAgICAgYXVkaW9fc2FtcGxlX3QgeDAgPSAqKGluKyspOwotICAgICAgICBhdWRpb19jb2VmX3NhbXBsZV9hY2NfdCBhY2M7Ci0gICAgICAgIGFjYyA9IG11bF9jb2VmX3NhbXBsZShiMCwgeDApOwotICAgICAgICBhY2MgPSBtYWNfY29lZl9zYW1wbGUoYjEsIHgxLCBhY2MpOwotICAgICAgICBhY2MgPSBtYWNfY29lZl9zYW1wbGUoYjIsIHgyLCBhY2MpOwotICAgICAgICBhY2MgPSBtYWNfY29lZl9zYW1wbGUoYTEsIHkxLCBhY2MpOwotICAgICAgICBhY2MgPSBtYWNfY29lZl9zYW1wbGUoYTIsIHkyLCBhY2MpOwotICAgICAgICBhdWRpb19zYW1wbGVfdCB5MCA9IGNvZWZfc2FtcGxlX2FjY190b19zYW1wbGUoYWNjKTsKLSAgICAgICAgeTIgPSB5MTsKLSAgICAgICAgeTEgPSB5MDsKLSAgICAgICAgeDIgPSB4MTsKLSAgICAgICAgeDEgPSB4MDsKLSAgICAgICAgKCpvdXQrKykgPSB5MDsKLSAgICB9Ci0gICAgbURlbGF5c1swXVswXSA9IHgxOwotICAgIG1EZWxheXNbMF1bMV0gPSB4MjsKLSAgICBtRGVsYXlzWzBdWzJdID0geTE7Ci0gICAgbURlbGF5c1swXVszXSA9IHkyOwotfQotCi12b2lkIEF1ZGlvQmlxdWFkRmlsdGVyOjpwcm9jZXNzX3RyYW5zaXRpb25fbm9ybWFsX21vbm8oY29uc3QgYXVkaW9fc2FtcGxlX3QgKiBpbiwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBhdWRpb19zYW1wbGVfdCAqIG91dCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpbnQgZnJhbWVDb3VudCkgewotICAgIGlmICh1cGRhdGVDb2VmcyhtVGFyZ2V0Q29lZnMsIGZyYW1lQ291bnQpKSB7Ci0gICAgICAgIHNldFN0YXRlKFNUQVRFX05PUk1BTCk7Ci0gICAgfQotICAgIHByb2Nlc3Nfbm9ybWFsX21vbm8oaW4sIG91dCwgZnJhbWVDb3VudCk7Ci19Ci0KLXZvaWQgQXVkaW9CaXF1YWRGaWx0ZXI6OnByb2Nlc3NfdHJhbnNpdGlvbl9ieXBhc3NfbW9ubyhjb25zdCBhdWRpb19zYW1wbGVfdCAqIGluLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGF1ZGlvX3NhbXBsZV90ICogb3V0LAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGludCBmcmFtZUNvdW50KSAgewotICBpZiAodXBkYXRlQ29lZnMoSURFTlRJVFlfQ09FRlMsIGZyYW1lQ291bnQpKSB7Ci0gICAgICBzZXRTdGF0ZShTVEFURV9OT1JNQUwpOwotICB9Ci0gIHByb2Nlc3Nfbm9ybWFsX21vbm8oaW4sIG91dCwgZnJhbWVDb3VudCk7Ci19Ci0KLXZvaWQgQXVkaW9CaXF1YWRGaWx0ZXI6OnByb2Nlc3Nfbm9ybWFsX211bHRpKGNvbnN0IGF1ZGlvX3NhbXBsZV90ICogaW4sCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBhdWRpb19zYW1wbGVfdCAqIG91dCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGludCBmcmFtZUNvdW50KSB7Ci0gICAgY29uc3QgYXVkaW9fY29lZl90IGIwID0gbUNvZWZzWzBdOwotICAgIGNvbnN0IGF1ZGlvX2NvZWZfdCBiMSA9IG1Db2Vmc1sxXTsKLSAgICBjb25zdCBhdWRpb19jb2VmX3QgYjIgPSBtQ29lZnNb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ID0geDE7Ci0gICAgICAgICAgICB4MSA9IHgwOwotICAgICAgICAgICAgKm91dCA9IHkwOwotICAgICAgICAgICAgaW4gKz0gbU51bUNoYW5uZWxzOwotICAgICAgICAgICAgb3V0ICs9IG1OdW1DaGFubmVsczsKLSAgICAgICAgfQotICAgICAgICBtRGVsYXlzW2NoXVswXSA9IHgxOwotICAgICAgICBtRGVsYXlzW2NoXVsxXSA9IHgyOwotICAgICAgICBtRGVsYXlzW2NoXVsyXSA9IHkxOwotICAgICAgICBtRGVsYXlzW2NoXVszXSA9IHkyOwotICAgICAgICBpbiAtPSBmcmFtZUNvdW50ICogbU51bUNoYW5uZWxzIC0gMTsKLSAgICAgICAgb3V0IC09IGZyYW1lQ291bnQgKiBtTnVtQ2hhbm5lbHMgLSAxOwotICAgIH0KLX0KLQotdm9pZCBBdWRpb0JpcXVhZEZpbHRlcjo6cHJvY2Vzc190cmFuc2l0aW9uX25vcm1hbF9tdWx0aShjb25zdCBhdWRpb19zYW1wbGVfdCAqIGluLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBhdWRpb19zYW1wbGVfdCAqIG91dCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaW50IGZyYW1lQ291bnQpIHsKLSAgICBpZiAodXBkYXRlQ29lZnMobVRhcmdldENvZWZzLCBmcmFtZUNvdW50KSkgewotICAgICAgICBzZXRTdGF0ZShTVEFURV9OT1JNQUwpOwotICAgIH0KLSAgICBwcm9jZXNzX25vcm1hbF9tdWx0aShpbiwgb3V0LCBmcmFtZUNvdW50KTsKLX0KLQotdm9pZCBBdWRpb0JpcXVhZEZpbHRlcjo6cHJvY2Vzc190cmFuc2l0aW9uX2J5cGFzc19tdWx0aShjb25zdCBhdWRpb19zYW1wbGVfdCAqIGluLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBhdW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WQgewotCi1BdWRpb0NvZWZJbnRlcnBvbGF0b3I6OkF1ZGlvQ29lZkludGVycG9sYXRvcihzaXplX3QgbkluRGltcywKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbnN0IHNpemVfdCBpbkRpbXNbXSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNpemVfdCBuT3V0RGltcywKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbnN0IGF1ZGlvX2NvZWZfdCAqIHRhYmxlKSB7Ci0gICAgbU51bUluRGltcyA9IG5JbkRpbXM7Ci0gICAgbWVtY3B5KG1JbkRpbXMsIGluRGltcywgbkluRGltcyAqIHNpemVvZihzaXplX3QpKTsKLSAgICBtTnVtT3V0RGltcyA9IG5PdXREaW1zOwotICAgIG1UYWJsZSA9IHRhYmxlOwotICAgIC8vIEluaXRpYWxpemUgb2Zmc2V0cyBhcnJheQotICAgIHNpemVfdCBkaW0gPSBuSW5EaW1zIC0gMTsKLSAgICBtSW5EaW1PZmZzZXRzW25JbkRpbXMgLSAxXSA9IG5PdXREaW1zOwotICAgIHdoaWxlIChkaW0tLSA+IDApIHsKLSAgICAgICAgbUluRGltT2Zmc2V0c1tkaW1dID0gbUluRGltT2Zmc2V0c1tkaW0gKyAxXSAqIG1JbkRpbXNbZGltICsgMV07Ci0gICAgfQotfQotCi12b2lkIEF1ZGlvQ29lZkludGVycG9sYXRvcjo6Z2V0Q29lZihjb25zdCBpbnQgaW50Q29vcmRbXSwgdWludDMyX3QgZnJhY0Nvb3JkW10sCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBhdWRpb19jb2VmX3Qgb3V0W10pIHsKLSAgICBzaXplX3QgaW5kZXggPSAwOwotICAgIHNpemVfdCBkaW0gPSBtTnVtSW5EaW1zOwotICAgIHdoaWxlIChkaW0tLSA+IDApIHsKLSAgICAgICAgaWYgKENDX1VOTElLRUxZKGludENvb3JkW2RpbV0gPCAwKSkgewotICAgICAgICAgICAgZnJhY0Nvb3JkW2RpbV0gPSAwOwotICAgICAgICB9IGVsc2UgaWYgKENDX1VOTElLRUxZKGludENvb3JkW2RpbV0gPj0gKGludCltSW5EaW1zW2RpbV0gLSAxKSkgewotICAgICAgICAgICAgZnJhY0Nvb3JkW2RpbV0gPSAwOwotICAgICAgICAgICAgaW5kZXggKz0gbUluRGltT2Zmc2V0c1tkaW1dICogKG1JbkRpbXNbZGltXSAtIDEpOwotICAgICAgICB9IGVsc2UgewotICAgICAgICAgICAgaW5kZXggKz0gbUluRGltT2Zmc2V0c1tkaW1dICogaW50Q29vcmRbZGltXTsKLSAgICAgICAgfQotICAgIH0KLSAgICBnZXRDb2VmUmVjdXJzZShpbmRleCwgZnJhY0Nvb3JkLCBvdXQsIDApOwotfQotCi12b2lkIEF1ZGlvQ29lZkludGVycG9sYXRvcjo6Z2V0Q29lZlJlY3Vyc2Uoc2l6ZV90IGluZGV4LAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbnN0IHVpbnQzMl90IGZyYWNDb29yZFtdLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGF1ZGlvX2NvZWZfdCBvdXRbXSwgc2l6ZV90IGRpbSkgewotICAgIGlmIChkaW0gPT0gbU51bUluRGltcykgewotICAgICAgICBtZW1jcHkob3V0LCBtVGFibGUgKyBpbmRleCwgbU51bU91dERpbXMgKiBzaXplb2YoYXVkaW9fY29lZl90KSk7Ci0gICAgfSBlbHNlIHsKLSAgICAgICAgZ2V0Q29lZlJlY3Vyc2UoaW5kZXgsIGZyYWNDb29yZCwgb3V0LCBkaW0gKyAxKTsKLSAgICAgICAgaWYgKENDX0xJS0VMWShmcmFjQ29vcmQgIT0gMCkpIHsKLSAgICAgICAgICAgYXVkaW9fY29lZl90IHRlbXBDb2VmW01BWF9PVVRfRElNU107Ci0gICAgICAgICAgIGd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MzJfdCBmcmVxID0gbXBQZWFraW5nRmlsdGVyc1tpXS5nZXRGcmVxdWVuY3koKTsKLSAgICAgICAgaWYgKGZyZXEgPj0gdGFyZ2V0RnJlcSkgewotICAgICAgICAgICAgaGlnaCA9IGZyZXE7Ci0gICAgICAgICAgICBiYW5kID0gaTsKLSAgICAgICAgICAgIGJyZWFrOwotICAgICAgICB9Ci0gICAgICAgIGxvdyA9IGZyZXE7Ci0gICAgfQotICAgIC8vIE5vdywgbG93IGlzIHJpZ2h0IGJlbG93IHRoZSB0YXJnZXQgYW5kIGhpZ2ggaXMgcmlnaHQgYWJvdmUuIFNlZSB3aGljaCBvbmUKLSAgICAvLyBpcyBjbG9zZXIgb24gYSBsb2cgc2NhbGUuCi0gICAgbG93ID0gRWZmZWN0c19sb2cyKGxvdyk7Ci0gICAgaGlnaCA9IEVmZmVjdHNfbG9nMihoaWdoKTsKLSAgICB0YXJnZXRGcmVxID0gRWZmZWN0c19sb2cyKHRhcmdldEZyZXEpOwotICAgIGlmIChoaWdoIC0gdGFyZ2V0RnJlcSA8IHRhcmdldEZyZXEgLSBsb3cpIHsKLSAgICAgICAgcmV0dXJuIGJhbmQgKyAxOwotICAgIH0gZWxzZSB7Ci0gICAgICAgIHJldHVybiBiYW5kOwotICAgIH0KLX0KLQotCi1BdWRpb0VxdWFsaXplcjo6QXVkaW9FcXVhbGl6ZXIodm9pZCAqIHBNZW0sIGludCBuQmFuZHMsIGludCBuQ2hhbm5lbHMsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaW50IHNhbXBsZVJhdGUsIGJvb2wgb3duTWVtLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbnN0IFByZXNldENvbmZpZyAqIHByZXNldHMsIGludCBuUHJlc2V0cykKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA6IG1TYW1wbGVSYXRlKHNhbXBsZVJhdGUpCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLCBtcFByZXNldH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W50IGFuZCBpcyBub3QgY29waWVkLiBJdAotICAgIC8vICAgICAgICAgICAgICBtdXN0IGJlIGtlcHQgdmFsaWQgYnkgdGhlIGNsaWVudCBhcyBsb25nIGFzIHRoZSBpbnN0YW5jZSBpcwotICAgIC8vICAgICAgICAgICAgICBhbGl2ZS4KLSAgICAvLyBuUHJlc2V0cyAgICAgTnVtYmVyIG9mIGVsZW1lbnRzIGluIHRoZSBwcmVzZXRzIGFycmF5LgotICAgIC8vIHJldHVybnMgICAgICBUaGUgaW5zdGFuY2UgaWYgc3VjY2Vzcy4gTlVMTCBpZiBwTWVtIGlzIE5VTEwgYW5kIGFsbG9jYXRpb24KLSAgICAvLyAgICAgICAgICAgICAgZmFpbGVkLgotICAgIHN0YXRpYyBBdWRpb0VxdWFsaXplciAqIENyZWF0ZUluc3RhbmNlKHZvaWQgKiBwTWVtLCBpbnQgbkJhbmRzLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGludCBuQ2hhbm5lbHMsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaW50IHNhbXBsZVJhdGUsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY29uc3QgUHJlc2V0Q29uZmlnICogcHJlc2V0cywKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpbnQgblByZXNldHMpOwotCi0gICAgLy8gUmVjb25maWd1cmF0aW9uIG9mIHRoZSBmaWx0ZXIuIENoYW5nZXMgaW5wdXQvb3V0cHV0IGZvcm1hdCwgYnV0IGRvZXMgbm90Ci0gICAgLy8gYWx0ZXIgY3VycmVudCBwYXJhbWV0ZXIgdmFsdWVzLiBDYXVzZXMgcmVzZXQgb2YgdGhlIGRlbGF5IGxpbmVzLgotICAgIC8vIG5DaGFubmVscyAgTnVtYmVyIG9mIGlucHV0L291dHB1dCBjaGFubmVscyAoaW50ZXJsYWNlZCkuCi0gICAgLy8gc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bnQzMl90IG5TYW1wbGVzQ2hhbm5lbHMgPSBudW1TYW1wbGVzSXRlciAqIG1OdW1DaGFubmVsczsKLSAgICAgICAgICAgIGlmIChtUGNtRm9ybWF0ID09IEFVRElPX0ZPUk1BVF9QQ01fOF8yNF9CSVQpIHsKLSAgICAgICAgICAgICAgICBpZiAobUJlaGF2aW9yID09IEVGRkVDVF9CVUZGRVJfQUNDRVNTX1dSSVRFKSB7Ci0gICAgICAgICAgICAgICAgICAgIG1wUHJvY2Vzc29yLT5wcm9jZXNzKAotICAgICAgICAgICAgICAgICAgICAgICAgcmVpbnRlcnByZXRfY2FzdDxjb25zdCBhdWRpb19zYW1wbGVfdCAqPiAocEluKSwKLSAgICAgICAgICAgICAgICAgICAgICAgIHJlaW50ZXJwcmV0X2Nhc3Q8YXVkaW9fc2FtcGxlX3QgKj4gKHBPdXQpLAotICAgICAgICAgICAgICAgICAgICAgICAgbnVtU2FtcGxlc0l0ZXIpOwotICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAobUJlaGF2aW9yID09IEVGRkVDVF9CVUZGRVJfQUNDRVNTX0FDQ1VNVUxBVEUpIHsKLSAgICAgICAgICAgICAgICAgICAgbXBQcm9jZXNzb3ItPnByb2Nlc3MoCi0gICAgICAgICAgICAgICAgICAgICAgICByZWludGVycHJldF9jYXN0PGNvbnN0IGF1ZGlvX3NhbXBsZV90ICo+IChwSW4pLAotICAgICAgICAgICAgICAgICAgICAgICAgbUJ1ZmZlciwgbnVtU2FtcGxlc0l0ZXIpOwotICAgICAgICAgICAgICAgICAgICBNaXhPdXRwdXQocE91dCwgbnVtU2FtcGxlc0l0ZXIpOwotICAgICAgICAgICAgICAgIH0gZWxzZSB7Ci0gICAgICAgICAgICAgICAgICAgIGFzc2VydChmYWxzZSk7Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgIHBJbiA9IHJlaW50ZXJwcmV0X2Nhc3Q8Y29uc3QgYXVkaW9fc2FtcGxlX3QgKj4gKHBJbikKLSAgICAgICAgICAgICAgICAgICAgICAgICsgblNhbXBsZXNDaGFubmVsczsKLSAgICAgICAgICAgICAgICBwT3V0ID0gcmVpbnRlcnByZXRfY2FzdDxhdWRpb19zYW1wbGVfdCAqPiAocE91dCkKLSAgICAgICAgICAgICAgICAgICAgICAgICsgblNhbXBsZXNDaGFubmVsczsKLSAgICAgICAgICAgIH0gZWxzZSB7Ci0gICAgICAgICAgICAgICAgQ29udmVydElucHV0KHBJbiwgblNhbXBsZXNDaGFubmVscyk7Ci0gICAgICAgICAgICAgICAgbXBQcm9jZXNzb3ItPnByb2Nlc3MobUJ1ZmZlciwgbUJ1ZmZlciwgbnVtU2FtcGxlc0l0ZXIpOwotICAgICAgICAgICAgICAgIENvbnZlcnRPdXRwdXQocE91dCwgblNhbXBsZXNDaGFubmVscyk7Ci0gICAgICAgICAgICB9Ci0gICAgICAgICAgICBudW1TYW1wbGVzIC09IG51bVNhbXBsZXNJdGVyOwotICAgICAgICB9Ci0gICAgfQotCi1wcml2YXRlOgotICAgIC8vIFRoZSB1bmRlcmx5aW5nIHByb2Nlc3Nvci4KLSAgICBUICogbXBQcm9jZXNzb3I7Ci0gICAgLy8gVGhlIG51bWJlciBvZiBpbnB1dC9vdXRwdXQgY2hhbm5lbHMuCi0gICAgaW50IG1OdW1DaGFubmVsczsKLSAgICAvLyBUaGUgZGVzaXJlZCBQQ00gZm9ybWF0LgotICAgIHVpbnQ4X3QgbVBjbUZvcm1hdDsKLSAgICAvLyBUaGUgZGVzaXJlZCBidWZmZXIgYmVoYXZpb3IuCi0gICAgdWludDMyX3QgbUJlaGF2aW9yOwotICAgIC8vIEFuIGludGVybWVkaWF0ZSBidWZmZXIgZm9yIHByb2Nlc3NpbmcuCi0gICAgYXVkaW9fc2FtcGxlX3QgbUJ1ZmZlcltidWZTaXplXTsKLSAgICAvLyBUaGUgYnVmZmVyIHNpemUsIGRpdmlkZWQgYnkgdGhlIG51bWJlciBvZiBjaGFubmVscyAtIHJlcHJlc2Vud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AvKiBlbmQgRWZmZWN0UXVlcnlOZXh0ICovCi0KLWV4dGVybiAiQyIgaW50IEVmZmVjdENyZWF0ZShjb25zdCBlZmZlY3RfdXVpZF90ICp1dWlkLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgIGludDMyX3Qgc2Vzc2lvbklkLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgIGludDMyX3QgaW9JZCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBlZmZlY3RfaGFuZGxlX3QgKnBIYW5kbGUpIHsKLSAgICBpbnQgcmV0OwotICAgIGludCBpOwotCi0gICAgQUxPR1YoIkVmZmVjdExpYkNyZWF0ZUVmZmVjdCBzdGFydCIpOwotCi0gICAgaWYgKHBIYW5kbGUgPT0gTlVMTCB8fCB1dWlkID09IE5VTEwpIHsKLSAgICAgICAgcmV0dXJuIC1FSU5WQUw7Ci0gICAgfQotCi0gICAgaWYgKG1lbWNtcCh1dWlkLCAmZ0VxdWFsaXplckRlc2NyaXB0b3IudXVpZCwgc2l6ZW9mKGVmZmVjdF91dWlkX3QpKSAhPSAwKSB7Ci0gICAgICAgIHJldHVybiAtRUlOVkFMOwotICAgIH0KLQotICAgIEVxdWFsaXplckNvbnRleHQgKnBDb250ZXh0ID0gbmV3IEVxdWFsaXplckNvbnRleHQ7Ci0KLSAgICBwQ29udGV4dC0+aXRmZSA9ICZnRXF1YWxpemVySW50ZXJmYWNlOwotICAgIHBDb250ZXh0LT5wRXF1YWxpemVyID0gTlVMTDsKLSAgICBwQ29udGV4dC0+c3RhdGUgPSBFUVVBTElaRVJfU1RBVEVfVU5JTklUSUFMSVpFRDsKLQotICAgIHJldCA9IEVxdWFsaXplcl9pbml0KHBDb250ZXh0KTsKLSAgICBpZiAocmV0IDwgMCkgewotICAgICAgICBBTE9HVygiRWZmZWN0TGliQ3JlYXRlRWZmZWN0KCkgaW5pdCBmYWlsZWQiKTsKLSAgICAgICAgZGVsZXRlIHBDb250ZXh0OwotICAgICAgICByZXR1cm4gc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ci0gICAgICAgIH0KLSAgICAgICAgKnBWYWx1ZVNpemUgPSBzaXplb2YoaW50MzJfdCk7Ci0gICAgICAgIGJyZWFrOwotCi0gICAgY2FzZSBFUV9QQVJBTV9HRVRfUFJFU0VUX05BTUU6Ci0gICAgICAgIGJyZWFrOwotCi0gICAgY2FzZSBFUV9QQVJBTV9QUk9QRVJUSUVTOgotICAgICAgICBpZiAoKnBWYWx1ZVNpemUgPCAoMiArIGtOdW1CYW5kcykgKiBzaXplb2YodWludDE2X3QpKSB7Ci0gICAgICAgICAgICByZXR1cm4gLUVJTlZBTDsKLSAgICAgICAgfQotICAgICAgICAqcFZhbHVlU2l6ZSA9ICgyICsga051bUJhbmRzKSAqIHNpemVvZih1aW50MTZfdCk7Ci0gICAgICAgIGJyZWFrOwotCi0gICAgZGVmYXVsdDoKLSAgICAgICAgcmV0dXJuIC1FSU5WQUw7Ci0gICAgfQotCi0gICAgc3dpdGNoIChwYXJhbSkgewotICAgIGNhc2UgRVFfUEFSQU1fTlVNX0JBTkRTOgotICAgICAgICAqKHVpbnQxNl90ICopcFZhbHVlID0gKHVpbnQxNl90KWtOdW1CYW5kczsKLSAgICAgICAgQUxPR1YoIkVxdWFsaXplcl9nZXRQYXJhbWV0ZXIoKSBFUV9QQVJBTV9OVU1fQkFORFMgJWQiLCAqKGludDE2X3QgKilwVmFsdWUpOwotICAgICAgICBicmVhazsKLQotICAgIGNhc2UgRVFfUEFSQU1fTEVWRUxfUkFOR0U6Ci0gICAgICAgICooaW50MTZfdCAqKXBWYWx1ZSA9IC05NjAwOwotICAgICAgICAqKChpbnQxNl90ICopcFZhbHVlICsgMSkgPSA0ODAwOwotICAgICAgICBBTE9HVigiRXF1YWxpemVyX2dldFBhcmFtZXRlcigpIEVRX1BBUkFNX0xFVkVMX1JBTkdFIG1pbiAlZCwgbWF4ICVkIiwKLSAgICAgICAgICAgICAqKGludDMyX3QgKilwVmFsdWUsICooKGludDMyX3QgKilwVmFsdWUgKyAxKSk7Ci0g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ZCA9ICAqcFBhcmFtOwotICAgICAgICBsZXZlbCA9IChpbnQzMl90KSgqKGludDE2X3QgKilwVmFsdWUpOwotICAgICAgICBBTE9HVigic2V0UGFyYW1ldGVyKCkgRVFfUEFSQU1fQkFORF9MRVZFTCBiYW5kICVkLCBsZXZlbCAlZCIsIGJhbmQsIGxldmVsKTsKLSAgICAgICAgaWYgKGJhbmQgPj0ga051bUJhbmRzKSB7Ci0gICAgICAgICAgICBzdGF0dXMgPSAtRUlOVkFMOwotICAgICAgICAgICAgYnJlYWs7Ci0gICAgICAgIH0KLSAgICAgICAgcEVxdWFsaXplci0+c2V0R2FpbihiYW5kLCBsZXZlbCk7Ci0gICAgICAgIHBFcXVhbGl6ZXItPmNvbW1pdCh0cnVlKTsKLSAgICAgICBicmVhazsKLSAgICBjYXNlIEVRX1BBUkFNX1BST1BFUlRJRVM6IHsKLSAgICAgICAgQUxPR1YoInNldFBhcmFtZXRlcigpIEVRX1BBUkFNX1BST1BFUlRJRVMiKTsKLSAgICAgICAgaW50MTZfdCAqcCA9IChpbnQxNl90ICopcFZhbHVlOwotICAgICAgICBpZiAoKGludClwWzBdID49IHBFcXVhbGl6ZXItPmdldE51bVByZXNldHMoKSkgewotICAgICAgICAgICAgc3RhdHVzID0gLUVJTlZBTDsKLSAgICAgICAgICAgIGJyZWFrOwotICAgICAgICB9Ci0gICAgICAgIGlmIChwWzBdID49IDApIHsKLSAgICAgICAgICAgIHBFcXVhbGl6ZXItPnNldFByZXNldCgoaW50KXBbMF0pOwotICAgICAgICB9IGVsc2UgewotICAgICAgICAgICAgaWYgKChpbnQpcFsxXSAhPSBrTnVtQmFuZHMpIHsKLSAgICAgICAgICAgICAgICBzdGF0dXMgPSAtRUlOVkFMOwotICAgICAgICAgICAgICAgIGJyZWFrOwotICAgICAgICAgICAgfQotICAgICAgICAgICAgZm9yIChpbnQgaSA9IDA7IGkgPCBrTnVtQmFuZHM7IGkrKykgewotICAgICAgICAgICAgICAgIHBFcXVhbGl6ZX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l6ZXJfY29tbWFuZCBFRkZFQ1RfQ01EX0dFVF9QQVJBTSAqcENtZERhdGEgJWQsICpyZXBseVNpemUgJWQsICpwUmVwbHlEYXRhICUwOHggJTA4eCIsCi0gICAgICAgICAgICAgICAgKihpbnQzMl90ICopKChjaGFyICopcENtZERhdGEgKyBzaXplb2YoZWZmZWN0X3BhcmFtX3QpKSwgKnJlcGx5U2l6ZSwKLSAgICAgICAgICAgICAgICAqKGludDMyX3QgKikoKGNoYXIgKilwUmVwbHlEYXRhICsgc2l6ZW9mKGVmZmVjdF9wYXJhbV90KSArIHZvZmZzZXQpLAotICAgICAgICAgICAgICAgICooaW50MzJfdCAqKSgoY2hhciAqKXBSZXBseURhdGEgKyBzaXplb2YoZWZmZWN0X3BhcmFtX3QpICsgdm9mZnNldCArIHNpemVvZihpbnQzMl90KSkpOwotCi0gICAgICAgIH0gYnJlYWs7Ci0gICAgY2FzZSBFRkZFQ1RfQ01EX1NFVF9QQVJBTTogewotICAgICAgICBBTE9HVigiRXF1YWxpemVyX2NvbW1hbmQgRUZGRUNUX0NNRF9TRVRfUEFSQU0gY21kU2l6ZSAlZCBwQ21kRGF0YSAlcCwgKnJlcGx5U2l6ZSAlZCwgcFJlcGx5RGF0YSAlcCIsCi0gICAgICAgICAgICAgY21kU2l6ZSwgcENtZERhdGEsICpyZXBseVNpemUsIHBSZXBseURhdGEpOwotICAgICAgICBpZiAocENtZERhdGEgPT0gTlVMTCB8fCBjbWRTaXplIDwgKGludCkoc2l6ZW9mKGVmZmVjdF9wYXJhbV90KSArIHNpemVvZihpbnQzMl90KSkgfHwKLSAgICAgICAgICAgIHBSZXBseURhdGEgPT0gTlVMTCB8fCAqcmVwbHlTaXplICE9IHNpemVvZihpbnQzMl90KSkgewotICAgICAgICAgICAgcmV0dXJuIC1FSU5WQUw7Ci0gICAgICAgIH0KLSAgICAgICAgZWZmZWN0X3BhcmFtX3QgKnAgPSAoZWZmZWN0X3BhcmFtX3QgKikgcENtZERhdGE7Ci0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j0gMjsKLSAgICAgICAgICAgICAgICB3aGlsZSAoY291bnQtLSkgewotICAgICAgICAgICAgICAgICAgICAqcERzdCsrID0gKnBTcmMrKzsKLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICB9IGVsc2UgewotICAgICAgICAgICAgICAgIHdoaWxlIChjb3VudC0tKSB7Ci0gICAgICAgICAgICAgICAgICAgIHNtcCA9ICpwU3JjKys7Ci0gICAgICAgICAgICAgICAgICAgICpwRHN0KysgPSBzbXA7Ci0gICAgICAgICAgICAgICAgICAgICpwRHN0KysgPSBzbXA7Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgfQotICAgICAgICB9Ci0gICAgICAgIHJldHVybiAwOwotICAgIH0KLQotICAgIGlmIChwUmV2ZXJiLT5tX25OZXh0Um9vbSAhPSBwUmV2ZXJiLT5tX25DdXJyZW50Um9vbSkgewotICAgICAgICBSZXZlcmJVcGRhdGVSb29tKHBSZXZlcmIsIHRydWUpOwotICAgIH0KLQotICAgIHBTcmMgPSBpbkJ1ZmZlci0+czE2OwotICAgIHBEc3QgPSBvdXRCdWZmZXItPnMxNjsKLSAgICBzaXplX3QgbnVtU2FtcGxlcyA9IG91dEJ1ZmZlci0+ZnJhbWVDb3VudDsKLSAgICB3aGlsZSAobnVtU2FtcGxlcykgewotICAgICAgICB1aW50MzJfdCBwcm9jZXNzZWRTYW1wbGVzOwotICAgICAgICBpZiAobnVtU2FtcGxlcyA+ICh1aW50MzJfdCkgcFJldmVyYi0+bV9uVXBkYXRlUGVyaW9kSW5TYW1wbGVzKSB7Ci0gICAgICAgICAgICBwcm9jZXNzZWRTYW1wbGVzID0gKHVpbnQzMl90KSBwUmV2ZXJiLT5tX25VcGRhdGVQZXJpb2RJblNhbXBsZXM7Ci0gICAgICAgIH0gZWxzZSB7Ci0gICAgICAgICAgICBwcm9jZXNzZWRTYW1wbGVzID0gbnVtU2FtcGxlczsKLSAgICAgICAgfQotCi0gICAgICAgIC8qIGluY3JlbWVudCB1c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U19ERUxBWToKLSAgICAgICAgY2FzZSBSRVZFUkJfUEFSQU1fUkVWRVJCX0RFTEFZOgotICAgICAgICAgICAgc2l6ZSA9IHNpemVvZihpbnQzMl90KTsKLSAgICAgICAgICAgIGJyZWFrOwotCi0gICAgICAgIGNhc2UgUkVWRVJCX1BBUkFNX1BST1BFUlRJRVM6Ci0gICAgICAgICAgICBzaXplID0gc2l6ZW9mKHRfcmV2ZXJiX3NldHRpbmdzKTsKLSAgICAgICAgICAgIGJyZWFrOwotCi0gICAgICAgIGRlZmF1bHQ6Ci0gICAgICAgICAgICByZXR1cm4gLUVJTlZBTDsKLSAgICAgICAgfQotCi0gICAgICAgIGlmICgqcFNpemUgPCBzaXplKSB7Ci0gICAgICAgICAgICByZXR1cm4gLUVJTlZBTDsKLSAgICAgICAgfQotCi0gICAgICAgIHBWYWx1ZTMyID0gKGludDMyX3QgKikgcFZhbHVlOwotICAgICAgICBwVmFsdWUxNiA9IChpbnQxNl90ICopIHBWYWx1ZTsKLSAgICAgICAgcFByb3BlcnRpZXMgPSAodF9yZXZlcmJfc2V0dGluZ3MgKikgcFZhbHVlOwotCi0gICAgICAgIHN3aXRjaCAocGFyYW0pIHsKLSAgICAgICAgY2FzZSBSRVZFUkJfUEFSQU1fQllQQVNTOgotICAgICAgICAgICAgKnBWYWx1ZTMyID0gKGludDMyX3QpIHBSZXZlcmItPm1fYkJ5cGFzczsKLSAgICAgICAgICAgIGJyZWFrOwotCi0gICAgICAgIGNhc2UgUkVWRVJCX1BBUkFNX1BST1BFUlRJRVM6Ci0gICAgICAgICAgICBwVmFsdWUxNiA9ICZwUHJvcGVydGllcy0+cm9vbUxldmVsOwotICAgICAgICAgICAgLyogRkFMTCBUSFJPVUdIICovCi0KLSAgICAgICAgY2FzZSBSRVZFUkJfUEFSQU1fUk9PTV9MRVZFTDoKLSAgICAgICAgICAgIC8vIENvbnZlcnQgbV9uUm9vbUxwZkZ3ZCB0byBtaWxsaWJlbHMKLSAgICAgICAgICAgIH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mIChwUmV2ZXJiLT5tX25SdmJMcGZGYmsgPT0gMCkgewotICAgICAgICAgICAgICAgICpwVmFsdWUxNiA9IDEwMDA7Ci0gICAgICAgICAgICAgICAgQUxPR1YoImdldCBSRVZFUkJfUEFSQU1fREVDQVlfSEZfUkFUSU8sIHBSZXZlcmItPm1fblJ2YkxwZkZiayA9PSAwLCByYXRpbyAlZCIsICpwVmFsdWUxNik7Ci0gICAgICAgICAgICB9IGVsc2UgewotICAgICAgICAgICAgICAgIHRlbXAgPSBNVUxUX0VHMV9FRzEocFJldmVyYi0+bV9uUnZiTHBmRmJrLCBwUmV2ZXJiLT5tX25SdmJMcGZGYmspOwotICAgICAgICAgICAgICAgIHRlbXAyID0gTVVMVF9FRzFfRUcxKHBSZXZlcmItPm1fblJ2YkxwZkZiaywgcFJldmVyYi0+bV9uQ29zV1RfNUtIeikKLSAgICAgICAgICAgICAgICAgICAgICAgIDw8IDE7Ci0gICAgICAgICAgICAgICAgdGVtcCA9IDMyNzY3ICsgdGVtcCAtIHRlbXAyOwotICAgICAgICAgICAgICAgIHRlbXAgPSBFZmZlY3RzX1NxcnQodGVtcCkgKiAxODE7Ci0gICAgICAgICAgICAgICAgdGVtcCA9IChwUmV2ZXJiLT5tX25SdmJMcGZGd2QgPDwgMTUpIC8gdGVtcDsKLSAgICAgICAgICAgICAgICAvLyBUaGUgbGluZWFyIGdhaW4gYXQgMEh6IGlzIGIwIC8gKGExICsgMSkKLSAgICAgICAgICAgICAgICB0ZW1wMiA9IChwUmV2ZXJiLT5tX25SdmJMcGZGd2QgPDwgMTUpIC8gKDMyNzY3Ci0gICAgICAgICAgICAgICAgICAgICAgICAtIHBSZXZlcmItPm1fblJ2YkxwZkZiayk7Ci0KLSAgICAgICAgICAgICAgICB0ZW1wID0gRWZmZWN0c19MaW5lYXIxNlRvTWlsbGliZWxzKHRlbXApOwotICAgICAgICAgICAgICAgIHRlbXAyID0gRWZmZWN0c19MaW5lYXIxNlRvTWlsbGliZWxzKHRlbX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gICAgICAgICAgICAgLyBBUDBfR0FJTl9SQU5HRSk7Ci0KLSAgICAgICAgICAgIGlmICh0ZW1wIDwgMCkKLSAgICAgICAgICAgICAgICB0ZW1wID0gMDsKLSAgICAgICAgICAgIGlmICh0ZW1wID4gMTAwMCkKLSAgICAgICAgICAgICAgICB0ZW1wID0gMTAwMDsKLQotICAgICAgICAgICAgKnBWYWx1ZTE2ID0gdGVtcDsKLSAgICAgICAgICAgIEFMT0dWKCJnZXQgUkVWRVJCX1BBUkFNX0RJRkZVU0lPTiwgJWQsIEFQMCBnYWluICVkIiwgKnBWYWx1ZTE2LCBwUmV2ZXJiLT5tX3NBcDAubV9uQXBHYWluKTsKLQotICAgICAgICAgICAgaWYgKHBhcmFtID09IFJFVkVSQl9QQVJBTV9ESUZGVVNJT04pIHsKLSAgICAgICAgICAgICAgICBicmVhazsKLSAgICAgICAgICAgIH0KLSAgICAgICAgICAgIHBWYWx1ZTE2ID0gJnBQcm9wZXJ0aWVzLT5kZW5zaXR5OwotICAgICAgICAgICAgLyogRkFMTCBUSFJPVUdIICovCi0KLSAgICAgICAgY2FzZSBSRVZFUkJfUEFSQU1fREVOU0lUWToKLSAgICAgICAgICAgIC8vIENhbGN1bGF0ZSBBUCBkZWxheSBpbiB0aW1lIHVuaXRzCi0gICAgICAgICAgICB0ZW1wID0gKChwUmV2ZXJiLT5tX3NBcDAubV96QXBPdXQgLSBwUmV2ZXJiLT5tX3NBcDAubV96QXBJbikgPDwgMTYpCi0gICAgICAgICAgICAgICAgICAgIC8gcFJldmVyYi0+bV9uU2FtcGxpbmdSYXRlOwotCi0gICAgICAgICAgICB0ZW1wID0gKGludDE2X3QpICgoMTAwMCAqICh0ZW1wIC0gQVAwX1RJTUVfQkFTRSkpIC8gQVAwX1RJTUVfUkFOR0UpOwotCi0gICAgICAgICAgICBpZiAodGVtcCA8IDApCi0gICAgICAgICAgICAgICAgdGVtcCA9IDA7Ci0gICAgICAgICAgICBpZiAodGVtcCA+IDEwMDApCi0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dCk7Ci0gICAgICAgICAgICBicmVhazsKLQotICAgICAgICBjYXNlIFJFVkVSQl9QQVJBTV9CWVBBU1M6Ci0gICAgICAgIGNhc2UgUkVWRVJCX1BBUkFNX0RFQ0FZX1RJTUU6Ci0gICAgICAgIGNhc2UgUkVWRVJCX1BBUkFNX1JFRkxFQ1RJT05TX0RFTEFZOgotICAgICAgICBjYXNlIFJFVkVSQl9QQVJBTV9SRVZFUkJfREVMQVk6Ci0gICAgICAgICAgICBwYXJhbVNpemUgPSBzaXplb2YoaW50MzJfdCk7Ci0gICAgICAgICAgICBicmVhazsKLQotICAgICAgICBjYXNlIFJFVkVSQl9QQVJBTV9QUk9QRVJUSUVTOgotICAgICAgICAgICAgcGFyYW1TaXplID0gc2l6ZW9mKHRfcmV2ZXJiX3NldHRpbmdzKTsKLSAgICAgICAgICAgIGJyZWFrOwotCi0gICAgICAgIGRlZmF1bHQ6Ci0gICAgICAgICAgICByZXR1cm4gLUVJTlZBTDsKLSAgICAgICAgfQotCi0gICAgICAgIGlmIChzaXplICE9IHBhcmFtU2l6ZSkgewotICAgICAgICAgICAgcmV0dXJuIC1FSU5WQUw7Ci0gICAgICAgIH0KLQotICAgICAgICBpZiAocGFyYW1TaXplID09IHNpemVvZihpbnQxNl90KSkgewotICAgICAgICAgICAgdmFsdWUxNiA9ICooaW50MTZfdCAqKSBwVmFsdWU7Ci0gICAgICAgIH0gZWxzZSBpZiAocGFyYW1TaXplID09IHNpemVvZihpbnQzMl90KSkgewotICAgICAgICAgICAgdmFsdWUzMiA9ICooaW50MzJfdCAqKSBwVmFsdWU7Ci0gICAgICAgIH0gZWxzZSB7Ci0gICAgICAgICAgICBwUHJvcGVydGllcyA9ICh0X3JldmVyYl9zZXR0aW5ncyAqKSBwVmFsdWU7Ci0gICAgICAgIH0KLQotICAgICAgICBwUHJlc2V0ID0gJnBSZXZlcmItPm1fc1ByZXNldC5tX3NQcmVzZXRbcFJldmVyYi0+bV9uTmV4dFJvb21dOwotCi0gICAgICAgIHN3aXRjaCAocGFyYW0pIHsKLSAgICAgICAgY2FzZSBSRVZFUkJfUEFSQU1fQllQQVNTOgotICAgICAgICAgICAgcFJldmVyYi0+bV9iQnlwYXNzID0gKHVpbnQxNl90KXZhbHVlMzI7Ci0gICAgICAgICAgICBicmVhazsKLQotICAgICAgICBjYXNlIFJFVkVSQl9QQVJBTV9QUk9QRVJUSUVTOgotICAgICAgICAgICAgdmFsdWUxNiA9IHBQcm9wZXJ0aWVzLT5yb29tTGV2ZWw7Ci0gICAgICAgICAgICAvKiBGQUxMIFRIUk9VR0ggKi8KLQotICAgICAgICBjYXNlIFJFVkVSQl9QQVJBTV9ST09NX0xFVkVMOgotICAgICAgICAgICAgLy8gQ29udmVydCBtaWxsaWJlbHMgdG8gbGluZWFyIDE2IGJpdCBzaWduZWQgPT4gbV9uUm9vbUxwZkZ3ZAotICAgICAgICAgICAgaWYgKHZhbHVlMTYgPiAwKQotICAgICAgICAgICAgICAgIHJldHVybiAtRUlOVkFMOwotCi0gICAgICAgICAgICB0ZW1wID0gRWZmZWN0c19NaWxsaWJlbHNUb0xpbmVhcjE2KHZhbHVlMTYpOwotCi0gICAgICAgICAgICBwUmV2ZXJiLT5tX25Sb29tTHBmRndkCi0gICAgICAgICAgICAgICAgICAgID0gTVVMVF9FRzFfRUcxKHRlbXAsICgzMjc2NyAtIHBSZXZlcmItPm1fblJvb21McGZGYmspKTsKLQotICAgICAgICAgICAgQUxPR1YoIlJFVkVSQl9QQVJBTV9ST09NX0xFVkVMLCBnYWluICVkLCBuZXcgbV9uUm9vbUxwZkZ3ZCAlZCwgbV9uUm9vbUxwZkZiayAlZCIsIHRlbXAsIHBSZXZlcmItPm1fblJvb21McGZGd2QsIHBSZXZlcmItPm1fblJvb21McGZGYmspOwotICAgICAgICAgICAgaWYgKHBhcmFtID09IFJFVkVSQl9QQVJBTV9ST09NX0xFVkVMKQotICAgICAgICAgICAgICAgIGJyZWFrOwotICAgICAgICAgICAgdmFsdWUxNiA9IH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SkgLyAoMzI3NjcKLSAgICAgICAgICAgICAgICAgICAgLSBwUmV2ZXJiLT5tX25Sb29tTHBmRmJrKTsKLSAgICAgICAgICAgIGlmICh2YWx1ZTE2ID09IDApIHsKLSAgICAgICAgICAgICAgICBwUmV2ZXJiLT5tX25Sb29tTHBmRmJrID0gMDsKLSAgICAgICAgICAgIH0gZWxzZSB7Ci0gICAgICAgICAgICAgICAgaW50MzJfdCBkRzIsIGIsIGRlbHRhOwotCi0gICAgICAgICAgICAgICAgLy8gZEdeMgotICAgICAgICAgICAgICAgIHRlbXAgPSBFZmZlY3RzX01pbGxpYmVsc1RvTGluZWFyMTYodmFsdWUxNik7Ci0gICAgICAgICAgICAgICAgQUxPR1YoIlJFVkVSQl9QQVJBTV9ST09NX0hGX0xFVkVMLCBIRiBnYWluICVkIiwgdGVtcCk7Ci0gICAgICAgICAgICAgICAgdGVtcCA9ICgxIDw8IDMwKSAvIHRlbXA7Ci0gICAgICAgICAgICAgICAgQUxPR1YoIlJFVkVSQl9QQVJBTV9ST09NX0hGX0xFVkVMLCAxLyBIRiBnYWluICVkIiwgdGVtcCk7Ci0gICAgICAgICAgICAgICAgZEcyID0gKGludDMyX3QpICgoKGludDY0X3QpIHRlbXAgKiAoaW50NjRfdCkgdGVtcCkgPj4gMTUpOwotICAgICAgICAgICAgICAgIEFMT0dWKCJSRVZFUkJfUEFSQU1fUk9PTV9IRl9MRVZFTCwgMS8gSEYgZ2FpbiBeIDIgJWQiLCBkRzIpOwotICAgICAgICAgICAgICAgIC8vIGIgPSAyKihDLWRHXjIpLygxLWRHXjIpCi0gICAgICAgICAgICAgICAgYiA9IChpbnQzMl90KSAoKCgoaW50NjRfdCkgMSA8PCAoMTUgKyAxKSkKLSAgICAgICAgICAgICAgICAgICAgICAgICogKChpbnQ2NF90KSBwUmV2ZXJiLT5tX25Db3NXVF81S0h6IC0gKGludDY0X3QpIGRHMikpCi0gICAgICAgICAgICAgICAgICAgICAgICAvICgoaW50NjRfdCkgMzI3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50NjRfdCkgdmFsdWUzMikgPj4gMTUpOwotCi0gICAgICAgICAgICAgICAgaWYgKHRlbXAgPCAtNDAwMCkgewotICAgICAgICAgICAgICAgICAgICBBTE9HVigiUkVWRVJCX1BBUkFNX0RFQ0FZX0hGX1JBVElPIEhGIGdhaW4gb3ZlcmZsb3cgJWQgbUIiLCB0ZW1wKTsKLSAgICAgICAgICAgICAgICAgICAgdGVtcCA9IC00MDAwOwotICAgICAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgICAgIHRlbXAgPSBFZmZlY3RzX01pbGxpYmVsc1RvTGluZWFyMTYodGVtcCk7Ci0gICAgICAgICAgICAgICAgQUxPR1YoIlJFVkVSQl9QQVJBTV9ERUNBWV9IRl9SQVRJTywgSEYgZ2FpbiAlZCIsIHRlbXApOwotICAgICAgICAgICAgICAgIC8vIGRHXjIKLSAgICAgICAgICAgICAgICB0ZW1wID0gKHRlbXAyIDw8IDE1KSAvIHRlbXA7Ci0gICAgICAgICAgICAgICAgZEcyID0gKGludDMyX3QpICgoKGludDY0X3QpIHRlbXAgKiAoaW50NjRfdCkgdGVtcCkgPj4gMTUpOwotCi0gICAgICAgICAgICAgICAgLy8gYiA9IDIqKEMtZEdeMikvKDEtZEdeMikKLSAgICAgICAgICAgICAgICBiID0gKGludDMyX3QpICgoKChpbnQ2NF90KSAxIDw8ICgxNSArIDEpKQotICAgICAgICAgICAgICAgICAgICAgICAgKiAoKGludDY0X3QpIHBSZXZlcmItPm1fbkNvc1dUXzVLSHogLSAoaW50NjRfdCkgZEcyKSkKLSAgICAgICAgICAgICAgICAgICAgICAgIC8gKChpbnQ2NF90KSAzMjc2NyAtIChpbnQ2NF90KSBkRzIpKTsKLQotICAgICAgICAgICAgICAgIC8vIGRlbHRhID0gYl4yIC0gNAotICAgICAgICAgICAgICAgIGRlbHRhID0gKGludDMyX3QpICgoKChpbnQ2NF90KSBiICogKGludDY0X3QpIGIpID4+IDE1KSAtICgxIDw8ICgxNQotICAgICAgICAgICAgICA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zMiA9IHBQcm9wZXJ0aWVzLT5yZWZsZWN0aW9uc0RlbGF5OwotICAgICAgICAgICAgLyogRkFMTCBUSFJPVUdIICovCi0KLSAgICAgICAgY2FzZSBSRVZFUkJfUEFSQU1fUkVGTEVDVElPTlNfREVMQVk6Ci0gICAgICAgICAgICAvLyBXZSBsaW1pdCBtYXggdmFsdWUgTUFYX0VBUkxZX1RJTUUKLSAgICAgICAgICAgIC8vIGNvbnZlcnQgbXMgdG8gdGltZSB1bml0cwotICAgICAgICAgICAgdGVtcCA9ICh2YWx1ZTMyICogNjU1MzYpIC8gMTAwMDsKLSAgICAgICAgICAgIGlmICh0ZW1wIDwgMCB8fCB0ZW1wID4gTUFYX0VBUkxZX1RJTUUpCi0gICAgICAgICAgICAgICAgcmV0dXJuIC1FSU5WQUw7Ci0KLSAgICAgICAgICAgIG1heFNhbXBsZXMgPSAoaW50MzJfdCkgKE1BWF9FQVJMWV9USU1FICogcFJldmVyYi0+bV9uU2FtcGxpbmdSYXRlKQotICAgICAgICAgICAgICAgICAgICA+PiAxNjsKLSAgICAgICAgICAgIHRlbXAgPSAodGVtcCAqIHBSZXZlcmItPm1fblNhbXBsaW5nUmF0ZSkgPj4gMTY7Ci0gICAgICAgICAgICBmb3IgKGkgPSAwOyBpIDwgUkVWRVJCX01BWF9OVU1fUkVGTEVDVElPTlM7IGkrKykgewotICAgICAgICAgICAgICAgIHRlbXAyID0gdGVtcCArICgoKGludDMyX3QpIHBQcmVzZXQtPm1fc0Vhcmx5TC5tX3pEZWxheVtpXQotICAgICAgICAgICAgICAgICAgICAgICAgKiBwUmV2ZXJiLT5tX25TYW1wbGluZ1JhdGUpID4+IDE2KTsKLSAgICAgICAgICAgICAgICBpZiAodGVtcDIgPiBtYXhTYW1wbGVzKQotICAgICAgICAgICAgICAgICAgICB0ZW1wMiA9IG1heFNhbXBsZXM7Ci0gICAgICAgICAgICAgICAgcFJldmVyYi0+bV9zRWFybHlMLm1fekRlbGF5W2ldID0gcFJldmVyYi0+bV9uRWFybHkwaW4gKyB0ZW1wMjsKLSAgICAgICAgICAgICAgICB0ZW1wMiA9IHRlbXAgKyAoKChpbnQzMl90KSBwUHJlc2V0LT5tX3NFYXJseVIubV96RGVsYXlbaV0KLSAgICAgICAgICAgICAgICAgICAgICAgICogcFJldmVyYi0+bV9uU2FtcGxpbmdSYXRlKSA+PiAxNik7Ci0gICAgICAgICAgICAgICAgaWYgKHRlbXAyID4gbWF4U2FtcGxlcykKLSAgICAgICAgICAgICAgICAgICAgdGVtcDIgPSBtYXhTYW1wbGVzOwotICAgICAgICAgICAgICAgIHBSZXZlcmItPm1fc0Vhcmx5Ui5tX3pEZWxheVtpXSA9IHBSZXZlcmItPm1fbkVhcmx5MWluICsgdGVtcDI7Ci0gICAgICAgICAgICB9Ci0gICAgICAgICAgICBwUmV2ZXJiLT5tX25FYXJseURlbGF5ID0gdGVtcDsKLQotICAgICAgICAgICAgQUxPR1YoIlJFVkVSQl9QQVJBTV9SRUZMRUNUSU9OU19ERUxBWSwgbV9uRWFybHlEZWxheSBzbXBzICVkIG1heCBzbXAgZGVsYXkgJWQiLCBwUmV2ZXJiLT5tX25FYXJseURlbGF5LCBtYXhTYW1wbGVzKTsKLQotICAgICAgICAgICAgLy8gQ29udmVydCBtaWxsaXNlY29uZHMgdG8gc2FtcGxlIGNvdW50ID0+IG1fbkVhcmx5RGVsYXkKLSAgICAgICAgICAgIGlmIChwYXJhbSA9PSBSRVZFUkJfUEFSQU1fUkVGTEVDVElPTlNfREVMQVkpCi0gICAgICAgICAgICAgICAgYnJlYWs7Ci0gICAgICAgICAgICB2YWx1ZTE2ID0gcFByb3BlcnRpZXMtPnJldmVyYkxldmVsOwotICAgICAgICAgICAgLyogRkFMTCBUSFJPVUdIICovCi0KLSAgICAgICAgY2FzZSBSRVZFUkJfUEFSQU1fUkVWRVJCX0xFVkVMOgotICAgICAgICAgICAgLy8gV2UgbGltaXQgbWF4IHZhbHVlIHRvIDAgYmVjYXVzZSBnYWluIGlz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lYWs7Ci0KLSAgICAgICAgICAgIHZhbHVlMTYgPSBwUHJvcGVydGllcy0+ZGlmZnVzaW9uOwotICAgICAgICAgICAgLyogRkFMTCBUSFJPVUdIICovCi0KLSAgICAgICAgY2FzZSBSRVZFUkJfUEFSQU1fRElGRlVTSU9OOgotICAgICAgICAgICAgaWYgKHZhbHVlMTYgPCAwIHx8IHZhbHVlMTYgPiAxMDAwKQotICAgICAgICAgICAgICAgIHJldHVybiAtRUlOVkFMOwotCi0gICAgICAgICAgICAvLyBDb252ZXJ0IHBlciBtaWxsZSB0byBtX3NBcDAubV9uQXBHYWluLCBtX3NBcDEubV9uQXBHYWluCi0gICAgICAgICAgICBwUmV2ZXJiLT5tX3NBcDAubV9uQXBHYWluID0gQVAwX0dBSU5fQkFTRSArICgoaW50MzJfdCkgdmFsdWUxNgotICAgICAgICAgICAgICAgICAgICAqIEFQMF9HQUlOX1JBTkdFKSAvIDEwMDA7Ci0gICAgICAgICAgICBwUmV2ZXJiLT5tX3NBcDEubV9uQXBHYWluID0gQVAxX0dBSU5fQkFTRSArICgoaW50MzJfdCkgdmFsdWUxNgotICAgICAgICAgICAgICAgICAgICAqIEFQMV9HQUlOX1JBTkdFKSAvIDEwMDA7Ci0KLSAgICAgICAgICAgIEFMT0dWKCJSRVZFUkJfUEFSQU1fRElGRlVTSU9OLCBtX3NBcDAubV9uQXBHYWluICVkIG1fc0FwMS5tX25BcEdhaW4gJWQiLCBwUmV2ZXJiLT5tX3NBcDAubV9uQXBHYWluLCBwUmV2ZXJiLT5tX3NBcDEubV9uQXBHYWluKTsKLQotICAgICAgICAgICAgaWYgKHBhcmFtID09IFJFVkVSQl9QQVJBTV9ESUZGVVNJT04pCi0gICAgICAgICAgICAgICAgYnJlYWs7Ci0KLSAgICAgICAgICAgIHZhbHVlMTYgPSBwUHJvcGVydGllcy0+ZGVuc2l0eTsKLSAgICAgICAgICAgIC8qIEZBTEwgVEhST1VHSCAqLwotCi0gICAgICAgIGNhc2UgUkVWRV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XQtPm1fc0Vhcmx5TC5tX25HYWluW2ldLGVhcmx5R2Fpbik7Ci0gICAgICAgICAgICBwUmV2ZXJiLT5tX3NFYXJseVIubV9uR2FpbltpXQotICAgICAgICAgICAgICAgICAgICA9IE1VTFRfRUcxX0VHMShwUHJlc2V0LT5tX3NFYXJseVIubV9uR2FpbltpXSxlYXJseUdhaW4pOwotICAgICAgICB9Ci0KLSAgICAgICAgcFJldmVyYi0+bV9uTWF4RXhjdXJzaW9uID0gcFByZXNldC0+bV9uTWF4RXhjdXJzaW9uOwotCi0gICAgICAgIHBSZXZlcmItPm1fc0FwMC5tX25BcEdhaW4gPSBwUHJlc2V0LT5tX25BcDBfQXBHYWluOwotICAgICAgICBwUmV2ZXJiLT5tX3NBcDEubV9uQXBHYWluID0gcFByZXNldC0+bV9uQXAxX0FwR2FpbjsKLQotICAgICAgICAvLyBzZXQgdGhlIGVhcmx5IHJlZmxlY3Rpb25zIGRlbGF5Ci0gICAgICAgIGVhcmx5RGVsYXkgPSAoKGludCkgcFByZXNldC0+bV9uRWFybHlEZWxheSAqIHBSZXZlcmItPm1fblNhbXBsaW5nUmF0ZSkKLSAgICAgICAgICAgICAgICA+PiAxNjsKLSAgICAgICAgcFJldmVyYi0+bV9uRWFybHlEZWxheSA9IGVhcmx5RGVsYXk7Ci0gICAgICAgIG1heFNhbXBsZXMgPSAoaW50MzJfdCkgKE1BWF9FQVJMWV9USU1FICogcFJldmVyYi0+bV9uU2FtcGxpbmdSYXRlKQotICAgICAgICAgICAgICAgID4+IDE2OwotICAgICAgICBmb3IgKGkgPSAwOyBpIDwgUkVWRVJCX01BWF9OVU1fUkVGTEVDVElPTlM7IGkrKykgewotICAgICAgICAgICAgLy9zdG9yZWQgYXMgdGltZSBiYXNlZCwgY29udmVydCB0byBzYW1wbGUgYmFzZWQKLSAgICAgICAgICAgIHRlbXAgPSBlYXJseURlbGF5ICsgKCgoaW50KSBwUHJlc2V0LT5tX3NFYXJseUwubV96RGVsYXlbaV0KLSAgICAgICAgICAgICAgICAgICAgKiBwUmV2ZXJiLT5tX25TYW1wbGluZ1JhdGUpID4+IDE2KTsKLSAgICAgICAgICAgIGlmICh0ZW1wID4gbWF4U2FtcGxlcykKLSAgICAgICAgICAgICAgICB0ZW1wID0gbWF4U2FtcGxlczsKLSAgICAgICAgICAgIHBSZXZlcmItPm1fc0Vhcmx5TC5tX3pEZWxheVtpXSA9IHBSZXZlcmItPm1fbkVhcmx5MGluICsgdGVtcDsKLSAgICAgICAgICAgIC8vc3RvcmVkIGFzIHRpbWUgYmFzZWQsIGNvbnZlcnQgdG8gc2FtcGxlIGJhc2VkCi0gICAgICAgICAgICB0ZW1wID0gZWFybHlEZWxheSArICgoKGludCkgcFByZXNldC0+bV9zRWFybHlSLm1fekRlbGF5W2ldCi0gICAgICAgICAgICAgICAgICAgICogcFJldmVyYi0+bV9uU2FtcGxpbmdSYXRlKSA+PiAxNik7Ci0gICAgICAgICAgICBpZiAodGVtcCA+IG1heFNhbXBsZXMpCi0gICAgICAgICAgICAgICAgdGVtcCA9IG1heFNhbXBsZXM7Ci0gICAgICAgICAgICBwUmV2ZXJiLT5tX3NFYXJseVIubV96RGVsYXlbaV0gPSBwUmV2ZXJiLT5tX25FYXJseTFpbiArIHRlbXA7Ci0gICAgICAgIH0KLQotICAgICAgICBtYXhTYW1wbGVzID0gKGludDMyX3QpIChNQVhfREVMQVlfVElNRSAqIHBSZXZlcmItPm1fblNhbXBsaW5nUmF0ZSkKLSAgICAgICAgICAgICAgICA+PiAxNjsKLSAgICAgICAgLy9zdG9yZWQgYXMgdGltZSBiYXNlZCwgY29udmVydCB0byBzYW1wbGUgYmFzZWQKLSAgICAgICAgLypsaW50IC1lezcwMn0gc2hpZnQgZm9yIHBlcmZvcm1hbmNlICovCi0gICAgICAgIHRlbXAgPSAocFByZXNldC0+bV9uTGF0ZURlbGF5ICogcFJldmVyYi0+bV9uU2FtcGxpbmdSYXRlKSA+PiAxNjsKLSAgICAgICAgaWYgKCh0ZW1w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GNhc2UgUkVWRVJCX1BSRVNFVF9TTUFMTFJPT006Ci0gICAgICAgICAgICBwUHJlc2V0LT5tX25SdmJMcGZGYmsgPSA1MDc3OwotICAgICAgICAgICAgcFByZXNldC0+bV9uUnZiTHBmRndkID0gMTEwNzY7Ci0gICAgICAgICAgICBwUHJlc2V0LT5tX25FYXJseUdhaW4gPSAyNzY5MDsKLSAgICAgICAgICAgIHBQcmVzZXQtPm1fbkVhcmx5RGVsYXkgPSAxMzExOwotICAgICAgICAgICAgcFByZXNldC0+bV9uTGF0ZUdhaW4gPSA4MTkxOwotICAgICAgICAgICAgcFByZXNldC0+bV9uTGF0ZURlbGF5ID0gMzkzMjsKLSAgICAgICAgICAgIHBQcmVzZXQtPm1fblJvb21McGZGYmsgPSAzNjkyOwotICAgICAgICAgICAgcFByZXNldC0+bV9uUm9vbUxwZkZ3ZCA9IDIwNDc0OwotICAgICAgICAgICAgcFByZXNldC0+bV9zRWFybHlMLm1fekRlbGF5WzBdID0gMTM3NjsKLSAgICAgICAgICAgIHBQcmVzZXQtPm1fc0Vhcmx5TC5tX25HYWluWzBdID0gMjIxNTI7Ci0gICAgICAgICAgICBwUHJlc2V0LT5tX3NFYXJseUwubV96RGVsYXlbMV0gPSAxNDYyOwotICAgICAgICAgICAgcFByZXNldC0+bV9zRWFybHlMLm1fbkdhaW5bMV0gPSAxNzUzNzsKLSAgICAgICAgICAgIHBQcmVzZXQtPm1fc0Vhcmx5TC5tX3pEZWxheVsyXSA9IDA7Ci0gICAgICAgICAgICBwUHJlc2V0LT5tX3NFYXJseUwubV9uR2FpblsyXSA9IDE0NzY4OwotICAgICAgICAgICAgcFByZXNldC0+bV9zRWFybHlMLm1fekRlbGF5WzNdID0gMTgzNTsKLSAgICAgICAgICAgIHBQcmVzZXQtPm1fc0Vhcmx5TC5tX25HYWluWzNdID0gMTQzMDc7Ci0gICAgICAgICAgICBwUHJlc2V0LT5tX3NFYXJseUwubV96RGVsYXlbNF0gPSAwOwotICAgICAgICAg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AgICAgICAgcFByZXNldC0+bV9yZnU0ID0gMDsKLSAgICAgICAgICAgIHBQcmVzZXQtPm1fcmZ1NSA9IDA7Ci0gICAgICAgICAgICBwUHJlc2V0LT5tX3JmdTYgPSAwOwotICAgICAgICAgICAgcFByZXNldC0+bV9yZnU3ID0gMDsKLSAgICAgICAgICAgIHBQcmVzZXQtPm1fcmZ1OCA9IDA7Ci0gICAgICAgICAgICBwUHJlc2V0LT5tX3JmdTkgPSAwOwotICAgICAgICAgICAgcFByZXNldC0+bV9yZnUxMCA9IDA7Ci0gICAgICAgICAgICBicmVhazsKLSAgICAgICAgY2FzZSBSRVZFUkJfUFJFU0VUX01FRElVTVJPT006Ci0gICAgICAgIGNhc2UgUkVWRVJCX1BSRVNFVF9MQVJHRVJPT006Ci0gICAgICAgICAgICBwUHJlc2V0LT5tX25SdmJMcGZGYmsgPSA1MDc3OwotICAgICAgICAgICAgcFByZXNldC0+bV9uUnZiTHBmRndkID0gMTI5MjI7Ci0gICAgICAgICAgICBwUHJlc2V0LT5tX25FYXJseUdhaW4gPSAyNzY5MDsKLSAgICAgICAgICAgIHBQcmVzZXQtPm1fbkVhcmx5RGVsYXkgPSAxMzExOwotICAgICAgICAgICAgcFByZXNldC0+bV9uTGF0ZUdhaW4gPSA4MTkxOwotICAgICAgICAgICAgcFByZXNldC0+bV9uTGF0ZURlbGF5ID0gMzkzMjsKLSAgICAgICAgICAgIHBQcmVzZXQtPm1fblJvb21McGZGYmsgPSAzNjkyOwotICAgICAgICAgICAgcFByZXNldC0+bV9uUm9vbUxwZkZ3ZCA9IDIxNzAzOwotICAgICAgICAgICAgcFByZXNldC0+bV9zRWFybHlMLm1fekRlbGF5WzBdID0gMTM3NjsKLSAgICAgICAgICAgIHBQcmVzZXQtPm1fc0Vhcmx5TC5tX25HYWluWzBdID0gMjIxNTI7Ci0gICAgICAgICAgICBwUHJlc2V0LT5tX3NFYXJseUwubV96RGVsYXlbMV0gPSAxNDYyOwotICAgICAgICAgICAgcFByZ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gICAgICBwUHJlc2V0LT5tX25Sb29tTHBmRmJrID0gMzY5MjsKLSAgICAgICAgICAgIHBQcmVzZXQtPm1fblJvb21McGZGd2QgPSAyNDU2OTsKLSAgICAgICAgICAgIHBQcmVzZXQtPm1fc0Vhcmx5TC5tX3pEZWxheVswXSA9IDEzNzY7Ci0gICAgICAgICAgICBwUHJlc2V0LT5tX3NFYXJseUwubV9uR2FpblswXSA9IDIyMTUyOwotICAgICAgICAgICAgcFByZXNldC0+bV9zRWFybHlMLm1fekRlbGF5WzFdID0gMTQ2MjsKLSAgICAgICAgICAgIHBQcmVzZXQtPm1fc0Vhcmx5TC5tX25HYWluWzFdID0gMTc1Mzc7Ci0gICAgICAgICAgICBwUHJlc2V0LT5tX3NFYXJseUwubV96RGVsYXlbMl0gPSAwOwotICAgICAgICAgICAgcFByZXNldC0+bV9zRWFybHlMLm1fbkdhaW5bMl0gPSAxNDc2ODsKLSAgICAgICAgICAgIHBQcmVzZXQtPm1fc0Vhcmx5TC5tX3pEZWxheVszXSA9IDE4MzU7Ci0gICAgICAgICAgICBwUHJlc2V0LT5tX3NFYXJseUwubV9uR2FpblszXSA9IDE0MzA3OwotICAgICAgICAgICAgcFByZXNldC0+bV9zRWFybHlMLm1fekRlbGF5WzRdID0gMDsKLSAgICAgICAgICAgIHBQcmVzZXQtPm1fc0Vhcmx5TC5tX25HYWluWzRdID0gMTMzODQ7Ci0gICAgICAgICAgICBwUHJlc2V0LT5tX3NFYXJseVIubV96RGVsYXlbMF0gPSA3MjE7Ci0gICAgICAgICAgICBwUHJlc2V0LT5tX3NFYXJseVIubV9uR2FpblswXSA9IDIwMzA2OwotICAgICAgICAgICAgcFByZXNldC0+bV9zRWFybHlSLm1fekRlbGF5WzFdID0gMjYyMTsKLSAgICAgICAgICAgIHBQcmVzZXQtPm1fc0Vhcmx5Ui5tX25HYWluWzFdID0gMTc1Mzc7Ci0gICAgICAgICAgICBwUHJlc2V0LT5tX3NFYXJseVIubV96RGVsYXlbMl0gP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+bV9uUnZiTHBmRmJrID0gODMwNzsKLSAgICAgICAgICAgIHBQcmVzZXQtPm1fblJ2YkxwZkZ3ZCA9IDE0NzY4OwotICAgICAgICAgICAgcFByZXNldC0+bV9uRWFybHlHYWluID0gMjc2OTA7Ci0gICAgICAgICAgICBwUHJlc2V0LT5tX25FYXJseURlbGF5ID0gMTMxMTsKLSAgICAgICAgICAgIHBQcmVzZXQtPm1fbkxhdGVHYWluID0gODE5MTsKLSAgICAgICAgICAgIHBQcmVzZXQtPm1fbkxhdGVEZWxheSA9IDM5MzI7Ci0gICAgICAgICAgICBwUHJlc2V0LT5tX25Sb29tTHBmRmJrID0gMzY5MjsKLSAgICAgICAgICAgIHBQcmVzZXQtPm1fblJvb21McGZGd2QgPSAyNDU2OTsKLSAgICAgICAgICAgIHBQcmVzZXQtPm1fc0Vhcmx5TC5tX3pEZWxheVswXSA9IDEzNzY7Ci0gICAgICAgICAgICBwUHJlc2V0LT5tX3NFYXJseUwubV9uR2FpblswXSA9IDIyMTUyOwotICAgICAgICAgICAgcFByZXNldC0+bV9zRWFybHlMLm1fekRlbGF5WzFdID0gMjE2MzsKLSAgICAgICAgICAgIHBQcmVzZXQtPm1fc0Vhcmx5TC5tX25HYWluWzFdID0gMTc1Mzc7Ci0gICAgICAgICAgICBwUHJlc2V0LT5tX3NFYXJseUwubV96RGVsYXlbMl0gPSAwOwotICAgICAgICAgICAgcFByZXNldC0+bV9zRWFybHlMLm1fbkdhaW5bMl0gPSAxNDc2ODsKLSAgICAgICAgICAgIHBQcmVzZXQtPm1fc0Vhcmx5TC5tX3pEZWxheVszXSA9IDE4MzU7Ci0gICAgICAgICAgICBwUHJlc2V0LT5tX3NFYXJseUwubV9uR2FpblszXSA9IDE0MzA3OwotICAgICAgICAgICAgcFByZXNldC0+bV9zRWFybHlMLm1fekRlbGF5WzRdID0gMDsKLSAgICAgICAgICAgIHBQcmVzZXQtPm1fc0Vhcmx5TC5tX25HYWluWzRdID0gMTMzODQ7Ci0gICAg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b19lZmZlY3RzL2VmZmVjdF9lbnZpcm9ubWVudGFscmV2ZXJiLmg+Ci0jaW5jbHVkZSA8YXVkaW9fZWZmZWN0cy9lZmZlY3RfcHJlc2V0cmV2ZXJiLmg+Ci0KLQotLyotLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0KLSAqIGRlZmluZXMKLSAqLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tCi0qLwotCi0vKgotQ0lSQ1VMQVIoKSBjYWxjdWxhdGVzIHRoZSBhcnJheSBpbmRleCB1c2luZyBtb2R1bG8gYXJpdGhtZXRpYy4KLVRoZSAidHJpY2siIGlzIHRoYXQgbW9kdWxvIGFyaXRobWV0aWMgaXMgc2ltcGxpZmllZCBieSBtYXNraW5nCi10aGUgZWZmZWN0aXZlIGFkZHJlc3Mgd2hlcmUgdGhlIG1hc2sgaXMgKDJebiktMS4gVGhpcyBvbmx5IHdvcmtzCi1pZiB0aGUgYnVmZmVyIHNpemUgaXMgYSBwb3dlciBvZiB0d28uCi0qLwotI2RlZmluZSBDSVJDVUxBUihiYXNlLG9mZnNldCxzaXplKSAodWludDMyX3QpKCAgICAgICAgICAgICAgIFwKLSAgICAgICAgICAgICggICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFwKLSAgICAgICAgICAgICAgICAoKGludDMyX3QpKGJhc2UpKSArICgoaW50MzJfdCkob2Zmc2V0KSkgICAgIFwKLSAgICAgICAgICAgICkgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFwKLSAgICAgICAgICAgICYgc2l6ZSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKQotCi0jZGVmaW5lIE5VTV9PVVRQVVRfQ0hBTk5FTFMgMgotI2RlZmluZSBPVVRQVVRfQ0hBTk5FT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XR5cGVkZWYgc3RydWN0Ci17Ci0gICAgdWludDE2X3QgICAgICAgICAgICBtX3pEZWxheVtSRVZFUkJfTUFYX05VTV9SRUZMRUNUSU9OU107ICAgLy8gZGVsYXkgb2Zmc2V0IGZvciBhcCBvdXQKLQotICAgIGludDE2X3QgICAgICAgICAgICAgbV9uR2FpbltSRVZFUkJfTUFYX05VTV9SRUZMRUNUSU9OU107ICAgIC8vIGdhaW4gZm9yIGFwCi0KLX0gZWFybHlfcmVmbGVjdGlvbl9vYmplY3RfdDsKLQotLy9kZW1vCi10eXBlZGVmIHN0cnVjdAotewotICAgIGludDE2X3QgICAgICAgICAgICAgbV9uUnZiTHBmRmJrOwotICAgIGludDE2X3QgICAgICAgICAgICAgbV9uUnZiTHBmRndkOwotICAgIGludDE2X3QgICAgICAgICAgICAgbV9uUm9vbUxwZkZiazsKLSAgICBpbnQxNl90ICAgICAgICAgICAgIG1fblJvb21McGZGd2Q7Ci0KLSAgICBpbnQxNl90ICAgICAgICAgICAgIG1fbkVhcmx5R2FpbjsKLSAgICBpbnQxNl90ICAgICAgICAgICAgIG1fbkVhcmx5RGVsYXk7Ci0gICAgaW50MTZfdCAgICAgICAgICAgICBtX25MYXRlR2FpbjsKLSAgICBpbnQxNl90ICAgICAgICAgICAgIG1fbkxhdGVEZWxheTsKLQotICAgIGVhcmx5X3JlZmxlY3Rpb25fb2JqZWN0X3QgbV9zRWFybHlMOwotICAgIGVhcmx5X3JlZmxlY3Rpb25fb2JqZWN0X3QgbV9zRWFybHlSOwotCi0gICAgdWludDE2X3QgICAgICAgICAgICBtX25NYXhFeGN1cnNpb247IC8vMjgKLSAgICBpbnQxNl90ICAgICAgICAgICAgIG1fblhmYWRlSW50ZXJ2YWw7Ci0KLSAgICBpbnQxNl90ICAgICAgICAgICAgIG1fbkFwMF9BcEdhaW47IC8vMzAKLSAgICBpbnQxNl90ICAgICAgICAgICAgIG1fbkFwMF9BcE91dDsKLSAgICBpbnQxNl90ICAgICAgICAgICAgIG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y8gYmFzZSBpbmRleCBmb3IgY2lyY3VsYXIgYnVmZmVyCi0KLSAgICAvLyByZXZlcmIgZGVsYXkgbGluZSBvZmZzZXRzLCBhbGxwYXNzIHBhcmFtZXRlcnMsIGV0YzoKLQotICAgIHNob3J0ICAgICAgICAgICAgIG1fblJldkZia1I7ICAgICAgICAgICAgICAvLyBjb21iaW5lIGZlZWRiYWNrIHJldmVyYiByaWdodCBvdXQgd2l0aCBkcnkgbGVmdCBpbgotICAgIHNob3J0ICAgICAgICAgICAgIG1fek91dExwZkw7ICAgICAgICAgICAgICAvLyBsZWZ0IHJldmVyYiBvdXRwdXQKLQotICAgIGFsbHBhc3Nfb2JqZWN0X3QgICAgbV9zQXAwOyAgICAgICAgICAgICAgICAgICAgIC8vIGFsbHBhc3MgMCAobGVmdCBjaGFubmVsKQotCi0gICAgdWludDE2X3QgICAgICAgICAgICAgbV96RDBJbjsgICAgICAgICAgICAgICAgICAgIC8vIGRlbGF5IG9mZnNldCBmb3IgZGVsYXkgbGluZSBEMCBpbgotCi0gICAgc2hvcnQgICAgICAgICAgICAgbV9uUmV2RmJrTDsgICAgICAgICAgICAgIC8vIGNvbWJpbmUgZmVlZGJhY2sgcmV2ZXJiIGxlZnQgb3V0IHdpdGggZHJ5IHJpZ2h0IGluCi0gICAgc2hvcnQgICAgICAgICAgICAgbV96T3V0THBmUjsgICAgICAgICAgICAgIC8vIHJpZ2h0IHJldmVyYiBvdXRwdXQKLQotICAgIGFsbHBhc3Nfb2JqZWN0X3QgICAgbV9zQXAxOyAgICAgICAgICAgICAgICAgICAgIC8vIGFsbHBhc3MgMSAocmlnaHQgY2hhbm5lbCkKLQotICAgIHVpbnQxNl90ICAgICAgICAgICAgIG1fekQxSW47ICAgICAgICAgICAgICAgICAgICAvLyBkZWxheSBvZmZzZXQgZm9yIGRlbGF5IGxpbmUgRDEgaW4KLQotICAgIC8vIGRlbGF5IG91dHB1dCB0YXBzLCBub3RpY2UgY3Jpc3MgY3Jvc3Mgb3JkZXIKLSAgICB1aW50MTZfdCAgICAgICAgICAgICBtX3pEMFNlbGY7ICAgICAgICAgICAgICAgICAgLy8gc2VsZiBmZWVkcyBmb3J3YXJkIGQwIC0tPiBkMAotCi0gICAgdWludDE2X3QgICAgICAgICAgICAgbV96RDFDcm9zczsgICAgICAgICAgICAgICAgIC8vIGNyb3NzIGZlZWRzIGFjcm9zcyBkMSAtLT4gZDAKLQotICAgIHVpbnQxNl90ICAgICAgICAgICAgIG1fekQxU2VsZjsgICAgICAgICAgICAgICAgICAvLyBzZWxmIGZlZWRzIGZvcndhcmQgZDEgLS0+IGQxCi0KLSAgICB1aW50MTZfdCAgICAgICAgICAgICBtX3pEMENyb3NzOyAgICAgICAgICAgICAgICAgLy8gY3Jvc3MgZmVlZHMgYWNyb3NzIGQwIC0tPiBkMQotCi0gICAgaW50MTZfdCAgICAgICAgICAgICBtX25TaW47ICAgICAgICAgICAgICAgICAgICAgLy8gZ2FpbiBmb3Igc2VsZiB0YXBzCi0KLSAgICBpbnQxNl90ICAgICAgICAgICAgIG1fbkNvczsgICAgICAgICAgICAgICAgICAgICAvLyBnYWluIGZvciBjcm9zcyB0YXBzCi0KLSAgICBpbnQxNl90ICAgICAgICAgICAgIG1fblNpbkluY3JlbWVudDsgICAgICAgICAgICAvLyBpbmNyZW1lbnQgZm9yIGdhaW4KLQotICAgIGludDE2X3QgICAgICAgICAgICAgbV9uQ29zSW5jcmVtZW50OyAgICAgICAgICAgIC8vIGluY3JlbWVudCBmb3IgZ2FpbgotCi0gICAgaW50MTZfdCAgICAgICAgICAgICBtX25SdmJMcGZGd2Q7ICAgICAgICAgICAgICAgICAgLy8gcmV2ZXJiIGZlZWRiYWNrIGxwZiBmb3J3YXJkIGdhaW4gKGluY2x1ZGVzIHNjYWxpbmcgZm9yIG1peGVyKQotCi0gICAgaW50MTZfdCAgICAgICAgICAgICBtX25SdmJMcGZGYms7ICAgICAgICAgICAgICAgICAgLy8gcmV2ZXJiIGZlZWRiYWNrIGxwZiBmZWVkYmFjayBnYWluCi0KLSAgICBpbnQxNl90ICAgICAgICAgICAgIG1fblJvb21McGZGd2Q7ICAgICAgICAgICAgICAgICAgLy8gcm9vbSBscGYgZm9yd2FyZCBnYWluIChpbmNsdWRlcyBzY2FsaW5nIGZvciBtaXhlcikKLQotICAgIGludDE2X3QgICAgICAgICAgICAgbV9uUm9vbUxwZkZiazsgICAgICAgICAgICAgICAgICAvLyByb29tIGxwZiBmZWVkYmFjayBnYWluCi0KLSAgICB1aW50MTZfdCAgICAgICAgICAgIG1fblhmYWRlSW50ZXJ2YWw7ICAgICAgICAgICAvLyB1cGRhdGUveGZhZGUgYWZ0ZXIgdGhpcyBtYW55IHNhbXBsZXMKLQotICAgIHVpbnQxNl90ICAgICAgICAgICAgbV9uWGZhZGVDb3VudGVyOyAgICAgICAgICAgIC8vIGtlZXAgdHJhY2sgb2Ygd2hlbiB0byB4ZmFkZQotCi0gICAgaW50MTZfdCAgICAgICAgICAgICBtX25QaGFzZTsgICAgICAgICAgICAgICAgICAgLy8gLTEgPD0gbV9uUGhhc2UgPCAxCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gYnV0IGR1cmluZyBzaW4sY29zIGNhbGN1bGF0aW9ucwotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vIHVzZSBtX25QaGFzZS8yCi0KLSAgICBpbnQxNl90ICAgICAgICAgICAgIG1fblBoYXNlSW5jcmVtZW50OyAgICAgICAgICAvLyBhZGQgdGhpcyB0byBtX25QaGFzZSBlYWNoIGZyYW1lCi0KLSAgICBpbnQxNl90ICAgICAgICAgICAgIG1fbk5vaXNlOyAgICAgICAgICAgICAgICAgICAvLyByYW5kb20gbm9pc2Ugc2FtcGxlCi0KLSAgICB1aW50MTZfdCAgICAgICAgICAgIG1fbk1heEV4Y3Vyc2lvbjsgICAgICAgICAgICAvLyB0aGUgdGFwcyBjYW4gZXhjdXJzZSArLy0gdGhpcyBhbW91bnQKLQotICAgIHVpbnQxNl90ICAgICAgICAgICAgbV9iVXNlTm9pc2U7ICAgICAgICAgICAgICAgIC8vIGlmIFRSVUUsIHVzZSBub2lzZSBhcyBpbnB1dCBzaWduYWwKLQotICAgIHVpbnQxNl90ICAgICAgICAgICAgbV9iQnlwYXNzOyAgICAgICAgICAgICAgICAgIC8vIGlmIFRSVUUsIHRoZW4gYnlwYXNzIHJldmVyYiBhbmQgY29weSBpbnB1dCB0byBvdXRwdXQKLQotICAgIGludDE2X3QgICAgICAgICAgICAgbV9uQ3VycmVudFJvb207ICAgICAgICAgICAgIC8vIHByZXNldCBudW1iZXIgZm9yIGN1cnJlbnQgcm9vbQotCi0gICAgaW50MTZfdCAgICAgICAgICAgICBtX25OZXh0Um9vbTsgICAgICAgICAgICAgICAgLy8gcHJlc2V0IG51bWJlciBmb3IgbmV4dCByb29tCi0KLSAgICBpbnQxNl90ICAgICAgICAgICAgIG1fbkVhcmx5R2FpbjsgICAgICAgICAgICAgICAvLyBnYWluIGZvciBlYXJseSAod2lkZW4pIHNpZ25hbAotICAgIGludDE2X3QgICAgICAgICAgICAgbV9uRWFybHlEZWxheTsgICAgICAgICAgICAgIC8vIGluaXRpYWwgZGVhbHkgZm9yIGVhcmx5ICh3aWRlbikgc2lnbmFsCi0gICAgaW50MTZfdCAgICAgICAgICAgICBtX25FYXJseTBpbjsKLSAgICBpbnQxNl90ICAgICAgICAgICAgIG1fbkVhcmx5MWluOwotICAgIGludDE2X3QgICAgICAgICAgICAgbV9uTGF0ZUdhaW47ICAgICAgICAgICAgICAgLy8gZ2FpbiBmb3IgbGF0ZSByZXZlcmIKLSAgICBpbnQxNl90ICAgICAgICAgICAgIG1fbkxhdGVEZWxheTsKLQotICAgIGludDE2X3QgICAgICAgICAgICAgbV9uRGlmZnVzaW9uOwotCi0gICAgZWFybHlfcmVmbGVjdGlvbl9vYmplY3RfdCAgIG1fc0Vhcmx5TDsgICAgICAgICAgLy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50IGltcGxlbWVudGF0aW9uLCBmcmFjIGlzIGFjdHVhbGx5IGFuIGludGVnZXIgdmFsdWUKLXdpdGggYW4gaW1wbGllZCBiaW5hcnkgcG9pbnQgb25lIHBvc2l0aW9uIHRvIHRoZSBsZWZ0LiBUaGUgdmFsdWUgb2YKLW9uZSAodW5pdHkpIGlzIGdpdmVuIGJ5IFBIQVNFX09ORQotb25lIGhhbGYgYW5kIG9uZSBxdWFydGVyIGFyZSB1c2VmdWwgZm9yIDQtcG9pbnQgbGluZWFyIGludGVycC4KLSovCi0jZGVmaW5lIFBIQVNFX09ORSAgICAgICAgICAgICAgICAoaW50MzJfdCkgKDB4MUwgPDwgTlVNX1BIQVNFX0ZSQUNfQklUUykKLQotLyoKLSBNdWx0aXBseSB0aGUgc2lnbmVkIGF1ZGlvIHNhbXBsZSBieSB0aGUgdW5zaWduZWQgZnJhY3Rpb24uCi0tICBhIGlzIHRoZSBzaWduZWQgYXVkaW8gc2FtcGxlCi0tICBiIGlzIHRoZSB1bnNpZ25lZCBmcmFjdGlvbiAoY2FzdCB0byBzaWduZWQgaW50IGFzIGxvbmcgYXMgY29lZgotICAgIHVzZXMgKG4tMSkgb3IgbGVzcyBiaXRzLCB3aGVyZSBuID09IGhhcmR3YXJlIGJpdCB3aWR0aCkKLSovCi0jZGVmaW5lIE1VTFRfQVVESU9fQ09FRihhdWRpbyxjb2VmKSAgICAgICAgIC8qbGludCAtZTcwNCA8YXZvaWQgZGl2aWRlIGZvciBwZXJmb3JtYW5jZT4qLyBcCi0gICAgICAgICAgICAoaW50MzJfdCkoICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXAotICAgICAgICAgICAgKCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXAotICAgICAgICAgICAgICAgICgoaW50MzJfdCkoYXVkaW8pKSAqICgoaW50MzJfdCkoY29lZikpICAgIFwKLSAgICAgICAgICAgICkgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFwKLSAgICAgICAgICAgID4+IE5VTV9QSEFTRV9GUkFDX0JJVFMgICAgICAgICAgICAgICAgICAgICAgICBcCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKSAgICAgICAgICAgICAgICBcCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLyogbGludCArNzA0IDxyZXN0b3JlIGNoZWNraW5nPiovCi0KLS8qIHdldCAvIGRyeSBjYWxjdWxhdGlvbiBtYWNyb3MgKi8KLSNkZWZpbmUgTlVNX1dFVF9EUllfRlJBQ19CSVRTICAgICAgIDcgICAgLy8gMTUKLSNkZWZpbmUgTlVNX1dFVF9EUllfSU5UX0JJVFMgICAgICAgIDkgICAgLy8gMQotCi0vKiBkZWZpbmUgYSAxLjAgKi8KLSNkZWZpbmUgV0VUX0RSWV9PTkUgICAgICAgICAgICAgICAgIChpbnQzMl90KSAoKDB4MUwgPDwgTlVNX1dFVF9EUllfRlJBQ19CSVRTKSkKLSNkZWZpbmUgV0VUX0RSWV9NSU5VU19PTkUgICAgICAgICAgIChpbnQzMl90KSAofldFVF9EUllfT05FKQotI2RlZmluZSBXRVRfRFJZX0ZVTExfU0NBTEUgICAgICAgICAgKGludDMyX3QpIChXRVRfRFJZX09ORSAtIDEpCi0KLSNkZWZpbmUgTVVMVF9BVURJT19XRVRfRFJZX0NPRUYoYXVkaW8sY29lZikgLypsaW50IC1lKDcwMikgPGF2b2lkIGRpdmlkZSBmb3IgcGVyZm9ybWFuY2U+Ki8gXAotICAgICAgICAgICAgKGludDMyX3QpKCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBcCi0gICAgICAgICAgICAoICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXAotICAgICAgICAgICAgICAgICgoaW50MzJfdCkoYXVkaW8pKSAqICgoaW50MzJfdCkoY29lZikpICAgICAgICBcCi0gICAgICAgICAgICApICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXAotICAgICAgICAgICAgPj4gTlVNX1dFVF9EUllfRlJBQ19CSVRTICAgICAgICAgICAgICAgICAgICAgICAgXAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICApCi0KLS8qIEVudmVsb3BlIDEgKEVHMSkgY2FsY3VsYXRpb24gbWFjcm9zICovCi0jZGVmaW5lICAgIE5VTV9FRzFfSU5UX0JJVFMgICAgICAgICAgMQotI2RlZmluZSBOVU1fRUcxX0ZSQUNfQklUUyAgICAgICAgICAgIDE1Ci0KLS8qIHRoZSBtYXggcG9zaXRpdmUgZ2FpbiB1c2VkIGluIHRoZSBzeW50aCBmb3IgRUcxICovCi0vKiBTWU5USF9GVUxMX1NDQUxFX0VHMV9HQUlOIG11c3QgbWF0Y2ggdGhlIHZhbHVlIGluIHRoZSBkbHMyZWFzCi1jb252ZXJ0ZXIsIG90aGVyd2lzZSwgdGhlIHZhbHVlcyB3ZSByZWFkIGZyb20gdGhlIC5lYXMgZmlsZSBhcmUgYm9ndXMuICovCi0jZGVmaW5lIFNZTlRIX0ZVTExfU0NBTEVfRUcxX0dBSU4gICAgKGludDMyX3QpICgoMHgxTCA8PCBOVU1fRUcxX0ZSQUNfQklUUykgLTEpCi0KLS8qIGRlZmluZSBhIDEuMCAqLwotI2RlZmluZSBFRzFfT05FICAgICAgICAgICAgICAgICAgICAgIChpbnQzMl90KSAoKDB4MUwgPDwgTlVNX0VHMV9GUkFDX0JJVFMpKQotI2RlZmluZSBFRzFfTUlOVVNfT05FICAgICAgICAgICAgICAgIChpbnQzMl90KSAoflNZTlRIX0ZVTExfU0NBTEVfRUcxX0dBSU4pCi0KLSNkZWZpbmUgRUcxX0hBTEYgICAgICAgICAgICAgICAgICAgICAoaW50MzJfdCkgKEVHMV9PTkUvMikKLSNkZWZpbmUgRUcxX01JTlVTX0hBTEYgICAgICAgICAgICAgICAoaW50MzJfdCk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CkoICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFwKLSAgICAgICAgICAgICggICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBcCi0gICAgICAgICAgICAgICAgKChpbnQzMl90KShnYWluKSkgKiAoKGludDMyX3QpKGRhbXBpbmcpKSAgICBcCi0gICAgICAgICAgICApICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXAotICAgICAgICAgICAgPj4gTlVNX0VHMV9GUkFDX0JJVFMgICAgICAgICAgICAgICAgICAgICAgICAgICAgXAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICkKLQotLy8gVXNlIHRoZSBmb2xsb3dpbmcgbWFjcm8gc3BlY2lmaWNhbGx5IGZvciB0aGUgZmlsdGVyLCB3aGVuIG11bHRpcGx5aW5nCi0vLyB0aGUgYjEgY29lZmZpY2llbnQuIFRoZSAwIDw9IHxiMXwgPCAyLCB3aGljaCB0aGVyZWZvcmUgbWlnaHQgb3ZlcmZsb3cKLS8vIGluIGNlcnRhaW4gY29uZGl0aW9ucyBiZWNhdXNlIHdlIHN0b3JlIGIxIGFzIGEgMS4xNSB2YWx1ZS4KLS8vIEluc3RlYWQsIHdlIGNvdWxkIHN0b3JlIGIxIGFzIGIxcCAoYjEnID09IGIxICJwcmltZSIpIHdoZXJlCi0vLyBiMXAgPT0gYjEvMiwgdGh1cyBlbnN1cmluZyBubyBwb3RlbnRpYWwgb3ZlcmZsb3cgZm9yIGIxcCBiZWNhdXNlCi0vLyAwIDw9IHxiMXB8IDwgMQotLy8gSG93ZXZlciwgZHVyaW5nIHRoZSBmaWx0ZXIgY2FsY3VsYXRpb24sIHdlIG11c3QgYWNjb3VudCBmb3IgdGhlIGZhY3QKLS8vIHRoYXQgd2UgYXJlIHVzaW5nIGIxcCBpbnN0ZWFkIG9mIGIxLCBhbmQgdGhlcmVieSBtdWx0aXBseSBieQotLy8gYW4gZXh0cmEgZmFjdG9yIG9mIDIuIFJhdGhlciB0aGFuIG11bHRpcGx5IGJ5IGFuIGV4dHJhIGZhY3RvciBvZiAyLAotLy8gd2UgY2FuIGluc3RlYWQgc2hpZnQgdGhlIHJlc3VsdCByaWdodCBieSBvbmUgbGVzcywgaGVuY2UgdGhlCi0vLyBtb2RpZmllZCBzaGlmdCByaWdodCB2YWx1ZSBvZiAoTlVNX0VHMV9GUkFDX0JJVFMgLTEpCi0jZGVmaW5lIE1VTFRfRUcxX0VHMV9YMihnYWluLGRhbXBpbmcpICAgICAgICAgLypsaW50IC1lKDcwMikgPGF2b2lkIGRpdmlkZSBmb3IgcGVyZm9ybWFuY2U+Ki8gXAotICAgICAgICAgICAgKGludDMyX3QpKCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBcCi0gICAgICAgICAgICAoICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXAotICAgICAgICAgICAgICAgICgoaW50MzJfdCkoZ2FpbikpICogKChpbnQzMl90KShkYW1waW5nKSkgICAgXAotICAgICAgICAgICAgKSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFwKLSAgICAgICAgICAgID4+IChOVU1fRUcxX0ZSQUNfQklUUyAtMSkgICAgICAgICAgICAgICAgICAgICAgICBcCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKQotCi0jZGVmaW5lIFNBVFVSQVRFX0VHMSh4KSAgICAgICAgLypsaW50IC1lezczNH0gc2F0dXJhdGlvbiBvcGVyYXRpb24gKi8gICAgICAgICAgICAgICAgXAotICAgICgoaW50MzJfdCkoeCkgPiBTWU5USF9GVUxMX1NDQUxFX0VHMV9HQUlOKSAgICA/IChTWU5USF9GVUxMX1NDQUxFX0VHMV9HQUlOKSA6ICAgIFwKLSAgICAoKGludDMyX3QpKHgpIDwgRUcxX01JTlVTX09ORSkgICAgICAgICAgICAgICAgPyAoRUcxX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ICAgICAgICAgICAgICAgIFwKLSAgICAgICAgICAgICAgICAoRE9VQkxFX0xPRzJfMTApICogICAgICAgICAgICAgICAgICAgICAgICAgICAgXAotICAgICAgICAgICAgICAgIDEyMDAuMCAgICAvICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXAotICAgICAgICAgICAgICAgIDIwLjAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXAotICAgICkKLQotI2RlZmluZSAgICBMRk9fR0FJTl9UT19DRU5UUyAgICAoaW50MzJfdCkgICAgICAgICAgICAgICAgICAgICAgICBcCi0gICAgKCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXAotICAgICAgICAgICAgICAgIERPVUJMRV9MRk9fR0FJTl9UT19DRU5UUyAqICAgICAgICAgICAgICAgICAgICBcCi0gICAgICAgICAgICAgICAgKDB4MUwgPDwgTlVNX0VHMV9GUkFDX0JJVFMpICAgICAgICAgICAgICAgICAgICBcCi0gICAgKQotI2VuZGlmCi0KLSNkZWZpbmUgTEZPX0dBSU5fVE9fQ0VOVFMgKGludDMyX3QpICgxNjcxOTgxMTU2TCA+PiAoMjMgLSBOVU1fRUcxX0ZSQUNfQklUUykpCi0KLQotI2RlZmluZSBNVUxUX0RFTlRTX0NPRUYoZGVudHMsY29lZikgICAgIC8qbGludCAtZTcwNCA8YXZvaWQgZGl2aWRlIGZvciBwZXJmb3JtYW5jZT4qLyAgICBcCi0gICAgICAgICAgICAoaW50MzJfdCkoICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXAotICAgICAgICAgICAgKCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXAotICAgICAgICAgICAgICAgICgoaW50MzJfdCkoZGVudHMpKSAqICgoaW50MzJfdCkoY29lZikpICAgIFwKLSAgICAgICAgICAgICkgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFwKLSAgICAgICAgICAgID4+IE5VTV9ERU5UU19GUkFDX0JJVFMgICAgICAgICAgICAgICAgICAgICAgICBcCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKSAgICAgICAgICAgICAgICBcCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLyogbGludCArZTcwNCA8cmVzdG9yZSBjaGVja2luZz4qLwotCi0KLS8qIHdlIHVzZSAxNi1iaXRzIGluIHRoZSBQQyBwZXIgYXVkaW8gc2FtcGxlICovCi0jZGVmaW5lIEJJVFNfUEVSX0FVRElPX1NBTVBMRSAgICAxNgotCi0vKiB3ZSBkZWZpbmUgMSBhcyAxLjAgLSAxIExTYml0ICovCi0jZGVmaW5lIERJU1RPUlRJT05fT05FICAgICAgICAgICAoaW50MzJfdCkoKDB4MUwgPDwgKEJJVFNfUEVSX0FVRElPX1NBTVBMRS0xKSkgLTEpCi0jZGVmaW5lIERJU1RPUlRJT05fTUlOVVNfT05FICAgICAoaW50MzJfdCkofkRJU1RPUlRJT05fT05FKQotCi0vKiBkcml2ZSBjb2VmIGlzIGdpdmVuIGFzIGludC5mcmFjICovCi0jZGVmaW5lIE5VTV9EUklWRV9DT0VGX0lOVF9CSVRTICAxCi0jZGVmaW5lIE5VTV9EUklWRV9DT0VGX0ZSQUNfQklUUyA0Ci0KLSNkZWZpbmUgTVVMVF9BVURJT19EUklWRShhdWRpbyxkcml2ZSkgICAgICAgICAvKmxpbnQgLWUoNzAyKSA8YXZvaWQgZGl2aWRlIGZvciBwZXJmb3JtYW5jZT4qLyBcCi0gICAgICAgICAgICAoaW50MzJfdCkgICAgKCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXAotICAgICAgICAgICAgKCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXAotICAgICAgICAgICAgICAgICgoaW50MzJfdCkoYXVkaW8pKSAqICgoaW50MzJfdCkoZHJpdmUpKSAgICBcCi0gICAgICAgICAgICApICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBcCi0gICAgICAgICAgICA+PiBOVU1fRFJJVkVfQ09FRl9GUkFDX0JJVFMgICAgICAgICAgICAgICAgICAgIFwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICkKLQotI2RlZmluZSBNVUxUX0FVRElPX0FVRElPKGF1ZGlvMSxhdWRpbzIpICAgICAgICAgLypsaW50IC1lKDcwMikgPGF2b2lkIGRpdmlkZSBmb3IgcGVyZm9ybWFuY2U+Ki8gXAotICAgICAgICAgICAgKGludDMyX3QpICAgICggICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBcCi0gICAgICAgICAgICAoICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXAotICAgICAgICAgICAgICAgICgoaW50MzJfdCkoYXVkaW8xKSkgKiAoKGludDMyX3QpKGF1ZGlvMikpICAgIFwKLSAgICAgICAgICAgICkgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBcCi0gICAgICAgICAgICA+PiAoQklUU19QRVJfQVVESU9fU0FNUExFLTEpICAgICAgICAgICAgICAgICAgICBcCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKQotCi0jZGVmaW5lIFNBVFVSQVRFKHgpICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXAotICAgICgoKChpbnQzMl90KSh4KSkgPiBESVNUT1JUSU9OX09ORSkgICAgICAgID8gKERJU1RPUlRJT05fT05FKSA6ICAgICAgICAgICAgXAotICAgICgoKGludDMyX3QpKHgpKSA8IERJU1RPUlRJT05fTUlOVVNfT05FKSAgICA/IChESVNUT1JUSU9OX01JTlVTX09ORSkgOiAgICAoKGludDMyX3QpKHgpKSk7Ci0KLQotLyotLS0tLS0tLS0tLS0tLS0tLS0tLS0tL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RzID0gMTsKLSAgICByZXR1cm4gMDsKLX0KLQotaW50IFZpc3VhbGl6ZXJMaWJfUXVlcnlFZmZlY3QodWludDMyX3QgaW5kZXgsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICBlZmZlY3RfZGVzY3JpcHRvcl90ICpwRGVzY3JpcHRvcikgewotICAgIGlmIChwRGVzY3JpcHRvciA9PSBOVUxMKSB7Ci0gICAgICAgIHJldHVybiAtRUlOVkFMOwotICAgIH0KLSAgICBpZiAoaW5kZXggPiAwKSB7Ci0gICAgICAgIHJldHVybiAtRUlOVkFMOwotICAgIH0KLSAgICBtZW1jcHkocERlc2NyaXB0b3IsICZnVmlzdWFsaXplckRlc2NyaXB0b3IsIHNpemVvZihlZmZlY3RfZGVzY3JpcHRvcl90KSk7Ci0gICAgcmV0dXJuIDA7Ci19Ci0KLWludCBWaXN1YWxpemVyTGliX0NyZWF0ZShjb25zdCBlZmZlY3RfdXVpZF90ICp1dWlkLAotICAgICAgICAgICAgICAgICAgICAgICAgIGludDMyX3Qgc2Vzc2lvbklkLAotICAgICAgICAgICAgICAgICAgICAgICAgIGludDMyX3QgaW9JZCwKLSAgICAgICAgICAgICAgICAgICAgICAgICBlZmZlY3RfaGFuZGxlX3QgKnBIYW5kbGUpIHsKLSAgICBpbnQgcmV0OwotICAgIGludCBpOwotCi0gICAgaWYgKHBIYW5kbGUgPT0gTlVMTCB8fCB1dWlkID09IE5VTEwpIHsKLSAgICAgICAgcmV0dXJuIC1FSU5WQUw7Ci0gICAgfQotCi0gICAgaWYgKG1lbWNtcCh1dWlkLCAmZ1Zpc3VhbGl6ZXJEZXNjcmlwdG9yLnV1aWQsIHNpemVvZihlZmZlY3RfdXVpZF90KSkgIT0gMCkgewotICAgICAgICByZXR1cm4gLUVJTlZBTDsKLSAgICB9Ci0KLSAgICBWaXN1YWxpemVyQ29udGV4dCAqcENvbnRleHQgPSBuZXcgVmlzdWFsaXplckNvbnRleHQ7Ci0KLSAgICBwQ29udGV4dC0+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W50ICopIHBSZXBseURhdGEgPSBWaXN1YWxpemVyX2luaXQocENvbnRleHQpOwotICAgICAgICBicmVhazsKLSAgICBjYXNlIEVGRkVDVF9DTURfU0VUX0NPTkZJRzoKLSAgICAgICAgaWYgKHBDbWREYXRhID09IE5VTEwgfHwgY21kU2l6ZSAhPSBzaXplb2YoZWZmZWN0X2NvbmZpZ190KQotICAgICAgICAgICAgICAgIHx8IHBSZXBseURhdGEgPT0gTlVMTCB8fCAqcmVwbHlTaXplICE9IHNpemVvZihpbnQpKSB7Ci0gICAgICAgICAgICByZXR1cm4gLUVJTlZBTDsKLSAgICAgICAgfQotICAgICAgICAqKGludCAqKSBwUmVwbHlEYXRhID0gVmlzdWFsaXplcl9zZXRDb25maWcocENvbnRleHQsCi0gICAgICAgICAgICAgICAgKGVmZmVjdF9jb25maWdfdCAqKSBwQ21kRGF0YSk7Ci0gICAgICAgIGJyZWFrOwotICAgIGNhc2UgRUZGRUNUX0NNRF9HRVRfQ09ORklHOgotICAgICAgICBpZiAocFJlcGx5RGF0YSA9PSBOVUxMIHx8Ci0gICAgICAgICAgICAqcmVwbHlTaXplICE9IHNpemVvZihlZmZlY3RfY29uZmlnX3QpKSB7Ci0gICAgICAgICAgICByZXR1cm4gLUVJTlZBTDsKLSAgICAgICAgfQotICAgICAgICBWaXN1YWxpemVyX2dldENvbmZpZyhwQ29udGV4dCwgKGVmZmVjdF9jb25maWdfdCAqKXBSZXBseURhdGEpOwotICAgICAgICBicmVhazsKLSAgICBjYXNlIEVGRkVDVF9DTURfUkVTRVQ6Ci0gICAgICAgIFZpc3VhbGl6ZXJfcmVzZXQocENvbnRleHQpOwotICAgICAgICBicmVhazsKLSAgICBjYXNlIEVGRkVDVF9DTURfRU5BQkxFOgotICAgICAgICBpZiAocFJlcGx5RGF0YSA9PSBOVUxMIHx8ICpyZXBseVNpemUgIT0gc2l6ZW9mKGludCkpIHsKLSAgICAgICAgICAgIHJldHVybiAtRUlOVkFMOwotICAgICAgICB9Ci0g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KGVmZmVjdF9wYXJhbV90KSArIHNpemVvZih1aW50MzJfdCkgKyBzaXplb2YodWludDMyX3QpKSB8fAotICAgICAgICAgICAgcFJlcGx5RGF0YSA9PSBOVUxMIHx8ICpyZXBseVNpemUgIT0gc2l6ZW9mKGludDMyX3QpKSB7Ci0gICAgICAgICAgICByZXR1cm4gLUVJTlZBTDsKLSAgICAgICAgfQotICAgICAgICAqKGludDMyX3QgKilwUmVwbHlEYXRhID0gMDsKLSAgICAgICAgZWZmZWN0X3BhcmFtX3QgKnAgPSAoZWZmZWN0X3BhcmFtX3QgKilwQ21kRGF0YTsKLSAgICAgICAgaWYgKHAtPnBzaXplICE9IHNpemVvZih1aW50MzJfdCkgfHwKLSAgICAgICAgICAgIHAtPnZzaXplICE9IHNpemVvZih1aW50MzJfdCkgfHwKLSAgICAgICAgICAgICoodWludDMyX3QgKilwLT5kYXRhICE9IFZJU1VBTElaRVJfUEFSQU1fQ0FQVFVSRV9TSVpFKSB7Ci0gICAgICAgICAgICAqKGludDMyX3QgKilwUmVwbHlEYXRhID0gLUVJTlZBTDsKLSAgICAgICAgICAgIGJyZWFrOzsKLSAgICAgICAgfQotICAgICAgICBwQ29udGV4dC0+bUNhcHR1cmVTaXplID0gKigodWludDMyX3QgKilwLT5kYXRhICsgMSk7Ci0gICAgICAgIEFMT0dWKCJzZXQgbUNhcHR1cmVTaXplID0gJWQiLCBwQ29udGV4dC0+bUNhcHR1cmVTaXplKTsKLSAgICAgICAgfSBicmVhazsKLSAgICBjYXNlIEVGRkVDVF9DTURfU0VUX0RFVklDRToKLSAgICBjYXNlIEVGRkVDVF9DTURfU0VUX1ZPTFVNRToKLSAgICBjYXNlIEVGRkVDVF9DTURfU0VUX0FVRElPX01PREU6Ci0gICAgICAgIGJyZWFrOwotCi0KLSAgICBjYXNlIFZJU1VBTElaRVJfQ01EX0NBUFRVUkU6Ci0gICAgICAgIGlmIChwUmVwbHlEYXRhID09IE5VTEwgfHwgKnJlcGx5U2l6ZSAhPSBwQ29udGV4dC0+bUNhcHR1cmVTaXplKSB7Ci0gICAgICAgICAgICBBTE9HVigiVklTVUFMSVpFUl9DTURfQ0FQVFVSRSgpIGVycm9yICpyZXBseVNpemUgJWQgcENvbnRleHQtPm1DYXB0dXJlU2l6ZSAlZCIsCi0gICAgICAgICAgICAgICAgICAgICpyZXBseVNpemUsIHBDb250ZXh0LT5tQ2FwdHVyZVNpemUpOwotICAgICAgICAgICAgcmV0dXJuIC1FSU5WQUw7Ci0gICAgICAgIH0KLSAgICAgICAgaWYgKHBDb250ZXh0LT5tU3RhdGUgPT0gVklTVUFMSVpFUl9TVEFURV9BQ1RJVkUpIHsKLSAgICAgICAgICAgIG1lbWNweShwUmVwbHlEYXRhLAotICAgICAgICAgICAgICAgICAgIHBDb250ZXh0LT5tQ2FwdHVyZUJ1ZltwQ29udGV4dC0+bUN1cnJlbnRCdWYgXiAxXSwKLSAgICAgICAgICAgICAgICAgICBwQ29udGV4dC0+bUNhcHR1cmVTaXplKTsKLSAgICAgICAgICAgIC8vIGlmIGF1ZGlvIGZyYW1ld29yayBoYXMgc3RvcHBlZCBwbGF5aW5nIGF1ZGlvIGFsdGhvdWdoIHRoZSBlZmZlY3QgaXMgc3RpbGwKLSAgICAgICAgICAgIC8vIGFjdGl2ZSB3ZSBtdXN0IGNsZWFyIHRoZSBjYXB0dXJlIGJ1ZmZlciB0byByZXR1cm4gc2lsZW5jZQotICAgICAgICAgICAgaWYgKChwQ29udGV4dC0+bUxhc3RCdWYgPT0gcENvbnRleHQtPm1DdXJyZW50QnVmKSAmJgotICAgICAgICAgICAgICAgICAgICAocENvbnRleHQtPm1CdWZmZXJVcGRhdGVUaW1lLnR2X3NlYyAhPSAwKSkgewotICAgICAgICAgICAgICAgIHN0cnVjdCB0aW1lc3BlYyB0czsKLSAgICAgICAgICAgICAgICBpZiAoY2xvY2tfZ2V0dGltZShDTE9DS19NT05PVE9OSUMsICZ0cykgPT0gMCkgewotICAgICAgICAgICAgICAgICAgICB0aW1lX3Qgc2VjcyA9IHRzLnR2X3NlYyAtIHBDb250ZXh0LT5tQnVmZmVyVXBkYXRlVGltZS50dl9zZWM7Ci0gICAgICAgICAgICAgICAgICAgIGxvbmcgbnNlYyA9IHRzLnR2X25zZWMgLSBwQ29udGV4dC0+bUJ1ZmZlclVwZGF0ZVRpbWUudHZfbnNlYzsKLSAgICAgICAgICAgICAgICAgICAgaWYgKG5zZWMgPCAwKSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICAtLXNlY3M7Ci0gICAgICAgICAgICAgICAgICAgICAgICBuc2VjICs9IDEwMDAwMDAwMDA7Ci0gICAgICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICAgICAgdWludDMyX3QgZGVsdGFNcyA9IHNlY3MgKiAxMDAwICsgbnNlYyAvIDEwMDAwMDA7Ci0gICAgICAgICAgICAgICAgICAgIGlmIChkZWx0YU1zID4gTUFYX1NUQUxMX1RJTUVfTVMpIHsKLSAgICAgICAgICAgICAgICAgICAgICAgIEFMT0dWKCJjYXB0dXJlIGdvaW5nIHRvIGlkbGUiKTsKLSAgICAgICAgICAgICAgICAgICAgICAgIHBDb250ZXh0LT5tQnVmZmVyVXBkYXRlVGltZS50dl9zZWMgPSAwOwotICAgICAgICAgICAgICAgICAgICAgICAgbWVtc2V0KHBDb250ZXh0LT5tQ2FwdHVyZUJ1ZltwQ29udGV4dC0+bUN1cnJlbnRCdWYgXiAxXSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMHg4MCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcENvbnRleHQtPm1DYXB0dXJlU2l6ZSk7Ci0gICAgICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICB9Ci0gICAgICAgICAgICBwQ29udGV4dC0+bUxhc3RCdWYgPSBwQ29udGV4dC0+bUN1cnJlbnRCdWY7Ci0gICAgICAgIH0gZWxzZSB7Ci0gICAgICAgICAgICBtZW1zZ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6OmRlc2NyaXB0b3IoKSBjb25zdAotewotICAgIHJldHVybiBtRGVzY3JpcHRvcjsKLX0KLQotYm9vbCBBdWRpb0VmZmVjdDo6Z2V0RW5hYmxlZCgpIGNvbnN0Ci17Ci0gICAgcmV0dXJuIChtRW5hYmxlZCAhPSAwKTsKLX0KLQotc3RhdHVzX3QgQXVkaW9FZmZlY3Q6OnNldEVuYWJsZWQoYm9vbCBlbmFibGVkKQotewotICAgIGlmIChtU3RhdHVzICE9IE5PX0VSUk9SKSB7Ci0gICAgICAgIHJldHVybiAobVN0YXR1cyA9PSBBTFJFQURZX0VYSVNUUykgPyAoc3RhdHVzX3QpIElOVkFMSURfT1BFUkFUSU9OIDogbVN0YXR1czsKLSAgICB9Ci0KLSAgICBzdGF0dXNfdCBzdGF0dXMgPSBOT19FUlJPUjsKLQotICAgIEF1dG9NdXRleCBsb2NrKG1Mb2NrKTsKLSAgICBpZiAoZW5hYmxlZCAhPSBtRW5hYmxlZCkgewotICAgICAgICBpZiAoZW5hYmxlZCkgewotICAgICAgICAgICAgQUxPR1YoImVuYWJsZSAlcCIsIHRoaXMpOwotICAgICAgICAgICAgc3RhdHVzID0gbUlFZmZlY3QtPmVuYWJsZSgpOwotICAgICAgICB9IGVsc2UgewotICAgICAgICAgICAgQUxPR1YoImRpc2FibGUgJXAiLCB0aGlzKTsKLSAgICAgICAgICAgIHN0YXR1cyA9IG1JRWZmZWN0LT5kaXNhYmxlKCk7Ci0gICAgICAgIH0KLSAgICAgICAgaWYgKHN0YXR1cyA9PSBOT19FUlJPUikgewotICAgICAgICAgICAgbUVuYWJsZWQgPSBlbmFibGVkOwotICAgICAgICB9Ci0gICAgfQotICAgIHJldHVybiBzdGF0dXM7Ci19Ci0KLXN0YXR1c190IEF1ZGlvRWZmZWN0Ojpjb21tYW5kKHVpbnQzMl90IGNtZENvZGUsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICB1aW50MzJfdCBjbWRTaXplLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdm9pZCAqY21kRGF0YSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHVpbnQzMl90ICpyZXBseVNpemUsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2b2lkICpyZXBseURhdGEpCi17Ci0gICAgaWYgKG1TdGF0dXMgIT0gTk9fRVJST1IgJiYgbVN0YXR1cyAhPSBBTFJFQURZX0VYSVNUUykgewotICAgICAgICBBTE9HVigiY29tbWFuZCgpIGJhZCBzdGF0dXMgJWQiLCBtU3RhdHVzKTsKLSAgICAgICAgcmV0dXJuIG1TdGF0dXM7Ci0gICAgfQotCi0gICAgaWYgKGNtZENvZGUgPT0gRUZGRUNUX0NNRF9FTkFCTEUgfHwgY21kQ29kZSA9PSBFRkZFQ1RfQ01EX0RJU0FCTEUpIHsKLSAgICAgICAgaWYgKG1FbmFibGVkID09IChjbWRDb2RlID09IEVGRkVDVF9DTURfRU5BQkxFKSkgewotICAgICAgICAgICAgcmV0dXJuIE5PX0VSUk9SOwotICAgICAgICB9Ci0gICAgICAgIGlmIChyZXBseVNpemUgPT0gTlVMTCB8fCAqcmVwbHlTaXplICE9IHNpemVvZihzdGF0dXNfdCkgfHwgcmVwbHlEYXRhID09IE5VTEwpIHsKLSAgICAgICAgICAgIHJldHVybiBCQURfVkFMVUU7Ci0gICAgICAgIH0KLSAgICAgICAgbUxvY2subG9jaygpOwotICAgIH0KLQotICAgIHN0YXR1c190IHN0YXR1cyA9IG1JRWZmZWN0LT5jb21tYW5kKGNtZENvZGUsIGNtZFNpemUsIGNtZERhdGEsIHJlcGx5U2l6ZSwgcmVwbHlEYXRhKTsKLQotICAgIGlmIChjbWRDb2RlID09IEVGRkVDVF9DTURfRU5BQkxFIHx8IGNtZENvZGUgPT0gRUZGRUNUX0NNRF9ESVNBQkxFKSB7Ci0gICAgICAgIGlmIChzdGF0dXMgPT0gTk9fRVJST1IpIHsKLSAgICAgICAgICAgIHN0YXR1cyA9ICooc3RhdHVzX3QgKil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zZXNzaW9uSWQgPT0gMCApIHsKLSAgICAgICAgbVNlc3Npb25JZCA9IEF1ZGlvU3lzdGVtOjpuZXdBdWRpb1Nlc3Npb25JZCgpOwotICAgIH0gZWxzZSB7Ci0gICAgICAgIG1TZXNzaW9uSWQgPSBzZXNzaW9uSWQ7Ci0gICAgfQotICAgIEFMT0dWKCJzZXQoKTogbVNlc3Npb25JZCAlZCIsIG1TZXNzaW9uSWQpOwotCi0gICAgYXVkaW9faW9faGFuZGxlX3QgaW5wdXQgPSBBdWRpb1N5c3RlbTo6Z2V0SW5wdXQoaW5wdXRTb3VyY2UsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2FtcGxlUmF0ZSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBmb3JtYXQsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY2hhbm5lbE1hc2ssCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKGF1ZGlvX2luX2Fjb3VzdGljc190KWZsYWdzLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1TZXNzaW9uSWQpOwotICAgIGlmIChpbnB1dCA9PSAwKSB7Ci0gICAgICAgIEFMT0dFKCJDb3VsZCBub3QgZ2V0IGF1ZGlvIGlucHV0IGZvciByZWNvcmQgc291cmNlICVkIiwgaW5wdXRTb3VyY2UpOwotICAgICAgICByZXR1cm4gQkFEX1ZBTFVFOwotICAgIH0KLQotICAgIC8vIHZhbGlkYXRlIGZyYW1lY291bnQKLSAgICBpbnQgbWluRnJhbWVDb3VudCA9IDA7Ci0gICAgc3RhdHVzX3Qgc3RhdHVzID0gZ2V0TWluRnJhbWVDb3VudCgmbWluRnJhbWVDb3VudCwgc2FtcGxlUmF0ZSwgZm9ybWF0LCBjaGFubmV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gICAgICAgICAgICAgICAgdGlkID0gMDsKLSAgICAgICAgICAgIH0KLSAgICAgICAgICAgIC8vIHRocmVhZCBibG9ja3MgaW4gcmVhZHlUb1J1bigpCi0gICAgICAgIH0gZWxzZSB7Ci0gICAgICAgICAgICB0aWQgPSAwOyAgICAvLyBub3QgZ2V0dGlkKCkKLSAgICAgICAgfQotCi0gICAgICAgIGNibGstPmxvY2subG9jaygpOwotICAgICAgICBpZiAoIShjYmxrLT5mbGFncyAmIENCTEtfSU5WQUxJRF9NU0spKSB7Ci0gICAgICAgICAgICBjYmxrLT5sb2NrLnVubG9jaygpOwotICAgICAgICAgICAgQUxPR1YoIm1BdWRpb1JlY29yZC0+c3RhcnQodGlkPSVkKSIsIHRpZCk7Ci0gICAgICAgICAgICByZXQgPSBtQXVkaW9SZWNvcmQtPnN0YXJ0KHRpZCk7Ci0gICAgICAgICAgICBjYmxrLT5sb2NrLmxvY2soKTsKLSAgICAgICAgICAgIGlmIChyZXQgPT0gREVBRF9PQkpFQ1QpIHsKLSAgICAgICAgICAgICAgICBhbmRyb2lkX2F0b21pY19vcihDQkxLX0lOVkFMSURfT04sICZjYmxrLT5mbGFncyk7Ci0gICAgICAgICAgICB9Ci0gICAgICAgIH0KLSAgICAgICAgaWYgKGNibGstPmZsYWdzICYgQ0JMS19JTlZBTElEX01TSykgewotICAgICAgICAgICAgcmV0ID0gcmVzdG9yZVJlY29yZF9sKGNibGspOwotICAgICAgICB9Ci0gICAgICAgIGNibGstPmxvY2sudW5sb2NrKCk7Ci0gICAgICAgIGlmIChyZXQgPT0gTk9fRVJST1IpIHsKLSAgICAgICAgICAgIG1OZXdQb3NpdGlvbiA9IGNibGstPnVzZXIgKyBtVXBkYXRlUGVyaW9kOwotICAgICAgICAgICAgY2Jsay0+YnVmZmVyVGltZW91dE1zID0gTUFYX1JVTl9USU1FT1VUX01TOwotICAgICAgICAgICAgY2Jsay0+d2FpdFRpbWVNcyA9IDA7Ci0gICAgICAgICAgICBpZiAodCAhPSAwKSB7Ci0gICAgICAgICAgICAgICAgLy8gdGhyZWFkIHVuYmxvY2tzIGluIHJlYWR5VG9SdW4oKSBhbmQgcmV0dXJucyBOT19FUlJPUgotICAgICAgICAgICAgICAgIG1SZWFkeVRvUnVuID0gTk9fRVJST1I7Ci0gICAgICAgICAgICAgICAgbUNvbmRpdGlvbi5zaWduYWwoKTsKLSAgICAgICAgICAgIH0gZWxzZSB7Ci0gICAgICAgICAgICAgICAgbVByZXZpb3VzUHJpb3JpdHkgPSBnZXRwcmlvcml0eShQUklPX1BST0NFU1MsIDApOwotICAgICAgICAgICAgICAgIG1QcmV2aW91c1NjaGVkdWxpbmdHcm91cCA9IGFuZHJvaWRHZXRUaHJlYWRTY2hlZHVsaW5nR3JvdXAoMCk7Ci0gICAgICAgICAgICAgICAgYW5kcm9pZFNldFRocmVhZFByaW9yaXR5KDAsIEFORFJPSURfUFJJT1JJVFlfQVVESU8pOwotICAgICAgICAgICAgfQotICAgICAgICB9IGVsc2UgewotICAgICAgICAgICAgbUFjdGl2ZSA9IDA7Ci0gICAgICAgICAgICAvLyB0aHJlYWQgdW5ibG9ja3MgaW4gcmVhZHlUb1J1bigpIGFuZCByZXR1cm5zIE5PX0lOSVQKLSAgICAgICAgICAgIG1SZWFkeVRvUnVuID0gTk9fSU5JVDsKLSAgICAgICAgICAgIG1Db25kaXRpb24uc2lnbmFsKCk7Ci0gICAgICAgIH0KLSAgICB9Ci0KLSAgICByZXR1cm4gcmV0OwotfQotCi1zdGF0dXNfdCBBdWRpb1JlY29yZDo6c3RvcCgpCi17Ci0gICAgc3A8Q2xpZW50UmVjb3JkVGhyZWFkPiB0ID0gbUNsaWVudFJlY29yZFRocmVhZDsKLQotICAgIEFMT0dWKCJzdG9wIik7Ci0KLSAgICBBdXRvTXV0ZXggbG9jayhtTG9jayk7Ci0gICAgaWYgKG1BY3RpdmUgPT0gMSkgewotICAgICAgICBtQWN0aXZlID0gMDsKLSAgICAgICAgbUNibGstPmN2LnNpZ25hb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xlUmF0ZSwgZm9ybWF0LAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNoYW5uZWxNYXNrLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZyYW1lQ291bnQsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgSUF1ZGlvRmxpbmdlcjo6VFJBQ0tfREVGQVVMVCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmbVNlc3Npb25JZCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmc3RhdHVzKTsKLQotICAgIGlmIChyZWNvcmQgPT0gMCkgewotICAgICAgICBBTE9HRSgiQXVkaW9GbGluZ2VyIGNvdWxkIG5vdCBjcmVhdGUgcmVjb3JkIHRyYWNrLCBzdGF0dXM6ICVkIiwgc3RhdHVzKTsKLSAgICAgICAgcmV0dXJuIHN0YXR1czsKLSAgICB9Ci0gICAgc3A8SU1lbW9yeT4gY2JsayA9IHJlY29yZC0+Z2V0Q2JsaygpOwotICAgIGlmIChjYmxrID09IDApIHsKLSAgICAgICAgQUxPR0UoIkNvdWxkIG5vdCBnZXQgY29udHJvbCBibG9jayIpOwotICAgICAgICByZXR1cm4gTk9fSU5JVDsKLSAgICB9Ci0gICAgbUF1ZGlvUmVjb3JkLmNsZWFyKCk7Ci0gICAgbUF1ZGlvUmVjb3JkID0gcmVjb3JkOwotICAgIG1DYmxrTWVtb3J5LmNsZWFyKCk7Ci0gICAgbUNibGtNZW1vcnkgPSBjYmxrOwotICAgIG1DYmxrID0gc3RhdGljX2Nhc3Q8YXVkaW9fdHJhY2tfY2Jsa190Kj4oY2Jsay0+cG9pbnRlcigpKTsKLSAgICBtQ2Jsay0+YnVmZmVycyA9IChjaGFyKiltQ2JsayArIHNpemV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VMWSghYWN0aXZlKSkgewotICAgICAgICAgICAgICAgIGNibGstPmxvY2sudW5sb2NrKCk7Ci0gICAgICAgICAgICAgICAgcmV0dXJuIE5PX01PUkVfQlVGRkVSUzsKLSAgICAgICAgICAgIH0KLSAgICAgICAgICAgIGlmIChDQ19VTkxJS0VMWSghd2FpdENvdW50KSkgewotICAgICAgICAgICAgICAgIGNibGstPmxvY2sudW5sb2NrKCk7Ci0gICAgICAgICAgICAgICAgcmV0dXJuIFdPVUxEX0JMT0NLOwotICAgICAgICAgICAgfQotICAgICAgICAgICAgaWYgKCEoY2Jsay0+ZmxhZ3MgJiBDQkxLX0lOVkFMSURfTVNLKSkgewotICAgICAgICAgICAgICAgIG1Mb2NrLnVubG9jaygpOwotICAgICAgICAgICAgICAgIHJlc3VsdCA9IGNibGstPmN2LndhaXRSZWxhdGl2ZShjYmxrLT5sb2NrLCBtaWxsaXNlY29uZHMod2FpdFRpbWVNcykpOwotICAgICAgICAgICAgICAgIGNibGstPmxvY2sudW5sb2NrKCk7Ci0gICAgICAgICAgICAgICAgbUxvY2subG9jaygpOwotICAgICAgICAgICAgICAgIGlmIChtQWN0aXZlID09IDApIHsKLSAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHN0YXR1c190KFNUT1BQRUQpOwotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICBjYmxrLT5sb2NrLmxvY2soKTsKLSAgICAgICAgICAgIH0KLSAgICAgICAgICAgIGlmIChjYmxrLT5mbGFncyAmIENCTEtfSU5WQUxJRF9NU0spIHsKLSAgICAgICAgICAgICAgICBnb3RvIGNyZWF0ZV9uZXdfcmVjb3JkOwotICAgICAgICAgICAgfQotICAgICAgICAgICAgaWYgKENDX1VOTElLRUxZKHJlc3VsdCAhPSBOT19FUlJPUikpIHsKLSAgICAgICAgICAgICAgICBjYmxrLT53YWl0VGltZU1zICs9IHdhaXRUaW1lTXM7Ci0gICAgICAgICAgICAgICAgaWYgKGNibGstPndhaXRUaW1lTXMgPj0gY2Jsay0+YnVmZmVyVGltZW91dE1zKSB7Ci0gICAgICAgICAgICAgICAgICAgIEFMT0dXKCAgICJvYnRhaW5CdWZmZXIgdGltZWQgb3V0IChpcyB0aGUgQ1BVIHBlZ2dlZD8pICIKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAidXNlcj0lMDh4LCBzZXJ2ZXI9JTA4eCIsIGNibGstPnVzZXIsIGNibGstPnNlcnZlcik7Ci0gICAgICAgICAgICAgICAgICAgIGNibGstPmxvY2sudW5sb2NrKCk7Ci0gICAgICAgICAgICAgICAgICAgIHJlc3VsdCA9IG1BdWRpb1JlY29yZC0+c3RhcnQoMCk7ICAgIC8vIGNhbGxiYWNrIHRocmVhZCBoYXNuJ3QgY2hhbmdlZAotICAgICAgICAgICAgICAgICAgICBjYmxrLT5sb2NrLmxvY2soKTsKLSAgICAgICAgICAgICAgICAgICAgaWYgKHJlc3VsdCA9PSBERUFEX09CSkVDVCkgewotICAgICAgICAgICAgICAgICAgICAgICAgYW5kcm9pZF9hdG9taWNfb3IoQ0JMS19JTlZBTElEX09OLCAmY2Jsay0+ZmxhZ3MpOwotY3JlYXRlX25ld19yZWNvcmQ6Ci0gICAgICAgICAgICAgICAgICAgICAgICByZXN1bHQgPSBBdWRpb1JlY29yZDo6cmVzdG9yZVJlY29yZF9sKGNibGspOwotICAgICAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgICAgIGlmIChyZXN1bHQgIT0gTk9fRVJST1IpIHsKLSAgICAgICAgICAgICAgICAgICAgICAgIEFMT0dXKCJvYnRhaW5CdWZmZXIgY3JlYXRlIFRyYWNrIGVycm9yICVkIiwgcmVzdWx0KTsKLSAgICAgICAgICAgICAgICAgICAgICAgIGNibGstPmxvY2sudW5sb2NrKCk7Ci0gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gcmVzdWx0OwotICAgICAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgICAgIGNibGstPndhaXRUaW1lTXMgPSAwOwotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICBpZiAoLS13YWl0Q291bnQgPT0gMCkgewotICAgICAgICAgICAgICAgICAgICBjYmxrLT5sb2NrLnVubG9jaygpOwotICAgICAgICAgICAgICAgICAgICByZXR1cm4gVElNRURfT1VUOwotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgIH0KLSAgICAgICAgICAgIC8vIHJlYWQgdGhlIHNlcnZlciBjb3VudCBhZ2FpbgotICAgICAgICBzdGFydF9sb29wX2hlcmU6Ci0gICAgICAgICAgICBmcmFtZXNSZWFkeSA9IGNibGstPmZyYW1lc1JlYWR5KCk7Ci0gICAgICAgIH0KLSAgICAgICAgY2Jsay0+bG9jay51bmxvY2soKTsKLSAgICB9Ci0KLSAgICBjYmxrLT53YWl0VGltZU1zID0gMDsKLQotICAgIGlmIChmcmFtZXNSZXEgPiBmcmFtZXNSZWFkeSkgewotICAgICAgICBmcmFtZXNSZXEgPSBmcmFtZXNSZWFkeTsKLSAgICB9Ci0KLSAgICB1aW50MzJfdCB1ID0gY2Jsay0+dXNlcjsKLSAgICB1aW50MzJfdCBidWZmZXJFbmQgPSBjYmxrLT51c2VyQmFzZSArIGNibGstPmZyYW1lQ291bnQ7Ci0KLSAgICBpZiAodSArIGZyYW1lc1JlcSA+IGJ1ZmZlckVuZCkgewotICAgICAgICBmcmFtZXNSZXEgPSBidWZmZXJFbmQgLSB1OwotICAgIH0KLQotICAgIGF1ZGlvQnVmZmVyLT5mbGFncyAgICAgICA9IDA7Ci0gICAgYXVkaW9CdWZmZXItPmNoYW5uZWxDb3VudD0gbUNoYW5uZWxDb3VudDsKLSAgICBhdWRpb0J1ZmZlci0+Zm9ybWF0ICAgICAgPSBtRm9ybWF0OwotICAgIGF1ZGlvQnVmZmVyLT5mcmFtZUNvdW50ICA9IGZyYW1lc1JlcTsKLSAgICBhdWRpb0J1ZmZlci0+c2l6ZSAgICAgICAgPSBmcmFtZXNSZXEqY2Jsay0+Zn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UZGRVJTKSwgIkVycm9yIG9idGFpbmluZyBhbiBhdWRpbyBidWZmZXIsIGdpdmluZyB1cC4iKTsKLSAgICAgICAgICAgICAgICByZXR1cm4gZmFsc2U7Ci0gICAgICAgICAgICB9Ci0gICAgICAgICAgICBicmVhazsKLSAgICAgICAgfQotICAgICAgICBpZiAoZXJyID09IHN0YXR1c190KFNUT1BQRUQpKSByZXR1cm4gZmFsc2U7Ci0KLSAgICAgICAgc2l6ZV90IHJlcVNpemUgPSBhdWRpb0J1ZmZlci5zaXplOwotICAgICAgICBtQ2JmKEVWRU5UX01PUkVfREFUQSwgbVVzZXJEYXRhLCAmYXVkaW9CdWZmZXIpOwotICAgICAgICByZWFkU2l6ZSA9IGF1ZGlvQnVmZmVyLnNpemU7Ci0KLSAgICAgICAgLy8gU2FuaXR5IGNoZWNrIG9uIHJldHVybmVkIHNpemUKLSAgICAgICAgaWYgKHNzaXplX3QocmVhZFNpemUpIDw9IDApIHsKLSAgICAgICAgICAgIC8vIFRoZSBjYWxsYmFjayBpcyBkb25lIGZpbGxpbmcgYnVmZmVycwotICAgICAgICAgICAgLy8gS2VlcCB0aGlzIHRocmVhZCBnb2luZyB0byBoYW5kbGUgdGltZWQgZXZlbnRzIGFuZAotICAgICAgICAgICAgLy8gc3RpbGwgdHJ5IHRvIGdldCBtb3JlIGRhdGEgaW4gaW50ZXJ2YWxzIG9mIFdBSVRfUEVSSU9EX01TCi0gICAgICAgICAgICAvLyBidXQgZG9uJ3QganVzdCBsb29wIGFuZCBibG9jayB0aGUgQ1BVLCBzbyB3YWl0Ci0gICAgICAgICAgICB1c2xlZXAoV0FJVF9QRVJJT0RfTVMqMTAwMCk7Ci0gICAgICAgICAgICBicmVhazsKLSAgICAgICAgfQotICAgICAgICBpZiAocmVhZFNpemUgPiByZXFTaXplKSByZWFkU2l6ZSA9IHJlcVNpemU7Ci0KLSAgICAgICAgYXVkaW9CdWZmZXIuc2l6ZSA9IHJlYWRTaXplOwotICAgICAgICBhdWRpb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vX2lvX2hhbmRsZV90IG91dHB1dCkKLXsKLSAgICBjb25zdCBzcDxJQXVkaW9Qb2xpY3lTZXJ2aWNlPiYgYXBzID0gQXVkaW9TeXN0ZW06OmdldF9hdWRpb19wb2xpY3lfc2VydmljZSgpOwotICAgIGlmIChhcHMgPT0gMCkgcmV0dXJuOwotICAgIGFwcy0+cmVsZWFzZU91dHB1dChvdXRwdXQpOwotfQotCi1hdWRpb19pb19oYW5kbGVfdCBBdWRpb1N5c3RlbTo6Z2V0SW5wdXQoYXVkaW9fc291cmNlX3QgaW5wdXRTb3VyY2UsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB1aW50MzJfdCBzYW1wbGluZ1JhdGUsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBhdWRpb19mb3JtYXRfdCBmb3JtYXQsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB1aW50MzJfdCBjaGFubmVscywKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGF1ZGlvX2luX2Fjb3VzdGljc190IGFjb3VzdGljcywKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGludCBzZXNzaW9uSWQpCi17Ci0gICAgY29uc3Qgc3A8SUF1ZGlvUG9saWN5U2VydmljZT4mIGFwcyA9IEF1ZGlvU3lzdGVtOjpnZXRfYXVkaW9fcG9saWN5X3NlcnZpY2UoKTsKLSAgICBpZiAoYXBzID09IDApIHJldHVybiAwOwotICAgIHJldHVybiBhcHMtPmdldElucHV0KGlucHV0U291cmNlLCBzYW1wbGluZ1JhdGUsIGZvcm1hdCwgY2hhbm5lbHMsIGFjb3VzdGljcywgc2Vzc2lvbklkKTsKLX0KLQotc3RhdHVzX3QgQXVkaW9TeXN0ZW06OnN0YXJ0SW5wdXQoYXVkaW9faW9faGFuZGxlX3QgaW5wdXQpCi17Ci0gICAgY29uc3Qgc3A8SUF1ZGlvUG9saWN5U2VydmljZT4mIGFwcy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VmZmVjdElkID0gMDsKLQotICAgIC8vIGNyZWF0ZSB0aGUgSUF1ZGlvVHJhY2sKLSAgICBzdGF0dXNfdCBzdGF0dXMgPSBjcmVhdGVUcmFja19sKHN0cmVhbVR5cGUsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2FtcGxlUmF0ZSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBmb3JtYXQsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKHVpbnQzMl90KWNoYW5uZWxNYXNrLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZyYW1lQ291bnQsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZmxhZ3MsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2hhcmVkQnVmZmVyLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG91dHB1dCk7Ci0KLSAgICBpZiAoc3RhdHVzICE9IE5PX0VSUk9SKSB7Ci0gICAgICAgIHJldHVybiBzdGF0dXM7Ci0gICAgfQotCi0gICAgaWYgKGNiZiAhPSBOVUxMKSB7Ci0gICAgICAgIG1BdWRpb1RyYWNrVGhyZWFkID0gbmV3IEF1ZGlvVHJhY2tUaHJlYWQoKnRoaXMsIHRocmVhZENhbkNhbGxKYXZhKTsKLSAgICB9Ci0KLSAgICBtU3RhdHVzID0gTk9fRVJST1I7Ci0KLSAgICBtU3RyZWFtVHlwZSA9IHN0cmVhbVR5cGU7Ci0gICAgbUZvcm1hdCA9IGZvcm1hdDsKLSAgICBtQ2hhbm5lbE1hc2sgPSAodWludDMyX3QpY2hhbm5lbE1hc2s7Ci0gICAgbUNoYW5uZWxDb3VudCA9IGNoYW5uZWxDb3VudDsKLSAgICBtU2hhcmVkQnVmZmVyID0gc2hhcmVkQnVmZmVyOwotICAgIG1NdXRlZCA9IGZhbHNlOwotICAgIG1BY3RpdmUgPSBmYWxzZTsKLSAgICBtQ2JmID0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Ci0gICAgICAgICAgICBtUHJldmlvdXNQcmlvcml0eSA9IGdldHByaW9yaXR5KFBSSU9fUFJPQ0VTUywgMCk7Ci0gICAgICAgICAgICBtUHJldmlvdXNTY2hlZHVsaW5nR3JvdXAgPSBhbmRyb2lkR2V0VGhyZWFkU2NoZWR1bGluZ0dyb3VwKDApOwotICAgICAgICAgICAgYW5kcm9pZFNldFRocmVhZFByaW9yaXR5KDAsIEFORFJPSURfUFJJT1JJVFlfQVVESU8pOwotICAgICAgICAgICAgdGlkID0gMDsgICAgLy8gbm90IGdldHRpZCgpCi0gICAgICAgIH0KLQotICAgICAgICBBTE9HVigic3RhcnQgJXAgYmVmb3JlIGxvY2sgY2JsayAlcCIsIHRoaXMsIG1DYmxrKTsKLSAgICAgICAgaWYgKCEoY2Jsay0+ZmxhZ3MgJiBDQkxLX0lOVkFMSURfTVNLKSkgewotICAgICAgICAgICAgY2Jsay0+bG9jay51bmxvY2soKTsKLSAgICAgICAgICAgIEFMT0dWKCJtQXVkaW9UcmFjay0+c3RhcnQodGlkPSVkKSIsIHRpZCk7Ci0gICAgICAgICAgICBzdGF0dXMgPSBtQXVkaW9UcmFjay0+c3RhcnQodGlkKTsKLSAgICAgICAgICAgIGNibGstPmxvY2subG9jaygpOwotICAgICAgICAgICAgaWYgKHN0YXR1cyA9PSBERUFEX09CSkVDVCkgewotICAgICAgICAgICAgICAgIGFuZHJvaWRfYXRvbWljX29yKENCTEtfSU5WQUxJRF9PTiwgJmNibGstPmZsYWdzKTsKLSAgICAgICAgICAgIH0KLSAgICAgICAgfQotICAgICAgICBpZiAoY2Jsay0+ZmxhZ3MgJiBDQkxLX0lOVkFMSURfTVNLKSB7Ci0gICAgICAgICAgICBzdGF0dXMgPSByZXN0b3JlVHJhY2tfbChjYmxrLCB0cnVlKTsKLSAgICAgICAgfQotICAgICAgICBjYmxrLT5sb2NrLnVubG9jaygpOwotICAgICAgICBpZiAoc3RhdHVzICE9IE5PX0VSUk9SKSB7Ci0gICAgICA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gKCgxMDAwICogYWZGcmFtZUNvdW50KS9hZlNhbXBsZVJhdGUpOwotICAgICAgICBpZiAobWluQnVmQ291bnQgPCAyKSBtaW5CdWZDb3VudCA9IDI7Ci0KLSAgICAgICAgaW50IG1pbkZyYW1lQ291bnQgPSAoYWZGcmFtZUNvdW50KnNhbXBsZVJhdGUqbWluQnVmQ291bnQpL2FmU2FtcGxlUmF0ZTsKLQotICAgICAgICBpZiAoc2hhcmVkQnVmZmVyID09IDApIHsKLSAgICAgICAgICAgIGlmIChmcmFtZUNvdW50ID09IDApIHsKLSAgICAgICAgICAgICAgICBmcmFtZUNvdW50ID0gbWluRnJhbWVDb3VudDsKLSAgICAgICAgICAgIH0KLSAgICAgICAgICAgIGlmIChtTm90aWZpY2F0aW9uRnJhbWVzQWN0ID09IDApIHsKLSAgICAgICAgICAgICAgICBtTm90aWZpY2F0aW9uRnJhbWVzQWN0ID0gZnJhbWVDb3VudC8yOwotICAgICAgICAgICAgfQotICAgICAgICAgICAgLy8gTWFrZSBzdXJlIHRoYXQgYXBwbGljYXRpb24gaXMgbm90aWZpZWQgd2l0aCBzdWZmaWNpZW50IG1hcmdpbgotICAgICAgICAgICAgLy8gYmVmb3JlIHVuZGVycnVuCi0gICAgICAgICAgICBpZiAobU5vdGlmaWNhdGlvbkZyYW1lc0FjdCA+ICh1aW50MzJfdClmcmFtZUNvdW50LzIpIHsKLSAgICAgICAgICAgICAgICBtTm90aWZpY2F0aW9uRnJhbWVzQWN0ID0gZnJhbWVDb3VudC8yOwotICAgICAgICAgICAgfQotICAgICAgICAgICAgaWYgKGZyYW1lQ291bnQgPCBtaW5GcmFtZUNvdW50KSB7Ci0gICAgICAgICAgICAgICAgLy8gbm90IEFMT0dXIGJlY2F1c2UgaXQgaGFwcGVucyBhbGwgdGhlIHRpbWUgd2hlbiBwbGF5aW5nIGtleSBjbGlja3Mgb3ZlciBBMkRQCi0gICAgICAgICAgICAgICAgQUxPR1YoIk1pbmltdW0gYnVmZmVyIHNpemU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HJhY2soZ2V0cGlkKCksCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzdHJlYW1UeXBlLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2FtcGxlUmF0ZSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZvcm1hdCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNoYW5uZWxNYXNrLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZnJhbWVDb3VudCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRyYWNrRmxhZ3MsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzaGFyZWRCdWZmZXIsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBvdXRwdXQsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmbVNlc3Npb25JZCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICZzdGF0dXMpOwotCi0gICAgaWYgKHRyYWNrID09IDApIHsKLSAgICAgICAgQUxPR0UoIkF1ZGlvRmxpbmdlciBjb3VsZCBub3QgY3JlYXRlIHRyYWNrLCBzdGF0dXM6ICVkIiwgc3RhdHVzKTsKLSAgICAgICAgcmV0dXJuIHN0YXR1czsKLSAgICB9Ci0gICAgc3A8SU1lbW9yeT4gY2JsayA9IHRyYWNrLT5nZXRDYmxrKCk7Ci0gICAgaWYgKGNibGsgPT0gMCkgewotICAgICAgICBBTE9HRSgiQ291bGQgbm90IGdldCBjb250cm9sIGJsb2NrIik7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ICAgICAgICBhY3RpdmUgPSBtQWN0aXZlOwotICAgICAgICAgICAgaWYgKENDX1VOTElLRUxZKCFhY3RpdmUpKSB7Ci0gICAgICAgICAgICAgICAgQUxPR1YoIk5vdCBhY3RpdmUgYW5kIE5PX01PUkVfQlVGRkVSUyIpOwotICAgICAgICAgICAgICAgIGNibGstPmxvY2sudW5sb2NrKCk7Ci0gICAgICAgICAgICAgICAgcmV0dXJuIE5PX01PUkVfQlVGRkVSUzsKLSAgICAgICAgICAgIH0KLSAgICAgICAgICAgIGlmIChDQ19VTkxJS0VMWSghd2FpdENvdW50KSkgewotICAgICAgICAgICAgICAgIGNibGstPmxvY2sudW5sb2NrKCk7Ci0gICAgICAgICAgICAgICAgcmV0dXJuIFdPVUxEX0JMT0NLOwotICAgICAgICAgICAgfQotICAgICAgICAgICAgaWYgKCEoY2Jsay0+ZmxhZ3MgJiBDQkxLX0lOVkFMSURfTVNLKSkgewotICAgICAgICAgICAgICAgIG1Mb2NrLnVubG9jaygpOwotICAgICAgICAgICAgICAgIHJlc3VsdCA9IGNibGstPmN2LndhaXRSZWxhdGl2ZShjYmxrLT5sb2NrLCBtaWxsaXNlY29uZHMod2FpdFRpbWVNcykpOwotICAgICAgICAgICAgICAgIGNibGstPmxvY2sudW5sb2NrKCk7Ci0gICAgICAgICAgICAgICAgbUxvY2subG9jaygpOwotICAgICAgICAgICAgICAgIGlmICghbUFjdGl2ZSkgewotICAgICAgICAgICAgICAgICAgICByZXR1cm4gc3RhdHVzX3QoU1RPUFBFRCk7Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgIGNibGstPmxvY2subG9jaygpOwotICAgICAgICAgICAgfQotCi0gICAgICAgICAgICBpZiAoY2Jsay0+ZmxhZ3MgJiBDQkxLX0lOVkFMSURfTVNLKSB7Ci0gICAgICAgICAgICAgICAgZ290byBjcmVhdGVfbmV3X3RyYWNrOwotICAgICAgICAgICAgfQotICAgICAgICAgICAgaWYgKENDX1VOTElLRUxZKHJlc3VsdCAhPSBOT19FUlJPUikpIHsKLSAgICAgICAgICAgICAgICBjYmxrLT53YWl0VGltZU1zICs9IHdhaXRUaW1lTXM7Ci0gICAgICAgICAgICAgICAgaWYgKGNibGstPndhaXRUaW1lTXMgPj0gY2Jsay0+YnVmZmVyVGltZW91dE1zKSB7Ci0gICAgICAgICAgICAgICAgICAgIC8vIHRpbWluZyBvdXQgd2hlbiBhIGxvb3AgaGFzIGJlZW4gc2V0IGFuZCB3ZSBoYXZlIGFscmVhZHkgd3JpdHRlbiB1cHRvIGxvb3AgZW5kCi0gICAgICAgICAgICAgICAgICAgIC8vIGlzIGEgbm9ybWFsIGNvbmRpdGlvbjogbm8gbmVlZCB0byB3YWtlIEF1ZGlvRmxpbmdlciB1cC4KLSAgICAgICAgICAgICAgICAgICAgaWYgKGNibGstPnVzZXIgPCBjYmxrLT5sb29wRW5kKSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICBBTE9HVyggICAib2J0YWluQnVmZmVyIHRpbWVkIG91dCAoaXMgdGhlIENQVSBwZWdnZWQ/KSAlcCAiCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICJ1c2VyPSUwOHgsIHNlcnZlcj0lMDh4IiwgdGhpcywgY2Jsay0+dXNlciwgY2Jsay0+c2VydmVyKTsKLSAgICAgICAgICAgICAgICAgICAgICAgIC8vdW5sb2NrIGNibGsgbXV0ZXggYmVmb3JlIGNhbGxpbmcgbUF1ZGlvVHJhY2stPnN0YXJ0KCkgKHNlZSBpc3N1ZSAjMTYxNzE0MCkKLSAgICAgICAgICAgICAgICAgICAgICAgIGNibGstPmxvY2sudW5sb2NrKCk7Ci0gICAgICAgICAgICAgICAgICAgICAgICByZXN1bHQgPSBtQXVkaW9UcmFjay0+c3RhcnQoMCk7IC8vIGNhbGxiYWNrIHRocmVhZCBoYXNuJ3QgY2hhbmdlZAotICAgICAgICAgICAgICAgICAgICAgICAgY2Jsay0+bG9jay5sb2NrKCk7Ci0gICAgICAgICAgICAgICAgICAgICAgICBpZiAocmVzdWx0ID09IERFQURfT0JKRUNUKSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgYW5kcm9pZF9hdG9taWNfb3IoQ0JMS19JTlZBTElEX09OLCAmY2Jsay0+ZmxhZ3MpOwotY3JlYXRlX25ld190cmFjazoKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXN1bHQgPSByZXN0b3JlVHJhY2tfbChjYmxrLCBmYWxzZSk7Ci0gICAgICAgICAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgICAgICAgICBpZiAocmVzdWx0ICE9IE5PX0VSUk9SKSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgQUxPR1coIm9idGFpbkJ1ZmZlciBjcmVhdGUgVHJhY2sgZXJyb3IgJWQiLCByZXN1bHQpOwotICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNibGstPmxvY2sudW5sb2NrKCk7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHJlc3VsdDsKLSAgICAgICAgICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgICAgICBjYmxrLT53YWl0VGltZU1zID0gMDsKLSAgICAgICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgICAgICBpZiAoLS13YWl0Q291bnQgPT0gMCkgewotICAgICAgICAgICAgICAgICAgICBjYmxrLT5sb2NrLnVubG9jaygpOwotICAgICAgICAgICAgICAgICAgICByZXR1cm4gVElNRURfT1VUOwotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgIH0KLSAgICAgICAgICAgIC8vIHJlYWQgdGhlIHNlcnZlciBjb3VudCBhZ2FpbgotICAgICAgICBzdGFydF9sb29wX2hlcmU6Ci0gICAgICAgICAgICBmcmFtZXNBdmFpbCA9IGNibGstPmZyYW1lc0F2YWlsYWJsZV9sKCk7Ci0gICAgICAgIH0KLSAgICAgICAgY2Jsay0+bG9jay51bmxvY2soKTsKL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IGlmIChhY3RpdmUgJiYgKGNibGstPmZyYW1lc0F2YWlsYWJsZSgpID09IGNibGstPmZyYW1lQ291bnQpKSB7Ci0gICAgICAgIEFMT0dWKCJVbmRlcnJ1biB1c2VyOiAleCwgc2VydmVyOiAleCwgZmxhZ3MgJTA0eCIsIGNibGstPnVzZXIsIGNibGstPnNlcnZlciwgY2Jsay0+ZmxhZ3MpOwotICAgICAgICBpZiAoIShhbmRyb2lkX2F0b21pY19vcihDQkxLX1VOREVSUlVOX09OLCAmY2Jsay0+ZmxhZ3MpICYgQ0JMS19VTkRFUlJVTl9NU0spKSB7Ci0gICAgICAgICAgICBtQ2JmKEVWRU5UX1VOREVSUlVOLCBtVXNlckRhdGEsIDApOwotICAgICAgICAgICAgaWYgKGNibGstPnNlcnZlciA9PSBjYmxrLT5mcmFtZUNvdW50KSB7Ci0gICAgICAgICAgICAgICAgbUNiZihFVkVOVF9CVUZGRVJfRU5ELCBtVXNlckRhdGEsIDApOwotICAgICAgICAgICAgfQotICAgICAgICAgICAgaWYgKG1TaGFyZWRCdWZmZXIgIT0gMCkgcmV0dXJuIGZhbHNlOwotICAgICAgICB9Ci0gICAgfQotCi0gICAgLy8gTWFuYWdlIGxvb3AgZW5kIGNhbGxiYWNrCi0gICAgd2hpbGUgKG1Mb29wQ291bnQgPiBjYmxrLT5sb29wQ291bnQpIHsKLSAgICAgICAgaW50IGxvb3BDb3VudCA9IC0xOwotICAgICAgICBtTG9vcENvdW50LS07Ci0gICAgICAgIGlmIChtTG9vcENvdW50ID49IDApIGxvb3BDb3VudCA9IG1Mb29wQ291bnQ7Ci0KLSAgICAgICAgbUNiZihFVkVOVF9MT09QX0VORCwgbVVzZXJEYXRhLCAodm9pZCAqKSZsb29wQ291bnQpOwotICAgIH0KLQotICAgIC8vIE1hbmFnZSBtYXJrZXIgY2FsbGJhY2sKLSAgICBpZiAoIW1NYXJrZXJSZWFjaGVkICYmIChtTWFya2VyUG9zaXRpb24gPiAwKSkgewotICAgICAgICBp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9sKCkgYW5kIGNyZWF0ZVRyYWNrX2woKQotICAgICAgICBBdWRpb1N5c3RlbTo6Y2xlYXJBdWRpb0NvbmZpZ0NhY2hlKCk7Ci0KLSAgICAgICAgLy8gaWYgdGhlIG5ldyBJQXVkaW9UcmFjayBpcyBjcmVhdGVkLCBjcmVhdGVUcmFja19sKCkgd2lsbCBtb2RpZnkgdGhlCi0gICAgICAgIC8vIGZvbGxvd2luZyBtZW1iZXIgdmFyaWFibGVzOiBtQXVkaW9UcmFjaywgbUNibGtNZW1vcnkgYW5kIG1DYmxrLgotICAgICAgICAvLyBJdCB3aWxsIGFsc28gZGVsZXRlIHRoZSBzdHJvbmcgcmVmZXJlbmNlcyBvbiBwcmV2aW91cyBJQXVkaW9UcmFjayBhbmQgSU1lbW9yeQotICAgICAgICByZXN1bHQgPSBjcmVhdGVUcmFja19sKG1TdHJlYW1UeXBlLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNibGstPnNhbXBsZVJhdGUsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbUZvcm1hdCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBtQ2hhbm5lbE1hc2ssCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbUZyYW1lQ291bnQsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbUZsYWdzLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1TaGFyZWRCdWZmZXIsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZ2V0T3V0cHV0X2woKSk7Ci0KLSAgICAgICAgaWYgKHJlc3VsdCA9PSBOT19FUlJPUikgewotICAgICAgICAgICAgdWludDMyX3QgdXNlciA9IGNibGstPnVzZXI7Ci0gICAgICAgICAgICB1aW50MzJfdCBzZXJ2ZXIgPSBjYmxrLT5zZXJ2ZXI7Ci0gICAgICAgICAgICAvLyByZXN0b3JlIHdyaXRlIGluZGV4IGFuZCBzZXQgb3RoZXIgaW5kZ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zZXJ2ZXIpID4gbUNibGstPmZyYW1lQ291bnQpID8KLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbUNibGstPmZyYW1lQ291bnQgOiAodXNlciAtIHNlcnZlcik7Ci0gICAgICAgICAgICAgICAgICAgICAgICBtZW1zZXQobUNibGstPmJ1ZmZlcnMsIDAsIGZyYW1lcyAqIG1DYmxrLT5mcmFtZVNpemUpOwotICAgICAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgICAgIC8vIHJlc3RhcnQgcGxheWJhY2sgZXZlbiBpZiBidWZmZXIgaXMgbm90IGNvbXBsZXRlbHkgZmlsbGVkLgotICAgICAgICAgICAgICAgICAgICBhbmRyb2lkX2F0b21pY19vcihDQkxLX0ZPUkNFUkVBRFlfT04sICZtQ2Jsay0+ZmxhZ3MpOwotICAgICAgICAgICAgICAgICAgICAvLyBzdGVwVXNlcigpIGNsZWFycyBDQkxLX1VOREVSUlVOX09OIGZsYWcgZW5hYmxpbmcgdW5kZXJydW4gY2FsbGJhY2tzIHRvCi0gICAgICAgICAgICAgICAgICAgIC8vIHRoZSBjbGllbnQKLSAgICAgICAgICAgICAgICAgICAgbUNibGstPnN0ZXBVc2VyKGZyYW1lcyk7Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgfQotICAgICAgICAgICAgaWYgKG1BY3RpdmUpIHsKLSAgICAgICAgICAgICAgICByZXN1bHQgPSBtQXVkaW9UcmFjay0+c3RhcnQoMCk7IC8vIGNhbGxiYWNrIHRocmVhZCBoYXNuJ3QgY2hhbmdlZAotICAgICAgICAgICAgICAgIEFMT0dXX0lGKHJlc3VsdCAhPSBOT19FUlJPUiwgInJlc3RvcmVUcmFja19sKCkgc3RhcnQoKSBmYWlsZWQgc3RhdHVzICVkIiwgcmVzdWx0KTsKLSAgICAgICAgICAgIH0KLSAgICAgICAgICAgIGlmIChmcm9tU3RhcnQgJiYgcmVzdWx0ID09IE5PX0VSUk9SKSB7Ci0gICAgICAgICAgIC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gdWludDMyX3QgcyA9IHNlcnZlcjsKLQotICAgIGlmIChmbGFncyAmIENCTEtfRElSRUNUSU9OX01TSykgewotICAgICAgICB1aW50MzJfdCBsaW1pdCA9IChzIDwgbG9vcFN0YXJ0KSA/IHMgOiBsb29wU3RhcnQ7Ci0gICAgICAgIHJldHVybiBsaW1pdCArIGZyYW1lQ291bnQgLSB1OwotICAgIH0gZWxzZSB7Ci0gICAgICAgIHJldHVybiBmcmFtZUNvdW50ICsgdSAtIHM7Ci0gICAgfQotfQotCi11aW50MzJfdCBhdWRpb190cmFja19jYmxrX3Q6OmZyYW1lc1JlYWR5KCkKLXsKLSAgICB1aW50MzJfdCB1ID0gdXNlcjsKLSAgICB1aW50MzJfdCBzID0gc2VydmVyOwotCi0gICAgaWYgKGZsYWdzICYgQ0JMS19ESVJFQ1RJT05fTVNLKSB7Ci0gICAgICAgIGlmICh1IDwgbG9vcEVuZCkgewotICAgICAgICAgICAgcmV0dXJuIHUgLSBzOwotICAgICAgICB9IGVsc2UgewotICAgICAgICAgICAgLy8gZG8gbm90IGJsb2NrIG9uIG11dGV4IHNoYXJlZCB3aXRoIGNsaWVudCBvbiBBdWRpb0ZsaW5nZXIgc2lkZQotICAgICAgICAgICAgaWYgKCF0cnlMb2NrKCkpIHsKLSAgICAgICAgICAgICAgICBBTE9HVygiZnJhbWVzUmVhZHkoKSBjb3VsZCBub3QgbG9jayBjYmxrIik7Ci0gICAgICAgICAgICAgICAgcmV0dXJuIDA7Ci0gICAgICAgICAgICB9Ci0gICAgICAgICAgICB1aW50MzJfdCBmcmFtZXMgPSBVSU5UX01BWDsKLSAgICAgICAgICAgIGlmIChsb29wQ291bnQgPj0gMCkgewotICAgICAgICAgICAgICAgIGZyYW1lcyA9IChsb29wRW5kIC0gbG9vcFN0YXJ0KSpsb29wQ291bnQgKyB1IC0gczsKLSAgICAgICAgICAgIH0KLSAgICAgICAgICAgIGxvY2sudW5sb2NrKCk7Ci0gICAgICAgICAgICByZXR1cm4gZnJh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U0VTU0lPTl9JRCwKLSAgICBBQ1FVSVJFX0FVRElPX1NFU1NJT05fSUQsCi0gICAgUkVMRUFTRV9BVURJT19TRVNTSU9OX0lELAotICAgIFFVRVJZX05VTV9FRkZFQ1RTLAotICAgIFFVRVJZX0VGRkVDVCwKLSAgICBHRVRfRUZGRUNUX0RFU0NSSVBUT1IsCi0gICAgQ1JFQVRFX0VGRkVDVCwKLSAgICBNT1ZFX0VGRkVDVFMKLX07Ci0KLWNsYXNzIEJwQXVkaW9GbGluZ2VyIDogcHVibGljIEJwSW50ZXJmYWNlPElBdWRpb0ZsaW5nZXI+Ci17Ci1wdWJsaWM6Ci0gICAgQnBBdWRpb0ZsaW5nZXIoY29uc3Qgc3A8SUJpbmRlcj4mIGltcGwpCi0gICAgICAgIDogQnBJbnRlcmZhY2U8SUF1ZGlvRmxpbmdlcj4oaW1wbCkKLSAgICB7Ci0gICAgfQotCi0gICAgdmlydHVhbCBzcDxJQXVkaW9UcmFjaz4gY3JlYXRlVHJhY2soCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBpZF90IHBpZCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYXVkaW9fc3RyZWFtX3R5cGVfdCBzdHJlYW1UeXBlLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB1aW50MzJfdCBzYW1wbGVSYXRlLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBhdWRpb19mb3JtYXRfdCBmb3JtYXQsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHVpbnQzMl90IGNoYW5uZWxNYXNrLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpbnQgZnJhbWVDb3VudCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdHJhY2tfZmxhZ3NfdCBmbGFncywKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY29uc3Qgc3A8SU1lbW9yeT4mIHNoYXJlZEJ1ZmZlciwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYXVkaW9faW9faGFuZGxlX3Qgb3V0cHV0LAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpbnQgKnNlc3Npb25JZCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc3RhdHVzX3QgKnN0YXR1cykKLSAgICB7Ci0gICAgICAgIFBhcmNlbCBkYXRhLCByZXBseTsKLSAgICAgICAgc3A8SUF1ZGlvVHJhY2s+IHRyYWNrOwotICAgICAgICBkYXRhLndyaXRlSW50ZXJmYWNlVG9rZW4oSUF1ZGlvRmxpbmdlcjo6Z2V0SW50ZXJmYWNlRGVzY3JpcHRvcigpKTsKLSAgICAgICAgZGF0YS53cml0ZUludDMyKHBpZCk7Ci0gICAgICAgIGRhdGEud3JpdGVJbnQzMigoaW50MzJfdCkgc3RyZWFtVHlwZSk7Ci0gICAgICAgIGRhdGEud3JpdGVJbnQzMihzYW1wbGVSYXRlKTsKLSAgICAgICAgZGF0YS53cml0ZUludDMyKGZvcm1hdCk7Ci0gICAgICAgIGRhdGEud3JpdGVJbnQzMihjaGFubmVsTWFzayk7Ci0gICAgICAgIGRhdGEud3JpdGVJbnQzMihmcmFtZUNvdW50KTsKLSAgICAgICAgZGF0YS53cml0ZUludDMyKChpbnQzMl90KSBmbGFncyk7Ci0gICAgICAgIGRhdGEud3JpdGVTdHJvbmdCaW5kZXIoc2hhcmVkQnVmZmVyLT5hc0JpbmRlcigpKTsKLSAgICAgICAgZGF0YS53cml0ZUludDMyKChpbnQzMl90KSBvdXRwdXQpOwotICAgICAgICBpbnQgbFNlc3Npb25JZCA9IDA7Ci0gICAgICAgIGlmIChzZXNzaW9uSWQgIT0gTlVMTCkgewotICAgICAgICAgICAgbFNlc3Npb25JZCA9ICpzZXNzaW9uSWQ7Ci0gICAgICAgIH0KLSAgICAgICAgZGF0YS53cml0ZUludDMyKGxTZXNzaW9uSWQpOwotICAgICAgICBzdGF0dXNfdCBsU3RhdHVzID0gcmVtb3RlKCktPnRyYW5zYWN0KENSRUFURV9UUkFDSywgZGF0YSwgJnJlcGx5KTsKLSAgICAgICAgaWYgKGxTdGF0dXMgIT0gTk9fRVJST1IpIHsKLSAgICAgICAgICAgIEFMT0dFKCJjcmVhdGVUcmFjayBlcnJvcjogJXMiLCBzdHJlcnJvcigtbFN0YXR1cykpOwotICAgICAgICB9IGVsc2UgewotICAgICAgICAgICAgbFNlc3Npb25JZCA9IHJlcGx5LnJlYWRJbnQzMigpOwotICAgICAgICAgICAgaWYgKHNlc3Npb25JZCAhPSBOVUxMKSB7Ci0gICAgICAgICAgICAgICAgKnNlc3Npb25JZCA9IGxTZXNzaW9uSWQ7Ci0gICAgICAgICAgICB9Ci0gICAgICAgICAgICBsU3RhdHVzID0gcmVwbHkucmVhZEludDMyKCk7Ci0gICAgICAgICAgICB0cmFjayA9IGludGVyZmFjZV9jYXN0PElBdWRpb1RyYWNrPihyZXBseS5yZWFkU3Ryb25nQmluZGVyKCkpOwotICAgICAgICB9Ci0gICAgICAgIGlmIChzdGF0dXMpIHsKLSAgICAgICAgICAgICpzdGF0dXMgPSBsU3RhdHVzOwotICAgICAgICB9Ci0gICAgICAgIHJldHVybiB0cmFjazsKLSAgICB9Ci0KLSAgICB2aXJ0dWFsIHNwPElBdWRpb1JlY29yZD4gb3BlblJlY29yZCgKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcGlkX3QgcGlkLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBhdWRpb19pb19oYW5kbGVfdCBpbnB1dCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdWludDMyX3Qgc2FtcGxlUmF0ZSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYXVkaW9fZm9ybWF0X3QgZm9ybWF0LAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB1aW50MzJfdCBjaGFubmVsTWFzaywKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaW50IGZyYW1lQ291bnQsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRyYWNrX2ZsYWdzX3QgZmxhZ3MsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGludCAqc2Vzc2lvbklkLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzdGF0dXNfdCAqc3RhdHVzKQotICAgIHsKLSAgICAgICAgUGFyY2VsIGRhdGEsIHJlcGx5OwotICAgICAgICBzcDxJQXVkaW9SZWNvcmQ+IHJlY29yZDsKLSAgICAgICAgZGF0YS53cml0ZUludGVyZmFjZVRva2VuKElBdWRpb0ZsaW5nZXI6OmdldEludGVyZmFjZURlc2NyaXB0b3IoKSk7Ci0gICAgICAgIGRhdGEud3JpdGVJbnQzMihwaWQpOwotICAgICAgICBkYXRhLndyaXRlSW50MzIoKGludDMyX3QpIGlucHV0KTsKLSAgICAgICAgZGF0YS53cml0ZUludDMyKHNhbXBsZVJhdGUpOwotICAgICAgICBkYXRhLndyaXRlSW50MzIoZm9ybWF0KTsKLSAgICAgICAgZGF0YS53cml0ZUludDMyKGNoYW5uZWxNYXNrKTsKLSAgICAgICAgZGF0YS53cml0ZUludDMyKGZyYW1lQ291bnQpOwotICAgICAgICBkYXRhLndyaXRlSW50MzIoZmxhZ3MpOwotICAgICAgICBpbnQgbFNlc3Npb25JZCA9IDA7Ci0gICAgICAgIGlmIChzZXNzaW9uSWQgIT0gTlVMTCkgewotICAgICAgICAgICAgbFNlc3Npb25JZCA9ICpzZXNzaW9uSWQ7Ci0gICAgICAgIH0KLSAgICAgICAgZGF0YS53cml0ZUludDMyKGxTZXNzaW9uSWQpOwotICAgICAgICBzdGF0dXNfdCBsU3RhdHVzID0gcmVtb3RlKCktPnRyYW5zYWN0KE9QRU5fUkVDT1JELCBkYXRhLCAmcmVwbHkpOwotICAgICAgICBpZiAobFN0YXR1cyAhPSBOT19FUlJPUikgewotICAgICAgICAgICAgQUxPR0UoIm9wZW5SZWNvcmQgZXJy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dCBzYW1wbGVSYXRlLCBhdWRpb19mb3JtYXRfdCBmb3JtYXQsIGludCBjaGFubmVsQ291bnQpIGNvbnN0Ci0gICAgewotICAgICAgICBQYXJjZWwgZGF0YSwgcmVwbHk7Ci0gICAgICAgIGRhdGEud3JpdGVJbnRlcmZhY2VUb2tlbihJQXVkaW9GbGluZ2VyOjpnZXRJbnRlcmZhY2VEZXNjcmlwdG9yKCkpOwotICAgICAgICBkYXRhLndyaXRlSW50MzIoc2FtcGxlUmF0ZSk7Ci0gICAgICAgIGRhdGEud3JpdGVJbnQzMihmb3JtYXQpOwotICAgICAgICBkYXRhLndyaXRlSW50MzIoY2hhbm5lbENvdW50KTsKLSAgICAgICAgcmVtb3RlKCktPnRyYW5zYWN0KEdFVF9JTlBVVEJVRkZFUlNJWkUsIGRhdGEsICZyZXBseSk7Ci0gICAgICAgIHJldHVybiByZXBseS5yZWFkSW50MzIoKTsKLSAgICB9Ci0KLSAgICB2aXJ0dWFsIGF1ZGlvX2lvX2hhbmRsZV90IG9wZW5PdXRwdXQodWludDMyX3QgKnBEZXZpY2VzLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgIHVpbnQzMl90ICpwU2FtcGxpbmdSYXRlLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgIGF1ZGlvX2Zvcm1hdF90ICpwRm9ybWF0LAotICAgICAgICAgICAgICAgICAgICAgICAgICAgIHVpbnQzMl90ICpwQ2hhbm5lbHMsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgdWludDMyX3QgKnBMYXRlbmN5TXMsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgYXVkaW9fcG9saWN5X291dHB1dF9mbGFnc190IGZsYWdzKQotICAgIHsKLSAgICAgICAgUGFyY2VsIGRhdGEsIHJlcGx5OwotICAgICAgICB1aW50MzJfdCBkZXZpY2VzID0gcERldmljZXMgPyAqcERldmljZXMgOiAwOwotICAgICAgICB1aW50MzJfdCBzYW1wbGluZ1JhdGUgPSBwU2FtcGx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KTsKLSAgICAgICAgcmVtb3RlKCktPnRyYW5zYWN0KFJFU1RPUkVfT1VUUFVULCBkYXRhLCAmcmVwbHkpOwotICAgICAgICByZXR1cm4gcmVwbHkucmVhZEludDMyKCk7Ci0gICAgfQotCi0gICAgdmlydHVhbCBhdWRpb19pb19oYW5kbGVfdCBvcGVuSW5wdXQodWludDMyX3QgKnBEZXZpY2VzLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgIHVpbnQzMl90ICpwU2FtcGxpbmdSYXRlLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgIGF1ZGlvX2Zvcm1hdF90ICpwRm9ybWF0LAotICAgICAgICAgICAgICAgICAgICAgICAgICAgIHVpbnQzMl90ICpwQ2hhbm5lbHMsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgYXVkaW9faW5fYWNvdXN0aWNzX3QgYWNvdXN0aWNzKQotICAgIHsKLSAgICAgICAgUGFyY2VsIGRhdGEsIHJlcGx5OwotICAgICAgICB1aW50MzJfdCBkZXZpY2VzID0gcERldmljZXMgPyAqcERldmljZXMgOiAwOwotICAgICAgICB1aW50MzJfdCBzYW1wbGluZ1JhdGUgPSBwU2FtcGxpbmdSYXRlID8gKnBTYW1wbGluZ1JhdGUgOiAwOwotICAgICAgICBhdWRpb19mb3JtYXRfdCBmb3JtYXQgPSBwRm9ybWF0ID8gKnBGb3JtYXQgOiBBVURJT19GT1JNQVRfREVGQVVMVDsKLSAgICAgICAgdWludDMyX3QgY2hhbm5lbHMgPSBwQ2hhbm5lbHMgPyAqcENoYW5uZWxzIDogMDsKLQotICAgICAgICBkYXRhLndyaXRlSW50ZXJmYWNlVG9rZW4oSUF1ZGlvRmxpbmdlcjo6Z2V0SW50ZXJmYWNlRGVzY3JpcHRvcigpKTsKLSAgICAgICAgZGF0YS53cml0ZUludDMyKGRldmljZXMpOwotICAgICAgICBkYXRhLndyaXRlSW50MzIoc2FtcGxpbmdSYXRlKTsKLSAgICAgICAgZGF0YS53cml0ZUludDMyK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AocFV1aWQgPT0gTlVMTCB8fCBwRGVzY3JpcHRvciA9PSBOVUxMKSB7Ci0gICAgICAgICAgICByZXR1cm4gQkFEX1ZBTFVFOwotICAgICAgICB9Ci0gICAgICAgIFBhcmNlbCBkYXRhLCByZXBseTsKLSAgICAgICAgZGF0YS53cml0ZUludGVyZmFjZVRva2VuKElBdWRpb0ZsaW5nZXI6OmdldEludGVyZmFjZURlc2NyaXB0b3IoKSk7Ci0gICAgICAgIGRhdGEud3JpdGUocFV1aWQsIHNpemVvZihlZmZlY3RfdXVpZF90KSk7Ci0gICAgICAgIHN0YXR1c190IHN0YXR1cyA9IHJlbW90ZSgpLT50cmFuc2FjdChHRVRfRUZGRUNUX0RFU0NSSVBUT1IsIGRhdGEsICZyZXBseSk7Ci0gICAgICAgIGlmIChzdGF0dXMgIT0gTk9fRVJST1IpIHsKLSAgICAgICAgICAgIHJldHVybiBzdGF0dXM7Ci0gICAgICAgIH0KLSAgICAgICAgc3RhdHVzID0gcmVwbHkucmVhZEludDMyKCk7Ci0gICAgICAgIGlmIChzdGF0dXMgIT0gTk9fRVJST1IpIHsKLSAgICAgICAgICAgIHJldHVybiBzdGF0dXM7Ci0gICAgICAgIH0KLSAgICAgICAgcmVwbHkucmVhZChwRGVzY3JpcHRvciwgc2l6ZW9mKGVmZmVjdF9kZXNjcmlwdG9yX3QpKTsKLSAgICAgICAgcmV0dXJuIE5PX0VSUk9SOwotICAgIH0KLQotICAgIHZpcnR1YWwgc3A8SUVmZmVjdD4gY3JlYXRlRWZmZWN0KHBpZF90IHBpZCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGVmZmVjdF9kZXNjcmlwdG9yX3QgKnBEZXNjLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY29uc3Qgc3A8SUVmZmVjdENsaWVudD4mIGNsaWVudCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGludDMyX3QgcHJpb3JpdHksCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBhdWRpb19pb19oYW5kbGVfdCBvdXRwdXQsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpbnQgc2Vzc2lvbklkLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc3RhdHVzX3QgKnN0YXR1cywKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGludCAqaWQsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpbnQgKmVuYWJsZWQpCi0gICAgewotICAgICAgICBQYXJjZWwgZGF0YSwgcmVwbHk7Ci0gICAgICAgIHNwPElFZmZlY3Q+IGVmZmVjdDsKLQotICAgICAgICBpZiAocERlc2MgPT0gTlVMTCkgewotICAgICAgICAgICAgcmV0dXJuIGVmZmVjdDsKLSAgICAgICAgICAgIGlmIChzdGF0dXMpIHsKLSAgICAgICAgICAgICAgICAqc3RhdHVzID0gQkFEX1ZBTFVFOwotICAgICAgICAgICAgfQotICAgICAgICB9Ci0KLSAgICAgICAgZGF0YS53cml0ZUludGVyZmFjZVRva2VuKElBdWRpb0ZsaW5nZXI6OmdldEludGVyZmFjZURlc2NyaXB0b3IoKSk7Ci0gICAgICAgIGRhdGEud3JpdGVJbnQzMihwaWQpOwotICAgICAgICBkYXRhLndyaXRlKHBEZXNjLCBzaXplb2YoZWZmZWN0X2Rlc2NyaXB0b3JfdCkpOwotICAgICAgICBkYXRhLndyaXRlU3Ryb25nQmluZGVyKGNsaWVudC0+YXNCaW5kZXIoKSk7Ci0gICAgICAgIGRhdGEud3JpdGVJbnQzMihwcmlvcml0eSk7Ci0gICAgICAgIGRhdGEud3JpdGVJbnQzMigoaW50MzJfdCkgb3V0cHV0KTsKLSAgICAgICAgZGF0YS53cml0ZUludDMyKHNlc3Npb25JZCk7Ci0KLSAgICAgICAgc3RhdHVzX3QgbFN0YXR1cyA9IHJlbW90ZSgpLT50cmFuc2FjdChDUkVBVEVfRUZGRUNULCBkYXRhLCAmcmVwbHkpOwotICAgICAgICBpZiAobFN0YXR1cyAhPSBOT19FUlJPUikgewotICAgICAgICAgICAgQUxPR0UoImNyZWF0ZUVmZmVjdCBlcnJvcjogJXMiLCBzdHJlcnJvcigtbFN0YXR1cykpOwotICAgICAgICB9IGVsc2UgewotICAgICAgICAgICAgbFN0YXR1cyA9IHJlcGx5LnJlYWRJbnQzMigpOwotICAgICAgICAgICAgaW50IHRtcCA9IHJlcGx5LnJlYWRJbnQzMigpOwotICAgICAgICAgICAgaWYgKGlkKSB7Ci0gICAgICAgICAgICAgICAgKmlkID0gdG1wOwotICAgICAgICAgICAgfQotICAgICAgICAgICAgdG1wID0gcmVwbHkucmVhZEludDMyKCk7Ci0gICAgICAgICAgICBpZiAoZW5hYmxlZCAhPSBOVUxMKSB7Ci0gICAgICAgICAgICAgICAgKmVuYWJsZWQgPSB0bXA7Ci0gICAgICAgICAgICB9Ci0gICAgICAgICAgICBlZmZlY3QgPSBpbnRlcmZhY2VfY2FzdDxJRWZmZWN0PihyZXBseS5yZWFkU3Ryb25nQmluZGVyKCkpOwotICAgICAgICAgICAgcmVwbHkucmVhZChwRGVzYywgc2l6ZW9mKGVmZmVjdF9kZXNjcmlwdG9yX3QpKTsKLSAgICAgICAgfQotICAgICAgICBpZiAoc3RhdHVzKSB7Ci0gICAgICAgICAgICAqc3RhdHVzID0gbFN0YXR1czsKLSAgICAgICAgfQotCi0gICAgICAgIHJldHVybiBlZmZlY3Q7Ci0gICAgfQotCi0gICAgdmlydHVhbCBzdGF0dXNfdCBtb3ZlRWZmZWN0cyhpbnQgc2Vzc2lvbiwgYXVkaW9faW9faGFuZGxlX3Qgc3JjT3V0cHV0LAotICAgICAgICAgICAgYXVkaW9faW9faGFuZGxlX3QgZHN0T3V0cHV0KQotICAgIHsKLSAgICAgICAgUGFyY2VsIGRhdGEsIHJlcGx5OwotICAgICAgICBkYXRhLndyaXRlSW50ZXJmYWNlVG9rZW4oSUF1ZGlvRmxpbmdl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wotICAgICAgICBjYXNlIE9QRU5fUkVDT1JEOiB7Ci0gICAgICAgICAgICBDSEVDS19JTlRFUkZBQ0UoSUF1ZGlvRmxpbmdlciwgZGF0YSwgcmVwbHkpOwotICAgICAgICAgICAgcGlkX3QgcGlkID0gZGF0YS5yZWFkSW50MzIoKTsKLSAgICAgICAgICAgIGF1ZGlvX2lvX2hhbmRsZV90IGlucHV0ID0gKGF1ZGlvX2lvX2hhbmRsZV90KSBkYXRhLnJlYWRJbnQzMigpOwotICAgICAgICAgICAgdWludDMyX3Qgc2FtcGxlUmF0ZSA9IGRhdGEucmVhZEludDMyKCk7Ci0gICAgICAgICAgICBhdWRpb19mb3JtYXRfdCBmb3JtYXQgPSAoYXVkaW9fZm9ybWF0X3QpIGRhdGEucmVhZEludDMyKCk7Ci0gICAgICAgICAgICBpbnQgY2hhbm5lbENvdW50ID0gZGF0YS5yZWFkSW50MzIoKTsKLSAgICAgICAgICAgIHNpemVfdCBidWZmZXJDb3VudCA9IGRhdGEucmVhZEludDMyKCk7Ci0gICAgICAgICAgICB0cmFja19mbGFnc190IGZsYWdzID0gKHRyYWNrX2ZsYWdzX3QpIGRhdGEucmVhZEludDMyKCk7Ci0gICAgICAgICAgICBpbnQgc2Vzc2lvbklkID0gZGF0YS5yZWFkSW50MzIoKTsKLSAgICAgICAgICAgIHN0YXR1c190IHN0YXR1czsKLSAgICAgICAgICAgIHNwPElBdWRpb1JlY29yZD4gcmVjb3JkID0gb3BlblJlY29yZChwaWQsIGlucHV0LAotICAgICAgICAgICAgICAgICAgICBzYW1wbGVSYXRlLCBmb3JtYXQsIGNoYW5uZWxDb3VudCwgYnVmZmVyQ291bnQsIGZsYWdzLCAmc2Vzc2lvbklkLCAmc3RhdHVzKTsKLSAgICAgICAgICAgIHJlcGx5LT53cml0ZUludDMyKHNlc3Npb25JZCk7Ci0gICAgICAgICAgICByZXBseS0+d3JpdGVJbnQzMihzdGF0dXMpOwotICAgICAgICAgICAgcmVwbHktPndyaXRlU3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ndyaXRlRmxvYXQoIG1hc3RlclZvbHVtZSgpICk7Ci0gICAgICAgICAgICByZXR1cm4gTk9fRVJST1I7Ci0gICAgICAgIH0gYnJlYWs7Ci0gICAgICAgIGNhc2UgTUFTVEVSX01VVEU6IHsKLSAgICAgICAgICAgIENIRUNLX0lOVEVSRkFDRShJQXVkaW9GbGluZ2VyLCBkYXRhLCByZXBseSk7Ci0gICAgICAgICAgICByZXBseS0+d3JpdGVJbnQzMiggbWFzdGVyTXV0ZSgpICk7Ci0gICAgICAgICAgICByZXR1cm4gTk9fRVJST1I7Ci0gICAgICAgIH0gYnJlYWs7Ci0gICAgICAgIGNhc2UgU0VUX1NUUkVBTV9WT0xVTUU6IHsKLSAgICAgICAgICAgIENIRUNLX0lOVEVSRkFDRShJQXVkaW9GbGluZ2VyLCBkYXRhLCByZXBseSk7Ci0gICAgICAgICAgICBpbnQgc3RyZWFtID0gZGF0YS5yZWFkSW50MzIoKTsKLSAgICAgICAgICAgIGZsb2F0IHZvbHVtZSA9IGRhdGEucmVhZEZsb2F0KCk7Ci0gICAgICAgICAgICBhdWRpb19pb19oYW5kbGVfdCBvdXRwdXQgPSAoYXVkaW9faW9faGFuZGxlX3QpIGRhdGEucmVhZEludDMyKCk7Ci0gICAgICAgICAgICByZXBseS0+d3JpdGVJbnQzMiggc2V0U3RyZWFtVm9sdW1lKChhdWRpb19zdHJlYW1fdHlwZV90KSBzdHJlYW0sIHZvbHVtZSwgb3V0cHV0KSApOwotICAgICAgICAgICAgcmV0dXJuIE5PX0VSUk9SOwotICAgICAgICB9IGJyZWFrOwotICAgICAgICBjYXNlIFNFVF9TVFJFQU1fTVVURTogewotICAgICAgICAgICAgQ0hFQ0tfSU5URVJGQUNFKElBdWRpb0ZsaW5nZXIsIGRhdGEsIHJlcGx5KTsKLSAgICAgICAgICAgIGludCBzdHJlYW0gPSBkYXRhLnJlYWRJbnQzMigpOwotICAgICAgICAgICAgcmVwbHktPndyaXRlSW50MzIoIHNldFN0cmVhbU11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yaXRlSW50MzIoIHNldE1vZGUobW9kZSkgKTsKLSAgICAgICAgICAgIHJldHVybiBOT19FUlJPUjsKLSAgICAgICAgfSBicmVhazsKLSAgICAgICAgY2FzZSBTRVRfTUlDX01VVEU6IHsKLSAgICAgICAgICAgIENIRUNLX0lOVEVSRkFDRShJQXVkaW9GbGluZ2VyLCBkYXRhLCByZXBseSk7Ci0gICAgICAgICAgICBpbnQgc3RhdGUgPSBkYXRhLnJlYWRJbnQzMigpOwotICAgICAgICAgICAgcmVwbHktPndyaXRlSW50MzIoIHNldE1pY011dGUoc3RhdGUpICk7Ci0gICAgICAgICAgICByZXR1cm4gTk9fRVJST1I7Ci0gICAgICAgIH0gYnJlYWs7Ci0gICAgICAgIGNhc2UgR0VUX01JQ19NVVRFOiB7Ci0gICAgICAgICAgICBDSEVDS19JTlRFUkZBQ0UoSUF1ZGlvRmxpbmdlciwgZGF0YSwgcmVwbHkpOwotICAgICAgICAgICAgcmVwbHktPndyaXRlSW50MzIoIGdldE1pY011dGUoKSApOwotICAgICAgICAgICAgcmV0dXJuIE5PX0VSUk9SOwotICAgICAgICB9IGJyZWFrOwotICAgICAgICBjYXNlIFNFVF9QQVJBTUVURVJTOiB7Ci0gICAgICAgICAgICBDSEVDS19JTlRFUkZBQ0UoSUF1ZGlvRmxpbmdlciwgZGF0YSwgcmVwbHkpOwotICAgICAgICAgICAgYXVkaW9faW9faGFuZGxlX3QgaW9IYW5kbGUgPSAoYXVkaW9faW9faGFuZGxlX3QpIGRhdGEucmVhZEludDMyKCk7Ci0gICAgICAgICAgICBTdHJpbmc4IGtleVZhbHVlUGFpcnMoZGF0YS5yZWFkU3RyaW5nOCgpKTsKLSAgICAgICAgICAgIHJlcGx5LT53cml0ZUludDMyKHNldFBhcmFtZXRlcnMoaW9IYW5kbGUsIGtleVZhbHVlUGFpcnMpKTsKLSAgICAgICAgICAgIHJldHVybiBOT19FUlJPUjsKLSAgICAgICAgfSBicmVhazsKLSAgICAgICAgY2FzZSBHRV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AgaW50IGNoYW5uZWxDb3VudCA9IGRhdGEucmVhZEludDMyKCk7Ci0gICAgICAgICAgICByZXBseS0+d3JpdGVJbnQzMiggZ2V0SW5wdXRCdWZmZXJTaXplKHNhbXBsZVJhdGUsIGZvcm1hdCwgY2hhbm5lbENvdW50KSApOwotICAgICAgICAgICAgcmV0dXJuIE5PX0VSUk9SOwotICAgICAgICB9IGJyZWFrOwotICAgICAgICBjYXNlIE9QRU5fT1VUUFVUOiB7Ci0gICAgICAgICAgICBDSEVDS19JTlRFUkZBQ0UoSUF1ZGlvRmxpbmdlciwgZGF0YSwgcmVwbHkpOwotICAgICAgICAgICAgdWludDMyX3QgZGV2aWNlcyA9IGRhdGEucmVhZEludDMyKCk7Ci0gICAgICAgICAgICB1aW50MzJfdCBzYW1wbGluZ1JhdGUgPSBkYXRhLnJlYWRJbnQzMigpOwotICAgICAgICAgICAgYXVkaW9fZm9ybWF0X3QgZm9ybWF0ID0gKGF1ZGlvX2Zvcm1hdF90KSBkYXRhLnJlYWRJbnQzMigpOwotICAgICAgICAgICAgdWludDMyX3QgY2hhbm5lbHMgPSBkYXRhLnJlYWRJbnQzMigpOwotICAgICAgICAgICAgdWludDMyX3QgbGF0ZW5jeSA9IGRhdGEucmVhZEludDMyKCk7Ci0gICAgICAgICAgICBhdWRpb19wb2xpY3lfb3V0cHV0X2ZsYWdzX3QgZmxhZ3MgPSAoYXVkaW9fcG9saWN5X291dHB1dF9mbGFnc190KSBkYXRhLnJlYWRJbnQzMigpOwotICAgICAgICAgICAgYXVkaW9faW9faGFuZGxlX3Qgb3V0cHV0ID0gb3Blbk91dHB1dCgmZGV2aWNlcywKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmc2FtcGxpbmdSYXRlLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICZmb3JtYXQsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJmNoYW5uZWxzLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICZsYXRlbmN5LAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZsYWdzKTsKLSAgICAgICAgICAgIEFMT0dWKCJPUEVOX09VVFBVVCBvdXRwdXQsICVwIiwgb3V0cHV0KTsKLSAgICAgICAgICAgIHJlcGx5LT53cml0ZUludDMyKChpbnQzMl90KSBvdXRwdXQpOwotICAgICAgICAgICAgcmVwbHktPndyaXRlSW50MzIoZGV2aWNlcyk7Ci0gICAgICAgICAgICByZXBseS0+d3JpdGVJbnQzMihzYW1wbGluZ1JhdGUpOwotICAgICAgICAgICAgcmVwbHktPndyaXRlSW50MzIoZm9ybWF0KTsKLSAgICAgICAgICAgIHJlcGx5LT53cml0ZUludDMyKGNoYW5uZWxzKTsKLSAgICAgICAgICAgIHJlcGx5LT53cml0ZUludDMyKGxhdGVuY3kpOwotICAgICAgICAgICAgcmV0dXJuIE5PX0VSUk9SOwotICAgICAgICB9IGJyZWFrOwotICAgICAgICBjYXNlIE9QRU5fRFVQTElDQVRFX09VVFBVVDogewotICAgICAgICAgICAgQ0hFQ0tfSU5URVJGQUNFKElBdWRpb0ZsaW5nZXIsIGRhdGEsIHJlcGx5KTsKLSAgICAgICAgICAgIGF1ZGlvX2lvX2hhbmRsZV90IG91dHB1dDEgPSAoYXVkaW9faW9faGFuZGxlX3QpIGRhdGEucmVhZEludDMyKCk7Ci0gICAgICAgICAgICBhdWRpb19pb19oYW5kbGVfdCBvdXRwdXQyID0gKGF1ZGlvX2lvX2hhbmRsZV90KSBkYXRhLnJlYWRJbnQzMigpOwotICAgICAgICAgICAgcmVwbHktPndyaXRlSW50MzIoKGludDMyX3QpIG9wZW5EdXBsaWNhdGVPdXRwdXQob3V0cHV0MSwgb3V0cHV0MikpOwotICAgICAgICAgICAgcmV0dXJuIE5PX0VSUk9SOwotICAgICAgICB9IGJyZWFrOwotICAgICAgICBjYXNlIENMT1NFX09VVFBVVDogewotICAgICAgICAgICAgQ0hFQ0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hdCA9IChhdWRpb19mb3JtYXRfdCkgZGF0YS5yZWFkSW50MzIoKTsKLSAgICAgICAgICAgIHVpbnQzMl90IGNoYW5uZWxzID0gZGF0YS5yZWFkSW50MzIoKTsKLSAgICAgICAgICAgIGF1ZGlvX2luX2Fjb3VzdGljc190IGFjb3VzdGljcyA9IChhdWRpb19pbl9hY291c3RpY3NfdCkgZGF0YS5yZWFkSW50MzIoKTsKLQotICAgICAgICAgICAgYXVkaW9faW9faGFuZGxlX3QgaW5wdXQgPSBvcGVuSW5wdXQoJmRldmljZXMsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJnNhbXBsaW5nUmF0ZSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmZm9ybWF0LAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICZjaGFubmVscywKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBhY291c3RpY3MpOwotICAgICAgICAgICAgcmVwbHktPndyaXRlSW50MzIoKGludDMyX3QpIGlucHV0KTsKLSAgICAgICAgICAgIHJlcGx5LT53cml0ZUludDMyKGRldmljZXMpOwotICAgICAgICAgICAgcmVwbHktPndyaXRlSW50MzIoc2FtcGxpbmdSYXRlKTsKLSAgICAgICAgICAgIHJlcGx5LT53cml0ZUludDMyKGZvcm1hdCk7Ci0gICAgICAgICAgICByZXBseS0+d3JpdGVJbnQzMihjaGFubmVscyk7Ci0gICAgICAgICAgICByZXR1cm4gTk9fRVJST1I7Ci0gICAgICAgIH0gYnJlYWs7Ci0gICAgICAgIGNhc2UgQ0xPU0VfSU5QVVQ6IHsKLSAgICAgICAgICAgIENIRUNLX0lOVEVSRkFDRShJQXVkaW9GbGluZ2VyLCBkYXRhLCByZXBseSk7Ci0gICAgICAgICAgICByZXBseS0+d3JpdGVJbnQzMihjbG9zZUlucHV0KChhdWRpb19pb19oYW5kbGVfdCkgZGF0YS5yZWFkSW50MzIoKSkpOwotICAgICAgIC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hbEZyYW1lczsKLSAgICAgICAgICAgIHVpbnQzMl90IGRzcEZyYW1lczsKLSAgICAgICAgICAgIHN0YXR1c190IHN0YXR1cyA9IGdldFJlbmRlclBvc2l0aW9uKCZoYWxGcmFtZXMsICZkc3BGcmFtZXMsIG91dHB1dCk7Ci0gICAgICAgICAgICByZXBseS0+d3JpdGVJbnQzMihzdGF0dXMpOwotICAgICAgICAgICAgaWYgKHN0YXR1cyA9PSBOT19FUlJPUikgewotICAgICAgICAgICAgICAgIHJlcGx5LT53cml0ZUludDMyKGhhbEZyYW1lcyk7Ci0gICAgICAgICAgICAgICAgcmVwbHktPndyaXRlSW50MzIoZHNwRnJhbWVzKTsKLSAgICAgICAgICAgIH0KLSAgICAgICAgICAgIHJldHVybiBOT19FUlJPUjsKLSAgICAgICAgfQotICAgICAgICBjYXNlIEdFVF9JTlBVVF9GUkFNRVNfTE9TVDogewotICAgICAgICAgICAgQ0hFQ0tfSU5URVJGQUNFKElBdWRpb0ZsaW5nZXIsIGRhdGEsIHJlcGx5KTsKLSAgICAgICAgICAgIGF1ZGlvX2lvX2hhbmRsZV90IGlvSGFuZGxlID0gKGF1ZGlvX2lvX2hhbmRsZV90KSBkYXRhLnJlYWRJbnQzMigpOwotICAgICAgICAgICAgcmVwbHktPndyaXRlSW50MzIoZ2V0SW5wdXRGcmFtZXNMb3N0KGlvSGFuZGxlKSk7Ci0gICAgICAgICAgICByZXR1cm4gTk9fRVJST1I7Ci0gICAgICAgIH0gYnJlYWs7Ci0gICAgICAgIGNhc2UgTkVXX0FVRElPX1NFU1NJT05fSUQ6IHsKLSAgICAgICAgICAgIENIRUNLX0lOVEVSRkFDRShJQXVkaW9GbGluZ2VyLCBkYXRhLCByZXBseSk7Ci0gICAgICAgICAgICByZXBseS0+d3JpdGVJbnQzMihuZXdBdWRpb1Nlc3Npb25JZCgpKTsKLSAgICAgICAgICAgIHJldHVybiBOT19FUlJPUjsKLSAgICAgICAgfSBicmVhazsKLSAgICAgICAgY2FzZS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F0aWNfY2FzdCA8dWludDMyX3Q+KHVzYWdlKSk7Ci0gICAgICAgIHJlbW90ZSgpLT50cmFuc2FjdChHRVRfRk9SQ0VfVVNFLCBkYXRhLCAmcmVwbHkpOwotICAgICAgICByZXR1cm4gc3RhdGljX2Nhc3QgPGF1ZGlvX3BvbGljeV9mb3JjZWRfY2ZnX3Q+IChyZXBseS5yZWFkSW50MzIoKSk7Ci0gICAgfQotCi0gICAgdmlydHVhbCBhdWRpb19pb19oYW5kbGVfdCBnZXRPdXRwdXQoCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYXVkaW9fc3RyZWFtX3R5cGVfdCBzdHJlYW0sCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdWludDMyX3Qgc2FtcGxpbmdSYXRlLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGF1ZGlvX2Zvcm1hdF90IGZvcm1hdCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB1aW50MzJfdCBjaGFubmVscywKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBhdWRpb19wb2xpY3lfb3V0cHV0X2ZsYWdzX3QgZmxhZ3MpCi0gICAgewotICAgICAgICBQYXJjZWwgZGF0YSwgcmVwbHk7Ci0gICAgICAgIGRhdGEud3JpdGVJbnRlcmZhY2VUb2tlbihJQXVkaW9Qb2xpY3lTZXJ2aWNlOjpnZXRJbnRlcmZhY2VEZXNjcmlwdG9yKCkpOwotICAgICAgICBkYXRhLndyaXRlSW50MzIoc3RhdGljX2Nhc3QgPHVpbnQzMl90PihzdHJlYW0pKTsKLSAgICAgICAgZGF0YS53cml0ZUludDMyKHNhbXBsaW5nUmF0ZSk7Ci0gICAgICAgIGRhdGEud3JpdGVJbnQzMihzdGF0aWNfY2FzdCA8dWludDMyX3Q+KGZvcm1hdCkpOwotICAgICAgICBkYXRhLndyaXRlSW50MzIoY2hhbm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Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGludCBzZXNzaW9uKQotICAgIHsKLSAgICAgICAgUGFyY2VsIGRhdGEsIHJlcGx5OwotICAgICAgICBkYXRhLndyaXRlSW50ZXJmYWNlVG9rZW4oSUF1ZGlvUG9saWN5U2VydmljZTo6Z2V0SW50ZXJmYWNlRGVzY3JpcHRvcigpKTsKLSAgICAgICAgZGF0YS53cml0ZUludDMyKG91dHB1dCk7Ci0gICAgICAgIGRhdGEud3JpdGVJbnQzMigoaW50MzJfdCkgc3RyZWFtKTsKLSAgICAgICAgZGF0YS53cml0ZUludDMyKHNlc3Npb24pOwotICAgICAgICByZW1vdGUoKS0+dHJhbnNhY3QoU1RPUF9PVVRQVVQsIGRhdGEsICZyZXBseSk7Ci0gICAgICAgIHJldHVybiBzdGF0aWNfY2FzdCA8c3RhdHVzX3Q+IChyZXBseS5yZWFkSW50MzIoKSk7Ci0gICAgfQotCi0gICAgdmlydHVhbCB2b2lkIHJlbGVhc2VPdXRwdXQoYXVkaW9faW9faGFuZGxlX3Qgb3V0cHV0KQotICAgIHsKLSAgICAgICAgUGFyY2VsIGRhdGEsIHJlcGx5OwotICAgICAgICBkYXRhLndyaXRlSW50ZXJmYWNlVG9rZW4oSUF1ZGlvUG9saWN5U2VydmljZTo6Z2V0SW50ZXJmYWNlRGVzY3JpcHRvcigpKTsKLSAgICAgICAgZGF0YS53cml0ZUludDMyKG91dHB1dCk7Ci0gICAgICAgIHJlbW90ZSgpLT50cmFuc2FjdChSRUxFQVNFX09VVFBVVCwgZGF0YSwgJnJlcGx5KTsKLSAgICB9Ci0KLSAgICB2aXJ0dWFsIGF1ZGlvX2lvX2hhbmRsZV90IGdldElucHV0KAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYXVkaW9fc291cmNlX3QgaW5wdXRTb3VyY2UsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB1aW50MzJfdCBzYW1wbGluZ1JhdGUsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBhdWRpb19mb3JtYXRfdCBmb3JtYXQsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB1aW50MzJfdCBjaGFubmVscywKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGF1ZGlvX2luX2Fjb3VzdGljc190IGFjb3VzdGljcywKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGludCBhdWRpb1Nlc3Npb24pCi0gICAgewotICAgICAgICBQYXJjZWwgZGF0YSwgcmVwbHk7Ci0gICAgICAgIGRhdGEud3JpdGVJbnRlcmZhY2VUb2tlbihJQXVkaW9Qb2xpY3lTZXJ2aWNlOjpnZXRJbnRlcmZhY2VEZXNjcmlwdG9yKCkpOwotICAgICAgICBkYXRhLndyaXRlSW50MzIoKGludDMyX3QpIGlucHV0U291cmNlKTsKLSAgICAgICAgZGF0YS53cml0ZUludDMyKHNhbXBsaW5nUmF0ZSk7Ci0gICAgICAgIGRhdGEud3JpdGVJbnQzMihzdGF0aWNfY2FzdCA8dWludDMyX3Q+KGZvcm1hdCkpOwotICAgICAgICBkYXRhLndyaXRlSW50MzIoY2hhbm5lbHMpOwotICAgICAgICBkYXRhLndyaXRlSW50MzIoc3RhdGljX2Nhc3QgPHVpbnQzMl90PihhY291c3RpY3MpKTsKLSAgICAgICAgZGF0YS53cml0ZUludDMyKGF1ZGlvU2Vzc2lvbik7Ci0gICAgICAgIHJlbW90ZSgpLT50cmFuc2FjdChHRVRfSU5QVVQsIGRhdGEsICZyZXBseSk7Ci0gICAgICAgIHJldHVybiBzdGF0aWNfY2FzdCA8YXVkaW9faW9faGFuZGxlX3Q+IChyZXBseS5yZWFkSW50MzIoKSk7Ci0gICAgfQotCi0gICAgdmlydHVhbCBzdGF0dXNfdCBzdGFydElucHV0KGF1ZGlvX2lvX2hhbmRsZV90IGlucHV0KQotICAgIHsKLSAgICAgICAgUGFyY2VsIGRhdGEsIHJlc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wbHkpOwotICAgIH0KLQotICAgIHZpcnR1YWwgc3RhdHVzX3QgaW5pdFN0cmVhbVZvbHVtZShhdWRpb19zdHJlYW1fdHlwZV90IHN0cmVhbSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGludCBpbmRleE1pbiwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGludCBpbmRleE1heCkKLSAgICB7Ci0gICAgICAgIFBhcmNlbCBkYXRhLCByZXBseTsKLSAgICAgICAgZGF0YS53cml0ZUludGVyZmFjZVRva2VuKElBdWRpb1BvbGljeVNlcnZpY2U6OmdldEludGVyZmFjZURlc2NyaXB0b3IoKSk7Ci0gICAgICAgIGRhdGEud3JpdGVJbnQzMihzdGF0aWNfY2FzdCA8dWludDMyX3Q+KHN0cmVhbSkpOwotICAgICAgICBkYXRhLndyaXRlSW50MzIoaW5kZXhNaW4pOwotICAgICAgICBkYXRhLndyaXRlSW50MzIoaW5kZXhNYXgpOwotICAgICAgICByZW1vdGUoKS0+dHJhbnNhY3QoSU5JVF9TVFJFQU1fVk9MVU1FLCBkYXRhLCAmcmVwbHkpOwotICAgICAgICByZXR1cm4gc3RhdGljX2Nhc3QgPHN0YXR1c190PiAocmVwbHkucmVhZEludDMyKCkpOwotICAgIH0KLQotICAgIHZpcnR1YWwgc3RhdHVzX3Qgc2V0U3RyZWFtVm9sdW1lSW5kZXgoYXVkaW9fc3RyZWFtX3R5cGVfdCBzdHJlYW0sCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpbnQgaW5kZXgsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBhdWRpb19kZXZpY2VzX3QgZGV2aWNlKQotICAgIHsKLSAgICAgICAgUGFyY2VsIGRhdGEsIHJlcGx5OwotICAgICAgICBkYXRhLndyaXRlSW50ZXJmYWNlVG9rZW4oSUF1ZGlvUG9saWN5U2VydmljZTo6Z2V0SW50ZXJmYWNlRGVzY3JpcHRvcigpKTsKLSAgICAgICAgZGF0YS53cml0ZUludDMyKHN0YXRpY19jYXN0IDx1aW50MzJfdD4oc3RyZWFtKSk7Ci0gICAgICAgIGRhdGEud3JpdGVJbnQzMihpbmRleCk7Ci0gICAgICAgIGRhdGEud3JpdGVJbnQzMihzdGF0aWNfY2FzdCA8dWludDMyX3Q+KGRldmljZSkpOwotICAgICAgICByZW1vdGUoKS0+dHJhbnNhY3QoU0VUX1NUUkVBTV9WT0xVTUUsIGRhdGEsICZyZXBseSk7Ci0gICAgICAgIHJldHVybiBzdGF0aWNfY2FzdCA8c3RhdHVzX3Q+IChyZXBseS5yZWFkSW50MzIoKSk7Ci0gICAgfQotCi0gICAgdmlydHVhbCBzdGF0dXNfdCBnZXRTdHJlYW1Wb2x1bWVJbmRleChhdWRpb19zdHJlYW1fdHlwZV90IHN0cmVhbSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGludCAqaW5kZXgsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBhdWRpb19kZXZpY2VzX3QgZGV2aWNlKQotICAgIHsKLSAgICAgICAgUGFyY2VsIGRhdGEsIHJlcGx5OwotICAgICAgICBkYXRhLndyaXRlSW50ZXJmYWNlVG9rZW4oSUF1ZGlvUG9saWN5U2VydmljZTo6Z2V0SW50ZXJmYWNlRGVzY3JpcHRvcigpKTsKLSAgICAgICAgZGF0YS53cml0ZUludDMyKHN0YXRpY19jYXN0IDx1aW50MzJfdD4oc3RyZWFtKSk7Ci0gICAgICAgIGRhdGEud3JpdGVJbnQzMihzdGF0aWNfY2FzdCA8dWludDMyX3Q+KGRldmljZSkpOwotCi0gICAgICAgIHJlbW90ZSgpLT50cmFuc2FjdChHRVRfU1RSRUFNX1ZPTFVNRSwgZGF0YSwgJnJlcGx5KTsKLSAgICAgICAgaW50IGxJbmRleCA9IHJlcGx5LnJlYWRJbnQzMigpOwotICAgICAgICBpZiAoaW5kZXgpICppbm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gICB9Ci0KLSAgICB2aXJ0dWFsIGF1ZGlvX2lvX2hhbmRsZV90IGdldE91dHB1dEZvckVmZmVjdChlZmZlY3RfZGVzY3JpcHRvcl90ICpkZXNjKQotICAgIHsKLSAgICAgICAgUGFyY2VsIGRhdGEsIHJlcGx5OwotICAgICAgICBkYXRhLndyaXRlSW50ZXJmYWNlVG9rZW4oSUF1ZGlvUG9saWN5U2VydmljZTo6Z2V0SW50ZXJmYWNlRGVzY3JpcHRvcigpKTsKLSAgICAgICAgZGF0YS53cml0ZShkZXNjLCBzaXplb2YoZWZmZWN0X2Rlc2NyaXB0b3JfdCkpOwotICAgICAgICByZW1vdGUoKS0+dHJhbnNhY3QoR0VUX09VVFBVVF9GT1JfRUZGRUNULCBkYXRhLCAmcmVwbHkpOwotICAgICAgICByZXR1cm4gc3RhdGljX2Nhc3QgPGF1ZGlvX2lvX2hhbmRsZV90PiAocmVwbHkucmVhZEludDMyKCkpOwotICAgIH0KLQotICAgIHZpcnR1YWwgc3RhdHVzX3QgcmVnaXN0ZXJFZmZlY3QoZWZmZWN0X2Rlc2NyaXB0b3JfdCAqZGVzYywKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBhdWRpb19pb19oYW5kbGVfdCBpbywKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB1aW50MzJfdCBzdHJhdGVneSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpbnQgc2Vzc2lvbiwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpbnQgaWQpCi0gICAgewotICAgICAgICBQYXJjZWwgZGF0YSwgcmVwbHk7Ci0gICAgICAgIGRhdGEud3JpdGVJbnRlcmZhY2VUb2tlbihJQXVkaW9Qb2xpY3lTZXJ2aWNlOjpnZXRJbnRlcmZhY2VEZXNjcmlwdG9yKCkpOwotICAgICAgICBkYXRhLndyaXRlKGRlc2MsIHNpemVvZihlZmZlY3Rf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S0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0KLQotCi1zdGF0dXNfdCBCbkF1ZGlvUG9saWN5U2VydmljZTo6b25UcmFuc2FjdCgKLSAgICB1aW50MzJfdCBjb2RlLCBjb25zdCBQYXJjZWwmIGRhdGEsIFBhcmNlbCogcmVwbHksIHVpbnQzMl90IGZsYWdzKQotewotICAgIHN3aXRjaCAoY29kZSkgewotICAgICAgICBjYXNlIFNFVF9ERVZJQ0VfQ09OTkVDVElPTl9TVEFURTogewotICAgICAgICAgICAgQ0hFQ0tfSU5URVJGQUNFKElBdWRpb1BvbGljeVNlcnZpY2UsIGRhdGEsIHJlcGx5KTsKLSAgICAgICAgICAgIGF1ZGlvX2RldmljZXNfdCBkZXZpY2UgPQotICAgICAgICAgICAgICAgICAgICBzdGF0aWNfY2FzdCA8YXVkaW9fZGV2aWNlc190PihkYXRhLnJlYWRJbnQzMigpKTsKLSAgICAgICAgICAgIGF1ZGlvX3BvbGljeV9kZXZfc3RhdGVfdCBzdGF0ZSA9Ci0gICAgICAgICAgICAgICAgICAgIHN0YXRpY19jYXN0IDxhdWRpb19wb2xpY3lfZGV2X3N0YXRlX3Q+KGRhdGEucmVhZEludDMyKCkpOwotICAgICAgICAgICAgY29uc3QgY2hhciAqZGV2aWNlX2FkZHJlc3MgPSBkYXRhLnJlYWRDU3RyaW5nKCk7Ci0gICAgICAgICAgICByZXBseS0+d3JpdGVJbnQzMihzdGF0aWNfY2FzdDx1aW50MzJfdD4gKHNldERldmljZUNvbm5lY3Rpb25TdGF0ZShkZXZpY2UsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzdGF0ZSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRldmljZV9hZGRyZXNzKSkpOwotICAgICAgICAgICAgcmV0dXJuIE5PX0VSUk9SOwotICAgICAgICB9IGJyZWFrOwotCi0gICAgICAgIGNhc2UgR0VUX0RFVklDRV9DT05ORUNUSU9OX1NUQVRFOiB7Ci0gICAgICAgICAgICBDSEVDS19JTlRFUkZBQ0UoSUF1ZGlvUG9saWN5U2VydmljZSwgZGF0YSwgcmVwbHkpOwotICAgICAgICAgICAgYXVkaW9fZGV2aWNlc190IGRldmljZSA9Ci0gICAgICAgICAgICAgICAgICAgIHN0YXRpY19jYXN0PGF1ZGlvX2RldmljZXNfdD4gKGRhdGEucmVhZEludDMyKCkpOwotICAgICAgICAgICAgY29uc3QgY2hhciAqZGV2aWNlX2FkZHJlc3MgPSBkYXRhLnJlYWRDU3RyaW5nKCk7Ci0gICAgICAgICAgICByZXBseS0+d3JpdGVJbnQzMihzdGF0aWNfY2FzdDx1aW50MzJfdD4gKGdldERldmljZUNvbm5lY3Rpb25TdGF0ZShkZXZpY2UsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBkZXZpY2VfYWRkcmVzcykpKTsKLSAgICAgICAgICAgIHJldHVybiBOT19FUlJPUjsKLSAgICAgICAgfSBicmVhazsKLQotICAgICAgICBjYXNlIFNFVF9QSE9ORV9TVEFURTogewotICAgICAgICAgICAgQ0hFQ0tfSU5URVJGQUNFKElBdWRpb1BvbGljeVNlcnZpY2UsIGRhdGEsIHJlcGx5KTsKLSAgICAgICAgICAgIHJlcGx5LT53cml0ZUludDMyKHN0YXRpY19jYXN0IDx1aW50MzJfdD4oc2V0UGhvbmVTdGF0ZSgoYXVkaW9fbW9kZV90KSBkYXRhLnJlYWRJbnQzMigpKSkpOwotICAgICAgICAgICAgcmV0dXJuIE5PX0VSUk9SOwotICAgICAgICB9IGJyZWFrOwotCi0gICAgICAgIGNhc2UgU0VUX0ZPUkNFX1VTRTogewotICAgICAgICA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cGx5KTsKLSAgICAgICAgICAgIGF1ZGlvX3N0cmVhbV90eXBlX3Qgc3RyZWFtID0KLSAgICAgICAgICAgICAgICAgICAgc3RhdGljX2Nhc3QgPGF1ZGlvX3N0cmVhbV90eXBlX3Q+KGRhdGEucmVhZEludDMyKCkpOwotICAgICAgICAgICAgdWludDMyX3Qgc2FtcGxpbmdSYXRlID0gZGF0YS5yZWFkSW50MzIoKTsKLSAgICAgICAgICAgIGF1ZGlvX2Zvcm1hdF90IGZvcm1hdCA9IChhdWRpb19mb3JtYXRfdCkgZGF0YS5yZWFkSW50MzIoKTsKLSAgICAgICAgICAgIHVpbnQzMl90IGNoYW5uZWxzID0gZGF0YS5yZWFkSW50MzIoKTsKLSAgICAgICAgICAgIGF1ZGlvX3BvbGljeV9vdXRwdXRfZmxhZ3NfdCBmbGFncyA9Ci0gICAgICAgICAgICAgICAgICAgIHN0YXRpY19jYXN0IDxhdWRpb19wb2xpY3lfb3V0cHV0X2ZsYWdzX3Q+KGRhdGEucmVhZEludDMyKCkpOwotCi0gICAgICAgICAgICBhdWRpb19pb19oYW5kbGVfdCBvdXRwdXQgPSBnZXRPdXRwdXQoc3RyZWFtLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNhbXBsaW5nUmF0ZSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBmb3JtYXQsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY2hhbm5lbHMsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZmxhZ3MpOwotICAgICAgICAgICAgcmVwbHktPndyaXRlSW50MzIoc3RhdGljX2Nhc3QgPGludD4ob3V0cHV0KSk7Ci0gICAgICAgICAgICByZXR1cm4gTk9fRVJST1I7Ci0gICAgICAgIH0gYnJlYWs7Ci0KLSAgICAgICAgY2FzZSBTVEFSVF9PVVRQVVQ6IHsKLSAgICAgICAgICAgIENIRUNLX0lOVEVSRkFDRShJQXVkaW9Qb2xpY3lTZXJ2aWNlLCBkYXRhLCByZXBseSk7Ci0gICAgICAgICAgICBhdWRpb19pb19oYW5kbGVfdCBvdXRwdXQgPSBzdGF0aWNfY2FzdCA8YXVkaW9faW9faGFuZGxlX3Q+KGRhdGEucmVhZEludDMyKCkpOwotICAgICAgICAgICAgdWludDMyX3Qgc3RyZWFtID0gZGF0YS5yZWFkSW50MzIoKTsKLSAgICAgICAgICAgIGludCBzZXNzaW9uID0gZGF0YS5yZWFkSW50MzIoKTsKLSAgICAgICAgICAgIHJlcGx5LT53cml0ZUludDMyKHN0YXRpY19jYXN0IDx1aW50MzJfdD4oc3RhcnRPdXRwdXQob3V0cHV0LAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoYXVkaW9fc3RyZWFtX3R5cGVfdClzdHJlYW0sCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNlc3Npb24pKSk7Ci0gICAgICAgICAgICByZXR1cm4gTk9fRVJST1I7Ci0gICAgICAgIH0gYnJlYWs7Ci0KLSAgICAgICAgY2FzZSBTVE9QX09VVFBVVDogewotICAgICAgICAgICAgQ0hFQ0tfSU5URVJGQUNFKElBdWRpb1BvbGljeVNlcnZpY2UsIGRhdGEsIHJlcGx5KTsKLSAgICAgICAgICAgIGF1ZGlvX2lvX2hhbmRsZV90IG91dHB1dCA9IHN0YXRpY19jYXN0IDxhdWRpb19pb19oYW5kbGVfdD4oZGF0YS5yZWFkSW50MzIoKSk7Ci0gICAgICAgICAgICB1aW50MzJfdCBzdHJlYW0gPSBkYXRhLnJlYWRJbnQzMigpOwotICAgICAgICAgICAgaW50IHNlc3Npb24gPSBkYXRhLnJlYWRJbnQzMigpOwotICAgICAgICAgICAgcmVwbHktPndyaXRlSW50MzIoc3RhdGljX2Nhc3QgPHVpbnQzMl90PihzdG9wT3V0cHV0KG91dHB1dCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoYXVkaW9fc3RyZWFtX3R5cGVfdClzdHJlYW0sCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2Vzc2lvbikpKTsKLSAgICAgICAgICAgIHJldHVybiBOT19FUlJPUjsKLSAgICAgICAgfSBicmVhazsKLQotICAgICAgICBjYXNlIFJFTEVBU0VfT1VUUFVUOiB7Ci0gICAgICAgICAgICBDSEVDS19JTlRFUkZBQ0UoSUF1ZGlvUG9saWN5U2VydmljZSwgZGF0YSwgcmVwbHkpOwotICAgICAgICAgICAgYXVkaW9faW9faGFuZGxlX3Qgb3V0cHV0ID0gc3RhdGljX2Nhc3QgPGF1ZGlvX2lvX2hhbmRsZV90PihkYXRhLnJlYWRJbnQzMigpKTsKLSAgICAgICAgICAgIHJlbGVhc2VPdXRwdXQob3V0cHV0KTsKLSAgICAgICAgICAgIHJldHVybiBOT19FUlJPUjsKLSAgICAgICAgfSBicmVhazsKLQotICAgICAgICBjYXNlIEdFVF9JTlBVVDogewotICAgICAgICAgICAgQ0hFQ0tfSU5URVJGQUNFKElBdWRpb1BvbGljeVNlcnZpY2UsIGRhdGEsIHJlcGx5KTsKLSAgICAgICAgICAgIGF1ZGlvX3NvdXJjZV90IGlucHV0U291cmNlID0gKGF1ZGlvX3NvdXJjZV90KSBkYXRhLnJlYWRJbnQzMigpOwotICAgICAgICAgICAgdWludDMyX3Qgc2FtcGxpbmdSYXRlID0gZGF0YS5yZWFkSW50MzIoKTsKLSAgICAgICAgICAgIGF1ZGlvX2Zvcm1hdF90IGZvcm1hdCA9IChhdWRpb19mb3JtYXRfdCkgZGF0YS5yZWFkSW50MzIoKTsKLSAgICAgICAgICAgIHVpbnQzMl90IGNoYW5uZWxzID0gZGF0YS5yZWFkSW50MzIoKTsKLSAgICAgICAgICAgIGF1ZGlvX2luX2Fjb3VzdGljc190IGFjb3VzdGljcyA9Ci0gICAgICAgICAgICAgICAgICAgIHN0YXRpY19jYXN0IDxhdWRpb19pbl9hY291c3RpY3NfdD4oZGF0YS5yZWFkSW50MzIoKSk7Ci0gICAgICAgICAgICBpbnQgYXVkaW9TZXNzaW9uID0gZGF0YS5yZWFkSW50MzIoKTsKLSAgICAgICAgICAgIGF1ZGlvX2lvX2hhbmRsZV90IGlucHV0ID0gZ2V0SW5wdXQoaW5wdXRTb3VyY2UsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNhbXBsaW5nUmF0ZSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZm9ybWF0LAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjaGFubmVscywKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYWNvdXN0aWNzLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBhdWRpb1Nlc3Npb24pOwotICAgICAgICAgICAgcmVwbHktPndyaXRlSW50MzIoc3RhdGljX2Nhc3QgPGludD4oaW5wdXQpKTsKLSAgICAgICAgICAgIHJldHVybiBOT19FUlJPUjsKLSAgICAgICAgfSBicmVhazsKLQotICAgICAgICBjYXNlIFNUQVJUX0lOUFVUOiB7Ci0gICAgICAgICAgICBDSEVDS19JTlRFUkZBQ0UoSUF1ZGlvUG9saWN5U2VydmljZSwgZGF0YSwgcmVwbHkpOwotICAgICAgICAgICAgYXVkaW9faW9faGFuZGxlX3QgaW5wdXQgPSBzdGF0aWNfY2FzdCA8YXVkaW9faW9faGFuZGxlX3Q+KGRhdGEucmVhZEludDMyKCkpOwotICAgICAgICAgICAgcmVwbHktPndyaXRlSW50MzIoc3RhdGljX2Nhc3QgPHV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W1fdHlwZV90PihkYXRhLnJlYWRJbnQzMigpKTsKLSAgICAgICAgICAgIGludCBpbmRleE1pbiA9IGRhdGEucmVhZEludDMyKCk7Ci0gICAgICAgICAgICBpbnQgaW5kZXhNYXggPSBkYXRhLnJlYWRJbnQzMigpOwotICAgICAgICAgICAgcmVwbHktPndyaXRlSW50MzIoc3RhdGljX2Nhc3QgPHVpbnQzMl90Pihpbml0U3RyZWFtVm9sdW1lKHN0cmVhbSwgaW5kZXhNaW4saW5kZXhNYXgpKSk7Ci0gICAgICAgICAgICByZXR1cm4gTk9fRVJST1I7Ci0gICAgICAgIH0gYnJlYWs7Ci0KLSAgICAgICAgY2FzZSBTRVRfU1RSRUFNX1ZPTFVNRTogewotICAgICAgICAgICAgQ0hFQ0tfSU5URVJGQUNFKElBdWRpb1BvbGljeVNlcnZpY2UsIGRhdGEsIHJlcGx5KTsKLSAgICAgICAgICAgIGF1ZGlvX3N0cmVhbV90eXBlX3Qgc3RyZWFtID0KLSAgICAgICAgICAgICAgICAgICAgc3RhdGljX2Nhc3QgPGF1ZGlvX3N0cmVhbV90eXBlX3Q+KGRhdGEucmVhZEludDMyKCkpOwotICAgICAgICAgICAgaW50IGluZGV4ID0gZGF0YS5yZWFkSW50MzIoKTsKLSAgICAgICAgICAgIGF1ZGlvX2RldmljZXNfdCBkZXZpY2UgPSBzdGF0aWNfY2FzdCA8YXVkaW9fZGV2aWNlc190PihkYXRhLnJlYWRJbnQzMigpKTsKLSAgICAgICAgICAgIHJlcGx5LT53cml0ZUludDMyKHN0YXRpY19jYXN0IDx1aW50MzJfdD4oc2V0U3RyZWFtVm9sdW1lSW5kZXgoc3RyZWFtLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpbmRleCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZGV2aWNlKSkpOwotICAgICAgICAgICAgcmV0dXJuIE5PX0VSUk9SOwotICAgICAgICB9IGJyZWFrOwotCi0gICAgICAgIGNhc2UgR0VUX1NUUkVBTV9WT0xVTUU6IHsKLSAgICAgICAgICAgIENIRUNLX0lOVEVSRkFDRShJQXVkaW9Qb2xpY3lTZXJ2aWNlLCBkYXRhLCByZXBseSk7Ci0gICAgICAgICAgICBhdWRpb19zdHJlYW1fdHlwZV90IHN0cmVhbSA9Ci0gICAgICAgICAgICAgICAgICAgIHN0YXRpY19jYXN0IDxhdWRpb19zdHJlYW1fdHlwZV90PihkYXRhLnJlYWRJbnQzMigpKTsKLSAgICAgICAgICAgIGF1ZGlvX2RldmljZXNfdCBkZXZpY2UgPSBzdGF0aWNfY2FzdCA8YXVkaW9fZGV2aWNlc190PihkYXRhLnJlYWRJbnQzMigpKTsKLSAgICAgICAgICAgIGludCBpbmRleDsKLSAgICAgICAgICAgIHN0YXR1c190IHN0YXR1cyA9IGdldFN0cmVhbVZvbHVtZUluZGV4KHN0cmVhbSwgJmluZGV4LCBkZXZpY2UpOwotICAgICAgICAgICAgcmVwbHktPndyaXRlSW50MzIoaW5kZXgpOwotICAgICAgICAgICAgcmVwbHktPndyaXRlSW50MzIoc3RhdGljX2Nhc3QgPHVpbnQzMl90PihzdGF0dXMpKTsKLSAgICAgICAgICAgIHJldHVybiBOT19FUlJPUjsKLSAgICAgICAgfSBicmVhazsKLQotICAgICAgICBjYXNlIEdFVF9TVFJBVEVHWV9GT1JfU1RSRUFNOiB7Ci0gICAgICAgICAgICBDSEVDS19JTlRFUkZBQ0UoSUF1ZGlvUG9saWN5U2VydmljZSwgZGF0YSwgcmVwbHkpOwotICAgICAgICAgICAgYXVkaW9fc3RyZWFtX3R5cGVfdCBzdHJlYW0gPQotICAgICAgICAgICAgICAgICAgICBzdGF0aWNfY2FzdCA8YXVkaW9fc3RyZWFtX3R5cGVfdD4oZGF0YS5yZWFkSW50MzIoKSk7Ci0gICAgICAgICAgICByZXBseS0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VJfRUZGRUNUOiB7Ci0gICAgICAgICAgICBDSEVDS19JTlRFUkZBQ0UoSUF1ZGlvUG9saWN5U2VydmljZSwgZGF0YSwgcmVwbHkpOwotICAgICAgICAgICAgZWZmZWN0X2Rlc2NyaXB0b3JfdCBkZXNjOwotICAgICAgICAgICAgZGF0YS5yZWFkKCZkZXNjLCBzaXplb2YoZWZmZWN0X2Rlc2NyaXB0b3JfdCkpOwotICAgICAgICAgICAgYXVkaW9faW9faGFuZGxlX3QgaW8gPSBkYXRhLnJlYWRJbnQzMigpOwotICAgICAgICAgICAgdWludDMyX3Qgc3RyYXRlZ3kgPSBkYXRhLnJlYWRJbnQzMigpOwotICAgICAgICAgICAgaW50IHNlc3Npb24gPSBkYXRhLnJlYWRJbnQzMigpOwotICAgICAgICAgICAgaW50IGlkID0gZGF0YS5yZWFkSW50MzIoKTsKLSAgICAgICAgICAgIHJlcGx5LT53cml0ZUludDMyKHN0YXRpY19jYXN0IDxpbnQzMl90PihyZWdpc3RlckVmZmVjdCgmZGVzYywKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpbywKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzdHJhdGVneSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzZXNzaW9uLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlkKSkpOwotICAgICAgICAgICAgcmV0dXJuIE5PX0VSUk9SOwotICAgICAgICB9IGJyZWFrOwotCi0gICAgICAgIGNhc2UgVU5SRUdJU1RFUl9FRkZFQ1Q6IHsKLSAgICAgICAgICAgIENIRUNLX0lOVEVSRkFDRShJQXVkaW9Qb2xpY3lTZXJ2aWNlLCBkYXRhLCByZXBseS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W5QYXN0TXMpICk7Ci0gICAgICAgICAgICByZXR1cm4gTk9fRVJST1I7Ci0gICAgICAgIH0gYnJlYWs7Ci0KLSAgICAgICAgY2FzZSBRVUVSWV9ERUZBVUxUX1BSRV9QUk9DRVNTSU5HOiB7Ci0gICAgICAgICAgICBDSEVDS19JTlRFUkZBQ0UoSUF1ZGlvUG9saWN5U2VydmljZSwgZGF0YSwgcmVwbHkpOwotICAgICAgICAgICAgaW50IGF1ZGlvU2Vzc2lvbiA9IGRhdGEucmVhZEludDMyKCk7Ci0gICAgICAgICAgICB1aW50MzJfdCBjb3VudCA9IGRhdGEucmVhZEludDMyKCk7Ci0gICAgICAgICAgICB1aW50MzJfdCByZXRDb3VudCA9IGNvdW50OwotICAgICAgICAgICAgZWZmZWN0X2Rlc2NyaXB0b3JfdCAqZGVzY3JpcHRvcnMgPQotICAgICAgICAgICAgICAgICAgICAoZWZmZWN0X2Rlc2NyaXB0b3JfdCAqKW5ldyBjaGFyW2NvdW50ICogc2l6ZW9mKGVmZmVjdF9kZXNjcmlwdG9yX3QpXTsKLSAgICAgICAgICAgIHN0YXR1c190IHN0YXR1cyA9IHF1ZXJ5RGVmYXVsdFByZVByb2Nlc3NpbmcoYXVkaW9TZXNzaW9uLCBkZXNjcmlwdG9ycywgJnJldENvdW50KTsKLSAgICAgICAgICAgIHJlcGx5LT53cml0ZUludDMyKHN0YXR1cyk7Ci0gICAgICAgICAgICBpZiAoc3RhdHVzICE9IE5PX0VSUk9SICYmIHN0YXR1cyAhPSBOT19NRU1PUlkpIHsKLSAgICAgICAgICAgICAgICByZXRDb3VudCA9IDA7Ci0gICAgICAgICAgICB9Ci0gICAgICAgICAgICByZXBseS0+d3JpdGVJbnQzMihyZXRDb3VudCk7Ci0gICAgICAgICAgICBpZiAocmV0Q291bnQpIHsKLSAgICAgICAgICAgICAgICBpZiAocmV0Q291bnQgPCBjb3VudCkgewotICAgICAgICAgICAgICAgICAgICBjb3VudCA9IHJldENvdW50OwotICAgICAgICA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XRhLndyaXRlSW50ZXJmYWNlVG9rZW4oSUF1ZGlvVHJhY2s6OmdldEludGVyZmFjZURlc2NyaXB0b3IoKSk7Ci0gICAgICAgIGRhdGEud3JpdGVJbnQzMihzaXplKTsKLSAgICAgICAgc3RhdHVzX3Qgc3RhdHVzID0gcmVtb3RlKCktPnRyYW5zYWN0KEFMTE9DQVRFX1RJTUVEX0JVRkZFUiwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRhdGEsICZyZXBseSk7Ci0gICAgICAgIGlmIChzdGF0dXMgPT0gTk9fRVJST1IpIHsKLSAgICAgICAgICAgIHN0YXR1cyA9IHJlcGx5LnJlYWRJbnQzMigpOwotICAgICAgICAgICAgaWYgKHN0YXR1cyA9PSBOT19FUlJPUikgewotICAgICAgICAgICAgICAgICpidWZmZXIgPSBpbnRlcmZhY2VfY2FzdDxJTWVtb3J5PihyZXBseS5yZWFkU3Ryb25nQmluZGVyKCkpOwotICAgICAgICAgICAgfQotICAgICAgICB9Ci0gICAgICAgIHJldHVybiBzdGF0dXM7Ci0gICAgfQotCi0gICAgdmlydHVhbCBzdGF0dXNfdCBxdWV1ZVRpbWVkQnVmZmVyKGNvbnN0IHNwPElNZW1vcnk+JiBidWZmZXIsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGludDY0X3QgcHRzKSB7Ci0gICAgICAgIFBhcmNlbCBkYXRhLCByZXBseTsKLSAgICAgICAgZGF0YS53cml0ZUludGVyZmFjZVRva2VuKElBdWRpb1RyYWNrOjpnZXRJbnRlcmZhY2VEZXNjcmlwdG9yKCkpOwotICAgICAgICBkYXRhLndyaXRlU3Ryb25nQmluZGVyKGJ1ZmZlci0+YXNCaW5kZXIoKSk7Ci0gICAgICAgIGRhdGEud3JpdGVJbnQ2NChwdHMpOwotICAgICAgICBzdGF0dXNfdCBzdGF0dXMgPSByZW1vdGUoKS0+dHJhbnNhY3QoUVVFVUVfVElNRURfQlVGRkVSLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZGF0YSwgJnJlcGx5KTsKLSAgICAgICAgaWYgKHN0YXR1cyA9PSBOT19FUlJPUikgewotICAgICAgICAgICAgc3RhdHVzID0gcmVwbHkucmVhZEludDMyKCk7Ci0gICAgICAgIH0KLSAgICAgICAgcmV0dXJuIHN0YXR1czsKLSAgICB9Ci0KLSAgICB2aXJ0dWFsIHN0YXR1c190IHNldE1lZGlhVGltZVRyYW5zZm9ybShjb25zdCBMaW5lYXJUcmFuc2Zvcm0mIHhmb3JtLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGludCB0YXJnZXQpIHsKLSAgICAgICAgUGFyY2VsIGRhdGEsIHJlcGx5OwotICAgICAgICBkYXRhLndyaXRlSW50ZXJmYWNlVG9rZW4oSUF1ZGlvVHJhY2s6OmdldEludGVyZmFjZURlc2NyaXB0b3IoKSk7Ci0gICAgICAgIGRhdGEud3JpdGVJbnQ2NCh4Zm9ybS5hX3plcm8pOwotICAgICAgICBkYXRhLndyaXRlSW50NjQoeGZvcm0uYl96ZXJvKTsKLSAgICAgICAgZGF0YS53cml0ZUludDMyKHhmb3JtLmFfdG9fYl9udW1lcik7Ci0gICAgICAgIGRhdGEud3JpdGVJbnQzMih4Zm9ybS5hX3RvX2JfZGVub20pOwotICAgICAgICBkYXRhLndyaXRlSW50MzIodGFyZ2V0KTsKLSAgICAgICAgc3RhdHVzX3Qgc3RhdHVzID0gcmVtb3RlKCktPnRyYW5zYWN0KFNFVF9NRURJQV9USU1FX1RSQU5TRk9STSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRhdGEsICZyZXBseSk7Ci0gICAgICAgIGlmIChzdGF0dXMgPT0gTk9fRVJST1IpIHsKLSAgICAgICAgICAgIHN0YXR1cyA9IHJlcGx5LnJlYWRJbnQzMigpOwotICAgICAgICB9Ci0gICAgICAgIHJldHVybiBzdG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kSW50MzIoKSwgJmJ1ZmZlcik7Ci0gICAgICAgICAgICByZXBseS0+d3JpdGVJbnQzMihzdGF0dXMpOwotICAgICAgICAgICAgaWYgKHN0YXR1cyA9PSBOT19FUlJPUikgewotICAgICAgICAgICAgICAgIHJlcGx5LT53cml0ZVN0cm9uZ0JpbmRlcihidWZmZXItPmFzQmluZGVyKCkpOwotICAgICAgICAgICAgfQotICAgICAgICAgICAgcmV0dXJuIE5PX0VSUk9SOwotICAgICAgICB9IGJyZWFrOwotICAgICAgICBjYXNlIFFVRVVFX1RJTUVEX0JVRkZFUjogewotICAgICAgICAgICAgQ0hFQ0tfSU5URVJGQUNFKElBdWRpb1RyYWNrLCBkYXRhLCByZXBseSk7Ci0gICAgICAgICAgICBzcDxJTWVtb3J5PiBidWZmZXIgPSBpbnRlcmZhY2VfY2FzdDxJTWVtb3J5PigKLSAgICAgICAgICAgICAgICBkYXRhLnJlYWRTdHJvbmdCaW5kZXIoKSk7Ci0gICAgICAgICAgICB1aW50NjRfdCBwdHMgPSBkYXRhLnJlYWRJbnQ2NCgpOwotICAgICAgICAgICAgcmVwbHktPndyaXRlSW50MzIocXVldWVUaW1lZEJ1ZmZlcihidWZmZXIsIHB0cykpOwotICAgICAgICAgICAgcmV0dXJuIE5PX0VSUk9SOwotICAgICAgICB9IGJyZWFrOwotICAgICAgICBjYXNlIFNFVF9NRURJQV9USU1FX1RSQU5TRk9STTogewotICAgICAgICAgICAgQ0hFQ0tfSU5URVJGQUNFKElBdWRpb1RyYWNrLCBkYXRhLCByZXBseSk7Ci0gICAgICAgICAgICBMaW5lYXJUcmFuc2Zvcm0geGZvcm07Ci0gICAgICAgICAgICB4Zm9ybS5hX3plcm8gPSBkYXRhLnJlYWRJbnQ2NCgpOwotICAgICAgICAgICAgeGZvcm0uYl96ZXJvID0gZGF0YS5yZWFkSW50NjQoKTsKLSAgICAgICAgICAgIHhmb3JtLmFfdG9fYl9udW1lciA9IGRhdGEucmVhZEludDMyKCk7Ci0gICAg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gICAgICAgIHJldHVybiByZXBseS5yZWFkSW50MzIoKTsKLSAgICB9Ci0KLSAgICB2aXJ0dWFsIHN0YXR1c190IHNldEVudGl0bGVtZW50Q29udHJvbE1lc3NhZ2UoCi0gICAgICAgICAgICBjb25zdCB2b2lkICptc2csIHNpemVfdCBtc2dMZW5ndGgpIHsKLSAgICAgICAgUGFyY2VsIGRhdGEsIHJlcGx5OwotICAgICAgICBkYXRhLndyaXRlSW50ZXJmYWNlVG9rZW4oSUNyeXB0bzo6Z2V0SW50ZXJmYWNlRGVzY3JpcHRvcigpKTsKLSAgICAgICAgZGF0YS53cml0ZUludDMyKG1zZ0xlbmd0aCk7Ci0gICAgICAgIGRhdGEud3JpdGUobXNnLCBtc2dMZW5ndGgpOwotICAgICAgICByZW1vdGUoKS0+dHJhbnNhY3QoU0VUX0VDTSwgZGF0YSwgJnJlcGx5KTsKLQotICAgICAgICByZXR1cm4gcmVwbHkucmVhZEludDMyKCk7Ci0gICAgfQotCi0gICAgdmlydHVhbCBzc2l6ZV90IGRlY3J5cHRWaWRlbygKLSAgICAgICAgICAgIGNvbnN0IHZvaWQgKml2LCBzaXplX3QgaXZMZW5ndGgsCi0gICAgICAgICAgICBjb25zdCB2b2lkICpzcmNEYXRhLCBzaXplX3Qgc3JjRGF0YVNpemUsCi0gICAgICAgICAgICB2b2lkICpkc3REYXRhLCBzaXplX3QgZHN0RGF0YU9mZnNldCkgewotICAgICAgICBQYXJjZWwgZGF0YSwgcmVwbHk7Ci0gICAgICAgIGRhdGEud3JpdGVJbnRlcmZhY2VUb2tlbihJQ3J5cHRvOjpnZXRJbnRlcmZhY2VEZXNjcmlwdG9yKCkpOwotICAgICAgICBpZiAoaXYgPT0gTlVMTCkgewotICAgICAgICAgICAgaWYgKGl2TGVuZ3RoID4gMCkgewotICAgICAgICAgICAgICAgIHJldHVybiAtRUlOVkFMOwotICAgICAgICAgICAgfQotCi0gICAgICAgICAgICBkYXRhLndyaXRlSW50MzIoLTEpOwotICAgICAgICB9IGVsc2UgewotICAgICAgICAgICAgZGF0YS53cml0ZUludDMyKGl2TGVuZ3RoKTsKLSAgICAgICAgICAgIGRhdGEud3JpdGUoaXYsIGl2TGVuZ3RoKTsKLSAgICAgICAgfQotCi0gICAgICAgIGRhdGEud3JpdGVJbnQzMihzcmNEYXRhU2l6ZSk7Ci0gICAgICAgIGRhdGEud3JpdGUoc3JjRGF0YSwgc3JjRGF0YVNpemUpOwotCi0gICAgICAgIGRhdGEud3JpdGVJbnRQdHIoKGludHB0cl90KWRzdERhdGEpOwotICAgICAgICBkYXRhLndyaXRlSW50MzIoZHN0RGF0YU9mZnNldCk7Ci0KLSAgICAgICAgcmVtb3RlKCktPnRyYW5zYWN0KERFQ1JZUFRfVklERU8sIGRhdGEsICZyZXBseSk7Ci0KLSAgICAgICAgcmV0dXJuIHJlcGx5LnJlYWRJbnQzMigpOwotICAgIH0KLQotICAgIHZpcnR1YWwgc3NpemVfdCBkZWNyeXB0QXVkaW8oCi0gICAgICAgICAgICBjb25zdCB2b2lkICppdiwgc2l6ZV90IGl2TGVuZ3RoLAotICAgICAgICAgICAgY29uc3Qgdm9pZCAqc3JjRGF0YSwgc2l6ZV90IHNyY0RhdGFTaXplLAotICAgICAgICAgICAgdm9pZCAqZHN0RGF0YSwgc2l6ZV90IGRzdERhdGFTaXplKSB7Ci0gICAgICAgIFBhcmNlbCBkYXRhLCByZXBseTsKLSAgICAgICAgZGF0YS53cml0ZUludGVyZmFjZVRva2VuKElDcnlwdG86OmdldEludGVyZmFjZURlc2NyaXB0b3IoKSk7Ci0gICAgICAgIGlmIChpdiA9PSBOVUxMKSB7Ci0gICAgICAgICAgICBpZiAoaXZMZW5ndGggPiAwKSB7Ci0gICAgICAgICAgICAgICAgcmV0dXJuIC1FSU5WQUw7Ci0gICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgIGRhdGEud3JpdGVJbnQzMigtMSk7Ci0gICAgICAgIH0gZWxzZSB7Ci0gICAgICAgICAgICBkYXRhLndya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dG8sIGRhdGEsIHJlcGx5KTsKLSAgICAgICAgICAgIHJlcGx5LT53cml0ZUludDMyKGluaXRpYWxpemUoKSk7Ci0KLSAgICAgICAgICAgIHJldHVybiBPSzsKLSAgICAgICAgfQotCi0gICAgICAgIGNhc2UgVEVSTUlOQVRFOgotICAgICAgICB7Ci0gICAgICAgICAgICBDSEVDS19JTlRFUkZBQ0UoSUNyeXB0bywgZGF0YSwgcmVwbHkpOwotICAgICAgICAgICAgcmVwbHktPndyaXRlSW50MzIodGVybWluYXRlKCkpOwotCi0gICAgICAgICAgICByZXR1cm4gT0s7Ci0gICAgICAgIH0KLQotICAgICAgICBjYXNlIFNFVF9FTlRJVExFTUVOVF9LRVk6Ci0gICAgICAgIHsKLSAgICAgICAgICAgIENIRUNLX0lOVEVSRkFDRShJQ3J5cHRvLCBkYXRhLCByZXBseSk7Ci0KLSAgICAgICAgICAgIHNpemVfdCBrZXlMZW5ndGggPSBkYXRhLnJlYWRJbnQzMigpOwotICAgICAgICAgICAgdm9pZCAqa2V5ID0gbWFsbG9jKGtleUxlbmd0aCk7Ci0gICAgICAgICAgICBkYXRhLnJlYWQoa2V5LCBrZXlMZW5ndGgpOwotCi0gICAgICAgICAgICByZXBseS0+d3JpdGVJbnQzMihzZXRFbnRpdGxlbWVudEtleShrZXksIGtleUxlbmd0aCkpOwotCi0gICAgICAgICAgICBmcmVlKGtleSk7Ci0gICAgICAgICAgICBrZXkgPSBOVUxMOwotCi0gICAgICAgICAgICByZXR1cm4gT0s7Ci0gICAgICAgIH0KLQotICAgICAgICBjYXNlIFNFVF9FQ006Ci0gICAgICAgIHsKLSAgICAgICAgICAgIENIRUNLX0lOVEVSRkFDRShJQ3J5cHRvLCBkYXRhLCByZXBseSk7Ci0KLSAgICAgICAgICAgIHNpemVfdCBtc2dMZW5ndGggPSBkYXRhLnJlYWRJbnQzMigpOwotICAgICAgICAgICAgdm9pZCAqbXNnID0gbWFsbG9jKG1zZ0xlbmd0aCk7Ci0gICAgICAgICAgICBkYXRhLnJlYWQobXNnLCBtc2dMZW5ndGgpOwotCi0gICAgICAgICAgICByZXBseS0+d3JpdGVJbnQzMihzZXRFbnRpdGxlbWVudENvbnRyb2xNZXNzYWdlKG1zZywgbXNnTGVuZ3RoKSk7Ci0KLSAgICAgICAgICAgIGZyZWUobXNnKTsKLSAgICAgICAgICAgIG1zZyA9IE5VTEw7Ci0KLSAgICAgICAgICAgIHJldHVybiBPSzsKLSAgICAgICAgfQotCi0gICAgICAgIGNhc2UgREVDUllQVF9WSURFTzoKLSAgICAgICAgewotICAgICAgICAgICAgQ0hFQ0tfSU5URVJGQUNFKElDcnlwdG8sIGRhdGEsIHJlcGx5KTsKLQotICAgICAgICAgICAgdm9pZCAqaXYgPSBOVUxMOwotCi0gICAgICAgICAgICBpbnQzMl90IGl2TGVuZ3RoID0gZGF0YS5yZWFkSW50MzIoKTsKLSAgICAgICAgICAgIGlmIChpdkxlbmd0aCA+PSAwKSB7Ci0gICAgICAgICAgICAgICAgaXYgPSBtYWxsb2MoaXZMZW5ndGgpOwotICAgICAgICAgICAgICAgIGRhdGEucmVhZChpdiwgaXZMZW5ndGgpOwotICAgICAgICAgICAgfQotCi0gICAgICAgICAgICBzaXplX3Qgc3JjRGF0YVNpemUgPSBkYXRhLnJlYWRJbnQzMigpOwotICAgICAgICAgICAgdm9pZCAqc3JjRGF0YSA9IG1hbGxvYyhzcmNEYXRhU2l6ZSk7Ci0gICAgICAgICAgICBkYXRhLnJlYWQoc3JjRGF0YSwgc3JjRGF0YVNpemUpOwotCi0gICAgICAgICAgICB2b2lkICpkc3REYXRhID0gKHZvaWQgKilkYXRhLnJlYWRJbnRQdHIoKTsKLSAgICAgICAgICAgIHNpemVfdCBkc3REYXRhT2Zmc2V0ID0gZGF0YS5yZWFkSW50MzIoKTsKLQotICAgICAgICAgICAgcmVwbHktPndyaXRlSW50MzIoCi0gICAgICAgICAgICAgICAgICAgIGRlY3J5cHRWaWRlbygKLSAgICAgICAgICAgICAgICAgICAgICAgIGl2LAotICAgICAgICAgICAgICAgICAgICAgICAgaXZMZW5ndGggPCAwID8gMCA6IGl2TGVuZ3RoLAotICAgICAgICAgICAgICAgICAgICAgICAgc3JjRGF0YSwKLSAgICAgICAgICAgICAgICAgICAgICAgIHNyY0RhdGFTaXplLAotICAgICAgICAgICAgICAgICAgICAgICAgZHN0RGF0YSwKLSAgICAgICAgICAgICAgICAgICAgICAgIGRzdERhdGFPZmZzZXQpKTsKLQotICAgICAgICAgICAgZnJlZShzcmNEYXRhKTsKLSAgICAgICAgICAgIHNyY0RhdGEgPSBOVUxMOwotCi0gICAgICAgICAgICBpZiAoaXYgIT0gTlVMTCkgewotICAgICAgICAgICAgICAgIGZyZWUoaXYpOwotICAgICAgICAgICAgICAgIGl2ID0gTlVMTDsKLSAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgcmV0dXJuIE9LOwotICAgICAgICB9Ci0KLSAgICAgICAgY2FzZSBERUNSWVBUX0FVRElPOgotICAgICAgICB7Ci0gICAgICAgICAgICBDSEVDS19JTlRFUkZBQ0UoSUNyeXB0bywgZGF0YSwgcmVwbHkpOwotCi0gICAgICAgICAgICB2b2lkICppdiA9IE5VTEw7Ci0KLSAgICAgICAgICAgIGludDMyX3QgaXZMZW5ndGggPSBkYXRhLnJlYWRJbnQzMigpOwotICAgICAgICAgICAgaWYgKGl2TGVuZ3RoID49IDApIHsKLSAgICAgICAgICAgICAgICBpdiA9IG1hbGxvYyhpdkxlbmd0aCk7Ci0gICAgICAgICAgICAgICAgZGF0YS5yZWFkKGl2LCBpdkxlbmd0aCk7Ci0gICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgIHNpemVfdCBzcmNEYXRhU2l6ZSA9IGRhdGEucmVhZEludDMyKCk7Ci0gICAgICAgICAgICB2b2lkICpzcmNEYXRhID0gbWFsbG9jKHNyY0RhdGFTaXplKTsKLSAgICAgICAgICAgIGRhdGEucmVhZChzcmNEYXRhLCBzcmNEYXRhU2l6ZSk7Ci0KLSAgICAgICAgICAgIHNpemVfdCBkc3REYXRhU2l6ZSA9IGRhdGEucmVhZEludDMyKCk7Ci0gICAgICAgICAgICB2b2lkICpkc3REYXRhID0gbWFsbG9jKGRzdERhdGFTaXplKTsKLQotICAgICAgICAgICAgc3NpemVfdCByZXMgPQotICAgICAgICAgICAgICAgIGRlY3J5cHRBdWRpbygKLSAgICAgICAgICAgICAgICAgICAgICAgIGl2LAotICAgICAgICAgICAgICAgICAgICAgICAgaXZMZW5ndGggPCAwID8gMCA6IGl2TGVuZ3RoLAotICAgICAgICAgICAgICAgICAgICAgICAgc3JjRGF0YSwKLSAgICAgICAgICAgICAgICAgICAgICAgIHNyY0RhdGFTaXplLAotICAgICAgICAgICAgICAgICAgICAgICAgZHN0RGF0YSwKLSAgICAgICAgICAgICAgICAgICAgICAgIGRzdERhdGFTaXplKTsKLQotICAgICAgICAgICAgcmVwbHktPndyaXRlSW50MzIocmVzKTsKLQotICAgICAgICAgICAgaWYgKHJlcyA+IDApIHsKLSAgICAgICAgICAgICAgICByZXBseS0+d3JpdGUoZHN0RGF0YSwgcmVzKTsKLSAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgZnJlZShkc3REYXRhKTsKLSAgICAgICAgICAgIGRzdERhdGEgPSBOVUxMOwotCi0gICAgICAgICAgICBmcmVlKHNyY0RhdGEpOwotICAgICAgICAgICAgc3JjRGF0YSA9IE5VTEw7Ci0KLSAgICAgICAgICAgIGlmIChpdiAhPSBOVUxMKSB7Ci0gICAgICAgICAgICAgICAgZnJlZShpdik7Ci0gICAgICAgICAgICAgICAgaXYgPSBOVUxMOwotICAgICAgICAgICAgfQotCi0gICAgICAgICAgICByZXR1cm4gT0s7Ci0gICAgICAgIH0KLQotICAgICAgICBkZWZhdWx0OgotICAgICAgICAgICAgcmV0dXJuIEJCaW5kZXI6Om9uVHJhbnNhY3QoY29kZSwgZGF0YSwgcmVwbHksIGZsYWdzKTsKLSAgICB9Ci19Ci0KLX0gIC8vIG5hbWVzcGFjZSB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ZXBseTsKLSAgICAgICAgZGF0YS53cml0ZUludGVyZmFjZVRva2VuKElFZmZlY3Q6OmdldEludGVyZmFjZURlc2NyaXB0b3IoKSk7Ci0gICAgICAgIHJlbW90ZSgpLT50cmFuc2FjdChESVNBQkxFLCBkYXRhLCAmcmVwbHkpOwotICAgICAgICByZXR1cm4gcmVwbHkucmVhZEludDMyKCk7Ci0gICAgfQotCi0gICAgc3RhdHVzX3QgY29tbWFuZCh1aW50MzJfdCBjbWRDb2RlLAotICAgICAgICAgICAgICAgICAgICAgdWludDMyX3QgY21kU2l6ZSwKLSAgICAgICAgICAgICAgICAgICAgIHZvaWQgKnBDbWREYXRhLAotICAgICAgICAgICAgICAgICAgICAgdWludDMyX3QgKnBSZXBseVNpemUsCi0gICAgICAgICAgICAgICAgICAgICB2b2lkICpwUmVwbHlEYXRhKQotICAgIHsKLSAgICAgICAgQUxPR1YoImNvbW1hbmQiKTsKLSAgICAgICAgUGFyY2VsIGRhdGEsIHJlcGx5OwotICAgICAgICBkYXRhLndyaXRlSW50ZXJmYWNlVG9rZW4oSUVmZmVjdDo6Z2V0SW50ZXJmYWNlRGVzY3JpcHRvcigpKTsKLSAgICAgICAgZGF0YS53cml0ZUludDMyKGNtZENvZGUpOwotICAgICAgICBpbnQgc2l6ZSA9IGNtZFNpemU7Ci0gICAgICAgIGlmIChwQ21kRGF0YSA9PSBOVUxMKSB7Ci0gICAgICAgICAgICBzaXplID0gMDsKLSAgICAgICAgfQotICAgICAgICBkYXRhLndyaXRlSW50MzIoc2l6ZSk7Ci0gICAgICAgIGlmIChzaXplKSB7Ci0gICAgICAgICAgICBkYXRhLndyaXRlKHBDbWREYXRhLCBzaXplKTsKLSAgICAgICAgfQotICAgICAgICBpZiAocFJlcGx5U2l6ZSA9PSBOVUxMKSB7Ci0gICAgICAgICAgICBzaXplID0gMDsKLSAgICAgICAgfSBlbHNlIHsKLSAgICAgICAgICAgIHNpemUgPSAqcFJlcGx5U2l6ZTsKLSAgICAgICAgfQotICAgICAgICBkYXRhLndyaXRlSW50MzIoc2l6ZSk7Ci0KLSAgICAgICAgc3RhdHVzX3Qgc3RhdHVzID0gcmVtb3RlKCktPnRyYW5zYWN0KENPTU1BTkQsIGRhdGEsICZyZXBseSk7Ci0gICAgICAgIGlmIChzdGF0dXMgIT0gTk9fRVJST1IpIHsKLSAgICAgICAgICAgIGlmIChwUmVwbHlTaXplICE9IE5VTEwpCi0gICAgICAgICAgICAgICAgKnBSZXBseVNpemUgPSAwOwotICAgICAgICAgICAgcmV0dXJuIHN0YXR1czsKLSAgICAgICAgfQotCi0gICAgICAgIHN0YXR1cyA9IHJlcGx5LnJlYWRJbnQzMigpOwotICAgICAgICBzaXplID0gcmVwbHkucmVhZEludDMyKCk7Ci0gICAgICAgIGlmIChzaXplICE9IDAgJiYgcFJlcGx5RGF0YSAhPSBOVUxMICYmIHBSZXBseVNpemUgIT0gTlVMTCkgewotICAgICAgICAgICAgcmVwbHkucmVhZChwUmVwbHlEYXRhLCBzaXplKTsKLSAgICAgICAgICAgICpwUmVwbHlTaXplID0gc2l6ZTsKLSAgICAgICAgfQotICAgICAgICByZXR1cm4gc3RhdHVzOwotICAgIH0KLQotICAgIHZvaWQgZGlzY29ubmVjdCgpCi0gICAgewotICAgICAgICBBTE9HVigiZGlzY29ubmVjdCIpOwotICAgICAgICBQYXJjZWwgZGF0YSwgcmVwbHk7Ci0gICAgICAgIGRhdGEud3JpdGVJbnRlcmZhY2VUb2tlbihJRWZmZWN0OjpnZXRJbnRlcmZhY2VEZXNjcmlwdG9yKCkpOwotICAgICAgICByZW1vdGUoKS0+dHJhbnNhY3QoRElTQ09OTkVDVCwgZGF0YSwgJnJlcGx5KTsKLSAgICAgICAgcmV0dXJuOwotICAgIH0KLQotICAgIHZpcnR1YWwgc3A8SU1lbW9yeT4gZ2V0Q2JsaygpIGNvbnN0Ci0gICAgewotICAgICAgICBQYXJjZWwgZGF0YSwgcmVwbHk7Ci0gICAgICAgIHNwPElNZW1vcnk+IGNib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ICAgICAgICAgQ0hFQ0tfSU5URVJGQUNFKElFZmZlY3QsIGRhdGEsIHJlcGx5KTsKLSAgICAgICAgICAgIHJlcGx5LT53cml0ZUludDMyKGRpc2FibGUoKSk7Ci0gICAgICAgICAgICByZXR1cm4gTk9fRVJST1I7Ci0gICAgICAgIH0gYnJlYWs7Ci0KLSAgICAgICAgY2FzZSBDT01NQU5EOiB7Ci0gICAgICAgICAgICBBTE9HVigiQ09NTUFORCIpOwotICAgICAgICAgICAgQ0hFQ0tfSU5URVJGQUNFKElFZmZlY3QsIGRhdGEsIHJlcGx5KTsKLSAgICAgICAgICAgIHVpbnQzMl90IGNtZENvZGUgPSBkYXRhLnJlYWRJbnQzMigpOwotICAgICAgICAgICAgdWludDMyX3QgY21kU2l6ZSA9IGRhdGEucmVhZEludDMyKCk7Ci0gICAgICAgICAgICBjaGFyICpjbWQgPSBOVUxMOwotICAgICAgICAgICAgaWYgKGNtZFNpemUpIHsKLSAgICAgICAgICAgICAgICBjbWQgPSAoY2hhciAqKW1hbGxvYyhjbWRTaXplKTsKLSAgICAgICAgICAgICAgICBkYXRhLnJlYWQoY21kLCBjbWRTaXplKTsKLSAgICAgICAgICAgIH0KLSAgICAgICAgICAgIHVpbnQzMl90IHJlcGx5U2l6ZSA9IGRhdGEucmVhZEludDMyKCk7Ci0gICAgICAgICAgICB1aW50MzJfdCByZXBseVN6ID0gcmVwbHlTaXplOwotICAgICAgICAgICAgY2hhciAqcmVzcCA9IE5VTEw7Ci0gICAgICAgICAgICBpZiAocmVwbHlTaXplKSB7Ci0gICAgICAgICAgICAgICAgcmVzcCA9IChjaGFyICopbWFsbG9jKHJlcGx5U2l6ZSk7Ci0gICAgICAgICAgICB9Ci0gICAgICAgICAgICBzdGF0dXNfdCBzdGF0dXMgPSBjb21tYW5kKGNtZENvZGUsIGNtZFNpemUsIGNtZCwgJnJlcGx5U3osIHJlc3ApOwotICAgICAgICAgICAgcmVwbHktPndyaXRlSW50MzIoc3RhdHVzKTsKLSAgICAgICAgICAgIGlmIChyZXBseVN6IDwgcmVwbHlTaXplKSB7Ci0gICAgICAgICAgICAgICAgcmVwbHlTaXplID0gcmVwbHlTejsKLSAgICAgICAgICAgIH0KLSAgICAgICAgICAgIHJlcGx5LT53cml0ZUludDMyKHJlcGx5U2l6ZSk7Ci0gICAgICAgICAgICBpZiAocmVwbHlTaXplKSB7Ci0gICAgICAgICAgICAgICAgcmVwbHktPndyaXRlKHJlc3AsIHJlcGx5U2l6ZSk7Ci0gICAgICAgICAgICB9Ci0gICAgICAgICAgICBpZiAoY21kKSB7Ci0gICAgICAgICAgICAgICAgZnJlZShjbWQpOwotICAgICAgICAgICAgfQotICAgICAgICAgICAgaWYgKHJlc3ApIHsKLSAgICAgICAgICAgICAgICBmcmVlKHJlc3ApOwotICAgICAgICAgICAgfQotICAgICAgICAgICAgcmV0dXJuIE5PX0VSUk9SOwotICAgICAgICB9IGJyZWFrOwotCi0gICAgICAgIGNhc2UgRElTQ09OTkVDVDogewotICAgICAgICAgICAgQUxPR1YoIkRJU0NPTk5FQ1QiKTsKLSAgICAgICAgICAgIENIRUNLX0lOVEVSRkFDRShJRWZmZWN0LCBkYXRhLCByZXBseSk7Ci0gICAgICAgICAgICBkaXNjb25uZWN0KCk7Ci0gICAgICAgICAgICByZXR1cm4gTk9fRVJST1I7Ci0gICAgICAgIH0gYnJlYWs7Ci0KLSAgICAgICAgY2FzZSBHRVRfQ0JMSzogewotICAgICAgICAgICAgQ0hFQ0tfSU5URVJGQUNFKElFZmZlY3QsIGRhdGEsIHJlcGx5KTsKLSAgICAgICAgICAgIHJlcGx5LT53cml0ZVN0cm9uZ0JpbmRlcihnZXRDYmxrKCktPmFzQmluZGVyKCkpOwotICAgICAgICAgICAgcmV0dXJuIE5PX0VSUk9SOwotICAgICAgICB9IGJyZWFrOwotCi0gICAgICAgIGRlZmF1bHQ6Ci0gICAgICAgICAgICByZXR1cm4gQkJpbmRlcjo6b25UcmFuc2FjdChjb2RlLCBkYXRhLCByZ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FjZVRva2VuKElFZmZlY3RDbGllbnQ6OmdldEludGVyZmFjZURlc2NyaXB0b3IoKSk7Ci0gICAgICAgIGRhdGEud3JpdGVJbnQzMigodWludDMyX3QpY29udHJvbEdyYW50ZWQpOwotICAgICAgICByZW1vdGUoKS0+dHJhbnNhY3QoQ09OVFJPTF9TVEFUVVNfQ0hBTkdFRCwgZGF0YSwgJnJlcGx5LCBJQmluZGVyOjpGTEFHX09ORVdBWSk7Ci0gICAgfQotCi0gICAgdm9pZCBlbmFibGVTdGF0dXNDaGFuZ2VkKGJvb2wgZW5hYmxlZCkKLSAgICB7Ci0gICAgICAgIEFMT0dWKCJlbmFibGVTdGF0dXNDaGFuZ2VkIik7Ci0gICAgICAgIFBhcmNlbCBkYXRhLCByZXBseTsKLSAgICAgICAgZGF0YS53cml0ZUludGVyZmFjZVRva2VuKElFZmZlY3RDbGllbnQ6OmdldEludGVyZmFjZURlc2NyaXB0b3IoKSk7Ci0gICAgICAgIGRhdGEud3JpdGVJbnQzMigodWludDMyX3QpZW5hYmxlZCk7Ci0gICAgICAgIHJlbW90ZSgpLT50cmFuc2FjdChFTkFCTEVfU1RBVFVTX0NIQU5HRUQsIGRhdGEsICZyZXBseSwgSUJpbmRlcjo6RkxBR19PTkVXQVkpOwotICAgIH0KLQotICAgIHZvaWQgY29tbWFuZEV4ZWN1dGVkKHVpbnQzMl90IGNtZENvZGUsCi0gICAgICAgICAgICAgICAgICAgICAgICAgdWludDMyX3QgY21kU2l6ZSwKLSAgICAgICAgICAgICAgICAgICAgICAgICB2b2lkICpwQ21kRGF0YSwKLSAgICAgICAgICAgICAgICAgICAgICAgICB1aW50MzJfdCByZXBseVNpemUsCi0gICAgICAgICAgICAgICAgICAgICAgICAgdm9pZCAqcFJlcGx5RGF0YSkKLSAgICB7Ci0gICAgICAgIEFMT0dWKCJjb21tYW5kRXhlY3V0ZWQiKTsKLSAgICAgICAgUGFyY2VsIGRhdGEsIHJlcGx5OwotICAgICAgICBkYXRhLndyaXR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QzMl90IGZsYWdzKQotewotICAgIHN3aXRjaCAoY29kZSkgewotICAgICAgICBjYXNlIENPTlRST0xfU1RBVFVTX0NIQU5HRUQ6IHsKLSAgICAgICAgICAgIEFMT0dWKCJDT05UUk9MX1NUQVRVU19DSEFOR0VEIik7Ci0gICAgICAgICAgICBDSEVDS19JTlRFUkZBQ0UoSUVmZmVjdENsaWVudCwgZGF0YSwgcmVwbHkpOwotICAgICAgICAgICAgYm9vbCBoYXNDb250cm9sID0gKGJvb2wpZGF0YS5yZWFkSW50MzIoKTsKLSAgICAgICAgICAgIGNvbnRyb2xTdGF0dXNDaGFuZ2VkKGhhc0NvbnRyb2wpOwotICAgICAgICAgICAgcmV0dXJuIE5PX0VSUk9SOwotICAgICAgICB9IGJyZWFrOwotICAgICAgICBjYXNlIEVOQUJMRV9TVEFUVVNfQ0hBTkdFRDogewotICAgICAgICAgICAgQUxPR1YoIkVOQUJMRV9TVEFUVVNfQ0hBTkdFRCIpOwotICAgICAgICAgICAgQ0hFQ0tfSU5URVJGQUNFKElFZmZlY3RDbGllbnQsIGRhdGEsIHJlcGx5KTsKLSAgICAgICAgICAgIGJvb2wgZW5hYmxlZCA9IChib29sKWRhdGEucmVhZEludDMyKCk7Ci0gICAgICAgICAgICBlbmFibGVTdGF0dXNDaGFuZ2VkKGVuYWJsZWQpOwotICAgICAgICAgICAgcmV0dXJuIE5PX0VSUk9SOwotICAgICAgICB9IGJyZWFrOwotICAgICAgICBjYXNlIENPTU1BTkRfRVhFQ1VURUQ6IHsKLSAgICAgICAgICAgIEFMT0dWKCJDT01NQU5EX0VYRUNVVEVEIik7Ci0gICAgICAgICAgICBDSEVDS19JTlRFUkZBQ0UoSUVmZmVjdENsaWVudCwgZGF0YSwgcmVwbHkpOwotICAgICAgICAgICAgdWludDMyX3QgY21kQ29kZSA9IGRhdGEucmVhZEludDMyKCk7Ci0gICAgICAgICAgICB1aW50MzJfdCBjbWRTaXplID0gZGF0YS5yZWFkSW50MzIoKTsKLSAgICAgICAgICAgIGNoYXIgKmNtZCA9IE5VTEw7Ci0gICAgICAgICAgICBpZiAoY21kU2l6ZSkgewotICAgICAgICAgICAgICAgIGNtZCA9IChjaGFyICopbWFsbG9jKGNtZFNpemUpOwotICAgICAgICAgICAgICAgIGRhdGEucmVhZChjbWQsIGNtZFNpemUpOwotICAgICAgICAgICAgfQotICAgICAgICAgICAgdWludDMyX3QgcmVwbHlTaXplID0gZGF0YS5yZWFkSW50MzIoKTsKLSAgICAgICAgICAgIGNoYXIgKnJlc3AgPSBOVUxMOwotICAgICAgICAgICAgaWYgKHJlcGx5U2l6ZSkgewotICAgICAgICAgICAgICAgIHJlc3AgPSAoY2hhciAqKW1hbGxvYyhyZXBseVNpemUpOwotICAgICAgICAgICAgICAgIGRhdGEucmVhZChyZXNwLCByZXBseVNpemUpOwotICAgICAgICAgICAgfQotICAgICAgICAgICAgY29tbWFuZEV4ZWN1dGVkKGNtZENvZGUsIGNtZFNpemUsIGNtZCwgcmVwbHlTaXplLCByZXNwKTsKLSAgICAgICAgICAgIGlmIChjbWQpIHsKLSAgICAgICAgICAgICAgICBmcmVlKGNtZCk7Ci0gICAgICAgICAgICB9Ci0gICAgICAgICAgICBpZiAocmVzcCkgewotICAgICAgICAgICAgICAgIGZyZWUocmVzcCk7Ci0gICAgICAgICAgICB9Ci0gICAgICAgICAgICByZXR1cm4gTk9fRVJST1I7Ci0gICAgICAgIH0gYnJlYWs7Ci0gICAgICAgIGRlZmF1bHQ6Ci0gICAgICAgICAgICByZXR1cm4gQkJpbmRlcjo6b25UcmFuc2FjdChjb2RlLCBkYXRhLCByZXBseSwgZmxhZ3MpOwotICAgIH0KLX0KLQotLy8gLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLQotCi19OyAvLyBuYW1lc3BhY2UgYW5kcm9pZApkaWZmIC0tZ2l0IGEvbWVkaWEvb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Y2hhciAqc3JjVXJsLCBjb25zdCBLZXllZFZlY3RvcjxTdHJpbmc4LCBTdHJpbmc4PiAqaGVhZGVycykKLSAgICB7Ci0gICAgICAgIFBhcmNlbCBkYXRhLCByZXBseTsKLSAgICAgICAgZGF0YS53cml0ZUludGVyZmFjZVRva2VuKElNZWRpYU1ldGFkYXRhUmV0cmlldmVyOjpnZXRJbnRlcmZhY2VEZXNjcmlwdG9yKCkpOwotICAgICAgICBkYXRhLndyaXRlQ1N0cmluZyhzcmNVcmwpOwotCi0gICAgICAgIGlmIChoZWFkZXJzID09IE5VTEwpIHsKLSAgICAgICAgICAgIGRhdGEud3JpdGVJbnQzMigwKTsKLSAgICAgICAgfSBlbHNlIHsKLSAgICAgICAgICAgIC8vIHNlcmlhbGl6ZSB0aGUgaGVhZGVycwotICAgICAgICAgICAgZGF0YS53cml0ZUludDMyKGhlYWRlcnMtPnNpemUoKSk7Ci0gICAgICAgICAgICBmb3IgKHNpemVfdCBpID0gMDsgaSA8IGhlYWRlcnMtPnNpemUoKTsgKytpKSB7Ci0gICAgICAgICAgICAgICAgZGF0YS53cml0ZVN0cmluZzgoaGVhZGVycy0+a2V5QXQoaSkpOwotICAgICAgICAgICAgICAgIGRhdGEud3JpdGVTdHJpbmc4KGhlYWRlcnMtPnZhbHVlQXQoaSkpOwotICAgICAgICAgICAgfQotICAgICAgICB9Ci0KLSAgICAgICAgcmVtb3RlKCktPnRyYW5zYWN0KFNFVF9EQVRBX1NPVVJDRV9VUkwsIGRhdGEsICZyZXBseSk7Ci0gICAgICAgIHJldHVybiByZXBseS5yZWFkSW50MzIoKTsKLSAgICB9Ci0KLSAgICBzdGF0dXNfdCBzZXREYXRhU291cmNlKGludCBmZCwgaW50NjRfdCBvZmZzZXQsIGludDY0X3QgbGVuZ3RoKQotICAgIHsKLSAgICAgICAgUGFyY2VsIGRhdGEsIHJlcGx5OwotICAgICAgICBkYXRhLndyaXRlSW50ZXJmYWNlVG9rZW4oSU1lZGlhTWV0YWRh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JlcGx5KTsKLSAgICAgICAgICAgIGNvbnN0IGNoYXIqIHNyY1VybCA9IGRhdGEucmVhZENTdHJpbmcoKTsKLQotICAgICAgICAgICAgS2V5ZWRWZWN0b3I8U3RyaW5nOCwgU3RyaW5nOD4gaGVhZGVyczsKLSAgICAgICAgICAgIGludDMyX3QgbnVtSGVhZGVycyA9IGRhdGEucmVhZEludDMyKCk7Ci0gICAgICAgICAgICBmb3IgKGludCBpID0gMDsgaSA8IG51bUhlYWRlcnM7ICsraSkgewotICAgICAgICAgICAgICAgIFN0cmluZzgga2V5ID0gZGF0YS5yZWFkU3RyaW5nOCgpOwotICAgICAgICAgICAgICAgIFN0cmluZzggdmFsdWUgPSBkYXRhLnJlYWRTdHJpbmc4KCk7Ci0gICAgICAgICAgICAgICAgaGVhZGVycy5hZGQoa2V5LCB2YWx1ZSk7Ci0gICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgIHJlcGx5LT53cml0ZUludDMyKAotICAgICAgICAgICAgICAgICAgICBzZXREYXRhU291cmNlKHNyY1VybCwgbnVtSGVhZGVycyA+IDAgPyAmaGVhZGVycyA6IE5VTEwpKTsKLQotICAgICAgICAgICAgcmV0dXJuIE5PX0VSUk9SOwotICAgICAgICB9IGJyZWFrOwotICAgICAgICBjYXNlIFNFVF9EQVRBX1NPVVJDRV9GRDogewotICAgICAgICAgICAgQ0hFQ0tfSU5URVJGQUNFKElNZWRpYU1ldGFkYXRhUmV0cmlldmVyLCBkYXRhLCByZXBseSk7Ci0gICAgICAgICAgICBpbnQgZmQgPSBkdXAoZGF0YS5yZWFkRmlsZURlc2NyaXB0b3IoKSk7Ci0gICAgICAgICAgICBpbnQ2NF90IG9mZnNldCA9IGRhdGEucmVhZEludDY0KCk7Ci0gICAgICAgICAgICBpbnQ2NF90IGxlbmd0aCA9IGRhdGEucmVhZEludDY0KCk7Ci0gICAgICAgICAgICByZXBseS0+d3JpdGVJbnQzMihzZXREYXRhU291cmNlKGZkLCBvZmZzZXQsIGxlbm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pOwotICAgICAgICAgICAgZGlzY29ubmVjdCgpOwotICAgICAgICAgICAgcmV0dXJuIE5PX0VSUk9SOwotICAgICAgICB9IGJyZWFrOwotICAgICAgICBjYXNlIFNFVF9EQVRBX1NPVVJDRV9VUkw6IHsKLSAgICAgICAgICAgIENIRUNLX0lOVEVSRkFDRShJTWVkaWFQbGF5ZXIsIGRhdGEsIHJlcGx5KTsKLSAgICAgICAgICAgIGNvbnN0IGNoYXIqIHVybCA9IGRhdGEucmVhZENTdHJpbmcoKTsKLSAgICAgICAgICAgIEtleWVkVmVjdG9yPFN0cmluZzgsIFN0cmluZzg+IGhlYWRlcnM7Ci0gICAgICAgICAgICBpbnQzMl90IG51bUhlYWRlcnMgPSBkYXRhLnJlYWRJbnQzMigpOwotICAgICAgICAgICAgZm9yIChpbnQgaSA9IDA7IGkgPCBudW1IZWFkZXJzOyArK2kpIHsKLSAgICAgICAgICAgICAgICBTdHJpbmc4IGtleSA9IGRhdGEucmVhZFN0cmluZzgoKTsKLSAgICAgICAgICAgICAgICBTdHJpbmc4IHZhbHVlID0gZGF0YS5yZWFkU3RyaW5nOCgpOwotICAgICAgICAgICAgICAgIGhlYWRlcnMuYWRkKGtleSwgdmFsdWUpOwotICAgICAgICAgICAgfQotICAgICAgICAgICAgcmVwbHktPndyaXRlSW50MzIoc2V0RGF0YVNvdXJjZSh1cmwsIG51bUhlYWRlcnMgPiAwID8gJmhlYWRlcnMgOiBOVUxMKSk7Ci0gICAgICAgICAgICByZXR1cm4gTk9fRVJST1I7Ci0gICAgICAgIH0gYnJlYWs7Ci0gICAgICAgIGNhc2UgU0VUX0RBVEFfU09VUkNFX0ZEOiB7Ci0gICAgICAgICAgICBDSEVDS19JTlRFUkZBQ0UoSU1lZGlhUGxheWVyLCBkYXRhLCByZXBseSk7Ci0gICAgICAgICAgICBpbnQgZmQgPSBkYXRhLnJlYWRGaWxlRGVzY3JpcHRvcigpOwotICAgICAgICAgICAgaW50NjRfdCBvZmZzZXQgPSBkYXRhLnJlYWRJbnQ2NCgpOwotICAgICAgICAgICAgaW50NjRfdCBsZW5ndGggPSBkYXRhLnJlYWRJbnQ2NCgpOwotICAgICAgICAgICAgcmVwbHktPndyaXRlSW50MzIoc2V0RGF0YVNvdXJjZShmZCwgb2Zmc2V0LCBsZW5ndGgpKTsKLSAgICAgICAgICAgIHJldHVybiBOT19FUlJPUjsKLSAgICAgICAgfQotICAgICAgICBjYXNlIFNFVF9EQVRBX1NPVVJDRV9TVFJFQU06IHsKLSAgICAgICAgICAgIENIRUNLX0lOVEVSRkFDRShJTWVkaWFQbGF5ZXIsIGRhdGEsIHJlcGx5KTsKLSAgICAgICAgICAgIHNwPElTdHJlYW1Tb3VyY2U+IHNvdXJjZSA9Ci0gICAgICAgICAgICAgICAgaW50ZXJmYWNlX2Nhc3Q8SVN0cmVhbVNvdXJjZT4oZGF0YS5yZWFkU3Ryb25nQmluZGVyKCkpOwotICAgICAgICAgICAgcmVwbHktPndyaXRlSW50MzIoc2V0RGF0YVNvdXJjZShzb3VyY2UpKTsKLSAgICAgICAgICAgIHJldHVybiBOT19FUlJPUjsKLSAgICAgICAgfQotICAgICAgICBjYXNlIFNFVF9WSURFT19TVVJGQUNFVEVYVFVSRTogewotICAgICAgICAgICAgQ0hFQ0tfSU5URVJGQUNFKElNZWRpYVBsYXllciwgZGF0YSwgcmVwbHkpOwotICAgICAgICAgICAgc3A8SVN1cmZhY2VUZXh0dXJlPiBzdXJmYWNlVGV4dHVyZSA9Ci0gICAgICAgICAgICAgICAgICAgIGludGVyZmFjZV9jYXN0PElTdXJmYWNlVGV4dHVyZT4oZGF0YS5yZWFkU3Ryb25nQmluZGVyKCkpOwotICAgICAgICAgICAgcmVwbHktPndyaXRlSW50MzIoc2V0VmlkZW9TdXJmYWNlVGV4dHVyZShzdXJmYWNlVGV4dHVyZSkpOwotICAgICAgICAgICAgcmV0dXJuIE5PX0VSUk9SOwotICAgICAgICB9IGJyZWFrOwotICAgICAgICBjYXNlIFBSRVBBUkVfQVNZTkM6IHsKLSAgICAgICAgICAgIENIRUNLX0lOVEVSRkFDRShJTWVkaWFQbGF5ZXIsIGRhdGEsIHJlcGx5KTsKLSAgICAgICAgICAgIHJlcGx5LT53cml0ZUludDMyKHByZXBhcmVBc3luYygpKTsKLSAgICAgICAgICAgIHJldHVybiBOT19FUlJPUjsKLSAgICAgICAgfSBicmVhazsKLSAgICAgICAgY2FzZSBTVEFSVDogewotICAgICAgICAgICAgQ0hFQ0tfSU5URVJGQUNFKElNZWRpYVBsYXllciwgZGF0YSwgcmVwbHkpOwotICAgICAgICAgICAgcmVwbHktPndyaXRlSW50MzIoc3RhcnQoKSk7Ci0gICAgICAgICAgICByZXR1cm4gTk9fRVJST1I7Ci0gICAgICAgIH0gYnJlYWs7Ci0gICAgICAgIGNhc2UgU1RPUDogewotICAgICAgICAgICAgQ0hFQ0tfSU5URVJGQUNFKElNZWRpYVBsYXllciwgZGF0YSwgcmVwbHkpOwotICAgICAgICAgICAgcmVwbHktPndyaXRlSW50MzIoc3RvcCgpKTsKLSAgICAgICAgICAgIHJldHVybiBOT19FUlJPUjsKLSAgICAgICAgfSBicmVhazsKLSAgICAgICAgY2FzZSBJU19QTEFZSU5HOiB7Ci0gICAgICAgICAgICBDSEVDS19JTlRFUkZBQ0UoSU1lZGlhUGxheWVyLCBkYXRhLCByZXBseSk7Ci0gICAgICAgICAgICBib29sIHN0YXRlOwotICAgICAgICAgICAgc3RhdHVzX3QgcmV0ID0gaXNQbGF5aW5nKCZzdGF0ZSk7Ci0gICAgICAgICAgICByZXBseS0+d3JpdGVJbnQzMihzdGF0ZSk7Ci0gICAgICAgICAgICByZXBseS0+d3JpdGVJbnQzMihyZXQpOwotICAgICAgICAgICAgcmV0dXJuIE5PX0VSUk9SOwotICAgICAgICB9IGJyZWFrOwotICAgICAgICBjYXNlIFBBVVNFOiB7Ci0gICAgICAgICAgICBDSEVDS19JTlRFUkZBQ0UoSU1lZGlhUGxheWVyLCBkYXRhLCByZXBseSk7Ci0gICAgICAgICAgICByZXBseS0+d3JpdGVJbnQzMihwYXVzZSgpKTsKLSAgICAgICAgICAgIHJldHVybiBOT19FUlJPUjsKLSAgICAgICAgfSBicmVhazsKLSAgICAgICAgY2FzZSBTRUVLX1RPOiB7Ci0gICAgICAgICAgICBDSEVDS19JTlRFUkZBQ0UoSU1lZGlhUGxheWVyLCBkYXRhLCByZXBseSk7Ci0gICAgICAgICAgICByZXBseS0+d3JpdGVJbnQzMihzZWVrVG8oZGF0YS5yZWFkSW50MzIoKSkpOwotICAgICAgICAgICAgcmV0dXJuIE5PX0VSUk9SOwotICAgICAgICB9IGJyZWFrOwotICAgICAgICBjYXNlIEdFVF9DVVJSRU5UX1BPU0lUSU9OOiB7Ci0gICAgICAgICAgICBDSEVDS19JTlRFUkZBQ0UoSU1lZGlhUGxheWVyLCBkYXRhLCByZXBseSk7Ci0gICAgICAgICAgICBpbnQgbXNlYzsKLSAgICAgICAgICAgIHN0YXR1c190IHJldCA9IGdldEN1cnJlbnRQb3NpdGlvbigmbXNlYyk7Ci0gICAgICAgICAgICByZXBseS0+d3JpdGVJbnQzMihtc2VjKTsKLSAgICAgICAgICAgIHJlcGx5LT53cml0ZUludDMyKHJldCk7Ci0gICAgICAgICAgICByZXR1cm4gTk9fRVJST1I7Ci0gICAgICAgIH0gYnJlYWs7Ci0gICAgICAgIGNhc2UgR0VUX0RVUkFUSU9OOiB7Ci0gICAgICAgICAgICBDSEVDS19JTlRFUkZBQ0UoSU1lZGlhUGxheWVyLCBkYXRhLCByZXBseSk7Ci0gICAgICAgICAgICBpbnQgbXNlYzsKLSAgICAgICAgICAgIHN0YXR1c190IHJldCA9IGdldER1cmF0aW9uKCZtc2VjKTsKLSAgICAgICAgICAgIHJlcGx5LT53cml0ZUludDMyKG1zZWMpOwotICAgICAgICAgICAgcmVwbHktPndyaXRlSW50MzIocmV0KTsKLSAgICAgICAgICAgIHJldHVybiBOT19FUlJPUjsKLSAgICAgICAgfSBicmVhazsKLSAgICAgICAgY2FzZSBSRVNFVDogewotICAgICAgICAgICAgQ0hFQ0tfSU5URVJGQUNFKElNZWRpYVBsYXllciwgZGF0YSwgcmVwbHkpOwotICAgICAgICAgICAgcmVwbHktPndyaXRlSW50MzIocmVzZXQoKSk7Ci0gICAgICAgICAgICByZXR1cm4gTk9fRVJST1I7Ci0gICAgICAgIH0gYnJlYWs7Ci0gICAgICAgIGNhc2UgU0VUX0FVRElPX1NUUkVBTV9UWVBFOiB7Ci0gICAgICAgICAgICBDSEVDS19JTlRFUkZBQ0UoSU1lZGlhUGxheWVyLCBkYXRhLCByZXBseSk7Ci0gICAgICAgICAgICByZXBseS0+d3JpdGVJbnQzMihzZXRBdWRpb1N0cmVhbVR5cGUoKGF1ZGlvX3N0cmVhbV90eXBlX3QpIGRhdGEucmVhZEludDMyKCkpKTsKLSAgICAgICAgICAgIHJldHVybiBOT19FUlJPUjsKLSAgICAgICAgfSBicmVhazsKLSAgICAgICAgY2FzZSBTRVRfTE9PUElORzogewotICAgICAgICAgICAgQ0hFQ0tfSU5URVJGQUNFKElNZWRpYVBsYXllciwgZGF0YSwgcmVwbHkpOwotICAgICAgICAgICAgcmVwbHktPndyaXRlSW50MzIoc2V0TG9vcGluZyhkYXRhLnJlYWRJbnQzMigpKSk7Ci0gICAgICAgICAgICByZXR1cm4gTk9fRVJST1I7Ci0gICAgICAgIH0gYnJlYWs7Ci0gICAgICAgIGNhc2UgU0VUX1ZPTFVNRTogewotICAgICAgICAgICAgQ0hFQ0tfSU5URVJGQUNFKElNZWRpYVBsYXllciwgZGF0YSwgcmVwbHkpOwotICAgICAgICAgICAgZmxvYXQgbGVmdFZvbHVtZSA9IGRhdGEucmVhZEZsb2F0KCk7Ci0gICAgICAgICAgICBmbG9hdCByaWdodFZvbHVtZSA9IGRhdGEucmVhZEZsb2F0KCk7Ci0gICAgICAgICAgICByZXBseS0+d3JpdGVJbnQzMihzZXRWb2x1bWUobGVmdFZvbHVtZSwgcmlnaHRWb2x1bWUpKTsKLSAgICAgICAgICAgIHJldHVybiBOT19FUlJPUjsKLSAgICAgICAgfSBicmVhazsKLSAgICAgICAgY2FzZSBJTlZPS0U6IHsKLSAgICAgICAgICAgIENIRUNLX0lOVEVSRkFDRShJTWVkaWFQbGF5ZXIsIGRhdGEsIHJlcGx5KTsKLSAgICAgICAgICAgIHN0YXR1c190IHJlc3VsdCA9IGludm9rZShkYXRhLCByZXBseSk7Ci0gICAgICAgICAgICByZXR1cm4gcmVzdWx0OwotICAgICAgICB9IGJyZWFrOwotICAgICAgICBjYXNlIFNFVF9NRVRBREFUQV9GSUxURVI6IHsKLSAgICAgICAgICAgIENIRUNLX0lOVEVSRkFDRShJTWVkaWFQbGF5ZXIsIGRhdGEsIHJlcGx5KTsKLSAgICAgICAgICAgIHJlcGx5LT53cml0ZUludDMyKHNldE1ldGFkYXRhRmlsdGVyKGRhdGEpKTsKLSAgICAgICAgICAgIHJldHVybiBOT19FUlJPUjsKLSAgICAgICAgfSBicmVhazsKLSAgICAgICAgY2FzZSBHRVRfTUVUQURBVEE6IHsKLSAgICAgICAgICAgIENIRUNLX0lOVEVSRkFDRShJTWVkaWFQbGF5ZXIsIGRhdGEsIHJlcGx5KTsKLSAgICAgICAgICAgIGJvb2wgdXBkYXRlX29ubHkgPSBzdGF0aWNfY2FzdDxib29sPihkYXRhLnJlYWRJbnQzMigpKTsKLSAgICAgICAgICAgIGJvb2wgYXBwbHlfZmlsdGVyID0gc3RhdGljX2Nhc3Q8Ym9vbD4oZGF0YS5yZWFkSW50MzIoKSk7Ci0gICAgICAgICAgICBjb25zdCBzdGF0dXNfdCByZXRjb2RlID0gZ2V0TWV0YWRhdGEodXBkYXRlX29ubHksIGFwcGx5X2ZpbHRlciwgcmVwbHkpOwotICAgICAgICAgICAgcmVwbHktPnNldERhdGFQb3NpdGlvbigwKTsKLSAgICAgICAgICAgIHJlcGx5LT53cml0ZUludDMyKHJldGNvZGUpOwotICAgICAgICAgICAgcmVwbHktPnNldERhdGFQb3NpdGlvbigwKTsKLSAgICAgICAgICAgIHJldHVybiBOT19FUlJPUjsKLSAgICAgICAgfSBicmVhazsKLSAgICAgICAgY2FzZSBTRVRfQVVYX0VGRkVDVF9TRU5EX0xFVkVMOiB7Ci0gICAgICAgICAgICBDSEVDS19JTlRFUkZBQ0UoSU1lZGlhUGxheWVyLCBkYXRhLCByZXBseSk7Ci0gICAgICAgICAgICByZXBseS0+d3JpdGVJbnQzMihzZXRBdXhFZmZlY3RTZW5kTGV2ZWwoZGF0YS5yZWFkRmxvYXQoKSkpOwotICAgICAgICAgICAgcmV0dXJuIE5PX0VSUk9SOwotICAgICAgICB9IGJyZWFrOwotICAgICAgICBjYXNlIEFUVEFDSF9BVVhfRUZGRUNUOiB7Ci0gICAgICAgICAgICBDSEVDS19JTlRFUkZBQ0UoSU1lZGlhUGxheWVyLCBkYXRhLCByZXBseSk7Ci0gICAgICAgICAgICByZXBseS0+d3JpdGVJbnQzMihhdHRhY2hBdXhFZmZlY3QoZGF0YS5yZWFkSW50MzIoKSkpOwotICAgICAgICAgICAgcmV0dXJuIE5PX0VSUk9SOwotICAgICAgICB9IGJyZWFrOwotICAgICAgICBjYXNlIFNFVF9QQVJBTUVURVI6IHsKLSAgICAgICAgICAgIENIRUNLX0lOVEVSRkFDRShJTWVkaWFQbGF5ZXIsIGRhdGEsIHJlcGx5KTsKLSAgICAgICAgICAgIGludCBrZXkgPSBkYXRhLnJlYWRJbnQzMigpOwotCi0gICAgICAgICAgICBQYXJjZWwgcmVxdWVzdDsKLSAgICAgICAgICAgIGlmIChkYXRhLmRhdGFBdmFpbCgpID4gMCkgewotICAgICAgICAgICAgICAgIHJlcXVlc3QuYXBwZW5kRnJvbSgKLSAgICAgICAgICAgICAgICAgICAgICAgIGNvbnN0X2Nhc3Q8UGFyY2VsICo+KCZkYXRhKSwgZGF0YS5kYXRhUG9zaXRpb24oKSwgZGF0YS5kYXRhQXZhaWwoKSk7Ci0gICAgICAgICAgICB9Ci0gICAgICAgICAgICByZXF1ZXN0LnNldERhdGFQb3NpdGlvbigwKTsKLSAgICAgICAgICAgIHJlcGx5LT53cml0ZUludDMyKHNldFBhcmFtZXRlcihrZXksIHJlcXVlc3QpKTsKLSAgICAgICAgICAgIHJldHVybiBOT19FUlJPUjsKLSAgICAgICAgfSBicmVhazsKLSAgICAgICAgY2FzZSBHRVRfUEFSQU1FVEVSOiB7Ci0gICAgICAgICAgICBDSEVDS19JTlRFUkZBQ0UoSU1lZGlhUGxheWVyLCBkYXRhLCByZXBseSk7Ci0gICAgICAgICAgICByZXR1cm4gZ2V0UGFyYW1ldGVyKGRhdGEucmVhZEludDMyKCksIHJlcGx5KTsKLSAgICAgICAgfSBicmVhazsKLSAgICAgICAgY2FzZSBTRVRfUkVUUkFOU01JVF9FTkRQT0lOVDogewotICAgICAgICAgICAgQ0hFQ0tfSU5URVJGQUNFKElNZWRpYVBsYXllciwgZGF0YSwgcmVwbHkpOwotCi0gICAgICAgICAgICBzdHJ1Y3Qgc29ja2FkZHJfaW4gZW5kcG9pbnQ7Ci0gICAgICAgICAgICBpbnQgYW10ID0gZGF0YS5yZWFkSW50MzIoKTsKLSAgICAgICAgICAgIGlmIChhbXQgPT0gc2l6ZW9mKGVuZHBvaW50KSkgewotICAgICAgICAgICAgICAgIGRhdGEucmVhZCgmZW5kcG9pbnQsIHNpemVvZihzdHJ1Y3Qgc29ja2FkZHJfaW4pKTsKLSAgICAgICAgICAgICAgICByZXBseS0+d3JpdGVJbnQzMihzZXRSZXRyYW5zbWl0RW5kcG9pbnQoJmVuZHBvaW50KSk7Ci0gICAgICAgICAgICB9IGVsc2UgewotICAgICAgICAgICAgICAgIHJlcGx5LT53cml0ZUludDMyKHNldFJldHJhbnNtaXRFbmRwb2ludChOVUxMKSk7Ci0gICAgICAgICAgICB9Ci0gICAgICAgICAgICByZXR1cm4gTk9fRVJST1I7Ci0gICAgICAgIH0gYnJlYWs7Ci0gICAgICAgIGNhc2UgU0VUX05FWFRfUExBWUVSOiB7Ci0gICAgICAgICA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09ERV9VUkw6IHsKLSAgICAgICAgICAgIENIRUNLX0lOVEVSRkFDRShJTWVkaWFQbGF5ZXJTZXJ2aWNlLCBkYXRhLCByZXBseSk7Ci0gICAgICAgICAgICBjb25zdCBjaGFyKiB1cmwgPSBkYXRhLnJlYWRDU3RyaW5nKCk7Ci0gICAgICAgICAgICB1aW50MzJfdCBzYW1wbGVSYXRlOwotICAgICAgICAgICAgaW50IG51bUNoYW5uZWxzOwotICAgICAgICAgICAgYXVkaW9fZm9ybWF0X3QgZm9ybWF0OwotICAgICAgICAgICAgc3A8SU1lbW9yeT4gcGxheWVyID0gZGVjb2RlKHVybCwgJnNhbXBsZVJhdGUsICZudW1DaGFubmVscywgJmZvcm1hdCk7Ci0gICAgICAgICAgICByZXBseS0+d3JpdGVJbnQzMihzYW1wbGVSYXRlKTsKLSAgICAgICAgICAgIHJlcGx5LT53cml0ZUludDMyKG51bUNoYW5uZWxzKTsKLSAgICAgICAgICAgIHJlcGx5LT53cml0ZUludDMyKChpbnQzMl90KSBmb3JtYXQpOwotICAgICAgICAgICAgcmVwbHktPndyaXRlU3Ryb25nQmluZGVyKHBsYXllci0+YXNCaW5kZXIoKSk7Ci0gICAgICAgICAgICByZXR1cm4gTk9fRVJST1I7Ci0gICAgICAgIH0gYnJlYWs7Ci0gICAgICAgIGNhc2UgREVDT0RFX0ZEOiB7Ci0gICAgICAgICAgICBDSEVDS19JTlRFUkZBQ0UoSU1lZGlhUGxheWVyU2VydmljZSwgZGF0YSwgcmVwbHkpOwotICAgICAgICAgICAgaW50IGZkID0gZHVwKGRhdGEucmVhZEZpbGVEZXNjcmlwdG9yKCkpOwotICAgICAgICAgICAgaW50NjRfdCBvZmZzZXQgPSBkYXRhLnJlYWRJbnQ2NCgpOwotICAgICAgICAgICAgaW50NjRfdCBsZW5ndGggPSBkYXRhLnJlYWRJbnQ2NCgpOwotICAgICAgICAgICAgdWludDMyX3Qgc2FtcGxlUmF0ZTsKLSAgICAgICAgICAgIGludCBudW1DaGFubmVsczsKLSAgICAgICAgICAgIGF1ZGlvX2Zvcm1hdF90IGZvcm1hdDsKLSAgICAgICAgICAgIHNwPElNZW1vcnk+IHBsYXllciA9IGRlY29kZShmZCwgb2Zmc2V0LCBsZW5ndGgsICZzYW1wbGVSYXRlLCAmbnVtQ2hhbm5lbHMsICZmb3JtYXQpOwotICAgICAgICAgICAgcmVwbHktPndyaXRlSW50MzIoc2FtcGxlUmF0ZSk7Ci0gICAgICAgICAgICByZXBseS0+d3JpdGVJbnQzMihudW1DaGFubmVscyk7Ci0gICAgICAgICAgICByZXBseS0+d3JpdGVJbnQzMigoaW50MzJfdCkgZm9ybWF0KTsKLSAgICAgICAgICAgIHJlcGx5LT53cml0ZVN0cm9uZ0JpbmRlcihwbGF5ZXItPmFzQmluZGVyKCkpOwotICAgICAgICAgICAgcmV0dXJuIE5PX0VSUk9SOwotICAgICAgICB9IGJyZWFrOwotICAgICAgICBjYXNlIENSRUFURV9NRURJQV9SRUNPUkRFUjogewotICAgICAgICAgICAgQ0hFQ0tfSU5URVJGQUNFKElNZWRpYVBsYXllclNlcnZpY2UsIGRhdGEsIHJlcGx5KTsKLSAgICAgICAgICAgIHBpZF90IHBpZCA9IGRhdGEucmVhZEludDMyKCk7Ci0gICAgICAgICAgICBzcDxJTWVkaWFSZWNvcmRlcj4gcmVjb3JkZXIgPSBjcmVhdGVNZWRpYVJlY29yZGVyKHBpZCk7Ci0gICAgICAgICAgICByZXBseS0+d3JpdGVTdHJvbmdCaW5kZXIocmVjb3JkZXItPmFzQmluZGVyKCkpOwotICAgICAgICAgICAgcmV0dXJuIE5PX0VSUk9SOwotICAgICAgICB9IGJyZWFrOwotICAgICAgICBjYXNlIENSRUFURV9NRVRBREFUQV9SRVRSSUVWRVI6IHsKLSAgICAgICAgICAgIENIRUNLX0lOVEVSRkFDRShJTWVkaWFQbGF5ZXJTZXJ2aWNlLCBkYXRhLCByZXBseSk7Ci0gICAgICAgICAgICBwaWRfdCBwaWQgPSBkYXRhLnJlYWRJbnQzMigpOwotICAgICAgICAgICAgc3A8SU1lZGlhTWV0YWRhdGFSZXRyaWV2ZXI+IHJldHJpZXZlciA9IGNyZWF0ZU1ldGFkYXRhUmV0cmlldmVyKHBpZCk7Ci0gICAgICAgICAgICByZXBseS0+d3JpdGVTdHJvbmdCaW5kZXIocmV0cmlldmVyLT5hc0JpbmRlcigpKTsKLSAgICAgICAgICAgIHJldHVybiBOT19FUlJPUjsKLSAgICAgICAgfSBicmVhazsKLSAgICAgICAgY2FzZSBHRVRfT01YOiB7Ci0gICAgICAgICAgICBDSEVDS19JTlRFUkZBQ0UoSU1lZGlhUGxheWVyU2VydmljZSwgZGF0YSwgcmVwbHkpOwotICAgICAgICAgICAgc3A8SU9NWD4gb214ID0gZ2V0T01YKCk7Ci0gICAgICAgICAgICByZXBseS0+d3JpdGVTdHJvbmdCaW5kZXIob214LT5hc0JpbmRlcigpKTsKLSAgICAgICAgICAgIHJldHVybiBOT19FUlJPUjsKLSAgICAgICAgfSBicmVhazsKLSAgICAgICAgY2FzZSBNQUtFX0NSWVBUTzogewotICAgICAgICAgICAgQ0hFQ0tfSU5URVJGQUNFKElNZWRpYVBsYXllclNlcnZpY2UsIGRhdGEsIHJlcGx5KTsKLSAgICAgICAgICAgIHNwPElDcnlwdG8+IGNyeXB0byA9IG1ha2VDcnlwdG8oKTsKLSAgICAgICAgICAgIHJlcGx5LT53cml0ZVN0cm9uZ0JpbmRlcihjcnlwdG8tPmFzQmluZGVyKCkpOwotICAgICAgICAgICAgcmV0dXJuIE5PX0VSUk9SOwotICAgICAgICB9IGJyZWFrOwotICAgICAgICBjYXNlIEFERF9CQVRURVJZX0RBVEE6IHsKLSAgICAgICAgICAgIENIRUNLX0lOVEVSRkFDRShJTWVkaWFQbGF5ZXJTZXJ2aWNlLCBkYXRhLCByZXBseSk7Ci0gICAgICAgICAgICB1aW50MzJfdCBwYXJhbXMgPSBkYXRhLnJlYWRJbnQzMigpOwotICAgICAgICAgICAgYWRkQmF0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2VsKiByZXBseSwgdWludDMyX3QgZmxhZ3MpCi17Ci0gICAgc3dpdGNoIChjb2RlKSB7Ci0gICAgICAgIGNhc2UgUkVMRUFTRTogewotICAgICAgICAgICAgQUxPR1YoIlJFTEVBU0UiKTsKLSAgICAgICAgICAgIENIRUNLX0lOVEVSRkFDRShJTWVkaWFSZWNvcmRlciwgZGF0YSwgcmVwbHkpOwotICAgICAgICAgICAgcmVwbHktPndyaXRlSW50MzIocmVsZWFzZSgpKTsKLSAgICAgICAgICAgIHJldHVybiBOT19FUlJPUjsKLSAgICAgICAgfSBicmVhazsKLSAgICAgICAgY2FzZSBJTklUOiB7Ci0gICAgICAgICAgICBBTE9HVigiSU5JVCIpOwotICAgICAgICAgICAgQ0hFQ0tfSU5URVJGQUNFKElNZWRpYVJlY29yZGVyLCBkYXRhLCByZXBseSk7Ci0gICAgICAgICAgICByZXBseS0+d3JpdGVJbnQzMihpbml0KCkpOwotICAgICAgICAgICAgcmV0dXJuIE5PX0VSUk9SOwotICAgICAgICB9IGJyZWFrOwotICAgICAgICBjYXNlIENMT1NFOiB7Ci0gICAgICAgICAgICBBTE9HVigiQ0xPU0UiKTsKLSAgICAgICAgICAgIENIRUNLX0lOVEVSRkFDRShJTWVkaWFSZWNvcmRlciwgZGF0YSwgcmVwbHkpOwotICAgICAgICAgICAgcmVwbHktPndyaXRlSW50MzIoY2xvc2UoKSk7Ci0gICAgICAgICAgICByZXR1cm4gTk9fRVJST1I7Ci0gICAgICAgIH0gYnJlYWs7Ci0gICAgICAgIGNhc2UgUkVTRVQ6IHsKLSAgICAgICAgICAgIEFMT0dWKCJSRVNFVCIpOwotICAgICAgICAgICAgQ0hFQ0tfSU5URVJGQUNFKElNZWRpYVJlY29yZGVyLCBkYXRhLCByZXBseSk7Ci0gICAgICAgICAgICByZXBseS0+d3JpdGVJbnQzMihyZXNldCgpKTsKLSAgICAgICAgICAgIHJldHVybiBOT19FUlJPUjsKLSAgICAgICAgfSBicmVhazsKLSAgICAgICAgY2FzZSBTVE9QOiB7Ci0gICAgICAgICAgICBBTE9HVigiU1RPUCIpOwotICAgICAgICAgICAgQ0hFQ0tfSU5URVJGQUNFKElNZWRpYVJlY29yZGVyLCBkYXRhLCByZXBseSk7Ci0gICAgICAgICAgICByZXBseS0+d3JpdGVJbnQzMihzdG9wKCkpOwotICAgICAgICAgICAgcmV0dXJuIE5PX0VSUk9SOwotICAgICAgICB9IGJyZWFrOwotICAgICAgICBjYXNlIFNUQVJUOiB7Ci0gICAgICAgICAgICBBTE9HVigiU1RBUlQiKTsKLSAgICAgICAgICAgIENIRUNLX0lOVEVSRkFDRShJTWVkaWFSZWNvcmRlciwgZGF0YSwgcmVwbHkpOwotICAgICAgICAgICAgcmVwbHktPndyaXRlSW50MzIoc3RhcnQoKSk7Ci0gICAgICAgICAgICByZXR1cm4gTk9fRVJST1I7Ci0gICAgICAgIH0gYnJlYWs7Ci0gICAgICAgIGNhc2UgUFJFUEFSRTogewotICAgICAgICAgICAgQUxPR1YoIlBSRVBBUkUiKTsKLSAgICAgICAgICAgIENIRUNLX0lOVEVSRkFDRShJTWVkaWFSZWNvcmRlciwgZGF0YSwgcmVwbHkpOwotICAgICAgICAgICAgcmVwbHktPndyaXRlSW50MzIocHJlcGFyZSgpKTsKLSAgICAgICAgICAgIHJldHVybiBOT19FUlJPUjsKLSAgICAgICAgfSBicmVhazsKLSAgICAgICAgY2FzZSBHRVRfTUFYX0FNUExJVFVERTogewotICAgICAgICAgICAgQUxPR1YoIkdFVF9NQVhfQU1QTElUVURFIik7Ci0gICAgICAgICAgICBDSEVDS19JTlRFUkZBQ0UoSU1lZGlhUmVjb3JkZXIsIGRhdGEsIHJlcGx5KTsKLSAgICAgICAgICAgIGludCBtYXggPSAwOwotICAgICAgICAgICAgc3RhdHVzX3QgcmV0ID0gZ2V0TWF4QW1wbGl0dWRlKCZtYXgpOwotICAgICAgICAgICAgcmVwbHktPndyaXRlSW50MzIobWF4KTsKLSAgICAgICAgICAgIHJlcGx5LT53cml0ZUludDMyKHJldCk7Ci0gICAgICAgICAgICByZXR1cm4gTk9fRVJST1I7Ci0gICAgICAgIH0gYnJlYWs7Ci0gICAgICAgIGNhc2UgU0VUX1ZJREVPX1NPVVJDRTogewotICAgICAgICAgICAgQUxPR1YoIlNFVF9WSURFT19TT1VSQ0UiKTsKLSAgICAgICAgICAgIENIRUNLX0lOVEVSRkFDRShJTWVkaWFSZWNvcmRlciwgZGF0YSwgcmVwbHkpOwotICAgICAgICAgICAgaW50IHZzID0gZGF0YS5yZWFkSW50MzIoKTsKLSAgICAgICAgICAgIHJlcGx5LT53cml0ZUludDMyKHNldFZpZGVvU291cmNlKHZzKSk7Ci0gICAgICAgICAgICByZXR1cm4gTk9fRVJST1I7Ci0gICAgICAgIH0gYnJlYWs7Ci0gICAgICAgIGNhc2UgU0VUX0FVRElPX1NPVVJDRTogewotICAgICAgICAgICAgQUxPR1YoIlNFVF9BVURJT19TT1VSQ0UiKTsKLSAgICAgICAgICAgIENIRUNLX0lOVEVSRkFDRShJTWVkaWFSZWNvcmRlciwgZGF0YSwgcmVwbHkpOwotICAgICAgICAgICAgaW50IGFzID0gZGF0YS5yZWFkSW50MzIoKTsKLSAgICAgICAgICAgIHJlcGx5LT53cml0ZUludDMyKHNldEF1ZGlvU291cmNlKGFzKSk7Ci0gICAgICAgICAgICByZXR1cm4gTk9fRVJST1I7Ci0gICAgICAgIH0gYnJlYWs7Ci0gICAgICAgIGNhc2UgU0VUX09VVFBVVF9GT1JNQVQ6IHsKLSAgICAgICAgICAgIEFMT0dWKCJTRVRfT1VUUFVUX0ZPUk1BVCIpOwotICAgICAgICAgICAgQ0hFQ0tfSU5URVJGQUNFKElNZWRpYVJlY29yZGVyLCBkYXRhLCByZXBseSk7Ci0gICAgICAgICAgICBpbnQgb2YgPSBkYXRhLnJlYWRJbnQzMigpOwotICAgICAgICAgICAgcmVwbHktPndyaXRlSW50MzIoc2V0T3V0cHV0Rm9ybWF0KG9mKSk7Ci0gICAgICAgICAgIC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AgICAgICAgICAgIHJldHVybiBOT19FUlJPUjsKLSAgICAgICAgfSBicmVhazsKLSAgICAgICAgY2FzZSBTRVRfT1VUUFVUX0ZJTEVfRkQ6IHsKLSAgICAgICAgICAgIEFMT0dWKCJTRVRfT1VUUFVUX0ZJTEVfRkQiKTsKLSAgICAgICAgICAgIENIRUNLX0lOVEVSRkFDRShJTWVkaWFSZWNvcmRlciwgZGF0YSwgcmVwbHkpOwotICAgICAgICAgICAgaW50IGZkID0gZHVwKGRhdGEucmVhZEZpbGVEZXNjcmlwdG9yKCkpOwotICAgICAgICAgICAgaW50NjRfdCBvZmZzZXQgPSBkYXRhLnJlYWRJbnQ2NCgpOwotICAgICAgICAgICAgaW50NjRfdCBsZW5ndGggPSBkYXRhLnJlYWRJbnQ2NCgpOwotICAgICAgICAgICAgcmVwbHktPndyaXRlSW50MzIoc2V0T3V0cHV0RmlsZShmZCwgb2Zmc2V0LCBsZW5ndGgpKTsKLSAgICAgICAgICAgIDo6Y2xvc2UoZmQpOwotICAgICAgICAgICAgcmV0dXJuIE5PX0VSUk9SOwotICAgICAgICB9IGJyZWFrOwotICAgICAgICBjYXNlIFNFVF9WSURFT19TSVpFOiB7Ci0gICAgICAgICAgICBBTE9HVigiU0VUX1ZJREVPX1NJWkUiKTsKLSAgICAgICAgICAgIENIRUNLX0lOVEVSRkFDRShJTWVkaWFSZWNvcmRlciwgZGF0YSwgcmVwbHkpOwotICAgICAgICAgICAgaW50IHdpZHRoID0gZGF0YS5yZWFkSW50MzIoKTsKLSAgICAgICAgICAgIGludCBoZWlnaHQgPSBkYXRhLnJlYWRJbnQzMigpOwotICAgICAgICAgICAgcmVwbHktPndyaXRlSW50MzIoc2V0VmlkZW9TaXplKHdpZHRoLCBoZWlnaHQpKTsKLSAgICAgICAgICAgIHJldHVybiBOT19FUlJPUjsKLSAgICAgICAgfSBicmVhazsKLSAgICAgICAgY2FzZSBTRVRfVklERU9fRlJBTUVSQVRFOiB7Ci0gICAgICAgICAgICBBTE9HVigiU0VUX1ZJREVPX0ZSQU1FUkFURSIpOwotICAgICAgICAgICAgQ0hFQ0tfSU5URVJGQUNFKElNZWRpYVJlY29yZGVyLCBkYXRhLCByZXBseSk7Ci0gICAgICAgICAgICBpbnQgZnJhbWVzX3Blcl9zZWNvbmQgPSBkYXRhLnJlYWRJbnQzMigpOwotICAgICAgICAgICAgcmVwbHktPndyaXRlSW50MzIoc2V0VmlkZW9GcmFtZVJhdGUoZnJhbWVzX3Blcl9zZWNvbmQpKTsKLSAgICAgICAgICAgIHJldHVybiBOT19FUlJPUjsKLSAgICAgICAgfSBicmVhazsKLSAgICAgICAgY2FzZSBTRVRfUEFSQU1FVEVSUzogewotICAgICAgICAgICAgQUxPR1YoIlNFVF9QQVJBTUVURVIiKTsKLSAgICAgICAgICAgIENIRUNLX0lOVEVSRkFDRShJTWVkaWFSZWNvcmRlciwgZGF0YSwgcmVwbHkpOwotICAgICAgICAgICAgcmVwbHktPndyaXRlSW50MzIoc2V0UGFyYW1ldGVycyhkYXRhLnJlYWRTdHJpbmc4KCkpKTsKLSAgICAgICAgICAgIHJldHVybiBOT19FUlJPUjsKLSAgICAgICAgfSBicmVhazsKLSAgICAgICAgY2FzZSBTRVRfTElTVEVORVI6IHsKLSAgICAgICAgICAgIEFMT0dWKCJTRVRfTElTVEVORVIiKTsKLSAgICAgICAgICAgIENIRUNLX0lOVEVSRkFDRShJTWVkaWFSZWNvcmRlciwgZGF0YSwgcmVwbHkpOwotICAgICAgICAgICAgc3A8SU1lZGlhUmVjb3JkZXJDbGllbnQ+IGxpc3RlbmVyID0KLSAgICAgICAgICAgICAgICBpbnRlcmZhY2VfY2FzdDxJTWVkaWFSZWNvcmRlckNsaWVudD4oZGF0YS5yZWFkU3Ryb25nQmluZGVyKCkpOwotICAgICAgICAgICAgcmVwbHktPndyaXRlSW50MzIoc2V0TGlzdGVuZXIobGlzdGVuZXIpKTsKLSAgICAgICAgICAgIHJldHVybiBOT19FUlJPUjsKLSAgICAgICAgfS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yIChpbnQzMl90IGogPSAwOyBqIDwgbnVtUm9sZXM7ICsraikgewotICAgICAgICAgICAgICAgIGluZm8ubVJvbGVzLnB1c2hfYmFjayhyZXBseS5yZWFkU3RyaW5nOCgpKTsKLSAgICAgICAgICAgIH0KLSAgICAgICAgfQotCi0gICAgICAgIHJldHVybiBPSzsKLSAgICB9Ci0KLSAgICB2aXJ0dWFsIHN0YXR1c190IGFsbG9jYXRlTm9kZSgKLSAgICAgICAgICAgIGNvbnN0IGNoYXIgKm5hbWUsIGNvbnN0IHNwPElPTVhPYnNlcnZlcj4gJm9ic2VydmVyLCBub2RlX2lkICpub2RlKSB7Ci0gICAgICAgIFBhcmNlbCBkYXRhLCByZXBseTsKLSAgICAgICAgZGF0YS53cml0ZUludGVyZmFjZVRva2VuKElPTVg6OmdldEludGVyZmFjZURlc2NyaXB0b3IoKSk7Ci0gICAgICAgIGRhdGEud3JpdGVDU3RyaW5nKG5hbWUpOwotICAgICAgICBkYXRhLndyaXRlU3Ryb25nQmluZGVyKG9ic2VydmVyLT5hc0JpbmRlcigpKTsKLSAgICAgICAgcmVtb3RlKCktPnRyYW5zYWN0KEFMTE9DQVRFX05PREUsIGRhdGEsICZyZXBseSk7Ci0KLSAgICAgICAgc3RhdHVzX3QgZXJyID0gcmVwbHkucmVhZEludDMyKCk7Ci0gICAgICAgIGlmIChlcnIgPT0gT0spIHsKLSAgICAgICAgICAgICpub2RlID0gKHZvaWQqKXJlcGx5LnJlYWRJbnRQdHIoKTsKLSAgICAgICAgfSBlbHNlIHsKLSAgICAgICAgICAgICpub2RlID0gMDsKLSAgICAgICAgfQotCi0gICAgICAgIHJldHVybiBlcnI7Ci0gICAgfQotCi0gICAgdmlydHVhbCBzdGF0dXNfdCBmcmVlTm9kZShub2RlX2lkIG5vZGUpIHsKLSAgICAgICAgUGFyY2VsIGRhdGEsIHJlcGx5OwotICAgICAgICBkYXRhLndyaXRlSW50ZXJmYWNlVG9rZW4oSU9NWDo6Z2V0SW50ZXJmY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AgIGRhdGEud3JpdGVJbnQzMihpbmRleCk7Ci0gICAgICAgIGRhdGEud3JpdGVJbnQzMihzaXplKTsKLSAgICAgICAgZGF0YS53cml0ZShwYXJhbXMsIHNpemUpOwotICAgICAgICByZW1vdGUoKS0+dHJhbnNhY3QoR0VUX1BBUkFNRVRFUiwgZGF0YSwgJnJlcGx5KTsKLQotICAgICAgICBzdGF0dXNfdCBlcnIgPSByZXBseS5yZWFkSW50MzIoKTsKLSAgICAgICAgaWYgKGVyciAhPSBPSykgewotICAgICAgICAgICAgcmV0dXJuIGVycjsKLSAgICAgICAgfQotCi0gICAgICAgIHJlcGx5LnJlYWQocGFyYW1zLCBzaXplKTsKLQotICAgICAgICByZXR1cm4gT0s7Ci0gICAgfQotCi0gICAgdmlydHVhbCBzdGF0dXNfdCBzZXRQYXJhbWV0ZXIoCi0gICAgICAgICAgICBub2RlX2lkIG5vZGUsIE9NWF9JTkRFWFRZUEUgaW5kZXgsCi0gICAgICAgICAgICBjb25zdCB2b2lkICpwYXJhbXMsIHNpemVfdCBzaXplKSB7Ci0gICAgICAgIFBhcmNlbCBkYXRhLCByZXBseTsKLSAgICAgICAgZGF0YS53cml0ZUludGVyZmFjZVRva2VuKElPTVg6OmdldEludGVyZmFjZURlc2NyaXB0b3IoKSk7Ci0gICAgICAgIGRhdGEud3JpdGVJbnRQdHIoKGludHB0cl90KW5vZGUpOwotICAgICAgICBkYXRhLndyaXRlSW50MzIoaW5kZXgpOwotICAgICAgICBkYXRhLndyaXRlSW50MzIoc2l6ZSk7Ci0gICAgICAgIGRhdGEud3JpdGUocGFyYW1zLCBzaXplKTsKLSAgICAgICAgcmVtb3RlKCktPnRyYW5zYWN0KFNFVF9QQVJBTUVURVIsIGRhdGEsICZyZXBseSk7Ci0KLSAgICAgICAgcmV0dXJuIHJlcGx5LnJlYWRJbnQzMigpOwotICAgIH0KLQotICAgIHZpcnR1YWwgc3RhdHVzX3QgZ2V0Q29uZmlnKAotICAgICAgICAgICAgbm9kZV9pZCBub2RlLCBPTVhfSU5ERVhUWVBFIGluZGV4LAotICAgICAgICAgICAgdm9pZCAqcGFyYW1zLCBzaXplX3Qgc2l6ZSkgewotICAgICAgICBQYXJjZWwgZGF0YSwgcmVwbHk7Ci0gICAgICAgIGRhdGEud3JpdGVJbnRlcmZhY2VUb2tlbihJT01YOjpnZXRJbnRlcmZhY2VEZXNjcmlwdG9yKCkpOwotICAgICAgICBkYXRhLndyaXRlSW50UHRyKChpbnRwdHJfdClub2RlKTsKLSAgICAgICAgZGF0YS53cml0ZUludDMyKGluZGV4KTsKLSAgICAgICAgZGF0YS53cml0ZUludDMyKHNpemUpOwotICAgICAgICBkYXRhLndyaXRlKHBhcmFtcywgc2l6ZSk7Ci0gICAgICAgIHJlbW90ZSgpLT50cmFuc2FjdChHRVRfQ09ORklHLCBkYXRhLCAmcmVwbHkpOwotCi0gICAgICAgIHN0YXR1c190IGVyciA9IHJlcGx5LnJlYWRJbnQzMigpOwotICAgICAgICBpZiAoZXJyICE9IE9LKSB7Ci0gICAgICAgICAgICByZXR1cm4gZXJyOwotICAgICAgICB9Ci0KLSAgICAgICAgcmVwbHkucmVhZChwYXJhbXMsIHNpemUpOwotCi0gICAgICAgIHJldHVybiBPSzsKLSAgICB9Ci0KLSAgICB2aXJ0dWFsIHN0YXR1c190IHNldENvbmZpZygKLSAgICAgICAgICAgIG5vZGVfaWQgbm9kZSwgT01YX0lOREVYVFlQRSBpbmRleCwKLSAgICAgICAgICAgIGNvbnN0IHZvaWQgKnBhcmFtcywgc2l6ZV90IHNpemUpIHsKLSAgICAgICAgUGFyY2VsIGRhdGEsIHJlcGx5OwotICAgICAgICBkYXRhLndyaXRlSW50ZXJmYWNlVG9rZW4oSU9NWDo6Z2V0SW50ZXJmYWNlRGVzY3JpcHRvcigpKTsKLSAgICAgICAgZGF0YS53cml0ZUludFB0cigoaW50cHRyX3Qpbm9kZSk7Ci0gICAgICAgIGRhdGEud3JpdGVJbnQzMihpbmRleCk7Ci0gICAgIC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IHNpemUsCi0gICAgICAgICAgICBidWZmZXJfaWQgKmJ1ZmZlciwgdm9pZCAqKmJ1ZmZlcl9kYXRhKSB7Ci0gICAgICAgIFBhcmNlbCBkYXRhLCByZXBseTsKLSAgICAgICAgZGF0YS53cml0ZUludGVyZmFjZVRva2VuKElPTVg6OmdldEludGVyZmFjZURlc2NyaXB0b3IoKSk7Ci0gICAgICAgIGRhdGEud3JpdGVJbnRQdHIoKGludHB0cl90KW5vZGUpOwotICAgICAgICBkYXRhLndyaXRlSW50MzIocG9ydF9pbmRleCk7Ci0gICAgICAgIGRhdGEud3JpdGVJbnQzMihzaXplKTsKLSAgICAgICAgcmVtb3RlKCktPnRyYW5zYWN0KEFMTE9DX0JVRkZFUiwgZGF0YSwgJnJlcGx5KTsKLQotICAgICAgICBzdGF0dXNfdCBlcnIgPSByZXBseS5yZWFkSW50MzIoKTsKLSAgICAgICAgaWYgKGVyciAhPSBPSykgewotICAgICAgICAgICAgKmJ1ZmZlciA9IDA7Ci0KLSAgICAgICAgICAgIHJldHVybiBlcnI7Ci0gICAgICAgIH0KLQotICAgICAgICAqYnVmZmVyID0gKHZvaWQgKilyZXBseS5yZWFkSW50UHRyKCk7Ci0gICAgICAgICpidWZmZXJfZGF0YSA9ICh2b2lkICopcmVwbHkucmVhZEludFB0cigpOwotCi0gICAgICAgIHJldHVybiBlcnI7Ci0gICAgfQotCi0gICAgdmlydHVhbCBzdGF0dXNfdCBhbGxvY2F0ZUJ1ZmZlcldpdGhCYWNrdXAoCi0gICAgICAgICAgICBub2RlX2lkIG5vZGUsIE9NWF9VMzIgcG9ydF9pbmRleCwgY29uc3Qgc3A8SU1lbW9yeT4gJnBhcmFtcywKLSAgICAgICAgICAgIGJ1ZmZlcl9pZCAqYnVmZmVyKSB7Ci0gICAgICAgIFBhcmNlbCBkYXRhLCByZXBseTsKLSAgICAgICAgZGF0YS53cml0ZUludGVyZmFjZVRva2VuKElPTVg6OmdldEludGVyZmFjZURlc2NyaXB0b3IoKSk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SAgICAgICAgICAgIENIRUNLX0lOVEVSRkFDRShJT01YLCBkYXRhLCByZXBseSk7Ci0KLSAgICAgICAgICAgIExpc3Q8Q29tcG9uZW50SW5mbz4gbGlzdDsKLSAgICAgICAgICAgIGxpc3ROb2RlcygmbGlzdCk7Ci0KLSAgICAgICAgICAgIHJlcGx5LT53cml0ZUludDMyKGxpc3Quc2l6ZSgpKTsKLSAgICAgICAgICAgIGZvciAoTGlzdDxDb21wb25lbnRJbmZvPjo6aXRlcmF0b3IgaXQgPSBsaXN0LmJlZ2luKCk7Ci0gICAgICAgICAgICAgICAgIGl0ICE9IGxpc3QuZW5kKCk7ICsraXQpIHsKLSAgICAgICAgICAgICAgICBDb21wb25lbnRJbmZvICZjdXIgPSAqaXQ7Ci0KLSAgICAgICAgICAgICAgICByZXBseS0+d3JpdGVTdHJpbmc4KGN1ci5tTmFtZSk7Ci0gICAgICAgICAgICAgICAgcmVwbHktPndyaXRlSW50MzIoY3VyLm1Sb2xlcy5zaXplKCkpOwotICAgICAgICAgICAgICAgIGZvciAoTGlzdDxTdHJpbmc4Pjo6aXRlcmF0b3Igcm9sZV9pdCA9IGN1ci5tUm9sZXMuYmVnaW4oKTsKLSAgICAgICAgICAgICAgICAgICAgIHJvbGVfaXQgIT0gY3VyLm1Sb2xlcy5lbmQoKTsgKytyb2xlX2l0KSB7Ci0gICAgICAgICAgICAgICAgICAgIHJlcGx5LT53cml0ZVN0cmluZzgoKnJvbGVfaXQpOwotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgcmV0dXJuIE5PX0VSUk9SOwotICAgICAgICB9Ci0KLSAgICAgICAgY2FzZSBBTExPQ0FURV9OT0RFOgotICAgICAgICB7Ci0gICAgICAgICAgICBDSEVDS19JTlRFUkZBQ0UoSU9NWCwgZGF0YSwgcmVwbHkpOwotCi0gICAgICAgICAgICBjb25zdCBjaGFyICpuYW1lID0gZGF0YS5yZWFkQ1N0cmluZygpOwotCi0gICAgICAgICAgICBzcDxJT01YT2JzZXJ2ZXI+IG9ic2VydmVyID0KLSAgICAgICAgICAgICAgICBpbnRlcmZhY2VfY2FzdDxJT01YT2JzZXJ2ZXI+KGRhdGEucmVhZFN0cm9uZ0JpbmRlcigpKTsKLQotICAgICAgICAgICAgbm9kZV9pZCBub2RlOwotCi0gICAgICAgICAgICBzdGF0dXNfdCBlcnIgPSBhbGxvY2F0ZU5vZGUobmFtZSwgb2JzZXJ2ZXIsICZub2RlKTsKLSAgICAgICAgICAgIHJlcGx5LT53cml0ZUludDMyKGVycik7Ci0gICAgICAgICAgICBpZiAoZXJyID09IE9LKSB7Ci0gICAgICAgICAgICAgICAgcmVwbHktPndyaXRlSW50UHRyKChpbnRwdHJfdClub2RlKTsKLSAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgcmV0dXJuIE5PX0VSUk9SOwotICAgICAgICB9Ci0KLSAgICAgICAgY2FzZSBGUkVFX05PREU6Ci0gICAgICAgIHsKLSAgICAgICAgICAgIENIRUNLX0lOVEVSRkFDRShJT01YLCBkYXRhLCByZXBseSk7Ci0KLSAgICAgICAgICAgIG5vZGVfaWQgbm9kZSA9ICh2b2lkKilkYXRhLnJlYWRJbnRQdHIoKTsKLQotICAgICAgICAgICAgcmVwbHktPndyaXRlSW50MzIoZnJlZU5vZGUobm9kZSkpOwotCi0gICAgICAgICAgICByZXR1cm4gTk9fRVJST1I7Ci0gICAgICAgIH0KLQotICAgICAgICBjYXNlIFNFTkRfQ09NTUFORDoKLSAgICAgICAgewotICAgICAgICAgICAgQ0hFQ0tfSU5URVJGQUNFKElPTVgsIGRhdGEsIHJlcGx5KTsKLQotICAgICAgICAgICAgbm9kZV9pZCBub2RlID0gKHZvaWQqKWRhdGEucmVhZEludFB0cigpOwotCi0gICAgICAgICAgICBPTVhfQ09NTUFORFRZUEUgY21kID0KLSAgICAgICAgICAgICAgICBzdGF0aWNfY2FzdDxPTVhfQ09NTUFORFRZUEU+KGRhdGEucmVhZEludDMyKCkpOwotCi0gICAgICAgICAgICBPTVhfUzMyIHBhcmFtID0gZGF0YS5yZWFkSW50MzIoKTsKLSAgICAgICAgICAgIHJlcGx5LT53cml0ZUludDMyKHNlbmRDb21tYW5kKG5vZGUsIGNtZCwgcGFyYW0pKTsKLQotICAgICAgICAgICAgcmV0dXJuIE5PX0VSUk9SOwotICAgICAgICB9Ci0KLSAgICAgICAgY2FzZSBHRVRfUEFSQU1FVEVSOgotICAgICAgICBjYXNlIFNFVF9QQVJBTUVURVI6Ci0gICAgICAgIGNhc2UgR0VUX0NPTkZJRzoKLSAgICAgICAgY2FzZSBTRVRfQ09ORklHOgotICAgICAgICB7Ci0gICAgICAgICAgICBDSEVDS19JTlRFUkZBQ0UoSU9NWCwgZGF0YSwgcmVwbHkpOwotCi0gICAgICAgICAgICBub2RlX2lkIG5vZGUgPSAodm9pZCopZGF0YS5yZWFkSW50UHRyKCk7Ci0gICAgICAgICAgICBPTVhfSU5ERVhUWVBFIGluZGV4ID0gc3RhdGljX2Nhc3Q8T01YX0lOREVYVFlQRT4oZGF0YS5yZWFkSW50MzIoKSk7Ci0KLSAgICAgICAgICAgIHNpemVfdCBzaXplID0gZGF0YS5yZWFkSW50MzIoKTsKLQotICAgICAgICAgICAgdm9pZCAqcGFyYW1zID0gbWFsbG9jKHNpemUpOwotICAgICAgICAgICAgZGF0YS5yZWFkKHBhcmFtcywgc2l6ZSk7Ci0KLSAgICAgICAgICAgIHN0YXR1c190IGVycjsKLSAgICAgICAgICAgIHN3aXRjaCAoY29kZSkgewotICAgICAgICAgICAgICAgIGNhc2UgR0VUX1BBUkFNRVRFUjoKLSAgICAgICAgICAgICAgICAgICAgZXJyID0gZ2V0UGFyYW1ldGVyKG5vZGUsIGluZGV4LCBwYXJhbXMsIHNpemUpOwotICAgICAgICAgICAgICAgICAgICBicmVhazsKLSAgICAgICAgICAgICAgICBjYXNlIFNFVF9QQVJBTUVURVI6Ci0gICAgICAgICAgICAgICAgICAgIGVyciA9IHNldFBhcmFtZXRlcihub2RlLCBpbmRleCwgcGFyYW1zLCBzaXplKTsKLSAgICAgICAgICAgICAgICAgICAgYnJlYWs7Ci0gICAgICAgICAgICAgICAgY2FzZSBHRVRfQ09ORklHOgotICAgICAgICAgICAgICAgICAgICBlcnIgPSBnZXRDb25maWcobm9kZSwgaW5kZXgsIHBhcmFtcywgc2l6ZSk7Ci0gICAgICAgICAgICAgICAgICAgIGJyZWFrOwotICAgICAgICAgICAgICAgIGNhc2UgU0VUX0NPTkZJRzoKLSAgICAgICAgICAgICAgICAgICAgZXJyID0gc2V0Q29uZmlnKG5vZGUsIGluZGV4LCBwYXJhbXMsIHNpemUpOwotICAgICAgICAgICAgICAgICAgICBicmVhazsKLSAgICAgICAgICAgICAgICBkZWZhdWx0OgotICAgICAgICAgICAgICAgICAgICBUUkVTUEFTUygpOwotICAgICAgICAgICAgfQotCi0gICAgICAgICAgICByZXBseS0+d3JpdGVJbnQzMihlcnIpOwotCi0gICAgICAgICAgICBpZiAoKGNvZGUgPT0gR0VUX1BBUkFNRVRFUiB8fCBjb2RlID09IEdFVF9DT05GSUcpICYmIGVyciA9PSBPSykgewotICAgICAgICAgICAgICAgIHJlcGx5LT53cml0ZShwYXJhbXMsIHNpemUpOwotICAgICAgICAgICAgfQotCi0gICAgICAgICAgICBmcmVlKHBhcmFtcyk7Ci0gICAgICAgICAgICBwYXJhbXMgPSBOVUxMOwotCi0gICAgICAgICAgICByZXR1cm4gTk9fRVJST1I7Ci0gICAgICAgIH0KLQotICAgICAgICBjYXNlIEdFVF9TVEFURToKLSAgICAgICAgewotICAgICAgICAgICAgQ0hFQ0tfSU5URVJGQUNFKElPTVgsIGRhdGEsIHJlcGx5KTsKLQotICAgICAgICAgICAgbm9kZV9pZCBub2RlID0gKHZvaWQqKWRhdGEucmVhZEludFB0cigpOwotICAgICAgICAgICAgT01YX1NUQVRFVFlQRSBzdGF0ZSA9IE9NWF9TdGF0ZUludmFsaWQ7Ci0KLSAgICAgICAgICAgIHN0YXR1c190IGVyciA9IGdldFN0YXRlKG5vZGUsICZzdGF0ZSk7Ci0gICAgICAgICAgICByZXBseS0+d3JpdGVJbnQzMihzdGF0ZSk7Ci0gICAgICAgICAgICByZXBseS0+d3JpdGVJbnQzMihlcnIpOwotCi0gICAgICAgICAgICByZXR1cm4gTk9fRVJST1I7Ci0gICAgICAgIH0KLQotICAgICAgICBjYXNlIEVOQUJMRV9HUkFQSElDX0JVRkZFUlM6Ci0gICAgICAgIHsKLSAgICAgICAgICAgIENIRUNLX0lOVEVSRkFDRShJT01YLCBkYXRhLCByZXBseSk7Ci0KLSAgICAgICAgICAgIG5vZGVfaWQgbm9kZSA9ICh2b2lkKilkYXRhLnJlYWRJbnRQdHIoKTsKLSAgICAgICAgICAgIE9NWF9VMzIgcG9ydF9pbmRleCA9IGRhdGEucmVhZEludDMyKCk7Ci0gICAgICAgICAgICBPTVhfQk9PTCBlbmFibGUgPSAoT01YX0JPT0wpZGF0YS5yZWFkSW50MzIoKTsKLQotICAgICAgICAgICAgc3RhdHVzX3QgZXJyID0gZW5hYmxlR3JhcGhpY0J1ZmZlcnMobm9kZSwgcG9ydF9pbmRleCwgZW5hYmxlKTsKLSAgICAgICAgICAgIHJlcGx5LT53cml0ZUludDMyKGVycik7Ci0KLSAgICAgICAgICAgIHJldHVybiBOT19FUlJPUjsKLSAgICAgICAgfQotCi0gICAgICAgIGNhc2UgR0VUX0dSQVBISUNfQlVGRkVSX1VTQUdFOgotICAgICAgICB7Ci0gICAgICAgICAgICBDSEVDS19JTlRFUkZBQ0UoSU9NWCwgZGF0YSwgcmVwbHkpOwotCi0gICAgICAgICAgICBub2RlX2lkIG5vZGUgPSAodm9pZCopZGF0YS5yZWFkSW50UHRyKCk7Ci0gICAgICAgICAgICBPTVhfVTMyIHBvcnRfaW5kZXggPSBkYXRhLnJlYWRJbnQzMigpOwotCi0gICAgICAgICAgICBPTVhfVTMyIHVzYWdlID0gMDsKLSAgICAgICAgICAgIHN0YXR1c190IGVyciA9IGdldEdyYXBoaWNCdWZmZXJVc2FnZShub2RlLCBwb3J0X2luZGV4LCAmdXNhZ2UpOwotICAgICAgICAgICAgcmVwbHktPndyaXRlSW50MzIoZXJyKTsKLSAgICAgICAgICAgIHJlcGx5LT53cml0ZUludDMyKHVzYWdlKTsKLQotICAgICAgICAgICAgcmV0dXJuIE5PX0VSUk9SOwotICAgICAgICB9Ci0KLSAgICAgICAgY2FzZSBVU0VfQlVGRkVSOgotICAgICAgICB7Ci0gICAgICAgICAgICBDSEVDS19JTlRFUkZBQ0UoSU9NWCwgZGF0YSwgcmVwbHkpOwotCi0gICAgICAgICAgICBub2RlX2lkIG5vZGUgPSAodm9pZCopZGF0YS5yZWFkSW50UHRyKCk7Ci0gICAgICAgICAgICBPTVhfVTMyIHBvcnRfaW5kZXggPSBkYXRhLnJlYWRJbnQzMigpOwotICAgICAgICAgICAgc3A8SU1lbW9yeT4gcGFyYW1zID0KLSAgICAgICAgICAgICAgICBpbnRlcmZhY2VfY2FzdDxJTWVtb3J5PihkYXRhLnJlYWRTdHJvbmdCaW5kZXIoKSk7Ci0KLSAgICAgICAgICAgIGJ1ZmZlcl9pZCBidWZmZXI7Ci0gICAgICAgICAgICBzdGF0dXNfdCBlcnIgPSB1c2VCdWZmZXIobm9kZSwgcG9ydF9pbmRleCwgcGFyYW1zLCAmYnVmZmVyKTsKLSAgICAgICAgICAgIHJlcGx5LT53cml0ZUludDMyKGVycik7Ci0KLSAgICAgICAgICAgIGlmIChlcnIgPT0gT0spIHsKLSAgICAgICAgICAgICAgICByZXBseS0+d3JpdGVJbnRQdHIoKGludHB0cl90KWJ1ZmZlcik7Ci0gICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgIHJldHVybiBOT19FUlJPUjsKLSAgICAgICAgfQotCi0gICAgICAgIGNhc2UgVVNFX0dSQVBISUNfQlVGRkVSOgotICAgICAgICB7Ci0gICAgICAgICAgICBDSEVDS19JTlRFUkZBQ0UoSU9NWCwgZGF0YSwgcmVwbHkpOwotCi0gICAgICAgICAgICBub2RlX2lkIG5vZGUgPSAodm9pZCopZGF0YS5yZWFkSW50UHRyKCk7Ci0gICAgICAgICAgICBPTVhfVTMyIHBvcnRfaW5kZXggPSBkYXRhLnJlYWRJbnQzMigpOwotICAgICAgICAgICAgc3A8R3JhcGhpY0J1ZmZlcj4gZ3JhcGhpY0J1ZmZlciA9IG5ldyBHcmFwaGljQnVmZmVyKCk7Ci0gICAgICAgICAgICBkYXRhLnJlYWQoKmdyYXBoaWNCdWZmZXIpOwotCi0gICAgICAgICAgICBidWZmZXJfaWQgYnVmZmVyOwotICAgICAgICAgICAgc3RhdHVzX3QgZXJyID0gdXNlR3JhcGhpY0J1ZmZlcigKLSAgICAgICAgICAgICAgICAgICAgbm9kZSwgcG9ydF9pbmRleCwgZ3JhcGhpY0J1ZmZlciwgJmJ1ZmZlcik7Ci0gICAgICAgICAgICByZXBseS0+d3JpdGVJbnQzMihlcnIpOwotCi0gICAgICAgICAgICBpZiAoZXJyID09IE9LKSB7Ci0gICAgICAgICAgICAgICAgcmVwbHktPndyaXRlSW50UHRyKChpbnRwdHJfdClidWZmZXIpOwotICAgICAgICAgICAgfQotCi0gICAgICAgICAgICByZXR1cm4gTk9fRVJST1I7Ci0gICAgICAgIH0KLQotICAgICAgICBjYXNlIFNUT1JFX01FVEFfREFUQV9JTl9CVUZGRVJTOgotICAgICAgICB7Ci0gICAgICAgICAgICBDSEVDS19JTlRFUkZBQ0UoSU9NWCwgZGF0YSwgcmVwbHkpOwotCi0gICAgICAgICAgICBub2RlX2lkIG5vZGUgPSAodm9pZCopZGF0YS5yZWFkSW50UHRyKCk7Ci0gICAgICAgICAgICBPTVhfVTMyIHBvcnRfaW5kZXggPSBkYXRhLnJlYWRJbnQzMigpOwotICAgICAgICAgICAgT01YX0JPT0wgZW5hYmxlID0gKE9NWF9CT09MKWRhdGEucmVhZEludDMyKCk7Ci0KLSAgICAgICAgICAgIHN0YXR1c190IGVyciA9IHN0b3JlTWV0YURhdGFJbkJ1ZmZlcnMobm9kZSwgcG9ydF9pbmRleCwgZW5hYmxlKTsKLSAgICAgICAgICAgIHJlcGx5LT53cml0ZUludDMyKGVycik7Ci0KLSAgICAgICAgICAgIHJldHVybiBOT19FUlJPUjsKLSAgICAgICAgfQotCi0gICAgICAgIGNhc2UgQUxMT0NfQlVGRkVSOgotICAgICAgICB7Ci0gICAgICAgICAgICBDSEVDS19JTlRFUkZBQ0UoSU9NWCwgZGF0YSwgcmVwbHkpOwotCi0gICAgICAgICAgICBub2RlX2lkIG5vZGUgPSAodm9pZCopZGF0YS5yZWFkSW50UHRyKCk7Ci0gICAgICAgICAgICBPTVhfVTMyIHBvcnRfaW5kZXggPSBkYXRhLnJlYWRJbnQzMigpOwotICAgICAgICAgICAgc2l6ZV90IHNpemUgPSBkYXRhLnJlYWRJbnQzMigpOwotCi0gICAgICAgICAgICBidWZmZXJfaWQgYnVmZmVyOwotICAgICAgICAgICAgdm9pZCAqYnVmZmVyX2RhdGE7Ci0gICAgICAgICAgICBzdGF0dXNfdCBlcnIgPSBhbGxvY2F0ZUJ1ZmZlcigKLSAgICAgICAgICAgICAgICAgICAgbm9kZSwgcG9ydF9pbmRleCwgc2l6ZSwgJmJ1ZmZlciwgJmJ1ZmZlcl9kYXRhKTsKLSAgICAgICAgICAgIHJlcGx5LT53cml0ZUludDMyKGVycik7Ci0KLSAgICAgICAgICAgIGlmIChlcnIgPT0gT0spIHsKLSAgICAgICAgICAgICAgICByZXBseS0+d3JpdGVJbnRQdHIoKGludHB0cl90KWJ1ZmZlcik7Ci0gICAgICAgICAgICAgICAgcmVwbHktPndyaXRlSW50UHRyKChpbnRwdHJfdClidWZmZXJfZGF0YSk7Ci0gICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgIHJldHVybiBOT19FUlJPUjsKLSAgICAgICAgfQotCi0gICAgICAgIGNhc2UgQUxMT0NfQlVGRkVSX1dJVEhfQkFDS1VQOgotICAgICAgICB7Ci0gICAgICAgICAgICBDSEVDS19JTlRF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W50MzIoZnJlZUJ1ZmZlcihub2RlLCBwb3J0X2luZGV4LCBidWZmZXIpKTsKLQotICAgICAgICAgICAgcmV0dXJuIE5PX0VSUk9SOwotICAgICAgICB9Ci0KLSAgICAgICAgY2FzZSBGSUxMX0JVRkZFUjoKLSAgICAgICAgewotICAgICAgICAgICAgQ0hFQ0tfSU5URVJGQUNFKElPTVgsIGRhdGEsIHJlcGx5KTsKLQotICAgICAgICAgICAgbm9kZV9pZCBub2RlID0gKHZvaWQqKWRhdGEucmVhZEludFB0cigpOwotICAgICAgICAgICAgYnVmZmVyX2lkIGJ1ZmZlciA9ICh2b2lkKilkYXRhLnJlYWRJbnRQdHIoKTsKLSAgICAgICAgICAgIHJlcGx5LT53cml0ZUludDMyKGZpbGxCdWZmZXIobm9kZSwgYnVmZmVyKSk7Ci0KLSAgICAgICAgICAgIHJldHVybiBOT19FUlJPUjsKLSAgICAgICAgfQotCi0gICAgICAgIGNhc2UgRU1QVFlfQlVGRkVSOgotICAgICAgICB7Ci0gICAgICAgICAgICBDSEVDS19JTlRFUkZBQ0UoSU9NWCwgZGF0YSwgcmVwbHkpOwotCi0gICAgICAgICAgICBub2RlX2lkIG5vZGUgPSAodm9pZCopZGF0YS5yZWFkSW50UHRyKCk7Ci0gICAgICAgICAgICBidWZmZXJfaWQgYnVmZmVyID0gKHZvaWQqKWRhdGEucmVhZEludFB0cigpOwotICAgICAgICAgICAgT01YX1UzMiByYW5nZV9vZmZzZXQgPSBkYXRhLnJlYWRJbnQzMigpOwotICAgICAgICAgICAgT01YX1UzMiByYW5nZV9sZW5ndGggPSBkYXRhLnJlYWRJbnQzMigpOwotICAgICAgICAgICAgT01YX1UzMiBmbGFncyA9IGRhdGEucmVhZEludDMyKCk7Ci0gICAgICAgICAgICBPTVhfVElDS1MgdGltZXN0YW1wID0gZGF0YS5yZWFkSW50NjQoKTsKLQotICAgICAgICAgICAgcmVwbHktPndyaXRlSW50MzIoCi0gICAgICAgICAgICAgICAgICAgIGVtcHR5QnVmZmVyKAotICAgICAgICAgICAgICAgICAgICAgICAgbm9kZSwgYnVmZmVyLCByYW5nZV9vZmZzZXQsIHJhbmdlX2xlbmd0aCwKLSAgICAgICAgICAgICAgICAgICAgICAgIGZsYWdzLCB0aW1lc3RhbXApKTsKLQotICAgICAgICAgICAgcmV0dXJuIE5PX0VSUk9SOwotICAgICAgICB9Ci0KLSAgICAgICAgY2FzZSBHRVRfRVhURU5TSU9OX0lOREVYOgotICAgICAgICB7Ci0gICAgICAgICAgICBDSEVDS19JTlRFUkZBQ0UoSU9NWCwgZGF0YSwgcmVwbHkpOwotCi0gICAgICAgICAgICBub2RlX2lkIG5vZGUgPSAodm9pZCopZGF0YS5yZWFkSW50UHRyKCk7Ci0gICAgICAgICAgICBjb25zdCBjaGFyICpwYXJhbWV0ZXJfbmFtZSA9IGRhdGEucmVhZENTdHJpbmcoKTsKLQotICAgICAgICAgICAgT01YX0lOREVYVFlQRSBpbmRleDsKLSAgICAgICAgICAgIHN0YXR1c190IGVyciA9IGdldEV4dGVuc2lvbkluZGV4KG5vZGUsIHBhcmFtZXRlcl9uYW1lLCAmaW5kZXgpOwotCi0gICAgICAgICAgICByZXBseS0+d3JpdGVJbnQzMihlcnIpOwotCi0gICAgICAgICAgICBpZiAoZXJyID09IE9LKSB7Ci0gICAgICAgICAgICAgICAgcmVwbHktPndyaXRlSW50MzIoaW5kZXgpOwotICAgICAgICAgICAgfQotCi0gICAgICAgICAgICByZXR1cm4gT0s7Ci0gICAgICAgIH0KLQotICAgICAgICBkZWZhdWx0OgotICAgICAgICAgICAgcmV0dXJuIEJCaW5kZXI6Om9uVHJhbnNhY3QoY29kZSwgZGF0YSwgcmVwbHksIGZsYWdzKTsKLSAgICB9Ci19Ci0KLS8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vCi0KLWNsYXNzIEJwT01YT2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kpOwotICAgICAgICAgICAgc2V0TGlzdGVuZXIoCi0gICAgICAgICAgICAgICAgICAgIGludGVyZmFjZV9jYXN0PElTdHJlYW1MaXN0ZW5lcj4oZGF0YS5yZWFkU3Ryb25nQmluZGVyKCkpKTsKLSAgICAgICAgICAgIGJyZWFrOwotICAgICAgICB9Ci0KLSAgICAgICAgY2FzZSBTRVRfQlVGRkVSUzoKLSAgICAgICAgewotICAgICAgICAgICAgQ0hFQ0tfSU5URVJGQUNFKElTdHJlYW1Tb3VyY2UsIGRhdGEsIHJlcGx5KTsKLSAgICAgICAgICAgIHNpemVfdCBuID0gc3RhdGljX2Nhc3Q8c2l6ZV90PihkYXRhLnJlYWRJbnQzMigpKTsKLSAgICAgICAgICAgIFZlY3RvcjxzcDxJTWVtb3J5PiA+IGJ1ZmZlcnM7Ci0gICAgICAgICAgICBmb3IgKHNpemVfdCBpID0gMDsgaSA8IG47ICsraSkgewotICAgICAgICAgICAgICAgIHNwPElNZW1vcnk+IG1lbSA9Ci0gICAgICAgICAgICAgICAgICAgIGludGVyZmFjZV9jYXN0PElNZW1vcnk+KGRhdGEucmVhZFN0cm9uZ0JpbmRlcigpKTsKLQotICAgICAgICAgICAgICAgIGJ1ZmZlcnMucHVzaChtZW0pOwotICAgICAgICAgICAgfQotICAgICAgICAgICAgc2V0QnVmZmVycyhidWZmZXJzKTsKLSAgICAgICAgICAgIGJyZWFrOwotICAgICAgICB9Ci0KLSAgICAgICAgY2FzZSBPTl9CVUZGRVJfQVZBSUxBQkxFOgotICAgICAgICB7Ci0gICAgICAgICAgICBDSEVDS19JTlRFUkZBQ0UoSVN0cmVhbVNvdXJjZSwgZGF0YSwgcmVwbHkpOwotICAgICAgICAgICAgb25CdWZmZXJBdmFpbGFibGUoc3RhdGljX2Nhc3Q8c2l6ZV90PihkYXRhLnJlYWRJbnQzMigpKSk7Ci0gICAgICAgICAgICBicmVhazsKLSAgICAgICAgfQotCi0gICAgICAgIGRlZmF1bHQ6Ci0gICAgICAgIC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aXplX3Q+KGRhdGEucmVhZEludDMyKCkpOwotICAgICAgICAgICAgc2l6ZV90IHNpemUgPSBzdGF0aWNfY2FzdDxzaXplX3Q+KGRhdGEucmVhZEludDMyKCkpOwotCi0gICAgICAgICAgICBxdWV1ZUJ1ZmZlcihpbmRleCwgc2l6ZSk7Ci0gICAgICAgICAgICBicmVhazsKLSAgICAgICAgfQotCi0gICAgICAgIGNhc2UgSVNTVUVfQ09NTUFORDoKLSAgICAgICAgewotICAgICAgICAgICAgQ0hFQ0tfSU5URVJGQUNFKElTdHJlYW1MaXN0ZW5lciwgZGF0YSwgcmVwbHkpOwotICAgICAgICAgICAgQ29tbWFuZCBjbWQgPSBzdGF0aWNfY2FzdDxDb21tYW5kPihkYXRhLnJlYWRJbnQzMigpKTsKLQotICAgICAgICAgICAgYm9vbCBzeW5jaHJvbm91cyA9IHN0YXRpY19jYXN0PGJvb2w+KGRhdGEucmVhZEludDMyKCkpOwotCi0gICAgICAgICAgICBzcDxBTWVzc2FnZT4gbXNnOwotCi0gICAgICAgICAgICBpZiAoZGF0YS5yZWFkSW50MzIoKSkgewotICAgICAgICAgICAgICAgIG1zZyA9IEFNZXNzYWdlOjpGcm9tUGFyY2VsKGRhdGEpOwotICAgICAgICAgICAgfQotCi0gICAgICAgICAgICBpc3N1ZUNvbW1hbmQoY21kLCBzeW5jaHJvbm91cywgbXNnKTsKLSAgICAgICAgICAgIGJyZWFrOwotICAgICAgICB9Ci0KLSAgICAgICAgZGVmYXVsdDoKLSAgICAgICAgICAgIHJldHVybiBCQmluZGVyOjpvblRyYW5zYWN0KGNvZGUsIGRhdGEsIHJlcGx5LCBmbGFncyk7Ci0gICAgfQotCi0gICAgcmV0dXJuIE9LOwotfQotCi19ICAvLyBuYW1lc3BhY2UgYW5kcm9pZApkaWZmIC0tZ2l0IGEvbWVkaWEvbGlibWVkaWEvSmV0UGxheWVyLmNwcCBiL21lZGlhL2xpYm1lZGlhL0pldFBsYXllci5jcHAKZGVsZXRlZCBma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l0Y2ggKGopIHsKLSAgICAgICAgICAgICAgICBjYXNlIDA6Ci0gICAgICAgICAgICAgICAgICAgcmVmUXVhbGl0eSA9IENBTUNPUkRFUl9RVUFMSVRZX0xPVzsKLSAgICAgICAgICAgICAgICAgICBicmVhazsKLSAgICAgICAgICAgICAgICBjYXNlIDE6Ci0gICAgICAgICAgICAgICAgICAgcmVmUXVhbGl0eSA9IENBTUNPUkRFUl9RVUFMSVRZX0hJR0g7Ci0gICAgICAgICAgICAgICAgICAgYnJlYWs7Ci0gICAgICAgICAgICAgICAgY2FzZSAyOgotICAgICAgICAgICAgICAgICAgIHJlZlF1YWxpdHkgPSBDQU1DT1JERVJfUVVBTElUWV9USU1FX0xBUFNFX0xPVzsKLSAgICAgICAgICAgICAgICAgICBicmVhazsKLSAgICAgICAgICAgICAgICBjYXNlIDM6Ci0gICAgICAgICAgICAgICAgICAgcmVmUXVhbGl0eSA9IENBTUNPUkRFUl9RVUFMSVRZX1RJTUVfTEFQU0VfSElHSDsKLSAgICAgICAgICAgICAgICAgICBicmVhazsKLSAgICAgICAgICAgICAgICBkZWZhdWx0OgotICAgICAgICAgICAgICAgICAgICBDSEVDSyghIlNob3VsZCBuZXZlciByZWFjaCBoZXJlIik7Ci0gICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgIGlmICghaW5mby0+bUhhc1JlZlByb2ZpbGUpIHsKLSAgICAgICAgICAgICAgICBpbmRleCA9IGdldENhbWNvcmRlclByb2ZpbGVJbmRleChjYW1lcmFJZCwgcmVmUXVhbGl0eSk7Ci0gICAgICAgICAgICB9Ci0gICAgICAgICAgICBpZiAoaW5kZXggPT0gLTEpIHsKLSAgICAgICAgICAgICAgICAvLyBOZXcgaGlnaCBvciBsb3cgcXVhbGl0eSBwcm9maWxlIGlzIGZvdW5kLgotICAgICAgICAgICAgICAgIC8vIFVwZGF0ZSBpdHMgcmVmZXJlbmNlLgotICAgICAgICAgICAgICAgIGluZm8tPm1IYXNSZWZQcm9maWxlID0gdHJ1ZTsKLSAgICAgICAgICAgICAgICBpbmZvLT5tUmVmUHJvZmlsZUluZGV4ID0gaTsKLSAgICAgICAgICAgICAgICBpbmZvLT5tUmVzb2x1dGlvblByb2R1Y3QgPSBwcm9kdWN0OwotICAgICAgICAgICAgfQotICAgICAgICB9Ci0gICAgfQotCi0gICAgZm9yIChzaXplX3QgY2FtZXJhSWQgPSAwOyBjYW1lcmFJZCA8IG1DYW1lcmFJZHMuc2l6ZSgpOyArK2NhbWVyYUlkKSB7Ci0gICAgICAgIGZvciAoc2l6ZV90IGogPSAwOyBqIDwga051bVJlcXVpcmVkUHJvZmlsZXM7ICsraikgewotICAgICAgICAgICAgaW50IHJlZkluZGV4ID0gZ2V0UmVxdWlyZWRQcm9maWxlUmVmSW5kZXgoY2FtZXJhSWQpOwotICAgICAgICAgICAgQ0hFQ0socmVmSW5kZXggIT0gLTEpOwotICAgICAgICAgICAgUmVxdWlyZWRQcm9maWxlUmVmSW5mbyAqaW5mbyA9Ci0gICAgICAgICAgICAgICAgICAgICZtUmVxdWlyZWRQcm9maWxlUmVmc1tyZWZJbmRleF0ubVJlZnNbal07Ci0KLSAgICAgICAgICAgIGlmIChpbmZvLT5tSGFzUmVmUHJvZmlsZSkgewotCi0gICAgICAgICAgICAgICAgQ2FtY29yZGVyUHJvZmlsZSAqcHJvZmlsZSA9Ci0gICAgICAgICAgICAgICAgICAgIG5ldyBDYW1jb3JkZXJQcm9maWxlKAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICptQ2FtY29yZGVyUHJvZmlsZXNbaW5mby0+bVJlZlByb2ZpbGVJbmRleF0pOwotCi0gICAgICAgICAgICAgICAgLy8gT3ZlcndyaXRlIHRoZSBxdWFsaXR5Ci0gICAgICAgICAgICAgICAgc3dpdGNoIChqICUga051bVJlcXVpcmVkUHJvZmlsZXMpIHsKLSAgICAgICAgICAgICAgICAgICAgY2FzZSAwOgotICAgICAgICAgICAgICAgICAgICAgICAgcHJvZmlsZS0+bVF1YWxpdHkgPSBDQU1DT1JERVJfUVVBTElUWV9MT1c7Ci0gICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKLSAgICAgICAgICAgICAgICAgICAgY2FzZSAxOgotICAgICAgICAgICAgICAgICAgICAgICAgcHJvZmlsZS0+bVF1YWxpdHkgPSBDQU1DT1JERVJfUVVBTElUWV9ISUdIOwotICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7Ci0gICAgICAgICAgICAgICAgICAgIGNhc2UgMjoKLSAgICAgICAgICAgICAgICAgICAgICAgIHByb2ZpbGUtPm1RdWFsaXR5ID0gQ0FNQ09SREVSX1FVQUxJVFlfVElNRV9MQVBTRV9MT1c7Ci0gICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKLSAgICAgICAgICAgICAgICAgICAgY2FzZSAzOgotICAgICAgICAgICAgICAgICAgICAgICAgcHJvZmlsZS0+bVF1YWxpdHkgPSBDQU1DT1JERVJfUVVBTElUWV9USU1FX0xBUFNFX0hJR0g7Ci0gICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKLSAgICAgICAgICAgICAgICAgICAgZGVmYXVsdDoKLSAgICAgICAgICAgICAgICAgICAgICAgIENIRUNLKCEiU2hvdWxkIG5ldmVyIGNvbWUgaGVyZSIpOwotICAgICAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgICAgIGludCBpbmRleCA9IGdldENhbWNvcmRlclByb2ZpbGVJbmRleChjYW1lcmFJZCwgcHJvZmlsZS0+bVF1YWxpdHkpOwotICAgICAgICAgICAgICAgIGlmIChpbmRleCAhPSAtMSkgewotICAgICAgICAgICAgICAgICAgICBBTE9HVigiUHJvZmlsZSBxdWFsaXR5ICVkIGZvciBjYW1lcmEgJWQgYWxyZWFkeSBleGlzdHMiLAotICAgICAgICAgICAgICAgICAgICAgICAgcHJvZmlsZS0+bVF1YWxpdHksIGNhbWVyYUlkKTsKLSAgICAgICAgICAgICAgICAgICAgQ0hFQ0soaW5kZXggPT0gcmVmSW5kZXgpOwotICAgICAgICAgIC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ICAgICAgICAgICAgc3RhdHVzX3Qgc3RhdHVzID0gY2xpZW50LnNjYW5GaWxlKHBhdGgsIHN0YXRidWYuc3RfbXRpbWUsIDAsCi0gICAgICAgICAgICAgICAgICAgIHRydWUgLyppc0RpcmVjdG9yeSovLCBjaGlsZE5vTWVkaWEpOwotICAgICAgICAgICAgaWYgKHN0YXR1cykgewotICAgICAgICAgICAgICAgIHJldHVybiBNRURJQV9TQ0FOX1JFU1VMVF9FUlJPUjsKLSAgICAgICAgICAgIH0KLSAgICAgICAgfQotCi0gICAgICAgIC8vIGFuZCBub3cgcHJvY2VzcyBpdHMgY29udGVudHMKLSAgICAgICAgc3RyY2F0KGZpbGVTcG90LCAiLyIpOwotICAgICAgICBNZWRpYVNjYW5SZXN1bHQgcmVzdWx0ID0gZG9Qcm9jZXNzRGlyZWN0b3J5KHBhdGgsIHBhdGhSZW1haW5pbmcgLSBuYW1lTGVuZ3RoIC0gMSwKLSAgICAgICAgICAgICAgICBjbGllbnQsIGNoaWxkTm9NZWRpYSk7Ci0gICAgICAgIGlmIChyZXN1bHQgPT0gTUVESUFfU0NBTl9SRVNVTFRfRVJST1IpIHsKLSAgICAgICAgICAgIHJldHVybiBNRURJQV9TQ0FOX1JFU1VMVF9FUlJPUjsKLSAgICAgICAgfQotICAgIH0gZWxzZSBpZiAodHlwZSA9PSBEVF9SRUcpIHsKLSAgICAgICAgc3RhdChwYXRoLCAmc3RhdGJ1Zik7Ci0gICAgICAgIHN0YXR1c190IHN0YXR1cyA9IGNsaWVudC5zY2FuRmlsZShwYXRoLCBzdGF0YnVmLnN0X210aW1lLCBzdGF0YnVmLnN0X3NpemUsCi0gICAgICAgICAgICAgICAgZmFsc2UgLyppc0RpcmVjdG9yeSovLCBub01lZGlhKTsKLSAgICAgICAgaWYgKHN0YXR1cykgewotICAgICAgICAgICAgcmV0dXJuIE1FRElBX1NDQU5fUkVTVUxUX0VSUk9SOwotICAgICAgICB9Ci0gICAgfQotCi0gICAgcmV0dXJuIE1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ZSBjaGFycyBiYWNrCi0gICAgdWludDhfdCBjaDEsIGNoMjsKLSAgICB1aW50OF90KiBjaHAgPSAodWludDhfdCAqKXM7Ci0KLSAgICB3aGlsZSAoKGNoMSA9ICpjaHArKykpIHsKLSAgICAgICAgaWYgKGNoMSAmIDB4ODApIHsKLSAgICAgICAgICAgIGNoMiA9ICpjaHArKzsKLSAgICAgICAgICAgIGNoMSA9ICgoY2gxIDw8IDYpICYgMHhDMCkgfCAoY2gyICYgMHgzRik7Ci0gICAgICAgICAgICAvLyBjaDEgaXMgbm93IHRoZSBmaXJzdCBieXRlIG9mIHRoZSBwb3RlbnRpYWwgbmF0aXZlIGNoYXIKLQotICAgICAgICAgICAgY2gyID0gKmNocCsrOwotICAgICAgICAgICAgaWYgKGNoMiAmIDB4ODApCi0gICAgICAgICAgICAgICAgY2gyID0gKChjaDIgPDwgNikgJiAweEMwKSB8ICgqY2hwKysgJiAweDNGKTsKLSAgICAgICAgICAgIC8vIGNoMiBpcyBub3cgdGhlIHNlY29uZCBieXRlIG9mIHRoZSBwb3RlbnRpYWwgbmF0aXZlIGNoYXIKLSAgICAgICAgICAgIGludCBjaCA9IChpbnQpY2gxIDw8IDggfCAoaW50KWNoMjsKLSAgICAgICAgICAgIHJlc3VsdCAmPSBmaW5kUG9zc2libGVFbmNvZGluZ3MoY2gpOwotICAgICAgICB9Ci0gICAgICAgIC8vIGVsc2UgQVNDSUkgY2hhcmFjdGVyLCB3aGljaCBjb3VsZCBiZSBhbnl0aGluZwotICAgIH0KLQotICAgIHJldHVybiByZXN1bHQ7Ci19Ci0KLXZvaWQgTWVkaWFTY2FubmVyQ2xpZW50Ojpjb252ZXJ0VmFsdWVzKHVpbnQzMl90IGVuY29kaW5nKQotewotICAgIGNvbnN0IGNoYXIqIGVuYyA9IE5VTEw7Ci0gICAgc3dpdGNoIChlbmNvZGluZykgewotICAgICAgICBjYXNlIGtFbmNvZGluZ1NoaWZ0SklTOgotICAgICAgICAgICAgZW5jID0gInNoaWZ0LWppcyI7Ci0gICAgICAgICAgICBicmVhazsKLSAgICAgICAgY2FzZSBrRW5jb2RpbmdHQks6Ci0gICAgICAgICAgICBlbmMgPSAiZ2JrIjsKLSAgICAgICAgICAgIGJyZWFrOwotICAgICAgICBjYXNlIGtFbmNvZGluZ0JpZzU6Ci0gICAgICAgICAgICBlbmMgPSAiQmlnNSI7Ci0gICAgICAgICAgICBicmVhazsKLSAgICAgICAgY2FzZSBrRW5jb2RpbmdFVUNLUjoKLSAgICAgICAgICAgIGVuYyA9ICJFVUMtS1IiOwotICAgICAgICAgICAgYnJlYWs7Ci0gICAgfQotCi0gICAgaWYgKGVuYykgewotICAgICAgICBVRXJyb3JDb2RlIHN0YXR1cyA9IFVfWkVST19FUlJPUjsKLQotICAgICAgICBVQ29udmVydGVyICpjb252ID0gdWNudl9vcGVuKGVuYywgJnN0YXR1cyk7Ci0gICAgICAgIGlmIChVX0ZBSUxVUkUoc3RhdHVzKSkgewotICAgICAgICAgICAgQUxPR0UoImNvdWxkIG5vdCBjcmVhdGUgVUNvbnZlcnRlciBmb3IgJXMiLCBlbmMpOwotICAgICAgICAgICAgcmV0dXJuOwotICAgICAgICB9Ci0gICAgICAgIFVDb252ZXJ0ZXIgKnV0ZjhDb252ID0gdWNudl9vcGVuKCJVVEYtOCIsICZzdGF0dXMpOwotICAgICAgICBpZiAoVV9GQUlMVVJFKHN0YXR1cykpIHsKLSAgICAgICAgICAgIEFMT0dFKCJjb3VsZCBub3QgY3JlYXRlIFVDb252ZXJ0ZXIgZm9yIFVURi04Iik7Ci0gICAgICAgICAgICB1Y252X2Nsb3NlKGNvbnYpOwotICAgICAgICAgICAgcmV0dXJuOwotICAgICAgICB9Ci0KLSAgICAgICAgLy8gZm9yIGVhY2ggdmFsdWUgc3RyaW5nLCBjb252ZXJ0IGZyb20gbmF0aXZlIGVuY29kaW5nIHRvIFVURi04Ci0gICAgICAgIGZvciAoaW50IGkgPSAwOyBpIDwgbU5hbWVzLT5zaXplKCk7IG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ZvciBOVUxMLCBidXQgaW4gdGhpcyBjYXNlIHRhcmdldExlbmd0aCBtYXkgYmUgbGFyZ2UKLSAgICAgICAgICAgIGlmICghYnVmZmVyKQotICAgICAgICAgICAgICAgIGJyZWFrOwotICAgICAgICAgICAgY2hhciogdGFyZ2V0ID0gYnVmZmVyOwotCi0gICAgICAgICAgICB1Y252X2NvbnZlcnRFeCh1dGY4Q29udiwgY29udiwgJnRhcmdldCwgdGFyZ2V0ICsgdGFyZ2V0TGVuZ3RoLAotICAgICAgICAgICAgICAgICAgICAmc291cmNlLCAoY29uc3QgY2hhciAqKWRlc3QsIE5VTEwsIE5VTEwsIE5VTEwsIE5VTEwsIFRSVUUsIFRSVUUsICZzdGF0dXMpOwotICAgICAgICAgICAgaWYgKFVfRkFJTFVSRShzdGF0dXMpKSB7Ci0gICAgICAgICAgICAgICAgQUxPR0UoInVjbnZfY29udmVydEV4IGZhaWxlZDogJWQiLCBzdGF0dXMpOwotICAgICAgICAgICAgICAgIG1WYWx1ZXMtPnNldEVudHJ5KGksICI/Pz8iKTsKLSAgICAgICAgICAgIH0gZWxzZSB7Ci0gICAgICAgICAgICAgICAgLy8gemVybyB0ZXJtaW5hdGUKLSAgICAgICAgICAgICAgICAqdGFyZ2V0ID0gMDsKLSAgICAgICAgICAgICAgICBtVmFsdWVzLT5zZXRFbnRyeShpLCBidWZmZXIpOwotICAgICAgICAgICAgfQotCi0gICAgICAgICAgICBkZWxldGVbXSBidWZmZXI7Ci0gICAgICAgIH0KLQotICAgICAgICB1Y252X2Nsb3NlKGNvbnYpOwotICAgICAgICB1Y252X2Nsb3NlKHV0ZjhDb252KTsKLSAgICB9Ci19Ci0KLXZvaWQgTWVkaWFTY2FubmVyQ2xpZW50OjplbmRGaWxlKCkKLXsKLSAgICBpZiAobUxvY2FsZUVuY29kaW5nICE9IGtFbmNvZGluZ05vbmUpIHsKLSAgICAgICAgaW50IHNpemUgPSBtTmFtZXMtPnNpemUoKTsKLSAgICAgICAgdWludDMyX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ICAgICAgICAgIGUtPmJhY2t0cmFjZSA9IHJlaW50ZXJwcmV0X2Nhc3Q8aW50cHRyX3QgKj4ocHRyKTsKLSAgICAgICAgICAgIHB0ciArPSBzaXplb2YoaW50cHRyX3QpICogYmFja3RyYWNlU2l6ZTsKLSAgICAgICAgfQotCi0gICAgICAgIC8vIE5vdyB3ZSBuZWVkIHRvIHNvcnQgdGhlIGVudHJpZXMuICBUaGV5IGNvbWUgc29ydGVkIGJ5IHNpemUgYnV0Ci0gICAgICAgIC8vIG5vdCBieSBzdGFjayB0cmFjZSB3aGljaCBjYXVzZXMgcHJvYmxlbXMgdXNpbmcgZGlmZi4KLSAgICAgICAgYm9vbCBtb3ZlZDsKLSAgICAgICAgZG8gewotICAgICAgICAgICAgbW92ZWQgPSBmYWxzZTsKLSAgICAgICAgICAgIGZvciAoc2l6ZV90IGkgPSAwOyBpIDwgKGNvdW50IC0gMSk7IGkrKykgewotICAgICAgICAgICAgICAgIEFsbG9jRW50cnkgKmUxID0gJmVudHJpZXNbaV07Ci0gICAgICAgICAgICAgICAgQWxsb2NFbnRyeSAqZTIgPSAmZW50cmllc1tpKzFdOwotCi0gICAgICAgICAgICAgICAgYm9vbCBzd2FwID0gZTEtPnNpemUgPCBlMi0+c2l6ZTsKLSAgICAgICAgICAgICAgICBpZiAoZTEtPnNpemUgPT0gZTItPnNpemUpIHsKLSAgICAgICAgICAgICAgICAgICAgZm9yKHNpemVfdCBqID0gMDsgaiA8IGJhY2t0cmFjZVNpemU7IGorKykgewotICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGUxLT5iYWNrdHJhY2Vbal0gPT0gZTItPmJhY2t0cmFjZVtqXSkgewotICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbnRpbnVlOwotICAgICAgICAgICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgICAgICAgICAgc3dhcCA9IGUxLT5iYWNrdHJhY2Vbal0gPCBlMi0+YmFja3RyYWNlW2pdOwotICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7Ci0gICAgICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgaWYgKHN3YXApIHsKLSAgICAgICAgICAgICAgICAgICAgQWxsb2NFbnRyeSB0ID0gZW50cmllc1tpXTsKLSAgICAgICAgICAgICAgICAgICAgZW50cmllc1tpXSA9IGVudHJpZXNbaSsxXTsKLSAgICAgICAgICAgICAgICAgICAgZW50cmllc1tpKzFdID0gdDsKLSAgICAgICAgICAgICAgICAgICAgbW92ZWQgPSB0cnVlOwotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgIH0KLSAgICAgICAgfSB3aGlsZSAobW92ZWQpOwotCi0gICAgICAgIGZvciAoc2l6ZV90IGkgPSAwOyBpIDwgY291bnQ7IGkrKykgewotICAgICAgICAgICAgQWxsb2NFbnRyeSAqZSA9ICZlbnRyaWVzW2ldOwotCi0gICAgICAgICAgICBzbnByaW50ZihidWZmZXIsIFNJWkUsICJzaXplICU4aSwgZHVwICU0aSwgIiwgZS0+c2l6ZSwgZS0+ZHVwcyk7Ci0gICAgICAgICAgICByZXN1bHQuYXBwZW5kKGJ1ZmZlcik7Ci0gICAgICAgICAgICBmb3IgKHNpemVfdCBjdCA9IDA7IChjdCA8IGJhY2t0cmFjZVNpemUpICYmIGUtPmJhY2t0cmFjZVtjdF07IGN0KyspIHsKLSAgICAgICAgICAgICAgICBpZiAoY3QpIHsKLSAgICAgICAgICAgICAgICAgICAgcmVzdWx0LmFwcGVuZCgiLCAiKTsKLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgc25wcmludGYoYnVmZmVyLCBTSVpFLCAiMHglMDh4IiwgZS0+YmFja3RyYWNlW2N0XSk7Ci0gICAgICAgICAgICAgICAgcmVzdWx0LmFwcGVuZChidWZmZXIpOwotICAgICAgICAgICAgfQotICAgICAgICAgICAgcmVzdWx0LmFwcGVuZCgiXG4iKTsKLSAgICAgICAgfQotCi0gICAgICAg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tU3RvcC5lcmFzZShpdGVyKTsKLSAgICAgICAgICAgIG1SZXN0YXJ0TG9jay51bmxvY2soKTsKLSAgICAgICAgICAgIGlmIChjaGFubmVsICE9IDApIHsKLSAgICAgICAgICAgICAgICBNdXRleDo6QXV0b2xvY2sgbG9jaygmbUxvY2spOwotICAgICAgICAgICAgICAgIGNoYW5uZWwtPnN0b3AoKTsKLSAgICAgICAgICAgIH0KLSAgICAgICAgICAgIG1SZXN0YXJ0TG9jay5sb2NrKCk7Ci0gICAgICAgICAgICBpZiAobVF1aXQpIGJyZWFrOwotICAgICAgICB9Ci0KLSAgICAgICAgd2hpbGUgKCFtUmVzdGFydC5lbXB0eSgpKSB7Ci0gICAgICAgICAgICBTb3VuZENoYW5uZWwqIGNoYW5uZWw7Ci0gICAgICAgICAgICBBTE9HVigiR2V0dGluZyBjaGFubmVsIGZyb20gbGlzdCIpOwotICAgICAgICAgICAgTGlzdDxTb3VuZENoYW5uZWwqPjo6aXRlcmF0b3IgaXRlciA9IG1SZXN0YXJ0LmJlZ2luKCk7Ci0gICAgICAgICAgICBjaGFubmVsID0gKml0ZXI7Ci0gICAgICAgICAgICBtUmVzdGFydC5lcmFzZShpdGVyKTsKLSAgICAgICAgICAgIG1SZXN0YXJ0TG9jay51bmxvY2soKTsKLSAgICAgICAgICAgIGlmIChjaGFubmVsICE9IDApIHsKLSAgICAgICAgICAgICAgICBNdXRleDo6QXV0b2xvY2sgbG9jaygmbUxvY2spOwotICAgICAgICAgICAgICAgIGNoYW5uZWwtPm5leHRFdmVudCgpOwotICAgICAgICAgICAgfQotICAgICAgICAgICAgbVJlc3RhcnRMb2NrLmxvY2soKTsKLSAgICAgICAgICAgIGlmIChtUXVpdCkgYnJlYWs7Ci0gICAgICAgIH0KLSAgICB9Ci0KLSAgICBtU3RvcC5jbGVhcigpOwotICAgIG1SZXN0YXJ0LmNsZWFyKCk7Ci0gICAgbUNvbmRpdGlvbi5zaWduYWwoKTsKLSAgICBtUmVzdGFydExvY2sud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QiLCB0aGlzLCBtQ2hhbm5lbElEKTsKLSAgICAgICAgaWYgKGIgIT0gTlVMTCkgewotICAgICAgICAgICAgYi0+c2l6ZSA9IDA7Ci0gICAgICAgIH0KLSAgICAgICAgcmV0dXJuOwotICAgIH0KLQotICAgIHNwPFNhbXBsZT4gc2FtcGxlID0gbVNhbXBsZTsKLQotLy8gICAgQUxPR1YoIlNvdW5kQ2hhbm5lbDo6cHJvY2VzcyBldmVudCAlZCIsIGV2ZW50KTsKLQotICAgIGlmIChldmVudCA9PSBBdWRpb1RyYWNrOjpFVkVOVF9NT1JFX0RBVEEpIHsKLQotICAgICAgICAvLyBjaGVjayBmb3Igc3RvcCBzdGF0ZQotICAgICAgICBpZiAoYi0+c2l6ZSA9PSAwKSByZXR1cm47Ci0KLSAgICAgICAgaWYgKG1TdGF0ZSA9PSBJRExFKSB7Ci0gICAgICAgICAgICBiLT5zaXplID0gMDsKLSAgICAgICAgICAgIHJldHVybjsKLSAgICAgICAgfQotCi0gICAgICAgIGlmIChzYW1wbGUgIT0gMCkgewotICAgICAgICAgICAgLy8gZmlsbCBidWZmZXIKLSAgICAgICAgICAgIHVpbnQ4X3QqIHEgPSAodWludDhfdCopIGItPmk4OwotICAgICAgICAgICAgc2l6ZV90IGNvdW50ID0gMDsKLQotICAgICAgICAgICAgaWYgKG1Qb3MgPCAoaW50KXNhbXBsZS0+c2l6ZSgpKSB7Ci0gICAgICAgICAgICAgICAgdWludDhfdCogcCA9IHNhbXBsZS0+ZGF0YSgpICsgbVBvczsKLSAgICAgICAgICAgICAgICBjb3VudCA9IHNhbXBsZS0+c2l6ZSgpIC0gbVBvczsKLSAgICAgICAgICAgICAgICBpZiAoY291bnQgPiBiLT5zaXplKSB7Ci0gICAgICAgICAgICAgICAgICAgIGNvdW50ID0gYi0+c2l6ZTsKLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgbWVtY3B5KHEsIHAsIGNvdW50KTsKLS8vICAgICAgICAgICAgICBBTE9HV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gICBtRm9ybWF0OwotICAgIGludCAgICAgICAgICAgICAgICAgbUZkOwotICAgIGludDY0X3QgICAgICAgICAgICAgbU9mZnNldDsKLSAgICBpbnQ2NF90ICAgICAgICAgICAgIG1MZW5ndGg7Ci0gICAgY2hhciogICAgICAgICAgICAgICBtVXJsOwotICAgIHNwPElNZW1vcnk+ICAgICAgICAgbURhdGE7Ci19OwotCi0vLyBzdG9yZXMgcGVuZGluZyBldmVudHMgZm9yIHN0b2xlbiBjaGFubmVscwotY2xhc3MgU291bmRFdmVudAotewotcHVibGljOgotICAgIFNvdW5kRXZlbnQoKSA6IG1DaGFubmVsSUQoMCksIG1MZWZ0Vm9sdW1lKDApLCBtUmlnaHRWb2x1bWUoMCksCi0gICAgICAgICAgICBtUHJpb3JpdHkoSURMRV9QUklPUklUWSksIG1Mb29wKDApLCBtUmF0ZSgwKSB7fQotICAgIHZvaWQgc2V0KGNvbnN0IHNwPFNhbXBsZT4mIHNhbXBsZSwgaW50IGNoYW5uZWxJRCwgZmxvYXQgbGVmdFZvbHVtZSwKLSAgICAgICAgICAgIGZsb2F0IHJpZ2h0Vm9sdW1lLCBpbnQgcHJpb3JpdHksIGludCBsb29wLCBmbG9hdCByYXRlKTsKLSAgICBzcDxTYW1wbGU+ICAgICAgc2FtcGxlKCkgeyByZXR1cm4gbVNhbXBsZTsgfQotICAgIGludCAgICAgICAgICAgICBjaGFubmVsSUQoKSB7IHJldHVybiBtQ2hhbm5lbElEOyB9Ci0gICAgZmxvYXQgICAgICAgICAgIGxlZnRWb2x1bWUoKSB7IHJldHVybiBtTGVmdFZvbHVtZTsgfQotICAgIGZsb2F0ICAgICAgICAgICByaWdodFZvbHVtZSgpIHsgcmV0dXJuIG1SaWdodFZvbHVtZTsgfQotICAgIGludCAgICAgICAgICAgICBwcmlvcml0eSgpIHsgcmV0dXJuIG1Qcmlvcml0eTsgfQotICAgIGludCAgICAgICAgICAgICBsb29wKCkgeyByZXR1cm4gbUxvb3A7IH0KLSAgICBmbG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lRPTkVHRU5fSU5GLAotICAgICAgICAgIHJlcGVhdFNlZ21lbnQ6IDAgfSwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyBUT05FX0RUTUZfNQotICAgICAgICB7IHNlZ21lbnRzOiB7IHsgZHVyYXRpb246IFRvbmVHZW5lcmF0b3I6OlRPTkVHRU5fSU5GLCB3YXZlRnJlcTogeyAxNDc3LCA3NzAsIDAgfSwgMCwgMCB9LAotICAgICAgICAgICAgICAgICAgICAgIHsgZHVyYXRpb246IDAgLCB3YXZlRnJlcTogeyAwIH0sIDAsIDB9fSwKLSAgICAgICAgICByZXBlYXRDbnQ6IFRvbmVHZW5lcmF0b3I6OlRPTkVHRU5fSU5GLAotICAgICAgICAgIHJlcGVhdFNlZ21lbnQ6IDAgfSwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyBUT05FX0RUTUZfNgotICAgICAgICB7IHNlZ21lbnRzOiB7IHsgZHVyYXRpb246IFRvbmVHZW5lcmF0b3I6OlRPTkVHRU5fSU5GLCB3YXZlRnJlcTogeyAxMjA5LCA4NTIsIDAgfSwgMCwgMCB9LAotICAgICAgICAgICAgICAgICAgICAgIHsgZHVyYXRpb246IDAgLCB3YXZlRnJlcTogeyAwIH0sIDAsIDB9fSwKLSAgICAgICAgICByZXBlYXRDbnQ6IFRvbmVHZW5lcmF0b3I6OlRPTkVHRU5fSU5GLAotICAgICAgICAgIHJlcGVhdFNlZ21lbnQ6IDAgfSwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyBUT05FX0RUTUZfNwotICAgICAgICB7IHNlZ21lbnRzOiB7IHsgZHVyYXRpb246IFRvbmVHZW5lcmF0b3I6OlRPTkVHRU5fSU5GLCB3YXZlRnJlcTogeyAxMzM2LCA4NTIsIDAgfSwgMCwgMCB9LAotICAgICAgICAgICAgICAgICAgICAgIHsgZHVyYXRpb246IDAgLCB3YXZlRnJlcTogeyAwIH0sIDAsIDB9fSwKLSAgICAgICAgICByZXBlYXRDbnQ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mVGcmVxOiB7IDAgfSwgMCwgMH19LAotICAgICAgICAgIHJlcGVhdENudDogVG9uZUdlbmVyYXRvcjo6VE9ORUdFTl9JTkYsCi0gICAgICAgICAgcmVwZWF0U2VnbWVudDogMCB9LCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vIFRPTkVfRFRNRl9DCi0gICAgICAgIHsgc2VnbWVudHM6IHsgeyBkdXJhdGlvbjogVG9uZUdlbmVyYXRvcjo6VE9ORUdFTl9JTkYsIHdhdmVGcmVxOiB7IDE2MzMsIDk0MSwgMCB9LCAwLCAwIH0sCi0gICAgICAgICAgICAgICAgICAgICAgeyBkdXJhdGlvbjogMCAsIHdhdmVGcmVxOiB7IDAgfSwgMCwgMH19LAotICAgICAgICAgIHJlcGVhdENudDogVG9uZUdlbmVyYXRvcjo6VE9ORUdFTl9JTkYsCi0gICAgICAgICAgcmVwZWF0U2VnbWVudDogMCB9LCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vIFRPTkVfRFRNRl9ECi0gICAgICAgIHsgc2VnbWVudHM6IHsgeyBkdXJhdGlvbjogVG9uZUdlbmVyYXRvcjo6VE9ORUdFTl9JTkYsIHdhdmVGcmVxOiB7IDQyNSwgMCB9LCAwLCAwIH0sCi0gICAgICAgICAgICAgICAgICAgICAgeyBkdXJhdGlvbjogMCAsIHdhdmVGcmVxOiB7IDAgfSwgMCwgMH19LAotICAgICAgICAgIHJlcGVhdENudDogVG9uZUdlbmVyYXRvcjo6VE9ORUdFTl9JTkYsCi0gICAgICAgICAgcmVwZWF0U2VnbWVudDogMCB9LCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vIFRPTkVfU1VQX0RJQUwKLSAgICAgICAgeyBzZWdtZW50czogeyB7IGR1cmF0aW9uOiA1MDAgLCB3YXZlRnJlcTogeyA0MjUsIDAgfSwgMCwgMH0sCi0gICAgICAgICAgICAgICAgICAgICAgeyBkdXJhdGlvbjogNTAwLCB3YXZlRnJlcTogeyAwIH0sIDAsIDB9LAotICAgICAgICAgICAgICAgICAgICAgICAgIHsgZHVyYXRpb246IDAgLCB3YXZlRnJlcTogeyAwIH0sIDAsIDB9fSwKLSAgICAgICAgICByZXBlYXRDbnQ6IFRvbmVHZW5lcmF0b3I6OlRPTkVHRU5fSU5GLAotICAgICAgICAgIHJlcGVhdFNlZ21lbnQ6IDAgfSwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyBUT05FX1NVUF9CVVNZCi0gICAgICAgIHsgc2VnbWVudHM6IHsgeyBkdXJhdGlvbjogMjAwLCB3YXZlRnJlcTogeyA0MjUsIDAgfSwgMCwgMCB9LAotICAgICAgICAgICAgICAgICAgICAgIHsgZHVyYXRpb246IDIwMCwgd2F2ZUZyZXE6IHsgMCB9LCAwLCAwIH0sCi0gICAgICAgICAgICAgICAgICAgICAgeyBkdXJhdGlvbjogMCAsIHdhdmVGcmVxOiB7IDAgfSwgMCwgMH19LAotICAgICAgICAgIHJlcGVhdENudDogVG9uZUdlbmVyYXRvcjo6VE9ORUdFTl9JTkYsCi0gICAgICAgICAgcmVwZWF0U2VnbWVudDogMCB9LCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vIFRPTkVfU1VQX0NPTkdFU1RJT04KLSAgICAgICAgeyBzZWdtZW50czogeyB7IGR1cmF0aW9uOiAyMDAsIHdhdmVGcmVxOiB7IDQyNSwgMCB9LCAwLCAwIH0sCi0gICAgICAgICAgICAgICAgICAgICAgeyBkdXJhdGlvbjogMCAsIHdhdmVGcmVxOiB7IDAgfSwgMCwgMH19LAotICAgICAgICAgIHJlcGVhdENudDogMCwKLSAgICAgICAgICByZXBlYXRTZWdtZW50OiAwIH0sICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gVE9ORV9TVVBfUkFESU9fQUNLCi0gICAgICAgIHsgc2VnbWVudHM6IHsgeyBkdXJhdGlvbjogMjAwLCB3YXZlRnJlcTogeyA0MjUsIDAgfSwgMCwgMH0sCi0gICAgICAgICAgICAgICAgICAgICAgeyBkdXJhdGlvbjogMjAwLCB3YXZlRnJlcTogeyAwIH0sIDAsIDB9LAotICAgICAgICAgICAgICAgICAgICAgIHsgZHVyYXRpb246IDAgLCB3YXZlRnJlcTogeyAwIH0sIDAsIDB9fSwKLSAgICAgICAgICByZXBlYXRDbnQ6IDIsCi0gICAgICAgICAgcmVwZWF0U2VnbWVudDogMCB9LCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vIFRPTkVfU1VQX1JBRElPX05PVEFWQUlMCi0gICAgICAgIHsgc2VnbWVudHM6IHsgeyBkdXJhdGlvbjogMzMwLCB3YXZlRnJlcTogeyA5NTAsIDE0MDAsIDE4MDAsIDAgfSwgMCwgMH0sCi0gICAgICAgICAgICAgICAgICAgICAgeyBkdXJhdGlvbjogMTAwMCwgd2F2ZUZyZXE6IHsgMCB9LCAwLCAwfSwKLSAgICAgICAgICAgICAgICAgICAgICB7IGR1cmF0aW9uOiAwICwgd2F2ZUZyZXE6IHsgMCB9LCAwLCAwfX0sCi0gICAgICAgICAgcmVwZWF0Q250OiBUb25lR2VuZXJhdG9yOjpUT05FR0VOX0lORiwKLSAgICAgICAgICByZXBlYXRTZWdtZW50OiAwIH0sICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gVE9ORV9TVVBfRVJST1IKLSAgICAgICAgeyBzZWdtZW50czogeyB7IGR1cmF0aW9uOiAyMDAsIHdhdmVGcmVxOiB7IDQyNSwgMCB9LCAwLCAwIH0sCi0gICAgICAgICAgICAgICAgICAgICAgeyBkdXJhdGlvbjogNjAwLCB3YXZlRnJlcTogeyAwIH0sIDAsIDAgfSwKLSAgICAgICAgICAgICAgICAgICAgICB7IGR1cmF0aW9uOiAyMDAsIHdhdmVGcmVxOiB7IDQyNSwgMCB9LCAwLCAwIH0sCi0gICAgICAgICAgICAgICAgICAgICAgeyBkdXJhdGlvbjogMzAwMCwgd2F2ZUZyZXE6IHsgMCB9LCAwLCAwIH0sCi0gICAgICAgICAgICAgICAgICAgICAgeyBkdXJhdGlvbjogMCAsIHdhdmVGcmVxOiB7IDAgfSwgMCwgMH19LAotICAgICAgICAgIHJlcGVhdENudDogVG9uZUdlbmVyYXRvcjo6VE9ORUdFTl9JTkYsCi0gICAgICAgICAgcmVwZWF0U2VnbWVudDogMCB9LCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vIFRPTkVfU1VQX0NBTExfV0FJVElORwotICAgICAgICB7IHNlZ21lbnRzOiB7IHsgZHVyYXRpb246IDEwMDAsIHdhdmVGcmVxOiB7IDQyNSwgMCB9LCAwLCAwIH0sCi0gICAgICAgICAgICAgICAgICAgICAgeyBkdXJhdGlvbjogNDAwMCwgd2F2ZUZyZXE6IHsgMCB9LCAwLCAwIH0sCi0gICAgICAgICAgICAgICAgICAgICAgeyBkdXJhdGlvbjogMCAsIHdhdmVGcmVxOiB7IDAgfSwgMCwgMH19LAotICAgICAgICAgIHJlcGVhdENudDogVG9uZUdlbmVyYXRvcjo6VE9ORUdFTl9JTkYsCi0gICAgICAgICAgcmVwZWF0U2VnbWVudDogMCB9LCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vIFRPTkVfU1VQX1JJTkdUT05FCi0gICAgICAgIHsgc2VnbWVudHM6IHsgeyBkdXJhdGlvbjogNDAsIHdhdmVGcmVxOiB7IDQwMCwgMTIwMCwgMCB9LCAwLCAwIH0sCi0gICAgICAgICAgICAgICAgICAgICAgeyBkdXJhdGlvbjogMCAsIHdhdmVGcmVxOiB7IDAgfSwgMCwgMH19LAotICAgICAgICAgIHJlcGVhdENudDogMCwKLSAgICAgICAgICByZXBlYXRTZWdtZW50OiAwIH0sICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gVE9ORV9QUk9QX0JFRVAKLSAgICAgICAgeyBzZWdtZW50czogeyB7IGR1cmF0aW9uOiAxMDAsIHdhdmVGcmVxOiB7IDEyMDAsIDAgfSwgMCwgMCB9LAotICAgICAgICAgICAgICAgICAgICAgIHsgZHVyYXRpb246IDEwMCwgd2F2ZUZyZXE6IHsgMCB9LCAwLCAwICB9LAotICAgICAgICAgICAgICAgICAgICAgIHsgZHVyYXRpb246IDAgLCB3YXZlRnJlcTogeyAwIH0sIDAsIDB9fSwKLSAgICAgICAgICByZXBlYXRDbnQ6IDEsCi0gICAgICAgICAgcmVwZWF0U2VnbWVudDogMCB9LCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vIFRPTkVfUFJPUF9BQ0sKLSAgICAgICAgeyBzZWdtZW50czogeyB7IGR1cmF0aW9uOiA0MDAsIHdhdmVGcmVxOiB7IDMwMCwgNDAwLCA1MDAsIDAgfSwgMCwgMCB9LAotICAgICAgICAgICAgICAgICAgICAgIHsgZHVyYXRpb246IDAgLCB3YXZlRnJlcTogeyAwIH0sIDAsIDB9fSwKLSAgICAgICAgICByZXBlYXRDbnQ6IDAsCi0gICAgICAgICAgcmVwZWF0U2VnbWVudDogMCB9LCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vIFRPTkVfUFJPUF9OQUNLCi0gICAgICAgIHsgc2VnbWVudHM6IHsgeyBkdXJhdGlvbjogMjAwLCB3YXZlRnJlcTogeyA0MDAsIDEyMDAsIDAgfSwgMCwgMCB9LAotICAgICAgICAgICAgICAgICAgICAgIHsgZHVyYXRpb246IDAgLCB3YXZlRnJlcTogeyAwIH0sIDAsIDB9fSwKLSAgICAgICAgICByZXBlYXRDbnQ6IDAsCi0gICAgICAgICAgcmVwZWF0U2VnbWVudDogMCB9LCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vIFRPTkVfUFJPUF9QUk9NUFQKLSAgICAgICAgeyBzZWdtZW50czogeyB7IGR1cmF0aW9uOiA0MCwgd2F2ZUZyZXE6IHsgNDAwLCAxMjAwLCAwIH0sIDAsIDAgfSwKLSAgICAgICAgICAgICAgICAgICAgICB7IGR1cmF0aW9uOiAyMDAsIHdhdmVGcmVxOiB7IDAgfSwgMCwgMCB9LAotICAgICAgICAgICAgICAgICAgICAgIHsgZHVyYXRpb246IDQwLCB3YXZlRnJlcTogeyA0MDAsIDEyMDAsIDAgfSwgMCwgMCB9LAotICAgICAgICAgICAgICAgICAgICAgIHsgZHVyYXRpb246IDAgLCB3YXZlRnJlcTogeyAwIH0sIDAsIDB9fSwKLSAgICAgICAgICByZXBlYXRDbnQ6IDAsCi0gICAgICAgICAgcmVwZWF0U2VnbWVudDogMCB9LCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gVE9ORV9QUk9QX0JFRVAyCi0gICAgICAgIHsgc2VnbWVudHM6IHsgeyBkdXJhdGlvbjogMjUwLCB3YXZlRnJlcTogeyA0NDAsIDAgfSwgMCwgMCB9LAotICAgICAgICAgICAgICAgICAgICAgIHsgZHVyYXRpb246IDI1MCwgd2F2ZUZyZXE6IHsgNjIwLCAwIH0sIDAsIDAgfSwKLSAgICAgICAgICAgICAgICAgICAgICB7IGR1cmF0aW9uOiAwICwgd2F2ZUZyZXE6IHsgMCB9LCAwLCAwIH19LAotICAgICAgICAgIHJlcGVhdENudDogVG9uZUdlbmVyYXRvcjo6VE9ORUdFTl9JTkYsCi0gICAgICAgICAgcmVwZWF0U2VnbWVudDogMCB9LCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vIFRPTkVfU1VQX0lOVEVSQ0VQVAotICAgICAgICB7IHNlZ21lbnRzOiB7IHsgZHVyYXRpb246IDI1MCwgd2F2ZUZyZXE6IHsgNDQwLCAwIH0sIDAsIDAgfSwKLSAgICAgICAgICAgICAgICAgICAgICB7IGR1cmF0aW9uOiAyNTAsIHdhdmVGcmVxOiB7IDYyMCwgMCB9LCAwLCAwIH0sCi0gICAgICAgICAgICAgICAgICAgICAgeyBkdXJhdGlvbjogMCAsIHdhdmVGcmVxOiB7IDAgfSwgMCwgMH19LAotICAgICAgICAgIHJlcGVhdENudDogNywKLSAgICAgICAgICByZXBlYXRTZWdtZW50OiAwIH0sICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyBUT05FX1NV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AwfX0sCi0gICAgICAgICAgcmVwZWF0Q250OiAzLAotICAgICAgICAgIHJlcGVhdFNlZ21lbnQ6IDAgfSwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyBUT05FX1NVUF9QSVAKLSAgICAgICAgeyBzZWdtZW50czoge3sgZHVyYXRpb246IFRvbmVHZW5lcmF0b3I6OlRPTkVHRU5fSU5GLCB3YXZlRnJlcTogeyA0MjUsIDAgfSwgMCwgMH0sCi0gICAgICAgICAgICAgICAgICAgICB7IGR1cmF0aW9uOiAwICwgd2F2ZUZyZXE6IHsgMCB9LCAwLCAwfX0sCi0gICAgICAgICAgcmVwZWF0Q250OiBUb25lR2VuZXJhdG9yOjpUT05FR0VOX0lORiwKLSAgICAgICAgICByZXBlYXRTZWdtZW50OiAwIH0sICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gVE9ORV9DRE1BX0RJQUxfVE9ORV9MSVRFCi0gICAgICAgIHsgc2VnbWVudHM6IHsgeyBkdXJhdGlvbjogMjAwMCwgd2F2ZUZyZXE6IHsgNDQwLCA0ODAsIDAgfSwgMCwgMCB9LAotICAgICAgICAgICAgICAgICAgICAgIHsgZHVyYXRpb246IDQwMDAsIHdhdmVGcmVxOiB7IDAgfSwgMCwgMCB9LAotICAgICAgICAgICAgICAgICAgICAgIHsgZHVyYXRpb246IDAgLCB3YXZlRnJlcTogeyAwIH0sIDAsIDB9fSwKLSAgICAgICAgICByZXBlYXRDbnQ6IFRvbmVHZW5lcmF0b3I6OlRPTkVHRU5fSU5GLAotICAgICAgICAgIHJlcGVhdFNlZ21lbnQ6IDAgfSwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyBUT05FX0NETUFfTkVUV09SS19VU0FfUklOR0JBQ0sKLSAgICAgICAgeyBzZWdtZW50czogeyB7IGR1cmF0aW9uOiAyNTAsIHdhdmVGcmVxOiB7IDQ0MCwgMCB9LCAwLCAwIH0sCi0gICAgICAgICAgICAgICAgICAgICAgeyBkdXJhdGlvbjogMjUwLCB3YXZlRnJlcTogeyA2MjAsIDAgfSwgMCwgMCB9LAotICAgICAgICAgICAgICAgICAgICAgIHsgZHVyYXRpb246IDAgLCB3YXZlRnJlcTogeyAwIH0sIDAsIDB9fSwKLSAgICAgICAgICByZXBlYXRDbnQ6ICBUb25lR2VuZXJhdG9yOjpUT05FR0VOX0lORiwKLSAgICAgICAgICByZXBlYXRTZWdtZW50OiAwIH0sICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyBUT05FX0NETUFfSU5URVJDRVBUCi0gICAgICAgIHsgc2VnbWVudHM6IHsgeyBkdXJhdGlvbjogMjUwLCB3YXZlRnJlcTogeyA0NDAsIDAgfSwgMCwgMCB9LAotICAgICAgICAgICAgICAgICAgICAgIHsgZHVyYXRpb246IDI1MCwgd2F2ZUZyZXE6IHsgNjIwLCAwIH0sIDAsIDAgfSwKLSAgICAgICAgICAgICAgICAgICAgICB7IGR1cmF0aW9uOiAwICwgd2F2ZUZyZXE6IHsgMCB9LCAwLCAwfX0sCi0gICAgICAgICAgcmVwZWF0Q250OiAgMCwKLSAgICAgICAgICByZXBlYXRTZWdtZW50OiAwIH0sICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyBUT05FX0NETUFfQUJCUl9JTlRFUkNFUFQKLSAgICAgICAgeyBzZWdtZW50czogeyB7IGR1cmF0aW9uOiAyNTAsIHdhdmVGcmVxOiB7IDQ4MCwgNjIwLCAwIH0sIDAsIDAgfSwKLSAgICAgICAgICAgICAgICAgICAgICB7IGR1cmF0aW9uOiAyNTAsIHdhdmVGcmVxOiB7IDAgfSwgMCwgMCB9LAotICAgICAgICAgICAgICAgICAgICAgIHsgZHVyYXRpb246IDAgLCB3YXZlRnJlcTogeyAwIH0sIDAsIDB9fSwKLSAgICAgICAgICByZXBlYXRDbnQ6IFRvbmVHZW5lcmF0b3I6OlRPTkVHRU5fSU5GLAotICAgICAgICAgIHJlcGVhdFNlZ21lbnQ6IDAgfSwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyBUT05FX0NETUFfUkVPUkRFUgotICAgICAgICB7IHNlZ21lbnRzOiB7IHsgZHVyYXRpb246IDI1MCwgd2F2ZUZyZXE6IHsgNDgwLCA2MjAsIDAgfSwgMCwgMCB9LAotICAgICAgICAgICAgICAgICAgICAgIHsgZHVyYXRpb246IDI1MCwgd2F2ZUZyZXE6IHsgMCB9LCAwLCAwIH0sCi0gICAgICAgICAgICAgICAgICAgICAgeyBkdXJhdGlvbjogMCAsIHdhdmVGcmVxOiB7IDAgfSwgMCwgMH19LAotICAgICAgICAgIHJlcGVhdENudDogNywKLSAgICAgICAgICByZXBlYXRTZWdtZW50OiAwIH0sICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gVE9ORV9DRE1BX0FCQlJfUkVPUkRFUgotICAgICAgICB7IHNlZ21lbnRzOiB7IHsgZHVyYXRpb246IDUwMCwgd2F2ZUZyZXE6IHsgNDgwLCA2MjAsIDAgfSwgMCwgMCB9LAotICAgICAgICAgICAgICAgICAgICAgIHsgZHVyYXRpb246IDUwMCwgd2F2ZUZyZXE6IHsgMCB9LCAwLCAwIH0sCi0gICAgICAgICAgICAgICAgICAgICAgeyBkdXJhdGlvbjogMCAsIHdhdmVGcmVxOiB7IDAgfSwgMCwgMH19LAotICAgICAgICAgIHJlcGVhdENudDogVG9uZUdlbmVyYXRvcjo6VE9ORUdFTl9JTkYsCi0gICAgICAgICAgcmVwZWF0U2VnbWVudDogMCB9LCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vIFRPTkVfQ0RNQV9ORVRXT1JLX0JVU1kKLSAgICAgICAgeyBzZWdtZW50czogeyB7IGR1cmF0aW9uOiAxMDAsIHdhdmVGcmVxOiB7IDM1MCwgNDQwLCAwIH0sIDAsIDAgfSwKLSAgICAgICAgICAgICAgICAgICAgICB7IGR1cmF0aW9uOiAxMDAsIHdhdmVGcmVxOiB7IDAgfSwgMCwgMCB9LAotICAgICAgICAgICAgICAgICAgICAgIHsgZHVyYXRpb246IDAgLCB3YXZlRnJlcTogeyAwIH0sIDAsIDB9fSwKLSAgICAgICAgICByZXBlYXRDbnQ6IDIsCi0gICAgICAgICAgcmVwZWF0U2VnbWVudDogMCB9LCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vIFRPTkVfQ0RNQV9DT05GSVJNCi0gICAgICAgIHsgc2VnbWVudHM6IHsgeyBkdXJhdGlvbjogNTAwLCB3YXZlRnJlcTogeyA2NjAsIDEwMDAsIDAgfSwgMCwgMCB9LAotICAgICAgICAgICAgICAgICAgICAgIHsgZHVyYXRpb246IDAgLCB3YXZlRnJlcTogeyAwIH0sIDAsIDB9fSwKLSAgICAgICAgICByZXBlYXRDbnQ6IDAsCi0gICAgICAgICAgcmVwZWF0U2VnbWVudDogMCB9LCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vIFRPTkVfQ0RNQV9BTlNXRVIKLSAgICAgICAgeyBzZWdtZW50czogeyB7IGR1cmF0aW9uOiAzMDAsIHdhdmVGcmVxOiB7IDQ0MCwgMCB9LCAwLCAwIH0sCi0gICAgICAgICAgICAgICAgICAgICAgeyBkdXJhdGlvbjogMCAsIHdhdmVGcmVxOiB7IDAgfSwgMCwgMH19LAotICAgICAgICAgIHJlcGVhdENudDogMCwKLSAgICAgICAgICByZXBlYXRTZWdtZW50OiAwIH0sICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gVE9ORV9DRE1BX05FVFdPUktfQ0FMTFdBSVRJTkcKLSAgICAgICAgeyBzZWdtZW50czogeyB7IGR1cmF0aW9uOiAxMDAsIHdhdmVGcmVxOiB7IDQ4MCwgMCB9LCAwLCAwIH0sCi0gICAgICAgICAgICAgICAgICAgICAgeyBkdXJhdGlvbjogMTAwLCB3YXZlRnJlcTogeyAwIH0sIDAsIDAgfSwKLSAgICAgICAgICAgICAgICAgICAgICB7IGR1cmF0aW9uOiAwICwgd2F2ZUZyZXE6IHsgMCB9LCAwLCAwfX0sCi0gICAgICAgICAgcmVwZWF0Q250OiAzLAotICAgICAgICAgIHJlcGVhdFNlZ21lbnQ6IDAgfSwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyBUT05FX0NETUFfUElQCi0KLSAgICAgICAgeyBzZWdtZW50czogeyB7IGR1cmF0aW9uOiAzMiwgd2F2ZUZyZXE6IHsgMjA5MSwgMH0sIDAsIDAgfSwKLSAgICAgICAgICAgICAgICAgICAgICB7IGR1cmF0aW9uOiA2NCwgd2F2ZUZyZXE6IHsgMjU1NiwgMH0sIDE5LCAwfSwKLSAgICAgICAgICAgICAgICAgICAgICB7IGR1cmF0aW9uOiAzMiwgd2F2ZUZyZXE6IHsgMjA5MSwgMH0sIDAsIDB9LAotICAgICAgICAgICAgICAgICAgICAgIHsgZHVyYXRpb246IDQ4LCB3YXZlRnJlcTogeyAyNTU2LCAwfSwgMCwgMH0sCi0gICAgICAgICAgICAgICAgICAgICAgeyBkdXJhdGlvbjogNDAwMCwgd2F2ZUZyZXE6IHsgMCB9LCAwLCAwfSwKLSAgICAgICAgICAgICAgICAgICAgICB7IGR1cmF0aW9uOiAwLCAgd2F2ZUZyZXE6IHsgMCB9LCAwLCAwfX0sCi0gICAgICAgICAgcmVwZWF0Q250OiAwLAotICAgICAgICAgIHJlcGVhdFNlZ21lbnQ6IDAgfSwgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vIFRPTkVfQ0RNQV9DQUxMX1NJR05BTF9JU0ROX05PUk1BTAotICAgICAgICB7IHNlZ21lbnRzOiB7IHsgZHVyYXRpb246IDMyLCB3YXZlRnJlcTogeyAyMDkxLCAwfSwgMCwgMCB9LAotICAgICAgICAgICAgICAgICAgICAgIHsgZHVyYXRpb246IDY0LCB3YXZlRnJlcTogeyAyNTU2LCAwfSwgNywgMCB9LAotICAgICAgICAgICAgICAgICAgICAgIHsgZHVyYXRpb246IDMyLCB3YXZlRnJlcTogeyAyMDkxLCAwfSwgMCwgMCB9LAotICAgICAgICAgICAgICAgICAgICAgIHsgZH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gMjA5MSwgMH0sIDAsIDAgfSwKLSAgICAgICAgICAgICAgICAgICAgICB7IGR1cmF0aW9uOiA2NCwgd2F2ZUZyZXE6IHsgMjU1NiwgMH0sIDMsIDQgfSwKLSAgICAgICAgICAgICAgICAgICAgICB7IGR1cmF0aW9uOiAxNiwgd2F2ZUZyZXE6IHsgMjA5MSwgMH0sIDAsIDAgfSwKLSAgICAgICAgICAgICAgICAgICAgICB7IGR1cmF0aW9uOiAyMDAsIHdhdmVGcmVxOiB7IDAgfSwgICAgIDAsIDAgfSwKLSAgICAgICAgICAgICAgICAgICAgICB7IGR1cmF0aW9uOiAwLCAgIHdhdmVGcmVxOiB7IDAgfSwgICAgIDAsIDAgfSB9LAotICAgICAgICAgIHJlcGVhdENudDogMCwKLSAgICAgICAgICByZXBlYXRTZWdtZW50OiAwIH0sICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vIFRPTkVfQ0RNQV9DQUxMX1NJR05BTF9JU0ROX1NQX1BSSQotICAgICAgICB7IHNlZ21lbnRzOiB7IHsgZHVyYXRpb246IDAsICB3YXZlRnJlcTogeyAwIH0sIDAsIDB9IH0sCi0gICAgICAgICAgcmVwZWF0Q250OiAwLAotICAgICAgICAgIHJlcGVhdFNlZ21lbnQ6IDAgfSwgICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gVE9ORV9DRE1BX0NBTExfU0lHTkFMX0lTRE5fUEFUMwotICAgICAgICB7IHNlZ21lbnRzOiB7IHsgZHVyYXRpb246IDMyLCB3YXZlRnJlcTogeyAyMDkxLCAwIH0sIDAsIDAgfSwKLSAgICAgICAgICAgICAgICAgICAgICB7IGR1cmF0aW9uOiA2NCwgd2F2ZUZyZXE6IHsgMjU1NiwgMCB9LCA0LCAwIH0sCi0gICAgICAgICAgICAgICAgICAgICAgeyBkdXJhdGlvbjogMjAsIHdhdmVGcmVxOiB7IDIwOTEsIDAgfSwgMCwgMCB9LAotICAgICAgICAgICAgICAgICAgICAgIHsgZHVyYXRpb246IDAsICB3YXZlRnJlcTogeyAwIH0gICAgICAsIDAsIDAgfSB9LAotICAgICAgICAgIHJlcGVhdENudDogMCwKLSAgICAgICAgICByZXBlYXRTZWdtZW50OiAwIH0sICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyBUT05FX0NETUFfQ0FMTF9TSUdOQUxfSVNETl9QSU5HX1JJTkcKLSAgICAgICAgeyBzZWdtZW50czogeyB7IGR1cmF0aW9uOiAwLCAgd2F2ZUZyZXE6IHsgMCB9LCAwLCAwfSB9LAotICAgICAgICAgIHJlcGVhdENudDogMCwKLSAgICAgICAgICByZXBlYXRTZWdtZW50OiAwIH0sICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyBUT05FX0NETUFfQ0FMTF9TSUdOQUxfSVNETl9QQVQ1Ci0gICAgICAgIHsgc2VnbWVudHM6IHsgeyBkdXJhdGlvbjogMCwgIHdhdmVGcmVxOiB7IDAgfSwgMCwgMH0gfSwKLSAgICAgICAgICByZXBlYXRDbnQ6IDAsCi0gICAgICAgICAgcmVwZWF0U2VnbWVudDogMCB9LCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gVE9ORV9DRE1BX0NBTExfU0lHTkFMX0lTRE5fUEFUNgotICAgICAgICB7IHNlZ21lbnRzOiB7IHsgZHVyYXRpb246IDAsICB3YXZlRnJlcTogeyAwIH0sIDAsIDB9IH0sCi0gICAgICAgICAgcmVwZWF0Q250OiAwLAotICAgICAgICAgIHJlcGVhdFNlZ21lbnQ6IDAgfSwgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vIFRPTkVfQ0RNQV9DQUxMX1NJR05BTF9JU0ROX1BBVDcKLQotICAgICAgICB7IHNlZ21lbnRzOiB7IHsgZHVyYXRpb246IDI1LCB3YXZlRnJlcTogeyAzNzAwLCAwIH0sIDAsIDAgfSwKLSAgICAgICAgICAgICAgICAgICAgICB7IGR1cmF0aW9uOiAyNSwgd2F2ZUZyZXE6IHsgNDAwMCwgMCB9LCAzOSwgMCB9LAotICAgICAgICAgICAgICAgICAgICAgIHsgZHVyYXRpb246IDQwMDAsIHdhdmVGcmVxOiB7IDAgfSwgICAgIDAsIDAgfSwKLSAgICAgICAgICAgICAgICAgICAgICB7IGR1cmF0aW9uOiAwLCAgICB3YXZlRnJlcTogeyAwIH0sICAgICAwLCAwIH0gfSwKLSAgICAgICAgICByZXBlYXRDbnQ6IFRvbmVHZW5lcmF0b3I6OlRPTkVHRU5fSU5GLAotICAgICAgICAgIHJlcGVhdFNlZ21lbnQ6IDAgfSwgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyBUT05FX0NETUFfSElHSF9MCi0gICAgICAgIHsgc2VnbWVudHM6IHsgeyBkdXJhdGlvbjogMjUsIHdhdmVGcmVxOiB7IDI2MDAsIDAgfSwgMCwgMCB9LAotICAgICAgICAgICAgICAgICAgICAgIHsgZHVyYXRpb246IDI1LCB3YXZlRnJlcTogeyAyOTAwLCAwIH0sIDM5LCAwIH0sCi0gICAgICAgICAgICAgICAgICAgICAgeyBkdXJhdGlvbjogNDAwMCwgd2F2ZUZyZXE6IHsgMCB9LCAgICAgMCwgMCB9LAotICAgICAgICAgICAgICAgICAgICAgIHsgZHVyYXRpb246IDAsICAgIHdhdmVGcmVxOiB7IDAgfSwgICAgIDAsIDAgfSB9LAotICAgICAgICAgIHJlcGVhdENudDogVG9uZUdlbmVyYXRvcjo6VE9ORUdFTl9JTkYsCi0gICAgICAgICAgcmVwZWF0U2VnbWVudDogMCB9LCAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vIFRPTkVfQ0RNQV9NRURfTAotICAgICAgICB7IHNlZ21lbnRzOiB7IHsgZHVyYXRpb246IDI1LCB3YXZlRnJlcTogeyAxMzAwLCAwIH0sIDAsIDAgfSwKLSAgICAgICAgICAgICAgICAgICAgICB7IGR1cmF0aW9uOiAyNSwgd2F2ZUZyZXE6IHsgMTQ1MCwgMCB9LCAzOSwgMCB9LAotICAgICAgICAgICAgICAgICAgICAgIHsgZHVyYXRpb246ID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gICAgICAgICAgICAgICAgIHsgZHVyYXRpb246IDAsIHdhdmVGcmVxOiB7IDAgfSwgMCwgMCB9fSwKLSAgICAgICAgICByZXBlYXRDbnQ6IFRvbmVHZW5lcmF0b3I6OlRPTkVHRU5fSU5GLAotICAgICAgICAgIHJlcGVhdFNlZ21lbnQ6IDAgfSwgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyBUT05FX0NETUFfTUVEX1NTCi0gICAgICAgIHsgc2VnbWVudHM6IHsgeyBkdXJhdGlvbjogMjUsIHdhdmVGcmVxOiB7IDEzMDAsIDAgfSwgMCwgMCB9LAotICAgICAgICAgICAgICAgICAgICAgIHsgZHVyYXRpb246IDI1LCB3YXZlRnJlcTogeyAxNDUwLCAwIH0sIDE1LCAwIH0sCi0gICAgICAgICAgICAgICAgICAgICAgeyBkdXJhdGlvbjogNDAwLCB3YXZlRnJlcTogeyAwIH0sIDAsIDAgfSwKLSAgICAgICAgICAgICAgICAgICAgICB7IGR1cmF0aW9uOiAwLCB3YXZlRnJlcTogeyAwIH0sIDAsIDAgfX0sCi0gICAgICAgICAgcmVwZWF0Q250OiBUb25lR2VuZXJhdG9yOjpUT05FR0VOX0lORiwKLSAgICAgICAgICByZXBlYXRTZWdtZW50OiAwIH0sICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gVE9ORV9DRE1BX0xPV19TUwotICAgICAgICB7IHNlZ21lbnRzOiB7IHsgZHVyYXRpb246IDI1LCB3YXZlRnJlcTogeyAzNzAwLCAwIH0sIDAsIDAgfSwKLSAgICAgICAgICAgICAgICAgICAgICB7IGR1cmF0aW9uOiAyNSwgd2F2ZUZyZXE6IHsgNDAwMCwgMCB9LCA3LCAwIH0sCi0gICAgICAgICAgICAgICAgICAgICAgeyBkdXJhdGlvbjogMjAwLCB3YXZlRnJlcTogeyAwIH0sIDAsIDAgfSwKLSAgICAgICAgICAgICAgICAgICAgICB7IGR1cmF0aW9uOiAyNSwgd2F2ZUZyZXE6IHsgMzcwMCwgMCB9LCAwLCAwIH0sCi0gICAgICAgICAgICAgICAgICAgICAgeyBkdXJhdGlvbjogMjUsIHdhdmVGcmVxOiB7IDQwMDAsIDAgfSwgNywgMyB9LAotICAgICAgICAgICAgICAgICAgICAgIHsgZHVyYXRpb246IDIwMCwgd2F2ZUZyZXE6IHsgMCB9LCAwLCAwIH0sCi0gICAgICAgICAgICAgICAgICAgICAgeyBkdXJhdGlvbjogMjUsIHdhdmVGcmVxOiB7IDM3MDAsIDAgfSwgMCwgMCB9LAotICAgICAgICAgICAgICAgICAgICAgIHsgZHVyYXRpb246IDI1LCB3YXZlRnJlcTogeyA0MDAwLCAwIH0sIDE1LCA2IH0sCi0gICAgICAgICAgICAgICAgICAgICAgeyBkdXJhdGlvbjogNDAwMCwgd2F2ZUZyZXE6IHsgMCB9LCAwLCAwIH0sCi0gICAgICAgICAgICAgICAgICAgICAgeyBkdXJhdGlvbjogMCwgd2F2ZUZyZXE6IHsgMCB9LCAwLCAwIH19LAotICAgICAgICAgIHJlcGVhdENudDogVG9uZUdlbmVyYXRvcjo6VE9ORUdFTl9JTkYsCi0gICAgICAgICAgcmVwZWF0U2VnbWVudDogMCB9LCAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vIFRPTkVfQ0RNQV9ISUdIX1NTTAotICAgICAgICB7IHNlZ21lbnRzOiB7IHsgZHVyYXRpb246IDI1LCB3YXZlRnJlcTogeyAyNjAwLCAwIH0sIDAsIDAgfSwKLSAgICAgICAgICAgICAgICAgICAgICB7IGR1cmF0aW9uOiAyNSwgd2F2ZUZyZXE6IHsgMjkwMCwgMCB9LCA3LCAwIH0sCi0gICAgICAgICAgICAgICAgICAgICAgeyBkdXJhdGlvbjogMjAwLCB3YXZlRnJlcTogeyAwIH0sIDAsIDAgfSwKLSAgICAgICAgICAgICAgICAgICAgICB7IGR1cmF0aW9uOiAyNSwgd2F2ZUZyZXE6IHsgMjYwMCwgMCB9LCAwLCAwIH0sCi0gICAgICAgICAgICAgICAgICAgICAgeyBkdXJhdGlvbjogMjUsIHdhdmVGcmVxOiB7IDI5MDAsIDAgfSwgNywgMyB9LAotICAgICAgICAgICAgICAgICAgICAgIHsgZHVyYXRpb246IDIwMCwgd2F2ZUZyZXE6IHsgMCB9LCAwLCAwIH0sCi0gICAgICAgICAgICAgICAgICAgICAgeyBkdXJhdGlvbjogMjUsIHdhdmVGcmVxOiB7IDI2MDAsIDAgfSwgMCwgMCB9LAotICAgICAgICAgICAgICAgICAgICAgIHsgZHVyYXRpb246IDI1LCB3YXZlRnJlcTogeyAyOTAwLCAwIH0sIDE1LCA2IH0sCi0gICAgICAgICAgICAgICAgICAgICAgeyBkdXJhdGlvbjogNDAwMCwgd2F2ZUZyZXE6IHsgMCB9LCAwLCAwIH0sCi0gICAgICAgICAgICAgICAgICAgICAgeyBkdXJhdGlvbjogMCwgd2F2ZUZyZXE6IHsgMCB9LCAwLCAwIH19LAotICAgICAgICAgIHJlcGVhdENudDogVG9uZUdlbmVyYXRvcjo6VE9ORUdFTl9JTkYsCi0gICAgICAgICAgcmVwZWF0U2VnbWVudDogMCB9LCAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vIFRPTkVfQ0RNQV9NRURfU1NMCi0gICAgICAgIHsgc2VnbWVudHM6IHsgeyBkdXJhdGlvbjogMjUsIHdhdmVGcmVxOiB7IDEzMDAsIDAgfSwgMCwgMCB9LAotICAgICAgICAgICAgICAgICAgICAgIHsgZHVyYXRpb246IDI1LCB3YXZlRnJlcTogeyAxNDUwLCAwIH0sIDcsIDAgfSwKLSAgICAgICAgICAgICAgICAgICAgICB7IGR1cmF0aW9uOiAyMDAsIHdhdmVGcmVxOiB7IDAgfSwgMCwgMCB9LAotICAgICAgICAgICAgICAgICAgICAgIHsgZHVyYXRpb246IDI1LCB3YXZlRnJlcTogeyAxMzAwLCAwIH0sIDAsIDAgfSwKLSAgICAgICAgICAgICAgICAgICAgICB7IGR1cmF0aW9uOiAyNSwgd2F2ZUZyZXE6IHsgMTQ1MCwgMCB9LCA3LCAzIH0sCi0gICAgICAgICAgICAgICAgICAgICAgeyBkdXJhdGlvbjogMjAwLCB3YXZlRnJlcTogeyAwIH0sIDAsIDAgfSwKLSAgICAgICAgICAgICAgICAgICAgICB7IGR1cmF0aW9uOiAyNSwgd2F2ZUZyZXE6IHsgMTMwMCwgMCB9LCAwLCAwIH0sCi0gICAgICAgICAgICAgICAgICAgICAgeyBkdXJhdGlvbjogMjUsIHdhdmVGcmVxOiB7IDE0NTAsIDAgfSwgMTUsIDYgfSwKLSAgICAgICAgICAgICAgICAgICAgICB7IGR1cmF0aW9uOiA0MDAwLCB3YXZlRnJlcTogeyAwIH0sIDAsIDAgfSwKLSAgICAgICAgICAgICAgICAgICAgICB7IGR1cmF0aW9uOiAwLCB3YXZlRnJlcTogeyAwIH0sIDAsIDAgfX0sCi0gICAgICAgICAgcmVwZWF0Q250OiBUb25lR2VuZXJhdG9yOjpUT05FR0VOX0lORiwKLSAgICAgICAgICByZXBlYXRTZWdtZW50OiAwIH0sICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gVE9ORV9DRE1BX0xPV19TU0wKLSAgICAgICAgeyBzZWdtZW50czogeyB7IGR1cmF0aW9uOiAyNSwgd2F2ZUZyZXE6IHsgMzcwMCwgMCB9LCAwLCAwIH0sCi0gICAgICAgICAgICAgICAgICAgICAgeyBkdXJhdGlvbjogMjUsIHdhdmVGcmVxOiB7IDQwMDAsIDAgfSwgMTksIDAgfSwKLSAgICAgICAgICAgICAgICAgICAgICB7IGR1cmF0aW9uOiAxMDAwLCB3YXZlRnJlcTogeyAwIH0sIDAsIDAgfSwKLSAgICAgICAgICAgICAgICAgICAgICB7IGR1cmF0aW9uOiAyNSwgd2F2ZUZyZXE6IHsgMzcwMCwgMCB9LCAwLCAwIH0sCi0gICAgICAgICAgICAgICAgICAgICAgeyBkdXJhdGlvbjogMjUsIHdhdmVGcmVxOiB7IDQwMDAsIDAgfSwgMTksIDMgfSwKLSAgICAgICAgICAgICAgICAgICAgICB7IGR1cmF0aW9uOiAzMDAwLCB3YXZlRnJlcTogeyAwIH0sIDAsIDAgfSwKLSAgICAgICAgICAgICAgICAgICAgICB7IGR1cmF0aW9uOiAwLCB3YXZlRnJlcTogeyAwIH0sIDAsIDAgfX0sCi0gICAgICAgICAgcmVwZWF0Q250OiBUb25lR2VuZXJhdG9yOjpUT05FR0VOX0lORiwKLSAgICAgICAgICByZXBlYXRTZWdtZW50OiAwIH0sICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gVE9ORV9DRE1BX0hJR0hfU1NfMgotICAgICAgICB7IHNlZ21lbnRzOiB7IHsgZHVyYXRpb246IDI1LCB3YXZlRnJlcTogeyAyNjAwLCAwIH0sIDAsIDAgfSwKLSAgICAgICAgICAgICAgICAgICAgICB7IGR1cmF0aW9uOiAyNSwgd2F2ZUZyZXE6IHsgMjkwMCwgMCB9LCAxOSwgMCB9LAotICAgICAgICAgICAgICAgICAgICAgIHsgZHVyYXRpb246IDEwMDAsIHdhdmVGcmVxOiB7IDAgfSwgMCwgMCB9LAotICAgICAgICAgICAgICAgICAgICAgIHsgZHVyYXRpb246IDI1LCB3YXZlRnJlcTogeyAyNjAwLCAwIH0sIDAsIDAgfSwKLSAgICAgICAgICAgICAgICAgICAgICB7IGR1cmF0aW9uOiAyNSwgd2F2ZUZyZXE6IHsgMjkwMCwgMCB9LCAxOSwgMyB9LAotICAgICAgICAgICAgICAgICAgICAgIHsgZHVyYXRpb246IDMwMDAsIHdhdmVGcmVxOiB7IDAgfSwgMCwgMCB9LAotICAgICAgICAgICAgICAgICAgICAgIHsgZHVyYXRpb246IDAsIHdhdmVGcmVxOiB7IDAgfSwgMCwgMCB9fSwKLSAgICAgICAgICByZXBlYXRDbnQ6IFRvbmVHZW5lcmF0b3I6OlRPTkVHRU5fSU5GLAotICAgICAgICAgIHJlcGVhdFNlZ21lbnQ6IDAgfSwgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyBUT05FX0NETUFfTUVEX1NTXzIKLSAgICAgICAgeyBzZWdtZW50czogeyB7IGR1cmF0aW9uOiAyNSwgd2F2ZUZyZXE6IHsgMTMwMCwgMCB9LCAwLCAwIH0sCi0gICAgICAgICAgICAgICAgICAgICAgeyBkdXJhdGlvbjogMjUsIHdhdmVGcmVxOiB7IDE0NTAsIDAgfSwgMTksIDAgfSwKLSAgICAgICAgICAgICAgICAgICAgICB7IGR1cmF0aW9uOiAxMDAwLCB3YXZlRnJlcTogeyAwIH0sIDAsIDAgfSwKLSAgICAgICAgICAgICAgICAgICAgICB7IGR1cmF0aW9uOiAyNSwgd2F2ZUZyZXE6IHsgMTMwMCwgMCB9LCAwLCAwIH0sCi0gICAgICAgICAgICAgICAgICAgICAgeyBkdXJhdGlvbjogMjUsIHdhdmVGcmVxOiB7IDE0NTAsIDAgfSwgMTksIDMgfSwKLSAgICAgICAgICAgICAgICAgICAgICB7IGR1cmF0aW9uOiAzMDAwLCB3YXZlRnJlcTogeyAwIH0sIDAsIDAgfSwKLSAgICAgICAgICAgICAgICAgICAgICB7IGR1cmF0aW9uOiAwLCB3YXZlRnJlcTogeyAwIH0sIDAsIDAgfX0sCi0gICAgICAgICAgcmVwZWF0Q250OiBUb25lR2VuZXJhdG9yOjpUT05FR0VOX0lORiwKLSAgICAgICAgICByZXBlYXRTZWdtZW50OiAwIH0sICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gVE9ORV9DRE1BX0xPV19TU18yCi0gICAgICAgIHsgc2VnbWVudHM6IHsgeyBkdXJhdGlvbjogMjUsIHdhdmVGcmVxOiB7IDM3MDAsIDAgfSwgMCwgMCB9LAotICAgICAgICAgICAgICAgICAgICAgIHsgZHVyYXRpb246IDI1LCB3YXZlRnJlcTogeyA0MDAwLCAwIH0sIDksIDAgfSwKLSAgICAgICAgICAgICAgICAgICAgICB7IGR1cmF0aW9uOiA1MDAsIHdhdmVGcmVxOiB7IDAgfSwgMCwgMCB9LAotICAgICAgICAgICAgICAgICAgICAgIHsgZHVyYXRpb246IDI1LCB3YXZlRnJlcTogeyAzNzAwLCAwIH0sIDAsIDAgfSwKLSAgICAgICAgICAgICAgICAgICAgICB7IGR1cmF0aW9uOiAyNSwgd2F2ZUZyZXE6IHsgNDAwMCwgMCB9LCAxOSwgMyB9LAotICAgICAgICAgICAgICAgICAgICAgIHsgZHVyYXRpb246IDUwMCwgd2F2ZUZyZXE6IHsgMCB9LCAwLCAwIH0sCi0gICAgICAgICAgICAgICAgICAgICAgeyBkdXJhdGlvbjogMjUsIHdhdmVGcmVxOiB7IDM3MDAsIDAgfSwgMCwgMCB9LAotICAgICAgICAgICAgICAgICAgICAgIHsgZHVyYXRpb246IDI1LCB3YXZlRnJlcTogeyA0MDAwLCAwIH0sIDksIDYgfSwKLSAgICAgICAgICAgICAgICAgICAgICB7IGR1cmF0aW9uOiAzMDAwLCB3YXZlRnJlcTogeyAwIH0sIDAsIDAgfSwKLSAgICAgICAgICAgICAgICAgICAgICB7IGR1cmF0aW9uOiAwLCB3YXZlRnJlcTogeyAwIH0sIDAsIDAgfX0sCi0gICAgICAgICAgcmVwZWF0Q250OiBUb25lR2VuZXJhdG9yOjpUT05FR0VOX0lORiwKLSAgICAgICAgICByZXBlYXRTZWdtZW50OiAwIH0sICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gVE9ORV9DRE1BX0hJR0hfU0xTCi0gICAgICAgIHsgc2VnbWVudHM6IHsgeyBkdXJhdGlvbjogMjUsIHdhdmVGcmVxOiB7IDI2MDAsIDAgfSwgMCwgMCB9LAotICAgICAgICAgICAgICAgICAgICAgIHsgZHVyYXRpb246IDI1LCB3YXZlRnJlcTogeyAyOTAwLCAwIH0sIDksIDAgfSwKLSAgICAgICAgICAgICAgICAgICAgICB7IGR1cmF0aW9uOiA1MDAsIHdhdmVGcmVxOiB7IDAgfSwgMCwgMCB9LAotICAgICAgICAgICAgICAgICAgICAgIHsgZHVyYXRpb246IDI1LCB3YXZlRnJlcTogeyAyNjAwLCAwIH0sIDAsIDAgfSwKLSAgICAgICAgICAgICAgICAgICAgICB7IGR1cmF0aW9uOiAyNSwgd2F2ZUZyZXE6IHsgMjkwMCwgMCB9LCAxOSwgMyB9LAotICAgICAgICAgICAgICAgICAgICAgIHsgZHVyYXRpb246IDUwMCwgd2F2ZUZyZXE6IHsgMCB9LCAwLCAwIH0sCi0gICAgICAgICAgICAgICAgICAgICAgeyBkdXJhdGlvbjogMjUsIHdhdmVGcmVxOiB7IDI2MDAsIDAgfSwgMCwgMCB9LAotICAgICAgICAgICAgICAgICAgICAgIHsgZHVyYXRpb246IDI1LCB3YXZlRnJlcTogeyAyOTAwLCAwIH0sIDksIDYgfSwKLSAgICAgICAgICAgICAgICAgICAgICB7IGR1cmF0aW9uOiAzMDAwLCB3YXZlRnJlcTogeyAwIH0sIDAsIDAgfSwKLSAgICAgICAgICAgICAgICAgICAgICB7IGR1cmF0aW9uOiAwLCB3YXZlRnJlcTogeyAwIH0sIDAsIDAgfX0sCi0gICAgICAgICAgcmVwZWF0Q250OiBUb25lR2VuZXJhdG9yOjpUT05FR0VOX0lORiwKLSAgICAgICAgICByZXBlYXRTZWdtZW50OiAwIH0sICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gVE9ORV9DRE1BX01FRF9TTFMKLSAgICAgICAgeyBzZWdtZW50czogeyB7IGR1cmF0aW9uOiAyNSwgd2F2ZUZyZXE6IHsgMTMwMCwgMCB9LCAwLCAwIH0sCi0gICAgICAgICAgICAgICAgICAgICAgeyBkdXJhdGlvbjogMjUsIHdhdmVGcmVxOiB7IDE0NTAsIDAgfSwgOSwgMCB9LAotICAgICAgICAgICAgICAgICAgICAgIHsgZHVyYXRpb246IDUwMCwgd2F2ZUZyZXE6IHsgMCB9LCAwLCAwIH0sCi0gICAgICAgICAgICAgICAgICAgICAgeyBkdXJhdGlvbjogMjUsIHdhdmVGcmVxOiB7IDEzMDAsIDAgfSwgMCwgMCB9LAotICAgICAgICAgICAgICAgICAgICAgIHsgZHVyYXRpb246IDI1LCB3YXZlRnJlcTogeyAxNDUwLCAwIH0sIDE5LCAzIH0sCi0gICAgICAgICAgICAgICAgICAgICAgeyBkdXJhdGlvbjogNTAwLCB3YXZlRnJlcTogeyAwIH0sIDAsIDAgfSwKLSAgICAgICAgICAgICAgICAgICAgICB7IGR1cmF0aW9uOiAyNSwgd2F2ZUZyZXE6IHsgMTMwMCwgMCB9LCAwLCAwIH0sCi0gICAgICAgICAgICAgICAgICAgICAgeyBkdXJhdGlvbjogMjUsIHdhdmVGcmVxOiB7IDE0NTAsIDAgfSwgOSwgNiB9LAotICAgICAgICAgICAgICAgICAgICAgIHsgZHVyYXRpb246IDMwMDAsIHdhdmVGcmVxOiB7IDAgfSwgMCwgMCB9LAotICAgICAgICAgICAgICAgICAgICAgIHsgZHVyYXRpb246IDAsIHdhdmVGcmVxOiB7IDAgfSwgMCwgMCB9fSwKLSAgICAgICAgICByZXBlYXRDbnQ6IFRvbmVHZW5lcmF0b3I6OlRPTkVHRU5fSU5GLAotICAgICAgICAgIHJlcGVhdFNlZ21lbnQ6IDAgfSwgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyBUT05FX0NETUFfTE9XX1NMUwotICAgICAgICB7IHNlZ21lbnRzOiB7IHsgZHVyYXRpb246IDI1LCB3YXZlRnJlcTogeyAzNzAwLCAwIH0sIDAsIDAgfSwKLSAgICAgICAgICAgICAgICAgICAgICB7IGR1cmF0aW9uOiAyNSwgd2F2ZUZyZXE6IHsgNDAwMCwgMCB9LCA5LCAwIH0sCi0gICAgICAgICAgICAgICAgICAgICAgeyBkdXJhdGlvbjogNTAwLCB3YXZlRnJlcTogeyAwIH0sIDAsIDAgfSwKLSAgICAgICAgICAgICAgICAgICAgICB7IGR1cmF0aW9uOiAyNSwgd2F2ZUZyZXE6IHsgMzcwMCwgMCB9LCAwLCAwIH0sCi0gICAgICAgICAgICAgICAgICAgICAgeyBkdXJhdGlvbjogMjUsIHdhdmVGcmVxOiB7IDQwMDAsIDAgfSwgOSwgMyB9LAotICAgICAgICAgICAgICAgICAgICAgIHsgZ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CAwIH0sCi0gICAgICAgICAgICAgICAgICAgICAgeyBkdXJhdGlvbjogMjUsIHdhdmVGcmVxOiB7IDI2MDAsIDAgfSwgMCwgMCB9LAotICAgICAgICAgICAgICAgICAgICAgIHsgZHVyYXRpb246IDI1LCB3YXZlRnJlcTogeyAyOTAwLCAwIH0sIDksIDMgfSwKLSAgICAgICAgICAgICAgICAgICAgICB7IGR1cmF0aW9uOiA1MDAsIHdhdmVGcmVxOiB7IDAgfSwgMCwgMCB9LAotICAgICAgICAgICAgICAgICAgICAgIHsgZHVyYXRpb246IDI1LCB3YXZlRnJlcTogeyAyNjAwLCAwIH0sIDAsIDAgfSwKLSAgICAgICAgICAgICAgICAgICAgICB7IGR1cmF0aW9uOiAyNSwgd2F2ZUZyZXE6IHsgMjkwMCwgMCB9LCA5LCA2IH0sCi0gICAgICAgICAgICAgICAgICAgICAgeyBkdXJhdGlvbjogNTAwLCB3YXZlRnJlcTogeyAwIH0sIDAsIDAgfSwKLSAgICAgICAgICAgICAgICAgICAgICB7IGR1cmF0aW9uOiAyNSwgd2F2ZUZyZXE6IHsgMjYwMCwgMCB9LCAwLCAwIH0sCi0gICAgICAgICAgICAgICAgICAgICAgeyBkdXJhdGlvbjogMjUsIHdhdmVGcmVxOiB7IDI5MDAsIDAgfSwgOSwgOSB9LAotICAgICAgICAgICAgICAgICAgICAgIHsgZHVyYXRpb246IDI1MDAsIHdhdmVGcmVxOiB7IDAgfSwgMCwgMCB9LAotICAgICAgICAgICAgICAgICAgICAgIHsgZHVyYXRpb246IDAsIHdhdmVGcmVxOiB7IDAgfSwgMCwgMCB9fSwKLSAgICAgICAgICByZXBlYXRDbnQ6IFRvbmVHZW5lcmF0b3I6OlRPTkVHRU5fSU5GLAotICAgICAgICAgIHJlcGVhdFNlZ21lbnQ6IDAgfSwgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyBUT05FX0NETUFfTUVEX1NfWDQKLSAgICAgICAgeyBzZWdtZW50czogeyB7IGR1cmF0aW9uOi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jpUT05FR0VOX0lORiwKLSAgICAgICAgICByZXBlYXRTZWdtZW50OiAwIH0sICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gVE9ORV9DRE1BX01FRF9QQlhfTAotICAgICAgICB7IHNlZ21lbnRzOiB7IHsgZHVyYXRpb246IDI1LCB3YXZlRnJlcTogeyAxMzAwLCAwIH0sIDAsIDAgfSwKLSAgICAgICAgICAgICAgICAgICAgICB7IGR1cmF0aW9uOiAyNSwgd2F2ZUZyZXE6IHsgMTQ1MCwgMCB9LCAxOSwgMCB9LAotICAgICAgICAgICAgICAgICAgICAgIHsgZHVyYXRpb246IDIwMDAsIHdhdmVGcmVxOiB7IDAgfSwgMCwgMCB9LAotICAgICAgICAgICAgICAgICAgICAgIHsgZHVyYXRpb246IDAsIHdhdmVGcmVxOiB7IDAgfSwgMCwgMCB9fSwKLSAgICAgICAgICByZXBlYXRDbnQ6IFRvbmVHZW5lcmF0b3I6OlRPTkVHRU5fSU5GLAotICAgICAgICAgIHJlcGVhdFNlZ21lbnQ6IDAgfSwgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyBUT05FX0NETUFfTE9XX1BCWF9MCi0gICAgICAgIHsgc2VnbWVudHM6IHsgeyBkdXJhdGlvbjogMjUsIHdhdmVGcmVxOiB7IDM3MDAsIDAgfSwgMCwgMCB9LAotICAgICAgICAgICAgICAgICAgICAgIHsgZHVyYXRpb246IDI1LCB3YXZlRnJlcTogeyA0MDAwLCAwIH0sIDcsIDAgfSwKLSAgICAgICAgICAgICAgICAgICAgICB7IGR1cmF0aW9uOiAyMDAsIHdhdmVGcmVxOiB7IDAgfSwgMCwgMCB9LAotICAgICAgICAgICAgICAgICAgICAgIHsgZHVyYXRpb246IDI1LCB3YXZlRnJlcTogeyAzNzAwLCAwIH0sIDAsIDAgfSwKLSAgICAgICAgICAgICAgICAgICAgICB7IGR1cmF0aW9uOiAyNSwgd2F2ZUZyZXE6IHsgNDAwMCwgMCB9LCA3LCAzIH0sCi0gICAgICAgICAgICAgICAgICAgICAgeyBkdXJhdGlvbjogMjAwMCwgd2F2ZUZyZXE6IHsgMCB9LCAwLCAwIH0sCi0gICAgICAgICAgICAgICAgICAgICAgeyBkdXJhdGlvbjogMCwgd2F2ZUZyZXE6IHsgMCB9LCAwLCAwIH19LAotICAgICAgICAgIHJlcGVhdENudDogVG9uZUdlbmVyYXRvcjo6VE9ORUdFTl9JTkYsCi0gICAgICAgICAgcmVwZWF0U2VnbWVudDogMCB9LCAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vIFRPTkVfQ0RNQV9ISUdIX1BCWF9TUwotICAgICAgICB7IHNlZ21lbnRzOiB7IHsgZHVyYXRpb246IDI1LCB3YXZlRnJlcTogeyAyNjAwLCAwIH0sIDAsIDAgfSwKLSAgICAgICAgICAgICAgICAgICAgICB7IGR1cmF0aW9uOiAyNSwgd2F2ZUZyZXE6IHsgMjkwMCwgMCB9LCA3LCAwIH0sCi0gICAgICAgICAgICAgICAgICAgICAgeyBkdXJhdGlvbjogMjAwLCB3YXZlRnJlcTogeyAwIH0sIDAsIDAgfSwKLSAgICAgICAgICAgICAgICAgICAgICB7IGR1cmF0aW9uOiAyNSwgd2F2ZUZyZXE6IHsgMjYwMCwgMCB9LCAwLCAwIH0sCi0gICAgICAgICAgICAgICAgICAgICAgeyBkdXJhdGlvbjogMjUsIHdhdmVGcmVxOiB7IDI5MDAsIDAgfSwgNywgMyB9LAotICAgICAgICAgICAgICAgICAgICAgIHsgZHVyYXRpb246IDIwMDAsIHdhdmVGcmVxOiB7IDAgfSwgMCwgMCB9LAotICAgICAgICAgICAgICAgICAgICAgIHsgZHVyYXRpb246IDAsIHdhdmVGcmVxOiB7IDAgfSwgMCwgMCB9fSwKLSAgICAgICAgICByZXBlYXRDbnQ6IFRvbmVHZW5lcmF0b3I6OlRPTkVHRU5fSU5GLAotICAgICAgICAgIHJlcGVhdFNlZ21lbnQ6IDAgfSwgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyBUT05FX0NETU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IDI2MDAsIDAgfSwgMCwgMCB9LAotICAgICAgICAgICAgICAgICAgICAgIHsgZHVyYXRpb246IDI1LCB3YXZlRnJlcTogeyAyOTAwLCAwIH0sIDcsIDMgfSwKLSAgICAgICAgICAgICAgICAgICAgICB7IGR1cmF0aW9uOiAyMDAsIHdhdmVGcmVxOiB7IDAgfSwgMCwgMCB9LAotICAgICAgICAgICAgICAgICAgICAgIHsgZHVyYXRpb246IDI1LCB3YXZlRnJlcTogeyAyNjAwLCAwIH0sIDAsIDAgfSwKLSAgICAgICAgICAgICAgICAgICAgICB7IGR1cmF0aW9uOiAyNSwgd2F2ZUZyZXE6IHsgMjkwMCwgMCB9LCAxNSwgNiB9LAotICAgICAgICAgICAgICAgICAgICAgIHsgZHVyYXRpb246IDEwMDAsIHdhdmVGcmVxOiB7IDAgfSwgMCwgMCB9LAotICAgICAgICAgICAgICAgICAgICAgIHsgZHVyYXRpb246IDAsIHdhdmVGcmVxOiB7IDAgfSwgMCwgMCB9fSwKLSAgICAgICAgICByZXBlYXRDbnQ6IFRvbmVHZW5lcmF0b3I6OlRPTkVHRU5fSU5GLAotICAgICAgICAgIHJlcGVhdFNlZ21lbnQ6IDAgfSwgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyBUT05FX0NETUFfTUVEX1BCWF9TU0wKLSAgICAgICAgeyBzZWdtZW50czogeyB7IGR1cmF0aW9uOiAyNSwgd2F2ZUZyZXE6IHsgMTMwMCwgMCB9LCAwLCAwIH0sCi0gICAgICAgICAgICAgICAgICAgICAgeyBkdXJhdGlvbjogMjUsIHdhdmVGcmVxOiB7IDE0NTAsIDAgfSwgNywgMCB9LAotICAgICAgICAgICAgICAgICAgICAgIHsgZHVyYXRpb246IDIwMCwgd2F2ZUZyZXE6IHsgMCB9LCAwLCAwIH0sCi0gICAgICAgICAgICAgICAgICAgICAgeyBkdXJhdGlvbjogMjUsIHdhdmVGcmVxOiB7IDEzMDAsIDAgfSwgMCwgMCB9LAotICAgICAgICAgICAgICAgICAgICAgIHsgZHVyYXRpb246IDI1LCB3YXZlRnJlcTogeyAxNDUwLCAwIH0sIDcsIDMgfSwKLSAgICAgICAgICAgICAgICAgICAgICB7IGR1cmF0aW9uOiAyMDAsIHdhdmVGcmVxOiB7IDAgfSwgMCwgMCB9LAotICAgICAgICAgICAgICAgICAgICAgIHsgZHVyYXRpb246IDI1LCB3YXZlRnJlcTogeyAxMzAwLCAwIH0sIDAsIDAgfSwKLSAgICAgICAgICAgICAgICAgICAgICB7IGR1cmF0aW9uOiAyNSwgd2F2ZUZyZXE6IHsgMTQ1MCwgMCB9LCAxNSwgNiB9LAotICAgICAgICAgICAgICAgICAgICAgIHsgZHVyYXRpb246IDEwMDAsIHdhdmVGcmVxOiB7IDAgfSwgMCwgMCB9LAotICAgICAgICAgICAgICAgICAgICAgIHsgZHVyYXRpb246IDAsIHdhdmVGcmVxOiB7IDAgfSwgMCwgMCB9fSwKLSAgICAgICAgICByZXBlYXRDbnQ6IFRvbmVHZW5lcmF0b3I6OlRPTkVHRU5fSU5GLAotICAgICAgICAgIHJlcGVhdFNlZ21lbnQ6IDAgfSwgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyBUT05FX0NETUFfTE9XX1BCWF9TU0wKLSAgICAgICAgeyBzZWdtZW50czogeyB7IGR1cmF0aW9uOiAyNSwgd2F2ZUZyZXE6IHsgMzcwMCwgMCB9LCAwLCAwIH0sCi0gICAgICAgICAgICAgICAgICAgICAgeyBkdXJhdGlvbjogMjUsIHdhdmVGcmVxOiB7IDQwMDAsIDAgfSwgNywgMCB9LAotICAgICAgICAgICAgICAgICAgICAgIHsgZHVyYXRpb246IDIwMCwgd2F2ZUZyZXE6IHsgMCB9LCAwLCAwIH0sCi0gICAgICAgICAgICAgICAgICAgICAgeyBkdXJhdGlvbjogMjUsIHdhdmVGcmVxOiB7IDM3MDAsIDAgfSwgMCwgMCB9LAotICAgICAgICAgICAgICAgICAgICAgIHsgZHVyYXRpb246IDI1LCB3YXZlRnJlcTogeyA0MDAwLCAwIH0sIDE1LCAzIH0sCi0gICAgICAgICAgICAgICAgICAgICAgeyBkdXJhdGlvbjogMjAwLCB3YXZlRnJlcTogeyAwIH0sIDAsIDAgfSwKLSAgICAgICAgICAgICAgICAgICAgICB7IGR1cmF0aW9uOiAyNSwgd2F2ZUZyZXE6IHsgMzcwMCwgMCB9LCAwLCAwIH0sCi0gICAgICAgICAgICAgICAgICAgICAgeyBkdXJhdGlvbjogMjUsIHdhdmVGcmVxOiB7IDQwMDAsIDAgfSwgNywgNiB9LAotICAgICAgICAgICAgICAgICAgICAgIHsgZHVyYXRpb246IDEwMDAsIHdhdmVGcmVxOiB7IDAgfSwgMCwgMCB9LAotICAgICAgICAgICAgICAgICAgICAgIHsgZHVyYXRpb246IDAsIHdhdmVGcmVxOiB7IDAgfSwgMCwgMCB9fSwKLSAgICAgICAgICByZXBlYXRDbnQ6IFRvbmVHZW5lcmF0b3I6OlRPTkVHRU5fSU5GLAotICAgICAgICAgIHJlcGVhdFNlZ21lbnQ6IDAgfSwgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyBUT05FX0NETUFfSElHSF9QQlhfU0xTCi0gICAgICAgIHsgc2VnbWVudHM6IHsgeyBkdXJhdGlvbjogMjUsIHdhdmVGcmVxOiB7IDI2MDAsIDAgfSwgMCwgMCB9LAotICAgICAgICAgICAgICAgICAgICAgIHsgZHVyYXRpb246IDI1LCB3YXZlRnJlcTogeyAyOTAwLCAwIH0sIDcsIDAgfSwKLSAgICAgICAgICAgICAgICAgICAgICB7IGR1cmF0aW9uOiAyMDAsIHdhdmVGcmVxOiB7IDAgfSwgMCwgMCB9LAotICAgICAgICAgICAgICAgICAgICAgIHsgZHVyYXRpb246IDI1LCB3YXZlRnJlcTogeyAyNjAwLCAwIH0sIDAsIDAgfSwKLSAgICAgICAgICAgICAgICAgICAgICB7IGR1cmF0aW9uOiAyNSwgd2F2ZUZyZXE6IHsgMjkwMCwgMCB9LCAxNSwgMyB9LAotICAgICAgICAgICAgICAgICAgICAgIHsgZHVyYXRpb246IDIwMCwgd2F2ZUZyZXE6IHsgMCB9LCAwLCAwIH0sCi0gICAgICAgICAgICAgICAgICAgICAgeyBkdXJhdGlvbjogMjUsIHdhdmVGcmVxOiB7IDI2MDAsIDAgfSwgMCwgMCB9LAotICAgICAgICAgICAgICAgICAgICAgIHsgZHVyYXRpb246IDI1LCB3YXZlRnJlcTogeyAyOTAwLCAwIH0sIDcsIDYgfSwKLSAgICAgICAgICAgICAgICAgICAgICB7IGR1cmF0aW9uOiAxMDAwLCB3YXZlRnJlcTogeyAwIH0sIDAsIDAgfSwKLSAgICAgICAgICAgICAgICAgICAgICB7IGR1cmF0aW9uOiAwLCB3YXZlRnJlcTogeyAwIH0sIDAsIDAgfX0sCi0gICAgICAgICAgcmVwZWF0Q250OiBUb25lR2VuZXJhdG9yOjpUT05FR0VOX0lORiwKLSAgICAgICAgICByZXBlYXRTZWdtZW50OiAwIH0sICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gVE9ORV9DRE1BX01FRF9QQlhfU0xTCi0gICAgICAgIHsgc2VnbWVudHM6IHsgeyBkdXJhdGlvbjogMjUsIHdhdmVGcmVxOiB7IDEzMDAsIDAgfSwgMCwgMCB9LAotICAgICAgICAgICAgICAgICAgICAgIHsgZHVyYXRpb246IDI1LCB3YXZlRnJlcTogeyAxNDUwLCAwIH0sIDcsIDAgfSwKLSAgICAgICAgICAgICAgICAgICAgICB7IGR1cmF0aW9uOiAyMDAsIHdhdmVGcmVxOiB7IDAgfSwgMCwgMCB9LAotICAgICAgICAgICAgICAgICAgICAgIHsgZHVyYXRpb246IDI1LCB3YXZlRnJlcTogeyAxMzAwLCAwIH0sIDAsIDAgfSwKLSAgICAgICAgICAgICAgICAgICAgICB7IGR1cmF0aW9uOiAyNSwgd2F2ZUZyZXE6IHsgMTQ1MCwgMCB9LCAxNSwgMyB9LAotICAgICAgICAgICAgICAgICAgICAgIHsgZHVyYXRpb246IDIwMCwgd2F2ZUZyZXE6IHsgMCB9LCAwLCAwIH0sCi0gICAgICAgICAgICAgICAgICAgICAgeyBkdXJhdGlvbjogMjUsIHdhdmVGcmVxOiB7IDEzMDAsIDAgfSwgMCwgMCB9LAotICAgICAgICAgICAgICAgICAgICAgIHsgZHVyYXRpb246IDI1LCB3YXZlRnJlcTogeyAxNDUwLCAwIH0sIDcsIDYgfSwKLSAgICAgICAgICAgICAgICAgICAgICB7IGR1cmF0aW9uOiAxMDAwLCB3YXZlRnJlcTogeyAwIH0sIDAsIDAgfSwKLSAgICAgICAgICAgICAgICAgICAgICB7IGR1cmF0aW9uOiAwLCB3YXZlRnJlcTogeyAwIH0sIDAsIDAgfX0sCi0gICAgICAgICAgcmVwZWF0Q250OiBUb25lR2VuZXJhdG9yOjpUT05FR0VOX0lORiwKLSAgICAgICAgICByZXBlYXRTZWdtZW50OiAwIH0sICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gVE9ORV9DRE1BX0xPV19QQlhfU0xTCi0gICAgICAgIHsgc2VnbWVudHM6IHsgeyBkdXJhdGlvbjogMjUsIHdhdmVGcmVxOiB7IDM3MDAsIDAgfSwgMCwgMCB9LAotICAgICAgICAgICAgICAgICAgICAgIHsgZHVyYXRpb246IDI1LCB3YXZlRnJlcTogeyA0MDAwLCAwIH0sIDcsIDAgfSwKLSAgICAgICAgICAgICAgICAgICAgICB7IGR1cmF0aW9uOiAyMDAsIHdhdmVGcmVxOiB7IDAgfSwgMCwgMCB9LAotICAgICAgICAgICAgICAgICAgICAgIHsgZHVyYXRpb246IDI1LCB3YXZlRnJlcTogeyAzNzAwLCAwIH0sIDAsIDAgfSwKLSAgICAgICAgICAgICAgICAgICAgICB7IGR1cmF0aW9uOiAyNSwgd2F2ZUZyZXE6IHsgNDAwMCwgMCB9LCA3LCAzIH0sCi0gICAgICAgICAgICAgICAgICAgICAgeyBkdXJhdGlvbjogMjAwLCB3YXZlRnJlcTogeyAwIH0sIDAsIDAgfSwKLSAgICAgICAgICAgICAgICAgICAgICB7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MCwgMCB9LCAwLCAwIH0sCi0gICAgICAgICAgICAgICAgICAgICAgeyBkdXJhdGlvbjogMjUsIHdhdmVGcmVxOiB7IDI5MDAsIDAgfSwgNywgMyB9LAotICAgICAgICAgICAgICAgICAgICAgIHsgZHVyYXRpb246IDIwMCwgd2F2ZUZyZXE6IHsgMCB9LCAwLCAwIH0sCi0gICAgICAgICAgICAgICAgICAgICAgeyBkdXJhdGlvbjogMjUsIHdhdmVGcmVxOiB7IDI2MDAsIDAgfSwgMCwgMCB9LAotICAgICAgICAgICAgICAgICAgICAgIHsgZHVyYXRpb246IDI1LCB3YXZlRnJlcTogeyAyOTAwLCAwIH0sIDcsIDYgfSwKLSAgICAgICAgICAgICAgICAgICAgICB7IGR1cmF0aW9uOiAyMDAsIHdhdmVGcmVxOiB7IDAgfSwgMCwgMCB9LAotICAgICAgICAgICAgICAgICAgICAgIHsgZHVyYXRpb246IDI1LCB3YXZlRnJlcTogeyAyNjAwLCAwIH0sIDAsIDAgfSwKLSAgICAgICAgICAgICAgICAgICAgICB7IGR1cmF0aW9uOiAyNSwgd2F2ZUZyZXE6IHsgMjkwMCwgMCB9LCA3LCA5IH0sCi0gICAgICAgICAgICAgICAgICAgICAgeyBkdXJhdGlvbjogODAwLCB3YXZlRnJlcTogeyAwIH0sIDAsIDAgfSwKLSAgICAgICAgICAgICAgICAgICAgICB7IGR1cmF0aW9uOiAwLCB3YXZlRnJlcTogeyAwIH0sIDAsIDAgfX0sCi0gICAgICAgICAgcmVwZWF0Q250OiBUb25lR2VuZXJhdG9yOjpUT05FR0VOX0lORiwKLSAgICAgICAgICByZXBlYXRTZWdtZW50OiAwIH0sICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gVE9ORV9DRE1BX01FRF9QQlhfU19YNAotICAgICAgICB7IHNlZ21lbnRzOiB7IHsgZHVyYXRpb246IDI1LCB3YXZlRnJlcTogeyAxMzAwLCAwIH0sIDAsIDAgfSwKLSAgICAgICAgICAgICAgICAgICAgICB7IGR1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gICAgICByZXBlYXRTZWdtZW50OiAwIH0sICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gVE9ORV9DRE1BX0xPV19QQlhfU19YNAotCi0gICAgICAgIHsgc2VnbWVudHM6IHsgeyBkdXJhdGlvbjogNjIsIHdhdmVGcmVxOiB7IDExMDksIDAgfSwgMCwgMCB9LAotICAgICAgICAgICAgICAgICAgICAgIHsgZHVyYXRpb246IDYyLCB3YXZlRnJlcTogeyA3ODQsIDAgfSwgIDAsIDAgfSwKLSAgICAgICAgICAgICAgICAgICAgICB7IGR1cmF0aW9uOiA2Miwgd2F2ZUZyZXE6IHsgNzQwLCAwIH0sICAwLCAwIH0sCi0gICAgICAgICAgICAgICAgICAgICAgeyBkdXJhdGlvbjogNjIsIHdhdmVGcmVxOiB7IDYyMiwgMCB9LCAgMCwgMCB9LAotICAgICAgICAgICAgICAgICAgICAgIHsgZHVyYXRpb246IDYyLCB3YXZlRnJlcTogeyAxMTA5LCAwIH0sIDAsIDAgfSwKLSAgICAgICAgICAgICAgICAgICAgICB7IGR1cmF0aW9uOiAwLCAgd2F2ZUZyZXE6IHsgMCB9LCAgICAgICAwLCAwIH0gfSwKLSAgICAgICAgICByZXBlYXRDbnQ6IDAsCi0gICAgICAgICAgcmVwZWF0U2VnbWVudDogMCB9LCAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyBUT05FX0NETUFfQUxFUlRfTkVUV09SS19MSVRFCi0gICAgICAgIHsgc2VnbWVudHM6IHsgeyBkdXJhdGlvbjogNjIsIHdhdmVGcmVxOiB7IDEyNDUsIDAgfSwgMCwgMCB9LAotICAgICAgICAgICAgICAgICAgICAgIHsgZHVyYXRpb246IDYyLCB3YXZlRnJlcTogeyA2NTksIDAgfSwgIDIsIDAgfSwKLSAgICAgICAgICAgICAgICAgICAgICB7IGR1cmF0aW9uOiA2Miwgd2F2ZUZyZXE6IHsgMTI0NSwgMCB9LCAwLCAwIH0sCi0gICAgICAgICAgICAgICAgICAgICAgeyBkdXJhdGlvbjogMCwgIHdhdmVGcmVxOiB7IDAgfSwgICAgICAgMCwgMCB9IH0sCi0gICAgICAgICAgcmVwZWF0Q250OiAwLAotICAgICAgICAgIHJlcGVhdFNlZ21lbnQ6IDAgfSwgICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gVE9ORV9DRE1BX0FMRVJUX0FVVE9SRURJQUxfTElURQotICAgICAgICB7IHNlZ21lbnRzOiB7IHsgZHVyYXRpb246IDQwMCwgd2F2ZUZyZXE6IHsgMTE1MCwgNzcwLCAwIH0sIDAsIDAgfSwKLSAgICAgICAgICAgICAgICAgICAgICB7IGR1cmF0aW9uOiAwLCAgIHdhdmVGcmVxOiB7IDAgfSwgICAgICAgICAgICAwLCAwIH0gfSwKLSAgICAgICAgICByZXBlYXRDbnQ6IDAsCi0gICAgICAgICAgcmVwZWF0U2VnbWVudDogMCB9LCAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyBUT05FX0NETUFfT05FX01JTl9CRUVQCi0gICAgICAgIHsgc2VnbWVudHM6IHsgeyBkdXJhdGlvbjogMTIwLCB3YXZlRnJlcTogeyA5NDEsIDE0NzcsIDAgfSwgMCwgMCB9LAotICAgICAgICAgICAgICAgICAgICAgIHsgZHVyYXRpb246IDAsICAgd2F2ZUZyZXE6IHsgMCB9LCAgICAgICAgICAgIDAsIDAgfSB9LAotICAgICAgICAgIHJlcGVhdENudDogMCwKLSAgICAgICAgICByZXBlYXRTZWdtZW50OiAwIH0sICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vIFRPTkVfQ0RNQV9LRVlQQURfVk9MVU1FX0tFWV9MSVRFCi0gICAgICAgIHsgc2VnbWVudHM6IHsgeyBkdXJhdGlvbjogMzc1LCB3YXZlRnJlcTogeyA1ODcsIDAgfSwgMCwgMCB9LAotICAgICAgICAgICAgICAgICAgICAgIHsgZHVyYXRpb246IDEyNSwgd2F2ZUZyZXE6IHsgMTE3NSwgMCB9LCAwLCAwIH0sCi0gICAgICAgICAgICAgICAgICAgICAgeyBkdXJhdGlvbjogMCwgICB3YXZlRnJlcTogeyAwIH0sICAgICAgIDAsIDAgfSB9LAotICAgICAgICAgIHJlcGVhdENudDogMCwKLSAgICAgICAgICByZXBlYXRTZWdtZW50OiAwIH0sICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vIFRPTkVfQ0RNQV9QUkVTU0hPTERLRVlfTElURQotICAgICAgICB7IHNlZ21lbnRzOiB7IHsgZHVyYXRpb246IDYyLCB3YXZlRnJlcTogeyA1ODcsIDAgfSwgMCwgMCB9LAotICAgICAgICAgICAgICAgICAgICAgIHsgZHVyYXRpb246IDYyLCB3YXZlRnJlcTogeyA3ODQsIDAgfSwgMCwgMCB9LAotICAgICAgICAgICAgICAgICAgICAgIHsgZHVyYXRpb246IDYyLCB3YXZlRnJlcTogeyA4MzEsIDAgfSwgMCwgMCB9LAotICAgICAgICAgICAgICAgICAgICAgIHsgZHVyYXRpb246IDYyLCB3YXZlRnJlcTogeyA3ODQsIDAgfSwgMCwgMCB9LAotICAgICAgICAgICAgICAgICAgICAgIHsgZHVyYXRpb246IDYyLCB3YXZlRnJlcTogeyAxMTA5LCAwIH0sIDAsIDAgfSwKLSAgICAgICAgICAgICAgICAgICAgICB7IGR1cmF0aW9uOiA2Miwgd2F2ZUZyZXE6IHsgNzg0LCAwIH0sIDAsIDAgfSwKLSAgICAgICAgICAgICAgICAgICAgICB7IGR1cmF0aW9uOiA2Miwgd2F2ZUZyZXE6IHsgODMxLCAwIH0sIDAsIDAgfSwKLSAgICAgICAgICAgICAgICAgICAgICB7IGR1cmF0aW9uOiA2Miwgd2F2ZUZyZXE6IHsgNzg0LCAwIH0sIDAsIDAgfSwKLSAgICAgICAgICAgICAgICAgICAgICB7IGR1cmF0aW9uOiAwLCAgd2F2ZUZyZXE6IHsgMCB9LCAgICAgIDAsIDAgfSB9LAotICAgICAgICAgIHJlcGVhdENudDogMCwKLSAgICAgICAgICByZXBlYXRTZWdtZW50OiAwIH0sICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyBUT05FX0NETUFfQUxFUlRfSU5DQUxMX0xJVEUKLSAgICAgICAgeyBzZWdtZW50czogeyB7IGR1cmF0aW9uOiAxMjUsIHdhdmVGcmVxOiB7IDk0MSwgMCB9LCAwLCAwIH0sCi0gICAgICAgICAgICAgICAgICAgICAgeyBkdXJhdGlvbjogMTAsICB3YXZlRnJlcTogeyAwIH0sICAgICAgMiwgMCB9LAotICAgICAgICAgICAgICAgICAgICAgIHsgZHVyYXRpb246IDQ5OTAsIHdhdmVGcmVxOiB7IDAgfSwgICAgIDAsIDAgfSwKLSAgICAgICAgICAgICAgICAgICAgICB7IGR1cmF0aW9uOiAwLCAgICB3YXZlRnJlcTogeyAwIH0sICAgICAwLCAwIH0gfSwKLSAgICAgICAgICByZXBlYXRDbnQ6IFRvbmVHZW5lcmF0b3I6OlRPTkVHRU5fSU5GLAotICAgICAgICAgIHJlcGVhdFNlZ21lbnQ6IDAgfSwgICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gVE9ORV9DRE1BX0VNRVJHRU5DWV9SSU5HQkFDSwotICAgICAgICB7IHNlZ21lbnRzOiB7IHsgZHVyYXRpb246IDEyNSwgd2F2ZUZyZXE6IHsgMTMxOSwgMCB9LCAwLCAwIH0sCi0gICAgICAgICAgICAgICAgICAgICAgeyBkdXJhdGlvbjogMTI1LCB3YXZlRnJlcTogeyAwIH0sICAgICAgIDAsIDAgfSwKLSAgICAgICAgICAgICAgICAgICAgICB7IGR1cmF0aW9uOiAwLCAgIHdhdmVGcmVxOiB7IDAgfSwgICAgICAgMCwgMCB9IH0sCi0gICAgICAgICAgcmVwZWF0Q250OiAyLAotICAgICAgICAgIHJlcGVhdFNlZ21lbnQ6IDAgfSwgICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gVE9ORV9DRE1BX0FMRVJUX0NBTExfR1VBUkQKLSAgICAgICAgeyBzZWdtZW50czogeyB7IGR1cmF0aW9uOiAxMjUsIHdhdmVGcmVxOiB7IDEwNDcsIDAgfSwgMCwgMCB9LAotICAgICAgICAgICAgICAgICAgICAgIHsgZHVyYXRpb246IDEyNSwgd2F2ZUZyZXE6IHsgMzcwLCAgMCB9LCAwLCAwIH0sCi0gICAgICAgICAgICAgICAgICAgICAgeyBkdXJhdGlvbjogMCwgICB3YXZlRnJlcTogeyAwIH0sICAgICAgIDAsIDAgfSB9LAotICAgICAgICAgIHJlcGVhdENudDogMCwKLSAgICAgICAgICByZXBlYXRTZWdtZW50OiAwIH0sICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vIFRPTkVfQ0RNQV9TT0ZUX0VSUk9SX0xJVEUKLSAgICAgICAgeyBzZWdtZW50czogeyB7IGR1cmF0aW9uOiAxMjUsIHdhdmVGcmVxOiB7IDE0ODAsIDAgfSwgMCwgMCB9LAotICAgICAgICAgICAgICAgICAgICAgIHsgZHVyYXRpb246IDEyNSwgd2F2ZUZyZXE6IHsgMTM5NywgMCB9LCAwLCAwIH0sCi0gICAgICAgICAgICAgICAgICAgICAgeyBkdXJhdGlvbjogMTI1LCB3YXZlRnJlcTogeyA3ODQsIDAgfSwgIDAsIDAgfSwKLSAgICAgICAgICAgICAgICAgICAgICB7IGR1cmF0aW9uOiAwLCAgIHdhdmVGcmVxOiB7IDAgfSwgICAgICAgMCwgMCB9IH0sCi0gICAgICAgICAgcmVwZWF0Q250OiAwLAotICAgICAgICAgIHJlcGVhdFNlZ21lbnQ6IDAgfSwgICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gVE9ORV9DRE1BX0NBTExEUk9QX0xJVEUKLQotICAgICAgICB7IHNlZ21lbnRzOiB7IHsgZHVyYXRpb246IDUwMCwgd2F2ZUZyZXE6IHsgNDI1LCAwIH0sIDAsIDAgfSwKLSAgICAgICAgICAgICAgICAgICAgICB7IGR1cmF0aW9uOiA1MDAsIHdhdmVGcmVxOiB7IDAgfSwgMCwgMCB9LAotICAgICAgICAgICAgICAgICAgICAgIHsgZHVyYXRpb246IDAsIHdhdmVGcmVxOiB7IDAgfSwgMCwgMCB9fSwKLSAgICAgICAgICByZXBlYXRDbnQ6IDAsCi0gICAgICAgICAgcmVwZWF0U2VnbWVudDogMCB9LCAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vIFRPTkVfQ0RNQV9ORVRXT1JLX0JVU1lfT05FX1NIT1QKLSAgICAgICAgeyBzZWdtZW50czogeyB7IGR1cmF0aW9uOiA0MDAsIHdhdmVGcmVxOiB7IDExNTAsIDc3MCB9LCAwLCAwIH0sCi0gICAgICAgICAgICAgICAgICAgICAgeyBkdXJhdGlvbjogMCwgd2F2ZUZyZXE6IHsgMCB9LCAwLCAwIH19LAotICAgICAgICAgIHJlcGVhdENudDogMCwKLSAgICAgICAgICByZXBlYXRTZWdtZW50OiAwIH0sICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gVE9ORV9DRE1BX0FCQlJfQUxFUlQKLSAgICAgICAgICB7IHNlZ21lbnRzOiB7IHsgZHVyYXRpb246IDAsIHdhdmVGcmVxOiB7IDAgfSwgMCwgMCB9fSwKLSAgICAgICAgICByZXBlYXRDbnQ6IDAsCi0gICAgICAgICAgcmVwZWF0U2VnbWVudDogMCB9LCAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyBUT05FX0NETUFfU0lHTkFMX09GRgotCi0gICAgICAgIHsgc2VnbWVudHM6IHsgeyBkdXJhdGlvbjogVG9uZUdlbmVyYXRvcjo6VE9ORUdFTl9JTkYsIHdhdmVGcmVxOiB7IDM1MCwgNDQwLCAwIH0sIDAsIDAgfSwKLSAgICAgICAgICAgICAgICAgICAgICB7IGR1cmF0aW9uOiAwICwgd2F2ZUZyZXE6IHsgMCB9LCAwLCAwfX0sCi0gICAgICAgICAgcmVwZWF0Q250OiBUb25lR2VuZXJhdG9yOjpUT05FR0VOX0lORiwKLSAgICAgICAgICByZXBlYXRTZWdtZW50OiAwIH0sICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gVE9ORV9BTlNJX0RJQUwKLSAgICAgICAgeyBzZWdtZW50czogeyB7IGR1cmF0aW9uOiA1MDAsIHdhdmVGcmVxOiB7IDQ4MCwgNjIwLCAwIH0sIDAsIDAgfSwKLSAgICAgICAgICAgICAgICAgICAgICB7IGR1cmF0aW9uOiA1MDAsIHdhdmVGcmVxOiB7IDAgfSwgMCwgMCB9LAotICAgICAgICAgICAgICAgICAgICAgIHsgZHVyYXRpb246IDAgLCB3YXZlRnJlcTogeyAwIH0sIDAsIDB9fSwKLSAgICAgICAgICByZXBlYXRDbnQ6IFRvbmVHZW5lcmF0b3I6OlRPTkVHRU5fSU5GLAotICAgICAgICAgIHJlcGVhdFNlZ21lbnQ6IDAgfSwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyBUT05FX0FOU0lfQlVTWQotICAgICAgICB7IHNlZ21lbnRzOiB7IHsgZHVyYXRpb246IDI1MCwgd2F2ZUZyZXE6IHsgNDgwLCA2MjAsIDAgfSwgMCwgMCB9LAotICAgICAgICAgICAgICAgICAgICAgIHsgZHVyYXRpb246IDI1MCwgd2F2ZUZyZXE6IHsgMCB9LCAwLCAwIH0sCi0gICAgICAgICAgICAgICAgICAgICAgeyBkdXJhdGlvbjogMCAsIHdhdmVGcmVxOiB7IDAgfSwgMCwgMH19LAotICAgICAgICAgIHJlcGVhdENudDogVG9uZUdlbmVyYXRvcjo6VE9ORUdFTl9JTkYsCi0gICAgICAgICAgcmVwZWF0U2VnbWVudDogMCB9LCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vIFRPTkVfQU5TSV9DT05HRVNUSU9OCi0gICAgICAgIHsgc2VnbWVudHM6IHsgeyBkdXJhdGlvbjogMzAwLCB3YXZlRnJlcTogeyA0NDAsIDAgfSwgMCwgMCB9LAotICAgICAgICAgICAgICAgICAgICAgIHsgZHVyYXRpb246IDk3MDAsIHdhdmVGcmVxOiB7IDAgfSwgMCwgMCB9LAotICAgICAgICAgICAgICAgICAgICAgIHsgZHVyYXRpb246IDEwMCwgd2F2ZUZyZXE6IHsgNDQwLCAwIH0sIDAsIDAgfSwKLSAgICAgICAgICAgICAgICAgICAgICB7IGR1cmF0aW9uOiAxMDAsIHdhdmVGcmVxOiB7IDAgfSwgMCwgMCB9LAotICAgICAgICAgICAgICAgICAgICAgIHsgZHVyYXRpb246IDEwMCwgd2F2ZUZyZXE6IHsgNDQwLCAwIH0sIDAsIDAgfSwKLSAgICAgICAgICAgICAgICAgICAgICB7IGR1cmF0aW9uOiAwICwgd2F2ZUZyZXE6IHsgMCB9LCAwLCAwfX0sCi0gICAgICAgICAgcmVwZWF0Q250OiBUb25lR2VuZXJhdG9yOjpUT05FR0VOX0lORiwKLSAgICAgICAgICByZXBlYXRTZWdtZW50OiAxIH0sICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gVE9ORV9BTlNJX0NBTExfV0FJVElORwotICAgICAgICB7IHNlZ21lbnRzOiB7IHsgZHVyYXRpb246IDIwMDAsIHdhdmVGcmVxOiB7IDQ0MCwgNDgwLCAwIH0sIDAsIDAgfSwKLSAgICAgICAgICAgICAgICAgICAgICB7IGR1cmF0aW9uOiA0MDAwLCB3YXZlRnJlcTogeyAwIH0sIDAsIDAgfSwKLSAgICAgICAgICAgICAgICAgICAgICB7IGR1cmF0aW9uOiAwICwgd2F2ZUZyZXE6IHsgMCB9LCAwLCAwfX0sCi0gICAgICAgICAgcmVwZWF0Q250OiBUb25lR2VuZXJhdG9yOjpUT05FR0VOX0lORiwKLSAgICAgICAgICByZXBlYXRTZWdtZW50OiAwIH0sICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gVE9ORV9BTlNJX1JJTkdUT05FCi0gICAgICAgIHsgc2VnbWVudHM6IHsgeyBkdXJhdGlvbjogVG9uZUdlbmVyYXRvcjo6VE9ORUdFTl9JTkYsIHdhdmVGcmVxOiB7IDQwMCwgMCB9LCAwLCAwIH0sCi0gICAgICAgICAgICAgICAgICAgICAgeyBkdXJhdGlvbjogMCAsIHdhdmVGcmVxOiB7IDAgfSwgMCwgMH19LAotICAgICAgICAgIHJlcGVhdENudDogVG9uZUdlbmVyYXRvcjo6VE9ORUdFTl9JTkYsCi0gICAgICAgICAgcmVwZWF0U2VnbWVudDogMCB9LCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vIFRPTkVfSkFQQU5fRElBTAotICAgICAgICB7IHNlZ21lbnRzOiB7IHsgZHVyYXRpb246IDUwMCwgd2F2ZUZyZXE6IHsgNDAwLCAwIH0sIDAsIDAgfSwKLSAgICAgICAgICAgICAgICAgICAgICB7IGR1cmF0aW9uOiA1MDAsIHdhdmVGcmVxOiB7IDAgfSwgMCwgMCB9LAotICAgICAgICAgICAgICAgICAgICAgIHsgZHVyYXRpb246IDAgLCB3YXZlRnJlcTogeyAwIH0sIDAsIDB9fSwKLSAgICAgICAgICByZXBlYXRDbnQ6IFRvbmVHZW5lcmF0b3I6OlRPTkVHRU5fSU5GLAotICAgICAgICAgIHJlcGVhdFNlZ21lbnQ6IDAgfSwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyBUT05FX0pBUEFOX0JVU1kKLSAgICAgICAgeyBzZWdtZW50czogeyB7IGR1cmF0aW9uOiAxMDAwLCB3YXZlRnJlcTogeyA0MDAsIDAgfSwgMCwgMCB9LAotICAgICAgICAgICAgICAgICAgICAgIHsgZHVyYXRpb246IDIwMDAsIHdhdmVGcmVxOiB7IDAgfSwgMCwgMCB9LAotICAgICAgICAgICAgICAgICAgICAgIHsgZHVyYXRpb246IDAgLCB3YXZlRnJlcTogeyAwIH0sIDAsIDB9fSwKLSAgICAgICAgICByZXBlYXRDbnQ6IFRvbmVHZW5lcmF0b3I6OlRPTkVHRU5fSU5GLAotICAgICAgICAgIHJlcGVhdFNlZ21lbnQ6IDAgfSwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyBUT05FX0pBUEFOX1JBRElPX0FDSwotCi0KLQotfTsKLQotLy8gVXNlZCBieSBUb25lR2VuZXJhdG9yOjpnZXRUb25lRm9yUmVnaW9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Ugc3RhcnQsIHRpbWUgJWQiLCAodW5zaWduZWQgaW50KShzeXN0ZW1UaW1lKCkvMTAwMDAwMCkpOwotICAgICAgICAgICAgbFJlc3VsdCA9IHRydWU7Ci0gICAgICAgICAgICBtU3RhdGUgPSBUT05FX1NUQVJUSU5HOwotICAgICAgICAgICAgbUxvY2sudW5sb2NrKCk7Ci0gICAgICAgICAgICBtcEF1ZGlvVHJhY2stPnN0YXJ0KCk7Ci0gICAgICAgICAgICBtTG9jay5sb2NrKCk7Ci0gICAgICAgICAgICBpZiAobVN0YXRlID09IFRPTkVfU1RBUlRJTkcpIHsKLSAgICAgICAgICAgICAgICBBTE9HVigiV2FpdCBmb3Igc3RhcnQgY2FsbGJhY2siKTsKLSAgICAgICAgICAgICAgICBsU3RhdHVzID0gbVdhaXRDYmtDb25kLndhaXRSZWxhdGl2ZShtTG9jaywgc2Vjb25kcygzKSk7Ci0gICAgICAgICAgICAgICAgaWYgKGxTdGF0dXMgIT0gTk9fRVJST1IpIHsKLSAgICAgICAgICAgICAgICAgICAgQUxPR0UoIi0tLSBJbW1lZGlhdGUgc3RhcnQgdGltZWQgb3V0LCBzdGF0dXMgJWQiLCBsU3RhdHVzKTsKLSAgICAgICAgICAgICAgICAgICAgbVN0YXRlID0gVE9ORV9JRExFOwotICAgICAgICAgICAgICAgICAgICBsUmVzdWx0ID0gZmFsc2U7Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgfQotICAgICAgICB9IGVsc2UgewotICAgICAgICAgICAgbVN0YXRlID0gVE9ORV9JRExFOwotICAgICAgICB9Ci0gICAgfSBlbHNlIHsKLSAgICAgICAgQUxPR1YoIkRlbGF5ZWQgc3RhcnQiKTsKLSAgICAgICAgbVN0YXRlID0gVE9ORV9SRVNUQVJUSU5HOwotICAgICAgICBsU3RhdHVzID0gbVdhaXRDYmtDb25kLndhaXRSZWxhdGl2ZShtTG9jaywgc2Vjb25kcygzKSk7Ci0gICAgICAgIGlmIChsU3RhdHVzID09IE5P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lbnRzW2xwVG9uZUdlbi0+bUN1clNlZ21lbnRdLmxvb3BDbnQpIHsKLSAgICAgICAgICAgICAgICAgICAgQUxPR1YgKCJpbiBpZiBsb29wIGxvb3BDbnQoJWQpIGxvb3BjdHIoJWQpLCBDdXJTZWcoJWQpIiwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgbHBUb25lRGVzYy0+c2VnbWVudHNbbHBUb25lR2VuLT5tQ3VyU2VnbWVudF0ubG9vcENudCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgbHBUb25lR2VuLT5tTG9vcENvdW50ZXIsCi0gICAgICAgICAgICAgICAgICAgICAgICAgIGxwVG9uZUdlbi0+bUN1clNlZ21lbnQpOwotICAgICAgICAgICAgICAgICAgICBscFRvbmVHZW4tPm1DdXJTZWdtZW50ID0gbHBUb25lRGVzYy0+c2VnbWVudHNbbHBUb25lR2VuLT5tQ3VyU2VnbWVudF0ubG9vcEluZHg7Ci0gICAgICAgICAgICAgICAgICAgICsrbHBUb25lR2VuLT5tTG9vcENvdW50ZXI7Ci0gICAgICAgICAgICAgICAgfSBlbHNlIHsKLSAgICAgICAgICAgICAgICAgICAgLy8gY29tcGxldGVkIGxvb3AuIGdvIHRvIG5leHQgc2VnbWVudAotICAgICAgICAgICAgICAgICAgICBscFRvbmVHZW4tPm1Mb29wQ291bnRlciA9IDA7Ci0gICAgICAgICAgICAgICAgICAgIGxwVG9uZUdlbi0+bUN1clNlZ21lbnQrKzsKLSAgICAgICAgICAgICAgICAgICAgQUxPR1YgKCJpbiBlbHNlIGxvb3AgbG9vcENudCglZCkgbG9vcGN0ciglZCksIEN1clNlZyglZCkiLAotICAgICAgICAgICAgICAgICAgICAgICAgICBscFRvbmVEZXNjLT5zZWdtZW50c1tscFRvbmVHZW4tPm1DdXJTZWdtZW50XS5sb29wQ250LAotICAgICAgICAgICAgICAgICAgICAgICAgICBscFRvbmVHZW4tPm1Mb29wQ291bnRlciwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgbHBUb25lR2VuLT5tQ3VyU2VnbWVudCk7Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgfSBlbHNlIHsKLSAgICAgICAgICAgICAgICBscFRvbmVHZW4tPm1DdXJTZWdtZW50Kys7Ci0gICAgICAgICAgICAgICAgQUxPR1YgKCJHb3RvIG5leHQgc2VnIGxvb3BDbnQoJWQpIGxvb3BjdHIoJWQpLCBDdXJTZWcoJWQpIiwKLSAgICAgICAgICAgICAgICAgICAgICBscFRvbmVEZXNjLT5zZWdtZW50c1tscFRvbmVHZW4tPm1DdXJTZWdtZW50XS5sb29wQ250LAotICAgICAgICAgICAgICAgICAgICAgIGxwVG9uZUdlbi0+bUxvb3BDb3VudGVyLAotICAgICAgICAgICAgICAgICAgICAgIGxwVG9uZUdlbi0+bUN1clNlZ21lbnQpOwotCi0gICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgIC8vIEhhbmRsZSBsb29wIGlmIGxhc3Qgc2VnbWVudCByZWFjaGVkCi0gICAgICAgICAgICBpZiAobHBUb25lRGVzYy0+c2VnbWVudHNbbHBUb25lR2VuLT5tQ3VyU2VnbWVudF0uZHVyYXRpb24gPT0gMCkgewotICAgICAgICAgICAgICAgIEFMT0dWKCJMYXN0IFNlZzogJWQiLCBscFRvbmVHZW4tPm1DdXJTZWdtZW50KTsKLQotICAgICAgICAgICAgICAgIC8vIFByZSBpbmNyZW1lbnQgbG9vcCBjb3VudCBhbmQgcmVzdGFydCBpZiB0b3RhbCBjb3VudCBub3QgcmVhY2hlZC4gU3RvcCBzZXF1ZW5jZSBvdGhlcndpc2UKLSAgICAgICAgICAgICAgICBpZiAoKytscFRvbmVHZW4tPm1DdXJDb3VudCA8PSBscFRvbmVEZXNjLT5yZXBlYXRDbnQpIHsKLSAgICAgICAgICAgICAgICAgICAgQUxPR1YoIlJlcGVhdGluZyBDb3VudDogJWQiLCBscFRvbmVHZW4tPm1DdXJDb3VudCk7Ci0KLSAgICAgICAgICAgICAgICAgICAgbHBUb25lR2VuLT5tQ3VyU2VnbWVudCA9IGxwVG9uZURlc2MtPnJlcGVhdFNlZ21lbnQ7Ci0gICAgICAgICAgICAgICAgICAgIGlmIChscFRvbmVEZXNjLT5zZWdtZW50c1tscFRvbmVEZXNjLT5yZXBlYXRTZWdtZW50XS53YXZlRnJlcVswXSAhPSAwKSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICBsV2F2ZUNtZCA9IFdhdmVHZW5lcmF0b3I6OldBVkVHRU5fU1RBUlQ7Ci0gICAgICAgICAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgICAgICAgICBBTE9HVigiTmV3IHNlZ21lbnQgJWQsIE5leHQgVGltZTogJWQiLCBscFRvbmVHZW4tPm1DdXJTZWdtZW50LAotICAgICAgICAgICAgICAgICAgICAgICAgICAgIChscFRvbmVHZW4tPm1OZXh0U2VnU21wKjEwMDApL2xwVG9uZUdlbi0+bVNhbXBsaW5nUmF0ZSk7Ci0KLSAgICAgICAgICAgICAgICB9IGVsc2UgewotICAgICAgICAgICAgICAgICAgICBsR2VuU21wID0gMDsKLSAgICAgICAgICAgICAgICAgICAgQUxPR1YoIkVuZCByZXBlYXQsIHRpbWU6ICVkIiwgKHVuc2lnbmVkIGludCkoc3lzdGVtVGltZSgpLzEwMDAwMDApKTsKLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICB9IGVsc2UgewotICAgICAgICAgICAgICAgIEFMT0dWKCJOZXcgc2VnbWVudCAlZCwgTmV4dCBUaW1lOiAlZCIsIGxwVG9uZUdlbi0+bUN1clNlZ21lbnQsCi0gICAgICAgICAgICAgICAgICAgICAgICAobHBUb25lR2VuLT5tTmV4dFNlZ1NtcCoxMDAwKS9scFRvbmVHZW4tPm1TYW1wbGluZ1JhdGUpOwotICAgICAgICAgICAgICAgIGlmIChscFRvbmVEZXNjLT5zZWdtZW50c1tscFRvbmVHZW4tPm1DdXJTZWdtZW50XS53YXZlRnJlcVswXSAhPSAwKSB7Ci0gICAgICAgICAgICAgICAg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GxwVG9uZUdlbi0+bVN0YXRlKSB7Ci0gICAgICAgIGNhc2UgVE9ORV9SRVNUQVJUSU5HOgotICAgICAgICAgICAgQUxPR1YoIkNiayByZXN0YXJ0aW5nIHRyYWNrIik7Ci0gICAgICAgICAgICBpZiAobHBUb25lR2VuLT5wcmVwYXJlV2F2ZSgpKSB7Ci0gICAgICAgICAgICAgICAgbHBUb25lR2VuLT5tU3RhdGUgPSBUT05FX1NUQVJUSU5HOwotICAgICAgICAgICAgICAgIC8vIG11c3QgcmVsb2FkIGxwVG9uZURlc2MgYXMgcHJlcGFyZVdhdmUoKSBtYXkgY2hhbmdlIG1wVG9uZURlc2MKLSAgICAgICAgICAgICAgICBscFRvbmVEZXNjID0gbHBUb25lR2VuLT5tcFRvbmVEZXNjOwotICAgICAgICAgICAgfSBlbHNlIHsKLSAgICAgICAgICAgICAgICBBTE9HVygiQ2JrIHJlc3RhcnRpbmcgcHJlcGFyZVdhdmUoKSBmYWlsZWQiKTsKLSAgICAgICAgICAgICAgICBscFRvbmVHZW4tPm1TdGF0ZSA9IFRPTkVfSURMRTsKLSAgICAgICAgICAgICAgICBscFRvbmVHZW4tPm1wQXVkaW9UcmFjay0+c3RvcCgpOwotICAgICAgICAgICAgICAgIC8vIEZvcmNlIGxvb3AgZXhpdAotICAgICAgICAgICAgICAgIGxOdW1TbXAgPSAwOwotICAgICAgICAgICAgfQotICAgICAgICAgICAgbFNpZ25hbCA9IHRydWU7Ci0gICAgICAgICAgICBicmVhazsKLSAgICAgICAgY2FzZSBUT05FX1NUT1BQSU5HOgotICAgICAgICAgICAgQUxPR1YoIkNiayBTdG9wcGluZyIpOwotICAgICAgICAgICAgbHBUb25lR2VuLT5tU3RhdGUgPSBUT05FX1NUT1BQRUQ7Ci0gICAgICAgICAgICAvLyBGb3JjZSBsb29wIGV4aXQKLSAgICAgICAgICAgIGxOdW1TbXAgPSAwOwotICAgICAgICAgICAgYnJlYWs7Ci0gICAgICAgIGNhc2UgVE9ORV9TVE9QUEVEOgotICAgICAgICAgICAgbHBUb25lR2VuLT5tU3RhdGUgPSBUT05FX0lOSVQ7Ci0gICAgICAgICAgICBBTE9HVigiQ2JrIFN0b3BwZWQgdHJhY2siKTsKLSAgICAgICAgICAgIGxwVG9uZUdlbi0+bXBBdWRpb1RyYWNrLT5zdG9wKCk7Ci0gICAgICAgICAgICAvLyBGb3JjZSBsb29wIGV4aXQKLSAgICAgICAgICAgIGxOdW1TbXAgPSAwOwotICAgICAgICAgICAgYnVmZmVyLT5zaXplID0gMDsKLSAgICAgICAgICAgIGxTaWduYWwgPSB0cnVlOwotICAgICAgICAgICAgYnJlYWs7Ci0gICAgICAgIGNhc2UgVE9ORV9TVEFSVElORzoKLSAgICAgICAgICAgIEFMT0dWKCJDYmsgc3RhcnRpbmcgdHJhY2siKTsKLSAgICAgICAgICAgIGxwVG9uZUdlbi0+bVN0YXRlID0gVE9ORV9QTEFZSU5HOwotICAgICAgICAgICAgbFNpZ25hbCA9IHRydWU7Ci0gICAgICAgICAgICBicmVhazsKLSAgICAgICAgY2FzZSBUT05FX1BMQVlJTkc6Ci0gICAgICAgICAgICBicmVhazsKLSAgICAgICAgZGVmYXVsdDoKLSAgICAgICAgICAgIC8vIEZvcmNlIGxvb3AgZXhpdAotICAgICAgICAgICAgbE51bVNtcCA9IDA7Ci0gICAgICAgICAgICBidWZmZXItPnNpemUgPSAwOwotICAgICAgICAgICAgYnJlYWs7Ci0gICAgICAgIH0KLQotICAgICAgICBpZiAobFNpZ25hbCkKLSAgICAgICAgICAgIGxwVG9uZUdlbi0+bVdhaXRDYmtDb25kLnNpZ25hbCgpOwotICAgICAgICBscFRvbmVHZW4tPm1Mb2NrLnVubG9jaygpOwotICAgIH0KLX0KLQotCi0vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLwotLy8KLS8vICAgIE1ldGhvZDogICA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bG9uZyBsUzEsIGxTMjsKLSAgICBsb25nIGxBMSwgbEFtcGxpdHVkZTsKLSAgICBsb25nIFNhbXBsZTsgIC8vIGN1cnJlbnQgc2FtcGxlCi0KLSAgICAvLyBpbml0IGxvY2FsCi0gICAgaWYgKGNvbW1hbmQgPT0gV0FWRUdFTl9TVEFSVCkgewotICAgICAgICBsUzEgPSAobG9uZykwOwotICAgICAgICBsUzIgPSAobG9uZyltUzJfMDsKLSAgICB9IGVsc2UgewotICAgICAgICBsUzEgPSAobG9uZyltUzE7Ci0gICAgICAgIGxTMiA9IChsb25nKW1TMjsKLSAgICB9Ci0gICAgbEExID0gKGxvbmcpbUExX1ExNDsKLSAgICBsQW1wbGl0dWRlID0gKGxvbmcpbUFtcGxpdHVkZV9RMTU7Ci0KLSAgICBpZiAoY29tbWFuZCA9PSBXQVZFR0VOX1NUT1ApIHsKLSAgICAgICAgbEFtcGxpdHVkZSA8PD0gMTY7Ci0gICAgICAgIGlmIChjb3VudCA9PSAwKSB7Ci0gICAgICAgICAgICByZXR1cm47Ci0gICAgICAgIH0KLSAgICAgICAgbG9uZyBkZWMgPSBsQW1wbGl0dWRlL2NvdW50OwotICAgICAgICAvLyBsb29wIGdlbmVyYXRpb24KLSAgICAgICAgd2hpbGUgKGNvdW50LS0pIHsKLSAgICAgICAgICAgIFNhbXBsZSA9ICgobEExICogbFMxKSA+PiBTX1ExNCkgLSBsUzI7Ci0gICAgICAgICAgICAvLyBzaGlmdCBkZWxheQotICAgICAgICAgICAgbFMyID0gbFMxOwotICAgICAgICAgICAgbFMxID0gU2FtcGxlOwotICAgICAgICAgICAgU2FtcGxlID0gKChsQW1wbGl0dWRlPj4xNikgKiBTYW1wbGUpID4+IFNfUTE1OwotICAgICAgICAgICAgKihvdXRCdWZmZXIrKykgKz0gKHNob3J0KVNhbXBsZTsgIC8vIHB1dCByZXN1bHQgaW4gYnVmZmVyCi0gICAgICAgICAgICBsQW1wbGl0dWRlIC09IGRlYzsKLSAgICAgICAgf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ICAgICAgIHJldHVybiBJTlZBTElEX09QRVJBVElPTjsKLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICB9Ci0gICAgICAgIH0KLSAgICAgICAgdC0+bUxvY2subG9jaygpOwotICAgIH0KLQotICAgIHN0YXR1c190IHN0YXR1cyA9IEF1ZGlvRWZmZWN0OjpzZXRFbmFibGVkKGVuYWJsZWQpOwotCi0gICAgaWYgKHN0YXR1cyA9PSBOT19FUlJPUikgewotICAgICAgICBpZiAodCAhPSAwKSB7Ci0gICAgICAgICAgICBpZiAoZW5hYmxlZCkgewotICAgICAgICAgICAgICAgIHQtPnJ1bigiVmlzdWFsaXplciIpOwotICAgICAgICAgICAgfSBlbHNlIHsKLSAgICAgICAgICAgICAgICB0LT5yZXF1ZXN0RXhpdCgpOwotICAgICAgICAgICAgfQotICAgICAgICB9Ci0gICAgfQotCi0gICAgaWYgKHQgIT0gMCkgewotICAgICAgICB0LT5tTG9jay51bmxvY2soKTsKLSAgICB9Ci0KLSAgICByZXR1cm4gc3RhdHVzOwotfQotCi1zdGF0dXNfdCBWaXN1YWxpemVyOjpzZXRDYXB0dXJlQ2FsbEJhY2soY2FwdHVyZV9jYmtfdCBjYmssIHZvaWQqIHVzZXIsIHVpbnQzMl90IGZsYWdzLCB1aW50MzJfdCByYXRlKQotewotICAgIGlmIChyYXRlID4gQ0FQVFVSRV9SQVRFX01BWCkgewotICAgICAgICByZXR1cm4gQkFEX1ZBTFVFOwotICAgIH0KLSAgICBNdXRleDo6QXV0b2xvY2sgX2wobUNhcHR1cmVMb2NrKTsKLQotICAgIGlmIChtRW5hYmxlZCkgewotICAgICAgICByZXR1cm4gSU5WQUxJRF9PUEVSQVRJT047Ci0gICAgfQotCi0gICAgc3A8Q2FwdHVyZVRocmVhZD4gdCA9IG1DYXB0dXJlVGhyZWFkOwotICAgIGlmICh0ICE9IDApIHsKLSAgICAgICAgdC0+bUxvY2subG9jaygpOwotICAgIH0KLSAgICBtQ2FwdHVyZVRocmVhZC5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wPE1lZGlhUGxheWVyTGlzdGVuZXI+JiBsaXN0ZW5lcikKLXsKLSAgICBBTE9HVigic2V0TGlzdGVuZXIiKTsKLSAgICBNdXRleDo6QXV0b2xvY2sgX2wobUxvY2spOwotICAgIG1MaXN0ZW5lciA9IGxpc3RlbmVyOwotICAgIHJldHVybiBOT19FUlJPUjsKLX0KLQotCi1zdGF0dXNfdCBNZWRpYVBsYXllcjo6YXR0YWNoTmV3UGxheWVyKGNvbnN0IHNwPElNZWRpYVBsYXllcj4mIHBsYXllcikKLXsKLSAgICBzdGF0dXNfdCBlcnIgPSBVTktOT1dOX0VSUk9SOwotICAgIHNwPElNZWRpYVBsYXllcj4gcDsKLSAgICB7IC8vIHNjb3BlIGZvciB0aGUgbG9jawotICAgICAgICBNdXRleDo6QXV0b2xvY2sgX2wobUxvY2spOwotCi0gICAgICAgIGlmICggISggKG1DdXJyZW50U3RhdGUgJiBNRURJQV9QTEFZRVJfSURMRSkgfHwKLSAgICAgICAgICAgICAgICAobUN1cnJlbnRTdGF0ZSA9PSBNRURJQV9QTEFZRVJfU1RBVEVfRVJST1IgKSApICkgewotICAgICAgICAgICAgQUxPR0UoImF0dGFjaE5ld1BsYXllciBjYWxsZWQgaW4gc3RhdGUgJWQiLCBtQ3VycmVudFN0YXRlKTsKLSAgICAgICAgICAgIHJldHVybiBJTlZBTElEX09QRVJBVElPTjsKLSAgICAgICAgfQotCi0gICAgICAgIGNsZWFyX2woKTsKLSAgICAgICAgcCA9IG1QbGF5ZXI7Ci0gICAgICAgIG1QbGF5ZXIgPSBwbGF5ZXI7Ci0gICAgICAgIGlmIChwbGF5ZXIgIT0gMCkgewotICAgICAgICAgICAgbUN1cnJlbnRTdGF0ZSA9IE1FRElBX1BMQVlFUl9JTklUSUFMSVpFRDsKLSAgICAgICAgICAgIGVyciA9IE5PX0VSUk9SOwotICAgICAgICB9IGVsc2UgewotICAgICAgICAgICAgQUxPR0UoIlVuYWJsZSB0byB0byBjcmVhdGUgbWVkaWEg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vcmsgZXJyb3IgY29kZS4KLSAgICAgICAgLy8gZXh0MjogSW1wbGVtZW50YXRpb24gZGVwZW5kYW50IGVycm9yIGNvZGUuCi0gICAgICAgIEFMT0dFKCJlcnJvciAoJWQsICVkKSIsIGV4dDEsIGV4dDIpOwotICAgICAgICBtQ3VycmVudFN0YXRlID0gTUVESUFfUExBWUVSX1NUQVRFX0VSUk9SOwotICAgICAgICBpZiAobVByZXBhcmVTeW5jKQotICAgICAgICB7Ci0gICAgICAgICAgICBBTE9HVigic2lnbmFsIGFwcGxpY2F0aW9uIHRocmVhZCIpOwotICAgICAgICAgICAgbVByZXBhcmVTeW5jID0gZmFsc2U7Ci0gICAgICAgICAgICBtUHJlcGFyZVN0YXR1cyA9IGV4dDE7Ci0gICAgICAgICAgICBtU2lnbmFsLnNpZ25hbCgpOwotICAgICAgICAgICAgc2VuZCA9IGZhbHNlOwotICAgICAgICB9Ci0gICAgICAgIGJyZWFrOwotICAgIGNhc2UgTUVESUFfSU5GTzoKLSAgICAgICAgLy8gZXh0MTogTWVkaWEgZnJhbWV3b3JrIGVycm9yIGNvZGUuCi0gICAgICAgIC8vIGV4dDI6IEltcGxlbWVudGF0aW9uIGRlcGVuZGFudCBlcnJvciBjb2RlLgotICAgICAgICBpZiAoZXh0MSAhPSBNRURJQV9JTkZPX1ZJREVPX1RSQUNLX0xBR0dJTkcpIHsKLSAgICAgICAgICAgIEFMT0dXKCJpbmZvL3dhcm5pbmcgKCVkLCAlZCkiLCBleHQxLCBleHQyKTsKLSAgICAgICAgfQotICAgICAgICBicmVhazsKLSAgICBjYXNlIE1FRElBX1NFRUtfQ09NUExFVEU6Ci0gICAgICAgIEFMT0dWKCJSZWNlaXZlZCBzZWVrIGNvbXBsZXRlIik7Ci0gICAgICAgIGlmIChtU2Vla1Bvc2l0aW9uICE9IG1DdXJyZW50UG9zaXRpb24pIHsKLSAgICAgICAgICAgIEFMT0dWKCJFeGVjdXRpbmcgcXVldWVkIHNlZWtUbyglZCkiLCB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nJlc2V0KCkKLXsKLSAgICBBTE9HVigicmVzZXQiKTsKLSAgICBpZiAobU1lZGlhUmVjb3JkZXIgPT0gTlVMTCkgewotICAgICAgICBBTE9HRSgibWVkaWEgcmVjb3JkZXIgaXMgbm90IGluaXRpYWxpemVkIHlldCIpOwotICAgICAgICByZXR1cm4gSU5WQUxJRF9PUEVSQVRJT047Ci0gICAgfQotCi0gICAgZG9DbGVhblVwKCk7Ci0gICAgc3RhdHVzX3QgcmV0ID0gVU5LTk9XTl9FUlJPUjsKLSAgICBzd2l0Y2ggKG1DdXJyZW50U3RhdGUpIHsKLSAgICAgICAgY2FzZSBNRURJQV9SRUNPUkRFUl9JRExFOgotICAgICAgICAgICAgcmV0ID0gT0s7Ci0gICAgICAgICAgICBicmVhazsKLQotICAgICAgICBjYXNlIE1FRElBX1JFQ09SREVSX1JFQ09SRElORzoKLSAgICAgICAgY2FzZSBNRURJQV9SRUNPUkRFUl9EQVRBU09VUkNFX0NPTkZJR1VSRUQ6Ci0gICAgICAgIGNhc2UgTUVESUFfUkVDT1JERVJfUFJFUEFSRUQ6Ci0gICAgICAgIGNhc2UgTUVESUFfUkVDT1JERVJfRVJST1I6IHsKLSAgICAgICAgICAgIHJldCA9IGRvUmVzZXQoKTsKLSAgICAgICAgICAgIGlmIChPSyAhPSByZXQpIHsKLSAgICAgICAgICAgICAgICByZXR1cm4gcmV0OyAgLy8gTm8gbmVlZCB0byBjb250aW51ZQotICAgICAgICAgICAgfQotICAgICAgICB9ICAvLyBJbnRlbnRpb25hbCBmYWxsIHRocm91Z2gKLSAgICAgICAgY2FzZSBNRURJQV9SRUNPUkRFUl9JTklUSUFMSVpFRDoKLSAgICAgICAgICAgIHJldCA9IGNsb3NlKCk7Ci0gICAgICAgICAgICBicmVhazsKLQotICAgICAgICBkZWZhdWx0OiB7Ci0gICAgICAgICAgICBBTE9HRSgiVW5leHBlY3RlZCBub24tZXhpc3Rpbmcgc3RhdGU6ICVkIiwgbUN1cnJlbnRTdGF0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dGl2ZSAgICAgICAJCQlcCi0JbGliY2FtZXJhX2NsaWVudCAgICAgIAkJCVwKLQlsaWJhbmRyb2lkX3J1bnRpbWUgICAgCQkJXAotCWxpYnN0YWdlZnJpZ2h0ICAgICAgICAJCQlcCi0JbGlic3RhZ2VmcmlnaHRfb214ICAgIAkJCVwKLQlsaWJzdGFnZWZyaWdodF9mb3VuZGF0aW9uICAgICAgIFwKLQlsaWJndWkgICAgICAgICAgICAgICAgICAgICAgICAgIFwKLQlsaWJkbCAgICAgICAgICAgICAgICAgICAgICAgICAgIFwKLQlsaWJhYWhfcnRwCi0KLUxPQ0FMX1NUQVRJQ19MSUJSQVJJRVMgOj0gXAotICAgICAgICBsaWJzdGFnZWZyaWdodF9udXBsYXllciAgICAgICAgICAgICAgICAgXAotICAgICAgICBsaWJzdGFnZWZyaWdodF9ydHNwICAgICAgICAgICAgICAgICAgICAgXAotCi1MT0NBTF9DX0lOQ0xVREVTIDo9ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBcCi0JJChjYWxsIGluY2x1ZGUtcGF0aC1mb3IsIGdyYXBoaWNzIGNvcmVjZykgICAgICAgICAgICAgICAgICAgICAgIFwKLQkkKFRPUCkvZnJhbWV3b3Jrcy9iYXNlL21lZGlhL2xpYnN0YWdlZnJpZ2h0L2luY2x1ZGUgICAgICAgICAgICAgXAotCSQoVE9QKS9mcmFtZXdvcmtzL2Jhc2UvbWVkaWEvbGlic3RhZ2VmcmlnaHQvcnRzcCAgICAgICAgICAgICAgICBcCi0JJChUT1ApL2ZyYW1ld29ya3MvbmF0aXZlL2luY2x1ZGUvbWVkaWEvb3Blbm1heCAgICAgICAgICAgICAgICAgIFwKLQkkKFRPUCkvZXh0ZXJuYWwvdHJlbW9sby9UcmVtb2xvICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXAotCi1MT0NBTF9NT0RVTEU6PSBsaWJtZWRpYXBsYXllcnNlcnZpY2UKLQotaW5jbHVkZSA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gNjQ7ICAvLyBJIHB1bGxlZCB0aGF0IG91dCBvZiB0aGluIGFpci4KLQotLy8gRklYTUU6IE1vdmUgYWxsIHRoZSBtZXRhZGF0YSByZWxhdGVkIGZ1bmN0aW9uIGluIHRoZSBNZXRhZGF0YS5jcHAKLQotCi0vLyBVbm1hcnNoYWxsIGEgZmlsdGVyIGZyb20gYSBQYXJjZWwuCi0vLyBGaWx0ZXIgZm9ybWF0IGluIGEgcGFyY2VsOgotLy8KLS8vICAwIDEgMiAzIDQgNSA2IDcgOCA5IDAgMSAyIDMgNCA1IDYgNyA4IDkgMCAxIDIgMyA0IDUgNiA3IDggOSAwIDEKLS8vICstKy0rLSstKy0rLSstKy0rLSstKy0rLSstKy0rLSstKy0rLSstKy0rLSstKy0rLSstKy0rLSstKy0rLSstKy0rCi0vLyB8ICAgICAgICAgICAgICAgICAgICAgICBudW1iZXIgb2YgZW50cmllcyAobikgICAgICAgICAgICAgICAgICAgfAotLy8gKy0rLSstKy0rLSstKy0rLSstKy0rLSstKy0rLSstKy0rLSstKy0rLSstKy0rLSstKy0rLSstKy0rLSstKy0rLSsKLS8vIHwgICAgICAgICAgICAgICAgICAgICAgIG1ldGFkYXRhIHR5cGUgMSAgICAgICAgICAgICAgICAgICAgICAgICB8Ci0vLyArLSstKy0rLSstKy0rLSstKy0rLSstKy0rLSstKy0rLSstKy0rLSstKy0rLSstKy0rLSstKy0rLSstKy0rLSstKwotLy8gfCAgICAgICAgICAgICAgICAgICAgICAgbWV0YWRhdGEgdHlwZSAyICAgICAgICAgICAgICAgICAgICAgICAgIHwKLS8vICstKy0rLSstKy0rLSstKy0rLSstKy0rLSstKy0rLSstKy0rLSstKy0rLSstKy0rLSstKy0rLSstKy0rLSstKy0rCi0vLyAgLi4uLgotLy8gKy0rLSstKy0rLSstKy0rLSstKy0rLSstKy0rLSstKy0rLSstKy0rLSstKy0rLSstKy0rLSstKy0rLSstKy0rLSsKLS8vIHwgICAgICAgICAgICAgICAgICAgICAgIG1ldG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lckNsaWVudCBwaWQoJWQpXG4iLCBjLT5tUGlkKTsKLSAgICAgICAgICAgICAgICAgICAgcmVzdWx0LmFwcGVuZChidWZmZXIpOwotICAgICAgICAgICAgICAgICAgICB3cml0ZShmZCwgcmVzdWx0LnN0cmluZygpLCByZXN1bHQuc2l6ZSgpKTsKLSAgICAgICAgICAgICAgICAgICAgcmVzdWx0ID0gIlxuIjsKLSAgICAgICAgICAgICAgICAgICAgYy0+ZHVtcChmZCwgYXJncyk7Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgfQotICAgICAgICB9Ci0KLSAgICAgICAgcmVzdWx0LmFwcGVuZCgiIEZpbGVzIG9wZW5lZCBhbmQvb3IgbWFwcGVkOlxuIik7Ci0gICAgICAgIHNucHJpbnRmKGJ1ZmZlciwgU0laRSwgIi9wcm9jLyVkL21hcHMiLCBnZXR0aWQoKSk7Ci0gICAgICAgIEZJTEUgKmYgPSBmb3BlbihidWZmZXIsICJyIik7Ci0gICAgICAgIGlmIChmKSB7Ci0gICAgICAgICAgICB3aGlsZSAoIWZlb2YoZikpIHsKLSAgICAgICAgICAgICAgICBmZ2V0cyhidWZmZXIsIFNJWkUsIGYpOwotICAgICAgICAgICAgICAgIGlmIChzdHJzdHIoYnVmZmVyLCAiIC9tbnQvc2RjYXJkLyIpIHx8Ci0gICAgICAgICAgICAgICAgICAgIHN0cnN0cihidWZmZXIsICIgL3N5c3RlbS9zb3VuZHMvIikgfHwKLSAgICAgICAgICAgICAgICAgICAgc3Ryc3RyKGJ1ZmZlciwgIiAvZGF0YS8iKSB8fAotICAgICAgICAgICAgICAgICAgICBzdHJzdHIoYnVmZmVyLCAiIC9zeXN0ZW0vbWVkaWEvIikpIHsKLSAgICAgICAgICAgICAgICAgICAgcmVzdWx0LmFwcGVuZCgiICAiKTsKLSAgICAgICAgICAgICAgICAgICAgcmVzdWx0LmFwcGVuZChidWZmZXIpOwotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgIH0KLSAgICAgICAgICAgIGZjbG9zZShmKTsKLSAgICAgICAgfSBlbHNlIHsKLSAgICAgICAgICAgIHJlc3VsdC5hcHBlbmQoImNvdWxkbid0IG9wZW4gIik7Ci0gICAgICAgICAgICByZXN1bHQuYXBwZW5kKGJ1ZmZlcik7Ci0gICAgICAgICAgICByZXN1bHQuYXBwZW5kKCJcbiIpOwotICAgICAgICB9Ci0KLSAgICAgICAgc25wcmludGYoYnVmZmVyLCBTSVpFLCAiL3Byb2MvJWQvZmQiLCBnZXR0aWQoKSk7Ci0gICAgICAgIERJUiAqZCA9IG9wZW5kaXIoYnVmZmVyKTsKLSAgICAgICAgaWYgKGQpIHsKLSAgICAgICAgICAgIHN0cnVjdCBkaXJlbnQgKmVudDsKLSAgICAgICAgICAgIHdoaWxlKChlbnQgPSByZWFkZGlyKGQpKSAhPSBOVUxMKSB7Ci0gICAgICAgICAgICAgICAgaWYgKHN0cmNtcChlbnQtPmRfbmFtZSwiLiIpICYmIHN0cmNtcChlbnQtPmRfbmFtZSwiLi4iKSkgewotICAgICAgICAgICAgICAgICAgICBzbnByaW50ZihidWZmZXIsIFNJWkUsICIvcHJvYy8lZC9mZC8lcyIsIGdldHRpZCgpLCBlbnQtPmRfbmFtZSk7Ci0gICAgICAgICAgICAgICAgICAgIHN0cnVjdCBzdGF0IHM7Ci0gICAgICAgICAgICAgICAgICAgIGlmIChsc3RhdChidWZmZXIsICZzKSA9PSAwKSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICBpZiAoKHMuc3RfbW9kZSAmIFNfSUZNVCkgPT0gU19JRkxOSykgewotICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNoYXIgbGlua3RvWzI1Nl07Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgaW50IGxlbiA9IHJlYWRsaW5rKGJ1ZmZlciwgbGlua3RvLCBzaXplb2YobGlua3RvKSk7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYobGVuID4gMCkgewotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZihsZW4gPiAyNTUpIHsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxpbmt0b1syNTJdID0gJy4nOwotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbGlua3RvWzI1M10gPSAnLic7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBsaW5rdG9bMjU0XSA9ICcuJzsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxpbmt0b1syNTVdID0gMDsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxpbmt0b1tsZW5dID0gMDsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoc3Ryc3RyKGxpbmt0bywgIi9tbnQvc2RjYXJkLyIpID09IGxpbmt0byB8fAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc3Ryc3RyKGxpbmt0bywgIi9zeXN0ZW0vc291bmRzLyIpID09IGxpbmt0byB8fAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc3Ryc3RyKGxpbmt0bywgIi9kYXRhLyIpID09IGxpbmt0byB8fAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc3Ryc3RyKGxpbmt0bywgIi9zeXN0ZW0vbWVkaWEvIikgPT0gbGlua3RvKSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXN1bHQuYXBwZW5kKCIgICIpOwotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmVzdWx0LmFwcGVuZChidWZmZXIpOwotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmVzdWx0LmFwcGVuZCgiIC0+ICIpOwotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmVzdWx0LmFwcGVuZChsaW5rdG8pOwotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmVzdWx0LmFwcGVuZCgiXG4iKTsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgcmVzdWx0LmFwcGVuZCgiICB1bmV4cGVjdGVkIHR5cGUgZm9yICIpOwotICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJlc3VsdC5hcHBlbmQoYnVmZmVyKTsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXN1bHQuYXBwZW5kKCJcbiIpOwotICAgICAgICAgICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgfQotICAgICAgICAgICAgY2xvc2VkaXIoZCk7Ci0gICAgICAgIH0gZWxzZSB7Ci0gICAgICAgICAgICByZXN1bHQuYXBwZW5kKCJjb3VsZG4ndCBvcGVuICIpOwotICAgICAgICAgICAgcmVzdWx0LmFwcGVuZChidWZmZXIpOwotICAgICAgICAgICAgcmVzdWx0LmFwcGVuZCgiXG4iKTsKLSAgICAgICAgfQotCi0gICAgICAgIGJvb2wgZHVtcE1lbSA9IGZhbHNlOwotICAgICAgICBmb3IgKHNpemVfdCBpID0gMDsgaSA8IGFyZ3Muc2l6ZSgpOyBpKyspIHsKLSAgICAgICAgICAgIGlmIChhcmdzW2ldID09IFN0cmluZzE2KCItbSIpKSB7Ci0gICAgICAgICAgICAgICAgZHVtcE1lbSA9IHRydWU7Ci0gICAgICAgICAgICB9Ci0gICAgICAgIH0KLSAgICAgICAgaWYgKGR1bXBNZW0pIHsKLSAgICAgICAgICAgIGR1bXBNZW1vcnlBZGRyZXNzZXMoZmQpOwotICAgICAgICB9Ci0gICAgfQotICAgIHdyaXRlKG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bbGVuIC0gNV0pKSB7Ci0gICAgICAgICAgICByZXR1cm4gTlVfUExBWUVSOwotICAgICAgICB9Ci0KLSAgICAgICAgaWYgKHN0cnN0cih1cmwsIm0zdTgiKSkgewotICAgICAgICAgICAgcmV0dXJuIE5VX1BMQVlFUjsKLSAgICAgICAgfQotICAgIH0KLQotICAgIGlmICghc3RybmNhc2VjbXAoInJ0c3A6Ly8iLCB1cmwsIDcpKSB7Ci0gICAgICAgIHJldHVybiBOVV9QTEFZRVI7Ci0gICAgfQotCi0gICAgaWYgKCFzdHJuY2FzZWNtcCgiYWFoUlg6Ly8iLCB1cmwsIDgpKSB7Ci0gICAgICAgIHJldHVybiBBQUhfUlhfUExBWUVSOwotICAgIH0KLQotICAgIC8vIHVzZSBNaWRpRmlsZSBmb3IgTUlESSBleHRlbnNpb25zCi0gICAgaW50IGxlblVSTCA9IHN0cmxlbih1cmwpOwotICAgIGZvciAoaW50IGkgPSAwOyBpIDwgTkVMRU0oRklMRV9FWFRTKTsgKytpKSB7Ci0gICAgICAgIGludCBsZW4gPSBzdHJsZW4oRklMRV9FWFRTW2ldLmV4dGVuc2lvbik7Ci0gICAgICAgIGludCBzdGFydCA9IGxlblVSTCAtIGxlbjsKLSAgICAgICAgaWYgKHN0YXJ0ID4gMCkgewotICAgICAgICAgICAgaWYgKCFzdHJuY2FzZWNtcCh1cmwgKyBzdGFydCwgRklMRV9FWFRTW2ldLmV4dGVuc2lvbiwgbGVuKSkgewotICAgICAgICAgICAgICAgIHJldHVybiBGSUxFX0VYVFNbaV0ucGxheWVydHlwZTsKLSAgICAgICAgICAgIH0KLSAgICAgICAgfQotICAgIH0KLQotICAgIHJldHVybiBnZXREZWZhdWx0UGxheWVyVHlwZSgpOwotfQotCi1wbGF5ZXJfdHlwZSBNZWRpYVBsYXllclNlcnZpY2U6OkNsaWVudDo6Z2V0UGxheWVyVHlwZShpbnQgZmQsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg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UExBWUVSOgotICAgICAgICAgICAgQUxPR1YoIiBjcmVhdGUgTnVQbGF5ZXIiKTsKLSAgICAgICAgICAgIHAgPSBuZXcgTnVQbGF5ZXJEcml2ZXI7Ci0gICAgICAgICAgICBicmVhazsKLSAgICAgICAgY2FzZSBURVNUX1BMQVlFUjoKLSAgICAgICAgICAgIEFMT0dWKCJDcmVhdGUgVGVzdCBQbGF5ZXIgc3R1YiIpOwotICAgICAgICAgICAgcCA9IG5ldyBUZXN0UGxheWVyU3R1YigpOwotICAgICAgICAgICAgYnJlYWs7Ci0gICAgICAgIGNhc2UgQUFIX1JYX1BMQVlFUjoKLSAgICAgICAgICAgIEFMT0dWKCIgY3JlYXRlIEFASCBSWCBQbGF5ZXIiKTsKLSAgICAgICAgICAgIHAgPSBjcmVhdGVBQUhfUlhQbGF5ZXIoKTsKLSAgICAgICAgICAgIGJyZWFrOwotICAgICAgICBjYXNlIEFBSF9UWF9QTEFZRVI6Ci0gICAgICAgICAgICBBTE9HVigiIGNyZWF0ZSBBQEggVFggUGxheWVyIik7Ci0gICAgICAgICAgICBwID0gY3JlYXRlQUFIX1RYUGxheWVyKCk7Ci0gICAgICAgICAgICBicmVhazsKLSAgICAgICAgZGVmYXVsdDoKLSAgICAgICAgICAgIEFMT0dFKCJVbmtub3duIHBsYXllciB0eXBlOiAlZCIsIHBsYXllclR5cGUpOwotICAgICAgICAgICAgcmV0dXJuIE5VTEw7Ci0gICAgfQotICAgIGlmIChwICE9IE5VTEwpIHsKLSAgICAgICAgaWYgKHAtPmluaXRDaGVjaygpID09IE5PX0VSUk9SKSB7Ci0gICAgICAgICAgICBwLT5zZXROb3RpZnlDYWxsYmFjayhjb29raWUsIG5vdGlmeUZ1bmMpOwotICAgICAgICB9IGVsc2UgewotICAgICAgICAgICAgcC5jbGVhcigpOwotICAgICAgICB9Ci0gICAgfQotICAgIGlmIChwID09IE5VTEwpIHsKLSAgICAgICAgQUxPR0UoIkZhaWxlZCB0byBjcmVhdGUgcGxheWV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bnQ6OnNldERhdGFTb3VyY2UoCi0gICAgICAgIGNvbnN0IGNoYXIgKnVybCwgY29uc3QgS2V5ZWRWZWN0b3I8U3RyaW5nOCwgU3RyaW5nOD4gKmhlYWRlcnMpCi17Ci0gICAgQUxPR1YoInNldERhdGFTb3VyY2UoJXMpIiwgdXJsKTsKLSAgICBpZiAodXJsID09IE5VTEwpCi0gICAgICAgIHJldHVybiBVTktOT1dOX0VSUk9SOwotCi0gICAgaWYgKChzdHJuY21wKHVybCwgImh0dHA6Ly8iLCA3KSA9PSAwKSB8fAotICAgICAgICAoc3RybmNtcCh1cmwsICJodHRwczovLyIsIDgpID09IDApIHx8Ci0gICAgICAgIChzdHJuY21wKHVybCwgInJ0c3A6Ly8iLCA3KSA9PSAwKSkgewotICAgICAgICBpZiAoIWNoZWNrUGVybWlzc2lvbigiYW5kcm9pZC5wZXJtaXNzaW9uLklOVEVSTkVUIikpIHsKLSAgICAgICAgICAgIHJldHVybiBQRVJNSVNTSU9OX0RFTklFRDsKLSAgICAgICAgfQotICAgIH0KLQotICAgIGlmIChzdHJuY21wKHVybCwgImNvbnRlbnQ6Ly8iLCAxMCkgPT0gMCkgewotICAgICAgICAvLyBnZXQgYSBmaWxlZGVzY3JpcHRvciBmb3IgdGhlIGNvbnRlbnQgVXJpIGFuZAotICAgICAgICAvLyBwYXNzIGl0IHRvIHRoZSBzZXREYXRhU291cmNlKGZkKSBtZXRob2QKLQotICAgICAgICBTdHJpbmcxNiB1cmwxNih1cmwpOwotICAgICAgICBpbnQgZmQgPSBhbmRyb2lkOjpvcGVuQ29udGVudFByb3ZpZGVyRmlsZSh1cmwxNik7Ci0gICAgICAgIGlmIChmZCA8IDApCi0gICAgICAgIHsKLSAgICAgICAgICAgIEFMT0dFKCJDb3VsZG4ndCBvcGVuIGZkIGZvciAlcyIsIHVybCk7Ci0gICAgICAgICAgICByZXR1cm4gVU5LTk9XTl9FUlJPUjsKLSAgICAgICAgfQotICAgICAgICBzZXREYXRhU291cmNlK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IGlmIChwID09IDApIHJldHVybiBVTktOT1dOX0VSUk9SOwotICAgICpzdGF0ZSA9IHAtPmlzUGxheWluZygpOwotICAgIEFMT0dWKCJbJWRdIGlzUGxheWluZzogJWQiLCBtQ29ubklkLCAqc3RhdGUpOwotICAgIHJldHVybiBOT19FUlJPUjsKLX0KLQotc3RhdHVzX3QgTWVkaWFQbGF5ZXJTZXJ2aWNlOjpDbGllbnQ6OmdldEN1cnJlbnRQb3NpdGlvbihpbnQgKm1zZWMpCi17Ci0gICAgQUxPR1YoImdldEN1cnJlbnRQb3NpdGlvbiIpOwotICAgIHNwPE1lZGlhUGxheWVyQmFzZT4gcCA9IGdldFBsYXllcigpOwotICAgIGlmIChwID09IDApIHJldHVybiBVTktOT1dOX0VSUk9SOwotICAgIHN0YXR1c190IHJldCA9IHAtPmdldEN1cnJlbnRQb3NpdGlvbihtc2VjKTsKLSAgICBpZiAocmV0ID09IE5PX0VSUk9SKSB7Ci0gICAgICAgIEFMT0dWKCJbJWRdIGdldEN1cnJlbnRQb3NpdGlvbiA9ICVkIiwgbUNvbm5JZCwgKm1zZWMpOwotICAgIH0gZWxzZSB7Ci0gICAgICAgIEFMT0dFKCJnZXRDdXJyZW50UG9zaXRpb24gcmV0dXJuZWQgJWQiLCByZXQpOwotICAgIH0KLSAgICByZXR1cm4gcmV0OwotfQotCi1zdGF0dXNfdCBNZWRpYVBsYXllclNlcnZpY2U6OkNsaWVudDo6Z2V0RHVyYXRpb24oaW50ICptc2VjKQotewotICAgIEFMT0dWKCJnZXREdXJhdGlvbiIpOwotICAgIHNwPE1lZGlhUGxheWVyQmFzZT4gcCA9IGdldFBsYXllcigpOwotICAgIGlmIChwID09IDApIHJldHVybiBVTktOT1dOX0VSUk9SOwotICAgIHN0YXR1c190IHJldCA9IHAtPmdldER1cmF0aW9uKG1zZWMpOwotICAgIGlmIChyZXQgPT0gTk9fRVJST1IpIHsKLSAgICAgICAgQUxPR1YoIlslZF0gZ2V0RHVyYXRpb24gPSAlZ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TlZBTElEX09QRVJBVElPTjsKLQotICAgIGlmIChOVUxMICE9IGVuZHBvaW50KSB7Ci0gICAgICAgIG1SZXRyYW5zbWl0RW5kcG9pbnQgPSAqZW5kcG9pbnQ7Ci0gICAgICAgIG1SZXRyYW5zbWl0RW5kcG9pbnRWYWxpZCA9IHRydWU7Ci0gICAgfSBlbHNlIHsKLSAgICAgICAgbVJldHJhbnNtaXRFbmRwb2ludFZhbGlkID0gZmFsc2U7Ci0gICAgfQotCi0gICAgcmV0dXJuIE5PX0VSUk9SOwotfQotCi12b2lkIE1lZGlhUGxheWVyU2VydmljZTo6Q2xpZW50Ojpub3RpZnkoCi0gICAgICAgIHZvaWQqIGNvb2tpZSwgaW50IG1zZywgaW50IGV4dDEsIGludCBleHQyLCBjb25zdCBQYXJjZWwgKm9iaikKLXsKLSAgICBDbGllbnQqIGNsaWVudCA9IHN0YXRpY19jYXN0PENsaWVudCo+KGNvb2tpZSk7Ci0KLSAgICB7Ci0gICAgICAgIE11dGV4OjpBdXRvbG9jayBsKGNsaWVudC0+bUxvY2spOwotICAgICAgICBpZiAobXNnID09IE1FRElBX1BMQVlCQUNLX0NPTVBMRVRFICYmIGNsaWVudC0+bU5leHRDbGllbnQgIT0gTlVMTCkgewotICAgICAgICAgICAgY2xpZW50LT5tQXVkaW9PdXRwdXQtPnN3aXRjaFRvTmV4dE91dHB1dCgpOwotICAgICAgICAgICAgY2xpZW50LT5tTmV4dENsaWVudC0+c3RhcnQoKTsKLSAgICAgICAgICAgIGNsaWVudC0+bU5leHRDbGllbnQtPm1DbGllbnQtPm5vdGlmeShNRURJQV9JTkZPLCBNRURJQV9JTkZPX1NUQVJURURfQVNfTkVYVCwgMCwgb2JqKTsKLSAgICAgICAgfQotICAgIH0KLQotICAgIGlmIChNRURJQV9JTkZPID09IG1zZyAmJgotICAgICAgICBNRURJQV9JTkZPX01FVEFEQVRBX1VQREFURSA9PSBleHQxKSB7Ci0gICAgICAgIGNvbnN0IG1lZGlhOjpNZXRh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Ci0gICAgICAgICAgICAgICAgZm9ybWF0LAotICAgICAgICAgICAgICAgIGNoYW5uZWxNYXNrLAotICAgICAgICAgICAgICAgIGZyYW1lQ291bnQsCi0gICAgICAgICAgICAgICAgQVVESU9fUE9MSUNZX09VVFBVVF9GTEFHX05PTkUsCi0gICAgICAgICAgICAgICAgQ2FsbGJhY2tXcmFwcGVyLAotICAgICAgICAgICAgICAgIG1DYWxsYmFja0RhdGEsCi0gICAgICAgICAgICAgICAgMCwgIC8vIG5vdGlmaWNhdGlvbiBmcmFtZXMKLSAgICAgICAgICAgICAgICBtU2Vzc2lvbklkKTsKLSAgICB9IGVsc2UgewotICAgICAgICB0ID0gbmV3IEF1ZGlvVHJhY2soCi0gICAgICAgICAgICAgICAgbVN0cmVhbVR5cGUsCi0gICAgICAgICAgICAgICAgc2FtcGxlUmF0ZSwKLSAgICAgICAgICAgICAgICBmb3JtYXQsCi0gICAgICAgICAgICAgICAgY2hhbm5lbE1hc2ssCi0gICAgICAgICAgICAgICAgZnJhbWVDb3VudCwKLSAgICAgICAgICAgICAgICBBVURJT19QT0xJQ1lfT1VUUFVUX0ZMQUdfTk9ORSwKLSAgICAgICAgICAgICAgICBOVUxMLAotICAgICAgICAgICAgICAgIE5VTEwsCi0gICAgICAgICAgICAgICAgMCwKLSAgICAgICAgICAgICAgICBtU2Vzc2lvbklkKTsKLSAgICB9Ci0KLSAgICBpZiAoKHQgPT0gMCkgfHwgKHQtPmluaXRDaGVjaygpICE9IE5PX0VSUk9SKSkgewotICAgICAgICBBTE9HRSgiVW5hYmxlIHRvIGNyZWF0ZSBhdWRpbyB0cmFjayIpOwotICAgICAgICBkZWxldGUgdDsKLSAgICAgICAgcmV0dXJuIE5PX0lOSVQ7Ci0gICAgfQotCi0gICAgQUxPR1YoInNldFZvbHVtZSIpOwotICAgIHQtPnNldFZvbHVtZShtTGVmdFZvbHVtZSwgbVJpZ2h0Vm9sdW1lKTsKLQotICAgIG1TYW1wbGVSYXRlSHogPSBzYW1w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ga0JhdHRlcnlEYXRhU3BlYWtlck9uKQotICAgICAgICAgICAgfHwgKHBhcmFtcyAmIGtCYXR0ZXJ5RGF0YU90aGVyQXVkaW9EZXZpY2VPbikpIHsKLQotICAgICAgICBpbnQgZGV2aWNlT25bTlVNX0FVRElPX0RFVklDRVNdOwotICAgICAgICBmb3IgKGludCBpID0gMDsgaSA8IE5VTV9BVURJT19ERVZJQ0VTOyBpKyspIHsKLSAgICAgICAgICAgIGRldmljZU9uW2ldID0gMDsKLSAgICAgICAgfQotCi0gICAgICAgIGlmICgocGFyYW1zICYga0JhdHRlcnlEYXRhU3BlYWtlck9uKQotICAgICAgICAgICAgICAgICYmIChwYXJhbXMgJiBrQmF0dGVyeURhdGFPdGhlckF1ZGlvRGV2aWNlT24pKSB7Ci0gICAgICAgICAgICBkZXZpY2VPbltTUEVBS0VSX0FORF9PVEhFUl0gPSAxOwotICAgICAgICB9IGVsc2UgaWYgKHBhcmFtcyAmIGtCYXR0ZXJ5RGF0YVNwZWFrZXJPbikgewotICAgICAgICAgICAgZGV2aWNlT25bU1BFQUtFUl0gPSAxOwotICAgICAgICB9IGVsc2UgewotICAgICAgICAgICAgZGV2aWNlT25bT1RIRVJfQVVESU9fREVWSUNFXSA9IDE7Ci0gICAgICAgIH0KLQotICAgICAgICBmb3IgKGludCBpID0gMDsgaSA8IE5VTV9BVURJT19ERVZJQ0VTOyBpKyspIHsKLSAgICAgICAgICAgIGlmIChtQmF0dGVyeUF1ZGlvLmRldmljZU9uW2ldICE9IGRldmljZU9uW2ldKXsKLQotICAgICAgICAgICAgICAgIGlmIChtQmF0dGVyeUF1ZGlvLnJlZkNvdW50ID4gMCkgeyAvLyBpZiBwbGF5aW5nIGF1ZGlvCi0gICAgICAgICAgICAgICAgICAgIGlmICghZGV2aWNlT25baV0pIHsKLSAgICAgICAgICAgICAgICAgICAgICAgIG1CYXR0ZXJ5QXVkaW8ubGFzdFRpbWVbaV0gKz0gdGltZTsKLSAgICAgICAgICAgICAgICAgICAgICAgIG1CYXR0ZXJ5QXVkaW8udG90YWxUaW1lW2ldICs9IG1CYXR0ZXJ5QXVkaW8ubGFzdFRpbWVbaV07Ci0gICAgICAgICAgICAgICAgICAgICAgICBtQmF0dGVyeUF1ZGlvLmxhc3RUaW1lW2ldID0gMDsKLSAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHsKLSAgICAgICAgICAgICAgICAgICAgICAgIG1CYXR0ZXJ5QXVkaW8ubGFzdFRpbWVbaV0gPSAwIC0gdGltZTsKLSAgICAgICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgICAgIG1CYXR0ZXJ5QXVkaW8uZGV2aWNlT25baV0gPSBkZXZpY2VPbltpXTsKLSAgICAgICAgICAgIH0KLSAgICAgICAgfQotICAgICAgICByZXR1cm47Ci0gICAgfQotCi0gICAgLy8gYW4gc3VkaW8gc3RyZWFtIGlzIHN0YXJ0ZWQKLSAgICBpZiAocGFyYW1zICYga0JhdHRlcnlEYXRhQXVkaW9GbGluZ2VyU3RhcnQpIHsKLSAgICAgICAgLy8gcmVjb3JkIHRoZSBzdGFydCB0aW1lIG9ubHkgaWYgY3VycmVudGx5IG5vIG90aGVyIGF1ZGlvCi0gICAgICAgIC8vIGlzIGJlaW5nIHBsYXllZAotICAgICAgICBpZiAobUJhdHRlcnlBdWRpby5yZWZDb3VudCA9PSAwKSB7Ci0gICAgICAgICAgICBmb3IgKGludCBpID0gMDsgaSA8IE5VTV9BVURJT19ERVZJQ0VTOyBpKyspIHsKLSAgICAgICAgICAgICAgICBpZiAobUJhdHRlcnlBdWRpby5kZXZpY2VPbltpXSkgewotICAgICAgICAgICAgICAgICAgICBtQmF0dGVyeUF1ZGlvLmxhc3RUaW1lW2ldIC09IHRpbWU7Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgfQotICAgICAgICB9Ci0KLSAgICAgICAgbUJhdHRlcnlBdWRpby5yZWZDb3VudCArKzsKLSAgICAgICAgcmV0dXJ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50ICsrOwotICAgICAgICB9Ci0gICAgfSBlbHNlIHsKLSAgICAgICAgaWYgKGluZm8ucmVmQ291bnQgPT0gMCkgewotICAgICAgICAgICAgQUxPR1coIkJhdHRlcnkgdHJhY2sgd2FybmluZzogcmVmQ291bnQgaXMgYWxyZWFkeSAwIik7Ci0gICAgICAgICAgICByZXR1cm47Ci0gICAgICAgIH0gZWxzZSBpZiAoaW5mby5yZWZDb3VudCA8IDApIHsKLSAgICAgICAgICAgIEFMT0dFKCJCYXR0ZXJ5IHRyYWNrIGVycm9yOiByZWZDb3VudCA8IDAiKTsKLSAgICAgICAgICAgIG1CYXR0ZXJ5RGF0YS5yZW1vdmVJdGVtKHVpZCk7Ci0gICAgICAgICAgICByZXR1cm47Ci0gICAgICAgIH0KLQotICAgICAgICBpZiAocGFyYW1zICYga0JhdHRlcnlEYXRhVHJhY2tBdWRpbykgewotICAgICAgICAgICAgaW5mby5hdWRpb0xhc3RUaW1lICs9IHRpbWU7Ci0gICAgICAgICAgICBpbmZvLnJlZkNvdW50IC0tOwotICAgICAgICB9Ci0gICAgICAgIGlmIChwYXJhbXMgJiBrQmF0dGVyeURhdGFUcmFja1ZpZGVvKSB7Ci0gICAgICAgICAgICBpbmZvLnZpZGVvTGFzdFRpbWUgKz0gdGltZTsKLSAgICAgICAgICAgIGluZm8ucmVmQ291bnQgLS07Ci0gICAgICAgIH0KLQotICAgICAgICAvLyBubyBzdHJlYW0gaXMgYmVpbmcgcGxheWVkIGJ5IHRoaXMgVUlECi0gICAgICAgIGlmIChpbmZvLnJlZkNvdW50ID09IDApIHsKLSAgICAgICAgICAgIGluZm8uYXVkaW9Ub3RhbFRpbWUgKz0gaW5mby5hdWRpb0xhc3RUaW1lOwotICAgICAgICAgICAgaW5mby5hdWRpb0xhc3RUaW1lID0gMDsKLSAgICAgICAgICAgIGluZm8udmlkZW9Ub3RhbFRpbWUgKz0gaW5mby52aWRlb0xhc3RUaW1lOwotICAgICAgICAgICAgaW5mby52aWRlb0xhc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VN0cmVhbVR5cGUgPSBzdHJlYW1UeXBlOyB9Ci0gICAgICAgICAgICAgICAgdm9pZCAgICAgICAgICAgIHNldFZvbHVtZShmbG9hdCBsZWZ0LCBmbG9hdCByaWdodCk7Ci0gICAgICAgIHZpcnR1YWwgc3RhdHVzX3QgICAgICAgIHNldFBsYXliYWNrUmF0ZVBlcm1pbGxlKGludDMyX3QgcmF0ZVBlcm1pbGxlKTsKLSAgICAgICAgICAgICAgICBzdGF0dXNfdCAgICAgICAgc2V0QXV4RWZmZWN0U2VuZExldmVsKGZsb2F0IGxldmVsKTsKLSAgICAgICAgICAgICAgICBzdGF0dXNfdCAgICAgICAgYXR0YWNoQXV4RWZmZWN0KGludCBlZmZlY3RJZCk7Ci0gICAgICAgIHZpcnR1YWwgc3RhdHVzX3QgICAgICAgIGR1bXAoaW50IGZkLCBjb25zdCBWZWN0b3I8U3RyaW5nMTY+JiBhcmdzKSBjb25zdDsKLQotICAgICAgICBzdGF0aWMgYm9vbCAgICAgICAgICAgICBpc09uRW11bGF0b3IoKTsKLSAgICAgICAgc3RhdGljIGludCAgICAgICAgICAgICAgZ2V0TWluQnVmZmVyQ291bnQoKTsKLSAgICAgICAgICAgICAgICB2b2lkICAgICAgICAgICAgc2V0TmV4dE91dHB1dChjb25zdCBzcDxBdWRpb091dHB1dD4mIG5leHRPdXRwdXQpOwotICAgICAgICAgICAgICAgIHZvaWQgICAgICAgICAgICBzd2l0Y2hUb05leHRPdXRwdXQoKTsKLSAgICAgICAgdmlydHVhbCBib29sICAgICAgICAgICAgbmVlZHNUcmFpbGluZ1BhZGRpbmcoKSB7IHJldHVybiBtTmV4dE91dHB1dCA9PSBOVUxMOyB9Ci0KLSAgICBwcml2YXRlOgotICAgICAgICBzdGF0aWMgdm9pZCAgICAgICAgICAgICBzZXRNaW5CdWZmZXJDb3VudCgpOwotICAgICAgICBzdGF0aWMgdm9pZCAgICAgICAgICAgICBDYWxsYmFja1dyYXBwZXIoCi0gICAgICAgICAgICAgICAgaW50IGV2ZW50LCB2b2lkICptZSwgdm9pZCAqaW5mbyk7Ci0KLSAgICAgICAgQXVkaW9UcmFjayogICAgICAgICAgICAgbVRyYWNrOwotICAgICAgICBBdWRpb1RyYWNrKiAgICAgICAgICAgICBtUmVjeWNsZWRUcmFjazsKLSAgICAgICAgc3A8QXVkaW9PdXRwdXQ+ICAgICAgICAgbU5leHRPdXRwdXQ7Ci0gICAgICAgIEF1ZGlvQ2FsbGJhY2sgICAgICAgICAgIG1DYWxsYmFjazsKLSAgICAgICAgdm9pZCAqICAgICAgICAgICAgICAgICAgbUNhbGxiYWNrQ29va2llOwotICAgICAgICBDYWxsYmFja0RhdGEgKiAgICAgICAgICBtQ2FsbGJhY2tEYXRhOwotICAgICAgICBhdWRpb19zdHJlYW1fdHlwZV90ICAgICBtU3RyZWFtVHlwZTsKLSAgICAgICAgZmxvYXQgICAgICAgICAgICAgICAgICAgbUxlZnRWb2x1bWU7Ci0gICAgICAgIGZsb2F0ICAgICAgICAgICAgICAgICAgIG1SaWdodFZvbHVtZTsKLSAgICAgICAgaW50MzJfdCAgICAgICAgICAgICAgICAgbVBsYXliYWNrUmF0ZVBlcm1pbGxlOwotICAgICAgICB1aW50MzJfdCAgICAgICAgICAgICAgICBtU2FtcGxlUmF0ZUh6OyAvLyBzYW1wbGUgcmF0ZSBvZiB0aGUgY29udGVudCwgYXMgc2V0IGluIG9wZW4oKQotICAgICAgICBmbG9hdCAgICAgICAgICAgICAgICAgICBtTXNlY3NQZXJGcmFtZTsKLSAgICAgICAgaW50ICAgICAgICAgICAgICAgICAgICAgbVNlc3Npb25JZDsKLSAgICAgICAgZmxvYXQgICAgICAgICAgICAgICAgICAgbVNlbmRMZXZlbDsKLSAgICAgICAgaW50ICAgICAgICAgICAgICAgICAgICAgbUF1eEVmZmVjdElkOwotICAgICAgICBzdGF0aWMgYm9vbCAgICAgICAgICAgICBtSXNPbkVtdWxhdG9yOwotICAgICAgICBzdGF0aWMgaW50ICAgICAgICAgICAgIC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NoL2VuZFRyYWNrU3dpdGNoIGFyZSB1c2VkIHdoZW4gdGhpcyBvYmplY3QgaXMgYmVpbmcgaGFuZGVkIG92ZXIKLSAgICAgICAgICAgIC8vIHRvIHRoZSBuZXh0IHNpbmsuCi0gICAgICAgICAgICB2b2lkICAgICAgICAgICAgYmVnaW5UcmFja1N3aXRjaCgpIHsgbUxvY2subG9jaygpOyBtU3dpdGNoaW5nID0gdHJ1ZTsgfQotICAgICAgICAgICAgdm9pZCAgICAgICAgICAgIGVuZFRyYWNrU3dpdGNoKCkgewotICAgICAgICAgICAgICAgIGlmIChtU3dpdGNoaW5nKSB7Ci0gICAgICAgICAgICAgICAgICAgIG1Mb2NrLnVubG9jaygpOwotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICBtU3dpdGNoaW5nID0gZmFsc2U7Ci0gICAgICAgICAgICB9Ci0gICAgICAgIHByaXZhdGU6Ci0gICAgICAgICAgICBBdWRpb091dHB1dCAqICAgbURhdGE7Ci0gICAgICAgICAgICBtdXRhYmxlIE11dGV4ICAgbUxvY2s7Ci0gICAgICAgICAgICBib29sICAgICAgICAgICAgbVN3aXRjaGluZzsKLSAgICAgICAgICAgIERJU0FMTE9XX0VWSUxfQ09OU1RSVUNUT1JTKENhbGxiYWNrRGF0YSk7Ci0gICAgICAgIH07Ci0KLSAgICB9OyAvLyBBdWRpb091dHB1dAotCi0KLSAgICBjbGFzcyBBdWRpb0NhY2hlIDogcHVibGljIE1lZGlhUGxheWVyQmFzZTo6QXVkaW9TaW5rCi0gICAgewotICAgIHB1YmxpYzoKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgQXVkaW9DYWNoZShjb25zdCBjaGFyKiBuYW1lKTsKLSAgICAgICAgdmlydHVhbCAgICAgICAgICAgICAgICAgfkF1ZGlvQ2FjaGUoKSB7fQotCi0gICAgICAgIHZpcnR1YWwgYm9vbCAgICAgICAgICAgIHJlYWR5KCkgY29uc3QgeyByZXR1cm4gKG1DaGFubmVsQ291bnQgPiAwKSAmJiAobUhlYXAtPmdldEhlYXBJRCgpID4gMCk7IH0KLSAgICAgICAgdmlydHVhbCBib29sICAgICAgICAgICAgcmVhbHRpbWUoKSBjb25zdCB7IHJldHVybiBmYWxzZTsgfQotICAgICAgICB2aXJ0dWFsIHNzaXplX3QgICAgICAgICBidWZmZXJTaXplKCkgY29uc3QgeyByZXR1cm4gZnJhbWVTaXplKCkgKiBtRnJhbWVDb3VudDsgfQotICAgICAgICB2aXJ0dWFsIHNzaXplX3QgICAgICAgICBmcmFtZUNvdW50KCkgY29uc3QgeyByZXR1cm4gbUZyYW1lQ291bnQ7IH0KLSAgICAgICAgdmlydHVhbCBzc2l6ZV90ICAgICAgICAgY2hhbm5lbENvdW50KCkgY29uc3QgeyByZXR1cm4gKHNzaXplX3QpbUNoYW5uZWxDb3VudDsgfQotICAgICAgICB2aXJ0dWFsIHNzaXplX3QgICAgICAgICBmcmFtZVNpemUoKSBjb25zdCB7IHJldHVybiBzc2l6ZV90KG1DaGFubmVsQ291bnQgKiAoKG1Gb3JtYXQgPT0gQVVESU9fRk9STUFUX1BDTV8xNl9CSVQpP3NpemVvZihpbnQxNl90KTpzaXplb2YodV9pbnQ4X3QpKSk7IH0KLSAgICAgICAgdmlydHVhbCB1aW50MzJfdCAgICAgICAgbGF0ZW5jeSgpIGNvbnN0OwotICAgICAgICB2aXJ0dWFsIGZsb2F0ICAgICAgICAgICBtc2Vjc1BlckZyYW1lKCkgY29uc3Q7Ci0gICAgICAgIHZpcnR1YWwgc3RhdHVzX3QgICAgICAgIGdldFBvc2l0aW9uKHVpbnQzMl90ICpwb3NpdGlvbik7Ci0gICAgICAgIHZpcnR1YWwgaW50ICAgICAgICAgICAgIGdldFNlc3Npb25JZCgpOwotCi0gICAgICAgIHZpcnR1YWwgc3RhdHVzX3QgICAgICAgIG9wZW4oCi0gICAgICAgICAgICAgICAgdWludDMyX3Qgc2FtcGxlUmF0ZSwgaW50IGNoYW5uZWxDb3VudCwgYXVkaW9fY2hhbm5lbF9tYXNrX3QgY2hhbm5lbE1hc2ssCi0gICAgICAgICAgICAgICAgYXVkaW9fZm9ybWF0X3QgZm9ybWF0LCBpbnQgYnVmZmVyQ291bnQgPSAxLAotICAgICAgICAgICAgICAgIEF1ZGlvQ2FsbGJhY2sgY2IgPSBOVUxMLCB2b2lkICpjb29raWUgPSBOVUxMKTsKLQotICAgICAgICB2aXJ0dWFsIHZvaWQgICAgICAgICAgICBzdGFydCgpOwotICAgICAgICB2aXJ0dWFsIHNzaXplX3QgICAgICAgICB3cml0ZShjb25zdCB2b2lkKiBidWZmZXIsIHNpemVfdCBzaXplKTsKLSAgICAgICAgdmlydHVhbCB2b2lkICAgICAgICAgICAgc3RvcCgpOwotICAgICAgICB2aXJ0dWFsIHZvaWQgICAgICAgICAgICBmbHVzaCgpIHt9Ci0gICAgICAgIHZpcnR1YWwgdm9pZCAgICAgICAgICAgIHBhdXNlKCkge30KLSAgICAgICAgdmlydHVhbCB2b2lkICAgICAgICAgICAgY2xvc2UoKSB7fQotICAgICAgICAgICAgICAgIHZvaWQgICAgICAgICAgICBzZXRBdWRpb1N0cmVhbVR5cGUoYXVkaW9fc3RyZWFtX3R5cGVfdCBzdHJlYW1UeXBlKSB7fQotICAgICAgICAgICAgICAgIHZvaWQgICAgICAgICAgICBzZXRWb2x1bWUoZmxvYXQgbGVmdCwgZmxvYXQgcmlnaHQpIHt9Ci0gICAgICAgIHZpcnR1YWwgc3RhdHVzX3QgICAgICAgIHNldFBsYXliYWNrUmF0ZVBlcm1pbGxlKGludDMyX3QgcmF0ZVBlcm1pbGxlKSB7IHJldHVybiBJTlZBTElEX09QRVJBVElPTjsgfQotICAgICAgICAgICAgICAgIHVpbnQzMl90ICAgICAgICBzYW1wbGVSYXRlKCkgY29uc3QgeyByZXR1cm4gbVNhbXBsZVJhdGU7IH0KLSAgICAgICAgICAgICAgICBhdWRpb19mb3JtYXRfdCAgZm9ybWF0KCkgY29uc3QgeyByZXR1cm4gbUZvcm1hdDsgfQotICAgICAgICAgICAgICAgIHNpemVfdCAgICAgICAgICBzaXplKCkgY29uc3QgeyByZXR1cm4gbVNpemU7IH0KLSAgICAgICAgICAgICAgICBzdGF0dXNfdCAgICAgICAgd2FpdCgpOwotCi0gICAgICAgICAgICAgICAgc3A8SU1lbW9yeUhlYXA+IGdldEhlYXAoKSBjb25zdCB7IHJldHVybiBtSGVhcDsgfQotCi0gICAgICAgIHN0YXRpYyAgdm9pZCAgICAgICAgICAgIG5vdGlmeSh2b2lkKiBjb29raWUsIGludCBtc2csCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpbnQgZXh0MSwgaW50IGV4dDIsIGNvbnN0IFBhcmNlbCAqb2JqKTsKLSAgICAgICAgdmlydHVhbCBzdGF0dXNfdCAgICAgICAgZHVtcChpbnQgZmQsIGNvbnN0IFZlY3RvcjxTdHJpbmcxNj4mIGFyZ3MpIGNvbnN0OwotCi0gICAgcHJpdmF0ZToKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgQXVkaW9DYWNoZSgpOwotCi0gICAgICAgIE11dGV4ICAgICAgICAgICAgICAgbUxvY2s7Ci0gICAgICAgIENvbmRpdGlvbiAgICAgICAgICAgbVNpZ25hbDsKLSAgICAgICAgc3A8TWVtb3J5SGVhcEJhc2U+ICBtSGVhcDsKLSAgICAgICAgZmxvYXQgICAgICAgICAgICAgICBtTXNlY3NQZXJGcmFtZTsKLSAgICAgICAgdWludDE2X3QgICAgICAgICAgICBtQ2hhbm5lbENvdW50OwotICAgICAgICBhdWRpb19mb3JtYXRfdCAgICAgIG1Gb3JtYXQ7Ci0gICAgICAgIHNzaXplX3QgICAgICAgICAgICAgbUZyYW1lQ291bnQ7Ci0gICAgICAgIHVpbnQzMl90ICAgICAgICAgICAgbVNhbXBsZVJhdGU7Ci0gICAgICAgIHVpbnQzMl90ICAgICAgICAgICAgbVNpemU7Ci0gICAgICAgIGludCAgICAgICAgICAgICAgICAgbUVycm9yOw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dWFsIHN0YXR1c190ICAgICAgICBnZXRNZXRhZGF0YShib29sIHVwZGF0ZV9vbmx5LAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBib29sIGFwcGx5X2ZpbHRlciwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgUGFyY2VsICpyZXBseSk7Ci0gICAgICAgIHZpcnR1YWwgc3RhdHVzX3QgICAgICAgIHNldEF1eEVmZmVjdFNlbmRMZXZlbChmbG9hdCBsZXZlbCk7Ci0gICAgICAgIHZpcnR1YWwgc3RhdHVzX3QgICAgICAgIGF0dGFjaEF1eEVmZmVjdChpbnQgZWZmZWN0SWQpOwotICAgICAgICB2aXJ0dWFsIHN0YXR1c190ICAgICAgICBzZXRQYXJhbWV0ZXIoaW50IGtleSwgY29uc3QgUGFyY2VsICZyZXF1ZXN0KTsKLSAgICAgICAgdmlydHVhbCBzdGF0dXNfdCAgICAgICAgZ2V0UGFyYW1ldGVyKGludCBrZXksIFBhcmNlbCAqcmVwbHkpOwotICAgICAgICB2aXJ0dWFsIHN0YXR1c190ICAgICAgICBzZXRSZXRyYW5zbWl0RW5kcG9pbnQoY29uc3Qgc3RydWN0IHNvY2thZGRyX2luKiBlbmRwb2ludCk7Ci0gICAgICAgIHZpcnR1YWwgc3RhdHVzX3QgICAgICAgIHNldE5leHRQbGF5ZXIoY29uc3Qgc3A8SU1lZGlhUGxheWVyPiYgcGxheWVyKTsKLQotICAgICAgICBzcDxNZWRpYVBsYXllckJhc2U+ICAgICBjcmVhdGVQbGF5ZXIocGxheWVyX3R5cGUgcGxheWVyVHlwZSk7Ci0KLSAgICAgICAgdmlydHVhbCBzdGF0dXNfdCAgICAgICAgc2V0RGF0YVNvdXJjZSgKLSAgICAgICAgICAgICAgICAgICAgICAgIGNvbnN0IGNoYXIgKnVybCwKLSAgICAgICAgICAgICAgICAgICAgICAgIGNvbnN0IEtleWVkVmVjdG9yPFN0cmluZzgsIFN0cmluZzg+ICpoZWFkZXJzKTsKLQotICAgICAgICB2aXJ0dWFsIHN0YXR1c190ICAgICAgICBzZXREYXRhU291cmNlKGludCBmZCwgaW50NjRfdCBvZmZzZXQsIGludDY0X3QgbGVuZ3RoKTsKLQotICAgICAgICB2aXJ0dWFsIHN0YXR1c190ICAgICAgICBzZXREYXRhU291cmNlKGNvbnN0IHNwPElTdHJlYW1Tb3VyY2U+ICZzb3VyY2UpOwotCi0gICAgICAgIHNwPE1lZGlhUGxheWVyQmFzZT4gICAgIHNldERhdGFTb3VyY2VfcHJlKHBsYXllcl90eXBlIHBsYXllclR5cGUpOwotICAgICAgICB2b2lkICAgICAgICAgICAgICAgICAgICBzZXREYXRhU291cmNlX3Bvc3QoY29uc3Qgc3A8TWVkaWFQbGF5ZXJCYXNlPiYgcCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHN0YXR1c190IHN0YXR1cyk7Ci0KLSAgICAgICAgcGxheWVyX3R5cGUgICAgICAgICAgICAgZ2V0UGxheWVyVHlwZShpbnQgZmQsIGludDY0X3Qgb2Zmc2V0LCBpbnQ2NF90IGxlbmd0aCk7Ci0gICAgICAgIHBsYXllcl90eXBlICAgICAgICAgICAgIGdldFBsYXllclR5cGUoY29uc3QgY2hhciogdXJsKTsKLSAgICAgICAgcGxheWVyX3R5cGUgICAgICAgICAgICAgZ2V0UGxheWVyVHlwZShjb25zdCBzcDxJU3RyZWFtU291cmNlPiAmc291cmNlKTsKLQotICAgICAgICBzdGF0aWMgIHZvaWQgICAgICAgICAgICBub3RpZnkodm9pZCogY29va2llLCBpbnQgbXNnLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaW50IGV4dDEsIGludCBleHQyLCBjb25zdCBQYXJjZWwgKm9iaik7Ci0KLSAgICAgICAgICAgICAgICBwaWRfdCAgICAgICAgICAgcGlkKCkgY29uc3QgeyByZXR1cm4gbVBpZDsgfQotICAgICAgICB2aXJ0dWFsIHN0YXR1c190ICAgICAgICBkdW1wKGludCBmZCwgY29uc3QgVmVjdG9yPFN0cmluZzE2PiYgYXJncykgY29uc3Q7Ci0KLSAgICAgICAgICAgICAgICBpbnQgICAgICAgICAgICAgZ2V0QXVkaW9TZXNzaW9uSWQoKSB7IHJldHVybiBtQXVkaW9TZXNzaW9uSWQ7IH0KLQotICAgIHByaXZhdGU6Ci0gICAgICAgIGZyaWVuZCBjbGFzcyBNZWRpYVBsYXllclNlcnZpY2U7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIENsaWVudCggY29uc3Qgc3A8TWVkaWFQbGF5ZXJTZXJ2aWNlPiYgc2VydmljZSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwaWRfdCBwaWQsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaW50MzJfdCBjb25uSWQsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY29uc3Qgc3A8SU1lZGlhUGxheWVyQ2xpZW50PiYgY2xpZW50LAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGludCBhdWRpb1Nlc3Npb25JZCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB1aWRfdCB1aWQpOwotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBDbGllbnQoKTsKLSAgICAgICAgdmlydHVhbCAgICAgICAgICAgICAgICAgfkNsaWVudCgpOwotCi0gICAgICAgICAgICAgICAgdm9pZCAgICAgICAgICAgIGRlbGV0ZVBsYXllcigpOwotCi0gICAgICAgIHNwPE1lZGlhUGxheWVyQmFzZT4gICAgIGdldFBsYXllcigpIGNvbnN0IHsgTXV0ZXg6OkF1dG9sb2NrIGxvY2sobUxvY2spOyByZXR1cm4gbVBsYXllcjsgfQotCi0KLQotICAgICAgICAvLyBAcGFyYW0gdHlwZSBPZiB0aGUgbWV0YWRhdGEgdG8gYmUgd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AgICAgIHBpZF90ICAgICAgICAgICAgICAgICAgICAgICBtUGlkOwotICAgICAgICAgICAgICAgICAgICBzdGF0dXNfdCAgICAgICAgICAgICAgICAgICAgbVN0YXR1czsKLSAgICAgICAgICAgICAgICAgICAgYm9vbCAgICAgICAgICAgICAgICAgICAgICAgIG1Mb29wOwotICAgICAgICAgICAgICAgICAgICBpbnQzMl90ICAgICAgICAgICAgICAgICAgICAgbUNvbm5JZDsKLSAgICAgICAgICAgICAgICAgICAgaW50ICAgICAgICAgICAgICAgICAgICAgICAgIG1BdWRpb1Nlc3Npb25JZDsKLSAgICAgICAgICAgICAgICAgICAgdWlkX3QgICAgICAgICAgICAgICAgICAgICAgIG1VSUQ7Ci0gICAgICAgICAgICAgICAgICAgIHNwPEFOYXRpdmVXaW5kb3c+ICAgICAgICAgICBtQ29ubmVjdGVkV2luZG93OwotICAgICAgICAgICAgICAgICAgICBzcDxJQmluZGVyPiAgICAgICAgICAgICAgICAgbUNvbm5lY3RlZFdpbmRvd0JpbmRlcjsKLSAgICAgICAgICAgICAgICAgICAgc3RydWN0IHNvY2thZGRyX2luICAgICAgICAgIG1SZXRyYW5zbWl0RW5kcG9pbnQ7Ci0gICAgICAgICAgICAgICAgICAgIGJvb2wgICAgICAgICAgICAgICAgICAgICAgICBtUmV0cmFuc21pdEVuZHBvaW50VmFsaWQ7Ci0gICAgICAgICAgICAgICAgICAgIHNwPENsaWVudD4gICAgICAgICAgICAgICAgICBtTmV4dENsaWVudDsKLQotICAgICAgICAvLyBNZXRhZGF0YSBmaWx0ZXJzLgotICAgICAgICBtZWRpYTo6TWV0YWRhdGE6OkZpbHRlciBtTWV0YWRhdGFBbGxvdzsgIC8vIHByb3RlY3RlZCBieSBtTG9jawotICAgICAgICBtZWRpYTo6TWV0YWRhdGE6OkZpbHRlciBtTWV0YWRhdGFEcm9wOyAgLy8gcHJvdGVjdGVkIGJ5IG1Mb2NrCi0KLSAgICAgICAgLy8gTWV0YWRhdGEgdXBkYXRlZC4g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QotICAgICAgICAgICAgICAgICAgICAgICAgICAgTWVkaWFSZWNvcmRlckNsaWVudCgKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY29uc3Qgc3A8TWVkaWFQbGF5ZXJTZXJ2aWNlPiYgc2VydmljZSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBpZF90IHBpZCk7Ci0gICAgdmlydHVhbCAgICAgICAgICAgICAgICB+TWVkaWFSZWNvcmRlckNsaWVudCgpOwotCi0gICAgcGlkX3QgICAgICAgICAgICAgICAgICBtUGlkOwotICAgIE11dGV4ICAgICAgICAgICAgICAgICAgbUxvY2s7Ci0gICAgTWVkaWFSZWNvcmRlckJhc2UgICAgICAqbVJlY29yZGVyOwotICAgIHNwPE1lZGlhUGxheWVyU2VydmljZT4gbU1lZGlhUGxheWVyU2VydmljZTsKLX07Ci0KLX07IC8vIG5hbWVzcGFjZSBhbmRyb2lkCi0KLSNlbmRpZiAvLyBBTkRST0lEX01FRElBUkVDT1JERVJDTElFTlRfSApkaWZmIC0tZ2l0IGEvbWVkaWEvbGlibWVkaWFwbGF5ZXJzZXJ2aWNlL01ldGFkYXRhUmV0cmlldmVyQ2xpZW50LmNwcCBiL21lZGlhL2xpYm1lZGlhcGxheWVyc2VydmljZS9NZXRhZGF0YVJldHJpZXZlckNsaWVudC5jcHAKZGVsZXRlZCBmaWxlIG1vZGUgMTAwNjQ0CmluZGV4IDc3NmQyODguLjAwMDAwMDAKLS0tIGEvbWVkaWEvbGlibWVkaWFwbGF5ZXJzZXJ2aWNlL01ldGFkYXRhUmV0cmlldmVyQ2xpZW50LmNwcAorKysgL2Rldi9udWxsCkBAIC0xLDI1NCArMCwwIEBACi0vKgotKioKLSoqIENvcHlyaWdodCAoQykgMjAwOCBUaGUgQW5kcm9pZCBPcGVuIFNvdXJjZSBQcm9qZWN0Ci0qKgotKiogTGljZW5zZWQgdW5kZXIgdGhlIEFwYW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NPTVBMRVRFKTsKLSAgICAgICAgICAgICAgICBicmVhazsKLSAgICAgICAgICAgIH0KLSAgICAgICAgICAgIGNhc2UgRUFTX1NUQVRFX0VSUk9SOgotICAgICAgICAgICAgewotICAgICAgICAgICAgICAgIEFMT0dFKCJNaWRpRmlsZTo6cmVuZGVyIC0gZXJyb3IiKTsKLSAgICAgICAgICAgICAgICBzZW5kRXZlbnQoTUVESUFfRVJST1IsIE1FRElBX0VSUk9SX1VOS05PV04pOwotICAgICAgICAgICAgICAgIGJyZWFrOwotICAgICAgICAgICAgfQotICAgICAgICAgICAgY2FzZSBFQVNfU1RBVEVfUEFVU0VEOgotICAgICAgICAgICAgICAgIEFMT0dWKCJNaWRpRmlsZTo6cmVuZGVyIC0gcGF1c2VkIik7Ci0gICAgICAgICAgICAgICAgYnJlYWs7Ci0gICAgICAgICAgICBkZWZhdWx0OgotICAgICAgICAgICAgICAgIGJyZWFrOwotICAgICAgICAgICAgfQotICAgICAgICAgICAgbUF1ZGlvU2luay0+c3RvcCgpOwotICAgICAgICAgICAgYXVkaW9TdGFydGVkID0gZmFsc2U7Ci0gICAgICAgICAgICBtUmVuZGVyID0gZmFsc2U7Ci0gICAgICAgIH0KLSAgICB9Ci0KLXRocmVhZEV4aXQ6Ci0gICAgbUF1ZGlvU2luay5jbGVhcigpOwotICAgIGlmIChtQXVkaW9CdWZmZXIpIHsKLSAgICAgICAgZGVsZXRlIFtdIG1BdWRpb0J1ZmZlcjsKLSAgICAgICAgbUF1ZGlvQnVmZmVyID0gTlVMTDsKLSAgICB9Ci0gICAgbU11dGV4LmxvY2soKTsKLSAgICBtVGlkID0gLTE7Ci0gICAgbUNvbmRpdGlvbi5zaWduYWwoKTsKLSAgICBtTXV0ZXgudW5sb2NrKCk7Ci0gICAgcmV0dXJuIHJlc3VsdDsKLX0KLQotfSAvLyBlbmQgbmFtZXNwYWNlIGFuZHJvaWQKZGlmZiAtLWdpdCBhL21lZGlhL2xpYm1lZGlhcGxheWVyc2Vydmlj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SAgICAgICAgcmV0dXJuIElOVkFMSURfT1BFUkFUSU9OOwotICAgIH0KLQotCi1wcml2YXRlOgotICAgICAgICAgICAgc3RhdHVzX3QgICAgY3JlYXRlT3V0cHV0VHJhY2soKTsKLSAgICAgICAgICAgIHN0YXR1c190ICAgIHJlc2V0X25vc3luYygpOwotICAgICAgICAgICAgaW50ICAgICAgICAgcmVuZGVyKCk7Ci0gICAgICAgICAgICB2b2lkICAgICAgICB1cGRhdGVTdGF0ZSgpeyBFQVNfU3RhdGUobUVhc0RhdGEsIG1FYXNIYW5kbGUsICZtU3RhdGUpOyB9Ci0KLSAgICBNdXRleCAgICAgICAgICAgICAgIG1NdXRleDsKLSAgICBDb25kaXRpb24gICAgICAgICAgIG1Db25kaXRpb247Ci0gICAgRUFTX0RBVEFfSEFORExFICAgICBtRWFzRGF0YTsKLSAgICBFQVNfSEFORExFICAgICAgICAgIG1FYXNIYW5kbGU7Ci0gICAgRUFTX1BDTSogICAgICAgICAgICBtQXVkaW9CdWZmZXI7Ci0gICAgRUFTX0kzMiAgICAgICAgICAgICBtUGxheVRpbWU7Ci0gICAgRUFTX0kzMiAgICAgICAgICAgICBtRHVyYXRpb247Ci0gICAgRUFTX1NUQVRFICAgICAgICAgICBtU3RhdGU7Ci0gICAgRUFTX0ZJTEUgICAgICAgICAgICBtRmlsZUxvY2F0b3I7Ci0gICAgYXVkaW9fc3RyZWFtX3R5cGVfdCBtU3RyZWFtVHlwZTsKLSAgICBib29sICAgICAgICAgICAgICAgIG1Mb29wOwotICAgIHZvbGF0aWxlIGJvb2wgICAgICAgbUV4aXQ7Ci0gICAgYm9vbCAgICAgICAgICAgICAgICBtUGF1c2VkOwotICAgIHZvbGF0aWxlIGJvb2wgICAgICAgbVJlbmRlcjsKLSAgICBwaWRfdCAgICAgICAgICAgICAgIG1UaWQ7Ci0KLSAgICBjbGFzcyBNaWRpRmlsZVRocmVhZCA6IHB1YmxpYyBUaHJlYWQgewotICAgIHB1YmxpYzoKLSAgICAg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ICAgICAgICAgIHJldHVybiBFUlJPUl9VTlNVUFBPUlRFRDsKLSAgICAgICAgfQotCi0gICAgICAgIHN0YXR1c190IGVyciA9IHNldHVwQXVkaW9FbmNvZGVyKHdyaXRlcik7Ci0KLSAgICAgICAgaWYgKGVyciAhPSBPSykgewotICAgICAgICAgICAgcmV0dXJuIGVycjsKLSAgICAgICAgfQotICAgIH0KLQotICAgIGlmIChtVmlkZW9Tb3VyY2UgPCBWSURFT19TT1VSQ0VfTElTVF9FTkQpIHsKLSAgICAgICAgaWYgKG1WaWRlb0VuY29kZXIgIT0gVklERU9fRU5DT0RFUl9IMjY0KSB7Ci0gICAgICAgICAgICByZXR1cm4gRVJST1JfVU5TVVBQT1JURUQ7Ci0gICAgICAgIH0KLQotICAgICAgICBzcDxNZWRpYVNvdXJjZT4gbWVkaWFTb3VyY2U7Ci0gICAgICAgIHN0YXR1c190IGVyciA9IHNldHVwTWVkaWFTb3VyY2UoJm1lZGlhU291cmNlKTsKLSAgICAgICAgaWYgKGVyciAhPSBPSykgewotICAgICAgICAgICAgcmV0dXJuIGVycjsKLSAgICAgICAgfQotCi0gICAgICAgIHNwPE1lZGlhU291cmNlPiBlbmNvZGVyOwotICAgICAgICBlcnIgPSBzZXR1cFZpZGVvRW5jb2RlcihtZWRpYVNvdXJjZSwgbVZpZGVvQml0UmF0ZSwgJmVuY29kZXIpOwotCi0gICAgICAgIGlmIChlcnIgIT0gT0spIHsKLSAgICAgICAgICAgIHJldHVybiBlcnI7Ci0gICAgICAgIH0KLQotICAgICAgICB3cml0ZXItPmFkZFNvdXJjZShlbmNvZGVyKTsKLSAgICB9Ci0KLSAgICBpZiAobU1heEZpbGVEdXJhdGlvblVzICE9IDApIHsKLSAgICAgICAgd3JpdGVyLT5zZXRNYXhGaWxlRHVyYXRpb24obU1heEZpbGVEdXJhdGlvblVzKTsKLSAgICB9Ci0KLSAgICBpZiAobU1heEZpbGVTaXplQnl0ZXMgIT0gMCkgewotICAgICAgICB3cml0ZXItP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XR1c190IHBhcnNlVXJsKCk7Ci0KLSAgICBjaGFyICptVXJsOyAgICAgICAgICAgICAgICAvLyB0ZXN0OmZvby5zbz91cmw9aHR0cDovL2JhcgotICAgIGNoYXIgKm1GaWxlbmFtZTsgICAgICAgICAgIC8vIGZvby5zbwotICAgIGNoYXIgKm1Db250ZW50VXJsOyAgICAgICAgIC8vIGh0dHA6Ly9iYXIKLSAgICB2b2lkICptSGFuZGxlOyAgICAgICAgICAgICAvLyByZXR1cm5lZCBieSBkbG9wZW4KLSAgICBORVdfUExBWUVSICAgIG1OZXdQbGF5ZXI7Ci0gICAgREVMRVRFX1BMQVlFUiBtRGVsZXRlUGxheWVyOwotICAgIE1lZGlhUGxheWVyQmFzZSAqbVBsYXllcjsgIC8vIHdyYXBwZWQgcGxheWVyCi19OwotCi19ICAvLyBuYW1lc3BhY2UgYW5kcm9pZAotCi0jZW5kaWYKZGlmZiAtLWdpdCBhL21lZGlhL2xpYm1lZGlhcGxheWVyc2VydmljZS9udXBsYXllci9BbmRyb2lkLm1rIGIvbWVkaWEvbGlibWVkaWFwbGF5ZXJzZXJ2aWNlL251cGxheWVyL0FuZHJvaWQubWsKZGVsZXRlZCBmaWxlIG1vZGUgMTAwNjQ0CmluZGV4IDczMzM2ZWYuLjAwMDAwMDAKLS0tIGEvbWVkaWEvbGlibWVkaWFwbGF5ZXJzZXJ2aWNlL251cGxheWVyL0FuZHJvaWQubWsKKysrIC9kZXYvbnVsbApAQCAtMSwyNyArMCwwIEBACi1MT0NBTF9QQVRIOj0gJChjYWxsIG15LWRpcikKLWluY2x1ZGUgJChDTEVBUl9WQVJTKQotCi1MT0NBTF9TUkNfRklMRVM6PSAgICAgICAgICAgICAgICAgICAgICAgXAotICAgICAgICBHZW5lcmljU291cmNlLmNwcCAgICAgICAgICAgICAgIFwKLSAgICAgICAgSFRUUExpdmVTb3VyY2UuY3BwICAgICAgICAgICAgICBcCi0gICAgICAgIE51UGxheWVyLmNwcCAgICAgICAgICAgICAgICAg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AgICAgICAgY29uc3QgY2hhciAqbWltZTsKLSAgICAgICAgQ0hFQ0sobWV0YS0+ZmluZENTdHJpbmcoa0tleU1JTUVUeXBlLCAmbWltZSkpOwotCi0gICAgICAgIHNwPE1lZGlhU291cmNlPiB0cmFjazsKLQotICAgICAgICBpZiAoIXN0cm5jYXNlY21wKG1pbWUsICJhdWRpby8iLCA2KSkgewotICAgICAgICAgICAgaWYgKG1BdWRpb1RyYWNrLm1Tb3VyY2UgPT0gTlVMTCkgewotICAgICAgICAgICAgICAgIG1BdWRpb1RyYWNrLm1Tb3VyY2UgPSB0cmFjayA9IGV4dHJhY3Rvci0+Z2V0VHJhY2soaSk7Ci0KLSAgICAgICAgICAgICAgICBpZiAoIXN0cmNhc2VjbXAobWltZSwgTUVESUFfTUlNRVRZUEVfQVVESU9fVk9SQklTKSkgewotICAgICAgICAgICAgICAgICAgICBtQXVkaW9Jc1ZvcmJpcyA9IHRydWU7Ci0gICAgICAgICAgICAgICAgfSBlbHNlIHsKLSAgICAgICAgICAgICAgICAgICAgbUF1ZGlvSXNWb3JiaXMgPSBmYWxzZTsKLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICB9Ci0gICAgICAgIH0gZWxzZSBpZiAoIXN0cm5jYXNlY21wKG1pbWUsICJ2aWRlby8iLCA2KSkgewotICAgICAgICAgICAgaWYgKG1WaWRlb1RyYWNrLm1Tb3VyY2UgPT0gTlVMTCkgewotICAgICAgICAgICAgICAgIG1WaWRlb1RyYWNrLm1Tb3VyY2UgPSB0cmFjayA9IGV4dHJhY3Rvci0+Z2V0VHJhY2soaSk7Ci0gICAgICAgICAgICB9Ci0gICAgICAgIH0KLQotICAgICAgICBpZiAodHJhY2sgIT0gTlVMTCkgewotICAgICAgICAgICAgaW50NjRfdCBkdXJhdGlvblVzOwotICAgICAgICAgICAgaWYgKG1ldGEtPmZpbmRJbnQ2NChrS2V5RHVyYXRpb24sICZkdXJhdGlvblVzKSkgewotICAgICAgICAgICAgICAgIGlmI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ICAgICAgICAgIG51bVBhZ2VTYW1wbGVzID0gLTE7Ci0gICAgICAgICAgICAgICAgfQotCi0gICAgICAgICAgICAgICAgbWVtY3B5KGJ1ZmZlci0+ZGF0YSgpICsgbWJ1Zi0+cmFuZ2VfbGVuZ3RoKCksCi0gICAgICAgICAgICAgICAgICAgICAgICZudW1QYWdlU2FtcGxlcywKLSAgICAgICAgICAgICAgICAgICAgICAgc2l6ZW9mKG51bVBhZ2VTYW1wbGVzKSk7Ci0gICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgIGludDY0X3QgdGltZVVzOwotICAgICAgICAgICAgQ0hFQ0sobWJ1Zi0+bWV0YV9kYXRhKCktPmZpbmRJbnQ2NChrS2V5VGltZSwgJnRpbWVVcykpOwotCi0gICAgICAgICAgICBidWZmZXItPm1ldGEoKS0+c2V0SW50NjQoInRpbWVVcyIsIHRpbWVVcyk7Ci0KLSAgICAgICAgICAgIGlmIChhY3R1YWxUaW1lVXMpIHsKLSAgICAgICAgICAgICAgICAqYWN0dWFsVGltZVVzID0gdGltZVVzOwotICAgICAgICAgICAgfQotCi0gICAgICAgICAgICBtYnVmLT5yZWxlYXNlKCk7Ci0gICAgICAgICAgICBtYnVmID0gTlVMTDsKLQotICAgICAgICAgICAgaWYgKHNlZWtpbmcpIHsKLSAgICAgICAgICAgICAgICB0cmFjay0+bVBhY2tldHMtPnF1ZXVlRGlzY29udGludWl0eSgKLSAgICAgICAgICAgICAgICAgICAgICAgIEFUU1BhcnNlcjo6RElTQ09OVElOVUlUWV9TRUVLLCBOVUxMKTsKLSAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgdHJhY2stPm1QYWNrZXRzLT5xdWV1ZUFjY2Vzc1VuaXQoYnVmZmVyKTsKLSAgICAgICAgICAgIGJyZWFrOwotICAgICAgICB9IGVsc2UgaWYgKGVyciA9PSBJTkZPX0ZPUk1BVF9DSEFOR0VEKSB7Ci0jaWYgMAotICAgICAgICAgICAgdHJhY2stPm1QYWNrZXRzLT5x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lVFNEYXRhKCkgewotICAgIGlmIChtRmluYWxSZXN1bHQgIT0gT0spIHsKLSAgICAgICAgcmV0dXJuIG1GaW5hbFJlc3VsdDsKLSAgICB9Ci0KLSAgICBzcDxMaXZlRGF0YVNvdXJjZT4gc291cmNlID0KLSAgICAgICAgc3RhdGljX2Nhc3Q8TGl2ZURhdGFTb3VyY2UgKj4obUxpdmVTZXNzaW9uLT5nZXREYXRhU291cmNlKCkuZ2V0KCkpOwotCi0gICAgZm9yIChpbnQzMl90IGkgPSAwOyBpIDwgNTA7ICsraSkgewotICAgICAgICBjaGFyIGJ1ZmZlclsxODhdOwotICAgICAgICBzc2l6ZV90IG4gPSBzb3VyY2UtPnJlYWRBdE5vbkJsb2NraW5nKG1PZmZzZXQsIGJ1ZmZlciwgc2l6ZW9mKGJ1ZmZlcikpOwotCi0gICAgICAgIGlmIChuID09IC1FV09VTERCTE9DSykgewotICAgICAgICAgICAgYnJlYWs7Ci0gICAgICAgIH0gZWxzZSBpZiAobiA8IDApIHsKLSAgICAgICAgICAgIGlmIChuICE9IEVSUk9SX0VORF9PRl9TVFJFQU0pIHsKLSAgICAgICAgICAgICAgICBBTE9HSSgiaW5wdXQgZGF0YSBFT1MgcmVhY2hlZCwgZXJyb3IgJWxkIiwgbik7Ci0gICAgICAgICAgICB9IGVsc2UgewotICAgICAgICAgICAgICAgIEFMT0dJKCJpbnB1dCBkYXRhIEVPUyByZWFjaGVkLiIpOwotICAgICAgICAgICAgfQotICAgICAgICAgICAgbVRTUGFyc2VyLT5zaWduYWxFT1Mobik7Ci0gICAgICAgICAgICBtRmluYWxSZXN1bHQgPSBuOwotICAgICAgICAgICAgYnJlYWs7Ci0gICAgICAgIH0gZWxzZSB7Ci0gICAgICAgICAgICBpZiAoYnVmZmVyWzBdID09IDB4MDApIHsKLSAgICAgICAgICAgICAgICAvLyBYWFggbGVnYWN5Ci0gICAgICAgICAgICAgICAgc3A8QU1lc3NhZ2U+IGV4dHJhOwotICAgICAgICAgICAgICAgIG1UU1BhcnNlci0+c2lnbmFsRGlzY29udGludWl0eSgKLSAgICAgICAgICAgICAgICAgICAgICAgIGJ1ZmZlclsxXSA9PSAweDAwCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgPyBBVFNQYXJzZXI6OkRJU0NPTlRJTlVJVFlfU0VFSwotICAgICAgICAgICAgICAgICAgICAgICAgICAgIDogQVRTUGFyc2VyOjpESVNDT05USU5VSVRZX0ZPUk1BVENIQU5HRSwKLSAgICAgICAgICAgICAgICAgICAgICAgIGV4dHJhKTsKLSAgICAgICAgICAgIH0gZWxzZSB7Ci0gICAgICAgICAgICAgICAgc3RhdHVzX3QgZXJyID0gbVRTUGFyc2VyLT5mZWVkVFNQYWNrZXQoYnVmZmVyLCBzaXplb2YoYnVmZmVyKSk7Ci0KLSAgICAgICAgICAgICAgICBpZiAoZXJyICE9IE9LKSB7Ci0gICAgICAgICAgICAgICAgICAgIEFMT0dFKCJUUyBQYXJzZXIgcmV0dXJuZWQgZXJyb3IgJWQiLCBlcnIpOwotICAgICAgICAgICAgICAgICAgICBtVFNQYXJzZXItPnNpZ25hbEVPUyhlcnIpOwotICAgICAgICAgICAgICAgICAgICBtRmluYWxSZXN1bHQgPSBlcnI7Ci0gICAgICAgICAgICAgICAgICAgIGJyZWFrOwotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgbU9mZnNldCArPSBuOwotICAgICAgICB9Ci0gICAgfQotCi0gICAgcmV0dXJuIE9LOwotfQotCi1zdGF0dXNfdCBOdVBsYXllcjo6SFRUUExpdmVTb3VyY2U6OmRlcXVldWVBY2Nlc3NVbml0KAotICAgICAgICBib29sIGF1ZGlvLCBzcDxBQnVmZmVyPiAqYWNjZXNzVW5pdCkgewotICAgIEFUU1BhcnNlcjo6U291cmNlVHlwZSB0eXBlID0KLSAgICAgICAgYXVkaW8gPyBBVFNQYXJzZXI6OkFVRElPIDogQVRTUGFyc2VyOjpWSURFTzsKLQotICAgIHNw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ICBjYXNlIGtXaGF0U3RhcnQ6Ci0gICAgICAgIHsKLSAgICAgICAgICAgIEFMT0dWKCJrV2hhdFN0YXJ0Iik7Ci0KLSAgICAgICAgICAgIG1WaWRlb0lzQVZDID0gZmFsc2U7Ci0gICAgICAgICAgICBtQXVkaW9FT1MgPSBmYWxzZTsKLSAgICAgICAgICAgIG1WaWRlb0VPUyA9IGZhbHNlOwotICAgICAgICAgICAgbVNraXBSZW5kZXJpbmdBdWRpb1VudGlsTWVkaWFUaW1lVXMgPSAtMTsKLSAgICAgICAgICAgIG1Ta2lwUmVuZGVyaW5nVmlkZW9VbnRpbE1lZGlhVGltZVVzID0gLTE7Ci0gICAgICAgICAgICBtVmlkZW9MYXRlQnlVcyA9IDA7Ci0gICAgICAgICAgICBtTnVtRnJhbWVzVG90YWwgPSAwOwotICAgICAgICAgICAgbU51bUZyYW1lc0Ryb3BwZWQgPSAwOwotCi0gICAgICAgICAgICBtU291cmNlLT5zdGFydCgpOwotCi0gICAgICAgICAgICBtUmVuZGVyZXIgPSBuZXcgUmVuZGVyZXIoCi0gICAgICAgICAgICAgICAgICAgIG1BdWRpb1NpbmssCi0gICAgICAgICAgICAgICAgICAgIG5ldyBBTWVzc2FnZShrV2hhdFJlbmRlcmVyTm90aWZ5LCBpZCgpKSk7Ci0KLSAgICAgICAgICAgIGxvb3BlcigpLT5yZWdpc3RlckhhbmRsZXIobVJlbmRlcmVyKTsKLQotICAgICAgICAgICAgcG9zdFNjYW5Tb3VyY2VzKCk7Ci0gICAgICAgICAgICBicmVhazsKLSAgICAgICAgfQotCi0gICAgICAgIGNhc2Uga1doYXRTY2FuU291cmNlczoKLSAgICAgICAgewotICAgICAgICAgICAgaW50MzJfdCBnZW5lcmF0aW9uOwotICAgICAgICAgICAgQ0hFQ0sobXNnLT5maW5kSW50MzIoImdlbmVyYXRpb24iLCAmZ2VuZXJhdGlvbikpOwotICAgICAgICAgICAgaWYgKGdlbmVyYXRpb24gIT0gbVNjYW5Tb3VyY2VzR2VuZXJhdGlvbikgewotICAgICAgICAgICAgICAgIC8vIERyb3Agb2Jzb2xldGUgbXNnLgotICAgICAgICAgICAgICAgIGJyZWFrOwotICAgICAgICAgICAgfQotCi0gICAgICAgICAgICBtU2NhblNvdXJjZXNQZW5kaW5nID0gZmFsc2U7Ci0KLSAgICAgICAgICAgIEFMT0dWKCJzY2FubmluZyBzb3VyY2VzIGhhdmVBdWRpbz0lZCwgaGF2ZVZpZGVvPSVkIiwKLSAgICAgICAgICAgICAgICAgbUF1ZGlvRGVjb2RlciAhPSBOVUxMLCBtVmlkZW9EZWNvZGVyICE9IE5VTEwpOwotCi0gICAgICAgICAgICBpbnN0YW50aWF0ZURlY29kZXIoZmFsc2UsICZtVmlkZW9EZWNvZGVyKTsKLQotICAgICAgICAgICAgaWYgKG1BdWRpb1NpbmsgIT0gTlVMTCkgewotICAgICAgICAgICAgICAgIGluc3RhbnRpYXRlRGVjb2Rlcih0cnVlLCAmbUF1ZGlvRGVjb2Rlcik7Ci0gICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgIHN0YXR1c190IGVycjsKLSAgICAgICAgICAgIGlmICgoZXJyID0gbVNvdXJjZS0+ZmVlZE1vcmVUU0RhdGEoKSkgIT0gT0spIHsKLSAgICAgICAgICAgICAgICBpZiAobUF1ZGlvRGVjb2RlciA9PSBOVUxMICYmIG1WaWRlb0RlY29kZXIgPT0gTlVMTCkgewotICAgICAgICAgICAgICAgICAgICAvLyBXZSdyZSBub3QgY3VycmVudGx5IGRlY29kaW5nIGFueXRoaW5nIChubyBhdWRpbyBvcgotICAgICAgICAgICAgICAgICAgICAvLyB2aWRlbyB0cmFja3MgZm91bmQpIGFuZCB3ZSBqdXN0IHJhbiBvdXQgb2YgaW5wdXQgZGF0YS4KLQotICAgICAgICAgICAgICAgICAgICBpZiAoZXJyID09IEVSUk9SX0VORF9PRl9TVFJFQU0pIHsKLSAgICAgICAgICAgICAgICAgICAgICAgIG5vdGlmeUxpc3RlbmVyKE1FRElBX1BMQVlCQUNLX0NPTVBMRVRFLCAwLCAwKTsKLSAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHsKLSAgICAgICAgICAgICAgICAgICAgICAgIG5vdGlmeUxpc3RlbmVyKE1FRElBX0VSUk9SLCBNRURJQV9FUlJPUl9VTktOT1dOLCBlcnIpOwotICAgICAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgIGJyZWFrOwotICAgICAgICAgICAgfQotCi0gICAgICAgICAgICBpZiAobUF1ZGlvRGVjb2RlciA9PSBOVUxMIHx8IG1WaWRlb0RlY29kZXIgPT0gTlVMTCkgewotICAgICAgICAgICAgICAgIG1zZy0+cG9zdCgxMDAwMDBsbCk7Ci0gICAgICAgICAgICAgICAgbVNjYW5Tb3VyY2VzUGVuZGluZyA9IHRydWU7Ci0gICAgICAgICAgICB9Ci0gICAgICAgICAgICBicmVhazsKLSAgICAgICAgfQotCi0gICAgICAgIGNhc2Uga1doYXRWaWRlb05vdGlmeToKLSAgICAgICAgY2FzZSBrV2hhdEF1ZGlvTm90aWZ5OgotICAgICAgICB7Ci0gICAgICAgICAgICBib29sIGF1ZGlvID0gbXNnLT53aGF0KCkgPT0ga1doYXRBdWRpb05vdGlmeTsKLQotICAgICAgICAgICAgc3A8QU1lc3NhZ2U+IGNvZGVjUmVxdWVzdDsKLSAgICAgICAgICAgIENIRUNLKG1zZy0+ZmluZE1lc3NhZ2UoImNvZGVjLXJlcXVlc3QiLCAmY29kZWNSZXF1ZXN0KSk7Ci0KLSAgICAgICAgICAgIGludDMyX3Qgd2hhdDsKLSAgICAgICAgICAgIENIRUNLKGNvZGVjUmVxdWVzdC0+ZmluZEludDMyKCJ3aGF0IiwgJndoYXQpKTsKLQotICAgICAgICAgICAgaWYgKHdoYXQgPT0gQUNvZGVjOjprV2hhdEZpbGxUaGlzQnVmZmVyKSB7Ci0gICAgICAgICAgICAgICAgc3RhdHVzX3QgZXJyID0gZmVlZERlY29kZXJJbnB1dERhdGEoCi0gICAgICAgICAgICAgICAgICAgICAgICBhdWRpbywgY29kZWNSZXF1ZXN0KTsKLQotICAgICAgICAgICAgICAgIGlmIChlcnIgPT0gLUVXT1VMREJMT0NLKSB7Ci0gICAgICAgICAgICAgICAgICAgIGlmIChtU291cmNlLT5mZWVkTW9yZVRTRGF0YSgpID09IE9LKSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICBtc2ctPnBvc3QoMTAwMDBsbCk7Ci0gICAgICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICB9IGVsc2UgaWYgKHdoYXQgPT0gQUNvZGVjOjprV2hhdEVPUykgewotICAgICAgICAgICAgICAgIGludDMyX3QgZXJyOwotICAgICAgICAgICAgICAgIENIRUNLKGNvZGVjUmVxdWVzdC0+ZmluZEludDMyKCJlcnIiLCAmZXJyKSk7Ci0KLSAgICAgICAgICAgICAgICBpZiAoZXJyID09IEVSUk9SX0VORF9PRl9TVFJFQU0pIHsKLSAgICAgICAgICAgICAgICAgICAgQUxPR1YoImdvdCAlcyBkZWNvZGVyIEVPUyIsIGF1ZGlvID8gImF1ZGlvIiA6ICJ2aWRlbyIpOwotICAgICAgICAgICAgICAgIH0gZWxzZSB7Ci0gICAgICAgICAgICAgICAgICAgIEFMT0dWKCJnb3QgJXMgZGVjb2RlciBFT1Mgdy8gZXJyb3IgJWQiLAotICAgICAgICAgICAgICAgICAgICAgICAgIGF1ZGlvID8gImF1ZGlvIiA6ICJ2aWRlbyIsCi0gICAgICAgICAgICAgICAgICAgICAgICAgZXJyKTsKLSAgICAgICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgICAgICBtUmVuZGVyZXItPnF1ZXVlRU9TKGF1ZGlvLCBlcnIpOwotICAgICAgICAgICAgfSBlbHNlIGlmICh3aGF0ID09IEFDb2RlYzo6a1doYXRGbHVzaENvbXBsZXRlZCkgewotICAgICAgICAgICAgICAgIGJvb2wgbmVlZFNodXRkb3duOwotCi0gICAgICAgICAgICAgICAgaWYgKGF1ZGlvKSB7Ci0gICAgICAgICAgICAgICAgICAgIENIRUNLKElzRmx1c2hpbmdTdGF0ZShtRmx1c2hpbmdBdWRpbywgJm5lZWRTaHV0ZG93bikpOwotICAgICAgICAgICAgICAgICAgICBtRmx1c2hpbmdBdWRpbyA9IEZMVVNIRUQ7Ci0gICAgICAgICAgICAgICAgfSBlbHNlIHsKLSAgICAgICAgICAgICAgICAgICAgQ0hFQ0soSXNGbHVzaGluZ1N0YXRlKG1GbHVzaGluZ1ZpZGVvLCAmbmVlZFNodXRkb3duKSk7Ci0gICAgICAgICAgICAgICAgICAgIG1GbHVzaGluZ1ZpZGVvID0gRkxVU0hFRDsKLQotICAgICAgICAgICAgICAgICAgICBtVmlkZW9MYXRlQnlVcyA9IDA7Ci0gICAgICAgICAgICAgICAgfQotCi0gICAgICAgICAgICAgICAgQUxPR1YoImRlY29kZXIgJXMgZmx1c2ggY29tcGxldGVkIiwgYXVkaW8gPyAiYXVkaW8iIDogInZpZGVvIik7Ci0KLSAgICAgICAgICAgICAgICBpZiAobmVlZFNodXRkb3duKSB7Ci0gICAgICAgICAgICAgICAgICAgIEFMT0dWKCJpbml0aWF0aW5nICVzIGRlY29kZXIgc2h1dGRvd24iLAotICAgICAgICAgICAgICAgICAgICAgICAgIGF1ZGlvID8gImF1ZGlvIiA6ICJ2aWRlbyIpOwotCi0gICAgICAgICAgICAgICAgICAgIChhdWRpbyA/IG1BdWRpb0RlY29kZXIgOiBtVmlkZW9EZWNvZGVyKS0+aW5pdGlhdGVTaHV0ZG93bigpOwotCi0gICAgICAgICAgICAgICAgICAgIGlmIChhdWRpbykgewotICAgICAgICAgICAgICAgICAgICAgICAgbUZsdXNoaW5nQXVkaW8gPSBTSFVUVElOR19ET1dOX0RFQ09ERVI7Ci0gICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICBtRmx1c2hpbmdWaWRlbyA9IFNIVVRUSU5HX0RPV05fREVDT0RFUjsKLSAgICAgICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgICAgIGZpbmlzaEZsdXNoSWZQb3NzaWJsZSgpOwotICAgICAgICAgICAgfSBlbHNlIGlmICh3aGF0ID09IEFDb2RlYzo6a1doYXRPdXRwdXRGb3JtYXRDaGFuZ2VkKSB7Ci0gICAgICAgICAgICAgICAgaWYgKGF1ZGlvKSB7Ci0gICAgICAgICAgICAgICAgICAgIGludDMyX3QgbnVtQ2hhbm5lbHM7Ci0gICAgICAgICAgICAgICAgICAgIENIRUNLKGNvZGVjUmVxdWVzdC0+ZmluZEludDMyKCJjaGFubmVsLWNvdW50IiwgJm51bUNoYW5uZWxzKSk7Ci0KLSAgICAgICAgICAgICAgICAgICAgaW50MzJfdCBzYW1wbGVSYXRlOwotICAgICAgICAgICAgICAgICAgICBDSEVDSyhjb2RlY1JlcXVlc3QtPmZpbmRJbnQzMigic2FtcGxlLXJhdGUiLCAmc2FtcGxlUmF0ZSkpOwotCi0gICAgICAgICAgICAgICAgICAgIEFMT0dWKCJBdWRpbyBvdXRwdXQgZm9ybWF0IGNoYW5nZWQgdG8gJWQgSHosICVkIGNoYW5uZWxzIiwKLSAgICAgICAgICAgICAgICAgICAgICAgICBzYW1wbGVSYXRlLCBudW1DaGFubmVscyk7Ci0KLSAgICAgICAgICAgICAgICAgICAgbUF1ZGlvU2luay0+Y2xvc2UoKTsKLSAgICAgICAgICAgICAgICAgICAgQ0hFQ0tfRVEobUF1ZGlvU2luay0+b3BlbigKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2FtcGxlUmF0ZSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbnVtQ2hhbm5lbHMsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIENIQU5ORUxfTUFTS19VU0VfQ0hBTk5FTF9PUkRFUiwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgQVVESU9fRk9STUFUX1BDTV8xNl9CSVQsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDggLyogYnVmZmVyQ291bnQgKi8pLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoc3RhdHVzX3QpT0spOwotICAgICAgICAgICAgICAgICAgICBtQXVkaW9TaW5rLT5zdGFydCgpOwotCi0gICAgICAgICAgICAgICAgICAgIG1SZW5kZXJlci0+c2lnbmFsQXVkaW9TaW5rQ2hhbmdlZCgpOwotICAgICAgICAgICAgICAgIH0gZWxzZSB7Ci0gICAgICAgICAgICAgICAgICAgIC8vIHZpZGVvCi0KLSAgICAgICAgICAgICAgICAgICAgaW50MzJfdCB3aWR0aCwgaGVpZ2h0OwotICAgICAgICAgICAgICAgICAgICBDSEVDSyhjb2RlY1JlcXVlc3QtPmZpbmRJbnQzMigid2lkdGgiLCAmd2lkdGgpKTsKLSAgICAgICAgICAgICAgICAgICAgQ0hFQ0soY29kZWNSZXF1ZXN0LT5maW5kSW50MzIoImhlaWdodCIsICZoZWlnaHQpKTsKLQotICAgICAgICAgICAgICAgICAgICBpbnQzMl90IGNyb3BMZWZ0LCBjcm9wVG9wLCBjcm9wUmlnaHQsIGNyb3BCb3R0b207Ci0gICAgICAgICAgICAgICAgICAgIENIRUNLKGNvZGVjUmVxdWVzdC0+ZmluZFJlY3QoCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICJjcm9wIiwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJmNyb3BMZWZ0LCAmY3JvcFRvcCwgJmNyb3BSaWdodCwgJmNyb3BCb3R0b20pKTsKLQotICAgICAgICAgICAgICAgICAgICBBTE9HVigiVmlkZW8gb3V0cHV0IGZvcm1hdCBjaGFuZ2VkIHRvICVkIHggJWQgIgotICAgICAgICAgICAgICAgICAgICAgICAgICIoY3JvcDogJWQgeCAlZCBAICglZCwgJWQpKSIsCi0gICAgICAgICAgICAgICAgICAgICAgICAgd2lkdGgsIGhlaWdodCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAoY3JvcFJpZ2h0IC0gY3JvcExlZnQgKyAxKSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAoY3JvcEJvdHRvbSAtIGNyb3BUb3AgKyAxKSwKLSAgICAgICAgICAgICAgICAgICAgICAgICBjcm9wTGVmdCwgY3JvcFRvcCk7Ci0KLSAgICAgICAgICAgICAgICAgICAgbm90aWZ5TGlzdGVuZXIoCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgTUVESUFfU0VUX1ZJREVPX1NJWkUsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgY3JvcFJpZ2h0IC0gY3JvcExlZnQgKyAxLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNyb3BCb3R0b20gLSBjcm9wVG9wICsgMSk7Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgfSBlbHNlIGlmICh3aGF0ID09IEFDb2RlYzo6a1doYXRTaHV0ZG93bkNvbXBsZXRlZCkgewotICAgICAgICAgICAgICAgIEFMT0dWKCIlcyBzaHV0ZG93biBjb21wbGV0ZWQiLCBhdWRpbyA/ICJhdWRpbyIgOiAidmlkZW8iKTsKLSAgICAgICAgICAgICAgICBpZiAoYXVkaW8pIHsKLSAgICAgICAgICAgICAgICAgICAgbUF1ZGlvRGVjb2Rlci5jbGVhcigpOwotCi0gICAgICAgICAgICAgICAgICAgIENIRUNLX0VRKChpbnQpbUZsdXNoaW5nQXVkaW8sIChpbnQpU0hVVFRJTkdfRE9XTl9ERUNPREVSKTsKLSAgICAgICAgICAgICAgICAgICAgbUZsdXNoaW5nQXVkaW8gPSBTSFVUX0RPV047Ci0gICAgICAgICAgICAgICAgfSBlbHNlIHsKLSAgICAgICAgICAgICAgICAgICAgbVZpZGVvRGVjb2Rlci5jbGVhcigpOwotCi0gICAgICAgICAgICAgICAgICAgIENIRUNLX0VRKChpbnQpbUZsdXNoaW5nVmlkZW8sIChpbnQpU0hVVFRJTkdfRE9XTl9ERUNPREVSKTsKLSAgICAgICAgICAgICAgICAgICAgbUZsdXNoaW5nVmlkZW8gPSBTSFVUX0RPV047Ci0gICAgICAgICAgICAgICAgfQotCi0gICAgICAgICAgICAgICAgZmluaXNoRmx1c2hJZlBvc3NpYmxlKCk7Ci0gICAgICAgICAgICB9IGVsc2UgaWYgKHdoYXQgPT0gQUNvZGVjOjprV2hhdEVycm9yKSB7Ci0gICAgICAgICAgICAgICAgQUxPR0UoIlJlY2VpdmVkIGVycm9yIGZyb20gJXMgZGVjb2RlciwgYWJvcnRpbmcgcGxheWJhY2suIiwKLSAgICAgICAgICAgICAgICAgICAgIGF1ZGlvID8gImF1ZGlvIiA6ICJ2aWRlbyIpOwotCi0gICAgICAgICAgICAgICAgbVJlbmRlcmVyLT5xdWV1ZUVPUyhhdWRpbywgVU5LTk9XTl9FUlJPUik7Ci0gICAgICAgICAgICB9IGVsc2UgaWYgKHdoYXQgPT0gQUNvZGVjOjprV2hhdERyYWluVGhpc0J1ZmZlcikgewotICAgICAgICAgICAgICAgIHJlbmRlckJ1ZmZlcihhdWRpbywgY29kZWNSZXF1ZXN0KTsKLSAgICAgICAgICAgIH0gZWxzZSB7Ci0gICAgICAgICAgICAgICAgQUxPR1YoIlVuaGFuZGxlZCBjb2RlYyBub3RpZmljYXRpb24gJWQuIiwgd2hhdCk7Ci0gICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgIGJyZWFrOwotICAgICAgICB9Ci0KLSAgICAgICAgY2FzZSBrV2hhdFJlbmRlcmVyTm90aWZ5OgotICAgICAgICB7Ci0gICAgICAgICAgICBpbnQzMl90IHdoYXQ7Ci0gICAgICAgICAgICBDSEVDSyhtc2ctPmZpbmRJbnQzMigid2hhdCIsICZ3aGF0KSk7Ci0KLSAgICAgICAgICAgIGlmICh3aGF0ID09IFJlbmRlcmVyOjprV2hhdEVPUykgewotICAgICAgICAgICAgICAgIGludDMyX3QgYXVkaW87Ci0gICAgICAgICAgICAgICAgQ0hFQ0sobXNnLT5maW5kSW50MzIoImF1ZGlvIiwgJmF1ZGlvKSk7Ci0KLSAgICAgICAgICAgICAgICBpbnQzMl90IGZpbmFsUmVzdWx0OwotICAgICAgICAgICAgICAgIENIRUNLKG1zZy0+ZmluZEludDMyKCJmaW5hbFJlc3VsdCIsICZmaW5hbFJlc3VsdCkpOwotCi0gICAgICAgICAgICAgICAgaWYgKGF1ZGlvKSB7Ci0gICAgICAgICAgICAgICAgICAgIG1BdWRpb0VPUyA9IHRydWU7Ci0gICAgICAgICAgICAgICAgfSBlbHNlIHsKLSAgICAgICAgICAgICAgICAgICAgbVZpZGVvRU9TID0gdHJ1ZTsKLSAgICAgICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgICAgICBpZiAoZmluYWxSZXN1bHQgPT0gRVJST1JfRU5EX09GX1NUUkVBTSkgewotICAgICAgICAgICAgICAgICAgICBBTE9HVigicmVhY2hlZCAlcyBFT1MiLCBhdWRpbyA/ICJhdWRpbyIgOiAidmlkZW8iKTsKLSAgICAgICAgICAgICAgICB9IGVsc2UgewotICAgICAgICAgICAgICAgICAgICBBTE9HRSgiJXMgdHJhY2sgZW5jb3VudGVyZWQgYW4gZXJyb3IgKCVkKSIsCi0gICAgICAgICAgICAgICAgICAgICAgICAgYXVkaW8gPyAiYXVkaW8iIDogInZpZGVvIiwgZmluYWxSZXN1bHQpOwotCi0gICAgICAgICAgICAgICAgICAgIG5vdGlmeUxpc3RlbmVyKAotICAgICAgICAgICAgICAgICAgICAgICAgICAgIE1FRElBX0VSUk9SLCBNRURJQV9FUlJPUl9VTktOT1dOLCBmaW5hbFJlc3VsdCk7Ci0gICAgICAgICAgICAgICAgfQotCi0gICAgICAgICAgICAgICAgaWYgKChtQXVkaW9FT1MgfHwgbUF1ZGlvRGVjb2RlciA9PSBOVUxMKQotICAgICAgICAgICAgICAgICAgICAgICAgJiYgKG1WaWRlb0VPUyB8fCBtVmlkZW9EZWNvZGVyID09IE5VTEwpKSB7Ci0gICAgICAgICAgICAgICAgICAgIG5vdGlmeUxpc3RlbmVyKE1FRElBX1BMQVlCQUNLX0NPTVBMRVRFLCAwLCAwKTsKLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICB9IGVsc2UgaWYgKHdoYXQgPT0gUmVuZGVyZXI6OmtXaGF0UG9zaXRpb24pIHsKLSAgICAgICAgICAgICAgICBpbnQ2NF90IHBvc2l0aW9uVXM7Ci0gICAgICAgICAgICAgICAgQ0hFQ0sobXNnLT5maW5kSW50NjQoInBvc2l0aW9uVXMiLCAmcG9zaXRpb25VcykpOwotCi0gICAgICAgICAgICAgICAgQ0hFQ0sobXNnLT5maW5kSW50NjQoInZpZGVvTGF0ZUJ5VXMiLCAmbVZpZGVvTGF0ZUJ5VXMpKTsKLQotICAgICAgICAgICAgICAgIGlmIChtRHJpdmVyICE9IE5VTEwpIHsKLSAgICAgICAgICAgICAgICAgICAgc3A8TnVQbGF5ZXJEcml2ZXI+IGRyaXZlciA9IG1Ecml2ZXIucHJvbW90ZSgpOwotICAgICAgICAgICAgICAgICAgICBpZiAoZHJpdmVyICE9IE5VTEwpIHsKLSAgICAgICAgICAgICAgICAgICAgICAgIGRyaXZlci0+bm90aWZ5UG9zaXRpb24ocG9zaXRpb25Vcyk7Ci0KLSAgICAgICAgICAgICAgICAgICAgICAgIGRyaXZlci0+bm90aWZ5RnJhbWVTdGF0cygKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbU51bUZyYW1lc1RvdGFsLCBtTnVtRnJhbWVzRHJvcHBlZCk7Ci0gICAgICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICB9IGVsc2UgaWYgKHdoYXQgPT0gUmVuZGVyZXI6OmtXaGF0Rmx1c2hDb21wbGV0ZSkgewotICAgICAgICAgICAgICAgIENIRUNLX0VRKHdoYXQsIChpbnQzMl90KVJlbmRlcmVyOjprV2hhdEZsdXNoQ29tcGxldGUpOwotCi0gICAgICAgICAgICAgICAgaW50MzJfdCBhdWR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bVJlbmRlcmVyLT5yZXN1bWUoKTsKLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgIGlmIChtRmx1c2hpbmdBdWRpbyAhPSBOT05FIHx8IG1GbHVzaGluZ1ZpZGVvICE9IE5PTkUpIHsKLSAgICAgICAgICAgICAgICAvLyBXZSdyZSBjdXJyZW50bHkgZmx1c2hpbmcsIHBvc3Rwb25lIHRoZSByZXNldCB1bnRpbCB0aGF0J3MKLSAgICAgICAgICAgICAgICAvLyBjb21wbGV0ZWQuCi0KLSAgICAgICAgICAgICAgICBBTE9HVigicG9zdHBvbmluZyByZXNldCBtRmx1c2hpbmdBdWRpbz0lZCwgbUZsdXNoaW5nVmlkZW89JWQiLAotICAgICAgICAgICAgICAgICAgICAgIG1GbHVzaGluZ0F1ZGlvLCBtRmx1c2hpbmdWaWRlbyk7Ci0KLSAgICAgICAgICAgICAgICBtUmVzZXRQb3N0cG9uZWQgPSB0cnVlOwotICAgICAgICAgICAgICAgIGJyZWFrOwotICAgICAgICAgICAgfQotCi0gICAgICAgICAgICBpZiAobUF1ZGlvRGVjb2RlciA9PSBOVUxMICYmIG1WaWRlb0RlY29kZXIgPT0gTlVMTCkgewotICAgICAgICAgICAgICAgIGZpbmlzaFJlc2V0KCk7Ci0gICAgICAgICAgICAgICAgYnJlYWs7Ci0gICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgIG1UaW1lRGlzY29udGludWl0eVBlbmRpbmcgPSB0cnVlOwotCi0gICAgICAgICAgICBpZiAobUF1ZGlvRGVjb2RlciAhPSBOVUxMKSB7Ci0gICAgICAgICAgICAgICAgZmx1c2hEZWNvZGVyKHRydWUgLyogYXVkaW8gKi8sIHRydWUgLyogbmVlZFNodXRkb3duICovKTsKLSAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgaWYgKG1WaWRlb0RlY29kZXIgIT0gTlVMTCkgewotICAgICAgICAgICAgICAgIGZsdXNoRGVjb2RlcihmYWxzZSAvKiBhdWRpbyAqLywgdHJ1ZSAvKiBuZWVkU2h1dGRvd24gKi8pOwotICAgICAgICAgICAgfQotCi0gICAgICAgICAgICBtUmVzZXRJblByb2dyZXNzID0gdHJ1ZTsKLSAgICAgICAgICAgIGJyZWFrOwotICAgICAgICB9Ci0KLSAgICAgICAgY2FzZSBrV2hhdFNlZWs6Ci0gICAgICAgIHsKLSAgICAgICAgICAgIGludDY0X3Qgc2Vla1RpbWVVczsKLSAgICAgICAgICAgIENIRUNLKG1zZy0+ZmluZEludDY0KCJzZWVrVGltZVVzIiwgJnNlZWtUaW1lVXMpKTsKLQotICAgICAgICAgICAgQUxPR1YoImtXaGF0U2VlayBzZWVrVGltZVVzPSVsbGQgdXMgKCUuMmYgc2VjcykiLAotICAgICAgICAgICAgICAgICBzZWVrVGltZVVzLCBzZWVrVGltZVVzIC8gMUU2KTsKLQotICAgICAgICAgICAgbVNvdXJjZS0+c2Vla1RvKHNlZWtUaW1lVXMpOwotCi0gICAgICAgICAgICBpZiAobURyaXZlciAhPSBOVUxMKSB7Ci0gICAgICAgICAgICAgICAgc3A8TnVQbGF5ZXJEcml2ZXI+IGRyaXZlciA9IG1Ecml2ZXIucHJvbW90ZSgpOwotICAgICAgICAgICAgICAgIGlmIChkcml2ZXIgIT0gTlVMTCkgewotICAgICAgICAgICAgICAgICAgICBkcml2ZXItPm5vdGlmeVNlZWtDb21wbGV0ZSgpOwotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgYnJlYWs7Ci0gICAgICAgIH0KLQotICAgICAgICBjYXNlIGtXaGF0UGF1c2U6Ci0gICAgICAgIHsKLSAgICAgICAgICAgIENIRUNLKG1SZW5kZXJlciAhPSBOVUxMKTsKLSAgICAgICAgICAgIG1SZW5kZXJlci0+cGF1c2UoKTsKLSAgICAgICAgICAgIGJyZWFrOwotICAgICAgICB9Ci0KLSAgICAgICAgY2FzZSBrV2hhdFJlc3VtZToKLSAgICAgICAgewotICAgICAgIC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QnVmZmVyPiBhY2Nlc3NVbml0OwotCi0gICAgYm9vbCBkcm9wQWNjZXNzVW5pdDsKLSAgICBkbyB7Ci0gICAgICAgIHN0YXR1c190IGVyciA9IG1Tb3VyY2UtPmRlcXVldWVBY2Nlc3NVbml0KGF1ZGlvLCAmYWNjZXNzVW5pdCk7Ci0KLSAgICAgICAgaWYgKGVyciA9PSAtRVdPVUxEQkxPQ0spIHsKLSAgICAgICAgICAgIHJldHVybiBlcnI7Ci0gICAgICAgIH0gZWxzZSBpZiAoZXJyICE9IE9LKSB7Ci0gICAgICAgICAgICBpZiAoZXJyID09IElORk9fRElTQ09OVElOVUlUWSkgewotICAgICAgICAgICAgICAgIGludDMyX3QgdHlwZTsKLSAgICAgICAgICAgICAgICBDSEVDSyhhY2Nlc3NVbml0LT5tZXRhKCktPmZpbmRJbnQzMigiZGlzY29udGludWl0eSIsICZ0eXBlKSk7Ci0KLSAgICAgICAgICAgICAgICBib29sIGZvcm1hdENoYW5nZSA9Ci0gICAgICAgICAgICAgICAgICAgIChhdWRpbyAmJgotICAgICAgICAgICAgICAgICAgICAgKHR5cGUgJiBBVFNQYXJzZXI6OkRJU0NPTlRJTlVJVFlfQVVESU9fRk9STUFUKSkKLSAgICAgICAgICAgICAgICAgICAgfHwgKCFhdWRpbyAmJgotICAgICAgICAgICAgICAgICAgICAgICAgICAgICh0eXBlICYgQVRTUGFyc2VyOjpESVNDT05USU5VSVRZX1ZJREVPX0ZPUk1BVCkpOwotCi0gICAgICAgICAgICAgICAgYm9vbCB0aW1lQ2hhbmdlID0gKHR5cGUgJiBBVFNQYXJzZXI6OkRJU0NPTlRJTlVJVFlfVElNRSkgIT0gMDsKLQotICAgICAgICAgICAgICAgIEFMT0dJKCIlcyBkaXNjb250aW51aXR5IChmb3JtYXRDaGFuZ2U9JWQsIHRpbWU9JWQpIiwKLSAgICAgICAgICAgICAgICAgICAgIGF1ZGlvID8gImF1ZGlvIiA6ICJ2aWRlbyIsIGZvcm1hdENoYW5nZSwgdGltZUNoYW5nZSk7Ci0KLSAgICAgICAgICAgICAgICBpZiAoYXVkaW8pIHsKLSAgICAgICAgICAgICAgICAgICAgbVNraXBSZW5kZXJpbmdBdWRpb1VudGlsTWVkaWFUaW1lVXMgPSAtMTsKLSAgICAgICAgICAgICAgICB9IGVsc2UgewotICAgICAgICAgICAgICAgICAgICBtU2tpcFJlbmRlcmluZ1ZpZGVvVW50aWxNZWRpYVRpbWVVcyA9IC0xOwotICAgICAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgICAgIGlmICh0aW1lQ2hhbmdlKSB7Ci0gICAgICAgICAgICAgICAgICAgIHNwPEFNZXNzYWdlPiBleHRyYTsKLSAgICAgICAgICAgICAgICAgICAgaWYgKGFjY2Vzc1VuaXQtPm1ldGEoKS0+ZmluZE1lc3NhZ2UoImV4dHJhIiwgJmV4dHJhKQotICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIGV4dHJhICE9IE5VTEwpIHsKLSAgICAgICAgICAgICAgICAgICAgICAgIGludDY0X3QgcmVzdW1lQXRNZWRpYVRpbWVVczsKLSAgICAgICAgICAgICAgICAgICAgICAgIGlmIChleHRyYS0+ZmluZEludDY0KAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgInJlc3VtZS1hdC1tZWRpYXRpbWVVcyIsICZyZXN1bWVBdE1lZGlhVGltZVVzKSkgewotICAgICAgICAgICAgICAgICAgICAgICAgICAgIEFMT0dJKCJzdXBwcmVzc2luZyByZW5kZXJpbmcgb2YgJXMgdW50aWwgJWxsZCB1cyIsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBhdWRpbyA/ICJhdWRpbyIgOiAidmlkZW8iLCByZXN1bWVBdE1lZGlhVGltZVVzKTsKLQotICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChhdWRpbykgewotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBtU2tpcFJlbmRlcmluZ0F1ZGlvVW50aWxNZWRpYVRpbWVVcyA9Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXN1bWVBdE1lZGlhVGltZVVzOwotICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1Ta2lwUmVuZGVyaW5nVmlkZW9VbnRpbE1lZGlhVGltZVVzID0KLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJlc3VtZUF0TWVkaWFUaW1lVXM7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgfQotCi0gICAgICAgICAgICAgICAgbVRpbWVEaXNjb250aW51aXR5UGVuZGluZyA9Ci0gICAgICAgICAgICAgICAgICAgIG1UaW1lRGlzY29udGludWl0eVBlbmRpbmcgfHwgdGltZUNoYW5nZTsKLQotICAgICAgICAgICAgICAgIGlmIChmb3JtYXRDaGFuZ2UgfHwgdGltZUNoYW5nZSkgewotICAgICAgICAgICAgICAgICAgICBmbHVzaERlY29kZXIoYXVkaW8sIGZvcm1hdENoYW5nZSk7Ci0gICAgICAgICAgICAgICAgfSBlbHNlIHsKLSAgICAgICAgICAgICAgICAgICAgLy8gVGhpcyBzdHJlYW0gaXMgdW5hZmZlY3RlZCBieSB0aGUgZGlzY29udGludWl0eQotCi0gICAgICAgICAgICAgICAgICAgIGlmIChhdWRpbykgewotICAgICAgICAgICAgICAgICAgICAgICAgbUZsdXNoaW5nQXVkaW8gPSBGTFVTSEVEOwotICAgICAgICAgICAgICAgICAgICB9IGVsc2UgewotICAgICAgICAgICAgICAgICAgICAgICAgbUZsdXNoaW5nVmlkZW8gPSBGTFVTSEVEOwotICAgICAgICAgICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgICAgICAgICAgZmluaXNoRmx1c2hJZlBvc3NpYmxlKCk7Ci0KLSAgICAgICAgICAgICAgICAg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NPREVSOwotCi0gICAgaWYgKGF1ZGlvKSB7Ci0gICAgICAgIENIRUNLKG1GbHVzaGluZ0F1ZGlvID09IE5PTkUKLSAgICAgICAgICAgICAgICB8fCBtRmx1c2hpbmdBdWRpbyA9PSBBV0FJVElOR19ESVNDT05USU5VSVRZKTsKLQotICAgICAgICBtRmx1c2hpbmdBdWRpbyA9IG5ld1N0YXR1czsKLQotICAgICAgICBpZiAobUZsdXNoaW5nVmlkZW8gPT0gTk9ORSkgewotICAgICAgICAgICAgbUZsdXNoaW5nVmlkZW8gPSAobVZpZGVvRGVjb2RlciAhPSBOVUxMKQotICAgICAgICAgICAgICAgID8gQVdBSVRJTkdfRElTQ09OVElOVUlUWQotICAgICAgICAgICAgICAgIDogRkxVU0hFRDsKLSAgICAgICAgfQotICAgIH0gZWxzZSB7Ci0gICAgICAgIENIRUNLKG1GbHVzaGluZ1ZpZGVvID09IE5PTkUKLSAgICAgICAgICAgICAgICB8fCBtRmx1c2hpbmdWaWRlbyA9PSBBV0FJVElOR19ESVNDT05USU5VSVRZKTsKLQotICAgICAgICBtRmx1c2hpbmdWaWRlbyA9IG5ld1N0YXR1czsKLQotICAgICAgICBpZiAobUZsdXNoaW5nQXVkaW8gPT0gTk9ORSkgewotICAgICAgICAgICAgbUZsdXNoaW5nQXVkaW8gPSAobUF1ZGlvRGVjb2RlciAhPSBOVUxMKQotICAgICAgICAgICAgICAgID8gQVdBSVRJTkdfRElTQ09OVElOVUlUWQotICAgICAgICAgICAgICAgIDogRkxVU0hFRDsKLSAgICAgICAgfQotICAgIH0KLX0KLQotfSAgLy8gbmFtZXNwYWNlIGFuZHJvaWQKZGlmZiAtLWdpdCBhL21lZGlhL2xpYm1lZGlhcGxheWVyc2VydmljZS9udXBsYXllci9OdVBsYXllci5oIGIvbWVkaWEvbGlibWVkaWFwbGF5ZXJzZXJ2aWNlL251cGxheWVyL051UGxheWVyLmgKZGVsZXRlZCBmaWxlIG1vZGUgMTAwNjQ0CmluZGV4IDI1Nz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U2NhblNvdXJjZXMgICAgICAgICAgICAgICAgPSAnc2NhbicsCi0gICAgICAgIGtXaGF0VmlkZW9Ob3RpZnkgICAgICAgICAgICAgICAgPSAndmlkTicsCi0gICAgICAgIGtXaGF0QXVkaW9Ob3RpZnkgICAgICAgICAgICAgICAgPSAnYXVkTicsCi0gICAgICAgIGtXaGF0UmVuZGVyZXJOb3RpZnkgICAgICAgICAgICAgPSAncmVuTicsCi0gICAgICAgIGtXaGF0UmVzZXQgICAgICAgICAgICAgICAgICAgICAgPSAncnNldCcsCi0gICAgICAgIGtXaGF0U2VlayAgICAgICAgICAgICAgICAgICAgICAgPSAnc2VlaycsCi0gICAgICAgIGtXaGF0UGF1c2UgICAgICAgICAgICAgICAgICAgICAgPSAncGF1cycsCi0gICAgICAgIGtXaGF0UmVzdW1lICAgICAgICAgICAgICAgICAgICAgPSAncnNtZScsCi0gICAgfTsKLQotICAgIHdwPE51UGxheWVyRHJpdmVyPiBtRHJpdmVyOwotICAgIGJvb2wgbVVJRFZhbGlkOwotICAgIHVpZF90IG1VSUQ7Ci0gICAgc3A8U291cmNlPiBtU291cmNlOwotICAgIHNwPE5hdGl2ZVdpbmRvd1dyYXBwZXI+IG1OYXRpdmVXaW5kb3c7Ci0gICAgc3A8TWVkaWFQbGF5ZXJCYXNlOjpBdWRpb1Npbms+IG1BdWRpb1Npbms7Ci0gICAgc3A8RGVjb2Rlcj4gbVZpZGVvRGVjb2RlcjsKLSAgICBib29sIG1WaWRlb0lzQVZDOwotICAgIHNwPERlY29kZXI+IG1BdWRpb0RlY29kZXI7Ci0gICAgc3A8UmVuZGVyZXI+IG1SZW5kZXJlcjsKLQotICAgIGJvb2wgbUF1ZGlvRU9TOwotICAgIGJvb2wgbVZpZGVvRU9TOwotCi0gICAgYm9vbCBtU2NhblNvdXJjZXNQZW5kaW5nOwotICAgIGludDMyX3QgbVNjYW5Tb3VyY2VzR2VuZXJhdGlvbjsKLQotICAgIGVudW0gRmx1c2hTdGF0dXMgewotICA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U2Vla0NvbXBsZXRlKCk7Ci0gICAgICAgICAgICAgICAgfSBlbHNlIHsKLSAgICAgICAgICAgICAgICAgICAgbVBsYXllci0+c2Vla1RvQXN5bmMobVN0YXJ0dXBTZWVrVGltZVVzKTsKLSAgICAgICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgICAgICBtU3RhcnR1cFNlZWtUaW1lVXMgPSAtMTsKLSAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgYnJlYWs7Ci0gICAgICAgIH0KLSAgICAgICAgY2FzZSBQTEFZSU5HOgotICAgICAgICAgICAgcmV0dXJuIE9LOwotICAgICAgICBkZWZhdWx0OgotICAgICAgICB7Ci0gICAgICAgICAgICBDSEVDS19FUSgoaW50KW1TdGF0ZSwgKGludClQQVVTRUQpOwotCi0gICAgICAgICAgICBtUGxheWVyLT5yZXN1bWUoKTsKLSAgICAgICAgICAgIGJyZWFrOwotICAgICAgICB9Ci0gICAgfQotCi0gICAgbVN0YXRlID0gUExBWUlORzsKLQotICAgIHJldHVybiBPSzsKLX0KLQotc3RhdHVzX3QgTnVQbGF5ZXJEcml2ZXI6OnN0b3AoKSB7Ci0gICAgcmV0dXJuIHBhdXNlKCk7Ci19Ci0KLXN0YXR1c190IE51UGxheWVyRHJpdmVyOjpwYXVzZSgpIHsKLSAgICBzd2l0Y2ggKG1TdGF0ZSkgewotICAgICAgICBjYXNlIFVOSU5JVElBTElaRUQ6Ci0gICAgICAgICAgICByZXR1cm4gSU5WQUxJRF9PUEVSQVRJT047Ci0gICAgICAgIGNhc2UgU1RPUFBFRDoKLSAgICAgICAgICAgIHJldHVybiBPSzsKLSAgICAgICAgY2FzZSBQTEFZSU5HOgotICAgICAgICAgICAgbVBsYXllci0+cGF1c2UoKTsKLSAgICAgICAgICAgIGJyZWFrOwotICAgICAgICBkZWZhdWx0OgotICAgICAgICB7Ci0gICAgICAgICAgICBDSEVDS19FUSgoaW50KW1TdGF0ZSwgKGludClQQVVTRUQpOwotICAgICAgICAgICAgcmV0dXJuIE9LOwotICAgICAgICB9Ci0gICAgfQotCi0gICAgbVN0YXRlID0gUEFVU0VEOwotCi0gICAgcmV0dXJuIE9LOwotfQotCi1ib29sIE51UGxheWVyRHJpdmVyOjppc1BsYXlpbmcoKSB7Ci0gICAgcmV0dXJuIG1TdGF0ZSA9PSBQTEFZSU5HICYmICFtQXRFT1M7Ci19Ci0KLXN0YXR1c190IE51UGxheWVyRHJpdmVyOjpzZWVrVG8oaW50IG1zZWMpIHsKLSAgICBpbnQ2NF90IHNlZWtUaW1lVXMgPSBtc2VjICogMTAwMGxsOwotCi0gICAgc3dpdGNoIChtU3RhdGUpIHsKLSAgICAgICAgY2FzZSBVTklOSVRJQUxJWkVEOgotICAgICAgICAgICAgcmV0dXJuIElOVkFMSURfT1BFUkFUSU9OOwotICAgICAgICBjYXNlIFNUT1BQRUQ6Ci0gICAgICAgIHsKLSAgICAgICAgICAgIG1TdGFydHVwU2Vla1RpbWVVcyA9IHNlZWtUaW1lVXM7Ci0gICAgICAgICAgICBicmVhazsKLSAgICAgICAgfQotICAgICAgICBjYXNlIFBMQVlJTkc6Ci0gICAgICAgIGNhc2UgUEFVU0VEOgotICAgICAgICB7Ci0gICAgICAgICAgICBtQXRFT1MgPSBmYWxzZTsKLSAgICAgICAgICAgIG1QbGF5ZXItPnNlZWtUb0FzeW5jKHNlZWtUaW1lVXMpOwotICAgICAgICAgICAgYnJlYWs7Ci0gICAgICAgIH0KLQotICAgICAgICBkZWZhdWx0OgotICAgICAgICAgICAgVFJFU1BBU1MoKTsKLSAgICAgICAgICAgIGJyZWFrOwotICAgIH0KLQotICAgIHJldHVybiBPSzsKLX0KLQotc3RhdHVzX3QgTnVQbGF5ZXJEcml2ZXI6OmdldEN1cnJlbnRQb3NpdGlvbihpbnQgKm1zZWMpIHsKLSAgICBNdXRleDo6QXV0b2xvY2sgYXV0b0xvY2sobUxvY2spOwotCi0gICAgaWYgKG1Qb3NpdGlvblVzIDwgMCkgewotICAgICAgICAqbXNlYy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ZSBkYXRhIHRvCi0gICAgICAgICAgICAgICAgLy8gcGxheSBiYWNrLgotICAgICAgICAgICAgICAgIGludDY0X3QgZGVsYXlVcyA9Ci0gICAgICAgICAgICAgICAgICAgIG1BdWRpb1NpbmstPm1zZWNzUGVyRnJhbWUoKQotICAgICAgICAgICAgICAgICAgICAgICAgKiBudW1GcmFtZXNQZW5kaW5nUGxheW91dCAqIDEwMDBsbDsKLQotICAgICAgICAgICAgICAgIC8vIExldCdzIGdpdmUgaXQgbW9yZSBkYXRhIGFmdGVyIGFib3V0IGhhbGYgdGhhdCB0aW1lCi0gICAgICAgICAgICAgICAgLy8gaGFzIGVsYXBzZWQuCi0gICAgICAgICAgICAgICAgcG9zdERyYWluQXVkaW9RdWV1ZShkZWxheVVzIC8gMik7Ci0gICAgICAgICAgICB9Ci0gICAgICAgICAgICBicmVhazsKLSAgICAgICAgfQotCi0gICAgICAgIGNhc2Uga1doYXREcmFpblZpZGVvUXVldWU6Ci0gICAgICAgIHsKLSAgICAgICAgICAgIGludDMyX3QgZ2VuZXJhdGlvbjsKLSAgICAgICAgICAgIENIRUNLKG1zZy0+ZmluZEludDMyKCJnZW5lcmF0aW9uIiwgJmdlbmVyYXRpb24pKTsKLSAgICAgICAgICAgIGlmIChnZW5lcmF0aW9uICE9IG1WaWRlb1F1ZXVlR2VuZXJhdGlvbikgewotICAgICAgICAgICAgICAgIGJyZWFrOwotICAgICAgICAgICAgfQotCi0gICAgICAgICAgICBtRHJhaW5WaWRlb1F1ZXVlUGVuZGluZyA9IGZhbHNlOwotCi0gICAgICAgICAgICBvbkRyYWluVmlkZW9RdWV1ZSgpOwotCi0gICAgICAgICAgICBwb3N0RHJhaW5WaWRlb1F1ZXVlKCk7Ci0gICAgICAgICAgICBicmVhazsKLSAgICAgICAgfQotCi0gICAgICAgIGNhc2Uga1doYXRRdWV1ZUJ1ZmZlcjoKLSAgICAgICAgewotICAgICAgICAgICAgb25RdWV1ZUJ1ZmZlcihtc2cpOwotICAgICAgICAgICAgYnJlYWs7Ci0gICAgICAgIH0KLQotICAgICAgICBjYXNlIGtXaGF0UXVldWVFT1M6Ci0gICAgICAgIHsKLSAgICAgICAgICAgIG9uUXVldWVFT1MobXNnKTsKLSAgICAgICAgICAgIGJyZWFrOwotICAgICAgICB9Ci0KLSAgICAgICAgY2FzZSBrV2hhdEZsdXNoOgotICAgICAgICB7Ci0gICAgICAgICAgICBvbkZsdXNoKG1zZyk7Ci0gICAgICAgICAgICBicmVhazsKLSAgICAgICAgfQotCi0gICAgICAgIGNhc2Uga1doYXRBdWRpb1NpbmtDaGFuZ2VkOgotICAgICAgICB7Ci0gICAgICAgICAgICBvbkF1ZGlvU2lua0NoYW5nZWQoKTsKLSAgICAgICAgICAgIGJyZWFrOwotICAgICAgICB9Ci0KLSAgICAgICAgY2FzZSBrV2hhdFBhdXNlOgotICAgICAgICB7Ci0gICAgICAgICAgICBvblBhdXNlKCk7Ci0gICAgICAgICAgICBicmVhazsKLSAgICAgICAgfQotCi0gICAgICAgIGNhc2Uga1doYXRSZXN1bWU6Ci0gICAgICAgIHsKLSAgICAgICAgICAgIG9uUmVzdW1lKCk7Ci0gICAgICAgICAgICBicmVhazsKLSAgICAgICAgfQotCi0gICAgICAgIGRlZmF1bHQ6Ci0gICAgICAgICAgICBUUkVTUEFTUygpOwotICAgICAgICAgICAgYnJlYWs7Ci0gICAgfQotfQotCi12b2lkIE51UGxheWVyOjpSZW5kZXJlcjo6cG9zdERyYWluQXVkaW9RdWV1ZShpbnQ2NF90IGRlbGF5VXMpIHsKLSAgICBpZiAobURyYWluQXVkaW9RdWV1ZVBlbmRpbmcgfHwgbVN5bmNRdWV1ZXMgfHwgbVBhdXNlZCkgewotICAgICAgICByZXR1cm47Ci0gICAgfQotCi0gICAgaWYgKG1BdWRpb1F1ZXVlLmVtcHR5KCkpIHsKLSAgICAgICAgcmV0dXJuOwotICAgIH0KLQotICAgIG1EcmFpbkF1ZGlvUXVldWVQZW5kaW5nID0gdHJ1ZTsKLS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DS19FUShtQXVkaW9TaW5rLT5nZXRQb3NpdGlvbigmbnVtRnJhbWVzUGxheWVkKSwgKHN0YXR1c190KU9LKTsKLQotICAgICAgICAgICAgdWludDMyX3QgbnVtRnJhbWVzUGVuZGluZ1BsYXlvdXQgPQotICAgICAgICAgICAgICAgIG1OdW1GcmFtZXNXcml0dGVuIC0gbnVtRnJhbWVzUGxheWVkOwotCi0gICAgICAgICAgICBpbnQ2NF90IHJlYWxUaW1lT2Zmc2V0VXMgPQotICAgICAgICAgICAgICAgIChtQXVkaW9TaW5rLT5sYXRlbmN5KCkgLyAyICAvKiBYWFggKi8KLSAgICAgICAgICAgICAgICAgICAgKyBudW1GcmFtZXNQZW5kaW5nUGxheW91dAotICAgICAgICAgICAgICAgICAgICAgICAgKiBtQXVkaW9TaW5rLT5tc2Vjc1BlckZyYW1lKCkpICogMTAwMGxsOwotCi0gICAgICAgICAgICAvLyBBTE9HSSgicmVhbFRpbWVPZmZzZXRVcyA9ICVsbGQgdXMiLCByZWFsVGltZU9mZnNldFVzKTsKLQotICAgICAgICAgICAgbUFuY2hvclRpbWVSZWFsVXMgPQotICAgICAgICAgICAgICAgIEFMb29wZXI6OkdldE5vd1VzKCkgKyByZWFsVGltZU9mZnNldFVzOwotICAgICAgICB9Ci0KLSAgICAgICAgc2l6ZV90IGNvcHkgPSBlbnRyeS0+bUJ1ZmZlci0+c2l6ZSgpIC0gZW50cnktPm1PZmZzZXQ7Ci0gICAgICAgIGlmIChjb3B5ID4gbnVtQnl0ZXNBdmFpbGFibGVUb1dyaXRlKSB7Ci0gICAgICAgICAgICBjb3B5ID0gbnVtQnl0ZXNBdmFpbGFibGVUb1dyaXRlOwotICAgICAgICB9Ci0KLSAgICAgICAgQ0hFQ0tfRVEobUF1ZGlvU2luay0+d3JpdGUoCi0gICAgICAgICAgICAgICAgICAgIGVudHJ5LT5tQnVmZmVyLT5kYXRhKCkgKyBlbnRyeS0+bU9mZnNldCwgY29weSksCi0gICAgICAgICAgICAgICAg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KLSAgICAgICAgICAgICAgICBtRU9TID0gdHJ1ZTsKLSAgICAgICAgICAgICAgICByZXR1cm4gMDsKLSAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgY2FzZSBESVNDT05USU5VSVRZOgotICAgICAgICAgICAgewotICAgICAgICAgICAgICAgICpleHRyYSA9IGVudHJ5LT5tRXh0cmE7Ci0KLSAgICAgICAgICAgICAgICBtUXVldWUuZXJhc2UobVF1ZXVlLmJlZ2luKCkpOwotICAgICAgICAgICAgICAgIGVudHJ5ID0gTlVMTDsKLQotICAgICAgICAgICAgICAgIHJldHVybiBJTkZPX0RJU0NPTlRJTlVJVFk7Ci0gICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgIGRlZmF1bHQ6Ci0gICAgICAgICAgICAgICAgVFJFU1BBU1MoKTsKLSAgICAgICAgICAgICAgICBicmVhazsKLSAgICAgICAgfQotICAgIH0KLQotICAgIHNpemVfdCBjb3B5ID0gZW50cnktPm1TaXplOwotICAgIGlmIChjb3B5ID4gc2l6ZSkgewotICAgICAgICBjb3B5ID0gc2l6ZTsKLSAgICB9Ci0KLSAgICBtZW1jcHkoZGF0YSwKLSAgICAgICAgICAgKGNvbnN0IHVpbnQ4X3QgKiltQnVmZmVycy5lZGl0SXRlbUF0KGVudHJ5LT5tSW5kZXgpLT5wb2ludGVyKCkKLSAgICAgICAgICAgICsgZW50cnktPm1PZmZzZXQsCi0gICAgICAgICAgIGNvcHkpOwotCi0gICAgZW50cnktPm1PZmZzZXQgKz0gY29weTsKLSAgICBlbnRyeS0+bVNpemUgLT0gY29weTsKLQotICAgIGlmIChlbnRyeS0+bVNpemUgPT0gMCkgewotICAgICAgICBtU291cmNlLT5vbkJ1ZmZlckF2YWlsYWJsZShlbnRyeS0+bUluZGV4KTsKLSAgICAgICAgbVF1ZXVlLmVyYXNlKG1RdWV1ZS5iZWdpbigpKTsKLSAgICAgICAgZW50cnkgPSBOVUxMOwotICAgIH0KLQotICAgIHJldHVybiBjb3B5OwotfQotC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WFwcGluZy4gQXNzdW1lIHRoZSBmaXJzdCBwYWNrZXRzIGNvcnJlc3BvbmQKLSAgICAgICAgICAgICAgICAgICAgLy8gdG8gdGltZSAwLgotCi0gICAgICAgICAgICAgICAgICAgIEFMT0dWKCJUaGlzIGlzIGEgbGl2ZSBzdHJlYW0sIGFzc3VtaW5nIHRpbWUgPSAwIik7Ci0KLSAgICAgICAgICAgICAgICAgICAgaW5mby0+bVJUUFRpbWUgPSBydHBUaW1lOwotICAgICAgICAgICAgICAgICAgICBpbmZvLT5tTm9ybWFsUGxheXRpbWVVcyA9IDBsbDsKLSAgICAgICAgICAgICAgICAgICAgaW5mby0+bU5QVE1hcHBpbmdWYWxpZCA9IHRydWU7Ci0gICAgICAgICAgICAgICAgfQotCi0gICAgICAgICAgICAgICAgaW50NjRfdCBucHRVcyA9Ci0gICAgICAgICAgICAgICAgICAgICgoZG91YmxlKXJ0cFRpbWUgLSAoZG91YmxlKWluZm8tPm1SVFBUaW1lKQotICAgICAgICAgICAgICAgICAgICAgICAgLyBpbmZvLT5tVGltZVNjYWxlCi0gICAgICAgICAgICAgICAgICAgICAgICAqIDEwMDAwMDBsbAotICAgICAgICAgICAgICAgICAgICAgICAgKyBpbmZvLT5tTm9ybWFsUGxheXRpbWVVczsKLQotICAgICAgICAgICAgICAgIGFjY2Vzc1VuaXQtPm1ldGEoKS0+c2V0SW50NjQoInRpbWVVcyIsIG5wdFVzKTsKLQotICAgICAgICAgICAgICAgIHNvdXJjZS0+cXVldWVBY2Nlc3NVbml0KGFjY2Vzc1VuaXQpOwotICAgICAgICAgICAgfQotICAgICAgICAgICAgYnJlYWs7Ci0gICAgICAgIH0KLQotICAgICAgICBjYXNlIE15SGFuZGxlcjo6a1doYXRFT1M6Ci0gICAgICAgIHsKLSAgICAgICAgICAgIHNpemVfdCB0cmFja0luZGV4OwotICAgICAgICAgICAgQ0hFQ0sobXNnLT5maW5kU2l6ZSgidHJhY2tJbmRleCIsICZ0cmFja0luZGV4KSk7Ci0gICAgICAgICAgICBDSEVDS19MVCh0cmFja0luZGV4LCBtVHJhY2tzLnNpemUoKSk7Ci0KLSAgICAgICAgICAgIGludDMyX3QgZmluYWxSZXN1bHQ7Ci0gICAgICAgICAgICBDSEVDSyhtc2ctPmZpbmRJbnQzMigiZmluYWxSZXN1bHQiLCAmZmluYWxSZXN1bHQpKTsKLSAgICAgICAgICAgIENIRUNLX05FKGZpbmFsUmVzdWx0LCAoc3RhdHVzX3QpT0spOwotCi0gICAgICAgICAgICBUcmFja0luZm8gKmluZm8gPSAmbVRyYWNrcy5lZGl0SXRlbUF0KHRyYWNrSW5kZXgpOwotICAgICAgICAgICAgc3A8QW5vdGhlclBhY2tldFNvdXJjZT4gc291cmNlID0gaW5mby0+bVNvdXJjZTsKLSAgICAgICAgICAgIGlmIChzb3VyY2UgIT0gTlVMTCkgewotICAgICAgICAgICAgICAgIHNvdXJjZS0+c2lnbmFsRU9TKGZpbmFsUmVzdWx0KTsKLSAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgYnJlYWs7Ci0gICAgICAgIH0KLQotICAgICAgICBjYXNlIE15SGFuZGxlcjo6a1doYXRTZWVrRGlzY29udGludWl0eToKLSAgICAgICAgewotICAgICAgICAgICAgc2l6ZV90IHRyYWNrSW5kZXg7Ci0gICAgICAgICAgICBDSEVDSyhtc2ctPmZpbmRTaXplKCJ0cmFja0luZGV4IiwgJnRyYWNrSW5kZXgpKTsKLSAgICAgICAgICAgIENIRUNLX0xUKHRyYWNrSW5kZXgsIG1UcmFja3Muc2l6ZSgpKTsKLQotICAgICAgICAgICAgVHJhY2tJbmZvICppbmZvID0gJm1UcmFja3MuZWRpdEl0ZW1BdCh0cmFja0luZGV4KTsKLSAgICAgICAgICAgIHNwPEFub3RoZXJQYWNrZXRTb3VyY2U+IHNvdXJjZSA9IGluZm8tPm1Tb3VyY2U7Ci0gICAgICAgICAgICBpZiAoc291cmNlICE9IE5VTEwpIHsKLSAgICAgICAgICAgICAgICBzb3VyY2UtP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gICAgICAgICAgICAgJiYgZXh0cmEtPmZpbmRJbnQzMigKLSAgICAgICAgICAgICAgICAgICAgICAgIElTdHJlYW1MaXN0ZW5lcjo6a0tleURpc2NvbnRpbnVpdHlNYXNrLCAmbWFzaykpIHsKLSAgICAgICAgICAgICAgICBpZiAobWFzayA9PSAwKSB7Ci0gICAgICAgICAgICAgICAgICAgIEFMT0dFKCJDbGllbnQgc3BlY2lmaWVkIGFuIGlsbGVnYWwgZGlzY29udGludWl0eSB0eXBlLiIpOwotICAgICAgICAgICAgICAgICAgICByZXR1cm4gRVJST1JfVU5TVVBQT1JURUQ7Ci0gICAgICAgICAgICAgICAgfQotCi0gICAgICAgICAgICAgICAgdHlwZSA9IG1hc2s7Ci0gICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgIG1UU1BhcnNlci0+c2lnbmFsRGlzY29udGludWl0eSgKLSAgICAgICAgICAgICAgICAgICAgKEFUU1BhcnNlcjo6RGlzY29udGludWl0eVR5cGUpdHlwZSwgZXh0cmEpOwotICAgICAgICB9IGVsc2UgaWYgKG4gPCAwKSB7Ci0gICAgICAgICAgICBDSEVDS19FUShuLCAtRVdPVUxEQkxPQ0spOwotICAgICAgICAgICAgYnJlYWs7Ci0gICAgICAgIH0gZWxzZSB7Ci0gICAgICAgICAgICBpZiAoYnVmZmVyWzBdID09IDB4MDApIHsKLSAgICAgICAgICAgICAgICAvLyBYWFggbGVnYWN5Ci0gICAgICAgICAgICAgICAgbVRTUGFyc2VyLT5zaWduYWxEaXNjb250aW51aXR5KAotICAgICAgICAgICAgICAgICAgICAgICAgYnVmZmVyWzFdID09IDB4MDAKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICA/IEFUU1BhcnNlcjo6RElTQ09OVElOVUlUWV9TRUVLCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgOiBBVFNQYXJzZXI6OkRJU0NPTlRJTlVJVFlfRk9STUFUQ0hBTkdFLAotICAgICAgICAgICAgICAgICAgICAgICAgZXh0cmEpOwotICAgICAgICAgICAgfSBlbHNlIHsKLSAgICAgICAgICAgICAgICBzdGF0dXNfdCBlcnIgPSBtVFNQYXJzZXItPmZlZWRUU1BhY2tldChidWZmZXIsIHNpemVvZihidWZmZXIpKTsKLQotICAgICAgICAgICAgICAgIGlmIChlcnIgIT0gT0spIHsKLSAgICAgICAgICAgICAgICAgICAgQUxPR0UoIlRTIFBhcnNlciByZXR1cm5lZCBlcnJvciAlZCIsIGVycik7Ci0KLSAgICAgICAgICAgICAgICAgICAgbVRTUGFyc2VyLT5zaWduYWxFT1MoZXJyKTsKLSAgICAgICAgICAgICAgICAgICAgbUZpbmFsUmVzdWx0ID0gZXJyOwotICAgICAgICAgICAgICAgICAgICBicmVhazsKLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICB9Ci0gICAgICAgIH0KLSAgICB9Ci0KLSAgICByZXR1cm4gT0s7Ci19Ci0KLXNwPE1ldGFEYXRhPiBOdVBsYXllcjo6U3RyZWFtaW5nU291cmNlOjpnZXRGb3JtYXQoYm9vbCBhdWRpbykgewotICAgIEFUU1BhcnNlcjo6U291cmNlVHlwZSB0eXBlID0KLSAgICAgICAgYXVkaW8gPyBBVFNQYXJzZXI6OkFVRElPIDogQVRTUGFyc2VyOjpWSURFTzsKLQotICAgIHNwPEFub3RoZXJQYWNrZXRTb3VyY2U+IHNvdXJjZSA9Ci0gICAgICAgIHN0YXRpY19jYXN0PEFub3RoZXJQYWNrZXRTb3VyY2UgKj4obVRTUGFyc2VyLT5nZXRTb3VyY2UodHlwZSkuZ2V0KCkpOwotCi0gICAgaWYgKHNvdXJjZSA9PSBOVUxMKSB7Ci0gICAgICAgIHJldHVybiBOVUxMOwotICAgIH0KLQotICAgIHJldHVybiBzb3VyY2UtPmdldEZvcm1hdCgpOwotfQotCi1zdGF0dXNfdCBOdVBsYXllcjo6U3RyZWFtaW5nU291cmNlOjpkZXF1ZXVlQWNjZXNzVW5pdCgKLSAgICAgICAgYm9vbCBhdWRpbywgc3A8QUJ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bXhfbXNnLnUuZXZlbnRfZGF0YS5kYXRhMSk7Ci0gICAgICAgICAgICAgICAgbXNnLT5zZXRJbnQzMigiZGF0YTIiLCBvbXhfbXNnLnUuZXZlbnRfZGF0YS5kYXRhMik7Ci0gICAgICAgICAgICAgICAgYnJlYWs7Ci0gICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgIGNhc2Ugb214X21lc3NhZ2U6OkVNUFRZX0JVRkZFUl9ET05FOgotICAgICAgICAgICAgewotICAgICAgICAgICAgICAgIG1zZy0+c2V0UG9pbnRlcigiYnVmZmVyIiwgb214X21zZy51LmJ1ZmZlcl9kYXRhLmJ1ZmZlcik7Ci0gICAgICAgICAgICAgICAgYnJlYWs7Ci0gICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgIGNhc2Ugb214X21lc3NhZ2U6OkZJTExfQlVGRkVSX0RPTkU6Ci0gICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgbXNnLT5zZXRQb2ludGVyKAotICAgICAgICAgICAgICAgICAgICAgICAgImJ1ZmZlciIsIG9teF9tc2cudS5leHRlbmRlZF9idWZmZXJfZGF0YS5idWZmZXIpOwotICAgICAgICAgICAgICAgIG1zZy0+c2V0SW50MzIoCi0gICAgICAgICAgICAgICAgICAgICAgICAicmFuZ2Vfb2Zmc2V0IiwKLSAgICAgICAgICAgICAgICAgICAgICAgIG9teF9tc2cudS5leHRlbmRlZF9idWZmZXJfZGF0YS5yYW5nZV9vZmZzZXQpOwotICAgICAgICAgICAgICAgIG1zZy0+c2V0SW50MzIoCi0gICAgICAgICAgICAgICAgICAgICAgICAicmFuZ2VfbGVuZ3RoIiwKLSAgICAgICAgICAgICAgICAgICAgICAgIG9teF9tc2cudS5leHRlbmRlZF9idWZmZXJfZGF0YS5yYW5nZV9sZW5ndGgpOwotICAgICAgICAgICAgICAgIG1zZy0+c2V0SW50MzIoCi0gICAgICAgICAgICAgICAgICAgICAgICAiZmxhZ3MiLAotICAgICAgICAgICAgICAgICAgICAgICAgb214X21zZy51LmV4dGVuZGVkX2J1ZmZlcl9kYXRhLmZsYWdzKTsKLSAgICAgICAgICAgICAgICBtc2ctPnNldEludDY0KAotICAgICAgICAgICAgICAgICAgICAgICAgInRpbWVzdGFtcCIsCi0gICAgICAgICAgICAgICAgICAgICAgICBvbXhfbXNnLnUuZXh0ZW5kZWRfYnVmZmVyX2RhdGEudGltZXN0YW1wKTsKLSAgICAgICAgICAgICAgICBtc2ctPnNldFBvaW50ZXIoCi0gICAgICAgICAgICAgICAgICAgICAgICAicGxhdGZvcm1fcHJpdmF0ZSIsCi0gICAgICAgICAgICAgICAgICAgICAgICBvbXhfbXNnLnUuZXh0ZW5kZWRfYnVmZmVyX2RhdGEucGxhdGZvcm1fcHJpdmF0ZSk7Ci0gICAgICAgICAgICAgICAgbXNnLT5zZXRQb2ludGVyKAotICAgICAgICAgICAgICAgICAgICAgICAgImRhdGFfcHRyIiwKLSAgICAgICAgICAgICAgICAgICAgICAgIG9teF9tc2cudS5leHRlbmRlZF9idWZmZXJfZGF0YS5kYXRhX3B0cik7Ci0gICAgICAgICAgICAgICAgYnJlYWs7Ci0gICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgIGRlZmF1bHQ6Ci0gICAgICAgICAgICAgICAgVFJFU1BBU1MoKTsKLSAgICAgICAgICAgICAgICBicmVhazsKLSAgICAgICAgfQotCi0gICAgICAgIG1zZy0+cG9zdCgpOwotICAgIH0KLQotcHJvdGVjdGVkOgotICAgIHZpcnR1YWwgfkNvZGVjT2JzZXJ2ZXIoKSB7fQotCi1wcml2YXRlOgotICAgIHNwPEFNZXNzYWdlPiBtTm90aWZ5OwotCi0gICAgRElTQUxMT1dfRVZJTF9DT05TVFJVQ1RPUlMoQ29kZWNPYnNlcnZlcik7Ci19OwotCi0vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLwotCi1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IHNpemUgJWx1IG9uICVzIHBvcnQiLAotICAgICAgICAgICAgICAgICAgICBtQ29tcG9uZW50TmFtZS5jX3N0cigpLAotICAgICAgICAgICAgICAgICAgICBkZWYubkJ1ZmZlckNvdW50QWN0dWFsLCBkZWYubkJ1ZmZlclNpemUsCi0gICAgICAgICAgICAgICAgICAgIHBvcnRJbmRleCA9PSBrUG9ydEluZGV4SW5wdXQgPyAiaW5wdXQiIDogIm91dHB1dCIpOwotCi0gICAgICAgICAgICBzaXplX3QgdG90YWxTaXplID0gZGVmLm5CdWZmZXJDb3VudEFjdHVhbCAqIGRlZi5uQnVmZmVyU2l6ZTsKLSAgICAgICAgICAgIG1EZWFsZXJbcG9ydEluZGV4XSA9IG5ldyBNZW1vcnlEZWFsZXIodG90YWxTaXplLCAiQUNvZGVjIik7Ci0KLSAgICAgICAgICAgIGZvciAoT01YX1UzMiBpID0gMDsgaSA8IGRlZi5uQnVmZmVyQ291bnRBY3R1YWw7ICsraSkgewotICAgICAgICAgICAgICAgIHNwPElNZW1vcnk+IG1lbSA9IG1EZWFsZXJbcG9ydEluZGV4XS0+YWxsb2NhdGUoZGVmLm5CdWZmZXJTaXplKTsKLSAgICAgICAgICAgICAgICBDSEVDSyhtZW0uZ2V0KCkgIT0gTlVMTCk7Ci0KLSAgICAgICAgICAgICAgICBCdWZmZXJJbmZvIGluZm87Ci0gICAgICAgICAgICAgICAgaW5mby5tU3RhdHVzID0gQnVmZmVySW5mbzo6T1dORURfQllfVVM7Ci0KLSAgICAgICAgICAgICAgICB1aW50MzJfdCByZXF1aXJlc0FsbG9jYXRlQnVmZmVyQml0ID0KLSAgICAgICAgICAgICAgICAgICAgKHBvcnRJbmRleCA9PSBrUG9ydEluZGV4SW5wdXQpCi0gICAgICAgICAgICAgICAgICAgICAgICA/IE9NWENvZGVjOjprUmVxdWlyZXNBbGxvY2F0ZUJ1ZmZlck9uSW5wdXRQb3J0cwotICAgICAgICAgICAgICAgICAgICAgICAgOiBPTVhDb2RlYzo6a1JlcXVpcmVzQWxsb2NhdGVCdWZmZXJPbk91dHB1dFBvcnRzOwotCi0gICAgICAgICAgICAgICAgaWYgKHBvcnRJbmRleCA9PSBrUG9ydEluZGV4SW5wdXQgJiYgKG1GbGFncyAmIGtGbGFnSXNTZWN1cmUpKSB7Ci0gICAgICAgICAgICAgICAgICAgIG1lbS5jbGVhcigpOwotCi0gICAgICAgICAgICAgICAgICAgIHZvaWQgKnB0cjsKLSAgICAgICAgICAgICAgICAgICAgZXJyID0gbU9NWC0+YWxsb2NhdGVCdWZmZXIoCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgbU5vZGUsIHBvcnRJbmRleCwgZGVmLm5CdWZmZXJTaXplLCAmaW5mby5tQnVmZmVySUQsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgJnB0cik7Ci0KLSAgICAgICAgICAgICAgICAgICAgaW5mby5tRGF0YSA9IG5ldyBBQnVmZmVyKHB0ciwgZGVmLm5CdWZmZXJTaXplKTsKLSAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKG1RdWlya3MgJiByZXF1aXJlc0FsbG9jYXRlQnVmZmVyQml0KSB7Ci0gICAgICAgICAgICAgICAgICAgIGVyciA9IG1PTVgtPmFsbG9jYXRlQnVmZmVyV2l0aEJhY2t1cCgKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBtTm9kZSwgcG9ydEluZGV4LCBtZW0sICZpbmZvLm1CdWZmZXJJRCk7Ci0gICAgICAgICAgICAgICAgfSBlbHNlIHsKLSAgICAgICAgICAgICAgICAgICAgZXJyID0gbU9NWC0+dXNlQnVmZmVyKG1Ob2RlLCBwb3J0SW5kZXgsIG1lbSwgJmluZm8ubUJ1ZmZlcklEKTsKLSAgICAgICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgICAgICBpZiAobWVtICE9IE5VTEwpIHsKLSAgICAgICAgICAgICAgICAgICAgaW5mby5tRGF0YSA9IG5ldyBBQnVmZmVyKG1lbS0+cG9pbnRlcigpLCBk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NvZGVyLm1wMiIgfSwKLSAgICAgICAgeyBNRURJQV9NSU1FVFlQRV9BVURJT19BTVJfTkIsCi0gICAgICAgICAgICAiYXVkaW9fZGVjb2Rlci5hbXJuYiIsICJhdWRpb19lbmNvZGVyLmFtcm5iIiB9LAotICAgICAgICB7IE1FRElBX01JTUVUWVBFX0FVRElPX0FNUl9XQiwKLSAgICAgICAgICAgICJhdWRpb19kZWNvZGVyLmFtcndiIiwgImF1ZGlvX2VuY29kZXIuYW1yd2IiIH0sCi0gICAgICAgIHsgTUVESUFfTUlNRVRZUEVfQVVESU9fQUFDLAotICAgICAgICAgICAgImF1ZGlvX2RlY29kZXIuYWFjIiwgImF1ZGlvX2VuY29kZXIuYWFjIiB9LAotICAgICAgICB7IE1FRElBX01JTUVUWVBFX0FVRElPX1ZPUkJJUywKLSAgICAgICAgICAgICJhdWRpb19kZWNvZGVyLnZvcmJpcyIsICJhdWRpb19lbmNvZGVyLnZvcmJpcyIgfSwKLSAgICAgICAgeyBNRURJQV9NSU1FVFlQRV9BVURJT19HNzExX01MQVcsCi0gICAgICAgICAgICAiYXVkaW9fZGVjb2Rlci5nNzExbWxhdyIsICJhdWRpb19lbmNvZGVyLmc3MTFtbGF3IiB9LAotICAgICAgICB7IE1FRElBX01JTUVUWVBFX0FVRElPX0c3MTFfQUxBVywKLSAgICAgICAgICAgICJhdWRpb19kZWNvZGVyLmc3MTFhbGF3IiwgImF1ZGlvX2VuY29kZXIuZzcxMWFsYXciIH0sCi0gICAgICAgIHsgTUVESUFfTUlNRVRZUEVfVklERU9fQVZDLAotICAgICAgICAgICAgInZpZGVvX2RlY29kZXIuYXZjIiwgInZpZGVvX2VuY29kZXIuYXZjIiB9LAotICAgICAgICB7IE1FRElBX01JTUVUWVBFX1ZJREVPX01QRUc0LAotICAgICAgICAgICAgInZpZGVvX2RlY29kZXIubXBlZzQiLCAidmlkZW9fZW5jb2Rlci5tcGVnNCIgfSwKLSAgICAgICAgeyBNRURJQV9NSU1FVFlQRV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ICAgICAgcm9sZVBhcmFtcy5jUm9sZVtPTVhfTUFYX1NUUklOR05BTUVfU0laRSAtIDFdID0gJ1wwJzsKLQotICAgICAgICBzdGF0dXNfdCBlcnIgPSBtT01YLT5zZXRQYXJhbWV0ZXIoCi0gICAgICAgICAgICAgICAgbU5vZGUsIE9NWF9JbmRleFBhcmFtU3RhbmRhcmRDb21wb25lbnRSb2xlLAotICAgICAgICAgICAgICAgICZyb2xlUGFyYW1zLCBzaXplb2Yocm9sZVBhcmFtcykpOwotCi0gICAgICAgIGlmIChlcnIgIT0gT0spIHsKLSAgICAgICAgICAgIEFMT0dXKCJbJXNdIEZhaWxlZCB0byBzZXQgc3RhbmRhcmQgY29tcG9uZW50IHJvbGUgJyVzJy4iLAotICAgICAgICAgICAgICAgICBtQ29tcG9uZW50TmFtZS5jX3N0cigpLCByb2xlKTsKLQotICAgICAgICAgICAgcmV0dXJuIGVycjsKLSAgICAgICAgfQotICAgIH0KLQotICAgIHJldHVybiBPSzsKLX0KLQotc3RhdHVzX3QgQUNvZGVjOjpjb25maWd1cmVDb2RlYygKLSAgICAgICAgY29uc3QgY2hhciAqbWltZSwgY29uc3Qgc3A8QU1lc3NhZ2U+ICZtc2cpIHsKLSAgICBpbnQzMl90IGVuY29kZXI7Ci0gICAgaWYgKCFtc2ctPmZpbmRJbnQzMigiZW5jb2RlciIsICZlbmNvZGVyKSkgewotICAgICAgICBlbmNvZGVyID0gZmFsc2U7Ci0gICAgfQotCi0gICAgbUlzRW5jb2RlciA9IGVuY29kZXI7Ci0KLSAgICBzdGF0dXNfdCBlcnIgPSBzZXRDb21wb25lbnRSb2xlKGVuY29kZXIgLyogaXNFbmNvZGVyICovLCBtaW1lKTsKLQotICAgIGlmIChlcnIgIT0gT0spIHsKLSAgICAgICAgcmV0dXJuIGVycjsKLSAgICB9Ci0KLSAgICBpbnQzMl90IGJpdFJhdGUgPSAwOwotICAgIGlmIChlbmNvZGVyICYmICFtc2ctPmZpbmRJbnQzMigiYml0cmF0ZSIsICZiaXRSYXRlKSkgewotICAgICAgICByZXR1cm4gSU5WQUxJRF9PUEVSQVRJT047Ci0gICAgfQotCi0gICAgaWYgKCFzdHJuY2FzZWNtcChtaW1lLCAidmlkZW8vIiwgNikpIHsKLSAgICAgICAgaWYgKGVuY29kZXIpIHsKLSAgICAgICAgICAgIGVyciA9IHNldHVwVmlkZW9FbmNvZGVyKG1pbWUsIG1zZyk7Ci0gICAgICAgIH0gZWxzZSB7Ci0gICAgICAgICAgICBpbnQzMl90IHdpZHRoLCBoZWlnaHQ7Ci0gICAgICAgICAgICBpZiAoIW1zZy0+ZmluZEludDMyKCJ3aWR0aCIsICZ3aWR0aCkKLSAgICAgICAgICAgICAgICAgICAgfHwgIW1zZy0+ZmluZEludDMyKCJoZWlnaHQiLCAmaGVpZ2h0KSkgewotICAgICAgICAgICAgICAgIGVyciA9IElOVkFMSURfT1BFUkFUSU9OOwotICAgICAgICAgICAgfSBlbHNlIHsKLSAgICAgICAgICAgICAgICBlcnIgPSBzZXR1cFZpZGVvRGVjb2RlcihtaW1lLCB3aWR0aCwgaGVpZ2h0KTsKLSAgICAgICAgICAgIH0KLSAgICAgICAgfQotICAgIH0gZWxzZSBpZiAoIXN0cmNhc2VjbXAobWltZSwgTUVESUFfTUlNRVRZUEVfQVVESU9fQUFDKSkgewotICAgICAgICBpbnQzMl90IG51bUNoYW5uZWxzLCBzYW1wbGVSYXRlOwotICAgICAgICBpZiAoIW1zZy0+ZmluZEludDMyKCJjaGFubmVsLWNvdW50IiwgJm51bUNoYW5uZWxzKQotICAgICAgICAgICAgICAgIHx8ICFtc2ctPmZpbmRJbnQzMigic2FtcGxlLXJhdGUiLCAmc2FtcGxlUmF0ZSkpIHsKLSAgICAgICAgICAgIGVyciA9IElOVkFMSURfT1BFUkFUSU9OOwotICAgICAgICB9IGVsc2UgewotICAgICAgICAgICAgaW50MzJfdCBpc0FEVFM7Ci0gICAgICAgICAgICBpZiAoIW1zZy0+ZmluZEludDMyKCJpcy1hZHRzIiwgJmlzQURUUykpIHsKLSAgICAgICAgICAgICAgICBpc0FEVFMgPSAwOwotICAgICAgICAgICAgfQotCi0gICAgICAgICAgICBlcnIgPSBzZXR1cEFBQ0NvZGVjKAotICAgICAgICAgICAgICAgICAgICBlbmNvZGVyLCBudW1DaGFubmVscywgc2FtcGxlUmF0ZSwgYml0UmF0ZSwgaXNBRFRTICE9IDApOwotICAgICAgICB9Ci0gICAgfSBlbHNlIGlmICghc3RyY2FzZWNtcChtaW1lLCBNRURJQV9NSU1FVFlQRV9BVURJT19BTVJfTkIpKSB7Ci0gICAgICAgIGVyciA9IHNldHVwQU1SQ29kZWMoZW5jb2RlciwgZmFsc2UgLyogaXNXQU1SICovLCBiaXRSYXRlKTsKLSAgICB9IGVsc2UgaWYgKCFzdHJjYXNlY21wKG1pbWUsIE1FRElBX01JTUVUWVBFX0FVRElPX0FNUl9XQikpIHsKLSAgICAgICAgZXJyID0gc2V0dXBBTVJDb2RlYyhlbmNvZGVyLCB0cnVlIC8qIGlzV0FNUiAqLywgYml0UmF0ZSk7Ci0gICAgfSBlbHNlIGlmICghc3RyY2FzZWNtcChtaW1lLCBNRURJQV9NSU1FVFlQRV9BVURJT19HNzExX0FMQVcpCi0gICAgICAgICAgICB8fCAhc3RyY2FzZWNtcChtaW1lLCBNRURJQV9NSU1FVFlQRV9BVURJT19HNzExX01MQVcpKSB7Ci0gICAgICAgIC8vIFRoZXNlIGFyZSBQQ00tbGlrZSBmb3JtYXRzIHdpdGggYSBmaXhlZCBzYW1wbGUgcmF0ZSBidXQKLSAgICAgICAgLy8gYSB2YXJpYWJsZSBudW1iZXIgb2YgY2hhbm5lbHMuCi0KLSAgICAgICAgaW50MzJfdCBudW1DaGFubmVsczsKLSAgICAgICAgaWYgKCFtc2ctPmZpbmRJbnQzMigiY2hhbm5lbC1jb3VudCIsICZudW1DaGFubmVscykpIHsKLSAgICAgICAgICAgIGVyciA9IElOVkFMSURfT1BFUkFUSU9OOwotICAgICAgICB9IG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IE9NWF9QQVJBTV9QT1JUREVGSU5JVElPTlRZUEUgZGVmOwotICAgICAgICBJbml0T01YUGFyYW1zKCZkZWYpOwotICAgICAgICBkZWYublBvcnRJbmRleCA9IGtQb3J0SW5kZXhPdXRwdXQ7Ci0KLSAgICAgICAgZXJyID0gbU9NWC0+Z2V0UGFyYW1ldGVyKAotICAgICAgICAgICAgICAgIG1Ob2RlLCBPTVhfSW5kZXhQYXJhbVBvcnREZWZpbml0aW9uLCAmZGVmLCBzaXplb2YoZGVmKSk7Ci0KLSAgICAgICAgaWYgKGVyciAhPSBPSykgewotICAgICAgICAgICAgcmV0dXJuIGVycjsKLSAgICAgICAgfQotCi0gICAgICAgIGRlZi5mb3JtYXQuYXVkaW8uYkZsYWdFcnJvckNvbmNlYWxtZW50ID0gT01YX1RSVUU7Ci0gICAgICAgIGRlZi5mb3JtYXQuYXVkaW8uZUVuY29kaW5nID0gT01YX0FVRElPX0NvZGluZ0FBQzsKLQotICAgICAgICBlcnIgPSBtT01YLT5zZXRQYXJhbWV0ZXIoCi0gICAgICAgICAgICAgICAgbU5vZGUsIE9NWF9JbmRleFBhcmFtUG9ydERlZmluaXRpb24sICZkZWYsIHNpemVvZihkZWYpKTsKLQotICAgICAgICBpZiAoZXJyICE9IE9LKSB7Ci0gICAgICAgICAgICByZXR1cm4gZXJyOwotICAgICAgICB9Ci0KLSAgICAgICAgT01YX0FVRElPX1BBUkFNX0FBQ1BST0ZJTEVUWVBFIHByb2ZpbGU7Ci0gICAgICAgIEluaXRPTVhQYXJhbXMoJnByb2ZpbGUpOwotICAgICAgICBwcm9maWxlLm5Qb3J0SW5kZXggPSBrUG9ydEluZGV4T3V0cHV0OwotCi0gICAgICAgIGVyciA9IG1PTVgtPmdldFBhcmFtZXRlcigKLSAgICAgICAgICAgICAgICBtTm9kZSwgT01YX0luZGV4UGFyYW1BdWRpb0FhYywgJnByb2ZpbGUsIHNpemVvZihwcm9maWxlKSk7Ci0KLSAgICAgICAgaWYgKGVyciAh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SAwOwotICAgIGZvciAoOzspIHsKLSAgICAgICAgZm9ybWF0Lm5JbmRleCA9IGluZGV4OwotICAgICAgICBzdGF0dXNfdCBlcnIgPSBtT01YLT5nZXRQYXJhbWV0ZXIoCi0gICAgICAgICAgICAgICAgbU5vZGUsIE9NWF9JbmRleFBhcmFtVmlkZW9Qb3J0Rm9ybWF0LAotICAgICAgICAgICAgICAgICZmb3JtYXQsIHNpemVvZihmb3JtYXQpKTsKLQotICAgICAgICBpZiAoZXJyICE9IE9LKSB7Ci0gICAgICAgICAgICByZXR1cm4gZXJyOwotICAgICAgICB9Ci0KLSAgICAgICAgLy8gVGhlIGZvbGxvd2luZyBhc3NlcnRpb24gaXMgdmlvbGF0ZWQgYnkgVEkncyB2aWRlbyBkZWNvZGVyLgotICAgICAgICAvLyBDSEVDS19FUShmb3JtYXQubkluZGV4LCBpbmRleCk7Ci0KLSAgICAgICAgaWYgKCFzdHJjbXAoIk9NWC5USS5WaWRlby5lbmNvZGVyIiwgbUNvbXBvbmVudE5hbWUuY19zdHIoKSkpIHsKLSAgICAgICAgICAgIGlmIChwb3J0SW5kZXggPT0ga1BvcnRJbmRleElucHV0Ci0gICAgICAgICAgICAgICAgICAgICYmIGNvbG9yRm9ybWF0ID09IGZvcm1hdC5lQ29sb3JGb3JtYXQpIHsKLSAgICAgICAgICAgICAgICAvLyBlQ29tcHJlc3Npb25Gb3JtYXQgZG9lcyBub3Qgc2VlbSByaWdodC4KLSAgICAgICAgICAgICAgICBmb3VuZCA9IHRydWU7Ci0gICAgICAgICAgICAgICAgYnJlYWs7Ci0gICAgICAgICAgICB9Ci0gICAgICAgICAgICBpZiAocG9ydEluZGV4ID09IGtQb3J0SW5kZXhPdXRwdXQKLSAgICAgICAgICAgICAgICAgICAgJiYgY29tcHJlc3Npb25Gb3JtYXQgPT0gZm9ybWF0LmVDb21wcmVzc2lvbkZvcm1hdCkgewotICAgICAgICAgICAgICAgIC8vIGVDb2xvckZvcm1hdCBkb2VzIG5vdCBz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bm90aWZ5LT5zZXRJbnQzMigid2lkdGgiLCB2aWRlb0RlZi0+bkZyYW1lV2lkdGgpOwotICAgICAgICAgICAgbm90aWZ5LT5zZXRJbnQzMigiaGVpZ2h0IiwgdmlkZW9EZWYtPm5GcmFtZUhlaWdodCk7Ci0gICAgICAgICAgICBub3RpZnktPnNldEludDMyKCJzdHJpZGUiLCB2aWRlb0RlZi0+blN0cmlkZSk7Ci0gICAgICAgICAgICBub3RpZnktPnNldEludDMyKCJzbGljZS1oZWlnaHQiLCB2aWRlb0RlZi0+blNsaWNlSGVpZ2h0KTsKLSAgICAgICAgICAgIG5vdGlmeS0+c2V0SW50MzIoImNvbG9yLWZvcm1hdCIsIHZpZGVvRGVmLT5lQ29sb3JGb3JtYXQpOwotCi0gICAgICAgICAgICBPTVhfQ09ORklHX1JFQ1RUWVBFIHJlY3Q7Ci0gICAgICAgICAgICBJbml0T01YUGFyYW1zKCZyZWN0KTsKLSAgICAgICAgICAgIHJlY3QublBvcnRJbmRleCA9IGtQb3J0SW5kZXhPdXRwdXQ7Ci0KLSAgICAgICAgICAgIGlmIChtT01YLT5nZXRDb25maWcoCi0gICAgICAgICAgICAgICAgICAgICAgICBtTm9kZSwgT01YX0luZGV4Q29uZmlnQ29tbW9uT3V0cHV0Q3JvcCwKLSAgICAgICAgICAgICAgICAgICAgICAgICZyZWN0LCBzaXplb2YocmVjdCkpICE9IE9LKSB7Ci0gICAgICAgICAgICAgICAgcmVjdC5uTGVmdCA9IDA7Ci0gICAgICAgICAgICAgICAgcmVjdC5uVG9wID0gMDsKLSAgICAgICAgICAgICAgICByZWN0Lm5XaWR0aCA9IHZpZGVvRGVmLT5uRnJhbWVXaWR0aDsKLSAgICAgICAgICAgICAgICByZWN0Lm5IZWlnaHQgPSB2aWRlb0RlZi0+bkZyYW1lSGVpZ2h0OwotICAgICAgICAgICAgfQotCi0gICAgICAgICAgICBDSEVDS19HRShyZWN0Lm5MZWZ0LCAwKTsKLSAgICAgICAgICAgIENIRUNLX0dFKHJlY3QublRvcCwgMCk7Ci0gICAgICAgICAgICBDSEVDS19HRShyZWN0Lm5XaWR0aCwgMHUpOwotICAgICAgICAgICAgQ0hFQ0tfR0UocmVjdC5uSGVpZ2h0LCAwdSk7Ci0gICAgICAgICAgICBDSEVDS19MRShyZWN0Lm5MZWZ0ICsgcmVjdC5uV2lkdGggLSAxLCB2aWRlb0RlZi0+bkZyYW1lV2lkdGgpOwotICAgICAgICAgICAgQ0hFQ0tfTEUocmVjdC5uVG9wICsgcmVjdC5uSGVpZ2h0IC0gMSwgdmlkZW9EZWYtPm5GcmFtZUhlaWdodCk7Ci0KLSAgICAgICAgICAgIG5vdGlmeS0+c2V0UmVjdCgKLSAgICAgICAgICAgICAgICAgICAgImNyb3AiLAotICAgICAgICAgICAgICAgICAgICByZWN0Lm5MZWZ0LAotICAgICAgICAgICAgICAgICAgICByZWN0Lm5Ub3AsCi0gICAgICAgICAgICAgICAgICAgIHJlY3QubkxlZnQgKyByZWN0Lm5XaWR0aCAtIDEsCi0gICAgICAgICAgICAgICAgICAgIHJlY3QublRvcCArIHJlY3QubkhlaWdodCAtIDEpOwotCi0gICAgICAgICAgICBpZiAobU5hdGl2ZVdpbmRvdyAhPSBOVUxMKSB7Ci0gICAgICAgICAgICAgICAgYW5kcm9pZF9uYXRpdmVfcmVjdF90IGNyb3A7Ci0gICAgICAgICAgICAgICAgY3JvcC5sZWZ0ID0gcmVjdC5uTGVmdDsKLSAgICAgICAgICAgICAgICBjcm9wLnRvcCA9IHJlY3QublRvcDsKLSAgICAgICAgICAgICAgICBjcm9wLnJpZ2h0ID0gcmVjdC5uTGVmdCArIHJlY3QubldpZHRoOwotICAgICAgICAgICAgICAgIGNyb3AuYm90dG9tID0gcmVjdC5uVG9wICsgcmVjdC5uSGVpZ2h0OwotCi0gICAgICAgICAgICAgICAgQ0hFQ0tfRVEoMCwgbmF0aXZlX3dpbmRvd19zZXRfY3JvcCgKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBtTmF0aXZlV2luZG93LmdldCgpLCAmY3JvcCkpOwotICAgICAgICAgICAgfQotICAgICAgICAgICAgYnJlYWs7Ci0gICAgICAgIH0KLQotICAgICAgICBjYXNlIE9NWF9Qb3J0RG9tYWluQXVkaW86Ci0gICAgICAgIHsKLSAgICAgICAgICAgIE9NWF9BVURJT19QT1JUREVGSU5JVElPTlRZUEUgKmF1ZGlvRGVmID0gJmRlZi5mb3JtYXQuYXVkaW87Ci0gICAgICAgICAgICBDSEVDS19FUSgoaW50KWF1ZGlvRGVmLT5lRW5jb2RpbmcsIChpbnQpT01YX0FVRElPX0NvZGluZ1BDTSk7Ci0KLSAgICAgICAgICAgIE9NWF9BVURJT19QQVJBTV9QQ01NT0RFVFlQRSBwYXJhbXM7Ci0gICAgICAgICAgICBJbml0T01YUGFyYW1zKCZwYXJhbXMpOwotICAgICAgICAgICAgcGFyYW1zLm5Qb3J0SW5kZXggPSBrUG9ydEluZGV4T3V0cHV0OwotCi0gICAgICAgICAgICBDSEVDS19FUShtT01YLT5nZXRQYXJhbWV0ZXIoCi0gICAgICAgICAgICAgICAgICAgICAgICBtTm9kZSwgT01YX0luZGV4UGFyYW1BdWRpb1BjbSwKLSAgICAgICAgICAgICAgICAgICAgICAgICZwYXJhbXMsIHNpemVvZihwYXJhbXMpKSwKLSAgICAgICAgICAgICAgICAgICAgIChzdGF0dXNfdClPSyk7Ci0KLSAgICAgICAgICAgIENIRUNLKHBhcmFtcy5uQ2hhbm5lbHMgPT0gMSB8fCBwYXJhbXMuYkludGVybGVhdmVkKTsKLSAgICAgICAgICAgIENIRUNLX0VRKHBhcmFtcy5uQml0UGVyU2FtcGxlLCAxNnUpOwotICAgICAgICAgICAgQ0hFQ0tfRVEoKGludClwYXJhbXMuZU51bURhdGEsIChpbnQpT01YX051bWVyaWNhbERhdGFTaWduZWQpOwotICAgICAgICAgICAgQ0hFQ0tfRVEoKGludClwYXJhbXMuZVBDTU1vZGUsIChpbnQpT01YX0FVRElPX1BDTU1vZ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obXNnLT5maW5kUG9pbnRlcigibm9kZSIsICZub2RlSUQpKTsKLSAgICBDSEVDS19FUShub2RlSUQsIG1Db2RlYy0+bU5vZGUpOwotCi0gICAgc3dpdGNoICh0eXBlKSB7Ci0gICAgICAgIGNhc2Ugb214X21lc3NhZ2U6OkVWRU5UOgotICAgICAgICB7Ci0gICAgICAgICAgICBpbnQzMl90IGV2ZW50LCBkYXRhMSwgZGF0YTI7Ci0gICAgICAgICAgICBDSEVDSyhtc2ctPmZpbmRJbnQzMigiZXZlbnQiLCAmZXZlbnQpKTsKLSAgICAgICAgICAgIENIRUNLKG1zZy0+ZmluZEludDMyKCJkYXRhMSIsICZkYXRhMSkpOwotICAgICAgICAgICAgQ0hFQ0sobXNnLT5maW5kSW50MzIoImRhdGEyIiwgJmRhdGEyKSk7Ci0KLSAgICAgICAgICAgIGlmIChldmVudCA9PSBPTVhfRXZlbnRDbWRDb21wbGV0ZQotICAgICAgICAgICAgICAgICAgICAmJiBkYXRhMSA9PSBPTVhfQ29tbWFuZEZsdXNoCi0gICAgICAgICAgICAgICAgICAgICYmIGRhdGEyID09IChpbnQzMl90KU9NWF9BTEwpIHsKLSAgICAgICAgICAgICAgICAvLyBVc2Ugb2YgdGhpcyBub3RpZmljYXRpb24gaXMgbm90IGNvbnNpc3RlbnQgYWNyb3NzCi0gICAgICAgICAgICAgICAgLy8gaW1wbGVtZW50YXRpb25zLiBXZSdsbCBkcm9wIHRoaXMgbm90aWZpY2F0aW9uIGFuZCByZWx5Ci0gICAgICAgICAgICAgICAgLy8gb24gZmx1c2gtY29tcGxldGUgbm90aWZpY2F0aW9ucyBvbiB0aGUgaW5kaXZpZHVhbCBwb3J0Ci0gICAgICAgICAgICAgICAgLy8gaW5kaWNlcyBpbnN0ZWFkLgotCi0gICAgICAgICAgICAgICAgcmV0dXJuIHRydWU7Ci0gICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgIHJldHVybiBvbk9NWEV2ZW50KAotICAgICAgICAgICAgICAgICAgIC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ZEludDMyKCJmbGFncyIsICZmbGFncykpOwotICAgICAgICAgICAgQ0hFQ0sobXNnLT5maW5kSW50NjQoInRpbWVzdGFtcCIsICZ0aW1lVXMpKTsKLSAgICAgICAgICAgIENIRUNLKG1zZy0+ZmluZFBvaW50ZXIoInBsYXRmb3JtX3ByaXZhdGUiLCAmcGxhdGZvcm1Qcml2YXRlKSk7Ci0gICAgICAgICAgICBDSEVDSyhtc2ctPmZpbmRQb2ludGVyKCJkYXRhX3B0ciIsICZkYXRhUHRyKSk7Ci0KLSAgICAgICAgICAgIHJldHVybiBvbk9NWEZpbGxCdWZmZXJEb25lKAotICAgICAgICAgICAgICAgICAgICBidWZmZXJJRCwKLSAgICAgICAgICAgICAgICAgICAgKHNpemVfdClyYW5nZU9mZnNldCwgKHNpemVfdClyYW5nZUxlbmd0aCwKLSAgICAgICAgICAgICAgICAgICAgKE9NWF9VMzIpZmxhZ3MsCi0gICAgICAgICAgICAgICAgICAgIHRpbWVVcywKLSAgICAgICAgICAgICAgICAgICAgcGxhdGZvcm1Qcml2YXRlLAotICAgICAgICAgICAgICAgICAgICBkYXRhUHRyKTsKLSAgICAgICAgfQotCi0gICAgICAgIGRlZmF1bHQ6Ci0gICAgICAgICAgICBUUkVTUEFTUygpOwotICAgICAgICAgICAgYnJlYWs7Ci0gICAgfQotfQotCi1ib29sIEFDb2RlYzo6QmFzZVN0YXRlOjpvbk9NWEV2ZW50KAotICAgICAgICBPTVhfRVZFTlRUWVBFIGV2ZW50LCBPTVhfVTMyIGRhdGExLCBPTVhfVTMyIGRhdGEyKSB7Ci0gICAgaWYgKGV2ZW50ICE9IE9NWF9FdmVudEVycm9yKSB7Ci0gICAgICAgIEFMT0dWKCJbJXNdIEVWRU5UKCVkLCAweCUwOGx4LCAweCUwOGx4KSIsCi0gICAgICAgICAgICAgbUNvZGVjLT5tQ29tcG9uZW50TmFtZS5jX3N0cigpLCBldmVudCwgZGF0YTEsIGRhdGEyKTsKLQotICAgICAgICByZXR1cm4gZ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IHsKLSAgICAgICAgICAgICAgICAgICAgZmxhZ3MgfD0gT01YX0JVRkZFUkZMQUdfQ09ERUNDT05GSUc7Ci0gICAgICAgICAgICAgICAgfQotCi0gICAgICAgICAgICAgICAgaWYgKGVvcykgewotICAgICAgICAgICAgICAgICAgICBmbGFncyB8PSBPTVhfQlVGRkVSRkxBR19FT1M7Ci0gICAgICAgICAgICAgICAgfQotCi0gICAgICAgICAgICAgICAgaWYgKGJ1ZmZlciAhPSBpbmZvLT5tRGF0YSkgewotICAgICAgICAgICAgICAgICAgICBpZiAoMCAmJiAhKGZsYWdzICYgT01YX0JVRkZFUkZMQUdfQ09ERUNDT05GSUcpKSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICBBTE9HVigiWyVzXSBOZWVkcyB0byBjb3B5IGlucHV0IGRhdGEuIiwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbUNvZGVjLT5tQ29tcG9uZW50TmFtZS5jX3N0cigpKTsKLSAgICAgICAgICAgICAgICAgICAgfQotCi0gICAgICAgICAgICAgICAgICAgIENIRUNLX0xFKGJ1ZmZlci0+c2l6ZSgpLCBpbmZvLT5tRGF0YS0+Y2FwYWNpdHkoKSk7Ci0gICAgICAgICAgICAgICAgICAgIG1lbWNweShpbmZvLT5tRGF0YS0+ZGF0YSgpLCBidWZmZXItPmRhdGEoKSwgYnVmZmVyLT5zaXplKCkpOwotICAgICAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgICAgIGlmIChmbGFncyAmIE9NWF9CVUZGRVJGTEFHX0NPREVDQ09ORklHKSB7Ci0gICAgICAgICAgICAgICAgICAgIEFMT0dWKCJbJXNdIGNhbGxpbmcgZW1wdHlCdWZmZXIgJXAgdy8gY29kZWMgc3BlY2lmaWMgZGF0YSIsCi0gICAgICAgICAgICAgICAgICAgICAgICAgbUNvZGVjLT5tQ29tcG9uZW50TmFtZS5jX3N0cigpLCBidWZmZXJJRCk7Ci0gICAgICAgICAgICAgICAgfSBlbHNlIGlmIChmbGFncyAmIE9NWF9CVUZGRVJGTEFHX0VPUykgewotICAgICAgICAgICAgICAgICAgICBBTE9HVigiWyVzXSBjYWxsaW5nIGVtcHR5QnVmZmVyICVwIHcvIEVPUyIsCi0gICAgICAgICAgICAgICAgICAgICAgICAgbUNvZGVjLT5tQ29tcG9uZW50TmFtZS5jX3N0cigpLCBidWZmZXJJRCk7Ci0gICAgICAgICAgICAgICAgfSBlbHNlIHsKLSAgICAgICAgICAgICAgICAgICAgQUxPR1YoIlslc10gY2FsbGluZyBlbXB0eUJ1ZmZlciAlcCB3LyB0aW1lICVsbGQgdXMiLAotICAgICAgICAgICAgICAgICAgICAgICAgIG1Db2RlYy0+bUNvbXBvbmVudE5hbWUuY19zdHIoKSwgYnVmZmVySUQsIHRpbWVVcyk7Ci0gICAgICAgICAgICAgICAgfQotCi0gICAgICAgICAgICAgICAgQ0hFQ0tfRVEobUNvZGVjLT5tT01YLT5lbXB0eUJ1ZmZlcigKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBtQ29kZWMtPm1Ob2RlLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJ1ZmZlcklELAotICAgICAgICAgICAgICAgICAgICAgICAgICAgIDAsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgYnVmZmVyLT5zaXplKCksCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgZmxhZ3MsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgdGltZVVzKSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAoc3RhdHVzX3QpT0spOwotCi0gICAgICAgICAgICAgICAgaW5mby0+bVN0YXR1cyA9IEJ1ZmZlckluZm86Ok9XTkVEX0JZX0NPTVBPTkVOVDsKLQotICAgICAgICAgICAgICAgIGlmICghZW9zKSB7Ci0gICAgICAgICAgICAgICAgICAgIGdldE1vcmVJbnB1dERhdGFJZlBvc3NpYmxlKCk7Ci0gICAgICAgICAgICAgICAgfSBlbHNlIHsKLSAgICAgICAgICAgICAgICAgICAgQUxPR1YoIlslc10gU2lnbmFsbGVkIEVPUyBvbiB0aGUgaW5wdXQgcG9ydCIsCi0gICAgICAgICAgICAgICAgICAgICAgICAgbUNvZGVjLT5tQ29tcG9uZW50TmFtZS5jX3N0cigpKTsKLQotICAgICAgICAgICAgICAgICAgICBtQ29kZWMtPm1Qb3J0RU9TW2tQb3J0SW5kZXhJbnB1dF0gPSB0cnVlOwotICAgICAgICAgICAgICAgICAgICBtQ29kZWMtPm1JbnB1dEVPU1Jlc3VsdCA9IGVycjsKLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICB9IGVsc2UgaWYgKCFtQ29kZWMtPm1Qb3J0RU9TW2tQb3J0SW5kZXhJbnB1dF0pIHsKLSAgICAgICAgICAgICAgICBpZiAoZXJyICE9IEVSUk9SX0VORF9PRl9TVFJFQU0pIHsKLSAgICAgICAgICAgICAgICAgICAgQUxPR1YoIlslc10gU2lnbmFsbGluZyBFT1Mgb24gdGhlIGlucHV0IHBvcnQgIgotICAgICAgICAgICAgICAgICAgICAgICAgICJkdWUgdG8gZXJyb3IgJWQiLAotICAgICAgICAgICAgICAgICAgICAgICAgIG1Db2RlYy0+bUNvbXBvbmVudE5hbWUuY19zdHIoKSwgZXJyKTsKLSAgICAgICAgICAgICAgICB9IGVsc2UgewotICAgICAgICAgICAgICAgICAgICBBTE9HVigiWyVzXSBTaWduYWxsaW5nIEVPUyBvbiB0aGUgaW5wdXQgcG9ydCIsCi0gICAgICAgICAgICAgICAgICAgICAgICAgbUNvZGVjLT5tQ29tcG9uZW50TmFtZS5jX3N0cigpKTsKLSAgICAgICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgICAgICBBTE9HVigiWyVzXSBjYWxsaW5nIGVtcHR5QnVmZmVyICVwIHNpZ25hbGxpbmcgRU9TIiwKLSAgICAgICAgICAgICAgICAgICAgIG1Db2RlYy0+bUNvbXBvbmVudE5hbWUuY19zdHIoKSwgYnVmZmVySUQpOwotCi0gICAgICAgICAgICAgICAgQ0hFQ0tfRVEobUNvZGVjLT5tT01YLT5lbXB0eUJ1ZmZlcigKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBtQ29kZWMtPm1Ob2RlLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJ1ZmZlcklELAotICAgICAgICAgICAgICAgICAgICAgICAgICAgIDAsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgMCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBPTVhfQlVGRkVSRkxBR19FT1MsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgMCksCi0gICAgICAgICAgICAgICAgICAgICAgICAgKHN0YXR1c190KU9LKTsKLQotICAgICAgICAgICAgICAgIGluZm8tPm1TdGF0dXMgPSBCdWZmZXJJbmZvOjpPV05FRF9CWV9DT01QT05FTlQ7Ci0KLSAgICAgICAgICAgICAgICBtQ29kZWMtPm1Qb3J0RU9TW2tQb3J0SW5kZXhJbnB1dF0gPSB0cnVlOwotICAgICAgICAgICAgICAgIG1Db2RlYy0+bUlucHV0RU9TUmVzdWx0ID0gZXJyOwotICAgICAgICAgICAgfQotICAgICAgICAgICAgYnJlYWs7Ci0KLSAgICAgICAgICAgIGRlZmF1bHQ6Ci0gICAgICAgICAgICAgICAgQ0hFQ0tfRVEoKGludCltb2RlLCAoaW50KUZSRUVfQlVGRkVSUyk7Ci0gICAgICAgICAgICAgICAgYnJlYWs7Ci0gICAgICAgIH0KLSAgICB9Ci19Ci0KLXZvaWQgQUNvZGVjOjpCYXNlU3RhdGU6OmdldE1vcmVJbnB1dERhdGFJZlBvc3NpYmxlKCkgewotICAgIGlmIChtQ29kZWMtPm1Qb3J0RU9TW2tQb3J0SW5kZXhJbnB1dF0pIHsKLSAgICAgICAgcmV0dXJuOwotICAgIH0KLQotICAgIEJ1ZmZlckluZm8gKmVsaWdpYmxlID0gTlVMTDsKLQotICAgIGZvciAoc2l6ZV90IGkgPSAwOyBpIDwgbUNvZGVjLT5tQnVmZmVyc1trUG9ydEluZGV4S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WdzKTsKLQotICAgIHNzaXplX3QgaW5kZXg7Ci0gICAgQnVmZmVySW5mbyAqaW5mbyA9Ci0gICAgICAgIG1Db2RlYy0+ZmluZEJ1ZmZlckJ5SUQoa1BvcnRJbmRleE91dHB1dCwgYnVmZmVySUQsICZpbmRleCk7Ci0KLSAgICBDSEVDS19FUSgoaW50KWluZm8tPm1TdGF0dXMsIChpbnQpQnVmZmVySW5mbzo6T1dORURfQllfQ09NUE9ORU5UKTsKLQotICAgIGluZm8tPm1TdGF0dXMgPSBCdWZmZXJJbmZvOjpPV05FRF9CWV9VUzsKLQotICAgIFBvcnRNb2RlIG1vZGUgPSBnZXRQb3J0TW9kZShrUG9ydEluZGV4T3V0cHV0KTsKLQotICAgIHN3aXRjaCAobW9kZSkgewotICAgICAgICBjYXNlIEtFRVBfQlVGRkVSUzoKLSAgICAgICAgICAgIGJyZWFrOwotCi0gICAgICAgIGNhc2UgUkVTVUJNSVRfQlVGRkVSUzoKLSAgICAgICAgewotICAgICAgICAgICAgaWYgKHJhbmdlTGVuZ3RoID09IDAgJiYgIShmbGFncyAmIE9NWF9CVUZGRVJGTEFHX0VPUykpIHsKLSAgICAgICAgICAgICAgICBBTE9HVigiWyVzXSBjYWxsaW5nIGZpbGxCdWZmZXIgJXAiLAotICAgICAgICAgICAgICAgICAgICAgbUNvZGVjLT5tQ29tcG9uZW50TmFtZS5jX3N0cigpLCBpbmZvLT5tQnVmZmVySUQpOwotCi0gICAgICAgICAgICAgICAgQ0hFQ0tfRVEobUNvZGVjLT5tT01YLT5maWxsQnVmZmVyKAotICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1Db2RlYy0+bU5vZGUsIGluZm8tPm1CdWZmZXJJRCksCi0gICAgICAgICAgICAgICAgICAgICAgICAgKHN0YXR1c190KU9LKTsKLQotICAgICAgICAgICAgICAgIGluZm8tPm1TdGF0dXMgPSBCdWZmZXJJbmZvOjpPV05FRF9CWV9DT01QT05FTlQ7Ci0gICAgICAgICAgICAgICAgYn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TWVzc2FnZSgicmVwbHkiLCByZXBseSk7Ci0KLSAgICAgICAgICAgIG5vdGlmeS0+cG9zdCgpOwotCi0gICAgICAgICAgICBpbmZvLT5tU3RhdHVzID0gQnVmZmVySW5mbzo6T1dORURfQllfRE9XTlNUUkVBTTsKLQotICAgICAgICAgICAgaWYgKGZsYWdzICYgT01YX0JVRkZFUkZMQUdfRU9TKSB7Ci0gICAgICAgICAgICAgICAgQUxPR1YoIlslc10gc2F3IG91dHB1dCBFT1MiLCBtQ29kZWMtPm1Db21wb25lbnROYW1lLmNfc3RyKCkpOwotCi0gICAgICAgICAgICAgICAgc3A8QU1lc3NhZ2U+IG5vdGlmeSA9IG1Db2RlYy0+bU5vdGlmeS0+ZHVwKCk7Ci0gICAgICAgICAgICAgICAgbm90aWZ5LT5zZXRJbnQzMigid2hhdCIsIEFDb2RlYzo6a1doYXRFT1MpOwotICAgICAgICAgICAgICAgIG5vdGlmeS0+c2V0SW50MzIoImVyciIsIG1Db2RlYy0+bUlucHV0RU9TUmVzdWx0KTsKLSAgICAgICAgICAgICAgICBub3RpZnktPnBvc3QoKTsKLQotICAgICAgICAgICAgICAgIG1Db2RlYy0+bVBvcnRFT1Nba1BvcnRJbmRleE91dHB1dF0gPSB0cnVlOwotICAgICAgICAgICAgfQotICAgICAgICAgICAgYnJlYWs7Ci0gICAgICAgIH0KLQotICAgICAgICBkZWZhdWx0OgotICAgICAgICB7Ci0gICAgICAgICAgICBDSEVDS19FUSgoaW50KW1vZGUsIChpbnQpRlJFRV9CVUZGRVJTKTsKLQotICAgICAgICAgICAgQ0hFQ0tfRVEoKHN0YXR1c190KU9LLAotICAgICAgICAgICAgICAgICAgICAgbUNvZGVjLT5mcmVlQnVmZmVyKGtQb3J0SW5kZXhPdXRwdXQsIGluZGV4KSk7Ci0gICAgICAgICAgICBicmVhazsKLSAgICAgICAgfQotICAgIH0KLQotICAgIHJldHVybiB0cnVlOwotfQotCi12b2lkIEFDb2RlYzo6QmFzZVN0YXRlOjp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AgICAgICAvLyBXZSBjYW5ub3QgcmVzdWJtaXQgdGhlIGJ1ZmZlciB3ZSBqdXN0IHJlbmRlcmVkLCBkZXF1ZXVlCi0gICAgICAgICAgICAgICAgICAgIC8vIHRoZSBzcGFyZSBpbnN0ZWFkLgotCi0gICAgICAgICAgICAgICAgICAgIGluZm8gPSBtQ29kZWMtPmRlcXVldWVCdWZmZXJGcm9tTmF0aXZlV2luZG93KCk7Ci0gICAgICAgICAgICAgICAgfQotCi0gICAgICAgICAgICAgICAgaWYgKGluZm8gIT0gTlVMTCkgewotICAgICAgICAgICAgICAgICAgICBBTE9HVigiWyVzXSBjYWxsaW5nIGZpbGxCdWZmZXIgJXAiLAotICAgICAgICAgICAgICAgICAgICAgICAgIG1Db2RlYy0+bUNvbXBvbmVudE5hbWUuY19zdHIoKSwgaW5mby0+bUJ1ZmZlcklEKTsKLQotICAgICAgICAgICAgICAgICAgICBDSEVDS19FUShtQ29kZWMtPm1PTVgtPmZpbGxCdWZmZXIobUNvZGVjLT5tTm9kZSwgaW5mby0+bUJ1ZmZlcklEKSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKHN0YXR1c190KU9LKTsKLQotICAgICAgICAgICAgICAgICAgICBpbmZvLT5tU3RhdHVzID0gQnVmZmVySW5mbzo6T1dORURfQllfQ09NUE9ORU5UOwotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgIH0KLSAgICAgICAgICAgIGJyZWFrOwotICAgICAgICB9Ci0KLSAgICAgICAgZGVmYXVsdDoKLSAgICAgICAgewotICAgICAgICAgICAgQ0hFQ0tfRVEoKGludCltb2RlLCAoaW50KUZSRUVfQlVGRkVSUyk7Ci0KLSAgICAgICAgICAgIENIRUNLX0VRKChzdGF0dXNfdClPSywKLSAgICAgICAgICAgICAgICAgICAgIG1Db2RlYy0+ZnJlZUJ1ZmZlcihrUG9ydEluZGV4T3V0cHV0LCBpbmRleCkpOwotICAgICAgICAgICAgYnJlYWs7Ci0gICAgICAgIH0KL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bnQzMigKLSAgICAgICAgICAgICAgICAgICAgICAgICJrZWVwQ29tcG9uZW50QWxsb2NhdGVkIiwgJmtlZXBDb21wb25lbnRBbGxvY2F0ZWQpKTsKLSAgICAgICAgICAgIENIRUNLKCFrZWVwQ29tcG9uZW50QWxsb2NhdGVkKTsKLQotICAgICAgICAgICAgc3A8QU1lc3NhZ2U+IG5vdGlmeSA9IG1Db2RlYy0+bU5vdGlmeS0+ZHVwKCk7Ci0gICAgICAgICAgICBub3RpZnktPnNldEludDMyKCJ3aGF0IiwgQUNvZGVjOjprV2hhdFNodXRkb3duQ29tcGxldGVkKTsKLSAgICAgICAgICAgIG5vdGlmeS0+cG9zdCgpOwotCi0gICAgICAgICAgICBoYW5kbGVkID0gdHJ1ZTsKLSAgICAgICAgICAgIGJyZWFrOwotICAgICAgICB9Ci0KLSAgICAgICAgY2FzZSBBQ29kZWM6OmtXaGF0Rmx1c2g6Ci0gICAgICAgIHsKLSAgICAgICAgICAgIHNwPEFNZXNzYWdlPiBub3RpZnkgPSBtQ29kZWMtPm1Ob3RpZnktPmR1cCgpOwotICAgICAgICAgICAgbm90aWZ5LT5zZXRJbnQzMigid2hhdCIsIEFDb2RlYzo6a1doYXRGbHVzaENvbXBsZXRlZCk7Ci0gICAgICAgICAgICBub3RpZnktPnBvc3QoKTsKLQotICAgICAgICAgICAgaGFuZGxlZCA9IHRydWU7Ci0gICAgICAgICAgICBicmVhazsKLSAgICAgICAgfQotCi0gICAgICAgIGRlZmF1bHQ6Ci0gICAgICAgICAgICByZXR1cm4gQmFzZVN0YXRlOjpvbk1lc3NhZ2VSZWNlaXZlZChtc2cpOwotICAgIH0KLQotICAgIHJldHVybiBoYW5kbGVkOwotfQotCi12b2lkIEFDb2RlYzo6VW5pbml0aWFsaXplZFN0YXRlOjpvblNldHVwKAotICAgICAgICBjb25zdCBzcDxBTWVzc2FnZT4gJm1zZykgewotICAgIGlmIChvbkFsbG9jYXRlQ29tcG9uZW50KG1zZykKLSAgICAgICAgIC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gICAgfSBlbHNlIHsKLSAgICAgICAgQ0hFQ0sobXNnLT5maW5kU3RyaW5nKCJtaW1lIiwgJm1pbWUpKTsKLQotICAgICAgICBpbnQzMl90IGVuY29kZXI7Ci0gICAgICAgIGlmICghbXNnLT5maW5kSW50MzIoImVuY29kZXIiLCAmZW5jb2RlcikpIHsKLSAgICAgICAgICAgIGVuY29kZXIgPSBmYWxzZTsKLSAgICAgICAgfQotCi0gICAgICAgIE9NWENvZGVjOjpmaW5kTWF0Y2hpbmdDb2RlY3MoCi0gICAgICAgICAgICAgICAgbWltZS5jX3N0cigpLAotICAgICAgICAgICAgICAgIGVuY29kZXIsIC8vIGNyZWF0ZUVuY29kZXIKLSAgICAgICAgICAgICAgICBOVUxMLCAgLy8gbWF0Y2hDb21wb25lbnROYW1lCi0gICAgICAgICAgICAgICAgMCwgICAgIC8vIGZsYWdzCi0gICAgICAgICAgICAgICAgJm1hdGNoaW5nQ29kZWNzLAotICAgICAgICAgICAgICAgICZtYXRjaGluZ0NvZGVjUXVpcmtzKTsKLSAgICB9Ci0KLSAgICBzcDxDb2RlY09ic2VydmVyPiBvYnNlcnZlciA9IG5ldyBDb2RlY09ic2VydmVyOwotICAgIElPTVg6Om5vZGVfaWQgbm9kZSA9IE5VTEw7Ci0KLSAgICBmb3IgKHNpemVfdCBtYXRjaEluZGV4ID0gMDsgbWF0Y2hJbmRleCA8IG1hdGNoaW5nQ29kZWNzLnNpemUoKTsKLSAgICAgICAgICAgICsrbWF0Y2hJbmRleCkgewotICAgICAgICBjb21wb25lbnROYW1lID0gbWF0Y2hpbmdDb2RlY3MuaXRlbUF0KG1hdGNoSW5kZXgpLnN0cmluZygpOwotICAgICAgICBxdWlya3MgPSBtYXRjaGluZ0NvZGVjUXVpcmtzLml0ZW1BdChtYXRjaEluZGV4KTsKLQotICAgICAgICBwaWRfdCB0aWQgPSBhbmRyb2lkR2V0VGlkKCk7Ci0gICAgICAgIGludCBwcmV2UHJpb3JpdHkgPSBhbmRyb2lk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0KCksCi0gICAgICAgICAgICAgICAgICAgIGluZm8tPm1HcmFwaGljQnVmZmVyLmdldCgpKTsKLSAgICAgICAgICAgIENIRUNLX0VRKGVyciwgKHN0YXR1c190KU9LKTsKLSAgICAgICAgfSBlbHNlIHsKLSAgICAgICAgICAgIENIRUNLX0VRKChpbnQpaW5mby0+bVN0YXR1cywgKGludClCdWZmZXJJbmZvOjpPV05FRF9CWV9VUyk7Ci0gICAgICAgIH0KLQotICAgICAgICBBTE9HVigiWyVzXSBjYWxsaW5nIGZpbGxCdWZmZXIgJXAiLAotICAgICAgICAgICAgIG1Db2RlYy0+bUNvbXBvbmVudE5hbWUuY19zdHIoKSwgaW5mby0+bUJ1ZmZlcklEKTsKLQotICAgICAgICBDSEVDS19FUShtQ29kZWMtPm1PTVgtPmZpbGxCdWZmZXIobUNvZGVjLT5tTm9kZSwgaW5mby0+bUJ1ZmZlcklEKSwKLSAgICAgICAgICAgICAgICAgKHN0YXR1c190KU9LKTsKLQotICAgICAgICBpbmZvLT5tU3RhdHVzID0gQnVmZmVySW5mbzo6T1dORURfQllfQ09NUE9ORU5UOwotICAgIH0KLX0KLQotdm9pZCBBQ29kZWM6OkV4ZWN1dGluZ1N0YXRlOjpyZXN1bWUoKSB7Ci0gICAgaWYgKG1BY3RpdmUpIHsKLSAgICAgICAgQUxPR1YoIlslc10gV2UncmUgYWxyZWFkeSBhY3RpdmUsIG5vIG5lZWQgdG8gcmVzdW1lLiIsCi0gICAgICAgICAgICAgbUNvZGVjLT5tQ29tcG9uZW50TmFtZS5jX3N0cigpKTsKLQotICAgICAgICByZXR1cm47Ci0gICAgfQotCi0gICAgc3VibWl0T3V0cHV0QnVmZmVycygpOwotCi0gICAgLy8gUG9zdCB0aGUgZmlyc3QgaW5wdXQgYnVmZmVyLgotICAgIENIRUNLX0dUKG1Db2RlYy0+bUJ1ZmZlcnNba1BvcnRJbmRleElucHV0XS5zaXplKCksIDB1KTsKLSAgICBCdWZmZXJJbmZvICppbmZvID0gJm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bUNvZGVjLT5tTm9kZSwgT01YX0NvbW1hbmRTdGF0ZVNldCwgT01YX1N0YXRlSWRsZSksCi0gICAgICAgICAgICAgICAgICAgICAoc3RhdHVzX3QpT0spOwotCi0gICAgICAgICAgICBtQ29kZWMtPmNoYW5nZVN0YXRlKG1Db2RlYy0+bUV4ZWN1dGluZ1RvSWRsZVN0YXRlKTsKLQotICAgICAgICAgICAgaGFuZGxlZCA9IHRydWU7Ci0gICAgICAgICAgICBicmVhazsKLSAgICAgICAgfQotCi0gICAgICAgIGNhc2Uga1doYXRGbHVzaDoKLSAgICAgICAgewotICAgICAgICAgICAgQUxPR1YoIlslc10gRXhlY3V0aW5nU3RhdGUgZmx1c2hpbmcgbm93ICIKLSAgICAgICAgICAgICAgICAgIihjb2RlYyBvd25zICVkLyVkIGlucHV0LCAlZC8lZCBvdXRwdXQpLiIsCi0gICAgICAgICAgICAgICAgICAgIG1Db2RlYy0+bUNvbXBvbmVudE5hbWUuY19zdHIoKSwKLSAgICAgICAgICAgICAgICAgICAgbUNvZGVjLT5jb3VudEJ1ZmZlcnNPd25lZEJ5Q29tcG9uZW50KGtQb3J0SW5kZXhJbnB1dCksCi0gICAgICAgICAgICAgICAgICAgIG1Db2RlYy0+bUJ1ZmZlcnNba1BvcnRJbmRleElucHV0XS5zaXplKCksCi0gICAgICAgICAgICAgICAgICAgIG1Db2RlYy0+Y291bnRCdWZmZXJzT3duZWRCeUNvbXBvbmVudChrUG9ydEluZGV4T3V0cHV0KSwKLSAgICAgICAgICAgICAgICAgICAgbUNvZGVjLT5tQnVmZmVyc1trUG9ydEluZGV4T3V0cHV0XS5zaXplKCkpOwotCi0gICAgICAgICAgICBtQWN0aXZlID0gZmFsc2U7Ci0KLSAgICAgICAgICAgIENIRUNLX0VRKG1Db2RlYy0+bU9NWC0+c2VuZENvbW1hbmQoCi0gICAgICAgICAgICAgICAgICAgICAgICBtQ29kZWMtPm1Ob2RlLCBPTVhfQ29tbWFuZEZsdXNoLCBPTVhfQUxMKSwKLSAgICAgICAgICAgICAgICAgICAgIChzdGF0dXNfdClPSyk7Ci0KLSAgICAgICAgICAgIG1Db2RlYy0+Y2hhbmdlU3RhdGUobUNvZGVjLT5tRmx1c2hpbmdTdGF0ZSk7Ci0KLSAgICAgICAgICAgIGhhbmRsZWQgPSB0cnVlOwotICAgICAgICAgICAgYnJlYWs7Ci0gICAgICAgIH0KLQotICAgICAgICBjYXNlIGtXaGF0UmVzdW1lOgotICAgICAgICB7Ci0gICAgICAgICAgICByZXN1bWUoKTsKLQotICAgICAgICAgICAgaGFuZGxlZCA9IHRydWU7Ci0gICAgICAgICAgICBicmVhazsKLSAgICAgICAgfQotCi0gICAgICAgIGRlZmF1bHQ6Ci0gICAgICAgICAgICBoYW5kbGVkID0gQmFzZVN0YXRlOjpvbk1lc3NhZ2VSZWNlaXZlZChtc2cpOwotICAgICAgICAgICAgYnJlYWs7Ci0gICAgfQotCi0gICAgcmV0dXJuIGhhbmRsZWQ7Ci19Ci0KLWJvb2wgQUNvZGVjOjpFeGVjdXRpbmdTdGF0ZTo6b25PTVhFdmVudCgKLSAgICAgICAgT01YX0VWRU5UVFlQRSBldmVudCwgT01YX1UzMiBkYXRhMSwgT01YX1UzMiBkYXRhMikgewotICAgIHN3aXRjaCAoZXZlbnQpIHsKLSAgICAgICAgY2FzZSBPTVhfRXZlbnRQb3J0U2V0dGluZ3NDaGFuZ2VkOgotICAgICAgICB7Ci0gICAgICAgICAgICBDSEVDS19FUShkYXRhMSwgKE9NWF9VMzIpa1BvcnRJbmRleE91dHB1dCk7Ci0KLSAgICAgICAgICAgIGlmIChkYXRhMiA9PSAwIHx8IGRhdGEyID09IE9NWF9JbmRleFBhcmFtUG9ydERlZmluaXRpb24pIHsKLSAgICAgICAgICAgICAgICBDSEVDS19FUShtQ29kZWMtPm1PTVgtPnNlbmRDb21tYW5kKAotICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1Db2RlYy0+bU5vZGUsCi0gICAgICAgICAgICAgICAgICAg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Q29kZWMtPm1CdWZmZXJzW2tQb3J0SW5kZXhPdXRwdXRdLmlzRW1wdHkoKSk7Ci0gICAgICAgICAgICAgICAgbUNvZGVjLT5tRGVhbGVyW2tQb3J0SW5kZXhPdXRwdXRdLmNsZWFyKCk7Ci0KLSAgICAgICAgICAgICAgICBDSEVDS19FUShtQ29kZWMtPm1PTVgtPnNlbmRDb21tYW5kKAotICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1Db2RlYy0+bU5vZGUsIE9NWF9Db21tYW5kUG9ydEVuYWJsZSwga1BvcnRJbmRleE91dHB1dCksCi0gICAgICAgICAgICAgICAgICAgICAgICAgKHN0YXR1c190KU9LKTsKLQotICAgICAgICAgICAgICAgIHN0YXR1c190IGVycjsKLSAgICAgICAgICAgICAgICBpZiAoKGVyciA9IG1Db2RlYy0+YWxsb2NhdGVCdWZmZXJzT25Qb3J0KAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBrUG9ydEluZGV4T3V0cHV0KSkgIT0gT0spIHsKLSAgICAgICAgICAgICAgICAgICAgQUxPR0UoIkZhaWxlZCB0byBhbGxvY2F0ZSBvdXRwdXQgcG9ydCBidWZmZXJzIGFmdGVyICIKLSAgICAgICAgICAgICAgICAgICAgICAgICAicG9ydCByZWNvbmZpZ3VyYXRpb24gKGVycm9yIDB4JTA4eCkiLAotICAgICAgICAgICAgICAgICAgICAgICAgIGVycik7Ci0KLSAgICAgICAgICAgICAgICAgICAgbUNvZGVjLT5zaWduYWxFcnJvcihPTVhfRXJyb3JVbmRlZmluZWQsIGVycik7Ci0KLSAgICAgICAgICAgICAgICAgICAgLy8gVGhpcyBpcyB0ZWNobmljYWxseSBub3QgY29ycmVjdCwgc2luY2Ugd2Ugd2VyZSB1bmFibGUKLSAgICAgICAgICAgICAgICAgICAgLy8gdG8gYWxsb2NhdGUgb3V0cHV0IGJ1ZmZlcnMgYW5kIHRoZXJlZm9yZSB0aGUgb3V0cHV0IHBvcnQKLSAgICAgICAgICAgICAgICA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gfQotCi0gICAgcmV0dXJuIGhhbmRsZWQ7Ci19Ci0KLWJvb2wgQUNvZGVjOjpGbHVzaGluZ1N0YXRlOjpvbk9NWEV2ZW50KAotICAgICAgICBPTVhfRVZFTlRUWVBFIGV2ZW50LCBPTVhfVTMyIGRhdGExLCBPTVhfVTMyIGRhdGEyKSB7Ci0gICAgQUxPR1YoIlslc10gRmx1c2hpbmdTdGF0ZSBvbk9NWEV2ZW50KCVkLCVsZCkiLAotICAgICAgICAgICAgbUNvZGVjLT5tQ29tcG9uZW50TmFtZS5jX3N0cigpLCBldmVudCwgZGF0YTEpOwotCi0gICAgc3dpdGNoIChldmVudCkgewotICAgICAgICBjYXNlIE9NWF9FdmVudENtZENvbXBsZXRlOgotICAgICAgICB7Ci0gICAgICAgICAgICBDSEVDS19FUShkYXRhMSwgKE9NWF9VMzIpT01YX0NvbW1hbmRGbHVzaCk7Ci0KLSAgICAgICAgICAgIGlmIChkYXRhMiA9PSBrUG9ydEluZGV4SW5wdXQgfHwgZGF0YTIgPT0ga1BvcnRJbmRleE91dHB1dCkgewotICAgICAgICAgICAgICAgIENIRUNLKCFtRmx1c2hDb21wbGV0ZVtkYXRhMl0pOwotICAgICAgICAgICAgICAgIG1GbHVzaENvbXBsZXRlW2RhdGEyXSA9IHRydWU7Ci0KLSAgICAgICAgICAgICAgICBpZiAobUZsdXNoQ29tcGxldGVba1BvcnRJbmRleElucHV0XQotICAgICAgICAgICAgICAgICAgICAgICAgJiYgbUZsdXNoQ29tcGxldGVba1BvcnRJbmRleE91dHB1dF0pIHsKLSAgICAgICAgICAgICAgICAgICAgY2hhbmdlU3RhdGVJZldlT3duQWxsQnVmZmVycygpOwotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgIH0gZWxzZSB7Ci0gICAgICAgICAgICAgICAgQ0hFQ0tfRVEoZGF0YTIsIE9NWF9BTEwpOwotICAgICAgICAgICAgICAgIENIRUNLKG1GbHVzaENvbXBsZXRlW2tQb3J0SW5kZXhJbnB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yZWFkRnVuYygpIHsKLSAgICBtRXN0aW1hdGVkRHVyYXRpb25VcyA9IDA7Ci0gICAgbUVzdGltYXRlZFNpemVCeXRlcyA9IDA7Ci0gICAgYm9vbCBzdG9wcGVkUHJlbWF0dXJlbHkgPSB0cnVlOwotICAgIGludDY0X3QgcHJldmlvdXNQYXVzZWREdXJhdGlvblVzID0gMDsKLSAgICBpbnQ2NF90IG1heFRpbWVzdGFtcFVzID0gMDsKLSAgICBzdGF0dXNfdCBlcnIgPSBPSzsKLQotICAgIHByY3RsKFBSX1NFVF9OQU1FLCAodW5zaWduZWQgbG9uZykiQU1SV3JpdGVyIiwgMCwgMCwgMCk7Ci0gICAgd2hpbGUgKCFtRG9uZSkgewotICAgICAgICBNZWRpYUJ1ZmZlciAqYnVmZmVyOwotICAgICAgICBlcnIgPSBtU291cmNlLT5yZWFkKCZidWZmZXIpOwotCi0gICAgICAgIGlmIChlcnIgIT0gT0spIHsKLSAgICAgICAgICAgIGJyZWFrOwotICAgICAgICB9Ci0KLSAgICAgICAgaWYgKG1QYXVzZWQpIHsKLSAgICAgICAgICAgIGJ1ZmZlci0+cmVsZWFzZSgpOwotICAgICAgICAgICAgYnVmZmVyID0gTlVMTDsKLSAgICAgICAgICAgIGNvbnRpbnVlOwotICAgICAgICB9Ci0KLSAgICAgICAgbUVzdGltYXRlZFNpemVCeXRlcyArPSBidWZmZXItPnJhbmdlX2xlbmd0aCgpOwotICAgICAgICBpZiAoZXhjZWVkc0ZpbGVTaXplTGltaXQoKSkgewotICAgICAgICAgICAgYnVmZmVyLT5yZWxlYXNlKCk7Ci0gICAgICAgICAgICBidWZmZXIgPSBOVUxMOwotICAgICAgICAgICAgbm90aWZ5KE1FRElBX1JFQ09SREVSX0VWRU5UX0lORk8sIE1FRElBX1JFQ09SREVSX0lORk9fTUFYX0ZJTEVTSVpFX1JFQUNIRUQsIDApOwotICAgICAgICAgICAgYnJlYWs7Ci0gICAgICAgIH0KLQotICAgICAgICBpbnQ2NF90IHRpbWVzdGFtcFVzOwotICAgICAgICBDSEVDSyhidWZmZXItPm1ldGFfZGF0YSgpLT5maW5kSW50NjQoa0tleVRpbWUsICZ0aW1lc3RhbXBVcykpOwotICAgICAgICBpZiAodGltZXN0YW1wVXMgPiBtRXN0aW1hdGVkRHVyYXRpb25VcykgewotICAgICAgICAgICAgbUVzdGltYXRlZER1cmF0aW9uVXMgPSB0aW1lc3RhbXBVczsKLSAgICAgICAgfQotICAgICAgICBpZiAobVJlc3VtZWQpIHsKLSAgICAgICAgICAgIHByZXZpb3VzUGF1c2VkRHVyYXRpb25VcyArPSAodGltZXN0YW1wVXMgLSBtYXhUaW1lc3RhbXBVcyAtIDIwMDAwKTsKLSAgICAgICAgICAgIG1SZXN1bWVkID0gZmFsc2U7Ci0gICAgICAgIH0KLSAgICAgICAgdGltZXN0YW1wVXMgLT0gcHJldmlvdXNQYXVzZWREdXJhdGlvblVzOwotICAgICAgICBBTE9HVigidGltZSBzdGFtcDogJWxsZCwgcHJldmlvdXMgcGF1c2VkIGR1cmF0aW9uOiAlbGxkIiwKLSAgICAgICAgICAgICAgICB0aW1lc3RhbXBVcywgcHJldmlvdXNQYXVzZWREdXJhdGlvblVzKTsKLSAgICAgICAgaWYgKHRpbWVzdGFtcFVzID4gbWF4VGltZXN0YW1wVXMpIHsKLSAgICAgICAgICAgIG1heFRpbWVzdGFtcFVzID0gdGltZXN0YW1wVXM7Ci0gICAgICAgIH0KLQotICAgICAgICBpZiAoZXhjZWVkc0ZpbGVEdXJhdGlvbkxpbWl0KCkpIHsKLSAgICAgICAgICAgIGJ1ZmZlci0+cmVsZWFzZSgpOwotICAgICAgICAgICAgYnVmZmVyID0gTlVMTDsKLSAgICAgICAgICAgIG5vdGlmeShNRURJQV9SRUNPUkRFUl9FVkVOVF9JTkZPLCBNRURJQV9SRUNPUkRFUl9JTkZPX01BWF9EVVJBVElPTl9SRUFDSEVELCAwKTsKLSAgICAgICAgICAgIGJyZWFrOwotICAgICAgICB9Ci0gICAgICAgIHNzaXplX3QgbiA9IHdyaXRlKG1GZCwKLSAgICAgICAgICAgICAgICAgICAgICAgIChjb25zdCB1aW50OF90ICopYnVmZmVyLT5kYXRhKCkgKyBidWZmZXItPnJhbmdlX29mZnNldCgpLAotICAgICAgICAgICAgICAgICAgICAgICAgYnVmZmVyLT5yYW5nZV9sZW5ndGgoKSk7Ci0KLSAgICAgICAgaWYgKG4gPCAoc3NpemVfdClidWZmZXItPnJhbmdlX2xlbmd0aCgpKSB7Ci0gICAgICAgICAgICBidWZmZXItPnJlbGVhc2UoKTsKLSAgICAgICAgICAgIGJ1ZmZlciA9IE5VTEw7Ci0KLSAgICAgICAgICAgIGJyZWFrOwotICAgICAgICB9Ci0KLSAgICAgICAgLy8gWFhYOiBIb3cgdG8gdGVsbCBpdCBpcyBzdG9wcGVkIHByZW1hdHVyZWx5PwotICAgICAgICBpZiAoc3RvcHBlZFByZW1hdHVyZWx5KSB7Ci0gICAgICAgICAgICBzdG9wcGVkUHJlbWF0dXJlbHkgPSBmYWxzZTsKLSAgICAgICAgfQotCi0gICAgICAgIGJ1ZmZlci0+cmVsZWFzZSgpOwotICAgICAgICBidWZmZXIgPSBOVUxMOwotICAgIH0KLQotICAgIGlmIChzdG9wcGVkUHJlbWF0dXJlbHkpIHsKLSAgICAgICAgbm90aWZ5KE1FRElBX1JFQ09SREVSX0VWRU5UX0lORk8sIE1FRElBX1JFQ09SREVSX1RSQUNLX0lORk9fQ09NUExFVElPTl9TVEFUVVMsIFVOS05PV05fRVJST1IpOwotICAgIH0KLQotICAgIGNsb3NlKG1GZCk7Ci0gICAgbUZkID0gLTE7Ci0gICAgbVJlYWNoZWRFT1MgPSB0cnVlOwotICAgIGlmIChlcnIgPT0gRVJST1JfRU5EX09GX1NUUkVBTSkgewotICAgICAgICByZXR1cm4gT0s7Ci0gICAgfQotICAgIHJldHVybiBlcnI7Ci19Ci0KLWJvb2wgQU1SV3JpdGVyOjpyZWFjaGVkRU9TKCkgewotICAgIHJldHVybi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J1ZmZlciwgY29uc3QgUmVhZE9wdGlvbnMgKm9wdGlvbnMpIHsKLSAgICBDSEVDSyhtQnVmZmVyR3JvdXApOwotCi0gICAgKmJ1ZmZlciA9IE5VTEw7Ci0KLSAgICBpbnQ2NF90IHNlZWtUaW1lVXM7Ci0gICAgUmVhZE9wdGlvbnM6OlNlZWtNb2RlIHNlZWtNb2RlOwotICAgIGlmIChvcHRpb25zICYmIG9wdGlvbnMtPmdldFNlZWtUbygmc2Vla1RpbWVVcywgJnNlZWtNb2RlKSkgewotICAgICAgICBzdGF0dXNfdCBlcnIgPQotICAgICAgICAgICAgbUV4dHJhY3Rvci0+Z2V0U2FtcGxlSW5kZXhBdFRpbWUoCi0gICAgICAgICAgICAgICAgICAgIG1UcmFja0luZGV4LCBzZWVrVGltZVVzLCBzZWVrTW9kZSwgJm1TYW1wbGVJbmRleCk7Ci0KLSAgICAgICAgaWYgKGVyciAhPSBPSykgewotICAgICAgICAgICAgcmV0dXJuIEVSUk9SX0VORF9PRl9TVFJFQU07Ci0gICAgICAgIH0KLQotICAgICAgICBpZiAobVNwbGl0dGVyICE9IE5VTEwpIHsKLSAgICAgICAgICAgIG1TcGxpdHRlci0+Y2xlYXIoKTsKLSAgICAgICAgfQotICAgIH0KLQotICAgIGZvciAoOzspIHsKLSAgICAgICAgaWYgKG1TcGxpdHRlciAhPSBOVUxMKSB7Ci0gICAgICAgICAgICBzdGF0dXNfdCBlcnIgPSBtU3BsaXR0ZXItPnJlYWQoYnVmZmVyKTsKLQotICAgICAgICAgICAgaWYgKGVyciA9PSBPSykgewotICAgICAgICAgICAgICAgIGJyZWFrOwotICAgICAgICAgICAgfSBlbHNlIGlmIChlcnIgIT0gLUVBR0FJTikgewotICAgICAgICAgICAgICAgIHJldHVybiBlcnI7Ci0gICAgICAgICAgICB9Ci0gICAgICAgIH0KLQotICAgICAgICBvZmY2NF90IG9mZnNldDsKLSAgICAgICAgc2l6ZV90IHNpemU7Ci0gICAgICAgIGJvb2wgaXN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Ci0KLSAgICAgICAgICAgIHN0YXRpYyBjb25zdCB1aW50MzJfdCBrTWFzayA9IDB4ZmZmZTBjMDA7Ci0KLSAgICAgICAgICAgIHVpbnQzMl90IGhlYWRlciA9IFUzMl9BVChtQnVmZmVyLT5kYXRhKCkgKyBzdWJzZXF1ZW50T2Zmc2V0KTsKLSAgICAgICAgICAgIGlmICgoaGVhZGVyICYga01hc2spICE9IChmaXJzdEhlYWRlciAmIGtNYXNrKSkgewotICAgICAgICAgICAgICAgIGJyZWFrOwotICAgICAgICAgICAgfQotCi0gICAgICAgICAgICBpZiAoIUdldE1QRUdBdWRpb0ZyYW1lU2l6ZShoZWFkZXIsICZmcmFtZVNpemUpKSB7Ci0gICAgICAgICAgICAgICAgYnJlYWs7Ci0gICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgIHN1YnNlcXVlbnRPZmZzZXQgKz0gZnJhbWVTaXplOwotICAgICAgICAgICAgLS1pOwotICAgICAgICB9Ci0KLSAgICAgICAgaWYgKGkgPT0gMCkgewotICAgICAgICAgICAgZm91bmRTeW5jID0gdHJ1ZTsKLSAgICAgICAgICAgIG1lbW1vdmUobUJ1ZmZlci0+ZGF0YSgpLAotICAgICAgICAgICAgICAgICAgICBtQnVmZmVyLT5kYXRhKCkgKyBvZmZzZXQsCi0gICAgICAgICAgICAgICAgICAgIG1CdWZmZXItPnNpemUoKSAtIG9mZnNldCk7Ci0KLSAgICAgICAgICAgIG1CdWZmZXItPnNldFJhbmdlKDAsIG1CdWZmZXItPnNpemUoKSAtIG9mZnNldCk7Ci0gICAgICAgICAgICBicmVhazsKLSAgICAgICAgfQotICAgIH0KLQotICAgIHJldHVybiBmb3VuZFN5bmM7Ci19Ci0KLXN0YXR1c190IEFWSUV4dHJhY3Rvcjo6TVAzU3BsaXR0ZXI6OnJlYWQoTWVkaWFCdWZmZXIgKipvdXQpIHsKLSAgICAqb3V0ID0gTlVMTDsKLQotICAgIGlmIChtRmluZFN5bmMpIHsKLSAgICAgICAgaW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kIiwKLSAgICAgICAgICAgICBwcmVmaXgsCi0gICAgICAgICAgICAgb2Zmc2V0LAotICAgICAgICAgICAgIChjaGFyKShzdWJGb3VyY2MgPj4gMjQpLAotICAgICAgICAgICAgIChjaGFyKSgoc3ViRm91cmNjID4+IDE2KSAmIDB4ZmYpLAotICAgICAgICAgICAgIChjaGFyKSgoc3ViRm91cmNjID4+IDgpICYgMHhmZiksCi0gICAgICAgICAgICAgKGNoYXIpKHN1YkZvdXJjYyAmIDB4ZmYpLAotICAgICAgICAgICAgIGNodW5rU2l6ZSAtIDQpOwotCi0gICAgICAgIGlmIChzdWJGb3VyY2MgPT0gRk9VUkNDKCdtJywgJ28nLCAndicsICdpJykpIHsKLSAgICAgICAgICAgIC8vIFdlJ3JlIG5vdCBnb2luZyB0byBwYXJzZSB0aGlzLCBidXQgd2lsbCB0YWtlIG5vdGUgb2YgdGhlCi0gICAgICAgICAgICAvLyBvZmZzZXQuCi0KLSAgICAgICAgICAgIG1Nb3ZpZU9mZnNldCA9IG9mZnNldDsKLSAgICAgICAgfSBlbHNlIHsKLSAgICAgICAgICAgIG9mZjY0X3Qgc3ViT2Zmc2V0ID0gb2Zmc2V0ICsgMTI7Ci0gICAgICAgICAgICBvZmY2NF90IHN1Yk9mZnNldExpbWl0ID0gc3ViT2Zmc2V0ICsgY2h1bmtTaXplIC0gNDsKLSAgICAgICAgICAgIHdoaWxlIChzdWJPZmZzZXQgPCBzdWJPZmZzZXRMaW1pdCkgewotICAgICAgICAgICAgICAgIHNzaXplX3QgcmVzID0KLSAgICAgICAgICAgICAgICAgICAgcGFyc2VDaHVuayhzdWJPZmZzZXQsIHN1Yk9mZnNldExpbWl0IC0gc3ViT2Zmc2V0LCBkZXB0aCArIDEpOwotCi0gICAgICAgICAgICAgICAgaWYgKHJlcyA8IDApIHsKLSAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHJlczsKLSAgICAgICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgICAgICBzdWJPZmZzZXQgKz0gcmVzOwotICAgICAgICAgICAgfQotICAgICAgICB9Ci0gICAgfSBlbHNlIHsKLSAgICAgICAgQUxPR1YoIiVzIG9mZnNldCAweCUwOGxseCBDSFVOSyAnJWMlYyVjJWMnIiwKLSAgICAgICAgICAgICBwcmVmaXgsCi0gICAgICAgICAgICAgb2Zmc2V0LAotICAgICAgICAgICAgIChjaGFyKShmb3VyY2MgPj4gMjQpLAotICAgICAgICAgICAgIChjaGFyKSgoZm91cmNjID4+IDE2KSAmIDB4ZmYpLAotICAgICAgICAgICAgIChjaGFyKSgoZm91cmNjID4+IDgpICYgMHhmZiksCi0gICAgICAgICAgICAgKGNoYXIpKGZvdXJjYyAmIDB4ZmYpKTsKLQotICAgICAgICBzdGF0dXNfdCBlcnIgPSBPSzsKLQotICAgICAgICBzd2l0Y2ggKGZvdXJjYykgewotICAgICAgICAgICAgY2FzZSBGT1VSQ0MoJ3MnLCAndCcsICdyJywgJ2gnKToKLSAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICBlcnIgPSBwYXJzZVN0cmVhbUhlYWRlcihvZmZzZXQgKyA4LCBjaHVua1NpemUpOwotICAgICAgICAgICAgICAgIGJyZWFrOwotICAgICAgICAgICAgfQotCi0gICAgICAgICAgICBjYXNlIEZPVVJDQygncycsICd0JywgJ3InLCAnZicpOgotICAgICAgICAgICAgewotICAgICAgICAgICAgICAgIGVyciA9IHBhcnNlU3RyZWFtRm9ybWF0KG9mZnNldCArIDgsIGNodW5rU2l6ZSk7Ci0gICAgICAgICAgICAgICAgYnJlYWs7Ci0gICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgIGNhc2UgRk9VUkNDKCdpJywgJ2QnLCAneCcsICcxJyk6Ci0gICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgZXJyID0gcGFyc2VJbmRleChvZmZzZXQgKyA4LCBjaHVua1NpemUpOwotICAgICAgICAgICAgICAgIGJyZWFrOwotICAgICAgICAgICAgfQotCi0gICAgICAgICAgICBkZWZhdWx0OgotICAgICAgICAgICAgICAgIGJyZWFrOwotICAgICAgICB9Ci0KLSAgICAgICAgaWYgKGVyciAhPSBPSykgewotICAgICAgICAgICAgcmV0dXJuIGVycjsKLSAgICAgICAgfQotICAgIH0KLQotICAgIGlmIChjaHVua1NpemUgJiAxKSB7Ci0gICAgICAgICsrY2h1bmtTaXplOwotICAgIH0KLQotICAgIHJldHVybiBjaHVua1NpemUgKyA4OwotfQotCi1zdGF0aWMgY29uc3QgY2hhciAqR2V0TUlNRVR5cGVGb3JIYW5kbGVyKHVpbnQzMl90IGhhbmRsZXIpIHsKLSAgICBzd2l0Y2ggKGhhbmRsZXIpIHsKLSAgICAgICAgLy8gV293Li4uIHNoYW1lbGVzc2x5IGNvcGllZCBmcm9tCi0gICAgICAgIC8vIGh0dHA6Ly93aWtpLm11bHRpbWVkaWEuY3gvaW5kZXgucGhwP3RpdGxlPUlTT19NUEVHLTQKLQotICAgICAgICBjYXNlIEZPVVJDQygnMycsICdJJywgJ1YnLCAnMicpOgotICAgICAgICBjYXNlIEZPVVJDQygnMycsICdpJywgJ3YnLCAnMicpOgotICAgICAgICBjYXNlIEZPVVJDQygnQicsICdMJywgJ1onLCAnMCcpOgotICAgICAgICBjYXNlIEZPVVJDQygnRCcsICdJJywgJ0cnLCAnSScpOgotICAgICAgICBjYXNlIEZPVVJDQygnRCcsICdJJywgJ1YnLCAnMScpOgotICAgICAgICBjYXNlIEZPVVJDQygnZCcsICdpJywgJ3YnLCAnMScpOgotICAgICAgICBjYXNlIEZPVVJDQygnRCcsICdJJywgJ1YnLCAnWCcpOgotICAgICAgICBjYXNlIEZPVVJDQygnZCcsICdpJywgJ3YnLCAneCcpOgotICAgICAgICBjYXNlIEZPVVJDQygnRCcsICdYJywgJzUnLCAnMCcpOgotICAgICAgICBjYXNlIEZPVVJDQygnZCcsICd4JywgJzUnLCAnMCcpOgotICAgICAgICBjYXNlIEZPVVJDQygnRCcsICdYJywgJ0cnLCAnTScpOgotICAgICAgICBjYXNlIEZPVVJDQygnRScsICdNJywgJzQnLCAnQScpOgotICAgICAgICBjYXNlIEZPVVJDQygnRScsICdQJywgJ0gnLCAnVicpOgotICAgICAgICBjYXNlIEZPVVJDQygnRicsICdNJywgJ1AnLCAnNCcpOgotICAgICAgICBjYXNlIEZPVVJDQygnZicsICdtJywgJ3AnLCAnNCcpOgotICAgICAgICBjYXNlIEZPVVJDQygnRicsICdWJywgJ0YnLCAnVycpOgotICAgICAgICBjYXNlIEZPVVJDQygnSCcsICdEJywgJ1gnLCAnNCcpOgotICAgICAgICBjYXNlIEZPVVJDQygnaCcsICdkJywgJ3gnLCAnNCcpOgotICAgICAgICBjYXNlIEZPVVJDQygnTScsICc0JywgJ0MnLCAnQycpOgotICAgICAgICBjYXNlIEZPVVJDQygnTScsICc0JywgJ1MnLCAnMicpOgotICAgICAgICBjYXNlIEZPVVJDQygnbScsICc0JywgJ3MnLCAnMicpOgotICAgICAgICBjYXNlIEZPVVJDQygnTScsICdQJywgJzQnLCAnUycpOgotICAgICAgICBjYXNlIEZPVVJDQygnbScsICdwJywgJzQnLCAncycpOgotICAgICAgICBjYXNlIEZPVVJDQygnTScsICdQJywgJzQnLCAnVicpOgotICAgICAgICBjYXNlIEZPVVJDQygnbScsICdwJywgJzQnLCAndicpOgotICAgICAgICBjYXNlIEZPVVJDQygnTScsICdWJywgJ1gnLCAnTScpOgotICAgICAgICBjYXNlIEZPVVJDQygnUicsICdNJywgJ1AnLCAnNCcpOgotICAgICAgICBjYXNlIEZPVVJDQygnUycsICdFJywgJ0QnLCAnRycpOgotICAgICAgICBjYXNlIEZPVVJDQygnUycsICdNJywgJ1AnLCAnNCcpOgotICAgICAgICBjYXNlIEZPVVJDQygnVScsICdNJywgJ1AnLCAnNCcpOgotICAgICAgICBjYXNlIEZPVVJDQygnVycsICdWJywgJzEnLCAnRicpOgotICAgICAgICBjYXNlIEZPVVJDQygnWCcsICdWJywgJ0knLCAnRCcpOgotICAgICAgICBjYXNlIEZPVVJDQygnWCcsICd2JywgJ2knLCAnRCcpOgotICAgICAgICBjYXNlIEZPVVJDQygneCcsICd2JywgJ2knLCAnZCcpOgotICAgICAgICBjYXNlIEZPVVJDQygnWCcsICdWJywgJ0knLCAnWCcpOgotICAgICAgICAgICAgcmV0dXJuIE1FRElBX01JTUVUWVBFX1ZJREVPX01QRUc0OwotCi0gICAgICAgIC8vIGZyb20gaHR0cDovL3dpa2kubXVsdGltZWRpYS5jeC9pbmRleC5waHA/dGl0bGU9SDI2NAotICAgICAgICBjYXNlIEZPVVJDQygnYScsICd2JywgJ2MnLCAnMScpOgotICAgICAgICBjYXNlIEZPVVJDQygnZCcsICdhJywgJ3YnLCAnYycpOgotICAgICAgICBjYXNlIEZPVVJDQygneCcsICcyJywgJzYnLCAnNCcpOgotICAgICAgICBjYXNlIEZPVVJDQygnSCcsICcyJywgJzYnLCAnNCcpOgotICAgICAgICBjYXNlIEZPVVJDQygndicsICdzJywgJ3MnLCAnaCcpOgotICAgICAgICAgICAgcmV0dXJuIE1FRElBX01JTUVUWVBFX1ZJREVPX0FWQzsKLQotICAgICAgICBkZWZhdWx0OgotICAgICAgICAgICAgcmV0dXJuIE5VTEw7Ci0gICAgfQotfQotCi1zdGF0dXNfdCBBVklFeHRyYWN0b3I6OnBhcnNlU3RyZWFtSGVhZGVyKG9mZjY0X3Qgb2Zmc2V0LCBzaXplX3Qgc2l6ZSkgewotICAgIGlmIChzaXplICE9IDU2KSB7Ci0gICAgICAgIHJldHVybiBFUlJPUl9NQUxGT1JNRUQ7Ci0gICAgfQotCi0gICAgaWYgKG1UcmFja3Muc2l6ZSgpID4gOTkpIHsKLSAgICAgICAgcmV0dXJuIC1FUkFOR0U7Ci0gICAgfQotCi0gICAgc3A8QUJ1ZmZlcj4gYnVmZmVyID0gbmV3IEFCdWZmZXIoc2l6ZSk7Ci0gICAgc3NpemVfdCBuID0gbURhdGFTb3VyY2UtPnJlYWRBdChvZmZzZXQsIGJ1ZmZlci0+ZGF0YSgpLCBidWZmZ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oY2hhcikoaGFuZGxlciA+PiAyNCksCi0gICAgICAgICAgICAgICAgIChjaGFyKSgoaGFuZGxlciA+PiAxNikgJiAweGZmKSwKLSAgICAgICAgICAgICAgICAgKGNoYXIpKChoYW5kbGVyID4+IDgpICYgMHhmZiksCi0gICAgICAgICAgICAgICAgIChjaGFyKShoYW5kbGVyICYgMHhmZikpOwotICAgICAgICB9Ci0KLSAgICAgICAga2luZCA9IFRyYWNrOjpWSURFTzsKLSAgICB9IGVsc2UgaWYgKHR5cGUgPT0gRk9VUkNDKCdhJywgJ3UnLCAnZCcsICdzJykpIHsKLSAgICAgICAgaWYgKG1pbWUgJiYgc3RybmNhc2VjbXAobWltZSwgImF1ZGlvLyIsIDYpKSB7Ci0gICAgICAgICAgICByZXR1cm4gRVJST1JfTUFMRk9STUVEOwotICAgICAgICB9Ci0KLSAgICAgICAga2luZCA9IFRyYWNrOjpBVURJTzsKLSAgICB9Ci0KLSAgICBpZiAoIW1pbWUpIHsKLSAgICAgICAgbWltZSA9ICJhcHBsaWNhdGlvbi9vY3RldC1zdHJlYW0iOwotICAgIH0KLQotICAgIG1ldGEtPnNldENTdHJpbmcoa0tleU1JTUVUeXBlLCBtaW1lKTsKLQotICAgIG1UcmFja3MucHVzaCgpOwotICAgIFRyYWNrICp0cmFjayA9ICZtVHJhY2tzLmVkaXRJdGVtQXQobVRyYWNrcy5zaXplKCkgLSAxKTsKLQotICAgIHRyYWNrLT5tTWV0YSA9IG1ldGE7Ci0gICAgdHJhY2stPm1SYXRlID0gcmF0ZTsKLSAgICB0cmFjay0+bVNjYWxlID0gc2NhbGU7Ci0gICAgdHJhY2stPm1CeXRlc1BlclNhbXBsZSA9IHNhbXBsZVNpemU7Ci0gICAgdHJhY2stPm1LaW5kID0ga2luZDsKLSAgICB0cmFjay0+bU51bVN5bmNTYW1wbGVzID0gMDsKLSAgICB0cmFjay0+bVRodW1ibmFpbFNhbXBsZVNpemUgPSAwOwotICAgIHRyYWNrLT5tVGh1bWJuYWl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7Ci0gICAgICAgIHRyYWNrLT5tTWV0YS0+c2V0SW50MzIoa0tleVNhbXBsZVJhdGUsIHNhbXBsZVJhdGUpOwotICAgIH0KLQotICAgIHJldHVybiBPSzsKLX0KLQotLy8gc3RhdGljCi1ib29sIEFWSUV4dHJhY3Rvcjo6SXNDb3JyZWN0Q2h1bmtUeXBlKAotICAgICAgICBzc2l6ZV90IHRyYWNrSW5kZXgsIFRyYWNrOjpLaW5kIGtpbmQsIHVpbnQzMl90IGNodW5rVHlwZSkgewotICAgIHVpbnQzMl90IGNodW5rQmFzZSA9IGNodW5rVHlwZSAmIDB4ZmZmZjsKLQotICAgIHN3aXRjaCAoa2luZCkgewotICAgICAgICBjYXNlIFRyYWNrOjpWSURFTzoKLSAgICAgICAgewotICAgICAgICAgICAgaWYgKGNodW5rQmFzZSAhPSBGT1VSQ0MoMCwgMCwgJ2QnLCAnYycpCi0gICAgICAgICAgICAgICAgICAgICYmIGNodW5rQmFzZSAhPSBGT1VSQ0MoMCwgMCwgJ2QnLCAnYicpKSB7Ci0gICAgICAgICAgICAgICAgcmV0dXJuIGZhbHNlOwotICAgICAgICAgICAgfQotICAgICAgICAgICAgYnJlYWs7Ci0gICAgICAgIH0KLQotICAgICAgICBjYXNlIFRyYWNrOjpBVURJTzoKLSAgICAgICAgewotICAgICAgICAgICAgaWYgKGNodW5rQmFzZSAhPSBGT1VSQ0MoMCwgMCwgJ3cnLCAnYicpKSB7Ci0gICAgICAgICAgICAgICAgcmV0dXJuIGZhbHNlOwotICAgICAgICAgICAgfQotICAgICAgICAgICAgYnJlYWs7Ci0gICAgICAgIH0KLQotICAgICAgICBkZWZhdWx0OgotICAgICAgICAgICAgYnJlYWs7Ci0gICAgfQotCi0gICAgaWYgKHRyYWNrSW5kZXggPCAwKSB7Ci0gICAgICAgIHJldHVybiB0cnVlOwotICAgIH0KLQotICAgIHVpbnQ4X3QgaGkgPSBjaHVua1R5cGUgPj4gMjQ7Ci0gICAgdWludDhfdCBsbyA9IChj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fCBsbyA8ICcwJyB8fCBsbyA+ICc5JykgewotICAgICAgICAgICAgcmV0dXJuIEVSUk9SX01BTEZPUk1FRDsKLSAgICAgICAgfQotCi0gICAgICAgIHNpemVfdCB0cmFja0luZGV4ID0gMTAgKiAoaGkgLSAnMCcpICsgKGxvIC0gJzAnKTsKLQotICAgICAgICBpZiAodHJhY2tJbmRleCA+PSBtVHJhY2tzLnNpemUoKSkgewotICAgICAgICAgICAgcmV0dXJuIEVSUk9SX01BTEZPUk1FRDsKLSAgICAgICAgfQotCi0gICAgICAgIFRyYWNrICp0cmFjayA9ICZtVHJhY2tzLmVkaXRJdGVtQXQodHJhY2tJbmRleCk7Ci0KLSAgICAgICAgaWYgKCFJc0NvcnJlY3RDaHVua1R5cGUoLTEsIHRyYWNrLT5tS2luZCwgY2h1bmtUeXBlKSkgewotICAgICAgICAgICAgcmV0dXJuIEVSUk9SX01BTEZPUk1FRDsKLSAgICAgICAgfQotCi0gICAgICAgIGlmICh0cmFjay0+bUtpbmQgPT0gVHJhY2s6Ok9USEVSKSB7Ci0gICAgICAgICAgICBkYXRhICs9IDE2OwotICAgICAgICAgICAgc2l6ZSAtPSAxNjsKLSAgICAgICAgICAgIGNvbnRpbnVlOwotICAgICAgICB9Ci0KLSAgICAgICAgdWludDMyX3QgZmxhZ3MgPSBVMzJMRV9BVCgmZGF0YVs0XSk7Ci0gICAgICAgIHVpbnQzMl90IG9mZnNldCA9IFUzMkxFX0FUKCZkYXRhWzhdKTsKLSAgICAgICAgdWludDMyX3QgY2h1bmtTaXplID0gVTMyTEVfQVQoJmRhdGFbMTJdKTsKLQotICAgICAgICBpZiAoY2h1bmtTaXplID4gdHJhY2stPm1NYXhTYW1wbGVTaXplKSB7Ci0gICAgICAgICAgICB0cmFjay0+bU1heFNhbXBsZVNpemUgPSBjaHVua1NpemU7Ci0gICAgICAgIH0KLQotICAgICAgICB0cmFjay0+bVNhbXBsZXMucHVzaCgpOwotCi0gICAgICAgIFNhbXBsZUluZm8gKmluZm8gPQotICAgICAgICAgICAgJnRyYWNrLT5tU2FtcGxlcy5lZGl0SXRlbUF0KHRyYWNrLT5tU2FtcGxlcy5zaXplKCkgLSAxKTsKLQotICAgICAgICBpbmZvLT5tT2Zmc2V0ID0gb2Zmc2V0OwotICAgICAgICBpbmZvLT5tSXNLZXkgPSAoZmxhZ3MgJiAweDEwKSAhPSAwOwotCi0gICAgICAgIGlmIChpbmZvLT5tSXNLZXkpIHsKLSAgICAgICAgICAgIHN0YXRpYyBjb25zdCBzaXplX3Qga01heE51bVN5bmNTYW1wbGVzVG9TY2FuID0gMjA7Ci0KLSAgICAgICAgICAgIGlmICh0cmFjay0+bU51bVN5bmNTYW1wbGVzIDwga01heE51bVN5bmNTYW1wbGVzVG9TY2FuKSB7Ci0gICAgICAgICAgICAgICAgaWYgKGNodW5rU2l6ZSA+IHRyYWNrLT5tVGh1bWJuYWlsU2FtcGxlU2l6ZSkgewotICAgICAgICAgICAgICAgICAgICB0cmFjay0+bVRodW1ibmFpbFNhbXBsZVNpemUgPSBjaHVua1NpemU7Ci0KLSAgICAgICAgICAgICAgICAgICAgdHJhY2stPm1UaHVtYm5haWxTYW1wbGVJbmRleCA9Ci0gICAgICAgICAgICAgICAgICAgICAgICB0cmFjay0+bVNhbXBsZXMuc2l6ZSgpIC0gMTsKLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgICsrdHJhY2stPm1OdW1TeW5jU2FtcGxlczsKLSAgICAgICAgfQotCi0gICAgICAgIGRhdGEgKz0gMTY7Ci0gICAgICAgIHNpemUgLT0gMTY7Ci0gICAgfQotCi0gICAgaWYgKCFtVHJhY2tzLmlzRW1wdHkoKSkgewotICAgICAgICBvZmY2NF90IG9mZnNldDsKLSAgICAgICAgc2l6ZV90IHNpemU7Ci0gICAgICAgIGJvb2wgaXNLZXk7Ci0gICAgICAgIGludDY0X3QgdGltZVVzOwotICAgICAgICBzdGF0dXNfdCBlcnIgPSBnZXRTYW1wbGVJbmZvKDAsIDAsICZvZmZzZXQsICZzaXplLCAmaXNLZXksICZ0aW1lVXMpOwotCi0gICAgICAgIGlmIChlcnIgIT0gT0spIHsKLSAgICAgICAgICAgIG1PZmZzZXRzQXJlQWJzb2x1dGUgPSAhbU9mZnNldHNBcmVBYnNvbHV0ZTsKLSAgICAgICAgICAgIGVyciA9IGdldFNhbXBsZUluZm8oMCwgMCwgJm9mZnNldCwgJnNpemUsICZpc0tleSwgJnRpbWVVcyk7Ci0KLSAgICAgICAgICAgIGlmIChlcnIgIT0gT0spIHsKLSAgICAgICAgICAgICAgICByZXR1cm4gZXJyOwotICAgICAgICAgICAgfQotICAgICAgICB9Ci0KLSAgICAgICAgQUxPR1YoIkNodW5rIG9mZnNldHMgYXJlICVzIiwKLSAgICAgICAgICAgICBtT2Zmc2V0c0FyZUFic29sdXRlID8gImFic29sdXRlIiA6ICJtb3ZpZS1jaHVuayByZWxhdGl2ZSIpOwotICAgIH0KLQotICAgIGZvciAoc2l6ZV90IGkgPSAwOyBpIDwgbVRyYWNrcy5zaXplKCk7ICsraSkgewotICAgICAgICBUcmFjayAqdHJhY2sgPSAmbVRyYWNrcy5lZGl0SXRlbUF0KGkpOwotCi0gICAgICAgIGlmICh0cmFjay0+bUJ5dGVzUGVyU2FtcGxlID4gMCkgewotICAgICAgICAgICAgLy8gQXNzdW1lIGFsbCBjaHVua3MgYXJlIHJvdWdobHkgdGhlIHNhbWUgc2l6ZSBmb3Igbm93LgotCi0gICAgICAgICAgICAvLyBDb21wdXRlIHRoZSBhdmcuIHNpemUgb2YgdGhlIGZpcnN0IDEyOCBjaHVua3MgKGlmIHRoZXJlIGFyZQotICAgICAgICAgICAgLy8gdGhhdCBtYW55KSwgYnV0IGV4Y2x1ZGUgdGhlIHNpemUgb2YgdGhlIGZpcnN0IG9uZSwgc2luY2UKLSAgICAgICAgICAgIC8vIGl0IG1heSBiZSBhbiBvdXRsaWVyLgotICAgICAgICAgICAgc2l6ZV90IG51bVNhbXBsZXNUb0F2ZXJhZ2UgPSB0cmFjay0+bVNhbXBsZXMuc2l6ZSgpOwotICAgICAgICAgICAgaWYgKG51bVNhbXBsZXNUb0F2ZXJhZ2UgPiAyNTYpIHsKLSAgICAgICAgICAgICAgICBudW1TYW1wbGVzVG9BdmVyYWdlID0gMjU2OwotICAgICAgICAgICAgfQotCi0gICAgICAgICAgICBkb3VibGUgYXZnQ2h1bmtTaXplID0gMDsKLSAgICAgICAgICAgIHNpemVfdCBqOwotICAgICAgICAgICAgZm9yIChqID0gMDsgaiA8PSBudW1TYW1wbGVzVG9BdmVyYWdlOyArK2opIHsKLSAgICAgICAgICAgICAgICBvZmY2NF90IG9mZnNldDsKLSAgICAgICAgICAgICAgICBzaXplX3Qgc2l6ZTsKLSAgICAgICAgICAgICAgICBib29sIGlzS2V5OwotICAgICAgICAgICAgICAgIGludDY0X3QgZHVtbXk7Ci0KLSAgICAgICAgICAgICAgICBzdGF0dXNfdCBlcnIgPQotICAgICAgICAgICAgICAgICAgICBnZXRTYW1wbGVJbmZvKAotICAgICAgICAgICAgICAgICAgICAgICAgICAgIGksIGosCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgJm9mZnNldCwgJnNpemUsICZpc0tleSwgJmR1bW15KTsKLQotICAgICAgICAgICAgICAgIGlmIChlcnIgIT0gT0spIHsKLSAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGVycjsKLSAgICAgICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgICAgICBpZiAoaiA9PSAwKSB7Ci0gICAgICAgICAgICAgICAgICAgIHRyYWNrLT5tRmlyc3RDaHVua1NpemUgPSBzaXplOwotICAgICAgICAgICAgICAgICAgICBjb250aW51ZTsKLSAgICAgICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgICAgICBhdmdDaHVua1NpemUgKz0gc2l6ZTsKLSAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgYXZnQ2h1bmtTaXplIC89IG51bVNhbXBsZXNUb0F2ZXJhZ2U7Ci0KLSAgICAgICAgICAgIHRyYWNrLT5tQXZnQ2h1bmtTaXplID0gYXZnQ2h1bmtTaXplOwotICAgICAgICB9Ci0KLSAgICAgICAgaW50NjRfdCBkdXJhdGlvblVzOwotICAgICAgICBDSEVDS19FUSgoc3RhdHVzX3QpT0ssCi0gICAgICAgICAgICAgICAgIGdldFNhbXBsZVRpbWUoaSwgdHJhY2stPm1TYW1wbGVzLnNpemUoKSAtIDEsICZkdXJhdGlvblVzKSk7Ci0KLSAgICAgICAgQUxPR1YoInRyYWNrICVkIGR1cmF0aW9uID0gJS4yZiBzZWNzIiwgaSwgZHVyYXRpb25VcyAvIDFFNik7Ci0KLSAgICAgICAgdHJhY2stPm1NZXRhLT5zZXRJbnQ2NChrS2V5RHVyYXRpb24sIGR1cmF0aW9uVXMpOwotICAgICAgICB0cmFjay0+bU1ldGEtPnNldEludDMyKGtLZXlNYXhJbnB1dFNpemUsIHRyYWNrLT5tTWF4U2FtcGxlU2l6ZSk7Ci0KLSAgICAgICAgY29uc3QgY2hhciAqdG1wOwotICAgICAgICBDSEVDSyh0cmFjay0+bU1ldGEtPmZpbmRDU3RyaW5nKGtLZXlNSU1FVHlwZSwgJnRtcCkpOwotCi0gICAgICAgIEFTdHJpbmcgbWltZSA9IHRtcDsKLQotICAgICAgICBpZiAoIXN0cm5jYXNlY21wKCJ2aWRlby8iLCBtaW1lLmNfc3RyKCksIDYpKSB7Ci0gICAgICAgICAgICBpZiAodHJhY2stPm1UaHVtYm5haWxTYW1wbGVJbmRleCA+PSAwKSB7Ci0gICAgICAgICAgICAgICAgaW50NjRfdCB0aHVtYm5haWxUaW1lVXM7Ci0gICAgICAgICAgICAgICAgQ0hFQ0tfRVEoKHN0YXR1c190KU9LLAotICAgICAgICAgICAgICAgICAgICAgICAgIGdldFNhbXBsZVRpbWUoaSwgdHJhY2stPm1UaHVtYm5haWxTYW1wbGVJbmRleCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICZ0aHVtYm5haWxUaW1lVXMpKTsKLQotICAgICAgICAgICAgICAgIHRyYWNrLT5tTWV0YS0+c2V0SW50NjQoa0tleVRodW1ibmFpbFRpbWUsIHRodW1ibmFpbFRpbWVVcyk7Ci0gICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgIHN0YXR1c190IGVyciA9IE9LOwotCi0gICAgICAgICAgICBpZiAoIXN0cmNhc2VjbXAobWltZS5jX3N0cigpLCBNRURJQV9NSU1FVFlQRV9WSURFT19NUEVHNCkpIHsKLSAgICAgICAgICAgICAgICBlcnIgPSBhZGRNUEVHNENvZGVjU3BlY2lmaWNEYXRhKGkpOwotICAgICAgICAgICAgfSBlbHNlIGlmICghc3RyY2FzZWNtcChtaW1lLmNfc3RyKCksIE1FRElBX01JTUVUWVBFX1ZJREVPX0FWQykpIHsKLSAgICAgICAgICAgICAgICBlcnIgPSBhZGRIMjY0Q29kZWNTcGVjaWZpY0RhdGEoaSk7Ci0gICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgIGlmIChlcnIgIT0gT0spIHsKLSAgICAgICAgICAgICAgICByZXR1cm4gZXJyOwotICAgICAgICAgICAgfQotICAgICAgICB9Ci0gICAgfQotCi0gICAgbUZvdW5kSW5kZXggPSB0cnVlOwotCi0gICAgcmV0dXJuIE9LOwotfQotCi1zdGF0aWMgc2l6ZV90IEdldFNpemVXaWR0aChzaXplX3QgeCkgewotICAgIHNpemVfdCBuID0gMTsKLSAgICB3aGlsZSAoeCA+IDEyNykgewotICAgICAgICArK247Ci0gICAgICAgIHggPj49IDc7Ci0gICAgfQotICAgIHJldHVybiBuOwotfQotCi1zdGF0aWMgdWludDhfdCAqRW5jb2RlU2l6ZSh1aW50OF90ICpkc3QsIHNpemVfdCB4KSB7Ci0gICAgd2hpbGUgKHggPiAxMjcpIHsKLSAgICAgICAgKmRzdCsrID0gKHggJiAweDdmKSB8IDB4ODA7Ci0gICAgICAgIHggPj49IDc7Ci0gICAgfQotICAgICpkc3QrKyA9IHg7Ci0g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VCkgewotICAgICAgICAqc2FtcGxlSW5kZXggPSBjbG9zZXN0U2FtcGxlSW5kZXg7Ci0KLSAgICAgICAgcmV0dXJuIE9LOwotICAgIH0KLQotICAgIHNzaXplX3QgcHJldlN5bmNTYW1wbGVJbmRleCA9IGNsb3Nlc3RTYW1wbGVJbmRleDsKLSAgICB3aGlsZSAocHJldlN5bmNTYW1wbGVJbmRleCA+PSAwKSB7Ci0gICAgICAgIGNvbnN0IFNhbXBsZUluZm8gJmluZm8gPQotICAgICAgICAgICAgdHJhY2subVNhbXBsZXMuaXRlbUF0KHByZXZTeW5jU2FtcGxlSW5kZXgpOwotCi0gICAgICAgIGlmIChpbmZvLm1Jc0tleSkgewotICAgICAgICAgICAgYnJlYWs7Ci0gICAgICAgIH0KLQotICAgICAgICAtLXByZXZTeW5jU2FtcGxlSW5kZXg7Ci0gICAgfQotCi0gICAgc3NpemVfdCBuZXh0U3luY1NhbXBsZUluZGV4ID0gY2xvc2VzdFNhbXBsZUluZGV4OwotICAgIHdoaWxlIChuZXh0U3luY1NhbXBsZUluZGV4IDwgbnVtU2FtcGxlcykgewotICAgICAgICBjb25zdCBTYW1wbGVJbmZvICZpbmZvID0KLSAgICAgICAgICAgIHRyYWNrLm1TYW1wbGVzLml0ZW1BdChuZXh0U3luY1NhbXBsZUluZGV4KTsKLQotICAgICAgICBpZiAoaW5mby5tSXNLZXkpIHsKLSAgICAgICAgICAgIGJyZWFrOwotICAgICAgICB9Ci0KLSAgICAgICAgKytuZXh0U3luY1NhbXBsZUluZGV4OwotICAgIH0KLQotICAgIHN3aXRjaCAobW9kZSkgewotICAgICAgICBjYXNlIE1lZGlhU291cmNlOjpSZWFkT3B0aW9uczo6U0VFS19QUkVWSU9VU19TWU5DOgotICAgICAgICB7Ci0gICAgICAgICAgICAqc2FtcGxlSW5kZXggPSBwcmV2U3luY1NhbXBsZUluZGV4OwotCi0gICAgICAgICAgICByZXR1cm4gcHJldlN5bmNTYW1wbGVJbmRleCA+PSAwID8gT0sgOiBVTktOT1dOX0VSUk9SOwotICAgICAgICB9Ci0KLSAgICAgICAgY2FzZSBNZWRpYVNvdXJjZTo6UmVhZE9wdGlvbnM6OlNFRUtfTkVYVF9TWU5DOgotICAgICAgICB7Ci0gICAgICAgICAgICAqc2FtcGxlSW5kZXggPSBuZXh0U3luY1NhbXBsZUluZGV4OwotCi0gICAgICAgICAgICByZXR1cm4gbmV4dFN5bmNTYW1wbGVJbmRleCA8IG51bVNhbXBsZXMgPyBPSyA6IFVOS05PV05fRVJST1I7Ci0gICAgICAgIH0KLQotICAgICAgICBjYXNlIE1lZGlhU291cmNlOjpSZWFkT3B0aW9uczo6U0VFS19DTE9TRVNUX1NZTkM6Ci0gICAgICAgIHsKLSAgICAgICAgICAgIGlmIChwcmV2U3luY1NhbXBsZUluZGV4IDwgMCAmJiBuZXh0U3luY1NhbXBsZUluZGV4ID49IG51bVNhbXBsZXMpIHsKLSAgICAgICAgICAgICAgICByZXR1cm4gVU5LTk9XTl9FUlJPUjsKLSAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgaWYgKHByZXZTeW5jU2FtcGxlSW5kZXggPCAwKSB7Ci0gICAgICAgICAgICAgICAgKnNhbXBsZUluZGV4ID0gbmV4dFN5bmNTYW1wbGVJbmRleDsKLSAgICAgICAgICAgICAgICByZXR1cm4gT0s7Ci0gICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgIGlmIChuZXh0U3luY1NhbXBsZUluZGV4ID49IG51bVNhbXBsZXMpIHsKLSAgICAgICAgICAgICAgICAqc2FtcGxlSW5kZXggPSBwcmV2U3luY1NhbXBsZUluZGV4OwotICAgICAgICAgICAgICAgIHJldHVybiBPSzsKLSAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgc2l6ZV90IGRpc3QxID0gY2xvc2VzdFNhbXBsZUluZGV4IC0gcHJldlN5bmNTYW1wbGVJbmRleDsKLSAgICAgICAgICAgIHNpemVfdCBkaXN0MiA9IG5leHRTeW5jU2FtcGxlSW5kZXgg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KLSAgICAgICAgcmV0dXJuIHRydWU7Ci0gICAgfQotCi0gICAgcmV0dXJuIGZhbHNlOwotfQotCi19ICAvLyBuYW1lc3BhY2UgYW5kcm9pZApkaWZmIC0tZ2l0IGEvbWVkaWEvbGlic3RhZ2VmcmlnaHQvQW5kcm9pZC5tayBiL21lZGlhL2xpYnN0YWdlZnJpZ2h0L0FuZHJvaWQubWsKZGVsZXRlZCBmaWxlIG1vZGUgMTAwNjQ0CmluZGV4IDg5NDhhYmIuLjAwMDAwMDAKLS0tIGEvbWVkaWEvbGlic3RhZ2VmcmlnaHQvQW5kcm9pZC5taworKysgL2Rldi9udWxsCkBAIC0xLDEyNyArMCwwIEBACi1MT0NBTF9QQVRIOj0gJChjYWxsIG15LWRpcikKLWluY2x1ZGUgJChDTEVBUl9WQVJTKQotCi1pbmNsdWRlIGZyYW1ld29ya3MvYmFzZS9tZWRpYS9saWJzdGFnZWZyaWdodC9jb2RlY3MvY29tbW9uL0NvbmZpZy5tawotCi1MT0NBTF9TUkNfRklMRVM6PSAgICAgICAgICAgICAgICAgICAgICAgICBcCi0gICAgICAgIEFDb2RlYy5jcHAgICAgICAgICAgICAgICAgICAgICAgICBcCi0gICAgICAgIEFBQ0V4dHJhY3Rvci5jcHAgICAgICAgICAgICAgICAgICBcCi0gICAgICAgIEFBQ1dyaXRlci5jcHAgICAgICAgICAgICAgICAgICAgICBcCi0gICAgICAgIEFNUkV4dHJhY3Rvci5jcHAgICAgICAgICAgICAgICAgICBcCi0gICAgICAgIEFNUldyaXRlci5jcHAgICAgICAgICAgICAgICAgICAgICBcCi0gICAgICAgIEFWSUV4dHJhY3Rvci5jcHAgICAgICAgICAgICAgICAgICBcCi0gICAgICAgIEF1ZGlvUGxheWVyLmNwcCAgICAgICAgICAgICAgICAgICBcCi0gICAgICAgIEF1ZGlvU291cmNlLmNwcCAgICAgICAgICAgICAgICAgICBcCi0gICAgICAgIEF3ZXNvbWVQbGF5ZXIuY3BwICAgICAgICAgICAgICAgICBcCi0gICAgICAgIENhbWVyYVNvdXJjZS5jcHAgICAgICAgICAgICAgICAgICBcCi0gICAgICAgIENhbWVyYVNvdXJjZVRpbWVMYXBzZS5jcHAgICAgICAgICBcCi0gICAgICAgIFZpZGVvU291cmNlRG93blNhbXBsZXIuY3BwICAgICAgICBcCi0gICAgICAgIERhdGFTb3VyY2UuY3BwICAgICAgICAgICAgICAgICAgICBcCi0gICAgICAgIERSTUV4dHJhY3Rvci5jcHAgICAgICAgICAgICAgICAgICBcCi0gICAgICAgIEVTRFMuY3BwICAgICAgICAgICAgICAgICAgICAgICAgICBcCi0gICAgICAgIEZpbGVTb3VyY2UuY3BwICAgICAgICAgICAgICAgICAgICBcCi0gICAgICAgIEZMQUNFeHRyYWN0b3IuY3BwICAgICAgICAgICAgICAgICBcCi0gICAgICAgIEhUVFBCYXNlLmNwcCAgICAgICAgICAgICAgICAgICAgICBcCi0gICAgICAgIEpQRUdTb3VyY2UuY3BwICAgICAgICAgICAgICAgICAgICBcCi0gICAgICAgIE1QM0V4dHJhY3Rvci5jcHAgICAgICAgICAgICAgICAgICBcCi0gICAgICAgIE1QRUcyVFNXcml0ZXIuY3BwICAgICAgICAgICAgICAgICBcCi0gICAgICAgIE1QRUc0RXh0cmFjdG9yLmNwcCAgICAgICAgICAgICAgICBcCi0gICAgICAgIE1QRUc0V3JpdGVyLmNwcCAgICAgICAgICAgICAgICAgICBcCi0gICAgICAgIE1lZGlhQnVmZmVyLmNwcCAgICAgICAgICAgICAgICAgICBcCi0gICAgICAgIE1lZGlhQnVmZmVyR3JvdXAuY3BwICAgICAgICAgICAgICBcCi0gICAgICAgIE1lZGlhQ29kZWMuY3BwICAgICAgICAgICAgICAgICAgICBcCi0gICAgICAgIE1lZGlhQ29kZWNMaXN0LmNwcCAgICAgICAgICAgICAgICBcCi0gICAgICAgIE1lZGlhRGVmcy5jcHAgICAgICAgICAgICAgICAgICAgICBcCi0gICAgICAgIE1lZGlhRXh0cmFjdG9yLmNwcCAgICAgICAgICAgICAgICBcCi0gICAgICAgIE1lZGlhU291cmNlLmNwcCAgICAgICAgICAgICAgICAgICBcCi0gICAgICAgIE1ldGFEYXRhLmNwcCAgICAgICAgICAgICAgICAgICAgICBcCi0gICAgICAgIE51Q2FjaGVkU291cmNlMi5jcHAgICAgICAgICAgICAgICBcCi0gICAgICAgIE51TWVkaWFFeHRyYWN0b3IuY3BwICAgICAgICAgICAgICBcCi0gICAgICAgIE9NWENsaWVudC5jcHAgICAgICAgICAgICAgICAgICAgICBcCi0gICAgICAgIE9NWENvZGVjLmNwcCAgICAgICAgICAgICAgICAgICAgICBcCi0gICAgICAgIE9nZ0V4dHJhY3Rvci5jcHAgICAgICAgICAgICAgICAgICBcCi0gICAgICAgIFNhbXBsZUl0ZXJhdG9yLmNwcCAgICAgICAgICAgICAgICBcCi0gICAgICAgIFNhbXBsZVRhYmxlLmNwcCAgICAgICAgICAgICAgICAgICBcCi0gICAgICAgIFNraXBDdXRCdWZmZXIuY3BwICAgICAgICAgICAgICAgICBcCi0gICAgICAgIFN0YWdlZnJpZ2h0TWVkaWFTY2FubmVyLmNwcCAgICAgICBcCi0gICAgICAgIFN0YWdlZnJpZ2h0TWV0YWRhdGFSZXRyaWV2ZXIuY3BwICBcCi0gICAgICAgIFN1cmZhY2VNZWRpYVNvdXJjZS5jcHAgICAgICAgICAgICBcCi0gICAgICAgIFRocm90dGxlZFNvdXJjZS5jcHAgICAgICAgICAgICAgICBcCi0gICAgICAgIFRpbWVTb3VyY2UuY3BwICAgICAgICAgICAgICAgICAgICBcCi0gICAgICAgIFRpbWVkRXZlbnRRdWV1ZS5jcHAgICAgICAgICAgICAgICBcCi0gICAgICAgIFV0aWxzLmNwcCAgICAgICAgICAgICAgICAgICAgICAgICBcCi0gICAgICAgIFZCUklTZWVrZXIuY3BwICAgICAgICAgICAgICAgICAgICBcCi0gICAgICAgIFdBVkV4dHJhY3Rvci5jcHAgICAgICAgICAgICAgICAgICBcCi0gICAgICAgIFdWTUV4dHJhY3Rvci5jcHAgICAgICAgICAgICAgICAgICBcCi0gICAgICAgIFhJTkdTZWVrZXIuY3BwICAgICAgICAgICAgICAgICAgICBcCi0gICAgICAgIGF2Y191dGlscy5jcHAgICAgICAgICAgICAgICAgICAgICBcCi0KLUxPQ0FMX0NfSU5DTFVERVM6PSBcCi0gICAgICAgICQoVE9QKS9mcmFtZXdvcmtzL2Jhc2UvaW5jbHVkZS9tZWRpYS9zdGFnZWZyaWdodC90aW1lZHRleHQgXAotICAgICAgICAkKFRPUCkvZnJhbWV3b3Jrcy9uYXRpdmUvaW5jbHVkZS9tZWRpYS9oYXJkd2FyZSBcCi0gICAgICAgICQoVE9QKS9mcmFtZXdvcmtzL25hdGl2ZS9pbmNsdWRlL21lZGlhL29wZW5tYXggXAotICAgICAgICAkKFRPUCkvZXh0ZXJuYWwvZXhwYXQvbGliIFwKLSAgICAgICAgJChUT1ApL2V4dGVybmFsL2ZsYWMvaW5jbHVkZSBcCi0gICAgICAgICQoVE9QKS9leHRlcm5hbC90cmVtb2xvIFwKLSAgICAgICAgJChUT1ApL2V4dGVybmFsL29wZW5zc2wvaW5jbHVkZSBcCi0KLUxPQ0FMX1NIQVJFRF9MSUJSQVJJRVMgOj0gXAotICAgICAgICBsaWJiaW5kZXIgXAotICAgICAgICBsaWJjYW1lcmFfY2xpZW50IFwKLSAgICAgICAgbGliY3J5cHRvIFwKLSAgICAgICAgbGliY3V0aWxzIFwKLSAgICAgICAgbGliZGwgXAotICAgICAgICBsaWJkcm1mcmFtZXdvcmsgXAotICAgICAgICBsaWJleHBhdCBcCi0gICAgICAgIGxpYmd1aSBcCi0gICAgICAgIGxpYmljdWkxOG4gXAotICAgICAgICBsaWJpY3V1YyBcCi0gICAgICAgIGxpYmxvZyBcCi0gICAgICAgIGxpYm1lZGlhIFwKLSAgICAgICAgbGlibWVkaWFfbmF0aXZlIFwKLSAgICAgICAgbGlic29uaXZveCBcCi0gICAgICAgIGxpYnNzbCBcCi0gICAgICAgIGxpYnN0YWd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fdCBhdWRpb01hc2sgPSBjaGFubmVsTWFzayA9PSBDSEFOTkVMX01BU0tfVVNFX0NIQU5ORUxfT1JERVIgPwotICAgICAgICAgICAgICAgIGF1ZGlvX2NoYW5uZWxfb3V0X21hc2tfZnJvbV9jb3VudChudW1DaGFubmVscykgOiBjaGFubmVsTWFzazsKLSAgICAgICAgaWYgKDAgPT0gYXVkaW9NYXNrKSB7Ci0gICAgICAgICAgICByZXR1cm4gQkFEX1ZBTFVFOwotICAgICAgICB9Ci0KLSAgICAgICAgbUF1ZGlvVHJhY2sgPSBuZXcgQXVkaW9UcmFjaygKLSAgICAgICAgICAgICAgICBBVURJT19TVFJFQU1fTVVTSUMsIG1TYW1wbGVSYXRlLCBBVURJT19GT1JNQVRfUENNXzE2X0JJVCwgYXVkaW9NYXNrLAotICAgICAgICAgICAgICAgIDAsIEFVRElPX1BPTElDWV9PVVRQVVRfRkxBR19OT05FLCAmQXVkaW9DYWxsYmFjaywgdGhpcywgMCk7Ci0KLSAgICAgICAgaWYgKChlcnIgPSBtQXVkaW9UcmFjay0+aW5pdENoZWNrKCkpICE9IE9LKSB7Ci0gICAgICAgICAgICBkZWxldGUgbUF1ZGlvVHJhY2s7Ci0gICAgICAgICAgICBtQXVkaW9UcmFjayA9IE5VTEw7Ci0KLSAgICAgICAgICAgIGlmIChtRmlyc3RCdWZmZXIgIT0gTlVMTCkgewotICAgICAgICAgICAgICAgIG1GaXJzdEJ1ZmZlci0+cmVsZWFzZSgpOwotICAgICAgICAgICAgICAgIG1GaXJzdEJ1ZmZlciA9IE5VTEw7Ci0gICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgIGlmICghc291cmNlQWxyZWFkeVN0YXJ0ZWQpIHsKLSAgICAgICAgICAgICAgICBtU291cmNlLT5zdG9wKCk7Ci0gICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgIHJldHVybiBlcnI7Ci0gICAgICAgIH0KLQotICAgICAgICBtTGF0ZW5jeVVzID0gKGludDY0X3QpbUF1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ci0gICAgfQotCi0gICAgYm9vbCBwb3N0U2Vla0NvbXBsZXRlID0gZmFsc2U7Ci0gICAgYm9vbCBwb3N0RU9TID0gZmFsc2U7Ci0gICAgaW50NjRfdCBwb3N0RU9TRGVsYXlVcyA9IDA7Ci0KLSAgICBzaXplX3Qgc2l6ZV9kb25lID0gMDsKLSAgICBzaXplX3Qgc2l6ZV9yZW1haW5pbmcgPSBzaXplOwotICAgIHdoaWxlIChzaXplX3JlbWFpbmluZyA+IDApIHsKLSAgICAgICAgTWVkaWFTb3VyY2U6OlJlYWRPcHRpb25zIG9wdGlvbnM7Ci0KLSAgICAgICAgewotICAgICAgICAgICAgTXV0ZXg6OkF1dG9sb2NrIGF1dG9Mb2NrKG1Mb2NrKTsKLQotICAgICAgICAgICAgaWYgKG1TZWVraW5nKSB7Ci0gICAgICAgICAgICAgICAgaWYgKG1Jc0ZpcnN0QnVmZmVyKSB7Ci0gICAgICAgICAgICAgICAgICAgIGlmIChtRmlyc3RCdWZmZXIgIT0gTlVMTCkgewotICAgICAgICAgICAgICAgICAgICAgICAgbUZpcnN0QnVmZmVyLT5yZWxlYXNlKCk7Ci0gICAgICAgICAgICAgICAgICAgICAgICBtRmlyc3RCdWZmZXIgPSBOVUxMOwotICAgICAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgICAgIG1Jc0ZpcnN0QnVmZmVyID0gZmFsc2U7Ci0gICAgICAgICAgICAgICAgfQotCi0gICAgICAgICAgICAgICAgb3B0aW9ucy5zZXRTZWVrVG8obVNlZWtUaW1lVXMpOwotCi0gICAgICAgICAgICAgICAgaWYgKG1JbnB1dEJ1ZmZlciAhPSBOVUxMKSB7Ci0gICAgICAgICAgICAgICAgICAgIG1JbnB1dEJ1ZmZlci0+cmVsZWFzZSgpOwotICAgICAgICAgICAgICAgICAgICBtSW5wdXRCdWZmZXIgPSBOVUxMOwotICAgICAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgICAgIG1TZWVraW5nID0gZmFsc2U7Ci0gICAgICAgICAgICAgICAgaWYgKG1PYnNlcnZlcikgewotICAgICAgICAgICAgICAgICAgICBwb3N0U2Vla0NvbXBsZXRlID0gdHJ1ZTsKLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICB9Ci0gICAgICAgIH0KLQotICAgICAgICBpZiAobUlucHV0QnVmZmVyID09IE5VTEwpIHsKLSAgICAgICAgICAgIHN0YXR1c190IGVycjsKLQotICAgICAgICAgICAgaWYgKG1Jc0ZpcnN0QnVmZmVyKSB7Ci0gICAgICAgICAgICAgICAgbUlucHV0QnVmZmVyID0gbUZpcnN0QnVmZmVyOwotICAgICAgICAgICAgICAgIG1GaXJzdEJ1ZmZlciA9IE5VTEw7Ci0gICAgICAgICAgICAgICAgZXJyID0gbUZpcnN0QnVmZmVyUmVzdWx0OwotCi0gICAgICAgICAgICAgICAgbUlzRmlyc3RCdWZmZXIgPSBmYWxzZTsKLSAgICAgICAgICAgIH0gZWxzZSB7Ci0gICAgICAgICAgICAgICAgZXJyID0gbVNvdXJjZS0+cmVhZCgmbUlucHV0QnVmZmVyLCAmb3B0aW9ucyk7Ci0gICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgIENIRUNLKChlcnIgPT0gT0sgJiYgbUlucHV0QnVmZmVyICE9IE5VTEwpCi0gICAgICAgICAgICAgICAgICAgfHwgKGVyciAhPSBPSyAmJiBtSW5wdXRCdWZmZXIgPT0gTlVMTCkpOwotCi0gICAgICAgICAgICBNdXRleDo6QXV0b2xvY2sgYXV0b0xvY2sobUxvY2spOwotCi0gICAgICAgICAgICBpZiAoZXJyICE9IE9LKSB7Ci0gICAgICAgICAgICAgICAgaWYgKG1PYnNlcnZlciAmJiAhbVJlYWNoZWRFT1MpIHsKLSAgICAgICAgICAgICAgICAgICAgLy8gV2UgZG9uJ3Qgd2FudCB0byBwb3N0IEVPUyByaWdodCBhd2F5IGJ1dCBvbmx5Ci0gICAgICAgICAgICAgICAgICAgIC8vIGFmdGVyIGFsbCBmcmFtZXMgaGF2ZSBhY3R1YWxseSBiZWVuIHBsYXllZCBvdXQuCi0KLSAgICAgICAgICAgICAgICAgICAgLy8gVGhlc2UgYXJlIHRoZSBudW1iZXIgb2YgZnJhbWVzIHN1Ym1pdHRlZCB0byB0aGUKLSAgICAgICAgICAgICAgICAgICAgLy8gQXVkaW9UcmFjayB0aGF0IHlvdSBoYXZlbid0IGhlYXJkIHlldC4KLSAgICAgICAgICAgICAgICAgICAgdWludDMyX3QgbnVtRnJhbWVzUGVuZGluZ1BsYXlvdXQgPQotICAgICAgICAgICAgICAgICAgICAgICAgZ2V0TnVtRnJhbWVzUGVuZGluZ1BsYXlvdXQoKTsKLQotICAgICAgICAgICAgICAgICAgICAvLyBUaGVzZSBhcmUgdGhlIG51bWJlciBvZiBmcmFtZXMgd2UncmUgZ29pbmcgdG8KLSAgICAgICAgICAgICAgICAgICAgLy8gc3VibWl0IHRvIHRoZSBBdWRpb1RyYWNrIGJ5IHJldHVybmluZyBmcm9tIHRoaXMKLSAgICAgICAgICAgICAgICAgICAgLy8gY2FsbGJhY2suCi0gICAgICAgICAgICAgICAgICAgIHVpbnQzMl90IG51bUFkZGl0aW9uYWxGcmFtZXMgPSBzaXplX2RvbmUgLyBtRnJhbWVTaXplOwotCi0gICAgICAgICAgICAgICAgICAgIG51bUZyYW1lc1BlbmRpbmdQbGF5b3V0ICs9IG51bUFkZGl0aW9uYWxGcmFtZXM7Ci0KLSAgICAgICAgICAgICAgICAgICAgaW50NjRfdCB0aW1lVG9Db21wbGV0aW9uVXMgPQotICAgICAgICAgICAgICAgICAgICAgICAgKDEwMDAwMDBsbCAqIG51bUZyYW1lc1BlbmRpbmdQbGF5b3V0KSAvIG1TYW1wbGVSYXRlOwotCi0gICAgICAgICAgICAgICAgICAgIEFMT0dWKCJ0b3RhbCBudW1iZXIgb2YgZnJhbWVzIHBsYXllZDogJWxsZCAoJWxsZCB1cykiLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgIChtTnVtRnJhbWVzUGxheWVkICsgbnVtQWRkaXRpb25hbEZyYW1lcyksCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgMTAwMDAwMGxsICogKG1OdW1GcmFtZXNQbGF5ZWQgKyBudW1BZGRpdGlvbmFsRnJhbWVzKQotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvIG1TYW1wbGVSYXRlKTsKLQotICAgICAgICAgICAgICAgICAgICBBTE9HVigiJWQgZnJhbWVzIGxlZnQgdG8gcGxheSwgJWxsZCB1cyAoJS4yZiBzZWNzKSIsCi0gICAgICAgICAgICAgICAgICAgICAgICAgbnVtRnJhbWVzUGVuZGluZ1BsYXlvdXQsCi0gICAgICAgICAgICAgICAgICAgICAgICAgdGltZVRvQ29tcGxldGlvblVzLCB0aW1lVG9Db21wbGV0aW9uVXMgLyAxRTYpOwotCi0gICAgICAgICAgICAgICAgICAgIHBvc3RFT1MgPSB0cnVlOwotICAgICAgICAgICAgICAgICAgICBpZiAobUF1ZGlvU2luay0+bmVlZHNUcmFpbGluZ1BhZGRpbmcoKSkgewotICAgICAgICAgICAgICAgICAgICAgICAgcG9zdEVPU0RlbGF5VXMgPSB0aW1lVG9Db21wbGV0aW9uVXMgKyBtTGF0ZW5jeVVzOwotICAgICAgICAgICAgICAgICAgICB9IGVsc2UgewotICAgICAgICAgICAgICAgICAgICAgICAgcG9zdEVPU0RlbGF5VXMgPSAwOwotICAgICAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgfQotCi0gICAgICAgICAgICAgICAgbVJlYWNoZWRFT1MgPSB0cnVlOwotICAgICAgICAgICAgICAgIG1GaW5hbFN0YXR1cyA9IGVycjsKLSAgICAgICAgICAgICAgICBicmVhazsKLSAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgaWYgKG1BdWRpb1NpbmsgIT0gTlVMTCkgewotICAgICAgICAgICAgICAgIG1MYXRlbmN5VXMgPSAoaW50NjRfdCltQXVkaW9TaW5rLT5sYXRlbmN5KCkgKiAxMDAwOwotICA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aWYgKCFoYXZlVmlkZW8gJiYgIXN0cm5jYXNlY21wKG1pbWUuc3RyaW5nKCksICJ2aWRlby8iLCA2KSkgewotICAgICAgICAgICAgc2V0VmlkZW9Tb3VyY2UoZXh0cmFjdG9yLT5nZXRUcmFjayhpKSk7Ci0gICAgICAgICAgICBoYXZlVmlkZW8gPSB0cnVlOwotCi0gICAgICAgICAgICAvLyBTZXQgdGhlIHByZXNlbnRhdGlvbi9kaXNwbGF5IHNpemUKLSAgICAgICAgICAgIGludDMyX3QgZGlzcGxheVdpZHRoLCBkaXNwbGF5SGVpZ2h0OwotICAgICAgICAgICAgYm9vbCBzdWNjZXNzID0gbWV0YS0+ZmluZEludDMyKGtLZXlEaXNwbGF5V2lkdGgsICZkaXNwbGF5V2lkdGgpOwotICAgICAgICAgICAgaWYgKHN1Y2Nlc3MpIHsKLSAgICAgICAgICAgICAgICBzdWNjZXNzID0gbWV0YS0+ZmluZEludDMyKGtLZXlEaXNwbGF5SGVpZ2h0LCAmZGlzcGxheUhlaWdodCk7Ci0gICAgICAgICAgICB9Ci0gICAgICAgICAgICBpZiAoc3VjY2VzcykgewotICAgICAgICAgICAgICAgIG1EaXNwbGF5V2lkdGggPSBkaXNwbGF5V2lkdGg7Ci0gICAgICAgICAgICAgICAgbURpc3BsYXlIZWlnaHQgPSBkaXNwbGF5SGVpZ2h0OwotICAgICAgICAgICAgfQotCi0gICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgTXV0ZXg6OkF1dG9sb2NrIGF1dG9Mb2NrKG1TdGF0c0xvY2spOwotICAgICAgICAgICAgICAgIG1TdGF0cy5tVmlkZW9UcmFja0luZGV4ID0gbVN0YXRzLm1UcmFja3Muc2l6ZSgpOwotICAgICAgICAgICAgICAgIG1TdGF0cy5tVHJhY2tzLnB1c2goKTsKLSAgICAgICAgICAgICAgICBUcmFja1N0YXQgKnN0YXQgPQotICAgICAgICAgICAgICAgICAgICAmbVN0YXRzLm1UcmFja3MuZWRpdEl0ZW1BdChtU3RhdHMubVZpZGVvVHJhY2tJbmRleCk7Ci0gICAgICAgICAgICAgICAgc3RhdC0+bU1JTUUgPSBtaW1lLnN0cmluZygpOwotICAgICAgICAgICAgfQotICAgICAgICB9IGVsc2UgaWYgKCFoYXZlQXVkaW8gJiYgIXN0cm5jYXNlY21wKG1pbWUuc3RyaW5nKCksICJhdWRpby8iLCA2KSkgewotICAgICAgICAgICAgc2V0QXVkaW9Tb3VyY2UoZXh0cmFjdG9yLT5nZXRUcmFjayhpKSk7Ci0gICAgICAgICAgICBoYXZlQXVkaW8gPSB0cnVlOwotCi0gICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgTXV0ZXg6OkF1dG9sb2NrIGF1dG9Mb2NrKG1TdGF0c0xvY2spOwotICAgICAgICAgICAgICAgIG1TdGF0cy5tQXVkaW9UcmFja0luZGV4ID0gbVN0YXRzLm1UcmFja3Muc2l6ZSgpOwotICAgICAgICAgICAgICAgIG1TdGF0cy5tVHJhY2tzLnB1c2goKTsKLSAgICAgICAgICAgICAgICBUcmFja1N0YXQgKnN0YXQgPQotICAgICAgICAgICAgICAgICAgICAmbVN0YXRzLm1UcmFja3MuZWRpdEl0ZW1BdChtU3RhdHMubUF1ZGlvVHJhY2tJbmRleCk7Ci0gICAgICAgICAgICAgICAgc3RhdC0+bU1JTUUgPSBtaW1lLnN0cmluZygpOwotICAgICAgICAgICAgfQotCi0gICAgICAgICAgICBpZiAoIXN0cmNhc2VjbXAobWltZS5zdHJpbmcoKSwgTUVESUFfTUlNRVRZUEVfQVVESU9fVk9SQklTKSkgewotICAgICAgICAgICAgICAgIC8vIE9ubHkgZG8gdGhpcyBmb3Igdm9yYmlzIGF1ZGlvLCBub25lIG9mIHRoZSBvdGhlciBhdWRpbwotICAgICAgICAgICAgICAgIC8vIGZvcm1hdHMgZXZlbiBzdXBwb3J0IHRoaXMgcmluZ3RvbmUgc3BlY2lmaWMgaGFjayBhbmQKLSAgICAgICAgICAgICAgICAvLyByZXRyaWV2aW5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aWYgKGZpbmFsU3RhdHVzID09IEVSUk9SX0VORF9PRl9TVFJFQU0pIHsKLSAgICAgICAgICAgICAgICBub3RpZnlMaXN0ZW5lcl9sKE1FRElBX0JVRkZFUklOR19VUERBVEUsIDEwMCk7Ci0gICAgICAgICAgICB9Ci0gICAgICAgICAgICBpZiAobUZsYWdzICYgUFJFUEFSSU5HKSB7Ci0gICAgICAgICAgICAgICAgQUxPR1YoImNhY2hlIGhhcyByZWFjaGVkIEVPUywgcHJlcGFyZSBpcyBkb25lLiIpOwotICAgICAgICAgICAgICAgIGZpbmlzaEFzeW5jUHJlcGFyZV9sKCk7Ci0gICAgICAgICAgICB9Ci0gICAgICAgIH0gZWxzZSB7Ci0gICAgICAgICAgICBpbnQ2NF90IGJpdHJhdGU7Ci0gICAgICAgICAgICBpZiAoZ2V0Qml0cmF0ZSgmYml0cmF0ZSkpIHsKLSAgICAgICAgICAgICAgICBzaXplX3QgY2FjaGVkU2l6ZSA9IG1DYWNoZWRTb3VyY2UtPmNhY2hlZFNpemUoKTsKLSAgICAgICAgICAgICAgICBpbnQ2NF90IGNhY2hlZER1cmF0aW9uVXMgPSBjYWNoZWRTaXplICogODAwMDAwMGxsIC8gYml0cmF0ZTsKLQotICAgICAgICAgICAgICAgIGludCBwZXJjZW50YWdlID0gMTAwLjAgKiAoZG91YmxlKWNhY2hlZER1cmF0aW9uVXMgLyBtRHVyYXRpb25VczsKLSAgICAgICAgICAgICAgICBpZiAocGVyY2VudGFnZSA+IDEwMCkgewotICAgICAgICAgICAgICAgICAgICBwZXJjZW50YWdlID0gMTAwOwotICAgICAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgICAgIG5vdGlmeUxpc3RlbmVyX2woTUVESUFfQlVGRkVSSU5HX1VQREFURSwgcGVyY2VudGFnZSk7Ci0gICAgICAgICAgICB9IGVsc2UgewotICAgICAgICAgICAgICAgIC8vIFdlIGRvbid0IGtub3cgdGhlIGJpdHJhdGUgb2YgdGhlIHN0cmVhbSwgdXNlIGFic29sdXRlIHNpemUKLSAgICAgICAgICAgICAgICAvLyBsaW1pdHMgdG8gbWFpbnRhaW4gdGhlIGNhY2hlLgotCi0gICAgICAgICAgICAgICAgaWYgKChtRmxhZ3MgJiBQTEFZSU5HKSAmJiAhZW9zCi0gICAgICAgICAgICAgICAgICAgICAgICAmJiAoY2FjaGVkRGF0YVJlbWFpbmluZyA8IGtMb3dXYXRlck1hcmtCeXRlcykpIHsKLSAgICAgICAgICAgICAgICAgICAgQUxPR0koImNhY2hlIGlzIHJ1bm5pbmcgbG93ICg8ICVkKSAsIHBhdXNpbmcuIiwKLSAgICAgICAgICAgICAgICAgICAgICAgICBrTG93V2F0ZXJNYXJrQnl0ZXMpOwotICAgICAgICAgICAgICAgICAgICBtb2RpZnlGbGFncyhDQUNIRV9VTkRFUlJVTiwgU0VUKTsKLSAgICAgICAgICAgICAgICAgICAgcGF1c2VfbCgpOwotICAgICAgICAgICAgICAgICAgICBlbnN1cmVDYWNoZUlzRmV0Y2hpbmdfbCgpOwotICAgICAgICAgICAgICAgICAgICBzZW5kQ2FjaGVTdGF0cygpOwotICAgICAgICAgICAgICAgICAgICBub3RpZnlMaXN0ZW5lcl9sKE1FRElBX0lORk8sIE1FRElBX0lORk9fQlVGRkVSSU5HX1NUQVJUKTsKLSAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKGVvcyB8fCBjYWNoZWREYXRhUmVtYWluaW5nID4ga0hpZ2hXYXRlck1hcmtCeXRlcykgewotICAgICAgICAgICAgICAgICAgICBpZiAobUZsYWdzICYgQ0FDSEVfVU5ERVJSVU4pIHsKLSAgICAgICAgICAgICAgICAgICAgICAgIEFMT0dJKCJjYWNoZSBoYXMgZmlsbGVkIHVwICg+ICVkKSwgcmVzdW1pbmcuIiwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAga0hpZ2hXYXRlck1hcmtCeXRlcyk7Ci0gICAgICAgICAgICAgICAgICAgICAgICBtb2RpZnlGbGFncyhDQUNIRV9VTkRFUlJVTiwgQ0xFQVIpOwotICAgICAgICAgICAgICAgICAgICAgICAgcGxheV9sKCk7Ci0gICAgICAgICAgICAgICAgICAgICAgICBub3RpZnlMaXN0ZW5lcl9sKE1FRElBX0lORk8sIE1FRElBX0lORk9fQlVGRkVSSU5HX0VORCk7Ci0gICAgICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAobUZsYWdzICYgUFJFUEFSSU5HKSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICBBTE9HVigiY2FjaGUgaGFzIGZpbGxlZCB1cCAoPiAlZCksIHByZXBhcmUgaXMgZG9uZSIsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgIGtIaWdoV2F0ZXJNYXJrQnl0ZXMpOwotICAgICAgICAgICAgICAgICAgICAgICAgZmluaXNoQXN5bmNQcmVwYXJlX2woKTsKLSAgICAgICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgIH0KLSAgICAgICAgfQotICAgIH0gZWxzZSBpZiAobVdWTUV4dHJhY3RvciAhPSBOVUxMKSB7Ci0gICAgICAgIHN0YXR1c190IGZpbmFsU3RhdHVzOwotCi0gICAgICAgIGludDY0X3QgY2FjaGVkRHVyYXRpb25VcwotICAgICAgICAgICAgPSBtV1ZNRXh0cmFjdG9yLT5nZXRDYWNoZWREdXJhdGlvblVzKCZmaW5hbFN0YXR1cyk7Ci0KLSAgICAgICAgYm9vbCBlb3MgPSAoZmluYWxTdGF0dXMgIT0gT0spOwotCi0gICAgICAgIGlmIChlb3MpIHsKLSAgICAgICAgICAgIGlmIChmaW5hbFN0YXR1cyA9PSBFUlJPUl9FTkRfT0ZfU1RSRUFNKSB7Ci0gICAgICAgICAgICAgICAgbm90aWZ5TGlzdGVuZXJfbChNRURJQV9CVUZGRVJJTkdfVVBEQVRFLCAxMDApOwotICAgICAgICAgICAgfQotICAgICAgICAgICAgaWYgKG1GbGFncyAmIFBSRVBBUklORykgewotICAgICAgICAgICAgICAgIEFMT0dWKCJjYWNoZSBoYXMgcmVhY2hlZCBFT1MsIHByZXBhcmUgaXMgZG9uZS4iKTsKLSAgICAgICAgICAgICAgICBmaW5pc2hBc3luY1ByZXBhcmVfbCgpOwotICAgICAgICAgICAgfQotICAgICAgICB9IGVsc2UgewotICAgICAgICAgICAgaW50IHBlcmNlbnRhZ2UgPSAxMDAuMCAqIChkb3VibGUpY2FjaGVkRHVyYXRpb25VcyAvIG1EdXJhdGlvblVzOwotICAgICAgICAgICAgaWYgKHBlcmNlbnRhZ2UgPiAxMDApIHsKLSAgICAgICAgICAgICAgICBwZXJjZW50YWdlID0gMTAwOwotICAgICAgICAgICAgfQotCi0gICAgICAgICAgICBub3RpZnlMaXN0ZW5lcl9sKE1FRElBX0JVRkZFUklOR19VUERBVEUsIHBlcmNlbnRhZ2UpOwotICAgICAgICB9Ci0gICAgfQotCi0gICAgaW50NjRfdCBjYWNoZWREdXJhdGlvblVzOwotICAgIGJvb2wgZW9zOwotICAgIGlmIChnZXRDYWNoZWREdXJhdGlvbl9sKCZjYWNoZWREdXJhdGlvblVzLCAmZW9zKSkgewotICAgICAgICBBTE9HVigiY2FjaGVkRHVyYXRpb25VcyA9ICUuMmYgc2VjcywgZW9zPSVkIiwKLSAgICAgICAgICAgICBjYWNoZWREdXJhdGlvblVzIC8gMUU2LCBlb3MpOwotCi0gICAgICAgIGlmICgobUZsYWdzICYgUExBWUlORykgJiYgIWVvcwotICAgICAgICAgICAgICAgICYmIChjYWNoZWREdXJhdGlvblVzIDwga0xvd1dhdGVyTWFya1VzKSkgewotICAgICAgICAgICAgQUxPR0koImNhY2hlIGlzIHJ1bm5pbmcgbG93ICglLjJmIHNlY3MpICwgcGF1c2luZy4iLAotICAgICAgICAgICAgICAgICBjYWNoZWREdXJhdGlvblVzIC8gMUU2KTsKLSAgICAgICAgICAgIG1vZGlmeUZsYWdzKENBQ0hFX1VOREVSUlVOLCBTRVQpOwotICAgICAgICAgICAgcGF1c2VfbCgpOwotICAgICAgICAgICAgZW5zd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wpIHsKLSAgICAgICAgICAgICAgICBtQXVkaW9QbGF5ZXIgPSBuZXcgQXVkaW9QbGF5ZXIobUF1ZGlvU2luaywgdGhpcyk7Ci0gICAgICAgICAgICAgICAgbUF1ZGlvUGxheWVyLT5zZXRTb3VyY2UobUF1ZGlvU291cmNlKTsKLQotICAgICAgICAgICAgICAgIG1UaW1lU291cmNlID0gbUF1ZGlvUGxheWVyOwotCi0gICAgICAgICAgICAgICAgLy8gSWYgdGhlcmUgd2FzIGEgc2VlayByZXF1ZXN0IGJlZm9yZSB3ZSBldmVyIHN0YXJ0ZWQsCi0gICAgICAgICAgICAgICAgLy8gaG9ub3IgdGhlIHJlcXVlc3Qgbm93LgotICAgICAgICAgICAgICAgIC8vIE1ha2Ugc3VyZSB0byBkbyB0aGlzIGJlZm9yZSBzdGFydGluZyB0aGUgYXVkaW8gcGxheWVyCi0gICAgICAgICAgICAgICAgLy8gdG8gYXZvaWQgYSByYWNlIGNvbmRpdGlvbi4KLSAgICAgICAgICAgICAgICBzZWVrQXVkaW9JZk5lY2Vzc2FyeV9sKCk7Ci0gICAgICAgICAgICB9Ci0gICAgICAgIH0KLQotICAgICAgICBDSEVDSyghKG1GbGFncyAmIEFVRElPX1JVTk5JTkcpKTsKLQotICAgICAgICBpZiAobVZpZGVvU291cmNlID09IE5VTEwpIHsKLSAgICAgICAgICAgIC8vIFdlIGRvbid0IHdhbnQgdG8gcG9zdCBhbiBlcnJvciBub3RpZmljYXRpb24gYXQgdGhpcyBwb2ludCwKLSAgICAgICAgICAgIC8vIHRoZSBlcnJvciByZXR1cm5lZCBmcm9tIE1lZGlhUGxheWVyOjpzdGFydCgpIHdpbGwgc3VmZmljZS4KLQotICAgICAgICAgICAgc3RhdHVzX3QgZXJyID0gc3RhcnRBdWRpb1BsYXllcl9sKAotICAgICAgICAgICAgICAgICAgICBmYWxzZSAvKiBzZW5kRXJyb3JOb3RpZmljYXRpb24gKi8pOwotCi0gICAgICAgICAgICBpZiAoZXJyICE9IE9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KSwKLSAgICAgICAgICAgICAgICBmYWxzZSwgLy8gY3JlYXRlRW5jb2RlcgotICAgICAgICAgICAgICAgIG1BdWRpb1RyYWNrKTsKLSAgICB9Ci0KLSAgICBpZiAobUF1ZGlvU291cmNlICE9IE5VTEwpIHsKLSAgICAgICAgaW50NjRfdCBkdXJhdGlvblVzOwotICAgICAgICBpZiAobUF1ZGlvVHJhY2stPmdldEZvcm1hdCgpLT5maW5kSW50NjQoa0tleUR1cmF0aW9uLCAmZHVyYXRpb25VcykpIHsKLSAgICAgICAgICAgIE11dGV4OjpBdXRvbG9jayBhdXRvTG9jayhtTWlzY1N0YXRlTG9jayk7Ci0gICAgICAgICAgICBpZiAobUR1cmF0aW9uVXMgPCAwIHx8IGR1cmF0aW9uVXMgPiBtRHVyYXRpb25VcykgewotICAgICAgICAgICAgICAgIG1EdXJhdGlvblVzID0gZHVyYXRpb25VczsKLSAgICAgICAgICAgIH0KLSAgICAgICAgfQotCi0gICAgICAgIHN0YXR1c190IGVyciA9IG1BdWRpb1NvdXJjZS0+c3RhcnQoKTsKLQotICAgICAgICBpZiAoZXJyICE9IE9LKSB7Ci0gICAgICAgICAgICBtQXVkaW9Tb3VyY2UuY2xlYXIoKTsKLSAgICAgICAgICAgIHJldHVybiBlcnI7Ci0gICAgICAgIH0KLSAgICB9IGVsc2UgaWYgKCFzdHJjYXNlY21wKG1pbWUsIE1FRElBX01JTUVUWVBFX0FVRElPX1FDRUxQKSkgewotICAgICAgICAvLyBGb3IgbGVnYWN5IHJlYXNvbnMgd2UncmUgc2ltcGx5IGdvaW5nIHRvIGlnbm9yZSB0aGUgYWJzZW5jZQotICAgICAgICAvLyBvZiBhbiBhdWRpbyBkZWNvZGVyIGZvciBRQ0VMUCBpbnN0ZWFkIG9mIGFib3J0aW5nIHBsYXliYWNrCi0gICAgICAgIC8vIGFsdG9nZXRoZXIuCi0gICAgICAgIHJldHVybiBPSzsKLSAgICB9Ci0KLSAgICBpZiAobUF1ZGlvU291cmNlICE9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AgICAgICAgbUF1ZGlvU291cmNlLT5wYXVzZSgpOwotICAgICAgICB9Ci0gICAgfQotCi0gICAgaWYgKCFtVmlkZW9CdWZmZXIpIHsKLSAgICAgICAgTWVkaWFTb3VyY2U6OlJlYWRPcHRpb25zIG9wdGlvbnM7Ci0gICAgICAgIGlmIChtU2Vla2luZyAhPSBOT19TRUVLKSB7Ci0gICAgICAgICAgICBBTE9HVigic2Vla2luZyB0byAlbGxkIHVzICglLjJmIHNlY3MpIiwgbVNlZWtUaW1lVXMsIG1TZWVrVGltZVVzIC8gMUU2KTsKLQotICAgICAgICAgICAgb3B0aW9ucy5zZXRTZWVrVG8oCi0gICAgICAgICAgICAgICAgICAgIG1TZWVrVGltZVVzLAotICAgICAgICAgICAgICAgICAgICBtU2Vla2luZyA9PSBTRUVLX1ZJREVPX09OTFkKLSAgICAgICAgICAgICAgICAgICAgICAgID8gTWVkaWFTb3VyY2U6OlJlYWRPcHRpb25zOjpTRUVLX05FWFRfU1lOQwotICAgICAgICAgICAgICAgICAgICAgICAgOiBNZWRpYVNvdXJjZTo6UmVhZE9wdGlvbnM6OlNFRUtfQ0xPU0VTVCk7Ci0gICAgICAgIH0KLSAgICAgICAgZm9yICg7OykgewotICAgICAgICAgICAgc3RhdHVzX3QgZXJyID0gbVZpZGVvU291cmNlLT5yZWFkKCZtVmlkZW9CdWZmZXIsICZvcHRpb25zKTsKLSAgICAgICAgICAgIG9wdGlvbnMuY2xlYXJTZWVrVG8oKTsKLQotICAgICAgICAgICAgaWYgKGVyciAhPSBPSykgewotICAgICAgICAgICAgICAgIENIRUNLKG1WaWRlb0J1ZmZlciA9PSBOVUxMKTsKLQotICAgICAgICAgICAgICAgIGlmIChlcnIgPT0gSU5GT19GT1JNQVRfQ0hBTkdFRCkgewotICAgICAgICAgICAgICAgICAgICBBTE9HVigiVmlkZW9Tb3VyY2Ugc2lnbmFsbGVkIGZvcm1hdCBjaGFuZ2UuIik7Ci0KLSAgICAgICAgICAgICAgICAgICAgbm90aWZ5VmlkZW9TaXplX2woKTsKLQotICAgICAgICAgICAgICAgICAgICBpZiAobVZpZGVvUmVuZGVyZXIgIT0gTlVMTCkgewotICAgICAgICAgICAgICAgICAgICAgICAgbVZpZGVvUmVuZGVyZXJJc1ByZXZpZXcgPSBmYWxzZTsKLSAgICAgICAgICAgICAgICAgICAgICAgIGluaXRSZW5kZXJlcl9sKCk7Ci0gICAgICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICAgICAgY29udGludWU7Ci0gICAgICAgICAgICAgICAgfQotCi0gICAgICAgICAgICAgICAgLy8gU28gdmlkZW8gcGxheWJhY2sgaXMgY29tcGxldGUsIGJ1dCB3ZSBtYXkgc3RpbGwgaGF2ZQotICAgICAgICAgICAgICAgIC8vIGEgc2VlayByZXF1ZXN0IHBlbmRpbmcgdGhhdCBuZWVkcyB0byBiZSBhcHBsaWVkCi0gICAgICAgICAgICAgICAgLy8gdG8gdGhlIGF1ZGlvIHRyYWNrLgotICAgICAgICAgICAgICAgIGlmIChtU2Vla2luZyAhPSBOT19TRUVLKSB7Ci0gICAgICAgICAgICAgICAgICAgIEFMT0dWKCJ2aWRlbyBzdHJlYW0gZW5kZWQgd2hpbGUgc2Vla2luZyEiKTsKLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgZmluaXNoU2Vla0lmTmVjZXNzYXJ5KC0xKTsKLQotICAgICAgICAgICAgICAgIGlmIChtQXVkaW9QbGF5ZXIgIT0gTlVMTAotICAgICAgICAgICAgICAgICAgICAgICAgJiYgIShtRmxhZ3MgJiAoQVVESU9fUlVOTklORyB8IFNFRUtfUFJFVklFVykpKSB7Ci0gICAgICAgICAgICAgICAgICAgIHN0YXJ0QXVkaW9QbGF5ZXJfbCgpOwotICAgICAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgICAgIG1vZGlmeUZsYWdzKFZJREVPX0FUX0VPUywgU0VUKTsKLSAgICAgICAgICAgICAgICBwb3N0U3RyZWFtRG9uZUV2ZW50X2woZXJyKTsKLSAgICAgICAgICAgICAgICByZXR1cm47Ci0gICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgIGlmIChtVmlkZW9CdWZmZXItPnJhbmdlX2xlbmd0aCgpID09IDApIHsKLSAgICAgICAgICAgICAgICAvLyBTb21lIGRlY29kZXJzLCBub3RhYmx5IHRoZSBQViBBVkMgc29mdHdhcmUgZGVjb2RlcgotICAgICAgICAgICAgICAgIC8vIHJldHVybiBzcHVyaW91cyBlbXB0eSBidWZmZXJzIHRoYXQgd2UganVzdCB3YW50IHRvIGlnbm9yZS4KLQotICAgICAgICAgICAgICAgIG1WaWRlb0J1ZmZlci0+cmVsZWFzZSgpOwotICAgICAgICAgICAgICAgIG1WaWRlb0J1ZmZlciA9IE5VTEw7Ci0gICAgICAgICAgICAgICAgY29udGludWU7Ci0gICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgIGJyZWFrOwotICAgICAgICB9Ci0KLSAgICAgICAgewotICAgICAgICAgICAgTXV0ZXg6OkF1dG9sb2NrIGF1dG9Mb2NrKG1TdGF0c0xvY2spOwotICAgICAgICAgICAgKyttU3RhdHMubU51bVZpZGVvRnJhbWVzRGVjb2RlZDsKLSAgICAgICAgfQotICAgIH0KLQotICAgIGludDY0X3QgdGltZVVzOwotICAgIENIRUNLKG1WaWRlb0J1ZmZlci0+bWV0YV9kYXRhKCktPmZpbmRJbnQ2NChrS2V5VGltZSwgJnRpbWVVcykpOwotCi0gICAgbUxhc3RWaWRlb1RpbWVVcyA9IHRpbWVVczsKLQotICAgIGlmIChtU2Vla2luZyA9PSBTRUVLX1ZJREVPX09OTFkpIHsKLSAgICAgICAgaWYgKG1TZWVrVGltZVVzID4gdGltZVVzKSB7Ci0gICAgICAgICAgICBBTE9HSSgiWFhYIG1TZWVrVGltZVVzID0gJWxsZCB1cywgdGltZVVzID0gJWxsZCB1cyIsCi0gICAgICAgICAgICAgICAgIG1TZWVrVGltZVVzLCB0aW1lVXMpOwotICAgICAgICB9Ci0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VzIC0gdGltZVVzOwotCi0gICAgICAgIGlmIChsYXRlbmVzc1VzID4gNTAwMDAwbGwKLSAgICAgICAgICAgICAgICAmJiBtQXVkaW9QbGF5ZXIgIT0gTlVMTAotICAgICAgICAgICAgICAgICYmIG1BdWRpb1BsYXllci0+Z2V0TWVkaWFUaW1lTWFwcGluZygKLSAgICAgICAgICAgICAgICAgICAgJnJlYWxUaW1lVXMsICZtZWRpYVRpbWVVcykpIHsKLSAgICAgICAgICAgIEFMT0dJKCJ3ZSdyZSBtdWNoIHRvbyBsYXRlICglLjJmIHNlY3MpLCB2aWRlbyBza2lwcGluZyBhaGVhZCIsCi0gICAgICAgICAgICAgICAgIGxhdGVuZXNzVXMgLyAxRTYpOwotCi0gICAgICAgICAgICBtVmlkZW9CdWZmZXItPnJlbGVhc2UoKTsKLSAgICAgICAgICAgIG1WaWRlb0J1ZmZlciA9IE5VTEw7Ci0KLSAgICAgICAgICAgIG1TZWVraW5nID0gU0VFS19WSURFT19PTkxZOwotICAgICAgICAgICAgbVNlZWtUaW1lVXMgPSBtZWRpYVRpbWVVczsKLQotICAgICAgICAgICAgcG9zdFZpZGVvRXZlbnRfbCgpOwotICAgICAgICAgICAgcmV0dXJuOwotICAgICAgICB9Ci0KLSAgICAgICAgaWYgKGxhdGVuZXNzVXMgPiA0MDAwMCkgewotICAgICAgICAgICAgLy8gV2UncmUgbW9yZSB0aGFuIDQwbXMgbGF0ZS4KLSAgICAgICAgICAgIEFMT0dWKCJ3ZSdyZSBsYXRlIGJ5ICVsbGQgdXMgKCUuMmYgc2VjcykiLAotICAgICAgICAgICAgICAgICBsYXRlbmVzc1VzLCBsYXRlbmVzc1VzIC8gMUU2KTsKLQotICAgICAgICAgICAgaWYgKCEobUZsYWdzICYgU0xPV19ERUNPREVSX0hBQ0spCi0gICAgICAgICAgICAgICAgICAgIHx8IG1TaW5jZUxhc3REcm9wcGVkID4gRlJBTUVfRFJPUF9GUkVRKQotICAgICAgICAgICAgewotICAgICAgICAgICAgICAgIEFMT0dWKCJ3ZSdyZSBsYXRlIGJ5ICVsbGQgdXMgKCUuMmYgc2VjcykgZHJvcHBpbmcgIgotICAgICAgICAgICAgICAgICAgICAgIm9uZSBhZnRlciAlZCBmcmFtZXMiLAotICAgICAgICAgICAgICAgICAgICAgbGF0ZW5lc3NVcywgbGF0ZW5lc3NVcyAvIDFFNiwgbVNpbmNlTGFzdERyb3BwZWQpOwotCi0gICAgICAgICAgICAgICAgbVNpbmNlTGFzdERyb3BwZWQgPSAwOwotICAgICAgICAgICAgICAgIG1WaWRlb0J1ZmZlci0+cmVsZWFzZSgpOwotICAgICAgICAgICAgICAgIG1WaWRlb0J1ZmZlciA9IE5VTEw7Ci0KLSAgICAgICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgICAgIE11dGV4OjpBdXRvbG9jayBhdXRvTG9jayhtU3RhdHNMb2NrKTsKLSAgICAgICAgICAgICAgICAgICAgKyttU3RhdHMubU51bVZpZGVvRnJhbWVzRHJvcHBlZDsKLSAgICAgICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgICAgICBwb3N0VmlkZW9FdmVudF9sKCk7Ci0gICAgICAgICAgICAgICAgcmV0dXJuOwotICAgICAgICAgICAgfQotICAgICAgICB9Ci0KLSAgICAgICAgaWYgKGxhdGVuZXNzVXMgPCAtMTAwMDApIHsKLSAgICAgICAgICAgIC8vIFdlJ3JlIG1vcmUgdGhhbiAxMG1zIGVhcmx5LgotCi0gICAgICAgICAgICBwb3N0VmlkZW9FdmVudF9sKDEwMDAwKTsKLSAgICAgICAgICAgIHJldHVybjsKLSAgICAgICAgfQotICAgIH0KLQotICAgIGlmICgobU5hdGl2ZVdpbmRvdyAhPSBOVUxMKQotICAgICAgICAgICAgJiYgKG1WaWRlb1JlbmRlcmVySXNQcmV2aWV3IHx8IG1WaWRlb1JlbmRlcmVyID09IE5VTEwpKSB7Ci0gICAgICAgIG1WaWRlb1JlbmRlcmVySXNQcmV2aWV3ID0gZmFsc2U7Ci0KL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k7Ci0KLSAgICAgICAgaWYgKGVyciAhPSBPSykgewotICAgICAgICAgICAgbUNvbm5lY3RpbmdEYXRhU291cmNlLmNsZWFyKCk7Ci0KLSAgICAgICAgICAgIEFMT0dJKCJtQ29ubmVjdGluZ0RhdGFTb3VyY2UtPmNvbm5lY3QoKSByZXR1cm5lZCAlZCIsIGVycik7Ci0gICAgICAgICAgICByZXR1cm4gZXJyOwotICAgICAgICB9Ci0KLSAgICAgICAgaWYgKCFpc1dpZGV2aW5lU3RyZWFtaW5nKSB7Ci0gICAgICAgICAgICAvLyBUaGUgd2lkZXZpbmUgZXh0cmFjdG9yIGRvZXMgaXRzIG93biBjYWNoaW5nLgotCi0jaWYgMAotICAgICAgICAgICAgbUNhY2hlZFNvdXJjZSA9IG5ldyBOdUNhY2hlZFNvdXJjZTIoCi0gICAgICAgICAgICAgICAgICAgIG5ldyBUaHJvdHRsZWRTb3VyY2UoCi0gICAgICAgICAgICAgICAgICAgICAgICBtQ29ubmVjdGluZ0RhdGFTb3VyY2UsIDUwICogMTAyNCAvKiBieXRlcy9zZWMgKi8pKTsKLSNlbHNlCi0gICAgICAgICAgICBtQ2FjaGVkU291cmNlID0gbmV3IE51Q2FjaGVkU291cmNlMigKLSAgICAgICAgICAgICAgICAgICAgbUNvbm5lY3RpbmdEYXRhU291cmNlLAotICAgICAgICAgICAgICAgICAgICBjYWNoZUNvbmZpZy5pc0VtcHR5KCkgPyBOVUxMIDogY2FjaGVDb25maWcuc3RyaW5nKCksCi0gICAgICAgICAgICAgICAgICAgIGRpc2Nvbm5lY3RBdEhpZ2h3YXRlcm1hcmspOwotI2VuZGlmCi0KLSAgICAgICAgICAgIGRhdGFTb3VyY2UgPSBtQ2FjaGVkU291cmNlOwotICAgICAgICB9IGVsc2UgewotICAgICAgICAgICAgZGF0YVNvdXJjZSA9IG1Db25uZWN0aW5nRGF0YVNvdXJjZTsKLSAgICAgICAgfQotCi0gICAgICAgIG1Db25uZWN0aW5nRGF0YVNvdXJjZS5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B0aGUgZXh0cmFjdG9yIGJlbG93LCBhcyB0aGUgbGF0dGVyIGlzIGFuIG9wZXJhdGlvbiB0aGF0IG90aGVyd2lzZQotICAgICAgICAgICAgICAgIC8vIGNvdWxkIGJsb2NrIG9uIHRoZSBkYXRhc291cmNlIGZvciBhIHNpZ25pZmljYW50IGFtb3VudCBvZiB0aW1lLgotICAgICAgICAgICAgICAgIC8vIER1cmluZyB0aGF0IHRpbWUgd2UnZCBiZSB1bmFibGUgdG8gYWJvcnQgdGhlIHByZXBhcmF0aW9uIHBoYXNlCi0gICAgICAgICAgICAgICAgLy8gd2l0aG91dCB0aGlzIHByZWZpbGwuCi0KLSAgICAgICAgICAgICAgICBtTG9jay51bmxvY2soKTsKLQotICAgICAgICAgICAgICAgIC8vIEluaXRpYWxseSBtYWtlIHN1cmUgd2UgaGF2ZSBhdCBsZWFzdCAxOTIgS0IgZm9yIHRoZSBzbmlmZgotICAgICAgICAgICAgICAgIC8vIHRvIGNvbXBsZXRlIHdpdGhvdXQgYmxvY2tpbmcuCi0gICAgICAgICAgICAgICAgc3RhdGljIGNvbnN0IHNpemVfdCBrTWluQnl0ZXNGb3JTbmlmZmluZyA9IDE5MiAqIDEwMjQ7Ci0KLSAgICAgICAgICAgICAgICBvZmY2NF90IG1ldGFEYXRhU2l6ZSA9IC0xbGw7Ci0gICAgICAgICAgICAgICAgZm9yICg7OykgewotICAgICAgICAgICAgICAgICAgICBzdGF0dXNfdCBmaW5hbFN0YXR1czsKLSAgICAgICAgICAgICAgICAgICAgc2l6ZV90IGNhY2hlZERhdGFSZW1haW5pbmcgPQotICAgICAgICAgICAgICAgICAgICAgICAgbUNhY2hlZFNvdXJjZS0+YXBwcm94RGF0YVJlbWFpbmluZygmZmluYWxTdGF0dXMpOwotCi0gICAgICAgICAgICAgICAgICAgIGlmIChmaW5hbFN0YXR1cyAhPSBPSwotICAgICAgICAgICAgICAgICAgICAgICAgICAgIHx8IChtZXRhRGF0YVNpemUgPj0gMAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiBjYWNoZWREYXRhUmVtYWluaW5nID49IG1ldGFEYXRhU2l6ZSkKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICB8fCAobUZsYWdzICYgUFJFUEFSRV9DQU5DRUxMRUQpKSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKLSAgICAgICAgICAgICAgICAgICAgfQotCi0gICAgICAgICAgICAgICAgICAgIEFMT0dWKCJub3cgY2FjaGVkICVkIGJ5dGVzIG9mIGRhdGEiLCBjYWNoZWREYXRhUmVtYWluaW5nKTsKLQotICAgICAgICAgICAgICAgICAgICBpZiAobWV0YURhdGFTaXplIDwgMAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIGNhY2hlZERhdGFSZW1haW5pbmcgPj0ga01pbkJ5dGVzRm9yU25pZmZpbmcpIHsKLSAgICAgICAgICAgICAgICAgICAgICAgIFN0cmluZzggdG1wOwotICAgICAgICAgICAgICAgICAgICAgICAgZmxvYXQgY29uZmlkZW5jZTsKLSAgICAgICAgICAgICAgICAgICAgICAgIHNwPEFNZXNzYWdlPiBtZXRhOwotICAgICAgICAgICAgICAgICAgICAgICAgaWYgKCFkYXRhU291cmNlLT5zbmlmZigmdG1wLCAmY29uZmlkZW5jZSwgJm1ldGEpKSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgbUxvY2subG9jaygpOwotICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBVTktOT1dOX0VSUk9SOwotICAgICAgICAgICAgICAgICAgICAgICAgfQotCi0gICAgICAgICAgICAgICAgICAgICAgICAvLyBXZSBzdWNjZXNzZnVsbHkgaWRlbnRpZmllZCB0aGUgZmlsZSdzIGV4dHJhY3RvciB0bwotICAgICAgICAgICAgICAgICAgICAgICAgLy8gYmUsIHJlbWVtYmVyIHRoaXMgbWltZSB0eXBlIHNvIHdlIGRvbid0IGhhdmUgdG8KLSAgICAgICAgICAgICAgICAgICAgICAgIC8vIHNuaWZmIGl0IGFnYWluIHdoZW4gd2UgY2FsbCBNZWRpYUV4dHJhY3Rvcjo6Q3JlYXRlKCkKLSAgICAgICAgICAgICAgICAgICAgICAgIC8vIGJlbG93LgotICAgICAgICAgICAgICAgICAgICAgICAgc25pZmZlZE1JTUUgPSB0bXAuc3RyaW5nKCk7Ci0KLSAgICAgICAgICAgICAgICAgICAgICAgIGlmIChtZXRhID09IE5VTEwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfHwgIW1ldGEtPmZpbmRJbnQ2NCgKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICJtZXRhLWRhdGEtc2l6ZSIsICZtZXRhRGF0YVNpemUpKSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgbWV0YURhdGFTaXplID0ga0hpZ2hXYXRlck1hcmtCeXRlczsKLSAgICAgICAgICAgICAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgICAgICAgICAgICAgQ0hFQ0tfR0UobWV0YURhdGFTaXplLCAwbGwpOwotICAgICAgICAgICAgICAgICAgICAgICAgQUxPR1YoIm1ldGFEYXRhU2l6ZSA9ICVsbGQgYnl0ZXMiLCBtZXRhRGF0YVNpemUpOwotICAgICAgICAgICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgICAgICAgICAgdXNsZWVwKDIwMDAwMCk7Ci0gICAgICAgICAgICAgICAgfQotCi0gICAgICAgICAgICAgICAgbUxvY2subG9jaygpOwotICAgICAgICAgICAgfQotCi0gICAgICAgICAgICBpZiAobUZsYWdzICYgUFJFUEFSRV9DQU5DRUxMRUQpIHsKLSAgICAgICAgICAgICAgICBBTE9HSSgiUHJlcGFyZSBjYW5jZWxsZWQgd2hpbGUgd2FpdGluZyBmb3IgaW5pdGlhbCBjYWNoZSBmaWxsLiIpOwotICAgICAgICAgICAgICAgIHJldHVybiBVTktOT1dOX0VSUk9SOwotICAgICAgICAgICAgfQotICAgICAgICB9Ci0gICAgfSBlbHNlIHsKLSAgICA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gIH0KLX0KLQotc3RhdHVzX3QgQXdlc29tZVBsYXllcjo6aW52b2tlKGNvbnN0IFBhcmNlbCAmcmVxdWVzdCwgUGFyY2VsICpyZXBseSkgewotICAgIGlmIChOVUxMID09IHJlcGx5KSB7Ci0gICAgICAgIHJldHVybiBhbmRyb2lkOjpCQURfVkFMVUU7Ci0gICAgfQotICAgIGludDMyX3QgbWV0aG9kSWQ7Ci0gICAgc3RhdHVzX3QgcmV0ID0gcmVxdWVzdC5yZWFkSW50MzIoJm1ldGhvZElkKTsKLSAgICBpZiAocmV0ICE9IGFuZHJvaWQ6Ok9LKSB7Ci0gICAgICAgIHJldHVybiByZXQ7Ci0gICAgfQotICAgIHN3aXRjaChtZXRob2RJZCkgewotICAgICAgICBjYXNlIElOVk9LRV9JRF9HRVRfVFJBQ0tfSU5GTzoKLSAgICAgICAgewotICAgICAgICAgICAgTXV0ZXg6OkF1dG9sb2NrIGF1dG9Mb2NrKG1UaW1lZFRleHRMb2NrKTsKLSAgICAgICAgICAgIGlmIChtVGV4dERyaXZlciA9PSBOVUxMKSB7Ci0gICAgICAgICAgICAgICAgcmV0dXJuIElOVkFMSURfT1BFUkFUSU9OOwotICAgICAgICAgICAgfQotICAgICAgICAgICAgbVRleHREcml2ZXItPmdldFRyYWNrSW5mbyhyZXBseSk7Ci0gICAgICAgICAgICByZXR1cm4gT0s7Ci0gICAgICAgIH0KLSAgICAgICAgY2FzZSBJTlZPS0VfSURfQUREX0VYVEVSTkFMX1NPVVJDRToKLSAgICAgICAgewotICAgICAgICAgICAgTXV0ZXg6OkF1dG9sb2NrIGF1dG9Mb2NrKG1UaW1lZFRleHRMb2NrKTsKLSAgICAgICAgICAgIGlmIChtVGV4dERyaXZlciA9PSBOVUxMKSB7Ci0gICAgICAgICAgICAgICAgbVRleHREcml2ZXIgPSBuZXcgVGltZWRUZXh0RHJpdmVyKG1MaXN0ZW5lcik7Ci0gICAgICAgICAgICB9Ci0gICAgICAgICAgICAvLyBTdHJpbmcgdm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gotICAgICAgICB7Ci0gICAgICAgICAgICBNdXRleDo6QXV0b2xvY2sgYXV0b0xvY2sobVRpbWVkVGV4dExvY2spOwotICAgICAgICAgICAgaWYgKG1UZXh0RHJpdmVyID09IE5VTEwpIHsKLSAgICAgICAgICAgICAgICByZXR1cm4gSU5WQUxJRF9PUEVSQVRJT047Ci0gICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgIHN0YXR1c190IGVyciA9IG1UZXh0RHJpdmVyLT5zZWxlY3RUcmFjaygKLSAgICAgICAgICAgICAgICAgICAgcmVxdWVzdC5yZWFkSW50MzIoKSk7Ci0gICAgICAgICAgICBpZiAoZXJyID09IE9LKSB7Ci0gICAgICAgICAgICAgICAgbW9kaWZ5RmxhZ3MoVEVYVFBMQVlFUl9JTklUSUFMSVpFRCwgU0VUKTsKLSAgICAgICAgICAgICAgICBpZiAobUZsYWdzICYgUExBWUlORyAmJiAhKG1GbGFncyAmIFRFWFRfUlVOTklORykpIHsKLSAgICAgICAgICAgICAgICAgICAgbVRleHREcml2ZXItPnN0YXJ0KCk7Ci0gICAgICAgICAgICAgICAgICAgIG1vZGlmeUZsYWdzKFRFWFRfUlVOTklORywgU0VUKTsKLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICB9Ci0gICAgICAgICAgICByZXR1cm4gZXJyOwotICAgICAgICB9Ci0gICAgICAgIGNhc2UgSU5WT0tFX0lEX1VOU0VMRUNUX1RSQUNLOgotICAgICAgICB7Ci0gICAgICAgICAgICBNdXRleDo6QXV0b2xvY2sgYXV0b0xvY2sobVRpbWVkVGV4dExvY2spOwotICAgICAgICAgICAgaWYgKG1UZXh0RHJpdmVyID09IE5VTEwpIHsKLSAgICAgICAgICAgICAgICByZXR1cm4gSU5WQUxJRF9PUEVSQVRJT047Ci0gICAgICAgICAgICB9Ci0gICAgICAgICAgICBzdGF0dXNfdCBlcnIgPSBtVGV4dERyaXZlci0+dW5zZWxlY3RUcmFjaygKLSAgICAgICAgICAgICAgICAgICAgcmVxdWVzdC5yZWFkSW50MzIoKSk7Ci0gICAgICAgICAgICBpZiAoZXJyID09IE9LKSB7Ci0gICAgICAgICAgICAgICAgbW9kaWZ5RmxhZ3MoVEVYVFBMQVlFUl9JTklUSUFMSVpFRCwgQ0xFQVIpOwotICAgICAgICAgICAgICAgIG1vZGlmeUZsYWdzKFRFWFRfUlVOTklORywgQ0xFQVIpOwotICAgICAgICAgICAgfQotICAgICAgICAgICAgcmV0dXJuIGVycjsKLSAgICAgICAgfQotICAgICAgICBkZWZhdWx0OgotICAgICAgICB7Ci0gICAgICAgICAgICByZXR1cm4gRVJST1JfVU5TVVBQT1JURUQ7Ci0gICAgICAgIH0KLSAgICB9Ci0gICAgLy8gSXQgd2lsbCBub3QgcmVhY2ggaGVyZS4KLSAgICByZXR1cm4gT0s7Ci19Ci0KLWJvb2wgQXdlc29tZVBsYXllcjo6aXNTdHJlYW1pbmdIVFRQKCkgY29uc3QgewotICAgIHJldHVybiBtQ2FjaGVkU291cmNlICE9IE5VTEwgfHwgbVdWTUV4dHJhY3RvciAhPSBOVUxMOwotfQotCi1zdGF0dXNfdCBBd2Vzb21lUGxheWVyOjpkdW1wKGludCBmZCwgY29uc3QgVmVjdG9yPFN0cmluZzE2PiAmYXJncykgY29uc3QgewotICAgIE11dGV4OjpBdXRvbG9jayBhdXRvTG9jayhtU3RhdHNMb2NrKTsKLQotICAgIEZJTEUgKm91dCA9IGZkb3BlbihkdXAoZmQpLCAidyIpOwotCi0gICAgZnByaW50ZihvdXQsICIgQXdlc29tZVBsYXllclxuIik7Ci0gICAgaWYgKG1TdGF0cy5tRmQgPCAwKSB7Ci0gICAgICAgIGZwcmludGYob3V0LCAiICBVUkkoJXMpIiwgbVN0YXRzLm1VUkkuc3RyaW5nKCkpOwotICAgIH0gZWxzZSB7Ci0gICAgICAgIGZwcmludGYob3V0LCAiICBmZCglZCkiLCBtU3RhdHMubUZkKTsKLSAgICB9Ci0KLSAgICBmcHJpbnRmKG91dCwgIiwgZmxhZ3MoMHglMDh4KSIsIG1TdGF0cy5tRmxhZ3MpOwotCi0gICAgaWYgKG1TdGF0cy5tQml0cmF0ZSA+PSAwKSB7Ci0gICAgICAgIGZwcmludGYob3V0LCAiLCBiaXRyYXRlKCVsbGQgYnBzKSIsIG1TdGF0cy5tQml0cmF0ZSk7Ci0gICAgfQotCi0gICAgZnByaW50ZihvdXQsICJcbiIpOwotCi0gICAgZm9yIChzaXplX3QgaSA9IDA7IGkgPCBtU3RhdHMubVRyYWNrcy5zaXplKCk7ICsraSkgewotICAgICAgICBjb25zdCBUcmFja1N0YXQgJnN0YXQgPSBtU3RhdHMubVRyYWNrcy5pdGVtQXQoaSk7Ci0KLSAgICAgICAgZnByaW50ZihvdXQsICIgIFRyYWNrICVkXG4iLCBpICsgMSk7Ci0gICAgICAgIGZwcmludGYob3V0LCAiICAgTUlNRSglcykiLCBzdGF0Lm1NSU1FLnN0cmluZygpKTsKLQotICAgICAgICBpZiAoIXN0YXQubURlY29kZXJOYW1lLmlzRW1wdHkoKSkgewotICAgICAgICAgICAgZnByaW50ZihvdXQsICIsIGRlY29kZXIoJXMpIiwgc3RhdC5tRGVjb2Rlck5hbWUuc3RyaW5nKCkpOwotICAgICAgICB9Ci0KLSAgICAgICAgZnByaW50ZihvdXQsICJcbiIpOwotCi0gICAgICAgIGlmICgoc3NpemVfdClpID09IG1TdGF0cy5tVmlkZW9UcmFja0luZGV4KSB7Ci0gICAgICAgICAgICBmcHJpbnRmKG91dCwKLSAgICAgICAgICAgICAgICAgICAgIiAgIHZpZGVvRGltZW5zaW9ucyglZCB4ICVkKSwgIgotICAgICAgICAgICAgICAgICAgICAibnVtVmlkZW9GcmFtZXNEZWNvZGVkKCVsbGQpLCAiCi0gICAgICAgICAgICAgICAgICAgICJudW1WaWRlb0ZyYW1lc0Ryb3BwZWQoJWxsZClcbiIsCi0gICAgICAgICAgICAgICAgICAgIG1TdGF0cy5tVmlkZW9XaWR0aCwKLSAgICAgICAgICAgICAgICAgICAgbVN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obU5BTExlbmd0aFNpemUpIHsKLSAgICAgICAgICAgICAgICBjYXNlIDE6Ci0gICAgICAgICAgICAgICAgICAgIG5hbExlbmd0aCA9ICpkYXRhOwotICAgICAgICAgICAgICAgICAgICBicmVhazsKLSAgICAgICAgICAgICAgICBjYXNlIDI6Ci0gICAgICAgICAgICAgICAgICAgIG5hbExlbmd0aCA9IFUxNl9BVChkYXRhKTsKLSAgICAgICAgICAgICAgICAgICAgYnJlYWs7Ci0gICAgICAgICAgICAgICAgY2FzZSAzOgotICAgICAgICAgICAgICAgICAgICBuYWxMZW5ndGggPSAoKHNpemVfdClkYXRhWzBdIDw8IDE2KSB8IFUxNl9BVCgmZGF0YVsxXSk7Ci0gICAgICAgICAgICAgICAgICAgIGJyZWFrOwotICAgICAgICAgICAgICAgIGNhc2UgNDoKLSAgICAgICAgICAgICAgICAgICAgbmFsTGVuZ3RoID0gVTMyX0FUKGRhdGEpOwotICAgICAgICAgICAgICAgICAgICBicmVhazsKLSAgICAgICAgICAgICAgICBkZWZhdWx0OgotICAgICAgICAgICAgICAgICAgICBDSEVDSyghIlNob3VsZCBub3QgYmUgaGVyZS4iKTsKLSAgICAgICAgICAgICAgICAgICAgYnJlYWs7Ci0gICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgIHNyY09mZnNldCArPSBtTkFMTGVuZ3RoU2l6ZTsKLQotICAgICAgICAgICAgaWYgKHNyY09mZnNldCArIG5hbExlbmd0aCA+IGxlbikgewotICAgICAgICAgICAgICAgIGlmIChkZWNyeXB0ZWREcm1CdWZmZXIuZGF0YSkgewotICAgICAgICAgICAgICAgICAgICBkZWxldGUgW10gZGVjcnlwdGVkRHJtQnVmZmVyLmRhdGE7Ci0gICAgICAgICAgICAgICAgICAgIGRlY3J5cHRlZERybUJ1ZmZlci5kYXRhID0gTlVMTDsKLSAgICAgICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgICAgICByZXR1cm4gRVJST1JfTUFMRk9STUVEOwotICAgICAgICAgICAgfQotC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0gICAgICAgICAgICBBTE9HRSgidW5zdXBwb3J0ZWQgc2FtcGxlIHJhdGUgJXUiLCBnZXRTYW1wbGVSYXRlKCkpOwotICAgICAgICAgICAgcmV0dXJuIE5PX0lOSVQ7Ci0gICAgICAgIH0KLSAgICAgICAgLy8gY29uZmlndXJlIHRoZSBhcHByb3ByaWF0ZSBjb3B5IGZ1bmN0aW9uLCBkZWZhdWx0aW5nIHRvIHRyZXNwYXNzCi0gICAgICAgIHN0YXRpYyBjb25zdCBzdHJ1Y3QgewotICAgICAgICAgICAgdW5zaWduZWQgbUNoYW5uZWxzOwotICAgICAgICAgICAgdW5zaWduZWQgbUJpdHNQZXJTYW1wbGU7Ci0gICAgICAgICAgICB2b2lkICgqbUNvcHkpKHNob3J0ICpkc3QsIGNvbnN0IGludCAqY29uc3QgKnNyYywgdW5zaWduZWQgblNhbXBsZXMpOwotICAgICAgICB9IHRhYmxlW10gPSB7Ci0gICAgICAgICAgICB7IDEsICA4LCBjb3B5TW9ubzggICAgfSwKLSAgICAgICAgICAgIHsgMiwgIDgsIGNvcHlTdGVyZW84ICB9LAotICAgICAgICAgICAgeyAxLCAxNiwgY29weU1vbm8xNiAgIH0sCi0gICAgICAgICAgICB7IDIsIDE2LCBjb3B5U3RlcmVvMTYgfSwKLSAgICAgICAgICAgIHsgMSwgMjQsIGNvcHlNb25vMjQgICB9LAotICAgICAgICAgICAgeyAyLCAyNCwgY29weVN0ZXJlbzI0IH0sCi0gICAgICAgIH07Ci0gICAgICAgIGZvciAodW5zaWduZWQgaSA9IDA7IGkgPCBzaXplb2YodGFibGUpL3NpemVvZih0YWJsZVswXSk7ICsraSkgewotICAgICAgICAgICAgaWYgKHRhYmxlW2ldLm1DaGFubmVscyA9PSBnZXRDaGFubmVscygpICYmCi0gICAgICAgICAgICAgICAgICAgIHRhYmxlW2ldLm1CaXRzUGVyU2FtcGxlID09IGdldEJpdHNQZXJTYW1wbGUoKSkgewotICAgICAgICAgICAgICAgIG1Db3B5ID0gdG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7Ci0gICAgICAgIHJldHVybiBVTktOT1dOX0VSUk9SOwotICAgIH0KLQotICAgIGZvciAoOzspIHsKLSAgICAgICAgdWludDhfdCBtYXJrZXI7Ci0gICAgICAgIGlmIChtU291cmNlLT5yZWFkQXQoaSsrLCAmbWFya2VyLCAxKSAhPSAxKSB7Ci0gICAgICAgICAgICByZXR1cm4gRVJST1JfSU87Ci0gICAgICAgIH0KLQotICAgICAgICBDSEVDS19FUShtYXJrZXIsIDB4ZmYpOwotCi0gICAgICAgIGlmIChtU291cmNlLT5yZWFkQXQoaSsrLCAmbWFya2VyLCAxKSAhPSAxKSB7Ci0gICAgICAgICAgICByZXR1cm4gRVJST1JfSU87Ci0gICAgICAgIH0KLQotICAgICAgICBDSEVDSyhtYXJrZXIgIT0gMHhmZik7Ci0KLSAgICAgICAgdWludDE2X3QgY2h1bmtTaXplOwotICAgICAgICBpZiAoIW1Tb3VyY2UtPmdldFVJbnQxNihpLCAmY2h1bmtTaXplKSkgewotICAgICAgICAgICAgcmV0dXJuIEVSUk9SX0lPOwotICAgICAgICB9Ci0KLSAgICAgICAgaSArPSAyOwotCi0gICAgICAgIGlmIChjaHVua1NpemUgPCAyKSB7Ci0gICAgICAgICAgICByZXR1cm4gVU5LTk9XTl9FUlJPUjsKLSAgICAgICAgfQotCi0gICAgICAgIHN3aXRjaCAobWFya2VyKSB7Ci0gICAgICAgICAgICBjYXNlIEpQRUdfU09TOgotICAgICAgICAgICAgewotICAgICAgICAgICAgICAgIHJldHVybiAobVdpZHRoID4gMCAmJiBtSGVpZ2h0ID4gMCkgPyBPSyA6IFVOS05PV05fRVJST1I7Ci0gICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgIGNhc2UgSlBFR19FT0k6Ci0gICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgcmV0dXJuIFVOS05PV05fRVJST1I7Ci0gICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgIGNhc2UgSlBFR19TT0YwOgotICAgICAgICAgICAgY2FzZSBKUEVHX1NPRjE6Ci0gICAgICAgICAgICBjYXNlIEpQRUdfU09GMzoKLSAgICAgICAgICAgIGNhc2UgSlBFR19TT0Y1OgotICAgICAgICAgICAgY2FzZSBKUEVHX1NPRjY6Ci0gICAgICAgICAgICBjYXNlIEpQRUdfU09GNzoKLSAgICAgICAgICAgIGNhc2UgSlBFR19TT0Y5OgotICAgICAgICAgICAgY2FzZSBKUEVHX1NPRjEwOgotICAgICAgICAgICAgY2FzZSBKUEVHX1NPRjExOgotICAgICAgICAgICAgY2FzZSBKUEVHX1NPRjEzOgotICAgICAgICAgICAgY2FzZSBKUEVHX1NPRjE0OgotICAgICAgICAgICAgY2FzZSBKUEVHX1NPRjE1OgotICAgICAgICAgICAgewotICAgICAgICAgICAgICAgIHVpbnQxNl90IHdpZHRoLCBoZWlnaHQ7Ci0gICAgICAgICAgICAgICAgaWYgKCFtU291cmNlLT5nZXRVSW50MTYoaSArIDEsICZoZWlnaHQpCi0gICAgICAgICAgICAgICAgICAgIHx8ICFtU291cmNlLT5nZXRVSW50MTYoaSArIDMsICZ3aWR0aCkpIHsKLSAgICAgICAgICAgICAgICAgICAgcmV0dXJuIEVSUk9SX0lPOwotICAgICAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgICAgIG1XaWR0aCA9IHdpZHRoOwotICAgICAgICAgICAgICAgIG1IZWlnaHQgPSBoZWlnaHQ7Ci0KLSAgICAgICAgICAgICAgICBpICs9IGNodW5rU2l6ZSAtIDI7Ci0gICAgICAgICAgICAgICAgYnJlYWs7Ci0gICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgIGRlZmF1bHQ6Ci0gICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgLy8gU2tpcCBjaHVuawotCi0gICAgICAgICAgICAgICAgaSArPSBjaHVua1NpemUgLSAyOwotCi0gICAgICAgICAgICAgICAgYnJlYWs7Ci0gICAgICAgICAgICB9Ci0gICAgICAgIH0KLSAgICB9Ci0KLSAgICByZXR1cm4gT0s7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c2l6ZW9mKGlkM2hlYWRlcikpIHsKLSAgICAgICAgICAgICAgICAvLyBJZiB3ZSBjYW4ndCBldmVuIHJlYWQgdGhlc2UgMTAgYnl0ZXMsIHdlIG1pZ2h0IGFzIHdlbGwgYmFpbAotICAgICAgICAgICAgICAgIC8vIG91dCwgZXZlbiBpZiB0aGVyZSBfd2VyZV8gMTAgYnl0ZXMgb2YgdmFsaWQgbXAzIGF1ZGlvIGRhdGEuLi4KLSAgICAgICAgICAgICAgICByZXR1cm4gZmFsc2U7Ci0gICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgIGlmIChtZW1jbXAoIklEMyIsIGlkM2hlYWRlciwgMykpIHsKLSAgICAgICAgICAgICAgICBicmVhazsKLSAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgLy8gU2tpcCB0aGUgSUQzdjIgaGVhZGVyLgotCi0gICAgICAgICAgICBzaXplX3QgbGVuID0KLSAgICAgICAgICAgICAgICAoKGlkM2hlYWRlcls2XSAmIDB4N2YpIDw8IDIxKQotICAgICAgICAgICAgICAgIHwgKChpZDNoZWFkZXJbN10gJiAweDdmKSA8PCAxNCkKLSAgICAgICAgICAgICAgICB8ICgoaWQzaGVhZGVyWzhdICYgMHg3ZikgPDwgNykKLSAgICAgICAgICAgICAgICB8IChpZDNoZWFkZXJbOV0gJiAweDdmKTsKLQotICAgICAgICAgICAgbGVuICs9IDEwOwotCi0gICAgICAgICAgICAqaW5vdXRfcG9zICs9IGxlbjsKLQotICAgICAgICAgICAgQUxPR1YoInNraXBwZWQgSUQzIHRhZywgbmV3IHN0YXJ0aW5nIG9mZnNldCBpcyAlbGxkICgweCUwMTZsbHgpIiwKLSAgICAgICAgICAgICAgICAgKmlub3V0X3BvcywgKmlub3V0X3Bvcyk7Ci0gICAgICAgIH0KLQotICAgICAgICBpZiAocG9zdF9pZDNfcG9zICE9IE5VTEwpIHsKLSAgICAgICAgICAgICpwb3N0X2lkM19wb3MgPSAqaW5vdXRfcG9zOwotICAgICAgICB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QgZnJvbSB0aGUgZW5kIG9mCi0gICAgICAgICAgICAgICAgICogdGhlIGxhc3QgYnVmZmVyLCBhbmQgdGh1cyBzaG91bGQgaW5jbHVkZSB0aGUgcmVtYWluaW5nCi0gICAgICAgICAgICAgICAgICogYnl0ZXMgaW4gdGhlIGJ1ZmZlci4KLSAgICAgICAgICAgICAgICAgKi8KLSAgICAgICAgICAgICAgICB0b3RhbEJ5dGVzUmVhZCA9IHNvdXJjZS0+cmVhZEF0KHBvcyArIHJlbWFpbmluZ0J5dGVzLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnVmICsgcmVtYWluaW5nQnl0ZXMsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBieXRlc1RvUmVhZCk7Ci0gICAgICAgICAgICAgICAgaWYgKHRvdGFsQnl0ZXNSZWFkIDw9IDApIHsKLSAgICAgICAgICAgICAgICAgICAgYnJlYWs7Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgIHJlYWNoRU9TID0gKHRvdGFsQnl0ZXNSZWFkICE9IGJ5dGVzVG9SZWFkKTsKLSAgICAgICAgICAgICAgICB0b3RhbEJ5dGVzUmVhZCArPSByZW1haW5pbmdCeXRlczsKLSAgICAgICAgICAgICAgICByZW1haW5pbmdCeXRlcyA9IHRvdGFsQnl0ZXNSZWFkOwotICAgICAgICAgICAgICAgIHRtcCA9IGJ1ZjsKLSAgICAgICAgICAgICAgICBjb250aW51ZTsKLSAgICAgICAgICAgIH0KLSAgICAgICAgfQotCi0gICAgICAgIHVpbnQzMl90IGhlYWRlciA9IFUzMl9BVCh0bXApOwotCi0gICAgICAgIGlmIChtYXRjaF9oZWFkZXIgIT0gMCAmJiAoaGVhZGVyICYga01hc2spICE9IChtYXRjaF9oZWFkZXIgJiBrTWFzaykpIHsKLSAgICAgICAgICAgICsrcG9zOwotICAgICAgICAgICAgKyt0bXA7Ci0gICAgICAgICAgICAtLXJlbWFpbmluZ0J5dGVzOwotICAgICAgICAgICAgY29udGludWU7Ci0gICAgICAgIH0KLQotICAgICAgICBzaXplX3QgZnJhbWVfc2l6ZTsKLSAgICAgICAgaW50IHNhbXBsZV9yYXRlLCBudW1fY2hhbm5lbHMsIGJpdHJhdGU7Ci0gICAgICAgIGlmICghR2V0TVBFR0F1ZGlvRnJhbWVTaXplKAotICAgICAgICAgICAgICAgICAgICBoZWFkZXIsICZmcmFtZV9zaXplLAotICAgICAgICAgICAgICAgICAgICAmc2FtcGxlX3JhdGUsICZudW1fY2hhbm5lbHMsICZiaXRyYXRlKSkgewotICAgICAgICAgICAgKytwb3M7Ci0gICAgICAgICAgICArK3RtcDsKLSAgICAgICAgICAgIC0tcmVtYWluaW5nQnl0ZXM7Ci0gICAgICAgICAgICBjb250aW51ZTsKLSAgICAgICAgfQotCi0gICAgICAgIEFMT0dWKCJmb3VuZCBwb3NzaWJsZSAxc3QgZnJhbWUgYXQgJWxsZCAoaGVhZGVyID0gMHglMDh4KSIsIHBvcywgaGVhZGVyKTsKLQotICAgICAgICAvLyBXZSBmb3VuZCB3aGF0IGxvb2tzIGxpa2UgYSB2YWxpZCBmcmFtZSwKLSAgICAgICAgLy8gbm93IGZpbmQgaXRzIHN1Y2Nlc3NvcnMuCi0KLSAgICAgICAgb2ZmNjRfdCB0ZXN0X3BvcyA9IHBvcyArIGZyYW1lX3NpemU7Ci0KLSAgICAgICAgdmFsaWQgPSB0cnVlOwotICAgICAgICBmb3IgKGludCBqID0gMDsgaiA8IDM7ICsraikgewotICAgICAgICAgICAgdWludDhfdCB0bXBbNF07Ci0gICAgICAgICAgICBpZiAoc291cmNlLT5yZWFkQXQodGVzdF9wb3MsIHRtcCwgNCkgPCA0KSB7Ci0gICAgICAgICAgICAgICAgdmFsaWQgPSBmYWxzZTsKLSAgICAgICAgICAgICAgICBicmVhazsKLSAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgdWludDMyX3QgdGVzdF9oZWFkZXIgPSBVMzJfQVQodG1wKTsKLQotICAgICAgICAgICAgQUxPR1YoInN1YnNlcXVlbnQgaGVhZGVyIGlzICUwOHgiLCB0ZXN0X2hlYWRlcik7Ci0KLSAgICAgICAgICAgIGlmICgodGVzdF9oZWFkZXIgJiBrTWFzaykgIT0gKGhlYWRlciAmIGtNYXNrKSkgewotICAgICAgICAgICAgICAgIHZhbGlkID0gZmFsc2U7Ci0gICAgICAgICAgICAgICAgYnJlYWs7Ci0gICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgIHNpemVfdCB0ZXN0X2ZyYW1lX3NpemU7Ci0gICAgICAgICAgICBpZiAoIUdldE1QRUdBdWRpb0ZyYW1lU2l6ZSgKLSAgICAgICAgICAgICAgICAgICAgICAgIHRlc3RfaGVhZGVyLCAmdGVzdF9mcmFtZV9zaXplKSkgewotICAgICAgICAgICAgICAgIHZhbGlkID0gZmFsc2U7Ci0gICAgICAgICAgICAgICAgYnJlYWs7Ci0gICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgIEFMT0dWKCJmb3VuZCBzdWJzZXF1ZW50IGZyYW1lICMlZCBhdCAlbGxkIiwgaiArIDIsIHRlc3RfcG9zKTsKLQotICAgICAgICAgICAgdGVzdF9wb3MgKz0gdGVzdF9mcmFtZV9zaXplOwotICAgICAgICB9Ci0KLSAgICAgICAgaWYgKHZhbGlkKSB7Ci0gICAgICAgICAgICAqaW5vdXRfcG9zID0gcG9zOwotCi0gICAgICAgICAgICBpZiAob3V0X2hlYWRlciAhPSBOVUxMKSB7Ci0gICAgICAgICAgICAgICAgKm91dF9oZWFkZXIgPSBoZWFkZXI7Ci0gICAgICAgICAgICB9Ci0gICAgICAgIH0gZWxzZSB7Ci0gICAgICAgICAgICBBTE9HVigibm8gZGljZSwgbm8gdmFsaWQgc2VxdWVuY2Ugb2YgZnJhbWVzIGZvdW5kLiIpOwotICAgICAgICB9Ci0KLSAgICAgICAgKytwb3M7Ci0gICAgICAgICsrdG1wOwotICAgICAgICAtLXJlbW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q2hlY2sgPSBPSzsKLQotICAgIC8vIGdldCBpVHVuZXMtc3R5bGUgZ2FwbGVzcyBpbmZvIGlmIHByZXNlbnQKLSAgICBJRDMgaWQzKG1EYXRhU291cmNlKTsKLSAgICBpZiAoaWQzLmlzVmFsaWQoKSkgewotICAgICAgICBJRDM6Okl0ZXJhdG9yICpjb20gPSBuZXcgSUQzOjpJdGVyYXRvcihpZDMsICJDT00iKTsKLSAgICAgICAgaWYgKGNvbS0+ZG9uZSgpKSB7Ci0gICAgICAgICAgICBkZWxldGUgY29tOwotICAgICAgICAgICAgY29tID0gbmV3IElEMzo6SXRlcmF0b3IoaWQzLCAiQ09NTSIpOwotICAgICAgICB9Ci0gICAgICAgIHdoaWxlKCFjb20tPmRvbmUoKSkgewotICAgICAgICAgICAgU3RyaW5nOCBjb21tZW50ZGVzYzsKLSAgICAgICAgICAgIFN0cmluZzggY29tbWVudHZhbHVlOwotICAgICAgICAgICAgY29tLT5nZXRTdHJpbmcoJmNvbW1lbnRkZXNjLCAmY29tbWVudHZhbHVlKTsKLSAgICAgICAgICAgIGNvbnN0IGNoYXIgKiBkZXNjID0gY29tbWVudGRlc2Muc3RyaW5nKCk7Ci0gICAgICAgICAgICBjb25zdCBjaGFyICogdmFsdWUgPSBjb21tZW50dmFsdWUuc3RyaW5nKCk7Ci0KLSAgICAgICAgICAgIC8vIGZpcnN0IDMgY2hhcmFjdGVycyBhcmUgdGhlIGxhbmd1YWdlLCB3aGljaCB3ZSBkb24ndCBjYXJlIGFib3V0Ci0gICAgICAgICAgICBpZihzdHJsZW4oZGVzYykgPiAzICYmIHN0cmNtcChkZXNjICsgMywgImlUdW5TTVBCIikgPT0gMCkgewotCi0gICAgICAgICAgICAgICAgaW50MzJfdCBkZWxheSwgcGFkZGluZzsKLSAgICAgICAgICAgICAgICBpZiAoc3NjYW5mKHZhbHVlLCAiICUqeCAleCAleCAlKngiLCAmZGVsYXksICZwYWRkaW5nKSA9PSAyKSB7Ci0gICAgICAgICAgICAg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dCA9IGJ1ZmZlcjsKLQotICAgIHJldHVybiBPSzsKLX0KLQotc3A8TWV0YURhdGE+IE1QM0V4dHJhY3Rvcjo6Z2V0TWV0YURhdGEoKSB7Ci0gICAgc3A8TWV0YURhdGE+IG1ldGEgPSBuZXcgTWV0YURhdGE7Ci0KLSAgICBpZiAobUluaXRDaGVjayAhPSBPSykgewotICAgICAgICByZXR1cm4gbWV0YTsKLSAgICB9Ci0KLSAgICBtZXRhLT5zZXRDU3RyaW5nKGtLZXlNSU1FVHlwZSwgImF1ZGlvL21wZWciKTsKLQotICAgIElEMyBpZDMobURhdGFTb3VyY2UpOwotCi0gICAgaWYgKCFpZDMuaXNWYWxpZCgpKSB7Ci0gICAgICAgIHJldHVybiBtZXRhOwotICAgIH0KLQotICAgIHN0cnVjdCBNYXAgewotICAgICAgICBpbnQga2V5OwotICAgICAgICBjb25zdCBjaGFyICp0YWcxOwotICAgICAgICBjb25zdCBjaGFyICp0YWcyOwotICAgIH07Ci0gICAgc3RhdGljIGNvbnN0IE1hcCBrTWFwW10gPSB7Ci0gICAgICAgIHsga0tleUFsYnVtLCAiVEFMQiIsICJUQUwiIH0sCi0gICAgICAgIHsga0tleUFydGlzdCwgIlRQRTEiLCAiVFAxIiB9LAotICAgICAgICB7IGtLZXlBbGJ1bUFydGlzdCwgIlRQRTIiLCAiVFAyIiB9LAotICAgICAgICB7IGtLZXlDb21wb3NlciwgIlRDT00iLCAiVENNIiB9LAotICAgICAgICB7IGtLZXlHZW5yZSwgIlRDT04iLCAiVENPIiB9LAotICAgICAgICB7IGtLZXlUaXRsZSwgIlRJVDIiLCAiVFQyIiB9LAotICAgICAgICB7IGtLZXlZZWFyLCAiVFlFIiwgIlRZRVIiIH0sCi0gICAgICAgIHsga0tleUF1dGhvciwgIlRYVCIsICJURVhUIiB9LAotICAgICAgICB7IGtLZXlDRFRyYWNrTnVtYmVyLCAiVFJLIiwgIlRSQ0siIH0sCi0gICAgICAgIHsga0tleURpc2NOdW1iZXIsICJ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RElBX01JTUVUWVBFX0FVRElPX0FBQykpIHsKLSAgICAgICAgdWludDMyX3QgdHlwZTsKLSAgICAgICAgY29uc3Qgdm9pZCAqZGF0YTsKLSAgICAgICAgc2l6ZV90IHNpemU7Ci0gICAgICAgIGlmICghbWV0YS0+ZmluZERhdGEoa0tleUVTRFMsICZ0eXBlLCAmZGF0YSwgJnNpemUpKSB7Ci0gICAgICAgICAgICAvLyBDb2RlYyBzcGVjaWZpYyBkYXRhIGJldHRlciBiZSBpbiB0aGUgZmlyc3QgZGF0YSBidWZmZXIuCi0gICAgICAgICAgICByZXR1cm47Ci0gICAgICAgIH0KLQotICAgICAgICBFU0RTIGVzZHMoKGNvbnN0IGNoYXIgKilkYXRhLCBzaXplKTsKLSAgICAgICAgQ0hFQ0tfRVEoZXNkcy5Jbml0Q2hlY2soKSwgKHN0YXR1c190KU9LKTsKLQotICAgICAgICBjb25zdCB1aW50OF90ICpjb2RlY19zcGVjaWZpY19kYXRhOwotICAgICAgICBzaXplX3QgY29kZWNfc3BlY2lmaWNfZGF0YV9zaXplOwotICAgICAgICBlc2RzLmdldENvZGVjU3BlY2lmaWNJbmZvKAotICAgICAgICAgICAgICAgIChjb25zdCB2b2lkICoqKSZjb2RlY19zcGVjaWZpY19kYXRhLCAmY29kZWNfc3BlY2lmaWNfZGF0YV9zaXplKTsKLQotICAgICAgICBDSEVDS19HRShjb2RlY19zcGVjaWZpY19kYXRhX3NpemUsIDJ1KTsKLQotICAgICAgICBtQUFDQ29kZWNTcGVjaWZpY0RhdGEgPSBuZXcgQUJ1ZmZlcihjb2RlY19zcGVjaWZpY19kYXRhX3NpemUpOwotCi0gICAgICAgIG1lbWNweShtQUFDQ29kZWNTcGVjaWZpY0RhdGEtPmRhdGEoKSwgY29kZWNfc3BlY2lmaWNfZGF0YSwKLSAgICAgICAgICAgICAgIGNvZGVjX3NwZWNpZmljX2RhdGFfc2l6ZSk7Ci0KLSAgICAgICAgcmV0dXJuOwotICAgIH0KLQotICAgIGlm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KTsKLSAgICBub3RpZnktPnBvc3QoKTsKLQotICAgIG1BQUNCdWZmZXIuY2xlYXIoKTsKLQotICAgIHJldHVybiB0cnVlOwotfQotCi12b2lkIE1QRUcyVFNXcml0ZXI6OlNvdXJjZUluZm86OnJlYWRNb3JlKCkgewotICAgIChuZXcgQU1lc3NhZ2Uoa1doYXRSZWFkLCBpZCgpKSktPnBvc3QoKTsKLX0KLQotdm9pZCBNUEVHMlRTV3JpdGVyOjpTb3VyY2VJbmZvOjpvbk1lc3NhZ2VSZWNlaXZlZChjb25zdCBzcDxBTWVzc2FnZT4gJm1zZykgewotICAgIHN3aXRjaCAobXNnLT53aGF0KCkpIHsKLSAgICAgICAgY2FzZSBrV2hhdFN0YXJ0OgotICAgICAgICB7Ci0gICAgICAgICAgICBzdGF0dXNfdCBlcnIgPSBtU291cmNlLT5zdGFydCgpOwotICAgICAgICAgICAgaWYgKGVyciAhPSBPSykgewotICAgICAgICAgICAgICAgIHNwPEFNZXNzYWdlPiBub3RpZnkgPSBtTm90aWZ5LT5kdXAoKTsKLSAgICAgICAgICAgICAgICBub3RpZnktPnNldEludDMyKCJ3aGF0Iiwga05vdGlmeVN0YXJ0RmFpbGVkKTsKLSAgICAgICAgICAgICAgICBub3RpZnktPnBvc3QoKTsKLSAgICAgICAgICAgICAgICBicmVhazsKLSAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgZXh0cmFjdENvZGVjU3BlY2lmaWNEYXRhKCk7Ci0KLSAgICAgICAgICAgIHJlYWRNb3JlKCk7Ci0gICAgICAgICAgICBicmVhazsKLSAgICAgICAgfQotCi0gICAgICAgIGNhc2Uga1doYXRSZWFkOgotICAgICAgICB7Ci0gICAgICAgICAgICBNZWRpYUJ1ZmZlciAqYnVmZmVyOwotICAgICAgICAgICAgc3RhdHVzX3QgZXJyID0gbVNvdXJjZS0+cmVhZCgmYnVmZmVyKTsKLQotICAgICAgICAgICAgaWYgKGVyciAhPSBPSyAmJiBlcnIgIT0gSU5GT19GT1JNQVRfQ0hBTkdFRCkgewotICAgICAgICAgICAgICAgIGlmIChtU3RyZWFtVHlwZSA9PSAweDBmKSB7Ci0gICAgICAgICAgICAgICAgICAgIGZsdXNoQUFDRnJhbWVzKCk7Ci0gICAgICAgICAgICAgICAgfQotCi0gICAgICAgICAgICAgICAgc3A8QU1lc3NhZ2U+IG5vdGlmeSA9IG1Ob3RpZnktPmR1cCgpOwotICAgICAgICAgICAgICAgIG5vdGlmeS0+c2V0SW50MzIoIndoYXQiLCBrTm90aWZ5UmVhY2hlZEVPUyk7Ci0gICAgICAgICAgICAgICAgbm90aWZ5LT5zZXRJbnQzMigic3RhdHVzIiwgZXJyKTsKLSAgICAgICAgICAgICAgICBub3RpZnktPnBvc3QoKTsKLSAgICAgICAgICAgICAgICBicmVhazsKLSAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgaWYgKGVyciA9PSBPSykgewotICAgICAgICAgICAgICAgIGlmIChtU3RyZWFtVHlwZSA9PSAweDBmICYmIG1BQUNDb2RlY1NwZWNpZmljRGF0YSA9PSBOVUxMKSB7Ci0gICAgICAgICAgICAgICAgICAgIC8vIFRoZSBmaXJzdCBidWZmZXIgY29udGFpbnMgY29kZWMgc3BlY2lmaWMgZGF0YS4KLQotICAgICAgICAgICAgICAgICAgICBDSEVDS19HRShidWZmZXItPnJhbmdlX2xlbmd0aCgpLCAydSk7Ci0KLSAgICAgICAgICAgICAgICAgICAgbUFBQ0NvZGVjU3BlY2lmaWNEYXRhID0gbmV3IEFCdWZmZXIoYnVmZmVyLT5yYW5nZV9sZW5ndGgoKSk7Ci0KLSAgICAgICAgICAgICAgICAgICAgbWVtY3B5KG1BQUNDb2RlY1NwZWNpZmljRGF0YS0+ZGF0YSgpLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgKGNvbnN0IHVpbnQ4X3QgKilidWZmZXItPmRhdGEoKQotICAgICAgICAgICAgICAgICAgICAgICAgICAgICsgYnVmZmVyLT5yYW5nZV9vZmZzZXQoKSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgIGJ1ZmZlci0+cmFuZ2VfbGVuZ3RoKCkpOwotICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAoYnVmZmVyLT5yYW5nZV9sZW5ndGgoKSA+IDApIHsKLSAgICAgICAgICAgICAgICAgICAgaWYgKG1TdHJlYW1UeXBlID09IDB4MGYpIHsKLSAgICAgICAgICAgICAgICAgICAgICAgIGlmICghYXBwZW5kQUFDRnJhbWVzKGJ1ZmZlcikpIHsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBtc2ctPnBvc3QoKTsKLSAgICAgICAgICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHsKLSAgICAgICAgICAgICAgICAgICAgICAgIHBvc3RBVkNGcmFtZShidWZmZXIpOwotICAgICAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgfQotCi0gICAgICAgICAgICAgICAgYnVmZmVyLT5yZWxlYXNlKCk7Ci0gICAgICAgICAgICAgICAgYnVmZmVyID0gTlVMTDsKLSAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgLy8gRG8gbm90IHJlYWQgbW9yZSBkYXRhIHVudGlsIHRvbGQgdG8uCi0gICAgICAgICAgICBicmVhazsKLSAgICAgICAgfQotCi0gICAgICAgIGRlZmF1bHQ6Ci0gICAgICAgICAgICBUUkVTUEFTUygpOwotICAgIH0KLX0KLQotc3A8QUJ1ZmZlcj4gTVBFRzJUU1dyaXRlcjo6U291cmNlSW5mbzo6bGFzdEFjY2Vzc1VuaXQoKSB7Ci0gICAgcmV0dXJuIG1MYXN0QWNjZXNzVW5pdDsKLX0KLQotdm9pZCBNUEVHMlRTV3JpdGVyOjpTb3VyY2VJbmZvOjpzZXRMYXN0QWNjZXNzVW5pdCgKLSAgICAgICAgY29uc3Qgc3A8QUJ1ZmZlcj4gJmFjY2Vzc1VuaXQpIHsKLSAgICBtTGFzdEFjY2Vzc1VuaXQgPSBhY2Nlc3NVbml0Ow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gICAgICAgd3JpdGVUUygpOwotICAgICAgICAgICAgICAgICAgICB3cml0ZUFjY2Vzc1VuaXQoc291cmNlSW5kZXgsIGJ1ZmZlcik7Ci0gICAgICAgICAgICAgICAgfQotCi0gICAgICAgICAgICAgICAgKyttTnVtU291cmNlc0RvbmU7Ci0gICAgICAgICAgICB9IGVsc2UgaWYgKHdoYXQgPT0gU291cmNlSW5mbzo6a05vdGlmeUJ1ZmZlcikgewotICAgICAgICAgICAgICAgIHNwPEFCdWZmZXI+IGJ1ZmZlcjsKLSAgICAgICAgICAgICAgICBDSEVDSyhtc2ctPmZpbmRCdWZmZXIoImJ1ZmZlciIsICZidWZmZXIpKTsKLQotICAgICAgICAgICAgICAgIGludDMyX3Qgb29iOwotICAgICAgICAgICAgICAgIGlmIChtc2ctPmZpbmRJbnQzMigib29iIiwgJm9vYikgJiYgb29iKSB7Ci0gICAgICAgICAgICAgICAgICAgIC8vIFRoaXMgaXMgY29kZWMgc3BlY2lmaWMgZGF0YSBkZWxpdmVyZWQgb3V0IG9mIGJhbmQuCi0gICAgICAgICAgICAgICAgICAgIC8vIEl0IGNhbiBiZSB3cml0dGVuIG91dCBpbW1lZGlhdGVseS4KLSAgICAgICAgICAgICAgICAgICAgd3JpdGVUUygpOwotICAgICAgICAgICAgICAgICAgICB3cml0ZUFjY2Vzc1VuaXQoc291cmNlSW5kZXgsIGJ1ZmZlcik7Ci0gICAgICAgICAgICAgICAgICAgIGJyZWFrOwotICAgICAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgICAgIC8vIFdlIGRvbid0IGp1c3Qgd3JpdGUgb3V0IGRhdGEgYXMgd2UgcmVjZWl2ZSBpdCBmcm9tCi0gICAgICAgICAgICAgICAgLy8gdGhlIHZhcmlvdXMgc291cmNlcy4gVGhhdCB3b3VsZCBlc3NlbnRpYWxseSB3cml0ZSB0aGVtCi0gICAgICAgICAgICAgICAgLy8gb3V0IGluIHJhbmRvbSBvcmRlciAoYXMgdGhlIHRocmVhZCBzY2hlZHVsZXIgZGV0ZXJtaW5lcwotICAgICAgICAgICAgICAgIC8vIGhvdyB0aGUgbWVzc2FnZXMgYXJlIGRpc3BhdGNoZWQpLgotICAgICAgICAgICAgICAgIC8vIEluc3RlYWQgd2UgZ2F0aGVyIGFuIGFjY2VzcyB1bml0IGZvciBhbGwgdHJhY2tzIGFuZAotICAgICAgICAgICAgICAgIC8vIHdyaXRlIG91dCB0aGUgb25lIHdpdGggdGhlIHNtYWxsZXN0IHRpbWVzdGFtcCwgdGhlbgotICAgICAgICAgICAgICAgIC8vIHJlcXVlc3QgbW9yZSBkYXRhIGZvciB0aGUgd3JpdHRlbiBvdXQgdHJhY2suCi0gICAgICAgICAgICAgICAgLy8gUmluc2UsIHJlcGVhdC4KLSAgICAgICAgICAgICAgICAvLyBJZiB3ZSBkb24ndCBoYXZlIGRhdGEgb24gYW55IHRyYWNrIHdlIGRvbid0IHdyaXRlCi0gICAgICAgICAgICAgICAgLy8gYW55dGhpbmcganVzdCB5ZXQuCi0KLSAgICAgICAgICAgICAgICBzcDxTb3VyY2VJbmZvPiBzb3VyY2UgPSBtU291cmNlcy5lZGl0SXRlbUF0KHNvdXJjZUluZGV4KTsKLQotICAgICAgICAgICAgICAgIENIRUNLKHNvdXJjZS0+bGFzdEFjY2Vzc1VuaXQoKSA9PSBOVUxMKTsKLSAgICAgICAgICAgICAgICBzb3VyY2UtPnNldExhc3RBY2Nlc3NVbml0KGJ1ZmZlcik7Ci0KLSAgICAgICAgICAgICAgICBBTE9HVigibGFzdEFjY2Vzc1VuaXRUaW1lVXNbJWRdID0gJS4yZiBzZWNzIiwKLSAgICAgICAgICAgICAgICAgICAgIHNvdXJjZUluZGV4LCBzb3VyY2UtPmxhc3RBY2Nlc3NVbml0VGltZVVzKCkgLyAxRTYpOwotCi0gICAgICAgICAgICAgICAgaW50NjRfdCBtaW5UaW1lVXMgPSAtMTsKLSAgICAgICAgICAgICAgICBzaXplX3QgbWluSW5kZXggPSAwOwotCi0gICAgICAgICAgICAgICAgZm9yIChzaXplX3QgaSA9IDA7IGkgPCBtU291cmNlcy5zaXplKCk7ICsraSkgewotICAgICAgICAgICAgICAgICAgICBjb25zdCBzcDxTb3VyY2VJbmZvPiAmc291cmNlID0gbVNvdXJjZXMuZWRpdEl0ZW1BdChpKTsKLQotICAgICAgICAgICAgICAgICAgICBpZiAoc291cmNlLT5lb3NSZWNlaXZlZCgpKSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICBjb250aW51ZTsKLSAgICAgICAgICAgICAgICAgICAgfQotCi0gICAgICAgICAgICAgICAgICAgIGludDY0X3QgdGltZVVzID0gc291cmNlLT5sYXN0QWNjZXNzVW5pdFRpbWVVcygpOwotICAgICAgICAgICAgICAgICAgICBpZiAodGltZVVzIDwgMCkgewotICAgICAgICAgICAgICAgICAgICAgICAgbWluVGltZVVzID0gLTE7Ci0gICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKLSAgICAgICAgICAgICAgICAgICAgfSBlbHNlIGlmIChtaW5UaW1lVXMgPCAwIHx8IHRpbWVVcyA8IG1pblRpbWVVcykgewotICAgICAgICAgICAgICAgICAgICAgICAgbWluVGltZVVzID0gdGltZVVzOwotICAgICAgICAgICAgICAgICAgICAgICAgbWluSW5kZXggPSBpOwotICAgICAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgfQotCi0gICAgICAgICAgICAgICAgaWYgKG1pblRpbWVVcyA8IDApIHsKLSAgICAgICAgICAgICAgICAgICAgQUxPR1YoIm5vdCBhIGFsbCB0cmFja3MgaGF2ZSB2YWxpZCBkYXRhLiIpOwotICAgICAgICAgICAgICAgICAgICBicmVhazsKLSAgICAgICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgICAgICBBTE9HVigid3JpdGluZyBhY2Nlc3MgdW5pdCBhdCB0aW1lICUuMmYgc2VjcyAoaW5kZXggJWQpIiwKLSAgICAgICAgICAgICAgICAgICAgIG1pblRpbWVVcyAvIDFFNiwgbWluSW5kZXgpOwotCi0gICA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2FjaGUsIG1DYWNoZWRTaXplKTsKLQotICAgIGlmIChlcnIgPCAoc3NpemVfdClzaXplKSB7Ci0gICAgICAgIGNsZWFyQ2FjaGUoKTsKLQotICAgICAgICByZXR1cm4gRVJST1JfSU87Ci0gICAgfQotCi0gICAgcmV0dXJuIE9LOwotfQotCi0vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLwotCi1zdGF0aWMgdm9pZCBoZXhkdW1wKGNvbnN0IHZvaWQgKl9kYXRhLCBzaXplX3Qgc2l6ZSkgewotICAgIGNvbnN0IHVpbnQ4X3QgKmRhdGEgPSAoY29uc3QgdWludDhfdCAqKV9kYXRhOwotICAgIHNpemVfdCBvZmZzZXQgPSAwOwotICAgIHdoaWxlIChvZmZzZXQgPCBzaXplKSB7Ci0gICAgICAgIHByaW50ZigiMHglMDR4ICAiLCBvZmZzZXQpOwotCi0gICAgICAgIHNpemVfdCBuID0gc2l6ZSAtIG9mZnNldDsKLSAgICAgICAgaWYgKG4gPiAxNikgewotICAgICAgICAgICAgbiA9IDE2OwotICAgICAgICB9Ci0KLSAgICAgICAgZm9yIChzaXplX3QgaSA9IDA7IGkgPCAxNjsgKytpKSB7Ci0gICAgICAgICAgICBpZiAoaSA9PSA4KSB7Ci0gICAgICAgICAgICAgICAgcHJpbnRmKCIgIik7Ci0gICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgIGlmIChvZmZzZXQgKyBpIDwgc2l6ZSkgewotICAgICAgICAgICAgICAgIHByaW50ZigiJTAyeCAiLCBkYXRhW29mZnNldCArIGldKTsKLSAgICAgICAgICAgIH0gZWxzZSB7Ci0gICAgICAgICAgICAgICAgcHJpbnRmKCIgICAiKTsKLSAgICAgICAgICAgIH0KLSAgICAgICAgfQotCi0gICAgICAgIHByaW50ZigiICIpOwotCi0gICAgICAgIGZvciAoc2l6ZV90IGkgPSAwOyBpIDwgbjsgKytpKSB7Ci0gICAgICAgICAgICBpZiAoaXNwcmludChkYXRhW29mZnNldCArIGldKSkgewotICAgICAgICAgICAgICAgIHByaW50ZigiJWMiLCBkYXRhW29mZnNldCArIGldKTsKLSAgICAgICAgICAgIH0gZWxzZSB7Ci0gICAgICAgICAgICAgICAgcHJpbnRmKCIuIik7Ci0gICAgICAgICAgICB9Ci0gICAgICAgIH0KLQotICAgICAgICBwcmludGYoIlxuIik7Ci0KLSAgICAgICAgb2Zmc2V0ICs9IDE2OwotICAgIH0KLX0KLQotc3RhdGljIGNvbnN0IGNoYXIgKkZvdXJDQzJNSU1FKHVpbnQzMl90IGZvdXJjYykgewotICAgIHN3aXRjaCAoZm91cmNjKSB7Ci0gICAgICAgIGNhc2UgRk9VUkNDKCdtJywgJ3AnLCAnNCcsICdhJyk6Ci0gICAgICAgICAgICByZXR1cm4gTUVESUFfTUlNRVRZUEVfQVVESU9fQUFDOwotCi0gICAgICAgIGNhc2UgRk9VUkNDKCdzJywgJ2EnLCAnbScsICdyJyk6Ci0gICAgICAgICAgICByZXR1cm4gTUVESUFfTUlNRVRZUEVfQVVESU9fQU1SX05COwotCi0gICAgICAgIGNhc2UgRk9VUkNDKCdzJywgJ2EnLCAndycsICdiJyk6Ci0gICAgICAgICAgICByZXR1cm4gTUVESUFfTUlNRVRZUEVfQVVESU9fQU1SX1dCOwotCi0gICAgICAgIGNhc2UgRk9VUkNDKCdtJywgJ3AnLCAnNCcsICd2Jyk6Ci0gICAgICAgICAgICByZXR1cm4gTUVESUFfTUlNRVRZUEVfVklERU9fTVBFRzQ7Ci0KLSAgICAgICAgY2FzZSBGT1VSQ0MoJ3MnLCAnMicsICc2JywgJzMnKToKLSAgICAgICAgY2FzZSBGT1VSQ0MoJ2gnLCAnMicsICc2JywgJzMnKToKLSAgICAgICAgY2FzZSBGT1VSQ0MoJ0gnLCAnMicsICc2JywgJzMnKToKLSAgICAgICAgICAgIHJldHVybiBNRURJQV9NSU1FV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ICAgICBkZWxldGUgc2luZjsKLSAgICAgICAgc2luZiA9IG5leHQ7Ci0gICAgfQotICAgIG1GaXJzdFNJTkYgPSBOVUxMOwotfQotCi1zcDxNZXRhRGF0YT4gTVBFRzRFeHRyYWN0b3I6OmdldE1ldGFEYXRhKCkgewotICAgIHN0YXR1c190IGVycjsKLSAgICBpZiAoKGVyciA9IHJlYWRNZXRhRGF0YSgpKSAhPSBPSykgewotICAgICAgICByZXR1cm4gbmV3IE1ldGFEYXRhOwotICAgIH0KLQotICAgIHJldHVybiBtRmlsZU1ldGFEYXRhOwotfQotCi1zaXplX3QgTVBFRzRFeHRyYWN0b3I6OmNvdW50VHJhY2tzKCkgewotICAgIHN0YXR1c190IGVycjsKLSAgICBpZiAoKGVyciA9IHJlYWRNZXRhRGF0YSgpKSAhPSBPSykgewotICAgICAgICByZXR1cm4gMDsKLSAgICB9Ci0KLSAgICBzaXplX3QgbiA9IDA7Ci0gICAgVHJhY2sgKnRyYWNrID0gbUZpcnN0VHJhY2s7Ci0gICAgd2hpbGUgKHRyYWNrKSB7Ci0gICAgICAgICsrbjsKLSAgICAgICAgdHJhY2sgPSB0cmFjay0+bmV4dDsKLSAgICB9Ci0KLSAgICByZXR1cm4gbjsKLX0KLQotc3A8TWV0YURhdGE+IE1QRUc0RXh0cmFjdG9yOjpnZXRUcmFja01ldGFEYXRhKAotICAgICAgICBzaXplX3QgaW5kZXgsIHVpbnQzMl90IGZsYWdzKSB7Ci0gICAgc3RhdHVzX3QgZXJyOwotICAgIGlmICgoZXJyID0gcmVhZE1ldGFEYXRhKCkpICE9IE9LKSB7Ci0gICAgICAgIHJldHVybiBOVUxMOwotICAgIH0KLQotICAgIFRyYWNrICp0cmFjayA9IG1GaXJzdFRyYWNrOwotICAgIHdoaWxlIChpbmRleCA+IDApIHsKLSAgICAgICAgaWYgKHRyYWNrID09IE5VTEwpIHsKLSAgICAgICAgICAgIHJldHVybiBOVUxMOwotICAgICAgICB9Ci0KLSAgICAgICAgdHJhY2sgPSB0cmFjay0+bmV4dDsKLSAgICAgICAgLS1pbmRleDsKLSAgICB9Ci0KLSAgICBpZiAodHJhY2sgPT0gTlVMTCkgewotICAgICAgICByZXR1cm4gTlVMTDsKLSAgICB9Ci0KLSAgICBpZiAoKGZsYWdzICYga0luY2x1ZGVFeHRlbnNpdmVNZXRhRGF0YSkKLSAgICAgICAgICAgICYmICF0cmFjay0+aW5jbHVkZXNfZXhwZW5zaXZlX21ldGFkYXRhKSB7Ci0gICAgICAgIHRyYWNrLT5pbmNsdWRlc19leHBlbnNpdmVfbWV0YWRhdGEgPSB0cnVlOwotCi0gICAgICAgIGNvbnN0IGNoYXIgKm1pbWU7Ci0gICAgICAgIENIRUNLKHRyYWNrLT5tZXRhLT5maW5kQ1N0cmluZyhrS2V5TUlNRVR5cGUsICZtaW1lKSk7Ci0gICAgICAgIGlmICghc3RybmNhc2VjbXAoInZpZGVvLyIsIG1pbWUsIDYpKSB7Ci0gICAgICAgICAgICB1aW50MzJfdCBzYW1wbGVJbmRleDsKLSAgICAgICAgICAgIHVpbnQzMl90IHNhbXBsZVRpbWU7Ci0gICAgICAgICAgICBpZiAodHJhY2stPnNhbXBsZVRhYmxlLT5maW5kVGh1bWJuYWlsU2FtcGxlKCZzYW1wbGVJbmRleCkgPT0gT0sKLSAgICAgICAgICAgICAgICAgICAgJiYgdHJhY2stPnNhbXBsZVRhYmxlLT5nZXRNZXRhRGF0YUZvclNhbXBsZSgKLSAgICAgICAgICAgICAgICAgICAgICAgIHNhbXBsZUluZGV4LCBOVUxMIC8qIG9mZnNldCAqLywgTlVMTCAvKiBzaXplICovLAotICAgICAgICAgICAgICAgICAgICAgICAgJnNhbXBsZVRpbWUpID09IE9LKSB7Ci0gICAgICAgICAgICAgICAgdHJhY2stPm1ldGEtPnNldEludDY0KAotICAgICAgICAgICAgICAgICAgICAgICAga0tleVRodW1ibmFpbFRpbWUsCi0gICAgICAgICAgICAgICAgICAgICAgICAoKGludDY0X3Qpc2FtcGxlVGlt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HRvclRhZykgewotICAgICAgICAgICAgcmV0dXJuIEVSUk9SX01BTEZPUk1FRDsKLSAgICAgICAgfQotCi0gICAgICAgIHVpbnQ4X3QgYnVmZmVyWzhdOwotICAgICAgICAvL09iamVjdERlc2NyaXB0b3JJRCBhbmQgT2JqZWN0RGVzY3JpcHRvciB1cmwgZmxhZwotICAgICAgICBpZiAobURhdGFTb3VyY2UtPnJlYWRBdChkYXRhX29mZnNldCwgYnVmZmVyLCAyKSA8IDIpIHsKLSAgICAgICAgICAgIHJldHVybiBFUlJPUl9JTzsKLSAgICAgICAgfQotICAgICAgICBkYXRhX29mZnNldCArPSAyOwotCi0gICAgICAgIGlmICgoYnVmZmVyWzFdID4+IDUpICYgMHgwMDAxKSB7IC8vdXJsIGZsYWcgaXMgc2V0Ci0gICAgICAgICAgICByZXR1cm4gRVJST1JfTUFMRk9STUVEOwotICAgICAgICB9Ci0KLSAgICAgICAgaWYgKG1EYXRhU291cmNlLT5yZWFkQXQoZGF0YV9vZmZzZXQsIGJ1ZmZlciwgOCkgPCA4KSB7Ci0gICAgICAgICAgICByZXR1cm4gRVJST1JfSU87Ci0gICAgICAgIH0KLSAgICAgICAgZGF0YV9vZmZzZXQgKz0gODsKLQotICAgICAgICBpZiAoKDB4MEYvKkVTX0lEX1JFRl9UQUcqLyAhPSBidWZmZXJbMV0pCi0gICAgICAgICAgICAgICAgfHwgKCAweDBBLypJUE1QX0RFU0NSSVBUT1JfUE9JTlRFUl9JRF9UQUcqLyAhPSBidWZmZXJbNV0pKSB7Ci0gICAgICAgICAgICByZXR1cm4gRVJST1JfTUFMRk9STUVEOwotICAgICAgICB9Ci0KLSAgICAgICAgU0lORiAqc2luZiA9IG5ldyBTSU5GOwotICAgICAgICBzaW5mLT50cmFja0lEID0gVTE2X0FUKCZidWZmZXJbM10pOwotICAgICAgICBzaW5mLT5JUE1QRGVzY3JpcHRvcklEID0gYnVmZmVyWzddOwotICAgICAgICBzaW5mLT5uZXh0ID0gbUZpcnN0U0l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ICAgICBkYXRhTGVuID0gcmVhZFNpemUoZGF0YV9vZmZzZXQsIG1EYXRhU291cmNlLCAmbnVtT2ZCeXRlcyk7Ci0gICAgICAgICAgICBpZiAoZGF0YUxlbiA8IDApIHsKLSAgICAgICAgICAgICAgICByZXR1cm4gRVJST1JfSU87Ci0gICAgICAgICAgICB9IGVsc2UgaWYgKGRhdGFMZW4gPCA0KSB7Ci0gICAgICAgICAgICAgICAgcmV0dXJuIEVSUk9SX01BTEZPUk1FRDsKLSAgICAgICAgICAgIH0KLSAgICAgICAgICAgIGRhdGFfb2Zmc2V0ICs9IG51bU9mQnl0ZXM7Ci0KLSAgICAgICAgICAgIGlmIChtRGF0YVNvdXJjZS0+cmVhZEF0KGRhdGFfb2Zmc2V0LCAmaWQsIDEpIDwgMSkgewotICAgICAgICAgICAgICAgIHJldHVybiBFUlJPUl9JTzsKLSAgICAgICAgICAgIH0KLSAgICAgICAgICAgIGRhdGFfb2Zmc2V0ICsrOwotCi0gICAgICAgICAgICBTSU5GICpzaW5mID0gbUZpcnN0U0lORjsKLSAgICAgICAgICAgIHdoaWxlIChzaW5mICYmIChzaW5mLT5JUE1QRGVzY3JpcHRvcklEICE9IGlkKSkgewotICAgICAgICAgICAgICAgIHNpbmYgPSBzaW5mLT5uZXh0OwotICAgICAgICAgICAgfQotICAgICAgICAgICAgaWYgKHNpbmYgPT0gTlVMTCkgewotICAgICAgICAgICAgICAgIHJldHVybiBFUlJPUl9NQUxGT1JNRUQ7Ci0gICAgICAgICAgICB9Ci0gICAgICAgICAgICBzaW5mLT5sZW4gPSBkYXRhTGVuIC0gMzsKLSAgICAgICAgICAgIHNpbmYtPklQTVBEYXRhID0gbmV3IGNoYXJbc2luZi0+bGVuXTsKLQotICAgICAgICAgICAgaWYgKG1EYXRhU291cmNlLT5yZWFkQXQoZGF0YV9vZmZzZXQgKyAyLCBzaW5mLT5JUE1QRGF0YSwgc2luZi0+bGVuKSA8IHNpbmYtPmxlbikgewotICAgICAgICAgICAgICA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F90IGNodW5rX3NpemUgPSBudG9obChoZHJbMF0pOwotICAgIHVpbnQzMl90IGNodW5rX3R5cGUgPSBudG9obChoZHJbMV0pOwotICAgIG9mZjY0X3QgZGF0YV9vZmZzZXQgPSAqb2Zmc2V0ICsgODsKLQotICAgIGlmIChjaHVua19zaXplID09IDEpIHsKLSAgICAgICAgaWYgKG1EYXRhU291cmNlLT5yZWFkQXQoKm9mZnNldCArIDgsICZjaHVua19zaXplLCA4KSA8IDgpIHsKLSAgICAgICAgICAgIHJldHVybiBFUlJPUl9JTzsKLSAgICAgICAgfQotICAgICAgICBjaHVua19zaXplID0gbnRvaDY0KGNodW5rX3NpemUpOwotICAgICAgICBkYXRhX29mZnNldCArPSA4OwotCi0gICAgICAgIGlmIChjaHVua19zaXplIDwgMTYpIHsKLSAgICAgICAgICAgIC8vIFRoZSBzbWFsbGVzdCB2YWxpZCBjaHVuayBpcyAxNiBieXRlcyBsb25nIGluIHRoaXMgY2FzZS4KLSAgICAgICAgICAgIHJldHVybiBFUlJPUl9NQUxGT1JNRUQ7Ci0gICAgICAgIH0KLSAgICB9IGVsc2UgaWYgKGNodW5rX3NpemUgPCA4KSB7Ci0gICAgICAgIC8vIFRoZSBzbWFsbGVzdCB2YWxpZCBjaHVuayBpcyA4IGJ5dGVzIGxvbmcuCi0gICAgICAgIHJldHVybiBFUlJPUl9NQUxGT1JNRUQ7Ci0gICAgfQotCi0gICAgY2hhciBjaHVua1s1XTsKLSAgICBNYWtlRm91ckNDU3RyaW5nKGNodW5rX3R5cGUsIGNodW5rKTsKLSAgICBBTE9HVigiY2h1bms6ICVzIEAgJWxsZCIsIGNodW5rLCAqb2Zmc2V0KTsKLQotI2lmIDAKLSAgICBzdGF0aWMgY29uc3QgY2hhciBrV2hpdGVzcGFjZVtdID0gIiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAiOwotICAgIGNvbnN0IGNoYXIgKmluZGVudCA9ICZrV2hpdGVzcGFjZVtzaXplb2Yoa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QUxPR1YoInNhbXBsZVRhYmxlIGNodW5rIGlzICVkIGJ5dGVzIGxvbmcuIiwgKHNpemVfdCljaHVua19zaXplKTsKLQotICAgICAgICAgICAgICAgIGlmIChtRGF0YVNvdXJjZS0+ZmxhZ3MoKQotICAgICAgICAgICAgICAgICAgICAgICAgJiAoRGF0YVNvdXJjZTo6a1dhbnRzUHJlZmV0Y2hpbmcKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICB8IERhdGFTb3VyY2U6OmtJc0NhY2hpbmdEYXRhU291cmNlKSkgewotICAgICAgICAgICAgICAgICAgICBzcDxNUEVHNERhdGFTb3VyY2U+IGNhY2hlZFNvdXJjZSA9Ci0gICAgICAgICAgICAgICAgICAgICAgICBuZXcgTVBFRzREYXRhU291cmNlKG1EYXRhU291cmNlKTsKLQotICAgICAgICAgICAgICAgICAgICBpZiAoY2FjaGVkU291cmNlLT5zZXRDYWNoZWRSYW5nZSgqb2Zmc2V0LCBjaHVua19zaXplKSA9PSBPSykgewotICAgICAgICAgICAgICAgICAgICAgICAgbURhdGFTb3VyY2UgPSBjYWNoZWRTb3VyY2U7Ci0gICAgICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgICAgICBtTGFzdFRyYWNrLT5zYW1wbGVUYWJsZSA9IG5ldyBTYW1wbGVUYWJsZShtRGF0YVNvdXJjZSk7Ci0gICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgIGJvb2wgaXNUcmFjayA9IGZhbHNlOwotICAgICAgICAgICAgaWYgKGNodW5rX3R5cGUgPT0gRk9VUkNDKCd0JywgJ3InLCAnYScsICdrJykpIHsKLSAgICAgICAgICAgICAgICBpc1RyYWNrID0gdHJ1ZTsKLQotICAgICAgICAgICAgICAgIFRyYWNrICp0cmFjayA9IG5ldyBUcmFjazsKLSAgICAgICAgICAgICAgICB0cmFjay0+bmV4dCA9IE5VTEw7Ci0gICAgICAgICAgICAgICAgaWYgKG1MYXN0VHJhY2spIHsKLSAgICAgICAgICAgICAgICAgICAgbUxhc3RUcmFjay0+bmV4dCA9IHRyYWNrOwotICAgICAgICAgICAgICAgIH0gZWxzZSB7Ci0gICAgICAgICAgICAgICAgICAgIG1GaXJzdFRyYWNrID0gdHJhY2s7Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgIG1MYXN0VHJhY2sgPSB0cmFjazsKLQotICAgICAgICAgICAgICAgIHRyYWNrLT5tZXRhID0gbmV3IE1ldGFEYXRhOwotICAgICAgICAgICAgICAgIHRyYWNrLT5pbmNsdWRlc19leHBlbnNpdmVfbWV0YWRhdGEgPSBmYWxzZTsKLSAgICAgICAgICAgICAgICB0cmFjay0+c2tpcFRyYWNrID0gZmFsc2U7Ci0gICAgICAgICAgICAgICAgdHJhY2stPnRpbWVzY2FsZSA9IDA7Ci0gICAgICAgICAgICAgICAgdHJhY2stPm1ldGEtPnNldENTdHJpbmcoa0tleU1JTUVUeXBlLCAiYXBwbGljYXRpb24vb2N0ZXQtc3RyZWFtIik7Ci0gICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgIG9mZjY0X3Qgc3RvcF9vZmZzZXQgPSAqb2Zmc2V0ICsgY2h1bmtfc2l6ZTsKLSAgICAgICAgICAgICpvZmZzZXQgPSBkYXRhX29mZnNldDsKLSAgICAgICAgICAgIHdoaWxlICgqb2Zmc2V0IDwgc3RvcF9vZmZzZXQpIHsKLSAgICAgICAgICAgICAgICBzdGF0dXNfdCBlcnIgPSBwYXJzZUNodW5rKG9mZnNldCwgZGVwdGggKyAxKTsKLSAgICAgICAgICAgICAgICBpZiAoZXJyICE9IE9LKSB7Ci0gICAgICAgICAgICAgICAgICAgIHJldHVybiBlcnI7Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgfQotCi0gICAgICAgICAgICBpZiAoKm9mZnNldCAhPSBzdG9wX29mZnNldCkgewotICAgICAgICAgICAgICAgIHJldHVybiBFUlJPUl9NQUxGT1JNRUQ7Ci0gICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgIGlmIChpc1RyYWNrKSB7Ci0gICAgICAgICAgICAgICAgaWYgKG1MYXN0VHJhY2stPnNraXBUcmFjaykgewotICAgICAgICAgICAgICAgICAgICBUcmFjayAqY3VyID0gbUZpcnN0VHJhY2s7Ci0KLSAgICAgICAgICAgICAgICAgICAgaWYgKGN1ciA9PSBtTGFzdFRyYWNrKSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICBkZWxldGUgY3VyOwotICAgICAgICAgICAgICAgICAgICAgICAgbUZpcnN0VHJhY2sgPSBtTGFzdFRyYWNrID0gTlVMTDsKLSAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHsKLSAgICAgICAgICAgICAgICAgICAgICAgIHdoaWxlIChjdXIgJiYgY3VyLT5uZXh0ICE9IG1MYXN0VHJhY2spIHsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBjdXIgPSBjdXItPm5leHQ7Ci0gICAgICAgICAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgICAgICAgICBjdXItPm5leHQgPSBOVUxMOwotICAgICAgICAgICAgICAgICAgICAgICAgZGVsZXRlIG1MYXN0VHJhY2s7Ci0gICAgICAgICAgICAgICAgICAgICAgICBtTGFzdFRyYWNrID0gY3VyOwotICAgICAgICAgICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgICAgICAgICAgcmV0dXJuIE9LOwotICAgICAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgICAgIHN0YXR1c190IGVyciA9IHZlcmlmeVRyYWNrKG1MYXN0VHJhY2spOwotCi0gICAgICAgICAgICAgICAgaWYgKGVyciAhPSBPSykgewotICAgICAgICAgICAgICAgICAgICByZXR1cm4gZXJyOwotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgIH0gZWxzZSBpZiAoY2h1bmtfdHlwZSA9PSBGT1VSQ0MoJ20nLCAnbycsICdvJywgJ3YnKSkgewotICAgICAgICAgICAgICAgIG1Jbml0Q2hlY2sgPSBPSzsKLQotICAgICAgICAgICAgICAgIGlmICghbUlzRHJtKSB7Ci0gICAgICAgICAgICAgICAgICAgIHJldHVybiBVTktOT1dOX0VSUk9SOyAgLy8gUmV0dXJuIGEgZHVtbXkgZXJyb3IuCi0gICAgICAgICAgICAgICAgfSBlbHNlIHsKLSAgICAgICAgICAgICAgICAgICAgcmV0dXJuIE9LOwotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgIH0KLSAgICAgICAgICAgIGJyZWFrOwotICAgICAgICB9Ci0KLSAgICAgICAgY2FzZSBGT1VSQ0MoJ3QnLCAnaycsICdoJywgJ2QnKToKLSAgICAgICAgewotICAgICAgICAgICAgc3RhdHVzX3QgZXJyOwotICAgICAgICAgICAgaWYgKChlcnIgPSBwYXJzZVRyYWNrSGVhZGVyKGRhdGFfb2Zmc2V0LCBjaHVua19kYXRhX3NpemUpKSAhPSBPSykgewotICAgICAgICAgICAgICAgIHJldHVybiBlcnI7Ci0gICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgICpvZmZzZXQgKz0gY2h1bmtfc2l6ZTsKLSAgICAgICAgICAgIGJyZWFrOwotICAgICAgICB9Ci0KLSAgICAgICAgY2FzZSBGT1VSQ0MoJ20nLCAnZCcsICdoJywgJ2QnKToKLSAgICAgICAgewotICAgICAgICAgICAgaWYgKGNodW5rX2RhdGFfc2l6ZSA8IDQpIHsKLSAgICAgICAgICAgICAgICByZXR1cm4gRVJST1JfTUFMRk9STUVEOwotICAgICAgICAgICAgfQotCi0gICAgICAgICAgICB1aW50OF90IHZlcnNpb247Ci0gICAgICAgICAgICBpZiAobURhdGFTb3VyY2UtPnJlYWRBdCgKLSAgICAgICAgICAgICAgICAgICAgICAgIGRhdGFfb2Zmc2V0LCAmdmVyc2lvbiwgc2l6ZW9mKHZlcnNpb24pKQotICAgICAgICAgICAgICAgICAgICA8IChzc2l6ZV90KXNpemVvZih2ZXJzaW9uKSkgewotICAgICAgICAgICAgICAgIHJldHVybiBFUlJPUl9JTzsKLSAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgb2ZmNjRfdCB0aW1lc2NhbGVfb2Zmc2V0OwotCi0gICAgICAgICAgICBpZiAodmVyc2lvbiA9PSAxKSB7Ci0gICAgICAgICAgICAgICAgdGltZXNjYWxlX29mZnNldCA9IGRhdGFfb2Zmc2V0ICsgNCArIDE2OwotICAgICAgICAgICAgfSBlbHNlIGlmICh2ZXJzaW9uID09IDApIHsKLSAgICAgICAgICAgICAgICB0aW1lc2NhbGVfb2Zmc2V0ID0gZGF0YV9vZmZzZXQgKyA0ICsgODsKLSAgICAgICAgICAgIH0gZWxzZSB7Ci0gICAgICAgICAgICAgICAgcmV0dXJuIEVSUk9SX0lPOwotICAgICAgICAgICAgfQotCi0gICAgICAgICAgICB1aW50MzJfdCB0aW1lc2NhbGU7Ci0gICAgICAgICAgICBpZiAobURhdGFTb3VyY2UtPnJlYWRBdCgKLSAgICAgICAgICAgICAgICAgICAgICAgIHRpbWVzY2FsZV9vZmZzZXQsICZ0aW1lc2NhbGUsIHNpemVvZih0aW1lc2NhbGUpKQotICAgICAgICAgICAgICAgICAgICA8IChzc2l6ZV90KXNpemVvZih0aW1lc2NhbGUpKSB7Ci0gICAgICAgICAgICAgICAgcmV0dXJuIEVSUk9SX0lPOwotICAgICAgICAgICAgfQotCi0gICAgICAgICAgICBtTGFzdFRyYWNrLT50aW1lc2NhbGUgPSBudG9obCh0aW1lc2NhbGUpOwotCi0gICAgICAgICAgICBpbnQ2NF90IGR1cmF0aW9uOwotICAgICAgICAgICAgaWYgKHZlcnNpb24gPT0gMSkgewotICAgICAgICAgICAgICAgIGlmIChtRGF0YVNvdXJjZS0+cmVhZEF0KAotICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRpbWVzY2FsZV9vZmZzZXQgKyA0LCAmZHVyYXRpb24sIHNpemVvZihkdXJhdGlvbikpCi0gICAgICAgICAgICAgICAgICAgICAgICA8IChzc2l6ZV90KXNpemVvZihkdXJhdGlvbikpIHsKLSAgICAgICAgICAgICAgICAgICAgcmV0dXJuIEVSUk9SX0lPOwotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICBkdXJhdGlvbiA9IG50b2g2NChkdXJhdGlvbik7Ci0gICAgICAgICAgICB9IGVsc2UgewotICAgICAgICAgICAgICAgIGludDMyX3QgZHVyYXRpb24zMjsKLSAgICAgICAgICAgICAgICBpZiAobURhdGFTb3VyY2UtPnJlYWRBdCgKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICB0aW1lc2NhbGVfb2Zmc2V0ICsgNCwgJmR1cmF0aW9uMzIsIHNpemVvZihkdXJhdGlvbjMyKSkKLSAgICAgICAgICAgICAgICAgICAgICAgIDwgKHNzaXplX3Qpc2l6ZW9mKGR1cmF0aW9uMzIpKSB7Ci0gICAgICAgICAgICAgICAgICAgIHJldHVybiBFUlJPUl9JTzsKLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgZHVyYXRpb24gPSBudG9obChkdXJhdGlvbjMyKTsKLSAgICAgICAgICAgIH0KLSAgICAgICAgICAgIG1MYXN0VHJhY2stPm1ldGEtPnNldEludDY0KAotICAgICAgICAgICAgICAgICAgICBrS2V5RHVyYXRpb24sIChkdXJhdGlvbiAqIDEwMDAwMDApIC8gbUxhc3RUcmFjay0+dGltZXNjYWxlKTsKLQotICAgICAgICAgICAgdWludDhfdCBsYW5nWzJdOwotICAgICAgICAgICAgb2ZmNjRfdCBsYW5nX29mZnNldDsKLSAgICAgICAgICAgIGlmICh2ZXJzaW9uID09IDEpIHsKLSAgICAgICAgICAgICAgICBsYW5nX29mZnNldCA9IHRpbWVzY2FsZV9vZmZzZXQgKyA0ICsgODsKLSAgICAgICAgICAgIH0gZWxzZSBpZiAodmVyc2lvbiA9PSAwKSB7Ci0gICAgICAgICAgICAgICAgbGFuZ19vZmZzZXQgPSB0aW1lc2NhbGVfb2Zmc2V0ICsgNCArIDQ7Ci0gICAgICAgICAgICB9IGVsc2UgewotICAgICAgICAgICAgICAgIHJldHVybiBFUlJPUl9JTzsKLSAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgaWYgKG1EYXRhU291cmNlLT5yZWFkQXQobGFuZ19vZmZzZXQsICZsYW5nLCBzaXplb2YobGFuZykpCi0gICAgICAgICAgICAgICAgICAgIDwgKHNzaXplX3Qpc2l6ZW9mKGxhbmcpKSB7Ci0gICAgICAgICAgICAgICAgcmV0dXJuIEVSUk9SX0lPOwotICAgICAgICAgICAgfQotCi0gICAgICAgICAgICAvLyBUbyBnZXQgdGhlIElTTy02MzktMi9UIHRocmVlIGNoYXJhY3RlciBsYW5ndWFnZSBjb2RlCi0gICAgICAgICAgICAvLyAxIGJpdCBwYWQgZm9sbG93ZWQgYnkgMyA1LWJpdHMgY2hhcmFjdGVycy4gRWFjaCBjaGFyYWN0ZXIKLSAgICAgICAgICAgIC8vIGlzIHBhY2tlZCBhcyB0aGUgZGlmZmVyZW5jZSBiZXR3ZWVuIGl0cyBBU0NJSSB2YWx1ZSBhbmQgMHg2MC4KLSAgICAgICAgICAgIGNoYXIgbGFuZ19jb2RlWzRdOwotICAgICAgICAgICAgbGFuZ19jb2RlWzBdID0gKChsYW5nWzBdID4+IDIpICYgMHgxZikgKyAweDYwOwotICAgICAgICAgICAgbGFuZ19jb2RlWzFdID0gKChsYW5nWzBdICYgMHgzKSA8PCAzIHwgKGxhbmdbMV0gPj4gNSkpICsgMHg2MDsKLSAgICAgICAgICAgIGxhbmdfY29kZVsyXSA9IChsYW5nWzFdICYgMHgxZikgKyAweDYwOwotICAgICAgICAgICAgbGFuZ19jb2RlWzNdID0gJ1wwJzsKLQotICAgICAgICAgICAgbUxhc3RUcmFjay0+bWV0YS0+c2V0Q1N0cmluZygKLSAgICAgICAgICAgICAgICAgICAga0tleU1lZGlhTGFuZ3VhZ2UsIGxhbmdfY29kZSk7Ci0KLSAgICAgICAgICAgICpvZmZzZXQgKz0gY2h1bmtfc2l6ZTsKLSAgICAgICAgICAgIGJyZWFrOwotICAgICAgICB9Ci0KLSAgICAgICAgY2FzZSBGT1VSQ0MoJ3MnLCAndCcsICdzJywgJ2QnKToKLSAgICAgICAgewotICAgICAgICAgICAgaWYgKGNodW5rX2RhdGFfc2l6ZSA8IDgpIHsKLSAgICAgICAgICAgICAgICByZXR1cm4gRVJST1JfTUFMRk9STUVEOwotICAgICAgICAgICAgfQotCi0gICAgICAgICAgICB1aW50OF90IGJ1ZmZlcls4XTsKLSAgICAgICAgICAgIGlmIChjaHVua19kYXRhX3NpemUgPCAob2ZmNjRfdClzaXplb2YoYnVmZmVyKSkgewotICAgICAgICAgICAgICAgIHJldHVybiBFUlJPUl9NQUxGT1JNRUQ7Ci0gICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgIGlmIChtRGF0YVNvdXJjZS0+cmVhZEF0KAotICAgICAgICAgICAgICAgICAgICAgICAgZGF0YV9vZmZzZXQsIGJ1ZmZlciwgOCkgPCA4KSB7Ci0gICAgICAgICAgICAgICAgcmV0dXJuIEVSUk9SX0lPOwotICAgICAgICAgICAgfQotCi0gICAgICAgICAgICBpZiAoVTMyX0FUKGJ1ZmZlcikgIT0gMCkgewotICAgICAgICAgICAgICAgIC8vIFNob3VsZCBiZSB2ZXJzaW9uIDAsIGZsYWdzIDAuCi0gICAgICAgICAgICAgICAgcmV0dXJuIEVSUk9SX01BTEZPUk1FRDsKLSAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgdWludDMyX3QgZW50cnlfY291bnQgPSBVMzJfQVQoJmJ1ZmZlcls0XSk7Ci0KLSAgICAgICAgICAgIGlmIChlbnRyeV9jb3VudCA+IDEpIHsKLSAgICAgICAgICAgICAgICAvLyBGb3IgM0dQUCB0aW1lZCB0ZXh0LCB0aGVyZSBjb3VsZCBiZSBtdWx0aXBsZSB0eDNnIGJveGVzIGNvbnRhaW4KLSAgICAgICAgICAgICAgICAvLyBtdWx0aXBsZSB0ZXh0IGRpc3BsYXkgZm9ybWF0cy4gVGhlc2UgZm9ybWF0cyB3aWxsIGJlIHVzZWQgdG8KLSAgICAgICAgICAgICAgICAvLyBkaXNwbGF5IHRoZSB0aW1lZCB0ZXh0LgotICAgICAgICAgICAgICAgIGNvbnN0IGNoYXIgKm1pbWU7Ci0gICAgICAgICAgICAgICAgQ0hFQ0sobUxhc3RUcmFjay0+bWV0YS0+ZmluZENTdHJpbmcoa0tleU1JTUVUeXBlLCAmbWltZSkpOwotICAgICAgICAgICAgICAgIGlmIChzdHJjYXNlY21wKG1pbWUsIE1FRElBX01JTUVUWVBFX1RFWFRfM0dQUCkpIHsKLSAgICAgICAgICAgICAgICAgICAgLy8gRm9yIG5vdyB3ZSBvbmx5IHN1cHBvcnQgYSBzaW5nbGUgdHlwZSBvZiBtZWRpYSBwZXIgdHJhY2suCi0gICAgICAgICAgICAgICAgICAgIG1MYXN0VHJhY2stPnNraXBUcmFjayA9IHRydWU7Ci0gICAgICAgICAgICAgICAgICAgICpvZmZzZXQgKz0gY2h1bmtfc2l6ZTsKLSAgICAgICAgICAgICAgICAgICAgYnJlYWs7Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgfQotCi0gICAgICAgICAgICBvZmY2NF90IHN0b3Bfb2Zmc2V0ID0gKm9mZnNldCArIGNodW5rX3NpemU7Ci0gICAgICAgICAgICAqb2Zmc2V0ID0gZGF0YV9vZmZzZXQgKyA4OwotICAgICAgICAgICAgZm9yICh1aW50MzJfdCBpID0gMDsgaSA8IGVudHJ5X2NvdW50OyArK2kpIHsKLSAgICAgICAgICAgICAgICBzdGF0dXNfdCBlcnIgPSBwYXJzZUNodW5rKG9mZnNldCwgZGVwdGggKyAxKTsKLSAgICAgICAgICAgICAgICBpZiAoZXJyICE9IE9LKSB7Ci0gICAgICAgICAgICAgICAgICAgIHJldHVybiBlcnI7Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgfQotCi0gICAgICAgICAgICBpZiAoKm9mZnNldCAhPSBzdG9wX29mZnNldCkgewotICAgICAgICAgICAgICAgIHJldHVybiBFUlJPUl9NQUx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2FzZWNtcChNRURJQV9NSU1FVFlQRV9BVURJT19BTVJfTkIsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgRm91ckNDMk1JTUUoY2h1bmtfdHlwZSkpKSB7Ci0gICAgICAgICAgICAgICAgLy8gQU1SIE5CIGF1ZGlvIGlzIGFsd2F5cyBtb25vLCA4a0h6Ci0gICAgICAgICAgICAgICAgbnVtX2NoYW5uZWxzID0gMTsKLSAgICAgICAgICAgICAgICBzYW1wbGVfcmF0ZSA9IDgwMDA7Ci0gICAgICAgICAgICB9IGVsc2UgaWYgKCFzdHJjYXNlY21wKE1FRElBX01JTUVUWVBFX0FVRElPX0FNUl9XQiwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBGb3VyQ0MyTUlNRShjaHVua190eXBlKSkpIHsKLSAgICAgICAgICAgICAgICAvLyBBTVIgV0IgYXVkaW8gaXMgYWx3YXlzIG1vbm8sIDE2a0h6Ci0gICAgICAgICAgICAgICAgbnVtX2NoYW5uZWxzID0gMTsKLSAgICAgICAgICAgICAgICBzYW1wbGVfcmF0ZSA9IDE2MDAwOwotICAgICAgICAgICAgfQotCi0jaWYgMAotICAgICAgICAgICAgcHJpbnRmKCIqKiogY29kaW5nPSclcycgJWQgY2hhbm5lbHMsIHNpemUgJWQsIHJhdGUgJWRcbiIsCi0gICAgICAgICAgICAgICAgICAgY2h1bmssIG51bV9jaGFubmVscywgc2FtcGxlX3NpemUsIHNhbXBsZV9yYXRlKTsKLSNlbmRpZgotCi0gICAgICAgICAgICBtTGFzdFRyYWNrLT5tZXRhLT5zZXRDU3RyaW5nKGtLZXlNSU1FVHlwZSwgRm91ckNDMk1JTUUoY2h1bmtfdHlwZSkpOwotICAgICAgICAgICAgbUxhc3RUcmFjay0+bWV0YS0+c2V0SW50MzIoa0tleUNoYW5uZWxDb3VudCwgbnVtX2NoYW5uZWxzKTsKLSAgICAgICAgICAgIG1MYXN0VHJhY2stPm1ldGEtPnNldEludDMyKGtLZXlTYW1wbGVSYXRlLCBzYW1wbGVfcmF0ZSk7Ci0KLSAgICAgICAgICAgIG9mZjY0X3Qgc3RvcF9vZmZzZXQgPSAqb2Zmc2V0ICsgY2h1bmtfc2l6ZTsKLSAgICAgICAgICAgICpvZmZzZXQgPSBkYXRhX29mZnNldCArIHNpemVvZihidWZmZXIpOwotICAgICAgICAgICAgd2hpbGUgKCpvZmZzZXQgPCBzdG9wX29mZnNldCkgewotICAgICAgICAgICAgICAgIHN0YXR1c190IGVyciA9IHBhcnNlQ2h1bmsob2Zmc2V0LCBkZXB0aCArIDEpOwotICAgICAgICAgICAgICAgIGlmIChlcnIgIT0gT0spIHsKLSAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGVycjsKLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgIGlmICgqb2Zmc2V0ICE9IHN0b3Bfb2Zmc2V0KSB7Ci0gICAgICAgICAgICAgICAgcmV0dXJuIEVSUk9SX01BTEZPUk1FRDsKLSAgICAgICAgICAgIH0KLSAgICAgICAgICAgIGJyZWFrOwotICAgICAgICB9Ci0KLSAgICAgICAgY2FzZSBGT1VSQ0MoJ20nLCAncCcsICc0JywgJ3YnKToKLSAgICAgICAgY2FzZSBGT1VSQ0MoJ3MnLCAnMicsICc2JywgJzMnKToKLSAgICAgICAgY2FzZSBGT1VSQ0MoJ0gnLCAnMicsICc2JywgJzMnKToKLSAgICAgICAgY2FzZSBGT1VSQ0MoJ2gnLCAnMicsICc2JywgJzMnKToKLSAgICAgICAgY2FzZSBGT1VSQ0MoJ2EnLCAndicsICdjJywgJzEnKToKLSAgICAgICAgewotICAgICAgICAgICAgbUhhc1ZpZGVvID0gdHJ1ZTsKLQotICAgICAgICAgICAgdWludDhfdCBidWZmZXJbNzhdOwotICAgICAgICAgICAgaWYgKGNodW5rX2RhdGFfc2l6ZSA8IChzc2l6ZV90KXNpemVvZihidWZmZXIpKSB7Ci0gICAgICAgICAgICAgICAgLy8gQmFzaWMgVm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qIGNvZGluZz0nJXMnIHdpZHRoPSVkIGhlaWdodD0lZFxuIiwKLSAgICAgICAgICAgIC8vICAgICAgICBjaHVuaywgd2lkdGgsIGhlaWdodCk7Ci0KLSAgICAgICAgICAgIG1MYXN0VHJhY2stPm1ldGEtPnNldENTdHJpbmcoa0tleU1JTUVUeXBlLCBGb3VyQ0MyTUlNRShjaHVua190eXBlKSk7Ci0gICAgICAgICAgICBtTGFzdFRyYWNrLT5tZXRhLT5zZXRJbnQzMihrS2V5V2lkdGgsIHdpZHRoKTsKLSAgICAgICAgICAgIG1MYXN0VHJhY2stPm1ldGEtPnNldEludDMyKGtLZXlIZWlnaHQsIGhlaWdodCk7Ci0KLSAgICAgICAgICAgIG9mZjY0X3Qgc3RvcF9vZmZzZXQgPSAqb2Zmc2V0ICsgY2h1bmtfc2l6ZTsKLSAgICAgICAgICAgICpvZmZzZXQgPSBkYXRhX29mZnNldCArIHNpemVvZihidWZmZXIpOwotICAgICAgICAgICAgd2hpbGUgKCpvZmZzZXQgPCBzdG9wX29mZnNldCkgewotICAgICAgICAgICAgICAgIHN0YXR1c190IGVyciA9IHBhcnNlQ2h1bmsob2Zmc2V0LCBkZXB0aCArIDEpOwotICAgICAgICAgICAgICAgIGlmIChlcnIgIT0gT0spIHsKLSAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGVycjsKLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgIGlmICgqb2Zmc2V0ICE9IHN0b3Bfb2Zmc2V0KSB7Ci0gICAgICAgICAgICAgICAgcmV0dXJuIEVSUk9SX01BTEZPUk1FRDsKLSAgICAgICAgICAgIH0KLSAgICAgICAgICAgIGJyZWFrOwotICAgICAgICB9Ci0KLSAgICAgICAgY2FzZSBGT1VSQ0MoJ3MnLCAndCcsICdjJywgJ28nKToKLSAgICAgICAgY2FzZSBGT1VSQ0MoJ2MnLCAnbycsICc2JywgJzQnKToKLSAgICAgICAgewotICAgICAgICAgICAgc3RhdHVzX3QgZXJyID0KLSAgICAgICAgICAgICAgICBtTGFzdFRyYWNrLT5zYW1wbGVUYWJsZS0+c2V0Q2h1bmtPZmZzZXRQYXJhbXMoCi0gICAgICAgICAgICAgICAgICAgICAgICBjaHVua190eXBlLCBkYXRhX29mZnNldCwgY2h1bmtfZGF0YV9zaXplKTsKLQotICAgICAgICAgICAgaWYgKGVyciAhPSBPSykgewotICAgICAgICAgICAgICAgIHJldHVybiBlcnI7Ci0gICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgICpvZmZzZXQgKz0gY2h1bmtfc2l6ZTsKLSAgICAgICAgICAgIGJyZWFrOwotICAgICAgICB9Ci0KLSAgICAgICAgY2FzZSBGT1VSQ0MoJ3MnLCAndCcsICdzJywgJ2MnKToKLSAgICAgICAgewotICAgICAgICAgICAgc3RhdHVzX3QgZXJyID0KLSAgICAgICAgICAgICAgICBtTGFzdFRyYWNrLT5zYW1wbGVUYWJsZS0+c2V0U2FtcGxlVG9DaHVua1BhcmFtcygKLSAgICAgICAgICAgICAgICAgICAgICAgIGRhdGFfb2Zmc2V0LCBjaHVua19kYXRhX3NpemUpOwotCi0gICAgICAgICAgICBpZiAoZXJyICE9IE9LKSB7Ci0gICAgICAgICAgICAgICAgcmV0dXJuIGVycjsKLSAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgKm9mZnNldCArPSBjaHVua19zaXplOwotICAgICAgICAgICAgYnJlYWs7Ci0gICAgICAgIH0KLQotICAgICAgICBjYXNlIEZPVVJDQygncycsICd0JywgJ3MnLCAneicpOgotICAgICAgICBjYXNlIEZPVVJDQygncycsICd0JywgJ3onLCAnMicpOgotICAgICAgICB7Ci0gICAgICAgICAgICBzdGF0dXNfdCBlcnIgPQotICAgICAgICAgICAgICAgIG1MYXN0VHJhY2stPnNhbXBsZVRhYmxlLT5zZXRTYW1wbGVTaXplUGFyYW1zKAotICAgICAgICAgICAgICAgICAgICAgICAgY2h1bmtfdHlwZSwgZGF0YV9vZmZzZXQsI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0gICAgICAgICAgICBpZiAoIXN0cm5jYXNlY21wKCJ2aWRlby8iLCBtaW1lLCA2KSkgewotICAgICAgICAgICAgICAgIHNpemVfdCBuU2FtcGxlcyA9IG1MYXN0VHJhY2stPnNhbXBsZVRhYmxlLT5jb3VudFNhbXBsZXMoKTsKLSAgICAgICAgICAgICAgICBpbnQ2NF90IGR1cmF0aW9uVXM7Ci0gICAgICAgICAgICAgICAgaWYgKG1MYXN0VHJhY2stPm1ldGEtPmZpbmRJbnQ2NChrS2V5RHVyYXRpb24sICZkdXJhdGlvblVzKSkgewotICAgICAgICAgICAgICAgICAgICBpZiAoZHVyYXRpb25VcyA+IDApIHsKLSAgICAgICAgICAgICAgICAgICAgICAgIGludDMyX3QgZnJhbWVSYXRlID0gKG5TYW1wbGVzICogMTAwMDAwMExMICsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChkdXJhdGlvblVzID4+IDEpKSAvIGR1cmF0aW9uVXM7Ci0gICAgICAgICAgICAgICAgICAgICAgICBtTGFzdFRyYWNrLT5tZXRhLT5zZXRJbnQzMihrS2V5RnJhbWVSYXRlLCBmcmFtZVJhdGUpOwotICAgICAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgfQotCi0gICAgICAgICAgICBicmVhazsKLSAgICAgICAgfQotCi0gICAgICAgIGNhc2UgRk9VUkNDKCdzJywgJ3QnLCAndCcsICdzJyk6Ci0gICAgICAgIHsKLSAgICAgICAgICAgIHN0YXR1c190IGVyciA9Ci0gICAgICAgICAgICAgICAgbUxhc3RUcmFjay0+c2FtcGxlVGFibGUtPnNldFRpbWVUb1NhbXBsZVBhcmFtcygKLSAgICAgICAgICAgICAgICAgICAgICAgIGRhdGFfb2Zmc2V0LCBjaHVua19kYXRhX3NpemUpOwotCi0gICAgICAgICAgICBpZiAoZXJyICE9IE9LKSB7Ci0gICAgICAgICAgICAgICAgcmV0dXJuIGVycjsKLSAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgKm9mZnNldCArPSBjaHVua19zaXplOwotICAgICAgICAgICAgYnJlYWs7Ci0gICAgICAgIH0KLQotICAgICAgICBjYXNlIEZPVVJDQygnYycsICd0JywgJ3QnLCAncycpOgotICAgICAgICB7Ci0gICAgICAgICAgICBzdGF0dXNfdCBlcnIgPQotICAgICAgICAgICAgICAgIG1MYXN0VHJhY2stPnNhbXBsZVRhYmxlLT5zZXRDb21wb3NpdGlvblRpbWVUb1NhbXBsZVBhcmFtcygKLSAgICAgICAgICAgICAgICAgICAgICAgIGRhdGFfb2Zmc2V0LCBjaHVua19kYXRhX3NpemUpOwotCi0gICAgICAgICAgICBpZiAoZXJyICE9IE9LKSB7Ci0gICAgICAgICAgICAgICAgcmV0dXJuIGVycjsKLSAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgKm9mZnNldCArPSBjaHVua19zaXplOwotICAgICAgICAgICAgYnJlYWs7Ci0gICAgICAgIH0KLQotICAgICAgICBjYXNlIEZPVVJDQygncycsICd0JywgJ3MnLCAncycpOgotICAgICAgICB7Ci0gICAgICAgICAgICBzdGF0dXNfdCBlcnIgPQotICAgICAgICAgICAgICAgIG1MYXN0VHJhY2stPnNhbXBsZVRhYmxlLT5zZXRTeW5jU2FtcGxlUGFyYW1zKAotICAgICAgICAgICAgICAgICAgICAgICAgZGF0YV9vZmZzZXQsIGNodW5rX2RhdGFfc2l6ZSk7Ci0KLSAgICAgICAgICAgIGlmIChlcnIgIT0gT0spIHsKLSAgICAgICAgICAgICAgICByZXR1cm4gZXJyOwotICAgICAgICAgICAgfQotCi0gICAgICAgICAgICAqb2Zmc2V0ICs9IGNodW5rX3NpemU7Ci0gICAgICAgICAgICBicmVhazsKLSAgICAgICAgfQotCi0gICAgICAgIC8vIEB4eXoKLSAgICAgICAgY2FzZSBGT1VSQ0MoJ1x4QTknLCAneCcsICd5JywgJ3onKToKLSAgICAgICAgewotICAgICAgICAgICAgLy8gQmVzdCBjYXNlIHRoZSB0b3RhbCBk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b2ZmNjRfdCBsb2NhdGlvbl9sZW5ndGggPSBjaHVua19kYXRhX3NpemUgLSA1OwotICAgICAgICAgICAgaWYgKGxvY2F0aW9uX2xlbmd0aCA+PSAob2ZmNjRfdCkgc2l6ZW9mKGJ1ZmZlcikpIHsKLSAgICAgICAgICAgICAgICByZXR1cm4gRVJST1JfTUFMRk9STUVEOwotICAgICAgICAgICAgfQotCi0gICAgICAgICAgICBpZiAobURhdGFTb3VyY2UtPnJlYWRBdCgKLSAgICAgICAgICAgICAgICAgICAgICAgIGRhdGFfb2Zmc2V0ICsgNCwgYnVmZmVyLCBsb2NhdGlvbl9sZW5ndGgpIDwgbG9jYXRpb25fbGVuZ3RoKSB7Ci0gICAgICAgICAgICAgICAgcmV0dXJuIEVSUk9SX0lPOwotICAgICAgICAgICAgfQotCi0gICAgICAgICAgICBidWZmZXJbbG9jYXRpb25fbGVuZ3RoXSA9ICdcMCc7Ci0gICAgICAgICAgICBtRmlsZU1ldGFEYXRhLT5zZXRDU3RyaW5nKGtLZXlMb2NhdGlvbiwgYnVmZmVyKTsKLSAgICAgICAgICAgICpvZmZzZXQgKz0gY2h1bmtfc2l6ZTsKLSAgICAgICAgICAgIGJyZWFrOwotICAgICAgICB9Ci0KLSAgICAgICAgY2FzZSBGT1VSQ0MoJ2UnLCAncycsICdkJywgJ3MnKToKLSAgICAgICAgewotICAgICAgICAgICAgaWYgKGNodW5rX2RhdGFfc2l6ZSA8IDQpIHsKLSAgICAgICAgICAgICAgICByZXR1cm4gRVJST1JfTUFMRk9STUVEOwotICAgICAgICAgICAgfQotCi0gICAgICAgICAgICB1aW50OF90IGJ1ZmZlclsyNTZdOwotICAgICAgICAgICAgaWYgKGNodW5rX2RhdGFfc2l6ZSA+IChvZmY2NF90KXNpemVvZihidWZmZXIpKSB7Ci0gICAgICAgICAgICAgICAgcmV0dXJuIEVSUk9SX0JVRkZFUl9UT09fU01BTEw7Ci0gICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgIGlmIChtRGF0YVNvdXJjZS0+cmVhZEF0KAotICAgICAgICAgICAgICAgICAgICAgICAgZGF0YV9vZmZzZXQsIGJ1ZmZlciwgY2h1bmtfZGF0YV9zaXplKSA8IGNodW5rX2RhdGFfc2l6ZSkgewotICAgICAgICAgICAgICAgIHJldHVybiBFUlJPUl9JTzsKLSAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgaWYgKFUzMl9BVChidWZmZXIpICE9IDApIHsKLSAgICAgICAgICAgICAgICAvLyBTaG91bGQgYmUgdmVyc2lvbiAwLCBmbGFncyAwLgotICAgICAgICAgICAgICAgIHJldHVybiBFUlJPUl9NQUxGT1JNRUQ7Ci0gICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgIG1MYXN0VHJhY2stPm1ldGEtPnNldERhdGEoCi0gICAgICAgICAgICAgICAgICAgIGtLZXlFU0RTLCBrVHlwZUVTRFMsICZidWZmZXJbNF0sIGNodW5rX2RhdGFfc2l6ZSAtIDQpOwotCi0gICAgICAgICAgICBpZiAobVBhdGguc2l6ZSgpID49IDIKLSAgICAgICAgICAgICAgICAgICAgJiYgbVBhdGhbbVBhdGguc2l6ZSgpIC0gMl0gPT0gRk9VUkNDKCdtJywgJ3AnLCAnNCcsICdhJykpIHsKLSAgICAgICAgICAgICAgICAvLyBJbmZvcm1hdGlvbiBmcm9tIHRoZSBFU0RTIG11c3QgYmUgcmVsaWVkIG9uIGZvciBwcm9wZXIKLSAgICAgICAgICAgICAgICAvLyBzZXR1cCBvZiBzYW1wbGUgcmF0ZSBhbmQgY2hhbm5lbCBjb3VudCBmb3IgTVBFRzQgQXVkaW8uCi0gICAgICAgICAgICAgICAgLy8gVGhlIGdlbmVyaWMgaGVhZGVyIGFwcGVhcnMgdG8gb25seSBjb250YWluIGdlbmVyaWMKLSAgICAgICAgICAgICAgICAvLyBpbmZvcm1hdGlvbi4uLgotCi0gICAgICAgICAgICAgICAgc3RhdHVzX3QgZXJyID0gdXBkYXRlQXVkaW9UcmFja0luZm9Gcm9tRVNEU19NUEVHNEF1ZGlvKAotICAgICAgICAgICAgICAgICAgICAgICAgJmJ1ZmZlcls0XSwgY2h1bmtfZGF0YV9zaXplIC0gNCk7Ci0KLSAgICAgICAgICAgICAgICBpZiAoZXJyICE9IE9LKSB7Ci0gICAgICAgICAgICAgICAgICAgIHJldHVybiBlcnI7Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgfQotCi0gICAgICAgICAgICAqb2Zmc2V0ICs9IGNodW5rX3NpemU7Ci0gICAgICAgICAgICBicmVhazsKLSAgICAgICAgfQotCi0gICAgICAgIGNhc2UgRk9VUkNDKCdhJywgJ3YnLCAnYycsICdDJyk6Ci0gICAgICAgIHsKLSAgICAgICAgICAgIGNoYXIgYnVmZmVyWzI1Nl07Ci0gICAgICAgICAgICBpZiAoY2h1bmtfZGF0YV9zaXplID4gKG9mZjY0X3Qpc2l6ZW9mKGJ1ZmZlcikpIHsKLSAgICAgICAgICAgICAgICByZXR1cm4gRVJST1JfQlVGRkVSX1RPT19TTUFMTDsKLSAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgaWYgKG1EYXRhU291cmNlLT5yZWFkQXQoCi0gICAgICAgICAgICAgICAgICAgICAgICBkYXRhX29mZnNldCwgYnVmZmVyLCBjaHVua19kYXRhX3NpemUpIDwgY2h1bmtfZGF0YV9zaXplKSB7Ci0gICAgICAgICAgICAgICAgcmV0dXJuIEVSUk9SX0lPOwotICAgICAgICAgICAgfQotCi0gICAgICAgICAgICBtTGFzdFRyYWNrLT5tZXRhLT5zZXREYXRhKAotICAgICAgICAgICAgICAgICAgICBrS2V5QVZDQywga1R5cGVBVkNDLCBidWZmZXIsIGNodW5rX2RhdGFfc2l6ZSk7Ci0KLSAgICAgICAgICAgICpvZmZzZXQgKz0gY2h1bmtfc2l6ZTsKLSAgICAgICAgICAgIGJyZWFrOwotICAgICAgICB9Ci0KLSAgICAgICAgY2FzZSBGT1VSQ0MoJ2QnLCAnMicsICc2JywgJzMnKToKLSAgICAgICAgewotICAgICAgICAgICAgLyoKLSAgICAgICAgICAgICAqIGQyNjMgY29udGFpbnMgYSBmaXhlZCA3IGJ5dGVzIHBhcnQ6Ci0gICAgICAgICAgICAgKiAgIHZlbmRvciAtIDQgYnl0ZXMKLSAgICAgICAgICAgICAqICAgdmVyc2lvbiAtIDEgYnl0ZQotICAgICAgICAgICAgICogICBsZXZlbCAtIDEgYnl0ZQotICAgICAgICAgICAgICogICBwcm9maWxlIC0gMSBieXRlCi0gICAgICAgICAgICAgKiBvcHRpb25hbGx5LCAiZDI2MyIgYm94IGl0c2VsZiBtYXkgY29udGFpbiBhIDE2LWJ5dGUKLSAgICAgICAgICAgICAqIGJpdCByYXRlIGJveCAoYml0cikKLSAgICAgICAgICAgICAqICAgYXZlcmFnZSBiaXQgcmF0ZSAtIDQgYnl0ZXMKLSAgICAgICAgICAgICAqICAgbWF4IGJpdCByYXRlIC0gNCBieXRlcwotICAgICAgICAgICAgICovCi0gICAgICAgICAgICBjaGFyIGJ1ZmZlclsyM107Ci0gICAgICAgICAgICBpZiAoY2h1bmtfZGF0YV9zaXplICE9IDcgJiYKLSAgICAgICAgICAgICAgICBjaHVua19kYXRhX3NpemUgIT0gMjMpIHsKLSAgICAgICAgICAgICAgICBBTE9HRSgiSW5jb3JyZWN0IEQyNjMgYm94IHNpemUgJWxsZCIsIGNodW5rX2RhdGFfc2l6ZSk7Ci0gICAgICAgICAgICAgICAgcmV0dXJuIEVSUk9SX01BTEZPUk1FRDsKLSAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgaWYgKG1EYXRhU291cmNlLT5yZWFkQXQoCi0gICAgICAgICAgICAgICAgICAgIGRhdGFfb2Zmc2V0LCBidWZmZXIsIGNodW5rX2RhdGFfc2l6ZSkgPCBjaHVua19kYXRhX3NpemUpIHsKLSAgICAgICAgICAgICAgICByZXR1cm4gRVJST1JfSU87Ci0gICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgIG1MYXN0VHJhY2stPm1ldGEtPnNldERhdGEoa0tleUQyNjMsIGtUeXBlRDI2MywgYnVmZmVyLCBjaHVua19kYXRhX3NpemUpOwotCi0gICAgICAgICAgICAqb2Zmc2V0ICs9IGNodW5rX3NpemU7Ci0gICAgICAgICAgICBicmVhazsKLSAgICAgICAgfQotCi0gICAgICAgIGNhc2UgRk9VUkNDKCdtJywgJ2UnLCAndCcsICdhJyk6Ci0gICAgICAgIHsKLSAgICAgICAgICAgIHVpbnQ4X3QgYnVmZmVyWzRdOwotICAgICAgICAgICAgaWYgKGNodW5rX2RhdGFfc2l6ZSA8IChvZmY2NF90KXNpemVvZihidWZmZXIpKSB7Ci0gICAgICAgICAgICAgICAgcmV0dXJuIEVSUk9SX01BTEZPUk1FRDsKLSAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgaWYgKG1EYXRhU291cmNlLT5yZWFkQXQoCi0gICAgICAgICAgICAgICAgICAgICAgICBkYXRhX29mZnNldCwgYnVmZmVyLCA0KSA8IDQpIHsKLSAgICAgICAgICAgICAgICByZXR1cm4gRVJST1JfSU87Ci0gICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgIGlmIChVMzJfQVQoYnVmZmVyKSAhPSAwKSB7Ci0gICAgICAgICAgICAgICAgLy8gU2hvdWxkIGJlIHZlcnNpb24gMCwgZmxhZ3MgMC4KLQotICAgICAgICAgICAgICAgIC8vIElmIGl0J3Mgbm90LCBsZXQncyBhc3N1bWUgdGhpcyBpcyBvbmUgb2YgdGhvc2UKLSAgICAgICAgICAgICAgICAvLyBhcHBhcmVudGx5IG1hbGZvcm1lZCBjaHVua3MgdGhhdCBkb24ndCBoYXZlIGZsYWdzCi0gICAgICAgICAgICAgICAgLy8gYW5kIGNvbXBsZXRlbHkgZGlmZmVyZW50IHNlbWFudGljcyB0aGFuIHdoYXQncwotICAgICAgICAgICAgICAgIC8vIGluIHRoZSBNUEVHNCBzcGVjcyBhbmQgc2tpcCBpdC4KLSAgICAgICAgICAgICAgICAqb2Zmc2V0ICs9IGNodW5rX3NpemU7Ci0gICAgICAgICAgICAgICAgcmV0dXJuIE9LOwotICAgICAgICAgICAgfQotCi0gICAgICAgICAgICBvZmY2NF90IHN0b3Bfb2Zmc2V0ID0gKm9mZnNldCArIGNodW5rX3NpemU7Ci0gICAgICAgICAgICAqb2Zmc2V0ID0gZGF0YV9vZmZzZXQgKyBzaXplb2YoYnVmZmVyKTsKLSAgICAgICAgICAgIHdoaWxlICgqb2Zmc2V0IDwgc3RvcF9vZmZzZXQpIHsKLSAgICAgICAgICAgICAgICBzdGF0dXNfdCBlcnIgPSBwYXJzZUNodW5rKG9mZnNldCwgZGVwdGggKyAxKTsKLSAgICAgICAgICAgICAgICBpZiAoZXJyICE9IE9LKSB7Ci0gICAgICAgICAgICAgICAgICAgIHJldHVybiBlcnI7Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgfQotCi0gICAgICAgICAgICBpZiAoKm9mZnNldCAhPSBzdG9wX29mZnNldCkgewotICAgICAgICAgICAgICAgIHJldHVybiBFUlJPUl9NQUxGT1JNRUQ7Ci0gICAgICAgICAgICB9Ci0gICAgICAgICAgICBicmVhazsKLSAgICAgICAgfQotCi0gICAgICAgIGNhc2UgRk9VUkNDKCdtJywgJ2UnLCAnYScsICduJyk6Ci0gICAgICAgIGNhc2UgRk9VUkNDKCduJywgJ2EnLCAnbScsICdlJyk6Ci0gICAgICAgIGNhc2UgRk9VUkNDKCdkJywgJ2EnLCAndCcsICdhJyk6Ci0gICAgICAgIHsKLSAgICAgICAgICAgIGlmIChtUGF0aC5zaXplKCkgPT0gNiAmJiB1bmRlck1ldGFEYXRhUGF0aChtUGF0aCkpIHsKLSAgICAgICAgICAgICAgICBzdGF0dXNfdCBlcnIgPSBwYXJzZU1ldGFEYXRhKGRhdGFfb2Zmc2V0LCBjaHVua19kYXRhX3NpemUpOwotCi0gICAgICAgICAgICAgICAgaWYgKGVyciAhPSBPSykgewotICAgICAgICAgICAgICAgICAgICByZXR1cm4gZXJyOwotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgKm9mZnNldCArPSBjaHVua19zaXplOwotICAgICAgICAgICAgYnJlYWs7Ci0gICAgICAgIH0KLQotICAgICAgICBjYXNlIEZPVVJDQygnbScsICd2JywgJ2gnLCAnZCcpOgotICAgICAgICB7Ci0gICAgICAgICAgICBpZiAoY2h1bmtfZGF0YV9zaXplIDwgMTIpIHsKLSAgICAgICAgICAgICAgICByZXR1cm4gRVJST1JfTUFMRk9STUVEOwotICAgICAgICAgICAgfQotCi0gICAgICAgICAgICB1aW50OF90IGhlYWRlclsxMl07Ci0gICAgICAgICAgICBpZiAobURhdGFTb3VyY2UtPnJlYWRBdCgKLSAgICAgICAgICAgICAgICAgICAgICAgIGRhdGFfb2Zmc2V0LCBoZWFkZXIsIHNpemVvZihoZWFkZXIpKQotICAgICAgICAgICAgICAgICAgICA8IChzc2l6ZV90KXNpemVvZihoZWFkZXIpKSB7Ci0gICAgICAgICAgICAgICAgcmV0dXJuIEVSUk9SX0lPOwotICAgICAgICAgICAgfQotCi0gICAgICAgICAgICBpbnQ2NF90IGNyZWF0aW9uVGltZTsKLSAgICAgICAgICAgIGlmIChoZWFkZXJbMF0gPT0gMSkgewotICAgICAgICAgICAgICAgIGNyZWF0aW9uVGltZSA9IFU2NF9BVCgmaGVhZGVyWzRdKTsKLSAgICAgICAgICAgIH0gZWxzZSBpZiAoaGVhZGVyWzBdICE9IDApIHsKLSAgICAgICAgICAgICAgICByZXR1cm4gRVJST1JfTUFMRk9STUVEOwotICAgICAgICAgICAgfSBlbHNlIHsKLSAgICAgICAgICAgICAgICBjcmVhdGlvblRpbWUgPSBVMzJfQVQoJmhlYWRlcls0XSk7Ci0gICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgIFN0cmluZzggczsKLSAgICAgICAgICAgIGNvbnZlcnRUaW1lVG9EYXRlKGNyZWF0aW9uVGltZSwgJnMpOwotCi0gICAgICAgICAgICBtRmlsZU1ldGFEYXRhLT5zZXRDU3RyaW5nKGtLZXlEYXRlLCBzLnN0cmluZygpKTsKLQotICAgICAgICAgICAgKm9mZnNldCArPSBjaHVua19zaXplOwotICAgICAgICAgICAgYnJlYWs7Ci0gICAgICAgIH0KLQotICAgICAgICBjYXNlIEZPVVJDQygnbScsICdkJywgJ2EnLCAndCcpOgotICAgICAgICB7Ci0gICAgICAgICAgICBpZiAoIW1Jc0RybSkgewotICAgICAgICAgICAgICAgICpvZmZzZXQgKz0gY2h1bmtfc2l6ZTsKLSAgICAgICAgICAgICAgICBicmVhazsKLSAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgaWYgKGNodW5rX3NpemUgPCA4KSB7Ci0gICAgICAgICAgICAgICAgcmV0dXJuIEVSUk9SX01BTEZPUk1FRDsKLSAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgcmV0dXJuIHBhcnNlRHJtU0lORihvZmZzZXQsIGRhdGFfb2Zmc2V0KTsKLSAgICAgICAgfQotCi0gICAgICAgIGNhc2UgRk9VUkNDKCdoJywgJ2QnLCAnbCcsICdyJyk6Ci0gICAgICAgIHsKLSAgICAgICAgICAgIHVpbnQzMl90IGJ1ZmZlcjsKLSAgICAgICAgICAgIGlmIChtRGF0YVNvdXJjZS0+cmVhZEF0KAotICAgICAgICAgICAgICAgICAgICAgICAgZGF0YV9vZmZzZXQgKyA4LCAmYnVmZmVyLCA0KSA8IDQpIHsKLSAgICAgICAgICAgICAgICByZXR1cm4gRVJST1JfSU87Ci0gICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgIHVpbnQzMl90IHR5cGUgPSBudG9obChidWZmZXIpOwotICAgICAgICAgICAgLy8gRm9yIHRoZSAzR1BQIGZpbGUgZm9ybWF0LCB0aGUgaGFuZGxlci10eXBlIHdpdGhpbiB0aGUgJ2hkbHInIGJveAotICAgICAgICAgICAgLy8gc2hhbGwgYmUgJ3RleHQnLiBXZSBhbHNvIHdhbnQgdG8gc3VwcG9ydCAnc2J0bCcgaGFuZGxlciB0eXBlCi0gICA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XQsIGJ1ZmZlciArIHNpemUsIGNodW5rX3NpemUpKQotICAgICAgICAgICAgICAgICAgICA8IGNodW5rX3NpemUpIHsKLSAgICAgICAgICAgICAgICBkZWxldGVbXSBidWZmZXI7Ci0gICAgICAgICAgICAgICAgYnVmZmVyID0gTlVMTDsKLQotICAgICAgICAgICAgICAgIHJldHVybiBFUlJPUl9JTzsKLSAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgbUxhc3RUcmFjay0+bWV0YS0+c2V0RGF0YSgKLSAgICAgICAgICAgICAgICAgICAga0tleVRleHRGb3JtYXREYXRhLCAwLCBidWZmZXIsIHNpemUgKyBjaHVua19zaXplKTsKLQotICAgICAgICAgICAgZGVsZXRlW10gYnVmZmVyOwotCi0gICAgICAgICAgICAqb2Zmc2V0ICs9IGNodW5rX3NpemU7Ci0gICAgICAgICAgICBicmVhazsKLSAgICAgICAgfQotCi0gICAgICAgIGNhc2UgRk9VUkNDKCdjJywgJ28nLCAndicsICdyJyk6Ci0gICAgICAgIHsKLSAgICAgICAgICAgIGlmIChtRmlsZU1ldGFEYXRhICE9IE5VTEwpIHsKLSAgICAgICAgICAgICAgICBBTE9HVigiY2h1bmtfZGF0YV9zaXplID0gJWxsZCBhbmQgZGF0YV9vZmZzZXQgPSAlbGxkIiwKLSAgICAgICAgICAgICAgICAgICAgICAgIGNodW5rX2RhdGFfc2l6ZSwgZGF0YV9vZmZzZXQpOwotICAgICAgICAgICAgICAgIHVpbnQ4X3QgKmJ1ZmZlciA9IG5ldyB1aW50OF90W2NodW5rX2RhdGFfc2l6ZSArIDFdOwotICAgICAgICAgICAgICAgIGlmIChtRGF0YVNvdXJjZS0+cmVhZEF0KAotICAgICAgICAgICAgICAgICAgICBkYXRhX29mZnNldCwgYnVmZmVyLCBjaHVua19kYXRhX3NpemUpICE9IChzc2l6ZV90KWNodW5rX2RhdGFfc2l6ZSkgewotICAgICAgICAgICAgICAgICAgICBkZWxldGVbXSBidWZmZXI7Ci0gICAgICAgICAgICAgICAgICAgIGJ1ZmZlciA9IE5VTEw7Ci0KLSAgICAgICAgICAgICAgICAgICAgcmV0dXJuIEVSUk9SX0lPOwotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICBjb25zdCBpbnQga1NraXBCeXRlc09mRGF0YUJveCA9IDE2OwotICAgICAgICAgICAgICAgIG1GaWxlTWV0YURhdGEtPnNldERhdGEoCi0gICAgICAgICAgICAgICAgICAgIGtLZXlBbGJ1bUFydCwgTWV0YURhdGE6OlRZUEVfTk9ORSwKLSAgICAgICAgICAgICAgICAgICAgYnVmZmVyICsga1NraXBCeXRlc09mRGF0YUJveCwgY2h1bmtfZGF0YV9zaXplIC0ga1NraXBCeXRlc09mRGF0YUJveCk7Ci0gICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgICpvZmZzZXQgKz0gY2h1bmtfc2l6ZTsKLSAgICAgICAgICAgIGJyZWFrOwotICAgICAgICB9Ci0KLSAgICAgICAgY2FzZSBGT1VSQ0MoJy0nLCAnLScsICctJywgJy0nKToKLSAgICAgICAgewotICAgICAgICAgICAgbUxhc3RDb21tZW50TWVhbi5jbGVhcigpOwotICAgICAgICAgICAgbUxhc3RDb21tZW50TmFtZS5jbGVhcigpOwotICAgICAgICAgICAgbUxhc3RDb21tZW50RGF0YS5jbGVhcigpOwotICAgICAgICAgICAgKm9mZnNldCArPSBjaHVua19zaXplOwotICAgICAgICAgICAgYnJlYWs7Ci0gICAgICAgIH0KLQotICAgICAgICBkZWZhdWx0OgotICAgICAgICB7Ci0gICAgICAgICAgICAqb2Zmc2V0ICs9IGNodW5rX3NpemU7Ci0gICAgICAgICAgICBicmVhazsKLSAgICAgICAgfQotICAgIH0KLQotICAgIHJldHVybiBPSzsKLX0KLQotc3RhdHVzX3QgTVBFRzRFeHRyYWN0b3I6OnBhcnNlVHJhY2tIZWFkZXIoCi0gICAgICAgIG9mZjY0X3QgZGF0YV9vZmZzZXQsIG9mZjY0X3QgZGF0YV9zaXplKSB7Ci0gICAgaW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gc3dpdGNoIChtUGF0aFs0XSkgewotICAgICAgICBjYXNlIEZPVVJDQygweGE5LCAnYScsICdsJywgJ2InKToKLSAgICAgICAgewotICAgICAgICAgICAgbWV0YWRhdGFLZXkgPSBrS2V5QWxidW07Ci0gICAgICAgICAgICBicmVhazsKLSAgICAgICAgfQotICAgICAgICBjYXNlIEZPVVJDQygweGE5LCAnQScsICdSJywgJ1QnKToKLSAgICAgICAgewotICAgICAgICAgICAgbWV0YWRhdGFLZXkgPSBrS2V5QXJ0aXN0OwotICAgICAgICAgICAgYnJlYWs7Ci0gICAgICAgIH0KLSAgICAgICAgY2FzZSBGT1VSQ0MoJ2EnLCAnQScsICdSJywgJ1QnKToKLSAgICAgICAgewotICAgICAgICAgICAgbWV0YWRhdGFLZXkgPSBrS2V5QWxidW1BcnRpc3Q7Ci0gICAgICAgICAgICBicmVhazsKLSAgICAgICAgfQotICAgICAgICBjYXNlIEZPVVJDQygweGE5LCAnZCcsICdhJywgJ3knKToKLSAgICAgICAgewotICAgICAgICAgICAgbWV0YWRhdGFLZXkgPSBrS2V5WWVhcjsKLSAgICAgICAgICAgIGJyZWFrOwotICAgICAgICB9Ci0gICAgICAgIGNhc2UgRk9VUkNDKDB4YTksICduJywgJ2EnLCAnbScpOgotICAgICAgICB7Ci0gICAgICAgICAgICBtZXRhZGF0YUtleSA9IGtLZXlUaXRsZTsKLSAgICAgICAgICAgIGJyZWFrOwotICAgICAgICB9Ci0gICAgICAgIGNhc2UgRk9VUkNDKDB4YTksICd3JywgJ3InLCAndCcpOgotICAgICAgICB7Ci0gICAgICAgICAgICBtZXRhZGF0YUtleSA9IGtLZXlXcml0ZXI7Ci0gICAgICAgICAgICBicmVhazsKLSAgICAgICAgfQotICAgICAgICBjYXNlIEZPVVJDQygnYycsICdvJywgJ3YnLCAncicpOgotICAgICAgICB7Ci0gICAgICAgICAgICBtZXRhZGF0YUtleSA9IGtLZXlBbGJ1bUFydDsKLSAgICAgICAgICAgIGJyZWFrOwotICAgICAgICB9Ci0gICAgICAgIGNhc2UgRk9VUkNDKCdnJywgJ24nLCAncicsICdlJyk6Ci0gICAgICAgIHsKLSAgICAgICAgICAgIG1ldGFkYXRhS2V5ID0ga0tleUdlbnJlOwotICAgICAgICAgICAgYnJlYWs7Ci0gICAgICAgIH0KLSAgICAgICAgY2FzZSBGT1VSQ0MoMHhhOSwgJ2cnLCAnZScsICduJyk6Ci0gICAgICAgIHsKLSAgICAgICAgICAgIG1ldGFkYXRhS2V5ID0ga0tleUdlbnJlOwotICAgICAgICAgICAgYnJlYWs7Ci0gICAgICAgIH0KLSAgICAgICAgY2FzZSBGT1VSQ0MoJ2MnLCAncCcsICdpJywgJ2wnKToKLSAgICAgICAgewotICAgICAgICAgICAgaWYgKHNpemUgPT0gOSAmJiBmbGFncyA9PSAyMSkgewotICAgICAgICAgICAgICAgIGNoYXIgdG1wWzE2XTsKLSAgICAgICAgICAgICAgICBzcHJpbnRmKHRtcCwgIiVkIiwKLSAgICAgICAgICAgICAgICAgICAgICAgIChpbnQpYnVmZmVyW3NpemUgLSAxXSk7Ci0KLSAgICAgICAgICAgICAgICBtRmlsZU1ldGFEYXRhLT5zZXRDU3RyaW5nKGtLZXlDb21waWxhdGlvbiwgdG1wKTsKLSAgICAgICAgICAgIH0KLSAgICAgICAgICAgIGJyZWFrOwotICAgICAgICB9Ci0gICAgICAgIGNhc2UgRk9VUkNDKCd0JywgJ3InLCAnaycsICduJyk6Ci0gICAgICAgIHsKLSAgICAgICAgICAgIGlmIChzaXplID09IDE2ICYmIGZsYWdzID09IDApIHsKLSAgICAgICAgICAgICAgICBjaGFyIHRtcFsxNl07Ci0gICAgICAgICAgICAgICAgc3ByaW50Zih0bXAsICIlZC8lZCIsCi0gICAgICAgICAgICAgICAgICAgICAgICAoaW50KWJ1ZmZlcltzaXplIC0gNV0sIChpbnQpYnVmZmVyW3NpemUgLSAzXSk7Ci0KLSAgICAgICAgICAgICAgICBtRmlsZU1ldGFEYXRhLT5zZXRDU3RyaW5nKGtLZXlDRFRyYWNrTnVtYmVyLCB0bXApOwotICAgICAgICAgICAgfQotICAgICAgICAgICAgYnJlYWs7Ci0gICAgICAgIH0KLSAgICAgICAgY2FzZSBGT1VSQ0MoJ2QnLCAnaScsICdzJywgJ2snKToKLSAgICAgICAgewotICAgICAgICAgICAgaWYgKHNpemUgPT0gMTQgJiYgZmxhZ3MgPT0gMCkgewotICAgICAgICAgICAgICAgIGNoYXIgdG1wWzE2XTsKLSAgICAgICAgICAgICAgICBzcHJpbnRmKHRtcCwgIiVkLyVkIiwKLSAgICAgICAgICAgICAgICAgICAgICAgIChpbnQpYnVmZmVyW3NpemUgLSAzXSwgKGludClidWZmZXJbc2l6ZSAtIDFdKTsKLQotICAgICAgICAgICAgICAgIG1GaWxlTWV0YURhdGEtPnNldENTdHJpbmcoa0tleURpc2NOdW1iZXIsIHRtcCk7Ci0gICAgICAgICAgICB9Ci0gICAgICAgICAgICBicmVhazsKLSAgICAgICAgfQotICAgICAgICBjYXNlIEZPVVJDQygnLScsICctJywgJy0nLCAnLScpOgotICAgICAgICB7Ci0gICAgICAgICAgICBidWZmZXJbc2l6ZV0gPSAnXDAnOwotICAgICAgICAgICAgc3dpdGNoIChtUGF0aFs1XSkgewotICAgICAgICAgICAgICAgIGNhc2UgRk9VUkNDKCdtJywgJ2UnLCAnYScsICduJyk6Ci0gICAgICAgICAgICAgICAgICAgIG1MYXN0Q29tbWVudE1lYW4uc2V0VG8oKGNvbnN0IGNoYXIgKilidWZmZXIgKyA0KTsKLSAgICAgICAgICAgICAgICAgICAgYnJlYWs7Ci0gICAgICAgICAgICAgICAgY2FzZSBGT1VSQ0MoJ24nLCAnYScsICdtJywgJ2UnKToKLSAgICAgICAgICAgICAgICAgICAgbUxhc3RDb21tZW50TmFtZS5zZXRUbygoY29uc3QgY2hhciAqKWJ1ZmZlciArIDQpOwotICAgICAgICAgICAgICAgICAgICBicmVhazsKLSAgICAgICAgICAgICAgICBjYXNlIEZPVVJDQygnZCcsICdhJywgJ3QnLCAnYScpOgotICAgICAgICAgICAgICAgICAgICBtTGFzdENvbW1lbnREYXRhLnNldFRvKChjb25zdCBjaGFyICopYnVmZmVyICsgOCk7Ci0gICAgICAgICAgICAgICAgICAgIGJyZWFrOwotICAgICAgICAgICAgfQotICAgICAgICAgICAgaWYgKG1MYXN0Q29tbWVudE1lYW4gPT0gImNvbS5hcHBsZS5pVHVuZXMiCi0gICAgICAgICAgICAgICAgICAgICYmIG1MYXN0Q29tbWVudE5hbWUgPT0gImlUdW5TTVBCIgotICAgICAgICAgICAgICAgICAgICAmJiBtTGFzdENvbW1lbnREYXRhLmxlbmd0aCgpICE9IDApIHsKLSAgICAgICAgICAgICAgICBpbnQzMl90IGRlbGF5LCBwYWRkaW5nOwotICAgICAgICAgICAgICAgIGlmIChzc2NhbmYobUxhc3RDb21tZW50RGF0YSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICIgJSp4ICV4ICV4ICUqeCIsICZkZWxheSwgJnBhZGRpbmcpID09IDIpIHsKLSAgICAgICAgICAgICAgICAgICAgbUxhc3RUcmFjay0+bWV0YS0+c2V0SW50MzIoa0tleUVuY29kZXJEZWxheSwgZGVsYXkpOwotICAgICAgICAgICAgICAgICAgICBtTGFzdFRyYWNrLT5tZXRhLT5zZXRJbnQzMihrS2V5RW5jb2RlclBhZGRpbmcsIHBhZGRpbmcpOwotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICBtTGFzdENvbW1lbnRNZWFuLmNsZWFyKCk7Ci0gICAgICAgICAgICAgICAgbUxhc3RDb21tZW50TmFtZS5jbGVhcigpOwotICAgICAgICAgICAgICAgIG1MYXN0Q29tbWVudERhdGEuY2xlYXIoKTsKLSAgICAgICAgICAgIH0KLSAgICAgICAgICAgIGJyZWFrOwotICAgICAgICB9Ci0KLSAgICAgICAgZGVmYXVsdDoKLSAgICAgICAgICAgIGJyZWFrOwotICAgIH0KLQotICAgIGlmIChzaXplID49IDggJiYgbWV0YWRhdGFLZXkpIHsKLSAgICAgICAgaWYgKG1ldGFkYXRhS2V5ID09IGtLZXlBbGJ1bUFydCkgewotICAgICAgICAgICAgbUZpbGVNZXRhRGF0YS0+c2V0RGF0YSgKLSAgICAgICAgICAgICAgICAgICAga0tleUFsYnVtQXJ0LCBNZXRhRGF0YTo6VFlQRV9OT05FLAotICAgICAgICAgICAgICAgICAgICBidWZmZXIgKyA4LCBzaXplIC0gOCk7Ci0gICAgICAgIH0gZWxzZSBpZiAobWV0YWRhdGFLZXkgPT0ga0tleUdlbnJlKSB7Ci0gICAgICAgICAgICBpZiAoZmxhZ3MgPT0gMCkgewotICAgICAgICAgICAgICAgIC8vIHVpbnQ4X3QgZ2VucmUgY29kZSwgaVR1bmVzIGdlbnJlIGNvZGVzIGFyZQotICAgICAgICAgICAgICAgIC8vIHRoZSBzdGFuZGFyZCBpZDMgY29kZXMsIGV4Y2VwdCB0aGV5IHN0YXJ0Ci0gICAgICAgICAgICAgICAgLy8gYXQgMSBpbnN0ZWFkIG9mIDAgKGUuZy4gUG9wIGlzIDE0LCBub3QgMTMpCi0gICAgICAgICAgICAgICAgLy8gV2UgdXNlIHN0YW5kYXJkIGlkMyBudW1iZXJpbmcsIHNvIHN1YnRyYWN0IDEuCi0gICAgICAgICAgICAgICAgaW50IGdlbnJlY29kZSA9IChpbnQpYnVmZmVyW3NpemUgLSAxXTsKLSAgICAgICAgICAgICAgICBnZW5yZWNvZGUtLTsKLSAgICAgICAgICAgICAgICBpZiAoZ2VucmVjb2RlIDwgMCkgewotICAgICAgICAgICAgICAgICAgICBnZW5yZWNvZGUgPSAyNTU7IC8vIHJlc2VydmVkIGZvciAndW5rbm93biBnZW5yZScKLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgY2hhciBnZW5yZVsxMF07Ci0gICAgICAgICAgICAgICAgc3ByaW50ZihnZW5yZSwgIiVkIiwgZ2VucmVjb2RlKTsKLQotICAgICAgICAgICAgICAgIG1GaWxlTWV0YURhdGEtPnNldENTdHJpbmcobWV0YWRhdGFLZXksIGdlbnJlKTsKLSAgICAgICAgICAgIH0gZWxzZSBpZiAoZmxhZ3MgPT0gMSkgewotICAgICAgICAgICAgICAgIC8vIGN1c3RvbSBnZW5yZSBzdHJpbmcKLSAgICAgICAgICAgICAgICBidWZmZXJbc2l6ZV0gPSAnXDAnOwotCi0gICAgICAgICAgICAgICAgbUZpbGVNZXRhRGF0YS0+c2V0Q1N0cmluZygKLSAgICAgICAgICAgICAgICAgICAgICAgIG1ldGFkYXRhS2V5LCAoY29uc3QgY2hhciAqKWJ1ZmZlciArIDgpOwotICAgICAgICAgICAgfQotICAgICAgICB9IGVsc2UgewotICAgICAgICAgICAgYnVmZmVyW3NpemVdID0gJ1wwJzsKLQotICAgICAgICAgICAgbUZpbGVNZXRhRGF0YS0+c2V0Q1N0cmluZygKLSAgICAgICAgICAgICAgICAgICAgbWV0YWRhdGFLZXksIChjb25zdCBjaGFyICopYnVmZmVyICsgOCk7Ci0gICAgICAgIH0KLSAgICB9Ci0KLSAgICBkZWxldGVbXSBidWZmZXI7Ci0gICAgYnVmZmVyID0gTlVMTDsKLQotICAgIHJldHVybiBPSzsKLX0KLQotc3A8TWVkaWFTb3VyY2U+IE1QRUc0RXh0cmFjdG9yOjpnZXRUcmFjayhzaXplX3QgaW5kZXgpIHsKLSAgICBzdGF0dXNfdCBlcnI7Ci0gICAgaWYgKChlcnIgPSByZWFkTWV0YURhdGEoKSkgIT0gT0spIHsKLSAgICAgICAgcmV0dXJuIE5VTEw7Ci0gICAgfQotCi0gICAgVHJhY2sgKnRyYWNrID0gbUZpcnN0VHJhY2s7Ci0gICAgd2hpbGUgKGluZGV4ID4gMCkgewotICAgICAgICBpZiAodHJhY2sgPT0gTlVMTCkgewotICAgICAgICAgICAgcmV0dXJuIE5VTEw7Ci0gICAgICAgIH0KLQotICAgICAgICB0cmFjayA9IHRyYWNrLT5uZXh0OwotICAgICAgICAtLWluZGV4OwotICAgIH0KLQotICAgIGlmICh0cmFjayA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RDsKLSAgICB9Ci0KLSAgICB1aW50MzJfdCBvYmplY3RUeXBlID0gY3NkWzBdID4+IDM7Ci0KLSAgICBpZiAob2JqZWN0VHlwZSA9PSAzMSkgewotICAgICAgICByZXR1cm4gRVJST1JfVU5TVVBQT1JURUQ7Ci0gICAgfQotCi0gICAgdWludDMyX3QgZnJlcUluZGV4ID0gKGNzZFswXSAmIDcpIDw8IDEgfCAoY3NkWzFdID4+IDcpOwotICAgIGludDMyX3Qgc2FtcGxlUmF0ZSA9IDA7Ci0gICAgaW50MzJfdCBudW1DaGFubmVscyA9IDA7Ci0gICAgaWYgKGZyZXFJbmRleCA9PSAxNSkgewotICAgICAgICBpZiAoY3NkX3NpemUgPCA1KSB7Ci0gICAgICAgICAgICByZXR1cm4gRVJST1JfTUFMRk9STUVEOwotICAgICAgICB9Ci0KLSAgICAgICAgc2FtcGxlUmF0ZSA9IChjc2RbMV0gJiAweDdmKSA8PCAxNwotICAgICAgICAgICAgICAgICAgICAgICAgfCBjc2RbMl0gPDwgOQotICAgICAgICAgICAgICAgICAgICAgICAgfCBjc2RbM10gPDwgMQotICAgICAgICAgICAgICAgICAgICAgICAgfCAoY3NkWzRdID4+IDcpOwotCi0gICAgICAgIG51bUNoYW5uZWxzID0gKGNzZFs0XSA+PiAzKSAmIDE1OwotICAgIH0gZWxzZSB7Ci0gICAgICAgIHN0YXRpYyB1aW50MzJfdCBrU2FtcGxpbmdSYXRlW10gPSB7Ci0gICAgICAgICAgICA5NjAwMCwgODgyMDAsIDY0MDAwLCA0ODAwMCwgNDQxMDAsIDMyMDAwLCAyNDAwMCwgMjIwNTAsCi0gICAgICAgICAgICAxNjAwMCwgMTIwMDAsIDExMDI1LCA4MDAwLCA3MzUwCi0gICAgICAgIH07Ci0KLSAgICAgICAgaWYgKGZyZXFJbmRleCA9PSAxMyB8fCBmcmVxSW5kZXggPT0gMTQpIHsKLSAgICAgICAgICAgIHJldHVybiBFUlJPUl9NQUxGT1JNRUQ7Ci0gICAgICAg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9kZSkgewotICAgICAgICAgICAgY2FzZSBSZWFkT3B0aW9uczo6U0VFS19QUkVWSU9VU19TWU5DOgotICAgICAgICAgICAgICAgIGZpbmRGbGFncyA9IFNhbXBsZVRhYmxlOjprRmxhZ0JlZm9yZTsKLSAgICAgICAgICAgICAgICBicmVhazsKLSAgICAgICAgICAgIGNhc2UgUmVhZE9wdGlvbnM6OlNFRUtfTkVYVF9TWU5DOgotICAgICAgICAgICAgICAgIGZpbmRGbGFncyA9IFNhbXBsZVRhYmxlOjprRmxhZ0FmdGVyOwotICAgICAgICAgICAgICAgIGJyZWFrOwotICAgICAgICAgICAgY2FzZSBSZWFkT3B0aW9uczo6U0VFS19DTE9TRVNUX1NZTkM6Ci0gICAgICAgICAgICBjYXNlIFJlYWRPcHRpb25zOjpTRUVLX0NMT1NFU1Q6Ci0gICAgICAgICAgICAgICAgZmluZEZsYWdzID0gU2FtcGxlVGFibGU6OmtGbGFnQ2xvc2VzdDsKLSAgICAgICAgICAgICAgICBicmVhazsKLSAgICAgICAgICAgIGRlZmF1bHQ6Ci0gICAgICAgICAgICAgICAgQ0hFQ0soISJTaG91bGQgbm90IGJlIGhlcmUuIik7Ci0gICAgICAgICAgICAgICAgYnJlYWs7Ci0gICAgICAgIH0KLQotICAgICAgICB1aW50MzJfdCBzYW1wbGVJbmRleDsKLSAgICAgICAgc3RhdHVzX3QgZXJyID0gbVNhbXBsZVRhYmxlLT5maW5kU2FtcGxlQXRUaW1lKAotICAgICAgICAgICAgICAgIHNlZWtUaW1lVXMgKiBtVGltZXNjYWxlIC8gMTAwMDAwMCwKLSAgICAgICAgICAgICAgICAmc2FtcGxlSW5kZXgsIGZpbmRGbGFncyk7Ci0KLSAgICAgICAgaWYgKG1vZGUgPT0gUmVhZE9wdGlvbnM6OlNFRUtfQ0xPU0VTVCkgewotICAgICAgICAgICAgLy8gV2UgZm91bmQgdGhlIGNsb3Nlc3Qgc2FtcGxlIGFscmVhZHksIG5vdyB3ZSB3YW50IHRoZSBz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gPQotICAgICAgICAgICAgICAgIG1EYXRhU291cmNlLT5yZWFkQXQob2Zmc2V0LCAodWludDhfdCAqKW1CdWZmZXItPmRhdGEoKSwgc2l6ZSk7Ci0KLSAgICAgICAgICAgIGlmIChudW1fYnl0ZXNfcmVhZCA8IChzc2l6ZV90KXNpemUpIHsKLSAgICAgICAgICAgICAgICBtQnVmZmVyLT5yZWxlYXNlKCk7Ci0gICAgICAgICAgICAgICAgbUJ1ZmZlciA9IE5VTEw7Ci0KLSAgICAgICAgICAgICAgICByZXR1cm4gRVJST1JfSU87Ci0gICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgIENIRUNLKG1CdWZmZXIgIT0gTlVMTCk7Ci0gICAgICAgICAgICBtQnVmZmVyLT5zZXRfcmFuZ2UoMCwgc2l6ZSk7Ci0gICAgICAgICAgICBtQnVmZmVyLT5tZXRhX2RhdGEoKS0+Y2xlYXIoKTsKLSAgICAgICAgICAgIG1CdWZmZXItPm1ldGFfZGF0YSgpLT5zZXRJbnQ2NCgKLSAgICAgICAgICAgICAgICAgICAga0tleVRpbWUsICgoaW50NjRfdCljdHMgKiAxMDAwMDAwKSAvIG1UaW1lc2NhbGUpOwotCi0gICAgICAgICAgICBpZiAodGFyZ2V0U2FtcGxlVGltZVVzID49IDApIHsKLSAgICAgICAgICAgICAgICBtQnVmZmVyLT5tZXRhX2RhdGEoKS0+c2V0SW50NjQoCi0gICAgICAgICAgICAgICAgICAgICAgICBrS2V5VGFyZ2V0VGltZSwgdGFyZ2V0U2FtcGxlVGltZVVzKTsKLSAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgaWYgKGlzU3luY1NhbXBsZSkgewotICAgICAgICAgICAgICAgIG1CdWZmZXItPm1ldGFfZGF0YSgpLT5zZXRJbnQzMihrS2V5SXNTeW5jRnJhbWUsIDEpOwotICAgICAgICAgICAgfQotCi0gICAgICAgICAgICArK21DdXJyZW50U2FtcGxlSW5kZXg7Ci0gICAgICAgIH0KLQotICAgICAgICBpZiAo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ZTsKLSAgICAgICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgICAgICBpZiAoaXNNYWxGb3JtZWQpIHsKLSAgICAgICAgICAgICAgICAgICAgQUxPR0UoIlZpZGVvIGlzIG1hbGZvcm1lZCIpOwotICAgICAgICAgICAgICAgICAgICBtQnVmZmVyLT5yZWxlYXNlKCk7Ci0gICAgICAgICAgICAgICAgICAgIG1CdWZmZXIgPSBOVUxMOwotICAgICAgICAgICAgICAgICAgICByZXR1cm4gRVJST1JfTUFMRk9STUVEOwotICAgICAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgICAgIGlmIChuYWxMZW5ndGggPT0gMCkgewotICAgICAgICAgICAgICAgICAgICBjb250aW51ZTsKLSAgICAgICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgICAgICBDSEVDSyhkc3RPZmZzZXQgKyA0IDw9IG1CdWZmZXItPnNpemUoKSk7Ci0KLSAgICAgICAgICAgICAgICBkc3REYXRhW2RzdE9mZnNldCsrXSA9IDA7Ci0gICAgICAgICAgICAgICAgZHN0RGF0YVtkc3RPZmZzZXQrK10gPSAwOwotICAgICAgICAgICAgICAgIGRzdERhdGFbZHN0T2Zmc2V0KytdID0gMDsKLSAgICAgICAgICAgICAgICBkc3REYXRhW2RzdE9mZnNldCsrXSA9IDE7Ci0gICAgICAgICAgICAgICAgbWVtY3B5KCZkc3REYXRhW2RzdE9mZnNldF0sICZtU3JjQnVmZmVyW3NyY09mZnNldF0sIG5hbExlbmd0aCk7Ci0gICAgICAgICAgICAgICAgc3JjT2Zmc2V0ICs9IG5hbExlbmd0aDsKLSAgICAgICAgICAgICAgICBkc3RPZmZzZXQgKz0gbmFsTGVuZ3RoOwotICAgICAgICAgICAgfQotICAgICAgICAgICAgQ0hFQ0tfRVEoc3JjT2Zmc2V0LCBzaXplKTsKLSAgICAgICAgICAgIENIRUNLKG1CdWZmZXIgIT0gTlVMTCk7Ci0gICAgICAgICAgICBtQnVmZmVyLT5zZXRfcmFuZ2UoMCwgZ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2ZmNjRfdCBtb292QXRvbUVuZE9mZnNldCA9IC0xbGw7Ci0gICAgYm9vbCBkb25lID0gZmFsc2U7Ci0KLSAgICB3aGlsZSAoIWRvbmUgJiYgb2Zmc2V0IDwga01heFNjYW5PZmZzZXQpIHsKLSAgICAgICAgdWludDMyX3QgaGRyWzJdOwotICAgICAgICBpZiAoc291cmNlLT5yZWFkQXQob2Zmc2V0LCBoZHIsIDgpIDwgOCkgewotICAgICAgICAgICAgcmV0dXJuIGZhbHNlOwotICAgICAgICB9Ci0KLSAgICAgICAgdWludDY0X3QgY2h1bmtTaXplID0gbnRvaGwoaGRyWzBdKTsKLSAgICAgICAgdWludDMyX3QgY2h1bmtUeXBlID0gbnRvaGwoaGRyWzFdKTsKLSAgICAgICAgb2ZmNjRfdCBjaHVua0RhdGFPZmZzZXQgPSBvZmZzZXQgKyA4OwotCi0gICAgICAgIGlmIChjaHVua1NpemUgPT0gMSkgewotICAgICAgICAgICAgaWYgKHNvdXJjZS0+cmVhZEF0KG9mZnNldCArIDgsICZjaHVua1NpemUsIDgpIDwgOCkgewotICAgICAgICAgICAgICAgIHJldHVybiBmYWxzZTsKLSAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgY2h1bmtTaXplID0gbnRvaDY0KGNodW5rU2l6ZSk7Ci0gICAgICAgICAgICBjaHVua0RhdGFPZmZzZXQgKz0gODsKLQotICAgICAgICAgICAgaWYgKGNodW5rU2l6ZSA8IDE2KSB7Ci0gICAgICAgICAgICAgICAgLy8gVGhlIHNtYWxsZXN0IHZhbGlkIGNodW5rIGlzIDE2IGJ5dGVzIGxvbmcgaW4gdGhpcyBjYXNlLgotICAgICAgICAgICAgICAgIHJldHVybiBmYWxzZTsKLSAgICAgICAgICAgIH0KLSAgICAgICAgfSBlbHNlIGlmIChjaHVua1NpemUgPCA4KSB7Ci0gICAgICAgICAgICAvLyBUaGUgc21hbGxlc3QgdmFsaWQgY2h1bmsgaXMgOCBieXRlcyBsb25nLgotICAgICAgICAgICAgcmV0dXJuIGZhbHNlOwotICAgICAgICB9Ci0KLSAgICAgICAgb2ZmNjRfdCBjaHVua0RhdGFTaXplID0gb2Zmc2V0ICsgY2h1bmtTaXplIC0gY2h1bmtEYXRhT2Zmc2V0OwotCi0gICAgICAgIHN3aXRjaCAoY2h1bmtUeXBlKSB7Ci0gICAgICAgICAgICBjYXNlIEZPVVJDQygnZicsICd0JywgJ3knLCAncCcpOgotICAgICAgICAgICAgewotICAgICAgICAgICAgICAgIGlmIChjaHVua0RhdGFTaXplIDwgOCkgewotICAgICAgICAgICAgICAgICAgICByZXR1cm4gZmFsc2U7Ci0gICAgICAgICAgICAgICAgfQotCi0gICAgICAgICAgICAgICAgdWludDMyX3QgbnVtQ29tcGF0aWJsZUJyYW5kcyA9IChjaHVua0RhdGFTaXplIC0gOCkgLyA0OwotICAgICAgICAgICAgICAgIGZvciAoc2l6ZV90IGkgPSAwOyBpIDwgbnVtQ29tcGF0aWJsZUJyYW5kcyArIDI7ICsraSkgewotICAgICAgICAgICAgICAgICAgICBpZiAoaSA9PSAxKSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICAvLyBTa2lwIHRoaXMgaW5kZXgsIGl0IHJlZmVycyB0byB0aGUgbWlub3JWZXJzaW9uLAotICAgICAgICAgICAgICAgICAgICAgICAgLy8gbm90IGEgYnJhbmQuCi0gICAgICAgICAgICAgICAgICAgICAgICBjb250aW51ZTsKLSAgICAgICAgICAgICAgICAgICAgfQotCi0gICAgICAgICAgICAgICAgICAgIHVpbnQzMl90IGJyYW5kOwotICAgICAgICAgICAgICAgICAgICBpZiAoc291cmNlLT5yZWFkQXQoCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNodW5rRGF0YU9mZnNldCArIDQgKiBpLCAmYnJhbmQsIDQpIDwgNCkgewotICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGZhbHNlOwotICAgICAgICAgICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgICAgICAgICAgYnJhbmQgPSBudG9obChicmFuZCk7Ci0KLSAgICAgICAgICAgICAgICAgICAgaWYgKGlzQ29tcGF0aWJsZUJyYW5kKGJyYW5kKSkgewotICAgICAgICAgICAgICAgICAgICAgICAgZm91bmRHb29kRmlsZVR5cGUgPSB0cnVlOwotICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7Ci0gICAgICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgICAgICBpZiAoIWZvdW5kR29vZEZpbGVUeXBlKSB7Ci0gICAgICAgICAgICAgICAgICAgIHJldHVybiBmYWxzZTsKLSAgICAgICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgICAgICBicmVhazsKLSAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgY2FzZSBGT1VSQ0MoJ20nLCAnbycsICdvJywgJ3YnKToKLSAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICBtb292QXRvbUVuZE9mZnNldCA9IG9mZnNldCArIGNodW5rU2l6ZTsKLQotICAgICAgICAgICAgICAgIGRvbmUgPSB0cnVlOwotICAgICAgICAgICAgICAgIGJyZWFrOwotICAgICAgICAgICAgfQotCi0gICAgICAgICAgICBkZWZhdWx0OgotICAgICAgICAgICAgICAgIGJyZWFrOwotICAgICAgICB9Ci0KLSAgICAgICAgb2Zmc2V0ICs9IGNodW5rU2l6ZTsKLSAgICB9Ci0KLSAgICBpZiAoIWZvdW5kR29vZEZpbGVUeXBlKSB7Ci0gICAgICAgIHJldHVybiBmYWxzZTsKLSAgICB9Ci0KLSAgICAqbWltZVR5cGUgPSBNRURJQV9NSU1FVFlQRV9DT05UQUlORVJfTVBFRzQ7Ci0gICAgKmNvbmZpZGVuY2UgPSAwLjRmOwotCi0gICAgaWYgKG1vb3ZBdG9tRW5kT2Zmc2V0ID49IDApIHsKLSAgICAgICAgKm1ldGEgPSBuZXcgQU1lc3NhZ2U7Ci0gICAgICAgICgqbWV0YSktPnNldEludDY0KCJtZXRhLWRhdGEtc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sKLQotICAgIExpc3Q8TWVkaWFCdWZmZXIgKj4gbUNodW5rU2FtcGxlczsKLQotICAgIHNpemVfdCAgICAgICAgICAgICAgbU51bVN0Y29UYWJsZUVudHJpZXM7Ci0gICAgTGlzdDxvZmY2NF90PiAgICAgICAgIG1DaHVua09mZnNldHM7Ci0KLSAgICBzaXplX3QgICAgICAgICAgICAgIG1OdW1TdHNjVGFibGVFbnRyaWVzOwotICAgIHN0cnVjdCBTdHNjVGFibGVFbnRyeSB7Ci0KLSAgICAgICAgU3RzY1RhYmxlRW50cnkodWludDMyX3QgY2h1bmssIHVpbnQzMl90IHNhbXBsZXMsIHVpbnQzMl90IGlkKQotICAgICAgICAgICAgOiBmaXJzdENodW5rKGNodW5rKSwKLSAgICAgICAgICAgICAgc2FtcGxlc1BlckNodW5rKHNhbXBsZXMpLAotICAgICAgICAgICAgICBzYW1wbGVEZXNjcmlwdGlvbklkKGlkKSB7fQotCi0gICAgICAgIHVpbnQzMl90IGZpcnN0Q2h1bms7Ci0gICAgICAgIHVpbnQzMl90IHNhbXBsZXNQZXJDaHVuazsKLSAgICAgICAgdWludDMyX3Qgc2FtcGxlRGVzY3JpcHRpb25JZDsKLSAgICB9OwotICAgIExpc3Q8U3RzY1RhYmxlRW50cnk+IG1TdHNjVGFibGVFbnRyaWVzOwotCi0gICAgc2l6ZV90ICAgICAgICBtTnVtU3Rzc1RhYmxlRW50cmllczsKLSAgICBMaXN0PGludDMyX3Q+IG1TdHNzVGFibGVFbnRyaWVzOwotCi0gICAgc3RydWN0IFN0dHNUYWJsZUVudHJ5IHsKLQotICAgICAgICBTdHRzVGFibGVFbnRyeSh1aW50MzJfdCBjb3VudCwgdWludDMyX3QgZHVyYXRpb24pCi0gICAgICAgICAgICA6IHNhbXBsZUNvdW50KGNvdW50KSwgc2FtcGxlRHVyYXRpb24oZHVyYXRpb24pIHt9Ci0KLSAgICAgICAgdWludDMyX3Qgc2FtcGxlQ291bnQ7Ci0gICAgICAgIHVpbnQzMl90I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SwgYiwgdSwgYywgZCwgdiwgeCwgeSwgd30sCi0gKiB3aGVyZSBhLCBiLCBjLCBkLCB4LCBhbmQgeSBpcyBpbiAxNi4xNiBmb3JtYXQsIHdoaWxlCi0gKiB1LCB2IGFuZCB3IGlzIGluIDIuMzAgZm9ybWF0LgotICovCi12b2lkIE1QRUc0V3JpdGVyOjp3cml0ZUNvbXBvc2l0aW9uTWF0cml4KGludCBkZWdyZWVzKSB7Ci0gICAgQUxPR1YoIndyaXRlQ29tcG9zaXRpb25NYXRyaXgiKTsKLSAgICB1aW50MzJfdCBhID0gMHgwMDAxMDAwMDsKLSAgICB1aW50MzJfdCBiID0gMDsKLSAgICB1aW50MzJfdCBjID0gMDsKLSAgICB1aW50MzJfdCBkID0gMHgwMDAxMDAwMDsKLSAgICBzd2l0Y2ggKGRlZ3JlZXMpIHsKLSAgICAgICAgY2FzZSAwOgotICAgICAgICAgICAgYnJlYWs7Ci0gICAgICAgIGNhc2UgOTA6Ci0gICAgICAgICAgICBhID0gMDsKLSAgICAgICAgICAgIGIgPSAweDAwMDEwMDAwOwotICAgICAgICAgICAgYyA9IDB4RkZGRjAwMDA7Ci0gICAgICAgICAgICBkID0gMDsKLSAgICAgICAgICAgIGJyZWFrOwotICAgICAgICBjYXNlIDE4MDoKLSAgICAgICAgICAgIGEgPSAweEZGRkYwMDAwOwotICAgICAgICAgICAgZCA9IDB4RkZGRjAwMDA7Ci0gICAgICAgICAgICBicmVhazsKLSAgICAgICAgY2FzZSAyNzA6Ci0gICAgICAgICAgICBhID0gMDsKLSAgICAgICAgICAgIGIgPSAweEZGRkYwMDAwOwotICAgICAgICAgICAgYyA9IDB4MDAwMTAwMDA7Ci0gICAgICAgICAgICBkID0gMDsKLSAgICAgICAgICAgIGJyZWFrOwotICAgICAgICBkZWZhdWx0OgotICAgICAgICAgICAgQ0hFQ0soISJTaG91bGQgbmV2ZXIgcmVhY2ggdGhpcyB1bmtub3duIHJvdGF0aW9uIik7Ci0gICAgICAgICAgICBicmVhazsKLSAgICB9Ci0KLSAgICB3cml0ZUludDMyKGEpOyAgICAgICAgICAgLy8gYQotICAgIHdyaXRlSW50MzIoYik7ICAgICAgICAgICAvLyBiCi0gICAgd3JpdGVJbnQzMigwKTsgICAgICAgICAgIC8vIHUKLSAgICB3cml0ZUludDMyKGMpOyAgICAgICAgICAgLy8gYwotICAgIHdyaXRlSW50MzIoZCk7ICAgICAgICAgICAvLyBkCi0gICAgd3JpdGVJbnQzMigwKTsgICAgICAgICAgIC8vIHYKLSAgICB3cml0ZUludDMyKDApOyAgICAgICAgICAgLy8geAotICAgIHdyaXRlSW50MzIoMCk7ICAgICAgICAgICAvLyB5Ci0gICAgd3JpdGVJbnQzMigweDQwMDAwMDAwKTsgIC8vIHcKLX0KLQotdm9pZCBNUEVHNFdyaXRlcjo6cmVsZWFzZSgpIHsKLSAgICBjbG9zZShtRmQpOwotICAgIG1GZCA9IC0xOwotICAgIG1Jbml0Q2hlY2sgPSBOT19JTklUOwotICAgIG1TdGFydGVkID0gZmFsc2U7Ci19Ci0KLXN0YXR1c190IE1QRUc0V3JpdGVyOjpyZXNldCgpIHsKLSAgICBpZiAobUluaXRDaGVjayAhPSBPSykgewotICAgICAgICByZXR1cm4gT0s7Ci0gICAgfSBlbHNlIHsKLSAgICAgICAgaWYgKCFtV3JpdGVyVGhyZWFkU3RhcnRlZCB8fAotICAgICAgICAgICAgIW1TdGFydGVkKSB7Ci0gICAgICAgICAgICBpZiAobVdyaXRlclRocmVhZFN0YXJ0ZWQpIHsKLSAgICAgICAgICAgICAgICBzdG9wV3JpdGVyVGhyZWFkKCk7Ci0gICAgICAgICAgICB9Ci0gICAgICAgICAgICByZWxlYXNlKCk7Ci0gICAgICAgICAgICByZXR1cm4gT0s7Ci0gICAgICAgIH0KLSAgICB9Ci0KLSAgICBzdGF0dXNfdCBlcnIgPSBPSzsKLSAgICBpbnQ2NF90IG1heER1cmF0aW9uVXMgPSAwOwotICAgIGludDY0X3QgbWluRHVyYXRpb25V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b24gdGltZQotICAgIHdyaXRlSW50MzIobVRpbWVTY2FsZSk7ICAgIC8vIG12aGQgdGltZXNjYWxlCi0gICAgaW50MzJfdCBkdXJhdGlvbiA9IChkdXJhdGlvblVzICogbVRpbWVTY2FsZSArIDVFNSkgLyAxRTY7Ci0gICAgd3JpdGVJbnQzMihkdXJhdGlvbik7Ci0gICAgd3JpdGVJbnQzMigweDEwMDAwKTsgICAgICAgLy8gcmF0ZTogMS4wCi0gICAgd3JpdGVJbnQxNigweDEwMCk7ICAgICAgICAgLy8gdm9sdW1lCi0gICAgd3JpdGVJbnQxNigwKTsgICAgICAgICAgICAgLy8gcmVzZXJ2ZWQKLSAgICB3cml0ZUludDMyKDApOyAgICAgICAgICAgICAvLyByZXNlcnZlZAotICAgIHdyaXRlSW50MzIoMCk7ICAgICAgICAgICAgIC8vIHJlc2VydmVkCi0gICAgd3JpdGVDb21wb3NpdGlvbk1hdHJpeCgwKTsgLy8gbWF0cml4Ci0gICAgd3JpdGVJbnQzMigwKTsgICAgICAgICAgICAgLy8gcHJlZGVmaW5lZAotICAgIHdyaXRlSW50MzIoMCk7ICAgICAgICAgICAgIC8vIHByZWRlZmluZWQKLSAgICB3cml0ZUludDMyKDApOyAgICAgICAgICAgICAvLyBwcmVkZWZpbmVkCi0gICAgd3JpdGVJbnQzMigwKTsgICAgICAgICAgICAgLy8gcHJlZGVmaW5lZAotICAgIHdyaXRlSW50MzIoMCk7ICAgICAgICAgICAgIC8vIHByZWRlZmluZWQKLSAgICB3cml0ZUludDMyKDApOyAgICAgICAgICAgICAvLyBwcmVkZWZpbmVkCi0gICAgd3JpdGVJbnQzMihtVHJhY2tzLnNpemUoKSArIDEpOyAgLy8gbmV4dFRyYWNrSUQKLSAgICBlbmRCb3goKTsgIC8vIG12aGQKLX0KLQotdm9pZCBNUEVHNFdyaXRlcjo6d3JpdGVNb292Qm94KGludDY0X3QgZHVyYXRpb25VcykgewotICAgIGJlZ2luQm94KCJtb292Iik7Ci0gICAgd3Jp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YgKCFtT3duZXItPmlzRmlsZVN0cmVhbWFibGUoKSkgewotICAgICAgICAvLyBSZXNlcnZlZCBmcmVlIHNwYWNlIGlzIG5vdCBsYXJnZSBlbm91Z2ggdG8gaG9sZAotICAgICAgICAvLyBhbGwgbWV0YSBkYXRhIGFuZCB0aHVzIHdhc3RlZC4KLSAgICAgICAgbUVzdGltYXRlZFRyYWNrU2l6ZUJ5dGVzICs9IG1OdW1TdHNjVGFibGVFbnRyaWVzICogMTIgKyAgLy8gc3RzYyBib3ggc2l6ZQotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbU51bVN0c3NUYWJsZUVudHJpZXMgKiA0ICsgICAvLyBzdHNzIGJveCBzaXplCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBtTnVtU3R0c1RhYmxlRW50cmllcyAqIDggKyAgIC8vIHN0dHMgYm94IHNpemUKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1OdW1DdHRzVGFibGVFbnRyaWVzICogOCArICAgLy8gY3R0cyBib3ggc2l6ZQotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc3Rjb0JveFNpemVCeXRlcyArICAgICAgICAgICAvLyBzdGNvIGJveCBzaXplCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzdHN6Qm94U2l6ZUJ5dGVzOyAgICAgICAgICAgIC8vIHN0c3ogYm94IHNpemUKLSAgICB9Ci19Ci0KLXZvaWQgTVBFRzRXcml0ZXI6OlRyYWNrOjphZGRPbmVTdHNjVGFibGVFbnRyeSgKLSAgICAgICAgc2l6ZV90IGNodW5rSWQsIHNpemVfdCBzYW1wbGVJZCkgewotCi0gICAgICAgIFN0c2NUYWJsZUVudHJ5IHN0c2NFbnRyeShjaHVua0lkLCBzYW1wbGVJZCwgMSk7Ci0gICAgICAgIG1TdHNjVGFibGVFbnRyaWVzLnB1c2hfYmFjayhzdHNjRW50cnkpOwotICAgICAgICArK21OdW1T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m9pZCBNUEVHNFdyaXRlcjo6d3JpdGVDaHVua1RvRmlsZShDaHVuayogY2h1bmspIHsKLSAgICBBTE9HVigid3JpdGVDaHVua1RvRmlsZTogJWxsZCBmcm9tICVzIHRyYWNrIiwKLSAgICAgICAgY2h1bmstPm1UaW1lU3RhbXBVcywgY2h1bmstPm1UcmFjay0+aXNBdWRpbygpPyAiYXVkaW8iOiAidmlkZW8iKTsKLQotICAgIGludDMyX3QgaXNGaXJzdFNhbXBsZSA9IHRydWU7Ci0gICAgd2hpbGUgKCFjaHVuay0+bVNhbXBsZXMuZW1wdHkoKSkgewotICAgICAgICBMaXN0PE1lZGlhQnVmZmVyICo+OjppdGVyYXRvciBpdCA9IGNodW5rLT5tU2FtcGxlcy5iZWdpbigpOwotCi0gICAgICAgIG9mZjY0X3Qgb2Zmc2V0ID0gY2h1bmstPm1UcmFjay0+aXNBdmMoKQotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA/IGFkZExlbmd0aFByZWZpeGVkU2FtcGxlX2woKml0KQotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA6IGFkZFNhbXBsZV9sKCppdCk7Ci0KLSAgICAgICAgaWYgKGlzRmlyc3RTYW1wbGUpIHsKLSAgICAgICAgICAgIGNodW5rLT5tVHJhY2stPmFkZENodW5rT2Zmc2V0KG9mZnNldCk7Ci0gICAgICAgICAgICBpc0ZpcnN0U2FtcGxlID0gZmFsc2U7Ci0gICAgICAgIH0KLQotICAgICAgICAoKml0KS0+cmVsZWFzZSgpOwotICAgICAgICAoKml0KSA9IE5VTEw7Ci0gICAgICAgIGNodW5rLT5tU2FtcGxlcy5lcmFzZShpdCk7Ci0gICAgfQotICAgIGNodW5rLT5tU2FtcGxlcy5jbGVhcigpOwotfQotCi12b2lkIE1QRUc0V3JpdGVyOjp3cml0ZUFsbENodW5rcygpIHsKLSAgICBBTE9HVigid3JpdGVBbGxDaHVua3MiKTsKLSAgICBzaXplX3Qgb3V0c3RhbmRpbmdDaHVua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SAgICB9Ci0KLSAgICBpZiAodHJhY2sgPT0gTlVMTCkgewotICAgICAgICBBTE9HVigiTm90aGluZyB0byBiZSB3cml0dGVuIGFmdGVyIGFsbCIpOwotICAgICAgICByZXR1cm4gZmFsc2U7Ci0gICAgfQotCi0gICAgaWYgKG1Jc0ZpcnN0Q2h1bmspIHsKLSAgICAgICAgbUlzRmlyc3RDaHVuayA9IGZhbHNlOwotICAgIH0KLQotICAgIGZvciAoTGlzdDxDaHVua0luZm8+OjppdGVyYXRvciBpdCA9IG1DaHVua0luZm9zLmJlZ2luKCk7Ci0gICAgICAgICBpdCAhPSBtQ2h1bmtJbmZvcy5lbmQoKTsgKytpdCkgewotICAgICAgICBpZiAoaXQtPm1UcmFjayA9PSB0cmFjaykgewotICAgICAgICAgICAgKmNodW5rID0gKihpdC0+bUNodW5rcy5iZWdpbigpKTsKLSAgICAgICAgICAgIGl0LT5tQ2h1bmtzLmVyYXNlKGl0LT5tQ2h1bmtzLmJlZ2luKCkpOwotICAgICAgICAgICAgQ0hFQ0tfRVEoY2h1bmstPm1UcmFjaywgdHJhY2spOwotCi0gICAgICAgICAgICBpbnQ2NF90IGludGVyQ2h1bmtUaW1lVXMgPQotICAgICAgICAgICAgICAgIGNodW5rLT5tVGltZVN0YW1wVXMgLSBpdC0+bVByZXZDaHVua1RpbWVzdGFtcFVzOwotICAgICAgICAgICAgaWYgKGludGVyQ2h1bmtUaW1lVXMgPiBpdC0+bVByZXZDaHVua1RpbWVzdGFtcFVzKSB7Ci0gICAgICAgICAgICAgICAgaXQtPm1NYXhJbnRlckNodW5rRHVyVXMgPSBpbnRlckNodW5rVGltZVVzOwotICAgICAgICAgICAgfQotCi0gICAgICAgICAgICByZXR1cm4gdHJ1ZTsKLSAgICAgICAgfQotICAgIH0KLQotICAgIHJldHVybiBmYWxzZTsKLX0KLQotdm9pZCBNUEVHNFdyaXRlcjo6dGhyZWFkRnVuYygpIHsKLSAgICBBTE9HVigidGhyZWFkRnVuYyIpOwotCi0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MzJfdCByb3RhdGlvbkRlZ3JlZXM7Ci0gICAgaWYgKCFtSXNBdWRpbyAmJiBwYXJhbXMgJiYgcGFyYW1zLT5maW5kSW50MzIoa0tleVJvdGF0aW9uLCAmcm90YXRpb25EZWdyZWVzKSkgewotICAgICAgICBtUm90YXRpb24gPSByb3RhdGlvbkRlZ3JlZXM7Ci0gICAgfQotCi0gICAgbUlzUmVhbFRpbWVSZWNvcmRpbmcgPSB0cnVlOwotICAgIHsKLSAgICAgICAgaW50MzJfdCBpc05vdFJlYWxUaW1lOwotICAgICAgICBpZiAocGFyYW1zICYmIHBhcmFtcy0+ZmluZEludDMyKGtLZXlOb3RSZWFsVGltZSwgJmlzTm90UmVhbFRpbWUpKSB7Ci0gICAgICAgICAgICBtSXNSZWFsVGltZVJlY29yZGluZyA9IChpc05vdFJlYWxUaW1lID09IDApOwotICAgICAgICB9Ci0gICAgfQotCi0gICAgaW5pdFRyYWNraW5nUHJvZ3Jlc3NTdGF0dXMocGFyYW1zKTsKLQotICAgIHNwPE1ldGFEYXRhPiBtZXRhID0gbmV3IE1ldGFEYXRhOwotICAgIGlmIChtSXNSZWFsVGltZVJlY29yZGluZyAmJiBtT3duZXItPm51bVRyYWNrcygpID4gMSkgewotICAgICAgICAvKgotICAgICAgICAgKiBUaGlzIGV4dHJhIGRlbGF5IG9mIGFjY2VwdGluZyBpbmNvbWluZyBhdWRpby92aWRlbyBzaWduYWxzCi0gICAgICAgICAqIGhlbHBzIHRvIGFsaWduIGEvdiBzdGFydCB0aW1lIGF0IHRoZSBiZWdpbm5pbmcgb2YgYSByZWNvcmRpbmcKLSAgICAgICAgICogc2Vzc2lvbiwgYW5kIGl0IGFsc28gaGVscHMgZWxpbWluYXRlIHRoZSAicmVjb3JkaW5nIiBzb3VuZCBmb3IKLSAgICAgICAgICogY2FtY29yZGVyIGFwcGxpY2F0aW9ucy4KLSAgICAgICAgICoKLSAgICAgICAgICogSWYgY2xpZW50IGRvZXMgbm90IHNldCB0aGUgc3R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MzIoa0tleUlzQ29kZWNDb25maWcsICZpc0NvZGVjQ29uZmlnKQotICAgICAgICAgICAgICAgICYmIGlzQ29kZWNDb25maWcpIHsKLSAgICAgICAgICAgIENIRUNLKCFtR290QWxsQ29kZWNTcGVjaWZpY0RhdGEpOwotCi0gICAgICAgICAgICBpZiAobUlzQXZjKSB7Ci0gICAgICAgICAgICAgICAgc3RhdHVzX3QgZXJyID0gbWFrZUFWQ0NvZGVjU3BlY2lmaWNEYXRhKAotICAgICAgICAgICAgICAgICAgICAgICAgKGNvbnN0IHVpbnQ4X3QgKilidWZmZXItPmRhdGEoKQotICAgICAgICAgICAgICAgICAgICAgICAgICAgICsgYnVmZmVyLT5yYW5nZV9vZmZzZXQoKSwKLSAgICAgICAgICAgICAgICAgICAgICAgIGJ1ZmZlci0+cmFuZ2VfbGVuZ3RoKCkpOwotICAgICAgICAgICAgICAgIENIRUNLX0VRKChzdGF0dXNfdClPSywgZXJyKTsKLSAgICAgICAgICAgIH0gZWxzZSBpZiAobUlzTVBFRzQpIHsKLSAgICAgICAgICAgICAgICBtQ29kZWNTcGVjaWZpY0RhdGFTaXplID0gYnVmZmVyLT5yYW5nZV9sZW5ndGgoKTsKLSAgICAgICAgICAgICAgICBtQ29kZWNTcGVjaWZpY0RhdGEgPSBtYWxsb2MobUNvZGVjU3BlY2lmaWNEYXRhU2l6ZSk7Ci0gICAgICAgICAgICAgICAgbWVtY3B5KG1Db2RlY1NwZWNpZmljRGF0YSwKLSAgICAgICAgICAgICAgICAgICAgICAgIChjb25zdCB1aW50OF90ICopYnVmZmVyLT5kYXRhKCkKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICArIGJ1ZmZlci0+cmFuZ2Vfb2Zmc2V0KCksCi0gICAgICAgICAgICAgICAgICAgICAgIGJ1ZmZlci0+cmFuZ2VfbGVuZ3RoKCkpOwotICAgICAgICAgICAgfQotCi0gICAgICAgICAgICBidWZmZXItPnJlbGVhc2UoKTsKLSAgICAgICAgICAgIGJ1Zm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mcgdGltZTogZGVjb2RpbmdUaW1lVXMKLSAgICAgICAgICAgICAqIENvbXBvc2l0aW9uIHRpbWUgb2Zmc2V0ID0gY29tcG9zaXRpb24gdGltZSAtIGRlY29kaW5nIHRpbWUKLSAgICAgICAgICAgICAqLwotICAgICAgICAgICAgaW50NjRfdCBkZWNvZGluZ1RpbWVVczsKLSAgICAgICAgICAgIENIRUNLKG1ldGFfZGF0YS0+ZmluZEludDY0KGtLZXlEZWNvZGluZ1RpbWUsICZkZWNvZGluZ1RpbWVVcykpOwotICAgICAgICAgICAgZGVjb2RpbmdUaW1lVXMgLT0gcHJldmlvdXNQYXVzZWREdXJhdGlvblVzOwotICAgICAgICAgICAgY3R0c09mZnNldFRpbWVVcyA9Ci0gICAgICAgICAgICAgICAgICAgIHRpbWVzdGFtcFVzICsga01heEN0dHNPZmZzZXRUaW1lVXMgLSBkZWNvZGluZ1RpbWVVczsKLSAgICAgICAgICAgIENIRUNLX0dFKGN0dHNPZmZzZXRUaW1lVXMsIDBsbCk7Ci0gICAgICAgICAgICB0aW1lc3RhbXBVcyA9IGRlY29kaW5nVGltZVVzOwotICAgICAgICAgICAgQUxPR1YoImRlY29kaW5nIHRpbWU6ICVsbGQgYW5kIGN0dHMgb2Zmc2V0IHRpbWU6ICVsbGQiLAotICAgICAgICAgICAgICAgIHRpbWVzdGFtcFVzLCBjdHRzT2Zmc2V0VGltZVVzKTsKLQotICAgICAgICAgICAgLy8gVXBkYXRlIGN0dHMgYm94IHRhYmxlIGlmIG5lY2Vzc2FyeQotICAgICAgICAgICAgY3VyckN0dHNPZmZzZXRUaW1lVGlja3MgPQotICAgICAgICAgICAgICAgICAgICAoY3R0c09mZnNldFRpbWVVcyAqIG1UaW1lU2NhbGUgKyA1MDAwMDBMTCkgLyAxMDAwMDAwTEw7Ci0gICAgICAgICAgICBDSEVDS19MRShjdXJyQ3R0c09mZnNldFRpbWVUaWNrcywgMHgwRkZGRkZGRkZMTCk7Ci0gICAgICAgICAgICBpZiAob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Q291bnQ7Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgfQotCi0gICAgICAgICAgICAvLyBVcGRhdGUgY3R0cyB0aW1lIG9mZnNldCByYW5nZQotICAgICAgICAgICAgaWYgKG1OdW1TYW1wbGVzID09IDApIHsKLSAgICAgICAgICAgICAgICBtTWluQ3R0c09mZnNldFRpbWVVcyA9IGN1cnJDdHRzT2Zmc2V0VGltZVRpY2tzOwotICAgICAgICAgICAgICAgIG1NYXhDdHRzT2Zmc2V0VGltZVVzID0gY3VyckN0dHNPZmZzZXRUaW1lVGlja3M7Ci0gICAgICAgICAgICB9IGVsc2UgewotICAgICAgICAgICAgICAgIGlmIChjdXJyQ3R0c09mZnNldFRpbWVUaWNrcyA+IG1NYXhDdHRzT2Zmc2V0VGltZVVzKSB7Ci0gICAgICAgICAgICAgICAgICAgIG1NYXhDdHRzT2Zmc2V0VGltZVVzID0gY3VyckN0dHNPZmZzZXRUaW1lVGlja3M7Ci0gICAgICAgICAgICAgICAgfSBlbHNlIGlmIChjdXJyQ3R0c09mZnNldFRpbWVUaWNrcyA8IG1NaW5DdHRzT2Zmc2V0VGltZVVzKSB7Ci0gICAgICAgICAgICAgICAgICAgIG1NaW5DdHRzT2Zmc2V0VGltZVVzID0gY3VyckN0dHNPZmZzZXRUaW1lVGlja3M7Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgfQotCi0gICAgICAgIH0KLQotICAgICAgICBpZiAobUlzUmVhbFRpbWVSZWNvcmRpbmcpIHsKLSAgICAgICAgICAgIGlmIChtSXNBdWRpbykgewotICAgICAgICAgICAgICAgIHVwZGF0ZURyaWZ0VGltZShtZXRhX2RhdGEpOwotICAgICAgICAgICAgfQotICAgICAgICB9Ci0KLSAgICAgICAgQ0hFQ0tfR0UodGltZXN0YW1wVXMsIDBsbCk7Ci0gICAgICAgIEFMT0dWKCIlcyBtZWRpYSB0aW1lIHN0YW1wOiAlbGxkIGFuZCBwcmV2aW91cyBwYXVzZWQgZHVy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aWNrcyA9IGN1cnJEdXJhdGlvblRpY2tzOwotICAgICAgICBsYXN0VGltZXN0YW1wVXMgPSB0aW1lc3RhbXBVczsKLQotICAgICAgICBpZiAoaXNTeW5jICE9IDApIHsKLSAgICAgICAgICAgIGFkZE9uZVN0c3NUYWJsZUVudHJ5KG1OdW1TYW1wbGVzKTsKLSAgICAgICAgfQotCi0gICAgICAgIGlmIChtVHJhY2tpbmdQcm9ncmVzc1N0YXR1cykgewotICAgICAgICAgICAgaWYgKG1QcmV2aW91c1RyYWNrVGltZVVzIDw9IDApIHsKLSAgICAgICAgICAgICAgICBtUHJldmlvdXNUcmFja1RpbWVVcyA9IG1TdGFydFRpbWVzdGFtcFVzOwotICAgICAgICAgICAgfQotICAgICAgICAgICAgdHJhY2tQcm9ncmVzc1N0YXR1cyh0aW1lc3RhbXBVcyk7Ci0gICAgICAgIH0KLSAgICAgICAgaWYgKCFoYXNNdWx0aXBsZVRyYWNrcykgewotICAgICAgICAgICAgb2ZmNjRfdCBvZmZzZXQgPSBtSXNBdmM/IG1Pd25lci0+YWRkTGVuZ3RoUHJlZml4ZWRTYW1wbGVfbChjb3B5KQotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOiBtT3duZXItPmFkZFNhbXBsZV9sKGNvcHkpOwotICAgICAgICAgICAgaWYgKG1DaHVua09mZnNldHMuZW1wdHkoKSkgewotICAgICAgICAgICAgICAgIGFkZENodW5rT2Zmc2V0KG9mZnNldCk7Ci0gICAgICAgICAgICB9Ci0gICAgICAgICAgICBjb3B5LT5yZWxlYXNlKCk7Ci0gICAgICAgICAgICBjb3B5ID0gTlVMTDsKLSAgICAgICAgICAgIGNvbnRpbnVlOwotICAgICAgICB9Ci0KLSAgICAgICAgbUNodW5rU2FtcGxlcy5wdXNoX2JhY2soY29weSk7Ci0gICAgICAgIGlmIChpbnRlcmxlYXZlRHVyYXRpb25VcyA9PSAwKSB7Ci0gICAgICAgICAgICBhZGRPbmVTdHNjVGFibGVFbnRyeSgrK25DaHVua3MsIDEpOwotICAgICAgICAgICAgYnVmZmVyQ2h1bmsodGltZXN0YW1wVXMpOwotICAgICAgICB9IGVsc2UgewotICAgICAgICAgICAgaWYgKGNodW5rVGltZXN0YW1wVXMgPT0gMCkgewotICAgICAgICAgICAgICAgIGNodW5rVGltZXN0YW1wVXMgPSB0aW1lc3RhbXBVczsKLSAgICAgICAgICAgIH0gZWxzZSB7Ci0gICAgICAgICAgICAgICAgaW50NjRfdCBjaHVua0R1cmF0aW9uVXMgPSB0aW1lc3RhbXBVcyAtIGNodW5rVGltZXN0YW1wVXM7Ci0gICAgICAgICAgICAgICAgaWYgKGNodW5rRHVyYXRpb25VcyA+IGludGVybGVhdmVEdXJhdGlvblVzKSB7Ci0gICAgICAgICAgICAgICAgICAgIGlmIChjaHVua0R1cmF0aW9uVXMgPiBtTWF4Q2h1bmtEdXJhdGlvblVzKSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICBtTWF4Q2h1bmtEdXJhdGlvblVzID0gY2h1bmtEdXJhdGlvblVzOwotICAgICAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgICAgICsrbkNodW5rczsKLSAgICAgICAgICAgICAgICAgICAgaWYgKG5DaHVua3MgPT0gMSB8fCAgLy8gRmlyc3QgY2h1bmsKLSAgICAgICAgICAgICAgICAgICAgICAgICgtLShtU3RzY1RhYmxlRW50cmllcy5lbmQoKSkpLT5zYW1wbGVzUGVyQ2h1bmsgIT0KLSAgICAgICAgICAgICAgICAgICAgICAgICBtQ2h1bmtTYW1wbGVzLnNpemUoKSkgewotICAgICAgICAgICAgICAgICAgICAgICAgYWRkT25lU3RzY1RhYmxlRW50cnkobkNodW5rcywgbUNodW5rU2FtcGxlcy5zaXplKCkpOwotICAgICAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgICAgIGJ1ZmZlckNodW5rKHRpbWVzdGFtcFVzKTsKLSAgICAgICAgICAgICAgICAgICAgY2h1bmtUaW1lc3RhbXBVcyA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bGVUcmFja3MpIHsKLQotICAgIC8vIFNlbmQgdHJhY2sgc3VtbWFyeSBvbmx5IGlmIHRlc3QgbW9kZSBpcyBlbmFibGVkLgotICAgIGlmICghaXNUZXN0TW9kZUVuYWJsZWQoKSkgewotICAgICAgICByZXR1cm47Ci0gICAgfQotCi0gICAgaW50IHRyYWNrTnVtID0gKG1UcmFja0lkIDw8IDI4KTsKLQotICAgIG1Pd25lci0+bm90aWZ5KE1FRElBX1JFQ09SREVSX1RSQUNLX0VWRU5UX0lORk8sCi0gICAgICAgICAgICAgICAgICAgIHRyYWNrTnVtIHwgTUVESUFfUkVDT1JERVJfVFJBQ0tfSU5GT19UWVBFLAotICAgICAgICAgICAgICAgICAgICBtSXNBdWRpbz8gMDogMSk7Ci0KLSAgICBtT3duZXItPm5vdGlmeShNRURJQV9SRUNPUkRFUl9UUkFDS19FVkVOVF9JTkZPLAotICAgICAgICAgICAgICAgICAgICB0cmFja051bSB8IE1FRElBX1JFQ09SREVSX1RSQUNLX0lORk9fRFVSQVRJT05fTVMsCi0gICAgICAgICAgICAgICAgICAgIG1UcmFja0R1cmF0aW9uVXMgLyAxMDAwKTsKLQotICAgIG1Pd25lci0+bm90aWZ5KE1FRElBX1JFQ09SREVSX1RSQUNLX0VWRU5UX0lORk8sCi0gICAgICAgICAgICAgICAgICAgIHRyYWNrTnVtIHwgTUVESUFfUkVDT1JERVJfVFJBQ0tfSU5GT19FTkNPREVEX0ZSQU1FUywKLSAgICAgICAgICAgICAgICAgICAgbU51bVNhbXBsZXMpOwotCi0gICAgewotICAgICAgICAvLyBUaGUgc3lzdGVtIGRlbGF5IHRpbWUgZXhjbHVkaW5nIHRoZSByZXF1ZXN0ZWQgaW5pdGlhbCBkZWxheSB0aGF0Ci0gICAgICAgIC8vIGlzIHVzZWQgdG8gZWxpbWluYXRlIHRoZSByZWNvcmRpbmcgc291bmQuCi0gICAgICAgIGludDY0X3Qgc3RhcnRUaW1lT2Zmc2V0VXMgPSBtT3duZXItPmdld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sKLX0KLQotdm9pZCBNUEVHNFdyaXRlcjo6VHJhY2s6OndyaXRlVHJhY2tIZWFkZXIoYm9vbCB1c2UzMkJpdE9mZnNldCkgewotCi0gICAgQUxPR1YoIiVzIHRyYWNrIHRpbWUgc2NhbGU6ICVkIiwKLSAgICAgICAgbUlzQXVkaW8/ICJBdWRpbyI6ICJWaWRlbyIsIG1UaW1lU2NhbGUpOwotCi0gICAgdGltZV90IG5vdyA9IHRpbWUoTlVMTCk7Ci0gICAgbU93bmVyLT5iZWdpbkJveCgidHJhayIpOwotICAgICAgICB3cml0ZVRraGRCb3gobm93KTsKLSAgICAgICAgbU93bmVyLT5iZWdpbkJveCgibWRpYSIpOwotICAgICAgICAgICAgd3JpdGVNZGhkQm94KG5vdyk7Ci0gICAgICAgICAgICB3cml0ZUhkbHJCb3goKTsKLSAgICAgICAgICAgIG1Pd25lci0+YmVnaW5Cb3goIm1pbmYiKTsKLSAgICAgICAgICAgICAgICBpZiAobUlzQXVkaW8pIHsKLSAgICAgICAgICAgICAgICAgICAgd3JpdGVTbWhkQm94KCk7Ci0gICAgICAgICAgICAgICAgfSBlbHNlIHsKLSAgICAgICAgICAgICAgICAgICAgd3JpdGVWbWhkQm94KCk7Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgIHdyaXRlRGluZkJveCgpOwotICAgICAgICAgICAgICAgIHdyaXRlU3RibEJveCh1c2UzMkJpdE9mZnNldCk7Ci0gICAgICAgICAgICBtT3duZXItPmVuZEJveCgpOyAgLy8gbWluZgotICAgICAgICBtT3duZXItPmVuZEJveCgpOyAgLy8gbWRpYQotICAgIG1Pd25lci0+ZW5kQm94KCk7ICAvLyB0cmFrCi19Ci0KLXZvaWQgTVBFRzRXcml0ZXI6OlRyYWNrOjp3cml0ZVN0YmxCb3goYm9vbCB1c2UzMkJpdE9mZnNldCkgewotICAgIG1Pd25lci0+YmVnaW5Cb3goInN0YmwiKTsKLSAgICBtT3duZXItPmJlZ2luQm94KCJzdHNkI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FzZWNtcChNRURJQV9NSU1FVFlQRV9WSURFT19BVkMsIG1pbWUpKSB7Ci0gICAgICAgIG1Pd25lci0+YmVnaW5Cb3goImF2YzEiKTsKLSAgICB9IGVsc2UgewotICAgICAgICBBTE9HRSgiVW5rbm93biBtaW1lIHR5cGUgJyVzJy4iLCBtaW1lKTsKLSAgICAgICAgQ0hFQ0soISJzaG91bGQgbm90IGJlIGhlcmUsIHVua25vd24gbWltZSB0eXBlLiIpOwotICAgIH0KLQotICAgIG1Pd25lci0+d3JpdGVJbnQzMigwKTsgICAgICAgICAgIC8vIHJlc2VydmVkCi0gICAgbU93bmVyLT53cml0ZUludDE2KDApOyAgICAgICAgICAgLy8gcmVzZXJ2ZWQKLSAgICBtT3duZXItPndyaXRlSW50MTYoMSk7ICAgICAgICAgICAvLyBkYXRhIHJlZiBpbmRleAotICAgIG1Pd25lci0+d3JpdGVJbnQxNigwKTsgICAgICAgICAgIC8vIHByZWRlZmluZWQKLSAgICBtT3duZXItPndyaXRlSW50MTYoMCk7ICAgICAgICAgICAvLyByZXNlcnZlZAotICAgIG1Pd25lci0+d3JpdGVJbnQzMigwKTsgICAgICAgICAgIC8vIHByZWRlZmluZWQKLSAgICBtT3duZXItPndyaXRlSW50MzIoMCk7ICAgICAgICAgICAvLyBwcmVkZWZpbmVkCi0gICAgbU93bmVyLT53cml0ZUludDMyKDApOyAgICAgICAgICAgLy8gcHJlZGVmaW5lZAotCi0gICAgaW50MzJfdCB3aWR0aCwgaGVpZ2h0OwotICAgIHN1Y2Nlc3MgPSBtTWV0YS0+ZmluZEludDMyKGtLZXlXaWR0aCwgJndpZHRoKTsKLSAgICBzdWNjZXNzID0gc3VjY2VzcyAmJiBtTWV0YS0+ZmluZEludDMyKGtLZXlIZWlnaHQsICZoZWlnaHQpOwotICAgIENIRUNLKHN1Y2Nlc3MpOwotCi0gICAgbU93bmVyLT53cml0ZUludDE2KHdpZHRoKTsKLSAgICBtT3duZXItPndyaXRlSW50MTYoaGVpZ2h0KTsKLSAgICBtT3duZXItPndyaXRlSW50MzIoMHg0ODAwMDApOyAgICAvLyBob3JpeiByZXNvbHV0aW9uCi0gICAgbU93bmVyLT53cml0ZUludDMyKDB4NDgwMDAwKTsgICAgLy8gdmVydCByZXNvbHV0aW9uCi0gICAgbU93bmVyLT53cml0ZUludDMyKDApOyAgICAgICAgICAgLy8gcmVzZXJ2ZWQKLSAgICBtT3duZXItPndyaXRlSW50MTYoMSk7ICAgICAgICAgICAvLyBmcmFtZSBjb3VudAotICAgIG1Pd25lci0+d3JpdGUoIiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIiwgMzIpOwotICAgIG1Pd25lci0+d3JpdGVJbnQxNigweDE4KTsgICAgICAgIC8vIGRlcHRoCi0gICAgbU93bmVyLT53cml0ZUludDE2KC0xKTsgICAgICAgICAgLy8gcHJlZGVmaW5lZAotCi0gICAgQ0hFQ0tfTFQoMjMgKyBtQ29kZWNTcGVjaWZpY0RhdGFTaXplLCAxMjgpOwotCi0gICAgaWYgKCFzdHJjYXNlY21wKE1FRElBX01JTUVUWVBFX1ZJREVPX01QRUc0LCBtaW1lKSkgewotICAgICAgICB3cml0ZU1wNHZFc2RzQm94KCk7Ci0gICAgfSBlbHNlIGlmICghc3RyY2FzZWNtcChNRURJQV9NSU1FVFlQRV9WSURFT19IMjYzLCBtaW1lKSkgewotICAgICAgICB3cml0ZUQyNjNCb3goKTsKLSAgICB9IGVsc2UgaWYgKCFzdHJjYXNlY21wKE1FRElBX01JTUVUWVBFX1ZJREVPX0FWQywgbWltZSkpIHsKLSAgICAgICAgd3JpdGVBdmNjQm94KCk7Ci0gICAgfQotCi0gICAgd3JpdGVQYXNwQm94KCk7Ci0gICAgbU93bmVyLT5lbmRCb3goKTsgIC8vIG1wNHYsIHMyNjMgb3IgYXZjMQotfQotCi12b2lkIE1QRUc0V3JpdGVyOjpUcmFjazo6d3JpdGVBdWRpb0ZvdXJDQ0JveCgpIHsKLSAgICBjb25zdCBjaGFyICptaW1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uZAotICAgIC8vIHBhcnQgb2YgdGhlIHByZXNlbnRhdGlvbgotICAgIG1Pd25lci0+d3JpdGVJbnQzMigweDA3KTsgICAgICAgICAgLy8gdmVyc2lvbj0wLCBmbGFncz03Ci0gICAgbU93bmVyLT53cml0ZUludDMyKG5vdyk7ICAgICAgICAgICAvLyBjcmVhdGlvbiB0aW1lCi0gICAgbU93bmVyLT53cml0ZUludDMyKG5vdyk7ICAgICAgICAgICAvLyBtb2RpZmljYXRpb24gdGltZQotICAgIG1Pd25lci0+d3JpdGVJbnQzMihtVHJhY2tJZCArIDEpOyAgLy8gdHJhY2sgaWQgc3RhcnRzIHdpdGggMQotICAgIG1Pd25lci0+d3JpdGVJbnQzMigwKTsgICAgICAgICAgICAgLy8gcmVzZXJ2ZWQKLSAgICBpbnQ2NF90IHRyYWtEdXJhdGlvblVzID0gZ2V0RHVyYXRpb25VcygpOwotICAgIGludDMyX3QgbXZoZFRpbWVTY2FsZSA9IG1Pd25lci0+Z2V0VGltZVNjYWxlKCk7Ci0gICAgaW50MzJfdCB0a2hkRHVyYXRpb24gPQotICAgICAgICAodHJha0R1cmF0aW9uVXMgKiBtdmhkVGltZVNjYWxlICsgNUU1KSAvIDFFNjsKLSAgICBtT3duZXItPndyaXRlSW50MzIodGtoZER1cmF0aW9uKTsgIC8vIGluIG12aGQgdGltZXNjYWxlCi0gICAgbU93bmVyLT53cml0ZUludDMyKDApOyAgICAgICAgICAgICAvLyByZXNlcnZlZAotICAgIG1Pd25lci0+d3JpdGVJbnQzMigwKTsgICAgICAgICAgICAgLy8gcmVzZXJ2ZWQKLSAgICBtT3duZXItPndyaXRlSW50MTYoMCk7ICAgICAgICAgICAgIC8vIGxheWVyCi0gICAgbU93bmVyLT53cml0ZUludDE2KDApOyAgICAgICAgICAgICAvLyBhbHRlcm5hdGUgZ3JvdXAKLSAgICBtT3duZXItPndyaXRlSW50MTYobUlzQXVkaW8gPyAweDEwMCA6IDApOyAgLy8gdm9sdW1lCi0gICAgbU93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bmVyLT53cml0ZUludDE2KDApOwotICAgIG1Pd25lci0+d3JpdGVJbnQxNigwKTsKLSAgICBtT3duZXItPmVuZEJveCgpOwotfQotCi12b2lkIE1QRUc0V3JpdGVyOjpUcmFjazo6d3JpdGVTbWhkQm94KCkgewotICAgIG1Pd25lci0+YmVnaW5Cb3goInNtaGQiKTsKLSAgICBtT3duZXItPndyaXRlSW50MzIoMCk7ICAgICAgICAgICAvLyB2ZXJzaW9uPTAsIGZsYWdzPTAKLSAgICBtT3duZXItPndyaXRlSW50MTYoMCk7ICAgICAgICAgICAvLyBiYWxhbmNlCi0gICAgbU93bmVyLT53cml0ZUludDE2KDApOyAgICAgICAgICAgLy8gcmVzZXJ2ZWQKLSAgICBtT3duZXItPmVuZEJveCgpOwotfQotCi12b2lkIE1QRUc0V3JpdGVyOjpUcmFjazo6d3JpdGVIZGxyQm94KCkgewotICAgIG1Pd25lci0+YmVnaW5Cb3goImhkbHIiKTsKLSAgICBtT3duZXItPndyaXRlSW50MzIoMCk7ICAgICAgICAgICAgIC8vIHZlcnNpb249MCwgZmxhZ3M9MAotICAgIG1Pd25lci0+d3JpdGVJbnQzMigwKTsgICAgICAgICAgICAgLy8gY29tcG9uZW50IHR5cGU6IHNob3VsZCBiZSBtaGxyCi0gICAgbU93bmVyLT53cml0ZUZvdXJjYyhtSXNBdWRpbyA/ICJzb3VuIiA6ICJ2aWRlIik7ICAvLyBjb21wb25lbnQgc3VidHlwZQotICAgIG1Pd25lci0+d3JpdGVJbnQzMigwKTsgICAgICAgICAgICAgLy8gcmVzZXJ2ZWQKLSAgICBtT3duZXItPndyaXRlSW50MzIoMCk7ICAgICAgICAgICAgIC8vIHJlc2VydmVkCi0gICAgbU93bmVyLT53cml0ZUludDMyKDApOyAgICAgICAgICAgICAvLyByZXNlcnZlZAotICAgIC8vIFJlbW92aW5nICJyIiBmb3IgdGhlIG5hbWUgc3RyaW5nIGp1c3QgbWFrZXMgdGhlIHN0cmluZyA0IGJ5dGUgYWxpZ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XQpOyAgLy8gZGVmYXVsdCBzYW1wbGUgc2l6ZQotICAgIH0gZWxzZSB7Ci0gICAgICAgIG1Pd25lci0+d3JpdGVJbnQzMigwKTsKLSAgICB9Ci0gICAgbU93bmVyLT53cml0ZUludDMyKG1OdW1TYW1wbGVzKTsKLSAgICBpZiAoIW1TYW1wbGVzSGF2ZVNhbWVTaXplKSB7Ci0gICAgICAgIGZvciAoTGlzdDxzaXplX3Q+OjppdGVyYXRvciBpdCA9IG1TYW1wbGVTaXplcy5iZWdpbigpOwotICAgICAgICAgICAgaXQgIT0gbVNhbXBsZVNpemVzLmVuZCgpOyArK2l0KSB7Ci0gICAgICAgICAgICBtT3duZXItPndyaXRlSW50MzIoKml0KTsKLSAgICAgICAgfQotICAgIH0KLSAgICBtT3duZXItPmVuZEJveCgpOyAgLy8gc3RzegotfQotCi12b2lkIE1QRUc0V3JpdGVyOjpUcmFjazo6d3JpdGVTdHNjQm94KCkgewotICAgIG1Pd25lci0+YmVnaW5Cb3goInN0c2MiKTsKLSAgICBtT3duZXItPndyaXRlSW50MzIoMCk7ICAvLyB2ZXJzaW9uPTAsIGZsYWdzPTAKLSAgICBtT3duZXItPndyaXRlSW50MzIobU51bVN0c2NUYWJsZUVudHJpZXMpOwotICAgIGZvciAoTGlzdDxTdHNjVGFibGVFbnRyeT46Oml0ZXJhdG9yIGl0ID0gbVN0c2NUYWJsZUVudHJpZXMuYmVnaW4oKTsKLSAgICAgICAgaXQgIT0gbVN0c2NUYWJsZUVudHJpZXMuZW5kKCk7ICsraXQpIHsKLSAgICAgICAgbU93bmVyLT53cml0ZUludDMyKGl0LT5maXJzdENodW5rKTsKLSAgICAgICAgbU93bmVyLT53cml0ZUludDMyKGl0LT5zYW1wbGVzUGVyQ2h1bmspOwotICAgICAgICBtT3duZXItPndyaXRlSW50MzIoaXQtPnNhbXBsZURlc2NyaXB0aW9uSWQpOwotICAgIH0KLSAgICBtT3duZXItPmVuZEJveCgpOyAgLy8gc3RzYwotfQotCi12b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m5hbEVycm9yOwotICAgICAgICAgICAgICAgICAgICBDSEVDSyhtc2ctPmZpbmRJbnQzMigib214LWVycm9yIiwgJm9teEVycm9yKSk7Ci0gICAgICAgICAgICAgICAgICAgIENIRUNLKG1zZy0+ZmluZEludDMyKCJlcnIiLCAmaW50ZXJuYWxFcnJvcikpOwotCi0gICAgICAgICAgICAgICAgICAgIEFMT0dFKCJDb2RlYyByZXBvcnRlZCBhbiBlcnJvci4gIgotICAgICAgICAgICAgICAgICAgICAgICAgICAiKG9teCBlcnJvciAweCUwOHgsIGludGVybmFsRXJyb3IgJWQpIiwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgb214RXJyb3IsIGludGVybmFsRXJyb3IpOwotCi0gICAgICAgICAgICAgICAgICAgIGJvb2wgc2VuZEVycm9yUmVwb25zZSA9IHRydWU7Ci0KLSAgICAgICAgICAgICAgICAgICAgc3dpdGNoIChtU3RhdGUpIHsKLSAgICAgICAgICAgICAgICAgICAgICAgIGNhc2UgSU5JVElBTElaSU5HOgotICAgICAgICAgICAgICAgICAgICAgICAgewotICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNldFN0YXRlKFVOSU5JVElBTElaRUQpOwotICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOwotICAgICAgICAgICAgICAgICAgICAgICAgfQotCi0gICAgICAgICAgICAgICAgICAgICAgICBjYXNlIENPTkZJR1VSSU5HOgotICAgICAgICAgICAgICAgICAgICAgICAgewotICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNldFN0YXRlKElOSVRJQUxJWkVEKTsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKLSAgICAgICAgICAgICAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgICAgICAgICAgICAgY2FzZSBTVEFSVElORzoKLSAgICAgICAgICAgICAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBzZXRTdGF0ZShDT05GSUdVUkVEKTsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKLSAgICAgICAgICAgICAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgICAgICAgICAgICAgY2FzZSBTVE9QUElORzoKLSAgICAgICAgICAgICAgICAgICAgICAgIGNhc2UgUkVMRUFTSU5HOgotICAgICAgICAgICAgICAgICAgICAgICAgewotICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vIElnbm9yZSB0aGUgZXJyb3IsIGFzc3VtaW5nIHdlJ2xsIHN0aWxsIGdldAotICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vIHRoZSBzaHV0ZG93biBjb21wbGV0ZSBub3RpZmljYXRpb24uCi0KLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBzZW5kRXJyb3JSZXBvbnNlID0gZmFsc2U7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7Ci0gICAgICAgICAgICAgICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgICAgICAgICAgICAgIGNhc2UgRkxVU0hJTkc6Ci0gICAgICAgICAgICAgICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgc2V0U3RhdGUoU1RBUlRFRCk7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7Ci0gICAgICAgICAgICAgICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgICAgICAgICAgICAgIGNhc2UgU1RBUlRFRDoKLSAgICAgICAgICAgICAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBzZW5kRXJyb3JSZXBvbnNlID0gZmFsc2U7Ci0KLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBtRmxhZ3MgfD0ga0ZsYWdTdGlja3lFcnJvcjsKLQotICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNhbmNlbFBlbmRpbmdEZXF1ZXVlT3BlcmF0aW9ucygpOwotICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOwotICAgICAgICAgICAgICAgICAgICAgICAgfQotCi0gICAgICAgICAgICAgICAgICAgICAgICBkZWZhdWx0OgotICAgICAgICAgICAgICAgICAgICAgICAgewotICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNlbmRFcnJvclJlcG9uc2UgPSBmYWxzZTsKLQotICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1GbGFncyB8PSBrRmxhZ1N0aWNreUVycm9yOwotICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOwotICAgICAgICAgICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgICAgICAgICAgaWYgKHNlbmRFcnJvclJlcG9uc2UpIHsKLSAgICAgICAgICAgICAgICAgICAgICAgIHNwPEFNZXNzYWdlPiByZXNwb25zZSA9IG5ldyBBTWVzc2FnZTsKLSAgICAgICAgICAgICAgICAgICAgICAgIHJlc3BvbnNlLT5zZXRJbnQzMigiZXJyIiwgVU5LTk9XTl9FUlJPUik7Ci0KLSAgICAgICAgICAgICAgICAgICAgICAgIHJlc3BvbnNlLT5wb3N0UmVwbHkobVJlcGx5SUQpOwotICAgICAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgICAgIGJyZWFrOwotICAgICAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgICAgIGNhc2UgQUNvZGVjOjprV2hhdENvbXBvbmVudEFsbG9jYXRlZDoKLSAgICAgICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgICAgIENIRUNLX0VRKG1TdGF0ZSwgSU5JVElBTElaSU5HKTsKLSAgICAgICAgICAgICAgICAgICAgc2V0U3RhdGUoSU5JVElBTElaRUQpOwotCi0gICAgICAgICAgICAgICAgICAgIEFTdHJpbmcgY29tcG9uZW50TmFtZTsKLSAgICAgICAgICAgICAgICAgICAgQ0hFQ0sobXNnLT5maW5kU3RyaW5nKCJjb21wb25lbnROYW1lIiwgJmNvbXBvbmVudE5hbWUpKTsKLQotICAgICAgICAgICAgICAgICAgICBpZiAoY29tcG9uZW50TmFtZS5zdGFydHNXaXRoKCJPTVguZ29vZ2xlLiIpKSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICBtRmxhZ3MgfD0ga0ZsYWdJc1NvZnR3YXJlQ29kZWM7Ci0gICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICBtRmxhZ3MgJj0gfmtGbGFnSXNTb2Z0d2FyZUNvZGVjOwotICAgICAgICAgICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgICAgICAgICAgKG5ldyBBTWVzc2FnZSktPnBvc3RSZXBseShtUmVwbHlJRCk7Ci0gICAgICAgICAgICAgICAgICAgIGJyZWFrOwotICAgICAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgICAgIGNhc2UgQUNvZGVjOjprV2hhdENvbXBvbmVudENvbmZpZ3VyZWQ6Ci0gICAgICAgICAgICAgICAgewotICAgICAgICAgICAgICAgICAgICBDSEVDS19FUShtU3RhdGUsIENPTkZJR1VSSU5HKTsKLSAgICAgICAgICAgICAgICAgICAgc2V0U3RhdGUoQ09ORklHVVJFRCk7Ci0KLSAgICAgICAgICAgICAgICAgICAgKG5ldyBBTWVzc2FnZSktPnBvc3RSZXBseShtUmVwbHlJRCk7Ci0gICAgICAgICAgICAgICAgICAgIGJyZWFrOwotICAgICAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgICAgIGNhc2UgQUNvZGVjOjprV2hhdEJ1ZmZlcnNBbGxvY2F0ZWQ6Ci0gICAgICAgICAgICAgICAgewotICAgICAgICAgICAgICAgICAgICBpbnQzMl90IHBvcnRJbmRleDsKLSAgICAgICAgICAgICAgICAgICAgQ0hFQ0sobXNnLT5maW5kSW50MzIoInBvcnRJbmRleCIsICZwb3J0SW5kZXgpKTsKLQotICAgICAgICAgICAgICAgICAgICBBTE9HVigiJXMgYnVmZmVycyBhbGxvY2F0ZWQiLAotICAgICAgICAgICAgICAgICAgICAgICAgICBwb3J0SW5kZXggPT0ga1BvcnRJbmRleElucHV0ID8gImlucHV0IiA6ICJvdXRwdXQiKTsKLQotICAgICAgICAgICAgICAgICAgICBDSEVDSyhwb3J0SW5kZXggPT0ga1BvcnRJbmRleElucHV0Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgfHwgcG9ydEluZGV4ID09IGtQb3J0SW5kZXhPdXRwdXQpOwotCi0gICAgICAgICAgICAgICAgICAgIG1Qb3J0QnVmZmVyc1twb3J0SW5kZXhdLmNsZWFyKCk7Ci0KLSAgICAgICAgICAgICAgICAgICAgVmVjdG9yPEJ1ZmZlckluZm8+ICpidWZmZXJzID0gJm1Qb3J0QnVmZmVyc1twb3J0SW5kZXhdOwotICAgICAgICAgICAgICAgICAgICBmb3IgKHNpemVfdCBpID0gMDs7ICsraSkgewotICAgICAgICAgICAgICAgICAgICAgICAgQVN0cmluZyBuYW1lID0gU3RyaW5nUHJpbnRmKCJidWZmZXItaWRfJWQiLCBpKTsKLQotICAgICAgICAgICAgICAgICAgICAgICAgdm9pZCAqYnVmZmVySUQ7Ci0gICAgICAgICAgICAgICAgICAgICAgICBpZiAoIW1zZy0+ZmluZFBvaW50ZXIobmFtZS5jX3N0cigpLCAmYnVmZmVySUQpKSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7Ci0gICAgICAgICAgICAgICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgICAgICAgICAgICAgIG5hbWUgPSBTdHJpbmdQcmludGYoImRhdGFfJWQiLCBpKTsKLQotICAgICAgICAgICAgICAgICAgICAgICAgQnVmZmVySW5mbyBpbmZvOwotICAgICAgICAgICAgICAgICAgICAgICAgaW5mby5tQnVmZmVySUQgPSBidWZmZXJJRDsKLSAgICAgICAgICAgICAgICAgICAgICAgIGluZm8ubU93bmVkQnlDbGllbnQgPSBmYWxzZTsKLSAgICAgICAgICAgICAgICAgICAgICAgIENIRUNLKG1zZy0+ZmluZEJ1ZmZlcihuYW1lLmNfc3RyKCksICZpbmZvLm1EYXRhKSk7Ci0KLSAgICAgICAgICAgICAgICAgICAgICAgIGlmIChwb3J0SW5kZXggPT0ga1BvcnRJbmRleElucHV0Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIChtRmxhZ3MgJiBrRmxhZ0lzU2VjdXJlKSkgewotICAgICAgICAgICAgICAgICAgICAgICAgICAgIGluZm8ubUVuY3J5cHRlZERhdGEgPQotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBuZXcgQUJ1ZmZlcihpbmZvLm1EYXRhLT5jYXBhY2l0eSgpKTsKLSAgICAgICAgICAgICAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgICAgICAgICAgICAgYnVmZmVycy0+cHVzaF9iYWNrKGluZm8pOwotICAgICAgICAgICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgICAgICAgICAgaWYgKHBvcnRJbmRleCA9PSBrUG9ydEluZGV4T3V0cHV0KSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICBpZiAobVN0YXRlID09IFNUQVJUSU5HKSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gV2UncmUgYWx3YXlzIGFsbG9jYXRpbmcgb3V0cHV0IGJ1ZmZlcnMgYWZ0ZXIKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyBhbGxvY2F0aW5nIGlucHV0IGJ1ZmZlcnMsIHNvIHRoaXMgaXMgYSBnb29kCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gaW5kaWNhdGlvbiB0aGF0IG5vdyBhbGwgYnVmZmVycyBhcmUgYWxsb2NhdGVkLgotICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNldFN0YXRlKFNUQVJURUQpOwotICAgICAgICAgICAgICAgICAgICAgICAgICAgIChuZXcgQU1lc3NhZ2UpLT5wb3N0UmVwbHkobVJlcGx5SUQpOwotICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBtRmxhZ3MgfD0ga0ZsYWdPdXRwdXRCdWZmZXJzQ2hhbmdlZDsKLSAgICAgICAgICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgICAgICBicmVhazsKLSAgICAgICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgICAgICBjYXNlIEFDb2RlYzo6a1doYXRPdXRwdXRGb3JtYXRDaGFuZ2VkOgotICAgICAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAgICAgQUxPR1YoImNvZGVjIG91dHB1dCBmb3JtYXQgY2hhbmdlZCIpOwotCi0gICAgICAgICAgICAgICAgICAgIGlmICgobUZsYWdzICYga0ZsYWdJc1NvZnR3YXJlQ29kZWMpCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgbU5hdGl2ZVdpbmRvdyAhPSBOVUxMKSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICBBU3RyaW5nIG1pbWU7Ci0gICAgICAgICAgICAgICAgICAgICAgICBDSEVDSyhtc2ctPmZpbmRTdHJpbmcoIm1pbWUiLCAmbWltZSkpOwotCi0gICAgICAgICAgICAgICAgICAgICAgICBpZiAoIXN0cm5jYXNlY21wKCJ2aWRlby8iLCBtaW1lLmNfc3RyKCksIDYpKSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgZGVsZXRlIG1Tb2Z0UmVuZGVyZXI7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgbVNvZnRSZW5kZXJlciA9IE5VTEw7Ci0KLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBpbnQzMl90IHdpZHRoLCBoZWlnaHQ7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgQ0hFQ0sobXNnLT5maW5kSW50MzIoIndpZHRoIiwgJndpZHRoKSk7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgQ0hFQ0sobXNnLT5maW5kSW50MzIoImhlaWdodCIsICZoZWlnaHQpKTsKLQotICAgICAgICAgICAgICAgICAgICAgICAgICAgIGludDMyX3QgY29sb3JGb3JtYXQ7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgQ0hFQ0sobXNnLT5maW5kSW50MzIoCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgImNvbG9yLWZvcm1hdCIsICZjb2xvckZvcm1hdCkpOwotCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgc3A8TWV0YURhdGE+IG1ldGEgPSBuZXcgTWV0YURhdGE7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgbWV0YS0+c2V0SW50MzIoa0tleVdpZHRoLCB3aWR0aCk7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgbWV0YS0+c2V0SW50MzIoa0tleUhlaWdodCwgaGVpZ2h0KTsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBtZXRhLT5zZXRJbnQzMihrS2V5Q29sb3JGb3JtYXQsIGNvbG9yRm9ybWF0KTsKLQotICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1Tb2Z0UmVuZGVyZXIgPQotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBuZXcgU29mdHdhcmVSZW5kZXJlcihtTmF0aXZlV2luZG93LCBtZXRhKTsKLSAgICAgICAgICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICAgICAgfQotCi0gICAgICAgICAgICAgICAgICAgIG1PdXRwdXRGb3JtYXQgPSBtc2c7Ci0gICAgICAgICAgICAgICAgICAgIG1GbGFncyB8PSBrRmxhZ091dHB1dEZvcm1hdENoYW5nZWQ7Ci0gICAgICAgICAgICAgICAgICAgIGJyZWFrOwotICAgICAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgICAgIGNhc2UgQUNvZGVjOjprV2hhdEZpbGxUaGlzQnVmZmVyOgotICAgICAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAgICAgLyogc2l6ZV90IGluZGV4ID0gKi91cGRhdGVCdWZmZXJzKGtQb3J0SW5kZXhJbnB1dCwgbXNnKTsKLQotICAgICAgICAgICAgICAgICAgICBpZiAobVN0YXRlID09IEZMVVNISU5HCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgfHwgbVN0YXRlID09IFNUT1BQSU5HCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgfHwgbVN0YXRlID09IFJFTEVBU0lORykgewotICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuQnVmZmVyc1RvQ29kZWNPblBvcnQoa1BvcnRJbmRleElucHV0KTsKLSAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOwotICAgICAgICAgICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgICAgICAgICAgaWYgKG1GbGFncyAmIGtGbGFnRGVxdWV1ZUlucHV0UGVuZGluZykgewotICAgICAgICAgICAgICAgICAgICAgICAgQ0hFQ0soaGFuZGxlRGVxdWV1ZUlucHV0QnVmZmVyKG1EZXF1ZXVlSW5wdXRSZXBseUlEKSk7Ci0KLSAgICAgICAgICAgICAgICAgICAgICAgICsrbURlcXVldWVJbnB1dFRpbWVvdXRHZW5lcmF0aW9uOwotICAgICAgICAgICAgICAgICAgICAgICAgbUZsYWdzICY9IH5rRmxhZ0RlcXVldWVJbnB1dFBlbmRpbmc7Ci0gICAgICAgICAgICAgICAgICAgICAgICBtRGVxdWV1ZUlucHV0UmVwbHlJRCA9IDA7Ci0gICAgICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICAgICAgYnJlYWs7Ci0gICAgICAgICAgICAgICAgfQotCi0gICAgICAgICAgICAgICAgY2FzZSBBQ29kZWM6OmtXaGF0RHJhaW5UaGlzQnVmZmVyOgotICAgICAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAgICAgLyogc2l6ZV90IGluZGV4ID0gKi91cGRhdGVCdWZmZXJzKGtQb3J0SW5kZXhPdXRwdXQsIG1zZyk7Ci0KLSAgICAgICAgICAgICAgICAgICAgaWYgKG1TdGF0ZSA9PSBGTFVTSElORwotICAgICAgICAgICAgICAgICAgICAgICAgICAgIHx8IG1TdGF0ZSA9PSBTVE9QUElORwotICAgICAgICAgICAgICAgICAgICAgICAgICAgIHx8IG1TdGF0ZSA9PSBSRUxFQVNJTkcpIHsKLSAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybkJ1ZmZlcnNUb0NvZGVjT25Qb3J0KGtQb3J0SW5kZXhPdXRwdXQpOwotICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7Ci0gICAgICAgICAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgICAgICAgICBzcDxBQnVmZmVyPiBidWZmZXI7Ci0gICAgICAgICAgICAgICAgICAgIENIRUNLKG1zZy0+ZmluZEJ1ZmZlcigiYnVmZmVyIiwgJmJ1ZmZlcikpOwotCi0gICAgICAgICAgICAgICAgICAgIGludDMyX3Qgb214RmxhZ3M7Ci0gICAgICAgICAgICAgICAgICAgIENIRUNLKG1zZy0+ZmluZEludDMyKCJmbGFncyIsICZvbXhGbGFncykpOwotCi0gICAgICAgICAgICAgICAgICAgIGJ1ZmZlci0+bWV0YSgpLT5zZXRJbnQzMigib214RmxhZ3MiLCBvbXhGbGFncyk7Ci0KLSAgICAgICAgICAgICAgICAgICAgaWYgKG1GbGFncyAmIGtGbGFnRGVxdWV1ZU91dHB1dFBlbmRpbmcpIHsKLSAgICAgICAgICAgICAgICAgICAgICAgIENIRUNLKGhhbmRsZURlcXVldWVPdXRwdXRCdWZmZXIobURlcXVldWVPdXRwdXRSZXBseUlEKSk7Ci0KLSAgICAgICAgICAgICAgICAgICAgICAgICsrbURlcXVldWVPdXRwdXRUaW1lb3V0R2VuZXJhdGlvbjsKLSAgICAgICAgICAgICAgICAgICAgICAgIG1GbGFncyAmPSB+a0ZsYWdEZXF1ZXVlT3V0cHV0UGVuZGluZzsKLSAgICAgICAgICAgICAgICAgICAgICAgIG1EZXF1ZXVlT3V0cHV0UmVwbHlJRCA9IDA7Ci0gICAgICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICAgICAgYnJlYWs7Ci0gICAgICAgICAgICAgICAgfQotCi0gICAgICAgICAgICAgICAgY2FzZSBBQ29kZWM6OmtXaGF0RU9TOgotICAgICAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAgICAgLy8gV2UgYWxyZWFkeSBub3RpZnkgdGhlIGNsaWVudCBvZiB0aGlzIGJ5IHVzaW5nIHRoZQotICAgICAgICAgICAgICAgICAgICAvLyBjb3JyZXNwb25kaW5nIGZsYWcgaW4gIm9uT3V0cHV0QnVmZmVyUmVhZHkiLgotICAgICAgICAgICAgICAgICAgICBicmVhazsKLSAgICAgICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgICAgICBjYXNlIEFDb2RlYzo6a1doYXRTaHV0ZG93bkNvbXBsZXRlZDoKLSAgICAgICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgICAgIGlmIChtU3RhdGUgPT0gU1RPUFBJTkcpIHsKLSAgICAgICAgICAgICAgICAgICAgICAgIHNldFN0YXRlKElOSVRJQUxJWkVEKTsKLSAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHsKLSAgICAgICAgICAgICAgICAgICAgICAgIENIRUNLX0VRKG1TdGF0ZSwgUkVMRUFTSU5HKTsKLSAgICAgICAgICAgICAgICAgICAgICAgIHNldFN0YXRlKFVOSU5JVElBTElaRUQpOwotICAgICAgICAgICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgICAgICAgICAgKG5ldyBBTWVzc2FnZSktPnBvc3RSZXBseShtUmVwbHlJRCk7Ci0gICAgICAgICAgICAgICAgICAgIGJyZWFrOwotICAgICAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgICAgIGNhc2UgQUNvZGVjOjprV2hhdEZsdXNoQ29tcGxldGVkOgotICAgICAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAgICAgQ0hFQ0tfRVEobVN0YXRlLCBGTFVTSElORyk7Ci0gICAgICAgICAgICAgICAgICAgIHNldFN0YXRlKFNUQVJURUQpOwotCi0gICAgICAgICAgICAgICAgICAgIG1Db2RlYy0+c2lnbmFsUmVzdW1lKCk7Ci0KLSAgICAgICAgICAgICAgICAgICAgKG5ldyBBTWVzc2FnZSktPnBvc3RSZXBseShtUmVwbHlJRCk7Ci0gICAgICAgICAgICAgICAgICAgIGJyZWFrOwotICAgICAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgICAgIGRlZmF1bHQ6Ci0gICAgICAgICAgICAgICAgICAgIFRSRVNQQVNTKCk7Ci0gICAgICAgICAgICB9Ci0gICAgICAgICAgICBicmVhazsKLSAgICAgICAgfQotCi0gICAgICAgIGNhc2Uga1doYXRJbml0OgotICAgICAgICB7Ci0gICAgICAgICAgICB1aW50MzJfdCByZXBseUlEOwotICAgICAgICAgICAgQ0hFQ0sobXNnLT5zZW5kZXJBd2FpdHNSZXNwb25zZSgmcmVwbHlJRCkpOwotCi0gICAgICAgICAgICBpZiAobVN0YXRlICE9IFVOSU5JVElBTElaRUQpIHsKLSAgICAgICAgICAgICAgICBzcDxBTWVzc2FnZT4gcmVzcG9uc2UgPSBuZXcgQU1lc3NhZ2U7Ci0gICAgICAgICAgICAgICAgcmVzcG9uc2UtPnNldEludDMyKCJlcnIiLCBJTlZBTElEX09QRVJBVElPTik7Ci0KLSAgICAgICAgICAgICAgICByZXNwb25zZS0+cG9zdFJlcGx5KHJlcGx5SUQpOwotICAgICAgICAgICAgICAgIGJyZWFrOwotICAgICAgICAgICAgfQotCi0gICAgICAgICAgICBtUmVwbHlJRCA9IHJlcGx5SUQ7Ci0gICAgICAgICAgICBzZXRTdGF0ZShJTklUSUFMSVpJTkcpOwotCi0gICAgICAgICAgICBBU3RyaW5nIG5hbWU7Ci0gICAgICAgICAgICBDSEVDSyhtc2ctPmZpbmRTdHJpbmcoIm5hbWUiLCAmbmFtZSkpOwotCi0gICAgICAgICAgICBpbnQzMl90IG5hbWVJc1R5cGU7Ci0gICAgICAgICAgICBpbnQzMl90IGVuY29kZXIgPSBmYWxzZTsKLSAgICAgICAgICAgIENIRUNLKG1zZy0+ZmluZEludDMyKCJuYW1lSXNUeXBlIiwgJm5hbWVJc1R5cGUpKTsKLSAgICAgICAgICAgIGlmIChuYW1lSXNUeXBlKSB7Ci0gICAgICAgICAgICAgICAgQ0hFQ0sobXNnLT5maW5kSW50MzIoImVuY29kZXIiLCAmZW5jb2RlcikpOwotICAgICAgICAgICAgfQotCi0gICAgICAgICAgICBzcDxBTWVzc2FnZT4gZm9ybWF0ID0gbmV3IEFNZXNzYWdlOwotCi0gICAgICAgICAgICBpZiAobmFtZUlzVHlwZSkgewotICAgICAgICAgICAgICAgIGZvcm1hdC0+c2V0U3RyaW5nKCJtaW1lIiwgbmFtZS5jX3N0cigpKTsKLSAgICAgICAgICAgICAgICBmb3JtYXQtPnNldEludDMyKCJlbmNvZGVyIiwgZW5jb2Rlcik7Ci0gICAgICAgICAgICB9IGVsc2UgewotICAgICAgICAgICAgICAgIGZvcm1hdC0+c2V0U3RyaW5nKCJjb21wb25lbnROYW1lIiwgbmFtZS5jX3N0cigpKTsKLSAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgbUNvZGVjLT5pbml0aWF0ZUFsbG9jYXRlQ29tcG9uZW50KGZvcm1hdCk7Ci0gICAgICAgICAgICBicmVhazsKLSAgICAgICAgfQotCi0gICAgICAgIGNhc2Uga1doYXRDb25maWd1cmU6Ci0gICAgICAgIHsKLSAgICAgICAgICAgIHVpbnQzMl90IHJlcGx5SUQ7Ci0gICAgICAgICAgICBDSEVDSyhtc2ctPnNlbmRlckF3YWl0c1Jlc3BvbnNlKCZyZXBseUlEKSk7Ci0KLSAgICAgICAgICAgIGlmIChtU3RhdGUgIT0gSU5JVElBTElaRUQpIHsKLSAgICAgICAgICAgICAgICBzcDxBTWVzc2FnZT4gcmVzcG9uc2UgPSBuZXcgQU1lc3NhZ2U7Ci0gICAgICAgICAgICAgICAgcmVzcG9uc2UtPnNldEludDMyKCJlcnIiLCBJTlZBTElEX09QRVJBVElPTik7Ci0KLSAgICAgICAgICAgICAgICByZXNwb25zZS0+cG9zdFJlcGx5KHJlcGx5SUQpOwotICAgICAgICAgICAgICAgIGJyZWFrOwotICAgICAgICAgICAgfQotCi0gICAgICAgICAgICBtUmVwbHlJRCA9IHJlcGx5SUQ7Ci0gICAgICAgICAgICBzZXRTdGF0ZShDT05GSUdVUklORyk7Ci0KLSAgICAgICAgICAgIHNwPFJlZkJhc2U+IG9iajsKLSAgICAgICAgICAgIGlmICghbXNnLT5maW5kT2JqZWN0KCJuYXRpdmUtd2luZG93IiwgJm9iaikpIHsKLSAgICAgICAgICAgICAgICBvYmouY2xlYXIoKTsKLSAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgc3A8QU1lc3NhZ2U+IGZvcm1hdDsKLSAgICAgICAgICAgIENIRUNLKG1zZy0+ZmluZE1lc3NhZ2UoImZvcm1hdCIsICZmb3JtYXQpKTsKLQotICAgICAgICAgICAgaWYgKG9iaiAhPSBOVUxMKSB7Ci0gICAgICAgICAgICAgICAgZm9ybWF0LT5zZXRPYmplY3QoIm5hdGl2ZS13aW5kb3ciLCBvYmopOwotICAgICAgICAgICAgfQotCi0gICAgICAgICAgICB1aW50MzJfdCBmbGFnczsKLSAgICAgICAgICAgIENIRUNLKG1zZy0+ZmluZEludDMyKCJmbGFncyIsIChpbnQzMl90ICopJmZsYWdzKSk7Ci0KLSAgICAgICAgICAgIGlmIChmbGFncyAmIENPTkZJR1VSRV9GTEFHX0VOQ09ERSkgewotICAgICAgICAgICAgICAgIGZvcm1hdC0+c2V0SW50MzIoImVuY29kZXIiLCB0cnVlKTsKLSAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgaWYgKGZsYWdzICYgQ09ORklHVVJFX0ZMQUdfU0VDVVJFKSB7Ci0gICAgICAgICAgICAgICAgbUZsYWdzIHw9IGtGbGFnSXNTZWN1cmU7Ci0KLSAgICAgICAgICAgICAgICBzcDxJU2VydmljZU1hbmFnZXI+IHNtID0gZGVmYXVsdFNlcnZpY2VNYW5hZ2VyKCk7Ci0KLSAgICAgICAgICAgICAgICBzcDxJQmluZGVyPiBiaW5kZXIgPQotICAgICAgICAgICAgICAgICAgICBzbS0+Z2V0U2VydmljZShTdHJpbmcxNigibWVkaWEucGxheWVyIikpOwotCi0gICAgICAgICAgICAgICAgc3A8SU1lZGlhUGxheWVyU2VydmljZT4gc2VydmljZSA9Ci0gICAgICAgICAgICAgICAgICAgIGludGVyZmFjZV9jYXN0PElNZWRpYVBsYXllclNlcnZpY2U+KGJpbmRlcik7Ci0KLSAgICAgICAgICAgICAgICBDSEVDSyhzZXJ2aWNlICE9IE5VTEwpOwotCi0gICAgICAgICAgICAgICAgbUNyeXB0byA9IHNlcnZpY2UtPm1ha2VDcnlwdG8oKTsKLQotICAgICAgICAgICAgICAgIHN0YXR1c190IGVyciA9IG1DcnlwdG8tPmluaXRpYWxpemUoKTsKLQotICAgICAgICAgICAgICAgIGlmIChlcnIgPT0gT0spIHsKLSAgICAgICAgICAgICAgICAgICAgc3A8QUJ1ZmZlcj4gZW1tOwotICAgICAgICAgICAgICAgICAgICBpZiAoZm9ybWF0LT5maW5kQnVmZmVyKCJlbW0iLCAmZW1tKSkgewotICAgICAgICAgICAgICAgICAgICAgICAgZXJyID0gbUNyeXB0by0+c2V0RW50aXRsZW1lbnRLZXkoCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGVtbS0+ZGF0YSgpLCBlbW0tPnNpemUoKSk7Ci0gICAgICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgICAgICBpZiAoZXJyID09IE9LKSB7Ci0gICAgICAgICAgICAgICAgICAgIHNwPEFCdWZmZXI+IGVjbTsKLSAgICAgICAgICAgICAgICAgICAgaWYgKGZvcm1hdC0+ZmluZEJ1ZmZlcigiZWNtIiwgJmVjbSkpIHsKLSAgICAgICAgICAgICAgICAgICAgICAgIENIRUNLX0VRKGVjbS0+c2l6ZSgpLCA4MHUpOwotCi0gICAgICAgICAgICAgICAgICAgICAgICAvLyBieXRlcyAxNi4uNDcgb2YgdGhlIG9yaWdpbmFsIGVjbSBzdHJlYW0gZGF0YS4KLSAgICAgICAgICAgICAgICAgICAgICAgIGVyciA9IG1DcnlwdG8tPnNldEVudGl0bGVtZW50Q29udHJvbE1lc3NhZ2UoCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGVjbS0+ZGF0YSgpICsgMTYsIDMyKTsKLSAgICAgICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgICAgIGlmIChlcnIgIT0gT0spIHsKLSAgICAgICAgICAgICAgICAgICAgQUxPR0UoImZhaWxlZCB0byBpbnN0YW50aWF0ZSBjcnlwdG8gc2VydmljZS4iKTsKLQotICAgICAgICAgICAgICAgICAgICBtQ3J5cHRvLmNsZWFyKCk7Ci0KLSAgICAgICAgICAgICAgICAgICAgc2V0U3RhdGUoSU5JVElBTElaRUQpOwotCi0gICAgICAgICAgICAgICAgICAgIHNwPEFNZXNzYWdlPiByZXNwb25zZSA9IG5ldyBBTWVzc2FnZTsKLSAgICAgICAgICAgICAgICAgICAgcmVzcG9uc2UtPnNldEludDMyKCJlcnIiLCBVTktOT1dOX0VSUk9SKTsKLQotICAgICAgICAgICAgICAgICAgICByZXNwb25zZS0+cG9zdFJlcGx5KG1SZXBseUlEKTsKLSAgICAgICAgICAgICAgICAgICAgYnJlYWs7Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgfSBlbHNlIHsKLSAgICAgICAgICAgICAgICBtRmxhZ3MgJj0gfmtGbGFnSXNTZWN1cmU7Ci0gICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgIG1Db2RlYy0+aW5pdGlhdGVDb25maWd1cmVDb21wb25lbnQoZm9ybWF0KTsKLSAgICAgICAgICAgIGJyZWFrOwotICAgICAgICB9Ci0KLSAgICAgICAgY2FzZSBrV2hhdFN0YXJ0OgotICAgICAgICB7Ci0gICAgICAgICAgICB1aW50MzJfdCByZXBseUlEOwotICAgICAgICAgICAgQ0hFQ0sobXNnLT5zZW5kZXJBd2FpdHNSZXNwb25zZSgmcmVwbHlJRCkpOwotCi0gICAgICAgICAgICBpZiAobVN0YXRlICE9IENPTkZJR1VSRUQpIHsKLSAgICAgICAgICAgICAgICBzcDxBTWVzc2FnZT4gcmVzcG9uc2UgPSBuZXcgQU1lc3NhZ2U7Ci0gICAgICAgICAgICAgICAgcmVzcG9uc2UtPnNldEludDMyKCJlcnIiLCBJTlZBTElEX09QRVJBVElPTik7Ci0KLSAgICAgICAgICAgICAgICByZXNwb25zZS0+cG9zdFJlcGx5KHJlcGx5SUQpOwotICAgICAgICAgICAgICAgIGJyZWFrOwotICAgICAgICAgICAgfQotCi0gICAgICAgICAgICBtUmVwbHlJRCA9IHJlcGx5SUQ7Ci0gICAgICAgICAgICBzZXRTdGF0ZShTVEFSVElORyk7Ci0KLSAgICAgICAgICAgIG1Db2RlYy0+aW5pdGlhdGVTdGFydCgpOwotICAgICAgICAgICAgYnJlYWs7Ci0gICAgICAgIH0KLQotICAgICAgICBjYXNlIGtXaGF0U3RvcDoKLSAgICAgICAgewotICAgICAgICAgICAgdWludDMyX3QgcmVwbHlJRDsKLSAgICAgICAgICAgIENIRUNLKG1zZy0+c2VuZGVyQXdhaXRzUmVzcG9uc2UoJnJlcGx5SUQpKTsKLQotICAgICAgICAgICAgaWYgKG1TdGF0ZSAhPSBJTklUSUFMSVpFRAotICAgICAgICAgICAgICAgICAgICAmJiBtU3RhdGUgIT0gQ09ORklHVVJFRCAmJiBtU3RhdGUgIT0gU1RBUlRFRCkgewotICAgICAgICAgICAgICAgIHNwPEFNZXNzYWdlPiByZXNwb25zZSA9IG5ldyBBTWVzc2FnZTsKLSAgICAgICAgICAgICAgICByZXNwb25zZS0+c2V0SW50MzIoImVyciIsIElOVkFMSURfT1BFUkFUSU9OKTsKLQotICAgICAgICAgICAgICAgIHJlc3BvbnNlLT5wb3N0UmVwbHkocmVwbHlJRCk7Ci0gICAgICAgICAgICAgICAgYnJlYWs7Ci0gICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgIG1SZXBseUlEID0gcmVwbHlJRDsKLSAgICAgICAgICAgIHNldFN0YXRlKFNUT1BQSU5HKTsKLQotICAgICAgICAgICAgbUNvZGVjLT5pbml0aWF0ZVNodXRkb3duKHRydWUgLyoga2VlcENvbXBvbmVudEFsbG9jYXRlZCAqLyk7Ci0gICAgICAgICAgICByZXR1cm5CdWZmZXJzVG9Db2RlYygpOwotICAgICAgICAgICAgYnJlYWs7Ci0gICAgICAgIH0KLQotICAgICAgICBjYXNlIGtXaGF0UmVsZWFzZToKLSAgICAgICAgewotICAgICAgICAgICAgdWludDMyX3QgcmVwbHlJRDsKLSAgICAgICAgICAgIENIRUNLKG1zZy0+c2VuZGVyQXdhaXRzUmVzcG9uc2UoJnJlcGx5SUQpKTsKLQotICAgICAgICAgICAgaWYgKG1TdGF0ZSAhPSBJTklUSUFMSVpFRAotICAgICAgICAgICAgICAgICAgICAmJiBtU3RhdGUgIT0gQ09ORklHVVJFRCAmJiBtU3RhdGUgIT0gU1RBUlRFRCkgewotICAgICAgICAgICAgICAgIHNwPEFNZXNzYWdlPiByZXNwb25zZSA9IG5ldyBBTWVzc2FnZTsKLSAgICAgICAgICAgICAgICByZXNwb25zZS0+c2V0SW50MzIoImVyciIsIElOVkFMSURfT1BFUkFUSU9OKTsKLQotICAgICAgICAgICAgICAgIHJlc3BvbnNlLT5wb3N0UmVwbHkocmVwbHlJRCk7Ci0gICAgICAgICAgICAgICAgYnJlYWs7Ci0gICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgIG1SZXBseUlEID0gcmVwbHlJRDsKLSAgICAgICAgICAgIHNldFN0YXRlKFJFTEVBU0lORyk7Ci0KLSAgICAgICAgICAgIG1Db2RlYy0+aW5pdGlhdGVTaHV0ZG93bigpOwotICAgICAgICAgICAgcmV0dXJuQnVmZmVyc1RvQ29kZWMoKTsKLSAgICAgICAgICAgIGJyZWFrOwotICAgICAgICB9Ci0KLSAgICAgICAgY2FzZSBrV2hhdERlcXVldWVJbnB1dEJ1ZmZlcjoKLSAgICAgICAgewotICAgICAgICAgICAgdWludDMyX3QgcmVwbHlJRDsKLSAgICAgICAgICAgIENIRUNLKG1zZy0+c2VuZGVyQXdhaXRzUmVzcG9uc2UoJnJlcGx5SUQpKTsKLQotICAgICAgICAgICAgaWYgKGhhbmRsZURlcXVldWVJbnB1dEJ1ZmZlcihyZXBseUlELCB0cnVlIC8qIG5ldyByZXF1ZXN0ICovKSkgewotICAgICAgICAgICAgICAgIGJyZWFrOwotICAgICAgICAgICAgfQotCi0gICAgICAgICAgICBpbnQ2NF90IHRpbWVvdXRVczsKLSAgICAgICAgICAgIENIRUNLKG1zZy0+ZmluZEludDY0KCJ0aW1lb3V0VXMiLCAmdGltZW91dFVzKSk7Ci0KLSAgICAgICAgICAgIGlmICh0aW1lb3V0VXMgPT0gMGxsKSB7Ci0gICAgICAgICAgICAgICAgc3A8QU1lc3NhZ2U+IHJlc3BvbnNlID0gbmV3IEFNZXNzYWdlOwotICAgICAgICAgICAgICAgIHJlc3BvbnNlLT5zZXRJbnQzMigiZXJyIiwgLUVBR0FJTik7Ci0gICAgICAgICAgICAgICAgcmVzcG9uc2UtPnBvc3RSZXBseShyZXBseUlEKTsKLSAgICAgICAgICAgICAgICBicmVhazsKLSAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgbUZsYWdzIHw9IGtGbGFnRGVxdWV1ZUlucHV0UGVuZGluZzsKLSAgICAgICAgICAgIG1EZXF1ZXVlSW5wdXRSZXBseUlEID0gcmVwbHlJRDsKLQotICAgICAgICAgICAgaWYgKHRpbWVvdXRVcyA+IDBsbCkgewotICAgICAgICAgICAgICAgIHNwPEFNZXNzYWdlPiB0aW1lb3V0TXNnID0KLSAgICAgICAgICAgICAgICAgICAgbmV3IEFNZXNzYWdlKGtXaGF0RGVxdWV1ZUlucHV0VGltZWRPdXQsIGlkKCkpOwotICAgICAgICAgICAgICAgIHRpbWVvdXRNc2ctPnNldEludDMyKAotICAgICAgICAgICAgICAgICAgICAgICAgImdlbmVyYXRpb24iLCArK21EZXF1ZXVlSW5wdXRUaW1lb3V0R2VuZXJhdGlvbik7Ci0gICAgICAgICAgICAgICAgdGltZW91dE1zZy0+cG9zdCh0aW1lb3V0VXMpOwotICAgICAgICAgICAgfQotICAgICAgICAgICAgYnJlYWs7Ci0gICAgICAgIH0KLQotICAgICAgICBjYXNlIGtXaGF0RGVxdWV1ZUlucHV0VGltZWRPdXQ6Ci0gICAgICAgIHsKLSAgICAgICAgICAgIGludDMyX3QgZ2VuZXJhdGlvbjsKLSAgICAgICAgICAgIENIRUNLKG1zZy0+ZmluZEludDMyKCJnZW5lcmF0aW9uIiwgJmdlbmVyYXRpb24pKTsKLQotICAgICAgICAgICAgaWYgKGdlbmVyYXRpb24gIT0gbURlcXVldWVJbnB1dFRpbWVvdXRHZW5lcmF0aW9uKSB7Ci0gICAgICAgICAgICAgICAgLy8gT2Jzb2xldGUKLSAgICAgICAgICAgICAgICBicmVhazsKLSAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgQ0hFQ0sobUZsYWdzICYga0ZsYWdEZXF1ZXVlSW5wdXRQZW5kaW5nKTsKLQotICAgICAgICAgICAgc3A8QU1lc3NhZ2U+IHJlc3BvbnNlID0gbmV3IEFNZXNzYWdlOwotICAgICAgICAgICAgcmVzcG9uc2UtPnNldEludDMyKCJlcnIiLCAtRUFHQUlOKTsKLSAgICAgICAgICAgIHJlc3BvbnNlLT5wb3N0UmVwbHkobURlcXVldWVJbnB1dFJlcGx5SUQpOwotCi0gICAgICAgICAgICBtRmxhZ3MgJj0gfmtGbGFnRGVxdWV1ZUlucHV0UGVuZGluZzsKLSAgICAgICAgICAgIG1EZXF1ZXVlSW5wdXRSZXBseUlEID0gMDsKLSAgICAgICAgICAgIGJyZWFrOwotICAgICAgICB9Ci0KLSAgICAgICAgY2FzZSBrV2hhdFF1ZXVlSW5wdXRCdWZmZXI6Ci0gICAgICAgIHsKLSAgIC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AgICB9Ci0KLSAgICAgICAgICAgIGludDY0X3QgdGltZW91dFVzOwotICAgICAgICAgICAgQ0hFQ0sobXNnLT5maW5kSW50NjQoInRpbWVvdXRVcyIsICZ0aW1lb3V0VXMpKTsKLQotICAgICAgICAgICAgaWYgKHRpbWVvdXRVcyA9PSAwbGwpIHsKLSAgICAgICAgICAgICAgICBzcDxBTWVzc2FnZT4gcmVzcG9uc2UgPSBuZXcgQU1lc3NhZ2U7Ci0gICAgICAgICAgICAgICAgcmVzcG9uc2UtPnNldEludDMyKCJlcnIiLCAtRUFHQUlOKTsKLSAgICAgICAgICAgICAgICByZXNwb25zZS0+cG9zdFJlcGx5KHJlcGx5SUQpOwotICAgICAgICAgICAgICAgIGJyZWFrOwotICAgICAgICAgICAgfQotCi0gICAgICAgICAgICBtRmxhZ3MgfD0ga0ZsYWdEZXF1ZXVlT3V0cHV0UGVuZGluZzsKLSAgICAgICAgICAgIG1EZXF1ZXVlT3V0cHV0UmVwbHlJRCA9IHJlcGx5SUQ7Ci0KLSAgICAgICAgICAgIGlmICh0aW1lb3V0VXMgPiAwbGwpIHsKLSAgICAgICAgICAgICAgICBzcDxBTWVzc2FnZT4gdGltZW91dE1zZyA9Ci0gICAgICAgICAgICAgICAgICAgIG5ldyBBTWVzc2FnZShrV2hhdERlcXVldWVPdXRwdXRUaW1lZE91dCwgaWQoKSk7Ci0gICAgICAgICAgICAgICAgdGltZW91dE1zZy0+c2V0SW50MzIoCi0gICAgICAgICAgICAgICAgICAgICAgICAiZ2VuZXJhdGlvbiIsICsrbURlcXVldWVPdXRwdXRUaW1lb3V0R2VuZXJhdGlvbik7Ci0gICAgICAgICAgICAgICAgdGltZW91dE1zZy0+cG9zdCh0aW1lb3V0VXMpOwotICAgICAgICAgICAgfQotICAgICAgICAgICAgYnJlYWs7Ci0gICAgICAgIH0KLQotICAgICAgICBjYXNlIGtXaGF0RGVxdWV1ZU91dHB1dFRpbWVkT3V0OgotICAgICAgICB7Ci0gICAgICAgICAgICB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ICAgcmVzcG9uc2UtPnNldEludDMyKCJlcnIiLCBJTlZBTElEX09QRVJBVElPTik7Ci0KLSAgICAgICAgICAgICAgICByZXNwb25zZS0+cG9zdFJlcGx5KHJlcGx5SUQpOwotICAgICAgICAgICAgICAgIGJyZWFrOwotICAgICAgICAgICAgfQotCi0gICAgICAgICAgICBzdGF0dXNfdCBlcnIgPSBvblJlbGVhc2VPdXRwdXRCdWZmZXIobXNnKTsKLQotICAgICAgICAgICAgc3A8QU1lc3NhZ2U+IHJlc3BvbnNlID0gbmV3IEFNZXNzYWdlOwotICAgICAgICAgICAgcmVzcG9uc2UtPnNldEludDMyKCJlcnIiLCBlcnIpOwotICAgICAgICAgICAgcmVzcG9uc2UtPnBvc3RSZXBseShyZXBseUlEKTsKLSAgICAgICAgICAgIGJyZWFrOwotICAgICAgICB9Ci0KLSAgICAgICAgY2FzZSBrV2hhdEdldEJ1ZmZlcnM6Ci0gICAgICAgIHsKLSAgICAgICAgICAgIHVpbnQzMl90IHJlcGx5SUQ7Ci0gICAgICAgICAgICBDSEVDSyhtc2ctPnNlbmRlckF3YWl0c1Jlc3BvbnNlKCZyZXBseUlEKSk7Ci0KLSAgICAgICAgICAgIGlmIChtU3RhdGUgIT0gU1RBUlRFRCB8fCAobUZsYWdzICYga0ZsYWdTdGlja3lFcnJvcikpIHsKLSAgICAgICAgICAgICAgICBzcDxBTWVzc2FnZT4gcmVzcG9uc2UgPSBuZXcgQU1lc3NhZ2U7Ci0gICAgICAgICAgICAgICAgcmVzcG9uc2UtPnNldEludDMyKCJlcnIiLCBJTlZBTElEX09QRVJBVElPTik7Ci0KLSAgICAgICAgICAgICAgICByZXNwb25zZS0+cG9zdFJlcGx5KHJlcGx5SUQpOwotICAgICAgICAgICAgICAgIGJyZWFrOwotICAgICAgICAgICAgfQotCi0gICAgICAgICAgICBpbnQzMl90IHBvcnRJbmRleDsKLSAgICAgICAgICAgIENIRUNLKG1zZy0+ZmluZEludDMyKCJwb3J0SW5kZXgiLCAmcG9ydEluZGV4KSk7Ci0KLSAgICAgICAgICAgIFZlY3RvcjxzcDxBQnVmZmVyPiA+ICpkc3RCdWZmZXJzOwotICAgICAgICAgICAgQ0hFQ0sobXNnLT5maW5kUG9pbnRlcigiYnVmZmVycyIsICh2b2lkICoqKSZkc3RCdWZmZXJzKSk7Ci0KLSAgICAgICAgICAgIGRzdEJ1ZmZlcnMtPmNsZWFyKCk7Ci0gICAgICAgICAgICBjb25zdCBWZWN0b3I8QnVmZmVySW5mbz4gJnNyY0J1ZmZlcnMgPSBtUG9ydEJ1ZmZlcnNbcG9ydEluZGV4XTsKLQotICAgICAgICAgICAgZm9yIChzaXplX3QgaSA9IDA7IGkgPCBzcmNCdWZmZXJzLnNpemUoKTsgKytpKSB7Ci0gICAgICAgICAgICAgICAgY29uc3QgQnVmZmVySW5mbyAmaW5mbyA9IHNyY0J1ZmZlcnMuaXRlbUF0KGkpOwotCi0gICAgICAgICAgICAgICAgZHN0QnVmZmVycy0+cHVzaF9iYWNrKAotICAgICAgICAgICAgICAgICAgICAgICAgKHBvcnRJbmRleCA9PSBrUG9ydEluZGV4SW5wdXQKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiAobUZsYWdzICYga0ZsYWdJc1NlY3VyZSkpCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgID8gaW5mby5tRW5jcnlwdGVkRGF0YSA6IGluZm8ubURhdGEpOwotICAgICAgICAgICAgfQotCi0gICAgICAgICAgICAobmV3IEFNZXNzYWdlKS0+cG9zdFJlcGx5KHJlcGx5SUQpOwotICAgICAgICAgICAgYnJlYWs7Ci0gICAgICAgIH0KLQotICAgICAgICBjYXNlIGtXaGF0Rmx1c2g6Ci0gICAgICAgIHsKLSAgICAgICAgICAgIHVpbnQzMl90IHJlcGx5SUQ7Ci0gICAgICAgICAgICBDSEVDSyhtc2ctPnNlbmRlckF3YWl0c1Jlc3BvbnNlKCZyZXBseUlEKSk7Ci0KLSAgICAgICAgICAgIGlmIChtU3RhdGUgIT0gU1RBUlRFRCB8fCAobUZsYWdzICYga0ZsYWdTdGlja3lFcnJvcikpIHsKLSAgICAgICAgICAgICAgICBzcDxBTWVzc2FnZT4gcmVzcG9uc2UgPSBuZXcgQU1lc3NhZ2U7Ci0gICAgICAgICAgICAgICAgcmVzcG9uc2UtPnNldEludDMyKCJlcnIiLCBJTlZBTElEX09QRVJBVElPTik7Ci0KLSAgICAgICAgICAgICAgICByZXNwb25zZS0+cG9zdFJlcGx5KHJlcGx5SUQpOwotICAgICAgICAgICAgICAgIGJyZWFrOwotICAgICAgICAgICAgfQotCi0gICAgICAgICAgICBtUmVwbHlJRCA9IHJlcGx5SUQ7Ci0gICAgICAgICAgICBzZXRTdGF0ZShGTFVTSElORyk7Ci0KLSAgICAgICAgICAgIG1Db2RlYy0+c2lnbmFsRmx1c2goKTsKLSAgICAgICAgICAgIHJldHVybkJ1ZmZlcnNUb0NvZGVjKCk7Ci0gICAgICAgICAgICBicmVhazsKLSAgICAgICAgfQotCi0gICAgICAgIGNhc2Uga1doYXRHZXRPdXRwdXRGb3JtYXQ6Ci0gICAgICAgIHsKLSAgICAgICAgICAgIHVpbnQzMl90IHJlcGx5SUQ7Ci0gICAgICAgICAgICBDSEVDSyhtc2ctPnNlbmRlckF3YWl0c1Jlc3BvbnNlKCZyZXBseUlEKSk7Ci0KLSAgICAgICAgICAgIGlmICgobVN0YXRlICE9IFNUQVJURUQgJiYgbVN0YXRlICE9IEZMVVNISU5HKQotICAgICAgICAgICAgICAgICAgICB8fCAobUZsYWdzICYga0ZsYWdTdGlja3lFcnJvcikpIHsKLSAgICAgICAgICAgICAgICBzcDxBTWVzc2FnZT4gcmVzcG9uc2UgPSBuZXcgQU1lc3NhZ2U7Ci0gICAgICAgICAgICAgICAgcmVzcG9uc2UtPnNldEludDMyKCJlcnIiLCBJTlZBTElEX09QRVJBVElPTik7Ci0KLSAgICAgICAgICAgICAgICByZXNwb25zZS0+cG9zdFJlcGx5KHJlcGx5SUQpOwotICA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QoInRpbWVVcyIsIHRpbWVVcyk7Ci0KLSAgICBpZiAoZmxhZ3MgJiBCVUZGRVJfRkxBR19FT1MpIHsKLSAgICAgICAgaW5mby0+bURhdGEtPm1ldGEoKS0+c2V0SW50MzIoImVvcyIsIHRydWUpOwotICAgIH0KLQotICAgIGlmIChmbGFncyAmIEJVRkZFUl9GTEFHX0NPREVDQ09ORklHKSB7Ci0gICAgICAgIGluZm8tPm1EYXRhLT5tZXRhKCktPnNldEludDMyKCJjc2QiLCB0cnVlKTsKLSAgICB9Ci0KLSAgICBpZiAobUZsYWdzICYga0ZsYWdJc1NlY3VyZSkgewotICAgICAgICB1aW50OF90IGl2WzE2XTsKLSAgICAgICAgbWVtc2V0KGl2LCAwLCBzaXplb2YoaXYpKTsKLQotICAgICAgICBzc2l6ZV90IG91dExlbmd0aDsKLQotICAgICAgICBpZiAobUZsYWdzICYga0ZsYWdJc1NvZnR3YXJlQ29kZWMpIHsKLSAgICAgICAgICAgIG91dExlbmd0aCA9IG1DcnlwdG8tPmRlY3J5cHRBdWRpbygKLSAgICAgICAgICAgICAgICAgICAgKGZsYWdzICYgQlVGRkVSX0ZMQUdfRU5DUllQVEVEKSA/IGl2IDogTlVMTCwKLSAgICAgICAgICAgICAgICAgICAgKGZsYWdzICYgQlVGRkVSX0ZMQUdfRU5DUllQVEVEKSA/IHNpemVvZihpdikgOiAwLAotICAgICAgICAgICAgICAgICAgICAgICAgaW5mby0+bUVuY3J5cHRlZERhdGEtPmJhc2UoKSArIG9mZnNldCwKLSAgICAgICAgICAgICAgICAgICAgICAgIHNpemUsCi0gICAgICAgICAgICAgICAgICAgICAgICBpbmZvLT5tRGF0YS0+YmFzZSgpLAotICAgICAgICAgICAgICAgICAgICAgICAgaW5mby0+bURhdGEtPmNhcGFjaXR5KCkpOwotICAgICAgICB9IGVsc2UgewotICAgICAgICAgICAgb3V0TGVuZ3RoID0gbUNyeXB0by0+ZGVjcnlwdFZpZGVvKAotICAgICAgICAgICAgICAgICAgICA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XRlc19yZWFkIDwgMCkgewotICAgICAgICAgICAgQUxPR0UoImZhaWxlZCBpbiBjYWxsIHRvIHJlYWQiKTsKLSAgICAgICAgICAgIG1Jbml0Q2hlY2sgPSBFUlJPUl9JTzsKLSAgICAgICAgICAgIGJyZWFrOwotICAgICAgICB9Ci0KLSAgICAgICAgaWYgKDo6WE1MX1BhcnNlQnVmZmVyKHBhcnNlciwgYnl0ZXNfcmVhZCwgYnl0ZXNfcmVhZCA9PSAwKQotICAgICAgICAgICAgICAgICE9IFhNTF9TVEFUVVNfT0spIHsKLSAgICAgICAgICAgIG1Jbml0Q2hlY2sgPSBFUlJPUl9NQUxGT1JNRUQ7Ci0gICAgICAgICAgICBicmVhazsKLSAgICAgICAgfQotCi0gICAgICAgIGlmIChieXRlc19yZWFkID09IDApIHsKLSAgICAgICAgICAgIGJyZWFrOwotICAgICAgICB9Ci0gICAgfQotCi0gICAgOjpYTUxfUGFyc2VyRnJlZShwYXJzZXIpOwotCi0gICAgaWYgKG1Jbml0Q2hlY2sgPT0gT0spIHsKLSAgICAgICAgZm9yIChzaXplX3QgaSA9IG1Db2RlY0luZm9zLnNpemUoKTsgaS0tID4gMDspIHsKLSAgICAgICAgICAgIENvZGVjSW5mbyAqaW5mbyA9ICZtQ29kZWNJbmZvcy5lZGl0SXRlbUF0KGkpOwotCi0gICAgICAgICAgICBpZiAoaW5mby0+bVR5cGVzID09IDApIHsKLSAgICAgICAgICAgICAgICAvLyBObyB0eXBlcyBzdXBwb3J0ZWQgYnkgdGhpcyBjb21wb25lbnQ/Pz8KLQotICAgICAgICAgICAgICAgIEFMT0dXKCJDb21wb25lbnQgJXMgZG9lcyBub3Qgc3VwcG9ydCBhbnkgdHlwZSBvZiBtZWRpYT8iLAotICAgICAgICAgICAgICAgICAgICAgIGluZm8tPm1OYW1lLmNfc3RyKCkpOwotCi0gICAgICAgICAgICAgICAgbUNvZGVjSW5mb3MucmVtb3ZlQXQoaSk7Ci0gICAgICAgICAgICB9Ci0gICA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uYW1lLCAiRW5jb2RlcnMiKSkgewotICAgICAgICAgICAgICAgIG1DdXJyZW50U2VjdGlvbiA9IFNFQ1RJT05fRU5DT0RFUlM7Ci0gICAgICAgICAgICB9Ci0gICAgICAgICAgICBicmVhazsKLSAgICAgICAgfQotCi0gICAgICAgIGNhc2UgU0VDVElPTl9ERUNPREVSUzoKLSAgICAgICAgewotICAgICAgICAgICAgaWYgKCFzdHJjbXAobmFtZSwgIk1lZGlhQ29kZWMiKSkgewotICAgICAgICAgICAgICAgIG1Jbml0Q2hlY2sgPQotICAgICAgICAgICAgICAgICAgICBhZGRNZWRpYUNvZGVjRnJvbUF0dHJpYnV0ZXMoZmFsc2UgLyogZW5jb2RlciAqLywgYXR0cnMpOwotCi0gICAgICAgICAgICAgICAgbUN1cnJlbnRTZWN0aW9uID0gU0VDVElPTl9ERUNPREVSOwotICAgICAgICAgICAgfQotICAgICAgICAgICAgYnJlYWs7Ci0gICAgICAgIH0KLQotICAgICAgICBjYXNlIFNFQ1RJT05fRU5DT0RFUlM6Ci0gICAgICAgIHsKLSAgICAgICAgICAgIGlmICghc3RyY21wKG5hbWUsICJNZWRpYUNvZGVjIikpIHsKLSAgICAgICAgICAgICAgICBtSW5pdENoZWNrID0KLSAgICAgICAgICAgICAgICAgICAgYWRkTWVkaWFDb2RlY0Zyb21BdHRyaWJ1dGVzKHRydWUgLyogZW5jb2RlciAqLywgYXR0cnMpOwotCi0gICAgICAgICAgICAgICAgbUN1cnJlbnRTZWN0aW9uID0gU0VDVElPTl9FTkNPREVSOwotICAgICAgICAgICAgfQotICAgICAgICAgICAgYnJlYWs7Ci0gICAgICAgIH0KLQotICAgICAgICBjYXNlIFNFQ1RJT05fREVDT0RFUjoKLSAgICAgICAgY2FzZSBTRUNUSU9OX0VOQ09ERVI6Ci0gICAgICAgIHsKLSAgICAgICAgICAgIGlmICghc3RyY21wKG5hbWUsICJRdWlyayIpKSB7Ci0gICAgICAgICAgICAgICAgbUluaXRDaGVjayA9IGFkZFF1aXJrKGF0dHJzKTsKLSAgICAgICAgICAgIH0gZWxzZSBpZiAoIXN0cmNtcChuYW1lLCAiVHlwZSIpKSB7Ci0gICAgICAgICAgICAgICAgbUluaXRDaGVjayA9IGFkZFR5cGVGcm9tQXR0cmlidXRlcyhhdHRycyk7Ci0gICAgICAgICAgICB9Ci0gICAgICAgICAgICBicmVhazsKLSAgICAgICAgfQotCi0gICAgICAgIGRlZmF1bHQ6Ci0gICAgICAgICAgICBicmVhazsKLSAgICB9Ci0KLSAgICArK21EZXB0aDsKLX0KLQotdm9pZCBNZWRpYUNvZGVjTGlzdDo6ZW5kRWxlbWVudEhhbmRsZXIoY29uc3QgY2hhciAqbmFtZSkgewotICAgIGlmIChtSW5pdENoZWNrICE9IE9LKSB7Ci0gICAgICAgIHJldHVybjsKLSAgICB9Ci0KLSAgICBzd2l0Y2ggKG1DdXJyZW50U2VjdGlvbikgewotICAgICAgICBjYXNlIFNFQ1RJT05fREVDT0RFUlM6Ci0gICAgICAgIHsKLSAgICAgICAgICAgIGlmICghc3RyY21wKG5hbWUsICJEZWNvZGVycyIpKSB7Ci0gICAgICAgICAgICAgICAgbUN1cnJlbnRTZWN0aW9uID0gU0VDVElPTl9UT1BMRVZFTDsKLSAgICAgICAgICAgIH0KLSAgICAgICAgICAgIGJyZWFrOwotICAgICAgICB9Ci0KLSAgICAgICAgY2FzZSBTRUNUSU9OX0VOQ09ERVJTOgotICAgICAgICB7Ci0gICAgICAgICAgICBpZiAoIXN0cmNtcChuYW1lLCAiRW5jb2RlcnMiKSkgewotICAgICAgICAgICAgICAgIG1DdXJyZW50U2VjdGlvbiA9IFNFQ1RJT05fVE9QTEVWRUw7Ci0gICAgICAgICAgICB9Ci0gICAgICAgICAgICBicmVhazsKLSAgICAgICAgfQotCi0gICAgICAgIGNhc2UgU0VDVElPTl9ERUNPREVSOgotICAgICAgICB7Ci0gICAgICAgICAgICBpZiAoIXN0cmNtcChuYW1lLCAiTWVkaWFDb2RlYyIpKSB7Ci0gICAgICAgICAgICAgICAgbUN1cnJlbnRTZWN0aW9uID0gU0VDVElPTl9ERUNPREVSUzsKLSAgICAgICAgICAgIH0KLSAgICAgICAgICAgIGJyZWFrOwotICAgICAgICB9Ci0KLSAgICAgICAgY2FzZSBTRUNUSU9OX0VOQ09ERVI6Ci0gICAgICAgIHsKLSAgICAgICAgICAgIGlmICghc3RyY21wKG5hbWUsICJNZWRpYUNvZGVjIikpIHsKLSAgICAgICAgICAgICAgICBtQ3VycmVudFNlY3Rpb24gPSBTRUNUSU9OX0VOQ09ERVJTOwotICAgICAgICAgICAgfQotICAgICAgICAgICAgYnJlYWs7Ci0gICAgICAgIH0KLQotICAgICAgICBkZWZhdWx0OgotICAgICAgICAgICAgYnJlYWs7Ci0gICAgfQotCi0gICAgLS1tRGVwdGg7Ci19Ci0KLXN0YXR1c190IE1lZGlhQ29kZWNMaXN0OjphZGRNZWRpYUNvZGVjRnJvbUF0dHJpYnV0ZXMoCi0gICAgICAgIGJvb2wgZW5jb2RlciwgY29uc3QgY2hhciAqKmF0dHJzKSB7Ci0gICAgY29uc3QgY2hhciAqbmFtZSA9IE5VTEw7Ci0gICAgY29uc3QgY2hhciAqdHlwZSA9IE5VTEw7Ci0KLSAgICBzaXplX3QgaSA9IDA7Ci0gICAgd2hpbGUgKGF0dHJzW2ldICE9IE5VTEwpIHsKLSAgICAgICAgaWYgKCFzdHJjbXAoYXR0cnNbaV0sICJuYW1lIikpIHsKLSAgICAgICAgICAgIGlmIChhdHRyc1tpICsgMV0gPT0gTlVMTCkgewotICAgICAgICAgICAgICAgIHJldHVybiAtRUlOVkFMOwotICAgICAgICAgICAgfQotICAgICAgICAgICAgbmFtZSA9IGF0dHJzW2kgKyAxXTsKLSAgICAgICAgICAgICsraTsKLSAgICAgICAgfSBlbHNlIGlmICghc3RyY21wKGF0dHJzW2ldLCAidHlwZSIpKSB7Ci0gICAgICAgICAgICBpZiAoYXR0cnNbaSArIDFdID09IE5VTEwpIHsKLSAgICAgICAgIC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WUiKSkgewotICAgICAgICAgICAgaWYgKGF0dHJzW2kgKyAxXSA9PSBOVUxMKSB7Ci0gICAgICAgICAgICAgICAgcmV0dXJuIC1FSU5WQUw7Ci0gICAgICAgICAgICB9Ci0gICAgICAgICAgICBuYW1lID0gYXR0cnNbaSArIDFdOwotICAgICAgICAgICAgKytpOwotICAgICAgICB9IGVsc2UgewotICAgICAgICAgICAgcmV0dXJuIC1FSU5WQUw7Ci0gICAgICAgIH0KLQotICAgICAgICArK2k7Ci0gICAgfQotCi0gICAgaWYgKG5hbWUgPT0gTlVMTCkgewotICAgICAgICByZXR1cm4gLUVJTlZBTDsKLSAgICB9Ci0KLSAgICB1aW50MzJfdCBiaXQ7Ci0gICAgc3NpemVfdCBpbmRleCA9IG1Db2RlY1F1aXJrcy5pbmRleE9mS2V5KG5hbWUpOwotICAgIGlmIChpbmRleCA8IDApIHsKLSAgICAgICAgYml0ID0gbUNvZGVjUXVpcmtzLnNpemUoKTsKLQotICAgICAgICBpZiAoYml0ID09IDMyKSB7Ci0gICAgICAgICAgICBBTE9HVygiVG9vIG1hbnkgZGlzdGluY3QgcXVpcmsgbmFtZXMgaW4gY29uZmlndXJhdGlvbi4iKTsKLSAgICAgICAgICAgIHJldHVybiBPSzsKLSAgICAgICAgfQotCi0gICAgICAgIG1Db2RlY1F1aXJrcy5hZGQobmFtZSwgYml0KTsKLSAgICB9IGVsc2UgewotICAgICAgICBiaXQgPSBtQ29kZWNRdWlya3MudmFsdWVBdChpbmRleCk7Ci0gICAgfQotCi0gICAgQ29kZWNJbmZvICppbmZvID0gJm1Db2RlY0luZm9zLmVkaXRJdGVtQXQobUNvZGVjSW5mb3Muc2l6ZSgpIC0gMSk7Ci0gICAgaW5mby0+bVF1aXJrcyB8PSAxdWwgPDwgYml0OwotCi0gICAgcmV0dXJuIE9LOwotfQotCi1zdGF0dXNfdCBNZWRpYUNvZGVjTGlzdDo6YWRkVHlwZUZyb21BdHRyaWJ1dGVzKGNvbnN0IGNoYXIgK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ICBzd2l0Y2gobVR5cGUpIHsKLSAgICAgICAgY2FzZSBUWVBFX05PTkU6Ci0gICAgICAgICAgICBvdXQgPSBTdHJpbmc4Ojpmb3JtYXQoIm5vIHR5cGUsIHNpemUgJWQpIiwgbVNpemUpOwotICAgICAgICAgICAgYnJlYWs7Ci0gICAgICAgIGNhc2UgVFlQRV9DX1NUUklORzoKLSAgICAgICAgICAgIG91dCA9IFN0cmluZzg6OmZvcm1hdCgiKGNoYXIqKSAlcyIsIChjb25zdCBjaGFyICopZGF0YSk7Ci0gICAgICAgICAgICBicmVhazsKLSAgICAgICAgY2FzZSBUWVBFX0lOVDMyOgotICAgICAgICAgICAgb3V0ID0gU3RyaW5nODo6Zm9ybWF0KCIoaW50MzJfdCkgJWQiLCAqKGludDMyX3QgKilkYXRhKTsKLSAgICAgICAgICAgIGJyZWFrOwotICAgICAgICBjYXNlIFRZUEVfSU5UNjQ6Ci0gICAgICAgICAgICBvdXQgPSBTdHJpbmc4Ojpmb3JtYXQoIihpbnQ2NF90KSAlbGxkIiwgKihpbnQ2NF90ICopZGF0YSk7Ci0gICAgICAgICAgICBicmVhazsKLSAgICAgICAgY2FzZSBUWVBFX0ZMT0FUOgotICAgICAgICAgICAgb3V0ID0gU3RyaW5nODo6Zm9ybWF0KCIoZmxvYXQpICVmIiwgKihmbG9hdCAqKWRhdGEpOwotICAgICAgICAgICAgYnJlYWs7Ci0gICAgICAgIGNhc2UgVFlQRV9QT0lOVEVSOgotICAgICAgICAgICAgb3V0ID0gU3RyaW5nODo6Zm9ybWF0KCIodm9pZCopICVwIiwgKih2b2lkICoqKWRhdGEpOwotICAgICAgICAgICAgYnJlYWs7Ci0gICAgICAgIGNhc2UgVFlQRV9SRUNUOgotICAgICAgICB7Ci0gICAgICAgICAgICBjb25zdCBSZWN0ICpyID0gKGNvbnN0IFJlY3QgKilkYXRhOwotICAgICAgICAgICAgb3V0ID0gU3RyaW5nODo6Zm9ybWF0KCJSZWN0KCVkLCAlZCwgJWQsICV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gICAgIG9uUmVhZChtc2cpOwotICAgICAgICAgICAgYnJlYWs7Ci0gICAgICAgIH0KLQotICAgICAgICBkZWZhdWx0OgotICAgICAgICAgICAgVFJFU1BBU1MoKTsKLSAgICB9Ci19Ci0KLXZvaWQgTnVDYWNoZWRTb3VyY2UyOjpmZXRjaEludGVybmFsKCkgewotICAgIEFMT0dWKCJmZXRjaEludGVybmFsIik7Ci0KLSAgICBib29sIHJlY29ubmVjdCA9IGZhbHNlOwotCi0gICAgewotICAgICAgICBNdXRleDo6QXV0b2xvY2sgYXV0b0xvY2sobUxvY2spOwotICAgICAgICBDSEVDSyhtRmluYWxTdGF0dXMgPT0gT0sgfHwgbU51bVJldHJpZXNMZWZ0ID4gMCk7Ci0KLSAgICAgICAgaWYgKG1GaW5hbFN0YXR1cyAhPSBPSykgewotICAgICAgICAgICAgLS1tTnVtUmV0cmllc0xlZnQ7Ci0KLSAgICAgICAgICAgIHJlY29ubmVjdCA9IHRydWU7Ci0gICAgICAgIH0KLSAgICB9Ci0KLSAgICBpZiAocmVjb25uZWN0KSB7Ci0gICAgICAgIHN0YXR1c190IGVyciA9Ci0gICAgICAgICAgICBtU291cmNlLT5yZWNvbm5lY3RBdE9mZnNldChtQ2FjaGVPZmZzZXQgKyBtQ2FjaGUtPnRvdGFsU2l6ZSgpKTsKLQotICAgICAgICBNdXRleDo6QXV0b2xvY2sgYXV0b0xvY2sobUxvY2spOwotCi0gICAgICAgIGlmIChlcnIgPT0gRVJST1JfVU5TVVBQT1JURUQpIHsKLSAgICAgICAgICAgIG1OdW1SZXRyaWVzTGVmdCA9IDA7Ci0gICAgICAgICAgICByZXR1cm47Ci0gICAgICAgIH0gZWxzZSBpZiAoZXJyICE9IE9LKSB7Ci0gICAgICAgICAgICBBTE9HSSgiVGhlIGF0dGVtcHQgdG8gcmVjb25uZWN0IGZhaWxlZCwgJWQgcmV0cmllcyByZW1haW5pbmciLAotICAgICAgICAgICAgICAgICBtTnVtUmV0cmllc0xlZnQpOwotC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SB7Ci0gICAgICAgICAgICBpbmZvLT5tRmluYWxSZXN1bHQgPSBPSzsKLQotICAgICAgICAgICAgaWYgKGluZm8tPm1TYW1wbGUgIT0gTlVMTCkgewotICAgICAgICAgICAgICAgIGluZm8tPm1TYW1wbGUtPnJlbGVhc2UoKTsKLSAgICAgICAgICAgICAgICBpbmZvLT5tU2FtcGxlID0gTlVMTDsKLSAgICAgICAgICAgICAgICBpbmZvLT5tU2FtcGxlVGltZVVzID0gLTFsbDsKLSAgICAgICAgICAgICAgICBpbmZvLT5tU2FtcGxlRmxhZ3MgPSAwOwotICAgICAgICAgICAgfQotICAgICAgICB9IGVsc2UgaWYgKGluZm8tPm1GaW5hbFJlc3VsdCAhPSBPSykgewotICAgICAgICAgICAgY29udGludWU7Ci0gICAgICAgIH0KLQotICAgICAgICBpZiAoaW5mby0+bVNhbXBsZSA9PSBOVUxMKSB7Ci0gICAgICAgICAgICBNZWRpYVNvdXJjZTo6UmVhZE9wdGlvbnMgb3B0aW9uczsKLSAgICAgICAgICAgIGlmIChzZWVrVGltZVVzID49IDBsbCkgewotICAgICAgICAgICAgICAgIG9wdGlvbnMuc2V0U2Vla1RvKHNlZWtUaW1lVXMpOwotICAgICAgICAgICAgfQotICAgICAgICAgICAgc3RhdHVzX3QgZXJyID0gaW5mby0+bVNvdXJjZS0+cmVhZCgmaW5mby0+bVNhbXBsZSwgJm9wdGlvbnMpOwotCi0gICAgICAgICAgICBpZiAoZXJyICE9IE9LKSB7Ci0gICAgICAgICAgICAgICAgQ0hFQ0soaW5mby0+bVNhbXBsZSA9PSBOVUxMKTsKLQotICAgICAgICAgICAgICAgIGluZm8tPm1GaW5hbFJlc3VsdCA9IGVycjsKLSAgICAgICAgICAgICAgICBpbmZvLT5tU2FtcGxlVGltZVVzID0gLTFsbDsKLSAgICAgICAgICAgICAgICBpbmZvLT5tU2FtcGxlRmxhZ3MgPSAwOwotICAgICAgICAgICAgICAgIGNvbnRpbnVlOwotICAgICAgICAgICAgfSBlbHNlIHsKLSAgICAgICAgICAgICAgICBDSEVDSyhpbmZvLT5tU2FtcGxlICE9IE5VTEwpOwotICAgICAgICAgICAgICAgIENIRUNLKGluZm8tPm1TYW1wbGUtPm1ldGFfZGF0YSgpLT5maW5kSW50NjQoCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAga0tleVRpbWUsICZpbmZvLT5tU2FtcGxlVGltZVVzKSk7Ci0KLSAgICAgICAgICAgICAgICBpbmZvLT5tU2FtcGxlRmxhZ3MgPSAwOwotCi0gICAgICAgICAgICAgICAgaW50MzJfdCB2YWw7Ci0gICAgICAgICAgICAgICAgaWYgKGluZm8tPm1TYW1wbGUtPm1ldGFfZGF0YSgpLT5maW5kSW50MzIoCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAga0tleUlzU3luY0ZyYW1lLCAmdmFsKSAmJiB2YWwgIT0gMCkgewotICAgICAgICAgICAgICAgICAgICBpbmZvLT5tU2FtcGxlRmxhZ3MgfD0gU0FNUExFX0ZMQUdfU1lOQzsKLSAgICAgICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgICAgICBpZiAoaW5mby0+bVNhbXBsZS0+bWV0YV9kYXRhKCktPmZpbmRJbnQzMigKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBrS2V5U2NyYW1ibGluZywgJnZhbCkgJiYgdmFsICE9IDApIHsKLSAgICAgICAgICAgICAgICAgICAgaW5mby0+bVNhbXBsZUZsYWdzIHw9IFNBTVBMRV9GTEFHX0VOQ1JZUFRFRDsKLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICB9Ci0gICAgICAgIH0KLQotICAgICAgICBpZiAobWluSW5mbyA9PSBOVUxMICB8fCBpbmZvLT5tU2FtcGxlVGltZVVzIDwgbWluSW5mby0+bVNhbXBsZVRpbWVVcykgewotICAgICAgICAgICAgbWluSW5mbyA9IGluZm87Ci0gICAgICAgICAgICBtaW5JbmRleCA9IGk7Ci0gICAgICAgIH0KLSAgICB9Ci0KLSAgICByZXR1cm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AgICAgICAgIGlmIChzb2Z0d2FyZUNvZGVjICE9IE5VTEwpIHsKLSAgICAgICAgICAgICAgICBBTE9HVigiU3VjY2Vzc2Z1bGx5IGFsbG9jYXRlZCBzb2Z0d2FyZSBjb2RlYyAnJXMnIiwgY29tcG9uZW50TmFtZSk7Ci0KLSAgICAgICAgICAgICAgICByZXR1cm4gc29mdHdhcmVDb2RlYzsKLSAgICAgICAgICAgIH0KLSAgICAgICAgfQotCi0gICAgICAgIEFMT0dWKCJBdHRlbXB0aW5nIHRvIGFsbG9jYXRlIE9NWCBub2RlICclcyciLCBjb21wb25lbnROYW1lKTsKLQotICAgICAgICBpZiAoIWNyZWF0ZUVuY29kZXIKLSAgICAgICAgICAgICAgICAmJiAocXVpcmtzICYga091dHB1dEJ1ZmZlcnNBcmVVbnJlYWRhYmxlKQotICAgICAgICAgICAgICAgICYmIChmbGFncyAmIGtDbGllbnROZWVkc0ZyYW1lYnVmZmVyKSkgewotICAgICAgICAgICAgaWYgKHN0cm5jbXAoY29tcG9uZW50TmFtZSwgIk9NWC5TRUMuIiwgOCkpIHsKLSAgICAgICAgICAgICAgICAvLyBGb3IgT01YLlNFQy4qIGRlY29kZXJzIHdlIGNhbiBlbmFibGUgYSBzcGVjaWFsIG1vZGUgdGhhdAotICAgICAgICAgICAgICAgIC8vIGdpdmVzIHRoZSBjbGllbnQgYWNjZXNzIHRvIHRoZSBmcmFtZWJ1ZmZlciBjb250ZW50cy4KLQotICAgICAgICAgICAgICAgIEFMT0dXKCJDb21wb25lbnQgJyVzJyBkb2VzIG5vdCBnaXZlIHRoZSBjbGllbnQgYWNjZXNzIHRvICIKLSAgICAgICAgICAgICAgICAgICAgICJ0aGUgZnJhbWVidWZmZXIgY29udGVudHMuIFNraXBwaW5nLiIsCi0gICAgICAgICAgICAgICAgICAgICBjb21wb25lbnROYW1lKTsKLQotICAgICAgICAgICAgICAgIGNvbnRpbnVlOwotICAgICAgICAgICAgfQotICAgICAgICB9Ci0KLSAgICAgICAgc3RhdHVzX3QgZXJyID0gb214LT5hbGxvY2F0ZU5vZGUoY29tcG9uZW50TmFtZSwgb2JzZXJ2ZXIsICZub2RlKTsKLSAgICAgICAgaWYgKGVyciA9PSBPSykgewotICAgICAgICAgICAgQUxPR1YoIlN1Y2Nlc3NmdWxseSBhbGxvY2F0ZWQgT01YIG5vZGUgJyVzJyIsIGNvbXBvbmVudE5hbWUpOwotCi0gICAgICAgICAgICBzcDxPTVhDb2RlYz4gY29kZWMgPSBuZXcgT01YQ29kZWMoCi0gICAgICAgICAgICAgICAgICAgIG9teCwgbm9kZSwgcXVpcmtzLCBmbGFncywKLSAgICAgICAgICAgICAgICAgICAgY3JlYXRlRW5jb2RlciwgbWltZSwgY29tcG9uZW50TmFtZSwKLSAgICAgICAgICAgICAgICAgICAgc291cmNlLCBuYXRpdmVXaW5kb3cpOwotCi0gICAgICAgICAgICBvYnNlcnZlci0+c2V0Q29kZWMoY29kZWMpOwotCi0gICAgICAgICAgICBlcnIgPSBjb2RlYy0+Y29uZmlndXJlQ29kZWMobWV0YSk7Ci0KLSAgICAgICAgICAgIGlmIChlcnIgPT0gT0spIHsKLSAgICAgICAgICAgICAgICBpZiAoIXN0cmNtcCgiT01YLk52aWRpYS5tcGVnMnYuZGVjb2RlIiwgY29tcG9uZW50TmFtZSkpIHsKLSAgICAgICAgICAgICAgICAgICAgY29kZWMtPm1GbGFncyB8PSBrT25seVN1Ym1pdE9uZUlucHV0QnVmZmVyQXRPbmVUaW1lOwotICAgICAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgICAgIHJldHVybiBjb2RlYzsKLSAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgQUxPR1YoIkZhaWxlZCB0byBjb25maWd1cmUgY29kZWMgJyVzJyIsIGNvbXBvbmVudE5hbWUpOwotICAgICAgICB9Ci0gICAgfQotCi0gICAgcmV0dXJuIE5VTEw7Ci19Ci0KLXN0YXR1c190IE9NWENvZGVjOjpwYXJzZUFWQ0NvZGVjU3BlY2l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lb091dHB1dEZvcm1hdCgKLSAgICAgICAgICAgICAgICAgICAgbU1JTUUsIHdpZHRoLCBoZWlnaHQpOwotCi0gICAgICAgICAgICBpZiAoZXJyICE9IE9LKSB7Ci0gICAgICAgICAgICAgICAgcmV0dXJuIGVycjsKLSAgICAgICAgICAgIH0KLSAgICAgICAgfQotICAgIH0KLQotICAgIGludDMyX3QgbWF4SW5wdXRTaXplOwotICAgIGlmIChtZXRhLT5maW5kSW50MzIoa0tleU1heElucHV0U2l6ZSwgJm1heElucHV0U2l6ZSkpIHsKLSAgICAgICAgc2V0TWluQnVmZmVyU2l6ZShrUG9ydEluZGV4SW5wdXQsIChPTVhfVTMyKW1heElucHV0U2l6ZSk7Ci0gICAgfQotCi0gICAgaW5pdE91dHB1dEZvcm1hdChtZXRhKTsKLQotICAgIGlmICgobUZsYWdzICYga0NsaWVudE5lZWRzRnJhbWVidWZmZXIpCi0gICAgICAgICAgICAmJiAhc3RybmNtcChtQ29tcG9uZW50TmFtZSwgIk9NWC5TRUMuIiwgOCkpIHsKLSAgICAgICAgT01YX0lOREVYVFlQRSBpbmRleDsKLQotICAgICAgICBzdGF0dXNfdCBlcnIgPQotICAgICAgICAgICAgbU9NWC0+Z2V0RXh0ZW5zaW9uSW5kZXgoCi0gICAgICAgICAgICAgICAgICAgIG1Ob2RlLAotICAgICAgICAgICAgICAgICAgICAiT01YLlNFQy5pbmRleC5UaHVtYm5haWxNb2RlIiwKLSAgICAgICAgICAgICAgICAgICAgJmluZGV4KTsKLQotICAgICAgICBpZiAoZXJyICE9IE9LKSB7Ci0gICAgICAgICAgICByZXR1cm4gZXJyOwotICAgICAgICB9Ci0KLSAgICAgICAgT01YX0JPT0wgZW5hYmxlID0gT01YX1RSVUU7Ci0gICAgICAgIGVyciA9IG1PTVgtPnNldENvbmZpZyhtTm9kZSwgaW5kZXgsICZlbmFibGUsIHNpemVvZihlbmFibGUpKTsKLQotICAgICAgICBpZiAoZXJyICE9IE9LKSB7Ci0gICAgICAgIC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c3Qgc3A8SU9NWD4gJm9teCwgSU9NWDo6bm9kZV9pZCBub2RlLCBib29sIGlzRW5jb2RlciwKLSAgICAgICAgY29uc3QgY2hhciAqbWltZSkgewotICAgIHN0cnVjdCBNaW1lVG9Sb2xlIHsKLSAgICAgICAgY29uc3QgY2hhciAqbWltZTsKLSAgICAgICAgY29uc3QgY2hhciAqZGVjb2RlclJvbGU7Ci0gICAgICAgIGNvbnN0IGNoYXIgKmVuY29kZXJSb2xlOwotICAgIH07Ci0KLSAgICBzdGF0aWMgY29uc3QgTWltZVRvUm9sZSBrTWltZVRvUm9sZVtdID0gewotICAgICAgICB7IE1FRElBX01JTUVUWVBFX0FVRElPX01QRUcsCi0gICAgICAgICAgICAiYXVkaW9fZGVjb2Rlci5tcDMiLCAiYXVkaW9fZW5jb2Rlci5tcDMiIH0sCi0gICAgICAgIHsgTUVESUFfTUlNRVRZUEVfQVVESU9fTVBFR19MQVlFUl9JLAotICAgICAgICAgICAgImF1ZGlvX2RlY29kZXIubXAxIiwgImF1ZGlvX2VuY29kZXIubXAxIiB9LAotICAgICAgICB7IE1FRElBX01JTUVUWVBFX0FVRElPX01QRUdfTEFZRVJfSUksCi0gICAgICAgICAgICAiYXVkaW9fZGVjb2Rlci5tcDIiLCAiYXVkaW9fZW5jb2Rlci5tcDIiIH0sCi0gICAgICAgIHsgTUVESUFfTUlNRVRZUEVfQVVESU9fQU1SX05CLAotICAgICAgICAgICAgImF1ZGlvX2RlY29kZXIuYW1ybmIiLCAiYXVkaW9fZW5jb2Rlci5hbXJuYiIgfSwKLSAgICAgICAgeyBNRURJQV9NSU1FVFlQRV9BVURJT19BTVJfV0IsCi0gICAgICAgICAgICAiYXVkaW9fZGVjb2Rlci5hbXJ3YiIsICJhdWRpb19lbmNvZGVyLmFtcndiIiB9LAotICAgICAgICB7IE1FRElBX01JTUVUWVBFX0FVRElPX0FBQywKLSAgICAgICAgICAgICJhdWRpb19kZWNvZGVyLmFhYyIsICJhdWRpb19lbmNvZGV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1lbS5nZXQoKSAhPSBOVUxMKTsKLQotICAgICAgICBCdWZmZXJJbmZvIGluZm87Ci0gICAgICAgIGluZm8ubURhdGEgPSBOVUxMOwotICAgICAgICBpbmZvLm1TaXplID0gZGVmLm5CdWZmZXJTaXplOwotCi0gICAgICAgIElPTVg6OmJ1ZmZlcl9pZCBidWZmZXI7Ci0gICAgICAgIGlmIChwb3J0SW5kZXggPT0ga1BvcnRJbmRleElucHV0Ci0gICAgICAgICAgICAgICAgJiYgKChtUXVpcmtzICYga1JlcXVpcmVzQWxsb2NhdGVCdWZmZXJPbklucHV0UG9ydHMpCi0gICAgICAgICAgICAgICAgICAgIHx8IChtRmxhZ3MgJiBrVXNlU2VjdXJlSW5wdXRCdWZmZXJzKSkpIHsKLSAgICAgICAgICAgIGlmIChtT01YTGl2ZXNMb2NhbGx5KSB7Ci0gICAgICAgICAgICAgICAgbWVtLmNsZWFyKCk7Ci0KLSAgICAgICAgICAgICAgICBlcnIgPSBtT01YLT5hbGxvY2F0ZUJ1ZmZlcigKLSAgICAgICAgICAgICAgICAgICAgICAgIG1Ob2RlLCBwb3J0SW5kZXgsIGRlZi5uQnVmZmVyU2l6ZSwgJmJ1ZmZlciwKLSAgICAgICAgICAgICAgICAgICAgICAgICZpbmZvLm1EYXRhKTsKLSAgICAgICAgICAgIH0gZWxzZSB7Ci0gICAgICAgICAgICAgICAgZXJyID0gbU9NWC0+YWxsb2NhdGVCdWZmZXJXaXRoQmFja3VwKAotICAgICAgICAgICAgICAgICAgICAgICAgbU5vZGUsIHBvcnRJbmRleCwgbWVtLCAmYnVmZmVyKTsKLSAgICAgICAgICAgIH0KLSAgICAgICAgfSBlbHNlIGlmIChwb3J0SW5kZXggPT0ga1BvcnRJbmRleE91dHB1dAotICAgICAgICAgICAgICAgICYmIChtUXVpcmtzICYga1JlcXVpcmVzQWxsb2NhdGVCdWZmZXJPbk91dHB1dFBvcnRzKSkgewotICAgICAgICAgICAgaWYgKG1PTVhMaXZlc0xvY2FsbHkpIHsKLSAgICAgICAgICAgICAgICBtZW0uY2xlYXIoKTsKLQotICAgICAgICAgICAgICAgIGVyciA9IG1PTVgtPmFsbG9jYXRlQnVmZmVyKAotICAgICAgICAgICAgICAgICAgICAgICAgbU5vZGUsIHBvcnRJbmRleCwgZGVmLm5CdWZmZXJTaXplLCAmYnVmZmVyLAotICAgICAgICAgICAgICAgICAgICAgICAgJmluZm8ubURhdGEpOwotICAgICAgICAgICAgfSBlbHNlIHsKLSAgICAgICAgICAgICAgICBlcnIgPSBtT01YLT5hbGxvY2F0ZUJ1ZmZlcldpdGhCYWNrdXAoCi0gICAgICAgICAgICAgICAgICAgICAgICBtTm9kZSwgcG9ydEluZGV4LCBtZW0sICZidWZmZXIpOwotICAgICAgICAgICAgfQotICAgICAgICB9IGVsc2UgewotICAgICAgICAgICAgZXJyID0gbU9NWC0+dXNlQnVmZmVyKG1Ob2RlLCBwb3J0SW5kZXgsIG1lbSwgJmJ1ZmZlcik7Ci0gICAgICAgIH0KLQotICAgICAgICBpZiAoZXJyICE9IE9LKSB7Ci0gICAgICAgICAgICBBTE9HRSgiYWxsb2NhdGVfYnVmZmVyX3dpdGhfYmFja3VwIGZhaWxlZCIpOwotICAgICAgICAgICAgcmV0dXJuIGVycjsKLSAgICAgICAgfQotCi0gICAgICAgIGlmIChtZW0gIT0gTlVMTCkgewotICAgICAgICAgICAgaW5mby5tRGF0YSA9IG1lbS0+cG9pbnRlcigpOwotICAgICAgICB9Ci0KLSAgICAgICAgaW5mby5tQnVmZmVyID0gYnVmZmVyOwotICAgICAgICBpbmZvLm1TdGF0dXMgPSBPV05FRF9CWV9VUzsKLSAgICAgICAgaW5mby5tTWVtID0gbWVtOwotICAgICAgICBpbmZvLm1NZWRpYUJ1ZmZlciA9IE5VTEw7Ci0KLSAgICAgICAgaWYgKHBvcnRJbmRleCA9PSBrUG9ydEluZGV4T3V0cHV0KSB7Ci0gICAgICAgICAgICBpZiAoIShtT01YTGl2ZXNMb2NhbGx5Ci0gIC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ICBpZiAoIW1ldGEtPmZpbmRJbnQzMihrS2V5RW5jb2RlckRlbGF5LCAmZGVsYXkpKSB7Ci0gICAgICAgICAgICBkZWxheSA9IDA7Ci0gICAgICAgIH0KLSAgICAgICAgaW50MzJfdCBwYWRkaW5nID0gMDsKLSAgICAgICAgaWYgKCFtZXRhLT5maW5kSW50MzIoa0tleUVuY29kZXJQYWRkaW5nLCAmcGFkZGluZykpIHsKLSAgICAgICAgICAgIHBhZGRpbmcgPSAwOwotICAgICAgICB9Ci0gICAgICAgIGludDMyX3QgbnVtY2hhbm5lbHMgPSAwOwotICAgICAgICBpZiAoZGVsYXkgKyBwYWRkaW5nKSB7Ci0gICAgICAgICAgICBpZiAobWV0YS0+ZmluZEludDMyKGtLZXlDaGFubmVsQ291bnQsICZudW1jaGFubmVscykpIHsKLSAgICAgICAgICAgICAgICBzaXplX3QgZnJhbWVTaXplID0gbnVtY2hhbm5lbHMgKiBzaXplb2YoaW50MTZfdCk7Ci0gICAgICAgICAgICAgICAgaWYgKG1Ta2lwQ3V0QnVmZmVyKSB7Ci0gICAgICAgICAgICAgICAgICAgIHNpemVfdCBwcmV2YnVmZmVyc2l6ZSA9IG1Ta2lwQ3V0QnVmZmVyLT5zaXplKCk7Ci0gICAgICAgICAgICAgICAgICAgIGlmIChwcmV2YnVmZmVyc2l6ZSAhPSAwKSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICBBTE9HVygiUmVwbGFjaW5nIFNraXBDdXRCdWZmZXIgaG9sZGluZyAlZCBieXRlcyIsIHByZXZidWZmZXJzaXplKTsKLSAgICAgICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgICAgICBkZWxldGUgbVNraXBDdXRCdWZmZXI7Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgIG1Ta2lwQ3V0QnVmZmVyID0gbmV3IFNraXBDdXRCdWZmZXIoZGVsYXkgKiBmcmFtZVNpemUsIHBhZGRpbmcgKiBmcmFtZVNpemUsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBkZWYubkJ1ZmZlclNpemUpOwotICAgICAgICAgICAgfQotICAgICAgICB9Ci0gICAgfQotCi0gICAgLy8gZHVtcFBvcnRTdGF0dXMocG9ydEluZGV4KTsKLQotICAgIGlmIChwb3J0SW5kZXggPT0ga1BvcnRJbmRleElucHV0ICYmIChtRmxhZ3MgJiBrVXNlU2VjdXJlSW5wdXRCdWZmZXJzKSkgewotICAgICAgICBWZWN0b3I8TWVkaWFCdWZmZXIgKj4gYnVmZmVyczsKLSAgICAgICAgZm9yIChzaXplX3QgaSA9IDA7IGkgPCBkZWYubkJ1ZmZlckNvdW50QWN0dWFsOyArK2kpIHsKLSAgICAgICAgICAgIGNvbnN0IEJ1ZmZlckluZm8gJmluZm8gPSBtUG9ydEJ1ZmZlcnNba1BvcnRJbmRleElucHV0XS5pdGVtQXQoaSk7Ci0KLSAgICAgICAgICAgIE1lZGlhQnVmZmVyICptYnVmID0gbmV3IE1lZGlhQnVmZmVyKGluZm8ubURhdGEsIGluZm8ubVNpemUpOwotICAgICAgICAgICAgYnVmZmVycy5wdXNoKG1idWYpOwotICAgICAgICB9Ci0KLSAgICAgICAgc3RhdHVzX3QgZXJyID0gbVNvdXJjZS0+c2V0QnVmZmVycyhidWZmZXJzKTsKLQotICAgICAgICBpZiAoZXJyICE9IE9LKSB7Ci0gICAgICAgICAgICBmb3IgKHNpemVfdCBpID0gMDsgaSA8IGRlZi5uQnVmZmVyQ291bnRBY3R1YWw7ICsraSkgewotICAgICAgICAgICAgICAgIGJ1ZmZlcnMuZWRpdEl0ZW1BdChpKS0+cmVsZWFzZSgpOwotICAgICAgICAgICAgfQotICAgICAgICAgICAgYnVmZmVycy5jbGVhcigpOwotCi0gICAgICAgICAgICBDT0RFQ19MT0dFKAotICAgICAgICAgICAgICAgICAgICAiQ29kZWMgcmVxdWVzdGVkIHRvIHVzZSBzZWN1cmUgaW5wdXQgYnVmZmVycyBidXQgIg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7Ci0gICAgaWYgKGVyciAhPSBOT19FUlJPUikgewotICAgICAgICBBTE9HRSgiZXJyb3IgcHVzaGluZyBibGFuayBmcmFtZXM6IGFwaV9jb25uZWN0IGZhaWxlZDogJXMgKCVkKSIsCi0gICAgICAgICAgICAgICAgc3RyZXJyb3IoLWVyciksIC1lcnIpOwotICAgICAgICByZXR1cm4gZXJyOwotICAgIH0KLQotICAgIGVyciA9IG5hdGl2ZV93aW5kb3dfc2V0X3NjYWxpbmdfbW9kZShtTmF0aXZlV2luZG93LmdldCgpLAotICAgICAgICAgICAgTkFUSVZFX1dJTkRPV19TQ0FMSU5HX01PREVfU0NBTEVfVE9fV0lORE9XKTsKLSAgICBpZiAoZXJyICE9IE5PX0VSUk9SKSB7Ci0gICAgICAgIEFMT0dFKCJlcnJvciBwdXNoaW5nIGJsYW5rIGZyYW1lczogc2V0X2J1ZmZlcnNfZ2VvbWV0cnkgZmFpbGVkOiAlcyAoJWQpIiwKLSAgICAgICAgICAgICAgICBzdHJlcnJvcigtZXJyKSwgLWVycik7Ci0gICAgICAgIGdvdG8gZXJyb3I7Ci0gICAgfQotCi0gICAgZXJyID0gbmF0aXZlX3dpbmRvd19zZXRfYnVmZmVyc19nZW9tZXRyeShtTmF0aXZlV2luZG93LmdldCgpLCAxLCAxLAotICAgICAgICAgICAgSEFMX1BJWEVMX0ZPUk1BVF9SR0JYXzg4ODgpOwotICAgIGlmIChlcnIgIT0gTk9fRVJST1IpIHsKLSAgICAgICAgQUxPR0UoImVycm9yIHB1c2hpbmcgYmxhbmsgZnJhbWVzOiBzZXRfYnVmZmVyc19nZW9tZXRyeSBmYWlsZWQ6ICVzICglZCkiLAotICAgICAgICAgICAgICAgIHN0cmVycm9yKC1lcnIpLCAtZXJyKTsKLSAgICAgICAgZ290byBlcnJvcjsKLSAgICB9Ci0KLSAgICBlcnIgPSBuYXRpdmVfd2luZG93X3NldF91c2FnZShtTmF0aXZlV2luZG93LmdldCgpLAotICAgICAgICAgICAgR1JBTEx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YWlsZWQ6ICVzICglZCkiLAotICAgICAgICAgICAgICAgICAgICBzdHJlcnJvcigtZXJyKSwgLWVycik7Ci0gICAgICAgICAgICBnb3RvIGVycm9yOwotICAgICAgICB9Ci0KLSAgICAgICAgLy8gRmlsbCB0aGUgYnVmZmVyIHdpdGggdGhlIGEgMXgxIGNoZWNrZXJib2FyZCBwYXR0ZXJuIDspCi0gICAgICAgIHVpbnQzMl90KiBpbWcgPSBOVUxMOwotICAgICAgICBlcnIgPSBidWYtPmxvY2soR1JBTExPQ19VU0FHRV9TV19XUklURV9PRlRFTiwgKHZvaWQqKikoJmltZykpOwotICAgICAgICBpZiAoZXJyICE9IE5PX0VSUk9SKSB7Ci0gICAgICAgICAgICBBTE9HRSgiZXJyb3IgcHVzaGluZyBibGFuayBmcmFtZXM6IGxvY2sgZmFpbGVkOiAlcyAoJWQpIiwKLSAgICAgICAgICAgICAgICAgICAgc3RyZXJyb3IoLWVyciksIC1lcnIpOwotICAgICAgICAgICAgZ290byBlcnJvcjsKLSAgICAgICAgfQotCi0gICAgICAgICppbWcgPSAwOwotCi0gICAgICAgIGVyciA9IGJ1Zi0+dW5sb2NrKCk7Ci0gICAgICAgIGlmIChlcnIgIT0gTk9fRVJST1IpIHsKLSAgICAgICAgICAgIEFMT0dFKCJlcnJvciBwdXNoaW5nIGJsYW5rIGZyYW1lczogdW5sb2NrIGZhaWxlZDogJXMgKCVkKSIsCi0gICAgICAgICAgICAgICAgICAgIHN0cmVycm9yKC1lcnIpLCAtZXJyKTsKLSAgICAgICAgICAgIGdvdG8gZXJyb3I7Ci0gICAgICAgIH0KLQotICAgICAgICBlcnIgPSBtTmF0aXZlV2luZG93LT5xdWV1ZUJ1ZmZlcihtTmF0aXZlV2luZG93LmdldCgpLAotICAgICAgICAgICAgICAgIGJ1Zi0+Z2V0TmF0aXZlQnVmZmVyKCkpOwotICAgICAgICBpZiAoZXJyICE9IE5PX0VSUk9SKSB7Ci0gICAgICAgICAgICBBTE9HRSgiZXJyb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otICAgICAgICAgICAgICAgICAgICBzdHJlcnJvcigtZXJyKSwgLWVycik7Ci0gICAgICAgICAgICByZXR1cm4gZXJyOwotICAgICAgICB9Ci0KLSAgICAgICAgZXJyID0gbmF0aXZlX3dpbmRvd19hcGlfY29ubmVjdChtTmF0aXZlV2luZG93LmdldCgpLAotICAgICAgICAgICAgICAgIE5BVElWRV9XSU5ET1dfQVBJX01FRElBKTsKLSAgICAgICAgaWYgKGVyciAhPSBOT19FUlJPUikgewotICAgICAgICAgICAgQUxPR0UoImVycm9yIHB1c2hpbmcgYmxhbmsgZnJhbWVzOiBhcGlfY29ubmVjdCBmYWlsZWQ6ICVzICglZCkiLAotICAgICAgICAgICAgICAgICAgICBzdHJlcnJvcigtZXJyKSwgLWVycik7Ci0gICAgICAgICAgICByZXR1cm4gZXJyOwotICAgICAgICB9Ci0KLSAgICAgICAgcmV0dXJuIE5PX0VSUk9SOwotICAgIH0KLX0KLQotaW50NjRfdCBPTVhDb2RlYzo6Z2V0RGVjb2RpbmdUaW1lVXMoKSB7Ci0gICAgQ0hFQ0sobUlzRW5jb2RlciAmJiBtSXNWaWRlbyk7Ci0KLSAgICBpZiAobURlY29kaW5nVGltZUxpc3QuZW1wdHkoKSkgewotICAgICAgICBDSEVDSyhtU2lnbmFsbGVkRU9TIHx8IG1Ob01vcmVPdXRwdXREYXRhKTsKLSAgICAgICAgLy8gTm8gY29ycmVzcG9uZGluZyBpbnB1dCBmcmFtZSBhdmFpbGFibGUuCi0gICAgICAgIC8vIFRoaXMgY291bGQgaGFwcGVuIHdoZW4gRU9TIGlzIHJlYWNoZWQuCi0gICAgICAgIHJldHVybiAwOwotICAgIH0KLQotICAgIExpc3Q8aW50NjRfdD46Oml0ZXJhdG9yIGl0ID0gbURlY29kaW5nVGltZUxpc3QuYmVnaW4oKTsKLSAgICBpbnQ2NF90IHRpbWVVcyA9ICppdDsKLSAgICBtRGVjb2RpbmdUaW1lTGlzdC5lcmFzZShpdCk7Ci0gICAgcmV0dXJ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ICB9Ci0KLSAgICAgICAgICAgIENIRUNLKGkgPCBidWZmZXJzLT5zaXplKCkpOwotICAgICAgICAgICAgaWYgKCgqYnVmZmVycylbaV0ubVN0YXR1cyAhPSBPV05FRF9CWV9DT01QT05FTlQpIHsKLSAgICAgICAgICAgICAgICBBTE9HVygiV2UgYWxyZWFkeSBvd24gaW5wdXQgYnVmZmVyICVwLCB5ZXQgcmVjZWl2ZWQgIgotICAgICAgICAgICAgICAgICAgICAgImFuIEVNUFRZX0JVRkZFUl9ET05FLiIsIGJ1ZmZlcik7Ci0gICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgIEJ1ZmZlckluZm8qIGluZm8gPSAmYnVmZmVycy0+ZWRpdEl0ZW1BdChpKTsKLSAgICAgICAgICAgIGluZm8tPm1TdGF0dXMgPSBPV05FRF9CWV9VUzsKLQotICAgICAgICAgICAgLy8gQnVmZmVyIGNvdWxkIG5vdCBiZSByZWxlYXNlZCB1bnRpbCBlbXB0eSBidWZmZXIgZG9uZSBpcyBjYWxsZWQuCi0gICAgICAgICAgICBpZiAoaW5mby0+bU1lZGlhQnVmZmVyICE9IE5VTEwpIHsKLSAgICAgICAgICAgICAgICBpZiAobUlzRW5jb2RlciAmJgotICAgICAgICAgICAgICAgICAgICAobVF1aXJrcyAmIGtBdm9pZE1lbWNvcHlJbnB1dFJlY29yZGluZ0ZyYW1lcykpIHsKLSAgICAgICAgICAgICAgICAgICAgLy8gSWYgemVyby1jb3B5IG1vZGUgaXMgZW5hYmxlZCB0aGlzIHdpbGwgc2VuZCB0aGUKLSAgICAgICAgICAgICAgICAgICAgLy8gaW5wdXQgYnVmZmVyIGJhY2sgdG8gdGhlIHVwc3RyZWFtIHNvdXJjZS4KLSAgICAgICAgICAgICAgICAgICAgcmVzdG9yZVBhdGNoZWREYXRhUG9pbnRlcihpbmZvKTsKLSAgICAgICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgICAgICBpbmZvLT5tTWVkaWFCdWZmZXItPnJlbGVhc2UoKTsKLSAgICAgICAgICAgICAgICBpbmZvLT5tTWVkaWFCdWZmZXIgPSBOVUxMOwotICAgICAgICAgICAgfQotCi0gICAgICAgICAgICBpZiAobVBvcnRTdGF0dXNba1BvcnRJbmRleElucHV0XSA9PSBESVNBQkxJTkcpIHsKLSAgICAgICAgICAgICAgICBDT0RFQ19MT0dWKCJQb3J0IGlzIGRpc2FibGVkLCBmcmVlaW5nIGJ1ZmZlciAlcCIsIGJ1ZmZlcik7Ci0KLSAgICAgICAgICAgICAgICBzdGF0dXNfdCBlcnIgPSBmcmVlQnVmZmVyKGtQb3J0SW5kZXhJbnB1dCwgaSk7Ci0gICAgICAgICAgICAgICAgQ0hFQ0tfRVEoZXJyLCAoc3RhdHVzX3QpT0spOwotICAgICAgICAgICAgfSBlbHNlIGlmIChtU3RhdGUgIT0gRVJST1IKLSAgICAgICAgICAgICAgICAgICAgJiYgbVBvcnRTdGF0dXNba1BvcnRJbmRleElucHV0XSAhPSBTSFVUVElOR19ET1dOKSB7Ci0gICAgICAgICAgICAgICAgQ0hFQ0tfRVEoKGludCltUG9ydFN0YXR1c1trUG9ydEluZGV4SW5wdXRdLCAoaW50KUVOQUJMRUQpOwotCi0gICAgICAgICAgICAgICAgaWYgKG1GbGFncyAmIGtVc2VTZWN1cmVJbnB1dEJ1ZmZlcnMpIHsKLSAgICAgICAgICAgICAgICAgICAgZHJhaW5BbnlJbnB1dEJ1ZmZlcigpOwotICAgICAgICAgICAgICAgIH0gZWxzZSB7Ci0gICAgICAgICAgICAgICAgICAgIGRyYWluSW5wdXRCdWZmZXIoJmJ1ZmZlcnMtPmVkaXRJdGVtQXQoaSkpOwotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgIH0KLSAgICAgICAgICAgIGJyZWFrOwotICAgICAgICB9Ci0KLSAgICAgICAgY2FzZSBvbXhfbWVzc2FnZTo6RklMTF9CVUZGRVJfRE9ORToKLSAgICAgICAgewotICAgICAgICAgICAgSU9NWDo6YnVmZmVyX2lkIG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gICAgICAgICAgICAgQUxPR1coIldlIGFscmVhZHkgb3duIG91dHB1dCBidWZmZXIgJXAsIHlldCByZWNlaXZlZCAiCi0gICAgICAgICAgICAgICAgICAgICAiYSBGSUxMX0JVRkZFUl9ET05FLiIsIGJ1ZmZlcik7Ci0gICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgIGluZm8tPm1TdGF0dXMgPSBPV05FRF9CWV9VUzsKLQotICAgICAgICAgICAgaWYgKG1Qb3J0U3RhdHVzW2tQb3J0SW5kZXhPdXRwdXRdID09IERJU0FCTElORykgewotICAgICAgICAgICAgICAgIENPREVDX0xPR1YoIlBvcnQgaXMgZGlzYWJsZWQsIGZyZWVpbmcgYnVmZmVyICVwIiwgYnVmZmVyKTsKLQotICAgICAgICAgICAgICAgIHN0YXR1c190IGVyciA9IGZyZWVCdWZmZXIoa1BvcnRJbmRleE91dHB1dCwgaSk7Ci0gICAgICAgICAgICAgICAgQ0hFQ0tfRVEoZXJyLCAoc3RhdHVzX3QpT0spOwotCi0jaWYgMAotICAgICAgICAgICAgfSBlbHNlIGlmIChtUG9ydFN0YXR1c1trUG9ydEluZGV4T3V0cHV0XSA9PSBFTkFCTEVECi0gICAgICAgICAgICAgICAgICAgICAgICYmIChmbGFncyAmIE9NWF9CVUZGRVJGTEFHX0VPUykpIHsKLSAgICAgICAgICAgICAgICBDT0RFQ19MT0dWKCJObyBtb3JlIG91dHB1dCBkYXRhLiIpOwotICAgICAgICAgICAgICAgIG1Ob01vcmVPdXRwdXREYXRhID0gdHJ1ZTsKLSAgICAgICAgICAgICAgICBtQnVmZmVyRmlsbGVkLnNpZ25hbCgpOwotI2VuZGlmCi0gICAgICAgICAgICB9IGVsc2UgaWYgKG1Qb3J0U3RhdHVzW2tQb3J0SW5kZXhPdXRwdXRdICE9IFNIVVRUSU5HX0RPV04pIHsKLSAgICAgICAgICAgICAgICBDSEVDS19FUSgoaW50KW1Qb3J0U3RhdHVzW2tQb3J0SW5kZXhPdXRwdXRdLCAoaW50KUVOQUJMRUQpOwotCi0gICAgICAgICAgICAgICAgaWYgKGluZm8tPm1NZWRpYUJ1ZmZlciA9PSBOVUxMKSB7Ci0gICAgICAgICAgICAgICAgICAgIENIRUNLKG1PTVhMaXZlc0xvY2FsbHkpOwotICAgICAgICAgICAgICAgICAgICBDSEVDSyhtUXVpcmtzICYga1JlcXVpcmVzQWxsb2NhdGVCdWZmZXJPbk91dHB1dFBvcnRzKTsKLSAgICAgICAgICAgICAgICAgICAgQ0hFQ0sobVF1aXJrcyAmIGtEZWZlcnNPdXRwdXRCdWZmZXJBbGxvY2F0aW9uKTsKLQotICAgICAgICAgICAgICAgICAgICAvLyBUaGUgcWNvbSB2aWRlbyBkZWNvZGVycyBvbiBOZXh1cyBkb24ndCBhY3R1YWxseSBhbGxvY2F0ZQotICAgICAgICAgICAgICAgICAgICAvLyBvdXRwdXQgYnVmZmVyIG1lbW9yeSBvbiBhIGNhbGwgdG8gT01YX0FsbG9jYXRlQnVmZmVyCi0gICAgICAgICAgICAgICAgICAgIC8vIHRoZSAicEJ1ZmZlciIgbWVtYmVyIG9mIHRoZSBPTVhfQlVGRkVSSEVBREVSVFlQRQotICAgICAgICAgICAgICAgICAgICAvLyBzdHJ1Y3R1cmUgaXMgb25seSBmaWxsZWQgaW4gbGF0ZXIuCi0KLSAgICAgICAgICAgICAgICAgICAgaW5mby0+bU1lZGlhQnVmZmVyID0gbmV3IE1lZGlhQnVmZmVyKAotICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1zZy51LmV4dGVuZGVkX2J1ZmZlcl9kYXRhLmRhdGFfcHRyLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgIGluZm8tPm1TaXplKTsKLSAgICAgICAgICAgICAgICAgICAgaW5mby0+bU1lZGlhQnVmZmVyLT5zZXRPYnNlcnZlcih0aGlzKTsKLSAgICAgICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgICAgICBNZWRpYUJ1ZmZlciAqYnVmZmVyID0gaW5mby0+bU1lZGlhQnVmZmVyOwotICAgICAgICAgICAgICAgIGJvb2wgaXNHcmFwaGljQnVmZmVyID0gYnVmZmVyLT5ncmFwaGljQnVmZmVyKCkgIT0gTlVMTDsKLQotICAgICAgICAgICAgICAgIGlmICghaXNHcmFwaGljQnVmZmVyCi0gICAgICAgICAgICAgICAgICAgICYmIG1zZy51LmV4dGVuZGVkX2J1ZmZlcl9kYXRhLnJhbmdlX29mZnNldAotICAgICAgICAgICAgICAgICAgICAgICAgKyBtc2cudS5leHRlbmRlZF9idWZmZXJfZGF0YS5yYW5nZV9sZW5ndGgKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICA+IGJ1ZmZlci0+c2l6ZSgpKSB7Ci0gICAgICAgICAgICAgICAgICAgIENPREVDX0xPR0UoCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgIkNvZGVjIGxpZWQgYWJvdXQgaXRzIGJ1ZmZlciBzaXplIHJlcXVpcmVtZW50cywgIgotICAgICAgICAgICAgICAgICAgICAgICAgICAgICJzZW5kaW5nIGEgYnVmZmVyIGxhcmdlciB0aGFuIHRoZSBvcmlnaW5hbGx5ICIKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAiYWR2ZXJ0aXNlZCBzaXplIGluIEZJTExfQlVGRkVSX0RPTkUhIik7Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgIGJ1ZmZlci0+c2V0X3JhbmdlKAotICAgICAgICAgICAgICAgICAgICAgICAgbXNnLnUuZXh0ZW5kZWRfYnVmZmVyX2RhdGEucmFuZ2Vfb2Zmc2V0LAotICAgICAgICAgICAgICAgICAgICAgICAgbXNnLnUuZXh0ZW5kZWRfYnVmZmVyX2RhdGEucmFuZ2VfbGVuZ3RoKTsKLQotICAgICAgICAgICAgICAgIGJ1ZmZlci0+bWV0YV9kYXRhKCktPmNsZWFyKCk7Ci0KLSAgICAgICAgICAgICAgICBidWZmZXItPm1ldGFfZGF0YSgpLT5zZXRJbnQ2NCgKLSAgICAgICAgICAgICAgICAgICAgICAgIGtLZXlUaW1lLCBtc2cudS5leHRlbmRlZF9idWZmZXJfZGF0YS50aW1lc3RhbXApOwotCi0gICAgICAgICAgICAgICAgaWYgKG1zZy51LmV4dGVuZGVkX2J1ZmZlcl9kYXRhLmZsYWdzICYgT01YX0JVRkZFUkZMQUdfU1lOQ0ZSQU1FKSB7Ci0gICAgICAgICAgICAgICAgICAgIGJ1ZmZlci0+bWV0YV9kYXRhKCktPnNldEludDMyKGtLZXlJc1N5bmNGcmFtZSwgdHJ1ZSk7Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgIGJvb2wgaXNDb2RlY1NwZWNpZmljID0gZmFsc2U7Ci0gICAgICAgICAgICAgICAgaWYgKG1zZy51LmV4dGVuZGVkX2J1ZmZlcl9kYXRhLmZsYWdzICYgT01YX0JVRkZFUkZMQUdfQ09ERUNDT05GSUcpIHsKLSAgICAgICAgICAgICAgICAgICAgYnVmZmVyLT5tZXRhX2RhdGEoKS0+c2V0SW50MzIoa0tleUlzQ29kZWNDb25maWcsIHRydWUpOwotICAgICAgICAgICAgICAgICAgICBpc0NvZGVjU3BlY2lmaWMgPSB0cnVlOwotICAgICAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgICAgIGlmIChpc0dyYXBoaWNCdWZmZXIgfHwgbVF1aXJrcyAmIGtPdXRwdXRCdWZmZXJzQXJlVW5yZWFkYWJsZSkgewotICAgICAgICAgICAgICAgICAgICBidWZmZXItPm1ldGFfZGF0YSgpLT5zZXRJbnQzMihrS2V5SXNVbnJlYWRhYmxlLCB0cnVlKTsKLSAgICAgICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgICAgICBidWZmZXItPm1ldGFfZGF0YSgpLT5zZXRQb2ludGVyKAotICAgICAgICAgICAgICAgICAgICAgICAga0tleVBsYXRmb3JtUHJpdmF0ZSwKLSAgICAgICAgICAgICAgICAgICAgICAgIG1zZy51LmV4dGVuZGVkX2J1ZmZlcl9kYXRhLnBsYXRmb3JtX3ByaXZhdGUpOwotCi0gICAgICAgICAgICAgICAgYnVmZmVyLT5tZXRhX2RhdGEoKS0+c2V0UG9pbnRlcigKLSAgICAgICAgICAgICAgICAgICAgICAgIGtLZXlCdWZmZXJJRCwKLSAgICAgICAgICAgICAgICAgICAgICAgIG1zZy51LmV4dGVuZGVkX2J1ZmZlcl9kYXRhLmJ1ZmZlcik7Ci0KLSAgICAgICAgICAgICAgICBpZiAobXNnLnUuZXh0ZW5kZWRfYnVmZmVyX2RhdGEuZmxhZ3MgJiBPTVhfQlVGRkVSRkxBR19FT1MpIHsKLSAgICAgICAgICAgICAgICAgICAgQ09ERUNfTE9HVigiTm8gbW9yZSBvdXRwdXQgZGF0YS4iKTsKLSAgICAgICAgICAgICAgICAgICAgbU5vTW9yZU91dHB1dERhdGEgPSB0cnVlOwotICAgICAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgICAgIGlmIChtSXNFbmNvZGVyICYmIG1Jc1ZpZGVvKSB7Ci0gICAgICAgICAgICAgICAgICAgIGludDY0X3QgZGVjb2RpbmdUaW1lVXMgPSBpc0NvZGVjU3BlY2lmaWM/IDA6IGdldERlY29kaW5nVGltZVVzKCk7Ci0gICAgICAgICAgICAgICAgICAgIGJ1ZmZlci0+bWV0YV9kYXRhKCktPnNldEludDY0KGtLZXlEZWNvZGluZ1RpbWUsIGRlY29kaW5nVGltZVVzKTsKLSAgICAgICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgICAgICBpZiAobVRhcmdldFRpbWVVcyA+PSAwKSB7Ci0gICAgICAgICAgICAgICAgICAgIENIRUNLKG1zZy51LmV4dGVuZGVkX2J1ZmZlcl9kYXRhLnRpbWVzdGFtcCA8PSBtVGFyZ2V0VGltZVVzKTsKLQotICAgICAgICAgICAgICAgICAgICBpZiAobXNnLnUuZXh0ZW5kZWRfYnVmZmVyX2RhdGEudGltZXN0YW1wIDwgbVRhcmdldFRpbWVVcykgewotICAgICAgICAgICAgICAgICAgICAgICAgQ09ERUNfTE9HVigKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgInNraXBwaW5nIG91dHB1dCBidWZmZXIgYXQgdGltZXN0YW1wICVsbGQgdXMiLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBtc2cudS5leHRlbmRlZF9idWZmZXJfZGF0YS50aW1lc3RhbXApOwotCi0gICAgICAgICAgICAgICAgICAgICAgICBmaWxsT3V0cHV0QnVmZmVyKGluZm8pOwotICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7Ci0gICAgICAgICAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgICAgICAgICBDT0RFQ19MT0dWKAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICJyZXR1cm5pbmcgb3V0cHV0IGJ1ZmZlciBhdCB0YXJnZXQgdGltZXN0YW1wICIKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAiJWxsZCB1cyIsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgbXNnLnUuZXh0ZW5kZWRfYnVmZmVyX2RhdGEudGltZXN0YW1wKTsKLQotICAgICAgICAgICAgICAgICAgICBtVGFyZ2V0VGltZVVzID0gLTE7Ci0gICAgICAgICAgICAgICAgfQotCi0gICAgICAgICAgICAgICAgbUZpbGxlZEJ1ZmZlcnMucHVzaF9iYWNrKGkpOwotICAgICAgICAgICAgICAgIG1CdWZmZXJGaWxsZWQuc2lnbmFsKCk7Ci0gICAgICAgICAgICAgICAgaWYgKG1Jc0VuY29kZXIpIHsKLSAgICAgICAgICAgICAgICAgICAgc2NoZWRfeWllbGQoKTsKLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgIGJyZWFrOwotICAgICAgICB9Ci0KLSAgICAgICAgZGVmYXVsdDoKLSAgICAgICAgewotICAgICAgICAgICAgQ0hFQ0soISJzaG91bGQgbm90IGJlIGhlcmUuIik7Ci0gICAgICAgICAgICBicmVhazsKLSAgICAgICAgfQotICAgIH0KLX0KLQotLy8gSGFzIHR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gIGlmIChzYW1wbGVSYXRlX2Zyb20gIT0gc2FtcGxlUmF0ZV90bykgewotICAgICAgICAgICAgcmV0dXJuIHRydWU7Ci0gICAgICAgIH0KLSAgICB9Ci0KLSAgICByZXR1cm4gZmFsc2U7Ci19Ci0KLXZvaWQgT01YQ29kZWM6Om9uRXZlbnQoT01YX0VWRU5UVFlQRSBldmVudCwgT01YX1UzMiBkYXRhMSwgT01YX1UzMiBkYXRhMikgewotICAgIHN3aXRjaCAoZXZlbnQpIHsKLSAgICAgICAgY2FzZSBPTVhfRXZlbnRDbWRDb21wbGV0ZToKLSAgICAgICAgewotICAgICAgICAgICAgb25DbWRDb21wbGV0ZSgoT01YX0NPTU1BTkRUWVBFKWRhdGExLCBkYXRhMik7Ci0gICAgICAgICAgICBicmVhazsKLSAgICAgICAgfQotCi0gICAgICAgIGNhc2UgT01YX0V2ZW50RXJyb3I6Ci0gICAgICAgIHsKLSAgICAgICAgICAgIENPREVDX0xPR0UoIkVSUk9SKDB4JTA4bHgsICVsZCkiLCBkYXRhMSwgZGF0YTIpOwotCi0gICAgICAgICAgICBzZXRTdGF0ZShFUlJPUik7Ci0gICAgICAgICAgICBicmVhazsKLSAgICAgICAgfQotCi0gICAgICAgIGNhc2UgT01YX0V2ZW50UG9ydFNldHRpbmdzQ2hhbmdlZDoKLSAgICAgICAgewotICAgICAgICAgICAgQ09ERUNfTE9HVigiT01YX0V2ZW50UG9ydFNldHRpbmdzQ2hhbmdlZChwb3J0PSVsZCwgZGF0YTI9MHglMDhseCkiLAotICAgICAgICAgICAgICAgICAgICAgICBkYXRhMSwgZGF0YTIpOwotCi0gICAgICAgICAgICBpZiAoZGF0YTIgPT0gMCB8fCBkYXRhMiA9PSBPTVhfSW5kZXhQYXJhbVBvcnREZWZpbml0aW9uKSB7Ci0gICAgICAgICAgICAgICAgLy8gVGhlcmUgaXMgbm8gbmVlZCB0byBjaGVjayB3aGV0aGVyIG1GaWxsZWRCdWZmZXJzIGlzIGVtcHR5IG9yIG5vdAotICAgICAgICAgICAgICAgIC8vIHdoZW4gdGhlIE9NWF9FdmVudFBvcnRTZXR0aW5nc0NoYW5nZWQgaXMgbm90IG1lYW50IGZvciByZWFsbG9jYXRpbmcKLSAgICAgICAgICAgICAgICAvLyB0aGUgb3V0cHV0IGJ1ZmZlcnMuCi0gICAgICAgICAgICAgICAgaWYgKGRhdGExID09IGtQb3J0SW5kZXhPdXRwdXQpIHsKLSAgICAgICAgICAgICAgICAgICAgQ0hFQ0sobUZpbGxlZEJ1ZmZlcnMuZW1wdHkoKSk7Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgIG9uUG9ydFNldHRpbmdzQ2hhbmdlZChkYXRhMSk7Ci0gICAgICAgICAgICB9IGVsc2UgaWYgKGRhdGExID09IGtQb3J0SW5kZXhPdXRwdXQgJiYKLSAgICAgICAgICAgICAgICAgICAgICAgIChkYXRhMiA9PSBPTVhfSW5kZXhDb25maWdDb21tb25PdXRwdXRDcm9wIHx8Ci0gICAgICAgICAgICAgICAgICAgICAgICAgZGF0YTIgPT0gT01YX0luZGV4Q29uZmlnQ29tbW9uU2NhbGUpKSB7Ci0KLSAgICAgICAgICAgICAgICBzcDxNZXRhRGF0YT4gb2xkT3V0cHV0Rm9ybWF0ID0gbU91dHB1dEZvcm1hdDsKLSAgICAgICAgICAgICAgICBpbml0T3V0cHV0Rm9ybWF0KG1Tb3VyY2UtPmdldEZvcm1hdCgpKTsKLQotICAgICAgICAgICAgICAgIGlmIChkYXRhMiA9PSBPTVhfSW5kZXhDb25maWdDb21tb25PdXRwdXRDcm9wICYmCi0gICAgICAgICAgICAgICAgICAgIGZvcm1hdEhhc05vdGFibHlDaGFuZ2VkKG9sZE91dHB1dEZvcm1hdCwgbU91dHB1dEZvcm1hdCkpIHsKLSAgICAgICAgICAgICAgICAgICAgbU91dHB1dFBvcnRTZXR0aW5nc0hhdmVDaGFuZ2VkID0gdHJ1ZTsKLQotICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAoZGF0YTIgPT0gT01YX0luZGV4Q29uZmlnQ29tbW9uU2NhbGUpIHsKLSAgICAgICAgICAgICAgICAgICAgT01YX0NPTkZJR19TQ0FMRUZBQ1RPUlRZUEUgc2NhbGU7Ci0gICAgICAgICAgICAgICAgICAgIEluaXRPTVhQYXJhbXMoJnNjYWxlKTsKLSAgICAgICAgICAgICAgICAgICAgc2NhbGUublBvcnRJbmRleCA9IGtQb3J0SW5kZXhPdXRwdXQ7Ci0KLSAgICAgICAgICAgICAgICAgICAgLy8gQ2hhbmdlIGRpc3BsYXkgZGltZW5zaW9uIG9ubHkgd2hlbiBuZWNlc3NhcnkuCi0gICAgICAgICAgICAgICAgICAgIGlmIChPSyA9PSBtT01YLT5nZXRDb25maWcoCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbU5vZGUsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgT01YX0luZGV4Q29uZmlnQ29tbW9uU2NhbGUsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJnNjYWxlLCBzaXplb2Yoc2NhbGUpKSkgewotICAgICAgICAgICAgICAgICAgICAgICAgaW50MzJfdCBsZWZ0LCB0b3AsIHJpZ2h0LCBib3R0b207Ci0gICAgICAgICAgICAgICAgICAgICAgICBDSEVDSyhtT3V0cHV0Rm9ybWF0LT5maW5kUmVjdChrS2V5Q3JvcFJlY3QsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmbGVmdCwgJnRvcCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICZyaWdodCwgJmJvdHRvbSkpOwotCi0gICAgICAgICAgICAgICAgICAgICAgICAvLyBUaGUgc2NhbGUgaXMgaW4gMTYuMTYgZm9ybWF0LgotICAgICAgICAgICAgICAgICAgICAgICAgLy8gc2NhbGUgMS4wID0gMHgwMTAwMDAuIFdoZW4gdGhlcmUgaXMgbm8KLSAgICAgICAgICAgICAgICAgICAgICAgIC8vIG5lZWQgdG8gY2hhbmdlIHRoZSBkaXNwbGF5LCBza2lwIGl0LgotICAgICAgICAgICAgICAgICAgICAgICAgQUxPR1YoIkdldCBPTVhfSW5kZXhDb25maWdTY2FsZTogMHglbHgvMHglbHgiLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzY2FsZS54V2lkdGgsIHNjYWxlLnhIZWlnaHQpOwotCi0gICAgICAgICAgICAgICAgICAgICAgICBpZiAoc2NhbGUueFdpZHRoICE9IDB4MDEwMDAwKSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgbU91dHB1dEZvcm1hdC0+c2V0SW50MzIoa0tleURpc3BsYXlXaWR0aCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICgocmlnaHQgLSBsZWZ0ICsgIDEpICogc2NhbGUueFdpZHRoKSAgPj4gMTYpOwotICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1PdXRwdXRQb3J0U2V0dGluZ3NIYXZlQ2hhbmdlZCA9IHRydWU7Ci0gICAgICAgICAgICAgICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgICAgICAgICAgICAgIGlmIChzY2FsZS54SGVpZ2h0ICE9IDB4MDEwMDAwKSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgbU91dHB1dEZvcm1hdC0+c2V0SW50MzIoa0tleURpc3BsYXlIZWlnaHQsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoKGJvdHRvbSAgLSB0b3AgKyAxKSAqIHNjYWxlLnhIZWlnaHQpID4+IDE2KTsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBtT3V0cHV0UG9ydFNldHRpbmdzSGF2ZUNoYW5nZWQgPSB0cnVlOwotICAgICAgICAgICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgfQotICAgICAgICAgICAgYnJlYWs7Ci0gICAgICAgIH0KLQotI2lmIDAKLSAgICAgICAgY2FzZSBPTVhfRXZlbnRCdWZmZXJGbGFnOgotICAgICAgICB7Ci0gICAgICAgICAgICBDT0RFQ19MT0dWKCJFVkVOVF9CVUZGRVJfRkxBRyglbGQpIiwgZGF0YTEpOwotCi0gICAgICAgICAgICBpZiAoZGF0YTEgPT0ga1BvcnRJbmRleE91dHB1dCkgewotICAgICAgICAgICAgICAgIG1Ob01vcmVPdXRwdXREYXRhID0gdHJ1ZTsKLSAgICAgICAgICAgIH0KLSAgICAgICAgICAgIGJyZWFrOwotICAgICAgICB9Ci0jZW5kaWYKLQotICAgICAgICBkZWZhdWx0OgotICAgICAgICB7Ci0gICAgICAgICAgICBDT0RFQ19MT0dWKCJFVkVOVCglZCwgJWxkLCAlbGQpIiwgZXZlbnQsIGRhdGExLCBkYXRhMik7Ci0gICAgICAgICAgICBicmVhazsKLSAgICAgICAgfQotICAgIH0KLX0KLQotdm9pZCBPTVhDb2RlYzo6b25DbWRDb21wbGV0ZShPTVhfQ09NTUFORFRZUEUgY21kLCBPTVhfVTMyIGRhdGEpIHsKLSAgICBzd2l0Y2ggKGNtZCkgewotICAgICAgICBjYXNlIE9NWF9Db21tYW5kU3RhdGVTZXQ6Ci0gICAgICAgIHsKLSAgICAgICAgICAgIG9uU3RhdGVDaGFuZ2UoKE9NWF9TVEFURVRZUEUpZGF0YSk7Ci0gICAgICAgICAgICBicmVhazsKLSAgICAgICAgfQotCi0gICAgICAgIGNhc2UgT01YX0NvbW1hbmRQb3J0RGlzYWJsZToKLSAgICAgICAgewotICAgICAgICAgICAgT01YX1UzMiBwb3J0SW5kZXggPSBkYXRhOwotICAgICAgICAgICAgQ09ERUNfTE9HVigiUE9SVF9ESVNBQkxFRCglbGQpIiwgcG9ydEluZGV4KTsKLQotICAgICAgICAgICAgQ0hFQ0sobVN0YXRlID09IEVYRUNVVElORyB8fCBtU3RhdGUgPT0gUkV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2V0dGluZ3NIYXZlQ2hhbmdlZCA9IGZvcm1hdENoYW5nZWQ7Ci0gICAgICAgICAgICAgICAgfQotCi0gICAgICAgICAgICAgICAgc3RhdHVzX3QgZXJyID0gZW5hYmxlUG9ydEFzeW5jKHBvcnRJbmRleCk7Ci0gICAgICAgICAgICAgICAgaWYgKGVyciAhPSBPSykgewotICAgICAgICAgICAgICAgICAgICBDT0RFQ19MT0dFKCJlbmFibGVQb3J0QXN5bmMoJWxkKSBmYWlsZWQgKGVyciA9ICVkKSIsIHBvcnRJbmRleCwgZXJyKTsKLSAgICAgICAgICAgICAgICAgICAgc2V0U3RhdGUoRVJST1IpOwotICAgICAgICAgICAgICAgIH0gZWxzZSB7Ci0gICAgICAgICAgICAgICAgICAgIGVyciA9IGFsbG9jYXRlQnVmZmVyc09uUG9ydChwb3J0SW5kZXgpOwotICAgICAgICAgICAgICAgICAgICBpZiAoZXJyICE9IE9LKSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICBDT0RFQ19MT0dFKCJhbGxvY2F0ZUJ1ZmZlcnNPblBvcnQgZmFpbGVkIChlcnIgPSAlZCkiLCBlcnIpOwotICAgICAgICAgICAgICAgICAgICAgICAgc2V0U3RhdGUoRVJST1IpOwotICAgICAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgfQotICAgICAgICAgICAgYnJlYWs7Ci0gICAgICAgIH0KLQotICAgICAgICBjYXNlIE9NWF9Db21tYW5kUG9ydEVuYWJsZToKLSAgICAgICAgewotICAgICAgICAgICAgT01YX1UzMiBwb3J0SW5kZXggPSBkYXRhOwotICAgICAgICAgICAgQ09ERUNfTE9HVigiUE9SVF9FTkFCTEVEKCVsZCkiLCBwb3J0SW5kZXgpOwotCi0gICAgICAgICAgICBDSEVDSyhtU3RhdGUgPT0gRVhFQ1VUSU5HIHx8IG1TdGF0ZSA9PSBSRUNPTkZJR1VSSU5HKTsKLSAgICAgICAgICAgIENIRUNLX0VRKChpbnQpbVBvcnRTdGF0dXNbcG9ydEluZGV4XSwgKGludClFTkFCTElORyk7Ci0KLSAgICAgICAgICAgIG1Qb3J0U3RhdHVzW3BvcnRJbmRleF0gPSBFTkFCTEVEOwotCi0gICAgICAgICAgICBpZiAobVN0YXRlID09IFJFQ09ORklHVVJJTkcpIHsKLSAgICAgICAgICAgICAgICBDSEVDS19FUShwb3J0SW5kZXgsIChPTVhfVTMyKWtQb3J0SW5kZXhPdXRwdXQpOwotCi0gICAgICAgICAgICAgICAgc2V0U3RhdGUoRVhFQ1VUSU5HKTsKLQotICAgICAgICAgICAgICAgIGZpbGxPdXRwdXRCdWZmZXJzKCk7Ci0gICAgICAgICAgICB9Ci0gICAgICAgICAgICBicmVhazsKLSAgICAgICAgfQotCi0gICAgICAgIGNhc2UgT01YX0NvbW1hbmRGbHVzaDoKLSAgICAgICAgewotICAgICAgICAgICAgT01YX1UzMiBwb3J0SW5kZXggPSBkYXRhOwotCi0gICAgICAgICAgICBDT0RFQ19MT0dWKCJGTFVTSF9ET05FKCVsZCkiLCBwb3J0SW5kZXgpOwotCi0gICAgICAgICAgICBDSEVDS19FUSgoaW50KW1Qb3J0U3RhdHVzW3BvcnRJbmRleF0sIChpbnQpU0hVVFRJTkdfRE9XTik7Ci0gICAgICAgICAgICBtUG9ydFN0YXR1c1twb3J0SW5kZXhdID0gRU5BQkxFRDsKLQotICAgICAgICAgICAgQ0hFQ0tfRVEoY291bnRCdWZmZXJzV2VPd24obVBvcnRCdWZmZXJzW3BvcnRJbmRleF0pLAotICAgICAgICAgICAgICAgICAgICAgbVBvcnRCdWZmZXJzW3BvcnRJbmRleF0uc2l6ZSgpKTsKLQotICAgICAgICAgICAgaWYgKG1Ta2lwQ3V0QnVmZmVyICYmIG1Qb3J0U3RhdHVzW2tQb3J0SW5kZXhPdXRwdXRdID09IEVOQUJMRUQpIHsKLSAgICAgICAgICAgICAgICBtU2tpcEN1dEJ1ZmZlci0+Y2xlYXIoKTsKLSAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgaWYgKG1TdGF0ZSA9PSBSRUNPTkZJR1VSSU5HKSB7Ci0gICAgICAgICAgICAgICAgQ0hFQ0tfRVEocG9ydEluZGV4LCAoT01YX1UzMilrUG9ydEluZGV4T3V0cHV0KTsKLQotICAgICAgICAgICAgICAgIGRpc2FibGVQb3J0QXN5bmMocG9ydEluZGV4KTsKLSAgICAgICAgICAgIH0gZWxzZSBpZiAobVN0YXRlID09IEVYRUNVVElOR19UT19JRExFKSB7Ci0gICAgICAgICAgICAgICAgaWYgKG1Qb3J0U3RhdHVzW2tQb3J0SW5kZXhJbnB1dF0gPT0gRU5BQkxFRAotICAgICAgICAgICAgICAgICAgICAmJiBtUG9ydFN0YXR1c1trUG9ydEluZGV4T3V0cHV0XSA9PSBFTkFCTEVEKSB7Ci0gICAgICAgICAgICAgICAgICAgIENPREVDX0xPR1YoIkZpbmlzaGVkIGZsdXNoaW5nIGJvdGggcG9ydHMsIG5vdyBjb21wbGV0aW5nICIKLSAgICAgICAgICAgICAgICAgICAgICAgICAidHJhbnNpdGlvbiBmcm9tIEVYRUNVVElORyB0byBJRExFLiIpOwotCi0gICAgICAgICAgICAgICAgICAgIG1Qb3J0U3RhdHVzW2tQb3J0SW5kZXhJbnB1dF0gPSBTSFVUVElOR19ET1dOOwotICAgICAgICAgICAgICAgICAgICBtUG9ydFN0YXR1c1trUG9ydEluZGV4T3V0cHV0XSA9IFNIVVRUSU5HX0RPV047Ci0KLSAgICAgICAgICAgICAgICAgICAgc3RhdHVzX3QgZXJyID0KLSAgICAgICAgICAgICAgICAgICAgICAgIG1PTVgtPnNlbmRDb21tYW5kKG1Ob2RlLCBPTVhfQ29tbWFuZFN0YXRlU2V0LCBPTVhfU3RhdGVJZGxlKTsKLSAgICAgICAgICAgICAgICAgICAgQ0hFQ0tfRVEoZXJyLCAoc3RhdHVzX3QpT0spOwotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgIH0gZWxzZSB7Ci0gICAgICAgICAgICAgICAgLy8gV2UncmUgZmx1c2hpbmcgYm90aCBwb3J0cyBpbiBwcmVwYXJhdGlvbiBmb3Igc2Vla2luZy4KLQotICAgICAgICAgICAgICAgIGlmIChtUG9ydFN0YXR1c1trUG9ydEluZGV4SW5wdXRdID09IEVOQUJMRUQKLSAgICAgICAgICAgICAgICAgICAgJiYgbVBvcnRTdGF0dXNba1BvcnRJbmRleE91dHB1dF0gPT0gRU5BQkxFRCkgewotICAgICAgICAgICAgICAgICAgICBDT0RFQ19MT0dWKCJGaW5pc2hlZCBmbHVzaGluZyBib3RoIHBvcnRzLCBub3cgY29udGludWluZyBmcm9tIgotICAgICAgICAgICAgICAgICAgICAgICAgICIgc2Vlay10aW1lLiIpOwotCi0gICAgICAgICAgICAgICAgICAgIC8vIFdlIGltcGxpY2l0bHkgcmVzdW1lIHB1bGxpbmcgb24gb3VyIHVwc3RyZWFtIHNvdXJjZS4KLSAgICAgICAgICAgICAgICAgICAgbVBhdXNlZCA9IGZhbHNlOwotCi0gICAgICAgICAgICAgICAgICAgIGRyYWluSW5wdXRCdWZmZXJzKCk7Ci0gICAgICAgICAgICAgICAgICAgIGZpbGxPdXRwdXRCdWZmZXJzKCk7Ci0gICAgICAgICAgICAgICAgfQotCi0gICAgICAgICAgICAgICAgaWYgKG1PdXRwdXRQb3J0U2V0dGluZ3NDaGFuZ2VkUGVuZGluZykgewotICAgICAgICAgICAgICAgICAgICBDT0RFQ19MT0dWKAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICJIb25vcmluZyBkZWZlcnJlZCBvdXRwdXQgcG9ydCBzZXR0aW5ncyBjaGFuZ2UuIik7Ci0KLSAgICAgICAgICAgICAgICAgICAgbU91dHB1dFBvcnRTZXR0aW5nc0NoYW5nZWRQZW5kaW5nID0gZmFsc2U7Ci0gICAgICAgICAgICAgICAgICAgIG9uUG9ydFNldHRpbmdzQ2hhbmdlZChrUG9ydEluZGV4T3V0cHV0KTsKLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgIGJyZWFrOwotICAgICAgICB9Ci0KLSAgICAgICAgZGVmYXVsdDoKLSAgICAgICAgewotICAgICAgICAgICAgQ09ERUNfTE9HVigiQ01EX0NPTVBMRVRFKCVkLCAlbGQpIiwgY21kLCBkYXRhKTsKLSAgICAgICAgICAgIGJyZWFrOwotICAgICAgICB9Ci0gICAgfQotfQotCi12b2lkIE9NWENvZGVjOjpvblN0YXRlQ2hhbmdlKE9NWF9TVEFURVRZUEUgbmV3U3RhdGUpIHsKLSAgICBDT0RFQ19MT0dWKCJvblN0YXRlQ2hhbmdlICVkIiwgbmV3U3RhdGUpOwotCi0gICAgc3dpdGNoIChuZXdTdGF0ZSkgewotICAgICAgICBjYXNlIE9NWF9TdGF0ZUlkbGU6Ci0gICAgICAgIHsKLSAgICAgICAgICAgIENPREVDX0xPR1YoIk5vdyBJZGxlLiIpOwotICAgICAgICAgICAgaWYgKG1TdGF0ZSA9PSBMT0FERURfVE9fSURMRSkgewotICAgICAgICAgICAgICAgIHN0YXR1c190IGVyciA9IG1PTVgtPnNlbmRDb21tYW5kKAotICAgICAgICAgICAgICAgICAgICAgICAgbU5vZGUsIE9NWF9Db21tYW5kU3RhdGVTZXQsIE9NWF9TdGF0ZUV4ZWN1dGluZyk7Ci0KLSAgICAgICAgICAgICAgICBDSEVDS19FUShlcnIsIChzdGF0dXNfdClPSyk7Ci0KLSAgICAgICAgICAgICAgICBzZXRTdGF0ZShJRExFX1RPX0VYRUNVVElORyk7Ci0gICAgICAgICAgICB9IGVsc2UgewotICAgICAgICAgICAgICAgIENIRUNLX0VRKChpbnQpbVN0YXRlLCAoaW50KUVYRUNVVElOR19UT19JRExFKTsKLQotICAgICAgICAgICAgICAgIENIRUNLX0VRKAotICAgICAgICAgICAgICAgICAgICBjb3VudEJ1ZmZlcnNXZU93bihtUG9ydEJ1ZmZlcnNba1BvcnRJbmRleElucHV0XSksCi0gICAgICAgICAgICAgICAgICAgIG1Qb3J0QnVmZmVyc1trUG9ydEluZGV4SW5wdXRdLnNpemUoKSk7Ci0KLSAgICAgICAgICAgICAgICBDSEVDS19FUSgKLSAgICAgICAgICAgICAgICAgICAgY291bnRCdWZmZXJzV2VPd24obVBvcnRCdWZmZXJzW2tQb3J0SW5kZXhPdXRwdXRdKSwKLSAgICAgICAgICAgICAgICAgICAgbVBvcnRCdWZmZXJzW2tQb3J0SW5kZXhPdXRwdXRdLnNpemUoKSk7Ci0KLSAgICAgICAgICAgICAgICBzdGF0dXNfdCBlcnIgPSBtT01YLT5zZW5kQ29tbWFuZCgKLSAgICAgICAgICAgICAgICAgICAgICAgIG1Ob2RlLCBPTVhfQ29tbWFuZFN0YXRlU2V0LCBPTVhfU3RhdGVMb2FkZWQpOwotCi0gICAgICAgICAgICAgICAgQ0hFQ0tfRVEoZXJyLCAoc3RhdHVzX3QpT0spOwotCi0gICAgICAgICAgICAgICAgZXJyID0gZnJlZUJ1ZmZlcnNPblBvcnQoa1BvcnRJbmRleElucHV0KTsKLSAgICAgICAgICAgICAgICBDSEVDS19FUShlcnIsIChzdGF0dXNfdClPSyk7Ci0KLSAgICAgICAgICAgICAgICBlcnIgPSBmcmVlQnVmZmVyc09uUG9ydChrUG9ydEluZGV4T3V0cHV0KTsKLSAgICAgICAgICAgICAgICBDSEVDS19FUShlcnIsIChzdGF0dXNfdClPSyk7Ci0KLSAgICAgICAgICAgICAgICBtUG9ydFN0YXR1c1trUG9ydEluZGV4SW5wdXRdID0gRU5BQkxFRDsKLSAgICAgICAgICAgICAgICBtUG9ydFN0YXR1c1trUG9ydEluZGV4T3V0cHV0XSA9IEVOQUJMRUQ7Ci0KLSAgICAgICAgICAgICAgICBpZiAoKG1GbGFncyAmIGtFbmFibGVHcmFsbG9jVXNhZ2VQcm90ZWN0ZWQpICYmCi0gICAgICAgICAgICAgICAgICAgICAgICBtTmF0aXZlV2luZG93ICE9IE5VTEwpIHsKLSAgICAgICAgICAgICAgICAgICAgLy8gV2UgcHVzaCBlbm91Z2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otICAgICAgICAgICAgLy8gdGhpcyBwb2ludC4gVGhpcyBlbnN1cmVzIHRoYXQgdGhpcyBvbl9tZXNzYWdlIGNhbGwgcmV0dXJucywKLSAgICAgICAgICAgIC8vIHJlbGVhc2VzIHRoZSBsb2NrIGFuZCA6OmluaXQgY2FuIG5vdGljZSB0aGUgc3RhdGUgY2hhbmdlIGFuZAotICAgICAgICAgICAgLy8gaXRzZWxmIHJldHVybi4KLSAgICAgICAgICAgIGJyZWFrOwotICAgICAgICB9Ci0KLSAgICAgICAgY2FzZSBPTVhfU3RhdGVMb2FkZWQ6Ci0gICAgICAgIHsKLSAgICAgICAgICAgIENIRUNLX0VRKChpbnQpbVN0YXRlLCAoaW50KUlETEVfVE9fTE9BREVEKTsKLQotICAgICAgICAgICAgQ09ERUNfTE9HVigiTm93IExvYWRlZC4iKTsKLQotICAgICAgICAgICAgc2V0U3RhdGUoTE9BREVEKTsKLSAgICAgICAgICAgIGJyZWFrOwotICAgICAgICB9Ci0KLSAgICAgICAgY2FzZSBPTVhfU3RhdGVJbnZhbGlkOgotICAgICAgICB7Ci0gICAgICAgICAgICBzZXRTdGF0ZShFUlJPUik7Ci0gICAgICAgICAgICBicmVhazsKLSAgICAgICAgfQotCi0gICAgICAgIGRlZmF1bHQ6Ci0gICAgICAgIHsKLSAgICAgICAgICAgIENIRUNLKCEic2hvdWxkIG5vdCBiZSBoZXJlLiIpOwotICAgICAgICAgICAgYnJlYWs7Ci0gICAgICAgIH0KLSAgICB9Ci19Ci0KLS8vIHN0YXRpYwotc2l6ZV90IE9NWENvZGVjOjpjb3VudEJ1ZmZlcnNXZU93bihjb25zdCBWZWN0b3I8QnVmZmVySW5mbz4gJmJ1ZmZlcnMpIHsKLSAgICBzaXplX3QgbiA9IDA7Ci0gICAgZm9yIChzaXplX3QgaSA9IDA7IGkgPCBidWZmZXJzLnNpemUoKTsgKytpKSB7Ci0gICAgICAgIGlmIChidWZmZXJzW2ldLm1TdGF0dXMgIT0gT1dORURfQllfQ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SBlbHNlIHsKLSAgICAgICAgVmVjdG9yPEJ1ZmZlckluZm8+ICpidWZmZXJzID0gJm1Qb3J0QnVmZmVyc1trUG9ydEluZGV4SW5wdXRdOwotICAgICAgICBmb3IgKHNpemVfdCBpID0gMDsgaSA8IGJ1ZmZlcnMtPnNpemUoKTsgKytpKSB7Ci0gICAgICAgICAgICBCdWZmZXJJbmZvICppbmZvID0gJmJ1ZmZlcnMtPmVkaXRJdGVtQXQoaSk7Ci0KLSAgICAgICAgICAgIGlmIChpbmZvLT5tU3RhdHVzICE9IE9XTkVEX0JZX1VTKSB7Ci0gICAgICAgICAgICAgICAgY29udGludWU7Ci0gICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgIGlmICghZHJhaW5JbnB1dEJ1ZmZlcihpbmZvKSkgewotICAgICAgICAgICAgICAgIGJyZWFrOwotICAgICAgICAgICAgfQotCi0gICAgICAgICAgICBpZiAobUZsYWdzICYga09ubHlTdWJtaXRPbmVJbnB1dEJ1ZmZlckF0T25lVGltZSkgewotICAgICAgICAgICAgICAgIGJyZWFrOwotICAgICAgICAgICAgfQotICAgICAgICB9Ci0gICAgfQotfQotCi1ib29sIE9NWENvZGVjOjpkcmFpbkFueUlucHV0QnVmZmVyKCkgewotICAgIHJldHVybiBkcmFpbklucHV0QnVmZmVyKChCdWZmZXJJbmZvICopTlVMTCk7Ci19Ci0KLU9NWENvZGVjOjpCdWZmZXJJbmZvICpPTVhDb2RlYzo6ZmluZElucHV0QnVmZmVyQnlEYXRhUG9pbnRlcih2b2lkICpwdHIpIHsKLSAgICBWZWN0b3I8QnVmZmVySW5mbz4gKmluZm9zID0gJm1Qb3J0QnVmZmVyc1trUG9ydEluZGV4SW5wdXRdOwotICAgIGZvciAoc2l6ZV90IGkgPSAwOyBpIDwgaW5mb3MtPnNpemUoKTsgKytpKSB7Ci0gICAgICAgIEJ1ZmZlckluZm8gKmluZm8gPSAmaW5mb3MtPmVkaXRJdGVtQXQoaSk7Ci0KLSAgICAgICAgaW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RhdGEuc2l6ZSgpKSB7Ci0gICAgICAgIENIRUNLKCEobUZsYWdzICYga1VzZVNlY3VyZUlucHV0QnVmZmVycykpOwotCi0gICAgICAgIGNvbnN0IENvZGVjU3BlY2lmaWNEYXRhICpzcGVjaWZpYyA9Ci0gICAgICAgICAgICBtQ29kZWNTcGVjaWZpY0RhdGFbbUNvZGVjU3BlY2lmaWNEYXRhSW5kZXhdOwotCi0gICAgICAgIHNpemVfdCBzaXplID0gc3BlY2lmaWMtPm1TaXplOwotCi0gICAgICAgIGlmICghc3RyY2FzZWNtcChNRURJQV9NSU1FVFlQRV9WSURFT19BVkMsIG1NSU1FKQotICAgICAgICAgICAgICAgICYmICEobVF1aXJrcyAmIGtXYW50c05BTEZyYWdtZW50cykpIHsKLSAgICAgICAgICAgIHN0YXRpYyBjb25zdCB1aW50OF90IGtOQUxTdGFydENvZGVbNF0gPQotICAgICAgICAgICAgICAgICAgICB7IDB4MDAsIDB4MDAsIDB4MDAsIDB4MDEgfTsKLQotICAgICAgICAgICAgQ0hFQ0soaW5mby0+bVNpemUgPj0gc3BlY2lmaWMtPm1TaXplICsgNCk7Ci0KLSAgICAgICAgICAgIHNpemUgKz0gNDsKLQotICAgICAgICAgICAgbWVtY3B5KGluZm8tPm1EYXRhLCBrTkFMU3RhcnRDb2RlLCA0KTsKLSAgICAgICAgICAgIG1lbWNweSgodWludDhfdCAqKWluZm8tPm1EYXRhICsgNCwKLSAgICAgICAgICAgICAgICAgICBzcGVjaWZpYy0+bURhdGEsIHNwZWNpZmljLT5tU2l6ZSk7Ci0gICAgICAgIH0gZWxzZSB7Ci0gICAgICAgICAgICBDSEVDSyhpbmZvLT5tU2l6ZSA+PSBzcGVjaWZpYy0+bVNpemUpOwotICAgICAgICAgICAgbWVtY3B5KGluZm8tPm1EYXRhLCBzcGVjaWZpYy0+bURhdGEsIHNwZWNpZmljLT5tU2l6ZSk7Ci0gICAgICAgIH0KLQotICAgICAgICBtTm9Nb3JlT3V0cHV0RGF0YSA9IGZhbHNlOwotCi0gICAgICAgIENPREVDX0xPR1YoImNhbGxpbmcgZW1wdHlCdWZmZXIgd2l0aCBjb2RlYyBzcGVjaWZpYyBkYXRhIik7Ci0KLSAgICAgICAgc3RhdHVzX3QgZXJyID0gbU9NWC0+ZW1wdHlCdWZmZXIoCi0gICAgICAgICAgICAgICAgbU5vZGUsIGluZm8tPm1CdWZmZXIsIDAsIHNpemUsCi0gICAgICAgICAgICAgICAgT01YX0JVRkZFUkZMQUdfRU5ET0ZGUkFNRSB8IE9NWF9CVUZGRVJGTEFHX0NPREVDQ09ORklHLAotICAgICAgICAgICAgICAgIDApOwotICAgICAgICBDSEVDS19FUShlcnIsIChzdGF0dXNfdClPSyk7Ci0KLSAgICAgICAgaW5mby0+bVN0YXR1cyA9IE9XTkVEX0JZX0NPTVBPTkVOVDsKLQotICAgICAgICArK21Db2RlY1NwZWNpZmljRGF0YUluZGV4OwotICAgICAgICByZXR1cm4gdHJ1ZTsKLSAgICB9Ci0KLSAgICBpZiAobVBhdXNlZCkgewotICAgICAgICByZXR1cm4gZmFsc2U7Ci0gICAgfQotCi0gICAgc3RhdHVzX3QgZXJyOwotCi0gICAgYm9vbCBzaWduYWxFT1MgPSBmYWxzZTsKLSAgICBpbnQ2NF90IHRpbWVzdGFtcFVzID0gMDsKLQotICAgIHNpemVfdCBvZmZzZXQgPSAwOwotICAgIGludDMyX3QgbiA9IDA7Ci0KLQotICAgIGZvciAoOzspIHsKLSAgICAgICAgTWVkaWFCdWZmZXIgKnNyY0J1ZmZlcjsKLSAgICAgICAgaWYgKG1TZWVrVGltZVVzID49IDApIHsKLSAgICAgICAgICAgIGlmIChtTGVmdE92ZXJCdWZmZXIpIHsKLSAgICAgICAgICAgICAgICBtTGVmdE92ZXJCdWZmZXItPnJlbGVhc2UoKTsKLSAgICAgICAgICAgICAgICBtTGVmdE92ZXJCdWZmZXIgPSBOVUxMOwotICAgICAgICAgICAgfQotCi0gICAgICAgICAgICBNZWRpYVNvdXJjZTo6UmVhZE9wdGlvbnMgb3B0aW9uczsKLSAgICAgICAgICAgIG9wdGlvbnMuc2V0U2Vla1RvKG1TZWVrVGltZVVzLCBtU2Vla01vZGUpOwotCi0gICAgICAgICAgICBtU2Vla1RpbWVVcyA9IC0xOwotICAgICAgICAgICAgbVNlZWtNb2RlID0gUmVhZE9wdGlvbnM6OlNFRUtfQ0xPU0VTVF9TWU5DOwotICAgICAgICAgICAgbUJ1ZmZlckZpbGxlZC5zaWduYWwoKTsKLQotICAgICAgICAgICAgZXJyID0gbVNvdXJjZS0+cmVhZCgmc3JjQnVmZmVyLCAmb3B0aW9ucyk7Ci0KLSAgICAgICAgICAgIGlmIChlcnIgPT0gT0spIHsKLSAgICAgICAgICAgICAgICBpbnQ2NF90IHRhcmdldFRpbWVVczsKLSAgICAgICAgICAgICAgICBpZiAoc3JjQnVmZmVyLT5tZXRhX2RhdGEoKS0+ZmluZEludDY0KAotICAgICAgICAgICAgICAgICAgICAgICAgICAgIGtLZXlUYXJnZXRUaW1lLCAmdGFyZ2V0VGltZVVzKQotICAgICAgICAgICAgICAgICAgICAgICAgJiYgdGFyZ2V0VGltZVVzID49IDApIHsKLSAgICAgICAgICAgICAgICAgICAgQ09ERUNfTE9HVigidGFyZ2V0VGltZVVzID0gJWxsZCB1cyIsIHRhcmdldFRpbWVVcyk7Ci0gICAgICAgICAgICAgICAgICAgIG1UYXJnZXRUaW1lVXMgPSB0YXJnZXRUaW1lVXM7Ci0gICAgICAgICAgICAgICAgfSBlbHNlIHsKLSAgICAgICAgICAgICAgICAgICAgbVRhcmdldFRpbWVVcyA9IC0xOwotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgIH0KLSAgICAgICAgfSBlbHNlIGlmIChtTGVmdE92ZXJCdWZmZXIpIHsKLSAgICAgICAgICAgIHNyY0J1ZmZlciA9IG1MZWZ0T3ZlckJ1ZmZlcjsKLSAgICAgICAgICAgIG1MZWZ0T3ZlckJ1ZmZlciA9IE5VTEw7Ci0KLSAgICAgICAgICAgIGVyciA9IE9LOwotICAgICAgICB9IGVsc2UgewotICAgICAgICAgICAgZXJyID0gbVNvdXJjZS0+cmVhZCgmc3JjQnVmZmVyKTsKLSAgICAgICAgfQotCi0gICAgICAgIGlmIChlcnIgIT0gT0spIHsKLSAgICAgICAgICAgIHNpZ25hbEVPUyA9IHRydWU7Ci0gICAgICAgICAgICBtRmluYWxTdGF0dXMgPSBlcnI7Ci0gICAgICAgICAgICBtU2lnbmFsbGVkRU9TID0gdHJ1ZTsKLSAgICAgICAgICAgIG1CdWZmZXJGaWxsZWQuc2lnbmFsKCk7Ci0gICAgICAgICAgICBicmVhazsKLSAgICAgICAgfQotCi0gICAgICAgIGlmIChtRmxhZ3MgJiBrVXNlU2VjdXJlSW5wdXRCdWZmZXJzKSB7Ci0gICAgICAgICAgICBpbmZvID0gZmluZElucHV0QnVmZmVyQnlEYXRhUG9pbnRlcihzcmNCdWZmZXItPmRhdGEoKSk7Ci0gICAgICAgICAgICBDSEVDSyhpbmZvICE9IE5VTEwpOwotICAgICAgICB9Ci0KLSAgICAgICAgc2l6ZV90IHJlbWFpbmluZ0J5dGVzID0gaW5mby0+bVNpemUgLSBvZmZzZXQ7Ci0KLSAgICAgICAgaWYgKHNyY0J1ZmZlci0+cmFuZ2VfbGVuZ3RoKCkgPiByZW1haW5pbmdCeXRlcykgewotICAgICAgICAgICAgaWYgKG9mZnNldCA9PSAwKSB7Ci0gICAgICAgICAgICAgICAgQ09ERUNfTE9HRSgKLSAgICAgICAgICAgICAgICAgICAgICJDb2RlYydzIGlucHV0IGJ1ZmZlcnMgYXJlIHRvbyBzbWFsbCB0byBhY2NvbW9kYXRlICIKLSAgICAgICAgICAgICAgICAgICAgICJidWZmZXIgcmVhZCBmcm9tIHNvdXJjZSAoaW5mby0+bVNpemUgPSAlZCwgc3JjTGVuZ3RoID0gJWQpIiwKLSAgICAgICAgICAgICAgICAgICAgIGluZm8tPm1TaXplLCBzcmNCdWZmZXItPnJhbmdlX2xlbmd0aCgpKTsKLQotICAgICAgICAgICAgICAgIHNyY0J1ZmZlci0+cmVsZWFzZSgpOwotICAgICAgICAgICAgICAgIHNyY0J1ZmZlciA9IE5VTEw7Ci0KLSAgICAgICAgICAgICAgICBzZXRTdGF0ZShFUlJPUik7Ci0gICAgICAgICAgICAgICAgcmV0dXJuIGZhbHNlOwotICAgICAgICAgICAgfQotCi0gICAgICAgICAgICBtTGVmdE92ZXJCdWZmZXIgPSBzcmNCdWZmZXI7Ci0gICAgICAgICAgICBicmVhazsKLSAgICAgICAgfQotCi0gICAgICAgIGJvb2wgcmVsZWFzZUJ1ZmZlciA9IHRydWU7Ci0gICAgICAgIGlmIChtSXNFbmNvZGVyICYmIChtUXVpcmtzICYga0F2b2lkTWVtY29weUlucHV0UmVjb3JkaW5nRnJhbWVzKSkgewotICAgICAgICAgICAgQ0hFQ0sobU9NWExpdmVzTG9jYWxseSAmJiBvZmZzZXQgPT0gMCk7Ci0KLSAgICAgICAgICAgIE9NWF9CVUZGRVJIRUFERVJUWVBFICpoZWFkZXIgPQotICAgICAgICAgICAgICAgIChPTVhfQlVGRkVSSEVBREVSVFlQRSAqKWluZm8tPm1CdWZmZXI7Ci0KLSAgICAgICAgICAgIENIRUNLKGhlYWRlci0+cEJ1ZmZlciA9PSBpbmZvLT5tRGF0YSk7Ci0KLSAgICAgICAgICAgIGhlYWRlci0+cEJ1ZmZlciA9Ci0gICAgICAgICAgICAgICAgKE9NWF9VOCAqKXNyY0J1ZmZlci0+ZGF0YSgpICsgc3JjQnVmZmVyLT5yYW5nZV9vZmZzZXQoKTsKLQotICAgICAgICAgICAgcmVsZWFzZUJ1ZmZlciA9IGZhbHNlOwotICAgICAgICAgICAgaW5mby0+bU1lZGlhQnVmZmVyID0gc3JjQnVmZmVyOwotICAgICAgICB9IGVsc2UgewotICAgICAgICAgICAgaWYgKG1GbGFncyAmIGtTdG9yZU1ldGFEYXRhSW5WaWRlb0J1ZmZlcnMpIHsKLSAgICAgICAgICAgICAgICByZWxlYXNlQnVmZmVyID0gZmFsc2U7Ci0gICAgICAgICAgICAgICAgaW5mby0+bU1lZGlhQnVmZmVyID0gc3JjQnVmZmVyOwotICAgICAgICAgICAgfQotCi0gICAgICAgICAgICBpZiAobUZsYWdzICYga1VzZVNlY3VyZUlucHV0QnVmZmVycykgewotICAgICAgICAgICAgICAgIC8vIERhdGEgaW4gImluZm8iIGlzIGFscmVhZHkgcHJvdmlkZWQgYXQgdGhpcyB0aW1lLgotCi0gICAgICAgICAgICAgICAgcmVsZWFzZUJ1ZmZlciA9IGZhbHNlOwotCi0gICAgICAgICAgICAgICAgQ0hFQ0soaW5mby0+bU1lZGlhQnVmZmVyID09IE5VTEwpOwotICAgICAgICAgICAgICAgIGluZm8tPm1NZWRpYUJ1ZmZlciA9IHNyY0J1ZmZlcjsKLSAgICAgICAgICAgIH0gZWxzZSB7Ci0gICAgICAgICAgICAgICAgQ0hFQ0soc3JjQnVmZmVyLT5kYXRhKCkgIT0gTlVMTCkgOwotICAgICAgICAgICAgICAgIG1lbWNweSgodWludDhfdCAqKWluZm8tPm1EYXRhICsgb2Zmc2V0LAotICAgICAgICAgICAgICAgICAgICAgICAgKGNvbnN0IHVpbnQ4X3QgKilzcmNCdWZmZXItPmRhdGEoKQotICAgICAgICAgICAgICAgICAgICAgICAgICAgICsgc3JjQnVmZmVyLT5yYW5nZV9vZmZzZXQoKSwKLSAgICAgICAgICAgICAgICAgICAgICAgIHNyY0J1ZmZlci0+cmFuZ2VfbGVuZ3RoKCkpOwotICAgICAgICAgICAgfQotICAgICAgICB9Ci0KLSAgICAgICAgaW50NjRfdCBsYXN0QnVmZmVyVGltZVVzOwotICAgICAgICBDSEVDSyhzcmNCdWZmZXItPm1ldGFfZGF0YSgpLT5maW5kSW50NjQoa0tleVRpbWUsICZsYXN0QnVmZmVyVGltZVVzKSk7Ci0gICAgICAgIENIRUNLKGxhc3RCdWZmZXJUaW1lVXMgPj0gMCk7Ci0gICAgICAgIGlmIChtSXNFbmNvZGVyICYmIG1Jc1ZpZGVvKSB7Ci0gICAgICAgICAgICBtRGVjb2RpbmdUaW1lTGlzdC5wdXNoX2JhY2sobGFzdEJ1ZmZlclRpbWVVcyk7Ci0gICAgICAgIH0KLQotICAgICAgICBpZiAob2Zmc2V0ID09IDApIHsKLSAgICAgICAgICAgIHRpbWVzdGFtcFVzID0gbGFzdEJ1ZmZlclRpbWVVczsKLSAgICAgICAgfQotCi0gICAgICAgIG9mZnNldCArPSBzcmNCdWZmZXItPnJhbmdlX2xlbmd0aCgpOwotCi0gICAgICAgIGlmICghc3RyY2FzZWNtcChNRURJQV9NSU1FVFlQRV9BVURJT19WT1JCSVMsIG1NSU1FKSkgewotICAgICAgICAgICAgQ0hFQ0soIShtUXVpcmtzICYga1N1cHBvcnRzTXVsdGlwbGVGcmFtZXNQZXJJbnB1dEJ1ZmZlcikpOwotICAgICAgICAgICAgQ0hFQ0tfR0UoaW5mby0+bVNpemUsIG9mZnNldCArIHNpemVvZihpbnQzMl90KSk7Ci0KLSAgICAgICAgICAgIGludDMyX3QgbnVtUGFnZVNhbXBsZXM7Ci0gICAgICAgICAgICBpZiAoIXNyY0J1ZmZlci0+bWV0YV9kYXRhKCktPmZpbmRJbnQzMigKLSAgICAgICAgICAgICAgICAgICAgICAgIGtLZXlWYWxpZFNhbXBsZXMsICZudW1QYWdlU2FtcGxlcykpIHsKLSAgICAgICAgICAgICAgICBudW1QYWdlU2FtcGxlcyA9IC0xOwotICAgICAgICAgICAgfQotCi0gICAgICAgICAgICBtZW1jcHkoKHVpbnQ4X3QgKilpbmZvLT5tRGF0YSArIG9mZnNldCwKLSAgICAgICAgICAgICAgICAgICAmbnVtUGFnZVNhbXBsZXMsCi0gICAgICAgICAgICAgICAgICAgc2l6ZW9mKG51bVBhZ2VTYW1wbGVzKSk7Ci0KLSAgICAgICAgICAgIG9mZnNldCArPSBzaXplb2YobnVtUGFnZVNhbXBsZXMpOwotICAgICAgICB9Ci0KLSAgICAgICAgaWYgKHJlb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ICAgbU5vZGUsIE9NWF9JbmRleFBhcmFtQXVkaW9QY20sICZwY21QYXJhbXMsIHNpemVvZihwY21QYXJhbXMpKTsKLQotICAgIENIRUNLX0VRKGVyciwgKHN0YXR1c190KU9LKTsKLX0KLQotc3RhdGljIE9NWF9BVURJT19BTVJCQU5ETU9ERVRZUEUgcGlja01vZGVGcm9tQml0UmF0ZShib29sIGlzQU1SV0IsIGludDMyX3QgYnBzKSB7Ci0gICAgaWYgKGlzQU1SV0IpIHsKLSAgICAgICAgaWYgKGJwcyA8PSA2NjAwKSB7Ci0gICAgICAgICAgICByZXR1cm4gT01YX0FVRElPX0FNUkJhbmRNb2RlV0IwOwotICAgICAgICB9IGVsc2UgaWYgKGJwcyA8PSA4ODUwKSB7Ci0gICAgICAgICAgICByZXR1cm4gT01YX0FVRElPX0FNUkJhbmRNb2RlV0IxOwotICAgICAgICB9IGVsc2UgaWYgKGJwcyA8PSAxMjY1MCkgewotICAgICAgICAgICAgcmV0dXJuIE9NWF9BVURJT19BTVJCYW5kTW9kZVdCMjsKLSAgICAgICAgfSBlbHNlIGlmIChicHMgPD0gMTQyNTApIHsKLSAgICAgICAgICAgIHJldHVybiBPTVhfQVVESU9fQU1SQmFuZE1vZGVXQjM7Ci0gICAgICAgIH0gZWxzZSBpZiAoYnBzIDw9IDE1ODUwKSB7Ci0gICAgICAgICAgICByZXR1cm4gT01YX0FVRElPX0FNUkJhbmRNb2RlV0I0OwotICAgICAgICB9IGVsc2UgaWYgKGJwcyA8PSAxODI1MCkgewotICAgICAgICAgICAgcmV0dXJuIE9NWF9BVURJT19BTVJCYW5kTW9kZVdCNTsKLSAgICAgICAgfSBlbHNlIGlmIChicHMgPD0gMTk4NTApIHsKLSAgICAgICAgICAgIHJldHVybiBPTVhfQVVESU9fQU1SQmFuZE1vZGVXQjY7Ci0gICAgICAgIH0gZWxzZSBpZiAoYnBzIDw9IDIzMDUwKSB7Ci0gICAgICAgICAgICByZXR1cm4gT01YX0FVRElPX0FNUkJhbmRNb2RlV0I3OwotICAgICAgICB9Ci0KLSAgICAgICAgLy8gMjM4NTAgYnBzCi0gICAgICAgIHJldHVybiBPTVhfQVVESU9fQU1SQmFuZE1vZGVXQjg7Ci0gICAgfSBlbHNlIHsgIC8vIEFNUk5CCi0gICAgICAgIGlmIChicHMgPD0gNDc1MCkgewotICAgICAgICAgICAgcmV0dXJuIE9NWF9BVURJT19BTVJCYW5kTW9kZU5CMDsKLSAgICAgICAgfSBlbHNlIGlmIChicHMgPD0gNTE1MCkgewotICAgICAgICAgICAgcmV0dXJuIE9NWF9BVURJT19BTVJCYW5kTW9kZU5CMTsKLSAgICAgICAgfSBlbHNlIGlmIChicHMgPD0gNTkwMCkgewotICAgICAgICAgICAgcmV0dXJuIE9NWF9BVURJT19BTVJCYW5kTW9kZU5CMjsKLSAgICAgICAgfSBlbHNlIGlmIChicHMgPD0gNjcwMCkgewotICAgICAgICAgICAgcmV0dXJuIE9NWF9BVURJT19BTVJCYW5kTW9kZU5CMzsKLSAgICAgICAgfSBlbHNlIGlmIChicHMgPD0gNzQwMCkgewotICAgICAgICAgICAgcmV0dXJuIE9NWF9BVURJT19BTVJCYW5kTW9kZU5CNDsKLSAgICAgICAgfSBlbHNlIGlmIChicHMgPD0gNzk1MCkgewotICAgICAgICAgICAgcmV0dXJuIE9NWF9BVURJT19BTVJCYW5kTW9kZU5CNTsKLSAgICAgICAgfSBlbHNlIGlmIChicHMgPD0gMTAyMDApIHsKLSAgICAgICAgICAgIHJldHVybiBPTVhfQVVESU9fQU1SQmFuZE1vZGVOQjY7Ci0gICAgICAgIH0KLQotICAgICAgICAvLyAxMjIwMCBicHMKLSAgICAgICAgcmV0dXJuIE9NWF9BVURJT19BTVJCYW5kTW9kZU5CNzsKLSAgICB9Ci19Ci0KLXZvaWQgT01YQ29kZWM6OnNldEFNUkZvcm1hdChib29sIGlzV0FNUiwgaW50MzJfdCBiaXRSYXRlKSB7Ci0gICAgT01YX1UzMiBwb3J0SW5kZXggPSBtSXN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bGluZyBjb2RlCi0gICAgICAgICAgICBpc0Vycm9yID0gdHJ1ZTsKLSAgICAgICAgfQotCi0gICAgICAgIGNhc2UgRVhFQ1VUSU5HOgotICAgICAgICB7Ci0gICAgICAgICAgICBzZXRTdGF0ZShFWEVDVVRJTkdfVE9fSURMRSk7Ci0KLSAgICAgICAgICAgIGlmIChtUXVpcmtzICYga1JlcXVpcmVzRmx1c2hCZWZvcmVTaHV0ZG93bikgewotICAgICAgICAgICAgICAgIENPREVDX0xPR1YoIlRoaXMgY29tcG9uZW50IHJlcXVpcmVzIGEgZmx1c2ggYmVmb3JlIHRyYW5zaXRpb25pbmcgIgotICAgICAgICAgICAgICAgICAgICAgImZyb20gRVhFQ1VUSU5HIHRvIElETEUuLi4iKTsKLQotICAgICAgICAgICAgICAgIGJvb2wgZW11bGF0ZUlucHV0Rmx1c2hDb21wbGV0aW9uID0KLSAgICAgICAgICAgICAgICAgICAgIWZsdXNoUG9ydEFzeW5jKGtQb3J0SW5kZXhJbnB1dCk7Ci0KLSAgICAgICAgICAgICAgICBib29sIGVtdWxhdGVPdXRwdXRGbHVzaENvbXBsZXRpb24gPQotICAgICAgICAgICAgICAgICAgICAhZmx1c2hQb3J0QXN5bmMoa1BvcnRJbmRleE91dHB1dCk7Ci0KLSAgICAgICAgICAgICAgICBpZiAoZW11bGF0ZUlucHV0Rmx1c2hDb21wbGV0aW9uKSB7Ci0gICAgICAgICAgICAgICAgICAgIG9uQ21kQ29tcGxldGUoT01YX0NvbW1hbmRGbHVzaCwga1BvcnRJbmRleElucHV0KTsKLSAgICAgICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgICAgICBpZiAoZW11bGF0ZU91dHB1dEZsdXNoQ29tcGxldGlvbikgewotICAgICAgICAgICAgICAgICAgICBvbkNtZENvbXBsZXRlKE9NWF9Db21tYW5kRmx1c2gsIGtQb3J0SW5kZXhPdXRwdXQpOwotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgIH0gZWxzZSB7Ci0gICAgICAgICAgICAgICAgbVBvcnRTdGF0dXNba1BvcnRJbmRleElucHV0XSA9IFNIVVRUSU5HX0RPV047Ci0gICAgICAgICAgICAgICAgbVBvcnRTdGF0dXNba1BvcnRJbmRleE91dHB1dF0gPSBTSFVUVElOR19ET1dOOwotCi0gICAgICAgICAgICAgICAgc3RhdHVzX3QgZXJyID0KLSAgICAgICAgICAgICAgICAgICAgbU9NWC0+c2VuZENvbW1hbmQobU5vZGUsIE9NWF9Db21tYW5kU3RhdGVTZXQsIE9NWF9TdGF0ZUlkbGUpOwotICAgICAgICAgICAgICAgIENIRUNLX0VRKGVyciwgKHN0YXR1c190KU9LKTsKLSAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgd2hpbGUgKG1TdGF0ZSAhPSBMT0FERUQgJiYgbVN0YXRlICE9IEVSUk9SKSB7Ci0gICAgICAgICAgICAgICAgbUFzeW5jQ29tcGxldGlvbi53YWl0KG1Mb2NrKTsKLSAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgaWYgKGlzRXJyb3IpIHsKLSAgICAgICAgICAgICAgICAvLyBXZSB3ZXJlIGluIHRoZSBFUlJPUiBzdGF0ZSBjb21pbmcgaW4sIHNvIHJlc3RvcmUgdGhhdCBub3cKLSAgICAgICAgICAgICAgICAvLyB0aGF0IHdlJ3ZlIGlkbGVkIHRoZSBPTVggY29tcG9uZW50LgotICAgICAgICAgICAgICAgIHNldFN0YXRlKEVSUk9SKTsKLSAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgYnJlYWs7Ci0gICAgICAgIH0KLQotICAgICAgICBkZWZhdWx0OgotICAgICAgICB7Ci0gICAgICAgICAgICBDSEVDSyghInNob3VsZCBub3QgYmUgaGVyZS4iKTsKLSAgICAgICAgICAgIGJyZWFrOwotICAgICAgICB9Ci0gICAgfQotCi0gICAgaWYgKG1MZWZ0T3ZlckJ1ZmZlcikgewotICAgICAgICBtTGVmdE92ZXJCdWZmZXItPnJlbGVhc2UoKTsKLSAgICAgICAgb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UNLKHNlZWtUaW1lVXMgPj0gMCk7Ci0gICAgICAgICAgICBtU2Vla1RpbWVVcyA9IHNlZWtUaW1lVXM7Ci0gICAgICAgICAgICBtU2Vla01vZGUgPSBzZWVrTW9kZTsKLQotICAgICAgICAgICAgLy8gVGhlcmUncyBubyByZWFzb24gdG8gdHJpZ2dlciB0aGUgY29kZSBiZWxvdywgdGhlcmUncwotICAgICAgICAgICAgLy8gbm90aGluZyB0byBmbHVzaCB5ZXQuCi0gICAgICAgICAgICBzZWVraW5nID0gZmFsc2U7Ci0gICAgICAgICAgICBtUGF1c2VkID0gZmFsc2U7Ci0gICAgICAgIH0KLQotICAgICAgICBkcmFpbklucHV0QnVmZmVycygpOwotCi0gICAgICAgIGlmIChtU3RhdGUgPT0gRVhFQ1VUSU5HKSB7Ci0gICAgICAgICAgICAvLyBPdGhlcndpc2UgbVN0YXRlID09IFJFQ09ORklHVVJJTkcgYW5kIHRoaXMgY29kZSB3aWxsIHRyaWdnZXIKLSAgICAgICAgICAgIC8vIGFmdGVyIHRoZSBvdXRwdXQgcG9ydCBpcyByZWVuYWJsZWQuCi0gICAgICAgICAgICBmaWxsT3V0cHV0QnVmZmVycygpOwotICAgICAgICB9Ci0gICAgfQotCi0gICAgaWYgKHNlZWtpbmcpIHsKLSAgICAgICAgd2hpbGUgKG1TdGF0ZSA9PSBSRUNPTkZJR1VSSU5HKSB7Ci0gICAgICAgICAgICBpZiAoKGVyciA9IHdhaXRGb3JCdWZmZXJGaWxsZWRfbCgpKSAhPSBPSykgewotICAgICAgICAgICAgICAgIHJldHVybiBlcnI7Ci0gICAgICAgICAgICB9Ci0gICAgICAgIH0KLQotICAgICAgICBpZiAobVN0YXRlICE9IEVYRUNVVElORykgewotICAgICAgICAgICAgcmV0dXJuIFVOS05PV05fRVJST1I7Ci0gICAgICAgIH0KLQotICAgICAgICBDT0RFQ19MT0dWKCJzZWVraW5nIHRvICVsbGQgdXMgKCUuMmYgc2VjcykiLCBzZWVrVGltZVVzLCB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OwotICAgICAgICAgICAgICAgIGlmICghbWV0YURhdGEtPmZpbmRJbnQzMihrS2V5UmVuZGVyZWQsICZyZW5kZXJlZCkpIHsKLSAgICAgICAgICAgICAgICAgICAgcmVuZGVyZWQgPSAwOwotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICBpZiAoIXJlbmRlcmVkKSB7Ci0gICAgICAgICAgICAgICAgICAgIHN0YXR1c190IGVyciA9IGNhbmNlbEJ1ZmZlclRvTmF0aXZlV2luZG93KGluZm8pOwotICAgICAgICAgICAgICAgICAgICBpZiAoZXJyIDwgMCkgewotICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuOwotICAgICAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgfQotCi0gICAgICAgICAgICAgICAgaW5mby0+bVN0YXR1cyA9IE9XTkVEX0JZX05BVElWRV9XSU5ET1c7Ci0KLSAgICAgICAgICAgICAgICAvLyBEZXF1ZXVlIHRoZSBuZXh0IGJ1ZmZlciBmcm9tIHRoZSBuYXRpdmUgd2luZG93LgotICAgICAgICAgICAgICAgIEJ1ZmZlckluZm8gKm5leHRCdWZJbmZvID0gZGVxdWV1ZUJ1ZmZlckZyb21OYXRpdmVXaW5kb3coKTsKLSAgICAgICAgICAgICAgICBpZiAobmV4dEJ1ZkluZm8gPT0gMCkgewotICAgICAgICAgICAgICAgICAgICByZXR1cm47Ci0gICAgICAgICAgICAgICAgfQotCi0gICAgICAgICAgICAgICAgLy8gR2l2ZSB0aGUgYnVmZmVyIHRvIHRoZSBPTVggbm9kZSB0byBmaWxsLgotICAgICAgICAgICAgICAgIGZpbGxPdXRwdXRCdWZmZXIobmV4dEJ1ZkluZm8pOwotICAgICAgICAgICAgfQotICAgICAgICAgICAgcmV0dXJuOwotICAgICAgICB9Ci0gICAgfQotCi0gICAgQ0hFQ0soISJzaG91bGQgbm90IGJlIGhlcmUuIik7Ci19Ci0KLXN0YXRpYyBjb25zdCBjaGFyICppbWFnZUNvbXByZXNz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luZ1dNViIsCi0gICAgICAgICJPTVhfVklERU9fQ29kaW5nUlYiLAotICAgICAgICAiT01YX1ZJREVPX0NvZGluZ0FWQyIsCi0gICAgICAgICJPTVhfVklERU9fQ29kaW5nTUpQRUciLAotICAgIH07Ci0KLSAgICBzaXplX3QgbnVtTmFtZXMgPSBzaXplb2Yoa05hbWVzKSAvIHNpemVvZihrTmFtZXNbMF0pOwotCi0gICAgaWYgKHR5cGUgPCAwIHx8IChzaXplX3QpdHlwZSA+PSBudW1OYW1lcykgewotICAgICAgICByZXR1cm4gIlVOS05PV04iOwotICAgIH0gZWxzZSB7Ci0gICAgICAgIHJldHVybiBrTmFtZXNbdHlwZV07Ci0gICAgfQotfQotCi1zdGF0aWMgY29uc3QgY2hhciAqYXVkaW9Db2RpbmdUeXBlU3RyaW5nKE9NWF9BVURJT19DT0RJTkdUWVBFIHR5cGUpIHsKLSAgICBzdGF0aWMgY29uc3QgY2hhciAqa05hbWVzW10gPSB7Ci0gICAgICAgICJPTVhfQVVESU9fQ29kaW5nVW51c2VkIiwKLSAgICAgICAgIk9NWF9BVURJT19Db2RpbmdBdXRvRGV0ZWN0IiwKLSAgICAgICAgIk9NWF9BVURJT19Db2RpbmdQQ00iLAotICAgICAgICAiT01YX0FVRElPX0NvZGluZ0FEUENNIiwKLSAgICAgICAgIk9NWF9BVURJT19Db2RpbmdBTVIiLAotICAgICAgICAiT01YX0FVRElPX0NvZGluZ0dTTUZSIiwKLSAgICAgICAgIk9NWF9BVURJT19Db2RpbmdHU01FRlIiLAotICAgICAgICAiT01YX0FVRElPX0NvZGluZ0dTTUhSIiwKLSAgICAgICAgIk9NWF9BVURJT19Db2RpbmdQRENGUiIsCi0gICAgICAgICJPTVhfQVVESU9fQ29kaW5nUERDRUZSIiwKLSAgICAgICAgIk9NWF9BVURJT19Db2RpbmdQRENIUiIsCi0gICAgICAgICJPTVhfQVVESU9fQ29kaW5nVERNQUZSIiwKLSAgICAgICAgIk9NWF9BVURJT19Db2RpbmdURE1BRUZSIiwKLSAgICAgICAgIk9NWF9BVURJT19Db2RpbmdRQ0VMUDgiLAotICAgICAgICAiT01YX0FVRElPX0NvZGluZ1FDRUxQMTMiLAotICAgICAgICAiT01YX0FVRElPX0NvZGluZ0VWUkMiLAotICAgICAgICAiT01YX0FVRElPX0NvZGluZ1NNViIsCi0gICAgICAgICJPTVhfQVVESU9fQ29kaW5nRzcxMSIsCi0gICAgICAgICJPTVhfQVVESU9fQ29kaW5nRzcyMyIsCi0gICAgICAgICJPTVhfQVVESU9fQ29kaW5nRzcyNiIsCi0gICAgICAgICJPTVhfQVVESU9fQ29kaW5nRzcyOSIsCi0gICAgICAgICJPTVhfQVVESU9fQ29kaW5nQUFDIiwKLSAgICAgICAgIk9NWF9BVURJT19Db2RpbmdNUDMiLAotICAgICAgICAiT01YX0FVRElPX0NvZGluZ1NCQyIsCi0gICAgICAgICJPTVhfQVVESU9fQ29kaW5nVk9SQklTIiwKLSAgICAgICAgIk9NWF9BVURJT19Db2RpbmdXTUEiLAotICAgICAgICAiT01YX0FVRElPX0NvZGluZ1JBIiwKLSAgICAgICAgIk9NWF9BVURJT19Db2RpbmdNSURJIiwKLSAgICB9OwotCi0gICAgc2l6ZV90IG51bU5hbWVzID0gc2l6ZW9mKGtOYW1lcykgLyBzaXplb2Yoa05hbWVzWzBdKTsKLQotICAgIGlmICh0eXBlIDwgMCB8fCAoc2l6ZV90KXR5cGUgPj0gbnVtTmFtZXMpIHsKLSAgICAgICAgcmV0dXJuICJVTktOT1dOIjsKLSAgICB9IGVsc2UgewotICAgICAgICByZXR1cm4ga05hbWVzW3R5cGVdOwotICAgIH0KLX0KLQotc3RhdGljIGNvbnN0IGNoYXIgKmF1ZGlvUENNTW9kZVN0cmluZyhPTVhfQVVESU9fUENNTU9ERVRZUEUgdHlwZSkgewotICAgIHN0YXRpYyBjb25zdCBjaGFyICprTmFtZXNbXSA9IHsKLSAgICAgICAgIk9NWF9BVURJT19QQ01Nb2RlTGluZWFyIiwKLSA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cpKTsKLQotICAgICAgICAgICAgaWYgKGF1ZGlvRGVmLT5lRW5jb2RpbmcgPT0gT01YX0FVRElPX0NvZGluZ1BDTSkgewotICAgICAgICAgICAgICAgIE9NWF9BVURJT19QQVJBTV9QQ01NT0RFVFlQRSBwYXJhbXM7Ci0gICAgICAgICAgICAgICAgSW5pdE9NWFBhcmFtcygmcGFyYW1zKTsKLSAgICAgICAgICAgICAgICBwYXJhbXMublBvcnRJbmRleCA9IHBvcnRJbmRleDsKLQotICAgICAgICAgICAgICAgIGVyciA9IG1PTVgtPmdldFBhcmFtZXRlcigKLSAgICAgICAgICAgICAgICAgICAgICAgIG1Ob2RlLCBPTVhfSW5kZXhQYXJhbUF1ZGlvUGNtLCAmcGFyYW1zLCBzaXplb2YocGFyYW1zKSk7Ci0gICAgICAgICAgICAgICAgQ0hFQ0tfRVEoZXJyLCAoc3RhdHVzX3QpT0spOwotCi0gICAgICAgICAgICAgICAgcHJpbnRmKCIgIG5TYW1wbGluZ1JhdGUgPSAlbGRcbiIsIHBhcmFtcy5uU2FtcGxpbmdSYXRlKTsKLSAgICAgICAgICAgICAgICBwcmludGYoIiAgbkNoYW5uZWxzID0gJWxkXG4iLCBwYXJhbXMubkNoYW5uZWxzKTsKLSAgICAgICAgICAgICAgICBwcmludGYoIiAgYkludGVybGVhdmVkID0gJWRcbiIsIHBhcmFtcy5iSW50ZXJsZWF2ZWQpOwotICAgICAgICAgICAgICAgIHByaW50ZigiICBuQml0UGVyU2FtcGxlID0gJWxkXG4iLCBwYXJhbXMubkJpdFBlclNhbXBsZSk7Ci0KLSAgICAgICAgICAgICAgICBwcmludGYoIiAgZU51bURhdGEgPSAlc1xuIiwKLSAgICAgICAgICAgICAgICAgICAgICAgcGFyYW1zLmVOdW1EYXRhID09IE9NWF9OdW1lcmljYWxEYXRhU2lnbmVkCi0gICAgICAgICAgICAgICAgICAgICAgICA/ICJzaWduZWQiIDogInVuc2lnbmVkIik7Ci0KLSAgICAgICAgICAgICAgICBwcmludGYoIiAgZVBDTU1vZGUgPSAlc1xuIiwgYXVkaW9QQ01Nb2RlU3RyaW5nKHBhcmFtcy5lUENNTW9kZSkpOwotICAgICAgICAgICAgfSBlbHNlIGlmIChhdWRpb0RlZi0+ZUVuY29kaW5nID09IE9NWF9BVURJT19Db2RpbmdBTVIpIHsKLSAgICAgICAgICAgICAgICBPTVhfQVVESU9fUEFSQU1fQU1SVFlQRSBhbXI7Ci0gICAgICAgICAgICAgICAgSW5pdE9NWFBhcmFtcygmYW1yKTsKLSAgICAgICAgICAgICAgICBhbXIublBvcnRJbmRleCA9IHBvcnRJbmRleDsKLQotICAgICAgICAgICAgICAgIGVyciA9IG1PTVgtPmdldFBhcmFtZXRlcigKLSAgICAgICAgICAgICAgICAgICAgICAgIG1Ob2RlLCBPTVhfSW5kZXhQYXJhbUF1ZGlvQW1yLCAmYW1yLCBzaXplb2YoYW1yKSk7Ci0gICAgICAgICAgICAgICAgQ0hFQ0tfRVEoZXJyLCAoc3RhdHVzX3QpT0spOwotCi0gICAgICAgICAgICAgICAgcHJpbnRmKCIgIG5DaGFubmVscyA9ICVsZFxuIiwgYW1yLm5DaGFubmVscyk7Ci0gICAgICAgICAgICAgICAgcHJpbnRmKCIgIGVBTVJCYW5kTW9kZSA9ICVzXG4iLAotICAgICAgICAgICAgICAgICAgICAgICAgYW1yQmFuZE1vZGVTdHJpbmcoYW1yLmVBTVJCYW5kTW9kZSkpOwotICAgICAgICAgICAgICAgIHByaW50ZigiICBlQU1SRnJhbWVGb3JtYXQgPSAlc1xuIiwKLSAgICAgICAgICAgICAgICAgICAgICAgIGFtckZyYW1lRm9ybWF0U3RyaW5nKGFtci5lQU1SRnJhbWVGb3JtYXQpKTsKLSAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgYnJlYWs7Ci0gICAgICAgIH0KLQotICAgICAgICBkZWZhdWx0OgotICAgICAgICB7Ci0gICAgICAgICAgICBwcmludGYoIiAgLy8gVW5rbm93blxuIik7Ci0gICAgICAgICAg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AgICAgICAgICAgICAgICBwYXJhbXMublBvcnRJbmRleCA9IGtQb3J0SW5kZXhPdXRwdXQ7Ci0KLSAgICAgICAgICAgICAgICBlcnIgPSBtT01YLT5nZXRQYXJhbWV0ZXIoCi0gICAgICAgICAgICAgICAgICAgICAgICBtTm9kZSwgT01YX0luZGV4UGFyYW1BdWRpb1BjbSwgJnBhcmFtcywgc2l6ZW9mKHBhcmFtcykpOwotICAgICAgICAgICAgICAgIENIRUNLX0VRKGVyciwgKHN0YXR1c190KU9LKTsKLQotICAgICAgICAgICAgICAgIENIRUNLX0VRKChpbnQpcGFyYW1zLmVOdW1EYXRhLCAoaW50KU9NWF9OdW1lcmljYWxEYXRhU2lnbmVkKTsKLSAgICAgICAgICAgICAgICBDSEVDS19FUShwYXJhbXMubkJpdFBlclNhbXBsZSwgMTZ1KTsKLSAgICAgICAgICAgICAgICBDSEVDS19FUSgoaW50KXBhcmFtcy5lUENNTW9kZSwgKGludClPTVhfQVVESU9fUENNTW9kZUxpbmVhcik7Ci0KLSAgICAgICAgICAgICAgICBpbnQzMl90IG51bUNoYW5uZWxzLCBzYW1wbGVSYXRlOwotICAgICAgICAgICAgICAgIGlucHV0Rm9ybWF0LT5maW5kSW50MzIoa0tleUNoYW5uZWxDb3VudCwgJm51bUNoYW5uZWxzKTsKLSAgICAgICAgICAgICAgICBpbnB1dEZvcm1hdC0+ZmluZEludDMyKGtLZXlTYW1wbGVSYXRlLCAmc2FtcGxlUmF0ZSk7Ci0KLSAgICAgICAgICAgICAgICBpZiAoKE9NWF9VMzIpbnVtQ2hhbm5lbHMgIT0gcGFyYW1zLm5DaGFubmVscykgewotICAgICAgICAgICAgICAgICAgICBBTE9HVigiQ29kZWMgb3V0cHV0cyBhIGRpZmZlcmVudCBudW1iZXIgb2YgY2hhbm5lbHMgdGhhbiAiCi0gICAgICAgICAgICAgICAgICAgICAgICAgInRoZSBpbnB1dCBzdHJlYW0gY29udGFpbnMgKGNvbnRhaW5zICVkIGNoYW5uZWxzLCAiCi0gICAgICAgICAgICAgICAgICAgICAgICAgImNvZGVjIG91dHB1dHMgJWxkIGNoYW5uZWxzKS4iLAotICAgICAgICAgICAgICAgICAgICAgICAgIG51bUNoYW5uZWxzLCBwYXJhbXMubkNoYW5uZWxzKTsKLSAgICAgICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgICAgICBpZiAoc2FtcGxlUmF0ZSAhPSAoaW50MzJfdClwYXJhbXMublNhbXBsaW5nUmF0ZSkgewotICAgICAgICAgICAgICAgICAgICBBTE9HVigiQ29kZWMgb3V0cHV0cyBhdCBkaWZmZXJlbnQgc2FtcGxpbmcgcmF0ZSB0aGFuICIKLSAgICAgICAgICAgICAgICAgICAgICAgICAid2hhdCB0aGUgaW5wdXQgc3RyZWFtIGNvbnRhaW5zIChjb250YWlucyBkYXRhIGF0ICIKLSAgICAgICAgICAgICAgICAgICAgICAgICAiJWQgSHosIGNvZGVjIG91dHB1dHMgJWx1IEh6KSIsCi0gICAgICAgICAgICAgICAgICAgICAgICAgc2FtcGxlUmF0ZSwgcGFyYW1zLm5TYW1wbGluZ1JhdGUpOwotICAgICAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgICAgIG1PdXRwdXRGb3JtYXQtPnNldENTdHJpbmcoCi0gICAgICAgICAgICAgICAgICAgICAgICBrS2V5TUlNRVR5cGUsIE1FRElBX01JTUVUWVBFX0FVRElPX1JBVyk7Ci0KLSAgICAgICAgICAgICAgICAvLyBVc2UgdGhlIGNvZGVjLWFkdmVydGlzZWQgbnVtYmVyIG9mIGNoYW5uZWxzLCBhcyBzb21lCi0gICAgICAgICAgICAgICAgLy8gY29kZWNzIGFwcGVhciB0byBvdXRwdXQgc3RlcmVvIGV2ZW4gaWYgdGhlIGlucHV0IGRhdGEgaXMKLSAgICAgICAgICAgICAgICAvLyBtb25vLiBJZiB3ZSBrbm93IHRoZSBjb2RlYyBsaWVzIGFib3V0IHRoaXMgaW5mb3JtYXRpb24sCi0gICAgICAgICAgICAgICAgLy8gdXNlIHRoZSBhY3R1YWwgbnVtYmVyIG9mIGNoYW5uZWxzIGluc3RlYWQuCi0gICAgICAgICAgICAgICAgbU91dHB1dEZvcm1hdC0+c2V0SW50MzIoCi0gICAgICAgICAgICAgICAgICAgICAgICBrS2V5Q2hhbm5lbENvdW50LAotICAgICAgICAgICAgICAgICAgICAgICAgKG1RdWlya3MgJiBrRGVjb2RlckxpZXNBYm91dE51bWJlck9mQ2hhbm5lbHMpCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgPyBudW1DaGFubmVscyA6IHBhcmFtcy5uQ2hhbm5lbHMpOwotCi0gICAgICAgICAgICAgICAgbU91dHB1dEZvcm1hdC0+c2V0SW50MzIoa0tleVNhbXBsZVJhdGUsIHBhcmFtcy5uU2FtcGxpbmdSYXRlKTsKLSAgICAgICAgICAgIH0gZWxzZSBpZiAoYXVkaW9fZGVmLT5lRW5jb2RpbmcgPT0gT01YX0FVRElPX0NvZGluZ0FNUikgewotICAgICAgICAgICAgICAgIE9NWF9BVURJT19QQVJBTV9BTVJUWVBFIGFtcjsKLSAgICAgICAgICAgICAgICBJbml0T01YUGFyYW1zKCZhbXIpOwotICAgICAgICAgICAgICAgIGFtci5uUG9ydEluZGV4ID0ga1BvcnRJbmRleE91dHB1dDsKLQotICAgICAgICAgICAgICAgIGVyciA9IG1PTVgtPmdldFBhcmFtZXRlcigKLSAgICAgICAgICAgICAgICAgICAgICAgIG1Ob2RlLCBPTVhfSW5kZXhQYXJhbUF1ZGlvQW1yLCAmYW1yLCBzaXplb2YoYW1yKSk7Ci0gICAgICAgICAgICAgICAgQ0hFQ0tfRVEoZXJyLCAoc3RhdHVzX3QpT0spOwotCi0gICAgICAgICAgICAgICAgQ0hFQ0tfRVEoYW1yLm5DaGFubmVscywgMXUpOwotICAgICAgICAgICAgICAgIG1PdXRwdXRGb3JtYXQtPnNldEludDMyKGtLZXlDaGFubmVsQ291bnQsIDEpOwotCi0gICAgICAgICAgICAgICAgaWYgKGFtci5lQU1SQmFuZE1vZGUgPj0gT01YX0FVRElPX0FNUkJhbmRNb2RlTkIwCi0gICAgICAgICAgICAgICAgICAgICYmIGFtci5lQU1SQmFuZE1vZGUgPD0gT01YX0FVRElPX0FNUkJhbmRNb2RlTkI3KSB7Ci0gICAgICAgICAgICAgICAgICAgIG1PdXRwdXRGb3JtYXQtPnNldENTdHJpbmcoCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAga0tleU1JTUVUeXBlLCBNRURJQV9NSU1FVFlQRV9BVURJT19BTVJfTkIpOwotICAgICAgICAgICAgICAgICAgICBtT3V0cHV0Rm9ybWF0LT5zZXRJbnQzMihrS2V5U2FtcGxlUmF0ZSwgODAwMCk7Ci0gICAgICAgICAgICAgICAgfSBlbHNlIGlmIChhbXIuZUFNUkJhbmRNb2RlID49IE9NWF9BVURJT19BTVJCYW5kTW9kZVdCMAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIGFtci5lQU1SQmFuZE1vZGUgPD0gT01YX0FVRElPX0FNUkJhbmRNb2RlV0I4KSB7Ci0gICAgICAgICAgICAgICAgICAgIG1PdXRwdXRGb3JtYXQtPnNldENTdHJpbmcoCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAga0tleU1JTUVUeXBlLCBNRURJQV9NSU1FVFlQRV9BVURJT19BTVJfV0IpOwotICAgICAgICAgICAgICAgICAgICBtT3V0cHV0Rm9ybWF0LT5zZXRJbnQzMihrS2V5U2FtcGxlUmF0ZSwgMTYwMDApOwotICAgICAgICAgICAgICAgIH0gZWxzZSB7Ci0gICAgICAgICAgICAgICAgICAgIENIRUNLKCEiVW5rbm93biBBTVIgYmFuZCBtb2RlLiIpOwotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgIH0gZWxzZSBpZiAoYXVkaW9fZGVmLT5lRW5jb2RpbmcgPT0gT01YX0FVRElPX0NvZGluZ0FBQykgewotICAgICAgICAgICAgICAgIG1PdXRwdXRGb3JtYXQtPnNldENTdHJpbmcoCi0gICAgICAgICAgICAgICAgICAgICAgICBrS2V5TUlNRVR5cGUsIE1FRElBX01JTUVUWVBFX0FVRElPX0FBQyk7Ci0gICAgICAgICAgICAgICAgaW50MzJfdCBudW1DaGFubmVscywgc2FtcGxlUmF0ZSwgYml0UmF0ZTsKLSAgICAgICAgICAgICAgICBpbnB1dEZvcm1hdC0+ZmluZEludDMyKGtLZXlDaGFubmVsQ291bnQsICZudW1DaGFubmVscyk7Ci0gICAgICAgICAgICAgICAgaW5wdXRGb3JtYXQtPmZpbmRJbnQzMihrS2V5U2FtcGxlUmF0ZSwgJnNhbXBsZVJhdGUpOwotICAgICAgICAgICAgICAgIGlucHV0Rm9ybWF0LT5maW5kSW50MzIoa0tleUJpdFJhdGUsICZiaXRSYXRlKTsKLSAgICAgICAgICAgICAgICBtT3V0cHV0Rm9ybWF0LT5zZXRJbnQzMihrS2V5Q2hhbm5lbENvdW50LCBudW1DaGFubmVscyk7Ci0gICAgICAgICAgICAgICAgbU91dHB1dEZvcm1hdC0+c2V0SW50MzIoa0tleVNhbXBsZVJhdGUsIHNhbXBsZVJhdGUpOwotICAgICAgICAgICAgICAgIG1PdXRwdXRGb3JtYXQtPnNldEludDMyKGtLZXlCaXRSYXRlLCBiaXRSYXRlKTsKLSAgICAgICAgICAgIH0gZWxzZSB7Ci0gICAgICAgICAgICAgICAgQ0hFQ0soISJTaG91bGQgbm90IGJlIGhlcmUuIFVua25vd24gYXVkaW8gZW5jb2RpbmcuIik7Ci0gICAgICAgICAgICB9Ci0gICAgICAgICAgICBicmVhazsKLSAgICAgICAgfQotCi0gICAgICAgIGNhc2UgT01YX1BvcnREb21haW5WaWRlbzoKLSAgICAgICAgewotICAgICAgICAgICAgT01YX1ZJREVPX1BPUlRERUZJTklUSU9OVFlQRSAqdmlkZW9fZGVmID0gJmRlZi5mb3JtYXQudmlkZW87Ci0KLSAgICAgICAgICAgIGlmICh2aWRlb19kZWYtPmVDb21wcmVzc2lvbkZvcm1hdCA9PSBPTVhfVklERU9fQ29kaW5nVW51c2VkKSB7Ci0gICAgICAgICAgICAgICAgbU91dHB1dEZvcm1hdC0+c2V0Q1N0cmluZygKLSAgICAgICAgICAgICAgICAgICAgICAgIGtLZXlNSU1FVHlwZSwgTUVESUFfTUlNRVRZUEVfVklERU9fUkFXKTsKLSAgICAgICAgICAgIH0gZWxzZSBpZiAodmlkZW9fZGVmLT5lQ29tcHJlc3Npb25Gb3JtYXQgPT0gT01YX1ZJREVPX0NvZGluZ01QRUc0KSB7Ci0gICAgICAgICAgICAgICAgbU91dHB1dEZvcm1hdC0+c2V0Q1N0cmluZygKLSAgICAgICAgICAgICAgICAgICAgICAgIGtLZXlNSU1FVHlwZSwgTUVESUFfTUlNRVRZUEVfVklERU9fTVBFRzQpOwotICAgICAgICAgICAgfSBlbHNlIGlmICh2aWRlb19kZWYtPmVDb21wcmVzc2lvbkZvcm1hdCA9PSBPTVhfVklERU9fQ29kaW5nSDI2MykgewotICAgICAgICAgICAgICAgIG1PdXRwdXRGb3JtYXQtPnNldENTdHJpbmcoCi0gICAgICAgICAgICAgICAgICAgICAgICBrS2V5TUlNRVR5cGUsIE1FRElBX01JTUVUWVBFX1ZJREVPX0gyNjMpOwotICAgICAgICAgICAgfSBlbHNlIGlmICh2aWRlb19kZWYtPmVDb21wcmVzc2lvbkZvcm1hdCA9PSBPTVhfVklERU9fQ29kaW5nQVZDKSB7Ci0gICAgICAgICAgICAgICAgbU91dHB1dEZvcm1hdC0+c2V0Q1N0cmluZygKLSAgICAgICAgICAgICAgICAgICAgICAgIGtLZXlNSU1FVHlwZSwgTUVESUFfTUlNRVRZUEVfVklERU9fQVZDKTsKLSAgICAgICAgICAgIH0gZWxzZSB7Ci0gICAgICAgICAgICAgICAgQ0hFQ0soISJVbmtub3duIGNvbXByZXNzaW9uIGZvcm1hdC4iKTsKLSAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgbU91dHB1dEZvcm1hdC0+c2V0SW50MzIoa0tleVdpZHRoLCB2aWRlb19kZWYtPm5GcmFtZVdpZHRoKTsKLSAgICAgICAgICAgIG1PdXRwdXRGb3JtYXQtPnNldEludDMyKGtLZXlIZWlnaHQsIHZpZGVvX2RlZi0+bkZyYW1lSGVpZ2h0KTsKLSAgICAgICAgICAgIG1PdXRwdXRGb3JtYXQtPnNldEludDMyKGtLZXlDb2xvckZvcm1hdCwgdmlkZW9fZGVmLT5lQ29sb3JGb3JtYXQpOwotCi0gICAgICAgICAgICBpZiAoIW1Jc0VuY29kZXIpIHsKLSAgICAgICAgICAgICAgICBPTVhfQ09ORklHX1JFQ1RUWVBFIHJlY3Q7Ci0gICAgICAgICAgICAgICAgSW5pdE9NWFBhcmFtcygmcmVjdCk7Ci0gICAgICAgICAgICAgICAgcmVjdC5uUG9ydEluZGV4ID0ga1BvcnRJbmRleE91dHB1dDsKLSAgICAgICAgICAgICAgICBzdGF0dXNfdCBlcnIgPQotICAgICAgICAgICAgICAgICAgICAgICAgbU9NWC0+Z2V0Q29uZmlnKAotICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1Ob2RlLCBPTVhfSW5kZXhDb25maWdDb21tb25PdXRwdXRDcm9wLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICZyZWN0LCBzaXplb2YocmVjdCkpOwotCi0gICAgICAgICAgICAgICAgQ09ERUNfTE9HSSgKLSAgICAgICAgICAgICAgICAgICAgICAgICJ2aWRlbyBkaW1lbnNpb25zIGFyZSAlbGQgeCAlbGQiLAotICAgICAgICAgICAgICAgICAgICAgICAgdmlkZW9fZGVmLT5uRnJhbWVXaWR0aCwgdmlkZW9fZGVmLT5uRnJhbWVIZWlnaHQpOwotCi0gICAgICAgICAgICAgICAgaWYgKGVyciA9PSBPSykgewotICAgICAgICAgICAgICAgICAgICBDSEVDS19HRShyZWN0Lm5MZWZ0LCAwKTsKLSAgICAgICAgICAgICAgICAgICAgQ0hFQ0tfR0UocmVjdC5uVG9wLCAwKTsKLSAgICAgICAgICAgICAgICAgICAgQ0hFQ0tfR0UocmVjdC5uV2lkdGgsIDB1KTsKLSAgICAgICAgICAgICAgICAgICAgQ0hFQ0tfR0UocmVjdC5uSGVpZ2h0LCAwdSk7Ci0gICAgICAgICAgICAgICAgICAgIENIRUNLX0xFKHJlY3QubkxlZnQgKyByZWN0Lm5XaWR0aCAtIDEsIHZpZGVvX2RlZi0+bkZyYW1lV2lkdGgpOwotICAgICAgICAgICAgICAgICAgICBDSEVDS19MRShyZWN0Lm5Ub3AgKyByZWN0Lm5IZWlnaHQgLSAxLCB2aWRlb19kZWYtPm5GcmFtZUhlaWdodCk7Ci0KLSAgICAgICAgICAgICAgICAgICAgbU91dHB1dEZvcm1hdC0+c2V0UmVjdCgKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBrS2V5Q3JvcFJlY3QsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgcmVjdC5uTGVmdCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICByZWN0Lm5Ub3AsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgcmVjdC5uTGVmdCArIHJlY3QubldpZHRoIC0gMSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICByZWN0Lm5Ub3AgKyByZWN0Lm5IZWlnaHQgLSAxKTsKLQotICAgICAgICAgICAgICAgICAgICBDT0RFQ19MT0dJKAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICJDcm9wIHJlY3QgaXMgJWxkIHggJWxkIEAgKCVsZCwgJWxkKSIsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgcmVjdC5uV2lkdGgsIHJlY3QubkhlaWdodCwgcmVjdC5uTGVmdCwgcmVjdC5uVG9wKTsKLSAgICAgICAgICAgICAgICB9IGVsc2UgewotICAgICAgICAgICAgICAgICAgICBtT3V0cHV0Rm9ybWF0LT5zZXRSZWN0KAotICAgICAgICAgICAgICAgICAgICAgICAgICAgIGtLZXlDcm9wUmVjdCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAwLCAwLAotICAgICAgICAgICAgICAgICAgICAgICAgIC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aWxpdGllcyAqY2FwcyA9ICZyZXN1bHRzLT5lZGl0SXRlbUF0KHJlc3VsdHMtPnNpemUoKSAtIDEpOwotICAgICAgICAgICAgY2Fwcy0+bUNvbXBvbmVudE5hbWUgPSBjb21wb25lbnROYW1lOwotICAgICAgICAgICAgY29udGludWU7Ci0gICAgICAgIH0KLQotICAgICAgICBzcDxPTVhDb2RlY09ic2VydmVyPiBvYnNlcnZlciA9IG5ldyBPTVhDb2RlY09ic2VydmVyOwotICAgICAgICBJT01YOjpub2RlX2lkIG5vZGU7Ci0gICAgICAgIHN0YXR1c190IGVyciA9IG9teC0+YWxsb2NhdGVOb2RlKGNvbXBvbmVudE5hbWUsIG9ic2VydmVyLCAmbm9kZSk7Ci0KLSAgICAgICAgaWYgKGVyciAhPSBPSykgewotICAgICAgICAgICAgY29udGludWU7Ci0gICAgICAgIH0KLQotICAgICAgICBPTVhDb2RlYzo6c2V0Q29tcG9uZW50Um9sZShvbXgsIG5vZGUsICFxdWVyeURlY29kZXJzLCBtaW1lKTsKLQotICAgICAgICByZXN1bHRzLT5wdXNoKCk7Ci0gICAgICAgIENvZGVjQ2FwYWJpbGl0aWVzICpjYXBzID0gJnJlc3VsdHMtPmVkaXRJdGVtQXQocmVzdWx0cy0+c2l6ZSgpIC0gMSk7Ci0gICAgICAgIGNhcHMtPm1Db21wb25lbnROYW1lID0gY29tcG9uZW50TmFtZTsKLQotICAgICAgICBPTVhfVklERU9fUEFSQU1fUFJPRklMRUxFVkVMVFlQRSBwYXJhbTsKLSAgICAgICAgSW5pdE9NWFBhcmFtcygmcGFyYW0pOwotCi0gICAgICAgIHBhcmFtLm5Qb3J0SW5kZXggPSBxdWVyeURlY29kZXJzID8gMCA6IDE7Ci0KLSAgICAgICAgZm9yIChwYXJhbS5uUHJvZmlsZUluZGV4ID0gMDs7ICsrcGFyYW0ublByb2ZpbGVJbmRleCkgewotICAgICAgICAgICAgZXJyID0gb214LT5nZXRQYXJhbWV0ZXIoCi0gICAgICAgICAg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WNlSW5kZXg7IGkgPCBtQ3VycmVudFBhZ2UubU51bVNlZ21lbnRzOyArK2kpIHsKLSAgICAgICAgICAgIHVpbnQ4X3QgbGFjZSA9IG1DdXJyZW50UGFnZS5tTGFjZVtpXTsKLQotICAgICAgICAgICAgcGFja2V0U2l6ZSArPSBsYWNlOwotCi0gICAgICAgICAgICBpZiAobGFjZSA8IDI1NSkgewotICAgICAgICAgICAgICAgIGdvdEZ1bGxQYWNrZXQgPSB0cnVlOwotICAgICAgICAgICAgICAgICsraTsKLSAgICAgICAgICAgICAgICBicmVhazsKLSAgICAgICAgICAgIH0KLSAgICAgICAgfQotCi0gICAgICAgIGlmIChtTmV4dExhY2VJbmRleCA8IG1DdXJyZW50UGFnZS5tTnVtU2VnbWVudHMpIHsKLSAgICAgICAgICAgIG9mZjY0X3QgZGF0YU9mZnNldCA9IG1PZmZzZXQgKyAyNyArIG1DdXJyZW50UGFnZS5tTnVtU2VnbWVudHM7Ci0gICAgICAgICAgICBmb3IgKHNpemVfdCBqID0gMDsgaiA8IG1OZXh0TGFjZUluZGV4OyArK2opIHsKLSAgICAgICAgICAgICAgICBkYXRhT2Zmc2V0ICs9IG1DdXJyZW50UGFnZS5tTGFjZVtqXTsKLSAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgc2l6ZV90IGZ1bGxTaXplID0gcGFja2V0U2l6ZTsKLSAgICAgICAgICAgIGlmIChidWZmZXIgIT0gTlVMTCkgewotICAgICAgICAgICAgICAgIGZ1bGxTaXplICs9IGJ1ZmZlci0+cmFuZ2VfbGVuZ3RoKCk7Ci0gICAgICAgICAgICB9Ci0gICAgICAgICAgICBNZWRpYUJ1ZmZlciAqdG1wID0gbmV3IE1lZGlhQnVmZmVyKGZ1bGxTaXplKTsKLSAgICAgICAgICAgIGlmIChidWZmZXIgIT0gTlVMTCkgewotICAgICAgICAgICAgICAgIG1lbWNweSh0bXAtPmRhdGEoKSwgYnVmZmVyLT5kYXRhKCksIGJ1ZmZlci0+cmFuZ2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gICAgICAgZGF0YU9mZnNldCwKLSAgICAgICAgICAgICAgICAgICAgKHVpbnQ4X3QgKilidWZmZXItPmRhdGEoKSArIGJ1ZmZlci0+cmFuZ2VfbGVuZ3RoKCksCi0gICAgICAgICAgICAgICAgICAgIHBhY2tldFNpemUpOwotCi0gICAgICAgICAgICBpZiAobiA8IChzc2l6ZV90KXBhY2tldFNpemUpIHsKLSAgICAgICAgICAgICAgICBBTE9HVigiZmFpbGVkIHRvIHJlYWQgJWQgYnl0ZXMgYXQgMHglMDE2bGx4LCBnb3QgJWxkIGJ5dGVzIiwKLSAgICAgICAgICAgICAgICAgICAgIHBhY2tldFNpemUsIGRhdGFPZmZzZXQsIG4pOwotICAgICAgICAgICAgICAgIHJldHVybiBFUlJPUl9JTzsKLSAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgYnVmZmVyLT5zZXRfcmFuZ2UoMCwgZnVsbFNpemUpOwotCi0gICAgICAgICAgICBtTmV4dExhY2VJbmRleCA9IGk7Ci0KLSAgICAgICAgICAgIGlmIChnb3RGdWxsUGFja2V0KSB7Ci0gICAgICAgICAgICAgICAgLy8gV2UndmUganVzdCByZWFkIHRoZSBlbnRpcmUgcGFja2V0LgotCi0gICAgICAgICAgICAgICAgaWYgKHRpbWVVcyA+PSAwKSB7Ci0gICAgICAgICAgICAgICAgICAgIGJ1ZmZlci0+bWV0YV9kYXRhKCktPnNldEludDY0KGtLZXlUaW1lLCB0aW1lVXMpOwotICAgICAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgICAgIGlmIChtRmlyc3RQYWNrZXRJblBhZ2UpIHsKLSAgICAgICAgICAgICAgICAgICAgYnVmZmVyLT5tZXRhX2RhdGEoKS0+c2V0SW50MzIoCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAga0tleVZhbGlkU2FtcGxlcywgbUN1cnJlbnRQYWdlU2FtcGxlcyk7Ci0gICAgICAgICAgICAgICAgICAgIG1GaXJzdFBhY2tldEluUGFnZSA9IGZhbHNlOwotICAgICAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgICAgICpvdXQgPSBidWZmZXI7Ci0KLSAgICAgICAgICAgICAgICByZXR1cm4gT0s7Ci0gICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgIC8vIGZhbGwgdGhyb3VnaCwgdGhlIGJ1ZmZlciBub3cgY29udGFpbnMgdGhlIHN0YXJ0IG9mIHRoZSBwYWNrZXQuCi0gICAgICAgIH0KLQotICAgICAgICBDSEVDS19FUShtTmV4dExhY2VJbmRleCwgbUN1cnJlbnRQYWdlLm1OdW1TZWdtZW50cyk7Ci0KLSAgICAgICAgbU9mZnNldCArPSBtQ3VycmVudFBhZ2VTaXplOwotICAgICAgICBzc2l6ZV90IG4gPSByZWFkUGFnZShtT2Zmc2V0LCAmbUN1cnJlbnRQYWdlKTsKLQotICAgICAgICBpZiAobiA8PSAwKSB7Ci0gICAgICAgICAgICBpZiAoYnVmZmVyKSB7Ci0gICAgICAgICAgICAgICAgYnVmZmVyLT5yZWxlYXNlKCk7Ci0gICAgICAgICAgICAgICAgYnVmZmVyID0gTlVMTDsKLSAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgQUxPR1YoInJlYWRQYWdlIHJldHVybmVkICVsZCIsIG4pOwotCi0gICAgICAgICAgICByZXR1cm4gbiA8IDAgPyBuIDogKHN0YXR1c190KUVSUk9SX0VORF9PRl9TVFJFQU07Ci0gICAgICAgIH0KLQotICAgICAgICBtQ3VycmVudFBhZ2VTYW1wbGVzID0KLSAgICAgICAgICAgIG1DdXJyZW50UGFnZS5tR3JhbnVsZVBvc2l0aW9uIC0gbVByZXZHcmFudWxlUG9zaXRpb247Ci0gICAgICAgIG1GaXJzdFBhY2tldEluUGFnZSA9IHRydWU7Ci0KLSAgICAgICAgbVByZXZHcmFudWxlUG9zaXRpb24gPSBtQ3VycmVudFBhZ2UubUdyYW51bGVQb3NpdGlvbjsKLQotICAgICAgICBtQ3VycmVudFBhZ2VTaXplID0gbjsKLSAgICAgICAgbU5leHRMYWNlSW5kZXggPSAwOwotCi0gICAgICAgIGlmIChidWZmZXIgIT0gTlVMTCkgewotICAgICAgICAgICAgaWYgKChtQ3VycmVudFBhZ2UubUZsYWdzICYgMSkgPT0gMCkgewotICAgICAgICAgICAgICAgIC8vIFRoaXMgcGFnZSBkb2VzIG5vdCBjb250aW51ZSB0aGUgcGFja2V0LCBpLmUuIHRoZSBwYWNrZXQKLSAgICAgICAgICAgICAgICAvLyBpcyBhbHJlYWR5IGNvbXBsZXRlLgotCi0gICAgICAgICAgICAgICAgaWYgKHRpbWVVcyA+PSAwKSB7Ci0gICAgICAgICAgICAgICAgICAgIGJ1ZmZlci0+bWV0YV9kYXRhKCktPnNldEludDY0KGtLZXlUaW1lLCB0aW1lVXMpOwotICAgICAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgICAgIGJ1ZmZlci0+bWV0YV9kYXRhKCktPnNldEludDMyKAotICAgICAgICAgICAgICAgICAgICAgICAga0tleVZhbGlkU2FtcGxlcywgbUN1cnJlbnRQYWdlU2FtcGxlcyk7Ci0gICAgICAgICAgICAgICAgbUZpcnN0UGFja2V0SW5QYWdlID0gZmFsc2U7Ci0KLSAgICAgICAgICAgICAgICAqb3V0ID0gYnVmZmVyOwotCi0gICAgICAgICAgICAgICAgcmV0dXJuIE9LOwotICAgICAgICAgICAgfQotICAgICAgICB9Ci0gICAgfQotfQotCi1zdGF0dXNfdCBNeVZvcmJpc0V4dHJhY3Rvcjo6aW5pdCgpIHsKLSAgICBtTWV0YSA9IG5ldyBNZXRhRGF0YTsKLSAgICBtTWV0YS0+c2V0Q1N0cmluZyhrS2V5TUlNRVR5cGUsIE1FRElBX01JTUVUWVBFX0FVRElPX1ZPUkJJUyk7Ci0KLSAgICBNZWRpYUJ1ZmZlciAqcGFja2V0OwotICAgIHN0YXR1c190IGVycjsKLSAgICBpZiAoKGVyciA9IHJlYWROZXh0UGFja2V0KCZwYWNrZXQpKSAhPSBPSykgewotICAgICAgICByZXR1cm4gZXJyOwot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ICAgICAgICBpZiAobVNvdXJjZS0+Z2V0U2l6ZSgmc2l6ZSkgPT0gT0spIHsKLSAgICAgICAgICAgICAgICB1aW50NjRfdCBicHMgPSBhcHByb3hCaXRyYXRlKCk7Ci0gICAgICAgICAgICAgICAgaWYgKGJwcyAhPSAwKSB7Ci0gICAgICAgICAgICAgICAgICAgIG1NZXRhLT5zZXRJbnQ2NChrS2V5RHVyYXRpb24sIHNpemUgKiA4MDAwMDAwbGwgLyBicHMpOwotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgIH0KLSAgICAgICAgICAgIGJyZWFrOwotICAgICAgICB9Ci0KLSAgICAgICAgY2FzZSAzOgotICAgICAgICB7Ci0gICAgICAgICAgICBpZiAoMCAhPSBfdm9yYmlzX3VucGFja19jb21tZW50KCZtVmMsICZiaXRzKSkgewotICAgICAgICAgICAgICAgIHJldHVybiBFUlJPUl9NQUxGT1JNRUQ7Ci0gICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgIHBhcnNlRmlsZU1ldGFEYXRhKCk7Ci0gICAgICAgICAgICBicmVhazsKLSAgICAgICAgfQotCi0gICAgICAgIGNhc2UgNToKLSAgICAgICAgewotICAgICAgICAgICAgaWYgKDAgIT0gX3ZvcmJpc191bnBhY2tfYm9va3MoJm1WaSwgJmJpdHMpKSB7Ci0gICAgICAgICAgICAgICAgcmV0dXJuIEVSUk9SX01BTEZPUk1FRDsKLSAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgbU1ldGEtPnNldERhdGEoa0tleVZvcmJpc0Jvb2tzLCAwLCBkYXRhLCBzaXplKTsKLSAgICAgICAgICAgIGJyZWFrOwotICAgICAgICB9Ci0gICAgfQotCi0gICAgcmV0dXJuIE9LOwotfQotCi11aW50NjRfdCBNeVZvcmJpc0V4dHJhY3Rvcjo6YXBwcm94Qml0cmF0ZSgpIHsKLSAgICBpZiAobVZpLmJpdHJhdGVfbm9taW5hbCAhPSAwKSB7Ci0gICAgICAgIHJldHVybiBtVmkuYml0c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lRJU1QiLCBrS2V5QWxidW1BcnRpc3QgfSwKLSAgICAgICAgeyAiQUxCVU0gQVJUSVNUIiwga0tleUFsYnVtQXJ0aXN0IH0sCi0gICAgICAgIHsgIkNPTVBJTEFUSU9OIiwga0tleUNvbXBpbGF0aW9uIH0sCi0gICAgICAgIHsgIkFMQlVNIiwga0tleUFsYnVtIH0sCi0gICAgICAgIHsgIkNPTVBPU0VSIiwga0tleUNvbXBvc2VyIH0sCi0gICAgICAgIHsgIkdFTlJFIiwga0tleUdlbnJlIH0sCi0gICAgICAgIHsgIkFVVEhPUiIsIGtLZXlBdXRob3IgfSwKLSAgICAgICAgeyAiVFJBQ0tOVU1CRVIiLCBrS2V5Q0RUcmFja051bWJlciB9LAotICAgICAgICB7ICJESVNDTlVNQkVSIiwga0tleURpc2NOdW1iZXIgfSwKLSAgICAgICAgeyAiREFURSIsIGtLZXlEYXRlIH0sCi0gICAgICAgIHsgIkxZUklDSVNUIiwga0tleVdyaXRlciB9LAotICAgICAgICB7ICJNRVRBREFUQV9CTE9DS19QSUNUVVJFIiwga0tleUFsYnVtQXJ0IH0sCi0gICAgICAgIHsgIkFORFJPSURfTE9PUCIsIGtLZXlBdXRvTG9vcCB9LAotICAgIH07Ci0KLSAgICAgICAgZm9yIChzaXplX3QgaiA9IDA7IGogPCBzaXplb2Yoa01hcCkgLyBzaXplb2Yoa01hcFswXSk7ICsraikgewotICAgICAgICAgICAgc2l6ZV90IHRhZ0xlbiA9IHN0cmxlbihrTWFwW2pdLm1UYWcpOwotICAgICAgICAgICAgaWYgKCFzdHJuY2FzZWNtcChrTWFwW2pdLm1UYWcsIGNvbW1lbnQsIHRhZ0xlbikKLSAgICAgICAgICAgICAgICAgICAgJiYgY29tbWVudFt0YWdMZW5dID09ICc9JykgewotICAgICAgICAgICAgICAgIGlmIChrTWFwW2pdLm1LZXkgPT0ga0tleUFsYnVtQXJ0KSB7Ci0gICAgICAgICAgICAgICAgICAgIGV4dHJhY3RBbGJ1bUFydCgKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBmaWxlTWV0YSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAmY29tbWVudFt0YWdMZW4gKyAxXSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb21tZW50TGVuZ3RoIC0gdGFnTGVuIC0gMSk7Ci0gICAgICAgICAgICAgICAgfSBlbHNlIGlmIChrTWFwW2pdLm1LZXkgPT0ga0tleUF1dG9Mb29wKSB7Ci0gICAgICAgICAgICAgICAgICAgIGlmICghc3RyY2FzZWNtcCgmY29tbWVudFt0YWdMZW4gKyAxXSwgInRydWUiKSkgewotICAgICAgICAgICAgICAgICAgICAgICAgZmlsZU1ldGEtPnNldEludDMyKGtLZXlBdXRvTG9vcCwgdHJ1ZSk7Ci0gICAgICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICB9IGVsc2UgewotICAgICAgICAgICAgICAgICAgICBmaWxlTWV0YS0+c2V0Q1N0cmluZyhrTWFwW2pdLm1LZXksICZjb21tZW50W3RhZ0xlbiArIDFdKTsKLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICB9Ci0gICAgICAgIH0KLQotfQotCi0vLyBUaGUgcmV0dXJuZWQgYnVmZmVyIHNob3VsZCBiZSBmcmVlKClkLgotc3RhdGljIHVpbnQ4X3QgKkRlY29kZUJhc2U2NChjb25zdCBjaGFyICpzLCBzaXplX3Qgc2l6ZSwgc2l6ZV90ICpvdXRTaXplKSB7Ci0gICAgKm91dFNpemUgPSAwOwotCi0gICAgaWYgKChzaXplICUgNCkgIT0gMCkgewotICAgICAgICByZXR1cm4gTlVMTDsKLSAgICB9Ci0KLSAgICBzaXplX3QgbiA9IHNpemU7Ci0gICAgc2l6ZV90IHBhZGRpbmcgPSAwOwotICAgIGlmIChuID49IDEgJiYgc1tuIC0gMV0gPT0gJz0nKSB7Ci0gICAgICAgIHBhZGRpbmcgPSAxOwotCi0gICAgICAgIGlmIChuID49IDIgJiYgc1tuIC0gMl0gPT0gJz0nKSB7Ci0gICAgICAgICAgICBwYWRkaW5nID0gMjsKLSAgICAgICAgfQotICAgIH0KLQotICAgIHNpemVfdCBvdXRMZW4gPSAzICogc2l6ZSAvIDQgLSBwYWRkaW5nOwotCi0gICAgKm91dFNpemUgPSBvdXRMZW47Ci0KLSAgICB2b2lkICpidWZmZXIgPSBtYWxsb2Mob3V0TGVuKTsKLQotICAgIHVpbnQ4X3QgKm91dCA9ICh1aW50OF90ICopYnVmZmVyOwotICAgIHNpemVfdCBqID0gMDsKLSAgICB1aW50MzJfdCBhY2N1bSA9IDA7Ci0gICAgZm9yIChzaXplX3QgaSA9IDA7IGkgPCBuOyArK2kpIHsKLSAgICAgICAgY2hhciBjID0gc1tpXTsKLSAgICAgICAgdW5zaWduZWQgdmFsdWU7Ci0gICAgICAgIGlmIChjID49ICdBJyAmJiBjIDw9ICdaJykgewotICAgICAgICAgICAgdmFsdWUgPSBjIC0gJ0EnOwotICAgICAgICB9IGVsc2UgaWYgKGMgPj0gJ2EnICYmIGMgPD0gJ3onKSB7Ci0gICAgICAgICAgICB2YWx1ZSA9IDI2ICsgYyAtICdhJzsKLSAgICAgICAgfSBlbHNlIGlmIChjID49ICcwJyAmJiBjIDw9ICc5JykgewotICAgICAgICAgICAgdmFsdWUgPSA1MiArIGMgLSAnMCc7Ci0gICAgICAgIH0gZWxzZSBpZiAoYyA9PSAnKycpIHsKLSAgICAgICAgICAgIHZhbHVlID0gNjI7Ci0gICAgICAgIH0gZWxzZSBpZiAoYyA9PSAnLycpIHsKLSAgICAgICAgICAgIHZhbHVlID0gNjM7Ci0gICAgICAgIH0gZWxzZSBpZiAoYyAhPSAnPScpIHsKLSAgICAgICAgICAgIHJldHVybiBOVUxMOwotICAgICAgICB9IGVsc2UgewotICAgICAgICAgICAgaWYgKGkgPCBuIC0gcGFkZGluZykgewotICAgICAgICAgICAgICAgIHJldHVybiBOVUxMOwotICAgICAgICAgICAgfQotCi0gICAgICAgICAgICB2YWx1ZSA9IDA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AgICAgICAgc3RhdHVzX3QgZXJyOwotICAgICAgICBpZiAoKGVyciA9IGZpbmRDaHVua1JhbmdlKHNhbXBsZUluZGV4KSkgIT0gT0spIHsKLSAgICAgICAgICAgIEFMT0dFKCJmaW5kQ2h1bmtSYW5nZSBmYWlsZWQiKTsKLSAgICAgICAgICAgIHJldHVybiBlcnI7Ci0gICAgICAgIH0KLSAgICB9Ci0KLSAgICBDSEVDSyhzYW1wbGVJbmRleCA8IG1TdG9wQ2h1bmtTYW1wbGVJbmRleCk7Ci0KLSAgICB1aW50MzJfdCBjaHVuayA9Ci0gICAgICAgIChzYW1wbGVJbmRleCAtIG1GaXJzdENodW5rU2FtcGxlSW5kZXgpIC8gbVNhbXBsZXNQZXJDaHVuawotICAgICAgICArIG1GaXJzdENodW5rOwotCi0gICAgaWYgKCFtSW5pdGlhbGl6ZWQgfHwgY2h1bmsgIT0gbUN1cnJlbnRDaHVua0luZGV4KSB7Ci0gICAgICAgIG1DdXJyZW50Q2h1bmtJbmRleCA9IGNodW5rOwotCi0gICAgICAgIHN0YXR1c190IGVycjsKLSAgICAgICAgaWYgKChlcnIgPSBnZXRDaHVua09mZnNldChjaHVuaywgJm1DdXJyZW50Q2h1bmtPZmZzZXQpKSAhPSBPSykgewotICAgICAgICAgICAgQUxPR0UoImdldENodW5rT2Zmc2V0IHJldHVybiBlcnJvciIpOwotICAgICAgICAgICAgcmV0dXJuIGVycjsKLSAgICAgICAgfQotCi0gICAgICAgIG1DdXJyZW50Q2h1bmtTYW1wbGVTaXplcy5jbGVhcigpOwotCi0gICAgICAgIHVpbnQzMl90IGZpcnN0Q2h1bmtTYW1wbGVJbmRleCA9Ci0gICAgICAgICAgICBtRmlyc3RDaHVua1NhbXBsZUluZGV4Ci0gICAgICAgICAgICAgICAgKyBtU2FtcGxlc1BlckNodW5rICogKG1DdXJyZW50Q2h1bmtJbmRleCAtIG1GaXJzdENodW5rKTsKLQotICAgICAgICBmb3IgKHVpbnQzMl90IGkgPSAwOyBp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ICAgdWludDMyX3Qgc2FtcGxlSW5kZXgsIHNpemVfdCAqc2l6ZSkgewotICAgICpzaXplID0gMDsKLQotICAgIGlmIChzYW1wbGVJbmRleCA+PSBtVGFibGUtPm1OdW1TYW1wbGVTaXplcykgewotICAgICAgICByZXR1cm4gRVJST1JfT1VUX09GX1JBTkdFOwotICAgIH0KLQotICAgIGlmIChtVGFibGUtPm1EZWZhdWx0U2FtcGxlU2l6ZSA+IDApIHsKLSAgICAgICAgKnNpemUgPSBtVGFibGUtPm1EZWZhdWx0U2FtcGxlU2l6ZTsKLSAgICAgICAgcmV0dXJuIE9LOwotICAgIH0KLQotICAgIHN3aXRjaCAobVRhYmxlLT5tU2FtcGxlU2l6ZUZpZWxkU2l6ZSkgewotICAgICAgICBjYXNlIDMyOgotICAgICAgICB7Ci0gICAgICAgICAgICBpZiAobVRhYmxlLT5tRGF0YVNvdXJjZS0+cmVhZEF0KAotICAgICAgICAgICAgICAgICAgICAgICAgbVRhYmxlLT5tU2FtcGxlU2l6ZU9mZnNldCArIDEyICsgNCAqIHNhbXBsZUluZGV4LAotICAgICAgICAgICAgICAgICAgICAgICAgc2l6ZSwgc2l6ZW9mKCpzaXplKSkgPCAoc3NpemVfdClzaXplb2YoKnNpemUpKSB7Ci0gICAgICAgICAgICAgICAgcmV0dXJuIEVSUk9SX0lPOwotICAgICAgICAgICAgfQotCi0gICAgICAgICAgICAqc2l6ZSA9IG50b2hsKCpzaXplKTsKLSAgICAgICAgICAgIGJyZWFrOwotICAgICAgICB9Ci0KLSAgICAgICAgY2FzZSAxNjoKLSAgICAgICAgewotICAgICAgICAgICAgdWludDE2X3QgeDsKLSAgICAgICAgICAgIGlmIChtVGFibGUtPm1EYXRhU291cmNlLT5yZWFkQXQoCi0gICAgICAgICAgICAgICAgICAgICAgICBtVGFibGUtPm1TYW1wbGVTaXplT2Zmc2V0ICsgMTIgKyAyICogc2FtcGxlSW5kZXgsCi0gICAgICAgICAgICAgICAgICAgICAgICAmeCwgc2l6ZW9mKHgpKSA8IChzc2l6ZV90KXNpemVvZih4KSkgewotICAgICAgICAgICAgICAgIHJldHVybiBFUlJPUl9JTzsKLSAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgKnNpemUgPSBudG9ocyh4KTsKLSAgICAgICAgICAgIGJyZWFrOwotICAgICAgICB9Ci0KLSAgICAgICAgY2FzZSA4OgotICAgICAgICB7Ci0gICAgICAgICAgICB1aW50OF90IHg7Ci0gICAgICAgICAgICBpZiAobVRhYmxlLT5tRGF0YVNvdXJjZS0+cmVhZEF0KAotICAgICAgICAgICAgICAgICAgICAgICAgbVRhYmxlLT5tU2FtcGxlU2l6ZU9mZnNldCArIDEyICsgc2FtcGxlSW5kZXgsCi0gICAgICAgICAgICAgICAgICAgICAgICAmeCwgc2l6ZW9mKHgpKSA8IChzc2l6ZV90KXNpemVvZih4KSkgewotICAgICAgICAgICAgICAgIHJldHVybiBFUlJPUl9JTzsKLSAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgKnNpemUgPSB4OwotICAgICAgICAgICAgYnJlYWs7Ci0gICAgICAgIH0KLQotICAgICAgICBkZWZhdWx0OgotICAgICAgICB7Ci0gICAgICAgICAgICBDSEVDS19FUShtVGFibGUtPm1TYW1wbGVTaXplRmllbGRTaXplLCA0KTsKLQotICAgICAgICAgICAgdWludDhfdCB4OwotICAgICAgICAgICAgaWYgKG1UYWJsZS0+bURhdGFTb3VyY2UtPnJlYWRBdCgKLSAgICAgICAgICAgICAgICAgICAgICAgIG1UYWJsZS0+bVNhbXBsZVNpemVPZmZzZXQgKyAxMiArIHNhbXBsZUluZGV4IC8gMiwKLSAgICAgICAgICAgICAgICAgICAgICAgICZ4LCBzaXplb2YoeCkpIDwgKHNzaXplX3Qpc2l6ZW9mKHgpKSB7Ci0gICAgICAgICAgICAgICAgcmV0dXJuIEVSUk9SX0lPOwotICAgICAgICAgICAgfQotCi0gICAgICAgICAgICAqc2l6ZSA9IChzYW1wbGVJbmRleCAmIDEpID8geCAmIDB4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llcygKLSAgICAgICAgY29uc3QgdWludDMyX3QgKmRlbHRhRW50cmllcywgc2l6ZV90IG51bURlbHRhRW50cmllcykgewotICAgIE11dGV4OjpBdXRvbG9jayBhdXRvbG9jayhtTG9jayk7Ci0KLSAgICBtRGVsdGFFbnRyaWVzID0gZGVsdGFFbnRyaWVzOwotICAgIG1OdW1EZWx0YUVudHJpZXMgPSBudW1EZWx0YUVudHJpZXM7Ci0gICAgbUN1cnJlbnREZWx0YUVudHJ5ID0gMDsKLSAgICBtQ3VycmVudEVudHJ5U2FtcGxlSW5kZXggPSAwOwotfQotCi11aW50MzJfdCBTYW1wbGVUYWJsZTo6Q29tcG9zaXRpb25EZWx0YUxvb2t1cDo6Z2V0Q29tcG9zaXRpb25UaW1lT2Zmc2V0KAotICAgICAgICB1aW50MzJfdCBzYW1wbGVJbmRleCkgewotICAgIE11dGV4OjpBdXRvbG9jayBhdXRvbG9jayhtTG9jayk7Ci0KLSAgICBpZiAobURlbHRhRW50cmllcyA9PSBOVUxMKSB7Ci0gICAgICAgIHJldHVybiAwOwotICAgIH0KLQotICAgIGlmIChzYW1wbGVJbmRleCA8IG1DdXJyZW50RW50cnlTYW1wbGVJbmRleCkgewotICAgICAgICBtQ3VycmVudERlbHRhRW50cnkgPSAwOwotICAgICAgICBtQ3VycmVudEVudHJ5U2FtcGxlSW5kZXggPSAwOwotICAgIH0KLQotICAgIHdoaWxlIChtQ3VycmVudERlbHRhRW50cnkgPCBtTnVtRGVsdGFFbnRyaWVzKSB7Ci0gICAgICAgIHVpbnQzMl90IHNhbXBsZUNvdW50ID0gbURlbHRhRW50cmllc1syICogbUN1cnJlbnREZWx0YUVudHJ5XTsKLSAgICAgICAgaWYgKHNhbXBsZUluZGV4IDwgbUN1cnJlbnRFbnRyeVNhbXBsZUluZGV4ICsgc2FtcGxlQ291bnQpIHsKLSAgICAgICAgICAgIHJldHVybiBtRGVsdGFFbnRyaWVzWzIgKiBtQ3VycmVudERlbHRhRW50cnkgKyAxXTsK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gICAgfQotCi0gICAgbU51bUNvbXBvc2l0aW9uVGltZURlbHRhRW50cmllcyA9IG51bUVudHJpZXM7Ci0gICAgbUNvbXBvc2l0aW9uVGltZURlbHRhRW50cmllcyA9IG5ldyB1aW50MzJfdFsyICogbnVtRW50cmllc107Ci0KLSAgICBpZiAobURhdGFTb3VyY2UtPnJlYWRBdCgKLSAgICAgICAgICAgICAgICBkYXRhX29mZnNldCArIDgsIG1Db21wb3NpdGlvblRpbWVEZWx0YUVudHJpZXMsIG51bUVudHJpZXMgKiA4KQotICAgICAgICAgICAgPCAoc3NpemVfdCludW1FbnRyaWVzICogOCkgewotICAgICAgICBkZWxldGVbXSBtQ29tcG9zaXRpb25UaW1lRGVsdGFFbnRyaWVzOwotICAgICAgICBtQ29tcG9zaXRpb25UaW1lRGVsdGFFbnRyaWVzID0gTlVMTDsKLQotICAgICAgICByZXR1cm4gRVJST1JfSU87Ci0gICAgfQotCi0gICAgZm9yIChzaXplX3QgaSA9IDA7IGkgPCAyICogbnVtRW50cmllczsgKytpKSB7Ci0gICAgICAgIG1Db21wb3NpdGlvblRpbWVEZWx0YUVudHJpZXNbaV0gPSBudG9obChtQ29tcG9zaXRpb25UaW1lRGVsdGFFbnRyaWVzW2ldKTsKLSAgICB9Ci0KLSAgICBtQ29tcG9zaXRpb25EZWx0YUxvb2t1cC0+c2V0RW50cmllcygKLSAgICAgICAgICAgIG1Db21wb3NpdGlvblRpbWVEZWx0YUVudHJpZXMsIG1OdW1Db21wb3NpdGlvblRpbWVEZWx0YUVudHJpZXMpOwotCi0gICAgcmV0dXJuIE9LOwotfQotCi1zdGF0dXNfdCBTYW1wbGVUYWJsZTo6c2V0U3luY1NhbXBsZVBhcmFtcyhvZmY2NF90IGRhdGFfb2Zmc2V0LCBzaXplX3QgZGF0YV9zaXplKSB7Ci0gICAgaWYgKG1TeW5jU2FtcGxlT2Zmc2V0ID49IDAgfHwgZGF0YV9zaXplIDwgOCkgewotICAgICAgICByZXR1cm4gRVJST1Jf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aiA8IG47ICsraikgewotICAgICAgICAgICAgaWYgKHNhbXBsZUluZGV4IDwgbU51bVNhbXBsZVNpemVzKSB7Ci0gICAgICAgICAgICAgICAgLy8gVGVjaG5pY2FsbHkgdGhpcyBzaG91bGQgYWx3YXlzIGJlIHRoZSBjYXNlIGlmIHRoZSBmaWxlCi0gICAgICAgICAgICAgICAgLy8gaXMgd2VsbC1mb3JtZWQsIGJ1dCB5b3Uga25vdy4uLiB0aGVyZSdzIChnYXNwKSBtYWxmb3JtZWQKLSAgICAgICAgICAgICAgICAvLyBjb250ZW50IG91dCB0aGVyZS4KLQotICAgICAgICAgICAgICAgIG1TYW1wbGVUaW1lRW50cmllc1tzYW1wbGVJbmRleF0ubVNhbXBsZUluZGV4ID0gc2FtcGxlSW5kZXg7Ci0KLSAgICAgICAgICAgICAgICB1aW50MzJfdCBjb21wVGltZURlbHRhID0KLSAgICAgICAgICAgICAgICAgICAgbUNvbXBvc2l0aW9uRGVsdGFMb29rdXAtPmdldENvbXBvc2l0aW9uVGltZU9mZnNldCgKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBzYW1wbGVJbmRleCk7Ci0KLSAgICAgICAgICAgICAgICBtU2FtcGxlVGltZUVudHJpZXNbc2FtcGxlSW5kZXhdLm1Db21wb3NpdGlvblRpbWUgPQotICAgICAgICAgICAgICAgICAgICBzYW1wbGVUaW1lICsgY29tcFRpbWVEZWx0YTsKLSAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgKytzYW1wbGVJbmRleDsKLSAgICAgICAgICAgIHNhbXBsZVRpbWUgKz0gZGVsdGE7Ci0gICAgICAgIH0KLSAgICB9Ci0KLSAgICBxc29ydChtU2FtcGxlVGltZUVudHJpZXMsIG1OdW1TYW1wbGVTaXplcywgc2l6ZW9mKFNhbXBsZVRpbWVFbnRyeSksCi0gICAgICAgICAgQ29tcGFyZUluY3JlYXNpbmdUaW1lKTsKLX0KLQotc3RhdHVzX3QgU2FtcGxlVGFibGU6OmZpbmRTYW1wbGVBdFRpbWUoCi0gICAgICAgIHVpbnQzMl90IHJlcV90aW1lLCB1aW50MzJfdCAqc2FtcGxlX2luZGV4LCB1aW50MzJfdCBmbGFncykgewotICAgIGJ1aWxkU2FtcGxlRW50cmllc1RhYmxlKCk7Ci0KLSAgICB1aW50MzJfdCBsZWZ0ID0gMDsKLSAgICB1aW50MzJfdCByaWdodCA9IG1OdW1TYW1wbGVTaXplczsKLSAgICB3aGlsZSAobGVmdCA8IHJpZ2h0KSB7Ci0gICAgICAgIHVpbnQzMl90IGNlbnRlciA9IChsZWZ0ICsgcmlnaHQpIC8gMjsKLSAgICAgICAgdWludDMyX3QgY2VudGVyVGltZSA9IG1TYW1wbGVUaW1lRW50cmllc1tjZW50ZXJdLm1Db21wb3NpdGlvblRpbWU7Ci0KLSAgICAgICAgaWYgKHJlcV90aW1lIDwgY2VudGVyVGltZSkgewotICAgICAgICAgICAgcmlnaHQgPSBjZW50ZXI7Ci0gICAgICAgIH0gZWxzZSBpZiAocmVxX3RpbWUgPiBjZW50ZXJUaW1lKSB7Ci0gICAgICAgICAgICBsZWZ0ID0gY2VudGVyICsgMTsKLSAgICAgICAgfSBlbHNlIHsKLSAgICAgICAgICAgIGxlZnQgPSBjZW50ZXI7Ci0gICAgICAgICAgICBicmVhazsKLSAgICAgICAgfQotICAgIH0KLQotICAgIGlmIChsZWZ0ID09IG1OdW1TYW1wbGVTaXplcykgewotICAgICAgICBpZiAoZmxhZ3MgPT0ga0ZsYWdBZnRlcikgewotICAgICAgICAgICAgcmV0dXJuIEVSUk9SX09VVF9PRl9SQU5HRTsKLSAgICAgICAgfQotCi0gICAgICAgIC0tbGVmdDsKLSAgICB9Ci0KLSAgICB1aW50MzJfdCBjbG9zZXN0SW5kZXggPSBsZWZ0OwotCi0gICAgc3dpdGNoIChmbGFncykgewotICAgICAgICBjYXNlIGtGbGFnQmVmb3JlOgotICAgICAgICB7Ci0gICAgICAgICAgICB3aGlsZSAoY2xvc2VzdEluZGV4ID4gMAotICAgICAgICAgICAgICAgICAgICAmJiBtU2FtcGxlVGltZUVudHJpZXNbY2xvc2VzdEluZGV4XS5tQ29tcG9zaXRpb25UaW1lCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgPiByZXFfdGltZSkgewotICAgICAgICAgICAgICAgIC0tY2xvc2VzdEluZGV4OwotICAgICAgICAgICAgfQotICAgICAgICAgICAgYnJlYWs7Ci0gICAgICAgIH0KLQotICAgICAgICBjYXNlIGtGbGFnQWZ0ZXI6Ci0gICAgICAgIHsKLSAgICAgICAgICAgIHdoaWxlIChjbG9zZXN0SW5kZXggKyAxIDwgbU51bVNhbXBsZVNpemVzCi0gICAgICAgICAgICAgICAgICAgICYmIG1TYW1wbGVUaW1lRW50cmllc1tjbG9zZXN0SW5kZXhdLm1Db21wb3NpdGlvblRpbWUKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICA8IHJlcV90aW1lKSB7Ci0gICAgICAgICAgICAgICAgKytjbG9zZXN0SW5kZXg7Ci0gICAgICAgICAgICB9Ci0gICAgICAgICAgICBicmVhazsKLSAgICAgICAgfQotCi0gICAgICAgIGRlZmF1bHQ6Ci0gICAgICAgIHsKLSAgICAgICAgICAgIENIRUNLKGZsYWdzID09IGtGbGFnQ2xvc2VzdCk7Ci0KLSAgICAgICAgICAgIGlmIChjbG9zZXN0SW5kZXggPiAwKSB7Ci0gICAgICAgICAgICAgICAgLy8gQ2hlY2sgbGVmdCBuZWlnaGJvdXIgYW5kIHBpY2sgY2xvc2VzdC4KLSAgICAgICAgICAgICAgICB1aW50MzJfdCBhYnNkaWZmMSA9Ci0gICAgICAgICAgICAgICAgICAgIGFic19kaWZmZXJlbmNlKAotICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1TYW1wbGVUaW1lRW50cmllc1tjbG9zZXN0SW5kZXhdLm1Db21wb3NpdGlvblRpbWUsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgcmVxX3RpbWUpOwotCi0gICAgICAgICAgICAgICAgdWludDMyX3QgYWJzZGlmZjIgPQotICAgICAgICAgICAgICAgICAgICBhYnNfZGlmZmVyZW5jZSgKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBtU2FtcGxlVGltZUVudHJpZXNbY2xvc2VzdEluZGV4IC0gMV0ubUNvbXBvc2l0aW9uVGltZSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXFfdGltZSk7Ci0KLSAgICAgICAgICAgICAgICBpZiAoYWJzZGlmZjEgPiBhYnNkaWZmMikgewotICAgICAgICAgICAgICAgICAgICBjbG9zZXN0SW5kZXggPSBjbG9zZXN0SW5kZXggLSAxOwotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgYnJlYWs7Ci0gICAgICAgIH0KLSAgICB9Ci0KLSAgICAqc2FtcGxlX2luZGV4ID0gbVNhbXBsZVRpbWVFbnRyaWVzW2Nsb3Nlc3RJbmRleF0ubVNhbXBsZUluZGV4OwotCi0gICAgcmV0dXJuIE9LOwotfQotCi1zdGF0dXNfdCBTYW1wbGVUYWJsZTo6ZmluZFN5bmNTYW1wbGVOZWFyKAotICAgICAgICB1aW50MzJfdCBzdGFydF9zYW1wbGVfaW5kZXgsIHVpbnQzMl90ICpzYW1wbGVfaW5kZXgsIHVpbnQzMl90IGZsYWdzKSB7Ci0gICAgTXV0ZXg6OkF1dG9sb2NrIGF1dG9Mb2NrKG1Mb2NrKTsKLQotICAgICpzYW1wbGVfaW5kZXggPSAwOwotCi0gICAgaWYgKG1TeW5jU2FtcGxlT2Zmc2V0IDwgMCkgewotICAgICAgICAvLyBBbGwgc2FtcGxlcyBhcmUgc3luYy1zYW1wbGVzLgotICAgICAgICAqc2FtcGxlX2luZGV4ID0gc3RhcnRfc2FtcGxlX2luZGV4OwotICAgICAgICByZXR1cm4gT0s7Ci0gICAgfQotCi0gICAgaWYgKG1OdW1TeW5jU2FtcGxlcyA9PSAwKSB7Ci0gICAgICAgICpzYW1wbGVfaW5kZXggPSAwOwotICAgICA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XJlbmNlKHlfdGltZSwgc2FtcGxlX3RpbWUpKSB7Ci0gICAgICAgICAgICAvLyBQaWNrIHRoZSBzeW5jIHNhbXBsZSBjbG9zZXN0ICh0aW1ld2lzZSkgdG8gdGhlIHN0YXJ0LXNhbXBsZS4KLSAgICAgICAgICAgIHggPSB5OwotICAgICAgICAgICAgKytsZWZ0OwotICAgICAgICB9Ci0gICAgfQotCi0gICAgc3dpdGNoIChmbGFncykgewotICAgICAgICBjYXNlIGtGbGFnQmVmb3JlOgotICAgICAgICB7Ci0gICAgICAgICAgICBpZiAoeCA+IHN0YXJ0X3NhbXBsZV9pbmRleCkgewotICAgICAgICAgICAgICAgIENIRUNLKGxlZnQgPiAwKTsKLQotICAgICAgICAgICAgICAgIHggPSBtU3luY1NhbXBsZXNbbGVmdCAtIDFdOwotCi0gICAgICAgICAgICAgICAgaWYgKHggPiBzdGFydF9zYW1wbGVfaW5kZXgpIHsKLSAgICAgICAgICAgICAgICAgICAgLy8gVGhlIHRhYmxlIG9mIHN5bmMgc2FtcGxlIGluZGljZXMgd2FzIG5vdCBzb3J0ZWQKLSAgICAgICAgICAgICAgICAgICAgLy8gcHJvcGVybHkuCi0gICAgICAgICAgICAgICAgICAgIHJldHVybiBFUlJPUl9NQUxGT1JNRUQ7Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgfQotICAgICAgICAgICAgYnJlYWs7Ci0gICAgICAgIH0KLQotICAgICAgICBjYXNlIGtGbGFnQWZ0ZXI6Ci0gICAgICAgIHsKLSAgICAgICAgICAgIGlmICh4IDwgc3RhcnRfc2FtcGxlX2luZGV4KSB7Ci0gICAgICAgICAgICAgICAgaWYgKGxlZnQgKyAxID49IG1OdW1TeW5jU2FtcGxlcykgewotICAgICAgICAgICAgICAgICAgICByZXR1cm4gRVJST1JfT1VUX09GX1JBTkdFOwotICAgICAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgICAgIHggPSBtU3luY1NhbXBsZXNbbGVmdCArIDFdOwotCi0gIC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G1heER1cmF0aW9uVXMpIHsKLSAgICAgICAgICAgICAgICBtYXhEdXJhdGlvblVzID0gZHVyYXRpb25VczsKLSAgICAgICAgICAgIH0KLSAgICAgICAgfQotCi0gICAgICAgIGNvbnN0IGNoYXIgKm1pbWU7Ci0gICAgICAgIGlmICh0cmFja01ldGEtPmZpbmRDU3RyaW5nKGtLZXlNSU1FVHlwZSwgJm1pbWUpKSB7Ci0gICAgICAgICAgICBpZiAoIWhhc0F1ZGlvICYmICFzdHJuY2FzZWNtcCgiYXVkaW8vIiwgbWltZSwgNikpIHsKLSAgICAgICAgICAgICAgICBoYXNBdWRpbyA9IHRydWU7Ci0KLSAgICAgICAgICAgICAgICBpZiAoIXRyYWNrTWV0YS0+ZmluZEludDMyKGtLZXlCaXRSYXRlLCAmYXVkaW9CaXRyYXRlKSkgewotICAgICAgICAgICAgICAgICAgICBhdWRpb0JpdHJhdGUgPSAtMTsKLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICB9IGVsc2UgaWYgKCFoYXNWaWRlbyAmJiAhc3RybmNhc2VjbXAoInZpZGVvLyIsIG1pbWUsIDYpKSB7Ci0gICAgICAgICAgICAgICAgaGFzVmlkZW8gPSB0cnVlOwotCi0gICAgICAgICAgICAgICAgQ0hFQ0sodHJhY2tNZXRhLT5maW5kSW50MzIoa0tleVdpZHRoLCAmdmlkZW9XaWR0aCkpOwotICAgICAgICAgICAgICAgIENIRUNLKHRyYWNrTWV0YS0+ZmluZEludDMyKGtLZXlIZWlnaHQsICZ2aWRlb0hlaWdodCkpOwotICAgICAgICAgICAgfSBlbHNlIGlmICghc3RyY2FzZWNtcChtaW1lLCBNRURJQV9NSU1FVFlQRV9URVhUXzNHUFApKSB7Ci0gICAgICAgICAgICAgICAgY29uc3QgY2hhciAqbGFuZzsKLSAgICAgICAgICAgICAgICB0cmFja01ldGEtPmZpbmRDU3RyaW5nKGtLZXlNZWRpYUxhbmd1YWdlLCAmbGFuZyk7Ci0gICAgICAgICAgICAgICA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GllbnRCdWZmZXJDb3VudCAmJgotICAgICAgICAgICAgICAgICgobVNlcnZlckJ1ZmZlckNvdW50ICE9IG1CdWZmZXJDb3VudCkgfHwKLSAgICAgICAgICAgICAgICAgICAgICAgIChtU2VydmVyQnVmZmVyQ291bnQgPCBtaW5CdWZmZXJDb3VudE5lZWRlZCkpKSB7Ci0gICAgICAgICAgICAvLyB3YWl0IGZvciB0aGUgRklGTyB0byBkcmFpbgotICAgICAgICAgICAgd2hpbGUgKCFtUXVldWUuaXNFbXB0eSgpKSB7Ci0gICAgICAgICAgICAgICAgQUxPR1YoIldhaXRpbmcgZm9yIHRoZSBGSUZPIHRvIGRyYWluIik7Ci0gICAgICAgICAgICAgICAgbURlcXVldWVDb25kaXRpb24ud2FpdChtTXV0ZXgpOwotICAgICAgICAgICAgfQotICAgICAgICAgICAgaWYgKG1TdG9wcGVkKSB7Ci0gICAgICAgICAgICAgICAgcmV0dXJuIE5PX0lOSVQ7Ci0gICAgICAgICAgICB9Ci0gICAgICAgICAgICAvLyBuZWVkIHRvIGNoZWNrIGFnYWluIHNpbmNlIHRoZSBtb2RlIGNvdWxkIGhhdmUgY2hhbmdlZAotICAgICAgICAgICAgLy8gd2hpbGUgd2Ugd2VyZSB3YWl0aW5nCi0gICAgICAgICAgICBtaW5CdWZmZXJDb3VudE5lZWRlZCA9IG1TeW5jaHJvbm91c01vZGUgPwotICAgICAgICAgICAgICAgICAgICBNSU5fU1lOQ19CVUZGRVJfU0xPVFMgOiBNSU5fQVNZTkNfQlVGRkVSX1NMT1RTOwotICAgICAgICB9Ci0KLSAgICAgICAgaWYgKCFtQ2xpZW50QnVmZmVyQ291bnQgJiYKLSAgICAgICAgICAgICAgICAoKG1TZXJ2ZXJCdWZmZXJDb3VudCAhPSBtQnVmZmVyQ291bnQpIHx8Ci0gICAgICAgICAgICAgICAgICAgICAgICAobVNlcnZlckJ1ZmZlckNvdW50IDwgbWluQnVmZmVyQ291bnROZWVkZWQpKSkgewotICAgICAgICAgICA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WQgKGRlcXVldWVkPSVkKSIsCi0gICAgICAgICAgICAgICAgICAgICAgICBNSU5fVU5ERVFVRVVFRF9CVUZGRVJTLWludChtU3luY2hyb25vdXNNb2RlKSwKLSAgICAgICAgICAgICAgICAgICAgICAgIGRlcXVldWVkQ291bnQpOwotICAgICAgICAgICAgICAgIHJldHVybiAtRUJVU1k7Ci0gICAgICAgICAgICB9Ci0gICAgICAgIH0KLQotICAgICAgICAvLyB3ZSdyZSBpbiBzeW5jaHJvbm91cyBtb2RlIGFuZCBkaWRuJ3QgZmluZCBhIGJ1ZmZlciwgd2UgbmVlZCB0byB3YWl0Ci0gICAgICAgIC8vIGZvciBmb3Igc29tZSBidWZmZXJzIHRvIGJlIGNvbnN1bWVkCi0gICAgICAgIHRyeUFnYWluID0gbVN5bmNocm9ub3VzTW9kZSAmJiAoZm91bmRTeW5jID09IElOVkFMSURfQlVGRkVSX1NMT1QpOwotICAgICAgICBpZiAodHJ5QWdhaW4pIHsKLSAgICAgICAgICAgIEFMT0dWKCJXYWl0aW5nLi5JbiBzeW5jaHJvbm91cyBtb2RlIGFuZCBubyBidWZmZXIgdG8gZGVxdWV1ZSIpOwotICAgICAgICAgICAgbURlcXVldWVDb25kaXRpb24ud2FpdChtTXV0ZXgpOwotICAgICAgICB9Ci0gICAgICAgIGlmIChtU3RvcHBlZCkgewotICAgICAgICAgICAgcmV0dXJuIE5PX0lOSVQ7Ci0gICAgICAgIH0KLSAgICB9Ci0KLSAgICBpZiAobVN5bmNocm9ub3VzTW9kZSAmJiBmb3VuZCA9PSBJTlZBTElEX0JVRkZFUl9TTE9UKSB7Ci0gICAgICAgIC8vIGZvdW5kU3luYyBndWFyYW50ZWVkIHRvIGJlICE9IElOVkFMSURfQlVGRkVSX1NMT1QKLSAgICAgICAgZm91bmQgPSBmb3VuZFN5bmM7Ci0gICAgfQotCi0gICAgaWYgKGZvdW5kID09IElOVkFMSURfQlVGRkVSX1NMT1QpIHsKLSAgICAgICAgcmV0dXJuIC1FQ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Y2sgbG9jayhtTXV0ZXgpOwotCi0gICAgaWYgKG1TdG9wcGVkKSB7Ci0gICAgICAgIEFMT0dFKCJkaXNjb25uZWN0OiBTdXJmYWNlTWVkaWFTb291cmNlIGlzIGFscmVhZHkgc3RvcHBlZCEiKTsKLSAgICAgICAgcmV0dXJuIE5PX0lOSVQ7Ci0gICAgfQotCi0gICAgc3RhdHVzX3QgZXJyID0gTk9fRVJST1I7Ci0gICAgc3dpdGNoIChhcGkpIHsKLSAgICAgICAgY2FzZSBOQVRJVkVfV0lORE9XX0FQSV9FR0w6Ci0gICAgICAgIGNhc2UgTkFUSVZFX1dJTkRPV19BUElfQ1BVOgotICAgICAgICBjYXNlIE5BVElWRV9XSU5ET1dfQVBJX01FRElBOgotICAgICAgICBjYXNlIE5BVElWRV9XSU5ET1dfQVBJX0NBTUVSQToKLSAgICAgICAgICAgIGlmIChtQ29ubmVjdGVkQXBpID09IGFwaSkgewotICAgICAgICAgICAgICAgIG1Db25uZWN0ZWRBcGkgPSBOT19DT05ORUNURURfQVBJOwotICAgICAgICAgICAgICAgIG1TdG9wcGVkID0gdHJ1ZTsKLSAgICAgICAgICAgICAgICBtRGVxdWV1ZUNvbmRpdGlvbi5zaWduYWwoKTsKLSAgICAgICAgICAgICAgICBtRnJhbWVBdmFpbGFibGVDb25kaXRpb24uc2lnbmFsKCk7Ci0gICAgICAgICAgICB9IGVsc2UgewotICAgICAgICAgICAgICAgIGVyciA9IC1FSU5WQUw7Ci0gICAgICAgICAgICB9Ci0gICAgICAgICAgICBicmVhazsKLSAgICAgICAgZGVmYXVsdDoKLSAgICAgICAgICAgIGVyciA9IC1FSU5WQUw7Ci0gICAgICAgICAgICBicmVhazsKLSAgICB9Ci0gICAgcmV0dXJuIGVycjsKLX0KLQotc3RhdHVzX3QgU3VyZmFjZU1lZGlhU291cmNlOjpxdWV1ZUJ1ZmZlcihpbnQgYnVmSW5kZXgsIGludDY0X3QgdGltZXN0YW1wLAotICAgICAgICB1aW50MzJfdCog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AgIE11dGV4OjpBdXRvbG9jayBhdXRvTG9jayhtTG9jayk7Ci0KLSAgICBzc2l6ZV90IG4gPSBtU291cmNlLT5yZWFkQXQob2Zmc2V0LCBkYXRhLCBzaXplKTsKLQotICAgIGlmIChuIDw9IDApIHsKLSAgICAgICAgcmV0dXJuIG47Ci0gICAgfQotCi0gICAgbVRvdGFsVHJhbnNmZXJyZWQgKz0gbjsKLQotICAgIGludDY0X3Qgbm93VXMgPSBnZXROb3dVcygpOwotCi0gICAgaWYgKG1TdGFydFRpbWVVcyA8IDApIHsKLSAgICAgICAgbVN0YXJ0VGltZVVzID0gbm93VXM7Ci0gICAgfQotCi0gICAgLy8gSG93IGxvbmcgd291bGQgaXQgaGF2ZSB0YWtlbiB0byB0cmFuc2ZlciBldmVyeXRoaW5nIHdlIGV2ZXIKLSAgICAvLyB0cmFuc2ZlcnJlZCBnaXZlbiB0aGUgbGltaXRlZCBiYW5kd2lkdGguCi0gICAgaW50NjRfdCBkdXJhdGlvblVzID0KLSAgICAgICAgbVRvdGFsVHJhbnNmZXJyZWQgKiAxMDAwMDAwbGwgLyBtQmFuZHdpZHRoTGltaXRCeXRlc1BlclNlY29uZDsKLQotICAgIGludDY0X3Qgd2hlblVzID0gbVN0YXJ0VGltZVVzICsgZHVyYXRpb25VczsKLQotICAgIGlmICh3aGVuVXMgPiBub3dVcykgewotICAgICAgICB1c2xlZXAod2hlblVzIC0gbm93VXMpOwotICAgIH0KLQotICAgIHJldHVybiBuOwotfQotCi1zdGF0dXNfdCBUaHJvdHRsZWRTb3VyY2U6OmdldFNpemUob2ZmNjRfdCAqc2l6ZSkgewotICAgIHJldHVybiBtU291cmNlLT5nZXRTaXplKHNpemUpOwotfQotCi11aW50MzJfdCBUaHJvdHRsZWRTb3VyY2U6OmZsYWdzKCkgewotICAgIHJldHVybiBtU291cmNlLT5mbGFncygpOwotfQotCi19ICAvLyBuYW1lc3BhY2UgYW5kcm9pZAotCmRpZmYgLS1naXQgYS9tZWRpYS9saW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sIDAsIDApOwotCi0gICAgZm9yICg7OykgewotICAgICAgICBpbnQ2NF90IG5vd191cyA9IDA7Ci0gICAgICAgIHNwPEV2ZW50PiBldmVudDsKLQotICAgICAgICB7Ci0gICAgICAgICAgICBNdXRleDo6QXV0b2xvY2sgYXV0b0xvY2sobUxvY2spOwotCi0gICAgICAgICAgICBpZiAobVN0b3BwZWQpIHsKLSAgICAgICAgICAgICAgICBicmVhazsKLSAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgd2hpbGUgKG1RdWV1ZS5lbXB0eSgpKSB7Ci0gICAgICAgICAgICAgICAgbVF1ZXVlTm90RW1wdHlDb25kaXRpb24ud2FpdChtTG9jayk7Ci0gICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgIGV2ZW50X2lkIGV2ZW50SUQgPSAwOwotICAgICAgICAgICAgZm9yICg7OykgewotICAgICAgICAgICAgICAgIGlmIChtUXVldWUuZW1wdHkoKSkgewotICAgICAgICAgICAgICAgICAgICAvLyBUaGUgb25seSBldmVudCBpbiB0aGUgcXVldWUgY291bGQgaGF2ZSBiZWVuIGNhbmNlbGxlZAotICAgICAgICAgICAgICAgICAgICAvLyB3aGlsZSB3ZSB3ZXJlIHdhaXRpbmcgZm9yIGl0cyBzY2hlZHVsZWQgdGltZS4KLSAgICAgICAgICAgICAgICAgICAgYnJlYWs7Ci0gICAgICAgICAgICAgICAgfQotCi0gICAgICAgICAgICAgICAgTGlzdDxRdWV1ZUl0ZW0+OjppdGVyYXRvciBpdCA9IG1RdWV1ZS5iZWdpbigpOwotICAgICAgICAgICAgICAgIGV2ZW50SUQgPSAoKml0KS5ldmVudC0+ZXZlbnRJRCgpOwotCi0gICAgICAgICAgICAgICAgbm93X3VzID0gZ2V0UmVhbFRpbWVVcygpOwotICAgICAgICAgICAgICAgIGludDY0X3Qgd2hlbl91cyA9ICgqaXQpLnJlYWx0aW1lX3VzOwotCi0gICAgICAgICAgICAgICAgaW50NjRfdCBkZWxheV91czsKLSAgICAgICAgICAgICAgICBpZiAod2hlbl91cyA8IDAgfHwgd2hlbl91cyA9PSBJTlQ2NF9NQVgpIHsKLSAgICAgICAgICAgICAgICAgICAgZGVsYXlfdXMgPSAwOwotICAgICAgICAgICAgICAgIH0gZWxzZSB7Ci0gICAgICAgICAgICAgICAgICAgIGRlbGF5X3VzID0gd2hlbl91cyAtIG5vd191czsKLSAgICAgICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgICAgICBpZiAoZGVsYXlfdXMgPD0gMCkgewotICAgICAgICAgICAgICAgICAgICBicmVhazsKLSAgICAgICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgICAgICBzdGF0aWMgaW50NjRfdCBrTWF4VGltZW91dFVzID0gMTAwMDAwMDBsbDsgIC8vIDEwIHNlY3MKLSAgICAgICAgICAgICAgICBib29sIHRpbWVvdXRDYXBwZWQgPSBmYWxzZTsKLSAgICAgICAgICAgICAgICBpZiAoZGVsYXlfdXMgPiBrTWF4VGltZW91dFVzKSB7Ci0gICAgICAgICAgICAgICAgICAgIEFMT0dXKCJkZWxheV91cyBleGNlZWRzIG1heCB0aW1lb3V0OiAlbGxkIHVzIiwgZGVsYXlfdXMpOwotCi0gICAgICAgICAgICAgICAgICAgIC8vIFdlJ2xsIG5ldmVyIGJsb2NrIGZvciBtb3JlIHRoYW4gMTAgc2VjcywgaW5zdGVhZAotICAgICAgICAgICAgICAgICAgICAvLyB3ZSB3aWxsIHNwbGl0IHVwIHRoZSBmdWxsIHRpbWVvdXQgaW50byBjaHVua3Mgb2YKLSAgICAgICAgICAgICAgICAgICAgLy8gMTAgc2VjcyBhdCBhIHRpbWUuIFRoaXMgd2lsbCBhbHNvIGF2b2lkIG92ZXJmbG93Ci0gICAgICAgICAgICAgICAgICAgIC8vIHdoZW4gY29udmVydGluZyBmcm9tIHVzIHRvIG5zLgotICAgICAgICAgICAgICAgICAgICBkZWxheV91cyA9IGtNYXhUaW1lb3V0VXM7Ci0gICAgICAgICAgICAgICAgICAgIHRpbWVvdXRDYXBwZWQgPSB0cnVlOwotICAgICAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgICAgIHN0YXR1c190IGVyciA9IG1RdWV1ZUhlYWRDaGFuZ2VkQ29uZGl0aW9uLndhaXRSZWxhdGl2ZSgKLSAgICAgICAgICAgICAgICAgICAgICAgIG1Mb2NrLCBkZWxheV91cyAqIDEwMDBsbCk7Ci0KLSAgICAgICAgICAgICAgICBpZiAoIXRpbWVvdXRDYXBwZWQgJiYgZXJyID09IC1FVElNRURPVVQpIHsKLSAgICAgICAgICAgICAgICAgICAgLy8gV2UgZmluYWxseSBoaXQgdGhlIHRpbWUgdGhpcyBldmVudCBpcyBzdXBwb3NlZCB0bwotICAgICAgICAgICAgICAgICAgICAvLyB0cmlnZ2VyLgotICAgICAgICAgICAgICAgICAgICBub3dfdXMgPSBnZXRSZWFsVGltZVVzKCk7Ci0gICAgICAgICAgICAgICAgICAgIGJyZWFrOwotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgLy8gVGhlIGV2ZW50IHcvIHRoaXMgaWQgbWF5IGhhdmUgYmVlbiBjYW5jZWxsZWQgd2hpbGUgd2UncmUKLSAgICAgICAgICAgIC8vIHdhaXRpbmcgZm9yIGl0cyB0cmlnZ2VyLXRpbWUsIGluIHRoYXQgY2FzZQotICAgICAgICAgICAgLy8gcmVtb3ZlRXZlbnRGcm9tUXVldWVfbCB3aWxsIHJldHVybiBOVUxMLgotICAgICAgICAgICAgLy8gT3RoZXJ3aXNlLCB0aGUgUXVldWVJdGVtIHdpbGwgYmUgcmVtb3ZlZAotICAgICAgICAgICAgLy8gZnJvbSB0aGUgcXVldWUgYW5kIHRoZSByZWZlcmVuY2VkIGV2ZW50IHJldHVybmVkLgotICAgICAgICAgICAgZXZlbnQgPSByZW1vdmVFdmVudEZyb21RdWV1ZV9sKGV2ZW50SUQpOwotICAgICAgICB9Ci0KLSAgICAgICAgaWYgKGV2ZW50ICE9IE5VTEwpIHsKLSAg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HJlbWFpbmluZ1NpemUgPSB0b3RhbFNpemU7Ci0gICAgd2hpbGUgKHJlbWFpbmluZ1NpemUgPj0gOCkgewotICAgICAgICB1aW50OF90IGNodW5rSGVhZGVyWzhdOwotICAgICAgICBpZiAobURhdGFTb3VyY2UtPnJlYWRBdChvZmZzZXQsIGNodW5rSGVhZGVyLCA4KSA8IDgpIHsKLSAgICAgICAgICAgIHJldHVybiBOT19JTklUOwotICAgICAgICB9Ci0KLSAgICAgICAgcmVtYWluaW5nU2l6ZSAtPSA4OwotICAgICAgICBvZmZzZXQgKz0gODsKLQotICAgICAgICB1aW50MzJfdCBjaHVua1NpemUgPSBVMzJfTEVfQVQoJmNodW5rSGVhZGVyWzRdKTsKLQotICAgICAgICBpZiAoY2h1bmtTaXplID4gcmVtYWluaW5nU2l6ZSkgewotICAgICAgICAgICAgcmV0dXJuIE5PX0lOSVQ7Ci0gICAgICAgIH0KLQotICAgICAgICBpZiAoIW1lbWNtcChjaHVua0hlYWRlciwgImZtdCAiLCA0KSkgewotICAgICAgICAgICAgaWYgKGNodW5rU2l6ZSA8IDE2KSB7Ci0gICAgICAgICAgICAgICAgcmV0dXJuIE5PX0lOSVQ7Ci0gICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgIHVpbnQ4X3QgZm9ybWF0U3BlY1s0MF07Ci0gICAgICAgICAgICBpZiAobURhdGFTb3VyY2UtPnJlYWRBdChvZmZzZXQsIGZvcm1hdFNwZWMsIDIpIDwgMikgewotICAgICAgICAgICAgICAgIHJldHVybiBOT19JTklUOwotICAgICAgICAgICAgfQotCi0gICAgICAgICAgICBtV2F2ZUZvcm1hdCA9IFUxNl9MRV9BVChmb3JtYXRTcGVjKTsKLSAgICAgICAgICAgIGlmIChtV2F2ZUZvcm1hdCAhPSBXQVZFX0ZPUk1BVF9QQ00KLSAgICAgICAgICAgICAgICAgICAgJiYgbVdhdmVGb3JtYXQgIT0gV0FWRV9GT1JNQVRfQUxBVwotICAgICAgICAgICAgICAgICAgICAmJiBtV2F2ZUZvcm1hdCAhPSBXQVZFX0ZPUk1BVF9NVUxBVwotICAgICAgICAgICAgICAgICAgICAmJiBtV2F2ZUZvcm1hdCAhPSBXQVZFX0ZPUk1BVF9FWFRFTlNJQkxFKSB7Ci0gICAgICAgICAgICAgICAgcmV0dXJuIEVSUk9SX1VOU1VQUE9SVEVEOwotICAgICAgICAgICAgfQotCi0gICAgICAgICAgICB1aW50OF90IGZtdFNpemUgPSAxNjsKLSAgICAgICAgICAgIGlmIChtV2F2ZUZvcm1hdCA9PSBXQVZFX0ZPUk1BVF9FWFRFTlNJQkxFKSB7Ci0gICAgICAgICAgICAgICAgZm10U2l6ZSA9IDQwOwotICAgICAgICAgICAgfQotICAgICAgICAgICAgaWYgKG1EYXRhU291cmNlLT5yZWFkQXQob2Zmc2V0LCBmb3JtYXRTcGVjLCBmbXRTaXplKSA8IGZtdFNpemUpIHsKLSAgICAgICAgICAgICAgICByZXR1cm4gTk9fSU5JVDsKLSAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgbU51bUNoYW5uZWxzID0gVTE2X0xFX0FUKCZmb3JtYXRTcGVjWzJdKTsKLSAgICAgICAgICAgIGlmIChtV2F2ZUZvcm1hdCAhPSBXQVZFX0ZPUk1BVF9FWFRFTlNJQkxFKSB7Ci0gICAgICAgICAgICAgICAgaWYgKG1OdW1DaGFubmVscyAhPSAxICYmIG1OdW1DaGFubmVscyAhPSAyKSB7Ci0gICAgICAgICAgICAgICAgICAgIEFMT0dXKCJNb3JlIHRoYW4gMiBjaGFubmVscyAoJWQpIGluIG5vbi1XQVZFX0VYVCwgdW5rbm93biBjaGFubmVsIG1hc2siLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1OdW1DaGFubmVscyk7Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgfSBlbHNlIHsKLSAgICAgICAgICAgICAgICBpZiAobU51bUNoYW5uZWxzIDwgMSAmJiBtTnVtQ2hhbm5lbHMgPiA4KSB7Ci0gICAgICAgICAgICAgICAgICAgIHJldHVybiBFUlJPUl9VTlNVUFBPUlRFRDsKLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgIG1TYW1wbGVSYXRlID0gVTMyX0xFX0FUKCZmb3JtYXRTcGVjWzRdKTsKLQotICAgICAgICAgICAgaWYgKG1TYW1wbGVSYXRlID09IDApIHsKLSAgICAgICAgICAgICAgICByZXR1cm4gRVJST1JfTUFMRk9STUVEOwotICAgICAgICAgICAgfQotCi0gICAgICAgICAgICBtQml0c1BlclNhbXBsZSA9IFUxNl9MRV9BVCgmZm9ybWF0U3BlY1sxNF0pOwotCi0gICAgICAgICAgICBpZiAobVdhdmVGb3JtYXQgPT0gV0FWRV9GT1JNQVRfUENNCi0gICAgICAgICAgICAgICAgICAgIHx8IG1XYXZlRm9ybWF0ID09IFdBVkVfRk9STUFUX0VYVEVOU0lCTEUpIHsKLSAgICAgICAgICAgICAgICBpZiAobUJpdHNQZXJTYW1wbGUgIT0gOCAmJiBtQml0c1BlclNhbXBsZSAhPSAxNgotICAgICAgICAgICAgICAgICAgICAmJiBtQml0c1BlclNhbXBsZSAhPSAyNCkgewotICAgICAgICAgICAgICAgICAgICByZXR1cm4gRVJST1JfVU5TVVBQT1JURUQ7Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgfSBlbHNlIHsKLSAgICAgICAgICAgICAgICBDSEVDSyhtV2F2ZUZvcm1hdCA9PSBXQVZFX0ZPUk1BVF9NVUxBVwotICAgICAgICAgICAgICAgICAgICAgICAgfHwgbVdhdmVGb3JtYXQgPT0gV0FWRV9GT1JNQVRfQUxBVyk7Ci0gICAgICAgICAgICAgICAgaWYgKG1CaXRzUGVyU2FtcGxlICE9IDgpIHsKLSAgICAgICAgICAgICAgICAgICAgcmV0dXJuIEVSUk9SX1VOU1VQUE9SVEVEOwotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgaWYgKG1XYXZlRm9ybWF0ID09IFdBVkVfRk9STUFUX0VYVEVOU0lCTEUpIHsKLSAgICAgICAgICAgICAgICB1aW50MTZfdCB2YWxpZEJpdHNQZXJTYW1wbGUgPSBVMTZfTEVfQVQoJmZvcm1hdFNwZWNbMThdKTsKLSAgICAgICAgICAgICAgICBpZiAodmFsaWRCaXRzUGVyU2FtcGxlICE9IG1CaXRzUGVyU2FtcGxlKSB7Ci0gICAgICAgICAgICAgICAgICAgIEFMT0dFKCJ2YWxpZEJpdHMoJWQpICE9IGJpdHNQZXJTYW1wbGUoJWQpIGFyZSBub3Qgc3VwcG9ydGVkIiwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YWxpZEJpdHNQZXJTYW1wbGUsIG1CaXRzUGVyU2FtcGxlKTsKLSAgICAgICAgICAgICAgICAgICAgcmV0dXJuIEVSUk9SX1VOU1VQUE9SVEVEOwotICAgICAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgICAgIG1DaGFubmVsTWFzayA9IFUzMl9MRV9BVCgmZm9ybWF0U3BlY1syMF0pOwotICAgICAgICAgICAgICAgIEFMT0dWKCJudW1DaGFubmVscz0lZCBjaGFubmVsTWFzaz0weCV4IiwgbU51bUNoYW5uZWxzLCBtQ2hhbm5lbE1hc2spOwotICAgICAgICAgICAgICAgIGlmICgobUNoYW5uZWxNYXNrID4+IDE4KSAhPSAwKSB7Ci0gICAgICAgICAgICAgICAgICAgIEFMT0dFKCJpbnZhbGlkIGNoYW5uZWwgbWFzayAweCV4IiwgbUNoYW5uZWxNYXNrKTsKLSAgICAgICAgICAgICAgICAgICAgcmV0dXJuIEVSUk9SX01BTEZPUk1FRDsKLSAgICAgICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgICAgICBpZiAoKG1DaGFubmVsTWFzayAhPSBDSEFOTkVMX01BU0tfVVNFX0NIQU5ORUxfT1JERVIpCi0gICAgICAgICAgICAgICAgICAgICAgICAmJiAocG9wY291bnQobUNoYW5uZWxNYXNrKSAhPSBtTnVtQ2hhbm5lbHMpKSB7Ci0gICAgICAgICAgICAgICAgICAgIEFMT0dFKCJpbnZhbGlkIG51bWJlciBvZiBjaGFubmVscyAoJWQpIGluIGNoYW5uZWwgbWFzayAoMHgleCkiLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBvcGNvdW50KG1DaGFubmVsTWFzayksIG1DaGFubmVsTWFzayk7Ci0gICAgICAgICAgICAgICAgICAgIHJldHVybiBFUlJPUl9NQUxGT1JNRUQ7Ci0gICAgICAgICAgICAgICAgfQotCi0gICAgICAgICAgICAgICAgLy8gSW4gYSBXQVZFX0VYVCBoZWFkZXIsIHRoZSBmaXJzdCB0d28gYnl0ZXMgb2YgdGhlIEdVSUQgc3RvcmVkIGF0IGJ5dGUgMjQgY29udGFpbgotICAgICAgICAgICAgICAgIC8vIHRoZSBzYW1wbGUgZm9ybWF0LCB1c2luZyB0aGUgc2FtZSBkZWZpbml0aW9ucyBhcyBhIHJlZ3VsYXIgV0FWIGhlYWRlcgotICAgICAgICAgICAgICAgIG1XYXZlRm9ybWF0ID0gVTE2X0xFX0FUKCZmb3JtYXRTcGVjWzI0XSk7Ci0gICAgICAgICAgICAgICAgaWYgKG1XYXZlRm9ybWF0ICE9IFdBVkVfRk9STUFUX1BDTQotICAgICAgICAgICAgICAgICAgICAgICAgJiYgbVdhdmVGb3JtYXQgIT0gV0FWRV9GT1JNQVRfQUxBVwotICAgICAgICAgICAgICAgICAgICAgICAgJiYgbVdhdmVGb3JtYXQgIT0gV0FWRV9GT1JNQVRfTVVMQVcpIHsKLSAgICAgICAgICAgICAgICAgICAgcmV0dXJuIEVSUk9SX1VOU1VQUE9SVEVEOwotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICBpZiAobWVtY21wKCZmb3JtYXRTcGVjWzI2XSwgV0FWRUVYVF9TVUJGT1JNQVQsIDE0KSkgewotICAgICAgICAgICAgICAgICAgICBBTE9HRSgidW5zdXBwb3J0ZWQgR1VJRCIpOwotICAgICAgICAgICAgICAgICAgICByZXR1cm4gRVJST1JfVU5TVVBQT1JURUQ7Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgfQotCi0gICAgICAgICAgICBtVmFsaWRGb3JtYXQgPSB0cnVlOwotICAgICAgICB9IGVsc2UgaWYgKCFtZW1jbXAoY2h1bmtIZWFkZXIsICJkYXRhIiwgNCkpIHsKLSAgICAgICAgICAgIGlmIChtVmFsaWRGb3JtYXQpIHsKLSAgICAgICAgICAgICAgICBtRGF0YU9mZnNldCA9IG9mZnNldDsKLSAgICAgICAgICAgICAgICBtRGF0YVNpemUgPSBjaHVua1NpemU7Ci0KLSAgICAgICAgICAgICAgICBtVHJhY2tNZXRhID0gbmV3IE1ldGFEYXRhOwotCi0gICAgICAgICAgICAgICAgc3dpdGNoIChtV2F2ZUZvcm1hdCkgewotICAgICAgICAgICAgICAgICAgICBjYXNlIFdBVkVfRk9STUFUX1BDTToKLSAgICAgICAgICAgICAgICAgICAgICAgIG1UcmFja01ldGEtPnNldENTdHJpbmcoCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGtLZXlNSU1FVHlwZSwgTUVESUFfTUlNRVRZUEVfQVVESU9fUkFXKTsKLSAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOwotICAgICAgICAgICAgICAgICAgICBjYXNlIFdBVkVfRk9STUFUX0FMQVc6Ci0gICAgICAgICAgICAgICAgICAgICAgICBtVHJhY2tNZXRhLT5zZXRDU3RyaW5nKAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBrS2V5TUlNRVR5cGUsIE1FRElBX01JTUVUWVBFX0FVRElPX0c3MTFfQUxBVyk7Ci0gICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKLSAgICAgICAgICAgICAgICAgICAgZGVmYXVsdDoKLSAgICAgICAgICAgICAgICAgICAgICAgIENIRUNLX0VRKG1XYXZlRm9ybWF0LCAodWludDE2X3QpV0FWRV9GT1JNQVRfTVVMQVcpOwotICAgICAgICAgICAgICAgICAgICAgICAgbVRyYWNrTWV0YS0+c2V0Q1N0cmluZygKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAga0tleU1JTUVUeXBlLCBNRURJQV9NSU1FVFlQRV9BVURJT19HNzExX01MQVcpOwotICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7Ci0gICAgICAgICAgICAgICAgfQotCi0gICAgICAgICAgICAgICAgbVRyYWNrTWV0YS0+c2V0SW50MzIoa0tleUNoYW5uZWxDb3VudCwgbU51bUNoYW5uZWxzKTsKLSAgICAgICAgICAgICAgICBtVHJhY2tNZXRhLT5zZXRJbnQzMihrS2V5Q2hhbm5lbE1hc2ssIG1DaGFubmVsTWFzayk7Ci0gICAgICAgICAgICAgICAgbVRyYWNrTWV0YS0+c2V0SW50MzIoa0tleVNhbXBsZVJhdGUsIG1TYW1wbGVSYXRlKTsKLQotICAgICAgICAgICAgICAgIHNpemVfdCBieXRlc1BlclNhbXBsZSA9IG1CaXRzUGVyU2FtcGxlID4+IDM7Ci0KLSAgICAgICAgICAgICAgICBpbnQ2NF90IGR1cmF0aW9uVXMgPQotICAgICAgICAgICAgICAgICAgICAxMDAwMDAwTEwgKiAobURhdGFTaXplIC8gKG1OdW1DaGFubmVscyAqIGJ5dGVzUGVyU2FtcGxlKSkKLSAgICAgICAgICAgICAgICAgICAgICAgIC8gbVNhbXBsZVJhdGU7Ci0KLSAgICAgICAgICAgICAgICBtVHJhY2tNZXRhLT5zZXRJbnQ2NChrS2V5RHVyYXRpb24sIGR1cmF0aW9uVXMpOwotCi0gICAgICAgICAgICAgICAgcmV0dXJuIE9LOwotICAgICAgICAgICAgfQotICAgICAgICB9Ci0KLSAgICAgICAgb2Zmc2V0ICs9IGNodW5rU2l6ZTsKLSAgICB9Ci0KLSAgICByZXR1cm4gTk9fSU5JVDsKLX0KLQotY29uc3Qgc2l6ZV90IFdBVlNvdXJjZTo6a01heEZyYW1lU2l6ZSA9IDMyNzY4OwotCi1XQVZTb3VyY2U6OldB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GJ1ZmZlci0+cmVsZWFzZSgpOwotICAgICAgICAgICAgYnVmZmVyID0gdG1wOwotICAgICAgICB9IGVsc2UgaWYgKG1CaXRzUGVyU2FtcGxlID09IDI0KSB7Ci0gICAgICAgICAgICAvLyBDb252ZXJ0IDI0LWJpdCBzaWduZWQgc2FtcGxlcyB0byAxNi1iaXQgc2lnbmVkLgotCi0gICAgICAgICAgICBjb25zdCB1aW50OF90ICpzcmMgPQotICAgICAgICAgICAgICAgIChjb25zdCB1aW50OF90ICopYnVmZmVyLT5kYXRhKCkgKyBidWZmZXItPnJhbmdlX29mZnNldCgpOwotICAgICAgICAgICAgaW50MTZfdCAqZHN0ID0gKGludDE2X3QgKilzcmM7Ci0KLSAgICAgICAgICAgIHNpemVfdCBudW1TYW1wbGVzID0gYnVmZmVyLT5yYW5nZV9sZW5ndGgoKSAvIDM7Ci0gICAgICAgICAgICBmb3IgKHNpemVfdCBpID0gMDsgaSA8IG51bVNhbXBsZXM7ICsraSkgewotICAgICAgICAgICAgICAgIGludDMyX3QgeCA9IChpbnQzMl90KShzcmNbMF0gfCBzcmNbMV0gPDwgOCB8IHNyY1syXSA8PCAxNik7Ci0gICAgICAgICAgICAgICAgeCA9ICh4IDw8IDgpID4+IDg7ICAvLyBzaWduIGV4dGVuc2lvbgotCi0gICAgICAgICAgICAgICAgeCA9IHggPj4gODsKLSAgICAgICAgICAgICAgICAqZHN0KysgPSAoaW50MTZfdCl4OwotICAgICAgICAgICAgICAgIHNyYyArPSAzOwotICAgICAgICAgICAgfQotCi0gICAgICAgICAgICBidWZmZXItPnNldF9yYW5nZShidWZmZXItPnJhbmdlX29mZnNldCgpLCAyICogbnVtU2FtcGxlcyk7Ci0gICAgICAgIH0KLSAgICB9Ci0KLSAgICBzaXplX3QgYnl0ZXNQZXJTYW1wbGUgPSBtQml0c1BlclNhbXBsZSA+PiAzOwotCi0gICAgYnVmZmVyLT5tZXRhX2RhdGEoKS0+c2V0SW50NjQoCi0gICAgICAgICAgICBrS2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B7Ci0gICAgICAgICAgICAzMiwgNDgsIDU2LCA2NCwgODAsIDk2LCAxMTIsIDEyOCwKLSAgICAgICAgICAgIDE0NCwgMTYwLCAxNzYsIDE5MiwgMjI0LCAyNTYKLSAgICAgICAgfTsKLQotICAgICAgICBpbnQgYml0cmF0ZSA9Ci0gICAgICAgICAgICAodmVyc2lvbiA9PSAzIC8qIFYxICovKQotICAgICAgICAgICAgICAgID8ga0JpdHJhdGVWMVtiaXRyYXRlX2luZGV4IC0gMV0KLSAgICAgICAgICAgICAgICA6IGtCaXRyYXRlVjJbYml0cmF0ZV9pbmRleCAtIDFdOwotCi0gICAgICAgIGlmIChvdXRfYml0cmF0ZSkgewotICAgICAgICAgICAgKm91dF9iaXRyYXRlID0gYml0cmF0ZTsKLSAgICAgICAgfQotCi0gICAgICAgICpmcmFtZV9zaXplID0gKDEyMDAwICogYml0cmF0ZSAvIHNhbXBsaW5nX3JhdGUgKyBwYWRkaW5nKSAqIDQ7Ci0KLSAgICAgICAgaWYgKG91dF9udW1fc2FtcGxlcykgewotICAgICAgICAgICAgKm91dF9udW1fc2FtcGxlcyA9IDM4NDsKLSAgICAgICAgfQotICAgIH0gZWxzZSB7Ci0gICAgICAgIC8vIGxheWVyIElJIG9yIElJSQotCi0gICAgICAgIHN0YXRpYyBjb25zdCBpbnQga0JpdHJhdGVWMUwyW10gPSB7Ci0gICAgICAgICAgICAzMiwgNDgsIDU2LCA2NCwgODAsIDk2LCAxMTIsIDEyOCwKLSAgICAgICAgICAgIDE2MCwgMTkyLCAyMjQsIDI1NiwgMzIwLCAzODQKLSAgICAgICAgfTsKLQotICAgICAgICBzdGF0aWMgY29uc3QgaW50IGtCaXRyYXRlVjFMM1tdID0gewotICAgICAgICAgICAgMzIsIDQwLCA0OCwgNTYsIDY0LCA4MCwgOTYsIDExMiwKLSAgICAgICAgICAgIDEyOCwgMTYwLCAxOTIsIDIyNCwgMjU2LCAzMjAKLSAgICAgICAgfTsKLQotICAgICAgICBzdGF0aWMgY29uc3QgaW50IGtCaXRyYXRlVjJbXSA9IHsKLSAgICAgICAgICAgIDgsIDE2LCAyNCwgMzIsIDQwLCA0OCwgNTYsIDY0LAotICAgICAgICAgICAgODAsIDk2LCAxMTIsIDEyOCwgMTQ0LCAxNjAKLSAgICAgICAgfTsKLQotICAgICAgICBpbnQgYml0cmF0ZTsKLSAgICAgICAgaWYgKHZlcnNpb24gPT0gMyAvKiBWMSAqLykgewotICAgICAgICAgICAgYml0cmF0ZSA9IChsYXllciA9PSAyIC8qIEwyICovKQotICAgICAgICAgICAgICAgID8ga0JpdHJhdGVWMUwyW2JpdHJhdGVfaW5kZXggLSAxXQotICAgICAgICAgICAgICAgIDoga0JpdHJhdGVWMUwzW2JpdHJhdGVfaW5kZXggLSAxXTsKLQotICAgICAgICAgICAgaWYgKG91dF9udW1fc2FtcGxlcykgewotICAgICAgICAgICAgICAgICpvdXRfbnVtX3NhbXBsZXMgPSAxMTUyOwotICAgICAgICAgICAgfQotICAgICAgICB9IGVsc2UgewotICAgICAgICAgICAgLy8gVjIgKG9yIDIuNSkKLQotICAgICAgICAgICAgYml0cmF0ZSA9IGtCaXRyYXRlVjJbYml0cmF0ZV9pbmRleCAtIDFdOwotICAgICAgICAgICAgaWYgKG91dF9udW1fc2FtcGxlcykgewotICAgICAgICAgICAgICAgICpvdXRfbnVtX3NhbXBsZXMgPSA1NzY7Ci0gICAgICAgICAgICB9Ci0gICAgICAgIH0KLQotICAgICAgICBpZiAob3V0X2JpdHJhdGUpIHsKLSAgICAgICAgICAgICpvdXRfYml0cmF0ZSA9IGJpdHJhdGU7Ci0gICAgICAgIH0KLQotICAgICAgICBpZiAodmVyc2lvbiA9PSAzIC8qIFYxICovKSB7Ci0gICAgICAgICAgICAqZnJhbWVfc2l6ZSA9IDE0NDAwMCAqIGJpdHJhdGUgLyBzYW1wbGluZ19yYXRlICsgcGFkZGluZzsKLSAgICAgICAgfSBlbHNlIHsKLSAgICAgICAgICAgIC8vIFYyIG9yIFYyLj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U5HKSB7Ci0gICAgICAgICAgICAgICAgTVlfTE9HSShTdHJpbmdQcmludGYoCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgIkRpcmVjdCByZWFkIGZhaWxlZCB3LyBzdGF0dXMgJWRcbiIsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgcmVxdWVzdC0+c3RhdHVzKCkuc3RhdHVzKCkpLmNfc3RyKCkpOwotCi0gICAgICAgICAgICAgICAgbU93bmVyLT5vblJlYWRDb21wbGV0ZWQoRVJST1JfSU8pOwotICAgICAgICAgICAgICAgIHJldHVybjsKLSAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgcmV0dXJuOwotICAgICAgICB9Ci0gICAgfQotCi0gICAgbU93bmVyLT5vblJlYWRDb21wbGV0ZWQobU51bUJ5dGVzUmVhZCk7Ci19Ci0KLXZvaWQgU2ZEZWxlZ2F0ZTo6aW5pdGlhdGVDb25uZWN0aW9uKAotICAgICAgICBjb25zdCBjaGFyICp1cmksCi0gICAgICAgIGNvbnN0IEtleWVkVmVjdG9yPFN0cmluZzgsIFN0cmluZzg+ICpoZWFkZXJzLAotICAgICAgICBvZmY2NF90IG9mZnNldCkgewotICAgIEdVUkwgdXJsKHVyaSk7Ci0KLSAgICBNZXNzYWdlTG9vcCAqbG9vcCA9IGdOZXR3b3JrVGhyZWFkLT5tZXNzYWdlX2xvb3AoKTsKLSAgICBsb29wLT5Qb3N0VGFzaygKLSAgICAgICAgICAgIEZST01fSEVSRSwKLSAgICAgICAgICAgIE5ld1J1bm5hYmxlRnVuY3Rpb24oCi0gICAgICAgICAgICAgICAgJlNmRGVsZWdhdGU6Ok9uSW5pdGlhdGVDb25uZWN0aW9uV3JhcHBlciwKLSAgICAgICAgICAgICAgICB0aGlzLAotICAgICAgICAgICAgICAgIHVybCwKLSAgICAgICAgICAgICAgICBoZWFkZXJzLAotICAgICAgICAgICAgICAgIG9mZnNldCkpOwotCi19Ci0KLS8vIHN0YXRpYwotdm9pZCBTZkRlbGVnY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PRklMRVRZUEUgKilwYXJhbXM7Ci0KLSAgICAgICAgICAgIGlmIChhYWNQYXJhbXMtPm5Qb3J0SW5kZXggIT0gMCkgewotICAgICAgICAgICAgICAgIHJldHVybiBPTVhfRXJyb3JVbmRlZmluZWQ7Ci0gICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgIGFhY1BhcmFtcy0+bkJpdFJhdGUgPSAwOwotICAgICAgICAgICAgYWFjUGFyYW1zLT5uQXVkaW9CYW5kV2lkdGggPSAwOwotICAgICAgICAgICAgYWFjUGFyYW1zLT5uQUFDdG9vbHMgPSAwOwotICAgICAgICAgICAgYWFjUGFyYW1zLT5uQUFDRVJ0b29scyA9IDA7Ci0gICAgICAgICAgICBhYWNQYXJhbXMtPmVBQUNQcm9maWxlID0gT01YX0FVRElPX0FBQ09iamVjdE1haW47Ci0KLSAgICAgICAgICAgIGFhY1BhcmFtcy0+ZUFBQ1N0cmVhbUZvcm1hdCA9Ci0gICAgICAgICAgICAgICAgbUlzQURUUwotICAgICAgICAgICAgICAgICAgICA/IE9NWF9BVURJT19BQUNTdHJlYW1Gb3JtYXRNUDRBRFRTCi0gICAgICAgICAgICAgICAgICAgIDogT01YX0FVRElPX0FBQ1N0cmVhbUZvcm1hdE1QNEZGOwotCi0gICAgICAgICAgICBhYWNQYXJhbXMtPmVDaGFubmVsTW9kZSA9IE9NWF9BVURJT19DaGFubmVsTW9kZVN0ZXJlbzsKLQotICAgICAgICAgICAgaWYgKCFpc0NvbmZpZ3VyZWQoKSkgewotICAgICAgICAgICAgICAgIGFhY1BhcmFtcy0+bkNoYW5uZWxzID0gMTsKLSAgICAgICAgICAgICAgICBhYWNQYXJhbXMtPm5TYW1wbGVSYXRlID0gNDQxMDA7Ci0gICAgICAgICAgICAgICAgYWFjUGFyYW1zLT5uRnJhbWVMZW5ndGggPSAwOwotICAgICAgICAgICAgfSBlbHNlIHsKLSAgICAgICAgICAgICAgICBhYWNQYXJhbXMtPm5DaGFubmVscyA9IG1Db25maWctP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hciAqKXJvbGVQYXJhbXMtPmNSb2xlLAotICAgICAgICAgICAgICAgICAgICAgICAgImF1ZGlvX2RlY29kZXIuYWFjIiwKLSAgICAgICAgICAgICAgICAgICAgICAgIE9NWF9NQVhfU1RSSU5HTkFNRV9TSVpFIC0gMSkpIHsKLSAgICAgICAgICAgICAgICByZXR1cm4gT01YX0Vycm9yVW5kZWZpbmVkOwotICAgICAgICAgICAgfQotCi0gICAgICAgICAgICByZXR1cm4gT01YX0Vycm9yTm9uZTsKLSAgICAgICAgfQotCi0gICAgICAgIGNhc2UgT01YX0luZGV4UGFyYW1BdWRpb0FhYzoKLSAgICAgICAgewotICAgICAgICAgICAgY29uc3QgT01YX0FVRElPX1BBUkFNX0FBQ1BST0ZJTEVUWVBFICphYWNQYXJhbXMgPQotICAgICAgICAgICAgICAgIChjb25zdCBPTVhfQVVESU9fUEFSQU1fQUFDUFJPRklMRVRZUEUgKilwYXJhbXM7Ci0KLSAgICAgICAgICAgIGlmIChhYWNQYXJhbXMtPm5Qb3J0SW5kZXggIT0gMCkgewotICAgICAgICAgICAgICAgIHJldHVybiBPTVhfRXJyb3JVbmRlZmluZWQ7Ci0gICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgIGlmIChhYWNQYXJhbXMtPmVBQUNTdHJlYW1Gb3JtYXQgPT0gT01YX0FVRElPX0FBQ1N0cmVhbUZvcm1hdE1QNEZGKSB7Ci0gICAgICAgICAgICAgICAgbUlzQURUUyA9IGZhbHNlOwotICAgICAgICAgICAgfSBlbHNlIGlmIChhYWNQYXJhbXMtPmVBQUNTdHJlYW1Gb3JtYXQKLSAgICAgICAgICAgICAgICAgICAgICAgID09IE9NWF9BVURJT19BQUNTdHJlYW1Gb3JtYXRNUDRBRFRTKSB7Ci0gICAgICAgICAgICAgICAgbUlzQURUUyA9IHRydWU7Ci0gICAgICAgICAgICB9IGVsc2UgewotICAgICAgICAgICAgICAgIHJldHVybiBPTVhfRXJyb3JVbmRlZmluZWQ7Ci0gICAgICA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gICAgICAgICAgICAgICBub3RpZnkoT01YX0V2ZW50UG9ydFNldHRpbmdzQ2hhbmdlZCwgMSwgMCwgTlVMTCk7Ci0gICAgICAgICAgICAgICAgICAgIG1PdXRwdXRQb3J0U2V0dGluZ3NDaGFuZ2UgPSBBV0FJVElOR19ESVNBQkxFRDsKLSAgICAgICAgICAgICAgICAgICAgcmV0dXJuOwotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgIH0gZWxzZSB7ICAvLyBtSW5wdXRCdWZmZXJDb3VudCA9PSAyCi0gICAgICAgICAgICAgICAgaWYgKG1Db25maWctPmV4dGVuZGVkQXVkaW9PYmplY3RUeXBlID09IE1QNEFVRElPX0FBQ19MQyB8fAotICAgICAgICAgICAgICAgICAgICBtQ29uZmlnLT5leHRlbmRlZEF1ZGlvT2JqZWN0VHlwZSA9PSBNUDRBVURJT19MVFApIHsKLSAgICAgICAgICAgICAgICAgICAgaWYgKG1VcHNhbXBsaW5nRmFjdG9yID09IDIpIHsKLSAgICAgICAgICAgICAgICAgICAgICAgIC8vIFRoZSBzdHJlYW0gdHVybnMgb3V0IHRvIGJlIG5vdCBhYWNQbHVzIG1vZGUgYW55d2F5Ci0gICAgICAgICAgICAgICAgICAgICAgICBBTE9HVygiRGlzYWJsZSBBQUMrL2VBQUMrIHNpbmNlIGV4dGVuZGVkIGF1ZGlvIG9iamVjdCAiCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICJ0eXBlIGlzICVkIiwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbUNvbmZpZy0+ZXh0ZW5kZWRBdWRpb09iamVjdFR5cGUpOwotICAgICAgICAgICAgICAgICAgICAgICAgbUNvbmZpZy0+YWFjUGx1c0VuYWJsZWQgPSAwOwotICAgICAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgfSBlbHNlIHsKLSAgICAgICAgICAgICAgICAgICAgaWYgKG1VcHNhbXBsaW5nRmFjdG9yID09IDEpIHsKLSAgICAgICAgICAgICAgICAgICAgICAgIC8vIGFhY1BsdXMgbW9kZSBkb2VzIG5vdCBidXkgdXMgYW55dGhpbmcsIGJ1dCB0byBjYXVzZQotICAgICAgICAgICAgICAgICAgICAgICAgLy8gMS4gQ1BVIGxvYWQgdG8gaW5jcmVhc2UsIGFuZAotICAgICAgICAgICAgICAgICAgICAgICAgLy8gMi4gYSBoYWxmIHNwZWVkIG9mIGRlY29kaW5nCi0gICAgICAgICAgICAgICAgICAgICAgICBBTE9HVygiRGlzYWJsZSBBQUMrL2VBQUMrIHNpbmNlIHVwc2FtcGxpbmcgZmFjdG9yIGlzIDEiKTsKLSAgICAgICAgICAgICAgICAgICAgICAgIG1Db25maWctPmFhY1BsdXNFbmFibGVkID0gMDsKLSAgICAgICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgIH0KLSAgICAgICAgfQotCi0gICAgICAgIHNpemVfdCBudW1PdXRCeXRlcyA9Ci0gICAgICAgICAgICBtQ29uZmlnLT5mcmFtZUxlbmd0aCAqIHNpemVvZihpbnQxNl90KSAqIG1Db25maWctPmRlc2lyZWRDaGFubmVsczsKLQotICAgICAgICBpZiAoZGVjb2RlckVyciA9PSBNUDRBVURFQ19TVUNDRVNTKSB7Ci0gICAgICAgICAgICBDSEVDS19MRShtQ29uZmlnLT5pbnB1dEJ1ZmZlclVzZWRMZW5ndGgsIGluSGVhZGVyLT5uRmlsbGVkTGVuKTsKLQotICAgICAgICAgICAgaW5IZWFkZXItPm5GaWxsZWRMZW4gLT0gbUNvbmZpZy0+aW5wdXRCdWZmZXJVc2VkTGVuZ3RoOwotICAgICAgICAgICAgaW5IZWFkZXItPm5PZmZzZXQgKz0gbUNvbmZpZy0+aW5wdXRCdWZmZXJVc2VkTGVuZ3RoOwotICAgICAgICB9IGVsc2UgewotICAgICAgICAgICAgQUxPR1coIkFBQyBkZWNvZGVyIHJldHVybmVkIGVycm9yICVkLCBzdWJzdGl0dXRpbmcgc2lsZW5jZSIsCi0gICAgICAgICAgICAgICAgIGRlY29kZXJFcnIpOwotCi0gICAgICAgICAgICBtZW1zZXQob3V0SGVhZGVyLT5wQnVmZmVyICsgb3V0SGVhZGVyLT5uT2Zmc2V0LCAwLCBudW1PdXRCeXRlcyk7Ci0KLSAgICAgICAgICAgIC8vIERpc2NhcmQgaW5wdXQgYnVmZmVyLgotICAgICAgICAgICAgaW5IZWFkZXItPm5GaWxsZWRMZW4gPSAwOwotCi0gICAgICAgICAgICAvLyBmYWxsIHRocm91Z2gKLSAgICAgICAgfQotCi0gICAgICAgIGlmIChkZWNvZGVyRXJyID09IE1QNEFVREVDX1NVQ0NFU1MgfHwgbU51bVNhbXBsZXNPdXRwdXQgPiAwKSB7Ci0gICAgICAgICAgICAvLyBXZSdsbCBvbmx5IG91dHB1dCBkYXRhIGlmIHdlIHN1Y2Nlc3NmdWxseSBkZWNvZGVkIGl0IG9yCi0gICAgICAgICAgICAvLyB3ZSd2ZSBwcmV2aW91c2x5IGRlY29kZWQgdmFsaWQgZGF0YSwgaW4gdGhlIGxhdHRlciBjYXNlCi0gICAgICAgICAgICAvLyAoZGVjb2RlIGZhaWxlZCkgd2UnbGwgb3V0cHV0IGEgc2lsZW50IGZyYW1lLgotCi0gICAgICAgICAgICBpZiAobVVwc2FtcGxpbmdGYWN0b3IgPT0gMikgewotICAgICAgICAgICAgICAgIGlmIChtQ29uZmlnLT5kZXNpcmVkQ2hhbm5lbHMgPT0gMSkgewotICAgICAgICAgICAgICAgICAgICBtZW1jcHkoJm1Db25maWctPnBPdXRwdXRCdWZmZXJbMTAyNF0sCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAmbUNvbmZpZy0+cE91dHB1dEJ1ZmZlclsyMDQ4XSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgIG51bU91dEJ5dGVzICogMik7Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgIG51bU91dEJ5dGVzICo9IDI7Ci0gICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgIG91dEhlYWRlci0+bkZpbGxlZExlbiA9IG51bU91dEJ5dGVzOwotICAgICAgICAgICAgb3V0SGVhZGVyLT5uRmxhZ3MgPSAwOwotCi0gICAgICAgICAgICBvdXRIZWFkZXItPm5UaW1lU3RhbXAgPQotICAgICAgICAgICAgICAgIG1BbmNob3JUaW1lVXMKLSAgICAgICAgICAgICAgICAgICAgKyAobU51bVNhbXBsZXNPdXRwdXQgKiAxMDAwMDAwbGwpIC8gbUNvbmZpZy0+c2FtcGxpbmdSYXRlOwotCi0gICAgICAgICAgICBtTnVtU2FtcGxlc091dHB1dCArPSBtQ29uZmlnLT5mcmFtZUxlbmd0aCAqIG1VcHNhbXBsaW5nRmFjdG9yOwotCi0gICAgICAgICAgICBvdXRJbmZvLT5tT3duZWRCeVVzID0gZmFsc2U7Ci0gICAgICAgICAgICBvdXRRdWV1ZS5lcmFzZShvdXRRdWV1ZS5iZWdpbigpKTsKLSAgICAgICAgICAgIG91dEluZm8gPSBOVUxMOwotICAgICAgICAgICAgbm90aWZ5RmlsbEJ1ZmZlckRvbmUob3V0SGVhZGVyKTsKLSAgICAgICAgICAgIG91dEhlYWRlciA9IE5VTEw7Ci0gICAgICAgIH0KLQotICAgICAgICBpZiAoaW5IZWFkZXItPm5GaWxsZWRMZW4gPT0gMCkgewotICAgICAgICAgICAgaW5JbmZvLT5tT3duZWRCeVVzID0gZmFsc2U7Ci0gICAgICAgICAgICBpblF1ZXVlLmVyYXNlKGluUXVldWUuYmVnaW4oKSk7Ci0gICAgICAgICAgICBpbkluZm8gPSBOVUxMOwotICAgICAgICAgICAgbm90aWZ5RW1wdHlCdWZmZXJEb25lKGluSGVhZGVyKTsKLSAgICAgICAgICAgIGluSGVhZGVyID0gTlVMTDsKLSAgICAgICAgfQotCi0gICAgICAgIGlmIChkZWNvZGVyRXJyID09IE1QNEFVREVDX1NVQ0NFU1MpIHsKLSAgICAgICAgICAgICsrbUlucHV0QnVmZmVyQ291bnQ7Ci0gICAgICAgIH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yKyspOwotICAgICAgICBJbnQzMiB0bXAyID0gKihwdF92ZWMrKyk7Ci0gICAgICAgIEludDMyIHRtcDQgPSAqKHB0X3ZlYysrKTsKLSAgICAgICAgKihwdF9jb3MrKykgPSAodG1wMSAtIHRtcDIpID4+IDE7Ci0gICAgICAgICoocHRfY29zKyspID0gKHRtcDMgLSB0bXA0KSA+PiAxOwotICAgICAgICAqKHB0X3NpbisrKSA9ICh0bXAxICsgdG1wMik7Ci0gICAgICAgICoocHRfc2luKyspID0gKHRtcDMgKyB0bXA0KTsKLSAgICAgICAgdG1wMSA9ICoocHRfdmVjXzMyKyspOwotICAgICAgICB0bXAzID0gKihwdF92ZWNfMzIrKyk7Ci0gICAgICAgIHRtcDIgPSAqKHB0X3ZlYysrKTsKLSAgICAgICAgdG1wNCA9ICoocHRfdmVjKyspOwotICAgICAgICAqKHB0X2NvcysrKSA9ICh0bXAxIC0gdG1wMikgPj4gMTsKLSAgICAgICAgKihwdF9jb3MrKykgPSAodG1wMyAtIHRtcDQpID4+IDE7Ci0gICAgICAgICoocHRfc2luKyspID0gKHRtcDEgKyB0bXAyKTsKLSAgICAgICAgKihwdF9zaW4rKykgPSAodG1wMyArIHRtcDQpOwotICAgIH0KLQotCi0gICAgaWRjdF8zMihjb3NpbmVfdGVybSwgc2NyYXRjaF9tZW1bMV0pOwotCi0gICAgZHN0XzMyKHNpbmVfdGVybSwgc2NyYXRjaF9tZW1bMV0pOwotCi0gICAgcHRfY29zICA9IGNvc2luZV90ZXJtOwotICAgIHB0X3NpbiAgPSBzaW5lX3Rlcm07Ci0KLSAgICBwdF9jb3NfdCAgPSBjb3NpbmVfdG90YWw7Ci0KLSAgICBmb3IgKGkgPSAwOyBpIDwgbWF4QmFuZDsgaSArPSA0KQotICAgIHsKLSAgICAgICAgKihwdF9jb3NfdCsrKSA9ICgqKHB0X2NvcysrKSArICoocHRfc2luKyspKTsKLSAgICAgICAgKihwdF9jb3NfdCsrKSA9ICgtKihwdF9jb3MrKykgKyAqKHB0X3NpbisrKSk7Ci0gICAgICAgICoocHRfY29zX3QrKykgPSAoLSoocHRfY29zKyspIC0gKihwdF9zaW4rKykpOwotICAgICAgICAqKHB0X2Nvc190KyspID0gKCoocHRfY29zKyspIC0gKihwdF9zaW4rKykpOwotICAgIH0KLQotICAgIHB0X2Nvc190ICA9ICZjb3NpbmVfdG90YWxbbWF4QmFuZF07Ci0KLSAgICBmb3IgKGkgPSAoMzIgLSBtYXhCYW5kKTsgaSAhPSAwOyBpLS0pCi0gICAgewotICAgICAgICAqKHB0X2Nvc190KyspID0gICAwOwotICAgIH0KLX0KLQotCi0jaWZkZWYgSFFfU0JSCi0KLQotdm9pZCBhbmFseXNpc19zdWJfYmFuZChJbnQzMiB2ZWNbNjRdLAotICAgICAgICAgICAgICAgICAgICAgICBJbnQzMiBjb3NpbmVfdG90YWxbXSwKLSAgICAgICAgICAgICAgICAgICAgICAgSW50MzIgc2luZV90b3RhbFtdLAotICAgICAgICAgICAgICAgICAgICAgICBJbnQzMiBtYXhCYW5kLAotICAgICAgICAgICAgICAgICAgICAgICBJbnQzMiBzY3JhdGNoX21lbVtdWzY0XSkKLXsKLSAgICBJbnQzMiBpOwotICAgIEludDMyICpzaW5lX3Rlcm0xICAgPSAmc2NyYXRjaF9tZW1bMF1bMF07Ci0gICAgSW50MzIgKnNpbmVfdGVybTIgICA9ICZzY3JhdGNoX21lbVswXVszMl07Ci0KLSAgICBJbnQzMiB0ZW1wMTsKLSAgICBJbnQzMiB0ZW1wMjsKLSAgICBJbnQzMiB0ZW1wMzsKLSAgICBJbnQzMiB0ZW1wNDsKLQotICAgIGNvbnN0IEludDMyICpwdF9leHA7Ci0gICAgSW50MzIgZXhwXzFfNTsKLQotICAgIEludDMyICpwdF92ZWMgICAgPSAgJnZlY1swXTsKLSAgICBJbnQzMiAqcHRfdmVjXzMyID0gICZ2ZWNbMzJdOwotCi0gICAgSW50MzIgKnB0X2NvczEgPSBwdF92ZWM7Ci0gICAgSW50MzIgKnB0X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XJ0XTsKLQotICAgICAgICBwYXJ0aXRpb24gPSAqKHBHcm91cCk7Ci0KLSAgICAgICAgcEdyb3VwID0gcEdyb3VwICsgMTsKLQotICAgICAgICBiYW5kX3N0YXJ0ID0gMDsKLQotICAgICAgICB3aW5zX2luX2dyb3VwID0gKHBhcnRpdGlvbiAtIHdpbmRvd19zdGFydCk7Ci0KLSAgICAgICAgRk9SIChzZmIgPSBzZmJfcGVyX3dpbjsgc2ZiID4gMDsgc2ZiLS0pCi0KLSAgICAgICAgICAgIGJhbmRfc3RvcCA9ICoocEJhbmQpOwotCi0gICAgICAgICAgICBwQmFuZCA9IHBCYW5kICsgMTsKLQotICAgICAgICAgICAgY29kZWJvb2sgPSAqKHBDb2RlYm9va01hcCk7Ci0KLSAgICAgICAgICAgIHBDb2RlYm9va01hcCA9IHBDb2RlYm9va01hcCArIDE7Ci0KLSAgICAgICAgICAgIG1hc2tfZW5hYmxlZCA9ICoocE1hc2tNYXApOwotCi0gICAgICAgICAgICBwTWFza01hcCA9IHBNYXNrTWFwICsgMTsKLQotICAgICAgICAgICAgSUYgKGNvZGVib29rIDwgTk9JU0VfSENCKQotICAgICAgICAgICAgVEhFTgotICAgICAgICAgICAgICAgIElGIChtYXNrX2VuYWJsZWQgIT0gRkFMU0UpCi0gICAgICAgICAgICAgICAgVEhFTgotICAgICAgICAgICAgICAgICAgICBiYW5kX2xlbmd0aCA9IGJhbmRfc3RvcCAtIGJhbmRfc3RhcnQ7Ci0KLSAgICAgICAgICAgICAgICAgICAgQ0FMTAotICAgICAgICAgICAgICAgICAgICAgICAgbXNfc3ludCgKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICB3aW5zX2luX2dyb3VwLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvZWZfcGVyX3dpbiwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBzZmJfcGVyX3dpbiwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBiYW5kX2xlbmd0aCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICYocENvZWZMZWZ0W2JhbmRfc3RhcnRdKSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICYocENvZWZSaWdodFtiYW5kX3N0YXJ0XSksCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAmKHFfZm9ybWF0TGVmdFt0b3Rfc2ZiXSksCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAmKHFfZm9ybWF0UmlnaHRbdG90X3NmYl0pICk7Ci0KLSAgICAgICAgICAgICAgICAgICAgTU9ESUZZSU5HCi0gICAgICAgICAgICAgICAgICAgICAgICAmKHBDb2VmTGVmdFtiYW5kX3N0YXJ0XSksCi0gICAgICAgICAgICAgICAgICAgICAgICAmKHBDb2VmUmlnaHRbYmFuZF9zdGFydF0pLAotICAgICAgICAgICAgICAgICAgICAgICAgJihxX2Zvcm1hdExlZnRbdG90X3NmYl0pLAotICAgICAgICAgICAgICAgICAgICAgICAgJihxX2Zvcm1hdFJpZ2h0W3RvdF9zZmJdKQotCi0gICAgICAgICAgICAgICAgICAgIFJFVFVSTklORwotICAgICAgICAgICAgICAgICAgICAgICAgTm9uZQotICAgICAgICAgICAgICAgIEVORElGCi0gICAgICAgICAgICBFTkRJRgotICAgICAgICAgICAgYmFuZF9zdGFydCA9IGJhbmRfc3RvcDsKLQotICAgICAgICAgICAgdG90X3NmYiA9IHRvdF9zZmIgKyAxOwotCi0gICAgICAgIEVOREZPUgotCi0gICAgICAgIHBDb2VmUmlnaHQgPSBwQ29lZlJpZ2h0ICsgY29lZl9wZXJfd2luICogd2luc19pbl9ncm91cDsKLSAgICAgICAgcENvZWZMZWZ0ICA9IHBDb2VmTGVmdCAgKyBjb2VmX3Blcl93aW4gKiB3aW5zX2luX2dyb3VwOwotCi0gICAgICAgIHdpbnNfaW5fZ3JvdXAgPSB3aW5zX2luX2dyb3VwIC0gMTsKLQotICAgICAgICB0b3Rfc2ZiID0gdG90X3NmYiArIHNmYl9wZXJfd2luICogd2luc19pbl9ncm91c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mZvLT5jb2VmX3Blcl93aW5bMF07Ci0KLSAgICAvKgotICAgICAqIEJlY2F1c2UgdGhlIG51bWJlciBvZiBzY2FsZWZhY3RvciBiYW5kcyBwZXIgd2luZG93IHNob3VsZCBiZQotICAgICAqIGNvbnN0YW50IGZvciBlYWNoIGZyYW1lLCBzZmJfcGVyX3dpbiBjYW4gYmUgZGV0ZXJtaW5lZCBvdXRzaWRlCi0gICAgICogb2YgdGhlIGxvb3AuCi0gICAgICoKLSAgICAgKiBGb3IgNDQuMSBrSHogc2FtcGxpbmcgcmF0ZSAgIHNmYl9wZXJfd2luID0gMTQgZm9yIHNob3J0IHdpbmRvd3MKLSAgICAgKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNmYl9wZXJfd2luID0gNDkgZm9yIGxvbmcgIHdpbmRvd3MKLSAgICAgKi8KLQotICAgIHNmYl9wZXJfd2luID0gcEZyYW1lSW5mby0+c2ZiX3Blcl93aW5bMF07Ci0KLSAgICBkbwotICAgIHsKLSAgICAgICAgcEJhbmQgICAgID0gcEZyYW1lSW5mby0+d2luX3NmYl90b3Bbd2luZG93X3N0YXJ0XTsKLQotICAgICAgICAvKgotICAgICAgICAgKiBQYXJ0aXRpb24gaXMgZXF1YWwgdG8gdGhlIGZpcnN0IHdpbmRvdyBpbiB0aGUgbmV4dCBncm91cAotICAgICAgICAgKgotICAgICAgICAgKiB7IEdyb3VwIDAgICAgfXsgICAgICBHcm91cCAxICAgICAgfXsgICAgR3JvdXAgMiB9e0dyb3VwIDN9Ci0gICAgICAgICAqIFt3aW4gMF1bd2luIDFdW3dpbiAyXVt3aW4gM11bd2luIDRdW3dpbiA1XVt3aW4gNl1bd2luIDddCi0gICAgICAgICAqCi0gICAgICAgICAqIHBHcm91cFswXSA9IDIKLSAgICAgICAgICogcEdyb3VwWzFdID0gNQotICAgICAgICAgKiBwR3JvdXBbMl0gPSA3Ci0gICAgICAgICAqIHBHcm91cFszXSA9IDgKLSAgICAgICAgICovCi0KLSAgICAgICAgcGFydGl0aW9uID0gKihwR3JvdXArKyk7Ci0KLSAgICAgICAgYmFuZF9zdGFydCA9IDA7Ci0KLSAgICAgICAgd2luc19pbl9ncm91cCA9IChwYXJ0aXRpb24gLSB3aW5kb3dfc3RhcnQpOwotCi0gICAgICAgIGZvciAoc2ZiID0gc2ZiX3Blcl93aW47IHNmYiA+IDA7IHNmYi0tKQotICAgICAgICB7Ci0gICAgICAgICAgICAvKiBiYW5kIGlzIG9mZnNldCB0YWJsZSwgYmFuZF9zdG9wIGlzIGxhc3QgY29lZiBpbiBiYW5kICovCi0gICAgICAgICAgICBiYW5kX3N0b3AgPSAqKHBCYW5kKyspOwotCi0gICAgICAgICAgICBjb2RlYm9vayA9ICoocENvZGVib29rTWFwKyspOwotCi0gICAgICAgICAgICBtYXNrX2VuYWJsZWQgPSAqKHBNYXNrTWFwKyspOwotCi0gICAgICAgICAgICAvKgotICAgICAgICAgICAgICogV2hlbiBhIGNvZGVib29rIDwgTk9JU0VfSENCIGlzIGZvdW5kLCBhcHBseSBNL1MgdG8gdGhhdAotICAgICAgICAgICAgICogc2NhbGVmYWN0b3JiYW5kLgotICAgICAgICAgICAgICoKLSAgICAgICAgICAgICAqIEV4YW1wbGUuLi4gIHNmYlszXSA9PSBOT0lTRV9IQ0IKLSAgICAgICAgICAgICAqCi0gICAgICAgICAgICAgKiBbIEdyb3VwIDEgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIF0KLSAgICAgICAgICAgICAqIFt3aW4gMCAgICAgICAgICAgICAgICAgXVt3aW4gMSAgICAgICAgICAgICAgICAgXQotICAgICAgICAgICAgICogWzBdWzFdWzJdW1hdWzRdWzVdWzZdWzddWzBdWzFdWzJdW1hdWzRdWzVdWzZdWzddCi0gICAgICAgICAgICAgKgotICAgICAgICAgICAgICogVGhlIGZvcihzZmIpIHN0ZXBzIHRocm91Z2ggdGhlIHNmYidzIDAtNyBpbiB3aW4gMC4KLSAgICAgICAgICAgICAqCi0gICAgICAgICAgICAgKiBGaW5kaW5nIHNmYlszXSdzIGNvZGVib29rID09IE5PSVNFX0hDQiwgdGhlIGNvZGUKLSAgICAgICAgICAgICAqIHN0ZXBzIHRocm91Z2ggYWxsIHRoZSB3aW5kb3dzIGluIHRoZSBncm91cCAodGhleSBzaGFyZQotICAgICAgICAgICAgICogdGhlIHNhbWUgc2NhbGVmYWN0b3JzKSBhbmQgcmVwbGFjZXMgdGhhdCBzZmIgd2l0aCBub2lzZS4KLSAgICAgICAgICAgICAqLwotCi0gICAgICAgICAgICBpZiAoY29kZWJvb2sgPCBOT0lTRV9IQ0IpCi0gICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgaWYgKG1hc2tfZW5hYmxlZCAhPSBGQUxTRSkKLSAgICAgICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgICAgIGJhbmRfbGVuZ3RoID0gYmFuZF9zdG9wIC0gYmFuZF9zdGFydDsKLQotICAgICAgICAgICAgICAgICAgICBtc19zeW50KAotICAgICAgICAgICAgICAgICAgICAgICAgd2luc19pbl9ncm91cCwKLSAgICAgICAgICAgICAgICAgICAgICAgIGNvZWZfcGVyX3dpbiwKLSAgICAgICAgICAgICAgICAgICAgICAgIHNmYl9wZXJfd2luLAotICAgICAgICAgICAgICAgICAgICAgICAgYmFuZF9sZW5ndGgsCi0gICAgICAgICAgICAgICAgICAgICAgICAmKHBDb2VmTGVmdFtiYW5kX3N0YXJ0XSksCi0gICAgICAgICAgICAgICAgICAgICAgICAmKHBDb2VmUmlnaHRbYmFuZF9zdGFydF0pLAotICAgICAgICAgICAgICAgICAgICAgICAgJihxX2Zvcm1hdExlZnRbdG90X3NmYl0pLAotICAgICAgICAgICAgICAgICAgICAgICAgJihxX2Zvcm1hdFJpZ2h0W3RvdF9zZmJdKSk7Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgfQotICAgICAgICAgICAgYmFuZF9zdGFydCA9IGJhbmRfc3RvcDsKLQotICAgICAgICAgICAgdG90X3NmYisr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gICAgICAgIHBlciBncm91cCwgZXRjLikKLSAgICAgICAgICAgICAgICAgW2NvbnN0IEZyYW1lSW5mbyAqIGNvbnN0XQotCi0gICAgcFROU19mcmFtZV9pbmZvID0gcG9pbnRlciB0byBzdHJ1Y3R1cmUgY29udGFpbmluZyB0aGUgZGV0YWlscyBvbiBlYWNoCi0gICAgICAgICAgICAgICAgICAgICAgVE5TIGZpbHRlciAob3JkZXIsIGZpbHRlciBjb2VmZmljaWVudHMsCi0gICAgICAgICAgICAgICAgICAgICAgY29lZmZpY2llbnQgcmVzLiwgZXRjLikKLSAgICAgICAgICAgICAgICAgICAgICBbVE5TX2ZyYW1lX2luZm8gKiBjb25zdF0KLQotICAgIGludmVyc2VfZmxhZyAgID0gVFJVRSAgaWYgaW52ZXJzZSBmaWx0ZXIgaXMgdG8gYmUgYXBwbGllZC4KLSAgICAgICAgICAgICAgICAgICAgIEZBTFNFIGlmIGZvcndhcmQgZmlsdGVyIGlzIHRvIGJlIGFwcGxpZWQuCi0gICAgICAgICAgICAgICAgICAgICBbQm9vbF0KLQotICAgIHNjcmF0Y2hfSW50X2J1ZmZlciA9IFBvaW50ZXIgdG8gc2NyYXRjaCBtZW1vcnkgdG8gc3RvcmUgdGhlCi0gICAgICAgICAgICAgICAgICAgICAgICAgICBmaWx0ZXIncyBzdGF0ZSBtZW1vcnkuICBVc2VkIGJ5IGJvdGgKLSAgICAgICAgICAgICAgICAgICAgICAgICAgIHRuc19pbnZfZmlsdGVyLgotICAgICAgICAgICAgICAgICAgICAgICAgICAgW0ludCAqLCBsZW5ndGggVE5TX01BWF9PUkRFUl0KLQotIExvY2FsIFN0b3Jlcy9CdWZmZXJzL1BvaW50ZXJzIE5lZWRlZDoKLSAgICBOb25lCi0KLSBHbG9iYWwgU3RvcmVzL0J1ZmZlcnMvUG9pbnRlcnMgTmVlZGVkOgotICAgIE5vbmUKLQotIE91dHB1dHM6Ci0gICAgTm9uZQotCi0gUG9pbnRlcnMgYW5kIEJ1ZmZlc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tLS0tLS0tLS0tLS0tLSovCi0KLXZvaWQgYXBwbHlfdG5zKAotICAgIEludDMyICAgICAgICAgICAgICAgICAgY29lZltdLAotICAgIEludCAgICAgICAgICAgICAgICAgICAgcV9mb3JtYXRbXSwKLSAgICBjb25zdCBGcmFtZUluZm8gICAgICAqIGNvbnN0IHBGcmFtZUluZm8sCi0gICAgVE5TX2ZyYW1lX2luZm8gKiBjb25zdCBwVE5TX2ZyYW1lX2luZm8sCi0gICAgY29uc3QgQm9vbCAgICAgICAgICAgICAgICAgICBpbnZlcnNlX2ZsYWcsCi0gICAgSW50MzIgICAgICAgICAgICAgICAgICBzY3JhdGNoX0ludF9idWZmZXJbXSkKLXsKLSAgICBJbnQgbnVtX3Ruc19iYW5kczsKLSAgICBJbnQgbnVtX1ROU19jb2VmOwotCi0gICAgSW50IGY7Ci0KLSAgICBJbnQgdGVtcEludDsKLSAgICBJbnQgdGVtcEludDI7Ci0KLSAgICBJbnQgc2ZiX3Blcl93aW47Ci0gICAgSW50IHNmYldpZHRoOwotCi0gICAgSW50IGNvZWZfcGVyX3dpbjsKLSAgICBJbnQgbWluX3E7Ci0gICAgSW50IHdpbjsKLQotICAgIEludDMyICpwQ29lZiA9IGNvZWY7Ci0gICAgSW50MzIgKnBUZW1wQ29lZjsKLQotICAgIEludCAgICpwU3RhcnRRZm9ybWF0ID0gcV9mb3JtYXQ7Ci0KLSAgICBJbnQgICAqcFFmb3JtYXQ7Ci0gICAgSW50MzIgKnBMcGNDb2VmOwotCi0gICAgSW50IHNmYl9vZmZzZXQ7Ci0KLSAgICBjb25zdCBJbnQxNiAqcFdpblNmYlRvcDsKLQotICAgIFROU2ZpbHQgKnBGaWx0OwotCi0gICAgY29lZl9wZXJfd2luID0gcEZyYW1lSW5mby0+Y29lZl9wZXJfd2luWzBdOwotICAgIHNmYl9wZXJfd2luICA9IHBGcmFtZUluZm8tPnNmYl9wZXJfd2luWzBdOwotCi0gICAgd2luID0gMDsKLQotICAgIHBMcGNDb2VmID0gcFROU19mcmFtZV9pbmZvLT5scGNfY29lZjsKLQotICAgIHBGaWx0ID0gcFROU19mcmFtZV9pbmZvLT5maWx0OwotCi0gICAgZG8KLSAgICB7Ci0gICAgICAgIGZvciAoZiA9IHBUTlNfZnJhbWVfaW5mby0+bl9maWx0W3dpbl07IGYgPiAwOyBmLS0pCi0gICAgICAgIHsKLSAgICAgICAgICAgIC8qIFNraXAgdG8gdGhlIG5leHQgZmlsdGVyIGlmIHRoZSBvcmRlciBpcyAwICovCi0gICAgICAgICAgICB0ZW1wSW50ID0gcEZpbHQtPm9yZGVyOwotCi0gICAgICAgICAgICBpZiAodGVtcEludCA+IDApCi0gICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgLyoKLSAgICAgICAgICAgICAgICAgKiBEbyBub3QgY2FsbCB0bnNfYXJfZmlsdGVyIG9yIHRuc19pbnZfZmlsdGVyCi0gICAgICAgICAgICAgICAgICogaWYgdGhlIGRpZmZlcmVuY2UKLSAgICAgICAgICAgICAgICAgKiBiZXR3ZWVuIHN0YXJ0X2NvZWYgYW5kIHN0b3Bfc3RvcCBpcyA8PSAwLgotICAgICAgICAgICAgICAgICAqCi0gICAgICAgICAgICAgICAgICovCi0gICAgICAgICAgICAgICAgbnVtX1ROU19jb2VmID0gKHBGaWx0LT5zdG9wX2NvZWYgLSBwRmlsdC0+c3RhcnRfY29lZik7Ci0KLSAgICAgICAgICAgICAgICBpZiAobnVtX1ROU19jb2VmID4gMCkKLSAgICAgICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgICAgIGlmIChpbnZlcnNlX2ZsYWcgIT0gRkFMU0UpCi0gICAgICAgICAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAgICAgICAgIHRuc19pbnZfZmlsdGVyKAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICYocENvZWZbcEZpbHQtPnN0YXJ0X2NvZWZdKSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBudW1fVE5TX2NvZWYsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgcEZpbHQtPmRpcmVjdGlvbiwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBwTHBjQ29lZiwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBwRmlsdC0+cV9scGMsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgcEZpbHQtPm9yZGVyLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNjcmF0Y2hfSW50X2J1ZmZlcik7Ci0gICAgICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICAgICAgZWxzZQotICAgICAgICAgICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgICAgICAgICBudW1fdG5zX2JhbmRzID0gKHBGaWx0LT5zdG9wX2JhbmQgLSBwRmlsdC0+c3RhcnRfYmFuZCk7Ci0KLSAgICAgICAgICAgICAgICAgICAgICAgIC8qCi0gICAgICAgICAgICAgICAgICAgICAgICAgKiBwUWZvcm1hdCBpcyBpbml0aWFsaXplZCBvbmx5IG9uY2UuCi0gICAgICAgICAgICAgICAgICAgICAgICAgKgotICAgICAgICAgICAgICAgICAgICAgICAgICogSGVyZSBpcyBob3cgVE5TIGlzIGFwcGxpZWQgb24gc2NhbGVmYWN0b3IgYmFuZHMKLSAgICAgICAgICAgICAgICAgICAgICAgICAqCi0gICAgICAgICAgICAgICAgICAgICAgICAgKiBbMF1bMV1bMl1bM11bNF1bNV1bNl1bN11bOF0KLSAgICAgICAgICAgICAgICAgICAgICAgICAqICB8ICAgICAgICAgICAgICAgICAgICAgICAgXAotICAgICAgICAgICAgICAgICAgICAgICAgICogc3RhcnRfYmFuZCAgICAgICAgICAgICAgIHN0b3BfYmFuZAotICAgICAgICAgICAgICAgICAgICAgICAgICoKLSAgICAgICAgICAgICAgICAgICAgICAgICAqIEluIHRoaXMgZXhhbXBsZSwgVE5TIHdvdWxkIGJlIGFwcGxpZWQgdG8gOAotICAgICAgICAgICAgICAgICAgICAgICAgICogc2NhbGVmYWN0b3IgYmFuZHMsIDAtNy4KLSAgICAgICAgICAgICAgICAgICAgICAgICAqCi0gICAgICAgICAgICAgICAgICAgICAgICAgKiBwUWZvcm1hdCBpcyBpbml0aWFsbHkgc2V0IHRvICYocFN0YXJ0UWZvcm1hdFs4XSkKLSAgICAgICAgICAgICAgICAgICAgICAgICAqCi0gICAgICAgICAgICAgICAgICAgICAgICAgKiAxc3QgTE9PUAotICAgICAgICAgICAgICAgICAgICAgICAgICogICAgICBFbnRyeTogcFFmb3JtYXQgPSAmKHBTdGFydFFmb3JtYXRbOF0pCi0gICAgICAgICAgICAgICAgICAgICAgICAgKgotICAgICAgICAgICAgICAgICAgICAgICAgICogICAgICBwUWZvcm1hdCBpcyBwcmUtZGVjcmVtZW50ZWQgOCB0aW1lcyBpbiB0aGUKLSAgICAgICAgICAgICAgICAgICAgICAgICAqICAgICAgc2VhcmNoIGZvciBtaW5fcQotICAgICAgICAgICAgICAgICAgICAgICAgICoKLSAgICAgICAgICAgICAgICAgICAgICAgICAqICAgICAgRXhpdDogIHBRZm9ybWF0ID0gJihwU3RhcnRRZm9ybWF0WzBdKQotICAgICAgICAgICAgICAgICAgICAgICAgICoKLSAgICAgICAgICAgICAgICAgICAgICAgICAqIDJuZCBMT09QCi0gICAgICAgICAgICAgICAgICAgICAgICAgKiAgICAgIEVudHJ5OiBwUWZvcm1hdCA9ICYocFN0YXJ0UWZvcm1hdFswXSkKLSAgICAgICAgICAgICAgICAgICAgICAgICAqCi0gICAgICAgICAgICAgICAgICAgICAgICAgKiAgICAgIHBRZm9ybWF0IGlzIHBvc3QtaW5jcmVtZW50ZWQgOCB0aW1lcyBpbiB0aGUKLSAgICAgICAgICAgICAgICAgICAgICAgICAqICAgICAgbm9ybWFsaXphdGlvbiBvZiB0aGUgZGF0YSBsb29wLgotICAgICAgICAgICAgICAgICAgICAgICAgICoKLSAgICAgICAgICAgICAgICAgICAgICAgICAqICAgICAgRXhpdDogIHBRZm9ybWF0ID0gJihwU3RhcnRRZm9ybWF0WzhdCi0gICAgICAgICAgICAgICAgICAgICAgICAgKgotICAgICAgICAgICAgICAgICAgICAgICAgICoKLSAgICAgICAgICAgICAgICAgICAgICAgICAqIHNoaWZ0X2FtdCA9IHRuc19hcl9maWx0ZXIoLi4uKQotICAgICAgICAgICAgICAgICAgICAgICAgICoKLSAgICAgICAgICAgICAgICAgICAgICAgICAqIDNyZCBMT09QCi0gICAgICAgICAgICAgICAgICAgICAgICAgKiAgICAgIEVudHJ5OiBwUWZvcm1hdCA9ICYocFN0YXJ0UWZvcm1hdFs4XSkKLSAgICAgICAgICAgICAgICAgICAgICAgICAqCi0gICAgICAgICAgICAgICAgICAgICAgICAgKiAgICAgIHBRZm9ybWF0IGlzIHByZS1kZWNyZW1lbnRlZCA4IHRpbWVzIGluIHRoZQotICAgICAgICAgICAgICAgICAgICAgICAgICogICAgICBhZGp1c3RtZW50IG9mIHRoZSBxLWZvcm1hdCB0byBtaW5fcSAtIHNoaWZ0X2FtdAotICAgICAgICAgICAgICAgICAgICAgICAgICoKLSAgICAgICAgICAgICAgICAgICAgICAgICAqICAgICAgRXhpdDogIHBRZm9ybWF0ID0gJihwU3RhcnRRZm9ybWF0WzBdKQotICAgICAgICAgICAgICAgICAgICAgICAgICoKLSAgICAgICAgICAgICAgICAgICAgICAgICAqLwotCi0gICAgICAgICAgICAgICAgICAgICAgICBwUWZvcm1hdCA9Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgJihwU3RhcnRRZm9ybWF0W3BGaWx0LT5zdG9wX2JhbmRdKTsKLQotICAgICAgICAgICAgICAgICAgICAgICAgLyoKLSAgICAgICAgICAgICAgICAgICAgICAgICAqIFNjYW4gdGhlIGFycmF5IG9mIHEtZm9ybWF0cyBhbmQgZmluZCB0aGUgbWluaW11bSBvdmVyCi0gICAgICAgICAgICAgICAgICAgICAgICAgKiB0aGUgcmFuZ2Ugd2hlcmUgdGhlIGZpbHRlciBpcyB0byBiZSBhcHBsaWVkLgotICAgICAgICAgICAgICAgICAgICAgICAgICoKLSAgICAgICAgICAgICAgICAgICAgICAgICAqIEF0IHRoZSBlbmQgb2YgdGhpcyBzY2FuLAotICAgICAgICAgICAgICAgICAgICAgICAgICogcFFmb3JtYXQgPSAmKHEtZm9ybWF0W3BGaWx0LT5zdGFydF9iYW5kXSk7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgKgotICAgICAgICAgICAgICAgICAgICAgICAgICovCi0KLSAgICAgICAgICAgICAgICAgICAgICAgIG1pbl9xID0gSU5UMTZfTUFYOwotCi0gICAgICAgICAgICAgICAgICAgICAgICBmb3IgKHRlbXBJbnQgPSBudW1fdG5zX2JhbmRzOyB0ZW1wSW50ID4gMDsgdGVtcEludC0tKQotICAgICAgICAgICAgICAgICAgICAgICAgewotICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRlbXBJbnQyID0gKigtLXBRZm9ybWF0KTsKLQotICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICh0ZW1wSW50MiA8IG1pbl9xKQotICAgICAgICAgICAgICAgICAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbWluX3EgPSB0ZW1wSW50MjsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgICAgICAgICB9IC8qIGZvcih0ZW1wSW50ID0gbnVtX2JhbmRzOyB0ZW1wSW50ID4gMDsgdGVtcEludC0tKSovCi0KLSAgICAgICAgICAgICAgICAgICAgICAgIC8qCi0gICAgICAgICAgICAgICAgICAgICAgICAgKiBTZXQgdXAgdGhlIHBvaW50ZXJzIHNvIHdlIGNhbiBpbmRleCBpbnRvIGNvZWZbXQotICAgICAgICAgICAgICAgICAgICAgICAgICogb24gYSBzY2FsZWZhY3RvciBiYW5kIGJhc2lzLgotICAgICAgICAgICAgICAgICAgICAgICAgICovCi0gICAgICAgICAgICAgICAgICAgICAgICB0ZW1wSW50ID0gcEZpbHQtPnN0YXJ0X2JhbmQ7Ci0KLSAgICAgICAgICAgICAgICAgICAgICAgIHRlbXBJbnQtLTsKLQotICAgICAgICAgICAgICAgICAgICAgICAgLyogSW5pdGlhbGl6ZSBzZmJfb2Zmc2V0IGFuZCBwV2luU2ZiVG9wICovCi0gICAgICAgICAgICAgICAgICAgICAgICBpZiAodGVtcEludCA+PSAwKQotICAgICAgICAgICAgICAgICAgICAgICAgewotICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBXaW5TZmJUb3AgPQotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmKHBGcmFtZUluZm8tPndpbl9zZmJfdG9wW3dpbl1bdGVtcEludF0pOwotCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgc2ZiX29mZnNldCA9ICoocFdpblNmYlRvcCsrKTsKLSAgICAgICAgICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICAgICAgICAgIGVsc2UKLSAgICAgICAgICAgICAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBwV2luU2ZiVG9wID0gcEZyYW1lSW5mby0+d2luX3NmYl90b3Bbd2luXTsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBzZmJfb2Zmc2V0ID0gMDsKLSAgICAgICAgICAgICAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgICAgICAgICAgICAgcFRlbXBDb2VmID0gcENvZWYgKyBwRmlsdC0+c3RhcnRfY29lZjsKLQotICAgICAgICAgICAgICAgICAgICAgICAgLyogU2NhbGUgdGhlIGRhdGEgaW4gdGhlIFROUyBiYW5kcyB0byBtaW5fcSBxLWZvcm1hdCAqLwotICAgICAgICAgICAgICAgICAgICAgICAgZm9yICh0ZW1wSW50ID0gbnVtX3Ruc19iYW5kczsgdGVtcEludCA+IDA7IHRlbXBJbnQtLSkKLSAgICAgICAgICAgICAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBzZmJXaWR0aCAgPSAqKHBXaW5TZmJUb3ArKykgLSBzZmJfb2Zmc2V0OwotCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgc2ZiX29mZnNldCArPSBzZmJXaWR0aDsKLQotICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRlbXBJbnQyID0gKihwUWZvcm1hdCsrKSAtIG1pbl9xOwotCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgLyoKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKiBUaGlzIHNob3VsZCB6ZXJvIG91dCB0aGUgZGF0YSBpbiBvbmUgc2NhbGVmYWN0b3IKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKiBiYW5kIGlmIGl0IGlzIHNvIG11Y2ggbGVzcyB0aGFuIHRoZSBuZWlnaGJvcmluZwotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqIHNjYWxlZmFjdG9yIGJhbmRzLgotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICogVGhlIG9ubHkgd2F5IHRoaXMgInNob3VsZCIgaGFwcGVuIGlzIGlmIG9uZQotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqIHNjYWxlZmFjdG9yIGJhbmQgY29udGFpbnMgemVybyBkYXRhLgotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICogWmVybyBkYXRhIGNhbiBiZSBvZiBhbnkgcS1mb3JtYXQsIGJ1dCB3ZSBhbHdheXMKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKiBzZXQgaXQgdmVyeSBoaWdoIHRvIGF2b2lkIHRoZSB6ZXJvLWRhdGEgYmFuZCBiZWluZwotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqIHBpY2tlZCBhcyB0aGUgb25lIHRvIG5vcm1hbGl6ZSB0byBpbiB0aGUgc2NhbiBmb3IKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKiBtaW5fcS4KLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKgotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICh0ZW1wSW50MiA+IDMxKQotICAgICAgICAgICAgICAgICAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdGVtcEludDIgPSAzMTsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBmb3IgKHNmYldpZHRoID4+PSAyOyBzZmJXaWR0aCA+IDA7IHNmYldpZHRoLS0pCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgewotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqKHBUZW1wQ29lZisrKSA+Pj0gdGVtcEludDI7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICoocFRlbXBDb2VmKyspID4+PSB0ZW1wSW50MjsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKihwVGVtcENvZWYrKykgPj49IHRlbXBJbnQyOwotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqKHBUZW1wQ29lZisrKSA+Pj0gdGVtcEludDI7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgfQotCi0gICAgICAgICAgICAgICAgICAgICAgICB9IC8qIGZvcih0ZW1wSW50ID0gbnVtX2JhbmRzOyB0ZW1wSW50ID4gMDsgdGVtcEludC0tKSovCi0KLSAgICAgICAgICAgICAgICAgICAgICAgIHRlbXBJbnQyID0KLSAgICAgICAgICAgICAgICAgICAgICAgICAgICB0bnNfYXJfZmlsdGVyKAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmKHBDb2VmW3BGaWx0LT5zdGFydF9jb2VmXSksCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG51bV9UTlNfY29lZiwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcEZpbHQtPmRpcmVjdGlvbiwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcExwY0NvZWYsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBGaWx0LT5xX2xwYywKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcEZpbHQtPm9yZGVyKTsKLQotICAgICAgICAgICAgICAgICAgICAgICAgLyoKLSAgICAgICAgICAgICAgICAgICAgICAgICAqIFVwZGF0ZSB0aGUgcS1mb3JtYXQgZm9yIGFsbCB0aGUgc2NhbGVmYWN0b3IgYmFuZHMKLSAgICAgICAgICAgICAgICAgICAgICAgICAqIHRha2luZyBpbnRvIGFjY291bnQgdGhlIGFkanVzdG1lbnQgY2F1c2VkIGJ5Ci0gICAgICAgICAgICAgICAgICAgICAgICAgKiB0bnNfYXJfZmlsdGVyCi0gICAgICAgICAgICAgICAgICAgICAgICAgKi8KLQotICAgICAgICAgICAgICAgICAgICAgICAgbWluX3EgLT0gdGVtcEludDI7Ci0KLSAgICAgICAgICAgICAgICAgICAgICAgIGZvciAodGVtcEludCA9IG51bV90bnNfYmFuZHM7IHRlbXBJbnQgPiAwOyB0ZW1wSW50LS0pCi0gICAgICAgICAgICAgICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgKigtLXBRZm9ybWF0KSA9IG1pbl9xOwotICAgICAgICAgICAgICAgICAgICAgICAgfQotCi0gICAgICAgICAgICAgICAgICAgIH0gLyogaWYgKGludmVyc2VfZmxhZyAhPSBGQUxTRSkgKi8KLQotICAgICAgICAgICAgICAgIH0gLyogaWYgKG51bV9UTlNfY29lZiA+IDApICovCi0KLSAgICAgICAgICAgICAgICBwTHBjQ29lZiArPSBwRmlsdC0+b3JkZXI7Ci0KLSAgICAgICAgICAgIH0gLyogaWYgKHRlbXBJbnQgPiAwKSAqLwotCi0gICAgICAgICAgICBwRmlsdCsrOwotCi0gICAgICAgIH0gLyogZm9yIChmID0gcFROU2luZm8tPm5fZmlsdDsgZiA+IDA7IGYtLSkgKi8KLQotICAgICAgICBwQ29lZiArPSBjb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jEyciA9IChJbnQzMikodGVtcF9yMTJyID4+IHRlbXAzKTsKLSAgICAgICAgICAgIGFjLT5yMjJyID0gKEludDMyKSh0ZW1wX3IyMnIgPj4gdGVtcDMpOwotCi0gICAgICAgIH0KLSAgICAgICAgZWxzZQotICAgICAgICB7Ci0gICAgICAgICAgICB0ZW1wMyA9IHB2X25vcm1hbGl6ZSgoKFVJbnQzMiltYXgpID4+IDEpIC0gMjsKLQotICAgICAgICAgICAgaWYgKHRlbXAzID4gMCkKLSAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICBhYy0+cjAxciA9IChJbnQzMikodGVtcF9yMDFyIDw8IHRlbXAzKTsKLSAgICAgICAgICAgICAgICBhYy0+cjAyciA9IChJbnQzMikodGVtcF9yMDJyIDw8IHRlbXAzKTsKLSAgICAgICAgICAgICAgICBhYy0+cjExciA9IChJbnQzMikodGVtcF9yMTFyIDw8IHRlbXAzKTsKLSAgICAgICAgICAgICAgICBhYy0+cjEyciA9IChJbnQzMikodGVtcF9yMTJyIDw8IHRlbXAzKTsKLSAgICAgICAgICAgICAgICBhYy0+cjIyciA9IChJbnQzMikodGVtcF9yMjJyIDw8IHRlbXAzKTsKLSAgICAgICAgICAgIH0KLSAgICAgICAgICAgIGVsc2UKLSAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICB0ZW1wMyA9IC10ZW1wMzsKLSAgICAgICAgICAgICAgICBhYy0+cjAxciA9IChJbnQzMikodGVtcF9yMDFyID4+IHRlbXAzKTsKLSAgICAgICAgICAgICAgICBhYy0+cjAyciA9IChJbnQzMikodGVtcF9yMDJyID4+IHRlbXAzKTsKLSAgICAgICAgICAgICAgICBhYy0+cjExciA9IChJbnQzMikodGVtcF9yMTFyID4+IHRlbXAzKTsKLSAgICAgICAgICAgICAgICBhYy0+cjEyciA9IChJbnQzMikodGVtcF9yMTJyID4+IHRlbXAzKTsKLSAgICAgICAgICAgICAgICBhYy0+cjIyciA9IChJbnQzMikodGVtcF9yMjJyID4+IHRlbXAzKTsKLSAgICAgICAgICAgIH0KLQotICAgICAgICB9Ci0KLSAgICAgICAgLyoKLSAgICAgICAgICogIGFjLT5kZXQgPSBhYy0+cjExciphYy0+cjIyciAtIHJlbCooYWMtPnIxMnIqYWMtPnIxMnIpOwotICAgICAgICAgKi8KLSAgICAgICAgLyogMS8oMSArIDFlLTYpID09IDEgLSAxZS02ICovCi0gICAgICAgIC8qIDJeLTIwID09IDFlLTYgKi8KLSAgICAgICAgYWMtPmRldCAgPSBmeHBfbXVsMzJfUTMwKGFjLT5yMTJyLCBhYy0+cjEycik7Ci0KLSAgICAgICAgYWMtPmRldCAtPSBhYy0+ZGV0ID4+IDIwOwotCi0gICAgICAgIGFjLT5kZXQgID0gZnhwX211bDMyX1EzMChhYy0+cjExciwgYWMtPnIyMnIpIC0gYWMtPmRldDsKLSAgICB9Ci0gICAgZWxzZQotICAgIHsKLSAgICAgICAgcHZfbWVtc2V0KCh2b2lkICopYWMsIDAsIHNpemVvZihzdHJ1Y3QgQUNPUlJfQ09FRlMpKTsKLSAgICB9Ci0KLQotfQotCi0KLSNpZmRlZiBIUV9TQlIKLQotCi12b2lkIGNhbGNfYXV0b19jb3JyKHN0cnVjdCBBQ09SUl9DT0VGUyAqYWMsCi0gICAgICAgICAgICAgICAgICAgIEludDMyICByZWFsQnVmW11bMzJdLAotICAgICAgICAgICAgICAgICAgICBJbnQzMiAgaW1hZ0J1ZltdWzMyXSwKLSAgICAgICAgICAgICAgICAgICAgSW50MzIgIGJkLAotICAgICAgICAgICAgICAgICAgICBJbnQzMiAgbGVuKQotewotCi0KLSAgICBJbnQzMiBqOwotICAgIEludDMyIHRlbXAxOwotICAgIEludDMyIHRlbXAyOwotICAgIEludDMyIHRlbXAzOwotICAgIEludDMyIHRlbXA0OwotICAgIEludDMyIHRlbXA1OwotICAgIEludDMyIHRlbXA2OwotCi0gICAgaW50NjRfdCBhY2N1MSA9IDA7Ci0gICAgaW50NjRfdCBhY2N1MiA9IDA7Ci0gICAga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iAodGVtcDEpCi0gICAgICAgIHsKLSAgICAgICAgICAgIHRlbXAxID0gMzQgLSBwdl9ub3JtYWxpemUodGVtcDEpOwotICAgICAgICAgICAgYWMtPnIxMXIgPSAoSW50MzIpKGFjY3UxID4+IHRlbXAxKTsKLSAgICAgICAgICAgIGFjLT5yMDFyID0gKEludDMyKShhY2N1MiA+PiB0ZW1wMSk7Ci0gICAgICAgICAgICBhYy0+cjAxaSA9IChJbnQzMikoYWNjdTMgPj4gdGVtcDEpOwotICAgICAgICAgICAgYWMtPnIwMnIgPSAoSW50MzIpKGFjY3U0ID4+IHRlbXAxKTsKLSAgICAgICAgICAgIGFjLT5yMDJpID0gKEludDMyKShhY2N1NSA+PiB0ZW1wMSk7Ci0gICAgICAgICAgICBhYy0+cjEyciA9IChJbnQzMikodGVtcF9yMTJyID4+IHRlbXAxKTsKLSAgICAgICAgICAgIGFjLT5yMTJpID0gKEludDMyKSh0ZW1wX3IxMmkgPj4gdGVtcDEpOwotICAgICAgICAgICAgYWMtPnIyMnIgPSAoSW50MzIpKHRlbXBfcjIyciA+PiB0ZW1wMSk7Ci0gICAgICAgIH0KLSAgICAgICAgZWxzZQotICAgICAgICB7Ci0gICAgICAgICAgICB0ZW1wMSA9IHB2X25vcm1hbGl6ZSgoKFVJbnQzMiltYXgpID4+IDEpIC0gMzsKLQotICAgICAgICAgICAgaWYgKHRlbXAxID4gMCkKLSAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICBhYy0+cjExciA9IChJbnQzMikoYWNjdTEgPDwgdGVtcDEpOwotICAgICAgICAgICAgICAgIGFjLT5yMDFyID0gKEludDMyKShhY2N1MiA8PCB0ZW1wMSk7Ci0gICAgICAgICAgICAgICAgYWMtPnIwMWkgPSAoSW50MzIpKGFjY3UzIDw8IHRlbXAxKTsKLSAgICAgICAgICAgICAgICBhYy0+cjAyciA9IChJbnQzMikoYWNjdTQgPDwgdGVtcDEpOwotICAgICAgICAgICAgICAgIGFjLT5yMDJpID0gKEludDMyKShhY2N1NSA8PCB0ZW1wMSk7Ci0gICAgICAgICAgICAgICAgYWMtPnIxMnIgPSAoSW50MzIpKHRlbXBfcjEyciA8PCB0ZW1wMSk7Ci0gICAgICAgICAgICAgICAgYWMtPnIxMmkgPSAoSW50MzIpKHRlbXBfcjEyaSA8PCB0ZW1wMSk7Ci0gICAgICAgICAgICAgICAgYWMtPnIyMnIgPSAoSW50MzIpKHRlbXBfcjIyciA8PCB0ZW1wMSk7Ci0gICAgICAgICAgICB9Ci0gICAgICAgICAgICBlbHNlCi0gICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgdGVtcDEgPSAtdGVtcDE7Ci0gICAgICAgICAgICAgICAgYWMtPnIxMXIgPSAoSW50MzIpKGFjY3UxID4+IHRlbXAxKTsKLSAgICAgICAgICAgICAgICBhYy0+cjAxciA9IChJbnQzMikoYWNjdTIgPj4gdGVtcDEpOwotICAgICAgICAgICAgICAgIGFjLT5yMDFpID0gKEludDMyKShhY2N1MyA+PiB0ZW1wMSk7Ci0gICAgICAgICAgICAgICAgYWMtPnIwMnIgPSAoSW50MzIpKGFjY3U0ID4+IHRlbXAxKTsKLSAgICAgICAgICAgICAgICBhYy0+cjAyaSA9IChJbnQzMikoYWNjdTUgPj4gdGVtcDEpOwotICAgICAgICAgICAgICAgIGFjLT5yMTJyID0gKEludDMyKSh0ZW1wX3IxMnIgPj4gdGVtcDEpOwotICAgICAgICAgICAgICAgIGFjLT5yMTJpID0gKEludDMyKSh0ZW1wX3IxMmkgPj4gdGVtcDEpOwotICAgICAgICAgICAgICAgIGFjLT5yMjJyID0gKEludDMyKSh0ZW1wX3IyMnIgPj4gdGVtcDEpOwotICAgICAgICAgICAgfQotCi0gICAgICAgIH0KLQotICAgICAgICAvKgotICAgICAgICAgKiAgYWMtPmRldCA9IGFjLT5yMTFyKmFjLT5yMjJyIC0gcmVsKihhYy0+cjEyciphYy0+cjEycik7Ci0gICAgICAgICAqLwotICAgICAgICAvKiAxLygxICsgMWUtNikgP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ci0KLX0KLQotCi0KLSNpZmRlZiBIUV9TQlIKLQotdm9pZCBjYWxjX3Nicl9hbmFmaWx0ZXJiYW5rKEludDMyICogU3IsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgSW50MzIgKiBTaSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBJbnQxNiAqIFgsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgSW50MzIgc2NyYXRjaF9tZW1bXVs2NF0sCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgSW50MzIgICBtYXhCYW5kKQotewotICAgIEludCBpOwotICAgIEludDMyICAgKnBfWV8xOwotICAgIEludDMyICAgKnBfWV8yOwotCi0KLQotCi0gICAgY29uc3QgSW50MzIgKiBwdF9DOwotICAgIEludDE2ICogcHRfWF8xOwotICAgIEludDE2ICogcHRfWF8yOwotICAgIEludDMyIHJlYWxBY2N1MTsKLSAgICBJbnQzMiByZWFsQWNjdTI7Ci0KLSAgICBJbnQzMiB0bXAxOwotICAgIEludDMyIHRtcDI7Ci0KLQotICAgIHBfWV8xID0gc2NyYXRjaF9tZW1bMF07Ci0KLQotICAgIHBfWV8yID0gcF9ZXzEgKyA2MzsKLSAgICBwdF9DICAgPSAmc2JyRGVjb2RlckZpbHRlcmJhbmtDb2VmZmljaWVudHNfYW5fZmlsdFswXTsKLQotICAgIHJlYWxBY2N1MSAgPSAgZnhwX211bDMyX2J5XzE2KFFmbXQyNygtMC4zNjExNTg5OUYpLCAgIFhbLTE5Ml0pOwotCi0KLSAgICByZWFsQWNjdTEgID0gIGZ4cF9tYWMzMl9ieV8xNihRZm10MjcoLTAuMzYxMTU4OTlGKSwgIC1YWy0xMjhdLCByZWFsQWNjdTEpOwotICAgIHJlYWxBY2N1MSAgPSAgZnhwX21hYzMyX2J5XzE2KFFmbXQyNygtMC4wMTMyNzE4MjJGKSwgIFhbLTI1Nl0sIHJlYWxBY2N1MSk7Ci0gICAgKihwX1lfMSsrKSA9ICBmeHBfbWFjMzJfYnl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LAotICAgIEludDMyICBub05vaXNlRmxhZyk7Ci0KLQotICAgIHZvaWQgZW5lcmd5X2VzdGltYXRpb25fTEMoSW50MzIgKmFCdWZSLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgSW50MzIgKm5yZ19lc3RfbWFuLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgSW50MzIgKm5yZ19lc3RfZXhwLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY29uc3QgSW50MzIgKmZyYW1lX2luZm8sCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICBJbnQzMiBpLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgSW50MzIgaywKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEludDMyIGMsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICBJbnQzMiB1aTIpOwotCi0jaWZkZWYgSFFfU0JSCi0KLQotICAgIHZvaWQgZW52ZWxvcGVfYXBwbGljYXRpb24oSW50MzIgICphQnVmUiwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEludDMyICAqYUJ1ZkksCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICBJbnQzMiAgKm5yZ19nYWluX21hbiwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEludDMyICAqbnJnX2dhaW5fZXhwLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgSW50MzIgICpub2lzZV9sZXZlbF9tYW4sCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICBJbnQzMiAgKm5vaXNlX2xldmVsX2V4cCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEludDMyICAqbnJnX3RvbmVfbWFuLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgSW50MzIgICpucmdfdG9uZV9leHAsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICBJbnQzMiAqZkJ1Zl9tYW5bNjRdLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgSW50MzIgKmZCdWZfZXhwWzY0XSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEludDMyICpmQnVmTl9tYW5bNjRdLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgSW50MzIgKmZCdWZOX2V4cFs2NF0sCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb25zdCBJbnQzMiAqZnJhbWVfaW5mbywKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEludDMyICAqaGFybV9pbmRleCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEludDMyICAqcGhhc2VfaW5kZXgsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICBJbnQzMiAgaSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEludDMyICBsb3dTdWJiYW5kLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgSW50MzIgIG5vU3ViYmFuZHMsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICBJbnQzMiAgbm9Ob2lzZUZsYWcsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICBJbnQzMiAgYmFuZF9ucmdfdG9uZV9kZXRlY3RvciwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEludDMyICBtYXhTbW9vdGhMZW5ndGgsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICBJbnQzMiAgc21vb3RoX2xlbmd0aCk7Ci0KLQotICAgIHZvaWQgZW5lcmd5X2VzdGltYXRpb24oSW50MzIgKmFCdWZSLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgSW50MzIgKmFCdWZJLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgSW50MzIgKm5yZ19lc3RfbWFuLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgSW50MzIgKm5yZ19lc3RfZXhwLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgY29uc3QgSW50MzIgKmZyYW1lX2luZm8sCi0gICAgICAgICAgICAgICAgICAgICAgICAgICBJbnQzMiBpLA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RkVSL1BPSU5URVIgUkVGRVJFTkNFUwotOyBEZWNsYXJlIHZhcmlhYmxlcyB1c2VkIGluIHRoaXMgbW9kdWxlIGJ1dCBkZWZpbmVkIGVsc2V3aGVyZQotLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSovCi0KLS8qLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLQotOyBGVU5DVElPTiBDT0RFCi0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tKi8KLQotdm9pZCBjYWxjX3Nicl9lbnZlbG9wZShTQlJfRlJBTUVfREFUQSAqZnJhbWVEYXRhLAotICAgICAgICAgICAgICAgICAgICAgICBJbnQzMiAqYUJ1ZlIsCi0gICAgICAgICAgICAgICAgICAgICAgIEludDMyICphQnVmSSwKLSAgICAgICAgICAgICAgICAgICAgICAgSW50IGZyZXFCYW5kVGFibGUxWzJdW01BWF9GUkVRX0NPRUZGUyArIDFdLAotICAgICAgICAgICAgICAgICAgICAgICBjb25zdCBJbnQzMiAqblNmYiwKLSAgICAgICAgICAgICAgICAgICAgICAgSW50MzIgZnJlcUJhbmRUYWJsZTJbTUFYX05PSVNFX0NPRUZGUyArIDFdLAotICAgICAgICAgICAgICAgICAgICAgICBJbnQzMiBuTkJhbmRzLAotICAgICAgICAgICAgICAgICAgICAgICBJbnQzMiByZXNldCwKLSAgICAgICAgICAgICAgICAgICAgICAgSW50MzIgKmRlZ3JlZUFsaWFzLAotICAgICAgICAgICAgICAgICAgICAgICBJbnQzMiAqaGFybV9pbmRleCwKLSAgICAgICAgICAgICAgICAgICAgICAgSW50MzIgKnBoYXNlX2luZGV4LAotICAgICAgICAgICAgICAgICAgICAgICBJbnQzMiBoRnBbNjRdLAotICAgICAgICAgICAgICAgICAgICAgICBJbnQzMiAqc1VwLAotICAgICAgICAgICAgICAgICAgICAgICBJbnQzMiBsaW1TYmNbXVsxM10sCi0gICAgICAgICAgICAgICAgICAgICAgIEludDMyICpnYXRlTW9kZSwKLSNpZmRlZiBIUV9TQlIKLSAgICAgICAgICAgICAgICAgICAgICAgSW50MzIgKmZCdWZfbWFuWzY0XSwKLSAgICAgICAgICAgICAgICAgICAgICAgSW50MzIgKmZCdWZfZXhwWzY0XSwKLSAgICAgICAgICAgICAgICAgICAgICAgSW50MzIgKmZCdWZOX21hbls2NF0sCi0gICAgICAgICAgICAgICAgICAgICAgIEludDMyICpmQnVmTl9leHBbNjRdLAotI2VuZGlmCi0gICAgICAgICAgICAgICAgICAgICAgIEludDMyIHNjcmF0Y2hfbWVtW11bNjRdLAotICAgICAgICAgICAgICAgICAgICAgICBzdHJ1Y3QgUEFUQ0ggUGF0Y2gsCi0gICAgICAgICAgICAgICAgICAgICAgIEludDMyICBzcXJ0X2NhY2hlW11bNF0sCi0gICAgICAgICAgICAgICAgICAgICAgIEludDMyICBMQ19mbGFnKQotewotCi0gICAgSW50MzIgYzsKLSAgICBJbnQzMiBsaTsKLSAgICBJbnQzMiB1aTsKLSAgICBJbnQzMiBpOwotICAgIEludDMyIGo7Ci0gICAgSW50MzIgayA9IDA7Ci0gICAgSW50MzIgbDsKLSAgICBJbnQgbSA9IDA7Ci0gICAgSW50IGtrID0gMDsKLSAgICBJbnQgbzsKLSAgICBJbnQgbmV4dCA9IC0xOwotICAgIEludDMyIHVpMjsKLSAgICBJbnQgZmxhZzsKLSAgICBJbnQgbm9Ob2lzZUZsYWc7Ci0gICAgSW50ICpwdHI7Ci0KLQotICAgIFVJbnQzMiBucmcgPSAwOwotICAgIEludDMyIG5yZ19leHAgPSAwOwotICAgIHN0cnVjdCBpbnRnX2RpdiAgIHF1b3R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QzMiBsb3dTdWJiYW5kICAgICAgICA9IGZyZXFCYW5kVGFibGUxW0xPV19SRVNdWzBdOwotICAgIEludDMyIG5vU3ViYmFuZHMgICAgICAgID0gZnJlcUJhbmRUYWJsZTFbTE9XX1JFU11bblNmYltMT1dfUkVTXV0gLSBsb3dTdWJiYW5kOwotICAgIEludDMyIG5FbnYgICAgICAgICAgICAgID0gZnJhbWVfaW5mb1swXTsKLSAgICBJbnQzMiBzRW52ICAgICAgICAgICAgICA9IGZyYW1lX2luZm9bKG5FbnYgKyAxKTw8MV07Ci0KLSAgICAvKiBlbnN1cmUgdGhhdCBub1N1YmJhbmRzIGluIHRoZSByYW5nZSBbMCw2NF0gKi8KLSAgICBub1N1YmJhbmRzID0gKG5vU3ViYmFuZHMgPj4gMzEpIF4gbm9TdWJiYW5kczsKLSAgICBpZiAobm9TdWJiYW5kcyA+IDY0KQotICAgIHsKLSAgICAgICAgbm9TdWJiYW5kcyA9IDY0OwotICAgIH0KLQotICAgIGlmIChyZXNldCkKLSAgICB7Ci0gICAgICAgICpzVXAgPSAxOwotICAgICAgICAqcGhhc2VfaW5kZXggPSAwOwotICAgICAgICBzYnJfY3JlYXRlX2xpbWl0ZXJfYmFuZHMobGltU2JjLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZ2F0ZU1vZGUsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBmcmVxQmFuZFRhYmxlMVtMT1dfUkVTXSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFBhdGNoLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgblNmYltMT1dfUkVTXSk7Ci0gICAgfQotCi0gICAgLyogTWFwcGluZy4gKi8KLSAgICBwdl9tZW1zZXQoKHZvaWQqKWhGLCAwLCAoc2l6ZW9mKCpoRikgPDwgNikpOwotCi0gICAgcHRyICA9IGZyZXFCYW5kVGFibGUxW0hJXTsKLSAgICBsID0gKihwdHIrKyk7Ci0KLSAgICBmb3IgKGkgPSBuU2ZiW0hJXTsgaSAhPSAwOyBpLS0pCi0gICAgewotICAgICAgICBrICAgICA9ICoocHRyKyspOwotICAgICAgICBqICAgICA9ICgoayArIGwpID4+IDEpIC0gbG93U3ViYmFuZDsKLSAgICAgICAgbCAgID0gazsKLSAgICAgICAgaEZbal0gPSAqKGFkZEhhcm1vbmljcysrKTsKLSAgICB9Ci0KLQotICAgIC8qIEVudmVsb3BlIGFkanVzdG1lbnQuICovCi0KLSAgICBmb3IgKGkgPSAwOyBpIDwgbkVudjsgaSsrKQotICAgIHsKLQotICAgICAgICBpZiAoZnJhbWVfaW5mb1sxK2ldID09IGZyYW1lX2luZm9bKG5FbnY8PDEpKzQra2tdKQotICAgICAgICB7Ci0gICAgICAgICAgICBraysrLCBuZXh0Kys7Ci0gICAgICAgIH0KLQotICAgICAgICBub05vaXNlRmxhZyA9IChpID09IHNFbnYgfHwgaSA9PSBmcmFtZURhdGEtPnByZXZFbnZJc1Nob3J0KSA/IDEgOiAwOwotCi0jaWZkZWYgSFFfU0JSCi0gICAgICAgIHNtb290aF9sZW5ndGggPSAobm9Ob2lzZUZsYWcgPyAwIDogc21vb3RoTGVuZ3Roc1tzbW9vdGhpbmdMZW5ndGhdKTsKLSNlbmRpZgotCi0KLSAgICAgICAgLyogRXN0aW1hdGUgbGV2ZWxzLiAqLwotICAgICAgICBjID0gMDsKLSAgICAgICAgbyA9IDA7Ci0KLSAgICAgICAgYmFuZF9ucmdfdG9uZV9kZXRlY3RvciA9IDA7Ci0KLSAgICAgICAgSW50IGtra2sgPSBmcmVxQmFuZFRhYmxlMVsgZnJhbWVfaW5mb1tuRW52KzIraV0gXVswXTsKLQotICAgICAgICBmb3IgKGogPSAwOyBqIDwgIG5TZmJbZnJhbWVfaW5mb1tuRW52KzIraV1dOyBqKyspCi0gICAgICAgIHsKLSAgICAgICAgICAgIGxpID0gZnJlcUJhbmRUYWJsZTFbIGZyYW1lX2luZm9bbkVudisyK2ldIF1baiAgICBdOwotICAgICAgICAgICAgdWkgPSBmcmVxQmFuZFRhYmxlMVsgZnJhbWVfaW5mb1tuRW52KzIraV0gXVtqICsgMV07Ci0gICAgICAgICAgICBmbGFnID0gMDsKLQotICAgICAgICAgICAgZm9yIChrID0gbGk7IGsgPCB1aTsgaysrKQotICAgICAgICAgICAgeyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvKiBDYWxjdWxhdGUgdGhlIGF2ZXJhZ2UgZW5lcmd5IG92ZXIgdGhlIGN1cnJlbnQgZW52ZWxvcGUsICovCi0gICAgICAgICAgICAgICAgdWkyICAgPSAoZnJhbWVfaW5mb1sxK2ldIDw8IDEpOwotCi0gICAgICAgICAgICAgICAgaWYgKExDX2ZsYWcgPT0gT04pCi0gICAgICAgICAgICAgICAgewotICAgICAgICAgICAgICAgICAgICBlbmVyZ3lfZXN0aW1hdGlvbl9MQygoSW50MzIgKilhQnVmUiwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbnJnX2VzdF9tYW4sCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG5yZ19lc3RfZXhwLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBmcmFtZV9pbmZvLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBrIC0ga2traywKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYywKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdWkyKTsKLSAgICAgICAgICAgICAgICB9Ci0jaWZkZWYgSFFfU0JSCi0gICAgICAgICAgICAgICAgZWxzZQotICAgICAgICAgICAgICAgIHsKLQotICAgICAgICAgICAgICAgICAgICBlbmVyZ3lfZXN0aW1hdGlvbigoSW50MzIgKilhQnVmUiwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKEludDMyICopYUJ1ZkksCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG5yZ19lc3RfbWFuLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBucmdfZXN0X2V4cCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZnJhbWVfaW5mbywKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgayAtIGtra2ssCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGMsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHVpMik7Ci0gICAgICAgICAgICAgICAgfQotI2VuZGlmCi0KLSAgICAgICAgICAgICAgICBmbGFnID0gKGhGW2NdICYmIChpID49IHNFbnYgfHwgaEZwW2MrbG93U3ViYmFuZF0pKSA/IDEgOiBmbGFnOwotICAgICAgICAgICAgICAgIGMrKzsKLSAgICAgICAgICAgIH0KLQotCi0gICAgICAgICAgICB1aTIgPSBmcmVxQmFuZFRhYmxlMltvKzFdOwotCi0gICAgICAgICAgICBpZiAoIWludF9tb2RlKQotICAgICAgICAgICAgeyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLyogSWYgbm8gaW50ZXJwb2xhdGlvbiBpcyB1c2VkLCAgICovCi0KLSAgICAgICAgICAgICAgICB0bXBfcTEgPSAtMTAwOwotCi0gICAgICAgICAgICAgICAgZm9yIChrID0gYyAtICh1aSAtIGxpKTsgayA8IGM7IGsrKykKLSAgICAgICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgICAgIGlmICh0bXBfcTEgPCBucmdfZXN0X2V4cFtrXSkKLSAgICAgICAgICAgICAgICAgICAgewotICAgICAgICAgICAgICAgICAgICAgICAgdG1wX3ExID0gbnJnX2VzdF9leHBba107Ci0gICAgICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgICAgICBucmcgPSAwOwotICAgICAgICAgICAgICAgIGZvciAoayA9IGMgLSAodWkgLSBsaSk7IGsgPCBjOyBrKyspCi0gICAgICAgICAgICAgICAgeyAgICAvKiBhdmVyYWdlIHRoZSBlbmVyZ3kgaW4gYWxsIHRoZSBRTUYgYmFuZHMsICovCi0gICAgICAgICAgICAgICAgICAgIG5yZyArPSBucmdfZXN0X21hbltrXSA+PiAodG1wX3ExIC0gbnJnX2VzdF9leHBba10pOyAvKiBmb3IgdGhlIHdob2xlIHNjYWxlZmFjdG9yIGJhbmQuICAqLwotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICBucmcgLz0gKHVpIC0gbGkpOwotICAgICAgICAgICAgICAgIG5yZ19leHAgPSB0bXBfcTE7Ci0KLSAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgYyAtPSAodWkgLSBsaSk7Ci0KLSAgICAgICAgICAgIGZvciAoayA9IDA7IGsgPCB1aSAtIGxpOyBrKyspCi0gICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgbyA9IChrICsgbGkgPj0gdWkyKSA/IG8gKyAxIDogbzsKLSAgICAgICAgICAgICAgICB1aTIgPSBmcmVxQmFuZFRhYmxlMltvKzFdOwotICAgICAgICAgICAgICAgIC8qCi0gICAgICAgICAgICAgICAgICogIElmIG5vIGludGVycG9sYXRpb24gaXMgdXNlZCwgdXNlIHRoZSBhdmVyYWdlZCBlbmVyZ3kgZnJvbSBhYm92ZSwKLSAgICAgICAgICAgICAgICAgKiAgb3RoZXJ3aXNlIGRvIG5vdGhpbmcuCi0gICAgICAgICAgICAgICAgICovCi0KLQotICAgICAgICAgICAgICAgIGlmICghaW50X21vZGUpCi0gICAgICAgICAgICAgICAgewotICAgICAgICAgICAgICAgICAgICBucmdfZXN0X21hbltjXSA9IG5yZzsKLSAgICAgICAgICAgICAgICAgICAgbnJnX2VzdF9leHBbY10gPSBucmdfZXhwOwotICAgICAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgICAgIGlmIChMQ19mbGFnID09IE9OKQotICAgICAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAgICAgbnJnX2VzdF9leHBbY10gKz0gMTsKLQotICAgICAgICAgICAgICAgICAgICBpZiAoZmxhZykKLSAgICAgICAgICAgICAgICAgICAgewotICAgICAgICAgICAgICAgICAgICAgICAgZG9udFVzZVRoZXNlR2FpblZhbHVlc1trICsgbGkgLSBsb3dTdWJiYW5kXSA9IDE7Ci0gICAgICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICAgICAgZWxzZQotICAgICAgICAgICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgICAgICAgICBkb250VXNlVGhlc2VHYWluVmFsdWVzW2sgKyBsaSAtIGxvd1N1YmJhbmRdID0gMDsKLSAgICAgICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgICAgIG5yZ19yZWZfbWFuW2NdID0gc2ZiX25yZ19tYW5bbV07Ci0gICAgICAgICAgICAgICAgbnJnX3JlZl9leHBbY10gPSBzZmJfbnJnX2V4cFttXTsKLQotICAgICAgICAgICAgICAgIC8qCi0gICAgICAgICAgICAgICAgICogIGNvbXB1dGUgbkwvKDEgKyBuTCk7ICAgd2hlcmUgbkwgPSBuTF9tYW4qMl5uTF9leHAKLSAgICAgICAgICAgICAgICAgKi8KLSAgICAgICAgICAgICAgICBhdXgxID0gbmV4dCAqIG5OQmFuZHMgKyBvOwotCi0gICAgICAgICAgICAgICAgdG1wX3ExID0gbkxfZXhwW2F1eDFdOwotCi0gICAgICAgICAgICAgICAgaWYgKHRtcF9xMSA+PSAwKQotICAgICAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAgICAgcHZfZGl2KG5MX21hblthdXgxXSwgbkxfbWFuW2F1eDFdICsgKDB4M0ZGRkZGRkYgPj4gdG1wX3ExKSwgJnF1b3RpZW50KTsKLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgZWxzZQotICAgICAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAgICAgdG1wX3ExID0gbkxfbWFuW2F1eDFdID4+ICgtdG1wX3ExKTsKLSAgICAgICAgICAgICAgICAgICAgcHZfZGl2KHRtcF9xMSwgdG1wX3ExICsgMHgzRkZGRkZGRiwgJnF1b3RpZW50KTsKLSAgICAgICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgICAgICAvKgotICAgICAgICAgICAgICAgICAqICB0bXBfcTEgPSBuTC8oMSArIG5MKSpucmdfcmVmW2NdOwotICAgICAgICAgICAgICAgICAqLwotCi0gICAgICAgICAgICAgICAgdG1wX3ExID0gZnhwX211bDMyX1EzMChxdW90aWVudC5xdW90aWVudCA+PiBxdW90aWVudC5zaGlmdF9mYWN0b3IsICBucmdfcmVmX21hbltjXSk7Ci0KLSAgICAgICAgICAgICAgICBpZiAoZmxhZykKLSAgICAgICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgICAgIC8qCi0gICAgICAgICAgICAgICAgICAgICAqICBDYWxjdWxhdGUgbGV2ZWxzIGFuZCBnYWluLCBkZXBlbmRlbnQgb24gd2hldGhlciBhIHN5bnRoZXRpYywgYSBzaW5lIGlzIHByZXNlbnQgb3Igbm90LgotICAgICAgICAgICAgICAgICAgICAgKgotICAgICAgICAgICAgICAgICAgICAgKiAgbnJnX2dhaW5bY109KGZsb2F0KXB2X3NxcnQoIHRtcC8obnJnX2VzdFtjXSArIDEpLCBzcXJ0X2NhY2hlWzFdICk7Ci0gICAgICAgICAgICAgICAgICAgICAqLwotCi0KLSAgICAgICAgICAgICAgICAgICAgcHZfZGl2KHRtcF9xMSwgbnJnX2VzdF9tYW5bY10gKyAxLCAmcXVvdGllbnQpOwotICAgICAgICAgICAgICAgICAgICAvKgotICAgICAgICAgICAgICAgICAgICAgKiAgbnJnX2VzdF9tYW5bY10gaXMgYW4gaW50ZWdlciBudW1iZXIsIHdoaWxlIHRtcF9xMSBhbmQgcXVvdGllbnQucXVvdGllbnQKLSAgICAgICAgICAgICAgICAgICAgICogIGFyZSBmcmFjdGlvbnMgaW4gUTMwCi0gICAgICAgICAgICAgICAgICAgICAqLwotCi0gICAgICAgICAgICAgICAgICAgIHRtcF9xMiA9IG5yZ19yZWZfZXhwW2NdIC0gbnJnX2VzdF9leHBbY10gLSBxdW90aWVudC5zaGlmdF9mYWN0b3IgLSAzMDsKLQotICAgICAgICAgICAgICAgICAgICBwdl9zcXJ0KHF1b3RpZW50LnF1b3RpZW50LCB0bXBfcTIsICZyb290X3NxLCBzcXJ0X2NhY2hlWzFdKTsKLSAgICAgICAgICAgICAgICAgICAgbnJnX2dhaW5fbWFuW2NdID0gcm9vdF9zcS5yb290OyAgICAgLyogIGluIFEyOCBmb3JtYXQgKi8KLSAgICAgICAgICAgICAgICAgICAgbnJnX2dhaW5fZXhwW2NdID0gcm9vdF9zcS5zaGlmdF9mYWN0b3I7Ci0KLQotICAgICAgICAgICAgICAgICAgICAvKgotICAgICAgICAgICAgICAgICAgICAgKiAgbnJnX3RvbmVbY109KGZsb2F0KSggKGhGW2NdICYmIChpID49IHNFbnYgfHwgaEZwW2MrbG93U3ViYmFuZF0pKSA/Ci0gICAgICAgICAgICAgICAgICAgICAqICAgICAgICAgICAgICAgICAgICAgICAgICBwdl9zcXJ0KG5yZ19yZWZbY10vKDErdG1wX25MKSwgc3FydF9jYWNoZVsyXSkgOiAwKTsKLSAgICAgICAgICAgICAgICAgICAgICovCi0gICAgICAgICAgICAgICAgICAgIGlmIChoRltjXSAmJiAoaSA+PSBzRW52IHx8IGhGcFtjK2xvd1N1YmJhbmRdKSkKLSAgICAgICAgICAgICAgICAgICAgewotICAgICAgICAgICAgICAgICAgICAgICAgLyoKLSAgICAgICAgICAgICAgICAgICAgICAgICAqICBucmdfcmVmW2NdIGFuZCAgbkwsIGFzIHdlbGwgYXMgcXVvdGllbnQucXVvdGllbnQKLSAgICAgICAgICAgICAgICAgICAgICAgICAqICBhcmUgZnJhY3Rpb25zIGluIFEzMAotICAgICAgICAgICAgICAgICAgICAgICAgICovCi0KLSAgICAgICAgICAgICAgICAgICAgICAgIC8qICBhdXgxID09IG5leHQqbk5CYW5kcyArIG8gKi8KLQotICAgICAgICAgICAgICAgICAgICAgICAgdG1wX3EyID0gbkxfZXhwW2F1eDFdOwotICAgICAgICAgICAgICAgICAgICAgICAgLyoKLSAgICAgICAgICAgICAgICAgICAgICAgICAqICBucmdfcmVmW2NdLygxK3RtcF9uTCkKLSAgICAgICAgICAgICAgICAgICAgICAgICAqLwotCi0gICAgICAgICAgICAgICAgICAgICAgICBpZiAodG1wX3EyID49IDApCi0gICAgICAgICAgICAgICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgcHZfZGl2KG5yZ19yZWZfbWFuW2NdLCBuTF9tYW5bYXV4MV0gKyAoMHgzRkZGRkZGRiA+PiB0bXBfcTIpLCAmcXVvdGllbnQpOwotICAgICAgICAgICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgICAgICAgICAgZWxzZQotICAgICAgICAgICAgICAgICAgICAgICAgewotICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRtcF9xMiA9IG5MX21hblthdXgxXSA+PiAoLXRtcF9xMik7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgcHZfZGl2KG5yZ19yZWZfbWFuW2NdLCB0bXBfcTIgKyAweDNGRkZGRkZGLCAmcXVvdGllbnQpOwotICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRtcF9xMiA9IDA7ICAgICAvKiBleHBvbmVudCBoYXMgYmVlbiBhcHBsaWVkIHRvIHRoZSBzdW0gKChtYW4+PmV4cCkgKyAxKSAgKi8KLSAgICAgICAgICAgICAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgICAgICAgICAgICAgdG1wX3EyID0gbnJnX3JlZl9leHBbY10gLSB0bXBfcTIgLSBxdW90aWVudC5zaGlmdF9mYWN0b3I7Ci0KLSAgICAgICAgICAgICAgICAgICAgICAgIHB2X3NxcnQocXVvdGllbnQucXVvdGllbnQsIHRtcF9xMiwgJnJvb3Rfc3EsIHNxcnRfY2FjaGVbMl0pOwotICAgICAgICAgICAgICAgICAgICAgICAgbnJnX3RvbmVfbWFuW2NdICAgID0gcm9vdF9zcS5yb290OwotICAgICAgICAgICAgICAgICAgICAgICAgbnJnX3RvbmVfZXhwW2NdICAgID0gcm9vdF9zcS5zaGlmdF9mYWN0b3I7Ci0KLSAgICAgICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgICAgICBlbHNlCi0gICAgICAgICAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAgICAgICAgIG5yZ190b25lX21hbltjXSAgICA9IDA7Ci0gICAgICAgICAgICAgICAgICAgICAgICBucmdfdG9uZV9leHBbY10gICAgPSAwOwotICAgICAgICAgICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgZWxzZQotICAgICAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAgICAgaWYgKG5vTm9pc2VGbGFnKQotICAgICAgICAgICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgICAgICAgICAvKgotICAgICAgICAgICAgICAgICAgICAgICAgICogbnJnX2dhaW5bY10gPSAoZmxvYXQpIHB2X3NxcnQobnJnX3JlZltjXSAvKG5yZ19lc3RbY10gKyAxKSwgc3FydF9jYWNoZVszXSk7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgKi8KLQotICAgICAgICAgICAgICAgICAgICAgICAgcHZfZGl2KG5yZ19yZWZfbWFuW2NdLCBucmdfZXN0X21hbltjXSArIDEsICZxdW90aWVudCk7Ci0KLSAgICAgICAgICAgICAgICAgICAgICAgIC8qCi0gICAgICAgICAgICAgICAgICAgICAgICAgKiAgbnJnX2VzdF9tYW5bY10gaXMgYW4gaW50ZWdlciBudW1iZXIsIHdoaWxlIG5yZ19yZWZfbWFuW2NdIGFuZAotICAgICAgICAgICAgICAgICAgICAgICAgICogIHF1b3RpZW50LnF1b3RpZW50IGFyZSBmcmFjdGlvbnMgaW4gUTMwCi0gICAgICAgICAgICAgICAgICAgICAgICAgKi8KLQotICAgICAgICAgICAgICAgICAgICAgICAgdG1wX3EyID0gbnJnX3JlZl9leHBbY10gLSBucmdfZXN0X2V4cFtjXSAtIHF1b3RpZW50LnNoaWZ0X2ZhY3RvciAtIDMwOwotCi0gICAgICAgICAgICAgICAgICAgICAgICBwdl9zcXJ0KHF1b3RpZW50LnF1b3RpZW50LCB0bXBfcTIsICZyb290X3NxLCBzcXJ0X2NhY2hlWzNdKTsKLSAgICAgICAgICAgICAgICAgICAgICAgIG5yZ19nYWluX21hbltjXSA9IHJvb3Rfc3Eucm9vdDsKLSAgICAgICAgICAgICAgICAgICAgICAgIG5yZ19nYWluX2V4cFtjXSA9IHJvb3Rfc3Euc2hpZnRfZmFjdG9yOwotCi0gICAgICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICAgICAgZWxzZQotICAgICAgICAgICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgICAgICAgICAvKgotICAgICAgICAgICAgICAgICAgICAgICAgICogIG5yZ19nYWluW2NdID0gKGZsb2F0KSBwdl9zcXJ0KG5yZ19yZWZbY10vKChucmdfZXN0W2NdICsgMSkqKDErdG1wX25MKSksIHNxcnRfY2FjaGVbNF0pOwotICAgICAgICAgICAgICAgICAgICAgICAgICovCi0gICAgICAgICAgICAgICAgICAgICAgICAvKiAgYXV4MSA9PSBuZXh0Km5OQmFuZHMgKyBvICovCi0KLSAgICAgICAgICAgICAgICAgICAgICAgIHRtcF9xMiA9IG5MX2V4cFthdXgxXTsKLSAgICAgICAgICAgICAgICAgICAgICAgIC8qCi0gICAgICAgICAgICAgICAgICAgICAgICAgKiAgbnJnX3JlZltjXS8oKG5yZ19lc3RbY10gKyAxKSooMSt0bXBfbkwpKQotICAgICAgICAgICAgICAgICAgICAgICAgICovCi0KLSAgICAgICAgICAgICAgICAgICAgICAgIGlmIChucmdfZXN0X21hbltjXSA9PSAwKQotICAgICAgICAgICAgICAgICAgICAgICAgewotICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRtcF9xMiA9IDA7ICAgICAvKiAgYXZvaWQgZGl2aXNpb24gYnkgMCBpbiBuZXh0IGlmLWVsc2UsIHRoaXMgY291bGQgYmUgZHVlIHRvCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByb3VuZGluZyBub2lzZSAqLwotICAgICAgICAgICAgICAgICAgICAgICAgfQotCi0KLSAgICAgICAgICAgICAgICAgICAgICAgIGlmICh0bXBfcTIgPj0gMCkKLSAgICAgICAgICAgICAgICAgICAgICAgIHsKLQotICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRtcF9xMiA9IGZ4cF9tdWwzMl9RMzAobnJnX2VzdF9tYW5bY10gKyAxLCBuTF9tYW5bYXV4MV0gKyAoMHgzRkZGRkZGRiA+PiB0bXBfcTIpKTsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBwdl9kaXYobnJnX3JlZl9tYW5bY10sIHRtcF9xMiwgJnF1b3RpZW50KTsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAvKgotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqICBucmdfZXN0X21hbltjXSBpcyBhbiBpbnRlZ2VyIG51bWJlciwgd2hpbGUgbnJnX3JlZl9tYW5bY10gYW5kCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICogIHF1b3RpZW50LnF1b3RpZW50IGFyZSBmcmFjdGlvbnMgaW4gUTMwCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgdG1wX3EyID0gbnJnX3JlZl9leHBbY10gLSBxdW90aWVudC5zaGlmdF9mYWN0b3IgLSAzMCAtIG5MX2V4cFthdXgxXTsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAobnJnX2VzdF9tYW5bY10pCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgewotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0bXBfcTIgLT0gIG5yZ19lc3RfZXhwW2NdOwotICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRtcF9xMiA9IG5yZ19yZWZfZXhwW2NdIC0gbnJnX2VzdF9leHBbY10gLSBxdW90aWVudC5zaGlmdF9mYWN0b3IgLSAzMCAtIG5MX2V4cFthdXgxXTsKLSAgICAgICAgICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICAgICAgICAgIGVsc2UKLSAgICAgICAgICAgICAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAodG1wX3EyID4gLSAxMCkKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRtcF9xMiA9IG5MX21hblthdXgxXSA+PiAoLXRtcF9xMik7Ci0KLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdG1wX3EyID0gZnhwX211bDMyX1EzMChucmdfZXN0X21hbltjXSArIDEsIHRtcF9xMiArIDB4M0ZGRkZGRkYpOwotICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBlbHNlCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgewotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0bXBfcTIgPSBucmdfZXN0X21hbltjXSArIDE7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgfQotCi0KLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBwdl9kaXYobnJnX3JlZl9tYW5bY10sIHRtcF9xMiwgJnF1b3RpZW50KTsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAvKgotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqICBucmdfZXN0X21hbltjXSBpcyBhbiBpbnRlZ2VyIG51bWJlciwgd2hpbGUgbnJnX3JlZl9tYW5bY10gYW5kCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICogIHF1b3RpZW50LnF1b3RpZW50IGFyZSBmcmFjdGlvbnMgaW4gUTMwCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0KLSAgICAgICAgICAgICAgICAgICAgICAgICAgICB0bXBfcTIgPSBucmdfcmVmX2V4cFtjXSAtIHF1b3RpZW50LnNoaWZ0X2ZhY3RvciAtIDMwOwotICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChucmdfZXN0X21hbltjXSkKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRtcF9xMiAtPSAgbnJnX2VzdF9leHBbY107Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgfQotCi0gICAgICAgICAgICAgICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgICAgICAgICAgICAgIHB2X3NxcnQocXVvdGllbnQucXVvdGllbnQsIHRtcF9xMiwgJnJvb3Rfc3EsIHNxcnRfY2FjaGVbNF0pOwotICAgICAgICAgICAgICAgICAgICAgICAgbnJnX2dhaW5fbWFuW2NdID0gcm9vdF9zcS5yb290OwotICAgICAgICAgICAgICAgICAgICAgICAgbnJnX2dhaW5fZXhwW2NdID0gcm9vdF9zcS5zaGlmdF9mYWN0b3I7Ci0KLSAgICAgICAgICAgICAgICAgICAgfQotCi0gICAgICAgICAgICAgICAgICAgIG5yZ190b25lX21hbltjXSAgICA9IDA7Ci0gICAgICAgICAgICAgICAgICAgIG5yZ190b25lX2V4cFtjXSAgICA9IC0xMDA7Ci0KLSAgICAgICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgICAgICBiYW5kX25yZ190b25lX2RldGVjdG9yIHw9IG5yZ190b25lX21hbltjXTsgICAvKiAgZGV0ZWN0IGFueSB0b25lIGFjdGl2aXR5ICAqLwotCi0gICAgICAgICAgICAgICAgcHZfc3FydCh0bXBfcTEsIG5yZ19yZWZfZXhwW2NdLCAmcm9vdF9zcSwgc3FydF9jYWNoZVs1XSk7Ci0gICAgICAgICAgICAgICAgbm9pc2VfbGV2ZWxfbWFuW2NdID0gcm9vdF9zcS5yb290OwotICAgICAgICAgICAgICAgIG5vaXNlX2xldmVsX2V4cFtjXSA9IHJvb3Rfc3Euc2hpZnRfZmFjdG9yOwotCi0gICAgICAgICAgICAgICAgYysrOwotCi0gICAgICAgICAgICB9ICAgLyogLS0tLSBlbmQtZm9yLWxvb3AgKGspIC0tLS0tLSAqLwotICAgICAgICAgICAgbSsrOwotCi0gICAgICAgIH0gICAvKiAtLS0tLS0tLSBFc3RpbWF0ZSBsZXZlbHMgZW5kLWZvci1sb29wIChqKSAtLS0tLSAqLwotCi0KLQotICAgICAgICAvKgotICAgICAgICAgKiAgICAgIExpbWl0ZXIKLSAgICAgICAgICovCi0KLQotICAgICAgICBmb3IgKGMgPSAwOyBjIDwgZ2F0ZU1vZGVbbGltaXRlckJhbmRdOyBjKyspCi0gICAgICAgIHsKLQotICAgICAgICAgICAgcF9yZWZfbWFuID0gMDsKLSAgICAgICAgICAgIHBfZXN0X21hbiA9IDA7Ci0KLSAgICAgICAgICAgIC8qCi0gICAgICAgICAgICAgKiAgZ2V0IG1heCBleHBvbmVudCBmb3IgdGhlIHJlZmVyZW5jZSBhbmQgZXN0aW1hdGVkIGVuZXJneQotICAgICAgICAgICAgICovCi0gICAgICAgICAgICBwX3JlZl9leHAgPSAtMTAwOwotICAgICAgICAgICAgcF9lc3RfZXhwID0gLTEwMDsKLQotICAgICAgICAgICAgZm9yIChrID0gbGltU2JjW2xpbWl0ZXJCYW5kXVtjXTsgayA8IGxpbVNiY1tsaW1pdGVyQmFuZF1bYyArIDFdOyBrKyspCi0gICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgaWYgKHBfcmVmX2V4cCA8IG5yZ19yZWZfZXhwW2tdKQotICAgICAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAgICAgcF9yZWZfZXhwID0gbnJnX3JlZl9leHBba107ICAgIC8qIG1heCAqLwotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICBpZiAocF9lc3RfZXhwIDwgbnJnX2VzdF9leHBba10pCi0gICAgICAgICAgICAgICAgewotICAgICAgICAgICAgICAgICAgICBwX2VzdF9leHAgPSBucmdfZXN0X2V4cFtrXTsgICAgLyogbWF4ICovCi0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgfQotCi0gICAgICAgICAgICBrIC09IGxpbVNiY1tsaW1pdGVyQmFuZF1bY107ICAgICAvKiAgbnVtYmVyIG9mIGVsZW1lbnQgdXNlZCBpbiB0aGUgYWRkaXRpb24gKi8KLQotICAgICAgICAgICAgd2hpbGUgKGsgIT0gMCkgICAgICAvKiAgYml0IGd1YXJkIHByb3RlY3Rpb24gZGVwZW5kcyBvbiBsb2cyKGspICAqLwotICAgICAgICAgICAgewotICAgICAgICAgICAgICAgIGsgPj49IDE7Ci0gICAgICAgICAgICAgICAgcF9yZWZfZXhwKys7ICAgICAgIC8qICBhZGQgZXh0cmEgYml0LW92ZXJmbG93LWd1YXJkLCBucmdfcmVmX2V4cCBpcyBpbiBRMzAgZm9ybWF0ICovCi0gICAgICAgICAgICB9Ci0KLQotICAgICAgICAgICAgZm9yIChrID0gbGltU2JjW2xpbWl0ZXJCYW5kXVtjXTsgayA8IGxpbVNiY1tsaW1pdGVyQmFuZF1bYyArIDFdOyBrKyspCi0gICAgICAgICAgICB7ICAgLypDYWxjdWxhdGUgdGhlIGF2ZXJhZ2UgZ2FpbiBmb3IgdGhlIGN1cnJlbnQgbGltaXRlciBiYW5kLiovCi0gICAgICAgICAgICAgICAgcF9yZWZfbWFuICs9IChucmdfcmVmX21hbltrXSA+PiAocF9yZWZfZXhwIC0gbnJnX3JlZl9leHBba10pKTsKLSAgICAgICAgICAgICAgICBwX2VzdF9tYW4gKz0gKG5yZ19lc3RfbWFuW2tdID4+IChwX2VzdF9leHAgLSBucmdfZXN0X2V4cFtrXSkpOwotCi0gICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgIGlmIChwX2VzdF9tYW4pCi0gICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgLyoKLSAgICAgICAgICAgICAgICAgKiAgImF2ZXJhZ2UgZ2FpbiIgKG5vdCBlcXVhbCB0byBhdmVyYWdlIG9mIG5yZ19nYWluKQotICAgICAgICAgICAgICAgICAqLwotICAgICAgICAgICAgICAgIHB2X2RpdihwX3JlZl9tYW4sIHBfZXN0X21hbiwgJnF1b3RpZW50KTsKLQotICAgICAgICAgICAgICAgIHRtcF9xMiA9IHBfcmVmX2V4cCAtIDMwIC0gcF9lc3RfZXhwIC0gcXVvdGllbnQuc2hpZnRfZmFjdG9yOwotCi0gICAgICAgICAgICAgICAgLyoKLSAgICAgICAgICAgICAgICAgKiAgYXZnX2dhaW4gPSBzcXJ0KHBfcmVmL3BfZXN0KQotICAgICAgICAgICAgICAgICAqLwotICAgICAgICAgICAgICAgIHB2X3NxcnQocXVvdGllbnQucXVvdGllbnQsIHRtcF9xMiwgJnJvb3Rfc3EsIHNxcnRfY2FjaGVbNl0pOwotICAgICAgICAgICAgICAgIGF2Z19nYWluICA9IHJvb3Rfc3Eucm9vdDsKLSAgICAgICAgICAgICAgICBnX21heF9leHAgPSByb290X3NxLnNoaWZ0X2ZhY3RvcjsKLQotICAgICAgICAgICAgICAgIC8qCi0gICAgICAgICAgICAgICAgICogIG1heGltdW0gZ2FpbiBhbGxvd2VkIGlzIGNhbGN1bGF0ZWQgZnJvbSB0YWJsZS4KLSAgICAgICAgICAgICAgICAgKi8KLQotICAgICAgICAgICAgICAgIC8qCi0gICAgICAgICAgICAgICAgICogIGdfbWF4ID0gYXZnX2dhaW4gKiBsaW1HYWluc1tsaW1pdGVyR2FpbnNdOwotICAgICAgICAgICAgICAgICAqLwotCi0gICAgICAgICAgICAgICAgZ19tYXhfbWFuID0gZnhwX211bDMyX1EzMChhdmdfZ2FpbiwgbGltR2FpbnNbbGltaXRlckdhaW5zXSk7ICAgLyogIHRhYmxlIGlzIGluIFEzMCAqLwotCi0gICAgICAgICAgICAgICAgaWYgKGxpbWl0ZXJHYWlucyA9PSAzKQotICAgICAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAgICAgZ19tYXhfZXhwID0gbGltR2FpbnNbNF07Ci0gICAgICAgICAgICAgICAgfQotCi0gICAgICAgICAgICAgICAgdG1wX3ExID0gZ19tYXhfZXhwID49IDE2ID8gZ19tYXhfZXhwIDogMTY7Ci0KLSAgICAgICAgICAgICAgICB0bXBfcTIgPSBnX21heF9tYW4gPj4gKHRtcF9xMSAtIGdfbWF4X2V4cCk7Ci0gICAgICAgICAgICAgICAgdG1wX3ExID0gUTI4Zm10KDEuNTI1ODc4OTA2MjVGKSA+PiAodG1wX3ExIC0gMTYpOwotCi0gICAgICAgICAgICAgICAgaWYgKHRtcF9xMiA+IHRtcF9xMSkKLSAgICAgICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgICAgIC8qIHVwcGVyIGxpbWl0LCArMTAwIGRCICovCi0gICAgICAgICAgICAgICAgICAgIGdfbWF4X21hbiA9IFEyOGZtdCgxLjUyNTg3ODkwNjI1Rik7Ci0gICAgICAgICAgICAgICAgICAgIGdfbWF4X2V4cCA9IDE2OwotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgIH0KLSAgICAgICAgICAgIGVsc2UKLSAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAvKiAgUWZtdCgxLjUyNTg3ODkwNjI1RikgICAgZXhwID0gMTYgKi8KLSAgICAgICAgICAgICAgICBnX21heF9tYW4gPSBRMjhmbXQoMS41MjU4Nzg5MDYyNUYpOwotICAgICAgICAgICAgICAgIGdfbWF4X2V4cCA9IDE2OwotICAgICAgICAgICAgfQotCi0gICAgICAgICAgICAvKgotICAgICAgICAgICAgICogIENvbXB1dGUgQWRqdXN0ZWQgcG93ZXIgcF9hZGoKLSAgICAgICAgICAgICAqLwotICAgICAgICAgICAgZm9yIChrID0gbGltU2JjW2xpbWl0ZXJCYW5kXVtjXTsgayA8IGxpbVNiY1tsaW1pdGVyQmFuZF1bYyArIDFdOyBrKyspCi0gICAgICAgICAgICB7Ci0KLSAgICAgICAgICAgICAgICB0bXBfcTEgPSBnX21heF9leHAgPj0gbnJnX2dhaW5fZXhwW2tdID8gZ19tYXhfZXhwIDogbnJnX2dhaW5fZXhwW2tdOwotCi0gICAgICAgICAgICAgICAgdG1wX3EyID0gZ19tYXhfbWFuID4+ICh0bXBfcTEgLSBnX21heF9leHApOwotICAgICAgICAgICAgICAgIHRtcF9xMSA9IG5yZ19nYWluX21hbltrXSA+PiAodG1wX3ExIC0gbnJnX2dhaW5fZXhwW2tdKTsKLSAgICAgICAgICAgICAgICAvKgotICAgICAgICAgICAgICAgICAqICBpZihnX21heCA8PSBucmdfZ2FpbltrXSkKLSAgICAgICAgICAgICAgICAgKi8KLSAgICAgICAgICAgICAgICBpZiAodG1wX3EyIDw9IHRtcF9xMSkKLSAgICAgICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgICAgIHRtcF9xMSA9IGZ4cF9tdWwzMl9RMjgobm9pc2VfbGV2ZWxfbWFuW2tdLCBnX21heF9tYW4pOwotICAgICAgICAgICAgICAgICAgICBwdl9kaXYodG1wX3ExLCBucmdfZ2Fpbl9tYW5ba10sICZxdW90aWVudCk7Ci0gICAgICAgICAgICAgICAgICAgIG5vaXNlX2xldmVsX21hbltrXSA9IHF1b3RpZW50LnF1b3RpZW50ID4+IDI7ICAgLyogaW4gUTI4ICovCi0gICAgICAgICAgICAgICAgICAgIG5vaXNlX2xldmVsX2V4cFtrXSA9IG5vaXNlX2xldmVsX2V4cFtrXSArIGdfbWF4X2V4cCAtIHF1b3RpZW50LnNoaWZ0X2ZhY3RvciAtIG5yZ19nYWluX2V4cFtrXTsKLQotICAgICAgICAgICAgICAgICAgICBucmdfZ2Fpbl9tYW5ba10gPSAgZ19tYXhfbWFuOyAgICAgICAvKiBnYWlucyB3aXRoIG5vaXNlIHN1cHJlc3Npb24gKi8KLSAgICAgICAgICAgICAgICAgICAgbnJnX2dhaW5fZXhwW2tdID0gIGdfbWF4X2V4cDsKLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgIHBfYWRqX2V4cCA9IC0xMDA7Ci0KLSAgICAgICAgICAgIGZvciAoayA9IGxpbVNiY1tsaW1pdGVyQmFuZF1bY107IGsgPCBsaW1TYmNbbGltaXRlckJhbmRdW2MgKyAxXTsgaysrKQotICAgICAgICAgICAgewotICAgICAgICAgICAgICAgIHRtcF9xMSA9IG5yZ19lc3RfZXhwW2tdICsgKG5yZ19nYWluX2V4cFtrXSA8PCAxKSArIDI4OyAgLyogMjggdG8gbWF0Y2ggc2hpZnQgZG93biBieSBtdWx0MzJfUTI4ICAqLwotCi0gICAgICAgICAgICAgICAgaWYgKHBfYWRqX2V4cCA8IHRtcF9xMSkKLSAgICAgICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgICAgIHBfYWRqX2V4cCA9IHRtcF9xMTsKLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgaWYgKG5yZ190b25lX21hbltrXSkKLSAgICAgICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgICAgIHRtcF9xMSA9IChucmdfdG9uZV9leHBba10gPDwgMSk7Ci0gICAgICAgICAgICAgICAgICAgIGlmIChwX2Fkal9leHAgPCB0bXBfcTEpCi0gICAgICAgICAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAgICAgICAgIHBfYWRqX2V4cCA9IHRtcF9xMTsKLSAgICAgICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICBlbHNlIGlmICghbm9Ob2lzZUZsYWcpCi0gICAgICAgICAgICAgICAgewotICAgICAgICAgICAgICAgICAgICB0bXBfcTEgPSAobm9pc2VfbGV2ZWxfZXhwW2tdIDw8IDEpOwotCi0gICAgICAgICAgICAgICAgICAgIGlmIChwX2Fkal9leHAgPCB0bXBfcTEpCi0gICAgICAgICAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAgICAgICAgIHBfYWRqX2V4cCA9IHRtcF9xMTsKLSAgICAgICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgcF9hZGpfZXhwICs9IDE7IC8qIG92ZXJmbG93IGJpdC1ndWFyZCovCi0KLSAgICAgICAgICAgIHBfYWRqX21hbiA9IDA7Ci0KLSAgICAgICAgICAgIGZvciAoayA9IGxpbVNiY1tsaW1pdGVyQmFuZF1bY107IGsgPCBsaW1TYmNbbGltaXRlckJhbmRdW2MgKyAxXTsgaysrKQotICAgICAgICAgICAgewotICAgICAgICAgICAgICAgIC8qCi0gICAgICAgICAgICAgICAgICogIHBfYWRqICs9IG5yZ19nYWluW2tdKm5yZ19nYWluW2tdKm5yZ19lc3Rba107Ci0gICAgICAgICAgICAgICAgICovCi0KLSAgICAgICAgICAgICAgICBpZiAocF9hZGpfZXhwIC0gKG5yZ19lc3RfZXhwW2tdICsgKG5yZ19nYWluX2V4cFtrXSA8PCAxKSkgPCA1OSkKLSAgICAgICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgICAgIHRtcF9xMSA9IGZ4cF9tdWwzMl9RMjgobnJnX2dhaW5fbWFuW2tdLCBucmdfZ2Fpbl9tYW5ba10pOwotICAgICAgICAgICAgICAgICAgICB0bXBfcTEgPSBmeHBfbXVsMzJfUTI4KHRtcF9xMSwgbnJnX2VzdF9tYW5ba10pOwotICAgICAgICAgICAgICAgICAgICBwX2Fkal9tYW4gKz0gKHRtcF9xMSA+PiAocF9hZGpfZXhwIC0gKG5yZ19lc3RfZXhwW2tdICsgKG5yZ19nYWluX2V4cFtrXSA8PCAxKSArIDI4KSkpOwotICAgICAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgICAgIGlmIChucmdfdG9uZV9tYW5ba10pCi0gICAgICAgICAgICAgICAgewotICAgICAgICAgICAgICAgICAgICAvKgotICAgICAgICAgICAgICAgICAgICAgKiAgcF9hZGogKz0gbnJnX3RvbmVba10qbnJnX3RvbmVba107Ci0gICAgICAgICAgICAgICAgICAgICAqLwotICAgICAgICAgICAgICAgICAgICBpZiAocF9hZGpfZXhwIC0gKG5yZ190b25lX2V4cFtrXSA8PCAxKSA8IDMxKQotICAgICAgICAgICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgICAgICAgICB0bXBfcTEgPSBmeHBfbXVsMzJfUTI4KG5yZ190b25lX21hbltrXSwgbnJnX3RvbmVfbWFuW2tdKTsKLSAgICAgICAgICAgICAgICAgICAgICAgIHBfYWRqX21hbiArPSAodG1wX3ExID4+IChwX2Fkal9leHAgLSAobnJnX3RvbmVfZXhwW2tdIDw8IDEpKSk7Ci0gICAgICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgZWxzZSBpZiAoIW5vTm9pc2VGbGFnKQotICAgICAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAgICAgLyoKLSAgICAgICAgICAgICAgICAgICAgICogIHBfYWRqICs9IG5vaXNlX2xldmVsW2tdKm5vaXNlX2xldmVsW2tdOwotICAgICAgICAgICAgICAgICAgICAgKi8KLQotICAgICAgICAgICAgICAgICAgICBpZiAocF9hZGpfZXhwIC0gKG5vaXNlX2xldmVsX2V4cFtrXSA8PCAxKSA8IDMxKQotICAgICAgICAgICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgICAgICAgICB0bXBfcTEgPSBmeHBfbXVsMzJfUTI4KG5vaXNlX2xldmVsX21hbltrXSwgbm9pc2VfbGV2ZWxfbWFuW2tdKTsKLSAgICAgICAgICAgICAgICAgICAgICAgIHBfYWRqX21hbiArPSAodG1wX3ExID4+IChwX2Fkal9leHAgLSAobm9pc2VfbGV2ZWxfZXhwW2tdIDw8IDEpKSk7Ci0gICAgICAgICAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgIH0KLQotCi0gICAgICAgICAgICBpZiAocF9hZGpfbWFuKQotICAgICAgICAgICAgewotICAgICAgICAgICAgICAgIHB2X2RpdihwX3JlZl9tYW4sIHBfYWRqX21hbiwgJnF1b3RpZW50KTsKLSAgICAgICAgICAgICAgICB0bXBfcTIgPSBwX3JlZl9leHAgLSBwX2Fkal9leHAgLSA1OCAtIHF1b3RpZW50LnNoaWZ0X2ZhY3RvcjsgICAvKiAgNTggPD4gUTMwICsgUTI4ICovCi0KLSAgICAgICAgICAgICAgICBwdl9zcXJ0KHF1b3RpZW50LnF1b3RpZW50LCB0bXBfcTIsICZyb290X3NxLCBzcXJ0X2NhY2hlWzddKTsKLQotICAgICAgICAgICAgICAgIGlmIChyb290X3NxLnNoaWZ0X2ZhY3RvciA+IC0yOCkKLSAgICAgICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgICAgIGJvb3N0X2dhaW5fcSA9IHJvb3Rfc3Eucm9vdCA8PCAocm9vdF9zcS5zaGlmdF9mYWN0b3IgKyAyOCk7Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgIGVsc2UKLSAgICAgICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgICAgIGJvb3N0X2dhaW5fcSA9IHJvb3Rfc3Eucm9vdCA+PiAoLTI4IC0gcm9vdF9zcS5zaGlmdF9mYWN0b3IpOwotICAgICAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgICAgIHRtcF9xMSA9IHJvb3Rfc3Euc2hpZnRfZmFjdG9yID49IC0yOCA/IHJvb3Rfc3Euc2hpZnRfZmFjdG9yIDogLTI4OwotCi0gICAgICAgICAgICAgICAgdG1wX3EyID0gcm9vdF9zcS5yb290ID4+ICh0bXBfcTEgLSByb290X3NxLnNoaWZ0X2ZhY3Rvcik7Ci0gICAgICAgICAgICAgICAgdG1wX3ExID0gUTI4Zm10KDEuNTg0ODkzMTkyZikgPj4gKHRtcF9xMSArIDI4KTsKLQotCi0gICAgICAgICAgICAgICAgaWYgKHRtcF9xMiA+IHRtcF9xMSkKLSAgICAgICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgICAgIGJvb3N0X2dhaW5fcSA9IFEyOGZtdCgxLjU4NDg5MzE5MmYpOwotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgIH0KLSAgICAgICAgICAgIGVsc2UKLSAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICBib29zdF9nYWluX3EgPSBRMjhmbXQoMS41ODQ4OTMxOTJmKTsKLSAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgaWYgKGJhbmRfbnJnX3RvbmVfZGV0ZWN0b3IpCi0gICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgZm9yIChrID0gbGltU2JjW2xpbWl0ZXJCYW5kXVtjXTsgayA8IGxpbVNiY1tsaW1pdGVyQmFuZF1bYyArIDFdOyBrKyspCi0gICAgICAgICAgICAgICAgewotICAgICAgICAgICAgICAgICAgICBucmdfZ2Fpbl9tYW5ba10gICAgPSBmeHBfbXVsMzJfUTI4KG5yZ19nYWluX21hbltrXSwgYm9vc3RfZ2Fpbl9xKTsKLSAgICAgICAgICAgICAgICAgICAgbm9pc2VfbGV2ZWxfbWFuW2tdID0gZnhwX211bDMyX1EyOChub2lzZV9sZXZlbF9tYW5ba10sIGJvb3N0X2dhaW5fcSk7Ci0gICAgICAgICAgICAgICAgICAgIG5yZ190b25lX21hbltrXSAgICA9IGZ4cF9tdWwzMl9RMjgobnJnX3RvbmVfbWFuW2tdLCBib29zdF9nYWluX3EpOwotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgIH0KLSAgICAgICAgICAgIGVsc2UKLSAgICAgICAgICAgIHsKLQotICAgICAgICAgICAgICAgIGZvciAoayA9IGxpbVNiY1tsaW1pdGVyQmFuZF1bY107IGsgPCBsaW1TYmNbbGltaXRlckJhbmRdW2MgKyAxXTsgaysrKQotICAgICAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAgICAgbnJnX2dhaW5fbWFuW2tdICAgID0gZnhwX211bDMyX1EyOChucmdfZ2Fpbl9tYW5ba10sIGJvb3N0X2dhaW5fcSk7Ci0gICAgICAgICAgICAgICAgICAgIG5vaXNlX2xldmVsX21hbltrXSA9IGZ4cF9tdWwzMl9RMjgobm9pc2VfbGV2ZWxfbWFuW2tdLCBib29zdF9nYWluX3EpOwotICAgICAgICAgICAgICAgIH0KLQotCi0gICAgICAgICAgICB9Ci0KLSAgICAgICAgfSAgIC8qIExpbWl0ZXIgIEVuZCBmb3IgbG9vcCAoYykgKi8KLQotCi0gICAgICAgIGlmIChMQ19mbGFnID09IE9OKQotICAgICAgICB7Ci0KLSAgICAgICAgICAgIC8qCi0gICAgICAgICAgICAgKiAgICAgICAgICBBbGlhc2luZyBjb3JyZWN0aW9uCi0gICAgICAgICAgICAgKi8KLQotICAgICAgICAgICAgc2JyX2FsaWFzaW5nX3JlZHVjdGlvbihkZWdyZWVBbGlhcywKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbnJnX2dhaW5fbWFuLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBucmdfZ2Fpbl9leHAsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG5yZ19lc3RfbWFuLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBucmdfZXN0X2V4cCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZG9udFVzZVRoZXNlR2FpblZhbHVlcywKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbm9TdWJiYW5kcywKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbG93U3ViYmFuZCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc3FydF9jYWNoZSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2NyYXRjaF9tZW1bM10pOwotCi0gICAgICAgICAgICBpZiAoKnNVcCkgICAgIC8qIEluaXQgb25seSBkb25lIG9uY2UgdXBvbiByZXNldCAqLwotICAgICAgICAgICAgewotICAgICAgICAgICAgICAgICpzVXAgPSAwOwotICAgICAgICAgICAgfQotCi0gICAgICAgICAgICBlbnZlbG9wZV9hcHBsaWNhdGlvbl9MQygoSW50MzIgKilhQnVmUiwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG5yZ19nYWluX21hbiwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG5yZ19nYWluX2V4cCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG5vaXNlX2xldmVsX21hbiwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG5vaXNlX2xldmVsX2V4cCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG5yZ190b25lX21hbiwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG5yZ190b25lX2V4cCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJhbmRfbnJnX3RvbmVfZGV0ZWN0b3IsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBmcmFtZV9pbmZvLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaGFybV9pbmRleCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBoYXNlX2luZGV4LAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxvd1N1YmJhbmQsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBub1N1YmJhbmRzLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbm9Ob2lzZUZsYWcpOwotICAgICAgICB9Ci0jaWZkZWYgSFFfU0JSCi0gICAgICAgIGVsc2UKLSAgICAgICAgewotCi0gICAgICAgICAgICBpZiAoKnNVcCkgICAgIC8qIEluaXQgb25seSBkb25lIG9uY2UgdXBvbiByZXNldCAqLwotICAgICAgICAgICAgewotICAgICAgICAgICAgICAgIGZvciAobiA9IDA7IG4gPCBtYXhTbW9vdGhMZW5ndGg7IG4rKykKLSAgICAgICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgICAgIHB2X21lbWNweShmQnVmX21hbltuXSwgICAgIG5yZ19nYWluX21hbiwgbm9TdWJiYW5kcypzaXplb2YoKmZCdWZfbWFuW25dKSk7Ci0gICAgICAgICAgICAgICAgICAgIHB2X21lbWNweShmQnVmTl9tYW5bbl0sIG5vaXNlX2xldmVsX21hbiwgbm9TdWJiYW5kcypzaXplb2YoKmZCdWZOX21hbltuXSkpOwotICAgICAgICAgICAgICAgICAgICBwdl9tZW1jcHkoZkJ1Zl9leHBbbl0sICAgICBucmdfZ2Fpbl9leHAsIG5vU3ViYmFuZHMqc2l6ZW9mKCpmQnVmX2V4cFtuXSkpOwotICAgICAgICAgICAgICAgICAgICBwdl9tZW1jcHkoZkJ1Zk5fZXhwW25dLCBub2lzZV9sZXZlbF9leHAsIG5vU3ViYmFuZHMqc2l6ZW9mKCpmQnVmTl9leHBbbl0pKTsKLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgKnNVcCA9IDA7Ci0gICAgICAgICAgICB9Ci0KLQotICAgICAgICAgICAgZW52ZWxvcGVfYXBwbGljYXRpb24oKEludDMyICopYUJ1ZlIsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoSW50MzIgKilhQnVmSSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG5yZ19nYWluX21hbiwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG5yZ19nYWluX2V4cCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG5vaXNlX2xldmVsX21hbiwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG5vaXNlX2xldmVsX2V4cCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG5yZ190b25lX21hbiwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG5yZ190b25lX2V4cCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZCdWZfbWFuLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZkJ1Zl9leHAsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBmQnVmTl9tYW4sCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBmQnVmTl9leHAsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBmcmFtZV9pbmZvLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaGFybV9pbmRleCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBoYXNlX2luZGV4LAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxvd1N1YmJhbmQsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBub1N1YmJhbmRzLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbm9Ob2lzZUZsYWcsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBiYW5kX25yZ190b25lX2RldGVjdG9yLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbWF4U21vb3RoTGVuZ3RoLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc21vb3RoX2xlbmd0aCk7Ci0KLSAgICAgICAgfQotI2VuZGlmCi0KLSAgICB9ICAgLyogLS0tLS0gIEVudmVsb3BlIGFkanVzdG1lbnQgZW5kIGZvci1sb29wIChpKSAtLS0tICovCi0KLQotICAgIHB2X21lbWNweSgmaEZwWzBdICsgbG93U3ViYmFuZCwKLSAgICAgICAgICAgICAgaEYsCi0gICAgICAgICAgICAgICg2NCAtIGxvd1N1YmJhbmQpKnNpemVvZigqaEYpKTsKLQotICAgIGlmIChzRW52ID09IG5FbnYpCi0gICAgewotICAgICAgICBmcmFtZURhdGEtPnByZXZFbnZJc1Nob3J0ID0gMDsKLSAgICB9Ci0gICAgZWxzZQotICAgIHsKLSAgICAgICAgZnJhbWVEYXRhLT5wcmV2RW52SXNTaG9ydCA9IC0xOwotICAgIH0KLQotCi19Ci0KLQotCi0vKi0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0KLTsgRlVOQ1RJT04gQ09ERQotLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSovCi0KLXZvaWQgZW52ZWxvcGVfYXBwbGljYXRpb25fTEMoSW50MzIgICphQnVmUiwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgSW50MzIgICpucmdfZ2Fpbl9tYW4sCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgIEludDMyICAqbnJnX2dhaW5fZXhwLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICBJbnQzMiAgKm5vaXNlX2xldmVsX21hbiwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgSW50MzIgICpub2lzZV9sZXZlbF9leHAsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgIEludDMyICAqbnJnX3RvbmVfbWFuLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICBJbnQzMiAgKm5yZ190b25lX2V4cCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgSW50MzIgIGJhbmRfbnJnX3RvbmVfZGV0ZWN0b3IsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbnN0IEludDMyICpmcmFtZV9pbmZvLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICBJbnQzMiAgKmhhcm1faW5kZXgsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgIEludDMyICAqcGhhc2VfaW5kZXgsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgIEludDMyICBpLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICBJbnQzMiAgbG93U3ViYmFuZCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgSW50MzIgIG5vU3ViYmFuZHMsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgIEludDMyICBub05vaXNlRmxhZykKLXsKLQotICAgIEludDMyICpwdHJSZWFsOwotICAgIEludDMyIHNiX2dhaW5fbWFuOwotICAgIEludDMyIHNiX25vaXNlX21hbjsKLSAgICBJbnQzMiBzYl9ub2lzZV9leHA7Ci0gICAgSW50MzIgbDsKLSAgICBJbnQzMiBrOwotICAgIEludDMyIHRtcF9xMTsKLSAgICBJbnQzMiB0bXBfcTI7Ci0gICAgSW50MzIgdG9uZV9jb3VudDsKLSAgICBJbnQxNiB0bXBfMTY7Ci0gICAgSW50MzIgaW5kZXhNaW51czE7Ci0gICAgSW50MzIgaW5kZXhQbHVzMTsKLQotCi0gICAgLyoKLSAgICAgKiAgICAgICAgICBBcHBsaWNhdGlvbgotICAgICAqLwotCi0gICAgaWYgKGJhbmRfbnJnX3RvbmVfZGV0ZWN0b3IpICAgICAvKiBBZGQgdG9uZSBlbmVyZ3kgb25seSBpZiBlbmVyZ3kgaXMgZGV0ZWN0ZWQgICovCi0gICAgewotCi0gICAgICAgIC8qCi0gICAgICAgICAqICBwcmUtY2FsY3VsYXRlIHRvbmUgYXBwbGljYXRpb24KLSAgICAgICAgICovCi0gICAgICAgIGZvciAoayA9IDA7IGsgPCBub1N1YmJhbmRzOyBrKyspCi0gICAgICAgIHsKLSAgICAgICAgICAgIHRtcF9xMiA9ICgtbnJnX3RvbmVfZXhwW2tdKTsKLSAgICAgICAgICAgIHRtcF9xMSA9IG5yZ190b25lX21hbltrXTsKLSAgICAgICAgICAgIHRtcF9xMiA9IHRtcF9xMSA+PiB0bXBfcTI7Ci0gICAgICAgICAgICB0bXBfcTEgPSBmeHBfbXVsMzJfYnlfMTYodG1wX3EyLCBRMTVmbXQoMC4wMTYzZikpOwotICAgICAgICAgICAgbnJnX3RvbmVfbWFuW2tdID0gdG1wX3EyOwotICAgICAgICAgICAgbnJnX3RvbmVfZXhwW2tdID0gdG1wX3ExOwotICAgICAgICAgICAgbm9pc2VfbGV2ZWxfZXhwW2tdICs9IDE7Ci0gICAgICAgICAgICBucmdfZ2Fpbl9leHBba10gKz0gMjg7Ci0gICAgICAgIH0KLQotICAgICAgICBmb3IgKGwgPSAoZnJhbWVfaW5mb1sxK2ldIDw8IDEpOyBsIDwgKGZyYW1lX2luZm9bMitpXSA8PCAxKTsgbCsrKQotICAgICAgICB7Ci0gICAgICAgICAgICBwdHJSZWFsID0gKGFCdWZSICsgbCAqIFNCUl9OVU1fQkFORFMpOwotCi0gICAgICAgICAgICB0b25lX2NvdW50ID0gMDsKLQotICAgICAgICAgICAgaW5kZXhQbHVzMSAgPSAoKmhhcm1faW5kZXggKyAxKSAmIDM7Ci0KLSAgICAgICAgICAgIGlmIChpbmRleFBsdXMxICYgMSkgICAgLyogIGlmIGluZGV4UGx1czEgaXMgb2RkICovCi0gICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgZm9yIChrID0gMDsgayA8IG5vU3ViYmFuZHM7IGsrKykKLSAgICAgICAgICAgICAgICB7Ci0KLSAgICAgICAgICAgICAgICAgICAgc2JfZ2Fpbl9tYW4gPSBucmdfZ2Fpbl9tYW5ba107Ci0gICAgICAgICAgICAgICAgICAgIHRtcF9xMSA9ICpwdHJSZWFsOwotICAgICAgICAgICAgICAgICAgICB0bXBfcTIgPSBucmdfZ2Fpbl9leHBba107Ci0gICAgICAgICAgICAgICAgICAgIHRtcF9xMSA9IGZ4cF9tdWwzMl9RMjgodG1wX3ExLCBzYl9nYWluX21hbik7Ci0KLSAgICAgICAgICAgICAgICAgICAgaWYgKHRtcF9xMiA8IDApCi0gICAgICAgICAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAgICAgICAgIGlmICh0bXBfcTIgPiAtMzIpCi0gICAgICAgICAgICAgICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgKnB0clJlYWwgPSB0bXBfcTEgPj4gKC10bXBfcTIpOwotICAgICAgICAgICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgICAgIGVsc2UKLSAgICAgICAgICAgICAgICAgICAgewotICAgICAgICAgICAgICAgICAgICAgICAgKnB0clJlYWwgPSB0bXBfcTEgPDwgdG1wX3EyOwotICAgICAgICAgICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgICAgICAgICAgKnBoYXNlX2luZGV4ID0gKCpwaGFzZV9pbmRleCArIDEpICYgNTExOwotCi0gICAgICAgICAgICAgICAgICAgIGlmICghbnJnX3RvbmVfbWFuW2tdICYmICFub05vaXNlRmxhZykKLQotICAgICAgICAgICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgICAgICAgICB0bXBfMTYgPSByUF9MQ3hbKnBoYXNlX2luZGV4XTsKLSAgICAgICAgICAgICAgICAgICAgICAgIHNiX25vaXNlX21hbiA9IG5vaXNlX2xldmVsX21hbltrXTsKLSAgICAgICAgICAgICAgICAgICAgICAgIHNiX25vaXNlX2V4cCA9IG5vaXNlX2xldmVsX2V4cFtrXTsKLQotICAgICAgICAgICAgICAgICAgICAgICAgdG1wX3ExID0gZnhwX211bDMyX2J5XzE2KHNiX25vaXNlX21hbiwgdG1wXzE2KTsKLQotICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHNiX25vaXNlX2V4cCA8IDApCi0gICAgICAgICAgICAgICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHNiX25vaXNlX2V4cCA+IC0zMikKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICpwdHJSZWFsICs9IHRtcF9xMSA+PiAoLXNiX25vaXNlX2V4cCk7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgICAgICAgICAgZWxzZQotICAgICAgICAgICAgICAgICAgICAgICAgewotICAgICAgICAgICAgICAgICAgICAgICAgICAgICpwdHJSZWFsICs9IHRtcF9xMSA8PCBzYl9ub2lzZV9leHA7Ci0gICAgICAgICAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgICAgICAgICB0bXBfcTEgPSBucmdfdG9uZV9tYW5ba107Ci0KLSAgICAgICAgICAgICAgICAgICAgaWYgKCpoYXJtX2luZGV4KQotICAgICAgICAgICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgICAgICAgICAqcHRyUmVhbCAtPSB0bXBfcTE7Ci0gICAgICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICAgICAgZWxzZQotICAgICAgICAgICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgICAgICAgICAqcHRyUmVhbCArPSB0bXBfcTE7Ci0gICAgICAgICAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgICAgICAgICBpZiAodG1wX3ExKQotICAgICAgICAgICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgICAgICAgICB0b25lX2NvdW50Kys7Ci0gICAgICAgICAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgICAgICAgICBwdHJSZWFsKys7Ci0KLSAgICAgICAgICAgICAgICB9ICAgLyogIGZvci1sb29wIChrKSAqLwotCi0gICAgICAgICAgICB9Ci0gICAgICAgICAgICBlbHNlICAgICAgICAvKiAgaWYgaW5kZXhQbHVzMSBpcyBldmVuICovCi0gICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgaW5kZXhNaW51czEgPSAoKmhhcm1faW5kZXggLSAxKSAmIDM7Ci0KLSAgICAgICAgICAgICAgICAvKiAgLS0tICBrID0gMCAgLS0tLS0gKi8KLQotICAgICAgICAgICAgICAgIHNiX2dhaW5fbWFuID0gbnJnX2dhaW5fbWFuWzBdOwotICAgICAgICAgICAgICAgIHRtcF9xMSA9ICpwdHJSZWFsOwotICAgICAgICAgICAgICAgIHRtcF9xMiA9IG5yZ19nYWluX2V4cFswXTsKLSAgICAgICAgICAgICAgICB0bXBfcTEgPSBmeHBfbXVsMzJfUTI4KHRtcF9xMSwgc2JfZ2Fpbl9tYW4pOwotCi0gICAgICAgICAgICAgICAgaWYgKHRtcF9xMiA8IDApCi0gICAgICAgICAgICAgICAgewotICAgICAgICAgICAgICAgICAgICBpZiAodG1wX3EyID4gLTMyKQotICAgICAgICAgICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgICAgICAgICAqcHRyUmVhbCA9IHRtcF9xMSA+PiAoLXRtcF9xMik7Ci0gICAgICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgZWxzZQotICAgICAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAgICAgKnB0clJlYWwgPSB0bXBfcTEgPDwgdG1wX3EyOwotICAgICAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgICAgICpwaGFzZV9pbmRleCA9ICgqcGhhc2VfaW5kZXggKyAxKSAmIDUxMTsKLQotICAgICAgICAgICAgICAgIHRtcF9xMSA9IG5yZ190b25lX2V4cFswXTsKLSAgICAgICAgICAgICAgICB0bXBfcTIgPSBucmdfdG9uZV9leHBbMV07Ci0KLSAgICAgICAgICAgICAgICBpZiAoKGluZGV4UGx1czEgIT0gMCkgXigobG93U3ViYmFuZCAmIDEpICE9IDApKQotICAgICAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAgICAgKihwdHJSZWFsIC0gMSkgLT0gdG1wX3ExOwotICAgICAgICAgICAgICAgICAgICAqKHB0clJlYWwpICAgKz0gdG1wX3EyOwotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICBlbHNlCi0gICAgICAgICAgICAgICAgewotICAgICAgICAgICAgICAgICAgICAqKHB0clJlYWwgLSAxKSArPSB0bXBfcTE7Ci0gICAgICAgICAgICAgICAgICAgICoocHRyUmVhbCkgICAtPSB0bXBfcTI7Ci0gICAgICAgICAgICAgICAgfQotCi0gICAgICAgICAgICAgICAgaWYgKCFucmdfdG9uZV9tYW5bMF0gJiYgIW5vTm9pc2VGbGFnKQotICAgICAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAgICAgdG1wXzE2ID0gclBfTEN4WypwaGFzZV9pbmRleF07Ci0gICAgICAgICAgICAgICAgICAgIHNiX25vaXNlX21hbiA9IG5vaXNlX2xldmVsX21hblswXTsKLSAgICAgICAgICAgICAgICAgICAgc2Jfbm9pc2VfZXhwID0gbm9pc2VfbGV2ZWxfZXhwWzBdOwotCi0gICAgICAgICAgICAgICAgICAgIHRtcF9xMSA9IGZ4cF9tdWwzMl9ieV8xNihzYl9ub2lzZV9tYW4sIHRtcF8xNik7Ci0KLSAgICAgICAgICAgICAgICAgICAgaWYgKHNiX25vaXNlX2V4cCA8IDApCi0gICAgICAgICAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAgICAgICAgIGlmIChzYl9ub2lzZV9leHAgPiAtMzIpCi0gICAgICAgICAgICAgICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgKnB0clJlYWwgKz0gdG1wX3ExID4+ICgtc2Jfbm9pc2VfZXhwKTsKLSAgICAgICAgICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgICAgICBlbHNlCi0gICAgICAgICAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAgICAgICAgICpwdHJSZWFsICs9IHRtcF9xMSA8PCBzYl9ub2lzZV9leHA7Ci0gICAgICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgZWxzZQotICAgICAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAgICAgdG9uZV9jb3VudCsrOwotICAgICAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgICAgIHB0clJlYWwrKzsKLQotICAgICAgICAgICAgICAgIC8qIC0tLS0gICovCi0KLSAgICAgICAgICAgICAgICBmb3IgKGsgPSAxOyBrIDwgbm9TdWJiYW5kcyAtIDE7IGsrKykKLSAgICAgICAgICAgICAgICB7Ci0KLSAgICAgICAgICAgICAgICAgICAgc2JfZ2Fpbl9tYW4gPSBucmdfZ2Fpbl9tYW5ba107Ci0gICAgICAgICAgICAgICAgICAgIHRtcF9xMSA9ICpwdHJSZWFsOwotICAgICAgICAgICAgICAgICAgICB0bXBfcTIgPSBucmdfZ2Fpbl9leHBba107Ci0gICAgICAgICAgICAgICAgICAgIHRtcF9xMSA9IGZ4cF9tdWwzMl9RMjgodG1wX3ExLCBzYl9nYWluX21hbik7Ci0KLSAgICAgICAgICAgICAgICAgICAgaWYgKHRtcF9xMiA8IDApCi0gICAgICAgICAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAgICAgICAgIGlmICh0bXBfcTIgPiAtMzIpCi0gICAgICAgICAgICAgICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgKnB0clJlYWwgPSB0bXBfcTEgPj4gKC10bXBfcTIpOwotICAgICAgICAgICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgICAgIGVsc2UKLSAgICAgICAgICAgICAgICAgICAgewotICAgICAgICAgICAgICAgICAgICAgICAgKnB0clJlYWwgPSB0bXBfcTEgPDwgdG1wX3EyOwotICAgICAgICAgICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgICAgICAgICAgKnBoYXNlX2luZGV4ID0gKCpwaGFzZV9pbmRleCArIDEpICYgNTExOwotCi0KLSAgICAgICAgICAgICAgICAgICAgaWYgKHRvbmVfY291bnQgPCAxNikKLSAgICAgICAgICAgICAgICAgICAgewotICAgICAgICAgICAgICAgICAgICAgICAgdG1wX3ExID0gbnJnX3RvbmVfZXhwW2sgLSAxXTsKLSAgICAgICAgICAgICAgICAgICAgICAgIHRtcF9xMiA9IG5yZ190b25lX2V4cFtrICsgMV07Ci0KLSAgICAgICAgICAgICAgICAgICAgICAgIHRtcF9xMSAtPSB0bXBfcTI7Ci0KLQotICAgICAgICAgICAgICAgICAgICAgICAgaWYgKChpbmRleFBsdXMxICE9IDApIF4oKChrICsgbG93U3ViYmFuZCkgJiAxKSAhPSAwKSkKLSAgICAgICAgICAgICAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAqKHB0clJlYWwpIC09IHRtcF9xMTsKLSAgICAgICAgICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICAgICAgICAgIGVsc2UKLSAgICAgICAgICAgICAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAqKHB0clJlYWwpICs9IHRtcF9xMTsKLSAgICAgICAgICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICAgICAgfSAgIC8qICAgaWYgKHRvbmVfY291bnQgPCAxNikgICovCi0KLQotICAgICAgICAgICAgICAgICAgICBpZiAoIW5yZ190b25lX21hbltrXSAmJiAhbm9Ob2lzZUZsYWcpCi0gICAgICAgICAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAgICAgICAgIHRtcF8xNiA9IHJQX0xDeFsqcGhhc2VfaW5kZXhdOwotICAgICAgICAgICAgICAgICAgICAgICAgc2Jfbm9pc2VfbWFuID0gbm9pc2VfbGV2ZWxfbWFuW2tdOwotICAgICAgICAgICAgICAgICAgICAgICAgc2Jfbm9pc2VfZXhwID0gbm9pc2VfbGV2ZWxfZXhwW2tdOwotCi0gICAgICAgICAgICAgICAgICAgICAgICB0bXBfcTEgPSBmeHBfbXVsMzJfYnlfMTYoc2Jfbm9pc2VfbWFuLCB0bXBfMTYpOwotCi0gICAgICAgICAgICAgICAgICAgICAgICBpZiAoc2Jfbm9pc2VfZXhwIDwgMCkKLSAgICAgICAgICAgICAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoc2Jfbm9pc2VfZXhwID4gLTMyKQotICAgICAgICAgICAgICAgICAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKnB0clJlYWwgKz0gdG1wX3ExID4+ICgtc2Jfbm9pc2VfZXhwKTsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgICAgICAgICBlbHNlCi0gICAgICAgICAgICAgICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgKnB0clJlYWwgKz0gdG1wX3ExIDw8IHNiX25vaXNlX2V4cDsKLSAgICAgICAgICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgICAgICBlbHNlCi0gICAgICAgICAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAgICAgICAgIHRvbmVfY291bnQrKzsKLSAgICAgICAgICAgICAgICAgICAgfQotCi0gICAgICAgICAgICAgICAgICAgIHB0clJlYWwrKzsKLQotICAgICAgICAgICAgICAgIH0gICAvKiAgZm9yLWxvb3AgKGspICovCi0KLSAgICAgICAgICAgICAgICBzYl9nYWluX21hbiA9IG5yZ19nYWluX21hbltrXTsKLSAgICAgICAgICAgICAgICB0bXBfcTEgPSAqcHRyUmVhbDsKLSAgICAgICAgICAgICAgICB0bXBfcTIgPSBucmdfZ2Fpbl9leHBba107Ci0gICAgICAgICAgICAgICAgdG1wX3ExID0gZnhwX211bDMyX1EyOCh0bXBfcTEsIHNiX2dhaW5fbWFuKTsKLQotICAgICAgICAgICAgICAgIGlmICh0bXBfcTIgPCAwKQotICAgICAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAgICAgaWYgKHRtcF9xMiA+IC0zMSkKLSAgICAgICAgICAgICAgICAgICAgewotICAgICAgICAgICAgICAgICAgICAgICAgKnB0clJlYWwgPSB0bXBfcTEgPj4gKC10bXBfcTIpOwotICAgICAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgIGVsc2UKLSAgICAgICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgICAgICpwdHJSZWFsID0gdG1wX3ExIDw8IHRtcF9xMjsKLSAgICAgICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgICAgICAqcGhhc2VfaW5kZXggPSAoKnBoYXNlX2luZGV4ICsgMSkgJiA1MTE7Ci0KLQotICAgICAgICAgICAgICAgIGlmICgodG9uZV9jb3VudCA8IDE2KSAmJiAhKGluZGV4TWludXMxICYxKSkKLSAgICAgICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgICAgIHRtcF9xMSA9IG5yZ190b25lX2V4cFtrIC0gMV07Ci0gICAgICAgICAgICAgICAgICAgIHRtcF9xMiA9IG5yZ190b25lX2V4cFtrICAgIF07Ci0KLSAgICAgICAgICAgICAgICAgICAgaWYgKChpbmRleE1pbnVzMSAhPSAwKSBeKCgoayArIGxvd1N1YmJhbmQpICYgMSkgIT0gMCkpCi0gICAgICAgICAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAgICAgICAgICoocHRyUmVhbCkgICArPSB0bXBfcTE7Ci0KLSAgICAgICAgICAgICAgICAgICAgICAgIGlmIChrICsgbG93U3ViYmFuZCA8IDYyKQotICAgICAgICAgICAgICAgICAgICAgICAgewotICAgICAgICAgICAgICAgICAgICAgICAgICAgICoocHRyUmVhbCArIDEpIC09IHRtcF9xMjsKLSAgICAgICAgICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgICAgICBlbHNlCi0gICAgICAgICAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAgICAgICAgICoocHRyUmVhbCkgICAtPSB0bXBfcTE7Ci0KLSAgICAgICAgICAgICAgICAgICAgICAgIGlmIChrICsgbG93U3ViYmFuZCA8IDYyKQotICAgICAgICAgICAgICAgICAgICAgICAgewotICAgICAgICAgICAgICAgICAgICAgICAgICAgICoocHRyUmVhbCArIDEpICs9IHRtcF9xMjsKLSAgICAgICAgICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgIH0gICAvKiAgIGlmICh0b25lX2NvdW50IDwgMTYpICAqLwotCi0KLSAgICAgICAgICAgICAgICBpZiAoIW5yZ190b25lX21hbltrXSAmJiAhbm9Ob2lzZUZsYWcpCi0gICAgICAgICAgICAgICAgewotICAgICAgICAgICAgICAgICAgICB0bXBfMTYgPSByUF9MQ3hbKnBoYXNlX2luZGV4XTsKLSAgICAgICAgICAgICAgICAgICAgc2Jfbm9pc2VfbWFuID0gbm9pc2VfbGV2ZWxfbWFuW2tdOwotICAgICAgICAgICAgICAgICAgICBzYl9ub2lzZV9leHAgPSBub2lzZV9sZXZlbF9leHBba107Ci0KLSAgICAgICAgICAgICAgICAgICAgdG1wX3ExID0gZnhwX211bDMyX2J5XzE2KHNiX25vaXNlX21hbiwgdG1wXzE2KTsKLQotICAgICAgICAgICAgICAgICAgICBpZiAoc2Jfbm9pc2VfZXhwIDwgMCkKLSAgICAgICAgICAgICAgICAgICAgewotICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHNiX25vaXNlX2V4cCA+IC0zMSkKLSAgICAgICAgICAgICAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAqcHRyUmVhbCArPSB0bXBfcTEgPj4gKC1zYl9ub2lzZV9leHApOwotICAgICAgICAgICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgICAgIGVsc2UKLSAgICAgICAgICAgICAgICAgICAgewotICAgICAgICAgICAgICAgICAgICAgICAgKnB0clJlYWwgKz0gdG1wX3ExIDw8IHNiX25vaXNlX2V4cDsKLSAgICAgICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgfSAgIC8qICBpZiBpbmRleFBsdXMxIGlzIG9kZCAqLwotCi0gICAgICAgICAgICAqaGFybV9pbmRleCA9IGluZGV4UGx1czE7Ci0KLQotICAgICAgICB9ICAgICAgICAvKiAgZm9yLWxvb3AgKGwpICovCi0KLSAgICB9Ci0gICAgZWxzZSAgICAgICAgLyogICBpZiAoIGJhbmRfbnJnX3RvbmVfZGV0ZWN0b3IpICAgKi8KLSAgICB7Ci0KLSAgICAgICAgZm9yIChrID0gMDsgayA8IG5vU3ViYmFuZHM7IGsrKykKLSAgICAgICAgewotICAgICAgICAgICAgdG1wX3ExID0gbm9pc2VfbGV2ZWxfZXhwW2tdOwotICAgICAgICAgICAgdG1wX3EyID0gbnJnX2dhaW5fZXhwW2tdOwotICAgICAgICAgICAgbm9pc2VfbGV2ZWxfZXhwW2tdID0gIHRtcF9xMSArIDE7Ci0gICAgICAgICAgICBucmdfZ2Fpbl9leHBba10gPSB0bXBfcTIgKyAyODsKLSAgICAgICAgfQotCi0gICAgICAgIGZvciAobCA9IChmcmFtZV9pbmZvWzEraV0gPDwgMSk7IGwgPCAoZnJhbWVfaW5mb1syK2ldIDw8IDEpOyBsKyspCi0gICAgICAgIHsKLSAgICAgICAgICAgIHB0clJlYWwgPSAoYUJ1ZlIgKyBsICogU0JSX05VTV9CQU5EUyk7Ci0KLSAgICAgICAgICAgIGZvciAoayA9IDA7IGsgPCBub1N1YmJhbmRzOyBrKyspCi0gICAgICAgICAgICB7Ci0KLSAgICAgICAgICAgICAgICB0bXBfcTEgPSAqcHRyUmVhbDsKLSAgICAgICAgICAgICAgICBzYl9nYWluX21hbiA9IG5yZ19nYWluX21hbltrXTsKLQotICAgICAgICAgICAgICAgIHRtcF9xMiA9IG5yZ19nYWluX2V4cFtrXTsKLQotICAgICAgICAgICAgICAgIHRtcF9xMSA9IGZ4cF9tdWwzMl9RMjgodG1wX3ExLCBzYl9nYWluX21hbik7Ci0KLSAgICAgICAgICAgICAgICBpZiAodG1wX3EyIDwgMCkKLSAgICAgICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgICAgIGlmICh0bXBfcTIgPiAtMzEpCi0gICAgICAgICAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAgICAgICAgICpwdHJSZWFsID0gdG1wX3ExID4+ICgtdG1wX3EyKTsKLSAgICAgICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICBlbHNlCi0gICAgICAgICAgICAgICAgewotICAgICAgICAgICAgICAgICAgICAqcHRyUmVhbCA9IHRtcF9xMSA8PCB0bXBfcTI7Ci0gICAgICAgICAgICAgICAgfQotCi0gICAgICAgICAgICAgICAgKnBoYXNlX2luZGV4ID0gKCpwaGFzZV9pbmRleCArIDEpICYgNTExOwotCi0gICAgICAgICAgICAgICAgaWYgKCEgbm9Ob2lzZUZsYWcpCi0gICAgICAgICAgICAgICAgewotICAgICAgICAgICAgICAgICAgICB0bXBfMTYgPSByUF9MQ3hbKnBoYXNlX2luZGV4XTsKLSAgICAgICAgICAgICAgICAgICAgc2Jfbm9pc2VfbWFuID0gbm9pc2VfbGV2ZWxfbWFuW2tdOwotICAgICAgICAgICAgICAgICAgICBzYl9ub2lzZV9leHAgPSBub2lzZV9sZXZlbF9leHBba107Ci0KLSAgICAgICAgICAgICAgICAgICAgdG1wX3ExID0gZnhwX211bDMyX2J5XzE2KHNiX25vaXNlX21hbiwgdG1wXzE2KTsKLQotICAgICAgICAgICAgICAgICAgICBpZiAoc2Jfbm9pc2VfZXhwIDwgMCkKLSAgICAgICAgICAgICAgICAgICAgewotICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHNiX25vaXNlX2V4cCA+IC0zMSkKLSAgICAgICAgICAgICAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAqcHRyUmVhbCArPSB0bXBfcTEgPj4gKC1zYl9ub2lzZV9leHApOwotICAgICAgICAgICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgICAgIGVsc2UKLSAgICAgICAgICAgICAgICAgICAgewotICAgICAgICAgICAgICAgICAgICAgICAgKnB0clJlYWwgKz0gdG1wX3ExIDw8IHNiX25vaXNlX2V4cDsKLSAgICAgICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgICAgIHB0clJlYWwrKzsKLQotICAgICAgICAgICAgfSAgIC8qICBmb3ItbG9vcCAoaykgKi8KLQotICAgICAgICAgICAgKmhhcm1faW5kZXggID0gKCpoYXJtX2luZGV4ICsgMSkgJiAzOwotCi0KLSAgICAgICAgfSAgIC8qICBmb3ItbG9vcCAobCkgKi8KLQotICAgIH0KLQotfQotCi0KLQotLyotLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tCi07IEZVTkNUSU9OIENPREUKLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0qLwotCi0KLSNkZWZpbmUgUWZtdDE1KGEpICAgKEludDMyKShhKigoSW50MzIpMTw8MTUpICsgKGE+PTA/MC41RjotMC41RikpCi0KLQotY29uc3QgSW50MTYgcG93MlszOV0gPSB7IDAsIDAsIDEsIDAsIDIsCi0gICAgICAgICAgICAgICAgICAgICAgICAgMCwgUWZtdDE1KDIgLyA2LjBmKSwgMCwgMywgMCwgUWZtdDE1KDIgLyAxMC4wZiksIDAsIFFmbXQxNSgyIC8gMTIuMGYpLCAwLCBRZm10MTUoMiAvIDE0LjBmKSwgMCwgNCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAwLCBRZm10MTUoMiAvIDE4LjBmKSwgICAgMCwgUWZtdDE1KDIgLyAyMC4wZiksIDAsIFFmbXQxNSgyIC8gMjIuMGYpLCAwLCBRZm10MTUoMiAvIDI0LjBmKSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAwLCBRZm10MTUoMiAvIDI2LjBmKSwgMCwgUWZtdDE1KDIgLyAyOC4wZiksIDAsIFFmbXQxNSgyIC8gMzAuMGYpLCAwLCA1LCAwLCBRZm10MTUoMiAvIDM0LjBmKSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAwLCBRZm10MTUoMiAvIDM2LjBmKSwgMCwgUWZtdDE1KDIgLyAzOC4wZikKLSAgICAgICAgICAgICAgICAgICAgICAgfTsKLQotdm9pZCBlbmVyZ3lfZXN0aW1hdGlvbl9MQyhJbnQzMiAqYUJ1ZlIsCi0gICAgICAgICAgICAgICAgICAgICAgICAgIEludDMyICpucmdfZXN0X21hbiwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgSW50MzIgKm5yZ19lc3RfZXhwLAotICAgICAgICAgICAgICAgICAgICAgICAgICBjb25zdCBJbnQzMiAqZnJhbWVfaW5mbywKLSAgICAgICAgICAgICAgICAgICAgICAgICAgSW50MzIgaSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgSW50MzIgaywKLSAgICAgICAgICAgICAgICAgICAgICAgICAgSW50MzIgYywKLSAgICAgICAgICAgICAgICAgICAgICAgICAgSW50MzIgdWkyKQotewotCi0KLSAgICBJbnQzMiAgYXV4MTsKLSAgICBJbnQzMiAgYXV4MjsKLSAgICBJbnQzMiAgbDsKLQotCi0gICAgaW50NjRfdCBucmdfaCA9IDA7Ci0gICAgSW50MzIgdG1wMTsKLSAgICBVSW50MzIgdG1wMjsKLQotICAgIGZvciAobCA9IHVpMjsgbCA8IChmcmFtZV9pbmZvWzIraV0gPDwgMSk7IGwrKykKLSAgICB7Ci0KLSAgICAgICAgYXV4MSA9IGFCdWZSW2wrKypTQlJfTlVNX0JBTkRTICsgayBdOwotICAgICAgICBhdXgyID0gYUJ1ZlJbbCAgKlNCUl9OVU1fQkFORFMgKyBrIF07Ci0KLSAgICAgICAgbnJnX2ggPSBmeHBfbWFjNjRfUTMxKG5yZ19oLCBhdXgxLCBhdXgxKTsKLSAgICAgICAgbnJnX2ggPSBmeHBfbWFjNjRfUTMxKG5yZ19oLCBhdXgyLCBhdXgyKTsKLSAgICB9Ci0KLSAgICAvKgotICAgICAqICBDaGVjayBmb3Igb3ZlcmZsb3cgYW5kIHNhdHVyYXRlIGlmIG5lZWRlZAotICAgICAqLwotICAgIGlmIChucmdfaCA8IDApCi0gICAgewotICAgICAgICBucmdfaCA9IDB4N2ZmZmZmZmY7Ci0gICAgfQotCi0KLSAgICBpZiAobnJnX2gpCi0gICAgewotICAgICAgICB0bXAyID0gKFVJbnQzMikobnJnX2ggPj4gMzIpOwotICAgICAgICBpZiAodG1wMikKLSAgICAgICAgewotICAgICAgICAgICAgYXV4MiA9IHB2X25vcm1hbGl6ZSh0bXAyKTsKLSAgICAgICAgICAgIGF1eDIgLT0gMTsgICAgICAgICAgICAgICAgICAvKiAgZW5zdXJlIFEzMCAqLwotICAgICAgICAgICAgbnJnX2ggPSAobnJnX2ggPDwgYXV4MikgPj4gMzM7Ci0gICAgICAgICAgICB0bXAyID0gKFVJbnQzMikobnJnX2gpOwotICAgICAgICAgICAgbnJnX2VzdF9leHBbY10gPSAzMyAtIGF1eDI7Ci0gICAgICAgIH0KLSAgICAgICAgZWxzZQotICAgICAgICB7Ci0gICAgICAgICAgICB0bXAyID0gKFVJbnQzMikobnJnX2ggPj4gMik7Ci0gICAgICAgICAgICBhdXgyID0gcHZfbm9ybWFsaXplKHRtcDIpOwotICAgICAgICAgICAgYXV4MiAtPSAxOyAgICAgICAgICAgICAgICAgIC8qICBlbnN1cmUgUTMwICovCi0KLSAgICAgICAgICAgIHRtcDIgPSAodG1wMiA8PCBhdXgyKTsKLSAgICAgICAgICAgIG5yZ19lc3RfZXhwW2NdID0gIC1hdXgyICsgMjsKLSAgICAgICAgfQotCi0gICAgICAgIHRtcDEgPSAobCAtIHVpMik7Ci0KLSAgICAgICAgYXV4MiA9IHBvdzJbdG1wMV07Ci0gICAgICAgIGlmICh0bXAxID09ICh0bXAxICYgKC10bXAxKSkpCi0gICAgICAgIHsKLSAgICAgICAgICAgIG5yZ19lc3RfbWFuW2NdID0gdG1wMiA+PiBhdXgyOwotICAgICAgICB9Ci0gICAgICAgIGVsc2UKLSAgICAgICAgewotICAgICAgICAgICAgbnJnX2VzdF9tYW5bY10gPSBmeHBfbXVsMzJfYnlfMTYodG1wMiwgYXV4Mik7Ci0gICAgICAgIH0KLQotICAgIH0KLSAgICBlbHNlCi0gICAgewotICAgICAgICBucmdfZXN0X21hbltjXSA9IDA7Ci0gICAgICAgIG5yZ19lc3RfZXhwW2NdID0gLTEwMDsKLSAgICB9Ci0KLQotCi0KLQotfQotCi0KLQotCi0KLQotI2lmIEhRX1NCUgotCi0vKi0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0KLTsgRlVOQ1RJT04gQ09ERQotLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSovCi0KLXZvaWQgZW52ZWxvcGVfYXBwbGljYXRpb24oSW50MzIgICphQnVmUiwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgSW50MzIgICphQnVmSSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgSW50MzIgICpucmdfZ2Fpbl9tYW4sCi0gICAgICAgICAgICAgICAgICAgICAgICAgIEludDMyICAqbnJnX2dhaW5fZXhwLAotICAgICAgICAgICAgICAgICAgICAgICAgICBJbnQzMiAgKm5vaXNlX2xldmVsX21hbiwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgSW50MzIgICpub2lzZV9sZXZlbF9leHAsCi0gICAgICAgICAgICAgICAgICAgICAgICAgIEludDMyICAqbnJnX3RvbmVfbWFuLAotICAgICAgICAgICAgICAgICAgICAgICAgICBJbnQzMiAgKm5yZ190b25lX2V4cCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgSW50MzIgICpmQnVmX21hbls2NF0sCi0gICAgICAgICAgICAgICAgICAgICAgICAgIEludDMyICAqZkJ1Zl9leHBbNjRdLAotICAgICAgICAgICAgICAgICAgICAgICAgICBJbnQzMiAgKmZCdWZOX21hbls2NF0sCi0gICAgICAgICAgICAgICAgICAgICAgICAgIEludDMyICAqZkJ1Zk5fZXhwWzY0XSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgY29uc3QgIEludDMyICpmcmFtZV9pbmZvLAotICAgICAgICAgICAgICAgICAgICAgICAgICBJbnQzMiAgKmhhcm1faW5kZXgsCi0gICAgICAgICAgICAgICAgICAgICAgICAgIEludDMyICAqcGhhc2VfaW5kZXgsCi0gICAgICAgICAgICAgICAgICAgICAgICAgIEludDMyICBpLAotICAgICAgICAgICAgICAgICAgICAgICAgICBJbnQzMiAgbG93U3ViYmFuZCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgSW50MzIgIG5vU3ViYmFuZHMsCi0gICAgICAgICAgICAgICAgICAgICAgICAgIEludDMyICBub05vaXNlRmxhZywKLSAgICAgICAgICAgICAgICAgICAgICAgICAgSW50MzIgIGJhbmRfbnJnX3RvbmVfZGV0ZWN0b3IsCi0gICAgICAgICAgICAgICAgICAgICAgICAgIEludDMyICBtYXhTbW9vdGhMZW5ndGgsCi0gICAgICAgICAgICAgICAgICAgICAgICAgIEludDMyICBzbW9vdGhfbGVuZ3RoKQotewotCi0gICAgSW50MzIgKnB0clJlYWw7Ci0gICAgSW50MzIgKnB0ckltYWc7Ci0gICAgSW50MzIgc2JfZ2Fpbl9tYW47Ci0gICAgSW50MzIgc2JfZ2Fpbl9leHA7Ci0gICAgSW50MzIgc2Jfbm9pc2VfbWFuOwotICAgIEludDMyIHNiX25vaXNlX2V4cDsKLSAgICBJbnQzMiBsOwotICAgIEludDMyIGs7Ci0gICAgSW50MzIgbjsKLSAgICBJbnQzMiB0bXBfcTE7Ci0gICAgSW50MzIgdG1wX3EyOwotICAgIEludDMyICBhdXgxOwotICAgIEludDMyICBhdXgyOwotICAgIEludDMyICBmaWx0ZXJfaGlzdG9yeSA9IDA7Ci0KLQotICAgIGlmIChiYW5kX25yZ190b25lX2RldGVjdG9yKSAgICAgLyogQWRkIHRvbmUgZW5lcmd5IG9ubHkgaWYgZW5lcmd5IGlzIGRldGVjdGVkICAqLwotICAgIHsKLQotICAgICAgICAvKgotICAgICAgICAgKiAgcHJlLWNhbGN1bGF0ZSB0b25lIGFwcGxpY2F0aW9uCi0gICAgICAgICAqLwotCi0gICAgICAgIHB0clJlYWwgPSBucmdfdG9uZV9leHA7Ci0gICAgICAgIHB0ckltYWcgPSBucmdfdG9uZV9tYW47Ci0gICAgICAgIHRtcF9xMSA9IC0gKihwdHJSZWFsKyspOwotICAgICAgICBhdXgxICAgPSAgICoocHRySW1hZyk7Ci0gICAgICAgIGZvciAoayA9IDA7IGsgPCBub1N1YmJhbmRzOyBrKyspCi0gICAgICAgIHsKLSAgICAgICAgICAgICoocHRySW1hZysrKSA9IGF1eDEgPj4gdG1wX3ExOwotICAgICAgICAgICAgdG1wX3ExID0gLSAqKHB0clJlYWwrKyk7Ci0gICAgICAgICAgICBhdXgxICAgPSAgICoocHRySW1hZyk7Ci0gICAgICAgIH0KLQotICAgICAgICAvKgotICAgICAgICAgKiAgICAgICAgICBBcHBsaWNhdGlvbgotICAgICAgICAgKi8KLQotICAgICAgICBmb3IgKGwgPSAoZnJhbWVfaW5mb1sxK2ldIDw8IDEpOyBsIDwgKGZyYW1lX2luZm9bMitpXSA8PCAxKTsgbCsrKQotICAgICAgICB7Ci0gIC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wgbm9TdWJiYW5kczsgaysrKQotICAgICAgICAgICAgewotICAgICAgICAgICAgICAgIGlmIChzbW9vdGhfbGVuZ3RoID09IDApICAgICAvKiBubyBmaWx0ZXItc21vb3RoIG5lZWRlZCAqLwotICAgICAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAgICAgc2JfZ2Fpbl9tYW4gPSBucmdfZ2Fpbl9tYW5ba107Ci0gICAgICAgICAgICAgICAgICAgIHNiX2dhaW5fZXhwID0gbnJnX2dhaW5fZXhwW2tdOwotCi0gICAgICAgICAgICAgICAgICAgIHNiX25vaXNlX21hbiA9IG5vaXNlX2xldmVsX21hbltrXTsKLSAgICAgICAgICAgICAgICAgICAgc2Jfbm9pc2VfZXhwID0gbm9pc2VfbGV2ZWxfZXhwW2tdOwotCi0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgIGVsc2UKLSAgICAgICAgICAgICAgICB7ICAgLyogZWxzZSAgc21vb3RoX2xlbmd0aCA9PSA0ICBhbmQgZmlyXzQgZmlsdGVyIGlzIGJlaW5nIHVzZWQgKi8KLQotICAgICAgICAgICAgICAgICAgICBzYl9nYWluX2V4cCA9IGZCdWZfZXhwW21heFNtb290aExlbmd0aF1ba107Ci0KLSAgICAgICAgICAgICAgICAgICAgc2Jfbm9pc2VfZXhwID0gZkJ1Zk5fZXhwW21heFNtb290aExlbmd0aF1ba107Ci0KLSAgICAgICAgICAgICAgICAgICAgZm9yIChuID0gbWF4U21vb3RoTGVuZ3RoIC0gc21vb3RoX2xlbmd0aDsgbiA8IG1heFNtb290aExlbmd0aDsgbisrKQotICAgICAgICAgICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgICAgICAgICBpZiAoc2JfZ2Fpbl9leHAgIDwgZkJ1Zl9leHBbbl1ba10pCi0gICAgICAgICAgICAgICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgc2JfZ2Fpbl9leHAgPSBmQnVmX2V4cFtuXVtrXTsKLSAgICAgICAgICAgICAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHNiX25vaXNlX2V4cCAgPCBmQnVmTl9leHBbbl1ba10pCi0gICAgICAgICAgICAgICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgc2Jfbm9pc2VfZXhwID0gZkJ1Zk5fZXhwW25dW2tdOwotICAgICAgICAgICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgICAgICAgICAgc2JfZ2Fpbl9tYW4gPSBmeHBfbXVsMzJfUTMwKGZCdWZfbWFuW21heFNtb290aExlbmd0aF1ba10sIFEzMGZtdCgwLjMzMzMzMzMzMzMzMzMzZikpOwotICAgICAgICAgICAgICAgICAgICBzYl9nYWluX21hbiAgPSBzYl9nYWluX21hbiA+PiAoc2JfZ2Fpbl9leHAgLSBmQnVmX2V4cFttYXhTbW9vdGhMZW5ndGhdW2tdKTsKLQotICAgICAgICAgICAgICAgICAgICBzYl9ub2lzZV9tYW4gPSBmeHBfbXVsMzJfUTMwKGZCdWZOX21hblttYXhTbW9vdGhMZW5ndGhdW2tdLCBRMzBmbXQoMC4zMzMzMzMzMzMzMzMzM2YpKTsKLSAgICAgICAgICAgICAgICAgICAgc2Jfbm9pc2VfbWFuID0gc2Jfbm9pc2VfbWFuID4+IChzYl9ub2lzZV9leHAgLSBmQnVmTl9leHBbbWF4U21vb3RoTGVuZ3RoXVtrXSk7Ci0KLSAgICAgICAgICAgICAgICAgICAgbiA9IG1heFNtb290aExlbmd0aCAtIHNtb290aF9sZW5ndGg7Ci0KLSAgICAgICAgICAgICAgICAgICAgdG1wX3ExID0gZnhwX211bDMyX1EzMChmQnVmX21hbltuXVtrXSwgUTMwZm10KDAuMDMxODMwNTAwOTM3NTFmKSk7Ci0gICAgICAgICAgICAgICAgICAgIHNiX2dhaW5fbWFuICArPSB0bXBfcTEgPj4gKHNiX2dhaW5fZXhwIC0gZkJ1Zl9leHB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IChzYl9ub2lzZV9leHAgLSBmQnVmTl9leHBbbisrXVtrXSk7Ci0KLSAgICAgICAgICAgICAgICAgICAgdG1wX3ExID0gZnhwX211bDMyX1EzMChmQnVmX21hbltuXVtrXSwgUTMwZm10KDAuMzAxNTAyODMyMzk1ODJmKSk7Ci0gICAgICAgICAgICAgICAgICAgIHNiX2dhaW5fbWFuICArPSB0bXBfcTEgPj4gKHNiX2dhaW5fZXhwIC0gZkJ1Zl9leHBbbl1ba10pOwotCi0gICAgICAgICAgICAgICAgICAgIHRtcF9xMSA9IGZ4cF9tdWwzMl9RMzAoZkJ1Zk5fbWFuW25dW2tdLCBRMzBmbXQoMC4zMDE1MDI4MzIzOTU4MmYpKTsKLSAgICAgICAgICAgICAgICAgICAgc2Jfbm9pc2VfbWFuICs9IHRtcF9xMSA+PiAoc2Jfbm9pc2VfZXhwIC0gZkJ1Zk5fZXhwW25dW2tdKTsKLQotICAgICAgICAgICAgICAgIH0KLQotCi0KLSAgICAgICAgICAgICAgICAvKgotICAgICAgICAgICAgICAgICAqICAgICpwdHJSZWFsICA9ICpwdHJSZWFsICogc2JfZ2FpbiA7Ci0gICAgICAgICAgICAgICAgICogICAgKnB0ckltYWcgID0gKnB0ckltYWcgKiBzYl9nYWluOwotICAgICAgICAgICAgICAgICAqLwotICAgICAgICAgICAgICAgIGF1eDEgPSAqcHRyUmVhbDsKLSAgICAgICAgICAgICAgICBhdXgyID0gKnB0ckltYWc7Ci0gICAgICAgICAgICAgICAgc2JfZ2Fpbl9leHAgKz0gMzI7Ci0gICAgICAgICAgICAgICAgYXV4MSA9IGZ4cF9tdWwzMl9RMzEoYXV4MSwgc2JfZ2Fpbl9tYW4pOwotICAgICAgICAgICAgICAgIGF1eDIgPSBmeHBfbXVsMzJfUTMxKGF1eDIsIHNiX2dhaW5fbWFuKTsKLQotCi0gICAgICAgICAgICAgICAgaWYgKHNiX2dhaW5fZXhwIDwgMCkKLSAgICAgICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgICAgIHNiX2dhaW5fZXhwID0gLXNiX2dhaW5fZXhwOwotICAgICAgICAgICAgICAgICAgICBpZiAoc2JfZ2Fpbl9leHAgPCAzMikKLSAgICAgICAgICAgICAgICAgICAgewotICAgICAgICAgICAgICAgICAgICAgICAgKnB0clJlYWwgPSAoYXV4MSA+PiBzYl9nYWluX2V4cCk7Ci0gICAgICAgICAgICAgICAgICAgICAgICAqcHRySW1hZyA9IChhdXgyID4+IHNiX2dhaW5fZXhwKTsKLSAgICAgICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICBlbHNlCi0gICAgICAgICAgICAgICAgewotICAgICAgICAgICAgICAgICAgICAqcHRyUmVhbCA9IChhdXgxIDw8IHNiX2dhaW5fZXhwKTsKLSAgICAgICAgICAgICAgICAgICAgKnB0ckltYWcgPSAoYXV4MiA8PCBzYl9nYWluX2V4cCk7Ci0gICAgICAgICAgICAgICAgfQotCi0KLQotICAgICAgICAgICAgICAgIC8qCi0gICAgICAgICAgICAgICAgICogICAgIGlmICggc2Jfbm9pc2UgIT0gMCkKLSAgICAgICAgICAgICAgICAgKiAgICAgewotICAgICAgICAgICAgICAgICAqICAgICAgICAgKnB0clJlYWwgKz0gc2Jfbm9pc2UgKiByUFsqcGhhc2VfaW5kZXhdWzBdOwotICAgICAgICAgICAgICAgICAqICAgICAgICAgKnB0ckltYWcgKz0gc2Jfbm9pc2UgKiByUFsqcGhhc2VfaW5kZXhdWzFdOwotICAgICAgICAgICAgICAgICAqICAgICB9Ci0gICAgICAgICAgICAgICAgICovCi0gICAgICAgICAgICAgICAgKnBoYXNlX2luZGV4ID0gKCpwaGFzZV9pbmRleCArIDEpICYgNTExOwotCi0gICAgICAgICAgICAgICAgaWYgKG5yZ190b25lX21hbltrXSB8fCBub05vaXNlRmxhZykKLSAgICAgICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgICAgIHNiX25vaXNlX21hbiA9IDA7Ci0gICAgICAgICAgICAgICAgICAgIHNiX25vaXNlX2V4cCA9IDA7Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgIGVsc2UKLSAgICAgICAgICAgICAgICB7Ci0KLSAgICAgICAgICAgICAgICAgICAgSW50MzIgdG1wID0gclB4eFsqcGhhc2VfaW5kZXhdOwotICAgICAgICAgICAgICAgICAgICBzYl9ub2lzZV9leHAgKz0gMTsKLSAgICAgICAgICAgICAgICAgICAgdG1wX3ExID0gZnhwX211bDMyX2J5XzE2dChzYl9ub2lzZV9tYW4sIHRtcCk7Ci0gICAgICAgICAgICAgICAgICAgIHRtcF9xMiA9IGZ4cF9tdWwzMl9ieV8xNmIoc2Jfbm9pc2VfbWFuLCB0bXApOwotCi0KLSAgICAgICAgICAgICAgICAgICAgaWYgKHNiX25vaXNlX2V4cCA8IDApCi0gICAgICAgICAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAgICAgICAgIGlmIChzYl9ub2lzZV9leHAgPiAtMzIpCi0gICAgICAgICAgICAgICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgKnB0clJlYWwgKz0gdG1wX3ExID4+ICgtc2Jfbm9pc2VfZXhwKTsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAqcHRySW1hZyArPSB0bXBfcTIgPj4gKC1zYl9ub2lzZV9leHApOwotICAgICAgICAgICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgICAgIGVsc2UKLSAgICAgICAgICAgICAgICAgICAgewotICAgICAgICAgICAgICAgICAgICAgICAgKnB0clJlYWwgKz0gdG1wX3ExIDw8IHNiX25vaXNlX2V4cDsKLSAgICAgICAgICAgICAgICAgICAgICAgICpwdHJJbWFnICs9IHRtcF9xMiA8PCBzYl9ub2lzZV9leHA7Ci0gICAgICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgICAgICAvKgotICAgICAgICAgICAgICAgICAqICAgICAgdG1wX3ExID0gbnJnX3RvbmVba10KLSAgICAgICAgICAgICAgICAgKi8KLQotICAgICAgICAgICAgICAgIHRtcF9xMSA9IG5yZ190b25lX21hbltrXTsKLQotICAgICAgICAgICAgICAgIGlmICgqaGFybV9pbmRleCAmIDEpCi0gICAgICAgICAgICAgICAgewotICAgICAgICAgICAgICAgICAgICBpZiAoKCgoayArIGxvd1N1YmJhbmQpICYgMSkgIT0gMCkgXigqaGFybV9pbmRleCAhPSAxKSkKLSAgICAgICAgICAgICAgICAgICAgewotICAgICAgICAgICAgICAgICAgICAgICAgKnB0ckltYWcgIC09ICB0bXBfcTE7Ci0gICAgICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICAgICAgZWxzZQotICAgICAgICAgICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgICAgICAgICAqcHRySW1hZyAgKz0gIHRtcF9xMTsKLSAgICAgICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICBlbHNlCi0gICAgICAgICAgICAgICAgewotICAgICAgICAgICAgICAgICAgICAqcHRyUmVhbCArPSAoKmhhcm1faW5kZXgpID8gLXRtcF9xMSA6IHRtcF9xMTsKLSAgICAgICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgICAgICAqcHRyUmVhbCsrIDw8PSAxMDsKLSAgICAgICAgICAgICAgICAqcHRySW1hZysrIDw8PSAxMDsKLQotCi0gICAgICAgICAgICB9ICAgIC8qICBmb3ItbG9vcCAoaykgKi8KLQotCi0gICAgICAgICAgICAqaGFybV9pbmRleCA9ICgqaGFybV9pbmRleCArIDEpICYgMzsKLQotICAgICAgICAgICAgLyoKLSAgICAgICAgICAgICAqICBVcGRhdGUgc21vb3RoaW5nIGZpbHRlciBoaXN0b3J5Ci0gICAgICAgICAgICAgKi8KLQotICAgICAgICAgICAgaWYgKGZpbHRlcl9oaXN0b3J5KysgPCBtYXhTbW9vdGhMZW5ndGgpICAgICAvKiBubyBtb3JlIHVwZGF0ZSBpcyBuZWVkZWQgYXMgYnVmZmVyIHdpbGwgaGF2ZSBzYW1lIGluZm8gKi8KLSAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAvKgotICAgICAgICAgICAgICAgICAqICBtYW50aXNzYXMKLSAgICAgICAgICAgICAgICAgKi8KLQotICAgICAgICAgICAgICAgIHB0clJlYWwgPSAoSW50MzIgKilmQnVmX21hblswXTsKLSAgICAgICAgICAgICAgICBwdHJJbWFnID0gKEludDMyICopZkJ1Zk5fbWFuWzBdOwotCi0gICAgICAgICAgICAgICAgZm9yIChuID0gMDsgbiA8IG1heFNtb290aExlbmd0aDsgbisrKQotICAgICAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAgICAgZkJ1Zl9tYW5bbl0gID0gZkJ1Zl9tYW5bbisxXTsKLSAgICAgICAgICAgICAgICAgICAgZkJ1Zk5fbWFuW25dID0gZkJ1Zk5fbWFuW24rMV07Ci0gICAgICAgICAgICAgICAgfQotCi0gICAgICAgICAgICAgICAgZkJ1Zl9tYW5bbWF4U21vb3RoTGVuZ3RoXSAgPSBwdHJSZWFsOwotICAgICAgICAgICAgICAgIGZCdWZOX21hblttYXhTbW9vdGhMZW5ndGhdID0gcHRySW1hZzsKLQotICAgICAgICAgICAgICAgIC8qCi0gICAgICAgICAgICAgICAgICogIGV4cG9uZW50cwotICAgICAgICAgICAgICAgICAqLwotICAgICAgICAgICAgICAgIHB0clJlYWwgPSAoSW50MzIgKilmQnVmX2V4cFswXTsKLSAgICAgICAgICAgICAgICBwdHJJbWFnID0gKEludDMyICopZkJ1Zk5fZXhwWzBdOwotCi0gICAgICAgICAgICAgICAgZm9yIChuID0gMDsgbiA8IG1heFNtb290aExlbmd0aDsgbisrKQotICAgICAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAgICAgZkJ1Zl9leHBbbl0gID0gZkJ1Zl9leHBbbisxXTsKLSAgICAgICAgICAgICAgICAgICAgZkJ1Zk5fZXhwW25dID0gZkJ1Zk5fZXhwW24rMV07Ci0gICAgICAgICAgICAgICAgfQotCi0gICAgICAgICAgICAgICAgZkJ1Zl9leHBbbWF4U21vb3RoTGVuZ3RoXSAgPSBwdHJSZWFsOwotICAgICAgICAgICAgICAgIGZCdWZOX2V4cFttYXhTbW9vdGhMZW5ndGhdID0gcHRySW1hZzsKLSAgICAgICAgICAgIH0KLQotICAgICAgICB9ICAgLyogIGZvci1sb29wIChsKSAqLwotCi0KLSAgICB9Ci0gICAgZWxzZSAgICAgICAgLyogICAtLS0tICBpZiAoIGJhbmRfbnJnX3RvbmVfZGV0ZWN0b3IpIC0tLS0gKi8KLSAgICB7Ci0KLSAgICAgICAgLyoKLSAgICAgICAgICogICAgICAgICAgQXBwbGljYXRpb24KLSAgICAgICAgICovCi0KLSAgICAgICAgZm9yIChsID0gKGZyYW1lX2luZm9bMStpXSA8PCAxKTsgbCA8IChmcmFtZV9pbmZvWzIraV0gPDwgMSk7IGwrKykKLSAgICAgICAgewotICAgICAgICAgICAgcHRyUmVhbCA9IChhQnVmUiArIGwgKiBTQlJfTlVNX0JBTkRTKTsKLSAgICAgICAgICAgIHB0ckltYWcgPSAoYUJ1ZkkgKyBsICogU0JSX05VTV9CQU5EUyk7Ci0KLSAgICAgICAgICAgIGlmIChmaWx0ZXJfaGlzdG9yeSA8PSBtYXhTbW9vdGhMZW5ndGgpICAgICAvKiBubyBtb3JlIHVwZGF0ZSBpcyBuZWVkZWQgYXMgYnVmZmVyIHdpbGwgaGF2ZSBzYW1lIGluZm8gKi8KLSAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICBwdl9tZW1tb3ZlKGZCdWZfbWFuW21heFNtb290aExlbmd0aF0sIG5yZ19nYWluX21hbiwgbm9TdWJiYW5kcypzaXplb2YoKm5yZ19nYWluX21hbikpOwotICAgICAgICAgICAgICAgIHB2X21lbW1vdmUoZkJ1Zl9leHBbbWF4U21vb3RoTGVuZ3RoXSwgbnJnX2dhaW5fZXhwLCBub1N1YmJhbmRzKnNpemVvZigqbnJnX2dhaW5fZXhwKSk7Ci0gICAgICAgICAgICAgICAgcHZfbWVtbW92ZShmQnVmTl9tYW5bbWF4U21vb3RoTGVuZ3RoXSwgbm9pc2VfbGV2ZWxfbWFuLCBub1N1YmJhbmRzKnNpemVvZigqbm9pc2VfbGV2ZWxfbWFuKSk7Ci0gICAgICAgICAgICAgICAgcHZfbWVtbW92ZShmQnVmTl9leHBbbWF4U21vb3RoTGVuZ3RoXSwgbm9pc2VfbGV2ZWxfZXhwLCBub1N1YmJhbmRzKnNpemVvZigqbm9pc2VfbGV2ZWxfZXhwKSk7Ci0gICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgIC8qCi0gICAgICAgICAgICAgKiAgbnJnX2dhaW5fbWF4IGJvdW5kZWQgdG8gMS41ODQ4OTMxOTIqMWU1LCB3aGljaCByZXF1aXJlcyAoMzItYml0KSBRMTQgbm90YXRpb24KLSAgICAgICAgICAgICAqLwotICAgICAgICAgICAgZm9yIChrID0gMDsgayA8IG5vU3ViYmFuZHM7IGsrKykKLSAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICBpZiAoc21vb3RoX2xlbmd0aCA9PSAwKSAgICAgLyogbm8gZmlsdGVyLXNtb290aCBuZWVkZWQgKi8KLSAgICAgICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgICAgIHNiX2dhaW5fbWFuID0gbnJnX2dhaW5fbWFuW2tdOwotICAgICAgICAgICAgICAgICAgICBzYl9nYWluX2V4cCA9IG5yZ19nYWluX2V4cFtrXTsKLQotICAgICAgICAgICAgICAgICAgICBzYl9ub2lzZV9tYW4gPSBub2lzZV9sZXZlbF9tYW5ba107Ci0gICAgICAgICAgICAgICAgICAgIHNiX25vaXNlX2V4cCA9IG5vaXNlX2xldmVsX2V4cFtrXTsKLQotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICBlbHNlCi0gICAgICAgICAgICAgICAgeyAgIC8qIGVsc2UgIHNtb290aF9sZW5ndGggPT0gNCAgYW5kIGZpcl80IGZpbHRlciBpcyBiZWluZyB1c2VkICovCi0KLSAgICAgICAgICAgICAgICAgICAgc2JfZ2Fpbl9leHAgPSBmQnVmX2V4cFttYXhTbW9vdGhMZW5ndGhdW2tdOwotCi0gICAgICAgICAgICAgICAgICAgIHNiX25vaXNlX2V4cCA9IGZCdWZOX2V4cFttYXhTbW9vdGhMZW5ndGhdW2tdOwotCi0gICAgICAgICAgICAgICAgICAgIGZvciAobiA9IG1heFNtb290aExlbmd0aCAtIHNtb290aF9sZW5ndGg7IG4gPCBtYXhTbW9vdGhMZW5ndGg7IG4rKykKLSAgICAgICAgICAgICAgICAgICAgewotICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHNiX2dhaW5fZXhwICA8IGZCdWZfZXhwW25dW2tdKQotICAgICAgICAgICAgICAgICAgICAgICAgewotICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNiX2dhaW5fZXhwID0gZkJ1Zl9leHBbbl1ba107Ci0gICAgICAgICAgICAgICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgICAgICAgICAgICAgIGlmIChzYl9ub2lzZV9leHAgIDwgZkJ1Zk5fZXhwW25dW2tdKQotICAgICAgICAgICAgICAgICAgICAgICAgewotICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNiX25vaXNlX2V4cCA9IGZCdWZOX2V4cFtuXVtrXTsKLSAgICAgICAgICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICAgICAgfQotCi0gICAgICAgICAgICAgICAgICAgIHNiX2dhaW5fbWFuID0gZnhwX211bDMyX1EzMChmQnVmX21hblttYXhTbW9vdGhMZW5ndGhdW2tdLCBRMzBmbXQoMC4zMzMzMzMzMzMzMzMzM2YpKTsKLSAgICAgICAgICAgICAgICAgICAgc2JfZ2Fpbl9tYW4gID0gc2JfZ2Fpbl9tYW4gPj4gKHNiX2dhaW5fZXhwIC0gZkJ1Zl9leHBbbWF4U21vb3RoTGVuZ3RoXVtrXSk7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ICAgICAgICAgICAgLyoKLSAgICAgICAgICAgICAgICAgKiAgICAqcHRyUmVhbCAgPSAqcHRyUmVhbCAqIHNiX2dhaW4gOwotICAgICAgICAgICAgICAgICAqICAgICpwdHJJbWFnICA9ICpwdHJJbWFnICogc2JfZ2FpbjsKLSAgICAgICAgICAgICAgICAgKi8KLSAgICAgICAgICAgICAgICBhdXgxID0gKnB0clJlYWw7Ci0gICAgICAgICAgICAgICAgYXV4MiA9ICpwdHJJbWFnOwotICAgICAgICAgICAgICAgIHNiX2dhaW5fZXhwICs9IDMyOwotICAgICAgICAgICAgICAgIGF1eDEgPSBmeHBfbXVsMzJfUTMxKGF1eDEsIHNiX2dhaW5fbWFuKTsKLSAgICAgICAgICAgICAgICBhdXgyID0gZnhwX211bDMyX1EzMShhdXgyLCBzYl9nYWluX21hbik7Ci0KLQotCi0gICAgICAgICAgICAgICAgLyoKLSAgICAgICAgICAgICAgICAgKiAgICAgaWYgKCBzYl9ub2lzZSAhPSAwKQotICAgICAgICAgICAgICAgICAqICAgICB7Ci0gICAgICAgICAgICAgICAgICogICAgICAgICAqcHRyUmVhbCArPSBzYl9ub2lzZSAqIHJQWypwaGFzZV9pbmRleF1bMF07Ci0gICAgICAgICAgICAgICAgICogICAgICAgICAqcHRySW1hZyArPSBzYl9ub2lzZSAqIHJQWypwaGFzZV9pbmRleF1bMV07Ci0gICAgICAgICAgICAgICAgICogICAgIH0KLSAgICAgICAgICAgICAgICAgKi8KLQotCi0gICAgICAgICAgICAgICAgaWYgKHNiX2dhaW5fZXhwIDwgMCkKLSAgICAgICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgICAgIGlmIChzYl9nYWluX2V4cCA+IC0zMikKLSAgICAgICAgICAgICAgICAgICAgewotICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHNiX2dhaW5fZXhwID4gLTEwKQotICAgICAgICAgICAgICAgICAgICAgICAgewotICAgICAgICAgICAgICAgICAgICAgICAgICAgICpwdHJSZWFsID0gYXV4MSA8PCAoMTAgKyBzYl9nYWluX2V4cCk7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgKnB0ckltYWcgPSBhdXgyIDw8ICgxMCArIHNiX2dhaW5fZXhwKTsKLSAgICAgICAgICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICAgICAgICAgIGVsc2UKLSAgICAgICAgICAgICAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAqcHRyUmVhbCA9IGF1eDEgPj4gKC1zYl9nYWluX2V4cCAtIDEwKTsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAqcHRySW1hZyA9IGF1eDIgPj4gKC1zYl9nYWluX2V4cCAtIDEwKTsKLSAgICAgICAgICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICBlbHNlCi0gICAgICAgICAgICAgICAgewotICAgICAgICAgICAgICAgICAgICAqcHRyUmVhbCA9IGF1eDEgPDwgKHNiX2dhaW5fZXhwICsgMTApOwotICAgICAgICAgICAgICAgICAgICAqcHRySW1hZyA9IGF1eDIgPDwgKHNiX2dhaW5fZXhwICsgMTApOwotICAgICAgICAgICAgICAgIH0KLQotCi0KLQotICAgICAgICAgICAgICAgIC8qCi0gICAgICAgICAgICAgICAgICogICAgIGlmICggc2Jfbm9pc2UgIT0gMCkKLSAgICAgICAgICAgICAgICAgKiAgICAgewotICAgICAgICAgICAgICAgICAqICAgICAgICAgKnB0clJlYWwgKz0gc2Jfbm9pc2UgKiByUFsqcGhhc2VfaW5kZXhdWzBdOwotICAgICAgICAgICAgICAgICAqICAgICAgICAgKnB0ckltYWcgKz0gc2Jfbm9pc2UgKiByUFsqcGhhc2VfaW5kZXhdWzFdOwotICAgICAgICAgICAgICAgICAqICAgICB9Ci0gICAgICAgICAgICAgICAgICovCi0gICAgICAgICAgICAgICAgKnBoYXNlX2luZGV4ID0gKCpwaGFzZV9pbmRleCArIDEpICYgNTExOwotCi0gICAgICAgICAgICAgICAgaWYgKCFub05vaXNlRmxhZykKLSAgICAgICAgICAgICAgICB7Ci0KLSAgICAgICAgICAgICAgICAgICAgSW50MzIgdG1wID0gclB4eFsqcGhhc2VfaW5kZXhdOwotICAgICAgICAgICAgICAgICAgICBzYl9ub2lzZV9leHAgKz0gMTsKLSAgICAgICAgICAgICAgICAgICAgdG1wX3ExID0gZnhwX211bDMyX2J5XzE2dChzYl9ub2lzZV9tYW4sIHRtcCk7Ci0gICAgICAgICAgICAgICAgICAgIHRtcF9xMiA9IGZ4cF9tdWwzMl9ieV8xNmIoc2Jfbm9pc2VfbWFuLCB0bXApOwotCi0gICAgICAgICAgICAgICAgICAgIGlmIChzYl9ub2lzZV9leHAgPCAwKQotICAgICAgICAgICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgICAgICAgICBpZiAoc2Jfbm9pc2VfZXhwID4gLTMyKQotICAgICAgICAgICAgICAgICAgICAgICAgewotICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChzYl9ub2lzZV9leHAgPiAtMTApCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgewotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqcHRyUmVhbCArPSB0bXBfcTEgPDwgKDEwICsgc2Jfbm9pc2VfZXhwKTsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKnB0ckltYWcgKz0gdG1wX3EyIDw8ICgxMCArIHNiX25vaXNlX2V4cCk7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgICAgICAgICAgICAgIGVsc2UKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICpwdHJSZWFsICs9IHRtcF9xMSA+PiAoLXNiX25vaXNlX2V4cCAtIDEwKTsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKnB0ckltYWcgKz0gdG1wX3EyID4+ICgtc2Jfbm9pc2VfZXhwIC0gMTApOwotICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgICAgICBlbHNlCi0gICAgICAgICAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAgICAgICAgICpwdHJSZWFsICs9IHRtcF9xMSA8PCAoc2Jfbm9pc2VfZXhwICsgMTApOwotICAgICAgICAgICAgICAgICAgICAgICAgKnB0ckltYWcgKz0gdG1wX3EyIDw8IChzYl9ub2lzZV9leHAgKyAxMCk7Ci0gICAgICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgICAgICBwdHJSZWFsKys7Ci0gICAgICAgICAgICAgICAgcHRySW1hZysrOwotCi0KLSAgICAgICAgICAgIH0gICAgLyogIGZvci1sb29wIChrKSAqLwotCi0KLSAgICAgICAgICAgICpoYXJtX2luZGV4ID0gKCpoYXJtX2luZGV4ICsgMSkgJiAzOwotCi0gICAgICAgICAgICAvKgotICAgICAgICAgICAgICogIFVwZGF0ZSBzbW9vdGhpbmcgZmlsdGVyIGhpc3RvcnkKLSAgICAgICAgICAgICAqLwotCi0gICAgICAgICAgICBpZiAoZmlsdGVyX2hpc3RvcnkrKyA8IG1heFNtb290aExlbmd0aCkgICAgIC8qIG5vIG1vcmUgdXBkYXRlIGlzIG5lZWRlZCBhcyBidWZmZXIgd2lsbCBoYXZlIHNhbWUgaW5mbyAqLwotICAgICAgICAgICAgewotICAgICAgICAgICAgICAgIC8qCi0gICAgICAgICAgICAgICAgICogIG1hbnRpc3NhcwotICAgICAgICAgICAgICAgICAqLwotCi0gICAgICAgICAgICAgICAgcHRyUmVhbCA9IChJbnQzMiAqKWZCdWZfbWFuWzBdOwotICAgICAgICAgICAgICAgIHB0ckltYWcgPSAoSW50MzIgKilmQnVmTl9tYW5bMF07Ci0KLSAgICAgICAgICAgICAgICBmb3IgKG4gPSAwOyBuIDwgbWF4U21vb3RoTGVuZ3RoOyBuKyspCi0gICAgICAgICAgICAgICAgewotICAgICAgICAgICAgICAgICAgICBmQnVmX21hbltuXSAgPSBmQnVmX21hbltuKzFdOwotICAgICAgICAgICAgICAgICAgICBmQnVmTl9tYW5bbl0gPSBmQnVmTl9tYW5bbisxXTsKLSAgICAgICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgICAgICBmQnVmX21hblttYXhTbW9vdGhMZW5ndGhdICA9IHB0clJlYWw7Ci0gICAgICAgICAgICAgICAgZkJ1Zk5fbWFuW21heFNtb290aExlbmd0aF0gPSBwdHJJbWFnOwotCi0gICAgICAgICAgICAgICAgLyoKLSAgICAgICAgICAgICAgICAgKiAgZXhwb25lbnRzCi0gICAgICAgICAgICAgICAgICovCi0gICAgICAgICAgICAgICAgcHRyUmVhbCA9IChJbnQzMiAqKWZCdWZfZXhwWzBdOwotICAgICAgICAgICAgICAgIHB0ckltYWcgPSAoSW50MzIgKilmQnVmTl9leHBbMF07Ci0KLSAgICAgICAgICAgICAgICBmb3IgKG4gPSAwOyBuIDwgbWF4U21vb3RoTGVuZ3RoOyBuKyspCi0gICAgICAgICAgICAgICAgewotICAgICAgICAgICAgICAgICAgICBmQnVmX2V4cFtuXSAgPSBmQnVmX2V4cFtuKzFdOwotICAgICAgICAgICAgICAgICAgICBmQnVmTl9leHBbbl0gPSBmQnVmTl9leHBbbisxXTsKLSAgICAgICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgICAgICBmQnVmX2V4cFttYXhTbW9vdGhMZW5ndGhdICA9IHB0clJlYWw7Ci0gICAgICAgICAgICAgICAgZkJ1Zk5fZXhwW21heFNtb290aExlbmd0aF0gPSBwdHJJbWFnOwotICAgICAgICAgICAgfQotCi0gICAgICAgIH0gICAvKiAgZm9yLWxvb3AgKGwpICovCi0KLSAgICB9ICAgICAgIC8qICBpZiAoIGJhbmRfbnJnX3RvbmVfZGV0ZWN0b3IpICovCi0KLX0KLQotCi0vKi0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0KLTsgRlVOQ1RJT04gQ09ERQotLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSovCi0KLXZvaWQgZW5lcmd5X2VzdGltYXRpb24oSW50MzIgKmFCdWZSLAotICAgICAgICAgICAgICAgICAgICAgICBJbnQzMiAqYUJ1ZkksCi0gICAgICAgICAgICAgICAgICAgICAgIEludDMyICpucmdfZXN0X21hbiwKLSAgICAgICAgICAgICAgICAgICAgICAgSW50MzIgKm5yZ19lc3RfZXhwLAotICAgICAgICAgICAgICAgICAgICAgICBjb25zdCBJbnQzMiAqZnJhbWVfaW5mbywKLSAgICAgICAgICAgICAgICAgICAgICAgSW50MzIgaSwKLSAgICAgICAgICAgICAgICAgICAgICAgSW50MzIgaywKLSAgICAgICAgICAgICAgICAgICAgICAgSW50MzIgYywKLSAgICAgICAgICAgICAgICAgICAgICAgSW50MzIgdWkyKQotewotCi0gICAgSW50MzIgIGF1eDE7Ci0gICAgSW50MzIgIGF1eDI7Ci0gICAgSW50MzIgIGw7Ci0KLQotCi0gICAgaW50NjRfdCBucmdfaCA9IDA7Ci0gICAgSW50MzIgdG1wMTsKLSAgICBJbnQzMiB0bXAyOwotCi0gICAgYXV4MSA9IGFCdWZSW3VpMipTQlJfTlVNX0JBTkRTICsga107Ci0gICAgYXV4MiA9IGFCdWZJW3VpMipTQlJfTlVNX0JBTkRTICsga107Ci0gICAgZm9yIChsID0gdWkyICsgMTsgbCA8IChmcmFtZV9pbmZvWzIraV0gPDwgMSk7ICBsKyspCi0gICAgewotICAgICAgICBucmdfaCA9IGZ4cF9tYWM2NF9RMzEobnJnX2gsIGF1eDEsIGF1eDEpOwotICAgICAgICBucmdfaCA9IGZ4cF9tYWM2NF9RMzEobnJnX2gsIGF1eDIsIGF1eDIpOwotICAgICAgICBhdXgxID0gYUJ1ZlJbbCpTQlJfTlVNX0JBTkRTICsga107Ci0gICAgICAgIGF1eDIgPSBhQnVmSVtsKlNCUl9OVU1fQkFORFMgKyBrXTsKLSAgICB9Ci0gICAgbnJnX2ggPSBmeHBfbWFjNjRfUTMxKG5yZ19oLCBhdXgxLCBhdXgxKTsKLSAgICBucmdfaCA9IGZ4cF9tYWM2NF9RMzEobnJnX2gsIGF1eDIsIGF1eDIpOwotCi0KLSAgICAvKgotICAgICAqICBDaGVjayBmb3Igb3ZlcmZsb3cgYW5kIHNhdHVyYXRlIGlmIG5lZWRlZAotICAgICAqLwotICAgIGlmIChucmdfaCA8IDApCi0gICAgewotICAgICAgICBucmdfaCA9IDB4N2ZmZmZmZmY7Ci0gICAgfQotCi0gICAgaWYgKG5yZ19oKQotICAgIHsKLQotICAgICAgICBhdXgxID0gKFVJbnQzMikobnJnX2ggPj4gMzIpOwotICAgICAgICBpZiAoYXV4MSkKLSAgICAgICAgewotICAgICAgICAgICAgYXV4MiA9IHB2X25vcm1hbGl6ZShhdXgxKTsKLSAgICAgICAgICAgIGlmIChhdXgyKQotICAgICAgICAgICAgewotICAgICAgICAgICAgICAgIGF1eDIgLT0gMTsgICAgICAgICAgICAgICAgICAvKiAgZW5zdXJlIFEzMCAqLwotICAgICAgICAgICAgICAgIG5yZ19oID0gKG5yZ19oIDw8IGF1eDIpID4+IDMzOwotICAgICAgICAgICAgICAgIHRtcDIgPSAoVUludDMyKShucmdfaCk7Ci0gICAgICAgICAgICAgICAgbnJnX2VzdF9leHBbY10gPSAzMyAtIGF1eDI7Ci0gICAgICAgICAgICB9Ci0gICAgICAgICAgICBlbHNlCi0gICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgdG1wMiA9IChVSW50MzIpKGF1eDEgPj4gMSk7Ci0gICAgICAgICAgICAgICAgbnJnX2VzdF9leHBbY10gP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gZCkgICAgICAqYyA9IHNhdCggYSk7ICAgXAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKmQgPSBzYXQoIGIpOyAgIFwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGMgKz0gMjsgICAgICAgICBcCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBkIC09IDI7Ci0KLQotI2VsaWYgZGVmaW5lZCAoUFZfQVJNX1Y0KQotCi0KLV9faW5saW5lIEludDE2IHNhdChJbnQzMiB5KQotewotICAgIEludDMyIHg7Ci0gICAgSW50MzIgeiA9IDMxOyAvKiBydmN0IGNvbXBpbGVyIHByb2JsZW0gKi8KLSAgICBfX2FzbQotICAgIHsKLSAgICAgICAgc3ViIHksIHksIHksIGFzciAyCi0gICAgICAgIG1vdiB5LCB5LCBhc3IgTgotICAgICAgICBtb3YgeCwgeSwgYXNyICMxNQotICAgICAgICB0ZXEgeCwgeSwgYXNyIHoKLSAgICAgICAgZW9ybmUgIHksIElOVDE2X01BWCwgeSwgYXNyICMzMQotICAgIH0KLQotICAgIHJldHVybigoSW50MTYpeSk7Ci19Ci0KLSNkZWZpbmUgc2F0dXJhdGUyKCBhLCBiLCBjLCBkKSAgICAgICpjID0gc2F0KCBhKTsgICBcCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqZCA9IHNhdCggYik7ICAgXAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYyArPSAyOyAgICAgICAgIFwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGQgLT0gMjsKLQotI2VsaWYgZGVmaW5lZChQVl9BUk1fR0NDX1Y1KQotCi1fX2lubGluZSBJbnQxNiBzYXQoSW50MzIgeSkKLXsKLSAgICByZWdpc3RlciBJbnQzMiB4OwotICAgIHJlZ2lzdGVyIEludDMyIHJhID0geTsKLQotCi0gICAgYXNtIHZvbGF0aWxlKAotICAgICAgICAicWRhZGQgJTAsICUxLCAlMVxuXHQiCi0gICAgICAgICJtb3YgJTAsICUwLCBhc3IgIzE2IgotICAgIDogIj0mcippIih4KQotICAgICAgICAgICAgICAgIDogInIiKHJhKSk7Ci0KLSAgICByZXR1cm4gKChJbnQxNil4KTsKLX0KLQotCi0jZGVmaW5lIHNhdHVyYXRlMiggYSwgYiwgYywgZCkgICAgICAqYyA9IHNhdCggYSk7ICAgXAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKmQgPSBzYXQoIGIpOyAgIFwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGMgKz0gMjsgICAgICAgICBcCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBkIC09IDI7Ci0KLQotI2VsaWYgZGVmaW5lZChQVl9BUk1fTVNDX0VWQ19WNSkKLQotI2luY2x1ZGUgImFybWludHIuaCIKLQotI2RlZmluZSBzYXR1cmF0ZTIoIGEsIGIsIGMsIGQpICAgICAgKmMgPSBfREFkZFNhdEludCggYSwgYSk+PjE2OyAgIFwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICpkID0gX0RBZGRTYXRJbnQoIGIsIGIpPj4xNjsgICBcCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjICs9IDI7ICAgICAgICAgXAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZCAtPSAyOwotCi0jZWxzZQotCi0KLSNkZWZpbmUgICBzYXR1cmF0ZTIoIGEsIGIsIGMsIGQpICAgIGEgLT0gKGE+PjIpOyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYSAgPSAoYT4+Tik7ICAgICAgICAgICAgICAgICAgICAgXAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYoKGE+PjE1KSAhPSAoYT4+MzEpKSAgICAgICAgICAgICAgICAgICBcCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB7ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBhID0gKChhID4+IDMxKSBeIElOVDE2X01BWCk7IFwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKmMgPSAoSW50MTYpYTsgICAgICAgICAgICAgICAgICAgICAgICAgICBcCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjICs9IDI7ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGIgLT0gKGI+PjIpOyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYiA9ICAoYj4+Tik7ICAgICAgICAgICAgICAgICAgICAgIFwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmKChiPj4xNSkgIT0gKGI+PjMxKSkgICAgICAgICAgICAgICAgICAgXAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgeyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBcCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYiA9ICgoYiA+PiAzMSkgXiBJTlQxNl9NQVgpOyBcCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICpkID0gKEludDE2KWI7ICAgICAgICAgICAgICAgICAgICAgICAgICAgXAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZCAtPSAyOwotCi0KLSN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SAgICB7Ci0KLSAgICAgICAgc3ludGhlc2lzX3N1Yl9iYW5kX0xDX2Rvd25fc2FtcGxlZChTciwgVik7Ci0KLSAgICAgICAgLyoKLSAgICAgICAgICogICAgd2luZG93IHNpZ25hbAotICAgICAgICAgKiAgICBjYWxjdWxhdGUgb3V0cHV0IHNhbXBsZXMKLSAgICAgICAgICovCi0KLQotICAgICAgICBwdF9WMSA9ICZWWzBdOwotICAgICAgICBwdF9WMiA9ICZWWzk2XTsKLQotCi0gICAgICAgIEludDMyICogcHRfb3V0ID0gU3I7Ci0KLSAgICAgICAgZm9yIChpID0gMDsgaSA8IDg7IGkrKykKLSAgICAgICAgewotICAgICAgICAgICAgKihwdF9vdXQrKykgPSAwOwotICAgICAgICAgICAgKihwdF9vdXQrKykgPSAwOwotICAgICAgICAgICAgKihwdF9vdXQrKykgPSAwOwotICAgICAgICAgICAgKihwdF9vdXQrKykgPSAwOwotICAgICAgICB9Ci0KLSAgICAgICAgY29uc3QgSW50MzIqIHB0X0MxID0gJnNickRlY29kZXJGaWx0ZXJiYW5rQ29lZmZpY2llbnRzX2Rvd25fc21wbFswXTsKLSAgICAgICAgcHRfQzIgPSAmc2JyRGVjb2RlckZpbHRlcmJhbmtDb2VmZmljaWVudHNfZG93bl9zbXBsWzE2XTsKLQotICAgICAgICBmb3IgKGludCBrID0gMDsgayA8IDU7IGsrKykKLSAgICAgICAgewotICAgICAgICAgICAgcHRfb3V0IC09IDMyOwotICAgICAgICAgICAgZm9yIChpID0gMDsgaSA8IDE2OyBpKyspCi0gICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgcmVhbEFjY3UxICAgPSBmeHBfbXVsXzE2X2J5XzE2YnQoKihwdF9WMSsrKSwgKihwdF9DMSkpOwotICAgICAgICAgICAgICAgIHJlYWxBY2N1MiAgID0gZnhwX211bF8xNl9ieV8xNmJiKCoocHRfVjErKyksICoocHRfQzErKykpOwotICAgICAgICAgICAgICAgIHJlYWxBY2N1MSAgID0gZnhwX21hY18xNl9ieV8xNl9idCgqKHB0X1YyKyspLCAqKHB0X0MyKSwgcmVhbEFjY3UxKTsKLSAgICAgICAgICAgICAgICByZWFsQWNjdTIgICA9IGZ4cF9tYWNfMTZfYnlfMTZfYmIoKihwdF9WMisrKSwgKihwdF9DMisrKSwgcmVhbEFjY3UyKTsKLSAgICAgICAgICAgICAgICAqKHB0X291dCsrKSArPSByZWFsQWNjdTEgPj4gNTsKLSAgICAgICAgICAgICAgICAqKHB0X291dCsrKSArPSByZWFsQWNjdTIgPj4gNTsKLQotICAgICAgICAgICAgfQotICAgICAgICAgICAgcHRfVjEgKz0gOTY7Ci0gICAgICAgICAgICBwdF9WMiArPSA5NjsKLSAgICAgICAgICAgIHB0X0MxICs9IDE2OwotICAgICAgICAgICAgcHRfQzIgKz0gMTY7Ci0gICAgICAgIH0KLSAgICAgICAgcHRfb3V0IC09IDMyOwotCi0gICAgICAgIGZvciAoaSA9IDA7IGkgPCAzMjsgaSsrKQotICAgICAgICB7Ci0gICAgICAgICAgICB0aW1lU2lnWzIqaV0gPSAoSW50MTYpKCgqKHB0X291dCsrKSArIDUxMikgPj4gMTApOwotICAgICAgICB9Ci0KLSAgICB9Ci0KLX0KLQotCi0KLSNpZmRlZiBIUV9TQlIKLQotdm9pZCBjYWxjX3Nicl9zeW5maWx0ZXJiYW5rKEludDMyICogU3IsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgSW50MzIgKiBTaSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBJbnQxNiAqIHRpbWVTaWcsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgSW50MTYgICBWWzEyODBdLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJvb2wgYkRvd25TYW1wbGVTQlIpCi17Ci0gICAgSW50MzIgaTsKLQotICAgIGNvbnN0IEludDMyICpwdF9DMjsKLQotICAgIEludDMyICAgcmVhbEFjY3UxOwotICAgIEludDMyICAgcmVhbEFjY3UyOwotCi0gICAgSW50MTYgKnB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1Yl9iYW5kX2Rvd25fc2FtcGxlZChTciwgIFNpLCAgVik7Ci0KLQotICAgICAgICBJbnQzMiAqIHB0X291dCA9IFNyOwotCi0gICAgICAgIGZvciAoaSA9IDA7IGkgPCA4OyBpKyspCi0gICAgICAgIHsKLSAgICAgICAgICAgICoocHRfb3V0KyspID0gMDsKLSAgICAgICAgICAgICoocHRfb3V0KyspID0gMDsKLSAgICAgICAgICAgICoocHRfb3V0KyspID0gMDsKLSAgICAgICAgICAgICoocHRfb3V0KyspID0gMDsKLSAgICAgICAgfQotCi0KLSAgICAgICAgLyoKLSAgICAgICAgICogICAgd2luZG93IHNpZ25hbAotICAgICAgICAgKiAgICBjYWxjdWxhdGUgb3V0cHV0IHNhbXBsZXMKLSAgICAgICAgICovCi0KLSAgICAgICAgcHRfVjEgPSAmVlswXTsKLSAgICAgICAgcHRfVjIgPSAmVls5Nl07Ci0KLQotICAgICAgICBjb25zdCBJbnQzMiogcHRfQzEgPSAmc2JyRGVjb2RlckZpbHRlcmJhbmtDb2VmZmljaWVudHNfZG93bl9zbXBsWzBdOwotICAgICAgICBwdF9DMiA9ICZzYnJEZWNvZGVyRmlsdGVyYmFua0NvZWZmaWNpZW50c19kb3duX3NtcGxbMTZdOwotCi0gICAgICAgIGZvciAoSW50IGsgPSAwOyBrIDwgNTsgaysrKQotICAgICAgICB7Ci0gICAgICAgICAgICBwdF9vdXQgLT0gMzI7Ci0gICAgICAgICAgICBmb3IgKGkgPSAwOyBpIDwgMTY7IGkrKykKLSAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICByZWFsQWNjdTEgICA9IGZ4cF9tdWxfMTZfYnlfMTZidCgqKHB0X1YxKyspLCAqKHB0X0MxKSk7Ci0gICAgICAgICAgICAgICAgcmVhbEFjY3UyICAgPSBmeHBfbXVsXzE2X2J5XzE2YmIoKihwdF9WMSsrKSwgKihwdF9DMSsrKSk7Ci0gICAgICAgICAgICAgICAgcmVhbEFjY3UxICAgPSBmeHBfbWFjXzE2X2J5XzE2X2J0KCoocHRfVjIrKyksICoocHRfQzIpLCByZWFsQWNjdTEpOwotICAgICAgICAgICAgICAgIHJlYWxBY2N1MiAgID0gZnhwX21hY18xNl9ieV8xNl9iYigqKHB0X1YyKyspLCAqKHB0X0MyKyspLCByZWFsQWNjdTIpOwotICAgICAgICAgICAgICAgICoocHRfb3V0KyspICs9IHJlYWxBY2N1MSA+PiA1OwotICAgICAgICAgICAgICAgICoocHRfb3V0KyspICs9IHJlYWxBY2N1MiA+PiA1OwotICAgICAgICAgICAgfQotICAgICAgICAgICAgcHRfVjEgKz0gOTY7Ci0gICAgICAgICAgICBwdF9WMiArPSA5NjsKLSAgICAgICAgICAgIHB0X0MxICs9IDE2OwotICAgICAgICAgICAgcHRfQzIgKz0gMTY7Ci0gICAgICAgIH0KLSAgICAgICAgcHRfb3V0IC09IDMyOwotCi0gICAgICAgIGZvciAoaSA9IDA7IGkgPCAzMjsgaSsrKQotICAgICAgICB7Ci0gICAgICAgICAgICB0aW1lU2lnWzIqaV0gPSAoSW50MTYpKCgqKHB0X291dCsrKSArIDUxMikgPj4gMTApOwotICAgICAgICB9Ci0KLSAgICB9Ci19Ci0KLQotI2VuZGlmICAgICAgLyogLS0tIEhRX1NCUiAtLS0gKi8KLQotCi0jZW5kaWYgICAgICAvKiAtLS0gQUFDX1BMVVMgLS0tICovCi0KLQotCmRpZmYgLS1naXQgYS9tZWRpYS9saWJzdGFnZWZyaWdodC9jb2RlY3MvYWFjZGVjL2NhbGNfc2JyX3N5bmZpbHRlcmJhbmsuaCBiL21lZGlhL2xpYnN0YWdlZnJpZ2h0L2NvZGVjcy9hYWNkZWMvY2FsY19zYnJfc3luZmlsdGVyYmFuay5oCmRlbGV0ZWQgZmlsZSBtb2RlIDEwMDY0NAppbmRleCAyOGJkNmRlLi4wMDAwMDAwCi0tLSBhL21lZGlhL2xpYnN0YWdlZnJpZ2h0L2NvZGVjcy9hYWNkZWMvY2FsY19zYnJfc3luZmlsdGVyYmFuay5oCis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AgICoocHRfdGVtcF9lLS0pID0gICB0bXAxICArIHRtcDI7Ci0gICAgICAgICoocHRfdGVtcF9vKyspID0gZnhwX211bDMyX1EyNigodG1wMSAtIHRtcDIpLCBjb3N4KTsKLSAgICB9Ci19Ci0KLQotCi12b2lkIHB2X3NwbGl0X3ooSW50MzIgKnZlY3RvcikKLXsKLSAgICBJbnQzMiBpOwotICAgIEludDMyICpwdF92ZWN0b3IgICAgID0gJnZlY3RvclszMV07Ci0gICAgY29uc3QgSW50MzIgKnB0X2Nvc1Rlcm1zID0gJkNvc1RhYmxlXzQ4WzMyXTsKLSAgICBJbnQzMiAqcHRfdGVtcF9lID0gdmVjdG9yOwotICAgIEludDMyIHRtcDE7Ci0gICAgSW50MzIgdG1wMjsKLSAgICBJbnQzMiBjb3N4OwotCi0gICAgZm9yIChpID0gODsgaSAhPSAwOyBpLS0pCi0gICAgewotICAgICAgICB0bXAxID0gKihwdF92ZWN0b3IpOwotICAgICAgICB0bXAyID0gKihwdF90ZW1wX2UpOwotICAgICAgICBjb3N4ID0gKihwdF9jb3NUZXJtcysrKTsKLSAgICAgICAgKihwdF90ZW1wX2UrKykgPSAgIHRtcDEgICsgdG1wMjsKLSAgICAgICAgKihwdF92ZWN0b3ItLSkgPSBmeHBfbXVsMzJfUTI2KCh0bXAxIC0gdG1wMiksIGNvc3gpOwotICAgICAgICB0bXAyID0gKihwdF90ZW1wX2UpOwotICAgICAgICB0bXAxID0gKihwdF92ZWN0b3IpOwotICAgICAgICBjb3N4ID0gKihwdF9jb3NUZXJtcysrKTsKLSAgICAgICAgKihwdF90ZW1wX2UrKykgPSAgIHRtcDEgICsgdG1wMjsKLSAgICAgICAgKihwdF92ZWN0b3ItLSkgPSBmeHBfbXVsMzJfUTI2KCh0bXAxIC0gdG1wMiksIGNvc3gpOwotICAgIH0KLX0KLQotCi12b2lkIHB2X21lcmdlX2luX3BsYWNlX04zMihJbnQzMiB2ZWNbXSkKLXsKLQotICAgIEludDMyIHRlbXBbNF07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tLS0tLS0tLS0tLSovCi0KLUludCBkZWNvZGVfaHVmZl9jd190YWIxKAotICAgIEJJVFMgICAgICAgICAgKnBJbnB1dFN0cmVhbSkKLXsKLSAgICBJbnQzMiAgdGFiOwotICAgIEludDMyICBjdzsKLQotICAgIGN3ICA9IGdldDE3X25fbGVzc2JpdHMoCi0gICAgICAgICAgICAgIDExLAotICAgICAgICAgICAgICBwSW5wdXRTdHJlYW0pOwotICAgIGlmICgoY3cgPj4gMTApID09IDApCi0gICAgewotICAgICAgICBwSW5wdXRTdHJlYW0tPnVzZWRCaXRzIC09ICgxMSAtIDEpOwotICAgICAgICByZXR1cm4gNDA7IC8qIGlkeCBpcyA0MCAqLwotICAgIH0KLSAgICBlbHNlIGlmICgoY3cgPj4gNikgPD0gMjMpCi0gICAgewotICAgICAgICB0YWIgPSAoY3cgPj4gNikgLSAxNjsKLSAgICB9Ci0gICAgZWxzZSBpZiAoKGN3ID4+IDQpIDw9IDExOSkKLSAgICB7Ci0gICAgICAgIHRhYiA9IChjdyA+PiA0KSAtIDk2ICsgODsKLSAgICB9Ci0gICAgZWxzZSBpZiAoKGN3ID4+IDIpIDw9IDUwMykKLSAgICB7Ci0gICAgICAgIHRhYiA9IChjdyA+PiAyKSAtIDQ4MCArIDMyOwotICAgIH0KLSAgICBlbHNlCi0gICAgewotICAgICAgICB0YWIgPSBjdyAtIDIwMTYgKyA1NjsKLSAgICB9Ci0KLSAgICB0YWIgPSAqKGh1ZmZfdGFiMSArIHRhYik7Ci0KLSAgICBwSW5wdXRTdHJlYW0tPnVzZWRCaXRzIC09ICgxMSAtICh0YWIgJiBNQVNLX0xPVzE2KSk7Ci0gICAgcmV0dXJuICgoSW50KSh0YWIgPj4gVVBQRVIxNikpOwotfQotCi0KLUludCBkZWNvZGVfaHVmZl9jd190YWIyKAotICAgIEJJVFMgICAgICAgICAgKnBJbnB1dFN0cmVhbSkKLXsKLSAgICBJbnQzMiAgdGFiOwotICAgIEludDMyICBjdzsKLQotICAgIGN3ICA9IGdldDlfbl9sZXNzYml0cygKLSAgICAgICAgICAgICAgOSwKLSAgICAgICAgICAgICAgcElucHV0U3RyZWFtKTsKLSAgICBpZiAoKGN3ID4+IDYpID09IDApCi0gICAgewotICAgICAgICBwSW5wdXRTdHJlYW0tPnVzZWRCaXRzIC09ICg5IC0gMyk7IC8qIHVzZWQgMyBiaXRzICovCi0gICAgICAgIHJldHVybiA0MDsgLyogaWR4IGlzIDQwICovCi0gICAgfQotICAgIGVsc2UgaWYgKChjdyA+PiAzKSA8PSA0OSkKLSAgICB7Ci0gICAgICAgIHRhYiA9IChjdyA+PiAzKSAtIDg7Ci0gICAgfQotICAgIGVsc2UgaWYgKChjdyA+PiAyKSA8PSAxMTQpCi0gICAgewotICAgICAgICB0YWIgPSAoY3cgPj4gMikgLSAxMDAgKyA0MjsKLSAgICB9Ci0gICAgZWxzZSBpZiAoKGN3ID4+IDEpIDw9IDI0OCkKLSAgICB7Ci0gICAgICAgIHRhYiA9IChjdyA+PiAxKSAtIDIzMCArIDU3OwotICAgIH0KLSAgICBlbHNlCi0gICAgewotICAgICAgICB0YWIgPSBjdyAtIDQ5OCArIDc2OwotICAgIH0KLQotICAgIHRhYiA9ICooaHVmZl90YWIyICsgdGFiKTsKLQotICAgIHBJbnB1dFN0cmVhbS0+dXNlZEJpdHMgLT0gKDkgLSAodGFiICYgTUFTS19MT1cxNikpOwotICAgIHJldHVybiAoKEludCkodGFiID4+IFVQUEVSMTYpKTsKLX0KLQotCi1JbnQgZGVjb2RlX2h1ZmZfY3dfdGFiMygKLSAgICBCSVRTICAgICAgICAgICpwSW5wdXRTdHJlYW0pCi17Ci0gICAgSW50MzIgIHRhYjsKLSAgICBJbnQzMiAgY3c7Ci0KLSAgICBjdyAgPSBnZXQxN19uX2xlc3NiaXRzKAotICAgICAgICAgICAgICAxNiwKLSAgICAgICAgICAgICAgcElucHV0U3RyZWFtKTsKLSAgICBpZiAoKGN3ID4+IDE1KSA9PSAwKQotICAgIHsKLSAgICAgICAgcElucHV0U3RyZWFtLT51c2VkQml0cyAtPSAoMTYgLSAxKTsgLyogdXNlZCAxIGJpdHMgKi8KLSAgICAgICAgcmV0dXJuIDA7IC8qIGlkeCBpcyAwICovCi0gICAgfQotICAgIGVsc2UgaWYgKChjdyA+PiAxMCkgPD0gNTcpCi0gICAgewotICAgICAgICB0YWIgPSAoY3cgPj4gMTApIC0gMzI7Ci0gICAgfQotICAgIGVsc2UgaWYgKChjdyA+PiA3KSA8PSA1MDApCi0gICAgewotICAgICAgICB0YWIgPSAoY3cgPj4gNykgLSA0NjQgKyAyNjsKLSAgICB9Ci0gICAgZWxzZSBpZiAoKGN3ID4+IDYpIDw9IDEwMTYpCi0gICAgewotICAgICAgICB0YWIgPSAoY3cgPj4gNikgLSAxMDAyICsgNjM7Ci0gICAgfQotICAgIGVsc2UgaWYgKChjdyA+PiA0KSA8PSA0MDkyKQotICAgIHsKLSAgICAgICAgdGFiID0gKGN3ID4+IDQpIC0gNDA2OCArIDc4OwotICAgIH0KLSAgICBlbHNlCi0gICAgewotICAgICAgICB0YWIgPSBjdyAtIDY1NDg4ICsgMTAzOwotICAgIH0KLQotICAgIHRhYiA9ICooaHVmZl90YWIzICsgdGFiKTsKLQotICAgIHBJbnB1dFN0cmVhbS0+dXNlZEJpdHMgLT0gKDE2IC0gKHRhYiAmIE1BU0tfTE9XMTYpKTsKLSAgICByZXR1cm4gKChJbnQpKHRhYiA+PiBVUFBFUjE2KSk7Ci19Ci0KLQotSW50IGRlY29kZV9odWZmX2N3X3RhYjQoCi0gICAgQklUUyAgICAgICAgICAqcElucHV0U3RyZWFtKQotewotICAgIEludDMyICB0YWI7Ci0gICAgSW50MzIgIGN3OwotCi0gICAgY3cgID0gZ2V0MTdfbl9sZXNzYml0cygKLSAgICAgICAgICAgICAgMTIsCi0gICAgICAgICAgICAgIHBJbnB1dFN0cmVhbSk7Ci0KLSAgICBpZiAoKGN3ID4+IDcpIDw9IDI1KQotICAgIHsKLSAgICAgICAgdGF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+PiA1KSAtIDIyNCArIDEyOwotICAgIH0KLSAgICBlbHNlIGlmICgoY3cgPj4gMykgPD0gMTAxMSkKLSAgICB7Ci0gICAgICAgIHRhYiA9IChjdyA+PiAzKSAtIDk3NiArIDMyOwotICAgIH0KLSAgICBlbHNlIGlmICgoY3cgPj4gMikgPD0gMjA0MSkKLSAgICB7Ci0gICAgICAgIHRhYiA9IChjdyA+PiAyKSAtIDIwMjQgKyA2ODsKLSAgICB9Ci0gICAgZWxzZQotICAgIHsKLSAgICAgICAgdGFiID0gY3cgLSA4MTY4ICsgODY7Ci0gICAgfQotCi0gICAgdGFiID0gKihodWZmX3RhYjUgKyB0YWIpOwotCi0gICAgcElucHV0U3RyZWFtLT51c2VkQml0cyAtPSAoMTMgLSAodGFiICYgTUFTS19MT1cxNikpOwotICAgIHJldHVybiAoKEludCkodGFiID4+IFVQUEVSMTYpKTsKLX0KLQotCi0KLUludCBkZWNvZGVfaHVmZl9jd190YWI2KAotICAgIEJJVFMgICAgICAgICAgKnBJbnB1dFN0cmVhbSkKLXsKLSAgICBJbnQzMiAgdGFiOwotICAgIEludDMyICBjdzsKLQotICAgIGN3ICA9IGdldDE3X25fbGVzc2JpdHMoCi0gICAgICAgICAgICAgIDExLAotICAgICAgICAgICAgICBwSW5wdXRTdHJlYW0pOwotCi0gICAgaWYgKChjdyA+PiA3KSA8PSA4KQotICAgIHsKLSAgICAgICAgdGFiID0gKGN3ID4+IDcpOwotICAgIH0KLSAgICBlbHNlIGlmICgoY3cgPj4gNCkgPD0gMTE2KQotICAgIHsKLSAgICAgICAgdGFiID0gKGN3ID4+IDQpIC0gNzIgKyA5OwotICAgIH0KLSAgICBlbHNlIGlmICgoY3cgPj4gMikgPD0gNTA2KQotICAgIHsKLSAgICAgICAgdGFiID0gKGN3ID4+IDIpIC0gNDY4ICsgNTQ7Ci0gICAgfQotICAgIGVsc2UKLSAgICB7Ci0gICAgICAgIHRhYiA9IGN3IC0gMjAyOCArIDkzOwotICAgIH0KLQot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pOwotICAgIHJldHVybiAoKEludCkodGFiID4+IFVQUEVSMTYpKTsKLX0KLQotCi0KLUludCBkZWNvZGVfaHVmZl9jd190YWI4KAotICAgIEJJVFMgICAgICAgICAgKnBJbnB1dFN0cmVhbSkKLXsKLSAgICBJbnQzMiAgdGFiOwotICAgIEludDMyICBjdzsKLQotICAgIGN3ICA9IGdldDE3X25fbGVzc2JpdHMoCi0gICAgICAgICAgICAgIDEwLAotICAgICAgICAgICAgICBwSW5wdXRTdHJlYW0pOwotCi0gICAgaWYgKChjdyA+PiA1KSA8PSAyMCkKLSAgICB7Ci0gICAgICAgIHRhYiA9IChjdyA+PiA1KTsKLSAgICB9Ci0gICAgZWxzZSBpZiAoKGN3ID4+IDMpIDw9IDExNykKLSAgICB7Ci0gICAgICAgIHRhYiA9IChjdyA+PiAzKSAtIDg0ICsgMjE7Ci0gICAgfQotICAgIGVsc2UgaWYgKChjdyA+PiAyKSA8PSAyNTApCi0gICAgewotICAgICAgICB0YWIgPSAoY3cgPj4gMikgLSAyMzYgKyA1NTsKLSAgICB9Ci0gICAgZWxzZQotICAgIHsKLSAgICAgICAgdGFiID0gY3cgLSAxMDA0ICsgNzA7Ci0gICAgfQotCi0gICAgdGFiID0gKihodWZmX3RhYjggKyB0YWIpOwotCi0gICAgcElucHV0U3RyZWFtLT51c2VkQml0cyAtPSAoMTAgLSAodGFiICYgTUFTS19MT1cxNikpOwotICAgIHJldHVybiAoKEludCkodGFiID4+IFVQUEVSMTYpKTsKLX0KLQotCi1JbnQgZGVjb2RlX2h1ZmZfY3dfdGFiOSgKLSAgICBCSVRTICAgICAgICAgICpwSW5wdXRTdHJlYW0pCi17Ci0gICAgSW50MzIgIHRhYjsKLSAgICBJbnQzMiAgY3c7Ci0KLSAgICBjdyAgPSBnZXQxN19uX2xlc3NiaXRzKAotICAgICAgICAgICAgICAxNSwKLSAgICAgICAgICAgICAgcElucHV0U3RyZWFtKTsKLQotICAgIGlmICgoY3cgPj4gMTEpIDw9IDEyKQ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S0tLS0tLS0tLS0tLS0qLwotCi12b2lkIGRlY29kZV9ub2lzZV9mbG9vcmxldmVscyhTQlJfRlJBTUVfREFUQSAqIGhGcmFtZURhdGEpCi0KLXsKLSAgICBJbnQzMiBlbnY7Ci0gICAgSW50MzIgaTsKLQotICAgIEludDMyICogZnJhbWVJbmZvICAgICAgICAgICA9IGhGcmFtZURhdGEtPmZyYW1lSW5mbzsKLSAgICBJbnQzMiAgIG5OZmIgICAgICAgICAgICAgICAgPSBoRnJhbWVEYXRhLT5uTmZiOwotICAgIEludDMyICogZG9tYWluX3ZlYyAgICAgICAgICA9IGhGcmFtZURhdGEtPmRvbWFpbl92ZWMyOwotCi0gICAgSW50MzIgKiBzYnJOb2lzZUZsb29yTGV2ZWxfbWFuID0gaEZyYW1lRGF0YS0+c2JyTm9pc2VGbG9vckxldmVsX21hbjsKLSAgICBJbnQzMiAqIHByZXZOb2lzZUxldmVsX21hbiAgICAgPSBoRnJhbWVEYXRhLT5wcmV2Tm9pc2VMZXZlbF9tYW47Ci0KLSAgICBJbnQzMiBuRW52ID0gZnJhbWVJbmZvWyhmcmFtZUluZm9bMF0gPDwgMSkgKyAzXTsKLQotICAgIGZvciAoZW52ID0gMDsgZW52IDwgbkVudjsgZW52KyspCi0gICAgewotICAgICAgICBpZiAoZG9tYWluX3ZlY1tlbnZdID09IDApCi0gICAgICAgIHsKLSAgICAgICAgICAgIHByZXZOb2lzZUxldmVsX21hblswXSA9ICooc2JyTm9pc2VGbG9vckxldmVsX21hbisrKTsKLQotICAgICAgICAgICAgZm9yIChpID0gMTsgaSA8IG5OZmI7IGkrKykKLSAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAqc2JyTm9pc2VGbG9vckxldmVsX21hbiArPSAqKHNick5vaXNlRmxvb3JMZXZlbF9tYW4gLSAxKTsKLSAgICAgICAgICAgICAgICBwcmV2Tm9pc2VMZXZlbF9tYW5baV0gPSAqKHNick5vaXNlRmxvb3JMZXZlbF9tYW4rKyk7Ci0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U3RhcnQgPSBwSW50ZXJsZWF2ZWQ7Ci0KLSAgICAgICAgRk9SIChzZmIgPSBwU2ZiUGVyV2luW25ncm91cHMtZ3JvdXBdOyBzZmIgPiAwOyBzZmItLSkKLQotICAgICAgICAgICAgcFdpbiA9IHBHcm91cDsKLQotICAgICAgICAgICAgRk9SICh3aW4gPSBwR3JvdXBMZW5bbmdyb3Vwcy1ncm91cF07IHdpbiA+IDA7IHdpbi0tKQotCi0gICAgICAgICAgICAgICAgcERlaW50ZXJsZWF2ZWQgPSBwV2luICsgc2ZiX2luYzsKLQotICAgICAgICAgICAgICAgIHB2X21lbWNweSgKLSAgICAgICAgICAgICAgICAgICAgIHBEZWludGVybGVhdmVkLAotICAgICAgICAgICAgICAgICAgICAgcEludGVybGVhdmVkLAotICAgICAgICAgICAgICAgICAgICAqcFNmYldpZHRoKnNpemVvZigqcEludGVybGVhdmVkKSk7Ci0KLSAgICAgICAgICAgICAgICBwSW50ZXJsZWF2ZWQgKz0gKnBTZmJXaWR0aDsKLQotICAgICAgICAgICAgICAgIHBXaW4gKz0gU04yOwotCi0gICAgICAgICAgICBFTkRGT1IgKHdpbikKLQotICAgICAgICAgICAgc2ZiX2luYyArPSAqcFNmYldpZHRoKys7Ci0KLSAgICAgICAgRU5ERk9SIChzZmIpCi0KLSAgICBwR3JvdXAgKz0gKHBJbnRlcmxlYXZlZCAtIHBTdGFydCk7Ci0KLSAgICBFTkRGT1IgKGdyb3VwKQotCi0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0KLSBSRVNPVVJDRVMgVVNFRAotICAgV2hlbiB0aGUgY29kZSBpcyB3cml0dGVuIGZvciBhIHNwZWNpZmljIHRhcmdldCBwcm9jZXNzb3IgdGhlCi0gICAgIHRoZSByZXNvdXJjZXMgdXNlZCBzaG91bGQgYmUgZG9jdW1lbnRlZCBiZWxv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nNmYl9wZXJfd2luOwotICAgIG5ncm91cHMgICAgID0gcEZyYW1lSW5mby0+bnVtX2dyb3VwczsKLSAgICBwR3JvdXBMZW4gICA9IHBGcmFtZUluZm8tPmdyb3VwX2xlbjsKLQotICAgIHBHcm91cCA9IHBEZWludGVybGVhdmVkOwotCi0gICAgZm9yIChncm91cCA9IG5ncm91cHM7IGdyb3VwID4gMDsgZ3JvdXAtLSkKLSAgICB7Ci0gICAgICAgIHBTZmJXaWR0aCAgID0gcEZyYW1lSW5mby0+c2ZiX3dpZHRoXzEyODsKLSAgICAgICAgc2ZiX2luYyA9IDA7Ci0gICAgICAgIHBTdGFydCA9IHBJbnRlcmxlYXZlZDsKLQotICAgICAgICAvKiBQZXJmb3JtIHRoZSBkZWludGVybGVhdmluZyBhY3Jvc3MgYWxsIHdpbmRvd3MgaW4gYSBncm91cCAqLwotCi0gICAgICAgIGZvciAoc2ZiID0gcFNmYlBlcldpbltuZ3JvdXBzLWdyb3VwXTsgc2ZiID4gMDsgc2ZiLS0pCi0gICAgICAgIHsKLSAgICAgICAgICAgIHBXaW4gPSBwR3JvdXA7Ci0KLSAgICAgICAgICAgIGZvciAod2luID0gcEdyb3VwTGVuW25ncm91cHMtZ3JvdXBdOyB3aW4gPiAwOyB3aW4tLSkKLSAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICBwRGVpbnRlcmxlYXZlZCA9IHBXaW4gKyBzZmJfaW5jOwotCi0gICAgICAgICAgICAgICAgcHZfbWVtY3B5KAotICAgICAgICAgICAgICAgICAgICBwRGVpbnRlcmxlYXZlZCwKLSAgICAgICAgICAgICAgICAgICAgcEludGVybGVhdmVkLAotICAgICAgICAgICAgICAgICAgICAqcFNmYldpZHRoKnNpemVvZigqcEludGVybGVhdmVkKSk7Ci0KLSAgICAgICAgICAgICAgICBwSW50ZXJsZWF2ZWQgKz0gKnBTZmJXaWR0aDsKLQotICAgICAgICAgICAgICAgIHBXaW4gKz0gU04yOwotCi0gICAgICAgICAgICB9I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yMjAsICsgMzQ4LCArIDQ3NiwKLSAgICArIDEyNCwgKyAyNTIsICsgMzgwLCArIDUwOCwKLSAgICArIDYsICsgMTM0LCArIDI2MiwgKyAzOTAsCi0gICAgKyAzOCwgKyAxNjYsICsgMjk0LCArIDQyMiwKLSAgICArIDcwLCArIDE5OCwgKyAzMjYsICsgNDU0LAotICAgICsgMTAyLCArIDIzMCwgKyAzNTgsICsgNDg2LAotICAgICsgMTQsICsgMTQyLCArIDI3MCwgKyAzOTgsCi0gICAgKyA0NiwgKyAxNzQsICsgMzAyLCArIDQzMCwKLSAgICArIDc4LCArIDIwNiwgKyAzMzQsICsgNDYyLAotICAgICsgMTEwLCArIDIzOCwgKyAzNjYsICsgNDk0LAotICAgICsgMjIsICsgMTUwLCArIDI3OCwgKyA0MDYsCi0gICAgKyA1NCwgKyAxODIsICsgMzEwLCArIDQzOCwKLSAgICArIDg2LCArIDIxNCwgKyAzNDIsICsgNDcwLAotICAgICsgMTE4LCArIDI0NiwgKyAzNzQsICsgNTAyLAotICAgICsgMzAsICsgMTU4LCArIDI4NiwgKyA0MTQsCi0gICAgKyA2MiwgKyAxOTAsICsgMzE4LCArIDQ0NiwKLSAgICArIDk0LCArIDIyMiwgKyAzNTAsICsgNDc4LAotICAgICsgMTI2LCArIDI1NCwgKyAzODIsICsgNTEwCi19OwotCi0KLQotCi1jb25zdCBJbnQxNiBkaWdpdF9yZXZlcnNlX3N3YXBfMjU2WyAyNDFdID0KLXsKLSAgICArIDIsICsgMTI4LCAgICsgNCwgKyAyNTYsCi0gICAgKyA2LCArIDM4NCwgICArIDgsICArIDMyLAotICAgICsgMTAsICsgMTYwLCAgKyAxMiwgKyAyODgsCi0gICAgKyAxNCwgKyA0MTYsICArIDE2LCAgKyA2NCwKLSAgICArIDE4LCArIDE5MiwgICsgMjAsICsgMzIwLAotICAgICsgMjIsICsgNDQ4LCAgKyAyNCwgICsgOTYsCi0gICAgKyAyNiwgKyAyMjQsICArIDI4LCArIDM1MiwKLSAgICArIDMwLCArIDQ4MCwgICsgMzQsICsgMTM2LAotICAgICsgMzYsICsgMjY0LCAgKyAzOCwgKyAzOTIsCi0gICAgKyA0MiwgKyAxNjgsICArIDQ0LCArIDI5NiwKLSAgICArIDQ2LCArIDQyNCwgICsgNDgsICArIDcyLAotICAgICsgNTAsICsgMjAwLCAgKyA1MiwgKyAzMjgsCi0gICAgKyA1NCwgKyA0NTYsICArIDU2LCArIDEwNCwKLSAgICArIDU4LCArIDIzMiwgICsgNjAsICsgMzYwLAotICAgICsgNjIsICsgNDg4LCAgKyA2NiwgKyAxNDQsCi0gICAgKyA2OCwgKyAyNzIsICArIDcwLCArIDQwMCwKLSAgICArIDc0LCArIDE3NiwgICsgNzYsICsgMzA0LAotICAgICsgNzgsICsgNDMyLCAgKyA4MiwgKyAyMDgsCi0gICAgKyA4NCwgKyAzMzYsICArIDg2LCArIDQ2NCwKLSAgICArIDg4LCArIDExMiwgICsgOTAsICsgMjQwLAotICAgICsgOTIsICsgMzY4LCAgKyA5NCwgKyA0OTYsCi0gICAgKyA5OCwgKyAxNTIsICsgMTAwLCArIDI4MCwKLSAgICArIDEwMiwgKyA0MDgsICsgMTA2LCArIDE4NCwKLSAgICArIDEwOCwgKyAzMTIsICsgMTEwLCArIDQ0MCwKLSAgICArIDExNCwgKyAyMTYsICsgMTE2LCArIDM0NCwKLSAgICArIDExOCwgKyA0NzIsICsgMTIyLCArIDI0OCwKLSAgICArIDEyNCwgKyAzNzYsICsgMTI2LCArIDUwNCwKLSAgICArIDEzMiwgKyAyNTgsICsgMTM0LCArIDM4NiwKLSAgICArIDEzOCwgKyAxNjIsICsgMTQwLCArIDI5MCwKLSAgICArIDE0MiwgKyA0MTgsICsgMTQ2LCArIDE5NCwKLSAgICArIDE0OCwgKyAzMjIsICsgMTUwLCArIDQ1MCwKLSAgICArIDE1NCwgKyAyMjYsICsgMTU2LCArIDM1NCwKLSAgICArIDE1OCwgKyA0ODIsICsgMTY0LCArIDI2NiwKLSAgICArID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0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tCi07IEVOVU1FUkFURUQgVFlQRURFRidTCi0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tKi8KLXR5cGVkZWYgZW51bQotewotICAgIC8qCi0gICAgICogc3BlY2lmeSBodWZmbWFuIHRhYmxlcyBhcyBzaWduZWQgKDEpIG9yIHVuc2lnbmVkICgwKQotICAgICAqLwotICAgIEhVRjFTR04gICAgID0gMSwKLSAgICBIVUYyU0dOICAgICA9IDEsCi0gICAgSFVGM1NHTiAgICAgPSAwLAotICAgIEhVRjRTR04gICAgID0gMCwKLSAgICBIVUY1U0dOICAgICA9IDEsCi0gICAgSFVGNlNHTiAgICAgPSAxLAotICAgIEhVRjdTR04gICAgID0gMCwKLSAgICBIVUY4U0dOICAgICA9IDAsCi0gICAgSFVGOVNHTiAgICAgPSAwLAotICAgIEhVRjEwU0dOICAgICAgICA9IDAsCi0gICAgSFVGMTFTR04gICAgICAgID0gMCwKLQotICAgIFpFUk9fSENCICAgICAgICA9IDAsCi0gICAgQlk0Qk9PS1MgICAgICAgID0gNCwKLSAgICBFU0NCT09LICAgICA9IDExLAotICAgIE5TUEVDQk9PS1MgICAgICA9IEVTQ0JPT0sgKyAxLAotICAgIEJPT0tTQ0wgICAgID0gTlNQRUNCT09LUywKLSAgICBOQk9PS1MgICAgICA9IE5TUEVDQk9PS1MgKyAxLAotICAgIElOVEVOU0lUWV9IQ0IyICA9IDE0LAotICAgIElOVEVOU0lUWV9IQ0IgICA9IDE1LAotICAgIE5PSVNFX0hDQiAgICAgICA9IDEzLAotICAgIE5PSVNFX0hDQjIgICAgICA9IDExMywKLQotICAgIE5PSVNFX1BDTV9CSVRTICAgICAgPSA5LAotICAgIE5PSVNFX1BDTV9PRkZTRVQgICAgPSAoMSA8PCAoTk9J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gdHlwZWRlZiBlbnVtIGVNUDRBdWRpb09iamVjdFR5cGUKLSAgICB7Ci0gICAgICAgIE1QNEFVRElPX05VTEwgICAgICAgICAgICA9ICAwLCAvKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0gICAgICAgIE1QNEFVRElPX0FBQ19NQUlOICAgICAgICA9ICAxLCAvKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0gICAgICAgIE1QNEFVRElPX0FBQ19MQyAgICAgICAgICA9ICAyLCAvKiBMQyA9IExvdyBDb21wbGV4aXR5ICAgICAgICAgICAgICAgICAgICovCi0gICAgICAgIE1QNEFVRElPX0FBQ19TU1IgICAgICAgICA9ICAzLCAvKiBTU1IgPSBTY2FsYWJsZSBTYW1wbGluZyBSYXRlICAgICAgICAgICovCi0gICAgICAgIE1QNEFVRElPX0xUUCAgICAgICAgICAgICA9ICA0LCAvKiBMVFAgPSBMb25nIFRlcm0gUHJlZGljdGlvbiAgICAgICAgICAgICovCi0gICAgICAgIE1QNEFVRElPX1NCUiAgICAgICAgICAgICA9ICA1LCAvKiBTQlIgPSBTcGVjdHJhbCBCYW5kIFJlcGxpY2F0aW9uICAgICAgICovCi0gICAgICAgIE1QNEFVRElPX0FBQ19TQ0FMQUJMRSAgICA9ICA2LCAvKiBzY2FsZXMgYm90aCBiaXRyYXRlIGFuZCBzYW1wbGluZyByYXRlICovCi0gICAgICAgIE1QNEFVRElPX1RXSU5WUSAgICAgICAgICA9ICA3LCAvKiBsb3cgYml0IHJhdGUgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0gICAgICAgIE1QNEFVRElPX0NFTFAgICAgICAgICAgICA9ICA4LAotICAgICAgICBNUDRBVURJT19IVlhDICAgICAgICAgICAgPSAgOSwKLSAgICAgICAgLyogMTAgaXMgcmVzZXJ2ZWQgICAgICAgICAgICAgICAgICAgICAgICAqLwotICAgICAgICAvKiAxMSBpcyByZXNlcnZlZCAgICAgICAgICAgICAgICAgICAgICAgICovCi0gICAgICAgIE1QNEFVRElPX1RUU0kgICAgICAgICAgICA9IDEyLAotICAgICAgICAvKiAxMy0xNiBhcmUgc3ludGhlc2lzIGFuZCBNSURJIHR5cGVzICAgICovCi0gICAgICAgIE1QNEFVRElPX0VSX0FBQ19MQyAgICAgICA9IDE3LCAvKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0gICAgICAgIC8qIDE4IGlzIHJlc2VydmVkICAgICAgICAgICAgICAgICAgICAgICAgKi8KLSAgICAgICAgTVA0QVVESU9fRVJfQUFDX0xUUCAgICAgID0gMTksIC8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLSAgICAgICAgTVA0QVVESU9fRVJfQUFDX1NDQUxBQkxFID0gMjAsIC8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLSAgICAgICAgTVA0QVVESU9fRVJfVFdJTlZRICAgICAgID0gMjEsIC8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLSAgICAgICAgTVA0QVVESU9fRVJfQlNBQyAgICAgICAgID0gMjIsIC8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLSAgICAgICAgTVA0QVVESU9fRVJfQUFDX0xEICAgICAgID0gMjMsIC8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLSAgICAgICAgTVA0QVVESU9fRVJfQ0VMUCAgICAgICAgID0gMjQsIC8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLSAgICAgICAgTVA0QVVESU9fRVJfSFZYQyAgICAgICAgID0gMjUsIC8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLSAgICAgICAgTVA0QVVESU9fRVJfSElMTiAgICAgICAgID0gMjYsIC8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLSAg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YWJzWCA9IHg7Ci0gICAgICAgIEVMU0UKLSAgICAgICAgICAgIGFic1ggPSAteDsKLSAgICAgICAgRU5ESUYKLQotICAgICAgICBjb2VmW2ldID0gYWJzWDsKLQotICAgICAgICBJRiAoYWJzWCA+IG1heElucHV0KQotICAgICAgICAgICAgbWF4SW5wdXQgPSBhYnNYOwotICAgICAgICBFTkRJRgotICAgIEVOREZPUgotCi0gICAgSUYgKG1heElucHV0ID09IDApCi0gICAgICAgICpwUUZvcm1hdCA9IFFUQUJMRTsKLSAgICBFTFNFCi0gICAgICAgIHRlbXAgPSBpbnZlcnNlUXVhbnRUYWJsZVsobWF4SW5wdXQgPj4gT1JERVIpICsgMV07Ci0KLSAgICAgICAgdGVtcCArPSAoKDEgPDwgKFFUQUJMRSkpLTEpOwotCi0gICAgICAgIHRlbXAgPj49IChRVEFCTEUtMSk7Ci0KLSAgICAgICAgdGVtcCAqPSBtYXhJbnB1dDsKLQotICAgICAgICBiaW5hcnlEaWdpdHMgPSAwOwotICAgICAgICBXSElMRSggdGVtcCAhPSAwKQotICAgICAgICAgICAgdGVtcCA+Pj0gMTsKLSAgICAgICAgICAgIGJpbmFyeURpZ2l0cysrOwotICAgICAgICBXRU5ECi0KLSAgICAgICAgSUYgKGJpbmFyeURpZ2l0cyA8IChTSUdORUQzMkJJVFMgLSBRVEFCTEUpKQotICAgICAgICAgICAgYmluYXJ5RGlnaXRzID0gU0lHTkVEMzJCSVRTIC0gUVRBQkxFOwotICAgICAgICBFTkRJRgotCi0gICAgICAgICpwUUZvcm1hdCA9IFNJR05FRDMyQklUUyAtIGJpbmFyeURpZ2l0czsKLSAgICAgICAgc2hpZnQgPSBRVEFCTEUgLSAqcFFGb3JtYXQ7Ci0KLSAgICAgICAgSUYgKG1heElucHV0IDwgVEFCTEVTSVpFKQotICAgICAgICAgICAgRk9SIChpID0gc2ZiV2lkdGggLSAxOyBpID49IDA7IGktLSkKLSAgICAgICAgICAgICAgICB4ID0gcXVhbnRTcGVjW2ldOwotCi0gICAgICAgICAgICAgICAgYWJzWCA9IGNvZWZbaV07Ci0KLSAgICAgICAgICAgICAgICB0bXBfY29lZiA9IHggKiAoaW52ZXJzZVF1YW50VGFibGVbYWJzWF0gPj4gc2hpZnQpOwotCi0gICAgICAgICAgICAgICAgYl9sb3cgID0gKHRtcF9jb2VmICYgMHhGRkZGKTsKLSAgICAgICAgICAgICAgICBiX2hpZ2ggPSAodG1wX2NvZWYgPj4gMTYpOwotCi0gICAgICAgICAgICAgICAgbXVsdF9sb3cgID0gKCAoVUludDMyKSBiX2xvdyAqIHNjYWxlICk7Ci0gICAgICAgICAgICAgICAgbXVsdF9oaWdoID0gKCAoSW50MzIpIGJfaGlnaCAqIHNjYWxlICk7Ci0KLSAgICAgICAgICAgICAgICBtdWx0X2xvdyA+Pj0gMTY7Ci0KLSAgICAgICAgICAgICAgICBjb2VmW2ldICA9IChJbnQzMikgKG11bHRfaGlnaCArIG11bHRfbG93KTsKLQotICAgICAgICAgICAgRU5ERk9SCi0gICAgICAgIEVMU0UKLSAgICAgICAgICAgIEZPUiAoaSA9IHNmYldpZHRoOyBpID49IDAgOyBpLS0pCi0gICAgICAgICAgICAgICAgeCAgICA9IHF1YW50U3BlY1tpXTsKLSAgICAgICAgICAgICAgICBhYnNYID0gY29lZltpXTsKLQotICAgICAgICAgICAgICAgIElGIChhYnNYIDwgVEFCTEVTSVpFKQotICAgICAgICAgICAgICAgICAgICB0bXBfY29lZiA9IHggKiAoaW52ZXJzZVF1YW50VGFibGVbYWJzWF0gPj4gc2hpZnQpOwotICAgICAgICAgICAgICAgIEVMU0UKLSAgICAgICAgICAgICAgICAgICAgaW5kZXggPSBhYnNYID4+IE9SREVSOwotICAgICAgICAgICAgICAgICAgICB3MSA9IGludmVyc2VRdWFudFRhYmxlW2luZGV4XTsKLQotICAgICAgICAgICAgICAgICAgICBhcHByb3hPbmVUaGlyZCA9ICh3MSAqIEZBQ1RPUikgPj4gc2hpZnQ7Ci0KLQotICAgICAgICAgICAgICAgICAgICB4MSA9IGluZGV4ICogU1BBQ0lORzsKLSAgICAgICAgICAgICAgICAgICAgdzIgPSBpbnZlcnNlUXVhbnRUYWJsZVtpbmRleCsxXTsKLQotICAgICAgICAgICAgICAgICAgICBkZWx0YU9uZVRoaXJkID0gKHcyIC0gdzEpICogKGFic1ggLSB4MSk7Ci0KLSAgICAgICAgICAgICAgICAgICAgZGVsdGFPbmVUaGlyZCA+Pj0gKHNoaWZ0ICsgT1JERVIgLSAxKTsKLQotICAgICAgICAgICAgICAgICAgICB0bXBfY29lZiA9IHggKiAoYXBwcm94T25lVGhpcmQgKyBkZWx0YU9uZVRoaXJkKTsKLQotICAgICAgICAgICAgICAgIEVORElGCi0KLSAgICAgICAgICAgICAgICBiX2xvdyAgPSAobXVsdF9oaWdoICYgMHhGRkZGKTsKLSAgICAgICAgICAgICAgICBiX2hpZ2ggPSAobXVsdF9oaWdoID4+IDE2KTsKLQotICAgICAgICAgICAgICAgIG11bHRfbG93ICA9ICggKFVJbnQzMikgYl9sb3cgKiBzY2FsZSApOwotICAgICAgICAgICAgICAgIG11bHRfaGlnaCA9ICggKEludDMyKSBiX2hpZ2ggKiBzY2FsZSApOwotCi0gICAgICAgICAgICAgICAgbXVsdF9sb3cgPj49IDE2OwotCi0gICAgICAgICAgICAgICAgY29lZltpXSAgPSAoSW50MzIpIChtdWx0X2hpZ2ggKyBtdWx0X2xvdyk7Ci0KLSAgICAgICAgICAgIEVOREZPUgotICAgICAgICBFTkRJRgotICAgIEVORElGCi0KLSAgICBSRVRVUk4KLQotCi0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0KLSBSRVNPVVJDRVMgVVNFRAotICAgV2hlbiB0aGUgY29kZSBpcyB3cml0dGVuIGZvciBhIHNwZWNpZmljIHRhcmdldCBwcm9jZXNzb3IgdGhlCi0gICAgIHRoZSByZX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KFBWX0FSTV9HQ0NfVjQpKQotCi0vKgotICogIEFic29sdXRlIHZhbHVlIGZvciAxNiBiaXQtbnVtYmVycwotICovCi1fX2lubGluZSBJbnQzMiBhYnMyKEludDMyIHgpCi17Ci0gICAgcmVnaXN0ZXIgSW50MzIgejsKLSAgICByZWdpc3RlciBJbnQzMiB5OwotICAgIHJlZ2lzdGVyIEludDMyIHJhID0geDsKLSAgICBhc20gdm9sYXRpbGUoCi0gICAgICAgICJzdWIgICUwLCAlMiwgJTIsIGxzciAjMzFcblx0IgotICAgICAgICAiZW9yICAlMSwgJTAsICUwLCBhc3IgIzMxIgotICAgIDogIj0mcippIih6KSwKLSAgICAgICAgIj0mcippIih5KQotICAgICAgICAgICAgICAgIDogInIiKHJhKSk7Ci0KLSAgICByZXR1cm4gKHkpOwotfQotCi0jZGVmaW5lIHB2X2Ficyh4KSAgIGFiczIoeCkKLQotCi0jZWxzZQotCi0jZGVmaW5lIHB2X2Ficyh4KSAgICgoeCkgPiAwKT8gKHgpIDogKC14KQotCi0jZW5kaWYKLQotCi0KLQotCi12b2lkIGVzY19pcXVhbnRfc2NhbGluZygKLSAgICBjb25zdCBJbnQxNiAgICAgcXVhbnRTcGVjW10sCi0gICAgSW50MzIgICAgICAgICBjb2VmW10sCi0gICAgY29uc3QgSW50ICAgICBzZmJXaWR0aCwKLSAgICBJbnQgY29uc3QgICAgICBRRm9ybWF0LAotICAgIFVJbnQxNiAgICAgICAgc2NhbGUsCi0gICAgSW50ICAgICAgICAgICBtYXhJbnB1dCkKLXsKLSAgICBJbnQgICAgaTsKLSAgICBJbnQgICAgeDsKLSAgICBJbnQgICAgeTsKLSAgICBJbnQgICAgaW5kZXg7Ci0gICAgSW50ICAgIHNoaWZ0OwotICAgIFVJbnQgICBhYnNYOwotICAgIFVJbnQzMiB3MSwgdzI7Ci0gICAgVUludDMyIGRlbHRhT25lVGhpcmQ7Ci0gICAgVUludDMyIHgxOwotICAgIFVJbnQzMiBhcHByb3hPbmVUaGly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Ci0KLSNlbHNlCi0gICAgcHZfbWVtc2V0KGNvZWYsIDAsIHNpemVvZihJbnQzMikgKiBzZmJXaWR0aCk7Ci0jZW5kaWYKLQotICAgIGlmIChtYXhJbnB1dCA+IDApCi0gICAgewotCi0gICAgICAgIHNoaWZ0ID0gUVRBQkxFIC0gUUZvcm1hdDsKLQotICAgICAgICBpZiAoc2NhbGUgIT0gMCkKLSAgICAgICAgewotICAgICAgICAgICAgaWYgKG1heElucHV0IDwgVEFCTEVTSVpFKQotICAgICAgICAgICAgewotCi0gICAgICAgICAgICAgICAgZm9yIChpID0gc2ZiV2lkdGggLSAxOyBpID49IDA7IGkgLT0gNCkKLSAgICAgICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgICAgIHggPSBxdWFudFNwZWNbaV07Ci0gICAgICAgICAgICAgICAgICAgIHkgPSBxdWFudFNwZWNbaS0xXTsKLSAgICAgICAgICAgICAgICAgICAgaWYgKHgpCi0gICAgICAgICAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAgICAgICAgIGFic1ggPSBwdl9hYnMoeCk7Ci0gICAgICAgICAgICAgICAgICAgICAgICBtdWx0X2hpZ2ggPSAoeCAqIChpbnZlcnNlUXVhbnRUYWJsZVthYnNYXSA+PiBzaGlmdCkpOwotICAgICAgICAgICAgICAgICAgICAgICAgY29lZltpXSA9IGZ4cF9tdWwzMl9ieV8xNihtdWx0X2hpZ2gsIHNjYWxlKSA8PCAxOwotICAgICAgICAgICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgICAgICAgICAgaWYgKHkpCi0gICAgICAgICAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAgICAgICAgIGFic1ggPSBwdl9hYnMoeSk7Ci0gICAgICAgICAgICAgICAgICAgICAgICBtdWx0X2hpZ2ggPSB5ICogKGludmVyc2VRdWFudFRhYmxlW2Fic1hdID4+IHNoaWZ0KTsKLSAgICAgICAgICAgICAgICAgICAgICAgIGNvZWZbaS0xXSA9IGZ4cF9tdWwzMl9ieV8xNihtdWx0X2hpZ2gsIHNjYWxlKSA8PCAxOwotICAgICAgICAgICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgICAgICAgICAgeCA9IHF1YW50U3BlY1tpLTJdOwotICAgICAgICAgICAgICAgICAgICB5ID0gcXVhbnRTcGVjW2ktM107Ci0gICAgICAgICAgICAgICAgICAgIGlmICh4KQotICAgICAgICAgICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgICAgICAgICBhYnNYID0gcHZfYWJzKHgpOwotICAgICAgICAgICAgICAgICAgICAgICAgbXVsdF9oaWdoID0geCAqIChpbnZlcnNlUXVhbnRUYWJsZVthYnNYXSA+PiBzaGlmdCk7Ci0gICAgICAgICAgICAgICAgICAgICAgICBjb2VmW2ktMl0gPSBmeHBfbXVsMzJfYnlfMTYobXVsdF9oaWdoLCBzY2FsZSkgPDwgMTsKLSAgICAgICAgICAgICAgICAgICAgfQotCi0gICAgICAgICAgICAgICAgICAgIGlmICh5KQotICAgICAgICAgICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgICAgICAgICBhYnNYID0gcHZfYWJzKHkpOwotICAgICAgICAgICAgICAgICAgICAgICAgbXVsdF9oaWdoID0geSAqIChpbnZlcnNlUXVhbnRUYWJsZVthYnNYXSA+PiBzaGlmdCk7Ci0gICAgICAgICAgICAgICAgICAgICAgICBjb2VmW2ktM10gPSBmeHBfbXVsMzJfYnlfMTYobXVsdF9oaWdoLCBzY2FsZSkgPDwgMTsKLSAgICAgICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgIH0gLyogZW5kIGZvciAoaSA9IHNmYldpZHRoIC0gMTsgaSA+PSAwOyBpLS0pICovCi0KLSAgICAgICAgICAgIH0gLyogZW5kIGlmIChtYXhJbnB1dCA8IFRBQkxFU0laRSkqLwotCi0gICAgICAgICAgICBlbHNlIC8qIG1heElucHV0ID49IFRBQkxFU0laRSkgKi8KLSAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICBmb3IgKGkgPSBzZmJXaWR0aCAtIDE7IGkgPj0gMDsgaSAtPSA0KQotICAgICAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAgICAgeCAgICA9IHF1YW50U3BlY1tpXTsKLSAgICAgICAgICAgICAgICAgICAgaWYgKHgpCi0gICAgICAgICAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAgICAgICAgIGFic1ggPSBwdl9hYnMoeCk7Ci0gICAgICAgICAgICAgICAgICAgICAgICBpZiAoYWJzWCA8IFRBQkxFU0laRSkKLSAgICAgICAgICAgICAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBtdWx0X2hpZ2ggPSB4ICogKGludmVyc2VRdWFudFRhYmxlW2Fic1hdID4+IHNoaWZ0KTsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb2VmW2ldID0gZnhwX211bDMyX2J5XzE2KG11bHRfaGlnaCwgc2NhbGUpIDw8IDE7Ci0KLSAgICAgICAgICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICAgICAgICAgIGVsc2UKLSAgICAgICAgICAgICAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBpbmRleCA9IGFic1ggPj4gT1JERVI7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgdzEgPSBpbnZlcnNlUXVhbnRUYWJsZVtpbmRleF07Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgdzIgPSBpbnZlcnNlUXVhbnRUYWJsZVtpbmRleCsxXTsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBhcHByb3hPbmVUaGlyZCA9ICh3MSAqIEZBQ1RPUikgPj4gc2hpZnQ7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgeDEgPSBpbmRleCA8PCBPUkRFUjsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBkZWx0YU9uZVRoaXJkID0gKHcyIC0gdzEpICogKGFic1ggLSB4MSk7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgZGVsdGFPbmVUaGlyZCA+Pj0gKHNoaWZ0ICsgMik7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgbXVsdF9oaWdoID0geCAqIChhcHByb3hPbmVUaGlyZCArIGRlbHRhT25lVGhpcmQpOwotICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvZWZbaV0gPSBmeHBfbXVsMzJfYnlfMTYobXVsdF9oaWdoLCBzY2FsZSkgPDwgMTsKLQotICAgICAgICAgICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgICAgICB9IC8qIGlmKHgpICovCi0KLQotICAgICAgICAgICAgICAgICAgICB4ICAgID0gcXVhbnRTcGVjW2ktMV07Ci0gICAgICAgICAgICAgICAgICAgIGlmICh4KQotICAgICAgICAgICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgICAgICAgICBhYnNYID0gcHZfYWJzKHgpOwotICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGFic1ggPCBUQUJMRVNJWkUpCi0gICAgICAgICAgICAgICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgbXVsdF9oaWdoID0gKHggKiAoaW52ZXJzZVF1YW50VGFibGVbYWJzWF0gPj4gc2hpZnQpKTsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb2VmW2ktMV0gPSBmeHBfbXVsMzJfYnlfMTYobXVsdF9oaWdoLCBzY2FsZSkgPDwgMTsKLQotICAgICAgICAgICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgICAgICAgICAgZWxzZQotICAgICAgICAgICAgICAgICAgICAgICAgewotICAgICAgICAgICAgICAgICAgICAgICAgICAgIGluZGV4ID0gYWJzWCA+PiBPUkRFUjsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICB3MSA9IGludmVyc2VRdWFudFRhYmxlW2luZGV4XTsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICB3MiA9IGludmVyc2VRdWFudFRhYmxlW2luZGV4KzFdOwotICAgICAgICAgICAgICAgICAgICAgICAgICAgIGFwcHJveE9uZVRoaXJkID0gKHcxICogRkFDVE9SKSA+PiBzaGlmdDsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICB4MSA9IGluZGV4IDw8IE9SREVSOwotICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRlbHRhT25lVGhpcmQgPSAodzIgLSB3MSkgKiAoYWJzWCAtIHgxKTsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBkZWx0YU9uZVRoaXJkID4+PSAoc2hpZnQgKyAyKTsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBtdWx0X2hpZ2ggPSB4ICogKGFwcHJveE9uZVRoaXJkICsgZGVsdGFPbmVUaGlyZCk7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgY29lZltpLTFdID0gZnhwX211bDMyX2J5XzE2KG11bHRfaGlnaCwgc2NhbGUpIDw8IDE7Ci0gICAgICAgICAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgICAgIH0gLyogaWYoeCkgKi8KLQotICAgICAgICAgICAgICAgICAgICB4ICAgID0gcXVhbnRTcGVjW2ktMl07Ci0gICAgICAgICAgICAgICAgICAgIGlmICh4KQotICAgICAgICAgICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgICAgICAgICBhYnNYID0gcHZfYWJzKHgpOwotICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGFic1ggPCBUQUJMRVNJWkUpCi0gICAgICAgICAgICAgICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgbXVsdF9oaWdoID0geCAqIChpbnZlcnNlUXVhbnRUYWJsZVthYnNYXSA+PiBzaGlmdCk7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgY29lZltpLTJdID0gZnhwX211bDMyX2J5XzE2KG11bHRfaGlnaCwgc2NhbGUpIDw8IDE7Ci0gICAgICAgICAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgICAgICAgICBlbHNlCi0gICAgICAgICAgICAgICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgaW5kZXggPSBhYnNYID4+IE9SREVSOwotICAgICAgICAgICAgICAgICAgICAgICAgICAgIHcxID0gaW52ZXJzZVF1YW50VGFibGVbaW5kZXhdOwotICAgICAgICAgICAgICAgICAgICAgICAgICAgIHcyID0gaW52ZXJzZVF1YW50VGFibGVbaW5kZXgrMV07Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgYXBwcm94T25lVGhpcmQgPSAodzEgKiBGQUNUT1IpID4+IHNoaWZ0OwotICAgICAgICAgICAgICAgICAgICAgICAgICAgIHgxID0gaW5kZXggPDwgT1JERVI7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgZGVsdGFPbmVUaGlyZCA9ICh3MiAtIHcxKSAqIChhYnNYIC0geDEpOwotICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRlbHRhT25lVGhpcmQgPj49IChzaGlmdCArIDIpOwotICAgICAgICAgICAgICAgICAgICAgICAgICAgIG11bHRfaGlnaCA9IHggKiAoYXBwcm94T25lVGhpcmQgKyBkZWx0YU9uZVRoaXJkKTsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb2VmW2ktMl0gPSBmeHBfbXVsMzJfYnlfMTYobXVsdF9oaWdoLCBzY2FsZSkgPDwgMTsKLSAgICAgICAgICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICAgICAgfSAvKiBpZih4KSAqLwotCi0gICAgICAgICAgICAgICAgICAgIHggICAgPSBxdWFudFNwZWNbaS0zXTsKLSAgICAgICAgICAgICAgICAgICAgaWYgKHgpCi0gICAgICAgICAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAgICAgICAgIGFic1ggPSBwdl9hYnMoeCk7Ci0gICAgICAgICAgICAgICAgICAgICAgICBpZiAoYWJzWCA8IFRBQkxFU0laRSkKLSAgICAgICAgICAgICAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBtdWx0X2hpZ2ggPSB4ICogKGludmVyc2VRdWFudFRhYmxlW2Fic1hdID4+IHNoaWZ0KTsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb2VmW2ktM10gPSBmeHBfbXVsMzJfYnlfMTYobXVsdF9oaWdoLCBzY2FsZSkgPDwgMTsKLQotICAgICAgICAgICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgICAgICAgICAgZWxzZQotICAgICAgICAgICAgICAgICAgICAgICAgewotICAgICAgICAgICAgICAgICAgICAgICAgICAgIGluZGV4ID0gYWJzWCA+PiBPUkRFUjsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICB3MSA9IGludmVyc2VRdWFudFRhYmxlW2luZGV4XTsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICB3MiA9IGludmVyc2VRdWFudFRhYmxlW2luZGV4KzFdOwotICAgICAgICAgICAgICAgICAgICAgICAgICAgIGFwcHJveE9uZVRoaXJkID0gKHcxICogRkFDVE9SKSA+PiBzaGlmdDsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICB4MSA9IGluZGV4IDw8IE9SREVSOwotICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRlbHRhT25lVGhpcmQgPSAodzIgLSB3MSkgKiAoYWJzWCAtIHgxKTsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBkZWx0YU9uZVRoaXJkID4+PSAoc2hpZnQgKyAyKTsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBtdWx0X2hpZ2ggPSB4ICogKGFwcHJveE9uZVRoaXJkICsgZGVsdGFPbmVUaGlyZCk7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgY29lZltpLTNdID0gZnhwX211bDMyX2J5XzE2KG11bHRfaGlnaCwgc2NhbGUpIDw8IDE7Ci0KLSAgICAgICAgICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICAgICAgfSAvKiBpZih4KSAqLwotCi0gICAgICAgICAgICAgICAgfSAgLyogZW5kIGZvciAoaSA9IHNmYldpZHRoIC0gMTsgaSA+PSAwOyBpLS0pICovCi0gICAgICAgICAgICB9IC8qIGVuZCBlbHNlIGZvciBpZiAobWF4SW5wdXQgPCBUQUJMRVNJWkUpKi8KLSAgICAgICAgfQotICAgICAgICBlbHNlIC8qIHNjYWxlID09IDAgKi8KLSAgICAgICAgewotICAgICAgICAgICAgaWYgKG1heElucHV0IDwgVEFCTEVTSVpFKQotICAgICAgICAgICAgewotICAgICAgICAgICAgICAgIGZvciAoaSA9IHNmYldpZHRoIC0gMTsgaSA+PSAwOyBpIC09IDQpCi0gICAgICAgICAgICAgICAgewotICAgICAgICAgICAgICAgICAgICB4ID0gcXVhbnRTcGVjW2ldOwotICAgICAgICAgICAgICAgICAgICB5ID0gcXVhbnRTcGVjW2ktMV07Ci0gICAgICAgICAgICAgICAgICAgIGlmICh4KQotICAgICAgICAgICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgICAgICAgICBhYnNYID0gcHZfYWJzKHgpOwotICAgICAgICAgICAgICAgICAgICAgICAgbXVsdF9oaWdoID0geCAqIChpbnZlcnNlUXVhbnRUYWJsZVthYnNYXSA+PiBzaGlmdCk7Ci0gICAgICAgICAgICAgICAgICAgICAgICBjb2VmW2ldID0gbXVsdF9oaWdoID4+IDE7Ci0gICAgICAgICAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgICAgICAgICBpZiAoeSkKLSAgICAgICAgICAgICAgICAgICAgewotICAgICAgICAgICAgICAgICAgICAgICAgYWJzWCA9IHB2X2Ficyh5KTsKLSAgICAgICAgICAgICAgICAgICAgICAgIG11bHRfaGlnaCA9IHkgKiAoaW52ZXJzZVF1YW50VGFibGVbYWJzWF0gPj4gc2hpZnQpOwotICAgICAgICAgICAgICAgICAgICAgICAgY29lZltpLTFdID0gbXVsdF9oaWdoID4+IDE7Ci0gICAgICAgICAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgICAgICAgICB4ID0gcXVhbnRTcGVjW2ktMl07Ci0gICAgICAgICAgICAgICAgICAgIHkgPSBxdWFudFNwZWNbaS0zXTsKLSAgICAgICAgICAgICAgICAgICAgaWYgKHgpCi0gICAgICAgICAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAgICAgICAgIGFic1ggPSBwdl9hYnMoeCk7Ci0gICAgICAgICAgICAgICAgICAgICAgICBtdWx0X2hpZ2ggPSB4ICogKGludmVyc2VRdWFudFRhYmxlW2Fic1hdID4+IHNoaWZ0KTsKLSAgICAgICAgICAgICAgICAgICAgICAgIGNvZWZbaS0yXSA9IG11bHRfaGlnaCA+PiAxOwotICAgICAgICAgICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgICAgICAgICAgaWYgKHkpCi0gICAgICAgICAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAgICAgICAgIGFic1ggPSBwdl9hYnMoeSk7Ci0gICAgICAgICAgICAgICAgICAgICAgICBtdWx0X2hpZ2ggPSB5ICogKGludmVyc2VRdWFudFRhYmxlW2Fic1hdID4+IHNoaWZ0KTsKLSAgICAgICAgICAgICAgICAgICAgICAgIGNvZWZbaS0zXSA9IG11bHRfaGlnaCA+PiAxOwotICAgICAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgfQotCi0gICAgICAgICAgICB9IC8qIGVuZCBpZiAobWF4SW5wdXQgPCBUQUJMRVNJWkUpKi8KLQotICAgICAgICAgICAgZWxzZSAvKiBtYXhJbnB1dCA+PSBUQUJMRVNJWkUpICovCi0gICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgZm9yIChpID0gc2ZiV2lkdGggLSAxOyBpID49IDA7IGkgLT0gNCkKLSAgICAgICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgICAgIHggICAgPSBxdWFudFNwZWNbaV07Ci0gICAgICAgICAgICAgICAgICAgIGlmICh4KQotICAgICAgICAgICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgICAgICAgICBhYnNYID0gcHZfYWJzKHgpOwotICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGFic1ggPCBUQUJMRVNJWkUpCi0gICAgICAgICAgICAgICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgbXVsdF9oaWdoID0geCAqIChpbnZlcnNlUXVhbnRUYWJsZVthYnNYXSA+PiBzaGlmdCk7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgY29lZltpXSA9IChtdWx0X2hpZ2ggPj4gMSk7Ci0gICAgICAgICAgICAgICAgICAgICAgICB9IC8qIGVuZCBpZiAoYWJzWCA8IFRBQkxFU0laRSkgKi8KLSAgICAgICAgICAgICAgICAgICAgICAgIGVsc2UKLSAgICAgICAgICAgICAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBpbmRleCA9IGFic1ggPj4gT1JERVI7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgdzEgPSBpbnZlcnNlUXVhbnRUYWJsZVtpbmRleF07Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgdzIgPSBpbnZlcnNlUXVhbnRUYWJsZVtpbmRleCsxXTsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBhcHByb3hPbmVUaGlyZCA9ICh3MSAqIEZBQ1RPUikgPj4gc2hpZnQ7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgeDEgPSBpbmRleCA8PCBPUkRFUjsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBkZWx0YU9uZVRoaXJkID0gKHcyIC0gdzEpICogKGFic1ggLSB4MSk7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgZGVsdGFPbmVUaGlyZCA+Pj0gKHNoaWZ0ICsgMik7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgbXVsdF9oaWdoID0geCAqIChhcHByb3hPbmVUaGlyZCArIGRlbHRhT25lVGhpcmQpOwotICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvZWZbaV0gPSAobXVsdF9oaWdoID4+IDEpOwotICAgICAgICAgICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgICAgICB9IC8qIGlmKHgpICovCi0KLSAgICAgICAgICAgICAgICAgICAgeCAgICA9IHF1YW50U3BlY1tpLTFdOwotICAgICAgICAgICAgICAgICAgICBpZiAoeCkKLSAgICAgICAgICAgICAgICAgICAgewotICAgICAgICAgICAgICAgICAgICAgICAgYWJzWCA9IHB2X2Ficyh4KTsKLSAgICAgICAgICAgICAgICAgICAgICAgIGlmIChhYnNYIDwgVEFCTEVTSVpFKQotICAgICAgICAgICAgICAgICAgICAgICAgewotICAgICAgICAgICAgICAgICAgICAgICAgICAgIG11bHRfaGlnaCA9IHggKiAoaW52ZXJzZVF1YW50VGFibGVbYWJzWF0gPj4gc2hpZnQpOwotICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvZWZbaS0xXSA9IChtdWx0X2hpZ2ggPj4gMSk7Ci0gICAgICAgICAgICAgICAgICAgICAgICB9IC8qIGVuZCBpZiAoYWJzWCA8IFRBQkxFU0laRSkgKi8KLSAgICAgICAgICAgICAgICAgICAgICAgIGVsc2UKLSAgICAgICAgICAgICAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBpbmRleCA9IGFic1ggPj4gT1JERVI7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgdzEgPSBpbnZlcnNlUXVhbnRUYWJsZVtpbmRleF07Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgdzIgPSBpbnZlcnNlUXVhbnRUYWJsZVtpbmRleCsxXTsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBhcHByb3hPbmVUaGlyZCA9ICh3MSAqIEZBQ1RPUikgPj4gc2hpZnQ7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgeDEgPSBpbmRleCA8PCBPUkRFUjsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBkZWx0YU9uZVRoaXJkID0gKHcyIC0gdzEpICogKGFic1ggLSB4MSk7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgZGVsdGFPbmVUaGlyZCA+Pj0gKHNoaWZ0ICsgMik7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgbXVsdF9oaWdoID0geCAqIChhcHByb3hPbmVUaGlyZCArIGRlbHRhT25lVGhpcmQpOwotICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvZWZbaS0xXSA9IChtdWx0X2hpZ2ggPj4gMSk7Ci0gICAgICAgICAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgICAgIH0gLyogaWYoeCkgKi8KLQotICAgICAgICAgICAgICAgICAgICB4ICAgID0gcXVhbnRTcGVjW2ktMl07Ci0gICAgICAgICAgICAgICAgICAgIGlmICh4KQotICAgICAgICAgICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgICAgICAgICBhYnNYID0gcHZfYWJzKHgpOwotICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGFic1ggPCBUQUJMRVNJWkUpCi0gICAgICAgICAgICAgICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgbXVsdF9oaWdoID0geCAqIChpbnZlcnNlUXVhbnRUYWJsZVthYnNYXSA+PiBzaGlmdCk7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgY29lZltpLTJdID0gKG11bHRfaGlnaCA+PiAxKTsKLSAgICAgICAgICAgICAgICAgICAgICAgIH0gLyogZW5kIGlmIChhYnNYIDwgVEFCTEVTSVpFKSAqLwotICAgICAgICAgICAgICAgICAgICAgICAgZWxzZQotICAgICAgICAgICAgICAgICAgICAgICAgewotICAgICAgICAgICAgICAgICAgICAgICAgICAgIGluZGV4ID0gYWJzWCA+PiBPUkRFUjsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICB3MSA9IGludmVyc2VRdWFudFRhYmxlW2luZGV4XTsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICB3MiA9IGludmVyc2VRdWFudFRhYmxlW2luZGV4KzFdOwotICAgICAgICAgICAgICAgICAgICAgICAgICAgIGFwcHJveE9uZVRoaXJkID0gKHcxICogRkFDVE9SKSA+PiBzaGlmdDsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICB4MSA9IGluZGV4IDw8IE9SREVSOwotICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRlbHRhT25lVGhpcmQgPSAodzIgLSB3MSkgKiAoYWJzWCAtIHgxKTsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBkZWx0YU9uZVRoaXJkID4+PSAoc2hpZnQgKyAyKTsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBtdWx0X2hpZ2ggPSB4ICogKGFwcHJveE9uZVRoaXJkICsgZGVsdGFPbmVUaGlyZCk7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgY29lZltpLTJdID0gKG11bHRfaGlnaCA+PiAxKTsKLSAgICAgICAgICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICAgICAgfSAvKiBpZih4KSAqLwotCi0gICAgICAgICAgICAgICAgICAgIHggICAgPSBxdWFudFNwZWNbaS0zXTsKLSAgICAgICAgICAgICAgICAgICAgaWYgKHgpCi0gICAgICAgICAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAgICAgICAgIGFic1ggPSBwdl9hYnMoeCk7Ci0gICAgICAgICAgICAgICAgICAgICAgICBpZiAoYWJzWCA8IFRBQkxFU0laRSkKLSAgICAgICAgICAgICAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBtdWx0X2hpZ2ggPSB4ICogKGludmVyc2VRdWFudFRhYmxlW2Fic1hdID4+IHNoaWZ0KTsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb2VmW2ktM10gPSAobXVsdF9oaWdoID4+IDEpOwotICAgICAgICAgICAgICAgICAgICAgICAgfSAvKiBlbmQgaWYgKGFic1ggPCBUQUJMRVNJWkUpICovCi0gICAgICAgICAgICAgICAgICAgICAgICBlbHNlCi0gICAgICAgICAgICAgICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgaW5kZXggPSBhYnNYID4+IE9SREVSOwotICAgICAgICAgICAgICAgICAgICAgICAgICAgIHcxID0gaW52ZXJzZVF1YW50VGFibGVbaW5kZXhdOwotICAgICAgICAgICAgICAgICAgICAgICAgICAgIHcyID0gaW52ZXJzZVF1YW50VGFibGVbaW5kZXgrMV07Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgYXBwcm94T25lVGhpcmQgPSAodzEgKiBGQUNUT1IpID4+IHNoaWZ0OwotICAgICAgICAgICAgICAgICAgICAgICAgICAgIHgxID0gaW5kZXggPDwgT1JERVI7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgZGVsdGFPbmVUaGlyZCA9ICh3MiAtIHcxKSAqIChhYnNYIC0geDEpOwotICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRlbHRhT25lVGhpcmQgPj49IChzaGlmdCArIDIpOwotICAgICAgICAgICAgICAgICAgICAgICAgICAgIG11bHRfaGlnaCA9IHggKiAoYXBwcm94T25lVGhpcmQgKyBkZWx0YU9uZVRoaXJkKTsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb2VmW2ktM10gPSAobXVsdF9oaWdoID4+IDEpOwotICAgICAgICAgICAgICAgICAgICAgICAgfQotCi0gICAgICAgICAgICAgICAgICAgIH0gLyogaWYoeCkgKi8KLQotICAgICAgICAgICAgICAgIH0gIC8qIGVuZCBmb3IgKGkgPSBzZmJXaWR0aCAtIDE7IGkgPj0gMDsgaS0tKSAqLwotCi0gICAgICAgICAgICB9IC8qIGVuZCBlbHNlIGZvciBpZiAobWF4SW5wdXQgPCBUQUJMRVNJWkUpKi8KLQotICAgICAgICB9IC8qIGVuZCBlbHNlIGZvciBpZihzY2FsZSE9MCkgKi8KLQotICAgIH0gIC8qIGVuZCBlbHNlIGZvciBpZihtYXhJbnB1dCA9PSAwKSAqLwotCi19IC8qIGVuZCBlc2NfaXF1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GZyYW1lQ2xhc3MpCi0gICAgewotCi0gICAgICAgIGNhc2UgRklYRklYOgotICAgICAgICAgICAgdGVtcCA9IGJ1Zl9nZXRiaXRzKGhCaXRCdWYsIFNCUl9FTlZfQklUUyk7ICAgLyogMiBiaXRzICovCi0KLSAgICAgICAgICAgIGJzX251bV9lbnYgPSAxIDw8IHRlbXA7Ci0KLQotICAgICAgICAgICAgZlswXSA9IGJ1Zl9nZXRiaXRzKGhCaXRCdWYsIFNCUl9SRVNfQklUUyk7ICAgLyogMSBiaXQgKi8KLQotICAgICAgICAgICAgZm9yIChlbnYgPSAxOyBlbnYgPCBic19udW1fZW52OyBlbnYrKykKLSAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICBmW2Vudl0gPSBmWzBdOwotICAgICAgICAgICAgfQotCi0gICAgICAgICAgICBuUmVsTGVhZCAgICAgPSBic19udW1fZW52IC0gMTsKLSAgICAgICAgICAgIGFic0JvcmRUcmFpbCAgPSAxNjsKLQotCi0gICAgICAgICAgICBicmVhazsKLQotICAgICAgICBjYXNlIEZJWFZBUjoKLSAgICAgICAgICAgIGJzX3Zhcl9ib3JkID0gYnVmX2dldGJpdHMoaEJpdEJ1ZiwgU0JSX0FCU19CSVRTKTsgICAvKiAyIGJpdHMgKi8KLSAgICAgICAgICAgIGJzX251bV9yZWwgID0gYnVmX2dldGJpdHMoaEJpdEJ1ZiwgU0JSX05VTV9CSVRTKTsgICAvKiAyIGJpdHMgKi8KLSAgICAgICAgICAgIGJzX251bV9lbnYgID0gYnNfbnVtX3JlbCArIDE7Ci0KLSAgICAgICAgICAgIGZvciAoayA9IDA7IGsgPCBic19udW1fZW52IC0gMTsgaysrKQotICAgICAgICAgICAgewotICAgICAgICAgICAgICAgIGJzX3JlbF9ib3JkW2tdID0gKGJ1Zl9nZXRiaXRzKGhCaXRCdWYsIFNCUl9SRUxfQklUUykgKyAxKSA8PCAxOwotICAgICAgICAgICAgfQotCi0gICAgICAgICAgICBic19wb2ludGVyX2JpdHMgPSBic19wb2ludGVyX2JpdHNfdGJsW2JzX251bV9lbnZdOwotCi0gICAgICAgICAgICBic19wb2ludGVyID0gYnVmX2dldGJpdHMoaEJpdEJ1ZiwgYnNfcG9pbnRlcl9iaXRzKTsKLQotICAgICAgICAgICAgZm9yIChlbnYgPSAwOyBlbnYgPCBic19udW1fZW52OyBlbnYrKykKLSAgICAgICAgICAgIHsgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLyogMSBiaXQgKi8KLSAgICAgICAgICAgICAgICBmW2JzX251bV9lbnYgLSAxIC0gZW52XSA9IGJ1Zl9nZXRiaXRzKGhCaXRCdWYsIFNCUl9SRVNfQklUUyk7Ci0gICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgIGFic0JvcmRUcmFpbCAgPSAxNiArIGJzX3Zhcl9ib3JkOwotICAgICAgICAgICAgblJlbFRyYWlsICAgICA9IGJzX251bV9yZWw7Ci0KLSAgICAgICAgICAgIGJyZWFrOwotCi0gICAgICAgIGNhc2UgVkFSRklYOgotICAgICAgICAgICAgYnNfdmFyX2JvcmQgPSBidWZfZ2V0Yml0cyhoQml0QnVmLCBTQlJfQUJTX0JJVFMpOyAgIC8qIDIgYml0cyAqLwotICAgICAgICAgICAgYnNfbnVtX3JlbCAgPSBidWZfZ2V0Yml0cyhoQml0QnVmLCBTQlJfTlVNX0JJVFMpOyAgIC8qIDIgYml0cyAqLwotICAgICAgICAgICAgYnNfbnVtX2VudiAgPSBic19udW1fcmVsICsgMTsKLQotICAgICAgICAgICAgZm9yIChrID0gMDsgayA8IGJzX251bV9lbnYgLSAxOyBrKyspCi0gICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgYnNfcmVsX2JvcmRba10gPSAoYnVmX2dldGJpdHMoaEJpdEJ1ZiwgU0JSX1JFTF9CSVRTKSArIDEpIDw8IDE7Ci0gICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgIGJzX3BvaW50ZXJfYml0cyA9IGJzX3BvaW50ZXJfYml0c190YmxbYnNfbnVtX2Vudl07Ci0KLSAgICAgICAgICAgIGJzX3BvaW50ZXIgPSBidWZfZ2V0Yml0cyhoQml0QnVmLCBic19wb2ludGVyX2JpdHMpOwotCi0gICAgICAgICAgICBmb3IgKGVudiA9IDA7IGVudiA8IGJzX251bV9lbnY7IGVudisrKQotICAgICAgICAgICAgeyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvKiAxIGJpdCAqLwotICAgICAgICAgICAgICAgIGZbZW52XSA9IGJ1Zl9nZXRiaXRzKGhCaXRCdWYsIFNCUl9SRVNfQklUUyk7Ci0gICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgIGFic0JvcmRUcmFpbCA9IDE2OwotICAgICAgICAgICAgYWJzQm9yZExlYWQgID0gYnNfdmFyX2JvcmQ7Ci0gICAgICAgICAgICBuUmVsTGVhZCAgICAgPSBic19udW1fcmVsOwotCi0gICAgICAgICAgICBicmVhazsKLQotICAgICAgICBjYXNlIFZBUlZBUjoKLSAgICAgICAgICAgIGJzX3Zhcl9ib3JkXzAgPSBidWZfZ2V0Yml0cyhoQml0QnVmLCBTQlJfQUJTX0JJVFMpOyAgIC8qIDIgYml0cyAqLwotICAgICAgICAgICAgYnNfdmFyX2JvcmRfMSA9IGJ1Zl9nZXRiaXRzKGhCaXRCdWYsIFNCUl9BQlNfQklUUyk7Ci0gICAgICAgICAgICBic19udW1fcmVsXzAgID0gYnVmX2dldGJpdHMoaEJpdEJ1ZiwgU0JSX05VTV9CSVRTKTsgICAvKiAyIGJpdHMgKi8KLSAgICAgICAgICAgIGJzX251bV9yZWxfMSAgPSBidWZfZ2V0Yml0cyhoQml0QnVmLCBTQlJfTlVNX0JJVFMpOwotCi0gICAgICAgICAgICBic19udW1fZW52ID0gYnNfbnVtX3JlbF8wICsgYnNfbnVtX3JlbF8xICsgMTsKLQotICAgICAgICAgICAgZm9yIChrID0gMDsgayA8IGJzX251bV9yZWxfMDsgaysrKQotICAgICAgICAgICAgeyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvKiAyIGJpdHMgKi8KLSAgICAgICAgICAgICAgICBic19yZWxfYm9yZF8wW2tdID0gKGJ1Zl9nZXRiaXRzKGhCaXRCdWYsIFNCUl9SRUxfQklUUykgKyAxKSA8PCAxOwotICAgICAgICAgICAgfQotCi0gICAgICAgICAgICBmb3IgKGsgPSAwOyBrIDwgYnNfbnVtX3JlbF8xOyBrKyspCi0gICAgICAgICAgICB7ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8qIDIgYml0cyAqLwotICAgICAgICAgICAgICAgIGJzX3JlbF9ib3JkXzFba10gPSAoYnVmX2dldGJpdHMoaEJpdEJ1ZiwgU0JSX1JFTF9CSVRTKSArIDEpIDw8IDE7Ci0gICAgICAgICAgICB9Ci0KLQotICAgICAgICAgICAgYnNfcG9pbnRlcl9iaXRzID0gYnNfcG9pbnRlcl9iaXRzX3RibFtic19udW1fZW52XTsKLQotICAgICAgICAgICAgYnNfcG9pbnRlciA9IGJ1Zl9nZXRiaXRzKGhCaXRCdWYsIGJzX3BvaW50ZXJfYml0cyk7Ci0KLSAgICAgICAgICAgIGZvciAoZW52ID0gMDsgZW52IDwgYnNfbnVtX2VudjsgZW52KyspCi0gICAgICAgICAgICB7ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8qIDEgYml0ICovCi0gICAgICAgICAgICAgICAgZltlbnZdID0gYnVmX2dldGJpdHMoaEJpdEJ1ZiwgU0JSX1JFU19CSVRTKTsKLSAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgYWJzQm9yZExlYWQgICA9IGJzX3Zhcl9ib3JkXzA7Ci0gICAgICAgICAgICBhYnNCb3JkVHJhaWwgID0gMTYgKyBic192YXJfYm9yZF8xOwotICAgICAgICAgICAgblJlbExlYWQgICAgICA9IGJzX251bV9yZWxfMDsKLSAgICAgICAgICAgIG5SZWxUcmFpbCAgICAgPSBic19udW1fcmVsXzE7Ci0KLSAgICAgICAgICAgIGJyZWFrOwotCi0gICAgfTsKLQotCi0gICAgLyoKLSAgICAgKiBDYWxjdWxhdGUgdGhlIGZyYW1pbmcuCi0gICAgICovCi0KLQotICAgIHN3aXRjaCAoZnJhbWVDbGFzcykKLSAgICB7Ci0gICAgICAgIGNhc2UgRklYRklYOgotICAgICAgICAgICAgZm9yIChrID0gMDsgayA8IG5SZWxMZWFkOyBrKyspCi0gICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgcmVsQm9yZExlYWRba10gPSBUXzE2X292X2JzX251bV9lbnZfdGJsW2JzX251bV9lbnZdOwotICAgICAgICAgICAgfQotICAgICAgICAgICAgYnJlYWs7Ci0gICAgICAgIGNhc2UgVkFSRklYOgotICAgICAgICAgICAgZm9yIChrID0gMDsgayA8IG5SZWxMZWFkOyBrKyspCi0gICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgcmVsQm9yZExlYWRba10gPSBic19yZWxfYm9yZFtrXTsKLSAgICAgICAgICAgIH0KLSAgICAgICAgICAgIGJyZWFrOwotICAgICAgICBjYXNlIFZBUlZBUjoKLSAgICAgICAgICAgIGZvciAoayA9IDA7IGsgPCBuUmVsTGVhZDsgaysrKQotICAgICAgICAgICAgewotICAgICAgICAgICAgICAgIHJlbEJvcmRMZWFkW2tdID0gYnNfcmVsX2JvcmRfMFtrXTsKLSAgICAgICAgICAgIH0KLSAgICAgICAgICAgIGZvciAoayA9IDA7IGsgPCBuUmVsVHJhaWw7IGsrKykKLSAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICByZWxCb3JkVHJhaWxba10gPSBic19yZWxfYm9yZF8xW2tdOwotICAgICAgICAgICAgfQotICAgICAgICAgICAgYnJlYWs7Ci0gICAgICAgIGNhc2UgRklYVkFSOgotICAgICAgICAgICAgZm9yIChrID0gMDsgayA8IG5SZWxUcmFpbDsgaysrKQotICAgICAgICAgICAgewotICAgICAgICAgICAgICAgIHJlbEJvcmRUcmFpbFtrXSA9IGJzX3JlbF9ib3JkW2tdOwotICAgICAgICAgICAgfQotICAgICAgICAgICAgYnJlYWs7Ci0gICAgfQotCi0KLSAgICB0RVswXSAgICAgICAgICA9IGFic0JvcmRMZWFkOwotICAgIHRFW2JzX251bV9lbnZdID0gYWJzQm9yZFRyYWlsOwotCi0gICAgZm9yIChlbnYgPSAxOyBlbnYgPD0gblJlbExlYWQ7IGVudisrKQotICAgIHsKLSAgICAgICAgdEVbZW52XSA9IGFic0JvcmRMZWFkOwotICAgICAgICBmb3IgKGsgPSAwOyBrIDw9IGVudiAtIDE7IGsrKykKLSAgICAgICAgewotICAgICAgICAgICAgdEVbZW52XSArPSByZWxCb3JkTGVhZFtrXTsKLSAgICAgICAgfQotICAgIH0KLQotICAgIGZvciAoZW52ID0gblJlbExlYWQgKyAxOyBlbnYgPCBic19udW1fZW52OyBlbnYrKykKLSAgICB7Ci0gICAgICAgIHRFW2Vudl0gPSBhYnNCb3JkVHJhaWw7Ci0gICAgICAgIGZvciAoayA9IDA7IGsgPD0gYnNfbnVtX2VudiAtIGVudiAtIDE7IGsrKykKLSAgICAgICAgewotICAgICAgICAgICAgdEVbZW52XSAtPSByZWxCb3JkVHJhaWxba107Ci0gICAgICAgIH0KLSAgICB9Ci0KLQotCi0gICAgc3dpdGNoIChmcmFtZUNsYXNzKQotICAgIHsKLSAgICAgICAgY2FzZSAgRklYRklYOgotICAgICAgICAgICAgbWlkZGxlQm9yZGVyID0gYnNfbnVtX2VudiA+PiAxOwotICAgICAgICAgICAgYnJlYWs7Ci0gICAgICAgIGNhc2UgVkFSRklYOgotICAgICAgICAgICAgc3dpdGNoIChic19wb2ludGVyKQotICAgICAgICAgICAgewotICAgICAgICAgICAgICAgIGNhc2UgMDoKLSAgICAgICAgICAgICAgICAgICAgbWlkZGxlQm9yZGVyID0gMTsKLSAgICAgICAgICAgICAgICAgICAgYnJlYWs7Ci0gICAgICAgICAgICAgICAgY2FzZSAxOgotICAgICAgICAgICAgICAgICAgICBtaWRkbGVCb3JkZXIgPSBic19udW1fZW52IC0gMTsKLSAgICAgICAgICAgICAgICAgICAgYnJlYWs7Ci0gICAgICAgICAgICAgICAgZGVmYXVsdDoKLSAgICAgICAgICAgICAgICAgICAgbWlkZGxlQm9yZGVyID0gYnNfcG9pbnRlciAtIDE7Ci0gICAgICAgICAgICAgICAgICAgIGJyZWFrOwotICAgICAgICAgICAgfTsKLSAgICAgICAgICAgIGJyZWFrOwotICAgICAgICBjYXNlIEZJWFZBUjoKLSAgICAgICAgY2FzZSBWQVJWQVI6Ci0gICAgICAgICAgICBzd2l0Y2ggKGJzX3BvaW50ZXIpCi0gICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgY2FzZSAwOgotICAgICAgICAgICAgICAgIGNhc2UgMToKLSAgICAgICAgICAgICAgICAgICAgbWlkZGxlQm9yZGVyID0gYnNfbnVtX2VudiAtIDE7Ci0gICAgICAgICAgICAgICAgICAgIGJyZWFrOwotICAgICAgICAgICAgICAgIGRlZmF1bHQ6Ci0gICAgICAgICAgICAgICAgICAgIG1pZGRsZUJvcmRlciA9IGJzX251bV9lbnYgKyAxIC0gYnNfcG9pbnRlcjsKLSAgICAgICAgICAgICAgICAgICAgYnJlYWs7Ci0gICAgICAgICAgICB9OwotICAgICAgICAgICAgYnJlYWs7Ci0gICAgfTsKLQotCi0gICAgdFFbMF0gPSB0RVswXTsKLSAgICBpZiAoYnNfbnVtX2VudiA+IDEpCi0gICAgewotICAgICAgICB0UVsxXSA9IHRFW21pZGRsZUJvcmRlcl07Ci0gICAgICAgIHRRWzJdID0gdEVbYnNfbnVtX2Vudl07Ci0gICAgICAgIGJzX251bV9ub2lzZSA9IDI7Ci0gICAgfQotICAgIGVsc2UKLSAgICB7Ci0gICAgICAgIHRRWzFdID0gdEVbYnNfbnVtX2Vudl07Ci0gICAgICAgIGJzX251bV9ub2lzZSA9IDE7Ci0gICAgfQotCi0gICAgLyoKLSAgICAgKiAgQ2hlY2sgY29uc2lzdGVuY3kgb24gZnJlcSBiYW5kcwotICAgICAqLwotCi0gICAgaWYgKCh0RVtic19udW1fZW52XSA8IHRFWzBdKSB8fCAodEVbMF0gPCAwKSkKLSAgICB7Ci0gICAgICAgIGVyciA9IFNCUkRFQ19JTlZBTElEX0JJVFNUUkVBTTsKLSAgICB9Ci0KLQotICAgIHN3aXRjaCAoZnJhbWVDbGFzcykKLSAgICB7Ci0gICAgICAgIGNhc2UgIEZJWEZJWDoKLSAgICAgICAgICAgIGxBID0gLTE7Ci0gICAgICAgICAgICBicmVhazsKLSAgICAgICAgY2FzZSBWQVJGSVg6Ci0gICAgICAgICAgICBzd2l0Y2ggKGJzX3BvaW50ZXIpCi0gICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgY2FzZSAwOgotICAgICAgICAgICAgICAgIGNhc2UgMToKLSAgICAgICAgICAgICAgICAgICAgbEEgPSAtMTsKLSAgICAgICAgICAgICAgICAgICAgYnJlYWs7Ci0gICAgICAgICAgICAgICAgZGVmYXVsdDoKLSAgICAgICAgICAgICAgICAgICAgbEEgPSBic19wb2ludGVyIC0gMTsKLSAgICAgICAgICAgICAgICAgICAgYnJlYWs7Ci0gICAgICAgICAgICB9OwotICAgICAgICAgICAgYnJlYWs7Ci0gICAgICAgIGNhc2UgRklYVkFSOgotICAgICAgICBjYXNlIFZBUlZBUjoKLSAgICAgICAgICAgIHN3aXRjaCAoYnNfcG9pbnRlcikKLSAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICBjYXNlIDA6Ci0gICAgICAgICAgICAgICAgICAgIGxBID0gLSAxOwotICAgICAgICAgICAgICAgICAgICBicmVhazsKLSAgICAgICAgICAgICAgICBkZWZhdWx0OgotICAgICAgICAgICAgICAgICAgICBsQSA9IGJzX251bV9lbnYgKyAxIC0gYnNfcG9pbnRlcjsKLSAgICAgICAgICAgICAgICAgICAgYnJlYWs7Ci0gICAgICAgICAgICB9OwotICAgICAgICAgICAgYnJlYWs7Ci0gICAgfTsK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S0tLS0tLS0tLS0tLS0tLS0qLwotCi0KLXZvaWQgZmZ0X3J4NF9sb25nKAotICAgIEludDMyICAgICAgRGF0YVtdLAotICAgIEludDMyICAgICAgKnBlYWtfdmFsdWUpCi0KLXsKLSAgICBJbnQgICAgIG4xOwotICAgIEludCAgICAgbjI7Ci0gICAgSW50ICAgICBqOwotICAgIEludCAgICAgazsKLSAgICBJbnQgICAgIGk7Ci0KLSAgICBJbnQzMiAgIHQxOwotICAgIEludDMyICAgdDI7Ci0gICAgSW50MzIgICByMTsKLSAgICBJbnQzMiAgIHIyOwotICAgIEludDMyICAgcjM7Ci0gICAgSW50MzIgICByNDsKLSAgICBJbnQzMiAgIHMxOwotICAgIEludDMyICAgczI7Ci0gICAgSW50MzIgICBzMzsKLSAgICBJbnQzMiAgICpwRGF0YTE7Ci0gICAgSW50MzIgICAqcERhdGEyOwotICAgIEludDMyICAgKnBEYXRhMzsKLSAgICBJbnQzMiAgICpwRGF0YTQ7Ci0gICAgSW50MzIgICB0ZW1wMTsKLSAgICBJbnQzMiAgIHRlbXAyOwotICAgIEludDMyICAgdGVtcDM7Ci0gICAgSW50MzIgICB0ZW1wNDsKLSAgICBJbnQzMiAgIG1heDsKLQotICAgIEludDMyICAgZXhwX2p3MTsKLSAgICBJbnQzMiAgIGV4cF9qdzI7Ci0gICAgSW50MzIgICBleHBfanczOwotCi0KLQotICAgIGNvbnN0IEludDMyICAqcHcgPSBXXzI1NnJ4NDsKLQotICAgIG4yID0gRkZUX1JYNF9MT05HOwotCi0gICAgZm9yIChrID0gRkZUX1JYNF9MT05HOyBrID4gNDsgayA+Pj0gMikKLSAgICB7Ci0KLSAgICAgICAgbjEgPSBuMjsKLSAgICAgICAgbjIgPj49IDI7Ci0KLSAgICAgICAgZm9yIChpID0gMDsgaSA8IEZGVF9SWDRfTE9ORzsgaSArPSBuMSkKLSAgICAgICAgewotICAgICAgICAgICAgcERhdGExID0gJkRhdGFbIGk8PDFdOwotICAgICAgICAgICAgcERhdGEyID0gcERhdGExICsgbjE7Ci0KLSAgICAgICAgICAgIHRlbXAxICAgPSAqcERhdGExOwotICAgICAgICAgICAgdGVtcDIgICA9ICpwRGF0YTI7Ci0KLSAgICAgICAgICAgIHIxICAgICAgPSB0ZW1wMSArIHRlbXAyOwotICAgICAgICAgICAgcjIgICAgICA9IHRlbXAxIC0gdGVtcDI7Ci0KLSAgICAgICAgICAgIHBEYXRhMyA9IHBEYXRhMSArIChuMSA+PiAxKTsKLSAgICAgICAgICAgIHBEYXRhNCA9IHBEYXRhMyArIG4xOwotICAgICAgICAgICAgdGVtcDMgICA9ICpwRGF0YTMrKzsKLSAgICAgICAgICAgIHRlbXA0ICAgPSAqcERhdGE0Kys7Ci0KLSAgICAgICAgICAgIHQxICAgICAgPSB0ZW1wMyArIHRlbXA0OwotCi0gICAgICAgICAgICAqKHBEYXRhMSsrKSA9IChyMSArIHQxKTsKLSAgICAgICAgICAgIHQyICAgICAgPSB0ZW1wMyAtIHRlbXA0OwotICAgICAgICAgICAgKihwRGF0YTIrKykgPSAocjEgLSB0MSk7Ci0KLSAgICAgICAgICAgIHRlbXAxICAgPSAqcERhdGExOwotICAgICAgICAgICAgdGVtcDIgICA9ICpwRGF0YTI7Ci0KLSAgICAgICAgICAgIHMxICAgICAgPSB0ZW1wMSArIHRlbXAyOwotICAgICAgICAgICAgdGVtcDMgICA9ICpwRGF0YTM7Ci0gICAgICAgICAgICBzMiAgICAgID0gdGVtcDEgLSB0ZW1wMjsKLSAgICAgICAgICAgIHRlbXA0ICAgPSAqcERhdGE0OwotICAgICAgICAgICAgKnBEYXRhMy0tICA9IChzMiAtIHQyKTsKLSAgICAgICAgICAgICpwRGF0YTQtLSAgPSAoczIgKyB0Mik7Ci0KLSAgICAgICAgICAgIHQxICAgICAgPSB0ZW1wMyArIHRlbXA0OwotCi0gICAgICAgICAgICAqcERhdGExICAgID0gKHMxICsgdDEpOwotICAgICAgICAgICAgKnBEYXRhMiAgICA9IChzMSAtIHQxKTsKLQotICAgICAgICAgICAgcjEgICAgICA9IHRlbXAzIC0gdGVtcDQ7Ci0KLSAgICAgICAgICAgICpwRGF0YTQgICAgPSAocjIgLSByMSk7Ci0gICAgICAgICAgICAqcERhdGEzICAgID0gKHIyICsgcjEpOwotCi0gICAgICAgIH0gIC8qIGkgKi8KLQotCi0KLSAgICAgICAgZm9yIChqID0gMTsgaiA8IG4yOyBqKyspCi0gICAgICAgIHsKLQotICAgICAgICAgICAgZXhwX2p3MSA9ICgqcHcrKyk7Ci0gICAgICAgICAgICBleHBfancyID0gKCpwdysrKTsKLSAgICAgICAgICAgIGV4cF9qdzMgPSAoKnB3KyspOwotCi0KLSAgICAgICAgICAgIGZvciAoaSA9IGo7IGkgPCBGRlRfUlg0X0xPTkc7IGkgKz0gbjEpCi0gICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgcERhdGExID0gJkRhdGFbIGk8PDFdOwotICAgICAgICAgICAgICAgIHBEYXRhMiA9IHBEYXRhMSArIG4xOwotCi0gICAgICAgICAgICAgICAgdGVtcDEgICA9ICpwRGF0YTE7Ci0gICAgICAgICAgICAgICAgdGVtcDIgICA9ICpwRGF0YTIrKzsKLQotICAgICAgICAgICAgICAgIHIxICAgICAgPSB0ZW1wMSArIHRlbXAyOwotICAgICAgICAgICAgICAgIHIyICAgICAgPSB0ZW1wMSAtIHRlbXAyOwotCi0gICAgICAgICAgICAgICAgcERhdGEzID0gcERhdGExICsgKG4xID4+IDEpOwotICAgICAgICAgICAgICAgIHBEYXRhNCA9IHBEYXRhMyArIG4xOwotICAgICAgICAgICAgICAgIHRlbXAzICAgPSAqcERhdGEzKys7Ci0gICAgICAgICAgICAgICAgdGVtcDQgICA9ICpwRGF0YTQrKzsKLQotICAgICAgICAgICAgICAgIHIzICAgICAgPSB0ZW1wMyArIHRlbXA0OwotICAgICAgICAgICAgICAgIHI0ICAgICAgPSB0ZW1wMyAtIHRlbXA0OwotCi0gICAgICAgICAgICAgICAgKihwRGF0YTErKykgPSAocjEgKyByMyk7Ci0gICAgICAgICAgICAgICAgcjEgICAgICAgICAgPSAocjEgLSByMykgPDwgMTsKLQotICAgICAgICAgICAgICAgIHRlbXAyICAgPSAqcERhdGEyOwotICAgICAgICAgICAgICAgIHRlbXAxICAgPSAqcERhdGExOwotCi0gICAgICAgICAgICAgICAgczEgICAgICA9IHRlbXAxICsgdGVtcDI7Ci0gICAgICAgICAgICAgICAgczIgICAgICA9IHRlbXAxIC0gdGVtcDI7Ci0gICAgICAgICAgICAgICAgczMgICAgICA9IChzMiArIHI0KSA8PCAxOwotICAgICAgICAgICAgICAgIHMyICAgICAgPSAoczIgLSByNCkgPDwgMTsKLQotICAgICAgICAgICAgICAgIHRlbXAzICAgPSAqcERhdGEzOwotICAgICAgICAgICAgICAgIHRlbXA0ICAgPSAqcERhdGE0OwotCi0gICAgICAgICAgICAgICAgdDEgICAgICA9IHRlbXAzICsgdGVtcDQ7Ci0gICAgICAgICAgICAgICAgdDIgICAgICA9IHRlbXAzIC0gdGVtcDQ7Ci0KLSAgICAgICAgICAgICAgICAqcERhdGExICA9IChzMSArIHQxKTsKLSAgICAgICAgICAgICAgICBzMSAgICAgICA9IChzMSAtIHQxKSA8PCAxOwotCi0gICAgICAgICAgICAgICAgKnBEYXRhMi0tICA9IGNtcGx4X211bDMyX2J5XzE2KHMxLCAtcjEsIGV4cF9qdzIpOwotICAgICAgICAgICAgICAgIHIzICAgICAgPSAocjIgLSB0MikgPDwgMTsKLSAgICAgICAgICAgICAgICAqcERhdGEyICAgID0gY21wbHhfbXVsMzJfYnlfMTYocjEsICBzMSwgZXhwX2p3Mik7Ci0KLSAgICAgICAgICAgICAgICByMiAgICAgID0gKHIyICsgdDIpIDw8IDE7Ci0KLSAgICAgICAgICAgICAgICAqcERhdGEzLS0gID0gY21wbHhfbXVsMzJfYnlfMTYoczIsIC1yMiwgZXhwX2p3MSk7Ci0gICAgICAgICAgICAgICAgKnBEYXRhMyAgICA9IGNtcGx4X211bDMyX2J5XzE2KHIyLCAgczIsIGV4cF9qdzEpOwotCi0gICAgICAgICAgICAgICAgKnBEYXRhNC0tICA9IGNtcGx4X211bDMyX2J5XzE2KHMzLCAtcjMsIGV4cF9qdzMpOwotICAgICAgICAgICAgICAgICpwRGF0YTQgICAgPSBjbXBseF9tdWwzMl9ieV8xNihyMywgIHMzLCBleHBfanczKTsKLQotICAgICAgICAgICAgfSAgLyogaSAqLwotCi0gICAgICAgIH0gIC8qICBqICovCi0KLSAgICB9IC8qIGsgKi8KLQotCi0gICAgbWF4ID0gMDsKLQotICAgIHBEYXRhMSA9IERhdGEgLSA3OwotCi0KLSAgICBmb3IgKGkgPSBPTkVfRk9VUlRIX0ZGVF9SWDRfTE9ORzsgaSAhPSAwIDsgaS0tKQotICAgIHsKLSAgICAgICAgcERhdGExICs9IDc7Ci0gICAgICAgIHBEYXRhMiA9IHBEYXRhMSArIDQ7Ci0KLQotICAgICAgICB0ZW1wMSAgID0gKnBEYXRhMTsKLSAgICAgICAgdGVtcDIgICA9ICpwRGF0YTIrKzsKLQotICAgICAgICByMSAgICAgID0gdGVtcDEgKyB0ZW1wMjsKLSAgICAgICAgcjIgICAgICA9IHRlbXAxIC0gdGVtcDI7Ci0KLSAgICAgICAgcERhdGEzID0gcERhdGExICsgMjsKLSAgICAgICAgcERhdGE0ID0gcERhdGExICsgNjsKLSAgICAgICAgdGVtcDEgICA9ICpwRGF0YTMrKzsKLSAgICAgICAgdGVtcDIgICA9ICpwRGF0YTQrKzsKLQotICAgICAgICB0MSAgICAgID0gdGVtcDEgKyB0ZW1wMjsKLSAgICAgICAgdDIgICAgICA9IHRlbXAxIC0gdGVtcDI7Ci0KLSAgICAgICAgdGVtcDEgICAgICAgPSAocjEgKyB0MSk7Ci0gICAgICAgIHIxICAgICAgICAgID0gKHIxIC0gdDEpOwotICAgICAgICAqKHBEYXRhMSsrKSA9IHRlbXAxOwotICAgICAgICBtYXggICAgICAgIHw9ICh0ZW1wMSA+PiAzMSkgXiB0ZW1wMTsKLQotCi0KLSAgICAgICAgdGVtcDIgICA9ICpwRGF0YTI7Ci0gICAgICAgIHRlbXAxICAgPSAqcERhdGExOwotCi0gICAgICAgIHMxICAgICAgPSB0ZW1wMSArIHRlbXAyOwotICAgICAgICBzMiAgICAgID0gdGVtcDEgLSB0ZW1wMjsKLQotCi0gICAgICAgIHRlbXAxICAgPSAqcERhdGEzOwotICAgICAgICB0ZW1wMiAgID0gKnBEYXRhNDsKLQotICAgICAgICBzMyAgICAgID0gKHMyICsgdDIpOwotICAgICAgICBzMiAgICAgID0gKHMyIC0gdDIpOwotCi0gICAgICAgIHQxICAgICAgPSB0ZW1wMSArIHRlbXAyOwotICAgICAgICB0MiAgICAgID0gdGVtcDEgLSB0ZW1wMjsKLQotICAgICAgICB0ZW1wMSAgICAgID0gKHMxICsgdDEpOwotICAgICAgICAqcERhdGExICAgID0gdGVtcDE7Ci0gICAgICAgIHRlbXAyICAgICAgPSAoczEgLSB0MSk7Ci0KLSAgICAgICAgbWF4ICAgICAgIHw9ICh0ZW1wMSA+PiAzMSkgXiB0ZW1wMTsKLSAgICAgICAgKnBEYXRhMi0tICA9IHRlbXAyOwotICAgICAgICBtYXggICAgICAgfD0gKHRlbXAyID4+IDMxKSBeIHRlbXAyOwotCi0gICAgICAgICpwRGF0YTIgICAgPSByMTsKLSAgICAgICAgbWF4ICAgICAgIHw9IChyMSA+PiAzMSkgXiByMTsKLSAgICAgICAgKnBEYXRhMy0tICA9IHMyOwotICAgICAgICBtYXggICAgICAgfD0gKHMyID4+IDMxKSBeIHMyOwotICAgICAgICAqcERhdGE0LS0gID0gczM7Ci0gICAgICAgIG1heCAgICAgICB8PSAoczMgPj4gMzEpIF4gczM7Ci0KLSAgICAgICAgdGVtcDEgICAgICA9IChyMiAtIHQyKTsKLSAgICAgICAgKnBEYXRhNCAgICA9IHRlbXAxOwotICAgICAgICB0ZW1wMiAgICAgID0gKHIyICsgdDIpOwotICAgICAgICAqcERhdGEzICAgID0gdGVtcDI7Ci0gICAgICAgIG1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gICAqcERhdGEyOwotICAgIEludDMyICAgKnBEYXRhMzsKLSAgICBJbnQzMiAgICpwRGF0YTQ7Ci0gICAgY29uc3QgSW50MzIgICpwdzsKLSAgICBJbnQzMiAgIHRlbXAxOwotICAgIEludDMyICAgdGVtcDI7Ci0gICAgSW50MzIgICB0ZW1wMzsKLSAgICBJbnQzMiAgIHRlbXA0OwotICAgIEludDMyICAgbWF4OwotICAgIEludCAgICAgZXhwOwotICAgIEludCAgICAgZXhwb25lbnQgPSAwOwotICAgIEludCAgICAgc2hpZnQ7Ci0KLQotICAgIG1heCA9ICpwZWFrX3ZhbHVlOwotICAgIGV4cCA9IDA7Ci0KLSAgICBpZiAobWF4ID4gMHgwMDgwMDApCi0gICAgewotICAgICAgICBleHAgPSA4IC0gcHZfbm9ybWFsaXplKG1heCk7ICAgLyogdXNlIDI0IGJpdHMgICovCi0KLSAgICAgICAgZXhwb25lbnQgPSBleHA7ICAgICAgICAvKiBrZWVwcyB0cmFjayBvZiAjIG9mIHNoaWZ0cyAqLwotCi0gICAgfQotCi0gICAgbjIgPSBGRlRfUlg0X1NIT1JUOwotCi0gICAgcHcgPSBXXzY0cng0OwotCi0KLSAgICAvKiBzaGlmdCBkb3duIHRvIGF2b2lkIHBvc3NpYmxlIG92ZXJmbG93IGluIGZpcnN0IHBhc3Mgb2YgdGhlIGxvb3AgKi8KLSAgICBzaGlmdCA9IDI7Ci0KLSAgICBmb3IgKGsgPSBGRlRfUlg0X1NIT1JUOyBrID4gNDsgayA+Pj0gMikKLSAgICB7Ci0KLSAgICAgICAgbjEgPSBuMjsKLSAgICAgICAgbjIgPj49IDI7Ci0gICAgICAgIG4zID0gbjEgPj4gMTsKLQotICAgICAgICBleHAgLT0gMjsKLQotICAgICAgICBmb3IgKGkgPSAwOyBpIDwgRkZUX1JYNF9TSE9SVDsgaSArPSBuMSkKLSAgICAgICAgewotICAgICAgICAgICAgcERhdGExID0gJkRhdGFbIGk8PDFdOwotICAgICAgICAgICAgcERhdGEzID0gcERhdGExICsgbjM7Ci0gICAgICAgICAgICBwRGF0YTIgPSBwRGF0YTEgKyBuMTsKLSAgICAgICAgICAgIHBEYXRhNCA9IHBEYXRhMyArIG4xOwotCi0gICAgICAgICAgICB0ZW1wMSAgID0gKihwRGF0YTEpOwotICAgICAgICAgICAgdGVtcDIgICA9ICoocERhdGEyKTsKLSAgICAgICAgICAgIHRlbXAxICAgPj49IHNoaWZ0OwotICAgICAgICAgICAgdGVtcDIgICA+Pj0gc2hpZnQ7Ci0KLSAgICAgICAgICAgIHIxICAgICAgPSB0ZW1wMSArIHRlbXAyOwotICAgICAgICAgICAgcjIgICAgICA9IHRlbXAxIC0gdGVtcDI7Ci0KLSAgICAgICAgICAgIHRlbXAzICAgPSAqKHBEYXRhMysrKTsKLSAgICAgICAgICAgIHRlbXA0ICAgPSAqKHBEYXRhNCsrKTsKLSAgICAgICAgICAgIHRlbXAzICAgPj49IHNoaWZ0OwotICAgICAgICAgICAgdGVtcDQgICA+Pj0gc2hpZnQ7Ci0KLSAgICAgICAgICAgIHQxICAgICAgPSB0ZW1wMyArIHRlbXA0OwotICAgICAgICAgICAgdDIgICAgICA9IHRlbXAzIC0gdGVtcDQ7Ci0KLSAgICAgICAgICAgICoocERhdGExKyspID0gKHIxICsgdDEpID4+IGV4cDsKLSAgICAgICAgICAgICoocERhdGEyKyspID0gKHIxIC0gdDEpID4+IGV4cDsKLQotICAgICAgICAgICAgdGVtcDEgICA9ICpwRGF0YTE7Ci0gICAgICAgICAgICB0ZW1wMiAgID0gKnBEYXRhMjsKLSAgICAgICAgICAgIHRlbXAxICAgPj49IHNoaWZ0OwotICAgICAgICAgICAgdGVtcDIgICA+Pj0gc2hpZnQ7Ci0KLSAgICAgICAgICAgIHMxICAgICAgPSB0ZW1wMSArIHRlbXAyOwotICAgICAgICAgICAgczIgICAgICA9IHRlbXAxIC0gdGVtcDI7Ci0KLSAgICAgICAgICAgIHRlbXAzICAgPSAqcERhdGEzOwotICAgICAgICAgICAgdGVtcDQgICA9ICpwRGF0YTQ7Ci0gICAgICAgICAgICB0ZW1wMyAgID4+PSBzaGlmdDsKLSAgICAgICAgICAgIHRlbXA0ICAgPj49IHNoaWZ0OwotCi0gICAgICAgICAgICB0MSAgICAgID0gdGVtcDMgKyB0ZW1wNDsKLSAgICAgICAgICAgIHIxICAgICAgPSB0ZW1wMyAtIHRlbXA0OwotCi0gICAgICAgICAgICAqcERhdGExICAgPSAoczEgKyB0MSkgPj4gZXhwOwotICAgICAgICAgICAgKnBEYXRhMiAgID0gKHMxIC0gdDEpID4+IGV4cDsKLQotICAgICAgICAgICAgKnBEYXRhNC0tICAgID0gKHMyICsgdDIpID4+IGV4cDsKLSAgICAgICAgICAgICpwRGF0YTQgICAgICA9IChyMiAtIHIxKSA+PiBleHA7Ci0KLSAgICAgICAgICAgICpwRGF0YTMtLSAgICA9IChzMiAtIHQyKSA+PiBleHA7Ci0gICAgICAgICAgICAqcERhdGEzICAgICAgPSAocjIgKyByMSkgPj4gZXhwOwotCi0KLSAgICAgICAgfSAgLyogaSAqLwotCi0gICAgICAgIGZvciAoaiA9IDE7IGogPCBuMjsgaisrKQotICAgICAgICB7Ci0gICAgICAgICAgICBleHBfancxID0gKnB3Kys7Ci0gICAgICAgICAgICBleHBfancyID0gKnB3Kys7Ci0gICAgICAgICAgICBleHBfanczID0gKnB3Kys7Ci0KLQotICAgICAgICAgICAgZm9yIChpID0gajsgaSA8IEZGVF9SWDRfU0hPUlQ7IGkgKz0gbjEpCi0gICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgcERhdGExID0gJkRhdGFbIGk8PDFdOwotICAgICAgICAgICAgICAgIHBEYXRhMyA9IHBEYXRhMSArIG4zOwotICAgICAgICAgICAgICAgIHBEYXRhMiA9IHBEYXRhMSArIG4xOwotICAgICAgICAgICAgICAgIHBEYXRhNCA9IHBEYXRhMyArIG4xOwotCi0gICAgICAgICAgICAgICAgdGVtcDEgICA9ICoocERhdGExKTsKLSAgICAgICAgICAgICAgICB0ZW1wMiAgID0gKihwRGF0YTIrKyk7Ci0gICAgICAgICAgICAgICAgdGVtcDEgICA+Pj0gc2hpZnQ7Ci0gICAgICAgICAgICAgICAgdGVtcDIgICA+Pj0gc2hpZnQ7Ci0KLSAgICAgICAgICAgICAgICByMSAgICAgID0gdGVtcDEgKyB0ZW1wMjsKLSAgICAgICAgICAgICAgICByMiAgICAgID0gdGVtcDEgLSB0ZW1wMjsKLSAgICAgICAgICAgICAgICB0ZW1wMyAgID0gKihwRGF0YTMrKyk7Ci0gICAgICAgICAgICAgICAgdGVtcDQgICA9ICoocERhdGE0KyspOwotICAgICAgICAgICAgICAgIHRlbXAzICAgPj49IHNoaWZ0OwotICAgICAgICAgICAgICAgIHRlbXA0ICAgPj49IHNoaWZ0OwotCi0gICAgICAgICAgICAgICAgdDEgICAgICA9IHRlbXAzICsgdGVtcDQ7Ci0gICAgICAgICAgICAgICAgdDIgICAgICA9IHRlbXAzIC0gdGVtcDQ7Ci0KLSAgICAgICAgICAgICAgICAqKHBEYXRhMSsrKSA9IChyMSArIHQxKSA+PiBleHA7Ci0gICAgICAgICAgICAgICAgcjEgICAgICAgICAgPSAocjEgLSB0MSkgPj4gZXhwOwotCi0gICAgICAgICAgICAgICAgdGVtcDEgICA9ICpwRGF0YTE7Ci0gICAgICAgICAgICAgICAgdGVtcDIgICA9ICpwRGF0YTI7Ci0gICAgICAgICAgICAgICAgdGVtcDEgICA+Pj0gc2hpZnQ7Ci0gICAgICAgICAgICAgICAgdGVtcDIgICA+Pj0gc2hpZnQ7Ci0KLSAgICAgICAgICAgICAgICBzMSAgICAgID0gdGVtcDEgKyB0ZW1wMjsKLSAgICAgICAgICAgICAgICBzMiAgICAgID0gdGVtcDEgLSB0ZW1wMjsKLQotICAgICAgICAgICAgICAgIHMzICAgICAgPSAoczIgKyB0MikgPj4gZXhwOwotICAgICAgICAgICAgICAgIHMyICAgICAgPSAoczIgLSB0MikgPj4gZXhwOwotCi0gICAgICAgICAgICAgICAgdGVtcDMgICA9ICpwRGF0YTM7Ci0gICAgICAgICAgICAgICAgdGVtcDQgICA9ICpwRGF0YTQgOwotICAgICAgICAgICAgICAgIHRlbXAzICAgPj49IHNoaWZ0OwotICAgICAgICAgICAgICAgIHRlbXA0ICAgPj49IHNoaWZ0OwotCi0gICAgICAgICAgICAgICAgdDEgICAgICA9IHRlbXAzICsgdGVtcDQ7Ci0gICAgICAgICAgICAgICAgdDIgICAgICA9IHRlbXAzIC0gdGVtcDQ7Ci0KLSAgICAgICAgICAgICAgICAqcERhdGExICA9IChzMSArIHQxKSA+PiBleHA7Ci0gICAgICAgICAgICAgICAgczEgICAgICAgPSAoczEgLSB0MSkgPj4gZXhwOwotCi0KLSAgICAgICAgICAgICAgICAqcERhdGEyLS0gID0gY21wbHhfbXVsMzJfYnlfMTYoczEsIC1yMSwgZXhwX2p3MikgPDwgMTsKLSAgICAgICAgICAgICAgICAqcERhdGEyICAgID0gY21wbHhfbXVsMzJfYnlfMTYocjEsICBzMSwgZXhwX2p3MikgPDwgMTsKLQotICAgICAgICAgICAgICAgIHIzICAgICAgID0gKChyMiAtIHQyKSA+PiBleHApOwotICAgICAgICAgICAgICAgIHIyICAgICAgID0gKChyMiArIHQyKSA+PiBleHApOwotCi0gICAgICAgICAgICAgICAgKnBEYXRhMy0tICA9IGNtcGx4X211bDMyX2J5XzE2KHMyLCAtcjIsIGV4cF9qdzEpIDw8IDE7Ci0gICAgICAgICAgICAgICAgKnBEYXRhMyAgICA9IGNtcGx4X211bDMyX2J5XzE2KHIyLCAgczIsIGV4cF9qdzEpIDw8IDE7Ci0KLSAgICAgICAgICAgICAgICAqcERhdGE0LS0gID0gY21wbHhfbXVsMzJfYnlfMTYoczMsIC1yMywgZXhwX2p3MykgPDwgMTsKLSAgICAgICAgICAgICAgICAqcERhdGE0ICAgID0gY21wbHhfbXVsMzJfYnlfMTYocjMsICBzMywgZXhwX2p3MykgPDwgMTsKLQotICAgICAgICAgICAgfSAgLyogaSAqLwotCi0gICAgICAgIH0gIC8qICBqICovCi0KLSAgICAgICAgLyoKLSAgICAgICAgICogIHRoaXMgd2lsbCByZXNldCBleHAgYW5kIHNoaWZ0IHRvIHplcm8gZm9yIHRoZSBzZWNvbmQgcGFzcyBvZiB0aGUKLSAgICAgICAgICogIGxvb3AKLSAgICAgICAgICovCi0gICAgICAgIGV4cCAgID0gMjsKLSAgICAgICAgc2hpZnQgPSAwOwotCi0gICAgfSAvKiBrICovCi0KLQotICAgIG1heCA9IDA7Ci0KLSAgICBwRGF0YTEgPSBEYXRhIC0gNzsKLQotICAgIGZvciAoaSA9IE9ORV9GT1VSVEhfRkZUX1JYNF9TSE9SVDsgaSAhPSAwIDsgaS0tKQotICAgIHsKLSAgICAgICAgcERhdGExICs9IDc7Ci0KLSAgICAgICAgcERhdGEzID0gcERhdGExICsgMjsKLSAgICAgICAgcERhdGEyID0gcERhdGExICsgNDsKLSAgICAgICAgcERhdGE0ID0gcERhdGExICsgNjsKLQotICAgICAgICB0ZW1wMSAgID0gKnBEYXRhMTsKLSAgICAgICAgdGVtcDIgICA9ICpwRGF0YTIrKzsKLQotICAgICAgICByMSAgICAgID0gdGVtcDEgKyB0ZW1wMjsKLSAgICAgICAgcjIgICAgICA9IHRlbXAxIC0gdGVtcDI7Ci0KLSAgICAgICAgdGVtcDEgICA9ICpwRGF0YTMrKzsKLSAgICAgICAgdGVtcDIgICA9ICpwRGF0YTQrKzsKLQotICAgICAgICB0MSAgICAgID0gdGVtcDEgKyB0ZW1wMjsKLSAgICAgICAgdDIgICAgICA9IHRlbXAxIC0gdGVtcDI7Ci0KLSAgICAgICAgdGVtcDEgICAgICAgPSAocjEgKyB0MSk7Ci0gICAgICAgIHIxICAgICAgICAgID0gKHIxIC0gdDEpOwotICAgICAgICAqKHBEYXRhMSsrKSA9IHRlbXAxOwotICAgICAgICBtYXggICAgICAgIHw9ICh0ZW1wMSA+PiAzMSkgXiB0ZW1wMTsKLQotCi0KLSAgICAgICAgdGVtcDEgICA9ICpwRGF0YTE7Ci0gICAgICAgIHRlbXAyICAgPSAqcERhdGEyOwotCi0gICAgICAgIHMxICAgICAgPSB0ZW1wMSArIHRlbXAyOwotICAgICAgICBzMiAgICAgID0gdGVtcDEgLSB0ZW1wMjsKLQotICAgICAgICBzMyAgICAgID0gKHMyICsgdDIpOwotICAgICAgICBzMiAgICAgID0gKHMyIC0gdDIpOwotCi0gICAgICAgIHRlbXAxICAgPSAqcERhdGEzOwotICAgICAgICB0ZW1wMiAgID0gKnBEYXRhNDsKLQotICAgICAgICB0MSAgICAgID0gdGVtcDEgKyB0ZW1wMjsKLSAgICAgICAgdDIgICAgICA9IHRlbXAxIC0gdGVtcDI7Ci0KLSAgICAgICAgdGVtcDEgICAgICA9IChzMSArIHQxKTsKLSAgICAgICAgdGVtcDIgICAgICA9IChzMSAtIHQxKTsKLSAgICAgICAgKnBEYXRhMSAgICA9IHRlbXAxOwotICAgICAgICAqcERhdGEyLS0gID0gdGVtcDI7Ci0gICAgICAgIG1heCAgICAgICB8PSAodGVtcDEgPj4gMzEpIF4gdGVtcDE7Ci0gICAgICAgIG1heCAgICAgICB8PSAodGVtcDIgPj4gMzEpIF4gdGVtcDI7Ci0KLSAgICAgICAgKnBEYXRhMiAgICA9IHIxOwotICAgICAgICAqcERhdGEzLS0gID0gczI7Ci0gICAgICAgICpwRGF0YTQtLSAgPSBzMzsKLSAgICAgICAgbWF4ICAgICAgIHw9IChyMSA+PiAzMSkgXiByMTsKLSAgICAgICAgbWF4ICAgICAgIHw9IChzMiA+PiAzMSkgXiBzMjsKLSAgICAgICAgbWF4ICAgICAgIHw9IChzMyA+PiAzMSkgXiBzMzsKLQotICAgICAgICB0ZW1wMSAgICAgID0gKHIyIC0gdDIpOwotICAgICAgICB0ZW1wMiAgICAgID0gKHIyICsgdDIpOwotICAgICAgICAqcERhdGE0ICAgID0gdGVtcDE7Ci0gICAgICAgICpwRGF0YTMgICAgPSB0ZW1wMjsKLSAgICAgICAgbWF4ICAgICAgIHw9ICh0ZW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50MzIgKkRhdGFfb3V0LAotICAgIEludDMyICBtYXgpCi17Ci0gICAgSW50ICAgICBpOwotICAgIGNvbnN0ICAgSW50MzIgKnBfcm90YXRlOwotICAgIEludDMyICAgdGVtcF9yZTsKLSAgICBJbnQzMiAgIHRlbXBfaW07Ci0gICAgSW50MzIgICAqcERhdGFfaW5fcmVmMTsKLSAgICBJbnQzMiAgICpwRGF0YV9pbl9yZWYyOwotICAgIEludDMyICAgZXhwX2p3OwotICAgIEludDMyICAgdGVtcF9yZV8zMjsKLSAgICBJbnQzMiAgIHRlbXBfaW1fMzI7Ci0KLSAgICBJbnQzMiAgICpwRGF0YV9vdXRfMTsKLSAgICBJbnQzMiAgICpwRGF0YV9vdXRfMjsKLSAgICBJbnQzMiAgICpwRGF0YV9vdXRfMzsKLSAgICBJbnQzMiAgICpwRGF0YV9vdXRfNDsKLQotICAgIEludDMyICpwRGF0YV9pbl8xOwotICAgIEludDMyICpwRGF0YV9pbl8yOwotCi0gICAgSW50ICAgICBleHA7Ci0KLSAgICBwX3JvdGF0ZSAgICAgICA9ICBleHBfcm90YXRpb25fTl8yMDQ4OwotCi0gICAgcERhdGFfaW5fcmVmMSAgPSAgRGF0YV9pbjsKLSAgICBwRGF0YV9pbl9yZWYyICA9ICZEYXRhX2luW1RXSUNFX0ZXRF9MT05HX0NYX1JPVF9MRU5HVEhdOwotCi0gICAgcERhdGFfb3V0XzEgPSBEYXRhX291dDsKLSAgICBwRGF0YV9vdXRfMiA9ICZEYXRhX291dFtMT05HX1dJTkRPV19MRU5HVEhfbV8xXTsKLSAgICBwRGF0YV9vdXRfMyA9ICZEYXRhX291dFtMT05HX1dJTkRPV19MRU5HVEhdOwotICAgIHBEYXRhX291dF80ID0gJkRhdGFfb3V0W1RXSUNFX0xPTkdfV0lORE9XX0xFTkdUSF9tXzFdOwotCi0gICAgLyoKLSAgICAgKiAgRGF0YV9vdXQKLSAgICAgKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPj4+PiAgICAgICAgICAgICAgICAgICA8PDw8Ci0gICAgICogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBEYXRhX291dF8zICAgICAgICAgICAgIHBEYXRhX291dF80Ci0gICAgICogICAgICB8ICAgICAgICAgICAgIHwgICAgICAgICAgICAgfCAgICAgICAgICAgICB8ICAgICAgICAgICAgIHwKLSAgICAgKiBwRGF0YV9vdXRfMSAgICAgICAgICAgICAgIHBEYXRhX291dF8yCi0gICAgICogICAgICA+Pj4+ICAgICAgICAgICAgICAgICAgICAgPDw8PAotICAgICAqLwotCi0KLSAgICBleHAgPSAxNiAtIHB2X25vcm1hbGl6ZShtYXgpOwotCi0gICAgaWYgKGV4cCA8IDApCi0gICAgewotICAgICAgICBleHAgPSAwOwotICAgIH0KLQotICAgIC8qCi0gICAgICogIEFwcGx5ICBBLzJeKGRpZmYpICsgQgotICAgICAqLwotCi0KLSAgICBwRGF0YV9pbl8xID0gcERhdGFfaW5fcmVmMTsKLSAgICBwRGF0YV9pbl8yID0gcERhdGFfaW5fcmVmMjsKLQotICAgIGZvciAoaSA9IEZXRF9MT05HX0NYX1JPVF9MRU5HVEg7IGkgIT0gMDsgaS0tKQotICAgIHsKLQotICAgICAgICAvKgotICAgICAgICAgKiBjb3NfbiArIGoqc2luX24gPT0gZXhwKGooMnBpL04pKGsrMS84KSkKLSAgICAgICAgICovCi0KLSAgICAgICAgZXhwX2p3ID0gKnBfcm90YXRlKys7Ci0KLSAgICAgICAgLyoKLSAgICAgICAgICogIFVzZSBhdXhpbGlhcnkgdmFyaWFibGVzIHRvIGF2b2lkIGRvdWJsZSBhY2Nlc3NlcyB0byBtZW1vcnkuCi0gICAgICAgICAqICBEYXRhIGluIGlzIHNjYWxlZCB0byB1c2Ugb25seSBsb3dlciAxNiBiaXRzLgotICAgICAgICAgKi8KLQotICAgICAgICB0ZW1wX3JlID0gICoocERhdGFfaW5fMSsrKSA+PiBleHA7Ci0gICAgICAgIHRlbXBfaW0gPSAgKihwRGF0YV9pbl8xKyspID4+IGV4cDsKLQotICAgICAgICAvKgotICAgICAgICAgKiAgIFByZS1yb3RhdGlvbgotICAgICAgICAgKi8KLQotICAgICAgICB0ZW1wX3JlXzMyICA9IChjbXBseF9tdWwzMl9ieV8xNih0ZW1wX3JlLCAgIHRlbXBfaW0sICBleHBfancpKTsKLSAgICAgICAgdGVtcF9pbV8zMiAgPSAoY21wbHhfbXVsMzJfYnlfMTYodGVtcF9pbSwgIC10ZW1wX3JlLCAgZXhwX2p3KSk7Ci0KLSAgICAgICAgKihwRGF0YV9vdXRfMSsrKSA9IC0gdGVtcF9yZV8zMjsKLSAgICAgICAgKihwRGF0YV9vdXRfMi0tKSA9ICAgdGVtcF9pbV8zMjsKLSAgICAgICAgKihwRGF0YV9vdXRfMysrKSA9IC0gdGVtcF9pbV8zMjsKLSAgICAgICAgKihwRGF0YV9vdXRfNC0tKSA9ICAgdGVtcF9yZV8zMjsKLQotICAgICAgICAvKgotICAgICAgICAgKiAgIFBvaW50ZXIgaW5jcmVtZW50IHRvIGp1bXAgb3ZlciBpbWFnICgxICYgNCkgb3IgcmVhbCBwYXJ0cwotICAgICAgICAgKiAgICgyICYgMykKLSAgICAgICAgICovCi0gICAgICAgIHBEYXRhX291dF8xKys7Ci0gICAgICAgIHBEYXRhX291dF8yLS07Ci0gICAgICAgIHBEYXRhX291dF8zKys7Ci0gICAgICAgIHBEYXRhX291dF80LS07Ci0KLSAgICAgICAgLyoKLSAgICAgICAgICogICBSZXBlYXQgcHJvY2VkdXJlIGZvciBvZGQgaW5kZXggYXQgdGhlIG91dHB1dAotICAgICAgICAgKi8KLQotICAgICAgICBleHBfancgPSAqcF9yb3RhdGUrKzsKLQotICAgICAgICB0ZW1wX3JlID0gICoocERhdGFfaW5fMisrKSA+PiBleHA7Ci0gICAgICAgIHRlbXBfaW0gPSAgKihwRGF0YV9pbl8yKyspID4+IGV4cDsKLQotICAgICAgICB0ZW1wX3JlXzMyICA9IChjbXBseF9tdWwzMl9ieV8xN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bnQzMiAqRGF0YV9vdXQsCi0gICAgSW50MzIgIG1heCkKLQotewotICAgIEludCAgICAgaTsKLSAgICBJbnQxNiAgICAgSTsKLSAgICBjb25zdCAgIEludDE2ICpwVGFibGU7Ci0gICAgY29uc3QgICBJbnQzMiAqcF9yb3RhdGU7Ci0KLSAgICBJbnQzMiAgICpwRGF0YV9pbl8xOwotICAgIEludCAgICAgZXhwOwotICAgIEludDMyICAgdGVtcF9yZTsKLSAgICBJbnQzMiAgIHRlbXBfaW07Ci0KLSAgICBJbnQzMiAgIGNvc19uOwotICAgIEludDMyICAgc2luX247Ci0gICAgSW50MzIgICB0ZW1wX3JlXzMyOwotICAgIEludDMyICAgdGVtcF9pbV8zMjsKLQotICAgIEludDMyICAgKnBEYXRhX2luX3JlZjsKLQotICAgIEludDMyICAgKnBEYXRhX291dF8xOwotICAgIEludDMyICAgKnBEYXRhX291dF8yOwotICAgIEludDMyICAgKnBEYXRhX291dF8zOwotICAgIEludDMyICAgKnBEYXRhX291dF80OwotCi0gICAgcFRhYmxlICAgID0gIGRpZ2l0X3JldmVyc2VfNjQ7Ci0gICAgcF9yb3RhdGUgID0gIGV4cF9yb3RhdGlvbl9OXzI1NjsKLQotICAgIHBEYXRhX2luX3JlZiAgPSAgRGF0YV9pbjsKLQotICAgIGV4cCA9IDE2IC0gcHZfbm9ybWFsaXplKG1heCk7Ci0KLSAgICBpZiAoZXhwIDwgMCkKLSAgICB7Ci0gICAgICAgIGV4cCA9IDA7Ci0gICAgfQotCi0gICAgcERhdGFfb3V0XzEgPSBEYXRhX291dDsKLSAgICBwRGF0YV9vdXRfMiA9ICZEYXRhX291dFtUV0lDRV9GV0RfU0hPUlRfQ1hfUk9UX0xFTkdUSF9tXzFdOwotICAgIHBEYXRhX291dF8zID0gJkRhdGFfb3V0W1RXSUNFX0ZXRF9TSE9SVF9DWF9ST1RfTEVOR1RIXTsKLSAgICBwRGF0YV9vdXRfNCA9ICZEYXRhX291dFtGT1VSX0ZXRF9TSE9SVF9DWF9ST1RfTEVOR1RIX21fMV07Ci0KLSAgICAvKgotICAgICAqICBEYXRhX291dAotICAgICAqICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA+Pj4+ICAgICAgICAgICAgICAgICAgIDw8PDwKLSAgICAgKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcERhdGFfb3V0XzMgICAgICAgICAgICAgcERhdGFfb3V0XzQKLSAgICAgKiAgICAgIHwgICAgICAgICAgICAgfCAgICAgICAgICAgICB8ICAgICAgICAgICAgIHwgICAgICAgICAgICAgfAotICAgICAqIHBEYXRhX291dF8xICAgICAgICAgICAgICAgcERhdGFfb3V0XzIKLSAgICAgKiAgICAgID4+Pj4gICAgICAgICAgICAgICAgICAgICA8PDw8Ci0gICAgICovCi0KLQotICAgIGZvciAoaSA9IEZXRF9TSE9SVF9DWF9ST1RfTEVOR1RIOyBpICE9IDA7IGktLSkKLSAgICB7Ci0gICAgICAgIC8qCi0gICAgICAgICAqICAgUGVyZm9ybSBkaWdpdCByZXZlcnNhbCBieSBhY2Nlc3NpbmcgaW5kZXggSSBmcm9tIHRhYmxlCi0gICAgICAgICAqLwotCi0gICAgICAgIEkgPSAqcFRhYmxlKys7Ci0gICAgICAgIHBEYXRhX2luXzEgPSBwRGF0YV9pbl9yZWYgKyBJOwotCi0gICAgICAgIC8qCi0gICAgICAgICAqIGNvc19uICsgaipzaW5fbiA9PSBleHAoaigycGkvTikoaysxLzgpKQotICAgICAgICAgKi8KLQotICAgICAgICBzaW5fbiA9ICpwX3JvdGF0ZSsrOwotICAgICAgICBjb3NfbiA9IHNpbl9uID4+IDE2OwotICAgICAgICBzaW5fbiA9IHNpbl9uICYgMHhGRkZGOwotCi0gICAgICAgIC8qCi0gICAgICAgICAqICBVc2UgYXV4aWxpYXJ5IHZhcmlhYmxlcyB0byBhdm9pZCBkb3VibGUgYWNjZXNzZXMgdG8gbWVtb3J5LgotICAgICAgICAgKiAgRGF0YSBpbiBpcyBzY2FsZWQgdG8gdXNlIG9ubHkgbG93ZXIgMTYgYml0cy4KLSAgICAgICAgICovCi0KLSAgICAgICAgdGVtcF9yZSA9ICAqKHBEYXRhX2luXzErKykgPj4gZXhwOwotICAgICAgICB0ZW1wX2ltID0gICoocERhdGFfaW5fMSkgPj4gZXhwOwotCi0gICAgICAgIC8qCi0gICAgICAgICAqICAgUHJlLXJvdGF0aW9uCi0gICAgICAgICAqLwotCi0gICAgICAgIHRlbXBfcmVfMzIgPSAodGVtcF9yZSAqIGNvc19uICsgdGVtcF9pbSAqIHNpbl9uKSA+PiAxNjsKLSAgICAgICAgdGVtcF9pbV8zMiA9ICh0ZW1wX2ltICogY29zX24gLSB0ZW1wX3JlICogc2luX24pID4+IDE2OwotCi0gICAgICAgICoocERhdGFfb3V0XzErKykgPSAtIHRlbXBfcmVfMzI7Ci0gICAgICAgICoocERhdGFfb3V0XzItLSkgPSAgIHRlbXBfaW1fMzI7Ci0gICAgICAgICoocERhdGFfb3V0XzMrKykgPSAtIHRlbXBfaW1fMzI7Ci0gICAgICAgICoocERhdGFfb3V0XzQtLSkgPSAgIHRlbXBfcmVfMzI7Ci0KLSAgICAgICAgLyoKLSAgICAgICAgICogICBQb2ludGVyIGluY3JlbWVudCB0byBqdW1wIG92ZXIgaW1hZyAoMSAmIDQpIG9yIHJlYWwgcGFydHMKLSAgICAgICAgICogICAoMiAmIDMpCi0gICAgICAgICAqLwotCi0gICAgICAgIHBEYXRhX291dF8xKys7Ci0gICAgICAgIHBEYXRhX291dF8yLS07Ci0gICAgICAgIHBEYXRhX291dF8zKys7Ci0gICAgICAgIHBEYXRhX291dF80LS07Ci0KLSAgICB9IC8qIGZvcihpKSAqLwotCi0gICAgcmV0dXJuIChleHApOwotfQpkaWZmIC0tZ2l0IGEvbWVkaWEvbGlic3RhZ2VmcmlnaHQvY29kZWNzL2FhY2RlYy9md2Rfc2hvcnRfY29tcGxleF9yb3QuaCBiL21lZGlhL2xpYnN0YWdlZnJpZ2h0L2NvZGVjcy9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ICByZWdpc3RlciBJbnQzMiByYSA9IChJbnQzMilMX3ZhcjE7Ci0gICAgICAgIHJlZ2lzdGVyIEludDMyIHJiID0gKEludDMyKUxfdmFyMjsKLQotICAgICAgICBhc20gdm9sYXRpbGUoCi0gICAgICAgICAgICAic211bGJiICUwLCAlMSwgJTIiCi0gICAgOiAiPSZyKmkiKHRtcCkKLSAgICAgICAgICAgICAgICAgICAgOiAiciIocmEpLAotICAgICAgICAgICAgICAgICAgICAiciIocmIpKTsKLQotICAgICAgICByZXR1cm4gKHRtcCk7Ci0gICAgfQotCi0KLSNkZWZpbmUgZnhwX211bF8xNl9ieV8xNihhLCBiKSAgZnhwX211bF8xNl9ieV8xNmJiKCAgYSwgYikKLQotCi0gICAgc3RhdGljIGlubGluZSBJbnQzMiBmeHBfbXVsXzE2X2J5XzE2dGIoSW50MzIgTF92YXIxLCBjb25zdCBJbnQzMiBMX3ZhcjIpCi17Ci0KLSAgICAgICAgcmVnaXN0ZXIgSW50MzIgdG1wOwotICAgICAgICByZWdpc3RlciBJbnQzMiByYSA9IChJbnQzMilMX3ZhcjE7Ci0gICAgICAgIHJlZ2lzdGVyIEludDMyIHJiID0gKEludDMyKUxfdmFyMjsKLQotICAgICAgICBhc20gdm9sYXRpbGUoCi0gICAgICAgICAgICAic211bHRiICUwLCAlMSwgJTIiCi0gICAgOiAiPSZyKmkiKHRtcCkKLSAgICAgICAgICAgICAgICAgICAgOiAiciIocmEpLAotICAgICAgICAgICAgICAgICAgICAiciIocmIpKTsKLQotICAgICAgICByZXR1cm4gKHRtcCk7Ci0gICAgfQotCi0gICAgc3RhdGljIGlubGluZSBJbnQzMiBmeHBfbXVsXzE2X2J5XzE2YnQoSW50MzIgTF92YXIxLCBjb25zdCBJbnQzMiBMX3ZhcjIpCi17Ci0KLSAgICAgICAgcmVnaXN0ZXIgSW50MzIgdG1wOwotICAgICAgICByZWdpc3RlciBJbnQzMiByYSA9IChJbnQzMilMX3ZhcjE7Ci0gICAgICAgIHJlZ2lzdGVyIEludDMyIHJiID0gKEludDMyKUxfdmFyMjsKLQotICAgICAgICBhc20gdm9sYXRpbGUoCi0gICAgICAgICAgICAic211bGJ0ICUwLCAlMSwgJTIiCi0gICAgOiAiPSZyKmkiKHRtcCkKLSAgICAgICAgICAgICAgICAgICAgOiAiciIocmEpLAotICAgICAgICAgICAgICAgICAgICAiciIocmIpKTsKLQotICAgICAgICByZXR1cm4gKHRtcCk7Ci0gICAgfQotCi0gICAgc3RhdGljIGlubGluZSBJbnQzMiBmeHBfbXVsXzE2X2J5XzE2dHQoSW50MzIgTF92YXIxLCBjb25zdCBJbnQzMiBMX3ZhcjIpCi17Ci0KLSAgICAgICAgcmVnaXN0ZXIgSW50MzIgdG1wOwotICAgICAgICByZWdpc3RlciBJbnQzMiByYSA9IChJbnQzMilMX3ZhcjE7Ci0gICAgICAgIHJlZ2lzdGVyIEludDMyIHJiID0gKEludDMyKUxfdmFyMjsKLQotICAgICAgICBhc20gdm9sYXRpbGUoCi0gICAgICAgICAgICAic211bHR0ICUwLCAlMSwgJTIiCi0gICAgOiAiPSZyKmkiKHRtcCkKLSAgICAgICAgICAgICAgICAgICAgOiAiciIocmEpLAotICAgICAgICAgICAgICAgICAgICAiciIocmIpKTsKLQotICAgICAgICByZXR1cm4gKHRtcCk7Ci0gICAgfQotCi0gICAgc3RhdGljIGlubGluZSBJbnQzMiBmeHBfbWFjXzE2X2J5XzE2KGNvbnN0IEludDMyIExfdmFyMSwgY29uc3QgSW50MzIgTF92YXIyLCBJbnQzMiBMX2FkZCkKLXsKLSAgICAgICAgcmVnaXN0ZXIgSW50MzIgdG1wOwotICAgICAgICByZWdpc3RlciBJbnQzMiByYSA9IChJbnQzMilMX3ZhcjE7Ci0gICAgICAgIHJlZ2lzdGVyIEludDMyIHJiID0gKEludDMyKUxfdmFyMjsKLSAgICAgICAgcmVnaXN0ZXIgSW50MzIgcmMgPSAoSW50MzIpTF9hZGQ7Ci0KLSAgICAgICAgYXNtIHZvbGF0aWxlKAotICAgICAgICAgICAgInNtbGFiYiAlMCwgJTEsICUyLCAlMyIKLSAgICA6ICI9JnIqaSIodG1wKQotICAgICAgICAgICAgICAgICAgICA6ICJyIihyYSksCi0gICAgICAgICAgICAgICAgICAgICJyIihyYiksCi0gICAgICAgICAgICAgICAgICAgICJyIihyYykpOwotCi0gICAgICAgIHJldHVybiAodG1wKTsKLSAgICB9Ci0KLQotCi0gICAgc3RhdGljIGlubGluZSBJbnQzMiBmeHBfbWFjXzE2X2J5XzE2X2JiKGNvbnN0IEludDMyIExfdmFyMSwgY29uc3QgSW50MzIgTF92YXIyLCBJbnQzMiBMX2FkZCkKLXsKLSAgICAgICAgcmVnaXN0ZXIgSW50MzIgdG1wOwotICAgICAgICByZWdpc3RlciBJbnQzMiByYSA9IChJbnQzMilMX3ZhcjE7Ci0gICAgICAgIHJlZ2lzdGVyIEludDMyIHJiID0gKEludDMyKUxfdmFyMjsKLSAgICAgICAgcmVnaXN0ZXIgSW50MzIgcmMgPSAoSW50MzIpTF9hZGQ7Ci0KLSAgICAgICAgYXNtIHZvbGF0aWxlKAotICAgICAgICAgICAgInNtbGFiYiAlMCwgJTEsICUyLCAlMyIKLSAgICA6ICI9JnIqaSIodG1wKQotICAgICAgICAgICAgICAgICAgICA6ICJyIihyYSksCi0gICAgICAgICAgICAgICAgICAgICJyIihyYiksCi0gICAgICAgICAgICAgICAgICAgICJyIihyYykpOwotCi0gICAgICAgIHJldHVybiAodG1wKTsKLSAgICB9Ci0KLQotICAgIHN0YXRpYyBpbmxpbmUgSW50MzIgZnhwX21hY18xNl9ieV8xNl9idChjb25zdCBJbnQzMiBMX3ZhcjEsIGNvbnN0IEludDMyIExfdmFyMiwgSW50MzIgTF9hZGQpCi17Ci0gICAgICAgIHJlZ2lzdGVyIEludDMyIHRtcDsKLSAgICAgICAgcmVnaXN0ZXIgSW50MzIgcmEgPSAoSW50MzIpTF92YXIxOwotICAgICAgICByZWdpc3RlciBJbnQzMiByYiA9IChJbnQzMilMX3ZhcjI7Ci0gICAgICAgIHJlZ2lzdGVyIEludDMyIHJjID0gKEludDMyKUxfYWRkOwotCi0gICAgICAgIGFzbSB2b2xhdGlsZSgKLSAgICAgICAgICAgICJzbWxhYnQgJTAsICUxLCAlMiwgJTMiCi0gICAgOiAiPSZyKmkiKHRtcCkKLSAgICAgICAgICAgICAgICAgICAgOiAiciIocmEpLAotICAgICAgICAgICAgICAgICAgICAiciIocmIpLAotICAgICAgICAgICAgICAgICAgICAiciIocmMpKTsKLQotICAgICAgICByZXR1cm4gKHRtcCk7Ci0gICAgfQotCi0KLQotICAgIHN0YXRpYyBpbmxpbmUgSW50MzIgY21wbHhfbXVsMzJfYnlfMTYoSW50MzIgeCwgY29uc3QgSW50MzIgeSwgSW50MzIgZXhwX2p3KQotewotICAgICAgICByZWdpc3RlciBJbnQzMiBjeF9zdW07Ci0gICAgICAgIHJlZ2lzdGVyIEludDMyIHJ4ID0gKEludDMyKXg7Ci0gICAgICAgIHJlZ2lzdGVyIEludDMyIHJ5ID0gKEludDMyKXk7Ci0gICAgICAgIHJlZ2lzdGVyIEludDMyIHJleHAgPSAoSW50MzIpZXhwX2p3OwotICAgICAgICBhc20gdm9sYXRpbGUoCi0gICAgICAgICAgICAic211bHd0ICUwLCAlMSwgJTNcblx0IgotICAgICAgICAgICAgInNtbGF3YiAlMCwgJTIsICUzLCAlMCIKLSAgICA6ICI9JnIqaSIoY3hfc3VtKQotICAgICAgICAgICAgICAgICAgICA6ICJyIihyeCksCi0gICAgICAgICAgICAgICAgICAgICJyIihyeSksCi0gICAgICAgICAgICAgICAgICAgICJyIihyZXhwKSk7Ci0KLSAgICAgICAgcmV0dXJuIChjeF9zdW0pOwotICAgIH0KLQotCi0gICAgc3RhdGljIGlubGluZSBJbnQzMiBmeHBfbXVsMzJfYnlfMTYoSW50MzIgTF92YXIxLCBjb25zdCBJbnQzMiBMX3ZhcjIpCi17Ci0KLSAgICAgICAgcmVnaXN0ZXIgSW50MzIgdG1wOwotICAgICAgICByZWdpc3RlciBJbnQzMiByYSA9IChJbnQzMilMX3ZhcjE7Ci0gICAgICAgIHJlZ2lzdGVyIEludDMyIHJiID0gKEludDMyKUxfdmFyMjsKLQotICAgICAgICBhc20gdm9sYXRpbGUoCi0gICAgICAgICAgICAic211bHdiICUwLCAlMSwgJTIiCi0gICAgOiAiPSZyKmkiKHRtcCkKLSAgICAgICAgICAgICAgICAgICAgOiAiciIocmEpLAotICAgICAgICAgICAgICAgICAgICAiciIocmIpKTsKLQotICAgICAgICByZXR1cm4gKHRtcCk7Ci0gICAgfQotCi0jZGVmaW5lIGZ4cF9tdWwzMl9ieV8xNmIoIGEsIGIpICAgZnhwX211bDMyX2J5XzE2KCBhLCBiKQotCi0KLSAgICBzdGF0aWMgaW5saW5lIEludDMyIGZ4cF9tdWwzMl9ieV8xNnQoSW50MzIgTF92YXIxLCBjb25zdCBJbnQzMiBMX3ZhcjIpCi17Ci0KLSAgICAgICAgcmVnaXN0ZXIgSW50MzIgdG1wOwotICAgICAgICByZWdpc3RlciBJbnQzMiByYSA9IChJbnQzMilMX3ZhcjE7Ci0gICAgICAgIHJlZ2lzdGVyIEludDMyIHJiID0gKEludDMyKUxfdmFyMjsKLQotICAgICAgICBhc20gdm9sYXRpbGUoCi0gICAgICAgICAgICAic211bHd0ICUwLCAlMSwgJTIiCi0gICAgOiAiPSZyKmkiKHRtcCkKLSAgICAgICAgICAgICAgICAgICAgOiAiciIocmEpLAotICAgICAgICAgICAgICAgICAgICAiciIocmIpKTsKLQotICAgICAgICByZXR1cm4gKHRtcCk7Ci0gICAgfQotCi0KLQotICAgIHN0YXRpYyBpbmxpbmUgSW50MzIgZnhwX21hYzMyX2J5XzE2KGNvbnN0IEludDMyIExfdmFyMSwgY29uc3QgSW50MzIgTF92YXIyLCBJbnQzMiBMX2FkZCkKLXsKLQotICAgICAgICByZWdpc3RlciBJbnQzMiB0bXA7Ci0gICAgICAgIHJlZ2lzdGVyIEludDMyIHJhID0gKEludDMyKUxfdmFyMTsKLSAgICAgICAgcmVnaXN0ZXIgSW50MzIgcmIgPSAoSW50MzIpTF92YXIyOwotICAgICAgICByZWdpc3RlciBJbnQzMiByYyA9IChJbnQzMilMX2FkZDsKLQotICAgICAgICBhc20gdm9sYXRpbGUoCi0gICAgICAgICAgICAic21sYXdiICUwLCAlMSwgJTIsICUzIgotICAgIDogIj0mcippIih0bXApCi0gICAgICAgICAgICAgICAgICAgIDogInIiKHJhKSwKLSAgICAgICAgICAgICAgICAgICAgInIiKHJiKSwKLSAgICAgICAgICAgICAgICAgICAgInIiKHJjKSk7Ci0KLSAgICAgICAgcmV0dXJuICh0bXApOwotICAgIH0KLQotCi0gICAgX19pbmxpbmUgIGludDY0IGZ4cF9tYWM2NF9RMzEoaW50NjQgc3VtLCBjb25zdCBJbnQzMiBMX3ZhcjEsIGNvbnN0IEludDMyIExfdmFyMikKLXsKLSAgICAgICAgc3VtICs9IChpbnQ2NClMX3ZhcjEgKiBMX3ZhcjI7Ci0gICAgICAgIHJldHVybiAoc3VtKTsKLSAgICB9Ci0KLQotCi0KLSAgICBzdGF0aWMgaW5saW5lIEludDMyIGZ4cF9tYWMzMl9RMzAoY29uc3QgSW50MzIgYSwgY29uc3QgSW50MzIgYiwgSW50MzIgTF9hZGQpCi0gICAgewotICAgICAgICBJbnQzMiByZXN1bHQ2NF9oaTsKLSAgICAgICAgSW50MzIgcmVzdWx0NjRfbG87Ci0gICAgICAgIHJlZ2lzdGVyIEludDMyIHJhID0gKEludDMyKWE7Ci0gICAgICAgIHJlZ2lzdGVyIEludDMyIHJiID0gKEludDMyKWI7Ci0gICAgICAgIHJlZ2lzdGVyIEludDMyIHJjID0gKEludDMyKUxfYWRkOwotCi0gICAgICAgIGFzbSB2b2xhdGlsZSgic211bGwgJTEsICUwLCAlMiwgJTNcblx0IgotICAgICAgICAgICAgICAgICAgICAgImFkZCAlNCwgJTQsICUwLCBhc2wgIzJcblx0IgotICAgICAgICAgICAgICAgICAgICAgImFkZCAlMCwgJTQsICUxLCBsc3IgIzMwIgotICAgICAgICAgICAgIDogIj0mcippIihyZXN1bHQ2NF9oaSksCi0gICAgICAgICAgICAgICAgICAgICAiPSZyKmkiKHJlc3VsdDY0X2xvKQotICAgICAgICAgICAgICAgICAgICAgICAgICAgICA6ICJyIihyYSksCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICJyIihyYiksCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICJyIihyYykpOwotCi0gICAgICAgIHJldHVybiAocmVzdWx0NjRfaGkpOwotICAgIH0KLQotCi0gICAgc3RhdGljIGlubGluZSBJbnQzMiBmeHBfbWFjMzJfUTMxKEludDMyIExfYWRkLCBjb25zdCBJbnQzMiBhLCBjb25zdCBJbnQzMiBiKQotewotCi0gICAgICAgIEludDMyIHJlc3VsdDY0X2hpOwotICAgICAgICBJbnQzMiByZXN1bHQ2NF9sbzsKLSAgICAgICAgcmVnaXN0ZXIgSW50MzIgcmEgPSAoSW50MzIpYTsKLSAgICAgICAgcmVnaXN0ZXIgSW50MzIgcmIgPSAoSW50MzIpYjsKLSAgICAgICAgcmVnaXN0ZXIgSW50MzIgcmMgPSAoSW50MzIpTF9hZGQ7Ci0KLSAgICAgICAgYXNtIHZvbGF0aWxlKCJzbXVsbCAlMSwgJTAsICUyLCAlM1xuXHQiCi0gICAgICAgICAgICAgICAgICAgICAiYWRkICUwLCAlMCwgJTQiCi0gICAgICAgICAgICAgOiAiPSZyKmkiKHJlc3VsdDY0X2hpKSwKLSAgICAgICAgICAgICAgICAgICAgICI9JnIqaSIocmVzdWx0NjRfbG8pCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgIDogInIiKHJhKSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgInIiKHJiKSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgInIiKHJjKSk7Ci0KLSAgICAgICAgcmV0dXJuIChyZXN1bHQ2NF9oaSk7Ci0gICAgfQotCi0KLQotICAgIHN0YXRpYyBpbmxpbmUgSW50MzIgZnhwX21zdTMyX1EzMShJbnQzMiBMX3N1YiwgY29uc3QgSW50MzIgYSwgY29uc3QgSW50MzIgYikKLXsKLSAgICAgICAgSW50MzIgcmVzdWx0NjRfaGk7Ci0gICAgICAgIEludDMyIHJlc3VsdDY0X2xvOwotICAgICAgICByZWdpc3RlciBJbnQzMiByYSA9IChJbnQzMilhOwotICAgICAgICByZWdpc3RlciBJbnQzMiByYiA9IChJbnQzMiliOwotICAgICAgICByZWdpc3RlciBJbnQzMiByYyA9IChJbnQzMilMX3N1YjsKLQotICAgICAgICBhc20gdm9sYXRpbGUoInNtdWxsICUxLCAlMCwgJTIsICUzXG5cdCIKLSAgICAgICAgICAgICAgICAgICAgICJzdWIgJTAsICU0LCAlMCIKLSAgICAgICAgICAgICA6ICI9JnIqaSIocmVzdWx0NjRfaGkpLAotICAgICAgICAgICAgICAgICAgICAgIj0mcippIihyZXN1bHQ2NF9sbykKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOiAiciIocmEpLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAiciIocmIpLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAiciIocmMpKTsKLQotCi0gICAgICAgIHJldHVybiAocmVzdWx0NjRfaGkpOwotICAgIH0KLQotCi0gICAgc3RhdGljIGlubGluZSBJbnQzMiBmeHBfbXVsMzJfUTMxKGNvbnN0IEludDMyIGEsIGNvbnN0IEludDMyIGIpCi17Ci0gICAgICAgIEludDMyIHJlc3VsdDY0X2hpOwotICAgICAgICBJbnQzMiByZXN1bHQ2NF9sbzsKLSAgICAgICAgcmVnaXN0ZXIgSW50MzIgcmEgPSAoSW50MzIpYTsKLSAgICAgICAgcmVnaXN0ZXIgSW50MzIgcmIgPSAoSW50MzIpYjsKLSAgICAgICAgYXNtIHZvbGF0aWxlKAotICAgICAgICAgICAgInNtdWxsICUxLCAlMCwgJTIsICUzIgotICAgIDogIj0mcippIihyZXN1bHQ2NF9oaSksCi0gICAgICAgICAgICAiPSZyKmkiKHJlc3VsdDY0X2xvKQotICAgICAgICAgICAgICAgICAgICA6ICJyIihyYSksCi0gICAgICAgICAgICAgICAgICAgICJyIihyYikpOwotCi0gICAgICAgIHJldHVybiAocmVzdWx0NjRfaGkpOwotICAgIH0KLQotCi0gICAgc3RhdGljIGlubGluZSBJbnQzMiBmeHBfbXVsMzJfUTMwKGNvbnN0IEludDMyIGEsIGNvbnN0IEludDMyIGIpCi17Ci0gICAgICAgIEludDMyIHJlc3VsdDY0X2hpOwotICAgICAgICBJbnQzMiByZXN1bHQ2NF9sbzsKLSAgICAgICAgcmVnaXN0ZXIgSW50MzIgcmEgPSAoSW50MzIpYTsKLSAgICAgICAgcmVnaXN0ZXIgSW50MzIgcmIgPSAoSW50MzIpYjsKLSAgICAgICAgYXNtIHZvbGF0aWxlKCJzbXVsbCAlMSwgJTAsICUyLCAlM1xuXHQiCi0gICAgICAgICAgICAgICAgICAgICAibW92ICUwLCAlMCwgbHNsICMyXG5cdCIKLSAgICAgICAgICAgICAgICAgICAgICJvcnIgICAlMCwgJTAsICUxLCBsc3IgIzMwIgotICAgICAgICAgICAgIDogIj0mcippIihyZXN1bHQ2NF9oaSksCi0gICAgICAgICAgICAgICAgICAgICAiPSZyKmkiKHJlc3VsdDY0X2xvKQotICAgICAgICAgICAgICAgICAgICAgICAgICAgICA6ICJyIihyYSksCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICJyIihyYikpOwotICAgICAgICByZXR1cm4gKHJlc3VsdDY0X2hpKTsKLSAgICB9Ci0KLQotCi0gICAgc3RhdGljIGlubGluZSBJbnQzMiBmeHBfbWFjMzJfUTI5KGNvbnN0IEludDMyIGEsIGNvbnN0IEludDMyIGIsIEludDMyIExfYWRkKQotewotICAgICAgICBJbnQzMiByZXN1bHQ2NF9oaTsKLSAgICAgICAgSW50MzIgcmVzdWx0NjRfbG87Ci0gICAgICAgIHJlZ2lzdGVyIEludDMyIHJhID0gKEludDMyKWE7Ci0gICAgICAgIHJlZ2lzdGVyIEludDMyIHJiID0gKEludDMyKWI7Ci0gICAgICAgIHJlZ2lzdGVyIEludDMyIHJjID0gKEludDMyKUxfYWRkOwotCi0gICAgICAgIGFzbSB2b2xhdGlsZSgic211bGwgJTEsICUwLCAlMiwgJTNcblx0IgotICAgICAgICAgICAgICAgICAgICAgImFkZCAgICU0LCAlNCwgJTAsIGxzbCAjM1xuXHQiCi0gICAgICAgICAgICAgICAgICAgICAiYWRkICAgJTAsICU0LCAlMSwgbHNyICMyOSIKLSAgICAgICAgICAgICA6ICI9JnIqaSIocmVzdWx0NjRfaGkpLAotICAgICAgICAgICAgICAgICAgICAgIj0mcippIihyZXN1bHQ2NF9sbykKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOiAiciIocmEpLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAiciIocmIpLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAiciIocmMpKTsKLQotICAgICAgICByZXR1cm4gKHJlc3VsdDY0X2hpKTsKLSAgICB9Ci0KLQotICAgIHN0YXRpYyBpbmxpbmUgSW50MzIgZnhwX21zdTMyX1EyOShjb25zdCBJbnQzMiBhLCBjb25zdCBJbnQzMiBiLCBJbnQzMiBMX3N1YikKLXsKLSAgICAgICAgSW50MzIgcmVzdWx0NjRfaGk7Ci0gICAgICAgIEludDMyIHJlc3VsdDY0X2xvOwotICAgICAgICByZWdpc3RlciBJbnQzMiByYSA9IChJbnQzMilhOwotICAgICAgICByZWdpc3RlciBJbnQzMiByYiA9IChJbnQzMiliOwotICAgICAgICByZWdpc3RlciBJbnQzMiByYyA9IChJbnQzMilMX3N1YjsKLQotICAgICAgICBhc20gdm9sYXRpbGUoInNtdWxsICUxLCAlMCwgJTIsICUzXG5cdCIKLSAgICAgICAgICAgICAgICAgICAgICJzdWIgICAlNCwgJTQsICUwLCBsc2wgIzNcblx0IgotICAgICAgICAgICAgICAgICAgICAgInN1YiAgICUwLCAlNCwgJTEsIGxzciAjMjkiCi0gICAgICAgICAgICAgOiAiPSZyKmkiKHJlc3VsdDY0X2hpKSwKLSAgICAgICAgICAgICAgICAgICAgICI9JnIqaSIocmVzdWx0NjRfbG8pCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgIDogInIiKHJhKSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgInIiKHJiKSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgInIiKHJjKSk7Ci0KLSAgICAgICAgcmV0dXJuIChyZXN1bHQ2NF9oaSk7Ci0gICAgfQotCi0gICAgc3RhdGljIGlubGluZSBJbnQzMiBmeHBfbXVsMzJfUTI5KGNvbnN0IEludDMyIGEsIGNvbnN0IEludDMyIGIpCi17Ci0gICAgICAgIEludDMyIHJlc3VsdDY0X2hpOwotICAgICAgICBJbnQzMiByZXN1bHQ2NF9sbzsKLSAgICAgICAgcmVnaXN0ZXIgSW50MzIgcmEgPSAoSW50MzIpYTsKLSAgICAgICAgcmVnaXN0ZXIgSW50MzIgcmIgPSAoSW50MzIpYjsKLSAgICAgICAgYXNtIHZvbGF0aWxlKCJzbXVsbCAlMSwgJTAsICUyLCAlM1xuXHQiCi0gICAgICAgICAgICAgICAgICAgICAibW92ICUwLCAlMCwgbHNsICMzXG5cdCIKLSAgICAgICAgICAgICAgICAgICAgICJvcnIgICAlMCwgJTAsICUxLCBsc3IgIzI5IgotICAgICAgICAgICAgIDogIj0mcippIihyZXN1bHQ2NF9oaSksCi0gICAgICAgICAgICAgICAgICAgICAiPSZyKmkiKHJlc3VsdDY0X2xvKQotICAgICAgICAgICAgICAgICAgICAgICAgICAgICA6ICJyIihyYSksCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICJyIihyYikpOwotICAgICAgICByZXR1cm4gKHJlc3VsdDY0X2hpKTsKLSAgICB9Ci0KLQotCi0gICAgc3RhdGljIGlubGluZSBJbnQzMiBmeHBfbXVsMzJfUTI4KGNvbnN0IEludDMyIGEsIGNvbnN0IEludDMyIGIpCi17Ci0gICAgICAgIEludDMyIHJlc3VsdDY0X2hpOwotICAgICAgICBJbnQzMiByZXN1bHQ2NF9sbzsKLSAgICAgICAgcmVnaXN0ZXIgSW50MzIgcmEgPSAoSW50MzIpYTsKLSAgICAgICAgcmVnaXN0ZXIgSW50MzIgcmIgPSAoSW50MzIpYjsKLSAgICAgICAgYXNtIHZvbGF0aWxlKCJzbXVsbCAlMSwgJTAsICUyLCAlM1xuXHQiCi0gICAgICAgICAgICAgICAgICAgICAibW92ICUwLCAlMCwgbHNsICM0XG5cdCIKLSAgICAgICAgICAgICAgICAgICAgICJvcnIgICAlMCwgJTAsICUxLCBsc3IgIzI4IgotICAgICAgICAgICAgIDogIj0mcippIihyZXN1bHQ2NF9oaSksCi0gICAgICAgICAgICAgICAgICAgICAiPSZyKmkiKHJlc3VsdDY0X2xvKQotICAgICAgICAgICAgICAgICAgICAgICAgICAgICA6ICJyIihyYSksCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICJyIihyYikpOwotICAgICAgICByZXR1cm4gKHJlc3VsdDY0X2hpKTsKLSAgICB9Ci0KLSAgICBzdGF0aWMgaW5saW5lIEludDMyIGZ4cF9tdWwzMl9RMjcoY29uc3QgSW50MzIgYSwgY29uc3QgSW50MzIgYikKLXsKLSAgICAgICAgSW50MzIgcmVzdWx0NjRfaGk7Ci0gICAgICAgIEludDMyIHJlc3VsdDY0X2xvOwotICAgICAgICByZWdpc3RlciBJbnQzMiByYSA9IChJbnQzMilhOwotICAgICAgICByZWdpc3RlciBJbnQzMiByYiA9IChJbnQzMiliOwotICAgICAgICBhc20gdm9sYXRpbGUoInNtdWxsICUxLCAlMCwgJTIsICUzXG5cdCIKLSAgICAgICAgICAgICAgICAgICAgICJtb3YgJTAsICUwLCBsc2wgIzVcblx0IgotICAgICAgICAgICAgICAgICAgICAgIm9yciAgICUwLCAlMCwgJTEsIGxzciAjMjciCi0gICAgICAgICAgICAgOiAiPSZyKmkiKHJlc3VsdDY0X2hpKSwKLSAgICAgICAgICAgICAgICAgICAgICI9JnIqaSIocmVzdWx0NjRfbG8pCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgIDogInIiKHJhKSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgInIiKHJiKSk7Ci0KLSAgICAgICAgcmV0dXJuIChyZXN1bHQ2NF9oaSk7Ci0gICAgfQotCi0KLSAgICBzdGF0aWMgaW5saW5lIEludDMyIGZ4cF9tdWwzMl9RMjYoY29uc3QgSW50MzIgYSwgY29uc3QgSW50MzIgYikKLXsKLSAgICAgICAgSW50MzIgcmVzdWx0NjRfaGk7Ci0gICAgICAgIEludDMyIHJlc3VsdDY0X2xvOwotICAgICAgICByZWdpc3RlciBJbnQzMiByYSA9IChJbnQzMilhOwotICAgICAgICByZWdpc3RlciBJbnQzMiByYiA9IChJbnQzMiliOwotICAgICAgICBhc20gdm9sYXRpbGUoInNtdWxsICUxLCAlMCwgJTIsICUzXG5cdCIKLSAgICAgICAgICAgICAgICAgICAgICJtb3YgJTAsICUwLCBsc2wgIzZcblx0IgotICAgICAgICAgICAgICAgICAgICAgIm9yciAgICUwLCAlMCwgJTEsIGxzciAjMjYiCi0gICAgICAgICAgICAgOiAiPSZyKmkiKHJlc3VsdDY0X2hpKSwKLSAgICAgICAgICAgICAgICAgICAgICI9JnIqaSIocmVzdWx0NjRfbG8pCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgIDogInIiKHJhKSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgInIiKHJiKSk7Ci0KLSAgICAgICAgcmV0dXJuIChyZXN1bHQ2NF9oaSk7Ci0gICAgfQotCi0KLSAgICBzdGF0aWMgaW5saW5lIEludDMyIGZ4cF9tdWwzMl9RMjAoY29uc3QgSW50MzIgYSwgY29uc3QgSW50MzIgYikKLXsKLSAgICAgICAgSW50MzIgcmVzdWx0NjRfaGk7Ci0gICAgICAgIEludDMyIHJlc3VsdDY0X2xvOwotICAgICAgICByZWdpc3RlciBJbnQzMiByYSA9IChJbnQzMilhOwotICAgICAgICByZWdpc3RlciBJbnQzMiByYiA9IChJbnQzMiliOwotICAgICAgICBhc20gdm9sYXRpbGUoInNtdWxsICUxLCAlMCwgJTIsICUzXG5cdCIKLSAgICAgICAgICAgICAgICAgICAgICJtb3YgJTAsICUwLCBsc2wgIzEyXG5cdCIKLSAgICAgICAgICAgICAgICAgICAgICJvcnIgICAlMCwgJTAsICUxLCBsc3IgIzIwIgotICAgICAgICAgICAgIDogIj0mcippIihyZXN1bHQ2NF9oaSksCi0gICAgICAgICAgICAgICAgICAgICAiPSZyKmkiKHJlc3VsdDY0X2xvKQotICAgICAgICAgICAgICAgICAgICAgICAgICAgICA6ICJyIihyYSksCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICJyIihyYikpOwotCi0gICAgICAgIHJldHVybiAocmVzdWx0NjRfaGkpOwotICAgIH0KLQotCi0gICAgc3RhdGljIGlubGluZSBJbnQzMiBmeHBfbXVsMzJfUTE1KGNvbnN0IEludDMyIGEsIGNvbnN0IEludDMyIGIpCi17Ci0gICAgICAgIEludDMyIHJlc3VsdDY0X2hpOwotICAgICAgICBJbnQzMiByZXN1bHQ2NF9sbzsKLSAgICAgICAgcmVnaXN0ZXIgSW50MzIgcmEgPSAoSW50MzIpYTsKLSAgICAgICAgcmVnaXN0ZXIgSW50MzIgcmIgPSAoSW50MzIpYjsKLSAgICAgICAgYXNtIHZvbGF0aWxlKCJzbXVsbCAlMSwgJTAsICUyLCAlM1xuXHQiCi0gICAgICAgICAgICAgICAgICAgICAibW92ICUwLCAlMCwgbHNsICMxN1xuXHQiCi0gICAgICAgICAgICAgICAgICAgICAib3JyICAgJTAsICUwLCAlMSwgbHNyICMxNSIKLSAgICAgICAgICAgICA6ICI9JnIqaSIocmVzdWx0NjRfaGkpLAotICAgICAgICAgICAgICAgICAgICAgIj0mcippIihyZXN1bHQ2NF9sbykKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOiAiciIocmEpLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAiciIocmIpKTsKLQotICAgICAgICByZXR1cm4gKHJlc3VsdDY0X2hpKTsKLSAgICB9Ci0KLQotCi0gICAgc3RhdGljIGlubGluZSBJbnQzMiBmeHBfbXVsMzJfUTE0KGNvbnN0IEludDMyIGEsIGNvbnN0IEludDMyIGIpCi17Ci0gICAgICAgIEludDMyIHJlc3VsdDY0X2hpOwotICAgICAgICBJbnQzMiByZXN1bHQ2NF9sbzsKLSAgICAgICAgcmVnaXN0ZXIgSW50MzIgcmEgPSAoSW50MzIpYTsKLSAgICAgICAgcmVnaXN0ZXIgSW50MzIgcmIgPSAoSW50MzIpYjsKLSAgICAgICAgYXNtIHZvbGF0aWxlKCJzbXVsbCAlMSwgJTAsICUyLCAgJTNcblx0IgotICAgICAgICAgICAgICAgICAgICAgIm1vdiAgICUwLCAlMCwgbHNsICMxOFxuXHQiCi0gICAgICAgICAgICAgICAgICAgICAib3JyICAgJTAsICUwLCAlMSwgbHNyICMxNCIKLSAgICAgICAgICAgICA6ICI9JnIqaSIocmVzdWx0NjRfaGkpLAotICAgICAgICAgICAgICAgICAgICAgIj0mcippIihyZXN1bHQ2NF9sbykKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOiAiciIocmEpLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAiciIocmIpKTsKLQotICAgICAgICByZXR1cm4gKHJlc3VsdDY0X2hpKTsKLSAgICB9Ci0KLSNlbmRpZgotCi0KLSNpZmRlZiBfX2NwbHVzcGx1cwotfQotI2VuZGlmCi0KLQotI2VuZGlmICAgLyogIEZYUF9NVUwzMiAgKi8KLQpkaWZmIC0tZ2l0IGEvbWVkaWEvbGlic3RhZ2VmcmlnaHQvY29kZWNzL2FhY2RlYy9meHBfbXVsMzJfYXJtX3Y0LmggYi9tZWRpYS9saWJzdGFnZWZyaWdodC9jb2RlY3MvYWFjZGVjL2Z4cF9tdWwzMl9hcm1fdjQuaApkZWxldGVkIGZpbGUgbW9kZSAxMDA2NDQKaW5kZXggNjg2OWM1N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AgICAgIHsKLSAgICAgICAgICAgIG1vdiB4LCBMX3ZhcjEsIGFzbCAxCi0gICAgICAgICAgICB0ZXEgTF92YXIxLCB4LCBhc3IgegotICAgICAgICAgICAgZW9ybmUgIHgsIElOVDMyX01BWCwgTF92YXIxLCBhc3IgIzMxCi0gICAgICAgIH0KLQotICAgICAgICByZXR1cm4oeCk7Ci0gICAgfQotCi0KLSAgICBfX2lubGluZSAgSW50MzIgZnhwX211bF8xNl9ieV8xNmJiKEludDMyIExfdmFyMSwgIEludDMyIExfdmFyMikKLSAgICB7Ci0gICAgICAgIF9fYXNtCi0gICAgICAgIHsKLQotICAgICAgICAgICAgbW92IExfdmFyMiwgTF92YXIyLCBhc2wgIzE2Ci0gICAgICAgICAgICBtb3YgTF92YXIyLCBMX3ZhcjIsIGFzciAjMTYKLSAgICAgICAgICAgIG1vdiBMX3ZhcjEsIExfdmFyMSwgYXNsICMxNgotICAgICAgICAgICAgbW92IExfdmFyMSwgTF92YXIxLCBhc3IgIzE2Ci0KLQotICAgICAgICAgICAgbXVsIExfdmFyMSwgTF92YXIyLCBMX3ZhcjEKLSAgICAgICAgfQotCi0gICAgICAgIHJldHVybiBMX3ZhcjE7Ci0KLSAgICB9Ci0KLQotI2RlZmluZSBmeHBfbXVsXzE2X2J5XzE2KGEsIGIpICBmeHBfbXVsXzE2X2J5XzE2YmIoICBhLCBiKQotCi0KLSAgICBfX2lubGluZSAgSW50MzIgZnhwX211bF8xNl9ieV8xNnRiKEludDMyIExfdmFyMSwgIEludDMyIExfdmFyMikKLSAgICB7Ci0gICAgICAgIF9fYXNtCi0gICAgICAgIHsKLSAgICAgICAgICAgIG1vdiBMX3ZhcjIsIExfdmFyMiwgYXNsICMxNgotICAgICAgICAgICAgbW92IExfdmFyMiwgTF92YXIyLCBhc3IgIzE2Ci0gICAgICAgICAgICBtb3YgTF92YXIxLCBMX3ZhcjEsIGFzciAjMTYKLQotICAgICAgICAgICAgbXVsIExfdmFyMSwgTF92YXIyLCBMX3ZhcjEKLSAgICAgICAgfQotICAgICAgICByZXR1cm4gTF92YXIxOwotICAgIH0KLQotICAgIF9faW5saW5lICBJbnQzMiBmeHBfbXVsXzE2X2J5XzE2YnQoSW50MzIgTF92YXIxLCAgSW50MzIgTF92YXIyKQotICAgIHsKLSAgICAgICAgX19hc20KLSAgICAgICAgewotICAgICAgICAgICAgbW92IExfdmFyMiwgTF92YXIyLCBhc3IgIzE2Ci0gICAgICAgICAgICBtb3YgTF92YXIxLCBMX3ZhcjEsIGFzbCAjMTYKLSAgICAgICAgICAgIG1vdiBMX3ZhcjEsIExfdmFyMSwgYXNyICMxNgotCi0gICAgICAgICAgICBtdWwgTF92YXIxLCBMX3ZhcjIsIExfdmFyMQotICAgICAgICB9Ci0KLSAgICAgICAgcmV0dXJuIExfdmFyMTsKLQotICAgIH0KLQotCi0gICAgX19pbmxpbmUgIEludDMyIGZ4cF9tdWxfMTZfYnlfMTZ0dChJbnQzMiBMX3ZhcjEsICBJbnQzMiBMX3ZhcjIpCi0gICAgewotICAgICAgICBfX2FzbQotICAgICAgICB7Ci0gICAgICAgICAgICBtb3YgTF92YXIyLCBMX3ZhcjIsIGFzciAjMTYKLSAgICAgICAgICAgIG1vdiBMX3ZhcjEsIExfdmFyMSwgYXNyICMxNgotCi0gICAgICAgICAgICBtdWwgTF92YXIxLCBMX3ZhcjIsIExfdmFyMQotICAgICAgICB9Ci0KLSAgICAgICAgcmV0dXJuIExfdmFyMTsKLQotICAgIH0KLQotICAgIF9faW5saW5lICBJbnQzMiBmeHBfbWFjXzE2X2J5XzE2KGNvbnN0IEludDMyIExfdmFyMSwgY29uc3QgSW50MzIgTF92YXIyLCBJbnQzMiBMX2FkZCkKLSAgICB7Ci0gICAgICAgIF9fYXNtCi0gICAgICAgIHsKLSAgICAgICAgICAgIG1sYSBMX2FkZCwgTF92YXIxLCBMX3ZhcjIsIExfYWRkCi0gICAgICAgIH0KLSAgICAgICAgcmV0dXJuIChMX2FkZCk7Ci0gICAgfQotCi0KLSAgICBfX2lubGluZSAgSW50MzIgZnhwX21hY18xNl9ieV8xNl9iYihjb25zdCBJbnQzMiBMX3ZhcjEsICBJbnQzMiBMX3ZhcjIsIEludDMyIExfYWRkKQotICAgIHsKLSAgICAgICAgX19hc20KLSAgICAgICAgewotICAgICAgICAgICAgbW92IExfdmFyMiwgTF92YXIyLCBhc2wgIzE2Ci0gICAgICAgICAgICBtb3YgTF92YXIyLCBMX3ZhcjIsIGFzciAjMTYKLSAgICAgICAgICAgIG1sYSBMX2FkZCwgTF92YXIxLCBMX3ZhcjIsIExfYWRkCi0gICAgICAgIH0KLSAgICAgICAgcmV0dXJuIExfYWRkOwotICAgIH0KLQotICAgIF9faW5saW5lICBJbnQzMiBmeHBfbWFjXzE2X2J5XzE2X2J0KEludDE2IExfdmFyMSwgIEludDMyIExfdmFyMiwgSW50MzIgTF9hZGQpCi0gICAgewotICAgICAgICBfX2FzbQotICAgICAgICB7Ci0gICAgICAgICAgICBtb3YgTF92YXIyLCBMX3ZhcjIsIGFzciAjMTYKLSAgICAgICAgICAgIG1sYSBMX2FkZCwgTF92YXIxLCBMX3ZhcjIsIExfYWRkCi0gICAgICAgIH0KLSAgICAgICAgcmV0dXJuIExfYWRkOwotICAgIH0KLQotCi0gICAgX19pbmxpbmUgIEludDMyIGNtcGx4X211bDMyX2J5XzE2KEludDMyIHgsIGNvbnN0IEludDMyIHksIEludDMyIGV4cF9qdykKLSAgICB7Ci0KLSAgICAgICAgSW50MzIgcmVzdWx0NjRfaGk7Ci0gICAgICAgIEludDMyIHJUbXAwOwotICAgICAgICBJbnQzMiBpVG1wMDsKLSAgICAgICAgX19hc20KLSAgICAgICAgewotICAgICAgICAgICAgbW92IHJUbXAwLCBleHBfancsIGFzciAjMTYKLSAgICAgICAgICAgIG1vdiByVG1wMCwgclRtcDAsIGFzbCAjMTYKLSAgICAgICAgICAgIG1vdiBpVG1wMCwgZXhwX2p3LCBhc2wgIzE2Ci0gICAgICAgICAgICBzbXVsbCByVG1wMCwgcmVzdWx0NjRfaGksIHgsIHJUbXAwCi0gICAgICAgICAgICBzbWxhbCBpVG1wMCwgcmVzdWx0NjRfaGksIHksIGlUbXAwCi0gICAgICAgIH0KLQotICAgICAgICByZXR1cm4gKHJlc3VsdDY0X2hpKTsKLSAgICB9Ci0KLQotICAgIF9faW5saW5lICBJbnQzMiBmeHBfbXVsMzJfYnlfMTYoSW50MzIgTF92YXIxLCBJbnQzMiBMX3ZhcjIpCi0gICAgewotICAgICAgICBJbnQzMiByZXN1bHQ2NF9oaTsKLSAgICAgICAgX19hc20KLSAgICAgICAgewotICAgICAgICAgICAgbW92IExfdmFyMiwgTF92YXIyLCBhc2wgIzE2Ci0gICAgICAgICAgICBzbXVsbCBMX3ZhcjEsIHJlc3VsdDY0X2hpLCBMX3ZhcjIsIExfdmFyMQotICAgICAgICB9Ci0gICAgICAgIHJldHVybiAocmVzdWx0NjRfaGkpOwotICAgIH0KLQotCi0KLSNkZWZpbmUgZnhwX211bDMyX2J5XzE2YiggYSwgYikgICBmeHBfbXVsMzJfYnlfMTYoIGEsIGIpCi0KLQotCi0gICAgX19pbmxpbmUgIEludDMyIGZ4cF9tdWwzMl9ieV8xNnQoSW50MzIgTF92YXIxLCBJbnQzMiBMX3ZhcjIpCi0gICAgewotCi0gICAgICAgIEludDMyIHJlc3VsdDY0X2hpOwotICAgICAgICBfX2FzbQotICAgICAgICB7Ci0gICAgICAgICAgICBtb3YgTF92YXIyLCBMX3ZhcjIsIGFzciAjMTYKLSAgICAgICAgICAgIG1vdiBMX3ZhcjIsIExfdmFyMiwgYXNsICMxNgotICAgICAgICAgICAgc211bGwgTF92YXIxLCByZXN1bHQ2NF9oaSwgTF92YXIyLCBMX3ZhcjEKLSAgICAgICAgfQotICAgICAgICByZXR1cm4gKHJlc3VsdDY0X2hpKTsKLQotICAgIH0KLQotICAgIF9faW5saW5lICBJbnQzMiBmeHBfbWFjMzJfYnlfMTYoSW50MzIgTF92YXIxLCBJbnQzMiBMX3ZhcjIsIEludDMyIExfYWRkKQotICAgIHsKLQotICAgICAgICBfX2FzbQotICAgICAgICB7Ci0gICAgICAgICAgICBtb3YgTF92YXIyLCBMX3ZhcjIsIGFzbCAjMTYKLSAgICAgICAgICAgIHNtbGFsIExfdmFyMSwgTF9hZGQsIExfdmFyMiwgTF92YXIxCi0gICAgICAgIH0KLQotICAgICAgICByZXR1cm4gKExfYWRkKTsKLSAgICB9Ci0KLQotICAgIF9faW5saW5lICBpbnQ2NCBmeHBfbWFjNjRfUTMxKGludDY0IHN1bSwgY29uc3QgSW50MzIgTF92YXIxLCBjb25zdCBJbnQzMiBMX3ZhcjIpCi0gICAgewotICAgICAgICB1aW50MzIgYiA9IChVSW50MzIpKHN1bSk7Ci0gICAgICAgIGludDMyIGMgPSBJbnQzMihzdW0gPj4gMzIpOwotICAgICAgICBfX2FzbQotICAgICAgICB7Ci0gICAgICAgICAgICBzbWxhbCBiLCBjLCBMX3ZhcjEsIExfdmFyMgotICAgICAgICB9Ci0gICAgICAgIHJldHVybiAoKChpbnQ2NChjKSkgPDwgMzIpIHwgYik7Ci0gICAgfQotCi0KLSAgICBfX2lubGluZSAgSW50MzIgZnhwX211bDMyX1EzMShJbnQzMiBMX3ZhcjEsIGNvbnN0IEludDMyIExfdmFyMikKLSAgICB7Ci0gICAgICAgIEludDMyIHJlc3VsdDY0X2hpOwotICAgICAgICBfX2FzbQotICAgICAgICB7Ci0gICAgICAgICAgICBzbXVsbCBMX3ZhcjEsIHJlc3VsdDY0X2hpLCBMX3ZhcjIsIExfdmFyMQotICAgICAgICB9Ci0gICAgICAgIHJldHVybiAocmVzdWx0NjRfaGkpOwotICAgIH0KLQotCi0gICAgX19pbmxpbmUgIEludDMyIGZ4cF9tYWMzMl9RMzEoSW50MzIgTF9hZGQsICBJbnQzMiBMX3ZhcjEsIGNvbnN0IEludDMyIExfdmFyMikKLSAgICB7Ci0gICAgICAgIF9fYXNtCi0gICAgICAgIHsKLSAgICAgICAgICAgIHNtbGFsIExfdmFyMSwgTF9hZGQsIExfdmFyMiwgTF92YXIxCi0gICAgICAgIH0KLSAgICAgICAgcmV0dXJuIExfYWRkOwotICAgIH0KLQotICAgIF9faW5saW5lICBJbnQzMiBmeHBfbXN1MzJfUTMxKEludDMyIExfc3ViLCAgSW50MzIgTF92YXIxLCBjb25zdCBJbnQzMiBMX3ZhcjIpCi0gICAgewotICAgICAgICBfX2FzbQotICAgICAgICB7Ci0gICAgICAgICAgICByc2IgICBMX3ZhcjEsIExfdmFyMSwgIzAKLSAgICAgICAgICAgIHNtbGFsIExfdmFyMSwgTF9zdWIsIExfdmFyMiwgTF92YXIxCi0gICAgICAgIH0KLSAgICAgICAgcmV0dXJuIExfc3ViOwotICAgIH0KLQotCi0gICAgX19pbmxpbmUgIEludDMyIGZ4cF9tdWwzMl9RMzAoY29uc3QgSW50MzIgTF92YXIxLCBjb25zdCBJbnQzMiBMX3ZhcjIpCi0gICAgewotICAgICAgICBJbnQzMiByZXN1bHQ2NF9oaTsKLSAgICAgICAgSW50MzIgcmVzdWx0NjRfbG87Ci0gICAgICAgIF9fYXNtCi0gICAgICAgIHsKLSAgICAgICAgICAgIHNtdWxsIHJlc3VsdDY0X2xvLCByZXN1bHQ2NF9oaSwgTF92YXIyLCBMX3ZhcjEKLSAgICAgICAgICAgIG1vdiByZXN1bHQ2NF9oaSwgcmVzdWx0NjRfaGksIGFzbCAgIzIKLSAgICAgICAgICAgIG9yciAgcmVzdWx0NjRfaGksIHJlc3VsdDY0X2hpLCByZXN1bHQ2NF9sbywgbHNyICMzMAotICAgICAgICB9Ci0gICAgICAgIHJldHVybiAocmVzdWx0NjRfaGkpOwotICAgIH0KLQotCi0gICAgX19pbmxpbmUgIEludDMyIGZ4cF9tYWMzMl9RMzAoY29uc3QgSW50MzIgTF92YXIxLCBjb25zdCBJbnQzMiBMX3ZhcjIsIEludDMyIExfYWRkKQotICAgIHsKLSAgICAgICAgSW50MzIgcmVzdWx0NjRfaGk7Ci0gICAgICAgIEludDMyIHJlc3VsdDY0X2xvOwotICAgICAgICBfX2FzbQotICAgICAgICB7Ci0gICAgICAgICAgICBzbXVsbCByZXN1bHQ2NF9sbywgcmVzdWx0NjRfaGksIExfdmFyMiwgTF92YXIxCi0gICAgICAgICAgICBhZGQgTF9hZGQsIExfYWRkLCByZXN1bHQ2NF9oaSwgYXNsICAjMgotICAgICAgICAgICAgYWRkIExfYWRkLCBMX2FkZCwgcmVzdWx0NjRfbG8sIGxzciAgIzMwCi0gICAgICAgIH0KLSAgICAgICAgcmV0dXJuIChMX2FkZCk7Ci0gICAgfQotCi0KLSAgICBfX2lubGluZSAgSW50MzIgZnhwX211bDMyX1EyOShjb25zdCBJbnQzMiBMX3ZhcjEsIGNvbnN0IEludDMyIExfdmFyMikKLSAgICB7Ci0gICAgICAgIEludDMyIHJlc3VsdDY0X2hpOwotICAgICAgICBJbnQzMiByZXN1bHQ2NF9sbzsKLSAgICAgICAgX19hc20KLSAgICAgICAgewotICAgICAgICAgICAgc211bGwgcmVzdWx0NjRfbG8sIHJlc3VsdDY0X2hpLCBMX3ZhcjIsIExfdmFyMQotICAgICAgICAgICAgbW92IHJlc3VsdDY0X2hpLCByZXN1bHQ2NF9oaSwgYXNsICAjMwotICAgICAgICAgICAgb3JyICByZXN1bHQ2NF9oaSwgcmVzdWx0NjRfaGksIHJlc3VsdDY0X2xvLCBsc3IgIzI5Ci0gICAgICAgIH0KLSAgICAgICAgcmV0dXJuIChyZXN1bHQ2NF9oaSk7Ci0gICAgfQotCi0gICAgX19pbmxpbmUgIEludDMyIGZ4cF9tYWMzMl9RMjkoY29uc3QgSW50MzIgTF92YXIxLCBjb25zdCBJbnQzMiBMX3ZhcjIsIEludDMyIExfYWRkKQotICAgIHsKLSAgICAgICAgSW50MzIgcmVzdWx0NjRfaGk7Ci0gICAgICAgIEludDMyIHJlc3VsdDY0X2xvOwotICAgICAgICBfX2FzbQotICAgICAgICB7Ci0gICAgICAgICAgICBzbXVsbCByZXN1bHQ2NF9sbywgcmVz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AgICAgICAgIG9yciAgcmVzdWx0NjRfaGksIHJlc3VsdDY0X2hpLCByZXN1bHQ2NF9sbywgbHNyICMyOAotICAgICAgICB9Ci0gICAgICAgIHJldHVybiAocmVzdWx0NjRfaGkpOwotICAgIH0KLQotICAgIF9faW5saW5lICBJbnQzMiBmeHBfbXVsMzJfUTI3KGNvbnN0IEludDMyIExfdmFyMSwgY29uc3QgSW50MzIgTF92YXIyKQotICAgIHsKLSAgICAgICAgSW50MzIgcmVzdWx0NjRfaGk7Ci0gICAgICAgIEludDMyIHJlc3VsdDY0X2xvOwotICAgICAgICBfX2FzbQotICAgICAgICB7Ci0gICAgICAgICAgICBzbXVsbCByZXN1bHQ2NF9sbywgcmVzdWx0NjRfaGksIExfdmFyMiwgTF92YXIxCi0gICAgICAgICAgICBtb3YgcmVzdWx0NjRfaGksIHJlc3VsdDY0X2hpLCBhc2wgICM1Ci0gICAgICAgICAgICBvcnIgIHJlc3VsdDY0X2hpLCByZXN1bHQ2NF9oaSwgcmVzdWx0NjRfbG8sIGxzciAjMjcKLSAgICAgICAgfQotICAgICAgICByZXR1cm4gKHJlc3VsdDY0X2hpKTsKLSAgICB9Ci0KLSAgICBfX2lubGluZSAgSW50MzIgZnhwX211bDMyX1EyNihjb25zdCBJbnQzMiBMX3ZhcjEsIGNvbnN0IEludDMyIExfdmFyMikKLSAgICB7Ci0gICAgICAgIEludDMyIHJlc3VsdDY0X2hpOwotICAgICAgICBJbnQzMiByZXN1bHQ2NF9sbzsKLSAgICAgICAgX19hc20KLSAgICAgICAgewotICAgICAgICAgICAgc211bGwgcmVzdWx0NjRfbG8sIHJlc3VsdDY0X2hpLCBMX3ZhcjIsIExfdmFyMQotICAgICAgICAgICAgbW92IHJlc3VsdDY0X2hpLCByZXN1bHQ2NF9oaSwgYXNsICAjNgotICAgICAgICAgICAgb3JyICByZXN1bHQ2NF9oaSwgcmVzdWx0NjRfaGksIHJlc3VsdDY0X2xvLCBsc3IgIzI2Ci0gICAgICAgIH0KLSAgICAgICAgcmV0dXJuIChyZXN1bHQ2NF9oaSk7Ci0gICAgfQotCi0gICAgX19pbmxpbmUgIEludDMyIGZ4cF9tdWwzMl9RMjAoY29uc3QgSW50MzIgTF92YXIxLCBjb25zdCBJbnQzMiBMX3ZhcjIpCi0gICAgewotICAgICAgICBJbnQzMiByZXN1bHQ2NF9oaTsKLSAgICAgICAgSW50MzIgcmVzdWx0NjRfbG87Ci0gICAgICAgIF9fYXNtCi0gICAgICAgIHsKLSAgICAgICAgICAgIHNtdWxsIHJlc3VsdDY0X2xvLCByZXN1bHQ2NF9oaSwgTF92YXIyLCBMX3ZhcjEKLSAgICAgICAgICAgIG1vdiByZXN1bHQ2NF9oaSwgcmVzdWx0NjRfaGksIGFzbCAgIzEyCi0gICAgICAgICAgICBvcnIgIHJlc3VsdDY0X2hpLCByZXN1bHQ2NF9oaSwgcmVzdWx0NjRfbG8sIGxzciAjMjAKLSAgICAgICAgfQotICAgICAgICByZXR1cm4gKHJlc3VsdDY0X2hpKTsKLSAgICB9Ci0KLSAgICBfX2lubGluZSAgSW50MzIgZnhwX211bDMyX1ExNShjb25zdCBJbnQzMiBMX3ZhcjEsIGNvbnN0IEludDMyIExfdmFyMikKLSAgICB7Ci0gICAgICAgIEludDMyIHJlc3VsdDY0X2hpOwotICAgICAgICBJbnQzMiByZXN1bHQ2NF9sbzsKLSAgICAgICAgX19hc20KLSAgICAgICAgewotICAgICAgICAgICAgc211bGwgcmVzdWx0NjRfbG8sIHJlc3VsdDY0X2hpLCBMX3ZhcjIsIExfdmFyMQotICAgICAgICAgICAgbW92IHJlc3VsdDY0X2hpLCByZXN1bHQ2NF9oaSwgYXNsICAjMTcKLSAgICAgICAgICAgIG9yciAgcmVzdWx0NjRfaGksIHJlc3VsdDY0X2hpLCByZXN1bHQ2NF9sbywgbHNyICMxNQotICAgICAgICB9Ci0gICAgICAgIHJldHVybiAocmVzdWx0NjRfaGkpOwotICAgIH0KLQotCi0KLQotICAgIF9faW5saW5lICBJb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ICAgICAgICAgICAgICAgICAgICA6ICJyIihyYSksCi0gICAgICAgICAgICAgICAgICAgICJyIih6KSk7Ci0KLSAgICAgICAgcmV0dXJuKHgpOwotICAgIH0KLQotICAgIHN0YXRpYyBpbmxpbmUgSW50MzIgZnhwX211bF8xNl9ieV8xNmJiKEludDMyIExfdmFyMSwgSW50MzIgTF92YXIyKQotewotCi0gICAgICAgIEludDMyIHRtcDE7Ci0gICAgICAgIEludDMyIHRtcDI7Ci0gICAgICAgIHJlZ2lzdGVyIEludDMyIHJhID0gKEludDMyKUxfdmFyMTsKLSAgICAgICAgcmVnaXN0ZXIgSW50MzIgcmIgPSAoSW50MzIpTF92YXIyOwotCi0gICAgICAgIGFzbSB2b2xhdGlsZSgKLSAgICAgICAgICAgICJtb3YgJTAsICUzLCBhc2wgIzE2XG5cdCIKLSAgICAgICAgICAgICJtb3YgJTAsICUwLCBhc3IgIzE2XG5cdCIKLSAgICAgICAgICAgICJtb3YgJTEsICUyLCBhc2wgIzE2XG5cdCIKLSAgICAgICAgICAgICJtb3YgJTEsICUxLCBhc3IgIzE2XG5cdCIKLSAgICAgICAgICAgICJtdWwgJTAsICUxLCAlMCIKLSAgICA6ICI9JnIqaSIodG1wMSksCi0gICAgICAgICAgICAiPSZyKmkiKHRtcDIpCi0gICAgICAgICAgICAgICAgICAgIDogInIiKHJhKSwKLSAgICAgICAgICAgICAgICAgICAgInIiKHJiKSk7Ci0KLSAgICAgICAgcmV0dXJuICh0bXAxKTsKLQotICAgIH0KLQotI2RlZmluZSBmeHBfbXVsXzE2X2J5XzE2KGEsIGIpICBmeHBfbXVsXzE2X2J5XzE2YmIoICBhLCBiKQotCi0KLSAgICBzdGF0aWMgaW5saW5lIEludDMyIGZ4cF9tdWxfMTZfYnlfMTZ0YihJbnQzMiBMX3ZhcjEsIEludDMyIExfdmFyMikKLXsKLQotICAgICAgICBJbnQzMiB0bXAxOwotICAgICAgICBJbnQzMiB0bXAyOwotICAgICAgICByZWdpc3RlciBJbnQzMiByYSA9IChJbnQzMilMX3ZhcjE7Ci0gICAgICAgIHJlZ2lzdGVyIEludDMyIHJiID0gKEludDMyKUxfdmFyMjsKLQotICAgICAgICBhc20gdm9sYXRpbGUoCi0gICAgICAgICAgICAibW92ICUwLCAlMywgYXNsICMxNlxuXHQiCi0gICAgICAgICAgICAibW92ICUwLCAlMCwgYXNyICMxNlxuXHQiCi0gICAgICAgICAgICAibW92ICUxLCAlMiwgYXNyICMxNlxuXHQiCi0gICAgICAgICAgICAibXVsICUwLCAlMSwgJTAiCi0gICAgOiAiPSZyKmkiKHRtcDEpLAotICAgICAgICAgICAgIj0mcippIih0bXAyKQotICAgICAgICAgICAgICAgICAgICA6ICJyIihyYSksCi0gICAgICAgICAgICAgICAgICAgICJyIihyYikpOwotCi0gICAgICAgIHJldHVybiAodG1wMSk7Ci0KLSAgICB9Ci0KLQotICAgIHN0YXRpYyBpbmxpbmUgSW50MzIgZnhwX211bF8xNl9ieV8xNmJ0KEludDMyIExfdmFyMSwgSW50MzIgTF92YXIyKQotewotCi0gICAgICAgIEludDMyIHRtcDE7Ci0gICAgICAgIEludDMyIHRtcDI7Ci0gICAgICAgIHJlZ2lzdGVyIEludDMyIHJhID0gKEludDMyKUxfdmFyMTsKLSAgICAgICAgcmVnaXN0ZXIgSW50MzIgcmIgPSAoSW50MzIpTF92YXIyOwotCi0gICAgICAgIGFzbSB2b2xhdGlsZSgKLSAgICAgICAgICAgICJtb3YgJTAsICUzLCBhc3IgIzE2XG5cdCIKLSAgICAgICAgICAgICJtb3YgJTEsICUyLCBhc2wgIzE2XG5cdCIKLSAgICAgICAgICAgICJtb3YgJTEsICUxLCBhc3IgIzE2XG5cdCIKLSAgICAgICAgICAgICJtdWwgJTAsICUxLCAlMCIKLSAgICA6ICI9JnIqaSIodG1wMSksCi0gICAgICAgICAgICAiPSZyKmkiKHRtcDIpCi0gICAgICAgICAgICAgICAgICAgIDogInIiKHJhKSwKLSAgICAgICAgICAgICAgICAgICAgInIiKHJiKSk7Ci0KLSAgICAgICAgcmV0dXJuICh0bXAxKTsKLQotICAgIH0KLQotCi0gICAgc3RhdGljIGlubGluZSBJbnQzMiBmeHBfbXVsXzE2X2J5XzE2dHQoSW50MzIgTF92YXIxLCBJbnQzMiBMX3ZhcjIpCi17Ci0KLSAgICAgICAgSW50MzIgdG1wMTsKLSAgICAgICAgSW50MzIgdG1wMjsKLSAgICAgICAgcmVnaXN0ZXIgSW50MzIgcmEgPSAoSW50MzIpTF92YXIxOwotICAgICAgICByZWdpc3RlciBJbnQzMiByYiA9IChJbnQzMilMX3ZhcjI7Ci0KLSAgICAgICAgYXNtIHZvbGF0aWxlKAotICAgICAgICAgICAgIm1vdiAlMCwgJTMsIGFzciAjMTZcblx0IgotICAgICAgICAgICAgIm1vdiAlMSwgJTIsIGFzciAjMTZcblx0IgotICAgICAgICAgICAgIm11bCAlMCwgJTEsICUwIgotICAgIDogIj0mcippIih0bXAxKSwKLSAgICAgICAgICAgICI9JnIqaSIodG1wMikKLSAgICAgICAgICAgICAgICAgICAgOiAiciIocmEpLAotICAgICAgICAgICAgICAgICAgICAiciIocmIpKTsKLQotICAgICAgICByZXR1cm4gKHRtcDEpOwotCi0gICAgfQotCi0KLQotICAgIHN0YXRpYyBpbmxpbmUgIEludDMyIGZ4cF9tYWNfMTZfYnlfMTYoSW50MTYgTF92YXIxLCAgSW50MTYgTF92YXIyLCBJbnQzMiBMX2FkZCkKLXsKLQotICAgICAgICBJbnQzMiB0bXA7Ci0gICAgICAgIHJlZ2lzdGVyIEludDMyIHJhID0gKEludDMyKUxfdmFyMTsKLSAgICAgICAgcmVnaXN0ZXIgSW50MzIgcmIgPSAoSW50MzIpTF92YXIyOwotICAgICAgICByZWdpc3RlciBJbnQzMiByYyA9IChJbnQzMilMX2FkZDsKLQotICAgICAgICBhc20gdm9sYXRpbGUoCi0gICAgICAgICAgICAibWxhICUwLCAlMSwgJTIsICUzIgotICAgIDogIj0mcippIih0bXApCi0gICAgICAgICAgICAgICAgICAgIDogInIiKHJhKSwKLSAgICAgICAgICAgICAgICAgICAgInIiKHJiKSwKLSAgICAgICAgICAgICAgICAgICAgInIiKHJjKSk7Ci0KLSAgICAgICAgcmV0dXJuICh0bXApOwotICAgIH0KLQotCi0KLSAgICBzdGF0aWMgaW5saW5lIEludDMyIGZ4cF9tYWNfMTZfYnlfMTZfYmIoSW50MTYgTF92YXIxLCAgSW50MzIgTF92YXIyLCBJbnQzMiBMX2FkZCkKLXsKLQotICAgICAgICBJbnQzMiB0bXAxOwotICAgICAgICBJbnQzMiB0bXAyOwotICAgICAgICByZWdpc3RlciBJbnQzMiByYSA9IChJbnQzMilMX3ZhcjE7Ci0gICAgICAgIHJlZ2lzdGVyIEludDMyIHJiID0gKEludDMyKUxfdmFyMjsKLSAgICAgICAgcmVnaXN0ZXIgSW50MzIgcmMgPSAoSW50MzIpTF9hZGQ7Ci0KLSAgICAgICAgYXNtIHZvbGF0aWxlKAotICAgICAgICAgICAgIm1vdiAlMCwgJTMsIGFzbCAjMTZcblx0IgotICAgICAgICAgICAgIm1vdiAlMCwgJTAsIGFzciAjMTZcblx0IgotICAgICAgICAgICAgIm1sYSAlMSwgJTAsICUyLCAlNCIKLSAgICA6ICI9JnIqaSIodG1wMSksCi0gICAgICAgICAgICAiPSZyKmkiKHRtcDIpCi0gICAgICAgICAgICAgICAgICAgIDogInIiKHJhKSwKLSAgICAgICAgICAgICAgICAgICAgInIiKHJiKSwKLSAgICAgICAgICAgICAgICAgICAgInIiKHJjKSk7Ci0KLSAgICAgICAgcmV0dXJuICh0bXAyKTsKLSAgICB9Ci0KLQotCi0gICAgc3RhdGljIGlubGluZSAgSW50MzIgZnhwX21hY18xNl9ieV8xNl9idChJbnQxNiBMX3ZhcjEsICBJbnQzMiBMX3ZhcjIsIEludDMyIExfYWRkKQotewotCi0gICAgICAgIEludDMyIHRtcDE7Ci0gICAgICAgIEludDMyIHRtcDI7Ci0gICAgICAgIHJlZ2lzdGVyIEludDMyIHJhID0gKEludDMyKUxfdmFyMTsKLSAgICAgICAgcmVnaXN0ZXIgSW50MzIgcmIgPSAoSW50MzIpTF92YXIyOwotICAgICAgICByZWdpc3RlciBJbnQzMiByYyA9IChJbnQzMilMX2FkZDsKLQotICAgICAgICBhc20gdm9sYXRpbGUoCi0gICAgICAgICAgICAibW92ICUwLCAlMywgYXNyICMxNlxuXHQiCi0gICAgICAgICAgICAibWxhICUxLCAlMCwgJTIsICU0IgotICAgIDogIj0mcippIih0bXAxKSwKLSAgICAgICAgICAgICI9JnIqaSIodG1wMikKLSAgICAgICAgICAgICAgICAgICAgOiAiciIocmEpLAotICAgICAgICAgICAgICAgICAgICAiciIocmIpLAotICAgICAgICAgICAgICAgICAgICAiciIocmMpKTsKLQotICAgICAgICByZXR1cm4gKHRtcDIpOwotCi0gICAgfQotCi0KLQotICAgIHN0YXRpYyBpbmxpbmUgIEludDMyIGNtcGx4X211bDMyX2J5XzE2KEludDMyIHgsIEludDMyIHksIEludDMyIGV4cF9qdykKLXsKLQotICAgICAgICBJbnQzMiByVG1wMDsKLSAgICAgICAgSW50MzIgaVRtcDA7Ci0gICAgICAgIEludDMyIHJlc3VsdDY0X2hpOwotICAgICAgICByZWdpc3RlciBJbnQzMiByYSA9IChJbnQzMil4OwotICAgICAgICByZWdpc3RlciBJbnQzMiByYiA9IChJbnQzMil5OwotICAgICAgICByZWdpc3RlciBJbnQzMiByYyA9IChJbnQzMilleHBfanc7Ci0KLQotCi0gICAgICAgIGFzbSB2b2xhdGlsZSgKLSAgICAgICAgICAgICJtb3YgJTAsICU1LCBhc3IgIzE2XG5cdCIKLSAgICAgICAgICAgICJtb3YgJTEsICU1LCBhc2wgIzE2XG5cdCIKLSAgICAgICAgICAgICJtb3YgJTAsICUwLCBhc2wgIzE2XG5cdCIKLSAgICA6ICI9JnIqaSIoclRtcDApLAotICAgICAgICAgICAgIj0mcippIihpVG1wMCksCi0gICAgICAgICAgICAiPSZyKmkiKHJlc3VsdDY0X2hpKQotICAgICAgICAgICAgICAgICAgICA6ICJyIihyYSksCi0gICAgICAgICAgICAgICAgICAgICJyIihyYiksCi0gICAgICAgICAgICAgICAgICAgICJyIihyYykpOwotCi0KLSAgICAgICAgYXNtIHZvbGF0aWxlKAotICAgICAgICAgICAgInNtdWxsICUwLCAlMiwgJTMsICUwXG5cdCIKLSAgICAgICAgICAgICJzbWxhbCAlMSwgJTIsICU0LCAlMSIKLSAgICA6ICI9JnIqaSIoclRtcDApLAotICAgICAgICAgICAgIj0mcippIihpVG1wMCksCi0gICAgICAgICAgICAiPSZyKmkiKHJlc3VsdDY0X2hpKQotICAgICAgICAgICAgICAgICAgICA6ICJyIihyYSksCi0gICAgICAgICAgICAgICAgICAgICJyIihyYiksCi0gICAgICAgICAgICAgICAgICAgICJyIihyYykpOwotCi0gICAgICAgIHJldHVybiAocmVzdWx0NjRfaGkpOwotCi0KLSAgICB9Ci0KLQotICAgIHN0YXRpYyBpbmxpbmUgIEludDMyIGZ4cF9tdWwzMl9ieV8xNihJbnQzMiBMX3ZhcjEsIEludDMyIExfdmFyMikKLXsKLQotICAgICAgICBJbnQzMiByVG1wMDsKLSAgICAgICAgSW50MzIgcmVzdWx0NjRfaGk7Ci0gICAgICAgIEludDMyIHJlc3VsdDY0X2xvOwotICAgICAgICByZWdpc3RlciBJbnQzMiByYSA9IChJbnQzMilMX3ZhcjE7Ci0gICAgICAgIHJlZ2lzdGVyIEludDMyIHJiID0gKEludDMyKUxfdmFyMjsKLQotICAgICAgICBhc20gdm9sYXRpbGUoCi0gICAgICAgICAgICAibW92ICUwLCAlNCwgYXNsICMxNlxuXHQiCi0gICAgICAgICAgICAic211bGwgJTIsICUxLCAlMCwgJTMiCi0gICAgOiAiPSZyKmkiKHJUbXAwKSwKLSAgICAgICAgICAgICI9JnIqaSIocmVzdWx0NjRfaGkpLAotICAgICAgICAgICAgIj0mcippIihyZXN1bHQ2NF9sbykKLSAgICAgICAgICAgICAgICAgICAgOiAiciIocmEpLAotICAgICAgICAgICAgICAgICAgICAiciIocmIpKTsKLQotICAgICAgICByZXR1cm4gKHJlc3VsdDY0X2hpKTsKLSAgICB9Ci0KLQotI2RlZmluZSBmeHBfbXVsMzJfYnlfMTZiKCBhLCBiKSAgIGZ4cF9tdWwzMl9ieV8xNiggYSwgYikKLQotCi0KLSAgICBzdGF0aWMgaW5saW5lICBJbnQzMiBmeHBfbXVsMzJfYnlfMTZ0KEludDMyIExfdmFyMSwgSW50MzIgTF92YXIyKQotewotCi0gICAgICAgIEludDMyIHJUbXAwOwotICAgICAgICBJbnQzMiByZXN1bHQ2NF9oaTsKLSAgICAgICAgSW50MzIgcmVzdWx0NjRfbG87Ci0gICAgICAgIHJlZ2lzdGVyIEludDMyIHJhID0gKEludDMyKUxfdmFyMTsKLSAgICAgICAgcmVnaXN0ZXIgSW50MzIgcmIgPSAoSW50MzIpTF92YXIyOwotCi0gICAgICAgIGFzbSB2b2xhdGlsZSgKLSAgICAgICAgICAgICJtb3YgJTAsICU0LCBhc3IgIzE2XG5cdCIKLSAgICAgICAgICAgICJtb3YgJTAsICUwLCBhc2wgIzE2XG5cdCIKLSAgICAgICAgICAgICJzbXVsbCAlMiwgJTEsICUwLCAlMyIKLSAgICA6ICI9JnIqaSIoclRtcDApLAotICAgICAgICAgICAgIj0mcippIihyZXN1bHQ2NF9oaSksCi0gICAgICAgICAgICAiPSZyKmkiKHJlc3VsdDY0X2xvKQotICAgICAgICAgICAgICAgICAgICA6ICJyIihyYSksCi0gICAgICAgICAgICAgICAgICAgICJyIihyYikpOwotCi0gICAgICAgIHJldHVybiAocmVzdWx0NjRfaGkpOwotICAgIH0KLQotCi0KLSAgICBzdGF0aWMgaW5saW5lICBJbnQzMiBmeHBfbWFjMzJfYnlfMTYoSW50MzIgTF92YXIxLCBJbnQzMiBMX3ZhcjIsIEludDMyIExfYWRkKQotewotCi0gICAgICAgIEludDMyIHJUbXAwOwotICAgICAgICBJbnQzMiByZXN1bHQ2NF9oaTsKLSAgICAgICAgSW50MzIgcmVzdWx0NjRfbG87Ci0gICAgICAgIHJlZ2lzdGVyIEludDMyIHJhID0gKEludDMyKUxfdmFyMTsKLSAgICAgICAgcmVnaXN0ZXIgSW50MzIgcmIgPSAoSW50MzIpTF92YXIyOwotICAgICAgICByZWdpc3RlciBJbnQzMiByYyA9IChJbnQzMilMX2FkZDsKLQotICAgICAgICBhc20gdm9sYXRpbGUoCi0gICAgICAgICAgICAibW92ICUwLCAlNCwgYXNsICMxNlxuXHQiCi0gICAgICAgICAgICAibW92ICUxLCAlNVxuXHQiCi0gICAgICAgICAgICAic21sYWwgJTIsICUxLCAlMCwgJTMiCi0gICAgOiAiPSZyKmkiKHJUbXAwKSwKLSAgICAgICAgICAgICI9JnIqaSIocmVzdWx0NjRfaGkpLAotICAgICAgICAgICAgIj0mcippIihyZXN1bHQ2NF9sbykKLSAgICAgICAgICAgICAgICAgICAgOiAiciIocmEpLAotICAgICAgICAgICAgICAgICAgICAiciIocmIpLAotICAgICAgICAgICAgICAgICAgICAiciIocmMpKTsKLQotICAgICAgICByZXR1cm4gKHJlc3VsdDY0X2hpKTsKLSAgICB9Ci0KLQotICAgIHN0YXRpYyBpbmxpbmUgaW50NjQgZnhwX21hYzY0X1EzMShpbnQ2NCBzdW0sIGNvbnN0IEludDMyIExfdmFyMSwgY29uc3QgSW50MzIgTF92YXIyKQotewotICAgICAgICBzdW0gKz0gKGludDY0KUxfdmFyMSAqIExfdmFyMjsKLSAgICAgICAgcmV0dXJuIChzdW0pOwotICAgIH0KLQotCi0gICAgc3RhdGljIGlubGluZSBJbnQzMiBmeHBfbWFjMzJfUTMwKGNvbnN0IEludDMyIGEsIGNvbnN0IEludDMyIGIsIEludDMyIExfYWRkKQotICAgIHsKLSAgICAgICAgSW50MzIgcmVzdWx0NjRfaGk7Ci0gICAgICAgIEludDMyIHJlc3VsdDY0X2xvOwotICAgICAgICByZWdpc3RlciBJbnQzMiByYSA9IChJbnQzMilhOwotICAgICAgICByZWdpc3RlciBJbnQzMiByYiA9IChJbnQzMiliOwotICAgICAgICByZWdpc3RlciBJbnQzMiByYyA9IChJbnQzMilMX2FkZDsKLQotICAgICAgICBhc20gdm9sYXRpbGUoInNtdWxsICUxLCAlMCwgJTIsICUzXG5cdCIKLSAgICAgICAgICAgICAgICAgICAgICJhZGQgJTQsICU0LCAlMCwgYXNsICMyXG5cdCIKLSAgICAgICAgICAgICAgICAgICAgICJhZGQgJTAsICU0LCAlMSwgbHNyICMzMCIKLSAgICAgICAgICAgICA6ICI9JnIqaSIocmVzdWx0NjRfaGkpLAotICAgICAgICAgICAgICAgICAgICAgIj0mcippIihyZXN1bHQ2NF9sbykKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOiAiciIocmEpLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAiciIocmIpLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAiciIocmMpKTsKLQotICAgICAgICByZXR1cm4gKHJlc3VsdDY0X2hpKTsKLSAgICB9Ci0KLQotICAgIHN0YXRpYyBpbmxpbmUgSW50MzIgZnhwX21hYzMyX1EzMShJbnQzMiBMX2FkZCwgY29uc3QgSW50MzIgYSwgY29uc3QgSW50MzIgYikKLXsKLQotICAgICAgICBJbnQzMiByZXN1bHQ2NF9oaTsKLSAgICAgICAgSW50MzIgcmVzdWx0NjRfbG87Ci0gICAgICAgIHJlZ2lzdGVyIEludDMyIHJhID0gKEludDMyKWE7Ci0gICAgICAgIHJlZ2lzdGVyIEludDMyIHJiID0gKEludDMyKWI7Ci0gICAgICAgIHJlZ2lzdGVyIEludDMyIHJjID0gKEludDMyKUxfYWRkOwotCi0gICAgICAgIGFzbSB2b2xhdGlsZSgic211bGwgJTEsICUwLCAlMiwgJTNcblx0IgotICAgICAgICAgICAgICAgICAgICAgImFkZCAlMCwgJTAsICU0IgotICAgICAgICAgICAgIDogIj0mcippIihyZXN1bHQ2NF9oaSksCi0gICAgICAgICAgICAgICAgICAgICAiPSZyKmkiKHJlc3VsdDY0X2xvKQotICAgICAgICAgICAgICAgICAgICAgICAgICAgICA6ICJyIihyYSksCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICJyIihyYiksCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICJyIihyYykpOwotCi0gICAgICAgIHJldHVybiAocmVzdWx0NjRfaGkpOwotICAgIH0KLQotCi0KLSAgICBzdGF0aWMgaW5saW5lIEludDMyIGZ4cF9tc3UzMl9RMzEoSW50MzIgTF9zdWIsIGNvbnN0IEludDMyIGEsIGNvbnN0IEludDMyIGIpCi17Ci0gICAgICAgIEludDMyIHJlc3VsdDY0X2hpOwotICAgICAgICBJbnQzMiByZXN1bHQ2NF9sbzsKLSAgICAgICAgcmVnaXN0ZXIgSW50MzIgcmEgPSAoSW50MzIpYTsKLSAgICAgICAgcmVnaXN0ZXIgSW50MzIgcmIgPSAoSW50MzIpYjsKLSAgICAgICAgcmVnaXN0ZXIgSW50MzIgcmMgPSAoSW50MzIpTF9zdWI7Ci0KLSAgICAgICAgYXNtIHZvbGF0aWxlKCJzbXVsbCAlMSwgJTAsICUyLCAlM1xuXHQiCi0gICAgICAgICAgICAgICAgICAgICAic3ViICUwLCAlNCwgJTAiCi0gICAgICAgICAgICAgOiAiPSZyKmkiKHJlc3VsdDY0X2hpKSwKLSAgICAgICAgICAgICAgICAgICAgICI9JnIqaSIocmVzdWx0NjRfbG8pCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgIDogInIiKHJhKSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgInIiKHJiKSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgInIiKHJjKSk7Ci0KLQotICAgICAgICByZXR1cm4gKHJlc3VsdDY0X2hpKTsKLSAgICB9Ci0KLQotICAgIHN0YXRpYyBpbmxpbmUgSW50MzIgZnhwX211bDMyX1EzMShjb25zdCBJbnQzMiBhLCBjb25zdCBJbnQzMiBiKQotewotICAgICAgICBJbnQzMiByZXN1bHQ2NF9oaTsKLSAgICAgICAgSW50MzIgcmVzdWx0NjRfbG87Ci0gICAgICAgIHJlZ2lzdGVyIEludDMyIHJhID0gKEludDMyKWE7Ci0gICAgICAgIHJlZ2lzdGVyIEludDMyIHJiID0gKEludDMyKWI7Ci0gICAgICAgIGFzbSB2b2xhdGlsZSgKLSAgICAgICAgICAgICJzbXVsbCAlMSwgJTAsICUyLCAlMyIKLSAgICA6ICI9JnIqaSIocmVzdWx0NjRfaGkpLAotICAgICAgICAgICAgIj0mcippIihyZXN1bHQ2NF9sbykKLSAgICAgICAgICAgICAgICAgICAgOiAiciIocmEpLAotICAgICAgICAgICAgICAgICAgICAiciIocmIpKTsKLQotICAgICAgICByZXR1cm4gKHJlc3VsdDY0X2hpKTsKLSAgICB9Ci0KLQotICAgIHN0YXRpYyBpbmxpbmUgSW50MzIgZnhwX211bDMyX1EzMChjb25zdCBJbnQzMiBhLCBjb25zdCBJbnQzMiBiKQotewotICAgICAgICBJbnQzMiByZXN1bHQ2NF9oaTsKLSAgICAgICAgSW50MzIgcmVzdWx0NjRfbG87Ci0gICAgICAgIHJlZ2lzdGVyIEludDMyIHJhID0gKEludDMyKWE7Ci0gICAgICAgIHJlZ2lzdGVyIEludDMyIHJiID0gKEludDMyKWI7Ci0gICAgICAgIGFzbSB2b2xhdGlsZSgic211bGwgJTEsICUwLCAlMiwgJTNcblx0IgotICAgICAgICAgICAgICAgICAgICAgIm1vdiAlMCwgJTAsIGxzbCAjMlxuXHQiCi0gICAgICAgICAgICAgICAgICAgICAib3JyICAgJTAsICUwLCAlMSwgbHNyICMzMCIKLSAgICAgICAgICAgICA6ICI9JnIqaSIocmVzdWx0NjRfaGkpLAotICAgICAgICAgICAgICAgICAgICAgIj0mcippIihyZXN1bHQ2NF9sbykKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOiAiciIocmEpLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAiciIocmIpKTsKLSAgICAgICAgcmV0dXJuIChyZXN1bHQ2NF9oaSk7Ci0gICAgfQotCi0KLQotICAgIHN0YXRpYyBpbmxpbmUgSW50MzIgZnhwX21hYzMyX1EyOShjb25zdCBJbnQzMiBhLCBjb25zdCBJbnQzMiBiLCBJbnQzMiBMX2FkZCkKLXsKLSAgICAgICAgSW50MzIgcmVzdWx0NjRfaGk7Ci0gICAgICAgIEludDMyIHJlc3VsdDY0X2xvOwotICAgICAgICByZWdpc3RlciBJbnQzMiByYSA9IChJbnQzMilhOwotICAgICAgICByZWdpc3RlciBJbnQzMiByYiA9IChJbnQzMiliOwotICAgICAgICByZWdpc3RlciBJbnQzMiByYyA9IChJbnQzMilMX2FkZDsKLQotICAgICAgICBhc20gdm9sYXRpbGUoInNtdWxsICUxLCAlMCwgJTIsICUzXG5cdCIKLSAgICAgICAgICAgICAgICAgICAgICJhZGQgICAlNCwgJTQsICUwLCBsc2wgIzNcblx0IgotICAgICAgICAgICAgICAgICAgICAgImFkZCAgICUwLCAlNCwgJTEsIGxzciAjMjkiCi0gICAgICAgICAgICAgOiAiPSZyKmkiKHJlc3VsdDY0X2hpKSwKLSAgICAgICAgICAgICAgICAgICAgICI9JnIqaSIocmVzdWx0NjRfbG8pCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgIDogInIiKHJhKSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgInIiKHJiKSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgInIiKHJjKSk7Ci0KLSAgICAgICAgcmV0dXJuIChyZXN1bHQ2NF9oaSk7Ci0gICAgfQotCi0KLSAgICBzdGF0aWMgaW5saW5lIEludDMyIGZ4cF9tc3UzMl9RMjkoY29uc3QgSW50MzIgYSwgY29uc3QgSW50MzIgYiwgSW50MzIgTF9zdWIpCi17Ci0gICAgICAgIEludDMyIHJlc3VsdDY0X2hpOwotICAgICAgICBJbnQzMiByZXN1bHQ2NF9sbzsKLSAgICAgICAgcmVnaXN0ZXIgSW50MzIgcmEgPSAoSW50MzIpYTsKLSAgICAgICAgcmVnaXN0ZXIgSW50MzIgcmIgPSAoSW50MzIpYjsKLSAgICAgICAgcmVnaXN0ZXIgSW50MzIgcmMgPSAoSW50MzIpTF9zdWI7Ci0KLSAgICAgICAgYXNtIHZvbGF0aWxlKCJzbXVsbCAlMSwgJTAsICUyLCAlM1xuXHQiCi0gICAgICAgICAgICAgICAgICAgICAic3ViICAgJTQsICU0LCAlMCwgbHNsICMzXG5cdCIKLSAgICAgICAgICAgICAgICAgICAgICJzdWIgICAlMCwgJTQsICUxLCBsc3IgIzI5IgotICAgICAgICAgICAgIDogIj0mcippIihyZXN1bHQ2NF9oaSksCi0gICAgICAgICAgICAgICAgICAgICAiPSZyKmkiKHJlc3VsdDY0X2xvKQotICAgICAgICAgICAgICAgICAgICAgICAgICAgICA6ICJyIihyYSksCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICJyIihyYiksCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICJyIihyYykpOwotCi0gICAgICAgIHJldHVybiAocmVzdWx0NjRfaGkpOwotICAgIH0KLQotICAgIHN0YXRpYyBpbmxpbmUgSW50MzIgZnhwX211bDMyX1EyOShjb25zdCBJbnQzMiBhLCBjb25zdCBJbnQzMiBiKQotewotICAgICAgICBJbnQzMiByZXN1bHQ2NF9oaTsKLSAgICAgICAgSW50MzIgcmVzdWx0NjRfbG87Ci0gICAgICAgIHJlZ2lzdGVyIEludDMyIHJhID0gKEludDMyKWE7Ci0gICAgICAgIHJlZ2lzdGVyIEludDMyIHJiID0gKEludDMyKWI7Ci0gICAgICAgIGFzbSB2b2xhdGlsZSgic211bGwgJTEsICUwLCAlMiwgJTNcblx0IgotICAgICAgICAgICAgICAgICAgICAgIm1vdiAlMCwgJTAsIGxzbCAjM1xuXHQiCi0gICAgICAgICAgICAgICAgICAgICAib3JyICAgJTAsICUwLCAlMSwgbHNyICMyOSIKLSAgICAgICAgICAgICA6ICI9JnIqaSIocmVzdWx0NjRfaGkpLAotICAgICAgICAgICAgICAgICAgICAgIj0mcippIihyZXN1bHQ2NF9sbykKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOiAiciIocmEpLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAiciIocmIpKTsKLSAgICAgICAgcmV0dXJuIChyZXN1bHQ2NF9oaSk7Ci0gICAgfQotCi0KLQotICAgIHN0YXRpYyBpbmxpbmUgSW50MzIgZnhwX211bDMyX1EyOChjb25zdCBJbnQzMiBhLCBjb25zdCBJbnQzMiBiKQotewotICAgICAgICBJbnQzMiByZXN1bHQ2NF9oaTsKLSAgICAgICAgSW50MzIgcmVzdWx0NjRfbG87Ci0gICAgICAgIHJlZ2lzdGVyIEludDMyIHJhID0gKEludDMyKWE7Ci0gICAgICAgIHJlZ2lzdGVyIEludDMyIHJiID0gKEludDMyKWI7Ci0gICAgICAgIGFzbSB2b2xhdGlsZSgic211bGwgJTEsICUwLCAlMiwgJTNcblx0IgotICAgICAgICAgICAgICAgICAgICAgIm1vdiAlMCwgJTAsIGxzbCAjNFxuXHQiCi0gICAgICAgICAgICAgICAgICAgICAib3JyICAgJTAsICUwLCAlMSwgbHNyICMyOCIKLSAgICAgICAgICAgICA6ICI9JnIqaSIocmVzdWx0NjRfaGkpLAotICAgICAgICAgICAgICAgICAgICAgIj0mcippIihyZXN1bHQ2NF9sbykKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOiAiciIocmEpLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAiciIocmIpKTsKLSAgICAgICAgcmV0dXJuIChyZXN1bHQ2NF9oaSk7Ci0gICAgfQotCi0gICAgc3RhdGljIGlubGluZSBJbnQzMiBmeHBfbXVsMzJfUTI3KGNvbnN0IEludDMyIGEsIGNvbnN0IEludDMyIGIpCi17Ci0gICAgICAgIEludDMyIHJlc3VsdDY0X2hpOwotICAgICAgICBJbnQzMiByZXN1bHQ2NF9sbzsKLSAgICAgICAgcmVnaXN0ZXIgSW50MzIgcmEgPSAoSW50MzIpYTsKLSAgICAgICAgcmVnaXN0ZXIgSW50MzIgcmIgPSAoSW50MzIpYjsKLSAgICAgICAgYXNtIHZvbGF0aWxlKCJzbXVsbCAlMSwgJTAsICUyLCAlM1xuXHQiCi0gICAgICAgICAgICAgICAgICAgICAibW92ICUwLCAlMCwgbHNsICM1XG5cdCIKLSAgICAgICAgICAgICAgICAgICAgICJvcnIgICAlMCwgJTAsICUxLCBsc3IgIzI3IgotICAgICAgICAgICAgIDogIj0mcippIihyZXN1bHQ2NF9oaSksCi0gICAgICAgICAgICAgICAgICAgICAiPSZyKmkiKHJlc3VsdDY0X2xvKQotICAgICAgICAgICAgICAgICAgICAgICAgICAgICA6ICJyIihyYSksCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICJyIihyYikpOwotCi0gICAgICAgIHJldHVybiAocmVzdWx0NjRfaGkpOwotICAgIH0KLQotCi0gICAgc3RhdGljIGlubGluZSBJbnQzMiBmeHBfbXVsMzJfUTI2KGNvbnN0IEludDMyIGEsIGNvbnN0IEludDMyIGIpCi17Ci0gICAgICAgIEludDMyIHJlc3VsdDY0X2hpOwotICAgICAgICBJbnQzMiByZXN1bHQ2NF9sbzsKLSAgICAgICAgcmVnaXN0ZXIgSW50MzIgcmEgPSAoSW50MzIpYTsKLSAgICAgICAgcmVnaXN0ZXIgSW50MzIgcmIgPSAoSW50MzIpYjsKLSAgICAgICAgYXNtIHZvbGF0aWxlKCJzbXVsbCAlMSwgJTAsICUyLCAlM1xuXHQiCi0gICAgICAgICAgICAgICAgICAgICAibW92ICUwLCAlMCwgbHNsICM2XG5cdCIKLSAgICAgICAgICAgICAgICAgICAgICJvcnIgICAlMCwgJTAsICUxLCBsc3IgIzI2IgotICAgICAgICAgICAgIDogIj0mcippIihyZXN1bHQ2NF9oaSksCi0gICAgICAgICAgICAgICAgICAgICAiPSZyKmkiKHJlc3VsdDY0X2xvKQotICAgICAgICAgICAgICAgICAgICAgICAgICAgICA6ICJyIihyYSksCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICJyIihyYikpOwotCi0gICAgICAgIHJldHVybiAocmVzdWx0NjRfaGkpOwotICAgIH0KLQotCi0gICAgc3RhdGljIGlubGluZSBJbnQzMiBmeHBfbXVsMzJfUTIwKGNvbnN0IEludDMyIGEsIGNvbnN0IEludDMyIGIpCi17Ci0gICAgICAgIEludDMyIHJlc3VsdDY0X2hpOwotICAgICAgICBJbnQzMiByZXN1bHQ2NF9sbzsKLSAgICAgICAgcmVnaXN0ZXIgSW50MzIgcmEgPSAoSW50MzIpYTsKLSAgICAgICAgcmVnaXN0ZXIgSW50MzIgcmIgPSAoSW50MzIpYjsKLSAgICAgICAgYXNtIHZvbGF0aWxlKCJzbXVsbCAlMSwgJTAsICUyLCAlM1xuXHQiCi0gICAgICAgICAgICAgICAgICAgICAibW92ICUwLCAlMCwgbHNsICMxMlxuXHQiCi0gICAgICAgICAgICAgICAgICAgICAib3JyICAgJTAsICUwLCAlMSwgbHNyICMyMCIKLSAgICAgICAgICAgICA6ICI9JnIqaSIocmVzdWx0NjRfaGkpLAotICAgICAgICAgICAgICAgICAgICAgIj0mcippIihyZXN1bHQ2NF9sbykKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOiAiciIocmEpLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAiciIocmIpKTsKLQotICAgICAgICByZXR1cm4gKHJlc3VsdDY0X2hpKTsKLSAgICB9Ci0KLQotICAgIHN0YXRpYyBpbmxpbmUgSW50MzIgZnhwX211bDMyX1ExNShjb25zdCBJbnQzMiBhLCBjb25zdCBJbnQzMiBiKQotewotICAgICAgICBJbnQzMiByZXN1bHQ2NF9oaTsKLSAgICAgICAgSW50MzIgcmVzdWx0NjRfbG87Ci0gICAgICAgIHJlZ2lzdGVyIEludDMyIHJhID0gKEludDMyKWE7Ci0gICAgICAgIHJlZ2lzdGVyIEludDMyIHJiID0gKEludDMyKWI7Ci0gICAgICAgIGFzbSB2b2xhdGlsZSgic211bGwgJTEsICUwLCAlMiwgJTNcblx0IgotICAgICAgICAgICAgICAgICAgICAgIm1vdiAlMCwgJTAsIGxzbCAjMTdcblx0IgotICAgICAgICAgICAgICAgICAgICAgIm9yciAgICUwLCAlMCwgJTEsIGxzciAjMTUiCi0gICAgICAgICAgICAgOiAiPSZyKmkiKHJlc3VsdDY0X2hpKSwKLSAgICAgICAgICAgICAgICAgICAgICI9JnIqaSIocmVzdWx0NjRfbG8pCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgIDogInIiKHJhKSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgInIiKHJiKSk7Ci0KLSAgICAgICAgcmV0dXJuIChyZXN1bHQ2NF9oaSk7Ci0gICAgfQotCi0KLQotICAgIHN0YXRpYyBpbmxpbmUgSW50MzIgZnhwX211bDMyX1ExNChjb25zdCBJbnQzMiBhLCBjb25zdCBJbnQzMiBiKQotewotICAgICAgICBJbnQzMiByZXN1bHQ2NF9oaTsKLSAgICAgICAgSW50MzIgcmVzdWx0NjRfbG87Ci0gICAgICAgIHJlZ2lzdGVyIEludDMyIHJhID0gKEludDMyKWE7Ci0gICAgICAgIHJlZ2lzdGVyIEludDMyIHJiID0gKEludDMyKWI7Ci0gICAgICAgIGFzbSB2b2xhdGlsZSgic211bGwgJTEsICUwLCAlMiwgICUzXG5cdCIKLSAgICAgICAgICAgICAgICAgICAgICJtb3YgICAlMCwgJTAsIGxzbCAjMThcblx0IgotICAgICAgICAgICAgICAgICAgICAgIm9yciAgICUwLCAlMCwgJTEsIGxzciAjMTQiCi0gICAgICAgICAgICAgOiAiPSZyKmkiKHJlc3VsdDY0X2hpKSwKLSAgICAgICAgICAgICAgICAgICAgICI9JnIqaSIocmVzdWx0NjRfbG8pCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgIDogInIiKHJhKSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgInIiKHJiKSk7Ci0KLSAgICAgICAgcmV0dXJuIChyZXN1bHQ2NF9oaSk7Ci0gICAgfQotCi0jZW5kaWYKLQotI2lmZGVmIF9fY3BsdXNwbHVzCi19Ci0jZW5kaWYKLQotCi0jZ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ZnMuaCIKLQotCi0jaWYgZGVmaW5lZChQVl9BUk1fVjUpCi0KLS8vI3VuZGVmIEVYVEVOREVEX0FTTQotI2RlZmluZSBFWFRFTkRFRF9BU00KLSNkZWZpbmUgX0FSTV9WNV8KLQotCi0gICAgX19pbmxpbmUgIEludDMyIHNoZnRfbGZ0XzEoSW50MzIgTF92YXIxKQotICAgIHsKLSAgICAgICAgX19hc20KLSAgICAgICAgewotICAgICAgICAgICAgcWFkZCBMX3ZhcjEsIExfdmFyMSwgTF92YXIxCi0gICAgICAgIH0KLQotICAgICAgICByZXR1cm4gTF92YXIxOwotICAgIH0KLQotCi0gICAgX19pbmxpbmUgIEludDMyIGZ4cF9tdWxfMTZfYnlfMTYoSW50MzIgTF92YXIxLCAgSW50MzIgTF92YXIyKQotICAgIHsKLSAgICAgICAgX19hc20KLSAgICAgICAgewotICAgICAgICAgICAgc211bGJiIExfdmFyMSwgTF92YXIxLCBMX3ZhcjIKLSAgICAgICAgfQotICAgICAgICByZXR1cm4gTF92YXIxOwotICAgIH0KLQotCi0gICAgX19pbmxpbmUgIEludDMyIGZ4cF9tdWxfMTZfYnlfMTZiYihJbnQzMiBMX3ZhcjEsICBJbnQzMiBMX3ZhcjIpCi0gICAgewotICAgICAgICBfX2FzbQotICAgICAgICB7Ci0gICAgICAgICAgICBzbXVsYmIgTF92YXIxLCBMX3ZhcjEsIExfdmFyMgotICAgICAgICB9Ci0gICAgICAgIHJldHVybiBMX3ZhcjE7Ci0gICAgfQotCi0KLSAgICBfX2lubGluZSAgSW50MzIgZnhwX211bF8xNl9ieV8xNnRiKEludDMyIExfdmFyMSwgIEludDMyIExfdmFyMikKLSAgICB7Ci0gICAgICAgIF9fYXNtCi0gICAgICAgIHsKLSAgICAgICAgICAgIHNtdWx0YiBMX3ZhcjEsIExfdmFyMSwgTF92YXIyCi0gICAgICAgIH0KLSAgICAgICAgcmV0dXJuIExfdmFyMTsKLSAgICB9Ci0KLSAgICBfX2lubGluZSAgSW50MzIgZnhwX211bF8xNl9ieV8xNnR0KEludDMyIExfdmFyMSwgIEludDMyIExfdmFyMikKLSAgICB7Ci0gICAgICAgIF9fYXNtCi0gICAgICAgIHsKLSAgICAgICAgICAgIHNtdWx0dCBMX3ZhcjEsIExfdmFyMSwgTF92YXIyCi0gICAgICAgIH0KLSAgICAgICAgcmV0dXJuIExfdmFyMTsKLSAgICB9Ci0KLSAgICBfX2lubGluZSAgSW50MzIgZnhwX211bF8xNl9ieV8xNmJ0KEludDMyIExfdmFyMSwgIEludDMyIExfdmFyMikKLSAgICB7Ci0gICAgICAgIF9fYXNtCi0gICAgICAgIHsKLSAgICAgICAgICAgIHNtdWxidCBMX3ZhcjEsIExfdmFyMSwgTF92YXIyCi0gICAgICAgIH0KLSAgICAgICAgcmV0dXJuIExfdmFyMTsKLSAgICB9Ci0KLQotCi0gICAgX19pbmxpbmUgIEludDMyIGZ4cF9tYWNfMTZfYnlfMTYoY29uc3QgSW50MzIgTF92YXIxLCBjb25zdCBJbnQzMiBMX3ZhcjIsIEludDMyIExfYWRkKQotICAgIHsKLSAgICAgICAgX19hc20KLSAgICAgICAgewotICAgICAgICAgICAgc21sYWJiIExfYWRkLCBMX3ZhcjEsIExfdmFyMiwgTF9hZGQKLSAgICAgICAgfQotICAgICAgICByZXR1cm4gKExfYWRkKTsKLSAgICB9Ci0KLSAgICBfX2lubGluZSAgSW50MzIgZnhwX21hY18xNl9ieV8xNl9iYihjb25zdCBJbnQzMiBMX3ZhcjEsICBJbnQzMiBMX3ZhcjIsIEludDMyIExfYWRkKQotICAgIHsKLSAgICAgICAgX19hc20KLSAgICAgICAgewotICAgICAgICAgICAgc21sYWJiIExfYWRkLCBMX3ZhcjEsIExfdmFyMiwgTF9hZGQKLSAgICAgICAgfQotICAgICAgICByZXR1cm4gTF9hZGQ7Ci0gICAgfQotCi0gICAgX19pbmxpbmUgIEludDMyIGZ4cF9tYWNfMTZfYnlfMTZfYnQoY29uc3QgSW50MzIgTF92YXIxLCAgSW50MzIgTF92YXIyLCBJbnQzMiBMX2FkZCkKLSAgICB7Ci0gICAgICAgIF9fYXNtCi0gICAgICAgIHsKLSAgICAgICAgICAgIHNtbGFidCBMX2FkZCwgTF92YXIxLCBMX3ZhcjIsIExfYWRkCi0gICAgICAgIH0KLSAgICAgICAgcmV0dXJuIExfYWRkOwotICAgIH0KLQotCi0gICAgX19pbmxpbmUgIEludDMyIGZ4cF9tYWNfMTZfYnlfMTZfdGIoY29uc3QgSW50MzIgTF92YXIxLCAgSW50MzIgTF92YXIyLCBJbnQzMiBMX2FkZCkKLSAgICB7Ci0gICAgICAgIF9fYXNtCi0gICAgICAgIHsKLSAgICAgICAgICAgIHNtbGF0YiBMX2FkZCwgTF92YXIxLCBMX3ZhcjIsIExfYWRkCi0gICAgICAgIH0KLSAgICAgICAgcmV0dXJuIExfYWRkOwotICAgIH0KLQotICAgIF9faW5saW5lICBJbnQzMiBmeHBfbWFjXzE2X2J5XzE2X3R0KGNvbnN0IEludDMyIExfdmFyMSwgIEludDMyIExfdmFyMiwgSW50MzIgTF9hZGQpCi0gICAgewotICAgICAgICBfX2FzbQotICAgICAgICB7Ci0gICAgICAgICAgICBzbWxhdHQgTF9hZGQsIExfdmFyMSwgTF92YXIyLCBMX2FkZAotICAgICAgICB9Ci0gICAgICAgIHJldHVybiBMX2FkZDsKLSAgICB9Ci0KLSAgICBfX2lubGluZSAgSW50MzIgZnhwX21hYzMyX2J5XzE2KEludDMyIExfdmFyMSwgY29uc3QgSW50MzIgTF92YXIyLCBJbnQzMiBMX2FkZCkKLSAgICB7Ci0gICAgICAgIF9fYXNtCi0gICAgICAgIHsKLSAgICAgICAgICAgIHNtbGF3YiBMX2FkZCwgTF92YXIxLCBMX3ZhcjIsIExfYWRkCi0gICAgICAgIH0KLSAgICAgICAgcmV0dXJuIChMX2FkZCk7Ci0gICAgfQotCi0KLSAgICBfX2lubGluZSAgaW50NjQgZnhwX21hYzY0X1EzMShpbnQ2NCBzdW0sIGNvbnN0IEludDMyIExfdmFyMSwgY29uc3QgSW50MzIgTF92YXIyKQotICAgIHsKLSAgICAgICAgdWludDMyIGIgPSAoVUludDMyKShzdW0pOwotICAgICAgICBpbnQzMiBjID0gSW50MzIoc3VtID4+IDMyKTsKLSAgICAgICAgX19hc20KLSAgICAgICAgewotICAgICAgICAgICAgc21sYWwgYiwgYywgTF92YXIxLCBMX3ZhcjIKLSAgICAgICAgfQotICAgICAgICByZXR1cm4gKCgoaW50NjQoYykpIDw8IDMyKSB8IGIpOwotICAgIH0KLQotCi0gICAgX19pbmxpbmUgIEludDMyIGZ4cF9tYWMzMl9RMzEoSW50MzIgTF9hZGQsICBJbnQzMiBMX3ZhcjEsIGNvbnN0IEludDMyIExfdmFyMikKLSAgICB7Ci0gICAgICAgIF9fYXNtCi0gICAgICAgIHsKLSAgICAgICAgICAgIHNtbGFsIExfdmFyMSwgTF9hZGQsIExfdmFyMiwgTF92YXIxCi0gICAgICAgIH0KLSAgICAgICAgcmV0dXJuIExfYWRkOwotICAgIH0KLQotICAgIF9faW5saW5lICBJbnQzMiBmeHBfbXN1MzJfUTMxKEludDMyIExfc3ViLCAgSW50MzIgTF92YXIxLCBjb25zdCBJbnQzMiBMX3ZhcjIpCi0gICAgewotICAgICAgICBfX2FzbQotICAgICAgICB7Ci0gICAgICAgICAgICByc2IgICBMX3ZhcjEsIExfdmFyMSwgIzAKLSAgICAgICAgICAgIHNtbGFsIExfdmFyMSwgTF9zdWIsIExfdmFyMiwgTF92YXIxCi0gICAgICAgIH0KLSAgICAgICAgcmV0dXJuIExfc3ViOwotICAgIH0KLQotICAgIF9faW5saW5lICBJbnQzMiBmeHBfbXVsMzJfUTMxKEludDMyIExfdmFyMSwgY29uc3QgSW50MzIgTF92YXIyKQotICAgIHsKLSAgICAgICAgSW50MzIgcmVzdWx0NjRfaGk7Ci0gICAgICAgIF9fYXNtCi0gICAgICAgIHsKLSAgICAgICAgICAgIHNtdWxsIExfdmFyMSwgcmVzdWx0NjRfaGksIExfdmFyMiwgTF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gICAgICBhZGQgTF9hZGQsIExfYWRkLCByZXN1bHQ2NF9oaSwgYXNsICAjMgotICAgICAgICAgICAgYWRkIExfYWRkLCBMX2FkZCwgcmVzdWx0NjRfbG8sIGxzciAgIzMwCi0gICAgICAgIH0KLSAgICAgICAgcmV0dXJuIChMX2FkZCk7Ci0gICAgfQotCi0KLSAgICBfX2lubGluZSAgSW50MzIgZnhwX211bDMyX1EyOShjb25zdCBJbnQzMiBMX3ZhcjEsIGNvbnN0IEludDMyIExfdmFyMikKLSAgICB7Ci0gICAgICAgIEludDMyIHJlc3VsdDY0X2hpOwotICAgICAgICBJbnQzMiByZXN1bHQ2NF9sbzsKLSAgICAgICAgX19hc20KLSAgICAgICAgewotICAgICAgICAgICAgc211bGwgcmVzdWx0NjRfbG8sIHJlc3VsdDY0X2hpLCBMX3ZhcjIsIExfdmFyMQotICAgICAgICAgICAgbW92IHJlc3VsdDY0X2hpLCByZXN1bHQ2NF9oaSwgYXNsICAjMwotI2lmZGVmIEVYVEVOREVEX0FTTQotICAgICAgICAgICAgbW92IHJlc3VsdDY0X2xvLCByZXN1bHQ2NF9sbywgbHNyICAjMjkKLSAgICAgICAgICAgIG9yciAgcmVzdWx0NjRfaGksIHJlc3VsdDY0X2xvLCByZXN1bHQ2NF9oaQotI2Vsc2UKLSAgICAgICAgICAgIG9yciAgcmVzdWx0NjRfaGksIHJlc3VsdDY0X2hpLCByZXN1bHQ2NF9sbywgbHNyICMyOQotI2VuZGlmCi0gICAgICAgIH0KLSAgICAgICAgcmV0dXJuIChyZXN1bHQ2NF9oaSk7Ci0gICAgfQotCi0KLQotICAgIF9faW5saW5lICBJbnQzMiBmeHBfbWFjMzJfUTI5KGNvbnN0IEludDMyIExfdmFyMSwgY29uc3QgSW50MzIgTF92YXIyLCBJbnQzMiBMX2FkZCkKLSAgICB7Ci0gICAgICAgIEludDMyIHJlc3VsdDY0X2hpOwotICAgICAgICBJbnQzMiByZXN1bHQ2NF9sbzsKLSAgICAgICAgX19hc20KLSAgICAgICAgewotICAgICAgICAgICAgc211bGwgcmVzdWx0NjRfbG8sIHJlc3VsdDY0X2hpLCBMX3ZhcjIsIExfdmFyMQotICAgICAgICAgICAgYWRkIExfYWRkLCBMX2FkZCwgcmVzdWx0NjRfaGksIGFzbCAgIzMKLSAgICAgICAgICAgIGFkZCBMX2FkZCwgTF9hZGQsIHJlc3VsdDY0X2xvLCBsc3IgICMyOQotICAgICAgICB9Ci0gICAgICAgIHJldHVybiAoTF9hZGQpOwotICAgIH0KLQotCi0gICAgX19pbmxpbmUgIEludDMyIGZ4cF9tc3UzMl9RMjkoY29uc3QgSW50MzIgTF92YXIxLCBjb25zdCBJbnQzMiBMX3ZhcjIsIEludDMyIExfc3ViKQotICAgIHsKLSAgICAgICAgSW50MzIgcmVzdWx0NjRfaGk7Ci0gICAgICAgIEludDMyIHJlc3VsdDY0X2xvOwotICAgICAgICBfX2FzbQotICAgICAgICB7Ci0gICAgICAgICAgICBzbXVsbCByZXN1bHQ2NF9sbywgcmVzdWx0NjRfaGksIExfdmFyMiwgTF92YXIxCi0gICAgICAgICAgICBzdWIgTF9zdWIsIExfc3ViLCByZXN1bHQ2NF9oaSwgYXNsICAjMwotICAgICAgICAgICAgc3ViIExfc3ViLCBMX3N1YiwgcmVzdWx0NjRfbG8sIGxzciAgIzI5Ci0gICAgICAgIH0KLSAgICAgICAgcmV0dXJuIChMX3N1Yik7Ci0gICAgfQotCi0KLSAgICBfX2lubGluZSAgSW50MzIgZnhwX211bDMyX1EyOChjb25zdCBJbnQzMiBMX3ZhcjEsIGNvbnN0IEludDMyIExfdmFyMikKLSAgICB7Ci0gICAgICAgIEludDMyIHJlc3VsdDY0X2hpOwotICAgICAgICBJbnQzMiByZXN1bHQ2NF9sbzsKLSAgICAgICAgX19hc20KLSAgICAgICAgewotICAgICAgICAgICAgc211bGwgcmVzdWx0NjRfbG8sIHJlc3VsdDY0X2hpLCBMX3ZhcjIsIExfdmFyMQotICAgICAgICAgICAgbW92IHJlc3V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0gICAgICAgIEludDMyIHJlc3VsdDY0X2hpOwotICAgICAgICBJbnQzMiByZXN1bHQ2NF9sbzsKLSAgICAgICAgX19hc20KLSAgICAgICAgewotICAgICAgICAgICAgc211bGwgcmVzdWx0NjRfbG8sIHJlc3VsdDY0X2hpLCBMX3ZhcjIsIExfdmFyMQotICAgICAgICAgICAgbW92IHJlc3VsdDY0X2hpLCByZXN1bHQ2NF9oaSwgYXNsICAjMTcKLSNpZmRlZiBFWFRFTkRFRF9BU00KLSAgICAgICAgICAgIG1vdiByZXN1bHQ2NF9sbywgcmVzdWx0NjRfbG8sIGxzciAgIzE1Ci0gICAgICAgICAgICBvcnIgIHJlc3VsdDY0X2hpLCByZXN1bHQ2NF9sbywgcmVzdWx0NjRfaGkKLSNlbHNlCi0gICAgICAgICAgICBvcnIgIHJlc3VsdDY0X2hpLCByZXN1bHQ2NF9oaSwgcmVzdWx0NjRfbG8sIGxzciAjMTUKLSNlbmRpZgotICAgICAgICB9Ci0gICAgICAgIHJldHVybiAocmVzdWx0NjRfaGkpOwotICAgIH0KLQotCi0gICAgX19pbmxpbmUgIEludDMyIGNtcGx4X211bDMyX2J5XzE2KEludDMyIExfdmFyMSwgY29uc3QgSW50MzIgTF92YXIyLCBjb25zdCBJbnQzMiBjbXBseCkKLSAgICB7Ci0gICAgICAgIEludDMyIHJlc3VsdDY0X2hpOwotCi0gICAgICAgIF9fYXNtCi0gICAgICAgIHsKLSAgICAgICAgICAgIHNtdWx3dCByZXN1bHQ2NF9oaSwgTF92YXIxLCBjbXBseAotICAgICAgICAgICAgc21sYXdiIHJlc3VsdDY0X2hpLCBMX3ZhcjIsIGNtcGx4LCByZXN1bHQ2NF9oaQotICAgICAgICB9Ci0gICAgICAgIHJldHVybiAocmVzdWx0NjRfaGkpOwotCi0gICAgfQotCi0gICAgX19pbmxpbmUgIEludDMyIGZ4cF9tdWwzMl9RMTQoY29uc3QgSW50MzIgTF92YXIxLCBjb25zdCBJbnQzMiBMX3ZhcjIpCi0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QotICAgICAgICByZXR1cm4gKExfdmFyMSk7Ci0KLSAgICB9Ci0KLQotICAgIF9faW5saW5lICBJbnQzMiBmeHBfbXVsXzE2X2J5XzE2YmIoSW50MzIgTF92YXIxLCAgSW50MzIgTF92YXIyKQotICAgIHsKLSAgICAgICAgTF92YXIyID0gKExfdmFyMiA8PCAxNikgPj4gMTY7Ci0gICAgICAgIExfdmFyMSA9IChMX3ZhcjEgPDwgMTYpID4+IDE2OwotCi0gICAgICAgIExfdmFyMSAqPSBMX3ZhcjI7Ci0KLSAgICAgICAgcmV0dXJuIExfdmFyMTsKLQotICAgIH0KLQotCi0jZGVmaW5lIGZ4cF9tdWxfMTZfYnlfMTYoYSwgYikgIGZ4cF9tdWxfMTZfYnlfMTZiYiggIGEsIGIpCi0KLQotICAgIF9faW5saW5lICBJbnQzMiBmeHBfbXVsXzE2X2J5XzE2dGIoSW50MzIgTF92YXIxLCAgSW50MzIgTF92YXIyKQotICAgIHsKLSAgICAgICAgTF92YXIyID0gKExfdmFyMiA8PCAxNikgPj4gMTY7Ci0gICAgICAgIExfdmFyMSA9ICBMX3ZhcjEgPj4gMTY7Ci0KLSAgICAgICAgTF92YXIxICo9IExfdmFyMjsKLQotICAgICAgICByZXR1cm4gTF92YXIxOwotCi0gICAgfQotCi0KLSAgICBfX2lubGluZSAgSW50MzIgZnhwX211bF8xNl9ieV8xNmJ0KEludDMyIExfdmFyMSwgIEludDMyIExfdmFyMikKLSAgICB7Ci0gICAgICAgIExfdmFyMiA9IExfdmFyMiA+PiAxNjsKLSAgICAgICAgTF92YXIxID0gKExfdmFyMSA8PCAxNikgPj4gMTY7Ci0KLSAgICAgICAgTF92YXIxICo9IExfdmFyMjsKLQotICAgICAgICByZXR1cm4gTF92YXIxOwotCi0gICAgfQotCi0KLSAgICBfX2lubGluZSAgSW50MzIgZnhwX211bF8xNl9ieV8xNnR0KEludDMyIExfdmFyMSwgIEludDMyIExfdmFyMikKLSAgICB7Ci0gICAgICAgIExfdmFyMiA9IExfdmFyMiA+PiAxNjsKLSAgICAgICAgTF92YXIxID0gTF92YXIxID4+IDE2OwotCi0gICAgICAgIExfdmFyMSAqPSBMX3ZhcjI7Ci0KLSAgICAgICAgcmV0dXJuIExfdmFyMTsKLQotICAgIH0KLQotICAgIF9faW5saW5lICBJbnQzMiBmeHBfbWFjXzE2X2J5XzE2KEludDE2IExfdmFyMSwgIEludDE2IExfdmFyMiwgSW50MzIgTF9hZGQpCi0gICAgewotCi0gICAgICAgIExfYWRkICs9IExfdmFyMSAqIExfdmFyMjsKLQotICAgICAgICByZXR1cm4gTF9hZGQ7Ci0KLSAgICB9Ci0KLQotCi0KLQotICAgIF9faW5saW5lICBJbnQzMiBmeHBfbWFjXzE2X2J5XzE2X2JiKEludDE2IExfdmFyMSwgIEludDMyIExfdmFyMiwgSW50MzIgTF9hZGQpCi0gICAgewotICAgICAgICBMX3ZhcjIgPSAoTF92YXIyIDw8IDE2KSA+PiAxNjsKLQotICAgICAgICBMX2FkZCArPSBMX3ZhcjEgKiBMX3ZhcjI7Ci0KLSAgICAgICAgcmV0dXJuIExfYWRkOwotCi0gICAgfQotCi0KLSAgICBfX2lubGluZSAgSW50MzIgZnhwX21hY18xNl9ieV8xNl9idChJbnQxNiBMX3ZhcjEsICBJbnQzMiBMX3ZhcjIsIEludDMyIExfYWRkKQotICAgIHsKLSAgICAgICAgTF92YXIyID0gTF92YXIyID4+IDE2OwotCi0gICAgICAgIExfYWRkICs9IExfdmFyMSAqIExfdmFyMjsKLQotICAgICAgICByZXR1cm4gTF9hZGQ7Ci0KLSAgICB9Ci0KLQotCi0KLQotICAgIF9faW5saW5lICBJbnQzMiBjbXBseF9tdWwzMl9ieV8xNihJbnQzMiB4LCBjb25zdCBJbnQzMiB5LCBJbnQzMiBleHBfancpCi0gICAgewotICAgICAgICBJbnQzMiAgclRtcDAgPSAoSW50MTYpKGV4cF9qdyA+PiAxNik7Ci0gICAgICAgIEludDMyICBpVG1wMCA9IGV4cF9qdzsKLSAgICAgICAgSW50MzIgIHo7Ci0KLSAgICAgICAgeiAgPSAoSW50MzIpKCgoaW50NjRfdCl4ICogKHJUbXAwIDw8IDE2KSkgPj4gMzIpOwotICAgICAgICB6ICs9IChJbnQzMikoKChpbnQ2NF90KXkgKiAoaVRtcDAgPDwgMTYpKSA+PiAzMik7Ci0KLSAgICAgICAgcmV0dXJuICh6KTsKLSAgICB9Ci0KLQotICAgIF9faW5saW5lICBJbnQzMiBmeHBfbXVsMzJfYnlfMTYoSW50MzIgTF92YXIxLCBjb25zdCBJbnQzMiBMX3ZhcjIpCi0gICAgewotICAgICAgICBJbnQzMiAgejsKLQotICAgICAgICB6ID0gKEludDMyKSgoKGludDY0X3QpIExfdmFyMSAqIChMX3ZhcjIgPDwgMTYpKSA+PiAzMik7Ci0gICAgICAgIHJldHVybih6KTsKLSAgICB9Ci0KLQotI2RlZmluZSBmeHBfbXVsMzJfYnlfMTZiKCBhLCBiKSAgIGZ4cF9tdWwzMl9ieV8xNiggYSwgYikKLQotCi0gICAgX19pbmxpbmUgIEludDMyIGZ4cF9tdWwzMl9ieV8xNnQoSW50MzIgTF92YXIxLCBjb25zdCBJbnQzMiBMX3ZhcjIpCi0gICAgewotICAgICAgICBJbnQzMiAgclRtcDAgPSAoSW50MTYpKExfdmFyMiA+PiAxNik7Ci0gICAgICAgIEludDMyICB6OwotCi0gICAgICAgIHogPSAoSW50MzIpKCgoaW50NjRfdCkgTF92YXIxICogKHJUbXAwIDw8IDE2KSkgPj4gMzIpOwotCi0gICAgICAgIHJldHVybih6KTsKLSAgICB9Ci0KLQotICAgIF9faW5saW5lICBJbnQzMiBmeHBfbWFjMzJfYnlfMTYoY29uc3QgSW50MzIgTF92YXIxLCBjb25zdCBJbnQzMiBMX3ZhcjIsIEludDMyIExfYWRkKQotICAgIHsKLSAgICAgICAgSW50MzIgIHJUbXAwID0gTF92YXIyIDw8IDE2OwotCi0gICAgICAgIExfYWRkICs9IChJbnQzMikoKChpbnQ2NF90KSBMX3ZhcjEgKiByVG1wMCkgPj4gMzIpOwotCi0gICAgICAgIHJldHVybihMX2FkZCk7Ci0gICAgfQotCi0gICAgX19pbmxpbmUgIGludDY0X3QgZnhwX21hYzY0X1EzMShpbnQ2NF90IHN1bSwgY29uc3QgSW50MzIgTF92YXIxLCBjb25zdCBJbnQzMiBMX3ZhcjIpCi0gICAgewotICAgICAgICBzdW0gKz0gKGludDY0X3QpTF92YXIxICogTF92YXIyOwotICAgICAgICByZXR1cm4gKHN1bSk7Ci0gICAgfQotCi0gICAgX19pbmxpbmUgSW50MzIgZnhwX211bDMyX1EzMShjb25zdCBJbnQzMiBhLCBjb25zdCBJbnQzMiBiKQotICAgIHsKLSAgICAgICAgcmV0dXJuIChJbnQzMikoKChpbnQ2NF90KShhKSAqIGIpID4+IDMyKTsKLSAgICB9Ci0KLSAgICBfX2lubGluZSBJbnQzMiBmeHBfbWFjMzJfUTMxKEludDMyIExfYWRkLCBjb25zdCBJbnQzMiBhLCBjb25zdCBJbnQzMiBiKQotICAgIHsKLSAgICAgICAgcmV0dXJuIChMX2FkZCArIChJbnQzMikoKChpbnQ2NF90KShhKSAqIGIpID4+IDMyKSk7Ci0gICAgfQotCi0gICAgX19pbmxpbmUgSW50MzIgZnhwX21zdTMyX1EzMShJbnQzMiBMX3N1YiwgY29uc3QgSW50MzIgYSwgY29uc3QgSW50MzIgYikKLSAgICB7Ci0gICAgICAgIHJldHVybiAoTF9zdWIgLSAoSW50MzIpKCgoaW50NjRfdCkoYSkgKiBiKSA+PiAzMikpOwotICAgIH0KLQotCi0gICAgX19pbmxpbmUgSW50MzIgZnhwX211bDMyX1EzMChjb25zdCBJbnQzMiBhLCBjb25zdCBJbnQzMiBiKQotICAgIHsKLSAgICAgICAgcmV0dXJuIChJbnQzMikoKChpbnQ2NF90KShhKSAqIGIpID4+IDMwKTsKLSAgICB9Ci0KLSAgICBfX2lubGluZSBJbnQzMiBmeHBfbWFjMzJfUTMwKGNvbnN0IEludDMyIGEsIGNvbnN0IEludDMyIGIsIEludDMyIExfYWRkKQotICAgIHsKLSAgICAgICAgcmV0dXJuIChMX2FkZCArIChJbnQzMikoKChpbnQ2NF90KShhKSAqIGIpID4+IDMwKSk7Ci0gICAgfQotCi0KLSAgICBfX2lubGluZSBJbnQzMiBmeHBfbXVsMzJfUTI5KGNvbnN0IEludDMyIGEsIGNvbnN0IEludDMyIGIpCi0gICAgewotICAgICAgICByZXR1cm4gKEludDMyKSgoKGludDY0X3QpKGEpICogYikgPj4gMjkpOwotICAgIH0KLQotICAgIF9faW5saW5lIEludDMyIGZ4cF9tYWMzMl9RMjkoY29uc3QgSW50MzIgYSwgY29uc3QgSW50MzIgYiwgSW50MzIgTF9hZGQpCi0gICAgewotICAgICAgICByZXR1cm4gKExfYWRkICsgKEludDMyKSgoKGludDY0X3QpKGEpICogYikgPj4gMjkpKTsKLSAgICB9Ci0KLSAgICBfX2lubGluZSBJbnQzMiBmeHBfbXN1MzJfUTI5KGNvbnN0IEludDMyIGEsIGNvbnN0IEludDMyIGIsIEludDMyIExfc3ViKQotICAgIHsKLSAgICAgICAgcmV0dXJuIChMX3N1YiAtIChJbnQzMikoKChpbnQ2NF90KShhKSAqIGIpID4+IDI5KSk7Ci0gICAgfQotCi0KLSAgICBfX2lubGluZSBJbnQzMiBmeHBfbXVsMzJfUTI4KGNvbnN0IEludDMyIGEsIGNvbnN0IEludDMyIGIpCi0gICAgewotICAgICAgICByZXR1cm4gKEludDMyKSgoKGludDY0X3QpKGEpICogYikgPj4gMjgpOwotICAgIH0KLQotICAgIF9faW5saW5lIEludDMyIGZ4cF9tdWwzMl9RMjcoY29uc3QgSW50MzIgYSwgY29uc3QgSW50MzIgYikKLSAgICB7Ci0gICAgICAgIHJldHVybiAoSW50MzIpKCgoaW50NjRfdCkoYSkgKiBiKSA+PiAyNyk7Ci0gICAgfQotCi0gICAgX19pbmxpbmUgSW50MzIgZnhwX211bDMyX1EyNihjb25zdCBJbnQzMiBhLCBjb25zdCBJbnQzMiBiKQotICAgI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F9tYWNfMTZfYnlfMTYoSW50MTYgTF92YXIxLCAgSW50MTYgTF92YXIyLCBJbnQzMiBMX2FkZCkKLSAgICB7Ci0gICAgICAgIHJldHVybiAoTF9hZGQgKyAoTF92YXIxKkxfdmFyMikpOwotICAgIH0KLQotCi0KLSAgICBfX2lubGluZSAgSW50MzIgZnhwX21hY18xNl9ieV8xNl9iYihJbnQxNiBMX3ZhcjEsICBJbnQzMiBMX3ZhcjIsIEludDMyIExfYWRkKQotICAgIHsKLSAgICAgICAgTF92YXIyID0gKExfdmFyMiA8PCAxNikgPj4gMTY7Ci0KLSAgICAgICAgcmV0dXJuIChMX2FkZCArIChMX3ZhcjEqTF92YXIyKSk7Ci0KLSAgICB9Ci0KLQotICAgIF9faW5saW5lICBJbnQzMiBmeHBfbWFjXzE2X2J5XzE2X2J0KEludDE2IExfdmFyMSwgIEludDMyIExfdmFyMiwgSW50MzIgTF9hZGQpCi0gICAgewotICAgICAgICBMX3ZhcjIgPSBMX3ZhcjIgPj4gMTY7Ci0KLSAgICAgICAgcmV0dXJuIChMX2FkZCArIChMX3ZhcjEqTF92YXIyKSk7Ci0KLSAgICB9Ci0KLQotICAgIF9faW5saW5lICBJbnQzMiBjbXBseF9tdWwzMl9ieV8xNihJbnQzMiB4LCBjb25zdCBJbnQzMiB5LCBJbnQzMiBleHBfancpCi0gICAgewotICAgICAgICBJbnQzMiAgclRtcDAgPSAoZXhwX2p3ID4+IDE2KSA8PCAxNjsKLSAgICAgICAgSW50MzIgIGlUbXAwID0gZXhwX2p3IDw8IDE2OwotICAgICAgICBJbnQzMiAgejsKLQotCi0gICAgICAgIHogID0gX011bEhpZ2goclRtcDAsIHgpOwotICAgICAgICB6ICs9IF9NdWxIaWdoKGlUbXAwLCB5KTsKLQotICAgICAgICByZXR1cm4gKHopOwotICAgIH0KLQotCi0gICAgX19pbmxpbmUgIEludDMyIGZ4cF9tdWwzMl9ieV8xNihJbnQzMiBMX3ZhcjEsIGNvbnN0IEludDMyIExfdmF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iKQotICAgIHsKLSAgICAgICAgcmV0dXJuIChMX2FkZCArIF9NdWxIaWdoKGIsIGEpKTsKLSAgICB9Ci0KLSAgICBfX2lubGluZSBJbnQzMiBmeHBfbXN1MzJfUTMxKEludDMyIExfc3ViLCBjb25zdCBJbnQzMiBhLCBjb25zdCBJbnQzMiBiKQotICAgIHsKLSAgICAgICAgcmV0dXJuIChMX3N1YiAtIF9NdWxIaWdoKGIsIGEpKTsKLSAgICB9Ci0KLQotICAgIF9faW5saW5lIEludDMyIGZ4cF9tdWwzMl9RMzAoY29uc3QgSW50MzIgYSwgY29uc3QgSW50MzIgYikKLSAgICB7Ci0gICAgICAgIHJldHVybiAoSW50MzIpKCgoaW50NjQpKGEpICogYikgPj4gMzApOwotICAgIH0KLQotICAgIF9faW5saW5lIEludDMyIGZ4cF9tYWMzMl9RMzAoY29uc3QgSW50MzIgYSwgY29uc3QgSW50MzIgYiwgSW50MzIgTF9hZGQpCi0gICAgewotICAgICAgICByZXR1cm4gKExfYWRkICsgKEludDMyKSgoKGludDY0KShhKSAqIGIpID4+IDMwKSk7Ci0gICAgfQotCi0KLSAgICBfX2lubGluZSBJbnQzMiBmeHBfbXVsMzJfUTI5KGNvbnN0IEludDMyIGEsIGNvbnN0IEludDMyIGIpCi0gICAgewotICAgICAgICByZXR1cm4gKEludDMyKSgoKGludDY0KShhKSAqIGIpID4+IDI5KTsKLSAgICB9Ci0KLSAgICBfX2lubGluZSBJbnQzMiBmeHBfbWFjMzJfUTI5KGNvbnN0IEludDMyIGEsIGNvbnN0IEludDMyIGIsIEludDMyIExfYWRkKQotICAgIHsKLSAgICAgICAgcmV0dXJuIChMX2FkZCArIChJbnQzMikoKChpbnQ2NCkoYSkgKiBiKSA+PiAyOSkpOwotICAgIH0KLQotICAgIF9faW5saW5lIEludDMyIGZ4cF9tc3UzMl9RMjkoY29uc3QgSW50MzIgYSwgY29uc3QgSW50MzIgYiwgSW50MzIgTF9zdWIpCi0gICAgewotICAgICAgICByZXR1cm4gKExfc3ViIC0gKEludDMyKSgoKGludDY0KShhKSAqIGIpID4+IDI5KSk7Ci0gICAgfQotCi0KLSAgICBfX2lubGluZSBJbnQzMiBmeHBfbXVsMzJfUTI4KGNvbnN0IEludDMyIGEsIGNvbnN0IEludDMyIGIpCi0gICAgewotICAgICAgICByZXR1cm4gKEludDMyKSgoKGludDY0KShhKSAqIGIpID4+IDI4KTsKLSAgICB9Ci0KLSAgICBfX2lubGluZSBJbnQzMiBmeHBfbXVsMzJfUTI3KGNvbnN0IEludDMyIGEsIGNvbnN0IEludDMyIGIpCi0gICAgewotICAgICAgICByZXR1cm4gKEludDMyKSgoKGludDY0KShhKSAqIGIpID4+IDI3KTsKLSAgICB9Ci0KLSAgICBfX2lubGluZSBJbnQzMiBmeHBfbXVsMzJfUTI2KGNvbnN0IEludDMyIGEsIGNvbnN0IEludDMyIGIpCi0gICAgewotICAgICAgICByZXR1cm4gKEludDMyKSgoKGludDY0KShhKSAqIGIpID4+IDI2KTsKLSAgICB9Ci0KLSAgICBfX2lubGluZSBJbnQzMiBmeHBfbXVsMzJfUTIwKGNvbnN0IEludDMyIGEsIGNvbnN0IEludDMyIGIpCi0gICAgewotICAgICAgICByZXR1cm4gKEludDMyKSgoKGludDY0KShhKSAqIGIpID4+IDIwKTsKLSAgICB9Ci0KLSAgICBfX2lubGluZSBJbnQzMiBmeHBfbXVsMzJfUTE1KGNvbnN0IEludDMyIGEsIGNvbnN0IEludDMyIGIpCi0gICAgewotICAgICAgICByZXR1cm4gKEludDMyKSgoKGludDY0KShhKSAqIGIpID4+IDE1KTsKLSAgICB9Ci0KLSAgICBfX2lubGluZSBJbnQzMiBmeHBfbXVsMzJfUTE0KGNvbnN0IEludDMyIGEsIGNvbnN0IEludDMyIGIpCi0gICAgewotICAgICAgICByZXR1cm4gKEludDMyKSgoKGludDY0KShhKSAqIGIpID4+IDE0KTsKLSAgICB9Ci0KLQotCi0jZW5kaWYKLQotCi0jaWZkZWYgX19jcGx1c3BsdXMKLX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gZnhwX211bDMyX1EzMSggYSwgIGIpICAgX011bEhpZ2goIGIsIGEpCi0KLQotICAgIF9faW5saW5lIEludDMyIGZ4cF9tYWMzMl9RMzEoSW50MzIgTF9hZGQsIGNvbnN0IEludDMyIGEsIGNvbnN0IEludDMyIGIpCi0gICAgewotICAgICAgICByZXR1cm4gKExfYWRkICsgX011bEhpZ2goYiwgYSkpOwotICAgIH0KLQotCi0gICAgX19pbmxpbmUgSW50MzIgZnhwX21zdTMyX1EzMShJbnQzMiBMX3N1YiwgY29uc3QgSW50MzIgYSwgY29uc3QgSW50MzIgYikKLSAgICB7Ci0gICAgICAgIHJldHVybiAoTF9zdWIgLSBfTXVsSGlnaChiLCBhKSk7Ci0gICAgfQotCi0KLSAgICBfX2lubGluZSBJbnQzMiBmeHBfbXVsMzJfUTMwKGNvbnN0IEludDMyIGEsIGNvbnN0IEludDMyIGIpCi0gICAgewotICAgICAgICByZXR1cm4gKEludDMyKSgoKGludDY0KShhKSAqIGIpID4+IDMwKTsKLSAgICB9Ci0KLSAgICBfX2lubGluZSBJbnQzMiBmeHBfbWFjMzJfUTMwKGNvbnN0IEludDMyIGEsIGNvbnN0IEludDMyIGIsIEludDMyIExfYWRkKQotICAgIHsKLSAgICAgICAgcmV0dXJuIChMX2FkZCArIChJbnQzMikoKChpbnQ2NCkoYSkgKiBiKSA+PiAzMCkpOwotICAgIH0KLQotCi0gICAgX19pbmxpbmUgSW50MzIgZnhwX211bDMyX1EyOShjb25zdCBJbnQzMiBhLCBjb25zdCBJbnQzMiBiKQotICAgIHsKLSAgICAgICAgcmV0dXJuIChJbnQzMikoKChpbnQ2NCkoYSkgKiBiKSA+PiAyOSk7Ci0gICAgfQotCi0gICAgX19pbmxpbmUgSW50MzIgZnhwX21hYzMyX1EyOShjb25zdCBJbnQzMiBhLCBjb25zdCBJbnQzMiBiLCBJbnQzMiBMX2FkZCkKLSAgICB7Ci0gICAgICAgIHJldHVybiAoTF9hZGQgKyAoSW50MzIpKCgoaW50Nj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ZXIgPSBwb3dlciArICgodGVtcCp0ZW1wKSA+PiA2KTsKLQotICAgICAgICAqKHBBcnJheSkgPSAoSW50MzIpdGVtcDsKLQotICAgICAgICBwQXJyYXkgPSBwQXJyYXkgKyAxOwotCi0gICAgRU5ERk9SCi0KLSAgICBrID0gMDsKLSAgICBxX2FkanVzdCA9IDMwOwotCi0gICAgSUYgKHBvd2VyKQotICAgIFRIRU4KLQotICAgICAgICBXSElMRSAoIHBvd2VyID4gMzI3NjcpCi0KLSAgICAgICAgICAgIHBvd2VyID0gcG93ZXIgPj4gMTsKLSAgICAgICAgICAgIGsgPSBrICsgMTsKLQotICAgICAgICBFTkRXSElMRQotCi0gICAgICAgIGsgPSBrIC0gMTM7Ci0KLSAgICAgICAgSUYgKGsgPCAwKQotICAgICAgICBUSEVOCi0gICAgICAgICAgICBrID0gLWs7Ci0gICAgICAgICAgICBJRiAoIGsgJiAxICkKLSAgICAgICAgICAgIFRIRU4KLSAgICAgICAgICAgICAgICBwb3dlcl9hZGogPSAocG93ZXJfYWRqKlNRUlRfT0ZfMik+PjE0OwotICAgICAgICAgICAgRU5ESUYKLSAgICAgICAgICAgIHFfYWRqdXN0ID0gcV9hZGp1c3QgLSAoIGsgPj4gMSk7Ci0KLSAgICAgICAgRUxTRSBJRiAoayA+IDApCi0gICAgICAgIFRIRU4KLSAgICAgICAgICAgIElGICggayAmIDEgICkKLSAgICAgICAgICAgIFRIRU4KLSAgICAgICAgICAgICAgICBwb3dlcl9hZGogPSAocG93ZXJfYWRqKklOVl9TUVJUX09GXzIpPj4xNDsKLSAgICAgICAgICAgIEVORElGCi0gICAgICAgICAgICBxX2FkanVzdCA9IHFfYWRqdXN0ICsgKCBrID4+IDEpOwotICAgICAgICBFTkRJRgotCi0gICAgICAgIHBJbnZTcXJ0Q29lZmYgPSBpbnZfc3FydF9jb2VmZjsKLQotICAgICAgICBpbnZfc3FydF9wb3dlciAgPSAoKihwSW52U3FydENvZWZmKSogcG93ZXIpID4+MTU7Ci0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fYXJyYXlbXSwKLSAgICBjb25zdCBJbnQgYmFuZF9sZW5ndGgsCi0gICAgSW50MzIqICAgcFNlZWQsCi0gICAgY29uc3QgSW50IHBvd2VyX3NjYWxlKQotewotCi0gICAgSW50ICAgICAgazsKLSAgICBVSW50ICAgICBwb3dlcl9hZGo7Ci0gICAgSW50ICAgICAgcV9hZGp1c3QgPSAzMDsKLQotICAgIEludDMyICAgIHRlbXA7Ci0gICAgSW50MzIgICAgc2VlZDsKLSAgICBJbnQzMiAgICBwb3dlcjsKLQotICAgIEludDMyKiAgIHBBcnJheSA9ICZyYW5kb21fYXJyYXlbMF07Ci0KLSAgICBJbnQzMiAgICBpbnZfc3FydF9wb3dlcjsKLSAgICBjb25zdCBJbnQgICpwSW52U3FydENvZWZmOwotCi0gICAgLyoKLSAgICAgKiAgVGhlIG91dCBvZiB0aGUgcmFuZG9tIG51bWJlciBnZW5lcmF0b3IgaXMgc2NhbGVkIGlzIHN1Y2ggYSB3YXkKLSAgICAgKiAgdGhhdCBpcyBpbmRlcGVuZGVudCBvZiB0aGUgYmFuZCBsZW5ndGguCi0gICAgICogIFRoZSBvdXRwdXQgaXMgY29tcHV0ZWQgYXM6Ci0gICAgICoKLSAgICAgKiAgICAgICAgICAgICAgICAgIHgoaSkKLSAgICAgKiAgb3V0cHV0ID0gLS0tLS0tLS0tLS0tLS0tLS0tICogMl4ocG93ZXJfc2NhbGUlNCkgMl4oZmxvb3IocG93ZXJfc2NhbGUvNCkpCi0gICAgICogICAgICAgICAgICAgICAgICAgYmwKLSAgICAgKiAgICAgICAgICAgc3FydCggIFNVTSB4KGkpXjIgKQotICAgICAqICAgICAgICAgICAgICAgICAgIDAKLSAgICAgKgotICAgICAqICBibCA9PSBiYW5kIGxlbmd0aAotICAgICAqLwotCi0KLSAgICAvKgotICAgICAqICBnZXQgMl4ocG93ZXJfc2NhbGUlNCkKLSAgICAgKi8KLQotCi0gICAgcG93ZXIgPSAwOwotCi0gICAgc2VlZCA9ICpwU2VlZ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bXAgKiB0ZW1wKSA+PiA2KTsKLSAgICAgICAgKnBBcnJheSsrID0gdGVtcDsKLQotICAgIH0gLyogRU5EIGZvciAoaz1oYWxmX2JhbmRfbGVuZ3RoOyBrID4gMDsgay0tKSAqLwotCi0KLSAgICAqcFNlZWQgPSBzZWVkOwotCi0gICAgLyoKLSAgICAgKiAgSWYgdGhlIGRpc3RyaWJ1dGlvbiBpcyB1bmlmb3JtLCB0aGUgcG93ZXIgaXMgZXhwZWN0ZWQgdG8gdXNlIGJldHdlZW4KLSAgICAgKiAgMjggYW5kIDI3IGJpdHMsIGJ5IHNoaWZ0aW5nIGRvd24gYnkgMTMgYml0cyB0aGUgcG93ZXIgd2lsbCBiZSBhCi0gICAgICogIFExNSBudW1iZXIuCi0gICAgICogIEZvciBkaWZmZXJlbnQgYmFuZCBsZW5ndGhzLCB0aGUgcG93ZXIgdXNlcyBiZXR3ZWVuIDIwIGFuZCAyOSBiaXRzCi0gICAgICovCi0KLQotICAgIGsgPSAwOwotCi0gICAgaWYgKHBvd2VyKQotICAgIHsKLSAgICAgICAgLyoKLSAgICAgICAgICogICAgYXBwcm94aW1hdGlvbiByZXF1aXJlcyBwb3dlciAgYmV0d2VlbiAwLjUgPCBwb3dlciA8IDEgaW4gUTE1LgotICAgICAgICAgKi8KLQotICAgICAgICB3aGlsZSAocG93ZXIgPiAzMjc2NykKLSAgICAgICAgewotICAgICAgICAgICAgcG93ZXIgPj49IDE7Ci0gICAgICAgICAgICBrKys7Ci0gICAgICAgIH0KLQotICAgICAgICAvKgotICAgICAgICAgKiAgZXhwZWN0ZWQgcG93ZXIgYml0IHVzYWdlID09IDI3IGJpdHMKLSAgICAgICAgICovCi0KLSAgICAgICAgayAtPSAxMzsKLQotICAgICAgICBwb3dlcl9hZGogPSBzY2FsZV9tb2RfNFtwb3dlcl9zY2FsZSAmIDNdOwotCi0gICAgICAgIGlmIChrIDwgMCkKLSAgICAgICAgewotICAgICAgICAgICAgayA9IC1rOwotICAgICAgICAgICAgaWYgKGsgJiAxKQotICAgICAgICAgICAgeyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvKiBtdWx0aXBseSBieSBzcXJ0KDIpICAqLwotICAgICAgICAgICAgICAgIHBvd2VyX2FkaiA9IChVSW50KSgoKFVJbnQzMikgcG93ZXJfYWRqICogU1FSVF9PRl8yKSA+PiAxNCk7Ci0gICAgICAgICAgICB9Ci0gICAgICAgICAgICBxX2FkanVzdCAtPSAoayA+PiAxKTsgICAgLyogYWRqdXN0IFEgaW5zdGVhZCBvZiBzaGlmdGluZyB1cCAqLwotICAgICAgICB9Ci0gICAgICAgIGVsc2UgaWYgKGsgPiAwKQotICAgICAgICB7Ci0gICAgICAgICAgICBpZiAoayAmIDEpCi0gICAgICAgICAgICB7ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8qIG11bHRpcGx5IGJ5IDEvc3FydCgyKSAgKi8KLSAgICAgICAgICAgICAgICBwb3dlcl9hZGogPSAoVUludCkoKChVSW50MzIpIHBvd2VyX2FkaiAqIElOVl9TUVJUX09GXzIpID4+IDE0KTsKLSAgICAgICAgICAgIH0KLSAgICAgICAgICAgIHFfYWRqdXN0ICs9IChrID4+IDEpOyAgIC8qIGFkanVzdCBRIGluc3RlYWQgb2Ygc2hpZnRpbmcgZG93biAqLwotICAgICAgICB9Ci0KLSAgICAgICAgLyoKLSAgICAgICAgICogICAgQ29tcHV0ZSAxL3NxcnQocG93ZXIpLCB3aGVyZSAwLjUgPCBwb3dlciA8IDEuMCBpcyBhcHByb3hpbWF0ZWQKLSAgICAgICAgICogICAgdXNpbmcgYSBwb2x5bm9taWFsIG9yZGVyIElOVl9TUVJUX1BPTFlfT1JERVIKLSAgICAgICAgICovCi0KLSAgICAgICAgcEludlNxcnRDb2VmZiA9IGludl9zcXJ0X2NvZWZmOwotCi0gICAgICAgIGludl9zcXJ0X3Bvd2VyICA9ICgqKHBJbnZTcXJ0Q29lZmYrKykgKiBwb3dlcikgPj4gMTU7Ci0gICAgICAgIGludl9zcXJ0X3Bvd2VyICs9ICoocEludlNxcnRDb2VmZisrKTsKLSAgICAgICAgaW52X3NxcnRfcG93ZXIgID0gKGludl9zcXJ0X3Bvd2VyICogcG93ZXIpID4+IDE1OwotICAgICAgICBpbnZfc3FydF9wb3dlciArPSAqKHBJbnZTcXJ0Q29lZmYrKyk7Ci0gICAgICAgIGludl9zcXJ0X3Bvd2VyICA9IChpbnZfc3FydF9wb3dlciAqIHBvd2VyKSA+PiAxNTsKLSAgICAgICAgaW52X3NxcnRfcG93ZXIgKz0gKihwSW52U3FydENvZWZmKyspOwotICAgICAgICBpbnZfc3FydF9wb3dlciAgPSAoaW52X3NxcnRfcG93ZXIgKiBwb3dlcikgPj4gMTU7Ci0gICAgICAgIGludl9zcXJ0X3Bvd2VyICs9ICoocEludlNxcnRDb2VmZik7Ci0KLSAgICAgICAgaW52X3NxcnRfcG93ZXIgID0gKGludl9zcXJ0X3Bvd2VyICogcG93ZXJfYWRqKSA+PiAxMzsKLQotICAgICAgICBwQXJyYXkgPSAmcmFuZG9tX2FycmF5WzBdOwotCi0gICAgICAgIGZvciAoayA9IChiYW5kX2xlbmd0aCA+PiAxKTsgayAhPSAwOyBrLS0pCi0gICAgICAgIHsKLSAgICAgICAgICAgIHRlbXAgICAgICAgID0gKihwQXJyYXkpICogaW52X3NxcnRfcG93ZXI7Ci0gICAgICAgICAgICAqKHBBcnJheSsrKSA9IHRlbXA7Ci0gICAgICAgICAgICB0ZW1wICAgICAgICA9ICoocEFycmF5KSAqIGludl9zcXJ0X3Bvd2VyOwotICAgICAgICAgICAgKihwQXJyYXkrKykgPSB0ZW1wOwotICAgICAgICB9IC8qIEVORCBmb3IgKGs9aGFsZl9iYW5kX2xlbmd0aDsgayA+IDA7IGstLSkgKi8KLQotICAgIH0gICAvKiBpZihwb3dlcikgKi8KLQotICAgIC8qCi0gICAgICogICAgICBBZGp1c3QgUSB3aXRoIHRoZSB2YWx1ZSBjb3JyZXNwb25kaW5nIHRvIDJe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RJRllJTkcoIHBJbnB1dFN0cmVhbSApCi0gICAgICAgIFJFVFVSTklORyggdGVtcCApCi0KLSAgICAgICAgSUYgKHRlbXAgIT0gRkFMU0UpIFRIRU4KLSAgICAgICAgICAgIEZPUiAoaSA9IExFTl9DT1BZUlRfSUQ7IGkgPiAwOyBpLS0pCi0gICAgICAgICAgICAgICBDQUxMIGdldGJpdHMoCi0gICAgICAgICAgICAgICAgICAgbmVlZGVkQml0cyA9IExFTl9CWVRFLAotICAgICAgICAgICAgICAgICAgIHBJbnB1dFN0cmVhbSA9IHBJbnB1dFN0cmVhbSkKLSAgICAgICAgICAgICAgIE1PRElGWUlORyggcElucHV0U3RyZWFtICkKLQotICAgICAgICAgICAgRU5EIEZPUgotICAgICAgICBFTkQgSUYKLQotICAgICAgICBDQUxMIGdldGJpdHMoCi0gICAgICAgICAgICBuZWVkZWRCaXRzID0gTEVOX09SSUcgKyBMRU5fSE9NRSwKLSAgICAgICAgICAgIHBJbnB1dFN0cmVhbSA9IHBJbnB1dFN0cmVhbSkKLSAgICAgICAgTU9ESUZZSU5HKCBwSW5wdXRTdHJlYW0gKQotCi0gICAgICAgIENBTEwgZ2V0Yml0cygKLSAgICAgICAgICAgIG5lZWRlZEJpdHMgPSBMRU5fQlNfVFlQRSwKLSAgICAgICAgICAgIHBJbnB1dFN0cmVhbSA9IHBJbnB1dFN0cmVhbSkKLSAgICAgICAgTU9ESUZZSU5HKCBwSW5wdXRTdHJlYW0gKQotICAgICAgICBSRVRVUk5JTkcoIGJpdFN0cmVhbVR5cGUgKQotCi0gICAgICAgIENBTEwgZ2V0Yml0cygKLSAgICAgICAgICAgIG5lZWRlZEJpdHMgPSBMRU5fQklUX1JBVEUsCi0gICAgICAgICAgICBwSW5wdXRTdHJlYW0gPSBwSW5wdXRTdHJlYW0pCi0gICAgICAgIE1PRElGWUlORyggcElucHV0U3RyZWFtICkKLSAgICAgICAgUkVUVVJOSU5HKCBwSGVhZGVyLT5iaXRyYXRlICkKLQotICAgICAgICBDQUxMIGdldGJpdHMoCi0gICAgICAgICAgICBuZWVkZWRCaXRzID0gTEVOX05VTV9QQ0UsCi0gICAgICAgICAgICBwSW5wdXRTdHJlYW0gPSBwSW5wdXRTdHJlYW0pCi0gICAgICAgIE1PRElGWUlORyggcElucHV0U3RyZWFtICkKLSAgICAgICAgUkVUVVJOSU5HKCBudW1Db25maWdFbGVtZW50c01pbnVzMSApCi0KLSAgICAgICAgRk9SICggIGkgPSBudW1Db25maWdFbGVtZW50c01pbnVzMTsKLSAgICAgICAgICAgICAgKGkgPj0gMCkgJiYgKHN0YXR1cyA9PSBTVUNDRVNTKTsKLSAgICAgICAgICAgICAgIGktLSkKLQotICAgICAgICAgICAgSUYgKGJpdFN0cmVhbVR5cGUgPT0gQ09OU1RBTlRfUkFURV9CSVRTVFJFQU0pIFRIRU4KLSAgICAgICAgICAgICAgIENBTEwgZ2V0Yml0cygKLSAgICAgICAgICAgICAgICAgICBuZWVkZWRCaXRzID0gTEVOX0FESUZfQkYsCi0gICAgICAgICAgICAgICAgICAgcElucHV0U3RyZWFtID0gcElucHV0U3RyZWFtKQotICAgICAgICAgICAgICAgTU9ESUZZSU5HKCBwSW5wdXRTdHJlYW0gKQotICAgICAgICAgICAgRU5EIElGCi0KLSAgICAgICAgICAgIENBTEwgZ2V0X3Byb2dfY29uZmlnKAotICAgICAgICAgICAgICAgIHBWYXJzID0gcFZhcnMpCi0gICAgICAgICAgICBNT0RJRllJTkcoIHBWYXJzLT5wcm9nX2NvbmZpZyApCi0gICAgICAgICAgICBSRVRVUk5JTkcoIHN0YXR1cyApCi0KLSAgICAgICAgRU5EIEZPUgotICAgIEVORCBJRgotCi0gICAgUkVUVVJOIChzdGF0dXMpCi0KLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLQotIFJFU09VUkNFUyBVU0VECi0gICBXaGVuIH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gICAgICAqIGNhbiBzdGFydCBhdCB0aGUgYmVnaW5uaW5nLgotICAgICAgICAgKi8KLQotICAgICAgICBwSW5wdXRTdHJlYW0tPnVzZWRCaXRzIC09ICg0ICogTEVOX0JZVEUpOwotCi0gICAgICAgIC8qCi0gICAgICAgICAqIFRoZSBjb25zdGFudCBpbiB0aGUgbmV4dCBsaW5lIG5lZWRzIHRvIGJlIHVwZGF0ZWQgd2hlbgotICAgICAgICAgKiBlcnJvciBoYW5kbGluZyBtZXRob2QgaXMgZGV0ZXJtaW5lZC4KLSAgICAgICAgICovCi0gICAgICAgIHN0YXR1cyA9IC0xOwotICAgIH0KLSAgICBlbHNlCi0gICAgewotICAgICAgICAvKgotICAgICAgICAgKiBUbyBzYXZlIHNwYWNlLCB0aGUgdW51c2VkIGZpZWxkcyBhcmUgcmVhZCBpbiwgYnV0IG5vdCBzYXZlZC4KLSAgICAgICAgICovCi0KLSAgICAgICAgLyogY29weXJpZ2h0IHN0cmluZyAqLwotICAgICAgICB0ZW1wID0KLSAgICAgICAgICAgIGdldDFiaXRzKC8qICAgICAgICAgICAgICAgIExFTl9DT1BZUlRfUFJFUywqLwotICAgICAgICAgICAgICAgIHBJbnB1dFN0cmVhbSk7Ci0KLSAgICAgICAgaWYgKHRlbXAgIT0gRkFMU0UpCi0gICAgICAgIHsKLSAgICAgICAgICAgIC8qCi0gICAgICAgICAgICAgKiBSZWFkIGluIGFuZCBpZ25vcmUgdGhlIGNvcHlyaWdodCBzdHJpbmcuIElmIHJlc3RvcmluZwotICAgICAgICAgICAgICogd2F0Y2ggb3V0IGZvciBjb3VudCBkb3duIGxvb3AuCi0gICAgICAgICAgICAgKi8KLQotICAgICAgICAgICAgZm9yIChpID0gTEVOX0NPUFlSVF9JRDsgaSA+IDA7IGktLSkKLSAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICBnZXQ5X25fbGVzc2JpdHMoTEVOX0JZVEUsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBJbnB1dFN0cmVhbSk7Ci0gICAgICAgICAgICB9IC8qIGVuZCBmb3IgKi8KLQotICAgICAgICAgICAgLyoKLSAgICAgICAgICAgICAqIE1ha2Ugc3VyZSB0byB0ZXJtaW5hdGUgdGhlIHN0cmluZyB3aXRoICdcMCcgaWYgcmVzdG9yaW5nCi0gICAgICAgICAgICAgKiB0aGUgdGhlIGNvcHlyaWdodCBzdHJpbmcuCi0gICAgICAgICAgICAgKi8KLQotICAgICAgICB9IC8qIGVuZCBpZiAqLwotCi0gICAgICAgIC8qIENvbWJpbmUgdGhlIG9yaWdpbmFsL2NvcHkgYW5kIGZpZWxkcyBpbnRvIG9uZSBjYWxsICovCi0gICAgICAgIGdldDlfbl9sZXNzYml0cygKLSAgICAgICAgICAgIExFTl9PUklHICsgTEVOX0hPTUUsCi0gICAgICAgICAgICBwSW5wdXRTdHJlYW0pOwotCi0gICAgICAgIGJpdFN0cmVhbVR5cGUgPQotICAgICAgICAgICAgZ2V0MWJpdHMoLyogICAgICAgICAgICAgICAgTEVOX0JTX1RZUEUsKi8KLSAgICAgICAgICAgICAgICBwSW5wdXRTdHJlYW0pOwotCi0gICAgICAgIHBIZWFkZXItPmJpdHJhdGUgPQotICAgICAgICAgICAgZ2V0Yml0cygKLSAgICAgICAgICAgICAgICBMRU5fQklUX1JBVEUsCi0gICAgICAgICAgICAgICAgcElucHV0U3RyZWFtKTsKLQotICAgICAgICAvKgotICAgICAgICAgKiBSZWFkIGluIGFsbCB0aGUgUHJvZ3JhbSBDb25maWd1cmF0aW9uIEVsZW1lbnRzLgotICAgICAgICAgKiBGb3IgdGhpcyBsaWJyYXJ5LCBvbmx5IG9uZSBvZiB0aGUgdXAgdG8gMTYgcG9zc2libGUgUENFJ3Mgd2lsbCBiZQotICAgICAgICAgKiBzYXZlZC4gU2luY2UgZWFjaCBQQ0UgbXVzdCBiZSByZWFkLCBhIHRlbXBvcmFyeSBQQ0Ugc3RydWN0dXJlIGlzCi0gICAgICAgICAqIHVzZWQsIGFuZCBpZiB0aGF0IFBDRSBpcyB0aGUgb25lIHRvIHVzZSwgaXQgaXMgY29waWVkIGludG8gdGhlCi0gICAgICAgICAqIHNpbmdsZSBQQ0UuIFRoaXMgaXMgZG9uZSBpbnNpZGUgb2YgZ2V0X3Byb2dfY29uZmlnKCkKLSAgICAgICAgICovCi0KLSAgICAgICAgbnVtQ29uZmlnRWxlbWVudHNNaW51czEgPSAgZ2V0OV9uX2xlc3NiaXRzKExFTl9OVU1fUENFLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwSW5wdXRTdHJlYW0pOwotCi0gICAgICAgIGZvciAoaSA9IG51bUNvbmZpZ0VsZW1lbnRzTWludXMxOwotICAgICAgICAgICAgICAgIChpID49IDApICYmIChzdGF0dXMgPT0gU1VDQ0VTUyk7Ci0gICAgICAgICAgICAgICAgaS0tKQotICAgICAgICB7Ci0gICAgICAgICAgICAvKgotICAgICAgICAgICAgICogRm9yIEFESUYgY29udGFudCBiaXQgcmF0ZSBzdHJlYW1zLCB0aGUgX2VuY29kZXJfIGJ1ZmZlcgotICAgICAgICAgICAgICogZnVsbG5lc3MgaXMgdHJhbnNtaXR0ZWQuIFRoaXMgdmVyc2lvbiBvZiBhbiBBQUMgZGVjb2RlciBoYXMKLSAgICAgICAgICAgICAqIG5vIHVzZSBmb3IgdGhpcyB2YXJpYWJsZTsgeWV0IGl0IG11c3QgYmUgcmVhZCBpbiB0byBtb3ZlCi0gICAgICAgICAgICAgKiB0aGUgYml0c3RyZWFtIHBvaW50ZXJzLgotICAgICAgICAgICAgICovCi0KLSAgICAgICAgICAgIGlmIChiaXRTdHJlYW1UeXBlID09IENPTlNUQU5UX1JBVEVfQklUU1RSRUFNKQotICAgICAgICAgICAgewotICAgICAgICAgICAgICAgIGdldGJpdHMoCi0gICAgICAgICAgICAgICAgICAgIExFTl9BRElGX0JGLAotICAgICAgICAgICAgICAgICAgICBwSW5wdXRTdHJlYW0pOwotICAgICAgICAgICAgfSAvKiBlbmQgaWYgKi8KLQotICAgICAgICAgICAgcFZhcnMtPmFkaWZfdGVzdCA9IDE7Ci0gICAgICAgICAgICAvKiBHZXQgb25lIHByb2dyYW0gY29uZmlndXJhdGlvbiBlbGVtZW50ICovCi0gICAgICAgICAgICBzdGF0dXMgPQotICAgICAgICAgICAgICAgIGdldF9wcm9nX2NvbmZpZygKLSAgICAgICAgICAgICAgICAgICAgcFZhcnMsCi0gICAgICAgICAgICAgICAgICAgIHBTY3JhdGNoUENFKTsKLQotI2lmZGVmIEFBQ19QTFVTCi0KLSAgICAgICAgICAgIC8qCi0gICAgICAgICAgICAgKiAgRm9yIGltcGxpY2l0IHNpZ25hbGxpbmcsIG5vIGhpbnQgdGhhdCBzYnIgb3IgcHMgaXMgdXNlZCwgc28gd2UgbmVlZCB0bwotICAgICAgICAgICAgICogIGNoZWNrIHRoZSBzYW1wbGluZyBmcmVxdWVuY3kgb2YgdGhlIGFhYyBjb250ZW50LCBpZiBsZXNzZXIgb3IgZXF1YWwgdG8KLSAgICAgICAgICAgICAqICAyNCBLSHosIGJ5IGRlZnVhbHQgdXBzYW1wbGUsIG90aGVyd2lzZSwgZG8gbm90aGluZwotICAgICAgICAgICAgICovCi0gICAgICAgICAgICBpZiAoKHBWYXJzLT5wcm9nX2NvbmZpZy5zYW1wbGluZ19yYXRlX2lkeCA+PSA2KSAmJiAocFZhcnMtPmFhY1BsdXNFbmFibGVkID09IHRydWUpICYmCi0gICAgICAgICAgICAgICAgICAgIHBWYXJzLT5tY19pbmZvLmF1ZGlvT2JqZWN0VHlwZSA9PSBNUDRBVURJT19BQUNfTEMpCi0gICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgcFZhcnMtPm1jX2luZm8udXBzYW1wbGluZ0ZhY3RvciA9IDI7Ci0gICAgICAgICAgICAgICAgcFZhcnMtPnByb2dfY29uZmlnLnNhbXBsaW5nX3JhdGVfaWR4IC09IDM7Ci0gICAgICAgICAgICAgICAgcFZhcnMtPm1jX2luZm8uc2Jy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lICAvICAgICBcICBVTlVTRUQKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBcICAgLyBcICAgLyAgICAgICBcICAgLwotfDAwfDAxfDAyfDAzfDA0fDA1fDA2fDA3fDA4fDA5fDEwfDExfDEyfDEzfDE0fDE1fDE2fDE3fDE4fDE5fDIwfDIxfDIyfDIzfDI0fDI1fAotIFwgICAgICAgICBfX19fX19fX19fX19fX18gICAgICAgICAvIHwgICBcICAvICAgICAgICAgICAgICAgICAgICAgICAgIFwgICAgICAvCi0gIFwtLS0tLS0tfDB4RkZGIHN5bmN3b3JkIHwtLS0tLS0tLyAgfCAgIExheWVyID09ICcwMCcgZm9yIEFBQyAgICAgICAgIFwgICAgLwotICAgICAgICAgICBcLS0tLS0tLS0tLS0tLS8gICAgICAgICAgIHwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXCAgLwotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFwvCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgSUQgPT0gJzEnIGZvciBNUEVHLTIgQUFDICAgIGNoYW5uZWxfY29uZmlnCi0gICAgICAgY29weXJpZ2h0X2lkX2JpdCAgICAgICAgICAgICAgICAgPT0gJzAnIGZvciBNUEVHLTQgQUFDCi0gICAgICAgICAgLwotICAgIGhvbWUgLwotICAgICAvICAvCi18MjZ8Mjd8Mjh8Mjl8MzB8MzF8MzJ8MzN8MzR8MzV8MzZ8Mzd8Mzh8Mzl8NDB8NDF8NDJ8Ci0gIHwgICAgICAgIFwgIFwgICAgICAgICAgX19fX19fX19fX19fXyAgICAgICAgICAgLwotICB8ICAgICAgICAgXCAgXC0tLS0tLS0tfGZyYW1lIGxlbmd0aCB8LS0tLS0tLS0tLwotICBvcmlnX2NvcHkgIFwgICAgICAgICAgIFwtLS0tLS0tLS0tLS8KLSAgICAgICAgICAgICAgXCA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HRoZSBjb2RlIGZvciBoaXMvaGVyICBvd24gcHVycG9zZSwKLSAgIGFzc2lnbiBvciBkb25hdGUgdGhlIGNvZGUgdG8gYSB0aGlyZCBwYXJ0eSBhbmQgdG8gaW5oaWJpdCB0aGlyZCBwYXJ0eQotICAgZnJvbSB1c2luZyB0aGUgY29kZSBmb3Igbm9uIE1QRUctMiBOQkMvTVBFRy00IEF1ZGlvIGNvbmZvcm1pbmcgcHJvZHVjdHMuCi0gICBUaGlzIGNvcHlyaWdodCBub3RpY2UgbXVzdCBiZSBpbmNsdWRlZCBpbiBhbGwgY29waWVzIG9yIGRlcml2YXRpdmUKLSAgIHdvcmtzLiIKLSAgIENvcHlyaWdodChjKTE5OTYuCi0KLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLQotIFBTRVVETy1DT0RFCi0KLSAgICBJRiAoKihwSW52b2tlKSA+IDMpCi0KLSAgICAgICAgIENBTEwgZmluZF9hZHRzX3N5bmN3b3JkKAotICAgICAgICAgICAgICAgICAgICBwU3luY3dvcmQsCi0gICAgICAgICAgICAgICAgICAgJihwVmFycy0+aW5wdXRTdHJlYW0pLAotICAgICAgICAgICAgICAgICAgICBMRU5HVEhfRklYRURfSEVBREVSLAotICAgICAgICAgICAgICAgICAgICBNQVNLXzI4QklUUyk7Ci0gICAgICAgICAgIFJFVFVSTklORyAgc3RhdHVzCi0gICAgRUxTRQotCi0gICAgICAgICoocFN5bmN3b3JkKSA9IFNZTkNXT1JEXzE1QklUUzsKLQotICAgICAgICBDQUxMIGZpbmRfYWR0c19zeW5jd29yZCgKLSAgICAgICAgICAgICAgICAgICBwU3luY3dvcmQsCi0gICAgICAgICAgICAgICAgICAmKHBWYXJzLT5pbnB1dFN0cmVhbSksCi0gICAgICAgICAgICAgICAgICAgTEVOR1RIX1NZTkNXT1JELAotICAgICAgICAgICAgICAgIC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gICAgIHBWYXJzLT5wcm9nX2NvbmZpZy5mcm9udC5lbGVfaXNfY3BlWzBdID0gY2hhbm5lbF9jb25maWd1cmF0aW9uOwotCi0gICAgICAgIHBWYXJzLT5wcm9nX2NvbmZpZy5mcm9udC5udW1fZWxlICAgID0gMTsKLQotICAgICAgICBwVmFycy0+cHJvZ19jb25maWcuZnJvbnQuZWxlX3RhZ1swXSA9IDA7Ci0KLSAgICAgICAgcFZhcnMtPnByb2dfY29uZmlnLm1vbm9fbWl4LnByZXNlbnQgPSAwOwotICAgICAgICBwVmFycy0+cHJvZ19jb25maWcuc3RlcmVvX21peC5wcmVzZW50ID0gMDsKLSAgICAgICAgcFZhcnMtPnByb2dfY29uZmlnLm1hdHJpeF9taXgucHJlc2VudCA9IDA7Ci0KLSAgICAgICAgQ0FMTCBzZXRfbWNfaW5mbygKLSAgICAgICAgICAgICAgICAmKHBWYXJzLT5tY19pbmZvKSwKLSAgICAgICAgICAgICAgICAmKHBWYXJzLT5zYXZlZE1DSW5mbyksCi0gICAgICAgICAgICAgICAgJihwVmFycy0+cHJvZ19jb25maWcpLAotICAgICAgICAgICAgICAgICAgcFZhcnMtPnBXaW5TZXFJbmZvLAotICAgICAgICAgICAgICAgICAgcFZhcnMtPlNGQldpZHRoMTI4KTsKLSAgICAgICAgICBNT0RJRllJTkcgcFZhcnMtPm1jX2luZm8gPSBtdWx0aS1jaGFubmVsIGNvbmZpZ3VyYXRpb24gaW5mb3JtYXRpb24KLSAgICAgICAgICBSRVRVUk5JTkcgc3RhdHVzICAgICAgICAgPSBTVUNDRVNTL0ZBSUxVUkUKLQotICAgICAgICBJRiAoICgqcEludm9rZSkgIT0gMCkKLSAgICAgICAgICAgIENBTEwgY2hlY2tfbWNfaW5mbygKLSAgICAgICAgICAgICAgICAgICAgJihwVmFycy0+bWNfaW5mbyksCi0gICAgICAgICAgICAgICAgICAgICYocFZhcnMtPnNhdmVkTUNJbmZvKSwKLSAgICAgICAgICAgICAgICAgICAgIEZBTFNFKTsKLSAgICAgICAgICAgICAgUkVUVVJOSU5HIHN0YXR1cyA9IFNVQ0NFU1MvRkFJTFVSRQotICAgICAgICBFTFNFCi0gICAgICAgICAgICBDQUxMIGNoZWNrX21jX2luZm8oCi0gICAgICAgICAgICAgICAgICAgICYocFZhcnMtPm1jX2luZm8pLAotICAgICAgICAgICAgICAgICAgICAmKHBWYXJzLT5zYXZlZE1DSW5mbyksCi0gICAgICAgICAgICAgICAgICAgICBUUlVFKTsKLSAgICAgICAgICAgICAgTU9ESUZZSU5HIHBWYXJzLT5zYXZlZE1DSW5mbyA9IHBWYXJzLT5tY19pbmZvCi0gICAgICAgICAgICAgIFJFVFVSTklORyBzdGF0dXMgPSBTVUNDRVNTL0ZBSUxVUkUKLSAgICAgICAgRU5ESUYKLQotICAgICAgICBJRiAoc3RhdHVzID09IFNVQ0NFU1MpCi0gICAgICAgICAgICAoKnBJbnZva2UpID0gKCpwSW52b2tlKSArIDE7Ci0gICAgICAgIEVMU0UKLSAgICAgICAgICAgICgqcEludm9rZSkgPSAwOwotICAgICAgICBFTkRJRgotCi0gICAgRU5ESUYKLQotICAgIENBTEwgZ2V0Yml0cygKLSAgICAgICAgICAgIExFTkdUSF9WQVJJQUJMRV9IRUFERVIsCi0gICAgICAgICAgICYocFZhcnMtPmlucHV0U3RyZWFtKSk7Ci0gICAgICBSRVRVUk5JTkcgYWR0c19oZWFkZXIgPSAyOC1iaXRzICh0aGUgY29udGVudHMgb2YgdGhlIHZhcmlhYmxlIGhlYWRlci4pCi0KLSAgICBwVmFycy0+cHJvZ19jb25maWcuZnJhbWVfbGVuZ3RoICA9ICgoVUludCkoYWR0c19oZWFkZXIgPj4gMTMpKSBBTkQgMHgxRkZGOwotCi0gICAgbG93ZXJfMTYgPSAoVUludClhZHRzX2hlYWRlcjsKLQotICAgIHBWYXJzLT5wcm9nX2NvbmZpZy5idWZmZXJfZnVsbG5lc3MgPSAobG93ZXJfMTYgPj4gMikgQU5EIDB4N0ZGOwotCi0gIC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50Ci0gICAgICoKLSAgICAgKiBPdGhlcndpc2UsIHNlYXJjaCBmb3IganVzdCB0aGUgc2hvcnQgc3luY3dvcmQuCi0gICAgICovCi0gICAgaWYgKCoocEludm9rZSkgPiBDb3JyZWN0bHlSZWFkRnJhbWVzQ291bnQpCi0gICAgewotICAgICAgICAvKgotICAgICAgICAgKiBGaW5kIHRoZSBsb25nIEFEVFMgc3luY3dvcmQKLSAgICAgICAgICogKGNvbXByaXNlZCBvZiB0aGUgZW50aXJlIEFEVFMgZml4ZWQgaGVhZGVyKQotICAgICAgICAgKi8KLQotICAgICAgICBzdGF0dXMgPSBmaW5kX2FkdHNfc3luY3dvcmQocFN5bmN3b3JkLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJihwVmFycy0+aW5wdXRTdHJlYW0pLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTEVOR1RIX0ZJWEVEX0hFQURFUiwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIE1BU0tfMjhCSVRTKTsKLSAgICB9Ci0gICAgZWxzZQotICAgIHsKLQotICAgICAgICAqKHBTeW5jd29yZCkgPSBTWU5DV09SRF8xNUJJVFM7Ci0KLSAgICAgICAgc3RhdHVzID0gZmluZF9hZHRzX3N5bmN3b3JkKHBTeW5jd29yZCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICYocFZhcnMtPmlucHV0U3RyZWFtKSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIExFTkdUSF9TWU5DV09SRCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIElEX0JJVF9GSUxURVIpOwotCi0gICAgICAgIC8qCi0gICAgICAgICAqICBFeHRyYWN0IHRoZSBkYXRhIGZyb20gdGhlIGhlYWRlciBmb2xsb3dpbmcgdGhlIHN5bmN3b3JkCi0gICAgICAgICAqLwotICAgICAgICBhZHRzX2hlYWRlciA9IGdldGJpdHMoKExF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gKiBvcmlnaW5hbF9jb3B5IGlzICcwJyBpZiB0aGVyZSBpcyBubyBjb3B5cmlnaHQgaW4gdGhlIGJpdHN0cmVhbS4KLSAgICAgICAgICogICAgICAgICAgICAgICAgICAnMScgaWYgdGhlIGJpdHN0cmVhbSBpcyBjb3B5cmlnaHQgcHJvdGVjdGVkLgotICAgICAgICAgKgotICAgICAgICAgKiBob21lIGlzICcwJyBmb3IgYSBjb3B5LCAnMScgZm9yIGFuIG9yaWdpbmFsLgotICAgICAgICAgKgotICAgICAgICAgKiBQYWNrZXRWaWRlbyBjdXJyZW50bHkgZG9lcyBub3RoaW5nIHdpdGggdGhpcyBpbmZvcm1hdGlvbiwKLSAgICAgICAgICogaG93ZXZlciwgcGFyc2luZyB0aGUgZGF0YSBmcm9tIHRoZSBiaXRzdHJlYW0gY291bGQgYmUgZWFzaWx5Ci0gICAgICAgICAqIGltcGxlbWVudGVkIHdpdGggdGhlIGZvbGxvd2luZyBpbnN0cnVjdGlvbnMuLi4KLSAgICAgICAgICoKLSAgICAgICAgICogb3JpZ2luYWxfY29weSA9IChsb3dlcl8xNiA+PiAxKSAmIDB4MTsKLSAgICAgICAgICoKLSAgICAgICAgICogaG9tZSA9IChsb3dlcl8xNiAmIDB4MSk7Ci0gICAgICAgICAqCi0gICAgICAgICAqLwotCi0gICAgICAgIC8qIFNldCB1cCBiYXNlZCBvbiBpbmZvcm1hdGlvbiBleHRyYWN0ZWQgZnJvbSB0aGUgQURUUyBGSVhFRCBoZWFkZXIgKi8KLQotICAgICAgICAvKiBUaGlzIGVxdWFscyAxIGZvciBTVEVSRU8sIDAgZm9yIE1PTk8gKi8KLSAgICAgICAgaWYgKGNoYW5uZWxfY29uZmlndXJhdGlvbikKLSAgICAgICAgewotICAgICAgICAgICAgY2hhbm5lbF9jb25maWd1cmF0aW9uLS07Ci0gICAgICAgIH0KLSAgICAgICAgcFZhcnMtPnByb2dfY29uZmlnLmZyb250LmVsZV9pc19jcGVbMF0gPSBjaGFubmVsX2NvbmZpZ3VyYXRpb247Ci0KLSAgICAgICAgLyogVGhpcyB2YWx1ZSBpcyBjb25zdGFudCBmb3IgYm90aCBNT05PIGFuZCBTVEVSRU8gKi8KLSAgICAgICAgcFZhcnMtPnByb2dfY29uZmlnLmZyb250Lm51bV9lbGUgICAgPSAxOwotCi0gICAgICAgIC8qIEFEVFMgZG9lcyBub3Qgc3BlY2lmeSB0aGlzIHRhZyB2YWx1ZSAtIGRvIHdlIGV2ZW4gdXNlIGl0PyAqLwotICAgICAgICBwVmFycy0+cHJvZ19jb25maWcuZnJvbnQuZWxlX3RhZ1swXSA9IDA7Ci0KLSAgICAgICAgLyogRGlzYWJsZSBhbGwgbWl4IHJlbGF0ZWQgdmFyaWFibGVzICovCi0gICAgICAgIHBWYXJzLT5wcm9nX2NvbmZpZy5tb25vX21peC5wcmVzZW50ID0gMDsKLSAgICAgICAgcFZhcnMtPnByb2dfY29uZmlnLnN0ZXJlb19taXgucHJlc2VudCA9IDA7Ci0gICAgICAgIHBWYXJzLT5wcm9nX2NvbmZpZy5tYXRyaXhfbWl4LnByZXNlbnQgPSAwOwotCi0gICAgICAgIC8qIGVudGVyIGNvbmZpZ3VyYXRpb24gaW50byBNQ19JbmZvIHN0cnVjdHVyZSAqLwotICAgICAgICBpZiAoc3RhdHVzID09IFNVQ0NFU1MpCi0gICAgICAgIHsKLSAgICAgICAgICAgIC8qIHByb2ZpbGUgKyAxID09IGF1ZGlvT2JqZWN0VHlwZSAqLwotICAgICAgICAgICAgc3RhdHVzID0KLSAgICAgICAgICAgICAgICBzZXRfbWNfaW5mbygKLSAgICAgICAgICAgICAgICAgICAgJihwVmFycy0+bWNfaW5mbyksCi0gICAgICAgICAgICAgICAgICAgICh0TVA0QXVkaW9PYmplY3RUeXBlKShwVmFycy0+cHJvZ19jb25maWcucHJvZmlsZSArIDEpLAotICAgICAgICAgICAgICAgICAgICBwVmFycy0+cHJvZ19jb25maWcuc2FtcGxpbmdfcmF0ZV9pZHgsCi0gICA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hdGEuU2JyQ2hhbm5lbFswXS5zeW5jU3RhdGUgPSBTQlJfQUNUSVZFOwotICAgICAgICAgICAgcFZhcnMtPnNickRlY29kZXJEYXRhLlNickNoYW5uZWxbMV0uc3luY1N0YXRlID0gU0JSX0FDVElWRTsKLSAgICAgICAgfQotI2VuZGlmCi0KLQotICAgICAgICAvKgotICAgICAgICAgKiBUaGUgdGFnIGFuZCBpc19jcGUgd2lsbCBiZSBjaGVja2VkIGluIGh1ZmZkZWNvZGUsCi0gICAgICAgICAqIHJlbW92ZSB0aGlzIGNoZWNrIHJvdXRpbmUuCi0gICAgICAgICAqLwotICAgICAgICAvKmlmIChzdGF0dXMgPT0gU1VDQ0VTUykKLSAgICAgICAgICp7Ci0gICAgICAgICAqICAgaWYgKCAoKnBJbnZva2UpICE9IDApCi0gICAgICAgICAqICAgewotICAgICAgICAgKiAgICAgICBzdGF0dXMgPQotICAgICAgICAgKiAgICAgICAgICAgY2hlY2tfbWNfaW5mbygKLSAgICAgICAgICogICAgICAgICAgICAgICAmKHBWYXJzLT5tY19pbmZvKSwKLSAgICAgICAgICogICAgICAgICAgICAgICAmKHBWYXJzLT5zYXZlZE1DSW5mbyksCi0gICAgICAgICAqICAgICAgICAgICAgICAgRkFMU0UpOwotICAgICAgICAgKiAgIH0KLSAgICAgICAgICogICBlbHNlCi0gICAgICAgICAqICAgewotICAgICAgICAgKiAgICAgICBzdGF0dXMgPQotICAgICAgICAgKiAgICAgICAgICAgY2hlY2tfbWNfaW5mbygKLSAgICAgICAgICogICAgICAgICAgICAgICAmKHBWYXJzLT5tY19pbmZvKSwKLSAgICAgICAgICogICAgICAgICAgICAgICAmKHBWYXJzLT5zYXZlZE1DSW5mbyksCi0gICAgICAgICAqICAgICAgICAgICAgICAgVFJVRSk7Ci0gICAgICAgICAqICAgfQotICAgICAgICAgKgotICAgICAgICAgKn0qLyAvKiBpZiAoc3RhdHVzID09IFNVQ0NFU1MpICovCi0KLSAgICAgICAgLyoKLSAgICAgICAgICogVGhpcyBrZWVwcyB0cmFjayBvZiBob3cgbWFueSBoZWFkZXJzIGhhdmUgYmVlbiByZWFkIGluIHRoZSBmaWxlLgotICAgICAgICAgKiBBZnRlciB0aGUgdGhyZWUgc3VjY2Vzc2Z1bCBoZWFkZXJzIHdpdGggdGhlIHNhbWUgY29uZmlndXJhdGlvbgotICAgICAgICAgKiBhcmUgcmVhZCBpbiwgdGhlIGVudGlyZSBBRFRTIGZpeGVkIGhlYWRlciBpcyB1c2VkIGFzIHRoZSBzeW5jd29yZAotICAgICAgICAgKiBmb3IgYSBtb3JlIHJvYnVzdCAyOC1iaXQgbG9uZyBzeW5jd29yZAotICAgICAgICAgKi8KLQotICAgICAgICBpZiAoc3RhdHVzID09IFNVQ0NFU1MpCi0gICAgICAgIHsKLSAgICAgICAgICAgICgqcEludm9rZSkrKzsKLSAgICAgICAgfQotICAgICAgICBlbHNlCi0gICAgICAgIHsKLSAgICAgICAgICAgICgqcEludm9rZSkgPSAwOwotICAgICAgICB9Ci0KLSAgICB9IC8qIEVORCBpZiAoKihwSW52b2tlKSA+IDMpICovCi0KLSAgICAvKiBHcmFiIHRoZSBiaXRzIGluIHRoZSBBRFRTIHZhcmlhYmxlIGhlYWRlciAqLwotICAgIGFkdHNfaGVhZGVyID0gZ2V0Yml0cygKLSAgICAgICAgICAgICAgICAgICAgICBMRU5HVEhfVkFSSUFCTEVfSEVBREVSLAotICAgICAgICAgICAgICAgICAgICAgICYocFZhcnMtPmlucHV0U3RyZWFtKSk7Ci0gICAgLyoKLSAgICAgKiBjb3B5cmlnaHRfaWRlbnRpZmljYXRpb24gYml0IGlzIGEgc2luZ2xlIGJpdCBvZiB0aGUgNzItYml0Ci0gICAgICogY29weXJpZ2h0X2lkIGZpZWxkLiAgVGhpcyBjb25zaXN0cyBvZiBhIDgtYml0IGNvcHlyaWdodCBpZGVudGlmaWVyCi0gICAgICogYW5kIGEgNjQtYml0IGNvcHlyaWdodF9udW1iZXIuICA3MiBoZWFkZXJzIG11c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LSAgICAgICAgICAgICAgICAgICAgICAgIFJFVFVSTklORyAoc2FtcGxpbmdfcmF0ZSkKLSAgICBFTkRJRgotCi0gICAgY2hhbm5lbF9jb25maWcgPSBDQUxMIGdldGJpdHMoCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgbmVlZGVkQml0cyA9IExFTl9DSEFOX0NPTkZJRywKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBwSW5wdXRTdHJlYW0gPSBwSW5wdXRTdHJlYW0pOwotICAgICAgICAgICAgICAgICAgICAgICAgTU9ESUZZSU5HIChwSW5wdXRTdHJlYW0pCi0gICAgICAgICAgICAgICAgICAgICAgICBSRVRVUk5JTkcgKGNoYW5uZWxfY29uZmlnKQotCi0gICAgSUYgKGNoYW5uZWxfY29uZmlnID4gMikKLSAgICBUSEVOCi0gICAgICAgIHN0YXR1cyA9IDE7Ci0gICAgRU5ESUYKLQotICAgIElGICgoKGF1ZGlvT2JqZWN0VHlwZSA9PSBNUDRBVURJT19BQUNfTUFJTikgICAgIE9SCi0gICAgICAgIChhdWRpb09iamVjdFR5cGUgPT0gTVA0QVVESU9fQUFDX0xDKSAgICAgICAgT1IKLSAgICAgICAgKGF1ZGlvT2JqZWN0VHlwZSA9PSBNUDRBVURJT19BQUNfU1NSKSAgICAgICBPUgotICAgICAgICAoYXVkaW9PYmplY3RUeXBlID09IE1QNEFVRElPX0xUUCkgICAgICAgICAgIE9SCi0gICAgICAgIChhdWRpb09iamVjdFR5cGUgPT0gTVA0QVVESU9fQUFDX1NDQUxBQkxFKSAgT1IKLSAgICAgICAgKGF1ZGlvT2JqZWN0VHlwZSA9PSBNUDRBVURJT19UV0lOVlEpKSBBTkQgKHN0YXR1cyA9PSAtMSkpCi0gICAgVEhFTgotICAgICAgICBzdGF0dXMgPSBDQUxMIGdldF9HQV9zcGVjaWZpY19jb25maWcoCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgcFZhcnMgPSBwVmFycywKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBjaGFubmVsX2NvbmZpZyA9IGNoYW5uZWxfY29uZmlnLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgIGF1ZGlvT2JqZWN0VHlwZSA9IGF1ZGlvT2JqZWN0VHlwZSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBwSW5wdXRTdHJlYW0gPSBwSW5wdXRTdHJlYW0pOwotICAgICAgICAgICAgICAgICAgICAgIE1PRElGWUlORyAocFZhcnMtPm1jX2luZm8sY2hhbm5lbF9jb25maWcscElucHV0U3RyZWFtKQotICAgICAgICAgICAgICAgICAgICAgIFJFVFVSTklORyAoc3RhdHVzKQotCi0gICAgRU5ESUYKLQotICAgIElGIChhdWRpb09iamVjdFR5cGUgPT0gTVA0QVVESU9fQ0VMUCkKLSAgICBUSEVOCi0gICAgICAgIHN0YXR1cyA9IDE7Ci0gICAgRU5ESUYKLQotICAgIElGIChhdWRpb09iamVjdFR5cGUgPT0gTVA0QVVESU9fSFZYQykKLSAgICBUSEVOCi0gICAgICAgIHN0YXR1cyA9IDE7Ci0gICAgRU5ESUYKLQotICAgIElGIChhdWRpb09iamVjdFR5cGUgPT0gTVA0QVVESU9fVFRTSSkKLSAgICBUSEVOCi0gICAgICAgIHN0YXR1cyA9IDE7Ci0gICAgRU5ESUYKLQotICAgIElGICgoYXVkaW9PYmplY3RUeXBlID09IDEzKSBPUiAoYXVkaW9PYmplY3RUeXBlID09IDE0KSBPUgotICAgICAgICAoYXVkaW9PYmplY3RUeXBlID09IDE1KSBPUiAoYXVkaW9PYmplY3RUeXBlID09IDE2KSkKLSAgICBUSEVOCi0gICAgICAgIHN0YXR1cyA9IDE7Ci0gICAgRU5ESUYKLQotICAgIElGICgoKGF1ZGlvT2JqZWN0VHlwZSA9PSBNUDRBVURJT19FUl9BQUNfTEMpICAgICAgIE9SCi0gICAgICAgICAoYXVkaW9PYmplY3RUeXBlID09IE1QNEFVRElPX0VSX0FBQ19MVFApICAgICAgT1IKLSAgICAgICAgIChhdWRp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gKGF1ZGlvT2JqZWN0VHlwZSA9PSBNUDRBVURJT19FUl9CU0FDKSAgICAgICAgIE9SCi0gICAgICAgIChhdWRpb09iamVjdFR5cGUgPT0gTVA0QVVESU9fRVJfQUFDX0xEKSAgICAgICBPUgotICAgICAgICAoYXVkaW9PYmplY3RUeXBlID09IE1QNEFVRElPX0VSX0NFTFApICAgICAgICAgT1IKLSAgICAgICAgKGF1ZGlvT2JqZWN0VHlwZSA9PSBNUDRBVURJT19FUl9IVlhDKSAgICAgICAgIE9SCi0gICAgICAgIChhdWRpb09iamVjdFR5cGUgPT0gTVA0QVVESU9fRVJfSElMTikgICAgICAgICBPUgotICAgICAgICAoYXVkaW9PYmplY3RUeXBlID09IE1QNEFVRElPX1BBUkFNRVRSSUMpKQotICAgIFRIRU4KLSAgICAgICAgZXBDb25maWcgPSBDQUxMIGdldGJpdHMoCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgbmVlZGVkQml0cyA9IExFTl9FUF9DT05GSUcsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgcElucHV0U3RyZWFtID0gcElucHV0U3RyZWFtKTsKLSAgICAgICAgICAgICAgICAgICAgICBNT0RJRllJTkcgKHBJbnB1dFN0cmVhbSkKLSAgICAgICAgICAgICAgICAgICAgICBSRVRVUk5JTkcgKGVwQ29uZmlnKQotCi0gICAgICAgIElGIChlcENvbmZpZyA9PSAyKQotICAgICAgICBUSEVOCi0gICAgICAgICAgICBzdGF0dXMgPSAxOwotICAgICAgICBFTkRJRgotCi0gICAgRU5ESUYKLQotICAgIFJFVFVSTiBzdGF0dXM7Ci0KLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLQotIFJFU09VUkNFUyBVU0VECi0gICBXaGVuIHRoZSBjb2RlIGlzIHdyaXR0ZW4gZm9yIGEgc3BlY2lmaWMgdGFyZ2V0IHByb2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FNUF9SQVRFLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwSW5wdXRTdHJlYW0pOyovCi0gICAgICAgICAgICBnZXRiaXRzKExFTl9TQU1QX1JBVEUsIHBJbnB1dFN0cmVhbSk7IC8qIGZ1dHVyZSB1c2UgKi8KLSAgICAgICAgfQotCi0gICAgICAgIHN0YXR1cyA9IDE7Ci0gICAgfQotCi0gICAgY2hhbm5lbF9jb25maWcgPSAgZ2V0OV9uX2xlc3NiaXRzKExFTl9DSEFOX0NPTkZJRywKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcElucHV0U3RyZWFtKTsKLQotICAgIGlmICgoY2hhbm5lbF9jb25maWcgPiAyKSAmJiAoIXBWYXJzLT5hYWNDb25maWdVdGlsaXR5RW5hYmxlZCkpCi0gICAgewotICAgICAgICAvKgotICAgICAgICAgKiBBQUMgbGliIGRvZXMgbm90IHN1cHBvcnQgbW9yZSB0aGFuIHR3byBjaGFubmVscwotICAgICAgICAgKiBzaWduYWwgZXJyb3Igd2hlbiBpbiBkZWNvZGVyIG1vZGUKLSAgICAgICAgICogZG8gbm90IHRlc3Qgd2hlbiBpbiB1dGlsaXR5IG1vZGUKLSAgICAgICAgICovCi0gICAgICAgIHN0YXR1cyA9IDE7Ci0KLSAgICB9Ci0KLSAgICBpZiAoYXVkaW9PYmplY3RUeXBlID09IE1QNEFVRElPX1NCUiB8fCBhdWRpb09iamVjdFR5cGUgPT0gTVA0QVVESU9fUFMpCi0gICAgewotICAgICAgICAvKiB0byBkaXNhYmxlIGV4cGxpY2l0IGJhY2t3YXJkIGNvbXBhdGlibGl0eSBjaGVjayAqLwotICAgICAgICBwVmFycy0+bWNfaW5mby5FeHRlbmRlZEF1ZGlvT2JqZWN0VHlwZSA9IE1QNEFVRElPX1NCUjsKLSAgICAgICAgcFZhcnMtPm1jX2luZm8uc2JyUHJlc2VudEZsYWcgPSAxOwotCi0gICAgICAgIGlmIChhdWRpb09iamVjdFR5cGUgPT0gTVA0QVVESU9fUFMpCi0gICAgICAgIHsKLSAgICAgICAgICAgIHBWYXJzLT5tY19pbmZvLnBzUHJlc2VudEZsYWcgPSAxOwotICAgICAgICAgICAgcFZhcnMtPm1jX2luZm8uRXh0ZW5kZWRBdWRpb09iamVjdFR5cGUgPSBNUDRBVURJT19QUzsKLSAgICAgICAgfQotCi0gICAgICAgIGV4dGVuc2lvblNhbXBsaW5nRnJlcXVlbmN5SW5kZXggPSAvKiBleHRlbnNpb25TYW1wbGluZ0ZyZXF1ZW5jeUluZGV4ICovCi0gICAgICAgICAgICBnZXQ5X25fbGVzc2JpdHMoTEVOX1NBTVBfUkFURV9JRFgsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgcElucHV0U3RyZWFtKTsKLSAgICAgICAgaWYgKGV4dGVuc2lvblNhbXBsaW5nRnJlcXVlbmN5SW5kZXggPT0gMHgwZikKLSAgICAgICAgewotICAgICAgICAgICAgLyoKLSAgICAgICAgICAgICAqIHNhbXBsaW5nIHJhdGUgbm90IGxpc3RlZCBpbiBUYWJsZSAxLjYuMiwKLSAgICAgICAgICAgICAqIHRoaXMgcmVsZWFzZSBkb2VzIG5vdCBzdXBwb3J0IHRoaXMKLSAgICAgICAgICAgICAgICAqLwotICAgICAgICAgICAgLypzYW1wbGluZ19yYXRlID0gZ2V0Yml0cyggTEVOX1NBTVBfUkFURSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwSW5wdXRTdHJlYW0pOyovCi0gICAgICAgICAgICBnZXRiaXRzKExFTl9TQU1QX1JBVEUsIHBJbnB1dFN0cmVhbSk7Ci0gICAgICAgIH0KLQotICAgICAgICBhdWRpb09iamVjdFR5cGUgPSAodE1QNEF1ZGlvT2JqZWN0VHlwZSkgZ2V0OV9uX2xlc3NiaXRzKExFTl9PQkpfVFlQRSAsCi0gICAgICAgICAgICAgICAgICAgICAgICAgIHBJbnB1dFN0cmVhbSk7Ci0gICAgfQotCi0KLSAgICBpZiAoKC8qKGF1ZGlvT2JqZWN0VHlwZSA9PSBNUDRBVURJT19BQUNfTUFJTikgICAgIHx8Ki8KLSAgICAgICAgICAgICAgICAoYXVkaW9PYmplY3RUeXBlID09IE1QNEFVRElPX0FBQ19MQykgICAgICAgIHx8Ci0gICAgICAgICAgICAgICAgLyooYXVkaW9PYmplY3RUeXBlID09IE1QNEFVRElPX0FBQ19TU1IpICAgICAgIHx8Ki8KLSAgICAgICAgICAgICAgICAoYXVkaW9PYmplY3RUeXBlID09IE1QNEFVRElPX0xUUCkgICAgICAgICAgIC8qfHwqLwotICAgICAgICAgICAgICAgIC8qKGF1ZGlvT2JqZWN0VHlwZSA9PSBNUDRBVURJT19BQUNfU0NBTEFCTEUpICB8fCovCi0gICAgICAgICAgICAgICAgLyooYXVkaW9PYmplY3RUeXBlID09IE1QNEFVRElPX1RXSU5WUSkqLykgJiYgKHN0YXR1cyA9PSBTVUNDRVNTKSkKLSAgICB7Ci0gICAgICAgIHN0YXR1cyA9IGdldF9HQV9zcGVjaWZpY19jb25maWcocFZhcnMsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcElucHV0U3RyZWFtLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNoYW5uZWxfY29uZmlnLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGF1ZGlvT2JqZWN0VHlwZSk7Ci0KLSAgICAgICAgLyoKLSAgICAgICAgICogIHZlcmlmeSB0aGF0IFByb2dyYW0gY29uZmlnIHJldHVybmVkIGEgc3VwcG9ydGVkIGF1ZGlvIG9iamVjdCB0eXBlCi0gICAgICAgICAqLwotCi0gICAgICAgIGlmICgocFZhcnMtPm1jX2luZm8uYXVkaW9PYmplY3RUeXBlICE9IE1QNEFVRElPX0FBQ19MQykgJiYKLSAgICAgICAgICAgICAgICAocFZhcnMtPm1jX2luZm8uYXVkaW9PYmplY3RUeXBlICE9IE1QNEFVRElPX0xUUCkpCi0gICAgICAgIHsKLSAgICAgICAgICAgIHJldHVybiAxOyAgIC8qIHN0YXR1cyAhPSBTVUNDRVNTIGludmFsaWQgYW90ICovCi0gICAgICAgIH0KLSAgICB9Ci0gICAgZWxzZQotICAgIHsKLSAgICAgICAgcmV0dXJuIDE7ICAgLyogc3RhdHVzICE9IFNVQ0NFU1MgaW52YWxpZCBhb3Qgb3IgaW52YWxpZCBwYXJhbWV0ZXIgKi8KLSAgICB9Ci0KLSAgICAvKgotICAgICAqICBTQlIgdG9vbCBleHBsaWNpdCBzaWduYWxpbmcgKCBiYWNrd2FyZCBjb21wYXRpYmxlICkKLSAgICAgKi8KLSAgICBpZiAoZXh0ZW5zaW9uQXVkaW9PYmplY3RUeXBlICE9IE1QNEFVRElPX1NCUikKLSAgICB7Ci0gICAgICAgIHN5bmNFeHRlbnNpb25UeXBlID0gKFVJbnQpZ2V0MTdfbl9sZXNzYml0cyhMRU5fU1lOQ19FWFRFTlNJT05fVFlQRSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBwSW5wdXRTdHJlYW0pOwotCi0gICAgICAgIGlmIChzeW5jRXh0ZW5zaW9uVHlwZSA9PSAweDJiNykKLSAgICAgICAgewotICAgICAgICAgICAgZXh0ZW5zaW9uQXVkaW9PYmplY3RUeXBlID0gZ2V0OV9uX2xlc3NiaXRzKCAvKiBleHRlbnNpb25BdWRpb09iamVjdFR5cGUgKi8KLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBMRU5fT0JKX1RZUEUsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcElucHV0U3RyZWFtKTsKLQotICAgICAgICAgICAgaWYgKGV4dGVuc2lvbkF1ZGlvT2JqZWN0VHlwZSA9PSBNUDRBVURJT19TQlIpCi0gICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgcFZhcnMtPm1jX2luZm8uc2JyUHJlc2VudEZsYWcgPSBnZXQxYml0cyhwSW5wdXRTdHJlYW0pOyAgLyogc2JyUHJlc2VudEZsYWcgKi8KLSAgICAgICAgICAgICAgICBpZiAocFZhcnMtPm1jX2luZm8uc2JyUHJlc2VudEZsYWcgPT0gMSkKLSAgICAgICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgICAgIGV4dGVuc2lvblNhbXBsaW5nRnJlcXVlbmN5SW5kZXggPQotICAgICAgICAgICAgICAgICAgICAgICAgZ2V0OV9uX2xlc3NiaXRzKCAvKiBleHRlbnNpb25TYW1wbGluZ0ZyZXF1ZW5jeUluZGV4ICovCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgTEVOX1NBTVBfUkFURV9JRFgsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgcElucHV0U3RyZWFtKTsKLSAgICAgICAgICAgICAgICAgICAgaWYgKHBWYXJzLT5hYWNQbHVzRW5hYmxlZCA9PSB0cnVlKQotICAgICAgICAgICAgICAgICAgICB7Ci0jaWZkZWYgQUFDX1BMVVMKLSAgICAgICAgICAgICAgICAgICAgICAgIHBWYXJzLT5tY19pbmZvLnVwc2FtcGxpbmdGYWN0b3IgPSAoc2FtcF9yYXRlX2luZm9bZXh0ZW5zaW9uU2FtcGxpbmdGcmVxdWVuY3lJbmRleF0uc2FtcF9yYXRlID4+IDEpID09Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2FtcF9yYXRlX2luZm9bcFZhcnMtPnByb2dfY29uZmlnLnNhbXBsaW5nX3JhdGVfaWR4XS5zYW1wX3JhdGUgPyAyIDogMTsKLQotICAgICAgICAgICAgICAgICAgICAgICAgaWYgKChJbnQpZXh0ZW5zaW9uU2FtcGxpbmdGcmVxdWVuY3lJbmRleCA9PSBwVmFycy0+cHJvZ19jb25maWcuc2FtcGxpbmdfcmF0ZV9pZHgpCi0gICAgICAgICAgICAgICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgLyoKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKiAgRGlzYWJsZSBTQlIgZGVjb2RpbmcgZm9yIGFueSBzYnItZG93bnNhbXBsZWQgZmlsZSB3aG9zZSBTRiBpcyA+PSAyNCBLSHoKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAocFZhcnMtPnByb2dfY29uZmlnLnNhbXBsaW5nX3JhdGVfaWR4IDwgNikKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBWYXJzLT5hYWNQbHVzRW5hYmxlZCA9IGZhbHNlOwotICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBWYXJzLT5tY19pbmZvLmJEb3duU2FtcGxlZFNiciA9IHRydWU7Ci0gICAgICAgICAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgICAgICAgICBwVmFycy0+cHJvZ19jb25maWcuc2FtcGxpbmdfcmF0ZV9pZHggPSBleHRlbnNpb25TYW1wbGluZ0ZyZXF1ZW5jeUluZGV4OwotCi0jZW5kaWYKLSAgICAgICAgICAgICAgICAgICAgfQotCi0gICAgICAgICAgICAgICAgICAgIGlmIChleHRlbnNpb25TYW1wbGluZ0ZyZXF1ZW5jeUluZGV4ID09IDB4MGYpCi0gICAgICAgICAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAgICAgICAgIC8qCi0gICAgICAgICAgICAgICAgICAgICAgICAgKiBzYW1wbGluZyByYXRlIG5vdCBsaXN0ZWQgaW4gVGFibGUgMS42LjIsCi0gICAgICAgICAgICAgICAgICAgICAgICAgKiB0aGlzIHJlbGVhc2UgZG9lcyBub3Qgc3VwcG9ydCB0aGlzCi0gICAgICAgICAgICAgICAgICAgICAgICAgKi8KLSAgICAgICAgICAgICAgICAgICAgICAgIC8qc2FtcGxpbmdfcmF0ZSA9IGdldGJpdHMoIExFTl9TQU1QX1JBVEUsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcElucHV0U3RyZWFtKTsqLwotICAgICAgICAgICAgICAgICAgICAgICAgZ2V0Yml0cyhMRU5fU0FNUF9SQVRFLCBwSW5wdXRTdHJlYW0pOwotICAgICAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgICAgIC8qIHN5bmNFeHRlbnNpb25UeXBlICovCi0gICAgICAgICAgICAgICAgICAgIHN5bmNFeHRlbnNpb25UeXBlID0gKFVJbnQpZ2V0MTdfbl9sZXNzYml0cyhMRU5fU1lOQ19FWFRFTlNJT05fVFlQRSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwSW5wdXRTdHJlYW0pOwotICAgICAgICAgICAgICAgICAgICBpZiAoc3luY0V4dGVuc2lvblR5cGUgPT0gMHg1NDgpCi0gICAgICAgICAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAgICAgICAgIHBWYXJzLT5tY19pbmZvLnBzUHJlc2VudEZsYWcgPSBnZXQxYml0cyhwSW5wdXRTdHJlYW0pOyAgLyogcHNQcmVzZW50RmxhZyAqLwotICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHBWYXJzLT5tY19pbmZvLnBzUHJlc2VudEZsYWcpCi0gICAgICAgICAgICAgICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgZXh0ZW5zaW9uQXVkaW9PYmplY3RUeXBlID0gTVA0QVVESU9fUFM7Ci0gICAgICAgICAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICAgICAgZWxzZQotICAgICAgICAgICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgICAgICAgICAvKgotICAgICAgICAgICAgICAgICAgICAgICAgKiBSZXdpbmQgYml0c3RyZWFtIHBvaW50ZXIgc28gdGhhdCB0aGUgc3luY0V4dGVuc2lvblR5cGUgcmVhZGluZyBoYXMgbm8KLSAgICAgICAgICAgICAgICAgICAgICAgICogZWZmZWN0IHdoZW4gZGVjb2RpbmcgcmF3IGJpdHN0cmVhbQotICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0gICAgICAgICAgICAgICAgICAgICAgICBwVmFycy0+aW5wdXRTdHJlYW0udXNlZEJpdHMgLT0gTEVOX1NZTkNfRVhURU5TSU9OX1RZUEU7Ci0gICAgICAgICAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgICAgICAgICBwVmFycy0+bWNfaW5mby5FeHRlbmRlZEF1ZGlvT2JqZWN0VHlwZSA9IChlTVA0QXVkaW9PYmplY3RUeXBlKWV4dGVuc2lvbkF1ZGlvT2JqZWN0VHlwZTsKLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICB9Ci0gICAgICAgIH0KLSAgICAgICAgZWxzZSBpZiAoIXN0YXR1cykKLSAgICAgICAgewotICAgICAgICAgICAgLyoKLSAgICAgICAgICAgICAqIFJld2luZCBiaXRzdHJlYW0gcG9pbnRlciBzbyB0aGF0IHRoZSBzeW5jRXh0ZW5zaW9uVHlwZSByZWFkaW5nIGhhcyBubwotICAgICAgICAgICAgICogZWZmZWN0IHdoZW4gZGVjb2RpbmcgcmF3IGJpdHN0cmVhbQotICAgICAgICAgICAgICovCi0gICAgICAgICAgICBwVmFycy0+aW5wdXRTdHJlYW0udXNlZEJpdHMgLT0gTEVOX1NZTkNfRVhURU5TSU9OX1RZUEU7Ci0KLSNpZmRlZiBBQUNfUExVUwotCi0gICAgICAgICAgICAvKgotICAgICAgICAgICAgICogIEZvciBpbXBsaWNpdCBzaWduYWxsaW5nLCBubyBoaW50IHRoYXQgc2JyIG9yIHBzIGlzIHVzZWQsIHNvIHdlIG5lZWQgdG8KLSAgICAgICAgICAgICAqICBjaGVjayB0aGUgc2FtcGxpbmcgZnJlcXVlbmN5IG9mIHRoZSBhYWMgY29udGVudCwgaWYgbGVzc2VyIG9y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nMtPmFhY1BsdXNFbmFibGVkID09IHRydWUpCi0gICAgICAgIHsKLSNpZmRlZiBBQUNfUExVUwotICAgICAgICAgICAgcFZhcnMtPm1jX2luZm8udXBzYW1wbGluZ0ZhY3RvciA9IChzYW1wX3JhdGVfaW5mb1tleHRlbnNpb25TYW1wbGluZ0ZyZXF1ZW5jeUluZGV4XS5zYW1wX3JhdGUgPj4gMSkgPT0KLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzYW1wX3JhdGVfaW5mb1twVmFycy0+cHJvZ19jb25maWcuc2FtcGxpbmdfcmF0ZV9pZHhdLnNhbXBfcmF0ZSA/IDIgOiAxOwotCi0gICAgICAgICAgICBpZiAoKEludClleHRlbnNpb25TYW1wbGluZ0ZyZXF1ZW5jeUluZGV4ID09IHBWYXJzLT5wcm9nX2NvbmZpZy5zYW1wbGluZ19yYXRlX2lkeCkKLSAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAvKgotICAgICAgICAgICAgICAgICAqICBEaXNhYmxlIFNCUiBkZWNvZGluZyBmb3IgYW55IHNici1kb3duc2FtcGxlZCBmaWxlIHdob3NlIFNGIGlzID49IDI0IEtIegotICAgICAgICAgICAgICAgICAqLwotICAgICAgICAgICAgICAgIGlmIChwVmFycy0+cHJvZ19jb25maWcuc2FtcGxpbmdfcmF0ZV9pZHggPCA2KQotICAgICAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAgICAgcFZhcnMtPmFhY1BsdXNFbmFibGVkID0gZmFsc2U7Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgIHBWYXJzLT5tY19pbmZvLmJEb3duU2FtcGxlZFNiciA9IHRydWU7Ci0gICAgICAgICAgICB9Ci0gICAgICAgICAgICBwVmFycy0+cHJvZ19jb25maWcuc2FtcGxpbmdfcmF0ZV9pZHggPSBleHRlbnNpb25TYW1wbGluZ0ZyZXF1ZW5jeUluZGV4OwotCi0KLQotI2VuZGlmCi0KLQotCi0KLSAgICAgICAgfQotCi0gICAgfSAgLyogIGlmICggZXh0ZW5zaW9uQXVkaW9PYmplY3RUeXBlICE9IE1QNEFVRElPX1NCUiApICovCi0KLSAgICAvKgotICAgICAqIFRoZSBmb2xsb3dpbmcgb2JqZWN0IHR5cGVzIGFyZSBub3Qgc3VwcG9ydGVkIGluIHRoaXMgcmVsZWFzZSwKLSAgICAgKiBob3dldmVyLCBrZWVwIHRoZXNlIGludGVyZmFjZXMgZm9yIGZ1dHVyZSBpbXBsZW1lbnRhdGlvbgotICAgICAqLwotCi0gICAgLyoKLSAgICAgKmlmIChhdWRpb09iamVjdFR5cGUgPT0gTVA0QVVESU9fQ0VMUCkKLSAgICAgKnsKLSAgICAgKiAgICBzdGF0dXMgPSAxOwotICAgICAqfQotICAgICAqLwotCi0gICAgLyoKLSAgICAgKmlmIChhdWRpb09iamVjdFR5cGUgPT0gTVA0QVVESU9fSFZYQykKLSAgICAgKnsKLSAgICAgKiAgICBzdGF0dXMgPSAxOwotICAgICAqfQotICAgICAqLwotCi0gICAgLyoKLSAgICAgKmlmIChhdWRpb09iamVjdFR5cGUgPT0gTVA0QVVESU9fVFRTSSkKLSAgICAgKnsKLSAgICAgKiAgICBzdGF0dXMgPSAxOwotICAgICAqfQotICAgICAqLwotCi0gICAgLyoKLSAgICAgKmlmICgoYXVkaW9PYmplY3RUeXBlID09IDEzKSB8fCAoYXVkaW9PYmplY3RUeXBlID09IDE0KSB8fAotICAgICAqICAgKGF1ZGlvT2JqZWN0VHlwZSA9PSAxNSkgfHwgKGF1ZGlvT2JqZWN0VHlwZSA9PSAxNikpCi0gICAgICp7Ci0gICAgICogICAgc3RhdHVzID0gMTsKLSAgICAgKn0KLSAgICAgKi8KLQotICAgIC8qIFRoZSBmb2xsb3dpbmcgb2JqZWN0cyBhcmUgQW1lbmRtZW50IDEgb2JqZWN0cyAqLwotICAgIC8qCi0gICAgICppZiAoKChhdWRpb09iamVjdFR5cGUgPT0gTVA0QVVESU9fRVJfQUFDX0xDKSAgICAgICB8fAotICAgICAqICAgIChhdWRpb09iamVjdFR5cGUgPT0gTVA0QVVESU9fRVJfQUFDX0xUUCkgICAgICB8fAotICAgICAqICAgIChhdWRpb09iamVjdFR5cGUgPT0gTVA0QVVESU9fRVJfQUFDX1NDQUxBQkxFKSB8fAotICAgICAqICAgIChhdWRpb09iamVjdFR5cGUgPT0gTVA0QVVESU9fRVJfVFdJTlZRKSAgICAgICB8fAotICAgICAqICAgIChhdWRpb09iamVjdFR5cGUgPT0gTVA0QVVESU9fRVJfQlNBQykgICAgICAgICB8fAotICAgICAqICAgIChhdWRpb09iamVjdFR5cGUgPT0gTVA0QVVESU9fRVJfQUFDX0xEKSkgJiYgKHN0YXR1cyA9PSAtMSkpCi0gICAgICp7Ci0gICAgICovCi0gICAgLyoKLSAgICAgKiBzaG91bGQgY2FsbCBnZXRfR0Ffc3BlY2lmaWNfY29uZmlnCi0gICAgICogZm9yIHRoaXMgcmVsZWFzZSwgZG8gbm90IHN1cHBvcnQgRXJyb3IgUmVzaWxpZW5jZQotICAgICAqIHRlbXBvcmFyeSBzb2x1dGlvbiBpcyBzZXQgc3RhdHVzIGZsYWcgYW5kIGV4aXQgZGVjb2RpbmcKLSAgICAgKi8KLSAgICAvKiAgICBzdGF0dXMgPSAxOwotICAgICp9Ci0gICAgKi8KLQotICAgIC8qCi0gICAgICppZiAoYXVkaW9PYmplY3RUeXBlID09IE1QNEFVRElPX0VSX0NFTFApCi0gICAgICogewotICAgICAqICAgIHN0YXR1cyA9IDE7Ci0gICAgICp9Ci0gICAgICovCi0KLSAgICAvKgotICAgICAqaWYgKGF1ZGlvT2JqZWN0VHlwZSA9PSBNUDRBVURJT19FUl9IVlhDKQotICAgICAqewotICAgICAqICAgIHN0YXR1cyA9IDE7Ci0gICAgICp9Ci0gICAgICovCi0KLSAgICAvKgotICAgICAqaWYgKChhdWRpb09iamVjdFR5cGUgPT0gTVA0QVVESU9fRVJfSElMTikgfHwKLSAgICAgKiAgICAoYXVkaW9PYmplY3RUeXBlID09IE1QNEFVRElPX1BBUkFNRVRSSUMpKQotICAgICAqewotICAgICAqICAgIHN0YXR1cyA9IDE7Ci0gICAgICp9Ci0gICAgICovCi0KLSAgICAvKgotICAgICAqaWYgKChhdWRpb09iamVjdFR5cGUgPT0gTVA0QVVESU9fRVJfQUFDX0xDKSAgICAgICB8fAotICAgICAqICAgIChhdWRpb09iamVjdFR5cGUgPT0gTVA0QVVESU9fRVJfQUFDX0xUUCkgICAgICB8fAotICAgICAqICAgIChhdWRpb09iamVjdFR5cGUgPT0gTVA0QVVESU9fRVJfQUFDX1NDQUxBQkxFKSB8fAotICAgICAqICAgIChhdWRpb09iamVjdFR5cGUgPT0gTVA0QVVESU9fRVJfVFdJTlZRKSAgICAgICB8fAotICAgICAqICAgIChhdWRpb09iamVjdFR5cGUgPT0gTVA0QVVESU9fRVJfQlNBQykgICAgICAgICB8fAotICAgICAqICAgIChhdWRpb09iamVjdFR5cGUgPT0gTVA0QVVESU9fRVJfQUFDX0xEKSAgICAgICB8fAotICAgICAqICAgIChhdWRpb09iamVjdFR5cGUgPT0gTVA0QVVESU9fRVJfQ0VMUCkgICAgICAgICB8fAotICAgICAqICAgIChhdWRpb09iamVjdFR5cGUgPT0gTVA0QVVESU9fRVJfSFZYQykgICAgICAgICB8fAotICAgICAqICAgIChhdWRpb09iamVjdFR5cGUgPT0gTVA0QVVESU9fRVJfSElMTikgICAgICAgICB8fAotICAgICAqICAgIChhdWRpb09iamVjdFR5cGUgPT0gTVA0QVVESU9fUEFSQU1FVFJJQykpCi0gICAgICp7Ci0gICAgICovCi0gICAgLyogZXJyb3IgcHJvdGVjdGlvbiBjb25maWcgKi8KLSAgICAvKgotICAgICAqICAgICBlcENvbmZpZyA9Ci0gICAgICogICAgICAgZ2V0Yml0cygKLSAgICAgKiAgICAgICAgICAgTEVOX0VQX0NPTkZJRywKLSAgICAgKiAgICAgICAgICAgcElucHV0U3RyZWFtKTsKLSAgICAgKgotICAgICAqIC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ml0cwotICAgICAgICAgICAgICB3aGVuIG9ubHkgMSBiaXQgaXMgcmVhZC4KLQotIFdobzogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgRGF0ZToKLSBEZXNjcmlwdGlvbjoKLQotLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tCi0gSU5QVVQgQU5EIE9VVFBVVCBERUZJTklUSU9OUwotCi0gSW5wdXRzOgotICAgICAgICBwVmFycyAgID0gcG9pbnRlciB0byB0aGUgc3RydWN0dXJlIHRoYXQgaG9sZHMgYWxsIGluZm9ybWF0aW9uIGZvcgotICAgICAgICAgICAgICAgICAgdGhpcyBpbnN0YW5jZSBvZiB0aGUgbGlicmFyeS4gcFZhcnMtPnByb2dfY29uZmlnCi0gICAgICAgICAgICAgICAgICBwVmFycy0+bWNfaW5mbywgcFZhcnMtPnBXaW5TZXFJbmZvLCBwVmFycy0+U0ZCV2lkdGgxMjgKLSAgICAgICAgICAgICAgICAgIGFyZSBuZWVkZWQgZm9yIGNhbGxpbmcgc2V0X21jX2luZm8uCi0gICAgICAgICAgICAgICAgICBEYXRhIHR5cGUgcG9pbnRlciB0byB0RGVjX0ludF9GaWxlCi0KLSAgICAgICAgY2hhbm5lbF9jb25maWcgPSB2YXJpYWJsZSB0aGF0IGluZGljYXRlcyB0aGUgY2hhbm5lbCBjb25maWd1cmF0aW9uCi0gICAgICAgICAgICAgICAgICAgICAgICAgaW5mb3JtYXRpb24sIGluIHRoaXMgZGVjb2RlciBsaWJyYXJ5LCBvbmx5IHZhbHVlcwotICAgICAgICAgICAgICAgICAgICAgICAgIDAsIDEsIGFuZCAyIGFyZSBhbGxvd2VkLgotICAgICAgICAgICAgICAgICAgICAgICAgIERhdGEgdHlwZSBVSW50Ci0KLSAgICAgICAgYXVkaW9PYmplY3RUeXBlID0gdmFyaWFibGUgdGhhdCBpbmRpY2F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xMCAgICAgNi4yLjEgQXVkaW9TcGVjaWZpY0luZm8KLSBBbWVuZG1lbnQgIHA3OCAgICAgOC4yIERlY29kZXIgY29uZmlndXJhdGlvbiAoR0FTcGVjaWZpY0NvbmZpZykKLQotICgyKSBBQUMgRGVjb2RlclNwZWNpZmljSW5mbyBJbmZvcm1hdGlvbgotICAgUGFja2V0VmlkZW8gZGVzY3JpcHRpb25zIC0gU2FuIERpZWdvCi0KLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLQotIFBTRVVETy1DT0RFCi0KLSAgICBmcmFtZUxlbkZsYWcgPSBDQUxMIGdldGJpdHMoCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgbmVlZGVkQml0cyA9IExFTl9GUkFNRV9MRU5fRkxBRywKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBwSW5wdXRTdHJlYW0gPSBwSW5wdXRTdHJlYW0pOwotICAgICAgICAgICAgICAgICAgICAgICAgTU9ESUZZSU5HIChwSW5wdXRTdHJlYW0pCi0gICAgICAgICAgICAgICAgICAgICAgICBSRVRVUk5JTkcgKGZyYW1lTGVuRmxhZykKLQotICAgIGRlcGVuZHNPbkNvcmVDb2RlciA9IENBTEwgZ2V0Yml0cygKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBuZWVkZWRCaXRzID0gTEVOX0RFUEVORF9PTl9DT1JFLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBJbnB1dFN0cmVhbSA9IHBJbnB1dFN0cmVhbSk7Ci0gICAgICAgICAgICAgICAgICAgICAgICBNT0RJRllJTkcgKHBJbnB1dFN0cmVhbSkKLSAgICAgICAgICAgICAgICAgICAgICAgIFJFVFVSTklORyAoZGVwZW5kc09uQ29yZUNvZGVyKQotCi0gICAgSUYgKGRlcGVuZHNPbkNvcmVDb2RlciAhPSBGQUxTRSkKLSAgICBUSEVOCi0gICAgICAgIGNvcmVDb2RlckRlbGF5ID0gQ0FMTCBnZXRiaXRzKAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBuZWVkZWRCaXRzID0gTEVOX0NPUkVfREVMQVksCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBJbnB1dFN0cmVhbSA9IHBJbnB1dFN0cmVhbSk7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgTU9ESUZZSU5HIChwSW5wdXRTdHJlYW0pCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgUkVUVVJOSU5HIChjb3JlQ29kZXJEZWxheSkKLSAgICBFTkRJRgotCi0gICAgZXh0RmxhZyA9IENBTEwgZ2V0Yml0cygKLSAgICAgICAgICAgICAgICAgICAgICBuZWVkZWRCaXRzID0gTEVOX0VYVF9GTEFHLAotICAgICAgICAgICAgICAgICAgICAgIHBJbnB1dFN0cmVhbSA9IHBJbnB1dFN0cmVhbSk7Ci0gICAgICAgICAgICAgICAgICAgTU9ESUZZSU5HIChwSW5wdXRTdHJlYW0pCi0gICAgICAgICAgICAgICAgICAgUkVUVVJOSU5HIChleHRGbGFnKQotCi0gICAgSUYgKGNoYW5uZWxfY29uZmlnID09IDApCi0gICAgVEhFTgotICAgICAgICBzdGF0dXMgPSBDQUxMIGdldF9wcm9nX2NvbmZpZygKLSAgICAgICAgICAgICAgICAgICAgICAgIHBWYXJzID0gcFZhcnMsCi0gICAgICAgICAgICAgICAgICAgICAgICBwU2NyYXRjaFBDRSA9ICZwVmFycy0+c2NyYXRjaF9wcm9nX2NvbmZpZyk7Ci0gICAgICAgICAgICAgICAgICAgTU9ESUZZSU5HIChwVmFycywgcFNjcmF0Y2hQQ0UpCi0gICAgICAgICAgICAgICAgICAgUkVUVVJOSU5HIChzdGF0dXMpCi0KLSAgICBFTFNFCi0gICAgICAgIGNoYW5uZWxfY29uZmlnLS07Ci0gICAgICAgIHBWYXJzLT5wcm9nX2NvbmZpZy5mcm9udC5lbGVfaXNfY3BlWzBdID0gY2hhbm5lbF9jb25maWc7Ci0gICAgICAgIHBWYXJzLT5wcm9nX2NvbmZpZy5mcm9udC5lbGVfdGFnWzBdID0gMDsKLQotICAgICAgICBzdGF0dXMgPSBDQUxMIHNldF9tY19pbmZvKAotICAgICAgICAgICAgICAgICAgICAgICAgcE1DX0luZm8gPSAgJihwVmFycy0+bWNfaW5mbyksCi0gICAgICAgICAgICAgICAgICAgICAgICBhdWRpb09iamVjdFR5cGUgPSBhdWRpb09iamVjdFR5cGUsCi0gICAgICAgICAgICAgICAgICAgICAgICBzYW1wbGluZ19yYXRlX2lkeCA9IHBWYXJzLT5wcm9nX2NvbmZpZy5zYW1wbGluZ19yYXRlX2lkeCwKLSAgICAgICAgICAgICAgICAgICAgICAgIHRhZyA9IHBWYXJzLT5wcm9nX2NvbmZpZy5mcm9udC5lbGVfdGFnWzBdLAotICAgICAgICAgICAgICAgICAgICAgICAgaXNfY3BlID0gcFZhcnMtPnByb2dfY29uZmlnLmZyb250LmVsZV9pc19jcGVbMF0sCi0gICAgICAgICAgICAgICAgICAgICAgICBwV2luU2VxSW5mbyA9IHBWYXJzLT5wV2luU2VxSW5mbywKLSAgICAgICAgICAgICAgICAgICAgICAgIHNmYndpZHRoMTI4ID0gcFZhcnMtPlNGQldpZHRoMTI4KTsKLSAgICAgICAgICAgICAgICAgICAgTU9ESUZZSU5HIChwTUNfSW5mbywgcFdpblNlcUluZm8sIHNmYndpZHRoMTI4KQotICAgICAgICAgICAgICAgICAgICBSRVRVUk5JTkcgKFNVQ0NFU1MpCi0gICAgRU5ESUYKLQotICAgIElGICgoYXVkaW9PYmplY3RUeXBlID09IE1QNEFVRElPX0FBQ19TQ0FMQUJMRSkgT1IKLSAgICAgICAgKGF1ZGlvT2JqZWN0VHlwZSA9PSBNUDRBVURJT19FUl9BQUNfU0NBTEFCTEUpKQotICAgIFRIRU4KLSAgICAgICAgbGF5ZXJfbnVtID0gQ0FMTCBnZXRiaXRzKAotICAgICAgICAgICAgICAgICAgICAgICAgICAgIG5lZWRlZEJpdHMgPSBMRU5fTEFZRVJfTlVNLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBJbnB1dFN0cmVhbSA9IHBJbnB1dFN0cmVhbSk7Ci0gICAgICAgICAgICAgICAgICAgICAgICBNT0RJRllJTkcgKHBJbnB1dFN0cmVhbSkKLSAgICAgICAgICAgICAgICAgICAgICAgIFJFVFVSTklORyAobGF5ZXJfbnVtKQotCi0gICAgICAgIHN0YXR1cyA9IDE7Ci0gICAgRU5ESUYKLQotICAgIElGIChleHRGbGFnICE9IEZBTFNFKQotICAgIFRIRU4KLSAgICAgICAgIElGIChhdWRpb09iamVjdFR5cGUgPT0gTVA0QVVESU9fRVJfQlNBQykKLSAgICAgICAgIFRIRU4KLSAgICAgICAgICAgICAgbnVtT2ZTdWJGcmFtZSA9IENBTEwgZ2V0Yml0cygKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBuZWVkZWRCaXRzID0gTEVOX1NVQl9GUkFNRSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwSW5wdXRTdHJlYW0gPSBwSW5wdXRTdHJlYW0pOwotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBNT0RJRllJTkcgKHBJbnB1dFN0cmVhbSkKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgUkVUVVJOSU5HIChudW1PZlN1YkZyYW1lKQotCi0gICAgICAgICAgICAgIGxheWVyX2xlbiA9IENBTEwgZ2V0Yml0cygKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbmVlZGVkQml0cyA9IExFTl9MQVlFUl9MRU4sCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBJbnB1dFN0cmVhbSA9IHBJbnB1dFN0cmVhbSk7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTU9ESUZZSU5HIChwSW5wdXRTdHJlYW0pCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgUkVUVVJOSU5HIChsYXllcl9sZW4pCi0KLSAgICAgICAgIEVORElGCi0KLSAgICAgICAgIElGICgoKGF1ZGlvT2JqZWN0VHlwZSA+IDE2KSBBTkQgKGF1ZGlvT2JqZWN0VHlwZSA8IDIyKSkgT1IKLSAgICAgICAgICAgICAoYXVkaW9PYmplY3RUeXBlID09IDIzKSkKLSAgICAgICAgIFRIRU4KLSAgICAgICAgICAgICBhYWNTZWN0aW9uRGF0YVJlc2lsaWVuY2VGbGFnID0KLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBDQUxMIGdldGJpdHMoCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBuZWVkZWRCaXRzID0gTEVOX1NFQ1RfUkVTX0ZMQUcsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwSW5wdXRTdHJlYW0gPSBwSW5wdXRTdHJlYW0pOwotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBNT0RJRllJTkcgKHBJbnB1dFN0cmVhbSkKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgUkVUVVJOSU5HIChhYWNTZWN0aW9uRGF0YVJlc2lsaWVuY2VGbGFnKQotCi0gICAgICAgICAgICAgYWFjU2NhbGVmYWN0b3JEYXRhUmVzaWxpZW5jZUZsYWcgPQotICAgICAgICAgICAgICAgICAgICAgICAgICAgIENBTEwgZ2V0Yml0cygKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG5lZWRlZEJpdHMgPSBMRU5fU0ZCX1JFU19GTEFHLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcElucHV0U3RyZWFtID0gcElucHV0U3RyZWFtKTsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTU9ESUZZSU5HIChwSW5wdXRTdHJlYW0pCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFJFVFVSTklORyAoYWFjU2NhbGVmYW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CA3Ci0gICAgICogZXh0ZW5zaW9uIGZsYWcgPT0gMSBvYmplY3RzID0gMTcsIDE5LCAyMCwgMjEsIDIyLCAyMwotICAgICAqLwotICAgIGV4dEZsYWcgPSBnZXQxYml0cyhwSW5wdXRTdHJlYW0pOyAgICAgICAvKiAgTEVOX0VYVF9GTEFHLCovCi0KLQotICAgIC8qIEZvcmNlIGNoZWNrcyBmb3IgaW1wbGljaXQgY2hhbm5lbCBjb25maWd1cmF0aW9uICovCi0gICAgcFZhcnMtPm1jX2luZm8uaW1wbGljaXRfY2hhbm5lbGluZyA9IDE7Ci0KLSAgICBpZiAoc3RhdHVzID09IFNVQ0NFU1MpCi0gICAgewotCi0gICAgICAgIGlmIChjaGFubmVsX2NvbmZpZyA9PSAwKQotICAgICAgICB7Ci0gICAgICAgICAgICBzdGF0dXMgPSBnZXRfcHJvZ19jb25maWcocFZhcnMsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJnBWYXJzLT5zY3JhdGNoLnNjcmF0Y2hfcHJvZ19jb25maWcpOwotCi0gICAgICAgICAgICBpZiAoc3RhdHVzICE9IFNVQ0NFU1MpCi0gICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgcFZhcnMtPnByb2dfY29uZmlnLmZyb250LmVsZV9pc19jcGVbMF0gPSAwOyAvKiBkZWZhdWx0IHRvIG1vbm8gICovCi0gICAgICAgICAgICAgICAgcFZhcnMtPm1jX2luZm8ubmNoID0gMTsKLSAgICAgICAgICAgICAgICBwVmFycy0+cHJvZ19jb25maWcuZnJvbnQuZWxlX3RhZ1swXSA9IDA7Ci0KLSAgICAgICAgICAgICAgICBzdGF0dXMgPSBTVUNDRVNTOwotICAgICAgICAgICAgfQotICAgICAgICB9Ci0gICAgICAgIGVsc2UKLSAgICAgICAgewotICAgICAgICAgICAgLyoKLSAgICAgICAgICAgICAqIGR1bW15IHRhZyA9IDAgYW5kCi0gICAgICAgICAgICAgKiBzZXQgdXAgZGVjb2RpbmcgY29uZmlndXJhdGlvbnMKLSAgICAgICAgICAgICAqLwotICAgICAgICAgICAgY2hhbm5lbF9jb25maWctLTsKLSAgICAgICAgICAgIHBWYXJzLT5wcm9nX2NvbmZpZy5mcm9udC5lbGVfaXNfY3BlWzBdID0gY2hhbm5lbF9jb25maWc7Ci0gICAgICAgICAgICBwVmFycy0+cHJvZ19jb25maWcuZnJvbnQuZWxlX3RhZ1swXSA9IDA7Ci0KLSAgICAgICAgICAgIHN0YXR1cyA9Ci0gICAgICAgICAgICAgICAgc2V0X21jX2luZm8oCi0gICAgICAgICAgICAgICAgICAgICYocFZhcnMtPm1jX2luZm8pLAotICAgICAgICAgICAgICAgICAgICBhdWRpb09iamVjdFR5cGUsIC8qIHByZXZpb3VzbHkgcHJvZmlsZSAqLwotICAgICAgICAgICAgICAgICAgICBwVmFycy0+cHJvZ19jb25maWcuc2FtcGxpbmdfcmF0ZV9pZHgsCi0gICAgICAgICAgICAgICAgICAgIHBWYXJzLT5wcm9nX2NvbmZpZy5mcm9udC5lbGVfdGFnWzBdLAotICAgICAgICAgICAgICAgICAgICBwVmFycy0+cHJvZ19jb25maWcuZnJvbnQuZWxlX2lzX2NwZVswXSwKLSAgICAgICAgICAgICAgICAgICAgcFZhcnMtPndpbm1hcCwgLypwVmFycy0+cFdpblNlcUluZm8sKi8KLSAgICAgICAgICAgICAgICAgICAgcFZhcnMtPlNGQldpZHRoMTI4KTsKLQotICAgICAgICB9IC8qIGlmIChjaGFubmVsX2NvbmZpZykgKi8KLQotICAgIH0gLyogaWYoc3RhdHVzKSAqLwotCi0gICAgLyoKLSAgICAgKiBUaGlzIGxheWVyX251bSBpcyBub3QgZm91bmQgaW4gSVNPL0lFQyBzcGVjcywKLSAgICAgKiBidXQgaXQgaXMgZGVmaW5lZCBpbiBTYW4gRGllZ28gc3BlYyBmb3Igc2NhbGFibGUgYml0c3RyZWFtCi0gICAgICovCi0gICAgaWYgKChhdWRpb09iamVjdFR5cGUgPT0gTVA0QVVESU9fQUFDX1NDQUxBQkxFKSB8fAotICAgICAgICAgICAgKGF1ZGlvT2JqZWN0VHlwZSA9PSBNUDRBVURJT19FUl9BQUNfU0NBTEFCTEUpKQotICAgIHsKLSAgICAgICAgLypsYXllcl9udW0gPQotICAgICAgICAgKiAgICBnZXRiaXRzKAotICAgICAgICAgKiAgICAgICAgTEVOX0xBWUVSX05VTSwKLSAgICAgICAgICogICAgICAgIHBJbnB1dFN0cmVhbSk7Ci0gICAgICAgICAqLwotCi0gICAgICAgIHN0YXR1cyA9IDE7IC8qIGZvciB0aGlzIHJlbGVhc2Ugb25seSAqLwotICAgIH0KLQotICAgIGlmIChleHRGbGFnKQotICAgIHsKLSAgICAgICAgLyoKLSAgICAgICAgICogY3VycmVudGx5IGRvIG5vdCBpbXBsZW1lbnQgdGhlc2UgZnVuY3Rpb25hbGl0aWVzCi0gICAgICAgICAqIGRlZmluZWQgaW4gQW1lbmRtZW50IDEKLSAgICAgICAgICoga2VlcCBpdCBoZXJlIGZvciBmdXR1cmUgcmVsZWFzZQotICAgICAgICAgKi8KLSAgICAgICAgaWYgKGF1ZGlvT2JqZWN0VHlwZSA9PSBNUDRBVURJT19FUl9CU0FDKQotICAgICAgICB7Ci0gICAgICAgICAgICBzdGF0dXMgPSAxOyAgICAgLyogTk9UIFNVUFBPUlRFRCAqLwotICAgICAgICAgICAgLyoKLSAgICAgICAgICAgIG51bU9mU3ViRnJhbWUgPSBnZXRiaXRzKCBMRU5fU1VCX0ZSQU1FLCBwSW5wdXRTdHJlYW0pOwotCi0gICAgICAgICAgICBsYXllcl9sZW4gPSBnZXRiaXRzKCBMRU5fTEFZRVJfTEVOLCBwSW5wdXRTdHJlYW0pOwotICAgICAgICAgICAgKi8KLSAgICAgICAgfQotCi0gICAgICAgIC8qCi0gICAgICAgICAqIFRoZSBmb2xsb3dpbmcgY29kZSBpcyBlcXVpdmFsZW50IHRvCi0gICAgICAgICAqIGlmICgoYXVkaW9PYmplY3RUeXBlID09IDE3KSB8fCAoYXVkaW9PYmplY3RUeXBlID09IDE4KSB8fAotICAgICAgICAgKiAgICAgKGF1ZGlvT2JqZWN0VHlwZSA9PSAxOSkgfHwgKGF1ZGlvT2JqZWN0VHlwZSA9PSAyMCkgfHwKLSAgICAgICAgICogICAgIChhdWRpb09iamVjdFR5cGUgPT0gMjEpIHx8IChhdWRpb09iamVjdFR5cGUgPT0gMjMpKQotICAgICAgICAgKi8KLQotICAgICAgICBpZiAoKChhdWRpb09iamVjdFR5cGUgPiAxNikgJiYgKGF1ZGlvT2JqZWN0VHlwZSA8IDIyKSkgfHwKLSAgICAgICAgICAgICAgICAoYXVkaW9PYmplY3RUeXBlID09IDIzKSkKLSAgICAgICAgewotICAgICAgICAgICAgc3RhdHVzID0gMTsgICAgIC8qIE5PVCBTVVBQT1JURUQgKi8KLSAgICAgICAgICAgIC8qCi0gICAgICAgICAgICBhYWNTZWN0aW9uRGF0YVJlc2lsaWVuY2VGbGFnID0gZ2V0Yml0cyggTEVOX1NFQ1RfUkVTX0ZMQUcsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcElucHV0U3RyZWFtKTsKLQotICAgICAgICAgICAgYWFjU2NhbGVmYWN0b3JEYXRhUmVzaWxpZW5jZUZsYWcgPSBnZXRiaXRzKCBMRU5fU0NGX1JFU19GTEFHLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwSW5wdXRTdHJlYW0pOwotCi0gICAgICAgICAgICBhYWNTcGVjdHJhbERhdGFSZXNpbGllbmNlRmxhZyA9IGdldGJpdHMoIExFTl9TUEVDX1JFU19GTEFHLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwSW5wdXRTdHJlYW0pOwotICAgICAgICAgICAgKi8KLSAgICAgICAgfQotICAgICAgICAvKgotICAgICAgICAgKiB0aGlzIGZsYWcgaXMgdGJkIGluIHZlcnNpb24gMyB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gICAgICAgICAgIHBJbnB1dFN0cmVhbSA9IHBJbnB1dFN0cmVhbSkKLSAgICAgICAgTU9ESUZZSU5HKHBJbnB1dFN0cmVhbSkKLSAgICAgICAgUkVUVVJOSU5HKGxvY2FsX21heF9zZmIgPSByZXR1cm5WYWx1ZSkKLQotICAgICAgICBDQUxMIGdldGdyb3VwKAotICAgICAgICAgICAgZ3JvdXAgPSBncm91cCwKLSAgICAgICAgICAgIHBJbnB1dFN0cmVhbSA9IHBJbnB1dFN0cmVhbSkKLSAgICAgICAgTU9ESUZZSU5HKGdyb3VwKQotICAgICAgICBNT0RJRllJTkcocElucHV0U3RyZWFtKQotICAgICAgICBSRVRVUk5JTkcobm90aGluZykKLQotCi0gICAgRUxTRQotCi0gICAgICAgIGdyb3VwWzBdID0gMTsKLQotICAgICAgICBDQUxMIGdldGJpdHMoCi0gICAgICAgICAgICBuZWVkZWRCaXRzID0gTEVOX01BWF9TRkJMICsgTEVOX1BSRURJQ1RPUl9EQVRBX1BSRVNFTlQsCi0gICAgICAgICAgICBwSW5wdXRTdHJlYW0gPSBwSW5wdXRTdHJlYW0pCi0gICAgICAgIE1PRElGWUlORyhwSW5wdXRTdHJlYW0pCi0gICAgICAgIFJFVFVSTklORyh0ZW1wID0gcmV0dXJuVmFsdWUpCi0KLSAgICAgICAgcHJlZGljdG9yX2RhdGFfcHJlc2VudCA9Ci0gICAgICAgICAgICAoQm9vbCkgZ2V0Yml0cygKLSAgICAgICAgICAgICAgICBMRU5fQk9PTEVBTiwKLSAgICAgICAgICAgICAgICBwSW5wdXRTdHJlYW0pOwotCi0gICAgICAgIGxvY2FsX21heF9zZmIgPSAoSW50KSh0ZW1wID4+IExFTl9QUkVESUNUT1JfREFUQV9QUkVTRU5UKTsKLQotICAgICAgICBwcmVkaWN0b3JfZGF0YV9wcmVzZW50ID0KLSAgICAgICAgICAgIChCb29sKSAodGVtcCAmICgoMHgxIDw8IExFTl9QUkVESUNUT1JfREFUQV9QUkVTRU5UKS0xKSk7Ci0KLSAgICAgICAgSUYgKGxvY2FsX21heF9zZmIgPiBhbGxvd2VkX21heF9zZmIpCi0gICAgICAgIFRIRU4KLSAgICAgICAgICAgIHN0YXR1cyA9IDEKLSAgICAgICAgRUxTRUlGIChhdWRpb09iamVjdFR5cGUgPT0gTVA0QVVESU9fTFRQKQotICAgICAgICBUSEVOCi0gICAgICAgICAgICBJRiAocHJlZGljdG9yX2RhdGFfcHJlc2VudCAhPSBGQUxTRSkKLSAgICAgICAgICAgIFRIRU4KLSAgICAgICAgICAgICAgICBDQUxMIGdldGJpdHMoCi0gICAgICAgICAgICAgICAgICAgIG5lZWRlZEJpdHMgPSBMRU5fTFRQX0RBVEFfUFJFU0VOVCwKLSAgICAgICAgICAgICAgICAgICAgcElucHV0U3RyZWFtID0gcElucHV0U3RyZWFtKQotICAgICAgICAgICAgICAgIE1PRElGWUlORyhwSW5wdXRTdHJlYW0pCi0gICAgICAgICAgICAgICAgUkVUVVJOSU5HKGZpcnN0X2x0cF9kYXRhX3ByZXNlbnQgPSByZXR1cm5WYWx1ZSkKLQotICAgICAgICAgICAgICAgIElGIChsdHBfZGF0YV9wcmVzZW50ICE9IEZBTFNFKQotICAgICAgICAgICAgICAgIFRIRU4KLQotICAgICAgICAgICAgICAgICAgICBDQUxMIGx0X2RlY29kZSgKLSAgICAgICAgICAgICAgICAgICAgICAgIHdpbl90eXBlID0gd2luZG93U2VxdWVuY2UsCi0gICAgICAgICAgICAgICAgICAgICAgICBwSW5wdXRTdHJlYW0gID0gcElucHV0U3RyZWFtLAotICAgICAgICAgICAgICAgICAgICAgICAgbWF4X3NmYiA9IGxvY2FsX21heF9zZmIsCi0gICAgICAgICAgICAgICAgICAgICAgICBwTHRfcHJlZCA9IHBGaXJzdExUUFN0YXR1cykKLSAgICAgICAgICAgICAgICAgICAgTU9ESUZZSU5HKHBJbnB1dFN0cmVhbSkKLSAgICAgICAgICAgICAgICAgICAgTU9ESUZZSU5HKHBGaXJzdExUUFN0YXR1cykKLSAgICAgICAgICAgICAgICAgICAgUkVUVVJOSU5HKG5vdGhpbmcpCi0KLSAgICAgICAgICAgICAgICBFTkRJRgotCi0gICAgICAgICAgICAgICAgSUYgKGNvbW1vbl93aW5kb3cgIT0gRkFMU0UpCi0gICAgICAgICAgICAgICAgVEhFTgotICAgICAgICAgICAgICAgICAgICBDQUxMIGdldGJpdHMoCi0gICAgICAgICAgICAgICAgICAgICAgICBuZWVkZWRCaXRzID0gTEVOX0xUUF9EQVRBX1BSRVNFTlQsCi0gICAgICAgICAgICAgICAgICAgICAgICBwSW5wdXRTdHJlYW0gPSBwSW5wdXRTdHJlYW0pCi0gICAgICAgICAgICAgICAgICAgIE1PRElGWUlORyhwSW5wdXRTdHJlYW0pCi0gICAgICAgICAgICAgICAgICAgIFJFVFVSTklORyhzZWNvbmRfbHRwX2RhdGFfcHJlc2VudCA9IHJldHVyblZhbHVlKQotCi0gICAgICAgICAgICAgICAgICAgIElGIChzZWNvbmRfbHRwX2RhdGFfcHJlc2VudCAhPSBGQUxTRSkKLSAgICAgICAgICAgICAgICAgICAgVEhFTgotCi0gICAgICAgICAgICAgICAgICAgICAgICBDQUxMIGx0X2RlY29kZSgKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICB3aW5fdHlwZSA9IHdpbmRvd1NlcXVlbmNlLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBJbnB1dFN0cmVhbSAgPSBwSW5wdXRTdHJlYW0sCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgbWF4X3NmYiA9IGxvY2FsX21heF9zZmIsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgcEx0X3ByZWQgPSBwU2Vjb25kTFRQU3RhdHVzKQotICAgICAgICAgICAgICAgICAgICAgICAgTU9ESUZZSU5HKHBJbnB1dFN0cmVhbSkKLSAgICAgICAgICAgICAgICAgICAgICAgIE1PRElGWUlORyhwU2Vjb25kTFRQU3RhdHVzKQotICAgICAgICAgICAgICAgICAgICAgICAgUkVUVVJOSU5HKG5vdGhpbmcpCi0gICAgICAgICAgICAgICAgICAgIEVORElGCi0gICAgICAgICAgICAgICAgRU5ESUYKLSAgICAgICAgICAgIEVORElGCi0gICAgICAgIEVMU0UKLSAgICAgICAgICAgIElGICAocHJlZGljdG9yX2RhdGFfcHJlc2VudCAhPSBGQUxTRSkKLSAgICAgICAgICAgIFRIRU4KLSAgICAgICAgICAgICAgICBzdGF0dXMgPSAxCi0gICAgICAgICAgICBFTkRJRgotICAgICAgICBFTkQgSUYKLSAgICBFTkRJRgotCi0gICAgcEZpcnN0TFRQU3RhdHVzLT5sdHBfZGF0YV9wcmVzZW50ID0gZmlyc3RfbHRwX2RhdGFfcHJlc2VudDsKLQotICAgIElGIChjb21tb25fd2luZG93ICE9IEZBTFNFKQotICAgIFRIRU4KLSAgICAgICAgcFNlY29uZExUUFN0YXR1cy0+bHRwX2RhdGFfcHJlc2VudCA9IHNlY29uZF9sdHBfZGF0YV9wcmVzZW50OwotICAgIEVORElGCi0KLSAgICBwRnJhbWVJbmZvID0gcF93aW5tYXBbKnBfd25kXTsKLSAgICBJRiAobG9jYWxfbWF4X3NmYiA+IHBGcmFtZUluZm8tPnNmYl9wZXJfZnJhbWUpCi0gICAgVEhFTgotICAgICAgICBzdGF0dXMgPSAxOwotICAgIEVORElGCi0KLSAgICAqKHBfbWF4X3NmYikgPSBsb2NhbF9tYXhfc2ZiOwotCi0gICAgTU9ESUZZKCoocFdpbmRvd1NlcXVlbmNlKSkKLSAgICBNT0RJRlkoKihwV2luU2hhcGUpKQotICAgIE1PRElGWSgqKHBfbWF4X3NmYikpCi0gICAgTU9ESUZZKGdyb3VwW10pCi0gICAgTU9ESUZZKCpwSW5wdXRTdHJlYW0pCi0gICAgTU9ESUZZKCpwRmlyc3RMVFBTdGF0dXMpCi0gICAgTU9ESUZZKCpwU2Vjb25kTFRQU3RhdHVzKQotICAgIFJFVFVSTiAoc3RhdHVzKTsKLQotCi0KLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0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SwKLSAgICBCSVRTICAgICAgICAgICAgICAgICAgICAgICpwSW5wdXRTdHJlYW0sCi0gICAgY29uc3QgQm9vbCAgICAgICAgICAgICAgICAgY29tbW9uX3dpbmRvdywKLSAgICBXSU5ET1dfU0VRVUVOQ0UgICAgICAgICAgICpwV2luZG93U2VxdWVuY2UsCi0gICAgV0lORE9XX1NIQVBFICAgICAgICAgICAgICAqcFdpbmRvd1NoYXBlLAotICAgIEludCAgICAgICAgICAgICAgICAgICAgICAgIGdyb3VwW10sCi0gICAgSW50ICAgICAgICAgICAgICAgICAgICAgICAqcF9tYXhfc2ZiLAotICAgIEZyYW1lSW5mbyAgICAgICAgICAgICAgICAgKnBfd2lubWFwW10sCi0gICAgTFRfUFJFRF9TVEFUVVMgICAgICAgICAgICAqcEZpcnN0TFRQU3RhdHVzLAotICAgIExUX1BSRURfU1RBVFVTICAgICAgICAgICAgKnBTZWNvbmRMVFBTdGF0dXMpCi17Ci0gICAgV0lORE9XX1NFUVVFTkNFICAgICAgIHdpbmRvd1NlcXVlbmNlOwotICAgIFVJbnQgICAgICAgICAgICAgICAgICB0ZW1wOwotICAgIEJvb2wgICAgICAgICAgICAgICAgICBwcmVkaWN0b3JfZGF0YV9wcmVzZW50OwotICAgIFVJbnQgICAgICAgICAgICAgICAgICAgbG9jYWxfbWF4X3NmYjsKLSAgICBVSW50ICAgICAgICAgICAgICAgICAgIGFsbG93ZWRfbWF4X3NmYjsKLSAgICBJbnQgICAgICAgICAgICAgICAgICAgc3RhdHVzID0gU1VDQ0VTUzsKLSAgICBCb29sICAgICAgICAgICAgICAgICAgZmlyc3RfbHRwX2RhdGFfcHJlc2VudCA9IEZBTFNFOwotICAgIEJvb2wgICAgICAgICAgICAgICAgICBzZWNvbmRfbHRwX2RhdGFfcHJlc2VudCA9IEZBTFNFOwotCi0gICAgLyoKLSAgICAgKiBUaGUgZm9sbG93aW5nIHRocmVlIGNhbGxzIHRvIGdldGJpdHMgaGF2ZSBiZWVuIHJlcGxhY2V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gICAgIGxvY2FsX21heF9zZmIgPSAgZ2V0OV9uX2xlc3NiaXRzKExFTl9NQVhfU0ZCUywKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcElucHV0U3RyZWFtKTsKLQotICAgICAgICBnZXRncm91cCgKLSAgICAgICAgICAgIGdyb3VwLAotICAgICAgICAgICAgcElucHV0U3RyZWFtKTsKLQotICAgICAgICBpZiAobG9jYWxfbWF4X3NmYiA+IGFsbG93ZWRfbWF4X3NmYikKLSAgICAgICAgewotICAgICAgICAgICAgc3RhdHVzID0gMTsgIC8qIEVSUk9SIENPREUgLSBuZWVkcyB0byBiZSB1cGRhdGVkICovCi0gICAgICAgIH0KLQotICAgIH0gLyogZW5kIG9mIFRSVUUgb2YgaWYgKHdpbmRvd1NlcXVlbmNlID09IEVJR0hUX1NIT1JUX1NFUVVFTkNFKSAqLwotICAgIGVsc2UKLSAgICB7Ci0gICAgICAgIC8qIFRoZXJlIGlzIG9ubHkgb25lIGdyb3VwIGZvciBsb25nIHdpbmRvd3MuICovCi0gICAgICAgIGdyb3VwWzBdID0gMTsKLQotICAgICAgICAvKgotICAgICAgICAgKiBUaGUgd2luZG93IGlzIGxvbmcsIGdldCB0aGUgbWF4aW11bSBzY2FsZSBmYWN0b3IgYmFuZHMsCi0gICAgICAgICAqIGFuZCBnZXQgbG9uZyB0ZXJtIHByZWRpY3Rpb24gaW5mby4KLSAgICAgICAgICoKLSAgICAgICAgICogUmVmZXJlbmNlIFsxXSBzdGF0ZXMgdGhhdCB0aGUgYXVkaW9PYmplY3RUeXBlIGlzIGZpcnN0IHRlc3RlZCwKLSAgICAgICAgICogdGhlbiB0aGUgcHJlZGljdG9yX2RhdGFfcHJlc2VudCBpcyByZWFkIG9uIGVpdGhlciBicmFuY2ggb2YgdGhlCi0gICAgICAgICAqIGlmIChhdWRpb09iamVjdFR5cGUgPT0gTVA0QVVESU9fTFRQKS4gSW5zdGVhZCwgdGhpcyBjb2RlIGNvbWJpbmVzCi0gICAgICAgICAqIHRoZSB0d28gY2FsbHMgb24gYm90aCBicmFuY2hlcyBpbnRvIG9uZSBiZWZvcmUgdGhlCi0gICAgICAgICAqIGlmLCBhbmQgdGhlbiBpbiB0dXJuIGNvbWJpbmVzIHdpdGggYW5vdGhlciBjYWxsIHRvIGdldGJpdHMsIGFsbAotICAgICAgICAgKiBpbiB0aGUgbmFtZSBvZiBzcGVlZC4KLSAgICAgICAgICoKLSAgICAgICAgICogVGhpcyB3b3VsZCBiZSB0aGUgaW5kaXZpZHVhbCBjYWxscywgd2l0aG91dCBjaGVja2luZyB0aGUgbnVtYmVyCi0gICAgICAgICAqIG9mIHNjYWxlIGZhY3RvciBiYW5kczoKLSAgICAgICAgICoKLSAgICAgICAgICogICBsb2NhbF9tYXhfc2ZiID0KLSAgICAgICAgICogICAgICAoSW50KSBnZXRiaXRzKAotICAgICAgICAgKiAgICAgICAgICBMRU5fTUFYX1NGQkwsCi0gICAgICAgICAqICAgICAgICAgICBwSW5wdXRTdHJlYW0pOwotICAgICAgICAgKgotICAgICAgICAgKiAgaWYgKGF1ZGlvT2JqZWN0VHlwZSA9PSBNUDRBVURJT19MVFApCi0gICAgICAgICAqICB7Ci0gICAgICAgICAqICAgICAgICBwcmVkaWN0b3JfZGF0YV9wcmVzZW50ID0KLSAgICAgICAgICogICAgICAgICAgIChCb29sKSBnZXRiaXRzKAotICAgICAgICAgKiAgICAgICAgICAgICAgTEVOX1BSRURJQ1RPUl9EQVRBX1BSRVNFTlQsCi0gICAgICAgICAqICAgICAgICAgICAgICBwSW5wdXRTdHJlYW0pOwotICAgICAgICAgKgotICAgICAgICAgKiAgICAgLi4uLi4gICAocmVhZCBMVFAgZGF0YSkKLSAgICAgICAgICoKLSAgICAgICAgICogICAgfQotICAgICAgICAgKiAgICBlbHNlCi0gICAgICAgICAqICAgIHsKLSAgICAgICAgICoKLSAgICAgICAgICogICAgICAgIHByZWRpY3Rvcl9kYXRhX3ByZXNlbnQgPQotICAgICAgICAgKiAgICAgICAgICAgKEJvb2wpIGdldGJpdHMoCi0gICAgICAgICAqICAgICAgICAgICAgICBMRU5fUFJFRElDVE9SX0RBVEFfUFJFU0VOVCwKLSAgICAgICAgICogICAgICAgICAgICAgIHBJbnB1dFN0cmVhbSk7Ci0gICAgICAgICAqCi0gICAgICAgICAqICAgICAuLi4uLiAgIChpdHMgYW4gZXJyb3IgZm9yIHRoaXMgbGlicmFyeSkKLSAgICAgICAgICogICAgIH0KLSAgICAgICAgICovCi0gICAgICAgIHRlbXAgPQotICAgICAgICAgICAgZ2V0OV9uX2xlc3NiaXRzKAotICAgICAgICAgICAgICAgIExFTl9NQVhfU0ZCTCArIExFTl9QUkVESUNUT1JfREFUQV9QUkVTRU5ULAotICAgICAgICAgICAgICAgIHBJbnB1dFN0cmVhbSk7Ci0KLSAgICAgICAgbG9jYWxfbWF4X3NmYiA9IChJbnQpKHRlbXAgPj4gTEVOX1BSRURJQ1RPUl9EQVRBX1BSRVNFTlQpOwotCi0gICAgICAgIHByZWRpY3Rvcl9kYXRhX3ByZXNlbnQgPQotICAgICAgICAgICAgKEJvb2wpKHRlbXAgJiAoKDB4MSA8PCBMRU5fUFJFRElDVE9SX0RBVEFfUFJFU0VOVCkgLSAxKSk7Ci0KLSAgICAgICAgaWYgKGxvY2FsX21heF9zZmIgPiBhbGxvd2VkX21heF9zZmIpCi0gICAgICAgIHsKLSAgICAgICAgICAgIHN0YXR1cyA9IDE7ICAvKiBFUlJPUiBDT0RFIC0gbmVlZHMgdG8gYmUgdXBkYXRlZCAqLwotICAgICAgICB9Ci0gICAgICAgIGVsc2UgaWYgKGF1ZGlvT2JqZWN0VHlwZSA9PSBNUDRBVURJT19MVFApCi0gICAgICAgIHsKLSAgICAgICAgICAgIC8qCi0gICAgICAgICAgICAgKiBOb3RlIHRoYXQgdGhlIHByZWRpY3RvciBkYXRhIGJpdCBoYXMgYWxyZWFkeSBiZWVuCi0gICAgICAgICAgICAgKiByZWFkLgotICAgICAgICAgICAgICovCi0KLSAgICAgICAgICAgIC8qCi0gICAgICAgICAgICAgKiBJZiB0aGUgb2JqZWN0IHR5cGUgaXMgTFRQLCB0aGUgcHJlZGljdG9yIGRhdGEgaXMKLSAgICAgICAgICAgICAqIExUUC4gSWYgdGhlIG9iamVjdCB0eXBlIGlzIG5vdCBMVFAsIHRoZSBwcmVkaWN0b3IgZGF0YQotICAgICAgICAgICAgICogaXMgc28gY2FsbGVkICJmcmVxdWVuY3kgcHJlZGljdG9yIGRhdGEiLCB3aGljaCBpcyBub3QKLSAgICAgICAgICAgICAqIHN1cHBvcnRlZCBieSB0aGlzIGltcGxlbWVudGF0aW9uLiBSZWZlciB0byAoMSkKLSAgICAgICAgICAgICAqLwotICAgICAgICAgICAgaWYgKHByZWRpY3Rvcl9kYXRhX3ByZXNlbnQgIT0gRkFMU0UpCi0gICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgZmlyc3RfbHRwX2RhdGFfcHJlc2VudCA9Ci0gICAgICAgICAgICAgICAgICAgIChCb29sKSBnZXQxYml0cygvKiAgICAgICAgICAgICAgICAgICAgICAgIExFTl9MVFBfREFUQV9QUkVTRU5ULCovCi0gICAgICAgICAgICAgICAgICAgICAgICBwSW5wdXRTdHJlYW0pOwotCi0gICAgICAgICAgICAgICAgaWYgKGZpcnN0X2x0cF9kYXRhX3ByZXNlbnQgIT0gRkFMU0UpCi0gICAgICAgICAgICAgICAgewotICAgICAgICAgICAgICAgICAgICBsdF9kZWNvZGUoCi0gICAgICAgICAgICAgICAgICAgICAgICB3aW5kb3dTZXF1ZW5jZSwKLSAgICAgICAgICAgICAgICAgICAgICAgIHBJbnB1dFN0cmVhbSwKLSAgICAgICAgICAgICAgICAgICAgICAgIGxvY2FsX21heF9zZmIsCi0gICAgICAgICAgICAgICAgICAgICAgICBwRmlyc3RMVFBTdGF0dXMpOwotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICBpZiAoY29tbW9uX3dpbmRvdyAhPSBGQUxTRSkKLSAgICAgICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgICAgIHNlY29uZF9sdHBfZGF0YV9wcmVzZW50ID0KLSAgICAgICAgICAgICAgICAgICAgICAgIChCb29sKSBnZXQxYml0cygvKiAgICAgICAgICAgICAgICAgICAgICAgICAgICBMRU5fTFRQX0RBVEFfUFJFU0VOVCwqLwotICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBJbnB1dFN0cmVhbSk7Ci0KLSAgICAgICAgICAgICAgICAgICAgaWYgKHNlY29uZF9sdHBfZGF0YV9wcmVzZW50ICE9IEZBTFNFKQotICAgICAgICAgICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgICAgICAgICBsdF9kZWNvZGUoCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgd2luZG93U2VxdWVuY2UsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgcElucHV0U3RyZWFtLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxvY2FsX21heF9zZmIsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgcFNlY29uZExUUFN0YXR1cyk7Ci0gICAgICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICB9IC8qIGlmIChjb21tb25fd2luZG93ICE9IEZBTFNFKSAqLwotCi0gICAgICAgICAgICB9IC8qIGlmIChwcmVkaWN0b3JfZGF0YV9wcmVzZW50ICE9IEZBTFNFKSAqLwotCi0gICAgICAgIH0gLyogZWxzZSBpZiAoYXVkaW9PYmplY3RUeXBlID09IE1QNEFVRElPX0xUUCkgKi8KLSAgICAgICAgZWxzZQotICAgICAgICB7Ci0gICAgICAgICAgICAvKgotICAgICAgICAgICAgICogTm90ZSB0aGF0IHRoZSBwcmVkaWN0b3IgZGF0YSBiaXQgaGFzIGFscmVhZHkgYmVlbgotICAgICAgICAgICAgICogcmVhZC4KLSAgICAgICAgICAgICAqLwotCi0gICAgICAgICAgICAvKgotICAgICAgICAgICAgICogVGhlIG9iamVjdCB0eXBlIGlzIG5vdCB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gTU9ESUZZSU5HKCBwSW5wdXRTdHJlYW0gKQotICAgIFJFVFVSTklORyggbnVtQ2hhcnMgPSByZXR1cm5WYWx1ZSApCi0KLSAgICBGT1IgKGkgPSBudW1DaGFyczsgaSA+IDA7IGktLSkKLQotICAgICAgICBDQUxMIGdldGJpdHMoCi0gICAgICAgICAgICBuZWVkZWRCaXRzID0gTEVOX0NPTU1FTlRfQllURVMsCi0gICAgICAgICAgICBwSW5wdXRTdHJlYW0gPSBwSW5wdXRTdHJlYW0gKQotICAgICAgICBNT0RJRllJTkcoIHBJbnB1dFN0cmVhbSApCi0gICAgICAgIFJFVFVSTklORyggbm90aGluZyApCi0KLSAgICBFTkRGT1IKLQotICAgIElGIChwVmFycy0+Y3VycmVudF9wcm9ncmFtIDwgMCkKLSAgICBUSEVOCi0gICAgICAgIHBWYXJzLT5jdXJyZW50X3Byb2dyYW0gPSB0YWc7Ci0gICAgRU5ESUYKLQotCi0gICAgSUYgKHRhZyA9PSBwVmFycy0+Y3VycmVudF9wcm9ncmFtKQotICAgIFRIRU4KLQotICAgICAgICBDQUxMIHB2X21lbWNweSgKLSAgICAgICAgICAgIHRvID0gJnBWYXJzLT5wcm9nX2NvbmZpZywKLSAgICAgICAgICAgIGZyb20gPSBwU2NyYXRjaFBDRSwKLSAgICAgICAgICAgIG4gPSBzaXplb2YoUHJvZ0NvbmZpZykpCi0gICAgICAgIE1PRElGWUlORyggcFZhcnMtPnByb2dfY29uZmlnICkKLSAgICAgICAgUkVUVVJOSU5HKCBub3RoaW5nICkKLQotICAgICAgICBDQUxMIHNldF9tY19pbmZvKAotICAgICAgICAgICAgcE1DX0luZm8gPSAmcFZhcnMtPm1jX2luZm8sCi0gICAgICAgICAgICBvYmplY3RUeXBlID0gcFZhcnMtPnByb2dfY29uZmlnLnByb2ZpbGUgKyAxLAotICAgICAgICAgICAgc2FtcGxpbl9yYXRlX2lkeCA9IHBWYXJzLT5wcm9nX2NvbmZpZy5zYW1wbGluZ19yYXRlX2lke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BGQUxTRSkgKi8KLQotICAgIC8qIFJlYWQgcHJlc2VuY2Ugb2Ygc3RlcmVvIG1peCAqLwotICAgIGZsYWcgPQotICAgICAgICBnZXQxYml0cygvKiAgICAgICAgICAgIExFTl9NSVhfUFJFUywqLwotICAgICAgICAgICAgcElucHV0U3RyZWFtKTsKLQotICAgIHBTY3JhdGNoUENFLT5zdGVyZW9fbWl4LnByZXNlbnQgPSBmbGFnOwotCi0gICAgaWYgKGZsYWcgIT0gRkFMU0UpCi0gICAgewotICAgICAgICB0ZW1wID0KLSAgICAgICAgICAgIGdldDlfbl9sZXNzYml0cygKLSAgICAgICAgICAgICAgICBMRU5fVEFHLAotICAgICAgICAgICAgICAgIHBJbnB1dFN0cmVhbSk7Ci0KLSAgICAgICAgcFNjcmF0Y2hQQ0UtPnN0ZXJlb19taXguZWxlX3RhZyA9IHRlbXA7Ci0KLSAgICB9IC8qIGVuZCBpZiAoZmxhZyAhPSBGQUxTRSkgKi8KLQotICAgIC8qIFJlYWQgcHJlc2VuY2Ugb2YgbWF0cml4IG1peCAqLwotICAgIGZsYWcgPQotICAgICAgICBnZXQxYml0cygvKiAgICAgICAgICAgIExFTl9NSVhfUFJFUywqLwotICAgICAgICAgICAgcElucHV0U3RyZWFtKTsKLQotICAgIHBTY3JhdGNoUENFLT5tYXRyaXhfbWl4LnByZXNlbnQgPSBmbGFnOwotCi0gICAgaWYgKGZsYWcgIT0gRkFMU0UpCi0gICAgewotICAgICAgICB0ZW1wID0KLSAgICAgICAgICAgIGdldDlfbl9sZXNzYml0cygKLSAgICAgICAgICAgICAgICBMRU5fTU1JWF9JRFgsCi0gICAgICAgICAgICAgICAgcElucHV0U3RyZWFtKTsKLQotICAgICAgICBwU2NyYXRjaFBDRS0+bWF0cml4X21peC5lbGVfdGFnID0gdGVtcDsKLQotICAgICAgICB0ZW1wID0KLSAgICAgICAgICAgIGdldDFiaXRzKC8qICAgICAgICAgICAgICAgIExFTl9QU1VSX0VOQUIsKi8KLSAgICAgIC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Y2lhbCBwcm9ncmFtIGNvbmZpZ3VyYXRpb24uCi0gICAgICAgICAqLwotICAgICAgICBwdl9tZW1jcHkoCi0gICAgICAgICAgICAmcFZhcnMtPnByb2dfY29uZmlnLAotICAgICAgICAgICAgcFNjcmF0Y2hQQ0UsCi0gICAgICAgICAgICBzaXplb2YoUHJvZ0NvbmZpZykpOwotCi0gICAgICAgIC8qIGVudGVyIGNvbmZpZ3VyYXRpb24gaW50byBNQ19JbmZvIHN0cnVjdHVyZSAqLwotICAgICAgICBzdGF0dXMgPQotICAgICAgICAgICAgc2V0X21jX2luZm8oCi0gICAgICAgICAgICAgICAgJnBWYXJzLT5tY19pbmZvLAotICAgICAgICAgICAgICAgICh0TVA0QXVkaW9PYmplY3RUeXBlKShwVmFycy0+cHJvZ19jb25maWcucHJvZmlsZSArIDEpLAotICAgICAgICAgICAgICAgIHBWYXJzLT5wcm9nX2NvbmZpZy5zYW1wbGluZ19yYXRlX2lkeCwKLSAgICAgICAgICAgICAgICBwVmFycy0+cHJvZ19jb25maWcuZnJvbnQuZWxlX3RhZ1swXSwKLSAgICAgICAgICAgICAgICBwVmFycy0+cHJvZ19jb25maWcuZnJvbnQuZWxlX2lzX2NwZVswXSwKLSAgICAgICAgICAgICAgICBwVmFycy0+d2lubWFwLAotICAgICAgICAgICAgICAgIHBWYXJzLT5TRkJXaWR0aDEyOCk7Ci0KLSAgICB9IC8qIGVuZCBpZiAodGFnID09IHBWYXJzLT5jdXJyZW50X3Byb2dyYW0pICovCi0KLSAgICByZXR1cm4gKHN0YXR1cyk7Ci19Ci0KZGlmZiAtLWdpdCBhL21lZGlhL2xpYnN0YWdlZnJpZ2h0L2NvZGVjcy9hYWNkZWMvZ2V0X3Byb2dfY29uZmlnLmggYi9tZWRpYS9saWJzdGFnZWZyaWdodC9jb2RlY3MvYWFjZGVjL2dldF9wcm9nX2NvbmZpZy5oCmRlbGV0ZWQgZmlsZSBtb2RlIDEwMDY0NAppbmRleCA2NDZiYTQ2Li4wMD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AgICAgIGswX21pbiA9IDE3OwotICAgICAgICAgICAgYnJlYWs7Ci0gICAgICAgIGNhc2UgMjQwMDA6Ci0gICAgICAgICAgICBpbmRleCA9IDI7Ci0gICAgICAgICAgICBrMF9taW4gPSAxNjsKLSAgICAgICAgICAgIGJyZWFrOwotICAgICAgICBjYXNlIDMyMDAwOgotICAgICAgICAgICAgaW5kZXggPSAzOwotICAgICAgICAgICAgazBfbWluID0gMTY7Ci0gICAgICAgICAgICBicmVhazsKLSAgICAgICAgY2FzZSA0NDEwMDoKLSAgICAgICAgICAgIGluZGV4ID0gNDsKLSAgICAgICAgICAgIGswX21pbiA9IDEyOwotICAgICAgICAgICAgYnJlYWs7Ci0gICAgICAgIGNhc2UgNDgwMDA6Ci0gICAgICAgICAgICBpbmRleCA9IDQ7Ci0gICAgICAgICAgICBrMF9taW4gPSAxMTsKLSAgICAgICAgICAgIGJyZWFrOwotICAgICAgICBjYXNlIDY0MDAwOgotICAgICAgICAgICAgaW5kZXggPSA0OwotICAgICAgICAgICAgazBfbWluID0gMTA7Ci0gICAgICAgICAgICBicmVhazsKLSAgICAgICAgY2FzZSA4ODIwMDoKLSAgICAgICAgY2FzZSA5NjAwMDoKLSAgICAgICAgICAgIGluZGV4ID0gNTsKLSAgICAgICAgICAgIGswX21pbiA9IDc7Ci0gICAgICAgICAgICBicmVhazsKLQotICAgICAgICBkZWZhdWx0OgotICAgICAgICAgICAgaW5kZXggPSA2OwotICAgIH0KLSAgICByZXR1cm4gKGswX21pbiArIHZfb2Zmc2V0W2luZGV4XVtzdGFydF9mcmVxXSk7Ci0KLX0KLQotCi0KZGlmZiAtLWdpdCBhL21lZGlhL2xpYnN0YWdlZnJpZ2h0L2NvZGVjcy9hYWNkZWMvZ2V0X3Nicl9zdGFydGZyZXEuaCBiL21lZGlhL2xpYnN0YWdlZnJpZ2h0L2NvZGVjcy9hYWNkZWMvZ2V0X3Nicl9zdGFydGZyZXEuaApkZWxldGVkIGZpbGUgbW9kZSAxMDA2N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ogKi8KLSAgICAgMzQsICAgICAgIC8qIDY0MDAwIEh6ICovCi0gICAgIDQwLCAgICAgICAvKiA0ODAwMCBIeiAqLwotICAgICA0MiwgICAgICAgLyogNDQxMDAgSHogKi8KLSAgICAgNTEsICAgICAgIC8qIDMyMDAwIEh6ICovCi0gICAgIDQ2LCAgICAgICAvKiAyNDAwMCBIeiAqLwotICAgICA0NiwgICAgICAgLyogMjIwNTAgSHogKi8KLSAgICAgNDIsICAgICAgIC8qIDE2MDAwIEh6ICovCi0gICAgIDQyLCAgICAgICAvKiAxMjAwMCBIeiAqLwotICAgICA0MiwgICAgICAgLyogMTEwMjUgSHogKi8KLSAgICAgMzksICAgICAgIC8qIDgwMDAgIEh6ICovCi0gICAgIDAsCi0gICAgIDAsCi0gICAgIDAsCi0gICAgIDAKLSAgICB9OwotCi1jb25zdCBJbnQgdG5zX21heF9iYW5kc190Ymxfc2hvcnRfd25kd1soMTw8TEVOX1NBTVBfSURYKV0gPQotICAgIHs5LCAgICAgICAvKiA5NjAwMCBIeiAqLwotICAgICA5LCAgICAgICAvKiA4ODIwMCBIeiAqLwotICAgICAxMCwgICAgICAgLyogNjQwMDAgSHogKi8KLSAgICAgMTQsICAgICAgIC8qIDQ4MDAwIEh6ICovCi0gICAgIDE0LCAgICAgICAvKiA0NDEwMCBIeiAqLwotICAgICAxNCwgICAgICAgLyogMzIwMDAgSHogKi8KLSAgICAgMTQsICAgICAgIC8qIDI0MDAwIEh6ICovCi0gICAgIDE0LCAgICAgICAvKiAyMjA1MCBIeiAqLwotICAgICAxNCwgICAgICAgLyogMTYwMDAgSHogKi8KLSAgICAgMTQsICAgICAgIC8qIDEyMDAwIEh6ICovCi0gICAgIDE0LCAgICAgICAvKiAxMTAyNSBIeiAqLwotICAgICAxNCwgICAgICAgLyogODAwMCAgSHogKi8KLSAgICAgMCwKLSAgICAgMCwKLSAgICAgMCwKLSAgICAgMAotICAgIH07Ci0KLS8qCi0gKiBGb3IgY29tcGxldGVuZXNzLCBoZXJlIGFyZSB0aGUgdGFibGUgZW50cmllcyBmb3Igb2JqZWN0IHR5cGVzIHRoYXQgbWFrZQotICogdXNlIG9mIFBRRiBmaWx0ZXIgYmFuay4gIFdlIGRvIG5vdCBjdXJyZW50bHkgc3VwcG9ydCB0aGlzOyB0aGVzZSBhcmUKLSAqIGdpdmVuIGhlcmUgb25seSB0byBlYXNlIGZ1dHVyZSBpbXBsZW1lbnRhdGlvbi4KLSAqCi0gKiAgY29uc3QgSW50IHRuc19tYXhfYmFuZHNfdGJsX2xvbmdfd25kd19QUUZbKDE8PExFTl9TQU1QX0lEWCldID0KLSAqICAgICAgICAgezI4LCAgICAgICA7IDk2MDAwCi0gKiAgICAgICAgICAyOCwgICAgICAgOyA4ODIwMAotICogICAgICAgICAgMjcsICAgICAgIDsgNjQwMDAKLSAqICAgICAgICAgIDI2LCAgICAgICA7IDQ4MDAwCi0gKiAgICAgICAgICAyNiwgICAgICAgOyA0NDEwMAotICogICAgICAgICAgMjYsICAgICAgIDsgMzIwMDAKLSAqICAgICAgICAgIDI5LCAgICAgICA7IDI0MDAwCi0gKiAgICAgICAgICAyOSwgICAgICAgOyAyMjA1MAotICogICAgICAgICAgMjMsICAgICAgIDsgMTYwMDAKLSAqICAgICAgICAgIDIzLCAgICAgICA7IDEyMDAwCi0gKiAgICAgICAgICAyMywgICAgICAgOyAxMTAyNQotICogICAgICAgICAgMTksICAgICAgIDsgODAwMAotICogICAgICAgICAgIDAsCi0gKiAgICAgICAgICAgMCwKLSAqICAgICAgICAgICAwLAotICogICAgICAgICAgIDB9OwotICoKLSAqICBjb25zdCBJbnQgdG5zX21heF9iYW5kc190Ymxfc2hvcnRfd25kd19QUUZbKDE8PExFTl9TQU1QX0lEWCldID0KLSAqICAgICAgICAgezcsICAgICAgIDsgOTYwMDAKLSAqICAgICAgICAgIDcsICAgICAgIDsgODgyMDAKLSAqICAgICAgICAgIDcsICAgICAgIDsgNjQwMDAKLSAqICAgICAgICAgIDYsICAgICAgIDsgN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blcl93aW47Ci0KLSAgICBJbnQzMiAqcExwY0NvZWY7Ci0gICAgSW50MzIgKnBTdGFydExwY0NvZWY7Ci0gICAgSW50IHNfbWFzazsKLSAgICBJbnQgbl9tYXNrOwotCi0gICAgSW50IHRuc19iYW5kczsKLSAgICBVSW50IG1heF9vcmRlcjsKLSAgICBJbnQgY29lZl9yZXM7Ci0KLQotICAgIFROU2ZpbHQgKnBGaWx0OwotCi0gICAgaWYgKHduZF9zZXEgIT0gRUlHSFRfU0hPUlRfU0VRVUVOQ0UpCi0gICAgewotICAgICAgICBudW1fZmlsdF9iaXRzICA9IDI7Ci0gICAgICAgIG51bV9vcmRlcl9iaXRzID0gNTsKLSAgICAgICAgbnVtX3N0YXJ0X2JhbmRfYml0cyA9IDY7Ci0KLSAgICAgICAgdG5zX2JhbmRzID0gdG5zX21heF9iYW5kc190YmxfbG9uZ193bmR3W3BNQ19JbmZvLT5zYW1wbGluZ19yYXRlX2lkeF07Ci0KLSAgICAgICAgLyoKLSAgICAgICAgICogIERlZmluaXRpb24gZnJvbSAxNDQ5Ni0zOjE5OTkgZG9jLiBPdXIgZmlyc3QgZW5jb2RlciBmb2xsb3dzIHRoaXMgcnVsZSwKLSAgICAgICAgICogIGxhdGVyIGVuY29kZXJzIGRvbid0Ci0gICAgICAgICAqLwotCi0gICAgICAgIGlmIChwTUNfSW5mby0+c2FtcGxpbmdfcmF0ZV9pZHggPiA0KSAgLyogaWYgKHNhbXBsaW5nX3JhdGUgPD0gMzIwMDAgKi8KLSAgICAgICAgewotICAgICAgICAgICAgbWF4X29yZGVyID0gMjA7Ci0gICAgICAgIH0KLSAgICAgICAgZWxzZQotICAgICAgICB7Ci0gICAgICAgICAgICBtYXhfb3JkZXIgPSAxMjsKLSAgICAgICAgfQotICAgIH0KLSAgICBlbHNlCi0gICAgewotICAgICAgICBudW1fZmlsdF9iaXRzICA9IDE7Ci0gICAgICAgIG51bV9vcmRlcl9iaXRzID0gMzsKLSAgICAgICAgbnVtX3N0YX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FuZCA0IGJpdHMgcmVzcGVjdGl2ZWx5Ci0gICAgICAgICAgICAgKgotICAgICAgICAgICAgICogaWYgY29lZl9yZXMgPSAwLCB0aGUgY29lZmZpY2llbnRzIGhhdmUgYSByYW5nZSBvZgotICAgICAgICAgICAgICoKLSAgICAgICAgICAgICAqICAgICAgICAgICAgICAgICAtNCAgLTMgIC0yICAtMSAgMCAgIDEgICAyICAgMwotICAgICAgICAgICAgICoKLSAgICAgICAgICAgICAqIGlmIGNvZWZfcmVzID0gMSwgdGhlIGNvZWZmaWNpZW50cyBoYXZlIGEgcmFuZ2Ugb2YKLSAgICAgICAgICAgICAqCi0gICAgICAgICAgICAgKiAtOCAgLTcgIC02ICAtNSAgLTQgIC0zICAtMiAgLTEgIDAgICAxICAgMiAgIDMgICA0ICAgNSAgIDYgICA3Ci0gICAgICAgICAgICAgKgotICAgICAgICAgICAgICogVGhlIGFycmF5cyBpbiAuL3NyYy90bnNfdGFiLmMgYXJlIGNvbXBsZXRlbHkgYmFzZWQgb24KLSAgICAgICAgICAgICAqIHRoZSB2YWx1ZSBvZiBjb2VmX3Jlcy4KLSAgICAgICAgICAgICAqLwotICAgICAgICAgICAgcmVzID0gZ2V0MWJpdHMoCi0gICAgICAgICAgICAgICAgICAgICAgcElucHV0U3RyZWFtKTsKLQotICAgICAgICAgICAgLyogcmVzIGlzIHBvc3QtaW5jcmVtZW50ZWQgZm9yIGNvcnJlY3QgY2FsY3VsYXRpb24gb2YgcmVzX2luZGV4ICovCi0gICAgICAgICAgICBjb2VmX3JlcyA9IHJlcysrOwotCi0gICAgICAgICAgICB0b3AgPSBzZmJfcGVyX3dpbjsKLQotICAgICAgICAgICAgZm9yIChmID0gcFRuc0ZyYW1lSW5mby0+bl9maWx0W3dpbl07IGYgPiAwOyBmLS0pCi0gICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgdGVtcEludCA9IE1JTklNVU0odG9wLCB0bnNfYmFuZHMpOwotCi0gICAgICAgICAgICAgICAgcEZpbHQtPnN0b3BfY29lZiA9IFNDQUxFX0ZBQ1RPUl9CQU5EX09GRlNFVCh0ZW1wSW50KTsKLQotICAgICAgICAgICAgICAgIHBGaWx0LT5zdG9wX2JhbmQgPSB0ZW1wSW50OwotCi0gICAgICAgICAgICAgICAgdG9wIC09IGdldDlfbl9sZXNzYml0cyhudW1fc3RhcnRfYmFuZF9iaXRzLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcElucHV0U3RyZWFtKTsKLQotICAgICAgICAgICAgICAgIHRlbXBJbnQgPSBNSU5JTVVNKHRvcCwgdG5zX2JhbmRzKTsKLQotICAgICAgICAgICAgICAgIHBGaWx0LT5zdGFydF9jb2VmID0gU0NBTEVfRkFDVE9SX0JBTkRfT0ZGU0VUKHRlbXBJbnQpOwotCi0gICAgICAgICAgICAgICAgcEZpbHQtPnN0YXJ0X2JhbmQgPSB0ZW1wSW50OwotCi0gICAgICAgICAgICAgICAgdGVtcEludCA9IGdldDlfbl9sZXNzYml0cyhudW1fb3JkZXJfYml0cywKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBJbnB1dFN0cmVhbSk7Ci0KLSAgICAgICAgICAgICAgICBwRmlsdC0+b3JkZXIgPSB0ZW1wSW50OwotCi0gICAgICAgICAgICAgICAgaWYgKHRlbXBJbnQgIT0gMCkKLSAgICAgICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgICAgIGlmICh0ZW1wSW50ID4gbWF4X29yZGVyKQotICAgICAgICAgICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgICAgICAgICBwRmlsdC0+b3JkZXIgPSBtYXhfb3JkZXI7Ci0gICAgICAgICAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgICAgICAgICAvKgotICAgICAgICAgICAgICAgICAgICAgKiBUaGlzIG1hcHMgdGhlIGJpdHN0cmVhbSdzIFswLDFdIHRvCi0gICAgICAgICAgICAgICAgICAgICAqIHBGaWx0LT5kaXJlY3Rpb24gPSBbMSwtMV0KLSAgICAgICAgICAgICAgICAgICAgICovCi0KLSAgICAgICAgICAgICAgICAgICAgdGVtcEludCA9IGdldDFiaXRzKHBJbnB1dFN0cmVhbSk7Ci0KLSAgICAgICAgICAgICAgICAgICAgcEZpbHQtPmRpcmVjdGlvbiA9ICgtKEludCl0ZW1wSW50KSB8IDB4MTsKLQotICAgICAgICAgICAgICAgICAgICAvKgotICAgICAgICAgICAgICAgICAgICAgKiBjb21wcmVzcyA9IFswLDFdCi0gICAgICAgICAgICAgICAgICAgICAqIElmIGNvbXByZXNzIGlzIHRydWUsIHRoZSBNU0IgaGFzCi0gICAgICAgICAgICAgICAgICAgICAqIGJlZW4gb21pdHRlZCBmcm9tIHRyYW5zbWlzc2lvbiAoUmVmLiAxKQotICAgICAgICAgICAgICAgICAgICAgKgotICAgICAgICAgICAgICAgICAgICAgKiBGb3IgY29lZl9yZXMgPSAwLCB0aGlzIGxpbWl0cyB0aGUgcmFuZ2Ugb2YKLSAgICAgICAgICAgICAgICAgICAgICogdHJhbnNtaXR0ZWQgY29lZmZpY2llbnRzIHRvLi4uCi0gICAgICAgICAgICAgICAgICAgICAqCi0gICAgICAgICAgICAgICAgICAgICAqICAgICAgICAgLTIgIC0xICAwICAgMQotICAgICAgICAgICAgICAgICAgICAgKgotICAgICAgICAgICAgICAgICAgICAgKiBGb3IgY29lZl9yZXMgPSAxLCB0aGUgY29lZmZpY2llbnRzIGhhdmUKLSAgICAgICAgICAgICAgICAgICAgICogYSByYW5nZSBvZi4uLgotICAgICAgICAgICAgICAgICAgICAgKgotICAgICAgICAgICAgICAgICAgICAgKiAtNCAgLTMgIC0yICAtMSAgMCAgIDEgICAyICAgMwotICAgICAgICAgICAgICAgICAgICAgKi8KLSAgICAgICAgICAgICAgICAgICAgY29tcHJlc3MgPSBnZXQxYml0cyhwSW5wdXRTdHJlYW0pOwotCi0gICAgICAgICAgICAgICAgICAgIC8qCi0gICAgICAgICAgICAgICAgICAgICAqIHJlcyBoYXMgYSByYW5nZSBvZiBbMSwyXQotICAgICAgICAgICAgICAgICAgICAgKiBjb21wcmVzcyBoYXMgYSByYW5nZSBvZiBbMCwxXQotICAgICAgICAgICAgICAgICAgICAgKiBTbyAocmVzIC0gY29tcHJlc3MpIGhhcyByYW5nZSBbMCwyXTsKLSAgICAgICAgICAgICAgICAgICAgICovCi0gICAgICAgICAgICAgICAgICAgIHJlc19pbmRleCA9IHJlcyAtIGNvbXByZXNzOwotCi0gICAgICAgICAgICAgICAgICAgIHNfbWFzayA9ICAyIDw8IHJlc19pbmRleDsKLQotICAgICAgICAgICAgICAgICAgICAvKgotICAgICAgICAgICAgICAgICAgICAgKiBJZiByZXNfaW5kZXggPSAwLCBncmFiIDIgYml0cyBvZiBkYXRhCi0gICAgICAgICAgICAgICAgICAgICAqIElmIHJlc19pbmRleCA9IDEsIGdyYWIgMyBiaXRzIG9mIGRhdGEKLSAgICAgICAgICAgICAgICAgICAgICogSWYgcmVzX2luZGV4ID0gMiwgZ3JhYiA0IGJpdHMgb2YgZGF0YQotICAgICAgICAgICAgICAgICAgICAgKi8KLSAgICAgICAgICAgICAgICAgICAgcmVzX2luZGV4ICs9IDI7Ci0KLSAgICAgICAgICAgICAgICAgICAgcFN0YXJ0THBjQ29lZiA9IHBMcGNDb2VmOwotCi0gICAgICAgICAgICAgICAgICAgIGZvciAodCA9IHBGaWx0LT5vcmRlcjsgdCA+IDA7IHQtLSkKLSAgICAgICAgICAgICAgICAgICAgewotICAgICAgICAgICAgICAgICAgICAgICAgLyoKLSAgICAgICAgICAgICAgICAgICAgICAgICAqIFRoZXNlIGFyZSB0aGUgZW5jb2RlZCBjb2VmZmljaWVudHMsIHdoaWNoIHdpbGwKLSAgICAgICAgICAgICAgICAgICAgICAgICAqIGxhdGVyIGJlIGRlY29kZWQgaW50byBMUEMgY29lZmZpY2llbnRzIGJ5Ci0gICAgICAgICAgICAgICAgICAgICAgICAgKiB0aGUgZnVuY3Rpb24gdG5zX2RlY29kZV9jb2VmKCkKLSAgICAgICAgICAgICAgICAgICAgICAgICAqLwotICAgICAgICAgICAgICAgICAgICAgICAgdGVtcEludCA9IGdldDlfbl9sZXNzYml0cyhyZXNfaW5kZXgsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBJbnB1dFN0cmVhbSk7Ci0KLSAgICAgICAgICAgICAgICAgICAgICAgIG5fbWFzayAgPSAtKChJbnQpdGVtcEludCAmIHNfbWFzayk7Ci0KLSAgICAgICAgICAgICAgICAgICAgICAgIC8qCi0gICAgICAgICAgICAgICAgICAgICAgICAgKiBuX21hc2sgaXMgdXNlZCB0byBzaWduX2V4dGVuZCB0aGUKLSAgICAgICAgICAgICAgICAgICAgICAgICAqIHZhbHVlLCBpZiBpdCBpcyBuZWdhdGl2ZS4KLSAgICAgICAgICAgICAgICAgICAgICAgICAqCi0gICAgICAgICAgICAgICAgICAgICAgICAgKi8KLSAgICAgICAgICAgICAgICAgICAgICAgICoocExwY0NvZWYrKykgPSB0ZW1wSW50IHwgbl9tYXNrOwotICAgICAgICAgICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgICAgICAgICAgLyogRGVjb2RlIHRoZSBUTlMgY29lZmZpY2llbnRzICovCi0KLSAgICAgICAgICAgICAgICAgICAgdGVtcEludCA9IHBGaWx0LT5zdG9wX2NvZWYgLSBwRmlsdC0+c3RhcnRfY29lZjsKLQotICAgICAgICAgICAgICAgICAgICBpZiAodGVtcEludCA+IDApCi0gICAgICAgICAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAgICAgICAgIHBGaWx0LT5xX2xwYyA9Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgdG5zX2RlY29kZV9jb2VmKAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwRmlsdC0+b3JkZXIsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvZWZfcmVzLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwU3R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DMyIGdldGJpdHMoCi0gICAgICAgIGNvbnN0IFVJbnQgIG5lZWRlZEJpdHMsCi0gICAgICAgIEJJVFMgICAgICAgKnBJbnB1dFN0cmVhbSkKLSAgICB7Ci0gICAgICAgIFVJbnQzMiAgIHJldHVyblZhbHVlID0gMDsKLSAgICAgICAgVUludCAgICAgb2Zmc2V0OwotICAgICAgICBVSW50ICAgICBiaXRJbmRleDsKLSAgICAgICAgVUNoYXIgICAgKnBFbGVtOyAgICAgICAgLyogTmVlZHMgdG8gYmUgc2FtZSB0eXBlIGFzIHBJbnB1dC0+cEJ1ZmZlciAqLwotCi0gICAgICAgIG9mZnNldCA9IChwSW5wdXRTdHJlYW0tPnVzZWRCaXRzKSA+PiBJTkJVRl9BUlJBWV9JTkRFWF9TSElGVDsKLQotICAgICAgICBwRWxlbSA9IHBJbnB1dFN0cmVhbS0+cEJ1ZmZlciArIG9mZnNldDsKLQotI2lmIENIRUNLX0lOUFVUX0JVRkZFUl9MSU1JVFMKLQotICAgICAgICBvZmZzZXQgPSAgcElucHV0U3RyZWFtLT5pbnB1dEJ1ZmZlckN1cnJlbnRMZW5ndGggLSBvZmZzZXQ7Ci0gICAgICAgIC8qICBjaGVjayBpZiBhY2Nlc3MgdG8gaW5wdXQgYnVmZmVyIGRvZXMgbm90IGdvIGJleW9uZCBib3VuZGFyaWVzICovCi0gICAgICAgIGlmIChvZmZzZXQgPiAzKQotICAgICAgICB7Ci0gICAgICAgICAgICByZXR1cm5WYWx1ZSA9ICgoKFVJbnQzMikgKiAocEVsZW0pKSA8PCAyNCkgfAotICAgICAgICAgICAgICAgICAgICAgICAgICAoKChVSW50MzIpICogKHBFbGVtICsgMSkpIDw8IDE2KSB8Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICgoKFVJbnQzMikgKiAocEVsZW0gKyAyKSkgPDwgOCkgfAotICAgICAgICAgICAgICAgICAgICAgICAgICAoKFVJbnQzMikgKiAocEVsZW0gKyAzKSk7Ci0gICAgICAgIH0KLSAg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SW50MzIpICogKHBFbGVtICsgMSkpIDw8IDE2KTsKLSAgICAgICAgICAgICAgICBjYXNlIDE6Ci0gICAgICAgICAgICAgICAgICAgIHJldHVyblZhbHVlIHw9ICgoKFVJbnQzMikgKiAocEVsZW0pKSA8PCAyNCk7Ci0gICAgICAgICAgICAgICAgZGVmYXVsdDoKLSAgICAgICAgICAgICAgICAgICAgYnJlYWs7Ci0gICAgICAgICAgICB9Ci0gICAgICAgIH0KLQotCi0jZWxzZQotCi0gICAgICAgIHJldHVyblZhbHVlID0gKCgoVUludDMyKSAqIChwRWxlbSkpIDw8IDI0KSB8Ci0gICAgICAgICAgICAgICAgICAgICAgKCgoVUludDMyKSAqIChwRWxlbSArIDEpKSA8PCAxNikgfAotICAgICAgICAgICAgICAgICAgICAgICgoKFVJbnQzMikgKiAocEVsZW0gKyAyKSkgPDwgOCkgfAotICAgICAgICAgICAgICAgICAgICAgICgoVUludDMyKSAqIChwRWxlbSArIDMpKTsKLSNlbmRpZgotCi0gICAgICAgIC8qIFJlbW92ZSBleHRyYSBoaWdoIGJpdHMgYnkgc2hpZnRpbmcgdXAgKi8KLSAgICAgICAgYml0SW5kZXggPSAoVUludCkoKHBJbnB1dFN0cmVhbS0+dXNlZEJpdHMpICYgSU5CVUZfQklUX01PRFVMT19NQVNLKTsKLQotICAgICAgICAvKiBUaGlzIGxpbmUgaXMgZmFzdGVyIHdheSB0byBtYXNrIG9mZiB0aGUgaGlnaCBiaXRzLiAqLwotICAgICAgICByZXR1cm5WYWx1ZSA9IHJldHVyblZhbHVlIDw8IChiaXRJbmRleCk7Ci0KLSAgICAgICAgLyogTW92ZSB0aGUgZmllbGQgZG93bi4gKi8KLSAgICAgICAgcmV0dXJuVmFsdWUgPSByZXR1cm5WYWx1ZSA+PiAoMzIgLSBuZWVkZWRCaXRzKTsKLQotICAgICAgICBwSW5wdXRTdHJlYW0tPnVzZWRCaXRzICs9IG5lZWRlZEJpdHM7Ci0KLSAgICAgICAgcmV0dXJuIChyZX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bHQ6Ci0gICAgICAgICAgICAgICAgICAgIHJldHVyblZhbHVlID0gMDsKLSAgICAgICAgICAgICAgICAgICAgYnJlYWs7Ci0gICAgICAgICAgICB9Ci0gICAgICAgIH0KLQotCi0jZWxzZQotICAgICAgICByZXR1cm5WYWx1ZSA9ICgoKFVJbnQzMikgKiAocEVsZW0pKSA8PCA4KSB8Ci0gICAgICAgICAgICAgICAgICAgICAgKChVSW50MzIpICogKHBFbGVtICsgMSkpIDsKLSNlbmRpZgotCi0gICAgICAgIC8qIFJlbW92ZSBleHRyYSBoaWdoIGJpdHMgYnkgc2hpZnRpbmcgdXAgKi8KLSAgICAgICAgYml0SW5kZXggPSAoVUludCkoKHBJbnB1dFN0cmVhbS0+dXNlZEJpdHMpICYgSU5CVUZfQklUX01PRFVMT19NQVNLKTsKLQotICAgICAgICBwSW5wdXRTdHJlYW0tPnVzZWRCaXRzICs9IG5lZWRlZEJpdHM7Ci0KLSAgICAgICAgLyogVGhpcyBsaW5lIGlzIGZhc3RlciB3YXkgdG8gbWFzayBvZmYgdGhlIGhpZ2ggYml0cy4gKi8KLSAgICAgICAgcmV0dXJuVmFsdWUgPSAweEZGRkYgJiAocmV0dXJuVmFsdWUgPDwgKGJpdEluZGV4KSk7Ci0KLSAgICAgICAgLyogTW92ZSB0aGUgZmllbGQgZG93bi4gKi8KLQotICAgICAgICByZXR1cm4gKFVJbnQpKHJldHVyblZhbHVlID4+ICgxNiAtIG5lZWRlZEJpdHMpKTsKLQotICAgIH0KLQotICAgIF9faW5saW5lIFVJbnQzMiBnZXQxN19uX2xlc3NiaXRzKAotICAgICAgICBjb25zdCBVSW50ICBuZWVkZWRCaXRzLAotICAgICAgICBCSVRTICAgICAgICpwSW5wdXRTdHJlYW0pCi0gICAgewotICAgICAgICBVSW50MzIgICByZXR1cm5WYWx1ZTsKLSAgICAgICAgVUludCAgICAgb2Zmc2V0OwotICAgICAgICBVSW50ICAgICBiaXRJbmRleDsKLSAgICAgICAgVUNoYXIgICAgK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wcm9jZXNzZWQuIE5vbi1hY2Nlc3NpYmxlIGJ5dGVzIHdpbGwgYmUgZmlsbGVkIGluIHdpdGggemVyb3MuCi0gICAgICAgICAgICAgKiAgWmVybyB2YWx1ZXMgZ3VhcmFudGVlcyB0aGF0IHRoZSBkYXRhIHN0cnVjdHVyZXMgYXJlIGZpbGxlZCBpbiB3aXRoIHZhbHVlcwotICAgICAgICAgICAgICogIHRoYXQgZXZlbnR1YWxseSB3aWxsIHNpZ25hbCBhbiBlcnJvciAobGlrZSBpbnZhbGlkIHBhcmFtZXRlcnMpIG9yIHRoYXQgYWxsb3cKLSAgICAgICAgICAgICAqICBjb21wbGV0aW9uIG9mIHRoZSBwYXJzaW5nIHJvdXRpbmUuCi0gICAgICAgICAgICAgKiAgT3ZlcnJ1biBpcyBkZXRlY3RlZCBvbiBmaWxlIHB2bXA0YXVkaW9kZWNvZGVmcmFtZS5jcHAKLSAgICAgICAgICAgICAqLwotICAgICAgICAgICAgcmV0dXJuVmFsdWUgPSAwOwotICAgICAgICAgICAgc3dpdGNoIChvZmZzZXQpCi0gICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgY2FzZSAyOgotICAgICAgICAgICAgICAgICAgICByZXR1cm5WYWx1ZSAgPSAoKChVSW50MzIpICogKHBFbGVtICsgMSkpIDw8IDgpOwotICAgICAgICAgICAgICAgIGNhc2UgMToKLSAgICAgICAgICAgICAgICAgICAgcmV0dXJuVmFsdWUgfD0gKCgoVUludDMyKSAqIChwRWxlbSkpIDw8IDE2KTsKLSAgICAgICAgICAgICAgICBkZWZhdWx0OgotICAgICAgICAgICAgICAgICAgICBicmVhazsKLSAgICAgICAgICAgIH0KLSAgICAgICAgfQotCi0jZWxzZQotCi0gICAgICAgIHJldHVyblZhbHVlID0gKCgoVUludDMyKSAqIChwRWxlbSkpIDw8IDE2KSB8Ci0gICAgICAgICAgICAgICAgICAgICAgKCgoVUludDMyKSAqIChwRWxlbSArIDEpKSA8PCA4KSB8Ci0gICAgICAg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gICAgTU9ESUZZSU5HKHBJbnB1dFN0cmVhbSkKLSAgICAgICAgICAgICAgICAgICAgICAgIFJlVFVSTklORyhnbG9iYWxfZ2FpbikKLQotICAgIElGIChjb21tb25fd2luZG93ID09IEZBTFNFKQotICAgIFRIRU4KLSAgICAgICAgc3RhdHVzID0gQ0FMTCBnZXRfaWNzX2luZm8oCi0gICAgICAgICAgICAgICAgICAgICAgICBwVmFycy0+bWNfaW5mby5hdWRpb09iamVjdFR5cGUsCi0gICAgICAgICAgICAgICAgICAgICAgICBwSW5wdXRTdHJlYW0sCi0gICAgICAgICAgICAgICAgICAgICAgICBjb21tb25fd2luZG93LAotICAgICAgICAgICAgICAgICAgICAgICAmcENoVmFycy0+d25kLAotICAgICAgICAgICAgICAgICAgICAgICAmcENoVmFycy0+d25kX3NoYXBlX3RoaXNfYmssCi0gICAgICAgICAgICAgICAgICAgICAgICBncm91cCwKLSAgICAgICAgICAgICAgICAgICAgICAgIHBNYXhfc2ZiLAotICAgICAgICAgICAgICAgICAgICAgICAgcFdpbk1hcCwKLSAgICAgICAgICAgICAgICAgICAgICAgICZwQ2hWYXJzLT5sdF9zdGF0dXMsCi0gICAgICAgICAgICAgICAgICAgICAgICBOVUxMKQotICAgICAgICAgICAgICAgICAgICBNT0RJRllJTkcocElucHV0U3RyZWFtLHBDaFZhcnMsZ3JvdXAsbWF4X3NmYixsdF9zdGF0dXMpCi0gICAgICAgICAgICAgICAgICAgIFJFVFVSTklORyhzdGF0dXMpCi0gICAgRU5ESUYKLQotICAgIG1lbWNweShwRnJhbWVJbmZvLCBwV2luTWFwW3BDaFZhcnMtPnduZF0sIHNpemVvZihGcmFtZUluZm8pKQotCi0gICAgSUYgKCpwTWF4X3NmYiA+IDApCi0gICAgVEhFTgotCi0gICAgICAgIGkgICAgICA9IDA7Ci0gICAgICAgIHRvdFNmYiA9IDA7Ci0KLSAgICAgICAgRE8KLQotICAgICAgICAgICAgdG90U2ZiKys7Ci0KLSAgICAgICAgV0hJTEUoICpwR3JvdXArKyA8IHBGcmFtZUluZm8tPm51bV93aW4pOwotCi0gICAgICAgIHRvdFNmYiAgKj0gIHBGcmFtZUluZm8tPnNmYl9wZXJfd2luWzBdOwotCi0gICAgICAgIG5zZWN0ID0gQ0FMTCBodWZmY2IoCi0gICAgICAgICAgICAgICAgICAgICAgICBzZWN0LAotICAgICAgICAgICAgICAgICAgICAgICAgcElucHV0U3RyZWFtLAotICAgICAgICAgICAgICAgICAgICAgICAgcEZyYW1lSW5mby0+c2VjdGJpdHMsCi0gICAgICAgICAgICAgICAgICAgICAgICB0b3RTZmIsCi0gICAgICAgICAgICAgICAgICAgICAgICBwRnJhbWVJbmZvLT5zZmJfcGVyX3dpblswXSwKLSAgICAgICAgICAgICAgICAgICAgICAgKnBNYXhfc2ZiKQotICAgICAgICAgICAgICAgICAgICBNT0RJRllJTkcoc2VjdCxwSW5wdXRTdHJlYW0sc2VjdGJpdHMpCi0gICAgICAgICAgICAgICAgICAgIFJFVFVSTklORyhuc2VjdCkKLQotICAgICAgICBJRiAobnNlY3QgPT0gMCkKLSAgICAgICAgVEhFTgotICAgICAgICAgICAgc3RhdHVzID0gMQotCi0gICAgICAgIEVORElGCi0KLSAgICAgICAgc2VjdFN0YXJ0ID0gMDsKLSAgICAgICAgRk9SIChpID0gMDsgaSA8IG5zZWN0OyBpKyspCi0KLSAgICAgICAgICAgIGNiICA9IHNlY3RbaV0uc2VjdF9jYjsKLSAgICAgICAgICAgIHNlY3RXaWR0aCA9ICBzZWN0W2ldLnNlY3RfZW5kIC0gc2VjdFN0YXJ0OwotICAgICAgICAgICAgc2VjdFN0YXJ0ICs9IHNlY3RXaWR0aDsKLQotICAgICAgICAgICAgV0hJTEUgKHNlY3RXaWR0aCA+IDApCi0KLSAgICAgICAgICAgICAgICAqcENvZGVib29rTWFwKysgPSBjYgotICAgICAgICAgICAgICAgICBzZWN0V2lkdGgtLQotICAgICAgICAgICAgRU5EV0hJTEUKLQotICAgICAgICBFTkRGT1IgKGkpCi0KLSAgICBFTFNFCi0KLSAgICAgICAgbWVtc2V0KHBDb2RlYm9va01hcCxaRVJPX0hDQixNQVhCQU5EUypzaXplb2YoKnBDb2RlYm9va01hcCkpOwotCi0gICAgRU5ESUYgKCpwTWF4X3NmYikKLQotICAgIElGIChwRnJhbWVJbmZvLT5pc2xvbmcgPT0gRkFMU0UpCi0gICAgVEhFTgotICAgICAgICBDQUxMIGNhbGNfZ3NmYl90YWJsZSgKLSAgICAgICAgICAgICAgICBwRnJhbUluZm8gPSBwRnJhbWVJbmZvLAotICAgICAgICAgICAgICAgIGdyb3VwW10gICA9IGdyb3VwKQotICAgICAgICAgICAgICBNT0RJRllJTkcocEZyYW1lSW5mby0+ZnJhbWVfc2ZiX3RvcCkKLSAgICAgICAgICAgICAgUkVUVVJOSU5HKHZvaWQpCi0gICAgRU5ESUYKLQotICAgIElGIChzdGF0dXMgPT0gU1VDQ0VTUykKLSAgICBUSEVOCi0gICAgICAgIHN0YXR1cyA9IENBTEwgaHVmZmZhYygKLSAgICAgICAgICAgICAgICAgICAgICAgIHBGcmFtZUluZm8sCi0gICAgICAgICAgICAgICAgICAgICAgICBwSW5wdXRTdHJlYW0sCi0gICAgICAgICAgICAgICAgICAgICAgICBncm91cCwKLSAgICAgICAgICAgICAgICAgICAgICAgIG5zZWN0LAotICAgICAgICAgICAgICAgICAgICAgICAgc2VjdCwKLSAgICAgICAgICAgICAgICAgICAgICAgIGdsb2JhbF9nYWluLAotICAgICAgICAgICAgICAgICAgICAgICAgcENoVmFycy0+ZmFjdG9ycywKLSAgICAgICAgICAgICAgICAgICAgICAgIHBWYXJzLT5odWZmQm9va1VzZWQpCi0gICAgICAgICAgICAgICAgICAgIE1PRElGWUlORyhwSW5wdXRTdHJlYW0sZmFjdG9ycykKLSAgICAgICAgICAgICAgICAgICAgUkVUVVJOSU5HKHN0YXR1cykKLQotICAgIEVORElGIChzdGF0dXMpCi0KLSAgICBJRiAoc3RhdHVzID09IFNVQ0NFU1MpCi0gICAgVEhFTgotICAgICAgICBwcmVzZW50ID0gQ0FMTCBnZXRiaXRzKAotICAgICAgICAgICAgICAgICAgICAgICAgbmVlZGVkQml0cyAgID0gTEVOX1BVTFNFX1BSRVMsCi0gICAgICAgICAgICAgICAgICAgICAgICBwSW5wdXRTdHJlYW0gPSBwSW5wdXRTdHJlYW0pCi0gICAgICAgICAgICAgICAgICAgIE1PRElGWUlORyhwSW5wdXRTdHJlYW0pCi0gICAgICAgICAgICAgICAgICAgIFJFVFVSTklORyhwcmVzZW50KQotCi0gICAgICAgIHBQdWxzZUluZm8tPnB1bHNlX2RhdGFfcHJlc2VudCA9IHByZXNlbnQ7Ci0KLSAgICAgICAgSUYgKHByZXNlbnQgIT0gRkFMU0UpCi0gICAgICAgIFRIRU4KLSAgICAgICAgICAgIElGIChwRnJhbWVJbmZvLT5pc2xvbmcgPT0gMSkKLSAgICAgICAgICAgIFRIRU4KLSAgICAgICAgICAgICAgICBDQUxMIGdldF9wdWxzZV9kYXRhKAotICAgICAgICAgICAgICAgICAgICAgICAgICBwUHVsc2VJbmZvID0gcFB1bHNlSW5mbywKLSAgICAgICAgICAgICAgICAgICAgICAgICAgcElucHV0U3RyZWFtID0gcElucHV0U3RyZWFtKQotICAgICAgICAgICAgICAgICAgICBNT0RJRllJTkcocElucHV0U3RyZWFtLHBQdWxzZUluZm8pCi0gICAgICAgICAgICAgICAgICAgIFJFVFVSTklORyh2b2lkKQotCi0gICAgICAgICAgICBFTFNFCi0KLSAgICAgICAgICAgICAgICBzdGF0dXMgPSAxOwotCi0gICAgICAgICAgICBFTkRJRiAocEZyYW1lSW5mbykKLSAgICAgICAgRU5ESUYgKHByZXNlbnQpCi0KLSAgICBFTkRJRiAoc3RhdHVzKQotCi0gICAgSUYgKHN0YXR1cyA9PSBTVUNDRVNTKQotICAgIFRIRU4KLSAgICAgICAgcHJlc2VudCA9IENBTEwgZ2V0Yml0cygKLSAgICAgICAgICAgICAgICAgICAgICAgIG5lZWRlZEJpdHMgPSBMRU5fVE5TX1BSRVMsCi0gICAgICAgICAgICAgICAgICAgICAgICBwSW5wdXRTdHJlYW0gPSBwSW5wdXRTdHJlYW0pCi0gICAgICAgICAgICAgICAgICAgIE1PRElGWUlORyhwSW5wdXRTdHJlYW0pCi0gICAgICAgICAgICAgICAgICAgIFJFVFVSTklORyhwcmVzZW50KQotCi0gICAgICAgIHBUbnNGcmFtZUluZm8tPnRuc19kYXRhX3ByZXNlbnQgPSBwcmVzZW50OwotCi0gICAgICAgIElGIChwcmVzZW50ICE9IEZBTFNFKQotICAgICAgICBUSEVOCi0gICAgICAgICAgICBDQUxMIGdldF90bnMoCi0gICAgICAgICAgICAgICAgICAgIHBGcmFtZUluZm8gPSBwRnJhbWVJbmZvLAotICAgICAgICAgICAgICAgICAgICBwVG5zRnJhbWVJbmZvID0gcFRuc0ZyYW1lSW5mbywKLSAgICAgICAgICAgICAgICAgICAgcElucHV0U3RyZWFtID0gcElucHV0U3RyZWFtKQotICAgICAgICAgICAgICAgIE1PRElGWUlORyhwSW5wdXRTdHJlYW0sIHBUbnNGcmFtZUluZm8pCi0gICAgICAgICAgICAgICAgUkVUVVJOSU5HKHZvaWQpCi0gICAgICAgIEVMU0UKLQotICAgICAgICAgICAgRk9SIChpID0gcFRuc0ZyYW1lSW5mby0+bl9zdWJibG9ja3MgLSAxOyBpID49IDAgOyBpLS0pCi0KLSAgICAgICAgICAgICAgICBwVG5zRnJhbWVJbmZvLT5pbmZvW2ldLm5fZmlsdCA9IDA7Ci0gICAgICAgICAgICBFTkRGT1IKLQotICAgICAgICBFTkRJRihwcmVzZW50KQotCi0gICAgRU5ESUYgKHN0YXR1cykKLQotICAgIElGIChzdGF0dXMgPT0gU1VDQ0VTUykKLSAgICBUSEVOCi0gICAgICAgIHByZXNlbnQgPSBDQUxMIGdldGJpdHMoCi0gICAgICAgICAgICAgICAgICAgICAgICBuZWVkZWRCaXRzID0gTEVOX0dBSU5fUFJFUywKLSAgICAgICAgICAgICAgICAgICAgICAgIHBJbnB1dFN0cmVhbSA9IHBJbnB1dFN0cmVhbSkKLSAgICAgICAgICAgICAgICBNT0RJRllJTkcocElucHV0U3RyZWFtKQotICAgICAgICAgICAgICAgIFJFVFVSTklORyhwcmVzZW50KQotCi0gICAgICAgIElGIChwcmVzZW50ICE9IEZBTFNFKQotICAgICAgICBUSEVOCi0gICAgICAgICAgICBzdGF0dXMgPSAxOwotICAgICAgICBFTkRJRgotICAgIEVORElGIChzdGF0dXMpCi0KLSAgICBJRiAoc3RhdHVzID09IFNVQ0NFU1MpCi0gICAgVEhFTgotICAgICAgICBzdGF0dXMgPSBDQUxMIGh1ZmZzcGVjX2Z4cCgKLSAgICAgICAgICAgICAgICAgICAgICAgIHBGcmFtZUluZm8sCi0gICAgICAgICAgICAgICAgICAgICAgICBwSW5wdXRTdHJlYW0sCi0gICAgICAgICAgICAgICAgICAgICAgICBuc2VjdCwKLSAgICAgICAgICAgICAgICAgICAgICAgIHNlY3QsCi0gICAgICAgICAgICAgICAgICAgICAgICBwQ2hWYXJzLT5mYWN0b3JzLAotICAgICAgICAgICAgICAgICAgICAgICAgcENoVmFycy0+ZnhwQ29lZiwKLSAgICAgICAgICAgICAgICAgICAgICAgIHBWYXJzLT5xdWFudFNwZWMsCi0gICAgICAgICAgICAgICAgICAgICAgICBwVmFycy0+dG1wX3NwZWMsCi0gICAgICAgICAgICAgICAgICAgICAgICBwV2luTWFwW09OTFlfTE9OR19XSU5ET1ddLAotICAgICAgICAgICAgICAgICAgICAgICAgcFB1bHNlSW5mbywKLSAgICAgICAgICAgICAgICAgICAgICAgIHBDaFZhcnMtPnFGb3JtYXQpCi0gICAgICAgICAgICAgICAgTU9ESUZZSU5HKHBJbnB1dFN0cmVhbSxmeHBDb2VmLHF1YW50U3BlYyx0bXBfc3BlYyxxRm9ybWF0KQotICAgICAgICAgICAgICAgIFJFVFVSTklORyhzdGF0dXMpCi0gICAgRU5ESUYKLQotICAgIFJFVFVSTiBzdGF0dXMKLQotLS0tLS0tLS0t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AgLyogcmVhZCBnbG9iYWwgZ2FpbiBmcm9tIElucHV0IGJpdHN0cmVhbSAqLwotICAgIGdsb2JhbF9nYWluID0KLSAgICAgICAgZ2V0OV9uX2xlc3NiaXRzKAotICAgICAgICAgICAgTEVOX1NDTF9QQ00sCi0gICAgICAgICAgICBwSW5wdXRTdHJlYW0pOwotCi0gICAgaWYgKGNvbW1vbl93aW5kb3cgPT0gRkFMU0UpCi0gICAgewotICAgICAgICBzdGF0dXMgPSBnZXRfaWNzX2luZm8oCi0gICAgICAgICAgICAgICAgICAgICBwVmFycy0+bWNfaW5mby5hdWRpb09iamVjdFR5cGUsCi0gICAgICAgICAgICAgICAgICAgICBwSW5wdXRTdHJlYW0sCi0gICAgICAgICAgICAgICAgICAgICBjb21tb25fd2luZG93LAotICAgICAgICAgICAgICAgICAgICAgJnBDaFZhcnMtPnduZCwKLSAgICAgICAgICAgICAgICAgICAgICZwQ2hWYXJzLT53bmRfc2hhcGVfdGhpc19iaywKLSAgICAgICAgICAgICAgICAgICAgIGdyb3VwLAotICAgICAgICAgICAgICAgICAgICAgcE1heF9zZmIsCi0gICAgICAgICAgICAgICAgICAgICBwV2luTWFwLAotICAgICAgICAgICAgICAgICAgICAgJnBDaFZhcnMtPnBTaGFyZVdmeHBDb2VmLT5sdF9zdGF0dXMsCi0gICAgICAgICAgICAgICAgICAgICBOVUxMKTsKLSAgICB9Ci0KLSAgICBwRnJhbWVJbmZvID0gcFdpbk1hcFtwQ2hWYXJzLT53bmRdOwotCi0gICAgLyogRmlyc3QsIGNhbGN1bGF0ZSB0b3RhbCBudW1iZXIgb2Ygc2NhbGVmYWN0b3IgYmFuZHMKLSAgICAgKiBmb3IgdGhpcyBncm91cGluZy4gVGhlbiwgZGVjb2RlIHNlY3Rpb24gZGF0YQotICAgICAqLwotICAgIGlmICgqcE1heF9zZmIgPiAwKQotICAgIHsKLQotICAgICAgICAvKiBjYWxjdWxhdGUgdG90YWwgbnVtYmVyIG9mIHNmYiAqLwotICAgICAgICBpICAgICAgPSAwOwotICAgICAgICB0b3RTZmIgPSAwOwotCi0gICAgICAgIGRvCi0gICAgICAgIHsKLSAgICAgICAgICAgIHRvdFNmYisrOwotCi0gICAgICAgIH0KLSAgICAgICAgd2hpbGUgKCpwR3JvdXArKyA8IHBGcmFtZUluZm8tPm51bV93aW4pOwotCi0gICAgICAgIHRvdFNmYiAgKj0gIHBGcmFtZUluZm8tPnNmYl9wZXJfd2luWzBdOwotCi0gICAgICAgIC8qIGRlY29kZSBzZWN0aW9uIGRhdGEgKi8KLSAgICAgICAgbnNlY3QgPQotICAgICAgICAgICAgaHVmZmNiKAotICAgICAgICAgICAgICAgIHNlY3QsCi0gICAgICAgICAgICAgICAgcElucHV0U3RyZWFtLAotICAgICAgICAgICAgICAgIHBGcmFtZUluZm8tPnNlY3RiaXRzLAotICAgICAgICAgICAgICAgIHRvdFNmYiwKLSAgICAgICAgICAgICAgICBwRnJhbWVJbmZvLT5zZmJfcGVyX3dpblswXSwKLSAgICAgICAgICAgICAgICAqcE1heF9zZmIpOwotCi0gICAgICAgIGlmIChuc2VjdCA9PSAwKQotICAgICAgICB7Ci0gICAgICAgICAgICBzdGF0dXMgPSAxOyAgICAgLyogZGVjb2RlIHNlY3Rpb24gZGF0YSBlcnJvciAqLwotCi0gICAgICAgIH0vKiBpZiAobnNlY3QpICovCi0KLSAgICAgICAgLyogZ2VuZXJhdGUgImxpbmVhciIgZGVzY3JpcHRpb24gZnJvbSBzZWN0aW9uIGluZm8KLSAgICAgICAgICogc3RvcmVkIGFzIGNvZGVib29rIGZvciBlYWNoIHNjYWxlZmFjdG9yIGJhbmQgYW5kIGdyb3VwCi0gICAgICAgICAqIHdoZW4gbnNlY3QgPT0gMCwgZm9yLWxvb3AgZG9lcyBub3QgZXhlY3V0ZQotICAgICAgICAgKi8KLSAgICAgICAgc2VjdFN0YXJ0ID0gMDsKLSAgICAgICAgZm9yIChpID0gMDsgaSA8IG5zZWN0OyBpKyspCi0gICAgICAgIHsKLSAgICAgICAgICAgIGNiICA9IHNlY3RbaV0uc2VjdF9jYjsKLSAgICAgICAgICAgIHNlY3RXaWR0aCA9ICBzZWN0W2ldLnNlY3RfZW5kIC0gc2VjdFN0YXJ0OwotICAgICAgICAgICAgc2VjdFN0YXJ0ICs9IHNlY3RXaWR0aDsKLQotICAgICAgICAgICAgd2hpbGUgKHNlY3RXaWR0aCA+IDApCi0gICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgKnBDb2RlYm9va01hcCsrID0gY2I7ICAgLyogY2Fubm90IHVzZSBtZW1zZXQgZm9yIEludCAqLwotICAgICAgICAgICAgICAgIHNlY3RXaWR0aC0tOwotICAgICAgICAgICAgfQotCi0gICAgICAgIH0gLyogZm9yIChpKSAqLwotCi0gICAgfQotICAgIGVsc2UKLSAgICB7Ci0gICAgICAgIC8qIHNldCBhbGwgc2VjdGlvbnMgd2l0aCBaRVJPX0hDQiAqLwotICAgICAgICBwdl9tZW1zZXQoCi0gICAgICAgICAgICBwQ29kZWJvb2tNYXAsCi0gICAgICAgICAgICBaRVJPX0hDQiwKLSAgICAgICAgICAgIE1BWEJBTkRTKnNpemVvZigqcENvZGVib29rTWFwKSk7Ci0gICAgICAgIC8qCi0gICAgICAgICAgICAgICAgZm9yIChpPU1BWEJBTkRTOyBpPjA7IGktLSkKLSAgICAgICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgICAgICoocENvZGVib29rTWFwKyspID0gWkVST19IQ0I7Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAqLwotCi0gICAgfSAvKiBpZiAoKnBNYXhfc2ZiKSAqLwotCi0gICAgLyogY2FsY3VsYXRlIGJhbmQgb2Zmc2V0cwotICAgICAqIChiZWNhdXNlIG9mIGdyb3VwaW5nIGFuZCBpbnRlcmxlYXZpbmcgdGhpcyBjYW5ub3QgYmUKLSAgICAgKiBhIGNvbnN0YW50OiBzdG9yZSBpdCBpbiBwRnJhbWVJbmZvLT5mcmFtZV9zZmJfdG9wKQotICAgICAqLwotICAgIGlmIChwRnJhbWVJbmZvLT5pc2xvbmcgPT0gRkFMU0UpCi0gICAgewotICAgICAgICBjYWxjX2dzZmJfdGFibGUoCi0gICAgICAgICAgICBwRnJhbWVJbmZvLAotICAgICAgICAgICAgZ3JvdXApOwotICAgIH0KLQotICAgIC8qIGRlY29kZSBzY2FsZSBmYWN0b3IgZGF0YSAqLwotICAgIGlmIChzdGF0dXMgPT0gU1VDQ0VTUykKLSAgICB7Ci0gICAgICAgIHN0YXR1cyA9Ci0gICAgICAgICAgICBodWZmZmFjKAotICAgICAgICAgICAgICAgIHBGcmFtZUluZm8sCi0gICAgICAgICAgICAgICAgcElucHV0U3RyZWFtLAotICAgICAgICAgICAgICAgIGdyb3VwLAotICAgICAgICAgICAgICAgIG5zZWN0LAotICAgICAgICAgICAgICAgIHNlY3QsCi0gICAgICAgICAgICAgICAgZ2xvYmFsX2dhaW4sCi0gICAgICAgICAgICAgICAgcENoVmFycy0+cFNoYXJlV2Z4cENvZWYtPmZhY3RvcnMsCi0gICAgICAgICAgICAgICAgcFZhcnMtPnNjcmF0Y2guaHVmZmJvb2tfdXNlZCk7Ci0KLSAgICB9IC8qIGlmIChzdGF0dXMpICovCi0KLSAgICAvKiBub2lzZWxlc3MgY29kaW5nICovCi0gICAgaWYgKHN0YXR1cyA9PSBTVUNDRVNTKQotICAgIHsKLSAgICAgICAgcHJlc2VudCA9Ci0gICAgICAgICAgICBnZXQxYml0cyhwSW5wdXRTdHJlYW0pOwotCi0gICAgICAgIHBQdWxzZUluZm8tPnB1bHNlX2RhdGFfcHJlc2VudCA9IHByZXNlbnQ7Ci0KLSAgICAgICAgaWYgKHByZXNlbnQgIT0gRkFMU0UpCi0gICAgICAgIHsKLSAgICAgICAgICAgIGlmIChwRnJhbWVJbmZvLT5pc2xvbmcgPT0gMSkKLSAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICBzdGF0dXMgPSBnZXRfcHVsc2VfZGF0YSgKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcFB1bHNlSW5mbywKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcElucHV0U3RyZWFtKTsKLSAgICAgICAgICAgIH0KLSAgICAgICAgICAgIGVsc2UKLSAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAvKiBDb21tb25FeGl0KDEsIlB1bHNlIGRhdGEgbm90IGFsbG93ZWQgZm9yIHNob3J0IGJsb2NrcyIpOyAqLwotICAgICAgICAgICAgICAgIHN0YXR1cyA9IDE7Ci0KLSAgICAgICAgICAgIH0gLyogaWYgKHBGcmFtZUluZm8pICovCi0gICAgICAgIH0gLyogaWYgKHByZXNlbnQpICovCi0KLSAgICB9IC8qIGlmIChzdGF0dXMpICovCi0KLQotICAgIC8qIGRlY29kZSB0bnMgZGF0YSAqLwotICAgIGlmIChzdGF0dXMgPT0gU1VDQ0VTUykKLSAgICB7Ci0gICAgICAgIHByZXNlbnQgPQotICAgICAgICAgICAgZ2V0MWJpdHMocElucHV0U3RyZWFtKTsKLQotICAgICAgICBwVG5zRnJhbWVJbmZvLT50bnNfZGF0YV9wcmVzZW50ID0gcHJlc2VudDsKLQotICAgICAgICBpZiAocHJlc2VudCAhPSBGQUxTRSkKLSAgICAgICAgewotICAgICAgICAgICAgZ2V0X3RucygKLSAgICAgICAgICAgICAgICBwQ2hWYXJzLT5wU2hhcmVXZnhwQ29lZi0+bWF4X3NmYiwKLSAgICAgICAgICAgICAgICBwSW5wdXRTdHJlYW0sCi0gICAgICAgICAgICAgICAgcENoVmFycy0+d25kLAotICAgICAgICAgICAgICAgIHBGcmFtZUluZm8sCi0gICAgICAgICAgICAgICAgJnBWYXJzLT5tY19pbmZvLAotICAgICAgICAgICAgICAgIHBUbnNGcmFtZUluZm8sCi0gICAgICAgICAgICAgICAgcFZhcnMtPnNjcmF0Y2gudG5zX2RlY29kZV9jb2VmKTsKLSAgICAgICAgfQotICAgICAgICBlbHNlCi0gICAgICAgIHsKLSAgICAgICAgICAgIGZvciAoaSA9IHBGcmFtZUluZm8tPm51bV93aW4gLSAxOyBpID49IDAgOyBpLS0pCi0gICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgcFRuc0ZyYW1lSW5mby0+bl9maWx0W2ldID0gMDsKLSAgICAgICAgICAgIH0KLQotICAgICAgICB9IC8qIGlmKHByZXNlbnQpICovCi0KLSAgICB9IC8qIGlmIChzdGF0dXMpICovCi0KLSAgICAvKiBnYWluIGNvbnRyb2wgKi8KLSAgICBpZiAoc3RhdHVzID09IFNVQ0NFU1MpCi0gICAgewotICAgICAgICBwcmVzZW50ID0KLSAgICAgICAgICAgIGdldDFiaXRzKHBJbnB1dFN0cmVhbSk7Ci0KLSAgICAgICAgaWYgKHByZXNlbnQgIT0gRkFMU0UpCi0gICAgICAgIHsKLSAgICAgICAgICAgIC8qIENvbW1vbkV4aXQoMSwgIkdhaW4gY29udHJvbCBub3QgaW1wbGVtZW50ZWQiKTsgKi8KLSAgICAgICAgICAgIHN0YXR1cyA9IDE7Ci0gICAgICAgIH0KLSAgICB9IC8qIGlmIChzdGF0dXMpICovCi0KLSAgICBpZiAoc3RhdHVzID09IFNVQ0NFU1MpCi0gICAgewotICAgICAgICBzdGF0dXMgPQotICAgICAgICAgICAgaHVmZnNwZWNfZnhwKAotICAgICAgICAgICAgICAgIHBGcmFtZUluZm8sCi0gICAgICAgICAgICAgICAgcElucHV0U3RyZWFtLAotICAgICAgICAgICAgICAgIG5zZWN0LAotICAgICAgICAgICAgICAgIHNlY3QsCi0gICAgICAgICAgICAgICAgcENoVmFycy0+cFNoYXJlV2Z4cENvZWYtPmZhY3RvcnMsCi0gICAgICAgICAgICAgICAgcENoVmFycy0+ZnhwQ29lZiwKLSAgICAgICAgICAgICAgICBwVmFycy0+c2hhcmUuYS5xdWFudFNwZWMsCi0gICAgICAgICAgICAgICAgcFZhcnMtPnNjcmF0Y2gudG1wX3NwZWMsCi0gICAgICAgICAgICAgICAgcFdpbk1hcFtPTkxZX0xPTkdfV0lORE9XXSwKL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0ggKG1hc2tfcHJlc2VudCkKLQotICAgICAgICBDQVNFICgwKToKLSAgICAgICAgICAgIEJSRUFLOwotCi0gICAgICAgIENBU0UgKDIpOgotICAgICAgICAgICAgbndpbiA9IHBGcmFtZUluZm8tPm51bV93aW47Ci0gICAgICAgICAgICBGT1Iod2luID0gMDsgd2luIDwgbndpbjsgd2luID0gKihwR3JvdXArKykpCi0KLSAgICAgICAgICAgICAgICBGT1Ioc2ZiID0gcEZyYW1lSW5mby0+c2ZiX3Blcl93aW5bd2luXTsgc2ZiID4gMDsgc2ZiLS0pCi0gICAgICAgICAgICAgICAgICAgICoocE1hc2srKykgPSAxOwotICAgICAgICAgICAgICAgIEVOREZPUgotCi0gICAgICAgICAgICBFTkRGT1IKLQotICAgICAgICAgICAgQlJFQUs7Ci0KLSAgICAgICAgQ0FTRSgxKToKLQotICAgICAgICAgICAgbndpbiA9IHBGcmFtZUluZm8tPm51bV93aW47Ci0KLSAgICAgICAgICAgICAgICBuVG9EbyA9IG1heF9zZmI7Ci0KLSAgICAgICAgICAgICAgICBXSElMRSAoblRvRG8gPiAwKQotICAgICAgICAgICAgICAgICAgICBuQ2FsbCA9IG5Ub0RvOwotCi0gICAgICAgICAgICAgICAgICAgIElGIChuQ2FsbCA+IE1BWF9HRVRCSVRTKQotICAgICAgICAgICAgICAgICAgICBUSEVOCi0gICAgICAgICAgICAgICAgICAgICAgICBuQ2FsbCA9IE1BWF9HRVRCSVRTOwotICAgICAgICAgICAgICAgICAgICBFTkRJRgotCi0gICAgICAgICAgICAgICAgICAgIHRlbXBNYXNrID0KLSAgICAgICAgICAgICAgICAgICAgICAgIGdldGJpdHMoCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgbkNhbGwsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgcElucHV0U3RyZWFtKTsKLQotICAgICAgICAgICAgICAgICAgICBiaXRtYXNrID0gMSA8PCAobkNhbGwgLSAxKTsKLSAgICAgICAgICAgICAgICAgICAgRk9SIChz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RFTkRFRF9NU19NQVNLIGNhc2VzICovCi0gICAgICAgICAgICAvKiBubyBtcyBhdCBhbGwgKi8KLSAgICAgICAgICAgIGJyZWFrOwotCi0gICAgICAgIGNhc2UoTUFTS19BTExfRlJBTUUpOgotICAgICAgICAgICAgLyogTVMgZm9yIHdob2xlIHNwZWN0cnVtIG9uLCBtYXNrIGJpdHMgc2V0IHRvIDEgKi8KLSAgICAgICAgICAgIG53aW4gPSBwRnJhbWVJbmZvLT5udW1fd2luOwotICAgICAgICAgICAgZm9yICh3aW4gPSAwOyB3aW4gPCBud2luOyB3aW4gPSAqKHBHcm91cCsrKSkKLSAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICBmb3IgKHNmYiA9IHBGcmFtZUluZm8tPnNmYl9wZXJfd2luW3dpbl07IHNmYiA+IDA7IHNmYi0tKQotICAgICAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAgICAgKihwTWFzaysrKSA9IDE7IC8qIGNhbm5vdCB1c2UgbWVtc2V0IGZvciBJbnQgdHlwZSAqLwotICAgICAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgfQotCi0gICAgICAgICAgICBicmVhazsKLQotICAgICAgICBjYXNlKE1BU0tfRlJPTV9CSVRTVFJFQU0pOgotICAgICAgICAgICAgLyogTVNfbWFza19wcmVzZW50PT0xLCBnZXQgbWFzayBpbmZvcm1hdGlvbiovCi0gICAgICAgICAgICBud2luID0gcEZyYW1lSW5mby0+bnVtX3dpbjsKLSAgICAgICAgICAgIGZvciAod2luID0gMDsgd2luIDwgbndpbjsgd2luID0gKihwR3JvdXArKykpCi0gICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgLyoKLSAgICAgICAgICAgICAgICAgKiB0aGUgZm9sbG93aW5nIGNvZGUgaXMgZXF1aXZhbGVudCB0bwotICAgICAgICAgICAgICAgICAqCi0gICAgICAgICAgICAgICAgICogZm9yKHNmYiA9IG1heF9zZmI7IHNmYiA+IDA7IHNmYi0tKQotICAgICAgICAgICAgICAgICAqIHsKLSAgICAgICAgICAgICAgICAgKiAgICoocE1hc2srKykgPQotICAgICAgICAgICAgICAgICAqICAgICAgIGdldGJpdHMoCi0gICAgICAgICAgICAgICAgICogICAgICAgICAgIExFTl9NQVNLLAotICAgICAgICAgICAgICAgICAqICAgICAgICAgICBwSW5wdXRTdHJlYW0pOwotICAgICAgICAgICAgICAgICAqIH0KLSAgICAgICAgICAgICAgICAgKgotICAgICAgICAgICAgICAgICAqIGluIG9yZGVyIHRvIHNhdmUgdGhlIGNhbGxzIHRvIGdldGJpdHMsIHRoZSBhYm92ZQotICAgICAgICAgICAgICAgICAqIGZvci1sb29wIGlzIGJyb2tlbiBpbnRvIHR3byBwYXJ0cwotICAgICAgICAgICAgICAgICAqLwotCi0gICAgICAgICAgICAgICAgblRvRG8gPSBtYXhfc2ZiOwotCi0gICAgICAgICAgICAgICAgd2hpbGUgKG5Ub0RvID4gMCkKLSAgICAgICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgICAgIG5DYWxsID0gblRvRG87Ci0KLSAgICAgICAgICAgICAgICAgICAgaWYgKG5DYWxsID4gTUFYX0dFVEJJVFMpCi0gICAgICAgICAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAgICAgICAgIG5DYWxsID0gTUFYX0dFVEJJVFM7Ci0gICAgICAgICAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgICAgICAgICB0ZW1wTWFzayA9Ci0gICAgICAgICAgICAgICAgICAgICAgICBnZXRiaXRzKAotICAgICAgICAgICAgICAgICAgICAgICAgICAgIG5DYWxsLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBJbnB1dFN0cmVhbSk7Ci0KLSAgICAgICAgICAgICAgICAgICAgYml0bWFzayA9IChVSW50MzIpIDEgPDwgKG5DYWxsIC0gMSk7Ci0gICAgICAgICAgICAgICAgICAgIGZvciAoc2ZiID0gbkNhbGw7IHNmYiA+IDA7IHNmYi0tKQotICAgICAgICAgICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgICAgICAgICAqKHBNYXNrKyspID0gKEludCkoKHRlbXBNYXNrICYgYml0bWFzaykgPj4gKHNmYiAtIDEpKTsKLSAgICAgICAgICAgICAgICAgICAgICAgIGJpdG1hc2sgPj49IDE7Ci0gICAgICAgICAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgICAgICAgICBuVG9EbyAtPSBuQ2FsbDsKLSAgICAgICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgICAgICAvKgotICAgICAgICAgICAgICAgICAqIHNldCByZW1haW5pbmcgc2ZicyB0byB6ZXJvCi0gICAgICAgICAgICAgICAgICogcmUtdXNlIG5DYWxsIHRvIHNhdmUgb25lIHZhcmlhYmxlIG9uIHN0YWNrCi0gICAgICAgICAgICAgICAgICovCi0KLSAgICAgICAgICAgICAgICBuQ2FsbCA9IHBGcmFtZUluZm8tPnNmYl9wZXJfd2luW3dpbl0gLSBtYXhfc2ZiOwotCi0KLSAgICAgICAgICAgICAgICBpZiAobkNhbGwgPj0gMCkKLSAgICAgICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgICAgIHB2X21lbXNldChwTWFzaywKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDAsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICBuQ2FsbCpzaXplb2YoKnBNYXNrKSk7Ci0KLSAgICAgICAgICAgICAgICAgICAgcE1hc2sgKz0gbkNhbGw7Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgIGVsc2UKLSAgICAgICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgICAgIG1hc2tfcHJlc2VudCA9IE1BU0tfRVJST1I7Ci0gICAgICAgICAgICAgICAgICAgIGJyZWFrOwotICAgICAgICAgICAgICAgIH0KLQotCi0gICAgICAgICAgICB9IC8qIGZvciAod2luKSAqLwotCi0gICAgICAgICAgICBicmVhazsKLQotICAgICAgICBkZWZhdWx0OgotICAgICAgICAgICAgLyogZXJyb3IgKi8KLSAg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wOSwKLSAgICAweDEzMDAwOSwKLSAgICAweDNkMDAwOSwKLSAgICAweDMzMDAwOSwKLSAgICAweDJmMDAwOSwKLSAgICAweDIzMDAwOSwKLSAgICAweDIxMDAwOSwKLSAgICAweDM3MDAwOSwKLSAgICAweDQxMDAwOSwKLSAgICAweDJkMDAwOSwKLSAgICAweDE5MDAwOSwKLSAgICAweGYwMDA5LAotICAgIDB4NzAwMDksCi0gICAgMHgxZDAwMDksCi0gICAgMHgzYjAwMDksCi0gICAgMHgzOTAwMDksCi0gICAgMHgxNTAwMDksCi0gICAgMHgxMDAwOSwKLSAgICAweDFiMDAwOSwKLSAgICAweDM1MDAwOSwKLSAgICAweDQ1MDAwOSwKLSAgICAweDRkMDAwOSwKLSAgICAweDE3MDAwOSwKLSAgICAweDRmMDAwOSwKLSAgICAweDUwMDBhLAotICAgIDB4NTAwMGEsCi0gICAgMHg5MDAwYSwKLSAgICAweDkwMDBhLAotICAgIDB4NGIwMDBhLAotICAgIDB4NGIwMDBhLAotICAgIDB4M2YwMDBhLAotICAgIDB4M2YwMDBhLAotICAgIDB4YjAwMGEsCi0gICAgMHhiMDAwYSwKLSAgICAweDMwMDBhLAotICAgIDB4MzAwMGEsCi0gICAgMHgxMTAwMGEsCi0gICAgMHgxMTAwMGEsCi0gICAgMHg0NzAwMGEsCi0gICAgMHg0NzAwMGEsCi0gICAgMHgzYzAwMGIsCi0gICAgMHgxNDAwMGIsCi0gICAgMHgxODAwMGIsCi0gICAgMHgzODAwMGIsCi0gICAgMHg1MDAwMGIsCi0gICAgMHg4MDAwYiwKLSAgICAweDQ4MDAwYiwKLSAgICAweDYwMDBiLAotICAgIDB4YiwKLSAgICAweDRhMDAwYiwKLSAgICAweDNlMDAwYiwKLSAgICAweDFhMDAwYiwKLSAgICAweDEyMDAwYiwKLSAgICAweDIwMDBiLAotICAgIDB4MzYwMDBiLAotICAgIDB4NGUwMDBiCi19OwotCi1jb25zdCBJbnQzMiBodWZmX3RhYjJbOTBdID0KLX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AwNywKLSAgICAweDNiMDAwOCwKLSAgICAweDE1MDAwOCwKLSAgICAweDcwMDA4LAotICAgIDB4MTEwMDA4LAotICAgIDB4NTAwMDgsCi0gICAgMHgzMDAwOCwKLSAgICAweDFiMDAwOCwKLSAgICAweDQ1MDAwOCwKLSAgICAweDNmMDAwOCwKLSAgICAweDJkMDAwOCwKLSAgICAweDM1MDAwOCwKLSAgICAweDE3MDAwOCwKLSAgICAweDkwMDA4LAotICAgIDB4MzMwMDA4LAotICAgIDB4MzkwMDA4LAotICAgIDB4MjMwMDA4LAotICAgIDB4NGQwMDA4LAotICAgIDB4M2MwMDA4LAotICAgIDB4MTQwMDA4LAotICAgIDB4MzgwMDA5LAotICAgIDB4OSwKLSAgICAweDE4MDAwOSwKLSAgICAweDFhMDAwOSwKLSAgICAweDUwMDAwOSwKLSAgICAweDYwMDA5LAotICAgIDB4M2UwMDA5LAotICAgIDB4MTIwMDA5LAotICAgIDB4ODAwMDksCi0gICAgMHg0ODAwMDksCi0gICAgMHgzNjAwMDksCi0gICAgMHgyMDAwOSwKLSAgICAweDRhMDAwOSwKLSAgICAweDRlMDAwOQotfTsKLQotY29uc3QgSW50MzIgaHVmZl90YWIzWzE1MV0gPQotewotICAgIDB4MWIwMDA0LAotICAgIDB4MWIwMDA0LAotICAgIDB4MWIwMDA0LAotICAgIDB4MWIwMDA0LAotICAgIDB4MTAwMDQsCi0gICAgMHgxMDAwNCwKLSAgICAweDEwMDA0LAotICAgIDB4MTAwMDQsCi0gICAgMHg5MDAwNCwKLSAgICAweDkwMDA0LAotICAgIDB4OTAwMDQsCi0gICAgMHg5MDAwNCwKLSAgICAweDMwMDA0LAotICAgIDB4MzAwMDQsCi0gICAgMHgzMDAwNCwKLSAgICAweDMwMDA0LAotICAgIDB4MjQwMDA1LAotICAgIDB4MjQwMDA1LAotICAgIDB4NDAwMDUsCi0gICAgMHg0MDAwNSwKLSAgICAweGMwMDA2LAotICAgIDB4YTAwMDYsCi0gICAgMHgxZTAwMDYsCi0gICAgMHhkMDAwNiwKLSAgICAweDFjMDAwNiwKLSAgICAweDI3MDAwNiwKLSAgICAweDI4MDAwNywKLSAgICAweDI4MDAwNywKLSAgICAweDI4MDAwNywKLSAgICAweDI4MDAwNywKLSAgICAweDFmMDAwNywKLSAgICAweDFmMDAwNywKLSAgICAweDFmMDAwNywKLSAgICAweDFmMDAwNywKLSAgICAweDI1MDAwNywKLSAgICAweDI1MDAwNywKLSAgICAweDI1MDAwNywKLSAgICAweDI1MDAwNywKLSAgICAweDM2MDAwOCwKLSAgICAweDM2MDAwOCwKLSAgICAweDIwMDA4LAotICAgIDB4MjAwMDgsCi0gICAgMHg1MDAwOCwKLSAgICAweDUwMDA4LAotICAgIDB4M2YwMDA4LAotICAgIDB4M2YwMDA4LAotICAgIDB4MzAwMDA4LAotICAgIDB4MzAwMDA4LAotICAgIDB4NzAwMDksCi0gICAgMHgxMDAwMDksCi0gICAgMHgyZDAwMDksCi0gICAgMHhlMDAwOSwKLSAgICAweDQyMDAwOSwKLSAgICAweDYwMDA5LAotICAgIDB4MTUwMDA5LAotICAgIDB4ZjAwMDksCi0gICAgMHgxMjAwMDksCi0gICAgMHhiMDAwOSwKLSAgICAweDM5MDAwOSwKLSAgICAweDMxMDAwOSwKLSAgICAweDE2MDAwOSwKLSAgICAweDJhMDAwOSwKLSAgICAweDJiMDAwOSwKLSAgICAweDJlMDAwYSwKLSAgICAweDIxMDAwYSwKLSAgICAweDIyMDAwYSwKLSAgICAweDEzMDAwYSwKLSAgICAweDQzMDAwYSwKLSAgICAweDI5MDAwYSwKLSAgICAweDQwMDAwYSwKLSAgICAweDIwMDAwYSwKLSAgICAweDgwMDBhLAotICAgIDB4MTEwMDBhLAotICAgIDB4NGIwMDBhLAotICAgIDB4MzMwMDBhLAotICAgIDB4MWQwMDBhLAotICAgIDB4MzcwMDBhLAotICAgIDB4MTkwMDBhLAotICAgIDB4NDgwMDBiLAotICAgIDB4NDgwMDBiLAotICAgIDB4MzQwMDBiLAotICAgIDB4MzQwMDBiLAotICAgIDB4MjYwMDBiLAotICAgIDB4MjYwMDBiLAotICAgIDB4M2EwMDBiLAotICAgIDB4M2EwMDBiLAotICAgIDB4MmMwMDBiLAotICAgIDB4MmMwMDBiLAotICAgIDB4NGMwMDBiLAotICAgIDB4NGMwMDBiLAotICAgIDB4MTgwMDBiLAotICAgIDB4MTgwMDBiLAotICAgIDB4MTcwMDBiLAotICAgIDB4MTcwMDBiLAotICAgIDB4MjMwMDBjLAotICAgIDB4NDkwMDBjLAotICAgIDB4NDUwMDBjLAotICAgIDB4NGUwMDBjLAotICAgIDB4MWEwMDBjLAotICAgIDB4NGYwMDBjLAotICAgIDB4NDYwMDBjLAotICAgIDB4MzIwMDBjLAotICAgIDB4MzUwMDBjLAotICAgIDB4MTQwMDBkLAotICAgIDB4MTQwMDBkLAotICAgIDB4MTQwMDBkLAotICAgIDB4MTQwMDBkLAotICAgIDB4MTQwMDBkLAotICAgIDB4MTQwMDBkLAotICAgIDB4MTQwMDBkLAotICAgIDB4MTQwMDBkLAotICAgIDB4M2MwMDBkLAotICAgIDB4M2MwMDBkLAotICAgIDB4M2MwMDBkLAotICAgIDB4M2MwMDBkLAotICAgIDB4M2MwMDBkLAotICAgIDB4M2MwMDBkLAotICAgIDB4M2MwMDBkLAotICAgIDB4M2MwMDBkLAotICAgIDB4MmYwMDBkLAotICAgIDB4MmYwMDBkLAotICAgIDB4MmYwMDBkLAotICAgIDB4MmYwMDBkLAotICAgIDB4MmYwMDBkLAotICAgIDB4MmYwMDBkLAotICAgIDB4MmYwMDBkLAotICAgIDB4MmYwMDBkLAotICAgIDB4M2QwMDBlLAotICAgIDB4M2QwMDBlLAotICAgIDB4M2QwMDBlLAotICAgIDB4M2QwMDBlLAotICAgIDB4NDQwMDBlLAotICAgIDB4NDQwMDBlLAotICAgIDB4NDQwMDBlLAotICAgIDB4NDQwMDBlLAotICAgIDB4NDEwMDBlLAotICAgIDB4NDEwMDBlLAotICAgIDB4NDEwMDBlLAotICAgIDB4NDEwMDBlLAotICAgIDB4NTAwMDBmLAotICAgIDB4NTAwMDBmLAotICAgIDB4NGQwMDBmLAotICAgIDB4NGQwMDBmLAotICAgIDB4NDcwMDBmLAotICAgIDB4NDcwMDBmLAotICAgIDB4M2IwMDBmLAotICAgIDB4M2IwMDBmLAotICAgIDB4MzgwMDBmLAotICAgIDB4MzgwMDBmLAotICAgIDB4NGEwMDEwLAotICAgIDB4M2UwMDEwCi19OwotCi1jb25zdCBJbnQzMiBodWZmX3RhYjRbMTE5XSA9Ci17Ci0gICAgMHgyODAwMDQsCi0gICAgMHgyODAwMDQsCi0gICAgMHhkMDAwNCwKLSAgICAweGQwMDA0LAotICAgIDB4MjUwMDA0LAotICAgIDB4MjUwMDA0LAotICAgIDB4MjcwMDA0LAotICAgIDB4MjcwMDA0LAotICAgIDB4MWYwMDA0LAotICAgIDB4MWYwMDA0LAotICAgIDB4MWIwMDA0LAotICAgIDB4MWIwMDA0LAotICAgIDB4MjQwMDA0LAotICAgIDB4MjQwMDA0LAotICAgIDB4NCwKLSAgICAweDQsCi0gICAgMHg0MDAwNCwKLSAgICAweDQwMDA0LAotICAgIDB4MWUwMDA0LAotICAgIDB4MWUwMDA0LAotICAgIDB4MWMwMDA1LAotICAgIDB4YzAwMDUsCi0gICAgMHgxMDAwNSwKLSAgICAweGEwMDA1LAotICAgIDB4MzAwMDUsCi0gICAgMHg5MDAwNSwKLSAgICAweDQzMDAwNywKLSAgICAweDQzMDAwNywKLSAgICAweDJiMDAwNywKLSAgICAweDJiMDAwNywKLSAgICAweDMxMDAwNywKLSAgICAweDMxMDAwNywKLSAgICAweDI5MDAwNywKLSAgICAweDI5MDAwNywKLSAgICAweDQyMDAwNywKLSAgICAweDQyMDAwNywKLSAgICAweDQwMDAwNywKLSAgICAweDQwMDAwNywKLSAgICAweDMwMDAwNywKLSAgICAweDMwMDAwNywKLSAgICAweDNhMDAwNywKLSAgICAweDNhMDAwNywKLSAgICAweDEwMDAwNywKLSAgIC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AgICAweDNmMDAwYywKLSAgICAweDNmMDAwYywKLSAgICAweDEwMDBjLAotICAgIDB4MTAwMGMsCi0gICAgMHg3MDAwYywKLSAgICAweDcwMDBjLAotICAgIDB4NDcwMDBjLAotICAgIDB4NDcwMDBjLAotICAgIDB4MTEwMDBjLAotICAgIDB4MTEwMDBjLAotICAgIDB4NGYwMDBjLAotICAgIDB4NGYwMDBjLAotICAgIDB4NDkwMDBjLAotICAgIDB4NDkwMDBjLAotICAgIDB4OTAwMGMsCi0gICAgMHg5MDAwYywKLSAgICAweDQ4MDAwZCwKLSAgICAweDgwMDBkLAotICAgIDB4NTAwMDBkLAotICAgIDB4ZAotfTsKLWNvbnN0IEludDMyIGh1ZmZfdGFiNlsxMTNdID0KLXsKLSAgICAweDI4MDAwNCwKLSAgICAweDMxMDAwNCwKLSAgICAweDI3MDAwNCwKLSAgICAweDI5MDAwNCwKLSAgICAweDFmMDAwNCwKLSAgICAweDMyMDAwNCwKLSAgICAweDIwMDAwNCwKLSAgICAweDMwMDAwNCwKLSAgICAweDFlMDAwNCwKLSAgICAweDM5MDAwNiwKLSAgICAweDM5MDAwNiwKLSAgICAweDNiMDAwNiwKLSAgICAweDNiMDAwNiwKLSAgICAweDE3MDAwNiwKLSAgICAweDE3MDAwNiwKLSAgICAweDE1MDAwNiwKLSAgICAweDE1MDAwNiwKLSAgICAweDE2MDAwNiwKLSAgICAweDE2MDAwNiwKLSAgICAweDIxMDAwNiwKLSAgICAweDIxMDAwNiwKLSAgICAweDNhMDAwNiwKLSAgICAweDNhMDAwNiwKLSAgICAweDJmMDAwNiwKLSAgICAweDJmMDAwNiwKLSAgICAweDMzMDAwNiwKLSAgICAweDMzMDAwNiwKLSAgICAweDI2MDAwNiwKLSAgICAweDI2MDAwNiwKLSAgICAweDFkMDAwNiwKLSAgICAweDFkMDAwNiwKLSAgICAweDJhMDAwNiwKLSAgICAweDJhMDAwNiwKLSAgICAweDM4MDAwNiwKLSAgICAweDM4MDAwNiwKLSAgICAwe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mMwMDA5LAotICAgIDB4OTAwMGEsCi0gICAgMHg5MDAwYSwKLSAgICAweDExMDAwYSwKLSAgICAweDExMDAwYSwKLSAgICAweDNmMDAwYSwKLSAgICAweDNmMDAwYSwKLSAgICAweDQ5MDAwYSwKLSAgICAweDQ5MDAwYSwKLSAgICAweDQ3MDAwYSwKLSAgICAweDQ3MDAwYSwKLSAgICAweDRmMDAwYSwKLSAgICAweDRmMDAwYSwKLSAgICAweDcwMDBhLAotICAgIDB4NzAwMGEsCi0gICAgMHgxMDAwYSwKLSAgICAweDEwMDBhLAotICAgIDB4NTAwMDBiLAotICAgIDB4ODAwMGIsCi0gICAgMHhiLAotICAgIDB4NDgwMDBiCi19OwotCi1jb25zdCBJbnQzMiBodWZmX3RhYjdbMTA3XSA9Ci17Ci0gICAgMHg4MDAwMywKLSAgICAweDgwMDAzLAotICAgIDB4ODAwMDMsCi0gICAgMHg4MDAwMywKLSAgICAweDgwMDAzLAotICAgIDB4ODAwMDMsCi0gICAgMHg4MDAwMywKLSAgICAweDgwMDAzLAotICAgIDB4MTAwMDMsCi0gICAgMHgxMDAwMywKLSAgICAweDEwMDAzLAotICAgIDB4MTAwMDMsCi0gICAgMHgxMDAwMywKLSAgICAweDEwMDAzLAotICAgIDB4MTAwMDMsCi0gICAgMHgxMDAwMywKLSAgICAweDkwMDA0LAotICAgIDB4OTAwMDQsCi0gICAgMHg5MDAwNCwKLSAgICAweDkwMDA0LAotICAgIDB4MTEwMDA2LAotICAgIDB4YTAwMDYsCi0gICAgMHgxMDAwMDYsCi0gICAgMHgyMDAwNiwKLSAgICAweDE5MDAwNywKLSAgICAweDE5MDAwNywKLSAgICAweGIwMDA3LAotICAgIDB4YjAwMDcsCi0gICAgMHgxMjAwMDcsCi0gICAgMHgxMjAwMDcsCi0gICAgMHgxODAwMDcsCi0gICAgMHgxODAwMDcsCi0gICAgMHgzMDAwNywKLSAgICAweDMwMDA3LAotICAgIDB4MTMwMDA4LAotICAgIDB4MWEwMDA4LAotIC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AotICAgIDB4MmUwMDBiLAotICAgIDB4MmUwMDBiLAotICAgIDB4M2MwMDBiLAotICAgIDB4M2MwMDBiLAotICAgIDB4MjcwMDBiLAotICAgIDB4MjcwMDBiLAotICAgIDB4MmYwMDBiLAotICAgIDB4MmYwMDBiLAotICAgIDB4M2QwMDBiLAotICAgIDB4M2QwMDBiLAotICAgIDB4M2UwMDBjLAotICAgIDB4MzYwMDBjLAotICAgIDB4MzcwMDBjLAotICAgIDB4M2YwMDBjCi19OwotY29uc3QgSW50MzIgaHVmZl90YWI4WzkwXSA9Ci17Ci0gICAgMHg5MDAwMywKLSAgICAweDkwMDAzLAotICAgIDB4OTAwMDMsCi0gICAgMHg5MDAwMywKLSAgICAweDExMDAwNCwKLSAgICAweDExMDAwNCwKLSAgICAweDgwMDA0LAotICAgIDB4ODAwMDQsCi0gICAgMHhhMDAwNCwKLSAgICAweGEwMDA0LAotICAgIDB4MTAwMDQsCi0gICAgMHgxMDAwNCwKLSAgICAweDEyMDAwNCwKLSAgICAweDEyMDAwNCwKLSAgICAweDUsCi0gICAgMHgxMDAwMDUsCi0gICAgMHgyMDAwNSwKLSAgICAweDE5MDAwNSwKLSAgICAweGIwMDA1LAotICAgIDB4MWEwMDA1LAotICAgIDB4MTMwMDA1LAotICAgIDB4MWIwMDA2LAotICAgIDB4MWIwMDA2LAotICAgIDB4MjEwMDA2LAotICAgIDB4MjEwMDA2LAotICAgIDB4YzAwMDYsCi0gICAgMHhjMDAwNiwKLSAgICAweDIyMDAwNiwKLSAgICAweDIyMDAwNiwKLSAgICAweDE0MDAwNiwKLSAgICAweDE0MDAwNiwKLSAgICAweDE4MDAwNiwKLSAgICAweDE4MDAwNiwKLSAgICAweDMwMDA2LAotICAgIDB4MzAwMDYsCi0gICAgMHgyMzAwMDYsCi0gICAgMHgyMzAwMDYsCi0gICAgMHgxYzAwMDYsCi0gICAgMHgxYzAwMDYsCi0gICAgMHgyYTAwMDYsCi0gICAgMHgyYTAwMDYsCi0gICAgMHgyOTAwMDcsCi0gICAgMHgxNTAwMDcsCi0gICAgMHhkMDAwNywKLSAgICAweDJiMDAwNywKLSAgICAweDFkMDAwNywKLSAgICAweDI0MDAwNywKLSAgICAweDJjMDAwNywKLSAgICAweDQwMDA3LAotICAgIDB4MjUwMDA3LAotICAgIDB4MjAwMDA3LAotICAgIDB4MTYwMDA3LAotICAgIDB4MzIwMDA3LAotICAgIDB4MzEwMDA3LAotICAgIDB4ZTAwMDcsCi0gICAgMHgxZTAwMDgsCi0gICAgMHgzMzAwMDgsCi0gICAgMHgyZDAwMDgsCi0gICAgMHgyODAwMDgsCi0gICAgMHgzNDAwMDgsCi0gICAgMHg1MDAwOCwKLSAgICAweDI2MDAwOCwKLSAgICAweDM5MDAwOCwKLSAgICAweDNhMDAwOCwKLSAgICAweDE3MDAwOCwKLSAgICAweDM1MDAwOCwKLSAgICAweDNiMDAwOCwKLSAgICAweGYwMDA4LAotICAgIDB4MmUwMDA4LAotICAgIDB4MWYwMDA4LAotICAgIDB4MzYwMDA5LAotICAgIDB4MzYwMDA5LAotICAgIDB4M2MwMDA5LAotICAgIDB4M2MwMDA5LAotICAgIDB4MzAwMDA5LAotICAgIDB4MzAwMDA5LAotICAgIDB4MjcwMDA5LAotICAgIDB4MjcwMDA5LAotICAgIDB4NjAwMDksCi0gICAgMHg2MDAwOSwKLSAgICAweDNkMDAwOSwKLSAgICAweDNkMDAwOSwKLSAgICAweDNlMDAwOSwKLSAgICAweDNlMDAwOSwKLSAgICAweDM3MDAwOSwKLSAgICAweDM3MDAwOSwKLSAgICAweDJmMDAwYSwKLSAgICAweDM4MDAwYSwKLSAgICAweDcwMDBhLAotICAgIDB4M2YwMDBhCi19OwotY29uc3QgSW50MzIgaHVmZl90YWI5WzIwNF0gPQotewotICAgIDB4MSwKLSAgICAweDEsCi0gICAgMHgxLAotICAgIDB4MSwKLSAgICAweDEsCi0gICAgMHgxLAotICAgIDB4MSwKLSAgICAweDEsCi0gICAgMHhkMDAwMywKLSAgICAweGQwMDAzLAotICAgIDB4MTAwMDMsCi0gICAgMHgxMDAwMywKLSAgICAweGUwMDA0LAotICAgIDB4MWIwMDA2LAotICAgIDB4MWIwMDA2LAotICAgIDB4ZjAwMDYsCi0gICAgMHhmMDAwNiwKLSAgICAweDFhMDAwNiwKLSAgICAweDFhMDAwNiwKLSAgICAweDIwMDA2LAotICAgIDB4MjAwMDYsCi0gICAgMHgyODAwMDcsCi0gICAgMHgxYzAwMDcsCi0gICAgMHgxMDAwMDcsCi0gICAgMHgyNzAwMDgsCi0gICAgMHgyNzAwMDgsCi0gICAgMHgzMDAwOCwKLSAgICAweDMwMDA4LAotICAgIDB4MWQwMDA4LAotICAgIDB4MWQwMDA4LAotICAgIDB4MjkwMDA4LAotICAgIDB4MjkwMDA4LAotICAgIDB4MTEwMDA4LAotICAgIDB4MTEwMDA4LAotICAgIDB4MzUwMDA4LAotICAgIDB4MzUwMDA4LAotICAgIDB4MWUwMDA4LAotICAgIDB4MWUwMDA4LAotICAgIDB4MTIwMDA4LAotICAgIDB4MTIwMDA4LAotICAgIDB4MzYwMDA5LAotICAgIDB4MmEwMDA5LAotICAgIDB4NDAwMDksCi0gICAgMHgzNDAwMDksCi0gICAgMHg0MjAwMDksCi0gICAgMHgxZjAwMDksCi0gICAgMHgxMzAwMDksCi0gICAgMHgyYjAwMDksCi0gICAgMHg0MzAwMDksCi0gICAgMHg0ZjAwMDksCi0gICAgMHgzNzAwMDksCi0gICAgMHg1MDAwYSwKLSAgICAweDIwMDAwYSwKLSAgICAweDQxMDAwYSwKLSAgICAweDE0MDAwYSwKLSAgICAweDJjMDAwYSwKLSAgICAweDE1MDAwYSwKLSAgICAweDY5MDAwYSwKLSAgICAweDM4MDAwYSwKLSAgICAweDQ0MDAwYSwKLSAgICAweDUwMDAwYSwKLSAgICAweDVjMDAwYSwKLSAgICAweDYwMDBhLAotICAgIDB4NmEwMDBhLAotICAgIDB4MjIwMDBhLAotICAgIDB4MmQwMDBhLAotICAgIDB4MjEwMDBhLAotICAgIDB4MzkwMDBhLAotICAgIDB4NzYwMDBhLAotICAgIDB4MTYwMDBhLAotICAgIDB4NWQwMDBhLAotICAgIDB4NGUwMDBiLAotICAgIDB4NDUwMDBiLAotICAgIDB4NTEwMDBiLAotICAgIDB4NmIwMDBiLAotICAgIDB4NzAwMGIsCi0gICAgMHg3NzAwMGIsCi0gICAgMHgyZjAwMGIsCi0gICAgMHgzYTAwMGIsCi0gICAgMHgyZTAwMGIsCi0gICAgMHg4MDAwYiwKLSAgICAweDgzMDAwYiwKLSAgICAweDUyMDAwYiwKLSAgICAweDIzMDAwYiwKLSAgICAweDQ2MDAwYiwKLSAgICAweDY4MDAwYiwKLSAgICAweDViMDAwYiwKLSAgICAweDVlMDAwYiwKLSAgICAweDg0MDAwYiwKLSAgICAweDc4MDAwYiwKLSAgICAweDZjMDAwYiwKLSAgICAweDE3MDAwYiwKLSAgICAweDVmMDAwYiwKLSAgICAweDUzMDAwYiwKLSAgICAweDQ3MDAwYiwKLSAgICAweDNjMDAwYiwKLSAgICAweDNiMDAwYiwKLSAgICAweDMwMDAwYiwKLSAgICAweDkwMDAwYiwKLSAgICAweDQ5MDAwYiwKLSAgICAweDc1MDAwYiwKLSAgICAweDZkMDAwYiwKLSAgICAweDg1MDAwYywKLSAgICAweDI0MDAwYywKLSAgICAweDkwMDBjLAotICAgIDB4OTEwMDBjLAotICAgIDB4NzkwMDBjLAotICAgIDB4NTQwMDBjLAotICAgIDB4OWQwMDBjLAotICAgIDB4M2QwMDBjLAotICAgIDB4NmUwMDBjLAotICAgIDB4MTgwMDBjLAotICAgIDB4N2EwMDBjLAotICAgIDB4ODYwMDBjLAotICAgIDB4NDgwMDBjLAotICAgIDB4NjAwMDBjLAotICAgIDB4MjUwMDBjLAotICAgIDB4MTkwMDBjLAotICAgIDB4OWUwMDBjLAotICAgIDB4OTIwMDBjLAotICAgIDB4MzEwMDBjLAotICAgIDB4NGEwMDBjLAotICAgIDB4NTUwMDBjLAotICAgIDB4NmY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weDc3MDAwOSwKLSAgICAweDRlMDAwOSwKLSAgICAweDU2MDAwOSwKLSAgICAweDc4MDAwOSwKLSAgICAweDMwMDAwOSwKLSAgICAweDc2MDAwOSwKLSAgICAweDIzMDAwOSwKLSAgICAweDYwMDA5LAotICAgIDB4NmUwMDA5LAotICAgIDB4NzkwMDA5LAotICAgIDB4M2QwMDA5LAotICAgIDB4ODQwMDA5LAotICAgIDB4MTYwMDA5LAotICAgIDB4NjIwMDA5LAotICAgIDB4NmYwMDA5LAotICAgIDB4N2EwMDA5LAotICAgIDB4NjMwMDA5LAotICAgIDB4ODUwMDA5LAotICAgIDB4NGEwMDA5LAotICAgIDB4ODYwMDA5LAotICAgIDB4MjQwMDA5LAotICAgIDB4ODMwMDA5LAotICAgIDB4MzEwMDA5LAotICAgIDB4N2IwMDA5LAotICAgIDB4NTcwMDA5LAotICAgIDB4NjgwMDA5LAotICAgIDB4M2UwMDA5LAotICAgIDB4NWIwMDA5LAotICAgIDB4OTEwMDA5LAotICAgIDB4NjQwMDBhLAotICAgIDB4OTIwMDBhLAotICAgIDB4ODgwMDBhLAotICAgIDB4MTcwMDBhLAotICAgIDB4OTAwMDBhLAotICAgIDB4N2MwMDBhLAotICAgIDB4NzAwMGEsCi0gICAgMHg3MDAwMGEsCi0gICAgMHg4NzAwMGEsCi0gICAgMHgzMjAwMGEsCi0gICAgMHg0YjAwMGEsCi0gICAgMHg3MTAwMGEsCi0gICAgMHg5NDAwMGEsCi0gICAgMHg4MDAwYSwKLSAgICAweDkzMDAwYSwKLSAgICAweDI1MDAwYSwKLSAgICAweDY1MDAwYSwKLSAgICAweDU4MDAwYSwKLSAgICAweDg5MDAwYSwKLSAgICAweDNmMDAwYSwKLSAgICAweDE4MDAwYSwKLSAgICAweDllMDAwYSwKLSAgICAweDdkMDAwYSwKLSAgICAweDlmMDAwYSwKLSAgICAweDk1MDAwYSwKLSAgICAweDRjMDAwYSwKLSAgICAweGEwMDAwYSwKLSAgICAweDk2MDAwYSwKLSAgICAweGExMDAwYSwKLSAgICAweDMzMDAwYSwKLSAgICAweDU5MDAwYSwKLSAgICAweDc1MDAwYSwKLSAgICAweDhhMDAwYSwKLSAgICAweDgyMDAwYSwKLSAgICAweDlkMDAwYSwKLSAgICAweDkwMDBhLAotICAgIDB4NDAwMDBhLAotICAgIDB4N2UwMDBhLAotICAgIDB4YTIwMDBhLAotICAgIDB4MjYwMDBhLAotICAgIDB4NzIwMDBhLAotICAgIDB4N2YwMDBiLAotICAgIDB4MTkwMDBiLAotICAgIDB4OTcwMDBiLAotICAgIDB4YTMwMDBiLAotICAgIDB4NjYwMDBiLAotICAgIDB4NGQwMDBiLAotICAgIDB4NWEwMDBiLAotICAgIDB4OGIwMDBiLAotICAgIDB4NzMwMDBiLAotICAgIDB4YTQwMDBiLAotICAgIDB4YTAwMGIsCi0gICAgMHg2NzAwMGIsCi0gICAgMHg4ZjAwMGIsCi0gICAgMHg4YzAwMGIsCi0gICAgMHg5ODAwMGIsCi0gICAgMHg5OTAwMGIsCi0gICAgMHhiMDAwYiwKLSAgICAweDlhMDAwYiwKLSAgICAweDgwMDAwYiwKLSAgICAweDhkMDAwYiwKLSAgICAweDljMDAwYiwKLSAgICAweDc0MDAwYiwKLSAgICAweGE1MDAwYywKLSAgICAweDhlMDAwYywKLSAgICAweDgxMDAwYywKLSAgICAweDliMDAwYywKLSAgICAweGE3MDAwYywKLSAgICAweGMwMDBjLAotICAgIDB4YTYwMDBjLAotICAgIDB4YTgwMDBjCi19OwotY29uc3QgSW50MzIgaHVmZl90YWIxMVszMDFdID0KLXsKLSAgICAweDQsCi0gICAgMHg0LAotICAgIDB4NCwKLSAgICAweDQsCi0gICAgMHgxMjAwMDQsCi0gICAgMHgxMjAwMDQsCi0gICAgMHgxMjAwMDQsCi0gICAgMHgxMjAwMDQsCi0gICAgMHgxMjAwMDA1LAotICAgIDB4MTIwMDAwNSwKLSAgICAweDExMDAwNSwKLSAgICAweDExMDAwNSwKLSAgICAweDEwMDA1LAotICAgIDB4MTAwMDUsCi0gICAgMHgyMzAwMDUsCi0gICAgMHgyMzAwMDUsCi0gICAgMHgxMzAwMDUsCi0gICAgMHgxMzAwMDUsCi0gICAgMHgyNDAwMDUsCi0gICAgMHgyNDAwMDUsCi0gICAgMHgxNDAwMDYsCi0gICAgMHgzNDAwMDYsCi0gICAgMHgzNTAwMDYsCi0gICAgMHgyMjAwMDYsCi0gICAgMHgyNTAwMDYsCi0gICAgMHgyMDAwNiwKLSAgICAweDM2MDAwNiwKLSAgICAweDQ1MDAwNywKLSAgICAweDE1MDAwNywKLSAgICAweDQ2MDAwNywKLSAgICAweDI2MDAwNywKLSAgICAweDQ3MDAwNywKLSAgICAweDM3MDAwNywKLSAgICAweDMzMDAwNywKLSAgICAweDMwMDA3LAotICAgIDB4NTYwMDA3LAotICAgIDB4NTcwMDA3LAotICAgIDB4MjcwMDA3LAotICAgIDB4NDgwMDA3LAotICAgIDB4MTYwMDA3LAotICAgIDB4NTgwMDA3LAotICAgIDB4MzgwMDA3LAotICAgIDB4NTkwMDA3LAotICAgIDB4NDkwMDA4LAotICAgIDB4NjgwMDA4LAotICAgIDB4MjgwMDA4LAotICAgIDB4NjcwMDA4LAotICAgIDB4NjkwMDA4LAotICAgIDB4MzkwMDA4LAotICAgIDB4MTcwMDA4LAotICAgIDB4NTQwMDA4LAotICAgIDB4NDMwMDA4LAotICAgIDB4MTE1MDAwOCwKLSAgICAweDExMzAwMDgsCi0gICAgMHgxMTQwMDA4LAotICAgIDB4NmEwMDA4LAotICAgIDB4MTE2MDAwOCwKLSAgICAweDQ0MDAwOCwKLSAgICAweDRhMDAwOCwKLSAgICAweDQwMDA4LAotICAgIDB4MzIwMDA4LAotICAgIDB4NWEwMDA4LAotICAgIDB4NjUwMDA4LAotICAgIDB4MTE3MDAwOCwKLSAgICAweDExMjAwMDgsCi0gICAgMHgxMTgwMDA4LAotICAgIDB4MjkwMDA4LAotICAgIDB4NzkwMDA4LAotICAgIDB4M2EwMDA4LAotICAgIDB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0gICAgMHgxYTAwMDksCi0gICAgMHhhZDAwMDksCi0gICAgMHg2MDAwOSwKLSAgICAweGFjMDAwOSwKLSAgICAweDlhMDAwOSwKLSAgICAweDllMDAwOSwKLSAgICAweDRlMDAwOSwKLSAgICAweDJjMDAwOSwKLSAgICAweDlmMDAwOSwKLSAgICAweDNkMDAwOSwKLSAgICAweDZmMDAwOSwKLSAgICAweGFlMDAwOSwKLSAgICAweDkwMDAwOSwKLSAgICAweGFmMDAwOSwKLSAgICAweGEwMDAwOSwKLSAgICAweGJlMDAwOSwKLSAgICAweDFiMDAwOSwKLSAgICAweDc3MDAwOSwKLSAgICAweGIwMDAwOSwKLSAgICAweDgwMDAwOSwKLSAgICAweDNlMDAwOSwKLSAgICAweDVmMDAwOSwKLSAgICAweGFiMDAwOSwKLSAgICAweDRmMDAwOSwKLSAgICAweGJkMDAwOSwKLSAgICAweGRmMDAwOSwKLSAgICAweDcwMDAwOSwKLSAgICAweGUwMDAwOSwKLSAgICAweDJkMDAwOSwKLSAgICAweDExMDAwMDksCi0gICAgMHg2MDAwMDksCi0gICAgMHhjMDAwMDksCi0gICAgMHhiZjAwMGEsCi0gICAgMHhhMTAwMGEsCi0gICAgMHg4MTAwMGEsCi0gICAgMHg5MTAwMGEsCi0gICAgMHgxMDAwMGEsCi0gICAgMHg1MTAwMGEsCi0gICAgMHg3MDAwYSwKLSAgICAweDQwMDAwYSwKLSAgICAweGMxMDAwYSwKLSAgICAweGRlMDAwYSwKLSAgICAweGUxMDAwYSwKLSAgICAweGNmMDAwYSwKLSAgICAweDJmMDAwYSwKLSAgICAweGUyMDAwYSwKLSAgICAweDkyMDAwYSwKLSAgICAweDcxMDAwYSwKLSAgICAweGIyMDAwYSwKLSAgICAweGIxMDAwYSwKLSAgICAweGYwMDAwYSwKLSAgICAweGQwMDAwYSwKLSAgICAweDFjMDAwYSwKLSAgICAweDUwMDAwYSwKLSAgICAweGJjMDAwYSwKLSAgICAweDNmMDAwYSwKLSAgICAweDFlMDA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Ci0gICAgbnVtX3NlY3QgICA9ICAwOwotICAgIGJhc2UgICAgICAgPSAgMDsKLSAgICBncm91cF9iYXNlID0gIDA7Ci0KLSAgICAvKiByZWFkIHVudGlsIHRoZSBlbmQgb2Ygb25lIGZyYW1lICovCi0gICAgd2hpbGUgKChiYXNlIDwgdG90X3NmYikgJiYgKG51bV9zZWN0IDwgdG90X3NmYikpCi0gICAgewotCi0gICAgICAgIHBTZWN0LT5zZWN0X2NiICA9IGdldDlfbl9sZXNzYml0cygKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIExFTl9DQiwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBJbnB1dFN0cmVhbSk7IC8qIHNlY3Rpb24gY29kZWJvb2sgKi8KLQotICAgICAgICBzZWN0X2xlbl9pbmNyICAgPSBnZXQ5X25fbGVzc2JpdHMoCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICBiaXRzLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcElucHV0U3RyZWFtKTsgLyogbGVuZ3RoX2luY3IgKi8KLQotCi0gICAgICAgIC8qIHJlYWQgdW50aWwgbm9uLUVTQyB2YWx1ZSwgc2VlIHA1NSByZWZlcmVuY2UgMiAqLwotICAgICAgICB3aGlsZSAoKHNlY3RfbGVuX2luY3IgPT0gZXNjX3ZhbCkgJiYgKGJhc2UgPCB0b3Rfc2ZiKSkKLSAgICAgICAgewotICAgICAgICAgICAgYmFzZSAgICAgICAgICAgICs9ICBlc2NfdmFsOwotCi0gICAgICAgICAgICBzZWN0X2xlbl9pbmNyICAgPSBnZXQ5X25fbGVzc2JpdHMoCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYml0cywKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwSW5wdXRTdHJlYW0pOwotICAgICAgICB9Ci0KLSAgICAgICAgYmFzZSAgICAgICs9IHNlY3RfbGVuX2luY3I7Ci0gICAgICAgIHBTZWN0LT5zZWN0X2Vu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WxsIGNvcGllcyBvciBkZXJpdmF0aXZlCi0gICB3b3Jrcy4iCi0gICBDb3B5cmlnaHQoYykxOTk2LgotCi0gKDIpIElTTy9JRUMgMTQ0OTYtMzogMTk5OShFKQotICAgIFN1YnBhcnQgNCAgICAgICBwMTUgICAgIChzaW5nbGVfY2hhbm5lbF9lbGVtZW50LCBjaGFubmVsX3BhaXJfZWxlbWVudCkKLSAgICAgICAgICAgICAgICAgICAgcDE1ICAgICAoVGFibGUgNC40LjUgICAgZ2V0bWFzaykKLSAgICAgICAgICAgICAgICAgICAgcDE2ICAgICAoVGFibGUgNC40LjYgICAgZ2V0X2ljc19pbmZvKQotICAgICAgICAgICAgICAgICAgICBwMjQgICAgIChUYWJsZSA0LjQuMjQgICBnZXRpY3MpCi0KLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLQotIFBTRVVETy1DT0RFCi0KLSAgICB0YWcgPSBDQUxMIGdldGJpdHMoTEVOX1RBRyxwSW5wdXRTdHJlYW0pCi0gICAgICAgICAgICAgICAgTU9ESUZZSU5HKHBJbnB1dFN0cmVhbSkKLSAgICAgICAgICAgICAgICBSRVRVUk5JTkcodGFnKQotCi0gICAgY29tbW9uX3dpbmRvdyA9IDA7Ci0KLSAgICBJRiAoaWRfc3luX2VsZSA9PSBJRF9DUEUpCi0gICAgVEhFTgotICAgICAgICBjb21tb25fd2luZG93ID0gQ0FMTCBnZXRiaXRzKExFTl9DT01fV0lOLHBJbnB1dFN0cmVhbSk7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIE1PRElGWUlORyhwSW5wdXRTdHJlYW0pCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFJFVFVSTklORyhjb21tb25fd2luZG93KQotICAgIEVORElGCi0KLSAgICBwTWNJbmZvID0gJnBWYXJzLT5tY19pbmZvOwotCi0gICAgSUYgKCAocE1jSW5mby0+Y2hfaW5mb1swXS5jcGUgIT0gaWRfc3luX2VsZSkgT1IKLSAgICAgICAgIChwTWNJbmZvLT5jaF9pbmZvWzBdLnRhZyAhPSB0YWcpICkKLSAgICBUSEVOCi0gICAgICAgIHN0YXR1cyA9IDE7Ci0gICAgRU5ESUYKLQotCi0gICAgSUYgKHN0YXR1cyA9PSBTVUNDRVNTKQotICAgIFRIRU4KLSAgICAgICAgSUYgKGlkX3N5bl9lbGUgPT0gSURfU0NFKQotICAgICAgICBUSEVOCi0KLSAgICAgICAgICAgIGxlZnRDaCAgPSAwOwotICAgICAgICAgICAgUklHSFQgPSAwOwotICAgICAgICAgICAgcENoVmFyc1tsZWZ0Q2hdLT5oYXNtYXNrID0gMDsKLSAgICAgICAgRUxTRUlGIChpZF9zeW5fZWxlID09IElEX0NQRSkKLQotICAgICAgICAgICAgbGVmdENoID0gMDsKLSAgICAgICAgICAgIHJpZ2h0Q2ggID0gMTsKLQotICAgICAgICAgICAgSUYgKGNvbW1vbl93aW5kb3cgIT0gRkFMU0UpCi0gICAgICAgICAgICBUSEVOCi0KLSAgICAgICAgICAgICAgICBDQUxMIGdldF9pY3NfaW5mbygKLSAgICAgICAgICAgICAgICAgICAgICAgIGF1ZGlvT2JqZWN0VHlwZSA9IHBWYXJzLT5tY19pbmZvLmF1ZGlvT2JqZWN0VHlwZSwKLSAgICAgICAgICAgICAgICAgICAgICAgIHBJbnB1dFN0cmVhbSA9IHBJbnB1dFN0cmVhbSwKLSAgICAgICAgICAgICAgICAgICAgICAgIGNvbW1vbl93aW5kb3cgPSBjb21tb25fd2luZG93LAotICAgICAgICAgICAgICAgICAgICAgICAgcFdpbmRvd1NlcXVlbmNlID0gJnBDaFZhcnNbbGVmdENoXS0+d25kLAotICAgICAgICAgICAgICAgICAgICAgICAgJnBDaFZhcnNbbGVmdENoXS0+d25kX3NoYXBlX3RoaXNfYmssCi0gICAgICAgICAgICAgICAgICAgICAgICBwQ2hWYXJzW2xlZnRDaF0tPmdyb3VwLAotICAgICAgICAgICAgICAgICAgICAgICAgJnBDaFZhcnNbbGVmdENoXS0+bWF4X3NmYiwKLSAgICAgICAgICAgICAgICAgICAgICAgIHBWYXJzLT53aW5tYXAsCi0gICAgICAgICAgICAgICAgICAgICAgICAmcENoVmFyc1tsZWZ0Q2hdLT5sdF9zdGF0dXMsCi0gICAgICAgICAgICAgICAgICAgICAgICAmcENoVmFyc1tyaWdodENoXS0+bHRfc3RhdHVzKTsKLSAgICAgICAgICAgICAgICAgICAgIE1PRElGWUlORyhwSW5wdXRTdHJlYW0sIHduZCwgd25kX3NoYXBlX3RoaXNfYmssZ3JvdXAsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbWF4X3NmYiwgbHRfc3RhdHVzKQotICAgICAgICAgICAgICAgICAgICAgUkVUVVJOSU5HKHN0YXR1cykKLQotICAgICAgICAgICAgICAgIElGIChzdGF0dXMgPT0gU1VDQ0VTUykKLSAgICAgICAgICAgICAgICBUSEVOCi0KLSAgICAgICAgICAgICAgICAgICAgcENoVmFyc1tyaWdodENoXS0+d25kID0gcENoVmFyc1tsZWZ0Q2hdLT53bmQ7Ci0gICAgICAgICAgICAgICAgICAgIHBDaFZhcnNbcmlnaHRDaF0tPnduZF9zaGFwZV90aGlzX2JrID0KLSAgICAgICAgICAgICAgICAgICAgICAgIHBDaFZhcnNbbGVmdENoXS0+d25kX3NoYXBlX3RoaXNfYms7Ci0gICAgICAgICAgICAgICAgICAgIHBDaFZhcnNbcmlnaHRDaF0tPm1heF9zZmIgPSBwQ2hWYXJzW2xlZnRDaF0tPm1heF9zZmI7Ci0gICAgICAgICAgICAgICAgICAgIHB2X21lbWNweSgKLSAgICAgICAgICAgICAgICAgICAgICAgIHBDaFZhcnNbcmlnaHRDaF0tPmdyb3VwLAotICAgICAgICAgICAgICAgICAgICAgICAgcENoVmFyc1tsZWZ0Q2hdLT5ncm91cCwKLSAgICAgICAgICAgICAgICAgICAgICAgIE5TSE9SVCpzaXplb2YocENoVmFyc1tsZWZ0Q2hdLT5ncm91cFswXSkpOwotCi0gICAgICAgICAgICAgICAgICAgIGhhc21hc2sgPSBDQUxMIGdldG1hc2soCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwVmFycy0+d2lubWFwW3BDaFZhcnNbbGVmdENoXS0+d25kXSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBJbnB1dFN0cmVhbSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBDaFZhcnNbbGVmdENoXS0+Z3JvdXAsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwQ2hWYXJzW2xlZnRDaF0tPm1heF9zZmIsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwQ2hWYXJzW2xlZnRDaF0tPm1hc2spOwotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBNT0RJRllJTkcocElucHV0U3RyZWFtLCBtYXNrKQotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBSRVRVUk5JTkcoaGFzbWFzaykKLQotICAgICAgICAgICAgICAgICAgICBJRiAoaGFzbWFzayA9PSBNQVNLX0VSUk9SKQotICAgICAgICAgICAgICAgICAgICBUSEVOCi0gICAgICAgICAgICAgICAgICAgICAgICBzdGF0dXMgPSAxOwotICAgICAgICAgICAgICAgICAgICBFTkRJRgotICAgICAgICAgICAgICAgICAgICBwQ2hWYXJzW2xlZnRDaF0tPmhhc21hc2sgID0gaGFzbWFzazsKLSAgICAgICAgICAgICAgICAgICAgcENoVmFyc1tyaWdodENoXS0+aGFzbWFzayA9IGhhc21hc2s7Ci0KLSAgICAgICAgICAgICAgICBFTkRJRgotCi0gICAgICAgICAgICBFTFNFCi0KLSAgICAgICAgICAgICAgICAgcENoVmFyc1tsZWZ0Q2hdLT5oYXNtYXNrICA9IDA7Ci0gICAgICAgICAgICAgICAgIHBDaFZhcnNbcmlnaHRDaF0tPmhhc21hc2sgPSAwOwotICAgICAgICAgICAgRU5ESUYoY29tbW9uX3dpbmRvdykKLQotICAgICAgICBFTkRJRihpZF9zeW5fZWxlKQotCi0gICAgRU5ESUYgKHN0YXR1cykKLQotICAgIGNoID0gbGVmdENoOwotCi0gICAgV0hJTEUoKGNoIDw9IHJpZ2h0Q2gpIEFORCAoc3RhdHVzID09IFNVQ0NFU1MpKQotCi0gICAgICAgIHN0YXR1cyA9IENBTEwgZ2V0aWNzKAotICAgICAgICAgICAgICAgICAgICAgICAgcElucHV0U3RyZWFtLAotICAgICAgICAgICAgICAgICAgICAgICAgY29tbW9uX3dpbmRvdywKLSAgICAgICAgICAgICAgICAgICAgICAgIHBWYXJzLAotICAgICAgICAgICAgICAgICAgICAgICAgcENoVmFyc1tjaF0sCi0gICAgICAgICAgICAgICAgICAgICAgICBwQ2hWYXJzW2NoXS0+Z3JvdXAsCi0gICAgICAgICAgICAgICAgICAgICAgICAmcENoVmFyc1tjaF0tPm1heF9zZmIsCi0gICAgICAgICAgICAgICAgICAgICAgICBwQ2hWYXJzW2NoXS0+Y2JfbWFwLAotICAgICAgICAgICAgICAgICAgICAgICAgJnBDaFZhcnNbY2hdLT50bnMsCi0gICAgICAgICAgICAgICAgICAgICAgICBwVmFycy0+d2lubWFwLAotICAgICAgICAgICAgICAgICAgICAgICAgJnBWYXJzLT5wdWxzZUluZm8sCi0gICAgICAgICAgICAgICAgICAgICAgICBwQ2hWYXJzW2NoXS0+c2VjdCk7Ci0gICAgICAgICAgICAgICAgICAgIE1PRElGWUlORyhwSW5wdXRTdHJlYW0scFZhcnNwLENoVmFyc1tjaF0sZ3JvdXAsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICBtYXhfc2ZiLHRucyxwdWxzZUluZm8sc2VjdCkKLSAgICAgICAgICAgICAgICAgICAgUkVUVVJOSU5HKHN0YXR1cykKLQotICAgICAgICBjaCsrOwotCi0gICAgRU5EV0hJTEUKLQotICAgIFJFVFVSTiBzdGF0dXM7Ci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cgPQotICAgICAgICAgICAgZ2V0MWJpdHMocElucHV0U3RyZWFtKTsKLSAgICB9Ci0KLSAgICBwTWNJbmZvID0gJnBWYXJzLT5tY19pbmZvOwotCi0gICAgLyoKLSAgICAgKiAgY2hlY2sgaWYgcHJvdmlkZWQgaW5mbyAobnVtIG9mIGNoYW5uZWxzKSBvbiBhdWRpbyBjb25maWcsCi0gICAgICogIG1hdGNoZXMgcmVhZCBiaXRzdHJlYW0gZGF0YSwgaWYgbm90LCBhbGxvdyB1cGRhdGUgb25seSBvbmNlLgotICAgICAqICBJbiBhbG1vc3QgYWxsIGNhc2VzIGl0IHNob3VsZCBtYXRjaC4KLSAgICAgKi8KLSAgICBpZiAoKHBNY0luZm8tPmNoX2luZm9bMF0uY3BlICE9IGlkX3N5bl9lbGUpKQotICAgIHsKLSAgICAgICAgaWYgKHBWYXJzLT5tY19pbmZvLmltcGxpY2l0X2NoYW5uZWxpbmcpICAgICAvKiBjaGVjayBkb25lIG9ubHkgb25jZSAqLwotICAgICAgICB7Ci0gICAgICAgICAgICBwTWNJbmZvLT5jaF9pbmZvWzBdLmNwZSA9IGlkX3N5bl9lbGUgJiAxOyAvKiAgY29sbGVjdCBpbmZvIGZyb20gYml0c3RyZWFtCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICogIGltcGxpY2l0X2NoYW5uZWxpbmcgZmxhZyBpcyBsb2NrZWQKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKiAgYWZ0ZXIgMXN0IGZyYW1lLCB0byBhdm9pZCB0b2dnbGluZwotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqICBwYXJhbWV0ZXIgaW4gdGhlIG1pZGRsZSBvZiB0aGUgY2xpcAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotICAgICAgICAgICAgcE1jSW5mby0+bmNoID0gKGlkX3N5bl9lbGUgJiAxKSArIDE7ICAgICAvKiB1cGRhdGUgbnVtYmVyIG9mIGNoYW5uZWxzICovCi0gICAgICAgIH0KLSAgICAgICAgZWxzZQotICAgICAgICB7Ci0gICAgICAgICAgICBzdGF0dXMgPSAxOyAvKiBFUlJPUiBicmVhayBpZiBzeW50YXggZXJyb3IgcGVyc2lzdCAgKi8KLSAgICAgICAgfQotICAgIH0KLQotICAgIGlmIChzdGF0dXMgPT0gU1VDQ0VTUykKLSAgICB7Ci0gICAgICAgIGlmIChpZF9zeW5fZWxlID09IElEX1NDRSkKLSAgICAgICAgewotCi0gICAgICAgICAgICBudW1fY2hhbm5lbHMgPSAxOwotICAgICAgICAgICAgcFZhcnMtPmhhc21hc2sgPSAwOwotICAgICAgICB9Ci0gICAgICAgIGVsc2UgaWYgKGlkX3N5bl9lbGUgPT0gSURfQ1BFKQotICAgICAgICB7Ci0gICAgICAgICAgICBwQ2hMZWZ0U2hhcmUgPSBwQ2hWYXJzW0xFRlRdLT5wU2hhcmVXZnhwQ29lZjsKLSAgICAgICAgICAgIHBDaFJpZ2h0U2hhcmUgPSBwQ2hWYXJzW1JJR0hUXS0+cFNoYXJlV2Z4cENvZWY7Ci0gICAgICAgICAgICBudW1fY2hhbm5lbHMgPSAyOwotCi0gICAgICAgICAgICBpZiAoY29tbW9uX3dpbmRvdyAhPSBGQUxTRSkKLSAgICAgICAgICAgIHsKLQotICAgICAgICAgICAgICAgIHN0YXR1cyA9IGdldF9pY3NfaW5mbygKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKHRNUDRBdWRpb09iamVjdFR5cGUpIHBWYXJzLT5tY19pbmZvLmF1ZGlvT2JqZWN0VHlwZSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcElucHV0U3RyZWFtLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoQm9vbCljb21tb25fd2luZG93LAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoV0lORE9XX1NFUVVFTkNFICopICYgcENoVmFyc1tMRUZUXS0+d25kLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoV0lORE9XX1NIQVBFICopICYgcENoVmFyc1tMRUZUXS0+d25kX3NoYXBlX3RoaXNfYmssCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBDaExlZnRTaGFyZS0+Z3JvdXAsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgIChJbnQgKikgJiBwQ2hMZWZ0U2hhcmUtPm1heF9zZmIsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBWYXJzLT53aW5tYXAsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgIChMVF9QUkVEX1NUQVRVUyAqKSAmIHBDaExlZnRTaGFyZS0+bHRfc3RhdHVzLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoTFRfUFJFRF9TVEFUVVMgKikgJiBwQ2hSaWdodFNoYXJlLT5sdF9zdGF0dXMpOwotCi0gICAgICAgICAgICAgICAgaWYgKHN0YXR1cyA9PSBTVUNDRVNTKQotICAgICAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAgICAgLyogY29weSBsZWZ0IGNoYW5uZWwgaW5mbyB0byByaWdodCBjaGFubmVsICovCi0gICAgICAgICAgICAgICAgICAgIHBDaFZhcnNbUklHSFRdLT53bmQgPSBwQ2hWYXJzW0xFRlRdLT53bmQ7Ci0gICAgICAgICAgICAgICAgICAgIHBDaFZhcnNbUklHSFRdLT53bmRfc2hhcGVfdGhpc19iayA9Ci0gICAgICAgICAgICAgICAgICAgICAgICBwQ2hWYXJzW0xFRlRdLT53bmRfc2hhcGVfdGhpc19iazsKLSAgICAgICAgICAgICAgICAgICAgcENoUmlnaHRTaGFyZS0+bWF4X3NmYiA9IHBDaExlZnRTaGFyZS0+bWF4X3NmYjsKLSAgICAgICAgICAgICAgICAgICAgcHZfbWVtY3B5KAotICAgICAgICAgICAgICAgICAgICAgICAgcENoUmlnaHRTaGFyZS0+Z3JvdXAsCi0gICAgICAgICAgICAgICAgICAgICAgICBwQ2hMZWZ0U2hhcmUtPmdyb3VwLAotICAgICAgICAgICAgICAgICAgICAgICAgTlNIT1JUKnNpemVvZihwQ2hMZWZ0U2hhcmUtPmdyb3VwWzBdKSk7Ci0KLSAgICAgICAgICAgICAgICAgICAgaGFzbWFzayA9IGdldG1hc2soCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcFZhcnMtPndpbm1hcFtwQ2hWYXJzW0xFRlRdLT53bmRdLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBJbnB1dFN0cmVhbSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwQ2hMZWZ0U2hhcmUtPmdyb3VwLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBDaExlZnRTaGFyZS0+bWF4X3NmYiwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwVmFycy0+bWFzayk7Ci0KLSAgICAgICAgICAgICAgICAgICAgaWYgKGhhc21hc2sgPT0gTUFTS19FUlJPUikKLSAgICAgICAgICAgICAgICAgICAgewotICAgICAgICAgICAgICAgICAgICAgICAgc3RhdHVzID0gMTsgLyogRVJST1IgY29kZSAqLwotICAgICAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgICAgIHBWYXJzLT5oYXNtYXNrICA9IGhhc21hc2s7Ci0KLSAgICAgICAgICAgICAgICB9IC8qIGlmIChzdGF0dXMgPT0gMCkgKi8KLSAgICAgICAgICAgIH0KLSAgICAgICAgICAgIGVsc2UKLSAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICBwVmFycy0+aGFzbWFzayAgPSAwOwotICAgICAgICAgICAgfSAvKiBpZiAoY29tbW9uX3dpbmRvdykgKi8KLQotICAgICAgICB9IC8qIGlmIChpZF9zeW5fZWxlKSAqLwotCi0gICAgfSAvKiBpZiAoc3RhdHVzKSAqLwotCi0gICAgY2ggPSAwOwotICAgIHdoaWxlICgoY2ggPCBudW1fY2hhbm5lbHMpICYmIChzdGF0dXMgPT0gU1VDQ0VTUykpCi0gICAgewotICAgICAgICBwQ2hMZWZ0U2hhcmUgPSBwQ2hWYXJzW2NoXS0+cFNoYXJlV2Z4cENvZWY7Ci0KLSAgICAgICAgc3RhdHVzID0gZ2V0aWNzKAotICAgICAgICAgICAgICAgICAgICAgcElucHV0U3RyZWFtLAotICAgICAgICAgICAgICAgICAgICAgY29tbW9uX3dpbmRvdywKLSAgICAgICAgICAgICAgICAgICAgIHBWYXJzLAotICAgICAgICAgICAgICAgICAgICAgcENoVmFyc1tjaF0sCi0gICAgICAgICAgICAgICAgICAgICBwQ2hMZWZ0U2hhcmUtPmdyb3VwLAotICAgICAgICAgICAgICAgICAgICAgJnBDaExlZnRTaGFyZS0+bWF4X3NmYiwKLSAgICAgICAgICAgICAgICAgICAgIHBDaExlZnRTaGFyZS0+Y2JfbWFwLAotICAgICAgICAgICAgICAgICAgICAgJnBDaExlZnRTaGFyZS0+dG5zLAotICAgICAgICAgICAgICAgICAgICAgcFZhcnMtPndpbm1hcCwKLSAgICAgICAgICAgICAgICAgICAgICZwVmFycy0+c2hhcmUuYS5wdWxzZUluZm8sCi0gICAgICAgICAgICAgICAgICAgICBwVmFycy0+c2hhcmUuYS5zZWN0KTsKLQotICAgICAgICBjaCsrOwotCi0gICAgfSAvKiB3aGlsZSAoY2gpICovCi0KLSAgICAvKi0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0KLSAgICA7IFJldHVybiBzdGF0dXMKLSAgICAtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tKi8KLQotICAgIHJldHVybiBzdGF0dXM7Ci0KLX0gLyogaHVmZ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luZm8tPnNmYl9wZXJfd2luW2dyb3VwX2VuZF07Ci0gICAgICAgIGdyb3VwX2VuZCA9ICpwR3JvdXArKzsKLQotICAgICAgICBGT1Ioc2ZiID0gMDsgc2ZiIDwgbnNmYl93aW47IHNmYisrKQotICAgICAgICB7Ci0gICAgICAgICAgICBJRiAoKHBIdWZmQm9va1VzZWRbc2ZiXSA+IDApJiYocEh1ZmZCb29rVXNlZFtzZmJdIDwgQk9PS1NDTCkpCi0gICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgY3dfaW5kZXggPSBDQUxMIGRlY29kZV9odWZmX2N3X2JpbmFyeShwVGFibGUsIHBJbnB1dFN0cmVhbSk7Ci0KLSAgICAgICAgICAgICAgICBmYWMgICAgICArPSBjd19pbmRleCAtIE1JREZBQzsKLQotICAgICAgICAgICAgICAgIElGKChmYWMgPj0gMipURVhQKSB8fCAoZmFjIDwgMCkpCi0gICAgICAgICAgICAgICAgewotICAgICAgICAgICAgICAgICAgICBzdGF0dXMgPSAxOwotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICBFTFNFCi0gICAgICAgICAgICAgICAgewotICAgICAgICAgICAgICAgICAgICBwRmFjdG9yc1tzZmJdID0gZmFjOwotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICBFTkRJRiAoZmFjKQotCi0gICAgICAgICAgICB9Ci0gICAgICAgICAgICBFTFNFIElGIChwSHVmZkJvb2tVc2VkW3NmYl0gPT0gWkVST19IQ0IpCi0gICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgZG8gbm90aGluZzsKLSAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgRUxTRSBJRiAoKHBIdWZmQm9va1VzZWRbc2ZiXSA9PSBJTlRFTlNJVFlfSENCKXx8Ci0gICAgICAgICAgICAgICAgICAgICAocEh1ZmZCb29rVXNlZFtzZmJdID09IElOVEVOU0lUWV9IQ0IyKSkKLSAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICBjd19pbmRleCA9IENBTEwgZGVjb2RlX2h1ZmZfY3dfYmluYXJ5KHBUYWJsZSwgcElucHV0U3RyZWFtKTsKLQotICAgICAgICAgICAgICAgIGlzX3BvcyAgICAgICAgKz0gY3dfaW5kZXggLSBNSURGQUM7Ci0gICAgICAgICAgICAgICAgcEZhY3RvcnNbc2ZiXSA9ICBpc19wb3M7Ci0gICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgIEVMU0UgSUYgKHBIdWZmQm9va1VzZWRbc2ZiXSA9PSBOT0lTRV9IQ0IpCi0gICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgSUYgKG5vaXNlX3BjbV9mbGFnID09IFRSVUUpCi0gICAgICAgICAgICAgICAgewotICAgICAgICAgICAgICAgICAgICBub2lzZV9wY21fZmxhZyA9IEZBTFNFOwotICAgICAgICAgICAgICAgICAgICBkcGNtX25vaXNlX25yZyA9IENBTEwgZ2V0Yml0cygKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBOT0lTRV9QQ01fQklUUywKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwSW5wdXRTdHJlYW0pOwotCi0gICAgICAgICAgICAgICAgICAgIGRwY21fbm9pc2VfbnJnIC09IE5PSVNFX1BDTV9PRkZTRVQ7Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgIEVMU0UKLSAgICAgICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgICAgIGRwY21fbm9pc2VfbnJnID0gQ0FMTCBkZWNvZGVfaHVmZl9jd19iaW5hcnkoCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcFRhYmxlLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBJbnB1dFN0cmVhbSk7Ci0KLSAgICAgICAgICAgICAgICAgICAgZHBjbV9ub2lzZV9ucmcgLT0gTUlERkFDOwotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICBFTkRJRiAobm9pc2VfcGNtX2ZsYWcpCi0KLSAgICAgICAgICAgICAgICBub2lzZV9ucmcgICAgICAgKz0gZHBjbV9ub2lzZV9ucmc7Ci0gICAgICAgICAgICAgICAgcEZhY3RvcnNbc2ZiXSAgID0gIG5vaXNlX25yZzsKLSAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgRUxTRSBJRiAocEh1ZmZCb29rVXNlZFtzZmJdID09IEJPT0tTQ0wpCi0gICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgc3RhdHVzID0gMTsKLSAgICAgICAgICAgIH0KLSAgICAgICAgICAgIEVORElGIChwSHVmZkJvb2tVc2VkW3NmYl0pCi0KLSAgICAgICAgfQotICAgICAgICBFTkRGT1IgKHNmYikKLQotICAgICAgICBJRiAocEZyYW1lSW5mby0+aXNsb25nID09IEZBTFNFKQotICAgICAgICB7Ci0KLSAgICAgICAgICAgIEZPUihncm91cF93aW4rKzsgZ3JvdXBfd2luIDwgZ3JvdXBfZW5kOyBncm91cF93aW4rKykKLSAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICBGT1IgKHNmYj0wOyBzZmIgPCBuc2ZiX3dpbjsgc2ZiKyspCi0gICAgICAgICAgICAgICAgewotICAgICAgICAgICAgICAgICAgICBwRmFjdG9yc1tzZmIgKyBuc2ZiX3dpbl0gID0gIHBGYWN0b3JzW3NmYl07Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgIEVOREZPUgotCi0gICAgICAgICAgICAgICAgcEZhY3RvcnMgICs9ICBuc2ZiX3dpbjsKLSAgICAgICAgICAgIH0KLSAgICAgICAgICAgIEVOREZPUgotCi0gICAgICAgIH0KLSAgICAgICAgRU5ESUYgKHBGcmFtZUluZm8pCi0KLSAgICAgICAgcEh1ZmZCb29rVXNlZCAgICs9IG5zZmJfd2luOwotICAgICAgICBwRmFjdG9ycyAgICAgICAgKz0gbnNmYl93aW47Ci0KLS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RTdHJlYW0sCi0gICAgSW50ICAgICAgICAgKnBHcm91cCwgICAgLyogbWF5IGJlIGNoYW5nZWQgdG8gSW50ICovCi0gICAgSW50ICAgICAgICAgbnNlY3QsCi0gICAgU2VjdEluZm8gICAgKnBTZWN0LCAgICAgLyogbWF5IGJlIGNoYW5nZWQgdG8gSW50ICovCi0gICAgSW50ICAgICAgICAgZ2xvYmFsX2dhaW4sCi0gICAgSW50ICAgICAgICAgKnBGYWN0b3JzLAotICAgIEludCAgICAgICAgIGh1ZmZCb29rVXNlZFtdKQotewotICAgIEludCAgICAgc2VjdF9pZHg7Ci0gICAgSW50ICAgICBncm91cF9lbmQ7ICAvKiBpbmRleCBvZiAxc3Qgd2luZG93IGluIG5leHQgZ3JvdXAgKi8KLSAgICBJbnQgICAgIGdyb3VwX3dpbjsgIC8qIHdpbmRvdyBpbmRleCB3aXRoaW4gZ3JvdXAgKi8KLSAgICBJbnQgICAgIGN3X2luZGV4OyAgIC8qIGh1ZmYgY29kZXdvcmQgaW5kZXggKi8KLSAgICBJbnQgICAgIG5zZmJfd2luOyAgIC8qICMgb2Ygc2NmYmFuZHMgcGVyIHdpbmRvdyAqLwotICAgIEludCAgICAgc2ZiOyAgICAgICAgLyogc2NhbGVmYWN0b3IgYmFuZCBpbmRleCAqLwotICAgIEludCAgICAgc2VjdF9jYjsgICAgLyogaHVmZiBjb2RlYm9vayAjIGZvciBlYWNoIHNlY3Rpb24gKi8KLSAgICBJbnQgICAgIGZhYzsgICAgICAgIC8qIGRlY29kZWQgc2NmICovCi0gICAgSW50ICAgICBpc19wb3M7ICAgICAvKiBpbnRlbnNpdHkgc3RlcmVvIHBvc2l0aW9uICovCi0gICAgSW50ICAgICBub2lzZV9wY21fZmxhZyA9IFRSVUU7ICAvKiBmaXJzdCBQTlMgc2ZiICovCi0gICAgSW50ICAgICBkcGNtX25vaXNlX25yZzsgICAgIC8qIGRwY20gbm9pc2UgZW5lcmd5ICovCi0gICAgSW50ICAgICBub2lzZV9ucmc7ICAgICAgLyogbm9pc2UgZW5lcmd5ICovCi0gICAgSW50ICAgICBzdGF0dXMgPSBTVUNDRVNTOyAgLyogc3RhdHVzIG9mIGRlY29kaW5nICovCi0gICAgSW50ICAgICAqcEh1ZmZCb29rVXNlZCA9ICZodWZmQm9va1VzZWRbMF07Ci0KLQotICAgIHB2X21lbXNldChwRmFjdG9ycywKLSAgICAgICAgICAgICAgWkVST19IQ0IsCi0gICAgICAgICAgICAgIE1BWEJBTkRTKnNpemVvZigqcEZhY3RvcnMpKTsKLQotCi0gICAgaWYgKG5zZWN0KQotICAgIHsKLSAgICAgICAgLyogcmVhZCBzZWN0aW9uIGxlbmd0aCBhbmQgY29kZWJvb2sgKi8KLQotICAgICAgICBpZiAobnNlY3QgPT0gMSkgLyogbG9uZyB3aW5kb3cgKi8KLSAgICAgICAgewotICAgICAgICAgICAgc2VjdF9jYiAgPSBwU2VjdC0+c2VjdF9jYjsgIC8qIGNvZGVib29rIGZvciB0aGlzIHNlY3Rpb24gKi8KLQotICAgICAgICAgICAgLyogYWxsIHNmYnMgaW4gb25lIHNlY3Rpb24gc2hhcmUgdGhlIHNhbWUgY29kZWJvb2sgKi8KLQotICAgICAgICAgICAgZm9yIChzZmIgPSBwU2VjdC0+c2VjdF9lbmQgPj4gMjsgc2ZiICE9IDA7IHNmYi0tKQotICAgICAgICAgICAgewotICAgICAgICAgICAgICAgICoocEh1ZmZCb29rVXNlZCsrKSA9IHNlY3RfY2I7Ci0gICAgICAgICAgICAgICAgKihwSHVmZkJvb2tVc2VkKyspID0gc2VjdF9jYjsKLSAgICAgICAgICAgICAgICAqKHBIdWZmQm9va1VzZWQrKykgPSBzZWN0X2NiOwotICAgICAgICAgICAgICAgICoocEh1ZmZCb29rVXNlZCsrKSA9IHNlY3RfY2I7Ci0gICAgICAgICAgICB9Ci0gICAgICAgICAgICBmb3IgKHNmYiA9IHBTZWN0LT5zZWN0X2VuZCAmIDM7IHNmYiAhPSAwOyBzZmItLSkKLSAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAqKHBIdWZmQm9va1VzZWQrKykgPSBzZWN0X2NiOwotICAgICAgICAgICAgfQotCi0gICAgICAgIH0KLSAgICAgICAgZWxzZSAgICAgICAgICAgIC8qIHNob3J0ICovCi0gICAgICAgIHsKLSAgICAgICAgICAgIEludCBzZWN0X3N0YXJ0ID0gMDsgLyogc3RhcnQgaW5kZXggb2Ygc2ZiIGZvciBlYWNoIHNlY3Rpb24gKi8KLSAgICAgICAgICAgIGZvciAoc2VjdF9pZHggPSBuc2VjdDsgc2VjdF9pZHggPiAwOyBzZWN0X2lkeC0tKQotICAgICAgICAgICAgewotICAgICAgICAgICAgICAgIHNlY3RfY2IgID0gcFNlY3QtPnNlY3RfY2I7ICAvKiBjb2RlYm9vayBmb3IgdGhpcyBzZWN0aW9uICovCi0KLSAgICAgICAgICAgICAgICAvKiBhbGwgc2ZicyBpbiBvbmUgc2VjdGlvbiBzaGFyZSB0aGUgc2FtZSBjb2RlYm9vayAqLwotICAgICAgICAgICAgICAgIGZvciAoc2ZiID0gc2VjdF9zdGFydDsgc2ZiIDwgcFNlY3QtPnNlY3RfZW5kOyBzZmIrKykKLSAgICAgICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgICAgIHBIdWZmQm9va1VzZWRbc2ZiXSA9IHNlY3RfY2I7Ci0gICAgICAgICAgICAgICAgfQotCi0gICAgICAgICAgICAgICAgcFNlY3QrKzsKLSAgICAgICAgICAgICAgICBzZWN0X3N0YXJ0ID0gc2ZiOwotCi0gICAgICAgICAgICB9IC8qIGZvciAoc2VjdF9pZHgpICovCi0gICAgICAgIH0KLSAgICB9Ci0gICAgZWxzZQotICAgIHsKLSAgICAgICAgLyogY2xlYXIgYXJyYXkgZm9yIHRoZSBjYXNlIG9mIG1heF9zZmIgPT0gMCAqLwotICAgICAgICBwdl9tZW1zZXQocEh1ZmZCb29rVXNlZCwKLSAgICAgICAgICAgICAgICAgIFpFUk9fSENCLAotICAgICAgICAgICAg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dpbmRvdyBvZiBlYWNoIGdyb3VwICovCi0KLSAgICAgICAgZm9yIChzZmIgPSAwOyBzZmIgPCBuc2ZiX3dpbjsgc2ZiKyspCi0gICAgICAgIHsKLQotICAgICAgICAgICAgc3dpdGNoIChwSHVmZkJvb2tVc2VkW3NmYl0pCi0gICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgY2FzZSBaRVJPX0hDQjoKLSAgICAgICAgICAgICAgICAgICAgYnJlYWs7Ci0gICAgICAgICAgICAgICAgY2FzZSBJTlRFTlNJVFlfSENCOgotICAgICAgICAgICAgICAgIGNhc2UgSU5URU5TSVRZX0hDQjI6Ci0gICAgICAgICAgICAgICAgICAgIC8qIGludGVuc2l0eSBib29rcyAqLwotICAgICAgICAgICAgICAgICAgICAvKiBkZWNvZGUgaW50ZW5zaXR5IHBvc2l0aW9uICovCi0gICAgICAgICAgICAgICAgICAgIGN3X2luZGV4ID0gZGVjb2RlX2h1ZmZfc2NsKHBJbnB1dFN0cmVhbSk7Ci0KLSAgICAgICAgICAgICAgICAgICAgaXNfcG9zICAgICAgICArPSBjd19pbmRleCAtIE1JREZBQzsKLSAgICAgICAgICAgICAgICAgICAgcEZhY3RvcnNbc2ZiXSA9ICBpc19wb3M7Ci0gICAgICAgICAgICAgICAgICAgIGJyZWFrOwotICAgICAgICAgICAgICAgIGNhc2UgTk9JU0VfSENCOgotICAgICAgICAgICAgICAgICAgICAvKiBub2lzZSBib29rcyAqLwotICAgICAgICAgICAgICAgICAgICAvKiBkZWNvZGUgbm9pc2UgZW5lcmd5ICovCi0gICAgICAgICAgICAgICAgICAgIGlmIChub2lzZV9wY21fZmxhZyA9PSBUUlVFKQotICAgICAgICAgICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgICAgICAgICBub2lzZV9wY21fZmxhZyA9IEZBTFNFOwotICAgICAgICAgICAgICAgICAgICAgICAgZHBjbV9ub2lzZV9ucmcgPSBnZXQ5X25fbGVzc2JpdHMoTk9JU0VfUENNX0JJVFMsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwSW5wdXRTdHJlYW0pOwotCi0gICAgICAgICAgICAgICAgICAgICAgICBkcGNtX25vaXNlX25yZyAtPSBOT0lTRV9QQ01fT0ZGU0VUOwotICAgICAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgICAgIGVsc2UKLSAgICAgICAgICAgICAgICAgICAgewotICAgICAgICAgICAgICAgICAgICAgICAgZHBjbV9ub2lzZV9ucmcgPSBkZWNvZGVfaHVmZl9zY2wocElucHV0U3RyZWFtKTsKLQotICAgICAgICAgICAgICAgICAgICAgICAgZHBjbV9ub2lzZV9ucmcgLT0gTUlERkFDOwotICAgICAgICAgICAgICAgICAgICB9IC8qIGlmIChub2lzZV9wY21fZmxhZykgKi8KLQotICAgICAgICAgICAgICAgICAgICBub2lzZV9ucmcgICAgICAgKz0gZHBjbV9ub2lzZV9ucmc7Ci0gICAgICAgICAgICAgICAgICAgIHBGYWN0b3JzW3NmYl0gICA9ICBub2lzZV9ucmc7Ci0gICAgICAgICAgICAgICAgICAgIGJyZWFrOwotICAgICAgICAgICAgICAgIGNhc2UgQk9PS1NDTDoKLSAgICAgICAgICAgICAgICAgICAgc3RhdHVzID0gMTsgLyogaW52YWxpZCBib29rcyAqLwotICAgICAgICAgICAgICAgICAgICBzZmIgPSBuc2ZiX3dpbjsgIC8qIGZvcmNlIG91dCAqLwotICAgICAgICAgICAgICAgICAgICBicmVhazsKLSAgICAgICAgICAgICAgICBkZWZhdWx0OgotICAgICAgICAgICAgICAgICAgICAvKiBzcGVjdHJhbCBib29rcyAqLwotICAgICAgICAgICAgICAgICAgICAvKiBkZWNvZGUgc2NhbGUgZmFjdG9ycyAqLwotICAgICAgICAgICAgICAgICAgICBjd19pbmRleCA9IGRlY29kZV9odWZmX3NjbChwSW5wdXRTdHJlYW0pOwotCi0gICAgICAgICAgICAgICAgICAgIGZhYyAgICAgICs9IGN3X2luZGV4IC0gTUlERkFDOyAgIC8qIDEuNSBkQiAqLwotICAgICAgICAgICAgICAgICAgICBpZiAoKGZhYyA+PSAyKlRFWFApIHx8IChmYWMgPCAwKSkKLSAgICAgICAgICAgICAgICAgICAgewotICAgICAgICAgICAgICAgICAgICAgICAgc3RhdHVzID0gMTsgICAvKiBlcnJvciwgTVVTVCAwPD1zY2Y8MjU2LCBSZWYuIHA3MyAqLwotICAgICAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgICAgIGVsc2UKLSAgICAgICAgICAgICAgICAgICAgewotICAgICAgICAgICAgICAgICAgICAgICAgcEZhY3RvcnNbc2ZiXSA9IGZhYzsgIC8qIHN0b3JlIHNjZiAqLwotICAgICAgICAgICAgICAgICAgICB9IC8qIGlmIChmYWMpICovCi0gICAgICAgICAgICB9Ci0KLSAgICAgICAgfSAvKiBmb3IgKHNmYj0wKSwgZmlyc3Qgd2luZG93IGRlY29kZSBlbmRzICovCi0KLSAgICAgICAgLyogZXhwYW5kIHNjZiB0byBvdGhlciB3aW5kb3dzIGluIHRoZSBzYW1lIGdyb3VwICovCi0gICAgICAgIGlmIChwRnJhbWVJbmZvLT5pc2xvbmcgPT0gRkFMU0UpCi0gICAgICAgIHsKLQotICAgICAgICAgICAgZm9yIChncm91cF93aW4rKzsgZ3JvdXBfd2luIDwgZ3JvdXBfZW5kOyBncm91cF93aW4rKykKLSAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICBmb3IgKHNmYiA9IDA7IHNmYiA8IG5zZmJfd2luOyBzZmIrKykKLSAgICAgICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgICAgIHBGYWN0b3JzW3NmYiArIG5zZmJfd2luXSAgPSAgcEZhY3RvcnNbc2ZiXTsKLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgcEZhY3RvcnMgICs9ICBuc2ZiX3dpbjsKLSAgICAgICAgICAgIH0KLQotICAgICAgICB9IC8qIGlmIChwRnJhbWVJbmZvLT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tKTsKLQotICAgIEludCBkZWNvZGVfaHVmZl9zY2woCi0gICAgICAgIEJJVFMgICAgICAgICAgKnBJbnB1dFN0cmVhbSk7Ci0KLSAgICBJbnQgaW5mb2luaXQoCi0gICAgICAgIGNvbnN0ICBJbnQgc2FtcGxpbmdfcmF0ZV9pZHgsCi0gICAgICAgIEZyYW1lSW5mbyAgICoqcHBXaW5fc2VxX2luZm8sCi0gICAgICAgIEludCAgICAqcFNmYndpZHRoMTI4KTsKLQotICAgIEludCBodWZmY2IoCi0gICAgICAgIFNlY3RJbmZvICpwU2VjdCwKLSAgICAgICAgQklUUyAgICAgKnBJbnB1dFN0cmVhbSwKLSAgICAgICAgSW50ICAgICAgKnBTZWN0Yml0cywKLSAgICAgICAgSW50ICAgICAgIHRvdF9zZmIsCi0gICAgICAgIEludCAgICAgICBzZmJfcGVyX3NiaywKLSAgICAgICAgSW50ICAgICAgIG1heF9zZmIpOwotCi0gICAgSW50IGh1ZmZmYWMoCi0gICAgICAgIEZyYW1lSW5mbyAgICpwRnJhbWVJbmZvLAotICAgICAgICBCSVRTICAgICAgICAqcElucHV0U3RyZWFtLAotICAgICAgICBJbnQgICAgICAgICAqcEdyb3VwLAotICAgICAgICBJbnQgICAgICAgICAgbnNlY3QsCi0gICAgICAgIFNlY3RJbmZvICAgICpwU2VjdCwKLSAgICAgICAgSW50ICAgICAgICAgIGdsb2JhbF9nYWluLAotICAgICAgICBJbnQgICAgICAgICAqcEZhY3RvcnMsCi0gICAgICAgIEludCAgICAgICAgICBodWZmQm9va1VzZWRbXSk7Ci0KLSAgICBJbnQgaHVmZnNwZWNfZnhwKAotICAgICAgICBGcmFtZUluZm8gKnBGcmFtZUluZm8sCi0gICAgICAgIEJJVFMgICAgICAqcElucHV0U3RyZWFtLAotICAgICAgICBJbnQgICAgICAgbnNlY3QsCi0gICAgICAgIFNlY3RJbmZvICAqcFNlY3RJbmZvLAotICAgICAgICBJbnQgICAgICAgZmFjdG9yc1tdLAotICAgICAgICBJbnQzMiAgICAgY29lZltdLAotICAgICAgICBJbnQxNiAgICAgcXVhbnRTcGVjW10sCi0gICAgICAgIEludDE2ICAgICB0bXBfc3BlY1tdLAotICAgICAgICBjb25zdCBGcmFtZUluZm8gICpwTG9uZ0ZyYW1lSW5mbywKLSAgICAgICAgUHVsc2VJbmZvICAqcFB1bHNlSW5mbywKLSAgICAgICAgSW50ICAgICAgICAgcUZvcm1hdFtdKTsKLQotICAgIEludCBodWZmZGVjb2RlKAotICAgICAgICBJbnQgICAgICAgICAgIGlkX3N5bl9lbGUsCi0gICAgICAgIEJJVFMgICAgICAgICAgKnBJbnB1dFN0cmVhbSwKLSAgICAgICAgdERlY19JbnRfRmlsZSAqcFZhcnMsCi0gICAgICAgIHREZWNfSW50X0NoYW4gKnBDaFZhcnNbXSk7Ci0KLSAgICB2b2lkIGRlaW50ZXJsZWF2ZSgKLSAgICAgICAgSW50MTYgICAgICAgICAgaW50ZXJsZWF2ZWRbXSwKLSAgICAgICAgSW50MTYgICAgICAgIGRlaW50ZXJsZWF2ZWRbXSwKLSAgICAgICAgRnJhbWVJbmZvICAgKnBGcmFtZUluZm8pOwotCi0gICAgSW50IGdldGljcygKLQotICAgICAgICBCSVRTICAgICAgICAgICAgKnBJbnB1dFN0cmVhbSwKLSAgICAgICAgSW50ICAgICAgICAgICAgIGNvbW1vbl93aW5kb3csCi0gICAgICAgIHREZWNfSW50X0ZpbGUgICAqcFZhcnMsCi0gICAgICAgIHREZWNfSW50X0NoYW4gICAqcENoVmFycywKLSAgICAgICAgSW50ICAgICAgICAgICAgIGdyb3VwW10sCi0gICAgICAgIEludCAgICAgICAgICAgICAqcE1heF9zZmIsCi0gICAgICAgIEludCAgICAgICAgICAgICAqcENvZGVib29rTWFwLAotICAgICAgICBUTlNfZnJhbWVfaW5mbyAgKnBUbnNJbmZvLAotICAgICAgICBGcmFtZUluZm8gICAgICAgKipwV2luTWFwLAotICAgICAgICBQdWxzZUluZm8gICAgICAgKnBQdWxzZUluZm8sCi0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ICAqcEhjYjsKLSAgICBJbnQgICAgIGk7Ci0gICAgSW50ICAgICBzZmI7Ci0gICAgSW50ICAgICBpZHhfY291bnQ7Ci0gICAgSW50ICAgICBzZWN0X2NiOyAgICAvKiBzZWN0aW9uIGNvZGVib29rICovCi0gICAgSW50ICAgICBkaW07Ci0gICAgSW50ICAgICBpZHg7Ci0gICAgSW50ICAgICBzdG9wX2lkeDsgICAgIC8qIGluZGV4IG9mIDFzdCBjb2VmIGluIG5leHQgc2ZiICovCi0gICAgSW50ICAgICBzZWN0X3N0YXJ0OyAgIC8qIHN0YXJ0IGluZGV4IG9mIHNmYiBpbiBvbmUgc2VjdGlvbiovCi0gICAgSW50ICAgICBzZWN0X2VuZDsgICAgIC8qIGluZGV4IG9mIDFzdCBzZmIgaW4gbmV4dCBzZWN0aW9uICovCi0gICAgSW50ICAgICAqcFNmYlN0YXJ0OwotICAgIEludCAgICAgKnBTZmI7Ci0gICAgSW50MTYgICAgICpwUXVhbnRTcGVjOyAgICAgICAgLyogcHJvYmFibHkgY291bGQgYmUgc2hvcnQgKi8KLSAgICBJbnQgICAgIG1heCA9IDA7Ci0gICAgLyogcmVzY2FsaW5nIHBhcmFtZXRlcnMgKi8KLSAgICBJbnQgICAgIG5zZmI7Ci0gICAgSW50ICAgICB0b3Rfc2ZiOwotICAgIEludCAgICAgZmFjOwotCi0gICAgSW50MzIgICAqcENvZWY7IC8qIHB0ciB0byBjb2VmW10sIGludmVyc2UgcXVhbnRpemVkIGNvZWZzICovCi0gICAgVUludDE2ICAgICBzY2FsZTsKLQotICAgIEludCAgICAgcG93ZXJfc2NhbGVfZGl2XzQ7Ci0gICAgSW50ICAgICBzZmJXaWR0aDsKLQotICAgIHZvaWQgKCpwVW5wYWNrX2lkeCkoCi0gICAgICAgIEludDE2ICBxdWFudF9zcGVjW10sCi0gICAgICAgIEludCAgY29kZXdvcmRfaW5keCwKLSAgICAgICAgY29uc3QgSGNiICpwSHVmZkNvZGVib29rLAotICAgICAgICBCSVR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otICAgICAgICBpZiAoKHNlY3RfY2IgPiAxNSkgfHwgKHNlY3RfY2IgPCAwKSkKLSAgICAgICAgewotICAgICAgICAgICAgcmV0dXJuICgtMSk7ICAgLyogIGVycm9yIGNvbmRpdGlvbiAqLwotICAgICAgICB9Ci0gICAgICAgIHNlY3RfZW5kID0gIHBTZWN0SW5mby0+c2VjdF9lbmQ7ICAgIC8qICMgb2Ygc2ZicyAqLwotCi0gICAgICAgIGlmIChzZWN0X2VuZCA8IDApCi0gICAgICAgIHsKLSAgICAgICAgICAgIHJldHVybiAoLTEpOyAgIC8qICBlcnJvciBjb25kaXRpb24gKi8KLSAgICAgICAgfQotCi0gICAgICAgIHBTZWN0SW5mbysrOwotCi0gICAgICAgIC8qICBzZWN0X2NiICAgICAgIHNlY3RfY2IgLSAxCi0gICAgICAgICAqICBaRVJPX0hDQiAgICAgICAgMTExMWIKLSAgICAgICAgICogICAgMSAgICAgICAgICAgICAwMDAwYgotICAgICAgICAgKiAgICAyICAgICAgICAgICAgIDAwMDFiCi0gICAgICAgICAqICAgIDMgICAgICAgICAgICAgMDAxMGIKLSAgICAgICAgICogICAgNCAgICAgICAgICAgICAwMDExYgotICAgICAgICAgKiAgICA1ICAgICAgICAgICAgIDAxMDBiCi0gICAgICAgICAqICAgIDYgICAgICAgICAgICAgMDEwMWIKLSAgICAgICAgICogICAgNyAgICAgICAgICAgICAwMTEwYgotICAgICAgICAgKiAgICA4ICAgICAgICAgICAgIDAxMTFiCi0gICAgICAgICAqICAgIDkgICAgICAgICAgICAgMTAwMGIKLSAgICAgICAgICogICAgMTAgICAgICAgICAgICAxMDAxYgotICAgICAgICAgKiAgICAxMSAgICAgICAgICAgIDEwMTBiCi0gICAgICAgICAqICAgIDEyICAgICAgICAgICAgMTAxMWIKLSAgICAgICAgICogTk9JU0VfSENCICAgICAgICAxMTAwYgotICAgICAgICAgKiBJTlRFTlNJVFlfSENCMiAgIDExMDFiCi0gICAgICAgICAqIElOVEVOU0lUWV9IQ0IgICAgMTExMGIKLSAgICAgICAgICogaWYgKCAoKHNlY3RfY2IgLSAxKSAmIDB4QykgPT0gMHhDICkgaXMgaWRlbnRpY2FsIHRvCi0gICAgICAgICAqIGlmICEoKHNlY3RfY2IgPT0gWkVST19IQ0IpIHx8IChzZWN0X2NiID09IE5PSVNFX0hDQikgfHwKLSAgICAgICAgICogICAgICAoc2VjX2NiID09IElOVEVOU0lUWV9IQ0IpIHx8IChzZWN0X2NiPT1JTlRFTlNJVFlfSENCMikgKQotICAgICAgICAgKiB1c2UgdGhpcyBjb21wYXJlIHNjaGVtZSB0byBzcGVlZCB1cCB0aGUgZXhlY3V0aW9uCi0gICAgICAgICAqLwotCi0gICAgICAgIGlmICgoKHNlY3RfY2IgLSAxKSAmIDB4QykgIT0gMHhDKQotICAgICAgICB7Ci0gICAgICAgICAgICAvKiBkZWNvZGUgc3BlYyBpbiBvbmUgc2VjdGlvbiAqLwotICAgICAgICAgICAgaWYgKHNlY3RfY2IgPiBCWTRCT09LUykKLSAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICBkaW0gPSBESU1FTlNJT05fMjsgLyogc2V0IGNvZGVib29rIGRpbWVuc2lvbiAqLwotICAgICAgICAgICAgfQotICAgICAgICAgICAgZWxzZQotICAgICAgICAgICAgewotICAgICAgICAgICAgICAgIGRpbSA9IERJTUVOU0lPTl80OwotICAgICAgICAgICAgfQotCi0gICAgICAgICAgICBwSGNiICAgICAgICA9ICZoY2Jib29rX2JpbmFyeVtzZWN0X2NiXTsKLQotICAgICAgICAgICAgaWYgKHNlY3RfY2IgPT0gRVNDQk9PSykKLSAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICBwVW5wYWNrX2lkeCA9ICZ1bnBhY2tfaWR4X2VzYzsKLSAgICAgICAgICAgIH0KLSAgICAgICAgICAgIGVsc2UgaWYgKHBIY2ItPnNpZ25lZF9jYiA9PSBGQUxTRSkKLSAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICBwVW5wYWNrX2lkeCA9ICZ1bnBhY2tfaWR4X3NnbjsKLSAgICAgICAgICAgIH0KLSAgICAgICAgICAgIGVsc2UKLSAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICBwVW5wYWNrX2lkeCA9ICZ1bnBhY2tfaWR4OwotICAgICAgICAgICAgfQotCi0KLSAgICAgICAgICAgIHN3aXRjaCAoc2VjdF9jYikKLSAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICBjYXNlIDE6Ci0gICAgICAgICAgICAgICAgICAgIHBEZWNfaHVmZl90YWIgPSBkZWNvZGVfaHVmZl9jd190YWIxOwotICAgICAgICAgICAgICAgICAgICBicmVhazsKLSAgICAgICAgICAgICAgICBjYXNlIDI6Ci0gICAgICAgICAgICAgICAgICAgIHBEZWNfaHVmZl90YWIgPSBkZWNvZGVfaHVmZl9jd190YWIyOwotICAgICAgICAgICAgICAgICAgICBicmVhazsKLSAgICAgICAgICAgICAgICBjYXNlIDM6Ci0gICAgICAgICAgICAgICAgICAgIHBEZWNfaHVmZl90YWIgPSBkZWNvZGVfaHVmZl9jd190YWIzOwotICAgICAgICAgICAgICAgICAgICBicmVhazsKLSAgICAgICAgICAgICAgICBjYXNlIDQ6Ci0gICAgICAgICAgICAgICAgICAgIHBEZWNfaHVmZl90YWIgPSBkZWNvZGVfaHVmZl9jd190YWI0OwotICAgICAgICAgICAgICAgICAgICBicmVhazsKLSAgICAgICAgICAgICAgICBjYXNlIDU6Ci0gICAgICAgICAgICAgICAgICAgIHBEZWNfaHVmZl90YWIgPSBkZWNvZGVfaHVmZl9jd190YWI1OwotICAgICAgICAgICAgICAgICAgICBicmVhazsKLSAgICAgICAgICAgICAgICBjYXNlIDY6Ci0gICAgICAgICAgICAgICAgICAgIHBEZWNfaHVmZl90YWIgPSBkZWNvZGVfaHVmZl9jd190YWI2OwotICAgICAgICAgICAgICAgICAgICBicmVhazsKLSAgICAgICAgICAgICAgICBjYXNlIDc6Ci0gICAgICAgICAgICAgICAgICAgIHBEZWNfaHVmZl90YWIgPSBkZWNvZGVfaHVmZl9jd190YWI3OwotICAgICAgICAgICAgICAgICAgICBicmVhazsKLSAgICAgICAgICAgICAgICBjYXNlIDg6Ci0gICAgICAgICAgICAgICAgICAgIHBEZWNfaHVmZl90YWIgPSBkZWNvZGVfaHVmZl9jd190YWI4OwotICAgICAgICAgICAgICAgICAgICBicmVhazsKLSAgICAgICAgICAgICAgICBjYXNlIDk6Ci0gICAgICAgICAgICAgICAgICAgIHBEZWNfaHVmZl90YWIgPSBkZWNvZGVfaHVmZl9jd190YWI5OwotICAgICAgICAgICAgICAgICAgICBicmVhazsKLSAgICAgICAgICAgICAgICBjYXNlIDEwOgotICAgICAgICAgICAgICAgICAgICBwRGVjX2h1ZmZfdGFiID0gZGVjb2RlX2h1ZmZfY3dfdGFiMTA7Ci0gICAgICAgICAgICAgICAgICAgIGJyZWFrOwotICAgICAgICAgICAgICAgIGNhc2UgMTE6Ci0gICAgICAgICAgICAgICAgICAgIHBEZWNfaHVmZl90YWIgPSBkZWNvZGVfaHVmZl9jd190YWIxMTsKLSAgICAgICAgICAgICAgICAgICAgYnJlYWs7Ci0gICAgICAgICAgICAgICAgZGVmYXVsdDoKLSAgICAgICAgICAgICAgICAgICAgcmV0dXJuICgtMSk7IC8qIGVycm9yIGNvbmRpdGlvbiAqLwotICAgICAgICAgICAgfQotCi0gICAgICAgICAgICAvKiBtb3ZlIHB0ciB0byBmaXJzdCBzZmIgb2YgY3VycmVudCBzZWN0aW9uICovCi0gICAgICAgICAgICBwUXVhbnRTcGVjICA9IHF1YW50U3BlYyArIHN0b3BfaWR4OwotCi0gICAgICAgICAgICAvKiBzdGVwIHRocm91Z2ggYWxsIHNmYnMgaW4gY3VycmVudCBzZWN0aW9uICovCi0gICAgICAgICAgICBmb3IgKHNmYiA9IHNlY3Rfc3RhcnQ7IHNmYiA8IHNlY3RfZW5kOyBzZmIrKykKLSAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICBpZHhfY291bnQgPSAqcFNmYiAtIHN0b3BfaWR4OwotICAgICAgICAgICAgICAgIHN0b3BfaWR4ICA9ICpwU2ZiKys7Ci0KLSAgICAgICAgICAgICAgICAvKiBkZWNvZGUgYWxsIGNvZWZzIGZvciBvbmUgc2ZiICovCi0gICAgICAgICAgICAgICAgd2hpbGUgKChpZHhfY291bnQgPiAwKSAmJiAoaWR4X2NvdW50IDwgMTAyNCkpCi0gICAgICAgICAgICAgICAgewotCi0gICAgICAgICAgICAgICAgICAgIGlkeCA9ICgqcERlY19odWZmX3RhYikocElucHV0U3RyZWFtKTsKLQotICAgICAgICAgICAgICAgICAgICAoKnBVbnBhY2tfaWR4KShwUXVhbnRTcGVjLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZHgsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBIY2IsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBJbnB1dFN0cmVhbSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJm1heCk7ICAgICAgLyogdW5wYWNrIGlkeCAtPiBjb2VmcyAqLwotCi0gICAgICAgICAgICAgICAgICAgIHBRdWFudFNwZWMgKz0gZGltOwotICAgICAgICAgICAgICAgICAgICBpZHhfY291bnQgIC09IGRpbTsKLQotICAgICAgICAgICAgICAgIH0gLyogd2hpbGUoaWR4X2NvdW50KSAqLwotCi0gICAgICAgICAgICB9IC8qIGZvciAoc2ZiPXNlY3Rfc3RhcnQpICovCi0gICAgICAgIH0KLSAgICAgICAgZWxzZQotICAgICAgICB7Ci0KLSAgICAgICAgICAgIC8qIGN1cnJlbnQgc2VjdGlvbiB1c2VzIFpFUk9fSENCLCBOT0lTRV9IQ0IsIGV0YyAqLwotCi0gICAgICAgICAgICAvKiBtb3ZlIHNmYiBwb2ludGVyIHRvIHRoZSBzdGFydCBzZmIgb2YgbmV4dCBzZWN0aW9uICovCi0gICAgICAgICAgICBwU2ZiICAgICAgICA9IHBTZmJTdGFyd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lzIHRoZSBtb3N0ICJleHBlbnNpdmUiIGZ1bmN0aW9uIG9mIHRoZQotICAgICAgICAgICAgICogbGlicmFyeS4KLSAgICAgICAgICAgICAqIFRoaXMgbWVtc2V0IGFsc28gZ3VhcmFudGVlcyB0aGUgUV9Gb3JtYXQgZm9yIHNmYnMgd2l0aCBhbGwgemVybwotICAgICAgICAgICAgICogY29lZmZpY2llbnRzIHdpbGwgYmUgc2V0IHByb3Blcmx5LgotICAgICAgICAgICAgICogUHJvZmlsaW5nIGRhdGEgb24gQVJNIGFuZCBUTVMzMjBDNTV4IHByb3ZlcyB0aGF0IHRoZXJlIGlzIGEgbmV0Ci0gICAgICAgICAgICAgKiBnYWluIGluIHRvdGFsIE1JUFMgaWYgYSBtZW1zZXQgaXMgY2FsbGVkIGhlcmUuCi0gICAgICAgICAgICAgKi8KLSAgICAgICAgICAgIHB2X21lbXNldCgmcXVhbnRTcGVjW3N0b3BfaWR4XSwKLSAgICAgICAgICAgICAgICAgICAgICAwLAotICAgICAgICAgICAgICAgICAgICAgIGlkeF9jb3VudCAqIHNpemVvZihxdWFudFNwZWNbMF0pKTsKLQotICAgICAgICAgICAgLyoKLSAgICAgICAgICAgICAqIFRoaXMgbWVtc2V0IGlzIGNhbGxlZCBiZWNhdXNlIHBRdWFudFNwZWMgcG9pbnRzIHRvIHRtcF9zcGVjCi0gICAgICAgICAgICAgKiBhZnRlciBkZWludGVybGVhdmluZwotICAgICAgICAgICAgICovCi0KLSAgICAgICAgICAgIHB2X21lbXNldCgmdG1wX3NwZWNbc3RvcF9pZHhdLAotICAgICAgICAgICAgICAgICAgICAgIDAsCi0gICAgICAgICAgICAgICAgICAgICAgaWR4X2NvdW50ICogc2l6ZW9mKHRtcF9zcGVjWzBdKSk7Ci0KLQotICAgICAgICAgICAgLyogc3RvcF9pZHggaXMgdGhlIGluZGV4IG9mIHRoZSAxc3QgY29lZiBvZiBuZXh0IHNlY3Rpb24gKi8KLSAgICAgICAgICAgIHN0b3BfaWR4ICAgID0gKihwU2ZiIC0gMSk7Ci0KLSAgICAgICAgfS8qIGlmIChzZWN0X2NiKSAqLwotCi0gICAgICAgIHNlY3Rfc3RhcnQgPSBzZWN0X2VuZDsKLQotICAgIH0gLyogZm9yIChpPW5zZWN0KSAqLwotCi0gICAgLyogbm9pc2xlc3MgY29kaW5nIHJlY29uc3RydWN0aW9uICovCi0gICAgaWYgKHBGcmFtZUluZm8tPmlzbG9uZyAhPSBGQUxTRSkKLSAgICB7Ci0gICAgICAgIGlmIChwUHVsc2VJbmZvLT5wdWxzZV9kYXRhX3ByZXNlbnQgPT0gMSkKLSAgICAgICAgewotICAgICAgICAgICAgcHVsc2VfbmMocXVhbnRTcGVjLAotICAgICAgICAgICAgICAgICAgICAgcFB1bHNlSW5mbywKLSAgICAgICAgICAgICAgICAgICAgIHBMb25nRnJhbWVJbmZvLAotICAgICAgICAgICAgICAgICAgICAgJm1heCk7ICAgIC8qIGFkZCBwdWxzZSBkYXRhICovCi0gICAgICAgIH0KLQotICAgICAgICBwUXVhbnRTcGVjID0gcXVhbnRTcGVjOwotCi0gICAgfQotICAgIGVsc2UKLSAgICB7Ci0gICAgICAgIGRlaW50ZXJsZWF2ZShxdWFudFNwZWMsCi0gICAgICAgICAgICAgICAgICAgICB0bXBfc3BlYywKLSAgICAgICAgICAgICAgICAgICAgIHBGcmFtZUluZm8pOwotCi0gICAgICAgIHBRdWFudFNwZWMgPSB0bXBfc3BlYzsKLSAgICB9Ci0KLQotICAgIC8qIGludmVyc2UgcXVhbnRpemF0aW9uLCBRX2Zvcm1hdDogSW50MzIgKi8KLSAgICAvKiByZXNjYWxpbmcgKi8KLQotICAgIC8qIHdoYXQgd2UgY2FuIGRvIGhlcmUgaXMgYXNzdW1pbmcgdGhhdCB3ZSBhbHJlYWR5IGtub3cgbWF4SW5wdXQgZm9yIGVhY2ggYmFuZCwgd2UgaGF2ZSB0byBnbwotICAgIHRob3VnaCBlYWNoIG9uZSBvZiB0aGVtIGZvciByZS1xdWF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otCi0gICAgUUZvcm1hdCA9IFNJR05FRDMyQklUUyAtIGJpbmFyeURpZ2l0czsKLQotICAgIC8qKioqKioqKioqKioqKioqKioqKi8KLSAgICB0b3Rfc2ZiID0gMDsKLSAgICBuc2ZiID0gcEZyYW1lSW5mby0+c2ZiX3Blcl93aW5bMF07Ci0gICAgcENvZWYgPSBjb2VmOwotCi0gICAgZm9yIChpID0gcEZyYW1lSW5mby0+bnVtX3dpbjsgaSA+IDA7IGktLSkKLSAgICB7Ci0gICAgICAgIHN0b3BfaWR4ICA9IDA7Ci0KLSAgICAgICAgZm9yIChzZmIgPSAwOyBzZmIgPCBuc2ZiOyBzZmIrKykKLSAgICAgICAgewotICAgICAgICAgICAgc2ZiV2lkdGggICA9ICBwRnJhbWVJbmZvLT53aW5fc2ZiX3RvcFswXVtzZmJdIC0gc3RvcF9pZHg7Ci0KLSAgICAgICAgICAgIGlmICgoc2ZiV2lkdGggPCAwKSB8fCAoc2ZiV2lkdGggPiAxMDI0KSkKLSAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICByZXR1cm4gKC0xKTsgICAvKiAgZXJyb3IgY29uZGl0aW9uICovCi0gICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgIHN0b3BfaWR4ICArPSBzZmJXaWR0aDsKLQotICAgICAgICAgICAgZmFjICAgPSBmYWN0b3JzW3RvdF9zZmJdIC0gU0ZfT0ZGU0VUOwotICAgICAgICAgICAgc2NhbGUgPSBleHB0YWJsZVtmYWMgJiAweDNdOwotCi0gICAgICAgICAgICBwb3dlcl9zY2FsZV9kaXZfNCA9IGZhYyA+PiAyOwotCi0gICAgICAgICAgICBwb3dlcl9zY2FsZV9kaXZfNCsrOwotCi0gICAgICAgICAgICBxRm9ybWF0W3RvdF9zZmJdID0gUUZvcm1hdDsKLQotICAgICAgICAgICAgZXNjX2lxdWFudF9zY2FsaW5nKHBRdWFudFNwZWMsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcENvZWYsCi0gICAg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ICAgICAgICAgICAgIFByZS1yb3RhdGlvbiBieSBleHAoaigycGkvTikoaysxLzgpKQotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICBOLzQtIHBvaW50IElGRlQKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfAotICAgICAgICAgICAgICAgICAgICBQb3N0LXJvdGF0aW9uIGJ5IGV4cChqKDJwaS9OKShuKzEvOCkpCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLS0tLS0tLS0tLS0tLSB4KG4pICBJbiB0aGUgdGltZSBkb21haW4KLQotCi0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0KLSBSRVFVSVJFTUVOVFMKLQotICAgIFRoaXMgZnVuY3Rpb24gc2hvdWxkIHByb3ZpZGUgYSBmaXhlZCBwb2ludCBJTURDVCB3aXRoIGFuIGF2ZXJhZ2UKLSAgICBxdWFudGl6YXRpb24gZXJyb3IgbGVzcyB0aGFuIDEgJSAodmFyaWFuY2UgYW5kIG1lYW4pLgotCi0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0KLSBSRUZFUkVOQ0VTCi0KLSAgICBbMV0gQW5hbHlzaXMvU3ludGhlc2lzIEZpbHRlciBCYW5rIGRlc2lnbiBiYXNlZCBvbiB0aW1lIGRvbW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S0tLS0tLS0tLS0qLwotCi0KLUludCBpbWRjdF9meHAoSW50MzIgICBkYXRhX3F1YW50W10sCi0gICAgICAgICAgICAgIEludDMyICAgZnJlcV8yX3RpbWVfYnVmZmVyW10sCi0gICAgICAgICAgICAgIGNvbnN0ICAgSW50ICAgICBuLAotICAgICAgICAgICAgICBJbnQgICAgIFFfZm9ybWF0LAotICAgICAgICAgICAgICBJbnQzMiAgIG1heCkKLXsKLQotICAgIEludDMyICAgICBleHBfanc7Ci0gICAgSW50ICAgICBzaGlmdCA9IDA7Ci0KLSAgICBjb25zdCAgIEludDMyICpwX3JvdGF0ZTsKLSAgICBjb25zdCAgIEludDMyICpwX3JvdGF0ZV8yOwotCi0gICAgSW50MzIgICAqcF9kYXRhXzE7Ci0gICAgSW50MzIgICAqcF9kYXRhXzI7Ci0KLSAgICBJbnQzMiAgIHRlbXBfcmUzMjsKLSAgICBJbnQzMiAgIHRlbXBfaW0zMjsKLQotICAgIEludCAgICAgc2hpZnQxID0gMDsKLSAgICBJbnQzMiAgIHRlbXAxOwotICAgIEludDMyICAgdGVtcDI7Ci0KLSAgICBJbnQgICAgIGs7Ci0gICAgSW50ICAgICBuXzIgICA9IG4gPj4gMTsKLSAgICBJbnQgICAgIG5fNCAgID0gbiA+PiAyOwotCi0KLQotICAgIGlmIChtYXggIT0gMCkKLSAgICB7Ci0KLSAgICAgICAgc3dpdGNoIChuKQotICAgICAgICB7Ci0gICAgICAgICAgICBjYXNlIFNIT1JUX1dJTkRPV19UWVBFOgotICAgICAgICAgICAgICAgIHBfcm90YXRlID0gZXhwX3JvdGF0aW9uX05fMjU2OwotICAgICAgICAgICAgICAgIHNoaWZ0ID0gMjE7ICAgICAgICAgICAvKiBsb2cyKG4pLTEgKyAxNCBhY29tb2RhdGVzIDIvTiBmYWN0b3IgKi8KLSAgICAgICAgICAgICAgICBicmVhazsKLQotICAgICAgICAgICAgY2FzZSBMT05HX1dJTkRPV19UWVBFOgotICAgICAgICAgICAgICAgIHBfcm90YXRlID0gZXhwX3JvdGF0aW9uX05fMjA0ODsKLSAgICAgICAgICAgICAgICBzaGlmdCA9IDI0OyAgICAgICAgICAgLyogbG9nMihuKS0xICsxNCBhY29tb2RhdGVzIDIvTiBmYWN0b3IgKi8KLSAgICAgICAgICAgICAgICBicmVhazsKLQotICAgICAgICAgICAgZGVmYXVsdDoKLSAgICAgICAgICAgICAgICAvKgotICAgICAgICAgICAgICAgICAqIFRoZXJlIGlzIG5vIGRlZmluZWQgYmVoYXZpb3IgZm9yIGEgbm9uIHN1cHBvcnRlZCBmcmFtZQotICAgICAgICAgICAgICAgICAqIHNpemUuIEJ5IHJldHVybmluZyBhIGZpeGVkIHNjYWxpbmcgZmFjdG9yLCB0aGUgaW5wdXQgd2lsbAotICAgICAgICAgICAgICAgICAqIHNjYWxlZCBkb3duIGFuZCB0aGUgd2lsbCBiZSBoZWFyZCBhcyBhIGxvdyBsZXZlbCBub2lzZQotICAgICAgICAgICAgICAgICAqLwotICAgICAgICAgICAgICAgIHJldHVybihFUlJPUl9JTl9GUkFNRV9TSVpFKTsKLQotICAgICAgICB9Ci0KLSAgICAgICAgLyoKLSAgICAgICAgICogICBwX2RhdGFfMSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwX2RhdGFfMgotICAgICAgICAgKiAgICAgICB8ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8Ci0gICAgICAgICAqICAgICAgIFJJUklSSVJJUklSSVJJUklSSVJJUklSSVJJUklSSS4uLi5SSVJJUklSSVJJUkkKLSAgICAgICAgICogICAgICAgIHwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8Ci0gICAgICAgICAqCi0gICAgICAgICAqLwotCi0gICAgICAgIHBfZGF0YV8xID0gIGRhdGFfcXVhbnQ7ICAgICAgICAgICAgIC8qIHVzZXMgZmlyc3QgIGhhbGYgb2YgYnVmZmVyICovCi0gICAgICAgIHBfZGF0YV8yID0gJmRhdGFfcXVhbnRbbl8yIC0gMV07ICAgIC8qIHVzZXMgc2Vjb25kIGhhbGYgb2YgYnVmZmVyICovCi0KLSAgICAgICAgcF9yb3RhdGVfMiA9ICZwX3JvdGF0ZVtuXzQtMV07Ci0KLSAgICAgICAgc2hpZnQxID0gcHZfbm9ybWFsaXplKG1heCkgLSAxOyAgICAgLyogLTEgdG8gbGVhdmUgcm9vbSBmb3IgYWRkaXRpb24gKi8KLSAgICAgICAgUV9mb3JtYXQgLT0gKDE2IC0gc2hpZnQxKTsKLSAgICAgICAgbWF4ID0gMDsKLQotCi0gICAgICAgIGlmIChzaGlmdDEgPj0gMCkKLSAgICAgICAgewotICAgICAgICAgICAgdGVtcF9yZTMyID0gICAqKHBfZGF0YV8xKyspIDw8IHNoaWZ0MTsKLSAgICAgICAgICAgIHRlbXBfaW0zMiA9ICAgKihwX2RhdGFfMi0tKSA8PCBzaGlmdDE7Ci0KLSAgICAgICAgICAgIGZvciAoayA9IG5fNCA+PiAxOyBrICE9IDA7IGstLSkKLSAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAvKgotICAgICAgICAgICAgICAgICAqICBSZWFsIGFuZCBJbWFnIHBhcnRzIGhhdmUgYmVlbiBzd2FwZWQgdG8gdXNlIEZGVCBhcyBJRkZUCi0gICAgICAgICAgICAgICAgICovCi0gICAgICAgICAgICAgICAgLyoKLSAgICAgICAgICAgICAgICAgKiBjb3NfbiArIGoqc2luX24gPT0gZXhwKGooMnBpL04pKGsrMS84KSkKLSAgICAgICAgICAgICAgICAgKi8KLSAgICAgICAgICAgICAgICBleHBfancgPSAqcF9yb3RhdGUrKzsKLQotICAgICAgICAgICAgICAgIHRlbXAxICAgICAgPSAgY21wbHhfbXVsMzJfYnlfMTYodGVtcF9pbTMyLCAtdGVtcF9yZTMyLCBleHBfancpOwotICAgICAgICAgICAgICAgIHRlbXAyICAgICAgPSAtY21wbHhfbXVsMzJfYnlfMTYodGVtcF9yZTMyLCAgdGVtcF9pbTMyLCBleHBfancpOwotCi0gICAgICAgICAgICAgICAgdGVtcF9pbTMyID0gICAqKHBfZGF0YV8xLS0pIDw8IHNoaWZ0MTsKLSAgICAgICAgICAgICAgICB0ZW1wX3JlMzIgPSAgICoocF9kYXRhXzItLSkgPDwgc2hpZnQxOwotICAgICAgICAgICAgICAgICoocF9kYXRhXzErKykgPSB0ZW1wMTsKLSAgICAgICAgICAgICAgICAqKHBfZGF0YV8xKyspID0gdGVtcDI7Ci0gICAgICAgICAgICAgICAgbWF4ICAgICAgICAgfD0gKHRlbXAxID4+IDMxKSBeIHRlbXAxOwotICAgICAgICAgICAgICAgIG1heCAgICAgICAgIHw9ICh0ZW1wMiA+PiAzMSkgXiB0ZW1wMjsKLQotCi0gICAgICAgICAgICAgICAgLyoKLSAgICAgICAgICAgICAgICAgKiAgUmVhbCBhbmQgSW1hZyBwYXJ0cyBoYXZlIGJlZW4gc3dhcGVkIHRvIHVzZSBGRlQgYXMgSUZGVAotICAgICAgICAgICAgICAgICAqLwotCi0gICAgICAgICAgICAgICAgLyoKLSAgICAgICAgICAgICAgICAgKiBjb3NfbiArIGoqc2luX24gPT0gZXhwKGooMnBpL04pKGsrMS84KSkKLSAgICAgICAgICAgICAgICAgKi8KLQotICAgICAgICAgICAgICAgIGV4cF9qdyA9ICpwX3JvdGF0ZV8yLS07Ci0KLSAgICAgICAgICAgICAgICB0ZW1wMSAgICAgID0gIGNtcGx4X211bDMyX2J5XzE2KHRlbXBfaW0zMiwgLXRlbXBfcmUzMiwgZXhwX2p3KTsKLSAgICAgICAgICAgICAgICB0ZW1wMiAgICAgID0gLWNtcGx4X211bDMyX2J5XzE2KHRlbXBfcmUzMiwgIHRlbXBfaW0zMiwgZXhwX2p3KTsKLQotCi0gICAgICAgICAgICAgICAgdGVtcF9yZTMyID0gICAqKHBfZGF0YV8xKyspIDw8IHNoaWZ0MTsKLSAgICAgICAgICAgICAgICB0ZW1wX2ltMzIgPSAgICoocF9kYXRhXzItLSkgPDwgc2hpZnQxOwotCi0gICAgICAgICAgICAgICAgKihwX2RhdGFfMiArIDIpID0gdGVtcDE7Ci0gICAgICAgICAgICAgICAgKihwX2RhdGFfMiArIDMpID0gdGVtcDI7Ci0gICAgICAgICAgICAgICAgbWF4ICAgICAgICAgfD0gKHRlbXAxID4+IDMxKSBeIHRlbXAxOwotICAgICAgICAgICAgICAgIG1heCAgICAgICAgIHw9ICh0ZW1wMiA+PiAzMSkgXiB0ZW1wMjsKLQotICAgICAgICAgICAgfQotICAgICAgICB9Ci0gICAgICAgIGVsc2UKLSAgICAgICAgewotICAgICAgICAgICAgdGVtcF9yZTMyID0gICAqKHBfZGF0YV8xKyspID4+IDE7Ci0gICAgICAgICAgICB0ZW1wX2ltMzIgPSAgICoocF9kYXRhXzItLSkgPj4gMTsKLQotICAgICAgICAgICAgZm9yIChrID0gbl80ID4+IDE7IGsgIT0gMDsgay0tKQotICAgICAgICAgICAgewotICAgICAgICAgICAgICAgIC8qCi0gICAgICAgICAgICAgICAgICogIFJlYWwgYW5kIEltYWcgcGFydHMgaGF2ZSBiZWVuIHN3YXBlZCB0byB1c2UgRkZUIGFzIElGRlQKLSAgICAgICAgICAgICAgICAgKi8KLSAgICAgICAgICAgICAgICAvKgotICAgICAgICAgICAgICAgICAqIGNvc19uICsgaipzaW5fbiA9PSBleHAoaigycGkvTikoaysxLzgpKQotICAgICAgICAgICAgICAgICAqLwotICAgICAgICAgICAgICAgIGV4cF9qdyA9ICpwX3JvdGF0ZSsrOwotCi0gICAgICAgICAgICAgICAgdGVtcDEgICAgICA9ICBjbXBseF9tdWwzMl9ieV8xNih0ZW1wX2ltMzIsIC10ZW1wX3JlMzIsIGV4cF9qdyk7Ci0gICAgICAgICAgICAgICAgdGVtcDIgICAgICA9IC1jbXBseF9tdWwzMl9ieV8xNih0ZW1wX3JlMzIsICB0ZW1wX2ltMzIsIGV4cF9qdyk7Ci0KLSAgICAgICAgICAgICAgICB0ZW1wX2ltMzIgPSAgICoocF9kYXRhXzEtLSkgPj4gMTsKLSAgICAgICAgICAgICAgICB0ZW1wX3JlMzIgPSAgICoocF9kYXRhXzItLSkgPj4gMTsKLSAgICAgICAgICAgICAgICAqKHBfZGF0YV8xKyspID0gdGVtcDE7Ci0gICAgICAgICAgICAgICAgKihwX2RhdGFfMSsrKSA9IHRlbXAyOwotCi0gICAgICAgICAgICAgICAgbWF4ICAgICAgICAgfD0gKHRlbXAxID4+IDMxKSBeIHRlbXAxOwotICAgICAgICAgICAgICAgIG1heCAgICAgICAgIHw9ICh0ZW1wMiA+PiAzMSkgXiB0ZW1wMjsKLQotCi0gICAgICAgICAgICAgICAgLyoKLSAgICAgICAgICAgICAgICAgKiAgUmVhbCBhbmQgSW1hZyBwYXJ0cyBoYXZlIGJlZW4gc3dhcGVkIHRvIHVzZSBGRlQgYXMgSUZGVAotICAgICAgICAgICAgICAgICAqLwotCi0gICAgICAgICAgICAgICAgLyoKLSAgICAgICAgICAgICAgICAgKiBjb3NfbiArIGoqc2luX24gPT0gZXhwKGooMnBpL04pKGsrMS84KSkKLSAgICAgICAgICAgICAgICAgKi8KLSAgICAgICAgICAgICAgICBleHBfancgPSAqcF9yb3RhdGVfMi0tOwotCi0gICAgICAgICAgICAgICAgdGVtcDEgICAgICA9ICBjbXBseF9tdWwzMl9ieV8xNih0ZW1wX2ltMzIsIC10ZW1wX3JlMzIsIGV4cF9qdyk7Ci0gICAgICAgICAgICAgICAgdGVtcDIgICAgICA9IC1jbXBseF9tdWwzMl9ieV8xNih0ZW1wX3JlMzIsICB0ZW1wX2ltMzIsIGV4cF9qdyk7Ci0KLSAgICAgICAgICAgICAgICB0ZW1wX3JlMzIgPSAgICoocF9kYXRhXzErKykgPj4gMTsKLSAgICAgICAgICAgICAgICB0ZW1wX2ltMzIgPSAgICoocF9kYXRhXzItLSkgPj4gMTsKLQotICAgICAgICAgICAgICAgICoocF9kYXRhXzIgKyAzKSA9IHRlbXAyOwotICAgICAgICAgICAgICAgICoocF9kYXRhXzIgKyAyKSA9IHRlbXAxOwotCi0gICAgICAgICAgICAgICAgbWF4ICAgICAgICAgfD0gKHRlbXAxID4+IDMxKSBeIHRlbXAxOwotICAgICAgICAgICAgICAgIG1heCAgICAgICAgIHw9ICh0ZW1wMiA+PiAzMSkgXiB0ZW1wMjsKLQotICAgICAgICAgICAgfQotICAgICAgICB9Ci0KLQotICAgICAgICBpZiAobiAhPSBTSE9SVF9XSU5ET1dfVFlQRSkKLSAgICAgICAgewotCi0gICAgICAgICAgICBzaGlmdCAtPSBtaXhfcmFkaXhfZmZ0KGRhdGFfcXVhbnQsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICZtYXgpOwotCi0gICAgICAgICAgICBzaGlmdCAtPSBpbnZfbG9uZ19jb21wbGV4X3JvdChkYXRhX3F1YW50LAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbWF4KTsKLQotICAgICAgICB9Ci0gICAgICAgIGVsc2UgICAgICAgIC8qICBuXzQgaXMgNjQgKi8KLSAgICAgICAgewotCi0gICAgICAgICAgICBzaGlmdCAtPSBmZnRfcng0X3Nob3J0KGRhdGFfcXVhbnQsICAgJm1heCk7Ci0KLQotICAgICAgICAgICAgc2hpZnQgLT0gaW52X3Nob3J0X2NvbXBsZXhfcm90KGRhdGFfcXVhbnQsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZnJlcV8yX3RpbWVfYnVmZmVyLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1heCk7Ci0KLSAgICAgICAgICAgIHB2X21lbWNweShkYXRhX3F1YW50LAotICAgICAgICAgICAgICAgICAgICAgIGZyZXFfMl90aW1lX2J1ZmZlciwKLSAgICAgICAgICAgICAgICAgICAgICBTSE9SVF9XSU5ET1cqc2l6ZW9mKCpkYXRhX3F1YW50KSk7Ci0gICAgICAgIH0KLQotICAgIH0KLSAgICBlbHNlCi0gICAgewotICAgICAgICBRX2Zvcm1hdCA9IE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3aWR0aCB0YWJsZSAqLwotICAgIHBGcmFtZUluZm8tPnNmYl93aWR0aF8xMjggPSBwU2Zid2lkdGgxMjg7Ci0gICAgZm9yIChpID0gMCwgc3RhcnRfaWR4ID0gMCwgbnNmYl9zaG9ydCA9IHBTaS0+bnNmYjEyODsgaSA8IG5zZmJfc2hvcnQ7IGkrKykKLSAgICB7Ci0gICAgICAgIGVuZF9pZHggPSBwdF9TRmJhbmRzMTI4W2ldOwotICAgICAgICBwU2Zid2lkdGgxMjhbaV0gPSBlbmRfaWR4IC0gc3RhcnRfaWR4OwotICAgICAgICBzdGFydF9pZHggPSBlbmRfaWR4OwotICAgIH0KLQotCi0gICAgLyogY29tbW9uIHRvIGxvbmcgYW5kIHNob3J0ICovCi0gICAgZm9yICh3aW5fc2VxID0gMDsgd2luX3NlcSA8IE5VTV9XSU5fU0VROyB3aW5fc2VxKyspCi0gICAgewotCi0gICAgICAgIGlmIChwcFdpbl9zZXFfaW5mb1t3aW5fc2VxXSAhPSBOVUxMKQotICAgICAgICB7Ci0gICAgICAgICAgICBwRnJhbWVJbmZvICAgICAgICAgICAgICAgICA9IHBwV2luX3NlcV9pbmZvW3dpbl9zZXFdOwotICAgICAgICAgICAgcEZyYW1lSW5mby0+c2ZiX3Blcl9mcmFtZSAgPSAwOwotICAgICAgICAgICAgc2ZiX3NiayAgICAgICAgICAgICAgICAgICAgPSAwOwotICAgICAgICAgICAgYmluc19zYmsgICAgICAgICAgICAgICAgICAgPSAwOwotCi0gICAgICAgICAgICBmb3IgKGkgPSAwOyBpIDwgcEZyYW1lSW5mby0+bnVtX3dpbjsgaSsrKQotICAgICAgICAgICAgewotCi0gICAgICAgICAgICAgICAgLyogY29tcHV0ZSBjb2VmX3Blcl93aW4gKi8KLSAgICAgICAgICAgICAgICBwRnJhbWVJbmZvLT5jb2VmX3Blcl93aW5baV0gPQotICAgICAgICAgICAgICAgICAgICBwRnJhbWVJbmZvLT5jb2VmX3Blcl9mcmFtZSAvIHBGcmFtZUluZm8tPm51bV93aW47Ci0KLSAgICAgICAgICAgICAgICAvKiBjb21wdXRlIHNmYl9wZXJfZnJhbWUgKi8KLSAgICAgICAgICAgICAgICBwRnJhbWVJbmZvLT5zZmJfcGVyX2ZyYW1lICs9IHBGcmFtZUluZm8tPnNmYl9wZXJfd2luW2ldOwotCi0gICAgICAgICAgICAgICAgLyogY29uc3RydWN0IGRlZmF1bHQgKG5vbi1pbnRlcmxlYXZlZCkgYmtfc2ZiX3RvcFtdICovCi0gICAgICAgICAgICAgICAgc2ZiYW5kcyA9IHBGcmFtZUluZm8tPndpbl9zZmJfdG9wW2ldOwotICAgICAgICAgICAgICAgIGZvciAoc2ZiX2lkeCA9IDA7IHNmYl9pZHggPCBwRnJhbWVJbmZvLT5zZmJfcGVyX3dpbltpXTsKLSAgICAgICAgICAgICAgICAgICAgICAgIHNmYl9pZHgrKykKLSAgICAgICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgICAgIHBGcmFtZUluZm8tPmZyYW1lX3NmYl90b3Bbc2ZiX2lkeCtzZmJfc2JrXSA9Ci0gICAgICAgICAgICAgICAgICAgICAgICBzZmJhbmRzW3NmYl9pZHhdICsgYmluc19zYms7Ci0gICAgICAgICAgICAgICAgfQotCi0gICAgICAgICAgICAgICAgYmluc19zYmsgKz0gcEZyYW1lSW5mby0+Y29lZl9wZXJfd2luW2ldOwotICAgICAgICAgICAgICAgIHNmYl9zYmsgICs9IHBGcmFtZUluZm8tPnNmYl9wZXJfd2luW2ldOwotICAgICAgICAgICAgfSAvKiBmb3IgaSA9IHNiayBlbmRzICovCi0gICAgICAgIH0KLQotICAgIH0gLyogZm9yIHdpbl9zZXEgZW5kcyAqLwotCi0gICAgcmV0dXJuIFNVQ0NFU1M7Ci0KLX0gLyogaW5mb2luaXQgKi8KZGlmZiAtLWdpdCBhL21lZGlhL2xpYnN0YWdlZnJpZ2h0L2NvZGVjcy9hYWNkZWMvaW5pdF9zYnJfZGVjLmNwcCBiL21lZGlhL2xpYn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gICAgIGNoYW5uZWwgZm9yIHVzZSBvbiB0aGUgcmlnaHQuCi0gICAgICAgICAgICAgICAgICAgIFtjb25zdCBJbnRdCi0KLSAgICBjb2VmX3Blcl93aW4gPSAgTnVtYmVyIG9mIGNvZWZmaWNpZW50cyBwZXIgd2luZG93LgotICAgICAgICAgICAgICAgICAgICAoMTI4IGZvciBzaG9ydCwgMTAyNCBmb3IgbG9uZykKLSAgICAgICAgICAgICAgICAgICAgW2NvbnN0IEludF0KLQotICAgIHNmYl9wZXJfd2luICA9ICBOdW1iZXIgb2Ygc2NhbGVmYWN0b3IgYmFuZHMgcGVyIHdpbmRvdy4gIFRoaXMgc2hvdWxkIGJlCi0gICAgICAgICAgICAgICAgICAgIGEgbnVtYmVyIGRpdmlzaWJsZSBieSBmb3VyLgotICAgICAgICAgICAgICAgICAgICBbY29uc3QgSW50XQotCi0gICAgd2luc19pbl9ncm91cCA9IFRoZSBudW1iZXIgb2Ygd2luZG93cyBpbiB0aGUgZ3JvdXAgYmVpbmcgZGVjb2RlZC4KLSAgICAgICAgICAgICAgICAgICAgVGhpcyBudW1iZXIgZmFsbHMgd2l0aGluIHRoZSByYW5nZSAxLTguCi0gICAgICAgICAgICAgICAgICAgIFtjb25zdCBJbnRdCi0KLSAgICBiYW5kX2xlbmd0aCAgPSAgVGhlIGxlbmd0aCBvZiB0aGUgc2NhbGVmYWN0b3IgYmFuZCBiZWluZyBkZWNvZGVkLgotICAgICAgICAgICAgICAgICAgICBUaGlzIHZhbHVlIGlzIGRpdmlzaWJsZSBieSA0LgotICAgICAgICAgICAgICAgICAgICBbY29uc3QgSW50XQotCi0gICAgY29kZWJvb2sgICAgID0gIFZhbHVlIHRoYXQgZGVub3RlcyB3aGljaCBIdWZmbWFuIGNvZGVib29rIHdhcyB1c2VkIGZvcgotICAgICAgICAgICAgICAgICAgICB0aGUgZW5jb2Rpbmcgb2YgdGhpcyBncm91cGVkIHNjYWxlZmFjdG9yIGJhbmQuCi0gICAgICAgICAgICAg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AgICArMQotICAgICAqIElOVEVOU0lUWV9IQ0IyIHwgRkFMU0UgICB8ICAgIC0xCi0gICAgICoKLSAgICAgKiBJbiBiaW5hcnksIHRoZSBhYm92ZSB0YWJsZSBpcyByZXByZXNlbnRlZCBhcy4uLgotICAgICAqCi0gICAgICogY29kZWJvb2sgICAgICAgfCBtc191c2VkIHwgbXVsdGlwbGllcgotICAgICAqIC0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tCi0gICAgICogMTExMWIgICAgICAgICAgfCAxICAgICAgIHwgICAgLTEKLSAgICAgKiAxMTExYiAgICAgICAgICB8IDAgICAgICAgfCAgICArMQotICAgICAqIDExMTBiICAgICAgICAgIHwgMSAgICAgICB8ICAgICsxCi0gICAgICogMTExMGIgICAgICAgICAgfCAwICAgICAgIHwgICAgLTEKLSAgICAgKgotICAgICAqLwotCi0gICAgLyoKLSAgICAgKiBEZXJpdmluZyB0aGUgY29ycmVjdCB2YWx1ZSBmb3IgIm11bHRpcGxpZXIiIGlzIGlsbHVzdHJhdGVkCi0gICAgICogYmVsb3cgZm9yIGFsbCA0IHBvc3NpYmxlIGNvbWJpbmF0aW9ucyBvZiBjb2RlYm9vayBhbmQgbXNfdXNlZAotICAgICAqLwotCi0gICAgLyoKLSAgICAgKiAxMTExYiBBTkQgMHgxID0gMWIKLSAgICAgKiAxMTExYiBBTkQgMHgxID0gMWIKLSAgICAgKiAxMTEwYiBBTkQgMHgxID0gMGIKLSAgICAgKiAxMTEwYiBBTkQgMHgxID0gMGIKLSAgICAgKi8KLSAgICBtdWx0aXBsaWVyICA9IChjb2RlYm9vayAmIDB4MSk7Ci0KLSAgICAvKgotICAgICAqIDFiIFhPUiAxID0gMGIKLSAgICAgKiAxYiBYT1IgMCA9IDFiCi0gICAgICogMGIgWE9SIDEgPSAxYgotICAgICAqIDBiIFhPUiAwID0gMGIKLSAgICAgKi8KLSAgICBtdWx0aXBsaWVyIF49IG1zX3VzZWQ7Ci0KLS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AgIGlmIChtdWx0aXBsaWVyID09IDMyNzY3KQotICAgICAgICB7Ci0gICAgICAgICAgICBJbnQzMiB0ZW1wSW50MiA9ICoocENvZWZMZWZ0KyspOwotICAgICAgICAgICAgSW50MzIgdGVtcEludDIyID0gKihwQ29lZkxlZnQrKyk7Ci0KLSAgICAgICAgICAgIGZvciAoSW50IHRlbXBJbnQgPSBiYW5kX2xlbmd0aCA+PiAxOyB0ZW1wSW50ID4gMDsgdGVtcEludC0tKQotICAgICAgICAgICAgewotICAgICAgICAgICAgICAgICoocENvZWZSaWdodCsrKSA9IHRlbXBJbnQyOwotICAgICAgICAgICAgICAgICoocENvZWZSaWdodCsrKSA9IHRlbXBJbnQyMjsKLSAgICAgICAgICAgICAgICB0ZW1wSW50MiA9ICoocENvZWZMZWZ0KyspOwotICAgICAgICAgICAgICAgIHRlbXBJbnQyMiA9ICoocENvZWZMZWZ0KyspOwotICAgICAgICAgICAgfQotCi0gICAgICAgIH0KLSAgICAgICAgZWxzZQotICAgICAgICB7Ci0KLSAgICAgICAgICAgIEludDMyIHRlbXBJbnQyID0gKihwQ29lZkxlZnQrKyk7Ci0gICAgICAgICAgICBJbnQzMiB0ZW1wSW50MjIgPSAqKHBDb2VmTGVmdCsrKTsKLSAgICAgICAgICAgIGZvciAoSW50IHRlbXBJbnQgPSBiYW5kX2xlbmd0aCA+PiAxOyB0ZW1wSW50ID4gMDsgdGVtcEludC0tKQotICAgICAgICAgICAgewotICAgICAgICAgICAgICAgICoocENvZWZSaWdodCsrKSA9IGZ4cF9tdWwzMl9ieV8xNih0ZW1wSW50MiwgbXVsdGlwbGllcikgPDwgMTsKLSAgICAgICAgICAgICAgICAqKHBDb2VmUmlnaHQrKykgPSBmeHBfbXVsMzJfYnlfMTYodGVtcEludDIyLCBtdWx0aXBsaWVyKSA8PCAxOwotICAgICAgICAgICAgICAgIHRlbXBJbnQyID0gKihwQ29lZkxlZnQrKyk7Ci0gICAgICAgICAgICAgICAgdGVtcEludDIyID0gKihw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gIG5fNCAgID0gbiA+PiAyOwotICAgIEludCAgICAgbl8zXzQgPSBuXzIgKyBuXzQ7Ci0KLSAgICBJbnQxNiAgICpweF8xOwotICAgIEludDE2ICAgKnB4XzI7Ci0gICAgSW50MTYgICAqcHhfMzsKLSAgICBJbnQxNiAgICpweF80OwotCi0gICAgSW50MTYgICAgIEo7Ci0gICAgY29uc3QgICBJbnQzMiAqcF9yb3RhdGUyOwotCi0KLQotCi0gICAgcF9yb3RhdGUgICAgPSAgJmV4cF9yb3RhdGlvbl9OXzIwNDhbMjU1XTsKLSAgICBwX3JvdGF0ZTIgICA9ICAmZXhwX3JvdGF0aW9uX05fMjA0OFsyNTZdOwotCi0gICAgcERhdGFfaW5fcmVmMSAgPSAgRGF0YTsKLSAgICBwRGF0YV9pbl9yZWYyICA9ICZEYXRhW1RXSUNFX0lOVl9MT05HX0NYX1JPVF9MRU5HVEhdOwotCi0KLSAgICAvKgotICAgICAqICBBcHBseSAgQS8yXihkaWZmKSArIEIKLSAgICAgKi8KLQotICAgIHBfRGF0YV9JbnRfcHJlY2lzaW9uID0gKEludDE2ICopRGF0YTsKLQotICAgIGV4cCA9IDE2IC0gcHZfbm9ybWFsaXplKG1heCk7Ci0KLQotICAgIC8qCi0gICAgICogICAgICAgIHB4Mi0tPiAgICAgICAgICAgICAgIDwtLXB4MSBweDQtLT4gICAgICAgICAgICAgICA8LS1weDMKLSAgICAgKgotICAgICAqICAgICAgICAgICAgICAgICAgICAgfCAgICAgICAgICAgICAgICAgICAgICAgICAgIHwgICAgICAgICAgICAgfAotICAgICAqICAgICAgIHwrKysrKysrKysrKysrfCsrKysrKysrKysrKyt8KysrKysrKysrKysrK3wrKysrKysrKysrKysrfAotICAgICAqICAgICAgICAgICAgICAgICAgICAgfCAgICAgICAgICAgICB8ICAgICAgICAgICAgIHwgICAgICAgICAgICAgfAotICAgICAqICAgICAgICAgICAgICAgICAgICBuLzQgICAgICAgICAgIG4vMiAgICAgICAgICAzbi80Ci0gICAgICovCi0KLSAgICBJID0gMjU1OwotICAgIEogPSAyNTY7Ci0KLSAgICBwRGF0YV9pbl8xID0gcERhdGFfaW5fcmVmMiArIEk7Ci0KLSAgICBweF8xID0gKEludDE2ICopcERhdGFfaW5fMTsKLSAgICBweF8xKys7Ci0KLSAgICBwRGF0YV9pbl8yID0gcERhdGFfaW5fcmVmMiArIEo7Ci0KLSAgICBweF80ID0gKEludDE2ICopcERhdGFfaW5fMjsKLQotCi0KLSAgICBleHAgLT0gMTsKLQotCi0gICAgZm9yIChpID0gSU5WX0xPTkdfQ1hfUk9UX0xFTkdUSCA+PiAxOyBpICE9IDA7IGktLSkKLSAgICB7Ci0KLSAgICAgICAgcERhdGFfaW5fMiA9IHBEYXRhX2luX3JlZjEgKyBKOwotCi0gICAgICAgIHRlbXBfaW0gPSAgKihwRGF0YV9pbl8yKyspOwotICAgICAgICB0ZW1wX3JlID0gICoocERhdGFfaW5fMik7Ci0KLQotICAgICAgICAvKgotICAgICAgICAgKiBjb3NfbiArIGoqc2luX24gPT0gZXhwKGooMnBpL04pKGsrMS84KSkKLSAgICAgICAgICovCi0gICAgICAgIGV4cF9qdyA9ICpwX3JvdGF0ZTIrKzsKLQotICAgICAgICAvKgotICAgICAgICAgKiAgIFBvc3Qtcm90YXRpb24KLSAgICAgICAgICovCi0KLQotCi0gICAgICAgIHRlbXBfcmVfMCAgPSAoSW50MTYpKGNtcGx4X211bDMyX2J5XzE2KHRlbXBfcmUsICAtdGVtcF9pbSwgIGV4cF9qdykgPj4gZXhwKTsKLSAgICAgICAgdGVtcF9pbV8wICA9IChJbnQxNikoY21wbHhfbXVsMzJfYnlfMTYodGVtcF9pbSwgICB0ZW1wX3JlLCAgZXhwX2p3KSA+PiBleHApOwotCi0KLSAgICAgICAgcERhdGFfaW5fMSA9IHBEYXRhX2luX3JlZjIgKyBJOwotCi0gICAgICAgIC8qCi0gICAgICAgICAqICBVc2UgYXV4aWxpYXJ5IHZhcmlhYmxlcyB0byBhdm9pZCBkb3VibGUgYWNjZXNzZXMgdG8gbWVtb3J5LgotICAgICAgICAgKiAgRGF0YSBpbiBpcyBzY2FsZWQgdG8gdXNlIG9ubHkgbG93ZXIgMTYgYml0cy4KLSAgICAgICAgICovCi0KLSAgICAgICAgdGVtcF9yZSA9ICAqKHBEYXRhX2luXzEtLSk7Ci0gICAgICAgIHRlbXBfaW0gPSAgKihwRGF0YV9pbl8xKTsKLQotICAgICAgICAvKgotICAgICAgICAgKiBjb3NfbiArIGoqc2luX24gPT0gZXhwKGooMnBpL04pKGsrMS84KSkKLSAgICAgICAgICovCi0gICAgICAgIGV4cF9qdyA9ICpwX3JvdGF0ZS0tOwotCi0KLSAgICAgICAgLyoKLSAgICAgICAgICogICBQb3N0LXJvdGF0aW9uCi0gICAgICAgICAqLwotCi0gICAgICAgIHRlbXBfcmVfMSAgPSAoSW50MTYpKGNtcGx4X211bDMyX2J5XzE2KHRlbXBfcmUsICAtdGVtcF9pbSwgIGV4cF9qdykgPj4gZXhwKTsKLSAgICAgICAgdGVtcF9pbV8xICA9IChJbnQxNikoY21wbHhfbXVsMzJfYnlfMTYodGVtcF9pbSwgICB0ZW1wX3JlLCAgZXhwX2p3KSA+PiBleHApOwotCi0KLSAgICAgICAgLyoKLSAgICAgICAgICogICBSZXBlYXQgcHJvY2VkdXJlIGZvciBvZGQgaW5kZXggYXQgdGhlIG91dHB1dAotICAgICAgICAgKi8KLQotICAgICAgICBwRGF0YV9pbl8yID0gcERhdGFfaW5fcmVmMiArIEo7Ci0gICAgICAgIEogKz0gMjsKLQotICAgICAgICB0ZW1wX2ltID0gICoocERhdGFfaW5fMisrKTsKLSAgICAgICAgdGVtcF9yZSA9ICAqKHBEYXRhX2luXzIpOwotCi0KLSAgICAgICAgKihweF8xLS0pID0gIHRlbXBfcmVfMDsKLSAgICAgICAgKihweF8xLS0pID0gIHRlbXBfaW1fMTsKLSAgICAgICAgKihweF80KyspID0gIHRlbXBfaW1fMDsKLSAgICAgICAgKihweF80KyspID0gIHRlbXBfcmVfMTsKLQotCi0gICAgICAgIGV4cF9qdyA9ICpwX3JvdGF0ZTIrKzsKLQotCi0gICAgICAgICoocHhfMS0tKSAgPSAoSW50MTYpKGNtcGx4X211bDMyX2J5XzE2KHRlbXBfcmUsICAtdGVtcF9pbSwgIGV4cF9qdykgPj4gZXhwKTsKLSAgICAgICAgKihweF80KyspICA9IChJbnQxNikoY21wbHhfbXVsMzJfYnlfMTYodGVtcF9pbSwgICB0ZW1wX3JlLCAgZXhwX2p3KSA+PiBleHApOwotCi0KLQotICAgICAgICAvKgotICAgICAgICAgKiAgIFJlcGVhdCBwcm9jZWR1cmUgZm9yIG9kZCBpbmRleCBhdCB0aGUgb3V0cHV0Ci0gICAgICAgICAqLwotCi0gICAgICAgIHBEYXRhX2luXzEgPSBwRGF0YV9pbl9yZWYxICsgSTsKLSAgICAgICAgSSAtPSAyOwotCi0gICAgICAgIHRlbXBfcmUgPSAgKihwRGF0YV9pbl8xLS0pOwotICAgICAgICB0ZW1wX2ltID0gICoocERhdGFfaW5fMSk7Ci0KLQotICAgICAgICBleHBfancgPSAqcF9yb3RhdGUtLTsKLQotCi0gICAgICAgICoocHhfNCsrKSAgPSAoSW50MTYpKGNtcGx4X211bDMyX2J5XzE2KHRlbXBfcmUsICAtdGVtcF9pbSwgIGV4cF9qdykgPj4gZXhwKTsKLSAgICAgICAgKihweF8xLS0pICA9IChJbnQxNikoY21wbHhfbXVsMzJfYnlfMTYodGVtcF9pbSwgICB0ZW1wX3JlLCAgZXhwX2p3KSA+PiBleHApOwotCi0gICAgfQotCi0gICAgLyoKLSAgICAgKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA8LS1weDEgcHg0LS0+Ci0gICAgICoKLSAgICAgKiAgICAgICAgICAgICAgICAgICAgIHwgICAgICAgICAgICAgICAgICAgICAgICAgICB8ICAgICAgICAgICAgIHwKLSAgICAgKiAgICAgICB8LS0tLS0tLS0tLS0tLXwtLS0tLS0tLS0tLS0tfC8vLy8vLy8vLy8vLy98XFxcXFxcXFxcXFxcXHwKLSAgICAgKiAgICAgICAgICAgICAgICAgICAgIHwgICAgICAgICAgICAgfCAgICAgICAgICAgICB8ICAgICAgICAgICAgIHwKLSAgICAgKiAgICAgICAgICAgICAgICAgICAgbi80ICAgICAgICAgICBuLzIgICAgICAgICAgM24vNAotICAgICAqLwotCi0KLSAgICBweF8xID0gcF9EYXRhX0ludF9wcmVjaXNpb24gKyBuXzIgLSAxOwotICAgIHB4XzIgPSBwX0RhdGFfSW50X3ByZWNpc2lvbjsKLQotICAgIHB4XzQgPSBwX0RhdGFfSW50X3ByZWNpc2lvbiArIG5fM180IC0gMTsKLQotICAgIGZvciAoaSA9IDA7IGk8SU5WX0xPTkdfQ1hfUk9UX0xFTkdUSCA+PiAxOyBpKyspCi0gICAgewotCi0gICAgICAgIEludDE2IHRlbXBfcmVfMCA9ICoocHhfNC0tKTsKLSAgICAgICAgSW50MTYgdGVtcF9pbV8xID0gKihweF80LS0pOwotICAgICAgICBJbnQxNiB0ZW1wX3JlXzIgPSAqKHB4XzQtLSk7Ci0gICAgICAgIEludDE2IHRlbXBfaW1fMyA9ICoocHhfNC0tKTsKLSAgICAgICAgKihweF8xLS0pID0gdGVtcF9yZV8wOwotICAgICAgICAqKHB4XzEtLSkgPSB0ZW1wX2ltXzE7Ci0gICAgICAgICoocHhfMS0tKSA9IHRlbXBfcmVfMjsKLSAgICAgICAgKihweF8xLS0pID0gdGVtcF9pbV8zOwotCi0gICAgICAgICoocHhfMisrKSA9ICgtdGVtcF9yZV8wKTsKLSAgICAgICAgKihweF8yKyspID0gKC10ZW1wX2ltXzEpOwotICAgICAgICAqKHB4XzIrKykgPSAoLXRlbXBfcmVfMik7Ci0gICAgICAgICoocHhfMisrKSA9ICgtdGVtcF9pbV8zKTsKLQotICAgIH0KLQotCi0gICAgcHhfNCA9IHBfRGF0YV9JbnRfcHJlY2lzaW9uICsgbl8yOwotCi0KLSAgICBwdl9tZW1jcHkocHhfNCwgcERhdGFfaW5fcmVmMiArIDI1NiwgVFdJQ0VfSU5WX0xPTkdfQ1hfUk9UX0xFTkdUSCpzaXplb2YoKnB4XzQpKTsKLQotCi0KLSAgICAvKgotICAgICAqICAgICAgICBweDItLT4gICAgICAgICAgICAgICA8LS1weDEgcHg0LS0+ICAgICAgICAgICAgICAgPC0tcHgzCi0gICAgICoKLSAgICAgKiAgICAgICAgICAgICAgICAgICAgIHwgICAgICAgICAgICAgICAgICAgICAgICAgICB8ICAgICAgICAgICAgIHwKLSAgICAgKiAgICAgICB8KysrKysrKysrKysrK3wrKysrKysrKysrKysrfCsrKysrKysrKysrKyt8KysrKysrKysrKysrK3wKLSAgICAgKiAgICAgICAgICAgICAgICAgICAgIHwgICAgICAgICAgICAgfCAgICAgICAgICAgICB8ICAgICAgICAgICAgIHwKLSAgICAgKiAgICAgICAgICAgICAgICAgICAgbi80ICAgICAgICAgICBuLzIgICAgICAgICAgM24vNAotICAgICAqLwotICAgIHB4XzMgPSBwX0RhdGFfSW50X3ByZWNpc2lvbiArIG4gLSAxOwotCi0KLSAgICBmb3IgKGkgPSAwOyBpPElOVl9MT05HX0NYX1JPVF9MRU5HVEggPj4gMTsgaSsrKQotICAgIHsKLQotICAgICAgICBJbnQxNiB0ZW1wX2ltXzAgPSAqKHB4XzQrKyk7Ci0gICAgICAgIEludDE2IHRlbXBfcmVfMSA9ICoocHhfNCsrKTsKLSAgICAgICAgSW50MTYgdGVtcF9pbV8yID0gKihweF80KyspOwotICAgICAgICBJbnQxNiB0ZW1wX3JlXzMgPSAqKHB4XzQrKyk7Ci0gICAgICAgICoocHhfMy0tKSA9ICB0ZW1wX2ltXzA7Ci0gICAgICAgICoocHhfMy0tKSA9ICB0ZW1wX3JlXzE7Ci0gICAgICAgICoocHhfMy0tKSA9ICB0ZW1wX2ltXzI7Ci0gICAgICAgICoocHhfMy0tKSA9ICB0ZW1wX3JlXzM7Ci0KLSAgICB9Ci0KLQotICAgIHJldHVybiAoZXhwICsgMSk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gICAgICBudW1fc2FtcGxlcyA9IGJsb2NrX2xlbmd0aDsKLQotICAgICAgICBFTkRJRgotCi0gICAgICAgIHBCdWZmZXIgPSAmYnVmZmVyW2pdOwotCi0gICAgICAgIEZPUiAoaSA9IG51bV9zYW1wbGVzOyBpPjA7IGktLSkKLQotICAgICAgICAgICAgKnBQcmVkaWN0ZWRfc2FtcGxlcyA9IHdlaWdodCAqICgqcEJ1ZmZlcik7Ci0gICAgICAgICAgICBwUHJlZGljdGVkX3NhbXBsZXMgPSBwUHJlZGljdGVkX3NhbXBsZXMgKyAxOwotICAgICAgICAgICAgcEJ1ZmZlciA9IHBCdWZmZXIgKyAxOwotCi0gICAgICAgIEVOREZPUgotCi0gICAgICAgIEZPUiAoaSA9IGJsb2NrX2xlbmd0aCAtIG51bV9zYW1wbGVzOyBpPjA7IGktLSkKLQotICAgICAgICAgICAgKnBQcmVkaWN0ZWRfc2FtcGxlcyA9IDA7Ci0gICAgICAgICAgICBwUHJlZGljdGVkX3NhbXBsZXMgPSBwUHJlZGljdGVkX3NhbXBsZXMgKyAxOwotCi0gICAgICAgIEVOREZPUgotCi0gICAgRUxTRQotCi0gICAgICAgIEZPUiAod25kID0gMDsgd25kIDwgc2hvcnRfd2luZG93X251bTsgd25kKyspCi0KLSAgICAgICAgICAgIElGICh3aW5fcHJlZGljdGlvbl91c2VkW3duZF0gIT0gRkFMU0UpCi0gICAgICAgICAgICBUSEVOCi0KLSAgICAgICAgICAgICAgICBkZWxheVt3bmRdID0gZGVsYXlbMF0gKyBsdHBfc2hvcnRfbGFnW3duZF07Ci0KLSAgICAgICAgICAgICAgICBsYWcgPSBkZWxheVt3bmRdOwotCi0gICAgICAgICAgICAgICAgaiA9IHduZCpzaG9ydF9ibG9ja19sZW5ndGggLSBsYWc7Ci0KLSAgICAgICAgICAgICAgICBJRiAobGFnIDwgc2hvcnRfZnJhbWVfbGVuZ3RoKQotICAgICAgICAgICAgICAgIFRIRU4KLQotICAgICAgICAgICAgICAgICAgICBudW1fc2FtcGxlcyA9IHNob3J0X2ZyYW1lX2xlbmd0aCArIGxhZzsKLQotICAgICAgICAgICAgICAgIEVMU0UKLQotICAgICAgICAgICAgICAgICAgICBudW1fc2FtcGxlcyA9IHNob3J0X2Jsb2NrX2xlbmd0aDsKLQotICAgICAgICAgICAgICAgIEVORElGCi0KLSAgICAgICAgICAgICAgICBwQnVmZmVyID0gJmJ1ZmZlcltqXTsKLQotICAgICAgICAgICAgICAgIEZPUiAoaSA9IG51bV9zYW1wbGVzOyBpPjA7IGktLSkKLQotICAgICAgICAgICAgICAgICAgICAqcFByZWRpY3RlZF9zYW1wbGVzID0gd2VpZ2h0ICogKCpwQnVmZmVyKTsKLSAgICAgICAgICAgICAgICAgICAgcFByZWRpY3RlZF9zYW1wbGVzID0gcFByZWRpY3RlZF9zYW1wbGVzICsgMTsKLSAgICAgICAgICAgICAgICAgICAgcEJ1ZmZlciA9IHBCdWZmZXIgKyAxOwotCi0gICAgICAgICAgICAgICAgRU5ERk9SCi0KLSAgICAgICAgICAgICAgICBGT1IgKGkgPSBzaG9ydF9ibG9ja19sZW5ndGggLSBudW1fc2FtcGxlczsgaT4wOyBpLS0pCi0KLSAgICAgICAgICAgICAgICAgICAgKnBQcmVkaWN0ZWRfc2FtcGxlcyA9IDA7Ci0gICAgICAgICAgICAgICAgICAgIHBQcmVkaWN0ZWRfc2FtcGxlcyA9IHBQcmVkaWN0ZWRfc2FtcGxlcyArIDE7Ci0KLSAgICAgICAgICAgICAgICBFTkRGT1IKLQotICAgICAgICAgICAgRUxTRQotCi0gICAgICAgICAgICAgICAgQ0FMTCBwdl9tZW1zZXQoCi0gICAgICAgICAgICAgICAgICAgICAgICBwUHJlZGljdGVkX3NhbXBsZXMsCi0gICAgICAgICAgICAgICAgICAgICAgICAwLAotICAgICAgICAgICAgICAgICAgICAgICAgc2l6ZW9mKCpwUHJlZGljdGVkX3NhbXBsZXMpKnNob3J0X2Jsb2NrX2xlbmd0aCk7Ci0gICAgICAgICA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tLS0tLS0tLS0tLS0tLS0tLQotICAgIDsgRnVuY3Rpb24gYm9keSBoZXJlCi0gICAgLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSovCi0gICAgLyogSW5pdGlhbGl6ZSBwb2ludGVycyAqLwotICAgIHBQcmVkaWN0ZWRfc2FtcGxlcyA9ICZwcmVkaWN0ZWRfc2FtcGxlc1swXTsKLQotICAgIHdlaWdodCA9IGNvZGVib29rW3dlaWdodF9pbmRleF07Ci0KLSAgICAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLSAgICAvKiBMVFAgZGVjb2RpbmcgcHJvY2VzcyBmb3IgbG9uZyB3aW5kb3cgKi8KLSAgICAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLQotICAgIGlmICh3aW5fc2VxICE9IEVJR0hUX1NIT1JUX1NFUVVFTkNFKQotICAgIHsKLSAgICAgICAgLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0gICAgICAgIC8qIFByZWRpY3Rpb24gYmFzZWQgb24gcHJldmlvdXMgdGltZSBkb21haW4gc2lnbmFscyAqLwotICAgICAgICAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLSAgICAgICAgYmxvY2tfbGVuZ3RoID0gZnJhbWVfbGVuZ3RoIDw8IDE7Ci0KLSAgICAgICAgLyogQ2FsY3VsYXRlIHRpbWUgbGFnIGZvciAxLXRhcCBJSVIgZmlsdGVyICovCi0gICAgICAgIGxhZyA9IGRlbGF5WzBdOwotCi0gICAgICAgIGx0cF9idWZmZXJfaW5kZXggPSBibG9ja19sZW5ndGggLSBsYWc7Ci0KLSAgICAgICAgLyogQ2FsY3VsYXRlIG51bWJlciBvZiBzYW1wbGVzIHVzZWQgaW4gSUlSIGZpbHRlciAqLwotICAgICAgICBpZiAobGFnIDwgZnJhbWVfbGVuZ3RoKQotICAgICAgICB7Ci0gICAgICAgICAgICBudW1fc2FtcGxlcyA9IGZyYW1lX2xlbmd0aCArIGxhZzsKLSAgICAgICAgfQotICAgICAgICBlbHNlCi0gICAgICAgIHsKLSAgICAgICAgICAgIG51bV9zYW1wbGVzID0gYmxvY2tfbGVuZ3RoOwotICAgICAgICB9Ci0KLQotICAgICAgICAvKgotICAgICAgICAgKiBDYWxjdWxhdGUgdGhlIHByZWRpY3RlZCB0aW1lIGRvbWFpbiBzaWduYWxzIGZyb20gdGhlCi0gICAgICAgICAqIHJlY29uc3RydWN0ZWQgdGltZSBkb21haW4gc2lnbmFscyBvZiBwcmV2aW91cyBmcmFtZXMuCi0gICAgICAgICAqLwotCi0gICAgICAgIC8qIFRoZSBkYXRhIGlzIHN0b3JlZCBpbiBUV08gYnVmZmVycywgZWl0aGVyIGFzLi4uCi0gICAgICAgICAqCi0gICAgICAgICAqICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgWyAgIHQgPT0gIDAgIF0KLSAgICAgICAgICoKLSAgICAgICAgICogWyAgIHQgPT0gLTEgICBdWyAgIHQgPT0gLTIgICBdCi0gICAgICAgICAqCi0gICAgICAgICAqIE9SLi4uCi0gICAgICAgICAqICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgWyAgIHQgPT0gIDAgIF0KLSAgICAgICAgICoKLSAgICAgICAgICogWyAgIHQgPT0gLTIgICBdWyAgIHQgPT0gLTEgICBdCi0gICAgICAgICAqCi0gICAgICAgICAqCi0gICAgICAgICAqCi0gICAgICAgICAqIEluIHRoZSBmaXJzdCBjYXNlLCBhbGwgb2YgdGhlIGJ1ZmZlcnMgYXJlIG5vbi1jb250aWd1b3VzLAotICAgICAgICAgKiBhbmQgZWFjaCBtdXN0IGJlIGhhbmRsZWQgc2VwYXJhdGVseS4gIENvZGUgZm9yIHRoa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pbmRleCA8IDEwMjQKLSAgICAgICAgICoKLSAgICAgICAgICogQlVGRkVSIHQgPT0gLTIKLSAgICAgICAgICoKLSAgICAgICAgICogWzBdW11bXVtdW11bXVtdW11bXVtdW11bLi4uXVtdW11bXVtdW11bXVtdW11bXVtdW11bMTAyM10KLSAgICAgICAgICoKLSAgICAgICAgICovCi0KLSAgICAgICAganVtcF9wb2ludCA9IChmcmFtZV9sZW5ndGggLSBsdHBfYnVmZmVyX2luZGV4KTsKLQotICAgICAgICBpZiAoanVtcF9wb2ludCA+IDApCi0gICAgICAgIHsKLSAgICAgICAgICAgIHBCdWZmZXIgPSAmKGJ1ZmZlcltsdHBfYnVmZmVyX2luZGV4ICsgYnVmZmVyX29mZnNldF0pOwotCi0gICAgICAgICAgICBmb3IgKGsgPSBqdW1wX3BvaW50OyBrID4gMDsgay0tKQotICAgICAgICAgICAgewotICAgICAgICAgICAgICAgIC8qIFExNSA9IFExNSAqIFEwICovCi0gICAgICAgICAgICAgICAgdGVzdCA9IChJbnQzMikgd2VpZ2h0ICogKCoocEJ1ZmZlcisrKSk7Ci0gICAgICAgICAgICAgICAgKihwUHJlZGljdGVkX3NhbXBsZXMrKykgPSAgdGVzdDsKLSAgICAgICAgICAgICAgICBtYXggICAgICAgICAgICAgICAgICAgfD0gKHRlc3QgPj4gMzEpIF4gdGVzdDsKLSAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgbnVtX3NhbXBsZXMgLT0ganVtcF9wb2ludDsKLQotICAgICAgICAgICAgbHRwX2J1ZmZlcl9pbmRleCArPSBqdW1wX3BvaW50OwotICAgICAgICB9Ci0KLSAgICAgICAgLyoKLSAgICAgICAgICogVGhpcyBzZWN0aW9uIG9mIHRoZSBjb2RlIGhhbmRsZXMgdGhlIHQgPT0gLTEKLSAgICAgICAgICogYnVmZmVyLCB3aGljaCBjb3JyZXNwb25kcyB0byAxMDI0IDw9IGx0cF9idWZmZXJfaW5kZXggPCAyMDQ4Ci0gICAgICAgICAqCi0gICAgICAgICAqIEJVRkZFUiB0ID09IC0xCi0gICAgICAgICAqCi0gICAgICAgICAqIFsxMDI0XVtdW11bXVtdW11bXVtdW11bXVtdWy4uLl1bXVtdW11bXVtdW11bXVtdW11bXVtdWzIwNDddCi0gICAgICAgICAqCi0gICAgICAgICAqLwotCi0gICAgICAgIGp1bXBfcG9pbnQgPSAyICogZnJhbWVfbGVuZ3RoIC0gbHRwX2J1ZmZlcl9pbmRleDsKLQotICAgICAgICBwQnVmZmVyID0gJihidWZmZXJbbHRwX2J1ZmZlcl9pbmRleCAtIGJ1ZmZlcl9vZmZzZXRdKTsKLQotICAgICAgICBpZiAobnVtX3NhbXBsZXMgPCBqdW1wX3BvaW50KQotICAgICAgICB7Ci0gICAgICAgICAgICBqdW1wX3BvaW50ID0gbnVtX3NhbXBsZXM7Ci0gICAgICAgIH0KLQotICAgICAgICBmb3IgKGsgPSBqdW1wX3BvaW50OyBrID4gMDsgay0tKQotICAgICAgICB7Ci0gICAgICAgICAgICAvKiBRMTUgPSBRMTUgKiBRMCAqLwotICAgICAgICAgICAgdGVzdCA9IChJbnQzMikgd2VpZ2h0ICogKCoocEJ1ZmZlcisrKSk7Ci0gICAgICAgICAgICAqKHBQcmVkaWN0ZWRfc2FtcGxlcysrKSA9ICB0ZXN0OwotICAgICAgICAgICAgbWF4ICAgICAgICAgICAgICAgICAgIHw9ICh0ZXN0ID4+IDMxKSBeIHRlc3Q7Ci0gICAgICAgIH0KLQotICAgICAgICBudW1fc2FtcGxlcyAtPSBqdW1wX3BvaW50OwotCi0gICAgICAgIGx0cF9idWZmZXJfaW5kZXggKz0ganVtcF9wb2ludDsKLQotICAgICAgICAvKgotICAgICAgICAgKiBUaGlzIHNlY3Rpb24gb2YgdGhlIGNvZGUgaGFuZGxlcyB0aGUgdCA9PSAwCi0gICAgICAgICAqIGJ1ZmZlciwgd2hpY2ggY29ycmVzcG9uZHMgdG8gMjA0OCA8PSBsdHBfYnVmZmVyX2luZGV4IDwgMzA3MgotICAgICAgICAgKgotICAgICAgICAgKiBCVUZGRVIgdCA9PSAwCi0gICAgICAgICAqCi0gICAgICAgICAqIFsyMDQ4XVtdW11bXVtdW11bXVtdW11bXVtdWy4uLl1bXVtdW11bXVtdW11bXVtdW11bXVtdWzMwNzFdCi0gICAgICAgICAqCi0gICAgICAgICAqLwotICAgICAgICBmb3IgKGsgPSBudW1fc2FtcGxlczsgayA+IDA7IGstLSkKLSAgICAgICAgewotCi0gICAgICAgICAgICBkYXR1bSA9ICoocFRpbWVRdWFudCsrKSA+PiBTQ0FMSU5HOwotCi0gICAgICAgICAgICAvKgotICAgICAgICAgICAgICogTGltaXQgdGhlIHZhbHVlcyBpbiB0aGUgMzItYml0IGZpbHRlcmJhbmsncyBidWZmZXIgdG8KLSAgICAgICAgICAgICAqIDE2LWJpdCByZXNvbHV0aW9uLgotICAgICAgICAgICAgICoKLSAgICAgICAgICAgICAqIFZhbHVlJ3MgZ3JlYXRlciB0aGFuIDMyNzY3IG9yIGxlc3MgdGhhbiAtMzI3NjggYXJlIHNhdHVyYXRlZAotICAgICAgICAgICAgICogdG8gMzI3NjcgYW5kIC0zMjc2OCwgcmVzcGVjdGl2ZWx5LgotICAgICAgICAgICAgICovCi0KLSAgICAgICAgICAgIHRlc3QgICAgICAgICAgICAgICAgICAgID0gKEludDMyKWRhdHVtICogd2VpZ2h0OwotICAgICAgICAgICAgKihwUHJlZGljdGVkX3NhbXBsZXMrKykgPSAgdGVzdDsKLSAgICAgICAgICAgIG1heCAgICAgICAgICAgICAgICAgICAgfD0gKHRlc3QgPj4gMzEpIF4gdGVzdDsKLQotICAgICAgICB9Ci0KLSAgICAgICAgLyogU2V0IGFueSByZW1haW5pbmcgc2FtcGxlcyBpbiB0aGUgYmxvY2sgdG8gMC4gKi8KLQotICAgICAgICBwdl9tZW1zZXQoCi0gICAgICAgICAgICBwUHJlZGljdGVkX3NhbXBsZXMsCi0gICAgICAgICAgICAwLAotICAgICAgICAgICAgYmxvY2tfbGVuZ3RoKnNpemVvZigqcFByZWRpY3RlZF9zYW1wbGVzKSk7Ci0KLSAgICB9IC8qIGlmICh3aW5fc2VxICE9IEVJR0hUX1NIT1JUX1NFUVVFTkNFKSAqLwotCi0KLSAgICAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0gICAgLyogTFRQIGRlY29kaW5nIHByb2Nlc3MgZm9yIHNob3J0IHdpbmRvdyAqLwotICAgIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLQotICAgIC8qCi0gICAgICogRm9yIHNob3J0IHdpbmRvdyBMVFAsIHNpbmNlIHRoZXJlIGlzIG5vICJsdHBfc2hvcnRfbGFnIgotICAgICAqIGluZm9ybWF0aW9uIGJlaW5nIHBhc3NlZCwgdGhlIGZvbGxvd2luZyBjb2RlIGZvciBzaG9ydAotICAgICAqIHdpbmRvdyBMVFAgd2lsbCBiZSBhcHBsaWVkIGluIHRoZSBmdXR1cmUgd2hlbiB0aG9zZQotICAgICAqIGluZm9ybWF0aW9uIGFyZSBhdmFpbGFibGUuCi0gICAgICovCi0KLSAgICAvKgotICAgICAqLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLQotICAgICAqICBlbHNlCi0gICAgICogIHsKLSAgICAgKiAgICAgIGZvciAod25kID0gMDsgd25kIDwgc2hvcnRfd2luZG93X251bTsgd25kKyspCi0gICAgICogICAgICB7Ci0gICAgICogICAgICAgICAgaWYgKHdpbl9wcmVkaWN0aW9uX3VzZWRbd25kXSAhPSBGQUxTRSkKLSAgICAgKiAgICAgICAgICB7Ci0gICAgICogICAgICAgICAgICAgIGRlbGF5W3duZF0gPSBkZWxheVswXSArIGx0cF9zaG9ydF9sYWdbd25kXTsKLSAgICAgKgotICAgICAqICAgICAgICAgICAgICBsYWcgPSBkZWxheVt3bmRdOwotICAgICAqCi0gICAgICogICAgICAgICAgICAgIGogPSB3bmQqc2hvcnRfYmxvY2tfbGVuZ3RoIC0gbGFnOwotICAgICAqCi0gICAgICogICAgICAgICAgICAgIGlmIChsYWcgPCBzaG9ydF9mcmFtZV9sZW5ndGgpCi0gICAgICogICAgICAgICAgICAgIHsKLSAgICAgKiAgICAgICAgICAgICAgICAgIG51bV9zYW1wbGVzID0gc2hvcnRfZnJhbWVfbGVuZ3RoICsgbGFnOwotICAgICAqICAgICAgICAgICAgICB9Ci0gICAgICogICAgICAgICAgICAgIGVsc2UKLSAgICAgKiAgICAgICAgICAgICAgewotICAgICAqICAgICAgICAgICAgICAgICAgbnVtX3NhbXBsZXMgPSBzaG9ydF9ibG9ja19sZW5ndGg7Ci0gICAgICogICAgICAgICAgICAgIH0KLSAgICAgKgotICAgICAqICAgICAgICAgICAgICBwQnVmZmVyID0gJmJ1ZmZlcltqXTsKLSAgICAgKgotICAgICAqICAgICAgICAgICAgICBmb3IoaSA9IG51bV9zYW1wbGVzOyBpPjA7IGktLSkKLSAgICAgKiAgICAgICAgICAgICAgewotICAgICAqICAgICAgICAgICAgICAgICAgKihwUHJlZGljdGVkX3NhbXBsZXMrKykgPSB3ZWlnaHQgKiAoKihwQnVmZmVyKyspKTsKLSAgICAgKiAgICAgICAgICAgICAgfQotICAgICAqCi0gICAgICogICAgICAgICAgICAgIGZvcihpID0gc2hvcnRfYmxvY2tfbGVuZ3RoIC0gbnVtX3NhbXBsZXM7IGk+MDsgaS0tKQotICAgICAqICAgICAgICAgICAgICB7Ci0gICAgICogICAgICAgICAgICAgICAgICAqKHBQcmVkaWN0ZWRfc2FtcGxlcysrKSA9IDA7Ci0gICAgICogICAgICAgICAgICAgIH0KLSAgICAgKiAgICAgICAgICB9Ci0gICAgICogICAgICAgICAgZWxzZQotICAgICAqICAgICAgICAgIHsKLSAgICAgKiAgICAgICAgICAgICAgcHZfbWVtc2V0KAotICAgICAqICAgICAgICAgICAgICAgICAgcFByZWRpY3RlZF9zYW1wbG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ciB0b2dnbGVzIHByZWRpY3Rpb24gb24oMSkvb2ZmKDApIGZvciBlYWNoCi0gICAgICAgICAgICAgICAgICAgICAgICAgIHdpbmRvdyBzZXBhcmF0ZWx5LgotICAgIHNmYl9wcmVkaWN0aW9uX3VzZWQgPSBidWZmZXIgKEludCkgY29udGFpbmluZyB0aGUgcHJlZGljdGlvbiBmbGFnCi0gICAgICAgICAgICAgICAgICAgICAgICAgIGluZm9ybWF0aW9uIGZvciBzY2FsZWZhY3RvciBiYW5kKHNmYikuIEVhY2ggaXRlbQotICAgICAgICAgICAgICAgICAgICAgICAgICB0b2dnbGUgcHJlZGljdGlvbiBvbigxKS9vZmYoMCkgb24gZWFjaCBzY2FsZWZhY3RvcgotICAgICAgICAgICAgICAgICAgICAgICAgICBiYW5kIG9mIGV2ZXJ5IHdpbmRvdy4KLSAgICBjdXJyZW50X2ZyYW1lID0gY2hhbm5lbCBidWZmZXIgKEludDMyKSBjb250YWluaW5nIHRoZSBkZXF1YW50aXplZAotICAgICAgICAgICAgICAgICAgICBzcGVjdHJhbCBjb2VmZmljaWVudHMgb3IgZXJyb3JzIG9mIGN1cnJlbnQgZnJhbWUuCi0gICAgcV9mb3JtYXQgPSBidWZmZXIgKEludCkgY29udGFpbmluZyBRIGZvcm1hdCBmb3IgZWFjaCBzY2FsZWZhY3RvciBiYW5kIG9mCi0gICAgICAgICAgICAgICBpbnB1dCBjdXJyZW50X2ZyYW1lLgotICAgIHByZWRpY3RlZF9zcGVjdHJhbCA9IGJ1ZmZlciAoSW50MzIpIGNvbnRhaW5pbmcgcHJlZGljdGVkIHNwZWN0cmFsCi0gICAgICAgICAgICAgICAgICAgICAgICAgY29tcG9uZW50cyBvZiBjdXJyZW50IGZyYW1lLgotICAgIHByZWRfcV9mb3JtYXQgPSBRIGZvcm1hdCAoSW50KSBmb3IgcHJlZGljdGVkIHNwZWN0cmFsIGNvbXBvbmVudHMgb2YKLSAgICAgICAgICAgICAgICAgICAgY3VycmVudCBmcmFtZS4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Jfb2Zmc2V0KTsgaj4wIDsgai0tKQotCi0gICAgICAgICAgICAgICAgICAgIHRtcEludDMyID0gKihwUHJlZGljdGVkX3NwZWN0cmFsKyspOwotCi0gICAgICAgICAgICAgICAgICAgIElGICh0bXBJbnQzMiA8IDApCi0gICAgICAgICAgICAgICAgICAgIFRIRU4KLQotICAgICAgICAgICAgICAgICAgICAgICAgdG1wSW50MzIgPSAtdG1wSW50MzI7Ci0KLSAgICAgICAgICAgICAgICAgICAgRU5ESUYKLQotICAgICAgICAgICAgICAgICAgICBtYXggfD0gdG1wSW50MzI7Ci0KLSAgICAgICAgICAgICAgICBFTkRGT1IKLQotICAgICAgICAgICAgICAgIHRtcEludCA9IDA7Ci0KLSAgICAgICAgICAgICAgICBJRiAobWF4ICE9IDApCi0gICAgICAgICAgICAgICAgVEhFTgotCi0gICAgICAgICAgICAgICAgICAgIFdISUxFIChtYXggPCAweDQwMDAwMDAwTCkKLQotICAgICAgICAgICAgICAgICAgICAgICAgbWF4IDw8PSAxOwotICAgICAgICAgICAgICAgICAgICAgICAgdG1wSW50Kys7Ci0KLSAgICAgICAgICAgICAgICAgICAgRU5EV0hJTEUKLQotICAgICAgICAgICAgICAgICAgICBwUHJlZGljdGVkX3NwZWN0cmFsID0gcFByZWRpY3RlZF9vZmZzZXQ7Ci0KLSAgICAgICAgICAgICAgICAgICAgRk9SIChqID0gcXVhcnRlcl9zZmJfd2lkdGg7IGo+MCA7IGotLSkKLQotICAgICAgICAgICAgICAgICAgICAgICAgKihwUHJlZGljdGVkX3NwZWN0cmFsKyspIDw8PSB0bXBJbnQ7Ci0gICAgICAgICAgICAgICAgICAgICAgICAqKHBQcmVkaWN0ZWRfc3BlY3RyYWwrKykgPDw9IHRtcEludDsKLSAgICAgICAgICAgICAgICAgICAgICAgICoocFByZWRpY3RlZF9zcGVjdHJhbCsrKSA8PD0gdG1wSW50OwotICAgICAgICAgICAgICAgICAgICAgICAgKihwUHJlZGljdGVkX3NwZWN0cmFsKyspIDw8PSB0bXBJbnQ7Ci0KLSAgICAgICAgICAgICAgICAgICAgRU5ERk9SCi0KLSAgICAgICAgICAgICAgICAgICAgYWRqdXN0ZWRfcHJlZF9xID0gcHJlZF9xX2Zvcm1hdCArIHRtcEludDsKLQotICAgICAgICAgICAgICAgICAgICBwUHJlZGljdGVkX3NwZWN0cmFsID0gcFByZWRpY3RlZF9vZmZzZXQ7Ci0KLSAgICAgICAgICAgICAgICAgICAgc2hpZnRfZmFjdG9yID0gKihwUV9mb3JtYXQpIC0gYWRqdXN0ZWRfcHJlZF9xOwotCi0gICAgICAgICAgICAgICAgICAgIElGICgoc2hpZnRfZmFjdG9yID49IDApICYmIChzaGlmdF9mYWN0b3IgPCAzMSkpCi0gICAgICAgICAgICAgICAgICAgIFRIRU4KLQotICAgICAgICAgICAgICAgICAgICAgICAgc2hpZnRfZmFjdG9yID0gc2hpZnRfZmFjdG9yICsgMTsKLQotICAgICAgICAgICAgICAgICAgICAgICAgRk9SIChqID0gcXVhcnRlcl9zZmJfd2lkdGg7IGo+MCA7IGotLSkKLQotICAgICAgICAgICAgICAgICAgICAgICAgICAgICoocEN1cnJlbnRfZnJhbWUrKykgPQotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoKnBDdXJyZW50X2ZyYW1lPj5zaGlmdF9mYWN0b3IpCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICArICgqKHBQcmVkaWN0ZWRfc3BlY3RyYWwrKyk+PjEpOwotICAgICAgICAgICAgICAgICAgICAgICAgICAgICoocEN1cnJlbnRfZnJhbWUrKykgPQotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoKnBDdXJyZW50X2ZyYW1lPj5zaGlmdF9mYWN0b3IpCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICArICgqKHBQcmVkaWN0ZWRfc3BlY3RyYWwrKyk+PjEpOwotICAgICAgICAgICAgICAgICAgICAgICAgICAgICoocEN1cnJlbnRfZnJhbWUrKykgPQotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoKnBDdXJyZW50X2ZyYW1lPj5zaGlmdF9mYWN0b3IpCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICArICgqKHBQcmVkaWN0ZWRfc3BlY3RyYWwrKyk+PjEpOwotICAgICAgICAgICAgICAgICAgICAgICAgICAgICoocEN1cnJlbnRfZnJhbWUrKykgPQotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoKnBDdXJyZW50X2ZyYW1lPj5zaGlmdF9mYWN0b3IpCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICArICgqKHBQcmVkaWN0ZWRfc3BlY3RyYWwrKyk+PjEpOwotCi0gICAgICAgICAgICAgICAgICAgICAgICBFTkRGT1IKLQotICAgICAgICAgICAgICAgICAgICAgICAgKihwUV9mb3JtYXQpID0gYWRqdXN0ZWRfcHJlZF9xIC0gMTsKLQotICAgICAgICAgICAgICAgICAgICBFTFNFSUYgKHNoaWZ0X2ZhY3RvciA+PSAzMSkKLSAgICAgICAgICAgICAgICAgICAgVEhFTgotCi0gICAgICAgICAgICAgICAgICAgICAgICBGT1IgKGogPSBxdWFydGVyX3NmYl93aWR0aDsgaj4wIDsgai0tKQotCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgKihwQ3VycmVudF9mcmFtZSsrKSA9ICoocFByZWRpY3RlZF9zcGVjdHJhbCsrKTsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAqKHBDdXJyZW50X2ZyYW1lKyspID0gKihwUHJlZGljdGVkX3NwZWN0cmFsKyspOwotICAgICAgICAgICAgICAgICAgICAgICAgICAgICoocEN1cnJlbnRfZnJhbWUrKykgPSAqKHBQcmVkaWN0ZWRfc3BlY3RyYWwrKyk7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgKihwQ3VycmVudF9mcmFtZSsrKSA9ICoocFByZWRpY3RlZF9zcGVjdHJhbCsrKTsKLQotICAgICAgICAgICAgICAgICAgICAgICAgRU5ERk9SCi0KLSAgICAgICAgICAgICAgICAgICAgICAgICoocFFfZm9ybWF0KSA9IGFkanVzdGVkX3ByZWRfcTsKLQotICAgICAgICAgICAgICAgICAgICBFTFNFSUYgKChzaGlmdF9mYWN0b3IgPCAwKSAmJiAoc2hpZnRfZmFjdG9yID4gLTMxKSkKLSAgICAgICAgICAgICAgICAgICAgVEhFTgotCi0gICAgICAgICAgICAgICAgICAgICAgICBzaGlmdF9mYWN0b3IgPSAxIC0gc2hpZnRfZmFjdG9yOwotCi0gICAgICAgICAgICAgICAgICAgICAgICBGT1IgKGogPSBxdWFydGVyX3NmYl93aWR0aDsgaj4wIDsgai0tKQotCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgKihwQ3VycmVudF9mcmFtZSsrKSA9ICgqcEN1cnJlbnRfZnJhbWU+PjEpICsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKCoocFByZWRpY3RlZF9zcGVjdHJhbCsrKT4+c2hpZnRfZmFjdG9yKTsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAqKHBDdXJyZW50X2ZyYW1lKyspID0gKCpwQ3VycmVudF9mcmFtZT4+MSkgKwotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoKihwUHJlZGljdGVkX3NwZWN0cmFsKyspPj5zaGlmdF9mYWN0b3IpOwotICAgICAgICAgICAgICAgICAgICAgICAgICAgICoocEN1cnJlbnRfZnJhbWUrKykgPSAoKnBDdXJyZW50X2ZyYW1lPj4xKSArCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICgqKHBQcmVkaWN0ZWRfc3BlY3RyYWwrKyk+PnNoaWZ0X2ZhY3Rvcik7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgKihwQ3VycmVudF9mcmFtZSsrKSA9ICgqcEN1cnJlbnRfZnJhbWU+PjEpICsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKCoocFByZWRpY3RlZF9zcGVjdHJhbCsrKT4+c2hpZnRfZmFjdG9yKTsKLQotICAgICAgICAgICAgICAgICAgICAgICAgRU5ERk9SCi0KLSAgICAgICAgICAgICAgICAgICAgICAgICoocFFfZm9ybWF0KSA9ICoocFFfZm9ybWF0KSAtIDE7Ci0KLSAgICAgICAgICAgICAgICAgICAgRU5ESUYKLQotICAgICAgICAgICAgICAgIEVORElGCi0KLSAgICAgICAgICAgIEVORElGIFsgSUYgKCoocFNmYl9wcmVkaWN0aW9uX3VzZWQrKykgIT0gRkFMU0UpIF0KLQotICAgICAgICAgICAgc2ZiX29mZnNldCA9ICpwV2luU2ZiVG9wOwotICAgICAgICAgICAgcFdpblNmYlRvcCA9IHBXaW5TZmJUb3AgKyAxOwotICAgICAgICAgICAgcFFfZm9ybWF0ID0gcFFfZm9ybWF0ICsgMTsKLQotICAgICAgICBFTkRGT1IgWyBGT1IgKGkgPSBzZmJfcGVyX2ZyYW1lOyBpPjA7IGktLSkgXQotCi0gICAgRUxTRQotCi0gICAgICAgIHBDdXJyZW50X2ZyYW1lX3N0YXJ0ID0gJmN1cnJlbnRfZnJhbWVbMF07Ci0KLSAgICAgICAgcFFfZm9ybWF0X3N0YXJ0ID0gJnFfZm9ybWF0WzBdOwotCi0gICAgICAgIG51bV9zZmIgPSBzZmJfcGVyX3dpblswXTsKLQotICAgICAgICBGT1IgKHduZD0wOyB3bmQ8c2hvcnRfd2luZG93X251bTsgd25kKyspCi0KLSAgICAgICAgICAgIHBXaW5TZmJUb3AgPSAmcFdpbl9zZmJfdG9wWzBdOwotCi0gICAgICAgICAgICBwUV9mb3JtYXQgPSBwUV9mb3JtYXRfc3RhcnQ7Ci0KLSAgICAgICAgICAgIElGICh3aW5fcHJlZGljdGlvbl91c2VkW3duZF0gIT0gRkFMU0UpCi0gICAgICAgICAgICBUSEVOCi0KLSAgICAgICAgICAgICAgICBzZmJfb2Zmc2V0ID0gMDsKLQotICAgICAgICAgICAgICAgIEZPUiAoaSA9IHJlY29uc3RydWN0X3NmYl9udW07IGkgPiAwOyBpLS0pCi0KLSAgICAgICAgICAgICAgICAgICAgcFByZWRpY3RlZF9vZmZzZXQgPSBwUHJlZGljdGVkX3NwZWN0cmFsX3N0YXJ0ICsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzZmJfb2Zmc2V0OwotICAgICAgICAgICAgICAgICAgICBwQ3VycmVudF9mcmFtZSA9IHBDdXJyZW50X2ZyYW1lX3N0YXJ0ICsgc2ZiX29mZnNldDsKLQotICAgICAgICAgICAgICAgICAgICBxdWFydGVyX3NmYl93aWR0aCA9ICgqcFdpblNmYlRvcCAtIHNmYl9vZmZzZXQpID4+IDI7Ci0KLSAgICAgICAgICAgICAgICAgICAgbWF4ID0gMDsKLQotICAgICAgICAgICAgICAgICAgICBwUHJlZGljdGVkX3NwZWN0cmFsID0gcFByZWRpY3RlZF9vZmZzZXQ7Ci0KLSAgICAgICAgICAgICAgICAgICAgRk9SIChqID0gKCpwV2luU2ZiVG9wIC0gc2ZiX29mZnNldCk7IGo+MCA7IGotLSkKLQotICAgICAgICAgICAgICAgICAgICAgICAgdG1wSW50MzIgPSAqKHBQcmVkaWN0ZWRfc3BlY3RyYWwrKyk7Ci0KLSAgICAgICAgICAgICAgICAgICAgICAgIElGICh0bXBJbnQzMiA8IDApCi0gICAgICAgICAgICAgICAgICAgICAgICBUSEVOCi0KLSAgICAgICAgICAgICAgICAgICAgICAgICAgICB0bXBJbnQzMiA9IC10bXBJbnQzMjsKLQotICAgICAgICAgICAgICAgICAgICAgICAgRU5ESUYKLQotICAgICAgICAgICAgICAgICAgICAgICAgbWF4IHw9IHRtcEludDMyOwotCi0gICAgICAgICAgICAgICAgICAgIEVOREZPUgotCi0gICAgICAgICAgICAgICAgICAgIHRtcEludCA9IDA7Ci0KLSAgICAgICAgICAgICAgICAgICAgSUYgKG1heCAhPSAwKQotICAgICAgICAgICAgICAgICAgICBUSEVOCi0KLSAgICAgICAgICAgICAgICAgICAgICAgIFdISUxFIChtYXggPCAweDQwMDAwMDAwTCkKLQotICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1heCA8PD0gMTsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICB0bXBJbnQrKzsKLQotICAgICAgICAgICAgICAgICAgICAgICAgRU5EV0hJTEUKLQotCi0gICAgICAgICAgICAgICAgICAgICAgICBwUHJlZGljdGVkX3NwZWN0cmFsID0gcFByZWRpY3RlZF9vZmZzZXQ7Ci0KLSAgICAgICAgICAgICAgICAgICAgICAgIEZPUiAoaiA9IHF1YXJ0ZXJfc2ZiX3dpZHRoOyBqPjAgOyBqLS0pCi0KLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAqKHBQcmVkaWN0ZWRfc3BlY3RyYWwrKykgPDw9IHRtcEludDsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAqKHBQcmVkaWN0ZWRfc3BlY3RyYWwrKykgPDw9IHRtcEludDsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAqKHBQcmVkaWN0ZWRfc3BlY3RyYWwrKykgPDw9IHRtcEludDsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAqKHBQcmVkaWN0ZWRfc3BlY3RyYWwrKykgPDw9IHRtcEludDsKLQotICAgICAgICAgICAgICAgICAgICAgICAgRU5ERk9SCi0KLSAgICAgICAgICAgICAgICAgICAgICAgIGFkanVzdGVkX3ByZWRfcSA9IHByZWRfcV9mb3JtYXQgKyB0bXBJbnQ7Ci0KLSAgICAgICAgICAgICAgICAgICAgICAgIHBQcmVkaWN0ZWRfc3BlY3RyYWwgPSBwUHJlZGljdGVkX29mZnNldDsKLQotICAgICAgICAgICAgICAgICAgICAgICAgc2hpZnRfZmFjdG9yID0gKihwUV9mb3JtYXQpIC0gYWRqdXN0ZWRfcHJlZF9xOwotCi0gICAgICAgICAgICAgICAgICAgICAgICBJRiAoKHNoaWZ0X2ZhY3RvciA+PSAwKSAmJiAoc2hpZnRfZmFjdG9yIDwgMzEpKQotICAgICAgICAgICAgICAgICAgICAgICAgVEhFTgotCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgc2hpZnRfZmFjdG9yID0gc2hpZnRfZmFjdG9yICsgMTsKLQotICAgICAgICAgICAgICAgICAgICAgICAgICAgIEZPUiAoaiA9IHF1YXJ0ZXJfc2ZiX3dpZHRoOyBqPjAgOyBqLS0pCi0KLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKihwQ3VycmVudF9mcmFtZSsrKSA9Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoKnBDdXJyZW50X2ZyYW1lPj5zaGlmdF9mYWN0b3IpICsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICgqKHBQcmVkaWN0ZWRfc3BlY3RyYWwrKyk+PjEpOwotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqKHBDdXJyZW50X2ZyYW1lKyspID0KLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICgqcEN1cnJlbnRfZnJhbWU+PnNoaWZ0X2ZhY3RvcikgKwotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKCoocFByZWRpY3RlZF9zcGVjdHJhbCsrKT4+MSk7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICoocEN1cnJlbnRfZnJhbWUrKykgPQotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKCpwQ3VycmVudF9mcmFtZT4+c2hpZnRfZmFjdG9yKSArCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoKihwUHJlZGljdGVkX3NwZWN0cmFsKyspPj4xKTsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKihwQ3VycmVudF9mcmFtZSsrKSA9Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoKnBDdXJyZW50X2ZyYW1lPj5zaGlmdF9mYWN0b3IpICsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICgqKHBQcmVkaWN0ZWRfc3BlY3RyYWwrKyk+PjEpOwotCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgRU5ERk9SCi0KLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAqKHBRX2Zvcm1hdCkgPSBhZGp1c3RlZF9wcmVkX3EgLSAxOwotCi0gICAgICAgICAgICAgICAgICAgICAgICBFTFNFSUYgKHNoaWZ0X2ZhY3RvciA+PSAzMSkKLSAgICAgICAgICAgICAgICAgICAgICAgIFRIRU4KLQotICAgICAgICAgICAgICAgICAgICAgICAgICAgIEZPUiAoaiA9IHF1YXJ0ZXJfc2ZiX3dpZHRoOyBqPjAgOyBqLS0pCi0KLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKihwQ3VycmVudF9mcmFtZSsrKSA9ICoocFByZWRpY3RlZF9zcGVjdHJhbCsrKTsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKihwQ3VycmVudF9mcmFtZSsrKSA9ICoocFByZWRpY3RlZF9zcGVjdHJhbCsrKTsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKihwQ3VycmVudF9mcmFtZSsrKSA9ICoocFByZWRpY3RlZF9zcGVjdHJhbCsrKTsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKihwQ3VycmVudF9mcmFtZSsrKSA9ICoocFByZWRpY3RlZF9zcGVjdHJhbCsrKTsKLQotICAgICAgICAgICAgICAgICAgICAgICAgICAgIEVOREZPUgotCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgKihwUV9mb3JtYXQpID0gYWRqdXN0ZWRfcHJlZF9xOwotCi0gICAgICAgICAgICAgICAgICAgICAgICBFTFNFSUYgKChzaGlmdF9mYWN0b3IgPCAwKSAmJiAoc2hpZnRfZmFjdG9yID4gLTMxKSkKLSAgICAgICAgICAgICAgICAgICAgICAgIFRIRU4KLQotICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNoaWZ0X2ZhY3RvciA9IDEgLSBzaGlmdF9mYWN0b3I7Ci0KLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBGT1IgKGogPSBxdWFydGVyX3NmYl93aWR0aDsgaj4wIDsgai0tKQotCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICoocEN1cnJlbnRfZnJhbWUrKykgPSAoKnBDdXJyZW50X2ZyYW1lPj4xKSArCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoKihwUHJlZGljdGVkX3NwZWN0cmFsKyspPj5zaGlmdF9mYWN0b3IpOwotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqKHBDdXJyZW50X2ZyYW1lKyspID0gKCpwQ3VycmVudF9mcmFtZT4+MSkgKwotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKCoocFByZWRpY3RlZF9zcGVjdHJhbCsrKT4+c2hpZnRfZmFjdG9yKTsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKihwQ3VycmVudF9mcmFtZSsrKSA9ICgqcEN1cnJlbnRfZnJhbWU+PjEpICsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICgqKHBQcmVkaWN0ZWRfc3BlY3RyYWwrKyk+PnNoaWZ0X2ZhY3Rvcik7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICoocEN1cnJlbnRfZnJhbWUrKykgPSAoKnBDdXJyZW50X2ZyYW1lPj4xKSArCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoKihwUHJlZGljdGVkX3NwZWN0cmFsKyspPj5zaGlmdF9mYWN0b3IpOwotCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgRU5ERk9SCi0KLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAqKHBRX2Zvcm1hdCkgPSAqKHBRX2Zvcm1hdCkgLSAxOwotCi0gICAgICAgICAgICAgICAgICAgICAgICBFTkRJRgotC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3RyYWw7Ci0KLSAgICAvKgotICAgICAqIE5PVEU6Ci0gICAgICogc2ZiX3ByZWRpY3Rpb25fdXNlZFtdIHN0YXJ0IGZyb20gMCBvciAxIGRlcGVuZGluZyBvbiBub2tfbHRfZGVjb2RlLmM7Ci0gICAgICogY3VycmVudGx5IHdlIGFncmVlIHRvIG1ha2UgaXQgc3RhcnQgZnJvbSAwOwotICAgICAqLwotICAgIHBTZmJfcHJlZGljdGlvbl91c2VkID0gJnNmYl9wcmVkaWN0aW9uX3VzZWRbMF07Ci0KLSAgICAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotICAgIC8qIExUUCBzeW50aGVzaXMgZm9yIGxvbmcgd2luZG93ICovCi0gICAgLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLSAgICBpZiAod2luX3NlcSAhPSBFSUdIVF9TSE9SVF9TRVFVRU5DRSkKLSAgICB7Ci0KLSAgICAgICAgLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0gICAgICAgIC8qIFJlY29uc3RydWN0aW9uIG9mIGN1cnJlbnQgZnJlcXVlbmN5IGRvbWFpbiBzcGVjdHJ1bSAqLwotICAgICAgICAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLQotICAgICAgICAvKiBJbml0aWFsaXplIHNjYWxlZmFjdG9yIGJhbmQgb2Zmc2V0ICovCi0gICAgICAgIHNmYl9vZmZzZXQgPSAwOwotCi0gICAgICAgIC8qCi0gICAgICAgICAqIFJlY29uc3RydWN0aW9uIGlzIHByb2Nlc3NlZCBvbiBzY2FsZWZhY3RvciBiYW5kIGJhc2lzLgotICAgICAgICAgKiAxLiBXaGVuIHByZWRpY3Rpb24gaXMgdHVybmVkIG9uLCBhbGwgdGhlIHByZWRpY3RlZCBzcGVjdHJhbAotICAgICAgICAgKiBjb21wb25lbnRzIHdpbGwgYmUgdXNlZCBmb3IgcmVjb25zdHJ1Y3Rpb24uCi0gICAgICAgICAqIDIuIFdoZW4gcHJlZGljdGlvbiBpcyB0dXJuZWQgb2ZmLCByZWNvbnN0cnVjdGlvbiBpcyBub3QKLSAgICAgICAgICogbmVlZGVkLiBTcGVjdHJhbCBjb21wb25lbnRzIG9mIGN1cnJlbnQgZnJhbWUgd2lsbCBkaXJlY3RseQotICAgICAgICAgKiBjb21lIGZyb20gdGhlIHRyYW5zbWl0dGVkIGRhdGEuCi0gICAgICAgICAqLwotICAgICAgICBwV2luU2ZiVG9wID0gJndpbl9zZmJfdG9wWzBdOwotCi0gICAgICAgIHBRX2Zvcm1hdCA9ICZxX2Zvcm1hdFswXTsKLQotICAgICAgICBmb3IgKGkgPSBzZmJfcGVyX3dpbjsgaSA+IDA7IGktLSkKLSAgICAgICAgewotICAgICAgICAgICAgLyogQ2hlY2sgcHJlZGljdGlvbiBmbGFnIGZvciBlYWNoIHNjYWxlZmFjdG9yIGJhbmQuICovCi0gICAgICAgICAgICBpZiAoKihwU2ZiX3ByZWRpY3Rpb25fdXNlZCsrKSAhPSBGQUxTRSkKLSAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAvKgotICAgICAgICAgICAgICAgICAqIFByZWRpY3Rpb24gaXMgb24uIERvIHJlY29uc3RydWN0aW9uIHJvdXRpbmUuCi0gICAgICAgICAgICAgICAgICogUmVjb25zdHJ1Y3Qgc3BlY3RyYWwgY29tcG9uZW50IG9mIGN1cnJlbnQKLSAgICAgICAgICAgICAgICAgKiBmcmFtZSBieSBhZGRpbmcgdGhlIHByZWRpY3RlZCBzcGVjdHJhbAotICAgICAgICAgICAgICAgICAqIGNvbXBvbmVudHMgYW5kIHRoZSBxdWFudGl6ZWQgcHJlZGljdGlvbgotICAgICAgICAgICAgICAgICAqIGVycm9ycyB0aGF0IHJlY29uc3RydWN0ZWQgZnJvbSB0cmFuc21pdHRlZAotICAgICAgICAgICAgICAgICAqIGRhdGEgd2hlbiBwcmVkaWN0aW9uIGlzIHR1cm5lZCBvbi4KLSAgICAgICAgICAgICAgICAgKi8KLQotICAgICAgICAgICAgICAgIC8qIFNldCBwb2ludGVycyB0byB0aGUgb2Zmc2V0IG9mIHNjYWxlZmFjdG9yIGJhbmRzICovCi0gICAgICAgICAgICAgICAgcFByZWRpY3RlZF9vZmZzZXQgPSBwUHJlZGljdGVkX3NwZWN0cmFsX3N0YXJ0ICsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNmYl9vZmZzZXQ7Ci0gICAgICAgICAgICAgICAgcEN1cnJlbnRfZnJhbWUgPSAmY3VycmVudF9mcmFtZVtzZmJfb2Zmc2V0XTsKLQotICAgICAgICAgICAgICAgIC8qCi0gICAgICAgICAgICAgICAgICogKCpwV2luU2ZiVG9wIC0gc2ZiX29mZnNldCkgaXMgbnVtYmVyIG9mIGNvZWZmaWNpZW50cwotICAgICAgICAgICAgICAgICAqIG9mIHRoZSBzY2FsZWZhY3RvciBiYW5kLgotICAgICAgICAgICAgICAgICAqICI+PjIiIGlzIHVzZWQgdG8gc2V0IHVwIGZvciBsYXRlciB1bnJvbGxpbmcgdGhlIGxvb3AuCi0gICAgICAgICAgICAgICAgICovCi0gICAgICAgICAgICAgICAgcXVhcnRlcl9zZmJfd2lkdGggPSAoKnBXaW5TZmJUb3AgLSBzZmJfb2Zmc2V0KSA+PiAyOwotCi0gICAgICAgICAgICAgICAgLyoKLSAgICAgICAgICAgICAgICAgKiBBZGp1c3QgcHJlZF9xX2Zvcm1hdCBhbmQgcHJlZGljdGVkX3NwZWN0cmFsKCkgdG8KLSAgICAgICAgICAgICAgICAgKiBtYXhpbXVtIHJlc29sdXRpb24uCi0gICAgICAgICAgICAgICAgICovCi0gICAgICAgICAgICAgICAgbWF4ID0gMDsKLQotICAgICAgICAgICAgICAgIHBQcmVkaWN0ZWRfc3BlY3RyYWwgPSBwUHJlZGljdGVkX29mZnNldDsKLQotICAgICAgICAgICAgICAgIC8qIEZpbmQgdGhlIG1heGltdW0gYWJzb2x1dGUgdmFsdWUgKi8KLSAgICAgICAgICAgICAgICBmb3IgKGogPSAoKnBXaW5TZmJUb3AgLSBzZmJfb2Zmc2V0KTsgaiA+IDAgOyBqLS0pCi0gICAgICAgICAgICAgICAgewotICAgICAgICAgICAgICAgICAgICB0bXBJbnQzMiA9ICoocFByZWRpY3RlZF9zcGVjdHJhbCsrKTsKLQotICAgICAgICAgICAgICAgICAgICAvKgotICAgICAgICAgICAgICAgICAgICAgKiBOb3RlOiBvdmVyZmxvdyBpcyBwcm90ZWN0ZWQgaGVyZSBldmVuIHRob3VnaAotICAgICAgICAgICAgICAgICAgICAgKiB0bXBJbnQzMiA9IDB4ODAwMDAwMDAgaXMgdmVyeSByYXJlIGNhc2UuCi0gICAgICAgICAgICAgICAgICAgICAqCi0gICAgICAgICAgICAgICAgICAgICAqICBpZiAodG1wSW50MzIgPT0gTE9OR19NSU4pCi0gICAgICAgICAgICAgICAgICAgICAqICB7Ci0gICAgICAgICAgICAgICAgICAgICAqICAgICAgdG1wSW50MzIgPSBMT05HX01BWDsKLSAgICAgICAgICAgICAgICAgICAgICogIH0KLSAgICAgICAgICAgICAgICAgICAgICogIGlmICh0bXBJbnQzMiA8IDApCi0gICAgICAgICAgICAgICAgICAgICAqICB7Ci0gICAgICAgICAgICAgICAgICAgICAqICAgICAgdG1wSW50MzIgPSAtdG1wSW50MzI7Ci0gICAgICAgICAgICAgICAgICAgICAqICB9Ci0gICAgICAgICAgICAgICAgICAgICAqLwotCi0gICAgICAgICAgICAgICAgICAgIG1heCB8PSB0bXBJbnQzMiBeKHRtcEludDMyID4+IDMxKTsKLSAgICAgICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgICAgICAvKgotICAgICAgICAgICAgICAgICAqIElGIHRoZSBMVFAgZGF0YSBpcyBhbGwgemVyb3MKLSAgICAgICAgICAgICAgICAgKiAobWF4ID09IDApIC0gZG8gbm90aGluZyBmb3IgdGhpcyBzZmIuCi0gICAgICAgICAgICAgICAgICovCi0KLSAgICAgICAgICAgICAgICBpZiAobWF4ICE9IDApCi0gICAgICAgICAgICAgICAgewotICAgICAgICAgICAgICAgICAgICAvKiBGaW5kIHRoZSBudW1iZXIgb2YgYml0cyB0byByZWFjaCB0aGUgbWF4IHJlc29sdXRpb24gKi8KLSAgICAgICAgICAgICAgICAgICAgdG1wSW50ID0gMDsKLQotICAgICAgICAgICAgICAgICAgICB3aGlsZSAobWF4IDwgMHg0MDAwMDAwMEwpCi0gICAgICAgICAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAgICAgICAgIG1heCA8PD0gMTsKLSAgICAgICAgICAgICAgICAgICAgICAgIHRtcEludCsrOwotICAgICAgICAgICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgICAgICAgICAgLyoKLSAgICAgICAgICAgICAgICAgICAgICogVGhlIGZvbGxvd2luZyBjb2RlcyBhcmUgY29tYmluZGVkIGludG8gc2hpZnQgZmFjdG9yCi0gICAgICAgICAgICAgICAgICAgICAqIGFkanVzdGluZyBhbmQgcmVjb25zdHJ1Y3Rpb24gc2VjdGlvbi4KLSAgICAgICAgICAgICAgICAgICAgICoKLSAgICAgICAgICAgICAgICAgICAgICogcFByZWRpY3RlZF9zcGVjdHJhbCA9IHBQcmVkaWN0ZWRfb2Zmc2V0OwotICAgICAgICAgICAgICAgICAgICAgKiBmb3IoaiA9IHF1YXJ0ZXJfc2ZiX3dpZHRoOyBqPjAgOyBqLS0pCi0gICAgICAgICAgICAgICAgICAgICAqIHsKLSAgICAgICAgICAgICAgICAgICAgICogICAgICAqKHBQcmVkaWN0ZWRfc3BlY3RyYWwrKykgPDw9IHRtcEludDsKLSAgICAgICAgICAgICAgICAgICAgICogICAgICAqKHBQcmVkaWN0ZWRfc3BlY3RyYWwrKykgPDw9IHRtcEludDsKLSAgICAgICAgICAgICAgICAgICAgICogICAgICAqKHBQcmVkaWN0ZWRfc3BlY3RyYWwrKykgPDw9IHRtcEludDsKLSAgICAgICAgICAgICAgICAgICAgICogICAgICAqKHBQcmVkaWN0ZWRfc3BlY3RyYWwrKykgPDw9IHRtcEludDsKLSAgICAgICAgICAgICAgICAgICAgICogfQotICAgICAgICAgICAgICAgICAgICAgKgotICAgICAgICAgICAgICAgICAgICAgKi8KLQotICAgICAgICAgICAgICAgICAgICAvKiBBZGp1c3QgUSBmb3JtYXQgZm9yIHByZWRpY3RlZF9zcGVjdHJhbCgpICovCi0gICAgICAgICAgICAgICAgICAgIGFkanVzdGVkX3ByZWRfcSA9IHByZWRfcV9mb3JtYXQgKyB0bXBJbnQ7Ci0KLSAgICAgICAgICAgICAgICAgICAgLyoKLSAgICAgICAgICAgICAgICAgICAgICogQWRqdXN0IFEgZm9ybWF0IHRvIHByZXZlbnQgb3ZlcmZsb3cgdGhhdCBtYXkgb2NjdXIgZHVyaW5nCi0gICAgICAgICAgICAgICAgICAgICAqIGZyZXF1ZW5jeSBkb21haW4gcmVjb25zdHJ1Y3Rpb24uCi0gICAgICAgICAgICAgICAgICAgICAqCi0gICAgICAgICAgICAgICAgICAgICAqLwotICAgICAgICAgICAgICAgICAgICBwUHJlZGljdGVkX3NwZWN0cmFsID0gcFByZWRpY3RlZF9vZmZzZXQ7Ci0KLSAgICAgICAgICAgICAgICAgICAgc2hpZnRfZmFjdG9yID0gKihwUV9mb3JtYXQpIC0gYWRqdXN0ZWRfcHJlZF9xOwotCi0gICAgICAgICAgICAgICAgICAgIGlmICgoc2hpZnRfZmFjdG9yID49IDApICYmIChzaGlmdF9mYWN0b3IgPCAzMSkpCi0gICAgICAgICAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAgICAgICAgIHNoaWZ0X2ZhY3RvciA9IHNoaWZ0X2ZhY3RvciArIDE7Ci0gICAgICAgICAgICAgICAgICAgICAgICBwcmVkX3NoaWZ0ID0gdG1wSW50IC0gMTsKLQotICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHByZWRfc2hpZnQgPj0gMCkKLSAgICAgICAgICAgICAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBmb3IgKGogPSBxdWFydGVyX3NmYl93aWR0aDsgaiA+IDAgOyBqLS0pCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgewotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0ZW1wID0gKnBDdXJyZW50X2ZyYW1lID4+IHNoaWZ0X2ZhY3RvcjsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKihwQ3VycmVudF9mcmFtZSsrKSA9IHRlbXAKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICsgKCoocFByZWRpY3RlZF9zcGVjdHJhbCsrKSA8PCBwcmVkX3NoaWZ0KTsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdGVtcCA9ICpwQ3VycmVudF9mcmFtZSA+PiBzaGlmdF9mYWN0b3I7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICoocEN1cnJlbnRfZnJhbWUrKykgPSB0ZW1wCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICArICgqKHBQcmVkaWN0ZWRfc3BlY3RyYWwrKykgPDwgcHJlZF9zaGlmdCk7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRlbXAgPSAqcEN1cnJlbnRfZnJhbWUgPj4gc2hpZnRfZmFjdG9yOwotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqKHBDdXJyZW50X2ZyYW1lKyspID0gdGVtcAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKyAoKihwUHJlZGljdGVkX3NwZWN0cmFsKyspIDw8IHByZWRfc2hpZnQpOwotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0ZW1wID0gKnBDdXJyZW50X2ZyYW1lID4+IHNoaWZ0X2ZhY3RvcjsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKihwQ3VycmVudF9mcmFtZSsrKSA9IHRlbXAKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICsgKCoocFByZWRpY3RlZF9zcGVjdHJhbCsrKSA8PCBwcmVkX3NoaWZ0KTsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgICAgICAgICBlbHNlCi0gICAgICAgICAgICAgICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgZm9yIChqID0gcXVhcnRlcl9zZmJfd2lkdGg7IGogPiAwIDsgai0tKQotICAgICAgICAgICAgICAgICAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdGVtcCA9ICpwQ3VycmVudF9mcmFtZSA+PiBzaGlmdF9mYWN0b3I7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICoocEN1cnJlbnRfZnJhbWUrKykgPSB0ZW1wCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICArICgqKHBQcmVkaWN0ZWRfc3BlY3RyYWwrKykgPj4gMSk7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRlbXAgPSAqcEN1cnJlbnRfZnJhbWUgPj4gc2hpZnRfZmFjdG9yOwotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqKHBDdXJyZW50X2ZyYW1lKyspID0gdGVtcAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKyAoKihwUHJlZGljdGVkX3NwZWN0cmFsKyspID4+IDEpOwotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0ZW1wID0gKnBDdXJyZW50X2ZyYW1lID4+IHNoaWZ0X2ZhY3RvcjsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKihwQ3VycmVudF9mcmFtZSsrKSA9IHRlbXAKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICsgKCoocFByZWRpY3RlZF9zcGVjdHJhbCsrKSA+PiAxKTsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdGVtcCA9ICpwQ3VycmVudF9mcmFtZSA+PiBzaGlmdF9mYWN0b3I7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICoocEN1cnJlbnRfZnJhbWUrKykgPSB0ZW1wCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICArICgqKHBQcmVkaWN0ZWRfc3BlY3RyYWwrKykgPj4gMSk7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgICAgICAgICAgfQotCi0gICAgICAgICAgICAgICAgICAgICAgICAvKiBVcGRhdGVkIG5ldyBRIGZvcm1hdCBmb3IgY3VycmVudCBzY2FsZWZhY3RvciBiYW5kICovCi0gICAgICAgICAgICAgICAgICAgICAgICAqKHBRX2Zvcm1hdCkgPSBhZGp1c3RlZF9wcmVkX3EgIC0gMTsKLSAgICAgICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgICAgICBlbHNlIGlmIChzaGlmdF9mYWN0b3IgPj0gMzEpCi0gICAgICAgICAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAgICAgICAgIGZvciAoaiA9IHF1YXJ0ZXJfc2ZiX3dpZHRoOyBqID4gMCA7IGotLSkKLSAgICAgICAgICAgICAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAqKHBDdXJyZW50X2ZyYW1lKyspID0KLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKihwUHJlZGljdGVkX3NwZWN0cmFsKyspIDw8IHRtcEludDsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAqKHBDdXJyZW50X2ZyYW1lKyspID0KLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKihwUHJlZGljdGVkX3NwZWN0cmFsKyspIDw8IHRtcEludDsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAqKHBDdXJyZW50X2ZyYW1lKyspID0KLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKihwUHJlZGljdGVkX3NwZWN0cmFsKyspIDw8IHRtcEludDsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAqKHBDdXJyZW50X2ZyYW1lKyspID0KLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKihwUHJlZGljdGVkX3NwZWN0cmFsKyspIDw8IHRtcEludDsKLSAgICAgICAgICAgICAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgICAgICAgICAgICAgLyogVXBkYXRlZCBuZXcgUSBmb3JtYXQgZm9yIGN1cnJlbnQgc2NhbGVmYWN0b3IgYmFuZCAqLwotICAgICAgICAgICAgICAgICAgICAgICAgKihwUV9mb3JtYXQpID0gYWRqdXN0ZWRfcHJlZF9xIDsKLSAgICAgICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgICAgICBlbHNlIGlmICgoc2hpZnRfZmFjdG9yIDwgMCkgJiYgKHNoaWZ0X2ZhY3RvciA+IC0zMSkpCi0gICAgICAgICAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAgICAgICAgIHNoaWZ0X2ZhY3RvciA9IDEgLSBzaGlmdF9mYWN0b3I7Ci0gICAgICAgICAgICAgICAgICAgICAgICBwcmVkX3NoaWZ0ID0gdG1wSW50IC0gc2hpZnRfZmFjdG9yOwotCi0gICAgICAgICAgICAgICAgICAgICAgICBpZiAocHJlZF9zaGlmdCA+PSAwKQotICAgICAgICAgICAgICAgICAgICAgICAgewotICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZvciAoaiA9IHF1YXJ0ZXJfc2ZiX3dpZHRoOyBqID4gMCA7IGotLSkKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRlbXAgPSAqcEN1cnJlbnRfZnJhbWUgPj4gMTsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKihwQ3VycmVudF9mcmFtZSsrKSA9ICB0ZW1wICsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoKihwUHJlZGljdGVkX3NwZWN0cmFsKyspIDw8IHByZWRfc2hpZnQpOwotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0ZW1wID0gKnBDdXJyZW50X2ZyYW1lID4+IDE7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICoocEN1cnJlbnRfZnJhbWUrKykgPSAgdGVtcCArCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKCoocFByZWRpY3RlZF9zcGVjdHJhbCsrKSA8PCBwcmVkX3NoaWZ0KTsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdGVtcCA9ICpwQ3VycmVudF9mcmFtZSA+PiAxOwotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqKHBDdXJyZW50X2ZyYW1lKyspID0gIHRlbXAgKwotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICgqKHBQcmVkaWN0ZWRfc3BlY3RyYWwrKykgPDwgcHJlZF9zaGlmdCk7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRlbXAgPSAqcEN1cnJlbnRfZnJhbWUgPj4gMTsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKihwQ3VycmVudF9mcmFtZSsrKSA9ICB0ZW1wICsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoKihwUHJlZGljdGVkX3NwZWN0cmFsKyspIDw8IHByZWRfc2hpZnQpOwotICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICAgICAgICAgIGVsc2UKLSAgICAgICAgICAgICAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBwcmVkX3NoaWZ0ID0gLXByZWRfc2hpZnQ7Ci0KLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBmb3IgKGogPSBxdWFydGVyX3NmYl93aWR0aDsgaiA+IDAgOyBqLS0pCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgewotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0ZW1wID0gKnBDdXJyZW50X2ZyYW1lID4+IDE7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICoocEN1cnJlbnRfZnJhbWUrKykgPSAgdGVtcCArCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKCoocFByZWRpY3RlZF9zcGVjdHJhbCsrKSA+PiBwcmVkX3NoaWZ0KTsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdGVtcCA9ICpwQ3VycmVudF9mcmFtZSA+PiAxOwotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqKHBDdXJyZW50X2ZyYW1lKyspID0gIHRlbXAgKwotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICgqKHBQcmVkaWN0ZWRfc3BlY3RyYWwrKykgPj4gcHJlZF9zaGlmdCk7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRlbXAgPSAqcEN1cnJlbnRfZnJhbWUgPj4gMTsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKihwQ3VycmVudF9mcmFtZSsrKSA9ICB0ZW1wICsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoKihwUHJlZGljdGVkX3NwZWN0cmFsKyspID4+IHByZWRfc2hpZnQpOwotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0ZW1wID0gKnBDdXJyZW50X2ZyYW1lID4+IDE7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICoocEN1cnJlbnRfZnJhbWUrKykgPSAgdGVtcCArCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKCoocFByZWRpY3RlZF9zcGVjdHJhbCsrKSA+PiBwcmVkX3NoaWZ0KTsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgICAgICAgICAgICAgIC8qCi0gICAgICAgICAgICAgICAgICAgICAgICAgKiBVcGRhdGVkIG5ldyBRIGZvcm1hdCBmb3IgY3VycmVudCBzY2FsZWZhY3RvciBiYW5kCi0gICAgICAgICAgICAgICAgICAgICAgICAgKgotICAgICAgICAgICAgICAgICAgICAgICAgICogVGhpcyBpcyBOT1QgYSBwb2ludGVyIGRlY3JlbWVudAotICAgICAgICAgICAgICAgICAgICAgICAgICovCi0gICAgICAgICAgICAgICAgICAgICAgICAoKnBRX2Zvcm1hdCktLTsKLSAgICAgICAgICAgICAgICAgICAgfQotCi0gICAgICAgICAgICAgICAgfSAvKiBpZiAobWF4ICE9IDApICovCi0KLSAgICAgICAgICAgICAgICAvKgotICAgICAgICAgICAgICAgICAqIEZvciBjYXNlIChzaGlmdF9mYWN0b3IgPD0gLTMxKSwgKnBDdXJyZW50X2ZyYW1lIGFuZAotICAgICAgICAgICAgICAgICAqICpwUV9mb3JtYXQgZG8gbm90IG5lZWQgdG8gYmUgdXBkYXRlZC4KLSAgICAgICAgICAgICAgICAgKi8KLQotICAgICAgICAgICAgfSAvKiBpZiAoKihwU2ZiX3ByZWRpY3Rpb25fdXNlZCsrKSAhPSBGQUxTRSkgKi8KLQotICAgICAgICAgICAgLyogVXBkYXRlZCB0byBuZXh0IHNjYWxlZmFjdG9yIGJhbmQuICovCi0gICAgICAgICAgICBzZmJfb2Zmc2V0ID0gKihwV2luU2ZiVG9wKyspOwotCi0gICAgICAgICAgICAvKiBVcGRhdGVkIHBvaW50ZXIgdG8gbmV4dCBzY2FsZWZhY3RvciBiYW5kJ3MgUS1mb3JtYXQgKi8KLSAgICAgICAgICAgIHBRX2Zvcm1hdCsrOwotCi0gICAgICAgIH0gLyogZm9yIChpID0gc2ZiX3Blcl9mcmFtZTsgaT4wOyBpLS0pICovCi0KLSAgICB9IC8qIGlmICh3aW5fc2VxIT1FSUdIVF9TSE9SVF9TRVFVRU5DRSkgKi8KLQotICAgIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotICAgIC8qIExUUCBzeW50aGVzaXMgZm9yIHNob3J0IHdpbmRvdyAqLwotICAgIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotICAgIGVsc2UKLSAgICB7Ci0gICAgICAgIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0gICAgICAgIC8qUmVjb25zdHJ1Y3Rpb24gb2YgY3VycmVudCBmcmVxdWVuY3kgZG9tYWluIHNwZWN0cnVtICovCi0gICAgICAgIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0gICAgICAgIHBDdXJyZW50X2ZyYW1lX3N0YXJ0ID0gJmN1cnJlbnRfZnJhbWVbMF07Ci0KLSAgICAgICAgcFFfZm9ybWF0X3N0YXJ0ID0gJnFfZm9ybWF0WzBdOwotCi0gICAgICAgIG51bV9zZmIgPSBzZmJfcGVyX3dpbjsKLQotICAgICAgICAvKiBSZWNvbnN0cnVjdGlvbiBpcyBwcm9jZXNzZWQgb24gd2luZG93IGJhc2lzICovCi0gICAgICAgIGZvciAod25kID0gMDsgd25kIDwgc2hvcnRfd2luZG93X251bTsgd25kKyspCi0gICAgICAgIHsKLSAgICAgICAgICAgIHBXaW5TZmJUb3AgPSAmd2luX3NmYl90b3BbMF07Ci0KLSAgICAgICAgICAgIHBRX2Zvcm1hdCA9IHBRX2Zvcm1hdF9zdGFydDsKLQotICAgICAgICAgICAgLyogQ2hlY2sgaWYgcHJlZGljdGlvbiBmbGFnIGlzIG9uIGZvciBlYWNoIHdpbmRvdyAqLwotICAgICAgICAgICAgaWYgKHdpbl9wcmVkaWN0aW9uX3VzZWRbd25kXSAhPSBGQUxTRSkKLSAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAvKiBJbml0aWFsaXplIHNjYWxlZmFjdG9yIGJhbmQgb2Zmc2V0ICovCi0gICAgICAgICAgICAgICAgc2ZiX29mZnNldCA9IDA7Ci0KLSAgICAgICAgICAgICAgICAvKgotICAgICAgICAgICAgICAgICAqIFJlY29uc3RydWN0aW9uIGlzIHByb2Nlc3NlZCBvbiBzY2FsZWZhY3RvciBiYW5kIGJhc2lzLgotICAgICAgICAgICAgICAgICAqIDEuIFdoZW4gcHJlZGljdGlvbiBpcyB0dXJuZWQgb24sIGFsbCB0aGUgcHJlZGljdGVkCi0gICAgICAgICAgICAgICAgICogc3BlY3RyYWwgY29tcG9uZW50cyB3aWxsIGJlIHVzZWQgZm9yIHJlY29uc3RydWN0aW9uLgotICAgICAgICAgICAgICAgICAqIDIuIFdoZW4gcHJlZGljdGlvbiBpcyB0dXJuZWQgb2ZmLCByZWNvbnN0cnVjdGlvbiBpcwotICAgICAgICAgICAgICAgICAqIG5vdCBuZWVkZWQuIFNwZWN0cmFsIGNvbXBvbmVudHMgb2YgY3VycmVudCBmcmFtZQotICAgICAgICAgICAgICAgICAqIHdpbGwgZGlyZWN0bHkgY29tZSBmcm9tIHRoZSB0cmFuc21pdHRlZCBkYXRhLgotICAgICAgICAgICAgICAgICAqLwotCi0gICAgICAgICAgICAgICAgLyoKLSAgICAgICAgICAgICAgICAgKiBBY2NvcmRpbmcgdG8gSVNPL0lFQyAxNDQ5Ni0zIHBnLjkxCi0gICAgICAgICAgICAgICAgICogT25seSB0aGUgc3BlY3RyYWwgY29tcG9uZW50cyBpbiBmaXJzdCBlaWdodCBzY2FsZWZhY3RvcgotICAgICAgICAgICAgICAgICAqIGJhbmRzIGFyZSBhZGRlZCB0byB0aGUgcXVhbnRpemVkIHByZWRpY3Rpb24gZXJyb3IuCi0gICAgICAgICAgICAgICAgICovCi0gICAgICAgICAgICAgICAgZm9yIChpID0gcmVjb25zdHJ1Y3Rfc2ZiX251bTsgaSA+IDA7IGktLSkKLSAgICAgICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgICAgIC8qIFNldCBwb2ludGVyIHRvIHRoZSBvZmZzZXQgb2Ygc2NhbGVmYWN0b3IgYmFuZHMgKi8KLSAgICAgICAgICAgICAgICAgICAgcFByZWRpY3RlZF9vZmZzZXQgPSBwUHJlZGljdGVkX3NwZWN0cmFsX3N0YXJ0ICsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzZmJfb2Zmc2V0OwotICAgICAgICAgICAgICAgICAgICBwQ3VycmVudF9mcmFtZSA9IHBDdXJyZW50X2ZyYW1lX3N0YXJ0ICsgc2ZiX29mZnNldDsKLQotICAgICAgICAgICAgICAgICAgICAvKgotICAgICAgICAgICAgICAgICAgICAgKiBQcmVkaWN0aW9uIGlzIG9uLiBEbyByZWNvbnN0cnVjdGlvbiByb3V0aW5lLgotICAgICAgICAgICAgICAgICAgICAgKiBSZWNvbnN0cnVjdCBzcGVjdHJhbCBjb21wb25lbnQgb2YKLSAgICAgICAgICAgICAgICAgICAgICogY3VycmVudCBmcmFtZSBieSBhZGRpbmcgdGhlIHByZWRpY3RlZAotICAgICAgICAgICAgICAgICAgICAgKiBzcGVjdHJhbCBjb21wb25lbnRzIGFuZCB0aGUgcXVhbnRpemVkCi0gICAgICAgICAgICAgICAgICAgICAqIHByZWRpY3Rpb24gZXJyb3JzIHRoYXQgcmVjb25zdHJ1Y3RlZAotICAgICAgICAgICAgICAgICAgICAgKiBmcm9tIHRyYW5zbWl0dGVkIGRhdGEgd2hlbiBwcmVkaWN0aW9uCi0gICAgICAgICAgICAgICAgICAgICAqIGlzIHR1cm5lZCBvbi4KLSAgICAgICAgICAgICAgICAgICAgICovCi0KLSAgICAgICAgICAgICAgICAgICAgLyoKLSAgICAgICAgICAgICAgICAgICAgICogKCpwV2luU2ZiVG9wIC0gc2ZiX29mZnNldCkgaXMgbnVtYmVyIG9mIGNvZWZmaWNpZW50cwotICAgICAgICAgICAgICAgICAgICAgKiBvZiB0aGUgc2NhbGVmYWN0b3IgYmFuZC4KLSAgICAgICAgICAgICAgICAgICAgICogIj4+MiIgaXMgdXNlZCB0byBzZXQgdXAgZm9yIGxhdGVyIHVucm9sbGluZyB0aGUgbG9vcC4KLSAgICAgICAgICAgICAgICAgICAgICovCi0gICAgICAgICAgICAgICAgICAgIHF1YXJ0ZXJfc2ZiX3dpZHRoID0gKCpwV2luU2ZiVG9wIC0gc2ZiX29mZnNldCkgPj4gMjsKLQotICAgICAgICAgICAgICAgICAgICAvKgotICAgICAgICAgICAgICAgICAgICAgKiBBZGp1c3QgcHJlZF9xX2Zvcm1hdCBhbmQgcHJlZGljdGVkX3NwZWN0cmFsKCkgdG8KLSAgICAgICAgICAgICAgICAgICAgICogbWF4aW11bSByZXNvbHV0aW9uLgotICAgICAgICAgICAgICAgICAgICAgKi8KLSAgICAgICAgICAgICAgICAgICAgbWF4ID0gMDsKLSAgICAgICAgICAgICAgICAgICAgcFByZWRpY3RlZF9zcGVjdHJhbCA9IHBQcmVkaWN0ZWRfb2Zmc2V0OwotCi0gICAgICAgICAgICAgICAgICAgIC8qIEZpbmQgdGhlIG1heGltdW0gYWJzb2x1dGUgdmFsdWUgKi8KLSAgICAgICAgICAgICAgICAgICAgZm9yIChqID0gKCpwV2luU2ZiVG9wIC0gc2ZiX29mZnNldCk7IGogPiAwIDsgai0tKQotICAgICAgICAgICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgICAgICAgICB0bXBJbnQzMiA9ICoocFByZWRpY3RlZF9zcGVjdHJhbCsrKTsKLQotCi0gICAgICAgICAgICAgICAgICAgICAgICAvKgotICAgICAgICAgICAgICAgICAgICAgICAgICogTm90ZTogb3ZlcmZsb3cgaXMgcHJvdGVjdGVkIGhlcmUgZXZlbiB0aG91Z2gKLSAgICAgICAgICAgICAgICAgICAgICAgICAqIHRtcEludDMyID0gMHg4MDAwMDAwMCBpcyB2ZXJ5IHJhcmUgY2FzZS4KLSAgICAgICAgICAgICAgICAgICAgICAgICAqCi0gICAgICAgICAgICAgICAgICAgICAgICAgKiAgaWYgKHRtcEludDMyID09IExPTkdfTUlOKQotICAgICAgICAgICAgICAgICAgICAgICAgICogIHsKLSAgICAgICAgICAgICAgICAgICAgICAgICAqICAgICAgdG1wSW50MzIgPSBMT05HX01BWDsKLSAgICAgICAgICAgICAgICAgICAgICAgICAqICB9Ci0gICAgICAgICAgICAgICAgICAgICAgICAgKiAgaWYgKHRtcEludDMyIDwgMCkKLSAgICAgICAgICAgICAgICAgICAgICAgICAqICB7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgKiAgICAgIHRtcEludDMyID0gLXRtcEludDMyOwotICAgICAgICAgICAgICAgICAgICAgICAgICogIH0KLSAgICAgICAgICAgICAgICAgICAgICAgICAqLwotCi0gICAgICAgICAgICAgICAgICAgICAgICBtYXggfD0gdG1wSW50MzIgXih0bXBJbnQzMiA+PiAzMSk7Ci0gICAgICAgICAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgICAgICAgICBpZiAobWF4ICE9IDApCi0gICAgICAgICAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAgICAgICAgIC8qIEZpbmQgdGhlIG51bWJlciBvZiBiaXRzIHRvIHJlYWNoCi0gICAgICAgICAgICAgICAgICAgICAgICAgKiB0aGUgbWF4IHJlc29sdXRpb24KLSAgICAgICAgICAgICAgICAgICAgICAgICAqLwotICAgICAgICAgICAgICAgICAgICAgICAgdG1wSW50ID0gMDsKLQotICAgICAgICAgICAgICAgICAgICAgICAgd2hpbGUgKG1heCA8IDB4NDAwMDAwMDBMKQotICAgICAgICAgICAgICAgICAgICAgICAgewotICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1heCA8PD0gMTsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICB0bXBJbnQrKzsKLSAgICAgICAgICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICAgICAgICAgIC8qCi0gICAgICAgICAgICAgICAgICAgICAgICAgKiBUaGUgZm9sbG93aW5nIGNvZGVzIGFyZSBjb21iaW5lZCBpbnRvIHNoaWZ0IGZhY3RvcgotICAgICAgICAgICAgICAgICAgICAgICAgICogYWRqdXN0aW5nIGFuZCByZWNvbnN0cnVjdGlvbiBzZWN0aW9uLgotICAgICAgICAgICAgICAgICAgICAgICAgICoKLSAgICAgICAgICAgICAgICAgICAgICAgICAqIHBQcmVkaWN0ZWRfc3BlY3RyYWwgPSBwUHJlZGljdGVkX29mZnNldDsKLSAgICAgICAgICAgICAgICAgICAgICAgICAqIGZvcihqID0gcXVhcnRlcl9zZmJfd2lkdGg7IGo+MCA7IGotLSkKLSAgICAgICAgICAgICAgICAgICAgICAgICAqIHsKLSAgICAgICAgICAgICAgICAgICAgICAgICAqICAgICAgKihwUHJlZGljdGVkX3NwZWN0cmFsKyspIDw8PSB0bXBJbnQ7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgKiAgICAgICoocFByZWRpY3RlZF9zcGVjdHJhbCsrKSA8PD0gdG1wSW50OwotICAgICAgICAgICAgICAgICAgICAgICAgICogICAgICAqKHBQcmVkaWN0ZWRfc3BlY3RyYWwrKykgPDw9IHRtcEludDsKLSAgICAgICAgICAgICAgICAgICAgICAgICAqICAgICAgKihwUHJlZGljdGVkX3NwZWN0cmFsKyspIDw8PSB0bXBJbnQ7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgKiB9Ci0gICAgICAgICAgICAgICAgICAgICAgICAgKgotICAgICAgICAgICAgICAgICAgICAgICAgICovCi0KLSAgICAgICAgICAgICAgICAgICAgICAgIC8qIEFkanVzdCBRIGZvcm1hdCBmb3IgcHJlZGljdGVkX3NwZWN0cmFsKCkgKi8KLSAgICAgICAgICAgICAgICAgICAgICAgIGFkanVzdGVkX3ByZWRfcSA9IHByZWRfcV9mb3JtYXQgKyB0bXBJbnQ7Ci0KLSAgICAgICAgICAgICAgICAgICAgICAgIC8qCi0gICAgICAgICAgICAgICAgICAgICAgICAgKiBBZGp1c3QgUSBmb3JtYXQgdG8gcHJldmVudCBvdmVyZmxvdyB0aGF0IG1heSBvY2N1cgotICAgICAgICAgICAgICAgICAgICAgICAgICogZHVyaW5nIGZyZXF1ZW5jeSBkb21haW4gcmVjb25zdHJ1Y3Rpb24uCi0gICAgICAgICAgICAgICAgICAgICAgICAgKi8KLSAgICAgICAgICAgICAgICAgICAgICAgIHBQcmVkaWN0ZWRfc3BlY3RyYWwgPSBwUHJlZGljdGVkX29mZnNldDsKLQotICAgICAgICAgICAgICAgICAgICAgICAgc2hpZnRfZmFjdG9yID0gKihwUV9mb3JtYXQpIC0gYWRqdXN0ZWRfcHJlZF9xOwotCi0gICAgICAgICAgICAgICAgICAgICAgICBpZiAoKHNoaWZ0X2ZhY3RvciA+PSAwKSAmJiAoc2hpZnRfZmFjdG9yIDwgMzEpKQotICAgICAgICAgICAgICAgICAgICAgICAgewotICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNoaWZ0X2ZhY3RvciA9IHNoaWZ0X2ZhY3RvciArIDE7Ci0KLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBwcmVkX3NoaWZ0ID0gdG1wSW50IC0gMTsKLQotICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChwcmVkX3NoaWZ0ID49IDApCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgewotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBmb3IgKGogPSBxdWFydGVyX3NmYl93aWR0aDsgaiA+IDAgOyBqLS0pCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRlbXAgPSAqcEN1cnJlbnRfZnJhbWUgPj4gc2hpZnRfZmFjdG9yOwotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKihwQ3VycmVudF9mcmFtZSsrKSA9IHRlbXAKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICArICgqKHBQcmVkaWN0ZWRfc3BlY3RyYWwrKykgPDwgcHJlZF9zaGlmdCk7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0ZW1wID0gKnBDdXJyZW50X2ZyYW1lID4+IHNoaWZ0X2ZhY3RvcjsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICoocEN1cnJlbnRfZnJhbWUrKykgPSB0ZW1wCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKyAoKihwUHJlZGljdGVkX3NwZWN0cmFsKyspIDw8IHByZWRfc2hpZnQpOwotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdGVtcCA9ICpwQ3VycmVudF9mcmFtZSA+PiBzaGlmdF9mYWN0b3I7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqKHBDdXJyZW50X2ZyYW1lKyspID0gdGVtcAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICsgKCoocFByZWRpY3RlZF9zcGVjdHJhbCsrKSA8PCBwcmVkX3NoaWZ0KTsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRlbXAgPSAqcEN1cnJlbnRfZnJhbWUgPj4gc2hpZnRfZmFjdG9yOwotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKihwQ3VycmVudF9mcmFtZSsrKSA9IHRlbXAKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICArICgqKHBQcmVkaWN0ZWRfc3BlY3RyYWwrKykgPDwgcHJlZF9zaGlmdCk7Ci0KLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBlbHNlCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgewotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBmb3IgKGogPSBxdWFydGVyX3NmYl93aWR0aDsgaiA+IDAgOyBqLS0pCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRlbXAgPSAqcEN1cnJlbnRfZnJhbWUgPj4gc2hpZnRfZmFjdG9yOwotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKihwQ3VycmVudF9mcmFtZSsrKSA9IHRlbXAKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICArICgqKHBQcmVkaWN0ZWRfc3BlY3RyYWwrKykgPj4gMSk7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0ZW1wID0gKnBDdXJyZW50X2ZyYW1lID4+IHNoaWZ0X2ZhY3RvcjsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICoocEN1cnJlbnRfZnJhbWUrKykgPSB0ZW1wCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKyAoKihwUHJlZGljdGVkX3NwZWN0cmFsKyspID4+IDEpOwotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdGVtcCA9ICpwQ3VycmVudF9mcmFtZSA+PiBzaGlmdF9mYWN0b3I7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqKHBDdXJyZW50X2ZyYW1lKyspID0gdGVtcAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICsgKCoocFByZWRpY3RlZF9zcGVjdHJhbCsrKSA+PiAxKTsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRlbXAgPSAqcEN1cnJlbnRfZnJhbWUgPj4gc2hpZnRfZmFjdG9yOwotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKihwQ3VycmVudF9mcmFtZSsrKSA9IHRlbXAKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICArICgqKHBQcmVkaWN0ZWRfc3BlY3RyYWwrKykgPj4gMSk7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICAgICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAvKiBVcGRhdGVkIG5ldyBRIGZvcm1hdCBmb3IgY3VycmVudCBzY2FsZWZhY3RvciBiYW5kKi8KLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAqKHBRX2Zvcm1hdCkgPSBhZGp1c3RlZF9wcmVkX3EgLSAxOwotICAgICAgICAgICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgICAgICAgICAgZWxzZSBpZiAoc2hpZnRfZmFjdG9yID49IDMxKQotICAgICAgICAgICAgICAgICAgICAgICAgewotICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZvciAoaiA9IHF1YXJ0ZXJfc2ZiX3dpZHRoOyBqID4gMCA7IGotLSkKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICoocEN1cnJlbnRfZnJhbWUrKykgPQotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKihwUHJlZGljdGVkX3NwZWN0cmFsKyspIDw8IHRtcEludDsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKihwQ3VycmVudF9mcmFtZSsrKSA9Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqKHBQcmVkaWN0ZWRfc3BlY3RyYWwrKykgPDwgdG1wSW50OwotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqKHBDdXJyZW50X2ZyYW1lKyspID0KLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICoocFByZWRpY3RlZF9zcGVjdHJhbCsrKSA8PCB0bXBJbnQ7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICoocEN1cnJlbnRfZnJhbWUrKykgPQotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKihwUHJlZGljdGVkX3NwZWN0cmFsKyspIDw8IHRtcEludDsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAvKiBVcGRhdGVkIG5ldyBRIGZvcm1hdCBmb3IgY3VycmVudCBzY2FsZWZhY3RvciBiYW5kKi8KLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAqKHBRX2Zvcm1hdCkgPSBhZGp1c3RlZF9wcmVkX3E7Ci0gICAgICAgICAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgICAgICAgICBlbHNlIGlmICgoc2hpZnRfZmFjdG9yIDwgMCkgJiYgKHNoaWZ0X2ZhY3RvciA+IC0zMSkpCi0gICAgICAgICAgICAgICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgc2hpZnRfZmFjdG9yID0gMSAtIHNoaWZ0X2ZhY3RvcjsKLQotICAgICAgICAgICAgICAgICAgICAgICAgICAgIHByZWRfc2hpZnQgPSB0bXBJbnQgLSBzaGlmdF9mYWN0b3I7Ci0KLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAocHJlZF9zaGlmdCA+PSAwKQotICAgICAgICAgICAgICAgICAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZm9yIChqID0gcXVhcnRlcl9zZmJfd2lkdGg7IGogPiAwIDsgai0tKQotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0ZW1wID0gKnBDdXJyZW50X2ZyYW1lID4+IDE7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqKHBDdXJyZW50X2ZyYW1lKyspID0gIHRlbXAgKwotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoKihwUHJlZGljdGVkX3NwZWN0cmFsKyspIDw8IHByZWRfc2hpZnQpOwotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdGVtcCA9ICpwQ3VycmVudF9mcmFtZSA+PiAxOwotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKihwQ3VycmVudF9mcmFtZSsrKSA9ICB0ZW1wICsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKCoocFByZWRpY3RlZF9zcGVjdHJhbCsrKSA8PCBwcmVkX3NoaWZ0KTsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRlbXAgPSAqcEN1cnJlbnRfZnJhbWUgPj4gMTsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICoocEN1cnJlbnRfZnJhbWUrKykgPSAgdGVtcCArCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICgqKHBQcmVkaWN0ZWRfc3BlY3RyYWwrKykgPDwgcHJlZF9zaGlmdCk7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0ZW1wID0gKnBDdXJyZW50X2ZyYW1lID4+IDE7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqKHBDdXJyZW50X2ZyYW1lKyspID0gIHRlbXAgKwotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoKihwUHJlZGljdGVkX3NwZWN0cmFsKyspIDw8IHByZWRfc2hpZnQpOwotCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgZWxzZQotICAgICAgICAgICAgICAgICAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcHJlZF9zaGlmdCA9IC1wcmVkX3NoaWZ0OwotCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZvciAoaiA9IHF1YXJ0ZXJfc2ZiX3dpZHRoOyBqID4gMCA7IGotLSkKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgewotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdGVtcCA9ICpwQ3VycmVudF9mcmFtZSA+PiAxOwotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKihwQ3VycmVudF9mcmFtZSsrKSA9ICB0ZW1wICsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKCoocFByZWRpY3RlZF9zcGVjdHJhbCsrKSA+PiBwcmVkX3NoaWZ0KTsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRlbXAgPSAqcEN1cnJlbnRfZnJhbWUgPj4gMTsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICoocEN1cnJlbnRfZnJhbWUrKykgPSAgdGVtcCArCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICgqKHBQcmVkaWN0ZWRfc3BlY3RyYWwrKykgPj4gcHJlZF9zaGlmdCk7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0ZW1wID0gKnBDdXJyZW50X2ZyYW1lID4+IDE7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqKHBDdXJyZW50X2ZyYW1lKyspID0gIHRlbXAgKwotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoKihwUHJlZGljdGVkX3NwZWN0cmFsKyspID4+IHByZWRfc2hpZnQpOwotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdGVtcCA9ICpwQ3VycmVudF9mcmFtZSA+PiAxOwotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKihwQ3VycmVudF9mcmFtZSsrKSA9ICB0ZW1wICsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKCoocFByZWRpY3RlZF9zcGVjdHJhbCsrKSA+PiBwcmVkX3NoaWZ0KTsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8qIFVwZGF0ZWQgbmV3IFEgZm9ybWF0IGZvciBjdXJyZW50IHNjYWxlZmFjdG9yIGJhbmQqLwotICAgICAgICAgICAgICAgICAgICAgICAgICAgICoocFFfZm9ybWF0KSA9ICoocFFfZm9ybWF0KSAtIDE7Ci0gICAgICAgICAgICAgICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgICAgICAgICAgICAgIC8qCi0gICAgICAgICAgICAgICAgICAgICAgICAgKiBGb3IgY2FzZSAoc2hpZnRfZmFjdG9yIDw9IC0zMSksICpwQ3VycmVudF9mcmFtZSBhbmQKLSAgICAgICAgICAgICAgICAgICAgICAgICAqICpwUV9mb3JtYXQgZG8gbm90IG5lZWQgdG8gYmUgdXBkYXRlZC4KLSAgICAgICAgICAgICAgICAgICAgICAgICAqLwotCi0gICAgICAgICAgICAgICAgICAgIH0gLyogaWYgKG1heCAhPSAwKSAqLwotCi0gICAgICAgICAgICAgICAgICAgIC8qIFVwZGF0ZWQgdG8gbmV4dCBzY2FsZWZhY3RvciBiYW5kLiAqLwotICAgICAgICAgICAgICAgICAgICBzZmJfb2Zmc2V0ID0gKihwV2luU2ZiVG9wKyspOwotCi0gICAgICAgICAgICAgICAgICAgIC8qIFVwZGF0ZWQgcG9pbnRlciB0byBuZXh0IHNjYWxlZmFjdG9yIGJhbmQncyBRLWZvcm1hdCAqLwotICAgICAgICAgICAgICAgICAgICBwUV9mb3JtYXQrKzsKLQotICAgICAgICAgICAgICAgIH0gLyogZm9yIChpID0gcmVjb25zdHJ1Y3Rfc2ZiX251bTsgaSA+IDA7IGktLSkgKi8KLQotICAgICAgICAgICAgfSAvKiBpZiAod2luX3ByZWRpY3Rpb25fdXNlZFt3bmRdICE9IEZBTFNFKSAqLwotCi0gICAgICAgICAgICAvKiBVcGRhdGVkIHRvIG5leHQgd2luZG93ICovCi0gICAgICAgICAgICBwUHJlZGljdGVkX3NwZWN0cmFsX3N0YXJ0ICs9IGNvZWZfcGVyX3dpbjsKLSAgICAgICAgICAgIHBDdXJyZW50X2ZyYW1lX3N0YXJ0ICs9IGNvZWZfcGVyX3dpbjsKLSAgICAgICAgICAgIHBRX2Zvcm1hdF9zdGFydCArPSBudW1fc2ZiOwotCi0gICAgICAgIH0gLyogZm9yICh3bmQ9MDsgd25kPHNob3J0X3dpbmRvd19udW07IHduZCsrKSAqLwotCi0gICAgfSAvKiBlbHNlICovCi0KLSAgICAvKi0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0KLSAgICA7IFJldHVybiBub3RoaW5nIG9yIGRhdGEgb3IgZGF0YSBwb2ludGVyCi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xhY2Ugc29tZSBpbnN0YW5jZXMgb2YgZ2V0Yml0cyB0byBnZXQ5X25fbGVzc2JpdHMKLSAgICAgICAgICAgICAgd2hlbiB0aGUgbnVtYmVyIG9mIGJpdHMgcmVhZCBpcyA5IG9yIGxlc3MgYW5kIGdldDFiaXRzCi0gICAgICAgICAgICAgIHdoZW4gb25seSAxIGJpdCBpcyByZWFkLgotCi0gV2hvOiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgRGF0ZToKLSBEZXNjcmlwdGlvbjoKLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLQotIElOUFVUIEFORCBPVVRQVVQgREVGSU5JVElPTlMKLQotIElucHV0czoKLSAgICB3aW5fdHlwZSAgICAgICAgVHlwZSBvZiB3aW5kb3cgKFNIT1JUIG9yIExPTkcpCi0gICAgICAgICAgICAgICAgICAgIFtXSU5ET1dfVFlQRV0KLQotICAgIG1heF9zZmIgICAgICAgICBNYXhpbXVtIG51bWJlciBvZiBhY3RpdmUgc2NhbGVmYWN0b3IgYmFuZHMKLSAgICAgICAgICAgICAgICAgICAgW0ludF0KLQotICAgIHBMdF9wcmVkICAgICAgICBQb2ludGVyIHRvIHN0cnVjdHVyZSBjb250YWluaW5nIGluZm9ybWF0aW9uIGZvcgotICAgICAgICAgICAgICAgICAgICBsb25nLXRlcm0gcHJlZGljdGlvbi4KLSAgICAgICAgICAgICAgICAgICAgW0xUX1BSRURfU1RBVFVTICpdCi0KLSAgICBwSW5wdXRTdHJlYW0gICAgUG9pbnRlciB0byBzdHJ1Y3R1cmUgY29udGFpbmluZyBiaXRzdHJlYW0KLSAgICAgICAgICAgICAgICAgICAgaW5mb3JtYXRpb24uCi0gICAgICAgICAgICAgICAgICAgIFtCSVRTICpdCi0KLSBMb2NhbCBTdG9yZXMvQnVmZmVycy9Qb2ludGVycyBOZWVkZ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IGxhc3RfYmFuZCA9IG1heF9zZmI7Ci0KLSAgICBJRiAod2luX3R5cGUgIT0gRUlHSFRfU0hPUlRfU0VRVUVOQ0UpCi0KLSAgICAgICAgSUYgKGxhc3RfYmFuZCA+IE1BWF9MVF9QUkVEX0xPTkdfU0ZCKQotCi0gICAgICAgICAgICBsYXN0X2JhbmQgPSBNQVhfTFRfUFJFRF9MT05HX1NGQjsKLQotICAgICAgICBFTkRJRgotCi0gICAgICAgIEZPUiAobSA9IGxhc3RfYmFuZDsgbSA+IDA7IG0tLSkKLQotICAgICAgICAgICAgKihwU2ZiUHJlZGljdGlvblVzZWQrKykgPSAoSW50KSBnZXRiaXRzKAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBMRU5fTFRQX0xPTkdfVVNFRCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcElucHV0U3RyZWFtKTsKLSAgICAgICAgRU5ERk9SCi0KLSAgICAgICAgRk9SIChtID0gKG1heF9zZmIgLSBsYXN0X2JhbmQpOyBtID4gMDsgbS0tKQotCi0gICAgICAgICAgICAqKHBTZmJQcmVkaWN0aW9uVXNlZCsrKSA9IDA7Ci0KLSAgICAgICAgRU5ERk9SCi0KLSAgICBFTFNFCi0KLSAgICAgICAgSUYgKGxhc3RfYmFuZCA+IE1BWF9MVF9QUkVEX1NIT1JUX1NGQikKLQotICAgICAgICAgICAgbGFzdF9iYW5kID0gTUFYX0xUX1BSRURfU0hPUlRfU0ZCOwotCi0gICAgICAgIEVORElGCi0KLSAgICAgICAgcHJldl9zdWJibG9jayA9IHBEZWxheVswXTsKLQotICAgICAgICBwV2luUHJlZGljdGlvblVzZWQrKzsKLQotICAgICAgICBwVGVtcFB0ciA9ICZwU2ZiUHJlZGljdGlvblVzZWRbMF07Ci0KLSAgICAgICAgRk9SIChtID0gTlVNX1NIT1JUX1dJTkRPV1M7IG0gPiAwOykKLQotICAgICAgICAgICAgbS0tOwotICAgICAgICAgICAgdGVtcF9yZWcgPSAoSW50KSBnZXRiaXRzKAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBMRU5fTFRQX1NIT1JUX1VTRUQsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBJbnB1dFN0cmVhbSk7Ci0KLSAgICAgICAgICAgICoocFdpblByZWRpY3Rpb25Vc2VkKyspID0gdGVtcF9yZWc7Ci0KLSAgICAgICAgICAgIElGICh0ZW1wX3JlZyAhPSBGQUxTRSkKLSAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAqKHBEZWxheSsrKSA9IHByZXZfc3ViYmxvY2s7Ci0KLSAgICAgICAgICAgICAgICBGT1IgKGsgPSBsYXN0X2JhbmQ7IGsgPiAwOyBrLS0pCi0gICAgICAgICAgICAgICAgewotICAgICAgICAgICAgICAgICAgICAqKHBUZW1wUHRyKyspID0gMTsKLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgYnJlYWs7Ci0gICAgICAgICAgICBFTFNFCi0gICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgcERlbGF5Kys7Ci0gICAgICAgICAgICAgICAgcFRlbXBQdHIgKz0gbGFzdF9iYW5kOwotICAgICAgICAgICAgfQotCi0gICAgICAgIEVOREZPUiAobSA9IE5VTV9TSE9SVF9XSU5ET1dTOyBtID4gMDspCi0KLSAgICAgICAgcHJldl9zdWJibG9jayArPSBMVFBfTEFHX09GRlNFVDsKLQotICAgICAgICBGT1IgKDsgbSA+IDA7IG0tLSkKLQotICAgICAgICAgICAgdGVtcF9yZWcgPSAoSW50KSBnZXRiaXRzICgKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTEVOX0xUUF9TSE9SVF9VU0VELAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwSW5wdXRTdHJlYW0pOwotCi0gICAgICAgICAgICAqKHBXaW5QcmVkaWN0aW9uVXNlZCsrKSA9IHRlbXBfcmVnOwotCi0gICAgICAgICAgICBJRiAodGVtcF9yZWcgIT0gRkFMU0UpCi0KLSAgICAgICAgICAgICAgICB0ZW1wX3JlZyA9IChJbnQpIGdldGJpdHMoCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBMRU5fTFRQX1NIT1JUX0xBR19QUkVTRU5ULAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcElucHV0U3RyZWFtKTsKLSAgICAgICAgICAgICAgICBJRiAodGVtcF9yZWcgIT0gMCkKLQotICAgICAgICAgICAgICAgICAgICB0ZW1wX3JlZyAgPSAoSW50KSBnZXRiaXRzKAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBMRU5fTFRQX1NIT1JUX0xBRywKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcElucHV0U3RyZWFtKTsKLQotICAgICAgICAgICAgICAgICAgICAqKHBEZWxheSsrKSA9IHByZXZfc3ViYmxvY2sgLSB0ZW1wX3JlZzsKLQotICAgICAgICAgICAgICAgIEVMU0UKLQotICAgICAgICAgICAgICAgICAgICAqKHBEZWxheSsrKSA9IHByZXZfc3ViYmxvY2sgLSBMVFBfTEFHX09GRlNFVDsKLQotICAgICAgICAgICAgICAgIEVORElGCi0KLSAgICAgICAgICAgICAgICBGT1IgKGsgPSBsYXN0X2JhbmQ7IGsgPiAwOyBrLS0pCi0gICAgICAgICAgICAgICAgICAgICoocFRlbXBQdHIrKykgPSAxOwotICAgICAgICAgICAgICAgIEVOREZPUgotCi0gICAgICAgICAgICBFTFNFCi0KLSAgICAgICAgICAgICAgICBwRGVsYXkrKzsKLSAgICAgICAgICAgICAgICBwVGVtcFB0ciArPSBsYXN0X2JhbmQ7Ci0KLSAgICAgICAgICAgIEVORElGCi0KLSAgICAgICAgRU5ERk9SICg7IG0gPiAwOyBtLS0pCi0KLSAgICBFTkRJRiAod2luX3R5cGUgIT0gRUlHSFRfU0hPUlRfU0VRVUVOQ0UpCi0KLS0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gayA+IDA7IGstLSkKLSAgICAgICAgewotICAgICAgICAgICAgKihwU2ZiUHJlZGljdGlvblVzZWQrKykgPSAoSW50KSBnZXQxYml0cyhwSW5wdXRTdHJlYW0pOwotICAgICAgICB9Ci0KLSAgICAgICAgLyoKLSAgICAgICAgICogVGhpcyBpcyBub3QgYSBjYWxsIHRvIG1lbXNldCwgYmVjYXVzZQotICAgICAgICAgKiAobWF4X3NmYiAtIGxhc3RfYmFuZCkgc2hvdWxkIHR5cGljYWxseSBiZSBhIHNtYWxsIHZhbHVlLgotICAgICAgICAgKi8KLSAgICAgICAgZm9yIChrID0gKG1heF9zZmIgLSBsYXN0X2JhbmQpOyBrID4gMDsgay0tKQotICAgICAgICB7Ci0gICAgICAgICAgICAqKHBTZmJQcmVkaWN0aW9uVXNlZCsrKSA9IEZBTFNFOwotICAgICAgICB9Ci0gICAgfQotICAgIGVsc2UgLyogKHdpbl90eXBlID09IEVJR0hUX1NIT1JUX1NFUVVFTkNFKSAqLwotICAgIHsKLSAgICAgICAgLyogbGFzdF9iYW5kID0gbWluKE1BWF9MVF9QUkVEX1NIT1JUX1NGQiwgbWF4X3NmYikgKi8KLQotICAgICAgICBpZiAobGFzdF9iYW5kID4gTUFYX0xUX1BSRURfU0hPUlRfU0ZCKQotICAgICAgICB7Ci0gICAgICAgICAgICBsYXN0X2JhbmQgPSBNQVhfTFRfUFJFRF9TSE9SVF9TRkI7Ci0gICAgICAgIH0KLQotICAgICAgICAvKgotICAgICAgICAgKiBUaGUgZm9sbG93aW5nIHR3byBjb2RpbmcgY29uc3RydWN0cyBhcmUgZXF1aXZhbGVudC4uLgotICAgICAgICAgKgotICAgICAgICAgKiAgZmlyc3RfdGltZSA9PSAxCi0gICAgICAgICAqICBmb3IgKHduZF9udW09TlVNX1NIT1JUX1dJTkRPV1M7IHduZF9udW0gPiAwOyB3bmRfbnVtLS0pCi0gICAgICAgICAqICB7Ci0gICAgICAgICAqICAgICBpZiAoY29uZGl0aW9uKQotICAgICAgICAgKiAgICAgewotICAgICAgICAgKiAgICAgICBpZiAoZmlyc3RfdGltZSA9PSAxKQotICAgICAgICAgKiAgICAgICB7Ci0gICAgICAgICAqICAgICAgICAgICBDT0RFIFNFQ1RJT04gQQotICAgICAgICAgKiAgICAgICAgICAgZmlyc3RfdGltZSA9IDA7Ci0gICAgICAgICAqICAgICAgIH0KLSAgICAgICAgICogICAgICAgZWxzZQotICAgICAgICAgKiAgICAgICB7Ci0gICAgICAgICAqICAgICAgICAgICBDT0RFIFNFQ1RJT04gQgotICAgICAgICAgKiAgICAgICB9Ci0gICAgICAgICAqICAgICB9Ci0gICAgICAgICAqICB9Ci0gICAgICAgICAqCi0gICAgICAgICAqIC0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tRVFVSVZBTEVOVCBUTy0tLS0tLS0tLS0tLQotICAgICAgICAgKgotICAgICAgICAgKiAgd25kX251bT1OVU1fU0hPUlRfV0lORE9XUzsKLSAgICAgICAgICoKLSAgICAgICAgICogIGRvCi0gICAgICAgICAqICB7Ci0gICAgICAgICAqICAgICB3bmRfbnVtLS07Ci0gICAgICAgICAqICAgICBpZiAoY29uZGl0aW9uKQotICAgICAgICAgKiAgICAgewotICAgICAgICAgKiAgICAgICAgIENPREUgU0VDVElPTiBBCi0gICAgICAgICAqICAgICAgICAgYnJlYWs7Ci0gICAgICAgICAqICAgICB9Ci0gICAgICAgICAqICB9IHdoaWxlKCB3bmRfbnVtID4gMCkKLSAgICAgICAgICoKLSAgICAgICAgICogIHdoaWxlICh3bmRfbnVtID4gMCkKLSAgICAgICAgICogIHsKLSAgICAgICAgICogICAgIGlmIChjb25kaXRpb24pCi0gICAgICAgICAqICAgICB7Ci0gICAgICAgICAqICAgICAgICAgQ09ERSBTRUNUSU9OIEIKLSAgICAgICAgICogICAgIH0KLSAgICAgICAgICogICAgIHduZF9udW0tLTsKLSAgICAgICAgICogIH0KLSAgICAgICAgICoKLSAgICAgICAgICovCi0KLSAgICAgICAgcHJldl9zdWJibG9jayA9IHBEZWxheVswXTsKLQotICAgICAgICBwVGVtcFB0ciA9ICZwU2ZiUHJlZGljdGlvblVzZWRbMF07Ci0KLSAgICAgICAgd25kX251bSA9IE5VTV9TSE9SVF9XSU5ET1dTOwotCi0gICAgICAgIHByZXZfc3ViYmxvY2tfbm9uemVybyA9IHByZXZfc3ViYmxvY2s7Ci0gICAgICAgIHByZXZfc3ViYmxvY2sgKz0gTFRQX0xBR19PRkZTRVQ7Ci0KLSAgICAgICAgZG8KLSAgICAgICAgewotICAgICAgICAgICAgLyoKLSAgICAgICAgICAgICAqIFBsYWNlIGRlY3JlbWVudCBvZiB3bmRfbnVtIGhlcmUsIHRvIGluc3VyZQotICAgICAgICAgICAgICogdGhhdCB0aGUgZGVjcmVtZW50IG9jY3VycyBiZWZvcmUgdGhlCi0gICAgICAgICAgICAgKiBicmVhayBvdXQgb2YgdGhlIGRvLXdoaWxlIGxvb3AuCi0gICAgICAgICAgICAgKi8KLSAgICAgICAgICAgIHduZF9udW0tLTsKLQotICAgICAgICAgICAgdGVtcF9yZWcgPSAoSW50KSBnZXQxYml0cyhwSW5wdXRTdHJlYW0pOwotCi0gICAgICAgICAgICAqKHBXaW5QcmVkaWN0aW9uVXNlZCsrKSA9IHRlbXBfcmVnOwotCi0gICAgICAgICAgICBpZiAodGVtcF9yZWcgIT0gRkFMU0UpCi0gICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgKihwRGVsYXkrKykgPSBwcmV2X3N1YmJsb2NrX25vbnplcm87Ci0KLSAgICAgICAgICAgICAgICBmb3IgKGsgPSBsYXN0X2JhbmQ7IGsgPiAwOyBrLS0pCi0gICAgICAgICAgICAgICAgewotICAgICAgICAgICAgICAgICAgICAqKHBUZW1wUHRyKyspID0gVFJVRTsKLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgZm9yIChrID0gKG1heF9zZmIgLSBsYXN0X2JhbmQpOyBrID4gMDsgay0tKQotICAgICAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAgICAgKihwVGVtcFB0cisrKSA9IEZBTFNFOwotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICBicmVhazsKLQotICAgICAgICAgICAgfSAvKiBpZihwV2luUHJlZGljdGlvblVzZWQpICovCi0gICAgICAgICAgICBlbHNlCi0gICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgcERlbGF5Kys7Ci0gICAgICAgICAgICAgICAgcFRlbXBQdHIgKz0gbWF4X3NmYjsKLSAgICAgICAgICAgIH0KLQotICAgICAgICB9Ci0gICAgICAgIHdoaWxlICh3bmRfbnVtID4gMCk7Ci0KLSAgICAgICAgLyoKLSAgICAgICAgICogVGhpcyB3aGlsZSBsb29wIHBpY2tzIHVwIHdoZXJlIHRoZSBwcmV2aW91cyBvbmUgbGVmdCBvZmYuCi0gICAgICAgICAqIE5vdGljZSB0aGF0IHRoZSBjb2RlIGZ1bmN0aW9ucyBkaWZmZXJlbnRseSBpbnNpZGUgdGhlIGxvb3AKLSAgICAgICAgICovCi0KLSAgICAgICAgd2hpbGUgKHduZF9udW0gPiAwKQotICAgICAgICB7Ci0gICAgICAgICAgICB0ZW1wX3JlZyA9IChJbnQpIGdldDFiaXRzKHBJbnB1dFN0cmVhbSk7Ci0KLSAgICAgICAgICAgICoocFdpblByZWRpY3Rpb25Vc2VkKyspID0gdGVtcF9yZWc7Ci0KLSAgICAgICAgICAgIGlmICh0ZW1wX3JlZyAhPSBGQUxTRSkKLSAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICB0ZW1wX3JlZyA9IChJbnQpIGdldDFiaXRzKHBJbnB1dFN0cmVhbSk7Ci0gICAgICAgICAgICAgICAgaWYgKHRlbXBfcmVnICE9IDApCi0gICAgICAgICAgICAgICAgewotICAgICAgICAgICAgICAgICAgICB0ZW1wX3JlZyAgPSAoSW50KSBnZXQ5X25fbGVzc2JpdHMoCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBMRU5fTFRQX1NIT1JUX0xBRywKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBJbnB1dFN0cmVhbSk7Ci0KLSAgICAgICAgICAgICAgICAgICAgKihwRGVsYXkrKykgPSBwcmV2X3N1YmJsb2NrIC0gdGVtcF9yZWc7Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgIGVsc2UKLSAgICAgICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgICAgICoocERlbGF5KyspID0gcHJldl9zdWJibG9ja19ub256ZXJvOwotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICBmb3IgKGsgPSBsYXN0X2JhbmQ7IGsgPiAwOyBrLS0pCi0gICAgICAgICAgICAgICAgewotICAgICAgICAgICAgICAgICAgICAqKHBUZW1wUHRyKyspID0gVFJVRTsKLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgZm9yIChrID0gKG1heF9zZmIgLSBsYXN0X2JhbmQpOyBrID4gMDsgay0tKQotICAgICAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAgICAgKihwVGVtcFB0cisrKSA9IEZBTFNFOwotICAgICAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgfSAvKiBpZiAodGVtcF9yZWcpICovCi0gICAgICAgICAgICBlbHNlCi0gICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgcERlbGF5Kys7Ci0gICAgICAgICAgICAgICAgcFRlbXBQdHIgKz0gbWF4X3NmYjsKLSAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgd25kX251bS0tOwotCi0gICAgICAgIH0gLyogd2hpbGUod25kX251bSkgKi8KLQotICAgIH0gLyogZWxzZSAod2luX3R5cGUgPT0gRUlHSFRfU0hPUlRfU0VRVUVOQ0UpICovCi0KLX0gLyogbHRfZGVjb2RlICovCmRpZmYgLS1naXQgYS9tZWRpYS9saWJzdGFnZWZyaWdodC9jb2RlY3MvYWFjZGVjL2x0X2RlY29kZS5oIGIvbWV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OKShuKzEvOCkpCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIE4vNC0gcG9pbnQgRkZUCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwKLSAgICAgICAgICAgICAgICAgICAgUG9zdC1yb3RhdGlvbiBieSBleHAoaigycGkvTikoaysxLzgpKQotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC0tLS0tLS0tLS0tLS0gRENUCi0KLSAgICBCeSBjb25zaWRlcmluZyB0aGUgTi8yIG92ZXJsYXAsIGEgcmVsYXRpb24gYmV0d2VlbiBzdWNjZXNzaXZlIGlucHV0IGJsb2NrcwotICAgIGlzIGZvdW5kOgotCi0gICAgICAgIHggICAoMm4pID0geCAoTi8yICsgMm4pCi0gICAgICAgICBtKzEgICAgICAgIG0KLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLQotIFJFUVVJUkVNRU5UUwotCi0gICAgVGhpcyBmdW5jdGlvbiBzaG91bGQgcHJvdmlkZSBhIGZpeGVkIHBvaW50IE1EQ1Qgd2l0aCBhbiBhdmVyYWdlCi0gICAgcXVhbnRpemF0aW9uIGVycm9yIGxlc3MgdGhhbiAxICUuCi0KLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLQotIFJFRkVSRU5DRVMKLQotIC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W1wX2ltOwotCi0gICAgSW50MzIgICB0ZW1wX3JlXzMyOwotICAgIEludDMyICAgdGVtcF9pbV8zMjsKLQotICAgIEludDE2ICAgICBjb3NfbjsKLSAgICBJbnQxNiAgICAgc2luX247Ci0gICAgSW50MzIgICAgIGV4cF9qdzsKLSAgICBJbnQgICAgIHNoaWZ0OwotCi0KLSAgICBjb25zdCBJbnQzMiAqcF9yb3RhdGU7Ci0KLQotICAgIEludDMyICAgKnBfZGF0YV8xOwotICAgIEludDMyICAgKnBfZGF0YV8yOwotICAgIEludDMyICAgKnBfZGF0YV8zOwotICAgIEludDMyICAgKnBfZGF0YV80OwotCi0gICAgSW50MzIgKnBfUV9GRlRhcnJheTsKLQotICAgIEludDMyICAgbWF4MTsKLQotICAgIEludCBrOwotICAgIEludCBuXzIgICA9IG4gPj4gMTsKLSAgICBJbnQgbl80ICAgPSBuID4+IDI7Ci0gICAgSW50IG5fOCAgID0gbiA+PiAzOwotICAgIEludCBuXzNfNCA9IDMgKiBuXzQ7Ci0KLSAgICBzd2l0Y2ggKG4pCi0gICAgewotICAgICAgICBjYXNlIFNIT1JUX1dJTkRPV19UWVBFOgotICAgICAgICAgICAgcF9yb3RhdGUgPSAoSW50MzIgKilleHBfcm90YXRpb25fTl8yNTY7Ci0gICAgICAgICAgICBicmVhazsKLQotICAgICAgICBjYXNlIExPTkdfV0lORE9XX1RZUEU6Ci0gICAgICAgICAgICBwX3JvdGF0ZSA9IChJbnQzMiAqKWV4cF9yb3RhdGlvbl9OXzIwNDg7Ci0gICAgICAgICAgICBicmVhazsKLQotICAgICAgICBkZWZhdWx0OgotICAgICAgICAgICAgLyoKLSAgICAgICAgICAgICAqICBUaGVyZSBpcyBubyBkZWZpbmVkIGJlaGF2aW9yIGZvciBhIG5vbiBzdXBwb3J0ZWQgZnJhbWUKLSAgICAgICAgICAgICAqICBzaXplLiBCeSByZXR1cm5pbmcgYSBmaXhlZCBzY2FsaW5nIGZhY3RvciwgdGhlIGlucHV0IHdpbGwKLSAgICAgICAgICAgICAqICBzY2FsZWQgZG93biBhbmQgdGhpcyB3aWxsIGJlIGhlYXJkIGFzIGEgbG93IGxldmVsIG5vaXNlCi0gICAgICAgICAgICAgKi8KLSAgICAgICAgICAgIHJldHVybihFUlJPUl9JTl9GUkFNRV9TSVpFKTsKLQotICAgIH0KLQotICAgIC8qLS0tIFJlb3JkZXJpbmcgYW5kIFByZS1yb3RhdGlvbiBieSBleHAoLWooMnBpL04pKHIrMS84KSkgICAqLwotICAgIHBfZGF0YV8xID0gJmRhdGFfcXVhbnRbbl8zXzRdOwotICAgIHBfZGF0YV8yID0gJmRhdGFfcXVhbnRbbl8zXzQgLSAxXTsKLSAgICBwX2RhdGFfMyA9ICZkYXRhX3F1YW50W25fNF07Ci0gICAgcF9kYXRhXzQgPSAmZGF0YV9xdWFudFtuXzQgLSAxXTsKLQotICAgIHBfUV9GRlRhcnJheSA9IFFfRkZUYXJyYXk7Ci0KLSAgICBtYXgxID0gMDsKLQotICAgIGZvciAoayA9IG5fODsgayA+IDA7IGstLSkKLSAgICB7Ci0gICAgICAgIC8qCi0gICAgICAgICAqICBzY2FsZSBkb3duIHRvIGVuc3VyZSBudW1iZXJzIGFyZSBRMTUKLSAgICAgICAgICogIHRlbXBfcmUgYW5kIHRlbXBfaW0gYXJlIDMyLWJpdCBidXQKLSAgICAgICAgICogIG9ubHkgdGhlIGxvd2VyIDE2IGJpdHMgYXJlIHVzZWQKLSAgICAgICAgICovCi0KLSAgICAgICAgdGVtcF9yZSA9ICgqKHBfZGF0YV8xKyspICsgKihwX2RhdGFfMi0tKSkgPj4gMTsKLSAgICAgICAgdGVtcF9pbSA9ICgqKHBfZGF0YV8zKyspIC0gKihwX2RhdGFfNC0tKSkgPj4gMTsKLQotCi0gICAgICAgIC8qCi0gICAgICAgICAqIGNvc19uICsgaipzaW5fbiA9PSBleHAoaigycGkvTikoaysxLzgpKQotICAgICAgICAgKi8KLQotICAgICAgICBleHBfancgPSAqcF9yb3RhdGUrK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fZGF0YV8xLS0pICsgKihwX2RhdGFfMysrKSkgPj4gMTsKLQotICAgICAgICBwX2RhdGFfMi0tOwotICAgICAgICBwX2RhdGFfMS0tOwotICAgICAgICBwX2RhdGFfNCsrOwotICAgICAgICBwX2RhdGFfMysrOwotCi0gICAgICAgIC8qCi0gICAgICAgICAqIGNvc19uICsgaipzaW5fbiA9PSBleHAoaigycGkvTikoaysxLzgpKQotICAgICAgICAgKi8KLQotICAgICAgICBleHBfancgPSAqcF9yb3RhdGUrKzsKLQotICAgICAgICBjb3NfbiA9IChJbnQxNikoZXhwX2p3ID4+IDE2KTsKLSAgICAgICAgc2luX24gPSAoSW50MTYpKGV4cF9qdyAmIDB4RkZGRik7Ci0KLSAgICAgICAgdGVtcF9yZV8zMiA9IHRlbXBfcmUgKiBjb3NfbiArIHRlbXBfaW0gKiBzaW5fbjsKLSAgICAgICAgdGVtcF9pbV8zMiA9IHRlbXBfaW0gKiBjb3NfbiAtIHRlbXBfcmUgKiBzaW5fbjsKLQotICAgICAgICAqKHBfUV9GRlRhcnJheSsrKSA9IHRlbXBfcmVfMzI7Ci0gICAgICAgICoocF9RX0ZGVGFycmF5KyspID0gdGVtcF9pbV8zMjsKLSAgICAgICAgbWF4MSAgICAgICAgIHw9ICh0ZW1wX3JlXzMyID4+IDMxKSBeIHRlbXBfcmVfMzI7Ci0gICAgICAgIG1heDEgICAgICAgICB8PSAodGVtcF9pbV8zMiA+PiAzMSkgXiB0ZW1wX2ltXzMyOwotCi0KLSAgICB9IC8qIGZvcihrKSAqLwotCi0KLQotICAgIHBfUV9GRlRhcnJheSA9IFFfRkZUYXJyYXk7Ci0KLSAgICBpZiAobWF4MSkKLSAgICB7Ci0KLSAgICAgICAgaWYgKG4gIT0gU0hPUlRfV0lORE9XX1RZUEUpCi0gICAgICAgIHsKLQotICAgICAgICAgICAgc2hpZnQgPSBtaXhfcmFkaXhfZmZ0KAotICAgICAgICAgICAgICAgICAgICAgICAgUV9GRlRhcnJheSwKLSAgICAgICAgICAgICAgICAgICAgICAgICZtYXgxKTsKLQotICAgICAgICAgICAgc2hpZnQgKz0gZndkX2xvbmdfY29tcGxleF9yb3QoCi0gICAgICAgICAgICAgICAgICAgICAgICAgUV9GRlRhcnJheSwKLSAgICAgICAgICAgICAgICAgICAgICAgICBkYXRhX3F1YW50LAotICAgICAgICAgICAgICAgICAgICAgICAgIG1heDEpOwotCi0gICAgICAgIH0KLSAgICAgICAgZWxzZSAgICAgICAgLyogIG5fNCBpcyA2NCAqLwotICAgICAgICB7Ci0KLSAgICAgICAgICAgIHNoaWZ0ID0gZmZ0X3J4NF9zaG9ydCgKLSAgICAgICAgICAgICAgICAgICAgICAgIFFfRkZUYXJyYXksCi0gICAgICAgICAgICAgICAgICAgICAgICAmbWF4MSk7Ci0KLSAgICAgICAgICAgIHNoaWZ0ICs9IGZ3ZF9zaG9ydF9jb21wbGV4X3JvdCgKLSAgICAgICAgICAgICAgICAgICAgICAgICBRX0ZGVGFycmF5LAotICAgICAgICAgICAgICAgICAgICAgICAgIGRhdGFfcXVhbnQsCi0gICAgICAgICAgICAgICAgICAgICAgICAgbWF4MSk7Ci0gICAgICAgIH0KLQotICAgIH0KLSAgICBlbHNlCi0gICAgewotICAgICAgICBzaGlmdCA9IC0zMTsKLSAgICB9Ci0KLSAgICAvKgotICAgICAqICByZXR1cm5zIHNoaWZ0IGludHJvZHVjZWQgYnkgRkZUIGFuZCBtZGN0X2Z4cCwgMTIgYWNjb3VudHMgZm9yCi0gICAgICogIHJlZ3VsYXIgZG93bnNoaWZ0ICgxNCkgYW5kIE1EQ1Qgc2NhbGUgZmFjdG9yICgtMikKLSAgICAgKiAgbnVtYmVyIGFyZSByZXR1cm5lZCBhcyAxNiBiaXRzCi0gICAgICovCi0gICAgcmV0dXJuICgxMiAtIHNoaWZ0KTsKLQotfSAvKiBtZGN0X2Z4cCAqLwotCmRpZmYgLS1naXQgYS9tZWRpYS9saWJzdGFnZWZyaWdodC9jb2RlY3MvYWFjZGVjL21kY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WZmMiwgZXhwX2p3KSA+PiAzOwotICAgICAgICAqcERhdGFfNCAgID0gIGNtcGx4X211bDMyX2J5XzE2KGRpZmYyLCAtZGlmZjEsIGV4cF9qdykgPj4gMzsKLQotCi0gICAgICAgIHRlbXAxICAgICAgPSAoKnBEYXRhXzEpOwotICAgICAgICBwRGF0YV8yICAgID0gcERhdGFfMSArIEZGVF9SWDRfTEVOR1RIX0ZPUl9MT05HOwotICAgICAgICB0ZW1wMiAgICAgID0gKCpwRGF0YV8yKyspOwotICAgICAgICB0ZW1wNCAgICAgID0gKCpwRGF0YV8yKTsKLQotICAgICAgICAqcERhdGFfMSsrID0gKHRlbXAxICArIHRlbXAyKSA+PiBleHA7Ci0KLSAgICAgICAgdGVtcDMgICAgICA9ICgqcERhdGFfMSk7Ci0gICAgICAgIGRpZmYxICAgICAgPSAodGVtcDEgIC0gdGVtcDIpID4+IChleHAgLSA0KTsKLQotICAgICAgICBkaWZmMiAgICAgID0gKHRlbXAzICAtIHRlbXA0KSA+PiAoZXhwIC0gNCk7Ci0gICAgICAgICpwRGF0YV8xKysgPSAodGVtcDMgICsgdGVtcDQpID4+IGV4cDsKLQotICAgICAgICAqcERhdGFfMi0tID0gIGNtcGx4X211bDMyX2J5XzE2KGRpZmYyLCAtZGlmZjEsIGV4cF9qdykgPj4gMzsKLSAgICAgICAgKnBEYXRhXzIgICA9ICBjbXBseF9tdWwzMl9ieV8xNihkaWZmMSwgIGRpZmYyLCBleHBfancpID4+IDM7Ci0KLSAgICAgICAgdGVtcDEgICAgICA9ICgqcERhdGFfMyk7Ci0gICAgICAgIHBEYXRhXzQgICAgPSBwRGF0YV8zICsgRkZUX1JYNF9MRU5HVEhfRk9SX0xPTkc7Ci0gICAgICAgIHRlbXAyICAgICAgPSAoKnBEYXRhXzQrKyk7Ci0KLSAgICB9LyogZm9yIGkgICovCi0KLQotICAgIGZmdF9yeDRfbG9uZygKLSAgICAgICAgRGF0YSwKLSAgICAgICAgJm1heDEpOwotCi0KLSA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b3VwICAgICAgICA9IE51bWJlciBvZiB3aW5kb3dzIGluIHRoZSBjdXJyZW50IGdyb3VwLgotICAgICAgICAgICAgICAgICAgICAgICAgICAgW2NvbnN0IEludF0KLQotICAgIGNvZWZfcGVyX3dpbiAgICAgICAgID0gTnVtYmVyIG9mIGNvZWZmaWNpZW50cyBwZXIgd2luZG93LgotICAgICAgICAgICAgICAgICAgICAgICAgICAgW2NvbnN0IEludF0KLQotICAgIG51bV9iYW5kcyAgICAgICAgICAgID0gTnVtYmVyIG9mIHNjYWxlZmFjdG9yIGJhbmRzLgotICAgICAgICAgICAgICAgICAgICAgICAgICAgW2NvbnN0IEludF0KLQotICAgIGJhbmRfbGVuZ3RoICAgICAgICAgID0gTnVtYmVyIG9mIGNvZWZmaWNpZW50cyBwZXIgc2NhbGVmYWN0b3IgYmFuZC4KLSAgICAgICAgICAgICAgICAgICAgICAgICAgIFtjb25zdCBJbnRdCi0KLSAgICBwRmlyc3RfV2luZG93X0NvZWZzTCA9IEFycmF5IGNvbnRhaW5pbmcgdGhlIHNwZWN0cmFsIGNvZWZmaWNpZW50cyBmb3IKLSAgICAgICAgICAgICAgICAgICAgICAgICAgIHRoZSBsZWZ0IGNoYW5uZWwuCi0gICAgICAgICAgICAgICAgICAgICAgICAgICBbSW50MzIgKiwgbGVuZ3RoIExOXQotICAgIHBGaXJzdF9XaW5kb3dfQ29lZnNSID0gQXJyYXkgY29udGFpbmluZyB0aGUgc3BlY3RyYWwgY29lZmZpY2llbnRzIGZvcgotICAgICAgICAgICAgICAgICAgICAgICAgICAgdGhlIHJpZ2h0IGNoYW5uZWwuCi0gICAgICAgICAgICAgICAgICAgICAgICAgICBbSW50MzIgKiwgbGVuZ3RoIExOXQotICAgIHFfZm9ybWF0TGVmdCAgICAgICAgID0gQXJyYXkgY29udGFpbmluZyB0aGUgcS1mb3JtYXQgdXNlZCB0byBlbmNvZGUgZWFjaAotICAgICAgICAgICAgICAgICAgICAgICAgICAgc2NhbGVmYWN0b3IgY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gcS1mb3JtYXQgKi8KLSAgICAgICAgICAgIGlmICh0ZW1wSW50ID4gMCkKLSAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAvKgotICAgICAgICAgICAgICAgICAqIHNoaWZ0X2xlZnRfY2hhbiBhbmQgc2hpZnRfcmlnaHRfY2hhbiBlYWNoIGhhdmUgYW4gb2Zmc2V0Ci0gICAgICAgICAgICAgICAgICogb2YgMS4gIEV2ZW4gaWYgdGhlIGxlZnQgYW5kIHJpZ2h0IGNoYW5uZWwgc2hhcmUgdGhlIHNhbWUKLSAgICAgICAgICAgICAgICAgKiBxLWZvcm1hdCwgd2UgbXVzdCBzaGlmdCBlYWNoIGJ5IDEgdG8gZ3VhcmQgYWdhaW5zdAotICAgICAgICAgICAgICAgICAqIG92ZXJmbG93LgotICAgICAgICAgICAgICAgICAqLwotICAgICAgICAgICAgICAgIEludCBzaGlmdF9sZWZ0X2NoYW4gID0gMSArIHRlbXBJbnQ7Ci0KLSAgICAgICAgICAgICAgICAvKgotICAgICAgICAgICAgICAgICAqIEZvbGxvd2luZyBjb2RlIGxpbmUgaXMgZXF1aXZhbGVudCB0by4uLgotICAgICAgICAgICAgICAgICAqIHFfZm9ybWF0TGVmdCAgPSBxX2Zvcm1hdFJpZ2h0IC0gMTsKLSAgICAgICAgICAgICAgICAgKiBxX2Zvcm1hdFJpZ2h0ID0gcV9mb3JtYXRSaWdodCAtIDE7Ci0gICAgICAgICAgICAgICAgICovCi0gICAgICAgICAgICAgICAgcV9mb3JtYXRMZWZ0W3N0YXJ0X2luZHhdID0gLS0ocV9mb3JtYXRSaWdodFtzdGFydF9pbmR4XSk7Ci0KLQotICAgICAgICAgICAgICAgIC8qCi0gICAgICAgICAgICAgICAgICogIGJhbmRfbGVuZ3RoIGlzIGFsd2F5cyBhbiBldmVuIG51bWJlciAoY2hlY2sgdGFibGVzIGluIHBnLjY2IElTMCAxNDQ5Ni0zKQotICAgICAgICAgICAgICAgICAqLwotCi0gICAgICAgICAgICAgICAgSW50MzIgdGVtcF9sZWZ0ICA9ICoocENvZWZMKSA+PiBzaGlmdF9sZWZ0X2NoYW47Ci0gICAgICAgICAgICAgICAgSW50MzIgdGVtcF9yaWdodCA9ICoocENvZWZSKSA+PiAxOwotCi0KLQotICAgICAgICAgICAgICAgIGZvciAoSW50IGkgPSBiYW5kX2xlbmd0aDsgaSAhPSAwOyBpLS0pCi0gICAgICAgICAgICAgICAgewotICAgICAgICAgICAgICAgICAgICAqKHBDb2VmTCsrKSA9IHRlbXBfbGVmdCArIHRlbXBfcmlnaHQ7Ci0gICAgICAgICAgICAgICAgICAgICoocENvZWZSKyspID0gdGVtcF9sZWZ0IC0gdGVtcF9yaWdodDsKLSAgICAgICAgICAgICAgICAgICAgdGVtcF9sZWZ0ICA9ICoocENvZWZMKSA+PiBzaGlmdF9sZWZ0X2NoYW47Ci0gICAgICAgICAgICAgICAgICAgIHRlbXBfcmlnaHQgPSAqKHBDb2VmUikgPj4gMTsKLQotICAgICAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgfQotICAgICAgICAgICAgZWxzZQotICAgICAgICAgICAgewotICAgICAgICAgICAgICAgIC8qCi0gICAgICAgICAgICAgICAgICogc2hpZnRfbGVmdF9jaGFuIGFuZCBzaGlmdF9yaWdodF9jaGFuIGVhY2ggaGF2ZSBhbiBvZmZzZXQKLSAgICAgICAgICAgICAgICAgKiBvZiAxLiAgRXZlbiBpZiB0aGUgbGVmdCBhbmQgcmlnaHQgY2hhbm5lbCBzaGFyZSB0aGUgc2FtZQotICAgICAgICAgICAgICAgICAqIHEtZm9ybWF0LCB3ZSBtdXN0IHNoaWZ0IGVhY2ggYnkgMSB0byBndWFyZCBhZ2FpbnN0Ci0gICAgICAgICAgICAgICAgICogb3ZlcmZsb3cuCi0gICAgICAgICAgICAgICAgICovCi0gICAgICAgICAgICAgICAgSW50IHNoaWZ0X3JpZ2h0X2NoYW4gPSAxIC0gdGVtcEludDsKLQotICAgICAgICAgICAgICAgIC8qCi0gICAgICAgICAgICAgICAgICogRm9sbG93aW5nIGNvZGUgbGluZSBpcyBlcXVpdmFsZW50IHRvLi4uCi0gICAgICAgICAgICAgICAgICogcV9mb3JtYXRSaWdodCA9IHFfZm9ybWF0TGVmdCAtIDE7Ci0gICAgICAgICAgICAgICAgICogcV9mb3JtYXRMZWZ0ICA9IHFfZm9ybWF0TGVmdCAtIDE7Ci0gICAgICAgICAgICAgICAgICovCi0gICAgICAgICAgICAgICAgcV9mb3JtYXRSaWdodFtzdGFydF9pbmR4XSA9IC0tKHFfZm9ybWF0TGVmdFtzdGFydF9pbmR4XSk7Ci0KLSAgICAgICAgICAgICAgICAvKgotICAgICAgICAgICAgICAgICAqICBiYW5kX2xlbmd0aCBpcyBhbHdheXMgYW4gZXZlbiBudW1iZXIgKGNoZWNrIHRhYmxlcyBpbiBwZy42NiBJUzAgMTQ0OTYtMykKLSAgICAgICAgICAgICAgICAgKi8KLQotICAgICAgICAgICAgICAgIEludDMyIHRlbXBfbGVmdCAgPSAqKHBDb2VmTCkgPj4gMTsKLSAgICAgICAgICAgICAgICBJbnQzMiB0ZW1wX3JpZ2h0ID0gKihwQ29lZlIpID4+IHNoaWZ0X3JpZ2h0X2NoYW47Ci0KLSAgICAgICAgICAgICAgICBmb3IgKEludCBpID0gYmFuZF9sZW5ndGg7IGkgIT0gMDsgaS0tKQotICAgICAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAgICAgKihwQ29lZkwrKykgPSB0ZW1wX2xlZnQgKyB0ZW1wX3JpZ2h0OwotICAgICAgICAgICAgICAgICAgICAqKHBDb2VmUisrKSA9IHRlbXBfbGVmdCAtIHRlbXBfcmlnaHQ7Ci0KLSAgICAgICAgICAgICAgICAgICAgdGVtcF9sZWZ0ICA9ICoocENvZWZMKSA+PiAxOwotICAgICAgICAgICAgICAgICAgICB0ZW1wX3JpZ2h0ID0gKihwQ29lZlIpID4+IHNoaWZ0X3JpZ2h0X2NoYW47Ci0KLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICB9Ci0KLSAgICAgICAgfQotICAgICAgICBlbHNlCi0gICAgICAgIHsKLSAgICAgICAgICAgIC8qCi0gICAgICAgICAgICAgKiAgTm90aGluZyBvbiByaWdodCBjaGFubmVsLCBqdXN0IGNvcHkgbGVmdCBpbnRvIHJpZ2h0Ci0gICAgICAgICAgICAgKi8KLSAgICAgICAgICAgIHFfZm9ybWF0UmlnaHRbc3RhcnRfaW5keF0gPSAocV9mb3JtYXRMZWZ0W3N0YXJ0X2luZHhdKTsKLQotICAgICAgICAgICAgcHZfbWVtY3B5KHBDb2VmUiwgcENvZWZMLCBiYW5kX2xlbmd0aCpzaXplb2YoKnBDb2VmUikpOwotICAgICAgICAgICAgcENvZWZSICs9IGJhbmRfbGVuZ3RoOwotICAgICAgICAgICAgcENvZWZMICs9IGJhbmRfbGVuZ3RoOwotICAgICAgICB9Ci0KLSAgICAgICAgLyoKLSAgICAgICAgICogSW5jcmVtZW50IHRoZSB3aW5kb3cgcG9pbnRlcnMgc28gdGhleSBwb2ludAotICAgICAgICAgKiB0byB0aGUgbmV4dCB3aW5kb3cgaW4gdGhlIGdyb3VwCi0gICAgICAgICAqLwotICAgICAgICBwQ29lZkwgKz0gbmV4dFdpblB0clVwZGF0ZTsKLSAgICAgICAgcENvZWZSICs9IG5leHRXaW5QdHJVcGRhdGU7Ci0KLSAgICAgICAgc3RhcnRfaW5keCArPSBudW1fYmFuZHM7Ci0KLSAgICB9IC8qIGZvciAod2luX2luZHgpICovCi0KLSAgICByZXR1cm47Ci0KLX0gLyogTVNfc3ludCAqLwpkaWZmIC0tZ2l0IGEvbWVkaWEvbGlic3RhZ2VmcmlnaHQvY29kZWNzL2FhY2RlYy9tc19zeW50LmggYi9tZWRpYS9saWJzdGFnZWZyaWdodC9jb2RlY3MvYWFjZGVjL21zX3N5bnQuaApkZWxldGVkIGZpbGUgbW9kZSAxMDA2NDQKaW5kZXggYTAwZTZlMi4uMDAwMDAwMAotLS0gYS9tZWRpYS9saWJz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lbCBmb3IgdXNlIG9uIHRoZSByaWdodC4KLSAgICAgICAgICAgICAgICAgICAgW2NvbnN0IEludF0KLQotICAgIGNvZWZfcGVyX3dpbiA9ICBOdW1iZXIgb2YgY29lZmZpY2llbnRzIHBlciB3aW5kb3cuCi0gICAgICAgICAgICAgICAgICAgICgxMjggZm9yIHNob3J0LCAxMDI0IGZvciBsb25nKQotICAgICAgICAgICAgICAgICAgICBbY29uc3QgSW50XQotCi0gICAgc2ZiX3Blcl93aW4gID0gIE51bWJlciBvZiBzY2FsZWZhY3RvcnMgcGVyIHdpbmRvdy4KLSAgICAgICAgICAgICAgICAgICAgW2NvbnN0IEludF0KLQotICAgIHdpbnNfaW5fZ3JvdXAgPSBUaGUgbnVtYmVyIG9mIHdpbmRvd3MgaW4gdGhlIGdyb3VwIGJlaW5nIGRlY29kZWQuCi0gICAgICAgICAgICAgICAgICAgIFtjb25zdCBJbnRdCi0KLSAgICBiYW5kX2xlbmd0aCAgPSAgVGhlIGxlbmd0aCBvZiB0aGUgc2NhbGVmYWN0b3IgYmFuZCBiZWluZyBkZWNvZGVkLgotICAgICAgICAgICAgICAgICAgICBbY29uc3QgSW50XQotCi0gICAgc2ZiX3ByZWRpY3Rpb25fdXNlZCA9ICBGbGFnIHRoYXQgZGVub3RlcyB0aGUgYWN0aXZhdGlvbiBvZiBsb25nIHRlcm0KLSAgICAgICAgICAgICAgICAgICAgICAgICAgIHByZWRpY3Rpb24gb24gYSBwZXItc2NhbGVmYWN0b3IgYmFuZCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgIG5vbi1ncm91cGVkIGJhc2lzLgotICAgICAgICAgICAgICAgICAgICAgICAgICAgW2NvbnN0IEludCAqLCBsZW5ndGggTUFYX1NGQl0KLQotICAgIHFfZm9ybWF0TGVmdCA9IFRoZSBRLWZvcm1hdCBmb3IgdGhlIGxlZnQgY2hhbm5lbCdzIGZpeGVkLXBvaW50IHNwZWN0cmFsCi0gICAgICAgICAgICAgICAgICAgY29lZmZ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bmQgKyAxOwotCi0gICAgICAgICAgICBjb2RlYm9vayA9ICoocENvZGVib29rTWFwKTsKLSAgICAgICAgICAgIHBDb2RlYm9va01hcCA9IHBDb2RlYm9va01hcCArIDE7Ci0KLSAgICAgICAgICAgIG1hc2tfZW5hYmxlZCA9ICoocE1hc2tNYXApOwotICAgICAgICAgICAgcE1hc2tNYXAgPSBwTWFza01hcCArIDE7Ci0KLSAgICAgICAgICAgIGJhbmRfbGVuZ3RoID0gYmFuZF9zdG9wIC0gYmFuZF9zdGFydDsKLQotICAgICAgICAgICAgSUYgKGNvZGVib29rID09IE5PSVNFX0hDQikKLQotICAgICAgICAgICAgICAgIHNmYl9wcmVkaWN0aW9uX3VzZWRbdG90X3NmYl0gJj0gbHRwX2RhdGFfcHJlc2VudDsKLQotICAgICAgICAgICAgICAgIElGIChzZmJfcHJlZGljdGlvbl91c2VkW3RvdF9zZmJdID09IEZBTFNFKQotCi0gICAgICAgICAgICAgICAgICAgIG1hc2tfZW5hYmxlZCA9IG1hc2tfZW5hYmxlZCBBTkQgaGFzbWFzazsKLQotICAgICAgICAgICAgICAgICAgICBJRiAobWFza19lbmFibGVkID09IEZBTFNFKQotCi0gICAgICAgICAgICAgICAgICAgICAgICBwV2luZG93X0NvZWZSID0gJihwQ29lZlJpZ2h0W2JhbmRfc3RhcnRdKTsKLQotICAgICAgICAgICAgICAgICAgICAgICAgc3RhcnRfaW5keCA9IHRvdF9zZmI7Ci0KLSAgICAgICAgICAgICAgICAgICAgICAgIEZPUiAod2luX2luZHggPSB3aW5zX2luX2dyb3VwOwotICAgICAgICAgICAgICAgICAgICAgICAgICAgICB3aW5faW5keCA+IDA7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgIHdpbl9pbmR4LS0pCi0KLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBDQUxMCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgcV9mb3JtYXRSaWdodFtzdGFydF9pbmR4XSA9Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBnZW5fcmFuZF92ZWN0b3IoCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcFdpbmRvd19Db2VmUiwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBiYW5kX2xlbmd0aCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwQ3VycmVudFNlZWQsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKihwRmFjdG9yc1JpZ2h0KSk7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgTU9ESUZZSU5HCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBDb2VmUmlnaHRbYmFuZF9zdGFydF0KLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBSRVRVUk5JTkcKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcV9mb3JtYXRSaWdodFtzdGFydF9pbmR4XQotCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgcFdpbmRvd19Db2VmUiArPSBjb2VmX3Blcl93aW47Ci0KLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBzdGFydF9pbmR4ID0gc3RhcnRfaW5keCArIHNmYl9wZXJfd2luOwotCi0gICAgICAgICAgICAgICAgICAgICAgICBFTkRGT1IKLQotICAgICAgICAgICAgICAgICAgICBFTFNFCi0gICAgICAgICAgICAgICAgICAgICAgICBDQUxMCi0gICAgICAgICAgICAgICAgICAgICAgICBwbnNfY29ycigKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKCoocEZhY3RvcnNSaWdodCkgLQotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKihwRmFjdG9yc0xlZnQpICksCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvZWZfcGVyX3dpbiwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2ZiX3Blcl93aW4sCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgIHdpbnNfaW5fZ3JvdXAsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJhbmRfbGVuZ3RoLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICBxX2Zvcm1hdExlZnRbdG90X3NmYl0sCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgJihxX2Zvcm1hdFJpZ2h0W3RvdF9zZmJdKSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAmKHBDb2VmTGVmdFtiYW5kX3N0YXJ0XSksCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgJihwQ29lZlJpZ2h0W2JhbmRfc3RhcnRdKSk7Ci0KLSAgICAgICAgICAgICAgICAgICAgICAgIE1PRElGWUlORwotICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBDb2VmUmlnaHR0W2JhbmRfc3RhcnRdCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgcV9mb3JtYXRSaWdodFt0b3Rfc2ZiXQotICAgICAgICAgICAgICAgICAgICAgICAgUkVUVVJOSU5HCi0gICAgICAgICAgICAgICAgTk9ORQotICAgICAgICAgICAgICAgICAgICBFTkRJRgotCi0gICAgICAgICAgICAgICAgRU5ESUYKLQotICAgICAgICAgICAgRUxTRSBJRiAoY29kZWJvb2sgPj0gSU5URU5TSVRZX0hDQjIpCi0KLSAgICAgICAgICAgICAgICBtYXNrX2VuYWJsZWQgPSBtYXNrX2VuYWJsZWQgQU5EIGhhc21hc2s7Ci0KLSAgICAgICAgICAgICAgICBDQUxMCi0gICAgICAgICAgICAgICAgICAgIGludGVuc2l0eV9yaWdodCgKLSAgICAgICAgICAgICAgICAgICAgICAgICoocEZhY3RvcnNSaWdodCksCi0gICAgICAgICAgICAgICAgICAgICAgICBjb2VmX3Blcl93aW4sCi0gICAgICAgICAgICAgICAgICAgICAgICBzZmJfcGVyX3dpbiwKLSAgICAgICAgICAgICAgICAgICAgICAgIHdpbnNfaW5fZ3JvdXAsCi0gICAgICAgICAgICAgICAgICAgICAgICBiYW5kX2xlbmd0aCwKLSAgICAgICAgICAgICAgICAgICAgICAgIGNvZGVib29rLAotICAgICAgICAgICAgICAgICAgICAgICAgbWFza19lbmFibGVkLAotICAgICAgICAgICAgICAgICAgICAgICAmKHFfZm9ybWF0TGVmdFt0b3Rfc2ZiXSksCi0gICAgICAgICAgICAgICAgICAgICAgICYocV9mb3JtYXRSaWdodFt0b3Rfc2ZiXSksCi0gICAgICAgICAgICAgICAgICAgICAgICYocENvZWZMZWZ0W2JhbmRfc3RhcnRdKSwKLSAgICAgICAgICAgICAgICAgICAgICAgJihwQ29lZlJpZ2h0W2JhbmRfc3RhcnRdKSk7Ci0KLSAgICAgICAgICAgICAgICBNT0RJRllJTkcKLSAgICAgICAgICAgICAgICAgICAgcENvZWZSaWdodHRbYmFuZF9zdGFydF0KLSAgICAgICAgICAgICAgICAgICAgcV9mb3JtYXRSaWdodFt0b3Rfc2ZiXQotICAgICAgICAgICAgICAgIFJFVFVSTklORwotICAgICAgICAgICAgICAgICAgICBOT05FCi0KLSAgICAgICAgICAgIEVORElGCi0KLSAgICAgICAgICAgIGJhbmRfc3RhcnQgPSBiYW5kX3N0b3A7Ci0KLSAgICAgICAgICAgIHRvdF9zZmIgPSB0b3Rfc2ZiICsgMTsKLQotICAgICAgICBFTkRGT1IKLQotICAgICAgICBjb2VmX3Blcl93aW4gPSBjb2VmX3Blcl93aW4gKiAod2luc19pbl9ncm91cCk7Ci0KLSAgICAgICAgd2luc19pbl9ncm91cCA9IHdpbnNfaW5fZ3JvdXAgLSAxOwotCi0gICAgICAgIHRvdF9zZmIgPSB0b3Rfc2ZiICsgc2ZiX3Blcl93aW4gKiB3aW5zX2luX2dyb3VwOwotICAgICAgICBwRmFjdG9yc1JpZ2h0ID0gcEZhY3RvcnNSaWdodCArIHNmYl9wZXJfd2luICogd2luc19pbl9ncm91cDsKLSAgICAgICAgcEZhY3RvcnNMZWZ0ICA9IHBGYWN0b3JzTGVmdCArIHNmYl9wZXJfd2luICogd2luc19pbl9ncm91cDsKLQotICA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tZUluZm8gKiBjb25zdCBwRnJhbWVJbmZvLAotICAgIGNvbnN0IEludCAgICAgICAgZ3JvdXBbXSwKLSAgICBjb25zdCBCb29sICAgICAgIG1hc2tfbWFwW10sCi0gICAgY29uc3QgSW50ICAgICAgICBjb2RlYm9va19tYXBbXSwKLSAgICBjb25zdCBJbnQgICAgICAgIGZhY3RvcnNMW10sCi0gICAgY29uc3QgSW50ICAgICAgICBmYWN0b3JzUltdLAotICAgIEludCAgICAgICAgc2ZiX3ByZWRpY3Rpb25fdXNlZFtdLAotICAgIGNvbnN0IEJvb2wgICAgICAgbHRwX2RhdGFfcHJlc2VudCwKLSAgICBJbnQzMiAgICAgIGNvZWZMZWZ0W10sCi0gICAgSW50MzIgICAgICBjb2VmUmlnaHRbXSwKLSAgICBJbnQgICAgICAgIHFfZm9ybWF0TGVmdFtNQVhCQU5EU10sCi0gICAgSW50ICAgICAgICBxX2Zvcm1hdFJpZ2h0W01BWEJBTkRTXSwKLSAgICBJbnQzMiAqIGNvbnN0IHBDdXJyZW50U2VlZCkKLXsKLQotICAgIEludDMyICAgKnBDb2VmUmlnaHQ7Ci0gICAgSW50MzIgICAqcFdpbmRvd19Db2VmUjsKLQotICAgIEludDMyICAgKnBDb2VmTGVmdDsKLQotICAgIEludCAgICAgdG90X3NmYjsKLSAgICBJbnQgICAgIHN0YXJ0X2luZHg7Ci0gICAgSW50ICAgICBzZmI7Ci0KLSAgICBJbnQgICAgIGJhbmRfbGVuZ3RoOwotICAgIEludCAgICAgYmFuZF9zdGFydDsKLSAgICBJbnQgICAgIGJhbmRfc3RvcDsKLSAgICBJbnQgICAgIGNvZWZfcGVyX3dpbjsKLQotICAgIEludCAgICAgY29kZWJvb2s7Ci0gICAgSW50ICAgICBwYXJ0aXRpb247Ci0gICAgSW50ICAgICB3aW5kb3dfc3RhcnQ7Ci0KLSAgICBJbnQgICAgIHNmYl9wZXJfd2luOwotICAgIEludCAgICAgd2luc19pbl9ncm91cDsKLSAgICBJbnQgICAgI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AgICB7Ci0gICAgICAgICAgICAvKiBiYW5kIGlzIG9mZnNldCB0YWJsZSwgYmFuZF9zdG9wIGlzIGxhc3QgY29lZiBpbiBiYW5kICovCi0gICAgICAgICAgICBiYW5kX3N0b3AgPSAqKHBCYW5kKyspOwotCi0gICAgICAgICAgICBjb2RlYm9vayA9ICoocENvZGVib29rTWFwKyspOwotCi0gICAgICAgICAgICBtYXNrX2VuYWJsZWQgPSAqKHBNYXNrTWFwKyspOwotCi0gICAgICAgICAgICAvKgotICAgICAgICAgICAgICogV2hlbiBhIHRvb2wgdXRpbGl6aW5nIHNmYiBpcyBmb3VuZCwgYXBwbHkgdGhlIGNvcnJlY3QgdG9vbAotICAgICAgICAgICAgICogdG8gdGhhdCBzZmIgaW4gZWFjaCB3aW5kb3cgaW4gdGhlIGdyb3VwCi0gICAgICAgICAgICAgKgotICAgICAgICAgICAgICogRXhhbXBsZS4uLiAgc2ZiWzNdID09IE5PSVNFX0hDQgotICAgICAgICAgICAgICoKLSAgICAgICAgICAgICAqIFsgR3JvdXAgMSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXQotICAgICAgICAgICAgICogW3dpbiAwICAgICAgICAgICAgICAgICBdW3dpbiAxICAgICAgICAgICAgICAgICBdCi0gICAgICAgICAgICAgKiBbMF1bMV1bMl1bWF1bNF1bNV1bNl1bN11bMF1bMV1bMl1bWF1bNF1bNV1bNl1bN10KLSAgICAgICAgICAgICAqCi0gICAgICAgICAgICAgKiBUaGUgZm9yKHNmYikgc3RlcHMgdGhyb3VnaCB0aGUgc2ZiJ3MgMC03IGluIHdpbiAwLgotICAgICAgICAgICAgICoKLSAgICAgICAgICAgICAqIEZpbmRpbmcgc2ZiWzNdJ3MgY29kZWJvb2sgPT0gTk9JU0VfSENCLCB0aGUgY29kZQotICAgICAgICAgICAgICogc3RlcHMgdGhyb3VnaCBhbGwgdGhlIHdpbmRvd3MgaW4gdGhlIGdyb3VwICh0aGV5IHNoYXJlCi0gICAgICAgICAgICAgKiB0aGUgc2FtZSBzY2FsZWZhY3RvcnMpIGFuZCByZXBsYWNlcyB0aGF0IHNmYiB3aXRoIG5vaXNlLgotICAgICAgICAgICAgICovCi0KLSAgICAgICAgICAgIC8qCi0gICAgICAgICAgICAgKiBFeHBlcmltZW50YWwgcmVzdWx0cyBzdWdnZXN0IHRoYXQgbXNfc3ludCBpcyB0aGUgbW9zdAotICAgICAgICAgICAgICogY29tbW9ubHkgdXNlZCB0b29sLCBzbyBjaGVjayBmb3IgaXQgZmlyc3QuCi0gICAgICAgICAgICAgKgotICAgICAgICAgICAgICovCi0KLSAgICAgICAgICAgIGJhbmRfbGVuZ3RoID0gYmFuZF9zdG9wIC0gYmFuZF9zdGFydDsKLQotICAgICAgICAgICAgaWYgKGNvZGVib29rID09IE5PSVNFX0hDQikKLSAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICBzZmJfcHJlZGljdGlvbl91c2VkW3RvdF9zZmJdICY9IGx0cF9kYXRhX3ByZXNlbnQ7Ci0KLSAgICAgICAgICAgICAgICBpZiAoc2ZiX3ByZWRpY3Rpb25fdXNlZFt0b3Rfc2ZiXSA9PSBGQUxTRSkKLSAgICAgICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgICAgIC8qCi0gICAgICAgICAgICAgICAgICAgICAqIFRoZSBicmFuY2ggYW5kIHRoZSBsb2dpY2FsIEFORCBpbnRlcmFjdCBpbiB0aGUKLSAgICAgICAgICAgICAgICAgICAgICogZm9sbG93aW5nIG1hbm5lci4uLgotICAgICAgICAgICAgICAgICAgICAgKgotICAgICAgICAgICAgICAgICAgICAgKiBtYXNrX2VuYWJsZWQgPT0gMCBoYXNtYXNrID09IFggLS0gZ2VuX3JhbmRfdmVjdG9yCi0gICAgICAgICAgICAgICAgICAgICAqIG1hc2tfZW5hYmxlZCA9PSAxIGhhc21hc2sgPT0gMSAtLSBwbnNfY29ycgotICAgICAgICAgICAgICAgICAgICAgKiBtYXNrX2VuYWJsZWQgPT0gMCBoYXNtYXNrID09IDEgLS0gZ2VuX3JhbmRfdmVjdG9yCi0gICAgICAgICAgICAgICAgICAgICAqIG1hc2tfZW5hYmxlZCA9PSAxIGhhc21hc2sgPT0gMiAtLSBnZW5fcmFuZF92ZWN0b3IKLSAgICAgICAgICAgICAgICAgICAgICogbWFza19lbmFibGVkID09IDAgaGFzbWFzayA9PSAyIC0tIGdlbl9yYW5kX3ZlY3RvcgotICAgICAgICAgICAgICAgICAgICAgKi8KLQotICAgICAgICAgICAgICAgICAgICBtYXNrX2VuYWJsZWQgJj0gaGFzbWFzazsKLQotICAgICAgICAgICAgICAgICAgICBpZiAobWFza19lbmFibGVkID09IEZBTFNFKQotICAgICAgICAgICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgICAgICAgICBwV2luZG93X0NvZWZSID0gJihwQ29lZlJpZ2h0W2JhbmRfc3RhcnRdKTsKLQotICAgICAgICAgICAgICAgICAgICAgICAgLyoKLSAgICAgICAgICAgICAgICAgICAgICAgICAqIFN0ZXAgdGhyb3VnaCBhbGwgdGhlIHdpbmRvd3MgaW4gdGhpcyBncm91cCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAqIHJlcGxhY2luZyB0aGlzIGJhbmQgaW4gZWFjaCB3aW5kb3cncwotICAgICAgICAgICAgICAgICAgICAgICAgICogc3BlY3RydW0gd2l0aCByYW5kb20gbm9pc2UKLSAgICAgICAgICAgICAgICAgICAgICAgICAqLwotICAgICAgICAgICAgICAgICAgICAgICAgc3RhcnRfaW5keCA9IHRvdF9zZmI7Ci0KLSAgICAgICAgICAgICAgICAgICAgICAgIGZvciAod2luX2luZHggPSB3aW5zX2luX2dyb3VwOwotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB3aW5faW5keCA+IDA7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHdpbl9pbmR4LS0pCi0gICAgICAgICAgICAgICAgICAgICAgICB7Ci0KLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAvKiBnZW5lcmF0ZSByYW5kb20gbm9pc2UgKi8KLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBxX2Zvcm1hdFJpZ2h0W3N0YXJ0X2luZHhdID0KLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZ2VuX3JhbmRfdmVjdG9yKAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcFdpbmRvd19Db2VmUiwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJhbmRfbGVuZ3RoLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcEN1cnJlbnRTZWVkLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKihwRmFjdG9yc1JpZ2h0KSk7Ci0KLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBwV2luZG93X0NvZWZSICs9IGNvZWZfcGVyX3dpbjsKLQotICAgICAgICAgICAgICAgICAgICAgICAgICAgIHN0YXJ0X2luZHggKz0gc2ZiX3Blcl93aW47Ci0gICAgICAgICAgICAgICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgICAgICBlbHNlCi0gICAgICAgICAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAgICAgICAgIHBuc19jb3JyKAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICgqKHBGYWN0b3JzUmlnaHQpIC0KLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKihwRmFjdG9yc0xlZnQpKSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb2VmX3Blcl93aW4sCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgc2ZiX3Blcl93aW4sCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgd2luc19pbl9ncm91cCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBiYW5kX2xlbmd0aCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBxX2Zvcm1hdExlZnRbdG90X3NmYl0sCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgJihxX2Zvcm1hdFJpZ2h0W3RvdF9zZmJdKSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAmKHBDb2VmTGVmdFtiYW5kX3N0YXJ0XSksCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgJihwQ29lZlJpZ2h0W2JhbmRfc3RhcnRdKSk7Ci0KLSAgICAgICAgICAgICAgICAgICAgfSAvKiBpZiAobWFza19tYXAgPT0gRkFMU0UpICovCi0KLSAgICAgICAgICAgICAgICB9IC8qIGlmIChzZmJfcHJlZGljdGlvbl91c2VkW3RvdF9zZmJdID09IEZBTFNFKSAqLwotCi0gICAgICAgICAgICB9IC8qIGlmIChjb2RlYm9vayA9PSAwKSAqLwotICAgICAgICAgICAgZWxzZSBpZiAoY29kZWJvb2sgPj0gSU5URU5TSVRZX0hDQjIpCi0gICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgLyoKLSAgICAgICAgICAgICAgICAgKiBUaGUgbG9naWNhbCBBTkQgZmxhZ3MgdGhlIGludmVyc2lvbiBvZiBpbnRlbnNpdHkKLSAgICAgICAgICAgICAgICAgKiBpbiB0aGUgZm9sbG93aW5nIG1hbm5lci4KLSAgICAgICAgICAgICAgICAgKgotICAgICAgICAgICAgICAgICAqIG1hc2tfZW5hYmxlZCA9PSBYIGhhc21hc2sgPT0gMCAtLSBETyBOT1QgSU5WRVJUCi0gICAgICAgICAgICAgICAgICogbWFza19lbmFibGVkID09IDAgaGFzbWFzayA9PSBYIC0tIERPIE5PVCBJTlZFUlQKLSAgICAgICAgICAgICAgICAgKiBtYXNrX2VuYWJsZWQgPT0gMSBoYXNtYXNrID09IDEgLS0gRE8gICAgIElOVkVSVAotICAgICAgICAgICAgICAgICAqIG1hc2tfZW5hYmxlZCA9PSAwIGhhc21hc2sgPT0gMSAtLSBETyBOT1QgSU5WRVJUCi0gICAgICAgICAgICAgICAgICogbWFza19lbmFibGVkID09IDEgaGFzbWFzayA9PSAyIC0tIERPIE5PVCBJTlZFUlQKLSAgICAgICAgICAgICAgICAgKiBtYXNrX2VuYWJsZWQgPT0gMCBoYXNtYXNrID09IDIgLS0gRE8gTk9UIElOVkVSVAotICAgICAgICAgICAgICAgICAqLwotCi0gICAgICAgICAgICAgICAgbWFza19lbmFibGVkICY9IGhhc21hc2s7Ci0KLSAgICAgICAgICAgICAgICBpbnRlbnNpdHlfcmlnaHQoCi0gICAgICAgICAgICAgICAgICAgICoocEZhY3RvcnNSaWdodCksCi0gICAgICAgICAgICAgICAgICAgIGNvZWZfcGVyX3dpbiwKLSAgICAgICAgICAgICAgICAgICAgc2ZiX3Blcl93aW4sCi0gICAgICAgICAgICAgICAgICAgIHdpbnNfaW5fZ3JvdXAsCi0gICAgICAgICAgICAgICAgICAgIGJhbmRfbGVuZ3RoLAotICAgICAgICAgICAgICAgICAgICBjb2RlYm9vaywKLSAgICAgICAgICAgICAgICAgICAgbWFza19lbmFibGVkLAotICAgICAgICAgICAgICAgICAgICAmKHFfZm9ybWF0TGVmdFt0b3Rfc2ZiXSksCi0gICAgICAgICAgICAgICAgICAgICYocV9mb3JtYXRSaWdodFt0b3Rfc2ZiXSksCi0gICAgICAgICAgICAgICAgICAgICYocENvZWZMZWZ0W2JhbmRfc3RhcnRdKSwKLSAgICAgICAgICAgICAgICAgICAgJihwQ29lZlJpZ2h0W2JhbmRfc3RhcnRdKSk7Ci0KLSAgICAgICAgICAgIH0gLyogRU5EIGVsc2UgY29kZWJvb2sgbXVzdCBiZSBJTlRFTlNJVFlfSENCIG9yIC4uLiAqLwotCi0gICAgICAgICAgICBiYW5kX3N0YXJ0ID0gYmFuZF9zdG9wOwotCi0gICAgICAgICAgICB0b3Rfc2ZiKys7Ci0KLSAgICAgICAgICAgIHBGYWN0b3JzTGVmdCsrOwotICAgICAgICAgICAgcEZhY3RvcnNSaWdodCsrOwotCi0gICAgICAgIH0gLyogZm9yIChzZmIpICovCi0KLSAgICAgICAgLyoKLSAgICAgICAgICogS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gICAgICAgICBudW1iZXIgb2Ygd2luZG93cywKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzY2FsZWZhY3RvciBiYW5kcyBwZXIgZ3JvdXAsIGV0Yy4pCi0KLSAgICBjb25zdCBJbnQgICAgICAgIGdyb3VwW10gICAgICAgICAgICA9IEFycmF5IHRoYXQgY29udGFpbnMgaW5kZXhlcyBvZiB0aGUKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRoZSBmaXJzdCB3aW5kb3cgaW4gdGhlIG5leHQgZ3JvdXAuCi0KLSAgICBjb25zdCBJbnQgICAgICAgIGNvZGVib29rX21hcFtdICAgICA9IEFycmF5IHRoYXQgZGVub3RlcyB3aGljaCBIdWZmbWFuCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb2RlYm9vayB3YXMgdXNlZCBmb3IgdGhlIGVuY29kaW5nCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBvZiBlYWNoIHNjYWxlZmFjdG9yIGJhbmQuCi0KLSAgICBjb25zdCBJbnQgICAgICAgIGZhY3RvcnNbXSAgICAgICAgICA9IEFycmF5IG9mIHNjYWxlZmFjdG9ycwotCi0gICAgSW50ICAgICAgICAgICAgICBzZmJfcHJlZGljdGlvbl91c2VkW10gPSBGbGFnIHRoYXQgZGVub3RlcyB0aGUgYWN0aXZhdGlvbgotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgb2YgbG9uZyB0ZXJtIHByZWRpY3Rpb24gb24gYSBzZmIKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJhc2lzLgotCi0gICAgQm9vbCAgICAgICAgICAgICBsdHBfZGF0YV9wcmVzZW50ICAgPSBGbGFnIHRoYXQgZGVub3RlcyB3aGV0aGVyIExUUAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaXMgYWN0aXZlIGZvciB0aGUgZW50aXJlIGZyYW1lLiAgSWYKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRoaXMgZmxhZyBpcyBGQUxTRSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNmYl9wcmVkaWN0aW9uX3VzZWQgaXMgZ2FyYmFnZS4KLQotICAgIEludDMyICAgICAgICAgICAgc3BlY3RyYWxfY29lZltdICAgID0gQXJyYXkgb2YgcG9pbnRlcnMgcG9pbnRpbmcgdG8gdGhlCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzcGVjdHJhbCBjb2VmJ3MgZm9yIHRoZSBMRUZUIGNoYW5uZWwuCi0KLSAgICBJbnQgICAgICAgICAgICAgIHFfZm9ybWF0W10gICAgICAgICAgID0gUS1mb3JtYXQgZm9yIHRoZSBpbmZvcm1hdGlvbgotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwb2ludGVkIHRvIGJ5IHNwZWN0cmFsX2NvZWYuCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEluZGV4ZWQgYnkgc2NhbGVmYWN0b3IgYmFuZC4KLQotICAgIEludDMyICAgICAgICAgICAqcEN1cnJlbnRTZWVkICAgICAgICAgPSBQb2ludGVyIHRvIHRoZSBjdXJyZW50IHNlZWQgZm9yIHRoZQotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByYW5kb20gbnVtYmVyIGdlbmVyYXRvci4KLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKGdlbl9yYW5kX3ZlY3RvcikKLQotIExvY2FsIFN0b3Jlcy9CdWZmZXJzL1BvaW50ZXJzIE5lZWRlZDoKLQotIEdsb2JhbCBTdG9yZXMvQnVmZmVycy9Qb2ludGVycyBOZWVkZWQ6Ci0KLSBPdXRwdXRzOgot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24gLSB3aW5kb3dfc3RhcnQpOwotCi0gICAgICAgIEZPUiAoc2ZiID0gbnVtX2JhbmRzOyBzZmIgPiAwOyBzZmItLSkKLQotICAgICAgICAgICAgYmFuZF9zdG9wID0gKnBCYW5kOwotICAgICAgICAgICAgcEJhbmQgPSBwQmFuZCArIDE7Ci0KLSAgICAgICAgICAgIElGICgqKHBDb2RlYm9va01hcCsrKSA9PSBOT0lTRV9IQ0IgKQotCi0gICAgICAgICAgICAgICAgdGVtcEludCA9IHNmYl9wcmVkaWN0aW9uX3VzZWRbdG90X3NmYl0gQU5EIGx0cF9kYXRhX3ByZXNlbnQ7Ci0KLSAgICAgICAgICAgICAgICBJRiAodGVtcEludCA9PSBGQUxTRSkKLQotICAgICAgICAgICAgICAgICAgICBwV2luZG93X0NvZWYgPSBwRmlyc3RfV2luZG93X0NvZWZzICsgYmFuZF9zdGFydDsKLQotICAgICAgICAgICAgICAgICAgICBiYW5kX2xlbmd0aCA9IChiYW5kX3N0b3AgLSBiYW5kX3N0YXJ0KTsKLQotICAgICAgICAgICAgICAgICAgICBzdGFydF9pbmR4ID0gdG90X3NmYjsKLQotICAgICAgICAgICAgICAgICAgICB0ZW1wSW50ID0gKihwRmFjdG9ycyk7Ci0KLSAgICAgICAgICAgICAgICAgICAgRk9SICh3aW5faW5keCA9IHdpbnNfaW5fZ3JvdXA7IHdpbl9pbmR4ID4gMDsgd2luX2luZHgtLSkKLQotICAgICAgICAgICAgICAgICAgICAgICAgQ0FMTCBnZW5fcmFuZF92ZWN0b3IoIHBXaW5kb3dfQ29lZlIsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYmFuZF9sZW5ndGgsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcEN1cnJlbnRTZWVkLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRlbXBJbnQpOwotCi0gICAgICAgICAgICAgICAgICAgICAgICBNT0RJRllJTkcgcFdpbmRvd19Db2VmUiA9IHNjYWxlZCByYW5kb20gbm9pc2UKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwQ3VycmVudFNlZWQgID0gY3VycmVudCBzdGF0ZSBvZiB0aGUgcmFuZG9tCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG5vaXNlIGdlbmVyYXRvci4KLQotICAgICAgICAgICAgICAgICAgICAgICAgUkVUVVJOSU5HIHFfZm9ybWF0W3N0YXJ0X2luZHhdID0gcS1mb3JtYXQgZm9yIHRoaXMgc2ZiLgotCi0gICAgICAgICAgICAgICAgICAgICAgICBwV2luZG93X0NvZWYgPSBwV2luZG93X0NvZWYgKyBjb2VmX3Blcl93aW47Ci0KLSAgICAgICAgICAgICAgICAgICAgICAgIHN0YXJ0X2luZHggPSBzdGFydF9pbmR4ICsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwRnJhbWVJbmZvLT5zZmJfcGVyX3dpblt3aW5faW5keF07Ci0KLSAgICAgICAgICAgICAgICAgICAgRU5ERk9SCi0KLSAgICAgICAgICAgICAgICBFTkRJRgotCi0gICAgICAgICAgICBFTkRJRgotCi0gICAgICAgICAgICBiYW5kX3N0YXJ0ID0gYmFuZF9zdG9wOwotCi0gICAgICAgICAgICB0b3Rfc2ZiID0gdG90X3NmYiArIDE7Ci0KLSAgICAgICAgICAgIHBGYWN0b3JzID0gcEZhY3RvcnMgKyAxOwotCi0gICAgICAgIEVOREZPUgotCi0gICAgICAgIGNvZWZfcGVyX3dpbiA9IGNvZWZfcGVyX3dpbiAqIHdpbnNfaW5fZ3JvdXA7Ci0gICAgICAgIHdpbnNfaW5fZ3JvdXAgPSB3aW5zX2luX2dyb3VwIC0gMTsKLQotICAgICAgICB0b3Rfc2ZiID0gdG90X3NmYiArIG51bV9iYW5kcyAqIHdpbnNfaW5fZ3JvdXA7Ci0gICAgICAgIHBGYWN0b3J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gICAgICAgICAgICB7Ci0KLSAgICAgICAgICAgICAgICAgICAgdGVtcEludCA9IHNmYl9wcmVkaWN0aW9uX3VzZWRbdG90X3NmYl0gJiBsdHBfZGF0YV9wcmVzZW50OwotCi0gICAgICAgICAgICAgICAgICAgIGlmICh0ZW1wSW50ID09IEZBTFNFKQotICAgICAgICAgICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgICAgICAgICAvKiBnZW5lcmF0ZSByYW5kb20gbm9pc2UgKi8KLSAgICAgICAgICAgICAgICAgICAgICAgIHBXaW5kb3dfQ29lZiA9IHNwZWMgKyBiYW5kX3N0YXJ0OwotCi0gICAgICAgICAgICAgICAgICAgICAgICB0ZW1wSW50ID0gcEZhY3RvcnNbc2ZiXTsKLQotICAgICAgICAgICAgICAgICAgICAgICAgc3RhcnRfaW5keCA9IHRvdF9zZmIrKzsKLQotICAgICAgICAgICAgICAgICAgICAgICAgLyogcmVjb25zdHJ1Y3Qgbm9pc2Ugc3Vic3RpdHV0ZWQgdmFsdWVzICovCi0gICAgICAgICAgICAgICAgICAgICAgICAvKiBnZW5lcmF0ZSByYW5kb20gbm9pc2UgKi8KLQotICAgICAgICAgICAgICAgICAgICAgICAgcV9mb3JtYXRbc3RhcnRfaW5keF0gPSBnZW5fcmFuZF92ZWN0b3IocFdpbmRvd19Db2VmLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYmFuZF9sZW5ndGgsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwQ3VycmVudFNlZWQsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0ZW1wSW50KTsKLQotICAgICAgICAgICAgICAgICAgICB9ICAgLyogaWYgKHNmYl9wcmVkaWN0aW9uX3VzZWRbdG90X3NmYl0gPT0gRkFMU0UpICovCi0KLSAgICAg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FsLiB8ICAgICAgICB8ICAgICAgICAgICAgICAgICAgICAgICAgfCAgICAgICB8ICB8IFN5bnRoICB8ICAgUU1GIC0+IEwKLSAgICAgLS0tLS0tLSAgICAgICAgIG8tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLT58ICAgICAgIHwgICAtLS0tLS0tLSAgICBTeW50aAotUU1GICAgICAgICAgICAgICAgICAgfCAgICAgICAgICAgICAgICBzX2sobikgIHxTdGVyZW8gfC0tLS0tLS0tLS0tLS0tPgotQW5hbC4gICAgICAgICAgICAgIC0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tPnwgICAgICAgfAotICAgICBfX19fX19fICAgICAgIHwgfCAgICAgICAgICAgICAgICAgICAgICAgIHwgICAgICAgfCAgIF9fX19fX19fCi0gICAgfCAgICAgICB8IEhGIC0tbyB8ICAgLS0tLS0tLS0tLS0gICAgICAgICAgfFByb2Nlc3N8ICB8ICAgICAgICB8Ci0gIC0+fCBEZWxheSB8ICAgICAgfCAgLT58ICAgICAgICAgICB8LS0tLS0tLS0+fCAgICAgICB8LT58IEh5YnJpZCB8LS0+Ci0gICAgIC0tLS0tLS0gICAgICAgfCAgICB8ZGVjb3JyZWxhdGV8IGRfayhuKSAgfCAgICAgICB8ICB8IFN5bnRoICB8ICAgUU1GIC0+IFIKLSAgICAgICAgICAgICAgICAgICAtLS0tPnwgICAgICAgICAgIHwtLS0tLS0tLT58ICAgICAgIHwgICAtLS0tLS0tLSAgICBTeW50aAotICAgICAgICAgICAgICAgICAgICAgICAgIC0tLS0tLS0tLS0tICAgICAgICAgIHxfX19fX19ffC0tLS0tLS0tLS0tLS0tPgotCi0KLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLQotIFJFUVVJUkVNRU5UUwotCi0KLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS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ViLWJhbmQgc2FtcGxlcyBzX2sobikgYXJlIGNvbnZlcnRlZCBpbnRvIGRlLWNvcnJlbGF0ZWQgc3ViLWJhbmRzIHNhbXBsZXMKLSAgZF9rKG4pLiBrIGluZGV4IGZvciBmcmVxdWVuY3ksIG4gdGltZSBpbmRleAotCi0KLSAgICAgX19fX19fXyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBfX19fX19fXwotICAgIHwgICAgICAgfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBfX19fX19fICAgfCAgICAgICAgfAotICAtPnxIeWJyaWQgfCBMRiAtLS0tICAgICAgICAgICAgICAgICAgICAgICAgIHwgICAgICAgfC0+fCBIeWJyaWQgfC0tPgotICAgIHwgQW5hbC4gfCAgICAgICAgfCAgICAgICAgICAgICAgICAgICAgICAgIHwgICAgICAgfCAgfCBTeW50aCAgfCAgIFFNRiAtPiBMCi0gICAgIC0tLS0tLS0gICAgICAgICBvLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0+fCAgICAgICB8ICAgLS0tLS0tLS0gICAgU3ludGgKLVFNRiAgICAgICAgICAgICAgICAgIHwgICAgICAgICAgICAgICAgc19rKG4pICB8U3RlcmVvIHwtLS0tLS0tLS0tLS0tLT4KLUFuYWwuICAgICAgICAgICAgICAtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLT58ICAgICAgIHwKLSAgICAgX19fX19fXyAgICAgICB8IHwgICAgICAgICAgICAgICAgICAgICAgICB8ICAgICAgIHwgICBfX19fX19fXwotICAgIHwgICAgICAgfCBIRiAtLW8gfCAgIC0tLS0tLS0tLS0tICAgICAgICAgIHxQcm9jZXNzfCAgfCAgICAgICAgfAotICAtPnwgRGVsYXkgfCAgICAgIHwgIC0+fCAgICAgICAgICAgfC0tLS0tLS0tPnwgICAgICAgfC0+fCBIeWJyaWQgfC0tPgotICAgICAtLS0tLS0tICAgICAgIHwgICAgfGRlY29ycmVsYXRlfCBkX2sobikgI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KmlJbikKLXsKLQotICAgIEludDMyIGNtcGx4OwotICAgIEludDE2IHJUbXAwOwotICAgIEludDMyIHJUbXA7Ci0gICAgSW50MzIgaVRtcDsKLSAgICBJbnQzMiAqcHRfclRtcDsKLSAgICBJbnQzMiAqcHRfaVRtcDsKLQotCi0KLSAgICAvKgotICAgICAqICBBbGwgcGFzcyBmaWx0ZXJzCi0gICAgICogICAgICAgICAgICAgICAgICAgICAgICAgMgotICAgICAqICAgICAgICAgICAgICAgICAgICAgICAgX19fICBRX2ZyYWN0KGssbSkqel4oLWQobSkpICAtICBhKG0pKmdfZGVjYXlfc2xvcGUoaykKLSAgICAgKiAgIHpeKC0yKSpwaGlfZnJhY3QoaykqIHwgfCAgLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tCi0gICAgICogICAgICAgICAgICAgICAgICAgICAgICBtPTAgIDEgIC0gYShtKSpnX2RlY2F5X3Nsb3BlKGspKlFfZnJhY3QoayxtKSp6XigtZChtKSkKLSAgICAgKgotICAgICAqCi0gICAgICogICAgRnJhY3Rpb25hbCBkZWxheSBtYXRyaXg6Ci0gICAgICoKLSAgICAgKiAgICBRX2ZyYWN0KGssbSkgPSBleHAoLWoqcGkqcShtKSpmX2NlbnRlcihrKSkgICAgICAgMDw9IGsgPD0gU1VCUU1GX0dST1VQUwotICAgICAqCi0gICAgICogICAgVmVjdG9yczogYShtKSwgcShtKSwgZChtKSBhcmUgY29uc3RhbnRzCi0gICAgICoKLSAgICAgKiAgICBtICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbSAgICAgMCAgICAgICAxICAgICAgIDIKLSAgICAgKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0KLSAgICAgKiAgICBkZWxheSBsZW5ndGggICAgICAgICAgICAgICAgIGQobSkgPT0gMyAgICAgICA0ICAgICAgIDUgICAgICAoRnMg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IGEobSkqZ19kZWNheV9zbG9wZShrKSp4KG4pICovCi0gICAgKnB0X2lUbXAgPSAgZnhwX21hYzMyX2J5XzE2KGlUbXAsIHJUbXAwLCAqaUluKTsgICAgIC8qIHkobikgPSB4KG4pICsgYShtKSpnX2RlY2F5X3Nsb3BlKGspKiggUV9mcmFjdChrLG0pKnkobi0xKSAtIGEobSkqZ19kZWNheV9zbG9wZShrKSp4KG4pKSAqLwotICAgICppSW4gPSBpVG1wIDw8IDI7Ci0KLSAgICByVG1wICAgICA9ICBmeHBfbWFjMzJfYnlfMTYoLSpySW4sIHJUbXAwLCByVG1wKTsKLSAgICAqcHRfclRtcCA9ICBmeHBfbWFjMzJfYnlfMTYoclRtcCwgclRtcDAsICpySW4pOwotICAgICpySW4gPSByVG1wIDw8IDI7Ci19Ci0KLQotdm9pZCBwc19hbGxfcGFzc19mcmFjdF9kZWxheV9maWx0ZXJfdHlwZV9JSShVSW50MzIgKmRlbGF5QnVmSW5kZXgsCi0gICAgICAgIEludDMyIHNiX2RlbGF5LAotICAgICAgICBjb25zdCBJbnQzMiAqcHBGcmFjdERlbGF5UGhhc2VGYWN0b3JTZXIsCi0gICAgICAgIEludDMyICoqKnBwcFJlYWxEZWxheVJCdWZmZXJTZXIsCi0gICAgICAgIEludDMyICoqKnBwcEltYWdEZWxheVJCdWZmZXJTZXIsCi0gICAgICAgIEludDMyICpySW4sCi0gICAgICAgIEludDMyICppSW4sCi0gICAgICAgIEludDMyIGRlY2F5U2NhbGVGYWN0b3IpCi17Ci0KLSAgICBJbnQzMiBjbXBseDsKLSAgICBJbnQxNiByVG1wMDsKLSAgICBJbnQzMiByVG1wOwotICAgIEludDMyIGlUbXA7Ci0gICAgSW50MzIgKnB0X3JUbXA7Ci0gICAgSW50MzIgKnB0X2lUbXA7Ci0gICAgY29uc3QgSW50MTYgKnB0X2RlbGF5OwotCi0KLQotICAgIC8qCi0gICAgICogIEFsbCBwYXNzIGZpbHRlcnMKLSAgICAgKiAgICAgICAgICAgICAgICAgICAgICAgICAyCi0gICAgICogICAgICAgICAgICAgICAgICAgICAgICBfX18gIFFfZnJhY3QoayxtKSp6XigtZChtKSkgIC0gIGEobSkqZ19kZWNheV9zbG9wZShrKQotICAgICAqICAgel4oLTIpKnBoaV9mcmFjdChrKSogfCB8ICAtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0KLSAgICAgKiAgICAgICAgICAgICAgICAgICAgICAgIG09MCAgMSAgLSBhKG0pKmdfZGVjYXlfc2xvcGUoaykqUV9mcmFjdChrLG0pKnpeKC1kKG0pKQotICAgICAqCi0gICAgICoKLSAgICAgKiAgICBGcmFjdGlvbmFsIGRlbGF5IG1hdHJpeDoKLSAgICAgKgotICAgICAqICAgIFFfZnJhY3QoayxtKSA9IGV4cCgtaipwaSpxKG0pKmZfY2VudGVyKGspKSAgICAgICAwPD0gayA8PSBTVUJRTUZfR1JPVVBTCi0gICAgICoKLSAgICAgKiAgICBWZWN0b3JzOiBhKG0pLCBxKG0pLCBkKG0pIGFyZSBjb25zdGFudHMKLSAgICAgKgotICAgICAqICAgIG0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICBtICAgICAwICAgICAgIDEgICAgICAgMgotICAgICAqICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLQotICAgICAqICAgIGRlbGF5IGxlbmd0aCAgICAgICAgICAgICAgICAgZChtKSA9PSAzICAgICAgIDQgICAgICAgNSAgICAgIChGcyA+IDMyIEtIeikKLSAgICAgKiAgICBmcmFjdGlvbmFsIGRlbGF5IGxlbmd0aCAgICAgIHEobSkgPT0gMC40MyAgICAwLjc1ICAgIDAuMzQ3Ci0gICAgICogICAgZmlsdGVyIGNvZWZmaWNpZW50ICAgICAgICAgICBhKG0pID09IDAuNjUxNDQgMC41NjQ3MiAwLjQ4OTU0Ci0gICAgICoKLSAgICAgKiAgICAgIC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J1ZmZlclN1YlFtZiA9IChJbnQzMiAqKilwdHIxOwotICAgIHB0cjEgKz0gU1VCUU1GX0dST1VQUyAqIHNpemVvZihJbnQzMiAqKSAvIHNpemVvZihJbnQzMik7Ci0KLSAgICBmb3IgKGkgPSAwOyBpIDwgTk9fUU1GX0lDQ19DSEFOTkVMUzsgaSsrKSAgIC8qIDYxICovCi0gICAgewotICAgICAgICBpbnQgZGVsYXk7Ci0KLSAgICAgICAgaWYgKGkgPCBOT19RTUZfQUxMUEFTU19DSEFOTkVMUykgICAgLyogMjAgKi8KLSAgICAgICAgewotICAgICAgICAgICAgZGVsYXkgPSAyOwotICAgICAgICAgICAgaF9wc19kZWMtPmFhUmVhbERlbGF5QnVmZmVyUW1mW2ldID0gKEludDMyICopcHRyNDsKLSAgICAgICAgICAgIHB0cjQgKz0gZGVsYXk7Ci0KLSAgICAgICAgICAgIGhfcHNfZGVjLT5hYUltYWdEZWxheUJ1ZmZlclFtZltpXSA9IChJbnQzMiAqKXB0cjU7Ci0gICAgICAgICAgICBwdHI1ICs9IGRlbGF5OwotICAgICAgICB9Ci0gICAgICAgIGVsc2UKLSAgICAgICAgewotCi0gICAgICAgICAgICBpZiAoaSA+PSAoTk9fUU1GX0FMTFBBU1NfQ0hBTk5FTFMgKyBTSE9SVF9ERUxBWV9TVEFSVCkpCi0gICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgZGVsYXkgPSBTSE9SVF9ERUxBWTsKLSAgICAgICAgICAgIH0KLSAgICAgICAgICAgIGVsc2UKLSAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICBkZWxheSA9IExPTkdfREVMQVk7Ci0gICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgIGhfcHNfZGVjLT5hYVJlYWxEZWxheUJ1ZmZlclFtZltpXSA9IChJbnQzMiAqKXB0cjE7Ci0gICAgICAgICAgICBwdHIxICs9IGRlbGF5OwotCi0gICAgICAgICAgICBoX3BzX2RlYy0+YWFJbWFnRGVsYXlCd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gICB8ICAgICAgIHwtPnwgSHlicmlkIHwtLT4KLSAgICB8IEFuYWwuIHwgICAgICAgIHwgICAgICAgICAgICAgICAgICAgICAgICB8ICAgICAgIHwgIHwgU3ludGggIHwgICBRTUYgLT4gTAotICAgICAtLS0tLS0tICAgICAgICAgby0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tPnwgICAgICAgfCAgIC0tLS0tLS0tICAgIFN5bnRoCi1RTUYgICAgICAgICAgICAgICAgICB8ICAgICAgICAgICAgICAgIHNfayhuKSAgfFN0ZXJlbyB8LS0tLS0tLS0tLS0tLS0+Ci1BbmFsLiAgICAgICAgICAgICAgLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0+fCAgICAgICB8Ci0gICAgIF9fX19fX18gICAgICAgfCB8ICAgICAgICAgICAgICAgICAgICAgICAgfCAgICAgICB8ICAgX19fX19fX18KLSAgICB8ICAgICAgIHwgSEYgLS1vIHwgICAtLS0tLS0tLS0tLSAgICAgICAgICB8UHJvY2Vzc3wgIHwgICAgICAgIHwKLSAgLT58IERlbGF5IHwgICAgICB8ICAtPnwgICAgICAgICAgIHwtLS0tLS0tLT58ICAgICAgIHwtPnwgSHlicmlkIHwtLT4KLSAgICAgLS0tLS0tLSAgICAgICB8ICAgIHxkZWNvcnJlbGF0ZXwgZF9rKG4pICB8ICAgICAgIHwgIHwgU3ludGggIHwgICBRTUYgLT4gUgotICAgICAgICAgICAgICAgICAgIC0tLS0+fCAgICAgICAgICAgfC0tLS0tLS0tPnwgICAgICAgfCAgIC0tLS0tLS0tICAgIFN5bnRoCi0gICAgICAgICAgICAgICAgICAgICAgICAgLS0tLS0tLS0tLS0gICAgICAgICAgfF9fX19fX198LS0tLS0tLS0tLS0tLS0+Ci0KLQotLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tCi0gUkVRVUlSRU1FTlRTC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0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0qLwotCi12b2lkIHBzX2FwcGxpZWQoU1RSVUNUX1BTX0RFQyAqaF9wc19kZWMsCi0gICAgICAgICAgICAgICAgSW50MzIgckludEJ1ZmZlckxlZnRbXVs2NF0sCi0gICAgICAgICAgICAgICAgSW50MzIgaUludEJ1ZmZlckxlZnRbXVs2NF0sCi0gICAgICAgICAgICAgICAgSW50MzIgKnJJbnRCdWZmZXJSaWdodCwKLSAgICAgICAgICAgICAgICBJbnQzMiAqaUludEJ1ZmZlclJpZ2h0LAotICAgICAgICAgICAgICAgIEludDMyIHNjcmF0Y2hfbWVtW10sCi0gICAgICAgICAgICAgICAgSW50MzIgYmFuZCkKLQotewotCi0gICAgLyoKLSAgICAgKiAgR2V0IGhpZ2hlciBmcmVxdWVuY3kgcmVzb2x1dGlvbiBpbiB0aGUgbG93ZXIgUU1GIHN1YmJhbmRzCi0gICAgICogIGNyZWF0aW5nIHN1Yi1zdWJiYW5kcwotICAgICAqLwotICAgIHBzX2h5YnJpZF9hbmFseXNpcyhySW50QnVmZmVyTGVmdCwKLSAgICAgICAgICAgICAgICAgICAgICAgaUludEJ1ZmZlckxlZnQsCi0gICAgICAgICAgICAgICAgICAgICAgIGhfcHNfZGVjLT5tSHlicmlkUmVhbExlZnQsCi0gICAgICAgICAgICAgICAgICAgICAgIGhfcHNfZGVjLT5tSHlicmlkSW1hZ0xlZnQsCi0gICAgICAgICAgICAgICAgICAgICAgIGhfcHNfZGVjLT5oSHlicmlkLAotICAgICAgICAgICAgICAgICAgICAgICBzY3JhdGNoX21lbSwKLSAgICAgICAgICAgICAgICAgICAgICAgYmFuZCk7Ci0KLSAgICAvKgotICAgICAqICBCeSBtZWFucyBvZiBkZWxheWluZyBhbmQgYWxsLXBhc3MgZmlsdGVyaW5nLCBzdWItc3ViYmFuZHMgb2YKLSAgICAgKiAgbGVmdCBjaC4gYXJlIGRlY29ycmVsYXRlIHRvIGNyZWF0ZXMgcmlnaHQgY2guIHN1Yi1zdWJiYW5kcwotICAgICAqLwotCi0gICAgcHNfZGVjb3JyZWxhdGUoaF9wc19kZWMsCi0gICAgICAgICAgICAgICAgICAgKnJJbnRCdWZmZXJMZWZ0LAotICAgICAgICAgICAgICAgICAgICppSW50QnVmZmVyTGVmdCwKLSAgICAgICAgICAgICAgICAgICBySW50QnVmZmVyUmlnaHQsCi0gICAgICAgICAgICAgICAgICAgaUludEJ1ZmZlclJpZ2h0LAotICAgICAgICAgICAgICAgICAgIHNjcmF0Y2hfbWVtKTsKLQotICAgIC8qCi0gICAgICogIHN1Yi1zdWJiYW5kcyBvZiBsZWZ0IGFuZCByaWdodCBjaC4gYXJlIHByb2Nlc3NlZCBhY2NvcmRpbmcgdG8KLSAgICAgKiAgc3RlcmVvIGNsdWVzLgotICAgICAqLwotCi0gICAgcHNfc3RlcmVvX3Byb2Nlc3NpbmcoaF9wc19kZWMsCi0gICAgICAgICAgICAgICAgICAgICAgICAgKnJJbnRCdWZmZXJMZWZ0LAotICAgICAgICAgICAgICAgICAgICAgICAgICppSW50QnVmZmVyTGVmdCwKLSAgICAgICAgICAgICAgICAgICAgICAgICBySW50QnVmZmVyUmlnaHQsCi0gICAgICAgICAgICAgICAgICAgICAgICAgaUludEJ1ZmZlclJpZ2h0KTsKLQotICAgIC8qCi0gICAgICogIFJlY29uc3RydWN0IHN0ZXJlbyBzaWduYWxzCi0gICAgICovCi0KLSAgICBwc19oeWJyaWRfc3ludGhlc2lzKChjb25zdCBJbnQzMiopaF9wc19kZWMtPm1IeWJyaWRSZWFsTGVmdCwKLSAgICAgICAgICAgICAgICAgICAgICAgIChjb25zdCBJbnQzMiopaF9wc19kZWMtPm1IeWJyaWRJbWFnTGVmdCwKLSAgICAgICAgICAgICAgICAgICAgICAgICpySW50QnVmZmVyTGVmdCwKLSAgICAgICAgICAgICAgICAgICAgICAgICppSW50QnVmZmVyTGVmdCwKLSAgICAgICAgICA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A9IHBzX2RlYy0+YUlpZFByZXZGcmFtZUluZGV4OwotICAgICAgICAgICAgYVByZXZJY2NJbmRleCA9IHBzX2RlYy0+YUljY1ByZXZGcmFtZUluZGV4OwotICAgICAgICB9Ci0gICAgICAgIGVsc2UKLSAgICAgICAgewotICAgICAgICAgICAgYVByZXZJaWRJbmRleCA9IHBzX2RlYy0+YWFJaWRJbmRleFtlbnYtMV07Ci0gICAgICAgICAgICBhUHJldkljY0luZGV4ID0gcHNfZGVjLT5hYUljY0luZGV4W2Vudi0xXTsKLSAgICAgICAgfQotCi0gICAgICAgIC8qCi0gICAgICAgICAqIERpZmZlcmVudGlhbCBEZWNvZGluZyBvZiBJSUQgcGFyYW1ldGVycyBvdmVyIHRpbWUvZnJlcXVlbmN5Ci0gICAgICAgICAqLwotICAgICAgICBkaWZmZXJlbnRpYWxfRGVjb2RpbmcocHNfZGVjLT5iRW5hYmxlSWlkLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcHNfZGVjLT5hYUlpZEluZGV4W2Vudl0sCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICBhUHJldklpZEluZGV4LAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcHNfZGVjLT5hYklpZER0RmxhZ1tlbnZdLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYU5vSWlkQmluc1twc19kZWMtPmZyZXFSZXNJaWRdLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKHBzX2RlYy0+ZnJlcVJlc0lpZCkgPyAxIDogMiwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC1ub0lpZFN0ZXBzLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbm9JaWRTdGVwcyk7Ci0KLSAgICAgICAgLyoKLSAgICAgICAgICogRGlmZmVyZW50aWFsIERlY29kaW5nIG9mIElDQyBwYXJhbWV0ZXJzIG92ZXIgdGltZS9mcmVxdWVuY3kKLSAgICAgICAgICovCi0gICAgICAgIGRpZmZlcmVudGlhbF9EZWNvZGluZyhwc19kZWMtPmJFbmFibGVJY2MsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwc19kZWMtPmFhSWNjSW5kZXhbZW52XSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGFQcmV2SWNjSW5kZXgsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwc19kZWMtPmFiSWNjRHRGbGFnW2Vudl0sCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICBhTm9JY2NCaW5zW3BzX2RlYy0+ZnJlcVJlc0ljY10sCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAocHNfZGVjLT5mcmVxUmVzSWNjKSA/IDEgOiAyLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIE5PX0lDQ19TVEVQUyAtIDEpOwotCi0KLSAgICB9ICAgLyogZm9yIChlbnY9MDsgZW52PHBzX2RlYy0+bm9FbnY7IGVudisrKSAqLwotCi0gICAgaWYgKHBzX2RlYy0+bm9FbnYgPT0gMCkKLSAgICB7Ci0gICAgICAgIHBzX2RlYy0+bm9FbnYgPSAxOwotCi0gICAgICAgIGlmIChwc19kZWMtPmJFbmFibGVJaWQpCi0gICAgICAgIHsgICAvKiAgTk9fSElfUkVTX0JJTlMgPT0gMzQgKi8KLSAgICAgICAgICAgIHB2X21lbW1vdmUocHNfZGVjLT5hYUlpZEluZGV4W3BzX2RlYy0+bm9FbnYtMV0sCi0gICAgICAgICAgICAgICAgICAgICAgIHBzX2RlYy0+YUlpZFByZXZGcmFtZUluZGV4LAotICAgICAgICAgICAgICAgICAgICAgICBOT19ISV9SRVNfQklOUypzaXplb2YoKnBzX2RlYy0+YUlpZFByZXZGcmFtZUluZGV4KSk7Ci0KLSAgICAgICAgfQotICAgICAgICBlbHNlCi0gICAgICAgIHsKLSAgICAgICAgICAgIHB2X21lbXNldCgodm9pZCAqKXBzX2RlYy0+YWFJaWRJbmRleFtwc19kZWMtPm5vRW52LTFdLAotICAgICAgICAgICAgICAgICAgICAgIDAsCi0gICAgICAgICAgICAgICAgICAgICAgTk9fSElfUkVTX0JJTlMqc2l6ZW9mKCoqcHNfZGVjLT5hYUlpZEluZGV4KSk7Ci0gICAgICAgIH0KLSAgICAgICAgaWYgKHBzX2RlYy0+YkVuYWJsZUljYykKLSAgICAgICAgewotICAgICAgICAgICAgcHZfbWVtbW92ZShwc19kZWMtPmFhSWNjSW5kZXhbcHNfZGVjLT5ub0Vudi0xXSwKLSAgICAgICAgICAgICAgICAgICAgICAgcHNfZGVjLT5hSWNjUHJldkZyYW1lSW5kZXgsCi0gICAgICAgICAgICAgICAgICAgICAgIE5PX0hJX1JFU19CSU5TKnNpemVvZigqcHNfZGVjLT5hSWNjUHJldkZyYW1lSW5kZXgpKTsKLSAgICAgICAgfQotICAgICAgICBlbHNlCi0gICAgICAgIHsKLSAgICAgICAgICAgIHB2X21lbXNldCgodm9pZCAqKXBzX2RlYy0+YWFJY2NJbmRleFtwc19kZWMtPm5vRW52LTFdLAotICAgICAgICAgICAgICAgICAgICAgIDAsCi0gICAgICAgICAgICAgICAgICAgICAgTk9fSElfUkVTX0JJTlMqc2l6ZW9mKCoqcHNfZGVjLT5hYUljY0luZGV4KSk7Ci0gICAgICAgIH0KLSAgICB9Ci0KLSAgICBwdl9tZW1tb3ZlKHBzX2RlYy0+YUlpZFByZXZGcmFtZUluZGV4LAotICAgICAgICAgICAgICAgcHNfZGVjLT5hYUlpZEluZGV4W3BzX2RlYy0+bm9FbnYtMV0sCi0gICAgICAgICAgICAgICBOT19ISV9SRVNfQklOUypzaXplb2YoKnBzX2RlYy0+YUlpZFByZXZGcmFtZUluZGV4KSk7Ci0KLSAgICBwdl9tZW1tb3ZlKHBzX2RlYy0+YUljY1ByZXZGcmFtZUluZGV4LAotICAgICAgICAgICAgICAgcHNfZGVjLT5hYUljY0luZGV4W3BzX2RlYy0+bm9FbnYtMV0sCi0gICAgICAgIC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sCi0gICAgICAgICAgICAgICAgICAgICAgIHBzX2RlYy0+YWFJaWRJbmRleFtwc19kZWMtPm5vRW52LTFdLAotICAgICAgICAgICAgICAgICAgICAgICBOT19ISV9SRVNfQklOUypzaXplb2YoKipwc19kZWMtPmFhSWlkSW5kZXgpKTsKLQotICAgICAgICAgICAgcHZfbWVtbW92ZShwc19kZWMtPmFhSWNjSW5kZXhbcHNfZGVjLT5ub0Vudl0sCi0gICAgICAgICAgICAgICAgICAgICAgIHBzX2RlYy0+YWFJY2NJbmRleFtwc19kZWMtPm5vRW52LTFdLAotICAgICAgICAgICAgICAgICAgICAgICBOT19ISV9SRVNfQklOUypzaXplb2YoKipwc19kZWMtPmFhSWNjSW5kZXgpKTsKLSAgICAgICAgfQotCi0gICAgICAgIGZvciAoZW52ID0gMTsgZW52IDwgcHNfZGVjLT5ub0VudjsgZW52KyspCi0gICAgICAgIHsKLSAgICAgICAgICAgIFVJbnQzMiB0aHI7Ci0gICAgICAgICAgICB0aHIgPSBwc19kZWMtPm5vU3ViU2FtcGxlcyAtIHBzX2RlYy0+bm9FbnYgKyBlbnY7Ci0KLSAgICAgICAgICAgIGlmIChwc19kZWMtPmFFbnZTdGFydFN0b3BbZW52XSA+IHRocikKLSAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICBwc19kZWMtPmFFbnZTdGFydFN0b3BbZW52XSA9IHRocjsKLSAgICAgICAgICAgIH0KLSAgICAgICAgICAgIGVsc2UKLSAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICB0aHIgPSBwc19kZWMtPmFFbnZTdGFydFN0b3BbZW52LTFdICsgMTsKLQotICAgICAgICAgICAgICAgIGlmIChwc19kZWMtPmFFbnZTdGFydFN0b3BbZW52XSA8IHRocikKLSAgICAgICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgICAgIHBzX2RlYy0+YUVudlN0YXJ0U3RvcFtlbnZdID0gdGhyOwotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgIH0KLS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0lQRF9NQVNLICAgICAgICAgICAgICAgICAoIDB4MDAwMDEwMDAgKQotI2RlZmluZSBOT19CSU5TICAgICAgICAgICAgICAgICAgICAgICAgICggMjAgKQotI2RlZmluZSBOT19ISV9SRVNfQklOUyAgICAgICAgICAgICAgICAgICggMzQgKQotI2RlZmluZSBOT19MT1dfUkVTX0JJTlMgICAgICAgICAgICAgICAgICggTk9fSUlEX0JJTlMgLyAyICkKLSNkZWZpbmUgTk9fSUlEX0JJTlMgICAgICAgICAgICAgICAgICAgICAoIE5PX0JJTlMgKQotI2RlZmluZSBOT19JQ0NfQklOUyAgICAgICAgICAgICAgICAgICAgICggTk9fQklOUyApCi0jZGVmaW5lIE5PX0xPV19SRVNfSUlEX0JJTlMgICAgICAgICAgICAgKCBOT19MT1dfUkVTX0JJTlMgKQotI2RlZmluZSBOT19MT1dfUkVTX0lDQ19CSU5TICAgICAgICAgICAgICggTk9fTE9XX1JFU19CSU5TICkKLSNkZWZpbmUgU1VCUU1GX0dST1VQUyAgICAgICAgICAgICAgICAgICAoIDEwICkKLSNkZWZpbmUgUU1GX0dST1VQUyAgICAgICAgICAgICAgICAgICAgICAoIDEyICkKLSNkZWZpbmUgTk9fSUlEX0dST1VQUyAgICAgICAgICAgICAgICAgICAoIFNVQlFNRl9HUk9VUFMgKyBRTUZfR1JPVVBTICkKLSNkZWZpbmUgTk9fSUlEX1NURVBTICAgICAgICAgICAgICAgICAgICAoIDcgKQotI2RlZmluZSBOT19JSURfU1RFUFNfRklORSAgICAgICAgICAgICAgICggMTUgKQotI2RlZmluZSBOT19JQ0NfU1RFUFMgICAgICAgICAgICAgICAgICAgICggOCApCi0jZGVmaW5lIE5PX0lJRF9MRVZFTFMgICAgICAgICAgICAgICAgICAgKCAyICogTk9fSUlEX1NURVBTICsgMSApCi0jZGVmaW5lIE5PX0lJRF9MRVZFTFNfRklORSAgICAgICAgICAgICAgKCAyICogTk9fSUlEX1NURVBTX0ZJTkUgKyAxICkKLSNkZWZpbmUgTk9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EludDMyIG1pbklkeCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgIEludDMyIG1heElkeCkKLXsKLSAgICBJbnQzMiBpOwotICAgIEludDMyICpwdHJfYUluZGV4OwotCi0gICAgaWYgKGVuYWJsZSA9PSAxKQotICAgIHsKLSAgICAgICAgcHRyX2FJbmRleCA9IGFJbmRleDsKLQotICAgICAgICBpZiAoRHREZiA9PSAwKQotICAgICAgICB7Ci0gICAgICAgICAgICAqKHB0cl9hSW5kZXgpID0gbGltaXRNaW5NYXgoKnB0cl9hSW5kZXgsIG1pbklkeCwgbWF4SWR4KTsKLSAgICAgICAgICAgIHB0cl9hSW5kZXgrKzsKLQotICAgICAgICAgICAgZm9yIChpID0gMTsgaSA8IG5yRWxlbWVudHM7IGkrKykKLSAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAqKHB0cl9hSW5kZXgpID0gbGltaXRNaW5NYXgoYUluZGV4W2ktMV0gKyAqcHRyX2FJbmRleCwgbWluSWR4LCBtYXhJZHgpOwotICAgICAgICAgICAgICAgIHB0cl9hSW5kZXgrKzsKLSAgICAgICAgICAgIH0KLSAgICAgICAgfQotICAgICAgICBlbHNlCi0gICAgICAgIHsKLSAgICAgICAgICAgIGlmIChzdHJpZGUgPT0gMSkKLSAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICBmb3IgKGkgPSAwOyBpIDwgbnJFbGVtZW50czsgaSsrKQotICAgICAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAgICAgKihwdHJfYUluZGV4KSA9IGxpbWl0TWluTWF4KGFQcmV2RnJhbWVJbmRleFtpXSArICpwdHJfYUluZGV4LCBtaW5JZHgsIG1heElkeCk7Ci0gICAgICAgICAgICAgICAgICAgIHB0cl9hSW5kZXgrKzsKLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICB9Ci0gICAgICAgICAgICBlbHNlCi0gICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgZm9yIChpID0gMDsgaSA8IG5yR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3ksIG4gdGltZSBpbmRleAotCi0KLSAgICAgX19fX19fXyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBfX19fX19fXwotICAgIHwgICAgICAgfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBfX19fX19fICAgfCAgICAgICAgfAotICAtPnxIeWJyaWQgfCBMRiAtLS0tICAgICAgICAgICAgICAgICAgICAgICAgIHwgICAgICAgfC0+fCBIeWJyaWQgfC0tPgotICAgIHwgQW5hbC4gfCAgICAgICAgfCAgICAgICAgICAgICAgICAgICAgICAgIHwgICAgICAgfCAgfCBTeW50aCAgfCAgIFFNRiAtPiBMCi0gICAgIC0tLS0tLS0gICAgICAgICBvLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0+fCAgICAgICB8ICAgLS0tLS0tLS0gICAgU3ludGgKLVFNRiAgICAgICAgICAgICAgICAgIHwgICAgICAgICAgICAgICAgc19rKG4pICB8U3RlcmVvIHwtLS0tLS0tLS0tLS0tLT4KLUFuYWwuICAgICAgICAgICAgICAtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLT58ICAgICAgIHwKLSAgICAgX19fX19fXyAgICAgICB8IHwgICAgICAgICAgICAgICAgICAgICAgICB8ICAgICAgIHwgICBfX19fX19fXwotICAgIHwgICAgICAgfCBIRiAtLW8gfCAgIC0tLS0tLS0tLS0tICAgICAgICAgIHxQcm9jZXNzfCAgfCAgICAgICAgfAotICAtPnwgRGVsYXkgfCAgICAgIHwgIC0+fCAgICAgICAgICAgfC0tLS0tLS0tPnwgICAgICAgfC0+fCBIeWJyaWQgfC0tPgotICAgICAtLS0tLS0tICAgICAgIHwgICAgfGRlY29ycmVsYXRlfCBkX2sobikgIHwgICAgICAgfCAgfCBTeW50aCAgfCAgIFFNRiAtPiBSCi0gICAgICAgICAgICAgICAgICAgLS0tLT58ICAgICAgICAgICB8LS0tLS0tLS0+fCAgICAgICB8ICAgLS0tLS0tLS0gICAgU3ludGgKLSAgIC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xheUJ1ZkluZGV4XTsKLSAgICAgICAgcHRfaVRtcCA9ICZwcEltYWdEZWxheUJ1ZmZlcltzYl1baF9wc19kZWMtPmRlbGF5QnVmSW5kZXhdOwotCi0gICAgICAgIHRtcDEgPSBhTGVmdFJlYWxbc2JdOwotICAgICAgICB0bXAyID0gYUxlZnRJbWFnW3NiXTsKLSAgICAgICAgckluID0gKnB0X3JUbXAgPj4gMTsKLSAgICAgICAgaUluID0gKnB0X2lUbXAgPj4gMTsKLQotCi0gICAgICAgICpwdF9yVG1wID0gdG1wMTsKLSAgICAgICAgKnB0X2lUbXAgPSB0bXAyOwotCi0gICAgICAgIC8qCi0gICAgICAgICAqICBGcmFjdGlvbmFsIGRlbGF5IHZlY3RvcgotICAgICAgICAgKgotICAgICAgICAgKiAgcGhpX2ZyYWN0KGspID0gZXhwKC1qKnBpKnFfcGhpKmZfY2VudGVyKGspKSAgICAgICAwPD0gayA8PSBTVUJRTUZfR1JPVVBTCi0gICAgICAgICAqCi0gICAgICAgICAqICBxX3BoaSA9IDAuMzkKLSAgICAgICAgICogIGZfY2VudGVyKGspIGZyZXF1ZW5jeSB2ZWN0b3IKLSAgICAgICAgICovCi0KLSAgICAgICAgY21wbHggPSAgYUZyYWN0RGVsYXlQaGFzZUZhY3RvclN1YlFtZltzYl07Ci0KLSAgICAgICAgYVJpZ2h0UmVhbFtzYl0gID0gY21wbHhfbXVsMzJfYnlfMTYockluLCAtaUluLCBjbXBseCk7Ci0gICAgICAgIGFSaWdodEltYWdbc2JdICA9IGNtcGx4X211bDMyX2J5XzE2KGlJbiwgIHJJbiwgY21wbHgpOwotCi0gICAgICAgIHBzX2FsbF9wYXNzX2ZyYWN0X2RlbGF5X2ZpbHRlcl90eXBlX0koaF9wc19kZWMtPmFEZWxheVJCdWZJbmRleFNlciwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzYiwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwcEZyYWN0RGVsYXlQaGFzZUZhY3RvclNlcltzYl0sCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcHBwUmVhbERlbGF5UkJ1ZmZlclNlciwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwcHBJbWFnRGVsYXlSQnVmZmVyU2VyLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICZhUmlnaHRSZWFsW3NiXSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmYVJpZ2h0SW1hZ1tzYl0pOwotCi0gICAgICAgIGJpbiA9IGJpbnMyZ3JvdXBNYXBbZ3JdOwotICAgICAgICByVG1wID0gYVRyYW5zUmF0aW9bYmluXTsKLQotICAgICAgICBpZiAoclRtcCAhPSAweDdGRkZGRkZGKQotICAgICAgICB7Ci0gICAgICAgICAgICBhUmlnaHRSZWFsW3NiXSA9IGZ4cF9tdWwzMl9RMzEoclRtcCwgYVJpZ2h0UmVhbFtzYl0pIDw8IDE7Ci0gICAgICAgICAgICBhUmlnaHRJbWFnW3NiXSA9IGZ4cF9tdWwzMl9RMzEoclRtcCwgYVJpZ2h0SW1hZ1tzYl0pIDw8IDE7Ci0gICAgICAgIH0KLQotCi0gICAgfSAvKiBnciAqLwotCi0gICAgYUxlZnRSZWFsID0gckludEJ1ZmZlckxlZnQ7Ci0gICAgYUxlZnRJbWFnID0gaUludEJ1ZmZlckxlZnQ7Ci0gICAgYVJpZ2h0UmVhbCA9IHJJbnRCdWZmZXJSaWdodDsKLSAgICBhUmlnaHRJbWFnID0gaUludEJ1ZmZlclJpZ2h0OwotCi0gICAgcHBwUmVhbERlbGF5UkJ1ZmZlclNlciA9IGhfcHNfZGVjLT5hYWFSZWFsRGVsYXlSQnVmZmVyU2VyUW1mOwotICAgIHBwcEltYWdEZWxheVJCdWZmZXJTZXIgPSBoX3BzX2RlYy0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i0gICAgICAgICAgICBwdF9yVG1wID0gJnBwUmVhbERlbGF5QnVmZmVyW3NiX2RlbGF5XVtoX3BzX2RlYy0+ZGVsYXlCdWZJbmRleF07Ci0gICAgICAgICAgICBwdF9pVG1wID0gJnBwSW1hZ0RlbGF5QnVmZmVyW3NiX2RlbGF5XVtoX3BzX2RlYy0+ZGVsYXlCdWZJbmRleF07Ci0KLSAgICAgICAgICAgIHJJbiA9ICpwdF9yVG1wID4+IDE7Ci0gICAgICAgICAgICBpSW4gPSAqcHRfaVRtcCA+PiAxOwotCi0gICAgICAgICAgICB0bXAxID0gYUxlZnRSZWFsW3NiXTsKLSAgICAgICAgICAgIHRtcDIgPSBhTGVmdEltYWdbc2JdOwotICAgICAgICAgICAgKnB0X3JUbXAgPSB0bXAxOwotICAgICAgICAgICAgKnB0X2lUbXAgPSB0bXAyOwotCi0gICAgICAgICAgICAvKgotICAgICAgICAgICAgICogIEZyYWN0aW9uYWwgZGVsYXkgdmVjdG9yCi0gICAgICAgICAgICAgKgotICAgICAgICAgICAgICogIHBoaV9mcmFjdChrKSA9IGV4cCgtaipwaSpxX3BoaSpmX2NlbnRlcihrKSkgICAgICAgMDw9IGsgPD0gU1VCUU1GX0dST1VQUwotICAgICAgICAgICAgICoKLSAgICAgICAgICAgICAqICBxX3BoaSA9IDAuMzkKLSAgICAgICAgICAgICAqICBmX2NlbnRlcihrKSBmcmVxdWVuY3kgdmVjdG9yCi0gICAgICAgICAgICAgKi8KLQotICAgICAgICAgICAgY21wbHggPSAgYUZyYWN0RGVsYXlQaGFzZUZhY3RvcltzYl9kZWxheV07Ci0gICAgICAgICAgICBhUmlnaHRSZWFsW3NiXSA9IGNtcGx4X211bDMyX2J5XzE2KHJJbiwgLWlJbiwgY21wbHgpOwotICAgICAgICAgICAgYVJpZ2h0SW1hZ1tzYl0gPSBjbXBseF9tdWwzMl9ieV8xNihpSW4sICBySW4sIGNtcGx4KTsKLQotICAgICAgICAgICAgcHNfYWxsX3Bhc3NfZnJhY3RfZGVsYXlfZmlsdGVyX3R5cGVfSUkoaF9wc19kZWMtPmFEZWxheVJCdWZJbmRleFNlciwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNiX2RlbGF5LAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcHBGcmFjdERlbGF5UGhhc2VGYWN0b3JTZXJbc2JfZGVsYXldLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcHBwUmVhbERlbGF5UkJ1ZmZlclNlciwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBwcEltYWdEZWxheVJCdWZmZXJTZXIsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmYVJpZ2h0UmVhbFtzYl0sCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmYVJpZ2h0SW1hZ1tzYl0sCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzYik7Ci0KLSAgICAgICAgICAgIHJUbXAgPSBhVHJhbnNSYXRpb1tnci0yXTsKLSAgICAgICAgICAgIGlmIChyVG1wICE9IDB4N0ZGRkZGRkYpCi0gICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgYVJpZ2h0UmVhbFtzYl0gPSBmeHBfbXVsMzJfUTMxKHJUbXAsIGFSaWdodFJlYWxbc2JdKSA8PCAxOwotICAgICAgICAgICAgICAgIGFSaWdodEltYWdbc2JdID0gZnhwX211bDMyX1EzMShyVG1wLCBhUmlnaHRJbWFnW3NiXSkgPDwgMTsKLSAgICAgICAgICAgIH0KLQotCi0gICAgICAgIH0gLyogc2IgKi8KLQotICAgIH0KLQotCi0gICAgbWF4c2IgPSBtaW4oaF9wc19kZWMtPnVzYiwgMzUpOyAgLyogIDM1ID09IGdyb3VwQm9yZGVyc1tOT19CSU5TICsgMV0gKi8KLQotICAgIC8qIHNiID0gc3ViUU1GL1FNRiBzdWJiYW5kICovCi0gICAgewotICAgICAgICBJbnQzMiBmYWN0b3IgPSBhVHJhbnNSYXRpb1tOT19CSU5TLTJdOwotCi0gICAgICAgIGZvciAoc2IgPSAyMzsgc2IgPCBtYXhzYjsgc2IrKykgICAgLyogIDIzID09IGdyb3VwQm9yZGVyc1tOT19CSU5TXSAqLwotICAgICAgICB7Ci0KLSAgICAgICAgICAgIEludDMyICB0bXAsIHRtcDI7Ci0gICAgICAgICAgICBJbnQzMiAqcHRfclRtcCwgKnB0X2lUbXA7Ci0KLSAgICAgICAgICAgIHNiX2RlbGF5ID0gc2IgLSBOT19RTUZfQ0hBTk5FTFNfSU5fSFlCUklEOyAgLyogID09IDMgKi8KLQotICAgICAgICAgICAgLyoKLSAgICAgICAgICAgICAqICBGb3IgdGhlIFVwcGVyIEJhbmRzIGFwcGx5IGRlbGF5IG9ubHkKLSAgICAgICAgICAgICAqICAgICAgICAgICAgICAgICAgICAgICAgICAtRChrKQotICAgICAgICAgICAgICogIEFwcGx5IERlbGF5ICAgSF9rKHopID0geiAgICAgICAgICwgRChrKSA9PSAxIG9yIDE0Ci0gICAgICAgICAgICAgKgotICAgICAgICAgICAgICovCi0gICAgICAgICAgICBJbnQzMiBrID0gc2IgLSBOT19BTExQQVNTX0NIQU5ORUxTOyAgLyogPT0gMjMgKi8KLQotCi0gICAgICAgICAgICBwdF9yVG1wID0gJnBwUmVhbERlbGF5QnVmZmVyW3NiX2RlbGF5XVtoX3BzX2RlYy0+YURlbGF5QnVmSW5kZXhbIGtdXTsKLSAgICAgICAgICAgIHB0X2lUbXAgPSAmcHBJbWFnRGVsYXlCdWZmZXJbc2JfZGVsYXldW2hfcHNfZGVjLT5hRGVsYXlCdWZJbmRleFsga11dOwotCi0gICAgICAgICAgICBpZiAoKytoX3BzX2RlYy0+YURlbGF5QnVmSW5kZXhbIGtdID49IExPTkdfREVMQVkpICAgICAvKiA9PSAxNCAqLwotICAgICAgICAgICAgewotICAgICAgICAgICAgICAgIGhfcHNfZGVjLT5hRGVsYXlCdWZJbmRleFsga10gPSAwOwotICAgICAgICAgICAgfQotCi0KLSAgICAgICAgICAgIHRtcCAgPSAqcHRfclRtcDsKLSAgICAgICAgICAgIHRtcDIgPSAqcHRfaVRtcDsKLQotICAgICAgICAgICAgaWYgKGFUcmFuc1JhdGlvW05PX0JJTlMtMl0gPCAweDdGRkZGRkZGKQotICAgICAgICAgICAgewotICAgICAgICAgICAgICAgIGFSaWdodFJlYWxbc2JdID0gZnhwX211bDMyX1EzMShmYWN0b3IsIHRtcCkgPDwgMTsKLSAgICAgICAgICAgICAgICBhUmlnaHRJbWFnW3NiXSA9IGZ4cF9tdWwzMl9RMzEoZmFjdG9yLCB0bXAyKSA8PCAxOwotICAgICAgICAgICAgfQotICAgICAgICAgICAgZWxzZQotICAgICAgICAgICAgewotICAgICAgICAgICAgICAgIGFSaWdodFJlYWxbc2JdID0gdG1wOwotICAgICAgICAgICAgICAgIGFSaWdodEltYWdbc2JdID0gdG1wMjsKLSAgICAgICAgICAgIH0KLQotCi0gICAgICAgICAgICB0bXAgID0gYUxlZnRSZWFsW3NiXTsKLSAgICAgICAgICAgIHRtcDIgPSBhTGVmdEltYWdbc2JdOwotICAgICAgICAgICAgKnB0X3JUbXAgPSB0bXA7Ci0gICAgICAgICAgICAqcHRfaVRtcCA9IHRtcDI7Ci0KLQotICAgICAgICB9IC8qIHNiICovCi0gICAgfQotCi0KLSAgICBtYXhzYiA9IG1pbihoX3BzX2RlYy0+dXNiLCA2NCk7ICAgICAvKiAgNjQgPT0gZ3JvdXBCb3JkZXJzW05PX0JJTlMrMl0gKi8KLQotICAgIC8qIHNiID0gc3ViUU1GL1FNRiBzdWJiYW5kICovCi0KLSAgICB7Ci0KLSAgICAgICAgZm9yIChzYiA9IDM1OyBzYiA8IG1heHNiOyBzYisrKSAgICAvKiAgMzUgPT0gZ3JvdXBCb3JkZXJzW05PX0JJTlMrMV0gKi8KLSAgICAgICAgewotCi0gICAgICAgICAgICBJbnQzMiAqcHRfclRtcCwgKnB0X2lUbXA7Ci0KLSAgICAgICAgICAgIHNiX2RlbGF5ID0gc2IgLSBOT19RTUZfQ0hBTk5FTFNfSU5fSFlCUklEOyAgLyogID09IDMgKi8KLQotICAgICAgICAgICAgLyoKLSAgICAgICAgICAgICAqICBGb3IgdGhlIFVwcGVyIEJhbmRzIGFwcGx5IGRlbGF5IG9ubHkKLSAgICAgICAgICAgICAqICAgICAgICAgICAgICAgICAgICAgICAgICAtRChrKQotICAgICAgICAgICAgICogIEFwcGx5IERlbGF5ICAgSF9rKHopID0geiAgICAgICAgICwgRChrKSA9PSAxIG9yIDE0Ci0gICAgICAgICAgICAgKgotICAgICAgICAgICAgICovCi0KLSAgICAgICAgICAgIHB0X3JUbXAgPSAmcHBSZWFsRGVsYXlCdWZmZXJbc2JfZGVsYXldWzBdOwotICAgICAgICAgICAgcHRfaVRtcCA9ICZwcEltYWdEZWxheUJ1ZmZlcltzYl9kZWxheV1bMF07Ci0KLSAgICAgICAgICAgIGFSaWdodFJlYWxbc2JdID0gKnB0X3JUbXA7Ci0gICAgICAgICAgICBhUmlnaHRJbWFnW3NiXSA9ICpwdF9pVG1wOwotCi0KLSAgICAgICAgICAgIGlmIChhVHJhbnNSYXRpb1tOT19CSU5TLTFdIDwgMHg3RkZGRkZGRikKLSAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICBhUmlnaHRSZWFsW3NiXSA9IGZ4cF9tdWwzMl9RMzEoYVRyYW5zUmF0aW9bTk9fQklOUy0xXSwgYVJpZ2h0UmVhbFtzYl0pIDw8IDE7Ci0gICAgICAgICAgICAgICAgYVJpZ2h0SW1hZ1tzYl0gPSBmeHBfbXVsMzJfUTMxKGFUcmFuc1JhdGlvW05PX0JJTlMtMV0sIGFSaWdodEltYWdbc2JdKSA8PCAxOwotICAgICAgICAgICAgfQotC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gZGVzaWduLgotCi0KLSAgIEluY3JlYXNlIEZyZXEuIFJlc29sdXRpb24KLSAgICAgX19fX19fXyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBfX19fX19fXwotICAgIHwgICAgICAgfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBfX19fX19fICAgfCAgICAgICAgfAotICAtPnxIeWJyaWQgfCBMRiAtLS0tICAgICAgICAgICAgICAgICAgICAgICAgIHwgICAgICAgfC0+fCBIeWJyaWQgfC0tPgotICAgIHwgQW5hbC4gfCAgICAgICAgfCAgICAgICAgICAgICAgICAgICAgICAgIHwgICAgICAgfCAgfCBTeW50aCAgfCAgIFFNRiAtPiBMCi0gICAgIC0tLS0tLS0gICAgICAgICBvLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0+fCAgICAgICB8ICAgLS0tLS0tLS0gICAgU3ludGgKLVFNRiAgICAgICAgICAgICAgICAgIHwgICAgICAgICAgICAgICAgc19rKG4pICB8U3RlcmVvIHwtLS0tLS0tLS0tLS0tLT4KLUFuYWwuICAgICAgICAgICAgICAtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLT58ICAgICAgIHwKLSAgICAgX19fX19fXyAgICAgICB8IHwgICAgICAgICAgICAgICAgICAgICAgICB8ICAgICAgIHwgICBfX19fX19fXwotICAgIHwgICAgICAgfCBIRiAtLW8gfCAgIC0tLS0tLS0tLS0tICAgICAgICAgIHxQcm9jZXNzfCAgfCAgICAgICAgfAotICAtPnwgRGVsYXkgfCAgICAgIHwgIC0+fCAgICAgICAgICAgfC0tLS0tLS0tPnwgICAgICAgfC0+fCBIeWJyaWQgfC0tPgotICAgICAtLS0tLS0tICAgICAgIHwgICAgfGRlY29ycmVsYXRlfCBkX2sobikgIHwgICAgICAgfCAgfCBTeW50aCAgfCAgIFFNRiAtPiBSCi0gICAgICAgICAgICAgICAgICAgLS0tLT58ICAgICAgICAgICB8LS0tLS0tLS0+fCAgICAgICB8ICAgLS0tLS0tLS0gICAgU3ludGgKLSAgICAgICAgICAgICAgICAgICAgICAgICAtLS0tLS0tLS0tLSAgICAgICAgICB8X19fX19fX3wtLS0tLS0tLS0tLS0tLT4KLQotCi0KLSAgICAgICAgICBzdWJiYW5kIGsgICAgICAgICAgICAgUU1GIGNoYW5uZWwKLSAgICAgICAgICAgICAwICAgLi4uLi4uLi4uLi4uLi4uLi4gIDAgICAgICAtLS0tLS0tLS0tLQotICAgICAgICAgICAgIDEgICAuLi4uLi4uLi4uLi4uLi4uLiAgMAotICAgICAgICAgICAgIDIgICAuLi4uLi4uLi4uLi4uLi4uLiAgMAotICAgICAgICAgICAgIDMgICAuLi4uLi4uLi4uLi4uLi4uLiAgMAotICAgICAgICAgICAgIDQgICAuLi4uLi4uLi4uLi4uLi4uLiAgMAotICAgICAgICAgICAgIDUgICAuLi4uLi4uLi4uLi4uLi4uLiAgMCAgICAgICAgU3ViLVFNRiAgKCBJbmNyZWFzZSBGcmVxLiBSZXNvbHV0aW9uKQotICAgICAgICAgICAgIDYgICAuLi4uLi4uLi4uLi4uLi4uLiAgMQotICAgICAgICAgICAgIDcgICAuLi4uLi4uLi4uLi4uLi4uLiAgMQotICAgICAgICAgICAgIDggICAuLi4uLi4uLi4uLi4uLi4uLiAgMgotICAgICAgICAgICAgIDkgICAuLi4uLi4uLi4uLi4uLi4uLiAgMgotICAgICAgICAgICAgMTAgICAuLi4uLi4uLi4uLi4uLi4uLiAgMyAgICAgIC0tLS0tLS0tLS0tCi0gICAgICAgICAgICAxMSAgIC4uLi4uLi4uLi4uLi4uLi4uICA0Ci0gICAgICAgICAgICAxMiAgIC4uLi4uLi4uLi4uLi4uLi4uICA1Ci0gICAgICAgICAgICAxMyAgIC4uLi4uLi4uLi4uLi4uLi4uICA2Ci0gICAgICAgICAgICAxNCAgIC4uLi4uLi4uLi4uLi4uLi4uICA3Ci0gICAgICAgICAgICAxNSAgIC4uLi4uLi4uLi4uLi4uLi4uICA4ICAgICAgICAgUU1G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AgICAgICAgICAgICAgICAgICAgcHRyX21IeWJyaWRfUmUsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwdHJfbUh5YnJpZF9JbSk7Ci0gICAgICAgICAgICAgICAgY2hPZmZzZXQgKz0gMjsKLQotICAgICAgICAgICAgICAgIGJyZWFrOwotCi0gICAgICAgICAgICAgICAgLyoKLSAgICAgICAgICAgICAgICAgKiAgRm9yIFFNRiBiYW5kID0gMAotICAgICAgICAgICAgICAgICAqLwotCi0gICAgICAgICAgICBjYXNlIEhZQlJJRF84X0NQTFg6Ci0KLSAgICAgICAgICAgICAgICBlaWdodF9jaF9maWx0ZXJpbmcocHRfbVFtZkJ1ZmZlclJlYWwsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHB0X21RbWZCdWZmZXJJbWFnLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwSHlicmlkLT5tVGVtcFJlYWwsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBIeWJyaWQtPm1UZW1wSW1hZywKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2NyYXRjaF9tZW0pOwotCi0gICAgICAgICAgICAgICAgcHZfbWVtbW92ZShwdHJfbUh5YnJpZF9SZSwgcEh5YnJpZC0+bVRlbXBSZWFsLCA0KnNpemVvZigqcEh5YnJpZC0+bVRlbXBSZWFsKSk7Ci0KLSAgICAgICAgICAgICAgICBwdHJfbUh5YnJpZF9SZSArPSAyOwotCi0gICAgICAgICAgICAgICAgKihwdHJfbUh5YnJpZF9SZSsrKSArPSAgcEh5YnJpZC0+bVRlbXBSZWFsWzVdOwotICAgICAgICAgICAgICAgICoocHRyX21IeWJyaWRfUmUrKykgKz0gIHBIeWJyaWQtPm1UZW1wUmVhbFs0XTsKLSAgICAgICAgICAgICAgICAqKHB0cl9tSHlicmlkX1JlKyspICA9ICBwSHlicmlkLT5tVGVtcFJlYWxbNl07Ci0gICAgICAgICAgICAgICA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i0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBJbnQzMiAqKnBQdHIpCi17Ci0gICAgSW50MzIgaTsKLSAgICBJbnQzMiB0bXA7Ci0gICAgSW50MzIgbWF4Tm9DaGFubmVscyA9IDA7Ci0gICAgSFlCUklEICpoczsKLSAgICBJbnQzMiAqcHRyID0gKnBQdHI7Ci0KLQotICAgICpwaEh5YnJpZCA9IChIWUJSSUQgKilOVUxMOwotCi0gICAgaHMgPSAoSFlCUklEICopcHRyOwotCi0gICAgcHRyICs9IHNpemVvZihIWUJSSUQpIC8gc2l6ZW9mKCpwdHIpOwotCi0gICAgaHMtPnBSZXNvbHV0aW9uID0gKEludDMyKilwdHI7Ci0KLSAgICBwdHIgKz0gbm9CYW5kcyAqIHNpemVvZihJbnQzMikgLyBzaXplb2YoKnB0cik7Ci0KLSAgICBmb3IgKGkgPSAwOyBpIDwgbm9CYW5kczsgaSsrKQotICAgIHsKLQotICAgICAgICBocy0+cFJlc29sdXRpb25baV0gPSBwUmVzb2x1dGlvbltpXTsKLQotICAgICAgICBpZiAocFJlc29sdXRpb25baV0gIT0gSFlCUklEXzhfQ1BMWCAmJgotICAgICAgICAgICAgICAgIHBSZXNvbHV0aW9uW2ldICE9IEhZQlJJRF8yX1JFQUwgJiYKLSAgICAgICAgICAgICAgICBwUmVzb2x1dGlvbltpXSAhPSBIWUJSSURfNF9DUExYKQotICAgICAgICB7Ci0gICAgICAgICAgICByZXR1cm4gMTsKLSAgICAgICAgfQotCi0gICAgICAgIGlmIChwUmVzb2x1dGlvbltpXSA+IG1heE5vQ2hhbm5lbHMpCi0gICAgICAgIHsKLSAgICAgICAgICAgIG1heE5vQ2hhbm5lbHMgPSBwUmVzb2x1dGlvbltpXTsKLSAgICAgICAgfQotICAgIH0KLQotICAgIGhzLT5uUW1mQmFuZHMgICAgID0gbm9CYW5kczsKLSAgICBocy0+cW1mQnVmZmVyTW92ZSA9IEhZQlJJRF9GSUxURVJfTEVOR1RIIC0g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tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLQotICovCi0vKgotCi0gRmlsZW5hbWU6IHBzX2h5YnJpZF9zeW50aGVzaXMuYwotCi0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0KLSBSRVZJU0lPTiBISVNUT1JZCi0KLQotIFdobzogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIERhdGU6IE1NL0REL1lZWVkKLSBEZXNjcmlwdGlvbjoKLQotLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tCi0gSU5QVVQgQU5EIE9VVFBVVCBERUZJTklUSU9OUwotCi0KLQotLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tCi0gRlVOQ1RJT04gREVTQ1JJUFRJT04KLQotICAgICAgICBIeWJyaWQgc3ludGhlc2lzCi0KLSAgICAgX19fX19fXyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBfX19fX19fXwotICAgIHwgICAgICAgfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBfX19fX19fICAgfCAgICAgICAgfAotICAtPnxIeWJyaWQgfCBMRiAtLS0tICAgICAgICAgICAgICAgICAgICAgICAgIHwgICAgICAgfC0+fCBIeWJyaWQgfC0tPgotICAgIHwgQW5hbC4gfCAgICAgICAgfCAgICAgICAgICAgICAgICAgICAgICAgIHwgICAgICAgfCAgfCBTeW50aCAgfCAgIFFNRiAtPiBMCi0gICAgIC0tLS0tLS0gICAgICAgICBvLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0+fCAgICAg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HNpbl9iZXRhOwotICAgIEludDMyICAgdGVtcDE7Ci0gICAgSW50MzIgICB0ZW1wMjsKLSAgICBJbnQzMiAgICpwdHJfdG1wOwotICAgIEludDMyICAgaDExOwotICAgIEludDMyICAgaDEyOwotICAgIEludDMyICAgaDIxOwotICAgIEludDMyICAgaDIyOwotCi0gICAgaWYgKHBtcy0+YkZpbmVJaWRRKQotICAgIHsKLSAgICAgICAgbm9JaWRTdGVwcyA9IE5PX0lJRF9TVEVQU19GSU5FOyAgICAgLyogIE5PX0lJRF9TVEVQU19GSU5FID09IDE1ICAqLwotICAgICAgICBwU2NhbGVGYWN0b3JzID0gc2NhbGVGYWN0b3JzRmluZTsKLSAgICB9Ci0gICAgZWxzZQotICAgIHsKLSAgICAgICAgbm9JaWRTdGVwcyA9IE5PX0lJRF9TVEVQUzsgICAgICAgICAgLyogIE5PX0lJRF9TVEVQUyA9PSA3ICAgKi8KLSAgICAgICAgcFNjYWxlRmFjdG9ycyA9IHNjYWxlRmFjdG9yczsKLSAgICB9Ci0KLSAgICBpZiAoZW52ID09IDApCi0gICAgewotICAgICAgICBwbXMtPmxhc3RVc2IgPSBwbXMtPnVzYjsKLSAgICAgICAgcG1zLT51c2IgPSB1c2I7Ci0gICAgICAgIGlmICh1c2IgIT0gcG1zLT5sYXN0VXNiICYmIHBtcy0+bGFzdFVzYiAhPSAwKQotICAgICAgICB7Ci0gICAgICAgICAgICByZXR1cm4oLTEpOwotCi0gICAgICAgIH0KLSAgICB9Ci0KLSAgICBpbnZFbnZMZW5ndGggPSAgcG1zLT5hRW52U3RhcnRTdG9wW2VudiArIDFdIC0gcG1zLT5hRW52U3RhcnRTdG9wW2Vudl07Ci0KLSAgICBpZiAoaW52RW52TGVuZ3RoID09IChJbnQzMikgcG1zLT5ub1N1YlNhbXBsZXMpCi0gICAgewotICAgICAgICBpbnZFbnZMZW5ndGggPSBwbXMtPmludk5vU3ViU2FtcGxlczsKLSAgICB9Ci0gICAgZWxzZQotICAgIHsKLSAgICAgICAgaW52RW52TGVuZ3RoID0gUTMwX2ZtdCgxLjBmKSAvIGludkVudkxlbmd0aDsKLSAgICB9Ci0KLSAgICBpZiAoaW52RW52TGVuZ3RoID09IDMyKSAgICAgLyogIG1vcmUgbGlrZWx5IHZhbHVlICAqLwotICAgIHsKLSAgICAgICAgZm9yIChncm91cCA9IDA7IGdyb3VwIDwgTk9fSUlEX0dST1VQUzsgZ3JvdXArKykgICAgICAvKiA9PSAyMiAqLwotICAgICAgICB7Ci0gICAgICAgICAgICBiaW4gPSBiaW5zMmdyb3VwTWFwW2dyb3VwXTsKLQotICAgICAgICAgICAgLyoKLSAgICAgICAgICAgICAqICBjKGIpID0gMTBeKGlpZChiKS8yMCkKLSAgICAgICAgICAgICAqLwotCi0gICAgICAgICAgICB0bXAgPSBwbXMtPmFhSWlkSW5kZXhbZW52XVtiaW5dOwotCi0gICAgICAgICAgICAvKgotICAgICAgICAgICAgICogIEludGVuc2l0eSBkaWZmZXJlbmNlcwotICAgICAgICAgICAgICoKLSAgICAgICAgICAgICAqICAgICAgICAgICAgICAgICAgc3FydCgyKQotICAgICAgICAgICAgICogICBjXzEoYikgPSAtLS0tLS0tLS0tLS0tLS0tCi0gICAgICAgICAgICAgKiAgICAgICAgICAgIHNxcnQoIDEgKyBjXjIoYikpCi0gICAgICAgICAgICAgKgotICAgICAgICAgICAgICovCi0gICAgICAgICAgICBzY2FsZVIgPSBwU2NhbGVGYWN0b3JzW25vSWlkU3RlcHMgKyB0bXBdOwotCi0gICAgICAgICAgICAvKgotICAgICAgICAgICAgICogICAgICAgICAgICAgICBzcXJ0KDIpKmMoYikKLSAgICAgICAgICAgICAqICAgY18yKGIpID0gLS0tLS0tLS0tLS0tLS0tLQotICAgICAgICAgICAgICogICAgICAgICAgICBzcXJ0KCAxICsgY14yKGIpKQotICAgICAgICAgICAgICoKLSAgICAgICAgICAgICAqLwotCi0gICAgICAgICAgICBzY2FsZUwgPSBwU2NhbGVGYWN0b3JzW25vSWlkU3RlcHMgLSB0bXBdOwotCi0KLSAgICAgICAgICAgIC8qCi0gICAgICAgICAgICAgKiAgYWxwaGEoYikgPSAoMS8yKSphcmNjb3MoIGdhbW1hKGIpKQotICAgICAgICAgICAgICovCi0gICAgICAgICAgICB0bXAgPSBwbXMtPmFhSWNjSW5kZXhbZW52XVtiaW5dOwotCi0gICAgICAgICAgICBjb3NfYWxwaGEgPSBjb3NfYWxwaGFzWyB0bXBdOwotICAgICAgICAgICAgc2luX2FscGhhID0gc2luX2FscGhhc1sgdG1wXTsKLQotICAgICAgICAgICAgLyoKLSAgICAgICAgICAgICAqICAgYmV0YShiKSA9IGFscGhhKGIpL3NxcnQoMikqKCBjXzEoYikgLSBjXzIoYikpCi0gICAgICAgICAgICAgKi8KLQotICAgICAgICAgICAgYmV0YSAgID0gZnhwX211bDMyX1EzMChzY2FsZWRfYWxwaGFzWyB0bXBdLCAoc2NhbGVSIC0gc2NhbGVMKSk7Ci0KLSAgICAgICAgICAgIGNvc19iZXRhID0gcHZfY29zaW5lKGJldGEpOwotICAgICAgICAgICAgc2luX2JldGEgPSBwdl9zaW5lKGJldGEpOwotCi0gICAgICAgICAgICB0ZW1wMSA9IGZ4cF9tdWwzMl9RMzAoY29zX2JldGEsIGNvc19hbHBoYSk7Ci0gICAgICAgICAgICB0ZW1wMiA9IGZ4cF9tdWwzMl9RMzAoc2luX2JldGEsIHNpbl9hbHBoYSk7Ci0KLQotICAgICAgICAgICAgLyoKLSAgICAgICAgICAgICAqICBoMTEoYikgPSBjb3MoIGFscGhhKGIpICsgIGJldGEoYikpKiBjXzIoYikKLSAgICAgICAgICAgICAqICBoMTIoYikgPSBjb3MoICBiZXRhKGIpIC0gYWxwaGEoYikpKiBjXzEoYikKLSAgICAgICAgICAgICAqLwotCi0gICAgICAgICAgICBoMTEgPSBmeHBfbXVsMzJfUTMwKHNjYWxlTCwgKHRlbXAxIC0gdGVtcDIpKTsKLSAgICAgICAgICAgIGgxMiA9IGZ4cF9tdWwzMl9RMzAoc2NhbGVSLCAodGVtcDEgKyB0ZW1wMikpOwotCi0gICAgICAgICAgICB0ZW1wMSA9IGZ4cF9tdWwzMl9RMzAoc2luX2JldGEsIGNvc19hbHBoYSk7Ci0gICAgICAgICAgICB0ZW1wMiA9IGZ4cF9tdWwzMl9RMzAoY29zX2JldGEsIHNpbl9hbHBoYSk7Ci0KLSAgICAgICAgICAgIC8qCi0gICAgICAgICAgICAgKiAgaDIxKGIpID0gc2luKCBhbHBoYShiKSArICBiZXRhKGIpKSogY18yKGIpCi0gICAgICAgICAgICAgKiAgaDIyKGIpID0gc2luKCAgYmV0YShiKSAtIGFscGhhKGIpKSogY18xKGIpCi0gICAgICAgICAgICAgKi8KLQotICAgICAgICAgICAgaDIxID0gZnhwX211bDMyX1EzMChzY2FsZUwsICh0ZW1wMSArIHRlbXAyKSk7Ci0gICAgICAgICAgICBoMjIgPSBmeHBfbXVsMzJfUTMwKHNjYWxlUiwgKHRlbXAxIC0gdGVtcDIpKTsKLQotCi0gICAgICAgICAgICAvKgotICAgICAgICAgICAgICogICBMaW5lYXIgaW50ZXJwb2xhdGlvbgotICAgICAgICAgICAgICoKLSAgICAgICAgICAgICAqICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgSGlqKGssIG5fZSsxKSAtIEhpaihrLCBuX2UpCi0gICAgICAgICAgICAgKiAgICBIaWooayxuKSA9IEhpaihrLCBuX2UpICsgKG4gLSBuX2UpKi0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLQotICAgICAgICAgICAgICogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbl9lKzEgLSBuX2UKLSAgICAgICAgICAgICAqLwotCi0gICAgICAgICAgICBwdHJfdG1wID0gJnBtcy0+aDExUHJldltncm91cF07Ci0gICAgICAgICAgICBwbXMtPkgxMVtncm91cF0gICAgICAgPSAqcHRyX3RtcDsKLSAgICAgICAgICAgIHBtcy0+ZGVsdGFIMTFbZ3JvdXBdICA9IChoMTEgLSAqcHRyX3RtcCkgPj4gNTsKLSAgICAgICAgICAgICpwdHJfdG1wICAgICAgICAgICAgICA9IGgxMTsKLQotICAgICAgICAgICAgcHRyX3RtcCA9ICZwbXMtPmgxMlByZXZbZ3JvdXBdOwotICAgICAgICAgICAgcG1zLT5IMTJbZ3JvdXBdICAgICAgID0gKnB0cl90bXA7Ci0gICAgICAgICAgICBwbXMtPmRlbHRhSDEyW2dyb3VwXSAgPSAoaDEyIC0gKnB0cl90bXApID4+IDU7Ci0gICAgICAgICAgICAqcHRyX3RtcCAgICAgICAgICAgICAgPSBoMTI7Ci0KLSAgICAgICAgICAgIHB0cl90bXAgPSAmcG1zLT5oMjFQcmV2W2dyb3VwXTsKLSAgICAgICAgICAgIHBtcy0+SDIxW2dyb3VwXSAgICAgICA9ICpwdHJfdG1wOwotICAgICAgICAgICAgcG1zLT5kZWx0YUgyMVtncm91cF0gID0gKGgyMSAtICpwdHJfdG1wKSA+PiA1OwotICAgICAgICAgICAgKnB0cl90bXAgICAgICAgICAgICAgID0gaDIxOwotCi0gICAgICAgICAgICBwdHJfdG1wID0gJnBtcy0+aDIyUHJldltncm91cF07Ci0gICAgICAgICAgICBwbXMtPkgyMltncm91cF0gICAgICAgPSAqcHRyX3RtcDsKLSAgICAgICAgICAgIHBtcy0+ZGVsdGFIMjJbZ3JvdXBdICA9IChoMjIgLSAqcHRyX3RtcCkgPj4gNTsKLSAgICAgICAgICAgICpwdHJfdG1wICAgICAgICAgICAgICA9IGgyMjsKLQotCi0gICAgICAgIH0gLyogZ3JvdXBzIGxvb3AgKi8KLSAgICB9Ci0gICAgZWxzZQotICAgIHsKLQotICAgICAgICBmb3IgKGdyb3VwID0gMDsgZ3JvdXAgPCBOT19JSURfR1JPVVBTOyBncm91cCsrKSAgICAgIC8qID09IDIyICovCi0gICAgICAgIHsKLSAgICAgICAgICAgIGJpbiA9IGJpbnMyZ3JvdXBNYXBbZ3JvdXBdOwotCi0gICAgICAgICAgICAvKgotICAgICAgICAgICAgICogIGMoYikgPSAxMF4oaWlkKGIpLzIwKQotICAgICAgICAgICAgICovCi0KLSAgICAgICAgICAgIHRtcCA9IHBtcy0+YWFJaWRJbmRleFtlbnZdW2Jpbl07Ci0KLSAgICAgICAgICAgIC8qCi0gICAgICAgICAgICAgKiAgSW50ZW5zaXR5IGRpZmZlcmVuY2VzCi0gICAgICAgICAgICAgKgotICAgICAgICAgICAgICogICAgICAgICAgICAgICAgICBzcXJ0KDIpCi0gICAgICAgICAgICAgKiAgIGNfMShiKSA9IC0tLS0tLS0tLS0tLS0tLS0KLSAgICAgICAgICAgICAqICAgICAgICAgICAgc3FydCggMSArIGNeMihiKSkKLSAgICAgICAgICAgICAqCi0gICAgICAgICAgICAgKi8KLSAgICAgICAgICAgIHNjYWxlUiA9IHBTY2FsZUZhY3RvcnNbbm9JaWRTdGVwcyArIHRtcF07Ci0KLSAgICAgICAgICAgIC8qCi0gICAgICAgICAgICAgKiAgICAgICAgICAgICAgIHNxcnQoMikqYyhiKQotICAgICAgICAgICAgICogICBjXzIoYikgPSAtLS0tLS0tLS0tLS0tLS0tCi0gICAgICAgICAgICAgKiAgICAgICAgICAgIHNxcnQoIDEgKyBjXjIoYikpCi0gICAgICAgICAgICAgKgotICAgICAgICAgICAgICovCi0KLSAgICAgICAgICAgIHNjYWxlTCA9IHBTY2FsZUZhY3RvcnNbbm9JaWRTdGVwcyAtIHRtcF07Ci0KLQotICAgICAgICAgICAgLyoKLSAgICAgICAgICAgICAqICBhbHBoYShiKSA9ICgxLzIpKmFyY2NvcyggZ2FtbWEoYikpCi0gICAgICAgICAgICAgKi8KLSAgICAgICAgICAgIHRtcCA9IHBtcy0+YWFJY2NJbmRleFtlbnZdW2Jpbl07Ci0KLSAgICAgICAgICAgIGNvc19hbHBoYSA9IGNvc19hbHBoYXNbIHRtcF07Ci0gICAgICAgICAgICBzaW5fYWxwaGEgPSBzaW5fYWxwaGFzWyB0bXBdOwotCi0gICAgICAgICAgICAvKgotICAgICAgICAgICAgICogICBiZXRhKGIpID0gYWxwaGEoYikvc3FydCgyKSooIGNfMShiKSAtIGNfMihiKSkKLSAgICAgICAgICAgICAqLwotCi0gICAgICAgICAgICBiZXRhICAgPSBmeHBfbXVsMzJfUTMwKHNjYWxlZF9hbHBoYXNbIHRtcF0sIChzY2FsZVIgLSBzY2FsZUwpKTsKLQotICAgICAgICAgICAgY29zX2JldGEgPSBwdl9jb3NpbmUoYmV0YSk7Ci0gICAgICAgICAgICBzaW5fYmV0YSA9IHB2X3NpbmUoYmV0YSk7Ci0KLSAgICAgICAgICAgIHRlbXAxID0gZnhwX211bDMyX1EzMChjb3NfYmV0YSwgY29zX2FscGhhKTsKLSAgICAgICAgICAgIHRlbXAyID0gZnhwX211bDMyX1EzMChzaW5fYmV0YSwgc2luX2FscGhhKTsKLQotCi0gICAgICAgICAgICAvKgotICAgICAgICAgICAgICogIGgxMShiKSA9IGNvcyggYWxwaGEoYikgKyAgYmV0YShiKSkqIGNfMihiKQotICAgICAgICAgICAgICogIGgxMihiKSA9IGNvcyggIGJldGEoYikgLSBhbHBoYShiKSkqIGNfMShiKQotICAgICAgICAgICAgICovCi0KLSAgICAgICAgICAgIGgxMSA9IGZ4cF9tdWwzMl9RMzAoc2NhbGVMLCAodGVtcDEgLSB0ZW1wMikpOwotICAgICAgICAgICAgaDEyID0gZnhwX211bDMyX1EzMChzY2FsZVIsICh0ZW1wMSArIHRlbXAyKSk7Ci0KLSAgICAgICAgICAgIHRlbXAxID0gZnhwX211bDMyX1EzMChzaW5fYmV0YSwgY29zX2FscGhhKTsKLSAgICAgICAgICAgIHRlbXAyID0gZnhwX211bDMyX1EzMChjb3NfYmV0YSwgc2luX2FscGhhKTsKLQotICAgICAgICAgICAgLyoKLSAgICAgICAgICAgICAqICBoMjEoYikgPSBzaW4oIGFscGhhKGIpICsgIGJldGEoYikpKiBjXzIoYikKLSAgICAgICAgICAgICAqICBoMjIoYikgPSBzaW4oICBiZXRhKGIpIC0gYWxwaGEoYikpKiBjXzEoYikKLSAgICAgICAgICAgICAqLwotCi0gICAgICAgICAgICBoMjEgPSBmeHBfbXVsMzJfUTMwKHNjYWxlTCwgKHRlbXAxICsgdGVtcDIpKTsKLSAgICAgICAgICAgIGgyMiA9IGZ4cF9tdWwzMl9RMzAoc2NhbGVSLCAodGVtcDEgLSB0ZW1wMikpOwotCi0KLSAgICAgICAgICAgIC8qCi0gICAgICAgICAgICAgKiAgIExpbmVhciBpbnRlcnBvbGF0aW9uCi0gICAgICAgICAgICAgKgotICAgICAgICAgICAgICogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBIaWooaywgbl9lKzEpIC0gSGlqKGssIG5fZSkKLSAgICAgICAgICAgICAqICAgIEhpaihrLG4pID0gSGlqKGssIG5fZSkgKyAobiAtIG5fZSkqLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tCi0gICAgICAgICAgICAgKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBuX2UrMSAtIG5fZQotICAgICAgICAgICAgICovCi0KLSAgICAgICAgICAgIHB0cl90bXAgPSAmcG1zLT5oMTFQcmV2W2dyb3VwXTsKLSAgICAgICAgICAgIHBtcy0+ZGVsdGFIMTFbZ3JvdXBdICA9IGZ4cF9tdWwzMl9RMzAoKGgxMSAtICpwdHJfdG1wKSwgaW52RW52TGVuZ3RoKTsKLSAgICAgICAgICAgIHBtcy0+SDExW2dyb3VwXSAgICAgICA9ICpwdHJfdG1wOwotICAgICAgICAgICAgKnB0cl90bXAgICAgICAgICAgICAgID0gaDExOwotCi0gICAgICAgICAgICBwdHJfdG1wID0gJnBtcy0+aDEyUHJldltncm91cF07Ci0gICAgICAgICAgICBwbXMtPmRlbHRhSDEyW2dyb3VwXSAgPSBmeHBfbXVsMzJfUTMwKChoMTIgLSAqcHRyX3RtcCksIGludkVudkxlbmd0aCk7Ci0gICAgICAgICAgICBwbXMtPkgxMltncm91cF0gICAgICAgPSAqcHRyX3Rtc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ZW50IHJlc3VsdDsKLQotICAgIEludDMyIG5yZzsKLSAgICBJbnQzMiAqcHRyX2FQcmV2TnJnOwotICAgIEludDMyIHBlYWtEaWZmOwotICAgIEludDMyICpwdHJfUHJldlBlYWtEaWZmOwotCi0KLSAgICBhTGVmdFJlYWwgPSBySW50QnVmZmVyTGVmdDsKLSAgICBhTGVmdEltYWcgPSBpSW50QnVmZmVyTGVmdDsKLQotICAgIC8qCi0gICAgICogIElucHV0IFBvd2VyIE1hdHJpeAotICAgICAqICAgICAgICAgICAgICAgICAgICAgICAgICAgIDIKLSAgICAgKiAgUG93ZXIoaSxuKSA9IFNVTSB8IHNfayhuKXwKLSAgICAgKiAgICAgICAgICAgICAgICBpCi0gICAgICovCi0KLSAgICBmb3IgKGdyID0gU1VCUU1GX0dST1VQUzsgZ3IgPCBOT19JSURfR1JPVVBTOyBncisrKSAvKiAxMCB0byAyMiAgKi8KLSAgICB7Ci0gICAgICAgIG1heHNiID0gbWluKGhfcHNfZGVjLT51c2IsIGdyb3VwQm9yZGVyc1sgZ3IrMV0pOwotCi0gICAgICAgIGFjY3UgPSAwOwotCi0gICAgICAgIGZvciAoc2IgPSBncm91cEJvcmRlcnNbZ3JdOyBzYiA8IG1heHNiOyBzYisrKQotICAgICAgICB7Ci0KLSAgICAgICAgICAgIHRlbXBfciA9IGFMZWZ0UmVhbFtzYl07Ci0gICAgICAgICAgICB0ZW1wX2kgPSBhTGVmdEltYWdbc2JdOwotICAgICAgICAgICAgYWNjdSA9ICBmeHBfbWFjMzJfUTMxKGFjY3UsIHRlbXBfciwgdGVtcF9yKTsKLSAgICAgICAgICAgIGFjY3UgPSAgZnhwX21hYzMyX1EzMShhY2N1LCB0ZW1wX2ksIHRlbXBfaSk7Ci0KLSAgICAgICAgfSAvKiBzYiAqLwotICAgICAgICBhUG93ZXJbZ3IgLSAyXSA9IGFjY3UgPj4gMTsKLSAgICB9IC8qIGdyICovCi0KLSAgICBhTGVmdFJlYWwgPSBoX3BzX2RlYy0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NjUsICAgMyB9LCAgICB7IC02MiwgICA0IH0sCi0gICAgeyAtNjYsICAgNSB9LCAgICB7IC02MSwgICA2IH0sICAgIHsgLTY3LCAgIDcgfSwgICAgeyAtNjAsICAgOCB9LAotICAgIHsgLTY4LCAgIDkgfSwgICAgeyAtNTksICAxMCB9LCAgICB7IC02OSwgIDExIH0sICAgIHsgLTU4LCAgMTIgfSwKLSAgICB7IC03MCwgIDEzIH0sICAgIHsgLTcxLCAtNTcgfQotfTsKLQotY29uc3QgQ2hhciBhQm9va1BzSWNjRnJlcURlY29kZVsxNF1bMl0gPQotewotICAgIHsgLTY0LCAgIDEgfSwgICAgeyAtNjMsICAgMiB9LCAgICB7IC02NSwgICAzIH0sICAgIHsgLTYyLCAgIDQgfSwKLSAgICB7IC02NiwgICA1IH0sICAgIHsgLTYxLCAgIDYgfSwgICAgeyAtNjcsICAgNyB9LCAgICB7IC02MCwgICA4IH0sCi0gICAgeyAtNTksICAgOSB9LCAgICB7IC02OCwgIDEwIH0sICAgIHsgLTU4LCAgMTEgfSwgICAgeyAtNjksICAxMiB9LAotICAgIHsgLTU3LCAgMTMgfSwgICAgeyAtNzAsIC03MSB9Ci19OwotCi1jb25zdCBDaGFyIGFCb29rUHNJaWRGaW5lVGltZURlY29kZVs2MF1bMl0gPQotewotICAgIHsgICAxLCAtNjQgfSwgICAgeyAtNjMsICAgMiB9LCAgICB7ICAgMywgLTY1IH0sICAgIHsgICA0LCAgNTkgfSwKLSAgICB7ICAgNSwgICA3IH0sICAgIHsgICA2LCAtNjcgfSwgICAgeyAtNjgsIC02MCB9LCAgICB7IC02MSwgICA4IH0sCi0gICAgeyAgIDksICAxMSB9LCAgICB7IC01OSwgIDEwIH0sICAgIHsgLTcwLCAtNTggfSwgICAgeyAgMTIsICA0MSB9LAotICAgIHsgIDEzLCAgMjAgfSwgICAgeyAgMTQsIC03MSB9LCAgICB7IC01NSwgIDE1IH0sICAgIHsgLTUzLCAgMTYgfSwKLSAgICB7ICAxNywgLT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gewotICAgICAgICAgICAgZHRGbGFnID0gYnVmX2dldF8xYml0KGhCaXRCdWYpOwotCi0gICAgICAgICAgICBpZiAoIWR0RmxhZykKLSAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICBpZiAocHNfZGVjLT5iRmluZUlpZFEpCi0gICAgICAgICAgICAgICAgewotICAgICAgICAgICAgICAgICAgICBDdXJyZW50VGFibGUgPSBhQm9va1BzSWlkRmluZUZyZXFEZWNvZGU7Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgIGVsc2UKLSAgICAgICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgICAgIEN1cnJlbnRUYWJsZSA9IGFCb29rUHNJaWRGcmVxRGVjb2RlOwotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgIH0KLSAgICAgICAgICAgIGVsc2UKLSAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICBpZiAocHNfZGVjLT5iRmluZUlpZFEpCi0gICAgICAgICAgICAgICAgewotICAgICAgICAgICAgICAgICAgICBDdXJyZW50VGFibGUgPSBhQm9va1BzSWlkRmluZVRpbWVEZWNvZGU7Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgIGVsc2UKLSAgICAgICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgICAgIEN1cnJlbnRUYWJsZSA9IGFCb29rUHNJaWRUaW1lRGVjb2RlOwotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgZm9yIChnciA9IDA7IGdyIDwgYU5vSWlkQmluc1twc19kZWMtPmZyZXFSZXNJaWRdOyBncisrKQotICAgICAgICAgICAgewotICAgICAgICAgICAgICAgIHBzX2RlYy0+YWFJaWRJbmRleFtlbnZdW2dyXSA9IHNicl9kZWNvZGVfaHVmZl9jdyhDdXJyZW50VGFibGUsIGhCaXRCdWYpOwotICAgICAgICAgICAgfQotCi0gICAgICAgICAgICBwc19kZWMtPmFiSWlkRHRGbGFnW2Vudl0gPSBkdEZsYWc7Ci0gICAgICAgIH0KLSAgICB9Ci0KLSAgICBpZiAocHNfZGVjLT5iRW5hYmxlSWNjKQotICAgIHsKLSAgICAgICAgZm9yIChlbnYgPSAwOyBlbnYgPCBwc19kZWMtPm5vRW52OyBlbnYrKykKLSAgICAgICAgewotICAgICAgICAgICAgZHRGbGFnID0gYnVmX2dldF8xYml0KGhCaXRCdWYpOwotICAgICAgICAgICAgaWYgKCFkdEZsYWcpCi0gICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgQ3VycmVudFRhYmxlID0gYUJvb2tQc0ljY0ZyZXFEZWNvZGU7Ci0gICAgICAgICAgICB9Ci0gICAgICAgICAgICBlbHNlCi0gICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgQ3VycmVudFRhYmxlID0gYUJvb2tQc0ljY1RpbWVEZWNvZGU7Ci0gICAgICAgICAgICB9Ci0gICAgICAgICAgICBmb3IgKGdyID0gMDsgZ3IgPCBhTm9JY2NCaW5zW3BzX2RlYy0+ZnJlcVJlc0ljY107IGdyKyspCi0gICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgcHNfZGVjLT5hYUljY0luZGV4W2Vudl1bZ3JdID0gc2JyX2RlY29kZV9odWZmX2N3KEN1cnJlbnRUYWJsZSwgaEJpdEJ1Zik7Ci0gICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgIHBzX2RlYy0+YWJJY2NEdEZsYWdbZW52XSA9IGR0RmxhZzsKLSAgICAgICAgfQotICAgIH0KLQotICAgIGlmIChwc19kZWMtPmJFbmFibGVFeHQpCi0gICAgewotCi0gICAgICAgIGludCBjbnQ7Ci0KLSAgICAgICAgY250ID0gKGludClidWZfZ2V0Yml0cyhoQml0QnVmLCA0KTsKLQotICAgICAgICBpZiAoY250ID09IDE1KQotICAgICAgICB7Ci0gICAgICAgICAgICBjbnQgKz0gKGludClidWZfZ2V0Yml0cyhoQml0QnVmLCA4KTsKLSAgICAgICAgfQotCi0gICAgICAgIG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KnNfayhuKSArIEgyMihrLG4pKmRfayhuKQotCi0gICAgIF9fX19fX18gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgX19fX19fX18KLSAgICB8ICAgICAgIHwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgX19fX19fXyAgIHwgICAgICAgIHwKLSAgLT58SHlicmlkIHwgTEYgLS0tLSAgICAgICAgICAgICAgICAgICAgICAgICB8ICAgICAgIHwtPnwgSHlicmlkIHwtLT4KLSAgICB8IEFuYWwuIHwgICAgICAgIHwgICAgICAgICAgICAgICAgICAgICAgICB8ICAgICAgIHwgIHwgU3ludGggIHwgICBRTUYgLT4gTAotICAgICAtLS0tLS0tICAgICAgICAgby0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tPnwgICAgICAgfCAgIC0tLS0tLS0tICAgIFN5bnRoCi1RTUYgICAgICAgICAgICAgICAgICB8ICAgICAgICAgICAgICAgIHNfayhuKSAgfFN0ZXJlbyB8LS0tLS0tLS0tLS0tLS0+Ci1BbmFsLiAgICAgICAgICAgICAgLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0+fCAgICAgICB8Ci0gICAgIF9fX19fX18gICAgICAgfCB8ICAgICAgICAgICAgICAgICAgICAgICAgfCAgICAgICB8ICAgX19fX19fX18KLSAgICB8ICAgICAgIHwgSEYgLS1vIHwgICAtLS0tLS0tLS0tLSAgICAgICAgICB8UHJvY2Vzc3wgIHwgICAgICAgIHwKLSAgLT58IERlbGF5IHwgICAgICB8ICAtPnwgICAgICAgICAgIHwtLS0tLS0tLT58ICAgICAgIHwtPnwgSHlicmlkIHwtLT4KLSAgICAgLS0tLS0tLSAgICAgICB8ICAgIHxkZWNvcnJlbGF0ZXwgZF9rKG4pICB8ICAgICAgIHwgIHwgU3ludGggIHwgICBRTUYgLT4gUgotICAgICAgICAgICAgICAgICAgIC0tLS0+fCAgICAgICAgICAgfC0tLS0tLS0tPnwgICAgICAgfCAgIC0tLS0tLS0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ICAgdGVtcDIgPSBwbXMtPmRlbHRhSDIyW2dyb3VwXTsKLQotICAgICAgICBwbXMtPkgyMVtncm91cF0gICs9IHRlbXAxOwotICAgICAgICBoMjEgID0gKEludDE2KShwbXMtPkgyMVtncm91cF0gPj4gMTYpOwotICAgICAgICBwbXMtPkgyMltncm91cF0gICs9IHRlbXAyOwotICAgICAgICBoMjIgID0gKEludDE2KShwbXMtPkgyMltncm91cF0gPj4gMTYpOwotCi0gICAgICAgIGluZGV4ID0gZ3JvdXBCb3JkZXJzW2dyb3VwXTsKLSAgICAgICAgbWF4U3ViYmFuZCA9IGdyb3VwQm9yZGVyc1tncm91cCArIDFdOwotICAgICAgICBtYXhTdWJiYW5kID0gbWluKHVzYiwgbWF4U3ViYmFuZCk7Ci0KLSAgICAgICAgLyoKLSAgICAgICAgICogIFJlY29uc3RydWN0aW9uIG9mIFN0ZXJlbyBzdWItYmFuZCBzaWduYWwKLSAgICAgICAgICoKLSAgICAgICAgICogIGxfayhuKSA9IEgxMShrLG4pKnNfayhuKSArIEgyMShrLG4pKmRfayhuKQotICAgICAgICAgKgotICAgICAgICAgKiAgcl9rKG4pID0gSDEyKGssbikqc19rKG4pICsgSDIyKGssbikqZF9rKG4pCi0gICAgICAgICAqLwotCi0gICAgICAgIHB0cl9oeWJyTGVmdFJlYWwgID0gJnFtZkxlZnRSZWFsWyAgaW5kZXhdOwotICAgICAgICBwdHJfaHliclJpZ2h0UmVhbCA9ICZxbWZSaWdodFJlYWxbIGluZGV4XTsKLQotICAgICAgICBmb3IgKHN1YmJhbmQgPSBpbmRleDsgc3ViYmFuZCA8IG1heFN1YmJhbmQ7IHN1YmJhbmQrKykKLSAgICAgICAgewotICAgICAgICAgICAgdGVtcDEgPSAqKHB0cl9oeWJyTGVmdFJlYWwpIDw8IDE7Ci0gICAgICAgICAgICB0ZW1wMiA9ICoocHRyX2h5YnJSaWdodFJlYWwpIDw8IDE7Ci0gICAgICAgICAgICB0ZW1wMyA9IGZ4cF9tdWwz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0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLQotIElOUFVUIEFORCBPVVRQVVQgREVGSU5JVElPTlMKLQotIElucHV0czoKLSAgICBjb2VmW10gICAgICAgICA9ICBBcnJheSBvZiBxdWFudGl6ZWQgc3BlY3RyYWwgY29lZmZpY2VudHMuCi0gICAgICAgICAgICAgICAgICAgICAgKEludCBbXSkKLQotICAgIHBQdWxzZUluZm8gICAgID0gIFBvaW50ZXIgdG8gc3RydWN0dXJlIHdoaWNoIGNvbnRhaW5zIG5vaXNlbGVzcwotICAgICAgICAgICAgICAgICAgICAgIGVuY29kaW5nIGluZm8sIGluY2x1ZGVzIGluZm9ybWF0aW9uIGFib3V0IHRoZSBwdWxzZSBkYXRhLAotICAgICAgICAgICAgICAgICAgICAgIHB1bHNlIGFtcGxpdHVkZSwgZXRjLgotICAgICAgICAgICAgICAgICAgICAgIChjb25zdCBQdWxzZUluZm8gKikKLQotICAgIHBMb25nRnJhbWVJbmZvID0gIFBvaW50ZXIgdG8gc3RydWN0dXJlIHRoYXQgaG9sZHMgaW5mb3JtYXRpb24gYWJvdXQKLSAgICAgICAgICAgICAgICAgICAgICBlYWNoIGdyb3VwLiAobG9uZyBibG9jayBmbGFnLCBudW1iZXIgb2Ygd2luZG93cywKLSAgICAgICAgICAgICAgICAgICAgICBzY2FsZWZhY3RvciBiYW5kcyBwZXIgZ3JvdXAsIGV0Yy4pCi0KLSAgICAgICAgICAgICAgICAgICAgICBWYXJpYWJsZSBpcyBuYW1lZCAocExvbmdGcmFtZUluZm8pIGJlY2F1c2UgdGhpcyBmdW5jdGlvbgotICAgICAgICAgICAgICAgICAgICAgIGlzIG9ubHkgdXNlZCBmb3IgTE9ORyB3aW5kb3dzLgotICAgICAgICAgICAgICAgICAgICAgIChGcmFtZUluZm8gKikKLSAgICBtYXggICAgICAgICAgICAgPSBQb2ludGVyIHRvIHRoZSBtYXhpbXVtIHZhbHVlIG9mIGN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ogPiBRX2ZtdCgyLjBmKSkKLSAgICB7Ci0gICAgICAgIHdoaWxlICh6ID4gUV9mbXQoMi4wZikpCi0gICAgICAgIHsKLSAgICAgICAgICAgIHogPj49IDE7Ci0gICAgICAgICAgICBpbnRfbG9nMisrOwotICAgICAgICB9Ci0gICAgfQotICAgIGVsc2UgaWYgKHogPCBRX2ZtdCgxLjBmKSkKLSAgICB7Ci0gICAgICAgIHsKLSAgICAgICAgICAgIHdoaWxlICh6IDwgUV9mbXQoMS4wZikpCi0gICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgeiA8PD0gMTsKLSAgICAgICAgICAgICAgICBpbnRfbG9nMi0tOwotICAgICAgICAgICAgfQotICAgICAgICB9Ci0gICAgfQotCi0gICAgLyoKLSAgICAgKiAgYXQgdGhpcyBwb2ludCwgaW5wdXQgbGltaXRlZCB0byAxPHg8MgotICAgICAqLwotCi0gICAgaWYgKHogIT0gUV9mbXQoMS4wZikpCi0gICAgewotICAgICAgICB5ICA9IGZ4cF9tdWwzMl9RMjAoKihwdF90YWJsZSsrKSwgeik7Ci0KLSAgICAgICAgZm9yIChpID0gNzsgaSAhPSAwOyBpLS0pCi0gICAgICAgIHsKLSAgICAgICAgICAgIHkgKz0gKihwdF90YWJsZSsrKTsKLSAgICAgICAgICAgIHkgID0gZnhwX211bDMyX1EyMCh5LCB6KTsKLSAgICAgICAgfQotCi0gICAgICAgIHkgKz0gKihwdF90YWJsZSsrKTsKLSAgICB9Ci0gICAgZWxzZQotICAgIHsKLSAgICAgICAgeSA9IDA7Ci0gICAgfQotCi0KLSAgICByZXR1cm4gKHkgKyAoaW50X2xvZzIgPDwgMjApKTsgICAgICAgICAvKiBRMjAgKi8KLX0KLQotCi0jZW5kaWYKLQpkaWZmIC0tZ2l0IGEvbWVkaWEvbGlic3RhZ2VmcmlnaHQvY29kZWNzL2FhY2RlYy9wdl9sb2cyLmggYi9tZWRpYS9saWJzdGFnZWZyaWdodC9jb2RlY3MvYWFjZGVjL3B2X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0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tKi8KLQotCi1JbnQzMiBwdl9zaW5lKEludDMyIHopCi17Ci0gICAgSW50MzIgc2luZTsKLSAgICBJbnQzMiBpOwotICAgIGNvbnN0IEludDMyICpwdF90YWJsZSA9IHNpbl90YWJsZTsKLSAgICBJbnQzMiBzaWduID0gMDsKLQotICAgIGlmICh6IDwgMCkKLSAgICB7Ci0gICAgICAgIHogPSAtejsKLSAgICAgICAgc2lnbiA9IDE7Ci0gICAgfQotCi0gICAgaWYgKHogPiBRX2ZtdCgwLjAwMTUpKQotICAgIHsKLSAgICAgICAgc2luZSAgPSBmeHBfbXVsMzJfUTMwKCoocHRfdGFibGUrKyksIHopOwotCi0gICAgICAgIGZvciAoaSA9IDc7IGkgIT0gMDsgaS0tKQotICAgICAgICB7Ci0gICAgICAgICAgICBzaW5lICs9ICoocHRfdGFibGUrKyk7Ci0gICAgICAgICAgICBzaW5lICA9IGZ4cF9tdWwzMl9RMzAoc2luZSwgeik7Ci0gICAgICAgIH0KLQotICAgIH0KLSAgICBlbHNlCi0gICAgewotICAgICAgICBzaW5lID0gejsgIC8qICBiZXR0ZXIgYXBwcm94aW1hdGlvbiBpbiB0aGlzIHJhbmdlICovCi0gICAgfQotCi0gICAgaWYgKHNpZ24pCi0gICAgewotICAgICAgICBzaW5lID0gLXNpbmU7Ci0gICAgfQotCi0gICAgcmV0dXJuIHNpbmU7Ci19Ci0KLQotCi1JbnQzMiBwdl9jb3NpbmUoSW50MzIgeikKLXsKLSAgICBJbnQzMiBjb3NpbmU7Ci0KLSAgICBpZiAoeiA8IDApCi0gICAgewotICAgICAgICB6ID0gLXo7ICAgICAvKiBzaWduIGRvZXMgbm90IHBsYXkgYSByb2xlIGluIGNvc2luZSAqLwotICAgIH0KLQotICAgIGlmICh6ID4gUV9mbXQoMC4wMDE1KSkKLSAgICB7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0gICAgSW50MzIgICB4eDsKLSAgICBJbnQzMiAgIG5uOwotICAgIEludDMyICAgaTsKLSAgICBjb25zdCBJbnQzMiAqcHRfdGFibGUgPSBzcXJ0X3RhYmxlOwotCi0KLSAgICBpZiAoc3FydF9jYWNoZVswXSA9PSBtYW4gJiYgc3FydF9jYWNoZVsxXSA9PSBleHApCi0gICAgewotICAgICAgICByZXN1bHQtPnJvb3QgICAgICAgICA9ICAgICAgICBzcXJ0X2NhY2hlWzJdOwotICAgICAgICByZXN1bHQtPnNoaWZ0X2ZhY3RvciA9IChJbnQxNilzcXJ0X2NhY2hlWzNdOwotICAgIH0KLSAgICBlbHNlCi0gICAgewotCi0gICAgICAgIHNxcnRfY2FjaGVbMF0gPSBtYW47Ci0gICAgICAgIHNxcnRfY2FjaGVbMV0gPSBleHA7Ci0KLQotICAgICAgICBpZiAobWFuID4gMCkKLSAgICAgICAgewotICAgICAgICAgICAgeHggPSAgbWFuOwotICAgICAgICAgICAgaWYgKG1hbiA+PSBRX2ZtdCgxLjBmKSkKLSAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICBubiA9IGV4cCArIDE7Ci0gICAgICAgICAgICAgICAgd2hpbGUgKCh4eCA+Pj0gMSkgPiBRX2ZtdCgxLjBmKSkKLSAgICAgICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgICAgIG5uKys7Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgfQotICAgICAgICAgICAgZWxzZSBpZiAobWFuIDwgUV9mbXQoMC41ZikpCi0gICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgbm4gPSBleHAgLSAxOwotICAgICAgICAgICAgICAgIHdoaWxlICgoeHggPDw9IDEpIDwgUV9mbXQoMC41ZikpCi0gICAgICAgICAgICAgICAgewotICAgICAgICAgICAgICAgICAgICBubi0tOwotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgIH0KLSAgICAgICAgICAgIGVsc2UKLSAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICBubiA9IGV4cDsKLSAgICAgICAgICAgIH0KLQotCi0gICAgICAgICAgICB5ICA9IGZ4cF9tdWwzMl9RMjgoKihwdF90YWJsZSsrKSwgeHgpOwotCi0gICAgICAgICAgICBmb3IgKGkgPSAzOyBpICE9IDA7IGktLSkKLSAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICB5ICs9ICoocHRfdGFibGUrKyk7Ci0gICAgICAgICAgICAgICAgeSAgPSBmeHBfbXVsMzJfUTI4KHksIHh4KTsKLSAgICAgICAgICAgICAgICB5ICs9ICoocHRfdGFibGUrKyk7Ci0gICAgICAgICAgICAgICAgeSAgPSBmeHBfbXVsMzJfUTI4KHksIHh4KTsKLSAgICAgICAgICAgIH0KLSAgICAgICAgICAgIHkgKz0gKihwdF90YWJsZSsrKTsKLSAgICAgICAgICAgIHkgID0gZnhwX211bDMyX1EyOCh5LCB4eCkgKyAqKHB0X3RhYmxlKyspOwotCi0gICAgICAgICAgICBpZiAobm4gPj0gMCkKLSAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICBpZiAobm4mMSkKLSAgICAgICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgICAgIHkgPSBmeHBfbXVsMzJfUTI5KHksIFFfZm10KDEuNDE0MjEzNTYyMzczMTBGKSk7Ci0gICAgICAgICAgICAgICAgICAgIHJlc3VsdC0+c2hpZnRfZmFjdG9yID0gKG5uID4+IDEpIC0gMjg7Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgIGVsc2UKLSAgICAgICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgICAgIHJlc3VsdC0+c2hpZnRfZmFjdG9yID0gKG5uID4+IDEpIC0gMjk7Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgfQotICAgICAgICAgICAgZWxzZQotICAgICAgICAgICAgewotICAgICAgICAgICAgICAgIGlmIChubiYxKQotICAgICAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAgICAgeSA9I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RlckNvbmZpZygKLSAgICB0UFZNUDRBdWRpb0RlY29kZXJFeHRlcm5hbCAgKnBFeHQsCi0gICAgdm9pZCAgICAgICAgICAgICAgICAgICAgICAgICpwTWVtKQotewotCi0gICAgVUludCAgICAgICAgICAgaW5pdGlhbFVzZWRCaXRzOyAgLyogVW5zaWduZWQgZm9yIEM1NXggKi8KLSAgICB0RGVjX0ludF9GaWxlICpwVmFyczsgICAgICAgICAgIC8qIEhlbHBlciBwb2ludGVyICovCi0KLSAgICBJbnQgICAgICAgICAgICBzdGF0dXMgPSBNUDRBVURFQ19JTkNPTVBMRVRFX0ZSQU1FOwotCi0gICAgLyoKLSAgICAgKiBJbml0aWFsaXplICJoZWxwZXIiIHBvaW50ZXJzIHRvIGV4aXN0aW5nIG1lbW9yeS4KLSAgICAgKi8KLSAgICBwVmFycyA9ICh0RGVjX0ludF9GaWxlICopcE1lbTsKLSAgICAvKgotICAgICAqIFRyYW5zbGF0ZSBpbnB1dCBidWZmZXIgdmFyaWFibGVzLgotICAgICAqLwotICAgIHBWYXJzLT5pbnB1dFN0cmVhbS5wQnVmZmVyID0gcEV4dC0+cElucHV0QnVmZmVyOwotCi0gICAgcFZhcnMtPmlucHV0U3RyZWFtLmlucHV0QnVmZmVyQ3VycmVudExlbmd0aCA9Ci0gICAgICAgIChVSW50KXBFeHQtPmlucHV0QnVmZmVyQ3VycmVudExlbmd0aDsKLQotICAgIHBWYXJzLT5pbnB1dFN0cmVhbS5hdmFpbGFibGVCaXRzID0KLSAgICAgICAgKFVJbnQpKHBFeHQtPmlucHV0QnVmZmVyQ3VycmVudExlbmd0aCA8PCBJTkJVRl9BUlJBWV9JTkRFWF9TSElGVCk7Ci0KLSAgICBpbml0aWFsVXNlZEJpdHMgPQotICAgICAgICAoVUludCkoKHBFeHQtPmlucHV0QnVmZmVyVXNlZExlbmd0aCA8PCBJTkJVRl9BUlJBWV9JTkRFWF9TSElGVCkgKwotICAgICAgICAgICAgICAgcEV4dC0+cmVtYWluZGV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WVMZW5ndGggLSBsZW5ndGggb2YgdGhlIGZyYW1lCi0KLSBMb2NhbCBTdG9yZXMgTW9kaWZpZWQ6IE5vbmUuCi0KLSBHbG9iYWwgU3RvcmVzIE1vZGlmaWVkOiBOb25lLgotCi0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0KLSBGVU5DVElPTiBERVNDUklQVElPTgotCi0gRGVjb2RlcyBvbmUgZnJhbWUgb2YgYW4gTVBFRy0yL01QRUctNCBlbmNvZGVkIGF1ZGlvIGJpdHN0cmVhbS4KLQotIFRoaXMgZnVuY3Rpb24gY2FsbHMgdGhlIHZhcmlvdXMgY29tcG9uZW50cyBvZiB0aGUgZGVjb2RlciBpbiB0aGUgcHJvcGVyIG9yZGVyLgotCi0KLSAgICAgICAgIExlZnQgQ2hhbm5lbCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFJpZ2h0IENoYW5uZWwKLSAgICAgICAgICAgICB8ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwKLSAgICAgICAgICAgICB8ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwKLSAgICAgICAgICAgICB8ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwKLSAgICAgICAgICAgIFx8LyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXHwvCi0gIzEgX19fX19fX19fX19fX19fX19fX18gICAgICAgICAgICAgICAgICAgICAgICAgICAjMiBfX19fX19fX19fX19fX19fX19fXwotICAgIHwgICAgICAgICAgICAgICAgICB8ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfCAgICAgICAgICAgICAgICAgIHwKLSAgICB8IEh1ZmZtYW4gRGVjb2RpbmcgfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwgSHVmZm1hbiBEZWNvZGluZyB8Ci0gICAgfF9fX19fX19fX19fX19fX19fX3wgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8X19fX19fX19fX19fX19fX19ffAotICAgICAgICAgICAgIHwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfAotICAgICAgICAgICAgIHwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfAotICAgICAgICAgICAgIHwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfAotICAgICAgICAgICAgXHwvICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfAotICMzIF9fX19fX19fX19fX19fX19fX19fICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfAotICAgIHwgICAgICAgICAgICAgICAgICB8ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfAotICAgIHwgICAgIFBOUyBMRUZUICAgICB8ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfAotICAgIHxfX19fX19fX19fX19fX19fX198ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfAotICAgICAgICAgICAgIHwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfAotICAgICAgICAgICAgIHwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfAotICAgICAgICAgICAgIHwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfAotICAgICAgICAgICAgXHwvICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBcfC8KLSAjNCBfX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fCi0gICAgfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfAotICAgIHwgICAgICAgICAgICAgICAgICAgICAgICAgIEFwcGx5IE1TX1N5bnQgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwKLSAgICB8X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX198Ci0gICAgICAgICAgICAgfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8Ci0gICAgICAgICAgICAgfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8Ci0gICAgICAgICAgICBcfC8gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8Ci0gIzUgX19fX19fX19fX19fX19fX19fX18gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8Ci0gICAgfCAgICAgICAgICAgICAgICAgIHwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBXCi0gICAgfCAgICAgICBMVFAgICAgICAgIHwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBBCi0gICAgfF9fX19fX19fX19fX19fX19fX3wgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBJCi0gICAgICAgICAgICAgfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBUCi0gICAgICAgICAgICAgfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8Ci0gICAgICAgICAgICAgfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBGCi0gICAgICAgICAgICBcfC8gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBPCi0gIzYgX19fX19fX19fX19fX19fX19fX18gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBSCi0gICAgfCAgICAgICAgICAgICAgICAgIHwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8Ci0gICAgfCAgIFRpbWUgLT4gRnJlcSAgIHwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBMCi0gICAgfF9fX19fX19fX19fX19fX19fX3wgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBFCi0gICAgICAgICAgICAgfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBGCi0gICAgICAgICAgICAgfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBUCi0gICAgICAgICAgICAgfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8Ci0gICAgICAgICAgICBcfC8gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBDCi0gIzcgX19fX19fX19fX19fX19fX19fX18gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBICi0gICAgfCAgICAgICAgICAgICAgICAgIHwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBBCi0gICAgfCAgICBUTlMgSW52ZXJzZSAgIHwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBOCi0gICAgfF9fX19fX19fX19fX19fX19fX3wgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBOCi0gICAgICAgICAgICAgfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBFCi0gICAgICAgICAgICAgfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBMCi0gICAgICAgICAgICAgfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8Ci0gICAgICAgICAgICBcfC8gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8Ci0gIzggX19fX19fX19fX19fX19fX19fX18gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8Ci0gICAgfCAgICAgICAgICAgICAgICAgIHwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8Ci0gICAgfCBMb25nIFRlcm0gU3ludGggIHwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8Ci0gICAgfF9fX19fX19fX19fX19fX19fX3wgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8Ci0gICAgICAgICAgICAgfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8Ci0gICAgICAgICAgICAgfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFx8LwotICAgICAgICAgICAgIHwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIzkgX19fX19fX19fX19fX19fX19fX18KLSAgICAgICAgICAgICB8ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwgICAgICAgICAgICAgICAgICB8Ci0gICAgICAgICAgICAgfC0tREFUQSBPTiBMRUZUIENIQU5ORUwgTUFZIEJFIFVTRUQtLS0tLT58IFBOUy9JbnRlbnNpdHkgUnQgfAotICAgICAgICAgICAgIHwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfF9fX19fX19fX19fX19fX19fX3wKLSAgICAgICAgICAgICB8ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwKLSAgICAgICAgICAgICB8ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwKLSAgICAgICAgICAgICB8ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXHwvCi0gICAgICAgICAgICAgfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICMxMCBfX19fX19fX19fX19fX19fX19fXwotICAgICAgICAgICAgIFcgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfCAgICAgICAgICAgICAgICAgIHwKLSAgICAgICAgICAgICBBICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwgICAgICAgTFRQICAgICAgICB8Ci0gICAgICAgICAgICAgSSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8X19fX19fX19fX19fX19fX19ffAotICAgICAgICAgICAgIFQgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfAotICAgICAgICAgICAgIHwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfAotICAgICAgICAgICAgIEYgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfAotICAgICAgICAgICAgIE8gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBcfC8KLSAgICAgICAgICAgICBSICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIzExIF9fX19fX19fX19fX19fX19fX19fCi0gICAgICAgICAgICAgfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8ICAgICAgICAgICAgICAgICAgfAotICAgICAgICAgICAgIFIgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfCAgIFRpbWUgLT4gRnJlcSAgIHwKLSAgICAgICAgICAgICBJICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHxfX19fX19fX19fX19fX19fX198Ci0gICAgICAgICAgICAgRyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8Ci0gICAgICAgICAgICAgSCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8Ci0gICAgICAgICAgICAgVCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8Ci0gICAgICAgICAgICAgfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFx8LwotICAgICAgICAgICAgIEMgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAjMTIgX19fX19fX19fX19fX19fX19fX18KLSAgICAgICAgICAgICBIICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwgICAgICAgICAgICAgICAgICB8Ci0gICAgICAgICAgICAgQSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8ICAgIFROUyBJbnZlcnNlICAgfAotICAgICAgICAgICAgIE4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfF9fX19fX19fX19fX19fX19fX3wKLSAgICAgICAgICAgICBOICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwKLSAgICAgICAgICAgICBFICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwKLSAgICAgICAgICAgICBMICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwKLSAgICAgICAgICAgICB8ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXHwvCi0gICAgICAgICAgICAgfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICMxMyBfX19fX19fX19fX19fX19fX19fXwotICAgICAgICAgICAgIHwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfCAgICAgICAgICAgICAgICAgIHwKLSAgICAgICAgICAgICB8ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwgTG9uZyBUZXJtIFN5bnRoICB8Ci0gICAgICAgICAgICAgfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8X19fX19fX19fX19fX19fX19ffAotICAgICAgICAgICAgIHwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfAotICAgICAgICAgICAgIHwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfAotICAgICAgICAgICAgIHwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfAotICAgICAgICAgICAgXHwvICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBcfC8KLSMxNCBfX19fX19fX19fX19fX19fX19fXyAgICAgICAgICAgICAgICAgICAgICAgICAgIzE4IF9fX19fX19fX19fX19fX19fX19fCi0gICAgfCAgICAgICAgICAgICAgICAgIHwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8ICAgICAgICAgICAgICAgICAgfAotICAgIHwgICAgICAgVE5TICAgICAgICB8ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfCAgICAgICBUTlMgICAgICAgIHwKLSAgICB8X19fX19fX19fX19fX19fX19ffCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHxfX19fX19fX19fX19fX19fX198Ci0gICAgICAgICAgICAgfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8Ci0gICAgICAgICAgICAgfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8Ci0gICAgICAgICAgICAgfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8Ci0gICAgICAgICAgICBcfC8gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFx8LwotIzE1IF9fX19fX19fX19fX19fX19fX19fICAgICAgICAgICAgICAgICAgICAgICAgICAjMTkgX19fX19fX19fX19fX19fX19fX18KLSAgICB8ICAgICAgICAgICAgICAgICAgfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwgICAgICAgICAgICAgICAgICB8Ci0gICAgfCAgIHFGb3JtYXROb3JtICAgIHwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8ICAgcUZvcm1hdE5vcm0gICAgfAotICAgIHxfX19fX19fX19fX19fX19fX198ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfF9fX19fX19fX19fX19fX19fX3wKLSAgICAgICAgICAgICB8ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwKLSAgICAgICAgICAgICB8ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwKLSAgICAgICAgICAgICB8ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwKLSAgICAgICAgICAgIFx8LyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXHwvCi0jMTYgX19fX19fX19fX19fX19fX19fX18gICAgICAgICAgICAgICAgICAgICAgICAgICMyMCBfX19fX19fX19fX19fX19fX19fXwotICAgIHwgICAgICAgICAgICAgICAgICB8ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfCAgICAgICAgICAgICAgICAgIHwKLSAgICB8ICAgRnJlcSAvIFRpbWUgICAgfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwgICBGcmVxIC8gVGltZSAgICB8Ci0gICAgfF9fX19fX19fX19fX19fX19fX3wgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8X19fX19fX19fX19fX19fX19ffAotICAgICAgICAgICAgIHwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfAotICAgICAgICAgICAgIHwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfAotICAgICAgICAgICAgIHwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfAotICAgICAgICAgICAgXHwvICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBcfC8KLSMxNyBfX19fX19fX19fX19fX19fX19fXyAgICAgICAgICAgICAgICAgICAgICAgICAgIzIxIF9fX19fX19fX19fX19fX19fX19fCi0gICAgfCAgICAgICAgICAgICAgICAgIHwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8ICAgICAgICAgICAgICAgICAgfAotICAgIHwgICBMaW1pdCBCdWZmZXIgICB8ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfCAgIExpbWl0IEJ1ZmZlciAgIHwKLSAgICB8X19fX19fX19fX19fX19fX19ffCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHxfX19fX19fX19fX19fX19fX198Ci0gICAgICAgICAgICAgfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8Ci0gICAgICAgICAgICAgfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8Ci0gICAgICAgICAgICAgfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8Ci0gICAgICAgICAgICBcfC8gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFx8LwotIzIyIF9fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX18KLSAgICB8ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8Ci0gICAgfCAgICAgICAgICAgICAgICAgICAgICAgICAgIFdyaXRlIE91dHB1dCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfAotICAgIHxfX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX3wKLQotCi0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS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VA0QXVkaW9EZWNvZGVGcmFtZSgKLSAgICB0UFZNUDRBdWRpb0RlY29kZXJFeHRlcm5hbCAgKnBFeHQsCi0gICAgdm9pZCAgICAgICAgICAgICAgICAgICAgICAgICpwTWVtKQotewotICAgIEludCAgICAgICAgICAgIGZyYW1lTGVuZ3RoOyAgICAgIC8qIEhlbHBlciB2YXJpYWJsZSAqLwotICAgIEludCAgICAgICAgICAgIGNoOwotICAgIEludCAgICAgICAgICAgIGlkX3N5bl9lbGU7Ci0gICAgVUludCAgICAgICAgICAgaW5pdGlhbFVzZWRCaXRzOyAgLyogVW5zaWduZWQgZm9yIEM1NXggKi8KLSAgICBJbnQgICAgICAgICAgICBxRm9ybWF0Tm9ybTsKLSAgICBJbnQgICAgICAgICAgICBxUHJlZGljdGVkU2FtcGxlczsKLSAgICBCb29sICAgICAgICAgICBsZWF2ZUdldExvb3A7Ci0gICAgTUNfSW5mbyAgICAgICAqcE1DX0luZm87ICAgICAgICAvKiBIZWxwZXIgcG9pbnRlciAqLwotICAgIEZyYW1lSW5mbyAgICAgKnBGcmFtZUluZm87ICAgICAgLyogSGVscGVyIHBvaW50ZXIgKi8KLSAgICB0RGVjX0ludF9GaWxlICpwVmFyczsgICAgICAgICAgIC8qIEhlbHBlciBwb2ludGVyICovCi0gICAgdERlY19JbnRfQ2hhbiAqcENoVmFyc1tDaGFuc107ICAvKiBIZWxwZXIgcG9pbnRlciAqLwotCi0gICAgcGVyX2NoYW5fc2hhcmVfd19meHBDb2VmICpwQ2hMZWZ0U2hhcmU7ICAvKiBIZWxwZXIgcG9pbnRlciAqLwotICAgIHBlcl9jaGFuX3NoYXJlX3dfZnhwQ29lZiAqcENoUmlnaHRTaGFyZTsgLyogSGVscGVyIHBvaW50ZXIgKi8KLQotICAgIEludCAgICAgICAgICAgIHN0YXR1cyA9IE1QNEFVREVDX1NVQ0NFU1M7Ci0KLQotICAgIEJvb2wgZW1wdHlfZnJhbWU7Ci0KLSNpZmRlZiBBQUNfUExVUwot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i0gICAgICAgICAqIChhY3R1YWxseSB1c2VkQml0cykuCi0gICAgICAgICAqLwotICAgICAgICBzdGF0dXMgPQotICAgICAgICAgICAgZ2V0X2FkaWZfaGVhZGVyKAotICAgICAgICAgICAgICAgIHBWYXJzLAotICAgICAgICAgICAgICAgICYocFZhcnMtPnNjcmF0Y2guc2NyYXRjaF9wcm9nX2NvbmZpZykpOwotCi0gICAgICAgIGJ5dGVfYWxpZ24oJnBWYXJzLT5pbnB1dFN0cmVhbSk7Ci0KLSAgICAgICAgaWYgKHN0YXR1cyA9PSBTVUNDRVNTKQotICAgICAgICB7Ci0gICAgICAgICAgICBwVmFycy0+cHJvZ19jb25maWcuZmlsZV9pc19hZHRzID0gRkFMU0U7Ci0gICAgICAgIH0KLSAgICAgICAgZWxzZSAgLyogd2UndmUgdHJpZWQgc2ltcGxlIGF1ZGlvIGNvbmZpZywgYWRpZiwgdGhlbiBpdCBzaG91bGQgYmUgYWR0cyAqLwotICAgICAgICB7Ci0gICAgICAgICAgICBwVmFycy0+cHJvZ19jb25maWcuZmlsZV9pc19hZHRzID0gVFJVRTsKLSAgICAgICAgfQotICAgIH0KLSAgICBlbHNlIGlmICgocFZhcnMtPmJubyA9PSAxKSAmJiAocFZhcnMtPnByb2dfY29uZmlnLmZpbGVfaXNfYWR0cyA9PSBGQUxTRSkpCi0gICAgewotCi0gICAgICAgIC8qCi0gICAgICAgICAqIFRoZXJlIG1pZ2h0IGJlIGFuIElEX0VORCBlbGVtZW50IGZvbGxvd2luZyBpbW1lZGlhdGVseSBhZnRlciB0aGUKLSAgICAgICAgICogQXVkaW9TcGVjaWZpY0NvbmZpZyBoZWFkZXIuIFRoaXMgc3ludGFjdGljIGVsZW1lbnQgc2hvdWxkIGJlIHJlYWQKLSAgICAgICAgICogYW5kIGJ5dGVfYWxpZ25lZCBiZWZvcmUgcHJvY2VlZHMgdG8gZGVjb2RlICJyZWFsIiBBQUMgcmF3IGRhdGEuCi0gICAgICAgICAqLwotICAgICAgICBpZF9zeW5fZWxlID0gKEludClnZXRiaXRzKExFTl9TRV9JRCwgJnBWYXJzLT5pbnB1dFN0cmVhbSkgOwotCi0gICAgICAgIGlmIChpZF9zeW5fZWxlID09IElEX0VORCkKLSAgICAgICAgewotCi0gICAgICAgICAgICBieXRlX2FsaWduKCZwVmFycy0+aW5wdXRTdHJlYW0pOwotCi0gICAgICAgICAgICBwRXh0LT5pbnB1dEJ1ZmZlclVzZWRMZW5ndGggPQotICAgICAgICAgICAgICAgIHBWYXJzLT5pbnB1dFN0cmVhbS51c2VkQml0cyA+PiBJTkJVRl9BUlJBWV9JTkRFWF9TSElGVDsKLQotICAgICAgICAgICAgcEV4dC0+cmVtYWluZGVyQml0cyA9IHBWYXJzLT5pbnB1dFN0cmVhbS51c2VkQml0cyAmIElOQlVGX0JJVF9NT0RVTE9fTUFTSzsKLQotICAgICAgICAgICAgcFZhcnMtPmJubysrOwotCi0gICAgICAgICAgICByZXR1cm4oc3RhdHVzKTsKLSAgICAgICAgfQotICAgICAgICBlbHNlCi0gICAgICAgIHsKLSAgICAgICAgICAgIC8qCi0gICAgICAgICAgICAgKiBSZXdpbmQgYml0c3RyZWFtIHBvaW50ZXIgc28gdGhhdCB0aGUgc3ludGFjdGljIGVsZW1lbnQgY2FuIGJlCi0gICAgICAgICAgICAgKiByZWFkIHdoZW4gZGVjb2RpbmcgcmF3IGJpdHN0cmVhbQotICAgICAgICAgICAgICovCi0gICAgICAgICAgICBwVmFycy0+aW5wdXRTdHJlYW0udXNlZEJpdHMgLT0gTEVOX1NFX0lEOwotICAgICAgICB9Ci0KLSAgICB9Ci0KLSAgICBpZiAocFZhcnMtPnByb2dfY29uZmlnLmZpbGVfaXNfYWR0cyA9PSBUUlVFKQotICAgIHsKLSAgICAgICAgLyoKLSAgICAgICAgICogIElmIGZpbGUgaXMgYWR0cyBmb3JtYXQsIGxldCB0aGUgZGVjb2RlciBoYW5kbGUgb25seSBvbiBkYXRhIHJhdwotICAgICAgICAgKiAgYmxvY2sgYXQgdGhlIHRpbWUsIG9uY2UgdGhlIGxhc3QgKG9yIG9ubHkpIGRhdGEgYmxvY2sgaGFzIGJlZW4KLSAgICAgICAgICogIHByb2Nlc3NlZCwgdGhlbiBzeW5jaCBvbiB0aGUgbmV4dCBoZWFkZXIKLSAgICAgICAgICovCi0gICAgICAgIGlmIChwVmFycy0+cHJvZ19jb25maWcuaGVhZGVybGVzc19mcmFtZXMpCi0gICAgICAgIHsKLSAgICAgICAgICAgIHBWYXJzLT5wcm9nX2NvbmZpZy5oZWFkZXJsZXNzX2ZyYW1lcy0tOyAgLyogcmF3IGRhdGEgYmxvY2sgY291bnRlciAgKi8KLSAgICAgICAgfQotICAgICAgICBlbHNlCi0gICAgICAgIHsKLSAgICAgICAgICAgIHN0YXR1cyA9ICBnZXRfYWR0c19oZWFkZXIocFZhcnMsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICYocFZhcnMtPnN5bmN3b3JkKSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJihwVmFycy0+aW52b2tlKSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMyk7ICAgICAvKiAgIENvcnJlY3RseVJlYWRGcmFtZXNDb3VudCAgKi8KLQotICAgICAgICAgICAgaWYgKHN0YXR1cyAhPSBTVUNDRVNTKQotICAgICAgICAgICAgewotICAgICAgICAgICAgICAgIHN0YXR1cyA9IE1QNEFVREVDX0xPU1RfRlJBTUVfU1lOQzsgICAgLyogIHdlIGxvc3QgdHJhY2sgb2YgaGVhZGVyICovCi0gICAgICAgICAgICB9Ci0gICAgICAgIH0KLSAgICB9Ci0gICAgZWxzZQotICAgIHsKLSAgICAgICAgYnl0ZV9hbGlnbigmcFZhcnMtPmlucHV0U3RyZWFtKTsKLSAgICB9Ci0KLSNpZmRlZiBBQUNfUExVUwotICAgIHNickJpdFN0cmVhbS0+TnJFbGVtZW50cyA9IDA7Ci0gICAgc2JyQml0U3RyZWFt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Rpb25hbCBmcmFtZSAqLwotICAgICAgICAgICAgaWRfc3luX2VsZSA9IElEX0VORDsgICAgICAgICAgIC8qIHF1aXQgd2hpbGUtbG9vcCAqLwotICAgICAgICB9Ci0KLSAgICAgICAgc3dpdGNoIChpZF9zeW5fZWxlKQotICAgICAgICB7Ci0gICAgICAgICAgICBjYXNlIElEX0VORDogICAgICAgIC8qIHRlcm1pbmF0b3IgZmllbGQgKi8KLSAgICAgICAgICAgICAgICBsZWF2ZUdldExvb3AgPSBUUlVFOwotICAgICAgICAgICAgICAgIGJyZWFrOwotCi0gICAgICAgICAgICBjYXNlIElEX1NDRTogICAgICAgIC8qIHNpbmdsZSBjaGFubmVsICovCi0gICAgICAgICAgICBjYXNlIElEX0NQRTogICAgICAgIC8qIGNoYW5uZWwgcGFpciAqLwotICAgICAgICAgICAgICAgIGVtcHR5X2ZyYW1lID0gRkFMU0U7Ci0gICAgICAgICAgICAgICAgc3RhdHVzID0KLSAgICAgICAgICAgICAgICAgICAgaHVmZmRlY29kZSgKLSAgICAgICAgICAgICAgICAgICAgICAgIGlkX3N5bl9lbGUsCi0gICAgICAgICAgICAgICAgICAgICAgICAmKHBWYXJzLT5pbnB1dFN0cmVhbSksCi0gICAgICAgICAgICAgICAgICAgICAgICBwVmFycywKLSAgICAgICAgICAgICAgICAgICAgICAgIHBDaFZhcnMpOwotCi0jaWZkZWYgQUFDX1BMVVMKLSAgICAgICAgICAgICAgICBpZiAoaWRfc3luX2VsZSA9PSBJRF9TQ0UpCi0gICAgICAgICAgICAgICAgewotICAgICAgICAgICAgICAgICAgICBzYnJCaXRTdHJlYW0tPnNickVsZW1lbnRbc2JyQml0U3RyZWFtLT5OckVsZW1lbnRzXS5FbGVtZW50SUQgPSBTQlJfSURfU0NFOwotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICBlbHNlIGlmIChpZF9zeW5fZWxlID09IElEX0NQRSkKLSAgICAgICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgICAgIHNickJpdFN0cmVhbS0+c2JyRWxlbWVudFtzYnJCaXRTdHJlYW0tPk5yRWxlbWVudHNdLkVsZW1lbnRJRCA9IFNCUl9JRF9DUEU7Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgIHNickJpdFN0cmVhbS0+TnJFbGVtZW50c0NvcmUrKzsKLQotCi0jZW5kaWYKLQotICAgICAgICAgICAgICAgIGJyZWFrOwotCi0gICAgICAgICAgICBjYXNlIElEX1BDRTogICAgICAgIC8qIHByb2dyYW0gY29uZmlnIGVsZW1lbnQgKi8KLSAgICAgICAgICAgICAgICAvKgotICAgICAgICAgICAgICAgICAqIFBDRSBhcmUgbm90IGFjY2VwdGVkIGluIHRoZSBtaWRkbGUgb2YgYQotICAgICAgICAgICAgICAgICAqIHJhd19kYXRhX2Jsb2NrLiBJZiBmb3VuZCwgYSBwb3NzaWJsZSBlcnJvciBtYXkgaGFwcGVuCi0gICAgICAgICAgICAgICAgICogSWYgYSBQQ0UgaXMgZW5jb3VudGVyZWQgZHVyaW5nIHRoZSBmaXJzdCAyIGZyYW1lcywKLSAgICAgICAgICAgICAgICAgKiBpdCB3aWxsIGJlIHJlYWQgYW5kIGFjY2VwdGVkCi0gICAgICAgICAgICAgICAgICogaWYgaXRzIHRhZyBtYXRjaGVzIHRoZSBmaXJzdCwgd2l0aCBubyBlcnJvciBjaGVja2luZwotICAgICAgICAgICAgICAgICAqIChpbnNpZGUgb2YgZ2V0X3Byb2dfY29uZmlnKQotICAgICAgICAgICAgICAgICAqLwotCi0gICAgICAgICAgICAgICAgaWYgKHBWYXJzLT5ibm8gPD0gMSkKLSAgICAgICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgICAgIHN0YXR1cyA9IGdldF9wcm9nX2NvbmZpZyhwVmFycywKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICYocFZhcnMtPnNjcmF0Y2guc2NyYXRjaF9wcm9nX2NvbmZpZykpOwotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICBlbHNlCi0gICAgICAgICAgICAgICAgewotICAgICAgICAgICAgICAgICAgICBzdGF0dXMgPSBNUDRBVURFQ19JTlZBTElEX0ZSQU1FOwotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICBicmVhazsKLQotICAgICAgICAgICAgY2FzZSBJRF9GSUw6ICAgICAgICAvKiBmaWxsIGVsZW1lbnQgKi8KLSNpZmRlZiBBQUNfUExVUwotICAgICAgICAgICAgICAgIGdldF9zYnJfYml0c3RyZWFtKHNickJpdFN0cmVhbSwgJnBWYXJzLT5pbnB1dFN0cmVhbSk7Ci0KLSNlbHNlCi0gICAgICAgICAgICAgICAgZ2V0ZmlsbCgmcFZhcnMtPmlucHV0U3RyZWFtKTsKLSNlbmRpZgotCi0gICAgICAgICAgICAgICAgYnJlYWs7Ci0KLSAgICAgICAgICAgIGNhc2UgSURfRFNFOiAgICAgICAvKiBEYXRhIFN0cmVhbWluZyBlbGVtZW50ICovCi0gICAgICAgICAgICAgICAgZ2V0X2RzZShwVmFycy0+c2hhcmUuZGF0YV9zdHJlYW1fYnl0ZXMsCi0gICAgICAgICAgICAgICAgICAgICAgICAmcFZhcnMtPmlucHV0U3RyZWFtKTsKLSAgICAgICAgICAgICAgICBicmVhazsKLQotICAgICAgICAgICAgZGVmYXVsdDogLyogVW5zdXBwb3J0ZWQgZWxlbWVudCwgaW5jbHVkaW5nIElEX0xGRSAqLwotICAgICAgICAgICAgICAgIHN0YXR1cyA9IC0xOyAgLyogRVJST1IgQ09ERSBuZWVkcyB0byBiZSB1cGRhdGVkICovCi0gICAgICAgICAgICAgICAgYnJlYWs7Ci0KLSAgICAgICAgfSAvKiBlbmQgc3dpdGNoKCkgKi8KLQotICAgIH0gLyogZW5kIHdoaWxlKCkgKi8KLQotICAgIGJ5dGVfYWxpZ24oJnBWYXJzLT5pbnB1dFN0cmVhbSk7Ci0KLSAgICAvKgotICAgICAqICAgQWZ0ZXIgcGFyc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lbCBzaGFyZSB0aGUKLSAgICAgICAgICogc2FtZSBncm91cGluZywgd2luZG93IGxlbmd0aCwgZXRjLgotICAgICAgICAgKgotICAgICAgICAgKiBwVmFycy0+aGFzbWFzayB3aWxsIGJlID4gMCBvbmx5IGlmCi0gICAgICAgICAqIGNvbW1vbiB3aW5kb3dzIGFyZSBlbmFibGVkIGZvciB0aGlzIGZyYW1lLgotICAgICAgICAgKi8KLQotICAgICAgICBpZiAocFZhcnMtPmhhc21hc2sgPiAwKQotICAgICAgICB7Ci0gICAgICAgICAgICBhcHBseV9tc19zeW50KAotICAgICAgICAgICAgICAgIHBGcmFtZUluZm8sCi0gICAgICAgICAgICAgICAgcENoTGVmdFNoYXJlLT5ncm91cCwKLSAgICAgICAgICAgICAgICBwVmFycy0+bWFzaywKLSAgICAgICAgICAgICAgICBwQ2hMZWZ0U2hhcmUtPmNiX21hcCwKLSAgICAgICAgICAgICAgICBwQ2hWYXJzW0xFRlRdLT5meHBDb2VmLAotICAgICAgICAgICAgICAgIHBDaFZhcnNbUklHSFRdLT5meHBDb2VmLAotICAgICAgICAgICAgICAgIHBDaExlZnRTaGFyZS0+cUZvcm1hdCwKLSAgICAgICAgICAgICAgICBwQ2hSaWdodFNoYXJlLT5xRm9ybWF0KTsKLSAgICAgICAgfQotCi0gICAgICAgIGZvciAoY2ggPSAwOyAoY2ggPCBwTUNfSW5mby0+bmNoKTsgY2grKykKLSAgICAgICAgewotICAgICAgICAgICAgcEZyYW1lSW5mbyA9IHBWYXJzLT53aW5tYXBbcENoVmFyc1tjaF0tPnduZF07Ci0KLSAgICAgICAgICAgIC8qCi0gICAgICAgICAgICAgKiBOb3RlOiBUaGlzIE1QNCBsaWJyYXJ5IGFzc3VtZXMgdGhhdCBpZiB0aGVyZSBhcmUgdHdvIGNoYW5uZWxzLAotICAgICAgICAgICAgICogdGhlbiB0aGUgc2Vjb25kIGNoYW5uZWwgaXMgcmlnaHQgQU5EIGl0IHdhcyBhIGNvdXBsZWQgY2hhbm5lbCwKLSAgICAgICAgICAgICAqIHRoZXJlZm9yZSB0aGVyZSBpcyBubyBuZWVkIHRvIGNoZWNrIHRoZSAiaXNfY3BlIiBmbGFnLgotICAgICAgICAgICAgICovCi0KLSAgICAgICAgICAgIGlmIChjaCA+IDApCi0gICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgcG5zX2ludGVuc2l0eV9yaWdodCgKLSAgICAgICAgICAgICAgICAgICAgcFZhcnMtPmhhc21hc2ssCi0gICAgICAgICAgICAgICAgICAgIHBGcmFtZUluZm8sCi0gICAgICAgICAgICAgICAgICAgIHBDaFJpZ2h0U2hhcmUtPmdyb3VwLAotICAgICAgICAgICAgICAgICAgICBwVmFycy0+bWFzaywKLSAgICAgICAgICAgICAgICAgICAgcENoUmlnaHRTaGFyZS0+Y2JfbWFwLAotICAgICAgICAgICAgICAgICAgICBwQ2hMZWZ0U2hhcmUtPmZhY3RvcnMsCi0gICAgICAgICAgICAgICAgICAgIHBDaFJpZ2h0U2hhcmUtPmZhY3RvcnMsCi0gICAgICAgICAgICAgICAgICAgIHBDaFJpZ2h0U2hhcmUtPmx0X3N0YXR1cy5zZmJfcHJlZGljdGlvbl91c2VkLAotICAgICAgICAgICAgICAgICAgICBwQ2hSaWdodFNoYXJlLT5sdF9zdGF0dXMubHRwX2RhdGFfcHJlc2VudCwKLSAgICAgICAgICAgICAgICAgICAgcENoVmFyc1tMRUZUXS0+ZnhwQ29lZiwKLSAgICAgICAgICAgICAgICAgICAgcENoVmFyc1tSSUdIVF0tPmZ4cENvZWYsCi0gICAgICAgICAgICAgICAgICAgIHBDaExlZnRTaGFyZS0+cUZvcm1hdCwKLSAgICAgICAgICAgICAgICAgICAgcENoUmlnaHRTaGFyZS0+cUZvcm1hdCwKLSAgICAgICAgICAgICAgICAgICAgJihwVmFycy0+cG5zX2N1cl9ub2lzZV9zdGF0ZSkpOwotICAgICAgICAgICAgfQotCi0gICAgICAgICAgICBpZiAocENoVmFyc1tjaF0tPnBTaGFyZVdmeHBDb2VmLT5sdF9zdGF0dXMubHRwX2RhdGFfcHJlc2VudCAhPSBGQUxTRSkKLSAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAvKgotICAgICAgICAgICAgICAgICAqIExUUCAtIExvbmcgVGVybSBQcmVkaWN0aW9uCi0gICAgICAgICAgICAgICAgICovCi0KLSAgICAgICAgICAgICAgICBxUHJlZGljdGVkU2FtcGxlcyA9IGxvbmdfdGVybV9wcmVkaWN0aW9uKAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBDaFZhcnNbY2hdLT53bmQsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcENoVmFyc1tjaF0tPnBTaGFyZVdmeHBDb2VmLT5sdF9zdGF0dXMuCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgd2VpZ2h0X2luZGV4LAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBDaFZhcnNbY2hdLT5wU2hhcmVXZnhwQ29lZi0+bHRfc3RhdHVzLgotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRlbGF5LAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBDaFZhcnNbY2hdLT5sdHBfYnVmZmVyLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBWYXJzLT5sdHBfYnVmZmVyX3N0YXRlLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBDaFZhcnNbY2hdLT50aW1lX3F1YW50LAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBWYXJzLT5zaGFyZS5wcmVkaWN0ZWRTYW1wbGVzLCAgICAgIC8qIFNjcmF0Y2ggKi8KLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBmcmFtZUxlbmd0aCk7Ci0KLSAgICAgICAgICAgICAgICB0cmFuczRtX3RpbWVfMl9mcmVxX2Z4cCgKLSAgICAgICAgICAgICAgICAgICAgcFZhcnMtPnNoYXJlLnByZWRpY3RlZFNhbXBsZXMsCi0gICAgICAgICAgICAgICAgICAgIHBDaFZhcnNbY2hdLT53bmQsCi0gICAgICAgICAgICAgICAgICAgIHBDaFZhcnNbY2hdLT53bmRfc2hhcGVfcHJldl9iaywKLSAgICAgICAgICAgICAgICAgICAgcENoVmFyc1tjaF0tPnduZF9zaGFwZV90aGlzX2JrLAotICAgICAgICAgICAgICAgICAgICAmcVByZWRpY3RlZFNhbXBsZXMsCi0gICAgICAgICAgICAgICAgICAgIHBWYXJzLT5zY3JhdGNoLmZmdCk7ICAgLyogc2NyYXRjaCBtZW1vcnkgZm9yIEZGVCAqLwotCi0KLSAgICAgICAgICAgICAgICAvKgotICAgICAgICAgICAgICAgICAqIFRvIHNvbHZlIGEgcG90ZW50aWFsIHByb2JsZW0gd2hlcmUgYSBwb2ludGVyIHRpZWQgdG8KLSAgICAgICAgICAgICAgICAgKiB0aGUgcUZvcm1hdCB3YXMgYmVpbmcgaW5jcmVtZW50ZWQsIGEgcG9pbnRlciB0bwotICAgICAgICAgICAgICAgICAqIHBDaFZhcnNbY2hdLT5xRm9ybWF0IGlzIHBhc3NlZCBpbiBoZXJlIHJhdGhlciB0aGFuCi0gICAgICAgICAgICAgICAgICogdGhlIGFkZHJlc3Mgb2YgcVByZWRpY3RlZFNhbXBsZXMuCi0gICAgICAgICAgICAgICAgICoKLSAgICAgICAgICAgICAgICAgKiBOZWl0aGVyIHZhbHVlcyBhcmUgYWN0dWFsbHkgbmVlZGVkIGluIHRoZSBjYXNlIG9mCi0gICAgICAgICAgICAgICAgICogaW52ZXJzZSBmaWx0ZXJpbmcsIGJ1dCB0aGUgcG9pbnRlciB3YXMgYmVpbmcKLSAgICAgICAgICAgICAgICAgKiBwYXNzZWQgKGFuZCBpbmNyZW1lbnRlZCkgcmVnYXJkbGVzcy4KLSAgICAgICAgICAgICAgICAgKgotICAgICAgICAgICAgICAgICAqIFNvLCB0aGUgc29sdXRpb24gaXMgdG8gcGFzcyBhIHNwYWNlIG9mIG1lbW9yeQotICAgICAgICAgICAgICAgICAqIHRoYXQgYSBwb2ludGVyIGNhbiBoYXBwaWx5IHBvaW50IHRvLgotICAgICAgICAgICAgICAgICAqLwotCi0gICAgICAgICAgICAgICAgLyogVGhpcyBpcyB0aGUgaW52ZXJzZSBmaWx0ZXIgKi8KLSAgICAgICAgICAgICAgICBhcHBseV90bnMoCi0gICAgICAgICAgICAgICAgICAgIHBWYXJzLT5zaGFyZS5wcmVkaWN0ZWRTYW1wbGVzLCAgLyogc2NyYXRjaCByZS11c2VkIGZvciBlYWNoIGNoICovCi0gICAgICAgICAgICAgICAgICAgIHBDaFZhcnNbY2hdLT5wU2hhcmVXZnhwQ29lZi0+cUZvcm1hdCwgICAgIC8qIE5vdCB1c2VkIGJ5IHRoZSBpbnZfZmlsdGVyICovCi0gICAgICAgICAgICAgICAgICAgIHBGcmFtZUluZm8sCi0gICAgICAgICAgICAgICAgICAgICYocENoVmFyc1tjaF0tPnBTaGFyZVdmeHBDb2VmLT50bnMpLAotICAgICAgICAgICAgICAgICAgICBUUlVFLCAgICAgICAgICAgICAgICAgICAgICAgLyogVFJVRSBpcyBGSVIgKi8KLSAgICAgICAgICAgICAgICAgICAgcFZhcnMtPnNjcmF0Y2gudG5zX2ludl9maWx0ZXIpOwotCi0gICAgICAgICAgICAgICAgLyoKLSAgICAgICAgICAgICAgICAgKiBGb3IgdGhlIG5leHQgZnVuY3Rpb24gbG9uZ190ZXJtX3N5bnRoZXNpcywKLSAgICAgICAgICAgICAgICAgKiB0aGUgdGhpcmQgcGFyYW0gd2luX3NmYl90b3BbXSwgYW5kCi0gICAgICAgICAgICAgICAgICogdGhlIHRlbnRoIHBhcmFtIGNvZWZfcGVyX3dpbiwKLSAgICAgICAgICAgICAgICAgKiBhcmUgdXNlZCBkaWZmZXJlbnRseSB0aGF0IGluIHRoZSByZXN0IG9mIHRoZSBwcm9qZWN0LiBUaGlzCi0gICAgICAgICAgICAgICAgICogaXMgYmVjYXVzZSBvcmlnaW5hbGx5IHRoZSBJU08gY29kZSB3YXMgZ29pbmcgdG8gaGF2ZQotICAgICAgICAgICAgICAgICAqIHRoZXNlIHBhcmFtZXRlcnMgY2hhbmdlIGFzIHRoZSAic2hvcnQgd2luZG93IiBjaGFuZ2VkLgotICAgICAgICAgICAgICAgICAqIFRoZXNlIGFyZSBhbGwgbm93IHRoZSBzYW1lIHZhbHVlIGZvciBlYWNoIG9mIHRoZSBlaWdodAotICAgICAgICAgICAgICAgICAqIHdpbmRvd3MuICBUaGlzIGlzIHdoeSB0aGVyZSBpcyBhIFswXSBhdCB0aGUKLSAgICAgICAgICAgICAgICAgKiBlbmQgb2YgZWFjaCBvZiB0aGVzZXMgcGFyYW1ldGVycy4KLSAgICAgICAgICAgICAgICAgKiBOb3RlIGluIHBhcnRpY3VsYXIgdGhhdCB3aW5fc2ZiX3RvcCB3YXMgb3JpZ2luYWxseSBhbgotICAgICAgICAgICAgICAgICAqIGFycmF5IG9mIHBvaW50ZXJzIHRvIGFycmF5cywgYnV0IGluc2lkZSBsb25nX3Rlcm1fc3ludGhlc2lzCi0gICAgICAgICAgICAgICAgICogaXQgaXMgbm93IGEgc2ltcGxlIGFycmF5LgotICAgICAgICAgICAgICAgICAqIFdoZW4gdGhlIHJlc3Qgb2YgdGhlIHByb2plY3QgZnVuY3Rpb25zIGFyZSBjaGFuZ2VkLCB0aGUKLSAgICAgICAgICAgICAgICAgKiBzdHJ1Y3R1cmUgRnJhbWVJbmZvIGNoYW5nZXMsIGFuZCB0aGUgWzBdJ3MgYXJlIHJlbW92ZWQsCi0gICAgICAgICAgICAgICAgICogdGhpcyBjb21tZW50IGNvdWxkIGdvIGF3YXkuCi0gICAgICAgICAgICAgICAgICovCi0gICAgICAgICAgICAgICAgbG9uZ190ZXJtX3N5bnRoZXNpcygKLSAgICAgICAgICAgICAgICAgICAgcENoVmFyc1tjaF0tPnduZCwKLSAgICAgICAgICAgICAgICAgICAgcENoVmFyc1tjaF0tPnBTaGFyZVdmeHBDb2VmLT5tYXhfc2ZiLAotICAgICAgICAgICAgICAgICAgICBwRnJhbWVJbmZvLT53aW5fc2ZiX3RvcFswXSwgLyogTG9vayBhYm92ZSAqLwotICAgICAgICAgICAgICAgICAgICBwQ2hWYXJzW2NoXS0+cFNoYXJlV2Z4cENvZWYtPmx0X3N0YXR1cy53aW5fcHJlZGljdGlvbl91c2VkLAotICAgICAgICAgICAgICAgICAgICBwQ2hWYXJzW2NoXS0+cFNoYXJlV2Z4cENvZWYtPmx0X3N0YXR1cy5zZmJfcHJlZGljdGlvbl91c2VkLAotICAgICAgICAgICAgICAgICAgICBwQ2hWYXJzW2NoXS0+ZnhwQ29lZiwgICAvKiBpbnB1dCBhbmQgb3V0cHV0ICovCi0gICAgICAgICAgICAgICAgICAgIHBDaFZhcnNbY2hdLT5wU2hhcmVXZnhwQ29lZi0+cUZvcm1hdCwgICAvKiBpbnB1dCBhbmQgb3V0cHV0ICovCi0gICAgICAgICAgICAgICAgICAgIHBWYXJzLT5zaGFyZS5wcmVkaWN0ZWRTYW1wbGVzLAotICAgICAgICAgICAgICAgICAgICBxUHJlZGljdGVkU2FtcGxlcywgICAgICAgLyogcSBmb3JtYXQgZm9yIHByZXZpb3VzIGFyYXkgKi8KLSAgICAgICAgICAgICAgICAgICAgcEZyYW1lSW5mby0+Y29lZl9wZXJfd2luWzBdLCAvKiBMb29rIGFib3ZlICovCi0gICAgICAgICAgICAgICAgICAgIE5VTV9TSE9SVF9XSU5ET1dTLAotICAgICAgICAgICAgICAgICAgICBOVU1fUkVDT05TVFJVQ1RFRF9TRkIpOwotCi0gICAgICAgICAgICB9IC8qIGVuZCBpZiAocENoVmFyc1tjaF0tPmx0X3N0YXR1cy5sdHBfZGF0YV9wcmVzZW50ICE9IEZBTFNFKSAqLwotCi0gICAgICAgIH0gLyogZm9yKGNoKSAqLwotCi0gICAgICAgIGZvciAoY2ggPSAwOyAoY2ggPCBwTUNfSW5mby0+bmNoKTsgY2grKykKLSAgICAgICAgewotCi0gICAgICAgICAgICBwRnJhbWVJbmZvID0gcFZhcnMtPndpbm1hcFtwQ2hWYXJzW2NoXS0+d25kXTsKLQotICAgICAgICAgICAgLyoKLSAgICAgICAgICAgICAqIFROUyAtIFRlbXBvcmFsIE5vaXNlIFNoYXBpbmcKLSAgICAgICAgICAgICAqLwotCi0gICAgICAgICAgICAvKiBUaGlzIGlzIHRoZSBmb3J3YXJkIGZpbHRlcgotICAgICAgICAgICAgICoKLSAgICAgICAgICAgICAqIEEgc3BlY2lhbCBub3RlOiAgU2NyYXRjaCBtZW1vcnkgaXMgbm90IHVzZWQgYnkKLSAgICAgICAgICAgICAqIHRoZSBmb3J3YXJkIGZpbHRlciwgYnV0IGlzIHBhc3NlZCBpbiB0byBtYWludGFpbgotICAgICAgICAgICAgICogY29tbW9uIGludGVyZmFjZSBmb3IgaW52ZXJzZSBhbmQgZm9yd2FyZCBmaWx0ZXIKLSAgICAgICAgICAgICAqLwotICAgICAgICAgICAgYXBwbHlfdG5zKAotICAgICAgICAgICAgICAgIHBDaFZhcnNbY2hdLT5meHBDb2VmLAotICAgICAgICAgICAgICAgIHBDaFZhcnNbY2hdLT5wU2hhcmVXZnhwQ29lZi0+cUZvcm1hdCwKLSAgICAgICAgICAgICAgICBwRnJhbWVJbmZvLAotICAgICAgICAgICAgICAgICYocENoVmFyc1tjaF0tPnBTaGFyZVdmeHBDb2VmLT50bnMpLAotICAgICAgICAgICAgICAgIEZBTFNFLCAgICAgICAgICAgICAgICAgICAvKiBGQUxTRSBpcyBJSVIgKi8KLSAgICAgICAgICAgICAgICBwVmFycy0+c2NyYXRjaC50bnNfaW52X2ZpbHRlcik7Ci0KLSAgICAgICAgICAgIC8qCi0gICAgICAgICAgICAgKiBOb3JtYWxpemUgdGhlIHEgZm9ybWF0IGFjcm9zcyBhbGwgc2NhbGUgZmFjdG9yIGJhbmRzCi0gICAgICAgICAgICAgKiB0byBvbmUgdmFsdWUuCi0gICAgICAgICAgICAgKi8KLSAgICAgICAgICAgIHFGb3JtYXROb3JtID0KLSAgICAgICAgICAgICAgICBxX25vcm1hbGl6ZSgKLSAgICAgICAgICAgICAgICAgICAgcENoVmFyc1tjaF0tPnBTaGFyZVdmeHBDb2VmLT5xRm9ybWF0LAotICAgICAgICAgICAgICAgICAgICBwRnJhbWVJbmZvLAotICAgICAgICAgICAgICAgICAgICBwQ2hWYXJzW2NoXS0+YWJzX21heF9wZXJfd2luZG93LAotICAgICAgICAgICAgICAgICAgICBwQ2hWYXJzW2NoXS0+ZnhwQ29lZik7Ci0KLSAgICAgICAgICAgIC8qCi0gICAgICAgICAgICAgKiAgZmlsdGVyYmFuayAtIGNvbnZlcnRzIGZyZXF1ZW5jeSBjb2VmaWNpZW50cyB0byB0aW1lIGRvbWFpbi4KLSAgICAgICAgICAgICAqLwotCi0jaWZkZWYgQUFDX1BMVVMKLSAgICAgICAgICAgIGlmIChzYnJCaXRTdHJlYW0tPk5yRWxlbWVudHMgPT0gMCAmJiBwTUNfSW5mby0+dXBzYW1wbGluZ0ZhY3RvciA9PSAxKQotICAgICAgICAgICAgewotICAgICAgICAgICAgICAgIHRyYW5zNG1fZnJlcV8yX3RpbWVfZnhwXzIoCi0gICAgICAgICAgICAgICAgICAgIHBDaFZhcnNbY2hdLT5meHBDb2VmLAotICAgICAgICAgICAgICAgICAgICBwQ2hWYXJzW2NoXS0+dGltZV9xdWFudCwKLSAgICAgICAgICAgICAgICAgICAgcENoVmFyc1tjaF0tPnduZCwgICAvKiB3aW5kb3cgc2VxdWVuY2UgKi8KLSAgICAgICAgICAgICAgICAgICAgcENoVmFyc1tjaF0tPnduZF9zaGFwZV9wcmV2X2JrLAotICAgICAgICAgICAgICAgICAgICBwQ2hWYXJzW2NoXS0+d25kX3NoYXBlX3RoaXNfYmssCi0gICAgICAgICAgICAgICAgICAgIHFGb3JtYXROb3JtLAotICAgICAgICAgICAgICAgICAgICBwQ2hWYXJzW2NoXS0+YWJzX21heF9wZXJfd2luZG93LAotICAgICAgICAgICAgICAgICAgICBwVmFycy0+c2NyYXRjaC5mZnQsCi0gICAgICAgICAgICAgICAgICAgICZwRXh0LT5wT3V0cHV0QnVmZmVyW2NoXSk7Ci0gICAgICAgICAgICAgICAgLyoKLSAgICAgICAgICAgICAgICAgKiAgVXBkYXRlIExUUCBidWZmZXJzIGlmIG5lZWRlZAotICAgICAgICAgICAgICAgICAqLwotCi0gICAgICAgICAgICAgICAgaWYgKHBWYXJzLT5tY19pbmZvLmF1ZGlvT2JqZWN0VHlwZSA9PSBNUDRBVURJT19MVFApCi0gICAgICAgICAgICAgICAgewotICAgICAgICAgICAgICAgICAgICBJbnQxNiAqIHB0ID0gJnBFeHQtPnBPdXRwdXRCdWZmZXJbY2hdOwotICAgICAgICAgICAgICAgICAgICBJbnQxNiAqIHB0ciA9ICYocENoVmFyc1tjaF0tPmx0cF9idWZmZXJbcFZhcnMtPmx0cF9idWZmZXJfc3RhdGVdKTsKLSAgICAgICAgICAgICAgICAgICAgSW50MTYgIHgsIHk7Ci0gICAgICAgICAgICAgICAgICAgIGZvciAoSW50MzIgaSA9IEhBTEZfTE9OR19XSU5ET1c7IGkgIT0gMDsgaS0tKQotICAgICAgICAgICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgICAgICAgICB4ID0gKnB0OwotICAgICAgICAgICAgICAgICAgICAgICAgcHQgKz0gMjsKLSAgICAgICAgICAgICAgICAgICAgICAgIHkgPSAqcHQ7Ci0gICAgICAgICAgICAgICAgICAgICAgICBwdCArPSAyOwotICAgICAgICAgICAgICAgICAgICAgICAgKihwdHIrKykgPSAgeDsKLSAgICAgICAgICAgICAgICAgICAgICAgICoocHRyKyspID0gIHk7Ci0gICAgICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICB9Ci0gICAgICAgICAgICBlbHNlCi0gICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgdHJhbnM0bV9mcmVxXzJfdGltZV9meHBfMSgKLSAgICAgICAgICAgICAgICAgICAgcENoVmFyc1tjaF0tPmZ4cENvZWYsCi0gICAgICAgICAgICAgICAgICAgIHBDaFZhcnNbY2hdLT50aW1lX3F1YW50LAotICAgICAgICAgICAgICAgICAgICAmKHBDaFZhcnNbY2hdLT5sdHBfYnVmZmVyW3BWYXJzLT5sdHBfYnVmZmVyX3N0YXRlICsgMjg4XSksCi0gICAgICAgICAgICAgICAgICAgIHBDaFZhcnNbY2hdLT53bmQsICAgLyogd2luZG93IHNlcXVlbmNlICovCi0gICAgICAgICAgICAgICAgICAgIHBDaFZhcnNbY2hdLT53bmRfc2hhcGVfcHJldl9iaywKLSAgICAgICAgICAgICAgICAgICAgcENoVmFyc1tjaF0tPnduZF9zaGFwZV90aGlzX2JrLAotICAgICAgICAgICAgICAgICAgICBxRm9ybWF0Tm9ybSwKLSAgICAgICAgICAgICAgICAgICAgcENoVmFyc1tjaF0tPmFic19tYXhfcGVyX3dpbmRvdywKLSAgICAgICAgICAgICAgICAgICAgcFZhcnMtPnNjcmF0Y2guZmZ0KTsKLQotICAgICAgICAgICAgfQotI2Vsc2UKLQotICAgICAgICAgICAgdHJhbnM0bV9mcmVxXzJfdGltZV9meHBfMigKLSAgICAgICAgICAgICAgICBwQ2hWYXJzW2NoXS0+ZnhwQ29lZiwKLSAgICAgICAgICAgICAgICBwQ2hWYXJzW2NoXS0+dGltZV9xdWFudCwKLSAgICAgICAgICAgICAgICBwQ2hWYXJzW2NoXS0+d25kLCAgIC8qIHdpbmRvdyBzZXF1ZW5jZSAqLwotICAgICAgICAgICAgICAgIHBDaFZhcnNbY2hdLT53bmRfc2hhcGVfcHJldl9iaywKLSAgICAgICAgICAgICAgICBwQ2hWYXJzW2NoXS0+d25kX3NoYXBlX3RoaXNfYmssCi0gICAgICAgICAgICAgICAgcUZvcm1hdE5vcm0sCi0gICAgICAgICAgICAgICAgcENoVmFyc1tjaF0tPmFic19tYXhfcGVyX3dpbmRvdywKLSAgICAgICAgICAgICAgICBwVmFycy0+c2NyYXRjaC5mZnQsCi0gICAgICAgICAgICAgICAgJnBFeHQtPnBPdXRwdXRCdWZmZXJbY2hdKTsKLSAgICAgICAgICAgIC8qCi0gICAgICAgICAgICAgKiAgVXBkYXRlIExUUCBidWZmZXJzIG9ubHkgaWYgbmVlZGVkCi0gICAgICAgICAgICAgKi8KLQotICAgICAgICAgICAgaWYgKHBWYXJzLT5tY19pbmZvLmF1ZGlvT2JqZWN0VHlwZSA9PSBNUDRBVURJT19MVFApCi0gICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgSW50MTYgKiBwdCA9ICZwRXh0LT5wT3V0cHV0QnVmZmVyW2NoXTsKLSAgICAgICAgICAgICAgICBJbnQxNiAqIHB0ciA9ICYocENoVmFyc1tjaF0tPmx0cF9idWZmZXJbcFZhcnMtPmx0cF9idWZmZXJfc3RhdGVdKTsKLSAgICAgICAgICAgICAgICBJbnQxNiAgeCwgeTsKLSAgICAgICAgICAgICAgICBmb3IgKEludDMyIGkgPSBIQUxGX0xPTkdfV0lORE9XOyBpICE9IDA7IGktLSkKLSAgICAgICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgICAgIHggPSAqcHQ7Ci0gICAgICAgICAgICAgICAgICAgIHB0ICs9IDI7Ci0gICAgICAgICAgICAgICAgICAgIHkgPSAqcHQ7Ci0gICAgICAgICAgICAgICAgICAgIHB0ICs9IDI7Ci0gICAgICAgICAgICAgICAgICAgICoocHRyKyspID0gIHg7Ci0gICAgICAgICAgICAgICAgICAgICoocHRyKyspID0gIHk7Ci0gICAgICAgICAgICAgICAgfQotCi0gICAgICAgICAgICB9Ci0KLQotI2VuZGlmCi0KLQotICAgICAgICAgICAgLyogVXBkYXRlIHRoZSB3aW5kb3cgc2hhcGUgKi8KLSAgICAgICAgICAgIHBDaFZhcnNbY2hdLT53bmRfc2hhcGVfcHJldl9iayA9IHBDaFZhcnNbY2hdLT53bmRfc2hhcGVfdGhpc19iazsKLQotICAgICAgICB9IC8qIGVuZCBmb3IoKSAqLwotCi0KLSAgICAgICAgLyoKLSAgICAgICAgICogQ29weSB0byB0aGUgZmluYWwgb3V0cHV0IGJ1ZmZlciwgdGFraW5nIGludG8gYWNjb3VudCB0aGUgZGVzaXJlZAotICAgICAgICAgKiBjaGFubmVscyBmcm9tIHRoZSBjYWxsaW5nIGVudmlyb25tZW50LCB0aGUgYWN0dWFsIGNoYW5uZWxzLCBhbmQKLSAgICAgICAgICogd2hldGhlciB0aGUgZGF0YSBzaG91bGQgYmUgaW50ZXJsZWF2ZWQgb3Igbm90LgotICAgICAgICAgKgotICAgICAgICAgKiBJZiB0aGUgc3RyZWFtIGhhZCBvbmx5IG9uZSBjaGFubmVsLCB3cml0ZV9vdXRwdXQgd2lsbCBub3QgdXNlCi0gICAgICAgICAqIHRoZSByaWdodCBjaGFubmVsIGRhdGEuCi0gICAgICAgICAqCi0gICAgICAgICAqLwotCi0KLSAgICAgICAgLyogQ09OU0lERVIgVVNFIE9GIERNQSBPUFRJTUlaQVRJT05TIFdJVEhJTiBUSEUgd3JpdGVfb3V0cHV0IEZVTkNUSU9OLgotICAgICAgICAgKgotICAgICAgICAgKiBJdCBpcyBwcmVzdW1lZCB0aGF0IHRoZSBsdHBfYnVmZmVyIHdpbGwgcmVzaWRlIGluIGludGVybmFsIChmYXN0KQotICAgICAgICAgKiBtZW1vcnksIHdoaWxlIHRoZSBwRXh0LT5wT3V0cHV0QnVmZmVyIHdpbGwgcmVzaWRlIGluIGV4dGVybmFsCi0gICAgICAgICAqIChzbG93KSBtZW1vcnkuCi0gICAgICAgICAqCi0gICAgICAgICAqLwotCi0KLSNpZmRlZiBBQUNfUExVUwotCi0gICAgICAgIGlmIChzYnJCaXRTdHJlYW0tPk5yRWxlbWVudHMgfHwgcE1DX0luZm8tPnVwc2FtcGxpbmdGYWN0b3IgPT0gMikKLSAgICAgICAgewotCi0gICAgICAgICAgICBpZiAocFZhcnMtPmJubyA8PSAxKSAgIC8qIGFsbG93cyBjb25zb2xlIHRvIG9wZXJhdGUgd2l0aCBBRElGIGFuZCBhdWRpbyBjb25maWcgKi8KLSAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICBpZiAoc2JyRGVjLT5vdXRTYW1wbGVSYXRlID09IDApIC8qIGRvIGl0IG9ubHkgb25jZSAoZGlzcmVnYXJkaW5nIG9mIHNpZ25hbGluZyB0eXBlKSAqLwotICAgICAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAgICAgc2JyX29wZW4oc2FtcF9yYXRlX2luZm9bcFZhcnMtPm1jX2luZm8uc2FtcGxpbmdfcmF0ZV9pZHhdLnNhbXBfcmF0ZSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2JyRGVjLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzYnJEZWNvZGVyRGF0YSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcFZhcnMtPm1jX2luZm8uYkRvd25TYW1wbGVkU2JyKTsKLSAgICAgICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgIH0KLSAgICAgICAgICAgIHBNQ19JbmZvLT51cHNhbXBsaW5nRmFjdG9yID0KLSAgICAgICAgICAgICAgICBzYnJEZWNvZGVyRGF0YS0+U2JyQ2hhbm5lbFswXS5mcmFtZURhdGEuc2JyX2hlYWRlci5zYW1wbGVSYXRlTW9kZTsKLQotCi0gICAgICAgICAgICAvKiByZXVzZSByaWdodCBhYWMgc3BlY3RydW0gY2hhbm5lbCAgKi8KLSAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICBJbnQxNiAqcHRfbGVmdCAgPSAgJihwQ2hWYXJzW0xFRlQgXS0+bHRwX2J1ZmZlcltwVmFycy0+bHRwX2J1ZmZlcl9zdGF0ZV0pOwotICAgICAgICAgICAgICAgIEludDE2ICpwdF9yaWdodCA9ICAmKHBDaFZhcnNbUklHSFRdLT5sdHBfYnVmZmVyW3BWYXJzLT5sdHBfYnVmZmVyX3N0YXRlXSk7Ci0KLSAgICAgICAgICAgICAgICBpZiAoc2JyX2FwcGxpZWQoc2JyRGVjb2RlckRhdGEsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNickJpdFN0cmVhbSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcHRfbGVmdCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcHRfcmlnaHQsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBFeHQtPnBPdXRwdXRCdWZmZXIsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNickRlYywKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcFZhcnMsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBNQ19JbmZvLT5uY2gpICE9IFNCUkRFQ19PSykKLSAgICAgICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgICAgIHN0YXR1cyA9IE1QNEFVREVDX0lOVkFMSURfRlJBTUU7Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgfQotCi0KLSAgICAgICAgfSAgLyogIGlmKCBwRXh0LT5hYWNQbHVzRW5hYmxlZCA9PSBGQUxTRSkgKi8KLSNlbmRpZgotCi0gICAgICAgIC8qCi0gICAgICAgICAqIENvcGllZCBtb25vIGRhdGEgaW4gYm90aCBjaGFubmVscyBvciBqdXN0IGxlYXZlIGl0IGFzIG1vbm8sCi0gICAgICAgICAqIGFjY29yZGluZyB3aXRoIGRlc2lyZWRDaGFubmVscyAoZGVmYXVsdCBpcyAyKQotICAgICAgICAgKi8KLQotICAgICAgICBpZiAocEV4dC0+ZGVzaXJlZENoYW5uZWxzID09IDIpCi0gICAgICAgIHsKLQotI2lmIGRlZmluZWQoQUFDX1BMVVMpCi0jaWYgZGVmaW5lZChQQVJBTUVUUklDU1RFUkVPKSYmZGVmaW5lZChIUV9TQlIpCi0gICAgICAgICAgICBpZiAocE1DX0luZm8tPm5jaCAhPSAyICYmIHBNQ19JbmZvLT5wc1ByZXNlbnRGbGFnICE9IDEpCi0jZWxzZQotICAgICAgICAgICAgaWYgKHBNQ19JbmZvLT5uY2ggIT0gMikKLSNlbmRpZgotI2Vsc2UKLSAgICAgICAgICAgIGlmIChwTUNfSW5mby0+bmNoICE9IDIpCi0jZW5kaWYKLSAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAvKiBtb25vICovCi0KLQotICAgICAgICAgICAgICAgIEludDE2ICogcHQgID0gJnBFeHQtPnBPdXRwdXRCdWZmZXJbMF07Ci0gICAgICAgICAgICAgICAgSW50MTYgKiBwdDIgPSAmcEV4dC0+cE91dHB1dEJ1ZmZlclsxXTsKLSAgICAgICAgICAgICAgICBJbnQgaTsKLSAgICAgICAgICAgICAgICBpZiAocE1DX0luZm8tPnVwc2FtcGxpbmdGYWN0b3IgPT0gMikKLSAgICAgICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgICAgIGZvciAoaSA9IDA7IGkgPCAxMDI0OyBpKyspCi0gICAgICAgICAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAgICAgICAgICpwdDIgPSAqcHQ7Ci0gICAgICAgICAgICAgICAgICAgICAgICBwdCArPSAyOwotICAgICAgICAgICAgICAgICAgICAgICAgcHQyICs9IDI7Ci0gICAgICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICAgICAgcHQgID0gJnBFeHQtPnBPdXRwdXRCdWZmZXJfcGx1c1swXTsKLSAgICAgICAgICAgICAgICAgICAgcHQyID0gJnBFeHQtPnBPdXRwdXRCdWZmZXJfcGx1c1sxXTsKLQotICAgICAgICAgICAgICAgICAgICBmb3IgKGkgPSAwOyBpIDwgMTAyNDsgaSsrKQotICAgICAgICAgICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgICAgICAgICAqcHQyID0gKnB0OwotICAgICAgICAgICAgICAgICAgICAgICAgcHQgKz0gMjsKLSAgICAgICAgICAgICAgICAgICAgICAgIHB0MiArPSAyOwotICAgICAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgIGVsc2UKLSAgICAgICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgICAgIGZvciAoaSA9IDA7IGkgPCAxMDI0OyBpKyspCi0gICAgICAgICAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAgICAgICAgICpwdDIgPSAqcHQ7Ci0gICAgICAgICAgICAgICAgICAgICAgICBwdCArPSAyOwotICAgICAgICAgICAgICAgICAgICAgICAgcHQyICs9IDI7Ci0gICAgICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgIH0KLQotI2lmIGRlZmluZWQoQUFDX1BMVVMpCi0jaWYgZGVmaW5lZChQQVJBTUVUUklDU1RFUkVPKSYmZGVmaW5lZChIUV9TQlIpCi0KLSAgICAgICAgICAgIGVsc2UgaWYgKHBNQ19JbmZvLT5wc1ByZXNlbnRGbGFnID09IDEpCi0gICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgSW50MzIgZnJhbWVTaXplID0gMDsKLSAgICAgICAgICAgICAgICBpZiAocEV4dC0+YWFjUGx1c0VuYWJsZWQgPT0gZmFsc2UpCi0gICAgICAgICAgICAgICAgewotICAgICAgICAgICAgICAgICAgICAvKgotICAgICAgICAgICAgICAgICAgICAgKiAgRGVjb2RpbmcgZWFhYysgd2hlbiBvbmx5IGFhYyBpcyBlbmFibGVkLCBjb3B5IEwgaW50byBSCi0gICAgICAgICAgICAgICAgICAgICAqLwotICAgICAgICAgICAgICAgICAgICBmcmFtZVNpemUgPSAxMDI0OwotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICBlbHNlIGlmIChzYnJEZWNvZGVyRGF0YS0+U2JyQ2hhbm5lbFswXS5zeW5jU3RhdGUgIT0gU0JSX0FDVElWRSkKLSAgICAgICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgICAgIC8qCi0gICAgICAgICAgICAgICAgICAgICAqICBEZWNvZGluZyBlYWFjKyB3aGVuIG5vIFBTIGRhdGEgd2FzIGZvdW5kLCBjb3B5IHVwc2FtcGxlZCBMIGludG8gUgotICAgICAgICAgICAgICAgICAgICAgKi8KLSAgICAgICAgICAgICAgICAgICAgZnJhbWVTaXplID0gMjA0ODsKLSAgICAgICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgICAgICBJbnQxNiAqIHB0ICA9ICZwRXh0LT5wT3V0cHV0QnVmZmVyWzBdOwotICAgICAgICAgICAgICAgIEludDE2ICogcHQyID0gJnBFeHQtPnBPdXRwdXRCdWZmZXJbMV07Ci0gICAgICAgICAgICAgICAgSW50IGk7Ci0gICAgICAgICAgICAgICAgZm9yIChpID0gMDsgaSA8IGZyYW1lU2l6ZTsgaSsrKQotICAgICAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAgICAgKnB0MiA9ICpwdDsKLSAgICAgICAgICAgICAgICAgICAgcHQgKz0gMjsKLSAgICAgICAgICAgICAgICAgICAgcHQyICs9IDI7Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgfQotI2VuZGlmCi0jZW5kaWYKLQotICAgICAgICB9Ci0gICAgICAgIGVsc2UKLSAgICAgICAgewotCi0jaWYgZGVmaW5lZChBQUNfUExVUykKLSNpZiBkZWZpbmVkKFBBUkFNRVRSSUNTVEVSRU8pJiZkZWZpbmVkKEhRX1NCUikKLSAgICAgICAgICAgIGlmIChwTUNfSW5mby0+bmNoICE9IDIgJiYgcE1DX0luZm8tPnBzUHJlc2VudEZsYWcgIT0gMSkKLSNlbHNlCi0gICAgICAgICAgICBpZiAocE1DX0luZm8tPm5jaCAhPSAyKQotI2VuZGlmCi0jZWxzZQotICAgICAgICAgICAgaWYgKHBNQ19JbmZvLT5uY2ggIT0gMikKLSNlbmRpZgotICAgICAgICAgICAgewotICAgICAgICAgICAgICAgIC8qIG1vbm8gKi8KLSAgICAgICAgICAgICAgICBJbnQxNiAqIHB0ICA9ICZwRXh0LT5wT3V0cHV0QnVmZmVyWzBdOwotICAgICAgICAgICAgICAgIEludDE2ICogcHQyID0gJnBFeHQtPnBPdXRwdXRCdWZmZXJbMF07Ci0gICAgICAgICAgICAgICAgSW50IGk7Ci0KLSAgICAgICAgICAgICAgICBpZiAocE1DX0luZm8tPnVwc2FtcGxpbmdGYWN0b3IgPT0gMikKLSAgICAgICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgICAgIGZvciAoaSA9IDA7IGkgPCAxMDI0OyBpKyspCi0gICAgICAgICAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAgICAgICAgICpwdDIrKyA9ICpwdDsKLSAgICAgICAgICAgICAgICAgICAgICAgIHB0ICs9IDI7Ci0gICAgICAgICAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgICAgICAgICBwdCAgPSAmcEV4dC0+cE91dHB1dEJ1ZmZlcl9wbHVzWzBdOwotICAgICAgICAgICAgICAgICAgICBwdDIgPSAmcEV4dC0+cE91dHB1dEJ1ZmZlcl9wbHVzWzBdOwotCi0gICAgICAgICAgICAgICAgICAgIGZvciAoaSA9IDA7IGkgPCAxMDI0OyBpKyspCi0gICAgICAgICAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAgICAgICAgICpwdDIrKyA9ICpwdDsKLSAgICAgICAgICAgICAgICAgICAgICAgIHB0ICs9IDI7Ci0gICAgICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgZWxzZQotICAgICAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAgICAgZm9yIChpID0gMDsgaSA8IDEwMjQ7IGkrKykKLSAgICAgICAgICAgICAgICAgICAgewotICAgICAgICAgICAgICAgICAgICAgICAgKnB0MisrID0gKnB0OwotICAgICAgICAgICAgICAgICAgICAgICAgcHQgKz0gMjsKLSAgICAgICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgfQ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ZS4KLSAgICAgICAgICAgICAqLwotICAgICAgICAgICAgcEV4dC0+c2FtcGxpbmdSYXRlID0KLSAgICAgICAgICAgICAgICBzYW1wX3JhdGVfaW5mb1twVmFycy0+bWNfaW5mby5zYW1wbGluZ19yYXRlX2lkeF0uc2FtcF9yYXRlOwotCi0gICAgICAgICAgICBwVmFycy0+bWNfaW5mby5pbXBsaWNpdF9jaGFubmVsaW5nID0gMDsgLyogZGlzYWJsZSBmbGFnLCBhcyB0aGlzIGlzIGFsbG93ZWQKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICogb25seSB0aGUgZmlyc3QgdGltZQotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLQotCi0jaWZkZWYgQUFDX1BMVVMKLQotICAgICAgICAgICAgaWYgKHBNQ19JbmZvLT51cHNhbXBsaW5nRmFjdG9yID09IDIpCi0gICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgcEV4dC0+c2FtcGxpbmdSYXRlICo9IHBNQ19JbmZvLT51cHNhbXBsaW5nRmFjdG9yOwotICAgICAgICAgICAgICAgIHBFeHQtPmFhY1BsdXNVcHNhbXBsaW5nRmFjdG9yID0gcE1DX0luZm8tPnVwc2FtcGxpbmdGYWN0b3I7Ci0gICAgICAgICAgICB9Ci0KLSNlbmRpZgotCi0gICAgICAgICAgICBwRXh0LT5leHRlbmRlZEF1ZGlvT2JqZWN0VHlwZSA9IHBNQ19JbmZvLT5FeHRlbmRlZEF1ZGlvT2JqZWN0VHlwZTsKLSAgICAgICAgICAgIHBFeHQtPmF1ZGlvT2JqZWN0VHlwZSA9IHBNQ19JbmZvLT5hdWRpb09iamVjdFR5cGU7Ci0KLSAgICAgICAgICAgIHBFeHQtPmVuY29kZWRDaGFubmVscyA9IHBNQ19JbmZvLT5uY2g7Ci0gICAgICAgICAgICBwRXh0LT5mcmFtZUxlbmd0aCA9IHBWYXJzLT5mcmFtZUxlbmd0aDsKLSAgICAgICAgfQotCi0gICAgICAgIHBWYXJzLT5ibm8rKzsKLQotCi0gICAgICAgIC8qCi0gICAgICAgICAqIFVzaW5nIHVuaXQgYW5hbHlzaXMsIHRoZSBiaXRyYXRlIGlzIGEgZnVuY3Rpb24gb2YgdGhlIHNhbXBsaW5nIHJhdGUsIGJpdHMsCi0gICAgICAgICAqIHBvaW50cyBpbiBhIGZyYW1lCi0gICAgICAgICAqCi0gICAgICAgICAqICAgICBiaXRzICAgICAgICBzYW1wbGVzICAgICAgICAgICAgICAgIGZyYW1lCi0gICAgICAgICAqICAgICAtLS0tICA9ICAgIC0tLS0tLS0tLSAqICBiaXRzICAqICAgLS0tLS0tLQotICAgICAgICAgKiAgICAgc2VjICAgICAgICAgICBzZWMgICAgICAgICAgICAgICAgICBzYW1wbGUKLSAgICAgICAgICoKLSAgICAgICAgICogVG8gc2F2ZSBhIGRpdmlkZSwgYSBzaGlmdCBpcyB1c2VkLiBQcmVzZW50bHkgb25seSB0aGUgdmFsdWUgb2YKLSAgICAgICAgICogMTAyNCBpcyB1c2VkIGJ5IHRoaXMgbGlicmFyeSwgc28gbWFrZSBpdCB0aGUgbW9zdCBhY2N1cmF0ZSBmb3IgdGhhdAotICAgICAgICAgKiB2YWx1ZS4gVGhpcyBtYXkgbmVlZCB0byBiZSB1cGRhdGVkIGxhdGVyLgotICAgICAgICAgKi8KLQotICAgICAgICBwRXh0LT5iaXRSYXRlID0gKHBFeHQtPnNhbXBsaW5nUmF0ZSAqCi0gICAgICAgICAgICAgICAgICAgICAgICAgKHBWYXJzLT5pbnB1dFN0cmVhbS51c2VkQml0cyAtIGluaXRpYWxVc2VkQml0cykpID4+IDEwOyAgLyogIExPTkdfV0lORE9XICAxMDI0ICovCi0KLSAgICAgICAgcEV4dC0+Yml0UmF0ZSA+Pj0gKHBNQ19JbmZvLT51cHNhbXBsaW5nRmFjdG9yIC0gMSk7Ci0KLQotICAgIH0gLyogZW5kIGlmIChzdG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zZXQoJnBWYXJzLT5wZXJDaGFuW0xFRlRdLmx0cF9idWZmZXJbMF0sCi0gICAgICAgICAgICAgICAgICAgICAgMCwKLSAgICAgICAgICAgICAgICAgICAgICAyODgqc2l6ZW9mKHBWYXJzLT5wZXJDaGFuW0xFRlRdLmx0cF9idWZmZXJbMF0pKTsKLSAgICAgICAgICAgIHB2X21lbXNldCgmcFZhcnMtPnBlckNoYW5bTEVGVF0ubHRwX2J1ZmZlclsxMDI0ICsgMjg4XSwKLSAgICAgICAgICAgICAgICAgICAgICAwLAotICAgICAgICAgICAgICAgICAgICAgIDI4OCpzaXplb2YocFZhcnMtPnBlckNoYW5bTEVGVF0ubHRwX2J1ZmZlclswXSkpOwotICAgICAgICAgICAgcHZfbWVtc2V0KGhGcmFtZURhdGFfMS0+ViwKLSAgICAgICAgICAgICAgICAgICAgICAwLAotICAgICAgICAgICAgICAgICAgICAgIDExNTIqc2l6ZW9mKGhGcmFtZURhdGFfMS0+VlswXSkpOwotICAgICAgICAgICAgcHZfbWVtc2V0KGhGcmFtZURhdGFfMS0+cHJldk5vaXNlTGV2ZWxfbWFuLAotICAgICAgICAgICAgICAgICAgICAgIDAsCi0gICAgICAgICAgICAgICAgICAgICAgTUFYX05VTV9OT0lTRV9WQUxVRVMqc2l6ZW9mKGhGcmFtZURhdGFfMS0+cHJldk5vaXNlTGV2ZWxfbWFuWzBdKSk7Ci0KLQotICAgICAgICAgICAgcHZfbWVtc2V0KCZwVmFycy0+cGVyQ2hhbltSSUdIVF0ubHRwX2J1ZmZlclswXSwKLSAgICAgICAgICAgICAgICAgICAgICAwLAotICAgICAgICAgICAgICAgICAgICAgIDI4OCpzaXplb2YocFZhcnMtPnBlckNoYW5bUklHSFRdLmx0cF9idWZmZXJbMF0pKTsKLSAgICAgICAgICAgIHB2X21lbXNldCgmcFZhcnMtPnBlckNoYW5bUklHSFRdLmx0cF9idWZmZXJbMTAyNCArIDI4OF0sCi0gICAgICAgICAgICAgICAgICAgICAgMCwKLSAgICAgICAgICAgICAgICAgICAgICAyODgqc2l6ZW9mKHBWYXJzLT5wZXJDaGFuW1JJR0hUXS5sdHBfYnVmZmVyWzBdKSk7Ci0gICAgICAgICAgICBwdl9tZW1zZXQoaEZyYW1lRGF0YV8yLT5WLAotICAgICAgICAgICAgICAgICAgICAgIDAsCi0gICAgICAgICAgICAgICAgICAgICAgMTE1MipzaXplb2YoaEZyYW1lRGF0YV8yLT5WWzBdKSk7Ci0KLSAgICAgICAgICAgIHB2X21lbXNldChoRnJhbWVEYXRhXzItPnByZXZOb2lzZUxldmVsX21hbiwKLSAgICAgICAgICAgICAgICAgICAgICAwLAotICAgICAgICAgICAgICAgICAgICAgIE1BWF9OVU1fTk9JU0VfVkFMVUVTKnNpemVvZihoRnJhbWVEYXRhXzItPnByZXZOb2lzZUxldmVsX21hblswXSkpOwotCi0KLSAgICAgICAgICAgIGludCBpOwotICAgICAgICAgICAgZm9yIChpID0gMDsgaSA8IDg7IGkrKykKLSAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICBwdl9tZW1zZXQoKHZvaWQgKikmaEZyYW1lRGF0YV8xLT5jb2RlY1FtZkJ1ZmZlclJlYWxbaV0sCi0gICAgICAgICAgICAgICAgICAgICAgICAgIDAsCi0gICAgICAgICAgICAgICAgICAgICAgICAgIHNpemVvZigqKmhGcmFtZURhdGFfMS0+Y29kZWNRbWZCdWZmZXJSZWFsKSA8PCA1KTsKLSAgICAgICAgICAgIH0KLQotCi0gICAgICAgICAgICAvKiAtLS0tICovCi0gICAgICAgICAgICBwdl9tZW1zZXQoKHZvaWQgKiloRnJhbWVEYXRhXzEtPkJ3VmVjdG9yT2xkLAotICAgICAgICAgICAgICAgICAgICAgIDAsCi0gICAgICAgICAgICAgICAgICAgICAgc2l6ZW9mKCpoRnJhbWVEYXRhXzEtPkJ3VmVjdG9yT2xkKSpNQVhfTlVNX1BBVENIRVMpOwotCi0jaWZkZWYgSFFfU0JSCi0KLSAgICAgICAgICAgIGZvciAoaSA9IDA7IGkgPCA1OyBpKyspCi0gICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgcHZfbWVtc2V0KCh2b2lkICopJmhGcmFtZURhdGFfMS0+ZkJ1ZmZlcl9tYW5baV0sCi0gICAgICAgICAgICAgICAgICAgICAgICAgIDAsCi0gICAgICAgICAgICAgICAgICAgICAgICAgIHNpemVvZigqKmhGcmFtZURhdGFfMS0+ZkJ1ZmZlcl9tYW4pKjY0KTsKLSAgICAgICAgICAgICAgICBwdl9tZW1zZXQoKHZvaWQgKikmaEZyYW1lRGF0YV8xLT5mQnVmZmVyTl9tYW5baV0sCi0gICAgICAgICAgICAgICAgICAgICAgICAgIDAsCi0gICAgICAgICAgICAgICAgICAgICAgICAgIHNpemVvZigqKmhGcmFtZURhdGFfMS0+ZkJ1ZmZlck5fbWFuKSo2NCk7Ci0gICAgICAgICAgICB9Ci0jZW5kaWYKLQotCi0gICAgICAgICAgICAvKiAtLS0tICovCi0KLQotCi0gICAgICAgICAgICBwdl9tZW1zZXQoKHZvaWQgKiloRnJhbWVEYXRhXzEtPkhpc3RzYnJRbWZCdWZmZXJSZWFsLAotICAgICAgICAgICAgICAgICAgICAgIDAsCi0gICAgICAgICAgICAgICAgICAgICAgc2l6ZW9mKCpoRnJhbWVEYXRhXzEtPkhpc3RzYnJRbWZCdWZmZXJSZWFsKSo2KlNCUl9OVU1fQkFORFMpOwotCi0jaWZkZWYgSFFfU0JSCi0gICAgICAgICAgICBwdl9tZW1zZXQoKHZvaWQgKiloRnJhbWVEYXRhXzEtPkhpc3RzYnJRbWZCdWZmZXJJbWFnLAotICAgICAgICAgICAgICAgICAgICAgIDAsCi0gICAgICAgICAgICAgICAgICAgICAgc2l6ZW9mKCpoRnJhbWVEYXRhXzEtPkhpc3RzYnJRbWZCdWZmZXJJbWFnKSo2KlNCUl9OVU1fQkFORFMpOwotI2VuZGlmCi0KLSAgICAgICAgICAgIGlmIChwVmFycy0+c2JyRGVjLkxDX2FhY1BfRGVjb2RlckZsYWcgPT0gMSkgIC8qIGNsZWFyIGJ1ZmZlciBvbmx5IGZvciBMQyBkZWNvZGluZyAqLwotICAgICAgICAgICAgewotCi0gICAgICAgICAgICAgICAgZm9yIChpID0gMDsgaSA8IDg7IGkrKykKLSAgICAgICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgICAgIHB2X21lbXNldCgodm9pZCAqKSZoRnJhbWVEYXRhXzItPmNvZGVjUW1mQnVmZmVyUmVhbFtpXSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDAsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzaXplb2YoKipoRnJhbWVEYXRhXzEtPmNvZGVjUW1mQnVmZmVyUmVhbCkgPDwgNSk7Ci0gICAgICAgICAgICAgICAgfQotCi0gICAgICAgICAgICAgICAgcHZfbWVtc2V0KCh2b2lkICopaEZyYW1lRGF0YV8yLT5IaXN0c2JyUW1mQnVmZmVyUmVhbCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgMCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgc2l6ZW9mKCpoRnJhbWVEYXRhXzItPkhpc3RzYnJRbWZCdWZmZXJSZWFsKSo2KlNCUl9OVU1fQkFORFMpOwotCi0KLSAgICAgICAgICAgICAgICBwdl9tZW1zZXQoKHZvaWQgKiloRnJhbWVEYXRhXzItPkJ3VmVjdG9yT2xkLAotICAgICAgICAgICAgICAgICAgICAgICAgICAwLAotICAgICAgICAgICAgICAgICAgICAgICAgICBzaXplb2YoKmhGcmFtZURhdGFfMi0+QndWZWN0b3JPbGQpKk1BWF9OVU1fUEFUQ0hFUyk7Ci0KLSNpZmRlZiBIUV9TQlIKLQotICAgICAgICAgICAgICAgIGZvciAoaSA9IDA7IGkgPCA1OyBpKyspCi0gICAgICAgICAgICAgICAgewotICAgICAgICAgICAgICAgICAgICBwdl9tZW1zZXQoKHZvaWQgKikmaEZyYW1lRGF0YV8yLT5mQnVmZmVyX21hbltpXSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDAsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzaXplb2YoKipoRnJhbWVEYXRhXzItPmZCdWZmZXJfbWFuKSo2NCk7Ci0gICAgICAgICAgICAgICAgICAgIHB2X21lbXNldCgodm9pZCAqKSZoRnJhbWVEYXRhXzItPmZCdWZmZXJOX21hbltpXSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDAsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzaXplb2YoKipoRnJhbWVEYXRhXzItPmZCdWZmZXJOX21hbikqNjQpOwotICAgICAgICAgICAgICAgIH0KLSNlbmRpZgotCi0gICAgICAgICAgICB9Ci0KLSNpZmRlZiBIUV9TQlIKLSNpZmRlZiBQQVJBTUVUUklDU1RFUkVPCi0gICAgICAgICAgICBlbHNlIGlmIChwVmFycy0+bWNfaW5mby5wc1ByZXNlbnRGbGFnID09IDEpCi0gICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgZm9yIChpID0gMDsgaSA8IDM7IGkrKykKLSAgICAgICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgICAgIHB2X21lbXNldChzYnJEZWNvZGVyRGF0YS0+aFBhcmFtZXRyaWNTdGVyZW9EZWMtPmhIeWJyaWQtPm1RbWZCdWZmZXJSZWFsW2ldLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEhZQlJJRF9GSUxURVJfTEVOR1RIX21fMSpzaXplb2YoKnNickRlY29kZXJEYXRhLT5oUGFyYW1ldHJpY1N0ZXJlb0RlYy0+aEh5YnJpZC0+bVFtZkJ1ZmZlclJlYWwpKTsKLSAgICAgICAgICAgICAgICAgICAgcHZfbWVtc2V0KHNickRlY29kZXJEYXRhLT5oUGFyYW1ldHJpY1N0ZXJlb0RlYy0+aEh5YnJpZC0+bVFtZkJ1ZmZlckltYWdbaV0sCi0gICAgICAgICAgICAgICAgICAgICAgICAgICA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ICAgIEludCAgICAgICAgICAgICAgICAgICAgICAgICB1cHNhbXBsaW5nRmFjdG9yLAotICAgIEludCAgICAgICAgICAgICAgICAgICAgICAgICBzYW1wX3JhdGUsCi0gICAgSW50ICAgICAgICAgICAgICAgICAgICAgICAgIG51bV9jaCwKLSAgICB0TVA0QXVkaW9PYmplY3RUeXBlICAgICAgICAgYXVkaW9PYmplY3RUeXBlKQotCi17Ci0KLSAgICB0RGVjX0ludF9GaWxlICpwVmFyczsgICAgICAgICAgIC8qIEhlbHBlciBwb2ludGVyICovCi0KLSAgICBJbnQgICAgICAgICAgICBzdGF0dXMgPSBNUDRBVURFQ19JTkNPTVBMRVRFX0ZSQU1FOwotCi0gICAgLyoKLSAgICAgKiBJbml0aWFsaXplICJoZWxwZXIiIHBvaW50ZXJzIHRvIGV4aXN0aW5nIG1lbW9yeS4KLSAgICAgKi8KLSAgICBwVmFycyA9ICh0RGVjX0ludF9GaWxlICopcE1lbTsKLSAgICAvKgotICAgICAqIFRyYW5zbGF0ZSBpbnB1dCBidWZmZXIgdmFyaWFibGVzLgotICAgICAqLwotICAgIHBWYXJzLT5pbnB1dFN0cmVhbS5wQnVmZmVyID0gcEV4dC0+cElucHV0QnVmZmVyOwotCi0gICAgcFZhcnMtPmlucHV0U3RyZWFtLmF2YWlsYWJsZUJpdHMgPSAwOwotCi0gICAgcFZhcnMtPmlucHV0U3RyZWFtLnVzZWRCaXRzID0gMDsKLQotCi0KLSAgICAvKgotICAgICAqICBnZXQgc2FtcGxpbmcgcmF0ZSBpbmRleAotICAgICAqLwotCi0gICAgc3dpdGNoIChzYW1wX3JhdGUpCi0gICAgewotICAgICAgICBjYXNlIDk2MDAwOgotICAgICAgICAgICAgcFZhcnMtPnByb2dfY29uZmlnLnNhbXBsaW5nX3JhdGVfaWR4ID0gMDsKLSAgICAgICAgICAgIGJyZWFrOwotICAgICAgICBjYXNlIDg4MjAwOgotICAgICAgICAgICAgcFZhcnMtPnByb2dfY29uZmlnLnNhbXBsaW5nX3JhdGVfaWR4ID0gMTsKLSAgICAgICAgICAgIGJyZWFrOwotICAgICAgICBjYXNlIDY0MDAwOgotICAgICAgICAgICAgcFZhcnMtPnByb2dfY29uZmlnLnNhbXBsaW5nX3JhdGVfaWR4ID0gMjsKLSAgICAgICAgICAgIGJyZWFrOwotICAgICAgICBjYXNlIDQ4MDAwOgotICAgICAgICAgICAgcFZhcnMtPnByb2dfY29uZmlnLnNhbXBsaW5nX3JhdGVfaWR4ID0gMzsKLSAgICAgICAgICAgIGJyZWFrOwotICAgICAgICBjYXNlIDQ0MTAwOgotICAgICAgICAgICAgcFZhcnMtPnByb2dfY29uZmlnLnNhbXBsaW5nX3JhdGVfaWR4ID0gNDsKLSAgICAgICAgICAgIGJyZWFrOwotICAgICAgICBjYXNlIDMyMDAwOgotICAgICAgICAgICAgcFZhcnMtPnByb2dfY29uZmlnLnNhbXBsaW5nX3JhdGVfaWR4ID0gNTsKLSAgICAgICAgICAgIGJyZWFrOwotICAgICAgICBjYXNlIDI0MDAwOgotICAgICAgICAgICAgcFZhcnMtPnByb2dfY29uZmlnLnNhbXBsaW5nX3JhdGVfaWR4ID0gNjsKLSAgICAgICAgICAgIGJyZWFrOwotICAgICAgICBjYXNlIDIyMDUwOgotICAgICAgICAgICAgcFZhcnMtPnByb2dfY29uZmlnLnNhbXBsaW5nX3JhdGVfaWR4ID0gNzsKLSAgICAgICAgICAgIGJyZWFrOwotICAgICAgICBjYXNlIDE2MDAwOgotICAgICAgICAgICAgcFZhcnMtPnByb2dfY29uZmlnLnNhbXBsaW5nX3JhdGVfaWR4ID0gODsKLSAgICAgICAgICAgIGJyZWFrOwotICAgICAgICBjYXNlIDEyMDAwOgotICAgICAgICAgICAgcFZhcnMtPnByb2dfY29uZmlnLnNhbXBsaW5nX3JhdGVfaWR4ID0gOTsKLSAgICAgICAgICAgIGJyZWFrOwotICAgICAgICBjYXNlIDExMDI1OgotICAgICAgICAgICAgcFZhcnMtPnByb2dfY29uZmlnLnNhbXBsaW5nX3JhdGVfaWR4ID0gMTA7Ci0gICAgICAgICAgICBicmVhazsKLSAgICAgICAgY2FzZSA4MDAwOgotICAgICAgICAgICAgcFZhcnMtPnByb2dfY29uZmlnLnNhbXBsaW5nX3JhdGVfaWR4ID0gMTE7Ci0gICAgICAgICAgICBicmVhazsKLSAgICAgICAgY2FzZSA3MzUwOgotICAgICAgICAgICAgcFZhcnMtPnByb2dfY29uZmlnLnNhbXBsaW5nX3JhdGVfaWR4ID0gMTI7Ci0gICAgICAgICAgICBicmVhazsKLSAgICAgICAgZGVmYXVsdDoKLSAgICAgICAgICAgIHN0YXR1cyA9IC0xOwotCi0gICAgICAgICAgICBicmVhazsKLSAgICB9Ci0KLSAgICBwVmFycy0+bWNfaW5mby5zYnJQcmVzZW50RmxhZyA9IDA7Ci0gICAgcFZhcnMtPm1jX2luZm8ucHNQcmVzZW50RmxhZyA9IDA7Ci0jaWZkZWYgQUFDX1BMVVMKLSAgICBwVmFycy0+bWNfaW5mby5iRG93blNhbXBsZWRTYnIgPSAwOwotI2VuZGlmCi0gICAgcFZhcnMtPm1jX2luZm8uaW1wbGljaXRfY2hhbm5lbGluZyA9IDA7Ci0gICAgcFZhcnMtPm1jX2luZm8ubmNoID0gbnVtX2NoOwotICAgIHBWYXJzLT5tY19pbmZvLnVwc2FtcGxpbmdGYWN0b3IgPSB1cHNhbXBsaW5nRmFjdG9yOwotCi0KLSAgICAvKgotICAgICAqICBTZXQgbnVtYmVyIG9mIGNoYW5uZWxzCi0gICAgICovCi0KLSAgICBpZiAobnVtX2NoID09IDIpCi0gICAgewotICAgICAgICBwVmFycy0+cHJvZ19jb25maWcuZnJvbnQuZWxlX2lzX2NwZVswXSA9IDE7Ci0gICAgfQotICAgIGVsc2UgaWYgKG51bV9jaCA9PSAxKQotICAgIHsKLSAgICAgICAgcFZhcnMtPnByb2dfY29uZmlnLmZyb250LmVsZV9pc19jcGVbMF0gPSAwOwotICAgIH0KLSAgICBlbHNlCi0gICAgewotICAgICAgICBzdGF0dXMgPSAtMTsgLyogZG8gbm90IHN1cHBvcnQgbW9yZSB0aGFuIHR3byBjaGFubmVscyAqLwotICAgICAgICBwVmFycy0+c3RhdHVzID0gc3RhdHVzOwotICAgICAgICByZXR1cm4gKHN0YXR1cyk7Ci0gICAgfQotCi0KLSAgICAvKgotICAgICAqICBTZXQgQUFDIGJpdHN0cmVhbQotICAgICAqLwotCi0gICAgaWYgKChhdWRpb09iamVjdFR5cGUgPT0gTVA0QVVESU9fQUFDX0xDKSAgICAgICAgfHwKLSAgICAgICAgICAgIChhdWRpb09iamVjdFR5cGUgPT0gTVA0QVVESU9fTFRQKSkKLSAgICB7Ci0gICAgICAgIHBWYXJzLT5hYWNQbHVzRW5hYmxlZCA9IGZhbHNlOwotCi0gICAgICAgIHN0YXR1cyA9IHNldF9tY19pbmZvKCYocFZhcnMtPm1jX2luZm8pLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICBhdWRpb09iamVjdFR5cGUsIC8qIHByZXZpb3VzbHkgcHJvZmlsZSAqLwotICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwVmFycy0+cHJvZ19jb25maWcuc2FtcGxpbmdfcmF0ZV9pZHgsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBWYXJzLT5wcm9nX2NvbmZpZy5mcm9udC5lbGVfdGFnWzBdLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwVmFycy0+cHJvZ19jb25maWcuZnJvbnQuZWxlX2lzX2NwZVswXSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcFZhcnMtPndpbm1hcCwgLypwVmFycy0+cFdpblNlcUluZm8sKi8KLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcFZhcnMtPlNGQldpZHRoMTI4KTsKLSAgICB9Ci0gICAgZWxzZSBpZiAoKGF1ZGlvT2JqZWN0VHlwZSA9PSBNUDRBVURJT19TQlIpICAgICAgICB8fAotICAgICAgICAgICAgIChhdWRpb09iamVjdFR5cGUgPT0gTVA0QVVESU9fUFMpKQotICAgIHsKLSAgICAgICAgcFZhcnMtPmFhY1BsdXNFbmFibGVkID0gdHJ1ZTsKLQotCi0gICAgICAgIHN0YXR1cyA9IHNldF9tY19pbmZvKCYocFZhcnMtPm1jX2luZm8pLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICBNUDRBVURJT19BQUNfTEMsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBWYXJzLT5wcm9nX2NvbmZpZy5zYW1wbGluZ19yYXRlX2lkeCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcFZhcnMtPnByb2dfY29uZmlnLmZyb250LmVsZV90YWdbMF0sCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBWYXJzLT5wcm9nX2NvbmZpZy5mcm9udC5lbGVfaXNfY3BlWzBdLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwVmFycy0+d2lubWFwLCAvKnBWYXJzLT5wV2luU2VxSW5mbywqLwotICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwVmFycy0+U0ZCV2lkdGgxMjgpOwotCi0gICAgICAgIHBWYXJzLT5tY19pbmZvLnNiclByZXNlbnRGbGFnID0gMTsKLSAgICAgICAgaWYgKGF1ZGlvT2JqZWN0VHlwZSA9PSBNUDRBVURJT19QUykKLSAgICAgICAgewotICAgICAgICAgICAgcFZhcnMtPm1jX2luZm8ucHNQcmVzZW50RmxhZyA9IDE7Ci0gICAgICAgIH0KLQotICAgICAgICBpZiAodXBzYW1wbGluZ0ZhY3RvciA9PSAxKQotICAgICAgICB7Ci0jaWZkZWYgQUFDX1BMVVMKLSAgICAgICAgICAgIHBWYXJzLT5tY19pbmZvLmJEb3duU2FtcGxlZFNiciA9IDE7Ci0jZW5kaWYKLQotICAgICAgICAgICAgLyoKLSAgICAgICAgICAgICAqICBEaXNhYmxlIFNCUiBkZWNvZGluZyBmb3IgYW55IHNici1kb3duc2FtcGxlZCBmaWxlIHdob3NlIFNGIGlzID49IDI0IE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AgICAgICAgICAgc2ZiV2lkdGggID0gKihwV2luU2ZiVG9wKyspIC0gc3RvcF9pZHg7Ci0KLSAgICAgICAgICAgIHN0b3BfaWR4ICs9IHNmYldpZHRoOwotCi0gICAgICAgICAgICBrID0gKihwUWZvcm1hdCsrKSAtIG1pbl9xOwotCi0gICAgICAgICAgICBJRiAoayA8IDMyKQotICAgICAgICAgICAgVEhFTgotICAgICAgICAgICAgICAgIEZPUiAoOyBzZmJXaWR0aCA+IDA7IHNmYldpZHRoLS0pCi0gICAgICAgICAgICAgICAgICAgICoocENvZWYrKykgPj49IGs7Ci0gICAgICAgICAgICAgICAgRU5ERk9SCi0gICAgICAgICAgICBFTFNFCi0gICAgICAgICAgICAgICAgRk9SICg7IHNmYldpZHRoID4gMDsgc2ZiV2lkdGgtLSkKLSAgICAgICAgICAgICAgICAgICAgKihwQ29lZisrKSA9IDA7Ci0gICAgICAgICAgICAgICAgRU5ERk9SCi0gICAgICAgICAgICBFTkRJRgotCi0gICAgICAgIEVOREZPUgotCi0gICAgRU5ERk9SCi0KLSAgICByZXR1cm4gbWluX3E7Ci0KLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLQotIFJFU09VUkNFUyBVU0VECi0gICBXaGVuIHRoZSBjb2RlIGlzIHdyaXR0ZW4gZm9yIGEgc3BlY2lmaWMgdGFyZ2V0IHByb2Nlc3NvciB0aGUKLSAgICAgdGhlIHJlc291cmNlcyB1c2VkIHNob3VsZCBiZSBkb2N1bWVudGVkIGJlbG93LgotCi0gU1RBQ0sgVVNBR0U6IFtzdGFjayBjb3VudCBmb3IgdGhpcyBtb2R1bGVdICsgW3ZhcmlhYmxlIHRvIHJlcHJlc2VudAotICAgICAgICAgIHN0YWNrIHVzYWdlIGZvciBlYWNoIHN1YnJvdXRpbmUgY2FsbGVkXQotCi0gICAgIHdoZXJlOiBbc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Ci0gICAgICAgIG5zZmIgPSAqKHBTZmJQZXJXaW4rKyk7Ci0KLSAgICAgICAgaWYgKG5zZmIgPCAwIHx8IG5zZmIgPiBNQVhCQU5EUykKLSAgICAgICAgewotICAgICAgICAgICAgYnJlYWs7ICAvKiBhdm9pZCBhbnkgcHJvY2Vzc2luZyBvbiBlcnJvciBjb25kaXRpb24gKi8KLSAgICAgICAgfQotCi0gICAgICAgIGZvciAoc2ZiID0gbnNmYjsgc2ZiICE9IDA7IHNmYi0tKQotICAgICAgICB7Ci0gICAgICAgICAgICBJbnQgcWZvcm1hdCA9ICoocFFmb3JtYXQrKyk7Ci0gICAgICAgICAgICBpZiAocWZvcm1hdCA8IG1pbl9xKQotICAgICAgICAgICAgewotICAgICAgICAgICAgICAgIG1pbl9xID0gcWZvcm1hdDsKLSAgICAgICAgICAgIH0KLSAgICAgICAgfQotCi0gICAgfSAvKiBmb3Iod2luKSAqLwotCi0gICAgLyogTm9ybWFsaXplIHRoZSBjb2VmcyBpbiBlYWNoIHNjYWxlZmFjdG9yIGJhbmQgdG8gb25lIHEtZm9ybWF0ICovCi0gICAgcFFmb3JtYXQgICA9ICYocUZvcm1hdFswXSk7Ci0gICAgcFNmYlBlcldpbiA9ICYocEZyYW1lSW5mby0+c2ZiX3Blcl93aW5bMF0pOwotICAgIHBDb2VmICAgICAgPSAmKGNvZWZbMF0pOwotCi0gICAgZm9yICh3aW4gPSAwOyB3aW4gPCBud2luOyB3aW4rKykKLSAgICB7Ci0KLSAgICAgICAgSW50MzIgbWF4ID0gMDsKLSAgICAgICAgc3RvcF9pZHggPSAwOwotCi0gICAgICAgIG5zZmIgICA9ICoocFNmYlBlcldpbisrKTsKLQotICAgICAgICBpZiAobnNmYiA8IDAgfHwgbnNmYiA+IE1BWEJBTkRTKQotICAgICAgICB7Ci0gICAgICAgICAgICBicmVhazsgIC8qIGF2b2lkIGFueSBwcm9jZXNzaW5nIG9uIGVycm9yIGNvbmRpdGlvbiAqLwotICAgICAgICB9Ci0KLSAgICAgICAgcFdpblNmYlRvcCA9ICYocEZyYW1lSW5mby0+d2luX3NmYl90b3Bbd2luXVswXSk7Ci0KLSAgICAgICAgZm9yIChzZmIgPSBuc2ZiOyBzZmIgIT0gMDsgc2ZiLS0pCi0gICAgICAgIHsKLSAgICAgICAgICAgIEludCB0bXAxLCB0bXAyOwotICAgICAgICAgICAgdG1wMSA9ICoocFdpblNmYlRvcCsrKTsKLSAgICAgICAgICAgIHRtcDIgPSAqKHBRZm9ybWF0KyspOwotICAgICAgICAgICAgc2ZiV2lkdGggID0gdG1wMSAtIHN0b3BfaWR4OwotCi0gICAgICAgICAgICBpZiAoc2ZiV2lkdGggPCAyKQotICAgICAgICAgICAgewotICAgICAgICAgICAgICAgIGJyZWFrOyAgLyogd2lsbCBsZWFkIHRvIGVycm9yIGNvbmRpdGlvbiAqLwotICAgICAgICAgICAgfQotCi0gICAgICAgICAgICBzdG9wX2lkeCArPSBzZmJXaWR0aDsKLQotICAgICAgICAgICAgc2hpZnRfYW10ID0gdG1wMiAtIG1pbl9xOwotCi0gICAgICAgICAgICBpZiAoc2hpZnRfYW10ID09IDApCi0gICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgSW50MzIgdG1wMSwgdG1wMjsKLSAgICAgICAgICAgICAgICB0bXAxID0gKihwQ29lZisrKTsKLSAgICAgICAgICAgICAgICB0bXAyID0gKihwQ29lZisrKTsKLSAgICAgICAgICAgICAgICAvKgotICAgICAgICAgICAgICAgICAqICBzZmJXaWR0aCBpcyBhbHdheXMgYW4gZXZlbiBudW1iZXIKLSAgICAgICAgICAgICAgICAgKiAgKGNoZWNrIHRhYmxlcyBpbiBwZy42NiBJUzAgMTQ0OTYtMykKLSAgICAgICAgICAgICAgICAgKi8KLSAgICAgICAgICAgICAgICBmb3IgKEludCBpID0gKHNmYldpZHRoID4+IDEpIC0gMTsgaSAhPSAwOyBpLS0pCi0gICAgICAgICAgICAgICAgewotICAgICAgICAgICAgICAgICAgICBtYXggIHw9ICh0bXAxID4+IDMxKSBeIHRtcDE7Ci0gICAgICAgICAgICAgICAgICAgIG1heCAgfD0gKHRtcDIgPj4gMzEpIF4gdG1wMjsKLSAgICAgICAgICAgICAgICAgICAgdG1wMSA9ICoocENvZWYrKyk7Ci0gICAgICAgICAgICAgICAgICAgIHRtcDIgPSAqKHBDb2VmKyspOwotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICBtYXggIHw9ICh0bXAxID4+IDMxKSBeIHRtcDE7Ci0gICAgICAgICAgICAgICAgbWF4ICB8PSAodG1wMiA+PiAzMSkgXiB0bXAyOwotCi0gICAgICAgICAgICB9Ci0gICAgICAgICAgICBlbHNlCi0gICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgaWYgKHNoaWZ0X2FtdCA8IDMxKQotICAgICAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAgICAgSW50MzIgdG1wMSwgdG1wMjsKLSAgICAgICAgICAgICAgICAgICAgdG1wMSA9ICoocENvZWYrKykgPj4gc2hpZnRfYW10OwotICAgICAgICAgICAgICAgICAgICB0bXAyID0gKihwQ29lZi0tKSA+PiBzaGlmdF9hbXQ7Ci0gICAgICAgICAgICAgICAgICAgIC8qCi0gICAgICAgICAgICAgICAgICAgICAqICBzZmJXaWR0aCBpcyBhbHdheXMgYW4gZXZlbiBudW1iZXIKLSAgICAgICAgICAgICAgICAgICAgICogIChjaGVjayB0YWJsZXMgaW4gcGcuNjYgSVMwIDE0NDk2LTMpCi0gICAgICAgICAgICAgICAgICAgICAqLwotICAgICAgICAgICAgICAgICAgICBmb3IgKEludCBpID0gKHNmYldpZHRoID4+IDEpIC0gMTsgaSAhPSAwOyBpLS0pCi0gICAgICAgICAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAgICAgICAgICoocENvZWYrKykgICA9IHRtcDE7Ci0gICAgICAgICAgICAgICAgICAgICAgICAqKHBDb2VmKyspICAgPSB0bXAyOwotCi0gICAgICAgICAgICAgICAgICAgICAgICBtYXggIHw9ICh0bXAxID4+IDMxKSBeIHRtcDE7Ci0gICAgICAgICAgICAgICAgICAgICAgICBtYXggIHw9ICh0bXAyID4+IDMxKSBeIHRtcDI7Ci0gICAgICAgICAgICAgICAgICAgICAgICB0bXAxID0gKihwQ29lZisrKSA+PiBzaGlmdF9hbXQ7Ci0gICAgICAgICAgICAgICAgICAgICAgICB0bXAyID0gKihwQ29lZi0tKSA+PiBzaGlmdF9hbXQ7Ci0KLSAgICAgICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgICAgICAqKHBDb2VmKyspICAgPSB0bXAxOwotICAgICAgICAgICAgICAgICAgICAqKHBDb2VmKyspICAgPSB0bXAyOwotICAgICAgICAgICAgICAgICAgICBtYXggIHw9ICh0bXAxID4+IDMxKSBeIHRtcDE7Ci0gICAgICAgICAgICAgICAgICAgIG1heCAgfD0gKHRtcDIgPj4gMzEpIF4gdG1wMjsKLQotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICBlbHNlCi0gICAgICAgICAgICAgICAgewotICAgICAgICAgICAgICAgICAgICBwdl9tZW1zZXQocENvZWYsIDAsIHNpemVvZihJbnQzMikqc2ZiV2lkdGgpOwotICAgICAgICAgICAgICAgICAgICBwQ29lZiArPSBzZmJXaWR0aDsKLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgIGFic19tYXhfcGVyX3dpbmRvd1t3aW5dID0gbWF4OwotCi0gICAgICAgIH0KLQotICAgIH0gLyogZm9yICh3aW4pICovCi0KLSAgICByZXR1cm4gbWluX3E7Ci0KLX0gLyogbm9ybWFsaXplKCkgKi8KZGlmZiAtLWdpdCBhL21lZGlhL2xpYnN0YWdlZnJpZ2h0L2NvZGVjcy9hYWNkZWMvcV9ub3JtYWxpemUuaCBiL21lZGlhL2xpYnN0YWdlZnJpZ2h0L2NvZGVjcy9hYWNkZWMvcV9ub3JtYWxpemUuaApkZWxldGVkIGZpbGUgbW9kZSAxMDA2N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NPL0lFQyAyMDAzLgotCi0qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotCi0jaWZuZGVmIFNfUFNfREVDX0gKLSNkZWZpbmUgU19QU19ERUNfSAotCi0KLSNpbmNsdWRlICJzX2h5YnJpZC5oIgotI2luY2x1ZGUgInNfcGF0Y2guaCIKLQotLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKLSAgVHlwZSBkZWZpbml0aW9ucwotICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi1zdHJ1Y3QgUFNfREVDCi17Ci0KLSAgICBJbnQgcHNEZXRlY3RlZDsKLSAgICBJbnQzMiAqUl9jaF9xbWZfZmlsdGVyX2hpc3Rvcnk7Ci0gICAgSW50MzIgaW52Tm9TdWJTYW1wbGVzOwotCi0gICAgSW50MzIgYkZvcmNlTW9ubzsKLSAgICBVSW50MzIgbm9TdWJTYW1wbGVzOwotICAgIEludDMyIHVzYjsKLSAgICBJbnQzMiBsYXN0VXNiOwotCi0gICAgSW50MzIgYlBzRGF0YUF2YWlsOwotCi0gICAgVUludDMyIGJFbmFibGVJaWQ7Ci0gICAgVUludDMyIGJFbmFibGVJY2M7Ci0KLSAgICBVSW50MzIgYkVuYWJsZUV4dDsKLSAgICBJbnQzMiBiRmluZUlpZFE7Ci0KLSAgICBJbnQzMiBhSWlkUHJldkZyYW1lSW5kZXhbTk9fSElfUkVTX0JJTlNdOwotICAgIEludDMyIGFJY2NQcmV2RnJhbWVJbmRleFtOT19ISV9SRVNfQklOU107Ci0KLSAgICBVSW50MzIgZnJlcVJlc0lpZDsKLSAgICBVSW50MzIgZnJlcVJlc0ljYzsKLQotICAgIFVJbnQzMiBiRnJhbWVDbGFzczsKLSAgICBVSW50MzIgbm9FbnY7Ci0gICAgVU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w2NDAgYnl0ZXMgKDMuNTUgS0IpLCBvbiBhIDMyLWJpdCBwbGF0Zm9ybSwKLSAgICAgKiB3aGljaCByZXByZXNlbnRzIHRoZSB3b3JzdCBjYXNlLgotICAgICAqLwotICAgIHR5cGVkZWYgc3RydWN0Ci0gICAgewotICAgICAgICBUTlNfZnJhbWVfaW5mbyAgICAgICB0bnM7Ci0KLSAgICAgICAgRnJhbWVJbmZvICAgICAgICAgICAgZnJhbWVJbmZvOwotCi0gICAgICAgIEludCAgICAgICAgICAgICAgICAgIGZhY3RvcnNbTUFYQkFORFNdOwotICAgICAgICBJbnQgICAgICAgICAgICAgICAgICBjYl9tYXBbTUFYQkFORFNdOwotICAgICAgICBJbnQgICAgICAgICAgICAgICAgICBncm91cFtOU0hPUlRdOwotICAgICAgICBJbnQgICAgICAgICAgICAgICAgICBxRm9ybWF0W01BWEJBTkRTXTsKLQotICAgICAgICBJbnQgICAgICAgICAgICAgICAgICBtYXhfc2ZiOwotICAgICAgICBMVF9QUkVEX1NUQVRVUyAgICAgICBsdF9zdGF0dXM7Ci0KLSAgICB9IHBlcl9jaGFuX3NoYXJlX3dfZnhwQ29lZjsKLQotICAgIC8qCi0gICAgICogVGhpcyBzdHJ1Y3R1cmUgY29udGFpbnMgb25lIHBlciBjaGFubmVsLgotICAgICAqLwotICAgIHR5cGVkZWYgc3RydWN0Ci0gICAgewotI2lmZGVmIEFBQ19QTFVTCi0gICAgICAgIEludDE2ICAgICAgICAgICAgICAgIGx0cF9idWZmZXJbTFRfQkxFTiArIDIqMjg4XTsgLyogTFRfQkxFTiAgPSAyMDQ4ICsgMioyODggKi8KLSNlbHNlCi0gICAgICAgIEludDE2ICAgICAgICAgICAgICAgIGx0cF9idWZmZXJbTFRfQkxFTl07IC8qIExUX0JMRU4gID0gMjA0OCAqLwotI2VuZGlmCi0KLQotICAgICAgICBJbnQzMiAgICAgICAgICAgICAgICB0aW1lX3F1YW50W0xPTkdfV0lORE9XXTsgLyogIDEwMjQgaG9s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ZSBuYW1lIGlzIGFsc28gdXNlZCBpbiBjYWxsZWQgZnVuY3Rpb25zLgotICAgICAqCi0gICAgICogYm5vIC0gYmxvY2sgbnVtYmVyCi0gICAgICoKLSAgICAgKi8KLSAgICB0eXBlZGVmIHN0cnVjdAotICAgIHsKLSAgICAgICAgVUludDMyICAgICAgICAgYm5vOwotICAgICAgICBJbnQgICAgICAgICAgICBzdGF0dXM7ICAvKiBzYXZlIHRoZSBzdGF0dXMgKi8KLQotICAgICAgICBib29sICAgICAgICAgICBhYWNQbHVzRW5hYmxlZDsKLSAgICAgICAgYm9vbCAgICAgICAgICAgYWFjQ29uZmlnVXRpbGl0eUVuYWJsZWQ7Ci0KLSAgICAgICAgSW50ICAgICAgICAgICAgY3VycmVudF9wcm9ncmFtOwotICAgICAgICBJbnQgICAgICAgICAgICBmcmFtZUxlbmd0aDsKLSAgICAgICAgSW50ICAgICAgICAgICAgYWRpZl90ZXN0OwotCi0gICAgICAgIEJJVFMgICAgICAgICAgIGlucHV0U3RyZWFtOwotCi0gICAgICAgIFByb2dDb25maWcgICAgIHByb2dfY29uZmlnOwotCi0gICAgICAgIEludCAgICAgICAgICAgIFNGQldpZHRoMTI4WygxPDxMRU5fTUFYX1NGQlMpXTsKLQotICAgICAgICAvKgotICAgICAgICAgKiBPbmUgb2YgdGhlIHR3byBhcnJheXMgc2hvdWxkIGJlIGRlbGV0ZWQgaW4gdGhlIGZpbmFsIHZlcnNpb24uCi0gICAgICAgICAqLwotICAgICAgICBGcmFtZUluZm8gICAgICBsb25nRnJhbWVJbmZvOwotICAgICAgICBGcmFtZUluZm8gICAgICBzaG9ydEZyYW1lSW5mbzsKLSAgICAgICAgRnJhbWVJbmZvICAgICAqd2lubWFwW05VTV9XSU5fU0VRXTsKLQotICAgICAgICAvKgotICAgICAgICAgKiBQbnMgdmFyaWFibGVzLgotICAgICAgICAgKi8KLSAgICAgICAgSW50MzIgICAgICAgICAgcG5zX2N1cl9ub2lzZV9zdGF0ZTsKLQotICAgICAgICAvKgotICAgICAgICAgKgotICAgICAgICAgKi8KLSAgICAgICAgTUNfSW5mbyAgICAgICAgbWNfaW5mbzsKLQotICAgICAgICBJbnQgICAgICAgICAgICBsdHBfYnVmZmVyX3N0YXRlOwotCi0gICAgICAgIC8qCi0gICAgICAgICAqICBGb3IgZWFhYyssIGEgc2NyYXRjaCBtYXRyaXggaXMgY3JlYXRlZCB3aXRoIHRoZSByaWd0aCBlbGVtZW50ICggcGVyQ2hhblsxXSBpcyBub3QgdXNlZCkKLSAgICAgICAgICogIGFuZCB0aGUgZnhwQ29lZiBtYXRyaXguIFRoZXNlICAyIG1hdHJpY2VzIGFyZSBbMl1bMzhdWzY0XSA9PSA0ODY0IEludDMyCi0gICAgICAgICAqICAgIDIzNDkgY29taW5nIGZyb20gdGhlIHBlckNoYW5bMV0gcGx1cyA0MDk2IGNvbWluZyBmcm9tIGZ4cENvZWYKLSAgICAgICAgICovCi0gICAgICAgIHREZWNfSW50X0NoYW4gIHBlckNoYW5bQ2hhbnNdOwotCi0gICAgICAgIEludDMyICAgICAgICAgIGZ4cENvZWZbMl1bTE5dOyAgICAgICAgIC8qIExOICA9IDIwNDggICAgICovCi0KLQotCi0jaWZkZWYgQUFDX1BMVVMKLQotICAgICAgICBTQlJERUNPREVSX0RBVEEgc2JyRGVjb2RlckRhdGE7LyogYWxsb2NhdGVzIDIgU0JSX0NIQU5ORUwsIGVhY2ggaGFzIGEgU0JSX0ZSQU1FX0RBVEEgKi8KLSAgICAgICAgU0JSX0RFQyAgICAgICAgIHNickRlYzsKLSAgICAgICAgU0JSQklUU1RSRUFNICAgIHNickJpdFN0cjsKLQotI2VuZGlmCi0KLQotICAgICAgICAvKgotICAgICAgICAgKiBJZiBBRFRTIHN1cHBvcnQgaXMgbmVlZGVkLCB0aGUgZm9sbG93aW5nIHZhcmlhYmxlcyB3aWxsCi0gICAgICAgICAqIGJlIHJlcXVpcmVkLgotICAgICAgICAgKi8KLSAgICAgICAgVUludDMyICAgICAgICAgc3luY3dvcmQ7Ci0gICAgICAgIEludCAgICAgICAgICAgIGludm9rZTsKLQotICAgICAgICBJbnQgICAgICAgICBtYXNrW01BWEJBTkRTXTsKLSAgICAgICAgSW50ICAgICAgICAgaGFzbWFzazsKLQotCi0gICAgICAgIC8qICBTQlIgdXNhZ2UKLSAgICAgICAgICogIFRoZXNlIHR3byB1bmlvbnMgYXJlIHVzZWQgZm9yIHRoZSBTQlIgdG9vbCBhbmQgdXNlZAotICAgICAgICAgKiAgYXMgYSBzaW5nbGUgMjU2MCBpbnQzMiBjb250aW51b3VzIG1lbW9yeSBmb3IgY2lyY3VsYXIKLSAgICAgICAgICogIGJ1ZmZlcmluZyB0aGUgc3ludGhlc2lzIFFNRidzIGJhbmsgaGlzdG9yeQotICAgICAgICAgKi8KLQotICAgICAgICAvKiBUaGlzIHVuaW9uIHNwZWNpZmllcyBtZW1vcnkgZm9yIGFycmF5cyB3aGljaCBhcmUgdXNlZAotICAgICAgICAgKiBieSBvbmx5IG9uZSBmdW5jdGlvbi4gIFRoaXMgaXMgdGhlIHNpbXBsZXN0IHR5cGUgb2Ygc2NyYXRjaAotICAgICAgICAgKiBtZW1vcnkgdG8gaW1wbGVtZW50LCBzaW5jZSB0aGVyZSBhcmUgbm8gd29ycmllcyBhYm91dAotICAgICAgICAgKiBmdW5jdGlvbiBpbnRlcmFjdGlvbi4KLSAgICAgICAgICovCi0gICAgICAgIHVuaW9uIHNjcmF0Y2hfbWVtb3J5Ci0gICAgICAgIHsKLSAgICAgICAgICAgIEludDMyICBmZnRbTE9OR19XSU5ET1ddOyAgICAvKiAxMDI0LCBhcyBuZWVkZWQgYnkgdGhlIEZGVCAqLwotICAgICAgICAgICAgSW50MzIgIHRuc19pbnZfZmlsdGVyW1ROU19NQVhfT1JERVJdOwotICAgICAgICAgICAgSW50MzIgIHRuc19kZWNvZGVfY29lZlsyKlROU19NQVhfT1JERVJdOwotICAgICAgICAgICAgSW50ICAgIGh1ZmZib29rX3VzZWRbMjQ4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ICAgICBJbnQgbl9maWx0W1ROU19NQVhfV0lOXTsKLQotICAgICAgICAvKgotICAgICAgICAgKiBGaWx0ZXIgSW5mb3JtYXRpb24KLSAgICAgICAgICoKLSAgICAgICAgICogRm9yIHNob3J0IHdpbmRvd3MsIHRoZXJlIGlzIGEgbWF4aW11bSBvZgotICAgICAgICAgKiAxIGZpbHRlciBwZXIgd2luZG93ICg4IHRvdGFsKQotICAgICAgICAgKgotICAgICAgICAgKiBGb3IgbG9uZyB3aW5kb3dzLCB0aGVyZSBpcyBhIG1heGltdW0gb2YgMyBmaWx0ZXJzCi0gICAgICAgICAqCi0gICAgICAgICAqLwotICAgICAgICBUTlNmaWx0IGZpbHRbVE5TX01BWF9XSU5dOwotCi0gICAgICAgIC8qCi0gICAgICAgICAqIEZvciBzaG9ydCB3aW5kb3dzLCB0aGVyZSBpcyBhIG1heGltdW0gb2YgOCBmaWx0ZXJzLAotICAgICAgICAgKiBlYWNoIG9mIG9yZGVyIDcgKHJlcXVyaW5nIDU2IEludHMpCi0gICAgICAgICAqCi0gICAgICAgICAqIEZvciBsb25nIHdpbmRvd3MsIHRoZXJlIGlzIGEgbWF4aW11bSBvZiAzIGZpbHRlcnMsCi0gICAgICAgICAqIGVhY2ggb2Ygb3JkZXIgMjAgKHJlcXVpcmluZyA2MCBJbnRzKQotICAgICAgICAgKgotICAgICAgICAgKiBTbywgMypUTlNfTUFYX09SREVSIGRlY2xhcmVzIGFuIGFycmF5IG9mIHN1ZmZpY2llbnQKLSAgICAgICAgICogc2l6ZSAoNjApIGZvciBib3RoIGNhc2VzLgotICAgICAgICAgKi8KLSAgICAgICAgSW50MzIgbHBjX2NvZWZbMypUTlNfTUFYX09SREVSXTsKLQotICAgIH0gVE5TX2ZyYW1lX2luZm87Ci0KLSAgICAvKi0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0KLS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tLS0tLSovCi0KLSNpbmNsdWRlICJwdl9ub3JtYWxpemUuaCIKLSNpbmNsdWRlICAic2JyX2NvbnN0YW50cy5oIgotCi0vKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgotIEZ1bmN0aW9ubmFtZTogIHNicl9hbGlhc2luZ19yZWR1Y3Rpb24KLSAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCi0gRGVzY3JpcHRpb246Ci0gQXJndW1lbnRzOgotCi0gUmV0dXJuOiAgICAgICAgbm9uZQotKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLXZvaWQgc2JyX2FsaWFzaW5nX3JlZHVjdGlvbihJbnQzMiAqZGVncmVlQWxpYXMsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgSW50MzIgICogbnJnX2dhaW5fbWFuLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgIEludDMyICAqIG5yZ19nYWluX2V4cCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBJbnQzMiAgKiBucmdfZXN0X21hbiwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBJbnQzMiAgKiBucmdfZXN0X2V4cCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBJbnQzMiAgKiBkb250VXNlVGhlc2VHYWluVmFsdWVzLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgIEludDMyICAgIG5vU3ViYmFuZHMsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgSW50MzIgICAgbG93U3ViYmFuZCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBJbnQzMiAgc3FydF9jYWNoZVtdWzRdLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgIEludDMyICogZ3JvdXBWZWN0b3IpCi17Ci0KLSAgICBJbnQzMiB0ZW1wMTsKLSAgICBJbnQzMiBlc3RfdG90YWw7Ci0gICAgSW50MzIgcmVmX3RvdGFsX21hbjsKLSAgICBJbnQzMiByZWZfdG90YWxfZXhwOwotICAgIEludDMyIHRtcF9xMTsKLSAgICBJbnQzMiB0bXBfcTI7Ci0gICAgSW50MzIgdG1wX3EzOwotICAgIEludDMyIHRtcF9xNDsKLSAgICBJbnQzMiBic3RfbWFuOwotICAgIEludDMyIGJzdF9leHA7Ci0gICAgc3RydWN0IGludGdfZGl2ICAgcXVvdGllbnQ7Ci0gICAgc3RydWN0IGludGdfc3FydCAgcm9vdF9zcTsKLSAgICBJbnQzMiBncm91cDsKLSAgICBJbnQzMiBncm91cGluZyA9IDA7Ci0gICAgSW50MzIgaW5kZXggPSAwOwotICAgIEludDMyIG5vR3JvdXBzOwotICAgIEludDMyIGs7Ci0KLQotICAgIC8qIENhbGN1bGF0ZSBncm91cGluZyovCi0gICAgZm9yIChrID0gMDsgayA8IG5vU3ViYmFuZHMgLSAxOyBrKyspCi0gICAgewotICAgICAgICBpZiAoZGVncmVlQWxpYXNbayArIGxvd1N1YmJhbmQgKyAxXSAmJiBkb250VXNlVGhlc2VHYWluVmFsdWVzW2tdID09IDApCi0gICAgICAgIHsKLSAgICAgICAgICAgIGlmIChncm91cGluZyA9PSAwKQotICAgICAgICAgICAgewotICAgICAgICAgICAgICAgIGdyb3VwVmVjdG9yW2luZGV4XSA9IGsgKyBsb3dTdWJiYW5kOwotICAgICAgICAgICAgICAgIGdyb3VwaW5nID0gMTsKLSAgICAgICAgICAgICAgICBpbmRleCsrOwotICAgICAgICAgICAgfQotICAgICAgICB9Ci0gICAgICAgIGVsc2UKLSAgICAgICAgewotICAgICAgICAgICAgaWYgKGdyb3VwaW5nKQotICAgICAgICAgICAgewotICAgICAgICAgICAgICAgIGdyb3VwVmVjdG9yW2luZGV4XSA9IGsgKyBsb3dTdWJiYW5kOwotCi0gICAgICAgICAgICAgICAgaWYgKCEgZG9udFVzZVRoZXNlR2FpblZhbHVlc1trXSkKLSAgICAgICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgICAgIChncm91cFZlY3RvcltpbmRleF0pKys7Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgIGdyb3VwaW5nID0gMDsKLSAgICAgICAgICAgICAgICBpbmRleCsrOwotICAgICAgICAgICAgfQotICAgICAgICB9Ci0gICAgfQotCi0gICAgaWYgKGdyb3VwaW5nKQotICAgIHsKLSAgICAgICAgZ3JvdXBWZWN0b3JbaW5kZXhdID0gbm9TdWJiYW5kcyArIGxvd1N1YmJhbmQ7Ci0gICAgICAgIGluZGV4Kys7Ci0gICAgfQotICAgIG5vR3JvdXBzID0gKGluZGV4ID4+IDEpOwotCi0KLQotICAgIC8qQ2FsY3VsYXRlIG5ldyBnYWluKi8KLSAgICBmb3IgKGdyb3VwID0gMDsgZ3JvdXAgPCBub0dyb3VwczsgZ3JvdXAgKyspCi0gICAgewotCi0gICAgICAgIGludCBzdGFydEdyb3VwID0gZ3JvdXBWZWN0b3JbKGdyb3VwPDwxKV0gLSBsb3dTdWJiYW5kOwotICAgICAgICBpbnQgc3RvcEdyb3VwICA9IGdyb3VwVmVjdG9yWyhncm91cDw8MSkrMV0gLSBsb3dTdWJiYW5kOwotCi0KLSAgICAgICAgZXN0X3RvdGFsID0gMDsKLSAgICAgICAgcmVmX3RvdGFsX21hbiA9IDA7Ci0KLSAgICAgICAgdG1wX3ExID0gLTEwMDsKLSAgICAgICAgdG1wX3EyID0gLTEwMDsKLQotICAgICAgICBmb3IgKGsgPSBzdGFydEdyb3VwOyBrIDwgc3RvcEdyb3VwOyBrKyspCi0gICAgICAgIHsKLSAgICAgICAgICAgIGlmICh0bXBfcTEgPCBucmdfZXN0X2V4cFtrXSkKLSAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICB0bXBfcTEgPSBucmdfZXN0X2V4cFtrXTsgICAgLyogbWF4ICovCi0gICAgICAgICAgICB9Ci0gICAgICAgICAgICBpZiAodG1wX3EyIDwgKG5yZ19lc3RfZXhwW2tdICsgKG5yZ19nYWluX2V4cFtrXSA8PCAxKSkpCi0gICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgdG1wX3EyID0gKG5yZ19lc3RfZXhwW2tdICsgKG5yZ19nYWluX2V4cFtrXSA8PCAxKSk7ICAvKiBtYXggKi8KLSAgICAgICAgICAgIH0KLSAgICAgICAgfQotCi0KLSAgICAgICAgayAtPSBzdGFydEdyb3VwOyAgICAgICAgLyogIG51bWJlciBvZiBlbGVtZW50IHVzZWQgaW4gdGhlIGFkZGl0aW9uICovCi0gICAgICAgIC8qIGFkanVzdCBRIGZvcm1hdCAqLwotICAgICAgICB0bXBfcTIgKz0gNTkgLSBwdl9ub3JtYWxpemUoayk7Ci0KLSAgICAgICAgZm9yIChrID0gc3RhcnRHcm91cDsgayA8IHN0b3BHcm91cDsgaysrKQotICAgICAgICB7Ci0gICAgICAgICAgICAvKgotICAgICAgICAgICAgICogIGVzdF90b3RhbCArPSBucmdfZXN0W2tdCi0gICAgICAgICAgICAgKiAgcmVmX3RvdGFsICs9IG5yZ19lc3Rba10qbnJnX2dhaW5ba10qbnJnX2dhaW5bawotICAgICAgICAgICAgICovCi0gICAgICAgICAgICBlc3RfdG90YWwgKz0gbnJnX2VzdF9tYW5ba10gPj4gKHRtcF9xMSAtIG5yZ19lc3RfZXhwW2tdKTsKLQotICAgICAgICAgICAgaWYgKHRtcF9xMiAtIChucmdfZXN0X2V4cFtrXSArIChucmdfZ2Fpbl9leHBba10gPDwgMSkpIDwgNjApCi0gICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgbnJnX2dhaW5fbWFuW2tdID0gZnhwX211bDMyX1EyOChucmdfZ2Fpbl9tYW5ba10sIG5yZ19nYWluX21hbltrXSk7Ci0gICAgICAgICAgICAgICAgbnJnX2dhaW5fZXhwW2tdID0gKG5yZ19nYWluX2V4cFtrXSA8PCAxKSArIDI4OwotICAgICAgICAgICAgICAgIHRtcF9xMyAgICAgICAgICA9IGZ4cF9tdWwzMl9RMjgobnJnX2dhaW5fbWFuW2tdLCBucmdfZXN0X21hbltrXSk7Ci0gICAgICAgICAgICAgICAgcmVmX3RvdGFsX21hbiAgICArPSB0bXBfcTMgPj4gKHRtcF9xMiAtIChucmdfZXN0X2V4cFtrXSArIG5yZ19nYWluX2V4cFtrXSkpOwotICAgICAgICAgICAgfQotICAgICAgICB9Ci0KLSAgICAgICAgcmVmX3RvdGFsX2V4cCA9IHRtcF9xMiArIDI4OwotCi0gICAgICAgIHB2X2RpdihyZWZfdG90YWxfbWFuLCBlc3RfdG90YWwsICZxdW90aWVudCk7Ci0KLSAgICAgICAgdG1wX3EyICs9IC0gdG1wX3ExIC0gcXVvdGllbnQuc2hpZnRfZmFjdG9yIC0gMjsKLQotCi0KLSAgICAgICAgZm9yIChrID0gc3RhcnRHcm91cDsgayA8IHN0b3BHcm91cDsgaysrKQotICAgICAgICB7Ci0gICAgICAgICAgICBJbnQzMiBhbHBoYTsKLSAgICAgICAgICAgIHRlbXAxID0gayArIGxvd1N1YmJhbmQ7Ci0gICAgICAgICAgICBpZiAoayA8IG5vU3ViYmFuZHMgLSAxKQotICAgICAgICAgICAgewotICAgICAgICAgICAgICAgIGFscGhhID0gZGVncmVlQWxpYXNbdGVtcDEgKyAxXSA+IGRlZ3JlZUFsaWFzW3RlbXAxIF0gPwotICAgICAgICAgICAgICAgICAgICAgICAgZGVncmVlQWxpYXNbdGVtcDEgKyAxXSA6IGRlZ3JlZUFsaWFzW3RlbXAxIF07Ci0gICAgICAgICAgICB9Ci0gICAgICAgICAgICBlbHNlCi0gICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgYWxwaGEgPSBkZWdyZWVBbGlhc1t0ZW1wMV07Ci0gICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgIC8qCi0gICAgICAgICAgICAgKiAgbnJnX2dhaW5ba10gPSBhbHBoYSpuZXdHYWluICsgKDEuMGYtYWxwaGEpKm5yZ19nYWluW2tdKm5yZ19nYWluW2tdOwotICAgICAgICAgICAgICovCi0KLSAgICAgICAgICAgIHRtcF9xMSA9IHRtcF9xMiA+IG5yZ19nYWluX2V4cFtrXSA/IHRtcF9xMiA6IG5yZ19nYWluX2V4cFtrXTsKLSAgICAgICAgICAgIHRtcF9xMSsrOwotCi0gICAgICAgICAgICB0bXBfcTMgPSBmeHBfbXVsMzJfUTMwKGFscGhhLCBxdW90aWVudC5xdW90aWVudCk7Ci0gICAgICAgICAgICB0bXBfcTQgPSBmeHBfbXVsMzJfUTMwKFEzMGZtdCgxLjBmKSAtIGFscGhhLCBucmdfZ2Fpbl9tYW5ba10pOwotCi0gICAgICAgICAgICBucmdfZ2Fpbl9tYW5ba10gPSAodG1wX3EzID4+ICh0bXBfcTEgLSB0bXBfcTIpKSArCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAodG1wX3E0ID4+ICh0bXBfcTEgLSBucmdfZ2Fpbl9leHBba10pKTsKLQotICAgICAgICAgICAgbnJnX2dhaW5fZXhwW2tdID0gdG1wX3ExOwotICAgICAgICB9Ci0KLQotICAgICAgICBic3RfZXhwID0gLTEwMDsKLQotICAgICAgICBmb3IgKGsgPSBzdGFydEdyb3VwOyBrIDwgc3RvcEdyb3VwOyBrKyspCi0gICAgICAgIHsKLSAgICAgICAgICAgIGlmIChic3RfZXhwIDwgbnJnX2dhaW5fZXhwW2tdICsgbnJnX2VzdF9leHBba10pCi0gICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgYnN0X2V4cCA9IG5yZ19nYWluX2V4cFtrXSArIG5yZ19lc3RfZXhwW2tdOyAgICAvKiBtYXggKi8KLSAgICAgICAgICAgIH0KLSAgICAgICAgfQotCi0gICAgICAgIGsgLT0gc3RhcnRHcm91cDsgICAgICAgIC8qICBudW1iZXIgb2YgZWxlbWVudCB1c2VkIGluIHRoZSBhZGRpdGlvbiAqLwotCi0gICAgICAgIHdoaWxlIChrICE9IDApICAgICAgICAgIC8qICBiaXQgZ3VhcmQgcHJvdGVjdGlvbiBkZXBlbmRzIG9uIGxvZzIoaykgICovCi0gICAgICAgIHsKLSAgICAgICAgICAgIGsgPj49IDE7Ci0gICAgICAgICAgICBic3RfZXhwKys7ICAgICAgICAgICAvKiAgYWRkIGV4dHJhIGJpdC1vdmVyZmxvdy1ndWFyZCAqLwotICAgICAgICB9Ci0KLSAgICAgICAgYnN0X21hbiA9IDA7Ci0KLSAgICAgICAgZm9yIChrID0gc3RhcnRHcm91cDsgayA8IHN0b3BHcm91cDsgaysrKQotICAgICAgICB7Ci0gICAgICAgICAgICB0bXBfcTIgPSAgZnhwX211bDMyX1EyOChucmdfZ2Fpbl9tYW5ba10sIG5yZ19lc3RfbWFuW2tdKTsKLSAgICAgICAgICAgIGJzdF9tYW4gKz0gIHRtcF9xMiA+PiAoYnN0X2V4cCAtIG5yZ19nYWluX2V4cFtrXSAtIG5yZ19lc3RfZXhwW2tdKTsKLSAgICAgICAgfQotCi0gICAgICAgIGJzdF9leHAgKz0gMjg7ICAvKiBjb21wZW5zYXRlIGZvciBzaGlmdCBkb3duICovCi0KLSAgICAgICAgaWYgKGJzdF9tYW4pCi0gICAgICAgIHsKLSAgICAgICAgICAgIC8qCi0gICAgICAgICAgICAgKiAgYnN0ID0gcmVmX3RvdGFsIC8gYnN0Ci0gICAgICAgICAgICAgKi8KLQotICAgICAgICAgICAgcHZfZGl2KHJlZl90b3RhbF9tYW4sIGJzdF9tYW4sICZxdW90aWVudCk7Ci0gICAgICAgICAgICBic3RfZXhwID0gcmVmX3RvdGFsX2V4cCAtIGJzdF9leHAgLSBxdW90aWVudC5zaGlmdF9mYWN0b3IgLSAzMDsKLSAgICAgICAgICAgIGJzdF9tYW4gPSBxdW90aWVudC5xdW90aWVudDsgICAgICAvKiAgUTMwICovCi0KLSAgICAgICAgICAgIGZvciAoayA9IHN0YXJ0R3JvdXA7IGsgPCBzdG9wR3JvdXA7IGsrKykKLSAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICB0bXBfcTEgPSBmeHBfbXVsMzJfUTMwKGJzdF9tYW4sIG5yZ19nYWluX21hbltrXSk7Ci0gICAgICAgICAgICAgICAgcHZfc3FydCh0bXBfcTEsIChic3RfZXhwICsgbnJnX2dhaW5fZXhwW2tdICsgNjApLCAmcm9vdF9zcSwgc3FydF9jYWNoZVswXSk7Ci0gICAgICAgICAgICAgICAgbnJnX2dhaW5fbWFuW2tdID0gcm9vdF9zcS5yb290OwotICAgICAgICAgICAgICAgIG5yZ19nYWluX2V4cFtrXSA9IHJvb3Rfc3Euc2hpZnRfZmFjdG9yOwotICAgICAgICAgICAgfQotICAgICAgICB9Ci0gICAgICAgIGVsc2UKLSAgICAgICAgewotICAgICAgICAgICAgcHZfbWVtc2V0KCh2b2lkICopJm5yZ19nYWluX21hbltzdGFydEdyb3VwXSwKLSAgICAgICAgICAgICAgICAgICAgICAwLAotICAgICAgICAgICAgICAgICAgICAgIChzdG9wR3JvdXAgLSBzdGFydEdyb3VwKSpzaXplb2YobnJnX2dhaW5fbWFuWzBdKSk7Ci0KLSAgICAgICAgICAgIHB2X21lbXNldCgodm9pZCAqKSZucmdfZ2Fpbl9leHBbc3RhcnRHcm91cF0sCi0gICAgICAgICAgICAgICAgICAgICAgMCwKLSAgICAgICAgICAgICAgICAgICAgICAoc3RvcEdyb3VwIC0gc3RhcnRHcm91cCkqc2l6ZW9mKG5yZ19nYWluX2V4cFswXSkpOwotCi0gICAgICAgIH0KLQotICAgIH0KLX0KLQotI2VuZGlmCi0KLQotCmRpZmYgLS1naXQgYS9tZWRpYS9saWJzdGFnZWZyaWdodC9jb2RlY3MvYWFjZGVjL3Nicl9hbGlhc2luZ19yZWR1Y3Rpb24uaCBiL21lZGlhL2xpYnN0YWdlZnJpZ2h0L2NvZGVjcy9hYWNkZWMvc2JyX2FsaWFzaW5nX3JlZHVjdGlvbi5oCmRlbGV0ZWQgZmlsZSBtb2RlIDEwMDY0NAppbmRleCAy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SW50MzIgKmRlZ3JlZUFsaWFzLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgIEludDMyICAqIG5yZ19nYWluX21hbiwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBJbnQzMiAgKiBucmdfZ2Fpbl9leHAsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgSW50MzIgICogbnJnX2VzdF9tYW4sCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgSW50MzIgICogbnJnX2VzdF9leHAsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgSW50MzIgICogZG9udFVzZVRoZXNlR2FpblZhbHVlcywKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBJbnQzMiAgICBub1N1YmJhbmRzLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgIEludDMyICAgIGxvd1N1YmJhbmQsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgSW50MzIgIHNxcnRfY2FjaGVbXVs0XSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBJbnQzMiAqIGdyb3VwVmVjdG9yKTsKLQotCi0vKi0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0KLTsgRU5ECi0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tKi8KLSNlbmRpZgotCi0KZGlmZiAtLWdpdCBhL21lZGlhL2xpYnN0YWdlZnJpZ2h0L2NvZGVjcy9hYWNkZWMvc2JyX2FwcGxpZWQuY3BwIGIvbWVkaWEvbGlic3RhZ2VmcmlnaHQvY29kZWNzL2FhY2RlYy9zYnJfYXBwbGllZC5jcHAKZGVsZXRlZCBmaWxlIG1vZGUgMTAwNjQ0CmluZGV4IGM4YjgxYjIuLjAwMDAwMDAKLS0tIGEvbWVkaWE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IFBTIERhdGEgb25seSB3aGVuIGF2YWlsYWJsZSAqLwotICAgIGlmIChzdHJlYW0tPk5yRWxlbWVudHMpCi0gICAgewotICAgICAgICAvKiByZWFkIGZyYW1lIGRhdGEgZnJvbSBiaXRzdHJlYW0gKi8KLQotICAgICAgICBlcnIgPSBzYnJfcmVhZF9kYXRhKHNlbGYsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgc2JyRGVjLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgIHN0cmVhbSk7Ci0KLSAgICAgICAgaWYgKGVyciAhPSBTQlJERUNfT0spCi0gICAgICAgIHsKLSAgICAgICAgICAgIC8qCi0gICAgICAgICAgICAgKiBUaGlzIGVycm9yIGNvbmRpdGlvbiBkaXNhYmxlcyBhbnkgZnVydGhlciBTQlIgcHJvY2Vzc2luZwotICAgICAgICAgICAgICovCi0gICAgICAgICAgICBzZWxmLT5TYnJDaGFubmVsW0xFRlRdLnN5bmNTdGF0ZSA9IFVQU0FNUExJTkc7Ci0gICAgICAgICAgICBpZiAoZWxlQ2hhbm5lbHMgPT0gMikKLSAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICBzZWxmLT5TYnJDaGFubmVsW1JJR0hUXS5zeW5jU3RhdGUgPSBVUFNBTVBMSU5HOwotICAgICAgICAgICAgfQotICAgICAgICB9Ci0KLSAgICAgICAgLyoKLSAgICAgICAgICogIFNldHRpbmcgYmlzdHJlYW0gYW5kIGRlY29kaW5nIHR5cGUgaXMgb25seSBkb25lIG9uY2UsCi0gICAgICAgICAqLwotICAgICAgICBpZiAoU2JyQ2hhbm5lbFtMRUZUXS5zeW5jU3RhdGUgPT0gU0JSX0FDVElWRSAmJiBzZWxmLT5zZXRTdHJlYW1UeXBlKQotICAgICAgICB7Ci0gICAgICAgICAgICBzZWxmLT5zZXRTdHJlYW1UeXBlID0gMDsgIC8qIERpc2FibGUgTG9jayBmb3IgQUFDIHN0cmVhbSB0eXBlIHNldHRpbmcgICovCi0KLSNpZmRlZiBIUV9TQlIKLSNpZmRlZiBQQVJBTUVUUklDU1RFUkVPCi0KLSAgICAgICAgICAgIEludCBzYnJFbmFibGVQUyA9IHNlbGYtPmhQYXJhbWV0cmljU3RlcmVvRGVjLT5wc0RldGVjdGVkOwotCi0gICAgICAgICAgICBwVmFycy0+bWNfaW5mby5wc1ByZXNlbnRGbGFnICA9IHNickVuYWJsZVBTOwotCi0gICAgICAgICAgICBpZiAoc2JyRW5hYmxlUFMpICAgLyogSW5pdGlhbGl6ZSBQUyBhcnJheXMgKi8KLSAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICBwVmFycy0+bWNfaW5mby5FeHRlbmRlZEF1ZGlvT2JqZWN0VHlwZSA9IE1QNEFVRElPX1BTOwotICAgICAgICAgICAgICAgIHBzX2FsbG9jYXRlX2RlY29kZXIoc2VsZiwgMzIpOwotCi0gICAgICAgICAgICAgICAgLyogRGlzYWJsZSBMQyAob3IgRW5hYmxlIEhRKSAgaWYgUFMgaXMgZGV0ZWN0ZWQgKi8KLSAgICAgICAgICAgICAgICBzYnJEZWMtPkxDX2FhY1BfRGVjb2RlckZsYWcgPSBPRkY7Ci0gICAgICAgICAgICB9Ci0gICAgICAgICAgICBlbHNlCi0gICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgLyoKLSAgICAgICAgICAgICAgICAgKiAgRG8gbm90IGRvd25ncmFkZSBzdHJlYW0gdHlwZSBmcm9tIGVhYWMrLCBpZiBpdCBoYXMgYmVlbiBleHBsaWNpdGx5IGRlY2xhcmVkCi0gICAgICAgICAgICAgICAgICovCi0gICAgICAgICAgICAgICAgaWYgKHBWYXJzLT5tY19pbmZvLkV4dGVuZGVkQXVkaW9PYmplY3RUeXBlICE9IE1QNEFVRElPX1BTKQotICAgICAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAgICAgcFZhcnMtPm1jX2luZm8uRXh0ZW5kZWRBdWRpb09iamVjdFR5cGUgPSBNUDRBVURJT19TQlI7Ci0KLSAgICAgICAgICAgICAgICAgICAgaWYgKHBWYXJzLT5tY19pbmZvLm5jaCA+IDEpCi0gICAgICAgICAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAgICAgICAgIHNickRlYy0+TENfYWFjUF9EZWNvZGVyRmxhZyA9IE9OOyAgICAvKiBFbmFibGUgTEMgZm9yIHN0ZXJlbyAqLwotICAgICAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgICAgIGVsc2UKLSAgICAgICAgICAgICAgICAgICAgewotICAgICAgICAgICAgICAgICAgICAgICAgc2JyRGVjLT5MQ19hYWNQX0RlY29kZXJGbGFnID0gT0ZGOyAgICAvKiBEaXNhYmxlIExDLCBFbmFibGUgSFEgZm9yIG1vbm8gKi8KLSAgICAgICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICBlbHNlCi0gICAgICAgICAgICAgICAgewotICAgICAgICAgICAgICAgICAgICBzYnJFbmFibGVQUyA9IDE7ICAvKiBGb3JjZSB0aGlzIGNvbmRpdGlvbiBhcyBpdCB3YXMgZXhwbGljaXRpdGx5IGRlY2xhcmVkICovCi0gICAgICAgICAgICAgICAgICAgIHBWYXJzLT5tY19pbmZvLnBzUHJlc2VudEZsYWcgID0gc2JyRW5hYmxlUFM7Ci0KLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICB9Ci0jZWxzZQotCi0gICAgICAgICAgICBwVmFycy0+bWNfaW5mby5FeHRlbmRlZEF1ZGlvT2JqZWN0VHlwZSA9IE1QNEFVRElPX1NCUjsKLQotICAgICAgICAgICAgaWYgKHBWYXJzLT5tY19pbmZvLm5jaCA+IDEpCi0gICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgc2JyRGVjLT5MQ19hYWNQX0RlY29kZXJGbGFnID0gT047ICAgIC8qIEVuYWJsZSBMQyBmb3Igc3RlcmVvICovCi0gICAgICAgICAgICB9Ci0gICAgICAgICAgICBlbHNlCi0gICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgc2JyRGVjLT5MQ19hYWNQX0RlY29kZXJGbGFnID0gT0ZGOyAgICAvKiBEaXNhYmxlIExDLCBFbmFibGUgSFEgZm9yIG1vbm8gKi8KLSAgICAgICAgICAgIH0KLSNlbmRpZgotCi0jZWxzZQotICAgICAgICAgICAgcFZhcnMtPm1jX2luZm8uRXh0ZW5kZWRBdWRpb09iamVjdFR5cGUgPSBNUDRBVURJT19TQlI7Ci0KLSAgICAgICAgICAgIHNickRlYy0+TENfYWFjUF9EZWNvZGVyRmxhZyA9IE9OOyAgICAgICAvKiBFbmFibGUgTEMgZm9yIGFsbCBzYnIgZGVjb2RpbmcgKi8KLQotI2VuZGlmCi0KLSAgICAgICAgfSAgIC8qICAgKFNickNoYW5uZWxbTEVGVF0uc3luY1N0YXRlID09IFNCUl9BQ1RJVkUgJiYgbG9jaykgICovCi0gICAgICAgIGVsc2UKLSAgICAgICAgewotICAgICAgICAgICAgLyoKLSAgICAgICAgICAgICAqICBEZWZhdWx0IHNldHRpbmcgZm9yIHVwc2FtcGxlcgotICAgICAgICAgICAgICovCi0gICAgICAgICAgICBpZiAocFZhcnMtPm1jX2luZm8uRXh0ZW5kZWRBdWRpb09iamVjdFR5cGUgPT0gTVA0QVVESU9fQUFDX0xDKQotICAgICAgICAgICAgewotICAgICAgICAgICAgICAgIC8qCi0gICAgICAgICAgICAgICAgICogIENoYW5nZSBvbmx5IGluIGltcGxpY2l0IHNpZ25hbGxpbmcsIG90aGVyd2lzZSBrZWVwIG9yaWdpbmFsIGRlY2xhcmF0aW9uCi0gICAgICAgICAgICAgICAgICovCi0gICAgICAgICAgICAgICAgcFZhcnMtPm1jX2luZm8uRXh0ZW5kZWRBdWRpb09iamVjdFR5cGUgPSBNUDRBVURJT19TQlI7Ci0gICAgICAgICAgICB9Ci0KLSNpZmRlZiBIUV9TQlIKLSAgICAgICAgICAgIGlmIChwVmFycy0+bWNfaW5mby5uY2ggPiAxKQotICAgICAgICAgICAgewotICAgICAgICAgICAgICAgIHNickRlYy0+TENfYWFjUF9EZWNvZGVyRmxhZyA9IE9OOyAgICAvKiBFbmFibGUgTEMgZm9yIHN0ZXJlbyAqLwotICAgICAgICAgICAgfQotICAgICAgICAgICAgZWxzZQotICAgICAgICAgICAgewotICAgICAgICAgICAgICAgIHNickRlYy0+TENfYWFjUF9EZWNvZGVyRmxhZyA9IE9GRjsgICAgLyogRGlzYWJsZSBMQywgRW5hYmxlIEhRIGZvciBtb25vICovCi0gICAgICAgICAgICB9Ci0jZWxzZQotICAgICAgICAgICAgc2JyRGVjLT5MQ19hYWNQX0RlY29kZXJGbGFnID0gT047ICAgICAgIC8qIEVuYWJsZSBMQyBmb3IgYWxsIHNiciBkZWNvZGluZyAqLwotCi0jZW5kaWYKLSAgICAgICAgICAgIC8qIG1hc2sgZXJyb3IgYW5kIGxldCB1cHNhbXBsZXIgcnVuICovCi0gICAgICAgICAgICBlcnIgPSBTQlJERUNfT0s7Ci0KLSAgICAgICAgfQotCi0gICAgICAgIC8qIGRlY29kaW5nICovCi0gICAgICAgIGVsZUNoYW5uZWxzID0gKHN0cmVhbS0+c2JyRWxlbWVudCBbTEVGVF0uRWxlbWVudElEID09IFNCUl9JRF9DUEUpID8gMiA6IDE7Ci0KLSAgICAgICAgaWYgKFNickNoYW5uZWxbTEVGVF0uc3luY1N0YXRlID09IFNCUl9BQ1RJVkUpCi0gICAgICAgIHsKLQotICAgICAgICAgICAgc2JyX2RlY29kZV9lbnZlbG9wZSgmKFNickNoYW5uZWxbTEVGVF0uZnJhbWVEYXRhKSk7Ci0KLSAgICAgICAgICAgIGRlY29kZV9ub2lzZV9mbG9vcmxldmVscygmKFNickNoYW5uZWxbTEVGVF0uZnJhbWVEYXRhKSk7Ci0KLSAgICAgICAgICAgIGlmICghIFNickNoYW5uZWxbTEVGVF0uZnJhbWVEYXRhLmNvdXBsaW5nKQotICAgICAgICAgICAgewotICAgICAgICAgICAgICAgIHNicl9yZXF1YW50aXplX2VudmVsb3BlX2RhdGEoJihTYnJDaGFubmVsW0xFRlRdLmZyYW1lRGF0YSkpOwotICAgICAgICAgICAgfQotCi0gICAgICAgICAgICBpZiAoZWxlQ2hhbm5lbHMgPT0gMikKLSAgICAgICAgICAgIHsKLQotICAgICAgICAgICAgICAgIHNicl9kZWNvZGVfZW52ZWxvcGUoJihTYnJDaGFubmVsW1JJR0hUXS5mcmFtZURhdGEpKTsKLQotICAgICAgICAgICAgICAgIGRlY29kZV9ub2lzZV9mbG9vcmxldmVscygmKFNickNoYW5uZWxbUklHSFRdLmZyYW1lRGF0YSkpOwotCi0gICAgICAgICAgICAgICAgaWYgKFNickNoYW5uZWxbUklHSFRdLmZyYW1lRGF0YS5jb3VwbGluZykKLSAgICAgICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgICAgIHNicl9lbnZlbG9wZV91bm1hcHBpbmcoJihTYnJDaGFubmVsWyBMRUZUXS5mcmFtZURhdGEpLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICYoU2JyQ2hhbm5lbFtSSUdIVF0uZnJhbWVEYXRhKSk7Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgIGVsc2UKLSAgICAgICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgICAgIHNicl9yZXF1YW50aXplX2VudmVsb3BlX2RhdGEoJihTYnJDaGFubmVsW1JJR0hUXS5mcmFtZURhdGEpKTsKLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICB9Ci0gICAgICAgIH0KLSAgICAgICAgZWxzZSAgICAgICAgICAgIC8qIGVuYWJsZSB1cHNhbXBsaW5nIHVudGlsIHZhbGlkIFNCUiBpcyBvYnRhaW5lZCAqLwotICAgICAgICB7Ci0gICAgICAgICAgICAvKgotICAgICAgICAgICAgICogIEluY29tcGxldGUgc2JyIGZyYW1lLCBvciBkaXNhYmxlZCBTQlIgc2VjdGlvbgotICAgICAgICAgICAgICogIFNldCB0aGUgZGVjb2RlciB0byBhY3QgYXMgYSByZWd1bGFyIHVwc2FtcGxlcgotICAgICAgICAgICAgICovCi0KLSAgICAgICAgICAgIGluaXRfc2JyX2RlYygoc2JyRGVjLT5vdXRTYW1wbGVSYXRlID4+IDEpLAotICAgICAgICAgICAgICAgICAgICAgICAgIHBWYXJzLT5tY19pbmZvLnVwc2FtcGxpbmdGYWN0b3IsCi0gICAgICAgICAgICAgICAgICAgICAgICAgc2JyRGVjLAotICAgICAgICAgICAgICAgICAgICAgICAgICYoc2VsZi0+U2JyQ2hhbm5lbFtMRUZUXS5mcmFtZURhdGEpKTsKLQotICAgICAgICAgICAgaWYgKChlbGVDaGFubmVscyA9PSAyKSAmJiAoU2JyQ2hhbm5lbFtSSUdIVF0uc3luY1N0YXRlICE9IFNCUl9BQ1RJVkUpKQotICAgICAgICAgICAgewotICAgICAgICAgICAgICAgIGluaXRfc2JyX2RlYygoc2JyRGVjLT5vdXRTYW1wbGVSYXRlID4+IDEpLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwVmFycy0+bWNfaW5mby51cHNhbXBsaW5nRmFjdG9yLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzYnJEZWMsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICYoc2VsZi0+U2JyQ2hhbm5lbFtSSUdIVF0uZnJhbWVEYXRhKSk7Ci0KLSAgICAgICAgICAgIH0KLQotICAgICAgICB9Ci0KLSAgICB9Ci0KLQotI2lmZGVmIEhRX1NCUgotI2lmZGVmIFBBUkFNRVRSSUNTVEVSRU8KLSAgICBpZiAocFZhcnMtPm1jX2luZm8uRXh0ZW5kZWRBdWRpb09iamVjdFR5cGUgPT0gTVA0QVVESU9fUFMpCi0gICAgewotICAgICAgICBwc19ic3RyX2RlY29kaW5nKHNlbGYtPmhQYXJhbWV0cmljU3RlcmVvRGVjKTsKLSAgICAgICAgLyogYWxsb2NhdGUgcG9pbnRlciBmb3IgcmlndGggY2hhbm5lbCBxbWYgZmlsdGVyIGhpc3RvcnkgICovC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S0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tCi0gICAgOyBFWFRFUk5BTCBHTE9CQUwgU1RPUkUvQlVGRkVSL1BPSU5URVIgUkVGRVJFTkNFUwotICAgIDsgRGVjbGFyZSB2YXJpYWJsZXMgdXNlZCBpbiB0aGlzIG1vZHVsZSBidXQgZGVmaW5lZCBlbHNld2hlcmUKLSAgICAtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tKi8KLSAgICAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLSAgICAvKiB0YWJsZSAgICAgICA6IGVudmVsb3BlIGxldmVsLCAxLjUgZEIgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLSAgICAvKiB0aGVvciByYW5nZSA6IFstNTgsNThdLCBDT0RFX0JPT0tfU0NGX0xBViAgID0gNTggICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLSAgICAvKiBpbXBsZW0gcmFuZ2U6IFstNjAsNjBdLCBDT0RFX0JPT0tfU0NGX0xBVjEwID0gNjAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLSAgICAvKiByYXcgc3RhdHMgICA6IGVudmVsb3BlTGV2ZWxfMDAgKHllcywgd3Jvbmcgc3VmZml4IGluIG5hbWUpICBLSyAwMS0wMy0wOSAgICAgKi8KLSAgICAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLQotICAgIC8qIGRpcmVjdGlvbjogdGltZQotICAgICAgIHJhdyB0YWJsZTogSHVmZkNvZGUzQzJGSVgubS9lbnZlbG9wZUxldmVsXzAwVF9jRi5tYXQvbV9oQUxDX2NGCi0gICAgICAgYnVpbHQg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LSAgICAgICAgeyAtMTA2LCAtMTA0IH0sICAgIHsgIDkwLCAxMDUgfSwgICAgeyAgOTEsICA5OCB9LCAgICB7ICA5MiwgIDk1IH0sCi0gICAgICAgIHsgIDkzLCAgOTQgfSwgICAgeyAtMTAzLCAtMTAyIH0sICAgIHsgLTEwMCwgLTk5IH0sICAgIHsgIDk2LCAgOTcgfSwKLSAgICAgICAgeyAtOTgsIC05NiB9LCAgICB7IC0zNSwgLTMzIH0sICAgIHsgIDk5LCAxMDIgfSwgICAgeyAxMDAsIDEwMSB9LAotICAgICAgICB7IC0zMiwgLTMxIH0sICAgIHsgLTMwLCAtMjkgfSwgICAgeyAxMDMsIDEwNCB9LCAgICB7IC0yOCwgLTI2IH0sCi0gICAgICAgIHsgLTI1LCAtMjQgfSwgICAgeyAxMDYsIDExMyB9LCAgICB7IDEwNywgMTEwIH0sICAgIHsgMTA4LCAxMDkgfSwKLSAgICAgICAgeyAtMjMsIC0yMSB9LCAgICB7IC0xOSwgLTE4IH0sICAgIHsgMTExLCAxMTIgfSwgICAgeyAtMTUsIC0xNCB9LAotICAgICAgICB7IC0xMywgLTEyIH0sICAgIHsgMTE0LCAxMTcgfSwgICAgeyAxMTUsIDExNiB9LCAgICB7IC0xMSwgLTEwIH0sCi0gICAgICAgIHsgIC05LCAgLTggfSwgICAgeyAxMTgsIDExOSB9LCAgICB7ICAtNywgIC02IH0sICAgIHsgIC01LCAgLTQgfQotICAgIH07Ci0KLSAgICAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLSAgICAvKiB0YWJsZSAgICAgICA6IGVudmVsb3BlIGJhbGFuY2UsIDEuNSBkQiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLSAgICAvKiB0aGVvciByYW5nZSA6IFstNDgsNDhdLCBDT0RFX0JPT0tfU0NGX0xBViA9IDQ4ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLSAgICAvKiBpbXBsZW0gcmFuZ2U6IHNhbWUgYnV0IG1hcHBlZCB0byBbLTI0LDI0XSwgQ09ERV9CT09LX1NDRl9MQVZfQkFMQU5DRTEwID0gMjQgKi8KLSAgICAvKiByYXcgc3RhdHMgICA6IGVudmVsb3BlUGFuXzAwICh5ZXMsIHdyb25nIHN1ZmZpeCBpbiBuYW1lKSAgS0sgMDEtMDMtMDkgICAgICAgKi8KLSAgICAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLQotICAgIC8qIGRpcmVjdGlvbjogdGltZQotICAgICAgIHJhdyB0YWJsZTogSHVmZkNvZGUzQy5tL2VudmVsb3BlUGFuXzAwVC5tYXQvdl9oQUxCCi0gICAgICAgYnVpbHQgYnkgOiBGSCAwMS0wNS0xNSAqLwotCi0gICAgZXh0ZXJuIGNvbnN0IENoYXIgYm9va1NickVudkJhbGFuY2UxMFRbNDhdWzJdID0KLSAgICB7Ci0gICAgICAgIHsgLTY0LCAgIDEgfSwgICAgeyAtNjMsICAgMiB9LCAgICB7IC02NSwgICAzIH0sICAgIHsgLTYyLCAgIDQgfSwKLSAgICAgICAgeyAtNjYsICAgNSB9LCAgICB7IC02MSwgICA2IH0sICAgIHsgLTY3LCAgIDcgfSwgICAgeyAtNjAsICAgOCB9LAotICAgICAgICB7IC02OCwgICA5IH0sICAgIHsgIDEwLCAgMTEgfSwgICAgeyAtNjksIC01OSB9LCAgICB7ICAxMiwgIDEzIH0sCi0gICAgICAgIHsgLTcwLCAtNTggfSwgICAgeyAgMTQsICAyOCB9LCAgICB7ICAxNSwgIDIxIH0sICAgIHsgIDE2LCAgMTggfSwKLSAgICAgICAgeyAtNTcsICAxNyB9LCAgICB7IC03MSwgLTU2IH0sICAgIHsgIDE5LCAgMjAgfSwgICAgeyAtODgsIC04NyB9LAotICAgICAgICB7IC04NiwgLTg1IH0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sgLTYwLCAgIDkgfSwgICAgeyAgMTAsICAxMSB9LCAgICB7IC02OSwgLTU5IH0sICAgIHsgLTcwLCAgMTIgfSwKLSAgICAgICAgeyAtNTgsICAxMyB9LCAgICB7ICAxNCwgIDE3IH0sICAgIHsgLTcxLCAgMTUgfSwgICAgeyAtNTcsICAxNiB9LAotICAgICAgICB7IC01NiwgLTczIH0sICAgIHsgIDE4LCAgMzIgfSwgICAgeyAgMTksICAyNSB9LCAgICB7ICAyMCwgIDIyIH0sCi0gICAgICAgIHsgLTcyLCAgMjEgfSwgICAgeyAtODgsIC04NyB9LCAgICB7ICAyMywgIDI0IH0sICAgIHsgLTg2LCAtODUgfSwKLSAgICAgICAgeyAtODQsIC04MyB9LCAgICB7ICAyNiwgIDI5IH0sICAgIHsgIDI3LCAgMjggfSwgICAgeyAtODIsIC04MSB9LAotICAgICAgICB7IC04MCwgLTc5IH0sICAgIHsgIDMwLCAgMzEgfSwgICAgeyAtNzgsIC03NyB9LCAgICB7IC03NiwgLTc1IH0sCi0gICAgICAgIHsgIDMzLCAgNDAgfSwgICAgeyAgMzQsICAzNyB9LCAgICB7ICAzNSwgIDM2IH0sICAgIHsgLTc0LCAtNTUgfSwKLSAgICAgICAgeyAtNTQsIC01MyB9LCAgICB7ICAzOCwgIDM5IH0sICAgIHsgLTUyLCAtNTEgfSwgICAgeyAtNTAsIC00OSB9LAotICAgICAgICB7ICA0MSwgIDQ0IH0sICAgIHsgIDQyLCAgNDMgfSwgICAgeyAtNDgsIC00NyB9LCAgICB7IC00NiwgLTQ1IH0sCi0gICAgICAgIHsgIDQ1LCAgNDYgfSwgICAgeyAtNDQsIC00MyB9LCAgICB7IC00MiwgIDQ3IH0sICAgIHsgLTQxLCAtNDAgfQotICAgIH07Ci0KLSAgICAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLSAgICAvKiB0YWJsZSAgICAgICA6IGVudmVsb3BlIGxldmVsLCAzLjAgZEIgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLSAgICAvKiB0aGVvciByYW5nZSA6IFstMjksMjldLCBDT0RFX0JPT0tfU0NGX0xBViAgID0gMjkgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLSAgICAvKiBpbXBsZW0gcmFuZ2U6IFstMzEsMzFdLCBDT0RFX0JPT0tfU0NGX0xBVjExID0gMzEgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLSAgICAvKiByYXcgc3RhdHMgICA6IGVudmVsb3BlTGV2ZWxfMTEgIEtLIDAwLTAyLTAzICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLSAgICAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLQotICAgIC8qIGRpcmVjdGlvbjogdGltZQotICAgICAgIHJhdyB0YWJsZTogSHVmZkNvZGUyLm0KLSAgICAgICBidWlsdCBieSA6IEZIIDAwLTAyLTA0ICovCi0KLSAgICBleHRlcm4gY29uc3QgQ2hhciBib29rU2JyRW52TGV2ZWwxMVRbNjJdWzJdID0KLSAgICB7Ci0gICAgICAgIHsgLTY0LCAgIDEgfSwgICAgeyAtNjUsICAgMiB9LCAgICB7IC02MywgICAzIH0sICAgIHsgLTY2LCAgIDQgfSwKLSAgICAgICAgeyAtNjIsICAgNSB9LCAgICB7IC02NywgICA2IH0sICAgIHsgLTYxLCAgIDcgfSwgICAgeyAtNjgsICAgOCB9LAotICAgICAgICB7IC02MCwgICA5IH0sICAgIHsgIDEwLCAgMTEgfSwgICAgeyAtNjksIC01OSB9LCAgICB7ICAxMiwgIDE0IH0sCi0gICAgICAgIHsgLTcwLCAgMTMgfSwgICAgeyAtNzEsIC01OCB9LCAgICB7ICAxNSwgIDE4IH0sICAgIHsgIDE2LCAgMTcgfSwKLSAgICAgICAgeyAtNzIsI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CAtNDggfSwgICAgeyAtNDcsICAzOCB9LCAgICB7IC04NiwgLTg1IH0sICAgIHsgIDQwLCAgNDcgfSwKLSAgICAgICAgeyAgNDEsICA0NCB9LCAgICB7ICA0MiwgIDQzIH0sICAgIHsgLTgwLCAtNDQgfSwgICAgeyAtNDMsIC00MiB9LAotICAgICAgICB7ICA0NSwgIDQ2IH0sICAgIHsgLTM5LCAtODcgfSwgICAgeyAtODQsIC00MCB9LCAgICB7ICA0OCwgIDU1IH0sCi0gICAgICAgIHsgIDQ5LCAgNTIgfSwgICAgeyAgNTAsICA1MSB9LCAgICB7IC05NSwgLTk0IH0sICAgIHsgLTkzLCAtOTIgfSwKLSAgICAgICAgeyAgNTMsICA1NCB9LCAgICB7IC05MSwgLTkwIH0sICAgIHsgLTg5LCAtODEgfSwgICAgeyAgNTYsICA1OSB9LAotICAgICAgICB7ICA1NywgIDU4IH0sICAgIHsgLTQ1LCAtNDEgfSwgICAgeyAtMzgsIC0zNyB9LCAgICB7ICA2MCwgIDYxIH0sCi0gICAgICAgIHsgLTM2LCAtMzUgfSwgICAgeyAtMzQsIC0zMyB9Ci0gICAgfTsKLQotICAgIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotICAgIC8qIHRhYmxlICAgICAgIDogZW52ZWxvcGUgYmFsYW5jZSwgMy4wIGRCICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotICAgIC8qIHRoZW9yIHJhbmdlIDogWy0yNCwyNF0sIENPREVfQk9PS19TQ0ZfTEFWID0gMjQgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotICAgIC8qIGltcGxlbSByYW5nZTogc2FtZSBidXQgbWFwcGVkIHRvIFstMTIsMTJdLCBDT0RFX0JPT0tfU0NGX0xBVl9CQUxBTkNFMTEgPSAxMiAqLwotICAgIC8qIHJhdyBzdGF0cyAgIDogZW52ZWxvcGVCYWxhbmNlXzExICBLSyAwMC0wMi0wMyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotICAgIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotCi0gICAgLyogZGlyZWN0aW9uOiB0aW1lCi0gICAgICAgcmF3IHRhYmxlOiBIdWZmQ29kZTNDLm0vZW52ZWxvcGVCYWxhbmNlXzExVC5tYXQvdl9oQUxCCi0gICAgICAgYnVpbHQgYnkgOiBGSCAwMS0wNS0xNSAqLwotCi0gICAgZXh0ZXJuIGNvbnN0IENoYXIgYm9va1NickVudkJhbGFuY2UxMVRbMjRdWzJdID0KLSAgICB7Ci0gICAgICAgIHsgLTY0LCAgIDEgfSwgICAgeyAtNjMsICAgMiB9LCAgICB7IC02NSwgICAzIH0sICAgIHsgLTY2LCAgIDQgfSwKLSAgICAgICAgeyAtNjIsICAgNSB9LCAgICB7IC02MSwgICA2IH0sICAgIHsgLTY3LCAgIDcgfSwgICAgeyAtNjgsICAgOCB9LAotICAgICAgICB7IC02MCwgICA5IH0sICAgIHsgIDEwLCAgMTYgfSwgICAgeyAgMTEsICAxMyB9LCAgICB7IC02OSwgIDEyIH0sCi0gICAgICAgIHsgLTc2LCAtNzUgfSwgICAgeyAgMTQsICAxNSB9LCAgICB7IC03NCwgLTczIH0sICAgIHsgLTcyLCAtNzEgfSwKLSAgICAgICAgeyAgMTcsICAyMCB9LCAgICB7ICAxOCwgIDE5IH0sICAgIHsgLTcwLCAtNTkgfSwgICAgeyAtNTgsIC01NyB9LAotICAgICAgICB7ICAyMSwgIDIyIH0sICAgIHsgLTU2LCAtNTUgfSwgICAgeyAtNTQsICAyMyB9LCAgICB7IC01MywgLTUyIH0KLSAgICB9OwotCi0gICAgLyogZGlyZWN0aW9uOiB0aW1lICg/KQotICAgICAgIHJhdyB0YWJsZTogSHVmZkNvZGUzQy5tL2VudmVsb3BlQmFsYW5jZV8xMVQubWF0L3ZfaEFMQgotICAgICAgIGJ1aWx0IGJ5IDogRkggMDEtMDUtMTUgKi8KLQotICAgIGV4dGVybiBjb25zdCBDaGFyIGJvb2tTYnJFbnZCYWxhbmNlMTFGWzI0XVsyXSA9Ci0gICAgewotICAgICAgICB7IC02NCwgICAxIH0sICAgIHsgLTY1LCAgIDIgfSwgICAgeyAtNjMsICAgMyB9LCAgICB7IC02NiwgICA0IH0sCi0gICAgICAgIHsgLTYyLCAgIDUgfSwgICAgeyAtNjEsICAgNiB9LCAgICB7IC02NywgICA3IH0sICAgIHsgLTY4LCAgIDggfSwKLSAgICAgICAgeyAtNjAsICAgOSB9LCAgICB7ICAxMCwgIDEzIH0sICAgIHsgLTY5LCAgMTEgfSwgICAgeyAtNTksICAxMiB9LAotICAgICAgICB7IC01OCwgLTc2IH0sICAgIHsgIDE0LCAgMTcgfSwgICAgeyAgMTUsICAxNiB9LCAgICB7IC03NSwgLTc0IH0sCi0gICAgICAgIHsgLTczLCAtNzIgfSwgICAgeyAgMTgsICAyMSB9LCAgICB7ICAxOSwgIDIwIH0sICAgIHsgLTcxLCAtNzAgfSwKLSAgICAgICAgeyAtNTcsIC01NiB9LCAgICB7ICAyMiwgIDIzIH0sICAgIHsgLTU1LCAtNTQgfSwgICAgeyAtNTMsIC01MiB9Ci0gICAgfTsKLQotICAgIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotICAgIC8qIHRhYmxlICAgICAgIDogbm9pc2UgbGV2ZWwsIDMuMCBkQiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotICAgIC8qIHRoZW9yIHJhbmdlIDogWy0yOSwyOV0sIENPREVfQk9PS19TQ0ZfTEFWICAgPSAyOSAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotICAgIC8qIGltcGxlbSByYW5nZTogWy0zMSwzMV0sIENPREVfQk9PS19TQ0ZfTEFWMTEgPSAzMSAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotICAgIC8qIHJhdyBzdGF0cyAgIDogbm9pc2VMZXZlbF8xMSAgS0sgMDAtMDItMDMgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotICAgIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotCi0gICAgLyogZGlyZWN0aW9uOiB0aW1lCi0gICAgICAgcmF3IHRhYmxlOiBIdWZmQ29kZTIubQotICAgICAgIGJ1aWx0IGJ5IDogRkggMDAtMDItMDQgKi8KLQotICAgIGV4dGVybiBjb25zdCBDaGFyIGJvb2tTYnJOb2lzZUxldmVsMTFUWzYyXVsyXSA9Ci0gICAgewotICAgICAgICB7IC02NCwgICAxIH0sICAgIHsgLTYzLCAgIDIgfSwgICAgeyAtNjUsICAgMyB9LCAgICB7IC02NiwgICA0IH0sCi0gICAgICAgIHsgLTYyLCAgIDUgfSwgICAgeyAtNjcsICAgNiB9LCAgICB7ICAgNywgICA4IH0sICAgIHsgLTYxLCAtNjggfSwKLSAgICAgICAgeyAgIDksICAzMCB9LCAgICB7ICAxMCwgIDE1IH0sICAgIHsgLTYwLCAgMTEgfSwgICAgeyAtNjksICAxMiB9LAotICAgICAgICB7ICAxMywgIDE0IH0sICAgIHsgLTU5LCAtNTMgfSwgICAgeyAtOTUsIC05NCB9LCAgICB7ICAxNiwgIDIzIH0sCi0gICAgICAgIHsgIDE3LCAgMjAgfSwgICAgeyAgMTgsICAxOSB9LCAgICB7IC05MywgLTkyIH0sICAgIHsgLTkxLCAtOTAgfSwKLSAgICAgICAgeyAgMjEsICAyMiB9LCAgICB7IC04OSwgLTg4IH0sICAgIHsgLTg3LCAtODYgfSwgICAgeyAgMjQsICAyNyB9LAotICAgICAgICB7ICAyNSwgIDI2IH0sICAgIHsgLTg1LCAtODQgfSwgICAgeyAtODMsIC04MiB9LCAgICB7ICAyOCwgIDI5IH0sCi0gICAgICAgIHsgLTgxLCAtODAgfSwgICAgeyAtNzksIC03OCB9LCAgICB7ICAzMSwgIDQ2IH0sICAgIHsgIDMyLCAgMzkgfSwKLSAgICAgICAgeyAgMzMsICAzNiB9LCAgICB7ICAzNCwgIDM1IH0sICAgIHsgLTc3LCAtNzYgfSwgICAgeyAtNzUsIC03NCB9LAotICAgICAgICB7ICAzNywgIDM4IH0sICAgIHsgLTczLCAtNzIgfSwgICAgeyAtNzEsIC03MCB9LCAgICB7ICA0MCwgIDQzIH0sCi0gICAgICAgIHsgIDQxLCAgNDIgfSwgICAgeyAtNTgsIC01NyB9LCAgICB7IC01NiwgLTU1IH0sICAgIHsgIDQ0LCAgNDUgfSwKLSAgICAgICAgeyAtNTQsIC01MiB9LCAgICB7IC01MSwgLTUwIH0sICAgIHsgIDQ3LCAgNTQgfSwgICAgeyAgNDgsICA1MSB9LAotICAgICAgICB7ICA0OSwgIDUwIH0sICAgIHsgLTQ5LCAtNDggfSwgICAgeyAtNDcsIC00NiB9LCAgICB7ICA1MiwgIDUzIH0sCi0gICAgICAgIHsgLTQ1LCAtNDQgfSwgICAgeyAtNDMsIC00MiB9LCAgICB7ICA1NSwgIDU4IH0sICAgIHsgIDU2LCAgNTcgfSwKLSAgICAgICAgeyAtNDEsIC00MCB9LCAgICB7IC0zOSwgLTM4IH0sICAgIHsgIDU5LCAgNjAgfSwgICAgeyAtMzcsIC0zNiB9LAotICAgICAgICB7IC0zNSwgIDYxIH0sICAgIHsgLTM0LCAtMzMgfQotICAgIH07Ci0KLSAgICAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLSAgICAvKiB0YWJsZSAgICAgICA6IG5vaXNlIGJhbGFuY2UsIDMuMCBkQiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLSAgICAvKiB0aGVvciByYW5nZSA6IFstMjQsMjRdLCBDT0RFX0JPT0tfU0NGX0xBViA9IDI0ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLSAgICAvKiBpbXBsZW0gcmFuZ2U6IHNhbWUgYnV0IG1hcHBlZCB0byBbLTEyLDEyXSwgQ09ERV9CT09LX1NDRl9MQVZfQkFMQU5DRTExID0gMTIgKi8KLSAgICAvKiByYXcgc3RhdHMgICA6IG5vaXNlQmFsYW5jZV8xMSAgS0sgMDAtMDItMDMgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLSAgICAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLQotICAgIC8qIGRpcmVjdGlvbjogdGltZQotICAgICAgIHJhdyB0YWJsZTogSHVmZkNvZGUzQy5tL25vaXNlQmFsYW5jZV8xMS5tYXQvdl9oQUxCCi0gICAgICAgYnVpbHQgYnkgOiBGSCAwMS0wNS0xNSAqLwotCi0gICAgZXh0ZXJuIGNvbnN0IENoYXIgYm9va1Nick5vaXNlQmFsYW5jZTExVFsyNF1bMl0gPQotICAgIHsKLSAgICAgICAgeyAtNjQsICAgMSB9LCAgICB7IC02NSwgICAyIH0sICAgIHsgLTYzLCAgIDMgfSwgICAgeyAgIDQsICAgOSB9LAotICAgICAgICB7IC02NiwgICA1IH0sICAgIHsgLTYyLCAgIDYgfSwgICAgeyAgIDcsICAgOCB9LCAgICB7IC03NiwgLTc1IH0sCi0gICAgICAgIHsgLTc0LCAtNzMgfSwgICAgeyAgMTAsICAxNyB9LCAgICB7ICAxMSwgIDE0IH0sICAgIHsgIDEyLCAgMTMgfSwKLSAgICAgICAgeyAtNzIsIC03MSB9LCAgICB7IC03MCwgLTY5IH0sICAgIHsgIDE1LCAgMTYgfSwgICAgeyAtNjgsIC02NyB9LAotICAgICAgICB7IC02MSwgLTYwIH0sICAgIHsgIDE4LCAgMjEg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PICAgICAgICAgICAgICAgICAgICAgICAgICAwCi0jZGVmaW5lIEhJICAgICAgICAgICAgICAgICAgICAgICAgICAxCi0KLSNkZWZpbmUgVElNRSAgICAgICAgICAgICAgICAgICAgICAgIDEKLSNkZWZpbmUgRlJFUSAgICAgICAgICAgICAgICAgICAgICAgIDAKLQotI2RlZmluZSBMRU5HVEhfRlJBTUVfSU5GTyAgICAgICAgICAgMzUKLQotI2RlZmluZSBTSV9TQlJfQ1JDX0JJVFMgICAgICAgICAgICAgMTAKLQotI2RlZmluZSBTQlJfRlJFUV9TQ0FMRV9ERUZBVUxUICAgICAgMgotI2RlZmluZSBTQlJfQUxURVJfU0NBTEVfREVGQVVMVCAgICAgMQotI2RlZmluZSBTQlJfTk9JU0VfQkFORFNfREVGQVVMVCAgICAgMgotCi0jZGVmaW5lIFNCUl9MSU1JVEVSX0JBTkRTX0RFRkFVTFQgICAgICAyCi0jZGVmaW5lIFNCUl9MSU1JVEVSX0dBSU5TX0RFRkFVTFQgICAgICAyCi0jZGVmaW5lIFNCUl9JTlRFUlBPTF9GUkVRX0RFRkFVTFQgICAgICAxCi0jZGVmaW5lIFNCUl9TTU9PVEhJTkdfTEVOR1RIX0RFRkFVTFQgICAxCi0KLS8qIGhlYWRlciAqLwotI2RlZmluZSBTSV9TQlJfQU1QX1JFU19CSVRTICAgICAgICAgICAgMQotI2RlZmluZSBTSV9TQlJfU1RBUlRfRlJFUV9CSVRTICAgICAgICAgNAotI2RlZmluZSBTSV9TQlJfU1RPUF9GUkVRX0JJVFMgICAgICAgICAgNAotI2RlZmluZSBTSV9TQlJfWE9WRVJfQkFORF9CSVRTICAgICAgICAgMwotI2RlZmluZSBTSV9TQlJfUkVTRVJWRURfQklUU19IRFIgICAgICAgMgotI2RlZmluZSBTSV9TQlJfREFUQV9FWFRSQV9CSVRTICAgICAgICAgMQotI2RlZmluZSBTSV9TQlJfSEVBREVSX0VYVFJBXzFfQklUUyAgICAgMQotI2RlZmluZSBTSV9TQlJfSEV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0YXZlW2ldKTsKLSAgICAgICAgICAgIGlmICh0bXBfcTEgPCBRX2ZtdCgwLjQ5KSkKLSAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICBpZiAod29ya0xpbWl0ZXJCYW5kVGFibGVbal0gPT0gd29ya0xpbWl0ZXJCYW5kVGFibGVbai0xXSkKLSAgICAgICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgICAgIHdvcmtMaW1pdGVyQmFuZFRhYmxlW2pdID0gaGlnaFN1YmJhbmQ7Ci0gICAgICAgICAgICAgICAgICAgIHNoZWxsc29ydCh3b3JrTGltaXRlckJhbmRUYWJsZSwgZ2F0ZU1vZGVbaV0gKyAxKTsKLSAgICAgICAgICAgICAgICAgICAgZ2F0ZU1vZGVbaV0tLTsKLSAgICAgICAgICAgICAgICAgICAgai0tOwotICAgICAgICAgICAgICAgICAgICBjb250aW51ZTsKLSAgICAgICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgICAgICBpc1BhdGNoQm9yZGVyWzBdID0gaXNQYXRjaEJvcmRlclsxXSA9IDA7Ci0KLSAgICAgICAgICAgICAgICBmb3IgKGsgPSAwOyBrIDw9IG5vUGF0Y2hlczsgaysrKQotICAgICAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAgICAgaWYgKHdvcmtMaW1pdGVyQmFuZFRhYmxlW2otMV0gPT0gcGF0Y2hCb3JkZXJzW2tdKQotICAgICAgICAgICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgICAgICAgICBpc1BhdGNoQm9yZGVyWzBdID0gMTsKLSAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOwotICAgICAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgfQotCi0gICAgICAgICAgICAgICAgZm9yIChrID0gMDsgayA8PSBub1BhdGNoZXM7IGsrKykKLSAgICAgICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgICAgIGlmICh3b3JrTGltaXRlckJhbmRUYWJsZVtqXSA9PSBwYXRjaEJvcmRlcnNba10pCi0gICAgICAgICAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAgICAgICAgIGlzUGF0Y2hCb3JkZXJbMV0gPSAxOwotICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7Ci0gICAgICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgICAgICBpZiAoIWlzUGF0Y2hCb3JkZXJbMV0pCi0gICAgICAgICAgICAgICAgewotICAgICAgICAgICAgICAgICAgICB3b3JrTGltaXRlckJhbmRUYWJsZVtqXSA9IGhpZ2hTdWJiYW5kOwotICAgICAgICAgICAgICAgICAgICBzaGVsbHNvcnQod29ya0xpbWl0ZXJCYW5kVGFibGUsIGdhdGVNb2RlW2ldICsgMSk7Ci0gICAgICAgICAgICAgICAgICAgIGdhdGVNb2RlW2ldLS07Ci0gICAgICAgICAgICAgICAgICAgIGotLTsKLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgZWxzZSBpZiAoIWlzUGF0Y2hCb3JkZXJbMF0pCi0gICAgICAgICAgICAgICAgewotICAgICAgICAgICAgICAgICAgICB3b3JrTGltaXRlckJhbmRUYWJsZVtqLTFdID0gaGlnaFN1YmJhbmQ7Ci0gICAgICAgICAgICAgICAgICAgIHNoZWxsc29ydCh3b3JrTGltaXRlckJhbmRUYWJsZSwgZ2F0ZU1vZGVbaV0gKyAxKTsKLSAgICAgICAgICAgICAgICAgICAgZ2F0ZU1vZGVbaV0tLTsKLSAgICAgICAgICAgICAgICAgICAgai0tOwotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgIH0KLSAgICAgICAgfQotICAgICAgICBmb3IgKGsgPSAwOyBrIDw9IGdhdGVNb2RlW2ldOyBrKyspCi0gICAgICAgIHsKLSAgICAgICAgICAgIGxpbVNiY1tpXVtrXSA9IHdvcmtMaW1pdGVyQmFuZFRhYmxlW2tdOwotICAgICAgICB9Ci0gICAgfQotfQotCi0KLQotI2VuZ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KlNCUl9OVU1fQkFORFMqc2l6ZW9mKCpoRnJhbWVEYXRhLT5zYnJRbWZCdWZmZXJJbWFnKSk7Ci0gICAgfQotI2VuZGlmCi0gICAgLyogLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0gKi8KLQotCi0gICAgLyoKLSAgICAgKiAgICBsb3cgYmFuZCBjb2RlYyBzaWduYWwgc3ViYmFuZCBmaWx0ZXJpbmcKLSAgICAgKi8KLQotICAgIGZvciAoaSA9IDA7IGkgPCAzMjsgaSsrKQotICAgIHsKLQotICAgICAgICBpZiAoc2JyRGVjLT5MQ19hYWNQX0RlY29kZXJGbGFnID09IE9OKQotICAgICAgICB7Ci0KLSAgICAgICAgICAgIGNhbGNfc2JyX2FuYWZpbHRlcmJhbmtfTEMoaEZyYW1lRGF0YS0+Y29kZWNRbWZCdWZmZXJSZWFsW3NickRlYy0+YnVmV3JpdGVPZmZzICsgaV0sCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICZpblBjbURhdGFbMzE5XSArIChpIDw8IDUpLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzY3JhdGNoX21lbSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbnVtX3FtZl9iYW5kcyk7Ci0KLSAgICAgICAgfQotI2lmZGVmIEhRX1NCUgotICAgICAgICBlbHNlCi0gICAgICAgIHsKLQotICAgICAgICAgICAgY2FsY19zYnJfYW5hZmlsdGVyYmFuayhoRnJhbWVEYXRhLT5jb2RlY1FtZkJ1ZmZlclJlYWxbc2JyRGVjLT5idWZXcml0ZU9mZnMgKyBpXSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaEZyYW1lRGF0YS0+Y29kZWNRbWZCdWZmZXJJbWFnW3NickRlYy0+YnVmV3JpdGVPZmZzICsgaV0sCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICZpblBjbURhdGFbMzE5XSArIChpIDw8IDUpLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzY3JhdGNoX21lbSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbnVtX3FtZl9iYW5kcyk7Ci0gICAgICAgIH0KLSNlbmRpZgotCi0gICAgfQotCi0gICAgaWYgKHBWYXJzLT5sdHBfYnVmZmVyX3N0YXRlKQotICAgIHsKLSAgICAgICAgcHZfbWVtY3B5KCZpblBjbURhdGFbLTEwMjQtMjg4XSwgJmluUGNtRGF0YVsxMDI0XSwgMjg4KnNpemVvZigqaW5QY21EYXRhKSk7Ci0gICAgfQotICAgIGVsc2UKLSAgICB7Ci0gICAgICAgIHB2X21lbWNweSgmaW5QY21EYXRhWzEwMjQgKyAyODhdLCAmaW5QY21EYXRhWzEwMjRdLCAyODgqc2l6ZW9mKCppblBjbURhdGEpKTsKLSAgICB9Ci0KLQotICAgIGlmIChhcHBseVByb2Nlc3NpbmcpCi0gICAgewotCi0gICAgICAgIC8qCi0gICAgICAgICAqICBJbnZlcnNlIGZpbHRlcmluZyBvZiBsb3diYW5kICsgSEYgZ2VuZXJhdGlvbgotICAgICAgICAgKi8KLQotICAgICAgICBpZiAoc2JyRGVjLT5MQ19hYWNQX0RlY29kZXJGbGFnID09IE9OKQotICAgICAgICB7Ci0KLSAgICAgICAgICAgIHNicl9nZW5lcmF0ZV9oaWdoX2ZyZXEoKGludDMyX3QoKilbMzJdKShoRnJhbWVEYXRhLT5jb2RlY1FtZkJ1ZmZlclJlYWwgKyBzYnJEZWMtPmJ1ZlJlYWRPZmZzKSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTlVMTCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKGludDMyX3QgKikoaEZyYW1lRGF0YS0+c2JyUW1mQnVmZmVyUmVhbCksCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIE5VTEwsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGhGcmFtZURhdGEtPnNicl9pbnZmX21vZGUsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGhGcmFtZURhdGEtPnNicl9pbnZmX21vZGVfcHJldiwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJihzYnJEZWMtPkZyZXFCYW5kVGFibGVOb2lzZVsxXSksCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNickRlYy0+Tm9Ob2lzZUJhbmRzLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzYnJEZWMtPmxvd1N1YmJhbmQsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNickRlYy0+Vl9rX21hc3RlciwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2JyRGVjLT5OdW1fTWFzdGVyLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzYnJEZWMtPm91dFNhbXBsZVJhdGUsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZyYW1lSW5mbywKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaEZyYW1lRGF0YS0+ZGVncmVlQWxpYXMsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNjcmF0Y2hfbWVtLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBoRnJhbWVEYXRhLT5Cd1ZlY3RvciwvKiAqLwotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBoRnJhbWVEYXRhLT5Cd1ZlY3Rvck9sZCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJihzYnJEZWMtPlBhdGNoKSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2JyRGVjLT5MQ19hYWNQX0RlY29kZXJGbGFnLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmKHNickRlYy0+aGlnaFN1YmJhbmQpKTsKLQotCi0gICAgICAgICAgICAvKgotICAgICAgICAgICAgICogICAgICBBZGp1c3QgZW52ZWxvcGUgb2YgY3VycmVudCBmcmFtZS4KLSAgICAgICAgICAgICAqLwotCi0gICAgICAgICAgICBjYWxjX3Nicl9lbnZlbG9wZShoRnJhbWVEYXRhLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKGludDMyX3QgKikoaEZyYW1lRGF0YS0+c2JyUW1mQnVmZmVyUmVhbCksCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICBOVUxMLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2JyRGVjLT5GcmVxQmFuZFRhYmxlLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2JyRGVjLT5OU2ZiLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2JyRGVjLT5GcmVxQmFuZFRhYmxlTm9pc2UsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzYnJEZWMtPk5vTm9pc2VCYW5kcywKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGhGcmFtZURhdGEtPnJlc2V0X2ZsYWcsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICBoRnJhbWVEYXRhLT5kZWdyZWVBbGlhcywKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICYoaEZyYW1lRGF0YS0+aGFybV9pbmRleCksCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmKGhGcmFtZURhdGEtPnBoYXNlX2luZGV4KSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGhGcmFtZURhdGEtPmhGcCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICYoaEZyYW1lRGF0YS0+c1VwKSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNickRlYy0+bGltU2JjLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2JyRGVjLT5nYXRlTW9kZSwKLSNpZmRlZiBIUV9TQlIKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIE5VTEwsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICBOVUxMLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTlVMTCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIE5VTEwsCi0jZW5kaWYKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNjcmF0Y2hfbWVtLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2JyRGVjLT5QYXRjaCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNickRlYy0+c3FydF9jYWNoZSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNickRlYy0+TENfYWFjUF9EZWNvZGVyRmxhZyk7Ci0gICAgICAgIH0KLSNpZmRlZiBIUV9TQlIKLSAgICAgICAgZWxzZQotICAgICAgICB7Ci0KLSAgICAgICAgICAgIHNicl9nZW5lcmF0ZV9oaWdoX2ZyZXEoKGludDMyX3QoKilbMzJdKShoRnJhbWVEYXRhLT5jb2RlY1FtZkJ1ZmZlclJlYWwgKyBzYnJEZWMtPmJ1ZlJlYWRPZmZzKSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKGludDMyX3QoKilbMzJdKShoRnJhbWVEYXRhLT5jb2RlY1FtZkJ1ZmZlckltYWcgKyBzYnJEZWMtPmJ1ZlJlYWRPZmZzKSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKGludDMyX3QgKikoaEZyYW1lRGF0YS0+c2JyUW1mQnVmZmVyUmVhbCksCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChpbnQzMl90ICopKGhGcmFtZURhdGEtPnNiclFtZkJ1ZmZlckltYWcpLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBoRnJhbWVEYXRhLT5zYnJfaW52Zl9tb2RlLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBoRnJhbWVEYXRhLT5zYnJfaW52Zl9tb2RlX3ByZXYsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICYoc2JyRGVjLT5GcmVxQmFuZFRhYmxlTm9pc2VbMV0pLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzYnJEZWMtPk5vTm9pc2VCYW5kcywKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2JyRGVjLT5sb3dTdWJiYW5kLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzYnJEZWMtPlZfa19tYXN0ZXIsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNickRlYy0+TnVtX01hc3RlciwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2JyRGVjLT5vdXRTYW1wbGVSYXRlLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBmcmFtZUluZm8sCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIE5VTEwsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNjcmF0Y2hfbWVtLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBoRnJhbWVEYXRhLT5Cd1ZlY3RvciwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaEZyYW1lRGF0YS0+QndWZWN0b3JPbGQsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICYoc2JyRGVjLT5QYXRjaCksCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNickRlYy0+TENfYWFjUF9EZWNvZGVyRmxhZywKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJihzYnJEZWMtPmhpZ2hTdWJiYW5kKSk7Ci0KLSAgICAgICAgICAgIC8qCi0gICAgICAgICAgICAgKiAgICAgIEFkanVzdCBlbnZlbG9wZSBvZiBjdXJyZW50IGZyYW1lLgotICAgICAgICAgICAgICovCi0KLSAgICAgICAgICAgIGNhbGNfc2JyX2VudmVsb3BlKGhGcmFtZURhdGEsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoaW50MzJfdCAqKShoRnJhbWVEYXRhLT5zYnJRbWZCdWZmZXJSZWFsKSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChpbnQzMl90ICopKGhGcmFtZURhdGEtPnNiclFtZkJ1ZmZlckltYWcpLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2JyRGVjLT5GcmVxQmFuZFRhYmxlLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2JyRGVjLT5OU2ZiLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2JyRGVjLT5GcmVxQmFuZFRhYmxlTm9pc2UsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzYnJEZWMtPk5vTm9pc2VCYW5kcywKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGhGcmFtZURhdGEtPnJlc2V0X2ZsYWcsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICBOVUxMLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJihoRnJhbWVEYXRhLT5oYXJtX2luZGV4KSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICYoaEZyYW1lRGF0YS0+cGhhc2VfaW5kZXgpLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaEZyYW1lRGF0YS0+aEZwLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJihoRnJhbWVEYXRhLT5zVXApLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2JyRGVjLT5saW1TYmMsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzYnJEZWMtPmdhdGVNb2RlLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaEZyYW1lRGF0YS0+ZkJ1Zl9tYW4sCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICBoRnJhbWVEYXRhLT5mQnVmX2V4cCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGhGcmFtZURhdGEtPmZCdWZOX21hbiwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGhGcmFtZURhdGEtPmZCdWZOX2V4cCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNjcmF0Y2hfbWVtLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2JyRGVjLT5QYXRjaCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNickRlYy0+c3FydF9jYWNoZSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNickRlYy0+TENfYWFjUF9EZWNvZGVyRmxhZyk7Ci0KLSAgICAgICAgfQotI2VuZGlmCi0KLQotICAgIH0KLSAgICBlbHNlICAgLyogIGVsc2UgZm9yIGFwcGx5UHJvY2Vzc2luZyAqLwotICAgIHsKLSAgICAgICAgLyogbm8gc2JyLCBzZXQgaGlnaCBiYW5kIGJ1ZmZlcnMgdG8gemVybyAqLwotCi0gICAgICAgIGZvciAoaSA9IDA7IGkgPCBTQlJfTlVNX0NPTFVNTlM7IGkrKykKLSAgICAgICAgewotICAgICAgICAgICAgcHZfbWVtc2V0KCh2b2lkICopJmhGcmFtZURhdGEtPnNiclFtZkJ1ZmZlclJlYWxbaSpTQlJfTlVNX0JBTkRTXSwKLSAgICAgICAgICAgICAgICAgICAgICAwLAotICAgICAgICAgICAgICAgICAgICAgIFNCUl9OVU1fQkFORFMqc2l6ZW9mKCpoRnJhbWVEYXRhLT5zYnJRbWZCdWZmZXJSZWFsKSk7Ci0KLSNpZmRlZiBIUV9TQlIKLSAgICAgICAgICAgIHB2X21lbXNldCgodm9pZCAqKSZoRnJhbWVEYXRhLT5zYnJRbWZCdWZmZXJJbWFnW2kqU0JSX05VTV9CQU5EU10sCi0gICAgICAgICAgICAgICAgICAgICAgMCwKLSAgICAgICAgICAgICAgICAgICAgICBTQ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FdOwotICAgICAgICAvKgotICAgICAgICAgKiAgZGVyZWZlcmVuY2luZyB0eXBlLXB1bm5lZCBwb2ludGVyIGF2b2lkCi0gICAgICAgICAqICBicmVha2luZyBzdHJpY3QtYWxpYXNpbmcgcnVsZXMKLSAgICAgICAgICovCi0gICAgICAgIGludDMyX3QgKnRtcCA9IChpbnQzMl90ICopdG1weDsKLSAgICAgICAgaFBhcmFtZXRyaWNTdGVyZW9EZWMtPnFtZkJ1ZmZlclJlYWwgPSAoaW50MzJfdCgqKVs2NF0pIHRtcDsKLQotICAgICAgICB0bXAgPSAoaW50MzJfdCAqKSAmIGhQYXJhbWV0cmljU3RlcmVvRGVjLT5xbWZCdWZmZXJSZWFsWzM4XVswXTsKLSAgICAgICAgaFBhcmFtZXRyaWNTdGVyZW9EZWMtPnFtZkJ1ZmZlckltYWcgPSAoaW50MzJfdCgqKVs2NF0pIHRtcDsKLQotICAgICAgICBmb3IgKGkgPSAwOyBpIDwgMzI7IGkrKykKLSAgICAgICAgewotICAgICAgICAgICAgSW50ICAgeG92ZXJCYW5kOwotCi0gICAgICAgICAgICBpZiAoaSA8ICgoaEZyYW1lRGF0YS0+ZnJhbWVJbmZvWzFdKSA8PCAxKSkKLSAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICB4b3ZlckJhbmQgPSBzYnJEZWMtPnByZXZMb3dTdWJiYW5kOwotICAgICAgICAgICAgfQotICAgICAgICAgICAgZWxzZQotICAgICAgICAgICAgewotICAgICAgICAgICAgICAgIHhvdmVyQmFuZCA9IHNickRlYy0+bG93U3ViYmFuZDsKLSAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgaWYgKHhvdmVyQmFuZCA+IHNickRlYy0+aGlnaFN1YmJhbmQpCi0gICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgLyoKLSAgICAgICAgICAgICAgICAgKiBlcnJvciBjb25kaXRpb24sIGRlZmF1bHQgdG8gdXBzYW1wbGluZyBtb2RlCi0gICAgICAgICAgICAgICAgICogYW5kIG1ha2Ugc3VyZSB0aGF0IHRoZSBudW1iZXIgb2YgYmFuZHMgZm9yIHhvdmVyIGRvZXMKLSAgICAgICAgICAgICAgICAgKiBub3QgZXhjZWVkIHRoZSBudW1iZXIgb2YgaGlnaCBmcmVxIGJhbmRzLgotICAgICAgICAgICAgICAgICAqLwotICAgICAgICAgICAgICAgIHhvdmVyQmFuZCA9IChzYnJEZWMtPmhpZ2hTdWJiYW5kID4gMzIpPyAzMjogc2JyRGVjLT5oaWdoU3ViYmFuZDsKLSAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgbSA9IHNickRlYy0+YnVmUmVhZE9mZnMgKyBpOyAgICAvKiAgMiArIGkgKi8KLQotICAgICAgICAgICAgU3JfeCA9IGhQYXJhbWV0cmljU3RlcmVvRGVjLT5xbWZCdWZmZXJSZWFsW2ldOwotICAgICAgICAgICAgU2lfeCA9IGhQYXJhbWV0cmljU3RlcmVvRGVjLT5xbWZCdWZmZXJJbWFnW2ldOwotCi0KLQotICAgICAgICAgICAgZm9yIChpbnQzMl90IGogPSAwOyBqIDwgeG92ZXJCYW5kOyBqKyspCi0gICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgU3JfeFtqXSA9IHNoZnRfbGZ0XzEoaEZyYW1lRGF0YS0+Y29kZWNRbWZCdWZmZXJSZWFsW21dW2pdKTsKLSAgICAgICAgICAgICAgICBTaV94W2pdID0gc2hmdF9sZnRfMShoRnJhbWVEYXRhLT5jb2RlY1FtZkJ1ZmZlckltYWdbbV1bal0pOwotICAgICAgICAgICAgfQotCi0KLQotCi0gICAgICAgICAgICBwdl9tZW1jcHkoJlNyX3hbeG92ZXJCYW5kXSwKLSAgICAgICAgICAgICAgICAgICAgICAmaEZyYW1lRGF0YS0+c2JyUW1mQnVmZmVyUmVhbFtpKlNCUl9OVU1fQkFORFNdLAotICAgICAgICAgICAgICAgICAgICAgIChzYnJEZWMtPmhpZ2hTdWJiYW5kIC0geG92ZXJCYW5kKSpzaXplb2YoKlNyX3gpKTsKLQotICAgICAgICAgICAgcHZfbWVtY3B5KCZTaV94W3hvdmVyQmFuZF0sCi0gICAgICAgICAgICAgICAgICAgICAgJmhGcmFtZURhdGEtPnNiclFtZkJ1ZmZlckltYWdbaSpTQlJfTlVNX0JBTkRTXSwKLSAgICAgICAgICAgICAgICAgICAgICAoc2JyRGVjLT5oaWdoU3ViYmFuZCAtIHhvdmVyQmFuZCkqc2l6ZW9mKCpTaV94KSk7Ci0KLSAgICAgICAgICAgIHB2X21lbXNldCgodm9pZCAqKSZTcl94W3NickRlYy0+aGlnaFN1YmJhbmRdLAotICAgICAgICAgICAgICAgICAgICAgIDAsCi0gICAgICAgICAgICAgICAgICAgICAgKDY0IC0gc2JyRGVjLT5oaWdoU3ViYmFuZCkqc2l6ZW9mKCpTcl94KSk7Ci0KLSAgICAgICAgICAgIHB2X21lbXNldCgodm9pZCAqKSZTaV94W3NickRlYy0+aGlnaFN1YmJhbmRdLAotICAgICAgICAgICAgICAgICAgICAgIDAsCi0gICAgICAgICAgICAgICAgICAgICAgKDY0IC0gc2JyRGVjLT5oaWdoU3ViYmFuZCkqc2l6ZW9mKCpTaV94KSk7Ci0KLQotICAgICAgICB9Ci0KLSAgICAgICAgZm9yIChpID0gMzI7IGkgPCAzMiArIDY7IGkrKykKLSAgICAgICAgewotICAgICAgICAgICAgbSA9IHNickRlYy0+YnVmUmVhZE9mZnMgKyBpOyAgICAgLyogIDIgKyBpICovCi0KLSAgICAgICAgICAgIGZvciAoaW50MzJfdCBqID0gMDsgaiA8IDU7IGorKykKLSAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICBoUGFyYW1ldHJpY1N0ZXJlb0RlYy0+cW1mQnVmZmVyUmVhbFtpXVtqXSA9IHNoZnRfbGZ0XzEoaEZyYW1lRGF0YS0+Y29kZWNRbWZCdWZmZXJSZWFsW21dW2pdKTsKLSAgICAgICAgICAgICAgICBoUGFyYW1ldHJpY1N0ZXJlb0RlYy0+cW1mQnVmZmVySW1hZ1tpXVtqXSA9IHNoZnRfbGZ0XzEoaEZyYW1lRGF0YS0+Y29kZWNRbWZCdWZmZXJJbWFnW21dW2pdKTsKLSAgICAgICAgICAgIH0KLQotICAgICAgICB9Ci0KLQotICAgICAgICAvKgotICAgICAgICAgKiAgICBVcGRhdGUgQnVmZmVycwotICAgICAgICAgKi8KLSAgICAgICAgZm9yIChpID0gMDsgaSA8IHNickRlYy0+YnVmV3JpdGVPZmZzOyBpKyspICAgICAvKiBzYnJEZWMtPmJ1ZldyaXRlT2ZmcyBzZXQgdG8gOCBhbmQgdW5jaGFuZ2VkICovCi0gICAgICAgIHsKLSAgICAgICAgICAgIGogPSBzYnJEZWMtPm5vQ29scyArIGk7ICAgICAgICAgICAgICAgICAgICAvKiBzYnJEZWMtPm5vQ29scyBzZXQgdG8gMzIgYW5kIHVuY2hhbmdlZCAqLwotCi0gICAgICAgICAgICBwdl9tZW1tb3ZlKGhGcmFtZURhdGEtPmNvZGVjUW1mQnVmZmVyUmVhbFtpXSwgICAgICAgICAvKiB0byAgICAqLwotICAgICAgICAgICAgICAgICAgICAgICBoRnJhbWVEYXRhLT5jb2RlY1FtZkJ1ZmZlclJlYWxbal0sICAgICAgICAvKiBmcm9tICAqLwotICAgICAgICAgICAgICAgICAgICAgICBzaXplb2YoKmhGcmFtZURhdGEtPmNvZGVjUW1mQnVmZmVyUmVhbFtpXSkgPDwgNSk7Ci0KLSAgICAgICAgICAgIHB2X21lbW1vdmUoaEZyYW1lRGF0YS0+Y29kZWNRbWZCdWZmZXJJbWFnW2ldLAotICAgICAgICAgICAgICAgICAgICAgICBoRnJhbWVEYXRhLT5jb2RlY1FtZkJ1ZmZlckltYWdbal0sCi0gICAgICAgICAgICAgICAgICAgICAgIHNpemVvZigqaEZyYW1lRGF0YS0+Y29kZWNRbWZCdWZmZXJJbWFnW2ldKSA8PCA1KTsKLSAgICAgICAgfQotCi0KLSAgICAgICAgcHZfbWVtbW92ZSgmaEZyYW1lRGF0YS0+SGlz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mNpcmN1bGFyX2J1ZmZlcl9zWzIwNDhdLAotICAgICAgICAgICAgICAgICAgICAgICBoRnJhbWVEYXRhLT5WLAotICAgICAgICAgICAgICAgICAgICAgICA2NDAqc2l6ZW9mKCpjaXJjdWxhcl9idWZmZXJfcykpOwotICAgICAgICB9Ci0gICAgICAgIGVsc2UKLSAgICAgICAgewotICAgICAgICAgICAgcHZfbWVtbW92ZSgmY2lyY3VsYXJfYnVmZmVyX3NbNDA5Nl0sCi0gICAgICAgICAgICAgICAgICAgICAgIGhGcmFtZURhdGEtPlYsCi0gICAgICAgICAgICAgICAgICAgICAgIDExNTIqc2l6ZW9mKCpjaXJjdWxhcl9idWZmZXJfcykpOwotCi0gICAgICAgIH0KLQotCi0gICAgICAgIC8qCi0gICAgICAgICAqICBTZXQgQ2lyY3VsYXIgYnVmZmVyIGZvciBQUyBoeWJyaWQgYW5hbHlzaXMKLSAgICAgICAgICovCi0KLSAgICAgICAgaW50MzJfdCAqcHRfdGVtcCA9ICZzY3JhdGNoX21lbVsyXVszMl07Ci0KLSAgICAgICAgZm9yIChpID0gMCwgaiA9IDA7IGkgPCAzOyBpKyspCi0gICAgICAgIHsKLQotICAgICAgICAgICAgcHZfbWVtbW92ZSgmcHRfdGVtcFsgal0sCi0gICAgICAgICAgICAgICAgICAgICAgIGhQYXJhbWV0cmljU3RlcmVvRGVjLT5oSHlicmlkLT5tUW1mQnVmZmVyUmVhbFtpXSwKLSAgICAgICAgICAgICAgICAgICAgICAgSFlCUklEX0ZJTFRFUl9MRU5HVEhfbV8xKnNpemVvZigqaFBhcmFtZXRyaWNTdGVyZW9EZWMtPmhIeWJyaWQtPm1RbWZCdWZmZXJSZWFsKSk7Ci0gICAgICAgICAgICBwdl9tZW1tb3ZlKCZwdF90ZW1wWyBqICsgNDRdLAotICAgICAgICAgICAgICAgICAgICAgICBoUGFyYW1ldHJpY1N0ZXJlb0RlYy0+aEh5YnJpZC0+bVFtZkJ1ZmZlckltYWdbaV0sCi0gICAgICAgICAgICAgICAgICAgICAgIEhZQlJJRF9GSUxURVJfTEVOR1RIX21fMSpzaXplb2YoKmhQYXJhbWV0cmljU3RlcmVvRGVjLT5oSHlicmlkLT5tUW1mQnVmZmVySW1hZykpOwotICAgICAgICAgICAgaiArPSA4ODsKLSAgICAgICAgfQotCi0KLSAgICAgICAgcHZfbWVtc2V0KCh2b2lkICopJnFtZl9QU19nZW5lcmF0ZWRfUmVhbFtoUGFyYW1ldHJpY1N0ZXJlb0RlYy0+dXNiXSwKLSAgICAgICAgICAgICAgICAgIDAsCi0gICAgICAgICAgICAgICAgICAoNjQgLSBoUGFyYW1ldHJpY1N0ZXJlb0RlYy0+dXNiKSpzaXplb2YoKnFtZl9QU19nZW5lcmF0ZWRfUmVhbCkpOwotCi0gICAgICAgIHB2X21lbXNldCgodm9pZCAqKSZxbWZfUFNfZ2VuZXJhdGVkX0ltYWdbaFBhcmFtZXRyaWNTdGVyZW9EZWMtPnVzYl0sCi0gICAgICAgICAgICAgICAgICAwLAotICAgICAgICAgICAgICAgICAgKDY0IC0gaFBhcmFtZXRyaWNTdGVyZW9EZWMtPnVzYikqc2l6ZW9mKCpxbWZfUFNfZ2VuZXJhdGVkX0ltYWcpKTsKLQotCi0gICAgICAgIGZvciAoaSA9IDA7IGkgPCAzMjsgaSsrKQotICAgICAgICB7Ci0gICAgICAgICAgICBpZiAoaSA9PSAoSW50KWhQYXJhbWV0cmljU3RlcmVvRGVjLT4gYUVudlN0YXJ0U3RvcFtlbnZdKQotICAgICAgICAgICAgewotICAgICAgICAgICAgICAgIHBzX2luaXRfc3RlcmVvX21peGluZyhoUGFyYW1ldHJpY1N0ZXJlb0RlYywgZW52LCBzYnJEZWMtPmhpZ2hTdWJiYW5kKTsKLSAgICAgICAgICAgICAgICBlbnYrKzsKLSAgICAgICAgICAgIH0KLQotCi0gICAgICAgICAgICBwc19hcHBsaWVkKGhQYXJhbWV0cmljU3RlcmVvRGVjLAotICAgICAgICAgICAgICAgICAgICAgICAmaFBhcmFtZXRyaWNTdGVyZW9EZWMtPnFtZkJ1ZmZlclJlYWxbaV0sCi0gICAgICAgICAgICAgICAgICAgICAgICZoUGFyYW1ldHJpY1N0ZXJlb0RlYy0+cW1mQnVmZmVySW1hZ1tpXSwKLSAgICAgICAgICAgICAgICAgICAgICAgcW1mX1BTX2dlbmVyYXRlZF9SZWFsLAotICAgICAgICAgICAgICAgICAgICAgICBxbWZfUFNfZ2VuZXJhdGVkX0ltYWcsCi0gICAgICAgICAgICAgICAgICAgICAgIHNjcmF0Y2hfbWVtWzJdLAotICAgICAgICAgICAgICAgICAgICAgICBpKTsKLQotICAgICAgICAgICAgLyogQ3JlYXRlIHRpbWUgc2FtcGxlcyBmb3IgcmVndWxhciBtb25vIGNoYW5uZWwgKi8KLQotICAgICAgICAgICAgaWYgKHBWYXJzLT5tY19pbmZvLmJEb3duU2FtcGxlZFNicikKLSAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICBjYWxjX3Nicl9zeW5maWx0ZXJiYW5rKGhQYXJhbWV0cmljU3RlcmVvRGVjLT5xbWZCdWZmZXJSZWFsW2ldLCAgLyogcmVhbFNhbXBsZXMgICovCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBoUGFyYW1ldHJpY1N0ZXJlb0RlYy0+cW1mQnVmZmVySW1hZ1tpXSwgLyogaW1hZ1NhbXBsZXMgICovCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBmdGltZU91dFB0ciArIChpIDw8IDYpLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJmNpcmN1bGFyX2J1ZmZlcl9zWzE5ODQgLSAoaTw8NildLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcFZhcnMtPm1jX2luZm8uYkRvd25TYW1wbGVkU2JyKTsKLSAgICAgICAgICAgIH0KLSAgICAgICAgICAgIGVsc2UKLSAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICBjY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wNDhdLAotICAgICAgICAgICAgICAgICAgICAgICAoaW50MzJfdCAqKWhQYXJhbWV0cmljU3RlcmVvRGVjLT5SX2NoX3FtZl9maWx0ZXJfaGlzdG9yeSwKLSAgICAgICAgICAgICAgICAgICAgICAgNjQwKnNpemVvZigqY2lyY3VsYXJfYnVmZmVyX3MpKTsKLSAgICAgICAgfQotICAgICAgICBlbHNlCi0gICAgICAgIHsKLSAgICAgICAgICAgIHB2X21lbW1vdmUoJmNpcmN1bGFyX2J1ZmZlcl9zWzQwOTZdLAotICAgICAgICAgICAgICAgICAgICAgICAoaW50MzJfdCAqKWhQYXJhbWV0cmljU3RlcmVvRGVjLT5SX2NoX3FtZl9maWx0ZXJfaGlzdG9yeSwKLSAgICAgICAgICAgICAgICAgICAgICAgMTE1MipzaXplb2YoKmNpcmN1bGFyX2J1ZmZlcl9zKSk7Ci0KLSAgICAgICAgfQotCi0KLSAgICAgICAgZm9yIChpID0gMDsgaSA8IDMyOyBpKyspCi0gICAgICAgIHsKLSAgICAgICAgICAgIGlmIChwVmFycy0+bWNfaW5mby5iRG93blNhbXBsZWRTYnIpCi0gICAgICAgICAgICB7Ci0KLSAgICAgICAgICAgICAgICBjYWxjX3Nicl9zeW5maWx0ZXJiYW5rKGhQYXJhbWV0cmljU3RlcmVvRGVjLT5xbWZCdWZmZXJSZWFsW2ldLCAgLyogcmVhbFNhbXBsZXMgICovCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBoUGFyYW1ldHJpY1N0ZXJlb0RlYy0+cW1mQnVmZmVySW1hZ1tpXSwgLyogaW1hZ1NhbXBsZXMgICovCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBmdGltZU91dFB0clBTICsgKGkgPDwgNiksCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmY2lyY3VsYXJfYnVmZmVyX3NbMTk4NCAtIChpPDw2KV0sCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwVmFycy0+bWNfaW5mby5iRG93blNhbXBsZWRTYnIpOwotICAgICAgICAgICAgfQotICAgICAgICAgICAgZWxzZQotICAgICAgICAgICAgewotICAgICAgICAgICAgICAgIGNhbGNfc2JyX3N5bmZpbHRlcmJhbmsoaFBhcmFtZXRyaWNTdGVyZW9EZWMtPnFtZkJ1ZmZlclJlYWxbaV0sICAvKiByZWFsU2FtcGxlcyAgKi8KLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGhQYXJhbWV0cmljU3RlcmVvRGVjLT5xbWZCdWZmZXJJbWFnW2ldLCAvKiBpbWFnU2FtcGxlcyAgKi8KLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZ0aW1lT3V0UHRyUFMgKyAoaSA8PCA3KSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICZjaXJjdWxhcl9idWZmZXJfc1szOTY4IC0gKGk8PDcpXSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBWYXJzLT5tY19pbmZvLmJEb3duU2FtcGxlZFNicik7Ci0gICAgICAgICAgICB9Ci0KLSAgICAgICAgfQotCi0gICAgICAgIGlmIChwVmFycy0+bWNfaW5mby5iRG93blNhbXBsZWRTYnIpCi0gICAgICAgIHsKLSAgICAgICAgICAgIHB2X21lbW1vdmUoKGludDMyX3QgKiloUGFyYW1ldHJpY1N0ZXJlb0RlYy0+Ul9jaF9xbWZfZmlsdGVyX2hpc3RvcnksICZjaXJjdWxhcl9idWZmZXJfc1swXSwgNjQwKnNpemVvZigqY2lyY3VsYXJfYnVmZmVyX3MpKTsKLSAgICAgICAgfQotICAgICAgICBlbHNlCi0gICAgICAgIHsKLSAgICAgICAgICAgIHB2X21lbW1vdmUoKGludDMyX3QgKiloUGFyYW1ldHJpY1N0ZXJlb0RlYy0+Ul9jaF9xbWZfZmlsdGVyX2hpc3RvcnksICZjaXJjdWxhcl9idWZmZXJfc1swXSwgMTE1MipzaXplb2YoKmNpcmN1bGFyX2J1ZmZlcl9zKSk7Ci0gICAgICAgIH0KLQotCi0KLQotCi0gICAgfQotICAgIGVsc2UgICAgLyogIGVsc2UgLS0gc2JyRW5hYmxlUFMgICovCi0gICAgewotCi0jZW5kaWYgICAgICAvKiAgIFBBUkFNRVRSSUNTVEVSRU8gKi8KLSNlbmRpZiAgICAgIC8qICAgSFFfU0JSICovCi0KLSAgICAgICAgLyoKLSAgICAgICAgICogIFVzZSBzaGFyZWQgYWFjIG1lbW9yeSBhcyBjb250aW51b3VzIGJ1ZmZlcgotICAgICAgICAgKi8KLQotCi0gICAgICAgIFNyICA9IHNjcmF0Y2hfbWVtWzBdOwotICAgICAgICBTaSAgPSBzY3JhdGNoX21lbVsxXTsKLQotICAgICAgICBjaXJjdWxhcl9idWZmZXJfcyA9IChJbnQxNiopc2NyYXRjaF9tZW1bMl07Ci0KLSAgICAgICAgaWYgKHBWYXJzLT5tY19pbmZvLmJEb3duU2FtcGxlZFNicikKLSAgICAgICAgewotCi0gICAgICAgICAgICBwdl9tZW1tb3ZlKCZjaXJjdWxhcl9idWZmZXJfc1syMDQ4XSwKLSAgICAgICAgICAgICAgICAgICAgICAgaEZyYW1lRGF0YS0+ViwKLSAgICAgICAgICAgICAgICAgICAgICAgNjQwKnNpemVvZigqY2lyY3VsYXJfYnVmZmVyX3MpKTsKLSAgICAgICAgfQotICAgICAgICBlbHNlCi0gICAgICAgIHsKLSAgICAgICAgICAgIHB2X21lbW1vdmUoJmNpcmN1bGFyX2J1ZmZlcl9zWzQwOTZdLAotICAgICAgICAgICAgICAgICAgICAgICBoRnJhbWVEYXRhLT5WLAotICAgICAgICAgICAgICAgICAgICAgICAxMTUyKnNpemVvZigqY2lyY3VsYXJfYnVmZmVyX3MpKTsKLSAgICAgICAgfQotCi0gICAgICAgIGZvciAoaSA9IDA7IGkgPCAzMjsgaSsrKQotICAgICAgICB7Ci0gICAgICAgICAgICBJbnQgICB4b3ZlckJhbmQ7Ci0KLSAgICAgICAgICAgIGlmIChhcHBseVByb2Nlc3NpbmcpCi0gICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgaWYgKGkgPCAoKGhGcmFtZURhdGEtPmZyYW1lSW5mb1sxXSkgPDwgMSkpCi0gICAgICAgICAgICAgICAgewotICAgICAgICAgICAgICAgICAgICB4b3ZlckJhbmQgPSBzYnJEZWMtPnByZXZMb3dTdWJiYW5kOwotCi0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgIGVsc2UKLSAgICAgICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgICAgIHhvdmVyQmFuZCA9IHNickRlYy0+bG93U3ViYmFuZDsKLSAgICAgICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgICAgICBpZiAoeG92ZXJCYW5kID4gc2JyRGVjLT5oaWdoU3ViYmFuZCkKLSAgICAgICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgICAgIC8qCi0gICAgICAgICAgICAgICAgICAgICAqIGVycm9yIGNvbmRpdGlvbiwgZGVmYXVsdCB0byB1cHNhbXBsaW5nIG1vZGUKLSAgICAgICAgICAgICAgICAgICAgICogYW5kIG1ha2Ugc3VyZSB0aGF0IHRoZSBudW1iZXIgb2YgYmFuZHMgZm9yIHhvdmVyIGRvZXMKLSAgICAgICAgICAgICAgICAgICAgICogbm90IGV4Y2VlZCB0aGUgbnVtYmVyIG9mIGhpZ2ggZnJlcSBiYW5kcy4KLSAgICAgICAgICAgICAgICAgICAgICovCi0gICAgICAgICAgICAgICAgICAgIHhvdmVyQmFuZCA9IChzYnJEZWMtPmhpZ2hTdWJiYW5kID4gMzIpPyAzMjogc2JyRGVjLT5oaWdoU3ViYmFuZDsKLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICB9Ci0gICAgICAgICAgICBlbHNlCi0gICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgeG92ZXJCYW5kID0gMzI7Ci0gICAgICAgICAgICAgICAgc2JyRGVjLT5oaWdoU3ViYmFuZCA9IDMyOwotICAgICAgICAgICAgfQotCi0KLSAgICAgICAgICAgIG0gPSBzYnJEZWMtPmJ1ZlJlYWRPZmZzICsgaTsgICAgLyogc2JyRGVjLT5idWZSZWFkT2ZmcyA9PSAyICovCi0KLQotICAgICAgICAgICAgcHRyX3RtcDEgPSAoaEZyYW1lRGF0YS0+Y29kZWNRbWZCdWZmZXJSZWFsW21dKTsKLSAgICAgICAgICAgIHB0cl90bXAyID0gU3I7Ci0KLSAgICAgICAgICAgIGlmIChzYnJEZWMtPkxDX2FhY1BfRGVjb2RlckZsYWcgPT0gT04pCi0gICAgICAgICAgICB7Ci0KLSAgICAgICAgICAgICAgICBmb3IgKGsgPSAoeG92ZXJCYW5kID4+IDEpOyBrICE9IDA7IGstLSkKLSAgICAgICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgICAgICoocHRyX3RtcDIrKykgPSAoKihwdHJfdG1wMSsrKSkgPj4gOTsKLSAgICAgICAgICAgICAgICAgICAgKihwdHJfdG1wMisrKSA9ICgqKHB0cl90bXAxKyspKSA+PiA5OwotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICBpZiAoeG92ZXJCYW5kICYgMSkKLSAgICAgICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgICAgICoocHRyX3RtcDIrKykgPSAoKihwdHJfdG1wMSkpID4+IDk7Ci0gICAgICAgICAgICAgICAgfQotCi0gICAgICAgICAgICAgICAgcHRyX3RtcDEgPSAmaEZyYW1lRGF0YS0+c2JyUW1mQnVmZmVyUmVhbFtpKlNCUl9OVU1fQkFORFNdOwotCi0KLSAgICAgICAgICAgICAgICBmb3IgKGsgPSB4b3ZlckJhbmQ7IGsgPCBzYnJEZWMtPmhpZ2hTdWJiYW5kOyBrKyspCi0gICAgICAgICAgICAgICAgewotICAgICAgICAgICAgICAgICAgICAqKHB0cl90bXAyKyspID0gKCoocHRyX3RtcDErKykpIDw8IDE7Ci0gICAgICAgICAgICAgICAgfQotCi0gICAgICAgICAgICAgICAgcHZfbWVtc2V0KCh2b2lkICopcHRyX3RtcDIsCi0gICAgICAgICAgICAgICAgICAgICAgICAgIDAsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICg2NCAtIHNickRlYy0+aGlnaFN1YmJhbmQpKnNpemVvZigqcHRyX3RtcDIpKTsKLQotCi0gICAgICAgICAgICAgICAgaWYgKHBWYXJzLT5tY19pbmZvLmJEb3duU2FtcGxlZFNicikKLSAgICAgICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgICAgIGNhbGNfc2JyX3N5bmZpbHRlcmJhbmtfTEMoU3IsICAgICAgICAgICAgICAgLyogcmVhbFNhbXBsZXMgICovCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZnRpbWVPdXRQdHIgKyAoaSA8PCA2KSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmY2lyY3VsYXJfYnVmZmVyX3NbMTk4NCAtIChpPDw2KV0sCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcFZhcnMtPm1jX2luZm8uYkRvd25TYW1wbGVkU2JyKTsKLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgZWxzZQotICAgICAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAgICAgY2FsY19zYnJfc3luZmlsdGVyYmFua19MQyhTciwgICAgICAgICAgICAgICAvKiByZWFsU2FtcGxlcyAgKi8KLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBmdGltZU91dFB0ciArIChpIDw8IDcpLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICZjaXJjdWxhcl9idWZmZXJfc1szOTY4IC0gKGk8PDcpXSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwVmFycy0+bWNfaW5mby5iRG93blNhbXBsZWRTYnIpOwotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgIH0KLSNpZmRlZiBIUV9TQlIKLSAgICAgICAgICAgIGVsc2UKLSAgICAgICAgICAgIHsKLQotICAgICAgICAgICAgICAgIGZvciAoayA9IHhvdmVyQmFuZDsgayAhPSAwOyBrLS0pCi0gICAgICAgICAgICAgICAgewotICAgICAgICAgICAgICAgICAgICAqKHB0cl90bXAyKyspID0gc2hmdF9sZnRfMSgqKHB0cl90bXAxKyspKTsKLSAgICAgICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgICAgICBwdHJfdG1wMSA9ICZoRnJhbWVEYXRhLT5zYnJRbWZCdWZmZXJSZWFsW2kqU0JSX05VTV9CQU5EU107Ci0gICAgICAgICAgICAgICAgcHRyX3RtcDIgPSAmU3JbeG92ZXJCYW5kXTsKLQotCi0gICAgICAgICAgICAgICAgZm9yIChrID0geG92ZXJCYW5kOyBrIDwgc2JyRGVjLT5oaWdoU3ViYmFuZDsgaysrKQotICAgICAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAgICAgKihwdHJfdG1wMisrKSA9ICgqKHB0cl90bXAxKyspKTsKLSAgICAgICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgICAgICBwdl9tZW1zZXQoKHZvaWQgKilwdHJfdG1wMiwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgMCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgKDY0IC0gc2JyRGVjLT5oaWdoU3ViYmFuZCkqc2l6ZW9mKCpwdHJfdG1wMikpOwotCi0KLSAgICAgICAgICAgICAgICBwdHJfdG1wMSA9IChoRnJhbWVEYXRhLT5jb2RlY1FtZkJ1ZmZlckltYWdbbV0pOwotICAgICAgICAgICAgICAgIHB0cl90bXAyID0gU2k7Ci0KLSAgICAgICAgICAgICAgICBmb3IgKGsgPSAoeG92ZXJCYW5kID4+IDEpOyBrICE9IDA7IGstLSkKLSAgICAgICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgICAgICoocHRyX3RtcDIrKykgPSBzaGZ0X2xmdF8xKCoocHRyX3RtcDErKykpOwotICAgICAgICAgICAgICAgICAgICAqKHB0cl90bXAyKyspID0gc2hmdF9sZnRfMSgqKHB0cl90bXAxKyspKTsKLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgaWYgKHhvdmVyQmFuZCAmIDEpCi0gICAgICAgICAgICAgICAgewotICAgICAgICAgICAgICAgICAgICAqKHB0cl90bXAyKSA9IHNoZnRfbGZ0XzEoKihwdHJfdG1wMSkpOwotICAgICAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgICAgIHB0cl90bXAxID0gJmhGcmFtZURhdGEtPnNiclFtZkJ1ZmZlckltYWdbaSpTQlJfTlVNX0JBTkRTXTsKLSAgICAgICAgICAgICAgICBwdHJfdG1wMiA9ICZTaVt4b3ZlckJhbmRdOwotCi0gICAgICAgICAgICAgICAgZm9yIChrID0geG92ZXJCYW5kOyBrIDwgc2JyRGVjLT5oaWdoU3ViYmFuZDsgaysrKQotICAgICAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAgICAgKihwdHJfdG1wMisrKSA9ICgqKHB0cl90bXAxKyspKTsKLSAgICAgICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgICAgICBwdl9tZW1zZXQoKHZvaWQgKilwdHJfdG1wMiwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgMCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgKDY0IC0gc2JyRGVjLT5oaWdoU3ViYmFuZCkqc2l6ZW9mKCpwdHJfdG1wMikpOwotCi0KLSAgICAgICAgICAgICAgICBpZiAocFZhcnMtPm1jX2luZm8uYkRvd25TYW1wbGVkU2JyKQotICAgICAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAgICAgY2FsY19zYnJfc3luZmlsdGVyYmFuayhTciwgICAgICAgICAgICAgIC8qIHJlYWxTYW1wbGVzICAqLwotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFNpLCAgICAgICAgICAgICAvKiBpbWFnU2FtcGxlcyAgKi8KLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBmdGltZU91dFB0ciArIChpIDw8IDYpLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICZjaXJjdWxhcl9idWZmZXJfc1sxOTg0IC0gKGk8PDYpXSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwVmFycy0+bWNfaW5mby5iRG93blNhbXBsZWRTYnIpOwotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICBlbHNlCi0gICAgICAgICAgICAgICAgewotICAgICAgICAgICAgICAgICAgICBjYWxjX3Nicl9zeW5maWx0ZXJiYW5rKFNyLCAgICAgICAgICAgICAgLyogcmVhbFNhbXBsZXMgICovCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgU2ksICAgICAgICAgICAgIC8qIGltYWdTYW1wbGVzICAqLwotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZ0aW1lT3V0UHRyICsgKGkgPDwgNyksCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJmNpcmN1bGFyX2J1ZmZlcl9zWzM5NjggLSAoaTw8NyldLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBWYXJzLT5tY19pbmZvLmJEb3duU2FtcGxlZFNicik7Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgfQotI2VuZGlmCi0KLSAgICAgICAgfQotCi0gICAgICAgIGlmIChwVmFycy0+bWNfaW5mby5iRG93blNhbXBsZWRTYnIpCi0gICAgICAgIHsKLSAgICAgICAgICAgIHB2X21lbW1vdmUoaEZyYW1lRGF0YS0+ViwgJmNpcmN1bGFyX2J1ZmZlcl9zWzBdLCA2NDAqc2l6ZW9mKCpj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YWluX3ZlYzE7Ci0gICAgSW50MzIgKmZyYW1lSW5mbyAgICA9IGhGcmFtZURhdGEtPmZyYW1lSW5mbzsKLQotCi0KLSAgICBmb3IgKGkgPSAwOyBpIDwgZnJhbWVJbmZvWzBdOyBpKyspCi0gICAgewotICAgICAgICBmcmVxUmVzID0gZnJhbWVJbmZvW2ZyYW1lSW5mb1swXSArIGkgKyAyXTsKLSAgICAgICAgbm9fb2ZfYmFuZHMgPSBuU2ZiW2ZyZXFSZXNdOwotCi0gICAgICAgIGlmIChkb21haW5fdmVjW2ldID09IDApCi0gICAgICAgIHsKLSAgICAgICAgICAgIG1hcExvd1Jlc0VuZXJneVZhbCgqaUVudmVsb3BlLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNmYl9ucmdfcHJldiwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBvZmZzZXQsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBmcmVxUmVzKTsKLSAgICAgICAgICAgIGlFbnZlbG9wZSsrOwotCi0gICAgICAgICAgICBmb3IgKGJhbmQgPSAxOyBiYW5kIDwgbm9fb2ZfYmFuZHM7IGJhbmQrKykKLSAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAqaUVudmVsb3BlICs9ICAqKGlFbnZlbG9wZSAtIDEpOwotCi0gICAgICAgICAgICAgICAgbWFwTG93UmVzRW5lcmd5VmFsKCppRW52ZWxvcGUsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNmYl9ucmdfcHJldiwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgb2Zmc2V0LAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBiYW5kLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBmcmVxUmVzKTsKLSAgICAgICAgICAgICAgICBpRW52ZWxvcGUrKzsKLSAgICAgICAgICAgIH0KLSAgICAgICAgfQotICAgICAgICBlbHNlCi0gICAgICAgIHsKLSAgICAgICAgICAgIGZvciAoYmFuZCA9IDA7IGJhbmQgPCBub19vZl9iYW5kczsgYmFuZCsrKQotICAgICAgICAgICAgewotICAgICAgICAgICAgICAgICppRW52ZWxvcGUgKz0gIHNmYl9ucmdfcHJldlsgaW5kZXhMb3cySGlnaChvZmZzZXQsIGJhbmQsIGZyZXFSZXMpXTsKLQotICAgICAgICAgICAgICAgIG1hcExvd1Jlc0VuZXJneVZhbCgqaUVudmVsb3BlLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzZmJfbnJnX3ByZXYsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG9mZnNldCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYmFuZCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZnJlcVJlcyk7Ci0gICAgICAgICAgICAgICAgaUVudmVsb3BlKys7Ci0gICAgICAgICAgICB9Ci0gICAgICAgIH0KLSAgICB9Ci19Ci0KLQotCi12b2lkIG1hcExvd1Jlc0VuZXJneVZhbCgKLSAgICBJbnQzMiAgY3VyclZhbCwKLSAgICBJbnQzMiAqcHJldkRhdGEsCi0gICAgSW50MzIgIG9mZnNldCwKLSAgICBJbnQzMiAgaW5kZXgsCi0gICAgSW50MzIgIHJlcykKLXsKLSAgICBJbnQzMiB0bXA7Ci0KLSAgICBpZiAocmVzID09IExPKQotICAgIHsKLSAgICAgICAgaWYgKG9mZnNldCA+PSAwKQotICAgICAgICB7Ci0gICAgICAgICAgICBpZiAoaW5kZXggPCBvZmZzZXQpCi0gICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgcHJldkRhdGFbaW5kZXhdID0gY3VyclZhbDsKLSAgICAgICAgICAgIH0KLSAgICAgICAgICAgIGVsc2UKLSAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICB0bXAgPSAoaW5kZXggPDwgMSkgLSBvZmZzZXQ7Ci0gICAgICAgICAgICAgICAgcHJldkRhdGFbdG1wICAgIF0gPSBjdXJyVmFsOwotICAgICAgICAgICAgICAgIHByZXZEYXRhW3RtcCArMSBdID0gY3VyclZhbDsKLSAgICAgICAgICAgIH0KLSAgICAgICAgfQotICAgICAgICBlbHNlCi0gICAgICAgIHsKLSAgICAgICAgICAgIG9mZnNldCA9IC1vZmZzZXQ7Ci0gICAgICAgICAgICBpZiAoaW5kZXggPCBvZmZzZXQpCi0gICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgdG1wID0gKGluZGV4IDw8IDEpICsgaW5kZXg7Ci0gICAgICAgICAgICAgICAgcHJldkRhdGFbdG1wICAgIF0gPSBjdXJyVmFsOwotICAgICAgICAgICAgICAgIHByZXZEYXRhW3RtcCArIDFdID0gY3VyclZhbDsKLSAgICAgICAgICAgICAgICBwcmV2RGF0YVt0bXAgKyAyXSA9IGN1cnJWYWw7Ci0gICAgICAgICAgICB9Ci0gICAgICAgICAgICBlbHNlCi0gICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgdG1wID0gKGluZGV4IDw8IDEpICsgb2Zmc2V0OwotICAgICAgICAgICAgICAgIHByZXZEYXRhW3RtcCAgICBdID0gY3VyclZhbDsKLSAgICAgICAgICAgICAgICBwcmV2RGF0YVt0bXAgKyAxXSA9IGN1cnJWYWw7Ci0gICAgICAgICAgICB9Ci0gICAgICAgIH0KLSAgICB9Ci0gICAgZWxzZQotICAgIHsKLSAgICAgICAgcHJldkRhdGFbaW5kZXhdID0gY3VyclZhbDsKLSAgICB9Ci19Ci0KLQotSW50MzIgaW5kZXhMb3cySGlnaChJbnQzMiBvZmZzZXQsCi0gICAgICAgICAgICAgICAgICAgIEludDMyIGluZGV4LAotICAgICAgICAgICAgICAgICAgICBJbnQzMiByZXMpCi17Ci0gICAgaWYgKHJlcyA9PSBMTykKLSAgICB7Ci0gICAgICAgIGlmIChvZmZzZXQgPj0gMCkKLSAgICAgICAgewotICAgICAgICAgICAgaWYgKGluZGV4IDwgb2Zmc2V0KQotICAgICAgICAgICAgewotICAgICAgICAgICAgICAgIHJldHVybihpbmRleCk7Ci0gICAgICAgICAgICB9Ci0gICAgICAgICAgICBlbHNlCi0gICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgcmV0dXJuKChpbmRleCA8PCAxKSAtIG9mZnNldCk7Ci0gICAgICAgICAgICB9Ci0gICAgICAgIH0KLSAgICAgICAgZWxzZQotICAgICAgICB7Ci0gICAgICAgICAgICBvZmZzZXQgPSAtb2Zmc2V0OwotICAgICAgICAgICAgaWYgKGluZGV4IDwgb2Zmc2V0KQotICAgICAgICAgICAgewotICAgICAgICAgICAgICAgIHJldHVybigoaW5kZXggPDwgMSkgKyBpbmRleCk7Ci0gICAgICAgICAgICB9Ci0gICAgICAgICAgICBlbHNlCi0gICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgcmV0dXJuKChpbmRleCA8PCAxKSArIG9mZnNldCk7Ci0gICAgICAgICAgICB9Ci0gICAgICAgIH0KLSAgICB9Ci0gICAgZWxzZQotICAgIHsKLSAgICAgICAgcmV0dXJuKGluZGV4KTsKLSAgICB9Ci19Ci0KLSNlbmRpZgotCmRpZmYgLS1naXQgYS9tZWRpYS9saWJzdGFnZWZyaWdodC9jb2RlY3MvYWFjZGVjL3Nicl9kZWNvZGVfZW52ZWxvcGUuaCBiL21lZGlhL2xpYnN0YWdlZnJpZ2h0L2NvZGVjcy9hYWNkZWMvc2JyX2RlY29kZV9lbnZlbG9wZS5oCmRlbGV0ZWQgZmlsZSBtb2RlIDEwMDY0NAppbmRleCAxOWMwNGE5Li4wMDAwMDAwCi0tLSBhL21lZGlhL2xpYnN0YWdlZnJpZ2h0L2NvZGVjcy9hYWNkZWMvc2JyX2RlY29kZV9lbnZlbG9wZS5oCisrKyAvZGV2L251bGwKQEAgLTEsOTQgKzAsMCBAQAotLyogLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS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ICAgICAgICAgICAgICoKLSAgICAgICAgICAgICAqICAgaUVudmVsb3BlUmlnaHRbaV0gPSBrKjJebi8oMSsyXm0pID0gIGsqMl4obi1tKS8oMSArIDJeLW0pOwotICAgICAgICAgICAgICogICB3aGVyZSBrID0gMSBvciBzcXJ0KDIpCi0gICAgICAgICAgICAgKi8KLSAgICAgICAgICAgIGlmIChpRW52ZWxvcGVSaWdodF9leHBbaV0gPj0gMCkKLSAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICBpZiAoaUVudmVsb3BlUmlnaHRfZXhwW2ldIDwgMTEpCi0gICAgICAgICAgICAgICAgewotICAgICAgICAgICAgICAgICAgICBpRW52ZWxvcGVSaWdodF9tYW5baV0gPSBvbmVfb3Zlcl9vbmVfcGx1c190d29fdG9fblsgaUVudmVsb3BlUmlnaHRfZXhwW2ldXTsKLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgZWxzZSAgICAgICAgLyogIDEvKDErMl4tbSkgPT0gMSAtIDJeLW0gOyAgZm9yIG0gPj0gMTAgICovCi0gICAgICAgICAgICAgICAgewotICAgICAgICAgICAgICAgICAgICBpRW52ZWxvcGVSaWdodF9tYW5baV0gLT0gKFFmbXQoMS4wMDBGKSA+PiBpRW52ZWxvcGVSaWdodF9leHBbaV0pOwotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICBpRW52ZWxvcGVSaWdodF9leHBbaV0gPSBpRW52ZWxvcGVMZWZ0X2V4cFtpXSAtIGlFbnZlbG9wZVJpZ2h0X2V4cFtpXTsKLSAgICAgICAgICAgIH0KLSAgICAgICAgICAgIGVsc2UKLSAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICBpZiAoaUVudmVsb3BlUmlnaHRfZXhwW2ldID4gLTExKQotICAgICAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAgICAgaUVudmVsb3BlUmlnaHRfbWFuW2ldIC09IG9uZV9vdmVyX29uZV9wbHVzX3R3b190b19uWyAtaUVudmVsb3BlUmlnaHRfZXhwW2ldXTsKLSAgICAgICAgICAgICAgICAgICAgaUVudmVsb3BlUmlnaHRfZXhwW2ldID0gaUVudmVsb3BlTGVmdF9leHBbaV0gLSBpRW52ZWxvcGVSaWdodF9leHBbaV07Ci0KLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgZWxzZSAgICAgICAgLyogIDEvKDErMl5tKSA9PSAyXi1tIDsgIGZvciBtID49IDEwICAqLwotICAgICAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAgICAgaUVudmVsb3BlUmlnaHRfZXhwW2ldID0gaUVudmVsb3BlTGVmdF9leHBbaV07Ci0gICAgICAgICAgICAgICAgICAgIGlFbnZlbG9wZUxlZnRfZXhwW2ldID0gMDsKLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgIGlFbnZlbG9wZUxlZnRfbWFuW2ldICA9IGlFbnZlbG9wZVJpZ2h0X21hbltpXTsKLSAgICAgICAgfQotICAgIH0KLSAgICBlbHNlCi0gICAgewotICAgICAgICBmb3IgKGkgPSAwOyBpIDwgaEZyYW1lRGF0YTEtPm5TY2FsZUZhY3RvcnM7IGkrKykKLSAgICAgICAgewotICAgICAgICAgICAgLyogIGlFbnZlbG9wZVtpXSBhbHdheXMgcG9zaXRpdmUgIDcgYml0cyBtYXggKi8KLSAgICAgICAgICAgIHRlbXBSaWdodCA9IGlFbnZlbG9wZVJpZ2h0X21hbltpXTsKLSAgICAgICAgICAgIHRlbXBMZWZ0ICA9IGlFbnZlbG9wZUxlZnRfbWFuW2ldOwotCi0gICAgICAgICAgICBpRW52ZWxvcGVMZWZ0X2V4cFtpXSA9ICh0ZW1wTGVmdCA+PiAxKSArIDc7Ci0gICAgICAgICAgICBpZiAodGVtcExlZnQgJiAweDEpICAgLyogIG9kZCAqLwotICAgICAgICAgICAgewotICAgICAgICAgICAgICAgIGlFbnZlbG9wZUxlZnRfbWFuW2ldID0gUWZtdCgxLjQxNDIxMzU2MjM3MzEwRik7Ci0gICAgICAgICAgICB9Ci0gICAgICAgICAgICBlbHNlCi0gICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgaUVudmVsb3BlTGVmdF9tYW5baV0gPSBRZm10KDEuMDAwRik7Ci0gICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgIGlFbnZlbG9wZVJpZ2h0X2V4cFtpXSA9ICh0ZW1wUmlnaHQgPj4gMSkgLSAxMjsKLSAgICAgICAgICAgIGlmICh0ZW1wUmlnaHQgJiAweDEpICAgLyogIG9kZCAqLwotICAgICAgICAgICAgewotICAgICAgICAgICAgICAgIGlmIChpRW52ZWxvcGVSaWdodF9leHBbaV0gPiAwKQotICAgICAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAgICAgaUVudmVsb3BlUmlnaHRfbWFuW2ldID0gUWZtdCgxLjQxNDIxMzU2MjM3MzEwRik7Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgIGVsc2UKLSAgICAgICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgICAgIGlFbnZlbG9wZVJpZ2h0X21hbltpXSA9IFFmbXQoMC43MDcxMDY3ODExODY1Rik7Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgfQotICAgICAgICAgICAgZWxzZQotICAgICAgICAgICAgewotICAgICAgICAgICAgICAgIGlFbnZlbG9wZVJpZ2h0X21hbltpXSA9IFFmbXQoMS4wMDBGKTsKLSAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgaWYgKGlFbnZlbG9wZVJpZ2h0X21hbltpXSA9PSBRZm10KDEuMDAwRikpCi0gICAgICAgICAgICB7Ci0KLSAgICAgICAgICAgICAgICAvKgotICAgICAgICAgICAgICAgICAqICBpRW52ZWxvcGVSaWdodFtpXSA9IHRlbXBMZWZ0IC8gKDEgKyB0ZW1wUmlnaHQpOwotICAgICAgICAgICAgICAgICAqICBpRW52ZWxvcGVMZWZ0W2ldICA9IHRlbXBSaWdodCAqIGlFbnZlbG9wZVJpZ2h0W2ldOwotICAgICAgICAgICAgICAgICAqCi0gICAgICAgICAgICAgICAgICoKLSAgICAgICAgICAgICAgICAgKiAgIGlFbnZlbG9wZVJpZ2h0W2ldID0gayoyXm4vKDErMl5tKSA9ICBrKjJeKG4tbSkvKDEgKyAyXi1tKTsKLSAgICAgICAgICAgICAgICAgKiAgIHdoZXJlIGsgPSAxIG9yIHNxcnQoMikKLSAgICAgICAgICAgICAgICAgKi8KLSAgICAgICAgICAgICAgICBpZiAoaUVudmVsb3BlUmlnaHRfZXhwW2ldID49IDApCi0gICAgICAgICAgICAgICAgewotICAgICAgICAgICAgICAgICAgICBpZiAoaUVudmVsb3BlUmlnaHRfZXhwW2ldIDwgMTEpCi0gICAgICAgICAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAgICAgICAgIGlFbnZlbG9wZVJpZ2h0X21hbltpXSA9IG9uZV9vdmVyX29uZV9wbHVzX3R3b190b19uWyBpRW52ZWxvcGVSaWdodF9leHBbaV1dOwotICAgICAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgICAgIGVsc2UgICAgICAgIC8qICAxLygxKzJeLW0pID09IDEgLSAyXi1tIDsgIGZvciBtID49IDEwICAqLwotICAgICAgICAgICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgICAgICAgICBpRW52ZWxvcGVSaWdodF9tYW5baV0gLT0gKFFmbXQoMS4wMDBGKSA+PiBpRW52ZWxvcGVSaWdodF9leHBbaV0pOwotICAgICAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgICAgIGlFbnZlbG9wZVJpZ2h0X2V4cFtpXSA9IGlFbnZlbG9wZUxlZnRfZXhwW2ldIC0gaUVudmVsb3BlUmlnaHRfZXhwW2ldOwotCi0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgIGVsc2UKLSAgICAgICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgICAgIGlmIChpRW52ZWxvcGVSaWdodF9leHBbaV0gPiAtMTEpCi0gICAgICAgICAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAgICAgICAgIGlFbnZlbG9wZVJpZ2h0X21hbltpXSAtPSBvbmVfb3Zlcl9vbmVfcGx1c190d29fdG9fblsgLWlFbnZlbG9wZVJpZ2h0X2V4cFtpXV07Ci0gICAgICAgICAgICAgICAgICAgICAgICBpRW52ZWxvcGVSaWdodF9leHBbaV0gPSBpRW52ZWxvcGVMZWZ0X2V4cFtpXSAtIGlFbnZlbG9wZVJpZ2h0X2V4cFtpXTsKLSAgICAgICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgICAgICBlbHNlICAgICAgICAvKiAgMS8oMSsyXm0pID09IDJeLW0gOyAgZm9yIG0gPj0gMTAgICovCi0gICAgICAgICAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAgICAgICAgIGlFbnZlbG9wZVJpZ2h0X2V4cFtpXSA9IGlFbnZlbG9wZUxlZnRfZXhwW2ldOwotICAgICAgICAgICAgICAgICAgICAgICAgaUVudmVsb3BlTGVmdF9leHBbaV0gID0gMDsKLSAgICAgICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgICAgIC8qCi0gICAgICAgICAgICAgICAgICogIGFwcGx5ICJrIiBmYWN0b3IgMSBvciBzcXJ0KDIpCi0gICAgICAgICAgICAgICAgICoKLSAgICAgICAgICAgICAgICAgKiAgICgyXm0pKjIqayoyXm4vKDErMl5tKSA9ICBrKjJeKG4rMSkvKDEgKyAyXi1tKTsKLSAgICAgICAgICAgICAgICAgKgotICAgICAgICAgICAgICAgICAqLwotICAgICAgICAgICAgICAgIGlmIChpRW52ZWxvcGVMZWZ0X21hbltpXSAhPSBRZm10KDEuMDAwRikpCi0gICAgICAgICAgICAgICAgewotICAgICAgICAgICAgICAgICAgICBpRW52ZWxvcGVSaWdodF9tYW5baV0gPSBmeHBfbXVsMzJfUTMwKGlFbnZlbG9wZUxlZnRfbWFuW2ldLCBpRW52ZWxvcGVSaWdodF9tYW5baV0pOwotICAgICAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgICAgIGlFbnZlbG9wZUxlZnRfbWFuW2ldICA9IGlFbnZlbG9wZVJpZ2h0X21hbltpXTsKLQotICAgICAgICAgICAgfQotICAgICAgICAgICAgZWxzZQotICAgICAgICAgICAgewotCi0gICAgICAgICAgICAgICAgLyoKLSAgICAgICAgICAgICAgICAqICBpRW52ZWxvcGVSaWdodFtpXSA9IHRlbXBMZWZ0IC8gKDEgKyB0ZW1wUmlnaHQpOwotICAgICAgICAgICAgICAgICogIGlFbnZlbG9wZUxlZnRbaV0gID0gdGVtcFJpZ2h0ICogaUVudmVsb3BlUmlnaHRbaV07Ci0gICAgICAgICAgICAgICAgKgotICAgICAgICAgICAgICAgICoKLSAgICAgICAgICAgICAgICAqICAgaUVudmVsb3BlUmlnaHRbaV0gPSBrKjJebi8oMStxMl5tKSA9ICBrKjJeKG4tbSkvKDEgKyBxMl4tbSk7Ci0gICAgICAgICAgICAgICAgKiAgIHdoZXJlIGsgPSAxIG9yIHNxcnQoMikKLSAgICAgICAgICAgICAgICAqICAgYW5kIHEgPSBzcXJ0KDIpCi0gICAgICAgICAgICAgICAgICAgICovCi0gICAgICAgICAgICAgICAgaWYgKGlFbnZlbG9wZVJpZ2h0X2V4cFtpXSA+PSAwKQotICAgICAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAgICAgaWYgKGlFbnZlbG9wZVJpZ2h0X2V4cFtpXSA8IDEyKQotICAgICAgICAgICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgICAgICAgICBpRW52ZWxvcGVSaWdodF9tYW5baV0gPSBvbmVfb3Zlcl9vbmVfcGx1c19zcV8yX2J5X3R3b190b19uWyBpRW52ZWxvcGVSaWdodF9leHBbaV1dOwotICAgICAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgICAgIGVsc2UgICAgICAgIC8qICAxLygxKzJeLW0pID09IDEgLSAyXi1tIDsgIGZvciBtID49IDExICAqLwotICAgICAgICAgICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgICAgICAgICBpRW52ZWxvcGVSaWdodF9tYW5baV0gPSBRZm10KDEuMDAwRikgLSAoUWZtdCgxLjAwMEYpID4+IGlFbnZlbG9wZVJpZ2h0X2V4cFtpXSk7Ci0gICAgICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgZWxzZQotICAgICAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAgICAgaWYgKGlFbnZlbG9wZVJpZ2h0X2V4cFtpXSA+IC0xMikKLSAgICAgICAgICAgICAgICAgICAgewotICAgICAgICAgICAgICAgICAgICAgICAgaUVudmVsb3BlUmlnaHRfbWFuW2ldID0gUWZtdCgxLjAwMEYpIC0gb25lX292ZXJfb25lX3BsdXNfc3FfMl9ieV90d29fdG9fblsgLWlFbnZlbG9wZVJpZ2h0X2V4cFtpXV07Ci0gICAgICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICAgICAgZWxzZSAgICAgICAgLyogIDEvKDErMl5tKSA9PSAyXi1tIDsgIGZvciBtID49IDExICAqLwotICAgICAgICAgICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgICAgICAgICBpRW52ZWxvcGVSaWdodF9tYW5baV0gPSBRZm10KDEuMDAwRik7Ci0gICAgICAgICAgICAgICAgICAgICAgICBpRW52ZWxvcGVSaWdodF9leHBbaV0gPSAwOwotICAgICAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgfQotCi0gICAgICAgICAgICAgICAgaUVudmVsb3BlUmlnaHRfZXhwW2ldID0gaUVudmVsb3BlTGVmdF9leHBbaV0gLSBpRW52ZWxvcGVSaWdodF9leHBbaV07Ci0KLSAgICAgICAgICAgICAgICAvKgotICAgICAgICAgICAgICAgICogIGFwcGx5ICJrIiBmYWN0b3IgMSBvciBzcXJ0KDIpCi0gICAgICAgICAgICAgICAgKgotICAgICAgICAgICAgICAgICogICBSaWdodCA9PSAgICBrKjJeKG4tbSkvKDEgKyBxMl4tbSkKLSAgICAgICAgICAgICAgICAqICAgTGVmdCAgPT0gKHEyXm0pKmsqMl5uLygxICsgcTJebSkgPSAgcWsqMl5uLygxICsgcTJeLW0pOwotICAgICAgICAgICAgICAgICovCi0gICAgICAgICAgICAgICAgaWYgKGlFbnZlbG9wZUxlZnRfbWFuW2ldICE9IFFmbXQoMS4wMDBGKSkKLSAgICAgICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgICAgIC8qCi0gICAgICAgICAgICAgICAgICAgICogICBrLygxICsgcTJeLW0pOwotICAgICAgICAgICAgICAgICAgICAgICAgKi8KLSAgICAgICAgICAgICAgICAgICAgdG1wID0gaUVudmVsb3BlUmlnaHRfbWFuW2ldOwotICAgICAgICAgICAgICAgICAgICBpRW52ZWxvcGVSaWdodF9tYW5baV0gPSBmeHBfbXVsMzJfUTMwKGlFbnZlbG9wZUxlZnRfbWFuW2ldLCBpRW52ZWxvcGVSaWdodF9tYW5baV0pOwotICAgICAgICAgICAgICAgICAgICBpRW52ZWxvcGVMZWZ0X21hbltpXSA9IHRtcDsKLSAgICAgICAgICAgICAgICAgICAgaUVudmVsb3BlTGVmdF9leHBbaV0gKz0gMTsgICAgICAvKiBleHRyYSBvbmUgZHVlIHRvIHNxcnQoMileMiAqLwotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICBlbHNlCi0gICAgICAgICAgICAgICAgewotICAgICAgICAgICAgICAgICAgICBpRW52ZWxvcGVMZWZ0X21hbltpXSAgPSBmeHBfbXVsMzJfUTMwKGlFbnZlbG9wZVJpZ2h0X21hbltpXSwgUWZtdCgxLjQxNDIxMzU2MjM3MzEwRikpOwotICAgICAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgfSAgICAgICAvKiAgZW5kIG9mICAgICBpZiAoaUVudmVsb3BlUmlnaHRfbWFuW2ldID09IFFmbXQoIDEuMDAwRikgKSAgKi8KLSAgICAgICAgfSAgICAgIC8qIGVuZCBvZiBmb3IgbG9vcCAqLwotICAgIH0gICAgIC8qICBlbmQgIGlmIChoRnJhbWVEYXRhMi0+YW1wUmVzKSAqLwotCi0KLSAgICBmb3IgKGkgPSAwOyBpIDwgaEZyYW1lRGF0YTEtPm5Ob2lzZUZhY3RvcnM7IGkrKykKLSAgICB7Ci0KLSAgICAgICAgbm9pc2VGbG9vckxlZnRfZXhwW2ldICA9IE5PSVNFX0ZMT09SX09GRlNFVF9QTFVTXzEgLSBub2lzZUZsb29yTGVmdF9tYW5baV07Ci0gICAgICAgIG5vaXNlRmxvb3JSaWdodF9leHBbaV0gPSBub2lzZUZsb29yUmlnaHRfbWFuW2ldIC0gU0JSX0VORVJHWV9QQU5fT0ZGU0VUX0lOVDsKLQotCi0gICAgICAgIC8qCi0gICAgICAgICAqICBub2lzZUZsb29yUmlnaHRbaV0gPSB0ZW1wTGVmdCAvICgxLjBmICsgdGVtcFJpZ2h0KTsKLSAgICAgICAgICogIG5vaXNlRmxvb3JMZWZ0W2ldICA9IHRlbXBSaWdodCpub2lzZUZsb29yUmlnaHRbaV07Ci0gICAgICAgICAqCi0gICAgICAgICAqCi0gICAgICAgICAqICAgbm9pc2VGbG9vclJpZ2h0W2ldID0gMl5uLygxKzJebSkgPSAgMl4obi1tKS8oMSArIDJeLW0pOwotICAgICAgICAgKi8KLSAgICAgICAgaWYgKG5vaXNlRmxvb3JSaWdodF9leHBbaV0gPj0gMCkKLSAgICAgICAgewotICAgICAgICAgICAgaWYgKG5vaXNlRmxvb3JSaWdodF9leHBbaV0gPCAxMSkKLSAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICBub2lzZUZsb29yUmlnaHRfbWFuW2ldID0gb25lX292ZXJfb25lX3BsdXNfdHdvX3RvX25bIG5vaXNlRmxvb3JSaWdodF9leHBbaV1dOwotICAgICAgICAgICAgfQotICAgICAgICAgICAgZWxzZSAgICAgICAgLyogIDEvKDErMl4tbSkgPT0gMSAtIDJeLW0gOyAgZm9yIG0gPj0gMTAgICovCi0gICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgbm9pc2VGbG9vclJpZ2h0X21hbltpXSA9IFFmbXQoMS4wMDBGKSAtIChRZm10KDEuMDAwRikgPj4gbm9pc2VGbG9vclJpZ2h0X2V4cFtpXSk7Ci0gICAgICAgICAgICB9Ci0gICAgICAgIH0KLSAgICAgICAgZWxzZQotICAgICAgICB7Ci0gICAgICAgICAgICBpZiAobm9pc2VGbG9vclJpZ2h0X2V4cFtpXSA+IC0xMSkKLSAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICBub2lzZUZsb29yUmlnaHRfbWFuW2ldID0gUWZtdCgxLjAwMEYpIC0gb25lX292ZXJfb25lX3BsdXNfdHdvX3RvX25bIC1ub2lzZUZsb29yUmlnaHRfZXhwW2ldXTsKLSAgICAgICAgICAgIH0KLSAgICAgICAgICAgIGVsc2UgICAgICAgIC8qICAxLygxKzJebSkgPT0gMl4tbSA7ICBmb3IgbSA+PSAxMCAgKi8KLSAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICBub2lzZUZsb29yUmlnaHRfbWFuW2ldID0gUWZtdCgxLjAwMEYpOwotICAgICAgICAgICAgICAgIG5vaXNlRmxvb3JSaWdodF9leHBbaV0gPSAwOwotICAgICAgICAgICAgfQotICAgICAgICB9Ci0KLSAgICAgICAgbm9pc2VGbG9vclJpZ2h0X2V4cFtpXSA9IG5vaXNlRmxvb3JMZWZ0X2V4cFtpXSAtIG5vaXNlRmxvb3JSaWdodF9leHBbaV07Ci0KLSAgICAgICAgLyoKLSAgICAgICAgICogICAoMl5tKSoyXm4vKDErMl5tKSA9ICAyXm4vKDEgKyAyXi1tKTsKLSAgICAgICAgICovCi0KLSAgICAgICAgbm9pc2VGbG9vckxlZnRfbWFuW2ldID0gbm9pc2VGbG9vclJpZ2h0X21hbltpXTsKLSAgICAgICAgbm9pc2VGbG9vckxlZnRfZXhwW2ldID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JT05fU0laRV9CSVRTKSAtIDEpCi0gICAgICAgIHsKLSAgICAgICAgICAgIGNudCArPSBidWZfZ2V0Yml0cyhoQml0QnVmLCBTSV9TQlJfRVhURU5TSU9OX0VTQ19DT1VOVF9CSVRTKTsKLSAgICAgICAgfQotCi0gICAgICAgIG5CaXRzTGVmdCA9IChjbnQgPDwgMyk7Ci0gICAgICAgIHdoaWxlIChuQml0c0xlZnQgPiA3KQotICAgICAgICB7Ci0gICAgICAgICAgICBleHRlbnNpb25faWQgPSBidWZfZ2V0Yml0cyhoQml0QnVmLCBTSV9TQlJfRVhURU5TSU9OX0lEX0JJVFMpOwotICAgICAgICAgICAgbkJpdHNMZWZ0IC09IFNJX1NCUl9FWFRFTlNJT05fSURfQklUUzsKLQotICAgICAgICAgICAgc3dpdGNoIChleHRlbnNpb25faWQpCi0gICAgICAgICAgICB7Ci0jaWZkZWYgSFFfU0JSCi0jaWZkZWYgUEFSQU1FVFJJQ1NURVJFTwotCi0gICAgICAgICAgICAgICAgICAgIC8qCi0gICAgICAgICAgICAgICAgICAgICAqICBQYXJhbWV0cmljIENvZGluZyBzdXBwb3J0cyB0aGUgVHJhbnNpZW50LCBTaW51c29pZGFsLCBOb2lzZSwgYW5kCi0gICAgICAgICAgICAgICAgICAgICAqICBQYXJhbWV0cmljIFN0ZXJlbyB0b29scyAoTVBFRzQpLgotICAgICAgICAgICAgICAgICAgICAgKiAgM0dQUCB1c2UgYWFjKyBocSBhbG9uZyB3aXRoIHBzIGZvciBlbmhhbmNlZCBhYWMrCi0gICAgICAgICAgICAgICAgICAgICAqICBUaGUgUFMgdG9vbCB1c2VzIGNvbXBsZXgtdmFsdWUgUU1GIGRhdGEsIHRoZXJlZm9yZSBjYW4gbm90IGJlIHVzZWQKLSAgICAgICAgICAgICAgICAgICAgICogIHdpdGggbG93IHBvd2VyIHZlcnNpb24gb2YgYWFjKwotICAgICAgICAgICAgICAgICAgICAgKi8KLSAgICAgICAgICAgICAgICBjYXNlIEVYVEVOU0lPTl9JRF9QU19DT0RJTkc6Ci0KLSAgICAgICAgICAgICAgICAgICAgaWYgKGhQYXJhbWV0cmljU3RlcmVvRGVjICE9IE5VTEwpCi0gICAgICAgICAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAgICAgICAgIGlmICghaFBhcmFtZXRyaWNTdGVyZW9EZWMtPnBzRGV0ZWN0ZWQpCi0gICAgICAgICAgICAgICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgLyogcGFyYW1ldHJpYyBzdGVyZW8gZGV0ZWN0ZWQgKi8KLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBoUGFyYW1ldHJpY1N0ZXJlb0RlYy0+cHNEZXRlY3RlZCA9IDE7Ci0gICAgICAgICAgICAgICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgICAgICAgICAgICAgIG5CaXRzTGVmdCAtPSBwc19yZWFkX2RhdGEoaFBhcmFtZXRyaWNTdGVyZW9EZWMsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGhCaXRCdWYsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG5CaXRzTGVmdCk7Ci0KLSAgICAgICAgICAgICAgICAgICAgfQotCi0gICAgICAgICAgICAgICAgICAgIGJyZWFrOwotI2VuZGlmCi0jZW5kaWYKLSAgICAgICAgICAgICAgICBjYXNlIDA6Ci0KLSAgICAgICAgICAgICAgICBkZWZhdWx0OgotICAgICAgICAgICAgICAgICAgICAvKiAgIEFuIHVua25vd24gZXh0ZW5zaW9uIGlkIGNhdXNlcyB0aGUgcmVtYWluaW5nIGV4dGVuc2lvbiBkYXRhCi0gICAgICAgICAgICAgICAgICAgICAqICAgdG8gYmUgc2tpcHBlZAotICAgICAgICAgICAgICAgICAgICAgKi8KLSAgICAgICAgICAgICAgICAgICAgY250ID0gbkJpdHNMZWZ0ID4+IDM7IC8qIG51bWJlciBvZiByZW1haW5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m9pZCBoaWdoX2ZyZXFfZ2VuZXJhdGlvbl9MQyhJbnQzMiBzb3VyY2VCdWZmZXJSZWFsW11bMzJdLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgSW50MzIgKnRhcmdldEJ1ZmZlclJlYWwsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBJbnQzMiAqYWxwaGFyWzJdLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgSW50MzIgKmRlZ3JlZUFsaWFzLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgSW50MzIgKmludkZpbHRCYW5kVGFibGUsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBJbnQzMiB0YXJnZXRTdG9wQmFuZCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEludDMyIHBhdGNoRGlzdGFuY2UsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBJbnQzMiBudW1CYW5kc0luUGF0Y2gsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBJbnQzMiBzdGFydFNhbXBsZSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEludDMyIHNsb3BlTGVuZ3RoLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgSW50MzIgc3RvcFNhbXBsZSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEludDMyICpCd1ZlY3RvciwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEludDMyIHNiclN0YXJ0RnJlcU9mZnNldCk7Ci0KLQotI2lmZGVmIEhRX1NCUgotCi0gICAgdm9pZCBoaWdoX2ZyZXFfY29lZmYoSW50MzIgc291cmNlQnVmZmVyUmVhbFtdWzMyXSwKLSAgICAgICAgICAgICAgICAgICAgICAgICBJbnQzMiBzb3VyY2VCdWZmZXJJbWFnW11bMzJdLAotICAgICAgICAgICAgICAgICAgICAgICAgIEludDMyICphbHBoYXJbMl0sCi0gICAgICAgICAgICAgICAgICAgICAgICAgSW50MzIgKmFscGhhaVsyXSwKLSAgICAgICAgICAgICAgICAgICAgICAgICBJbnQzMiAqdl9rX21hc3Rlcik7Ci0KLSAgICB2b2lkIGhpZ2hfZnJlcV9nZW5lcmF0aW9uKEludDMyIHNvdXJjZUJ1ZmZlclJlYWxbXVszMl0sCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICBJbnQzMiBzb3VyY2VCdWZmZXJJbWFnW11bMzJdLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgSW50MzIgKnRhcmdldEJ1ZmZlclJlYWwsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICBJbnQzMiAqdGFyZ2V0QnVmZmVySW1hZywKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEludDMyICphbHBoYXJbMl0sCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICBJbnQzMiAqYWxwaGFpWzJdLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgSW50MzIgKmludkZpbHRCYW5kVGFibGUsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICBJbnQzMiB0YXJnZXRTdG9wQmFuZCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEludDMyIHBhdGNoRGlzdGFuY2UsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICBJbnQzMiBudW1CYW5kc0luUGF0Y2gsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICBJbnQzMiBzdGFydFNhbXBsZSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEludDMyIHNsb3BlTGVuZ3RoLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgSW50MzIgc3RvcFNhbXBsZSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEludDMyICpCd1ZlY3RvciwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEludDMyIHNiclN0YXJ0RnJlcU9mZnNldCk7Ci0KLQotI2VuZGlmC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LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0qLwotCi0vKi0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0KLTsgRlVOQ1RJT04gQ09ERQotLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSovCi0KLXZvaWQgc2JyX2dlbmVyYXRlX2hpZ2hfZnJlcShJbnQzMiBzb3VyY2VCdWZmZXJSZWFsW11bMzJdLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgIEludDMyIHNvdXJjZUJ1ZmZlckltYWdbXVszMl0sCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgSW50MzIgKnRhcmdldEJ1ZmZlclJlYWwsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgSW50MzIgKnRhcmdldEJ1ZmZlckltYWcsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgSU5WRl9NT0RFICppbnZGaWx0TW9kZSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBJTlZGX01PREUgKnByZXZJbnZGaWx0TW9kZSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBJbnQzMiAqaW52RmlsdEJhbmRUYWJsZSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBJbnQzMiBub0ludkZpbHRCYW5kcywKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBJbnQzMiBoaWdoQmFuZFN0YXJ0U2IsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgSW50MzIgICp2X2tfbWFzdGVyLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgIEludDMyIG51bU1hc3RlciwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBJbnQzMiBmcywKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBJbnQzMiAgICpmcmFtZUluZm8sCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgSW50MzIgKmRlZ3JlZUFsaWFzLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgIEludDMyICBzY3JhdGNoX21lbVtdWzY0XSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBJbnQzMiAgQndWZWN0b3JbTUFYX05VTV9QQVRDSEVTXSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBJbnQzMiAgQndWZWN0b3JPbGRbTUFYX05VTV9QQVRDSEVTXSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBzdHJ1Y3QgUEFUQ0ggKlBhdGNoLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgIEludDMyIExDX2ZsYWcsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgSW50MzIgKmhpZ2hCYW5kU3RvcFNiKQotewotICAgIEludDMyICAgIGk7Ci0gICAgSW50MzIgICAgcGF0Y2g7Ci0gICAgSW50MzIgICAgc3RhcnRTYW1wbGU7Ci0gICAgSW50MzIgICAgc3RvcFNhbXBsZTsKLSAgICBJbnQzMiAgICBnb2FsU2I7Ci0gICAgSW50MzIgICAgdGFyZ2V0U3RvcEJhbmQ7Ci0gICAgSW50MzIgICAgc291cmNlU3RhcnRCYW5kOwotICAgIEludDMyICAgIHBhdGNoRGlzdGFuY2U7Ci0gICAgSW50MzIgICAgbnVtQmFuZHNJblBhdGNoOwotICAgIEludDMyICAgIHNiclN0YXJ0RnJlcU9mZnNldDsKLQotICAgIEludDMyICAqYWxwaGFyWzJdOwotICAgIEludDMyICAqYWxwaGFpWzJdOwotCi0gICAgSW50MzIgICAgbHNiID0gdl9rX21hc3RlclswXTsgICAgICAgICAgICAgICAgICAgICAgICAgICAvKiBMb3dlc3Qgc3ViYmFuZCByZWxhdGVkIHRvIHRoZSBzeW50aGVzaXMgZmlsdGVyYmFuayAqLwotICAgIEludDMyICAgIHVzYiA9IHZfa19tYXN0ZXJbbnVtTWFzdGVyXTsgICAgICAgICAgICAgICAgICAgLyogU3RvcCBzdWJiYW5kIHJlbGF0ZWQgdG8gdGhlIHN5bnRoZXNpcyBmaWx0ZXJiYW5rICovCi0gICAgSW50MzIgIHhvdmVyT2Zmc2V0ID0gaGlnaEJhbmRTdGFydFNiIC0gdl9rX21hc3RlclswXTsgLyogQ2FsY3VsYXRlIGRpc3RhbmNlIGluIHN1YmJhbmRzIGJldHdlZW4gazAgYW5kIGt4ICovCi0KLQotCi0gICAgSW50ICAgIHNsb3BlTGVuZ3RoID0gMDsKLQotICAgIEludDMyIGZpcnN0U2xvdE9mZnMgPSBmcmFtZUluZm9bMV07Ci0gICAgSW50MzIgbGFzdFNsb3RPZmZzICA9IGZyYW1lSW5mb1tmcmFtZUluZm9bMF0gKyAxXSAtIDE2OwotCi0KLSAgICBhbHBoYXJbMF0gPSBzY3JhdGNoX21lbVswXTsKLSAgICBhbHBoYXJbMV0gPSBzY3JhdGNoX21lbVsxXTsKLSAgICBhbHBoYWlbMF0gPSBzY3JhdGNoX21lbVsyXTsKLSAgICBhbHBoYWlbMV0gPSBzY3JhdGNoX21lbVszXTsKLQotCi0gICAgc3RhcnRTYW1wbGUgPSAoZmlyc3RTbG90T2ZmcyA8PCAxKTsKLSAgICBzdG9wU2FtcGxlICA9IChsYXN0U2xvdE9mZnMgPDwgMSkgKyAzMjsKLQotCi0gICAgc2JyX2ludl9maWx0X2xldmVsZW1waGFzaXMoaW52RmlsdE1vZGUsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcHJldkludkZpbHRNb2RlLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG5vSW52RmlsdEJhbmRzLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEJ3VmVjdG9yLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEJ3VmVjdG9yT2xkKTsKLQotCi0gICAgaWYgKExDX2ZsYWcgPT0gT04pCi0gICAgewotICAgICAgICAvKiBTZXQgc3ViYmFuZHMgdG8gemVybyAgKi8KLQotICAgICAgICBwdl9tZW1zZXQoKHZvaWQgKikmdGFyZ2V0QnVmZmVyUmVhbFtzdGFydFNhbXBsZSpTQlJfTlVNX0JBTkRTXSwKLSAgICAgICAgICAgICAgICAgIDAsCi0gICAgICAgICAgICAgICAgICAoc3RvcFNhbXBsZSAtIHN0YXJ0U2FtcGxlKSpTQlJfTlVNX0JBTkRTKnNpemVvZih0YXJnZXRCdWZmZXJSZWFsWzBdKSk7Ci0KLSAgICAgICAgaGlnaF9mcmVxX2NvZWZmX0xDKHNvdXJjZUJ1ZmZlclJlYWwsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICBhbHBoYXIsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICBkZWdyZWVBbGlhcywKLSAgICAgICAgICAgICAgICAgICAgICAgICAgIHZfa19tYXN0ZXIsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICBzY3JhdGNoX21lbVs0XSk7Ci0gICAgfQotI2lmZGVmIEhRX1NCUgotICAgIGVsc2UKLSAgICB7Ci0gICAgICAgIC8qIFNldCBzdWJiYW5kcyB0byB6ZXJvICAqLwotCi0gICAgICAgIHB2X21lbXNldCgodm9pZCAqKSZ0YXJnZXRCdWZmZXJSZWFsW3N0YXJ0U2FtcGxlKlNCUl9OVU1fQkFORFNdLAotICAgICAgICAgICAgICAgICAgMCwKLSAgICAgICAgICAgICAgICAgIChzdG9wU2FtcGxlIC0gc3RhcnRTYW1wbGUpKlNCUl9OVU1fQkFORFMqc2l6ZW9mKHRhcmdldEJ1ZmZlclJlYWxbMF0pKTsKLSAgICAgICAgcHZfbWVtc2V0KCh2b2lkICopJnRhcmdldEJ1ZmZlckltYWdbc3RhcnRTYW1wbGUqU0JSX05VTV9CQU5EU10sCi0gICAgICAgICAgICAgICAgICAwLAotICAgICAgICAgICAgICAgICAgKHN0b3BTYW1wbGUgLSBzdGFydFNhbXBsZSkqU0JSX05VTV9CQU5EUypzaXplb2YodGFyZ2V0QnVmZmVySW1hZ1swXSkpOwotCi0gICAgICAgIGhpZ2hfZnJlcV9jb2VmZihzb3VyY2VCdWZmZXJSZWFsLAotICAgICAgICAgICAgICAgICAgICAgICAgc291cmNlQnVmZmVySW1hZywKLSAgICAgICAgICAgICAgICAgICAgICAgIGFscGhhciwKLSAgICAgICAgICAgICAgICAgICAgICAgIGFscGhhaSwKLSAgICAgICAgICAgICAgICAgICAgICAgIHZfa19tYXN0ZXIpOwotCi0gICAgfQotI2VuZGlmICAgICAvKiAgI2lmZGVmIEhRX1NCUiAqLwotCi0KLQotCi0gICAgLyoKLSAgICAgKiBJbml0aWFsaXplIHRoZSBwYXRjaGluZyBwYXJhbWV0ZXIKLSAgICAgKi8KLSAgICBzd2l0Y2ggKGZzKQotCi0gICAgewotICAgICAgICAgICAgLyoKLSAgICAgICAgICAgICAqICBnb2FsU2IgPSAoaW50KSggMi4wNDhlNmYgLyBmcyArIDAuNWYgKTsKLSAgICAgICAgICAgICAqLwotICAgICAgICBjYXNlIDQ4MDAwOgotICAgICAgICAgICAgZ29hbFNiID0gNDM7ICAvKiAxNiBrSHogYmFuZCAqLwotICAgICAgICAgICAgYnJlYWs7Ci0gICAgICAgIGNhc2UgMzIwMDA6Ci0gICAgICAgICAgICBnb2FsU2IgPSA2NDsgIC8qIDE2IGtIeiBiYW5kICovCi0gICAgICAgICAgICBicmVhazsKLSAgICAgICAgY2FzZSAyNDAwMDoKLSAgICAgICAgICAgIGdvYWxTYiA9IDg1OyAgLyogMTYga0h6IGJhbmQgKi8KLSAgICAgICAgICAgIGJyZWFrOwotICAgICAgICBjYXNlIDIyMDUwOgotICAgICAgICAgICAgZ29hbFNiID0gOTM7ICAvKiAxNiBrSHogYmFuZCAqLwotICAgICAgICAgICAgYnJlYWs7Ci0gICAgICAgIGNhc2UgMTYwMDA6Ci0gICAgICAgICAgICBnb2FsU2IgPSAxMjg7ICAvKiA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ICAgICAgICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgICAgICAgICBpLS07Ci0gICAgICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICB9Ci0gICAgICAgICAgICBlbHNlCi0gICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgaSA9IDA7Ci0gICAgICAgICAgICB9Ci0gICAgICAgICAgICBudW1CYW5kc0luUGF0Y2ggPSAgdl9rX21hc3RlcltpXSAtIHRhcmdldFN0b3BCYW5kOwotICAgICAgICB9Ci0KLSAgICAgICAgLyogZGVzaXJlZCBudW1iZXIgYmFuZHMgYXJlIGF2YWlsYWJsZSAtPiBnZXQgdGhlIG1pbmltYWwgZXZlbiBwYXRjaGluZyBkaXN0YW5jZSAqLwotICAgICAgICBwYXRjaERpc3RhbmNlICAgPSBudW1CYW5kc0luUGF0Y2ggKyB0YXJnZXRTdG9wQmFuZCAtIGxzYjsgIC8qIGdldCBtaW5pbWFsIGRpc3RhbmNlICovCi0gICAgICAgIHBhdGNoRGlzdGFuY2UgICA9IChwYXRjaERpc3RhbmNlICsgMSkgJiB+MTsgICAgICAgICAgICAgICAgLyogcm91bmRpbmcgdXAgb2RkIG51bWJlcnMgYW5kIG1ha2UgYWxsIGV2ZW4gKi8KLQotICAgICAgICAvKiBBbGwgcGF0Y2hlcyBidXQgZmlyc3QgKi8KLSAgICAgICAgc291cmNlU3RhcnRCYW5kID0gMTsKLQotICAgICAgICAvKiBDaGVjayBpZiB3ZSBhcmUgY2xvc2UgdG8gZ29hbFNiICovCi0gICAgICAgIGlmIChnb2FsU2IgLSAodGFyZ2V0U3RvcEJhbmQgKyBudW1CYW5kc0luUGF0Y2gpIDwgMykKLSAgICAgICAgeyAvKiBNUEVHIGRvYyAqLwotICAgICAgICAgICAgZ29hbFNiID0gdXNiOwotICAgICAgICB9Ci0KLQotICAgICAgICBpZiAoKG51bUJhbmRzSW5QYXRjaCA8IDMpICYmIChwYXRjaCA+IDApKQotICAgICAgICB7Ci0gICAgICAgICAgICBpZiAoTENfZmxhZyA9PSBPTikKLSAgICAgICAgICAgIHsKLQotICAgICAgICAgICAgICAgIHB2X21lbXNldCgodm9pZCAqKSAmZGVncmVlQWxpYXNbdGFyZ2V0U3RvcEJhbmRdLCAwLCBudW1CYW5kc0luUGF0Y2gqc2l6ZW9mKCpkZWdyZWVBbGlhcykpOwotICAgICAgICAgICAgfQotICAgICAgICAgICAgYnJlYWs7Ci0gICAgICAgIH0KLQotICAgICAgICBpZiAobnVtQmFuZHNJblBhdGNoIDw9IDApCi0gICAgICAgIHsKLSAgICAgICAgICAgIGNvbnRpbnVlOwotICAgICAgICB9Ci0KLQotICAgICAgICAvKgotICAgICAgICAgKiAgSGlnaCBGcmVxdWVuY3kgZ2VuZXJhdGlvbgotICAgICAgICAgKi8KLQotICAgICAgICBpZiAoTENfZmxhZyA9PSBPTikKLSAgICAgICAgewotCi0gICAgICAgICAgICBoaWdoX2ZyZXFfZ2VuZXJhdGlvbl9MQyhzb3VyY2VCdWZmZXJSZWFsLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKEludDMyICopdGFyZ2V0QnVmZmVyUmVhbCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGFscGhhciwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRlZ3JlZUFsaWFzLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaW52RmlsdEJhbmRUYWJsZSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRhcmdldFN0b3BCYW5kLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcGF0Y2hEaXN0YW5jZSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG51bUJhbmRzSW5QYXRjaCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHN0YXJ0U2FtcGxlLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2xvcGVMZW5ndGgsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzdG9wU2FtcGxlLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgQndWZWN0b3IsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzYnJTdGFydEZyZXFPZmZzZXQpOwotCi0gICAgICAgIH0KLSNpZmRlZiBIUV9TQlIKLSAgICAgICAgZWxzZQotICAgICAgICB7Ci0KLSAgICAgICAgICAgIGhpZ2hfZnJlcV9nZW5lcmF0aW9uKHNvdXJjZUJ1ZmZlclJlYWwsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzb3VyY2VCdWZmZXJJbWFnLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKEludDMyICopdGFyZ2V0QnVmZmVyUmVhbCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChJbnQzMiAqKXRhcmdldEJ1ZmZlckltYWcsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBhbHBoYXIsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBhbHBoYWksCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpbnZGaWx0QmFuZFRhYmxlLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdGFyZ2V0U3RvcEJhbmQsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwYXRjaERpc3RhbmNlLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbnVtQmFuZHNJblBhdGNoLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc3RhcnRTYW1wbGUsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzbG9wZUxlbmd0aCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHN0b3BTYW1wbGUsCi0gICAgICAgICAgICAgICAgICAgICAgICA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TIGFjOwotICAgIHN0cnVjdCBpbnRnX2RpdiAgcXVvdGllbnQ7Ci0KLSAgICBJbnQzMiB0ZW1wMTsKLSAgICBJbnQzMiB0ZW1wMjsKLSAgICBJbnQzMiB0ZW1wMzsKLSAgICBJbnQzMiBhdXRvQ29yckxlbmd0aDsKLSAgICBJbnQzMiBsb0JhbmQ7Ci0KLSAgICBrMSA9IHNjcmF0Y2hfbWVtOwotCi0KLSAgICBhdXRvQ29yckxlbmd0aCA9IDM4OwotCi0gICAgZm9yIChsb0JhbmQgPSAxOyBsb0JhbmQgPCB2X2tfbWFzdGVyWzBdOyBsb0JhbmQrKykKLSAgICB7Ci0KLSAgICAgICAgY2FsY19hdXRvX2NvcnJfTEMoJmFjLAotICAgICAgICAgICAgICAgICAgICAgICAgICBzb3VyY2VCdWZmZXJSZWFsLAotICAgICAgICAgICAgICAgICAgICAgICAgICBsb0JhbmQsCi0gICAgICAgICAgICAgICAgICAgICAgICAgIGF1dG9Db3JyTGVuZ3RoKTsKLQotICAgICAgICBpZiAoYWMucjExciAmJiBhYy5kZXQpCi0gICAgICAgIHsKLQotICAgICAgICAgICAgcHZfZGl2KGFjLnIwMXIsIGFjLnIxMXIsICZxdW90aWVudCk7Ci0KLSAgICAgICAgICAgIGZhYyA9IC0ocXVvdGllbnQucXVvdGllbnQgPj4gMik7ICAgLyogIFEyOCAqLwotCi0gICAgICAgICAgICBpZiAocXVvdGllbnQuc2hpZnRfZmFjdG9yID4gMCkKLSAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICBmYWMgPj49IHF1b3RpZW50LnNoaWZ0X2ZhY3RvcjsgICAgLyogUTI4ICovCi0gICAgICAgICAgICB9Ci0gICAgICAgICAgICBlbHNlIGlmIChxdW90aWVudC5zaGlmdF9mYWN0b3IgPCAwKQotICAgICAgICAgICAgewotICAgICAgICAgICAgICAgIGlmIChxdW90aWVudC5zaGlmdF9mYWN0b3IgPiAtNCkgICAgIC8qIHxmYWN8IDwgOCAqLwotICAgICAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAgICAgZmFjIDw8PSAoLXF1b3RpZW50LnNoaWZ0X2ZhY3Rvcik7IC8qIFEyOCAqLwotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICBlbHNlCi0gICAgICAgICAgICAgICAgewotICAgICAgICAgICAgICAgICAgICBmYWMgPSAweDgwMDAwMDAwOyAgICAgLyogb3ZlcnNob290IHBvc3NpYmxlIGZhYyA9IC04ICovCi0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgfQotCi0gICAgICAgICAgICAvKgotICAgICAgICAgICAgICogIHByZXZlbnQgZm9yIG92ZXJmbG93IG9mIHJlZmxlY3Rpb24gY29lZmZpY2llbnRzCi0gICAgICAgICAgICAgKi8KLSAgICAgICAgICAgIGlmIChxdW90aWVudC5zaGlmdF9mYWN0b3IgPiAwKQotICAgICAgICAgICAgewotICAgICAgICAgICAgICAgIGsxW2xvQmFuZF0gPSAtIHF1b3RpZW50LnF1b3RpZW50ID4+IHF1b3RpZW50LnNoaWZ0X2ZhY3RvcjsKLSAgICAgICAgICAgIH0KLSAgICAgICAgICAgIGVsc2UgaWYgKHF1b3RpZW50LnNoaWZ0X2ZhY3RvciA9PSAwKQotICAgICAgICAgICAgewotICAgICAgICAgICAgICAgIGlmIChxdW90aWVudC5xdW90aWVudCA+PSAweDQwMDAwMDAwKQotICAgICAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAgICAgazFbbG9CYW5kXSA9IChJbnQzMikweEMwMDAwMDAwOyAgIC8qIC0xLjAgaW4gUTMwICAqLwotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICBlbHNlIGlmIChxdW90aWVudC5xdW90aWVudCA8PSAoSW50MzIpMHhDMDAwMDAwMCkKLSAgICAgICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgICAgIGsxW2xvQmFuZF0gPSAweDQwMDAwMDAwOyAgIC8qICAxLjAgaW4gUTMwICAqLwotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICBlbHNlCi0gICAgICAgICAgICAgICAgewotICAgICAgICAgICAgICAgICAgICBrMVtsb0JhbmRdID0gLXF1b3RpZW50LnF1b3RpZW50OwotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgIH0KLSAgICAgICAgICAgIGVsc2UKLSAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICBpZiAocXVvdGllbnQucXVvdGllbnQgPiAwKQotICAgICAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAgICAgazFbbG9CYW5kXSA9IChJbnQzMikweEMwMDAwMDAwOyAgIC8qIC0xLjAgaW4gUTMwICAqLwotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICBlbHNlCi0gICAgICAgICAgICAgICAgewotICAgICAgICAgICAgICAgICAgICBrMVtsb0JhbmRdID0gMHg0MDAwMDAwMDsgICAvKiAgMS4wIGluIFEzMCAgKi8KLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICB9Ci0gICAgICAgICAgICAvKgotICAgICAgICAgICAgICogICBhbHBoYXJbMV1bbG9CYW5kXSA9ICggYWMucjAxciAqIGFjLnIxMnIgLSBhYy5yMDJyICogYWMucjExciApIC8gYWMuZGV0OwotICAgICAgICAgICAgICovCi0KLSAgICAgICAgICAgIHRlbXAxICA9IC1meHBfbXVsMzJfUTMwKGFjLnIwMnIsIGFjLnIxMXIpOwotICAgICAgICAgICAgdGVtcDEgID0gIGZ4cF9tYWMzMl9RMzAoYWMucjAxciwgYWMucjEyciwgdGVtcDEpOwotCi0gICAgICAgICAgICB0ZW1wMiA9IGFjLmRldDsKLSAgICAgICAgICAgIHRlbXAzID0gdGVtcDEgPiAwID8gdGVtcDEgOiAtdGVtcDE7Ci0gICAgICAgICAgICB0ZW1wMiA9IHRlbXAyID4gMCA/IHRlbXAyIDogLXRlbXAyOwotCi0gICAgICAgICAgICAvKiBwcmV2ZW50IGZvciBzaG9vdG92ZXJzICovCi0gICAgICAgICAgICBpZiAoKHRlbXAzID4+IDIpID49IHRlbXAyIHx8IGZhYyA9PSAoSW50MzIpMHg4MDAwMDAwMCkKLSAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICBhbHBoYXJbMF1bbG9CYW5kXSA9IDA7Ci0gICAgICAgICAgICAgICAgYWxwaGFyWzFdW2xvQmFuZF0gPSAwOwotICAgICAgICAgICAgfQotICAgICAgICAgICAgZWxzZQotICAgICAgICAgICAgewotICAgICAgICAgICAgICAgIHB2X2Rpdih0ZW1wMSwgYWMuZGV0LCAmcXVvdGllbnQpOwotICAgICAgICAgICAgICAgIC8qCi0gICAgICAgICAgICAgICAgICogIGFscGhhclsxXVtsb0JhbmRdIGlzIGxlc3NlciB0aGFuIDQuMAotICAgICAgICAgICAgICAgICAqLwotICAgICAgICAgICAgICAgIGFscGhhclsxXVtsb0JhbmRdID0gcXVvdGllbnQucXVvdGllbnQ7Ci0gICAgICAgICAgICAgICAgcXVvdGllbnQuc2hpZnRfZmFjdG9yICs9IDI7ICAgICAgICAgICAgIC8qIFEyOCAqLwotCi0gICAgICAgICAgICAgICAgaWYgKHF1b3RpZW50LnNoaWZ0X2ZhY3RvciA+IDApCi0gICAgICAgICAgICAgICAgewotICAgICAgICAgICAgICAgICAgICBhbHBoYXJbMV1bbG9CYW5kXSA+Pj0gcXVvdGllbnQuc2hpZnRfZmFjdG9yOyAgICAvKiBRMjggKi8KLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgZWxzZSBpZiAocXVvdGllbnQuc2hpZnRfZmFjdG9yIDwgMCkgICAgIC8qIGF0IHRoaXMgcG9pbnQgY2FuIG9ubHkgYmUgLTEgKi8KLSAgICAgICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgICAgIGFscGhhclsxXVtsb0JhbmRdIDw8PSAoLXF1b3RpZW50LnNoaWZ0X2ZhY3Rvcik7IC8qIFEyOCAqLwotICAgICAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgICAgIC8qCi0gICAgICAgICAgICAgICAgICogIGFscGhhclswXVtsb0JhbmRdID0gLSAoIGFjLnIwMXIgKyBhbHBoYXJbMV1bbG9CYW5kXSAqIGFjLnIxMnIgKSAvIGFjLnIxMXI7Ci0gICAgICAgICAgICAgICAgICovCi0KLSAgICAgICAgICAgICAgICBwdl9kaXYoYWMucjEyciwgYWMucjExciwgJnF1b3RpZW50KTsKLQotICAgICAgICAgICAgICAgIHRlbXAzID0gKHF1b3RpZW50LnF1b3RpZW50ID4+IDIpOyAgICAgICAvKiAgUTI4ICovCi0KLSAgICAgICAgICAgICAgICBpZiAocXVvdGllbnQuc2hpZnRfZmFjdG9yID4gMCkKLSAgICAgICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgICAgIHRlbXAzID4+PSBxdW90aWVudC5zaGlmdF9mYWN0b3I7ICAgIC8qIFEyOCAqLwotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICBlbHNlIGlmIChxdW90aWVudC5zaGlmdF9mYWN0b3IgPCAwKQotICAgICAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAgICAgdGVtcDMgPDw9ICgtcXVvdGllbnQuc2hpZnRfZmFjdG9yKTsgLyogUTI4ICovCi0gICAgICAgICAgICAgICAgfQotCi0gICAgICAgICAgICAgICAgYWxwaGFyWzBdW2xvQmFuZF0gPSBmYWMgLSBmeHBfbXVsMzJfUTI4KGFscGhhclsxXVtsb0JhbmRdLCB0ZW1wMykgOyAgICAvKiBRMjggKi8KLQotICAgICAgICAgICAgICAgIGlmICgoYWxwaGFyWzBdW2xvQmFuZF0gPj0gMHg0MDAwMDAwMCkgfHwgKGFscGhhclswXVtsb0JhbmRdIDw9IChJbnQzMikweEMwMDAwMDAwKSkKLSAgICAgICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgICAgIGFscGhhclswXVtsb0JhbmRdID0gMDsKLSAgICAgICAgICAgICAgICAgICAgYWxwaGFyWzFdW2xvQmFuZF0gPSAwOwotICAgICAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgfQotCi0gICAgICAgIH0KLSAgICAgICAgZWxzZQotICAgICAgICB7Ci0gICAgICAgICAgICBhbHBoYXJbMF1bbG9CYW5kXSA9IDA7Ci0gICAgICAgICAgICBhbHBoYXJbMV1bbG9CYW5kXSA9IDA7Ci0KLSAgICAgICAgICAgIGsxW2xvQmFuZF0gPSAwOwotICAgICAgICB9Ci0KLSAgICB9Ci0KLSAgICBrMVswXSA9IDA7Ci0gICAgZGVncmVlQWxpYXNbMV0gPSAwOwotICAgIGZvciAobG9CYW5kID0gMjsgbG9CYW5kIDwgdl9rX21hc3RlclswXTsgbG9CYW5kKyspCi0gICAgewotICAgICAgICBkZWdyZWVBbGlhc1tsb0JhbmRdID0gMDsKLSAgICAgICAgaWYgKCghKGxvQmFuZCAmIDEpKSAmJiAoazFbbG9CYW5kXSA8IDApKQotICAgICAgICB7Ci0gICAgICAgICAgICBpZiAoazFbbG9CYW5kLTFdIDwgMCkKLSAgICAgICAgICAgIHsgLy8gMi1DSCBBbGlhc2luZyBEZXRlY3Rpb24KLSAgICAgICAgICAgICAgICBkZWdyZWVBbGlhc1tsb0JhbmRdICAgPSAweDQwMDAwMDAwOwotICAgICAgICAgICAgICAgIGlmIChrMVtsb0JhbmQtMl0gPiAwKQotICAgICAgICAgICAgICAgIHsgLy8gMy1DSCBBbGlhc2luZyBEZXRlY3Rpb24KLSAgICAgICAgICAgICAgICAgICAgZGVncmVlQWxpYXNbbG9CYW5kLTFdID0gMHg0MDAwMDAwMCAtIGZ4cF9tdWwzMl9RMzAoazFbbG9CYW5kLTFdLCBrMVtsb0JhbmQtMV0pOwotCi0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgfQotICAgICAgICAgICAgZWxzZSBpZiAoazFbbG9CYW5kLTJdID4gMCkKLSAgICAgICAgICAgIHsgLy8gMy1DSCBBbGlhc2luZyBEZXRlY3Rpb24KLSAgICAgICAgICAgICAgICBkZWdyZWVBbGlhc1tsb0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LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSovCi0KLXZvaWQgaGlnaF9mcmVxX2dlbmVyYXRpb25fTEMoSW50MzIgc291cmNlQnVmZmVyUmVhbFtdWzMyXSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgSW50MzIgKnRhcmdldEJ1ZmZlclJlYWwsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgIEludDMyICphbHBoYXJbMl0sCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgIEludDMyICpkZWdyZWVBbGlhcywKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgSW50MzIgKmludkZpbHRCYW5kVGFibGUsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgIEludDMyIHRhcmdldFN0b3BCYW5kLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICBJbnQzMiBwYXRjaERpc3RhbmNlLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICBJbnQzMiBudW1CYW5kc0luUGF0Y2gsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgIEludDMyIHN0YXJ0U2FtcGxlLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICBJbnQzMiBzbG9wZUxlbmd0aCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgSW50MzIgc3RvcFNhbXBsZSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgSW50MzIgKkJ3VmVjdG9yLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICBJbnQzMiBzYnJTdGFydEZyZXFPZmZzZXQpCi17Ci0KLSAgICBJbnQzMiAgdGVtcDE7Ci0gICAgSW50MzIgIHRlbXAyOwotICAgIEludDMyICB0ZW1wMzsKLQotCi0gICAgSW50MzIgIGEwcjsKLSAgICBJbnQzMiAgYTFyOwotICAgIEludDMyICBpOwotICAgIEludDMyICBidzsKLSAgICBJbnQzMiAgaGlCYW5kOwotICAgIEludDMyICBid0luZGV4OwotICAgIEludDMyICBsb0JhbmQ7Ci0gICAgSW50MzIgIGo7Ci0KLSAgICBid0luZGV4ID0gMDsKLQotICAgIGZvciAoaGlCYW5kID0gdGFyZ2V0U3RvcEJhbmQ7IGhpQmFuZCA8IHRhcmdldFN0b3BCYW5kICsgbnVtQmFuZHNJblBhdGNoOyBoaUJhbmQrKykKLSAgICB7Ci0gICAgICAgIGxvQmFuZCA9IGhpQmFuZCAtIHBhdGNoRGlzdGFuY2U7Ci0KLSAgICAgICAgaWYgKGhpQmFuZCAhPSB0YXJnZXRTdG9wQmFuZCkKLSAgICAgICAgewotICAgICAgICAgICAgZGVncmVlQWxpYXNbaGlCYW5kXSA9IGRlZ3JlZUFsaWFzW2xvQmFuZF07Ci0gICAgICAgIH0KLSAgICAgICAgZWxzZQotICAgICAgICB7Ci0gICAgICAgICAgICBkZWdyZWVBbGlhc1toaUJhbmRdID0gMDsKLSAgICAgICAgfQotCi0gICAgICAgIHdoaWxlIChoaUJhbmQgPj0gaW52RmlsdEJhbmRUYWJsZVtid0luZGV4XSkKLSAgICAgICAgewotICAgICAgICAgICAgYndJbmRleCsrOwotICAgICAgICB9Ci0KLSAgICAgICAgYncgPSBCd1ZlY3Rvcltid0luZGV4XTsKLQotICAgICAgICAvKgotICAgICAgICAgKiAgSW52ZXJzZSBGaWx0ZXJpbmcKLSAgICAgICAgICovCi0KLQotICAgICAgICBqID0gaGlCYW5kIC0gc2JyU3RhcnRGcmVxT2Zmc2V0OwotCi0gICAgICAgIGlmIChidyA+IDAgJiYgKGFscGhhclswXVtsb0JhbmRdIHwgYWxwaGFyWzFdW2xvQmFuZF0pKQotICAgICAgICB7Ci0gICAgICAgICAgICAvKiBBcHBseSBjdXJyZW50IGJhbmR3aWR0aCBleHBhbnNpb24gZmFjdG9yICovCi0gICAgICAgICAgICBhMHIgPSBmeHBfbXVsMzJfUTI5KGJ3LCBhbHBoYXJbMF1bbG9CYW5kXSk7Ci0KLSAgICAgIC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VtcDByOwotICAgIEludDMyICB0ZW1wMGk7Ci0gICAgSW50MzIgIGxvQmFuZDsKLQotICAgIHN0cnVjdCBBQ09SUl9DT0VGUyBhYzsKLSAgICBzdHJ1Y3QgaW50Z19kaXYgIHF1b3RpZW50OwotCi0gICAgSW50MzIgYXV0b0NvcnJMZW5ndGg7Ci0KLSAgICBhdXRvQ29yckxlbmd0aCA9IDM4OwotCi0gICAgZm9yIChsb0JhbmQgPSAxOyBsb0JhbmQgPCB2X2tfbWFzdGVyWzBdOyBsb0JhbmQrKykKLSAgICB7Ci0KLSAgICAgICAgY2FsY19hdXRvX2NvcnIoJmFjLAotICAgICAgICAgICAgICAgICAgICAgICBzb3VyY2VCdWZmZXJSZWFsLAotICAgICAgICAgICAgICAgICAgICAgICBzb3VyY2VCdWZmZXJJbWFnLAotICAgICAgICAgICAgICAgICAgICAgICBsb0JhbmQsCi0gICAgICAgICAgICAgICAgICAgICAgIGF1dG9Db3JyTGVuZ3RoKTsKLQotCi0gICAgICAgIG92ZXJmbG93X2ZsYWcgPSAwOwotCi0gICAgICAgIGlmIChhYy5kZXQgPCAxKQotICAgICAgICB7Ci0gICAgICAgICAgICAvKiAtLS0gICovCi0gICAgICAgICAgICB0ZW1wMXIgPSAwOwotICAgICAgICAgICAgdGVtcDFpID0gMDsKLSAgICAgICAgICAgIGFscGhhclsxXVtsb0JhbmRdID0gMDsKLSAgICAgICAgICAgIGFscGhhaVsxXVtsb0JhbmRdID0gMDsKLQotICAgICAgICB9Ci0gICAgICAgIGVsc2UKLSAgICAgICAgewotCi0gICAgICAgICAgICB0ZW1wMXIgPSAgZnhwX211bDMyX1EyOShhYy5yMDFyLCBhYy5yMTJyKTsKLSAgICAgICAgICAgIHRlbXAxciA9ICBmeHBfbXN1MzJfUTI5KGFjLnIwMWksIGFjLnIxMmksIHRlbXAxcik7Ci0gICAgICAgICAgICB0ZW1wMXIgPSAgZnhwX21zdTMyX1EyOShhYy5yMDJyLCBhYy5yMTFyLCB0ZW1wMXIpOwotCi0gICAgICAgICAgICB0ZW1wMWkgPSAgZnhwX211bDMyX1EyOShhYy5yMDFyLCBhYy5yMTJpKTsKLSAgICAgICAgICAgIHRlbXAxaSA9ICBmeHBfbXN1MzJfUTI5KGFjLnIwMmksIGFjLnIxMXIsIHRlbXAxaSk7Ci0gICAgICAgICAgICB0ZW1wMWkgPSAgZnhwX21hYzMyX1EyOShhYy5yMDFpLCBhYy5yMTJyLCB0ZW1wMWkpOwotCi0gICAgICAgICAgICBwdl9kaXYodGVtcDFyLCBhYy5kZXQsICZxdW90aWVudCk7Ci0gICAgICAgICAgICBvdmVyZmxvd19mbGFnID0gKHF1b3RpZW50LnNoaWZ0X2ZhY3RvciA8IC0yKSA/IDEgOiAwOwotICAgICAgICAgICAgdGVtcDFyID0gcXVvdGllbnQucXVvdGllbnQgPj4gKDIgKyBxdW90aWVudC5zaGlmdF9mYWN0b3IpOyAgIC8qICBRMjggKi8KLSAgICAgICAgICAgIHB2X2Rpdih0ZW1wMWksIGFjLmRldCwgJnF1b3RpZW50KTsKLSAgICAgICAgICAgIG92ZXJmbG93X2ZsYWcgPSAocXVvdGllbnQuc2hpZnRfZmFjdG9yIDwgLTIpID8gMSA6IDA7Ci0gICAgICAgICAgICB0ZW1wMWkgPSBxdW90aWVudC5xdW90aWVudCA+PiAoMiArIHF1b3RpZW50LnNoaWZ0X2ZhY3Rvcik7ICAgLyogIFEyOCAqLwotCi0gICAgICAgICAgICBhbHBoYXJbMV1bbG9CYW5kXSA9IHRlbXAxcjsKLSAgICAgICAgICAgIGFscGhhaVsxXVtsb0JhbmRdID0gdGVtcDFpOwotCi0gICAgICAgIH0KLQotICAgICAgICBpZiAoYWMucjExciA9PSAwKQotICAgICAgICB7Ci0gICAgICAgICAgICB0ZW1wMHIgPSAwOwotICAgICAgICAgICAgdGVtcDBpID0gMDsKLSAgICAgICAgICAgIGFscGhhclswXVtsb0JhbmRdID0gMDsKLSAgICAgICAgICAgIGFscGhhaVswXVtsb0JhbmR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JJbWFnLAotICAgICAgICAgICAgICAgICAgICAgICAgICBJbnQzMiAqYWxwaGFyWzJdLAotICAgICAgICAgICAgICAgICAgICAgICAgICBJbnQzMiAqYWxwaGFpWzJdLAotICAgICAgICAgICAgICAgICAgICAgICAgICBJbnQzMiAqaW52RmlsdEJhbmRUYWJsZSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgSW50MzIgdGFyZ2V0U3RvcEJhbmQsCi0gICAgICAgICAgICAgICAgICAgICAgICAgIEludDMyIHBhdGNoRGlzdGFuY2UsCi0gICAgICAgICAgICAgICAgICAgICAgICAgIEludDMyIG51bUJhbmRzSW5QYXRjaCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgSW50MzIgc3RhcnRTYW1wbGUsCi0gICAgICAgICAgICAgICAgICAgICAgICAgIEludDMyIHNsb3BlTGVuZ3RoLAotICAgICAgICAgICAgICAgICAgICAgICAgICBJbnQzMiBzdG9wU2FtcGxlLAotICAgICAgICAgICAgICAgICAgICAgICAgICBJbnQzMiAqQndWZWN0b3IsCi0gICAgICAgICAgICAgICAgICAgICAgICAgIEludDMyIHNiclN0YXJ0RnJlcU9mZnNldCkKLXsKLSAgICBJbnQzMiAgdGVtcDFfcjsKLSAgICBJbnQzMiAgdGVtcDJfcjsKLSAgICBJbnQzMiAgdGVtcDNfcjsKLSAgICBJbnQzMiAgdGVtcDFfaTsKLSAgICBJbnQzMiAgdGVtcDJfaTsKLSAgICBJbnQzMiAgdGVtcDNfaTsKLQotCi0gICAgSW50MzIgIGEwaTsKLSAgICBJbnQzMiAgYTFpOwotICAgIEludDMyICBhMHI7Ci0gICAgSW50MzIgIGExcjsKLSAgICBJbnQzMiAgaTsKLSAgICBJbnQzMiAgYnc7Ci0gICAgSW50MzIgIGhpQmFuZDsKLSAgICBJbnQzMiAgYndJbmRleDsKLSAgICBJbnQzMiAgbG9CYW5kOwotICAgIEludDMyICBqOwotCi0KLQotICAgIGludDY0X3QgdG1wOwotCi0gICAgYndJbmRleCA9ID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F9tYWM2NF9RMzEoKChpbnQ2NF90KXRlbXAxX2kgPDwgMjgpLCAgYTBpLCB0ZW1wMl9yKTsKLSAgICAgICAgICAgICAgICB0bXAgPSAgZnhwX21hYzY0X1EzMSh0bXAsICBhMHIsIHRlbXAyX2kpOwotICAgICAgICAgICAgICAgIHRtcCA9ICBmeHBfbWFjNjRfUTMxKHRtcCwgIGExaSwgdGVtcDNfcik7Ci0gICAgICAgICAgICAgICAgdGFyZ2V0QnVmZmVySW1hZ1tqXSA9IChJbnQzMikoZnhwX21hYzY0X1EzMSh0bXAsICBhMXIsIHRlbXAzX2kpID4+IDI4KTsKLQotICAgICAgICAgICAgICAgIGkrKzsKLSAgICAgICAgICAgICAgICBqICs9IFNCUl9OVU1fQkFORFM7Ci0KLSAgICAgICAgICAgICAgICB0ZW1wM19yICA9IHRlbXAyX3I7Ci0gICAgICAgICAgICAgICAgdGVtcDJfciAgPSB0ZW1wMV9yOwotICAgICAgICAgICAgICAgIHRlbXAxX3IgID0gc291cmNlQnVmZmVyUmVhbFtpIF1bbG9CYW5kXTsKLQotICAgICAgICAgICAgICAgIHRlbXAzX2kgID0gdGVtcDJfaTsKLSAgICAgICAgICAgICAgICB0ZW1wMl9pICA9IHRlbXAxX2k7Ci0gICAgICAgICAgICAgICAgdGVtcDFfaSAgPSBzb3VyY2VCdWZmZXJJbWFnW2kgXVtsb0JhbmRdOwotCi0gICAgICAgICAgICB9Ci0KLSAgICAgICAgfQotCi0KLQotICAgICAgICBlbHNlCi0gICAgICAgIHsKLSAgICAgICAgICAgIGkgPSBzdGFydFNhbXBsZSArIHNsb3BlTGVuZ3RoOwotICAgICAgICAgICAgaiArPSBpICogU0JSX05VTV9CQU5EUzsKLQotICAgICAgICAgICAgZm9yICg7IGkgPCBzdG9wU2FtcGxlICsgc2xvcGVMZW5ndGg7IGkrKykKLSAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICB0YXJnZXRCdWZmZXJSZWFsW2pdID0gc291cmNlQnVmZmVy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qICAgIFNlbGVjdCBodWZmbWFuIGNvZGVib29rIGRlcGVuZGluZyBvbiBjb3VwbGluZyBtb2RlIGFuZCBhbXBsaXR1ZGUgcmVzb2x1dGlvbgotICAgICAqLwotICAgIGlmIChjb3VwbGluZyA9PSBDT1VQTElOR19CQUwpCi0gICAgewotICAgICAgICBlbnZEYXRhVGFibGVDb21wRmFjdG9yID0gMTsKLSAgICAgICAgaWYgKGFtcFJlcyA9PSBTQlJfQU1QX1JFU18xXzUpCi0gICAgICAgIHsKLSAgICAgICAgICAgIGhjYl90ID0gYm9va1NickVudkJhbGFuY2UxMFQ7Ci0gICAgICAgICAgICBoY2JfZiA9IGJvb2tTYnJFbnZCYWxhbmNlMTBGOwotICAgICAgICB9Ci0gICAgICAgIGVsc2UKLSAgICAgICAgewotICAgICAgICAgICAgaGNiX3QgPSBib29rU2JyRW52QmFsYW5jZTExVDsKLSAgICAgICAgICAgIGhjYl9mID0gYm9va1NickVudkJhbGFuY2UxMUY7Ci0gICAgICAgIH0KLSAgICB9Ci0gICAgZWxzZQotICAgIHsKLSAgICAgICAgZW52RGF0YVRhYmxlQ29tcEZhY3RvciA9IDA7Ci0gICAgICAgIGlmIChhbXBSZXMgPT0gU0JSX0FNUF9SRVNfMV81KQotICAgICAgICB7Ci0gICAgICAgICAgICBoY2JfdCA9IGJvb2tTYnJFbnZMZXZlbDEwVDsKLSAgICAgICAgICAgIGhjYl9mID0gYm9va1NickVudkxldmVsMTBGOwotICAgICAgICB9Ci0gICAgICAgIGVsc2UKLSAgICAgICAgewotICAgICAgICAgICAgaGNiX3QgPSBib29rU2JyRW52TGV2ZWwxMVQ7Ci0gICAgICAgICAgICBoY2JfZiA9IGJvb2tTYnJFbnZMZXZlbDExRjsKLSAgICAgICAgfQotICAgIH0KLQotICAgIC8qCi0gICAgICogICAgTm93IHJlYWQgcmF3IGVudmVsb3BlIGRhdGEKLSAgICAgKi8KLSAgICBmb3IgKGogPSAwOyBqIDwgaF9mcmFtZV9kYXRhLT5mcmFtZUluZm9bMF07IGorKykKLSAgICB7Ci0gICAgICAgIGlmIChoX2ZyYW1lX2RhdGEtPmRvbWFpbl92ZWMxW2pdID09IEZSRVEpCi0gICAgICAgIHsKLSAgICAgICAgICAgIGlmIChjb3VwbGluZyA9PSBDT1VQTElOR19CQUwpCi0gICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgdG1wID0gYnVmX2dldGJpdHMoaEJpdEJ1Ziwgc3RhcnRfYml0c19iYWxhbmNlKTsKLSAgICAgICAgICAgICAgICBoX2ZyYW1lX2RhdGEtPmlFbnZlbG9wZV9tYW5bb2Zmc2V0XSA9IHRtcCA8PCBlbnZEYXRhVGFibGVDb21wRmFjdG9yOwotICAgICAgICAgICAgfQotICAgICAgICAgICAgZWxzZQotICAgICAgICAgICAgewotICAgICAgICAgICAgICAgIHRtcCA9IGJ1Zl9nZXRiaXRzKGhCaXRCdWYsIHN0YXJ0X2JpdHMpOwotICAgICAgICAgICAgICAgIGhfZnJhbWVfZGF0YS0+aUVudmVsb3BlX21hbltvZmZzZXRdID0gdG1wOwotICAgICAgICAgICAgfQotICAgICAgICB9Ci0KLSAgICAgICAgZm9yIChpID0gKDEgLSBoX2ZyYW1lX2RhdGEtPmRvbWFpbl92ZWMxW2pdKTsgaSA8IG5vX2JhbmRbal07IGkrKykKLSAgICAgICAgewotCi0gICAgICAgICAgICBpZiAoaF9mcmFtZV9kYXRhLT5kb21haW5fdmVjMVtqXSA9PSBGUkVRKQotICAgICAgICAgICAgewotICAgICAgICAgICAgICAgIGRlbHRhID0gc2JyX2RlY29kZV9odWZmX2N3KGhjYl9mLCBoQml0QnVmKTsKLSAgICAgICAgICAgIH0KLSAgICAgICAgICAgIGVsc2UKLSAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICBkZWx0YSA9IHNicl9kZWNvZGVfaHVmZl9jdyhoY2JfdCwgaEJpdEJ1Zik7Ci0gICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgIGhfZnJhbWVfZG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YW1lX2RhdGEtPnNick5vaXNlRmxvb3JMZXZlbF9leHBba10gPSAgIDA7Ci0gICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgIGZvciAoaiA9IDE7IGogPCBub05vaXNlQmFuZHM7IGorKykKLSAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICBkZWx0YSA9IHNicl9kZWNvZGVfaHVmZl9jdyhoY2Jfbm9pc2VGLCBoQml0QnVmKTsgLyoKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICogIC0zMSA8IGRlbHRhIDwgMzEKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICogIC0yNCA8IGRlbHRhIDwgMjQgICBDT1VQTElOR19CQUwgKGluY2wuIDw8MSkKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0gICAgICAgICAgICAgICAgaF9mcmFtZV9kYXRhLT5zYnJOb2lzZUZsb29yTGV2ZWxfbWFuW2sral0gPSBkZWx0YSA8PCBlbnZEYXRhVGFibGVDb21wRmFjdG9yOwotICAgICAgICAgICAgICAgIGhfZnJhbWVfZGF0YS0+c2JyTm9pc2VGbG9vckxldmVsX2V4cFtrK2pdID0gICAwOwotICAgICAgICAgICAgfQotICAgICAgICB9Ci0gICAgICAgIGVsc2UKLSAgICAgICAgewotICAgICAgICAgICAgZm9yIChqID0gMDsgaiA8IG5vTm9pc2VCYW5kczsgaisrKQotICAgICAgICAgICAgewotICAgICAgICAgICAgICAgIGRlbHRhID0gc2JyX2RlY29kZV9odWZmX2N3KGhjYl9ub2lzZSwgaEJpdEJ1Zik7ICAvKgotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKiAgLTMxIDwgZGVsdGEgPCAzMQotICAgICAgICAg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Oi0wLjVGKSkKLQotY29uc3QgSW50MzIgSW52RmlsdEZhY3RvcnNbNV0gPSB7UWZtdCgwLjAwZiksICAgIC8qIE9GRl9MRVZFTCAqLwotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgUWZtdCgwLjYwZiksICAgICAvKiBUUkFOU0lUSU9OX0xFVkVMICovCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBRZm10KDAuNzVmKSwgICAgIC8qIExPV19MRVZFTCAqLwotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgUWZtdCgwLjkwZiksICAgICAvKiBNSURfTEVWRUwgKi8KLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFFmbXQoMC45OGYpCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH07ICAgIC8qIEhJR0hfTEVWRUwgKi8KLQotLyotLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tCi07IEZVTkNUSU9OIENPREUKLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0qLwotCi12b2lkIHNicl9pbnZfZmlsdF9sZXZlbGVtcGhhc2lzKElOVkZfTU9ERSAqaW52RmlsdE1vZGUsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIElOVkZfTU9ERSAqcHJldkludkZpbHRNb2RlLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBJbnQzMiBuTmZiLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBJbnQzMiAgQndWZWN0b3JbTUFYX05VTV9QQVRDSEVTXSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgSW50MzIgIEJ3VmVjdG9yT2xkW01BWF9OVU1fUEFUQ0hFU10pCi17Ci0gICAgSW50MzIgaTsKLSAgICBJbnQzMiBqOwotICAgIEludDMyIHRtcDsKLQotICAgIGZvciAoaSA9IDA7IGkgPCBuTmZiOyBpKyspCi0gICAgewotICAgICAgICBzd2l0Y2ggKGludkZpbHRNb2RlW2ldKQotICAgICAgICB7Ci0gICAgICAgICAgICBjYXNlIElOVkZfTE9XX0xFVkVMOgotICAgICAgICAgICAgICAgIGlmIChwcmV2SW52RmlsdE1vZGVbaV0gPT0gSU5WRl9PRkYpCi0gICAgICAgICAgICAgICAgewotICAgICAgICAgICAgICAgICAgICBqID0gMTsKLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgZWxzZQotICAgICAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAgICAgaiA9IDI7Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgIGJyZWFrOwotCi0gICAgICAgICAgICBjYXNlIElOVkZfTUlEX0xFVkVMOgotICAgICAgICAgICAgICAgIGogPSAzOwotICAgICAgICAgICAgICAgIGJyZWFrOwotCi0gICAgICAgICAgICBjYXNlIElOVkZfSElHSF9MRVZFTDoKLSAgICAgICAgICAgICAgICBqID0gNDsKLSAgICAgICAgICAgICAgICBicmVhazsKLQotICAgICAgICAgICAgZGVmYXVsdDoKLSAgICAgICAgICAgICAgICBpZiAocHJldkludkZpbHRNb2RlW2ldID09IElOVkZfTE9XX0xFVkVMKQotICAgICAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAgICAgaiA9IDE7Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgIGVsc2UKLSAgICAgICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgICAgIGogPSAwOwotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgfQotCi0gICAgICAgIHRtcCAgPSAgSW52RmlsdEZhY3RvcnNbal07Ci0KLSAgICAgICAgaWYgKHRtcCA8IEJ3VmVjdG9yT2xkW2ldKQotICAgICAgICB7Ci0gICAgICAgICAgICB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CUi1Ub29sIHNvIGZhciBpcyBvbmx5IGluaXRpYWxpc2VkIHRvIGRvIHVwc2FtcGxpbmcKLSAgICAgICAgICAgICAqICBhbmQgaGVuY2Ugd2UgbmVlZCB0byBkbyBhIHJlc2V0LCBhbmQgaW5pdGlhbGlzZSB0aGUgc3lzdGVtCi0gICAgICAgICAgICAgKiAgYWNjb3JkaW5nIHRvIHRoZSBwcmVzZW50IGhlYWRlci4KLSAgICAgICAgICAgICAqLwotCi0gICAgICAgICAgICBoZWFkZXJTdGF0dXMgPSBzYnJfZ2V0X2hlYWRlcl9kYXRhKCYoU2JyQ2hhbm5lbFswXS5mcmFtZURhdGEuc2JyX2hlYWRlciksCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICZiaXRCdWYsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFNickNoYW5uZWxbMF0uc3luY1N0YXRlKTsKLSAgICAgICAgfSAgICAgLyogaWYgKGJzX2hlYWRlcl9mbGFnKSAqLwotCi0KLSAgICAgICAgc3dpdGNoIChzdHJlYW0tPnNickVsZW1lbnRbMF0uRWxlbWVudElEKQotICAgICAgICB7Ci0gICAgICAgICAgICBjYXNlIFNCUl9JRF9TQ0UgOgotCi0gICAgICAgICAgICAgICAgLyogY2hhbmdlIG9mIGNvbnRyb2wgZGF0YSwgcmVzZXQgZGVjb2RlciAqLwotICAgICAgICAgICAgICAgIGlmIChoZWFkZXJTdGF0dXMgPT0gSEVBREVSX1JFU0VUKQotICAgICAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAgICAgc2JyX2VyciA9IHNicl9yZXNldF9kZWMoJihTYnJDaGFubmVsWzBdLmZyYW1lRGF0YSksCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNickRlYywKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2VsZi0+U2JyQ2hhbm5lbFswXS5mcmFtZURhdGEuc2JyX2hlYWRlci5zYW1wbGVSYXRlTW9kZSk7Ci0KLSAgICAgICAgICAgICAgICAgICAgaWYgKHNicl9lcnIgIT0gU0JSREVDX09LKQotICAgICAgICAgICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKLSAgICAgICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgICAgICAvKgotICAgICAgICAgICAgICAgICAgICAgKiBBdCB0aGlzIHBvaW50IHdlIGhhdmUgYSBoZWFkZXIgYW5kIHRoZSBzeXN0ZW0gaGFzIGJlZW4gcmVzZXQsCi0gICAgICAgICAgICAgICAgICAgICAqIGhlbmNlIHN5bmNTdGF0ZSBmcm9tIG5vdyBvbiB3aWxsIGJlIFNCUl9BQ1RJVkUuCi0gICAgICAgICAgICAgICAgICAgICAqLwotICAgICAgICAgICAgICAgICAgICBTYnJDaGFubmVsWzBdLnN5bmNTdGF0ZSAgICAgPSBTQlJfQUNUSVZFOwotICAgICAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgICAgIGlmICgoU2JyQ2hhbm5lbFswXS5zeW5jU3RhdGUgPT0gU0JSX0FDVElWRSkpCi0gICAgICAgICAgICAgICAgewotICAgICAgICAgICAgICAgICAgICBzYnJfZXJyID0gc2JyX2dldF9zY2UoJihTYnJDaGFubmVsWzBdLmZyYW1lRGF0YSksCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmYml0QnVmCi0jaWZkZWYgUEFSQU1FVFJJQ1NURVJFTwotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLCBzZWxmLT5oUGFyYW1ldHJpY1N0ZXJlb0RlYwotI2VuZGlmCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICk7Ci0KLSAgICAgICAgICAgICAgICAgICAgaWYgKHNicl9lcnIgIT0gU0JSREVDX09LKQotICAgICAgICAgICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKLSAgICAgICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgICAgIGJyZWFrOwotCi0gICAgICAgICAgICBjYXNlIFNCUl9JRF9DUEUgOgotCi0gICAgICAgICAgICAgICAgaWYgKGJzX2hlYWRlcl9mbGFnKQotICAgICAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAgICAgcHZfbWVtY3B5KCYoU2JyQ2hhbm5lbFsxXS5mcmFtZURhdGEuc2JyX2hlYWRlciksCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmKFNickNoYW5uZWxbMF0uZnJhbWVEYXRhLnNicl9oZWFkZXIpLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2l6ZW9mKFNCUl9IRUFERVJfREFUQSkpOwotICAgICAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgICAgIC8qIGNoYW5nZSBvZiBjb250cm9sIGRhdGEsIHJlc2V0IGRlY29kZXIgKi8KLSAgICAgICAgICAgICAgICBpZiAoaGVhZGVyU3RhdHVzID09IEhFQURFUl9SRVNFVCkKLSAgICAgICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgICAgIGZvciAoaW50MzJfdCBsciA9IDAgOyBsciA8IDIgOyBscisrKQotICAgICAgICAgICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgICAgICAgICBzYnJfZXJyID0gc2JyX3Jlc2V0X2RlYygmKFNickNoYW5uZWxbbHJdLmZyYW1lRGF0YSksCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzYnJEZWMsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzZWxmLT5TYnJDaGFubmVsWzBdLmZyYW1lRGF0YS5zYnJfaGVhZGVyLnNhbXBsZVJhdGVNb2RlKTsKLQotICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHNicl9lcnIgIT0gU0JSREVDX09LKQotICAgICAgICAgICAgICAgICAgICAgICAgewotICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOwotICAgICAgICAgICAgICAgICAgICAgICAgfQotCi0gICAgICAgICAgICAgICAgICAgICAgICBTYnJDaGFubmVsW2xyXS5zeW5jU3RhdGUgPSBTQlJfQUNUSVZFOwotICAgICAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgfQotCi0gICAgICAgICAgICAgICAgaWYgKFNickNoYW5uZWxbMF0uc3luY1N0YXRlID09IFNCUl9BQ1RJVkUpCi0gICAgICAgICAgICAgICAgewotICAgICAgICAgICAgICAgICAgICBzYnJfZXJyID0gc2JyX2dldF9jcGUoJihTYnJDaGFubmVsWzBdLmZyYW1lRGF0YSksCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmKFNickNoYW5uZWxbMV0uZnJhbWVEYXRhKSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICZiaXRCdWYpOwotCi0gICAgICAgICAgICAgICAgICAgIGlmIChzYnJfZXJyICE9IFNCUkRFQ19PSykKLSAgICAgICAgICAgICAgICAgICAgewotICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7Ci0gICAgICAgICAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICBicmVhazsKLQotICAgICAgICAgICAgZGVmYXVsdDoKLSAgICAgICAgICAgICAgICBzYnJfZXJyID0gU0JSREVDX0lMTEVHQUxfUExVU19FTEVfSUQ7Ci0gICAgICAgICAgICAgICAgYnJlYWs7Ci0gICAgICAgIH0KLQotICAgIH0gICAgICAgICAgIC8qIGlmIChTYnJGcmFtZU9LKSAqLwotCi0gICAgLyoKLSAgICAgKiAgQ2hlY2sgdGhhdCB0aGUgYml0cyByZWFkIGRpZCBub3QgZ28gYmV5b25kIFNCUiBmcmFtZSBib3VuZGFyaWVzCi0gICAgICovCi0KLSAgICB6ZXJ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gICAgICAgIHsKLQotICAgICAgICAgICAgaUVudmVsb3BlX2V4cFtpXSA9IGlFbnZlbG9wZV9tYW5baV0gKyA2OwotICAgICAgICAgICAgaUVudmVsb3BlX21hbltpXSA9IFFmbXQoMS4wMDBGKTsKLSAgICAgICAgfQotICAgIH0KLSAgICBlbHNlCi0gICAgewotICAgICAgICAvKiAgaUVudmVsb3BlW2ldIGFsd2F5cyBwb3NpdGl2ZSAgNyBiaXRzIG1heCAqLwotICAgICAgICBmb3IgKGkgPSAwOyBpIDwgblNjYWxlRmFjdG9yczsgaSsrKQotICAgICAgICB7Ci0gICAgICAgICAgICBpRW52ZWxvcGVfZXhwW2ldID0gKGlFbnZlbG9wZV9tYW5baV0gPj4gMSkgKyA2OwotICAgICAgICAgICAgaWYgKGlFbnZlbG9wZV9tYW5baV0gJiAweDEpICAgLyogIG9kZCAqLwotICAgICAgICAgICAgewotICAgICAgICAgICAgICAgIGlFbnZlbG9wZV9tYW5baV0gPSBRZm10KDEuNDE0MjEzNTYyMzczMTBGKTsKLSAgICAgICAgICAgIH0KLSAgICAgICAgICAgIGVsc2UKLSAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICBpRW52ZWxvcGVfbWFuW2ldID0gUWZtdCgxLjAwMEYpOwotICAgICAgICAgICAgfQotICAgICAgICB9Ci0KLSAgICB9Ci0gICAgZm9yIChpID0gMDsgaSA8IG5Ob2lzZUZhY3RvcnM7IGkrKykKLSAgICB7Ci0gICAgICAgIC8qICBzYnJOb2lzZUZsb29yTGV2ZWxbaV0gdmFyaWVzIGZyb20gLTMxIHRvIDMxIGlmIG5vIGNvdXBsaW5nIGlzIHVzZWQgKi8KLQotICAgICAgICBzYnJOb2lzZUZsb29yTGV2ZWxfZXhwW2ldID0gTk9JU0VfRkxPT1JfT0ZGU0VUIC0gc2JyTm9pc2VGbG9vckxldmVsX21hbltpXTsKLSAgICAgICAgc2JyTm9pc2VGbG9vckxldmVsX21hbltpXSA9IDB4NDAwMDAwMDA7Ci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ICAgU0JSX0hFQURFUl9EQVRBICpoZWFkZXJEYXRhICA9ICYoaEZyYW1lRGF0YS0+c2JyX2hlYWRlcik7Ci0gICAgSW50MzIgICAgICAgICAgIHNhbXBsaW5nRnJlcSA9IHNickRlYy0+b3V0U2FtcGxlUmF0ZTsKLQotICAgIGhGcmFtZURhdGEtPnJlc2V0X2ZsYWcgPSAxOwotCi0gICAgLypDYWxjdWxhdGUgbWFzdGVyIGZyZXF1ZW5jeSBmdW5jdGlvbiAqLwotICAgIGVyciA9IHNicl9maW5kX3N0YXJ0X2FuZHN0b3BfYmFuZChzYW1wbGluZ0ZyZXEsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGhlYWRlckRhdGEtPnN0YXJ0RnJlcSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaGVhZGVyRGF0YS0+c3RvcEZyZXEsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICZsc2JNLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmdXNiKTsKLQotICAgIGlmIChlcnIgIT0gU0JSREVDX09LKQotICAgIHsKLSAgICAgICAgcmV0dXJuIGVycjsKLSAgICB9Ci0KLSAgICAvKiBDYWxjdWxhdGUgbmV3IHZfa19tYXN0ZXIgaWYgbmVlZGVkICovCi0gICAgaWYgKGhlYWRlckRhdGEtPm1hc3RlclN0YXR1cyA9PSBNQVNURVJfUkVTRVQpCi0gICAgewotICAgICAgICBzYnJfdXBkYXRlX2ZyZXFfc2NhbGUoc2JyRGVjLT5WX2tfbWFzdGVyLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJihzYnJEZWMtPk51bV9NYXN0ZXIpLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbHNiTSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHVzYiwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGhlYWRlckRhdGEtPmZyZXFTY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tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tKi8KLQotLyotLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tCi07IEZVTkNUSU9OIENPREUKLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0qLwotCi0KLQotdm9pZCBzYnJfdXBkYXRlX2ZyZXFfc2NhbGUoSW50MzIgKiB2X2tfbWFzdGVyLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgSW50MzIgKmhfbnVtX2JhbmRzLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgY29uc3QgSW50MzIgbHNiTSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbnN0IEludDMyIHVzYiwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbnN0IEludDMyIGZyZXFTY2FsZSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbnN0IEludDMyIGFsdGVyU2NhbGUsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICBjb25zdCBJbnQzMiBjaGFubmVsT2Zmc2V0KQotewotICAgIEludDMyIGk7Ci0gICAgSW50MzIgbnVtQmFuZHMgPSAwOwotICAgIEludDMyIG51bUJhbmRzMjsKLSAgICBJbnQzMiB0bXBfcTE7Ci0KLSAgICBpZiAoZnJlcVNjYWxlID4gMCkgLypCYXJrIG1vZGUqLwotICAgIHsKLSAgICAgICAgSW50MzIgcmVnOwotICAgICAgICBJbnQzMiByZWdpb25zOwotICAgICAgICBJbnQzMiBiX3BfbzsKLSAgICAgICAgSW50MzIga1szXTsKLSAgICAgICAgSW50MzIgZFtNQVhfU0VDT05EX1JFR0lPTl07Ci0gICAgICAgIEludDMyIGQyW01BWF9TRUNPTkRfUkVHSU9OXTsKLSAgICAgICAgSW50MzIgd1syXSA9IHtRX2ZtdCgxLjBGKSwgUV9mbXQoMS4wRil9OwotCi0KLSAgICAgICAga1swXSA9IGxzYk07Ci0gICAgICAgIGtbMV0gPSB1c2I7Ci0gICAgICAgIGtbMl0gPSB1c2I7Ci0KLSAgICAgICAgYl9wX28gPSAoZnJlcVNjYWxlID09IDEpICA/IDEyIDogODsKLSAgICAgICAgYl9wX28gPSAoZnJlcVNjYWxlID09IDIpICA/IDEwIDogYl9wX287Ci0KLSAgICAgICAgd1sxXSAgPSAoYWx0ZXJTY2FsZSA9PSAwKSA/IFFfZm10KDAuNWYpIDogUV9mbXQoMC4zODQ2MTUzODQ2MTUzODZmKTsKLQotICAgICAgICBpZiAodXNiID4gZnhwX211bDMyX1EyOChsc2JNLCBRMjhmbXQoMi4yNDQ5KSkpCi0gICAgICAgIHsKLSAgICAgICAgICAgIHJlZ2lvbnMgPSAyOwotICAgICAgICAgICAga1sxXSA9IChsc2JNIDw8IDEpOwotICAgICAgICB9Ci0gICAgICAgIGVsc2UKLSAgICAgICAgewotICAgICAgICAgICAgcmVnaW9ucyA9IDE7Ci0gICAgICAgIH0KLQotICAgICAgICAqaF9udW1fYmFuZHMgPSAwOwotICAgICAgICBmb3IgKHJlZyA9IDA7IHJlZyA8IHJlZ2lvbnM7IHJlZysrKQotICAgICAgICB7Ci0gICAgICAgICAgICBpZiAocmVnID09IDApCi0gICAgICAgICAgICB7Ci0KLSAgICAgICAgICAgICAgICB0bXBfcTEgPSBwdl9sb2cyKChrWzFdIDw8IDIwKSAvIGtbMF0pOwotCi0gICAgICAgICAgICAgICAgdG1wX3ExID0gZnhwX211bDMyX1ExNSh0bXBfcTEsIGJfcF9vKTsKLSAgICAgICAgICAgICAgICB0bXBfcTEgPSAodG1wX3ExICsgMzIpID4+IDY7Ci0KLSAgICAgICAgICAgICAgICBudW1CYW5kcyA9IHRtcF9xMSA8PCAxOwotCi0KLSAgICAgICAgICAgICAgICBDYWxjQmFuZHMoZCwga1swXSwga1sxXSwgbnVtQmFuZHMpOyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8qIENhbGNCYW5kcyA9PiBkICAgKi8KLSAgICAgICAgICAgICAgICBzaGVsbHNvcnQoZCwgbnVtQmFuZHMpOyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvKiBTb3J0QmFuZHMgc29ydCBkICovCi0gICAgICAgICAgICAgICAgY3VtU3VtKGtbMF0gLSBjaGFubmVsT2Zmc2V0LAotICAgICAgICAgICAgICAgICAgICAgICBkLAotICAgICAgICAgICAgICAgICAgICAgICBudW1CYW5kcywKLSAgICAgICAgICAgICAgICAgICAgICAgKHZfa19tYXN0ZXIgKyAqaF9udW1fYmFuZHMpKTsgICAvKiBjdW1zdW0gKi8KLQotICAgICAgICAgICAgICAgICpoX251bV9iYW5kcyArPSBudW1CYW5kczsgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8qIE91dHB1dCBuciBvZiBiYW5kcyAqLwotICAgICAgICAgICAgfQotICAgICAgICAgICAgZWxzZQotICAgICAgICAgICAgewotICAgICAgICAgICAgICAgIHRtcF9xMSA9IHB2X2xvZzIoKGtbcmVnICsgMV0gPDwgMjApIC8ga1tyZWddKTsKLQotICAgICAgICAgICAgICAgIHRtcF9xMSA9IGZ4cF9tdWwzMl9RMzAodG1wX3ExLCB3W3JlZ10pOwotICAgICAgICAgICAgICAgIHRtcF9xMSA9IGZ4cF9tdWwzMl9RMTUodG1wX3ExLCBiX3Bfbyk7Ci0gICAgICAgICAgICAgICAgdG1wX3ExID0gKHRtcF9xMSArIDE2KSA+PiA1OwotCi0gICAgICAgICAgICAgICAgbnVtQmFuZHMyID0gdG1wX3ExIDw8IDE7Ci0KLSAgICAgICAgICAgICAgICBDYWxjQmFuZHMoZDIsIGtbcmVnXSwga1tyZWcrMV0sIG51bUJhbmRzMik7ICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8qIENhbGNCYW5kcyA9PiBkICAgKi8KLSAgICAgICAgICAgICAgICBzaGVsbHNvcnQoZDIsIG51bUJhbmRzMik7ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8qIFNvcnRCYW5kcyBzb3J0IGQgKi8KLSAgICAgICAgICAgICAgICBpZiAoZFtudW1CYW5kcy0xXSA+IGQyWzBdKQotICAgICAgICAgICAgICAgIHsKLQotICAgICAgICAgICAgICAgICAgICBJbnQzMiAgIGNoYW5nZSA9IGRbbnVtQmFuZHMtMV0gLSBkMlswXTsKLSAgICAgICAgICAgICAgICAgICAgLyogTGltaXQgdGhlIGNoYW5nZSBzbyB0aGF0IHRoZSBsYXN0IGJhbmQgY2Fubm90IGdldCBuYXJyb3dlciB0aGFuIHRoZSBmaXJzdCBvbmUgKi8KLSAgICAgICAgICAgICAgICAgICAgaWYgKGNoYW5nZSA+IChkMltudW1CYW5kczItMV0gLSBkMlswXSkgPj4gMSkKLSAgICAgICAgICAgICAgICAgICAgewotICAgICAgICAgICAgICAgICAgICAgICAgY2hhbmdlID0gKGQyW251bUJhbmRzMi0xXSAtIGQyWzBdKSA+PiAxOwotICAgICAgICAgICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgICAgICAgICAgZDJbMF0gKz0gY2hhbmdlOwotICAgICAgICAgICAgICAgICAgICBkMltudW1CYW5kczItMV0gLT0gY2hhbmdlOwotICAgICAgICAgICAgICAgICAgICBzaGVsbHNvcnQoZDIsIG51bUJhbmRzMik7Ci0KLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgY3VtU3VtKGtbcmVnXSAtIGNoYW5uZWxPZmZzZXQsCi0gICAgICAgICAgICAgICAgICAgICAgIGQyLAotICAgICAgICAgICAgICAgICAgICAgICBudW1CYW5kczIsCi0gICAgICAgICAgICAgICAgICAgICAgIHZfa19tYXN0ZXIgKyAqaF9udW1fYmFuZHMpOyAgIC8qIGN1bXN1bSAqLwotCi0gICAgICAgICAgICAgICAgKmhfbnVtX2JhbmRzICs9IG51bUJhbmRzMjsgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLyogT3V0cHV0IG5yIG9mIGJhbmRzICovCi0gICAgICAgICAgICB9Ci0gICAgICAgIH0KLSAgICB9Ci0gICAgZWxzZQotICAgIHsgICAgICAgICAgICAgICAgICAgICAgICAgLyogTGluZWFyIG1vZGUgKi8KLSAgICAgICAgSW50MzIgICAgIGsyX2FjaGl2ZWQ7Ci0gICAgICAgIEludDMyICAgICBrMl9kaWZmOwotICAgICAgICBJbnQzMiAgICAgZGlmZl90b3RbTUFYX09DVEFWRSArIE1BWF9TRUNPTkRfUkVHSU9OXTsKLSAgICAgICAgSW50MzIgICAgIGRrOwotICAgICAgICBJbnQzMiAgICAgaW5jciA9IDA7Ci0KLQotICAgICAgICBpZiAoYWx0ZXJTY2FsZSkKLSAgICAgICAgewotICAgICAgICAgICAgbnVtQmFuZHMgPSAodXNiIC0gbHNiTSkgPj4gMTsKLSAgICAgICAgICAgIGRrID0gMTsKLSAgICAgICAgICAgIGsyX2FjaGl2ZWQgPSBsc2JNICsgbnVtQmFuZHM7Ci0gICAgICAgIH0KLSAgICAgICAgZWxzZQotICAgICAgICB7Ci0gICAgICAgICAgICBudW1CYW5kcyA9IHVzYiAtIGxzYk07Ci0gICAgICAgICAgICBpZiAobnVtQmFuZHMgJiAweDEpIC8qIGVxdWl2YWxlbnQgcm91bmRpbmcgKi8KLSAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICBudW1CYW5kcy0tOwotICAgICAgICAgICAgfQotICAgICAgICAgICAgZGsgPSAyOwotICAgICAgICAgICAgazJfYWNoaXZlZCA9IGxzYk0gKyAobnVtQmFuZHMgPDwgMSk7Ci0gICAgICAgIH0KLQotICAgICAgICBrMl9kaWZmID0gdXNiIC0gazJfYWNoaXZlZDsKLQotICAgICAgICBmb3IgKGkgPSAwOyBpIDwgbnVtQmFuZHM7IGkrKykKLSAgICAgICAgewotICAgICAgICAgICAgZGlmZl90b3RbaV0gPSBkazsKLSAgICAgICAgfQotCi0gICAgICAgIGlmIChrMl9kaWZmIDwgMCkgICAgICAgIC8qIElmIGxpbmVhciBzY2FsZSB3YXNuJ3QgYWNoaXZlZCAqLwotICAgICAgICB7Ci0gICAgICAgICAgICBpbmNyID0gMTsgICAgICAgICAgIC8qIGFuZCB3ZSBnb3QgdG9vIGxhcmdlIFNCUiBhcmVhICovCi0gICAgICAgICAgICBpID0gMDsKLSAgICAgICAgfQotCi0gICAgICAgIGlmIChrMl9kaWZmID4gMCkgICAgICAgIC8qIElmIGxpbmVhciBzY2FsZSB3YXNuJ3QgYWNoaXZlZCAqLwotICAgICAgICB7Ci0gICAgICAgICAgICBpbmNyID0gLTE7ICAgICAgICAgICAgLyogYW5kIHdlIGdvdCB0b28gc21hbGwgU0JSIGFyZWEgKi8KLSAgICAgICAgICAgIGkgPSBudW1CYW5kcyAtIDE7Ci0gICAgICAgIH0KLQotICAgICAgICAvKiBBZGp1c3QgZGlmZiB2ZWN0b3IgdG8gZ2V0IHNwZWMuIFNCUiByYW5nZSAqLwotICAgICAgICB3aGlsZSAoazJfZGlmZiAhPSAwKQotICAgICAgICB7Ci0gICAgICAgICAgICBkaWZmX3RvdFtpXSAtPSAgaW5jcjsKLSAgICAgICAgICAgIGkgKz0gaW5jcjsKLSAgICAgICAgICAgIGsyX2RpZmYgKz0gaW5jcjsKLSAgICAgICAgfQotCi0gICAgICAgIGN1bVN1bShsc2JNLAotICAgICAgICAgICAgICAgZGlmZl90b3QsCi0gICAgICAgICAgICAgICBudW1CYW5kcywKLSAgICAgICAgICAgICAgIHZfa19tYXN0ZXIpOyAvKiBjdW1zdW0gKi8KLQotICAgICAgICAqaF9udW1fYmFuZHMgPSBudW1CYW5kczsgICAgICAgICAgICAgICAgICAgICAgLyogT3V0cHV0IG5yIG9mIGJhbmRzICovCi0gICAgfQotfQotCi0KLXZvaWQgQ2FsY0JhbmRzKEludDMyICogZGlmZiwKLSAgICAgICAgICAgICAgIEludDMyIHN0YXJ0LAotICAgICAgICAgICAgICAgSW50MzIgc3RvcCwKLSAgICAgICAgICAgICAgIEludDMyIG51bV9iYW5kcykKLXsKLSAgICBJbnQzMiBpOwotICAgIEludDMyIHByZXZpb3VzOwotICAgIEludDMyIGN1cnJlbnQ7Ci0gICAgSW50MzIgdG1wX3ExOwotCi0KLSAgICBwcmV2aW91cyA9IHN0YXJ0OwotCi0gICAgZm9yIChpID0gMTsgaSA8PSBudW1fYmFuZHM7IGkrKykKLSAgICB7Ci0gICAgICAgIC8qICAgICAgICAgICAgICBmbG9hdCB0ZW1wPShzdGFydCAqIHBvdyggKGZsb2F0KXN0b3Avc3RhcnQsIChmbG9hdClpL251bV9iYW5kcykpOyAqLwotCi0gICAgICAgIHRtcF9xMSA9IHB2X2xvZzIoKHN0b3AgPDwgMjApIC8gc3RhcnQpOwotCi0gICAgICAgIHRtcF9xMSA9IGZ4cF9tdWwzMl9RMjAodG1wX3ExLCAoaSA8PCAyNykgLyBudW1fYmFuZHMpOwotICAgICAgICB0bXBfcTEgPSBwdl9wb3cyKHRtcF9xMSk7Ci0KLSAgICAgICAgdG1wX3ExID0gZnhwX211bDMyX1EyMCh0bXBfcTEsIHN0YXJ0KTsKLQotICAgICAgICBjdXJyZW50ID0gKHRtcF9xMSArIDE2KSA+PiA1OwotCi0gICAgICAgIGRpZmZbaS0xXSA9IGN1cnJlbnQgLSBwcmV2aW91czsKLSAgICAgICAgcHJldmlvdXMgID0gY3VycmVudDsKLSAgICB9Ci0KLX0gIC8qIEVuZCBDYWxjQmFuZHMgKi8KLQotCi12b2lkIGN1bVN1bShJbnQzMiBzdGFydF92YWx1ZSwKLSAgICAgICAgICAgIEludDMyICogZGlmZiwKLSAgICAgICAgICAgIEludDMyIGxlbmd0aCwKLSAgICAgICAgICAgIEludDMyICogc3RhcnRfYWRyZXNzKQotewotICAgIEludDMyIGk7Ci0gICAgSW50MzIgKnB0X3N0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m9pZCBzYnJfdXBkYXRlX2ZyZXFfc2NhbGUoSW50MzIgKiB2X2tfbWFzdGVyLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgSW50MzIgKmhfbnVtX2JhbmRzLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgY29uc3QgSW50MzIgbHNiTSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbnN0IEludDMyIHVzYiwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbnN0IEludDMyIGZyZXFTY2FsZSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbnN0IEludDMyIGFsdGVyU2NhbGUsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICBjb25zdCBJbnQzMiBjaGFubmVsT2Zmc2V0KTsKLQotCi12b2lkIENhbGNCYW5kcyhJbnQzMiAqIGRpZmYsCi0gICAgICAgICAgICAgICBJbnQzMiBzdGFydCwKLSAgICAgICAgICAgICAgIEludDMyIHN0b3AsCi0gICAgICAgICAgICAgICBJbnQzMiBudW1fYmFuZHMpOwotCi12b2lkIGN1bVN1bShJbnQzMiBzdGFydF92YWx1ZSwKLSAgICAgICAgICAgIEludDMyICogZGlmZiwKLSAgICAgICAgICAgIEludDMyIGxlbmd0aCwKLSAgICAgICAgICAgIEludDMyICogc3RhcnRfYWRyZXNzKTsKLQotCi0vKi0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0KLTsgRU5ECi0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tKi8KLSNlbmRpZgotCi0KZGlmZiAtLWdpdCBhL21lZGlhL2xpYnN0YWdlZnJpZ2h0L2NvZGVjcy9hYWNkZWMvc2V0X21jX2luZm8uY3BwIGIvbWVkaWEvbGlic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0gICAgICAgICAgICAgICAgICAgc2hvcnQgd2luZG93IHNlcXVlbmNlIGZyYW1lLgotICAgICAgICAgICAgICAgICAgIERhdGEgdHlwZSBJbnQgYXJyYXkKLQotIExvY2FsIFN0b3Jlcy9CdWZmZXJzL1BvaW50ZXJzIE5lZWRlZDoKLSAgICBOb25lCi0KLSBHbG9iYWwgU3RvcmVzL0J1ZmZlcnMvUG9pbnRlcnMgTmVlZGVkOgotICAgIE5vbmUKLQotIE91dHB1dHM6Ci0gICAgcmV0dXJuIFNVQ0NFU1MKLQotIFBvaW50ZXJzIGFuZCBCdWZmZXJzIE1vZGlmaWVkOgotICAgIHBNQ19JbmZvLT5uY2ggICAgICAgICAgIGNvbnRhaW5zIHRoZSBudW1iZXIgb2YgY2hhbm5lbHMgZGVwZW5kaW5nCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgdXBvbiBpZiBDUEUgb3IgU0NFIGlzIHVzZWQKLSAgICBwTUNfSW5mby0+b2JqZWN0VHlwZSAgICBjb250ZW50cyB1cGRhdGVkIHdpdGggdGhlIGRlY29kZWQgQXVkaW8KLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBPYmplY3QgVHlwZQotCi0gICAgcE1DX0luZm8tPmNoX2luZm8udGFnICAgY29udGVudHMgdXBkYXRlZCB3aXRoIHRoZSB2YWx1ZSBvZiBkZWNvZGVkCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgY2hhbm5lbCBlbGVtZW50IHRhZwotCi0gICAgUE1DX0luZm8tPmNoX2luZm8uY3BlICAgY29udGVudHMgdXBkYXRlZCBkZXBlbmRpbmcgdXBvbiBpZiBDUEUgb3IKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBTQ0UgaXMgdXNlZAotCi0gICAgcFdpblNlcUluZm8gICAgICAgICAgICAgY29udGVudHMgdXBkYXRlZCBieSBjYWxsaW5nIGluZm9pbml0IGlmCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgc2FtcGxpbmdfcmF0ZV9p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BpKyspCi0gICAgewotICAgICAgICBwdF9kYXRhXzFbICAgaV0gPSAoSW50MTYpKFNyWzE2LWldID4+IDUpOwotICAgICAgICBwdF9kYXRhXzFbMTYraV0gPSAoSW50MTYpKFNyW2ldID4+IDUpOwotICAgICAgICBwdF9kYXRhXzFbMzIraV0gPSAoSW50MTYpKFNyWzE2K2ldID4+IDUpOwotICAgIH0KLSAgICBmb3IgKGkgPSAwOyBpIDwgMTU7IGkrKykKLSAgICB7Ci0gICAgICAgIHB0X2RhdGFfMVs0OStpXSA9IChJbnQxNikoLVNyWzMxLWldID4+IDUpOwotICAgIH0KLSAgICBwdF9kYXRhXzFbNDhdID0gMDsKLX0KLQotCi0jaWZkZWYgSFFfU0JSCi0KLXZvaWQgc3ludGhlc2lzX3N1Yl9iYW5kKEludDMyIFNyW10sIEludDMyIFNpW10sIEludDE2IGRhdGFbXSkKLXsKLQotCi0gICAgSW50MzIgaSA7Ci0gICAgSW50MTYgKnB0X2RhdGFfMTsKLSAgICBJbnQxNiAqcHRfZGF0YV8yOwotICAgIEludDMyICpwdF9Tcl8xOwotICAgIEludDMyICpwdF9Tcl8yOwotICAgIEludDMyICpwdF9TaV8xOwotICAgIEludDMyICpwdF9TaV8yOwotCi0gICAgSW50MzIgdG1wMTsKLSAgICBJbnQzMiB0bXAyOwotICAgIEludDMyIHRtcDM7Ci0gICAgSW50MzIgdG1wNDsKLQotICAgIEludDMyIGNvc3g7Ci0gICAgY29uc3QgSW50MzIgKnB0X0Nvc1RhYmxlID0gQ29zVGFibGVfNjQ7Ci0KLQotICAgIHB0X1NyXzEgPSAmU3JbMF07Ci0gICAgcHRfU3JfMiA9ICZTcls2M107Ci0KLSAgICBwdF9TaV8xID0gJlNpWzBdOwotICAgIHB0X1NpXzIgPSAmU2lbNjNdOwotCi0KLSAgICB0bXAzID0gKnB0X1NyXzE7Ci0KLSAgICBmb3IgKGkgPSAzMjsgaSAhPSAwOyBpLS0pCi0gICAgewotICAgICAgICB0bXA0ID0gKn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fc3ViX2JhbmRfZG93bl9zYW1wbGVkKEludDMyIFNyW10sIEludDMyIFNpW10sIEludDE2IGRhdGFbXSkKLXsKLQotICAgIEludDE2IGs7Ci0gICAgSW50MTYgKnB0X2RhdGFfMTsKLSAgICBJbnQzMiBleHBfbTBfMjU7Ci0gICAgY29uc3QgSW50MzIgKnB0X2V4cCA9IGV4cF9tMF8yNV9waGk7Ci0KLSAgICBJbnQzMiAqWFggPSBTcjsKLSAgICBJbnQzMiAqWVkgPSAoSW50MzIgKilkYXRhOwotICAgIEludDMyIHRtcDE7Ci0gICAgSW50MzIgdG1wMjsKLQotICAgIGZvciAoayA9IDA7IGsgPCAzMjsgaysrKQotICAgIHsKLSAgICAgICAgZXhwX20wXzI1ID0gKihwdF9leHArKyk7Ci0gICAgICAgIHRtcDEgPSBTcltrXTsKLSAgICAgICAgdG1wMiA9IFNpW2tdOwotICAgICAgICBYWFtrXSAgICA9IGNtcGx4X211bDMyX2J5XzE2KC10bXAxLCAgdG1wMiwgZXhwX20wXzI1KTsKLSAgICAgICAgWVlbMzEta10gPSBjbXBseF9tdWwzMl9ieV8xNih0bXAyLCAgdG1wMSwgZXhwX20wXzI1KTsKLSAgICB9Ci0KLSAgICBtZGN0XzMyKFhYKTsKLSAgICBtZGN0XzMyKFlZKTsKLQotICAgIGZvciAoayA9IDA7IGsgPCAzMjsgaysrKQotICAgIHsKLSAgICAgICAgU2lba10gPSBZWVtrXTsKLSAgICB9Ci0KLSAgICBwdF9kYXRhXzEgPSBkYXRhOwotCi0gICAgZm9yIChrID0gMDsgayA8IDE2OyBrKyspCi0gICAgewotICAgICAgICAqKHB0X2RhdGFfMSsrKSAgPSAoSW50MTYpKChYWFsyKmsgIF0gKyBTaVsyKmsgIF0pID4+IDE0KTsKLSAgICAgICAgKihwdF9kYXRhXzErKykgID0gKEludDE2KSgoWFhbMiprKzFdIC0gU2lbMiprKzFdKSA+PiAxNCk7Ci0gICAgfQotCi0gICAgZm9yIChrID0gMTU7IGsgPiA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Y3RyYWwgaW5wdXQgdG8gYmUgc2hhcGVkIGJ5IHRoZSBmaWx0ZXIuCi0gICAgICAgICAgICBGaXhlZCBwb2ludCBmb3JtYXQKLSAgICAgICAgICAgIEludDMyW10KLSAgICAgICAgICAgIGxlbmd0aCA9IHNwZWNfbGVuZ3RoCi0KLSAgICBzcGVjX2xlbmd0aCAgPSBsZW5ndGggb2Ygc3BlYyBhcnJheS4KLSAgICAgICAgICAgIGNvbnN0IEludAotCi0gICAgZGlyZWN0aW9uID0gZGlyZWN0aW9uIGZvciBhcHBsaWNhdGlvbiBvZiB0bnMgZmlsdGVyLgotICAgICAgICAgICAgICAgICsxICBmaWx0ZXJzIHNwZWN0cnVtIGZyb20gbG93IHRvIGhpZ2ggZnJlcXVlbmNpZXMKLSAgICAgICAgICAgICAgICAgICAgKGZpcnN0IGlucHV0IHRvIGZpbHRlciBpcyBzcGVjWzBdKQotICAgICAgICAgICAgICAgIC0xICBmaWx0ZXJzIHNwZWN0cnVtIGZyb20gaGlnaCB0byBsb3cgZnJlcXVlbmNpZXMKLSAgICAgICAgICAgICAgICAgICAgKGZpcnN0IGlucHV0IHRvIGZpbHRlciBpcyBzcGVjW3NwZWNfbGVuZ3RoLTFdKQotICAgICAgICAgICAgICAgIGNvbnN0IEludAotCi0gICAgbHBjICAgPSBhcnJheSBvZiBscGMgY29lZmZpY2llbnRzLCBtaW51cyBscGNbMF0gd2hpY2ggaXMgYXNzdW1lZCB0byBiZSAiMSIKLSAgICAgICAgICAgIEZpeGVkIHBvaW50IGZvcm1hdAotICAgICAgICAgICAgY29uc3QgSW50W10KLSAgICAgICAgICAgIGxlbmd0aCA9IFROU19NQVhfT1JERVIKLQotICAgIFFfbHBjID0gUSBmb3JtYXQgZm9yIHRoZSBscGMgY29lZmZjaWVudHMgKGZvciBtYXguIHByZWNpc2lvbiwgaXQgYXNzdW1lcwotICAgICAgICAgICAgdGhhdCBhbGwgMTYgYml0cyBhcmUgdXNlZCkKLSAgICAgICAgICAgIGN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b3IgKGkgPSBvcmRlcjsgaSAhPSAwOyBpLS0pCi0gICAgICAgIHsKLQotICAgICAgICAgICAgeTAgPSAqcF9zcGVjID4+IHNoaWZ0X2Rvd25fYW1vdW50OwotCi0gICAgICAgICAgICBwX2xwYyA9IGxwYzsKLQotICAgICAgICAgICAgLyogMzIgYnkgMzIgYml0IG11bHRpcGxpY2F0aW9uICovCi0gICAgICAgICAgICBmb3IgKGogPSBvcmRlcjsgaiA+IGk7IGotLSkKLSAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICB0ZW1wID0gKnBfc3RhdGUrKzsKLSAgICAgICAgICAgICAgICB5MCAtPSBmeHBfbXVsMzJfUTMxKHRlbXAsICoocF9scGMrKykpIDw8IHNoaWZ0X3VwOwotICAgICAgICAgICAgfQotCi0gICAgICAgICAgICAvKgotICAgICAgICAgICAgKiBSZWNvcmQgdGhlIG91dHB1dCBpbi1wbGFjZQotICAgICAgICAgICAgKi8KLSAgICAgICAgICAgIHBfc3RhdGUgICAgID0gcF9zcGVjOwotICAgICAgICAgICAgKihwX3NwZWMtLSkgPSB5MDsKLQotICAgICAgICB9Ci0KLSAgICAgICAgaWYgKHNwZWNfbGVuZ3RoID4gb3JkZXIpCi0gICAgICAgIHsKLSAgICAgICAgICAgIGZvciAoaSA9IChzcGVjX2xlbmd0aCAtIG9yZGVyKTsgaSAhPSAwOyBpLS0pCi0gICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgeTAgPSAqcF9zcGVjID4+IHNoaWZ0X2Rvd25fYW1vdW50OwotCi0gICAgICAgICAgICAgICAgcF9scGMgPSAmKGxwY1swXSk7Ci0KLSAgICAgICAgICAgICAgICAvKiAzMiBieSAzMiBiaXQgbXVsdGlwbGljYXRpb24gKi8KLSAgICAgICAgICAgICAgICBmb3IgKGogPSBvcmRlcjsgaiAhPSAwOyBqLS0pCi0gICAgICAgICAgICAgICAgewotICAgICAgICAgICAgICAgICAgICB0ZW1wID0gKnBfc3RhdGUrKzsKLSAgICAgICAgICAgICAgICAgICAgeTAgLT0gZnhwX211bDMyX1EzMSh0ZW1wLCAqKHBfbHBjKyspKSA8PCBzaGlmdF91cDsKLSAgICAgICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgICAgICAvKgotICAgICAgICAgICAgICAgICAqIFJlY29yZCB0aGUgb3V0cHV0IGluLXBsYWNlCi0gICAgICAgICAgICAgICAgICovCi0gICAgICAgICAgICAgICAgcF9zdGF0ZSAgICAgPSBwX3NwZWM7Ci0gICAgICAgICAgICAgICAgKihwX3NwZWMtLSkgPSB5MDsKLQotICAgICAgICAgICAgfSAvKiBFTkQgZm9yIChpID0gKHNwZWNfbGVuZ3RoIC0gb3JkZXIpOyBpPjA7IGktLSkgKi8KLSAgICAgICAgfQotCi0gICAgfQotICAgIGVsc2UKLSAgICB7Ci0gICAgICAgIGZvciAoaSA9IG9yZGVyOyBpICE9IDA7IGktLSkKLSAgICAgICAgewotCi0gICAgICAgICAgICBwX2xwYyA9ICBscGM7Ci0KLSAgICAgICAgICAgIHkwID0gMDsKLQotICAgICAgICAgICAgLyogMzIgYnkgMzIgYml0IG11bHRpcGxpY2F0aW9uICovCi0gICAgICAgICAgICBmb3IgKGogPSBvcmRlcjsgaiA+IGk7IGotLSkKLSAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICB5MCAtPSBmeHBfbXVsMzJfUTMxKCpwX3N0YXRlLS0sICoocF9scGMrKykpOwotICAgICAgICAgICAgfQotCi0gICAgICAgICAgICBwX3N0YXRlICAgICA9IHBfc3BlYzsKLSAgICAgICAgICAgIC8qCi0gICAgICAgICAgICAqIFJlY29yZCB0aGUgb3V0cHV0IGluLXBsYWNlCi0gICAgICAgICAgICAqLwotICAgICAgICAgICAgKihwX3NwZWMpID0gKCpwX3NwZWMgPj4gc2hpZnRfZG93bl9hbW91bnQpICsgKHkwIDw8IHNoaWZ0X3VwKTsKLSAgICAgICAgICAgIHBfc3BlYysrOwotICAgICAgICB9Ci0KLSAgICAgICAgaWYgKHNwZWNfbGVuZ3RoID4gb3JkZXIpCi0gICAgICAgIHsKLSAgICAgICAgICAgIGZvciAoaSA9IChzcGVjX2xlbmd0aCAtIG9yZGVyKTsgaSAhPSAwOyBpLS0pCi0gICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgcF9scGMgPSAgbHBjOwotCi0gICAgICAgICAgICAgICAgeTAgPSAwOwotCi0gICAgICAgICAgICAgICAgLyogMzIgYnkgMzIgYml0IG11bHRpcGxpY2F0aW9uICovCi0gICAgICAgICAgICAgICAgZm9yIChqID0gb3JkZXI7IGogIT0gMDsgai0tKQotICAgICAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAgICAgeTAgLT0gZnhwX211bDMyX1EzMSgqcF9zdGF0ZS0tLCAqKHBfbHBjKyspKTsKLSAgICAgICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgICAgICBwX3N0YXRlICAgICA9IHBfc3BlYzsKLSAgICAgICAgICAgICAgICAvKgotICAgICAgICAgICAgICAgICAqIFJlY29yZCB0aGUgb3V0cHV0IGluLXBsYWNlCi0gICAgICAgICAgICAgICAgICovCi0gICAgICAgICAgICAgICAgKihwX3NwZWMpID0gKCpwX3NwZWMgPj4gc2hpZnRfZG93bl9hbW91bnQpICsgKHkwIDw8IHNoaWZ0X3VwKTsKLSAgICAgICAgICAgICAgICBwX3NwZWMrKzsKLQotICAgICAgICAgICAgfSAvKiBFTkQgZm9yIChpID0gKHNwZWNfbGVuZ3RoIC0gb3JkZXIpOyBpPjA7IGktLSkgKi8KLSAgICAgICAgfQotICAgIH0KLQotICAgIHJldHVybihzaGlmdF9kb3duX2Ftb3VudCk7Ci0KLQotfSAvKiB0bnNfYXJfZmlsdGVyICovCmRpZmYgLS1naXQgYS9tZWRpYS9saWJzdGFnZWZyaWdodC9jb2RlY3MvYWFjZGVjL3Ruc19hcl9maWx0ZXIuaCBiL21lZGlhL2xpYnN0YWdlZnJpZ2h0L2NvZGVjcy9hYWNkZWMvdG5zX2FyX2Zpb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tLS0tLS0tLS0tLS0tLS0KLSAqICAgICAgICAgIChjb2VmX3JlcyArIDMpICAgICAgICAgICAgICAgICAgICAgICAgKGNvZWZfcmVzICsgMykKLSAqICAgICAgICAgMiAgICAgICAgICAgICAgIC0gMSAgICAgICAgICAgICAgICAgICAyICAgICAgICAgICAgICArIDEKLSAqCi0gKgotICogaWYgYSBjb2VmIGlzIG5lZ2F0aXZlLCBpdCBpcyBtdWx0aXBsaWVkIGJ5IGlxZmFjX20KLSAqICAgICAgICAgICBpZiBwb3NpdGl2ZSwgIiAgICIgICAgICIgICAgICAgICBpcWZhYwotICoKLSAqIFRoZSByYW5nZSBvZiBjb2VmcyBpcyBsaW1pdGVkIHRvICAtNDozIGlmIGNvZWZfcmVzID0gMAotICogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC04OjcgaWYgY29lZl9yZXMgPSAxCi0gKgotICoKLSAqCi0gKi8KLQotCi1jb25zdCBJbnQzMiB0bnNfdGFibGVbMl1bMTZdID0KLXsKLSAgICB7Ci0gICAgICAgIC0yMTE0ODU4NTQ2LCAgLTE4NTk3NzUzOTMsICAtMTM4MDM3NTg4MSwgIC03MzQ0ODI2NjUsCi0gICAgICAgIDAsICAgIDkzMTc1ODIzNSwgICAxNjc4OTcwMzI0LCAgMjA5MzY0MTc0OQotICAgIH0sCi0gICAgewotICAgICAgICAtMjEzODMyMjg2MSwgIC0yMDY1NTA0ODQxLCAgLTE5MjIzNDg1MzAsICAtMTcxMzcyODk0NiwKLSAgICAgICAgLTE0NDY3NTAzNzgsICAtMTEzMDUwNDQ2MiwgICAtNzc1NzYwNTcxLCAgIC0zOTQ1OTkwODUsCi0gICAgICAgIDAsICAgIDQ0NjQ4Njk1NiwgICAgODczNDYwMjkwLCAgIDEyNjIyNTkyMTgsCi0gICAgICAgIDE1OTU4OTEzNjEsICAgMTg1OTc3NTM5MywgICAyMDQyMzc4MzE3LCAgIDIxMzU3MTk1MDgKLSAgICB9Ci19OwotCi0KLWNvbnN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c2V0ID0gbmVnX29mZnNldFtjb2VmX3Jlc107Ci0gICAgcFRuc1RhYmxlICAgPSB0bnNfdGFibGVbY29lZl9yZXNdOwotCi0gICAgbSA9IDA7Ci0gICAgcExQQyA9IGxwY19jb2VmOwotCi0KLSAgICAvKgotICAgICAqICBDb252ZXJzaW9uIHRvIExQQyBjb2VmZmljaWVudHMKLSAgICAgKi8KLQotICAgIGRvCi0gICAgewotICAgICAgICB0YWJsZV9pbmRleCA9IGNvZWZfb2Zmc2V0ICsgKihwTFBDKyspOwotCi0gICAgICAgIC8qIEVxdWl2LiB0byBzaW5fcmVzdWx0ICA9IHRuc190YWJsZVtjb2VmX3Jlc11bdGFibGVfaW5kZXhdOyAqLwotICAgICAgICBzaW5fcmVzdWx0ID0gKihwVG5zVGFibGUgKyB0YWJsZV9pbmRleCk7Ci0KLSAgICAgICAgLyogc2luX3Jlc3VsdCBoYXMgYSByYW5nZSBvZiAtMC45OTkgdG8gKzAuOTk5IGluIFEtMzEgKi8KLQotICAgICAgICAvKgotICAgICAgICAgKiBJdCBpcyBpbXBvcnRhbnQgdGhhdCB0aGlzIGZvciBsb29wIGlzIG5vdCBlbnRlcmVkIG9uIHRoZSBmaXJzdAotICAgICAgICAgKiBpdGVyYXRpb24gb2YgdGhlIGRvLXdoaWxlKCBtIDwgb3JkZXIgKSBsb29wLgotICAgICAgICAgKi8KLSAgICAgICAgZm9yIChpID0gbTsgaSA+IDA7IGktLSkKLSAgICAgICAgewotCi0gICAgICAgICAgICAvKgotICAgICAgICAgICAgICogdGVtcF9wdHIgdXNlZCB0byBvcHRpbWl6ZSBpbmRleCBpbnRvIHBBCi0gICAgICAgICAgICAgKiBtdWx0ID0gKEludDMyKSggcEFbbS1pXSAqIHNpbl9yZXN1bHQpOwotICAgICAgICAgICAgICovCi0KLSAgICAgICAgICAgIG11bHRfaGlnaCA9IGZ4cF9tdWwzMl9RMzEoKih0ZW1wX3B0ci0tKSwgc2luX3Jlc3VsdCk7Ci0KLSAgICAgICAgICAgIC8qCi0gICAgICAgICAgICAgKiAgcEJbaV0gPSBwQVtpXSArIHNpbl9yZXN1bHQgKiBwQVttLWldCi0gICAgICAgICAgICAgKgotICAgICAgICAgICAgICogIChtdWx0X2hpZ2ggPDwxKSAgZWxpbWluYXRlcyBleHRyYSBzaWduIGJpdAotICAgICAgICAgICAgICovCi0KLSAgICAgICAgICAgICoocEIrKykgPSAgKihwQSsrKSArIChtdWx0X2hpZ2ggPDwgMSk7Ci0KLSAgICAgICAgfSAvKiBFTkQgZm9yIChpPW07IGkgPiAwOyBpLS0pICovCi0KLQotICAgICAgICAvKiBTaGlmdCB0byBwbGFjZSBwQlttXSBpbiBxX2xwYyBmb3JtYXQgKi8KLQotICAgICAgICAqcEIgPSAgc2luX3Jlc3VsdCA+PiAxMjsKLQotICAgICAgICAvKgotICAgICAgICAgKiBTd2FwcGluZyB0aGUgcG9pbnRlcnMgaGVyZSBoYXMgdGhlIHNhbWUgZWZmZWN0Ci0gICAgICAgICAqIGFzIHNwZWNpZmljYWxseSBjb3B5aW5nIHRoZSBkYXRhIGZyb20gYiB0byBhCi0gICAgICAgICAqLwotCi0gICAgICAgIHRlbXBfcHRyID0gcEE7Ci0gICAgICAgIHBBICAgICAgID0gcEI7Ci0gICAgICAgIHBCICAgICAgID0gdGVtcF9wdHI7Ci0KLSAgICAgICAgLyoKLSAgICAgICAgICogIEF0IHRoaXMgcG9pbnQsIHBBID0gcEFbbV0KLSAgICAgICAgICogICAgICAgICAgICAgYW5kIHBCID0gcEJbbV0KLSAgICAgICAgICovCi0gICAgICAgIHRlbXBfcHRyID0gcEE7Ci0KLSAgICAgICAgdGVtcEludDMyID0gKihwQSk7Ci0KLSAgICAgICAgbWFzayA9IHRlbXBJbnQzMiA+PiAzMTsKLSAgICAgICAgdGVtcEludDMyIF49IG1hc2s7Ci0KLSAgICAgICAgbWF4ID0gdGVtcEludDMyOwotCi0gICAgICAgIC8qCi0gICAgICAgICAqIEl0IGlzIGltcG9ydGFudCB0aGF0IHRoaXMgZm9yIGxvb3AgaXMgbm90IGVudGVyZWQgb24gdGhlIGZpcnN0Ci0gICAgICAgICAqIGl0ZXJhdGlvbiBvZiB0aGUgZG8td2hpbGUoIG0gPCBvcmRlciApIGxvb3AuCi0gICAgICAgICAqLwotICAgICAgICBmb3IgKGkgPSBtOyBpID4gMDsgaS0tKQotICAgICAgICB7Ci0gICAgICAgICAgICB0ZW1wSW50MzIgPSAqKC0tcEEpOwotCi0gICAgICAgICAgICBtYXNrID0gdGVtcEludDMyID4+IDMxOwotICAgICAgICAgICAgdGVtcEludDMyIF49IG1hc2s7Ci0KLSAgICAgICAgICAgIG1heCB8PSB0ZW1wSW50MzI7Ci0gICAgICAgIH0KLQotICAgICAgICBwQiAtPSBtOwotCi0gICAgICAgIC8qCi0gICAgICAgICAqIEhlcmUsIHBBID0gJihwQVswXSkKLSAgICAgICAgICogYW5kICAgcEIgPSAmKHBCWzBdKQotICAgICAgICAgKi8KLQotICAgICAgICBpZiAobWF4ID49IDB4NDAwMDAwMDBMKQotICAgICAgICB7Ci0gICAgICAgICAgICBtYXggPj49IDE7Ci0KLSAgICAgICAgICAgIGZvciAoaSA9IG07IGkgPiAwOyBpLS0pCi0gICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgKihwQSsrKSA+Pj0gMTsKLSAgICAgICAgICAgICAgICAqKHBCKyspID4+PSAxOwotICAgICAgICAgICAgfQotCi0gICAgICAgICAgICAvKiBTaGlmdCB0aGUgbW9zdCByZWNlbnQgZW50cnkgZG93biBhbHNvICovCi0gICAgICAgICAgICAqKHBBKSA+Pj0gMTsKLQotICAgICAgICAgICAgcV9scGMtLTsKLQotICAgICAgICAgICAgcEEgLT0gbTsKLSAgICAgICAgICAgIHBCIC09IG07Ci0gICAgICAgIH0KLQotICAgICAgICBtKys7Ci0KLSAgICB9Ci0gICAgd2hpbGUgKG0gPCBvcmRlcik7Ci0KLQotICAgIC8qCi0gICAgICogVGhlIGZvbGxvd2luZyBjb2RlIGNvbXBhY3RzCi0gICAgICogMzItYml0IExQQyBjb2VmZmljaWVudHMgaW50byAxNi1iaXQgbnVtYmVycywKLSAgICAgKiBzaGlmdGluZyBieSB0aGUgbWluaW11bSBhbW91bnQgbmVjZXNzYXJ5LgotICAgICAqLwotCi0gICAgc2hpZnRfYW1vdW50ID0gMDsKLQotICAgIHdoaWxlIChtYXggPiAzMjc2NykKLSAgICB7Ci0gICAgICAgIG1heCA+Pj0gMTsKLSAgICAgICAgc2hpZnRfYW1vdW50Kys7Ci0gICAgfQotCi0gICAgLyoKLSAgICAgKiBUaGlzIHdoaWxlIGxvb3AgaXMgZm9yIHByb3RlY3RpdmUgcHVycG9zZXMgb25seS4KLSAgICAgKiBJIGhhdmUgbm90IGZvdW5kIGRhdGEgdGhhdCBjYXVzZXMgaXQgdG8gYmUgZW50ZXJlZC4KLSAgICAgKgotICAgICAqLwotICAgIGlmIChtYXggIT0gMCkKLSAgICB7Ci0gICAgICAgIHdoaWxlIChtYXggPCAxNjM4NCkKLSAgICAgICAgewotICAgICAgICAgICAgbWF4IDw8PSAxOwotICAgICAgICAgICAgc2hpZnRfYW1vdW50LS07Ci0gICAgICAgIH0KLSAgICB9Ci0KLQotICAgIHBMUEMgPSBscGNfY29lZjsKLQotICAgIGlmIChzaGlmdF9hbW91bnQgPj0gMCkKLSAgICB7Ci0KLSAgICAgICAgZm9yIChtID0gb3JkZXI7IG0gPiAwOyBtLS0pCi0gICAgICAgIHsKLSAgICAgICAgICAgICoocExQQysrKSA9ICoocEErKykgPDwgKDE2IC0gc2hpZnRfYW1vdW50KTsKLSAgICAgICAgfQotICAgIH0KLQotCi0gICAgcV9scGMgLT0gc2hpZnRfYW1vdW50OwotCi0gICAgLyoKLSAgICAgKiAgbWFrZSBzdXJlIHRoYXQgdGhlIG51bWJlcnMgaGF2ZSBzb21lIG1lYW5pbmcsIHFfbHBjIGNhbiBub3QgYmUKLSAgICAgKiAgYmlnZ2VyIHRoYW4gMTUgKDE1IGJpdHMgKy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S0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLQotIElOUFVUIEFORCBPVVRQVVQgREVGSU5JVElPTlMKLQotIElucHV0czoKLQotICAgIGNvZWYgICAgICAgICAgID0gc3BlY3RyYWwgaW5wdXQgdG8gYmUgc2hhcGVkIGJ5IHRoZSBmaWx0ZXIuCi0gICAgICAgICAgICAgICAgICAgICBGaXhlZCBwb2ludCBmb3JtYXQKLSAgICAgICAgICAgICAgICAgICAgIFtJbnQzMltdLCBsZW5ndGggPSBudW1fY29lZl0KLQotICAgIG51bV9jb2VmICAgICAgID0gbGVuZ3RoIG9mIHNwZWMgYXJyYXkuCi0gICAgICAgICAgICAgICAgICAgICBbY29uc3QgSW50XQotCi0gICAgZGlyZWN0aW9uICAgICAgPSBkaXJlY3Rpb24gZm9yIGFwcGxpY2F0aW9uIG9mIHRucyBmaWx0ZXIuCi0gICAgICAgICAgICAgICAgICAgICArMSBhcHBsaWVzIGZvcndhcmQgZmlsdGVyCi0gICAgICAgICAgICAgICAgICAgICAoZmlyc3QgaW5wdXQgdG8gZmlsdGVyIGlzIGNvZWZbMF0pCi0gICAgICAgICAgICAgICAgICAgICAtMSBhcHBsaWVzIHJldmVyc2VkIGZpbHRlcgotICAgICAgICAgICAgICAgICAgICAgKGZpcnN0IGlucHV0IHRvIGZpbHRlciBpcyBjb2VmW251bV9jb2VmLTFdKQotICAgICAgICAgICAgICAgICAgICAgW2NvbnN0IEludF0KLQotICAgIGxwYyAgICAgICAgICAgID0gYXJyYXkgb2YgbHBjIGNvZWZmaWNpZW50cy4KLSAgICAgICAgICAgICAgICAgICAgIEZpeGVkIHBvaW50IGZvcm1hdCBRLTExCi0gICAgICAgICAgICAgICAgICAgICBbY29uc3QgSW50W10sIGxlbmd0aCA9IFROU19NQVhfT1JERVJdCi0KLSAgICBscGNfcWZvcm1hdCAgICA9IFRoZSBxLWZvcm1hdCBvZiB0aGUgbHBjIGN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jsgaSA+IDA7IGktLSkKLQotICAgICAgICBwTFBDID0gbHBjOwotCi0gICAgICAgIG11bHQgPSAwOwotCi0gICAgICAgIEZPUiAoaiA9IHdyYXBfcG9pbnQ7IGo+MDsgai0tKQotCi0gICAgICAgICAgIHRlbXBJbnQzMiA9IChJbnQzMikoKihwTFBDKSAqICoocEZpbHRlcklucHV0KSk7Ci0gICAgICAgICAgIHRlbXBJbnQzMiA9IHRlbXBJbnQzMiA+PiA1OwotCi0gICAgICAgICAgIG11bHQgPSBtdWx0ICsgdGVtcEludDMyOwotCi0gICAgICAgICAgIHBGaWx0ZXJJbnB1dCA9IHBGaWx0ZXJJbnB1dCArIDE7Ci0gICAgICAgICAgIHBMUEMgPSBwTFBDICsgMTsKLQotICAgICAgICBFTkRGT1IKLQotICAgICAgICBwRmlsdGVySW5wdXQgPSBzY3JhdGNoX21lbW9yeTsKLQotICAgICAgICBGT1IgKGogPSAob3JkZXIgLSB3cmFwX3BvaW50KTsgaj4wOyBqLS0pCi0KLSAgICAgICAgICAgdGVtcEludDMyID0gKEludDMyKSgqKHBMUEMpICogKihwRmlsdGVySW5wdXQpKTsKLSAgICAgICAgICAgdGVtcEludDMyID0gdGVtcEludDMyID4+IDU7Ci0KLSAgICAgICAgICAgbXVsdCA9IG11bHQgKyB0ZW1wSW50MzI7Ci0KLSAgICAgICAgICAgcEZpbHRlcklucHV0ID0gcEZpbHRlcklucHV0ICsgMTsKLSAgICAgICAgICAgcExQQyA9IHBMUEMgKyAxOwotCi0gICAgICAgIEVOREZPUgotCi0gICAgICAgIHBGaWx0ZXJJbnB1dCA9IHBGaWx0ZXJJbnB1dCAtIDE7Ci0gICAgICAgICoocEZpbHRlcklucHV0KSA9IChJbnQpKCpwQ29lZik7Ci0KLSAgICAgICAgbXVsdCA9IG11bHQgPj4gc2hpZnRfYW10OwotCi0gICAgICAgICoocENvZWYpID0gKihwQ29lZikgKyBtdWx0OwotCi0gICAgICAgIHBDb2VmID0gcENvZWYgKyBkaXJl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GlmdF9hbXQgID0gKGxwY19xZm9ybWF0IC0gNSk7Ci0KLSAgICBmb3IgKGkgPSBudW1fY29lZjsgaSA+IDA7IGktLSkKLSAgICB7Ci0gICAgICAgIC8qCi0gICAgICAgICAqIENvcHkgc3BlY3RyYWwgaW5wdXQgaW50byBzcGVjaWFsCi0gICAgICAgICAqIGZpbHRlciBpbnB1dCBidWZmZXIuCi0gICAgICAgICAqLwotICAgICAgICBwTFBDID0gbHBjOwotCi0gICAgICAgIG11bHQgPSAwOwotCi0gICAgICAgIC8qCi0gICAgICAgICAqIHdyYXBfcG9pbnQgPSAwIHdoZW4gdGhpcyBjb2RlIGlzCi0gICAgICAgICAqIGVudGVyZWQgZm9yIHRoZSBmaXJzdCBpdGVyYXRpb24gb2YKLSAgICAgICAgICogZm9yKGk9bnVtX2NvZWY7IGk+MDsgaS0tKQotICAgICAgICAgKgotICAgICAgICAgKiBTbywgdGhpcyBmaXJzdCBmb3ItbG9vcCB3aWxsIGJlCi0gICAgICAgICAqIHNraXBwZWQgd2hlbiBpID09IG51bV9jb2VmLgotICAgICAgICAgKi8KLQotICAgICAgICBmb3IgKGogPSB3cmFwX3BvaW50OyBqID4gMDsgai0tKQotICAgICAgICB7Ci0gICAgICAgICAgICBtdWx0ICs9IGZ4cF9tdWwzMl9RMzEoKihwTFBDKyspLCAqKHBGaWx0ZXJJbnB1dCsrKSkgPj4gNTsKLQotICAgICAgICB9IC8qIGZvciAoaiA9IHdyYXBfcG9pbnQ7IGo+MDsgai0tKSAqLwotCi0gICAgICAgIC8qCi0gICAgICAgICAqIHBGaWx0ZXJJbnB1dCBoYXMgcmVhY2hlZCAmc2NyYXRjaF9tZW1vcnlbb3JkZXItMV0KLSAgICAgICAgICogUmVzZXQgcG9pbnRlciB0byBiZWdpbm5pbmcgb2YgZmlsdGVyJ3Mgc3RhdGUgbWVtb3J5Ci0gICAgICAgICAqLwotICAgICAgICBwRmlsdGVySW5wdXQgPSBzY3JhdGNoX21lbW9yeTsKLQotICAgICAgICBmb3IgKGogPSAob3JkZXIgLSB3cmFwX3BvaW50KTsgaiA+IDA7IGotLSkKLSAgICAgICAgewotICAgICAgICAgICAgbXVsdCArPSBmeHBfbXVsMzJfUTMxKCoocExQQysrKSwgKihwRmlsdGVySW5wdXQrKykpID4+IDU7Ci0KLSAgICAgICAgfSAvKiBmb3IgKGogPSB3cmFwX3BvaW50OyBqPjA7IGotLSkgKi8KLQotCi0gICAgICAgIC8qCi0gICAgICAgICAqIEZpbGwgdGhlIGZpbHRlcidzIHN0YXRlIGJ1ZmZlcgotICAgICAgICAgKiBhdm9pZCBvYnZpb3VzIGNhc3RpbmcKLSAgICAgICAgICovCi0gICAgICAgICooLS1wRmlsdGVySW5wdXQpID0gKCpwQ29lZik7Ci0KLQotICAgICAgICAvKiBTY2FsZSB0aGUgZGF0YSBkb3duIHNvIHRoZSBvdXRwdXQgcS1mb3JtYXQgaXMgbm90IGFkanVzdGVkLgotICAgICAgICAgKgotICAgICAgICAgKiBIZXJlIGlzIGFuIGVxdWF0aW9uLCB3aGljaCBzaG93cyBob3cgdGhlIHNwZWN0cmFsIGNvZWZmaWNpZW50cwotICAgICAgICAgKiBhbmQgbHBjIGNvZWZmaWNpZW50cyBhcmUgbXVsdGlwbGllZCBhbmQgdGhlIHNwZWN0cmFsCi0gICAgICAgICAqIGNvZWZmaWNpZW50J3MgcS1mb3JtYXQgZG9lcyBub3QgY2hhbmdlLgotICAgICAgICAgKgotICAgICAgICAgKiBRLShjb2VmKSAqIFEtKGxwY19xZm9ybWF0KSA+PiA1ID0gUS0oY29lZiArIGxwY19xX2Zvcm1hdCAtIDUpCi0gICAgICAgICAqCi0gICAgICAgICAqIFEtKGNvZWYgKyBscGNfcV9mb3JtYXQgLSA1KSA+PiAobHBjX3Fmb3JtYXQgLSA1KSA9IFEtKGNvZWYpCi0gICAgICAgICAqLwotCi0gICAgICAgIC8qIFN0b3JlIG91dHB1dCBpbiBwbGFjZSAqLwotICAgICAgICAqKHBDb2VmKSAr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AgICAgICAgICAgICAgICAgICAgIHR5cGUgSW50MzIKLQotICAgIE91dHB1dF9idWZmZXIgICAgID0gIHBsYWNlIGhvbGRlciBmb3IgY3VycmVudCBvdXRwdXQsICBzaXplIDEwMjQKLSAgICAgICAgICAgICAgICAgICAgICAgICB0eXBlIEludDE2Ci0KLSAgICB3bmRfc2VxICAgICAgICAgICA9ICB3aW5kb3cgc2VxdWVuY2UKLSAgICAgICAgICAgICAgICAgICAgICAgICB0eXBlIFdJTkRPV19TRVFVRU5DRQotCi0gICAgd25kX3NoYXBlX3ByZXZfYmsgPSAgcHJldmlvdXMgd2luZG93IHNoYXBlIHR5cGUKLSAgICAgICAgICAgICAgICAgICAgICAgICB0eXBlIEludAotCi0gICAgd25kX3NoYXBlX3RoaXNfYmsgPSAgY3VycmVudCB3aW5kb3cgc2hhcGUgdHlwZQotICAgICAgICAgICAgICAgICAgICAgICAgIHR5cGUgSW50Ci0KLSAgICBRX2Zvcm1hdCAgICAgICAgICA9ICBRIGZvcm1hdCBmb3IgdGhlIGlucHV0IGZyZXF1ZW5jeSBkYXRhCi0gICAgICAgICAgICAgICAgICAgICAgICAgdHlwZSBJbnQKLQotICAgIGZyZXFfMl90aW1lX2J1ZmZlcltdID0gIHNjcmF0Y2ggbWVtb3J5IGZvciBjb21wdXRpbmcgRkZUCi0gICAgICAgICAgICAgICAgICAgICAgICAgdHlwZSBJbnQzMgotCi0KLSBMb2NhbCBTdG9yZXMvQnVmZmVycy9Qb2ludGVycyBOZWVkZWQ6Ci0gICAgTm9uZQotCi0gR2xvYmFsIFN0b3Jlcy9CdWZmZXJzL1BvaW50ZXJzIE5lZWRlZDoKLSAgICBOb25lCi0KLSBPdXRwdXRzOgotICAgIE5vbmUKLQotIFBvaW50ZXJzIGFuZCBCdWZmZXJzIE1vZGlmaWVkOgotICAgIE91dHB1dF9idWZmZXIKLSAgICBUaW1lX2RhdGEKLSAgICBGcmVxdWVuY3lfZGF0YQotICAgIHBXbmRfc2hhcGVfcHJld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jZXNzaW5nIGlzIGRvbmUgaW4tcGxhY2UgYW5kCi1pbiBkZXNjZW5kZW50IG9yZGVyIHRvIGF2b2lkIHVzaW5nIGV4dHJhIG1lbW9yeS4KLVRoZSBvcmRlcmluZyBpcyBhcyBmb2xsb3dzOgotCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFBuOiBQcmV2aW91cyBkYXRhIGZvciB3aW5kb3cgbgotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBDbjogIEN1cnJlbnQgZGF0YSBmb3Igd2luZG93IG4KLQotCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAxMjggZnJlcS4KLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzYW1wbGVzCi0gICAgICAgICAgICAgICAgICBGUkVRICAgICAgICAgICAgICAgICAgICAgICAgICArKysrKysKLUlOICAgICAgICAgICAgICAgICAgICAgICAgID09PT09PT09PT09PT09PT09PT09PT09PT09PQotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLT4gIDI1NiB0aW1lCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2FtcGxlcwotCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFA4ICAgIEM4Ci0gICAgICAgICAgIDggICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICMjIyMjIyMrKysrKysKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBQNyAgICAgQzcKLSAgICAgICAgICAgNyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAjIyMjIyMjKysrKysrCi0gICAgICAgICAgIDogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDoKLSAgICAgICAgICAgOiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOgotICAgICAgICAgICAgICAgICAgICAgICAgICAgIFAyICAgIEMyCi0gICAgICAgICAgIDIgICAgICAgICAgICAgIyMjIyMjIysrKysrKwotICAgICAgICAgICAgICAgICAgICAgUDEgICAgQzEKLSAgICAgICAgICAgMSAgICAgICMjIyMjIyMrKysrKysKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgVElNRQotT1VUICAgICAgICAgID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09Ci0KLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLQotIFJFUVVJUkVNRU5UUwotCi0gICAgVGhpcyBtb2R1bGUgc2hhbGwgaW1wbGVtZW50IGEgc2NoZW1lIHRvIHN3aXRjaCBiZXR3ZWVuIHdpbmRvdyB0eXBlcwotCi0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0KLSBSRUZFUkVOQ0VTCi0KLSAgICBbMV0gSVNPIDE0NDk2LTM6MTk5OSwgcGFnIDExMQotCi0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0KLSBQU0VVRE8tQ09ERQotCi0KLQotICAgIElGICggd25kX3NlcSA9PSBFSUdIVF9TSE9SVF9TRVFVRU5DRSkKLSAgICBUSEVOCi0KLSAgICAgICAgRk9SICggaT0wOyBpPExPTkdfV0lORE9XOyBpKyspCi0gICAgICAgICAgICBUaW1lX2RhdGFbTE9OR19XSU5ET1cgKyBpXSA9IDA7Ci0gICAgICAgIEVOREZPUgotCi0gICAgICAgIEZPUiAoIHduZD1OVU1fU0hPUlRfV0lORE9XUy0xOyB3bmQ+PTA7IHduZC0tKQotCi0gICAgICAgICAgICBwRnJlcUluZm8gPSAmRnJlcXVlbmN5X2RhdGFbIHduZCpTSE9SVF9XSU5ET1ddOwotCi0gICAgICAgICAgICBDQUxMIElNRENUKCBwRnJlcUluZm8sIFNIT1JUX0JMT0NLMSk7Ci0gICAgICAgICAgICBNT0RJRllJTkcocEZyZXFJbmZvKQotCi0KLSAgICAgICAgICAgIElGICh3bmQgPT0gMCkKLSAgICAgICAgICAgIFRIRU4KLSAgICAgICAgICAgICAgICBwU2hvcnRfV2luZG93XzEgPSAmU2hvcnRfV2luZG93W3duZF9zaGFwZV9wcmV2X2JrXVswXTsKLSAgICAgICAgICAgIEVMU0UKLSAgICAgICAgICAgICAgICBwU2hvcnRfV2luZG93XzEgPSAmU2hvcnRfV2luZG93W3duZF9zaGFwZV90aGlzX2JrXVswXTsKLSAgICAgICAgICAgIEVORElGCi0KLSAgICAgICAgICAgIHBTaG9ydF9XaW5kb3dfMiAgID0KLSAgICAgICAgICAgICAgICAgICAgJlNob3J0X1dpbmRvd1t3bmRfc2hhcGUtPnRoaXNfYmtdW1NIT1JUX1dJTkRPV19tXzFdOwotCi0gICAgICAgICAgICBGT1IoIGk9MCwgaj1TSE9SVF9XSU5ET1c7IGk8U0hPUlRfV0lORE9XOyBpKyssIGotLSkKLSAgICAgICAgICAgICAgICBwRnJlcUluZm9bICAgICAgICAgICAgIGldICAqPSBwU2hvcnRfV2luZG93XzFbaV07Ci0gICAgICAgICAgICAgICAgcEZyZXFJbmZvW1NIT1JUX1dJTkRPVytpXSAgKj0gcFNob3J0X1dpbmRvd18yW2pdOwotICAgICAgICAgICAgRU5ERk9SCi0KLQotICAgICAgICAgICAgRk9SKCBpPTA7IGk8U0hPUlRfQkxPQ0sxOyBpKyspCi0gICAgICAgICAgICAgICAgVGltZV9kYXRhW1dfTF9TVE9QXzEgKyBTSE9SVF9XSU5ET1cqd25kICsgaV0gKz0gcEZyZXFJbmZvW2ldOwotICAgICAgICAgICAgRU5ERk9SCi0KLSAgICAgICAgRU5ERk9SCi0KLSAgICAgICAgRk9SICggaT0wOyBpPExPTkdfV0lORE9XOyBpKyspCi0gICAgICAgICAgICB0ZW1wICAgICAgICAgICAgICA9IFRpbWVfZGF0YVtpXTsKLSAgICAgICAgICAgIE91dHB1dF9idWZmZXJbaV0gID0gVGltZV9kYXRhW2ldOwotICAgICAgICAgICAgVGltZV9kYXRhW2ldICAgICAgPSB0ZW1wOwotICAgICAgICBFTkRGT1IKLSAgICBFTFNFCi0KLSAgICAgICAgQ0FMTCBJTURDVCggRnJlcXVlbmN5X2RhdGEsIExPTkdfQkxPQ0sxKQotICAgICAgICAgICAgTU9ESUZZSU5HKEZyZXF1ZW5jeV9kYXRhKQotCi0gICAgICAgIFNXSVRDSCAoIHduZF9zZXEpCi0KLSAgICAgICAgICAgIENBU0UgKCBPTkxZX0xPTkdfU0VRVUVOQ0UpCi0KLSAgICAgICAgICAgICAgICBwTG9uZ19XaW5kb3dfMSA9ICZMb25nX1dpbmRvd1t3bmRfc2hhcGVfcHJldl9ia11bMF07Ci0gICAgICAgICAgICAgICAgcExvbmdfV2luZG93XzIgPQotICAgICAgICAgICAgICAgICAgICAgICAgJkxvbmdfV2luZG93W3duZF9zaGFwZV90aGlzX2JrXVtMT05HX1dJTkRPV19tXzFdOwotCi0gICAgICAgICAgICAgICAgRk9SIChpPTA7IGk8TE9OR19XSU5ET1c7IGkrKykKLSAgICAgICAgICAgICAgICAgICAgRnJlcXVlbmN5X2RhdGFbICAgICAgICAgICAgaV0gKj0gKnBMb25nX1dpbmRvd18xKys7Ci0gICAgICAgICAgICAgICAgICAgIEZyZXF1ZW5jeV9kYXRhW0xPTkdfV0lORE9XK2ldICo9ICpwTG9uZ19XaW5kb3dfMi0tOwotICAgICAgICAgICAgICAgIEVOREZPUgotCi0gICAgICAgICAgICAgICAgQlJFQUsKLQotICAgICAgICAgICAgQ0FTRSAoIExPTkdfU1RBUlRfU0VRVUVOQ0UpCi0KLSAgICAgICAgICAgICAgICBwTG9uZ19XaW5kb3dfMSA9ICZMb25nX1dpbmRvd1t3bmRfc2hhcGVfcHJldl9ia11bMF07Ci0KLSAgICAgICAgICAgICAgICBGT1IgKCBpPTA7IGk8TE9OR19XSU5ET1c7IGkrKykKLSAgICAgICAgICAgICAgICAgICAgRnJlcXVlbmN5X2RhdGFbIGldICo9ICpwTG9uZ19XaW5kb3dfMSsrOwotICAgICAgICAgICAgICAgIEVOREZPUgotCi0gICAgICAgICAgICAgICAgcFNob3J0X1dpbmRvd18xICAgPQotICAgICAgICAgICAgICAgICAgICAgICAgJlNob3J0X1dpbmRvd1t3bmRfc2hhcGVfdGhpc19ia11bU0hPUlRfV0lORE9XX21fMV07Ci0KLSAgICAgICAgICAgICAgICBGT1IgKCBpPTA7IGk8U0hPUlRfV0lORE9XOyBpKyspCi0gICAgICAgICAgICAgICAgICAgIEZyZXF1ZW5jeV9kYXRhW1dfTF9TVEFSVF8xICsgaV0gKj0gKnBTaG9ydF9XaW5kb3dfMS0tOwotICAgICAgICAgICAgICAgIEVOREZPUgotCi0gICAgICAgICAgICAgICAgRk9SICggaT1XX0xfU1RBUlRfMjsgaTxMT05HX0JMT0NLMTsgaSsrKQotICAgICAgICAgICAgICAgICAgICBGcmVxdWVuY3lfZGF0YVtXX0xfU1RBUlRfMiArIGldID0gMDsKLSAgICAgICAgICAgICAgICBFTkRGT1IKLQotICAgICAgICAgICAgICAgIEJSRUFLCi0KLQotICAgICAgICAgICAgQ0FTRSAoIExPTkdfU1RPUF9TRVFVRU5DRSApCi0KLSAgICAgICAgICAgICAgICBGT1IgKCBpPTA7IGk8V19MX1NUT1BfMTsgaSsrKQotICAgICAgICAgICAgICAgICAgICBGcmVxdWVuY3lfZGF0YVsgaV0gPSAwOwotICAgICAgICAgICAgICAgIEVOREZPUgotCi0gICAgICAgICAgICAgICAgcFNob3J0X1dpbmRvd18xICAgPSAmU2hvcnRfV2luZG93W3duZF9zaGFwZV9wcmV2X2JrXVswXTsKLQotICAgICAgICAgICAgICAgIEZPUiAoIGk9MDsgaTxTSE9SVF9XSU5ET1c7IGkrKykKLSAgICAgICAgICAgICAgICAgICAgRnJlcXVlbmN5X2RhdGFbV19MX1NUT1BfMSsgaV0gKj0gKnBTaG9ydF9XaW5kb3dfMSsrOwotICAgICAgICAgICAgICAgIEVOREZPUgotCi0gICAgICAgICAgICAgICAgcExvbmdfV2luZG93XzEgPQotICAgICAgICAgICAgICAgICAgICAgICAgJkxvbmdfV2luZG93W3duZF9zaGFwZV90aGlzX2JrXVtMT05HX1dJTkRPV19tXzFdOwotCi0gICAgICAgICAgICAgICAgRk9SICggaT0wOyBpPExPTkdfV0lORE9XOyBpKyspCi0gICAgICAgICAgICAgICAgICAgIEZyZXF1ZW5jeV9kYXRhW0xPTkdfV0lORE9XICsgaV0gICo9ICAqcExvbmdfV2luZG93XzEtLTsKLSAgICAgICAgICAgICAgICBFTkRGT1IKLQotICAgICAgICAgICAgICAgIEJSRUFLCi0KLSAgICAgICAgfQotCi0KLSAgICAgICAgRk9SICggaT0wOyBpPExPTkdfV0lORE9XOyBpKyspCi0gICAgICAgICAgICBPdXRwdXRfYnVmZmVyW2ldICA9IEZyZXF1ZW5jeV9kYXRhW2ldICArIFRpbWVfZGF0YVtpXTsKLSAgICAgICAgICAgIFRpbWVfZGF0YVtpXSA9IEZyZXF1ZW5jeV9kYXRhW0xPTkdfV0lORE9XK2ldOwotICAgICAgICBFTkRGT1IKLQotICAgIH0KLQotICAgIEVORElGCi0KLQotCi0tLS0tLS0t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ORElOR19TQ0FMRUQKLSAgICAgICAgbW92IHksIHksIGxzbCAjKDE1LVNDQUxJTkcpCi0gICAgICAgIHFkYWRkIHosIHgsIHkKLSAgICAgICAgbW92IHksIHosIGxzciAjMTYKLSAgICB9Ci0gICAgcmV0dXJuKChJbnQxNil5KTsKLX0KLQotI2RlZmluZSAgbGltaXRlciggeSwgeCkgICB5ID0gc2F0KHgpOwotCi0KLQotI2VsaWYgZGVmaW5lZChQVl9BUk1fR0NDX1Y1KQotCi0KLV9faW5saW5lIEludDE2IHNhdChJbnQzMiB5KQotewotICAgIHJlZ2lzdGVyIEludDMyIHg7Ci0gICAgcmVnaXN0ZXIgSW50MzIgcmEgPSAoSW50MzIpeTsKLSAgICByZWdpc3RlciBJbnQzMiB6ID0gUk9VTkRJTkdfU0NBTEVEOwotCi0KLSAgICBhc20gdm9sYXRpbGUoCi0gICAgICAgICJtb3YgJTAsICUxLCBsc2wgIzVcblx0IiAgICAvLyAoMTUtU0NBTElORykgYXNzZW1ibGVyIGRvZXMgbm90IHRha2Ugc3ltYm9scwotICAgICAgICAicWRhZGQgJTAsICUyLCAlMFxuXHQiCi0gICAgICAgICJtb3YgJTAsICUwLCBsc3IgIzE2IgotICAgIDogIj0mcippIih4KQotICAgICAgICAgICAgICAgIDogInIiKHJhKSwKLSAgICAgICAgICAgICAgICAiciIoeikpOwotCi0gICAgcmV0dXJuICgoSW50MTYpeCk7Ci19Ci0KLSNkZWZpbmUgIGxpbWl0ZXIoIHksIHgpICAgeSA9IHNhdCh4KTsKLQotCi0jZWxpZiBkZWZpbmVkKFBWX0FSTV9NU0NfRVZDX1Y1KQotCi0KLSNkZWZpbmUgIGxpbWl0ZXIoIHksIHgpICAgICAgIHogPSB4PDwgKDE1LVNDQUxJTkcpOyBcCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICB5ID0gX0RBZGRTYXRJbnQoIFJPVU5ESU5HX1NDQUxFRCwgeik+PjE2OwotCi0KLSNlbHNlCi0KLSNkZWZpbm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ydF9XaW5kb3dfc2luZV9meHA7Ci0gICAgU2hvcnRfV2luZG93X2Z4cFsxXSA9IFNob3J0X1dpbmRvd19LQkRfZnhwOwotCi0KLSAgICBpZiAod25kX3NlcSAhPSBFSUdIVF9TSE9SVF9TRVFVRU5DRSkKLSAgICB7Ci0KLSAgICAgICAgcEZyZXFJbmZvID0gKEludDE2ICopRnJlcXVlbmN5X2RhdGE7Ci0KLQotICAgICAgICBleHAgPSBpbWRjdF9meHAoCi0gICAgICAgICAgICAgICAgICAoSW50MzIgKilwRnJlcUluZm8sCi0gICAgICAgICAgICAgICAgICBmcmVxXzJfdGltZV9idWZmZXIsCi0gICAgICAgICAgICAgICAgICBMT05HX0JMT0NLMSwKLSAgICAgICAgICAgICAgICAgIFFfZm9ybWF0LAotICAgICAgICAgICAgICAgICAgYWJzX21heF9wZXJfd2luZG93WzBdKTsKLQotCi0KLSAgICAgICAgLyoKLSAgICAgICAgICogIFRoZSBDIFByb2dyYW1taW5nIExhbmd1YWdlLCBTZWNvbmQgRWRpdGlvbiwgS2VybmlnaGFuICYgUml0Y2hpZSwKLSAgICAgICAgICogIHBhZ2UgMjA2LgotICAgICAgICAgKiAgIlRoZSByZXN1bHQgW29mIGEgc2hpZnRdIGlzIHVuZGVmaW5lZCBpZiB0aGUgcmlnaHQgb3BlcmFuZCBpcwotICAgICAgICAgKiAgbmVnYXRpdmUsIG9yIGdyZWF0ZXIgdGhhbiBvciBlcXVhbCB0byB0aGUgbnVtYmVyIG9mIGJpdHMgaW4gdGhlCi0gICAgICAgICAqICBsZWZ0IGV4cHJlc3Npb24ncyB0eXBlIgotICAgICAgICAgKiAgID0+IGF2b2lkIHNoaWZ0IGJ5IDMyIG9yIDE2Ci0gICAgICAgICAqLwotCi0gICAgICAgIGlmIChleHAgPCAxNikKLSAgICAgICAgewotCi0gICAgICAgICAgICBwRnJlcV8yX1RpbWVfZGF0YV8xID0gcEZyZXFJbmZvOwotCi0gICAgICAgICAgICBzd2l0Y2ggKHduZF9zZXEpCi0gICAgICAgICAgICB7Ci0KLSAgICAgICAgICAgICAgICBjYXNlIE9OTFlfTE9OR19TRVFVRU5DRToKLSAgICAgICAgICAgICAgICBkZWZhdWx0OgotCi0gICAgICAgICAgICAgICAgICAgIHBPdXRwdXRfYnVmZmVyID0gT3V0cHV0X2J1ZmZlcjsKLQotICAgICAgICAgICAgICAgICAgICBwT3ZlcmxhcF9hbmRfQWRkX0J1ZmZlcl8xID0gVGltZV9kYXRhOwotCi0gICAgICAgICAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAgICAgICAgIGNvbnN0IEludDE2ICpwTG9uZ19XaW5kb3dfMiA9ICZMb25nX1dpbmRvd19meHBbd25kX3NoYXBlX3RoaXNfYmtdW0xPTkdfV0lORE9XX21fMV07Ci0KLSAgICAgICAgICAgICAgICAgICAgICAgIEludDMyICogcEZyZXEyVCA9IChJbnQzMiAqKXBGcmVxSW5mbzsKLSAgICAgICAgICAgICAgICAgICAgICAgIEludDMyICogd2luID0gKEludDMyICopICYgTG9uZ19XaW5kb3dfZnhwW3duZF9zaGFwZV9wcmV2X2JrXVswXTsKLSAgICAgICAgICAgICAgICAgICAgICAgIEludCBzaGlmdCA9IGV4cCArIDE1IC0gU0NBTElORzsKLQotCi0gICAgICAgICAgICAgICAgICAgICAgICBJbnQzMiAqIHBGcmVxMlRfMiA9ICZwRnJlcTJUW0hBTEZfTE9OR19XSU5ET1ddOwotCi0KLSAgICAgICAgICAgICAgICAgICAgICAgIGZvciAoaSA9IEhBTEZfTE9OR19XSU5ET1c7IGkgIT0gMDsgaS0tKQotICAgICAgICAgICAgICAgICAgICAgICAgewotICAgICAgICAgICAgICAgICAgICAgICAgICAgIEludDE2IHdpbjEsIHdpbjI7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgSW50MzIgIHRlbXAyLCB0ZXN0MjsKLQotICAgICAgICAgICAgICAgICAgICAgICAgICAgIEludDMyICB3aW54OwotCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgdGVtcDIgPSAqKHBGcmVxMlQrKyk7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgd2lueCA9ICood2luKyspOwotCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgdGVzdCAgPSAqKHBPdmVybGFwX2FuZF9BZGRfQnVmZmVyXzErKyk7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgdGVzdDIgPSAqKHBPdmVybGFwX2FuZF9BZGRfQnVmZmVyXzEtLSk7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgdGVtcCAgPSAgIGZ4cF9tdWxfMTZfYnlfMTZiYih0ZW1wMiwgd2lueCkgPj4gc2hpZnQ7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgdGVtcDIgPSAgIGZ4cF9tdWxfMTZfYnlfMTZ0dCh0ZW1wMiwgd2lueCkgPj4gc2hpZnQ7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgbGltaXRlcigqKHBPdXRwdXRfYnVmZmVyKyspLCAodGVtcCArIHRlc3QpKTsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBsaW1pdGVyKCoocE91dHB1dF9idWZmZXIrKyksICh0ZW1wMiArIHRlc3QyKSk7Ci0KLSAgICAgICAgICAgICAgICAgICAgICAgICAgICB0ZW1wMiA9ICoocEZyZXEyVF8yKyspOwotCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgd2luMSAgPSAqKHBMb25nX1dpbmRvd18yLS0pOwotICAgICAgICAgICAgICAgICAgICAgICAgICAgIHdpbjIgID0gKihwTG9uZ19XaW5kb3dfMi0tKTsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICB0ZW1wICA9IGZ4cF9tdWxfMTZfYnlfMTZiYih0ZW1wMiwgd2luMSkgPj4gc2hpZnQ7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgdGVzdDIgPSBmeHBfbXVsXzE2X2J5XzE2dGIodGVtcDIsIHdpbjIpID4+IHNoaWZ0OwotICAgICAgICAgICAgICAgICAgICAgICAgICAgICoocE92ZXJsYXBfYW5kX0FkZF9CdWZmZXJfMSsrKSA9IHRlbXA7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgKihwT3ZlcmxhcF9hbmRfQWRkX0J1ZmZlcl8xKyspID0gdGVzdDI7Ci0KLSAgICAgICAgICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICAgICAgfQotCi0gICAgICAgICAgICAgICAgICAgIGJyZWFrOwotCi0gICAgICAgICAgICAgICAgY2FzZSBMT05HX1NUQVJUX1NFUVVFTkNFOgotCi0KLSAgICAgICAgICAgICAgICAgICAgcEZyZXFfMl9UaW1lX2RhdGFfMiA9Ci0gICAgICAgICAgICAgICAgICAgICAgICAmcEZyZXFfMl9UaW1lX2RhdGFfMVsgSEFMRl9MT05HX1dJTkRPV107Ci0KLSAgICAgICAgICAgICAgICAgICAgcExvbmdfV2luZG93XzEgPSAmTG9uZ19XaW5kb3dfZnhwW3duZF9zaGFwZV9wcmV2X2JrXVswXTsKLSAgICAgICAgICAgICAgICAgICAgcExvbmdfV2luZG93XzIgPSAmcExvbmdfV2luZG93XzFbIEhBTEZfTE9OR19XSU5ET1ddOwotCi0gICAgICAgICAgICAgICAgICAgIHBPdmVybGFwX2FuZF9BZGRfQnVmZmVyXzEgPSAmVGltZV9kYXRhWzBdOwotICAgICAgICAgICAgICAgICAgICBwT3ZlcmxhcF9hbmRfQWRkX0J1ZmZlcl8yID0gJlRpbWVfZGF0YVtIQUxGX0xPTkdfV0lORE9XXTsKLQotICAgICAgICAgICAgICAgICAgICBwT3V0cHV0X2J1ZmZlciAgID0gT3V0cHV0X2J1ZmZlcjsKLSAgICAgICAgICAgICAgICAgICAgcE91dHB1dF9idWZmZXJfMiA9IHBPdXRwdXRfYnVmZmVyICsgSEFMRl9MT05HX1dJTkRPVzsKLQotCi0gICAgICAgICAgICAgICAgICAgIHNoaWZ0ID0gZXhwICsgMTUgLSBTQ0FMSU5HOwotCi0gICAgICAgICAgICAgICAgICAgIGZvciAoaSA9IEhBTEZfTE9OR19XSU5ET1c7IGkgIT0gMDsgaS0tKQotICAgICAgICAgICAgICAgICAgICB7Ci0KLSAgICAgICAgICAgICAgICAgICAgICAgIEludDE2IHdpbjEsIHdpbjI7Ci0gICAgICAgICAgICAgICAgICAgICAgICBJbnQxNiAgZGF0MSwgZGF0MjsKLSAgICAgICAgICAgICAgICAgICAgICAgIEludDMyICB0ZXN0MSwgdGVzdDI7Ci0KLSAgICAgICAgICAgICAgICAgICAgICAgIGRhdDEgICA9ICoocEZyZXFfMl9UaW1lX2RhdGFfMSsrKTsKLSAgICAgICAgICAgICAgICAgICAgICAgIHdpbjEgICA9ICoocExvbmdfV2luZG93XzErKyk7Ci0gICAgICAgICAgICAgICAgICAgICAgICB0ZXN0MSAgPSAqKHBPdmVybGFwX2FuZF9BZGRfQnVmZmVyXzErKyk7Ci0KLSAgICAgICAgICAgICAgICAgICAgICAgIGRhdDIgID0gICoocEZyZXFfMl9UaW1lX2RhdGFfMisrKTsKLSAgICAgICAgICAgICAgICAgICAgICAgIHdpbjIgID0gKihwTG9uZ19XaW5kb3dfMisrKTsKLSAgICAgICAgICAgICAgICAgICAgICAgIHRlc3QyID0gKihwT3ZlcmxhcF9hbmRfQWRkX0J1ZmZlcl8yKyspOwotCi0gICAgICAgICAgICAgICAgICAgICAgICBsaW1pdGVyKCoocE91dHB1dF9idWZmZXIrKyksICh0ZXN0MSArIChmeHBfbXVsXzE2X2J5XzE2KGRhdDEsIHdpbjEpID4+IHNoaWZ0KSkpOwotCi0gICAgICAgICAgICAgICAgICAgICAgICBsaW1pdGVyKCoocE91dHB1dF9idWZmZXJfMisrKSwgKHRlc3QyICsgKGZ4cF9tdWxfMTZfYnlfMTYoZGF0Miwgd2luMikgPj4gc2hpZnQpKSk7Ci0KLSAgICAgICAgICAgICAgICAgICAgfQotCi0gICAgICAgICAgICAgICAgICAgIC8qCi0gICAgICAgICAgICAgICAgICAgICAqICBkYXRhIHVuY2hhbmdlZCBmcm9tICBMT05HX1dJTkRPVyB0byBXX0xfU1RBUlRfMQotICAgICAgICAgICAgICAgICAgICAgKiAgb25seSBzY2FsZWQgYWNjb3JkaW5nbHkKLSAgICAgICAgICAgICAgICAgICAgICovCi0KLSAgICAgICAgICAgICAgICAgICAgcE92ZXJsYXBfYW5kX0FkZF9CdWZmZXJfMSA9ICZUaW1lX2RhdGFbMF07Ci0gICAgICAgICAgICAgICAgICAgIHBGcmVxXzJfVGltZV9kYXRhXzEgICAgICAgPSAmcEZyZXFJbmZvW0xPTkdfV0lORE9XXTsKLQotICAgICAgICAgICAgICAgICAgICBleHAgLT0gU0NBTElORzsKLQotICAgICAgICAgICAgICAgICAgICBpZiAoZXhwID49IDApCi0gICAgICAgICAgICAgICAgICAgIHsKLQotICAgICAgICAgICAgICAgICAgICAgICAgZm9yIChpID0gKFdfTF9TVEFSVF8xIC0gTE9OR19XSU5ET1cpID4+IDE7IGkgIT0gMDsgaS0tKQotICAgICAgICAgICAgICAgICAgICAgICAgewotICAgICAgICAgICAgICAgICAgICAgICAgICAgICoocE92ZXJsYXBfYW5kX0FkZF9CdWZmZXJfMSsrKSA9Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICoocEZyZXFfMl9UaW1lX2RhdGFfMSsrKSA+PiBleHA7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgKihwT3ZlcmxhcF9hbmRfQWRkX0J1ZmZlcl8xKyspID0KLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKihwRnJlcV8yX1RpbWVfZGF0YV8xKyspID4+IGV4cDsKLQotICAgICAgICAgICAgICAgICAgICAgICAgfQotCi0gICAgICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICAgICAgZWxzZSBpZiAoZXhwIDwgMCkKLSAgICAgICAgICAgICAgICAgICAgewotCi0gICAgICAgICAgICAgICAgICAgICAgICBJbnQgc2hpZnQgPSAtZXhwOwotICAgICAgICAgICAgICAgICAgICAgICAgZm9yIChpID0gKFdfTF9TVEFSVF8xIC0gTE9OR19XSU5ET1cpID4+IDE7IGkgIT0gMCA7IGktLSkKLSAgICAgICAgICAgICAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBJbnQzMiB0ZW1wMiA9ICgoSW50MzIpICogKHBGcmVxXzJfVGltZV9kYXRhXzErKykpIDw8IHNoaWZ0OwotICAgICAgICAgICAgICAgICAgICAgICAgICAgICoocE92ZXJsYXBfYW5kX0FkZF9CdWZmZXJfMSsrKSA9IHRlbXAyOwotICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRlbXAyID0gKChJbnQzMikgKiAocEZyZXFfMl9UaW1lX2RhdGFfMSsrKSkgPDwgc2hpZnQ7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgKihwT3ZlcmxhcF9hbmRfQWRkX0J1ZmZlcl8xKyspID0gdGVtcDI7Ci0gICAgICAgICAgICAgICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgICAgICBlbHNlCi0gICAgICAgICAgICAgICAgICAgIHsKLQotICAgICAgICAgICAgICAgICAgICAgICAgZm9yIChpID0gKFdfTF9TVEFSVF8xIC0gTE9OR19XSU5ET1cpID4+IDE7IGkgIT0gMDsgaS0tKQotICAgICAgICAgICAgICAgICAgICAgICAgewotICAgICAgICAgICAgICAgICAgICAgICAgICAgICoocE92ZXJsYXBfYW5kX0FkZF9CdWZmZXJfMSsrKSA9Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICoocEZyZXFfMl9UaW1lX2RhdGFfMSsrKTsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAqKHBPdmVybGFwX2FuZF9BZGRfQnVmZmVyXzErKykgPQotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqKHBGcmVxXzJfVGltZV9kYXRhXzErKyk7Ci0KLSAgICAgICAgICAgICAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgICAgICAgICB9Ci0KLQotICAgICAgICAgICAgICAgICAgICBwRnJlcV8yX1RpbWVfZGF0YV8xICA9ICZwRnJlcUluZm9bV19MX1NUQVJUXzFdOwotICAgICAgICAgICAgICAgICAgICBwRnJlcV8yX1RpbWVfZGF0YV8yICA9Ci0gICAgICAgICAgICAgICAgICAgICAgICAmcEZyZXFfMl9UaW1lX2RhdGFfMVtIQUxGX1NIT1JUX1dJTkRPV107Ci0KLSAgICAgICAgICAgICAgICAgICAgcFNob3J0X1dpbmRvd18xICAgPQotICAgICAgICAgICAgICAgICAgICAgICAgJlNob3J0X1dpbmRvd19meHBbd25kX3NoYXBlX3RoaXNfYmtdW1NIT1JUX1dJTkRPV19tXzFdOwotCi0gICAgICAgICAgICAgICAgICAgIHBTaG9ydF9XaW5kb3dfMiAgID0gcFNob3J0X1dpbmRvd18xIC0gSEFMRl9TSE9SVF9XSU5ET1c7Ci0KLSAgICAgICAgICAgICAgICAgICAgcE92ZXJsYXBfYW5kX0FkZF9CdWZmZXJfMiA9IHBPdmVybGFwX2FuZF9BZGRfQnVmZmVyXzEgKwotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgSEFMRl9TSE9SVF9XSU5ET1c7Ci0KLQotICAgICAgICAgICAgICAgICAgICBmb3IgKGkgPSBIQUxGX1NIT1JUX1dJTkRPVzsgaSAhPSAwOyBpLS0pCi0gICAgICAgICAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAgICAgICAgIEludDE2IHdpbjEsIHdpbjI7Ci0gICAgICAgICAgICAgICAgICAgICAgICBJbnQxNiAgZGF0MSwgZGF0MjsKLSAgICAgICAgICAgICAgICAgICAgICAgIEludDMyICB0ZW1wMjsKLSAgICAgICAgICAgICAgICAgICAgICAgIGRhdDEgID0gKCpwRnJlcV8yX1RpbWVfZGF0YV8xKyspOwotICAgICAgICAgICAgICAgICAgICAgICAgZGF0MiAgPSAoKnBGcmVxXzJfVGltZV9kYXRhXzIrKyk7Ci0gICAgICAgICAgICAgICAgICAgICAgICB3aW4xICA9ICoocFNob3J0X1dpbmRvd18xLS0pOwotICAgICAgICAgICAgICAgICAgICAgICAgd2luMiAgPSAqKHBTaG9ydF9XaW5kb3dfMi0tKTsKLQotICAgICAgICAgICAgICAgICAgICAgICAgdGVtcCAgID0gICBmeHBfbXVsXzE2X2J5XzE2KGRhdDEsIHdpbjEpID4+IHNoaWZ0OwotICAgICAgICAgICAgICAgICAgICAgICAgKihwT3ZlcmxhcF9hbmRfQWRkX0J1ZmZlcl8xKyspID0gdGVtcDsKLQotICAgICAgICAgICAgICAgICAgICAgICAgdGVtcDIgPSAgIGZ4cF9tdWxfMTZfYnlfMTYoZGF0Miwgd2luMikgPj4gc2hpZnQ7Ci0gICAgICAgICAgICAgICAgICAgICAgICAqKHBPdmVybGFwX2FuZF9BZGRfQnVmZmVyXzIrKykgPSB0ZW1wMjsKLQotCi0gICAgICAgICAgICAgICAgICAgIH0KLQotCi0gICAgICAgICAgICAgICAgICAgIHBPdmVybGFwX2FuZF9BZGRfQnVmZmVyXzEgKz0gSEFMRl9TSE9SVF9XSU5ET1c7Ci0KLSAgICAgICAgICAgICAgICAgICAgcHZfbWVtc2V0KAotICAgICAgICAgICAgICAgICAgICAgICAgcE92ZXJsYXBfYW5kX0FkZF9CdWZmZXJfMSwKLSAgICAgICAgICAgICAgICAgICAgICAgIDAsCi0gICAgICAgICAgICAgICAgICAgICAgICAoTE9OR19CTE9DSzEgLSBXX0xfU1RBUlRfMikKLSAgICAgICAgICAgICAgICAgICAgICAgICpzaXplb2YoKnBPdmVybGFwX2FuZF9BZGRfQnVmZmVyXzEpKTsKLQotCi0gICAgICAgICAgICAgICAgICAgIGJyZWFrOwotCi0KLSAgICAgICAgICAgICAgICBjYXNlIExPTkdfU1RPUF9TRVFVRU5DRToKLQotICAgICAgICAgICAgICAgICAgICBwT3ZlcmxhcF9hbmRfQWRkX0J1ZmZlcl8xID0gJlRpbWVfZGF0YVsgV19MX1NUT1BfMl07Ci0KLSAgICAgICAgICAgICAgICAgICAgcE91dHB1dF9idWZmZXIgICAgICAgICA9ICZPdXRwdXRfYnVmZmVyW1dfTF9TVE9QXzJdOwotCi0gICAgICAgICAgICAgICAgICAgIHBGcmVxXzJfVGltZV9kYXRhXzEgICAgICA9ICZwRnJlcUluZm9bV19MX1NUT1BfMl07Ci0KLSAgICAgICAgICAgICAgICAgICAgZXhwIC09IFNDQUxJTkc7IC8qICAhISEhICovCi0KLSAgICAgICAgICAgICAgICAgICAgaWYgKGV4cCA+IDApCi0gICAgICAgICAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAgICAgICAgIEludDE2IHRtcDEgPSAoKihwRnJlcV8yX1RpbWVfZGF0YV8xKyspID4+IGV4cCk7Ci0gICAgICAgICAgICAgICAgICAgICAgICB0ZW1wID0gKihwT3ZlcmxhcF9hbmRfQWRkX0J1ZmZlcl8xKyspOwotCi0gICAgICAgICAgICAgICAgICAgICAgICBmb3IgKGkgPSAoTE9OR19XSU5ET1cgLSBXX0xfU1RPUF8yKTsgaSAhPSAwOyBpLS0pCi0gICAgICAgICAgICAgICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgbGltaXRlcigqKHBPdXRwdXRfYnVmZmVyKyspLCAodGVtcCArIHRtcDEpKTsKLQotICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRtcDEgPSAqKHBGcmVxXzJfVGltZV9kYXRhXzErKykgPj4gZXhwOwotICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRlbXAgPSAqKHBPdmVybGFwX2FuZF9BZGRfQnVmZmVyXzErKyk7Ci0KLSAgICAgICAgICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgICAgICBlbHNlIGlmIChleHAgPCAwKQotICAgICAgICAgICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgICAgICAgICBzaGlmdCA9IC1leHA7Ci0gICAgICAgICAgICAgICAgICAgICAgICBJbnQzMiB0ZW1wMSA9ICgoSW50MzIpICogKHBGcmVxXzJfVGltZV9kYXRhXzErKykpIDw8IHNoaWZ0OwotICAgICAgICAgICAgICAgICAgICAgICAgdGVtcCA9ICoocE92ZXJsYXBfYW5kX0FkZF9CdWZmZXJfMSsrKTsKLQotICAgICAgICAgICAgICAgICAgICAgICAgZm9yIChpID0gKExPTkdfV0lORE9XIC0gV19MX1NUT1BfMik7IGkgIT0gMDsgaS0tKQotICAgICAgICAgICAgICAgICAgICAgICAgewotICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxpbWl0ZXIoKihwT3V0cHV0X2J1ZmZlcisrKSwgKHRlbXAgKyB0ZW1wMSkpOwotCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgdGVtcDEgPSAoKEludDMyKSAqIChwRnJlcV8yX1RpbWVfZGF0YV8xKyspKSA8PCBzaGlmdDsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICB0ZW1wID0gKihwT3ZlcmxhcF9hbmRfQWRkX0J1ZmZlcl8xKyspOwotCi0gICAgICAgICAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICAgICAgZWxzZQotICAgICAgICAgICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgICAgICAgICBJbnQxNiB0bXAxID0gKihwRnJlcV8yX1RpbWVfZGF0YV8xKyspOwotICAgICAgICAgICAgICAgICAgICAgICAgdGVtcCA9ICoocE92ZXJsYXBfYW5kX0FkZF9CdWZmZXJfMSsrKTsKLQotICAgICAgICAgICAgICAgICAgICAgICAgZm9yIChpID0gKExPTkdfV0lORE9XIC0gV19MX1NUT1BfMik7IGkgIT0gMDsgaS0tKQotICAgICAgICAgICAgICAgICAgICAgICAgewotICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxpbWl0ZXIoKihwT3V0cHV0X2J1ZmZlcisrKSwgKHRlbXAgKyB0bXAxKSk7Ci0KLSAgICAgICAgICAgICAgICAgICAgICAgICAgICB0bXAxID0gKihwRnJlcV8yX1RpbWVfZGF0YV8xKyspOwotICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRlbXAgPSAqKHBPdmVybGFwX2FuZF9BZGRfQnVmZmVyXzErKyk7Ci0KLSAgICAgICAgICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICAgICAgfQotCi0KLSAgICAgICAgICAgICAgICAgICAgcFNob3J0X1dpbmRvd18xID0gJlNob3J0X1dpbmRvd19meHBbd25kX3NoYXBlX3ByZXZfYmtdWzBdOwotICAgICAgICAgICAgICAgICAgICBwU2hvcnRfV2luZG93XzIgPSAmcFNob3J0X1dpbmRvd18xW0hBTEZfU0hPUlRfV0lORE9XXTsKLQotICAgICAgICAgICAgICAgICAgICBwRnJlcV8yX1RpbWVfZGF0YV8xID0gJnBGcmVxSW5mb1tXX0xfU1RPUF8xXTsKLSAgICAgICAgICAgICAgICAgICAgcEZyZXFfMl9UaW1lX2RhdGFfMiA9Ci0gICAgICAgICAgICAgICAgICAgICAgICAmcEZyZXFfMl9UaW1lX2RhdGFfMVtIQUxGX1NIT1JUX1dJTkRPV107Ci0KLSAgICAgICAgICAgICAgICAgICAgcE92ZXJsYXBfYW5kX0FkZF9CdWZmZXJfMSA9ICZUaW1lX2RhdGFbIFdfTF9TVE9QXzFdOwotICAgICAgICAgICAgICAgICAgICBwT3ZlcmxhcF9hbmRfQWRkX0J1ZmZlcl8yID0gcE92ZXJsYXBfYW5kX0FkZF9CdWZmZXJfMQotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKyBIQUxGX1NIT1JUX1dJTkRPVzsKLQotICAgICAgICAgICAgICAgICAgICBwT3V0cHV0X2J1ZmZlciAgID0gJk91dHB1dF9idWZmZXJbV19MX1NUT1BfMV07Ci0gICAgICAgICAgICAgICAgICAgIHBPdXRwdXRfYnVmZmVyXzIgPSBwT3V0cHV0X2J1ZmZlciArIEhBTEZfU0hPUlRfV0lORE9XOwotCi0gICAgICAgICAgICAgICAgICAgIGV4cCArPSBTQ0FMSU5HOyAgLyogKzggYmFjayB0byB3aGF0IGl0IHdhcyAqLwotCi0gICAgICAgICAgICAgICAgICAgIHNoaWZ0ID0gZXhwICsgMTUgLSBTQ0FMSU5HOwotCi0KLSAgICAgICAgICAgICAgICAgICAgZm9yIChpID0gSEFMRl9TSE9SVF9XSU5ET1c7IGkgIT0gMDsgaS0tKQotICAgICAgICAgICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgICAgICAgICBJbnQxNiB3aW4xOwotICAgICAgICAgICAgICAgICAgICAgICAgSW50MTYgIGRhdDE7Ci0KLSAgICAgICAgICAgICAgICAgICAgICAgIGRhdDEgPSAqKHBGcmVxXzJfVGltZV9kYXRhXzErKyk7Ci0gICAgICAgICAgICAgICAgICAgICAgICB3aW4xID0gKihwU2hvcnRfV2luZG93XzErKyk7Ci0gICAgICAgICAgICAgICAgICAgICAgICB0ZW1wID0gKihwT3ZlcmxhcF9hbmRfQWRkX0J1ZmZlcl8xKyspOwotCi0gICAgICAgICAgICAgICAgICAgICAgICB0ZXN0ICA9IGZ4cF9tdWxfMTZfYnlfMTYoZGF0MSwgd2luMSk7Ci0KLSAgICAgICAgICAgICAgICAgICAgICAgIGxpbWl0ZXIoKihwT3V0cHV0X2J1ZmZlcisrKSwgKHRlbXAgKyAodGVzdCA+PiBzaGlmdCkpKTsKLQotICAgICAgICAgICAgICAgICAgICAgICAgZGF0MSA9ICoocEZyZXFfMl9UaW1lX2RhdGFfMisrKTsKLSAgICAgICAgICAgICAgICAgICAgICAgIHdpbjEgPSAqKHBTaG9ydF9XaW5kb3dfMisrKTsKLSAgICAgICAgICAgICAgICAgICAgICAgIHRlbXAgPSAqKHBPdmVybGFwX2FuZF9BZGRfQnVmZmVyXzIrKyk7Ci0gICAgICAgICAgICAgICAgICAgICAgICB0ZXN0ID0gIGZ4cF9tdWxfMTZfYnlfMTYoZGF0MSwgd2luMSk7Ci0gICAgICAgICAgICAgICAgICAgICAgICBsaW1pdGVyKCoocE91dHB1dF9idWZmZXJfMisrKSwgKHRlbXAgKyAodGVzdCA+PiBzaGlmdCkpKTsKLQotICAgICAgICAgICAgICAgICAgICB9Ci0KLQotICAgICAgICAgICAgICAgICAgICBwRnJlcV8yX1RpbWVfZGF0YV8yID0gJnBGcmVxSW5mb1tMT05HX1dJTkRPV107Ci0KLSAgICAgICAgICAgICAgICAgICAgcE92ZXJsYXBfYW5kX0FkZF9CdWZmZXJfMSA9IFRpbWVfZGF0YTsKLQotICAgICAgICAgICAgICAgICAgICBwT3V0cHV0X2J1ZmZlciA9IE91dHB1dF9idWZmZXI7Ci0KLSAgICAgICAgICAgICAgICAgICAgcExvbmdfV2luZG93XzIgICA9Ci0gICAgICAgICAgICAgICAgICAgICAgICAmTG9uZ19XaW5kb3dfZnhwW3duZF9zaGFwZV90aGlzX2JrXVtMT05HX1dJTkRPV19tXzFdOwotCi0KLSAgICAgICAgICAgICAgICAgICAgLyoKLSAgICAgICAgICAgICAgICAgICAgICogIENvcHkgcHJldmlvdXMgdGltZSBpbiBjdXJyZW50IGJ1ZmZlciwgYWxzbyBjb3B5IG92ZXJsYXAKLSAgICAgICAgICAgICAgICAgICAgICogIGFuZCBhZGQgYnVmZmVyCi0gICAgICAgICAgICAgICAgICAgICAqLwotCi0gICAgICAgICAgICAgICAgICAgIGZvciAoaSA9IFdfTF9TVE9QXzE7IGkgIT0gMDsgaS0tKQotICAgICAgICAgICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgICAgICAgICBJbnQxNiB3aW4xOwotICAgICAgICAgICAgICAgICAgICAgICAgSW50MTYgZGF0MTsKLQotICAgICAgICAgICAgICAgICAgICAgICAgd2luMSA9ICoocExvbmdfV2luZG93XzItLSk7Ci0gICAgICAgICAgICAgICAgICAgICAgICBkYXQxID0gKnBGcmVxXzJfVGltZV9kYXRhXzIrKzsKLQotICAgICAgICAgICAgICAgICAgICAgICAgbGltaXRlcigqKHBPdXRwdXRfYnVmZmVyKyspLCAqKHBPdmVybGFwX2FuZF9BZGRfQnVmZmVyXzEpKTsKLQotCi0gICAgICAgICAgICAgICAgICAgICAgICB0ZW1wID0gZnhwX211bF8xNl9ieV8xNihkYXQxLCB3aW4xKSA+PiBzaGlmdDsKLSAgICAgICAgICAgICAgICAgICAgICAgICoocE92ZXJsYXBfYW5kX0FkZF9CdWZmZXJfMSsrKSA9IHRlbXAgOwotCi0gICAgICAgICAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgICAgICAgICBmb3IgKGkgPSAoTE9OR19XSU5ET1cgLSBXX0xfU1RPUF8xKTsgaSAhPSAwOyBpLS0pCi0gICAgICAgICAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAgICAgICAgIHRlbXAgPSBmeHBfbXVsXzE2X2J5XzE2KCpwRnJlcV8yX1RpbWVfZGF0YV8yKyssICoocExvbmdfV2luZG93XzItLSkpID4+IHNoaWZ0OwotICAgICAgICAgICAgICAgICAgICAgICAgKihwT3ZlcmxhcF9hbmRfQWRkX0J1ZmZlcl8xKyspID0gdGVtcCA7Ci0gICAgICAgICAgICAgICAgICAgIH0KLQotCi0gICAgICAgICAgICAgICAgICAgIGJyZWFrOwotCi0KLQotICAgICAgICAgICAgfSAvKiBzd2l0Y2ggKHduZF9zZXEpICovCi0KLSAgICAgICAgfSAgIC8qICBpZiAoZXhwIDwgMTYpICAqLwotCi0gICAgICAgIGVsc2UKLSAgICAgICAgewotICAgICAgICAgICAgLyogYWxsIHplcm9zIGJ1ZmZlciBvciBleGNlc3NpdmUgZG93biBzaGlmdCAqLwotCi0gICAgICAgICAgICAvKiBPdmVybGFwIGFuZCBhZGQsIHNldHVwIGJ1ZmZlciBmb3IgbmV4dCBpdGVyYXRpb24gKi8KLSAgICAgICAgICAgIHBPdmVybGFwX2FuZF9BZGRfQnVmZmVyXzEgPSAmVGltZV9kYXRhWzBdOwotCi0gICAgICAgICAgICBwT3V0cHV0X2J1ZmZlciA9IE91dHB1dF9idWZmZXI7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zZWQgYXMgc2NyYXRjaCBtZW0sCi0gICAgICAgICAqICB0aGVuIGdyYWIgZGF0YSBmcm9tIG9uZSB3aW5kb3cgYXQgYSB0aW1lIGluCi0gICAgICAgICAqICByZXZlcnNlIG9yZGVyLgotICAgICAgICAgKiAgVGhlIHVwcGVyIExPTkdfV0lORE9XIEludDMyIGFyZSB1c2VkIHRvIGhvbGQgdGhlCi0gICAgICAgICAqICBjb21wdXRlZCBvdmVybGFwIGFuZCBhZGQsIHVzZWQgaW4gdGhlIG5leHQgY2FsbCB0bwotICAgICAgICAgKiAgdGhpcyBmdW5jdGlvbiwgYW5kIGFsc28gYXMgc2N0cmFjaCBtZW1vcnkKLSAgICAgICAgICovCi0KLSAgICAgICAgLyoKLSAgICAgICAgICogIEZyZXF1ZW5jeV9kYXRhIHVzYWdlIGZvciB0aGUgY2FzZSBFSUdIVF9TSE9SVF9TRVFVRU5DRQotCi0gICAgICAgICAgfDwtLS0tLSBJbnB1dCBGcmVxLiBkYXRhIC0tLS0tPnw8IE92ZXJsYXAgJiBBZGQgLT58IFVudXNlZCB8LVNjcmF0Y2gtfAotICAgICAgICAgIHwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8ICBTdG9yZSBmb3IgbmV4dCAgfCAgICAgICAgfCAgbWVtb3J5IHwKLSAgICAgICAgICB8ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfCAgY2FsbCAgICAgICAgICAgIHwgICAgICAgIHwgICAgICAgICB8Ci0gICAgICAgICAgfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwgICAgICAgICAgICAgICAgICB8ICAgICAgICB8ICAgICAgICAgfAotICAgICAgICAgIHwvLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy98XFxcXFxcXFxcXFxcXFxcXFxcfC0tLS0tLS0tfCsrKysrKysrK3wKLSAgICAgICAgICB8ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfCAgICAgICAgICAgICAgICAgIHwgICAgICAgIHwgICAgICAgICB8Ci0gICAgICAgICAgMCAgICAgICAgICAgICAgICAgICAgICAgICBMT05HX1dJTkRPVyAgICAgICAgTE9OR19XSU5ET1cgICB8ICAgMipMT05HX1dJTkRPVwotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKyAgICAgICAgfCAgICAgICAgIHwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBXX0xfU1RPUF8yICAgIHwgICAgICAgICB8Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8PC0tICAgLS0+fAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFNIT1JUX1dJTkRPVyArCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEhBTEZfU0hPUlRfV0lORE9XCi0gICAgICAgICAgKgotICAgICAgICAgICovCi0KLSAgICAgICAgcE92ZXJsYXBfYW5kX0FkZF9CdWZmZXJfMSAgPSAmcEZyZXF1ZW5jeV9kYXRhWwotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBMT05HX1dJTkRPVyArIDMqU0hPUlRfV0lORE9XICsgSEFMRl9TSE9SVF9XSU5ET1ddOwotCi0gICAgICAgIC8qCi0gICAgICAgICAqICBJbml0aWFsaXplIHRvIHplcm8sIG9ubHkgdGhlIGZpcnQgc2hvcnQgd2luZG93IHVzZWQgaW4gb3ZlcmxhcAotICAgICAgICAgKiAgYW5kIGFkZAotICAgICAgICAgKi8KLSAgICAgICAgcHZfbWVtc2V0KAotICAgICAgICAgICAgcE92ZXJsYXBfYW5kX0FkZF9CdWZmZXJfMSwKLSAgICAgICAgICAgIDAsCi0gICAgICAgICAgICBTSE9SVF9XSU5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EgPQotICAgICAgICAgICAgICAgICZwRnJlcXVlbmN5X2RhdGFbIFdfTF9TVE9QXzEgKyBTSE9SVF9XSU5ET1cqd25kXTsKLQotCi0gICAgICAgICAgICBwT3ZlcmxhcF9hbmRfQWRkX0J1ZmZlcl8yID0KLSAgICAgICAgICAgICAgICBwT3ZlcmxhcF9hbmRfQWRkX0J1ZmZlcl8xICsgU0hPUlRfV0lORE9XOwotCi0gICAgICAgICAgICAvKgotICAgICAgICAgICAgICogIElmIGFsbCBlbGVtZW50IGFyZSB6ZXJvIG9yIGlmIHRoZSBleHBvbmVudCBpcyBiaWdnZXIgdGhhbgotICAgICAgICAgICAgICogIDE2ICggaXQgYmVjb21lcyBhbiB1bmRlZmluZWQgc2hpZnQpIC0+ICBza2lwCi0gICAgICAgICAgICAgKi8KLQotICAgICAgICAgICAgaWYgKGV4cCA8IDE2KQotICAgICAgICAgICAgewotCi0KLSAgICAgICAgICAgICAgICBwRnJlcV8yX1RpbWVfZGF0YV8xID0gJnBGcmVxSW5mb1swXTsKLSAgICAgICAgICAgICAgICBwRnJlcV8yX1RpbWVfZGF0YV8yID0gJnBGcmVxSW5mb1tTSE9SVF9XSU5ET1ddOwotCi0KLSAgICAgICAgICAgICAgICAvKgotICAgICAgICAgICAgICAgICAqICBFYWNoIG9mIHRoZSBlaWdodCBzaG9ydCBibG9ja3MgaXMgd2luZG93ZWQgc2VwYXJhdGVseS4KLSAgICAgICAgICAgICAgICAgKiAgV2luZG93IHNoYXBlIGRlY2lzaW9ucyBhcmUgbWFkZSBvbiBhIGZyYW1lLWJ5LWZyYW1lCi0gICAgICAgICAgICAgICAgICogIGJhc2lzLgotICAgICAgICAgICAgICAgICAqLwotCi0gICAgICAgICAgICAgICAgcFNob3J0X1dpbmRvd18xID0gJlNob3J0X1dpbmRvd19meHBbd25kX3NoYXBlX3RoaXNfYmtdWzBdOwotCi0gICAgICAgICAgICAgICAgcFNob3J0X1dpbmRvd18yICAgPQotICAgICAgICAgICAgICAgICAgICAmU2hvcnRfV2luZG93X2Z4cFt3bmRfc2hhcGVfdGhpc19ia11bU0hPUlRfV0lORE9XX21fMV07Ci0KLQotCi0KLSAgICAgICAgICAgICAgICAvKgotICAgICAgICAgICAgICAgICAqIEZvciBzaG9ydCB3aW5kb3dzIGZyb20gNyB0byA1Ci0gICAgICAgICAgICAgICAgICogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwgICA9PT09PT09PT09PT09PT09PT09PT09PT09Ci0gICAgICAgICAgICAgICAgICogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwgICB8ICAgICA1ICAgICA2ICAgICA3Ci0gICAgICAgICAgICAgICAgICogICAgICAgICAgICAgICBfLS1fICBfLS1fICBfLS1fICBfLS1fIHwgXy18LV8gIF8tLV8gIF8tLV8gIF8tLV8KLSAgICAgICAgICAgICAgICAgKiAgICAgICAgICAgICAgLyAgICBcLyAgICBcLyAgICBcLyAgICBcfC8gIHwgIFwvICAgIFwvICAgIFwvICAgIFwKLSAgICAgICAgICAgICAgICAgKiAgICAgICAgICAgICAvICAgICAvXCAgICAvXCAgICAvXCAgICAvfFwgIHwgIC9cICAgIC9cICAgIC9cICAgICBcCi0gICAgICAgICAgICAgICAgICogICAgICAgICAgICAvICAgICAvICBcICAvICBcICAvICBcICAvIHwgXCB8IC8gIFwgIC8gIFwgIC8gIFwgICAgIFwKLSAgICAgICAgICAgICAgICAgKiAgICAgICAgICAgLyAgICAgLyAgICBcLyAgICBcLyAgICBcLyAgfCAgXHwvICAgIFwvICAgIFwgICAgIFwgICAgIFwKLSAgICAgICAgICAgICAgICAgKiAgICAgIC0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tfC0tLVsvLy8vLy8vLy8vLy8vLy8vLy8vLy8vL10tLS0tLS0tLQotICAgICAgICAgICAgICAgICAqCi0gICAgICAgICAgICAgICAgICovCi0KLQotICAgICAgICAgICAgICAgIHNoaWZ0ID0gZXhwICsgMTUgLSBTQ0FMSU5HOwotCi0KLSAgICAgICAgICAgICAgICBmb3IgKGkgPSBTSE9SVF9XSU5ET1c7IGkgIT0gMDsgaS0tKQotICAgICAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAgICAgSW50MTYgd2luMSwgd2luMjsKLSAgICAgICAgICAgICAgICAgICAgSW50MTYgIGRhdDEsIGRhdDI7Ci0KLSAgICAgICAgICAgICAgICAgICAgZGF0MiA9ICoocEZyZXFfMl9UaW1lX2RhdGFfMisrKTsKLSAgICAgICAgICAgICAgICAgICAgd2luMiA9ICoocFNob3J0X1dpbmRvd18yLS0pOwotICAgICAgICAgICAgICAgICAgICB0ZW1wID0gKnBPdmVybGFwX2FuZF9BZGRfQnVmZmVyXzI7Ci0gICAgICAgICAgICAgICAgICAgIGRhdDEgPSAqKHBGcmVxXzJfVGltZV9kYXRhXzErKyk7Ci0gICAgICAgICAgICAgICAgICAgIHdpbjEgPSAqKHBTaG9ydF9XaW5kb3dfMSsrKTsKLQotICAgICAgICAgICAgICAgICAgICAqKHBPdmVybGFwX2FuZF9BZGRfQnVmZmVyXzIrKykgPSAgdGVtcCArIChmeHBfbXVsXzE2X2J5XzE2KGRhdDIsIHdpbjIpID4+IHNoaWZ0KTsKLQotICAgICAgICAgICAgICAgICAgICAqKHBPdmVybGFwX2FuZF9BZGRfQnVmZmVyXzErKykgID0gIGZ4cF9tdWxfMTZfYnlfMTYoZGF0MSwgd2luMSkgPj4gc2hpZnQ7Ci0KLSAgICAgICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgIH0gICAvKiBpZiAoZXhwIDwgMTYpICovCi0gICAgICAgICAgICBlbHNlCi0gICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgcHZfbWVtc2V0KAotICAgICAgICAgICAgICAgICAgICBwT3ZlcmxhcF9hbmRfQWRkX0J1ZmZlcl8xLAotICAgICAgICAgICAgICAgICAgICAwLAotICAgICAgICAgICAgICAgICAgICBTSE9SVF9XSU5ET1cqc2l6ZW9mKCpwT3ZlcmxhcF9hbmRfQWRkX0J1ZmZlcl8xKSk7Ci0gICAgICAgICAgICB9Ci0KLQotICAgICAgICB9LyogZm9yICggd25kPU5VTV9TSE9SVF9XSU5ET1dTLTE7IHduZD49TlVNX1NIT1JUX1dJTkRPV1MvMjsgd25kLS0pICovCi0KLQotICAgICAgICB3bmQgPSBOVU1fU0hPUlRfV0lORE9XUyAvIDI7Ci0KLSAgICAgICAgcEZyZXFJbmZvID0gKEludDE2ICopICYgcEZyZXF1ZW5jeV9kYXRhWyB3bmQqU0hPUlRfV0lORE9XXTsKLQotICAgICAgICAvKgotICAgICAgICAgKiAgc2NyYXRjaCBtZW1vcnkgaXMgYWxsb2NhdGVkIGluIGFuIHVudXNlZCBwYXJ0IG9mIG1lbW9yeQotICAgICAgICAgKi8KLQotCi0gICAgICAgIHBTY3JhdGhfbWVtID0gJnBGcmVxdWVuY3lfZGF0YVsgMipMT05HX1dJTkRPVyAtIEhBTEZfU0hPUlRfV0lORE9XXTsKLQotICAgICAgICBwT3ZlcmxhcF9hbmRfQWRkX0J1ZmZlcl8xID0gJnBGcmVxdWVuY3lfZGF0YVsgTE9OR19XSU5ET1ddOwotCi0gICAgICAgIHBPdmVybGFwX2FuZF9BZGRfQnVmZmVyXzIgPSBwT3ZlcmxhcF9hbmRfQWRkX0J1ZmZlcl8xCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICArIEhBTEZfU0hPUlRfV0lORE9XOwotCi0KLSAgICAgICAgZXhwID0gaW1kY3RfZnhwKAotICAgICAgICAgICAgICAgICAgKEludDMyICopcEZyZXFJbmZvLAotICAgICAgICAgICAgICAgICAgZnJlcV8yX3RpbWVfYnVmZmVyLAotICAgICAgICAgICAgICAgICAgU0hPUlRfQkxPQ0sxLAotICAgICAgICAgICAgICAgICAgUV9mb3JtYXQsCi0gICAgICAgICAgICAgICAgICBhYnNfbWF4X3Blcl93aW5kb3dbd25kXSk7Ci0KLSAgICAgICAgLyoKLSAgICAgICAgICogIElmIGFsbCBlbGVtZW50IGFyZSB6ZXJvIG9yIGlmIHRoZSBleHBvbmVudCBpcyBiaWdnZXIgdGhhbgotICAgICAgICAgKiAgMTYgKCBpdCBiZWNvbWVzIGFuIHVuZGVmaW5lZCBzaGlmdCkgLT4gIHNraXAKLSAgICAgICAgICovCi0KLQotICAgICAgICBpZiAoZXhwIDwgMTYpCi0gICAgICAgIHsKLQotICAgICAgICAgICAgcEZyZXFfMl9UaW1lX2RhdGFfMSA9ICZwRnJlcUluZm9bMF07Ci0gICAgICAgICAgICBwRnJlcV8yX1RpbWVfZGF0YV8yID0gJnBGcmVxSW5mb1tTSE9SVF9XSU5ET1ddOwotCi0gICAgICAgICAgICBwU2hvcnRfV2luZG93XzEgPSAmU2hvcnRfV2luZG93X2Z4cFt3bmRfc2hhcGVfdGhpc19ia11bMF07Ci0KLSAgICAgICAgICAgIHBTaG9ydF9XaW5kb3dfMiA9Ci0gICAgICAgICAgICAgICAgJlNob3J0X1dpbmRvd19meHBbd25kX3NoYXBlX3RoaXNfYmtdW1NIT1JUX1dJTkRPV19tXzFdOwotCi0KLSAgICAgICAgICAgIC8qCi0gICAgICAgICAgICAgKiBGb3Igc2hvcnQgd2luZG93IDQKLSAgICAgICAgICAgICAqICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPT09PXw9PT09PT09PT09PQotICAgICAgICAgICAgICogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfCAgIDQKLSAgICAgICAgICAgICAqICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfCAgIHwgICB8ICAgICAgfAotICAgICAgICAgICAgICogICAgICAgICAgICAgICAgXy0tXyAgXy0tXyAgXy0tXyAgXy18LV8gfCBfLXwtXyAgXy18LV8gIF8tLV8gIF8tLV8KLSAgICAgICAgICAgICAqICAgICAgICAgICAgICAgLyAgICBcLyAgICBcLyAgICBcLyAgfCAgXHwvICB8ICBcLyAgfCAgXC8gICAgXC8gICAgXAotICAgICAgICAgICAgICogICAgICAgICAgICAgIC8gICAgIC9cICAgIC9cICAgIC9cICB8ICAvfFwgIHwgIC9cICB8ICAvXCAgICAvXCAgICAgXAotICAgICAgICAgICAgICogICAgICAgICAgICAgLyAgICAgLyAgXCAgLyAgXCAgLyAgXCB8IC8gfCBcIHwgLyAgXCB8IC8gIFwgIC8gIFwgICAgIFwKLSAgICAgICAgICAgICAqICAgICAgICAgICAgLyAgICAgLyAgICBcLyAgICBcLyAgICBcfC8gIHwgIFx8LyAgICBcfC8gICAgXC8gICAgXCAgICAgXAotICAgICAgICAgICAgICogICAgICAtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS1bXFxcfFxcXHwvLy8vLy9dLS0tLS0tLS0tLS0tLS0tLS0tLQotICAgICAgICAgICAgICogICAgICAgICAgIHwgICAgICAgICAgICAgICAgICAgICAgICB8IEEgfCBCIHwgICBDICB8Ci0gICAgICAgICAgICAgKiAgICAgICAgICAgfAotICAgICAgICAgICAgICogICAgICAgIFdfTF9TVE9QXzEKLSAgICAgICAgICAgICAqLwotCi0gICAgICAgICAgICBzaGlmdCA9IGV4cCArIDE1IC0gU0NBTElORzsKLSAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICBJbnQxNiB3aW4xOwotICAgICAgICAgICAgICAgIEludDE2ICBkYXQxOwotICAgICAgICAgICAgICAgIC8qIC0tLS0tLS0tIHNlZ21lbnQgQSAtLS0tLS0tLS0tLS0tLS0qLwotICAgICAgICAgICAgICAgIGRhdDEgPSAqKHBGcmVxXzJfVGltZV9kYXRhXzErKyk7Ci0gICAgICAgICAgICAgICAgd2luMSA9ICoocFNob3J0X1dpbmRvd18xKyspOwotICAgICAgICAgICAgICAgIGZvciAoaSA9IEhBTEZfU0hPUlRfV0lORE9XOyBpICE9IDA7IGktLSkKLSAgICAgICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgICAgICoocFNjcmF0aF9tZW0rKykgID0gIGZ4cF9tdWxfMTZfYnlfMTYoZGF0MSwgd2luMSkgPj4gKHNoaWZ0KTsKLSAgICAgICAgICAgICAgICAgICAgZGF0MSA9ICoocEZyZXFfMl9UaW1lX2RhdGFfMSsrKTsKLSAgICAgICAgICAgICAgICAgICAgd2luMSA9ICoocFNob3J0X1dpbmRvd18xKyspOwotICAgICAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgICAgIC8qIC0tLS0tLS0tIHNlZ21lbnQgQiAtLS0tLS0tLS0tLS0tLS0qLwotICAgICAgICAgICAgICAgIGZvciAoaSA9IEhBTEZfU0hPUlRfV0lORE9XOyBpICE9IDA7IGktLSkKLSAgICAgICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgICAgICoocE92ZXJsYXBfYW5kX0FkZF9CdWZmZXJfMSsrKSAgPSAgZnhwX211bF8xNl9ieV8xNihkYXQxLCB3aW4xKSA+PiBzaGlmdDsKLQotICAgICAgICAgICAgICAgICAgICBkYXQxID0gKihwRnJlcV8yX1RpbWVfZGF0YV8xKyspOwotICAgICAgICAgICAgICAgICAgICB3aW4xID0gKihwU2hvcnRfV2luZG93XzErKyk7Ci0gICAgICAgICAgICAgICAgfQotCi0gICAgICAgICAgICAgICAgLyogLS0tLS0tLS0gc2VnbWVudCBDIC0tLS0tLS0tLS0tLS0tLSovCi0gICAgICAgICAgICAgICAgdGVtcCA9ICpwT3ZlcmxhcF9hbmRfQWRkX0J1ZmZlcl8yOwotICAgICAgICAgICAgICAgIGRhdDEgPSAqKHBGcmVxXzJfVGltZV9kYXRhXzIrKyk7Ci0gICAgICAgICAgICAgICAgd2luMSA9ICoocFNob3J0X1dpbmRvd18yLS0pOwotCi0gICAgICAgICAgICAgICAgZm9yIChpID0gU0hPUlRfV0lORE9XOyBpICE9IDA7IGktLSkKLSAgICAgICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgICAgICoocE92ZXJsYXBfYW5kX0FkZF9CdWZmZXJfMisrKSAgPSAgdGVtcCArIChmeHBfbXVsXzE2X2J5XzE2KGR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0aF9tZW1fZW50cnk7Ci0KLSAgICAgICAgcE92ZXJsYXBfYW5kX0FkZF9CdWZmZXJfMSA9ICZwRnJlcXVlbmN5X2RhdGFbIExPTkdfV0lORE9XXTsKLQotICAgICAgICAvKiBwb2ludCB0byBlbmQgb2YgYnVmZmVyIGxlc3MgSEFMRl9TSE9SVF9XSU5ET1cgKi8KLQotICAgICAgICBwT3V0cHV0X2J1ZmZlcl8yID0gJk91dHB1dF9idWZmZXJbTE9OR19XSU5ET1cgLSBIQUxGX1NIT1JUX1dJTkRPV107Ci0gICAgICAgIHBPdXRwdXRfYnVmZmVyICAgPSBwT3V0cHV0X2J1ZmZlcl8yOwotCi0gICAgICAgIHBPdmVybGFwX2FuZF9BZGRfQnVmZmVyXzF4ID0gJlRpbWVfZGF0YVtXX0xfU1RPUF8xICsgU0hPUlRfV0lORE9XKih3bmQrMSldOyAgLyogISEhISAqLwotCi0gICAgICAgIGV4cCA9IGltZGN0X2Z4cCgKLSAgICAgICAgICAgICAgICAgIChJbnQzMiAqKXBGcmVxSW5mbywKLSAgICAgICAgICAgICAgICAgIGZyZXFfMl90aW1lX2J1ZmZlciwKLSAgICAgICAgICAgICAgICAgIFNIT1JUX0JMT0NLMSwKLSAgICAgICAgICAgICAgICAgIFFfZm9ybWF0LAotICAgICAgICAgICAgICAgICAgYWJzX21heF9wZXJfd2luZG93W3duZF0pOwotCi0gICAgICAgIC8qCi0gICAgICAgICAqICBJZiBhbGwgZWxlbWVudCBhcmUgemVybyBvciBpZiB0aGUgZXhwb25lbnQgaXMgYmlnZ2VyIHRoYW4KLSAgICAgICAgICogIDE2ICggaXQgYmVjb21lcyBhbiB1bmRlZmluZWQgc2hpZnQpIC0+ICBza2lwCi0gICAgICAgICAqLwotCi0gICAgICAgIGlmIChleHAgPCAxNikKLSAgICAgICAgewotCi0gICAgICAgICAgICBwRnJlcV8yX1RpbWVfZGF0YV8xID0gJnBGcmVxSW5mb1swXTsKLSAgICAgICAgICAgIHBGcmVxXzJfVGltZV9kYXRhXzIgPSAmcEZyZXFJbmZvW1NIT1JUX1dJTkRPV107Ci0KLQotICAgICAgICAgICAgLyoKLSAgICAgICAgICAgICAqIEZvciBzaG9ydCB3aW5kb3cgMwotICAgICAgICAgICAgICogICAgICAgICAgICAgICAgICAgICAgICAgICAgID09PT09PT09PT09fD09PT0KLSAgICAgICAgICAgICAqICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMyAgIHwKLSAgICAgICAgICAgICAqICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8ICAgICAgfCAgIHwgICB8Ci0gICAgICAgICAgICAgKiAgICAgICAgICAgICAgIF8tLV8gIF8tLV8gIF8tfC1fICBfLXwtXyB8IF8tfC1fICBfLS1fICBfLS1fICBfLS1fCi0gICAgICAgICAgICAgKiAgICAgICAgICAgICAgLyAgICBcLyAgICBcLyAgfCAgXC8gIHwgIFx8LyAgfCAgXC8gICAgXC8gICAgXC8gICAgXAotICAgICAgICAgICAgICogICAgICAgICAgICAgLyAgICAgL1wgICAgL1wgIHwgIC9cICB8ICAvfFwgIHwgIC9cICAgIC9cICAgIC9cICAgICBcCi0gICAgICAgICAgICAgKiAgICAgICAgICAgIC8gICAgIC8gIFwgIC8gIFwgfCAvICBcIHwgLyB8IFwgfCAvICBcICAvICBcICAvICBcICAgICBcCi0gICAgICAgICAgICAgKiAgICAgICAgICAgLyAgICAgLyAgICBcLyAgICBcfC8gICAgXHwvICB8ICBcfC8gICAgXC8gICAgXCAgICAgXCAgICAgXAotICAgICAgICAgICAgICogICAgIC0tLS0tfC0tLS0tLS0tLS0tLS0tLS0tLVtcXFxcXFx8Ly8vfC8vL10tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLQotICAgICAgICAgICAgICogICAgICAgICAgfCAgICAgICAgICAgICAgICAgIHwgICBBICB8IEIgfCBDIHwKLSAgICAgICAgICAgICAqCi0gICAgICAgICAgICAgKiAgICAgIFdfTF9TVE9QXzEKLSAgICAgICAgICAgICAqLwotCi0KLSAgICAgICAgICAgIHBTaG9ydF9XaW5kb3dfMSA9ICZTaG9ydF9XaW5kb3dfZnhwW3duZF9zaGFwZV90aGlzX2JrXVswXTsKLQotICAgICAgICAgICAgcFNob3J0X1dpbmRvd18yID0KLSAgICAgICAgICAgICAgICAmU2hvcnRfV2luZG93X2Z4cFt3bmRfc2hhcGVfdGhpc19ia11bU0hPUlRfV0lORE9XX21fMV07Ci0KLSAgICAgICAgICAgIHNoaWZ0ID0gZXhwICsgMTUgLSBTQ0FMSU5HOwotCi0KLSAgICAgICAgICAgIEludDE2IHdpbjE7Ci0gICAgICAgICAgICBJbnQxNiAgZGF0MTsKLSAgICAgICAgICAgIC8qIC0tLS0tLS0tIHNlZ21lbnQgQSAtLS0tLS0tLS0tLS0tLS0qLwotICAgICAgICAgICAgZGF0MSA9ICoocEZyZXFfMl9UaW1lX2RhdGFfMSsrKTsKLSAgICAgICAgICAgIHdpbjEgPSAqKHBTaG9ydF9XaW5kb3dfMSsrKTsKLSAgICAgICAgICAgIGZvciAoaSA9IFNIT1JUX1dJTkRPVzsgaSAhPSAwOyBpLS0pCi0gICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgKihwU2NyYXRoX21lbSsrKSAgPSAgZnhwX211bF8xNl9ieV8xNihkYXQxLCB3aW4xKSA+PiBzaGlmdDsKLSAgICAgICAgICAgICAgICBkYXQxID0gKihwRnJlcV8yX1RpbWVfZGF0YV8xKyspOwotICAgICAgICAgICAgICAgIHdpbjEgPSAqKHBTaG9ydF9XaW5kb3dfMSsrKTsKLSAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgZGF0MSA9ICoocEZyZXFfMl9UaW1lX2RhdGFfMisrKTsKLSAgICAgICAgICAgIHdpbjEgPSAqKHBTaG9ydF9XaW5kb3dfMi0tKTsKLQotICAgICAgICAgICAgLyogLS0tLS0tLS0gc2VnbWVudCBCIC0tLS0tLS0tLS0tLS0tLSovCi0gICAgICAgICAgICBmb3IgKGkgPSBIQUxGX1NIT1JUX1dJTkRPVzsgaSAhPSAwOyBpLS0pCi0gICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgdGVzdCA9IGZ4cF9tdWxfMTZfYnlfMTYoZGF0MSwgd2luMSkgPj4gc2hpZnQ7Ci0KLSAgICAgICAgICAgICAgICB0ZW1wID0gICoocFNjcmF0aF9tZW0rKykgKyB0ZXN0OwotCi0KLSAgICAgICAgICAgICAgICB0ZXN0ID0gKihwT3ZlcmxhcF9hbmRfQWRkX0J1ZmZlcl8xeCsrKTsgIC8qICEhISEgKi8KLQotICAgICAgICAgICAgICAgIGxpbWl0ZXIoKihwT3V0cHV0X2J1ZmZlcisrKSwgKHRlbXAgKyB0ZXN0KSk7Ci0KLSAgICAgICAgICAgICAgICBkYXQxID0gKihwRnJlcV8yX1RpbWVfZGF0YV8yKyspOwotICAgICAgICAgICAgICAgIHdpbjEgPSAqKHBTaG9ydF9XaW5kb3dfMi0tKTsKLQotICAgICAgICAgICAgfQotCi0gICAgICAgICAgICAvKiAtLS0tLS0tLSBzZWdtZW50IEMgLS0tLS0tLS0tLS0tLS0tKi8KLSAgICAgICAgICAgIGZvciAoaSA9IEhBTEZfU0hPUlRfV0lORE9XOyBpICE9IDA7IGktLSkKLSAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICB0ZW1wID0gZnhwX211bF8xNl9ieV8xNihkYXQxLCB3aW4xKSA+PiAoc2hpZnQpOwotCi0gICAgICAgICAgICAgICAgKihwT3ZlcmxhcF9hbmRfQWRkX0J1ZmZlcl8xKyspICs9IHRlbXA7Ci0KLSAgICAgICAgICAgICAgICBkYXQxID0gKihwRnJlcV8yX1RpbWVfZGF0YV8yKyspOwotICAgICAgICAgICAgICAgIHdpbjEgPSAqKHBTaG9ydF9XaW5kb3dfMi0tKTsKLSAgICAgICAgICAgIH0KLQotICAgICAgICB9ICAgLyogaWYgKGV4cCA8IDE2KSAqLwotICAgICAgICBlbHNlCi0gICAgICAgIHsKLQotICAgICAgICAgICAgcHZfbWVtc2V0KAotICAgICAgICAgICAgICAgIHBTY3JhdGhfbWVtLAotICAgICAgICAgICAgICAgIDAsCi0gICAgICAgICAgICAgICAgU0hPUlRfV0lORE9XKnNpemVvZigqcFNjcmF0aF9tZW0pKTsKLQotICAgICAgICAgICAgcFNjcmF0aF9tZW0gKz0gU0hPUlRfV0lORE9XOwotCi0gICAgICAgICAgICB0ZW1wID0gKihwU2NyYXRoX21lbSsrKTsKLSAgICAgICAgICAgIGZvciAoaSA9IEhBTEZfU0hPUlRfV0lORE9XOyBpICE9IDA7IGktLSkKLSAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICBsaW1pdGVyKCoocE91dHB1dF9idWZmZXIrKyksIHRlbXApOwotICAgICAgICAgICAgICAgIHRlbXAgPSAqKHBTY3JhdGhfbWVtKyspOwotCi0KLSAgICAgICAgICAgIH0KLSAgICAgICAgfQotCi0KLSAgICAgICAgZm9yICh3bmQgPSBOVU1fU0hPUlRfV0lORE9XUyAvIDIgLSAyOyB3bmQgPj0gMDsgd25kLS0pCi0gICAgICAgIHsKLQotCi0gICAgICAgICAgICBwT3V0cHV0X2J1ZmZlcl8yIC09IFNIT1JUX1dJTkRPVzsKLSAgICAgICAgICAgIHBPdXRwdXRfYnVmZmVyID0gcE91dHB1dF9idWZmZXJfMjsKLQotICAgICAgICAgICAgLyoKLSAgICAgICAgICAgICAqIFRoZSBzYW1lIG1lbW9yeSBpcyB1c2VkIGFzIHNjcmF0Y2ggaW4gZXZlcnkgaXRlcmF0aW9uCi0gICAgICAgICAgICAgKi8KLSAgICAgICAgICAgIHBTY3JhdGhfbWVtID0gcFNjcmF0aF9tZW1fZW50cnk7Ci0KLSAgICAgICAgICAgIHBPdmVybGFwX2FuZF9BZGRfQnVmZmVyXzJ4ID0KLSAgICAgICAgICAgICAgICAmVGltZV9kYXRhW1dfTF9TVE9QXzEgKyBTSE9SVF9XSU5ET1cqKHduZCsxKV07Ci0KLSAgICAgICAgICAgIHBGcmVxSW5mbyA9IChJbnQxNiAqKSAmIHBGcmVxdWVuY3lfZGF0YVsgd25kKlNIT1JUX1dJTkRPV107Ci0KLQotCi0gICAgICAgICAgICBleHAgPSBpbWRjdF9meHAoCi0gICAgICAgICAgICAgICAgICAgICAgKEludDMyICopcEZyZXFJbmZvLAotICAgICAgICAgICAgICAgICAgICAgIGZyZXFfMl90aW1lX2J1ZmZlciwKLSAgICAgICAgICAgICAgICAgICAgICBTSE9SVF9CTE9DSzEsCi0gICAgICAgICAgICAgICAgICAgICAgUV9mb3JtYXQsCi0gICAgICAgICAgICAgICAgICAgICAgYWJzX21heF9wZXJfd2luZG93W3duZF0pOwotCi0gICAgICAgICAgICAvKgotICAgICAgICAgICAgICogIElmIGFsbCBlbGVtZW50IGFyZSB6ZXJvIG9yIGlmIHRoZSBleHBvbmVudCBpcyBiaWdnZXIgdGhhbgotICAgICAgICAgICAgICogIDE2ICggaXQgYmVjb21lcyBhbiB1bmRlZmluZWQgc2hpZnQpIC0+ICBza2lwCi0gICAgICAgICAgICAgKi8KLQotICAgICAgICAgICAgaWYgKGV4cCA8IDE2KQotICAgICAgICAgICAgewotCi0gICAgICAgICAgICAgICAgcEZyZXFfMl9UaW1lX2RhdGFfMSA9ICZwRnJlcUluZm9bMF07Ci0gICAgICAgICAgICAgICAgcEZyZXFfMl9UaW1lX2RhdGFfMiA9ICZwRnJlcUluZm9bU0hPUlRfV0lORE9XXTsKLQotCi0gICAgICAgICAgICAgICAgLyoKLSAgICAgICAgICAgICAgICAgKiAgRWFjaCBvZiB0aGUgZWlnaHQgc2hvcnQgYmxvY2tzIGlzIHdpbmRvd2VkIHNlcGFyYXRlbHkuCi0gICAgICAgICAgICAgICAgICogIFdpbmRvdyBzaGFwZSBkZWNpc2lvbnMgYXJlIG1hZGUgb24gYSBmcmFtZS1ieS1mcmFtZQotICAgICAgICAgICAgICAgICAqICBiYXNpcy4KLSAgICAgICAgICAgICAgICAgKi8KLQotICAgICAgICAgICAgICAgIHBTaG9ydF9XaW5kb3dfMSA9ICZTaG9ydF9XaW5kb3dfZnhwW3duZF9zaGFwZV90aGlzX2JrXVswXTsKLQotICAgICAgICAgICAgICAgIGlmICh3bmQgPT0gMCkKLSAgICAgICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgICAgIHBTaG9ydF9XaW5kb3dfMSA9Ci0gICAgICAgICAgICAgICAgICAgICAgICAmU2hvcnRfV2luZG93X2Z4cFt3bmRfc2hhcGVfcHJldl9ia11bMF07Ci0gICAgICAgICAgICAgICAgfQotCi0gICAgICAgICAgICAgICAgcFNob3J0X1dpbmRvd18yICAgPQotICAgICAgICAgICAgICAgICAgICAmU2hvcnRfV2luZG93X2Z4cFt3bmRfc2hhcGVfdGhpc19ia11bU0hPUlRfV0lORE9XX21fMV07Ci0KLQotICAgICAgICAgICAgICAgIC8qCi0gICAgICAgICAgICAgICAgICogRm9yIHNob3J0IHdpbmRvd3MgZnJvbSAyIHRvIDAKLSAgICAgICAgICAgICAgICAgKgotICAgICAgICAgICAgICAgICAqICAgICAgICAgID09PT09PT09PT09PT09PT09PT09PT09PT0KLSAgICAgICAgICAgICAgICAgKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwKLSAgICAgICAgICAgICAgICAgKiAgICAgICAgICAgICAgICAwICAgICAxICAgICAyICAgICAgfCAgIHwKLSAgICAgICAgICAgICAgICAgKiAgICAgICAgICAgICAgIF8tLV8gIF8tLV8gIF8tLV8gIF8tfC1fIHwgXy0tXyAgXy0tXyAgXy0tXyAgXy0tXwotICAgICAgICAgICAgICAgICAqICAgICAgICAgICAgICAvICAgIFwvICAgIFwvICAgIFwvICB8ICBcfC8gICAgXC8gICAgXC8gICAgXC8gICAgXAotICAgICAgICAgICAgICAgICAqICAgICAgICAgICAgIC8gICAgIC9cICAgIC9cICAgIC9cICB8ICAvfFwgICAgL1wgICAgL1wgICAgL1wgICAgIFwKLSAgICAgICAgICAgICAgICAgKiAgICAgICAgICAgIC8gICAgIC8gIFwgIC8gIFwgIC8gIFwgfCAvIHwgXCAgLyAgXCAgLyAgXCAgLyAgXCAgICAgXAotICAgICAgICAgICAgICAgICAqICAgICAgICAgICAvICAgICAvICAgIFwvICAgIFwvICAgIFx8LyAgfCAgXC8gICAgXC8gICAgXCAgICAgXCAgICAgXAotICAgICAgICAgICAgICAgICAqICAgICAgLS0tLVtcXFxcXFxcXFxcXFxcXFxcXFxcXFxcXFxdLS0tfC0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tCi0gICAgICAgICAgICAgICAgICogICAgICAgICAgfAotICAgICAgICAgICAgICAgICAqCi0gICAgICAgICAgICAgICAgICogICAgICBXX0xfU1RPUF8xCi0gICAgICAgICAgICAgICAgICovCi0KLSAgICAgICAgICAgICAgICBzaGlmdCA9IGV4cCArIDE1IC0gU0NBTElORzsKLQotICAgICAgICAgICAgICAgIEludDE2IGRhdDEgPSAqKHBGcmVxXzJfVGltZV9kYXRhXzIrKyk7Ci0gICAgICAgICAgICAgICAgSW50MTYgd2luMSA9ICoocFNob3J0X1dpbmRvd18yLS0pOwotCi0gICAgICAgICAgICAgICAgdGVtcCAgPSAgKihwU2NyYXRoX21lbSk7Ci0gICAgICAgICAgICAgICAgZm9yIChpID0gU0hPUlRfV0lORE9XOyBpICE9IDA7IGktLSkKLSAgICAgICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgICAgIHRlc3QgID0gIGZ4cF9tdWxfMTZfYnlfMTYoZGF0MSwgd2luMSkgPj4gc2hpZnQ7Ci0KLSAgICAgICAgICAgICAgICAgICAgdGVtcCArPSB0ZXN0OwotCi0gICAgICAgICAgICAgICAgICAgIGRhdDEgPSAqKHBGcmVxXzJfVGltZV9kYXRhXzErKyk7Ci0gICAgICAgICAgICAgICAgICAgIHdpbjEgPSAqKHBTaG9ydF9XaW5kb3dfMSsrKTsKLQotICAgICAgICAgICAgICAgICAgICBsaW1pdGVyKCoocE91dHB1dF9idWZmZXIrKyksICh0ZW1wICsgKihwT3ZlcmxhcF9hbmRfQWRkX0J1ZmZlcl8yeCsrKSkpOwotCi0KLSAgICAgICAgICAgICAgICAgICAgKihwU2NyYXRoX21lbSsrKSA9IGZ4cF9tdWxfMTZfYnlfMTYoZGF0MSwgd2luMSkgPj4gc2hpZnQ7Ci0gICAgICAgICAgICAgICAgICAgIGRhdDEgPSAqKHBGcmVxXzJfVGltZV9kYXRhXzIrKyk7Ci0gICAgICAgICAgICAgICAgICAgIHdpbjEgPSAqKHBTaG9ydF9XaW5kb3dfMi0tKTsKLSAgICAgICAgICAgICAgICAgICAgdGVtcCAgPSAgKihwU2NyYXRoX21lbSk7Ci0KLSAgICAgICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgIH0gICAvKiBpZiAoZXhwIDwgMTYpICovCi0gICAgICAgICAgICBlbHNlCi0gICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgdGVzdCAgPSAqKHBTY3JhdGhfbWVtKTsKLSAgICAgICAgICAgICAgICB0ZW1wICA9ICoocE92ZXJsYXBfYW5kX0FkZF9CdWZmZXJfMngrKyk7Ci0KLSAgICAgICAgICAgICAgICBmb3IgKGkgPSBTSE9SVF9XSU5ET1c7IGkgIT0gMDsgaS0tKQotICAgICAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAgICAgbGltaXRlcigqKHBPdXRwdXRfYnVmZmVyKyspLCAodGVtcCArIHRlc3QpKTsKLQotICAgICAgICAgICAgICAgICAgICAqKHBTY3JhdGhfbWVtKyspID0gMDsKLSAgICAgICAgICAgICAgICAgICAgdGVzdCAgPSAgKihwU2NyYXRoX21lbSk7Ci0gICAgICAgICAgICAgICAgICAgIHRlbXAgID0gKihwT3ZlcmxhcF9hbmRfQWRkX0J1ZmZlcl8yeCsrKTsKLQotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgIH0KLQotICAgICAgICB9ICAgLyogZm9yICggd25kPU5VTV9TSE9SVF9XSU5ET1dTLzItMTsgd25kPj0wOyB3bmQtLSkgKi8KLQotICAgICAgICBwT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Z4cF8yKAotICAgIEludDMyICAgICAgICAgICAgICAgRnJlcXVlbmN5X2RhdGFbXSwKLSAgICBJbnQzMiAgICAgICAgICAgICAgIFRpbWVfZGF0YVtdLAotICAgIFdJTkRPV19TRVFVRU5DRSAgICAgd25kX3NlcSwKLSAgICBJbnQgICAgICAgICAgICAgICAgIHduZF9zaGFwZV9wcmV2X2JrLAotICAgIEludCAgICAgICAgICAgICAgICAgd25kX3NoYXBlX3RoaXNfYmssCi0gICAgSW50ICAgICAgICAgICAgICAgICBRX2Zvcm1hdCwKLSAgICBJbnQzMiAgICAgICAgICAgICAgIGFic19tYXhfcGVyX3dpbmRvd1tdLAotICAgIEludDMyICAgICAgICAgICAgICAgZnJlcV8yX3RpbWVfYnVmZmVyW10sCi0gICAgSW50MTYgICAgICAgICAgICAgICAqSW50ZXJsZWF2ZWRfb3V0cHV0KQotCi17Ci0KLSAgICBJbnQgZXhwOwotICAgIEludCBzaGlmdDsKLQotICAgIEludCAgaTsKLSAgICBJbnQgIHduZDsKLSNpZiAhKGRlZmluZWQoIFBWX0FSTV9HQ0NfVjUpfHwoUFZfQVJNX1Y1KSkKLSAgICBJbnQzMiB6OwotI2VuZGlmCi0gICAgSW50MTYgKnBGcmVxSW5mbzsKLSAgICBJbnQzMiB0ZW1wOwotICAgIEludDMyIHRlc3Q7Ci0KLSAgICBJbnQxNiAqcEZyZXFfMl9UaW1lX2RhdGFfMTsKLSAgICBJbnQxNiAqcEZyZXFfMl9UaW1lX2RhdGFfMjsKLQotICAgIGNvbnN0IEludDE2ICpwTG9uZ19XaW5kb3dfMTsKLSAgICBjb25zdCBJbnQxNiAqcExvbmdfV2luZG93XzI7Ci0gICAgY29uc3QgSW50MTYgKnBTaG9ydF9XaW5kb3dfMTsKLSAgICBjb25zdCBJbnQxNiAqcFNob3J0X1dpbmRvd18yOwotCi0gICAgSW50MzIgKnBPdmVybGFwX2FuZF9BZGRfQnVmZmVyXzE7Ci0gICAgSW50MzIgKnBPdmVybGFwX2F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AgKiAgIlRoZSByZXN1bHQgW29mIGEgc2hpZnRdIGlzIHVuZGVmaW5lZCBpZiB0aGUgcmlnaHQgb3BlcmFuZCBpcwotICAgICAgICAgKiAgbmVnYXRpdmUsIG9yIGdyZWF0ZXIgdGhhbiBvciBlcXVhbCB0byB0aGUgbnVtYmVyIG9mIGJpdHMgaW4gdGhlCi0gICAgICAgICAqICBsZWZ0IGV4cHJlc3Npb24ncyB0eXBlIgotICAgICAgICAgKiAgID0+IGF2b2lkIHNoaWZ0IGJ5IDMyIG9yIDE2Ci0gICAgICAgICAqLwotCi0gICAgICAgIGlmIChleHAgPCAxNikKLSAgICAgICAgewotCi0gICAgICAgICAgICBwRnJlcV8yX1RpbWVfZGF0YV8xID0gcEZyZXFJbmZvOwotCi0KLSAgICAgICAgICAgIHN3aXRjaCAod25kX3NlcSkKLSAgICAgICAgICAgIHsKLQotICAgICAgICAgICAgICAgIGNhc2UgT05MWV9MT05HX1NFUVVFTkNFOgotICAgICAgICAgICAgICAgIGRlZmF1bHQ6Ci0KLSAgICAgICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgICAgIHBPdmVybGFwX2FuZF9BZGRfQnVmZmVyXzEgPSBUaW1lX2RhdGE7Ci0KLSAgICAgICAgICAgICAgICAgICAgcEludGVybGVhdmVkX291dHB1dCA9IEludGVybGVhdmVkX291dHB1dDsKLQotICAgICAgICAgICAgICAgICAgICB7Ci0KLSAgICAgICAgICAgICAgICAgICAgICAgIGNvbnN0IEludDE2ICpwTG9uZ19XaW5kb3dfMiA9ICZMb25nX1dpbmRvd19meHBbd25kX3NoYXBlX3RoaXNfYmtdW0xPTkdfV0lORE9XX21fMV07Ci0KLSAgICAgICAgICAgICAgICAgICAgICAgIEludDMyICogcEZyZXEyVCAgID0gKEludDMyICopcEZyZXFJbmZvOwotICAgICAgICAgICAgICAgICAgICAgICAgSW50MzIgKiBwRnJlcTJUXzIgPSAmcEZyZXEyVFtIQUxGX0xPTkdfV0lORE9XXTsKLSAgICAgICAgICAgICAgICAgICAgICAgIEludDMyICogd2luID0gKEludDMyICopICYgTG9uZ19XaW5kb3dfZnhwW3duZF9zaGFwZV9wcmV2X2JrXVswXTsKLQotICAgICAgICAgICAgICAgICAgICAgICAgSW50IHNoaWZ0ID0gZXhwICsgMTUgLSBTQ0FMSU5HOwotCi0gICAgICAgICAgICAgICAgICAgICAgICBmb3IgKGkgPSBIQUxGX0xPTkdfV0lORE9XOyBpICE9IDA7IGktLSkKLSAgICAgICAgICAgICAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBJbnQxNiB3aW4xLCB3aW4yOwotICAgICAgICAgICAgICAgICAgICAgICAgICAgIEludDMyICB0ZW1wMiwgdGVzdDI7Ci0KLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBJbnQzMiAgd2lueDsKLQotICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRlbXAyID0gKihwRnJlcTJUKyspOwotICAgICAgICAgICAgICAgICAgICAgICAgICAgIHdpbnggPSAqKHdpbisrKTsKLQotICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRlc3QgID0gKihwT3ZlcmxhcF9hbmRfQWRkX0J1ZmZlcl8xKyspOwotICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRlc3QyID0gKihwT3ZlcmxhcF9hbmRfQWRkX0J1ZmZlcl8xLS0pOwotICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRlbXAgID0gICBmeHBfbXVsXzE2X2J5XzE2YmIodGVtcDIsIHdpbngpID4+IHNoaWZ0OwotICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRlbXAyID0gICBmeHBfbXVsXzE2X2J5XzE2dHQodGVtcDIsIHdpbngpID4+IHNoaWZ0OwotCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgbGltaXRlcigqKHBJbnRlcmxlYXZlZF9vdXRwdXQpLCAodGVtcCArIHRlc3QpKTsKLQotICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxpbWl0ZXIoKihwSW50ZXJsZWF2ZWRfb3V0cHV0ICsgMiksICh0ZW1wMiArIHRlc3QyKSk7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgcEludGVybGVhdmVkX291dHB1dCArPSA0OwotCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgdGVtcDIgPSAqKHBGcmVxMlRfMisrKTsKLQotICAgICAgICAgICAgICAgICAgICAgICAgICAgIHdpbjEgID0gKihwTG9uZ19XaW5kb3dfMi0tKTsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICB3aW4yICA9ICoocExvbmdfV2luZG93XzItLSk7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgdGVtcCAgPSBmeHBfbXVsXzE2X2J5XzE2YmIodGVtcDIsIHdpbjEpID4+IHNoaWZ0OwotICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRlc3QyID0gZnhwX211bF8xNl9ieV8xNnRiKHRlbXAyLCB3aW4yKSA+PiBzaGlmdDsKLQotICAgICAgICAgICAgICAgICAgICAgICAgICAgICoocE92ZXJsYXBfYW5kX0FkZF9CdWZmZXJfMSsrKSA9IHRlbXA7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgKihwT3ZlcmxhcF9hbmRfQWRkX0J1ZmZlcl8xKyspID0gdGVzdDI7Ci0gICAgICAgICAgICAgICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgICAgICAgICAgfQotCi0gICAgICAgICAgICAgICAgfQotCi0gICAgICAgICAgICAgICAgYnJlYWs7Ci0KLSAgICAgICAgICAgICAgICBjYXNlIExPTkdfU1RBUlRfU0VRVUVOQ0U6Ci0KLSAgICAgICAgICAgICAgICAgICAgcEZyZXFfMl9UaW1lX2RhdGFfMiA9Ci0gICAgICAgICAgICAgICAgICAgICAgICAmcEZyZXFfMl9UaW1lX2RhdGFfMVsgSEFMRl9MT05HX1dJTkRPV107Ci0KLSAgICAgICAgICAgICAgICAgICAgcExvbmdfV2luZG93XzEgPSAmTG9uZ19XaW5kb3dfZnhwW3duZF9zaGFwZV9wcmV2X2JrXVswXTsKLSAgICAgICAgICAgICAgICAgICAgcExvbmdfV2luZG93XzIgPSAmcExvbmdfV2luZG93XzFbIEhBTEZfTE9OR19XSU5ET1ddOwotCi0gICAgICAgICAgICAgICAgICAgIHBPdmVybGFwX2FuZF9BZGRfQnVmZmVyXzEgPSAmVGltZV9kYXRhWzBdOwotICAgICAgICAgICAgICAgICAgICBwT3ZlcmxhcF9hbmRfQWRkX0J1ZmZlcl8yID0gJlRpbWVfZGF0YVtIQUxGX0xPTkdfV0lORE9XXTsKLQotCi0gICAgICAgICAgICAgICAgICAgIHBJbnRlcmxlYXZlZF9vdXRwdXQgICA9IEludGVybGVhdmVkX291dHB1dDsKLSAgICAgICAgICAgICAgICAgICAgcEludGVybGVhdmVkX291dHB1dF8yID0gcEludGVybGVhdmVkX291dHB1dCArICgyICogSEFMRl9MT05HX1dJTkRPVyk7Ci0KLQotICAgICAgICAgICAgICAgICAgICAvKgotICAgICAgICAgICAgICAgICAgICAgKiAgcHJvY2VzcyBmaXJzdCAgTE9OR19XSU5ET1cgZWxlbWVudHMKLSAgICAgICAgICAgICAgICAgICAgICovCi0KLSAgICAgICAgICAgICAgICAgICAgc2hpZnQgPSBleHAgKyAxNSAtIFNDQUxJTkc7Ci0KLSAgICAgICAgICAgICAgICAgICAgZm9yIChpID0gSEFMRl9MT05HX1dJTkRPVzsgaSAhPSAwOyBpLS0pCi0gICAgICAgICAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAgICAgICAgIEludDE2IHdpbjEsIHdpbjI7Ci0gICAgICAgICAgICAgICAgICAgICAgICBJbnQxNiAgZGF0MSwgZGF0MjsKLSAgICAgICAgICAgICAgICAgICAgICAgIEludDMyICB0ZXN0MSwgdGVzdDI7Ci0KLSAgICAgICAgICAgICAgICAgICAgICAgIGRhdDEgICA9ICoocEZyZXFfMl9UaW1lX2RhdGFfMSsrKTsKLSAgICAgICAgICAgICAgICAgICAgICAgIHdpbjEgICA9ICoocExvbmdfV2luZG93XzErKyk7Ci0gICAgICAgICAgICAgICAgICAgICAgICB0ZXN0MSAgPSAqKHBPdmVybGFwX2FuZF9BZGRfQnVmZmVyXzErKyk7Ci0KLSAgICAgICAgICAgICAgICAgICAgICAgIGRhdDIgID0gICoocEZyZXFfMl9UaW1lX2RhdGFfMisrKTsKLSAgICAgICAgICAgICAgICAgICAgICAgIHdpbjIgID0gKihwTG9uZ19XaW5kb3dfMisrKTsKLSAgICAgICAgICAgICAgICAgICAgICAgIHRlc3QyID0gKihwT3ZlcmxhcF9hbmRfQWRkX0J1ZmZlcl8yKyspOwotCi0gICAgICAgICAgICAgICAgICAgICAgICBsaW1pdGVyKCoocEludGVybGVhdmVkX291dHB1dCksICh0ZXN0MSArIChmeHBfbXVsXzE2X2J5XzE2KGRhdDEsIHdpbjEpID4+IHNoaWZ0KSkpOwotCi0gICAgICAgICAgICAgICAgICAgICAgICBwSW50ZXJsZWF2ZWRfb3V0cHV0ICAgKz0gMjsKLQotICAgICAgICAgICAgICAgICAgICAgICAgbGltaXRlcigqKHBJbnRlcmxlYXZlZF9vdXRwdXRfMiksICh0ZXN0MiArIChmeHBfbXVsXzE2X2J5XzE2KGRhdDIsIHdpbjIpID4+IHNoaWZ0KSkpOwotCi0gICAgICAgICAgICAgICAgICAgICAgICBwSW50ZXJsZWF2ZWRfb3V0cHV0XzIgICAgKz0gMjsKLSAgICAgICAgICAgICAgICAgICAgfQotCi0KLSAgICAgICAgICAgICAgICAgICAgLyoKLSAgICAgICAgICAgICAgICAgICAgICogIGRhdGEgdW5jaGFuZ2VkIGZyb20gIExPTkdfV0lORE9XIHRvIFdfTF9TVEFSVF8xCi0gICAgICAgICAgICAgICAgICAgICAqICBvbmx5IHNjYWxlZCBhY2NvcmRpbmdseQotICAgICAgICAgICAgICAgICAgICAgKi8KLQotICAgICAgICAgICAgICAgICAgICBwT3ZlcmxhcF9hbmRfQWRkX0J1ZmZlcl8xID0gJlRpbWVfZGF0YVswXTsKLSAgICAgICAgICAgICAgICAgICAgcEZyZXFfMl9UaW1lX2RhdGFfMSAgICAgICA9ICZwRnJlcUluZm9bTE9OR19XSU5ET1ddOwotCi0gICAgICAgICAgICAgICAgICAgIGV4cCAtPSBTQ0FMSU5HOwotCi0gICAgICAgICAgICAgICAgICAgIGlmIChleHAgPj0gMCkKLSAgICAgICAgICAgICAgICAgICAgewotCi0gICAgICAgICAgICAgICAgICAgICAgICBmb3IgKGkgPSAoV19MX1NUQVJUXzEgLSBMT05HX1dJTkRPVykgPj4gMTsgaSAhPSAwOyBpLS0pCi0gICAgICAgICAgICAgICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgKihwT3ZlcmxhcF9hbmRfQWRkX0J1ZmZlcl8xKyspID0KLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKihwRnJlcV8yX1RpbWVfZGF0YV8xKyspID4+IGV4cDsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAqKHBPdmVybGFwX2FuZF9BZGRfQnVmZmVyXzErKykgPQotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqKHBGcmVxXzJfVGltZV9kYXRhXzErKykgPj4gZXhwOwotCi0gICAgICAgICAgICAgICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgICAgICBlbHNlIGlmIChleHAgPCAwKQotICAgICAgICAgICAgICAgICAgICB7Ci0KLSAgICAgICAgICAgICAgICAgICAgICAgIEludCBzaGlmdCA9IC1leHA7Ci0gICAgICAgICAgICAgICAgICAgICAgICBmb3IgKGkgPSAoV19MX1NUQVJUXzEgLSBMT05HX1dJTkRPVykgPj4gMTsgaSAhPSAwIDsgaS0tKQotICAgICAgICAgICAgICAgICAgICAgICAgewotICAgICAgICAgICAgICAgICAgICAgICAgICAgIEludDMyIHRlbXAyID0gKChJbnQzMikgKiAocEZyZXFfMl9UaW1lX2RhdGFfMSsrKSkgPDwgc2hpZnQ7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgKihwT3ZlcmxhcF9hbmRfQWRkX0J1ZmZlcl8xKyspID0gdGVtcDI7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgdGVtcDIgPSAoKEludDMyKSAqIChwRnJlcV8yX1RpbWVfZGF0YV8xKyspKSA8PCBzaGlmdDsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAqKHBPdmVybGFwX2FuZF9BZGRfQnVmZmVyXzErKykgPSB0ZW1wMjsKLSAgICAgICAgICAgICAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgICAgIGVsc2UKLSAgICAgICAgICAgICAgICAgICAgewotCi0gICAgICAgICAgICAgICAgICAgICAgICBmb3IgKGkgPSAoV19MX1NUQVJUXzEgLSBMT05HX1dJTkRPVykgPj4gMTsgaSAhPSAwOyBpLS0pCi0gICAgICAgICAgICAgICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgKihwT3ZlcmxhcF9hbmRfQWRkX0J1ZmZlcl8xKyspID0KLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKihwRnJlcV8yX1RpbWVfZGF0YV8xKyspOwotICAgICAgICAgICAgICAgICAgICAgICAgICAgICoocE92ZXJsYXBfYW5kX0FkZF9CdWZmZXJfMSsrKSA9Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICoocEZyZXFfMl9UaW1lX2RhdGFfMSsrKTsKLQotICAgICAgICAgICAgICAgICAgICAgICAgfQotCi0gICAgICAgICAgICAgICAgICAgIH0KLQotCi0gICAgICAgICAgICAgICAgICAgIHBGcmVxXzJfVGltZV9kYXRhXzEgID0gJnBGcmVxSW5mb1tXX0xfU1RBUlRfMV07Ci0gICAgICAgICAgICAgICAgICAgIHBGcmVxXzJfVGltZV9kYXRhXzIgID0KLSAgICAgICAgICAgICAgICAgICAgICAgICZwRnJlcV8yX1RpbWVfZGF0YV8xW0hBTEZfU0hPUlRfV0lORE9XXTsKLQotICAgICAgICAgICAgICAgICAgICBwU2hvcnRfV2luZG93XzEgICA9Ci0gICAgICAgICAgICAgICAgICAgICAgICAmU2hvcnRfV2luZG93X2Z4cFt3bmRfc2hhcGVfdGhpc19ia11bU0hPUlRfV0lORE9XX21fMV07Ci0KLSAgICAgICAgICAgICAgICAgICAgcFNob3J0X1dpbmRvd18yICAgPSBwU2hvcnRfV2luZG93XzEgLSBIQUxGX1NIT1JUX1dJTkRPVzsKLQotICAgICAgICAgICAgICAgICAgICBwT3ZlcmxhcF9hbmRfQWRkX0J1ZmZlcl8yID0gcE92ZXJsYXBfYW5kX0FkZF9CdWZmZXJfMSArCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBIQUxGX1NIT1JUX1dJTkRPVzsKLQotICAgICAgICAgICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgICAgICAgICBJbnQxNiB3aW4xLCB3aW4yOwotICAgICAgICAgICAgICAgICAgICAgICAgSW50MTYgIGRhdDEsIGRhdDI7Ci0gICAgICAgICAgICAgICAgICAgICAgICBJbnQzMiAgdGVtcDI7Ci0KLSAgICAgICAgICAgICAgICAgICAgICAgIGZvciAoaSA9IEhBTEZfU0hPUlRfV0lORE9XOyBpICE9IDA7IGktLSkKLSAgICAgICAgICAgICAgICAgICAgICAgIHsKLQotICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRhdDEgID0gKCpwRnJlcV8yX1RpbWVfZGF0YV8xKyspOwotICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRhdDIgID0gKCpwRnJlcV8yX1RpbWVfZGF0YV8yKyspOwotICAgICAgICAgICAgICAgICAgICAgICAgICAgIHdpbjEgID0gKihwU2hvcnRfV2luZG93XzEtLSk7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgd2luMiAgPSAqKHBTaG9ydF9XaW5kb3dfMi0tKTsKLQotICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRlbXAgICA9ICAgZnhwX211bF8xNl9ieV8xNihkYXQxLCB3aW4xKSA+PiBzaGlmdDsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAqKHBPdmVybGFwX2FuZF9BZGRfQnVmZmVyXzErKykgPSB0ZW1wOwotCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgdGVtcDIgPSAgIGZ4cF9tdWxfMTZfYnlfMTYoZGF0Miwgd2luMikgPj4gc2hpZnQ7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgKihwT3ZlcmxhcF9hbmRfQWRkX0J1ZmZlcl8yKyspID0gdGVtcDI7Ci0KLSAgICAgICAgICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICAgICAgfQotCi0gICAgICAgICAgICAgICAgICAgIHBPdmVybGFwX2FuZF9BZGRfQnVmZmVyXzEgKz0gSEFMRl9TSE9SVF9XSU5ET1c7Ci0KLQotICAgICAgICAgICAgICAgICAgICBwdl9tZW1zZXQoCi0gICAgICAgICAgICAgICAgICAgICAgICBwT3ZlcmxhcF9hbmRfQWRkX0J1ZmZlcl8xLAotICAgICAgICAgICAgICAgICAgICAgICAgMCwKLSAgICAgICAgICAgICAgICAgICAgICAgIChMT05HX0JMT0NLMSAtIFdfTF9TVEFSVF8yKQotICAgICAgICAgICAgICAgICAgICAgICAgKnNpemVvZigqcE92ZXJsYXBfYW5kX0FkZF9CdWZmZXJfMSkpOwotCi0KLSAgICAgICAgICAgICAgICAgICAgYnJlYWs7Ci0KLQotICAgICAgICAgICAgICAgIGNhc2UgTE9OR19TVE9QX1NFUVVFTkNFOgotCi0gICAgICAgICAgICAgICAgICAgIHBPdmVybGFwX2FuZF9BZGRfQnVmZmVyXzEgPSAmVGltZV9kYXRhWyBXX0xfU1RPUF8yXTsKLQotICAgICAgICAgICAgICAgICAgICBwSW50ZXJsZWF2ZWRfb3V0cHV0ICAgID0gJkludGVybGVhdmVkX291dHB1dFsyKldfTF9TVE9QXzJdOwotCi0gICAgICAgICAgICAgICAgICAgIHBGcmVxXzJfVGltZV9kYXRhXzEgICAgICA9ICZwRnJlcUluZm9bV19MX1NUT1BfMl07Ci0KLSAgICAgICAgICAgICAgICAgICAgZXhwIC09IFNDQUxJTkc7Ci0KLQotICAgICAgICAgICAgICAgICAgICBpZiAoZXhwID4gMCkKLSAgICAgICAgICAgICAgICAgICAgewotICAgICAgICAgICAgICAgICAgICAgICAgSW50MTYgdG1wMSA9ICgqKHBGcmVxXzJfVGltZV9kYXRhXzErKykgPj4gZXhwKTsKLSAgICAgICAgICAgICAgICAgICAgICAgIHRlbXAgPSAqKHBPdmVybGFwX2FuZF9BZGRfQnVmZmVyXzErKyk7Ci0KLSAgICAgICAgICAgICAgICAgICAgICAgIGZvciAoaSA9IChMT05HX1dJTkRPVyAtIFdfTF9TVE9QXzIpOyBpICE9IDA7IGktLSkKLSAgICAgICAgICAgICAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBsaW1pdGVyKCoocEludGVybGVhdmVkX291dHB1dCksICh0ZW1wICsgdG1wMSkpOwotCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgcEludGVybGVhdmVkX291dHB1dCArPSAyOwotICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRtcDEgPSAqKHBGcmVxXzJfVGltZV9kYXRhXzErKykgPj4gZXhwOwotICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRlbXAgPSAqKHBPdmVybGFwX2FuZF9BZGRfQnVmZmVyXzErKyk7Ci0gICAgICAgICAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICAgICAgZWxzZSBpZiAoZXhwIDwgMCkKLSAgICAgICAgICAgICAgICAgICAgewotICAgICAgICAgICAgICAgICAgICAgICAgc2hpZnQgPSAtZXhwOwotCi0gICAgICAgICAgICAgICAgICAgICAgICBJbnQzMiB0ZW1wMSA9ICgoSW50MzIpICogKHBGcmVxXzJfVGltZV9kYXRhXzErKykpIDw8IHNoaWZ0OwotICAgICAgICAgICAgICAgICAgICAgICAgdGVtcCA9ICoocE92ZXJsYXBfYW5kX0FkZF9CdWZmZXJfMSsrKTsKLQotICAgICAgICAgICAgICAgICAgICAgICAgZm9yIChpID0gKExPTkdfV0lORE9XIC0gV19MX1NUT1BfMik7IGkgIT0gMDsgaS0tKQotICAgICAgICAgICAgICAgICAgICAgICAgewotICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxpbWl0ZXIoKihwSW50ZXJsZWF2ZWRfb3V0cHV0KSwgKHRlbXAgKyB0ZW1wMSkpOwotCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgcEludGVybGVhdmVkX291dHB1dCArPSAyOwotICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRlbXAxID0gKChJbnQzMikgKiAocEZyZXFfMl9UaW1lX2RhdGFfMSsrKSkgPDwgc2hpZnQ7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgdGVtcCA9ICoocE92ZXJsYXBfYW5kX0FkZF9CdWZmZXJfMSsrKTsKLSAgICAgICAgICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgICAgICBlbHNlCi0gICAgICAgICAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAgICAgICAgIEludDE2IHRtcDEgPSAqKHBGcmVxXzJfVGltZV9kYXRhXzErKyk7Ci0gICAgICAgICAgICAgICAgICAgICAgICB0ZW1wID0gKihwT3ZlcmxhcF9hbmRfQWRkX0J1ZmZlcl8xKyspOwotICAgICAgICAgICAgICAgICAgICAgICAgZm9yIChpID0gKExPTkdfV0lORE9XIC0gV19MX1NUT1BfMik7IGkgIT0gMDsgaS0tKQotICAgICAgICAgICAgICAgICAgICAgICAgewotICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxpbWl0ZXIoKihwSW50ZXJsZWF2ZWRfb3V0cHV0KSwgKHRlbXAgKyB0bXAxKSk7Ci0KLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBwSW50ZXJsZWF2ZWRfb3V0cHV0ICs9IDI7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgdG1wMSA9ICoocEZyZXFfMl9UaW1lX2RhdGFfMSsrKTsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICB0ZW1wID0gKihwT3ZlcmxhcF9hbmRfQWRkX0J1ZmZlcl8xKyspOwotICAgICAgICAgICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgICAgICB9Ci0KLQotCi0gICAgICAgICAgICAgICAgICAgIHBTaG9ydF9XaW5kb3dfMSA9ICZTaG9ydF9XaW5kb3dfZnhwW3duZF9zaGFwZV9wcmV2X2JrXVswXTsKLSAgICAgICAgICAgICAgICAgICAgcFNob3J0X1dpbmRvd18yID0gJnBTaG9ydF9XaW5kb3dfMVtIQUxGX1NIT1JUX1dJTkRPV107Ci0KLSAgICAgICAgICAgICAgICAgICAgcEZyZXFfMl9UaW1lX2RhdGFfMSA9ICZwRnJlcUluZm9bV19MX1NUT1BfMV07Ci0gICAgICAgICAgICAgICAgICAgIHBGcmVxXzJfVGltZV9kYXRhXzIgPQotICAgICAgICAgICAgICAgICAgICAgICAgJnBGcmVxXzJfVGltZV9kYXRhXzFbSEFMRl9TSE9SVF9XSU5ET1ddOwotCi0gICAgICAgICAgICAgICAgICAgIHBPdmVybGFwX2FuZF9BZGRfQnVmZmVyXzEgPSAmVGltZV9kYXRhWyBXX0xfU1RPUF8xXTsKLSAgICAgICAgICAgICAgICAgICAgcE92ZXJsYXBfYW5kX0FkZF9CdWZmZXJfMiA9IHBPdmVybGFwX2FuZF9BZGRfQnVmZmVyXzEKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICsgSEFMRl9TSE9SVF9XSU5ET1c7Ci0KLQotICAgICAgICAgICAgICAgICAgICBwSW50ZXJsZWF2ZWRfb3V0cHV0ICAgPSAmSW50ZXJsZWF2ZWRfb3V0cHV0WzIqV19MX1NUT1BfMV07Ci0gICAgICAgICAgICAgICAgICAgIHBJbnRlcmxlYXZlZF9vdXRwdXRfMiA9IHBJbnRlcmxlYXZlZF9vdXRwdXQgKyAoMiAqIEhBTEZfU0hPUlRfV0lORE9XKTsKLQotICAgICAgICAgICAgICAgICAgICBleHAgKz0gU0NBTElORzsgIC8qICs4IGJhY2sgdG8gd2hhdCBpdCB3YXMgKi8KLSAgICAgICAgICAgICAgICAgICAgc2hpZnQgPSBleHAgKyAxNSAtIFNDQUxJTkc7Ci0KLQotICAgICAgICAgICAgICAgICAgICBmb3IgKGkgPSBIQUxGX1NIT1JUX1dJTkRPVzsgaSAhPSAwOyBpLS0pCi0gICAgICAgICAgICAgICAgICAgIHsKLQotICAgICAgICAgICAgICAgICAgICAgICAgSW50MTYgd2luMTsKLSAgICAgICAgICAgICAgICAgICAgICAgIEludDE2IGRhdDE7Ci0KLSAgICAgICAgICAgICAgICAgICAgICAgIGRhdDEgPSAqKHBGcmVxXzJfVGltZV9kYXRhXzErKyk7Ci0gICAgICAgICAgICAgICAgICAgICAgICB3aW4xID0gKihwU2hvcnRfV2luZG93XzErKyk7Ci0gICAgICAgICAgICAgICAgICAgICAgICB0ZW1wID0gKihwT3ZlcmxhcF9hbmRfQWRkX0J1ZmZlcl8xKyspOwotCi0gICAgICAgICAgICAgICAgICAgICAgICB0ZXN0ICA9IGZ4cF9tdWxfMTZfYnlfMTYoZGF0MSwgd2luMSk7Ci0KLSAgICAgICAgICAgICAgICAgICAgICAgIGxpbWl0ZXIoKihwSW50ZXJsZWF2ZWRfb3V0cHV0KSwgKHRlbXAgKyAodGVzdCA+PiBzaGlmdCkpKTsKLQotICAgICAgICAgICAgICAgICAgICAgICAgcEludGVybGVhdmVkX291dHB1dCArPSAyOwotCi0gICAgICAgICAgICAgICAgICAgICAgICBkYXQxID0gKihwRnJlcV8yX1RpbWVfZGF0YV8yKyspOwotICAgICAgICAgICAgICAgICAgICAgICAgd2luMSA9ICoocFNob3J0X1dpbmRvd18yKyspOwotICAgICAgICAgICAgICAgICAgICAgICAgdGVtcCA9ICoocE92ZXJsYXBfYW5kX0FkZF9CdWZmZXJfMisrKTsKLSAgICAgICAgICAgICAgICAgICAgICAgIHRlc3QgPSAgZnhwX211bF8xNl9ieV8xNihkYXQxLCB3aW4xKTsKLQotICAgICAgICAgICAgICAgICAgICAgICAgbGltaXRlcigqKHBJbnRlcmxlYXZlZF9vdXRwdXRfMiksICh0ZW1wICsgKHRlc3QgPj4gc2hpZnQpKSk7Ci0KLSAgICAgICAgICAgICAgICAgICAgICAgIHBJbnRlcmxlYXZlZF9vdXRwdXRfMiArPSAyOwotCi0gICAgICAgICAgICAgICAgICAgIH0KLQotCi0KLSAgICAgICAgICAgICAgICAgICAgcEZyZXFfMl9UaW1lX2RhdGFfMiA9ICZwRnJlcUluZm9bTE9OR19XSU5ET1ddOwotCi0gICAgICAgICAgICAgICAgICAgIHBPdmVybGFwX2FuZF9BZGRfQnVmZmVyXzEgPSBUaW1lX2RhdGE7Ci0KLQotICAgICAgICAgICAgICAgICAgICBwSW50ZXJsZWF2ZWRfb3V0cHV0ID0gSW50ZXJsZWF2ZWRfb3V0cHV0OwotCi0gICAgICAgICAgICAgICAgICAgIHBMb25nX1dpbmRvd18yICAgPQotICAgICAgICAgICAgICAgICAgICAgICAgJkxvbmdfV2luZG93X2Z4cFt3bmRfc2hhcGVfdGhpc19ia11bTE9OR19XSU5ET1dfbV8xXTsKLQotCi0gICAgICAgICAgICAgICAgICAgIC8qCi0gICAgICAgICAgICAgICAgICAgICAqICBDb3B5IHByZXZpb3VzIHRpbWUgaW4gY3VycmVudCBidWZmZXIsIGFsc28gY29weSBvdmVybGFwCi0gICAgICAgICAgICAgICAgICAgICAqICBhbmQgYWRkIGJ1ZmZlcgotICAgICAgICAgICAgICAgICAgICAgKi8KLQotICAgICAgICAgICAgICAgICAgICBmb3IgKGkgPSBXX0xfU1RPUF8xOyBpICE9IDA7IGktLSkKLSAgICAgICAgICAgICAgICAgICAgewotCi0gICAgICAgICAgICAgICAgICAgICAgICBJbnQxNiB3aW4xOwotICAgICAgICAgICAgICAgICAgICAgICAgSW50MTYgZGF0MTsKLQotICAgICAgICAgICAgICAgICAgICAgICAgd2luMSA9ICoocExvbmdfV2luZG93XzItLSk7Ci0gICAgICAgICAgICAgICAgICAgICAgICBkYXQxID0gKnBGcmVxXzJfVGltZV9kYXRhXzIrKzsKLQotICAgICAgICAgICAgICAgICAgICAgICAgbGltaXRlcigqKHBJbnRlcmxlYXZlZF9vdXRwdXQpLCAqKHBPdmVybGFwX2FuZF9BZGRfQnVmZmVyXzEpKTsKLQotICAgICAgICAgICAgICAgICAgICAgICAgcEludGVybGVhdmVkX291dHB1dCArPSAyOwotCi0gICAgICAgICAgICAgICAgICAgICAgICB0ZW1wID0gZnhwX211bF8xNl9ieV8xNihkYXQxLCB3aW4xKSA+PiBzaGlmdDsKLSAgICAgICAgICAgICAgICAgICAgICAgICoocE92ZXJsYXBfYW5kX0FkZF9CdWZmZXJfMSsrKSA9IHRlbXAgOwotCi0gICAgICAgICAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgICAgICAgICBmb3IgKGkgPSAoTE9OR19XSU5ET1cgLSBXX0xfU1RPUF8xKTsgaSAhPSAwOyBpLS0pCi0gICAgICAgICAgICAgICAgICAgIHsKLQotICAgICAgICAgICAgICAgICAgICAgICAgdGVtcCA9IGZ4cF9tdWxfMTZfYnlfMTYoKnBGcmVxXzJfVGltZV9kYXRhXzIrKywgKihwTG9uZ19XaW5kb3dfMi0tKSkgPj4gc2hpZnQ7Ci0gICAgICAgICAgICAgICAgICAgICAgICAqKHBPdmVybGFwX2FuZF9BZGRfQnVmZmVyXzErKykgPSB0ZW1wIDsKLQotICAgICAgICAgICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgICAgICAgICAgYnJlYWs7Ci0KLQotCi0gICAgICAgICAgICB9IC8qIHN3aXRjaCAod25kX3NlcSkgKi8KLQotICAgICAgICB9ICAgLyogIGlmIChleHAgPC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JlIGZvciBuZXh0ICB8ICAgICAgICB8ICBtZW1vcnkgfAotICAgICAgICAgIHwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8ICBjYWxsICAgICAgICAgICAgfCAgICAgICAgfCAgICAgICAgIHwKLSAgICAgICAgICB8ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfCAgICAgICAgICAgICAgICAgIHwgICAgICAgIHwgICAgICAgICB8Ci0gICAgICAgICAgfC8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vL3xcXFxcXFxcXFxcXFxcXFxcXFx8LS0tLS0tLS18KysrKysrKysrfAotICAgICAgICAgIHwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8ICAgICAgICAgICAgICAgICAgfCAgICAgICAgfCAgICAgICAgIHwKLSAgICAgICAgICAwICAgICAgICAgICAgICAgICAgICAgICAgIExPTkdfV0lORE9XICAgICAgICBMT05HX1dJTkRPVyAgIHwgICAyKkxPTkdfV0lORE9XCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICArICAgICAgICB8ICAgICAgICAgfAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFdfTF9TVE9QXzIgICAgfCAgICAgICAgIHwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHw8LS0gICAtLT58Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgU0hPUlRfV0lORE9XICsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgSEFMRl9TSE9SVF9XSU5ET1cKLSAgICAgICAgICAqCi0gICAgICAgICAgKi8KLQotICAgICAgICBwT3ZlcmxhcF9hbmRfQWRkX0J1ZmZlcl8xICA9ICZwRnJlcXVlbmN5X2RhdGFbCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIExPTkdfV0lORE9XICsgMypTSE9SVF9XSU5ET1cgKyBIQUxGX1NIT1JUX1dJTkRPV107Ci0KLSAgICAgICAgLyoKLSAgICAgICAgICogIEluaXRpYWxpemUgdG8gemVybywgb25seSB0aGUgZmlydCBzaG9ydCB3aW5kb3cgdXNlZCBpbiBvdmVybGFwCi0gICAgICAgICAqICBhbmQgYWRkCi0gICAgICAgICAqLwotICAgICAgICBwdl9tZW1zZXQoCi0gICAgICAgICAgICBwT3ZlcmxhcF9hbmRfQWRkX0J1ZmZlcl8xLAotICAgICAgICAgICAgMCwKLSAgICAgICAgICAgIFNIT1JUX1dJTkRPVypzaXplb2YoKnBPdmVybGFwX2FuZF9BZGRfQnVmZmVyXzEpKTsKLQotICAgICAgICAvKgotICAgICAgICAgKiAgU2hvd3Qgd2luZG93cyBhcmUgZXZhbHVhdGVkIGluIGRlY3Jlc2luZyBvcmRlci4gV2luZG93cyBmcm9tIDcKLSAgICAgICAgICogIHRvIDAgYXJlIGJyZWFrIGRvd24gaW4gZm91ciBjYXNlczogd2luZG93IG51bWJlcnMgNyB0byA1LCA0LCAzLAotICAgICAgICAgKiAgYW5kIDIgdG8gMC4KLSAgICAgICAgICogIFRoZSBkYXRhIGZyb20gc2hvcnQgd2luZG93cyAzIGFuZCA0IGlzIHNpdHVhdGVkIGF0IHRoZSBib3VuZGFyeQotICAgICAgICAgKiAgYmV0d2VlbiB0aGUgJ292ZXJsYXAgYW5kIGFkZCcgYnVmZmVyIGFuZCB0aGUgb3V0cHV0IGJ1ZmZlci4KLSAgICAgICAgICovCi0gICAgICAgIGZvciAod25kID0gTlVNX1NIT1JUX1dJTkRPV1MgLSAxOyB3bmQgPj0gTlVNX1NIT1JUX1dJTkRPV1MgLyAyICsgMTsgd25kLS0pCi0gICAgICAgIHsKLQotICAgICAgICAgICAgcEZyZXFJbmZvID0gKEludDE2ICopICYgcEZyZXF1ZW5jeV9kYXRhWyB3bmQqU0hPUlRfV0lORE9XXTsKLQotICAgICAgICAgICAgZXhwID0gaW1kY3RfZnhwKAotICAgICAgICAgICAgICAgICAgICAgIChJbnQzMiAqKXBGcmVxSW5mbywKLSAgICAgICAgICAgICAgICAgICAgICBmcmVxXzJfdGltZV9idWZmZXIsCi0gICAgICAgICAgICAgICAgICAgICAgU0hPUlRfQkxPQ0sxLAotICAgICAgICAgICAgICAgICAgICAgIFFfZm9ybWF0LAotICAgICAgICAgICAgICAgICAgICAgIGFic19tYXhfcGVyX3dpbmRvd1t3bmRdKTsKLQotICAgICAgICAgICAgLyogIFdfTF9TVE9QXzEgPT0gKExPTkdfV0lORE9XIC0gU0hPUlRfV0lORE9XKT4+MSAqLwotICAgICAgICAgICAgcE92ZXJsYXBfYW5kX0FkZF9CdWZmZXJfMSA9Ci0gICAgICAgICAgICAgICAgJnBGcmVxdWVuY3lfZGF0YVsgV19MX1NUT1BfMSArIFNIT1JUX1dJTkRPVyp3bmRdOwotCi0KLSAgICAgICAgICAgIHBPdmVybGFwX2FuZF9BZGRfQnVmZmVyXzIgPQotICAgICAgICAgICAgICAgIHBPdmVybGFwX2FuZF9BZGRfQnVmZmVyXzEgKyBTSE9SVF9XSU5ET1c7Ci0KLSAgICAgICAgICAgIC8qCi0gICAgICAgICAgICAgKiAgSWYgYWxsIGVsZW1lbnQgYXJlIHplcm8gb3IgaWYgdGhlIGV4cG9uZW50IGlzIGJpZ2dlciB0aGFuCi0gICAgICAgICAgICAgKiAgMTYgKCBpdCBiZWNvbWVzIGFuIHVuZGVmaW5lZCBzaGlmdCkgLT4gIHNraXAKLSAgICAgICAgICAgICAqLwotCi0gICAgICAgICAgICBpZiAoZXhwIDwgMTYpCi0gICAgICAgICAgICB7Ci0KLQotICAgICAgICAgICAgICAgIHBGcmVxXzJfVGltZV9kYXRhXzEgPSAmcEZyZXFJbmZvWzBdOwotICAgICAgICAgICAgICAgIHBGcmVxXzJfVGltZV9kYXRhXzIgPSAmcEZyZXFJbmZvW1NIT1JUX1dJTkRPV107Ci0KLQotICAgICAgICAgICAgICAgIC8qCi0gICAgICAgICAgICAgICAgICogIEVhY2ggb2YgdGhlIGVpZ2h0IHNob3J0IGJsb2NrcyBpcyB3aW5kb3dlZCBzZXBhcmF0ZWx5LgotICAgICAgICAgICAgICAgICAqICBXaW5kb3cgc2hhcGUgZGVjaXNpb25zIGFyZSBtYWRlIG9uIGEgZnJhbWUtYnktZnJhbWUKLSAgICAgICAgICAgICAgICAgKiAgYmFzaXMuCi0gICAgICAgICAgICAgICAgICovCi0KLSAgICAgICAgICAgICAgICBwU2hvcnRfV2luZG93XzEgPSAmU2hvcnRfV2luZG93X2Z4cFt3bmRfc2hhcGVfdGhpc19ia11bMF07Ci0KLSAgICAgICAgICAgICAgICBwU2hvcnRfV2luZG93XzIgICA9Ci0gICAgICAgICAgICAgICAgICAgICZTaG9ydF9XaW5kb3dfZnhwW3duZF9zaGFwZV90aGlzX2JrXVtTSE9SVF9XSU5ET1dfbV8xXTsKLQotCi0KLQotICAgICAgICAgICAgICAgIC8qCi0gICAgICAgICAgICAgICAgICogRm9yIHNob3J0IHdpbmRvd3MgZnJvbSA3IHRvIDUKLSAgICAgICAgICAgICAgICAgKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfCAgID09PT09PT09PT09PT09PT09PT09PT09PT0KLSAgICAgICAgICAgICAgICAgKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfCAgIHwgICAgIDUgICAgIDYgICAgIDcKLSAgICAgICAgICAgICAgICAgKiAgICAgICAgICAgICAgIF8tLV8gIF8tLV8gIF8tLV8gIF8tLV8gfCBfLXwtXyAgXy0tXyAgXy0tXyAgXy0tXwotICAgICAgICAgICAgICAgICAqICAgICAgICAgICAgICAvICAgIFwvICAgIFwvICAgIFwvICAgIFx8LyAgfCAgXC8gICAgXC8gICAgXC8gICAgXAotICAgICAgICAgICAgICAgICAqICAgICAgICAgICAgIC8gICAgIC9cICAgIC9cICAgIC9cICAgIC98XCAgfCAgL1wgICAgL1wgICAgL1wgICAgIFwKLSAgICAgICAgICAgICAgICAgKiAgICAgICAgICAgIC8gICAgIC8gIFwgIC8gIFwgIC8gIFwgIC8gfCBcIHwgLyAgXCAgLyAgXCAgLyAgXCAgICAgXAotICAgICAgICAgICAgICAgICAqICAgICAgICAgICAvICAgICAvICAgIFwvICAgIFwvICAgIFwvICB8ICBcfC8gICAgXC8gICAgXCAgICAgXCAgICAgXAotICAgICAgICAgICAgICAgICAqICAgICAgLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS18LS0tWy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vXS0tLS0tLS0tCi0gICAgICAgICAgICAgICAgICoKLSAgICAgICAgICAgICAgICAgKi8KLQotCi0gICAgICAgICAgICAgICAgc2hpZnQgPSBleHAgKyAxNSAtIFNDQUxJTkc7Ci0KLQotICAgICAgICAgICAgICAgIGZvciAoaSA9IFNIT1JUX1dJTkRPVzsgaSAhPSAwOyBpLS0pCi0gICAgICAgICAgICAgICAgewotICAgICAgICAgICAgICAgICAgICBJbnQxNiB3aW4xLCB3aW4yOwotICAgICAgICAgICAgICAgICAgICBJbnQxNiAgZGF0MSwgZGF0MjsKLQotICAgICAgICAgICAgICAgICAgICBkYXQyID0gKihwRnJlcV8yX1RpbWVfZGF0YV8yKyspOwotICAgICAgICAgICAgICAgICAgICB3aW4yID0gKihwU2hvcnRfV2luZG93XzItLSk7Ci0gICAgICAgICAgICAgICAgICAgIHRlbXAgPSAqcE92ZXJsYXBfYW5kX0FkZF9CdWZmZXJfMjsKLSAgICAgICAgICAgICAgICAgICAgZGF0MSA9ICoocEZyZXFfMl9UaW1lX2RhdGFfMSsrKTsKLSAgICAgICAgICAgICAgICAgICAgd2luMSA9ICoocFNob3J0X1dpbmRvd18xKyspOwotCi0gICAgICAgICAgICAgICAgICAgICoocE92ZXJsYXBfYW5kX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F9BZGRfQnVmZmVyXzEgPSAmcEZyZXF1ZW5jeV9kYXRhWyBMT05HX1dJTkRPV107Ci0KLSAgICAgICAgcE92ZXJsYXBfYW5kX0FkZF9CdWZmZXJfMiA9IHBPdmVybGFwX2FuZF9BZGRfQnVmZmVyXzEKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICsgSEFMRl9TSE9SVF9XSU5ET1c7Ci0KLQotICAgICAgICBleHAgPSBpbWRjdF9meHAoCi0gICAgICAgICAgICAgICAgICAoSW50MzIgKilwRnJlcUluZm8sCi0gICAgICAgICAgICAgICAgICBmcmVxXzJfdGltZV9idWZmZXIsCi0gICAgICAgICAgICAgICAgICBTSE9SVF9CTE9DSzEsCi0gICAgICAgICAgICAgICAgICBRX2Zvcm1hdCwKLSAgICAgICAgICAgICAgICAgIGFic19tYXhfcGVyX3dpbmRvd1t3bmRdKTsKLQotICAgICAgICAvKgotICAgICAgICAgKiAgSWYgYWxsIGVsZW1lbnQgYXJlIHplcm8gb3IgaWYgdGhlIGV4cG9uZW50IGlzIGJpZ2dlciB0aGFuCi0gICAgICAgICAqICAxNiAoIGl0IGJlY29tZXMgYW4gdW5kZWZpbmVkIHNoaWZ0KSAtPiAgc2tpcAotICAgICAgICAgKi8KLQotCi0gICAgICAgIGlmIChleHAgPCAxNikKLSAgICAgICAgewotCi0gICAgICAgICAgICBwRnJlcV8yX1RpbWVfZGF0YV8xID0gJnBGcmVxSW5mb1swXTsKLSAgICAgICAgICAgIHBGcmVxXzJfVGltZV9kYXRhXzIgPSAmcEZyZXFJbmZvW1NIT1JUX1dJTkRPV107Ci0KLSAgICAgICAgICAgIHBTaG9ydF9XaW5kb3dfMSA9ICZTaG9ydF9XaW5kb3dfZnhwW3duZF9zaGFwZV90aGlzX2JrXVswXTsKLQotICAgICAgICAgICAgcFNob3J0X1dpbmRvd18yID0KLSAgICAgICAgICAgICAgICAmU2hvcnRfV2luZG93X2Z4cFt3bmRfc2hhcGVfdGhpc19ia11bU0hPUlRfV0lORE9XX21fMV07Ci0KLQotICAgICAgICAgICAgLyoKLSAgICAgICAgICAgICAqIEZvciBzaG9ydCB3aW5kb3cgNAotICAgICAgICAgICAgICogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA9PT09fD09PT09PT09PT09Ci0gICAgICAgICAgICAgKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8ICAgNAotICAgICAgICAgICAgICogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8ICAgfCAgIHwgICAgICB8Ci0gICAgICAgICAgICAgKiAgICAgICAgICAgICAgICBfLS1fICBfLS1fICBfLS1fICBfLXwtXyB8IF8tfC1fICBfLXwtXyAgXy0tXyAgXy0tXwotICAgICAgICAgICAgICogICAgICAgICAgICAgICAvICAgIFwvICAgIFwvICAgIFwvICB8ICBcfC8gIHwgIFwvICB8ICBcLyAgICBcLyAgICBcCi0gICAgICAgICAgICAgKiAgICAgICAgICAgICAgLyAgICAgL1wgICAgL1wgICAgL1wgIHwgIC98XCAgfCAgL1wgIHwgIC9cICAgIC9cICAgICBcCi0gICAgICAgICAgICAgKiAgICAgICAgICAgICAvICAgICAvICBcICAvICBcICAvICBcIHwgLyB8IFwgfCAvICBcIHwgLyAgXCAgLyAgXCAgICAgXAotICAgICAgICAgICAgICogICAgICAgICAgICAvICAgICAvICAgIFwvICAgIFwvICAgIFx8LyAgfCAgXHwvICAgIFx8LyAgICBcLyAgICBcICAgICBcCi0gICAgICAgICAgICAgKiAgICAgIC0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLVtcXFx8XFxcfC8vLy8vL10tLS0tLS0tLS0tLS0tLS0tLS0tCi0gICAgICAgICAgICAgKiAgICAgICAgICAgfCAgICAgICAgICAgICAgICAgICAgICAgIHwgQSB8IEIgfCAgIEMgIHwKLSAgICAgICAgICAgICAqICAgICAgICAgICB8Ci0gICAgICAgICAgICAgKiAgICAgICAgV19MX1NUT1BfMQotICAgICAgICAgICAgICovCi0KLSAgICAgICAgICAgIHNoaWZ0ID0gZXhwICsgMTUgLSBTQ0FMSU5HOwotICAgICAgICAgICAgewotICAgICAgICAgICAgICAgIEludDE2IHdpbjE7Ci0gICAgICAgICAgICAgICAgSW50MTYgIGRhdDE7Ci0gICAgICAgICAgICAgICAgLyogLS0tLS0tLS0gc2VnbWVudCBBIC0tLS0tLS0tLS0tLS0tLSovCi0gICAgICAgICAgICAgICAgZGF0MSA9ICoocEZyZXFfMl9UaW1lX2RhdGFfMSsrKTsKLSAgICAgICAgICAgICAgICB3aW4xID0gKihwU2hvcnRfV2luZG93XzErKyk7Ci0gICAgICAgICAgICAgICAgZm9yIChpID0gSEFMRl9TSE9SVF9XSU5ET1c7IGkgIT0gMDsgaS0tKQotICAgICAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAgICAgKihwU2NyYXRoX21lbSsrKSAgPSAgZnhwX211bF8xNl9ieV8xNihkYXQxLCB3aW4xKSA+PiBzaGlmdDsKLSAgICAgICAgICAgICAgICAgICAgZGF0MSA9ICoocEZyZXFfMl9UaW1lX2RhdGFfMSsrKTsKLSAgICAgICAgICAgICAgICAgICAgd2luMSA9ICoocFNob3J0X1dpbmRvd18xKyspOwotICAgICAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgICAgIC8qIC0tLS0tLS0tIHNlZ21lbnQgQiAtLS0tLS0tLS0tLS0tLS0qLwotICAgICAgICAgICAgICAgIGZvciAoaSA9IEhBTEZfU0hPUlRfV0lORE9XOyBpICE9IDA7IGktLSkKLSAgICAgICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgICAgICoocE92ZXJsYXBfYW5kX0FkZF9CdWZmZXJfMSsrKSAgPSAgZnhwX211bF8xNl9ieV8xNihkYXQxLCB3aW4xKSA+PiBzaGlmdDsKLQotICAgICAgICAgICAgICAgICAgICBkYXQxID0gKihwRnJlcV8yX1RpbWVfZGF0YV8xKyspOwotICAgICAgICAgICAgICAgICAgICB3aW4xID0gKihwU2hvcnRfV2luZG93XzErKyk7Ci0gICAgICAgICAgICAgICAgfQotCi0gICAgICAgICAgICAgICAgLyogLS0tLS0tLS0gc2VnbWVudCBDIC0tLS0tLS0tLS0tLS0tLSovCi0gICAgICAgICAgICAgICAgdGVtcCA9ICpwT3ZlcmxhcF9hbmRfQWRkX0J1ZmZlcl8yOwotICAgICAgICAgICAgICAgIGRhdDEgPSAqKHBGcmVxXzJfVGltZV9kYXRhXzIrKyk7Ci0gICAgICAgICAgICAgICAgd2luMSA9ICoocFNob3J0X1dpbmRvd18yLS0pOwotCi0gICAgICAgICAgICAgICAgZm9yIChpID0gU0hPUlRfV0lORE9XOyBpICE9IDA7IGktLSkKLSAgICAgICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgICAgICoocE92ZXJsYXBfYW5kX0FkZF9CdWZmZXJfMisrKSAgPSAgdGVtcCArIChmeHBfbXVsXzE2X2J5XzE2KGRhdDEsIHdpbjEpID4+IHNoaWZ0KTsKLQotICAgICAgICAgICAgICAgICAgICB0ZW1wID0gKnBPdmVybGFwX2FuZF9BZGRfQnVmZmVyXzI7Ci0gICAgICAgICAgICAgICAgICAgIGRhdDEgPSAqKHBGcmVxXzJfVGltZV9kYXRhXzIrKyk7Ci0gICAgICAgICAgICAgICAgICAgIHdpbjEgPSAqKHBTaG9ydF9XaW5kb3dfMi0tKTsKLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICB9Ci0KLSAgICAgICAgfSAgIC8qIGlmIChleHAgPCAxNikgKi8KLSAgICAgICAgZWxzZQotICAgICAgICB7Ci0gICAgICAgICAgICBwdl9tZW1zZXQoCi0gICAgICAgICAgICAgICAgcFNjcmF0aF9tZW0sCi0gICAgICAgICAgICAgICAgMCwKLSAgICAgICAgICAgICAgICBIQUxGX1NIT1JUX1dJTkRPVypzaXplb2YoKnBTY3JhdGhfbWVtKSk7Ci0KLSAgICAgICAgICAgIHB2X21lbXNldCgKLSAgICAgICAgICAgICAgICBwT3Zlcmxhc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JlcUluZm8sCi0gICAgICAgICAgICAgICAgICBmcmVxXzJfdGltZV9idWZmZXIsCi0gICAgICAgICAgICAgICAgICBTSE9SVF9CTE9DSzEsCi0gICAgICAgICAgICAgICAgICBRX2Zvcm1hdCwKLSAgICAgICAgICAgICAgICAgIGFic19tYXhfcGVyX3dpbmRvd1t3bmRdKTsKLQotICAgICAgICAvKgotICAgICAgICAgKiAgSWYgYWxsIGVsZW1lbnQgYXJlIHplcm8gb3IgaWYgdGhlIGV4cG9uZW50IGlzIGJpZ2dlciB0aGFuCi0gICAgICAgICAqICAxNiAoIGl0IGJlY29tZXMgYW4gdW5kZWZpbmVkIHNoaWZ0KSAtPiAgc2tpcAotICAgICAgICAgKi8KLQotICAgICAgICBpZiAoZXhwIDwgMTYpCi0gICAgICAgIHsKLQotICAgICAgICAgICAgcEZyZXFfMl9UaW1lX2RhdGFfMSA9ICZwRnJlcUluZm9bMF07Ci0gICAgICAgICAgICBwRnJlcV8yX1RpbWVfZGF0YV8yID0gJnBGcmVxSW5mb1tTSE9SVF9XSU5ET1ddOwotCi0KLSAgICAgICAgICAgIC8qCi0gICAgICAgICAgICAgKiBGb3Igc2hvcnQgd2luZG93IDMKLSAgICAgICAgICAgICAqICAgICAgICAgICAgICAgICAgICAgICAgICAgICA9PT09PT09PT09PXw9PT09Ci0gICAgICAgICAgICAgKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDMgICB8Ci0gICAgICAgICAgICAgKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfCAgICAgIHwgICB8ICAgfAotICAgICAgICAgICAgICogICAgICAgICAgICAgICBfLS1fICBfLS1fICBfLXwtXyAgXy18LV8gfCBfLXwtXyAgXy0tXyAgXy0tXyAgXy0tXwotICAgICAgICAgICAgICogICAgICAgICAgICAgIC8gICAgXC8gICAgXC8gIHwgIFwvICB8ICBcfC8gIHwgIFwvICAgIFwvICAgIFwvICAgIFwKLSAgICAgICAgICAgICAqICAgICAgICAgICAgIC8gICAgIC9cICAgIC9cICB8ICAvXCAgfCAgL3xcICB8ICAvXCAgICAvXCAgICAvXCAgICAgXAotICAgICAgICAgICAgICogICAgICAgICAgICAvICAgICAvICBcICAvICBcIHwgLyAgXCB8IC8gfCBcIHwgLyAgXCAgLyAgXCAgLyAgXCAgICAgXAotICAgICAgICAgICAgICogICAgICAgICAgIC8gICAgIC8gICAgXC8gICAgXHwvICAgIFx8LyAgfCAgXHwvICAgIFwvICAgIFwgICAgIFwgICAgIFwKLSAgICAgICAgICAgICAqICAgICAtLS0tLXwtLS0tLS0tLS0tLS0tLS0tLS1bXFxcXFxcfC8vL3wvLy9dLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0KLSAgICAgICAgICAgICAqICAgICAgICAgIHwgICAgICAgICAgICAgICAgICB8ICAgQSAgfCBCIHwgQyB8Ci0gICAgICAgICAgICAgKgotICAgICAgICAgICAgICogICAgICBXX0xfU1RPUF8xCi0gICAgICAgICAgICAgKi8KLQotCi0gICAgICAgICAgICBwU2hvcnRfV2luZG93XzEgPSAmU2hvcnRfV2luZG93X2Z4cFt3bmRfc2hhcGVfdGhpc19ia11bMF07Ci0KLSAgICAgICAgICAgIHBTaG9ydF9XaW5kb3dfMiA9Ci0gICAgICAgICAgICAgICAgJlNob3J0X1dpbmRvd19meHBbd25kX3NoYXBlX3RoaXNfYmtdW1NIT1JUX1dJTkRPV19tXzFdOwotCi0gICAgICAgICAgICBzaGlmdCA9IGV4cCArIDE1IC0gU0NBTElORzsKLQotICAgICAgICAgICAgSW50MTYgd2luMTsKLSAgICAgICAgICAgIEludDE2ICBkYXQxOwotICAgICAgICAgICAgLyogLS0tLS0tLS0gc2VnbWVudCBBIC0tLS0tLS0tLS0tLS0tLSovCi0gICAgICAgICAgICBkYXQxID0gKihwRnJlcV8yX1RpbWVfZGF0YV8xKyspOwotICAgICAgICAgICAgd2luMSA9ICoocFNob3J0X1dpbmRvd18xKyspOwotICAgICAgICAgICAgZm9yIChpID0gU0hPUlRfV0lORE9XOyBpICE9IDA7IGktLSkKLSAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAqKHBTY3JhdGhfbWVtKyspICA9ICBmeHBfbXVsXzE2X2J5XzE2KGRhdDEsIHdpbjEpID4+IHNoaWZ0OwotICAgICAgICAgICAgICAgIGRhdDEgPSAqKHBGcmVxXzJfVGltZV9kYXRhXzErKyk7Ci0gICAgICAgICAgICAgICAgd2luMSA9ICoocFNob3J0X1dpbmRvd18xKyspOwotICAgICAgICAgICAgfQotCi0gICAgICAgICAgICBkYXQxID0gKihwRnJlcV8yX1RpbWVfZGF0YV8yKyspOwotICAgICAgICAgICAgd2luMSA9ICoocFNob3J0X1dpbmRvd18yLS0pOwotCi0KLSAgICAgICAgICAgIC8qIC0tLS0tLS0tIHNlZ21lbnQgQiAtLS0tLS0tLS0tLS0tLS0qLwotICAgICAgICAgICAgZm9yIChpID0gSEFMRl9TSE9SVF9XSU5ET1c7IGkgIT0gMDsgaS0tKQotICAgICAgICAgICAgewotICAgICAgICAgICAgICAgIHRlc3QgPSBmeHBfbXVsXzE2X2J5XzE2KGRhdDEsIHdpbjEpID4+IHNoaWZ0OwotCi0gICAgICAgICAgICAgICAgdGVtcCA9ICAqKHBTY3JhdGhfbWVtKyspICsgdGVzdDsKLQotICAgICAgICAgICAgICAgIHRlc3QgPSAqKHBPdmVybGFwX2FuZF9BZGRfQnVmZmVyXzF4KyspOwotICAgICAgICAgICAgICAgIGxpbWl0ZXIoKihwSW50ZXJsZWF2ZWRfb3V0cHV0KSwgKHRlbXAgKyB0ZXN0KSk7Ci0KLQotICAgICAgICAgICAgICAgIHBJbnRlcmxlYXZlZF9vdXRwdXQgKz0gMjsKLSAgICAgICAgICAgICAgICBkYXQxID0gKihwRnJlcV8yX1RpbWVfZGF0YV8yKyspOwotICAgICAgICAgICAgICAgIHdpbjEgPSAqKHBTaG9ydF9XaW5kb3dfMi0tKTsKLQotICAgICAgICAgICAgfQotCi0gICAgICAgICAgICAvKiAtLS0tLS0tLSBzZWdtZW50IEMgLS0tLS0tLS0tLS0tLS0tKi8KLSAgICAgICAgICAgIGZvciAoaSA9IEhBTEZfU0hPUlRfV0lORE9XOyBpICE9IDA7IGktLSkKLSAgICAgICAgICAgIHsKLQotICAgICAgICAgICAgICAgIHRlbXAgPSBmeHBfbXVsXzE2X2J5XzE2KGRhdDEsIHdpbjEpID4+IHNoaWZ0OwotCi0gICAgICAgICAgICAgICAgKihwT3ZlcmxhcF9hbmRfQWRkX0J1ZmZlcl8xKyspICs9IHRlbXA7Ci0KLSAgICAgICAgICAgICAgICBkYXQxID0gKihwRnJlcV8yX1RpbWVfZGF0YV8yKyspOwotICAgICAgICAgICAgICAgIHdpbjEgPSAqKHBTaG9ydF9XaW5kb3dfMi0tKTsKLSAgICAgICAgICAgIH0KLQotCi0gICAgICAgIH0gICAvKiBpZiAoZXhwIDwgMTYpICovCi0gICAgICAgIGVsc2UKLSAgICAgICAgewotCi0gICAgICAgICAgICBwdl9tZW1zZXQoCi0gICAgICAgICAgICAgICAgcFNjcmF0aF9tZW0sCi0gICAgICAgICAgICAgICAgMCwKLSAgICAgICAgICAgICAgICBTSE9SVF9XSU5ET1cqc2l6ZW9mKCpwU2NyYXRoX21lbSkpOwotCi0gICAgICAgICAgICBwU2NyYXRoX21lbSArPSBTSE9SVF9XSU5ET1c7Ci0KLSAgICAgICAgICAgIHRlbXAgPSAqKHBTY3JhdGhfbWVtKyspOwotICAgICAgICAgICAgZm9yIChpID0gSEFMRl9TSE9SVF9XSU5ET1c7IGkgIT0gMDsgaS0tKQotICAgICAgICAgICAgewotICAgICAgICAgICAgICAgIGxpbWl0ZXIoKihwSW50ZXJsZWF2ZWRfb3V0cHV0KSwgKHRlbXApKTsKLQotICAgICAgICAgICAgICAgIHBJbnRlcmxlYXZlZF9vdXRwdXQgKz0gMjsKLSAgICAgICAgICAgICAgICB0ZW1wID0gKihwU2NyYXRoX21lbSsrKTsKLQotICAgICAgICAgICAgfQotICAgICAgICB9Ci0KLQotICAgICAgICBmb3IgKHduZCA9IE5VTV9TSE9SVF9XSU5ET1dTIC8gMiAtIDI7IHduZCA+PSAwOyB3bmQtLSkKLSAgICAgICAgewotCi0KLSAgICAgICAgICAgIHBJbnRlcmxlYXZlZF9vdXRwdXRfMiAtPSAoU0hPUlRfV0lORE9XICogMik7Ci0gICAgICAgICAgICBwSW50ZXJsZWF2ZWRfb3V0cHV0ID0gcEludGVybGVhdmVkX291dHB1dF8yOwotCi0gICAgICAgICAgICAvKgotICAgICAgICAgICAgICogVGhlIHNhbWUgbWVtb3J5IGlzIHVzZWQgYXMgc2NyYXRjaCBpbiBldmVyeSBpdGVyYXRpb24KLSAgICAgICAgICAgICAqLwotICAgICAgICAgICAgcFNjcmF0aF9tZW0gPSBwU2NyYXRoX21lbV9lbnRyeTsKLQotICAgICAgICAgICAgcE92ZXJsYXBfYW5kX0FkZF9CdWZmZXJfMnggPQotICAgICAgICAgICAgICAgICZUaW1lX2RhdGFbV19MX1NUT1BfMSArIFNIT1JUX1dJTkRPVyood25kKzEpXTsKLQotICAgICAgICAgICAgcEZyZXFJbmZvID0gKEludDE2ICopICYgcEZyZXF1ZW5jeV9kYXRhWyB3bmQqU0hPUlRfV0lORE9XXTsKLQotCi0KLSAgICAgICAgICAgIGV4cCA9IGltZGN0X2Z4cCgKLSAgICAgICAgICAgICAgICAgICAgICAoSW50MzIgKilwRnJlcUluZm8sCi0gICAgICAgICAgICAgICAgICAgICAgZnJlcV8yX3RpbWVfYnVmZmVyLAotICAgICAgICAgICAgICAgICAgICAgIFNIT1JUX0JMT0NLMSwKLSAgICAgICAgICAgICAgICAgICAgICBRX2Zvcm1hdCwKLSAgICAgICAgICAgICAgICAgICAgICBhYnNfbWF4X3Blcl93aW5kb3dbd25kXSk7Ci0KLSAgICAgICAgICAgIC8qCi0gICAgICAgICAgICAgKiAgSWYgYWxsIGVsZW1lbnQgYXJlIHplcm8gb3IgaWYgdGhlIGV4cG9uZW50IGlzIGJpZ2dlciB0aGFuCi0gICAgICAgICAgICAgKiAgMTYgKCBpdCBiZWNvbWVzIGFuIHVuZGVmaW5lZCBzaGlmdCkgLT4gIHNraXAKLSAgICAgICAgICAgICAqLwotCi0gICAgICAgICAgICBpZiAoZXhwIDwgMTYpCi0gICAgICAgICAgICB7Ci0KLSAgICAgICAgICAgICAgICBwRnJlcV8yX1RpbWVfZGF0YV8xID0gJnBGcmVxSW5mb1swXTsKLSAgICAgICAgICAgICAgICBwRnJlcV8yX1RpbWVfZGF0YV8yID0gJnBGcmVxSW5mb1tTSE9SVF9XSU5ET1ddOwotCi0KLSAgICAgICAgICAgICAgICAvKgotICAgICAgICAgICAgICAgICAqICBFYWNoIG9mIHRoZSBlaWdodCBzaG9ydCBibG9ja3MgaXMgd2luZG93ZWQgc2VwYXJhdGVseS4KLSAgICAgICAgICAgICAgICAgKiAgV2luZG93IHNoYXBlIGRlY2lzaW9ucyBhcmUgbWFkZSBvbiBhIGZyYW1lLWJ5LWZyYW1lCi0gICAgICAgICAgICAgICAgICogIGJhc2lzLgotICAgICAgICAgICAgICAgICAqLwotCi0gICAgICAgICAgICAgICAgcFNob3J0X1dpbmRvd18xID0gJlNob3J0X1dpbmRvd19meHBbd25kX3NoYXBlX3RoaXNfYmtdWzBdOwotCi0gICAgICAgICAgICAgICAgaWYgKHduZCA9PSAwKQotICAgICAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAgICAgcFNob3J0X1dpbmRvd18xID0KLSAgICAgICAgICAgICAgICAgICAgICAgICZTaG9ydF9XaW5kb3dfZnhwW3duZF9zaGFwZV9wcmV2X2JrXVswXTsKLSAgICAgICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgICAgICBwU2hvcnRfV2luZG93XzIgICA9Ci0gICAgICAgICAgICAgICAgICAgICZTaG9ydF9XaW5kb3dfZnhwW3duZF9zaGFwZV90aGlzX2JrXVtTSE9SVF9XSU5ET1dfbV8xXTsKLQotCi0gICAgICAgICAgICAgICAgLyoKLSAgICAgICAgICAgICAgICAgKiBGb3Igc2hvcnQgd2luZG93cyBmcm9tIDIgdG8gMAotICAgICAgICAgICAgICAgICAqCi0gICAgICAgICAgICAgICAgICogICAgICAgICAgPT09PT09PT09PT09PT09PT09PT09PT09PQotICAgICAgICAgICAgICAgICAqICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfAotICAgICAgICAgICAgICAgICAqICAgICAgICAgICAgICAgIDAgICAgIDEgICAgIDIgICAgICB8ICAgfAotICAgICAgICAgICAgICAgICAqICAgICAgICAgICAgICAgXy0tXyAgXy0tXyAgXy0tXyAgXy18LV8gfCBfLS1fICBfLS1fICBfLS1fICBfLS1fCi0gICAgICAgICAgICAgICAgICogICAgICAgICAgICAgIC8gICAgXC8gICAgXC8gICAgXC8gIHwgIFx8LyAgICBcLyAgICBcLyAgICBcLyAgICBcCi0gICAgICAgICAgICAgICAgICogICAgICAgICAgICAgLyAgICAgL1wgICAgL1wgICAgL1wgIHwgIC98XCAgICAvXCAgICAvXCAgICAvXCAgICAgXAotICAgICAgICAgICAgICAgICAqICAgICAgICAgICAgLyAgICAgLyAgXCAgLyAgXCAgLyAgXCB8IC8gfCBcICAvICBcICAvICBcICAvICBcICAgICBcCi0gICAgICAgICAgICAgICAgICogICAgICAgICAgIC8gICAgIC8gICAgXC8gICAgXC8gICAgXHwvICB8ICBcLyAgICBcLyAgICBcICAgICBcICAgICBcCi0gICAgICAgICAgICAgICAgICogICAgICAtLS0tW1xcXFxcXFxcXFxcXFxcXFxcXFxcXFxcXF0tLS18LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0KLSAgICAgICAgICAgICAgICAgKiAgICAgICAgICB8Ci0gICAgICAgICAgICAgICAgICoKLSAgICAgICAgICAgICAgICAgKiAgICAgIFdfTF9TVE9QXzEKLSAgICAgICAgICAgICAgICAgKi8KLQotICAgICAgICAgICAgICAgIHNoaWZ0ID0gZXhwICsgMTUgLSBTQ0FMSU5HOwotCi0gICAgICAgICAgICAgICAgSW50MTYgZGF0MSA9ICoocEZyZXFfMl9UaW1lX2RhdGFfMisrKTsKLSAgICAgICAgICAgICAgICBJbnQxNiB3aW4xID0gKihwU2hvcnRfV2luZG93XzItLSk7Ci0KLSAgICAgICAgICAgICAgICB0ZW1wICA9ICAqKHBTY3JhdGhfbWVtKTsKLSAgICAgICAgICAgICAgICBmb3IgKGkgPSBTSE9SVF9XSU5ET1c7IGkgIT0gMDsgaS0tKQotICAgICAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAgICAgdGVzdCAgPSAgZnhwX211bF8xNl9ieV8xNihkYXQxLCB3aW4xKSA+PiBzaGlmdDsKLQotICAgICAgICAgICAgICAgICAgICB0ZW1wICs9IHRlc3Q7Ci0gICAgICAgICAgICAgICAgICAgIGRhdDEgPSAqKHBGcmVxXzJfVGltZV9kYXRhXzErKyk7Ci0gICAgICAgICAgICAgICAgICAgIHdpbjEgPSAqKHBTaG9ydF9XaW5kb3dfMSsrKTsKLQotICAgICAgICAgICAgICAgICAgICBsaW1pdGVyKCoocEludGVybGVhdmVkX291dHB1dCksICh0ZW1wICsgKihwT3ZlcmxhcF9hbmRfQWRkX0J1ZmZlcl8yeCsrKSkpOwotCi0gICAgICAgICAgICAgICAgICAgIHBJbnRlcmxlYXZlZF9vdXRwdXQgKz0gMjsKLQotICAgICAgICAgICAgICAgICAgICAqKHBTY3JhdGhfbWVtKyspID0gZnhwX211bF8xNl9ieV8xNihkYXQxLCB3aW4xKSA+PiBzaGlmdDsKLSAgICAgICAgICAgICAgICAgICAgZGF0MSA9ICoocEZyZXFfMl9UaW1lX2RhdGFfMisrKTsKLSAgICAgICAgICAgICAgICAgICAgd2luMSA9ICoocFNob3J0X1dpbmRvd18yLS0pOwotICAgICAgICAgICAgICAgICAgICB0ZW1wICA9ICAqKHBTY3JhdGhfbWVtKTsKLQotICAgICAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgfSAgIC8qIGlmIChleHAgPCAxNikgKi8KLSAgICAgICAgICAgIGVsc2UKLSAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICB0ZXN0ICA9ICoocFNjcmF0aF9tZW0pOwotICAgICAgICAgICAgICAgIHRlbXAgID0gKihwT3ZlcmxhcF9hbmRfQWRkX0J1ZmZlcl8yeCsrKTsKLQotICAgICAgICAgICAgICAgIGZvciAoaSA9IFNIT1JUX1dJTkRPVzsgaSAhPSAwOyBpLS0pCi0gICAgICAgICAgICAgICAgewotICAgICAgICAgICAgICAgICAgICBsaW1pdGVyKCoocEludGVybGVhdmVkX291dHB1dCksICh0ZW1wICsgdGVzdCkpOwotCi0gICAgICAgICAgICAgICAgICAgIHBJbnRlcmxlYXZlZF9vdXRwdXQgKz0gMjsKLQotICAgICAgICAgICAgICAgICAgICAqKHBTY3JhdGhfbWVtKyspID0gMDsKLSAgICAgICAgICAgICAgICAgICAgdGVzdCAgPSAgKihwU2NyYXRoX21lbSk7Ci0gICAgICAgICAgICAgICAgICAgIHRlbXAgID0gKihwT3ZlcmxhcF9hbmRfQWRkX0J1ZmZlcl8yeCsrKTsKLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICB9Ci0KLSAgICAgICAgfSAgIC8qIGZvciAoIHduZD1OVU1fU0hPUlRfV0lORE9XUy8yLTE7IHduZD49MDsgd25kLS0pICovCi0KLSAgICAgICAgcE92ZXJsYXBfYW5kX0FkZF9CdWZmZXJfMnggPSAgJlRpbWVfZGF0YVtXX0xfU1RPUF8xXTsKLQotICAgICAgICBwU2NyYXRoX21lbSA9IHBTY3JhdGhfbWVtX2VudHJ5OwotCi0gICAgICAgIHBJbnRlcmxlYXZlZF9vdXRwdXRfMiAtPSAoU0hPUlRfV0lORE9XICogMik7Ci0gICAgICAgIHBJbnRlcmxlYXZlZF9vdXRwdXQgICAgPSBwSW50ZXJsZWF2ZWRfb3V0cHV0XzI7Ci0KLSAgICAgICAgdGVzdCAgPSAqKHBTY3JhdGhfbWVtKyspOwotICAgICAgICB0ZW1wICA9ICoocE92ZXJsYXBfYW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MKLQotIElucHV0czoKLSAgICBUaW1lMkZyZXFfZGF0YSAgICA9ICBidWZmZXIgd2l0aCBkYXRhIGluIHRoZSB0aW1lIGRvbWFpbiwgaXQgaG9sZHMgMjA0OAotICAgICAgICAgICAgICAgICAgICAgICAgIHBvaW50cyBvZiBpbnB1dCB0aW1lIGRhdGEKLSAgICAgICAgICAgICAgICAgICAgICAgICBPdXRwdXQgaG9sZHMgZnJlcXVlbmN5IChmaXJzdCAxMDI0IHBvaW50cyApCi0gICAgICAgICAgICAgICAgICAgICAgICAgdHlwZSBJbnQzMgotCi0gICAgd25kX3NlcSAgICAgICAgICAgPSAgd2luZG93IHNlcXVlbmNlCi0gICAgICAgICAgICAgICAgICAgICAgICAgdHlwZSBXSU5ET1dfU0VRVUVOQ0UKLQotICAgIHduZF9zaGFwZV9wcmV2X2JrID0gIHByZXZpb3VzIHdpbmRvdyBzaGFwZSB0eXBlCi0gICAgICAgICAgICAgICAgICAgICAgICAgdHlwZSBJbnQKLQotICAgIHduZF9zaGFwZV90aGlzX2JrID0gIGN1cnJlbnQgd2luZG93IHNoYXBlIHR5cGUKLSAgICAgICAgICAgICAgICAgICAgICAgICB0eXBlIEludAotCi0gICAgcFFfZm9ybWF0ICAgICAgICAgID0gIEhvbGRzIHRoZSBRIGZvcm1hdCBvZiB0aGUgZGF0YSBpbiwgYW5kIGRhdGEgb3V0Ci0gICAgICAgICAgICAgICAgICAgICAgICAgdHlwZSBJbnQgKgotCi0gICAgbWVtXzRfaW5fcGxhY2VfRkZUW10gPSAgc2NyYXRjaCBtZW1vcnkgZm9yIGNvbXB1dGluZyBGRlQsIDEwMjQgcG9pbnQKLSAgICAgICAgICAgICAgICAgICAgICAgICB0eXBlIEludDMyCi0KLQotCi0gTG9jYWwgU3RvcmVzL0J1ZmZlcnMvUG9pbnRlcnMgTmVlZGVkOgotICAgIE5vbmUKLQotIEdsb2JhbCBTdG9yZXMvQnVmZmVycy9Qb2ludGVycyBOZWVkZWQ6Ci0gICAgTm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93W3duZF9zaGFwZS0+dGhpc19ia11bU0hPUlRfV0lORE9XX21fMV0KLQotICAgICAgICAgICAgRk9SKCBpPTAsIGo9U0hPUlRfV0lORE9XOyBpPFNIT1JUX1dJTkRPVzsgaSsrLCBqLS0pCi0gICAgICAgICAgICAgICAgYXV4X3RlbXBbICAgICAgICAgICAgIGldICAqPSBwU2hvcnRfV2luZG93XzFbaV0KLSAgICAgICAgICAgICAgICBhdXhfdGVtcFtTSE9SVF9XSU5ET1craV0gICo9IHBTaG9ydF9XaW5kb3dfMltqXQotICAgICAgICAgICAgRU5ERk9SCi0KLQotICAgICAgICAgICAgQ0FMTCBNRENUKCBhdXhfdGVtcCwgU0hPUlRfQkxPQ0sxKQotICAgICAgICAgICAgTU9ESUZZSU5HKCBhdXhfdGVtcCkKLQotICAgICAgICAgICAgRk9SKCBpPTA7IGk8U0hPUlRfV0lORE9XOyBpKyspCi0gICAgICAgICAgICAgICAgVGltZTJGcmVxX2RhdGFbd25kKlNIT1JUX1dJTkRPVyArIGldID0gYXV4X3RlbXBbaV07Ci0gICAgICAgICAgICBFTkRGT1IKLQotICAgICAgICBFTkRGT1IKLQotICAgIEVMU0UKLQotICAgICAgICBTV0lUQ0ggKCB3bmRfc2VxKQotCi0gICAgICAgICAgICBDQVNFICggT05MWV9MT05HX1NFUVVFTkNFKQotCi0gICAgICAgICAgICAgICAgcExvbmdfV2luZG93XzEgPSAmTG9uZ19XaW5kb3dbd25kX3NoYXBlX3ByZXZfYmtdWzBdCi0gICAgICAgICAgICAgICAgcExvbmdfV2luZG93XzIgPQotICAgICAgICAgICAgICAgICAgICAgICAgJkxvbmdfV2luZG93W3duZF9zaGFwZV90aGlzX2JrXVtMT05HX1dJTkRPV19tXzFdCi0KLSAgICAgICAgICAgICAgICBGT1IgKGk9MDsgaTxMT05HX1dJTkRPVzsgaSsrKQotICAgICAgICAgICAgICAgICAgICBUaW1lMkZyZXFfZGF0YVsgICAgICAgICAgICBpXSAqPSAqcExvbmdfV2luZG93XzErKwotICAgICAgICAgICAgICAgICAgICBUaW1lMkZyZXFfZGF0YVtMT05HX1dJTkRPVytpXSAqPSAqcExvbmdfV2luZG93XzItLQotICAgICAgICAgICAgICAgIEVOREZPUgotCi0gICAgICAgICAgICAgICAgQlJFQUsKLQotCi0gICAgICAgICAgICBDQVNFICggTE9OR19TVEFSVF9TRVFVRU5DRSkKLQotICAgICAgICAgICAgICAgIHBMb25nX1dpbmRvd18xID0gJkxvbmdfV2luZG93W3duZF9zaGFwZV9wcmV2X2JrXVswXTsKLQotICAgICAgICAgICAgICAgIEZPUiAoIGk9MDsgaTxMT05HX1dJTkRPVzsgaSsrKQotICAgICAgICAgICAgICAgICAgICBUaW1lMkZyZXFfZGF0YVsgaV0gKj0gKnBMb25nX1dpbmRvd18xKys7Ci0gICAgICAgICAgICAgICAgRU5ERk9SCi0KLQotICAgICAgICAgICAgICAgIHBTaG9ydF9XaW5kb3dfMSAgID0KLSAgICAgICAgICAgICAgICAgICAgICAgICZTaG9ydF9XaW5kb3dbd25kX3NoYXBlLT50aGlzX2JrXVtTSE9SVF9XSU5ET1dfbV8xXTsKLQotICAgICAgICAgICAgICAgIEZPUiAoIGk9MDsgaTxTSE9SVF9XSU5ET1c7IGkrKykKLSAgICAgICAgICAgICAgICAgICAgVGltZTJGcmVxX2RhdGFbV19MX1NUQVJUXzEgKyBpXSAqPSAqcFNob3J0X1dpbmRvd18xLS07Ci0gICAgICAgICAgICAgICAgRU5ERk9SCi0KLQotICAgICAgICAgICAgICAgIEZPUiAoIGk9V19MX1NUQVJUXzI7IGk8TE9OR19CTE9DSzE7IGkrKykKLSAgICAgICAgICAgICAgICAgICAgVGltZTJGcmVxX2RhdGFbV19MX1NUQVJUXzIgKyBpXSA9IDA7Ci0gICAgICAgICAgICAgICAgRU5ERk9SCi0KLSAgICAgICAgICAgICAgICBCUkVBSwotCi0KLSAgICAgICAgICAgIENBU0UgKCBMT05HX1NUT1BfU0VRVUVOQ0UgKQotCi0gICAgICAgICAgICAgICAgRk9SICggaT0wOyBpPFdfTF9TVE9QXzE7IGkrKykKLSAgICAgICAgICAgICAgICAgICAgVGltZTJGcmVxX2RhdGFbIGldID0gMDsKLSAgICAgICAgICAgICAgICBFTkRGT1IKLQotCi0gICAgICAgICAgICAgICAgcFNob3J0X1dpbmRvd18xICAgPSAmU2hvcnRfV2luZG93W3duZF9zaGFwZS0+cHJldl9ia11bMF07Ci0KLSAgICAgICAgICAgICAgICBGT1IgKCBpPTA7IGk8U0hPUlRfV0lORE9XOyBpKyspCi0gICAgICAgICAgICAgICAgICAgIFRpbWUyRnJlcV9kYXRhW1dfTF9TVE9QXzErIGldICo9ICpwU2hvcnRfV2luZG93XzErKzsKLSAgICAgICAgICAgICAgICBFTkRGT1IKLQotCi0gICAgICAgICAgICAgICAgcExvbmdfV2luZG93XzEgPQotICAgICAgICAgICAgICAgICAgICAgICAgJkxvbmdfV2luZG93W3duZF9zaGFwZS0+dGhpc19ia11bTE9OR19XSU5ET1dfbV8xXTsKLQotICAgICAgICAgICAgICAgIEZPUiAoIGk9MDsgaTxMT05HX1dJTkRPVzsgaSsrKQotICAgICAgICAgICAgICAgICAgICBUaW1lMkZyZXFfZGF0YVtMT05HX1dJTkRPVyArIGldICAqPSAgKnBMb25nX1dpbmRvd18xLS07Ci0gICAgICAgICAgICAgICAgRU5ERk9SCi0KLSAgICAgICAgICAgICAgICBCUkVBSwotCi0KLSAgICAgICAgfQotCi0gICAgICAgIE1EQ1QoIFRpbWUyRnJlcV9kYXRhLCBMT05HX0JMT0NLMSk7Ci0gICAgICAgIE1PRElGWUlORyggVGltZTJGcmVxX2RhdGEpCi0KLSAgICBFTkRJRgotCi0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0KLSBSRVNPVVJDRVMgVVNFRAotICAgV2hlbiB0aGUgY29kZSBpcyB3cml0dGVuIGZvci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gRUlHSFRfU0hPUlRfU0VRVUVOQ0UpCi0gICAgewotCi0gICAgICAgIHBBdXhfdGVtcCA9IFRpbWUyRnJlcV9kYXRhOwotCi0gICAgICAgICpwUV9mb3JtYXQgPSBMVFBfUV9GT1JNQVQgLSAqcFFfZm9ybWF0OwotCi0gICAgICAgIHBBdXhfdGVtcF8xID0gcEF1eF90ZW1wOwotCi0gICAgICAgIHN3aXRjaCAod25kX3NlcSkKLSAgICAgICAgewotCi0gICAgICAgICAgICBjYXNlIExPTkdfU1RBUlRfU0VRVUVOQ0U6Ci0KLSAgICAgICAgICAgICAgICBwQXV4X3RlbXBfMiA9ICZwQXV4X3RlbXBfMVtIQUxGX0xPTkdfV0lORE9XXTsKLQotICAgICAgICAgICAgICAgIHBMb25nX1dpbmRvd18xID0gJkxvbmdfV2luZG93X2Z4cFt3bmRfc2hhcGVfcHJldl9ia11bMF07Ci0gICAgICAgICAgICAgICAgcExvbmdfV2luZG93XzIgPSAmcExvbmdfV2luZG93XzFbIEhBTEZfTE9OR19XSU5ET1ddOwotCi0KLQotCi0gICAgICAgICAgICAgICAgZm9yIChpID0gSEFMRl9MT05HX1dJTkRPVzsgaSA+IDA7IGktLSkKLSAgICAgICAgICAgICAgICB7Ci0KLSAgICAgICAgICAgICAgICAgICAgKnBBdXhfdGVtcF8xID0gZnhwX211bDMyX2J5XzE2KCgqcEF1eF90ZW1wXzEpLCAqcExvbmdfV2luZG93XzErKykgPj4gc2hpZnQ7Ci0gICAgICAgICAgICAgICAgICAgIHBBdXhfdGVtcF8xKys7Ci0gICAgICAgICAgICAgICAgICAgICpwQXV4X3RlbXBfMiA9IGZ4cF9tdWwzMl9ieV8xNigoKnBBdXhfdGVtcF8yKSwgKnBMb25nX1dpbmRvd18yKyspID4+IHNoaWZ0OwotICAgICAgICAgICAgICAgICAgICBwQXV4X3RlbXBfMisrOwotCi0gICAgICAgICAgICAgICAgfQotCi0KLSAgICAgICAgICAgICAgICAvKiBkYXRhIHVuY2hhbmdlZCBmcm9tICBMT05HX1dJTkRPVyB0byBXX0xfU1RBUlRfMSAqLwotICAgICAgICAgICAgICAgIHBBdXhfdGVtcF8xID0gJnBBdXhfdGVtcFtMT05HX1dJTkRPV107Ci0gICAgICAgICAgICAgICAgaWYgKHNoaWZ0KQotICAgICAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAgICAgZm9yIChpID0gKFdfTF9TVEFSVF8xIC0gTE9OR19XSU5ET1cpID4+IDE7IGkgIT0gMDsgaS0tKQotICAgICAgICAgICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgICAgICAgICAqKHBBdXhfdGVtcF8xKyspID4+PSBzaGlmdDsKLSAgICAgICAgICAgICAgICAgICAgICAgICoocEF1eF90ZW1wXzErKykgPj49IHNoaWZ0OwotICAgICAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgfQotCi0KLSAgICAgICAgICAgICAgICBwQXV4X3RlbXBfMSA9ICZwQXV4X3RlbXBbV19MX1NUQVJUXzFdOwotICAgICAgICAgICAgICAgIHBBdXhfdGVtcF8yID0gJnBBdXhfdGVtcF8xW0hBTEZfU0hPUlRfV0lORE9XXTsKLQotICAgICAgICAgICAgICAgIHBTaG9ydF9XaW5kb3dfMSAgID0KLSAgICAgICAgICAgICAgICAgICAgJlNob3J0X1dpbmRvd19meHBbd25kX3NoYXBlX3RoaXNfYmtdW1NIT1JUX1dJTkRPV19tXzFdOwotCi0gICAgICAgICAgICAgICAgcFNob3J0X1dpbmRvd18yICAgPSBwU2hvcnRfV2luZG93XzEgLSBIQUxGX1NIT1JUX1dJTkRPVzsKLQotICAgICAgICAgICAgICAgIGZvciAoaSA9IEhBTEZfU0hPUlRfV0lORE9XOyBpID4gMDsgaS0tKQotICAgICAgICAgICAgICAgIHsKLQotICAgICAgICAgICAgICAgICAgICAqcEF1eF90ZW1wXzEgPSBmeHBfbXVsMzJfYnlfMTYoKCpwQXV4X3RlbXBfMSksICpwU2hvcnRfV2luZG93XzEtLSkgPj4gc2hpZnQ7Ci0gICAgICAgICAgICAgICAgICAgIHBBdXhfdGVtcF8xKys7Ci0gICAgICAgICAgICAgICAgICAgICpwQXV4X3RlbXBfMiA9IGZ4cF9tdWwzMl9ieV8xNigoKnBBdXhfdGVtcF8yKSwgKnBTaG9ydF9XaW5kb3dfMi0tKSA+PiBzaGlmdDsKLSAgICAgICAgICAgICAgICAgICAgcEF1eF90ZW1wXzIrKzsKLQotICAgICAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgICAgIHBBdXhfdGVtcF8xID0gJnBBdXhfdGVtcFtXX0xfU1RBUlRfMl07Ci0KLSAgICAgICAgICAgICAgICBwdl9tZW1zZXQoCi0gICAgICAgICAgICAgICAgICAgIHBBdXhfdGVtcF8xLAotICAgICAgICAgICAgICAgICAgICAwLAotICAgICAgICAgICAgICAgICAgICAoTE9OR19CTE9DSzEgLSBXX0xfU1RBUlRfMikqc2l6ZW9mKCpwQXV4X3RlbXBfMSkpOwotCi0gICAgICAgICAgICAgICAgYnJlYWs7Ci0KLQotICAgICAgICAgICAgY2FzZSBMT05HX1NUT1BfU0VRVUVOQ0U6Ci0KLSAgICAgICAgICAgICAgICBwdl9tZW1zZXQoCi0gICAgICAgICAgICAgICAgICAgIHBBdXhfdGVtcF8xLAotICAgICAgICAgICAgICAgICAgICAwLAotICAgICAgICAgICAgICAgICAgICAoV19MX1NUT1BfMSkqc2l6ZW9mKCpwQXV4X3RlbXBfMSkpOwotCi0gICAgICAgICAgICAgICAgcFNob3J0X1dpbmRvd18xICAgPSAmU2hvcnRfV2luZG93X2Z4cFt3bmRfc2hhcGVfcHJldl9ia11bMF07Ci0gICAgICAgICAgICAgICAgcFNob3J0X1dpbmRvd18yICAgPSAmcFNob3J0X1dpbmRvd18xW0hBTEZfU0hPUlRfV0lORE9XXTsKLQotICAgICAgICAgICAgICAgIHBBdXhfdGVtcF8xICAgICAgPSAmcEF1eF90ZW1wXzFbV19MX1NUT1BfMV07Ci0gICAgICAgICAgICAgICAgcEF1eF90ZW1wXzIgICAgICA9IHBBdXhfdGVtcF8xICsgSEFMRl9TSE9SVF9XSU5ET1c7Ci0KLSAgICAgICAgICAgICAgICBmb3IgKGkgPSBIQUxGX1NIT1JUX1dJTkRPVzsgaSA+IDA7IGktLSkKLSAgICAgICAgICAgICAgICB7Ci0KLSAgICAgICAgICAgICAgICAgICAgKnBBdXhfdGVtcF8xID0gZnhwX211bDMyX2J5XzE2KCgqcEF1eF90ZW1wXzEpLCAqcFNob3J0X1dpbmRvd18xKyspID4+IHNoaWZ0OwotICAgICAgICAgICAgICAgICAgICBwQXV4X3RlbXBfMSsrOwotICAgICAgICAgICAgICAgICAgICAqcEF1eF90ZW1wXzIgPSBmeHBfbXVsMzJfYnlfMTYoKCpwQXV4X3RlbXBfMiksICpwU2hvcnRfV2luZG93XzIrKykgPj4gc2hpZnQ7Ci0gICAgICAgICAgICAgICAgICAgIHBBdXhfdGVtcF8yKys7Ci0KLQotICAgICAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgICAgIC8qIGRhdGEgdW5jaGFuZ2VkIGZyb20gIFdfTF9TVE9QXzIgdG8gTE9OR19XSU5ET1cgKi8KLSAgICAgICAgICAgICAgICBwQXV4X3RlbXBfMSA9ICZwQXV4X3RlbXBbV19MX1NUT1BfMl07Ci0KLSAgICAgICAgICAgICAgICBpZiAoc2hpZnQpCi0gICAgICAgICAgICAgICAgewotICAgICAgICAgICAgICAgICAgICBmb3IgKGkgPSAoKExPTkdfV0lORE9XIC0gV19MX1NUT1BfMikgPj4gMSk7IGkgIT0gMDsgaS0tKQotICAgICAgICAgICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgICAgICAgICAqKHBBdXhfdGVtcF8xKyspID4+PSBzaGlmdDsKLSAgICAgICAgICAgICAgICAgICAgICAgICoocEF1eF90ZW1wXzErKykgPj49IHNoaWZ0OwotICAgICAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgfQotCi0KLQotICAgICAgICAgICAgICAgIHBBdXhfdGVtcF8xID0gJnBBdXhfdGVtcFtMT05HX1dJTkRPV107Ci0gICAgICAgICAgICAgICAgcEF1eF90ZW1wXzIgPSAgcEF1eF90ZW1wXzEgKyBIQUxGX0xPTkdfV0lORE9XOwotCi0gICAgICAgICAgICAgICAgcExvbmdfV2luZG93XzEgPQotICAgICAgICAgICAgICAgICAgICAmTG9uZ19XaW5kb3dfZnhwW3duZF9zaGFwZV90aGlzX2JrXVtMT05HX1dJTkRPV19tXzFdOwotCi0KLSAgICAgICAgICAgICAgICBwTG9uZ19XaW5kb3dfMiAgID0gJnBMb25nX1dpbmRvd18xWy1IQUxGX0xPTkdfV0lORE9XXTsKLQotICAgICAgICAgICAgICAgIGZvciAoaSA9IEhBTEZfTE9OR19XSU5ET1c7IGkgPiAwOyBpLS0pCi0gICAgICAgICAgICAgICAgewotICAgICAgICAgICAgICAgICAgICAqcEF1eF90ZW1wXzEgPSBmeHBfbXVsMzJfYnlfMTYoKCpwQXV4X3RlbXBfMSksICpwTG9uZ19XaW5kb3dfMS0tKSA+PiBzaGlmdDsKLSAgICAgICAgICAgICAgICAgICAgcEF1eF90ZW1wXzErKzsKLSAgICAgICAgICAgICAgICAgICAgKnBBdXhfdGVtcF8yID0gZnhwX211bDMyX2J5XzE2KCgqcEF1eF90ZW1wXzIpLCAqcExvbmdfV2luZG93XzItLSkgPj4gc2hpZnQ7Ci0gICAgICAgICAgICAgICAgICAgIHBBdXhfdGVtcF8yKys7Ci0KLSAgICAgICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgICAgICBicmVhazsKLQotICAgICAgICAgICAgY2FzZSBPTkxZX0xPTkdfU0VRVUVOQ0U6Ci0gICAgICAgICAgICBkZWZhdWx0OgotCi0gICAgICAgICAgICAgICAgcEF1eF90ZW1wXzIgPSAmcEF1eF90ZW1wW0xPTkdfV0lORE9XXTsKLQotICAgICAgICAgICAgICAgIHBMb25nX1dpbmRvd18xID0gJkxvbmdfV2luZG93X2Z4cFt3bmRfc2hhcGVfcHJldl9ia11bMF07Ci0KLQotICAgICAgICAgICAgICAgIHBMb25nX1dpbmRvd18yID0KLSAgICAgICAgICAgICAgICAgICAgJkxvbmdfV2luZG93X2Z4cFt3bmRfc2hhcGVfdGhpc19ia11bTE9OR19XSU5ET1dfbV8xXTsKLQotCi0gICAgICAgICAgICAgICAgZm9yIChpID0gTE9OR19XSU5ET1c7IGkgPiAwOyBpLS0pCi0gICAgICAgICAgICAgICAgewotCi0gICAgICAgICAgICAgICAgICAgICpwQXV4X3RlbXBfMSA9IGZ4cF9tdWwzMl9ieV8xNigoKnBBdXhfdGVtcF8xKSwgKnBMb25nX1dpbmRvd18xKyspID4+IHNoaWZ0OwotICAgICAgICAgICAgICAgICAgICBwQXV4X3RlbXBfMSsrOwotICAgICAgICAgICAgICAgICAgICAqcEF1eF90ZW1wXzIgPSBmeHBfbXVsMzJfYnlfMTYoKCpwQXV4X3RlbXBfMiksICpwTG9uZ19XaW5kb3dfMi0tKSA+PiBzaGlmdDsKLSAgICAgICAgICAgICAgICAgICAgcEF1eF90ZW1wXzIrKzsKLSAgICAgICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgICAgICBicmVhazsKLQotICAgICAgICB9ICAgLyogZW5kIHN3aXRjaCAoIHduZF9zZXEpICAqLwotCi0KLQotICAgICAgICAqcFFfZm9ybWF0ICs9IG1kY3RfZnhwKAotICAgICAgICAgICAgICAgICAgICAgICAgICBwQXV4X3RlbXAsCi0gICAgICAgICAgICAgICAgICAgICAgICAgIG1lbV80X2luX3BsYWNlX0ZGVCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgTE9OR19CTE9DSzEpOwotCi0KLSAgICB9ICAgLyogZW5kIGlmKCB3bmRfc2VxICE9IEVJR0hUX1NIT1JUX1NFUVVFTkNFKSAqLwotCi0KLQotICAgIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLSAgICAvKiBkZWNvZGluZyBwcm9jZXNzIGZvciBzaG9ydCB3aW5kb3cgKi8KLSAgICAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0KLSAgICAvKgotICAgICAqIEZvciBzaG9ydCB3aW5kb3cgdGhlIGZvbGxvd2luZyBjb2RlIHdpbGwgYmUgYXBwbGllZAotICAgICAqIGluIHRoZSBmdXR1cmUgd2hlbiBzaG9ydCB3aW5kb3cgaXMgc3VwcG9ydGVkIGluIHRoZQotICAgICAqIHN0YW5kYXJkcwotICAgICAqLwotICAgIC8qLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLQotCi0gICAgKiAgICAgICAgcEF1eF90ZW1wID0gJm1lbV80X2luX3BsYWNlX0ZGVFsoMipTSE9SVF9CTE9DSzEpXTsKLSAgICAqCi0gICAgKiAgICAgICAgZm9yICggd25kPTA7IHduZDxOVU1fU0hPUlRfV0lORE9XUzsgd25kKyspCi0gICAgKiAgICAgICAgewotICAgICoKLSAgICAqICAgICAgICAgICAgcFNob3J0X1dpbmRvd18xID0gJlNob3J0X1dpbmRvd19meHBbd25kX3NoYXBlX3RoaXNfYmtdWzBdOwotICAgICoKLSAgICAqICAgICAgICAgICAgaWYgKHduZCA9PSAwKQotICAgICogICAgICAgICAgICB7Ci0gICAgKiAgICAgICAgICAgICAgICBwU2hvcnRfV2luZG93XzEgPSAmU2hvcnRfV2luZG93X2Z4cFt3bmRfc2hhcGVfcHJldl9ia11bMF07Ci0gICAgKiAgICAgICAgICAgIH0KLSAgICAqCi0gICAgKiAgICAgICAgICAgIHBTaG9ydF9XaW5kb3dfMiAgID0KLSAgICAqICAgICAgICAgICAgICAgICAgICAmU2hvcnRfV2luZG93X2Z4cFt3bmRfc2hhcGVfdGhpc19ia11bU0hPUlRfV0lORE9XX21fMV07Ci0gICAgKgotICAgICogICAgICAgICAgICBwQXV4X3RlbXBfMSA9ICBwQXV4X3RlbXA7Ci0gICAgKiAgICAgICAgICAgIHBBdXhfdGVtcF8yID0gcEF1eF90ZW1wXzEgKyBTSE9SVF9XSU5ET1c7Ci0gICAgKgotICAgICogICAgICAgICAgICBRX2F1eCA9IDA7Ci0gICAgKgotICAgICogICAgICAgICAgICBidWZmZXJfYWRhcHRhdGlvbiAoCi0gICAgKiAgICAgICAgICAgICAgICAmUV9hdXgsCi0gICAgKiAgICAgICAgICAgICAgICAmVGltZTJGcmVxX2RhdGFbIFdfTF9TVE9QXzEgKyB3bmQqU0hPUlRfV0lORE9XXSwKLSAgICAqICAgICAgICAgICAgICAgICh2b2lkICopIHBBdXhfdGVtcCwKLSAgICAqICAgICAgICAgICAgICAgIFNIT1JUX0JMT0NLMSwKLSAgICAqICAgICAgICAgICAgICAgIFVTSU5HX0lOVCwKLSAgICAqICAgICAgICAgICAgICAgIDE2KTsKLSAgICAqCi0gICAgKgotICAgICogICAgICAgICAgICBmb3IgKCBpPVNIT1JUX1dJTkRPVzsgaT4wOyBpLS0pCi0gICAgKiAgICAgICAgICAgIHsKLSAgICAqICAgICAgICAgICAgICAgIHRlbXAgICAgICAgICAgID0gKCpwQXV4X3RlbXBfMSkgKiAqcFNob3J0X1dpbmRvd18xKys7Ci0gICAgKiAgICAgICAgICAgICAgICAqcEF1eF90ZW1wXzErKyA9ICh0ZW1wICsgMHgwODAwMEwpID4+IDE2OwotICAgICoKLSAgICAqICAgICAgICAgICAgICAgIHRlbXAgICAgICAgICAgID0gKCpwQXV4X3RlbXBfMikgKiAqcFNob3J0X1dpbmRvd18yLS07Ci0gICAgKiAgICAgICAgICAgICAgICAqcEF1eF90ZW1wXzIrKyA9ICh0ZW1wICsgMHgwODAwMEwpID4+IDE2OwotICAgICoKLSAgICAqICAgICAgICAgICAgfQotICAgICoKLSAgICAqCi0gICAgKiAgICAgICAgICAgIGV4cCA9IG1kY3RfZnhwKAotICAgICogICAgICAgICAgICAgICAgcEF1eF90ZW1wLAotICAgICogICAgICAgICAgICAgICAgbWVtXzRfaW5fcGxhY2VfRkZULAotICAgICogICAgICAgICAgICAgICAgU0hPUlRfQkxPQ0sxKTsKLSAgICAqCi0gICAgKgotICAgICogICAgICAgICAgICBleHAgKz0gUV9hdXg7Ci0gICAgKgotICAgICogICAgICAgICAgICBwQXV4X3RlbXBfMSAgPSAgcEF1eF90ZW1wOwotICAgICogICAgICAgICAgICBwQXV4X3RlbXBfMiAgPSAgcEF1eF90ZW1wXzEgICsgIEhBTEZfU0hPUlRfV0lORE9XOwotICAgICogICAgICAgICAgICBwVGltZV9kYXRhXzEgPSAmVGltZTJGcmVxX2RhdGFbd25kKlNIT1JUX1dJTkRPV107Ci0gICAgKiAgICAgICAgICAgIHBUaW1lX2RhdGFfMiA9ICBwVGltZV9kYXRhXzEgKyBIQUxGX1NIT1JUX1dJTkRPVzsKLSAgICAqCi0gICAgKgotICAgICogICAgICAgICAgICBpZiAoZXhwID4gMCkKLSAgICAqICAgICAgICAgICAgewotICAgICogICAgICAgICAgICAgICAgZm9yICggaT1IQUxGX1NIT1JUX1dJTkRPVzsgaT4wOyBpLS0pCi0gICAgKiAgICAgICAgICAgICAgICB7Ci0gICAgKiAgICAgICAgICAgICAgICAgICAgKnBUaW1lX2RhdGFfMSsrID0gKCpwQXV4X3RlbXBfMSsrPj5leHApOwotICAgICogICAgICAgICAgICAgICAgICAgICpwVGltZV9kYXRhXzIrKyA9ICgqcEF1eF90ZW1wXzIrKz4+ZXhwKTsKLSAgICAqICAgICAgICAgICAgICAgIH0KLSAgICAqICAgICAgICAgICAgfQotICAgICogICAgICAgICAgICBlbHNlIGlmIChleHAgPCAwKQotICAgICogICAgICAgICAgICB7Ci0gICAgKiAgICAgICAgICAgICAgICBleHAgPSAtZXhwOwotICAgICogICAgICAgICAgICAgICAgZm9yICggaT1IQUxGX1NIT1JUX1dJTkRPVzsgaT4wOyBpLS0pCi0gICAgKiAgICAgICAgICAgICAgICB7Ci0gICAgKiAgICAgICAgICAgICAgICAgICAgKnBUaW1lX2RhdGFfMSsrID0gKCpwQXV4X3RlbXBfMSsrPDxleHApOwotICAgICogICAgICAgICAgICAgICAgICAgICpwVGltZV9kYXRhXzIrKyA9ICgqcEF1eF90ZW1wXzIrKzw8ZXhwKTsKLSAgICAqICAgICAgICAgICAgICAgIH0KLSAgICAqICAgICAgICAgICAgfQotICAgICogICAgICAgICAgICBlbHNlCi0gICAgKiAgICAgICAgICAgIHsKLSAgICAqICAgICAgICAgICAgICAgIGZvciAoIGk9SEFMRl9TSE9SVF9XSU5ET1c7IGk+MDsgaS0tKQotICAgICogICAgICAgICAgICAgICAgewotICAgICogICAgICAgICAgICAgICAgICAgICpwVGltZV9kYXRhXzErKyA9ICgqcEF1eF90ZW1wXzErKyk7Ci0gICAgKiAgICAgICAgICAgICAgICAgICAgKnBUaW1lX2RhdGFfMisrID0gKCpwQXV4X3RlbXBfMisrKTsKLSAgICAqICAgICAgICAgICAgICAgIH0KLSAgICAqICAgICAgICAgICAgfQotICAgICoKLSAgICAqICAgICAgICB9Ci0gICAgKgotICAgICogICAgfQotICAgICoKLSAgICAqLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0qLwotCi19ICAgLyogdHJhbnM0bV90aW1lXzJfZnJlcV9meHAgKi8KZGlmZiAtLWdpdCBhL21lZGlhL2xpYnN0YWdlZnJpZ2h0L2NvZGVjcy9hYWNkZWMvdW5wYWNrX2lkeC5jcHAgYi9tZWRpYS9saWJzdGFnZWZyaWdodC9jb2RlY3MvYWFjZGVjL3VucGFja19pZHguY3BwCmRlbGV0ZWQgZmlsZSBtb2RlIDEwMDY0NAppbmRleCA5MTgwOTk0Li4wMDAwMDAwCi0tLSBhL21lZGlhL2xpYnN0YWdlZnJpZ2h0L2NvZGVjcy9hYWNkZWMvdW5wYWNrX2lkeC5jcHAKKysrIC9kZXYvbnVsbApAQCAtMSw2NjAgKzAsMCBAQAotLyogLS0tLS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Bmb3IgbW9kID0gezMsOCw5LDEzLDE3fQotCi0gICAgVGhlcmUgZXhpc3RzICJlbXB0eSIgc3BhY2VzIGluIHRoZSB0YWJsZS4gIFRoZXNlIGNhbiBwb3RlbnRpYWxseQotICAgIGJlIHV0aWxpemVkIGJ5IG90aGVyIGNvbnN0IHRhYmxlcywgaWYgYXZhaWxhYmxlIG1lbW9yeSBiZWNvbWVzIGFuIGlzc3VlLgotLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tKi8KLQotY29uc3QgSW50IGRpdl9tb2RbMThdID0gICAvKiAgIG1vZCAgIGluZGV4ICBRLWZvcm1hdCAqLwotewotICAgIC8qIC0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tICovCi0gICAgMHhDQywgICAgICAgICAgICAgICAgIC8qIHwgICAgICB8ICAwICB8ICAgICAgICAgICovCi0gICAgMHhDQywgICAgICAgICAgICAgICAgIC8qIHwgICAgICB8ICAxICB8ICAgICAgICAgICovCi0gICAgMHhDQywgICAgICAgICAgICAgICAgIC8qIHwgICAgICB8ICAyICB8ICAgICAgICAgICovCi0gICAgMjczMSwgICAgICAgICAgICAgICAgIC8qIHwgIDMgICB8ICAzICB8ICAgMTMgICAgICovCi0gICAgMHhDQywgICAgICAgICAgICAgICAgIC8qIHwgICAgICB8ICA0ICB8ICAgICAgICAgICovCi0gICAgMHhDQywgICAgICAgICAgICAgICAgIC8qIHwgICAgICB8ICA1ICB8ICAgICAgICAgICovCi0gICAgMHhDQywgICAgICAgICAgICAgICAgIC8qIHwgICAgICB8ICA2ICB8ICAgICAgICAgICovCi0gICAgMHhDQywgICAgICAgICAgICAgICAgIC8qIHwgICAgICB8ICA3ICB8ICAgICAgICAgICovCi0gICAgMTAyNSwgICAgICAgICAgICAgICAgIC8qIHwgIDggICB8ICA4ICB8ICAgMTMgICAgICovCi0gICAgOTExLCAgICA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50MzIpIGNvZGV3b3JkX2luZHggKiBkaXZfbW9kW21vZF0pID4+IFFfRk9STUFUX01PRDsKLQotICAgIGNvZGV3b3JkX2luZHggLT0gdGVtcF9zcGVjICogbW9kOwotCi0gICAgdGVtcF9zcGVjIC09IG9mZjsKLSAgICAqcFF1YW50U3BlYysrICA9IChJbnQxNil0ZW1wX3NwZWM7Ci0KLSAgICB0ZW1wX3NwZWMgPSBwdl9hYnModGVtcF9zcGVjKTsKLQotCi0gICAgaWYgKHRlbXBfc3BlYyA+ICptYXgpCi0gICAgewotICAgICAgICAqbWF4ID0gdGVtcF9zcGVjOwotICAgIH0KLQotICAgIC8qCi0gICAgKiAgQ2FsY3VsYXRlIHBRdWFudFNwZWNbM10gaWYgZGltID09IDQKLSAgICAqICBDYWxjdWxhdGUgcFF1YW50U3BlY1sxXSBpZiBkaW0gPT0gMgotICAgICovCi0gICAgY29kZXdvcmRfaW5keCAtPSBvZmY7Ci0gICAgKnBRdWFudFNwZWMgICAgPSAoSW50MTYpY29kZXdvcmRfaW5keCA7Ci0KLQotICAgIGNvZGV3b3JkX2luZHggPSBwdl9hYnMoY29kZXdvcmRfaW5keCk7Ci0KLSAgICBpZiAoY29kZXdvcmRfaW5keCA+ICptYXgpCi0gICAgewotICAgICAgICAqbWF4ID0gY29kZXdvcmRfaW5keDsKLSAgICB9Ci0KLQotICAgIHJldHVybiA7Ci19IC8qIHVucGFja19pZHggKi8KLQotCi12b2lkIHVucGFja19pZHhfc2duKAotICAgIEludDE2ICAgcXVhbnRfc3BlY1tdLAotICAgIEludCBjb2Rld29yZF9pbmR4LAotICAgIGNvbnN0IEhjYiAgICpwSHVmZkNvZGVib29rLAotICAgIEJJVFMgICpwSW5wdXRTdHJlYW0sCi0gICAgSW50ICptYXgpCi17Ci0gICAgSW50MTYgKnBRdWFudFNwZWMgPSAmcXVhbnRfc3BlY1swXTsKLSAgICBJbnQgIHRlbXBfc3BlYzsKLSAgICBJbnQgIHNnbjsKLQotICAgIGNvbnN0IEludCBtb2QgPSBwSHVmZkNvZGVib29rLT5tb2Q7Ci0gICAgY29uc3QgSW50IG9mZiA9IHBIdWZmQ29kZWJvb2stPm9mZjsKLQotCi0KLSAgICBpZiAocEh1ZmZDb2RlYm9vay0+ZGltID09IERJTUVOU0lPTl80KQotICAgIHsKLSAgICAgICAgLyogQ2FsY3VsYXRlIHBRdWFudFNwZWNbMF0gKi8KLSAgICAgICAgcHJlbG9hZF9jYWNoZSgoSW50MzIgKilwUXVhbnRTcGVjKTsKLSAgICAgICAgdGVtcF9zcGVjICAgICAgPSAoY29kZXdvcmRfaW5keCAqIERJVl8zX0NVQkVEKSA+PiBRX0ZPUk1BVF9NT0QzOwotCi0gICAgICAgIGNvZGV3b3JkX2luZHggLT0gdGVtcF9zcGVjICogVEhSRUVfQ1VCRUQ7Ci0KLSAgICAgICAgdGVtcF9zcGVjIC09IG9mZjsKLSAgICAgICAgaWYgKHRlbXBfc3BlYykKLSAgICAgICAgewotICAgICAgICAgICAgc2duID0gZ2V0MWJpdHMocElucHV0U3RyZWFtKTsKLQotCi0gICAgICAgICAgICAqcFF1YW50U3BlYysrID0gKEludDE2KSgoc2duKSA/IC10ZW1wX3NwZWMgOiB0ZW1wX3NwZWMpOwotCi0gICAgICAgICAgICB0ZW1wX3NwZWMgPSBwdl9hYnModGVtcF9zcGVjKTsKLQotICAgICAgICAgICAgaWYgKHRlbXBfc3BlYyA+ICptYXgpCi0gICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgKm1heCA9IHRlbXBfc3BlYzsKLSAgICAgICAgICAgIH0KLQotICAgICAgICB9Ci0gICAgICAgIGVsc2UKLSAgICAgICAgewotICAgICAgICAgICAgKnBRdWFudFNwZWMrKyA9IDA7Ci0gICAgICAgIH0KLQotICAgICAgICAvKiBDYWxjdWxhdGUgcFF1YW50U3BlY1sxXSAqLwotICAgICAgICB0ZW1wX3NwZWMgICAgICA9IChjb2Rld29yZF9pbmR4ICogRElWXzNfU1FVQVJFRCkgPj4g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HNnbikgPyAtdGVtcF9zcGVjIDogdGVtcF9zcGVjKTsKLQotICAgICAgICB0ZW1wX3NwZWMgPSBwdl9hYnModGVtcF9zcGVjKTsKLQotICAgICAgICBpZiAodGVtcF9zcGVjID4gKm1heCkKLSAgICAgICAgewotICAgICAgICAgICAgKm1heCA9IHRlbXBfc3BlYzsKLSAgICAgICAgfQotICAgIH0KLSAgICBlbHNlCi0gICAgewotICAgICAgICAqcFF1YW50U3BlYysrID0gMDsKLSAgICB9Ci0KLSAgICAvKgotICAgICAqICBDYWxjdWxhdGUgcFF1YW50U3BlY1szXSBpZiBkaW0gPT0gNAotICAgICAqICBDYWxjdWxhdGUgcFF1YW50U3BlY1sxXSBpZiBkaW0gPT0gMgotICAgICAqLwotICAgIGNvZGV3b3JkX2luZHggLT0gb2ZmOwotICAgIGlmIChjb2Rld29yZF9pbmR4KQotICAgIHsKLQotICAgICAgICBzZ24gPSBnZXQxYml0cyhwSW5wdXRTdHJlYW0pOwotCi0gICAgICAgICpwUXVhbnRTcGVjID0gKEludDE2KSgoc2duKSA/IC1jb2Rld29yZF9pbmR4IDogY29kZXdvcmRfaW5keCk7Ci0KLSAgICAgICAgY29kZXdvcmRfaW5keCA9IHB2X2Ficyhjb2Rld29yZF9pbmR4KTsKLQotICAgICAgICBpZiAoY29kZXdvcmRfaW5keCA+ICptYXgpCi0gICAgICAgIHsKLSAgICAgICAgICAgICptYXggPSBjb2Rld29yZF9pbmR4OwotICAgICAgICB9Ci0gICAgfQotICAgIGVsc2UKLSAgICB7Ci0gICAgICAgICpwUXVhbnRTcGVjID0gMDsKLSAgICB9Ci0KLSAgICByZXR1cm4gOwotfSAvKiB1bnBhY2tfaWR4X3NnbiAqLwotCi0KLXZvaWQgdW5wYWNrX2lkeF9lc2MoCi0gICAgSW50MTYgICBxdWFudF9zcGVjW10sCi0gICAgSW50IGNvZGV3b3JkX2luZHgsCi0gICAgY29uc3QgSGNiICAgKnBIdWZmQ29kZWJvb2ssCi0gICAgQklUUy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jID0gKEludCkoKHRlbXBfc3BlYyAqIGVzY19zZXEpID4+IDQpOwotCi0gICAgfQotCi0KLSAgICBpZiAoc2duMSkKLSAgICB7Ci0gICAgICAgIHF1YW50X3NwZWNbMF0gID0gKEludDE2KSgtdGVtcF9zcGVjKTsKLSAgICB9Ci0gICAgZWxzZQotICAgIHsKLSAgICAgICAgcXVhbnRfc3BlY1swXSAgPSAoSW50MTYpdGVtcF9zcGVjOwotICAgIH0KLQotICAgIHRlbXBfc3BlYyA9IHB2X2Ficyh0ZW1wX3NwZWMpOwotCi0gICAgaWYgKHRlbXBfc3BlYyA+ICptYXgpCi0gICAgewotICAgICAgICAqbWF4ID0gdGVtcF9zcGVjOwotICAgIH0KLQotICAgIGlmICgoY29kZXdvcmRfaW5keCAmIExPV0VSXzVfQklUU19NQVNLKSA9PSAxNikKLSAgICB7Ci0gICAgICAgIE4gPSAzOwotICAgICAgICBkbwotICAgICAgICB7Ci0gICAgICAgICAgICBOKys7Ci0KLSAgICAgICAgICAgIGVzY19zZXEgPSBnZXQxYml0cyhwSW5wdXRTdHJlYW0pOwotCi0gICAgICAgIH0KLSAgICAgICAgd2hpbGUgKGVzY19zZXEgIT0gMCk7Ci0KLSAgICAgICAgZXNjX3NlcSAgPSBnZXRiaXRzKE4sIHBJbnB1dFN0cmVhbSk7Ci0KLSAgICAgICAgZXNjX3NlcSArPSAoMSA8PCBOKTsKLQotICAgICAgICBjb2Rld29yZF9pbmR4ID0gKEludCkoKGNvZGV3b3JkX2luZHggKiBlc2Nfc2VxKSA+PiA0KTsKLSAgICB9Ci0KLQotCi0KLSAgICBpZiAoc2duMikKLSAgICB7Ci0gICAgICAgIHF1YW50X3NwZWNbMV0gICAgPSAoSW50MTYpKC1jb2Rld29yZF9pbmR4KTsKLSAgICB9Ci0gICAgZWxzZQotICAgIHsKLSAgICAgICAgcXVhbnRfc3BlY1sxXSAgICA9IChJbnQxNiljb2Rld29yZF9pbmR4OwotICAgIH0KLQotCi0gICAgY29kZXdv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VTkNUSU9OIERFRklOSVRJT05TCi0gICAgOyBGdW5jdGlvbiBQcm90b3R5cGUgZGVjbGFyYXRpb24KLSAgICAtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tKi8KLQotICAgIHZvaWQgdHJhbnM0bV9mcmVxXzJfdGltZV9meHAoCi0gICAgICAgIEludDMyICAgRnJlcXVlbmN5X2RhdGFbXSwKLSAgICAgICAgSW50MzIgICBUaW1lX2RhdGFbXSwKLSNpZmRlZiBBQUNfUExVUwotICAgICAgICBJbnQzMiAgIE91dHB1dF9idWZmZXJbXSwKLSNlbHNlCi0gICAgICAgIEludDE2ICAgT3V0cHV0X2J1ZmZlcltdLAotI2VuZGlmCi0gICAgICAgIFdJTkRPV19TRVFVRU5DRSB3bmRfc2VxLAotICAgICAgICBJbnQgICAgIHduZF9zaGFwZV9wcmV2X2JrLAotICAgICAgICBJbnQgICAgIHduZF9zaGFwZV90aGlzX2JrLAotICAgICAgICBJbnQgICAgIFFfZm9ybWF0LAotICAgICAgICBJbnQzMiAgIGFic19tYXhfcGVyX3dpbmRvd1tdLAotICAgICAgICBJbnQzMiAgIGZyZXFfMl90aW1lX2J1ZmZlcltdICwKLSAgICAgICAgSW50MTYgICAqSW50ZXJsZWF2ZV9vdXRwdXQKLSAgICApOwotCi0KLQotICAgIHZvaWQgdHJhbnM0bV9mcmVxXzJfdGltZV9meHBfMSgKLSAgICAgICAgSW50MzIgICBGcmVxdWVuY3lfZGF0YVtdLAotICAgICAgICBJbnQzMiAgIFRpbWVfZGF0YVtdLAotICAgICAgICBJbnQxNiAgIE91dHB1dF9idWZmZXJbXSwKLSAgICAgICAgV0lORE9XX1NFUVVFTkNFIHduZF9zZXEsCi0gICAgICAgIEludCAgICAgd25kX3NoYXBlX3ByZXZfYmssCi0gICAgICAgIEludCAgICAgd25kX3NoYXBlX3RoaXNfYmssCi0gICAgICAgIEludCAgICAgUV9mb3JtYXQsCi0gICAgICAgIEludDMyICAgYWJzX21heF9wZXJfd2luZG93W10sCi0gICAgICAgIEludDMyICAgZnJlcV8yX3RpbWVfYnVmZmVyW10KLSAgICApOwotCi0KLSAgICB2b2lkIHRyYW5zNG1fZnJlcV8yX3RpbWVfZnhwXzIoCi0gICAgICAgIEludDMyICAgRnJlcXVlbmN5X2RhdGFbXSwKLSAgICAgICAgSW50MzIgICBUaW1lX2RhdGFbXSwKLSAgICAgICAgV0lORE9XX1NFUVVFTkNFIHduZF9zZXEsCi0gICAgICAgIEludCAgICAgd25kX3NoYXBlX3ByZXZfYmssCi0gICAgICAgIEludCAgICAgd25kX3NoYXBlX3RoaXNfYmssCi0gICAgICAgIEludCAgICAgUV9mb3JtYXQsCi0gICAgICAgIEludDMyICAgYWJzX21heF9wZXJfd2luZG93W10sCi0gICAgICAgIEludDMyICAgZnJlcV8yX3RpbWVfYnVmZmVyW10gLAotICAgICAgICBJbnQxNiAgICpJbnRlcmxlYXZlX291dHB1dAotICAgICk7Ci0KLSAgICB2b2lkIHRyYW5zNG1fdGltZV8yX2ZyZXFfZnhwKAotICAgICAgICBJbnQzMiAgIFRpbWUyRnJlcV9kYXRhW10sCi0gICAgICAgIFdJTkRPV19TRVFVRU5DRSB3bmRfc2VxLAotICAgICAgICBJbnQgICAgIHduZF9zaGFwZV9wcmV2X2JrLAotICAgICAgICBJbnQgICAgIHduZF9zaGFwZV90aGlzX2JrLAotICAgICAgICBJbnQgICAgICpwUV9mb3JtYXQsCi0gICAgICAgIEludDMyICAgbWVtXzRfaW5fcGxhY2VfRkZUW10pOwotCi0gICAgLyotLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tCi0gICAgOyBFTkQKLSAgICAtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0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RzLgotCi0gRGVzY3JpcHRpb246IEVsaW1pbmF0ZWQgc3RydWN0dXJlIHRvIGF2b2lkIGFzc2lnbmluZyBhZGRyZXNzZXMgdG8gY29uc3RhbnQKLSAgICAgICAgICAgICAgdGFibGVzLiBUaGlzIHNvbHZlIGxpbmtpbmcgcHJvYmxlbSB3aGVuIHVzaW5nIHRoZQotICAgICAgICAgICAgICAvcm9waSBvcHRpb24gKFJlYWQtb25seSBwb3NpdGlvbiBpbmRlcGVuZGVudCkgZm9yIHNvbWUKLSAgICAgICAgICAgICAgY29tcGlsZXJzCi0gICAgICAgICAgICAgIC0gRWxpbWluYXRlZCBMb25nX1dpbmRvd19meHAgYW5kIFNob3J0X1dpbmRvd19meHAgYXMgZ2xvYmFsCi0gICAgICAgICAgICAgICAgY29udGFudHMgdmVjdG9ycwotCi0gV2hvOiAgICAgICAgICAgICAgICAgICAgICAgRGF0ZToKLSBEZXNjcmlwdGlvbjoKLQotICAtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0KLSBNT0RVTEUgREVTQ1JJUFRJT04KLQotICAgIFdpbmRvdyB0YWJsZXMKLQotICAgICAgICBGb3IgYSBzaW5lIHRhYmxlIHdpdGggTiAgcG9pbnRzOgotCi0gICAgICAgICAgICB3X2xlZnQgID0gc2luKHBpL04gKG4gKyAxLzIpKSAgICAgZm9yIDAgICA9PCBuIDwgTi8yCi0KLSAgICAgICAgICAgIHdfcmlndGggPSBzaW4ocGkvTiAobiArIDEvMikpICAgICBmb3IgTi8yID08IG4gPCBOCi0KLQotICAgICAgICBGb3IgS2Fpc2VyLUJlc3NlbCBkZXJpdmVkIChLQkQpCi0KLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBuICAgICAgICAgICAgIE4vMgotICAgICAgICAgICAgd19sZWZ0ICA9ICBzcXJ0KCggU1VNIFcocCxhKSApLygg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0gICAgICAgIGNvbnN0IEludCAgICAgc291cmNlUG9pbnRzUGVyQ2hhbm5lbCwKLSAgICAgICAgY29uc3QgSW50ICAgICBzb3VyY2VDaGFubmVscywKLSAgICAgICAgY29uc3QgSW50ICAgICByZXF1ZXN0ZWRDaGFubmVscywKLSAgICAgICAgY29uc3QgdFBWTVA0QXVkaW9EZWNvZGVyT3V0cHV0Rm9ybWF0ICBvdXRwdXRGb3JtYXQpOwotCi0jZWxzZQotCi0gICAgSW50IHdyaXRlX291dHB1dCgKLSAgICAgICAgY29uc3QgSW50MTYgICBzb3VyY2VMZWZ0W10sCi0gICAgICAgIGNvbnN0IEludDE2ICAgc291cmNlUmlnaHRbXSwKLSAgICAgICAgSW50MTYgICBvdXRwdXRCdWZmZXJbXSwKLSAgICAgICAgY29uc3QgSW50ICAgICBzb3VyY2VQb2ludHNQZXJDaGFubmVsLAotICAgICAgICBjb25zdCBJbnQgICAgIHNvdXJjZUNoYW5uZWxzLAotICAgICAgICBjb25zdCBJbnQgICAgIHJlcXVlc3RlZENoYW5uZWxzLAotI2lmZGVmIFBBUkFNRVRSSUNTVEVSRU8KLSAgICAgICAgSW50MzIgc2JyRW5hYmxlUFMsCi0jZW5kaWYKLSAgICAgICAgY29uc3QgdFBWTVA0QXVkaW9EZWNvZGVyT3V0cHV0Rm9ybWF0ICBvdXRwdXRGb3JtYXQpOwotCi0jaWZkZWYgQUFDXzMyX0JJVF9JTlRFUkZBQ0UKLQotICAgIEludCB3cml0ZV9vdXRwdXRfMSgKLSAgICAgICAgY29uc3QgSW50MzIgICBzb3VyY2VMZWZ0W10sCi0gICAgICAgIGNvbnN0IEludDMyICAgc291cmNlUmlnaHRbXSwKLSAgICAgICAgSW50MTYgICBvdXRwdXRCdWZmZXJbXSwKLSAgICAgICAgY29uc3QgSW50ICAgICBzb3VyY2VQb2ludHNQZXJDaGFubmVsLAotICAgICAgICBjb25zdCBJbnQgICAgIHNvdXJjZUNoYW5uZWxzLAotICAgICAgICBjb25zdC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1BdWRpb1NwZWNpZmljQ29uZmlnRGF0YSwgMik7Ci0gICAgICAgIGJ1ZmZlci0+c2V0X3JhbmdlKDAsIDIpOwotICAgICAgICBidWZmZXItPm1ldGFfZGF0YSgpLT5zZXRJbnQzMihrS2V5SXNDb2RlY0NvbmZpZywgdHJ1ZSk7Ci0gICAgICAgICpvdXQgPSBidWZmZXI7Ci0gICAgICAgICsrbUZyYW1lQ291bnQ7Ci0gICAgICAgIHJldHVybiBPSzsKLSAgICB9IGVsc2UgaWYgKG1GcmFtZUNvdW50ID09IDEpIHsKLSAgICAgICAgYnVmZmVyLT5tZXRhX2RhdGEoKS0+c2V0SW50MzIoa0tleUlzQ29kZWNDb25maWcsIGZhbHNlKTsKLSAgICB9Ci0KLSAgICBjb25zdCBpbnQzMl90IG5TYW1wbGVzID0gbUNoYW5uZWxzICoga051bVNhbXBsZXNQZXJGcmFtZTsKLSAgICB3aGlsZSAobU51bUlucHV0U2FtcGxlcyA8IG5TYW1wbGVzKSB7Ci0gICAgICAgIGlmIChtSW5wdXRCdWZmZXIgPT0gTlVMTCkgewotICAgICAgICAgICAgaWYgKG1Tb3VyY2UtPnJlYWQoJm1JbnB1dEJ1ZmZlciwgb3B0aW9ucykgIT0gT0spIHsKLSAgICAgICAgICAgICAgICBpZiAobU51bUlucHV0U2FtcGxlcyA9PSAwKSB7Ci0gICAgICAgICAgICAgICAgICAgIGJ1ZmZlci0+cmVsZWFzZSgpOwotICAgICAgICAgICAgICAgICAgICByZXR1cm4gRVJST1JfRU5EX09GX1NUUkVBTTsKLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgbWVtc2V0KCZtSW5wdXRGcmFtZVttTnVtSW5wdXRTYW1wbGVzXSwKLSAgICAgICAgICAgICAgICAgICAgICAgMCwKLSAgICAgICAgICAgICAgICAgICAgICAgc2l6ZW9mKGludDE2X3QpICogKG5TYW1wbGVzIC0gbU51bUlucHV0U2FtcGxlcykpOwotICAgICAgICAgICAgICAgIG1OdW1JbnB1dFNhbXBsZXMgPSAwOwotICAgICAgICAgICAgICAgIGJyZWFrOwotICAgICAgICAgICAgfQotCi0gICAgICAgICAgICBzaXplX3QgYWxpZ24gPSBtSW5wdXRCdWZmZXItPnJhbmdlX2xlbmd0aCgpICUgc2l6ZW9mKGludDE2X3QpOwotICAgICAgICAgICAgQ0hFQ0tfRVEoYWxpZ24sIChzaXplX3QpMCk7Ci0KLSAgICAgICAgICAgIGludDY0X3QgdGltZVVzOwotICAgICAgICAgICAgaWYgKG1JbnB1dEJ1ZmZlci0+bWV0YV9kYXRhKCktPmZpbmRJbnQ2NChrS2V5RHJpZnRUaW1lLCAmdGltZVVzKSkgewotICAgICAgICAgICAgICAgIHdhbGxDbG9ja1RpbWVVcyA9IHRpbWVVczsKLSAgICAgICAgICAgIH0KLSAgICAgICAgICAgIGlmIChtSW5wdXRCdWZmZXItPm1ldGFfZGF0YSgpLT5maW5kSW50NjQoa0tleUFuY2hvclRpbWUsICZ0aW1lVXMpKSB7Ci0gICAgICAgICAgICAgICAgbUFuY2hvclRpbWVVcyA9IHRpbWVVczsKLSAgICAgICAgICAgIH0KLSAgICAgICAgICAgIHJlYWRGcm9tU291cmNlID0gdHJ1ZTsKLSAgICAgICAgfSBlbHNlIHsKLSAgICAgICAgICAgIHJlYWRGcm9tU291cmNlID0gZmFsc2U7Ci0gICAgICAgIH0KLSAgICAgICAgc2l6ZV90IGNvcHkgPSAoblNhbXBsZXMgLSBtTnVtSW5wdXRTYW1wbGVzKSAqIHNpemVvZihpbnQxNl90KTsKLQotICAgICAgICBpZiAoY29weSA+IG1JbnB1dEJ1ZmZlci0+cmFuZ2VfbGVuZ3RoKCkpIHsKLSAgICAgICAgICAgIGNvcHkgPSBtSW5wdXRCdWZmZXItPnJhbmdlX2xlbmd0aCgpOwotICAgICAgICB9Ci0KLSAgICAgICAgbWVtY3B5KCZtSW5wdXRGcmFtZVttTnVtSW5wdXRTYW1wbGVzXSwKLSAgICAgICAgICAgICAgIChjb25zd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RleCA+IDApIHsKLSAgICAgICAgICAgICAgICByZXR1cm4gT01YX0Vycm9yTm9Nb3JlOwotICAgICAgICAgICAgfQotCi0gICAgICAgICAgICBmb3JtYXRQYXJhbXMtPmVFbmNvZGluZyA9Ci0gICAgICAgICAgICAgICAgKGZvcm1hdFBhcmFtcy0+blBvcnRJbmRleCA9PSAwKQotICAgICAgICAgICAgICAgICAgICA/IE9NWF9BVURJT19Db2RpbmdQQ00gOiBPTVhfQVVESU9fQ29kaW5nQUFDOwotCi0gICAgICAgICAgICByZXR1cm4gT01YX0Vycm9yTm9uZTsKLSAgICAgICAgfQotCi0gICAgICAgIGNhc2UgT01YX0luZGV4UGFyYW1BdWRpb0FhYzoKLSAgICAgICAgewotICAgICAgICAgICAgT01YX0FVRElPX1BBUkFNX0FBQ1BST0ZJTEVUWVBFICphYWNQYXJhbXMgPQotICAgICAgICAgICAgICAgIChPTVhfQVVESU9fUEFSQU1fQUFDUFJPRklMRVRZUEUgKilwYXJhbXM7Ci0KLSAgICAgICAgICAgIGlmIChhYWNQYXJhbXMtPm5Qb3J0SW5kZXggIT0gMSkgewotICAgICAgICAgICAgICAgIHJldHVybiBPTVhfRXJyb3JVbmRlZmluZWQ7Ci0gICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgIGFhY1BhcmFtcy0+bkJpdFJhdGUgPSBtQml0UmF0ZTsKLSAgICAgICAgICAgIGFhY1BhcmFtcy0+bkF1ZGlvQmFuZFdpZHRoID0gMDsKLSAgICAgICAgICAgIGFhY1BhcmFtcy0+bkFBQ3Rvb2xzID0gMDsKLSAgICAgICAgICAgIGFhY1BhcmFtcy0+bkFBQ0VSdG9vbHMgPSAwOwotICAgICAgICAgICAgYWFjUGFyYW1zLT5lQUFDUHJvZmlsZSA9IE9NWF9BVURJT19BQUNPYmplY3RNYWluOwotICAgICAgICAgICAgYWFjUGFyYW1zLT5lQUFDU3RyZWFtRm9ybWF0ID0gT01YX0FVRElPX0FBQ1N0cmVhbUZvcm1hdE1Q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E9NWF9BVURJT19DaGFubmVsTEY7Ci0gICAgICAgICAgICBwY21QYXJhbXMtPmVDaGFubmVsTWFwcGluZ1sxXSA9IE9NWF9BVURJT19DaGFubmVsUkY7Ci0KLSAgICAgICAgICAgIHBjbVBhcmFtcy0+bkNoYW5uZWxzID0gbU51bUNoYW5uZWxzOwotICAgICAgICAgICAgcGNtUGFyYW1zLT5uU2FtcGxpbmdSYXRlID0gbVNhbXBsZVJhdGU7Ci0KLSAgICAgICAgICAgIHJldHVybiBPTVhfRXJyb3JOb25lOwotICAgICAgICB9Ci0KLSAgICAgICAgZGVmYXVsdDoKLSAgICAgICAgICAgIHJldHVybiBTaW1wbGVTb2Z0T01YQ29tcG9uZW50OjppbnRlcm5hbEdldFBhcmFtZXRlcihpbmRleCwgcGFyYW1zKTsKLSAgICB9Ci19Ci0KLU9NWF9FUlJPUlRZUEUgU29mdEFBQ0VuY29kZXI6OmludGVybmFsU2V0UGFyYW1ldGVyKAotICAgICAgICBPTVhfSU5ERVhUWVBFIGluZGV4LCBjb25zdCBPTVhfUFRSIHBhcmFtcykgewotICAgIHN3aXRjaCAoaW5kZXgpIHsKLSAgICAgICAgY2FzZSBPTVhfSW5kZXhQYXJhbVN0YW5kYXJkQ29tcG9uZW50Um9sZToKLSAgICAgICAgewotICAgICAgICAgICAgY29uc3QgT01YX1BBUkFNX0NPTVBPTkVOVFJPTEVUWVBFICpyb2xlUGFyYW1zID0KLSAgICAgICAgICAgICAgICAoY29uc3QgT01YX1BBUkFNX0NPTVBPTkVOVFJPTEVUWVBFICopcGFyYW1zOwotCi0gICAgICAgICAgICBpZiAoc3RybmNtcCgoY29uc3QgY2hhciAqKXJvbGVQYXJhbXMtPmNSb2xlLAotICAgICAgICAgICAgICAgICAgICAgICAgImF1ZGlvX2VuY29kZXIuYWFjIiwKLSAgICAgICAgICAgICAgICAgICAgICAgIE9NWF9NQVhfU1RSSU5HTkFNRV9TSVpFIC0gMSkpIHsKLSAgICAgICAgICAgICAgICByZXR1cm4gT01YX0Vycm9yVW5kZWZpbmVkOwotICAgICAgICAgICAgfQotCi0gICAgICAgICAgICByZXR1cm4gT01YX0Vycm9yTm9uZTsKLSAgICAgICAgfQotCi0gICAgICAgIGNhc2UgT01YX0luZGV4UGFyYW1BdWRpb1BvcnRGb3JtYXQ6Ci0gICAgICAgIHsKLSAgICAgICAgICAgIGNvbnN0IE9NWF9BVURJT19QQVJBTV9QT1JURk9STUFUVFlQRSAqZm9ybWF0UGFyYW1zID0KLSAgICAgICAgICAgICAgICAoY29uc3QgT01YX0FVRElPX1BBUkFNX1BPUlRGT1JNQVRUWVBFICopcGFyYW1zOwotCi0gICAgICAgICAgICBpZiAoZm9ybWF0UGFyYW1zLT5uUG9ydEluZGV4ID4gMSkgewotICAgICAgICAgICAgICAgIHJldHVybiBPTVhfRXJyb3JVbmRlZmluZWQ7Ci0gICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgIGlmIChmb3JtYXRQYXJhbXMtPm5JbmRleCA+IDApIHsKLSAgICAgICAgICAgICAgICByZXR1cm4gT01YX0Vycm9yTm9Nb3JlOwotICAgICAgICAgICAgfQotCi0gICAgICAgICAgICBpZiAoKGZvcm1hdFBhcmFtcy0+blBvcnRJbmRleCA9PSAwCi0gICAgICAgICAgICAgICAgICAgICAgICAmJiBmb3JtYXRQYXJhbXMtPmVFbmNvZGluZyAhPSBPTVhfQVVESU9fQ29kaW5nUENNKQotICAgICAgICAgICAgICAgIHx8IChmb3JtYXRQYXJhbXMtPm5Qb3J0SW5kZXggPT0gMQotICAgICAgICAgICAgICAgICAgICAgICAgJiYgZm9ybWF0UGFyYW1zLT5lRW5jb2RpbmcgIT0gT01YX0FVRElPX0NvZGluZ0FBQykpIHsKLSAgICAgICAgICAgICAgICByZXR1cm4gT01YX0Vycm9yVW5kZWZpbmVkOwotICAgICAgICAgICAgfQotCi0gICAgICAgICAgICByZXR1cm4gT01YX0Vycm9yTm9uZTsKLSAgICAgICAgfQotCi0gICAgICAgIGNhc2UgT01YX0luZGV4UGFyYW1BdWRpb0FhYzoKLSAgICAgICAgewotICAgICAgICAgICAgT01YX0FVRElPX1BBUkFNX0FBQ1BST0ZJTEVUWVBFICphYWNQYXJhbXMgPQotICAgICAgICAgICAgICAgIChPTVhfQVVESU9fUEFSQU1fQUFDUFJPRklMRVRZUEUgKilwYXJhbXM7Ci0KLSAgICAgICAgICAgIGlmIChhYWNQYXJhbXMtPm5Qb3J0SW5kZXggIT0gMSkgewotICAgICAgICAgICAgICAgIHJldHVybiBPTVhfRXJyb3JVbmRlZmluZWQ7Ci0gICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgIG1CaXRSYXRlID0gYWFjUGFyYW1zLT5uQml0UmF0ZTsKLSAgICAgICAgICAgIG1OdW1DaGFubmVscyA9IGFhY1BhcmFtcy0+bkNoYW5uZWxzOwotICAgICAgICAgICAgbVNhbXBsZVJhdGUgPSBhYWNQYXJhbXMtPm5TYW1wbGVSYXRlOwotCi0gICAgICAgICAgICBpZiAoc2V0QXVkaW9QYXJhbXMoKSAhPSBPSykgewotICAgICAgICAgICAgICAgIHJldHVybiBPTVhfRXJyb3JVbmRlZmluZWQ7Ci0gICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgIHJldHVybiBPTVhfRXJyb3JOb25lOwotICAgICAgICB9Ci0KLSAgICAgICAgY2FzZSBPTVhfSW5kZXhQYXJhbUF1ZGlvUGNtOgotICAgICAgICB7Ci0gICAgICAgICAgICBPTVhfQVVESU9fUEFSQU1fUENNTU9ERVRZUEUgKnBjbVBhcmFtcyA9Ci0gICAgICAgICAgICAgICAgKE9NWF9BVURJT19QQVJBTV9QQ01NT0RFVFlQRSAqKXBhcmFtczsKLQotICAgICAgICAgICAgaWYgKHBjbVBhcmFtcy0+blBvcnRJbmRleCAhPSAwKSB7Ci0gICAgICAgICAgICAgICAgcmV0dXJuIE9NWF9FcnJvclVuZGVmaW5lZDsKLSAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgbU51bUNoYW5uZWxz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vIHRoZSAibUlucHV0RnJhbWUiIGJ1ZmZlciBhbmQgdGhlbiBlbmNvZGUgdGhvc2UKLSAgICAgICAgICAgIC8vIGFzIGEgdW5pdCBpbnRvIGFuIG91dHB1dCBidWZmZXIuCi0KLSAgICAgICAgICAgIGlmIChtU2F3SW5wdXRFT1MgfHwgaW5RdWV1ZS5lbXB0eSgpKSB7Ci0gICAgICAgICAgICAgICAgcmV0dXJuOwotICAgICAgICAgICAgfQotCi0gICAgICAgICAgICBCdWZmZXJJbmZvICppbkluZm8gPSAqaW5RdWV1ZS5iZWdpbigpOwotICAgICAgICAgICAgT01YX0JVRkZFUkhFQURFUlRZUEUgKmluSGVhZGVyID0gaW5JbmZvLT5tSGVhZGVyOwotCi0gICAgICAgICAgICBjb25zdCB2b2lkICppbkRhdGEgPSBpbkhlYWRlci0+cEJ1ZmZlciArIGluSGVhZGVyLT5uT2Zmc2V0OwotCi0gICAgICAgICAgICBzaXplX3QgY29weSA9IG51bUJ5dGVzUGVySW5wdXRGcmFtZSAtIG1JbnB1dFNpemU7Ci0gICAgICAgICAgICBpZiAoY29weSA+IGluSGVhZGVyLT5uRmlsbGVkTGVuKSB7Ci0gICAgICAgICAgICAgICAgY29weSA9IGluSGVhZGVyLT5uRmlsbGVkTGVuOwotICAgICAgICAgICAgfQotCi0gICAgICAgICAgICBpZiAobUlucHV0RnJhbWUgPT0gTlVMTCkgewotICAgICAgICAgICAgICAgIG1JbnB1dEZyYW1lID0gbmV3IGludDE2X3Rba051bVNhbXBsZXNQZXJGcmFtZSAqIG1OdW1DaGFubmVsc107Ci0gICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgIGlmIChtSW5wdXRTaXplID09IDApIHsKLSAgICAgICAgICAgICAgICBtSW5wdXRUaW1lVXMgPSBpbkhlYWRlci0+blRpbWVTdGFtcDsKLSAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgbWVtY3B5KCh1aW50OF90ICopbUlucHV0RnJhbWUgKyBtSW5wdXRTaXplLCBpbkRhdGEsIGNvcHkpOwotICAgICAgICAgICAgbUlucHV0U2l6ZSArPSBjb3B5OwotCi0gICAgICAgICAgICBpbkhlYWRlci0+bk9mZnNldCArPSBjb3B5OwotICAgICAgICAgICAgaW5IZWFkZXItPm5GaWxsZWRMZW4gLT0gY29weTsKLQotICAgICAgICAgICAgLy8gIlRpbWUiIG9uIHRoZSBpbnB1dCBidWZmZXIgaGFzIGluIGVmZmVjdCBhZHZhbmNlZCBieSB0aGUKLSAgICAgICAgICAgIC8vIG51bWJlciBvZiBhdWRpbyBmcmFtZXMgd2UganVzdCBhZHZhbmNlZCBuT2Zmc2V0IGJ5LgotICAgICAgICAgICAgaW5IZWFkZXItPm5UaW1lU3RhbXAgKz0KLSAgICAgICAgICAgICAgICAoY29weSAqIDEwMDAwMDBsbCAvIG1TYW1wbGVSYXRlKQotICAgICAgICAgICAgICAgICAgICAvIChtTnVtQ2hhbm5lbHMgKiBzaXplb2YoaW50MTZfdCkpOwotCi0gICAgICAgICAgICBpZiAoaW5IZWFkZXItPm5GaWxsZWRMZW4gPT0gMCkgewotICAgICAgICAgICAgICAgIGlmIChpbkhlYWRlci0+bkZsYWdzICYgT01YX0JVRkZFUkZMQUdfRU9TKSB7Ci0gICAgICAgICAgICAgICAgICAgIEFMT0dWKCJzYXcgaW5wdXQgRU9TIik7Ci0gICAgICAgICAgICAgICAgICAgIG1TYXdJbnB1dEVPUyA9IHRydWU7Ci0KLSAgICAgICAgICAgICAgICAgICAgLy8gUGFkIGFueSByZW1haW5pbmcgZGF0YSB3aXRoIHplcm9lcy4KLSAgICAgICAgICAgICAgICAgICAgbWVtc2V0KCh1aW50OF90ICopbUlucHV0RnJhbWUgKyBtSW5wdXRTaXplLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgMCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgIG51bUJ5dGVzUGVySW5wdXRGcmFtZSAtIG1JbnB1dFNpemUpOwotCi0gICAgICAgICAgICAgICAgICAgIG1JbnB1d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c3VsdF0iPXIiKHJlc3VsdCkKLQkJOltMX3ZhcjFdInIiKExfdmFyMSksIFt2YXIyXSJyIih2YXIyKQotCQkpOwotCXJldHVybiByZXN1bHQ7Ci0jZWxzZQotCVdvcmQzMiByZXN1bHQ7Ci0JV29yZDMyIHRtcDsKLQlhc20gKAotCQkiQ01QCSVbdmFyMl0sICMxNlxuIgotCQkiTU9WTFQgICVbcmVzdWx0XSwgJVtMX3ZhcjFdLCBBU0wgJVt2YXIyXVxuIgotCQkiTU9WR0UgICVbcmVzdWx0XSwgJVtMX3ZhcjFdLCBBU0wgIzE2XG4iCi0gICAgICAgICJNT1YgICAgJVt0bXBdLCAlW3Jlc3VsdF0sIEFTUiAjMTVcbiIKLSAgICAgICAgIlRFUSAgICAlW3RtcF0sICVbcmVzdWx0XSwgQVNSICMzMSBcbiIKLSAgICAgICAgIkVPUk5FICAlW3Jlc3VsdF0sICVbbWFza10sICVbcmVzdWx0XSxBU1IgIzMxIgotCQk6W3Jlc3VsdF0iPSZyIihyZXN1bHQpLCBbdG1wXSI9JnIiKHRtcCkKLQkJOltMX3ZhcjFdInIiKExfdmFyMSksIFt2YXIyXSJyIih2YXIyKSwgW21hc2tdInIiKDB4N2ZmZikKLQkJKTsKLQlyZXR1cm4gcmVzdWx0OwotI2VuZGlmCi19Ci0jZW5kaWYKLQotLypfX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX18KLSB8ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfAotIHwgICBkZWZpbml0aW9ucyBmb3IgaW5saW5lIGJhc2ljIGFyaXRobWV0aWMgb3BlcmF0b3JzICAgICAgICAgICAgICAgICAgICAgICB8Ci0gfF9fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX3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AgICAgfQotICAgIH0KLSAgICByZXR1cm4gKHZhcl9vdXQpOwotI2VuZGlmCi19Ci0jZW5kaWYKLQotLyogU2hvcnQgc2hpZnQgcmlnaHQsICAgMSAgICovCi0jaWYgKFNIUl9JU19JTkxJTkUpCi1fX2lubGluZSBXb3JkMTYgc2hyIChXb3JkMTYgdmFyMSwgV29yZDE2IHZhcjIpCi17Ci0jaWYgQVJNVjVURV9TSFIKLQlpZih2YXIyPj0wKQotCXsKLQkJcmV0dXJuICBBU01fc2hyKCB2YXIxLCB2YXIyKTsKLQl9Ci0JZWxzZQotCXsKLQkJcmV0dXJuICBBU01fc2hsKCB2YXIxLCAtdmFyMik7Ci0JfQotI2Vsc2UKLSAgICBXb3JkMTYgdmFyX291dDsKLQotICAgIGlmICh2YXIyIDwgMCkKLSAgICB7Ci0gICAgICAgIHZhcl9vdXQgPSBzaGwgKHZhcjEsIChXb3JkMTYpLXZhcjIpOwotICAgIH0KLSAgICBlbHNlCi0gICAgewotICAgICAgICBpZiAodmFyMiA+PSAxNSkKLSAgICAgICAgewotICAgICAgICAgICAgdmFyX291dCA9IChXb3JkMTYpKCh2YXIxIDwgMCkgPyAtMSA6IDApOwotICAgICAgICB9Ci0gICAgICAgIGVsc2UKLSAgICAgICAgewotICAgICAgICAgICAgaWYgKHZhcjEgPCAwKQotICAgICAgICAgICAgewotICAgICAgICAgICAgICAgIHZhcl9vdXQgPSAoV29yZDE2KSh+KCh+dmFyMSkgPj4gdmFyMikpOwotICAgICAgICAgICAgfQotICAgICAgICAgICAgZWxzZQotICAgICAgICAgICAgewotICAgICAgICAgICAgICAgIHZhcl9vdXQgPSAoV29yZDE2KSh2YXIxID4+IHZhcjIpOwotICAgICAgICAgICAgfQotICAgICAgICB9Ci0gICAgfQotCi0gICAgcmV0dXJuICh2YXJfb3V0KTsKLSNlbmRpZgotfQotI2VuZGlmCi0KLQotI2lmIChMX01VTFRfSVNfSU5MSU5FKQotX19pbmxpbmUgV29yZDMyIExfbXVsdChXb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JkMTYgdmFyMikKLXsKLSNpZiBBUk1WNVRFX0xfU0hMCi0gICAgaWYodmFyMj49MCkKLSAgICB7Ci0gICAgICAgIHJldHVybiAgQVNNX0xfc2hsKCBMX3ZhcjEsIHZhcjIpOwotICAgIH0KLSAgICBlbHNlCi0gICAgewotICAgICAgICByZXR1cm4gIEFTTV9MX3NociggTF92YXIxLCAtdmFyMik7Ci0gICAgfQotI2Vsc2UKLSAgICBXb3JkMzIgTF92YXJfb3V0ID0gMEw7Ci0KLSAgICBpZiAodmFyMiA8PSAwKQotICAgIHsKLSAgICAgICAgTF92YXIxID0gTF9zaHIoTF92YXIxLCAoV29yZDE2KS12YXIyKTsKLSAgICB9Ci0gICAgZWxzZQotICAgIHsKLSAgICAgICAgZm9yICg7IHZhcjIgPiAwOyB2YXIyLS0pCi0gICAgICAgIHsKLSAgICAgICAgICAgIGlmIChMX3ZhcjEgPiAoV29yZDMyKSAwWDNmZmZmZmZmTCkKLSAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICByZXR1cm4gTUFYXzMyOwotICAgICAgICAgICAgfQotICAgICAgICAgICAgZWxzZQotICAgICAgICAgICAgewotICAgICAgICAgICAgICAgIGlmIChMX3ZhcjEgPCAoV29yZDMyKSAweGMwMDAwMDAwTCkKLSAgICAgICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgICAgIHJldHVybiBNSU5fMzI7Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgfQotICAgICAgICAgICAgTF92YXIxIDw8PSAxOwotICAgICAgICAgICAgTF92YXJfb3V0ID0gTF92YXIxOwotICAgICAgICB9Ci0gICAgfQotICAgIHJldHVybiAoTF92YXIxKTsKLSNlbmRpZgotfQotI2VuZGlmCi0KLSNpZiAoTF9TSFJfSVNfSU5MSU5FKQotX19pbmxpbmUgV29yZDMyIExfc2hyIChXb3JkMzIgTF92YXIxLCBXb3JkMTYgdmFyMikKLXsKLSNpZiBBUk1WNVRFX0xfU0hSCi0JaWYodmFyMj49MCkKLQl7Ci0JCXJldHVybiBBU01fTF9zaHIoIExfdmFyMSwgdmFyMik7Ci0JfQotCWVsc2UKLQl7Ci0JCXJldHVybiBBU01fTF9zaGwoIExfdmFyMSwgLXZhcjIpOwotCX0KLSNlbHNlCi0gICAgV29yZDMyIExfdmFyX291dDsKLQotICAgIGlmICh2YXIyIDwgMCkKLSAgICB7Ci0gICAgICAgIExfdmFyX291dCA9IExfc2hsIChMX3ZhcjEsIChXb3JkMTYpLXZhcjIpOwotICAgIH0KLSAgICBlbHNlCi0gICAgewotICAgICAgICBpZiAodmFyMiA+PSAzMSkKLSAgICAgICAgewotICAgICAgICAgICAgTF92YXJfb3V0ID0gKExfdmFyMSA8IDBMKSA/IC0xIDogMDsKLSAgICAgICAgfQotICAgICAgICBlbHNlCi0gICAgICAgIHsKLSAgICAgICAgICAgIGlmIChMX3ZhcjEgPCAwKQotICAgICAgICAgICAgewotICAgICAgICAgICAgICAgIExfdmFyX291dCA9IH4oKH5MX3ZhcjEpID4+IHZhcjIpOwotICAgICAgICAgICAgfQotICAgICAgICAgICAgZWxzZQotICAgICAgICAgICAgewotICAgICAgICAgICAgICAgIExfdmFyX291dCA9IExfdmFyMSA+PiB2YXIyOwotICAgICAgICAgICAgfQotICAgICAgICB9Ci0gICAgfQotICAgIHJldHVybiAoTF92YXJfb3V0KTsKLSNlbmRpZgotfQotI2VuZGlmCi0KLS8qIFNob3J0IGFkZCwgICAgICAgICAgIDEgICAqLwotI2lmIChBRERfSVNfSU5MSU5FKQotX19pbmxpbmUgV29yZDE2IGFkZCAoV29yZDE2IHZhcjEsIFdvcmQxNiB2YXIyKQotewotI2lmIEFSTVY1VEVfQURECi0JV29yZDMyIHJlc3VsdDsKLQlXb3JkMzIgdG1wOwotCWFzbSAoCi0JCSJBREQgICVbcmVzdWx0XSwgJVt2YXIxXSwgJVt2YXIyXSBcbiIKLQkJIk1PViAgJVt0bXBdLCAlW3Jlc3VsdF0sIEFTUiAjMTUgXG4iCi0JCSJUR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AgIC8vewotICAgIC8vICAgIGlmIChMX3ZhcjEgPT0gKFdvcmQzMikgMHhmZmZmZmZmZkwpCi0gICAgLy8gICAgewotICAgIC8vICAgICAgICB2YXJfb3V0ID0gMzE7Ci0gICAgLy8gICAgfQotICAgIC8vICAgIGVsc2UKLSAgICAvLyAgICB7Ci0gICAgLy8gICAgICAgIGlmIChMX3ZhcjEgPCAwKQotICAgIC8vICAgICAgICB7Ci0gICAgLy8gICAgICAgICAgICBMX3ZhcjEgPSB+TF92YXIxOwotICAgIC8vICAgICAgICB9Ci0gICAgLy8gICAgICAgIGZvciAodmFyX291dCA9IDA7IExfdmFyMSA8IChXb3JkMzIpIDB4NDAwMDAwMDBMOyB2YXJfb3V0KyspCi0gICAgLy8gICAgICAgIHsKLSAgICAvLyAgICAgICAgICAgIExfdmFyMSA8PD0gMTsKLSAgICAvLyAgICAgICAgfQotICAgIC8vICAgIH0KLSAgICAvL30KLSAgICAvL3JldHVybiAodmFyX291dCk7Ci0gIFdvcmQxNiBhMTY7Ci0gIFdvcmQxNiByID0gMCA7Ci0KLQotICBpZiAoIExfdmFyMSA8IDAgKSB7Ci0gICAgTF92YXIxID0gfkxfdmFyMTsKLSAgfQotCi0gIGlmICgwID09IChMX3ZhcjEgJiAweDdmZmY4MDAwKSkgewotICAgIGExNiA9IGV4dHJhY3RfbChMX3ZhcjEpOwotICAgIHIgKz0gMTY7Ci0KLSAgICBpZiAoMCA9PSAoYTE2ICYgMHg3ZjgwKSkgewotICAgICAgciArPSA4OwotCi0gICAgICBpZiAoMCA9PSAoYTE2ICYgMHgwMDc4KSkgewotICAgICAgICByICs9IDQ7Ci0KLSAgICAgICAgaWYgKDAgPT0gKGExNiAmIDB4MDAwNikpIHsKLSAgICAgICAgICByICs9IDI7Ci0KLSAgICAgICAgICBpZiAoMCA9PSAoYTE2ICYgMHgwMDAxKSkgewotICAgICAgICAgICAgciArPSAxOwotICAgICAgICAgIH0KLSAgICAgICAgfQotICAgICAgICBlbHNlIHsKLQotICAgICAgICAgIGlmICgwID09IChhMTYgJiAweDAwMDQpKSB7Ci0gICAgICAgICAgICByICs9IDE7Ci0gICAgICAgICAgfQotICAgICAgICB9Ci0gICAgICB9Ci0gICAgICBlbHNlIHsKLQotICAgICAgICBpZiAoMCA9PSAoYTE2ICYgMHgwMDYwKSkgewotICAgICAgICAgIHIgKz0gMjsKLQotICAgICAgICAgIGlmICgwID09IChhMTYgJiAweDAwMTApKSB7Ci0gICAgICAgICAgICByICs9IDE7Ci0gICAgICAgICAgfQotICAgICAgICB9Ci0gICAgICAgIGVsc2UgewotCi0gICAgICAgICAgaWYgKDAgPT0gKGExNiAmIDB4MDA0MCkpIHsKLSAgICAgICAgICAgIHIgKz0gMTsKLSAgICAgICAgICB9Ci0gICAgICAgIH0KLSAgICAgIH0KLSAgICB9Ci0gICAgZWxzZSB7Ci0KLSAgICAgIGlmICgwID09IChhMTYgJiAweDc4MDApKSB7Ci0gICAgICAgIHIgKz0gNDsKLQotICAgICAgICBpZiAoMCA9PSAoYTE2ICYgMHgwNjAwKSkgewotICAgICAgICAgIHIgKz0gMjsKLQotICAgICAgICAgIGlmICgwID09IChhMTYgJiAweDAxMDApKSB7Ci0gICAgICAgICAgICByICs9IDE7Ci0gICAgICAgICAgfQotICAgICAgICB9Ci0gICAgICAgIGVsc2UgewotCi0gICAgICAgICAgaWYgKDAgPT0gKGExNiAmIDB4MDQwMCkpIHsKLSAgICAgICAgICAgIHIgKz0gMTsKLSAgICAgICAgICB9Ci0gICAgICAgIH0KLSAgICAgIH0KLSAgICAgIGVsc2UgewotCi0gICAgICAgIGlmICgwID09IChhMTYgJiAweDYwMDApKSB7Ci0gICAgICAgICAgciArPSAyOwotCi0gICAgICAgICAgaWYgKDAgPT0gKGExNiAmIDB4MTAwMCkpIHsKLSAgICAgICAgICAgIHIgKz0gMTsKLSAgICAgICAgICB9Ci0gICAgICAgIH0KLSAgICAgICAgZWxzZSB7Ci0KLSAgICAgICAgICBpZiAoMCA9PSAoYTE2ICYgMHg0MDAwKSkgewotICAgICAgICAgICAgciArPSAxOwotICAgICAgICAgIH0KLSAgICAgICAgfQotICAgICAgfQotICAgIH0KLSAgfQotICBlbHNlIHsKLSAgICBhMTYgPSBleHRyYWN0X2goTF92YXIxKTsKLQotICAgIGlmICgwID09IChhMTYgJiAweDdmODApKSB7Ci0gICAgICByICs9IDg7Ci0KLSAgICAgIGlmICgwID09IChhMTYgJiAweDAwNzgpKSB7Ci0gICAgICAgIHIgKz0gNCA7Ci0KLSAgICAgICAgaWYgKDAgPT0gKGExNiAmIDB4MDAwNikpIHsKLSAgICAgICAgICByICs9IDI7Ci0KLSAgICAgICAgICBpZiAoMCA9PSAoYTE2ICYgMHgwMDAxKSkgewotICAgICAgICAgICAgciArPSAxOwotICAgICAgICAgIH0KLSAgICAgICAgfQotICAgICAgICBlbHNlIHsKLQotICAgICAgICAgIGlmICgwID09IChhMTYgJiAweDAwMDQpKSB7Ci0gICAgICAgICAgICByICs9IDE7Ci0gICAgICAgICAgfQotICAgICAgICB9Ci0gICAgICB9Ci0gICAgICBlbHNlIHsKLQotICAgICAgICBpZiAoMCA9PSAoYTE2ICYgMHgwMDYwKSkgewotICAgICAgICAgIHIgKz0gMjsKLQotICAgICAgICAgIGlmICgwID09IChhMTYgJiAweDAwMTApKSB7Ci0gICAgICAgICAgICByICs9IDE7Ci0gICAgICAgICAgfQotICAgICAgICB9Ci0gICAgICAgIGVsc2UgewotCi0gICAgICAgICAgaWYgKDAgPT0gKGExNiAmIDB4MDA0MCkpIHsKLSAgICAgICAgICAgIHIgKz0gMTsKLSAgICAgICAgICB9Ci0gICAgICAgIH0KLSAgICAgIH0KLSAgICB9Ci0gICAgZWxzZSB7Ci0KLSAgICAgIGlmICgwID09IChhMTYgJiAweDc4MDApKSB7Ci0gICAgICAgIHIgKz0gNDsKLQotICAgICAgICBpZiAoMCA9PSAoYTE2ICYgMHgwNjAwKSkgewotICAgICAgICAgIHIgKz0gMjsKLQotICAgICAgICAgIGlmICgwID09IChhMTYgJiAweDAxMDApKSB7Ci0gICAgICAgICAgICByICs9IDE7Ci0gICAgICAgICAgfQotICAgICAgICB9Ci0gICAgICAgIGVsc2UgewotCi0gICAgICAgICAgaWYgKDAgPT0gKGExNiAmIDB4MDQwMCkpIHsKLSAgICAgICAgICAgIHIgKz0gMTsKLSAgICAgICAgICB9Ci0gICAgICAgIH0KLSAgICAgIH0KLSAgICAgIGVsc2UgewotCi0gICAgICAgIGlmICgwID09IChhMTYgJiAweDYwMDApKSB7Ci0gICAgICAgICAgciArPSAyOwotCi0gICAgICAgICAgaWYgKDAgPT0gKGExNiAmIDB4MTAwMCkpIHsKLSAgICAgICAgICAgIHIgKz0gMTsKLSAgICAgICAgICB9Ci0gICAgICAgIH0KLSAgICAgICAgZWxzZSB7Ci0KLSAgICAgICAgICBpZiAoMCA9PSAoYTE2ICYgMHg0MDAwKSkgewotICAgICAgICAgICAgcmV0dXJuIDE7Ci0gICAgICAgICAgfQotICAgICAgICB9Ci0gICAgICB9Ci0gICAgfQotICB9Ci0KLSAgcmV0dXJuIHIgOwotI2VuZGlmCi19Ci0jZW5kaWYKLQotLyogUm91bmQsICAgICAgICAgICAgICAgMSAgICovCi0jaWYgKFJPVU5EX0lTX0lOTElORSkKLV9faW5saW5lIFdvcmQxNiByb3VuZDE2KFdvcmQzMiBMX3ZhcjEpCi17Ci0jaWYgQVJNVjVURV9ST1VORAotCVdvcmQxNiByZXN1bHQ7Ci0JYXNtICgKLQkJIlFBREQgICVbcmVzdWx0XSwgJVtMX3ZhcjFdLCAlW2JpYXNdXG4iCi0JCSJNT1YgICAlW3Jlc3VsdF0sICVbcmVzdWx0XSwgQVNSICMxNiBcbiIKLQkJOltyZXN1bHRdIj1yIihyZXN1bHQpCi0JCTpbTF92YXIxXSJyIihMX3ZhcjEpLCBbYmlhc10iciIoMHg4MDAwKQotCQkpOwotCXJldHVybiByZXN1bHQ7Ci0jZWxzZQotICAgIFdvcmQxNiB2YXJfb3V0OwotICAgIFdvc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X0lTX0lOTElORSkKLV9faW5saW5lIFdvcmQxNiBzaHJfciAoV29yZDE2IHZhcjEsIFdvcmQxNiB2YXIyKQotewotICAgIFdvcmQxNiB2YXJfb3V0OwotCi0gICAgaWYgKHZhcjIgPiAxNSkKLSAgICB7Ci0gICAgICAgIHZhcl9vdXQgPSAwOwotICAgIH0KLSAgICBlbHNlCi0gICAgewotICAgICAgICB2YXJfb3V0ID0gc2hyKHZhcjEsIHZhcjIpOwotCi0gICAgICAgIGlmICh2YXIyID4gMCkKLSAgICAgICAgewotICAgICAgICAgICAgaWYgKCh2YXIxICYgKChXb3JkMTYpIDEgPDwgKHZhcjIgLSAxKSkpICE9IDApCi0gICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgdmFyX291dCsrOwotICAgICAgICAgICAgfQotICAgICAgICB9Ci0gICAgfQotCi0gICAgcmV0dXJuICh2YXJfb3V0KTsKLX0KLSNlbmRpZgotCi0jaWYgKE1BQ19SX0lTX0lOTElORSkKLV9faW5saW5lIFdvcmQxNiBtYWNfciAoV29yZDMyIExfdmFyMywgV29yZDE2IHZhcjEsIFdvcmQxNiB2YXIyKQotewotICAgIFdvcmQxNiB2YXJfb3V0OwotCi0gICAgTF92YXIzID0gTF9tYWMgKExfdmFyMywgdmFyMSwgdmFyMik7Ci0gICAgdmFyX291dCA9IChXb3JkMTYpKChMX3ZhcjMgKyAweDgwMDBMKSA+PiAxNik7Ci0KLSAgICByZXR1cm4gKHZhcl9vdXQpOwotfQotI2VuZGlmCi0KLSNpZiAoTVNVX1JfSVNfSU5MSU5FKQotX19pbmxpbmUgV29yZDE2IG1zdV9yIChXb3JkMzIgTF92YXIzLCBXb3JkMTYgdmFyMSwgV29yZDE2IHZhcjIpCi17Ci0gICAgV29yZDE2IHZhcl9vdXQ7Ci0KLSAgICBMX3ZhcjMgPSBMX21zdSAoTF92YXIzLCB2YXIxLCB2YXIyKTsKLSAgICB2YXJfb3V0ID0gKFdvcmQxNikoKExfdmFyMyArIDB4ODA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GxpbWl0YXRpb25zIHVuZGVyIHRoZSBMaWNlbnNlLgotICovCi0vKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgotCUZpbGU6CQliYXNpY29wMi5jCi0KLQlDb250ZW50OglCYXNpYyBhcml0aG1ldGljIG9wZXJhdG9ycy4KLQotKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLQotI2luY2x1ZGUgInR5cGVkZWYuaCIKLSNpbmNsdWRlICJiYXNpY19vcC5oIgotCi0KLS8qX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fCi0gfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwKLSB8ICAgRnVuY3Rpb25zICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfAotIHxfX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX198Ci0qLwotCi0vKl9fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fXwotIHwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8Ci0gfCAgIEZ1bmN0aW9uIE5hbWUgOiBzYXR1cmF0ZSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwKLSB8ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfAotIHwgICBQdXJwb3NlIDogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8Ci0gfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwKLSB8ICAgIExpbWl0IHRoZSAzMiBiaXQgaW5wdXQgdG8gdGhlIHJhbmdlIG9mIGEgMTYgYml0IHdvcmQuICAgICAgICAgICAgICAgICAgfAotIHwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8Ci0gfCAgIElucHV0cyA6ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwKLSB8ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfAotIHwgICAgTF92YXIxICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8Ci0gfCAgICAgICAgICAgICAzMiBiaXQgbG9uZyBzaWduZWQgaW50ZWdlciAoV29yZDMyKSB3aG9zZSB2YWx1ZSBmYWxscyBpbiB0aGUgIHwKLSB8ICAgICAgICAgICAgIHJhbmdlIDogMHg4MDAwIDAwMDAgPD0gTF92YXIxIDw9IDB4N2ZmZiBmZmZmLiAgICAgICAgICAgICAgICAgfAotIHwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8Ci0gfCAgIE91dHB1dHMgOiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwKLSB8ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfAotIHwgICAgbm9uZSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8Ci0gfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwKLSB8ICAgUmV0dXJuIFZhbHVlIDogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfAotIHwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8Ci0gfCAgICB2YXJfb3V0ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwKLSB8ICAgICAgICAgICAgIDE2IGJpdCBzaG9ydCBzaWduZWQgaW50ZWdlciAoV29yZDE2KSB3aG9zZSB2YWx1ZSBmYWxscyBpbiB0aGUgfAotIHwgICAgICAgICAgICAgcmFuZ2UgOiAweGZmZmYgODAwMCA8PSB2YXJfb3V0IDw9IDB4MDAwMCA3ZmZmLiAgICAgICAgICAgICAgICB8Ci0gfF9fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX3wKLSovCi0KLSNpZiAoIVNBVFJVQVRFX0lTX0lOTElORSkKLVdvcmQxNiBzYXR1cmF0ZShXb3JkMzIgTF92YXIxKQotewotICAgIFdvcmQxNiB2YXJfb3V0OwotCi0gICAgaWYgKExfdmFyMSA+IDBYMDAwMDdmZmZMKQotICAgIHsKLSAgICAgICAgdmFyX291dCA9IE1BWF8xNjsKLSAgICB9Ci0gICAgZWxzZSBpZiAoTF92YXIxIDwgKFdvcmQzMikgMHhmZmZmODAwMEwpCi0gICAgewotICAgICAgICB2YXJfb3V0ID0gTUlOXzE2OwotICAgIH0KLSAgICBlbHNlCi0gICAgewotICAgICAgICB2YXJfb3V0ID0gZXh0cmFjdF9sKExfdmFyMSk7Ci0gICAgfQotCi0gICAgcmV0dXJuICh2YXJfb3V0KTsKLX0KLSNlbmRpZgotCi0vKl9fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fXwotIHwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8Ci0gfCAgIEZ1bmN0aW9uIE5hbWUgOiBhZGQgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwKLSB8ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfAotIHwgICBQdXJwb3NlIDogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8Ci0gfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwKLSB8ICAgIFBlcmZvcm1zIHRoZSBhZGRpdGlvbiAodmFyMSt2YXIyKSB3aXRoIG92ZXJmbG93IGNvbnRyb2wgYW5kIHNhdHVyYXRpb247fAotIHwgICAgdGhlIDE2IGJpdCByZXN1bHQgaXMgc2V0IGF0ICszMjc2NyB3aGVuIG92ZXJmbG93IG9jY3VycyBvciBhdCAtMzI3NjggICB8Ci0gfCAgICB3aGVuIHVuZGVyZmxvdyBvY2N1cnMuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwKLSB8ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfAotIHwgICBDb21wbGV4aXR5IHdlaWdodCA6IDEgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8Ci0gfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwKLSB8ICAgSW5wdXRzIDogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfAotIHwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8Ci0gfCAgICB2YXIxICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwKLSB8ICAgICAgICAgICAgIDE2IGJpdCBzaG9ydCBzaWduZWQgaW50ZWdlciAoV29yZDE2KSB3aG9zZSB2YWx1ZSBmYWxscyBpbiB0aGUgfAotIHwgICAgICAgICAgICAgcmFuZ2UgOiAweGZmZmYgODAwMCA8PSB2YXIxIDw9IDB4MDAwMCA3ZmZmLiAgICAgICAgICAgICAgICAgICB8Ci0gfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwKLSB8ICAgIHZhcjIgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfAotIHwgICAgICAgICAgICAgMTYgYml0IHNob3J0IHNpZ25lZCBpbnRlZ2VyIChXb3JkMTYpIHdob3NlIHZhbHVlIGZhbGxzIGluIHRoZSB8Ci0gfCAgICAgICAgICAgICByYW5nZSA6IDB4ZmZmZiA4MDAwIDw9IHZhcjEgPD0gMHgwMDAwIDdmZmYuICAgICAgICAgICAgICAgICAgIHwKLSB8ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfAotIHwgICBPdXRwdXRzIDogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8Ci0gfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwKLSB8ICAgIG5vbmUgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfAotIHwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8Ci0gfCAgIFJldHVybiBWYWx1ZSA6ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwKLSB8ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfAotIHwgICAgdmFyX291dCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8Ci0gfCAgICAgICAgICAgICAxNiBiaXQgc2hvcnQgc2lnbmVkIGludGVnZXIgKFdvcmQxNikgd2hvc2UgdmFsdWUgZmFsbHMgaW4gdGhlIHwKLSB8ICAgICAgICAgICAgIHJhbmdlIDogMHhmZmZmIDgwMDAgPD0gdmFyX291dCA8PSAweDAwMDAgN2ZmZi4gICAgICAgICAgICAgICAgfAotIHxfX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX198Ci0qLwotCi0jaWYgKCFBRERfSVNfSU5MSU5FKQotV29yZDE2IGFkZCAoV29yZDE2IHZhcjEsIFdvcmQxNiB2YXIyKQotewotICAgIFdvcmQxNiB2YXJfb3V0OwotICAgIFdvcmQzMiBMX3N1bTsKLQotICAgIExfc3VtID0gKFdvcmQzMil2YXIxICsgKFdvcmQzMil2YXIyOwotICAgIHZhcl9vdXQgPSBzYXR1cmF0ZShMX3N1bSk7Ci0KLSAgICByZXR1cm4gKHZhcl9vdXQpOwotfQotI2VuZGlmCi0KLS8qX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fCi0gfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwKLSB8ICAgRnVuY3Rpb24gTmFtZSA6IHN1YiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfAotIHwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8Ci0gfCAgIFB1cnBvc2UgOiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwKLSB8ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfAotIHwgICAgUGVyZm9ybXMgdGhlIHN1YnRyYWN0aW9uICh2YXIxK3ZhcjIpIHdpdGggb3ZlcmZsb3cgY29udHJvbCBhbmQgc2F0dS0gICB8Ci0gfCAgICByYXRpb247IHRoZSAxNiBiaXQgcmVzdWx0IGlzIHNldCBhdCArMzI3Njcgd2hlbiBvdmVyZmxvdyBvY2N1cnMgb3IgYXQgIHwKLSB8ICAgIC0zMjc2OCB3aGVuIHVuZGVyZmxvdyBvY2N1cnMuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfAotIHwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8Ci0gfCAgIENvbXBsZXhpdHkgd2VpZ2h0IDogMSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwKLSB8ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfAotIHwgICBJbnB1dHMgOiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8Ci0gfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwKLSB8ICAgIHZhcjEgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfAotIHwgICAgICAgICAgICAgMTYgYml0IHNob3J0IHNpZ25lZCBpbnRlZ2VyIChXb3JkMTYpIHdob3NlIHZhbHVlIGZhbGxzIGluIHRoZSB8Ci0gfCAgICAgICAgICAgICByYW5nZSA6IDB4ZmZmZiA4MDAwIDw9IHZhcjEgPD0gMHgwMDAwIDdmZmYuICAgICAgICAgICAgICAgICAgIHwKLSB8ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfAotIHwgICAgdmFyMiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8Ci0gfCAgICAgICAgICAgICAxNiBiaXQgc2hvcnQgc2lnbmVkIGludGVnZXIgKFdvcmQxNikgd2hvc2UgdmFsdWUgZmFsbHMgaW4gdGhlIHwKLSB8ICAgICAgICAgICAgIHJhbmdlIDogMHhmZmZmIDgwMDAgPD0gdmFyMSA8PSAweDAwMDAgN2ZmZi4gICAgICAgICAgICAgICAgICAgfAotIHwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8Ci0gfCAgIE91dHB1dHMgOiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwKLSB8ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfAotIHwgICAgbm9uZSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8Ci0gfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwKLSB8ICAgUmV0dXJuIFZhbHVlIDogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfAotIHwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8Ci0gfCAgICB2YXJfb3V0ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwKLSB8ICAgICAgICAgICAgIDE2IGJpdCBzaG9ydCBzaWduZWQgaW50ZWdlciAoV29yZDE2KSB3aG9zZSB2YWx1ZSBmYWxscyBpbiB0aGUgfAotIHwgICAgICAgICAgICAgcmFuZ2UgOiAweGZmZmYgODAwMCA8PSB2YXJfb3V0IDw9IDB4MDAwMCA3ZmZmLiAgICAgICAgICAgICAgICB8Ci0gfF9fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX3wKLSovCi0jaWYgKCFTVUJfSVNfSU5MSU5FKQotV29yZDE2IHN1YihXb3JkMTYgdmFyMSwgV29yZDE2IHZhcjIpCi17Ci0gICAgV29yZDE2IHZhcl9vdXQ7Ci0gICAgV29yZDMyIExfZGlmZjsKLQotICAgIExfZGlmZiA9IChXb3JkMzIpIHZhcjEgLSB2YXIyOwotICAgIHZhcl9vdXQgPSBzYXR1cmF0ZShMX2RpZmYpOwotCi0gICAgcmV0dXJuICh2YXJfb3V0KTsKLX0KLSNlbmRpZgotCi0vKl9fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fXwotIHwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8Ci0gfCAgIEZ1bmN0aW9uIE5hbWUgOiBhYnNfcyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwKLSB8ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfAotIHwgICBQdXJwb3NlIDogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8Ci0gfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwKLSB8ICAgIEFic29sdXRlIHZhbHVlIG9mIHZhcjE7IGFic19zKC0zMjc2OCkgPSAzMjc2Ny4gICAgICAgICAgICAgICAgICAgICAgICAgfAotIHwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8Ci0gfCAgIENvbXBsZXhpdHkgd2VpZ2h0IDogMSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwKLSB8ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfAotIHwgICBJbnB1dHMgOiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8Ci0gfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwKLSB8ICAgIHZhcjEgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfAotIHwgICAgICAgICAgICAgMTYgYml0IHNob3J0IHNpZ25lZCBpbnRlZ2VyIChXb3JkMTYpIHdob3NlIHZhbHVlIGZhbGxzIGluIHRoZSB8Ci0gfCAgICAgICAgICAgICByYW5nZSA6IDB4ZmZmZiA4MDAwIDw9IHZhcjEgPD0gMHgwMDAwIDdmZmYuICAgICAgICAgICAgICAgICAgIHwKLSB8ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfAotIHwgICBPdXRwdXRzIDogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8Ci0gfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwKLSB8ICAgIG5vbmUgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfAotIHwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8Ci0gfCAgIFJldHVybiBWYWx1ZSA6ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwKLSB8ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfAotIHwgICAgdmFyX291dCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8Ci0gfCAgICAgICAgICAgICAxNiBiaXQgc2hvcnQgc2lnbmVkIGludGVnZXIgKFdvcmQxNikgd2hvc2UgdmFsdWUgZmFsbHMgaW4gdGhlIHwKLSB8ICAgICAgICAgICAgIHJhbmdlIDogMHgwMDAwIDAwMDAgPD0gdmFyX291dCA8PSAweDAwMDAgN2ZmZi4gICAgICAgICAgICAgICAgfAotIHxfX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX198Ci0qLwotLy9Xb3JkMTYgYWJzX3MgKFdvcmQxNiB2YXIxKQotLy97Ci0vLyAgICBXb3JkMTYgdmFyX291dDsKLS8vCi0vLyAgICBpZiAodmFyMSA9PSBNSU5fMTYpCi0vLyAgICB7Ci0vLyAgICAgICAgdmFyX291dCA9IE1BWF8xNjsKLS8vICAgIH0KLS8vICAgIGVsc2UKLS8vICAgIHsKLS8vICAgICAgICBpZiAodmFyMSA8IDApCi0vLyAgICAgICAgewotLy8gICAgICAgICAgICB2YXJfb3V0ID0gKFdvcmQxNiktdmFyMTsKLS8vICAgICAgICB9Ci0vLyAgICAgICAgZWxzZQotLy8gICAgICAgIHsKLS8vICAgICAgICAgICAgdmFyX291dCA9IHZhcjE7Ci0vLyAgICAgICAgfQotLy8gICAgfQotLy8KLS8vICAgIHJldHVybiAodmFyX291dCk7Ci0vL30KLQotCi0vKl9fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fXwotIHwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8Ci0gfCAgIEZ1bmN0aW9uIE5hbWUgOiBzaGwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwKLSB8ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfAotIHwgICBQdXJwb3NlIDogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8Ci0gfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwKLSB8ICAgQXJpdGhtZXRpY2FsbHkgc2hpZnQgdGhlIDE2IGJpdCBpbnB1dCB2YXIxIGxlZnQgdmFyMiBwb3NpdGlvbnMuWmVybyBmaWxsfAotIHwgICB0aGUgdmFyMiBMU0Igb2YgdGhlIHJlc3VsdC4gSWYgdmFyMiBpcyBuZWdhdGl2ZSwgYXJpdGhtZXRpY2FsbHkgc2hpZnQgICB8Ci0gfCAgIHZhcjEgcmlnaHQgYnkgLXZhcjIgd2l0aCBzaWduIGV4dGVuc2lvbi4gU2F0dXJhdGUgdGhlIHJlc3VsdCBpbiBjYXNlIG9mIHwKLSB8ICAgdW5kZXJmbG93cyBvciBvdmVyZmxvd3MuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfAotIHwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8Ci0gfCAgIENvbXBsZXhpdHkgd2VpZ2h0IDogMSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwKLSB8ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfAotIHwgICBJbnB1dHMgOiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8Ci0gfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwKLSB8ICAgIHZhcjEgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfAotIHwgICAgICAgICAgICAgMTYgYml0IHNob3J0IHNpZ25lZCBpbnRlZ2VyIChXb3JkMTYpIHdob3NlIHZhbHVlIGZhbGxzIGluIHRoZSB8Ci0gfCAgICAgICAgICAgICByYW5nZSA6IDB4ZmZmZiA4MDAwIDw9IHZhcjEgPD0gMHgwMDAwIDdmZmYuICAgICAgICAgICAgICAgICAgIHwKLSB8ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfAotIHwgICAgdmFyMiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8Ci0gfCAgICAgICAgICAgICAxNiBiaXQgc2hvcnQgc2lnbmVkIGludGVnZXIgKFdvcmQxNikgd2hvc2UgdmFsdWUgZmFsbHMgaW4gdGhlIHwKLSB8ICAgICAgICAgICAgIHJhbmdlIDogMHhmZmZmIDgwMDAgPD0gdmFyMSA8PSAweDAwMDAgN2ZmZi4gICAgICAgICAgICAgICAgICAgfAotIHwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8Ci0gfCAgIE91dHB1dHMgOiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwKLSB8ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfAotIHwgICAgbm9uZSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8Ci0gfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwKLSB8ICAgUmV0dXJuIFZhbHVlIDogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfAotIHwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8Ci0gfCAgICB2YXJfb3V0ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwKLSB8ICAgICAgICAgICAgIDE2IGJpdCBzaG9ydCBzaWduZWQgaW50ZWdlciAoV29yZDE2KSB3aG9zZSB2YWx1ZSBmYWxscyBpbiB0aGUgfAotIHwgICAgICAgICAgICAgcmFuZ2UgOiAweGZmZmYgODAwMCA8PSB2YXJfb3V0IDw9IDB4MDAwMCA3ZmZmLiAgICAgICAgICAgICAgICB8Ci0gfF9fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX3wKLSovCi0KLSNpZiAoIVNITF9JU19JTkxJTkUpCi1Xb3JkMTYgc2hsIChXb3JkMTYgdmFyMSwgV29yZDE2IHZhcjIpCi17Ci0gICAgV29yZDE2IHZhcl9vdXQ7Ci0gICAgV29yZDMyIHJlc3VsdDsKLQotICAgIGlmICh2YXIyIDwgMCkKLSAgICB7Ci0gICAgICAgIGlmICh2YXIyIDwgLTE2KQotICAgICAgICAgICAgdmFyMiA9IC0xNjsKLSAgICAgICAgdmFyX291dCA9IHNociAodmFyMSwgKFdvcmQxNiktdmFyMik7Ci0gICAgfQotICAgIGVsc2UKLSAgICB7Ci0gICAgICAgIHJlc3VsdCA9IChXb3JkMzIpIHZhcjEgKigoV29yZDMyKSAxIDw8IHZhcjIpOwotCi0gICAgICAgIGlmICgodmFyMiA+IDE1ICYmIHZhcjEgIT0gMCkgfHwgKHJlc3VsdCAhPSAoV29yZDMyKSAoKFdvcmQxNikgcmVzdWx0KSkpCi0gICAgICAgIHsKLSAgICAgICAgICAgIC8vT3ZlcmZsb3cgPSAxOwotICAgICAgICAgICAgdmFyX291dCA9IChXb3JkMTYpKCh2YXIxID4gMCkgPyBNQVhfMTYgOiBNSU5fMTYpOwotICAgICAgICB9Ci0gICAgICAgIGVsc2UKLSAgICAgICAgewotICAgICAgICAgICAgdmFyX291dCA9IGV4dHJhY3RfbChyZXN1bHQpOwotICAgICAgICB9Ci0gICAgfQotCi0gICAgcmV0dXJuICh2YXJfb3V0KTsKLX0KLSNlbmRpZgotLy8gZW5kCi0KLS8qX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fCi0gfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwKLSB8ICAgRnVuY3Rpb24gTmFtZSA6IHNociAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfAotIHwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8Ci0gfCAgIFB1cnBvc2UgOiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwKLSB8ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfAotIHwgICBBcml0aG1ldGljYWxseSBzaGlmdCB0aGUgMTYgYml0IGlucHV0IHZhcjEgcmlnaHQgdmFyMiBwb3NpdGlvbnMgd2l0aCAgICB8Ci0gfCAgIHNpZ24gZXh0ZW5zaW9uLiBJZiB2YXIyIGlzIG5lZ2F0aXZlLCBhcml0aG1ldGljYWxseSBzaGlmdCB2YXIxIGxlZnQgYnkgIHwKLSB8ICAgLXZhcjIgd2l0aCBzaWduIGV4dGVuc2lvbi4gU2F0dXJhdGUgdGhlIHJlc3VsdCBpbiBjYXNlIG9mIHVuZGVyZmxvd3Mgb3IgfAotIHwgICBvdmVyZmxvd3MuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8Ci0gfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwKLSB8ICAgQ29tcGxleGl0eSB3ZWlnaHQgOiAxICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfAotIHwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8Ci0gfCAgIElucHV0cyA6ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwKLSB8ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfAotIHwgICAgdmFyMSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8Ci0gfCAgICAgICAgICAgICAxNiBiaXQgc2hvcnQgc2lnbmVkIGludGVnZXIgKFdvcmQxNikgd2hvc2UgdmFsdWUgZmFsbHMgaW4gdGhlIHwKLSB8ICAgICAgICAgICAgIHJhbmdlIDogMHhmZmZmIDgwMDAgPD0gdmFyMSA8PSAweDAwMDAgN2ZmZi4gICAgICAgICAgICAgICAgICAgfAotIHwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8Ci0gfCAgICB2YXIyICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwKLSB8ICAgICAgICAgICAgIDE2IGJpdCBzaG9ydCBzaWduZWQgaW50ZWdlciAoV29yZDE2KSB3aG9zZSB2YWx1ZSBmYWxscyBpbiB0aGUgfAotIHwgICAgICAgICAgICAgcmFuZ2UgOiAweGZmZmYgODAwMCA8PSB2YXIxIDw9IDB4MDAwMCA3ZmZmLiAgICAgICAgICAgICAgICAgICB8Ci0gfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwKLSB8ICAgT3V0cHV0cyA6ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfAotIHwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8Ci0gfCAgICBub25lICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwKLSB8ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfAotIHwgICBSZXR1cm4gVmFsdWUgOiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8Ci0gfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwKLSB8ICAgIHZhcl9vdXQgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfAotIHwgICAgICAgICAgICAgMTYgYml0IHNob3J0IHNpZ25lZCBpbnRlZ2VyIChXb3JkMTYpIHdob3NlIHZhbHVlIGZhbGxzIGluIHRoZSB8Ci0gfCAgICAgICAgICAgICByYW5nZSA6IDB4ZmZmZiA4MDAwIDw9IHZhcl9vdXQgPD0gMHgwMDAwIDdmZmYuICAgICAgICAgICAgICAgIHwKLSB8X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19ffAotKi8KLQotI2lmICghU0hSX0lTX0lOTElORSkKLVdvcmQxNiBzaHIgKFdvcmQxNiB2YXIxLCBXb3JkMTYgdmFyMikKLXsKLSAgICBXb3JkMTYgdmFyX291dDsKLQotICAgIGlmICh2YXIyIDwgMCkKLSAgICB7Ci0gICAgICAgIGlmICh2YXIyIDwgLTE2KQotICAgICAgICAgICAgdmFyMiA9IC0xNjsKLSAgICAgICAgdmFyX291dCA9IHNobCAodmFyMSwgKFdvcmQxNiktdmFyMik7Ci0gICAgfQotICAgIGVsc2UKLSAgICB7Ci0gICAgICAgIGlmICh2YXIyID49IDE1KQotICAgICAgICB7Ci0gICAgICAgICAgICB2YXJfb3V0ID0gKFdvcmQxNikoKHZhcjEgPCAwKSA/IC0xIDogMCk7Ci0gICAgICAgIH0KLSAgICAgICAgZWxzZQotICAgICAgICB7Ci0gICAgICAgICAgICBpZiAodmFyMSA8IDApCi0gICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgdmFyX291dCA9IChXb3JkMTYpKH4oKH52YXIxKSA+PiB2YXIyKSk7Ci0gICAgICAgICAgICB9Ci0gICAgICAgICAgICBlbHNlCi0gICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgdmFyX291dCA9IChXb3JkMTYpKHZhcjEgPj4gdmFyMik7Ci0gICAgICAgICAgICB9Ci0gICAgICAgIH0KLSAgICB9Ci0KLSAgICByZXR1cm4gKHZhcl9vdXQpOwotfQotI2VuZGlmCi0KLQotLypfX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX18KLSB8ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfAotIHwgICBGdW5jdGlvbiBOYW1lIDogbXVsdCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8Ci0gfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwKLSB8ICAgUHVycG9zZSA6ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfAotIHwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8Ci0gfCAgICBQZXJmb3JtcyB0aGUgbXVsdGlwbGljYXRpb24gb2YgdmFyMSBieSB2YXIyIGFuZCBnaXZlcyBhIDE2IGJpdCByZXN1bHQgIHwKLSB8ICAgIHdoaWNoIGlzIHNjYWxlZCBpLmUuOiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfAotIHwgICAgICAgICAgICAgbXVsdCh2YXIxLHZhcjIpID0gZXh0cmFjdF9sKExfc2hyKCh2YXIxIHRpbWVzIHZhcjIpLDE1KSkgYW5kICB8Ci0gfCAgICAgICAgICAgICBtdWx0KC0zMjc2OCwtMzI3NjgpID0gMzI3NjcuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwKLSB8ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfAotIHwgICBDb21wbGV4aXR5IHdlaWdodCA6IDEgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8Ci0gfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwKLSB8ICAgSW5wdXRzIDogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfAotIHwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8Ci0gfCAgICB2YXIxICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwKLSB8ICAgICAgICAgICAgIDE2IGJpdCBzaG9ydCBzaWduZWQgaW50ZWdlciAoV29yZDE2KSB3aG9zZSB2YWx1ZSBmYWxscyBpbiB0aGUgfAotIHwgICAgICAgICAgICAgcmFuZ2UgOiAweGZmZmYgODAwMCA8PSB2YXIxIDw9IDB4MDAwMCA3ZmZmLiAgICAgICAgICAgICAgICAgICB8Ci0gfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwKLSB8ICAgIHZhcjIgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfAotIHwgICAgICAgICAgICAgMTYgYml0IHNob3J0IHNpZ25lZCBpbnRlZ2VyIChXb3JkMTYpIHdob3NlIHZhbHVlIGZhbGxzIGluIHRoZSB8Ci0gfCAgICAgICAgICAgICByYW5nZSA6IDB4ZmZmZiA4MDAwIDw9IHZhcjEgPD0gMHgwMDAwIDdmZmYuICAgICAgICAgICAgICAgICAgIHwKLSB8ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfAotIHwgICBPdXRwdXRzIDogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8Ci0gfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwKLSB8ICAgIG5vbmUgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfAotIHwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8Ci0gfCAgIFJldHVybiBWYWx1ZSA6ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwKLSB8ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfAotIHwgICAgdmFyX291dCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8Ci0gfCAgICAgICAgICAgICAxNiBiaXQgc2hvcnQgc2lnbmVkIGludGVnZXIgKFdvcmQxNikgd2hvc2UgdmFsdWUgZmFsbHMgaW4gdGhlIHwKLSB8ICAgICAgICAgICAgIHJhbmdlIDogMHhmZmZmIDgwMDAgPD0gdmFyX291dCA8PSAweDAwMDAgN2ZmZi4gICAgICAgICAgICAgICAgfAotIHxfX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX198Ci0qLwotI2lmICghTVVMVF9JU19JTkxJTkUpCi1Xb3JkMTYgbXVsdCAoV29yZDE2IHZhcjEsIFdvcmQxNiB2YXIyKQotewotICAgIFdvcmQxNiB2YXJfb3V0OwotICAgIFdvcmQzMiBMX3Byb2R1Y3Q7Ci0KLSAgICBMX3Byb2R1Y3QgPSAoV29yZDMyKSB2YXIxICooV29yZDMyKSB2YXIyOwotCi0gICAgTF9wcm9kdWN0ID0gKExfcHJvZHVjdCAmIChXb3JkMzIpIDB4ZmZmZjgwMDBMKSA+PiAxNTsKLQotICAgIGlmIChMX3Byb2R1Y3QgJiAoV29yZDMyKSAweDAwMDEwMDAwTCkKLSAgICAgICAgTF9wcm9kdWN0ID0gTF9wcm9kdWN0IHwgKFdvcmQzMikgMHhmZmZmMDAwMEw7Ci0KLSAgICB2YXJfb3V0ID0gc2F0dXJhdGUoTF9wcm9kdWN0KTsKLQotICAgIHJldHVybiAodmFyX291dCk7Ci19Ci0jZW5kaWYKLQotLypfX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX18KLSB8ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfAotIHwgICBGdW5jdGlvbiBOYW1lIDogTF9tdWx0ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8Ci0gfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwKLSB8ICAgUHVycG9zZSA6ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfAotIHwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8Ci0gfCAgIExfbXVsdCBpcyB0aGUgMzIgYml0IHJlc3VsdCBvZiB0aGUgbXVsdGlwbGljYXRpb24gb2YgdmFyMSB0aW1lcyB2YXIyICAgIHwKLSB8ICAgd2l0aCBvbmUgc2hpZnQgbGVmdCBpLmUuOiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfAotIHwgICAgICAgIExfbXVsdCh2YXIxLHZhcjIpID0gTF9zaGwoKHZhcjEgdGltZXMgdmFyMiksMSkgYW5kICAgICAgICAgICAgICAgICB8Ci0gfCAgICAgICAgTF9tdWx0KC0zMjc2OCwtMzI3NjgpID0gMjE0NzQ4MzY0Ny4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwKLSB8ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfAotIHwgICBDb21wbGV4aXR5IHdlaWdodCA6IDEgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8Ci0gfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwKLSB8ICAgSW5wdXRzIDogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfAotIHwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8Ci0gfCAgICB2YXIxICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwKLSB8ICAgICAgICAgICAgIDE2IGJpdCBzaG9ydCBzaWduZWQgaW50ZWdlciAoV29yZDE2KSB3aG9zZSB2YWx1ZSBmYWxscyBpbiB0aGUgfAotIHwgICAgICAgICAgICAgcmFuZ2UgOiAweGZmZmYgODAwMCA8PSB2YXIxIDw9IDB4MDAwMCA3ZmZmLiAgICAgICAgICAgICAgICAgICB8Ci0gfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwKLSB8ICAgIHZhcjIgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfAotIHwgICAgICAgICAgICAgMTYgYml0IHNob3J0IHNpZ25lZCBpbnRlZ2VyIChXb3JkMTYpIHdob3NlIHZhbHVlIGZhbGxzIGluIHRoZSB8Ci0gfCAgICAgICAgICAgICByYW5nZSA6IDB4ZmZmZiA4MDAwIDw9IHZhcjEgPD0gMHgwMDAwIDdmZmYuICAgICAgICAgICAgICAgICAgIHwKLSB8ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfAotIHwgICBPdXRwdXRzIDogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8Ci0gfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwKLSB8ICAgIG5vbmUgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfAotIHwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8Ci0gfCAgIFJldHVybiBWYWx1ZSA6ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwKLSB8ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfAotIHwgICAgTF92YXJfb3V0ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8Ci0gfCAgICAgICAgICAgICAzMiBiaXQgbG9uZyBzaWduZWQgaW50ZWdlciAoV29yZDMyKSB3aG9zZSB2YWx1ZSBmYWxscyBpbiB0aGUgIHwKLSB8ICAgICAgICAgICAgIHJhbmdlIDogMHg4MDAwIDAwMDAgPD0gTF92YXJfb3V0IDw9IDB4N2ZmZiBmZmZmLiAgICAgICAgICAgICAgfAotIHxfX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX198Ci0qLwotCi0jaWYgKCFMX01VTFRfSVNfSU5MSU5FKQotV29yZDMyIExfbXVsdChXb3JkMTYgdmFyMSwgV29yZDE2IHZhcjIpCi17Ci0gICAgV29yZDMyIExfdmFyX291dDsKLQotICAgIExfdmFyX291dCA9IChXb3JkMzIpIHZhcjEgKihXb3JkMzIpIHZhcjI7Ci0KLSAgICBpZiAoTF92YXJfb3V0ICE9IChXb3JkMzIpIDB4NDAwMDAwMDBMKQotICAgIHsKLSAgICAgICAgTF92YXJfb3V0IDw8PSAxOwotICAgIH0KLSAgICBlbHNlCi0gICAgewotICAgICAgICBMX3Zhcl9vdXQgPSBNQVhfMzI7Ci0gICAgfQotCi0gICAgcmV0dXJuIChMX3Zhcl9vdXQpOwotfQotI2VuZGlmCi0vLyBlbmQKLQotLypfX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX18KLSB8ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfAotIHwgICBGdW5jdGlvbiBOYW1lIDogbmVnYXRlICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8Ci0gfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwKLSB8ICAgUHVycG9zZSA6ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfAotIHwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8Ci0gfCAgIE5lZ2F0ZSB2YXIxIHdpdGggc2F0dXJhdGlvbiwgc2F0dXJhdGUgaW4gdGhlIGNhc2Ugd2hlcmUgaW5wdXQgaXMgLTMyNzY4OnwKLSB8ICAgICAgICAgICAgICAgIG5lZ2F0ZSh2YXIxKSA9IHN1YigwLHZhcjEpLiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfAotIHwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8Ci0gfCAgIENvbXBsZXhpdHkgd2VpZ2h0IDogMSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwKLSB8ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfAotIHwgICBJbnB1dHMgOiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8Ci0gfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwKLSB8ICAgIHZhcjEgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfAotIHwgICAgICAgICAgICAgMTYgYml0IHNob3J0IHNpZ25lZCBpbnRlZ2VyIChXb3JkMTYpIHdob3NlIHZhbHVlIGZhbGxzIGluIHRoZSB8Ci0gfCAgICAgICAgICAgICByYW5nZSA6IDB4ZmZmZiA4MDAwIDw9IHZhcjEgPD0gMHgwMDAwIDdmZmYuICAgICAgICAgICAgICAgICAgIHwKLSB8ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfAotIHwgICBPdXRwdXRzIDogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8Ci0gfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwKLSB8ICAgIG5vbmUgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfAotIHwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8Ci0gfCAgIFJldHVybiBWYWx1ZSA6ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwKLSB8ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfAotIHwgICAgdmFyX291dCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8Ci0gfCAgICAgICAgICAgICAxNiBiaXQgc2hvcnQgc2lnbmVkIGludGVnZXIgKFdvcmQxNikgd2hvc2UgdmFsdWUgZmFsbHMgaW4gdGhlIHwKLSB8ICAgICAgICAgICAgIHJhbmdlIDogMHhmZmZmIDgwMDAgPD0gdmFyX291dCA8PSAweDAwMDAgN2ZmZi4gICAgICAgICAgICAgICAgfAotIHxfX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX198Ci0qLwotLy9Xb3JkMTYgbmVnYXRlIChXb3JkMTYgdmFyMSkKLS8vewotLy8gICAgV29yZDE2IHZhcl9vdXQ7Ci0vLwotLy8gICAgdmFyX291dCA9IChXb3JkMTYpKCh2YXIxID09IE1JTl8xNikgPyBNQVhfMTYgOiAtdmFyMSk7Ci0vLwotLy8gICAgcmV0dXJuICh2YXJfb3V0KTsKLS8vfQotCi0KLS8qX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fCi0gfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwKLSB8ICAgRnVuY3Rpb24gTmFtZSA6IGV4dHJhY3RfaCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfAotIHwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8Ci0gfCAgIFB1cnBvc2UgOiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwKLSB8ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfAotIHwgICBSZXR1cm4gdGhlIDE2IE1TQiBvZiBMX3ZhcjEuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8Ci0gfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwKLSB8ICAgQ29tcGxleGl0eSB3ZWlnaHQgOiAxICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfAotIHwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8Ci0gfCAgIElucHV0cyA6ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwKLSB8ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfAotIHwgICAgTF92YXIxICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8Ci0gfCAgICAgICAgICAgICAzMiBiaXQgbG9uZyBzaWduZWQgaW50ZWdlciAoV29yZDMyICkgd2hvc2UgdmFsdWUgZmFsbHMgaW4gdGhlIHwKLSB8ICAgICAgICAgICAgIHJhbmdlIDogMHg4MDAwIDAwMDAgPD0gTF92YXIxIDw9IDB4N2ZmZiBmZmZmLiAgICAgICAgICAgICAgICAgfAotIHwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8Ci0gfCAgIE91dHB1dHMgOiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwKLSB8ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfAotIHwgICAgbm9uZSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8Ci0gfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwKLSB8ICAgUmV0dXJuIFZhbHVlIDogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfAotIHwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8Ci0gfCAgICB2YXJfb3V0ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwKLSB8ICAgICAgICAgICAgIDE2IGJpdCBzaG9ydCBzaWduZWQgaW50ZWdlciAoV29yZDE2KSB3aG9zZSB2YWx1ZSBmYWxscyBpbiB0aGUgfAotIHwgICAgICAgICAgICAgcmFuZ2UgOiAweGZmZmYgODAwMCA8PSB2YXJfb3V0IDw9IDB4MDAwMCA3ZmZmLiAgICAgICAgICAgICAgICB8Ci0gfF9fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX3wKLSovCi0jaWYgKCFFWFRSQUNUX0hfSVNfSU5MSU5FKQotV29yZDE2IGV4dHJhY3RfaCAoV29yZDMyIExfdmFyMSkKLXsKLSAgICBXb3JkMTYgdmFyX291dDsKLQotICAgIHZhcl9vdXQgPSAoV29yZDE2KSAoTF92YXIxID4+IDE2KTsKLQotICAgIHJldHVybiAodmFyX291dCk7Ci19Ci0jZW5kaWYKLQotLypfX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX18KLSB8ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfAotIHwgICBGdW5jdGlvbiBOYW1lIDogZXh0cmFjdF9sICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8Ci0gfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwKLSB8ICAgUHVycG9zZSA6ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfAotIHwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8Ci0gfCAgIFJldHVybiB0aGUgMTYgTFNCIG9mIExfdmFyMS4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwKLSB8ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfAotIHwgICBDb21wbGV4aXR5IHdlaWdodCA6IDEgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8Ci0gfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwKLSB8ICAgSW5wdXRzIDogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfAotIHwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8Ci0gfCAgICBMX3ZhcjEgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwKLSB8ICAgICAgICAgICAgIDMyIGJpdCBsb25nIHNpZ25lZCBpbnRlZ2VyIChXb3JkMzIgKSB3aG9zZSB2YWx1ZSBmYWxscyBpbiB0aGUgfAotIHwgICAgICAgICAgICAgcmFuZ2UgOiAweDgwMDAgMDAwMCA8PSBMX3ZhcjEgPD0gMHg3ZmZmIGZmZmYuICAgICAgICAgICAgICAgICB8Ci0gfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwKLSB8ICAgT3V0cHV0cyA6ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfAotIHwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8Ci0gfCAgICBub25lICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwKLSB8ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfAotIHwgICBSZXR1cm4gVmFsdWUgOiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8Ci0gfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwKLSB8ICAgIHZhcl9vdXQgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfAotIHwgICAgICAgICAgICAgMTYgYml0IHNob3J0IHNpZ25lZCBpbnRlZ2VyIChXb3JkMTYpIHdob3NlIHZhbHVlIGZhbGxzIGluIHRoZSB8Ci0gfCAgICAgICAgICAgICByYW5nZSA6IDB4ZmZmZiA4MDAwIDw9IHZhcl9vdXQgPD0gMHgwMDAwIDdmZmYuICAgICAgICAgICAgICAgIHwKLSB8X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19ffAotKi8KLSNpZiAoIUVYVFJBQ1RfTF9JU19JTkxJTkUpCi1Xb3JkMTYgZXh0cmFjdF9sKFdvcmQzMiBMX3ZhcjEpCi17Ci0gICAgV29yZDE2IHZhcl9vdXQ7Ci0KLSAgICB2YXJfb3V0ID0gKFdvcmQxNikgTF92YXIxOwotCi0gICAgcmV0dXJuICh2YXJfb3V0KTsKLX0KLSNlbmRpZgotCi0vKl9fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fXwotIHwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8Ci0gfCAgIEZ1bmN0aW9uIE5hbWUgOiByb3VuZCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwKLSB8ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfAotIHwgICBQdXJwb3NlIDogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8Ci0gfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwKLSB8ICAgUm91bmQgdGhlIGxvd2VyIDE2IGJpdHMgb2YgdGhlIDMyIGJpdCBpbnB1dCBudW1iZXIgaW50byB0aGUgTVMgMTYgYml0cyAgfAotIHwgICB3aXRoIHNhdHVyYXRpb24uIFNoaWZ0IHRoZSByZXN1bHRpbmcgYml0cyByaWdodCBieSAxNiBhbmQgcmV0dXJuIHRoZSAxNiB8Ci0gfCAgIGJpdCBudW1iZXI6ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwKLSB8ICAgICAgICAgICAgICAgcm91bmQoTF92YXIxKSA9IGV4dHJhY3RfaChMX2FkZChMX3ZhcjEsMzI3NjgpKSAgICAgICAgICAgICAgfAotIHwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8Ci0gfCAgIENvbXBsZXhpdHkgd2VpZ2h0IDogMSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwKLSB8ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfAotIHwgICBJbnB1dHMgOiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8Ci0gfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwKLSB8ICAgIExfdmFyMSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfAotIHwgICAgICAgICAgICAgMzIgYml0IGxvbmcgc2lnbmVkIGludGVnZXIgKFdvcmQzMiApIHdob3NlIHZhbHVlIGZhbGxzIGluIHRoZSB8Ci0gfCAgICAgICAgICAgICByYW5nZSA6IDB4ODAwMCAwMDAwIDw9IExfdmFyMSA8PSAweDdmZmYgZmZmZi4gICAgICAgICAgICAgICAgIHwKLSB8ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfAotIHwgICBPdXRwdXRzIDogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8Ci0gfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwKLSB8ICAgIG5vbmUgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfAotIHwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8Ci0gfCAgIFJldHVybiBWYWx1ZSA6ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwKLSB8ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfAotIHwgICAgdmFyX291dCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8Ci0gfCAgICAgICAgICAgICAxNiBiaXQgc2hvcnQgc2lnbmVkIGludGVnZXIgKFdvcmQxNikgd2hvc2UgdmFsdWUgZmFsbHMgaW4gdGhlIHwKLSB8ICAgICAgICAgICAgIHJhbmdlIDogMHhmZmZmIDgwMDAgPD0gdmFyX291dCA8PSAweDAwMDAgN2ZmZi4gICAgICAgICAgICAgICAgfAotIHxfX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX198Ci0qLwotCi0jaWYgKCFST1VORF9JU19JTkxJTkUpCi1Xb3JkMTYgcm91bmQxNihXb3JkMzIgTF92YXIxKQotewotICAgIFdvcmQxNiB2YXJfb3V0OwotICAgIFdvcmQzMiBMX3JvdW5kZWQ7Ci0KLSAgICBMX3JvdW5kZWQgPSBMX2FkZCAoTF92YXIxLCAoV29yZDMyKSAweDAwMDA4MDAwTCk7Ci0gICAgdmFyX291dCA9IGV4dHJhY3RfaCAoTF9yb3VuZGVkKTsKLQotICAgIHJldHVybiAodmFyX291dCk7Ci19Ci0jZW5kaWYKLS8vIGVuZAotCi0vKl9fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fXwotIHwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8Ci0gfCAgIEZ1bmN0aW9uIE5hbWUgOiBMX21hYyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwKLSB8ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfAotIHwgICBQdXJwb3NlIDogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8Ci0gfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwKLSB8ICAgTXVsdGlwbHkgdmFyMSBieSB2YXIyIGFuZCBzaGlmdCB0aGUgcmVzdWx0IGxlZnQgYnkgMS4gQWRkIHRoZSAzMiBiaXQgICAgfAotIHwgICByZXN1bHQgdG8gTF92YXIzIHdpdGggc2F0dXJhdGlvbiwgcmV0dXJuIGEgMzIgYml0IHJlc3VsdDogICAgICAgICAgICAgICB8Ci0gfCAgICAgICAgTF9tYWMoTF92YXIzLHZhcjEsdmFyMikgPSBMX2FkZChMX3ZhcjMsTF9tdWx0KHZhcjEsdmFyMikpLiAgICAgICAgIHwKLSB8ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfAotIHwgICBDb21wbGV4aXR5IHdlaWdodCA6IDEgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8Ci0gfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwKLSB8ICAgSW5wdXRzIDogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfAotIHwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8Ci0gfCAgICBMX3ZhcjMgICAzMiBiaXQgbG9uZyBzaWduZWQgaW50ZWdlciAoV29yZDMyKSB3aG9zZSB2YWx1ZSBmYWxscyBpbiB0aGUgIHwKLSB8ICAgICAgICAgICAgIHJhbmdlIDogMHg4MDAwIDAwMDAgPD0gTF92YXIzIDw9IDB4N2ZmZiBmZmZmLiAgICAgICAgICAgICAgICAgfAotIHwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8Ci0gfCAgICB2YXIxICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwKLSB8ICAgICAgICAgICAgIDE2IGJpdCBzaG9ydCBzaWduZWQgaW50ZWdlciAoV29yZDE2KSB3aG9zZSB2YWx1ZSBmYWxscyBpbiB0aGUgfAotIHwgICAgICAgICAgICAgcmFuZ2UgOiAweGZmZmYgODAwMCA8PSB2YXIxIDw9IDB4MDAwMCA3ZmZmLiAgICAgICAgICAgICAgICAgICB8Ci0gfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwKLSB8ICAgIHZhcjIgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfAotIHwgICAgICAgICAgICAgMTYgYml0IHNob3J0IHNpZ25lZCBpbnRlZ2VyIChXb3JkMTYpIHdob3NlIHZhbHVlIGZhbGxzIGluIHRoZSB8Ci0gfCAgICAgICAgICAgICByYW5nZSA6IDB4ZmZmZiA4MDAwIDw9IHZhcjEgPD0gMHgwMDAwIDdmZmYuICAgICAgICAgICAgICAgICAgIHwKLSB8ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfAotIHwgICBPdXRwdXRzIDogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8Ci0gfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwKLSB8ICAgIG5vbmUgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfAotIHwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8Ci0gfCAgIFJldHVybiBWYWx1ZSA6ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwKLSB8ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfAotIHwgICAgTF92YXJfb3V0ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8Ci0gfCAgICAgICAgICAgICAzMiBiaXQgbG9uZyBzaWduZWQgaW50ZWdlciAoV29yZDMyKSB3aG9zZSB2YWx1ZSBmYWxscyBpbiB0aGUgIHwKLSB8ICAgICAgICAgICAgIHJhbmdlIDogMHg4MDAwIDAwMDAgPD0gTF92YXJfb3V0IDw9IDB4N2ZmZiBmZmZmLiAgICAgICAgICAgICAgfAotIHxfX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX198Ci0qLwotI2lmICghTF9NU1VfSVNfSU5MSU5FKQotV29yZDMyIExfbWFjIChXb3JkMzIgTF92YXIzLCBXb3JkMTYgdmFyMSwgV29yZDE2IHZhcjIpCi17Ci0gICAgV29yZDMyIExfdmFyX291dDsKLSAgICBXb3JkMzIgTF9wcm9kdWN0OwotCi0gICAgTF9wcm9kdWN0ID0gTF9tdWx0KHZhcjEsIHZhcjIpOwotICAgIExfdmFyX291dCA9IExfYWRkIChMX3ZhcjMsIExfcHJvZHVjdCk7Ci0KLSAgICByZXR1cm4gKExfdmFyX291dCk7Ci19Ci0jZW5kaWYKLQotLypfX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX18KLSB8ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfAotIHwgICBGdW5jdGlvbiBOYW1lIDogTF9tc3UgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8Ci0gfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwKLSB8ICAgUHVycG9zZSA6ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfAotIHwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8Ci0gfCAgIE11bHRpcGx5IHZhcjEgYnkgdmFyMiBhbmQgc2hpZnQgdGhlIHJlc3VsdCBsZWZ0IGJ5IDEuIFN1YnRyYWN0IHRoZSAzMiAgIHwKLSB8ICAgYml0IHJlc3VsdCB0byBMX3ZhcjMgd2l0aCBzYXR1cmF0aW9uLCByZXR1cm4gYSAzMiBiaXQgcmVzdWx0OiAgICAgICAgICAgfAotIHwgICAgICAgIExfbXN1KExfdmFyMyx2YXIxLHZhcjIpID0gTF9zdWIoTF92YXIzLExfbXVsdCh2YXIxLHZhcjIpKS4gICAgICAgICB8Ci0gfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwKLSB8ICAgQ29tcGxleGl0eSB3ZWlnaHQgOiAxICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfAotIHwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8Ci0gfCAgIElucHV0cyA6ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwKLSB8ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfAotIHwgICAgTF92YXIzICAgMzIgYml0IGxvbmcgc2lnbmVkIGludGVnZXIgKFdvcmQzMikgd2hvc2UgdmFsdWUgZmFsbHMgaW4gdGhlICB8Ci0gfCAgICAgICAgICAgICByYW5nZSA6IDB4ODAwMCAwMDAwIDw9IExfdmFyMyA8PSAweDdmZmYgZmZmZi4gICAgICAgICAgICAgICAgIHwKLSB8ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfAotIHwgICAgdmFyMSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8Ci0gfCAgICAgICAgICAgICAxNiBiaXQgc2hvcnQgc2lnbmVkIGludGVnZXIgKFdvcmQxNikgd2hvc2UgdmFsdWUgZmFsbHMgaW4gdGhlIHwKLSB8ICAgICAgICAgICAgIHJhbmdlIDogMHhmZmZmIDgwMDAgPD0gdmFyMSA8PSAweDAwMDAgN2ZmZi4gICAgICAgICAgICAgICAgICAgfAotIHwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8Ci0gfCAgICB2YXIyICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwKLSB8ICAgICAgICAgICAgIDE2IGJpdCBzaG9ydCBzaWduZWQgaW50ZWdlciAoV29yZDE2KSB3aG9zZSB2YWx1ZSBmYWxscyBpbiB0aGUgfAotIHwgICAgICAgICAgICAgcmFuZ2UgOiAweGZmZmYgODAwMCA8PSB2YXIxIDw9IDB4MDAwMCA3ZmZmLiAgICAgICAgICAgICAgICAgICB8Ci0gfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwKLSB8ICAgT3V0cHV0cyA6ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfAotIHwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8Ci0gfCAgICBub25lICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwKLSB8ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfAotIHwgICBSZXR1cm4gVmFsdWUgOiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8Ci0gfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwKLSB8ICAgIExfdmFyX291dCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfAotIHwgICAgICAgICAgICAgMzIgYml0IGxvbmcgc2lnbmVkIGludGVnZXIgKFdvcmQzMikgd2hvc2UgdmFsdWUgZmFsbHMgaW4gdGhlICB8Ci0gfCAgICAgICAgICAgICByYW5nZSA6IDB4ODAwMCAwMDAwIDw9IExfdmFyX291dCA8PSAweDdmZmYgZmZmZi4gICAgICAgICAgICAgIHwKLSB8X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19ffAotKi8KLQotI2lmICghTF9NU1VfSVNfSU5MSU5FKQotV29yZDMyIExfbXN1IChXb3JkMzIgTF92YXIzLCBXb3JkMTYgdmFyMSwgV29yZDE2IHZhcjIpCi17Ci0gICAgV29yZDMyIExfdmFyX291dDsKLSAgICBXb3JkMzIgTF9wcm9kdWN0OwotCi0gICAgTF9wcm9kdWN0ID0gTF9tdWx0KHZhcjEsIHZhcjIpOwotICAgIExfdmFyX291dCA9IExfc3ViIChMX3ZhcjMsIExfcHJvZHVjdCk7Ci0KLSAgICByZXR1cm4gKExfdmFyX291dCk7Ci19Ci0jZW5kaWYKLQotCi0vKl9fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fXwotIHwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8Ci0gfCAgIEZ1bmN0aW9uIE5hbWUgOiBMX2FkZCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwKLSB8ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfAotIHwgICBQdXJwb3NlIDogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8Ci0gfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwKLSB8ICAgMzIgYml0cyBhZGRpdGlvbiBvZiB0aGUgdHdvIDMyIGJpdHMgdmFyaWFibGVzIChMX3ZhcjErTF92YXIyKSB3aXRoICAgICAgfAotIHwgICBvdmVyZmxvdyBjb250cm9sIGFuZCBzYXR1cmF0aW9uOyB0aGUgcmVzdWx0IGlzIHNldCBhdCArMjE0NzQ4MzY0NyB3aGVuICB8Ci0gfCAgIG92ZXJmbG93IG9jY3VycyBvciBhdCAtMjE0NzQ4MzY0OCB3aGVuIHVuZGVyZmxvdyBvY2N1cnMuICAgICAgICAgICAgICAgIHwKLSB8ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfAotIHwgICBDb21wbGV4aXR5IHdlaWdodCA6IDIgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8Ci0gfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwKLSB8ICAgSW5wdXRzIDogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfAotIHwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8Ci0gfCAgICBMX3ZhcjEgICAzMiBiaXQgbG9uZyBzaWduZWQgaW50ZWdlciAoV29yZDMyKSB3aG9zZSB2YWx1ZSBmYWxscyBpbiB0aGUgIHwKLSB8ICAgICAgICAgICAgIHJhbmdlIDogMHg4MDAwIDAwMDAgPD0gTF92YXIzIDw9IDB4N2ZmZiBmZmZmLiAgICAgICAgICAgICAgICAgfAotIHwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8Ci0gfCAgICBMX3ZhcjIgICAzMiBiaXQgbG9uZyBzaWduZWQgaW50ZWdlciAoV29yZDMyKSB3aG9zZSB2YWx1ZSBmYWxscyBpbiB0aGUgIHwKLSB8ICAgICAgICAgICAgIHJhbmdlIDogMHg4MDAwIDAwMDAgPD0gTF92YXIzIDw9IDB4N2ZmZiBmZmZmLiAgICAgICAgICAgICAgICAgfAotIHwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8Ci0gfCAgIE91dHB1dHMgOiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwKLSB8ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfAotIHwgICAgbm9uZSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8Ci0gfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwKLSB8ICAgUmV0dXJuIFZhbHVlIDogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfAotIHwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8Ci0gfCAgICBMX3Zhcl9vdXQgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwKLSB8ICAgICAgICAgICAgIDMyIGJpdCBsb25nIHNpZ25lZCBpbnRlZ2VyIChXb3JkMzIpIHdob3NlIHZhbHVlIGZhbGxzIGluIHRoZSAgfAotIHwgICAgICAgICAgICAgcmFuZ2UgOiAweDgwMDAgMDAwMCA8PSBMX3Zhcl9vdXQgPD0gMHg3ZmZmIGZmZmYuICAgICAgICAgICAgICB8Ci0gfF9fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX3wKLSovCi0jaWYgKCFMX0FERF9JU19JTkxJTkUpCi1Xb3JkMzIgTF9hZGQgKFdvcmQzMiBMX3ZhcjEsIFdvcmQzMiBMX3ZhcjIpCi17Ci0gICAgV29yZDMyIExfdmFyX291dDsKLQotICAgIExfdmFyX291dCA9IExfdmFyMSArIExfdmFyMjsKLQotICAgIGlmICgoKExfdmFyMSBeIExfdmFyMikgJiBNSU5fMzIpID09IDApCi0gICAgewotICAgICAgICBpZiAoKExfdmFyX291dCBeIExfdmFyMSkgJiBNSU5fMzIpCi0gICAgICAgIHsKLSAgICAgICAgICAgIExfdmFyX291dCA9IChMX3ZhcjEgPCAwKSA/IE1JTl8zMiA6IE1BWF8zMjsKLSAgICAgICAgICAgIC8vT3ZlcmZsb3cgPSAxOwotICAgICAgICB9Ci0gICAgfQotCi0gICAgcmV0dXJuIChMX3Zhcl9vdXQpOwotfQotI2VuZGlmCi0KLS8qX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fCi0gfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwKLSB8ICAgRnVuY3Rpb24gTmFtZSA6IExfc3ViICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfAotIHwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8Ci0gfCAgIFB1cnBvc2UgOiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwKLSB8ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfAotIHwgICAzMiBiaXRzIHN1YnRyYWN0aW9uIG9mIHRoZSB0d28gMzIgYml0cyB2YXJpYWJsZXMgKExfdmFyMS1MX3ZhcjIpIHdpdGggICB8Ci0gfCAgIG92ZXJmbG93IGNvbnRyb2wgYW5kIHNhdHVyYXRpb247IHRoZSByZXN1bHQgaXMgc2V0IGF0ICsyMTQ3NDgzNjQ3IHdoZW4gIHwKLSB8ICAgb3ZlcmZsb3cgb2NjdXJzIG9yIGF0IC0yMTQ3NDgzNjQ4IHdoZW4gdW5kZXJmbG93IG9jY3Vycy4gICAgICAgICAgICAgICAgfAotIHwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8Ci0gfCAgIENvbXBsZXhpdHkgd2VpZ2h0IDogMiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwKLSB8ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfAotIHwgICBJbnB1dHMgOiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8Ci0gfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwKLSB8ICAgIExfdmFyMSAgIDMyIGJpdCBsb25nIHNpZ25lZCBpbnRlZ2VyIChXb3JkMzIpIHdob3NlIHZhbHVlIGZhbGxzIGluIHRoZSAgfAotIHwgICAgICAgICAgICAgcmFuZ2UgOiAweDgwMDAgMDAwMCA8PSBMX3ZhcjMgPD0gMHg3ZmZmIGZmZmYuICAgICAgICAgICAgICAgICB8Ci0gfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwKLSB8ICAgIExfdmFyMiAgIDMyIGJpdCBsb25nIHNpZ25lZCBpbnRlZ2VyIChXb3JkMzIpIHdob3NlIHZhbHVlIGZhbGxzIGluIHRoZSAgfAotIHwgICAgICAgICAgICAgcmFuZ2UgOiAweDgwMDAgMDAwMCA8PSBMX3ZhcjMgPD0gMHg3ZmZmIGZmZmYuICAgICAgICAgICAgICAgICB8Ci0gfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwKLSB8ICAgT3V0cHV0cyA6ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfAotIHwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8Ci0gfCAgICBub25lICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwKLSB8ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfAotIHwgICBSZXR1cm4gVmFsdWUgOiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8Ci0gfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwKLSB8ICAgIExfdmFyX291dCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfAotIHwgICAgICAgICAgICAgMzIgYml0IGxvbmcgc2lnbmVkIGludGVnZXIgKFdvcmQzMikgd2hvc2UgdmFsdWUgZmFsbHMgaW4gdGhlICB8Ci0gfCAgICAgICAgICAgICByYW5nZSA6IDB4ODAwMCAwMDAwIDw9IExfdmFyX291dCA8PSAweDdmZmYgZmZmZi4gICAgICAgICAgICAgIHwKLSB8X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19ffAotKi8KLSNpZiAoIUxfU1VCX0lTX0lOTElORSkKLVdvcmQzMiBMX3N1YihXb3JkMzIgTF92YXIxLCBXb3JkMzIgTF92YXIyKQotewotICAgIFdvcmQzMiBMX3Zhcl9vdXQ7Ci0KLSAgICBMX3Zhcl9vdXQgPSBMX3ZhcjEgLSBMX3ZhcjI7Ci0KLSAgICBpZiAoKChMX3ZhcjEgXiBMX3ZhcjIpICYgTUlOXzMyKSAhPSAwKQotICAgIHsKLSAgICAgICAgaWYgKChMX3Zhcl9vdXQgXiBMX3ZhcjEpICYgTUlOXzMyKQotICAgICAgICB7Ci0gICAgICAgICAgICBMX3Zhcl9vdXQgPSAoTF92YXIxIDwgMEwpID8gTUlOXzMyIDogTUFYXzMyOwotICAgICAgICAgICAgLy9PdmVyZmxvdyA9IDE7Ci0gICAgICAgIH0KLSAgICB9Ci0KLSAgICByZXR1cm4gKExfdmFyX291dCk7Ci19Ci0jZW5kaWYKLQotCi0vKl9fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fXwotIHwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8Ci0gfCAgIEZ1bmN0aW9uIE5hbWUgOiBMX25lZ2F0ZSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwKLSB8ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfAotIHwgICBQdXJwb3NlIDogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8Ci0gfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwKLSB8ICAgTmVnYXRlIHRoZSAzMiBiaXQgdmFyaWFibGUgTF92YXIxIHdpdGggc2F0dXJhdGlvbjsgc2F0dXJhdGUgaW4gdGhlIGNhc2UgfAotIHwgICB3aGVyZSBpbnB1dCBpcyAtMjE0NzQ4MzY0OCAoMHg4MDAwIDAwMDApLiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8Ci0gfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwKLSB8ICAgQ29tcGxleGl0eSB3ZWlnaHQgOiAyICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfAotIHwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8Ci0gfCAgIElucHV0cyA6ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwKLSB8ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfAotIHwgICAgTF92YXIxICAgMzIgYml0IGxvbmcgc2lnbmVkIGludGVnZXIgKFdvcmQzMikgd2hvc2UgdmFsdWUgZmFsbHMgaW4gdGhlICB8Ci0gfCAgICAgICAgICAgICByYW5nZSA6IDB4ODAwMCAwMDAwIDw9IExfdmFyMyA8PSAweDdmZmYgZmZmZi4gICAgICAgICAgICAgICAgIHwKLSB8ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfAotIHwgICBPdXRwdXRzIDogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8Ci0gfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwKLSB8ICAgIG5vbmUgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfAotIHwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8Ci0gfCAgIFJldHVybiBWYWx1ZSA6ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwKLSB8ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfAotIHwgICAgTF92YXJfb3V0ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8Ci0gfCAgICAgICAgICAgICAzMiBiaXQgbG9uZyBzaWduZWQgaW50ZWdlciAoV29yZDMyKSB3aG9zZSB2YWx1ZSBmYWxscyBpbiB0aGUgIHwKLSB8ICAgICAgICAgICAgIHJhbmdlIDogMHg4MDAwIDAwMDAgPD0gTF92YXJfb3V0IDw9IDB4N2ZmZiBmZmZmLiAgICAgICAgICAgICAgfAotIHxfX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX198Ci0qLwotLy9Xb3JkMzIgTF9uZWdhdGUgKFdvcmQzMiBMX3ZhcjEpCi0vL3sKLS8vICAgIFdvcmQzMiBMX3Zhcl9vdXQ7Ci0vLwotLy8gICAgTF92YXJfb3V0ID0gKExfdmFyMSA9PSBNSU5fMzIpID8gTUFYXzMyIDogLUxfdmFyMTsKLS8vCi0vLyAgICByZXR1cm4gKExfdmFyX291dCk7Ci0vL30KLQotCi0vKl9fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fXwotIHwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8Ci0gfCAgIEZ1bmN0aW9uIE5hbWUgOiBtdWx0X3IgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwKLSB8ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfAotIHwgICBQdXJwb3NlIDogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8Ci0gfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwKLSB8ICAgU2FtZSBhcyBtdWx0IHdpdGggcm91bmRpbmcsIGkuZS46ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfAotIHwgICAgIG11bHRfcih2YXIxLHZhcjIpID0gZXh0cmFjdF9sKExfc2hyKCgodmFyMSAqIHZhcjIpICsgMTYzODQpLDE1KSkgYW5kICB8Ci0gfCAgICAgbXVsdF9yKC0zMjc2OCwtMzI3NjgpID0gMzI3NjcuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwKLSB8ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfAotIHwgICBDb21wbGV4aXR5IHdlaWdodCA6IDIgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8Ci0gfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwKLSB8ICAgSW5wdXRzIDogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfAotIHwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8Ci0gfCAgICB2YXIxICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwKLSB8ICAgICAgICAgICAgIDE2IGJpdCBzaG9ydCBzaWduZWQgaW50ZWdlciAoV29yZDE2KSB3aG9zZSB2YWx1ZSBmYWxscyBpbiB0aGUgfAotIHwgICAgICAgICAgICAgcmFuZ2UgOiAweGZmZmYgODAwMCA8PSB2YXIxIDw9IDB4MDAwMCA3ZmZmLiAgICAgICAgICAgICAgICAgICB8Ci0gfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwKLSB8ICAgIHZhcjIgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfAotIHwgICAgICAgICAgICAgMTYgYml0IHNob3J0IHNpZ25lZCBpbnRlZ2VyIChXb3JkMTYpIHdob3NlIHZhbHVlIGZhbGxzIGluIHRoZSB8Ci0gfCAgICAgICAgICAgICByYW5nZSA6IDB4ZmZmZiA4MDAwIDw9IHZhcjEgPD0gMHgwMDAwIDdmZmYuICAgICAgICAgICAgICAgICAgIHwKLSB8ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfAotIHwgICBPdXRwdXRzIDogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8Ci0gfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwKLSB8ICAgIG5vbmUgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfAotIHwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8Ci0gfCAgIFJldHVybiBWYWx1ZSA6ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwKLSB8ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfAotIHwgICAgdmFyX291dCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8Ci0gfCAgICAgICAgICAgICAxNiBiaXQgc2hvcnQgc2lnbmVkIGludGVnZXIgKFdvcmQxNikgd2hvc2UgdmFsdWUgZmFsbHMgaW4gdGhlIHwKLSB8ICAgICAgICAgICAgIHJhbmdlIDogMHhmZmZmIDgwMDAgPD0gdmFyX291dCA8PSAweDAwMDAgN2ZmZi4gICAgICAgICAgICAgICAgfAotIHxfX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX198Ci0qLwotI2lmICghTVVMVF9SX0lTX0lOTElORSkKLVdvcmQxNiBtdWx0X3IgKFdvcmQxNiB2YXIxLCBXb3JkMTYgdmFyMikKLXsKLSAgICBXb3JkMTYgdmFyX291dDsKLSAgICBXb3JkMzIgTF9wcm9kdWN0X2FycjsKLQotICAgIExfcHJvZHVjdF9hcnIgPSAoV29yZDMyKSB2YXIxICooV29yZDMyKSB2YXIyOyAgICAgICAvKiBwcm9kdWN0ICovCi0gICAgTF9wcm9kdWN0X2FyciArPSAoV29yZDMyKSAweDAwMDA0MDAwTDsgICAgICAvKiByb3VuZCAqLwotICAgIExfcHJvZHVjdF9hcnIgJj0gKFdvcmQzMikgMHhmZmZmODAwMEw7Ci0gICAgTF9wcm9kdWN0X2FyciA+Pj0gMTU7ICAgICAgIC8qIHNoaWZ0ICovCi0KLSAgICBpZiAoTF9wcm9kdWN0X2FyciAmIChXb3JkMzIpIDB4MDAwMTAwMDBMKSAgIC8qIHNpZ24gZXh0ZW5kIHdoZW4gbmVjZXNzYXJ5ICovCi0gICAgewotICAgICAgICBMX3Byb2R1Y3RfYXJyIHw9IChXb3JkMzIpIDB4ZmZmZjAwMDBMOwotICAgIH0KLSAgICB2YXJfb3V0ID0gc2F0dXJhdGUoTF9wcm9kdWN0X2Fycik7Ci0KLSAgICByZXR1cm4gKHZhcl9vdXQpOwotfQotI2VuZGlmCi0KLS8qX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fCi0gfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwKLSB8ICAgRnVuY3Rpb24gTmFtZSA6IExfc2hsICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfAotIHwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8Ci0gfCAgIFB1cnBvc2UgOiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwKLSB8ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfAotIHwgICBBcml0aG1ldGljYWxseSBzaGlmdCB0aGUgMzIgYml0IGlucHV0IExfdmFyMSBsZWZ0IHZhcjIgcG9zaXRpb25zLiBaZXJvICB8Ci0gfCAgIGZpbGwgdGhlIHZhcjIgTFNCIG9mIHRoZSByZXN1bHQuIElmIHZhcjIgaXMgbmVnYXRpdmUsIGFyaXRobWV0aWNhbGx5ICAgIHwKLSB8ICAgc2hpZnQgTF92YXIxIHJpZ2h0IGJ5IC12YXIyIHdpdGggc2lnbiBleHRlbnNpb24uIFNhdHVyYXRlIHRoZSByZXN1bHQgaW4gfAotIHwgICBjYXNlIG9mIHVuZGVyZmxvd3Mgb3Igb3ZlcmZsb3dzLiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8Ci0gfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwKLSB8ICAgQ29tcGxleGl0eSB3ZWlnaHQgOiAyICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfAotIHwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8Ci0gfCAgIElucHV0cyA6ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwKLSB8ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfAotIHwgICAgTF92YXIxICAgMzIgYml0IGxvbmcgc2lnbmVkIGludGVnZXIgKFdvcmQzMikgd2hvc2UgdmFsdWUgZmFsbHMgaW4gdGhlICB8Ci0gfCAgICAgICAgICAgICByYW5nZSA6IDB4ODAwMCAwMDAwIDw9IExfdmFyMyA8PSAweDdmZmYgZmZmZi4gICAgICAgICAgICAgICAgIHwKLSB8ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfAotIHwgICAgdmFyMiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8Ci0gfCAgICAgICAgICAgICAxNiBiaXQgc2hvcnQgc2lnbmVkIGludGVnZXIgKFdvcmQxNikgd2hvc2UgdmFsdWUgZmFsbHMgaW4gdGhlIHwKLSB8ICAgICAgICAgICAgIHJhbmdlIDogMHhmZmZmIDgwMDAgPD0gdmFyMSA8PSAweDAwMDAgN2ZmZi4gICAgICAgICAgICAgICAgICAgfAotIHwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8Ci0gfCAgIE91dHB1dHMgOiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwKLSB8ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfAotIHwgICAgbm9uZSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8Ci0gfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwKLSB8ICAgUmV0dXJuIFZhbHVlIDogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfAotIHwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8Ci0gfCAgICBMX3Zhcl9vdXQgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwKLSB8ICAgICAgICAgICAgIDMyIGJpdCBsb25nIHNpZ25lZCBpbnRlZ2VyIChXb3JkMzIpIHdob3NlIHZhbHVlIGZhbGxzIGluIHRoZSAgfAotIHwgICAgICAgICAgICAgcmFuZ2UgOiAweDgwMDAgMDAwMCA8PSBMX3Zhcl9vdXQgPD0gMHg3ZmZmIGZmZmYuICAgICAgICAgICAgICB8Ci0gfF9fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX3wKLSovCi0KLSNpZiAoIUxfU0hMX0lTX0lOTElORSkKLVdvcmQzMiBMX3NobCAoV29yZDMyIExfdmFyMSwgV29yZDE2IHZhcjIpCi17Ci0gICAgV29yZDMyIExfdmFyX291dCA9IDBMOwotCi0gICAgaWYgKHZhcjIgPD0gMCkKLSAgICB7Ci0gICAgICAgIExfdmFyMSA9IExfc2hyKExfdmFyMSwgKFdvcmQxNiktdmFyMik7Ci0gICAgfQotICAgIGVsc2UKLSAgICB7Ci0gICAgICAgIGZvciAoOyB2YXIyID4gMDsgdmFyMi0tKQotICAgICAgICB7Ci0gICAgICAgICAgICBpZiAoTF92YXIxID4gKFdvcmQzMikgMFgzZmZmZmZmZkwpCi0gICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgcmV0dXJuIE1BWF8zMjsKLSAgICAgICAgICAgIH0KLSAgICAgICAgICAgIGVsc2UKLSAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICBpZiAoTF92YXIxIDwgKFdvcmQzMikgMHhjMDAwMDAwMEwpCi0gICAgICAgICAgICAgICAgewotICAgICAgICAgICAgICAgICAgICByZXR1cm4gTUlOXzMyOwotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgIH0KLSAgICAgICAgICAgIExfdmFyMSA8PD0gMTsKLSAgICAgICAgfQotICAgIH0KLSAgICByZXR1cm4gKExfdmFyMSk7Ci19Ci0jZW5kaWYKLQotLypfX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX18KLSB8ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfAotIHwgICBGdW5jdGlvbiBOYW1lIDogTF9zaHIgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8Ci0gfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwKLSB8ICAgUHVycG9zZSA6ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfAotIHwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8Ci0gfCAgIEFyaXRobWV0aWNhbGx5IHNoaWZ0IHRoZSAzMiBiaXQgaW5wdXQgTF92YXIxIHJpZ2h0IHZhcjIgcG9zaXRpb25zIHdpdGggIHwKLSB8ICAgc2lnbiBleHRlbnNpb24uIElmIHZhcjIgaXMgbmVnYXRpdmUsIGFyaXRobWV0aWNhbGx5IHNoaWZ0IExfdmFyMSBsZWZ0ICAgfAotIHwgICBieSAtdmFyMiBhbmQgemVybyBmaWxsIHRoZSAtdmFyMiBMU0Igb2YgdGhlIHJlc3VsdC4gU2F0dXJhdGUgdGhlIHJlc3VsdCB8Ci0gfCAgIGluIGNhc2Ugb2YgdW5kZXJmbG93cyBvciBvdmVyZmxvd3MuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwKLSB8ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfAotIHwgICBDb21wbGV4aXR5IHdlaWdodCA6IDIgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8Ci0gfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwKLSB8ICAgSW5wdXRzIDogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfAotIHwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8Ci0gfCAgICBMX3ZhcjEgICAzMiBiaXQgbG9uZyBzaWduZWQgaW50ZWdlciAoV29yZDMyKSB3aG9zZSB2YWx1ZSBmYWxscyBpbiB0aGUgIHwKLSB8ICAgICAgICAgICAgIHJhbmdlIDogMHg4MDAwIDAwMDAgPD0gTF92YXIzIDw9IDB4N2ZmZiBmZmZmLiAgICAgICAgICAgICAgICAgfAotIHwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8Ci0gfCAgICB2YXIyICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwKLSB8ICAgICAgICAgICAgIDE2IGJpdCBzaG9ydCBzaWduZWQgaW50ZWdlciAoV29yZDE2KSB3aG9zZSB2YWx1ZSBmYWxscyBpbiB0aGUgfAotIHwgICAgICAgICAgICAgcmFuZ2UgOiAweGZmZmYgODAwMCA8PSB2YXIxIDw9IDB4MDAwMCA3ZmZmLiAgICAgICAgICAgICAgICAgICB8Ci0gfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwKLSB8ICAgT3V0cHV0cyA6ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfAotIHwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8Ci0gfCAgICBub25lICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwKLSB8ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfAotIHwgICBSZXR1cm4gVmFsdWUgOiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8Ci0gfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwKLSB8ICAgIExfdmFyX291dCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfAotIHwgICAgICAgICAgICAgMzIgYml0IGxvbmcgc2lnbmVkIGludGVnZXIgKFdvcmQzMikgd2hvc2UgdmFsdWUgZmFsbHMgaW4gdGhlICB8Ci0gfCAgICAgICAgICAgICByYW5nZSA6IDB4ODAwMCAwMDAwIDw9IExfdmFyX291dCA8PSAweDdmZmYgZmZmZi4gICAgICAgICAgICAgIHwKLSB8X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19ffAotKi8KLQotI2lmICghTF9TSFJfSVNfSU5MSU5FKQotV29yZDMyIExfc2hyIChXb3JkMzIgTF92YXIxLCBXb3JkMTYgdmFyMikKLXsKLSAgICBXb3JkMzIgTF92YXJfb3V0OwotCi0gICAgaWYgKHZhcjIgPCAwKQotICAgIHsKLSAgICAgICAgTF92YXJfb3V0ID0gTF9zaGwgKExfdmFyMSwgKFdvcmQxNiktdmFyMik7Ci0gICAgfQotICAgIGVsc2UKLSAgICB7Ci0gICAgICAgIGlmICh2YXIyID49IDMxKQotICAgICAgICB7Ci0gICAgICAgICAgICBMX3Zhcl9vdXQgPSAoTF92YXIxIDwgMEwpID8gLTEgOiAwOwotICAgICAgICB9Ci0gICAgICAgIGVsc2UKLSAgICAgICAgewotICAgICAgICAgICAgaWYgKExfdmFyMSA8IDApCi0gICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgTF92YXJfb3V0ID0gfigofkxfdmFyMSkgPj4gdmFyMik7Ci0gICAgICAgICAgICB9Ci0gICAgICAgICAgICBlbHNlCi0gICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgTF92YXJfb3V0ID0gTF92YXIxID4+IHZhcjI7Ci0gICAgICAgICAgICB9Ci0gICAgICAgIH0KLSAgICB9Ci0gICAgcmV0dXJuIChMX3Zhcl9vdXQpOwotfQotI2VuZGlmCi0KLS8qX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fCi0gfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwKLSB8ICAgRnVuY3Rpb24gTmFtZSA6IHNocl9yICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfAotIHwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8Ci0gfCAgIFB1cnBvc2UgOiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwKLSB8ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfAotIHwgICBTYW1lIGFzIHNocih2YXIxLHZhcjIpIGJ1dCB3aXRoIHJvdW5kaW5nLiBTYXR1cmF0ZSB0aGUgcmVzdWx0IGluIGNhc2Ugb2Z8Ci0gfCAgIHVuZGVyZmxvd3Mgb3Igb3ZlcmZsb3dzIDogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwKLSB8ICAgIC0gSWYgdmFyMiBpcyBncmVhdGVyIHRoYW4gemVybyA6ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfAotIHwgICAgICAgICAgaWYgKHN1YihzaGwoc2hyKHZhcjEsdmFyMiksMSksc2hyKHZhcjEsc3ViKHZhcjIsMSkpKSkgICAgICAgICAgICB8Ci0gfCAgICAgICAgICBpcyBlcXVhbCB0byB6ZXJvICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwKLSB8ICAgICAgICAgICAgICAgICAgICAgdGhlbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfAotIHwgICAgICAgICAgICAgICAgICAgICBzaHJfcih2YXIxLHZhcjIpID0gc2hyKHZhcjEsdmFyMikgICAgICAgICAgICAgICAgICAgICB8Ci0gfCAgICAgICAgICAgICAgICAgICAgIGVsc2UgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwKLSB8ICAgICAgICAgICAgICAgICAgICAgc2hyX3IodmFyMSx2YXIyKSA9IGFkZChzaHIodmFyMSx2YXIyKSwxKSAgICAgICAgICAgICAgfAotIHwgICAgLSBJZiB2YXIyIGlzIGxlc3MgdGhhbiBvciBlcXVhbCB0byB6ZXJvIDogICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8Ci0gfCAgICAgICAgICAgICAgICAgICAgIHNocl9yKHZhcjEsdmFyMikgPSBzaHIodmFyMSx2YXIyKS4gICAgICAgICAgICAgICAgICAgIHwKLSB8ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfAotIHwgICBDb21wbGV4aXR5IHdlaWdodCA6IDIgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8Ci0gfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwKLSB8ICAgSW5wdXRzIDogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfAotIHwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8Ci0gfCAgICB2YXIxICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwKLSB8ICAgICAgICAgICAgIDE2IGJpdCBzaG9ydCBzaWduZWQgaW50ZWdlciAoV29yZDE2KSB3aG9zZSB2YWx1ZSBmYWxscyBpbiB0aGUgfAotIHwgICAgICAgICAgICAgcmFuZ2UgOiAweGZmZmYgODAwMCA8PSB2YXIxIDw9IDB4MDAwMCA3ZmZmLiAgICAgICAgICAgICAgICAgICB8Ci0gfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwKLSB8ICAgIHZhcjIgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfAotIHwgICAgICAgICAgICAgMTYgYml0IHNob3J0IHNpZ25lZCBpbnRlZ2VyIChXb3JkMTYpIHdob3NlIHZhbHVlIGZhbGxzIGluIHRoZSB8Ci0gfCAgICAgICAgICAgICByYW5nZSA6IDB4ZmZmZiA4MDAwIDw9IHZhcjEgPD0gMHgwMDAwIDdmZmYuICAgICAgICAgICAgICAgICAgIHwKLSB8ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfAotIHwgICBPdXRwdXRzIDogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8Ci0gfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwKLSB8ICAgIG5vbmUgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfAotIHwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8Ci0gfCAgIFJldHVybiBWYWx1ZSA6ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwKLSB8ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfAotIHwgICAgdmFyX291dCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8Ci0gfCAgICAgICAgICAgICAxNiBiaXQgc2hvcnQgc2lnbmVkIGludGVnZXIgKFdvcmQxNikgd2hvc2UgdmFsdWUgZmFsbHMgaW4gdGhlIHwKLSB8ICAgICAgICAgICAgIHJhbmdlIDogMHhmZmZmIDgwMDAgPD0gdmFyX291dCA8PSAweDAwMDAgN2ZmZi4gICAgICAgICAgICAgICAgfAotIHxfX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX198Ci0qLwotI2lmICghU0hSX1JfSVNfSU5MSU5FKQotV29yZDE2IHNocl9yIChXb3JkMTYgdmFyMSwgV29yZDE2IHZhcjIpCi17Ci0gICAgV29yZDE2IHZhcl9vdXQ7Ci0KLSAgICBpZiAodmFyMiA+IDE1KQotICAgIHsKLSAgICAgICAgdmFyX291dCA9IDA7Ci0gICAgfQotICAgIGVsc2UKLSAgICB7Ci0gICAgICAgIHZhcl9vdXQgPSBzaHIgKHZhcjEsIHZhcjIpOwotCi0gICAgICAgIGlmICh2YXIyID4gMCkKLSAgICAgICAgewotICAgICAgICAgICAgaWYgKCh2YXIxICYgKChXb3JkMTYpIDEgPDwgKHZhcjIgLSAxKSkpICE9IDApCi0gICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgdmFyX291dCsrOwotICAgICAgICAgICAgfQotICAgICAgICB9Ci0gICAgfQotCi0gICAgcmV0dXJuICh2YXJfb3V0KTsKLX0KLSNlbmRpZgotCi0vKl9fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fXwotIHwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8Ci0gfCAgIEZ1bmN0aW9uIE5hbWUgOiBtYWNfciAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwKLSB8ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfAotIHwgICBQdXJwb3NlIDogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8Ci0gfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwKLSB8ICAgTXVsdGlwbHkgdmFyMSBieSB2YXIyIGFuZCBzaGlmdCB0aGUgcmVzdWx0IGxlZnQgYnkgMS4gQWRkIHRoZSAzMiBiaXQgICAgfAotIHwgICByZXN1bHQgdG8gTF92YXIzIHdpdGggc2F0dXJhdGlvbi4gUm91bmQgdGhlIExTIDE2IGJpdHMgb2YgdGhlIHJlc3VsdCAgICB8Ci0gfCAgIGludG8gdGhlIE1TIDE2IGJpdHMgd2l0aCBzYXR1cmF0aW9uIGFuZCBzaGlmdCB0aGUgcmVzdWx0IHJpZ2h0IGJ5IDE2LiAgIHwKLSB8ICAgUmV0dXJuIGEgMTYgYml0IHJlc3VsdC4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfAotIHwgICAgICAgICAgICBtYWNfcihMX3ZhcjMsdmFyMSx2YXIyKSA9IHJvdW5kKExfbWFjKExfdmFyMyx2YXIxLHZhcjIpKSAgICAgICB8Ci0gfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwKLSB8ICAgQ29tcGxleGl0eSB3ZWlnaHQgOiAyICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfAotIHwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8Ci0gfCAgIElucHV0cyA6ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwKLSB8ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfAotIHwgICAgTF92YXIzICAgMzIgYml0IGxvbmcgc2lnbmVkIGludGVnZXIgKFdvcmQzMikgd2hvc2UgdmFsdWUgZmFsbHMgaW4gdGhlICB8Ci0gfCAgICAgICAgICAgICByYW5nZSA6IDB4ODAwMCAwMDAwIDw9IExfdmFyMyA8PSAweDdmZmYgZmZmZi4gICAgICAgICAgICAgICAgIHwKLSB8ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfAotIHwgICAgdmFyMSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8Ci0gfCAgICAgICAgICAgICAxNiBiaXQgc2hvcnQgc2lnbmVkIGludGVnZXIgKFdvcmQxNikgd2hvc2UgdmFsdWUgZmFsbHMgaW4gdGhlIHwKLSB8ICAgICAgICAgICAgIHJhbmdlIDogMHhmZmZmIDgwMDAgPD0gdmFyMSA8PSAweDAwMDAgN2ZmZi4gICAgICAgICAgICAgICAgICAgfAotIHwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8Ci0gfCAgICB2YXIyICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwKLSB8ICAgICAgICAgICAgIDE2IGJpdCBzaG9ydCBzaWduZWQgaW50ZWdlciAoV29yZDE2KSB3aG9zZSB2YWx1ZSBmYWxscyBpbiB0aGUgfAotIHwgICAgICAgICAgICAgcmFuZ2UgOiAweGZmZmYgODAwMCA8PSB2YXIxIDw9IDB4MDAwMCA3ZmZmLiAgICAgICAgICAgICAgICAgICB8Ci0gfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwKLSB8ICAgT3V0cHV0cyA6ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfAotIHwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8Ci0gfCAgICBub25lICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwKLSB8ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfAotIHwgICBSZXR1cm4gVmFsdWUgOiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8Ci0gfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwKLSB8ICAgIHZhcl9vdXQgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfAotIHwgICAgICAgICAgICAgMTYgYml0IHNob3J0IHNpZ25lZCBpbnRlZ2VyIChXb3JkMTYpIHdob3NlIHZhbHVlIGZhbGxzIGluIHRoZSB8Ci0gfCAgICAgICAgICAgICByYW5nZSA6IDB4MDAwMCA4MDAwIDw9IExfdmFyX291dCA8PSAweDAwMDAgN2ZmZi4gICAgICAgICAgICAgIHwKLSB8X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19ffAotKi8KLSNpZiAoIU1BQ19SX0lTX0lOTElORSkKLVdvcmQxNiBtYWNfciAoV29yZDMyIExfdmFyMywgV29yZDE2IHZhcjEsIFdvcmQxNiB2YXIyKQotewotICAgIFdvcmQxNiB2YXJfb3V0OwotCi0gICAgTF92YXIzID0gTF9tYWMgKExfdmFyMywgdmFyMSwgdmFyMik7Ci0gICAgTF92YXIzID0gTF9hZGQgKExfdmFyMywgKFdvcmQzMikgMHgwMDAwODAwMEwpOwotICAgIHZhcl9vdXQgPSBleHRyYWN0X2ggKExfdmFyMyk7Ci0KLSAgICByZXR1cm4gKHZhcl9vdXQpOwotfQotI2VuZGlmCi0KLS8qX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fCi0gfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwKLSB8ICAgRnVuY3Rpb24gTmFtZSA6IG1zdV9yICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfAotIHwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8Ci0gfCAgIFB1cnBvc2UgOiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwKLSB8ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfAotIHwgICBNdWx0aXBseSB2YXIxIGJ5IHZhcjIgYW5kIHNoaWZ0IHRoZSByZXN1bHQgbGVmdCBieSAxLiBTdWJ0cmFjdCB0aGUgMzIgICB8Ci0gfCAgIGJpdCByZXN1bHQgdG8gTF92YXIzIHdpdGggc2F0dXJhdGlvbi4gUm91bmQgdGhlIExTIDE2IGJpdHMgb2YgdGhlIHJlcy0gIHwKLSB8ICAgdWx0IGludG8gdGhlIE1TIDE2IGJpdHMgd2l0aCBzYXR1cmF0aW9uIGFuZCBzaGlmdCB0aGUgcmVzdWx0IHJpZ2h0IGJ5ICAgfAotIHwgICAxNi4gUmV0dXJuIGEgMTYgYml0IHJlc3VsdC4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8Ci0gfCAgICAgICAgICAgIG1zdV9yKExfdmFyMyx2YXIxLHZhcjIpID0gcm91bmQoTF9tc3UoTF92YXIzLHZhcjEsdmFyMikpICAgICAgIHwKLSB8ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfAotIHwgICBDb21wbGV4aXR5IHdlaWdodCA6IDIgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8Ci0gfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwKLSB8ICAgSW5wdXRzIDogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfAotIHwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8Ci0gfCAgICBMX3ZhcjMgICAzMiBiaXQgbG9uZyBzaWduZWQgaW50ZWdlciAoV29yZDMyKSB3aG9zZSB2YWx1ZSBmYWxscyBpbiB0aGUgIHwKLSB8ICAgICAgICAgICAgIHJhbmdlIDogMHg4MDAwIDAwMDAgPD0gTF92YXIzIDw9IDB4N2ZmZiBmZmZmLiAgICAgICAgICAgICAgICAgfAotIHwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8Ci0gfCAgICB2YXIxICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwKLSB8ICAgICAgICAgICAgIDE2IGJpdCBzaG9ydCBzaWduZWQgaW50ZWdlciAoV29yZDE2KSB3aG9zZSB2YWx1ZSBmYWxscyBpbiB0aGUgfAotIHwgICAgICAgICAgICAgcmFuZ2UgOiAweGZmZmYgODAwMCA8PSB2YXIxIDw9IDB4MDAwMCA3ZmZmLiAgICAgICAgICAgICAgICAgICB8Ci0gfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwKLSB8ICAgIHZhcjIgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfAotIHwgICAgICAgICAgICAgMTYgYml0IHNob3J0IHNpZ25lZCBpbnRlZ2VyIChXb3JkMTYpIHdob3NlIHZhbHVlIGZhbGxzIGluIHRoZSB8Ci0gfCAgICAgICAgICAgICByYW5nZSA6IDB4ZmZmZiA4MDAwIDw9IHZhcjEgPD0gMHgwMDAwIDdmZmYuICAgICAgICAgICAgICAgICAgIHwKLSB8ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfAotIHwgICBPdXRwdXRzIDogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8Ci0gfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwKLSB8ICAgIG5vbmUgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfAotIHwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8Ci0gfCAgIFJldHVybiBWYWx1ZSA6ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwKLSB8ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfAotIHwgICAgdmFyX291dCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8Ci0gfCAgICAgICAgICAgICAxNiBiaXQgc2hvcnQgc2lnbmVkIGludGVnZXIgKFdvcmQxNikgd2hvc2UgdmFsdWUgZmFsbHMgaW4gdGhlIHwKLSB8ICAgICAgICAgICAgIHJhbmdlIDogMHgwMDAwIDgwMDAgPD0gTF92YXJfb3V0IDw9IDB4MDAwMCA3ZmZmLiAgICAgICAgICAgICAgfAotIHxfX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX198Ci0qLwotI2lmICghTVNVX1JfSVNfSU5MSU5FKQotV29yZDE2IG1zdV9yIChXb3JkMzIgTF92YXIzLCBXb3JkMTYgdmFyMSwgV29yZDE2IHZhcjIpCi17Ci0gICAgV29yZDE2IHZhcl9vdXQ7Ci0KLSAgICBMX3ZhcjMgPSBMX21zdSAoTF92YXIzLCB2YXIxLCB2YXIyKTsKLSAgICBMX3ZhcjMgPSBMX2FkZCAoTF92YXIzLCAoV29yZDMyKSAweDAwMDA4MDAwTCk7Ci0gICAgdmFyX291dCA9IGV4dHJhY3RfaCAoTF92YXIzKTsKLQotICAgIHJldHVybiAodmFyX291dCk7Ci19Ci0jZW5kaWYKLQotLypfX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX18KLSB8ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfAotIHwgICBGdW5jdGlvbiBOYW1lIDogTF9kZXBvc2l0X2ggICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8Ci0gfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwKLSB8ICAgUHVycG9zZSA6ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfAotIHwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8Ci0gfCAgIERlcG9zaXQgdGhlIDE2IGJpdCB2YXIxIGludG8gdGhlIDE2IE1TIGJpdHMgb2YgdGhlIDMyIGJpdCBvdXRwdXQuIFRoZSAgIHwKLSB8ICAgMTYgTFMgYml0cyBvZiB0aGUgb3V0cHV0IGFyZSB6ZXJvZWQuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfAotIHwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8Ci0gfCAgIENvbXBsZXhpdHkgd2VpZ2h0IDogMiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwKLSB8ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfAotIHwgICBJbnB1dHMgOiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8Ci0gfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwKLSB8ICAgIHZhcjEgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfAotIHwgICAgICAgICAgICAgMTYgYml0IHNob3J0IHNpZ25lZCBpbnRlZ2VyIChXb3JkMTYpIHdob3NlIHZhbHVlIGZhbGxzIGluIHRoZSB8Ci0gfCAgICAgICAgICAgICByYW5nZSA6IDB4ZmZmZiA4MDAwIDw9IHZhcjEgPD0gMHgwMDAwIDdmZmYuICAgICAgICAgICAgICAgICAgIHwKLSB8ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfAotIHwgICBPdXRwdXRzIDogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8Ci0gfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwKLSB8ICAgIG5vbmUgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfAotIHwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8Ci0gfCAgIFJldHVybiBWYWx1ZSA6ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwKLSB8ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfAotIHwgICAgTF92YXJfb3V0ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8Ci0gfCAgICAgICAgICAgICAzMiBiaXQgbG9uZyBzaWduZWQgaW50ZWdlciAoV29yZDMyKSB3aG9zZSB2YWx1ZSBmYWxscyBpbiB0aGUgIHwKLSB8ICAgICAgICAgICAgIHJhbmdlIDogMHg4MDAwIDAwMDAgPD0gdmFyX291dCA8PSAweDdmZmYgMDAwMC4gICAgICAgICAgICAgICAgfAotIHxfX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX198Ci0qLwotLy9Xb3JkMzIgTF9kZXBvc2l0X2ggKFdvcmQxNiB2YXIxKQotLy97Ci0vLyAgICBXb3JkMzIgTF92YXJfb3V0OwotLy8KLS8vICAgIExfdmFyX291dCA9IChXb3JkMzIpIHZhcjEgPDwgMTY7Ci0vLwotLy8gICAgcmV0dXJuIChMX3Zhcl9vdXQpOwotLy99Ci0KLQotLypfX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX18KLSB8ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfAotIHwgICBGdW5jdGlvbiBOYW1lIDogTF9kZXBvc2l0X2wgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8Ci0gfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwKLSB8ICAgUHVycG9zZSA6ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfAotIHwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8Ci0gfCAgIERlcG9zaXQgdGhlIDE2IGJpdCB2YXIxIGludG8gdGhlIDE2IExTIGJpdHMgb2YgdGhlIDMyIGJpdCBvdXRwdXQuIFRoZSAgIHwKLSB8ICAgMTYgTVMgYml0cyBvZiB0aGUgb3V0cHV0IGFyZSBzaWduIGV4dGVuZGVkLiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfAotIHwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8Ci0gfCAgIENvbXBsZXhpdHkgd2VpZ2h0IDogMiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwKLSB8ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfAotIHwgICBJbnB1dHMgOiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8Ci0gfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwKLSB8ICAgIHZhcjEgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfAotIHwgICAgICAgICAgICAgMTYgYml0IHNob3J0IHNpZ25lZCBpbnRlZ2VyIChXb3JkMTYpIHdob3NlIHZhbHVlIGZhbGxzIGluIHRoZSB8Ci0gfCAgICAgICAgICAgICByYW5nZSA6IDB4ZmZmZiA4MDAwIDw9IHZhcjEgPD0gMHgwMDAwIDdmZmYuICAgICAgICAgICAgICAgICAgIHwKLSB8ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfAotIHwgICBPdXRwdXRzIDogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8Ci0gfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwKLSB8ICAgIG5vbmUgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfAotIHwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8Ci0gfCAgIFJldHVybiBWYWx1ZSA6ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwKLSB8ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfAotIHwgICAgTF92YXJfb3V0ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8Ci0gfCAgICAgICAgICAgICAzMiBiaXQgbG9uZyBzaWduZWQgaW50ZWdlciAoV29yZDMyKSB3aG9zZSB2YWx1ZSBmYWxscyBpbiB0aGUgIHwKLSB8ICAgICAgICAgICAgIHJhbmdlIDogMHhGRkZGIDgwMDAgPD0gdmFyX291dCA8PSAweDAwMDAgN2ZmZi4gICAgICAgICAgICAgICAgfAotIHxfX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX198Ci0qLwotLy9Xb3JkMzIgTF9kZXBvc2l0X2wgKFdvcmQxNiB2YXIxKQotLy97Ci0vLyAgICBXb3JkMzIgTF92YXJfb3V0OwotLy8KLS8vICAgIExfdmFyX291dCA9IChXb3JkMzIpIHZhcjE7Ci0vLwotLy8gICAgcmV0dXJuIChMX3Zhcl9vdXQpOwotLy99Ci0KLQotLypfX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX18KLSB8ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfAotIHwgICBGdW5jdGlvbiBOYW1lIDogTF9zaHJfciAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8Ci0gfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwKLSB8ICAgUHVycG9zZSA6ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfAotIHwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8Ci0gfCAgIFNhbWUgYXMgTF9zaHIoTF92YXIxLHZhcjIpIGJ1dCB3aXRoIHJvdW5kaW5nLiBTYXR1cmF0ZSB0aGUgcmVzdWx0IGluICAgIHwKLSB8ICAgY2FzZSBvZiB1bmRlcmZsb3dzIG9yIG92ZXJmbG93cyA6ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfAotIHwgICAgLSBJZiB2YXIyIGlzIGdyZWF0ZXIgdGhhbiB6ZXJvIDogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8Ci0gfCAgICAgICAgICBpZiAoTF9zdWIoTF9zaGwoTF9zaHIoTF92YXIxLHZhcjIpLDEpLExfc2hyKExfdmFyMSxzdWIodmFyMiwxKSkpKXwKLSB8ICAgICAgICAgIGlzIGVxdWFsIHRvIHplcm8gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfAotIHwgICAgICAgICAgICAgICAgICAgICB0aGVuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8Ci0gfCAgICAgICAgICAgICAgICAgICAgIExfc2hyX3IoTF92YXIxLHZhcjIpID0gTF9zaHIoTF92YXIxLHZhcjIpICAgICAgICAgICAgIHwKLSB8ICAgICAgICAgICAgICAgICAgICAgZWxzZSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfAotIHwgICAgICAgICAgICAgICAgICAgICBMX3Nocl9yKExfdmFyMSx2YXIyKSA9IExfYWRkKExfc2hyKExfdmFyMSx2YXIyKSwxKSAgICB8Ci0gfCAgICAtIElmIHZhcjIgaXMgbGVzcyB0aGFuIG9yIGVxdWFsIHRvIHplcm8gOiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwKLSB8ICAgICAgICAgICAgICAgICAgICAgTF9zaHJfcihMX3ZhcjEsdmFyMikgPSBMX3NocihMX3ZhcjEsdmFyMikuICAgICAgICAgICAgfAotIHwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8Ci0gfCAgIENvbXBsZXhpdHkgd2VpZ2h0IDogMyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwKLSB8ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfAotIHwgICBJbnB1dHMgOiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8Ci0gfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwKLSB8ICAgIExfdmFyMSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfAotIHwgICAgICAgICAgICAgMzIgYml0IGxvbmcgc2lnbmVkIGludGVnZXIgKFdvcmQzMikgd2hvc2UgdmFsdWUgZmFsbHMgaW4gdGhlICB8Ci0gfCAgICAgICAgICAgICByYW5nZSA6IDB4ODAwMCAwMDAwIDw9IHZhcjEgPD0gMHg3ZmZmIGZmZmYuICAgICAgICAgICAgICAgICAgIHwKLSB8ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfAotIHwgICAgdmFyMiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8Ci0gfCAgICAgICAgICAgICAxNiBiaXQgc2hvcnQgc2lnbmVkIGludGVnZXIgKFdvcmQxNikgd2hvc2UgdmFsdWUgZmFsbHMgaW4gdGhlIHwKLSB8ICAgICAgICAgICAgIHJhbmdlIDogMHhmZmZmIDgwMDAgPD0gdmFyMSA8PSAweDAwMDAgN2ZmZi4gICAgICAgICAgICAgICAgICAgfAotIHwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8Ci0gfCAgIE91dHB1dHMgOiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwKLSB8ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfAotIHwgICAgbm9uZSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8Ci0gfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwKLSB8ICAgUmV0dXJuIFZhbHVlIDogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfAotIHwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8Ci0gfCAgICBMX3Zhcl9vdXQgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwKLSB8ICAgICAgICAgICAgIDMyIGJpdCBsb25nIHNpZ25lZCBpbnRlZ2VyIChXb3JkMzIpIHdob3NlIHZhbHVlIGZhbGxzIGluIHRoZSAgfAotIHwgICAgICAgICAgICAgcmFuZ2UgOiAweDgwMDAgMDAwMCA8PSB2YXJfb3V0IDw9IDB4N2ZmZiBmZmZmLiAgICAgICAgICAgICAgICB8Ci0gfF9fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX3wKLSovCi0jaWYgKCFMX1NIUl9SX0lTX0lOTElORSkKLVdvcmQzMiBMX3Nocl9yIChXb3JkMzIgTF92YXIxLCBXb3JkMTYgdmFyMikKLXsKLSAgICBXb3JkMzIgTF92YXJfb3V0OwotCi0gICAgaWYgKHZhcjIgPiAzMSkKLSAgICB7Ci0gICAgICAgIExfdmFyX291dCA9IDA7Ci0gICAgfQotICAgIGVsc2UKLSAgICB7Ci0gICAgICAgIExfdmFyX291dCA9IExfc2hyIChMX3ZhcjEsIHZhcjIpOwotCi0gICAgICAgIGlmICh2YXIyID4gMCkKLSAgICAgICAgewotICAgICAgICAgICAgaWYgKChMX3ZhcjEgJiAoKFdvcmQzMikgMSA8PCAodmFyMiAtIDEpKSkgIT0gMCkKLSAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICBMX3Zhcl9vdXQrKzsKLSAgICAgICAgICAgIH0KLSAgICAgICAgfQotICAgIH0KLQotICAgIHJldHVybiAoTF92YXJfb3V0KTsKLX0KLSNlbmRpZgotCi0vKl9fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fXwotIHwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8Ci0gfCAgIEZ1bmN0aW9uIE5hbWUgOiBMX2FicyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwKLSB8ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfAotIHwgICBQdXJwb3NlIDogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8Ci0gfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwKLSB8ICAgIEFic29sdXRlIHZhbHVlIG9mIExfdmFyMTsgU2F0dXJhdGUgaW4gY2FzZSB3aGVyZSB0aGUgaW5wdXQgaXMgICAgICAgICAgfAotIHwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAtMjE0NzgzNjQ4ICB8Ci0gfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwKLSB8ICAgQ29tcGxleGl0eSB3ZWlnaHQgOiAzICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfAotIHwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8Ci0gfCAgIElucHV0cyA6ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwKLSB8ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfAotIHwgICAgTF92YXIxICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8Ci0gfCAgICAgICAgICAgICAzMiBiaXQgbG9uZyBzaWduZWQgaW50ZWdlciAoV29yZDMyKSB3aG9zZSB2YWx1ZSBmYWxscyBpbiB0aGUgIHwKLSB8ICAgICAgICAgICAgIHJhbmdlIDogMHg4MDAwIDAwMDAgPD0gdmFyMSA8PSAweDdmZmYgZmZmZi4gICAgICAgICAgICAgICAgICAgfAotIHwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8Ci0gfCAgIE91dHB1dHMgOiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwKLSB8ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfAotIHwgICAgbm9uZSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8Ci0gfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwKLSB8ICAgUmV0dXJuIFZhbHVlIDogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfAotIHwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8Ci0gfCAgICBMX3Zhcl9vdXQgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwKLSB8ICAgICAgICAgICAgIDMyIGJpdCBsb25nIHNpZ25lZCBpbnRlZ2VyIChXb3JkMzIpIHdob3NlIHZhbHVlIGZhbGxzIGluIHRoZSAgfAotIHwgICAgICAgICAgICAgcmFuZ2UgOiAweDAwMDAgMDAwMCA8PSB2YXJfb3V0IDw9IDB4N2ZmZiBmZmZmLiAgICAgICAgICAgICAgICB8Ci0gfF9fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX3wKLSovCi0vL1dvcmQzMiBMX2FicyAoV29yZDMyIExfdmFyMSkKLS8vewotLy8gICAgV29yZDMyIExfdmFyX291dDsKLS8vCi0vLyAgICBpZiAoTF92YXIxID09IE1JTl8zMikKLS8vICAgIHsKLS8vICAgICAgICBMX3Zhcl9vdXQgPSBNQVhfMzI7Ci0vLyAgICB9Ci0vLyAgICBlbHNlCi0vLyAgICB7Ci0vLyAgICAgICAgaWYgKExfdmFyMSA8IDApCi0vLyAgICAgICAgewotLy8gICAgICAgICAgICBMX3Zhcl9vdXQgPSAtTF92YXIxOwotLy8gICAgICAgIH0KLS8vICAgICAgICBlbHNlCi0vLyAgICAgICAgewotLy8gICAgICAgICAgICBMX3Zhcl9vdXQgPSBMX3ZhcjE7Ci0vLyAgICAgICAgfQotLy8gICAgfQotLy8KLS8vICAgIHJldHVybiAoTF92YXJfb3V0KTsKLS8vfQotCi0vKl9fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fXwotIHwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8Ci0gfCAgIEZ1bmN0aW9uIE5hbWUgOiBub3JtX3MgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwKLSB8ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfAotIHwgICBQdXJwb3NlIDogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8Ci0gfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwKLSB8ICAgUHJvZHVjZXMgdGhlIG51bWJlciBvZiBsZWZ0IHNoaWZ0IG5lZWRlZCB0byBub3JtYWxpemUgdGhlIDE2IGJpdCB2YXJpYS0gfAotIHwgICBibGUgdmFyMSBmb3IgcG9zaXRpdmUgdmFsdWVzIG9uIHRoZSBpbnRlcnZhbCB3aXRoIG1pbmltdW0gb2YgMTYzODQgYW5kICB8Ci0gfCAgIG1heGltdW0gb2YgMzI3NjcsIGFuZCBmb3IgbmVnYXRpdmUgdmFsdWVzIG9uIHRoZSBpbnRlcnZhbCB3aXRoIG1pbmltdW0gIHwKLSB8ICAgb2YgLTMyNzY4IGFuZCBtYXhpbXVtIG9mIC0xNjM4NDsgaW4gb3JkZXIgdG8gbm9ybWFsaXplIHRoZSByZXN1bHQsIHRoZSAgfAotIHwgICBmb2xsb3dpbmcgb3BlcmF0aW9uIG11c3QgYmUgZG9uZSA6ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8Ci0gfCAgICAgICAgICAgICAgICAgICAgbm9ybV92YXIxID0gc2hsKHZhcjEsbm9ybV9zKHZhcjEpKS4gICAgICAgICAgICAgICAgICAgIHwKLSB8ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfAotIHwgICBDb21wbGV4aXR5IHdlaWdodCA6IDE1ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8Ci0gfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwKLSB8ICAgSW5wdXRzIDogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfAotIHwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8Ci0gfCAgICB2YXIxICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwKLSB8ICAgICAgICAgICAgIDE2IGJpdCBzaG9ydCBzaWduZWQgaW50ZWdlciAoV29yZDE2KSB3aG9zZSB2YWx1ZSBmYWxscyBpbiB0aGUgfAotIHwgICAgICAgICAgICAgcmFuZ2UgOiAweGZmZmYgODAwMCA8PSB2YXIxIDw9IDB4MDAwMCA3ZmZmLiAgICAgICAgICAgICAgICAgICB8Ci0gfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwKLSB8ICAgT3V0cHV0cyA6ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfAotIHwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8Ci0gfCAgICBub25lICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwKLSB8ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfAotIHwgICBSZXR1cm4gVmFsdWUgOiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8Ci0gfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwKLSB8ICAgIHZhcl9vdXQgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfAotIHwgICAgICAgICAgICAgMTYgYml0IHNob3J0IHNpZ25lZCBpbnRlZ2VyIChXb3JkMTYpIHdob3NlIHZhbHVlIGZhbGxzIGluIHRoZSB8Ci0gfCAgICAgICAgICAgICByYW5nZSA6IDB4MDAwMCAwMDAwIDw9IHZhcl9vdXQgPD0gMHgwMDAwIDAwMGYuICAgICAgICAgICAgICAgIHwKLSB8X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19ffAotKi8KLQotI2lmICghTk9STV9TX0lTX0lOTElORSkKLVdvcmQxNiBub3JtX3MgKFdvcmQxNiB2YXIxKQotewotICAgIFdvcmQxNiB2YXJfb3V0OwotCi0gICAgaWYgKHZhcjEgPT0gMCkKLSAgICB7Ci0gICAgICAgIHZhcl9vdXQgPSAwOwotICAgIH0KLSAgICBlbHNlCi0gICAgewotICAgICAgICBpZiAodmFyMSA9PSAtMSkKLSAgICAgICAgewotICAgICAgICAgICAgdmFyX291dCA9IDE1OwotICAgICAgICB9Ci0gICAgICAgIGVsc2UKLSAgICAgICAgewotICAgICAgICAgICAgaWYgKHZhcjEgPCAwKQotICAgICAgICAgICAgewotICAgICAgICAgICAgICAgIHZhcjEgPSAoV29yZDE2KX52YXIxOwotICAgICAgICAgICAgfQotICAgICAgICAgICAgZm9yICh2YXJfb3V0ID0gMDsgdmFyMSA8IDB4NDAwMDsgdmFyX291dCsrKQotICAgICAgICAgICAgewotICAgICAgICAgICAgICAgIHZhcjEgPDw9IDE7Ci0gICAgICAgICAgICB9Ci0gICAgICAgIH0KLSAgICB9Ci0KLSAgICByZXR1cm4gKHZhcl9vdXQpOwotfQotI2VuZGlmCi0KLS8qX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fCi0gfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwKLSB8ICAgRnVuY3Rpb24gTmFtZSA6IGRpdl9zICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfAotIHwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8Ci0gfCAgIFB1cnBvc2UgOiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwKLSB8ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfAotIHwgICBQcm9kdWNlcyBhIHJlc3VsdCB3aGljaCBpcyB0aGUgZnJhY3Rpb25hbCBpbnRlZ2VyIGRpdmlzaW9uIG9mIHZhcjEgIGJ5ICB8Ci0gfCAgIHZhcjI7IHZhcjEgYW5kIHZhcjIgbXVzdCBiZSBwb3NpdGl2ZSBhbmQgdmFyMiBtdXN0IGJlIGdyZWF0ZXIgb3IgZXF1YWwgIHwKLSB8ICAgdG8gdmFyMTsgdGhlIHJlc3VsdCBpcyBwb3NpdGl2ZSAobGVhZGluZyBiaXQgZXF1YWwgdG8gMCkgYW5kIHRydW5jYXRlZCAgfAotIHwgICB0byAxNiBiaXRzLiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8Ci0gfCAgIElmIHZhcjEgPSB2YXIyIHRoZW4gZGl2KHZhcjEsdmFyMikgPSAzMjc2Ny4gICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwKLSB8ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfAotIHwgICBDb21wbGV4aXR5IHdlaWdodCA6IDE4ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8Ci0gfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwKLSB8ICAgSW5wdXRzIDogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfAotIHwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8Ci0gfCAgICB2YXIxICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwKLSB8ICAgICAgICAgICAgIDE2IGJpdCBzaG9ydCBzaWduZWQgaW50ZWdlciAoV29yZDE2KSB3aG9zZSB2YWx1ZSBmYWxscyBpbiB0aGUgfAotIHwgICAgICAgICAgICAgcmFuZ2UgOiAweDAwMDAgMDAwMCA8PSB2YXIxIDw9IHZhcjIgYW5kIHZhcjIgIT0gMC4gICAgICAgICAgICB8Ci0gfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwKLSB8ICAgIHZhcjIgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfAotIHwgICAgICAgICAgICAgMTYgYml0IHNob3J0IHNpZ25lZCBpbnRlZ2VyIChXb3JkMTYpIHdob3NlIHZhbHVlIGZhbGxzIGluIHRoZSB8Ci0gfCAgICAgICAgICAgICByYW5nZSA6IHZhcjEgPD0gdmFyMiA8PSAweDAwMDAgN2ZmZiBhbmQgdmFyMiAhPSAwLiAgICAgICAgICAgIHwKLSB8ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfAotIHwgICBPdXRwdXRzIDogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8Ci0gfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwKLSB8ICAgIG5vbmUgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfAotIHwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8Ci0gfCAgIFJldHVybiBWYWx1ZSA6ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwKLSB8ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfAotIHwgICAgdmFyX291dCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8Ci0gfCAgICAgICAgICAgICAxNiBiaXQgc2hvcnQgc2lnbmVkIGludGVnZXIgKFdvcmQxNikgd2hvc2UgdmFsdWUgZmFsbHMgaW4gdGhlIHwKLSB8ICAgICAgICAgICAgIHJhbmdlIDogMHgwMDAwIDAwMDAgPD0gdmFyX291dCA8PSAweDAwMDAgN2ZmZi4gICAgICAgICAgICAgICAgfAotIHwgICAgICAgICAgICAgSXQncyBhIFExNSB2YWx1ZSAocG9pbnQgYmV0d2VlbiBiMTUgYW5kIGIxNCkuICAgICAgICAgICAgICAgICB8Ci0gfF9fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX3wKLSovCi0KLSNpZiAoIURJVl9TX0lTX0lOTElORSkKLVdvcmQxNiBkaXZfcyAoV29yZDE2IHZhcjEsIFdvcmQxNiB2YXIyKQotewotICAgIFdvcmQxNiB2YXJfb3V0ID0gMDsKLSAgICBXb3JkMTYgaXRlcmF0aW9uOwotICAgIFdvcmQzMiBMX251bTsKLSAgICBXb3JkMzIgTF9kZW5vbTsKLQotICAgIGlmICh2YXIxID09IDApCi0gICAgewotICAgICAgICB2YXJfb3V0ID0gMDsKLSAgICB9Ci0gICAgZWxzZQotICAgIHsKLSAgICAgICAgaWYgKHZhcjEgPT0gdmFyMikKLSAgICAgICAgewotICAgICAgICAgICAgdmFyX291dCA9IE1BWF8xNjsKLSAgICAgICAgfQotICAgICAgICBlbHNlCi0gICAgICAgIHsKLSAgICAgICAgICAgIExfbnVtID0gTF9kZXBvc2l0X2wgKHZhcjEpOwotICAgICAgICAgICAgTF9kZW5vbSA9IExfZGVwb3NpdF9sICh2YXIyKTsKLQotICAgICAgICAgICAgZm9yIChpdGVyYXRpb24gPSAwOyBpdGVyYXRpb24gPCAxNTsgaXRlcmF0aW9uKyspCi0gICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgdmFyX291dCA8PD0gMTsKLSAgICAgICAgICAgICAgICBMX251bSA8PD0gMTsKLQotICAgICAgICAgICAgICAgIGlmIChMX251bSA+PSBMX2Rlbm9tKQotICAgICAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAgICAgTF9udW0gPSBMX3N1YihMX251bSwgTF9kZW5vbSk7Ci0gICAgICAgICAgICAgICAgICAgIHZhcl9vdXQgPSBhZGQgKHZhcl9vdXQsIDEpOwotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgIH0KLSAgICAgICAgfQotICAgIH0KLQotICAgIHJldHVybiAodmFyX291dCk7Ci19Ci0jZW5kaWYKLQotLypfX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX18KLSB8ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfAotIHwgICBGdW5jdGlvbiBOYW1lIDogbm9ybV9sICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8Ci0gfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwKLSB8ICAgUHVycG9zZSA6ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfAotIHwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8Ci0gfCAgIFByb2R1Y2VzIHRoZSBudW1iZXIgb2YgbGVmdCBzaGlmdHMgbmVlZGVkIHRvIG5vcm1hbGl6ZSB0aGUgMzIgYml0IHZhcmlhLXwKLSB8ICAgYmxlIExfdmFyMSBmb3IgcG9zaXRpdmUgdmFsdWVzIG9uIHRoZSBpbnRlcnZhbCB3aXRoIG1pbmltdW0gb2YgICAgICAgICAgfAotIHwgICAxMDczNzQxODI0IGFuZCBtYXhpbXVtIG9mIDIxNDc0ODM2NDcsIGFuZCBmb3IgbmVnYXRpdmUgdmFsdWVzIG9uIHRoZSBpbi18Ci0gfCAgIHRlcnZhbCB3aXRoIG1pbmltdW0gb2YgLTIxNDc0ODM2NDggYW5kIG1heGltdW0gb2YgLTEwNzM3NDE4MjQ7IGluIG9yZGVyIHwKLSB8ICAgdG8gbm9ybWFsaXplIHRoZSByZXN1bHQsIHRoZSBmb2xsb3dpbmcgb3BlcmF0aW9uIG11c3QgYmUgZG9uZSA6ICAgICAgICAgfAotIHwgICAgICAgICAgICAgICAgICAgbm9ybV9MX3ZhcjEgPSBMX3NobChMX3ZhcjEsbm9ybV9sKExfdmFyMSkpLiAgICAgICAgICAgICB8Ci0gfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwKLSB8ICAgQ29tcGxleGl0eSB3ZWlnaHQgOiAzMCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfAotIHwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8Ci0gfCAgIElucHV0cyA6ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwKLSB8ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfAotIHwgICAgTF92YXIxICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8Ci0gfCAgICAgICAgICAgICAzMiBiaXQgbG9uZyBzaWduZWQgaW50ZWdlciAoV29yZDMyKSB3aG9zZSB2YWx1ZSBmYWxscyBpbiB0aGUgIHwKLSB8ICAgICAgICAgICAgIHJhbmdlIDogMHg4MDAwIDAwMDAgPD0gdmFyMSA8PSAweDdmZmYgZmZmZi4gICAgICAgICAgICAgICAgICAgfAotIHwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8Ci0gfCAgIE91dHB1dHMgOiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwKLSB8ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfAotIHwgICAgbm9uZSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8Ci0gfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwKLSB8ICAgUmV0dXJuIFZhbHVlIDogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfAotIHwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8Ci0gfCAgICB2YXJfb3V0ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwKLSB8ICAgICAgICAgICAgIDE2IGJpdCBzaG9ydCBzaWduZWQgaW50ZWdlciAoV29yZDE2KSB3aG9zZSB2YWx1ZSBmYWxscyBpbiB0aGUgfAotIHwgICAgICAgICAgICAgcmFuZ2UgOiAweDAwMDAgMDAwMCA8PSB2YXJfb3V0IDw9IDB4MDAwMCAwMDFmLiAgICAgICAgICAgICAgICB8Ci0gfF9fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX3wKLSovCi0KLSNpZiAoIU5PUk1fTF9JU19JTkxJTkUpCi1Xb3JkMTYgbm9ybV9sIChXb3JkMzIgTF92YXIxKQotewotICAgIFdvcmQxNiB2YXJfb3V0OwotCi0gICAgaWYgKExfdmFyMSA9PSAwKQotICAgIHsKLSAgICAgICAgdmFyX291dCA9IDA7Ci0gICAgfQotICAgIGVsc2UKLSAgICB7Ci0gICAgICAgIGlmIChMX3ZhcjEgPT0gKFdvcmQzMikgMHhmZmZmZmZmZkwpCi0gICAgICAgIHsKLSAgICAgICAgICAgIHZhcl9vdXQgPSA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ioKLSAqKiAgICAgaHR0cDovL3d3dy5hcGFjaGUub3JnL2xpY2Vuc2VzL0xJQ0VOU0UtMi4wCi0gKioKLSAqKiBVbmxlc3MgcmVxdWlyZWQgYnkgYXBwbGljYWJsZSBsYXcgb3IgYWdyZWVkIHRvIGluIHdyaXRpbmcsIHNvZnR3YXJlCi0gKiogZGlzdHJpYnV0ZWQgdW5kZXIgdGhlIExpY2Vuc2UgaXMgZGlzdHJpYnV0ZWQgb24gYW4gIkFTIElTIiBCQVNJUywKLSAqKiBXSVRIT1VUIFdBUlJBTlRJRVMgT1IgQ09ORElUSU9OUyBPRiBBTlkgS0lORCwgZWl0aGVyIGV4cHJlc3Mgb3IgaW1wbGllZC4KLSAqKiBTZWUgdGhlIExpY2Vuc2UgZm9yIHRoZSBzcGVjaWZpYyBsYW5ndWFnZSBnb3Zlcm5pbmcgcGVybWlzc2lvbnMgYW5kCi0gKiogbGltaXRhdGlvbnMgdW5kZXIgdGhlIExpY2Vuc2UuCi0gKi8KLS8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCi0JRmlsZToJCW9wZXJfMzJiLmMKLQotCUNvbnRlbnQ6CSAgVGhpcyBmaWxlIGNvbnRhaW5zIG9wZXJhdGlvbnMgaW4gZG91YmxlIHByZWNpc2lvbi4KLQotKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLQotI2luY2x1ZGUgInR5cGVkZWYuaCIKLSNpbmNsdWRlICJiYXNpY19vcC5oIgotI2luY2x1ZGUgIm9wZXJfMzJiLmgiCi0KLS8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgotICogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqCi0gKiAgRnVuY3Rpb24gTF9FeHRyYWN0KCkgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICoKLSAqICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKgotICogIEV4dHJhY3QgZnJvbSBhIDMyIGJpdCBpbnRlZ2VyIHR3byAxNiBiaXQgRFBGLiAgICAgICAgICAgICAgICAgICAgICAgICAgICAqCi0gKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICoKLSAqICBBcmd1bWVudHM6ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKgotICogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqCi0gKiAgIExfMzIgICAgICA6IDMyIGJpdCBpbnRlZ2VyLiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICoKLSAqICAgICAgICAgICAgICAgMHg4MDAwIDAwMDAgPD0gTF8zMiA8PSAweDdmZmYgZmZmZi4gICAgICAgICAgICAgICAgICAgICAgICAgKgotICogICBoaSAgICAgICAgOiBiMTYgdG8gYjMxIG9mIExfMzIgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqCi0gKiAgIGxvICAgICAgICA6IChMXzMyIC0gaGk8PDE2KT4+MSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICoKLSAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgotKi8KLQotdm9pZCBMX0V4dHJhY3QgKFdvcmQzMiBMXzMyLCBXb3JkMTYgKmhpLCBXb3JkMTYgKmxvKQotewotICAgICpoaSA9IGV4dHJhY3RfaCAoTF8zMik7Ci0gICAgKmxvID0gZXh0cmFjdF9sIChMX21zdSAoTF9zaHIgKExfMzIsIDEpLCAqaGksIDE2Mzg0KSk7Ci0gICAgcmV0dXJuOwotfQotCi0vKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKLSAqICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKgotICogIEZ1bmN0aW9uIExfQ29tcCgpICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqCi0gKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICoKLSAqICBDb21wb3NlIGZyb20gdHdvIDE2IGJpdCBEUEYgYSAzMiBiaXQgaW50ZWdlci4gICAgICAgICAgICAgICAgICAgICAgICAgICAgKgotICogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqCi0gKiAgICAgTF8zMiA9IGhpPDwxNiArIGxvPDwxICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICoKLSAqICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKgotICogIEFyZ3VtZW50czogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqCi0gKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICoKLSAqICAgaGkgICAgICAgIG1zYiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKgotICogICBsbyAgICAgICAgbHNmICh3aXRoIHNpZ24pICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqCi0gKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICoKLSAqICAgUmV0dXJuIFZhbHVlIDogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKgotICogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqCi0gKiAgICAgICAgICAgICAzMiBiaXQgbG9uZyBzaWduZWQgaW50ZWdlciAoV29yZDMyKSB3aG9zZSB2YWx1ZSBmYWxscyBpbiB0aGUgICoKLSAqICAgICAgICAgICAgIHJhbmdlIDogMHg4MDAwIDAwMDAgPD0gTF8zMiA8PSAweDdmZmYgZmZmMC4gICAgICAgICAgICAgICAgICAgKgotICogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqCi0gKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKLSovCi0KLVdvcmQzMiBMX0NvbXAgKFdvcmQxNiBoaSwgV29yZDE2IGxvKQotewotICAgIFdvcmQzMiBMXzMyOwotCi0gICAgTF8zMiA9IExfZGVwb3NpdF9oIChoaSk7Ci0gICAgcmV0dXJuIChMX21hYyAoTF8zMiwgbG8sIDEpKTsgICAgICAgLyogPSBoaTw8MTYgKyBsbzw8MSAqLwotfQotCi0vKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKLSAqIEZ1bmN0aW9uIE1weV8zMigpICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKgotICogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqCi0gKiAgIE11bHRpcGx5IHR3byAzMiBiaXQgaW50ZWdlcnMgKERQRikuIFRoZSByZXN1bHQgaXMgZGl2aWRlZCBieSAyKiozMSAgICAgICoKLSAqICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKgotICogICBMXzMyID0gKGhpMSpoaTIpPDwxICsgKCAoaGkxKmxvMik+PjE1ICsgKGxvMSpoaTIpPj4xNSApPDwxICAgICAgICAgICAgICAqCi0gKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICoKLSAqICAgVGhpcyBvcGVyYXRpb24gY2FuIGFsc28gYmUgdmlld2VkIGFzIHRoZSBtdWx0aXBsaWNhdGlvbiBvZiB0d28gUTMxICAgICAgKgotICogICBudW1iZXIgYW5kIHRoZSByZXN1bHQgaXMgYWxzbyBpbiBRMzEuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqCi0gKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICoKLSAqIEFyZ3VtZW50czogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKgotICogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqCi0gKiAgaGkxICAgICAgICAgaGkgcGFydCBvZiBmaXJzdCBudW1iZXIgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICoKLSAqICBsbzEgICAgICAgICBsbyBwYXJ0IG9mIGZpcnN0IG51bWJlciAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKgotICogIGhpMiAgICAgICAgIGhpIHBhcnQgb2Ygc2Vjb25kIG51bWJlciAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqCi0gKiAgbG8yICAgICAgICAgbG8gcGFydCBvZiBzZWNvbmQgbnVtYmVyICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICoKLSAqICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKgotICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCi0qLwotCi1Xb3JkMzIgTXB5XzMyIChXb3JkMTYgaGkxLCBXb3JkMTYgbG8xLCBXb3JkMTYgaGkyLCBXb3JkMTYgbG8yKQotewotICAgIFdvcmQzMiBMXzMyOwotCi0gICAgTF8zMiA9IExfbXVsdCAoaGkxLCBoaTIpOwotICAgIExfMzIgPSBMX21hYyAoTF8zMiwgbXVsdCAoaGkxLCBsbzIpLCAxKTsKLSAgICBMXzMyID0gTF9tYWMgKExfMzIsIG11bHQgKGxvMSwgaGkyKSwgMSk7Ci0KLSAgICByZXR1cm4gKExfMzIpOwotfQotCi0vKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKLSAqIEZ1bmN0aW9uIE1weV8zMl8xNigpICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKgotICogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqCi0gKiAgIE11bHRpcGx5IGEgMTYgYml0IGludGVnZXIgYnkgYSAzMiBiaXQgKERQRikuIFRoZSByZXN1bHQgaXMgZGl2aWRlZCAgICAgICoKLSAqICAgYnkgMioqMTUgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKgotICogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqCi0gKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICoKLSAqICAgTF8zMiA9IChoaTEqbG8yKTw8MSArICgobG8xKmxvMik+PjE1KTw8MSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKgotICogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqCi0gKiBBcmd1bWVudHM6ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICoKLSAqICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKgotICogIGhpICAgICAgICAgIGhpIHBhcnQgb2YgMzIgYml0IG51bWJlci4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqCi0gKiAgbG8gICAgICAgICAgbG8gcGFydCBvZiAzMiBiaXQgbnVtYmVyLiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICoKLSAqICBuICAgICAgICAgICAxNiBiaXQgbnVtYmVyLiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKgotICogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqCi0gKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKLSovCi0KLVdvcmQzMiBNcHlfMzJfMTYgKFdvcmQxNiBoaSwgV29yZDE2IGxvLCBXb3JkMTYgbikKLXsKLSAgICBXb3JkMzIgTF8zMjsKLQotICAgIExfMzIgPSBMX211bHQgKGhpLCBuKTsKLSAgICBMXzMyID0gTF9tYWMgKExfMzIsIG11bHQgKGxvLCBuKSwgMSk7Ci0KLSAgICByZXR1cm4gKExfMzIpOwotfQotCi0vKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKLSAqICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKgotICogICBGdW5jdGlvbiBOYW1lIDogRGl2XzMyICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqCi0gKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICoKLSAqICAgUHVycG9zZSA6ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKgotICogICAgICAgICAgICAgRnJhY3Rpb25hbCBpbnRlZ2VyIGRpdmlzaW9uIG9mIHR3byAzMiBiaXQgbnVtYmVycy4gICAgICAgICAgICAqCi0gKiAgICAgICAgICAgICBMX251bSAvIExfZGVub20uICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICoKLSAqICAgICAgICAgICAgIExfbnVtIGFuZCBMX2Rlbm9tIG11c3QgYmUgcG9zaXRpdmUgYW5kIExfbnVtIDwgTF9kZW5vbS4gICAgICAgKgotICogICAgICAgICAgICAgTF9kZW5vbSA9IGRlbm9tX2hpPDwxNiArIGRlbm9tX2xvPDwxICAgICAgICAgICAgICAgICAgICAgICAgICAqCi0gKiAgICAgICAgICAgICBkZW5vbV9oaSBpcyBhIG5vcm1hbGl6ZSBudW1iZXIuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICoKLSAqICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKgotICogICBJbnB1dHMgOiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqCi0gKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICoKLSAqICAgIExfbnVtICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKgotICogICAgICAgICAgICAgMzIgYml0IGxvbmcgc2lnbmVkIGludGVnZXIgKFdvcmQzMikgd2hvc2UgdmFsdWUgZmFsbHMgaW4gdGhlICAqCi0gKiAgICAgICAgICAgICByYW5nZSA6IDB4MDAwMCAwMDAwIDwgTF9udW0gPCBMX2Rlbm9tICAgICAgICAgICAgICAgICAgICAgICAgICoKLSAqICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKgotICogICAgTF9kZW5vbSA9IGRlbm9tX2hpPDwxNiArIGRlbm9tX2xvPDwxICAgICAgKERQRikgICAgICAgICAgICAgICAgICAgICAgICAqCi0gKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICoKLSAqICAgICAgIGRlbm9tX2hpICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKgotICogICAgICAgICAgICAgMTYgYml0IHBvc2l0aXZlIG5vcm1hbGl6ZWQgaW50ZWdlciB3aG9zZSB2YWx1ZSBmYWxscyBpbiB0aGUgICAqCi0gKiAgICAgICAgICAgICByYW5nZSA6IDB4NDAwMCA8IGhpIDwgMHg3ZmZmICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICoKLSAqICAgICAgIGRlbm9tX2xvICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKgotICogICAgICAgICAgICAgMTYgYml0IHBvc2l0aXZlIGludGVnZXIgd2hvc2UgdmFsdWUgZmFsbHMgaW4gdGhlICAgICAgICAgICAgICAqCi0gKiAgICAgICAgICAgICByYW5nZSA6IDAgPCBsbyA8IDB4N2ZmZiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICoKLSAqICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKgotICogICBSZXR1cm4gVmFsdWUgOiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqCi0gKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICoKLSAqICAgIExfZGl2ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKgotICogICAgICAgICAgICAgMzIgYml0IGxvbmcgc2lnbmVkIGludGVnZXIgKFdvcmQzMikgd2hvc2UgdmFsdWUgZmFsbHMgaW4gdGhlICAqCi0gKiAgICAgICAgICAgICByYW5nZSA6IDB4MDAwMCAwMDAwIDw9IExfZGl2IDw9IDB4N2ZmZiBmZmZmLiAgICAgICAgICAgICAgICAgICoKLSAqICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKgotICogIEFsZ29yaXRobTogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqCi0gKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICoKLSAqICAtIGZpbmQgPSAxL0xfZGVub20uICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKgotICogICAgICBGaXJzdCBhcHByb3hpbWF0aW9uOiBhcHByb3ggPSAxIC8gZGVub21faGkgICAgICAgICAgICAgICAgICAgICAgICAgICAqCi0gKiAgICAgIDEvTF9kZW5vbSA9IGFwcHJveCAqICgyLjAgLSBMX2Rlbm9tICogYXBwcm94ICkgICAgICAgICAgICAgICAgICAgICAgICoKLSAqICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKgotICogIC0gIHJlc3VsdCA9IExfbnVtICogKDEvTF9kZW5vbSkgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqCi0gKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKLSovCi0KLVdvcmQzMiBEaXZfMzIgKFdvcmQzMiBMX251bSwgV29yZDMyIGRlbm9tKQotewotICAgIFdvcmQxNiBhcHByb3g7Ci0gICAgV29yZDMyIExfMzI7Ci0gICAgLyogRmlyc3QgYXBwcm94aW1hdGlvbjogMSAvIExfZGVub20gPSAxL2Rlbm9tX2hpICovCi0KLSAgICBhcHByb3ggPSBkaXZfcyAoKFdvcmQxNikgMHgzZmZmLCBkZW5vbSA+PiAxNik7Ci0KLSAgICAvKiAxL0xfZGVub20gPSBhcHByb3ggKiAoMi4wIC0gTF9kZW5vbSAqIGFwcHJveCkgKi8KLQotICAgIExfMzIgPSBMX21weV9scyAoZGVub20sIGFwcHJveCk7Ci0KLS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pc3Npb25zIGFuZAotICoqIGxpbWl0YXRpb25zIHVuZGVyIHRoZSBMaWNlbnNlLgotICovCi0vKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgotCUZpbGU6CQl0eXBlZGVmLmgKLQotCUNvbnRlbnQ6CXR5cGUgZGVmaW5lZCBmb3IgZGVmZmVyZW50IHBhbHRmb3JtCi0KLSoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0KLSNpZm5kZWYgdHlwZWRlZl9oCi0jZGVmaW5lIHR5cGVkZWZfaCAiJElkICQiCi0KLSN1bmRlZiBPUklHSU5BTF9UWVBFREVGX0ggLyogZGVmaW5lIHRvIGdldCAib3JpZ2luYWwiIEVUU0kgdmVyc2lvbgotICAgICAgICAgICAgICAgICAgICAgICAgICAgICBvZiB0eXBlZGVmLmggICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotCi0jaWZkZWYgT1JJR0lOQUxfVFlQRURFRl9ICi0vKgotICogdGhpcyBpcyB0aGUgb3JpZ2luYWwgY29kZSBmcm9tIHRoZSBFVFNJIGZpbGUgdHlwZWRlZi5oCi0gKi8KLQotI2lmIGRlZmluZWQoX19CT1JMQU5EQ19fKSB8fCBkZWZpbmVkKF9fV0FUQ09NQ19fKSB8fCBkZWZpbmVkKF9NU0NfVkVSKSB8fCBkZWZpbmVkKF9fWlRDX18pCi10eXBlZGVmIHNpZ25lZCBjaGFyIFdvcmQ4OwotdHlwZWRlZiBzaG9ydCBXb3JkMTY7Ci10eXBlZGVmIGxvbmcgV29yZDMyOwotdHlwZWRlZiBpbnQgRmxhZzsKLQotI2VsaWYgZGVmaW5lZChfX3N1bikKLXR5cGVkZWYgc2lnbmVkIGNoYXIgV29yZDg7Ci10eXBlZGVmIHNob3J0IFdvcmQxNjsKLXR5cGVkZWYgbG9uZy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19TSFJUX01BWAotI2RlZmluZSBWT0FBQ19TSFJUX01BWCAgICAoMzI3NjcpICAgICAgICAvKiBtYXhpbXVtIChzaWduZWQpIHNob3J0IHZhbHVlICovCi0jZW5kaWYKLQotI2lmbmRlZiBWT0FBQ19TSFJUX01JTgotI2RlZmluZSBWT0FBQ19TSFJUX01JTiAgICAoLTMyNzY4KSAgICAgICAgLyogbWluaW11bSAoc2lnbmVkKSBzaG9ydCB2YWx1ZSAqLwotI2VuZGlmCi0KLS8qIERlZmluZSBOVUxMIHBvaW50ZXIgdmFsdWUgKi8KLSNpZm5kZWYgTlVMTAotI2lmZGVmIF9fY3BsdXNwbHVzCi0jZGVmaW5lIE5VTEwgICAgMAotI2Vsc2UKLSNkZWZpbmUgTlVMTCAgICAoKHZvaWQgKikwKQotI2VuZGlmCi0jZW5kaWYKLQotI2lmbmRlZiBhc3NlcnQKLSNkZWZpbmUgYXNzZXJ0KF9FeHByZXNzaW9uKSAgICAgKCh2b2lkKTApCi0jZW5kaWYKLQotI2RlZmluZSBfX2lubGluZSBzdGF0aWMgX19pbmxpbmUKLQotI2RlZmluZSBJTlRfQklUUyAgIDMyCi0vKgotKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKLSogICAgICAgICAgICAgICAgICAgICAgICAgREVGSU5JVElPTiBPRiBDT05TVEFOVFMKLSoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCi0qLwotLyoKLSAqKioqKioqKiogZGVmaW5lIGNoYXIgdHlwZQotICovCi10eXBlZGVmIGNoYXIgQ2hhcjsKLQotLyoKLSAqKioqKioqKiogZGVmaW5lIDggYml0IHNpZ25lZC91bnNpZ25lZCB0eXBlcyAmIGNvbnN0YW50cwotICovCi10eXBlZGVmIHNpZ25lZCBjaGFyIFdvcmQ4OwotdHlwZWRlZ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ZGVmaW5lIEFSTVY1VEVfU0hSICAgICAgICAgICAxCi0JI2RlZmluZSBBUk1WNVRFX0xfU0hMICAgICAgICAgMQotICAgICNkZWZpbmUgQVJNVjVURV9MX1NIUiAgICAgICAgIDEKLSNlbmRpZi8vQVJNVjQKLSNpZiBBUk1WNUVfSU5BU00KLSAgICAjZGVmaW5lIEFSTVY1VEVfTF9BREQgICAgICAgICAxCi0gICAgI2RlZmluZSBBUk1WNVRFX0xfU1VCICAgICAgICAgMQotICAgICNkZWZpbmUgQVJNVjVURV9MX01VTFQgICAgICAgIDEKLSAgICAjZGVmaW5lIEFSTVY1VEVfTF9NQUMgICAgICAgICAxCi0gICAgI2RlZmluZSBBUk1WNVRFX0xfTVNVICAgICAgICAgMQotCi0KLSAgICAjZGVmaW5lIEFSTVY1VEVfRElWX1MgICAgICAgICAxCi0gICAgI2RlZmluZSBBUk1WNVRFX1JPVU5EICAgICAgICAgMQotICAgICNkZWZpbmUgQVJNVjVURV9NVUxUICAgICAgICAgIDEKLQotICAgICNkZWZpbmUgQVJNVjVURV9OT1JNX1MgICAgICAgIDEKLSAgICAjZGVmaW5lIEFSTVY1VEVfTk9STV9MICAgICAgICAxCi0JI2RlZmluZSBBUk1WNVRFX0xfTVBZX0xTCSAgMQotI2VuZGlmCi0jaWYgQVJNVjZfSU5BU00KLSAgICAjdW5kZWYgIEFSTVY1VEVfQURECi0gICAgI2RlZmluZSBBUk1WNVRFX0FERCAgICAgICAgICAgMAotICAgICN1bmRlZiAgQVJNVjVURV9TVUIKLSAgICAjZGVmaW5lIEFSTVY1VEVfU1VCICAgICAgICAgICAwCi0gICAgI2RlZmluZSBBUk1WNl9TQVQgICAgICAgICAgICAgMQotI2VuZGlmCi0KLS8vYmFzaWMgb3BlcmF0aW9uIGZ1bmN0aW9ucyBvcHRpbWl6YXRpb24gZmxhZ3MKLSNkZWZpbmUgU0FUUlVBVEVfSVNfSU5MSU5FICAgICAgICAgICAgICAxICAgLy9kZWZpbmUgc2F0dXJ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pY2Vuc2UgYXQKLSAqKgotICoqICAgICBodHRwOi8vd3d3LmFwYWNoZS5vcmcvbGljZW5zZXMvTElDRU5TRS0yLjAKLSAqKgotICoqIFVubGVzcyByZXF1aXJlZCBieSBhcHBsaWNhYmxlIGxhdyBvciBhZ3JlZWQgdG8gaW4gd3JpdGluZywgc29mdHdhcmUKLSAqKiBkaXN0cmlidXRlZCB1bmRlciB0aGUgTGljZW5zZSBpcyBkaXN0cmlidXRlZCBvbiBhbiAiQVMgSVMiIEJBU0lTLAotICoqIFdJVEhPVVQgV0FSUkFOVElFUyBPUiBDT05ESVRJT05TIE9GIEFOWSBLSU5ELCBlaXRoZXIgZXhwcmVzcyBvciBpbXBsaWVkLgotICoqIFNlZSB0aGUgTGljZW5zZSBmb3IgdGhlIHNwZWNpZmljIGxhbmd1YWdlIGdvdmVybmluZyBwZXJtaXNzaW9ucyBhbmQKLSAqKiBsaW1pdGF0aW9ucyB1bmRlciB0aGUgTGljZW5zZS4KLSAqLwotLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKLQlGaWxlOgkJYWFjX3JvbS5oCi0KLQlDb250ZW50Ogljb25zdGFudCB0YWJsZXMKLQotKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLQotI2lmbmRlZiBST01fSAotI2RlZmluZSBST01fSAotCi0jaW5jbHVkZSAiY29uZmlnLmgiCi0jaW5jbHVkZSAicHN5X2NvbnN0LmgiCi0jaW5jbHVkZSAidG5zX3BhcmFtLmgiCi0KLS8qCi0gIG1kY3QKLSovCi1leHRlcm4gY29uc3QgaW50IFNob3J0V2luZG93U2luZVtGUkFNRV9MRU5fU0hPUlQvMl07Ci1leHRlcm4gY29uc3QgaW50IExvbmdXaW5kb3dLQkRbRlJBTUVfTEVOX0xPTkcvMl07Ci0KLWV4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iovCi0KLSNpZm5kZWYgX19BREpfVEhSX0gKLSNkZWZpbmUgX19BREpfVEhSX0gKLQotI2luY2x1ZGUgImFkal90aHJfZGF0YS5oIgotI2luY2x1ZGUgInFjX2RhdGEuaCIKLSNpbmNsdWRlICJpbnRlcmZhY2UuaCIKLQotV29yZDE2IGJpdHMycGUoY29uc3QgV29yZDE2IGJpdHMpOwotCi1Xb3JkMzIgQWRqVGhyTmV3KEFESl9USFJfU1RBVEUqKiBwaEFkalRociwKLSAgICAgICAgICAgICAgICAgV29yZDMyIG5FbGVtZW50cyk7Ci0KLXZvaWQgQWRqVGhyRGVsZXRlKEFESl9USFJfU1RBVEUgKmhBZGpUaHIpOwotCi12b2lkIEFkalRockluaXQoQURKX1RIUl9TVEFURSAqaEFkalRociwKLSAgICAgICAgICAgICAgICBjb25zdCBXb3JkMzIgcGVNZWFuLAotICAgICAgICAgICAgICAgIFdvcmQzMiBjaEJpdHJhdGUpOwotCi12b2lkIEFkanVzdFRocmVzaG9sZHMoQURKX1RIUl9TVEFURSAqYWRqVGhyU3RhdGUsCi0gICAgICAgICAgICAgICAgICAgICAgQVRTX0VMRU1FTlQqIEFkalRoclN0YXRlRWxlbWVudCwKLSAgICAgICAgICAgICAgICAgICAgICBQU1lfT1VUX0NIQU5ORUwgcHN5T3V0Q2hhbm5lbFtNQVhfQ0hBTk5FTFNdLAotICAgICAgICAgICAgICAgICAgICAgIFBTWV9PVVRfRUxFTUVOVCAqcHN5T3V0RWxlbWVudCwKLSAgICAgICAgICAgICAgICAgICAgICBXb3JkMTYgKmNoQml0RGlzdHJpYnV0aW9uLAotICAgICAgICAgICAgICAgICAgICAgIFdvcmQxNiBsb2dTZmJFbmVyZ3lbTUFYX0NIQU5ORUxTXVtNQVhfR1JPVVBFRF9TRkJdLAotICAgICAgICAgICAgICAgICAgICAgIFdvcmQxNiBzZmJOUmVsZXZhbnRMaW5lc1tNQVhfQ0hBTk5FTFNdW01BWF9HUk9VUEVEX1NGQl0sCi0gICAg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T05ESVRJT05TIE9GIEFOWSBLSU5ELCBlaXRoZXIgZXhwcmVzcyBvciBpbXBsaWVkLgotICoqIFNlZSB0aGUgTGljZW5zZSBmb3IgdGhlIHNwZWNpZmljIGxhbmd1YWdlIGdvdmVybmluZyBwZXJtaXNzaW9ucyBhbmQKLSAqKiBsaW1pdGF0aW9ucyB1bmRlciB0aGUgTGljZW5zZS4KLSAqLwotLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKLQlGaWxlOgkJYmFuZF9ucmcuaAotCi0JQ29udGVudDoJQmFuZC9MaW5lIGVuZXJneSBjYWxjdWxhdGlvbnMgZnVuY3Rpb25zCi0KLSoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0KLQotI2lmbmRlZiBfQkFORF9OUkdfSAotI2RlZmluZSBfQkFORF9OUkdfSAotCi0jaW5jbHVkZSAidHlwZWRlZi5oIgotCi0KLXZvaWQgQ2FsY0JhbmRFbmVyZ3koY29uc3QgV29yZDMyICptZGN0U3BlY3RydW0sCi0gICAgICAgICAgICAgICAgICAgIGNvbnN0IFdvcmQxNiAqYmFuZE9mZnNldCwKLSAgICAgICAgICAgICAgICAgICAgY29uc3QgV29yZDE2ICBudW1CYW5kcywKLSAgICAgICAgICAgICAgICAgICAgV29yZDMyICAgICAgICpiYW5kRW5lcmd5LAotICAgICAgICAgICAgICAgICAgICBXb3JkMzIgICAgICAgKmJhbmRFbmVyZ3lTdW0pOwotCi0KLXZvaWQgQ2FsY0JhbmRFbmVyZ3lNUyhjb25zdCBXb3JkMzIgKm1kY3RTcGVjdHJ1bUxlZnQsCi0gICAgICAgICAgICAgICAgICAgICAgY29uc3QgV29yZDMyICptZGN0U3BlY3RydW1SaWdodCwKLSAgICAgICAgICAgICAgICAgICAgICBjb25zdCBXb3JkMTYgKmJh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0gKioKLSAqKiBVbmxlc3MgcmVxdWlyZWQgYnkgYXBwbGljYWJsZSBsYXcgb3IgYWdyZWVkIHRvIGluIHdyaXRpbmcsIHNvZnR3YXJlCi0gKiogZGlzdHJpYnV0ZWQgdW5kZXIgdGhlIExpY2Vuc2UgaXMgZGlzdHJpYnV0ZWQgb24gYW4gIkFTIElTIiBCQVNJUywKLSAqKiBXSVRIT1VUIFdBUlJBTlRJRVMgT1IgQ09ORElUSU9OUyBPRiBBTlkgS0lORCwgZWl0aGVyIGV4cHJlc3Mgb3IgaW1wbGllZC4KLSAqKiBTZWUgdGhlIExpY2Vuc2UgZm9yIHRoZSBzcGVjaWZpYyBsYW5ndWFnZSBnb3Zlcm5pbmcgcGVybWlzc2lvbnMgYW5kCi0gKiogbGltaXRhdGlvbnMgdW5kZXIgdGhlIExpY2Vuc2UuCi0gKi8KLS8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCi0JRmlsZToJCWJpdF9jbnQuaAotCi0JQ29udGVudDoJSHVmZm1hbiBCaXRjb3VudGVyICYgY29kZXIgc3RydWN0dXJlIGFuZCBmdW5jdGlvbnMKLQotKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLQotI2lmbmRlZiBfX0JJVENPVU5UX0gKLSNkZWZpbmUgX19CSVRDT1VOVF9ICi0KLSNpbmNsdWRlICJiaXRidWZmZXIuaCIKLSNpbmNsdWRlICJiYXNpY19vcC5oIgotI2RlZmluZSBJTlZBTElEX0JJVENPVU5UIChNQVhfMTYvNCkKLQotLyoKLSAgY29kZSBib29rIG51bWJlciB0YWJsZQotKi8KLQotZW51bSBjb2RlQm9va05vewotICBDT0RFX0JPT0tfWkVST19OTz0gICAgICAgICAgICAgICAwLAotICBDT0RFX0JPT0tfMV9OTz0gICAgICAgICAgICAgICAgICAxLAotICBDT0RFX0JPT0tfMl9OTz0gICAgICAgICAgICAgICAgICAyLAotICBDT0RFX0JPT0tfM19OTz0gICAgICAgICAgICAgICAgICAzLAotICBDT0RFX0JPT0tfNF9OTz0gICAgICAgICAgICAgICAgICA0LAotICBDT0RFX0JPT0tfNV9OTz0gICAgICAgICAgICAgICAgICA1LAotICBDT0RFX0JPT0tfNl9OTz0gICAgICAgICAgICAgICAgICA2LAotICBDT0RFX0JPT0tfN19OTz0gICAgICAgICAgICAgICAgICA3LAotICBDT0RFX0JPT0tfOF9OTz0gICAgICAgICAgICAgICAgICA4LAotICBDT0RFX0JPT0tfOV9OTz0gICAgICAgICAgICAgICAgICA5LAotICBDT0RFX0JPT0tfMTBfTk89ICAgICAgICAgICAgICAgIDEwLAotICBDT0RFX0JPT0tfRVNDX05PPSAgICAgICAgICAgICAgIDExLAotICBDT0RFX0JPT0tfUkVTX05PPSAgICAgICAgICAgICAgIDEyLAotICBDT0RFX0JPT0tfUE5TX05PPSAgICAgICAgICAgICAgIDEzCi19OwotCi0vKgotICBjb2RlIGJvb2sgaW5kZXggdGFibGUKLSovCi0KLWVudW0gY29kZUJvb2tOZHh7Ci0gIENPREVfQk9PS19aRVJPX05EWD0wLAotICBDT0RFX0JPT0tfMV9ORFgsCi0gIENPREVfQk9PS18yX05EWCwKLSAgQ09ERV9CT09LXzNfTkRYLAotICBDT0RFX0JPT0tfNF9ORFgsCi0gIENPREVfQk9PS181X05EWCwKLSAgQ09ERV9CT09LXzZfTkRYLAotICBDT0RFX0JPT0tfN19ORFgsCi0gIENPREVfQk9PS184X05EWCwKLSAgQ09ERV9CT09LXzlfTkRYLAotICBDT0RFX0JPT0tfMTBfTkRYLAotICBDT0RFX0JPT0tfRVNDX05EWCwKLSAgQ09ERV9CT09LX1JFU19ORFgsCi0gIENPREVfQk9PS19QTlNfTkRYLAotICBOVU1CRVJfT0ZfQ09ERV9CT09LUwotfTsKLQotLyoKLSAgY29kZSBib29rIGxhdiB0YWJsZ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9saWNlbnNlcy9MSUNFTlNFLTIuMAotICoqCi0gKiogVW5sZXNzIHJlcXVpcmVkIGJ5IGFwcGxpY2FibGUgbGF3IG9yIGFncmVlZCB0byBpbiB3cml0aW5nLCBzb2Z0d2FyZQotICoqIGRpc3RyaWJ1dGVkIHVuZGVyIHRoZSBMaWNlbnNlIGlzIGRpc3RyaWJ1dGVkIG9uIGFuICJBUyBJUyIgQkFTSVMsCi0gKiogV0lUSE9VVCBXQVJSQU5USUVTIE9SIENPTkRJVElPTlMgT0YgQU5ZIEtJTkQsIGVpdGhlciBleHByZXNzIG9yIGltcGxpZWQuCi0gKiogU2VlIHRoZSBMaWNlbnNlIGZvciB0aGUgc3BlY2lmaWMgbGFuZ3VhZ2UgZ292ZXJuaW5nIHBlcm1pc3Npb25zIGFuZAotICoqIGxpbWl0YXRpb25zIHVuZGVyIHRoZSBMaWNlbnNlLgotICovCi0vKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgotCUZpbGU6CQlibG9ja19zd2l0Y2guaAotCi0JQ29udGVudDoJQmxvY2sgc3dpdGNoaW5nIHN0cnVjdHVyZSBhbmQgZnVuY3Rpb25zCi0KLSoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0KLSNpZm5kZWYgX0JMT0NLX1NXSVRDSF9ICi0jZGVmaW5lIF9CTE9DS19TV0lUQ0hfSAotCi0jaW5jbHVkZSAidHlwZWRlZi5oIgotCi0KLS8qKioqKioqKioqKioqKioqKiogRGVmaW5lcyAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0jZGVmaW5lIEJMT0NLX1NXSVRDSElOR19JSVJfTEVOIDIgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLyogTGVuZ3RoIG9mIEhpZ2hQYXNzLUZJUi1GaWx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SB0aGUgTGljZW5zZSBmb3IgdGhlIHNwZWNpZmljIGxhbmd1YWdlIGdvdmVybmluZyBwZXJtaXNzaW9ucyBhbmQKLSAqKiBsaW1pdGF0aW9ucyB1bmRlciB0aGUgTGljZW5zZS4KLSAqLwotLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKLQlGaWxlOgkJY2hhbm5lbF9tYXAuaAotCi0JQ29udGVudDoJY2hhbm5lbCBtYXBwaW5nIGZ1bmN0aW9ucwotCi0qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotCi0jaWZuZGVmIF9DSEFOTkVMX01BUF9ICi0jZGVmaW5lIF9DSEFOTkVMX01BUF9ICi0KLSNpbmNsdWRlICJwc3lfY29uc3QuaCIKLSNpbmNsdWRlICJxY19kYXRhLmgiCi0KLVdvcmQxNiBJbml0RWxlbWVudEluZm8gKFdvcmQxNiBuQ2hhbm5lbHMsIEVMRU1FTlRfSU5GTyogZWxJbmZvKTsKLQotV29yZDE2IEluaXRFbGVtZW50Qml0cyhFTEVNRU5UX0JJVFMgKmVsZW1lbnRCaXRzLAotICAgICAgICAgICAgICAgICAgICAgICBFTEVNRU5UX0lORk8gZWxJbmZvLAotICAgICAgICAgICAgICAgICAgICAgICBXb3JkMzIgYml0cmF0ZVRvdCwKLSAgICAgICAgICAgICAgICAgICAgICAgV29yZDE2IGF2ZXJhZ2VCaXRzVG90LAotICAgICAgICAgICAgICAgICAgICAgICBXb3JkMTYgc3RhdGljQml0c1RvdCk7Ci0KLSNlbmRpZiAvKiBDSEFOTkVMX01BUF9IICovCmRpZmYgLS1naXQgYS9tZWRpYS9saWJzdGFnZWZyaWdodC9jb2RlY3MvYWFjZW5jL2luYy9jb25maWcuaCBiL21lZGlhL2xpYnN0YWdlZnJpZ2h0L2NvZGVjcy9hYW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gotICovCi0vKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgotCUZpbGU6CQlncnBfZGF0YS5oCi0KLQlDb250ZW50OglTaG9ydCBibG9jayBncm91cGluZyBmdW5jdGlvbgotCi0qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotCi0jaWZuZGVmIF9fR1JQX0RBVEFfSF9fCi0jZGVmaW5lIF9fR1JQX0RBVEFfSF9fCi0jaW5jbHVkZSAicHN5X2RhdGEuaCIKLSNpbmNsdWRlICJ0eXBlZGVmcy5oIgotCi12b2lkCi1ncm91cFNob3J0RGF0YShXb3JkMzIgICAgICAgICptZGN0U3BlY3RydW0sCi0gICAgICAgICAgICAgICBXb3JkMzIgICAgICAgICp0bXBTcGVjdHJ1bSwKLSAgICAgICAgICAgICAgIFNGQl9USFJFU0hPTEQgKnNmYlRocmVzaG9sZCwKLSAgICAgICAgICAgICAgIFNGQl9FTkVSR1kgICAgKnNmYkVuZXJneSwKLSAgICAgICAgICAgICAgIFNGQl9FTkVSR1kgICAgKnNmYkVuZXJneU1TLAotICAgICAgICAgICAgICAgU0ZCX0VORVJHWSAgICAqc2ZiU3ByZWFkZWRFbmVyZ3ksCi0gICAgICAgICAgICAgICBjb25zdCBXb3JkMTYgICBzZmJDbnQsCi0gICAgICAgICAgICAgICBjb25zdCBXb3JkMTYgICpzZmJPZmZzZXQsCi0gICAgICAgICAgICAgICBjb25zdCBXb3JkMTYgICpzZmJNaW5TbnIsCi0gICAgICAgICAgICAgICBXb3JkMTYgICAgICAgICpncm91cGVkU2ZiT2Zmc2V0LAotICAgICAgICAgICAgICAgV29yZDE2ICAgICAgICAqbWF4U2ZiUGVyR3JvdXAsCi0gICAgICAgICAgICAgICBXb3JkMTYgICAgICAgICpncm91cGVkU2ZiTWluU25yLAotICAgICAgICAgIC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mNlLAotICAgICAgICAgICAgICAgICAgICBjb25zdCBXb3JkMTYgICAgICAgICAgICB3aW5kb3dTaGFwZSwKLSAgICAgICAgICAgICAgICAgICAgY29uc3QgV29yZDE2ICAgICAgICAgICAgc2ZiQ250LAotICAgICAgICAgICAgICAgICAgICBjb25zdCBXb3JkMTYgICAgICAgICAgICpzZmJPZmZzZXQsCi0gICAgICAgICAgICAgICAgICAgIGNvbnN0IFdvcmQxNiAgICAgICAgICAgIG1heFNmYlBlckdyb3VwLAotICAgICAgICAgICAgICAgICAgICBjb25zdCBXb3JkMTYgICAgICAgICAgICpncm91cGVkU2ZiTWluU25yLAotICAgICAgICAgICAgICAgICAgICBjb25zdCBXb3JkMTYgICAgICAgICAgICBub09mR3JvdXBzLAotICAgICAgICAgICAgICAgICAgICBjb25zdCBXb3JkMTYgICAgICAgICAgICpncm91cExlbiwKLSAgICAgICAgICAgICAgICAgICAgUFNZX09VVF9DSEFOTkVMICAgICAgICAqcHN5T3V0Q2gpOwotCi0jZW5kaWYgLyogX0lOVEVSRkFDRV9IICovCmRpZmYgLS1naXQgYS9tZWRpYS9saWJzdGFnZWZyaWdodC9jb2RlY3MvYWFjZW5jL2luYy9saW5lX3BlLmggYi9tZWRpYS9saWJzdGFnZWZyaWdodC9jb2RlY3MvYWFjZW5jL2luYy9saW5lX3BlLmgKZGVsZXRlZCBmaWxlIG1vZGUgMTAwNjQ0CmluZGV4IDExNmQ1YTguLjAwMDAwMDAKLS0tIGEvbWVkaWEvbGlic3RhZ2VmcmlnaHQvY29kZWNzL2FhY2VuYy9pbmMvbGluZV9wZS5oCisrKyAvZGV2L251bGwKQEAgLTEsNzUgKzAsMCBAQAotLyoKLSAqKiBDb3B5cmlnaHQgMjAwMy0yMDEwLCBWaXN1YWxPbiwgSW5jLgotICoqCi0gKiogTGljZW5zZWQgdW5kZXIgdGhlIEFwYWNoZSBMaWNlbnNlLCBWZXJzaW9uIDIuMCAodGhlICJMaWNlbnNlIik7Ci0gKiogeW91IG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KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0KLSNpZm5kZWYgX19NU19TVEVSRU9fSF9fCi0jZGVmaW5lIF9fTVNfU1RFUkVPX0hfXwotI2luY2x1ZGUgInR5cGVkZWYuaCIKLQotdm9pZCBNc1N0ZXJlb1Byb2Nlc3NpbmcoV29yZDMyICAgICAgICpzZmJFbmVyZ3lMZWZ0LAotICAgICAgICAgICAgICAgICAgICAgICAgV29yZDMyICAgICAgICpzZmJFbmVyZ3lSaWdodCwKLSAgICAgICAgICAgICAgICAgICAgICAgIGNvbnN0IFdvcmQzMiAqc2ZiRW5lcmd5TWlkLAotICAgICAgICAgICAgICAgICAgICAgICAgY29uc3QgV29yZDMyICpzZmJFbmVyZ3lTaWRlLAotICAgICAgICAgICAgICAgICAgICAgICAgV29yZDMyICAgICAgICptZGN0U3BlY3RydW1MZWZ0LAotICAgICAgICAgICAgICAgICAgICAgICAgV29yZDMyICAgICAgICptZGN0U3BlY3RydW1SaWdodCwKLSAgICAgICAgICAgICAgICAgICAgICAgIFdvcmQzMiAgICAgICAqc2ZiVGhyZXNob2xkTGVmdCwKLSAgICAgICAgICAgICAgICAgICAgICAgIFdvcmQzMiAgICAgICAqc2ZiVGhyZXNob2xkUmlnaHQsCi0gICAgICAgICAgICAgICAgICAgICAgICBXb3JkMzIgICAgICAgKnNmYlNwcmVhZGVkRW5MZWZ0LAotICAgICAgICAgICAgICAgICAgICAgICAgV29yZDMyICAgICAgICpzZmJTcHJlYWRlZEVuUmlnaHQsCi0gICAgICAgICAgICAgICAgICAgICAgICBXb3JkMTYgICAgICAgKm1zRGlnZXN0LAotICAgICAgICAgICAgICAgICAgICAgICAgV29yZDE2ICAgICAgICptc01hc2ssCi0gICAgICAgICAgICAgICAgICAgICAgICBjb25zdCBXb3JkMTYgIHNmYkNudCwKLSAgICAgICAgICAgICAgICAgICAgICAgIGNvbnN0IFdvcmQxNiAgc2ZiUGVyR3JvdXAsCi0gICAgICAgICAgICAgICA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TLAotICoqIFdJVEhPVVQgV0FSUkFOVElFUyBPUiBDT05ESVRJT05TIE9GIEFOWSBLSU5ELCBlaXRoZXIgZXhwcmVzcyBvciBpbXBsaWVkLgotICoqIFNlZSB0aGUgTGljZW5zZSBmb3IgdGhlIHNwZWNpZmljIGxhbmd1YWdlIGdvdmVybmluZyBwZXJtaXNzaW9ucyBhbmQKLSAqKiBsaW1pdGF0aW9ucyB1bmRlciB0aGUgTGljZW5zZS4KLSAqLwotLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKLQlGaWxlOgkJcHJlX2VjaG9fY29udHJvbC5oCi0KLQlDb250ZW50OglQcmUgZWNobyBjb250cm9sIGZ1bmN0aW9ucwotCi0qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotCi0jaWZuZGVmIF9fUFJFX0VDSE9fQ09OVFJPTF9ICi0jZGVmaW5lIF9fUFJFX0VDSE9fQ09OVFJPTF9ICi0KLSNpbmNsdWRlICJ0eXBlZGVmcy5oIgotCi12b2lkIEluaXRQcmVFY2hvQ29udHJvbChXb3JkMzIgKnBiVGhyZXNob2xkbm0xLAotICAgICAgICAgICAgICAgICAgICAgICAgV29yZDE2ICBudW1QYiwKLSAgICAgICAgICAgICAgICAgICAgICAgIFdvcmQzMiAqcGJUaHJlc2hvbGRRdWlldCk7Ci0KLQotdm9pZCBQcmVFY2hvQ29udHJvbChXb3JkMzIgKnBiVGhyZXNob2xkTm0xLAotICAgICAgICAgICAgICAgICAgICBXb3JkMTYgIG51bVBiLAotICAgICAgICAgICAgICAgICAgICBXb3JkMzIgIG1heEFsbG93ZWRJbmNyZWFzZUZhY3RvciwKLSAgICAgICAgICAgICAgICAgICAgV29yZDE2ICBtaW5SZW1haW5pbmdUaHJlc2hvbGRGYWN0b3IsCi0gICAgICAgICAgIC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HN5T3V0LCBWT19NRU1fT1BFUkFUT1IgKnBNZW1PUCk7Ci0KLVdvcmQxNiBwc3lNYWluSW5pdCggUFNZX0tFUk5FTCAqaFBzeSwKLSAgICAgICAgICAgICAgICAgICAgV29yZDMyIHNhbXBsZVJhdGUsCi0gICAgICAgICAgICAgICAgICAgIFdvcmQzMiBiaXRSYXRlLAotICAgICAgICAgICAgICAgICAgICBXb3JkMTYgY2hhbm5lbHMsCi0gICAgICAgICAgICAgICAgICAgIFdvcmQxNiB0bnNNYXNrLAotICAgICAgICAgICAgICAgICAgICBXb3JkMTYgYmFuZHdpZHRoKTsKLQotCi1Xb3JkMTYgcHN5TWFpbihXb3JkMTYgICAgICAgICAgICAgICAgICAgbkNoYW5uZWxzLCAgIC8qITwgdG90YWwgbnVtYmVyIG9mIGNoYW5uZWxzICovCi0gICAgICAgICAgICAgICBFTEVNRU5UX0lORk8gICAgICAgICAgICAgKmVsZW1JbmZvLAotICAgICAgICAgICAgICAgV29yZDE2ICAgICAgICAgICAgICAgICAgICp0aW1lU2lnbmFsLCAvKiE8IGludGVybGVhdmVkIHRpbWUgc2lnbmFsICovCi0gICAgICAgICAgICAgICBQU1lfREFUQSAgICAgICAgICAgICAgICAgcHN5RGF0YVtNQVhfQ0hBTk5FTFNdLAotICAgICAgICAgICAgICAgVE5TX0RBVEEgICAgICAgICAgICAgICAgIHRuc0RhdGFbTUFYX0NIQU5ORUxTXSwKLSAgICAgICAgICAgICAgIFBTWV9DT05GSUdVUkFUSU9OX0xPTkcqICBwc3lDb25mTG9uZywKLSAgICAgICAgICAgICAgIFBTWV9DT05GSUdVUkFUSU9OX1NIT1JUKiBwc3lDb25mU2hvcnQsCi0gICAgICAgICAgICAgICBQU1lfT1VUX0NIQU5ORUwgICAgICAgICAgcHN5T3V0Q2hhbm5lbFtNQVhfQ0hBTk5FTFNdLAotICAgICAgICAgICAgICAgUFNZX09VVF9FTEVNRU5UICAgICAgICAgICpwc3lPdXRFbGVtZW50LAotICAgICAgIC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UyBPUiBDT05ESVRJT05TIE9GIEFOWSBLSU5ELCBlaXRoZXIgZXhwcmVzcyBvciBpbXBsaWVkLgotICoqIFNlZSB0aGUgTGljZW5zZSBmb3IgdGhlIHNwZWNpZmljIGxhbmd1YWdlIGdvdmVybmluZyBwZXJtaXNzaW9ucyBhbmQKLSAqKiBsaW1pdGF0aW9ucyB1bmRlciB0aGUgTGljZW5zZS4KLSAqLwotLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKLQlGaWxlOgkJcWNfZGF0YS5oCi0KLQlDb250ZW50OglRdWFudGl6aW5nICYgY29kaW5nIHN0cnVjdHVyZXMKLQotKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLQotI2lmbmRlZiBfUUNfREFUQV9ICi0jZGVmaW5lIF9RQ19EQVRBX0gKLQotI2luY2x1ZGUgInBzeV9jb25zdC5oIgotI2luY2x1ZGUgImR5bl9iaXRzLmgiCi0jaW5jbHVkZSAiYWRqX3Rocl9kYXRhLmgiCi0KLQotI2RlZmluZSBNQVhfTU9ERVMgMTAKLQotdHlwZWRlZiBlbnVtIHsKLSAgTU9ERV9JTlZBTElEID0gMCwKLSAgTU9ERV8xLCAgICAgICAgLyogbW9ubyAgICAgICovCi0gIE1PREVfMV8xLCAgICAgIC8qIGR1YWwgbW9ubyAqLwotICBNT0RFXzIgICAgICAgICAvKiBzdGVyZW8gICAgKi8KLX0gRU5DT0RFUl9NT0RFOwotCi10eXBlZGVmIGVudW0gewotICBJRF9TQ0U9MCwgICAgIC8qIFNpbmdsZSBDaGFubmVsIEVsZW1lbnQgICAqLwotICBJRF9DUEU9MSwgICAgIC8qIENoYW5uZWwgUGFpciBFbGVtZW50ICAgICAqLwotICBJRF9DQ0U9MiwgICAgIC8qIENvdXBsaW5nIENoYW5uZWwgRWxl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ApOwotCi1Xb3JkMTYgUUNJbml0KFFDX1NUQVRFICpoUUMsCi0gICAgICAgICAgICAgIHN0cnVjdCBRQ19JTklUICppbml0KTsKLQotdm9pZCBRQ0RlbGV0ZShRQ19TVEFURSAqaFFDLCBWT19NRU1fT1BFUkFUT1IgKnBNZW1PUCk7Ci0KLQotV29yZDE2IFFDTWFpbihRQ19TVEFURSAqaFFDLAotICAgICAgICAgICAgICBFTEVNRU5UX0JJVFMqIGVsQml0cywKLSAgICAgICAgICAgICAgQVRTX0VMRU1FTlQqIGFkalRoclN0YXRlRWxlbWVudCwKLSAgICAgICAgICAgICAgUFNZX09VVF9DSEFOTkVMIHBzeU91dENoYW5uZWxbTUFYX0NIQU5ORUxTXSwgLyogbWF5IGJlIG1vZGlmaWVkIGluLXBsYWNlICovCi0gICAgICAgICAgICAgIFBTWV9PVVRfRUxFTUVOVCogcHN5T3V0RWxlbWVudCwKLSAgICAgICAgICAgICAgUUNfT1VUX0NIQU5ORUwgIHFjT3V0Q2hhbm5lbFtNQVhfQ0hBTk5FTFNdLCAgIC8qIG91dCAgICAgICAgICAgICAgICAgICAgICAqLwotICAgICAgICAgICAgICBRQ19PVVRfRUxFTUVOVCogcWNPdXRFbGVtZW50LAotICAgICAgICAgICAgICBXb3JkMTYgbkNoYW5uZWxzLAotCQkJICBXb3JkMTYgYW5jaWxsYXJ5RGF0YUJ5dGVzKTsgICAgIC8qIHJldHVybnMgZXJyb3IgY29kZSAgICAgICAqLwotCi12b2lkIHVwZGF0ZUJpdHJlcyhRQ19TVEFURSogcWNLZXJuZWwsCi0gICAgICAgICAgICAgICAgICBRQ19PVVQqIHFjT3V0KTsKLQotV29yZDE2IEZpbmFsaXplQml0Q29uc3VtcHRpb24oUUNfU1RBVEUgKmhRQywKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFFDX09VVCogcWNPdXQpOwotCi1Xb3JkMTYgQWRqdXN0Qml0cmF0ZShRQ19TVEFURSAqaFFDLAotICAgICAgICAgICA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PTkRJVElPTlMgT0YgQU5ZIEtJTkQsIGVpdGhlciBleHByZXNzIG9yIGltcGxpZWQuCi0gKiogU2VlIHRoZSBMaWNlbnNlIGZvciB0aGUgc3BlY2lmaWMgbGFuZ3VhZ2UgZ292ZXJuaW5nIHBlcm1pc3Npb25zIGFuZAotICoqIGxpbWl0YXRpb25zIHVuZGVyIHRoZSBMaWNlbnNlLgotICovCi0vKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgotCUZpbGU6CQlxdWFudGl6ZS5oCi0KLQlDb250ZW50OglRdWFudGl6YXRpb24gZnVuY3Rpb25zCi0KLSoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0KLSNpZm5kZWYgX1FVQU5USVpFX0hfCi0jZGVmaW5lIF9RVUFOVElaRV9IXwotI2luY2x1ZGUgInR5cGVkZWZzLmgiCi0KLS8qIHF1YW50aXppbmcgKi8KLQotI2RlZmluZSBNQVhfUVVBTlQgODE5MQotCi12b2lkIFF1YW50aXplU3BlY3RydW0oV29yZDE2IHNmYkNudCwKLSAgICAgICAgICAgICAgICAgICAgICBXb3JkMTYgbWF4U2ZiUGVyR3JvdXAsCi0gICAgICAgICAgICAgICAgICAgICAgV29yZDE2IHNmYlBlckdyb3VwLAotICAgICAgICAgICAgICAgICAgICAgIFdvcmQxNiAqc2ZiT2Zmc2V0LCBXb3JkMzIgKm1kY3RTcGVjdHJ1bSwKLSAgICAgICAgICAgICAgICAgICAgICBXb3JkMTYgZ2xvYmFsR2FpbiwgV29yZDE2ICpzY2FsZWZhY3RvcnMsCi0gICAgICAgICAgICAgICAgICAgICAgV29yZDE2ICpxdWFudGl6ZWRTcGVjdHJ1bSk7Ci0KLVdvcmQzMiBjYWxjU2ZiRGlzdChjb25zdCBXb3JkMzIgKnNwZWMsCi0gICAgICAg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RJVElPTlMgT0YgQU5ZIEtJTkQsIGVpdGhlciBleHByZXNzIG9yIGltcGxpZWQuCi0gKiogU2VlIHRoZSBMaWNlbnNlIGZvciB0aGUgc3BlY2lmaWMgbGFuZ3VhZ2UgZ292ZXJuaW5nIHBlcm1pc3Npb25zIGFuZAotICoqIGxpbWl0YXRpb25zIHVuZGVyIHRoZSBMaWNlbnNlLgotICovCi0vKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgotCUZpbGU6CQlzZl9lc3RpbS5oCi0KLQlDb250ZW50OglTY2FsZSBmYWN0b3IgZXN0aW1hdGlvbiBmdW5jdGlvbnMKLQotKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLQotI2lmbmRlZiBfX1NGX0VTVElNX0hfXwotI2RlZmluZSBfX1NGX0VTVElNX0hfXwotLyoKLSAgIFNjYWxlIGZhY3RvciBlc3RpbWF0aW9uCi0gKi8KLSNpbmNsdWRlICJwc3lfY29uc3QuaCIKLSNpbmNsdWRlICJpbnRlcmZhY2UuaCIKLSNpbmNsdWRlICJxY19kYXRhLmgiCi0KLXZvaWQKLUNhbGNGb3JtRmFjdG9yKFdvcmQxNiAgICAgICAgICBsb2dTZmJGb3JtRmFjdG9yW01BWF9DSEFOTkVMU11bTUFYX0dST1VQRURfU0ZCXSwKLSAgICAgICAgICAgICAgIFdvcmQxNiAgICAgICAgICBzZmJOUmVsZXZhbnRMaW5lc1tNQVhfQ0hBTk5FTFNdW01BWF9HUk9VUEVEX1NGQl0sCi0gICAgICAgICAgICAgICBXb3JkMTYgICAgICAgICAgbG9nU2ZiRW5lcmd5W01BWF9DSEFOTkVMU11bTUFYX0dST1VQRURfU0ZCXSwKLSAgICAgICAgICAgICAgIFBTWV9PVVRfQ0hBTk5FTCBwc3lPdXRDaGFubmVsW01BWF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GljZW5zZSBmb3IgdGhlIHNwZWNpZmljIGxhbmd1YWdlIGdvdmVybmluZyBwZXJtaXNzaW9ucyBhbmQKLSAqKiBsaW1pdGF0aW9ucyB1bmRlciB0aGUgTGljZW5zZS4KLSAqLwotLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKLQlGaWxlOgkJdG5zLmgKLQotCUNvbnRlbnQ6CVROUyBzdHJ1Y3R1cmVzCi0KLSoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0KLSNpZm5kZWYgX1ROU19ICi0jZGVmaW5lIF9UTlNfSAotCi0jaW5jbHVkZSAidHlwZWRlZi5oIgotI2luY2x1ZGUgInBzeV9jb25zdC5oIgotCi0KLQotI2RlZmluZSBUTlNfTUFYX09SREVSIDEyCi0jZGVmaW5lIFROU19NQVhfT1JERVJfU0hPUlQgNQotCi0jZGVmaW5lIEZJTFRFUl9ESVJFQ1RJT04gICAgMAotCi10eXBlZGVmIHN0cnVjdHsgLypzdHVmZiB0aGF0IGlzIHRhYnVsYXRlZCBkZXBlbmRlbnQgb24gYml0cmF0ZSBldGMuICovCi0gIFdvcmQxNiAgICAgdGhyZXNoT247ICAgICAgICAgICAgICAgIC8qIG1pbi4gcHJlZGljdGlvbiBnYWluIGZvciB1c2luZyB0bnMgVEFCVUwgKiAxMDAqLwotICBXb3JkMzIgICAgIGxwY1N0YXJ0RnJlcTsgICAgICAgICAgICAvKiBsb3dlc3QgZnJlcSBmb3IgbHBjIFRBQlVMKi8KLSAgV29yZDMyICAgICBscGNTdG9wRnJlcTsgICAgICAgICAgICAgLyogVEFCVUwgKi8KLSAgV29yZDMyICAgICB0bnNUaW1lUmVzb2x1dGlvbjsKLX1UTlNfQ09ORklHX1RBQlVMQVRFRDsKLQotCi10eXBlZGVmIHN0cnVjdCB7IC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i0qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotCi0vKgotICAgVGVtcG9yYWwgbm9pc2Ugc2hhcGluZwotICovCi0jaWZuZGVmIF9UTlNfRlVOQ19ICi0jZGVmaW5lIF9UTlNfRlVOQ19ICi0jaW5jbHVkZSAidHlwZWRlZi5oIgotI2luY2x1ZGUgInBzeV9jb25maWd1cmF0aW9uLmgiCi0KLVdvcmQxNiBJbml0VG5zQ29uZmlndXJhdGlvbkxvbmcoV29yZDMyIGJpdHJhdGUsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFdvcmQzMiBzYW1wbGVyYXRlLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBXb3JkMTYgY2hhbm5lbHMsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFROU19DT05GSUcgKnRuc0NvbmZpZywKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgUFNZX0NPTkZJR1VSQVRJT05fTE9ORyAqcHN5Q29uZmlnLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBXb3JkMTYgYWN0aXZlKTsKLQotV29yZDE2IEluaXRUbnNDb25maWd1cmF0aW9uU2hvcnQoV29yZDMyIGJpdHJhdGUsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBXb3JkMzIgc2FtcGxlcmF0ZSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFdvcmQxNiBjaGFubmVscywKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFROU19DT05GSUcgKnRuc0NvbmZpZywKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFBTWV9DT05GSUdVUkFUSU9OX1NIT1JUICpwc3lDb25maWcsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBXb3JkMTYgYWN0aXZlKTsKLQotV29yZDMyIFRuc0RldGVjdChUTlNfREFUQSogdG5zRGF0YSwKLSAgICAgICAgICAgICAgICAgVE5TX0NPTkZJRyB0QywKLSAgICAgICAgICAgICAgICAgV29yZDMyKiBwU2NyYXRjaFRucywKLSAgICAgICAgICAgICAgICAgY29uc3QgV29yZDE2IHNmYk9mZnNldFtdLAotICAgICAgICAgICAgICAgICBXb3JkMzIqIHNwZWN0cnVtLAotICAgICAgICAgICAgICAgICBXb3JkMTYgc3ViQmxvY2tOdW1iZXIsCi0gICAgICAgICAgICAgICAgIFdvcmQxNiBibG9ja1R5cGUsCi0gICAgICAgICAgICAgICAgIFdvcmQzMiAqIHNmYkVuZXJneSk7Ci0KLXZvaWQgVG5zU3luYyhUTlNfREFUQSAqdG5zRGF0YURlc3QsCi0gICAgICAgICAgICAgY29uc3QgVE5TX0RBVEEgKnRuc0RhdGFTcmMsCi0gICAgICAgICAgICAgY29uc3QgVE5TX0NPTkZJRyB0QywKLSAgICAgICAgICAgICBjb25zdCBXb3JkMTYgc3ViQmxvY2tOdW1iZXIsCi0gICAgICAgICAgICAgY29uc3QgV29yZDE2IGJsb2NrVHlwZSk7Ci0KLVdvcmQxNiBUbnNFbmNvZGUoVE5TX0lORk8qIHRuc0luZm8sCi0gICAgICAgICAgICAgICAgIFROU19EQVRBKiB0bnNEYXRhLAotICAgICAgICAgICAgICAgICBXb3JkMTYgbnVtT2ZTZmIsCi0gICAgICAgICAgICAgICAgIFROU19DT05GSUcgdEMsCi0gICAgICAgICAgICAgICAgIFdvcmQxNiBsb3dQYXNzTGluZSwKLSAgICAgICAgICAgICAgICAgV29yZDMyKiBzcGVjdHJ1bSwKLSAgICAgICAgICAgICAgICAgV29yZDE2IHN1YkJsb2NrTnVtYmVyLAotICAgICAgICAgICAgICAgICBXb3JkMTYgYmxvY2tUeXBlKTsKLQotdm9pZCBBcHBseVRuc011bHRUYWJsZVRvUmF0aW9zKFdvcmQxNiBzdGFydENiLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFdvcmQxNiBzd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biBhbiAiQVMgSVMiIEJBU0lTLAotICoqIFdJVEhPVVQgV0FSUkFOVElFUyBPUiBDT05ESVRJT05TIE9GIEFOWSBLSU5ELCBlaXRoZXIgZXhwcmVzcyBvciBpbXBsaWVkLgotICoqIFNlZSB0aGUgTGljZW5zZSBmb3IgdGhlIHNwZWNpZmljIGxhbmd1YWdlIGdvdmVybmluZyBwZXJtaXNzaW9ucyBhbmQKLSAqKiBsaW1pdGF0aW9ucyB1bmRlciB0aGUgTGljZW5zZS4KLSAqLwotLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKLQlGaWxlOgkJdG5zX3BhcmFtLmgKLQotCUNvbnRlbnQ6CVROUyBwYXJhbWV0ZXJzCi0KLSoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0KLS8qCi0gICBUTlMgcGFyYW1ldGVycwotICovCi0jaWZuZGVmIF9UTlNfUEFSQU1fSAotI2RlZmluZSBfVE5TX1BBUkFNX0gKLQotI2luY2x1ZGUgInRucy5oIgotCi10eXBlZGVmIHN0cnVjdHsKLSAgV29yZDMyIHNhbXBsaW5nUmF0ZTsKLSAgV29yZDE2IG1heEJhbmRMb25nOwotICBXb3JkMTYgbWF4QmFuZFNob3J0OwotfVROU19NQVhfVEFCX0VOVFJZOwotCi10eXBlZGVmIHN0cnVjdHsKLSAgICBXb3JkMzIgYml0UmF0ZUZyb207Ci0gICAgV29yZDMyIGJpdFJhdGVUbzsKLSAgICBjb25zdCBUTlNfQ09ORklHX1RBQlVMQVRFRCAqcGFyYW1Nb25vX0xvbmc7ICAvKiBjb250YWlucyBUTlMgcGFyYW1ldGVycyAqLwotICAgIGNvbnN0IFROU19DT05GSUdfVEFCVUxBVEVEICpwYXJhbU1vbm9fU2hvcnQ7Ci0gICAgY29uc3QgVE5TX0NPTkZ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GhlIExpY2Vuc2UgYXQKLSAqKgotICoqICAgICBodHRwOi8vd3d3LmFwYWNoZS5vcmcvbGljZW5zZXMvTElDRU5TRS0yLjAKLSAqKgotICoqIFVubGVzcyByZXF1aXJlZCBieSBhcHBsaWNhYmxlIGxhdyBvciBhZ3JlZWQgdG8gaW4gd3JpdGluZywgc29mdHdhcmUKLSAqKiBkaXN0cmlidXRlZCB1bmRlciB0aGUgTGljZW5zZSBpcyBkaXN0cmlidXRlZCBvbiBhbiAiQVMgSVMiIEJBU0lTLAotICoqIFdJVEhPVVQgV0FSUkFOVElFUyBPUiBDT05ESVRJT05TIE9GIEFOWSBLSU5ELCBlaXRoZXIgZXhwcmVzcyBvciBpbXBsaWVkLgotICoqIFNlZSB0aGUgTGljZW5zZSBmb3IgdGhlIHNwZWNpZmljIGxhbmd1YWdlIGdvdmVybmluZyBwZXJtaXNzaW9ucyBhbmQKLSAqKiBsaW1pdGF0aW9ucyB1bmRlciB0aGUgTGljZW5zZS4KLSAqLwotLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKLQlGaWxlOgkJdHJhbnNmb3JtLmgKLQotCUNvbnRlbnQ6CU1EQ1QgVHJhbnNmb3JtIGZ1bmN0aW9ucwotCi0qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotCi0jaWZuZGVmICBfX1RSQU5TRk9STV9IX18KLSNkZWZpbmUgX19UUkFOU0ZPUk1fSF9fCi0KLSNpbmNsdWRlICJ0eXBlZGVmLmgiCi0KLXZvaWQgVHJhbnNmb3JtX1JlYWwoV29yZDE2ICptZGN0RGVsYXlCdWZmZXIsCi0gICAgICAgICAgICAgICAgICAgIFdvcmQxNiAqdGltZVNpZ25hbCwKLSAgICAgICAgICAgICAgICAgICAgV29yZDE2IGNoSW5jcmVtZW50LCAgICAg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yBPRiBBTlkgS0lORCwgZWl0aGVyIGV4cHJlc3Mgb3IgaW1wbGllZC4KLSAqKiBTZWUgdGhlIExpY2Vuc2UgZm9yIHRoZSBzcGVjaWZpYyBsYW5ndWFnZSBnb3Zlcm5pbmcgcGVybWlzc2lvbnMgYW5kCi0gKiogbGltaXRhdGlvbnMgdW5kZXIgdGhlIExpY2Vuc2UuCi0gKi8KLS8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCi0JRmlsZToJCWFhY19yb20uYwotCi0JQ29udGVudDoJY29uc3RhbnQgdGFibGVzCi0KLSoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0KLSNpbmNsdWRlICJhYWNfcm9tLmgiCi0KLSNpZiBkZWZpbmVkIChBUk1WNUUpICYmICFkZWZpbmVkIChBUk1WN05lb24pCi0KLS8qCi0gKiAgUTMwIGZvciAxMjggYW5kIDEwMjQKLSAqCi0gKiBmb3IgKGkgPSAwOyBpIDwgbnVtLzQ7IGkrKykgewotICogICBhbmdsZSA9IChpICsgMC4xMjUpICogTV9QSSAvIG51bTsKLSAqICAgeCA9IGNvcyhhbmdsZSkgKiAoMSA8PCAzMCk7Ci0gKiAgIHggPSBzaW4oYW5nbGUpICogKDEgPDwgMzApOwotICoKLSAqICAgYW5nbGUgPSAobnVtLzIgLSAxIC0gaSArIDAuMTI1KSAqIE1fUEkgLyBudW07Ci0gKiAgIHggPSBjb3MoYW5nbGUpICogKDEgPDwgMzApOwotICogICB4ID0gc2luKGFuZ2xlKSAqICgxIDw8IDMwKTsKLSAqIH0KLSAqLwotY29uc3QgaW50IGNvc3NpbnRhYlsxMjggKyAxMDI0XSA9IHsKLQkvKiAxMjggKi8KLQkweDNmZmZlYzQzLCAweDAwMzI0M2YxLCAweDAxNWZkNGQyLCAweDNmZmMzOGQ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NywweDBiMDl9LAotICAgICAgezB4MDkwOCwweDA3MDYsMHgwOTA4fSwKLSAgICAgIHsweDBiMDgsMHgwOTA3LDB4MGIwOX0KLSAgICB9LAotICAgIHsKLSAgICAgIHsweDBhMDgsMHgwNzA2LDB4MDkwN30sCi0gICAgICB7MHgwNzA2LDB4MDUwNCwweDA3MDZ9LAotICAgICAgezB4MDkwOCwweDA3MDYsMHgwYTA3fQotICAgIH0sCi0gICAgewotICAgICAgezB4MGIwOSwweDA5MDcsMHgwYjA5fSwKLSAgICAgIHsweDBhMDcsMHgwNzA2LDB4MDkwOH0sCi0gICAgICB7MHgwYjA5LDB4MDkwNywweDBiMDl9Ci0gICAgfQotICB9Ci19OwotCi0KLWNvbnN0IFVXb3JkMTYgaHVmZl9sdGFiM180WzNdWzNdWzNdWzNdPQotewotICB7Ci0gICAgewotICAgICAgezB4MDEwNCwweDA0MDUsMHgwODA4fSwKLSAgICAgIHsweDA0MDUsMHgwNTA0LDB4MDgwOH0sCi0gICAgICB7MHgwOTA5LDB4MDkwOCwweDBhMGJ9Ci0gICAgfSwKLSAgICB7Ci0gICAgICB7MHgwNDA1LDB4MDYwNSwweDA5MDh9LAotICAgICAgezB4MDYwNSwweDA2MDQsMHgwOTA4fSwKLSAgICAgIHsweDA5MDgsMHgwOTA3LDB4MGEwYX0KLSAgICB9LAotICAgIHsKLSAgICAgIHsweDA5MDksMHgwYTA4LDB4MGQwYn0sCi0gICAgICB7MHgwOTA4LDB4MDkwOCwweDBiMGF9LAotICAgICAgezB4MGIwYiwweDBhMGEsMHgwYzBifQotICAgIH0KLSAgfSwKLSAgewotICAgIHsKLSAgICAgIHsweDA0MDQsMHgwNjA1LDB4MGEwOH0sCi0gICAgICB7MHgwNjA0LDB4MDcwNCwweDBhMDh9LAotICAgICAgezB4MGEwOCwweDBhMDgsMHgwYzBhfQotICAgIH0sCi0gICAgewotICAgICAgezB4MDUwNCwweDA3MDQsMHgwYjA4fSwKLSAgICAgIHsweDA2MDQsMHgw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AwMDNmZmU2LAotICAweDAwMDNmZmU3LAotICAweDAwMDNmZmU1LAotICAweDAwMDdmZmY1LAotICAweDAwMDdmZmYxLAotICAweDAwMDdmZmVkLAotICAweDAwMDdmZmY2LAotICAweDAwMDdmZmVlLAotICAweDAwMDdmZmVmLAotICAweDAwMDdmZmYwLAotICAweDAwMDdmZmZjLAotICAweDAwMDdmZmZkLAotICAweDAwMDdmZmZmLAotICAweDAwMDdmZmZlLAotICAweDAwMDdmZmY3LAotICAweDAwMDdmZmY4LAotICAweDAwMDdmZmZiLAotICAweDAwMDdmZmY5LAotICAweDAwMDNmZmU0LAotICAweDAwMDdmZmZhLAotICAweDAwMDNmZmUzLAotICAweDAwMDFmZmVmLAotICAweDAwMDFmZmYwLAotICAweDAwMDBmZmY1LAotICAweDAwMDFmZmVlLAotICAweDAwMDBmZmYyLAotICAweDAwMDBmZmYzLAotICAweDAwMDBmZmY0LAotICAweDAwMDBmZmYxLAotICAweDAwMDA3ZmY2LAotICAweDAwMDA3ZmY3LAotICAweDAwMDAzZmY5LAotICAweDAwMDAzZmY1LAotICAweDAwMDAzZmY3LAotICAweDAwMDAzZmYzLAotICAweDAwMDAzZmY2LAotICAweDAwMDAzZmYyLAotICAweDAwMDAxZmY3LAotICAweDAwMDAxZmY1LAotICAweDAwMDAwZmY5LAotICAweDAwMDAwZmY3LAotICAweDAwMDAwZmY2LAotICAweDAwMDAwN2Y5LAotICAweDAwMDAwZmY0LAotICAweDAwMDAwN2Y4LAotICAweDAwMDAwM2Y5LAotICAweDAwMDAwM2Y3LAotICAweDAwMDAwM2Y1LAotICAweDAwMDAwMWY4LAotICAweDAwMDAwMWY3LAotICAweDAwMDAwMGZhLAotICAweDAwMDAwMGY4LAotICAweDAwMDAwMGY2LAotICAweDAwMDAwMDc5LAotICAweDAwMDAwMDNhLAotICAweDAwMDAwMDM4LAotICAweDAwMDAwMDFhLAotICAweDAwMDAwMDBiLAotICAweDAwMDAwMDA0LAotICAweDAwMDAwMDAwLAotICAweDAwMDAwMDBhLAotICAweDAwMDAwMDBjLAotICAweDAwMDAwMDFiLAotICAweDAwMDAwMDM5LAotICAweDAwMDAwMDNiLAotICAweDAwMDAwMDc4LAotICAweDAwMDAwMDdhLAotICAweDAwMDAwMGY3LAotICAweDAwMDAwMGY5LAotICAweDAwMDAwMWY2LAotICAweDAwMDAwMWY5LAotICAweDAwMDAwM2Y0LAotICAweDAwMDAwM2Y2LAotICAweDAwMDAwM2Y4LAotICAweDAwMDAwN2Y1LAotICAweDAwMDAwN2Y0LAotICAweDAwMDAwN2Y2LAotICAweDAwMDAwN2Y3LAotICAweDAwMDAwZmY1LAotICAweDAwMDAwZmY4LAotICAweDAwMDAxZmY0LAotICAweDAwMDAxZmY2LAotICAweDAwMDAxZmY4LAotICAweDAwMDAzZmY4LAotICAweDAwMDAzZmY0LAotICAweDAwMDBmZmYwLAotICAweDAwMDA3ZmY0LAotICAweDAwMDBmZmY2LAotICAweDAwMDA3ZmY1LAotICAweDAwMDNmZmUyLAotICAweDAwMDdmZmQ5LAotICAweDAwMDdmZmRhLAotICAweDAwMDdmZmRiLAotICAweDAwMDdmZmRjLAotICAweDAwMDdmZmRkLAotICAweDAwMDdmZmRlLAotICAweDAwMDdmZmQ4LAotICAweDAwMDdmZmQyLAotICAweDAwMDdmZmQzLAotICAweDAwMDdmZmQ0LAotICAweDAwMDdmZmQ1LAotICAweDAwMDdmZmQ2LAotICAweDAwMDdmZmYyLAotICAweDAwMDdmZmRmLAotICAweDAwMDdmZmU3LAotICAweDAwMDdmZmU4LAotICAweDAwMDdmZmU5LAotICAweDAwMDdmZmVhLAotICAweDAwMDdmZmViLAotICAweDAwMDdmZmU2LAotICAweDAwMDdmZmUwLAotICAweDAwMDdmZmUxLAotICAweDAwMDdmZmUyLAotICAweDAwMDdmZmUzLAotICAweDAwMDdmZmU0LAotICAweDAwMDdmZmU1LAotICAweDAwMDdmZmQ3LAotICAweDAwMDdmZmVjLAotICAweDAwMDdmZmY0LAotICAweDAwMD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HgxYzdiOTBmMCwgIC8qICAxICovCi0gIDB4NGZjZTgzYWEsICAvKiAgMiAqLwotICAweDczNTJmMmM0LCAgLyogIDMgKi8KLX07Ci0KLQotLyoKLSAgNCBiaXQgcmVzb2x1dGlvbgotKi8KLQotY29uc3QgV29yZDMyIHRuc0NvZWZmNFsxNl0gPQotewotICAweDgwOGJjODRiLAotICAweDg0ZTJlNTdkLAotICAweDhkNmI0OWZiLAotICAweDk5ZGE5MjA3LAotICAweGE5YzQ1NzA3LAotICAweGJjOWRkZTc4LAotICAweGQxYzJkNGZjLAotICAweGU4N2FlNTM5LAotICAweDAwMDAwMDAwLAotICAweDFhOWNkOWMwLAotICAweDM0MGZmMjNiLAotICAweDRiM2M4YmY3LAotICAweDVmMWY1ZTgwLAotICAweDZlZDllYjg0LAotICAweDc5YmMzODgwLAotICAweDdmNGM3ZTg5Ci19OwotCi1jb25zdCBXb3JkMzIgdG5zQ29lZmY0Qm9yZGVyc1sxNl09Ci17Ci0gIDB4ODAwMDAwMDAsICAvKiAtOCAqLwotICAweDgyMmRlZmVmLCAgLyogLTcgKi8KLSAgMHg4OGE0YmZlNSwgIC8qIC02ICovCi0gIDB4OTMyYzE1OWMsICAvKiAtNSAqLwotICAweGExNjgyN2MxLCAgLyogLTQgKi8KLSAgMHhiMmRjZGUyNiwgIC8qIC0zICovCi0gIDB4YzZmMjBiOTEsICAvKiAtMiAqLwotICAweGRjZjg5YzY0LCAgLyogLTEgKi8KLSAgMHhmNDMwOGNlMSwgIC8qICAwICovCi0gIDB4MGQ2MTMwNTQsICAvKiAgMSAqLwotICAweDI3OGRkZTgwLCAgLyogIDIgKi8KLSAgMHg0MDAwMDAxYiwgIC8qICAzICovCi0gIDB4NTVhNjEyN2MsICAvKiAgNCAqLwotICAweDY3OGRkZThmLCAgLyogIDUgKi8KLSAgMHg3NGVmMGVkOCwgIC8qICA2ICovCi0gIDB4N2QzM2YwZGIgICAvKiAgNyAqLwotfTsKLQotCi1jb25zdCB1bnNpZ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NfbWFpbi5oIgotI2luY2x1ZGUgInBzeV9tYWluLmgiCi0jaW5jbHVkZSAiY2hhbm5lbF9tYXAuaCIKLSNpbmNsdWRlICJhYWNfcm9tLmgiCi0KLS8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgotKgotKiBmdW5jdGlvbiBuYW1lOiBBYWNJbml0RGVmYXVsdENvbmZpZwotKiBkZXNjcmlwdGlvbjogIGdpdmVzIHJlYXNvbmFibGUgZGVmYXVsdCBjb25maWd1cmF0aW9uCi0qCi0qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotdm9pZCBBYWNJbml0RGVmYXVsdENvbmZpZyhBQUNFTkNfQ09ORklHICpjb25maWcpCi17Ci0gIC8qIGRlZmF1bHQgY29uZmlndXJhdGlvbnMgKi8KLSAgY29uZmlnLT5hZHRzVXNlZCAgICAgICAgPSAxOwotICBjb25maWctPm5DaGFubmVsc0luICAgICA9IDI7Ci0gIGNvbmZpZy0+bkNoYW5uZWxzT3V0ICAgID0gMjsKLSAgY29uZmlnLT5iaXRSYXRlICAgICAgICAgPSAxMjgwMDA7Ci0gIGNvbmZpZy0+YmFuZFdpZHRoICAgICAgID0gMDsKLX0KLQotLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCi0qCi0qIGZ1bmN0aW9uIG5hbWU6IEFhY0VuY09wZW4KLSogZGVzY3JpcHRpb246ICBhbGxvY2F0ZSBhbmQgaW5pdGlhbGl6ZSBhIG5ldyBlbmNvZGVyIGluc3RhbmNlCi0qIHJldHVybnM6ICAgICAgMCBpZiBzdWNjZXNzCi0qCi0qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotV29yZDE2ICBBYWNFbmNPcGVuKCAgQUFDX0VOQ09ERVIqICAgICAgaEFhY0VuYywgICAgICAgIC8qIHBvaW50ZXIgdG8gYW4gZW5jb2RlciBoYW5kbGUsIGluaXRpYWxpemVkIG9uIHJldHVybiAqLwotICAgICAgICAgICAgICAgICAgICAgY29uc3QgIEFBQ0VOQ19DT05GSUcgICAgIGNvbmZpZyAgIC8qIHByZS1pbml0aWFsaXplZCBjb25maWcgc3RydWN0ICovCi0gICAgICAgICAgICAgICAgICAgICApCi17Ci0gIFdvcmQzMiBpOwotICBXb3JkMzIgZXJyb3IgPSAwOwotICBXb3JkMTYgcHJvZmlsZSA9IDE7Ci0KLSAgRUxFTUVOVF9JTkZPICplbEluZm8gPSBOVUxMOwotCi0gIGlmIChoQWFjRW5jPT0wKSB7Ci0gICAgZXJyb3I9MTsKLSAgfQotCi0gIGlmICghZXJyb3IpIHsKLSAgICBoQWFjRW5jLT5jb25maWcgPSBjb25maWc7Ci0gIH0KLQotICBpZiAoIWVycm9yKSB7Ci0gICAgZXJyb3IgPSBJbml0RWxlbWVudEluZm8gKGNvbmZpZy5uQ2hhbm5lbHNPdXQsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICZoQWFjRW5jLT5lbEluZm8pOwotICB9Ci0KLSAgaWYgKCFlcnJvcikgewotICAgIGVsSW5mbyA9ICZoQWFjRW5jLT5lbEluZm87Ci0gIH0KLQotICBpZiAoIWVycm9yKSB7Ci0gICAgLyogdXNlIG9yIG5vdCB0bnMgdG9vbCBmb3IgbG9uZyBhbmQgc2hvcnQgYmxvY2sgKi8KLQkgV29yZDE2IHRuc01hc2s9MzsKLQotCS8qIGluaXQgZW5jb2RlciBwc3ljaG9hY291c3RpYyAqLwotICAgIGVycm9yID0gcHN5TWFpbkluaXQoJmhBYWNFbmMtPnBzeUtlcm5lbCwKLSAgICAgICAgICAgICAgICAgICAgICAgIGNvbmZpZy5zYW1wbGV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AgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoY29uZmlnLnNhbXBsZVJhdGU+PjEpKTsKLQotICAgIHFjSW5pdC5tYXhCaXRGYWMgPSAoV29yZDE2KSAoKDEwMCAqIChNQVhCSVRTX0NPRUYtTUlOQklUU19DT0VGKSogZWxJbmZvLT5uQ2hhbm5lbHNJbkVsKS8KLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAocWNJbml0LmF2ZXJhZ2VCaXRzP3FjSW5pdC5hdmVyYWdlQml0czoxKSk7Ci0KLSAgICBxY0luaXQuYml0cmF0ZSA9IGNvbmZpZy5iaXRSYXRlOwotCi0gICAgZXJyb3IgPSBRQ0luaXQoJmhBYWNFbmMtPnFjS2VybmVsLCAmcWNJbml0KTsKLSAgfQotCi0gIC8qIGluaXQgYml0c3RyZWFtIGVuY29kZXIgKi8KLSAgaWYgKCFlcnJvcikgewotICAgIGhBYWNFbmMtPmJzZUluaXQubkNoYW5uZWxzICAgPSBlbEluZm8tPm5DaGFubmVsc0luRWw7Ci0gICAgaEFhY0VuYy0+YnNlSW5pdC5iaXRyYXRlICAgICA9IGNvbmZpZy5iaXRSYXRlOwotICAgIGhBYWNFbmMtPmJzZUluaXQuc2FtcGxlUmF0ZSAgPSBjb25maWcuc2FtcGxlUmF0ZTsKLSAgICBoQWFjRW5jLT5ic2VJbml0LnByb2ZpbGUgICAgID0gcHJvZmlsZTsKLSAgfQotCi0gIHJldHVybiBlcnJvcjsKLX0KLQotLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCi0qCi0qIGZ1bmN0aW9uIG5hbWU6IEFhY0VuY0VuY29kZQotKiBkZXNjcmlwdGlvbjogIGVuY29kZSBwY20gdG8gYWFjIGRhdGEgY29yZSBmdW5jdGlvbgotKiByZXR1cm5zOiAgICAgIDAgaWYgc3VjY2VzcwotKgotKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLVdvcmQxNiBBYWNFbmNFbmNvZGUoQUFDX0VOQ09ERVIgKmFhY0VuYywJCS8qITwgYW4gZW5jb2RlciBoYW5kbGUgKi8KLSAgICAgICAgICAgICAgICAgICAgV29yZDE2ICp0aW1lU2lnbmFsLCAgICAgICAgIC8qITwgQkxPQ0tTSVpFKm5DaGFubmVscyBhdWRpbyBzYW1wbGVzLCBpbnRlcmxlYXZlZCAqLwotICAgICAgICAgICAgICAgICAgICBjb25zdCBVV29yZDggKmFuY0J5dGVzLCAgICAgLyohPCBwb2ludGVyIHRvIGFuY2lsbGFyeSBkYXRhIGJ5dGVzICovCi0gICAgICAgICAgICAgICAgICAgIFdvcmQxNiAqbnVtQW5jQnl0ZXMsCQkvKiE8IG51bWJlciBvZiBhbmNpbGxhcnkgRGF0YSBCeXRlcyAqLwotICAgICAgICAgICAgICAgICAgICBVV29yZDggKm91dEJ5dGVzLCAgICAgICAgICAgLyohPCBwb2ludGVyIHRvIG91dHB1dCBidWZmZXIgKG11c3QgYmUgbGFyZ2UgTUlOQklUU19DT0VGLzgqTUFYX0NIQU5ORUxTIGJ5dGVzKSAqLwotICAgICAgICAgICAgICAgICAgICBWT19VMzIgKm51bU91dEJ5dGVzICAgICAgICAgLyohPCBudW1iZXIgb2YgYnl0ZXMgaW4gb3V0cHV0IGJ1ZmZlciBhZnRlciBwcm9jZXNzaW5nICovCi0gICAgICAgICAgICAgICAgICAgICkKLXsKLSAgRUxFTUVOVF9JTkZPICplbEluZm8gPSAmYWFjRW5jLT5lbEluZm87Ci0gIFdvcmQxNiBnbG9iVXNlZEJpdHM7Ci0gIFdvcmQxNiBhbmNEYXRhQnl0ZXMsIGFuY0RhdGFCeXRlc0xlZnQ7Ci0KLSAgYW5jRGF0YUJ5dGVzID0gYW5jRGF0YUJ5dGVzTGVmdCA9ICpudW1BbmN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OWSBLSU5ELCBlaXRoZXIgZXhwcmVzcyBvciBpbXBsaWVkLgotICoqIFNlZSB0aGUgTGljZW5zZSBmb3IgdGhlIHNwZWNpZmljIGxhbmd1YWdlIGdvdmVybmluZyBwZXJtaXNzaW9ucyBhbmQKLSAqKiBsaW1pdGF0aW9ucyB1bmRlciB0aGUgTGljZW5zZS4KLSAqLwotLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKLQlGaWxlOgkJYWRqX3Roci5jCi0KLQlDb250ZW50OglUaHJlc2hvbGQgY29tcGVuc2F0aW9uIGZ1bmN0aW9ucwotCi0qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotCi0jaW5jbHVkZSAiYmFzaWNfb3AuaCIKLSNpbmNsdWRlICJvcGVyXzMyYi5oIgotI2luY2x1ZGUgImFkal90aHJfZGF0YS5oIgotI2luY2x1ZGUgImFkal90aHIuaCIKLSNpbmNsdWRlICJxY19kYXRhLmgiCi0jaW5jbHVkZSAibGluZV9wZS5oIgotI2luY2x1ZGUgPHN0cmluZy5oPgotCi0KLSNkZWZpbmUgIG1pblNuckxpbWl0ICAgIDB4NjY2NiAvKiAxIGRCICovCi0jZGVmaW5lICBQRUJJVFNfQ09FRgkweDE3MGEgLyogMC4xOCooMSA8PCAxNSkqLwotCi0jZGVmaW5lICBIT0xFX1RIUl9MT05HCTB4Mjg3MwkvKiAwLjMxNiooMSA8PCAxNSkgKi8KLSNkZWZpbmUgIEhPTEVfVEhSX1NIT1JUIDB4NDAwMCAgLyogMC41ICAqKDEgPDwgMTUpICovCi0KLSNkZWZpbmUgIE1TX1RIUlNQUkVBRF9DT0VGIDB4NzMzMyAgLyogMC45ICogKDEgPDwgMTUpICovCi0KLSNkZWZpbmUJIE1JTl9TTlJfQ09FRgkgICAweDY1MWYgIC8qIDMuMTYqICgxIDw8ICgxNSAtIDIpKSAqLwotCi0vKiB2YWx1ZXMgZm9yIGF2b2lkIGhvbGUgZmxhZyAqLwotZW51bSBfYXZvaWRfaG9sZV9zdGF0ZSB7Ci0gIE5PX0FIICAgICAgICAgICAgICA9MCwKLSAgQUhfSU5BQ1RJVkUgICAgICAgID0xLAotICBBSF9BQ1RJVkUgICAgICAgICAgPTIKLX07Ci0KLS8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgotKgotKiBmdW5jdGlvbiBuYW1lOmJpdHMycGUKLSogZGVzY3JpcHRpb246IGNvbnZlcnQgZnJvbSBiaXRzIHRvIHBlCi0qCQkJICAgcGUgPSAxLjE4KmRlc2lyZWRCaXRzCi0qCi0qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotV29yZDE2IGJpdHMycGUoY29uc3QgV29yZDE2IGJpdHMpIHsKLSAgcmV0dXJuIChiaXRzICsgKChQRUJJVFNfQ09FRiAqIGJpdHMpID4+IDE1KSk7Ci19Ci0KLS8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgotKgotKiBmdW5jdGlvbiBuYW1lOmNhbGNUaHJlc2hFeHAKLSogZGVzY3JpcHRpb246IGxvdWRuZXNzIGNhbGN1bGF0aW9uICh0aHJlc2hvbGQgdG8gdGhlIHBvd2VyIG9mIHJlZEV4cCkKLSoJCQkgICB0aHIobileMC4yNQotKgotKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLXN0YXRpYyB2b2lkIGNhbGNUaHJlc2hFeHAoV29yZDMyIHRockV4cFtNQVhfQ0hBTk5F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taW5TbnJSZWQsIDIwKTsgLyogMTEwOiAoMC4zNzUocmVkT2ZmcykrMSkqODAsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDM6IDAuMDAzNzUocmVkUmF0aW9GYWMpKjgwCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDIwOiAwLjI1KG1heFJlZCkgKiA4MCAqLwotCi0gICAgICAgICAgc25yUmVkID0gbWluU25yUmVkICogaUxvZzQoKHBzeU91dENoYW4tPnNmYk1pblNucltzZmJPZmZzK3NmYl0gPDwgMTYpKTsKLSAgICAgICAgICAvKgotICAgICAgICAgICAgIHNuclJlZEkgc2kgbm93IHNjYWxlZCBieSA4MCAobWluU25yUmVkKSBhbmQgNCAoZmZyX2lMb2c0KQotICAgICAgICAgICovCi0KLSAgICAgICAgICBuZXdNaW5TbnIgPSByb3VuZDE2KHBvdzJfeHkoc25yUmVkLDgwKjQpKTsKLQotICAgICAgICAgIHBzeU91dENoYW4tPnNmYk1pblNucltzZmJPZmZzK3NmYl0gPSBtaW4obmV3TWluU25yLCBtaW5TbnJMaW1pdCk7Ci0gICAgICAgIH0KLSAgICAgIH0KLSAgICB9Ci0gIH0KLQotfQotCi0KLS8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgotKgotKiBmdW5jdGlvbiBuYW1lOmluaXRBdm9pZEhvbGVGbGFnCi0qIGRlc2NyaXB0aW9uOiBkZXRlcm1pbmUgYmFuZHMgd2hlcmUgYXZvaWQgaG9sZSBpcyBub3QgbmVjZXNzYXJ5IHJlc3AuIHBvc3NpYmxlCi0qCi0qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotc3RhdGljIHZvaWQgaW5pdEF2b2lkSG9sZUZsYWcoV29yZ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kcpOwotICAgICAgICAgICAgdG1wTWluU25yID0gbWF4KHRtcE1pblNuciwgdGhyZXNob2xkKTsKLSAgICAgICAgICAgICpwc2ZiTWluU25yID0gbWluKCpwc2ZiTWluU25yLCB0bXBNaW5TbnIpOwotICAgICAgICAgIH0KLSAgICAgICAgICAvKiB2YWxsZXkgPyAqLwotCi0gICAgICAgICAgaWYgKChzZmJFbiA8IChhdmdFbiA+PiAxKSkgJiYgKHNmYkVuID4gMCkpIHsKLSAgICAgICAgICAgIFdvcmQzMiB0bXBNaW5TbnI7Ci0gICAgICAgICAgICBXb3JkMzIgbWluU25yRW4gPSBMX21weV93eChhdmdFbiwgKnBzZmJNaW5TbnIpOwotCi0gICAgICAgICAgICBpZihtaW5TbnJFbiA8IHNmYkVuKSB7Ci0JCQkgIHNoaWZ0ID0gbm9ybV9sKHNmYkVuKTsKLSAgICAgICAgICAgICAgdG1wTWluU25yID0gRGl2XzMyKCBtaW5TbnJFbiA8PCBzaGlmdCwgc2ZiRW48PHNoaWZ0KTsKLSAgICAgICAgICAgIH0KLSAgICAgICAgICAgIGVsc2UgewotICAgICAgICAgICAgICB0bXBNaW5TbnIgPSBNQVhfMTY7Ci0gICAgICAgICAgICB9Ci0gICAgICAgICAgICB0bXBNaW5TbnIgPSBtaW4obWluU25yTGltaXQsIHRtcE1pblNucik7Ci0KLSAgICAgICAgICAgICpwc2ZiTWluU25yID0KLSAgICAgICAgICAgICAgKG1pbigodG1wTWluU25yID4+ICAyKSwgbXVsdCgqcHNmYk1pblNuciwgTUlOX1NOUl9DT0VGKSkgPDwgMik7Ci0gICAgICAgICAgfQotCQkgIHBzZmJNaW5TbnIrKzsKLSAgICAgICAgfQotICAgICAgfQotICAgIH0KLSAgfQotCi0gIC8qIHN0ZXJlbzogYWRhcHQgdGhlIG1pbmltdW0gcmVxdWlyZW1lbnRzIHNmYk1pblNuciBvZiBtaWQgYW5kCi0gICAgIHNpZGUgY2hhbm5lbHMgKi8KLQotICBpZiAobkNoYW5uZ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WhGbGFnW2NoXSArIHNmYkdycDsKLQkgIGZvciAoc2ZiPTA7IHNmYjxwc3lPdXRDaGFuLT5tYXhTZmJQZXJHcm91cDsgc2ZiKyspIHsKLQotICAgICAgICBpZiAoKHBzeU91dENoYW4tPnNmYlNwcmVhZGVkRW5lcmd5W3NmYkdycCtzZmJdID4gcHN5T3V0Q2hhbi0+c2ZiRW5lcmd5W3NmYkdycCtzZmJdKSB8fAotICAgICAgICAgICAgKHBzeU91dENoYW4tPnNmYkVuZXJneVtzZmJHcnArc2ZiXSA8PSBwc3lPdXRDaGFuLT5zZmJUaHJlc2hvbGRbc2ZiR3JwK3NmYl0pIHx8Ci0gICAgICAgICAgICAocHN5T3V0Q2hhbi0+c2ZiTWluU25yW3NmYkdycCtzZmJdID09IE1BWF8xNikpIHsKLSAgICAgICAgICAqcGFoRmxhZysrID0gTk9fQUg7Ci0gICAgICAgIH0KLSAgICAgICAgZWxzZSB7Ci0gICAgICAgICAgKnBhaEZsYWcrKyA9IEFIX0lOQUNUSVZFOwotICAgICAgICB9Ci0gICAgICB9Ci0gICAgICBmb3IgKHNmYj1wc3lPdXRDaGFuLT5tYXhTZmJQZXJHcm91cDsgc2ZiPHBzeU91dENoYW4tPnNmYlBlckdyb3VwOyBzZmIrKykgewotICAgICAgICAqcGFoRmxhZysrID0gTk9fQUg7Ci0gICAgICB9Ci0gICAgfQotICB9Ci19Ci0KLS8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgotKgotKiBmdW5jdGlvbiBuYW1lOmNhbGNQZU5vQUgKLSogZGVzY3JpcHRpb246IHN1bSB0aGUgcGUgZGF0YSBvbmx5IGZvciBiYW5kcyB3aGVyZSBhdm9pZCBob2xlIGlzIGluYWN0aXZlCi0qCi0qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKio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BpZiAoYWhGbGFnW2NoXVtzZmJHcnArc2ZiXSA8IEFIX0FDVElWRSkgewotICAgICAgICAgIGlwZSA9IGlwZSArIHBlQ2hhbkRhdGEtPnNmYlBlW3NmYkdycCtzZmJdOwotICAgICAgICAgIGljb25zdFBhcnQgPSBpY29uc3RQYXJ0ICsgcGVDaGFuRGF0YS0+c2ZiQ29uc3RQYXJ0W3NmYkdycCtzZmJdOwotICAgICAgICAgIGluQWN0aXZlTGluZXMgPSBpbkFjdGl2ZUxpbmVzICsgcGVDaGFuRGF0YS0+c2ZiTkFjdGl2ZUxpbmVzW3NmYkdycCtzZmJdOwotICAgICAgICB9Ci0gICAgICB9Ci0gICAgfQotICB9Ci0KLSAgKnBlID0gc2F0dXJhdGUoaXBlKTsKLSAgKmNvbnN0UGFydCA9IHNhdHVyYXRlKGljb25zdFBhcnQpOwotICAqbkFjdGl2ZUxpbmVzID0gc2F0dXJhdGUoaW5BY3RpdmVMaW5lcyk7Ci19Ci0KLS8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgotKgotKiBmdW5jdGlvbiBuYW1lOnJlZHVjZVRocmVzaG9sZHMKLSogZGVzY3JpcHRpb246IGFwcGx5IHJlZHVjdGlvbiBmb3JtdWxhCi0qCi0qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotc3RhdGljIHZvaWQgcmVkdWNlVGhyZXNob2xkcyhQU1lfT1VUX0NIQU5ORUwgIHBzeU91dENoYW5uZWxbTUFYX0NIQU5ORUxTXSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgV29yZDE2ICAgICAgICAgICBhaEZsYWdbTUFYX0NIQU5ORUxTXVtNQVhfR1JPVVBFRF9TRkJdLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICBXb3JkMzIgICAgICAgICAgI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F9tcHlfbHMoKnBzZmJFbiwgcHN5T3V0Q2hhbi0+c2ZiTWluU25yW3NmYkdycCtzZmJdKTsKLQotICAgICAgICAgIGlmICgoc2ZiVGhyUmVkdWNlZCA+IHRtcCkgJiYKLSAgICAgICAgICAgICAgKGFoRmxhZ1tjaF1bc2ZiR3JwK3NmYl0gIT0gTk9fQUgpKXsKLSAgICAgICAgICAgIHNmYlRoclJlZHVjZWQgPSBtYXgodG1wLCAqcHNmYlRocik7Ci0gICAgICAgICAgICBhaEZsYWdbY2hdW3NmYkdycCtzZmJdID0gQUhfQUNUSVZFOwotICAgICAgICAgIH0KLQkJICAqcHNmYlRociA9IHNmYlRoclJlZHVjZWQ7Ci0gICAgICAgIH0KLQotCQlwc2ZiRW4rKzsgIHBzZmJUaHIrKzsKLSAgICAgIH0KLSAgICB9Ci0gIH0KLX0KLQotCi0vKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKLSoKLSogZnVuY3Rpb24gbmFtZTpjb3JyZWN0VGhyZXNoCi0qIGRlc2NyaXB0aW9uOiBpZiBwZSBkaWZmZXJlbmNlIGRlbHRhUGUgYmV0d2VlbiBkZXNpcmVkIHBlIGFuZCByZWFsIHBlIGlzIHNtYWxsIGVub3VnaCwKLSogICAgICAgICAgICAgdGhlIGRpZmZlcmVuY2UgY2FuIGJlIGRpc3RyaWJ1dGVkIGFtb25nIHRoZSBzY2FsZSBmYWN0b3IgYmFuZHMuCi0qCi0qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotc3RhdGljIHZvaWQgY29ycmVjdFRocmVzaChQU1lfT1VUX0NIQU5ORUwgIHBzeU91dENoYW5uZWxbTUFYX0NIQU5ORUxTXSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgV29yZDE2ICAgICAgICAgICBhaEZsYWd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UgdGhyZXNob2xkCi0gICAgICAgICAgICAqLwotICAgICAgICAgICAgdGhyRmFjdG9yID0gcG93Ml94eShMX25lZ2F0ZShkZWx0YVNmYlBlKSwgKG5vcm1GYWN0b3IqICgqcHNmYk5BY3RpdmVMaW5lcykpKTsKLQotICAgICAgICAgICAgc2ZiVGhyUmVkdWNlZCA9IExfbXB5X2xzKHNmYlRociwgcm91bmQxNih0aHJGYWN0b3IpKTsKLSAgICAgICAgICB9Ci0gICAgICAgICAgZWxzZSB7Ci0gICAgICAgICAgICAvKgotICAgICAgICAgICAgICBpbmNyZWFzZSB0aHJlc2hvbGQKLSAgICAgICAgICAgICovCi0gICAgICAgICAgICB0aHJGYWN0b3IgPSBwb3cyX3h5KGRlbHRhU2ZiUGUsIChub3JtRmFjdG9yICogKCpwc2ZiTkFjdGl2ZUxpbmVzKSkpOwotCi0KLSAgICAgICAgICAgIGlmKHRockZhY3RvciA+IHNmYlRocikgewotICAgICAgICAgICAgICBzaGlmdCA9IG5vcm1fbCh0aHJGYWN0b3IpOwotCQkJICBzZmJUaHJSZWR1Y2VkID0gRGl2XzMyKCBzZmJUaHIgPDwgc2hpZnQsIHRockZhY3Rvcjw8c2hpZnQgKTsKLSAgICAgICAgICAgIH0KLSAgICAgICAgICAgIGVsc2UgewotICAgICAgICAgICAgICBzZmJUaHJSZWR1Y2VkID0gTUFYXzMyOwotICAgICAgICAgICAgfQotCi0gICAgICAgICAgfQotCi0gICAgICAgICAgLyogYXZvaWQgaG9sZSAqLwotICAgICAgICAgIHNmYkVuID0gTF9tcHlfbHMoc2ZiRW4sIHBzeU91dENoYW4tPnNmYk1pblNucltzZmJHcnArc2ZiXSk7Ci0KLSAgICAgICAgICBpZiAoKHNmYlRoclJlZHVjZWQgPiBzZmJFbikgJiYKLSAgICAgICAgICAgICAgKCpwYWhGbGFnID09IEFIX0lOQUNUSVZFKSkgewotICAgICAgICAgICAgc2ZiVGhyUmVkdWNlZCA9IG1heChzZmJFbiwgc2ZiVGhyKTsKLSAgICAgICAgICAgICpwYWhGbGFnID0gQUhfQUNUSVZFOwotICAgICAgICAgIH0KLQotICAgICAgICAgIHBzeU91dENoYW4tPnNmYlRocmVzaG9sZFtzZmJHcnArc2ZiXSA9IHNmYlRoclJlZHVjZWQ7Ci0gICAgICAgIH0KLQotCQlwYWhGbGFnKys7IHBzZmJOQWN0aXZlTGluZXMrKzsgcHNmYlBlRmFjdG9ycysrOwotICAgICAgfQotICAgIH0KLSAgfQotfQotCi0KLS8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgotKgotKiBmdW5jdGlvbiBuYW1lOnJlZHVjZU1pblNucgotKiBkZXNjcmlwdGlvbjogaWYgdGhlIGRlc2lyZWQgcGUgY2FuIG5vdCBiZSByZWFjaGVkLCByZWR1Y2UgcGUgYnkgcmVkdWNpbmcgbWluU25yCi0qCi0qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotc3RhdGljIHZvaWQgcmVkdWNlTWluU25yKFBTWV9PVVRfQ0hBTk5FTCAgcHN5T3V0Q2hhbm5lbFtNQVhfQ0hBTk5FTFNdLAotICAgICAgICAgICAgICAgICAgICAgICAgIFBFX0RBVEEgICAgICAgICAqcGVEYXRhLAotICAgICAgICAgICAgICAgICAgICAgICAgIFdvcmQxNiAgICAgICAgICAgYWhGbGFnW01BWF9DSEFOTkVMU11bTUFYX0dST1VQRURfU0ZCXSwKLSAgICAgICAgICAgICAgICAgICAgICAgICBjb25zdCBXb3JkMTYgICAgIG5DaGFubmVscywKLSAgICAgICAgICAgICAgICAgICAgICAgICBjb25zdCBXb3JkMTYgICAgIGRlc2lyZWRQZSkKLXsKLSAgV29yZDE2IGNoLCBzZmIsIHNmYlN1YldpbjsKLSAgV29yZDE2IGRlbHRhUGU7Ci0KLSAgLyogc3RhcnQgY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Q2hhbi0+c2ZiTkxpbmVzNFtzZmJdID4+IDEpKSA+PiAyKSAtCi0gICAgICAgICAgICAgIHBlQ2hhbi0+c2ZiUGVbc2ZiXTsKLSAgICAgICAgICBwZURhdGEtPnBlID0gcGVEYXRhLT5wZSArIGRlbHRhUGU7Ci0gICAgICAgICAgcGVDaGFuLT5wZSA9IHBlQ2hhbi0+cGUgKyBkZWx0YVBlOwotICAgICAgICB9Ci0JCXBlQ2hhbiArPSAxOyBwc3lPdXRDaCArPSAxOwotICAgICAgfQotICAgICAgLyogc3RvcCBpZiBlbm91Z2ggaGFzIGJlZW4gc2F2ZWQgKi8KLQotICAgICAgaWYgKHBlRGF0YS0+cGUgPD0gZGVzaXJlZFBlKQotICAgICAgICBicmVhazsKLSAgICB9Ci0gIH0KLX0KLQotLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCi0qCi0qIGZ1bmN0aW9uIG5hbWU6YWxsb3dNb3JlSG9sZXMKLSogZGVzY3JpcHRpb246IGlmIHRoZSBkZXNpcmVkIHBlIGNhbiBub3QgYmUgcmVhY2hlZCwgc29tZSBtb3JlIHNjYWxlZmFjdG9yIGJhbmRzCi0qICAgICAgICAgICAgICBoYXZlIHRvIGJlIHF1YW50aXplZCB0byB6ZXJvCi0qCi0qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotc3RhdGljIHZvaWQgYWxsb3dNb3JlSG9sZXMoUFNZX09VVF9DSEFOTkVMICBwc3lPdXRDaGFubmVsW01BWF9DSEFOTkVMU10sCi0gICAgICAgICAgICAgICAgICAgICAgICAgICBQU1lfT1VUX0VMRU1FTlQgKnBzeU91dEVsZW1lbnQsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICBQRV9EQVRBICAgICAgICAgKnBlRGF0YSwKLSAgICAgICAgICA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ZG9uZSA9IDE7Ci0gICAgICAgICAgICBicmVhazsKLSAgICAgICAgICB9Ci0gICAgICAgIH0KLSAgICAgIH0KLSAgICAgIHNmYiA9IHNmYiAtIDE7Ci0KLSAgICAgIGlmIChzZmIgPCBtaW5TZmIpIHsKLSAgICAgICAgLyogcmVzdGFydCB3aXRoIG5leHQgZW5lcmd5IGJvcmRlciAqLwotICAgICAgICBzZmIgPSBtYXhTZmI7Ci0gICAgICAgIGVuSWR4ID0gZW5JZHggKyAxOwotCi0gICAgICAgIGlmIChlbklkeCAtIDQgPj0gMCkKLSAgICAgICAgICBkb25lID0gMTsKLSAgICAgIH0KLSAgICB9Ci0gIH0KLX0KLQotLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCi0qCi0qIGZ1bmN0aW9uIG5hbWU6YWRhcHRUaHJlc2hvbGRzVG9QZQotKiBkZXNjcmlwdGlvbjogdHdvIGd1ZXNzZXMgZm9yIHRoZSByZWR1Y3Rpb24gdmFsdWUgYW5kIG9uZSBmaW5hbCBjb3JyZWN0aW9uIG9mIHRoZQotKiAgICAgICAgICAgICAgdGhyZXNob2xkcwotKgotKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLXN0YXRpYyB2b2lkIGFkYXB0VGhyZXNob2xkc1RvUGUoUFNZX09VVF9DSEFOTkVMICAgICBwc3lPdXRDaGFubmVsW01BWF9DSEFOTkVMU10sCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFBTWV9PVVRfRUxFTUVOVCAgICAqcHN5T3V0RWxlbWVudCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgV29yZDE2ICAgICAgICAgICAgICBsb2dTZmJFbmVyZ3lbTUFYX0NIQU5ORUxTXVtNQVhfR1JPVVBFRF9TRkJdLAotICAgICAgIC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m5lbHMsIGRlc2lyZWRQZTEwNSk7Ci0gICAgYWxsb3dNb3JlSG9sZXMocHN5T3V0Q2hhbm5lbCwgcHN5T3V0RWxlbWVudCwgcGVEYXRhLCBwZURhdGEtPmFoRmxhZywKLSAgICAgICAgICAgICAgICAgICBhaFBhcmFtLCBuQ2hhbm5lbHMsIGRlc2lyZWRQZTEwNSk7Ci0gIH0KLX0KLQotCi0vKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKLSoKLSogZnVuY3Rpb24gbmFtZTogY2FsY0JpdFNhdmUKLSogZGVzY3JpcHRpb246ICBDYWxjdWxhdGVzIHBlcmNlbnRhZ2Ugb2YgYml0IHNhdmUsIHNlZSBmaWd1cmUgYmVsb3cKLSogcmV0dXJuczoKLSogaW5wdXQ6ICAgICAgICBwYXJhbWV0ZXJzIGFuZCBiaXRyZXMtZnVsbG5lc3MKLSogb3V0cHV0OiAgICAgICBwZXJjZW50YWdlIG9mIGJpdCBzYXZlCi0qCi0qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLXN0YXRpYyBXb3JkMTYgY2FsY0JpdFNhdmUoV29yZDE2IGZpbGxMZXZlbCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgY29uc3QgV29yZDE2IGNsaXBMb3csCi0gICAgICAgICAgICAgICAgICAgICAgICAgIGNvbnN0IFdvcmQxNiBjbGlwSGlnaCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgY29uc3QgV29yZDE2IG1pbkJpdFNhdmUsCi0gICAgICAgICAgICAgICAgICAgICAgICAgIGNvbnN0IFdvcmQxNiBtYXhCaXRTYXZlKQotewotICBXb3JkMTYgYml0c2F2ZSA9IDA7Ci0KLSAgZmlsbExldmVsID0gbWF4KGZpbGxMZXZlbCwgY2xpcExvdyk7Ci0gIGZpbGxMZXZlbCA9IG1pbihmaWxsTGV2ZWwsIGNsaXBIaWdoKTsKLQotICBpZihjbGlwSGlnaC1jbGlwTG93KQotICBiaXRzYXZlID0gKG1heEJpdFNhdmUgLSAoKChtYXhCaXRTYXZlLW1pbkJpdFNhdmUpKihmaWxsTGV2ZWwtY2xpcExvdykpLwotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKGNsaXBIaWdoLWNsaXBMb3cpKSk7Ci0KLSAgcmV0dXJuIChiaXRzYXZlKTsKLX0KLQotCi0KLS8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgotKgotKiBmdW5jdGlvbiBuYW1lOiBjYWxjQml0U3BlbmQKLSogZGVzY3JpcHRpb246ICBDYWxjdWxhdGVzIHBlcmNlbnRhZ2Ugb2YgYml0IHNwZW5kLCBzZWUgZmlndXJlIGJlbG93Ci0qIHJldHVybnM6Ci0qIGlucHV0OiAgICAgICAgcGFyYW1ldGVycyBhbmQgYml0cmVzLWZ1bGxuZXNzCi0qIG91dHB1dDogICAgICAgcGVyY2VudGFnZSBvZiBiaXQgc3BlbmQKLSoKLSoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotc3RhdGljIFdvcmQxNiBjYWxjQml0U3BlbmQoV29yZDE2IGZpbGxMZXZlbCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbnN0IFdvcmQxNiBjbGlwTG93LAotICAgICAgICAgICAgICAgICAgICAgICAgICAgY29uc3QgV29yZDE2IGNsaXBIaWdoLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgY29uc3QgV29yZDE2IG1pbkJpdFNwZW5kLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgY29uc3QgV29yZDE2IG1heEJpdFNwZW5kKQotewotICBXb3JkMTYgYml0c3BlbmQgPSAxOwotCi0gIGZpbGxMZXZlbCA9IG1heChmaWxsTGV2ZWwsIGNsaXBMb3cpOwotICBmaWxsTGV2ZWwgPSBtaW4oZmlsbExldmVsLCBjbGlwSGlnaCk7Ci0KLSAgaWYoY2xpcEhpZ2gtY2xpcExvdykKLSAgYml0c3BlbmQgPSAobWluQml0U3BlbmQgKyAoKG1heEJpdFNwZW5kIC0gbWluQml0U3BlbmQpKihmaWxsTGV2ZWwgLSBjbGlwTG93KSAvCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChjbGlwSGlnaC1jbGlwTG93KSkpOwotCi0gIHJldHVybiAoYml0c3BlbmQpOwotfQotCi0KLS8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgotKgotKiBmdW5jdGlvbiBuYW1lOiBhZGp1c3RQZU1pbk1heCgpCi0qIGRlc2NyaXB0aW9uOiAgYWRqdXN0cyBwZU1pbiBhbmQgcGVNYXggcGFyYW1ldGVycyBvdmVyIHRpbWUKLSogcmV0dXJuczoKLSogaW5wdXQ6ICAgICAgICBjdXJyZW50IHBlLCBwZU1pbiwgcGVNYXgKLSogb3V0cHV0OiAgICAgICBhZGp1c3RlZCBwZU1pbi9wZU1heAotKgotKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi1zdGF0aWMgdm9pZCBhZGp1c3RQZU1pbk1heChjb25zdCBXb3JkMTYgY3VyclBlLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgV29yZDE2ICAgICAgKnBlTWluLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgV29yZDE2ICAgICAgKnBlTWF4KQotewotICBXb3JkMTYgbWluRmFjSGksIG1heEZhY0hpLCBtaW5GYWNMbywgbWF4RmFjTG87Ci0gIFdvcmQxNiBkaWZmOwotICBXb3JkMTYgbWluRGlmZiA9IGV4dHJhY3RfbChjdXJyUG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cGFydEhpKSk7Ci0gICAgKnBlTWluID0gbWF4KDAsICpwZU1pbik7Ci0gIH0KLX0KLQotCi0vKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKLSoKLSogZnVuY3Rpb24gbmFtZTogQml0cmVzQ2FsY0JpdEZhYwotKiBkZXNjcmlwdGlvbjogIGNhbGN1bGF0ZXMgZmFjdG9yIG9mIHNwZW5kaW5nIGJpdHMgZm9yIG9uZSBmcmFtZQotKiAgICAgICAgICAgICAgICAxLjAgOiB0YWtlIGFsbCBmcmFtZSBkeW5wYXJ0IGJpdHMKLSogICAgICAgICAgICAgICAgPjEuMCA6IHRha2UgYWxsIGZyYW1lIGR5bnBhcnQgYml0cyArIGJpdHJlcwotKiAgICAgICAgICAgICAgICA8MS4wIDogcHV0IGJpdHMgaW4gYml0cmVzZXJ2b2lyCi0qICByZXR1cm5zOiAgICAgIEJpdEZhYyoxMDAKLSogIGlucHV0OiAgICAgICAgYml0cmVzLWZ1bGxuZXNzLCBwZSwgYmxvY2tUeXBlLCBwYXJhbWV0ZXItc2V0dGluZ3MKLSogIG91dHB1dDoKLSoKLSoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotc3RhdGljIFdvcmQxNiBiaXRyZXNDYWxjQml0RmFjKCBjb25zdCBXb3JkMTYgICBiaXRyZXNCaXRzLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb25zdCBXb3JkMTYgICBtYXhCaXRyZXNCaXRzLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb25zdCBXb3JkMTYgICBwZSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY29uc3QgV29yZDE2ICAgd2luZG93U2VxdWVuY2UsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbnN0IFdvcmQxNi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Mb3csIGJyZXNQYXJhbS0+Y2xpcFNwZW5kSGlnaCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlc1BhcmFtLT5taW5CaXRTcGVuZCwgYnJlc1BhcmFtLT5tYXhCaXRTcGVuZCk7Ci0KLSAgaWYoYWRqVGhyQ2hhbi0+cGVNYXggIT0gYWRqVGhyQ2hhbi0+cGVNaW4pCi0JYml0cmVzRmFjID0gKDEwMCAtIGJpdFNhdmUpICsgZXh0cmFjdF9sKCgoYml0U3BlbmQgKyBiaXRTYXZlKSAqIChwZXggLSBhZGpUaHJDaGFuLT5wZU1pbikpIC8KLSAgICAgICAgICAgICAgICAgICAgKGFkalRockNoYW4tPnBlTWF4IC0gYWRqVGhyQ2hhbi0+cGVNaW4pKTsKLSAgZWxzZQotCWJpdHJlc0ZhYyA9IDB4N2ZmZjsKLQotICBiaXRyZXNGYWMgPSBtaW4oYml0cmVzRmFjLAotICAgICAgICAgICAgICAgICAgICAoMTAwLTMwICsgZXh0cmFjdF9sKCgxMDAgKiBiaXRyZXNCaXRzKSAvIGF2Z0JpdHMpKSk7Ci0KLSAgYml0cmVzRmFjID0gbWluKGJpdHJlc0ZhYywgbWF4Qml0RmFjKTsKLQotICBhZGp1c3RQZU1pbk1heChwZSwgJmFkalRockNoYW4tPnBlTWluLCAmYWRqVGhyQ2hhbi0+cGVNYXgpOwotCi0gIHJldHVybiBiaXRyZXNGYWM7Ci19Ci0KLS8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgotKgotKiBmdW5jdGlvbiBuYW1lOiBBZGpUaHJJbml0Ci0qIGRlc2NyaXB0aW9uOiAgaW5pdCB0aHJlc2hvbGRzIHBhcmFtZXRlcgotKgotKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi12b2lkIEFkalRockluaXQoQURKX1R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otCi0gIC8qIHBlIGNvcnJlY3Rpb24gKi8KLSAgYXRzRWxlbS0+cGVMYXN0ID0gMDsKLSAgYXRzRWxlbS0+ZHluQml0c0xhc3QgPSAwOwotICBhdHNFbGVtLT5wZUNvcnJlY3Rpb25GYWN0b3IgPSAxMDA7IC8qIDEuMCAqLwotCi19Ci0KLS8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgotKgotKiBmdW5jdGlvbiBuYW1lOiBjYWxjUGVDb3JyZWN0aW9uCi0qIGRlc2NyaXB0aW9uOiAgY2FsY3VsYXRlcyB0aGUgZGVzaXJlZCBwZXJjZXB0dWFsIGVudHJvcHkgZmFjdG9yCi0qCQkJCUl0IGlzIGJldHdlZW4gMC44NSBhbmQgMS4xNQotKgotKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi1zdGF0aWMgdm9pZCBjYWxjUGVDb3JyZWN0aW9uKFdvcmQxNiAqY29ycmVjdGlvbkZhYywKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY29uc3QgV29yZDE2IHBlQWN0LAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb25zdCBXb3JkMTYgcGVMYXN0LAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb25zdCBXb3JkMTYgYml0c0xhc3QpCi17Ci0gIFdvcmQzMiBwZUFjdDEwMCA9IDEwMCAqIHBlQWN0OwotICBXb3JkMzIgcGVMYXN0MTAwID0gMTAwICogcGVMYXN0OwotICBXb3JkMTYgcGVCaXRzTGFzdCA9IGJpdHMycGUoYml0c0xhc3QpOwotCi0gIGlmICgoYml0c0xhc3QgPiAwKSAmJgotICAgICAgKHBlQWN0MTAwIDwgKDE1MCAqIHBlTGFzdCkpICYmICAocGVBY3QxMDAgPiAoNzAgKiBwZUxhc3QpKSAmJgotICAgICAg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AgICAgKmNvcnJlY3Rpb25GYWMgPSAoNzAgKiAqY29ycmVjdGlvbkZhYyArIDMwICogbmV3RmFjKSAvIDEwMDsKLSAgICAgICpjb3JyZWN0aW9uRmFjID0gbWluKCpjb3JyZWN0aW9uRmFjLCAxMTUpOwotICAgICAgKmNvcnJlY3Rpb25GYWMgPSBtYXgoKmNvcnJlY3Rpb25GYWMsIDg1KTsKLSAgICB9Ci0gIGVsc2UgewotICAgICpjb3JyZWN0aW9uRmFjID0gMTAwOwotICB9Ci19Ci0KLS8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgotKgotKiBmdW5jdGlvbiBuYW1lOiBBZGp1c3RUaHJlc2hvbGRzCi0qIGRlc2NyaXB0aW9uOiAgQWRqdXN0IHRocmVzaG9sZHMgdG8gdGhlIGRlc2lyZWQgYml0cmF0ZQotKgotKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLXZvaWQgQWRqdXN0VGhyZXNob2xkcyhBREpfVEhSX1NUQVRFICAgKmFkalRoclN0YXRlLAotICAgICAgICAgICAgICAgICAgICAgIEFUU19FTEVNRU5UICAgICAqQWRqVGhyU3RhdGVFbGVtZW50LAotICAgICAgICAgICAgICAgICAgICAgIFBTWV9PVVRfQ0hBTk5FTCAgcHN5T3V0Q2hhbm5lbFtNQVhfQ0hBTk5FTFNdLAotICAgICAgICAgICAgICAgICAgICAgIFBTWV9PVVRfRUxFTUVOVCAqcHN5T3V0RWxlbWVudCwKLSAgICAgICAgICAgICAgICAgICAgICBXb3JkMTYgICAgICAgICAgKmNoQml0RGlzdHJpYnV0aW9uLAotICAgICAgICAgICAgICAgICAgICAgIFdvcmQxNiAgICAgICAgICAgbG9nU2ZiRW5lcmd5W01BWF9DSEFOTkVMU11bTUFYX0dST1VQRURfU0ZCXSwKL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29ycmVjdGlvbkZhY3RvciksCi0gICAgICAgICAgICAgICAgICAgbWluKGdyYW50ZWRQZSwgbm9SZWRQZSksCi0gICAgICAgICAgICAgICAgICAgQWRqVGhyU3RhdGVFbGVtZW50LT5wZUxhc3QsCi0gICAgICAgICAgICAgICAgICAgQWRqVGhyU3RhdGVFbGVtZW50LT5keW5CaXRzTGFzdCk7Ci0gIGdyYW50ZWRQZUNvcnIgPSAoZ3JhbnRlZFBlICogQWRqVGhyU3RhdGVFbGVtZW50LT5wZUNvcnJlY3Rpb25GYWN0b3IpIC8gMTAwOwotCi0KLSAgaWYgKGdyYW50ZWRQZUNvcnIgPCBub1JlZFBlICYmIG5vUmVkUGUgPiBwZURhdGEub2Zmc2V0KSB7Ci0gICAgLyogY2FsYyB0aHJlc2hvbGQgbmVjZXNzYXJ5IGZvciBkZXNpcmVkIHBlICovCi0gICAgYWRhcHRUaHJlc2hvbGRzVG9QZShwc3lPdXRDaGFubmVsLAotICAgICAgICAgICAgICAgICAgICAgICAgcHN5T3V0RWxlbWVudCwKLSAgICAgICAgICAgICAgICAgICAgICAgIGxvZ1NmYkVuZXJneSwKLSAgICAgICAgICAgICAgICAgICAgICAgICZwZURhdGEsCi0gICAgICAgICAgICAgICAgICAgICAgICBuQ2hhbm5lbHMsCi0gICAgICAgICAgICAgICAgICAgICAgICBncmFudGVkUGVDb3JyLAotICAgICAgICAgICAgICAgICAgICAgICAgJkFkalRoclN0YXRlRWxlbWVudC0+YWhQYXJhbSwKLSAgICAgICAgICAgICAgICAgICAgICAgICZBZGpUaHJTdGF0ZUVsZW1lbnQtPm1pblNuckFkYXB0UGFyYW0pOwotICB9Ci0KLSAgLyogY2FsY3VsYXRlIHJlbGF0aXZlIGRpc3RyaWJ1dGlvbiAqLwotICBmb3IgKGNoPTA7IGNoPG5DaGFubmVsczsgY2grKykgewotICAgIFdvcmQxNiBwZU9mZnNEaWZmID0gcGVEYXRhLnBlIC0gcGVEYXRhLm9mZnNldDsKLSAgICBjaEJpdERpc3RyaWJ1dGlvbltjaF0gPSAyMDA7Ci0KLSAgICBpZiAocGVPZmZzRGlmZiA+IDApIHsKLSAgICAgIFdvcmQzMiB0ZW1wID0gMTAwMCAtIChuQ2hhbm5lbHMgKiAyMDApOwotICAgICAgY2hCaXREaXN0cmlidXRpb25bY2hdID0gY2hCaXREaXN0cmlidXRpb25bY2hdICsKLQkJICAodGVtcCAqIHBlRGF0YS5wZUNoYW5uZWxEYXRhW2NoXS5wZSkgLyBwZU9mZnNEaWZmOwotICAgIH0KLSAgfQotCi0gIC8qIHN0b3JlIHBlICovCi0gIHFjT0UtPnBlID0gbm9SZWRQZTsKLQotICAvKiB1cGRhdGUgbGFzdCBwZSAqLwotICBBZGpUaHJTdGF0ZUVsZW1lbnQtPnBlTGFzdCA9IGdyYW50ZWRQZTsKLX0KLQotLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCi0qCi0qIGZ1bmN0aW9uIG5hbWU6IEFkalRoclVwZGF0ZQotKiBkZXNjcmlwdGlvbjogIHNhdmUgZHluQml0c1VzZWQgZm9yIGNvcnJlY3Rpb24gb2YgYml0czJwZSByZWxhdGlvbgotKgotKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLXZvaWQgQWRqVGhyVXBkYXRlKEFUU19FTEVNRU5UICpBZGpUaHJTdGF0ZUVsZW1lbnQsCi0gICAgICAgICAgICAgICAgICBjb25zdCBXb3JkMTYgZHluQml0c1VzZWQpCi17Ci0gIEFkalRoclN0YXRlRWxlbWVudC0+ZHluQml0c0xhc3QgPSBkeW5CaXRzVXNlZDsKLX0KLQotCmRpZmYgLS1naXQgYS9tZWRpYS9saWJzdGFnZWZyaWdodC9jb2RlY3MvYWFjZW5jL3NyYy9hc20vQVJNVjVFL0F1dG9Db3JyZWxhdGl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luIHdyaXRpbmcsIHNvZnR3YXJlCi0gKiogZGlzdHJpYnV0ZWQgdW5kZXIgdGhlIExpY2Vuc2UgaXMgZGlzdHJpYnV0ZWQgb24gYW4gIkFTIElTIiBCQVNJUywKLSAqKiBXSVRIT1VUIFdBUlJBTlRJRVMgT1IgQ09ORElUSU9OUyBPRiBBTlkgS0lORCwgZWl0aGVyIGV4cHJlc3Mgb3IgaW1wbGllZC4KLSAqKiBTZWUgdGhlIExpY2Vuc2UgZm9yIHRoZSBzcGVjaWZpYyBsYW5ndWFnZSBnb3Zlcm5pbmcgcGVybWlzc2lvbnMgYW5kCi0gKiogbGltaXRhdGlvbnMgdW5kZXIgdGhlIExpY2Vuc2UuCi0gKi8KLS8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCi0JRmlsZToJCWJhbmRfbnJnLmMKLQotCUNvbnRlbnQ6CUJhbmQvTGluZSBlbmVyZ3kgY2FsY3VsYXRpb25zIGZ1bmN0aW9ucwotCi0qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotCi0jaW5jbHVkZSAiYmFzaWNfb3AuaCIKLSNpbmNsdWRlICJiYW5kX25yZy5oIgotCi0jaWZuZGVmIEFSTVY1RQotLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCi0qCi0qIGZ1bmN0aW9uIG5hbWU6IENhbGNCYW5kRW5lcmd5Ci0qIGRlc2NyaXB0aW9uOiAgIENhbGMgc2ZiLWJhbmR3aXNlIG1kY3QtZW5lcmdpZXMgZm9yIGxlZnQgYW5kIHJpZ2h0IGNoYW5uZWwKLSoKLSoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi12b2lkIENhbGNCYW5kRW5lcmd5KGNvbnN0IFdvcmQzMiAqbWRjdFNwZWN0cnVtLAotICAgICAgICAgICAgICAgICAgICBjb25zdCBXb3JkMTYgKmJhbmRPZmZzZXQsCi0gICAgICAgICAgICAgICAgICAgIGNvbnN0IFdvcmQxNiAgbnVtQmFuZHMsCi0gICAgICAgICAgICAgICAgICAgIFdvcmQzMiAgICAgICAqYmFuZEVuZXJneSwKLSAgICAgICAgICAgICAgICAgICAgV29yZDMyICAgICAgICpiYW5kRW5lcmd5U3VtKQotewotICBXb3JkMzIgaSwgajsKLSAgV29yZDMyIGFjY3VTdW0gPSAwOwotCi0gIGZvciAoaT0wOyBpPG51bUJhbmRzOyBpKyspIHsKLSAgICBXb3JkMzIgYWNjdSA9IDA7Ci0gICAgZm9yIChqPWJhbmRPZmZzZXRbaV07IGo8YmFuZE9mZnNldFtpKzFdOyBqKyspCi0gICAgICBhY2N1ID0gTF9hZGQoYWNjdSwgTVVMSElHSChtZGN0U3BlY3RydW1bal0sIG1kY3RTcGVjdHJ1bVtqXSkpOwotCi0JYWNjdSA9IExfYWRkKGFjY3UsIGFjY3UpOwotICAgIGFjY3VTdW0gPSBMX2FkZChhY2N1U3VtLCBhY2N1KTsKLSAgICBiYW5kRW5lcmd5W2ldID0gYWNjdTsKLSAgfQotICAqYmFuZEVuZXJneVN1bSA9IGFjY3VTdW07Ci19Ci0KLS8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgotKgotKiBmdW5jdGlvbiBuYW1lOiBDYWxjQmFuZEVuZXJneU1TCi0qIGRlc2NyaXB0aW9uOiAgIENhbGMgc2ZiLWJhbmR3aXNlIG1kY3QtZW5lcmdpZXMgZm9yIGxlZnQgYWRkIG9yIG1pbnVzIHJpZ2h0IGNoYW5uZWwKLSoKLSoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi12b2lkIENhbGNCYW5kRW5lcmd5TVMoY29uc3QgV29yZDMyICptZGN0U3BlY3RydW1MZWZ0LAotICAgICAgICAgICAgICAgICAgICAgIGNvbnN0IFdvcmQzMiAqbWRjdFNwZWN0cnVtUmlnaHQsCi0gICAgICAgICAgICAgICAgICAgICAgY29uc3QgV29yZDE2ICpiYW5kT2Zmc2V0LAotICAgICAgICAgICAgICAgICAgICAgIGNvbnN0IFdvcmQxNiAgbnVtQmFuZHMsCi0gICAgICAgICAgICAgICAgICAgICAgV29yZDMyICAgICAgICpiYW5kRW5lcmd5TWlkLAotICAgICAgICAgICAgICAgICAgICAgIFdvcmQzMiAgICAgICAqYmFuZEVuZXJneU1pZFN1bSwKLSAgICAgICAgICAgICAgICAgICAgICBXb3JkMzIgICAgICAgKmJhbmRFbmVyZ3lTaWRlLAotICAgICAgICAgICAgICAgICAgICAgIFdvcmQzMiAgICAgICAqYmFuZEVuZXJneVNpZGVTdW0pCi17Ci0KLSAgV29yZDMyIGksIGo7Ci0gIFdvcmQzMiBhY2N1TWlkU3VtID0gMDsKLSAgV29yZDMyIGFjY3VTaWRlU3VtID0gMDsKLQotCi0gIGZvcihpPTA7IGk8bnVtQmFuZHM7IGkrKykgewotICAgIFdvcmQzMiBhY2N1TWlkID0gMDsKLSAgICBXb3JkMzIgYWNjdVNpZGUgPSAwOwotICAgIGZvciAoaj1iYW5kT2Zmc2V0W2ldOyBqPGJhbmRPZmZzZXRbaSsxXTsgaisrKSB7Ci0gICAgICBXb3JkMzIgc3BlY20sIHNwZWNzOwotICAgICAgV29yZDMyIGwsIHI7Ci0KLSAgICAgIGwgPSBtZGN0U3BlY3RydW1MZWZ0W2pdID4+IDE7Ci0gICAgICByID0gbWRjdFNwZWN0cnVtUmlnaHRbal0gPj4gMTsKLSAgICAgIHNwZWNtID0gbCArIHI7Ci0gICAgICBzcGVjcyA9IGwgL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lIEhJX0xUQUIoYSkgKGE+PjgpCi0jZGVmaW5lIExPX0xUQUIoYSkgKGEgJiAweGZmKQotCi0jZGVmaW5lIEVYUEFORChhKSAgKCgoKFdvcmQzMikoYSYweGZmMDApKSA8PCA4KXwoV29yZDMyKShhJjB4ZmYpKQotCi0KLS8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgotKgotKiBmdW5jdGlvbiBuYW1lOiBjb3VudDFfMl8zXzRfNV82XzdfOF85XzEwXzExCi0qIGRlc2NyaXB0aW9uOiAgY291bnRzIHRhYmxlcyAxLTExCi0qIHJldHVybnM6Ci0qIGlucHV0OiAgICAgICAgcXVhbnRpemVkIHNwZWN0cnVtCi0qIG91dHB1dDogICAgICAgYml0Q291bnQgZm9yIHRhYmxlcyAxLTExCi0qCi0qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLQotc3RhdGljIHZvaWQgY291bnQxXzJfM180XzVfNl83XzhfOV8xMF8xMShjb25zdCBXb3JkMTYgKnZhbHVlcywKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY29uc3QgV29yZDE2ICB3aWR0aCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgV29yZDE2ICAgICAgICpiaXRDb3VudCkKLXsKLSAgV29yZDMyIHQwLHQxLHQyLHQzLGk7Ci0gIFdvcmQzMiBiYzFfMixiYzNfNCxiYzVfNixiYzdfOCxiYzlfMTA7Ci0gIFdvcmQxNiBiYzExLHNjOwotCi0gIGJjMV8yPTA7Ci0gIGJjM180PTA7Ci0gIGJjNV82PTA7Ci0gIGJjN184PTA7Ci0gIGJjOV8xMD0wOwotICBiYzExPTA7Ci0gIHNjPTA7Ci0KLSAgZm9yKGk9MDtpPHdpZHRoO2krPTQpewotCi0gICAgdDA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KLSAgYml0Q291bnRbMl09ZXh0cmFjdF9sKGJjMV8yKTsKLSAgYml0Q291bnRbM109ZXh0cmFjdF9oKGJjM180KSArIHNjOwotICBiaXRDb3VudFs0XT1leHRyYWN0X2woYmMzXzQpICsgc2M7Ci0gIGJpdENvdW50WzVdPWV4dHJhY3RfaChiYzVfNik7Ci0gIGJpdENvdW50WzZdPWV4dHJhY3RfbChiYzVfNik7Ci0gIGJpdENvdW50WzddPWV4dHJhY3RfaChiYzdfOCkgKyBzYzsKLSAgYml0Q291bnRbOF09ZXh0cmFjdF9sKGJjN184KSArIHNjOwotICBiaXRDb3VudFs5XT1leHRyYWN0X2goYmM5XzEwKSArIHNjOwotICBiaXRDb3VudFsxMF09ZXh0cmFjdF9sKGJjOV8xMCkgKyBzYzsKLSAgYml0Q291bnRbMTFdPWJjMTEgKyBzYzsKLX0KLQotCi0vKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKLSoKLSogZnVuY3Rpb24gbmFtZTogY291bnQzXzRfNV82XzdfOF85XzEwXzExCi0qIGRlc2NyaXB0aW9uOiAgY291bnRzIHRhYmxlcyAzLTExCi0qIHJldHVybnM6Ci0qIGlucHV0OiAgICAgICAgcXVhbnRpemVkIHNwZWN0cnVtCi0qIG91dHB1dDogICAgICAgYml0Q291bnQgZm9yIHRhYmxlcyAzLTExCi0qCi0qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLQotc3RhdGljIHZvaWQgY291bnQzXzRfNV82XzdfOF85XzEwXzExKGNvbnN0IFdvcmQxNiAqdmFsdWVzLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbnN0IFdvcmQxNiAgd2lkdGgsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgV29yZDE2ICAgICAgICpiaXRDb3V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MxMSArIGh1ZmZfbHRhYjExW3QyXVt0M107Ci0KLQotICAgIHNjID0gc2MgKyAodDA+MCkgKyAodDE+MCkgKyAodDI+MCkgKyAodDM+MCk7Ci0gIH0KLQotICBiaXRDb3VudFsxXT1JTlZBTElEX0JJVENPVU5UOwotICBiaXRDb3VudFsyXT1JTlZBTElEX0JJVENPVU5UOwotICBiaXRDb3VudFszXT1leHRyYWN0X2goYmMzXzQpICsgc2M7Ci0gIGJpdENvdW50WzRdPWV4dHJhY3RfbChiYzNfNCkgKyBzYzsKLSAgYml0Q291bnRbNV09ZXh0cmFjdF9oKGJjNV82KTsKLSAgYml0Q291bnRbNl09ZXh0cmFjdF9sKGJjNV82KTsKLSAgYml0Q291bnRbN109ZXh0cmFjdF9oKGJjN184KSArIHNjOwotICBiaXRDb3VudFs4XT1leHRyYWN0X2woYmM3XzgpICsgc2M7Ci0gIGJpdENvdW50WzldPWV4dHJhY3RfaChiYzlfMTApICsgc2M7Ci0gIGJpdENvdW50WzEwXT1leHRyYWN0X2woYmM5XzEwKSArIHNjOwotICBiaXRDb3VudFsxMV09YmMxMSArIHNjOwotCi19Ci0KLQotCi0vKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKLSoKLSogZnVuY3Rpb24gbmFtZTogY291bnQ1XzZfN184XzlfMTBfMTEKLSogZGVzY3JpcHRpb246ICBjb3VudHMgdGFibGVzIDUtMTEKLSogcmV0dXJuczoKLSogaW5wdXQ6ICAgICAgICBxdWFudGl6ZWQgc3BlY3RydW0KLSogb3V0cHV0OiAgICAgICBiaXRDb3VudCBmb3IgdGFibGVzIDUtMTEKLSoKLSoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotc3RhdGljIHZvaWQgY291bnQ1XzZfN184XzlfMTBfMTEoY29uc3QgV29yZDE2ICp2YWx1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dF9oKGJjN184KSArIHNjOwotICBiaXRDb3VudFs4XT1leHRyYWN0X2woYmM3XzgpICsgc2M7Ci0gIGJpdENvdW50WzldPWV4dHJhY3RfaChiYzlfMTApICsgc2M7Ci0gIGJpdENvdW50WzEwXT1leHRyYWN0X2woYmM5XzEwKSArIHNjOwotICBiaXRDb3VudFsxMV09YmMxMSArIHNjOwotCi19Ci0KLQotLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCi0qCi0qIGZ1bmN0aW9uIG5hbWU6IGNvdW50N184XzlfMTBfMTEKLSogZGVzY3JpcHRpb246ICBjb3VudHMgdGFibGVzIDctMTEKLSogcmV0dXJuczoKLSogaW5wdXQ6ICAgICAgICBxdWFudGl6ZWQgc3BlY3RydW0KLSogb3V0cHV0OiAgICAgICBiaXRDb3VudCBmb3IgdGFibGVzIDctMTEKLSoKLSoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotCi1zdGF0aWMgdm9pZCBjb3VudDdfOF85XzEwXzExKGNvbnN0IFdvcmQxNiAqdmFsdWVzLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb25zdCBXb3JkMTYgIHdpZHRoLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICBXb3JkMTYgICAgICAgKmJpdENvdW50KQotewotICBXb3JkMzIgdDAsdDEsIGk7Ci0gIFdvcmQzMiBiYzdfOCxiYzlfMTA7Ci0gIFdvcmQxNiBiYzExLHNjOwotCi0gIGJjN184PTA7Ci0gIGJjOV8xMD0wOwotICBiYzExPTA7Ci0gIHNjPTA7Ci0KLSAgZm9yKGk9MDtpPHdpZHRoO2krPTIpewotCi0gICAgdDA9QUJTKHZhbHVlc1tpKzBdKTsKLSAgICB0MT1BQlModmFsdWVzW2krMV0pOwotCi0gICAgYmM3XzggPSBiYzdfOCArIEVYUEFORChodWZmX2x0YWI3XzhbdDBdW3QxXSk7Ci0gICAgYmM5XzEwID0gYmM5XzEwICsgRVhQQU5EKGh1ZmZfbHRhYjlfMTBbdDBdW3QxXSk7Ci0gICAgYmMxMSA9IGJjMTEgKyBodWZmX2x0YWIxMVt0MF1bdDFdOwotCi0KLSAgICBzYyA9IHNjICsgKHQwPjApICsgKHQxPjApOwotICB9Ci0gIGJpdENvdW50WzFdPUlOVkFMSURfQklUQ09VTlQ7Ci0gIGJpdENvdW50WzJdPUlOVkFMSURfQklUQ09VTlQ7Ci0gIGJpdENvdW50WzNdPUlOVkFMSURfQklUQ09VTlQ7Ci0gIGJpdENvdW50WzRdPUlOVkFMSURfQklUQ09VTlQ7Ci0gIGJpdENvdW50WzVdPUlOVkFMSURfQklUQ09VTlQ7Ci0gIGJpdENvdW50WzZdPUlOVkFMSURfQklUQ09VTlQ7Ci0gIGJpdENvdW50WzddPWV4dHJhY3RfaChiYzdfOCkgKyBzYzsKLSAgYml0Q291bnRbOF09ZXh0cmFjdF9sKGJjN184KSArIHNjOwotICBiaXRDb3VudFs5XT1leHRyYWN0X2goYmM5XzEwKSArIHNjOwotICBiaXRDb3VudFsxMF09ZXh0cmFjdF9sKGJjOV8xMCkgKyBzYzsKLSAgYml0Q291bnRbMTFdPWJjMTEgKyBzYzsKLQotfQotCi0vKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKLSoKLSogZnVuY3Rpb24gbmFtZTogY291bnQ5XzEwXzExCi0qIGRlc2NyaXB0aW9uOiAgY291bnRzIHRhYmxlcyA5LTExCi0qIHJldHVybnM6Ci0qIGlucHV0OiAgICAgICAgcXVhbnRpemVkIHNwZWN0cnVtCi0qIG91dHB1dDogICAgICAgYml0Q291bnQgZm9yIHRhYmxlcyA5LTExCi0qCi0qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq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3VudFsxMV09YmMxMSArIHNjOwotCi19Ci0KLS8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgotKgotKiBmdW5jdGlvbiBuYW1lOiBjb3VudDExCi0qIGRlc2NyaXB0aW9uOiAgY291bnRzIHRhYmxlIDExCi0qIHJldHVybnM6Ci0qIGlucHV0OiAgICAgICAgcXVhbnRpemVkIHNwZWN0cnVtCi0qIG91dHB1dDogICAgICAgYml0Q291bnQgZm9yIHRhYmxlIDExCi0qCi0qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLSBzdGF0aWMgdm9pZCBjb3VudDExKGNvbnN0IFdvcmQxNiAqdmFsdWVzLAotICAgICAgICAgICAgICAgICAgICBjb25zdCBXb3JkMTYgIHdpZHRoLAotICAgICAgICAgICAgICAgICAgICBXb3JkMTYgICAgICAgICpiaXRDb3VudCkKLXsKLSAgV29yZDMyIHQwLHQxLGk7Ci0gIFdvcmQxNiBiYzExLHNjOwotCi0gIGJjMTE9MDsKLSAgc2M9MDsKLSAgZm9yKGk9MDtpPHdpZHRoO2krPTIpewotICAgIHQwPUFCUyh2YWx1ZXNbaSswXSk7Ci0gICAgdDE9QUJTKHZhbHVlc1tpKzFdKTsKLSAgICBiYzExID0gYmMxMSArIGh1ZmZfbHRhYjExW3QwXVt0MV07Ci0KLQotICAgIHNjID0gc2MgKyAodDA+MCkgKyAodDE+MCk7Ci0gIH0KLQotICBiaXRDb3VudFsxXT1JTlZBTElEX0JJVENPVU5UOwotICBiaXRDb3VudFsyXT1JTlZBTElEX0JJVENPVU5UOwotICBiaXRDb3VudFszXT1JTlZBTElEX0JJVENPVU5UOwotICBiaXRDb3VudFs0XT1JTlZBTElEX0JJVENPVU5UOwotICBiaXRDb3VudFs1XT1JTlZBTElEX0JJVENPVU5UOwotICBiaXRDb3VudFs2XT1JTlZBTElEX0JJVENPVU5UOwotICBiaXRDb3VudFs3XT1JTlZBTElEX0JJVENPVU5UOwotICBiaXRDb3VudFs4XT1JTlZBTElEX0JJVENPVU5UOwotICBiaXRDb3VudFs5XT1JTlZBTElEX0JJVENPVU5UOwotICBiaXRDb3VudFsxMF09SU5WQUxJRF9CSVRDT1VOVDsKLSAgYml0Q291bnRbMTFdPWJjMTEgKyBzYzsKLX0KLQotLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCi0qCi0qIGZ1bmN0aW9uIG5hbWU6IGNvdW50RXNjCi0qIGRlc2NyaXB0aW9uOiAgY291bnRzIHRhYmxlIDExICh3aXRoIEVzYykKLSogcmV0dXJuczoKLSogaW5wdXQ6ICAgICAgICBxdWFudGl6ZWQgc3BlY3RydW0KLSogb3V0cHV0OiAgICAgICBiaXRDb3VudCBmb3IgdGFibGVzIDExICh3aXRoIEVzYykKLSoKLSoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotCi1zdGF0aWMgdm9pZCBjb3VudEVzYyhjb25zdCBXb3JkMTYgKnZhbHVlcywKLSAgICAgICAgICAgICAgICAgICAgIGNvbnN0IFdvcmQxNiAgd2lkdGgsCi0gICAgICAgICAgICAgICAgICAgICBXb3JkMTYgICAgICAgKmJpdENvdW50KQotewotICBXb3JkMzIgdDAsdDEsdDAwLHQwMSxpOwotICBXb3JkMTYgYmMxMSxlYyxzYzsKLQotICBiYzExPTA7Ci0gIHNjPTA7Ci0gIGVjPTA7Ci0gIGZvcihpPTA7aTx3aWR0aDtpKz0yKXsKLSAgICB0MD1BQlModmFsdWVzW2krMF0pOwotICAgIHQxPUFCUyh2YWx1ZXNbaSsxXSk7Ci0KLQotICAgIHNjID0gc2MgKyAodDA+MCkgKyAodDE+MCk7Ci0KLSAgICB0MDAgPSBtaW4odDAsMTYpOwotICAgIHQwMSA9IG1pbih0MSwxNik7Ci0gICAgYmMxMSA9IGJjMTEgKyBodWZmX2x0YWIxMVt0MDBdW3QwMV07Ci0KLQotICAgIGlmKHQwID49IDE2KXsKLSAgICAgIGVjID0gZWMgKyA1OwotICAgICAgd2hpbGUoc3ViKHQwPSh0MCA+PiAxKSwgMTYpID49IDApIHsKLSAgICAgICAgZWMgPSBlYyArIDI7Ci0gICAgICB9Ci0gICAgfQotCi0KLSAgICBpZih0MSA+PSAxNil7Ci0gICAgICBlYyA9IGVjICsgNTsKLSAgICAgIHdoaWxlKHN1Yih0MT0odDEgPj4gMSksIDE2KSA+PSAwKSB7Ci0gICAgICAgIGVjID0gZWMgKyAyOwotICAgICAgfQotICAgIH0KLSAgfQotICBiaXRDb3VudFsxXT1JTlZBTElEX0JJVENPVU5UOwotICBiaXRDb3VudFsyXT1JTlZBTElEX0JJVENPVU5UOwotICBiaXRDb3VudFszXT1JTlZBTElEX0JJVENPVU5UOwotICBiaXRDb3VudFs0XT1JTlZBTElEX0JJVENPVU5UOwotICBiaXRDb3VudFs1XT1JTlZBTElEX0JJVENPVU5UOwotICBiaXRDb3VudFs2XT1JTlZBTElEX0JJVENPVU5UOwotICBiaXRDb3VudFs3XT1JTlZBTElEX0JJVENPVU5UOwotICBiaXRDb3VudFs4XT1JTlZBTElEX0JJVENPVU5UOwotICBiaXRDb3VudFs5XT1JTlZBTElEX0JJVENPVU5UOwotICBiaXRDb3VudFsxMF09SU5WQUxJRF9CSVRDT1VOVDsKLSAgYml0Q291bnRbMTFdPWJjMTEgKyBzYyArIGVjOwotfQotCi0KLXR5cGVkZWYgdm9pZCAoKkNPVU5UX0ZVTkNUSU9OKShjb25zdCBXb3JkMTYgKnZhbHVlcywKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb25zdCBXb3JkMTYgIHdpZHRoLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFdvcmQxNiAgICAgICAqYml0Q291bnQpOwotCi1zdGF0aWMgQ09VTlRfRlVOQ1RJT04gY291bnRGdW5jVGFibGVbQ09ERV9CT09LX0VTQ19MQVYrMV0gPQotICB7Ci0KLSAgICBjb3VudDFfMl8zXzRfNV82XzdfOF85XzEwXzExLCAgLyogMCAgKi8KLSAgICBjb3VudDFfMl8zXzRfNV82XzdfOF85XzEwXzExLCAgLyogMSAgKi8KLSAgICBjb3VudDNfNF81XzZfN184XzlfMTBfMTEsICAgICAgLyogMiAgKi8KLSAgICBjb3VudDVfNl83XzhfOV8xMF8xMSwgICAgICAgICAgLyogMyAgKi8KLSAgICBjb3VudDVfNl83XzhfOV8xMF8xMSwgICAgICAgICAgLyogNCAgKi8KLSAgICBjb3VudDdfOF85XzEwXzExLCAgICAgICAgICAgICAgLyogNSAgKi8KLSAgICBjb3VudDdfOF85XzEwXzExLCAgICAgICAgICAgICAgLyogNiAgKi8KLSAgICBjb3VudDdfOF85XzEwXzExLCAgICAgICAgICAgICAgLyogNyAgKi8KLSAgICBjb3VudDlfMTBfMTEsICAgICAgICAgICAgICAgICAgLyogOCAgKi8KLSAgICBjb3VudDlfMTBfMTEsICAgICAgICAgICAgICAgICAgLyogOSAgKi8KLSAgICBjb3VudDlfMTBfMTEsICAgICAgICAgICAgICAgICAgLyogMTAgKi8KLSAgICBjb3VudDlfMTBfMTEsICAgICAgICAgICAgICAgICAgLyogMTEgKi8KLSAgICBjb3VudDlfMTBfMTEsICAgICAgICAgICAgICAgICAgLyogMTIgKi8KLSAgICBjb3VudDExLCAgICAgICAgICAgICAgICAgICAgICAgLyogMTMgKi8KLSAgICBjb3VudDExLCAgICAgICAgICAgICAgICAgICAgICAgLyogMTQgKi8KLSAgICBjb3VudDExLCAgICAgICAgICAgICAgICAgICAgICAgLyogMTUgKi8KLSAgICBjb3VudEVzYyAgICAgICAgICAgICAgICAgICAgICAgLyogMTYgKi8KLSAgfTsKLQotLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCi0qCi0qIGZ1bmN0aW9uIG5hbWU6IGJpdENvdW50Ci0qIGRlc2NyaXB0aW9uOiAgY291bnQgYml0cwotKgotKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi1Xb3JkMTYgYml0Q291bnQoY29uc3QgV29yZDE2ICp2YWx1ZXMsCi0gICAgICAgICAgICAgICAgY29uc3QgV29yZDE2ICB3aWR0aCwKLSAgICAgICAgICAgICAgICBXb3JkMTYgICAgICAgIG1heFZhbCwKLSAgICAgICAgICAgICAgICBXb3JkMTYgICAgICAgKmJpdENvdW50KQotewotICAvKgotICAgIGNoZWNrIGlmIHdlIGNhbiB1c2UgY29kZWJvb2sgMAotICAqLwotCi0gIGlmKG1heFZhbCA9PSAwKQotICAgIGJpdENvdW50WzBdID0gMDsKLSAgZWxzZQotICAgIGJpdENvdW50WzBdID0gSU5WQUxJRF9CSVRDT1VOVDsKLQotICBtYXhWYWwgPSBtaW4obWF4VmFsLCBDT0RFX0JPT0tfRVNDX0xBVik7Ci0gIGNvdW50RnVuY1RhYmxlW21heFZhbF0odmFsdWVzLHdpZHRoLGJpdENvdW50KTsKLQotICByZXR1cm4oMCk7Ci19Ci0KLS8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgotKgotKiBmdW5jdGlvbiBuYW1lOiBjb2RlVmFsdWVzCi0qIGRlc2NyaXB0aW9uOiAgd3JpdGUgaHVmZnVtIGJpdHMKLSoKLSoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotV29yZDE2IGNvZGVWYWx1ZXMoV29yZDE2ICp2YWx1ZXMsIFdvcmQxNiB3aWR0aCwgV29yZDE2IGNvZGVCb29rLCB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JbdDArMV1bdDErMV1bdDIrMV1bdDMrMV07Ci0gICAgICAgIGNvZGVMZW5ndGggPSBMT19MVEFCKGh1ZmZfbHRhYjFfMlt0MCsxXVt0MSsxXVt0MisxXVt0MysxXSk7Ci0gICAgICAgIFdyaXRlQml0cyhoQml0c3RyZWFtLGNvZGVXb3JkLGNvZGVMZW5ndGgpOwotICAgICAgfQotICAgICAgYnJlYWs7Ci0KLSAgICBjYXNlIENPREVfQk9PS18zX05POgotICAgICAgZm9yKGk9MDsgaTx3aWR0aDsgaSs9NCkgewotICAgICAgICBzaWduPTA7Ci0gICAgICAgIHNpZ25MZW5ndGg9MDsKLSAgICAgICAgdDAgPSB2YWx1ZXNbaSswXTsKLQotICAgICAgICBpZih0MCAhPSAwKXsKLSAgICAgICAgICBzaWduTGVuZ3RoID0gc2lnbkxlbmd0aCArIDE7Ci0gICAgICAgICAgc2lnbiA9IHNpZ24gPDwgMTsKLQotICAgICAgICAgIGlmKHQwIDwgMCl7Ci0gICAgICAgICAgICBzaWdufD0xOwotICAgICAgICAgICAgdDA9LXQwOwotICAgICAgICAgIH0KLSAgICAgICAgfQotICAgICAgICB0MSA9IHZhbHVlc1tpKzFdOwotCi0gICAgICAgIGlmKHQxICE9IDApewotICAgICAgICAgIHNpZ25MZW5ndGggPSBzaWduTGVuZ3RoICsgMTsKLSAgICAgICAgICBzaWduID0gc2lnbiA8PCAxOwotCi0gICAgICAgICAgaWYodDEgPCAwKXsKLSAgICAgICAgICAgIHNpZ258PTE7Ci0gICAgICAgICAgICB0MT0tdDE7Ci0gICAgICAgICAgfQotICAgICAgICB9Ci0gICAgICAgIHQyID0gdmFsdWVzW2krMl07Ci0KLSAgICAgICAgaWYodDIgIT0gMCl7Ci0gICAgICAgICAgc2lnbkxlbmd0aCA9IHNpZ25MZW5ndGggKyAxOwotICAgICAgICAgIHNpZ24gPSBzaWduIDw8IDE7Ci0KLSAgICAgICAgICBpZih0MiA8IDApewotICAgICAgICAgICAgc2lnbnw9MTsKLSAgICAgICAgICAgIHQyPS10MjsKLSAgICAgICAgICB9Ci0gICAgICAgIH0KLSAgICAgICAgdDMgPSB2YWx1ZXNbaSszXTsKLSAgICAgICAgaWYodDMgIT0gMCl7Ci0gICAgICAgICAgc2lnbkxlbmd0aCA9IHNpZ25MZW5ndGggKyAxOwotICAgICAgICAgIHNpZ24gPSBzaWduIDw8IDE7Ci0KLSAgICAgICAgICBpZih0MyA8IDApewotICAgICAgICAgICAgc2lnbnw9MTsKLSAgICAgICAgICAgIHQzPS10MzsKLSAgICAgICAgICB9Ci0gICAgICAgIH0KLQotICAgICAgICBjb2RlV29yZCAgID0gaHVmZl9jdGFiM1t0MF1bdDFdW3QyXVt0M107Ci0gICAgICAgIGNvZGVMZW5ndGggPSBISV9MVEFCKGh1ZmZfbHRhYjNfNFt0MF1bdDFdW3QyXVt0M10pOwotICAgICAgICBXcml0ZUJpdHMoaEJpdHN0cmVhbSxjb2RlV29yZCxjb2RlTGVuZ3RoKTsKLSAgICAgICAgV3JpdGVCaXRzKGhCaXRzdHJlYW0sc2lnbixzaWduTGVuZ3RoKTsKLSAgICAgIH0KLSAgICAgIGJyZWFrOwotCi0gICAgY2FzZSBDT0RFX0JPT0tfNF9OTzoKLSAgICAgIGZvcihpPTA7IGk8d2lkdGg7IGkrPTQpIHsKLSAgICAgICAgc2lnbj0wOwotICAgICAgICBzaWduTGVuZ3RoPTA7Ci0gICAgICAgIHQwID0gdmFsdWVzW2krMF07Ci0KLSAgICAgICAgaWYodDAgIT0gMCl7Ci0gICAgICAgICAgc2lnbkxlbmd0aCA9IHNpZ25MZW5ndGggKyAxOwotICAgICAgICAgIHNpZ24gPSBzaWduIDw8IDE7Ci0gICAgICAgICAgaWYodDAgPCAwKXsKLSAgICAgICAgICAgIHNpZ258PTE7Ci0gICAgICAgICAgICB0MD0tdDA7Ci0gICAgICAgICAgfQotICAgICAgICB9Ci0gICAgICAgIHQxID0gdmFsdWVzW2krMV07Ci0KLSAgICAgICAgaWYodDEgIT0gMCl7Ci0gICAgICAgICAgc2lnbkxlbmd0aCA9IHNpZ25MZW5ndGggKyAxOwotICAgICAgICAgIHNpZ24gPSBzaWduIDw8IDE7Ci0KLSAgICAgICAgICBpZih0MSA8IDApewotICAgICAgICAgICAgc2lnbnw9MTsKLSAgICAgICAgICAgIHQxPS10MTsKLSAgICAgICAgICB9Ci0gICAgICAgIH0KLSAgICAgICAgdDIgPSB2YWx1ZXNbaSsyXTsKLQotICAgICAgICBpZih0MiAhPSAwKXsKLSAgICAgICAgICBzaWduTGVuZ3RoID0gc2lnbkxlbmd0aCArIDE7Ci0gICAgICAgICAgc2lnbiA9IHNpZ24gPDwgMTsKLQotICAgICAgICAgIGlmKHQyIDwgMCl7Ci0gICAgICAgICAgICBzaWdufD0xOwotICAgICAgICAgICAgdDI9LXQyOwotICAgICAgICAgIH0KLSAgICAgICAgfQotICAgICAgICB0MyA9IHZhbHVlc1tpKzNdOwotCi0gICAgICAgIGlmKHQzICE9IDApewotICAgICAgICAgIHNpZ25MZW5ndGggPSBzaWduTGVuZ3RoICsgMTsKLSAgICAgICAgICBzaWduID0gc2lnbiA8PCAxOwotCi0gICAgICAgICAgaWYodDMgPCAwKXsKLSAgICAgICAgICAgIHNpZ258PTE7Ci0gICAgICAgICAgICB0Mz0tdDM7Ci0gICAgICAgICAgfQotICAgICAgICB9Ci0gICAgICAgIGNvZGVXb3JkICAgPSBodWZmX2N0YWI0W3QwXVt0MV1bdDJdW3QzXTsKLSAgICAgICAgY29kZUxlbmd0aCA9IExPX0xUQUIoaHVmZl9sdGFiM180W3QwXVt0MV1bdDJdW3QzXSk7Ci0gICAgICAgIFdyaXRlQml0cyhoQml0c3RyZWFtLGNvZGVXb3JkLGNvZGVMZW5ndGgpOwotICAgICAgICBXcml0ZUJpdHMoaEJpdHN0cmVhbSxzaWduLHNpZ25MZW5ndGgpOwotICAgICAgfQotICAgICAgYnJlYWs7Ci0KLSAgICBjYXNlIENPREVfQk9PS181X05POgotICAgICAgZm9yKGk9MDsgaTx3aWR0aDsgaSs9MikgewotICAgICAgICB0MCAgICAgICAgID0gdmFsdWVzW2krMF07Ci0gICAgICAgIHQxICAgICAgICAgPSB2YWx1ZXNbaSsxXTsKLSAgICAgICAgY29kZVdvcmQgICA9IGh1ZmZfY3RhYjVbdDArNF1bdDErNF07Ci0gICAgICAgIGNvZGVMZW5ndGggPSBISV9MVEFCKGh1ZmZfbHRhYjVfNlt0MCs0XVt0MSs0XSk7Ci0gICAgICAgIFdyaXRlQml0cyhoQml0c3RyZWFtLGNvZGVXb3JkLGNvZGVMZW5ndGgpOwotICAgICAgfQotICAgICAgYnJlYWs7Ci0KLSAgICBjYXNlIENPREVfQk9PS182X05POgotICAgICAgZm9yKGk9MDsgaTx3aWR0aDsgaSs9MikgewotICAgICAgICB0MCAgICAgICAgID0gdmFsdWVzW2krMF07Ci0gICAgICAgIHQxICAgICAgICAgPSB2YWx1ZXNbaSsxXTsKLSAgICAgICAgY29kZVdvcmQgICA9IGh1ZmZfY3RhYjZbdDArNF1bdDErNF07Ci0gICAgICAgIGNvZGVMZW5ndGggPSBMT19MVEFCKGh1ZmZfbHRhYjVfNlt0MCs0XVt0MSs0XSk7Ci0gICAgICAgIFdyaXRlQml0cyhoQml0c3RyZWFtLGNvZGVXb3JkLGNvZGVMZW5ndGgpOwotICAgICAgfQotICAgICAgYnJlYWs7Ci0KLSAgICBjYXNlIENPREVfQk9PS183X05POgotICAgICAgZm9yKGk9MDsgaTx3aWR0aDsgaSs9Mil7Ci0gICAgICAgIHNpZ249MDsKLSAgICAgICAgc2lnbkxlbmd0aD0wOwotICAgICAgICB0MCA9IHZhbHVlc1tpKzBdOwotCi0gICAgICAgIGlmKHQwICE9IDApewotICAgICAgICAgIHNpZ25MZW5ndGggPSBzaWduTGVuZ3RoICsgMTsKLSAgICAgICAgICBzaWduID0gc2lnbiA8PCAxOwotCi0gICAgICAgICAgaWYodDAgPCAwKXsKLSAgICAgICAgICAgIHNpZ258PTE7Ci0gICAgICAgICAgICB0MD0tdDA7Ci0gICAgICAgICAgfQotICAgICAgICB9Ci0KLSAgICAgICAgdDEgPSB2YWx1ZXNbaSsxXTsKLQotICAgICAgICBpZih0MSAhPSAwKXsKLSAgICAgICAgICBzaWduTGVuZ3RoID0gc2lnbkxlbmd0aCArIDE7Ci0gICAgICAgICAgc2lnbiA9IHNpZ24gPDwgMTsKLQotICAgICAgICAgIGlmKHQxIDwgMCl7Ci0gICAgICAgICAgICBzaWdufD0xOwotICAgICAgICAgICAgdDE9LXQxOwotICAgICAgICAgIH0KLSAgICAgICAgfQotICAgICAgICBjb2RlV29yZCAgID0gaHVmZl9jdGFiN1t0MF1bdDFdOwotICAgICAgICBjb2RlTGVuZ3RoID0gSElfTFRBQihodWZmX2x0YWI3XzhbdDBdW3QxXSk7Ci0gICAgICAgIFdyaXRlQml0cyhoQml0c3RyZWFtLGNvZGVXb3JkLGNvZGVMZW5ndGgpOwotICAgICAgICBXcml0ZUJpdHMoaEJpdHN0cmVhbSxzaWduLHNpZ25MZW5ndGgpOwotICAgICAgfQotICAgICAgYnJlYWs7Ci0KLSAgICBjYXNlIENPREVfQk9PS184X05POgotICAgICAgZm9yKGk9MDsgaTx3aWR0aDsgaSs9MikgewotICAgICAgICBzaWduPTA7Ci0gICAgICAgIHNpZ25MZW5ndGg9MDsKLSAgICAgICAgdDAgPSB2YWx1ZXNbaSswXTsKLQotICAgICAgICBpZih0MCAhPSAwKXsKLSAgICAgICAgICBzaWduTGVuZ3RoID0gc2lnbkxlbmd0aCArIDE7Ci0gICAgICAgICAgc2lnbiA9IHNpZ24gPDwgMTsKLQotICAgICAgICAgIGlmKHQwIDwgMCl7Ci0gICAgICAgICAgICBzaWdufD0xOwotICAgICAgICAgICAgdDA9LXQwOwotICAgICAgICAgIH0KLSAgICAgICAgfQotCi0gICAgICAgIHQxID0gdmFsdWVzW2krMV07Ci0KLSAgICAgICAgaWYodDEgIT0gMCl7Ci0gICAgICAgICAgc2lnbkxlbmd0aCA9IHNpZ25MZW5ndGggKyAxOwotICAgICAgICAgIHNpZ24gPSBzaWduIDw8IDE7Ci0KLSAgICAgICAgICBpZih0MSA8IDApewotICAgICAgICAgICAgc2lnbnw9MTsKLSAgICAgICAgICAgIHQxPS10MTsKLSAgICAgICAgICB9Ci0gICAgICAgIH0KLSAgICAgICAgY29kZVdvcmQgICA9IGh1ZmZfY3RhYjhbdDBdW3QxXTsKLSAgICAgICAgY29kZUxlbmd0aCA9IExPX0xUQUIoaHVmZl9sdGFiN184W3QwXVt0MV0pOwotICAgICAgICBXcml0ZUJpdHMoaEJpdHN0cmVhbSxjb2RlV29yZCxjb2RlTGVuZ3RoKTsKLSAgICAgICAgV3JpdGVCaXRzKGhCaXRzdHJlYW0sc2lnbixzaWduTGVuZ3RoKTsKLSAgICAgIH0KLSAgICAgIGJyZWFrOwotCi0gICAgY2FzZSBDT0RFX0JPT0tfOV9OTzoKLSAgICAgIGZvcihpPTA7IGk8d2lkdGg7IGkrPTIpIHsKLSAgICAgICAgc2lnbj0wOwotICAgICAgICBzaWduTGVuZ3RoPTA7Ci0gICAgICAgIHQwID0gdmFsdWVzW2krMF07Ci0KLSAgICAgICAgaWYodDAgIT0gMCl7Ci0gICAgICAgICAgc2lnbkxlbmd0aCA9IHNpZ25MZW5ndGggKyAxOwotICAgICAgICAgIHNpZ24gPSBzaWduIDw8IDE7Ci0KLSAgICAgICAgICBpZih0MCA8IDApewotICAgICAgICAgICAgc2lnbnw9MTsKLSAgICAgICAgICAgIHQwPS10MDsKLSAgICAgICAgICB9Ci0gICAgICAgIH0KLQotICAgICAgICB0MSA9IHZhbHVlc1tpKzFdOwotCi0gICAgICAgIGlmKHQxICE9IDApewotICAgICAgICAgIHNpZ25MZW5ndGggPSBzaWduTGVuZ3RoICsgMTsKLSAgICAgICAgICBzaWduID0gc2lnbiA8PCAxOwotCi0gICAgICAgICAgaWYodDEgPCAwKXsKLSAgICAgICAgICAgIHNpZ258PTE7Ci0gICAgICAgICAgICB0MT0tdDE7Ci0gICAgICAgICAgfQotICAgICAgICB9Ci0gICAgICAgIGNvZGVXb3JkICAgPSBodWZmX2N0YWI5W3QwXVt0MV07Ci0gICAgICAgIGNvZGVMZW5ndGggPSBISV9MVEFCKGh1ZmZfbHRhYjlfMTBbdDBdW3QxXSk7Ci0gICAgICAgIFdyaXRlQml0cyhoQml0c3RyZWFtLGNvZGVXb3JkLGNvZGVMZW5ndGgpOwotICAgICAgICBXcml0ZUJpdHMoaEJpdHN0cmVhbSxzaWduLHNpZ25MZW5ndGgpOwotICAgICAgfQotICAgICAgYnJlYWs7Ci0KLSAgICBjYXNlIENPREVfQk9PS18xMF9OTzoKLSAgICAgIGZvcihpPTA7IGk8d2lkdGg7IGkrPTIpIHsKLSAgICAgICAgc2lnbj0wOwotICAgICAgICBzaWduTGVuZ3RoPTA7Ci0gICAgICAgIHQwID0gdmFsdWVzW2krMF07Ci0KLSAgICAgICAgaWYodDAgIT0gMCl7Ci0gICAgICAgICAgc2lnbkxlbmd0aCA9IHNpZ25MZW5ndGggKyAxOwotICAgICAgICAgIHNpZ24gPSBzaWduIDw8IDE7Ci0KLSAgICAgICAgICBpZih0MCA8IDApewotICAgICAgICAgICAgc2lnbnw9MTsKLSAgICAgICAgICAgIHQwPS10MDsKLSAgICAgICAgICB9Ci0gICAgICAgIH0KLQotICAgICAgICB0MSA9IHZhbHVlc1tpKzFdOwotCi0gICAgICAgIGlmKHQxICE9IDApewotICAgICAgICAgIHNpZ25MZW5ndGggPSBzaWduTGVuZ3RoICsgMTsKLSAgICAgICAgICBzaWduID0gc2lnbiA8PCAxOwotCi0gICAgICAgICAgaWYodDEgPCAwKXsKLSAgICAgICAgICAgIHNpZ258PTE7Ci0gICAgICAgICAgICB0MT0tdDE7Ci0gICAgICAgICAgfQotICAgICAgICB9Ci0gICAgICAgIGNvZGVXb3JkICAgPSBodWZmX2N0YWIxMFt0MF1bdDFdOwotICAgICAgICBjb2RlTGVuZ3RoID0gTE9fTFRBQihodWZmX2x0YWI5XzEwW3QwXVt0MV0pOwotICAgICAgICBXcml0ZUJpdHMoaEJpdHN0cmVhbSxjb2RlV29yZCxjb2RlTGVuZ3RoKTsKLSAgICAgICAgV3JpdGVCaXRzKGhCaXRzdHJlYW0sc2lnbixzaWduTGVuZ3RoKTsKLSAgICAgIH0KLSAgICAgIGJyZWFrOwotCi0gICAgY2FzZSBDT0RFX0JPT0tfRVNDX05POgotICAgICAgZm9yKGk9MDsgaTx3aWR0aDsgaSs9MikgewotICAgICAgICBzaWduPTA7Ci0gICAgICAgIHNpZ25MZW5ndGg9MDsKLSAgICAgICAgdDAgPSB2YWx1ZXNbaSswXTsKLQotICAgICAgICBpZih0MCAhPSAwKXsKLSAgICAgICAgICBzaWduTGVuZ3RoID0gc2lnbkxlbmd0aCArIDE7Ci0gICAgICAgICAgc2lnbiA9IHNpZ24gPDwgMTsKLQotICAgICAgICAgIGlmKHQwIDwgMCl7Ci0gICAgICAgICAgICBzaWdufD0xOwotICAgICAgICAgICAgdDA9LXQwOwotICAgICAgICAgIH0KLSAgICAgICAgfQotCi0gICAgICAgIHQxID0gdmFsdWVzW2krMV07Ci0KLSAgICAgICAgaWYodDEgIT0gMCl7Ci0gICAgICAgICAgc2lnbkxlbmd0aCA9IHNpZ25MZW5ndGggKyAxOwotICAgICAgICAgIHNpZ24gPSBzaWduIDw8IDE7Ci0KLSAgICAgICAgICBpZih0MSA8IDApewotICAgICAgICAgICAgc2lnbnw9MTsKLSAgICAgICAgICAgIHQxPS10MTsKLSAgICAgICAgICB9Ci0gICAgICAgIH0KLSAgICAgICAgdDAwID0gbWluKHQwLDE2KTsKLSAgICAgICAgdDAxID0gbWluKHQxLDE2KTsKLQotICAgICAgICBjb2RlV29yZCAgID0gaHVmZl9jdGFiMTFbdDAwXVt0MDFdOwotICAgICAgICBjb2RlTGVuZ3RoID0gaHVmZl9sdGFiMTFbdDAwXVt0MDFdOwotICAgICAgICBXcml0ZUJpdHMoaEJpdHN0cmVhbSxjb2RlV29yZCxjb2RlTGVuZ3RoKTsKLSAgICAgICAgV3JpdGVCaXRzKGhCaXRzdHJlYW0sc2lnbixzaWduTGVuZ3RoKTsKLQotICAgICAgICBpZih0MCA+PSAxNil7Ci0gICAgICAgICAgV29yZDE2IG4sIHA7Ci0gICAgICAgICAgbj0wOwotICAgICAgICAgIHA9dDA7Ci0gICAgICAgICAgd2hpbGUoc3ViKHA9KHAgPj4gMSksIDE2KSA+PSAwKXsKLQotICAgICAgICAgICAgV3JpdGVCaXRzKGhCaXRzdHJlYW0sMSwxKTsKLSAgICAgICAgICAgIG4gPSBuICsgMTsKLSAgICAgICAgICB9Ci0gICAgICAgICAgV3JpdGVCaXRzKGhCaXRzdHJlYW0sMCwxKTsKLSAgICAgICAgICBuID0gbiArIDQ7Ci0gICAgICAgICAgV3JpdGVCaXRzKGhCaXRzdHJlYW0sKHQwIC0gKDEgPDwgbikpLG4pOwotICAgICAgICB9Ci0KLSAgICAgICAgaWYodDEgPj0gMTYpewotICAgICAgICAgIFdvcmQxNiBuLCBwOwotICAgICAgICAgIG49MDsKLSAgICAgICAgICBwPXQxOwotICAgICAgICAgIHdoaWxlKHN1YihwPShwID4+IDEpLCAxNikgPj0gMCl7Ci0KLSAgICAgICAgICAgIFdyaXRlQml0cyhoQml0c3RyZWFtLDEsMSk7Ci0gICAgICAgICAgICBuID0gbiArIDE7Ci0gICAgICAgICAgfQotICAgICAgICAgIFdyaXRlQml0cyhoQml0c3RyZWFtLDAsMSk7Ci0gICAgICAgICAgbiA9IG4gKyA0OwotICAgICAgICAgIFdyaXRlQml0cyhoQml0c3RyZWFtLCh0MSAtICgxIDw8IG4pKSxuKTsKLSAgICAgICAgfQotICAgICAgfQotICAgICAgYnJlYWs7Ci0KLSAgICBkZWZhdWx0OgotICAgICAgYnJlYWs7Ci0gIH0KLSAgcmV0dXJuKDApOwotfQotCi1Xb3JkMTYgYml0Q291bnRTY2FsZWZhY3RvckRlbHRhKFdvcmQxNiBkZWx0YSkKLXsKLSAgcmV0dXJuKGh1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gKiogeW91IG1heSBub3QgdXNlIHRoaXMgZmlsZSBleGNlcHQgaW4gY29tcGxpYW5jZSB3aXRoIHRoZSBMaWNlbnNlLgotICoqIFlvdSBtYXkgb2J0YWluIGEgY29weSBvZiB0aGUgTGljZW5zZSBhdAotICoqCi0gKiogICAgIGh0dHA6Ly93d3cuYXBhY2hlLm9yZy9saWNlbnNlcy9MSUNFTlNFLTIuMAotICoqCi0gKiogVW5sZXNzIHJlcXVpcmVkIGJ5IGFwcGxpY2FibGUgbGF3IG9yIGFncmVlZCB0byBpbiB3cml0aW5nLCBzb2Z0d2FyZQotICoqIGRpc3RyaWJ1dGVkIHVuZGVyIHRoZSBMaWNlbnNlIGlzIGRpc3RyaWJ1dGVkIG9uIGFuICJBUyBJUyIgQkFTSVMsCi0gKiogV0lUSE9VVCBXQVJSQU5USUVTIE9SIENPTkRJVElPTlMgT0YgQU5ZIEtJTkQsIGVpdGhlciBleHByZXNzIG9yIGltcGxpZWQuCi0gKiogU2VlIHRoZSBMaWNlbnNlIGZvciB0aGUgc3BlY2lmaWMgbGFuZ3VhZ2UgZ292ZXJuaW5nIHBlcm1pc3Npb25zIGFuZAotICoqIGxpbWl0YXRpb25zIHVuZGVyIHRoZSBMaWNlbnNlLgotICovCi0vKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgotCUZpbGU6CQliaXRidWZmZXIuYwotCi0JQ29udGVudDoJQml0IEJ1ZmZlciBNYW5hZ2VtZW50IGZ1bmN0aW9ucwotCi0qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotCi0jaW5jbHVkZSAiYml0YnVmZmVyLmgiCi0KLS8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgotKgotKiBmdW5jdGlvbiBuYW1lOiB1cGRhdGVCaXRCdWZXb3JkUHRyCi0qIGRlc2NyaXB0aW9uOiAgdXBkYXRlIEJpdCBCdWZmZXIgcG9pbnRlcgotKgotKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi1zdGF0aWMgdm9pZCB1cGRhdGVCaXRCdWZXb3JkUHRyKEhBTkRMRV9CSVRfQlVGIGhCaXRCdWYsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFVXb3JkOCAqKnBCaXRCdWZXb3JkLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBXb3JkMTYgICBjbnQpCi17Ci0gICpwQml0QnVmV29yZCArPSBjbnQ7Ci0KLQotICBpZigqcEJpdEJ1ZldvcmQgPiBoQml0QnVmLT5wQml0QnVmRW5kKSB7Ci0gICAgKnBCaXRCdWZXb3JkIC09IChoQml0QnVmLT5wQml0QnVmRW5kIC0gaEJpdEJ1Zi0+cEJpdEJ1ZkJhc2UgKyAxKTsKLSAgfQotCi0gIGlmKCpwQml0QnVmV29yZCA8IGhCaXRCdWYtPnBCaXRCdWZCYXNlKSB7Ci0gICAgKnBCaXRCdWZXb3JkICs9IChoQml0QnVmLT5wQml0QnVmRW5kIC0gaEJpdEJ1Zi0+cEJpdEJ1ZkJhc2UgKyAxKTsKLSAgfQotfQotCi0KLS8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgotKgotKiBmdW5jdGlvbiBuYW1lOiBDcmVhdGVCaXRCdWZmZXIKLSogZGVzY3JpcHRpb246ICBjcmVhdGUgYW5kIGluaXQgQml0IEJ1ZmZlciBNYW5hZ2VtZW50Ci0qCi0qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLUhBTkRMRV9CSVRfQlVGIENyZWF0ZUJpdEJ1ZmZlcihIQU5ETEVfQklUX0JVRiBoQml0QnVmLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFVXb3JkOCAqcEJpdEJ1ZkJhc2UsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgV29yZDE2ICBiaXRCdWZTaXplKQotewotICBhc3NlcnQoYml0QnVmU2l6ZSo4IDw9IDMyNzY4KTsKLQotICBoQml0QnVmLT5wQml0QnVmQmFzZSA9IHBCaXRCdWZCYXNlOwotICBoQml0QnVmLT5wQml0QnVmRW5kICA9IHBCaXRCdWZCYXNlICsgYml0QnVmU2l6ZSAtIDE7Ci0KLSAgaEJpdEJ1Zi0+cFdyaXRlTmV4dCAgPSBwQml0QnVmQmFzZTsKLQotICBoQml0QnVmLT5jYWNoZSAgICAgICA9IDA7Ci0KLSAgaEJpdEJ1Zi0+d0JpdFBvcyAgICAgPSAwOwotICBoQml0QnVmLT5jbnRCaXRzICAgICA9IDA7Ci0KLSAgaEJpdEJ1Zi0+c2l6ZSAgICAgICAgPSAoYml0QnVmU2l6ZSA8PCAzKTsKLSAgaEJpdEJ1Zi0+aXNWYWxpZCAgICAgPSAxOwotCi0gIHJldHVybiBoQml0QnVmOwotfQotCi0vKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKLSoKLSogZnVuY3Rpb24gbmFtZTogRGVsZXRlQml0QnVmZmVyCi0qIGRlc2NyaXB0aW9uOiAgdW5pbml0IEJpdCBCdWZmZXIgTWFuYWdlbWVudAotKgotKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi12b2lkIERlbGV0ZUJpdEJ1ZmZlcihIQU5ETEVfQklUX0JVRiAqaEJpdEJ1ZikKLXsKLSAgaWYoKmhCaXRCdWYpCi0JKCpoQml0QnVmKS0+aXNWYWxpZCA9IDA7Ci0gICpoQml0QnVmID0gTlVMTDsKLX0KLQotLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCi0qCi0qIGZ1bmN0aW9uIG5hbWU6IFJlc2V0Qml0QnVmCi0qIGRlc2NyaXB0aW9uOiAgcmVzZXQgQml0IEJ1ZmZlciBNYW5hZ2VtZW50Ci0qCi0qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLXZvaWQgUmVzZXRCaXRCdWYoSEFORExFX0JJVF9CVUYgaEJpdEJ1ZiwKLSAgICAgICAgICAgICAgICAgVVdvcmQ4ICpwQml0QnVmQmFzZSwKLSAgICAgICAgICAgICAgICAgV29yZDE2ICBiaXRCdWZTaXplKQotewotICBoQml0QnVmLT5wQml0QnVmQmFzZSA9IHBCaXRCdWZCYXNlOwotICBoQml0QnVmLT5wQml0QnVmRW5kICA9IHBCaXRCdWZCYXNlICsgYml0QnVmU2l6ZSAtIDE7Ci0KLQotICBoQml0QnVmLT5wV3JpdGVOZXh0ICA9IHBCaXRCdWZCYXNlOwotCi0gIGhCaXRCdWYtPndCaXRQb3MgICAgID0gMDsKLSAgaEJpdEJ1Zi0+Y250Qml0cyAgICAgPSAwOwotCi0gIGhCaXRCdWYtPmNhY2hlCSAgID0gMDsKLX0KLQotLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCi0qCi0qIGZ1bmN0aW9uIG5hbWU6IENvcHlCaXRCdWYKLSogZGVzY3JpcHRpb246ICBjb3B5IEJpdCBCdWZmZXIgTWFuYWdlbWVudAotKgotKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi12b2lkIENvcHlCaXRCdWYoSEFORExFX0JJVF9CVUYgaEJpdEJ1ZlNyYywKLSAgICAgICAgICAgICAgICBIQU5ETEVfQklUX0JVRiBoQml0QnVmRHN0KQotewotICAqaEJpdEJ1ZkRzdCA9ICpoQml0QnVmU3JjOwotfQotCi0vKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKLSoKLSogZnVuY3Rpb24gbmFtZTogR2V0Qml0c0F2YWlsCi0qIGRlc2NyaXB0aW9uOiAgZ2V0IGF2YWlsYWJsZSBiaXRzCi0qCi0qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLVdvcmQxNiBHZXRCaXRzQXZhaWwoSEFORExFX0JJVF9CVUYgaEJpdEJ1ZikKLXsKLSAgcmV0dXJuIGhCaXRCdWYtPmNudEJpdHM7Ci19Ci0KLS8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgotKgotKiBmdW5jdGlvbiBuYW1lOiBXcml0ZUJpdHMKLSogZGVzY3JpcHRpb246ICB3cml0ZSBiaXRzIHRvIHRoZSBidWZmZXIKLSoKLSoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotV29yZDE2IFdyaXRlQml0cyhIQU5ETEVfQklUX0JVRiBoQml0QnVmLAotICAgICAgICAgICAgICAgICBVV29yZDMyIHdyaXRlVmFsdWUsCi0gICAgICAgICAgICAgICAgIFdvcmQxNiBub0JpdHNUb1dyaXRlKQotewotICBXb3JkMTYgd0JpdFBvczsKLQotICBhc3NlcnQobm9CaXRzVG9Xcml0ZSA8PSAoV29yZDE2KXNpemVvZihXb3JkMzIpKjgpOwotCi0gIGlm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nMKLQotKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLQotI2luY2x1ZGUgImJpdGVuYy5oIgotI2luY2x1ZGUgImJpdF9jbnQuaCIKLSNpbmNsdWRlICJkeW5fYml0cy5oIgotI2luY2x1ZGUgInFjX2RhdGEuaCIKLSNpbmNsdWRlICJpbnRlcmZhY2UuaCIKLQotCi1zdGF0aWMgY29uc3QgIFdvcmQxNiBnbG9iYWxHYWluT2Zmc2V0ID0gMTAwOwotc3RhdGljIGNvbnN0ICBXb3JkMTYgaWNzUmVzZXJ2ZWRCaXQgICA9IDA7Ci0KLQotLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCi0qCi0qIGZ1bmN0aW9uIG5hbWU6IGVuY29kZVNwZWN0cmFsRGF0YQotKiBkZXNjcmlwdGlvbjogIGVuY29kZSBzcGVjdHJhbCBkYXRhCi0qIHJldHVybnM6ICAgICAgc3BlY3RyYWwgYml0cyB1c2VkCi0qCi0qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLXN0YXRpYyBXb3JkMzIgZW5jb2RlU3BlY3RyYWxEYXRhKFdvcmQxNiAgICAgICAgICAgICAqc2ZiT2Zmc2V0LAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgU0VDVElPTl9EQVRBICAgICAgICpzZWN0aW9uRGF0YSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFdvcmQxNiAgICAgICAgICAgICAqcXVhbnRTcGVjdHJ1bSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEhBTkRMRV9CSVRfQlVGICAgICAgaEJpdFN0cmVhbSkKLXsKLSAgV29yZDE2IGksc2ZiOwotICBXb3JkMTYgZGJ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KioqKioqKioqKioqKioqKioqKioqKiovCi1zdGF0aWMgdm9pZCBlbmNvZGVHbG9iYWxHYWluKFdvcmQxNiBnbG9iYWxHYWluLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICBXb3JkMTYgbG9nTm9ybSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgV29yZDE2IHNjYWxlZmFjLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICBIQU5ETEVfQklUX0JVRiBoQml0U3RyZWFtKQotewotICBXcml0ZUJpdHMoaEJpdFN0cmVhbSwgKChnbG9iYWxHYWluIC0gc2NhbGVmYWMpICsgZ2xvYmFsR2Fpbk9mZnNldC0obG9nTm9ybSA8PCAyKSksIDgpOwotfQotCi0KLS8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgotKgotKiBmdW5jdGlvbiBuYW1lOmVuY29kZUljc0luZm8KLSogZGVzY3JpcHRpb246IGVuY29kZXMgSWNzIEluZm8KLSogcmV0dXJuczogICAgIG5vbmUKLSoKLSoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotCi1zdGF0aWMgdm9pZCBlbmNvZGVJY3NJbmZvKFdvcmQxNiBibG9ja1R5cGUsCi0gICAgICAgICAgICAgICAgICAgICAgICAgIFdvcmQxNiB3aW5kb3dTaGFwZSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgV29yZDE2IGdyb3VwaW5nTWFzaywKLSAgICAgICAgICAgICAgICAgICAgICAgICAgU0VDVElPTl9EQVRBICpzZWN0aW9uRGF0YSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgSEFORExFX0JJVF9CVUYgIGhCaXRTdHJlYW0pCi17Ci0gIFdyaXRlQml0cyhoQml0U3RyZWFtLGljc1Jlc2VydmVkQml0LDEpOwotICBXcml0ZUJpdHMoaEJpdFN0cmVhbSxibG9ja1R5cGUsMik7Ci0gIFdyaXRlQml0cyhoQml0U3RyZWFtLHdpbmRvd1NoYXBlLDEpOwotCi0KLSAgc3dpdGNoKGJsb2NrVHlwZSl7Ci0gICAgY2FzZSBMT05HX1dJTkRPVzoKLSAgICBjYXNlIFNUQVJUX1dJTkRPVzoKLSAgICBjYXNlIFNUT1BfV0lORE9XOgotICAgICAgV3JpdGVCaXRzKGhCaXRTdHJlYW0sc2VjdGlvbkRhdGEtPm1heFNmYlBlckdyb3VwLDYpOwotCi0gICAgICAvKiBObyBwcmVkaWN0b3IgZGF0YSBwcmVzZW50ICovCi0gICAgICBXcml0ZUJpdHMoaEJpdFN0cmVhbSwgMCwgMSk7Ci0gICAgICBicmVhazsKLQotICAgIGNhc2UgU0hPUlRfV0lORE9XOgotICAgICAgV3JpdGVCaXRzKGhCaXRTdHJlYW0sc2VjdGlvbkRhdGEtPm1heFNmYlBlckdyb3VwLDQpOwotCi0gICAgICAvKgotICAgICAgV3JpdGUgZ3JvdXBpbmcgYml0cwotICAgICAgKi8KLSAgICAgIFdyaXRlQml0cyhoQml0U3RyZWFtLGdyb3VwaW5nTWFzayxUUkFOU19GQUMtMSk7Ci0gICAgICBicmVhazsKLSAgfQotfQotCi0vKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKLSoKLSogZnVuY3Rpb24gbmFtZTogZW5jb2RlU2VjdGlvbkRhdGEKLSogZGVzY3JpcHRpb246ICBlbmNvZGUgc2VjdGlvbiBkYXRhIChjb21tb24gSHVmZm1hbiBjb2RlYm9va3MgZm9yIGFkamFjZW50Ci0qICAgICAgICAgICAgICAgU0ZCJ3MpCi0qIHJldHVybnM6ICAgICAgbm9uZQotKgotKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi1zdGF0aWMgV29yZDMyIG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3RMZW5CaXRzKTsKLSAgICAgIHNlY3RMZW4gPSBzZWN0TGVuIC0gc2VjdEVzY2FwZVZhbDsKLSAgICB9Ci0gICAgV3JpdGVCaXRzKGhCaXRTdHJlYW0sc2VjdExlbixzZWN0TGVuQml0cyk7Ci0gIH0KLSAgcmV0dXJuKEdldEJpdHNBdmFpbChoQml0U3RyZWFtKS1kYmdWYWwpOwotfQotCi0vKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKLSoKLSogZnVuY3Rpb24gbmFtZTogZW5jb2RlU2NhbGVGYWN0b3JEYXRhCi0qIGRlc2NyaXB0aW9uOiAgZW5jb2RlIERQQ00gY29kZWQgc2NhbGUgZmFjdG9ycwotKiByZXR1cm5zOiAgICAgIG5vbmUKLSoKLSoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotc3RhdGljIFdvcmQzMiBlbmNvZGVTY2FsZUZhY3RvckRhdGEoVVdvcmQxNiAgICAgICAgKm1heFZhbHVlSW5TZmIsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBTRUNUSU9OX0RBVEEgICAqc2VjdGlvbkRhdGEsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBXb3JkMTYgICAgICAgICAqc2NhbGVmYWMsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBIQU5ETEVfQklUX0JVRiAgaEJpdFN0cmVhbSkKLXsKLSAgV29yZDE2IGksaixsYXN0VmFsU2NmLGRlbHRhU2NmOwotICBXb3JkMTYgZGJnVmFsID0gR2V0Qml0c0F2YWlsKGhCaXRTdHJlYW0pOwotICBTRUNUSU9OX0lORk8qIHBzZWN0aW9uaW5mbzsKLQotICBsYXN0VmFsU2NmPXNjYWxlZmFjW3NlY3Rpb25EYXRhLT5maXJzdFNjZl07Ci0KLSAgZm9yKGk9MDtpPHNlY3Rpb25EYXRhLT5ub09mU2VjdGlvbnM7aSsrKXsKLSAgICBwc2VjdGlvbmluZm8gPSAmKHNlY3Rpb25EYXRhLT5zZWN0aW9uSW5mb1tpXSk7Ci0gICAgaWYgKHBzZWN0aW9uaW5mby0+Y29kZUJvb2sgIT0gQ09ERV9CT09LX1pFUk9fTk8pewotICAgICAgZm9yIChqPXBzZWN0aW9uaW5mby0+c2ZiU3RhcnQ7Ci0gICAgICAgICAgIGo8cHNlY3Rpb25pbmZvLT5zZmJTdGFydCtwc2VjdGlvbmluZm8tPnNmYkNudDsgaisrKXsKLQotICAgICAgICBpZihtYXhWYWx1ZUluU2ZiW2pdID09IDApIHsKLSAgICAgICAgICBkZWx0YVNjZiA9IDA7Ci0gICAgICAgIH0KLSAgICAgICAgZWxzZSB7Ci0gICAgICAgICAgZGVsdGFTY2YgPSBsYXN0VmFsU2NmIC0gc2NhbGVmYWNbal07Ci0gICAgICAgICAgbGFzdFZhbFNjZiA9IHNjYWxlZmFjW2pdOwotICAgICAgICB9Ci0KLSAgICAgICAgaWYoY29kZVNjYWxlZmFjdG9yRGVsdGEoZGVsdGFTY2YsaEJpdFN0cmVhbSkpewotICAgICAgICAgIHJldHVybigxKTsKLSAgICAgICAgfQotICAgICAgfQotICAgIH0KLQotICB9Ci0gIHJldHVybihHZXRCaXRzQXZhaWwoaEJpdFN0cmVhbSktZGJnVmFsKTsKLX0KLQotLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCi0qCi0qIGZ1bmN0aW9uIG5hbWU6ZW5jb2RlTXNJbmZvCi0qIGRlc2NyaXB0aW9uOiBlbmNvZGVzIE1TLVN0ZXJlbyBJbmZvCi0qIHJldHVybnM6ICAgICBub25lCi0qCi0qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLXN0YXRpYyB2b2lkIGVuY29kZU1TSW5mbyhXb3JkMTYgICAgICAgICAgc2ZiQ250LAotICAgICAgICAgICAgICAgICAgICAgICAgIFdvcmQxNiAgICAgICAgICBncnBTZmIsCi0gICAgICAgICAgICAgICAgICAgICAgICAgV29yZDE2ICAgICAgICAgIG1heFNmYiwKLSAgICAgICAgICAgICAgICAgICAgICAgICBXb3JkMTYgICAgICAgICAgbXNEaWdlc3QsCi0gICAgICAgICAgICAgICAgICAgICAgICAgV29yZDE2ICAgICAgICAgKmpzRmxhZ3MsCi0gICAgICAgICAgICAgICAgICAgICAgICAgSEFORExFX0JJVF9CVUYgIGhCaXRTdHJlYW0pCi17Ci0gIFdvcmQxNiBzZmIsIHNmYk9mZjsKLQotCi0gIHN3aXRjaChtc0RpZ2VzdCkKLSAgewotICAgIGNhc2UgTVNfTk9ORToKLSAgICAgIFdyaXRlQml0cyhoQml0U3RyZWFtLFNJX01TX01BU0tfTk9ORSwyKTsKLSAgICAgIGJyZWFrOwotCi0gICAgY2FzZSBNU19BTEw6Ci0gICAgICBXcml0ZUJpdHMoaEJpdFN0cmVhbSxTSV9NU19NQVNLX0FMTCwyKTsKLSAgICAgIGJyZWFrOwotCi0gICAgY2FzZSBNU19TT01FOgotICAgICAgV3JpdGVCaXRzKGhCaXRTdHJlYW0sU0lfTVNfTUFTS19TT01FLDIpOwotICAgICAgZm9yKHNmYk9mZiA9IDA7IHNmYk9mZiA8IHNmYkNudDsgc2ZiT2ZmKz1ncnBTZmIpIHsKLSAgICAgICAgZm9yKHNmYj0wOyBzZmI8bWF4U2ZiOyBzZmIrKykgewotCi0gICAgICAgICAgaWYoanNGbGFnc1tzZmJPZmYrc2ZiXSAmIE1TX09OKSB7Ci0gICAgICAgICAgICBXcml0ZUJpdHMoaEJpdFN0cmVhbSwxLDEpOwotICAgICAgICAgIH0KLSAgICAgICAgICBlbHNlewotICAgICAgICAgICAgV3JpdGVCaXRzKGhCaXRTdHJlYW0sMCwxKTsKLSAgICAgICAgICB9Ci0gICAgICAgIH0KLSAgICAgIH0KLSAgICAgIGJyZWFrOwotICB9Ci0KLX0KLQotLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCi0qCi0qIGZ1bmN0aW9uIG5hbWU6IGVuY29kZVRuc0RhdGEKLSogZGVzY3JpcHRpb246ICBlbmNvZGUgVE5TIGRhdGEgKGZpbHRlciBvcmRlciwgY29lZmZzLCAuLikKLSogcmV0dXJuczogICAgICBub25lCi0qCi0qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLXN0YXRpYyB2b2lkIGVuY29kZVRuc0RhdGEoVE5TX0lORk8gdG5zSW5mbywKLSAgICAgICAgICAgICAgICAgICAgICAgICAgV29yZDE2IGJsb2NrVHlwZSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgSEFORExFX0JJVF9CVUYgaEJpdFN0cmVhbSkgewotICBXb3JkMTYgaSxrOwotICBGbGFnIHRuc1ByZXNlbnQ7Ci0gIFdvcmQxNiBudW1PZldpbmRvd3M7Ci0gIFdvcmQxNiBjb2VmQml0czsKLSAgRmxhZyBpc1Nob3J0OwotCi0KLSAgaWYgKGJsb2NrVHlwZT09MikgewotICAgIGlzU2hvcnQgPSAxOwotICAgIG51bU9mV2luZG93cyA9IFRSQU5TX0ZBQzsKLSAgfQotICBlbHNlIHsKLSAgICBpc1Nob3J0ID0gMDsKLSAgICBudW1PZldpbmRvd3MgPSAxOwotICB9Ci0KLSAgdG5zUHJlc2VudD0wOwotICBmb3IgKGk9MDsgaTxudW1PZldpbmRvd3M7IGkrKykgewotCi0gICAgaWYgKHRuc0luZm8udG5zQWN0aXZlW2ldKSB7Ci0gICAgICB0bnNQcmVzZW50PTE7Ci0gICAgfQotICB9Ci0KLSAgaWYgKHRuc1ByZXN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gICAgICAgICAgICAgY29lZkJpdHMgPSA0OwotICAgICAgICAgICAgICAgIGJyZWFrOwotICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICB9Ci0gICAgICAgICAgfQotICAgICAgICAgIGVsc2UgewotICAgICAgICAgICAgY29lZkJpdHMgPSAyOwotICAgICAgICAgICAgZm9yKGs9MDsgazx0bnNJbmZvLm9yZGVyW2ldOyBrKyspIHsKLQotICAgICAgICAgICAgICBpZiAodG5zSW5mby5jb2VmW2kqVE5TX01BWF9PUkRFUl9TSE9SVCtrXSA+IDEgfHwKLSAgICAgICAgICAgICAgICAgIHRuc0luZm8uY29lZltpKlROU19NQVhfT1JERVJfU0hPUlQra10gPCAtMikgewotICAgICAgICAgICAgICAgIGNvZWZCaXRzID0gMzsKLSAgICAgICAgICAgICAgICBicmVhazsKLSAgICAgICAgICAgICAgfQotICAgICAgICAgICAgfQotICAgICAgICAgIH0KLSAgICAgICAgICBXcml0ZUJpdHMoaEJpdFN0cmVhbSwgdG5zSW5mby5jb2VmUmVzW2ldIC0gY29lZkJpdHMsIDEpOyAvKmNvZWZfY29tcHJlcyovCi0gICAgICAgICAgZm9yIChrPTA7IGs8dG5zSW5mby5vcmRlcltpXTsgaysrICkgewotICAgICAgICAgICAgc3RhdGljIGNvbnN0IFdvcmQxNiBybWFza1tdID0gezAsMSwzLDcsMTV9OwotCi0gICAgICAgICAgICBXcml0ZUJpdHMoaEJpdFN0cmVhbSx0bnNJbmZvLmNvZWZbaSpUTlNfTUFYX09SREVSX1NIT1JUK2tdICYgcm1hc2tbY29lZkJpdHNdLGNvZWZCaXRzKTsKLSAgICAgICAgICB9Ci0gICAgICAgIH0KLSAgICAgIH0KLSAgICB9Ci0gIH0KLQotfQotCi0vKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKLSoKLSogZnVuY3Rpb24gbmFtZTogZW5jb2RlR2FpbkNvbnRyb2xEYXRhCi0qIGRlc2NyaXB0aW9uOiAgdW5zdXBwb3J0ZWQKLSogcmV0dXJuczogICAgICBub25lCi0qCi0qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLXN0YXRpYyB2b2lkIGVuY29kZUdhaW5Db250cm9sRGF0YShIQU5ETEVfQklUX0JVRiBoQml0U3RyZWFtKQotewotICBXcml0ZUJpdHMoaEJpdFN0cmVhbSwwLDEpOwotfQotCi0vKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKLSoKLSogZnVuY3Rpb24gbmFtZTogZW5jb2RlUHVsc2VEYXRhCi0qIGRlc2NyaXB0aW9uOiAgbm90IHN1cHBvcnRlZCB5ZXQgKGR1bW15KQotKiByZXR1cm5zOiAgICAgIG5vbmUKLSoKLSoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotc3RhdGljIHZvaWQgZW5jb2RlUHVsc2VEYXRhKEhBTkRMRV9CSVRfQlVGIGhCaXRTdHJlYW0pCi17Ci0gIFdyaXRlQml0cyhoQml0U3RyZWFtLDAsMSk7Ci19Ci0KLQotLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCi0qCi0qIGZ1bmN0aW9uIG5hbWU6IFdyaXRlSW5kaXZpZHVhbENoYW5uZWxTdHJlYW0KLSogZGVzY3JpcHRpb246ICBtYW5hZ2VtZW50IG9mIHdyaXRlIHByb2Nlc3Mgb2YgaW5kaXZpZHVhbCBjaGFubmVsIHN0cmVhbQotKiByZXR1cm5zOiAgICAgIG5vbmUKLSoKLSoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotc3RhdGljIHZvaWQKLXdyaXRlSW5kaXZpZHVhbENoYW5uZWxTdHJlYW0oRmxhZyAgIGNvbW1vbldpbmRvdywKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgV29yZDE2IG1kY3RTY2FsZSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgV29yZDE2IHdpbmRvd1NoYXBlLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICBXb3JkMTYgZ3JvdXBpbmdNYXNrLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICBXb3JkMTYgKnNmYk9mZnNldCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgV29yZDE2IHNjZltdLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICBVV29yZDE2ICptYXhWYWx1ZUluU2ZiLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICBXb3JkMTYgZ2xvYmFsR2FpbiwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgV29yZDE2IHF1YW50U3BlY1tdLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICBTRUNUSU9OX0RBVEEgKnNlY3Rpb25EYXRhLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICBIQU5ETEVfQklUX0JVRiBoQml0U3RyZWFtLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICBUTlNfSU5GTyB0bnNJbmZvKQotewotICBXb3JkMTYgbG9nTm9ybTsKLQotICBsb2dOb3JtID0gTE9HX05PUk1fUENNIC0gKG1kY3RTY2FsZSArIDEpOwotCi0gIGVuY29kZUdsb2JhbEdhaW4oZ2xvYmFsR2FpbiwgbG9nTm9ybSxzY2Zbc2VjdGlvbkRhdGEtPmZpcnN0U2NmXSwgaEJpdFN0cmVhbSk7Ci0KLQotICBpZighY29tbW9uV2luZG93KSB7Ci0gICAgZW5jb2RlSWNzSW5mbyhzZWN0aW9uRGF0YS0+YmxvY2tUeXBlLCB3aW5kb3dTaGFwZSwgZ3JvdXBpbmdNYXNrLCBzZWN0aW9uRGF0YSwgaEJpdFN0cmVhbSk7Ci0gIH0KLQotICBlbmNvZGVTZWN0aW9uRGF0YShzZWN0aW9uRGF0YSwgaEJpdFN0cmVhbSk7Ci0KLSAgZW5jb2RlU2NhbGVGYWN0b3JEYXRhKG1heFZhbHVlSW5TZmIsCi0gICAgICAgICAgICAgICAgICAgICAgICBzZWN0aW9uRGF0YSwKLSAgICAgICAgICAgICAgICAgICAgICAgIHNjZiwKLSAgICAgICAgICAgICAgICAgICAgICAgIGhCaXRTdHJlYW0pOwotCi0gIGVuY29kZVB1bHNlRGF0YShoQml0U3RyZWFtKTsKLQotICBlbmNvZGVUbnNEYXRhKHRuc0luZm8sIHNlY3Rpb25EYXRhLT5ibG9ja1R5cGUsIGhCaXRTdHJlYW0pOwotCi0gIGVuY29kZUdhaW5Db250cm9sRGF0YShoQml0U3RyZWFtKTsKLQotICBlbmNvZGVTcGVjdHJhbERhdGEoc2ZiT2Zmc2V0LAotICAgICAgICAgICAgICAgICAgICAgc2VjdGlvbkRhdGEsCi0gICAgICAgICAgICAgICAgICAgICBxdWFudFNwZWMsCi0gICAgICAgICAgICAgICAgICAgICBoQml0U3RyZWFtKTsKLQotfQotCi0vKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKLSoKLSogZnVuY3Rpb24gbmFtZTogd3JpdGVTaW5nbGVDaGFubmVsRWxlbWVudAotKiBkZXNjcmlwdGlvbjogIHdyaXRlIHNpbmdsZSBjaGFubmVsIGVsZW1lbnQgdG8gYml0c3RyZWFtCi0qIHJldHVybnM6ICAgICAgbm9uZQotKgotKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi1zdGF0aWMgV29yZDE2IHdyaXRlU2luZ2xlQ2hhbm5lbEVsZW1lbnQoV29yZDE2IGluc3RhbmNlVGFnLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFdvcmQxNiAqc2ZiT2Zmc2V0LAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFFDX09VVF9DSEFOTkVMKiBxY091dENoYW5uZWwsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgSEFORExFX0JJVF9CVUYgaEJpdFN0cmVhbSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBUTlNfSU5GTyB0bnNJbmZvKQotewotICBXcml0ZUJpdHMoaEJpdFN0cmVhbSxJRF9TQ0UsMyk7Ci0gIFdyaXRlQml0cyhoQml0U3RyZWFtLGluc3RhbmNlVGFnLDQpOwotICB3cml0ZUluZGl2aWR1YWxDaGFubmVsU3RyZWFtKDAsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcWNPdXRDaGFubmVsLT5tZGN0U2NhbGUsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcWNPdXRDaGFubmVsLT53aW5kb3dTaGFwZSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBxY091dENoYW5uZWwtPmdyb3VwaW5nTWFzaywKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzZmJPZmZzZXQsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcWNPdXRDaGFubmVsLT5zY2YsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcWNPdXRDaGFubmVsLT5tYXhWYWx1ZUluU2ZiLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHFjT3V0Q2hhbm5lbC0+Z2xvYmFsR2FpbiwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBxY091dENoYW5uZWwtPnF1YW50U3BlYywKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmKHFjT3V0Q2hhbm5lbC0+c2VjdGlvbkRhdGEpLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGhCaXRTdHJlYW0sCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdG5zSW5mbwotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICk7Ci0gIHJldHVybigwKTsKLX0KLQotCi0KLS8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgotKgotKiBmdW5jdGlvbiBuYW1lOiB3cml0ZUNoYW5uZWxQYWlyRWxlbWVudAotKiBkZXNjcmlwdGlvbjoKLSogcmV0dXJuczogICAgICBub25lCi0qCi0qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLXN0YXRpYyBXb3JkMTYgd3JpdGVDaGFubmVsUGFpckVsZW1lbnQoV29yZDE2IGluc3RhbmNlVGFnLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBXb3JkMTYgbXNEaWdlc3QsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFdvcmQxNiBtc0ZsYWdzW01BWF9HUk9VUEVEX1NGQl0sCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFdvcmQxNiAqc2ZiT2Zmc2V0WzJdLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBRQ19PVVRfQ0hBTk5FTCBxY091dENoYW5uZWxbMl0sCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEhBTkRMRV9CSVRfQlVGIGhCaXRTdHJlYW0sCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFROU19JTkZPIHRuc0luZm9bMl0pCi17Ci0gIFdyaXRlQml0cyhoQml0U3RyZWFtLElEX0NQRSwzKTsKLSAgV3JpdGVCaXRzKGhCaXRTdHJlYW0saW5zdGFuY2VUYWcsNCk7Ci0gIFdyaXRlQml0cyhoQml0U3RyZWFtLDEsMSk7IC8qIGNvbW1vbiB3aW5kb3cgKi8KLQotICBlbmNvZGVJY3NJbmZvKHFjT3V0Q2hhbm5lbFswXS5zZWN0aW9uRGF0YS5ibG9ja1R5cGUsCi0gICAgICAgICAgICAgICAgcWNPdXRDaGFubmVsWzBdLndpbmRvd1NoYXBlLAotICAgICAgICAgICAgICAgIHFjT3V0Q2hhbm5lbFswXS5ncm91cGluZ01hc2ssCi0gICAgICAgICAgICAgICAgJihxY091dENoYW5uZWxbMF0uc2VjdGlvbkRhdGEpLAotICAgICAgICAgICAgICAgIGhCaXRTdHJlYW0pOwotCi0gIGVuY29kZU1TSW5mbyhxY091dENoYW5uZWxbMF0uc2VjdGlvbkRhdGEuc2ZiQ250LAotICAgICAgICAgICAgICAgcWNPdXRDaGFubmVsWzBdLnNlY3Rpb25EYXRhLnNmYlBlckdyb3VwLAotICAgICAgICAgICAgICAgcWNPdXRDaGFubmVsWzBdLnNlY3Rpb25EYXRhLm1heFNmYlBlckdyb3VwLAotICAgICAgICAgICAgICAgbXNEaWdlc3QsCi0gICAgICAgICAgICAgICBtc0ZsYWdzLAotICAgICAgICAgICAgICAgaEJpdFN0cmVhbSk7Ci0KLSAgd3JpdGVJbmRpdmlkdWFsQ2hhbm5lbFN0cmVhbSgxLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHFjT3V0Q2hhbm5lbFswXS5tZGN0U2NhbGUsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcWNPdXRDaGFubmVsWzBdLndpbmRvd1NoYXBlLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHFjT3V0Q2hhbm5lbFswXS5ncm91cGluZ01hc2ssCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2ZiT2Zmc2V0WzBdLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHFjT3V0Q2hhbm5lbFswXS5zY2YsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcWNPdXRDaGFubmVsWzBdLm1heFZhbHVlSW5TZmIsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcWNPdXRDaGFubmVsWzBdLmdsb2JhbEdhaW4sCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcWNPdXRDaGFubmVsWzBdLnF1YW50U3BlYywKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmKHFjT3V0Q2hhbm5lbFswXS5zZWN0aW9uRGF0YSksCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaEJpdFN0cmVhbSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0bnNJbmZvWzBdKTsKLQotICB3cml0ZUluZGl2aWR1YWxDaGFubmVsU3RyZWFtKDEsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcWNPdXRDaGFubmVsWzFdLm1kY3RTY2FsZSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBxY091dENoYW5uZWxbMV0ud2luZG93U2hhcGUsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcWNPdXRDaGFubmVsWzFdLmdyb3VwaW5nTWFzaywKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzZmJPZmZzZXRbMV0sCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcWNPdXRDaGFubmVsWzFdLnNjZiwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBxY091dENoYW5uZWxbMV0ubWF4VmFsdWVJblNmYiwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBxY091dENoYW5uZWxbMV0uZ2xvYmFsR2FpbiwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBxY091dENoYW5uZWxbMV0ucXVhbnRTcGVjLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICYocWNPdXRDaGFubmVsWzFdLnNlY3Rpb25EYXRhKSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBoQml0U3RyZWFtLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRuc0luZm9bMV0pOwotCi0gIHJldHVybigwKTsKLX0KLQotCi0KLS8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgotKgotKiBmdW5jdGlvbiBuYW1lOiB3cml0ZUZpbGxFbGVtZW50Ci0qIGRlc2NyaXB0aW9uOiAgd3JpdGUgZmlsbCBlbGVtZW50cyB0byBiaXRzdHJlYW0KLSogcmV0dXJuczogICAgICBub25lCi0qCi0qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLXN0YXRpYyB2b2lkIHdyaXRlRmlsbEVsZW1lbnQoIGNvbnN0IFVXb3JkOCAqYW5jQnl0ZXMsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICBXb3JkMTYgdG90RmlsbEJpdHMsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICBIQU5ETEVfQklUX0JVRiBoQml0U3RyZWFtKQotewotICBXb3JkMTYgaTsKLSAgV29yZDE2IGNudCxlc2NfY291bnQ7Ci0KLSAgLyoKLSAgICBXcml0ZSBmaWxsIEVsZW1lbnQocyk6Ci0gICAgYW1vdW50IG9mIGEgZmlsbCBlbGVtZW50IGNhbiBiZSA3K1gqOCBCaXRzLCBYIGVsZW1lbnQgb2YgWzAuLjI3MF0KLSAgKi8KLQotICB3aGlsZSh0b3RGaWxsQml0cyA+PSAoMys0KSkgewotICAgIGNudCA9IG1pbigoKHRvdEZpbGxCaXRzIC0gKDMrNCkpID4+IDMpLCAoKDE8PDQpLTEpKTsKLQotICAgIFdyaXRlQml0cyhoQml0U3RyZWFtLElEX0ZJTCwzKTsKLSAgICBXcml0ZUJpdHMoaEJpdFN0cmVhbSxjbnQsNCk7Ci0KLSAgICB0b3RGaWxsQml0cyA9IHRvdEZpbGxCaXRzIC0gKDMrNCk7Ci0KLQotICAgIGlmICgoY250ID09ICgxPDw0KS0xKSkgewotCi0gICAgICBlc2NfY291bnQgPSBtaW4oICgodG90RmlsbEJpdHMgPj4gMykgLSAoKDE8PDQpLTEpKSwgKDE8PDgpLTEpOwotICAgICAgV3JpdGVCaXRzKGhCaXRTdHJlYW0sZXNjX2NvdW50LDgpOwotICAgICAgdG90RmlsbEJpdHMgPSAodG90RmlsbEJpdHMgLSA4KTsKLSAgICAgIGNudCA9IGNudCArIChlc2NfY291bnQgLSAxKTsKLSAgICB9Ci0KLSAgICBmb3IoaT0wO2k8Y250O2krKykgewotCi0gICAgICBpZihhbmNCeXRlcykKLSAgICAgICAgV3JpdGVCaXRzKGhCaXRTdHJlYW0sICphbmNCeXRlcysrLDgpOwotICAgICAgZWxzZQotICAgICAgICBXcml0ZUJpdHMoaEJpdFN0cmVhbSwwLDgpOwotICAgICAgdG90RmlsbEJpdHMgPSB0b3RGaWxsQml0cyAtIDg7Ci0gICAgfQotICB9Ci19Ci0KLS8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgotKgotKiBmdW5jdGlvbiBuYW1lOiBXcml0ZUJpdFN0cmVhbQotKiBkZXNjcmlwdGlvbjogIG1haW4gZnVuY3Rpb24gb2Ygd3JpdGUgYml0c3RlYW0gcHJvY2VzcwotKiByZXR1cm5zOiAgICAgIDAgaWYgc3VjY2VzcwotKgotKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi1Xb3JkMTYgV3JpdGVCaXRzdHJlYW0gKEhBTkRMRV9CSVRfQlVGIGhCaXRTdHJlYW0sCi0gICAgICAgICAgICAgICAgICAgICAgIEVMRU1FTlRfSU5GTyBlbEluZm8sCi0gICAgICAgICAgICAgICAgICAgICAgIFFDX09VVCAq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WxJbmZvLmVsVHlwZSkgewotCi0gICAgICBjYXNlIElEX1NDRTogICAgICAvKiBzaW5nbGUgY2hhbm5lbCAqLwotICAgICAgICBzZmJPZmZzZXRbMF0gPSBwc3lPdXQtPnBzeU91dENoYW5uZWxbZWxJbmZvLkNoYW5uZWxJbmRleFswXV0uc2ZiT2Zmc2V0czsKLSAgICAgICAgdG5zSW5mb1swXSA9IHBzeU91dC0+cHN5T3V0Q2hhbm5lbFtlbEluZm8uQ2hhbm5lbEluZGV4WzBdXS50bnNJbmZvOwotCi0gICAgICAgIHdyaXRlU2luZ2xlQ2hhbm5lbEVsZW1lbnQoZWxJbmZvLmluc3RhbmNlVGFnLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNmYk9mZnNldFswXSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmcWNPdXQtPnFjQ2hhbm5lbFtlbEluZm8uQ2hhbm5lbEluZGV4WzBdXSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBoQml0U3RyZWFtLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRuc0luZm9bMF0pOwotICAgICAgICBicmVhazsKLQotICAgICAgY2FzZSBJRF9DUEU6ICAgICAvKiBjaGFubmVsIHBhaXIgKi8KLSAgICAgICAgewotICAgICAgICAgIFdvcmQxNiBtc0RpZ2VzdDsKLSAgICAgICAgICBXb3JkMTYgKm1zRmxhZ3MgPSBwc3lPdXQtPnBzeU91dEVsZW1lbnQudG9vbHNJbmZvLm1zTWFzazsKLSAgICAgICAgICBtc0RpZ2VzdCA9IHBzeU91dC0+cHN5T3V0RWxlbWVudC50b29sc0luZm8ubXNEaWdlc3Q7Ci0gICAgICAgICAgc2ZiT2Zmc2V0WzBdID0KLSAgICAgICAgICAgIHBzeU91dC0+cHN5T3V0Q2hhbm5lbFtlbEluZm8uQ2hhbm5lbEluZGV4WzBdXS5zZmJPZmZzZXRzOwotICAgICAgICAgIHNmYk9mZnNldFsxXSA9Ci0gICAgICAgICAgICBwc3lPdXQtPnBzeU91dENoYW5uZWxbZWxJbmZvLkNoYW5uZWxJbmRleFsxXV0uc2ZiT2Zmc2V0czsKLQotICAgICAgICAgIHRuc0luZm9bMF09Ci0gICAgICAgICAgICBwc3lPdXQtPnBzeU91dENoYW5uZWxbZWxJbmZvLkNoYW5uZWxJbmRleFswXV0udG5zSW5mbzsKLSAgICAgICAgICB0bnNJbmZvWzFdPQotICAgICAgICAgICAgcHN5T3V0LT5wc3lPdXRDaGFubmVsW2VsSW5mby5DaGFubmVsSW5kZXhbMV1dLnRuc0luZm87Ci0gICAgICAgICAgd3JpdGVDaGFubmVsUGFpckVsZW1lbnQoZWxJbmZvLmluc3RhbmNlVGFnLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1zRGlnZXN0LAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1zRmxhZ3MsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2ZiT2Zmc2V0LAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICZxY091dC0+cWNDaGFubmVsW2VsSW5mby5DaGFubmVsSW5kZXhbMF1dLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGhCaXRTdHJlYW0sCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdG5zSW5mbyk7Ci0gICAgICAgIH0KLSAgICAgICAgYnJlYWs7Ci0KLSAgICAgIGRlZmF1bHQ6Ci0gICAgICAgIHJldHVybigxKTsKLQotICAgICAgfSAgIC8qIHN3aXRjaCAqLwotCi0gICAgZWxlbWVudFVzZWRCaXRzID0gZWxlbWVudFVzZWRCaXRzIC0gYml0TWFya1VwOwotICAgIGJpdE1hcmtVcCA9IEdldEJpdHNBdmFpbChoQml0U3RyZWFtKTsKLSAgICBmcmFtZUJpdHMgPSBmcmFtZUJpdHMgKyBlbGVtZW50VXNlZEJpdHMgKyBiaXRNYXJrVXA7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XRjaGluZyBmdW5jdGlvbnMKLQotKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLQotI2luY2x1ZGUgInR5cGVkZWYuaCIKLSNpbmNsdWRlICJiYXNpY19vcC5oIgotI2luY2x1ZGUgIm9wZXJfMzJiLmgiCi0jaW5jbHVkZSAicHN5X2NvbnN0LmgiCi0jaW5jbHVkZSAiYmxvY2tfc3dpdGNoLmgiCi0KLQotI2RlZmluZSBFTkVSR1lfU0hJRlQgKDggLSAxKQotCi0vKioqKioqKioqKioqKioqKiBpbnRlcm5hbCBmdW5jdGlvbiBwcm90b3R5cGVzICoqKioqKioqKioqLwotc3RhdGljIFdvcmQxNgotSUlSRmlsdGVyKGNvbnN0IFdvcmQxNiBpbiwgY29uc3QgV29yZDMyIGNvZWZmW10sIFdvcmQzMiBzdGF0ZXNbXSk7Ci0KLXN0YXRpYyBXb3JkMzIKLVNyY2hNYXhXaXRoSW5kZXgoY29uc3QgV29yZDMyICppbiwgV29yZDE2ICppbmRleCwgV29yZDE2IG4pOwotCi0KLVdvcmQzMgotQ2FsY1dpbmRvd0VuZXJneShCTE9DS19TV0lUQ0hJTkdfQ09OVFJPTCAqYmxvY2tTd2l0Y2hpbmdDb250cm9sLAotICAgICAgICAgICAgICAgICBXb3JkMTYgKnRpbWVTaWduYWwsCi0gICAgICAgICAgICAgICAgIFdvcmQxNiBjaEluY3JlbWVudCwKLSAgICAgICAgICAgICAgICAgV29yZDE2IHdpbmRvd0xlbik7Ci0KLQotCi0vKioqKioqKioqKioqKioqKioqIENvbnN0YW50cyAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLQotCi0vKgotICBJSVIgaGlnaCBwYXNzIGNvZWZmcwotKi8KLVdvcmQzMiBoaVBhc3NDb2VmZltCTE9DS19TV0lUQ0hJTkdfSUlSX0xFTl0gPSB7Ci0gIDB4YmVjOGI0MzksIDB4NjA5ZDQ5NTIgIC8qIC0wLjUwOTVmLCAwLjc1NDhmICovCi19OwotCi1zdGF0aWMgY29uc3QgV29yZDMyIGFjY1dpbmRvd05yZ0ZhYyA9IDB4MjY2NjY2NjY7ICAgICAgICAgICAgICAgICAgIC8qIGZhY3RvciBmb3IgYWNjdW11bGF0aW5nIGZpbHRlcmVkIHdpbmRvdyBlbmVyZ2llcyAwLjMgKi8KLXN0YXRpYyBjb25zdCBXb3JkMzIgb25lTWludXNBY2NXaW5kb3dOcmdGYWMgPSAweDU5OTk5OTlhOwkJCS8qIDAuNyAqLwotc3RhdGljIGNvbnN0IFdvcmQzMiBpbnZBdHRhY2tSYXRpb0hpZ2hCciA9IDB4MGNjY2NjY2Q7ICAgICAgICAgICAgICAvKiBpbnZlcnRlZCBsb3dlciByYXRpbyBsaW1pdCBmb3IgYXR0YWNrcyAwLjEqLwotc3RhdGljIGNvbnN0IFdvcmQzMiBpbnZBdHRhY2tSYXRpb0xvd0JyID0gIDB4MDcyYjAyMGM7ICAgICAgICAgICAgICAvKiAwLjA1NiAqLwotc3RhdGljIGNvbnN0IFdvcmQzMiBtaW5BdHRhY2tOcmcgPSAweDAwMDAxZTg0OyAgICAgICAgICAgICAgICAgICAgICAvKiBtaW5pbXVtIGVuZXJneSBmb3IgYXR0YWNrcyAxZSs2ICovCi0KLQotLyoqKioqKioqKioqKioqKioqKiBSb3V0aW5lcyAqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotCi0KLS8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgotKgotKiBmdW5jdGlvbiBuYW1lOiBJbml0QmxvY2tTd2l0Y2hpbmcKLSogZGVzY3JpcHRpb246ICBpbml0IEJsb2NrIFN3aXRjaGluZyBwYXJhbWV0ZXIuCi0qIHJldHVybnM6ICAgICAgVFJVRSBpZiBzdWNjZXNzCi0qCi0qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotV29yZDE2IEluaXRCbG9ja1N3aXRjaGluZyhCTE9DS19TV0lUQ0hJTkdfQ09OVFJPTCAqYmxvY2tTd2l0Y2hpbmdDb250cm9sLAotICAgICAgICAgICAgICAgICAgICAgICAgICBjb25zdCBXb3JkMzIgYml0UmF0ZSwgY29uc3QgV29yZDE2IG5DaGFubmVscykKLXsKLSAgLyogc2VsZWN0IGF0dGFja1JhdGlvICovCi0KLSAgaWYgKChzdWIobkNoYW5uZWxzLDEpPT0wICYmIExfc3ViKGJpdFJhdGUsIDI0MDAwKSA+IDApIHx8Ci0gICAgICAoc3ViKG5DaGFubmVscywxKT4wICYmIGJpdFJhdGUgPiAobkNoYW5uZWxzICogMTYwMDApKSkgewotICAgIGJsb2NrU3dpdGNoaW5nQ29udHJvbC0+aW52QXR0YWNrUmF0aW8gPSBpbnZBdHRhY2tSYXRpb0hpZ2hCcjsKLSAgfQotICBlbHNlICB7Ci0gICAgYmxvY2tTd2l0Y2hpbmdDb250cm9sLT5pbnZBdHRhY2tSYXRpbyA9IGludkF0dGFja1JhdGlvTG93QnI7Ci0gIH0KLQotICByZXR1cm4oVFJVRSk7Ci19Ci0KLXN0YXRpYyBXb3JkMTYgc3VnZ2VzdGVkR3JvdXBpbmdUYWJsZVtUUkFOU19GQUNdW01BWF9OT19PRl9HUk9VUFNdID0gewotICAvKiBBdHRhY2sgaW4gV2luZG93IDAgKi8gezEsICAzLCAgMywgIDF9LAotICAvKiBBdHRhY2sgaW4gV2luZG93IDEgKi8gezEsICAxLCAgMywgIDN9LAotICAvKiBBdHRhY2sgaW4gV2luZG93IDIgKi8gezIsICAxLCAgMywgIDJ9LAotICAvKiBBdHRhY2sgaW4gV2luZG93IDMgKi8gezMsICAxLCAgMywgIDF9LAotICAvKiBBdHRhY2sgaW4gV2luZG93IDQgKi8gezMsICAxLCAgMSwgIDN9LAotICAvKiBBdHRhY2sgaW4gV2luZG93IDUgKi8gezMsICAyLCAgMSwgIDJ9LAotICAvKiBBdHRhY2sgaW4gV2luZG93IDYgKi8gezMsICAzLCAgMSwgIDF9LAotICAvKiBBdHRhY2sgaW4gV2luZG93IDcgKi8gezMsICAzLCAgMSwgIDF9Ci19OwotCi0vKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKLSoKLSogZnVuY3Rpb24gbmFtZTogQmxvY2tTd2l0Y2hpbmcKLSogZGVzY3JpcHRpb246ICBkZXRlY3QgdGhpcyBmcmFtZSB3aGV0aGVyIHRoZXJlIGlzIGFuIGF0dGFjawotKiByZXR1cm5zOiAgICAgIFRSVUUgaWYgc3VjY2VzcwotKgotKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLVdvcmQxNiBCbG9ja1N3aXRjaGluZyhCTE9DS19TV0lUQ0hJTkdfQ09OVFJPTCAqYmxvY2tTd2l0Y2hpbmdDb250cm9sLAotICAgICAgICAgICAgICAgICAgICAgIFdvcmQxNiAqdGltZVNpZ25hbCwKLQkJCQkJICBXb3JkMzIgc2FtcGxlUmF0ZSwKLSAgICAgICAgICAgICAgICAgICAgICBXb3JkMTYgY2hJbmNyZW1lbnQpCi17Ci0gIFdvcmQzMiBpLCB3OwotICBXb3JkMzIgZW5NMSwgZW5NYXg7Ci0KLSAgLyogUmVzZXQgZ3JvdXBpbmcgaW5mbyAqLwotICBmb3IgKGk9MDsgaTxUUkFOU19GQUM7IGkrKykgewotICAgIGJsb2NrU3dpdGNoaW5nQ29udHJvbC0+Z3JvdXBMZW5baV0gPSAwOwotICB9Ci0KLQotICAvKiBTZWFyY2ggZm9yIHBvc2l0aW9uIGFuZCBhbXBsaXR1ZGUgb2YgYXR0YWNrIGluIGxhc3QgZnJhbWUgKDEgd2luZG93cyBkZWxheSkgKi8KLS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KSB7Ci0KLSAgICBpZiAoYmxvY2tTd2l0Y2hpbmdDb250cm9sLT53aW5kb3dTZXF1ZW5jZSA9PSBTSE9SVF9XSU5ET1cpIHsKLSAgICAgIGJsb2NrU3dpdGNoaW5nQ29udHJvbC0+bmV4dHdpbmRvd1NlcXVlbmNlID0gU1RPUF9XSU5ET1c7Ci0gICAgfQotICB9Ci0KLSAgcmV0dXJuKFRSVUUpOwotfQotCi0KLS8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgotKgotKiBmdW5jdGlvbiBuYW1lOiBTcmNoTWF4V2l0aEluZGV4Ci0qIGRlc2NyaXB0aW9uOiAgc2VhcmNoIGZvciB0aGUgYmlnZ2VzdCB2YWx1ZSBpbiBhbiBhcnJheQotKiByZXR1cm5zOiAgICAgIHRoZSBtYXggdmFsdWUKLSoKLSoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi1zdGF0aWMgV29yZDMyIFNyY2hNYXhXaXRoSW5kZXgoY29uc3QgV29yZDMyIGluW10sIFdvcmQxNiAqaW5kZXgsIFdvcmQxNiBuKQotewotICBXb3JkMzIgbWF4OwotICBXb3JkMzIgaSwgaWR4OwotCi0gIC8qIFNlYXJjaCBtYXhpbXVtIHZhbHVlIGluIGFycmF5IGFuZCByZXR1cm4gaW5kZXggYW5kIHZhbHVlICovCi0gIG1heCA9IDA7Ci0gIGlkeCA9IDA7Ci0KLSAgZm9yIChpID0gMDsgaSA8IG47IGkrKykgewotCi0gICAgaWYgKGluW2krMV0gID4gbWF4KSB7Ci0gICAgICBtYXggPSBpbltpKzFdOwotICAgICAgaWR4ID0gaTsKLSAgICB9Ci0gIH0KLSAgKmluZGV4ID0gaWR4OwotCi0gIHJldHVybihtYXgpOwotfQotCi0vKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKLSoKLSogZnVuY3Rpb24gbmFtZTogQ2FsY1dpbmRvd0VuZXJneQotKiBkZXNjcmlwdGlvbjogIGNhbGN1bGF0ZSB0aGUgZW5lcmd5IGJlZm9yZSBpaXItZmlsdGVyIGFuZCBhZnRlciBpcnItZmlsdGVyCi0qIHJldHVybnM6ICAgICAgVFJVRSBpZiBzdWNjZXNzCi0qCi0qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotI2lmbmRlZiBBUk1WNUUKLVdvcmQzMiBDYWxjV2luZG93RW5lcmd5KEJMT0NLX1NXSVRDSElOR19DT05UUk9MICpibG9ja1N3aXRjaGluZ0NvbnRyb2wsCi0gICAgICAgICAgICAgICAgICAgICAgICBXb3JkMTYgKnRpbWVTaWduYWwsCi0gICAgICAgICAgICAgICAgICAgICAgICBXb3JkMTYgY2hJbmNyZW1lbnQsCi0gICAgICAgICAgICAgICAgICAgICAgICBXb3JkMTYgd2luZG93TGVuKQotewotICBXb3JkMzIgdywgaSwgd09mZnNldCwgdGlkeCwgY2g7Ci0gIFdvcmQzMiBhY2N1VUUsIGFjY3VGRTsKLSAgV29yZDMyIHRlbXBVbmZpbHRlcmVkOwotICBXb3JkMzIgdGVtcEZpbHRlcmVkOwotICBXb3JkMzIgc3RhdGVzMCwgc3RhdGVzMTsKLSAgV29yZDMyIENvZWZmMCwgQ29lZmYxOwotCi0KLSAgc3RhdGVzMCA9IGJsb2NrU3dpdGNoaW5nQ29udHJvbC0+aWlyU3RhdGVzWzBdOwotICBzdGF0ZXMxID0gYmxvY2tTd2l0Y2hpbmdDb250cm9sLT5paXJTdGF0ZXNbMV07Ci0gIENvZWZmMCA9IGhpUGFzc0NvZWZmWzBdOwotICBDb2VmZjEgPSBoaVBhc3NDb2VmZlsxXTsKLSAgdGlkeCA9IDA7Ci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QVJUX1dJTkRPVywgU0hPUlRfV0lORE9XLCBTVE9QX1dJTkRPV30sCi0gIC8qIFNUQVJUX1dJTkRPVyAqL3tTVEFSVF9XSU5ET1csIFNUQVJUX1dJTkRPVywgU0hPUlRfV0lORE9XLCBTSE9SVF9XSU5ET1d9LAotICAvKiBTSE9SVF9XSU5ET1cgKi97U0hPUlRfV0lORE9XLCBTSE9SVF9XSU5ET1csIFNIT1JUX1dJTkRPVywgU0hPUlRfV0lORE9XfSwKLSAgLyogU1RPUF9XSU5ET1cgICove1NUT1BfV0lORE9XLCAgU0hPUlRfV0lORE9XLCBTSE9SVF9XSU5ET1csIFNUT1BfV0lORE9XfQotfTsKLQotCi0vKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKLSoKLSogZnVuY3Rpb24gbmFtZTogU3luY0Jsb2NrU3dpdGNoaW5nCi0qIGRlc2NyaXB0aW9uOiAgdXBkYXRlIGJsb2NrIHR5cGUgYW5kIGdyb3VwIHZhbHVlCi0qIHJldHVybnM6ICAgICAgVFJVRSBpZiBzdWNjZXNzCi0qCi0qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotV29yZDE2IFN5bmNCbG9ja1N3aXRjaGluZyhCTE9DS19TV0lUQ0hJTkdfQ09OVFJPTCAqYmxvY2tTd2l0Y2hpbmdDb250cm9sTGVmdCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgQkxPQ0tfU1dJVENISU5HX0NPTlRST0wgKmJsb2NrU3dpdGNoaW5nQ29udHJvbFJpZ2h0LAotICAgICAgICAgICAgICAgICAgICAgICAgICBjb25zdCBXb3JkMTYgbkNoYW5uZWxzKQotewotICBXb3JkMTYgaTsKLSAgV29yZDE2IHBhdGNoVHlwZSA9IExPTkdfV0lORE9XOwotCi0KLSAgaWYgKG5DaGFubmV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HVzZSB0aGlzIGZpbGUgZXhjZXB0IGluIGNvbXBsaWFuY2Ugd2l0aCB0aGUgTGljZW5zZS4KLSAqKiBZb3UgbWF5IG9idGFpbiBhIGNvcHkgb2YgdGhlIExpY2Vuc2UgYXQKLSAqKgotICoqICAgICBodHRwOi8vd3d3LmFwYWNoZS5vcmcvbGljZW5zZXMvTElDRU5TRS0yLjAKLSAqKgotICoqIFVubGVzcyByZXF1aXJlZCBieSBhcHBsaWNhYmxlIGxhdyBvciBhZ3JlZWQgdG8gaW4gd3JpdGluZywgc29mdHdhcmUKLSAqKiBkaXN0cmlidXRlZCB1bmRlciB0aGUgTGljZW5zZSBpcyBkaXN0cmlidXRlZCBvbiBhbiAiQVMgSVMiIEJBU0lTLAotICoqIFdJVEhPVVQgV0FSUkFOVElFUyBPUiBDT05ESVRJT05TIE9GIEFOWSBLSU5ELCBlaXRoZXIgZXhwcmVzcyBvciBpbXBsaWVkLgotICoqIFNlZSB0aGUgTGljZW5zZSBmb3IgdGhlIHNwZWNpZmljIGxhbmd1YWdlIGdvdmVybmluZyBwZXJtaXNzaW9ucyBhbmQKLSAqKiBsaW1pdGF0aW9ucyB1bmRlciB0aGUgTGljZW5zZS4KLSAqLwotLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKLQlGaWxlOgkJZHluX2JpdHMuYwotCi0JQ29udGVudDoJTm9pc2VsZXNzIGNvZGVyIG1vZHVsZSBmdW5jdGlvbnMKLQotKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLQotI2luY2x1ZGUgImFhY19yb20uaCIKLSNpbmNsdWRlICJkeW5fYml0cy5oIgotI2luY2x1ZGUgImJpdF9jbnQuaCIKLSNpbmNsdWRlICJwc3lfY29uc3QuaCIKLQotCi0vKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKLSoKLSogZnVuY3Rpb24gbmFtZTogYnVpbGRCaXRMb29rVXAKLSogZGVzY3JpcHRpb246ICBjb3VudCBiaXRzIHVzaW5nIGFsbCBwb3NzaWJsZSB0YWJsZXMKLSoKLSoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotc3RhdGljIHZvaWQKLWJ1aWxkQml0TG9va1VwKGNvbnN0IFdvcmQxNiAqcXVhbnRTcGVjdHJ1bSwKLSAgICAgICAgICAgICAgIGNvbnN0IFdvcmQxNiBtYXhTZmIsCi0gICAgICAgICAgICAgICBjb25zdCBXb3JkMTYgKnNmYk9mZnNldCwKLSAgICAgICAgICAgICAgIGNvbnN0IFVXb3JkMTYgKnNmYk1heCwKLSAgICAgICAgICAgICAgIFdvcmQxNiBiaXRMb29rVXBbTUFYX1NGQl9MT05HXVtDT0RFX0JPT0tfRVNDX05EWCArIDFdLAotICAgICAgICAgICAgICAgU0VDVElPTl9JTkZPICogc2VjdGlvbkluZm8pCi17Ci0gIFdvcmQzMiBpOwotCi0gIGZvciAoaT0wOyBpPG1heFNmYjsgaSsrKSB7Ci0gICAgV29yZDE2IHNmYldpZHRoLCBtYXhWYWw7Ci0KLSAgICBzZWN0aW9uSW5mb1tpXS5zZmJDbnQgPSAxOwotICAgIHNlY3Rpb25JbmZvW2ldLnNmYlN0YXJ0ID0gaTsKLSAgICBzZWN0aW9uSW5mb1tpXS5zZWN0aW9uQml0cyA9IElOVkFMSURfQklUQ09VTlQ7Ci0gICAgc2VjdGlvbkluZm9baV0uY29kZUJvb2sgPSAtMTsKLSAgICBzZmJXaWR0aCA9IHNmYk9mZnNldFtpICsgMV0gLSBzZmJPZmZzZXRbaV07Ci0gICAgbWF4VmFsID0gc2ZiTWF4W2ldOwotICAgIGJpdENvdW50KHF1YW50U3BlY3RydW0gKyBzZmJPZmZzZXRbaV0sIHNmYldpZHRoLCBtYXhWYWwsIGJpdExvb2tVcFtpXSk7Ci0gIH0KLX0KLQotCi0vKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKLSoKLSogZnVuY3Rpb24gbmFtZTogZmluZEJlc3RCb29rCi0qIGRlc2NyaXB0aW9uOiAgZXNzZW50aWFsIGhlbHBlciBmdW5jdGlvbnMKLSoKLSoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotc3RhdGljIFdvcmQxNgotZmluZEJlc3RCb29rKGNvbnN0IFdvcmQxNiAqYmMsIFdvcmQxNiAqYm9vaykKLXsKLSAgV29yZDMyIG1pbkJpdHMsIGo7Ci0gIG1pbkJpdHMgPSBJTlZBTElEX0JJVENPVU5UOwotCi0gIGZvciAoaj0wOyBqPD1DT0RFX0JPT0tfRVNDX05EWDsgaisrKSB7Ci0KLSAgICBpZiAoYmNbal0gPCBtaW5CaXRzKSB7Ci0gICAgICBtaW5CaXRzID0gYmNbal07Ci0gICAgICAqYm9vayA9IGo7Ci0gICAgfQotICB9Ci0gIHJldHVybiBleHRyYWN0X2wobWluQml0cyk7Ci19Ci0KLXN0YXRpYyBXb3JkMTYKLWZpbmRNaW5NZXJnZUJpdHMoY29uc3QgV29yZDE2ICpiYzEsIGNvbnN0IFdvcmQxNiAqYmMyKQotewotICBXb3JkMzIgbWluQml0cywgaiwgc3VtOwotICBtaW5CaXRzID0gSU5WQUxJRF9CSVRDT1VOVDsKLQotICBmb3IgKGo9MDsgajw9Q09ERV9CT09LX0VTQ19ORFg7IGorKykgewotICAgIHN1bSA9IGJjMVtqXSArIGJjMltqXTsKLSAgICBpZiAoc3VtIDwgbWluQml0cykgewotICAgICAgbWluQml0cyA9IHN1bTsKLSAgICB9Ci0gIH0KLSAgcmV0dXJ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0gIFdvcmQxNiBpOwotCi0gIGZvciAoaT0wOyBpK3NlY3Rpb25JbmZvW2ldLnNmYkNudDxtYXhTZmI7IGkrPXNlY3Rpb25JbmZvW2ldLnNmYkNudCkgewotICAgIG1lcmdlR2Fpbkxvb2tVcFtpXSA9IENhbGNNZXJnZUdhaW4oc2VjdGlvbkluZm8sCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBiaXRMb29rVXAsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzaWRlSW5mb1RhYiwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGksCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoaSArIHNlY3Rpb25JbmZvW2ldLnNmYkNudCkpOwotICB9Ci0KLSAgd2hpbGUgKFRSVUUpIHsKLSAgICBXb3JkMTYgbWF4TWVyZ2VHYWluLCBtYXhOZHgsIG1heE5keE5leHQsIG1heE5keExhc3Q7Ci0KLSAgICBtYXhNZXJnZUdhaW4gPSBmaW5kTWF4TWVyZ2UobWVyZ2VHYWluTG9va1VwLCBzZWN0aW9uSW5mbywgbWF4U2ZiLCAmbWF4TmR4KTsKLQotCi0gICAgaWYgKG1heE1lcmdlR2FpbiA8PSAwKQotICAgICAgYnJlYWs7Ci0KLQotICAgIG1heE5keE5leHQgPSBtYXhOZHggKyBzZWN0aW9uSW5mb1ttYXhOZHhdLnNmYkNudDsKLQotICAgIHNlY3Rpb25JbmZvW21heE5keF0uc2ZiQ250ID0gc2VjdGlvbkluZm9bbWF4TmR4XS5zZmJDbnQgKyBzZWN0aW9uSW5mb1ttYXhOZHhOZXh0XS5zZmJDbnQ7Ci0gICAgc2VjdGlvbkluZm9bbWF4TmR4XS5zZWN0aW9uQml0cyA9IHNlY3Rpb25JbmZvW21heE5keF0uc2VjdGlvbkJpdHMgKwotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKHNlY3Rpb25JbmZvW21heE5keE5leHRdLnNlY3Rpb25CaXRzIC0gbWF4TWVyZ2VHYWluKTsKLQotCi0gICAgbWVyZ2VCaXRMb29rVXAoYml0TG9va1VwW21heE5keF0sIGJpdExvb2tVcFttYXhOZHhOZXh0XSk7Ci0KLQotICAgIGlmIChtYXhOZHggIT0gMCkgewotICAgICAgbWF4TmR4TGFzdCA9IHNlY3Rpb25JbmZvW21heE5keCAtIDFdLnNmYlN0YXJ0OwotICAgICAgbWVyZ2VHYWluTG9va1VwW21heE5keExhc3RdID0gQ2FsY01lcmdlR2FpbihzZWN0aW9uSW5mbywKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYml0TG9va1VwLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzaWRlSW5mb1RhYiwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbWF4TmR4TGFzdCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbWF4TmR4KTsKLSAgICB9Ci0gICAgbWF4TmR4TmV4dCA9IG1heE5keCArIHNlY3Rpb25JbmZvW21heE5keF0uc2ZiQ250OwotCi0gICAgc2VjdGlvbkluZm9bbWF4TmR4TmV4dCAtIDFdLnNmYlN0YXJ0ID0gc2VjdGlvbkluZm9bbWF4TmR4XS5zZmJTdGFydDsKLQotCi0gICAgaWYgKG1heE5keE5leHQgLSBtYXhTZmIgPCAwKSB7Ci0gICAgICBtZXJnZUdhaW5Mb29rVXBbbWF4TmR4XSA9IENhbGNNZXJnZUdhaW4oc2VjdGlvbkluZm8sCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYml0TG9va1VwLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNpZGVJbmZvVGFiLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1heE5keCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBtYXhOZHhOZXh0KTsKLSAgICB9Ci0gIH0KLX0KLQotLyoKLSAgY291bnQgYml0cyB1c2VkIGJ5IHRoZSBub2lzZWxlc3MgY29kZXIKLSovCi1zdGF0aWMgdm9pZAotbm9pc2VsZXNzQ291bnRlcihTRUNUSU9OX0RBVEEgKnNlY3Rpb25EYXRhLAotICAgICAgICAgICAgICAgICBXb3JkMTYgbWVyZ2VHYWluTG9va1VwW01BWF9TRkJfTE9OR10sCi0gICAgICAgICAgICAgICAgIFdvcmQxNiBiaXRMb29rVXBbTUFYX1NGQl9MT05HXVtDT0RFX0JPT0tfRVNDX05EWCArIDFdLAotICAgICAgICAgICAgICAgICBjb25zdCBXb3JkMTYgKnF1YW50U3BlY3RydW0sCi0gICAgICAgICAgICAgICAgIGNvbnN0IFVXb3JkMTYgKm1heFZhbHVlSW5TZmIsCi0gICAgICAgICAgICAgICAgIGNvbnN0IFdvcmQxNiAqc2ZiT2Zmc2V0LAotICAgICAgICAgICAgICAgICBjb25zdCBXb3JkMzIgYmxvY2tUeXBlKQotewotICBXb3JkMzIgZ3JwTmR4LCBpOwotICBjb25zdCBXb3JkMTYgKnNpZGVJbmZvVGFiID0gTlVMTDsKLSAgU0VDVElPTl9JTkZPICpzZWN0aW9uSW5mbzsKLQotICAvKgotICAgIHVzZSBhcHByb3ByaWF0ZSBzaWRlIGluZm8gdGFibGUKLSAgKi8KLSAgc3dpdGNoIChibG9ja1R5cGUpCi0gIHsKLSAgICBjYXNlIExPTkdfV0lORE9XOgotICAgIGNhc2UgU1RBUlRfV0lORE9XOgotICAgIGNhc2UgU1RPUF9XSU5ET1c6Ci0gICAgICBzaWRlSW5mb1RhYiA9IHNpZGVJbmZvVGFiTG9uZzsKLSAgICAgIGJyZWFrOwotICAgIGNhc2UgU0hPUlRfV0lORE9XOgotICAgICAgc2lkZUluZ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0aW9uSW5mb1tpXTsKLSAgICAgIHNlY3Rpb25EYXRhLT5ub09mU2VjdGlvbnMgPSBzZWN0aW9uRGF0YS0+bm9PZlNlY3Rpb25zICsgMTsKLSAgICB9Ci0gIH0KLX0KLQotCi0vKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgotKgotKiBmdW5jdGlvbm5hbWU6IHNjZkNvdW50Ci0qIHJldHVybnMgICAgIDogLS0tCi0qIGRlc2NyaXB0aW9uIDogY291bnQgYml0cyB1c2VkIGJ5IHNjYWxlZmFjdG9ycy4KLSoKLSoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotc3RhdGljIHZvaWQgc2NmQ291bnQoY29uc3QgV29yZDE2ICpzY2FsZWZhY0dhaW4sCi0gICAgICAgICAgICAgICAgICAgICBjb25zdCBVV29yZDE2ICptYXhWYWx1ZUluU2ZiLAotICAgICAgICAgICAgICAgICAgICAgU0VDVElPTl9EQVRBICogc2VjdGlvbkRhdGEpCi0KLXsKLSAgU0VDVElPTl9JTkZPICpwc2VjdGlvbkluZm87Ci0gIFNFQ1RJT05fSU5GTyAqcHNlY3Rpb25JbmZvbTsKLQotICAvKiBjb3VudGVyICovCi0gIFdvcmQzMiBpID0gMDsgLyogc2VjdGlvbiBjb3VudGVyICovCi0gIFdvcmQzMiBqID0gMDsgLyogc2ZiIGNvdW50ZXIgKi8KLSAgV29yZDMyIGsgPSAwOyAvKiBjdXJyZW50IHNlY3Rpb24gYXV4aWxpYXJ5IGNvdW50ZXIgKi8KLSAgV29yZDMyIG0gPSAwOyAvKiBvdGhlciBzZWN0aW9uIGF1eGlsaWFyeSBjb3VudGVyICovCi0gIFdvcmQzMiBuID0gMDsgLyogb3RoZXIgc2ZiIGF1eGlsaWFyeSBjb3VudGVyICovCi0KLSAgLyogZnVydGh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8pIHsKLSAgICAgIGZvciAoaiA9IHBzZWN0aW9uSW5mby0+c2ZiU3RhcnQ7Ci0gICAgICAgICAgIGogPCAocHNlY3Rpb25JbmZvLT5zZmJTdGFydCArIHBzZWN0aW9uSW5mby0+c2ZiQ250KTsgaisrKSB7Ci0gICAgICAgIC8qIGNoZWNrIGlmIHdlIGNhbiByZXBlYXQgdGhlIGxhc3QgdmFsdWUgdG8gc2F2ZSBiaXRzICovCi0KLSAgICAgICAgaWYgKG1heFZhbHVlSW5TZmJbal0gPT0gMCkgewotICAgICAgICAgIGZvdW5kID0gMDsKLQotICAgICAgICAgIGlmIChzY2ZTa2lwQ291bnRlciA9PSAwKSB7Ci0gICAgICAgICAgICAvKiBlbmQgb2Ygc2VjdGlvbiAqLwotCi0gICAgICAgICAgICBpZiAoaiAtICgocHNlY3Rpb25JbmZvLT5zZmJTdGFydCArIHBzZWN0aW9uSW5mby0+c2ZiQ250KSAtIDEpID09IDApIHsKLSAgICAgICAgICAgICAgZm91bmQgPSAwOwotICAgICAgICAgICAgfQotICAgICAgICAgICAgZWxzZSB7Ci0gICAgICAgICAgICAgIGZvciAoayA9IGogKyAxOyBrIDwgcHNlY3Rpb25JbmZvLT5zZmJTdGFydCArIHBzZWN0aW9uSW5mby0+c2ZiQ250OyBrKyspIHsKLQotICAgICAgICAgICAgICAgIGlmIChtYXhWYWx1ZUluU2ZiW2tdICE9IDApIHsKLSAgICAgICAgICAgICAgICAgIGludCB0bXAgPSBMX2FicyhzY2FsZWZhY0dhaW5ba10gLSBsYXN0VmFsU2NmKTsKLQkJCQkgIGZvdW5kID0gMTsKLQotICAgICAgICAgICAgICAgICAgaWYgKCB0bXAgPCBDT0RFX0JPT0tfU0NGX0xBVikgewotICAgICAgICAgICAgICAgICAgICAvKiBzYXZlIGJpdHMgKi8KLSAgICAgICAgICAgICAgICAgICAgZGVsdGFTY2YgPSAwOwotICAgICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgICAgZWxzZSB7Ci0gICAgICAgICAgICAgICAgICAgIC8qIGRvIG5vdCBzYXZlIGJpdHMgKi8KLSAgICAgICAgICAgICAgICAgICAgZGVsdGFTY2YgPSBsYXN0VmFsU2NmIC0gc2NhbGVmYWNHYWluW2pdOwotICAgICAgICAgICAgICAgICAgICBsYXN0VmFsU2NmID0gc2NhbGVmYWNHYWluW2pdOwotICAgICAgICAgICAgICAgICAgICBzY2ZTa2lwQ291bnRlciA9IDA7Ci0gICAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgICBicmVhazsKLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgLyogY291bnQgc2NhbGVmYWN0b3Igc2tpcCAqLwotICAgICAgICAgICAgICAgIHNjZlNraXBDb3VudGVyID0gc2NmU2tpcENvdW50ZXIgKyAxOwotICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICB9Ci0KLQkJCXBzZWN0aW9uSW5mb20gPSBwc2VjdGlvbkluZm8gKyAxOwotICAgICAgICAgICAgLyogc2VhcmNoIGZvciB0aGUgbmV4dCBtYXhWYWx1ZUluU2ZiW10gIT0gMCBpbiBhbGwgb3RoZXIgc2VjdGlvbnMgKi8KLSAgICAgICAgICAgIGZvciAobSA9IGkgKyAxOyAobSA8IHNlY3Rpb25EYXRhLT5ub09mU2VjdGlvbnMpICYmIChmb3VuZCA9PSAwKTsgbSsrKSB7Ci0KLSAgICAgICAgICAgICAgaWYgKChwc2VjdGlvbkluZm9tLT5jb2RlQm9vayAhPSBDT0RFX0JPT0tfWkVST19OTykgJiYKLSAgICAgICAgICAgICAgICAgIChwc2VjdGlvbkluZm9tLT5jb2RlQm9vayAhPSBDT0RFX0JPT0tfUE5TX05PKSkgewotICAgICAgICAgICAgICAgIGZvciAobiA9IHBzZWN0aW9uSW5mb20tPnNmYlN0YXJ0OwotICAgICAgICAgICAgICAgICAgICAgbiA8IChwc2VjdGlvbkluZm9tLT5zZmJTdGFydCArIHBzZWN0aW9uSW5mb20tPnNmYkNudCk7IG4rKykgewotCi0gICAgICAgICAgICAgICAgICBpZiAobWF4VmFsdWVJblNmYltuXSAhPSAwKSB7Ci0gICAgICAgICAgICAgICAgICAgIGZvdW5kID0gMTsKLQotICAgICAgICAgICAgICAgICAgICBpZiAoIChhYnNfcyhzY2FsZWZhY0dhaW5bbl0gLSBsYXN0VmFsU2NmKSA8IENPREVfQk9PS19TQ0ZfTEFWKSkgewotICAgICAgICAgICAgICAgICAgICAgIGRlbHRhU2NmID0gMDsKLSAgICAgICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgICAgICBlbHNlIHsKLSAgICAgICAgICAgICAgICAgICAgICBkZWx0YVNjZiA9IChsYXN0VmFsU2NmIC0gc2NhbGVmYWNHYWluW2pdKTsKLSAgICAgICAgICAgICAgICAgICAgICBsYXN0VmFsU2NmID0gc2NhbGVmYWNHYWluW2pdOwotICAgICAgICAgICAgICAgICAgICAgIHNjZlNraXBDb3VudGVyID0gMDsKLSAgICAgICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgICAgICBicmVhazsKLSAgICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICAgIC8qIGNvdW50IHNjYWxlZmFjdG9yIHNraXAgKi8KLSAgICAgICAgICAgICAgICAgIHNjZlNraXBDb3VudGVyID0gc2NmU2tpcENvdW50ZXIgKyAxOwotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgfQotCi0JCQkgIHBzZWN0aW9uSW5mb20gKz0gMTsKLSAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgaWYgKGZvdW5kID09IDApIHsKLSAgICAgICAgICAgICAgZGVsdGFTY2YgPSAwOwotICAgICAgICAgICAgICBzY2ZTa2lwQ291bnRlciA9IDA7Ci0gICAgICAgICAgICB9Ci0gICAgICAgICAgfQotICAgICAgICAgIGVsc2UgewotICAgICAgICAgICAgZGVsdGFTY2YgPSAwOwotICAgICAgICAgICAgc2NmU2tpcENvdW50ZXIgPSBzY2ZTa2lwQ291bnRlciA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1bmN0aW9uCi0KLSoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0KLSNpbmNsdWRlICJiYXNpY19vcC5oIgotI2luY2x1ZGUgInBzeV9jb25zdC5oIgotI2luY2x1ZGUgImludGVyZmFjZS5oIgotI2luY2x1ZGUgImdycF9kYXRhLmgiCi0KLS8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgotKgotKiBmdW5jdGlvbiBuYW1lOiBncm91cFNob3J0RGF0YQotKiBkZXNjcmlwdGlvbjogIGdyb3VwIHNob3J0IGRhdGEgZm9yIG5leHQgcXVhbnRpemF0aW9uIGFuZCBjb2RpbmcKLSoKLSoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi12b2lkCi1ncm91cFNob3J0RGF0YShXb3JkMzIgICAgICAgICptZGN0U3BlY3RydW0sCi0gICAgICAgICAgICAgICBXb3JkMzIgICAgICAgICp0bXBTcGVjdHJ1bSwKLSAgICAgICAgICAgICAgIFNGQl9USFJFU0hPTEQgKnNmYlRocmVzaG9sZCwKLSAgICAgICAgICAgICAgIFNGQl9FTkVSR1kgICAgKnNmYkVuZXJneSwKLSAgICAgICAgICAgICAgIFNGQl9FTkVSR1kgICAgKnNmYkVuZXJneU1TLAotICAgICAgICAgICAgICAgU0ZCX0VORVJHWSAgICAqc2ZiU3ByZWFkZWRFbmVyZ3ksCi0gICAgICAgICAgICAgICBjb25zdCBXb3JkMTYgICBzZmJDbnQsCi0gICAgICAgICAgICAgICBjb25zdCBXb3JkMTYgICpzZmJPZmZzZXQsCi0gICAgICAgICAgICAgICBjb25zdCBXb3JkMTYgICpzZmJNaW5TbnIsCi0gICAgICAgICAgICAgICBXb3JkMTYgICAgICAgICpncm91c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KioqKioqKioqKioqKioqKioqKioqKioqKioqLwotCi0jaW5jbHVkZSAiYmFzaWNfb3AuaCIKLSNpbmNsdWRlICJvcGVyXzMyYi5oIgotI2luY2x1ZGUgInBzeV9jb25zdC5oIgotI2luY2x1ZGUgImludGVyZmFjZS5oIgotCi0vKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKLSoKLSogZnVuY3Rpb24gbmFtZTogQnVpbGRJbnRlcmZhY2UKLSogZGVzY3JpcHRpb246ICB1cGRhdGUgb3V0cHV0IHBhcmFtZXRlcgotKgotKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLXZvaWQgQnVpbGRJbnRlcmZhY2UoV29yZDMyICAgICAgICAgICAgICAgICAgKmdyb3VwZWRNZGN0U3BlY3RydW0sCi0gICAgICAgICAgICAgICAgICAgIGNvbnN0IFdvcmQxNiAgICAgICAgICAgICBtZGN0U2NhbGUsCi0gICAgICAgICAgICAgICAgICAgIFNGQl9USFJFU0hPTEQgICAgICAgICAgICpncm91cGVkU2ZiVGhyZXNob2xkLAotICAgICAgICAgICAgICAgICAgICBTRkJfRU5FUkdZICAgICAgICAgICAgICAqZ3JvdXBlZFNmYkVuZXJneSwKLSAgICAgICAgICAgICAgICAgICAgU0ZCX0VORVJHWSAgICAgICAgICAgICAgKmdyb3VwZWRTZmJTcHJlYWRlZEVuZXJneSwKLSAgICAgICAgICAgICAgICAgICAgY29uc3QgU0ZCX0VORVJHWV9TVU0gICAgIHNmYkVuZXJneVN1bUxSLAotICAgICAgICAgICAgICAgICAgICBjb25zdCBTRkJfRU5FUkdZX1NVTSAgICAgc2ZiRW5lcmd5U3VtTVMsCi0gICAgICAgICAgICAgICAgICAgIGNvbnN0IFdvcmQxNiAgICAgICAgICAgICB3aW5kb3dTZXF1ZW5jZSwKLSAgICAgICAgICAgICAgICAgICAgY29uc3QgV29yZDE2ICAgICAgICAgICAgIHdpbmRvd1NoYXBlLAotICAgICAgICAgICAgICAgICAgICBjb25zdCBXb3JkMTYgICAgICAgICAgICAgZ3JvdXBlZFNmYkNudCwKLSAgICAgICAgICAgICAgICAgICAgY29uc3QgV29yZDE2ICAgICAgICAgICAgKmdyb3VwZWRTZmJPZmZzZXQsCi0gICAgICAgICAgICAgICAgICAgIGNvbnN0IFdvcmQxNiAgICAgICAgICAgICBtYXhTZmJQZXJHcm91cCwKLSAgICAgICAgICAgICAgICAgICAgY29uc3QgV29yZDE2ICAgICAgICAgICAgKmdyb3VwZWRTZmJNaW5TbnIsCi0gICAgICAgICAgICAgICAgICAgIGNvbnN0IFdvcmQxNiAgICAgICAgICAgICBub09mR3JvdXBzLAotICAgICAgICAgICAgICAgICAgICBjb25zdCBXb3JkMTYgICAgICAgICAgICAqZ3JvdXBMZW4sCi0gICAgICAgICAgICAgICAgICAgIFBTWV9PVVRfQ0hBTk5FTCAgICAgICAgICpwc3lPdXRDaCkKLXsKLSAgV29yZDMyIGo7Ci0gIFdvcmQzMiBncnA7Ci0gIFdvcmQzMiBtYXNrOwotICBXb3JkMTYgKnRtcFY7Ci0KLSAgLyoKLSAgY29weSB2YWx1ZXMgdG8gcHN5T3V0Ci0gICovCi0gIHBzeU91dENoLT5tYXhTZmJQZXJHcm91cCAgICA9IG1heFNmYlBlckdyb3VwOwotICBwc3lPdXRDaC0+c2ZiQ250ICAgICAgICAgICAgPSBncm91cGVkU2ZiQ250OwotICBpZihub09mR3JvdXBzKQotCXBzeU91dENoLT5zZmJQZXJHcm91cCAgICAgPSBncm91cGVkU2ZiQ250LyBub09mR3JvdXBzOwotICBlbHNlCi0JcHN5T3V0Q2gtPnNmYlBlckdyb3VwICAgICA9IDB4N2ZmZjsKLSAgcHN5T3V0Q2gtPndpbmRvd1NlcXVlbmNlICAgID0gd2luZG93U2VxdWVuY2U7Ci0gIHBzeU91dENoLT53aW5kb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qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotCi0jaW5jbHVkZSAiYmFzaWNfb3AuaCIKLSNpbmNsdWRlICJvcGVyXzMyYi5oIgotI2luY2x1ZGUgInR5cGVkZWYuaCIKLSNpbmNsdWRlICJsaW5lX3BlLmgiCi0KLQotc3RhdGljIGNvbnN0IFdvcmQxNiAgQzFfSSA9IDEyOyAgICAvKiBsb2coOC4wKS9sb2coMikgKjQgICAgICAgICAqLwotc3RhdGljIGNvbnN0IFdvcmQzMiAgQzJfSSA9IDEwODMwOyAvKiBsb2coMi41KS9sb2coMikgKiAxMDI0ICogNCAqIDIgKi8KLXN0YXRpYyBjb25zdCBXb3JkMTYgIEMzX0kgPSA1NzM7ICAgLyogKDEtQzIvQzEpICoxMDI0ICAgICAgICAgICAgKi8KLQotCi0vKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKLSoKLSogZnVuY3Rpb24gbmFtZTogcHJlcGFyZVNmYlBlCi0qIGRlc2NyaXB0aW9uOiAgY29uc3RhbnRzIHRoYXQgZG8gbm90IGNoYW5nZSBkdXJpbmcgc3VjY2Vzc2l2ZSBwZSBjYWxjdWxhdGlvbnMKLSoKLSoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi12b2lkIHByZXBhcmVTZmJQZShQRV9EQVRBICpwZURhdGEsCi0gICAgICAgICAgICAgICAgICBQU1lfT1VUX0NIQU5ORUwgIHBzeU91dENoYW5uZWxbTUFYX0NIQU5ORUxTXSwKLSAgICAgICAgICAgICAgICAgIFdvcmQxNiBsb2dTZmJFbmVyZ3lbTUFYX0NIQU5ORUxTXVtNQVhfR1JPVVBFRF9TRkJdLAotICAgICAgICAgICAgICAgICAgV29yZDE2IHNmYk5SZWxldmFudExpbmVzW01BWF9DSEFOTkVMU11bT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GljZW5zZS4KLSAqKiBZb3UgbWF5IG9idGFpbiBhIGNvcHkgb2YgdGhlIExpY2Vuc2UgYXQKLSAqKgotICoqICAgICBodHRwOi8vd3d3LmFwYWNoZS5vcmcvbGljZW5zZXMvTElDRU5TRS0yLjAKLSAqKgotICoqIFVubGVzcyByZXF1aXJlZCBieSBhcHBsaWNhYmxlIGxhdyBvciBhZ3JlZWQgdG8gaW4gd3JpdGluZywgc29mdHdhcmUKLSAqKiBkaXN0cmlidXRlZCB1bmRlciB0aGUgTGljZW5zZSBpcyBkaXN0cmlidXRlZCBvbiBhbiAiQVMgSVMiIEJBU0lTLAotICoqIFdJVEhPVVQgV0FSUkFOVElFUyBPUiBDT05ESVRJT05TIE9GIEFOWSBLSU5ELCBlaXRoZXIgZXhwcmVzcyBvciBpbXBsaWVkLgotICoqIFNlZSB0aGUgTGljZW5zZSBmb3IgdGhlIHNwZWNpZmljIGxhbmd1YWdlIGdvdmVybmluZyBwZXJtaXNzaW9ucyBhbmQKLSAqKiBsaW1pdGF0aW9ucyB1bmRlciB0aGUgTGljZW5zZS4KLSAqLwotCi0vKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgotCUZpbGU6CQltZW1fYWxpZ24uYwotCi0JQ29udGVudDoJTWVtb3J5IGFsbG9jIGFsaWdubWVudHMgZnVuY3Rpb25zCi0KLSoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0KLQotI2luY2x1ZGUJIm1lbWFsaWduLmgiCi0jaWZkZWYgX01TQ19WRVIKLSNpbmNsdWRlCTxzdGRkZWYuaD4KLSNlbHNlCi0jaW5jbHVkZQk8c3RkaW50Lmg+Ci0jZW5kaWYKLQotLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq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VtSW5mbyk7Ci0JCWlmKHJldCAhPSAwKQotCQkJcmV0dXJuIDA7Ci0KLQkJdG1wID0gKHVuc2lnbmVkIGNoYXIgKilNZW1JbmZvLlZCdWZmZXI7Ci0KLQkJcE1lbW9wLT5TZXQoQ29kZWNJRCwgdG1wLCAwLCBzaXplICsgYWxpZ25tZW50KTsKLQotCQltZW1fcHRyID0KLQkJCSh1bnNpZ25lZCBjaGFyICopICgoaW50cHRyX3QpICh0bXAgKyBhbGlnbm1lbnQgLSAxKSAmCi0JCQkJCSh+KChpbnRwdHJfdCkgKGFsaWdubWVudCAtIDEpKSkpOwotCi0JCWlmIChtZW1fcHRyID09IHRtcCkKLQkJCW1lbV9wdHIgKz0gYWxpZ25tZW50OwotCi0JCSoobWVtX3B0ciAtIDEpID0gKHVuc2lnbmVkIGNoYXIpIChtZW1fcHRyIC0gdG1wKTsKLQotCQlyZXR1cm4gKCh2b2lkICopbWVtX3B0cik7Ci0JfQotCi0JcmV0dXJuKDApOwotfQotCi0KLS8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgotKgotKiBmdW5jdGlvbiBuYW1lOiBtZW1fZnJlZQotKiBkZXNjcmlwdGlvbjogIGZyZWUgdGhlIG1lbW9yeQotKgotKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLXZvaWQKLW1lbV9mcmVlKFZPX01FTV9PUEVSQVRPUiAqcE1lbW9wLCB2b2lkICptZW1fcHRyLCB1bnNpZ25lZCBpbnQgQ29kZWNJRCkKLXsKLQotCXVuc2lnbmVkIGNoYXIgKnB0cjsKLQotCWlmIChtZW1fcHRyID09IDApCi0JCXJldHVybjsKLQotCXB0ciA9IG1lbV9wdHI7Ci0KLQlwdHIgLT0gKihwdHIgLSAxKTsKLQotCXBNZW1vcC0+RnJlZShDb2RlY0lEL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WUgdGhlIExpY2Vuc2UgZm9yIHRoZSBzcGVjaWZpYyBsYW5ndWFnZSBnb3Zlcm5pbmcgcGVybWlzc2lvbnMgYW5kCi0gKiogbGltaXRhdGlvbnMgdW5kZXIgdGhlIExpY2Vuc2UuCi0gKi8KLS8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCi0JRmlsZToJCW1zX3N0ZXJlby5jCi0KLQlDb250ZW50OglNUyBzdGVyZW8gcHJvY2Vzc2luZyBmdW5jdGlvbgotCi0qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotCi0jaW5jbHVkZSAiYmFzaWNfb3AuaCIKLSNpbmNsdWRlICJvcGVyXzMyYi5oIgotI2luY2x1ZGUgInBzeV9jb25zdC5oIgotI2luY2x1ZGUgIm1zX3N0ZXJlby5oIgotCi0KLS8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgotKgotKiBmdW5jdGlvbiBuYW1lOiBNc1N0ZXJlb1Byb2Nlc3NpbmcKLSogZGVzY3JpcHRpb246ICBkZXRlY3QgdXNlIG1zIHN0ZXJlbyBvciBub3QKLSoJCQkJaWYgKChtaW4odGhyTG4sIHRoclJuKSptaW4odGhyTG4sIHRoclJuKSkvKGVuTW4qZW5TbikpCi0qCQkJCT49ICgodGhyTG4gKnRoclJuKS8oZW5MbiplblJuKSkgdGhlbiBtcyBzdGVyZW8KLSoKLSoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi12b2lkIE1zU3RlcmVvUHJvY2Vzc2luZyhXb3JkMzIgICAgICAgKnNmYkVuZXJneUxlZnQsCi0gICAgICAgICAgICAgICAgICAgICAgICBXb3JkMzIgICAgICAgKnNmYkVuZXJneVJpZ2h0LAotICAgICAgICAgICAgICAgICAgICAgICAgY29uc3QgV29yZDMyICpzZmJFbmVyZ3lNaWQsCi0gICAgICAgICAgICAgICAgICAgICAgICBjb25zdCBXb3JkMzIgKnNmYkVuZXJneVNpZGUsCi0gICAgICAgICAgICAgICAgICAgICAgICBXb3JkMzIgICAgICAgKm1kY3RTcGVjdHJ1bUxlZnQsCi0gICAgICAgICAgICAgICAgICAgICAgICBXb3JkMzIgICAgICAgKm1kY3RTcGVjdHJ1bVJpZ2h0LAotICAgICAgICAgICAgICAgICAgICAgICAgV29yZDMyICAgICAgICpzZmJUaHJlc2hvbGRMZWZ0LAotICAgICAgICAgICAgICAgICAgICAgICAgV29yZDMyICAgICAgICpzZmJUaHJlc2hvbGRSaWdodCwKLSAgICAgICAgICAgICAgICAgICAgICAgIFdvcmQzMiAgICAgICAqc2ZiU3ByZWFkZWRFbkxlZnQsCi0gICAgICAgICAgICAgICAgICAgICAgICBXb3JkMzIgICAgICAgKnNmYlNwcmVhZGVkRW5SaWdodCwKLSAgICAgICAgICAgICAgICAgICAgICAgIFdvcmQxNiAgICAgICAqbXNEaWdlc3QsCi0gICAgICAgICAgICAgICAgICAgICAgICBXb3JkMTYgICAgICAgKm1zTWFzaywKLSAgICAgICAgICAgICAgICAgICAgICAgIGNvbnN0IFdvcmQxNiAgc2ZiQ250LAotICAgICAgICAgICAgICAgICAgICAgICAgY29uc3QgV29yZDE2ICBzZmJQZXJHcm91cCwKLSAgICAgICAgICAgICAgICAgICAgICAgIGNvbnN0IFdvcmQxNiAgbWF4U2ZiUGVyR3JvdXAsCi0gICAgICAgICAgICAgICAgICAgICAgICBjb25zdCBXb3JkMTYgKnNmYk9mZnNldCkgewotICBXb3JkMzIgdGVtcDsKLSAgV29yZDMyIHNmYixzZmJvZmZzLCBqOwotICBXb3JkMzIgbXNNYXNrVHJ1ZVNvbWV3aGVyZSA9IDA7Ci0gIFdv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KioqKioqKioqKioqKioqCi0JRmlsZToJCXByZV9lY2hvX2NvbnRyb2wuYwotCi0JQ29udGVudDoJUHJlIGVjaG8gY29udHJvbCBmdW5jdGlvbnMKLQotKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLQotI2luY2x1ZGUgImJhc2ljX29wLmgiCi0jaW5jbHVkZSAib3Blcl8zMmIuaCIKLQotI2luY2x1ZGUgIm9wZXJfMzJiLmgiCi0jaW5jbHVkZSAicHJlX2VjaG9fY29udHJvbC5oIgotCi0KLS8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgotKgotKiBmdW5jdGlvbiBuYW1lOkluaXRQcmVFY2hvQ29udHJvbAotKiBkZXNjcmlwdGlvbjogaW5pdCBwcmUgZWNobyBjb250cm9sIHBhcmFtZXRlcgotKgotKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi12b2lkIEluaXRQcmVFY2hvQ29udHJvbChXb3JkMzIgKnBiVGhyZXNob2xkTm0xLAotICAgICAgICAgICAgICAgICAgICAgICAgV29yZDE2ICBudW1QYiwKLSAgICAgICAgICAgICAgICAgICAgICAgIFdvcmQzMiAqcGJUaHJlc2hvbGRRdWlldCkKLXsKLSAgV29yZDE2IHBiOwotCi0gIGZvcihwYj0wOyBwYjxudW1QYjsgcGIrKykgewotICAgIHBiVGhyZXNob2xkTm0xW3BiXSA9IHBiVGhyZXNob2xkUXVpZXRbcGJdOwotICB9Ci19Ci0KLS8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgotKgotKiBmdW5jdGlvbiBuYW1lOlByZUVjaG9Db250cm9sCi0qIGRlc2NyaXB0aW9uOiB1cGRhdGUgc2hyZXNob2xkIHRvIGF2b2lkIHByZSBlY2hvCi0qCQkJICAgdGhyKG4pID0gbWF4KHJwbWluKnRocnEobiksIG1pbih0aHJxKG4pLCBycGVsZXYqdGhycTEobikpKQotKgotKgotKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi12b2lkIFByZUVjaG9Db250cm9sKFdvcmQzMiAqcGJUaHJlc2hvbGRObTEsCi0gICAgICAgICAgICAgICAgICAgIFdvcmQxNiAgbnVtUGIsCi0gICAgICAgICAgICAgICAgICAgIFdvcmQzMiAgbWF4QWxsb3dlZEluY3JlYXNlRmFjdG9yLAotICAgICAgICAgICAgICAgICAgICBXb3JkMTYgIG1pblJlbWFpbmluZ1RocmVzaG9sZEZhY3RvciwKLSAgICAgICAgICAgICAgICAgICAgV29yZDMyICpwYlRocmVzaG9sZCwKLSAgICAgICAgICAgICAgICAgICAgV29yZDE2ICBtZGN0U2NhbGUsCi0gICAgICAgICAgICAgICAgICAgIFdvcmQxNiAgbWRjdFNjYWxlbm0xKQotewotICBXb3JkMzIgaTsKLSAgV29yZDMyIHRtcFRocmVzaG9sZDEsIHRtcFRocmVzaG9sZDI7Ci0gIFdvcmQzMiBzY2FsaW5nOwotCi0gIC8qIG1heEFsbG93ZWRJbmNyZWFzZUZhY3RvciBpcyBoYXJkIGNvZGVkIHRvIDIgKi8KLSAgKHZvaWQpbWF4QWxsb3dlZEluY3JlYXNlRmFjdG9yOwotCi0gIHNjYWxpbmcgPSAoKG1kY3RTY2FsZSAtIG1kY3RTY2FsZW5tMSkgPDwgMSk7Ci0KLSAgaWYgKCBzY2FsaW5nID4gMCApIHsKLSAgICBmb3IoaSA9IDA7IGkgPCBudW1QYjsgaSsrKSB7Ci0gICAgICB0bXBUaHJlc2hvbGQxID0gcGJUaHJlc2hvbGRObTFbaV0gPj4gKHNjYWxpbmctMSk7Ci0gICAgICB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wNCA8PSBzYW1wbGVSYXRlKSByZXR1cm4gNjsKLSAgICBpZiAoMTg3ODMgPD0gc2FtcGxlUmF0ZSkgcmV0dXJuIDc7Ci0gICAgaWYgKDEzODU2IDw9IHNhbXBsZVJhdGUpIHJldHVybiA4OwotICAgIGlmICgxMTUwMiA8PSBzYW1wbGVSYXRlKSByZXR1cm4gOTsKLSAgICBpZiAoOTM5MSA8PSBzYW1wbGVSYXRlKSByZXR1cm4gMTA7Ci0KLSAgICByZXR1cm4gMTE7Ci19Ci0KLQotLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgotKgotKiBmdW5jdGlvbiBuYW1lOiBhdGFuXzEwMDAKLSogZGVzY3JpcHRpb246ICBjYWxjdWxhdGVzIDEwMDAqYXRhbih4LzEwMDApCi0qICAgICAgICAgICAgICAgYmFzZWQgb24gYXRhbiBhcHByb3ggZm9yIHggPiAwCi0qCQkJCWF0YW4oeCkgPSB4LygoZmxvYXQpMS4wZisoZmxvYXQpMC4yODA4NzJmKngqeCkgIGlmIHggPCAxCi0qCQkJCQkJPSBwaS8yIC0geC8oKGZsb2F0KTAuMjgwODcyZiAreCp4KQkgICAgaWYgeCA+PSAxCi0qIHJldHVybjogICAgICAgMTAwMCphdGFuKHgvMTAwMCkKLSoKLSoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi1zdGF0aWMgV29yZDE2IGF0YW5fMTAwMChXb3JkMzIgdmFsKQotewotICBXb3JkMzIgeTsKLQotCi0gIGlmKExfc3ViKHZhbCwgMTAwMCkgPCAwKSB7Ci0gICAgeSA9IGV4dHJhY3RfbCgoKDEwMDAgKiB2YWwpIC8gKDEwMDAgKyAoKHZhbCAqIHZhbCkgLyBBVEFOX0NPRUYxKSkpKTsKLSAgfQotICBlbHNlIHsKLSAgICB5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JlcSo3NikgLyAxMDApICsgNyp0ZW1wKnRlbXApIC8gKDIqMTAwMCoxMDAwIC8gQkFSQ19TQ0FMRSk7Ci0KLSAgcmV0dXJuIHNhdHVyYXRlKGJ2YWxGRlRMaW5lKTsKLX0KLQotLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCi0qCi0qIGZ1bmN0aW9uIG5hbWU6IGluaXRUaHJRdWlldAotKiBkZXNjcmlwdGlvbjogIGluaXQgdGhyZWRob2xkIGluIHF1aWV0Ci0qCi0qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLXN0YXRpYyB2b2lkIGluaXRUaHJRdWlldChXb3JkMTYgIG51bVBiLAotICAgICAgICAgICAgICAgICAgICAgICAgIGNvbnN0IFdvcmQxNiAqcGJPZmZzZXQsCi0gICAgICAgICAgICAgICAgICAgICAgICAgV29yZDE2ICpwYkJhcmNWYWwsCi0gICAgICAgICAgICAgICAgICAgICAgICAgV29yZDMyICpwYlRocmVzaG9sZFF1aWV0KSB7Ci0gIFdvcmQxNiBpOwotICBXb3JkMTYgYmFyY1RoclF1aWV0OwotCi0gIGZvcihpPTA7IGk8bnVtUGI7IGkrKykgewotICAgIFdvcmQxNiBidjEsIGJ2MjsKLQotCi0gICAgaWYgKGk+MCkKLSAgICAgIGJ2MSA9IChwYkJhcmNWYWxbaV0gKyBwYkJhcmNWYWxbaS0xXSkgPj4gMTsKLSAgICBlbHNlCi0gICAgICBidjEgPSBwYkJhcmNWYWxbaV0gPj4gMTsKLQotCi0gICAgaWYgKGkgPCAobnVtUGIgLSAxKSkKLSAgICAgIGJ2MiA9IChwYkJhcmNWYWxbaV0gKyBwYkJhcmNWYWxbaSsxXSkgPj4gMTsKLSAgICBlbHNlIHsKLSAgICAgIGJ2MiA9IHBiQmFyY1ZhbFtpXTsKLSAgICB9Ci0KLSAgICBidjEgPSBtaW4oKGJ2MSAvIEJBUkNfU0NBTEUpLCBtYXhfYmFyayk7Ci0gICAgYnYyID0gbWluKChidjIgLyBCQVJDX1NDQUxFKSwgbWF4X2JhcmspOwotCi0gICAgYmFyY1RoclF1aWV0ID0gbWluKEJBUkNfVEhSX1FVSUVUW2J2MV0sIEJBUkNfVEhSX1FVSUVUW2J2Ml0pOwotCi0KLSAgICAvKgotICAgICAgd2UgY2FsY3VsYXRlCi0gICAgICBwb3coMTAuMGYsKGZsb2F0KShiYXJjVGhyUXVpZXQgLSBBQlNfTEVWKSowLjEpKihmbG9hdClBQlNfTE9XKihwYk9mZnNldFtpKzFdIC0gcGJPZmZzZXRbaV0pOwotICAgICovCi0KLSAgICBwYlRocmVzaG9sZFF1aWV0W2ldID0gcG93Ml94eSgoKChiYXJjVGhyUXVpZXQgLSBBQlNfTEVWKSAqIDEwMCkgKwotICAgICAgICAgICAgICAgICAgICAgICAgICBMT0cyXzEwMDAqKDE0KzIqTE9HX05PUk1fUENNKSksIExPRzJfMTAwMCkgKiAocGJPZmZzZXRbaSsxXSAtIHBiT2Zmc2V0W2ldKTsKLSAgfQotfQotCi0KLS8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgotKgotKiBmdW5jdGlvbiBuYW1lOiBpbml0U3ByZWFkaW5nCi0qIGRlc2NyaXB0aW9uOiAgaW5pdCBlbmVyZ3kgc3ByZWFkaW5nIHBhcmFtZXRlcgotKgotKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi1zdGF0aWMgdm9pZCBpbml0U3ByZWFkaW5nKFdvcmQxNiAgbnVtUGIsCi0gICAgICAgICAgICAgICAgICAgICAgICAgIFdvcmQxNiAqcGJCYXJjVmFsdWUsCi0gICAgICAgICAgICAgICAgICAgICAgICA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AuMSpkYlZhbC9CQVJDX1NDQUxFKQotICAgICAgKi8KLSAgICAgIGRiVmFsID0gKG1hc2tIaWdoICogZGJhcmspOwotICAgICAgcGJNYXNrSGlGYWN0b3JbaV0gPSByb3VuZDE2KHBvdzJfeHkoTF9uZWdhdGUoZGJWYWwpLCAoV29yZDMyKUxPRzJfMTAwMCkpOyAgICAgICAgICAgICAvKiAwLjMwMSBsb2cxMCgyKSAqLwotCi0gICAgICBkYlZhbCA9IChtYXNrTG93ICogZGJhcmspOwotICAgICAgcGJNYXNrTG9GYWN0b3JbaS0xXSA9IHJvdW5kMTYocG93Ml94eShMX25lZ2F0ZShkYlZhbCksKFdvcmQzMilMT0cyXzEwMDApKTsKLQotCi0gICAgICBkYlZhbCA9IChtYXNrSGlnaFNwckVuICogZGJhcmspOwotICAgICAgcGJNYXNrSGlGYWN0b3JTcHJFbltpXSA9ICByb3VuZDE2KHBvdzJfeHkoTF9uZWdhdGUoZGJWYWwpLChXb3JkMzIpTE9HMl8xMDAwKSk7Ci0gICAgICBkYlZhbCA9IChtYXNrTG93U3ByRW4gKiBkYmFyayk7Ci0gICAgICBwYk1hc2tMb0ZhY3RvclNwckVuW2ktMV0gPSByb3VuZDE2KHBvdzJfeHkoTF9uZWdhdGUoZGJWYWwpLChXb3JkMzIpTE9HMl8xMDAwKSk7Ci0gICAgfQotICAgIGVsc2UgewotICAgICAgcGJNYXNrSGlGYWN0b3JbaV0gPSAwOwotICAgICAgcGJNYXNrTG9GYWN0b3JbbnVtUGItMV0gPSAwOwotCi0gICAgICBwYk1hc2tIaUZhY3RvclNwckVuW2ldID0gMDsKLSAgICAgIHBiTWFza0xvRmFjdG9yU3ByRW5bbnVtUGItMV0gPSAwOwotICAgIH0KLSAgfQotCi19Ci0KLQotLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCi0qCi0qIGZ1bmN0aW9uIG5hbWU6IGluaXRCYXJjVmFsdWVzCi0qIGRlc2NyaXB0aW9uOiAgaW5pdCBiYXJrIHZhbHVlCi0qCi0qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLXN0YXRpYyB2b2lkIGluaXRCYXJjVmFsdWVzKFdvcmQxNiAgbnVtUGIsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICBjb25zdCBXb3JkMTYgKnBiT2Zmc2V0LAotICAgICAgICAgICAgICAgICAgICAgICAgICAgV29yZDE2ICBudW1MaW5lcywKLSAgICAgICAgICAgICAgICAgICAgICAgICAgIFdvcmQzMiAgc2FtcGxpbmdGcmVxdWVuY3ksCi0gICAgICAgICAgICAgICAgICAgICAgICAgICBXb3JkMTYgKnBiQnZhbCkKLXsKLSAgV29yZDE2IGk7Ci0gIFdvcmQxNiBwYkJ2YWwwLCBwYkJ2YWwxOwotCi0gIHBiQnZhbDAgPSAwOwotCi0gIGZvcihpPTA7IGk8bnVtUGI7IGkrKyl7Ci0gICAgcGJCdmFsMSA9IEJhcmNMaW5lVmFsdWUobnVtTGluZXMsIHBiT2Zmc2V0W2krMV0sIHNhbXBsaW5nRnJlcXVlbmN5KTsKLSAgICBwYkJ2YWxbaV0gPSAocGJCdmFsMCArIHBiQnZhbDEpID4+IDE7Ci0gICAgcGJCdmFsMCA9IHBiQnZhbDE7Ci0gIH0KLX0KLQotCi0vKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKLSoKLSogZnVuY3Rpb24gbmFtZTogaW5pdE1pblNucgotKiBkZXNjcmlwdGlvbjogIGNhbGN1bGF0ZSBtaW4gc25yIHBhcmFtZXRlcgotKgkJCQltaW5TbnIobikgPSAxLygyXnNmYlBlbWluKG4pL3cobikgLSAxLjUpCi0qCi0qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKio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AotICAgICAgICAgICAgICAgICBwc3lDb25mLT5zZmJPZmZzZXQsCi0gICAgICAgICAgICAgICAgIHBzeUNvbmYtPnNmYk9mZnNldFtwc3lDb25mLT5zZmJDbnRdLAotICAgICAgICAgICAgICAgICBzYW1wbGVyYXRlLAotICAgICAgICAgICAgICAgICBzZmJCYXJjVmFsKTsKLQotICAvKgotICAgIGluaXQgdGhyZXNob2xkcyBpbiBxdWlldAotICAqLwotICBpbml0VGhyUXVpZXQocHN5Q29uZi0+c2ZiQ250LAotICAgICAgICAgICAgICAgcHN5Q29uZi0+c2ZiT2Zmc2V0LAotICAgICAgICAgICAgICAgc2ZiQmFyY1ZhbCwKLSAgICAgICAgICAgICAgIHBzeUNvbmYtPnNmYlRocmVzaG9sZFF1aWV0KTsKLQotICAvKgotICAgIGNhbGN1bGF0ZSBzcHJlYWRpbmcgZnVuY3Rpb24KLSAgKi8KLSAgaW5pdFNwcmVhZGluZyhwc3lDb25mLT5zZmJDbnQsCi0gICAgICAgICAgICAgICAgc2ZiQmFyY1ZhbCwKLSAgICAgICAgICAgICAgICBwc3lDb25mLT5zZmJNYXNrTG93RmFjdG9yLAotICAgICAgICAgICAgICAgIHBzeUNvbmYtPnNmYk1hc2tIaWdoRmFjdG9yLAotICAgICAgICAgICAgICAgIHBzeUNvbmYtPnNmYk1hc2tMb3dGYWN0b3JTcHJFbiwKLSAgICAgICAgICAgICAgICBwc3lDb25mLT5zZmJNYXNrSGlnaEZhY3RvclNwckVuLAotICAgICAgICAgICAgICAgIGJpdHJhdGUsCi0gICAgICAgICAgICAgICAgTE9OR19XSU5ET1cpOwotCi0gIC8qCi0gICAgaW5pdCByYXRpbwotICAqLwotICBwc3lDb25mLT5yYXRpbyA9IGNfcmF0aW87Ci0KLSAgcHN5Q29uZi0+bWF4QWxsb3dlZEluY3JlYXNlRmFjdG9yID0gMjsKLSAgcHN5Q29uZi0+bWluUmVtYWluaW5nVGhyZXNob2xkRmFjdG9yID0gY19taW5SZW1haW5pbmdU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lICJvcGVyXzMyYi5oIgotI2luY2x1ZGUgInBzeV9jb25zdC5oIgotI2luY2x1ZGUgImJsb2NrX3N3aXRjaC5oIgotI2luY2x1ZGUgInRyYW5zZm9ybS5oIgotI2luY2x1ZGUgInNwcmVhZGluZy5oIgotI2luY2x1ZGUgInByZV9lY2hvX2NvbnRyb2wuaCIKLSNpbmNsdWRlICJiYW5kX25yZy5oIgotI2luY2x1ZGUgInBzeV9jb25maWd1cmF0aW9uLmgiCi0jaW5jbHVkZSAicHN5X2RhdGEuaCIKLSNpbmNsdWRlICJtc19zdGVyZW8uaCIKLSNpbmNsdWRlICJpbnRlcmZhY2UuaCIKLSNpbmNsdWRlICJwc3lfbWFpbi5oIgotI2luY2x1ZGUgImdycF9kYXRhLmgiCi0jaW5jbHVkZSAidG5zX2Z1bmMuaCIKLSNpbmNsdWRlICJtZW1hbGlnbi5oIgotCi0vKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxvbmcgICAgICAgc3RhcnQgICAgICAgc2hvcnQgICAgICAgc3RvcCAqLwotc3RhdGljIFdvcmQxNiBibG9ja1R5cGUyd2luZG93U2hhcGVbXSA9IHtLQkRfV0lORE9XLFNJTkVfV0lORE9XLFNJTkVfV0lORE9XLEtCRF9XSU5ET1d9OwotCi0vKgotICBmb3J3YXJkIGRlZmluaXRpb25zCi0qLwotc3RhdGljIFdvcmQxNiBhZHZhbmNlUHN5Y2hMb25nKFBTWV9EQVRBKiBwc3lEYXRhLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFROU19EQVRBKiB0bnNEYXRhLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFBTWV9DT05GSUdVUkFUSU9OX0xPTkcgKmhQc3lDb25mTG9uZywKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBQU1lfT1VUX0NIQU5ORUwqIHBzeU91dENoYW5uZWwsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgV29yZDMyICpwU2NyYXRjaFRucywKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb25zdCBUTlNfREFUQSAqdG5zRGF0YTIsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY29uc3QgV29yZDE2IGNoKTsKLQotc3RhdGljIFdvcmQxNiBhZHZhbmNlUHN5Y2hMb25nTVMgKFBTWV9EQVRBICBwc3lEYXRhW01BWF9DSEFOTkVMU10sCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY29uc3QgUFNZX0NPTkZJR1VSQVRJT05fTE9ORyAqaFBzeUNvbmZMb25nKTsKLQotc3RhdGljIFdvcmQxNiBhZHZhbmNlUHN5Y2hTaG9ydChQU1lfREFUQSogcHN5RGF0YSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgVE5TX0RBVEEqIHRuc0RhdGEsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbnN0IFBTWV9DT05GSUdVUkFUSU9OX1NIT1JUICpoUHN5Q29uZlNob3J0LAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBQU1lfT1VUX0NIQU5ORUwqIHBzeU91dENoYW5uZWwsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFdvcmQzMiAqcFNjcmF0Y2hUbnMsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbnN0IFROU19EQVRBICp0bnNEYXRhMiwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY29uc3QgV29yZDE2IGNoKTsKLQotc3RhdGljIFdvcmQxNiBhZHZhbmNlUHN5Y2hTaG9ydE1TIChQU1lfREFUQSAgcHN5RGF0YVtNQVhfQ0hBTk5FTFNdLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb25zdCBQU1lfQ09ORklHVVJBVElPTl9TSE9SVCAqaFBzeUNvbmZTaG9ydCk7Ci0KLQotLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq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OwotICAvKgotICAgIGFsbG9jIHNvbWUgbW9yZSBzdHVmZiwgdGJkCi0gICovCi0gIHJldHVybiAwOwotfQotCi0vKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKLSoKLSogZnVuY3Rpb24gbmFtZTogUHN5T3V0RGVsZXRlCi0qIGRlc2NyaXB0aW9uOiAgYWxsb2NhdGVzIG1lbW9yeSBmb3IgcHN5Y2hvYWNvdXN0aWMKLSogcmV0dXJuczogICAgICBhbiBlcnJvciBjb2RlCi0qCi0qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLVdvcmQxNiBQc3lPdXREZWxldGUoUFNZX09VVCAqaFBzeU91dCwgVk9fTUVNX09QRVJBVE9SICpwTWVtT1ApCi17Ci0gIGhQc3lPdXQ9TlVMTDsKLSAgcmV0dXJuIDA7Ci19Ci0KLQotLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCi0qCi0qIGZ1bmN0aW9uIG5hbWU6IHBzeU1haW5Jbml0Ci0qIGRlc2NyaXB0aW9uOiAgaW5pdGlhbGl6ZXMgcHN5Y2hvYWNvdXN0aWMKLSogcmV0dXJuczogICAgICBhbiBlcnJvciBjb2RlCi0qCi0qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLQotV29yZDE2IHBzeU1haW5Jbml0KFBTWV9LRVJORUwgKmhQc3ksCi0gICAgICAgICAgICAgICAgICAgV29yZDMyIHNhbXBsZVJhdGUsCi0gICAgICAgICAgICAgICAgICAgV29yZDMyIGJpdFJhdGUsCi0gICAgICAgICAgICAgICAgICAgV29yZDE2IGNoYW5uZWxzLAotICAgICAgICAgICAgICAgICAgIFdvcmQxNiB0bnNNYXNrLAotICAgICAgICAgICAgICAgICAgIFdvcmQxNiBiYW5kd2lkdGgpCi17Ci0gIFdvcmQxNiBjaCwgZXJyOwotICBXb3JkMzIgY2hhbm5lbEJpdFJhdGUgPSBiaXRSYXRlL2NoYW5uZWxzOwotCi0gIGVyciA9IEluaXRQc3lDb25maWd1cmF0aW9uTG9uZyhjaGFubmVsQml0UmF0ZSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNhbXBsZVJhdGUsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBiYW5kd2lkdGgsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmKGhQc3ktPnBzeUNvbmZMb25nKSk7Ci0KLSAgaWYgKCFlcnIpIHsKLSAgICAgIGhQc3ktPnNhbXBsZVJhdGVJZHggPSBoUHN5LT5wc3lDb25mTG9uZy5zYW1wUmF0ZUlkeDsKLQkgIGVyciA9IEluaXRUbnNDb25maWd1cmF0aW9uTG9uZyhiaXRSYXRlLCBzYW1wbGVSYXRlLCBjaGFubmVscywKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJmhQc3ktPnBzeUNvbmZMb25nLnRuc0NvbmYsICZoUHN5LT5wc3lDb25mTG9uZywgdG5zTWFzayYyKTsKLSAgfQotCi0gIGlmICghZXJyKQotICAgIGVyciA9IEluaXRQc3lDb25maWd1cmF0aW9uU2hvcnQoY2hhbm5lbEJpdFJhdGUsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzYW1wbGVSYXRlLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYmFuZHdpZHRoLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJmhQc3ktPnBzeUNvbmZTaG9ydCk7Ci0gIGlmICghZXJyKSB7Ci0gICAgZXJyID0gSW5pdFRuc0NvbmZpZ3VyYXRpb25TaG9ydChiaXRSYXRlLCBzYW1wbGVSYXRlLCBjaGFubmVscywKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICZoUHN5LT5wc3lDb25mU2hvcnQudG5zQ29uZiwgJmhQc3ktPnBzeUNvbmZTaG9ydCwgdG5zTWFzayYxKTsKLSAgfQotCi0gIGlmICghZXJyKQotICAgIGZvcihjaD0wO2NoIDwgY2hhbm5lbHM7Y2grKyl7Ci0KLSAgICAgIEluaXRCbG9ja1N3aXRjaGluZygmaFBzeS0+cHN5RGF0YVtjaF0uYmxvY2tTd2l0Y2hpbmdDb250cm9sLAotICAgICAgICAgICAgICAgICAgICAgICAgIGJpdFJhdGUsIGNoYW5uZWxzKTsKLQotICAgICAgSW5pdFByZUVjaG9Db250cm9sKGhQc3ktPnBzeURhdGFbY2hdLnNmYlRocmVzaG9sZG5tMSwKLSAgICAgICAgICAgICAgICAgICAgICAgICBoUHN5LT5wc3lDb25mTG9uZy5zZmJDbnQsCi0gICAgICAgICAgICAgICAgICAgICAgICAgaFBzeS0+cHN5Q29uZkxvbmcuc2ZiVGhyZXNob2xkUXVpZXQpOwotICAgICAgaFBzeS0+cHN5RGF0YVtjaF0ubWRjdFNjYWxlbm0xID0gMDsKLSAgICB9Ci0KLQlyZXR1cm4oZXJyKTsKLX0KLQotLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCi0qCi0qIGZ1bmN0aW9uIG5hbWU6IHBzeU1haW4KLSogZGVzY3JpcHRpb246ICBwc3ljaG9hY291c3RpYyBtYWluIGZ1bmN0aW9uCi0qIHJldHVybnM6ICAgICAgYW4gZXJyb3IgY29kZQotKgotKiAgICBUaGlzIGZ1bmN0aW9uIGFzc3VtZXMgdGhhdCBlbm91Z2ggaW5wdXQgZGF0YSBpcyBpbiB0aGUgbW9kdWxvIGJ1ZmZlci4KLSoKLSoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotCi1Xb3JkMTYgcHN5TWFpbihXb3JkMTYgICAgICAgICAgICAgICAgICAgbkNoYW5uZWxzLAotICAgICAgICAgICAgICAgRUxFTUVOVF9JTkZPICAgICAgICAgICAgKmVsZW1JbmZvLAotICAgICAgICAgICAgICAgV29yZDE2ICAgICAgICAgICAgICAgICAgKnRpbWVTaWduYWwsCi0gICAgICAgICAgICAgICBQU1lfREFUQSAgICAgICAgICAgICAgICAgcHN5RGF0YVtNQVhfQ0hBTk5FTFNdLAotICAgICAgICAgICAgICAgVE5TX0RBVEEgICAgICAgICAgICAgICAgIHRuc0RhdGFbTUFYX0NIQU5ORUxTXSwKLSAgICAgICAgICAgICAgIFBTWV9DT05GSUdVUkFUSU9OX0xPTkcgICpoUHN5Q29uZkxvbmcsCi0gICAgICAgICAgICAgICBQU1lfQ09ORklHVVJBVElPTl9TSE9SVCAqaFBzeUNvbmZTaG9ydCwKLSAgICAgICAgICAgICAgIFBTWV9PVVRfQ0hBTk5FTCAgICAgICAgICBwc3lPdXRDaGFubmVsW01BWF9DSEFOTkVMU10sCi0gICAgICAgICAgICAgICBQU1lfT1VUX0VMRU1FTlQgICAgICAgICAqcHN5T3V0RWxlbWVudCwKLSAgICAgICAgICAgICAgIFdvcmQzMiAgICAgICAgICAgICAgICAgICpwU2NyYXRjaFRucywKLQkJCSAgIFdvcmQzMgkJCQkgICBzYW1wbGVSYXRlKQotewotICBXb3JkMTYgbWF4U2ZiUGVyR3JvdXBbTUFYX0NIQU5ORUxTXTsKLSAgV29yZDE2IG1kY3RTY2FsaW5nQXJyYXlbTUFYX0NIQU5ORUxTXTsKLQotICBXb3JkMTYgY2g7ICAgLyogY291bnRzIHRocm91Z2ggY2hhbm5lbHMgICAgICAgICAgKi8KLSAgV29yZDE2IHNmYjsgIC8qIGNvdW50cyB0aHJvdWdoIHNjYWxlZmFjdG9yIGJhbmRzICovCi0gIFdvcmQxNiBsaW5lOyAvKiBjb3V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gICAgICAgICAgIGhQc3lDb25mTG9uZywKLSAgICAgICAgICAgICAgICAgICAgICAgJnBzeU91dENoYW5uZWxbY2hdLAotICAgICAgICAgICAgICAgICAgICAgICBwU2NyYXRjaFRucywKLSAgICAgICAgICAgICAgICAgICAgICAgJnRuc0RhdGFbMSAtIGNoXSwKLSAgICAgICAgICAgICAgICAgICAgICAgY2gpOwotCi0gICAgICAvKiBkZXRlcm1pbmUgbWF4U2ZiICovCi0gICAgICBmb3IgKHNmYj1oUHN5Q29uZkxvbmctPnNmYkNudC0xOyBzZmI+PTA7IHNmYi0tKSB7Ci0gICAgICAgIGZvciAobGluZT1oUHN5Q29uZkxvbmctPnNmYk9mZnNldFtzZmIrMV0gLSAxOyBsaW5lPj1oUHN5Q29uZkxvbmctPnNmYk9mZnNldFtzZmJdOyBsaW5lLS0pIHsKLQotICAgICAgICAgIGlmIChwc3lEYXRhW2NoXS5tZGN0U3BlY3RydW1bbGluZV0gIT0gMCkgYnJlYWs7Ci0gICAgICAgIH0KLSAgICAgICAgaWYgKGxpbmUgPj0gaFBzeUNvbmZMb25nLT5zZmJPZmZzZXRbc2ZiXSkgYnJlYWs7Ci0gICAgICB9Ci0gICAgICBtYXhTZmJQZXJHcm91cFtjaF0gPSBzZmIgKyAxOwotCi0gICAgICAvKiBDYWxjIGJhbmR3aXNlIGVuZXJnaWVzIGZvciBtaWQgYW5kIHNpZGUgY2hhbm5lbAotICAgICAgICAgRG8gaXQgb25seSBpZiAyIGNoYW5uZWxzIGV4aXN0ICovCi0KLSAgICAgIGlmIChjaCA9PSAxKQotICAgICAgICBhZHZhbmNlUHN5Y2hMb25nTVMocHN5RGF0YSwgaFBzeUNvbmZMb25nKTsKLSAgICB9Ci0gICAgZWxzZSB7Ci0gICAgICBhZHZhbmNlUHN5Y2hTaG9ydCgmcHN5RGF0YVtjaF0sCi0gICAgICAgICAgICAgICAgICAgICAgICAmdG5zRGF0YVtjaF0sCi0gICAgICAgICAgICAgICAgICAgICAgICBoUHN5Q29uZlNob3J0LAotICAgICAgICAgICAgICAgICAgICAgICAgJnBzeU91dENoYW5uZWxbY2hdLAotICAgICAgICAgICAgICAgICAgICAgICAgcFNjcmF0Y2hUbnMsCi0gICAgICAgICAgICAgICAgICAgICAgICAmdG5zRGF0YVsxIC0gY2hdLAotICAgICAgICAgICAgICAgICAgICAgICAgY2gpOwotCi0gICAgICAvKiBDYWxjIGJhbmR3aXNlIGVuZXJnaWVzIGZvciBtaWQgYW5kIHNpZGUgY2hhbm5lbAotICAgICAgICAgRG8gaXQgb25seSBpZiAyIGNoYW5uZWxzIGV4aXN0ICovCi0KLSAgICAgIGlmIChjaCA9PSAxKQotICAgICAgICBhZHZhbmNlUHN5Y2hTaG9ydE1TIChwc3lEYXRhLCBoUHN5Q29uZlNob3J0KTsKLSAgICB9Ci0gIH0KLQotICAvKiBncm91cCBzaG9ydCBkYXRhICovCi0gIGZvcihjaD0wOyBjaDxjaGFubmVsczsgY2grKykgewotCi0gICAgaWYgKHBzeURhdGFbY2hdLmJsb2NrU3dpdGNoaW5nQ29udHJvbC53aW5kb3dTZXF1ZW5jZSA9PSBTSE9SVF9XSU5ET1cpIHsKLSAgICAgIGdyb3VwU2hvcnREYXRhKHBzeURhdGFbY2hdLm1kY3RTcGVjdHJ1bSwKLSAgICAgICAgICAgICAgICAgICAgIHBTY3JhdGNoVG5zLAotICAgICAgICAgICAgICAgICAgICAgJnBzeURhdGFbY2hdLnNmYlRocmVzaG9sZCwKLSAgICAgICAgICAgICAgICAgICAgICZwc3lEYXRhW2NoXS5zZmJFbmVyZ3ksCi0gICAgICAgICAgICAgICAgICAgICAmcHN5RGF0YVtjaF0uc2ZiRW5lcmd5TVMsCi0gICAgICAgICAgICAgICAgICAgICAmcHN5RGF0YVtjaF0uc2ZiU3ByZWFkZWRFbmVyZ3ksCi0gICAgICAgICAgICAgICAgICAgICBoUHN5Q29uZlNob3J0LT5zZmJDbnQsCi0gICAgICAgICAgICAgICAgICAgICBoUHN5Q29uZlNob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G9uZywKLSAgICAgICAgICAgICAgICAgICAgICAgICBwc3lEYXRhWzFdLnNmYkVuZXJneU1TLnNmYkxvbmcsCi0gICAgICAgICAgICAgICAgICAgICAgICAgcHN5RGF0YVswXS5tZGN0U3BlY3RydW0sCi0gICAgICAgICAgICAgICAgICAgICAgICAgcHN5RGF0YVsxXS5tZGN0U3BlY3RydW0sCi0gICAgICAgICAgICAgICAgICAgICAgICAgcHN5RGF0YVswXS5zZmJUaHJlc2hvbGQuc2ZiTG9uZywKLSAgICAgICAgICAgICAgICAgICAgICAgICBwc3lEYXRhWzFdLnNmYlRocmVzaG9sZC5zZmJMb25nLAotICAgICAgICAgICAgICAgICAgICAgICAgIHBzeURhdGFbMF0uc2ZiU3ByZWFkZWRFbmVyZ3kuc2ZiTG9uZywKLSAgICAgICAgICAgICAgICAgICAgICAgICBwc3lEYXRhWzFdLnNmYlNwcmVhZGVkRW5lcmd5LnNmYkxvbmcsCi0gICAgICAgICAgICAgICAgICAgICAgICAgKFdvcmQxNiopJnBzeU91dEVsZW1lbnQtPnRvb2xzSW5mby5tc0RpZ2VzdCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAoV29yZDE2Kilwc3lPdXRFbGVtZW50LT50b29sc0luZm8ubXNNYXNrLAotICAgICAgICAgICAgICAgICAgICAgICAgIGhQc3lDb25mTG9uZy0+c2ZiQ250LAotICAgICAgICAgICAgICAgICAgICAgICAgIGhQc3lDb25mTG9uZy0+c2ZiQ250LAotICAgICAgICAgICAgICAgICAgICAgICAgIG1heFNmYlBlckdyb3VwWzBdLAotICAgICAgICAgICAgICAgICAgICAgICAgIChjb25zdCBXb3JkMTYqKWhQc3lDb25mTG9uZy0+c2ZiT2Zmc2V0KTsKLSAgICAgIGVsc2UKLSAgICAgICAgTXNTdGVyZW9Qcm9jZXNzaW5nKHBzeURhdGFbMF0uc2ZiRW5lcmd5LnNmYkxvbmcsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICBwc3lEYXRhWzFdLnNmYkVuZXJneS5zZmJMb25nLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgcHN5RGF0YVswXS5zZmJFbmVyZ3lNUy5zZmJMb25nLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgcHN5RGF0YVsxXS5zZmJFbmVyZ3lNUy5zZmJMb25nLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgcHN5RGF0YVswXS5tZGN0U3BlY3RydW0sCi0gICAgICAgICAgICAgICAgICAgICAgICAgICBwc3lEYXRhWzFdLm1kY3RTcGVjdHJ1bSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgIHBzeURhdGFbMF0uc2ZiVGhyZXNob2xkLnNmYkxvbmcsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICBwc3lEYXRhWzFdLnNmYlRocmVzaG9sZC5zZmJMb25nLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgcHN5RGF0YVswXS5zZmJTcHJlYWRlZEVuZXJneS5zZmJMb25nLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgcHN5RGF0YVsxXS5zZmJTcHJlYWRlZEVuZXJneS5zZmJMb25nLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgKFdvcmQxNiopJnBzeU91dEVsZW1lbnQtPnRvb2xzSW5mby5tc0RpZ2VzdCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgIChXb3JkMTYqKXBzeU91dEVsZW1lbnQtPnRvb2xzSW5mby5tc01hc2ssCi0gICAgICAgICAgICAgICAgICAgICAgICAgICBwc3lEYXRhWzBdLmJsb2NrU3dpdGNoaW5nQ29udHJvbC5ub09mR3JvdXBzKmhQc3lDb25mU2hvcnQtPnNmYkNudCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgIGhQc3lDb25mU2hvcnQtPnNmYkNudCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgIG1heFNmYlBlckdyb3VwWzBdLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgKGNvbnN0IFdvcmQxNiopcHN5T3V0RWxlbWVudC0+Z3JvdXBlZFNmYk9mZnNldFswXSk7Ci0gIH0KLQotI2VuZGlmIC8qIChNQVhfQ0hBTk5FTFM+MSkgKi8KLQotICAvKgotICAgIGJ1aWxkIG91dHB1dAotICAqLwotICBmb3IoY2g9MDtjaDxjaGFubmVscztjaCsrKSB7Ci0KLSAgICBpZiAocHN5RGF0YVtjaF0uYmxvY2tTd2l0Y2hpbmdDb250cm9sLndpbmRvd1NlcXVlbmNlICE9IFNIT1JUX1dJTkRPVykKLSAgICAgIEJ1aWxkSW50ZXJmYWNlKHBzeURhdGFbY2hdLm1kY3RTcGVjdHJ1bSwKLSAgICAgICAgICAgICAgICAgICAgIHBzeURhdGFbY2hdLm1kY3RTY2FsZSwKLSAgICAgICAgICAgICAgICAgICAgICZwc3lEYXRhW2NoXS5zZmJUaHJlc2hvbGQsCi0gICAgICAgICAgICAgICAgICAgICAmcHN5RGF0YVtjaF0uc2ZiRW5lcmd5LAotICAgICAgICAgICAgICAgICAgICAgJnBzeURhdGFbY2hdLnNmYlNwcmVhZGVkRW5lcmd5LAotICAgICAgICAgICAgICAgICAgICAgcHN5RGF0YVtjaF0uc2ZiRW5lcmd5U3VtLAotICAgICAgICAgICAgICAgICAgICAgcHN5RGF0YVtjaF0uc2ZiRW5lcmd5U3VtTVMsCi0gICAgICAgICAgICAgICAgICAgICBwc3lEYXRhW2NoXS5ibG9ja1N3aXRjaGluZ0NvbnRyb2wud2luZG93U2VxdWVuY2UsCi0gICAgICAgICAgICAgICAgICAgICBibG9ja1R5cGUyd2luZG93U2hhcGVbcHN5RGF0YVtjaF0uYmxvY2tTd2l0Y2hpbmdDb250cm9sLndpbmRvd1NlcXVlbmNlXSwKLSAgICAgICAgICAgICAgICAgICAgIGhQc3lDb25mTG9uZy0+c2ZiQ250LAotICAgICAgICAgICAgICAgICAgICAgaFBzeUNvbmZMb25nLT5zZmJPZmZzZXQsCi0gICAgICAgICAgICAgICAgICAgICBtYXhTZmJQZXJHcm91cFtjaF0sCi0gICAgICAgICAgICAgICAgICAgICBoUHN5Q29uZkxvbmctPnNmYk1pblNuciwKLSAgICAgICAgICAgICAgICAgICAgIHBzeURhdGFbY2hdLmJsb2NrU3dpdGNoaW5nQ29udHJvbC5ub09mR3JvdXBzLAotICAgICAgICAgICAgICAgICAgICAgcHN5RGF0YVtjaF0uYmxvY2tTd2l0Y2hpbmdDb250cm9sLmdyb3VwTGVuLAotICAgICAgICAgICAgICAgICAgICAgJnBzeU91dENoYW5uZWxbY2hdKTsKLSAgICBlbHNlCi0gICAgICBCdWlsZEludGVyZmFjZShwc3lEYXRhW2NoXS5tZGN0U3BlY3RydW0sCi0gICAgICAgICAgICAgICAgICAgICBwc3lEYXRhW2NoXS5tZGN0U2NhbGUsCi0gICAgICAgICAgICAgICAgICAgICAmcHN5RGF0YVtjaF0uc2ZiVGhyZXNob2xkLAotICAgICAgICAgICAgICAgICAgICAgJnBzeURhdGFbY2hdLnNmYkVuZXJneSwKLSAgICAgICAgICAgICAgICAgICAgICZwc3lEYXRhW2NoXS5zZmJTcHJlYWRlZEVuZXJneSwKLSAgICAgICAgICAgICAgICAgICAgIHBzeURhdGFbY2hdLnNmYkVuZXJneVN1bSwKLSAgICAgICAgICAgICAgICAgICAgIHBzeURhdGFbY2hdLnNmYkVuZXJneVN1bU1TLAotICAgICAgICAgICAgICAgICAgICAgU0hPUlRfV0lORE9XLAotICAgICAgICAgICAgICAgICAgICAgU0lORV9XSU5ET1csCi0gICAgICAgICAgICAgICAgICAgICBwc3lEYXRhWzBdLmJsb2NrU3dpdGNoaW5nQ29udHJvbC5ub09mR3JvdXBzKmhQc3lDb25mU2hvcnQtPnNmYkNudCwKLSAgICAgICAgICAgICAgICAgICAgIHBzeU91dEVsZW1lbnQtPmdyb3VwZWRTZmJPZmZzZXRbY2hdLAotICAgICAgICAgICAgICAgICAgICAgbWF4U2ZiUGVyR3JvdXBbY2hdLAotICAgICAgICAgICAgICAgICAgICAgcHN5T3V0RWxlbWVudC0+Z3JvdXBlZFNmYk1pblNucltjaF0sCi0gICAgICAgICAgICAgICAgICAgICBwc3lEYXRhW2NoXS5ibG9ja1N3aXRjaGluZ0NvbnRyb2wubm9PZkdyb3VwcywKLSAgICAgICAgICAgICAgICAgICAgIHBzeURhdGFbY2hdLmJsb2NrU3dpdGNoaW5nQ29udHJvbC5ncm91cExlbiwKLSAgICAgICAgICAgICAgICAgICAgICZwc3lPdXRDaGFubmVsW2NoXSk7Ci0gIH0KLQotICByZXR1cm4oMCk7IC8qIG5vIGVycm9yICovCi19Ci0KLS8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgotKgotKiBmdW5jdGlvbiBuYW1lOiBhZHZhbmNlUHN5Y2hMb25nCi0qIGRlc2NyaXB0aW9uOiAgcHN5Y2hvYWNvdXN0aWMgZm9yIGxvbmcgYmxvY2tzCi0qCi0qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLQotc3RhdGljIFdvcmQxNiBhZHZhbmNlUHN5Y2hMb25nKFBTWV9EQVRBKiBwc3lEYXRhLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFROU19EQVRBKiB0bnNEYXRhLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFBTWV9DT05GSUdVUkFUSU9OX0xPTkcgKmhQc3lDb25mTG9uZywKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBQU1lfT1VUX0NIQU5ORUwqIHBzeU91dENoYW5uZWwsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgV29yZDMyICpwU2NyYXRjaFRucywKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb25zdCBUTlNfREFUQSogdG5zRGF0YTIsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY29uc3QgV29yZDE2IGNoKQotewotICBXb3JkMzIgaTsKLS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01BWF9DSEFOTkVMU10sCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY29uc3QgUFNZX0NPTkZJR1VSQVRJT05fTE9ORyAqaFBzeUNvbmZMb25nKQotewotICBDYWxjQmFuZEVuZXJneU1TKHBzeURhdGFbMF0ubWRjdFNwZWN0cnVtLAotICAgICAgICAgICAgICAgICAgIHBzeURhdGFbMV0ubWRjdFNwZWN0cnVtLAotICAgICAgICAgICAgICAgICAgIGhQc3lDb25mTG9uZy0+c2ZiT2Zmc2V0LAotICAgICAgICAgICAgICAgICAgIGhQc3lDb25mTG9uZy0+c2ZiQWN0aXZlLAotICAgICAgICAgICAgICAgICAgIHBzeURhdGFbMF0uc2ZiRW5lcmd5TVMuc2ZiTG9uZywKLSAgICAgICAgICAgICAgICAgICAmcHN5RGF0YVswXS5zZmJFbmVyZ3lTdW1NUy5zZmJMb25nLAotICAgICAgICAgICAgICAgICAgIHBzeURhdGFbMV0uc2ZiRW5lcmd5TVMuc2ZiTG9uZywKLSAgICAgICAgICAgICAgICAgICAmcHN5RGF0YVsxXS5zZmJFbmVyZ3lTdW1NUy5zZmJMb25nKTsKLQotICByZXR1cm4gMDsKLX0KLQotCi0vKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKLSoKLSogZnVuY3Rpb24gbmFtZTogYWR2YW5jZVBzeWNoU2hvcnQKLSogZGVzY3JpcHRpb246ICBwc3ljaG9hY291c3RpYyBmb3Igc2hvcnQgYmxvY2tzCi0qCi0qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLQotc3RhdGljIFdvcmQxNiBhZHZhbmNlUHN5Y2hTaG9ydChQU1lfREFUQSogcHN5RGF0YSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgVE5TX0RBVEEqIHRuc0RhdGEsCi0gICAg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Z0IGFkZCBvciBtaW51cyByaWdodCBjaGFubmVsCi0qCQkJCWZvciBzaG9ydCBibG9jawotKgotKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi1zdGF0aWMgV29yZDE2IGFkdmFuY2VQc3ljaFNob3J0TVMgKFBTWV9EQVRBIHBzeURhdGFbTUFYX0NIQU5ORUxTXSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY29uc3QgUFNZX0NPTkZJR1VSQVRJT05fU0hPUlQgKmhQc3lDb25mU2hvcnQpCi17Ci0gIFdvcmQzMiB3LCB3T2Zmc2V0OwotICB3T2Zmc2V0ID0gMDsKLSAgZm9yKHc9MDsgdzxUUkFOU19GQUM7IHcrKykgewotICAgIENhbGNCYW5kRW5lcmd5TVMocHN5RGF0YVswXS5tZGN0U3BlY3RydW0rd09mZnNldCwKLSAgICAgICAgICAgICAgICAgICAgIHBzeURhdGFbMV0ubWRjdFNwZWN0cnVtK3dPZmZzZXQsCi0gICAgICAgICAgICAgICAgICAgICBoUHN5Q29uZlNob3J0LT5zZmJPZmZzZXQsCi0gICAgICAgICAgICAgICAgICAgICBoUHN5Q29uZlNob3J0LT5zZmJBY3RpdmUsCi0gICAgICAgICAgICAgICAgICAgICBwc3lEYXRhWzBdLnNmYkVuZXJneU1TLnNmYlNob3J0W3ddLAotICAgICAgICAgICAgICAgICAgICAgJnBzeURhdGFbMF0uc2ZiRW5lcmd5U3VtTVMuc2ZiU2hvcnRbd10sCi0gICAgICAgICAgICAgICAgICAgICBwc3lEYXRhWzFdLnNmYkVuZXJneU1TLnNmYlNob3J0W3ddLAotICAgICAgICAgICAgICAgICAgICAgJnBzeURhdGFbMV0uc2ZiRW5lcmd5U3VtTVMuc2ZiU2hvcnRbd10pOwotICAgIHdPZmZzZXQgKz0gRlJBTUVfTEVOX1NIT1JUOwotICB9Ci0KLSAgcmV0dXJuIDA7Ci19C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1YWdlIGdvdmVybmluZyBwZXJtaXNzaW9ucyBhbmQKLSAqKiBsaW1pdGF0aW9ucyB1bmRlciB0aGUgTGljZW5zZS4KLSAqLwotLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKLQlGaWxlOgkJcWNfbWFpbi5jCi0KLQlDb250ZW50OglRdWFudGl6aW5nICYgY29kaW5nIGZ1bmN0aW9ucwotCi0qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotCi0jaW5jbHVkZSAiYmFzaWNfb3AuaCIKLSNpbmNsdWRlICJvcGVyXzMyYi5oIgotI2luY2x1ZGUgInFjX21haW4uaCIKLSNpbmNsdWRlICJxdWFudGl6ZS5oIgotI2luY2x1ZGUgImludGVyZmFjZS5oIgotI2luY2x1ZGUgImFkal90aHIuaCIKLSNpbmNsdWRlICJzZl9lc3RpbS5oIgotI2luY2x1ZGUgInN0YXRfYml0cy5oIgotI2luY2x1ZGUgImJpdF9jbnQuaCIKLSNpbmNsdWRlICJkeW5fYml0cy5oIgotI2luY2x1ZGUgImNoYW5uZWxfbWFwLmgiCi0jaW5jbHVkZSAibWVtYWxpZ24uaCIKLQotCi10eXBlZGVmIGVudW17Ci0gIEZSQU1FX0xFTl9CWVRFU19NT0RVTE8gPSAgMSwKLSAgRlJBTUVfTEVOX0JZVEVTX0lOVCAgICA9ICAyCi19RlJBTUVfTEVOX1JFU1VMVF9NT0RFOwotCi1zdGF0aWMgY29uc3QgV29yZDE2IG1heEZpbGxFbGVtQml0cyA9IDcgKyAyNzAqODsKLQotLyogZm9yd2FyZCBkZWNsYXJhdGlvbnMgKi8KLQotc3RhdGljIFdvcmQxNiBjYWxjTWF4VmFsdWVJblNmYihXb3JkMTYgc2ZiQ250LAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBXb3JkMTYgbWF4U2ZiUGVyR3JvdXAsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFdvcmQxNiBzZmJQZXJHcm91cCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgV29yZDE2IHNmYk9mZnNldFtNQVhfR1JPVVBFRF9TRkJdLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBXb3JkMTYgcXVhbnRTcGVjdHJ1bVtGUkFNRV9MRU5fTE9OR10sCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFVXb3JkMTYgbWF4VmFsdWVbTUFYX0dST1VQRURfU0ZCXSk7Ci0KLQotLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCi0qCi0qIGZ1bmN0aW9uIG5hbWU6IGNhbGNGcmFtZUxlbgotKiBkZXNjcmlwdGlvbjogZXN0aW1hdGUgdGhlIGZyYW1lIGxlbmd0aCBhY2NvcmRpbmcgdGhlIGJpdHJhdGVzCi0qCi0qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLXN0YXRpYyBXb3JkMTYgY2FsY0ZyYW1lTGVuKFdvcmQzMiBiaXRSYXRlLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgV29yZDMyIHNhbXBsZVJhdGUsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICBGUkFNRV9MRU5fUkVTVUxUX01PREUgbW9kZSkKLXsKLQotICBXb3JkMzIgcmVzdWx0OwotICBXb3JkMzIgcXVvdDsKLQotICByZXN1bHQgPSAoRlJBTUVfTEVOX0xPTkcgPj4gMykgKiBiaXRSYXRlOwotICBxdW90ID0gcmVzdWx0IC8gc2FtcGxlUmF0ZTsKLQotCi0gIGlmIChtb2RlID09IEZSQU1FX0xFTl9CWVRFU19NT0RVTE8pIHsKLSAgICByZXN1bHQgLT0gcXVvdCAqIHNhbXBsZVJhdGU7Ci0gIH0KLSAgZWxzZSB7IC8qIEZSQU1FX0xFTl9CWVRFU19JTlQgKi8KLSAgICByZXN1bHQgPSBxdW90OwotICB9Ci0KLSAgcmV0dXJuIHJlc3VsdDsKLX0KLQotLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCi0qCi0qICBmdW5jdGlvbiBuYW1lOmZyYW1lUGFkZGluZwotKiAgZGVzY3JpcHRpb246IENhbGN1bGF0ZXMgaWYgcGFkZGluZyBpcyBuZWVkZWQgZm9yIGFjdHVhbCBmcmFtZQotKiAgcmV0dXJuczogcGFkZGluZ09uIG9yIG5vdAotKgotKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi1zdGF0aWMgV29yZDE2IGZyYW1lUGFkZGluZyhXb3JkMzIgYml0UmF0ZSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgIFdvcmQzMiBzYW1wbGVSYXRlLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgV29yZDMyICpwYWRkaW5nUmVzdCkKLXsKLSAgV29yZDE2IHBhZGRpbmdPbjsKLSAgV29yZDE2IGRpZmZlcmVuY2U7Ci0KLSAgcGFkZGluZ09uID0gMDsKLQotICBkaWZmZXJlbmNlID0gY2FsY0ZyYW1lTGVuKCBiaXRSYXRlLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzYW1wbGVSYXRlLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICBGUkFNRV9MRU5fQllURVNfTU9EVUxPICk7Ci0gICpwYWRkaW5nUmVzdCA9ICpwYWRkaW5nUmVzdCAtIGRpZmZlcmVuY2U7Ci0KLQotICBpZiAoKnBhZGRpbmdSZXN0IDw9IDAgKSB7Ci0gICAgcGFkZGluZ09uID0gMTsKLSAgICAqcGFkZGluZ1J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qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgotKgotKiBmdW5jdGlvbiBuYW1lOiBRQ0RlbGV0ZQotKiBkZXNjcmlwdGlvbjogdW5pbnQgcWNvdXQgcGFyYW1ldGVyCi0qCi0qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotdm9pZCBRQ0RlbGV0ZShRQ19TVEFURSAqaFFDLCBWT19NRU1fT1BFUkFUT1IgKnBNZW1PUCkKLXsKLQotICAvKgotICAgICBub3RoaW5nIHRvIGRvCi0gICovCi0gIGhRQz1OVUxMOwotfQotCi0vKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCi0qCi0qIGZ1bmN0aW9uIG5hbWU6IFFDSW5pdAotKiBkZXNjcmlwdGlvbjogaW5pdCBRRCBwYXJhbWV0ZXIKLSogcmV0dXJuczogICAgIDAgaWYgc3VjY2VzcwotKgotKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLVdvcmQxNiBRQ0luaXQoUUNfU1RBVEUgKmhRQywKLSAgICAgICAgICAgICAgc3RydWN0IFFDX0lOSVQgKmluaXQpCi17Ci0gIGhRQy0+bkNoYW5uZWxzICAgICAgID0gaW5pdC0+ZWxJbmZvLT5uQ2hhbm5lbHNJbkVsOwotICBoUUMtPm1heEJpdHNUb3QgICAgICA9IGluaXQtPm1heEJpdHM7Ci0gIGhRQy0+Yml0UmVzVG90ICAgICAgID0gc3ViKGluaXQtPmJpdFJlcywgaW5pdC0+YXZlcmFnZUJpdHMpOwotICBoUUMtPmF2ZXJhZ2VCaXRzVG90ICA9IGluaXQtPmF2ZXJhZ2VCaXRzOwotICBoUUMtPm1heEJpdEZhYyAgICAgICA9IGluaXQtPm1heEJpdEZhYzsKLQotICBoUUMtPnBhZGRpbmcucGFkZGluZ1Jlc3QgPSBpbml0LT5wYWRkaW5nLnBhZGRpbmdSZXN0OwotCi0gIGhRQy0+Z2xvYlN0YXRCaXRzICAgID0gMzsgICAgICAgICAgICAgICAgICAgICAgICAgIC8qIGZvciBJRF9FTkQgKi8KLQotICAvKiBjaGFubmVsIGVsZW1lbnRzIGluaXQgKi8KLSAgSW5pdEVsZW1lbnRCaXRzKCZoUUMtPmVsZW1lbnRCaXRzLAotICAgICAgICAgICAgICAgICAgKmluaXQtPmVsSW5mbywKLSAgICAgICAgICAgICAgICAgIGluaXQtPmJpdHJhdGUsCi0gICAgICAgICAgICAgICAgICBpbml0LT5hdmVyYWdlQml0cywKLSAgICAgICAgICAgICAgICAgIGhRQy0+Z2xvYlN0YXRCaXRzKTsKLQotICAvKiB0aHJlc2hvbGQgcGFyYW1ldGVyIGluaXQgKi8KLSAgQWRqVGhySW5pdCgmaFFDLT5hZGpUaHIsCi0gICAgICAgICAgICAgaW5pdC0+bWVhblBlLAotICAgICAgICAgICAgIGhRQy0+ZWxlbWVudEJpdHMuY2hCaXRyYXRlKTsKLQotICByZXR1cm4gMDsKLX0KLQotCi0vKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCi0qCi0qIGZ1bmN0aW9uIG5hbWU6IFFDTWFpbgotKiBkZXNjcmlwdGlvbjogIHF1YW50aXphdGlvbiBhbmQgY29kaW5nIHRoZSBzcGVjdHJ1bQotKiByZXR1cm5zOiAgICAgIDAgaWYgc3VjY2VzcwotKgotKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLVdvcmQxNiBRQ01haW4oUUNfU1RBVEUqIGhRQywKLSAgICAgICAgICAgICAgRUxFTUVOVF9CSVRTKiBlbEJpdHMsCi0gICAgICAgICAgICAgIEFUU19FTEVNRU5UKiBhZGpUaHJTdGF0ZUVsZW1lbnQsCi0gICAgICAgICAgICAgIFBTWV9PVVRfQ0hBTk5FTCAgcHN5T3V0Q2hhbm5lbFtNQVhfQ0hBTk5FTFNdLCAgLyogbWF5IGJlIG1vZGlmaWVkIGluLXBsYWNlICovCi0gICAgICAgICAgICAgIFBTWV9PVVRfRUxFTUVOVCogcHN5T3V0RWxlbWVudCwKLSAgICAgICAgICAgICAgUUNfT1VUX0NIQU5ORUwgIHFjT3V0Q2hhbm5lbFtNQVhfQ0hBTk5FTFNdLCAgICAvKiBvdXQgICAgICAgICAgICAgICAgICAgICAgKi8KLSAgICAgICAgICAgICAgUUNfT1VUX0VMRU1FTlQqIHFjT3V0RWxlbWVudCwKLSAgICAgICAgICAgICAgV29yZDE2IG5DaGFubmVscywKLQkJCSAgV29yZDE2IGFuY2lsbGFyeURhdGFCeXRlcykKLXsKLSAgV29yZDE2IG1heENoRHluQml0c1tNQVhfQ0hBTk5FTFNdOwotICBXb3JkMTYgY2hCaXREaXN0cmlidXRpb25bTUFYX0NIQU5ORUxTXTsKLSAgV29yZDMyIGNoOwotCi0gIGlmIChlbEJpdHMtPmJpdFJlc0xldmVsIDwgMCkgewotICAgIHJldHVybiAtMTsKLSAgfQotCi0gIGlmIChlbEJpdHMtPmJpdFJlc0xldmVsID4gZWxCaXRzLT5tYXhCaXRSZXNCaXRzKSB7Ci0gICAgcmV0dXJuIC0xOwotICB9Ci0KLSAgcWNPdXRFbGVtZW50LT5zdGF0aWNCaXRzVXNlZCA9IGNvdW50U3RhdGljQml0ZGVtYW5kKHBzeU91dENoYW5uZWwsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwc3lPdXRFbGVtZW50LAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbkNoYW5uZWxzLAotCQk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otICAgICAgY29uc3RyYWludHNGdWxmaWxsZWQgPSAxOwotCi0gICAgICBRdWFudGl6ZVNwZWN0cnVtKHBzeU91dENoYW5uZWxbY2hdLnNmYkNudCwKLSAgICAgICAgICAgICAgICAgICAgICAgcHN5T3V0Q2hhbm5lbFtjaF0ubWF4U2ZiUGVyR3JvdXAsCi0gICAgICAgICAgICAgICAgICAgICAgIHBzeU91dENoYW5uZWxbY2hdLnNmYlBlckdyb3VwLAotICAgICAgICAgICAgICAgICAgICAgICBwc3lPdXRDaGFubmVsW2NoXS5zZmJPZmZzZXRzLAotICAgICAgICAgICAgICAgICAgICAgICBwc3lPdXRDaGFubmVsW2NoXS5tZGN0U3BlY3RydW0sCi0gICAgICAgICAgICAgICAgICAgICAgIHFjT3V0Q2hhbm5lbFtjaF0uZ2xvYmFsR2FpbiwKLSAgICAgICAgICAgICAgICAgICAgICAgcWNPdXRDaGFubmVsW2NoXS5zY2YsCi0gICAgICAgICAgICAgICAgICAgICAgIHFjT3V0Q2hhbm5lbFtjaF0ucXVhbnRTcGVjKTsKLQotICAgICAgaWYgKGNhbGNNYXhWYWx1ZUluU2ZiKHBzeU91dENoYW5uZWxbY2hdLnNmYkNudCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBwc3lPdXRDaGFubmVsW2NoXS5tYXhTZmJQZXJHcm91cCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBwc3lPdXRDaGFubmVsW2NoXS5zZmJQZXJHcm91cCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBwc3lPdXRDaGFubmVsW2NoXS5zZmJPZmZzZXRzLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgIHFjT3V0Q2hhbm5lbFtjaF0ucXVhbnRTcGVjLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgIHFjT3V0Q2hhbm5lbFtjaF0ubWF4VmFsdWVJblNmYikgPiBNQVhfUVVBTlQpIHsKLSAgICAgICAgY29uc3RyYWludHNGdWxmaWxsZWQgPSAwOwotICAgICAgfQotCi0gICAgICBjaER5bkJpdHMgPSBkeW5CaXRDb3VudChxY091dENoYW5uZWxbY2hdLnF1YW50U3BlYywKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHFjT3V0Q2hhbm5lbFtjaF0ubWF4VmFsdWVJblNmYiwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHFjT3V0Q2hhbm5lbFtjaF0uc2NmLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcHN5T3V0Q2hhbm5lbFtjaF0ud2luZG93U2VxdWVuY2UsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwc3lPdXRDaGFubmVsW2NoXS5zZmJDbnQsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwc3lPdXRDaGFubmVsW2NoXS5tYXhTZmJQZXJHcm91cCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBzeU91dENoYW5uZWxbY2hdLnNmYlBlckdyb3VwLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcHN5T3V0Q2hhbm5lbFtjaF0uc2ZiT2Zmc2V0cywKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICZxY091dENoYW5uZWxbY2hdLnNlY3Rpb25EYXRhKTsKLQotICAgICAgaWYgKGNoRHluQml0cyA+PSBtYXhDaER5bkJpdHNbY2hdKSB7Ci0gICAgICAgIGNvbnN0cmFpbnRzRnVsZmlsbGVkID0gMDsKLSAgICAgIH0KLQotICAgICAgaWYgKCFjb25zdHJhaW50c0Z1bGZpbGxlZCkgewotICAgICAgICBxY091dENoYW5uZWxbY2hdLmdsb2JhbEdhaW4gPSBxY091dENoYW5uZWxbY2hdLmdsb2JhbEdhaW4gKyAxOwotICAgICAgfQotCi0gICAgICBpdGVyID0gaXRlciArIDE7Ci0KLSAgICB9IHdoaWxlKCFjb25zdHJhaW50c0Z1bGZpbGxlZCk7Ci0KLSAgICBxY091dEVsZW1lbnQtPmR5bkJpdHNVc2VkID0g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zmc2V0W3NmYk9mZnMrc2ZiKzFdOyBsaW5lKyspIHsKLSAgICAgICAgV29yZDE2IGFic1ZhbDsKLSAgICAgICAgYWJzVmFsID0gYWJzX3MocXVhbnRTcGVjdHJ1bVtsaW5lXSk7Ci0gICAgICAgIG1heFRoaXNTZmIgPSBtYXgobWF4VGhpc1NmYiwgYWJzVmFsKTsKLSAgICAgIH0KLQotICAgICAgbWF4VmFsdWVbc2ZiT2ZmcytzZmJdID0gbWF4VGhpc1NmYjsKLSAgICAgIG1heFZhbHVlQWxsID0gbWF4KG1heFZhbHVlQWxsLCBtYXhUaGlzU2ZiKTsKLSAgICB9Ci0gIH0KLSAgcmV0dXJuIG1heFZhbHVlQWxsOwotfQotCi0KLS8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKLSoKLSogZnVuY3Rpb24gbmFtZTogdXBkYXRlQml0cmVzCi0qIGRlc2NyaXB0aW9uOiB1cGRhdGUgYml0cmVzZXJ2b2lyCi0qCi0qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotdm9pZCB1cGRhdGVCaXRyZXMoUUNfU1RBVEUqIHFjS2VybmVsLAotICAgICAgICAgICAgICAgICAgUUNfT1VUKiAgIHFjT3V0KQotCi17Ci0gIEVMRU1FTlRfQklUUyAqZWxCaXRzOwotCi0gIHFjS2VybmVsLT5iaXRSZXNUb3QgPSAwOwotCi0gIGVsQml0cyA9ICZxY0tlcm5lbC0+ZWxlbWVudEJpdHM7Ci0KLQotICBpZiAoZWxCaXRzLT5hdmVyYWdlQml0cyA+IDApIHsKLSAgICAvKiBjb25zdGFudCBiaXRyYXRlICovCi0gICAgV29yZDE2IGJpdHNVc2VkOwotICAgIGJpdHNVc2VkID0gKHFjT3V0LT5xY0VsZW1lbnQuc3RhdGljQml0c1VzZWQgKyBxY091dC0+cWNFbGVtZW50LmR5bkJpdHNVc2VkKSArCi0gICAgICAgICAgICAgICAgICAgKHFjT3V0LT5xY0VsZW1lbnQuYW5jQml0c1VzZWQgKyBxY091dC0+cWNFbGVtZW50LmZpbGxCaXRzKTsKLSAgICBlbEJpdHMtPmJpdFJlc0xldmVsID0gZWxCaXRzLT5iaXRSZXNMZXZlbCArIChlbEJpdHMtPmF2ZXJhZ2VCaXRzIC0gYml0c1VzZWQpOwotICAgIHFjS2VybmVsLT5iaXRSZXNUb3QgPSBxY0tlcm5lbC0+Yml0UmVzVG90ICsgZWxCaXRzLT5iaXRSZXNMZXZlbDsKLSAgfQotICBlbHNlIHsKLSAgICAvKiB2YXJpYWJsZSBiaXRyYXRlICovCi0gICAgZWxCaXRzLT5iaXRSZXNMZXZlbCA9IGVsQml0cy0+bWF4Qml0czsKLSAgICBxY0tlcm5lbC0+Yml0UmVzVG90ID0gcWNLZXJuZWwtPm1heEJpdHNUb3Q7Ci0gIH0KLX0KLQotLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgotKgotKiBmdW5jdGlvbiBuYW1lOiBGaW5hbGl6ZUJpdENvbnN1bXB0aW9uCi0qIGRlc2NyaXB0aW9uOiBjb3VudCBiaXRzIHVzZWQKLSoKLSoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi1Xb3JkMTYgRmluYWxpemVCaXRDb25zdW1wdGlvbihRQ19TVEFURSAqcWNLZXJuZWwsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICBRQ19PVVQqIHFjT3V0KQotewotICBXb3JkMzIgbkZ1bGxGaWxsRWxlbTsKLSAgV29yZDMyIHRvdEZpbGxCaXRzOwotICBXb3JkMTYgZGlmZkJpdHM7Ci0gIFdvcmQxNiBiaXRzVXNlZDs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KyBxY091dC0+YWxpZ25CaXRzOwotCi0gIGlmIChiaXRzVXNlZCA+IHFjS2VybmVsLT5tYXhCaXRzVG90KSB7Ci0gICAgcmV0dXJuIC0xOwotICB9Ci0gIHJldHVybiBiaXRzVXNlZDsKLX0KLQotCi0vKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCi0qCi0qIGZ1bmN0aW9uIG5hbWU6IEFkanVzdEJpdHJhdGUKLSogZGVzY3JpcHRpb246ICBhZGp1c3RzIGZyYW1lbGVuZ3RoIHZpYSBwYWRkaW5nIG9uIGEgZnJhbWUgdG8gZnJhbWUgYmFzaXMsCi0qICAgICAgICAgICAgICAgdG8gYWNoaWV2ZSBhIGJpdHJhdGUgdGhhdCBkZW1hbmRzIGEgbm9uIGJ5dGUgYWxpZ25lZAotKiAgICAgICAgICAgICAgIGZyYW1lbGVuZ3RoCi0qIHJldHVybjogICAgICAgZXJyb3Jjb2RlCi0qCi0qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotV29yZDE2IEFkanVzdEJpdHJhdGUoUUNfU1RBVEUgICAgICAgICpoUUMsCi0gICAgICAgICAgICAgICAgICAgICBXb3JkMzIgICAgICAgICAgIGJpdFJhdGUsICAgIC8qIHRvdGFsIGJpdHJhdGUgKi8KLSAgICAgICAgICAgICAgICAgICAgIFdvcmQzMiAgICAgICAgICAgc2FtcGxlUmF0ZSkgLyogb3V0cHV0IHNhbXBsaW5nIHJhdGUgKi8KLXsKLSAgV29yZDE2IHBhZGRpbmdPbjsKLSAgV29yZDE2IGZyYW1lTGVuOwotICBXb3JkMTYgY29kZUJpdHM7Ci0gIFdvcmQxNiBjb2RlQml0c0xhc3Q7Ci0KLSAgLyogRG8gd2UgbmVlZCBhIGV4dHJhIHBhZGRpbmcgYnl0ZT8gKi8KLS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5ELCBlaXRoZXIgZXhwcmVzcyBvciBpbXBsaWVkLgotICoqIFNlZSB0aGUgTGljZW5zZSBmb3IgdGhlIHNwZWNpZmljIGxhbmd1YWdlIGdvdmVybmluZyBwZXJtaXNzaW9ucyBhbmQKLSAqKiBsaW1pdGF0aW9ucyB1bmRlciB0aGUgTGljZW5zZS4KLSAqLwotLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKLQlGaWxlOgkJcXVhbnRpemUuYwotCi0JQ29udGVudDoJcXVhbnRpemF0aW9uIGZ1bmN0aW9ucwotCi0qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotCi0jaW5jbHVkZSAidHlwZWRlZi5oIgotI2luY2x1ZGUgImJhc2ljX29wLmgiCi0jaW5jbHVkZSAib3Blcl8zMmIuaCIKLSNpbmNsdWRlICJxdWFudGl6ZS5oIgotI2luY2x1ZGUgImFhY19yb20uaCIKLQotI2RlZmluZSBNQU5UX0RJR0lUUyA5Ci0jZGVmaW5lIE1BTlRfU0laRSAgICgxPDxNQU5UX0RJR0lUUykKLQotc3RhdGljIGNvbnN0IFdvcmQzMiBYUk9VTkQgPSAweDMzZTQyNWFmOyAvKiBmaW5hbCByb3VuZGluZyBjb25zdGFudCAoLTAuMDk0NmYrIDAuNWYpICovCi0KLQotLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCi0qCi0qIGZ1bmN0aW9uIG5hbWU6cG93MzQKLSogZGVzY3JpcHRpb246IGNhbGN1bGF0ZSAkeF57XGZyYWN7M317NH19LCBmb3IgMC41IDwgeCA8IDEuMCQuCi0qCi0qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKio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HNhU2hmdDsKLQotICAgICAgICBzYSA9IExfYWJzKG1kY3RTcGVMKTsKLSAgICAgICAgc2FTaGZ0ID0gc2EgPDwgZzsKLQotICAgICAgICBpZiAoc2FTaGZ0ID4gcHF1YXRbMF0pIHsKLQotICAgICAgICAgIGlmIChzYVNoZnQgPCBwcXVhdFsxXSkgewotCi0gICAgICAgICAgICBxdWEgPSBtZGN0U3BlTD4wID8gMSA6IC0xOwotCQkgIH0KLSAgICAgICAgICBlbHNlIHsKLQotICAgICAgICAgICAgaWYgKHNhU2hmdCA8IHBxdWF0WzJdKSB7Ci0KLSAgICAgICAgICAgICAgcXVhID0gbWRjdFNwZUw+MCA/IDIgOiAtMjsKLQkJCX0KLSAgICAgICAgICAgIGVsc2UgewotCi0gICAgICAgICAgICAgIGlmIChzYVNoZnQgPCBwcXVhdFszXSkgewotCi0gICAgICAgICAgICAgICAgcXVhID0gbWRjdFNwZUw+MCA/IDMgOiAtMzsKLQkJCSAgfQotICAgICAgICAgICAgICBlbHNlIHsKLSAgICAgICAgICAgICAgICBxdWEgPSBxdWFudGl6ZVNpbmdsZUxpbmUoZ2Fpbiwgc2EpOwotICAgICAgICAgICAgICAgIC8qIGFkanVzdCB0aGUgc2lnbi4gU2luY2UgMCA8IHF1YSA8IDEsIHRoaXMgY2Fubm90IG92ZXJmbG93LiAqLwotCi0gICAgICAgICAgICAgICAgaWYgKG1kY3RTcGVMIDwgMCkKLSAgICAgICAgICAgICAgICAgIHF1YSA9IC1xdWE7Ci0JCQkgIH0KLQkJCX0KLQkJICB9Ci0JCX0KLQkgIH0KLSAgICAgIHF1YVNwZWN0cnVtW2xpbmVdID0gcXVhIDsKLQl9Ci0gIH0KLQotfQotCi0KLS8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgotKgotKiBmdW5jdGlvbiBuYW1lOmlxdWFudGl6ZUxpbmVzCi0qIGRlc2NyaXB0aW9uOiBpcXVhbnRpemVzIHNwZWN0cnVtIGxpbmVzIHdpdGhvdXQgc2lnbgotKiAgICAgICAgICAgICAgbWRjdFNwZWN0cnVtID0gaXF1YVNwZWN0cnVtXjQvMyAqMl4oMC4yNSpnYWluKQotKiBpbnB1dDogZ2xvYmFsIGdhaW4sIG51bWJlciBvZiBsaW5lcyB0byBwcm9jZXNzLHF1YW50aXplZCBzcGVjdHJ1bQotKiBvdXRwdXQ6IHNwZWN0cmFsIGRhdGEKLSoKLSoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotc3RhdGljIHZvaWQgaXF1YW50aXplTGluZXMoY29uc3QgV29yZDE2IGdhaW4sCi0gICAgICAgICAgICAgICAgICAgICAgICAgICBjb25zdCBXb3JkMTYgbm9PZkxpbmVzLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgY29uc3QgV29yZDE2ICpxdWFudFNwZWN0cnVtLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgV29yZDMyICptZGN0U3BlY3RydW0pCi17Ci0gIFdvcmQzMiAgIGlxdWFudGl6ZXJtb2Q7Ci0gIFdvcmQzMiAgIGlxdWFudGl6ZXJzaGlmdDsKLSAgV29yZDMyICAgbGluZTsKLQotICBpcXVhbnRpemVybW9kID0gZ2FpbiAmIDM7Ci0gIGlxdWFudGl6ZXJzaGlmdCA9IGdhaW4gPj4gMjsKLQotICBmb3IgKGxpbmU9MDsgbGluZTxub09mTGluZXM7IGxpbmUrKykgewotCi0gICAgaWYoIHF1YW50U3BlY3RydW1bbGluZV0gIT0gMCApIHsKLSAgICAgIFdvcmQzMiBhY2N1OwotICAgICAgV29yZDMyIGV4OwotCSAgV29yZDMyIHRhYkluZGV4OwotICAgICAgV29yZDMyIHNwZWNFeHA7Ci0gICAgICBXb3JkMzIgcyx0OwotCi0gICAgICBhY2N1ID0gcXVhbnRTcGVjdHJ1bVtsaW5lXTsKLQotICAgICA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KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKLSoKLSogZnVuY3Rpb24gbmFtZTogUXVhbnRpemVTcGVjdHJ1bQotKiBkZXNjcmlwdGlvbjogcXVhbnRpemVzIHRoZSBlbnRpcmUgc3BlY3RydW0KLSogcmV0dXJuczoKLSogaW5wdXQ6IG51bWJlciBvZiBzY2FsZWZhY3RvciBiYW5kcyB0byBiZSBxdWFudGl6ZWQsIC4uLgotKiBvdXRwdXQ6IHF1YW50aXplZCBzcGVjdHJ1bQotKgotKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi12b2lkIFF1YW50aXplU3BlY3RydW0oV29yZDE2IHNmYkNudCwKLSAgICAgICAgICAgICAgICAgICAgICBXb3JkMTYgbWF4U2ZiUGVyR3JvdXAsCi0gICAgICAgICAgICAgICAgICAgICAgV29yZDE2IHNmYlBlckdyb3VwLAotICAgICAgICAgICAgICAgICAgICAgIFdvcmQxNiAqc2ZiT2Zmc2V0LAotICAgICAgICAgICAgICAgICAgICAgIFdvcmQzMiAqbWRjdFNwZWN0cnVtLAotICAgICAgICAgICAgICAgICAgICAgIFdvcmQxNiBnbG9iYWxHYWluLAotICAgICAgICAgICAgICAgICAgICAgIFdvcmQxNiAqc2NhbGVmYWN0b3JzLAotICAgICAgICAgICAgICAgICAgICAgIFdvcmQxNiAqcXVhbnRpemVkU3BlY3RydW0pCi17Ci0gIFdvcmQzMiBzZmJPZmZzLCBzZmI7Ci0KLSAgZm9yKHNmYk9mZnM9MDtzZmJPZmZzPHNmYkNudDtzZmJPZmZzKz1zZmJQZXJHcm91cCkgewotICAgIFdvcmQzMiBzZmJOZXh0IDsKLSAgICBmb3IgKHNmYiA9IDA7IHNmYiA8IG1heFNmYlBlckdyb3VwOyBzZmIgPSBzZmJOZXh0KSB7Ci0gICAgICBXb3JkMTYgc2NhbGVmYWN0b3IgPSBzY2FsZWZhY3RvcnNbc2ZiT2ZmcytzZmJdOwotICAgICAgLyogY29hbGVzY2Ugc2ZicyB3aXRoIHRoZSBzYW1lIHNjYWxlZmFjdG9yICovCi0gICAgICBmb3IgKHNmYk5leHQgPSBzZmIrMTsKLSAgICAgICAgICAgc2ZiTmV4dCA8IG1heFNmYlBlckdyb3VwICYmIHNjYWxlZmFjdG9yID09IHNjYWxlZmFjdG9yc1tzZmJPZmZzK3NmYk5leHRdOwotICAgICAgICAgICBzZmJOZXh0KyspIDsKLQotICAgICAgcXVhbnRpemVMaW5lcyhnbG9iYWxHYWluIC0gc2NhbGVmYWN0b3IsCi0gICAgICAgICAgICAgICAgICAgIHNmYk9mZnNldFtzZmJPZmZzK3NmYk5leHRdIC0gc2ZiT2Zmc2V0W3NmYk9mZnMrc2ZiXSwKLSAgICAgICAgICAgICAgICAgICAgbWRjdFNwZWN0cnVtICsgc2ZiT2Zmc2V0W3NmYk9mZnMrc2ZiXSwKLSAgICAgICAgICAgICAgICAgICAgcXVhbnRpemVkU3BlY3RydW0gKyBzZmJPZmZzZXRbc2ZiT2ZmcytzZmJdKTsKLSAgICB9Ci0gIH0KLX0KLQotCi0vKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKLSoKLSogZnVuY3Rpb24gbmFtZTpjYWxjU2ZiRGlzdAotKiBkZXNjcmlwdGlvbjogcXVhbnRpemVzIGFuZCByZXF1YW50aXplcyBsaW5lcyB0byBjYWxjdWxhdGUgZGlzdG9ydGlvbgotKiBpbnB1dDogIG51bWJlciBvZiBsaW5lcyB0byBiZSBxdWFudGl6ZWQsIC4uLgotKiBvdXRwdXQ6IGRpc3RvcnRpb24KLSoKLSoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotV29yZDMyIGNhbGNTZmJEaXN0KGNv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0YWluIGEgY29weSBvZiB0aGUgTGljZW5zZSBhdAotICoqCi0gKiogICAgIGh0dHA6Ly93d3cuYXBhY2hlLm9yZy9saWNlbnNlcy9MSUNFTlNFLTIuMAotICoqCi0gKiogVW5sZXNzIHJlcXVpcmVkIGJ5IGFwcGxpY2FibGUgbGF3IG9yIGFncmVlZCB0byBpbiB3cml0aW5nLCBzb2Z0d2FyZQotICoqIGRpc3RyaWJ1dGVkIHVuZGVyIHRoZSBMaWNlbnNlIGlzIGRpc3RyaWJ1dGVkIG9uIGFuICJBUyBJUyIgQkFTSVMsCi0gKiogV0lUSE9VVCBXQVJSQU5USUVTIE9SIENPTkRJVElPTlMgT0YgQU5ZIEtJTkQsIGVpdGhlciBleHByZXNzIG9yIGltcGxpZWQuCi0gKiogU2VlIHRoZSBMaWNlbnNlIGZvciB0aGUgc3BlY2lmaWMgbGFuZ3VhZ2UgZ292ZXJuaW5nIHBlcm1pc3Npb25zIGFuZAotICoqIGxpbWl0YXRpb25zIHVuZGVyIHRoZSBMaWNlbnNlLgotICovCi0vKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgotCUZpbGU6CQlzZl9lc3RpbS5jCi0KLQlDb250ZW50OglTY2FsZSBmYWN0b3IgZXN0aW1hdGlvbiBmdW5jdGlvbnMKLQotKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLQotI2luY2x1ZGUgImJhc2ljX29wLmgiCi0jaW5jbHVkZSAib3Blcl8zMmIuaCIKLSNpbmNsdWRlICJzZl9lc3RpbS5oIgotI2luY2x1ZGUgInF1YW50aXplLmgiCi0jaW5jbHVkZSAiYml0X2NudC5oIgotI2luY2x1ZGUgImFhY19yb20uaCIKLQotc3RhdGljIGNvbnN0IFdvcmQxNiBNQVhfU0NGX0RFTFRBID0gNjA7Ci0KLS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KiBQRV9TQ0FMRSkgPj4gMTQ7Ci0KLQlyZXR1cm4gc2F0dXJhdGUoc3BlY1BlRGlmZik7Ci19Ci0KLQotLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgotKgotKiBmdW5jdGlvbiBuYW1lOiBhc3NpbWlsYXRlU2luZ2xlU2NmCi0qIGRlc2NyaXB0aW9uOiAgc2VhcmNoZWQgZm9yIHNpbmdsZSBzY2FsZWZhY3RvciBiYW5kcywgd2hlcmUgdGhlIG51bWJlciBvZiBiaXRzIGdhaW5lZAotKgkJCQlieSB1c2luZyBhIHNtYWxsZXIgc2NmZ2FpbihuKSBpcyBncmVhdGVyIHRoYW4gdGhlIGVzdGltYXRlZCBpbmNyZWFzZWQKLSoJCQkJYml0IGRlbWFuZAotKgotKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLXN0YXRpYyB2b2lkIGFzc2ltaWxhdGVTaW5nbGVTY2YoUFNZX09VVF9DSEFOTkVMICpwc3lPdXRDaGFuLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBXb3JkMTYgKnNjZiwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgV29yZDE2ICptaW5TY2YsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFdvcmQzMiAqc2ZiRGlzdCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgV29yZDE2ICpzZmJDb25zdFBlUGFydCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgV29yZDE2ICpsb2dTZmJFbmVyZ3ksCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFdvcmQxNiAqbG9nU2ZiRm9ybUZhY3RvciwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgV29yZDE2ICpzZmJO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3VjY2VzcykgewotCQkJLyogc3RhcnQgYWdhaW4gYXQgZmlyc3Qgc2ZiICovCi0JCQlzZmJMYXN0ID0gLTE7Ci0JCQlzZmJBY3QgID0gLTE7Ci0JCQlzZmJOZXh0ID0gLTE7Ci0JCQlzY2ZMYXN0ID0gMDsKLQkJCXNjZk5leHQgPSAwOwotCQkJc2NmTWluICA9IE1BWF8xNjsKLQkJCXN1Y2Nlc3MgPSAwOwotCQl9Ci0JCWVsc2UgewotCQkJLyogc2hpZnQgc2ZicyBmb3IgbmV4dCBiYW5kICovCi0JCQlzZmJMYXN0ID0gc2ZiQWN0OwotCQkJc2ZiQWN0ICA9IHNmYk5leHQ7Ci0JCX0KLQotICB9IHdoaWxlIChzZmJOZXh0IDwgcHN5T3V0Q2hhbi0+c2ZiQ250KTsKLX0KLQotCi0vKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCi0qCi0qIGZ1bmN0aW9uIG5hbWU6IGFzc2ltaWxhdGVNdWx0aXBsZVNjZgotKiBkZXNjcmlwdGlvbjogIHNjYWxlZmFjdG9yIGRpZmZlcmVuY2UgcmVkdWN0aW9uCi0qCi0qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotc3RhdGljIHZvaWQgYXNzaW1pbGF0ZU11bHRpcGxlU2NmKFBTWV9PVVRfQ0hBTk5FTCAqcHN5T3V0Q2hhbiwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBXb3JkMTYgKnNjZiwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBXb3JkMTYgKm1pblNjZiwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBXb3JkMzIgKnNmYkRpc3QsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgV29yZDE2ICpzZmJ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ioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCi0qCi0qIGZ1bmN0aW9uIG5hbWU6IEVzdGltYXRlU2NhbGVGYWN0b3JzQ2hhbm5lbAotKiBkZXNjcmlwdGlvbjogIGVzdGltYXRlIHNjYWxlIGZhY3RvcnMgZm9yIG9uZSBjaGFubmVsCi0qCi0qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotc3RhdGljIHZvaWQKLUVzdGltYXRlU2NhbGVGYWN0b3JzQ2hhbm5lbChQU1lfT1VUX0NIQU5ORUwgKnBzeU91dENoYW4sCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgV29yZDE2ICAgICAgICAgICpzY2YsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgV29yZDE2ICAgICAgICAgICpnbG9iYWxHYWluLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgIFdvcmQxNiAgICAgICAgICAqbG9nU2ZiRW5lcmd5LAotICAgICAgICAgICAgICAgICAgICAgICAgICAgIFdvcmQxNiAgICAgICAgICAqbG9nU2ZiRm9ybUZhY3RvciwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBXb3JkMTYgICAgICAgICAgKnNmYk5SZWxldmFudExpbmVzKQotewotCVdvcmQzMiBpLCBqOwotCVdvcmQzMiB0aHJlc2gsIGVuZXJneTsKLQlXb3JkMzIgZW5lcmd5UGFydCwgdGhyZXNob2xkUGFydDsKLQlXb3JkMzIgc2NmSW50LCBtaW5TY2YsIG1heFNjZiwgbWF4QWxsb3dlZFNjZiwgbGFzdFNmOwotCVdvcmQzMiBtYXhTcGVjOwotCVdvcmQzMiAqc2ZiRGlzdCA9IHBzeU91dENoYW4tPnNmYkRpc3Q7Ci0JV29yZDE2ICptaW5TZk1heFF1YW50ID0gcHN5T3V0Q2hhbi0+bWluU2ZNY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3JtRmFjdG9yCi0qIGRlc2NyaXB0aW9uOiAgZXN0aW1hdGUgRm9ybSBmYWN0b3JzIGZvciBhbGwgY2hhbm5lbAotKgotKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLXZvaWQKLUNhbGNGb3JtRmFjdG9yKFdvcmQxNiBsb2dTZmJGb3JtRmFjdG9yW01BWF9DSEFOTkVMU11bTUFYX0dST1VQRURfU0ZCXSwKLSAgICAgICAgICAgICAgIFdvcmQxNiBzZmJOUmVsZXZhbnRMaW5lc1tNQVhfQ0hBTk5FTFNdW01BWF9HUk9VUEVEX1NGQl0sCi0gICAgICAgICAgICAgICBXb3JkMTYgbG9nU2ZiRW5lcmd5W01BWF9DSEFOTkVMU11bTUFYX0dST1VQRURfU0ZCXSwKLSAgICAgICAgICAgICAgIFBTWV9PVVRfQ0hBTk5FTCBwc3lPdXRDaGFubmVsW01BWF9DSEFOTkVMU10sCi0gICAgICAgICAgICAgICBjb25zdCBXb3JkMTYgbkNoYW5uZWxzKQotewotCVdvcmQxNiBqOwotCi0JZm9yIChqPTA7IGo8bkNoYW5uZWxzOyBqKyspIHsKLQkJQ2FsY0Zvcm1GYWN0b3JDaGFubmVsKGxvZ1NmYkZvcm1GYWN0b3Jbal0sIHNmYk5SZWxldmFudExpbmVzW2pdLCBsb2dTZmJFbmVyZ3lbal0sICZwc3lPdXRDaGFubmVsW2pdKTsKLQl9Ci19Ci0KLS8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKLSoKLSogZnVuY3Rpb24gbmFtZTogRXN0aW1hdGVTY2FsZUZhY3RvcnMKLSogZGVzY3JpcHRpb246ICBlc3RpbWF0ZSBzY2FsZSBmYWN0b3JzIGZvciBhbGwgY2hhbm5lbAotKgotKioqKioqKioqKioqKioqKioqKioqKioqKioq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uCi0gKi8KLS8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCi0JRmlsZToJCXNwcmVhZGluZy5jCi0KLQlDb250ZW50OglTcHJlYWRpbmcgb2YgZW5lcmd5IGZ1bmN0aW9uCi0KLSoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0KLSNpbmNsdWRlICJiYXNpY19vcC5oIgotI2luY2x1ZGUgIm9wZXJfMzJiLmgiCi0jaW5jbHVkZSAic3ByZWFkaW5nLmgiCi0KLS8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKLSoKLSogZnVuY3Rpb24gbmFtZTogU3ByZWFkaW5nTWF4Ci0qIGRlc2NyaXB0aW9uOiAgc3ByZWFkaW5nIHRoZSBlbmVyZ3kKLSoJCQkJIGhpZ2hlciBmcmVxdWVuY2llcyB0aHIobikgPSBtYXgodGhyKG4pLCBzaChuKSp0aHIobi0xKSkKLSoJCQkJIGxvd2VyIGZyZXF1ZW5jaWVzICB0aHIobikgPSBtYXgodGhyKG4pLCBzbChuKSp0aHIobisxKSkKLSoKLSoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi12b2lkIFNwcmVhZGluZ01heChjb25zdCBXb3JkMTYgcGJDbnQsCi0gICAgICAgICAgICAgICAgICBjb25zdCBXb3JkMTYgKm1hc2tMb3dGYWN0b3IsCi0gICAgICAgICAgICAgICAgICBjb25zdCBXb3JkMTYgKm1hc2tIaWdoRmFjdG9yLAotICAgICAgICAgICAgICAgICAgV29yZDMyICAgICAgICpwYlNwcmVhZGVkRW5lcmd5KQotewotICBXb3JkMzIgaTsKLQotICAvK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otICBTSV9GSUxMX0NPVU5UX0JJVFMgICAgICAgID0oNCksCi0gIFNJX0ZJTExfRVNDX0NPVU5UX0JJVFMgICAgPSg4KSwKLSAgU0lfRklMTF9FWFRFTlRJT05fQklUUyAgICA9KDQpLAotICBTSV9GSUxMX05JQkJMRV9CSVRTICAgICAgID0oNCksCi0gIFNJX1NDRV9CSVRTICAgICAgICAgICAgICAgPSg0KSwKLSAgU0lfQ1BFX0JJVFMgICAgICAgICAgICAgICA9KDUpLAotICBTSV9DUEVfTVNfTUFTS19CSVRTICAgICAgID0oMikgLAotICBTSV9JQ1NfSU5GT19CSVRTX0xPTkcgICAgID0oMSsyKzErNisxKSwKLSAgU0lfSUNTX0lORk9fQklUU19TSE9SVCAgICA9KDErMisxKzQrNyksCi0gIFNJX0lDU19CSVRTICAgICAgICAgICAgICAgPSg4KzErMSsxKQotfSBTSV9CSVRTOwotCi0KLS8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKLSoKLSogZnVuY3Rpb24gbmFtZTogY291bnRNc01hc2tCaXRzCi0qIGRlc2NyaXB0aW9uOiAgIGNvdW50IG1zIHN0ZXJlbyBiaXRzIGRlbWFuZAotKgotKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLXN0YXRpYyBXb3JkMTYgY291bnRNc01hc2tCaXRzKFdvcmQxNiAgIHNmYkNudCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFdvcmQxNiAgIHNmYlBlckdyb3VwLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgV29yZDE2ICAgbWF4U2ZiUGVyR3JvdXAsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzdHJ1Y3QgVE9PTFNJTkZPICp0b29sc0luZm8pCi17Ci0gIFdvcmQxNiBtc0JpdHMsIHNmYk9mZiwgc2ZiOwotICBtc0JpdHMgPSAwOwotCi0KLSAgc3dpdGNoKHRvb2xzSW5mby0+bXNEaWdlc3QpIHsKLSAgICBjYXNlIE1TX05PTkU6Ci0gICAgY2FzZSBNU19BTEw6Ci0gICAgICBicmVhazsKLQotICAgIGNhc2UgTVNfU09NRToKLSAgICAgIGZvcihzZmJPZmY9MDsgc2ZiT2ZmPHNmYkNudDsgc2ZiT2ZmKz1zZmJQZXJHcm91cCkKLSAgICAgICAgZm9yKHNmYj0wOyBzZmI8bWF4U2ZiUGVyR3JvdXA7IHNmYisrKQotICAgICAgICAgIG1zQml0cyArPSAxOwotICAgICAgYnJlYWs7Ci0gIH0KLSAgcmV0dXJuKG1zQml0cyk7Ci19Ci0KLS8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKLSoKLSogZnVuY3Rpb24gbmFtZTogdG5zQ291bnQKLSogZGVzY3JpcHRpb246ICAgY291bnQgdG5zIGJpdCBkZW1hbmQgIGNvcmUgZnVuY3Rpb24KLSoKLSoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi1zdGF0aWMgV29yZDE2IHRuc0NvdW50KFROU19JTkZPICp0bnNJbmZvLCBXb3JkMTYgYmxvY2tUeXBlKQotewotCi0gIFdvcmQzMiBpLCBrOwotICBGbGFnIHRuc1ByZXNlbnQ7Ci0gIFdvcmQzMiBudW1PZldpbmRvd3M7Ci0gIFdvcmQzMiBjb3VudDsKLSAgV29yZDMyIGNvZWZCaXRzOwotICBXb3JkMTYgKnB0Y29lZjsKLQotICBjb3VudCA9IDA7Ci0KLSAgaWYgKGJsb2NrVHlwZSA9PSAyKQotICAgIG51bU9mV2luZG93cyA9IDg7Ci0gIGVsc2UKLSAgICBudW1PZldpbmRvd3MgPSAxOwotICB0bnNQcmVzZW50ID0gMDsKLQotICBmb3IgKGk9MDsgaTxudW1PZldpbmRvd3M7IGkrKykgewotCi0gICAgaWYgKHRuc0luZm8tPnRuc0FjdGl2ZVtpXSE9MCkgewotICAgICAgdG5zUHJlc2VudCA9IDE7Ci0gICAgfQotICB9Ci0KLSAgaWYgKHRuc1ByZXNlbnQpIHsKLSAgICAvKiB0aGVyZSBpcyBkYXRhIHRvIGJlIHdyaXR0ZW4qLwotICAgIC8qY291bnQgKz0gMTsgKi8KLSAgICBmb3IgKGk9MDsgaTxudW1PZldpbmRvd3M7IGkrKykgewotCi0gICAgICBpZiAoYmxvY2tUeXBlID09IDIpCi0gICAgICAgIGNvdW50ICs9IDE7Ci0gICAgICBlbHNlCi0gICAgICAgIGNvdW50ICs9IDI7Ci0KLSAgICAgIGlmICh0bnNJbmZvLT50bnNBY3RpdmVbaV0pIHsKLSAgICAgICAgY291bnQgKz0gMTsKLQotICAgICAgICBpZiAoYmxvY2tUeXBlID09IDIpIHsKLSAgICAgICAgICBjb3VudCArPSA0OwotICAgICAgICAgIGNvdW50ICs9IDM7Ci0gICAgICAgIH0KLSAgICAgICAgZWxzZSB7Ci0gICAgICAgICAgY291bnQgKz0gNjsKLSAgICAgICAgICBjb3VudCArPSA1OwotICAgICAgICB9Ci0KLSAgICAgICAgaWYgKHRuc0luZm8tPm9yZGVyW2ldKSB7Ci0gICAgICAgICAgY291bnQgKz0gMTsgLypkaXJlY3Rpb24qLwotICAgICAgICAgIGNvdW50ICs9IDE7IC8qY29lZl9jb21wcmVzc2lvbiAqLwotCi0gICAgICAgICAgaWYgKHRuc0luZm8tPmNvZWZSZXNbaV0gPT0gNCkgewotICAgICAgICAgICAgcHRjb2VmID0gdG5zSW5mby0+Y29lZiArIGkqVE5TX01BWF9PUkRFUl9TSE9SVDsKLQkJCWNvZWZCaXRzID0gMzsKLSAgICAgICAgICAgIGZvcihrPTA7IGs8dG5zSW5mby0+b3JkZXJbaV07IGsrKykgewotCi0gICAgICAgICAgICAgIGlmICgocHRjb2VmW2tdID4gMykgfHwgKHB0Y29lZltrXSA8IC00KSkgewotICAgICAgICAgICAgICAgIGNvZWZCaXRzID0gNDsKLSAgICAgICAgICAgICAgICBicmVhazsKLSAgICAgICAgICAgICAgfQotICAgICAgICAgICAgfQotICAgICAgICAgIH0KLSAgICAgICAgICBlbHNlIHsKLSAgICAgICAgICAgIGNvZWZCaXRzID0gMjsKLSAgICAgICAgICAgIHB0Y29lZiA9IHRuc0luZm8tPmNvZWYgKyBpKlROU19NQVhfT1JERVJfU0hPUlQ7Ci0JCQlmb3Ioaz0wOyBrPHRuc0luZm8tPm9yZGVyW2ldOyBrKyspIHsKLQotICAgICAgICAgICAgICBpZiAoKHB0Y29lZltrXSA+IDEpIHx8IChwdGNvZWZba10gPCAtMikpIHsKLSAgICAgICAgICAgICAgICBjb2VmQml0cyA9IDM7Ci0gICAgICAgICAgICAgICAgYnJlYWs7Ci0gICAgICAgICAgICAgIH0KLSAgICAgICAgICAgIH0KLSAgICAgICAgICB9Ci0gICAgICAgICAgZm9yIChrPTA7IGs8dG5zSW5mby0+b3JkZXJbaV07IGsrKyApIHsKLSAgICAgICAgICAgIGNvdW50ICs9IGNvZWZCaXRzOwotICAgICAgICAgIH0KLSAgICAgICAgfQotICAgICAgfQotICAgIH0KLSAgfQotCi0gIHJldHVybiBjb3VudDsKLX0KLQotLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKLSoKLSogZnVuY3Rpb24gbmFtZTogY291bnRUbnNCaXRzCi0qIGRlc2NyaXB0aW9uOiAgIGNvdW50IHRucyBiaXQgZGVtYW5kCi0qCi0qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotc3RhdGljIFdvcmQxNiBjb3VudFRuc0JpdHMoVE5TX0lORk8gKnRuc0luZm8sV29yZDE2IGJsb2NrVHlwZSkKLXsKLSAgcmV0dXJuKHRuc0NvdW50KHRuc0luZm8sIGJsb2NrVHlwZSkpOwotfQotCi0vKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCi0qCi0qIGZ1bmN0aW9uIG5hbWU6IGNvdW50U3RhdGljQml0ZGVtYW5kCi0qIGRlc2NyaXB0aW9uOiAgIGNvdW50IHN0YXRpYyBiaXQgZGVtYW5kIGluY2x1ZGUgdG5zCi0qCi0qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotV29yZDE2IGNvdW50U3RhdGljQml0ZGVtYW5kKFBTWV9PVVRfQ0hBTk5FTCBwc3lPdXRDaGFubmVsW01BWF9DSEFOTkVMU10sCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgUFNZX09VVF9FTEVNRU5UICpwc3lPdXRFbGVtZW50LAotICAgICAgICAgICAgICAgICAgICAgICAgICAgIFdvcmQxNiBjaGFubmVscywKLQkJCQkJCQlXb3JkMTYgYWR0c1VzZWQpCi17Ci0gIFdvcmQzMiBzdGF0Qml0czsKLSAgV29yZDMyIGNoOwotCi0gIHN0YXRCaXRzID0gMDsKLQotICAvKiBpZiBhZHRzIHVzZWQsIGFkZCA1NiBiaXRzICovCi0gIGlmKGFkdHNVc2VkKSBzdGF0Qml0cyArPSA1NjsKLQotCi0gIHN3aXRjaCAoY2hhbm5lbHMpIHsKLSAgICBjYXNlIDE6Ci0gICAgICBzdGF0Qml0cyArPSBTSV9JRF9CSVRTK1NJX1NDRV9CSVRTK1NJX0lDU19CSVRTOwotICAgICAgc3RhdEJpdHMgKz0gY291bnRUbnNCaXRzKCYocHN5T3V0Q2hhbm5lbFswXS50bnNJbmZvKSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwc3lPdXRD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ZWN0cnVtKGNvbnN0IFdvcmQzMiBzcGVjdHJ1bVtdLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgV29yZDE2IHdlaWdodGVkU3BlY3RydW1bXSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFdvcmQzMiogc2ZiRW5lcmd5LAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY29uc3QgV29yZDE2KiBzZmJPZmZzZXQsIFdvcmQxNiBscGNTdGFydExpbmUsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBXb3JkMTYgbHBjU3RvcExpbmUsIFdvcmQxNiBscGNTdGFydEJhbmQsV29yZDE2IGxwY1N0b3BCYW5kLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgV29yZDMyICpwV29yazMyKTsKLQotCi0KLXZvaWQgQXV0b0NvcnJlbGF0aW9uKGNvbnN0IFdvcmQxNiBpbnB1dFtdLCBXb3JkMzIgY29ycltdLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgIFdvcmQxNiBzYW1wbGVzLCBXb3JkMTYgY29yckNvZWZmKTsKLXN0YXRpYyBXb3JkMTYgQXV0b1RvUGFyY29yKFdvcmQzMiB3b3JrQnVmZmVyW10sIFdvcmQzMiByZWZsQ29lZmZbXSwgV29yZDE2IG51bU9mQ29lZmYpOwotCi1zdGF0aWMgV29yZDE2IENhbGNUbnNGaWx0ZXIoY29uc3QgV29yZDE2KiBzaWduYWwsIGNvbnN0IFdvcmQzMiB3aW5kb3dbXSwgV29yZDE2IG51bU9mTGluZXMsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgV29yZDE2IHRuc09yZGVyLCBXb3JkMzIgcGFyY29yW10pOwotCi0KLXN0YXRpYyB2b2lkIFBhcmNvcjJJbmRleChjb25zdCBXb3JkMzIgcGFyY29yW10sIFdvcmQxNiBpbmRleFtdLCBXb3JkMTYgb3JkZXIsCi0gICAgICAgICAgICAgICAgICAgICAgICAgV29yZDE2IGJpdHNQZXJDb2VmZik7Ci0KLXN0YXRpYyB2b2lkIEluZGV4MlBhcmNvcihjb25zdCBXb3JkMTYgaW5kZXhbXSwgV29yZDMyIHBhcmNvcltdLCBXb3JkMTYgb3JkZXIsCi0gICAgICAgICAgICAgICAgICAgICAgICAgV29yZDE2IGJpdHNQZXJDb2VmZik7Ci0KLQotCi1zdGF0aWMgdm9pZCBBbmFseXNpc0ZpbHRlckxhdHRpY2UoY29uc3QgV29yZDMyIHNpZ25hbFtdLCBXb3JkMTYgbnVtT2ZMaW5lcywKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb25zdCBXb3JkMzIgcGFyQ29lZmZbXSwgV29yZDE2IG9yZGVyLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFdvcmQzMiBvdXRwdXRbXSk7Ci0KLQotLyoqCi0qCi0qIGZ1bmN0aW9uIG5hbWU6IEZyZXFUb0JhbmRXaXRoUm91bmRpbmcKLSogZGVzY3JpcHRpb246ICBSZXRyaWV2ZSBpbmRleCBvZiBuZWFyZXN0IGJhbmQgYm9yZGVyCi0qIHJldHVybnQ6CQlpbmRleAotKgotKi8KLXN0YXRpYyBXb3JkMTYgRnJlcVRvQmFuZFdpdGhSb3VuZGluZyhXb3JkMzIgZnJlcSwgICAgICAgICAgICAgICAgICAgLyohPCBmcmVxdWVuY3kgaW4gSGVydHogKi8KLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBXb3JkMzIgZnMsICAgICAgICAgICAgICAgICAgICAgLyohPCBTYW1wbGluZyBmcmVxdWVuY3kgaW4gSGVydHogKi8KLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBXb3JkMTYgbnVtT2ZCYW5kcywgICAgICAgICAgICAgLyohPCB0b3RhbCBudW1iZXIgb2YgYmFuZHMgKi8KLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb25zdCBXb3JkMTYgK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Mb25nCi0qIGRlc2NyaXB0aW9uOiAgRmlsbCBUTlNfQ09ORklHIHN0cnVjdHVyZSB3aXRoIHNlbnNpYmxlIGNvbnRlbnQgZm9yIGxvbmcgYmxvY2tzCi0qIHJldHVybnM6CQkwIGlmIHN1Y2Nlc3MKLSoKLSovCi1Xb3JkMTYgSW5pdFRuc0NvbmZpZ3VyYXRpb25Mb25nKFdvcmQzMiBiaXRSYXRlLCAgICAgICAgICAvKiE8IGJpdHJhdGUgKi8KLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgV29yZDMyIHNhbXBsZVJhdGUsICAgICAgICAgIC8qITwgU2FtcGxpbmcgZnJlcXVlbmN5ICovCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFdvcmQxNiBjaGFubmVscywgICAgICAgICAgICAvKiE8IG51bWJlciBvZiBjaGFubmVscyAqLwotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBUTlNfQ09ORklHICp0QywgICAgICAgICAgICAgLyohPCBUTlMgQ29uZmlnIHN0cnVjdCAobW9kaWZpZWQpICovCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFBTWV9DT05GSUdVUkFUSU9OX0xPTkcgKnBDLCAvKiE8IHBzeSBjb25maWcgc3RydWN0ICovCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFdvcmQxNiBhY3RpdmUpICAgICAgICAgICAgICAvKiE8IHRucyBhY3RpdmUgZmxhZyAqLwotewotCi0gIFdvcmQzMiBiaXRyYXRlUGVyQ2hhbm5lbDsKLSAgdEMtPm1heE9yZGVyICAgICA9IFROU19NQVhfT1JERVI7Ci0gIHRDLT50bnNTdGFydEZyZXEgPSAxMjc1OwotICB0Qy0+Y29lZlJlcyAgICAgID0gNDsKLQotICAvKiB0byBhdm9pZCBpbnRlZ2VyIGRpdmlzaW9uICovCi0gIGlmICggc3ViKGNoYW5uZWxzLDIpID09IDAgKSB7Ci0gICAgYml0cmF0ZVBlckNoYW5uZWw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dFJhdGUsICAgICAgICAgICAgICAvKiE8IGJpdHJhdGUgKi8KLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFdvcmQzMiBzYW1wbGVSYXRlLCAgICAgICAgICAgLyohPCBTYW1wbGluZyBmcmVxdWVuY3kgKi8KLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFdvcmQxNiBjaGFubmVscywgICAgICAgICAgICAgLyohPCBudW1iZXIgb2YgY2hhbm5lbHMgKi8KLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFROU19DT05GSUcgKnRDLCAgICAgICAgICAgICAgLyohPCBUTlMgQ29uZmlnIHN0cnVjdCAobW9kaWZpZWQpICovCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBQU1lfQ09ORklHVVJBVElPTl9TSE9SVCAqcEMsIC8qITwgcHN5IGNvbmZpZyBzdHJ1Y3QgKi8KLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFdvcmQxNiBhY3RpdmUpICAgICAgICAgICAgICAgLyohPCB0bnMgYWN0aXZlIGZsYWcgKi8KLXsKLSAgV29yZDMyIGJpdHJhdGVQZXJDaGFubmVsOwotICB0Qy0+bWF4T3JkZXIgICAgID0gVE5TX01BWF9PUkRFUl9TSE9SVDsKLSAgdEMtPnRuc1N0YXJ0RnJlcSA9IDI3NTA7Ci0gIHRDLT5jb2VmUmVzICAgICAgPSAzOwotCi0gIC8qIHRvIGF2b2lkIGludGVnZXIgZGl2aXNpb24gKi8KLSAgaWYgKCBzdWIoY2hhbm5lbHMsMikgPT0gMCApIHsKLSAgICBiaXRyYXRlUGVyQ2hhbm5lbCA9IExfc2hyKGJpdFJhdGUsMSk7Ci0gIH0KLSAgZWxzZSB7Ci0gICAgYml0cmF0ZVBlckNoYW5uZWwgPSBiaXRSYXRlOwotICB9Ci0KLSAgdEMtPnRuc01heFNmYiA9IHRuc01heEJhbmRzU2hvcnRNYWluTG93W3BDLT5zYW1wUmF0ZUlkeF07Ci0KLSAgdEMtPnRuc0FjdGl2ZSA9IGFjdGl2ZTsKLQotICAvKiBub3cgY2FsYyBiYW5kIGFuZCBsaW5lIGJvcmRlcnMgKi8KLSAgdEMtPnRuc1N0b3BCYW5kID0gbWluKHBDLT5zZmJDbnQsIHRDLT50bnNNYXhTZmIpOwotICB0Qy0+dG5zU3RvcExpbmUgPSBwQy0+c2ZiT2Zmc2V0W3RDLT50bnNTdG9wQmFuZF07Ci0KLSAgdEMtPnRuc1N0YXJ0QmFuZD1GcmVxVG9CYW5kV2l0aFJvdW5kaW5nKHRDLT50bnNTdGFydEZyZXEsIHNhbXBsZVJhdGUsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwQy0+c2ZiQ250LCAoY29uc3QgV29yZDE2KilwQy0+c2ZiT2Zmc2V0KTsKLQotICB0Qy0+dG5zTW9kaWZ5QmVnaW5DYiA9IEZyZXFUb0JhbmRXaXRoUm91bmRpbmcoVE5TX01PRElGWV9CRUdJTiwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNhbXBsZVJhdGUsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwQy0+c2ZiQ250LAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKGNvbnN0IFdvcmQxNiopcEMtPnNmYk9mZnNldCk7Ci0KLSAgdEMtPnRuc1JhdGlvUGF0Y2hMb3dlc3RDYiA9IEZyZXFUb0JhbmRXaXRoUm91bmRpbmcoUkFUSU9fUEFUQ0hfTE9XRVJfQk9SREVSLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzYW1wbGVSYXRlLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwQy0+c2ZiQ250LAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA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gdG8gc2NyYXRjaCBzcGFjZSAqLwotICAgICAgICAgICAgICAgICBjb25zdCBXb3JkMTYgc2ZiT2Zmc2V0W10sIC8qITwgc2NhbGVmYWN0b3Igc2l6ZSBhbmQgdGFibGUgKi8KLSAgICAgICAgICAgICAgICAgV29yZDMyKiBzcGVjdHJ1bSwgICAgICAgICAvKiE8IHNwZWN0cmFsIGRhdGEgKi8KLSAgICAgICAgICAgICAgICAgV29yZDE2IHN1YkJsb2NrTnVtYmVyLCAgICAvKiE8IHN1YmJsb2NrIG51bSAqLwotICAgICAgICAgICAgICAgICBXb3JkMTYgYmxvY2tUeXBlLCAgICAgICAgIC8qITwgYmxvY2t0eXBlIChsb25nIG9yIHNob3J0KSAqLwotICAgICAgICAgICAgICAgICBXb3JkMzIgKiBzZmJFbmVyZ3kpICAgICAgIC8qITwgc2ZiLXdpc2UgZW5lcmd5ICovCi17Ci0KLSAgV29yZDMyICBwcmVkaWN0aW9uR2FpbjsKLSAgV29yZDMyICB0ZW1wOwotICBXb3JkMzIqIHBXb3JrMzIgPSAmcFNjcmF0Y2hUbnNbc3ViQmxvY2tOdW1iZXIgPj4gOF07Ci0gIFdvcmQxNiogcFdlaWdodGVkU3BlY3RydW0gPSAoV29yZDE2ICopJnBTY3JhdGNoVG5zW3N1YkJsb2NrTnVtYmVyID4+IDhdOwotCi0KLSAgaWYgKHRDLnRuc0FjdGl2ZSkgewotICAgIENhbGNXZWlnaHRlZFNwZWN0cnVtKHNwZWN0cnVtLAotICAgICAgICAgICAgICAgICAgICAgICAgIHBXZWlnaHRlZFNwZWN0cnVtLAotICAgICAgICAgICAgICAgICAgICAgICAgIHNmYkVuZXJneSwKLSAgICAgICAgICAgICAgICAgICAgICAgICBzZmJPZmZzZXQsCi0gICAgICAgICAgICAgICAgICAgICAgICAgdEMubHBjU3RhcnRMaW5lLAotICAgICAgICAgICAgICAgICAgICAgICAgIHRDLmxwY1N0b3BMaW5lLAotICAgICAgICAgICAgICAgICAgICAgICAgIHRDLmxwY1N0YXJ0QmFuZCwKLSAgICAgICAgICAgICAgICAgICAgICAgICB0Qy5scGNTdG9wQmFuZCwKLSAgICAgICAgICAgICAgICAgICAgICAgICBwV29yazMyKTsKLQotICAgIHRlbXAgPSBibG9ja1R5cGUgLSBTSE9SVF9XSU5ET1c7Ci0gICAgaWYgKCB0ZW1wICE9IDAgKSB7Ci0gICAgICAgIHByZWRpY3Rpb25HYWluID0gQ2FsY1Ruc0ZpbHRlciggJnBXZWlnaHRlZFNwZWN0cnVtW3RDLmxwY1N0YXJ0TGluZV0sCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdEMuYWNmV2luZG93LAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRDLmxwY1N0b3BMaW5lIC0gdEMubHBjU3RhcnRMaW5lLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRDLm1heE9yZGVyLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRuc0RhdGEtPmRhdGFSYXcudG5zTG9uZy5zdWJCbG9ja0luZm8ucGFyY29yKTsKLQotCi0gICAgICAgIHRlbXAgPSBwcmVkaWN0aW9uR2FpbiAtIHRDLnRocmVzaG9sZDsKLSAgICAgICAgaWYgKCB0ZW1wID4gMCApIHsKLSAgICAgICAgICB0bnNEYXRhLT5kYXRhUmF3LnRuc0xvbmcuc3ViQmxvY2tJbmZvLnRuc0FjdGl2ZSA9IDE7Ci0gICAgICAgIH0KLSAgICAgICAgZWxzZSB7Ci0gICAgICAgICAgdG5zRGF0YS0+ZGF0YVJhdy50bnNMb25nLnN1YkJsb2NrSW5mby50bnNBY3RpdmUgPSAwOwotICAgICAgICB9Ci0KLSAgICAgICAgdG5zRGF0YS0+ZGF0YVJhdy50bnNMb25nLnN1YkJsb2NrSW5mby5wcmVkaWN0aW9uR2FpbiA9IHByZWRpY3Rpb25HYWluOwotICAgIH0KLSAgICBlbHNlewotCi0gICAgICAgIHByZWRpY3Rpb25HYWluID0gQ2FsY1Ruc0ZpbHRlciggJnBXZWlnaHRlZFNwZWN0cnVtW3RDLmxwY1N0YXJ0TGluZV0sCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdEMuYWNmV2luZG93LAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRDLmxwY1N0b3BMaW5lIC0gdEMubHBjU3RhcnRMaW5lLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRDLm1heE9yZGVyLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRuc0RhdGEtPmRhdGFSYXcudG5zU2hvcnQuc3ViQmxvY2tJbmZvW3N1YkJsb2NrTnVtYmVyXS5wYXJjb3IpOwotCi0gICAgICAgIHRlbXAgPSBwcmVkaWN0aW9uR2FpbiAtIHRDLnRocmVzaG9sZDsKLSAgICAgICAgaWYgKCB0ZW1wID4gMCApIHsKLSAgICAgICAgICB0bnNEYXRhLT5kYXRhUmF3LnRuc1Nob3J0LnN1YkJsb2NrSW5mb1tzdWJCbG9ja051bWJlcl0udG5zQWN0aXZlID0gMTsKLSAgICAgICAgfQotICAgICAgICBlbHNlIHsKLSAgICAgICAgICB0bnNEYXRhLT5kYXRhUmF3LnRuc1Nob3J0LnN1YkJsb2NrSW5mb1tzdWJCbG9ja051bWJlcl0udG5zQWN0aXZlID0gMDsKLSAgICAgICAgfQotCi0gICAgICAgIHRuc0RhdGEtPmRhdGFSYXcudG5zU2hvcnQuc3ViQmxvY2tJbmZvW3N1YkJsb2NrTnVtYmVyXS5wcmVkaWN0aW9uR2FpbiA9IHByZWRpY3Rpb25HYWluOwotICAgIH0KLQotICB9Ci0gIGVsc2V7Ci0KLSAgICB0ZW1wID0gYmxvY2tUeXBlIC0gU0hPUlRfV0lORE9XOwotICAgIGlmICggdGVtcCAhPSAwICkgewotICAgICAgICB0bnNEYXRhLT5kYXRhUmF3LnRuc0xvbmcuc3ViQmxvY2tJbmZvLnRuc0FjdGl2ZSA9IDA7Ci0gICAgICAgIHRuc0RhdGEtPmRhdGFSYXcudG5zTG9uZy5zdWJCbG9ja0luZm8ucHJlZGljdGlvbkdhaW4gPSAwOwotICAgIH0KLSAgICBlbHNlIHsKLSAgICAgICAgdG5zRGF0YS0+ZGF0YVJhdy50bnNTaG9ydC5zdWJCbG9ja0luZm9bc3ViQmxvY2tOdW1iZXJdLnRuc0FjdGl2ZSA9IDA7Ci0gICAgICAgIHRuc0RhdGEtPmRhdGFSYXcudG5zU2hvcnQuc3ViQmxvY2tJbmZvW3N1YkJsb2NrTnVtYmVyXS5wcmVkaWN0aW9uR2FpbiA9IDA7Ci0gICAgfQotICB9Ci0KLSAgcmV0dXJuKDApOwotfQotCi0KLS8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgotKgotKiBmdW5jdGlvbiBuYW1lOiBUbnNTeW5jCi0qIGRlc2NyaXB0aW9uOiB1cGRhdGUgdG5zIHBhcmFtZXRlcgotKgotKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi12b2lkIFRuc1N5bmMoVE5TX0RBVEEgKnRuc0RhdGFEZXN0LAotICAgICAgICAgICAgIGNvbnN0IFROU19EQVRBICp0bnNEYXRhU3JjLAotICAgICAgICAgICAgIGNvbnN0IFROU19DT05GSUcgdEMsCi0gICAgICAgICAgICAgY29uc3QgV29yZDE2IHN1YkJsb2NrTnVtYmVyLAotICAgICAgICAgICAgIGNvbnN0IFdvcmQxNiBibG9ja1R5cGUpCi17Ci0gICBUTlNfU1VCQkxPQ0tfSU5GTyAqc2JJbmZvRGVzdDsKLSAgIGNvbnN0IFROU19TVUJCTE9DS19JTkZPICpzYkluZm9TcmM7Ci0gICBXb3JkMzIgaSwgdGVtcDsKLQotICA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NjZXNzCi0qCi0qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLVdvcmQxNiBUbnNFbmNvZGUoVE5TX0lORk8qIHRuc0luZm8sICAgICAvKiE8IHRucyBpbmZvIHN0cnVjdHVyZSAobW9kaWZpZWQpICovCi0gICAgICAgICAgICAgICAgIFROU19EQVRBKiB0bnNEYXRhLCAgICAgLyohPCB0bnMgZGF0YSBzdHJ1Y3R1cmUgKG1vZGlmaWVkKSAqLwotICAgICAgICAgICAgICAgICBXb3JkMTYgbnVtT2ZTZmIsICAgICAgIC8qITwgbnVtYmVyIG9mIHNjYWxlIGZhY3RvciBiYW5kcyAqLwotICAgICAgICAgICAgICAgICBUTlNfQ09ORklHIHRDLCAgICAgICAgIC8qITwgdG5zIGNvbmZpZyBzdHJ1Y3R1cmUgKi8KLSAgICAgICAgICAgICAgICAgV29yZDE2IGxvd1Bhc3NMaW5lLCAgICAvKiE8IGxvd3Bhc3MgbGluZSAqLwotICAgICAgICAgICAgICAgICBXb3JkMzIqIHNwZWN0cnVtLCAgICAgIC8qITwgc3BlY3RyYWwgZGF0YSAobW9kaWZpZWQpICovCi0gICAgICAgICAgICAgICAgIFdvcmQxNiBzdWJCbG9ja051bWJlciwgLyohPCBzdWJibG9jayBudW0gKi8KLSAgICAgICAgICAgICAgICAgV29yZDE2IGJsb2NrVHlwZSkgICAgICAvKiE8IGJsb2NrdHlwZSAobG9uZyBvciBzaG9ydCkgKi8KLXsKLSAgV29yZDMyIGk7Ci0gIFdvcmQzMiB0ZW1wX3M7Ci0gIFdvcmQzMiB0ZW1wOwotICBUTlNfU1VCQkxPQ0tfSU5GTyAqcHN1YkJsb2NrSW5mbzsKLQotICB0ZW1wX3MgPSBibG9ja1R5cGUgLSBTSE9SVF9XSU5ET1c7Ci0gIGlmICggdGVtcF9zICE9IDApIHsKLSAgICBwc3ViQmxvY2tJbmZvID0gJnRuc0RhdG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Wx0ZXJMYXR0aWNlKCYoc3BlY3RydW1bdEMudG5zU3RhcnRMaW5lXSksICh0Qy50bnNTdG9wTGluZSAtIHRDLnRuc1N0YXJ0TGluZSksCi0gICAgICAgICAgICAgICAgIHBzdWJCbG9ja0luZm8tPnBhcmNvciwKLSAgICAgICAgICAgICAgICAgdG5zSW5mby0+b3JkZXJbc3ViQmxvY2tOdW1iZXJdLAotICAgICAgICAgICAgICAgICAmKHNwZWN0cnVtW3RDLnRuc1N0YXJ0TGluZV0pKTsKLQotICAgIH0KLSAgfQotCi0gIHJldHVybigwKTsKLX0KLQotCi0vKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKLSoKLSogZnVuY3Rpb24gbmFtZTogbV9wb3cyX2NvcmRpYwotKiBkZXNjcmlwdGlvbjogSXRlcmF0aXZlIHBvd2VyIGZ1bmN0aW9uCi0qCi0qCUNhbGN1bGF0ZXMgcG93KDIuMCx4LTEuMCooc2NhbGUrMSkpIHdpdGggSU5UX0JJVFMgYml0IHByZWNpc2lvbgotKgl1c2luZyBtb2RpZmllZCBjb3JkaWMgYWxnb3JpdGhtCi0qIHJldHVybnM6ICAgICB0aGUgcmVzdWx0IG9mIHBvdzIKLSoKLSoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotc3RhdGljIFdvcmQzMiBtX3BvdzJfY29yZGljKFdvcmQzMiB4LCBXb3JkMTYgc2NhbGUpCi17Ci0gIFdvcmQzMiBrOwotCi0gIFdvcmQzMiBhY2N1X3kgPSAweDQwMDAwMDAwOwotICBhY2N1X3kgPSBMX3NocihhY2N1X3ksc2NhbGUpOwotCi0gIGZvcihrPTE7IGs8SU5UX0JJVFM7IGsrKykgewotICAgIGNvbnN0IFdvcmQzMiB6ID0gbV9sb2cyX3RhYmxlW2tdOwotCi0gICAgd2hpbGUoTF9zdWIoeCx6KSA+PSAwKSB7Ci0KLSAgICAgIHggPSBMX3N1Yih4LCB6KTsKLSAgICAgIGFjY3VfeSA9IExfYWRkKGFjY3VfeSwgKGFjY3VfeSA+PiBrKSk7Ci0gICAgfQotICB9Ci0gIHJldHVybihhY2N1X3kpOwotfQotCi0KLS8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgotKgotKiBmdW5jdGlvbiBuYW1lOiBDYWxjV2VpZ2h0ZWRTcGVjdHJ1bQotKiBkZXNjcmlwdGlvbjogQ2FsY3VsYXRlIHdlaWdodGVkIHNwZWN0cnVtIGZvciBMUEMgY2FsY3VsYXRpb24KLSoKLSoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotc3RhdGljIHZvaWQgQ2FsY1dlaWdodGVkU3BlY3RydW0oY29uc3QgV29yZDMyICBzcGVjdHJ1bVtdLCAgICAgICAgIC8qITwgaW5wdXQgc3BlY3RydW0gKi8KLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFdvcmQxNiAgICAgICAgd2VpZ2h0ZWRTcGVjdHJ1bVtdLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgV29yZDMyICAgICAgICpzZmJFbmVyZ3ksICAgICAgICAgIC8qITwgc2ZiIGVuZXJnaWVzICovCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb25zdCBXb3JkMTYgKnNmYk9mZnNldCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFdvcmQxNiAgICAgICAgbHBjU3RhcnRMaW5lLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgV29yZDE2ICAgICAgICBscGNTdG9wTGluZSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFdvcmQxNiAgICAgICAgbHBjU3Rhc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BiZSBsYXJnZXIgdGhhbiB0bnNPcmRlciAhISoKLSoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLQotc3RhdGljIFdvcmQxNiBDYWxjVG5zRmlsdGVyKGNvbnN0IFdvcmQxNiAqc2lnbmFsLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbnN0IFdvcmQzMiB3aW5kb3dbXSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBXb3JkMTYgbnVtT2ZMaW5lcywKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBXb3JkMTYgdG5zT3JkZXIsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgV29yZDMyIHBhcmNvcltdKQotewotICBXb3JkMzIgcGFyY29yV29ya0J1ZmZlclsyKlROU19NQVhfT1JERVIrMV07Ci0gIFdvcmQzMiBwcmVkaWN0aW9uR2FpbjsKLSAgV29yZDMyIGk7Ci0gIFdvcmQzMiB0bnNPcmRlclBsdXMxID0gdG5zT3JkZXIgKyAxOwotCi0gIGFzc2VydCh0bnNPcmRlciA8PSBUTlNfTUFYX09SREVSKTsgICAgICAvKiByZW1vdmUgYXNzZXJ0cyBsYXRlcj8gKGJ0ZykgKi8KLQotICBmb3IoaT0wO2k8dG5zT3JkZXI7aSsrKSB7Ci0gICAgcGFyY29yW2ldID0gMDsKLSAgfQotCi0gIEF1dG9Db3JyZWxhdGlvbihzaWduYWwsIHBhcmNvcldvcmtCdWZmZXIsIG51bU9mTGluZXMsIHRuc09yZGVyUGx1czEpOwotCi0gIC8qIGVhcmx5IHJldHVybiBpZiBzaWduYWwgaXMgdmVyeSBsb3c6IHNpZ25hbCBwcmVkaWN0aW9uIG9mZiwgd2l0aCB6ZXJvIHBhcmNvciBjb2VmZnMgKi8KLSAgaWYgKHBhcmNvcldvcmtCdWZmZXJbMF0gPT0gMCkKLSAgICByZXR1cm4gMDsKLQotICBwcmVkaWN0aW9uR2FpbiA9IEF1dG9Ub1BhcmNvcihwYXJjb3JXb3JrQnVmZmVyLCBwYXJjb3IsIHRuc09yZGVyKTsKLQotICByZXR1cm4ocHJlZGljdGlvbkdhaW4pOwotfQotCi0vKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKLSoKLSogZnVuY3Rpb24gbmFtZTogQXV0b0NvcnJlbGF0aW9uCi0qIGRlc2NyaXB0aW9uOiAgY2FsYy4gYXV0b2NvcnJlbGF0aW9uIChhY2YpCi0qIHJldHVybnM6ICAgICAgLQotKiBpbnB1dDogICAgICAgIGlucHV0IHZhbHVlcywgbm8uIG9mIGlucHV0IHZhbHVlcywgbm8uIG9mIGFjZiB2YWx1ZXMKLSogb3V0cHV0OiAgICAgICBhY2YgdmFsdWVzCi0qCi0qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLSNpZm5kZWYgQVJNVjVFCi12b2lkIEF1dG9Db3JyZWxhdGlvbihjb25zdCBXb3JkMTYJCSBpbnB1dFtdLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgIFdvcmQzMiAgICAgICBjb3JyW10sCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgV29yZDE2ICAgICAgIHNhbXBsZXMsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgV29yZDE2ICAgICAgIGNvcnJDb2VmZikgewotICBXb3JkMzIgaSwgaiwgaXNhbXBsZXM7Ci0gIFdvcmQzMiBhY2N1OwotICBXb3JkMzIgc2NmOwotCi0gIHNjZiA9IDEwIC0gMTsKLQotICBpc2FtcGxlcyA9IHNhbXBsZXM7Ci0gIC8qIGNhbGMgZmlyc3QgY29yckNvZWY6ICBSWzBdID0gc3VtIHsgdFtpXSAqIHRbaV0gfSA7IGkgPSAwLi5OLTEgKi8KLSAgYWNjdSA9IDA7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pCi17Ci0gIFdvcmQzMiBpbmRleCA9IDA7Ci0gIFdvcmQzMiBpOwotICBXb3JkMzIgdGVtcDsKLQotICBmb3IgKGk9MDtpPDg7aSsrKSB7Ci0gICAgdGVtcCA9IExfc3ViKCBwYXJjb3IsIHRuc0NvZWZmM0JvcmRlcnNbaV0pOwotICAgIGlmICh0ZW1wID4gMCkKLSAgICAgIGluZGV4PWk7Ci0gIH0KLSAgcmV0dXJuIGV4dHJhY3RfbChpbmRleCAtIDQpOwotfQotCi1zdGF0aWMgV29yZDE2IFNlYXJjaDQoV29yZDMyIHBhcmNvcikKLXsKLSAgV29yZDMyIGluZGV4ID0gMDsKLSAgV29yZDMyIGk7Ci0gIFdvcmQzMiB0ZW1wOwotCi0KLSAgZm9yIChpPTA7aTwxNjtpKyspIHsKLSAgICB0ZW1wID0gTF9zdWIocGFyY29yLCB0bnNDb2VmZjRCb3JkZXJzW2ldKTsKLSAgICBpZiAodGVtcCA+IDApCi0gICAgICBpbmRleD1pOwotICB9Ci0gIHJldHVybiBleHRyYWN0X2woaW5kZXggLSA4KTsKLX0KLQotCi0KLS8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgotKgotKiBmdW5jdGlvbm5hbWU6IFBhcmNvcjJJbmRleAotKiBkZXNjcmlwdGlvbjogIHF1YW50aXphdGlvbiBpbmRleCBmb3IgcmVmbGVjdGlvbiBjb2VmZmljaWVudHMKLSoKLSoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotc3RhdGljIHZvaWQgUGFyY29yMkluZGV4KGNvbnN0IFdvcmQzMiBwYXJjb3JbXSwgICAvKiE8IHBhcmNvciBjb2VmZmljaWVudHMgKi8KLSAgICAgICAgICAgICAgICAgICAgICAgICBXb3JkMTYgaW5kZXhbXSwgICAgICAgICAgLyohPCBxdWFudGl6ZWQgY29lZmYgaW5kaWNlcyAqLwotICAgICAgICAgICAgICAgICAgICAgICAgIFdvcmQxNiBvcmRlciwgICAgICAgICAgICAvKiE8IGZpbHRlciBvcmRlciAqLwotICAgICAgICAgICAgICAgICAgICAgICAgIFdvcmQxNiBiaXRzUGVyQ29lZmYpIHsgICAvKiE8IHF1YW50aXplciByZXNvbHV0aW9uICovCi0gIFdvcmQzMiBpOwotICBXb3JkMzIgdGVtcDsKLQotICBmb3IoaT0wOyBpPG9yZGVyOyBpKyspIHsKLSAgICB0ZW1wID0gYml0c1BlckNvZWZmIC0gMzsKLSAgICBpZiAodGVtcCA9PSAwKSB7Ci0gICAgICBpbmRleFtpXSA9IFNlYXJjaDMocGFyY29yW2ldKTsKLSAgICB9Ci0gICAgZWxzZSB7Ci0gICAgICBpbmRleFtpXSA9IFNlYXJjaDQocGFyY29yW2ldKTsKLSAgICB9Ci0gIH0KLX0KLQotLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCi0qCi0qIGZ1bmN0aW9ubmFtZTogSW5kZXgyUGFyY29yCi0qIGRlc2NyaXB0aW9uOiAgSW52ZXJzZSBxdWFudGl6YXRpb24gZm9yIHJlZmxlY3Rpb24gY29lZmZpY2llbnRzCi0qCi0qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLXN0YXRpYyB2b2lkIEluZGV4MlBhcmNvcihjb25zdCBXb3JkMTYgaW5kZXhbXSwgIC8qITwgcXVhbnRpemVkIHZhbHVlcyAqLwotICAgICAgICAgICAgICAgICAgICAgICAgIFdvcmQzMiBwYXJjb3JbXSwgICAgICAgLyohPCBwdHIuIHRvIHJlZmxlY3Rpb24gY29lZmZpY2llbnRzIChvdXRwdXQpICovCi0gICAgICAgICAgICAgICAgICAgICAgICAgV29yZDE2IG9yZGVyLCAgICAgICAgICAvKiE8IG5vLiBvZiBjb2VmZmljaWVudHMgKi8KLSAgICAgICAgICAgICAgICAgICAgICAgICBXb3JkMTYgYml0c1BlckNvZWZmKSAgIC8qITwgcXVhbnRpemVyIHJlc29sdXRpb24gKi8KLXsKLSAgV29yZDMyIGk7Ci0gIFdvcmQzMiB0ZW1wOwotCi0gIGZvciAoaT0wOyBpPG9yZGVyOyBpKyspIHsKLSAgICB0ZW1wID0gYml0c1BlckNvZWZmIC0gNDsKLSAgICBpZiAoIHRlbXAgPT0gMCApIHsKLSAgICAgICAgcGFyY29yW2ldID0gdG5zQ29lZmY0W2luZGV4W2ldICsgOF07Ci0gICAgfQotICAgIGVsc2UgewotICAgICAgICBwYXJjb3JbaV0gPSB0bnNDb2VmZjNbaW5kZXhbaV0gKyA0XTsKLSAgICB9Ci0gIH0KLX0KLQotLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCi0qCi0qIGZ1bmN0aW9ubmFtZTogRklSTGF0dGljZQotKiBkZXNjcmlwdGlvbjogIGluIHBsYWNlIGxhdHRpY2UgZmlsdGVyaW5nIG9mIHNwZWN0cmFsIGRhdGEKLSogcmV0dXJuczoJCXBvaW50ZXIgdG8gbW9kaWZpZWQgZGF0YQotKgotKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi1zdGF0aWMgV29yZDMyIEZJUkxhdHRpY2UoV29yZDE2IG9yZGVyLCAgICAgICAgICAgLyohPCBmaWx0ZXIgb3JkZXIgKi8KLSAgICAgICAgICAgICAgICAgICAgICAgICBXb3JkMzIgeCwgICAgICAgICAgICAgICAvKiE8IHNwZWN0cmFsIGRhdGEgKi8KLSAgICAgICAgICAgICAgICAgICAgICAgICBXb3JkMzIgKnN0YXRlX3BhciwgICAgICAvKiE8IGZpbHRlciBzdGF0ZXMgKi8K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ioqKioqKi8KLXN0YXRpYyB2b2lkIEFuYWx5c2lzRmlsdGVyTGF0dGljZShjb25zdCAgV29yZDMyIHNpZ25hbFtdLCAgLyohPCBpbnB1dCBzcGVjdHJ1bSAqLwotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFdvcmQxNiBudW1PZkxpbmVzLCAgICAgICAvKiE8IG5vLiBvZiBsaW5lcyAqLwotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbnN0ICBXb3JkMzIgcGFyQ29lZmZbXSwvKiE8IFBBUkMgY29lZmZpY2llbnRzICovCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgV29yZDE2IG9yZGVyLCAgICAgICAgICAgIC8qITwgZmlsdGVyIG9yZGVyICovCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgV29yZDMyIG91dHB1dFtdKSAgICAgICAgIC8qITwgZmlsdGVyZWQgc2lnbmFsIHZhbHVlcyAqLwotewotCi0gIFdvcmQzMiBzdGF0ZV9wYXJbVE5TX01BWF9PUkRFUl07Ci0gIFdvcmQzMiBqOwotCi0gIGZvciAoIGo9MDsgajxUTlNfTUFYX09SREVSOyBqKysgKSB7Ci0gICAgc3RhdGVfcGFyW2pdID0gMDsKLSAgfQotCi0gIGZvcihqPTA7IGo8bnVtT2ZMaW5lczsgaisrKSB7Ci0gICAgb3V0cHV0W2pdID0gRklSTGF0dGljZShvcmRlcixzaWduYWxbal0sc3RhdGVfcGFyLHBhckNvZWZmKTsKLSAgfQotfQotCi0vKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKLSoKLSogZnVuY3Rpb25uYW1lOiBBcHBseVRuc011bHRUYWJsZVRvUmF0aW9zCi0qIGRlc2NyaXB0aW9uOiAgQ2hhbmdlIHRocmVzaG9sZHMgYWNjb3JkaW5nIHRvIHRucwotKgotKioqKioqKioqKioqKioqKioqKioqKioq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bnNmb3JtLmgiCi0jaW5jbHVkZSAiYWFjX3JvbS5oIgotCi0KLSNkZWZpbmUgTFNfVFJBTlMgKChGUkFNRV9MRU5fTE9ORy1GUkFNRV9MRU5fU0hPUlQpLzIpIC8qIDQ0OCAqLwotI2RlZmluZSBTUVJUMV8yIDB4NWE4Mjc5OWEJLyogc3FydCgxLzIpIGluIFEzMSAqLwotI2RlZmluZSBzd2FwMihwMCxwMSkgXAotCXQgPSBwMDsgdDEgPSAqKCYocDApKzEpOwlcCi0JcDAgPSBwMTsgKigmKHAwKSsxKSA9ICooJihwMSkrMSk7CVwKLQlwMSA9IHQ7ICooJihwMSkrMSkgPSB0MQotCi0vKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCi0qCi0qIGZ1bmN0aW9uIG5hbWU6IFNodWZmbGUKLSogZGVzY3JpcHRpb246ICBTaHVmZmxlIHBvaW50cyBwcmVwYXJlZCBmdW5jdGlvbiBmb3IgZmZ0Ci0qCi0qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotc3RhdGljIHZvaWQgU2h1ZmZsZShpbnQgKmJ1ZiwgaW50IG51bSwgY29uc3QgdW5zaWduZWQgY2hhciogYml0VGFiKQotewotICAgIGludCAqcGFydDAsICpwYXJ0MTsKLQlpbnQgaSwgajsKLQlpbnQgdCwgdDE7Ci0KLQlwYXJ0MCA9IGJ1ZjsKLSAgICBwYXJ0MSA9IGJ1ZiArIG51bTsKLQotCXdoaWxlICgoaSA9ICpiaXRUYWIrKykgIT0gMCkgewotICAgICAgICBqID0gKmJpdFRhYisrOwotCi0gICAgICAgIHN3YXAyKHBhcnQwWzQqaSswXSwgcGFydDBbNCpqKzBdKTsKLSAgICAgICAgc3dhcDIocGFydDBbNCppKzJdLCBwYXJ0MVs0KmorMF0pOwotICAgIC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yByNDsKLQkJYnVmWzFdID0gcjEgKyByNTsKLQkJYnVmWzRdID0gcjAgLSByNDsKLQkJYnVmWzVdID0gcjEgLSByNTsKLQkJYnVmWzJdID0gcjIgKyByNzsKLQkJYnVmWzNdID0gcjMgLSByNjsKLQkJYnVmWzZdID0gcjIgLSByNzsKLQkJYnVmWzddID0gcjMgKyByNjsKLQotCQlidWYgKz0gODsKLQl9Ci19Ci0KLS8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgotKgotKiBmdW5jdGlvbiBuYW1lOiBSYWRpeDhGaXJzdAotKiBkZXNjcmlwdGlvbjogIFJhZGl4IDggcG9pbnQgcHJlcGFyZWQgZnVuY3Rpb24gZm9yIGZmdAotKgotKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLXN0YXRpYyB2b2lkIFJhZGl4OEZpcnN0KGludCAqYnVmLCBpbnQgbnVtKQotewotICAgaW50IHIwLCByMSwgcjIsIHIzOwotICAgaW50IGkwLCBpMSwgaTIsIGkzOwotICAgaW50IHI0LCByNSwgcjYsIHI3OwotICAgaW50IGk0LCBpNSwgaTYsIGk3OwotICAgaW50IHQwLCB0MSwgdDIsIHQzOwotCi0JZm9yICggOyBudW0gIT0gMDsgbnVtLS0pCi0JewotCQlyMCA9IGJ1ZlswXSArIGJ1ZlsyXTsKLQkJaTAgPSBidWZbMV0gKyBidWZbM107Ci0JCXIxID0gYnVmWzBdIC0gYnVmWzJdOwotCQlpMSA9IGJ1ZlsxXSAtIGJ1ZlszXTsKLQkJcjIgPSBidWZbNF0gKyBidWZbNl07Ci0JCWkyID0gYnVmWzVdICsgYnVmWzddOwotCQlyMyA9IGJ1Zls0XSAtIGJ1Zls2XTsKLQkJaTMgPSBidWZbNV0gLSBidWZbN107Ci0KLQkJcjQgPSAocjAgKyByMik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ioqKioqKi8KLXN0YXRpYyB2b2lkIFByZU1EQ1QoaW50ICpidWYwLCBpbnQgbnVtLCBjb25zdCBpbnQgKmNzcHRyKQotewotCWludCBpOwotCWludCB0cjEsIHRpMSwgdHIyLCB0aTI7Ci0JaW50IGNvc2EsIHNpbmEsIGNvc2IsIHNpbmI7Ci0JaW50ICpidWYxOwotCi0JYnVmMSA9IGJ1ZjAgKyBudW0gLSAxOwotCi0JZm9yKGkgPSBudW0gPj4gMjsgaSAhPSAwOyBpLS0pCi0JewotCQljb3NhID0gKmNzcHRyKys7Ci0JCXNpbmEgPSAqY3NwdHIrKzsKLQkJY29zYiA9ICpjc3B0cisrOwotCQlzaW5iID0gKmNzcHRyKys7Ci0KLQkJdHIxID0gKihidWYwICsgMCk7Ci0JCXRpMiA9ICooYnVmMCArIDEpOwotCQl0cjIgPSAqKGJ1ZjEgLSAxKTsKLQkJdGkxID0gKihidWYxICsgMCk7Ci0KLQkJKmJ1ZjArKyA9IE1VTEhJR0goY29zYSwgdHIxKSArIE1VTEhJR0goc2luYSwgdGkxKTsKLQkJKmJ1ZjArKyA9IE1VTEhJR0goY29zYSwgdGkxKSAtIE1VTEhJR0goc2luYSwgdHIxKTsKLQotCQkqYnVmMS0tID0gTVVMSElHSChjb3NiLCB0aTIpIC0gTVVMSElHSChzaW5iLCB0cjIpOwotCQkqYnVmMS0tID0gTVVMSElHSChjb3NiLCB0cjIpICsgTVVMSElHSChzaW5iLCB0aTIpOwotCX0KLX0KLQotLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgotKgotKiBmdW5jdGlvbiBuYW1lOiBQb3N0TURDVAotKiBkZXNjcmlwdGlvbjogICBwb3N0IE1EQ1QgcHJvY2VzcyBhZnRlciBuZXh0IEZGVCBmb3IgTURDVAotKgotKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq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jc3B0cik7Ci12b2lkIFBvc3RNRENUKGludCAqYnVmMCwgaW50IG51bSwgY29uc3QgaW50ICpjc3B0cik7Ci0jZW5kaWYKLQotCi0vKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgotKgotKiBmdW5jdGlvbiBuYW1lOiBNZGN0X0xvbmcKLSogZGVzY3JpcHRpb246ICB0aGUgbG9uZyBibG9jayBtZGN0LCBpbmNsdWRlIGxvbmdfc3RhcnQgYmxvY2ssIGVuZF9sb25nIGJsb2NrCi0qCi0qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotdm9pZCBNZGN0X0xvbmcoaW50ICpidWYpCi17Ci0JUHJlTURDVChidWYsIDEwMjQsIGNvc3NpbnRhYiArIDEyOCk7Ci0KLQlTaHVmZmxlKGJ1ZiwgNTEyLCBiaXRyZXZUYWIgKyAxNyk7Ci0JUmFkaXg4Rmlyc3QoYnVmLCA1MTIgPj4gMyk7Ci0JUmFkaXg0RkZUKGJ1ZiwgNTEyID4+IDMsIDgsIChpbnQgKil0d2lkVGFiNTEyKTsKLQotCVBvc3RNRENUKGJ1ZiwgMTAyNCwgY29zc2ludGFiICsgMTI4KTsKLX0KLQotCi0vKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgotKgotKiBmdW5jdGlvbiBuYW1lOiBNZGN0X1Nob3J0Ci0qIGRlc2NyaXB0aW9uOiAgdGhlIHNob3J0IGJsb2NrIG1kY3QKLSoKLSoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi12b2lkIE1kY3RfU2hvcnQoaW50ICpidWYpCi17Ci0JUHJ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zVmFsOwotCX0KLQotCXJldHVybiggbWF4VmFsID8gbm9ybV9zKG1heFZhbCkgOiAxNSk7Ci19Ci0KLQotLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCi0qCi0qIGZ1bmN0aW9uIG5hbWU6IFRyYW5zZm9ybV9SZWFsCi0qIGRlc2NyaXB0aW9uOiAgQ2FsY3VsYXRlIHRyYW5zZm9ybSBmaWx0ZXIgZm9yIGlucHV0IHZlY3RvciBvZiBzaG9ydHMKLSogcmV0dXJuczogICAgICBUUlVFIGlmIHN1Y2Nlc3MKLSoKLSoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi12b2lkIFRyYW5zZm9ybV9SZWFsKFdvcmQxNiAqbWRjdERlbGF5QnVmZmVyLAotICAgICAgICAgICAgICAgICAgICBXb3JkMTYgKnRpbWVTaWduYWwsCi0gICAgICAgICAgICAgICAgICAgIFdvcmQxNiBjaEluY3JlbWVudCwKLSAgICAgICAgICAgICAgICAgICAgV29yZDMyICpyZWFsT3V0LAotICAgICAgICAgICAgICAgICAgICBXb3JkMTYgKm1kY3RTY2FsZSwKLSAgICAgICAgICAgICAgICAgICAgV29yZDE2IGJsb2NrVHlwZQotICAgICAgICAgICAgICAgICAgICApCi17Ci0JV29yZDMyIGksdzsKLQlXb3JkMzIgdGltZVNpZ25hbFNhbXBsZTsKLQlXb3JkMzIgd3MxLHdzMjsKLQlXb3JkMTYgKmRjdEluMCwgKmRjdEluMTsKLQlXb3JkMzIgKm91dERhdGEwLCAqb3V0RGF0YTE7Ci0JV29yZDMyICp3aW5QdHI7Ci0KLQlXb3JkMzIgZGVsYXlCdWZmZXJTZix0aW1lU2lnbmFsU2YsbWluU2Y7Ci0JV29yZDMyIGhlYWRSb29tPTA7Ci0KLQlzd2l0Y2goYmxvY2tUeXB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gN2ZmZi4KLSAgICAgICAgTF92YXIxX2xvID0gMTYgYml0IHNob3J0IHNpZ25lZCBpbnRlZ2VyIChXb3JkMTYpIHdob3NlIHZhbHVlIGZhbGxzIGluCi0gICAgICAgICAgICAgICB0aGUgcmFuZ2UgOiAweGZmZmYgODAwMCA8PSB2YXIyIDw9IDB4MDAwMCA3ZmZmLgotICAgICAgICB2YXIyPSAxNiBiaXQgc2hvcnQgc2lnbmVkIGludGVnZXIgKFdvcmQxNikgd2hvc2UgdmFsdWUgZmFsbHMgaW4KLSAgICAgICAgICAgICAgIHRoZSByYW5nZSA6IDB4ZmZmZiA4MDAwIDw9IHZhcjEgPD0gMHgwMDAwIDdmZmYuCi0gICAgICAgIHBPdmVyZmxvdyA9IHBvaW50ZXIgdG8gb3ZlcmZsb3cgKEZsYWcpCi0KLSAgICAgT3V0cHV0czoKLSAgICAgICAgcE92ZXJmbG93IC0+IDEgaWYgdGhlIDMyIGJpdCBtYWMgb3BlcmF0aW9uIHJlc3VsdGVkIGluIG92ZXJmbG93Ci0KLSAgICAgUmV0dXJuczoKLSAgICAgICAgTF92YXIzID0gMzItYml0IHJlc3VsdCBvZiBMX3ZhcjMgKyAoTF92YXIxICogdmFyMikoV29yZDMyKQotICAgICovCi0KLSAgICBzdGF0aWMgaW5saW5lIFdvcmQzMiBNYWNfMzJfMTYoV29yZDMyIExfdmFyMywKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgV29yZDE2IExfdmFyMV9oaSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgV29yZDE2IExfdmFyMV9sbywKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgV29yZDE2IHZhcjIsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEZsYWcgICpwT3ZlcmZsb3cpCi0gICAgewotICAgICAgICBXb3JkMTYgIHByb2R1Y3Q7Ci0KLSAgICAgICAgTF92YXIzID0gTF9tYWMoTF92YXIzLCBMX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DgwMDAgPD0gdmFyMiA8PSA3ZmZmLgotCi0gICAgICAgICAgcE92ZXJmbG93IDogcG9pbnRlciB0byBvdmVyZmxvdyAoRmxhZykKLQotICAgICAgICAgUmV0dXJuIFZhbHVlIDoKLSAgICAgICAgICAgICAgICAgICAzMiBiaXQgbG9uZyBzaWduZWQgaW50ZWdlciAoV29yZDMyKSB3aG9zZSB2YWx1ZSBmYWxscyBpbiB0aGUKLSAgICAgICAgICAgICAgICAgICByYW5nZSA6IDB4ODAwMCAwMDAwIDw9IExfdmFyX291dCA8PSAweDdmZmYgZmZmZi4KLQotICAgICAtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tKi8KLQotICAgIHN0YXRpYyBpbmxpbmUgV29yZDMyIExfc2hsKFdvcmQzMiBMX3ZhcjEsIFdvcmQxNiB2YXIyLCBGbGFnICpwT3ZlcmZsb3cpCi0gICAgewotICAgICAgICBXb3JkMzIgTF92YXJfb3V0ID0gMDsKLQotICAgICAgICBPU0NMX1VOVVNFRF9BUkcocE92ZXJmbG93KTsKLQotICAgICAgICBpZiAodmFyMiA+IDApCi0gICAgICAgIHsKLSAgICAgICAgICAgIExfdmFyX291dCA9IExfdmFyMSA8PCB2YXIyOwotICAgICAgICAgICAgaWYgKExfdmFyX291dCA+PiB2YXIyICE9IExfdmFyMSkKLSAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICBMX3Zhcl9vdXQgPSAoTF92YXIxID4+IDMxKSBeIE1BWF8zMjsKLSAgICAgICAgICAgIH0KLSAgICAgICAgfQotICAgICAgICBlbHNlCi0gICAgICAgIHsKLSAgICAgICAgICAgIHZhcjIgPSAtdmFyMjsKLSAgICAgICAgICAgIGlmICh2YXIyIDwgMzEpCi0gICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgTF92YXJfb3V0ID0gTF92YXIxID4+IHZhcjI7Ci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GVyIHRvIG92ZXJmbG93IChGbGFnKQotCi0gICAgICAgICBSZXR1cm4gVmFsdWUgOgotICAgICAgICAgICAgICAgICAgIDMyIGJpdCBsb25nIHNpZ25lZCBpbnRlZ2VyIChXb3JkMzIpIHdob3NlIHZhbHVlIGZhbGxzIGluIHRoZQotICAgICAgICAgICAgICAgICAgIHJhbmdlIDogMHg4MDAwIDAwMDAgPD0gTF92YXJfb3V0IDw9IDB4N2ZmZiBmZmZmLgotCi0gICAgIC0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0qLwotCi0gICAgc3RhdGljIGlubGluZSBXb3JkMzIgTF9zaHIoV29yZDMyIExfdmFyMSwgV29yZDE2IHZhcjIsIEZsYWcgKnBPdmVyZmxvdykKLSAgICB7Ci0gICAgICAgIFdvcmQzMiBMX3Zhcl9vdXQgPSAwOwotCi0gICAgICAgIE9TQ0xfVU5VU0VEX0FSRyhwT3ZlcmZsb3cpOwotCi0gICAgICAgIGlmICh2YXIyID4gMCkKLSAgICAgICAgewotICAgICAgICAgICAgaWYgKHZhcjIgPCAzMSkKLSAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICBMX3Zhcl9vdXQgPSBMX3ZhcjEgPj4gdmFyMjsKLSAgICAgICAgICAgIH0KLSAgICAgICAgfQotICAgICAgICBlbHNlCi0gICAgICAgIHsKLSAgICAgICAgICAgIHZhcjIgPSAtdmFyMjsKLQotICAgICAgICAgICAgTF92YXJfb3V0ID0gTF92YXIxIDw8ICh2YXIyKSA7Ci0gICAgICAgICAgICBpZiAoKExfdmFyX291dCA+PiAodmFyMikpICE9IExfdmFyMSkKLSAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICBMX3Zhcl9vdXQgPSAoTF92YXIxID4+IDMxKSBeIE1BWF8zMjsKLSAgICAgICAgICAgIH0KLQotICAgICAgICB9Ci0KLSAgICAg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HQ7Ci0KLSAgICAgICAgT1NDTF9VTlVTRURfQVJHKHBPdmVyZmxvdyk7Ci0KLSAgICAgICAgYXNtIHZvbGF0aWxlKCJzbXVsYmIgJTAsICUxLCAlMiIKLSAgICAgICAgICAgICA6ICI9ciIocmVzdWx0KQotICAgICAgICAgICAgICAgICAgICAgICAgICAgICA6ICJyIihyYiksICJyIihyYykKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICApOwotCi0gICAgICAgIGFzbSB2b2xhdGlsZSgicWRhZGQgJTAsICUxLCAlMiIKLSAgICAgICAgICAgICA6ICI9ciIocmMpCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgIDogInIiKHJhKSwgInIiKHJlc3VsdCkKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICApOwotCi0gICAgICAgIHJldHVybiAocmMpOwotICAgIH0KLQotICAgIC8qCi0gICAgLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tCi0gICAgIEZVTkNUSU9OIE5BTUU6IExfbXVsdAotICAgIC0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLQotICAgICBJTlBVVCBBTkQgT1VUUFVUIERFRklOSVRJT05TCi0KLSAgICAgSW5wdXRzOgotICAgICAgICBMX3ZhcjEgPSAxNiBiaXQgc2hvcnQgc2lnbmVkIGludGVnZXIgKFdvcmQxNikgd2hvc2UgdmFsdWUgZmFsbHMgaW4KLSAgICAgICAgICAgICAgIHRoZSByYW5nZSA6IDB4ZmZmZiA4MDAwIDw9IHZhcjEgPD0gMHgwMDAwIDdmZmYuCi0KLSAgICAgICAgTF92YXIyID0gMTYgYml0IHNob3J0IHNpZ25lZCBpbnRlZ2VyIChXb3JkMTYpIHdob3NlIHZhbHVlIG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ICAgICAgICAgICAgICAgICAgICAgICAgICAgICBXb3JkMTYgTF92YXIyX2xvLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBGbGFnICAgKnBPdmVyZmxvdykKLXsKLSAgICAgICAgcmVnaXN0ZXIgV29yZDMyIHByb2R1Y3QzMjsKLSAgICAgICAgcmVnaXN0ZXIgV29yZDMyIExfc3VtOwotICAgICAgICByZWdpc3RlciBXb3JkMzIgTF9wcm9kdWN0LCByZXN1bHQ7Ci0gICAgICAgIHJlZ2lzdGVyIFdvcmQzMiByYSA9IExfdmFyMV9oaTsKLSAgICAgICAgcmVnaXN0ZXIgV29yZDMyIHJiID0gTF92YXIxX2xvOwotICAgICAgICByZWdpc3RlciBXb3JkMzIgcmMgPSBMX3ZhcjJfaGk7Ci0gICAgICAgIHJlZ2lzdGVyIFdvcmQzMiByZCA9IExfdmFyMl9sbzsKLQotCi0KLSAgICAgICAgT1NDTF9VTlVTRURfQVJHKHBPdmVyZmxvdyk7Ci0KLSAgICAgICAgYXNtIHZvbGF0aWxlKCJzbXVsYmIgJTAsICUxLCAlMiIKLSAgICAgICAgICAgICA6ICI9ciIoTF9wcm9kdWN0KQotICAgICAgICAgICAgICAgICAgICAgICAgICAgICA6ICJyIihyYSksICJyIihyYykKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICApOwotICAgICAgICBhc20gdm9sYXRpbGUoIm1vdiAlMCwgIzAiCi0gICAgICAgICAgICAgOiAiPXIiKHJlc3VsdCkKLSAgICAgICAgICAgICAgICAgICAgKTsKLQotICAgICAgICBhc20gdm9sYXRpbGUoInFkYWRkICUwLCAlMSwgJTIiCi0gICAgICAgICAgICAgOiAiPXIiKExfc3VtKQotICAgICAgICAgICAgICAgICAgICAgICAgICAgICA6ICJyIihyZXN1bHQpLCAiciIoTF9wcm9kdWN0KQotICAgICAgICAgICAgICAgICAgICAgICAgICAgICk7Ci0KLSAgICAgICAgYXNtIHZvbGF0aWxlKCJzbXVsYmIgJTAsICUxLCAlMiIKLSAgICAgICAgICAgICA6ICI9ciIocHJvZHVjdDMyKQotICAgICAgICAgICAgICAgICAgICAgICAgICAgICA6ICJyIihyYSksICJyIihyZCkKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICApOwotCi0gICAgICAgIGFzbSB2b2xhdGlsZSgibW92ICUwLCAlMSwgQVNSICMxNSIKLSAgICAgICAgICAgICA6ICI9ciIocmEpCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgIDogInIiKHByb2R1Y3QzMikKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICApOwotICAgICAgICBhc20gdm9sYXRpbGUoInFkYWRkICUwLCAlMSwgJTIiCi0gICAgICAgICAgICAgOiAiPXIiKExfcHJvZHVjdCkKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOiAiciIoTF9zdW0pLCAiciIocmEpCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgKTsKLQotICAgICAgICBhc20gdm9sYXRpbGUoInNtdWxiYiAlMCwgJTEsICUyIgotICAgICAgICAgICAgIDogIj1yIihwcm9kdWN0MzIpCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgIDogInIiKHJiKSwgInIiKHJjKQotICAgICAgICAgICAgICAgICAgICAgICAgICAgICk7Ci0KLSAgICAgICAgYXNtIHZvbGF0aWxlKCJtb3YgJTAsICUxLCBBU1IgIzE1IgotICAgICAgICAgICAgIDogIj1yIihyYikKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOiAiciIocHJvZHVjdDMyKQotICAgICAgICAgICAgICAgICAgICAgICAgICAgICk7Ci0KLSAgICAgICAgYXNtIHZvbGF0aWxlKCJxZGFkZCAlMCwgJTEsICUyIgotICAgICAgICAgICAgIDogIj1yIihMX3N1bSkKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOiAiciIoTF9wcm9kdWN0KSwgInIiKHJiKQotICAgICAgICAgICAgICAgICAgICAgICAgICAgICk7Ci0KLSAgICAgICAgcmV0dXJuIChMX3N1bSk7Ci0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ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFdvcmQxNiB2YXIyLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBGbGFnICpwT3ZlcmZsb3cpCi17Ci0KLSAgICAgICAgcmVnaXN0ZXIgV29yZDMyIHJhID0gTF92YXIxX2hpOwotICAgICAgICByZWdpc3RlciBXb3JkMzIgcmIgPSBMX3ZhcjFfbG87Ci0gICAgICAgIHJlZ2lzdGVyIFdvcmQzMiByYyA9IHZhcjI7Ci0gICAgICAgIFdvcmQzMiByZXN1bHQsIExfcHJvZHVjdDsKLQotICAgICAgICBPU0NMX1VOVVNFRF9BUkcocE92ZXJmbG93KTsKLQotICAgICAgICBhc20gdm9sYXRpbGUoInNtdWxiYiAlMCwgJTEsICUyIgotICAgICAgICAgICAgIDogIj1yIihMX3Byb2R1Y3QpCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgIDogInIiKHJhKSwgInIiKHJjKQotICAgICAgICAgICAgICAgICAgICAgICAgICAgICk7Ci0gICAgICAgIGFzbSB2b2xhdGlsZSgibW92ICUwLCAjMCIKLSAgICAgICAgICAgICA6ICI9ciIocmVzdWx0KQotICAgICAgICAgICAgICAgICAgICApOwotCi0gICAgICAgIGFzbSB2b2xhdGlsZSgicWRhZGQgJTAsICUxLCAlMiIKLSAgICAgICAgICAgICA6ICI9ciIoTF9wcm9kdWN0KQotICAgICAgICAgICAgICAgICAgICAgICAgICAgICA6ICJyIihyZXN1bHQpLCAiciIoTF9wcm9kdWN0KQotICAgICAgICAgICAgICAgICAgICAgICAgICAgICk7Ci0KLSAgICAgICAgYXNtIHZvbGF0aWxlKCJzbXVsYmIgJTAsICUxLCAlMiIKLSAgICAgICAgICAgICA6ICI9ciIocmVzdWx0KQotICAgICAgICAgICAgICAgICAgICAgICAgICAgICA6ICJyIihyYiksICJyIihyYykKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICApOwotCi0gICAgICAgIGFzbSB2b2xhdGlsZSgibW92ICUwLCAlMSwgQVNSICMxNSIKLSAgICAgICAgICAgICA6ICI9ciIocmEpCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgIDogInIiKHJlc3VsdCkKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICApOwotICAgICAgICBhc20gdm9sYXRpbGUoInFkYWRkICUwLCAlMSwgJTIiCi0gICAgICAgICAgICAgOiAiPXIiKHJlc3VsdCkKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOiAiciIoTF9wcm9kdWN0KSwgInIiKHJhKQotICAgICAgICAgICAgICAgICAgICAgICAgICAgICk7Ci0KLSAgICAgICAgcmV0dXJuIChyZXN1bHQpOwotICAgIH0KLQotICAgIC8qCi0gICAgLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tCi0gICAgIEZVTkNUSU9OIE5BTUU6IG11bHQKLSAgICAtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0KLSAgICAgSU5QVVQgQU5EIE9VVFBVVCBERUZJTklUSU9OUwotCi0gICAgIElucHV0czoKLSAgICAgICAgdmFyMSA9IDE2IGJpdCBzaG9ydCBzaWduZWQgaW50ZWdlciAoV29yZDE2KSB3aG9zZSB2YWx1ZSBmYWxscyBpbgotICAgICAgICAgICAgICAgdGhlIHJhbmdlIDogMHhmZmZmIDgwMDAgPD0gdmFyMSA8PSAweDAwMDAgN2ZmZi4KLQotICAgICAgICB2YXIyID0gMTYgYml0IHNob3J0IHNpZ25lZCBpbnRlZ2VyIChXb3JkMTYpIHdob3NlIHZhbHVlIGZhbGxzIGluCi0gICAgICAgICAgICAgICB0aGUgcmFuZ2UgOiAweGZmZmYgODAwMCA8PSB2YXIyIDw9IDB4MDAwMCA3ZmZmLgotCi0gIC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ybmJfZnhwX21hY18xNl9ieV8xNmJiKFdvcmQzMiBMX3ZhcjEsIFdvcmQzMiBMX3ZhcjIsIFdvcmQzMiBMX3ZhcjMpCi17Ci0gICAgICAgIHJlZ2lzdGVyIFdvcmQzMiByYSA9IExfdmFyMTsKLSAgICAgICAgcmVnaXN0ZXIgV29yZDMyIHJiID0gTF92YXIyOwotICAgICAgICByZWdpc3RlciBXb3JkMzIgcmMgPSBMX3ZhcjM7Ci0gICAgICAgIFdvcmQzMiByZXN1bHQ7Ci0KLSAgICAgICAgYXNtIHZvbGF0aWxlKCJzbWxhYmIgJTAsICUxLCAlMiwgJTMiCi0gICAgICAgICAgICAgOiAiPXIiKHJlc3VsdCkKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOiAiciIocmEpLCAiciIocmIpLCAiciIocmMpCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgKTsKLSAgICAgICAgcmV0dXJuIChyZXN1bHQpOwotICAgIH0KLQotICAgIF9faW5saW5lIFdvcmQzMiBhbXJuYl9meHBfbXN1XzE2X2J5XzE2YmIoV29yZDMyIExfdmFyMSwgV29yZDMyIExfdmFyMiwgV29yZDMyIExfdmFyMykKLXsKLSAgICAgICAgcmVnaXN0ZXIgV29yZDMyIHJhID0gTF92YXIxOwotICAgICAgICByZWdpc3RlciBXb3JkMzIgcmIgPSBMX3ZhcjI7Ci0gICAgICAgIHJlZ2lzdGVyIFdvcmQzMiByYyA9IExfdmFyMzsKLSAgICAgICAgV29yZDMyIHJlc3VsdDsKLQotICAgICAgICBhc20gdm9sYXRpbGUoInJzYiAlMCwgJTEsICMwIgotICAgICAgICAgICAgIDogIj1yIihyYSkKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOiAiciIocmEpCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgKTsKLQotICAgICAgICBhc20gdm9sYXRpbGUoInNtbGFiYiAlMCwgJTEsICUyLCAlMyIKLSAgICAgICAgICAgICA6ICI9ciIocmVzdWx0KQot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aWduaWZpY2FudCAxNiBiaXRzIG9mIDMyLWJpdCBpbnB1dCAoV29yZDE2KS4KLSAgICAgICAgdmFyMiAgPSAxNi1iaXQgc2lnbmVkIGludGVnZXIgKFdvcmQxNikuCi0KLSAgICAgICAgcE92ZXJmbG93ID0gcG9pbnRlciB0byBvdmVyZmxvdyAoRmxhZykKLQotICAgICBPdXRwdXRzOgotICAgICAgICBwT3ZlcmZsb3cgLT4gMSBpZiB0aGUgMzIgYml0IHByb2R1Y3Qgb3BlcmF0aW9uIHJlc3VsdGVkIGluIG92ZXJmbG93Ci0KLSAgICAgUmV0dXJuczoKLSAgICAgICAgcHJvZHVjdCA9IDMyLWJpdCBwcm9kdWN0IG9mIHRoZSAzMi1iaXQgTF92YXIxIGFuZCAxNi1iaXQgdmFyMSAoV29yZDMyKQotICAgICovCi0gICAgX19pbmxpbmUgV29yZDMyIE1weV8zMl8xNihXb3JkMTYgTF92YXIxX2hpLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgV29yZDE2IExfdmFyMV9sbywKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFdvcmQxNiB2YXIyLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgRmxhZyAqcE92ZXJmbG93KQotICAgIHsKLQotICAgICAgICBXb3JkMzIgTF9wcm9kdWN0OwotICAgICAgICBXb3JkMzIgTF9zdW07Ci0gICAgICAgIFdvcmQzMiByZXN1bHQ7Ci0KLSAgICAgICAgT1NDTF9VTlVTRURfQVJHKHBPdmVyZmxvdyk7Ci0KLSAgICAgICAgX19hc20ge1NNVUxCQiBMX3Byb2R1Y3QsIExfdmFyMV9oaSwgdmFyMn0KLSAgICAgICAgX19hc20ge1FEQUREIExfcHJvZHVjdCwgMCwgTF9wcm9kdWN0fQotICAgICAgICBfX2FzbSB7U01VTEJCIHJlc3VsdCwgTF92YXIxX2xvLCB2YXIyfQotICAgICAgICByZXN1bHQgPj49IDE1OwotICAgICAgICBfX2FzbSB7UURBREQgTF9zd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0gICAgX19pbmxpbmUgV29yZDE2IG11bHQoV29yZDE2IHZhcjEsIFdvcmQxNiB2YXIyLCBGbGFnICpwT3ZlcmZsb3cpCi0gICAgewotICAgICAgICBXb3JkMzIgcHJvZHVjdDsKLQotICAgICAgICBPU0NMX1VOVVNFRF9BUkcocE92ZXJmbG93KTsKLQotICAgICAgICBfX2FzbQotICAgICAgICB7Ci0gICAgICAgICAgICBTTVVMQkIgcHJvZHVjdCwgdmFyMSwgdmFyMgotICAgICAgICAgICAgTU9WICAgIHByb2R1Y3QsIHByb2R1Y3QsIEFTUiAjMTUKLSAgICAgICAgICAgIENNUCAgICBwcm9kdWN0LCAweDdGRkYKLSAgICAgICAgICAgIE1PVkdFICBwcm9kdWN0LCAweDdGRkYKLSAgICAgICAgfQotCi0gICAgICAgIHJldHVybiAoKFdvcmQxNikgcHJvZHVjdCk7Ci0gICAgfQotCi0gICAgX19pbmxpbmUgV29yZDMyIGFtcm5iX2Z4cF9tYWNfMTZfYnlfMTZiYihXb3JkMzIgTF92YXIxLCBXb3JkMzIgTF92YXIyLCBXb3JkMzIgTF92YXIzKQotICAgIHsKLSAgICAgICAgV29yZDMyIHJlc3VsdDsKLSAgICAgICAgX19hc20KLSAgICAgICAgewotICAgICAgICAgICAgc21sYWJiIHJlc3VsdCwgTF92YXIxLCBMX3ZhcjIsIExfdmFyMwotICAgICAgICB9Ci0gICAgICAgIHJldHVybiByZXN1bHQ7Ci0gICAgfQotCi0gICAgX19pbmxpbmUgV29yZDMyIGFtcm5iX2Z4cF9tc3VfMTZfYnlfMTZiYihXb3JkMzIgTF92YXIxLCBXb3JkMzIgTF92YXIyLCBXb3JkMzIgTF92YXIzKQotICAgIHsKLSAgICAgICAgV29yZDMyIHJlc3VsdDsKLSAgICAgICAgX19hc20KLSAgICAgICAgewotICAgICAgICAgICAgcnNiIExfdmFyMSwgTF92YXIxLCAjMAotICAgICAgICAgICAgc21sYWJiIHJlc3VsdCwgTF92YXIxLCBMX3ZhcjIsIExfd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IGlmIChyZXN1bHQgIT0gKFdvcmQzMikgMHg0MDAwMDAwMEwpCi0gICAgICAgIHsKLSAgICAgICAgICAgIExfc3VtID0gKHJlc3VsdCA8PCAxKSArIExfdmFyMzsKLQotICAgICAgICAgICAgLyogQ2hlY2sgaWYgTF9zdW0gYW5kIExfdmFyXzMgc2hhcmUgdGhlIHNhbWUgc2lnbiAqLwotICAgICAgICAgICAgaWYgKChMX3ZhcjMgXiByZXN1bHQpID4gMCkKLSAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICBpZiAoKExfc3VtIF4gTF92YXIzKSA8IDApCi0gICAgICAgICAgICAgICAgewotICAgICAgICAgICAgICAgICAgICBMX3N1bSA9IChMX3ZhcjMgPCAwKSA/IE1JTl8zMiA6IE1BWF8zMjsKLSAgICAgICAgICAgICAgICAgICAgKnBPdmVyZmxvdyA9IDE7Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgfQotICAgICAgICB9Ci0gICAgICAgIGVsc2UKLSAgICAgICAgewotICAgICAgICAgICAgKnBPdmVyZmxvdyA9IDE7Ci0gICAgICAgICAgICBMX3N1bSA9IE1BWF8zMjsKLSAgICAgICAgfQotICAgICAgICByZXR1cm4gKExfc3VtKTsKLSAgICB9Ci0KLSAgICAvKgotICAgIC0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLQotICAgICBGVU5DVElPTiBOQU1FOiBMX211bHQKLSAgICAtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0KLSAgICAgSU5QVVQgQU5EIE9VVFBVVCBERUZJTklUSU9OUwotCi0gICAgIElucHV0czoKLSAgICAgICAgTF92YXIxID0gMTYgYml0IHNob3J0IHNpZ25lZCBpbnRlZ2VyIChX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2R1Y3QgPSAzMi1iaXQgcHJvZHVjdCBvZiB0aGUgMzItYml0IExfdmFyMSBhbmQgMTYtYml0IHZhcjEgKFdvcmQzMikKLSAgICAqLwotCi0gICAgX19pbmxpbmUgV29yZDMyIE1weV8zMl8xNihXb3JkMTYgTF92YXIxX2hpLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgV29yZDE2IExfdmFyMV9sbywKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFdvcmQxNiB2YXIyLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgRmxhZyAqcE92ZXJmbG93KQotICAgIHsKLQotICAgICAgICBXb3JkMzIgTF9wcm9kdWN0OwotICAgICAgICBXb3JkMzIgTF9zdW07Ci0gICAgICAgIFdvcmQzMiByZXN1bHQ7Ci0gICAgICAgIExfcHJvZHVjdCA9IChXb3JkMzIpIExfdmFyMV9oaSAqIHZhcjI7Ci0KLSAgICAgICAgaWYgKExfcHJvZHVjdCAhPSAoV29yZDMyKSAweDQwMDAwMDAwTCkKLSAgICAgICAgewotICAgICAgICAgICAgTF9wcm9kdWN0IDw8PSAxOwotICAgICAgICB9Ci0gICAgICAgIGVsc2UKLSAgICAgICAgewotICAgICAgICAgICAgKnBPdmVyZmxvdyA9IDE7Ci0gICAgICAgICAgICBMX3Byb2R1Y3QgPSBNQVhfMzI7Ci0gICAgICAgIH0KLQotICAgICAgICByZXN1bHQgPSAoKFdvcmQzMilMX3ZhcjFfbG8gKiB2YXIyKSA+PiAxNTsKLQotICAgICAgICBMX3N1bSAgPSAgTF9wcm9kdWN0ICsgKHJlc3VsdCA8PCAxKTsKLQotICAgICAgICBpZiAoKExfcHJvZHVjdCBeIHJlc3VsdCkgPiAwKQotICAgICAgICB7Ci0gICAgICAgICAgICBpZiAoKExfc3VtIF4gTF9wcm9kdWN0KSA8IDApCi0gICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgTF9zdW0gPSAoTF9wcm9kdWN0IDwgMCkgPyBNSU5fMzI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5kYXJkIGxpY2Vuc2UKLXRlcm1zIGxpc3RlZCBhYm92ZSBoYXMgYmVlbiBvYnRhaW5lZCBmcm9tIHRoZSBjb3B5cmlnaHQgaG9sZGVyLgotKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLS8qCi0qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgotKgotKiAgICAgIEdTTSBBTVItTkIgc3BlZWNoIGNvZGVjICAgUjk4ICAgVmVyc2lvbiA3LjUuMCAgIE1hcmNoIDIsIDIwMDEKLSogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFI5OSAgIFZlcnNpb24gMy4yLjAKLSogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFJFTC00IFZlcnNpb24gNC4wLjAKLSoKLSoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCi0qCi0qICAgICAgRmlsZSAgICAgICAgICAgICA6IGJpdHMycHJtLmgKLSogICAgICBQdXJwb3NlICAgICAgICAgIDogUmV0cmlldmVzIHRoZSB2ZWN0b3Igb2YgZW5jb2RlciBwYXJhbWV0ZXJzIGZyb20KLSogICAgICAgICAgICAgICAgICAgICAgIDogdGhlIHJlY2VpdmVkIHNlcmlhbCBiaXRzIGluIGEgZnJhbWUuCi0qCi0qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgotKi8KLSNpZm5kZWYgYml0czJwcm1faAotI2RlZmluZSBiaXRzMnBybV9oICIkSWQgJCIKLQotLyoKLSoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCi0qICAgICAgICAgICAgICAgICAgICAgICAgIElOQ0xVREUgRklMRVMKLSoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCi0qLwotI2luY2x1ZGUgInR5cGVkZWYuaCIKLSNpbmNsdWRlICJtb2RlLmgiCi0KLSNpZmRlZiBfX2NwbHVzcGx1cwotZXh0ZXJuICJDIgotewotI2VuZGlmCi0KLSAgICAvKgotICAgICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCi0gICAgKiAgICAgICAgICAgICAgICAgICAgICAgICBERUZJTklUSU9OIE9GIERBVEEgVFlQRVMKLSAgICAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgotICAgICovCi0KLSAgICAvKgotICAgICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCi0gICAgKiAgICAgICAgICAgICAgICAgICAgICAgICBERUNMQVJBVElPTiBPRiBQUk9UT1RZUEVTCi0gICAgKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKLSAgICAqLwotICAgIC8qCi0gICAgKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKLSAgICAqCi0gICAgKiAgRnVuY3Rpb24gICAgOiBCaXRzMnBybQotICAgICogIFB1cnBvc2UgICAgIDogUmV0cmlldmVzIHRoZSB2ZWN0b3Igb2YgZW5jb2RlciBwYXJhbWV0ZXJzIGZyb20KLSAgICAqICAgICAgICAgICAgICAgIHRoZSByZWNlaXZlZCBzZXJpYWwgYml0cyBpbiB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AgICAgLyogRnJhbWUgc2l6ZSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotI2RlZmluZSBMX0ZSQU1FX0JZMiAgODAgICAgICAgIC8qIEZyYW1lIHNpemUgZGl2aWRlZCBieSAyICAgICAgICAgICAgICAgICAgKi8KLSNkZWZpbmUgTF9TVUJGUiAgICAgIDQwICAgICAgICAvKiBTdWJmcmFtZSBzaXplICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0jZGVmaW5lIExfQ09ERSAgICAgICA0MCAgICAgICAgLyogY29kZXZlY3RvciBsZW5ndGggICAgICAgICAgICAgICAgICAgICAgICAqLwotI2RlZmluZSBOQl9UUkFDSyAgICAgNSAgICAgICAgIC8qIG51bWJlciBvZiB0cmFja3MgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLSNkZWZpbmUgU1RFUCAgICAgICAgIDUgICAgICAgICAvKiBjb2RlYm9vayBzdGVwIHNpemUgICAgICAgICAgICAgICAgICAgICAgICovCi0jZGVmaW5lIE5CX1RSQUNLX01SMTAyICA0ICAgICAgLyogbnVtYmVyIG9mIHRyYWNrcyBtb2RlIG1yMTAyICAgICAgICAgICAgICAqLwotI2RlZmluZSBTVEVQX01SMTAyICAgICAgNCAgICAgIC8qIGNvZGVib29rIHN0ZXAgc2l6ZSBtb2RlIG1yMTAyICAgICAgICAgICAgKi8KLSNkZWZpbmUgTSAgICAgICAgICAgIDEwICAgICAgICAvKiBPcmRlciBvZiBMUCBmaWx0ZXIgICAgICAgICAgICAgICAgICAgICAgICovCi0jZGVmaW5lIE1QMSAgICAgICAgICAoTSsxKSAgICAgLyogT3JkZXIgb2YgTFAgZmlsdGVyICsgMSAgICAgICAgICAgICAgICAgICAqLwotI2RlZmluZSBMU0ZfR0FQICAgICAgMjA1ICAgICAgIC8qIE1pbmltdW0gZGlzdGFuY2UgYmV0d2VlbiBMU0YgYWZ0ZXIgcXVhbi0gKi8KLSAgICAvKiB0aXphdGlvbjsgNTAgSHogPSAyMDUgICA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ljZW5zZQotdGVybXMgbGlzdGVkIGFib3ZlIGhhcyBiZWVuIG9idGFpbmVkIGZyb20gdGhlIGNvcHlyaWdodCBob2xkZXIuCi0qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotLyoKLSoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCi0qKi0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0qKgotKiogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKioKLSoqICAgICBHU00gQU1SLU5CIHNwZWVjaCBjb2RlYyAgIFI5OCAgIFZlcnNpb24gNy41LjAgICBNYXJjaCAyLCAyMDAxICAgICAgICoqCi0qKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBSOTkgICBWZXJzaW9uIDMuMi4wICAgICAgICAgICAgICAgICAgICAgICAqKgotKiogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgUkVMLTQgVmVyc2lvbiA0LjAuMCAgICAgICAgICAgICAgICAgICAgICAgKioKLSoqICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICoqCi0qKi0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0qKgotKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKLSoKLSogICAgICBGaWxlICAgICAgICAgICAgIDogY25zdF92YWQuaAotKiAgICAgIFB1cnBvc2UgICAgICAgICAgOiBDb25zdGFudHMgYW5kIGRlZmluaXRpb25zIGZvciBWQUQKLSoKLSoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCi0qLwotI2lmbmRlZiBjbnN0X3ZhZF9oCi0jZGVmaW5lIGNuc3RfdmFkX2ggIiRJZCAkIgotCi0jZGVmaW5lIEZSQU1FX0xFTiAxNjAgICAgLyogTGVuZ3RoIChzYW1wbGVzKSBvZiB0aGUgaW5wdXQgZnJhbWUgICAgICAgICAgKi8KLSNkZWZpbmUgQ09NUExFTiA5ICAgICAgICAvKiBOdW1iZXIgb2Ygc3ViLWJhbmRzIHVzZWQgYnkgVkFEICAgICAgICAgICAgICAqLwotI2RlZmluZSBJTlZfQ09NUExFTiAzNjQxIC8qIDEuMC9DT01QTEVOKjJeMTUgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0jZGVmaW5lIExPT0tBSEVBRCA0MCAgICAgLyogbGVuZ3RoIG9mIHRoZSBsb29rYWhlYWQgdXNlZCBieSBzcGVlY2ggY29kZXIgKi8KLQotI2RlZmluZSBVTklUWSA1MTIgICAgICAgIC8qIFNjYWxpbmcgdXNlZCB3aXRoIFNOUiBjYWxjdWxhdGlvbiAgICAgICAgICAgICovCi0jZGVmaW5lIFVOSVJTSEZUIDYgICAgICAgLyogPSBsb2cyKE1BWF8xNi9VTklUWSkgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLQotI2RlZmluZSBUT05FX1RIUiAoV29yZDE2KSgwLjY1Kk1BWF8xNikgLyogVGhyZXNob2xkIGZvciB0b25lIGRldGVjdGlvbiAgICovCi0KLS8qIENvbnN0YW50cyBmb3IgYmFja2dyb3VuZCBzcGVjdHJ1bSB1cGRhdGUgKi8KLSNkZWZpbmUgQUxQSEFfVVAxICAgKFdvcmQxNikoKDEuMCAtIDAuOTUpKk1BWF8xN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KFdvcmQxNikoMjUwKSAgICAgICAgICAgICAgICAvKiA1IHNlY29uZCBoYW5nb3ZlciAgICAgICAgICAgICAgICAgICAgKi8KLQotI2RlZmluZSBDVkFEX0xPV1BPV19SRVNFVCAoV29yZDE2KSAoMC40MCAqIE1BWF8xNikgICAgIC8qIGluaXQgaW4gbG93IHBvd2VyIHNlZ21lbnQgICAgICAgICAgICAqLwotI2RlZmluZSBDVkFEX01JTl9DT1JSIChXb3JkMTYpICgwLjQwICogTUFYXzE2KSAgICAgICAgIC8qIGxvd2VzdCBhZGFwdGF0aW9uIHZhbHVlICAgICAgICAgICAgICAqLwotCi0jZGVmaW5lIENWQURfQlVSU1QgMjAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLyogc3BlZWNoIGJ1cnN0IGxlbmd0aCBmb3Igc3BlZWNoIHJlc2V0ICovCi0jZGVmaW5lIENWQURfQURBUFRfU0xPVyAoV29yZDE2KSgoIDEuMCAtIDAuOTgpICogTUFYXzE2KSAgICAgICAgLyogdGhyZXNob2xkIGZvciBzbG93IGFkYXB0aW9uICovCi0jZGVmaW5lIENWQURfQURBUFRfRkFTVCAoV29yZDE2KSgoMS4wIC0gMC45MikgKiBNQVhfMTYpICAgICAgICAgLyogdGhyZXNob2xkIGZvciBmYXN0IGFkYXB0aW9uICovCi0jZGVmaW5lIENWQURfQURBUFRfUkVBTExZX0ZBU1QgKFdvcmQxNikoKDEuMCAtIDAuODApICogTUFYXzE2KSAgLyogdGhyZXNob2xkIGZvciByZWFsbHkgZmFzdCAgICovCi0vKiBhZGFwdGlvbiAgICAgICAgICAgICAgICAgICAgKi8KLQotI2VuZGlmCmRpZmYgLS1naXQgYS9tZWRpYS9saWJzdGFnZWZyaWdodC9jb2RlY3MvYW1ybmIvY29tbW9uL2luY2x1ZGUvY29weS5oIGIvbWVkaWEvbGlic3RhZ2VmcmlnaHQvY29kZWNzL2Ftcm5iL2NvbW1vbi9pbmNsdWRlL2NvcHkuaApkZWxldGVkIGZp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vuc2UuCi0gKiAtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tCi0gKi8KLS8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCi1Qb3J0aW9ucyBvZiB0aGlzIGZpbGUgYXJlIGRlcml2ZWQgZnJvbSB0aGUgZm9sbG93aW5nIDNHUFAgc3RhbmRhcmQ6Ci0KLSAgICAzR1BQIFRTIDI2LjA3MwotICAgIEFOU0ktQyBjb2RlIGZvciB0aGUgQWRhcHRpdmUgTXVsdGktUmF0ZSAoQU1SKSBzcGVlY2ggY29kZWMKLSAgICBBdmFpbGFibGUgZnJvbSBodHRwOi8vd3d3LjNncHAub3JnCi0KLShDKSAyMDA0LCAzR1BQIE9yZ2FuaXphdGlvbmFsIFBhcnRuZXJzIChBUklCLCBBVElTLCBDQ1NBLCBFVFNJLCBUVEEsIFRUQykKLVBlcm1pc3Npb24gdG8gZGlzdHJpYnV0ZSwgbW9kaWZ5IGFuZCB1c2UgdGhpcyBmaWxlIHVuZGVyIHRoZSBzdGFuZGFyZCBsaWNlbnNlCi10ZXJtcyBsaXN0ZWQgYWJvdmUgaGFzIGJlZW4gb2J0YWluZWQgZnJvbSB0aGUgY29weXJpZ2h0IGhvbGRlci4KLSoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0vKgotKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKLSoKLSogICAgICBHU00gQU1SLU5CIHNwZWVjaCBjb2RlYyAgIFI5OCAgIFZlcnNpb24gNy41LjAgICBNYXJjaCAyLCAyMDAxCi0qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBSOTkgICBWZXJzaW9uIDMuMi4wCi0qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBSRUwtNCBWZXJzaW9uIDQuMC4wCi0qCi0qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgotKiAgICAgIEZpbGUgICAgICAgICAgICAgOiBjb3B5LmgKLSogICAgICBQdXJwb3NlICAgICAgICAgIDogQ29weSB2ZWN0b3IgeFtdIHRvIHlbXQotKgotKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKLSovCi0jaWZuZGVmIGNvcHlfaAotI2RlZmluZSBjb3B5X2ggIiRJZCAkIgotCi0vKgotKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKLSogICAgICAgICAgICAgICAgICAgICAgICAgSU5DTFVERSBGSUxFUwotKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKLSovCi0jaW5jbHVkZSAidHlwZWRlZi5oIgotCi0jaWZkZWYgX19jcGx1c3BsdXMKLWV4dGVybiAiQyIKLXsKLSNlbmRpZgotCi0gICAgLyoKLSAgICAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgotICAgICogICAgICAgICAgICAgICAgICAgICAgICAgREVGSU5JVElPTiBPRiBEQVRBIFRZUEVTCi0gICAgKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKLSAgICAqLwotCi0gICAgLyoKLSAgICAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgotICAgICogICAgICAgICAgICAgICAgICAgICAgICAgREVDTEFSQVRJT04gT0YgUFJPVE9UWVBFUwotICAgICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCi0gICAgKi8KLQotICAgIC8qCi0gICAgKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKLSAgICAqCi0gICAgKiAgRnVuY3Rpb24gICAgOiBDb3B5Ci0gICAgKiAgUHVycG9zZSAgICAgOiBDb3B5IHZlY3RvciB4W10gdG8geVtdLCB2ZWN0b3IgbGVuZ3RoIEwKLSAgICAqICBSZXR1cm5zICAgICA6IHZvaWQKLSAgICAqCi0gICAgKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKLSAgICAqLwotICAgIHZvaWQgQ29weSgKLSAgICAgICAgY29uc3QgV29yZDE2IHhbXSwgIC8qIGkgOiBpbnB1dCB2ZWN0b3IgKEwpICAgICovCi0gICAgICAgIFdvcmQxNiB5W10sICAgICAgICAvKiBvIDogb3V0cHV0IHZlY3RvciAoTCkgICAqLwotICAgICAgICBXb3JkMTYgTCAgICAgICAgICAgLyogaSA6IHZlY3RvciBsZW5ndGggICAgICAgKi8KLSAgICApOwotCi0jaWZkZWYgX19jcGx1c3BsdXMKLX0KLSNlbmRpZgotCi0jZW5kaWYKZGlmZiAtLWdpdCBhL21lZGlhL2xpYnN0YWdlZnJpZ2h0L2NvZGVjcy9hbXJuYi9jb21tb24vaW5jbHVkZS9kX2dhaW5fYy5oIGIvbWVkaWEvbGlic3RhZ2VmcmlnaHQvY29kZWNzL2Ftcm5iL2NvbW1vbi9pbmNsdWRlL2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tIGh0dHA6Ly93d3cuM2dwcC5vcmcKLQotKEMpIDIwMDQsIDNHUFAgT3JnYW5pemF0aW9uYWwgUGFydG5lcnMgKEFSSUIsIEFUSVMsIENDU0EsIEVUU0ksIFRUQSwgVFRDKQotUGVybWlzc2lvbiB0byBkaXN0cmlidXRlLCBtb2RpZnkgYW5kIHVzZSB0aGlzIGZpbGUgdW5kZXIgdGhlIHN0YW5kYXJkIGxpY2Vuc2UKLXRlcm1zIGxpc3RlZCBhYm92ZSBoYXMgYmVlbiBvYnRhaW5lZCBmcm9tIHRoZSBjb3B5cmlnaHQgaG9sZGVyLgotKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLS8qCi0qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgotKgotKiAgICAgIEdTTSBBTVItTkIgc3BlZWNoIGNvZGVjICAgUjk4ICAgVmVyc2lvbiA3LjUuMCAgIE1hcmNoIDIsIDIwMDEKLSogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFI5OSAgIFZlcnNpb24gMy4yLjAKLSogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFJFTC00IFZlcnNpb24gNC4wLjAKLSoKLSoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCi0qCi0qICAgICAgRmlsZSAgICAgICAgICAgICA6IGRfZ2Fpbl9wLmgKLSogICAgICBQdXJwb3NlICAgICAgICAgIDogRGVjb2RlcyB0aGUgcGl0Y2ggZ2FpbiB1c2luZyB0aGUgcmVjZWl2ZWQgaW5kZXguCi0qCi0qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgotKi8KLSNpZm5kZWYgZF9nYWluX3BfaAotI2RlZmluZSBkX2dhaW5fcF9oICIkSWQgJCIKLQotLyoKLSoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCi0qICAgICAgICAgICAgICAgICAgICAgICAgIElOQ0xVREUgRklMRVMKLSoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCi0qLwotI2luY2x1ZGUgInR5cGVkZWYuaCIKLSNpbmNsdWRlICJtb2RlLmgiCi0KLSNpZmRlZiBfX2NwbHVzcGx1cwotZXh0ZXJuICJDIgotewotI2VuZGlmCi0KLSAgICAvKgotICAgICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCi0gICAgKgotICAgICogIEZ1bmN0aW9uICAgIDogZF9nYWluX3BpdGNoCi0gICAgKiAgUHVycG9zZSAgICAgOiBEZWNvZGVzIHRoZSBwaXRjaCBnYWluIHVzaW5nIHRoZSByZWNlaXZlZCBpbmRleC4KLSAgICAqICBEZXNjcmlwdGlvbiA6IEluIGNhc2Ugb2Ygbm8gZnJhbWUgZXJhc3VyZSwgdGhlIGdhaW4gaXMgb2J0YWluZWQKLSAgICAqICAgICAgICAgICAgICAgIGZyb20gdGhlIHF1YW50aXphdGlvbiB0YWJsZSBhdCB0aGUgZ2l2ZW4gaW5kZXg7Ci0gICAgKiAgICAgICAgICAgICAgICBvdGhlcndpc2UsIGEgZG93bnNjYWxlZCBwYXN0IGdhaW4gaXMgdXNlZC4KLSAgICAqICBSZXR1cm5zICAgICA6IFF1YW50aXplZCBwaXRjaCBnYWluCi0gICAgKgotICAgICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq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gICAgLyotLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tCi0gICAgOyBHTE9CQUwgRlVOQ1RJT04gREVGSU5JVElPTlMKLSAgICA7IEZ1bmN0aW9uIFByb3RvdHlwZSBkZWNsYXJhdGlvbgotICAgIC0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0qLwotCi0gICAgLyoKLSAgICAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgotICAgICoKLSAgICAqICBGdW5jdGlvbiAgICA6IERfcGxzZl9yZXNldAotICAgICogIFB1cnBvc2UgICAgIDogUmVzZXRzIHN0YXRlIG1lbW9yeQotICAgICogIFJldHVybnMgICAgIDogMCBvbiBzdWNjZXNzCi0gICAgKgotICAgICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCi0gICAgKi8KLSAgICBXb3JkMTYgRF9wbHNmX3Jlc2V0KERfcGxzZlN0YXRlICpzdCk7Ci0KLSAgICAvKgotICAgICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCi0gICAgKgotICAgICogIEZ1bmN0aW9uICAgIDogRF9wbHNmX2V4aXQKLSAgICAqICBQdXJwb3NlICAgICA6IFRoZSBtZW1vcnkgdXNlZCBmb3Igc3RhdGUgbWVtb3J5IGlzIGZyZWVkCi0gICAgKiAgRGVzY3JpcHRpb24gOiBTdG9yZXMgTlVMTCBpbiAqc3QKLSAgICAqICBSZXR1cm5zICAgICA6IHZvaWQKLSAgICAqCi0gICAgKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKLSAgICAqLwotICAgIHZvaWQgRF9wbHNmX2V4aXQoRF9wbHNmU3RhdGUgKipzdCk7Ci0KLSAgICAvKgotICAgICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCi0gICAgKgotICAgICogIEZ1bmN0aW9uICAgIDogRF9wbHNmXzUKLSAgICAqICBQdXJwb3NlICAgICA6IERlY29kZXMgdGhlIDIgc2V0cyBvZiBMU1AgcGFyYW1ldGVycyBpbiBhIGZyYW1lCi0gICAgKiAgICAgICAgICAgICAgICB1c2luZyB0aGUgcmVjZWl2ZWQgcXVhbnRpemF0aW9uIGluZGljZXMuCi0gICAgKiAgRGVzY3JpcHRpb24gOiBUaGUgdHdvIHNldHMgb2YgTFNGcyBhcmUgcXVhbnRpemVkIHVzaW5nIHNwbGl0IGJ5Ci0gICAgKiAgICAgICAgICAgICAgICA1IG1hdHJpeCBxdWFudGl6YXRpb24gKHNwbGl0LU1RKSB3aXRoIDFzdCBvcmRlciBNQQotICAgICogICAgICAgICAgICAgICAgcHJlZGljdGlvbi4KLSAgICAqICAgICAgICAgICAgICAgIFNlZSAicV9wbHNmXzUuYyIgZm9yIG1vcmUgZGV0YWlscyBhYm91dCB0aGUKLSAgICAqICAgICAgICAgICAgICAgIHF1YW50aXphdGlvbiBwcm9jZWR1cmUKLSAgICAqICBSZXR1cm5zICAgICA6IDAKLSAgICAqCi0gICAgKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKLSAgICAqLwotICAgIHZvaWQgRF9wbHNmXzUoCi0gICAgICAgIERfcGxzZlN0YXRlICpzdCwgIC8qIGkvbzogU3RhdGUgdmFyaWFibGVzICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0gICAgICAgIFdvcmQxNiBiZmksICAgICAgIC8qIGkgIDogYmFkIGZyYW1lIGluZGljYXRvciAoc2V0IHRvIDEgaWYgYSBiYWQKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZyYW1lIGlzIHJlY2VpdmVkKSAgICAgICAgICAgICAgICAgICAgICAgICAqLwotICAgICAgICBXb3JkMTYgKmluZGljZSwgICAvKiBpICA6IHF1YW50aXphdGlvbiBpbmRpY2VzIG9mIDUgc3VibWF0cmljZXMsIFEwICAqLwotICAgICAgICBXb3JkMTYgKmxzcDFfcSwgICAvKiBvICA6IHF1YW50aXplZCAxc3QgTFNQIHZlY3RvciAoTSkgICAgICAgICAgIFExNSAqLwotICAgICAgICBXb3JkMTYgKmxzcDJfcSwgICAvKiBvICA6IHF1YW50aXplZCAybmQgTFNQIHZlY3RvciAoTSkgICAgICAgICAgIFExNSAqLwotICAgICAgICBGbGFnICAqcE92ZXJmbG93ICAvKiBvIDogRmxhZyBzZXQgd2hlbiBvdmVyZmxvdyBvY2N1cnMgICAgICAgICAgICAgICAqLwotICAgICk7Ci0KLSAgICAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgotICAgICAqCi0gICAgICogIEZVTkNUSU9OOiAgIERfcGxzZl8zKCkKLSAgICAgKgotICAgICAqICBQVVJQT1NFOiBEZWNvZGVzIHRoZSBMU1AgcGFyYW1ldGVycyB1c2luZyB0aGUgcmVjZWl2ZWQgcXVhbnRpemF0aW9uCi0gICAgICogICAgICAgICAgIGluZGljZXMuMXN0IG9yZGVyIE1BIHByZWRpY3Rpb24gYW5kIHNwbGl0IGJ5IDMgbWF0cml4Ci0gICAgICogICAgICAgICAgIHF1YW50aXphdGlvbiAoc3BsaXQtTVEpCi0gICAgICoKLSAgICAgKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLQotICAgIHZvaWQgRF9wbHNmXzMoCi0gICAgICAgIERfcGxzZlN0YXRlICpzdCwgIC8qIGkvbzogU3RhdGUgc3RydWN0ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0gICAgICAgIGVudW0gTW9kZSBtb2RlLCAgIC8qIGkgIDogY29kZXIgbW9kZSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0gICAgICAgIFdvcmQxNiBiZmksICAgICAgIC8qIGkgIDogYmFkIGZyYW1lIGluZGljYXRvciAoc2V0IHRvIDEgaWYgYSAgICAgICAgICovCi0gICAgICAgIC8qICAgICAgYmFkIGZyYW1lIGlzIHJlY2VpdmVkKSAgICAgICAgICAgICAgICAgICAgICovCi0gICAgICAgIFdvcmQxNiAqIGluZGljZSwgIC8qIGkgIDogcXVhbnRpemF0aW9uIGluZGljZXMgb2YgMyBzdWJtYXRyaWNlcywgUTAgICovCi0gICAgICAgIFdvcmQxNiAqIGxzcDFfcSwgIC8qIG8gIDogcXVhbnRpemVkIDFzdCBMU1AgdmVjdG9yLCAgICAgICAgICAgICAgUTE1ICovCi0gICAgICAgIEZsYWcgICpwT3ZlcmZsb3cgIC8qIG8gOiBGbGFnIHNldCB3aGVuIG92ZXJmbG93IG9jY3VycyAgICAgICAgICAgICAgICovCi0gICAgKTsKLQotICAgIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCi0gICAgICoKLSAgICAgKiAgRlVOQ1RJT046ICAgSW5pdF9EX3Bsc2ZfMygpCi0gICAgICoKLSAgICAgKiAgUFVSUE9TRTogU2V0IHRoZSBwYXN0X3JfcVtNXSB2ZWN0b3IgdG8gb25lIG9mIHRoZSBlaWdodAotICAgICAqICAgICAgICAgICBwYXN0X3JxX2luaXQgdmVjdG9ycy4KLSAgICAgKgotICAgICAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqK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eSBhbmQgdXNlIHRoaXMgZmlsZSB1bmRlciB0aGUgc3RhbmRhcmQgbGljZW5zZQotdGVybXMgbGlzdGVkIGFib3ZlIGhhcyBiZWVuIG9idGFpbmVkIGZyb20gdGhlIGNvcHlyaWdodCBob2xkZXIuCi0qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotLyoKLSoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCi0qCi0qICAgICAgR1NNIEFNUi1OQiBzcGVlY2ggY29kZWMgICBSOTggICBWZXJzaW9uIDcuNS4wICAgTWFyY2ggMiwgMjAwMQotKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgUjk5ICAgVmVyc2lvbiAzLjIuMAotKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgUkVMLTQgVmVyc2lvbiA0LjAuMAotKgotKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKLSoKLSogICAgICBGaWxlICAgICAgICAgICAgIDogZnJhbWUuaAotKiAgICAgIFB1cnBvc2UgICAgICAgICAgOiBEZWNsYXJhdGlvbiBvZiByZWNlaXZlZCBhbmQgdHJhbnNtaXR0ZWQgZnJhbWUgdHlwZXMKLSoKLSoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCi0qLwotI2lmbmRlZiBmcmFtZV9oCi0jZGVmaW5lIGZyYW1lX2ggIiRJZCAkIgotCi0vKgotKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKLSogICAgICAgICAgICAgICAgICAgICAgICAgSU5DTFVERSBGSUxFUwotKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKLSovCi0KLQotI2lmZGVmIF9fY3BsdXNwbHVzCi1leHRlcm4gIkMiCi17Ci0jZW5kaWYKLQotICAgIC8qCi0gICAgKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKLSAgICAqICAgICAgICAgICAgICAgICAgICAgICAgIERFRklOSVRJT04gT0YgREFUQSBUWVBFUwotICAgICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCi0gICAgKiBOb3RlOiBUaGUgb3JkZXIgb2YgdGhlIFRYIGFuZCBSWF9UeXBlIGlkZW50aWZpZXJzIGhhcyBiZWVuIGNob3NlbiBpbgotICAgICogICAgICAgdGhlIHdheSBiZWxvdyB0byBiZSBjb21wYXRpYmxlIHRvIGFuIGVhcmxpZXIgdmVyc2lvbiBvZiB0aGUKLSAgICAqICAgICAgIEFNUi1OQiBDIHJlZmVyZW5jZSBwcm9ncmFtLgotICAgICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCi0gICAgKi8KLQotICAgIGVudW0gUlhGcmFtZVR5cGUgeyBSWF9TUEVFQ0hfR09PRCA9IDAsCi0gICAgICAgIFJYX1NQRUVDSF9ERUdSQURFRCwKLSAgICAgICAgUlhfT05TRVQsCi0gICAgICAgIFJYX1NQRUVDSF9CQUQsCi0gICAgICAgIFJYX1NJRF9GSVJTVCwKLSAgICAgICAgUlhfU0lEX1VQREFURSwKLSAgICAgICAgUlhfU0lEX0JBRCwKLSAgICAgICAgUlhfTk9fREFUQSwKLSAgICAgICAgUlhfTl9GUkFNRVRZUEVTICAgICAvKiBudW1iZXIgb2YgZnJhbWUgdHlwZXMgKi8KLSAgICB9OwotCi0gICAgZW51bSBUWEZyYW1lVHlwZSB7IFRYX1NQRUVDSF9HT09EID0gMCwKLSAgICAgICAgICAgICAgICAgICAgICAgVFhfU0lEX0ZJUlNULAotICAgICAgICAgICAgICAgICAgICAgICBUWF9TSURfVVBEQVRFLAotICAgICAgICAgICAgICAgICAgICAgICBUWF9OT19EQVRBLAotICAgICAgICAgICAgICAgICAgICAgICBUWF9TUEVFQ0hfREVHUkFERUQsCi0gICAgICAgICAgICAgICAgICAgICAgIFRYX1NQRUVDSF9CQUQsCi0gICAgICAgICAgICAgICAgICAgICAgIFRYX1NJRF9CQUQsCi0gICAgICAgICAgICAgICAgICAgICAgIFRYX09OU0VULAotICAgICAgICAgICAgICAgICAgICAgICBUWF9OX0ZSQU1FVFlQRVMgICAgIC8qIG51bWJlciBvZiBmcmFtZSB0eXBlcyAqLwotICAgICAgICAgICAgICAgICAgICAgfTsKLQotCi0gICAgLyogQ2hhbm5lbCBkZWNvZGVkIGZyYW1lIHR5cGUgKi8KLSAgICBlbnVtIENIREVDRnJhbWVUeXBlIHsgQ0hERUNfU0lEX0ZJUlNUID0gMCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgQ0hERUNfU0lEX0ZJUlNUX0lOQ09NUExFVEUsCi0gICAgICAgICAgICAgICAgICAgICAgICAgIENIREVDX1NJRF9VUERBVEVfSU5DT01QTEVURSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgQ0hERUNfU0lEX1VQREFURSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgQ0hERUNfU1BFRUNILAotICAgICAgICAgICAgICAgICAgICAgICAgICBDSERFQ19TUEVFQ0hfT05TRVQsCi0gICAgICAgICAgICAgICAgICAgICAgICAgIENIREVDX0VTQ0FQRV9NQVJLRVIsCi0gICAgICAgICAgICAgICAgICAgICAgICAgIENIREVDX0VTQ0FQRV9EQVRBLAotICAgICAgICAgICAgICAgICAgICAgICAgICBDSERFQ19OT19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S0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tKi8KLQotICAgIGVudW0gRnJhbWVfVHlwZV8zR1BQCi0gICAgewotICAgICAgICBBTVJfNDc1ID0gMCwgICAgICAgIC8qIDQuNzUga2JwcyAgICAqLwotICAgICAgICBBTVJfNTE1LCAgICAgICAgICAgIC8qIDUuMTUga2JwcyAgICAqLwotICAgICAgICBBTVJfNTksICAgICAgICAgICAgIC8qIDUuOSBrYnBzICAgICAqLwotICAgICAgICBBTVJfNjcsICAgICAgICAgICAgIC8qIDYuNyBrYnBzICAgICAqLwotICAgICAgICBBTVJfNzQsICAgICAgICAgICAgIC8qIDcuNCBrYnBzICAgICAqLwotICAgICAgICBBTVJfNzk1LCAgICAgICAgICAgIC8qIDcuOTUga2JwcyAgICAqLwotICAgICAgICBBTVJfMTAyLCAgICAgICAgICAgIC8qIDEwLjIga2JwcyAgICAqLwotICAgICAgICBBTVJfMTIyLCAgICAgICAgICAgIC8qIDEyLjIga2JwcyAgICAqLwotICAgICAgICBBTVJfU0lELCAgICAgICAgICAgIC8qIEdTTSBBTVIgRFRYICAqLwotICAgICAgICBHU01fRUZSX1NJRCwgICAgICAgIC8qIEdTTSBFRlIgRFRYICAqLwotICAgICAgICBURE1BX0VGUl9TSUQsICAgICAgIC8qIFRETUEgRUZSIERUWCAqLwotICAgICAgICBQRENfRUZSX1NJRCwgICAgICAgIC8qIFBEQyBFRlIgRFRYICAqLwotICAgICAgICBGT1JfRlVUVVJFX1VTRTEsICAgIC8qIFVudXNlZCAxICAgICAqLwotICAgICAgICBGT1JfRlVUVVJFX1VTRTIsICAgIC8qIFVudXNlZCAyICAgICAqLwotICAgICAgICBGT1JfRlVUVVJFX1VTRTMsICAgIC8qIFVudXNlZCAzICAgICAqLwotICAgICAgICBBTVJfTk9fREFUQSAgICAgICAgIC8qIE5vIGRhdGEgICAgICAqLwotICAgIH07Ci0KLSAgICAvKi0tLS0tLS0tLS0tLS0tLS0tLS0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CkKLSAgICAgKiBQVVJQT1NFOiBNQSBwcmVkaWN0aW9uIG9mIHRoZSBpbm5vdmF0aW9uIGVuZXJneQotICAgICAqICAgICAgICAgIChpbiBkQi8oMjAqbG9nMTAoMikpKSB3aXRoIG1lYW4gIHJlbW92ZWQpLgotICAgICAqLwotICAgIHZvaWQgZ2NfcHJlZCgKLSAgICAgICAgZ2NfcHJlZFN0YXRlICpzdCwgICAvKiBpL286IFN0YXRlIHN0cnVjdCAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0gICAgICAgIGVudW0gTW9kZSBtb2RlLCAgICAgLyogaSAgOiBBTVIgbW9kZSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotICAgICAgICBXb3JkMTYgKmNvZGUsICAgICAgIC8qIGkgIDogaW5ub3ZhdGl2ZSBjb2RlYm9vayB2ZWN0b3IgKExfU1VCRlIpICAgKi8KLSAgICAgICAgLyogICAgICBNUjEyMjogUTEyLCBvdGhlciBtb2RlczogUTEzICAgICAgICAgICAqLwotICAgICAgICBXb3JkMTYgKmV4cF9nY29kZTAsIC8qIG8gIDogZXhwb25lbnQgb2YgcHJlZGljdGVkIGdhaW4gZmFjdG9yLCBRMCAgKi8KLSAgICAgICAgV29yZDE2ICpmcmFjX2djb2RlMCwvKiBvICA6IGZyYWN0aW9uIG9mIHByZWRpY3RlZCBnYWluIGZhY3RvciAgUTE1ICovCi0gICAgICAgIFdvcmQxNiAqZXhwX2VuLCAgICAgLyogbyAgOiBleHBvbmVudCBvZiBpbm5vdmF0aW9uIGVuZXJneSwgICAgIFEwICAqLwotICAgICAgICAvKiAgICAgIChvbmx5IGNhbGN1bGF0ZWQgZm9yIE1SNzk1KSAgICAgICAgICAgICovCi0gICAgICAgIFdvcmQxNiAqZnJhY19lbiwgICAgLyogbyAgOiBmcmFjdGlvbiBvZiBpbm5vdmF0aW9uIGVuZXJneSwgICAgIFExNSAqLwotICAgICAgICAvKiAgICAgIChvbmx5IGNhbGN1bGF0ZWQgZm9yIE1SNzk1KSAgICAgICAgICAgICovCi0gICAgICAgIEZsYWcgICAqcE92ZXJmbG93Ci0gICAgKTsKLQotICAgIC8qCi0gICAgICogRlVOQ1RJT046ICBnY19wcmVkX3VwZGF0ZSgpCi0gICAgICogUFVSUE9TRTogdXBkYXRlIE1BIHByZWRpY3RvciB3aXRoIGxhc3QgcXVhbnRpemVkIGVuZXJneQotICAgICAqLwotICAgIHZvaWQgZ2NfcHJlZF91cGRhdGUoCi0gICAgICAgIGdjX3ByZWRTdGF0ZSAqc3QsICAgICAgLyogaS9vOiBTdGF0ZSBzdHJ1Y3QgICAgICAgICAgICAgICAgICAgICAqLwotICAgICAgICBXb3JkMTYgcXVhX2VuZXJfTVIxMjIsIC8qIGkgIDogcXVhbnRpemVkIGVuZXJneSBmb3IgdXBkYXRlLCBRMTAgKi8KLSAgICAgICAgLyogICAgICAobG9nMihxdWFfZXJyKSkgICAgICAgICAgICAgICAgICAqLwotICAgICAgICBXb3JkMTYgcXVhX2VuZXIgICAgICAgIC8qIGkgIDogcXVhbnRpemVkIGVuZXJneSBmb3IgdXBkYXRlLCBRMTAgKi8KLSAgICAgICAgLyogICAgICAoMjAqbG9nMTAocXVhX2VycikpICAgICAgICAgICAgICAqLwotICAgICk7Ci0KLSAgICAvKgotICAgICAqIEZVTkNUSU9OOiAgZ2NfcHJlZF9hdmVyYWdlX2xpbWl0ZWQoKQotICAgICAqIFBVUlBPU0U6IGdldCBhdmVyYWdlIG9mIE1BIHByZWRpY3RvciBzdGF0ZSB2YWx1ZXMgKHdpdGggYSBsb3dlciBsaW1pdCkKLSAgICAgKiAgICAgICAgICBbdXNlZCBpbiBlcnJvciBjb25jZWFsbWVudF0KLSAgICAgKi8KLSAgICB2b2lkIGdjX3ByZWRfYXZlcmFnZV9saW1pdGVkKAotICAgICAgICBnY19wcmVkU3RhdGUgKnN0LCAgICAgICAvKiBpOiBTdGF0ZSBzdHJ1Y3QgICAgICAgICAgICAgICAgICAgICovCi0gICAgICAgIF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otICAgIEF2YWlsYWJsZSBmcm9tIGh0dHA6Ly93d3cuM2dwcC5vcmcKLQotKEMpIDIwMDQsIDNHUFAgT3JnYW5pemF0aW9uYWwgUGFydG5lcnMgKEFSSUIsIEFUSVMsIENDU0EsIEVUU0ksIFRUQSwgVFRDKQotUGVybWlzc2lvbiB0byBkaXN0cmlidXRlLCBtb2RpZnkgYW5kIHVzZSB0aGlzIGZpbGUgdW5kZXIgdGhlIHN0YW5kYXJkIGxpY2Vuc2UKLXRlcm1zIGxpc3RlZCBhYm92ZSBoYXMgYmVlbiBvYnRhaW5lZCBmcm9tIHRoZSBjb3B5cmlnaHQgaG9sZGVyLgotKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLS8qCi0qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgotKgotKiAgICAgIEdTTSBBTVItTkIgc3BlZWNoIGNvZGVjICAgUjk4ICAgVmVyc2lvbiA3LjUuMCAgIE1hcmNoIDIsIDIwMDEKLSogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFI5OSAgIFZlcnNpb24gMy4yLjAKLSogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFJFTC00IFZlcnNpb24gNC4wLjAKLSoKLSoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCi0qCi0qICAgICAgRmlsZSAgICAgICAgICAgICA6IGdtZWRfbi5oCi0qICAgICAgUHVycG9zZSAgICAgICAgICA6IGNhbGN1bGF0ZXMgTi1wb2ludCBtZWRpYW4uCi0qCi0qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgotKi8KLSNpZm5kZWYgZ21lZF9uX2gKLSNkZWZpbmUgZ21lZF9uX2ggIiRJZCAkIgotCi0vKgotKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKLSogICAgICAgICAgICAgICAgICAgICAgICAgSU5DTFVERSBGSUxFUwotKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKLSovCi0jaW5jbHVkZSAidHlwZWRlZi5oIgotCi0jaWZkZWYgX19jcGx1c3BsdXMKLWV4dGVybiAiQyIKLXsKLSNlbmRpZgotCi0gICAgLyoKLSAgICAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgotICAgICogICAgICAgICAgICAgICAgICAgICAgICAgREVGSU5JVElPTiBPRiBEQVRBIFRZUEVTCi0gICAgKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKLSAgICAqLwotCi0gICAgLyoKLSAgICAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgotICAgICogICAgICAgICAgICAgICAgICAgICAgICAgREVDTEFSQVRJT04gT0YgUFJPVE9UWVBFUwotICAgICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCi0gICAgKi8KLSAgICBXb3JkMTYgZ21lZF9uKCAgICAvKiBvIDogaW5kZXggb2YgdGhlIG1lZGlhbiB2YWx1ZSAoMC4uLk4tMSkgICAgICAqLwotICAgICAgICBXb3JkMTYgaW5kW10sIC8qIGkgOiBQYXN0IGdhaW4gdmFsdWVzIC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ICAgKiAgICAgICAgICAgICAgICBUaGUgTFNQcyBhcmUgcXVhbnRpemVkIGFuZCB0cmFuc21pdHRlZCBhdCB0aGUgMm5kIGFuZAotICAgICogICAgICAgICAgICAgICAgNHRoIHN1YmZyYW1lcyAodHdpY2UgcGVyIGZyYW1lKSBhbmQgaW50ZXJwb2xhdGVkIGF0IHRoZQotICAgICogICAgICAgICAgICAgICAgMXN0IGFuZCAzcmQgc3ViZnJhbWUuCi0gICAgKgotICAgICogICAgICAgICAgICAgICAgICAgICAgfC0tLS0tLXwtLS0tLS18LS0tLS0tfC0tLS0tLXwKLSAgICAqICAgICAgICAgICAgICAgICAgICAgICAgIHNmMSAgICBzZjIgICAgc2YzICAgIHNmNAotICAgICogICAgICAgICAgICAgICAgICAgRjAgICAgICAgICAgICBGbSAgICAgICAgICAgIEYxCi0gICAgKgotICAgICogICAgICAgICAgICAgICAgIHNmMTogICAxLzIgRm0gKyAxLzIgRjAgICAgICAgICBzZjM6ICAgMS8yIEYxICsgMS8yIEZtCi0gICAgKiAgICAgICAgICAgICAgICAgc2YyOiAgICAgICBGbSAgICAgICAgICAgICAgICAgIHNmNDogICAgICAgRjEKLSAgICAqICBSZXR1cm5zICAgICA6IHZvaWQKLSAgICAqCi0gICAgKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKLSAgICAqLwotICAgIHZvaWQgSW50X2xwY18xYW5kMygKLSAgICAgICAgV29yZDE2IGxzcF9vbGRbXSwgIC8qIGkgOiBMU1AgdmVjdG9yIGF0IHRoZSA0dGggc3ViZnIuIG9mIHBhc3QgZnJhbWUgKE0pICovCi0gICAgICAgIFdvcmQxNiBsc3BfbWlkW10sICAvKiBpIDogTFNQIHZlY3RvciBhdCB0aGUgMm5kIHN1YmZyLiBvZgotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcHJlc2VudCBmcmFtZSAoTSkgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotICAgICAgICBXb3JkMTYgbHNwX25ld1tdLCAgLyogaSA6IExTUCB2ZWN0b3IgYXQgdGhlIDR0aCBzdWJmci4gb2YKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHByZXNlbnQgZnJhbWUgKE0pICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLSAgICAgICAgV29yZDE2IEF6W10sICAgICAgIC8qIG8gOiBpbnRlcnBvbGF0ZWQgTFAgcGFyYW1ldGVycyBpbiBhbGwgc3ViZnIuCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoQVpfU0laRSkgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0gICAgICAgIEZsYWcgICAqcE92ZXJmbG93Ci0gICAgKTsKLQotICAgIC8qCi0gICAgKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKLSAgICAqCi0gICAgKiAgRnVuY3Rpb24gICAgOiBJbnRfbHBjXzFhbmQzXzIKLSAgICAqICBQdXJwb3NlICAgICA6IEludGVycG9sYXRpb24gb2YgdGhlIExQQyBwYXJhbWV0ZXJzLiBTYW1lIGFzIHRoZSBJbnRfbHBjCi0gICAgKiAgICAgICAgICAgICAgICBmdW5jdGlvbiBidXQgd2UgZG8gbm90IHJlY29tcHV0ZSBBeigpIGZvciBzdWJmcmFtZSAyIGFuZAotICAgICogICAgICAgICAgICAgICAgNCBiZWNhdXNlIGl0IGlzIGFscmVhZHkgYXZhaWxhYmxlLgotICAgICogIFJldHVybnMgICAgIDogdm9pZAotICAgICoKLSAgICAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgotICAgICovCi0gICAgdm9pZCBJbnRfbHBjXzFhbmQzXzIoCi0gICAgICAgIFdvcmQxNiBsc3Bfb2xkW10sICAvKiBpIDogTFNQIHZlY3RvciBhdCB0aGUgNHRoIHN1YmZyLiBvZiBwYXN0IGZyYW1lIChNKSAqLwotICAgICAgICBXb3JkMTYgbHNwX21pZFtdLCAgLyogaSA6IExTUCB2ZWN0b3IgYXQgdGhlIDJuZCBzdWJmcmFtZSBvZgotICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwcmVzZW50IGZyYW1lIChNKSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotICAgICAgICBXb3JkMTYgbHNwX25ld1tdLCAgLyogaSA6IExTUCB2ZWN0b3IgYXQgdGhlIDR0aCBzdWJmcmFtZSBvZgotICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwcmVzZW50IGZyYW1lIChNKSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotICAgICAgICBXb3JkMTYgQXpbXSwgICAgICAgLyogbyA6aW50ZXJwb2xhdGVkIExQIHBhcmFtZXRlcnMKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaW4gc3ViZnJhbWVzIDEgYW5kIDMgKEFaX1NJWkUpICAgICAgICAgICAgICAgICAgICAgKi8KLSAgICAgICAgRmxhZyAgICpwT3ZlcmZsb3cKLSAgICApOwotCi0gICAgLyoKLSAgICAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgotICAgICoKLSAgICAqICBGdW5jdGlvbiAgICA6IEludF9scGNfMXRvMwotICAgICogIFB1cnBvc2UgICAgIDogSW50ZXJwb2xhdGVzIHRoZSBMU1BzIGFuZCBjb252ZXJ0cyB0byBMUEMgcGFyYW1ldGVycwotICAgICogICAgICAgICAgICAgICAgdG8gZ2V0IGEgZGlmZmVyZW50IExQIGZpbHRlciBpbiBlYWNoIHN1YmZyYW1lLgotICAgICogIERlc2NyaXB0aW9uIDogVGhlIDIwIG1zIHNwZWVjaCBmcmFtZSBpcyBkaXZpZGVkIGludG8gNCBzdWJmcmFtZXMuCi0gICAgKiAgICAgICAgICAgICAgICBUaGUgTFNQcyBhcmUgcXVhbnRpemVkIGFuZCB0cmFuc21pdHRlZCBhdCB0aGUgNHRoCi0gICAgKiAgICAgICAgICAgICAgICBzdWJmcmFtZXMgKG9uY2UgcGVyIGZyYW1lKSBhbmQgaW50ZXJwb2xhdGVkIGF0IHRoZQotICAgICogICAgICAgICAgICAgICAgMXN0LCAybmQgYW5kIDNyZCBzdWJmcmFtZS4KLSAgICAqCi0gICAgKiAgICAgICAgICAgICAgICAgICAgICB8LS0tLS0tfC0tLS0tLXwtLS0tLS18LS0tLS0tfAotICAgICogICAgICAgICAgICAgICAgICAgICAgICAgc2YxICAgIHNmMiAgICBzZjMgICAgc2Y0Ci0gICAgKiAgICAgICAgICAgICAgICAgICBGMCAgICAgICAgICAgICAgICAgICAgICAgICAgRjEKLSAgICAqCi0gICAgKiAgICAgICAgICAgICAgICAgc2YxOiAgIDMvNCBGMCArIDEvNCBGMSAgICAgICAgIHNmMzogICAxLzQgRjAgKyAzLzQgRjEKLSAgICAqICAgICAgICAgICAgICAgICBzZjI6ICAgMS8yIEYwICsgMS8yIEYxICAgICAgICAgc2Y0OiAgICAgICBGMQotICAgICogIFJldHVybnMgICAgIDogdm9pZAotICAgICoKLSAgICAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgotICAgICovCi0gICAgdm9pZCBJbnRfbHBjXzF0bzMoCi0gICAgICAgIFdvcmQxNiBsc3Bfb2xkW10sIC8qIGkgOiBMU1AgdmVjdG9yIGF0IHRoZSA0dGggU0Ygb2YgcGFzdCBmcmFtZSAoTSkgICAgICAqLwotICAgICAgICBXb3JkMTYgbHNwX25ld1tdLCAvKiBpIDogTFNQIHZlY3RvciBhdCB0aGUgNHRoIFNGIG9mIHByZXNlbnQgZnJhbWUgKE0pICAgKi8KLSAgICAgICAgV29yZDE2IEF6W10sICAgICAgLyogbyA6IGludGVycG9sYXRlZCBMUCBwYXJhbWV0ZXJzIGluIGFsbCBTRnMgKEFaX1NJWkUpICovCi0gICAgICAgIEZsYWcgICAqcE92ZXJmbG93Ci0gICAgKTsKLQotICAgIC8qCi0gICAgKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKLSAgICAqCi0gICAgKiAgRnVuY3Rpb24gICAgOiBJbnRfbHBjXzF0bzNfMgotICAgICogIFB1cnBvc2UgICAgIDogSW50ZXJwb2xhdGlvbiBvZiB0aGUgTFBDIHBhcmFtZXRlcnMuIFNhbWUgYXMgdGhlIEludF9scGMKLSAgICAqICAgICAgICAgICAgICAgIGZ1bmN0aW9uIGJ1dCB3ZSBkbyBub3QgcmVjb21wdXRlIEF6KCkgZm9yIHN1YmZyYW1lIDQKLSAgICAqICAgICAgICAgICAgICAgIGJlY2F1c2UgaXQgaXMgYWxyZWFkeSBhdmFpbGFibGUuCi0gICAgKiAgUmV0dXJucyAgICAgOiB2b2lkCi0gICAgKgotICAgICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCi0gICAgKi8KLSAgICB2b2lkIEludF9scGNfMXRvM18yKAotICAgICAgICBXb3JkMTYgbHNwX29sZFtdLCAgLyogaSA6IExTUCB2ZWN0b3IgYXQgdGhlIDR0aCBTRiBvZiBwYXN0IGZyYW1lIChNKSAqLwotICAgICAgICBXb3JkMTYgbHNwX25ld1tdLCAgLyogaSA6IExTUCB2ZWN0b3IgYXQgdGhlIDR0aCBTRiBwcmVzZW50IGZyYW1lIChNKSAqLwotICAgICAgICBXb3JkMTYgQXpbXSwgICAgICAgLyogbyA6aW50ZXJwb2xhdGVkIExQIHBhcmFtZXRlcnMgaW4gU0ZzIDEsIDIsIDMKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKEFaX1NJWkUpICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC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gICAgcmV0dXJuKHJlc3VsdCk7Ci0gICAgfQotCi0jZWxpZiBkZWZpbmVkKFBWX0FSTV9HQ0NfVjUpIC8qIEluc3RydWN0aW9ucyBmb3IgQVJNLWxpbnV4IGNyb3NzLWNvbXBpbGVyKi8KLQotICAgIF9faW5saW5lIFdvcmQzMiBMX2FkZChyZWdpc3RlciBXb3JkMzIgTF92YXIxLCByZWdpc3RlciBXb3JkMzIgTF92YXIyLCBGbGFnICpwT3ZlcmZsb3cpCi0gICAgewotICAgICAgICByZWdpc3RlciBXb3JkMzIgcmEgPSBMX3ZhcjE7Ci0gICAgICAgIHJlZ2lzdGVyIFdvcmQzMiByYiA9IExfdmFyMjsKLSAgICAgICAgV29yZDMyIHJlc3VsdDsKLQotICAgICAgICBPU0NMX1VOVVNFRF9BUkcocE92ZXJmbG93KTsKLQotICAgICAgICBhc20gdm9sYXRpbGUoInFhZGQgJTAsICUxLCAlMiIKLSAgICAgICAgICAgICA6ICI9ciIocmVzdWx0KQotICAgICAgICAgICAgICAgICAgICAgICAgICAgICA6ICJyIihyYSksICJyIihyYikKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICApOwotICAgICAgICByZXR1cm4gKHJlc3VsdCk7Ci0KLSAgICB9Ci0KLSNlbHNlIC8qIEMgRVFVSVZBTEVOVCAqLwotCi0KLSAgICBzdGF0aWMgaW5saW5lIFdvcmQzMiBMX2FkZChyZWdpc3RlciBXb3JkMzIgTF92YXIxLCByZWdpc3RlciBXb3JkMzIgTF92YXIyLCBGbGFnICpwT3ZlcmZsb3cpCi0gICAgewotICAgICAgICBXb3JkMzIgTF9zdW07Ci0KLSAgICAgICAgTF9zdW0gPSBMX3ZhcjEgKyBMX3ZhcjI7Ci0KLSAgICAgICAgaWYgKChMX3ZhcjEgXiBMX3ZhcjIpID49IDApCi0gICAgICAgIHsKLSAgICAgICAgICAgIGlmICgoTF9zdW0gXiBMX3ZhcjEpIDwgMCkKLSAgICAgICAgICAgIHsKLSAgICAgICAgICAgIC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Exfc3VtOwotCi0gICAgICAgIE9TQ0xfVU5VU0VEX0FSRyhwT3ZlcmZsb3cpOwotCi0gICAgICAgIF9fYXNtIHtTTVVMQkIgcmVzdWx0LCB2YXIxLCB2YXIyfQotICAgICAgICBfX2FzbSB7UURBREQgTF9zdW0sIExfdmFyMywgcmVzdWx0fQotICAgICAgICByZXR1cm4gKExfc3VtKTsKLSAgICB9Ci0KLSNlbGlmIGRlZmluZWQoUFZfQVJNX0dDQ19WNSkgLyogSW5zdHJ1Y3Rpb25zIGZvciBBUk0tbGludXggY3Jvc3MtY29tcGlsZXIqLwotCi0gICAgc3RhdGljIGlubGluZSBXb3JkMzIgTF9tYWMoV29yZDMyIExfdmFyMywgV29yZDE2IHZhcjEsIFdvcmQxNiB2YXIyLCBGbGFnICpwT3ZlcmZsb3cpCi0gICAgewotICAgICAgICByZWdpc3RlciBXb3JkMzIgcmEgPSBMX3ZhcjM7Ci0gICAgICAgIHJlZ2lzdGVyIFdvcmQzMiByYiA9IHZhcjE7Ci0gICAgICAgIHJlZ2lzdGVyIFdvcmQzMiByYyA9IHZhcjI7Ci0gICAgICAgIFdvcmQzMiByZXN1bHQ7Ci0KLSAgICAgICAgT1NDTF9VTlVTRURfQVJHKHBPdmVyZmxvdyk7Ci0KLSAgICAgICAgYXNtIHZvbGF0aWxlKCJzbXVsYmIgJTAsICUxLCAlMiIKLSAgICAgICAgICAgICA6ICI9ciIocmVzdWx0KQotICAgICAgICAgICAgICAgICAgICAgICAgICAgICA6ICJyIihyYiksICJyIihyYykKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICApOwotCi0gICAgICAgIGFzbSB2b2xhdGlsZSgicWRhZGQgJTAsICUxLCAlMiIKLSAgICAgICAgICAgICA6ICI9ciIocmMpCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgIDogInIiKHJhKSwgInIiKHJlc3VsdCkKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICApOwotCi0gICAgICAgIHJldHVybiAocmMpOwotICAgIH0KLQotI2Vsc2UgLyogQ19FUVVJVkFMRU5UICovCi0KLSAgICBfX2lubGluZSBXb3JkMzIgTF9tYWMoV29yZDMyIExfdmFyMywgV29yZDE2IHZhcjEsIFdvcmQxNiB2YXIyLCBGbGFnICpwT3ZlcmZsb3cpCi0gICAgewotICAgICAgICBXb3JkMzIgcmVzdWx0OwotICAgICAgICBXb3JkMzIgTF9zdW07Ci0gICAgICAgIHJlc3VsdCA9IChXb3JkMzIpIHZhcjEgKiB2YXIyOwotICAgICAgICBpZiAocmVzdWx0ICE9IChXb3JkMzIpIDB4NDAwMDAwMDBMKQotICAgICAgICB7Ci0gICAgICAgICAgICBMX3N1bSA9IChyZXN1bHQgPDwgMSkgKyBMX3ZhcjM7Ci0KLSAgICAgICAgICAgIC8qIENoZWNrIGlmIExfc3VtIGFuZCBMX3Zhcl8zIHNoYXJlIHRoZSBzYW1lIHNpZ24gKi8KLSAgICAgICAgICAgIGlmICgoTF92YXIzIF4gcmVzdWx0KSA+IDApCi0gICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgaWYgKChMX3N1bSBeIExfdmFyMykgPCAwKQotICAgICAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAgICAgTF9zdW0gPSAoTF92YXIzIDwgMCkgPyBNSU5fMzIgOiBNQVhfMzI7Ci0gICAgICAgICAgICAgICAgICAgICpwT3ZlcmZsb3cgPSAxOwotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgIH0KLSAgICAgICAgfQotICAgICAgICBlbHNlCi0gICAgICAgIHsKLSAgICAgICAgICAgICpwT3ZlcmZsb3cgPSAxOwotICAgICAgICAgICAgTF9zdW0gPSBNQVhfMzI7Ci0gICAgICAgIH0KLSAgICAgICAgcmV0dXJuIChMX3N1bSk7Ci0gICAgfQotCi0jZW5kaWYKLSAgICAvKi0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0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IHJlc3VsdDsKLQotICAgICAgICBPU0NMX1VOVVNFRF9BUkcocE92ZXJmbG93KTsKLQotICAgICAgICBhc20gdm9sYXRpbGUoInNtdWxiYiAlMCwgJTEsICUyIgotICAgICAgICAgICAgIDogIj1yIihwcm9kdWN0KQotICAgICAgICAgICAgICAgICAgICAgICAgICAgICA6ICJyIihyYiksICJyIihyYykKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICApOwotCi0gICAgICAgIGFzbSB2b2xhdGlsZSgicWRzdWIgJTAsICUxLCAlMiIKLSAgICAgICAgICAgICA6ICI9ciIocmVzdWx0KQotICAgICAgICAgICAgICAgICAgICAgICAgICAgICA6ICJyIihyYSksICJyIihwcm9kdWN0KQotICAgICAgICAgICAgICAgICAgICAgICAgICAgICk7Ci0KLSAgICAgICAgcmV0dXJuIChyZXN1bHQpOwotICAgIH0KLQotI2Vsc2UgLyogQyBFUVVJVkFMRU5UICovCi0KLSAgICBzdGF0aWMgaW5saW5lIFdvcmQzMiBMX21zdShXb3JkMzIgTF92YXIzLCBXb3JkMTYgdmFyMSwgV29yZDE2IHZhcjIsIEZsYWcgKnBPdmVyZmxvdykKLSAgICB7Ci0gICAgICAgIFdvcmQzMiByZXN1bHQ7Ci0KLSAgICAgICAgcmVzdWx0ID0gTF9tdWx0KHZhcjEsIHZhcjIsIHBPdmVyZmxvdyk7Ci0gICAgICAgIHJlc3VsdCA9IExfc3ViKExfdmFyMywgcmVzdWx0LCBwT3ZlcmZsb3cpOwotCi0gICAgICAgIHJldHVybiAocmVzdWx0KTsKLSAgICB9Ci0KLSNlbmRpZgotICAgIC8qLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLQotICAgIDsgRU5ECi0gICAgLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tL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MzIgcmVzdWx0OwotCi0gICAgICAgIE9TQ0xfVU5VU0VEX0FSRyhwT3ZlcmZsb3cpOwotCi0gICAgICAgIGFzbSB2b2xhdGlsZSgicXN1YiAlMCwgJTEsICUyIgotICAgICAgICAgICAgIDogIj1yIihyZXN1bHQpCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgIDogInIiKHJhKSwgInIiKHJiKQotICAgICAgICAgICAgICAgICAgICAgICAgICAgICk7Ci0KLSAgICAgICAgcmV0dXJuIChyZXN1bHQpOwotICAgIH0KLQotI2Vsc2UgLyogQyBFUVVJVkFMRU5UICovCi0KLSAgICBzdGF0aWMgaW5saW5lIFdvcmQzMiBMX3N1YihyZWdpc3RlciBXb3JkMzIgTF92YXIxLCByZWdpc3RlciBXb3JkMzIgTF92YXIyLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJlZ2lzdGVyIEZsYWcgKnBPdmVyZmxvdykKLSAgICB7Ci0gICAgICAgIFdvcmQzMiBMX2RpZmY7Ci0KLSAgICAgICAgTF9kaWZmID0gTF92YXIxIC0gTF92YXIyOwotCi0gICAgICAgIGlmICgoTF92YXIxIF4gTF92YXIyKSA8IDApCi0gICAgICAgIHsKLSAgICAgICAgICAgIGlmICgoTF9kaWZmIF4gTF92YXIxKSAmIE1JTl8zMikKLSAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICBMX2RpZmYgPSAoTF92YXIxIDwgMEwpID8gTUlOXzMyIDogTUFYXzMyOwotICAgICAgICAgICAgICAgICpwT3ZlcmZsb3cgPSAxOwotICAgICAgICAgICAgfQotICAgICAgICB9Ci0KLSAgICAgICAgcmV0dXJuIChMX2RpZmYpOwotICAgIH0KLQotI2VuZGlmCi0gICAgLyotLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tCi0gICAgOyBFTkQKLSAgICAtLS0tLS0tLS0tLS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KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKLSAgICAqLwotICAgIFdvcmQxNiBsc3BfaW5pdChsc3BTdGF0ZSAqKnN0KTsKLQotICAgIC8qCi0gICAgKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKLSAgICAqCi0gICAgKiAgRnVuY3Rpb24gICAgOiBsc3BfcmVzZXQKLSAgICAqICBQdXJwb3NlICAgICA6IFJlc2V0cyBzdGF0ZSBtZW1vcnkKLSAgICAqICBSZXR1cm5zICAgICA6IDAgb24gc3VjY2VzcwotICAgICoKLSAgICAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgotICAgICovCi0gICAgV29yZDE2IGxzcF9yZXNldChsc3BTdGF0ZSAqc3QpOwotCi0gICAgLyoKLSAgICAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgotICAgICoKLSAgICAqICBGdW5jdGlvbiAgICA6IGxzcF9leGl0Ci0gICAgKiAgUHVycG9zZSAgICAgOiBUaGUgbWVtb3J5IHVzZWQgZm9yIHN0YXRlIG1lbW9yeSBpcyBmcmVlZAotICAgICogIERlc2NyaXB0aW9uIDogU3RvcmVzIE5VTEwgaW4gKnN0Ci0gICAgKgotICAgICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCi0gICAgKi8KLSAgICB2b2lkIGxzcF9leGl0KGxzcFN0YXRlICoqc3QpOwotCi0gICAgLyoKLSAgICAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgotICAgICoKLSAgICAqICBGdW5jdGlvbiAgICA6IGxzcAotICAgICogIFB1cnBvc2UgICAgIDogQ29udmVyc2lvbiBmcm9tIExQIGNvZWZmaWNpZW50cyB0byBMU1BzLgotICAgICogICAgICAgICAgICAgICAgUXVhbnRpemF0aW9uIG9mIExTUHMuCi0gICAgKiAgRGVzY3JpcHRpb24gOiBHZW5lcmF0ZXMgMiBzZXRzIG9mIExTUHMgZnJvbSAyIHNldHMgb2YKLSAgICAqICAgICAgICAgICAgICAgIExQIGNvZWZmaWNpZW50cyBmb3IgbW9kZSAxMi4yLiBGb3IgdGhlIG90aGVyCi0gICAgKiAgICAgICAgICAgICAgICBtb2RlcyAxIHNldCBvZiBMU1BzIGlzIGdlbmVyYXRlZCBmcm9tIDEgc2V0IG9mCi0gICAgKiAgICAgICAgICAgICAgICBMUCBjb2VmZmljaWVudHMuIFRoZXNlIExTUHMgYXJlIHF1YW50aXplZCB3aXRoCi0gICAgKiAgICAgICAgICAgICAgICBNYXRyaXgvVmVjdG9yIHF1YW50aXphdGlvbiAoZGVwZW5kaW5nIG9uIHRoZSBtb2RlKQotICAgICogICAgICAgICAgICAgICAgYW5kIGludGVycG9sYXRlZCBmb3IgdGhlIHN1YmZyYW1lcyBub3QgeWV0IGhhdmluZwotICAgICogICAgICAgICAgICAgICAgdGhlaXIgb3duIExTUHMuCi0gICAgKgotICAgICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCi0gICAgKi8KLSAgICB2b2lkIGxzcChsc3BTdGF0ZSAqc3QsICAgICAgIC8qIGkvbyA6IFN0YXRlIHN0cnVjdCAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotICAgICAgICAgICAgIGVudW0gTW9kZSByZXFfbW9kZSwgLyogaSAgIDogcmVxdWVzdGVkIGNvZGVyIG1vZGUgICAgICAgICAgICAgICAgICAgICovCi0gICAgICAgICAgICAgZW51bSBNb2RlIHVzZWRfbW9kZSwvKiBpICAgOiB1c2VkIGNvZGVyIG1vZGUgIC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AgIC0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0qLwotCi0gICAgLyotLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tCi0gICAgOyBHTE9CQUwgRlVOQ1RJT04gREVGSU5JVElPTlMKLSAgICA7IEZ1bmN0aW9uIFByb3RvdHlwZSBkZWNsYXJhdGlvbgotICAgIC0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0qLwotCi0gICAgdm9pZCBMc2ZfbHNwKAotICAgICAgICBXb3JkMTYgbHNmW10sICAgICAgLyogKGkpICAgIDogbHNmW21dIG5vcm1hbGl6ZWQgKHJhbmdlOiAwLjA8PXZhbDw9MC41KSAqLwotICAgICAgICBXb3JkMTYgbHNwW10sICAgICAgLyogKG8pICAgIDogbHNwW21dIChyYW5nZTogLTE8PXZhbDwxKSAgICAgICAgICAgICAgICAqLwotICAgICAgICBXb3JkMTYgbSwgICAgICAgICAgLyogKGkpICAgIDogTFBDIG9yZGVyICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotICAgICAgICBGbGFnICAqcE92ZXJmbG93ICAgLyogKG8pICAgIDogRmxhZyBzZXQgd2hlbiBvdmVyZmxvdyBvY2N1cnMgICAgICAgICAgICAqLwotICAgICk7Ci0gICAgdm9pZCBMc3BfbHNmKAotICAgICAgICBXb3JkMTYgbHNwW10sICAgICAgLyogKGkpICAgIDogbHNwW21dIChyYW5nZTogLTE8PXZhbDwxKSAgICAgICAgICAgICAgICAqLwotICAgICAgICBXb3JkMTYgbHNmW10sICAgICAgLyogKG8pICAgIDogbHNmW21dIG5vcm1hbGl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S0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0qLwotCi0gICAgc3RhdGljIGlubGluZSBXb3JkMzIgTWFjXzMyKFdvcmQzMiBMX3ZhcjMsCi0gICAgV29yZDE2IExfdmFyMV9oaSwKLSAgICBXb3JkMTYgTF92YXIxX2xvLAotICAgIFdvcmQxNiBMX3ZhcjJfaGksCi0gICAgV29yZDE2IExfdmFyMl9sbywKLSAgICBGbGFnICpwT3ZlcmZsb3cpCi0gICAgewotICAgICAgICBXb3JkMTYgIHByb2R1Y3Q7Ci0KLSAgICAgICAgTF92YXIzID0gTF9tYWMoTF92YXIzLCBMX3ZhcjFfaGksIExfdmFyMl9oaSwgcE92ZXJmbG93KTsKLQotICAgICAgICBwcm9kdWN0ID0gbXVsdChMX3ZhcjFfaGksIExfdmFyMl9sbywgcE92ZXJmbG93KTsKLSAgICAgICAgTF92YXIzID0gTF9tYWMoTF92YXIzLCBwcm9kdWN0LCAxLCBwT3ZlcmZsb3cpOwotCi0gICAgICAgIHByb2R1Y3QgPSBtdWx0KExfdmFyMV9sbywgTF92YXIyX2hpLCBwT3ZlcmZsb3cpOwotICAgICAgICBMX3ZhcjMgPSBMX21hYyhMX3ZhcjMsIHByb2R1Y3QsIDEsIHBPdmVyZmxvdyk7Ci0KLSAgICAgICAgcmV0dXJuIChMX3ZhcjMpOwotICAgIH0KLQotICAgIHN0YXRpYyBpbmxpbmUgV29yZDMyIE1hY18zMl8xNihXb3JkMzIgTF92YXIzLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBXb3JkMTYgTF92YXIxX2hpLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBXb3JkMTYgTF92YXIxX2xvLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBXb3JkMTYgdmFyMiwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgRmxhZyAgKnBPdmVyZmxvdykKLSAgICB7Ci0gICAgICAg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SBkZXJpdmVkIGZyb20gdGhlIGZvbGxvd2luZyAzR1BQIHN0YW5kYXJkOgotCi0gICAgM0dQUCBUUyAyNi4wNzMKLSAgICBBTlNJLUMgY29kZSBmb3IgdGhlIEFkYXB0aXZlIE11bHRpLVJhdGUgKEFNUikgc3BlZWNoIGNvZGVjCi0gICAgQXZhaWxhYmxlIGZyb20gaHR0cDovL3d3dy4zZ3BwLm9yZwotCi0oQykgMjAwNCwgM0dQUCBPcmdhbml6YXRpb25hbCBQYXJ0bmVycyAoQVJJQiwgQVRJUywgQ0NTQSwgRVRTSSwgVFRBLCBUVEMpCi1QZXJtaXNzaW9uIHRvIGRpc3RyaWJ1dGUsIG1vZGlmeSBhbmQgdXNlIHRoaXMgZmlsZSB1bmRlciB0aGUgc3RhbmRhcmQgbGljZW5zZQotdGVybXMgbGlzdGVkIGFib3ZlIGhhcyBiZWVuIG9idGFpbmVkIGZyb20gdGhlIGNvcHlyaWdodCBob2xkZXIuCi0qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotLyoKLSoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCi0qCi0qICAgICAgR1NNIEFNUi1OQiBzcGVlY2ggY29kZWMgICBSOTggICBWZXJzaW9uIDcuNS4wICAgTWFyY2ggMiwgMjAwMQotKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgUjk5ICAgVmVyc2lvbiAzLjIuMAotKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgUkVMLTQgVmVyc2lvbiA0LjAuMAotKgotKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKLSoKLSogICAgICBGaWxlICAgICAgICAgICAgIDogbW9kZS5oCi0qICAgICAgUHVycG9zZSAgICAgICAgICA6IERlY2xhcmF0aW9uIG9mIG1vZGUgdHlwZQotKgotKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKLSovCi0jaWZuZGVmIG1vZGVfaAotI2RlZmluZSBtb2RlX2ggIiRJZCAkIgotCi0vKgotKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKLSogICAgICAgICAgICAgICAgICAgICAgICAgSU5DTFVERSBGSUxFUwotKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKLSovCi0KLQotI2lmZGVmIF9fY3BsdXNwbHVzCi1leHRlcm4gIkMiCi17Ci0jZW5kaWYKLQotICAgIC8qCi0gICAgKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKLSAgICAqICAgICAgICAgICAgICAgICAgICAgICAgIERFRklOSVRJT04gT0YgREFUQSBUWVBFUwotICAgICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCi0gICAgKi8KLSAgICBlbnVtIE1vZGUgeyBNUjQ3NSA9IDAsCi0gICAgICAgIE1SNTE1LAotICAgICAgICBNUjU5LAotICAgICAgICBNUjY3LAotICAgICAgICBNUjc0LAotICAgICAgICBNUjc5NSwKLSAgICAgICAgTVIxMDIsCi0gICAgICAgIE1SMTIyLAotCi0gICAgICAgIE1SRFRYLAotCi0gICAgICAgIE5fTU9ERVMgICAgIC8qIG51bWJlciBvZiAoU1BDKSBtb2RlcyAqLwotCi0gICAgfTsKLQotI2lmZGVmIF9fY3BsdXNwbHVzCi19Ci0jZW5k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BXb3JkMzIgcmQgPSBMX3ZhcjJfbG87Ci0KLQotCi0gICAgICAgIE9TQ0xfVU5VU0VEX0FSRyhwT3ZlcmZsb3cpOwotCi0gICAgICAgIGFzbSB2b2xhdGlsZSgic211bGJiICUwLCAlMSwgJTIiCi0gICAgICAgICAgICAgOiAiPXIiKExfcHJvZHVjdCkKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOiAiciIocmEpLCAiciIocmMpCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgKTsKLSAgICAgICAgYXNtIHZvbGF0aWxlKCJtb3YgJTAsICMwIgotICAgICAgICAgICAgIDogIj1yIihyZXN1bHQpCi0gICAgICAgICAgICAgICAgICAgICk7Ci0KLSAgICAgICAgYXNtIHZvbGF0aWxlKCJxZGFkZCAlMCwgJTEsICUyIgotICAgICAgICAgICAgIDogIj1yIihMX3N1bSkKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOiAiciIocmVzdWx0KSwgInIiKExfcHJvZHVjdCkKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICApOwotCi0gICAgICAgIGFzbSB2b2xhdGlsZSgic211bGJiICUwLCAlMSwgJTIiCi0gICAgICAgICAgICAgOiAiPXIiKHByb2R1Y3QzMikKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOiAiciIocmEpLCAiciIocmQpCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgKTsKLQotICAgICAgICBhc20gdm9sYXRpbGUoIm1vdiAlMCwgJTEsIEFTUiAjMTUiCi0gICAgICAgICAgICAgOiAiPXIiKHJhKQotICAgICAgICAgICAgICAgICAgICAgICAgICAgICA6ICJyIihwcm9kdWN0MzIpCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgKTsKLSAgICAgICAgYXNtIHZvbGF0aWxlKCJxZGFkZCAlMCwgJTEsICUyIgotICAgICAgICAgICAgIDogIj1yIihMX3Byb2R1Y3QpCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgIDogInIiKExfc3VtKSwgInIiKHJhKQotICAgICAgICAgICAgICAgICAgICAgICAgICAgICk7Ci0KLSAgICAgICAgYXNtIHZvbGF0aWxlKCJzbXVsYmIgJTAsICUxLCAlMiIKLSAgICAgICAgICAgICA6ICI9ciIocHJvZHVjdDMyKQotICAgICAgICAgICAgICAgICAgICAgICAgICAgICA6ICJyIihyYiksICJyIihyYykKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICApOwotCi0gICAgICAgIGFzbSB2b2xhdGlsZSgibW92ICUwLCAlMSwgQVNSICMxNSIKLSAgICAgICAgICAgICA6ICI9ciIocmIpCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgIDogInIiKHByb2R1Y3QzMikKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICApOwotCi0gICAgICAgIGFzbSB2b2xhdGlsZSgicWRhZGQgJTAsICUxLCAlMiIKLSAgICAgICAgICAgICA6ICI9ciIoTF9zdW0pCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgIDogInIiKExfcHJvZHVjdCksICJyIihyYikKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICApOwotCi0gICAgICAgIHJldHVybiAoTF9zdW0pOwotICAgIH0KLQotI2Vsc2UgLyogQ19FUVVJVkFMRU5UICovCi0KLSAgICBfX2lubGluZSBXb3JkMzIgTXB5XzMyKFdvcmQxNiBMX3ZhcjFfaGksCi0gICAgICAgICAgICAgICAgICAgICAgICAgICBXb3JkMTYgTF92YXIxX2xvLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgV29yZDE2IExfdmFyMl9oaSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgIFdvcmQxNiBMX3ZhcjJfbG8sCi0gICAgICAgICAgICAgICAgICAgICAgICAgICBGbGFnICAgKnBPdmVyZmxvdykKLSAgICB7Ci0gICAgICAgIFdvcmQzMiBMX3Byb2R1Y3Q7Ci0gICAgICAgIFdvcmQzMiBMX3N1bTsKLSAgICAgICAgV29yZDMyIHByb2R1Y3QzMjsKLQotICAgICA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dvcmQxNiBMX3ZhcjFfaGksCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFdvcmQxNiBMX3ZhcjFfbG8sCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFdvcmQxNiB2YXIyLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBGbGFnICpwT3ZlcmZsb3cpCi0gICAgewotCi0gICAgICAgIHJlZ2lzdGVyIFdvcmQzMiByYSA9IExfdmFyMV9oaTsKLSAgICAgICAgcmVnaXN0ZXIgV29yZDMyIHJiID0gTF92YXIxX2xvOwotICAgICAgICByZWdpc3RlciBXb3JkMzIgcmMgPSB2YXIyOwotICAgICAgICBXb3JkMzIgcmVzdWx0LCBMX3Byb2R1Y3Q7Ci0KLSAgICAgICAgT1NDTF9VTlVTRURfQVJHKHBPdmVyZmxvdyk7Ci0KLSAgICAgICAgYXNtIHZvbGF0aWxlKCJzbXVsYmIgJTAsICUxLCAlMiIKLSAgICAgICAgICAgICA6ICI9ciIoTF9wcm9kdWN0KQotICAgICAgICAgICAgICAgICAgICAgICAgICAgICA6ICJyIihyYSksICJyIihyYykKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICApOwotICAgICAgICBhc20gdm9sYXRpbGUoIm1vdiAlMCwgIzAiCi0gICAgICAgICAgICAgOiAiPXIiKHJlc3VsdCkKLSAgICAgICAgICAgICAgICAgICAgKTsKLQotICAgICAgICBhc20gdm9sYXRpbGUoInFkYWRkICUwLCAlMSwgJTIiCi0gICAgICAgICAgICAgOiAiPXIiKExfcHJvZHVjdCkKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOiAiciIocmVzdWx0KSwgInIiKExfcHJvZHVjdCkKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICApOwotCi0gICAgICAgIGFzbSB2b2xhdGlsZSgic211bGJiICUwLCAlMSwgJTIiCi0gICAgICAgICAgICAgOiAiPXIiKHJlc3VsdCkKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOiAiciIocmIpLCAiciIocmMpCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgKTsKLQotICAgICAgICBhc20gdm9sYXRpbGUoIm1vdiAlMCwgJTEsIEFTUiAjMTUiCi0gICAgICAgICAgICAgOiAiPXIiKHJhKQotICAgICAgICAgICAgICAgICAgICAgICAgICAgICA6ICJyIihyZXN1bHQpCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgKTsKLSAgICAgICAgYXNtIHZvbGF0aWxlKCJxZGFkZCAlMCwgJTEsICUyIgotICAgICAgICAgICAgIDogIj1yIihyZXN1bHQpCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgIDogInIiKExfcHJvZHVjdCksICJyIihyYSkKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICApOwotCi0gICAgICAgIHJldHVybiAocmVzdWx0KTsKLSAgICB9Ci0KLSNlbHNlIC8qIENfRVFVSVZBTEVOVCAqLwotICAgIF9faW5saW5lIFdvcmQzMiBNcHlfMzJfMTYoV29yZDE2IExfdmFyMV9oaSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFdvcmQxNiBMX3ZhcjFfbG8sCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICBXb3JkMTYgdmFyMiwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEZsYWcgKnBPdmVyZmxvdykKLSAgICB7Ci0KLSAgICAgICAgV29yZDMyIExfcHJvZHVjdDsKLSAgICAgICAgV29yZDMyIExfc3VtOwotICAgICAgICBXb3JkMzIgcmVzdWx0OwotICAgICAgICBMX3Byb2R1Y3QgPSAoV29yZDMyKSBMX3ZhcjFfaGkgKiB2YXIyOwotCi0gICAgICAgIGlmIChMX3Byb2R1Y3QgIT0gKFdvcmQzMikgMHg0MDAwMDAwMEwpCi0gICAgICAgIHsKLSAgICAgICAgICAgIExfcHJvZHVjdCA8PD0gMTsKLSAgICAgICAgfQotICAgICAgICBlbHNlCi0gICAgICAgIHsKLSAgICAgICAgICAgIC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cm4gKChXb3JkMTYpIHByb2R1Y3QpOwotICAgIH0KLQotI2VsaWYgZGVmaW5lZChQVl9BUk1fR0NDX1Y1KQotCi0gICAgX19pbmxpbmUgV29yZDE2IG11bHQoV29yZDE2IHZhcjEsIFdvcmQxNiB2YXIyLCBGbGFnICpwT3ZlcmZsb3cpCi0gICAgewotICAgICAgICByZWdpc3RlciBXb3JkMzIgcmEgPSB2YXIxOwotICAgICAgICByZWdpc3RlciBXb3JkMzIgcmIgPSB2YXIyOwotICAgICAgICBXb3JkMzIgcHJvZHVjdDsKLSAgICAgICAgV29yZDMyIHRlbXAgPSAweDdGRkY7Ci0KLSAgICAgICAgT1NDTF9VTlVTRURfQVJHKHBPdmVyZmxvdyk7Ci0KLSAgICAgICAgYXNtIHZvbGF0aWxlKCJzbXVsYmIgJTAsICUxLCAlMiIKLSAgICAgICAgICAgICA6ICI9ciIocHJvZHVjdCkKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOiAiciIocmEpLCAiciIocmIpCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgKTsKLSAgICAgICAgYXNtIHZvbGF0aWxlKCJtb3YgJTAsICUxLCBBU1IgIzE1IgotICAgICAgICAgICAgIDogIj1yIihwcm9kdWN0KQotICAgICAgICAgICAgICAgICAgICAgICAgICAgICA6ICJyIihwcm9kdWN0KQotICAgICAgICAgICAgICAgICAgICAgICAgICAgICk7Ci0gICAgICAgIGFzbSB2b2xhdGlsZSgiY21wICUwLCAlMSIKLSAgICAgICAgICAgICA6ICI9ciIocHJvZHVjdCkKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOiAiciIodGVtcCkKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICApOwotICAgICAgICBhc20gdm9sYXRpbGUoIm1vdmdlICUwLCAlMSIKLSAgICAgICAgICAgICA6ICI9ciIocHJvZHVjdCkKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOiAiciIodGVtcCkKLSAgICAgICAgICAgICAgICAgICAgIC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STV9WNSkgfHwgZGVmaW5lZChQVl9BUk1fR0NDX1Y1KSApCi0KLSAgICAvKiBDIEVRVUlWQUxFTlQgKi8KLSAgICBXb3JkMTYgbm9ybV9sKFdvcmQzMiBMX3ZhcjEpOwotCi0jZWxpZiBkZWZpbmVkKFBWX0FSTV9WNSkKLQotICAgIF9faW5saW5lIFdvcmQxNiBub3JtX2woV29yZDMyIExfdmFyMSkKLSAgICB7Ci0gICAgICAgIHJlZ2lzdGVyIFdvcmQzMiB2YXJfb3V0ID0gMDsKLQotICAgICAgICBfX2FzbQotICAgICAgICB7Ci0gICAgICAgICAgICBDTVAgICAgTF92YXIxLCAjMAotICAgICAgICAgICAgRU9STkUgIExfdmFyMSwgTF92YXIxLCBMX3ZhcjEsIExTTCAjMQotICAgICAgICAgICAgQ0xaTkUgIHZhcl9vdXQsIExfdmFyMQotICAgICAgICB9Ci0KLSAgICAgICAgcmV0dXJuICgoV29yZDE2KXZhcl9vdXQpOwotICAgIH0KLQotI2VsaWYgZGVmaW5lZChQVl9BUk1fR0NDX1Y1KQotCi0gICAgc3RhdGljIGlubGluZSBXb3JkMTYgbm9ybV9sKFdvcmQzMiBMX3ZhcjEpCi0gICAgewotICAgICAgICByZWdpc3RlciBXb3JkMzIgdmFyX291dCA9IDA7Ci0gICAgICAgIHJlZ2lzdGVyIFdvcmQzMiByYSA9IExfdmFyMTsKLSAgICAgICAgaWYgKExfdmFyMSkKLSAgICAgICAgewotICAgICAgICAgICAgcmEgXj0gKHJhIDw8IDEpOwotICAgICAgICAgICAgYXNtIHZvbGF0aWxlKAotICAgICAgICAgICAgICAgICJjbHogJTAsICUxIgotICAgIDogIj1yIih2YXJfb3V0KQotICAgICAgICAgICAgICAgICAgICAgICAgOiAiciIocmEpCi0gICAgICAgICAgICAgICAgICAgICk7Ci0gICAgICAgIH0KLSAgICAgICAgcmV0dXJuICh2YXJfb3V0KTsKLSAgICB9Ci0KLSNlbmRpZgotICAgIC8qLS0tLS0tLS0tLS0tLS0t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xNiBub3JtX3MoV29yZDE2IHZhcjEpOwotCi0jZWxpZiBkZWZpbmVkKFBWX0FSTV9WNSkKLQotICAgIF9faW5saW5lIFdvcmQxNiAgbm9ybV9zKFdvcmQxNiB2YXIpCi0gICAgewotICAgICAgICByZWdpc3RlciBXb3JkMzIgdmFyX291dCA9IDA7Ci0gICAgICAgIFdvcmQzMiB2YXIxID0gdmFyIDw8IDE2OwotCi0gICAgICAgIF9fYXNtCi0gICAgICAgIHsKLSAgICAgICAgICAgIENNUCAgICB2YXIxLCAjMAotICAgICAgICAgICAgRU9STkUgIHZhcjEsIHZhcjEsIHZhcjEsIExTTCAjMQotICAgICAgICAgICAgQ0xaTkUgIHZhcl9vdXQsIHZhcjEKLSAgICAgICAgfQotCi0gICAgICAgIHJldHVybiAoKFdvcmQxNil2YXJfb3V0KTsKLSAgICB9Ci0KLSNlbGlmIGRlZmluZWQoUFZfQVJNX0dDQ19WNSkKLQotICAgIHN0YXRpYyBpbmxpbmUgV29yZDE2IG5vcm1fcyhXb3JkMTYgdmFyMSkKLSAgICB7Ci0gICAgICAgIHJlZ2lzdGVyIFdvcmQzMiB2YXJfb3V0ID0gMDsKLSAgICAgICAgcmVnaXN0ZXIgV29yZDMyIHJhID0gdmFyMSA8PCAxNjsKLSAgICAgICAgaWYgKHJhKQotICAgICAgICB7Ci0gICAgICAgICAgICByYSBePSAocmEgPDwgMSk7Ci0gICAgICAgICAgICBhc20gdm9sYXRpbGUoCi0gICAgICAgICAgICAgICAgImNseiAlMCwgJTEiCi0gICAgOiAiPXIiKHZhcl9vdXQpCi0gICAgICAgICAgICAgICAgICAgICAgICA6ICJyIihyYSkKLSAgICAgICAgICAgICAgICAgICAgKTsKLSAgICAgICAgfQotICAgICAgICByZXR1cm4gKHZhcl9vdXQpOwotICAgIH0KLQotI2VuZGlmCi0gICAgLyotLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS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LSAgICAgICBzdG9yZXMgTlVMTCBpbiAqc3QKLSAgICAgKi8KLQotICAgIFdvcmQxNiBQaXRjaF9vbF93Z2goICAgICAgLyogbyAgIDogb3BlbiBsb29wIHBpdGNoIGxhZyAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotICAgICAgICBwaXRjaE9MV2dodFN0YXRlICpzdCwgLyogaS9vIDogU3RhdGUgc3RydWN0ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotICAgICAgICB2YWRTdGF0ZSAqdmFkU3QsICAgICAgLyogaS9vIDogVkFEIHN0YXRlIHN0cnVjdCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotICAgICAgICBXb3JkMTYgc2lnbmFsW10sICAgICAgLyogaSAgIDogc2lnbmFsIHVzZWQgdG8gY29tcHV0ZSB0aGUgb3BlbiBsb29wIHBpdGNoICAgICAqLwotICAgICAgICAvKiAgICAgICBzaWduYWxbLXBpdF9tYXhdIHRvIHNpZ25hbFstMV0gc2hvdWxkIGJlIGtub3duICovCi0gICAgICAgIFdvcmQxNiBwaXRfbWluLCAgICAgICAvKiBpICAgOiBtaW5pbXVtIHBpdGNoIGxhZyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0gICAgICAgIFdvcmQxNiBwaXRfbWF4LCAgICAgICAvKiBpICAgOiBtYXhpbXVtIHBpdGNoIGxhZyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0gICAgICAgIFdvcmQxNiBMX2ZyYW1lLCAgICAgICAvKiBpICAgOiBsZW5ndGggb2YgZnJhbWUgdG8gY29tcHV0ZSBwaXRjaCAgICAgICAgICAgICAgICovCi0gICAgICAgIFdvcmQxNiBvbGRfbGFnc1tdLCAgICAvKiBpICAgOiBoaXN0b3J5IHdpdGggb2xkIHN0b3JlZCBDbCBsYWdzICAgICAgICAgICAgICAgICovCi0gICAgICAgIFdvcmQxNiBvbF9nYWluX2ZsZ1tdLCAvKiBpICAgOiBPTCBnYWlu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U3RhdGUgKipzdCk7Ci0gICAgLyogZGUtaW5pdGlhbGl6ZSBzdGF0ZSAoaS5lLiBmcmVlIHN0YXR1cyBzdHJ1Y3QpCi0gICAgICAgc3RvcmVzIE5VTEwgaW4gKnN0Ci0gICAgICovCi0KLSAgICB2b2lkIFFfcGxzZl8zKAotICAgICAgICBRX3Bsc2ZTdGF0ZSAqc3QsICAgIC8qIGkvbzogc3RhdGUgc3RydWN0ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotICAgICAgICBlbnVtIE1vZGUgbW9kZSwgICAgIC8qIGkgIDogY29kZXIgbW9kZSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotICAgICAgICBXb3JkMTYgKmxzcDEsICAgICAgIC8qIGkgIDogMXN0IExTUCB2ZWN0b3IgICAgICAgICAgICAgICAgICAgICAgUTE1ICAqLwotICAgICAgICBXb3JkMTYgKmxzcDFfcSwgICAgIC8qIG8gIDogcXVhbnRpemVkIDFzdCBMU1AgdmVjdG9yICAgICAgICAgICAgUTE1ICAqLwotICAgICAgICBXb3JkMTYgKmluZGljZSwgICAgIC8qIG8gIDogcXVhbnRpemF0aW9uIGluZGljZXMgb2YgMyB2ZWN0b3JzICAgUTAgICAqLwotICAgICAgICBXb3JkMTYgKnByZWRfaW5pdF9pLC8qIG8gIDogaW5pdCBpbmRleCBmb3IgTUEgcHJlZGljdGlvbiBpbiBEVFggbW9kZSAqLwotICAgICAgICBGbGFnICAqcE92ZXJmbG93ICAgIC8qIG8gOiBGbGFnIHNldCB3aGVuIG92ZXJmbG93IG9jY3VycyAgICAgICAgICAgICAqLwotICAgICk7Ci0KLSAgICB2b2lkIFFfcGxzZl81KAotICAgICAgICBRX3Bsc2ZTdGF0ZSAqc3QsCi0gICAgICAgIFdvcmQxNiAqbHNwMSwgICAgICAvKiBpICA6IDFzdCBMU1AgdmVjdG9yLCAgICAgICAgICAgICAgICAgICAgIFExNSAqLwotICAgICAgICBXb3JkMTYgKmxzcDIsICAgICA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KGV4cG9uZW50KSwgICAgICBRMCAgKi8KLSAgICAgICAgV29yZDE2IGZyYWNfZ2NvZGUwLCAgICAgLyogaSAgOiBwcmVkaWN0ZWQgQ0IgZ2FpbiAoZnJhY3Rpb24pLCAgICAgIFExNSAqLwotICAgICAgICBXb3JkMTYgZnJhY19jb2VmZltdLCAgICAvKiBpICA6IGVuZXJneSBjb2VmZi4gKDUpLCBmcmFjdGlvbiBwYXJ0LCAgUTE1ICovCi0gICAgICAgIFdvcmQxNiBleHBfY29lZmZbXSwgICAgIC8qIGkgIDogZW5lcmd5IGNvZWZmLiAoNSksIGV4cG9uZW50IHBhcnQsICBRMCAgKi8KLSAgICAgICAgLyogICAgICAoZnJhY19jb2VmZiBhbmQgZXhwX2NvZWZmIGNvbXB1dGVkIGluICAqLwotICAgICAgICAvKiAgICAgICBjYWxjX2ZpbHRfZW5lcmdpZXMoKSkgICAgICAgICAgICAgICAgICovCi0gICAgICAgIFdvcmQxNiBncF9saW1pdCwgICAgICAgIC8qIGkgIDogcGl0Y2ggZ2FpbiBsaW1pdCAgICAgICAgICAgICAgICAgICAgICAgKi8KLSAgICAgICAgV29yZDE2ICpnYWluX3BpdCwgICAgICAgLyogbyAgOiBQaXRjaCBnYWluLCAgICAgICAgICAgICAgICAgICAgICAgIFExNCAqLwotICAgICAgICBXb3JkMTYgKmdhaW5fY29kLCAgICAgICAvKiBvICA6IENvZGUgZ2FpbiwgICAgICAgICAgICAgICAgICAgICAgICAgUTEgICovCi0gICAgICAgIFdvcmQxNiAqcXVhX2VuZXJfTVIxMjIsIC8qIG8gIDogcXVhbnRpemVkIGVuZXJneSBlcnJvciwgICAgICAgICAgICBRMTAgKi8KLSAgICAgICAgLyogICAgICAoZm9yIE1SMTIyIE1BIHByZWRpY3RvciB1cGRhdGUpICAgICAgICAqLwotICAgICAgICBXb3JkMTYgKnF1YV9lbmVyLCAgICAgICAvKiBvICA6IHF1YW50aXplZCBlbmVyZ3kgZXJyb3IsICAgICAgICAgICAgUT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qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLS8qCi0qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgotKgotKiAgICAgIEdTTSBBTVItTkIgc3BlZWNoIGNvZGVjICAgUjk4ICAgVmVyc2lvbiA3LjUuMCAgIE1hcmNoIDIsIDIwMDEKLSogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFI5OSAgIFZlcnNpb24gMy4yLjAKLSogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFJFTC00IFZlcnNpb24gNC4wLjAKLSoKLSoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCi0qCi0qICAgICAgRmlsZSAgICAgICAgICAgICA6IHJlc2lkdS5oCi0qICAgICAgUHVycG9zZSAgICAgICAgICA6IENvbXB1dGVzIHRoZSBMUCByZXNpZHVhbC4KLSogICAgICBEZXNjcmlwdGlvbiAgICAgIDogVGhlIExQIHJlc2lkdWFsIGlzIGNvbXB1dGVkIGJ5IGZpbHRlcmluZyB0aGUgaW5wdXQKLSogICAgICAgICAgICAgICAgICAgICAgIDogc3BlZWNoIHRocm91Z2ggdGhlIExQIGludmVyc2UgZmlsdGVyIEEoeikuCi0qCi0qCi0qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgotKi8KLSNpZm5kZWYgcmVzaWR1X2gKLSNkZWZpbmUgcmVzaWR1X2ggIiRJZCAkIgotCi0vKgotKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKLSogICAgICAgICAgICAgICAgICAgICAgICAgSU5DTFVERSBGSUxFUwotKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKLSovCi0jaW5jbHVkZSAidHlwZWRlZi5oIgotCi0jaWZkZWYgX19jcGx1c3BsdXMKLWV4dGVybiAiQyIKLXsKLSNlbmRpZgotCi0gICAgLyoKLSAgICAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgotICAgICogICAgICAgICAgICAgICAgICAgICAgICAgREVGSU5JVElPTiBPRiBEQVRBIFRZUEVTCi0gICAgKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKLSAgICAqLwotCi0gICAgLyoKLSAgICAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgotICAgICogICAgICAgICAgICAgICAgICAgICAgICAgREVDTEFSQVRJT04gT0YgUFJPVE9UWVBFUwotICAgICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCi0gICAgKi8KLSAgICB2b2lkIFJlc2lkdSgKLSAgICAgICAgV29yZDE2IGFbXSwgICAgICAgIC8qIChpKSAgOiBwcmVkaWN0aW9uIGNvZWZmaWNpZW50cyAgICAgICAgICAgICAgICAgICAgKi8KLSAgICAgICAgV29yZDE2IHhbXSwgICAgICAgIC8qIChpKSAgOiBzcGVlY2ggc2lnbmFsICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLSAgICAgICAgV29yZDE2IHlbXSwgICAgICAgIC8qIChvKSAgOiByZXNpZHVhbCBzaWduYWwgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLSAgICAgICAgV29yZDE2IGxnICAgICAgICAgIC8qIChpKSAgOiB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gIEFOU0ktQyBjb2RlIGZvciB0aGUgQWRhcHRpdmUgTXVsdGktUmF0ZSAoQU1SKSBzcGVlY2ggY29kZWMKLSAgICBBdmFpbGFibGUgZnJvbSBodHRwOi8vd3d3LjNncHAub3JnCi0KLShDKSAyMDA0LCAzR1BQIE9yZ2FuaXphdGlvbmFsIFBhcnRuZXJzIChBUklCLCBBVElTLCBDQ1NBLCBFVFNJLCBUVEEsIFRUQykKLVBlcm1pc3Npb24gdG8gZGlzdHJpYnV0ZSwgbW9kaWZ5IGFuZCB1c2UgdGhpcyBmaWxlIHVuZGVyIHRoZSBzdGFuZGFyZCBsaWNlbnNlCi10ZXJtcyBsaXN0ZWQgYWJvdmUgaGFzIGJlZW4gb2J0YWluZWQgZnJvbSB0aGUgY29weXJpZ2h0IGhvbGRlci4KLSoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0vKgotKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKLSoKLSogICAgICBHU00gQU1SLU5CIHNwZWVjaCBjb2RlYyAgIFI5OCAgIFZlcnNpb24gNy41LjAgICBNYXJjaCAyLCAyMDAxCi0qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBSOTkgICBWZXJzaW9uIDMuMi4wCi0qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBSRUwtNCBWZXJzaW9uIDQuMC4wCi0qCi0qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgotKgotKiAgICAgIEZpbGUgICAgICAgICAgICAgOiBzZXRfemVyby5oCi0qICAgICAgRGVzY3JpcHRpb24gICAgICA6IFNldCB2ZWN0b3IgeFtdIHRvIHplcm8KLSoKLSoKLSoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCi0qLwotI2lmbmRlZiBzZXRfemVyb19oCi0jZGVmaW5lIHNldF96ZXJvX2ggIiRJZCAkIgotCi0vKgotKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKLSogICAgICAgICAgICAgICAgICAgICAgICAgSU5DTFVERSBGSUxFUwotKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKLSovCi0jaW5jbHVkZSAidHlwZWRlZi5oIgotCi0jaWZkZWYgX19jcGx1c3BsdXMKLWV4dGVybiAiQyIKLXsKLSNlbmRpZgotCi0gICAgLyoKLSAgICAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgotICAgICogICAgICAgICAgICAgICAgICAgICAgICAgREVGSU5JVElPTiBPRiBEQVRBIFRZUEVTCi0gICAgKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKLSAgICAqLwotCi0gICAgLyoKLSAgICAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgotICAgICogICAgICAgICAgICAgICAgICAgICAgICAgREVDTEFSQVRJT04gT0YgUFJPVE9UWVBFUwotICAgICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCi0gICAgKi8KLSAgICB2b2lkIFNldF96ZXJvKAotICAgICAgICBXb3JkMTYgeFtdLCAgICAgICAgLyogKG8pICA6IHZlY3Rv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KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKLSoKLSogICAgICBHU00gQU1SLU5CIHNwZWVjaCBjb2RlYyAgIFI5OCAgIFZlcnNpb24gNy41LjAgICBNYXJjaCAyLCAyMDAxCi0qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBSOTkgICBWZXJzaW9uIDMuMi4wCi0qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBSRUwtNCBWZXJzaW9uIDQuMC4wCi0qCi0qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgotKgotKiAgICAgIEZpbGUgICAgICAgICAgICAgOiBzeW5fZmlsdC5oCi0qICAgICAgUHVycG9zZSAgICAgICAgICA6IFBlcmZvcm0gc3ludGhlc2lzIGZpbHRlcmluZyB0aHJvdWdoIDEvQSh6KS4KLSoKLSoKLSoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCi0qLwotI2lmbmRlZiBzeW5fZmlsdF9oCi0jZGVmaW5lIHN5bl9maWx0X2ggIiRJZCAkIgotCi0vKgotKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKLSogICAgICAgICAgICAgICAgICAgICAgICAgSU5DTFVERSBGSUxFUwotKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKLSovCi0jaW5jbHVkZSAidHlwZWRlZi5oIgotCi0jaWZkZWYgX19jcGx1c3BsdXMKLWV4dGVybiAiQyIKLXsKLSNlbmRpZgotCi0gICAgLyoKLSAgICAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgotICAgICogICAgICAgICAgICAgICAgICAgICAgICAgREVGSU5JVElPTiBPRiBEQVRBIFRZUEVTCi0gICAgKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKLSAgICAqLwotCi0gICAgLyoKLSAgICAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgotICAgICogICAgICAgICAgICAgICAgICAgICAgICAgREVDTEFSQVRJT04gT0YgUFJPVE9UWVBFUwotICAgICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCi0gICAgKi8KLSAgICB2b2lkIFN5bl9maWx0KAotICAgICAgICBXb3JkMTYgYVtdLCAgICAgICAgLyogKGkpICA6IGFbbSsxXSBwcmVkaWN0aW9uIGNvZWZmaWNpZW50cyAgIChtPTEwKSAgICAqLwotICAgICAgICBXb3JkMTYgeFtdLCAgICAgICAgLyogKGkpICA6IGlucHV0IHNpZ25hbCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotICAgICAgICBXb3JkMTYgeVtdLCAgICAgICAgLyogKG8pICA6IG91dHB1dCBzaWduYWwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotICAgICAgICBXb3JkMTYgbGcsICAgICAgICAgLyogKGkpICA6IHNpemUgb2YgZmlsdGVyaW5nICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotICAgICAgICBXb3JkMTYgbWVtW10sICAgICAgLyogKGkvbyk6IG1lbW9yeSBhc3NvY2lhdGVkIHdpdGggdGhpcyBmaWx0ZXJpbmcuICAgICAqLwotICAgICAgICBXb3JkMTYgdXBkYXRlICAgICAgLyogKGkpICA6IDA9bm8gdXBkYXRlLC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cHlyaWdodCBob2xkZXIuCi0qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotLyoKLSoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCi0qCi0qICAgICAgR1NNIEFNUi1OQiBzcGVlY2ggY29kZWMgICBSOTggICBWZXJzaW9uIDcuNS4wICAgTWFyY2ggMiwgMjAwMQotKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgUjk5ICAgVmVyc2lvbiAzLjIuMAotKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgUkVMLTQgVmVyc2lvbiA0LjAuMAotKgotKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKLSoKLSogICAgICBGaWxlICAgICAgICAgICAgIDogdHlwZWRlZi5jCi0qICAgICAgUHVycG9zZSAgICAgICAgICA6IEJhc2ljIHR5cGVzLgotKgotKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKLSovCi0jaWZuZGVmIHR5cGVkZWZfaAotI2RlZmluZSB0eXBlZGVmX2ggIiRJZCAkIgotCi0jdW5kZWYgT1JJR0lOQUxfVFlQRURFRl9IIC8qIENIQU5HRSBUSElTIFRPICNkZWZpbmUgdG8gZ2V0IHRoZSAgICAgICovCi0vKiAgIm9yaWdpbmFsIiBFVFNJIHZlcnNpb24gb2YgdHlwZWRlZi5oICAqLwotLyogQ0hBTkdFIFRPICN1bmRlZiBmb3IgUFYgdmVyc2lvbiAgICAgICAgKi8KLQotI2lmZGVmIE9SSUdJTkFMX1RZUEVERUZfSAotLyoKLSAqIHRoaXMgaXMgdGhlIG9yaWdpbmFsIGNvZG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Uikgc3BlZWNoIGNvZGVjCi0gICAgQXZhaWxhYmxlIGZyb20gaHR0cDovL3d3dy4zZ3BwLm9yZwotCi0oQykgMjAwNCwgM0dQUCBPcmdhbml6YXRpb25hbCBQYXJ0bmVycyAoQVJJQiwgQVRJUywgQ0NTQSwgRVRTSSwgVFRBLCBUVEMpCi1QZXJtaXNzaW9uIHRvIGRpc3RyaWJ1dGUsIG1vZGlmeSBhbmQgdXNlIHRoaXMgZmlsZSB1bmRlciB0aGUgc3RhbmRhcmQgbGljZW5zZQotdGVybXMgbGlzdGVkIGFib3ZlIGhhcyBiZWVuIG9idGFpbmVkIGZyb20gdGhlIGNvcHlyaWdodCBob2xkZXIuCi0qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotLyoKLSoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCi0qKi0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0qKgotKiogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKioKLSoqICAgICBHU00gQU1SLU5CIHNwZWVjaCBjb2RlYyAgIFI5OCAgIFZlcnNpb24gNy41LjAgICBNYXJjaCAyLCAyMDAxICAgICAgICoqCi0qKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBSOTkgICBWZXJzaW9uIDMuMi4wICAgICAgICAgICAgICAgICAgICAgICAqKgotKiogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgUkVMLTQgVmVyc2lvbiA0LjAuMCAgICAgICAgICAgICAgICAgICAgICAgKioKLSoqICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICoqCi0qKi0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0qKgotKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKLSoKLSogICAgICBGaWxlICAgICAgICAgICAgIDogdmFkLmgKLSogICAgICBQdXJwb3NlICAgICAgICAgIDogVm9pY2UgQWN0aXZpdHkgRGV0ZWN0aW9uIChWQUQpIGZvciBBTVIKLSoKLSoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCi0qLwotI2lmbmRlZiB2YWRfaAotI2RlZmluZSB2YWRfaCAiJElkICQiCi0KLS8qCi0qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgotKiAgICAgICAgICAgICAgICAgICAgICAgICBJTkNMVURFIEZJTEVTCi0qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgotKi8KLQotI2luY2x1ZGUgInZhZDEuaCIgICAvKiBmb3IgVkFEIG9wdGlvbiAxICovCi0jaW5jbHVkZSAidmFkMi5oIiAgIC8qIGZvciBWQUQgb3B0aW9uIDIgKi8KLQotLyoKLSoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCi0qICAgICAgICAgICAgICAgICAgICAgICAgIExPQ0FMIFZBUklBQkxFUyBBTkQgVEFCTEVTCi0qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgotKi8KLQotLyoKLSoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCi0qICAgICAgICAgICAgICAgICAgICAgICAgIERFRklOSVRJT04gT0YgREFUQSBUWVBFUwotKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKLSovCi0KLSNpZm5kZWYgVkFEMgotI2RlZmluZSB2YWRTdGF0ZSB2YWRTdGF0ZTEKLSNlbHNlCi0jZGVmaW5lIHZhZFN0YXRlIHZhZFN0YXRlMgotI2VuZGlmCi0KLQotI2VuZGlmCmRpZmYgLS1naXQgYS9tZWRpYS9saWJzdGFnZWZyaWdodC9jb2RlY3MvYW1ybmIvY29tbW9uL2luY2x1ZGUvdmFkMS5oIGIvbWVkaWEvbGlic3RhZ2VmcmlnaHQvY29kZWNzL2Ftcm5iL2NvbW1vbi9pbmNsdWRlL3ZhZDEuaApkZWxldGVkIGZpbGUgbW9kZSAxMDA2NDQKaW5kZXggYzE0NGVhMC4uMDAwMDAwMAotLS0gYS9tZWRpYS9saWJzdGFnZWZyaWdodC9jb2RlY3MvYW1ybmIvY29tbW9uL2luY2x1ZGUvdmFkMS5oCisrKyAvZGV2L251bGwKQEAgLTEsMTk3ICswLDAgQEAKLS8qIC0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLQotICogQ29weXJpZ2h0IChDKSAxOTk4LTIwMDkgUGFja2V0VmlkZW8KLSAqCi0gKiBMaWNlbnNlZCB1bmRlciB0aGUgQXBhY2hlIExpY2Vuc2UsIFZlcnNpb24gMi4wICh0aGUgIkxpY2Vuc2UiKTsKLSAqIHlvdSBtYXkgbm90IHVzZSB0aGlzIGZpbG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gICAgICAvKiAgICBlc3RpbWF0aW9uICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0gICAgICAgIFdvcmQxNiBvbGRfbGV2ZWxbQ09NUExFTl07ICAgLyogaW5wdXQgbGV2ZWxzIG9mIHRoZSBwcmV2aW91cyBmcmFtZSAgICAgICAqLwotICAgICAgICBXb3JkMTYgc3ViX2xldmVsW0NPTVBMRU5dOyAgIC8qIGlucHV0IGxldmVscyBjYWxjdWxhdGVkIGF0IHRoZSBlbmQgb2YKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYSBmcmFtZSAobG9va2FoZWFkKSAgICAgICAgICAgICAgICAgICAqLwotICAgICAgICBXb3JkMTYgYV9kYXRhNVszXVsyXTsgICAgICAgIC8qIG1lbW9yeSBmb3IgdGhlIGZpbHRlciBiYW5rICAgICAgICAgICAgICAgKi8KLSAgICAgICAgV29yZDE2IGFfZGF0YTNbNV07ICAgICAgICAgICAvKiBtZW1vcnkgZm9yIHRoZSBmaWx0ZXIgYmFuayAgICAgICAgICAgICAgICovCi0KLSAgICAgICAgV29yZDE2IGJ1cnN0X2NvdW50OyAgICAgICAgICAvKiBjb3VudHMgbGVuZ3RoIG9mIGEgc3BlZWNoIGJ1cnN0ICAgICAgICAgICovCi0gICAgICAgIFdvcmQxNiBoYW5nX2NvdW50OyAgICAgICAgICAgLyogaGFuZ292ZXIgY291bnRlciAgICAgICAgICAgICAgICAgICAgICAgICAqLwotICAgICAgICBXb3JkMTYgc3RhdF9jb3VudDsgICAgICAgICAgIC8qIHN0YXRpb25hcnkgY291bnRlciAgICAgICAgICAgICAgICAgICAgICAgKi8KLQotICAgICAgICAvKiBOb3RlIHRoYXQgZWFjaCBvZiB0aGUgZm9sbG93aW5nIHRocmVlIHZhcmlhYmxlcyAodmFkcmVnLCBwaXRjaCBhbmQgdG9uZSkKLSAgICAgICAgICAgaG9sZHMgMTUgZmxhZ3MuIEVhY2ggZmxhZyByZXNlcnZlcyAxIGJpdCBvZiB0aGUgdmFyaWFibGUuIFRoZSBuZXdlc3QKLSAgICAgICAgICAgZmxhZyBpcyBpbiB0aGUgYml0IDE1IChhc3N1bWluZyB0aGF0IExTQiBpcyBiaXQgMSBhbmQgTVNCIGlzIGJpdCAxNikuICovCi0gICAgICAgIFdvcmQxNiB2YWRyZWc7ICAgICAgICAgICAgICAgLyogZmxhZ3MgZm9yIGludGVybWVkaWF0ZSBWQUQgZGVjaXNpb25zICAgICAqLwotICAgICAgICBXb3JkMTYgcGl0Y2g7ICAgICAgICAgICAgICAgIC8qIGZsYWdzIGZvciBwaXRjaCBkZXRlY3Rpb24gICAgICAgICAgICAgICAgKi8KLSAgICAgICAgV29yZDE2IHRvbmU7ICAgICAgICAgICAgICAgICAvKiBmbGFncyBmb3IgdG9uZSBkZXRlY3Rpb24gICAgICAgICAgICAgICAgICovCi0gICAgICAgIFdvcmQxNiBjb21wbGV4X2hpZ2g7ICAgICAgICAgLyogZmxhZ3MgZm9yIGNvbXBsZXggZGV0ZWN0aW9uICAgICAgICAgICAgICAqLwotICAgICAgICBXb3JkMTYgY29tcGxleF9sb3c7ICAgICAgICAgIC8qIGZsYWdzIGZvciBjb21wbGV4IGRldGVjdGlvbiAgICAgICAgICAgICAgKi8KLQotICAgICAgICBXb3JkMTYgb2xkbGFnX2NvdW50LCBvbGRsYWc7IC8qIHZhcmlhYmxlcyBmb3IgcGl0Y2ggZGV0ZWN0aW9uICAgICAgICAgICAgKi8KLQotICAgICAgICBXb3JkMTYgY29tcGxleF9oYW5nX2NvdW50OyAgIC8qIGNvbXBsZXggaGFuZ292ZXIgY291bnRlciwgdXNlZCBieSBWQUQgICAgKi8KLSAgICAgICAgV29yZDE2IGNvbXBsZXhfaGFuZ190aW1lcjsgICAvKiBoYW5nb3ZlciBpbml0aWF0b3IsIHVzZWQgYnkgQ0FEICAgICAgICAgICovCi0KLSAgICAgICAgV29yZDE2IGJlc3RfY29ycl9ocDsgICAgICAgICAvKiBGSVAgZmlsdGVyZWQgd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4gZWFjaCBjYWxsLgotICAgICAgIHJldHVybnMgMCBvbiBzdWNjZXNzCi0gICAgICovCi0KLSAgICBXb3JkMTYgdmFkMV9yZXNldCh2YWRTdGF0ZTEgKnN0KTsKLSAgICAvKiByZXNldCBvZiBwcmUgcHJvY2Vzc2luZyBzdGF0ZSAoaS5lLiBzZXQgc3RhdGUgbWVtb3J5IHRvIHplcm8pCi0gICAgICAgcmV0dXJucyAwIG9uIHN1Y2Nlc3MKLSAgICAgKi8KLQotICAgIHZvaWQgdmFkMV9leGl0KHZhZFN0YXRlMSAqKnN0KTsKLSAgICAvKiBkZS1pbml0aWFsaXplIHByZSBwcm9jZXNzaW5nIHN0YXRlIChpLmUuIGZyZWUgc3RhdHVzIHN0cnVjdCkKLSAgICAgICBzdG9yZXMgTlVMTCBpbiAqc3QKLSAgICAgKi8KLQotICAgIHZvaWQgdmFkX2NvbXBsZXhfZGV0ZWN0aW9uX3VwZGF0ZSh2YWRTdGF0ZTEgKnN0LCAgICAgICAvKiBpL28gOiBTdGF0ZSBzdHJ1Y3QgICAgICovCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFdvcmQxNiBiZXN0X2NvcnJfaHAgLyogaSAgIDogYmVzdCBDb3JyIFExNSAgICAqLwotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICk7Ci0KLSAgICB2b2lkIHZhZF90b25lX2RldGVjdGlvbih2YWRTdGF0ZTEgKnN0LCAgLyogaS9vIDogU3RhdGUgc3RydWN0ICAgICAgICAgICAgKi8KLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBXb3JkMzIgdDAsICAgICAvKiBpICAgOiBhdXRvY29ycmVsYXRpb24gbWF4aW1hICAqLwotICAgICAgICAgICAgICAgICAgICAgICAgICAgIFdvcmQzMiB0MSwgICAgIC8qIGkgICA6IGVuZXJneSAgICAgICAgICAgICAgICAgICovCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgRmxhZyAgICpwT3ZlcmZsb3cKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICk7Ci0KLSAgICB2b2lkIHZhZF90b25lX2RldGVjdGlvbl91cGRhdGUoCi0gICAgICAgIHZhZFN0YXRlMSAqc3QsICAgICAgICAgICAgIC8qIGkvbyA6IFN0YXRlIHN0cnVjdCAgICAgICAgICAgICAgKi8KLSAgICAgICAgV29yZDE2IG9uZV9sYWdfcGVyX2ZyYW1lLCAgLyogaSAgIDogMSBpZiBvbmUgb3Blbi1sb29wIGxhZyBpcwotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNhbGN1bGF0ZWQgcGVyIGVhY2ggZnJhbWUsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgb3RoZXJ3aXNlIDAgICAgICAgICAgICAgICAgICAgICAqLwotICAgICAgICBGbGFnICpwT3ZlcmZsb3cKLSAgICApOwotCi0gICAgdm9pZCB2YWRfcGl0Y2hfZGV0ZWN0aW9uKHZhZFN0YXRlMSAqc3QsICAgLyogaS9vIDogU3RhdGUgc3RydWN0ICAgICAgICAgICAgICAgICAgKi8KLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgV29yZDE2IGxhZ3NbXSwgIC8qIGkgICA6IHNwZWVjaCBlbmNvZGVyIG9wZW4gbG9vcCBsYWdzICovCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgIEZsYWcgICAqcE92ZXJmbG93Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgKTsKLQotICAgIFdvcmQxNiB2YWQxKHZhZFN0YXRlMSAqc3QsICAgLyogaS9vIDogU3RhdGUgc3RydWN0ICAgICAgICAgICAgICAgICAgICAgICovCi0gICAgICAgICAgICAgICAgV29yZDE2IGluX2J1ZltdLCAvKiBpICAgOiBzYW1wbGVzIG9mIHRoZSBpbnB1dCBmcmFtZQotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpbmJ1ZlsxNTldIGlzIHRoZSB2ZXJ5I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I2RlZmluZSAgICAgVFJVRSAgICAgICAgMQotI2RlZmluZSAgICAgRkFMU0UgICAgICAgMAotCi0jZGVmaW5lICAgICBGUk1fTEVOICAgICAgICAgICAgICAgICA4MAotI2RlZmluZSAgICAgREVMQVkgICAgICAgICAgICAgICAgICAgMjQKLSNkZWZpbmUgICAgIEZGVF9MRU4gICAgICAgICAgICAgICAgIDEyOAotCi0jZGVmaW5lICAgICBOVU1fQ0hBTiAgICAgICAgICAgICAgICAxNgotI2RlZmluZSAgICAgTE9fQ0hBTiAgICAgICAgICAgICAgICAgMAotI2RlZmluZSAgICAgSElfQ0hBTiAgICAgICAgICAgICAgICAgMTUKLQotI2RlZmluZSAgICAgVVBEQVRFX1RITEQgICAgICAgICAgICAgMzUKLSNkZWZpbmUgICAgIEhZU1RFUl9DTlRfVEhMRCAgICAgICAgIDYKLSNkZWZpbmUgICAgIFVQREFURV9DTlRfVEhMRCAgICAgICAgIDUwCi0KLSNkZWZpbmUgICAgIFNISUZUX1NUQVRFXzAgICAgICAgMCAgICAgICAvKiBjaGFubmVsIGVuZXJneSBzY2FsZWQgYXMgMjIsOSAqLwotI2RlZmluZSAgICAgU0hJRlRfU1RBVEVfMSAgICAgICAxICAgICAgIC8qIGNoYW5uZWwgZW5lcmd5IHNjYWxlZCBhcyAyNyw0ICovCi0KLSNkZWZpbmUgICAgIE5PSVNFX0ZMT09SX0NIQU5fMCAgNTEyICAgICAvKiAxLjAgICAgc2NhbGVkIGFzIDIyLDkgKi8KLSNkZWZpbmUgICAgIE1JTl9DSEFOX0VOUkdfMCAgICAgMzIgICAgICAvKiAwLjA2MjUgc2NhbGVkIGFzIDIyLDkgKi8KLSNkZWZpbmUgICAgIE1JTl9OT0lTRV9FTlJHXzAgICAgMzIgICAgICAvKiAwLjA2MjUgc2NhbGVkIGFzIDIyLDkgKi8KLSNkZWZpbmUgICAgIElORV9OT0lTRV8wICAgICA4MTkyICAgICAgICAvKiAxNi4wICAgc2NhbGVkIGFzIDIyLDkgK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ZSBjb3B5cmlnaHQgaG9sZGVyLgotKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLS8qCi0qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgotKgotKiAgICAgIEdTTSBBTVItTkIgc3BlZWNoIGNvZGVjICAgUjk4ICAgVmVyc2lvbiA3LjUuMCAgIE1hcmNoIDIsIDIwMDEKLSogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFI5OSAgIFZlcnNpb24gMy4yLjAKLSogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFJFTC00IFZlcnNpb24gNC4wLjAKLSoKLSoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCi0qCi0qICAgICAgRmlsZSAgICAgICAgICAgICA6IHdlaWdodF9hLmgKLSogICAgICBQdXJwb3NlICAgICAgICAgIDogU3BlY3RyYWwgZXhwYW5zaW9uIG9mIExQIGNvZWZmaWNpZW50cy4gIChvcmRlcj09MTApCi0qICAgICAgRGVzY3JpcHRpb24gICAgICA6IGFfZXhwW2ldID0gYVtpXSAqIGZhY1tpLTFdICAgICxpPTEsMTAKLSoKLSoKLSoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCi0qLwotI2lmbmRlZiB3ZWlnaHRfYV9oCi0jZGVmaW5lIHdlaWdodF9hX2ggIiRJZCAkIgotCi0vKgotKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKLSogICAgICAgICAgICAgICAgICAgICAgICAgSU5DTFVERSBGSUxFUwotKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKLSovCi0jaW5jbHVkZSAidHlwZWRlZi5oIgotCi0jaWZkZWYgX19jcGx1c3BsdXMKLWV4dGVybiAiQyIKLXsKLSNlbmRpZgotCi0gICAgLyoKLSAgICAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgotICAgICogICAgICAgICAgICAgICAgICAgICAgICAgREVGSU5JVElPTiBPRiBEQVRBIFRZUEVTCi0gICAgKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKLSAgICAqLwotCi0gICAgLyoKLSAgICAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgotICAgICogICAgICAgICAgICAgICAgICAgICAgICAgREVDTEFSQVRJT04gT0YgUFJPVE9UWVBFUwotICAgICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCi0gICAgKi8KLSAgICB2b2lkIFdlaWdodF9BaSgKLSAgICAgICAgV29yZDE2IGFbXSwgICAgICAgIC8qIChpKSAgOiBhW20rMV0gIExQQyBjb2VmZmljaWVudHMgICAobT0xMCkgICAgICAgICAgKi8KLSAgICAgICAgY29uc3QgV29yZDE2IGZhY1tdLC8qIChpKSAgOiBTcGVjdHJhbCBleHBhbnNpb24gZmFjdG9ycy4gICAgICAgICAgICAgICAgKi8KLSAgICAgICAgV29yZDE2IGFfZXhwW10gICAgIC8qIChvKSAgOiBTcGVjdHJhbCBleHBhbmRlZCBMUEMgY29lZmZpY2llbnRzICAgICAgICAgKi8KLSAgICApOwotCi0jaWZkZWYgX19j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ikgKiAocF9mKyspIDw8IDE0OwotCi0gICAgICAgIExfdGVtcCA9ICgoV29yZDMyKSBiMV9oIDw8IDE2KSArICgoV29yZDMyKSBiMV9sIDw8IDEpOwotCi0gICAgICAgIC8qIGIwID0gMi4wKngqYjEgLSBiMiArIGZbaV0qLwotICAgICAgICBiMV9oID0gKFdvcmQxNikodDAgPj4gMTYpOwotICAgICAgICBiMV9sID0gKFdvcmQxNikoKHQwID4+IDEpIC0gKGIxX2ggPDwgMTUpKTsKLQotICAgIH0KLQotICAgIC8qIHQwID0geCpiMTsgKi8KLSAgICB0MCAgPSAoKFdvcmQzMikgYjFfaCAqIHgpOwotICAgIHQwICs9ICgoV29yZDMyKSBiMV9sICogeCkgPj4gMTU7Ci0gICAgdDAgPDw9IDE7Ci0KLQotICAgIC8qIHQwID0geCpiMSAtIGIyICAgKi8KLSAgICB0MCAtPSBMX3RlbXA7Ci0KLSAgICAvKiB0MCA9IHgqYjEgLSBiMiArIGZbaV0vMiAqLwotICAgIHQwICs9IChXb3JkMzIpICogKHBfZikgPDwgMTM7Ci0KLQotICAgIGlmICgoVVdvcmQzMikodDAgLSAweGZlMDAwMDAwTCkgPCAoVVdvcmQzMikweDAzZmZmZmZmTCkKLSAgICB7Ci0gICAgICAgIGNoZWIgPSAoV29yZDE2KSh0MCA+PiAxMCk7Ci0gICAgfQotICAgIGVsc2UKLSAgICB7Ci0gICAgICAgIGlmICh0MCA+IChXb3JkMzIpIDB4MDFmZmZmZmZMKQotICAgICAgICB7Ci0gICAgICAgICAgICBjaGViID0gTUFYXzE2OwotCi0gICAgICAgIH0KLSAgICAgICAgZWxzZQotICAgICAgICB7Ci0gICAgICAgICAgICBjaGViID0gTUlOXzE2OwotICAgICAgICB9Ci0gICAgfQotCi0gICAgcmV0dXJuIChjaGViKTsKLX0KLQotCi0vKgotLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t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LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tCi0gUFNFVURPLUNPREUKLQotdm9pZCBBel9sc3AgKAotICAgIFdvcmQxNiBhW10sICAgICAgICAgLy8gKGkpICA6IHByZWRpY3RvciBjb2VmZmljaWVudHMgKE1QMSkKLSAgICBXb3JkMTYgbHNwW10sICAgICAgIC8vIChvKSAgOiBsaW5lIHNwZWN0cmFsIHBhaXJzIChNKQotICAgIFdvcmQxNiBvbGRfbHNwW10gICAgLy8gKGkpICA6IG9sZCBsc3BbXSAoaW4gY2FzZSBub3QgZm91bmQgMTAgcm9vdHMpIChNKQotKQotewotICAgIFdvcmQxNiBpLCBqLCBuZiwgaXA7Ci0gICAgV29yZDE2IHhsb3csIHlsb3csIHhoaWdoLCB5aGlnaCwgeG1pZCwgeW1pZCwgeGludDsKLSAgICBXb3JkMTYgeCwgeSwgc2lnbiwgZXhwOwotICAgIFdvcmQxNiAqY29lZjsKLSAgICBXb3JkMTYgZjFbTSAvIDIgKyAxXSwgZjJbTSAvIDIgKyAxXTsKLSAgICBXb3JkMzIgdDA7Ci0KLSAgICAgKi0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0qCi0gICAgICogIGZpbmQgdGhlIHN1bSBhbmQgZGlmZi4gcG9sLiBGMSh6KSBhbmQgRjIoeikgICAgICAgICAgICAgICAgKgotICAgICAqICAgIEYxKHopIDwtLS0gRjEoeikvKDEreioqLTEpICYgRjIoeikgPC0tLSBGMih6KS8oMS16KiotMSkgICoKLSAgICAgKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqCi0gICAgICogZjFbMF0gPSAxLjA7ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKgotICAgICAqIGYyWzBdID0gMS4wOyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICoKLSAgICAgKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqCi0gICAgICogZm9yIChpID0gMDsgaTwgTkM7IGkrKykgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKgotICAgICAqIHsgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICoKLSAgICAgKiAgIGYxW2krMV0gPSBhW2krMV0gKyBhW00taV0gLSBmMVtpXSA7ICAgICAgICAgICAgICAgICAgICAgICAqCi0gICAgICogICBmMltpKzFdID0gYVtpKzFdIC0gYVtNLWldICsgZjJbaV0gOyAgICAgICAgICAgICAgICAgICAgICAgKgotICAgICAqIH0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICoKLSAgICAgKi0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0qCi0KLSAgICBmMVswXSA9IDEwMjQ7IC8vIGYxWzBdID0gMS4wCi0gICAgZjJbMF0gPSAxMDI0OyAvLyBmMlswXSA9IDEuMAotCi0vLyBUaGUgcmVmZXJlbmNlIEVUU0kgY29kZSB1c2VzIGEgZ2xvYmFsIGZsYWcgZm9yIE92ZXJmbG93LiBIb3dldmVyLCBpbiB0aGUKLS8vIGFjdHVhbCBpbXBsZW1lbnRhdGlvbiBhIHBvaW50ZXIgdG8gT3ZlcmZsb3cgZmxhZyBpcyBwYXNzZWQgaW4gYXMgYQotLy8gcGFyYW1ldGVyIHRvIHRoZSBmdW5jdGlvbi4gVGhpcyBwb2ludGVyIGlzIHBhc3NlZCBpbnRvIGFsbCB0aGUgYmFzaWMgbWF0aAotLy8gZnVuY3Rpb25zIGludm9rZWQKLQotICAgIGZvciAoaSA9IDA7IG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DaGVicHMgKHhsb3csIGNvZWYsIE5DKTsKLQotICAgIGogPSAwOwotICAgIC8vIHdoaWxlICggKG5mIDwgTSkgJiYgKGogPCBncmlkX3BvaW50cykgKQotICAgIHdoaWxlICgoc3ViIChuZiwgTSkgPCAwKSAmJiAoc3ViIChqLCBncmlkX3BvaW50cykgPCAwKSkKLSAgICB7Ci0gICAgICAgIGorKzsKLSAgICAgICAgeGhpZ2ggPSB4bG93OwotICAgICAgICB5aGlnaCA9IHlsb3c7Ci0gICAgICAgIHhsb3cgPSBncmlkW2pdOwotICAgICAgICB5bG93ID0gQ2hlYnBzICh4bG93LCBjb2VmLCBOQyk7Ci0KLSAgICAgICAgaWYgKExfbXVsdCAoeWxvdywgeWhpZ2gpIDw9IChXb3JkMzIpIDBMKQotICAgICAgICB7Ci0KLSAgICAgICAgICAgIC8vIGRpdmlkZSA0IHRpbWVzIHRoZSBpbnRlcnZhbAotCi0gICAgICAgICAgICBmb3IgKGkgPSAwOyBpIDwgNDsgaSsrKQotICAgICAgICAgICAgewotICAgICAgICAgICAgICAgIC8vIHhtaWQgPSAoeGxvdyArIHhoaWdoKS8yCi0gICAgICAgICAgICAgICAgeG1pZCA9IGFkZCAoc2hyICh4bG93LCAxKSwgc2hyICh4aGlnaCwgMSkpOwotICAgICAgICAgICAgICAgIHltaWQgPSBDaGVicHMgKHhtaWQsIGNvZWYsIE5DKTsKLQotICAgICAgICAgICAgICAgIGlmIChMX211bHQgKHlsb3csIHltaWQpIDw9IChXb3JkMzIpIDBMKQotICAgICAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAgICAgeWhpZ2ggPSB5bWlkOwotICAgICAgICAgICAgICAgICAgICB4aGlnaCA9IHhtaWQ7Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgIGVsc2UKLSAgICAgICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgICAgIHlsb3cgPSB5bWlkOwotICAgICAgICAgICAgICAgICAgICB4bG93ID0geG1pZDsKLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgICAqLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSoKLSAgICAgICAgICAgICAqIExpbmVhciBpbnRlcnBvbGF0aW9uICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICoKLSAgICAgICAgICAgICAqICAgIHhpbnQgPSB4bG93IC0geWxvdyooeGhpZ2gteGxvdykvKHloaWdoLXlsb3cpOyAgICAgICAgICAgICoKLSAgICAgICAgICAgICAqLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSoKLQotICAgICAgICAgICAgeCA9IHN1YiAoeGhpZ2gsIHhsb3cpOwotICAgICAgICAgICAgeSA9IHN1YiAoeWhpZ2gsIHlsb3cpOwotCi0gICAgICAgICAgICBpZiAoeSA9PSAwKQotICAgICAgICAgICAgewotICAgICAgICAgICAgICAgIHhpbnQgPSB4bG93OwotICAgICAgICAgICAgfQotICAgICAgICAgICAgZWxzZQotICAgICAgICAgICAgewotICAgICAgICAgICAgICAgIHNpZ24gPSB5OwotICAgICAgICAgICAgICAgIHkgPSBhYnNfcyAoeSk7Ci0gICAgICAgICAgICAgICAgZXhwID0gbm9ybV9zICh5KTsKLSAgICAgICAgICAgICAgICB5ID0gc2hsICh5LCBleHApOwotICAgICAgICAgICAgICAgIHkgPSBkaXZfcyAoKFdvcmQxNikgMTYzODMsIHkpOwotICAgICAgICAgICAgICAgIHQwID0gTF9tdWx0ICh4LCB5KTsKLSAgICAgICAgICAgICAgICB0MCA9IExfc2hyICh0MCwgc3ViICgyMCwgZXhwKSk7Ci0gICAgICAgICAgICAgICAgeSA9IGV4dHJhY3RfbCAodDApOyAgICAgLy8geT0gKHhoaWdoLXhsb3cpLyh5aGlnaC15bG93KQotCi0gICAgICAgICAgICAgICAgaWYgKHNpZ24gPCAwKQotICAgICAgICAgICAgICAgICAgICB5ID0gbmVnYXRlICh5KTsKLQotICAgICAgICAgICAgICAgIHQwID0gTF9tdWx0ICh5bG93LCB5KTsKLSAgICAgICAgICAgICAgICB0MCA9IExfc2hyICh0MCwgMTEpOwotICAgICAgICAgICAgICAgIHhpbnQgPSBzdWIgKHhsb3csIGV4dHJhY3RfbCAodDApKTsgLy8geGludCA9IHhsb3cgLSB5bG93KnkKLSAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgbHNwW25mXSA9IHhpbnQ7Ci0gICAgICAgICAgICB4bG93ID0geGludDsKLSAgICAgICAgICAgIG5mKys7Ci0KLSAgICAgICAgICAgIGlmIChpcCA9PSAwKQotICAgICAgICAgICAgewotICAgICAgICAgICAgICAgIGlwID0gMTsKLSAgICAgICAgICAgICAgICBjb2VmID0gZjI7Ci0gICAgICAgICAgICB9Ci0gICAgICAgICAgICBlbHNlCi0gICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgaXAgPSAwOwotICAgICAgICAgICAgICAgIGNvZWYgPSBmMTsKLSAgICAgICAgICAgIH0KLSAgICAgICAgICAgIHlsb3cgPSBDaGVicHMgKHhsb3csIGNvZWYsIE5DKTsKLQotICAgICAgICB9Ci0gICAgfQotCi0gICAgLy8gQ2hlY2sgaWYgTSByb290cyBmb3VuZAotCi0gICAgaWYgKHN1YiAobmYsIE0pIDwgMCkKLSAgICB7Ci0gICAgICAgIGZvciAoaSA9IDA7IGkgPCBNOyBpKyspCi0gICAgICAgIHsKLSAgICAgICAgICAgIGxzcFtpXSA9IG9sZF9sc3BbaV07Ci0gICAgICAgIH0KLQotICAgIH0KLSAgICByZXR1cm47Ci19Ci0KLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLQotIFJFU09VUkNFUyBVU0VEIF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gICAgICoKLSAgICAgKiAgICBGMSh6KSA8LS0tIEYxKHopLygxK3oqKi0xKSAmIEYyKHopIDwtLS0gRjIoeikvKDEteioqLTEpICAqCi0gICAgICogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKgotICAgICAqIGYxWzBdID0gMS4wOyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICoKLSAgICAgKiBmMlswXSA9IDEuMDsgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqCi0gICAgICogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKgotICAgICAqIGZvciAoaSA9IDA7IGk8IE5DOyBpKyspICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICoKLSAgICAgKiB7ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqCi0gICAgICogICBmMVtpKzFdID0gYVtpKzFdICsgYVtNLWldIC0gZjFbaV0gOyAgICAgICAgICAgICAgICAgICAgICAgKgotICAgICAqICAgZjJbaSsxXSA9IGFbaSsxXSAtIGFbTS1pXSArIGYyW2ldIDsgICAgICAgICAgICAgICAgICAgICAgICoKLSAgICAgKiB9ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqCi0gICAgICotLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tKi8KLQotICAgICpwX2YxID0gMTAyNDsgICAgICAgICAgICAgICAgICAgICAgIC8qIGYxWzBdID0gMS4wICovCi0gICAgKnBfZjIgPSAxMDI0OyAgICAgICAgICAgICAgICAgICAgICAgLyogZjJbMF0gPSAxLjAgKi8KLQotICAgIGZvciAoaSA9IDA7IGkgPCBOQzsg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NvZWYgPSBmMTsKLQotICAgIHhsb3cgPSAqKGdyaWQpOwotICAgIHlsb3cgPSBDaGVicHMoeGxvdywgY29lZiwgTkMsIHBPdmVyZmxvdyk7Ci0KLSAgICBqID0gMDsKLQotICAgIHdoaWxlICgobmYgPCBNKSAmJiAoaiA8IGdyaWRfcG9pbnRzKSkKLSAgICB7Ci0gICAgICAgIGorKzsKLSAgICAgICAgeGhpZ2ggPSB4bG93OwotICAgICAgICB5aGlnaCA9IHlsb3c7Ci0gICAgICAgIHhsb3cgPSAqKGdyaWQgKyBqKTsKLSAgICAgICAgeWxvdyA9IENoZWJwcyh4bG93LCBjb2VmLCBOQywgcE92ZXJmbG93KTsKLQotICAgICAgICBpZiAoKChXb3JkMzIpeWxvdyp5aGlnaCkgPD0gMCkKLSAgICAgICAgewotICAgICAgICAgICAgLyogZGl2aWRlIDQgdGltZXMgdGhlIGludGVydmFsICovCi0gICAgICAgICAgICBmb3IgKGkgPSA0OyBpICE9IDA7IGktLSkKLSAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAvKiB4bWlkID0gKHhsb3cgKyB4aGlnaCkvMiAqLwotICAgICAgICAgICAgICAgIHggPSB4bG93ID4+IDE7Ci0gICAgICAgICAgICAgICAgeSA9IHhoaWdoID4+IDE7Ci0gICAgICAgICAgICAgICAgeG1pZCA9IHggKyB5OwotCi0gICAgICAgICAgICAgICAgeW1pZCA9IENoZWJwcyh4bWlkLCBjb2VmLCBOQywgcE92ZXJmbG93KTsKLQotICAgICAgICAgICAgICAgIGlmICgoKFdvcmQzMil5bG93KnltaWQpIDw9IDApCi0gICAgICAgICAgICAgICAgewotICAgICAgICAgICAgICAgICAgICB5aGlnaCA9IHltaWQ7Ci0gICAgICAgICAgICAgICAgICAgIHhoaWdoID0geG1pZDsKLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgZWxzZQotICAgICAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAgICAgeWxvdyA9IHltaWQ7Ci0gICAgICAgICAgICAgICAgICAgIHhsb3cgPSB4bWlkOwotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgLyotLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tKgotICAgICAgICAgICAgICogTGluZWFyIGludGVycG9sYXRpb24gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKgotICAgICAgICAgICAgICogICAgeGludCA9IHhsb3cgLSB5bG93Kih4aGlnaC14bG93KS8oeWhpZ2gteWxvdyk7ICAgICAgICAgICAgKgotICAgICAgICAgICAgICotLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tKi8KLQotICAgICAgICAgICAgeCA9IHhoaWdoIC0geGxvdzsKLSAgICAgICAgICAgIHkgPSB5aGlnaCAtIHlsb3c7Ci0KLSAgICAgICAgICAgIGlmICh5ID09IDApCi0gICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgeGludCA9IHhsb3c7Ci0gICAgICAgICAgICB9Ci0gICAgICAgICAgICBlbHNlCi0gICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgc2lnbiA9IHk7Ci0gICAgICAgICAgICAgICAgeSA9IGFic19zKHkpOwotICAgICAgICAgICAgICAgIGV4cCA9IG5vcm1fcyh5KTsKLSAgICAgICAgICAgICAgICB5IDw8PSBleHA7Ci0gICAgICAgICAgICAgICAgeSA9IGRpdl9zKChXb3JkMTYpIDE2MzgzLCB5KTsKLQotICAgICAgICAgICAgICAgIHkgPSAoKFdvcmQzMil4ICogeSkgPj4gKDE5IC0gZXhwKTsKLQotICAgICAgICAgICAgICAgIGlmIChzaWduIDwgMCkKLSAgICAgICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgICAgIHkgPSAteTsKLSAgICAgICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgICAgICAvKiB4aW50ID0geGxvdyAtIHlsb3cqeSAqLwotICAgICAgICAgICAgICAgIHhpbnQgPSB4bG93IC0gKCgoV29yZDMyKSB5bG93ICogeSkgPj4gMTApOwotICAgICAgICAgICAgfQotCi0gICAgICAgICAgICAqKGxzcCArIG5mKSA9IHhpbnQ7Ci0gICAgICAgICAgICB4bG93ID0geGludDsKLSAgICAgICAgICAgIG5mKys7Ci0KLSAgICAgICAgICAgIGlmIChpcCA9PSAwKQotICAgICAgICAgICAgewotICAgICAgICAgICAgICAgIGlwID0gMTsKLSAgICAgICAgICAgICAgICBjb2VmID0gZjI7Ci0gICAgICAgICAgICB9Ci0gICAgICAgICAgICBlbHNlCi0gICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgaXAgPSAwOwotICAgICAgICAgICAgICAgIGNvZWYgPSBmMTsKLSAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgeWxvdyA9IENoZWJwcyh4bG93LCBjb2VmLCBOQywgcE92ZXJmbG93KTsKLQotICAgICAgICB9Ci0gICAgfQotCi0gICAgLyogQ2hlY2sgaWYgTSByb290cyBmb3VuZCAqLwotCi0gICAgaWYgKG5mIDwgTSkKLSAgICB7Ci0gICAgICAgIGZvciAoaSA9IE5DOyBpICE9IDAgOyBpLS0pCi0gICAgICAgIHsKLSAgICAgICAgICAgICpsc3ArKyA9ICpvbGRfbHNwKys7Ci0gICAgICAgICAgICAqbHNwKysgPSAqb2xkX2xzcCsrOwotICAgICAgICB9Ci0gICAgfQotCi19Ci0KLVdvcmQxNiBDaGVicHNfV3JhcHBlcihXb3JkMTYgeCwKLSAgICAgICAgICAgICAgICAgICAgICBXb3JkMTYgZltdLCAvKiAobikgKi8KLSAgICAgICAgICAgICAgICAgICAgICBXb3JkMTYgbiwKLSAgICAgICAgICAgICAgICAgICAgICBGbGFnICpwT3ZlcmZsb3cpCi17Ci0gICAgcmV0dXJuIENoZWJwcyh4LCBmLCBuLCBwT3ZlcmZs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XJhbWV0ZXJzIHRvIGZpcnN0IHN1YmZyYW1lIHBlciBtb2RlcyAqLwotICAgIGNvbnN0IFdvcmQxNiBwcm1ub2ZzZltOX01PREVTIC0gMV0gPQotICAgIHsKLSAgICAgICAgUFJNTk9GU0ZfTVI0NzUsCi0gICAgICAgIFBSTU5PRlNGX01SNTE1LAotICAgICAgICBQUk1OT0ZTRl9NUjU5LAotICAgICAgICBQUk1OT0ZTRl9NUjY3LAotICAgICAgICBQUk1OT0ZTRl9NUjc0LAotICAgICAgICBQUk1OT0ZTRl9NUjc5NSwKLSAgICAgICAgUFJNTk9GU0ZfTVIxMDIsCi0gICAgICAgIFBSTU5PRlNGX01SMTIyCi0gICAgfTsKLQotICAgIC8qIHBhcmFtZXRlciBzaXplcyAoIyBvZiBiaXRzKSwgb25lIHRhYmxlIHBlciBtb2RlICovCi0gICAgY29uc3QgV29yZDE2IGJpdG5vX01SNDc1W1BSTU5PX01SNDc1XSA9Ci0gICAgewotICAgICAgICA4LCA4LCA3LCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8qIExTUCBWUSAgICAgICAgICAqLwotICAgICAgICA4LCA3LCAyLCA4LCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8qIGZpcnN0IHN1YmZyYW1lICAqLwotICAgICAgICA0LCA3LCAyLCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8qIHNlY29uZCBzdWJmcmFtZSAqLwotICAgICAgICA0LCA3LCAyLCA4LCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8qIHRoaXJkIHN1YmZyYW1lICAqLwotICAgICAgICA0LCA3LCAyLCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8qIGZvdXJ0aCBzdWJmcmFtZSAqLwotICAgIH07Ci0KLSAgICBjb25zdCBXb3JkMTYgYml0bm9fTVI1MTVbUFJNTk9fTVI1MTVdID0KLSAgICB7Ci0gICAgICAgIDgsIDgsIDcsICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLyogTFNQIFZRICAgICAgICAgICovCi0gICAgICAgIDgsIDcsIDIsIDYsICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLyogZmlyc3Qgc3ViZnJhbWUgICovCi0gICAgICAgIDQsIDcsIDIsIDYsICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLyogc2Vjb25kIHN1YmZyYW1lICovCi0gICAgICAgIDQsIDcsIDIsIDYsICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLyogdGhpcmQgc3ViZnJhbWUgICovCi0gICAgICAgIDQsIDcsIDIsIDYsICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLyogZm91cnRoIHN1YmZyYW1lICovCi0gICAgfTsKLQotICAgIGNvbnN0IFdvcmQxNiBiaXRub19NUjU5W1BSTU5PX01SNTldID0KLSAgICB7Ci0gICAgICAgIDgsIDksIDksICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLyogTFNQIFZRICAgICAgICAgICovCi0gICAgICAgIDgsIDksIDIsIDYsICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLyogZmlyc3Qgc3ViZnJhbWUgICovCi0gICAgICAgIDQsIDksIDIsIDYsICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLyogc2Vjb25kIHN1YmZyYW1lICovCi0gICAgICAgIDgsIDksIDIsIDYsICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLyogdGhpcmQgc3ViZnJhbWUgICovCi0gICAgICAgIDQsIDksIDIsIDYsICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLyogZm91cnRoIHN1YmZyYW1lICovCi0gICAgfTsKLQotICAgIGNvbnN0IFdvcmQxNiBiaXRub19NUjY3W1BSTU5PX01SNjddID0KLSAgICB7Ci0gICAgICAgIDgsIDksIDksICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLyogTFNQIFZRICAgICAgICAgICovCi0gICAgICAgIDgsIDExLCAzLCA3LCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLyogZmlyc3Qgc3ViZnJhbWUgICovCi0gICAgICAgIDQsIDExLCAzLCA3LCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLyogc2Vjb25kIHN1YmZyYW1lICovCi0gICAgICAgIDgsIDExLCAzLCA3LCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLyogdGhpcmQgc3ViZnJhbWUgICovCi0gICAgICAgIDQsIDExLCAzLCA3LCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLyogZm91cnRoIHN1YmZyYW1lICovCi0gICAgfTsKLQotICAgIGNvbnN0IFdvcmQxNiBiaXRub19NUjc0W1BSTU5PX01SNzRdID0KLSAgICB7Ci0gICAgICAgIDgsIDksIDksICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLyogTFNQIFZRICAgICAgICAgICovCi0gICAgICAgIDgsIDEzLCA0LCA3LCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLyogZmlyc3Qgc3ViZnJhbWUgICovCi0gICAgICAgIDUsIDEzLCA0LCA3LCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLyogc2Vjb25kIHN1YmZyYW1lICovCi0gICAgICAgIDgsIDEzLCA0LCA3LCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLyogdGhpcmQgc3ViZnJhbWUgICovCi0gICAgICAgIDUsIDEzLCA0LCA3LCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLyogZm91cnRoIHN1YmZyYW1lICovCi0gICAgfTsKLQotICAgIGNvbnN0IFdvcmQxNiBiaXRub19NUjc5NVtQUk1OT19NUjc5NV0gPQotICAgIHsKLSAgICAgICAgOSwgOSwgOSwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvKiBMU1AgVlEgICAgICAgICAgKi8KLSAgICAgICAgOCwgMTMsIDQsIDQsIDUsICAgICAgICAgICAgICAgICAgICAgICAgICAvKiBmaXJzdCBzdWJmcmFtZSAgKi8KLSAgICAgICAgNiwgMTMsIDQsIDQsIDUsICAgICAgICAgICAgICAgICAgICAgICAgICAvKiBzZWNvbmQgc3ViZnJhbWUgKi8KLSAgICAgICAgOCwgMTMsIDQsIDQsIDUsICAgICAgICAgICAgICAgICAgICAgICAgICAvKiB0aGlyZCBzdWJmcmFtZSAgKi8KLSAgICAgICAgNiwgMTMsIDQsIDQsIDUsICAgICAgICAgICAgICAgICAgICAgICAgICAvKiBmb3VydGggc3ViZnJhbWUgKi8KLSAgICB9OwotCi0gICAgY29uc3QgV29yZDE2IGJpdG5vX01SMTAyW1BSTU5PX01SMTAyXSA9Ci0gICAgewotICAgICAgICA4LCA5LCA5LCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8qIExTUCBWUSAgICAgICAgICAqLwotICAgICAgICA4LCAxLCAxLCAxLCAxLCAxMCwgMTAsIDcsIDcsICAgICAgICAgICAgIC8qIGZpcnN0IHN1YmZyYW1lICAqLwotICAgICAgICA1LCAxLCAxLCAxLCAxLCAxMCwgMTAsIDcsIDcsICAgICAgICAgICAgIC8qIHNlY29uZCBzdWJmcmFtZSAqLwotICAgICAgICA4LCAxLCAxLCAxLCAxLCAxMCwgMTAsIDcsIDcsICAgICAgICAgICAgIC8qIHRoaXJkIHN1YmZyYW1lICAqLwotICAgICAgICA1LCAxLCAxLCAxLCAxLCAxMCwgMTAsIDcsIDcsICAgICAgICAgICAgIC8qIGZvdXJ0aCBzdWJmcmFtZSAqLwotICAgIH07Ci0KLSAgICBjb25zdCBXb3JkMTYgYml0bm9fTVIxMjJbUFJNTk9fTVIxMjJdID0KLSAgICB7Ci0gICAgICAgIDcsIDgsIDksIDgsIDYsICAgICAgICAgICAgICAgICAgICAgICAgICAgLyogTFNQIFZRICAgICAgICAgICovCi0gICAgICAgIDksIDQsIDQsIDQsIDQsIDQsIDQsIDMsIDMsIDMsIDMsIDMsIDUsICAgLyogZmlyc3Qgc3ViZnJhbWUgICovCi0gICAgICAgIDYsIDQsIDQsIDQsIDQsIDQsIDQsIDMsIDMsIDMsIDMsIDMsI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ODEsCi0gICAgICAgIDE4MCwgMTg1LCAxODQsIDE4MywgMTg4LCAxODcsIDE4NiwgMjI2LCAyMjUsIDIyNCwKLSAgICAgICAgMjI5LCAyMjgsIDIyNywgMjMyLCAyMzEsIDIzMCwgMjM1LCAyMzQsIDIzMywgMjM4LAotICAgICAgICAyMzcsIDIzNiwgOTYsIDE5OQotICAgIH07Ci0KLSAgICAvKiBvdmVyYWxsIHRhYmxlIHdpdGggYWxsIHBhcmFtZXRlciBzaXplcyBmb3IgYWxsIG1vZGVzICovCi0gICAgY29uc3QgV29yZDE2ICogY29uc3QgcmVvcmRlckJpdHNbTlVNX01PREVTLTFdID0KLSAgICB7Ci0gICAgICAgIHJlb3JkZXJCaXRzX01SNDc1LAotICAgICAgICByZW9yZGVyQml0c19NUjUxNSwKLSAgICAgICAgcmVvcmRlckJpdHNfTVI1OSwKLSAgICAgICAgcmVvcmRlckJpdHNfTVI2NywKLSAgICAgICAgcmVvcmRlckJpdHNfTVI3NCwKLSAgICAgICAgcmVvcmRlckJpdHNfTVI3OTUsCi0gICAgICAgIHJlb3JkZXJCaXRzX01SMTAyLAotICAgICAgICByZW9yZGVyQml0c19NUjEyMgotICAgIH07Ci0KLSAgICAvKiBOdW1iZXIgb2YgRnJhbWVzICgxNi1iaXQgc2VnbWVudHMgc2VudCBmb3IgZWFjaCBtb2RlICovCi0gICAgY29uc3QgV29yZDE2IG51bUNvbXByZXNzZWRCeXRlc1sxNl0gPQotICAgIHsKLSAgICAgICAgMTMsIC8qNC43NSovCi0gICAgICAgIDE0LCAvKjUuMTUqLwotICAgICAgICAxNiwgLyo1LjkwKi8KLSAgICAgICAgMTgsIC8qNi43MCovCi0gICAgICAgIDE5LCAvKjcuNDAqLwotICAgICAgICAyMSwgLyo3Ljk1Ki8KLSAgICAgICAgMjYsIC8qMTAuMiovCi0gICAgICAgIDMxLCAvKjEyLjIqLwotICAgICAgICA2LCAvKkdzbUFtciBjb21mb3J0IG5vaXNlKi8KLSAgICAgICAgNi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qKioqKioqKioqKioqCi1Qb3J0aW9ucyBvZiB0aGlzIGZpbGUgYXJlIGRlcml2ZWQgZnJvbSB0aGUgZm9sbG93aW5nIDNHUFAgc3RhbmRhcmQ6Ci0KLSAgICAzR1BQIFRTIDI2LjA3MwotICAgIEFOU0ktQyBjb2RlIGZvciB0aGUgQWRhcHRpdmUgTXVsdGktUmF0ZSAoQU1SKSBzcGVlY2ggY29kZWMKLSAgICBBdmFpbGFibGUgZnJvbSBodHRwOi8vd3d3LjNncHAub3JnCi0KLShDKSAyMDA0LCAzR1BQIE9yZ2FuaXphdGlvbmFsIFBhcnRuZXJzIChBUklCLCBBVElTLCBDQ1NBLCBFVFNJLCBUVEEsIFRUQykKLVBlcm1pc3Npb24gdG8gZGlzdHJpYnV0ZSwgbW9kaWZ5IGFuZCB1c2UgdGhpcyBmaWxlIHVuZGVyIHRoZSBzdGFuZGFyZCBsaWNlbnNlCi10ZXJtcyBsaXN0ZWQgYWJvdmUgaGFzIGJlZW4gb2J0YWluZWQgZnJvbSB0aGUgY29weXJpZ2h0IGhvbGRlci4KLSoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0vKgotKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKLSoKLSogICAgICBHU00gQU1SLU5CIHNwZWVjaCBjb2RlYyAgIFI5OCAgIFZlcnNpb24gNy41LjAgICBNYXJjaCAyLCAyMDAxCi0qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBSOTkgICBWZXJzaW9uIDMuMi4wCi0qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBSRUwtNCBWZXJzaW9uIDQuMC4wCi0qCi0qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgotKiAgICAgIEZpbGUgICAgICAgICAgICAgOiBjb3B5LmgKLSoKLSoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCi0qLwotCi0vKgotKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKLSogICAgICAgICAgICAgICAgICAgICAgICAgTU9EVUxFIElOQ0xVREUgRklMRSBBTkQgVkVSU0lPTiBJRAotKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKLSovCi0jaW5jbHVkZSAiY29weS5oIgotCi0vKgotKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKLSogICAgICAgICAgICAgICAgICAgICAgICAgSU5DTFVERSBGSUxFUwotKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKLSovCi0jaW5jbHVkZSA8c3RyaW5nLmg+Ci0KLSNpbmNsdWRlICJ0eXBlZGVmLmgiCi0jaW5jbHVkZSAiYmFzaWNfb3AuaCIKLQotLyoKLSoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCi0qICAgICAgICAgICAgICAgICAgICAgICAgIFBVQkxJQyBQUk9HUkFNIENPREUKLSoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCi0qLwotLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKLSAqCi0gKiAgIEZVTkNUSU9OOiAgIENvcHkKLSAqCi0gKiAgIFBVUlBPU0U6ICAgQ29weSB2ZWN0b3IgeFtdIHRvIHlbXQotICoKLSAqCi0gKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLS8qCi0qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgotKgotKiAgRnVuY3Rpb24gICAgOiBDb3B5Ci0qICBQdXJwb3NlICAgICA6IENvcHkgdmVjdG9yIHhbXSB0byB5W10KLSoKLSoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCi0qLwotdm9pZCBDb3B5KAotICAgIGNvbnN0IFdvcmQxNiB4W10sICAgLyogaSA6IGlucHV0IHZlY3RvciAoTCkgICovCi0gICAgV29yZDE2IHlbXSwgICAgICAgICAvKiBvIDogb3V0cHV0IHZlY3RvciAoTCkgKi8KLSAgICBXb3JkMTYgTCAgICAgICAgICAgIC8qIGkgOiB2ZWN0b3IgbGVuZ3RoICAgICAqLwotKQotewotICAgIG1lbW1vdmUoeSwgeCwgTCpzaXplb2YoKngpKTsKLX0KZGlmZiAtLWdpdCBhL21lZGlhL2xpYnN0YWdlZnJpZ2h0L2NvZGVjcy9hbXJuYi9jb21tb24vc3JjL2Rpdl8zMi5jcHAgYi9tZWRpYS9saWJzdGFnZWZyaWdodC9jb2RlY3MvYW1ybmIvY29tbW9uL3NyYy9kaXZfMzIuY3BwCmRlbGV0ZWQgZmlsZSBtb2RlIDEwMDY0NAppbmRleCAxNDNlMzdjLi4wMDAwMDAwCi0tLSBhL21lZGlhL2xpYnN0YWdlZnJpZ2h0L2NvZGVjcy9hbXJuYi9jb21tb24vc3JjL2Rpdl8zMi5jcHAKKysrIC9kZXYvbnVsbApAQC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BXb3JkMzIgTF9udW07Ci0gICAgV29yZDMyIExfZGVub207Ci0gICAgV29yZDE2IGFib3J0X2ZsYWcgPSAwOwotCi0gICAgaWYgKCh2YXIxID4gdmFyMikgfHwgKHZhcjEgPCAwKSkKLSAgICB7Ci0gICAgICAgIHByaW50ZiAoIkRpdmlzaW9uIEVycm9yIHZhcjE9JWQgIHZhcjI9JWRcbiIsIHZhcjEsIHZhcjIpOwotICAgICAgICBhYm9ydF9mbGFnID0gMTsKLSAgICAgICAgZXhpdCgwKTsKLSAgICB9Ci0gICAgaWYgKCh2YXIxICE9IDApICYmIChhYm9ydF9mbGFnID09IDApKQotICAgIHsKLSAgICAgICAgaWYgKHZhcjEgPT0gdmFyMikKLSAgICAgICAgewotICAgICAgICAgICAgdmFyX291dCA9IE1BWF8xNjsKLSAgICAgICAgfQotICAgICAgICBlbHNlCi0gICAgICAgIHsKLSAgICAgICAgICAgIExfbnVtID0gKFdvcmQzMikgdmFyMTsKLSAgICAgICAgICAgIExfZGVub20gPSAoV29yZDMyKSB2YXIyOwotCi0gICAgICAgICAgICBmb3IgKGl0ZXJhdGlvbiA9IDE1OyBpdGVyYXRpb24gPiAwOyBpdGVyYXRpb24tLSkKLSAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICB2YXJfb3V0IDw8PSAxOwotICAgICAgICAgICAgICAgIExfbnVtIDw8PSAxOwotCi0gICAgICAgICAgICAgICAgaWYgKExfbnVtID49IExfZGVub20pCi0gICAgICAgICAgICAgICAgewotICAgICAgICAgICAgICAgICAgICBMX251bSAtPSBMX2Rlbm9tOwotICAgICAgICAgICAgICAgICAgICB2YXJfb3V0ICs9IDE7Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgfQotICAgICAgICB9Ci0gICAgfQotCi0jaWYgKFdNT1BTKQotICAgIG11bHRpQ291bnRlcltjdXJyQ291bnRlcl0uZGl2X3MrKzsKLSNlbmRpZgotICAgIHJldHVybiAodmFyX291dCk7Ci19Ci0KLS0tLS0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tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLQotICAgIDsgRnVuY3Rpb24gYm9keSBoZXJlCi0gICAgLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSovCi0gICAgaWYgKCh2YXIxID4gdmFyMikgfHwgKHZhcjEgPCAwKSkKLSAgICB7Ci0gICAgICAgIHJldHVybiAwOyAvLyB1c2VkIHRvIGV4aXQoMCk7Ci0gICAgfQotICAgIGlmICh2YXIxKQotICAgIHsKLSAgICAgICAgaWYgKHZhcjEgIT0gdmFyMikKLSAgICAgICAgewotCi0gICAgICAgICAgICBMX251bSA9IChXb3JkMzIpIHZhcjE7Ci0gICAgICAgICAgICBMX2Rlbm9tID0gKFdvcmQzMikgdmFyMjsKLSAgICAgICAgICAgIExfZGVub21fYnlfMiA9IChMX2Rlbm9tIDw8IDEpOwotICAgICAgICAgICAgTF9kZW5vbV9ieV80ID0gKExfZGVub20gPDwgMik7Ci0gICAgICAgICAgICBmb3IgKGl0ZXJhdGlvbiA9IDU7IGl0ZXJhdGlvbiA+IDA7IGl0ZXJhdGlvbi0tKQotICAgICAgICAgICAgewotICAgICAgICAgICAgICAgIHZhcl9vdXQgPDw9IDM7Ci0gICAgICAgICAgICAgICAgTF9udW0gICA8PD0gMzsKLQotICAgICAgICAgICAgICAgIGlmIChMX251bSA+PSBMX2Rlbm9tX2J5XzQpCi0gICAgICAgICAgICAgICAgewotICAgICAgICAgICAgICAgICAgICBMX251bSAtPSBMX2Rlbm9tX2J5XzQ7Ci0gICAgICAgICAgICAgICAgICAgIHZhcl9vdXQgfD0gNDsKLSAgICAgICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgICAgICBpZiAoTF9udW0gPj0gTF9kZW5vbV9ieV8yKQotICAgICAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAgICAgTF9udW0gLT0gTF9kZW5vbV9ieV8yOwotICAgICAgICAgICAgICAgICAgICB2YXJfb3V0IHw9ICAyOwotICAgICAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgICAgIGlmIChMX251bSA+PSAoTF9kZW5vbSkpCi0gICAgICAgICAgICAgICAgewotICAgICAgICAgICAgICAgICAgICBMX251bSAtPSAoTF9kZW5vbSk7Ci0gICAgICAgICAgICAgICAgICAgIHZhcl9vdXQgfD0gIDE7Ci0gICAgICAgICAgICAgICAgfQotCi0gICAgICAgICAgICB9Ci0gICAgICAgIH0KLSAgICAgICAgZWxzZQotICAgICAgICB7Ci0gICAgICAgICAgICB2YXJfb3V0ID0gTUFYXzE2OwotICAgICAgICB9Ci0gICAgfQotCi0jaWYgKFdNT1BTKQotICAgIG11bHRpQ291bnRlcltjdXJyQ291bnRlcl0uZGl2X3MrKzsKLSNlbmRpZgotCi0gICAgLyotLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tCi0gICAgOyBSZXR1cm4gbm90aGluZyBvciBkYXRhIG9yIGRhdGEgcG9pbnRlcgotICAgIC0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0qLwotICAgIHJldHVybiAodmFyX291dCk7Ci19CmRpZmYgLS1naXQgYS9tZWRpYS9saWJzdGFnZWZyaWdodC9jb2RlY3MvYW1ybmIvY29tbW9uL3NyYy9leHRyYWN0X2guY3BwIGIvbWVkaWEvbGlic3RhZ2VmcmlnaHQvY29kZWNzL2Ftcm5iL2NvbW1vbi9zcmMvZXh0cmFjdF9oLmNwcApkZWxldGVkIGZpbGUgbW9kZSAxMDA2NDQKaW5kZXggZTUzOGY5Zi4uMDAwMDAw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ICAgICAgICAgICAgICAgICAgICAgICAgICAgY2FsY3VsYXRlcyBmcm9tIGdfZmFjIFt1c2luZyBMb2cyXSkKLSAgICAgICAgICogcXVhX2VuZXIgICAgICAgPSAyMCpsb2cxMChnX2ZhYyk7IChyb3VuZGVkIGZsb2F0aW5nIHBvaW50IHZhbHVlKQotICAgICAgICAgKgotICAgICAgICAgKgotICAgICAgICAgKiBnX2ZhYyAoUTExKSwgcXVhX2VuZXJfTVIxMjIgKFExMCksIHF1YV9lbmVyIChRMTApCi0gICAgICAgICAqLwotICAgICAgICAxNTksICAgICAgICAgICAgICAgIC0zNzc2LCAgICAgICAgICAtMjI3MzEsCi0gICAgICAgIDIwNiwgICAgICAgICAgICAgICAgLTMzOTQsICAgICAgICAgIC0yMDQyOCwKLSAgICAgICAgMjY4LCAgICAgICAgICAgICAgICAtMzAwNSwgICAgICAgICAgLTE4MDg4LAotICAgICAgICAzNDksICAgICAgICAgICAgICAgIC0yNjE1LCAgICAgICAgICAtMTU3MzksCi0gICAgICAgIDQxOSwgICAgICAgICAgICAgICAgLTIzNDUsICAgICAgICAgIC0xNDExMywKLSAgICAgICAgNDgyLCAgICAgICAgICAgICAgICAtMjEzOCwgICAgICAgICAgLTEyODY3LAotICAgICAgICA1NTQsICAgICAgICAgICAgICAgIC0xOTMyLCAgICAgICAgICAtMTE2MjksCi0gICAgICAgIDYzNywgICAgICAgICAgICAgICAgLTE3MjYsICAgICAgICAgIC0xMDM4NywKLSAgICAgICAgNzMzLCAgICAgICAgICAgICAgICAtMTUxOCwgICAgICAgICAgIC05MTM5LAotICAgICAgICA4NDIsICAgICAgICAgICAgICAgIC0xMzE0LCAgICAgICAgICAgLTc5MDYsCi0gICAgICAgIDk2OSwgICAgICAgICAgICAgICAgLTExMDYsICAgICAgICAgICAtNjY1NiwKLSAgICAgICAgMTExNCwgICAgICAgICAgICAgICAgIC05MDAsICAgICAgICAgICAtNTQxNiwKLSAgICAgICAgMTI4MSwgICAgICAgICAgICAgICAgIC02OTQsICAgICAgICAgICAtNDE3MywKLSAgICAgICAgMTQ3MywgICAgICAgICAgICAgICAgIC00ODcsICAgICAgICAgICAtMjkzMSwKLSAgICAgICAgMTY5NCwgICAgICAgICAgICAgICAgIC0yODEsICAgICAgICAgICAtMTY4OCwKLSAgICAgICAgMTk0OCwgICAgICAgICAgICAgICAgICAtNzUsICAgICAgICAgICAgLTQ0NSwKLSAgICAgICAgMjI0MSwgICAgICAgICAgICAgICAgICAxMzMsICAgICAgICAgICAgIDgwMSwKLSAgICAgICAgMjU3NywgICAgICAgICAgICAgICAgICAzMzksICAgICAgICAgICAgMjA0NCwKLSAgICAgICAgMjk2MywgICAgICAgICAgICAgICAgICA1NDUsICAgICAgICAgICAgMzI4NSwKLSAgICAgICAgMzQwOCwgICAgICAgICAgICAgICAgICA3NTIsICAgICAgICAgICAgNDUzMCwKLSAgICAgICAgMzkxOSwgICAgICAgICAgICAgICAgICA5NTgsICAgICAgICAgICAgNTc3MiwKLSAgICAgICAgNDUwNywgICAgICAgICAgICAgICAgIDExNjUsICAgICAgICAgICAgNzAxNiwKLSAgICAgICAgNTE4MywgICAgICAgICAgICAgICAgIDEzNzEsICAgICAgICAgICAgODI1OSwKLSAgICAgICAgNTk2MCwgICAgICAgICAgICAgICAgIDE1NzcsICAgICAgICAgICAgOTUwMSwKLSAgICAgICAgNjg1NSwgICAgICAgICAgICAgICAgIDE3ODQsICAgICAgICAgICAxMDc0NSwKLSAgICAgICAgNzg4MywgICAgICAgICAgICAgICAgIDE5OTEsICAgICAgICAgICAxMTk4OCwKLSAgICAgICAgOTA2NSwgICAgICAgICAgICAgICAgIDIxOTcsICAgICAgICAgICAxMzIzMSwKLSAgICAgICAgMTA0MjUsICAgICAgICAgICAgICAgICAyNDA0LCAgICAgICAgICAgMTQ0NzQsCi0gICAgICAgIDEyNTEwLCAgICAgICAgICAgICAgICAgMjY3MywgICAgICAgICAgIDE2MDk2LAotICAgICAgICAxNjI2MywgICAgICAgICAgICAgICAgIDMwN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SNzk1KQotKQotewotICAgIFdvcmQxNiBpOwotICAgIFdvcmQzMiBlbmVyX2NvZGU7Ci0gICAgV29yZDE2IGV4cCwgZnJhYzsKLQotICAgICAqLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSoKLSAgICAgKiAgZW5lcmd5IG9mIGNvZGU6ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqCi0gICAgICogIH5+fn5+fn5+fn5+fn5+fiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKgotICAgICAqICBlbmVyX2NvZGUgPSBzdW0oY29kZVtpXV4yKSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICoKLSAgICAgKi0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0qCi0gICAgZW5lcl9jb2RlID0gTF9tYWMoKFdvcmQzMikgMCwgY29kZVswXSwgY29kZVswXSk7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gTVIxMjI6ICBRMTIqUTEyIC0+IFEyNQotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vIG90aGVyczogUTEzKlExMyAtPiBRMjcKLSAgICBmb3IgKGkgPSAxOyBpIDwgTF9TVUJGUjsgaSsrKQotICAgICAgICBlbmVyX2NvZGUgPSBMX21hYyhlbmVyX2NvZGUsIGNvZGVbaV0sIGNvZGVbaV0pOwotCi0gICAgaWYgKHN1YiAobW9kZSwgTVIxMjIpID09IDApCi0gICAgewotICAgICAgICBXb3JkMzIgZW5lcjsKLQotICAgICAgICAvLyBlbmVyX2NvZGUgPSBlbmVyX2NvZGUgLyBsY29kZTsgbGNvZGUgPSA0MDsgMS80MCA9IDI2MjE0IFEyMAotICAgICAgICBlbmVyX2NvZGUgPSBMX211bHQgKHB2X3JvdW5kIChlbmVyX2NvZGUpLCAyNjIxNCk7ICAgLy8gUTkgICogUTIwIC0+IFEzMAotCi0gICAgICAgICAqLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSoKLSAgICAgICAgICogIGVuZXJneSBvZiBjb2RlOiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKgotICAgICAgICAgKiAgfn5+fn5+fn5+fn5+fn5+ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqCi0gICAgICAgICAqICBlbmVyX2NvZGUoUTE3KSA9IDEwICogTG9nMTAoZW5lcmd5KSAvIGNvbnN0YW50ICAgICAgICAgICAgICAgICAgICoKLSAgICAgICAgICogICAgICAgICAgICAgICAgID0gMS8yICogTG9nMihlbmVyZ3kpICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKgotICAgICAgICAgKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb25zdGFudCA9IDIwKkxvZzEwKDIpICAqCi0gICAgICAgICAqLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSoKLSAgICAgICAgLy8gZW5lcl9jb2RlID0gMS8yICogTG9nMihlbmVyX2NvZGUpOyBOb3RlOiBMb2cyPWxvZzIrMzAKLSAgICAgICAgTG9nMihlbmVyX2NvZGUsICZleHAsICZmcmFjKTsKLSAgICAgICAgZW5lcl9jb2RlID0gTF9Db21wIChzdWIgKGV4cCwgMzApLCBmcmFjKTsgICAgIC8vIFExNiBmb3IgbG9nKCkKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyAtPlExNyBmb3IgMS8yIGxvZygpCi0KLSAgICAgICAgICotLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tKgotICAgICAgICAgKiAgcHJlZGljdGVkIGVuZXJneTogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqCi0gICAgICAgICAqICB+fn5+fn5+fn5+fn5+fn5+fiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICoKLSAgICAgICAgICogIGVuZXIoUTI0KSA9IChFbWVhbiArIHN1bXtwcmVkW2ldKnBhc3RfZW5baV19KS9jb25zdGFudCAgICAgICAgICAgKgotICAgICAgICAgKiAgICAgICAgICAgID0gTUVBTl9FTkVSICsgc3VtKHByZWRbaV0qcGFzdF9xdWFfZW5baV0pICAgICAgICAgICAgICAqCi0gICAgICAgICAqICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbnN0YW50ID0gMjAqTG9nMTAoMikgICoKLSAgICAgICAgICotLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tKgotCi0gICAgICAgIGVuZXIgPSBNRUFOX0VORVJfTVIxMjI7ICAgICAgICAgICAgICAgICAgICAgIC8vIFEyNCAoUTE3KQotICAgICAgICBmb3IgKGkgPSAwOyBpIDwgTlBSRUQ7IGkrKykKLSAgICAgICAgewotICAgICAgICAgICAgZW5lciA9IExfbWFjIChlbmVyLCBzdC0+cGFzdF9xdWFfZW5fTVIxMjJbaV0sIHByZWRfTVIxMjJbaV0pOwotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyBRMTAgKiBRMTMgLT4gUTI0Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vIFExMCAqIFE2ICAtPiBRMTcKLSAgICAgICAgfQotCi0gICAgICAgICAqLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSoKLSAgICAgICAgICogIHByZWRpY3RlZCBjb2RlYm9vayBnYWluICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKgotICAgICAgICAgKiAgfn5+fn5+fn5+fn5+fn5+fn5+fn5+fn4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqCi0gICAgICAgICAqICBnYzAgICAgID0gUG93MTAoIChlbmVyKmNvbnN0YW50IC0gZW5lcl9jb2RlKmNvbnN0YW50KSAvIDIwICkgICAgICoKLSAgICAgICAgICogICAgICAgICAgPSBQb3cyKGVuZXItZW5lcl9jb2RlKSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKgotICAgICAgICAgKiAgICAgICAgICA9IFBvdzIoaW50KGQpK2ZyYWMoZCkpICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqCi0gICAgICAgICAqICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICoKLSAgICAgICAgICogIChzdG9yZSBleHAgYW5kIGZyYWMgZm9yIHBvdzIoKSkgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKgotICAgICAgICAgKi0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0qCi0KLSAgICAgICAgZW5lciA9IExfc2hyIChMX3N1YiAoZW5lciwgZW5lcl9jb2RlKSwgMSk7ICAgICAgICAgICAgICAgIC8vIFExNgotICAgICAgICBMX0V4dHJhY3QoZW5lciwgZXhwX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oZW5lcl9jb2RlKQotICAgICAgICAgKiAgICAgICAgID0gSyAtIGZhY3QgKiBsb2cyKGVuZXJfY29kZSkgLSBmYWN0KjI3Ci0gICAgICAgICAqCi0gICAgICAgICAqICAgPT0+IEsgPSBtZWFuc19lbmVyICsgZmFjdCoyNyArIDEwbG9nMTAoTF9TVUJGUikKLSAgICAgICAgICoKLSAgICAgICAgICogICBtZWFuc19lbmVyID0gICAgICAgMzMgICAgPSAgNTQwNjcyICAgIFExNCAgKE1SNDc1LCBNUjUxNSwgTVI1OSkKLSAgICAgICAgICogICBtZWFuc19lbmVyID0gICAgICAgMjguNzUgPSAgNDcxMDQwICAgIFExNCAgKE1SNjcpCi0gICAgICAgICAqICAgbWVhbnNfZW5lciA9ICAgICAgIDMwICAgID0gIDQ5MTUyMCAgICBRMTQgIChNUjc0KQotICAgICAgICAgKiAgIG1lYW5zX2VuZXIgPSAgICAgICAzNiAgICA9ICA1ODk4MjQgICAgUTE0ICAoTVI3OTUpCi0gICAgICAgICAqICAgbWVhbnNfZW5lciA9ICAgICAgIDMzICAgID0gIDU0MDY3MiAgICBRMTQgIChNUjEwMikKLSAgICAgICAgICogICAxMGxvZzEwKExfU1VCRlIpID0gMTYuMDIgPSAgMjYyNDgxLjUxIFExNAotICAgICAgICAgKiAgIGZhY3QgKiAyNyAgICAgICAgICAgICAgICA9IDEzMzE2NDAgICAgUTE0Ci0gICAgICAgICAqICAgLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0KLSAgICAgICAgICogICAoTVI0NzUsIE1SNTE1LCBNUjU5KSAgIEsgPSAyMTM0NzkzLjUxIFExNCB+PSAxNjY3OCAqIDY0ICogMgotICAgICAgICAgKiAgIChNUjY3KSAgICAgICAgICAgICAgICAgSyA9IDIwNjUxNjEuNTEgUTE0IH49IDMyMjY4ICogMzIgKiAyCi0gICAgICAgICAqICAgKE1SNzQpICAgICAgICAgICAgICAgICBLID0gMjA4NTY0MS41MSBRMTQgfj0gMzI1ODggKiAzMiAqIDIKLSAgICAgICAgICogICAoTVI3OTUpICAgICAgICAgICAgICAgIEsgPSAyMTgzOTQ1LjUxIFExNCB+PSAxNzA2MiAqIDY0ICogMgotICAgICAgICAgKiAgIChNUjEwMikgICAgICAgICAgICAgICAgSyA9IDIxMzQ3OTMuNTEgUTE0IH49IDE2Njc4ICogNjQgKiAyCi0KLQotICAgICAgICBpZiAoc3ViIChtb2RlLCBNUjEwMikgPT0gMCkKLSAgICAgICAgewotICAgICAgICAgICAgLy8gbWVhbiA9IDMzIGRCCi0gICAgICAgICAgICBMX3RtcCA9IExfbWFjKExfdG1wLCAxNjY3OCwgNjQpOyAgICAgLy8gUTE0Ci0gICAgICAgIH0KLSAgICAgICAgZWxzZSBpZiAoc3ViIChtb2RlLCBNUjc5NSkgPT0gMCkKLSAgICAgICAgewotICAgICAgICAgICAgLy8gZW5lcl9jb2RlICA9IDx4biB4bj4gKiAyXjI3KjJeZXhwX2NvZGUKLSAgICAgICAgICAgIC8vIGZyYWNfZW4gICAgPSBlbmVyX2NvZGUgLyAyXjE2Ci0gICAgICAgICAgICAvLyAgICAgICAgICAgID0gPHhuIHhuPiAqIDJeMTEqMl5leHBfY29kZQotICAgICAgICAgICAgLy8gPHhuIHhuPiAgICA9IDx4biB4bj4qMl4xMSoyXmV4cCAqIDJeZXhwX2VuCi0gICAgICAgICAgICAvLyAgICAgICAgICAgOj0gZnJhY19lbiAgICAgICAgICAgICogMl5leHBfZW4KLQotICAgICAgICAgICAgLy8gPT0+IGV4cF9lbiA9IC0xMS1leHBfY29kZTsKLQotICAgICAgICAgICAgKmZyYWNfZW4gPSBleHRyYWN0X2ggKGVuZXJfY29kZSk7Ci0gICAgICAgICAgICAqZXhwX2VuID0gc3ViICgtMTEsIGV4cF9jb2RlKTsKLQotICAgICAgICAgICAgLy8gbWVhbiA9IDM2IGRCCi0gICAgICAgICAgICBMX3RtcCA9IExfbWFjKExfdG1wLCAxNzA2MiwgNjQpOyAgICAgLy8gUTE0Ci0gICAgICAgIH0KLSAgICAgICAgZWxzZSBpZiAoc3ViIChtb2RlLCBNUjc0KSA9PSAwKQotICAgICAgICB7Ci0gICAgICAgICAgICAvLyBtZWFuID0gMzAgZEIKLSAgICAgICAgICAgIExfdG1wID0gTF9tYWMoTF90bXAsIDMyNTg4LCAzMik7ICAgICAvLyBRMTQKLSAgICAgICAgfQotICAgICAgICBlbHNlIGlmIChzdWIgKG1vZGUsIE1SNjcpID09IDApCi0gICAgICAgIHsKLSAgICAgICAgICAgIC8vIG1lYW4gPSAyOC43NSBkQgotICAgICAgICAgICAgTF90bXAgPSBMX21hYyhMX3RtcCwgMzIyNjgsIDMyKTsgICAgIC8vIFExNAotICAgICAgICB9Ci0gICAgICAgIGVsc2UgLy8gTVI1OSwgTVI1MTUsIE1SNDc1Ci0gICAgICAgIHsKLSAgICAgICAgICAgIC8vIG1lYW4gPSAzMyBkQgotICAgICAgICAgICAgTF90bXAgPSBMX21hYyhMX3RtcCwgMTY2NzgsIDY0KTsgICAgIC8vIFExNAotICAgICAgICB9Ci0KLSAgICAgICAgICotLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSoKLSAgICAgICAgICogQ29tcHV0ZSBnY29kZTAuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICoKLSAgICAgICAgICogID0gU3VtKGk9MCwzKSBwcmVkW2ldKnBhc3RfcXVhX2VuW2ldIC0gZW5lcl9jb2RlICsgbWVhbl9lbmVyICAgICoKLSAgICAgICAgICotLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSoKLQotICAgICAgICBMX3RtcCA9IExfc2hsKExfdG1wLCAxMCk7ICAgICAgICAgICAgICAgIC8vIFEyNAotICAgICAgICBmb3IgKGkgPSAwOyBpIDwgNDsgaSsrKQotICAgICAgICAgICAgTF90bXAgPSBMX21hYyhMX3RtcCwgcHJlZFtpXSwgc3QtPnBhc3RfcXVhX2VuW2ldKTsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyBRMTMgKiBRMTAgLT4gUTI0Ci0KLSAgICAgICAgZ2NvZGUwID0gZXh0cmFjdF9oKExfdG1wKTsgICAgICAgICAgICAgICAvLyBROAotCi0gICAgICAgICAqLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0qCi0gICAgICAgICAqIGdjb2RlMCA9IHBvdygxMC4wLCBnY29kZTAvMjApICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqCi0gICAgICAgICAqICAgICAgICA9IHBvdygyLCAzLjMyMTkqZ2NvZGUwLzIwKSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqCi0gICAgICAgICAqICAgICAgICA9IHBvdygyLCAwLjE2NipnY29kZTApICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqCi0gICAgICAgICAqLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0qCi0KLSAgICAgICAgLy8gNTQzOSBRMTUgPSAwLjE2NTk4NQotICAgICAgICAvLyAoY29ycmVjdDogMS8oMjAqbG9nMTAoMikpIDAuMTY2MDk2ID0gNTQ0MyBRMTUpCi0gICAgICAgIGlmIChzdWIgKG1vZGUsIE1SNzQpID09IDApIC8vIEZvciBJUzY0MSBiaXRleGFjdG5lc3MKLSAgICAgICAgICAgIExfdG1wID0gTF9tdWx0KGdjb2RlMCwgNTQzOSk7ICAvLyBROCAqIFExNSAtPiBRMjQKLSAgICAgICAgZWxzZQotICAgICAgICAgICAgTF90bXAgPSBMX211bHQoZ2N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5+fn5+ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqCi0gICAgICAgICAqICBlbmVyX2NvZGUoUTE3KSA9IDEwICogTG9nMTAoZW5lcmd5KSAvIGNvbnN0YW50ICAgICAgICAgICAgICoKLSAgICAgICAgICogICAgICAgICAgICAgICAgID0gMS8yICogTG9nMihlbmVyZ3kpICAgICAgICAgICAgICAgICAgICAgICAgKgotICAgICAgICAgKiAgY29uc3RhbnQgPSAyMCpMb2cxMCgyKSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqCi0gICAgICAgICAqLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSovCi0gICAgICAgIC8qIGVuZXJfY29kZSA9IDEvMiAqIExvZzIoZW5lcl9jb2RlKTsgTm90ZTogTG9nMj1sb2cyKzMwICovCi0gICAgICAgIExvZzIoZW5lcl9jb2RlLCAmZXhwLCAmZnJhYywgcE92ZXJmbG93KTsKLQotICAgICAgICAvKiBRMTYgZm9yIGxvZygpICAgICovCi0gICAgICAgIC8qIC0+UTE3IGZvciAxLzIgbG9nKCkqLwotCi0gICAgICAgIExfdGVtcDEgPSAoV29yZDMyKShleHAgLSAzMCkgPDwgMTY7Ci0gICAgICAgIGVuZXJfY29kZSA9IExfdGVtcDEgKyAoKFdvcmQzMilmcmFjIDw8IDEpOwotCi0gICAgICAgIC8qLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSoKLSAgICAgICAgICogIHByZWRpY3RlZCBlbmVyZ3k6ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKgotICAgICAgICAgKiAgfn5+fn5+fn5+fn5+fn5+fn4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqCi0gICAgICAgICAqICBlbmVyKFEyNCkgPSAoRW1lYW4gKyBzdW17cHJlZFtpXSpwYXN0X2VuW2ldfSkvY29uc3RhbnQgICAgICoKLSAgICAgICAgICogICAgICAgICAgICA9IE1FQU5fRU5FUiArIHN1bShwcmVkW2ldKnBhc3RfcXVhX2VuW2ldKSAgICAgICAgKgotICAgICAgICAgKiAgY29uc3RhbnQgPSAyMCpMb2cxMCgyKSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqCi0gICAgICAgICAqLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSovCi0KLSAgICAgICAgZW5lciA9IE1FQU5fRU5FUl9NUjEyMjsgICAgICAgICAgICAgICAgICAgLyogUTI0IChRMTcpICovCi0gICAgICAgIGZvciAoaSA9IDA7IGkgPCBOUFJFRDsgaSsrKQotICAgICAgICB7Ci0gICAgICAgICAgICBMX3RlbXAxID0gKCgoV29yZDMyKSBzdC0+cGFzdF9xdWFfZW5fTVIxMjJbaV0pICoKLSAgICAgICAgICAgICAgICAgICAgICAgcHJlZF9NUjEyMltpXSkgPDwgMTsKLSAgICAgICAgICAgIGVuZXIgPSBMX2FkZChlbmVyLCBMX3RlbXAxLCBwT3ZlcmZsb3cpOwotCi0gICAgICAgICAgICAvKiBRMTAgKiBRMTMgLT4gUTI0ICovCi0gICAgICAgICAgICAvKiBRMTAgKiBRNiAgLT4gUTE3ICovCi0gICAgICAgIH0KLQotICAgICAgICAvKi0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSoKLSAgICAgICAgICogIHByZWRpY3RlZCBjb2RlYm9vayBnYWluICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqCi0gICAgICAgICAqICB+fn5+fn5+fn5+fn5+fn5+fn5+fn5+fiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKgotICAgICAgICAgKiAgZ2MwICAgICA9IFBvdzEwKCAoZW5lcipjb25zdGFudCAtIGVuZXJfY29kZSpjb25zdGFudCkgLyAyMCApICoKLSAgICAgICAgICogICAgICAgICAgPSBQb3cyKGVuZXItZW5lcl9jb2RlKSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqCi0gICAgICAgICAqICAgICAgICAgID0gUG93MihpbnQoZCkrZnJhYyhkKSkgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKgotICAgICAgICAgKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICoKLSAgICAgICAgICogIChzdG9yZSBleHAgYW5kIGZyYWMgZm9yIHBvdzIoKSkgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqCi0gICAgICAgICAqLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tKi8KLSAgICAgICAgLyogUTE2ICovCi0KLSAgICAgICAgTF90ZW1wMSA9IExfc3ViKGVuZXIsIGVuZXJfY29kZSwgcE92ZXJmbG93KTsKLQotCi0gICAgICAgICpleHBfZ2NvZGUwID0gKFdvcmQxNikoTF90ZW1wMSA+PiAxNyk7Ci0KLSAgICAgICAgTF90ZW1wMiA9IChXb3JkMzIpICogZXhwX2djb2RlMCA8PCAxNTsKLSAgICAgICAgTF90ZW1wMSA+Pj0gMjsKLQotICAgICAgICAqZnJhY19nY29kZTAgPSAoV29yZDE2KShMX3RlbXAxIC0gTF90ZW1wMik7Ci0KLSAgICB9Ci0gICAgZWxzZSAvKiBhbGwgbW9kZXMgZXhjZXB0IDEyLjIgKi8KLSAgICB7Ci0gICAgICAgIC8qLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0qCi0gICAgICAgICAq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TVUJGUikKLSAgICAgICAgICogICAgICAgICA9IG1lYW5zX2VuZXIgLSAxMGxvZzEwKGVuZXJfY29kZSkgKyAxMGxvZzEwKExfU1VCRlIpCi0gICAgICAgICAqICAgICAgICAgPSBLIC0gZmFjdCAqIExvZzIoZW5lcl9jb2RlKQotICAgICAgICAgKiAgICAgICAgID0gSyAtIGZhY3QgKiBsb2cyKGVuZXJfY29kZSkgLSBmYWN0KjI3Ci0gICAgICAgICAqCi0gICAgICAgICAqICAgPT0+IEsgPSBtZWFuc19lbmVyICsgZmFjdCoyNyArIDEwbG9nMTAoTF9TVUJGUikKLSAgICAgICAgICoKLSAgICAgICAgICogICBtZWFuc19lbmVyID0gICAgICAgMzMgICAgPSAgNTQwNjcyICAgIFExNCAgKE1SNDc1LCBNUjUxNSwgTVI1OSkKLSAgICAgICAgICogICBtZWFuc19lbmVyID0gICAgICAgMjguNzUgPSAgNDcxMDQwICAgIFExNCAgKE1SNjcpCi0gICAgICAgICAqICAgbWVhbnNfZW5lciA9ICAgICAgIDMwICAgID0gIDQ5MTUyMCAgICBRMTQgIChNUjc0KQotICAgICAgICAgKiAgIG1lYW5zX2VuZXIgPSAgICAgICAzNiAgICA9ICA1ODk4MjQgICAgUTE0ICAoTVI3OTUpCi0gICAgICAgICAqICAgbWVhbnNfZW5lciA9ICAgICAgIDMzICAgID0gIDU0MDY3MiAgICBRMTQgIChNUjEwMikKLSAgICAgICAgICogICAxMGxvZzEwKExfU1VCRlIpID0gMTYuMDIgPSAgMjYyNDgxLjUxIFExNAotICAgICAgICAgKiAgIGZhY3QgKiAyNyAgICAgICAgICAgICAgICA9IDEzMzE2NDAgICAgUTE0Ci0gICAgICAgICAqICAgLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0KLSAgICAgICAgICogICAoTVI0NzUsIE1SNTE1LCBNUjU5KSAgIEsgPSAyMTM0NzkzLjUxIFExNCB+PSAxNjY3OCAqIDY0ICogMgotICAgICAgICAgKiAgIChNUjY3KSAgICAgICAgICAgICAgICAgSyA9IDIwNjUxNjEuNTEgUTE0IH49IDMyMjY4ICogMzIgKiAyCi0gICAgICAgICAqICAgKE1SNzQpICAgICAgICAgICAgICAgICBLID0gMjA4NTY0MS41MSBRMTQgfj0gMzI1ODggKiAzMiAqIDIKLSAgICAgICAgICogICAoTVI3OTUpICAgICAgICAgICAgICAgIEsgPSAyMTgzOTQ1LjUxIFExNCB+PSAxNzA2MiAqIDY0ICogMgotICAgICAgICAgKiAgIChNUjEwMikgICAgICAgICAgICAgICAgSyA9IDIxMzQ3OTMuNTEgUTE0IH49IDE2Njc4ICogNjQgKiAyCi0gICAgICAgICAqLwotCi0gICAgICAgIGlmIChtb2RlID09IE1SMTAyKQotICAgICAgICB7Ci0gICAgICAgICAgICAvKiBtZWFuID0gMzMgZEIgKi8KLSAgICAgICAgICAgIExfdGVtcDIgPSAoV29yZDMyKSAxNjY3OCA8PCA3OwotICAgICAgICAgICAgTF90bXAgPSBMX2FkZChMX3RtcCwgTF90ZW1wMiwgcE92ZXJmbG93KTsgICAgIC8qIFExNCAqLwotICAgICAgICB9Ci0gICAgICAgIGVsc2UgaWYgKG1vZGUgPT0gTVI3OTUpCi0gICAgICAgIHsKLSAgICAgICAgICAgIC8qIGVuZXJfY29kZSAgPSA8eG4geG4+ICogMl4yNyoyXmV4cF9jb2RlCi0gICAgICAgICAgICAgICBmcmFjX2VuICAgID0gZW5lcl9jb2RlIC8gMl4xNgotICAgICAgICAgICAgICAgICAgICAgICAgICA9IDx4biB4bj4gKiAyXjExKjJeZXhwX2NvZGUKLSAgICAgICAgICAgICAgIDx4biB4bj4gICAgPSA8eG4geG4+KjJeMTEqMl5leHAgKiAyXmV4cF9lbgotICAgICAgICAgICAgOiAgICAgICAgICAgICAgICAgPSBmcmFjX2VuICAgICAgICAgICAgKiAyXmV4cF9lbgotICAgICAgICAgICAgICAgICAgICAgICAgICA9PT4gZXhwX2VuID0gLTExLWV4cF9jb2RlOyAgICAgICovCi0gICAgICAgICAgICAqZnJhY19lbiA9IChXb3JkMTYpKGVuZXJfY29kZSA+PiAxNik7Ci0gICAgICAgICAgICAqZXhwX2VuID0gc3ViKC0xMSwgZXhwX2NvZGUsIHBPdmVyZmxvdyk7Ci0KLSAgICAgICAgICAgIC8qIG1lYW4gPSAzNiBkQiAqLwotICAgICAgICAgICAgTF90ZW1wMiA9IChXb3JkMzIpIDE3MDYyIDw8IDc7Ci0gICAgICAgICAgICBMX3RtcCA9IExfYWRkKExfdG1wLCBMX3RlbXAyLCBwT3ZlcmZsb3cpOyAgICAgLyogUTE0ICovCi0gICAgICAgIH0KLSAgICAgICAgZWxzZSBpZiAobW9kZSA9PSBNUjc0KQotICAgICAgICB7Ci0gICAgICAgICAgICAvKiBtZWFuID0gMzAgZEIgKi8KLSAgICAgICAgICAgIExfdGVtcDIgPSAoV29yZDMyKSAzMjU4OCA8PCA2OwotICAgICAgICAgICAgTF90bXAgPSBMX2FkZChMX3RtcCwgTF90ZW1wMiwgcE92ZXJmbG93KTsgICAgIC8qIFExNCAqLwotICAgICAgICB9Ci0gICAgICAgIGVsc2UgaWYgKG1vZGUgPT0gTVI2NykKLSAgICAgICAgewotICAgICAgICAgICAgLyogbWVhbiA9IDI4Ljc1IGRCICovCi0gICAgICAgICAgICBMX3RlbXAyID0gKFdvcmQzMikgMzIyNjggPDwgNjsKLSAgICAgICAgICAgIExfdG1wID0gTF9hZGQoTF90bXAsIExfdGVtcDIsIHBPdmVyZmxvdyk7ICAgICAvKiBRMTQgKi8KLSAgICAgICAgfQotICAgICAgICBlbHNlIC8qIE1SNTksIE1SNTE1LCBNUjQ3NSAqLwotICAgICAgICB7Ci0gICAgICAgICAgICAvKiBtZWFuID0gMzMgZEIgKi8KLSAgICAgICAgICAgIExfdGVtcDIgPSAoV29yZDMyKSAxNjY3OCA8PCA3OwotICAgICAgICAgICAgTF90bXAgPSBMX2FkZChMX3RtcCwgTF90ZW1wMiwgcE92ZXJmbG93KTsgICAgIC8qIFExNCAqLwotICAgICAgICB9Ci0KLSAgICAgICAgLyotLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tKgotICAgICAgICAgKiBDb21wdXRlIGdjb2RlMC4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKgotICAgICAgICAgKiAgPSBTdW0oaT0wLDMpIHByZWRbaV0qcGFzdF9xdWFfZW5baV0gLSBlbmVyX2NvZGUgKyBtZWFuX2VuZXIgKgotICAgICAgICAgKi0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tKi8KLSAgICAgICAgLyogUTI0ICovCi0gICAgICAgIGlmIChMX3RtcCA+IChXb3JkMzIpIDBYMDAxZmZmZmZMKQotICAgICAgICB7Ci0gICAgICAgICAgICAqcE92ZXJmbG93ID0gMTsKLSAgICAgICAgICAgIExfdG1wID0gTUFYXzMyOwotICAgICAgICB9Ci0gICAgICAgIGVsc2UgaWYgKExfdG1wIDwgKFdvcmQzMikgMHhmZmUwMDAwMEwpCi0gICAgICAgIHsKLSAgICAgICAgICAgICpwT3ZlcmZsb3cgPSAxOwotICAgICAgICAgICAgTF90bXAgPSBNSU5fMzI7Ci0gICAgICAgIH0KLSAgICAgICAgZWxzZQotICAgICAgICB7Ci0gICAgICAgICAgICBMX3RtcCA9IExfdG1wIDw8IDEwOwotICAgICAgICB9Ci0KLSAgICAgICAgZm9yIChpID0gMDsgaSA8IDQ7IGkrKykKLSAgICAgICAgewotICAgICAgICAgICAgTF90ZW1wMiA9ICgoKChXb3JkMzIpIHByZWRbaV0pICogc3QtPnBhc3RfcXVhX2VuW2ldKSA8PCAxKTsKLSAgICAgICAgICAgIExfdG1wID0gTF9hZGQoTF90bXAsIExfdGVtcDIsIHBPdmVyZmxvdyk7ICAvKiBRMTMgKiBRMTAgLT4gUTI0ICovCi0gICAgICAgIH0KLQotICAgICAgICBnY29kZTAgPSAoV29yZDE2KShMX3RtcCA+PiAxNik7ICAgICAgICAgICAgICAgLyogUTggICovCi0KLSAgICAgICAgLyotLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSoKLSAgICAgICAgICogZ2NvZGUwID0gcG93KDEwLjAsIGdjb2RlMC8yMCkgICAgICAgICAgICAgICAgICAgICAgICAgICAgICoKLSAgICAgICAgICogICAgICAgID0gcG93KDIsIDMuMzIxOSpnY29kZTAvMjApICAgICAgICAgICAgICAgICAgICAgICAgICoKLSAgICAgICAgICogICAgICAgID0gcG93KDIsIDAuMTY2Kmdjb2RlMCkgICAgICAgICAgICAgICAgICAgICAgICAgICAgICoKLSAgICAgICAgICotLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSovCi0KLSAgICAgICAgLyogNTQzOSBRMTUgPSAwLjE2NTk4NSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0gICAgICAgIC8qIChjb3JyZWN0OiAxLygyMCpsb2cxMCgyKSkgMC4xNjYwOTYgPSA1NDQzIFExNSkgICAgICAgICAgICAqLwotCi0gICAgICAgIGlmIChtb2RlID09IE1SNzQpIC8qIEZvciBJUzY0MSBiaXRleGFjdG5lc3MgKi8KLSAgICAgICAgewotICAgICAgICAgICAgTF90bXAgPSAoKChXb3JkMzIpIGdjb2RlMCkgKiA1NDM5KSA8PCAxOyAgLyogUTggKiBRMTUgLT4gUTI0ICovCi0gICAgICAgIH0KLSAgICAgICAgZWxzZQotICAgICAgICB7Ci0gICAgICAgICAgICBMX3RtcCA9ICgoKFdvcmQzMikgZ2NvZGUwKSAqIDU0NDMpIDw8IDE7ICAvKiBROCAqIFExNSAtPiBRMjQgKi8KLSAgICAgICAgfQotCi0gICAgICAgIGlmIChMX3RtcCA8IDApCi0gICAgICAgIHsKLSAgICAgICAgICAgIExfdG1wID0gfigofkxfdG1wKSA+PiA4KTsKLSAgICAgICAgfQotICAgICAgICBlbHNlCi0gICAgICAgIHsKLSAgICAgICAgICAgIExfdG1wID0gTF90bXAgPj4gODsgICAgIC8qIC0+IFExNiAqLwotICAgICAgICB9Ci0KLSAgICAgICAgKmV4cF9nY29kZTAgPSAoV29yZDE2KShMX3RtcCA+PiAxNik7Ci0gICAgICAgIGlmIChMX3RtcCA8IDApCi0gICAgICAgIHsKLSAgICAgICAgICAgIExfdGVtcDEgPSB+KCh+TF90bXApID4+IDEpOwotICAgICAgICB9Ci0gICAgICAgIGVsc2UKLSAgICAgICAgewotICAgICAgICAgICAgTF90ZW1wMSA9IExfdG1wID4+IDE7Ci0gICAgICAgIH0KLSAgICAgICAgTF90ZW1wMiA9IChXb3JkMzIpICogZXhwX2djb2RlMCA8PCAxNTsKLSAgICAgICAgKmZyYWNfZ2NvZGUwID0gKFdvcmQxNikoTF9zdWIoTF90ZW1wMSwgTF90ZW1wMiwgcE92ZXJmbG93KSk7Ci0gICAgICAgIC8qIC0+IFEwLlExNSAqLwotICAgIH0KLQotICAgIHJldHVybjsKLX0KLQotLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0KLS8qCi0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0KLSBGVU5DVElPTiBOQU1FOiBnY19wcmVkX3VwZGF0ZQotLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tCi0gSU5QVVQgQU5EIE9VVFBVVCBERUZJTklUSU9OUwotCi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S0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tCi0gQ0FVVElPTiBbb3B0aW9uYWxdCi0gW1N0YXRlIGFueSBzcGVjaWFsIG5vdGVzLCBjb25zdHJhaW50cyBvciBjYXV0aW9ucyBmb3IgdXNlcnMgb2YgdGhpcyBmdW5jdGlvbl0KLQotLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tCi0qLwotCi12b2lkIEludF9scGNfMWFuZDMoCi0gICAgV29yZDE2IGxzcF9vbGRbXSwgIC8qIGkgOiBMU1AgdmVjdG9yIGF0IHRoZSA0dGggc3ViZnIuIG9mIHBhc3QgZnJhbWUgKE0pICovCi0gICAgV29yZDE2IGxzcF9taWRbXSwgIC8qIGkgOiBMU1AgdmVjdG9yIGF0IHRoZSAybmQgc3ViZnIuIG9mCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwcmVzZW50IGZyYW1lIChNKSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0gICAgV29yZDE2IGxzcF9uZXdbXSwgIC8qIGkgOiBMU1AgdmVjdG9yIGF0IHRoZSA0dGggc3ViZnIuIG9mCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwcmVzZW50IGZyYW1lIChNKSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0gICAgV29yZDE2IEF6W10sICAgICAgIC8qIG8gOiBpbnRlcnBvbGF0ZWQgTFAgcGFyYW1ldGVycyBpbiBhbGwgc3ViZnIuCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoQVpfU0laRSkgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0gICAgRmxhZyAgKnBPdmVyZmxvdwotKQotewotICAgIFdvcmQxNiBpOwotICAgIFdvcmQxNiBsc3BbTV07Ci0gICAgV29yZDE2ICpwX2xzcF9vb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mWzFdIC0gMCAgKi8KLSAgICAqKHBfd2YrKykgPSAqKHBfbHNmXzIrKyk7Ci0KLSAgICBmb3IgKGkgPSA0OyBpICE9IDAgOyBpLS0pCi0gICAgewotICAgICAgICAqKHBfd2YrKykgPSAqKHBfbHNmXzIrKykgLSAqKHBfbHNmKyspOwotICAgICAgICAqKHBfd2YrKykgPSAqKHBfbHNmXzIrKykgLSAqKHBfbHNmKyspOwotICAgIH0KLSAgICAvKgotICAgICAqICB3Zls5XSA9IDQwMDAgLSBsc2ZbOF0KLSAgICAgKi8KLSAgICAqKHBfd2YpID0gMTYzODQgLSAqKHBfbHNmKTsKLQotICAgIHBfd2YgPSB3ZjsKLQotICAgIGZvciAoaSA9IDEwOyBpICE9IDA7IGktLSkKLSAgICB7Ci0gICAgICAgIC8qCi0gICAgICAgICAqICAod2ZbaV0gLSA0NTApOwotICAgICAgICAgKiAgMTg0MyA9PSA0NTAgSHogKFExNSBjb25zaWRlcmluZyA3RkZGID0gODAwMCBIeikKLSAgICAgICAgICovCi0gICAgICAgIHdndF9mY3QgPSAqcF93ZjsKLSAgICAgICAgdGVtcCA9ICB3Z3RfZmN0IC0gMTg0MzsKLQotICAgICAgICBpZiAodGVtcCA+IDApCi0gICAgICAgIHsKLSAgICAgICAgICAgIHRlbXAgPSAoV29yZDE2KSgoKFdvcmQzMil0ZW1wICogNjI0MikgPj4gMTUpOwotICAgICAgICAgICAgd2d0X2ZjdCA9IDE4NDMgLSB0ZW1wOwotICAgICAgICB9Ci0gICAgICAgIGVsc2UKLSAgICAgICAgewotICAgICAgICAgICAgdGVtcCA9IChXb3JkMTYpKCgoV29yZDMyKXdndF9mY3QgKiAyODE2MCkgPj4gMTUpOwotICAgICAgICAgICAgd2d0X2ZjdCA9IDM0MjcgLSB0ZW1wOwotICAgICAgICB9Ci0KLSAgICAgICAgKihwX3dmKyspID0gd2d0X2ZjdCA8PCAzOwotCi0gICAgfSAvKiBmb3IgKGkgPSAxMDsgaSAhPSAwOyBpLS0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haW50cyBvciBjYXV0aW9ucyBmb3IgdXNlcnMgb2YgdGhpcyBmdW5jdGlvbl0KLQotLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tCi0qLwotdm9pZCBsc3AobHNwU3RhdGUgKnN0LCAgICAgICAvKiBpL28gOiBTdGF0ZSBzdHJ1Y3QgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLSAgICAgICAgIGVudW0gTW9kZSByZXFfbW9kZSwgLyogaSAgIDogcmVxdWVzdGVkIGNvZGVyIG1vZGUgICAgICAgICAgICAgICAgICAgICovCi0gICAgICAgICBlbnVtIE1vZGUgdXNlZF9tb2RlLC8qIGkgICA6IHVzZWQgY29kZXIgbW9kZSAgICAgICAgICAgICAgICAgICAgICAgICAqLwotICAgICAgICAgV29yZDE2IGF6W10sICAgICAgICAvKiBpL28gOiBpbnRlcnBvbGF0ZWQgTFAgcGFyYW1ldGVycyBRMTIgICAgICAgICAgKi8KLSAgICAgICAgIFdvcmQxNiBhelFbXSwgICAgICAgLyogbyAgIDogcXVhbnRpemF0aW9uIGludGVycG9sLiBMUCBwYXJhbWV0ZXJzIFExMiovCi0gICAgICAgICBXb3JkMTYgbHNwX25ld1tdLCAgIC8qIG8gICA6IG5ldyBsc3AgdmVjdG9yICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotICAgICAgICAgV29yZDE2ICoqYW5hcCwgICAgICAvKiBvICAgOiBhbmFseXNpcyBwYXJhbWV0ZXJzICAgICAgICAgICAgICAgICAgICAgKi8KLSAgICAgICAgIEZsYWcgICAqcE92ZXJmbG93KSAgLyogbyAgIDogRmxhZyBzZXQgd2hlbiBvdmVyZmxvdyBvY2N1cnMgICAgICAgICAgICovCi0KLXsKLSAgICBXb3JkMTYgbHNwX25ld19xW01dOyAgICAvKiBMU1BzIGF0IDR0aCBzdWJmcmFtZSAgICAgICAg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LCBsc3BfbWlkLCBsc3BfbmV3LCBheiwgcE92ZXJmbG93KTsKLQotICAgICAgICBpZiAodXNlZF9tb2RlICE9IE1SRFRYKQotICAgICAgICB7Ci0gICAgICAgICAgICAvKiBMU1AgcXVhbnRpemF0aW9uIChsc3BfbWlkW10gYW5kIGxzcF9uZXdbXSBqb2ludGx5IHF1YW50aXplZCkgKi8KLSAgICAgICAgICAgIFFfcGxzZl81KAotICAgICAgICAgICAgICAgIHN0LT5xU3QsCi0gICAgICAgICAgICAgICAgbHNwX21pZCwKLSAgICAgICAgICAgICAgICBsc3BfbmV3LAotICAgICAgICAgICAgICAgIGxzcF9taWRfcSwKLSAgICAgICAgICAgICAgICBsc3BfbmV3X3EsCi0gICAgICAgICAgICAgICAgKmFuYXAsCi0gICAgICAgICAgICAgICAgcE92ZXJmbG93KTsKLQotICAgICAgICAgICAgSW50X2xwY18xYW5kMyhzdC0+bHNwX29sZF9xLCBsc3BfbWlkX3EsIGxzcF9uZXdfcSwgYXpRLCBwT3ZlcmZsb3cpOwotCi0gICAgICAgICAgICAvKiBBZHZhbmNlIGFuYWx5c2lzIHBhcmFtZXRlcnMgcG9pbnRlciAqLwotICAgICAgICAgICAgKCphbmFwKSArPSA1OwotICAgICAgICB9Ci0gICAgfQotICAgIGVsc2UKLSAgICB7Ci0gICAgICAgIEF6X2xzcCgmYXpbTVAxICogM10sIGxzcF9uZXcsIHN0LT5sc3Bfb2xkLCBwT3ZlcmZsb3cpOyAgLyogRnJvbSBBKHopIHRvIGxzcCAgKi8KLQotICAgICAgICAvKi0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tKgotICAgICAgICAgKiBGaW5kIGludGVycG9sYXRlZCBMUEMgcGFyYW1ldGVycyBpbiBhbGwgc3ViZnJhbWVzIChib3RoIHF1YW50aXplZCAgKgotICAgICAgICAgKiBhbmQgdW5xdWFudGl6ZWQpLiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKgotICAgICAgICAgKiBUaGUgaW50ZXJwb2xhdGVkIHBhcmFtZXRlcnMgYXJlIGluIGFycmF5IEFfdFtdIG9mIHNpemUgKE0rMSkqNCAgICAgKgotICAgICAgICAgKiBhbmQgdGhlIHF1YW50aXplZCBpbnRlcnBvbGF0ZWQgcGFyYW1ldGVycyBhcmUgaW4gYXJyYXkgQXFfdFtdICAgICAgKgotICAgICAgICAgKi0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tKi8KLQotICAgICAgICBJbnRfbHBjXzF0bzNfMihzdC0+bHNwX29sZCwgbHNwX25ldywgYXosIHBPdmVyZmxvdyk7Ci0KLSAgICAgICAgaWYgKHVzZWRfbW9kZSAhPSBNUkRUWCkKLSAgICAgICAgewotICAgICAgICAgICAgLyogTFNQIHF1YW50aXphdGlvbiAqLwotICAgICAgICAgICAgUV9wbHNmXzMoCi0gICAgICAgICAgICAgICAgc3QtPnFTdCwKLSAgICAgICAgICAgICAgICByZXFfbW9kZSwKLSAgICAgICAgICAgICAgICBsc3BfbmV3LAotICAgICAgICAgICAgICAgIGxzcF9uZXdfcSwKLSAgICAgICAgICAgICAgICAqYW5hcCwKLSAgICAgICAgICAgICAgICAmcHJlZF9pbml0X2ksCi0gICAgICAgICAgICAgICAgcE92ZXJmbG93KTsKLQotICAgICAgICAgICAgSW50X2xwY18xdG8zKAotICAgICAgICAgICAgICAgIHN0LT5sc3Bfb2xkX3EsCi0gICAgICAgICAgICAgICAgbHNwX25ld19xLAotICAgICAgICAgICAgICAgIGF6USwKLSAgICAgICAgICAgICAgICBwT3ZlcmZsb3cpOwotCi0gICAgICAgICAgICAvKiBBZHZhbmNlIGFuYWx5c2lzIHBhcmFtZXRlcnMgcG9pbnRlciAqLwotICAgICAgICAgICAgKCphbmFwKSAr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DsKLQotICAgIC8vIGZbMF0gPSAxLjA7Ci0gICAgKmYgPSBMX211bHQgKDQwOTYsIDIwNDgpOwotICAgIGYrKzsKLSAgICAqZiA9IExfbXN1ICgoV29yZDMyKSAwLCAqbHNwLCA1MTIpOyAgICAvLyBmWzFdID0gIC0yLjAgKiBsc3BbMF07Ci0gICAgZisrOwotICAgIGxzcCArPSAyOyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vIEFkdmFuY2UgbHNwIHBvaW50ZXIKLQotICAgIGZvciAoaSA9IDI7IGkgPD0gNTsgaSsrKQotICAgIHsKLSAgICAgICAgKmYgPSBmWy0yXTsKLQotICAgICAgICBmb3IgKGogPSAxOyBqIDwgaTsgaisrLCBmLS0pCi0gICAgICAgIHsKLSAgICAgICAgICAgIExfRXh0cmFjdCAoZlstMV0sICZoaSwgJmxvKTsKLSAgICAgICAgICAgIHQwID0gTXB5XzMyXzE2IChoaSwgbG8sICpsc3ApOyAvLyB0MCA9IGZbLTFdICogbHNwCi0gICAgICAgICAgICB0MCA9IExfc2hsICh0MCwgMSk7Ci0gICAgICAgICAgICAqZiA9IExfYWRkICgqZiwgZlstMl0pOyAvLyAqZiArPSBmWy0yXQotICAgICAgICAgICAgKmYgPSBMX3N1YiAoKmYsIHQwKTsgLy8gKmYgLT0gdDAKLSAgICAgICAgfQotICAgICAgICAqZiA9IExfbXN1ICgqZiwgKmxzcCwgNTEyKTsgLy8gKmYgLT0gbHNwPDw5Ci0gICAgICAgIGYgKz0gaTsgICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gQWR2YW5jZSBmIHBvaW50ZXIKLSAgICAgICAgbHNwICs9IDI7ICAgICAgICAgICAgICAgICAgICAgICAgICAvLyBBZHZhbmNlIGxzcCBwb2ludGVyCi0gICAgfQotCi0gICAgcmV0dXJuOwotfQotCi0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0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HNwLAotICAgIFdvcmQzMiAqZiwKLSAgICBGbGFnICAgKnBPdmVyZmxvdykKLXsKLSAgICByZWdpc3RlciBXb3JkMTYgaTsKLSAgICByZWdpc3RlciBXb3JkMTYgajsKLQotICAgIFdvcmQxNiBoaTsKLSAgICBXb3JkMTYgbG87Ci0gICAgV29yZDMyIHQwOwotICAgIE9TQ0xfVU5VU0VEX0FSRyhwT3ZlcmZsb3cpOwotCi0gICAgLyogZlswXSA9IDEuMDsgICAgICAgICAgICAgKi8KLSAgICAqZisrID0gKFdvcmQzMikgMHgwMTAwMDAwMDsKLSAgICAqZisrID0gKFdvcmQzMikgLSAqKGxzcCsrKSA8PCAxMDsgICAgICAgLyogZlsxXSA9ICAtMi4wICogbHNwWzBdOyAgKi8KLSAgICBsc3ArKzsgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLyogQWR2YW5jZSBsc3AgcG9pbnRlciAgICAgKi8KLQotICAgIGZvciAoaSA9IDI7IGkgPD0gNTsgaSsrKQotICAgIHsKLSAgICAgICAgKmYgPSAqKGYgLSAyKTsKLQotICAgICAgICBmb3IgKGogPSAxOyBqIDwgaTsgaisrKQotICAgICAgICB7Ci0gICAgICAgICAgICBoaSA9IChXb3JkMTYpKCooZiAtIDEpID4+IDE2KTsKLQotICAgICAgICAgICAgbG8gPSAoV29yZDE2KSgoKihmIC0gMSkgPj4gMSkgLSAoKFdvcmQzMikgaGkgPDwgMTUpKTsKLQotICAgICAgICAgICAgdDAgID0gKChXb3JkMzIpaGkgKiAqbHNwKTsKLSAgICAgICAgICAgIHQwICs9ICgoV29yZDMyKWxvICogKmxzcCkgPj4gMTU7Ci0KLSAgICAgICAgICAgICooZikgKz0gICooZiAtIDIpOyAgICAgICAgICAvKiAgICAgICpmICs9IGZbLTJdICAgICAgKi8KLSAgICAgICAgICAgICooZi0tKSAtPSAgdDAgPDwgMjsgICAgICAgICAvKiAgICAgICpmIC09IHQwICAgICAgICAgKi8KLQotICAgICAgICB9Ci0KLSA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S0tLQotKi8KLQotdm9pZCBMc2ZfbHNwKAotICAgIFdvcmQxNiBsc2ZbXSwgICAgICAgLyogKGkpIDogbHNmW21dIG5vcm1hbGl6ZWQgKHJhbmdlOiAwLjA8PXZhbDw9MC41KSAqLwotICAgIFdvcmQxNiBsc3BbXSwgICAgICAgLyogKG8pIDogbHNwW21dIChyYW5nZTogLTE8PXZhbDwxKSAgICAgICAgICAgICAgICAqLwotICAgIFdvcmQxNiBtLCAgICAgICAgICAgLyogKGkpIDogTFBDIG9yZGVyICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotICAgIEZsYWcgICAqcE92ZXJmbG93ICAgLyogKG8pIDogRmxhZyBzZXQgd2hlbiBvdmVyZmxvdyBvY2N1cnMgICAgICAgICAgICAqLwotKQotewotICAgIFdvcmQxNiBpLCBpbmQsIG9mZnNldDsKLSAgICBXb3JkMzIgTF90bXA7Ci0KLSAgICBmb3IgKGkgPSAwOyBpIDwgbTsgaSsrKQotICAgIHsKLSAgICAgICAgaW5kID0gbHNmW2ldID4+IDg7ICAgICAgICAgICAvKiBpbmQgICAgPSBiOC1iMTUgb2YgbHNmW2ldICovCi0gICAgICAgIG9mZnNldCA9IGxzZltpXSAmIDB4MDBmZjsgICAgLyogb2Zmc2V0ID0gYjAtYjcgIG9mIGxzZltpXSAqLwotCi0gICAgICAgIC8qIGxzcFtpXSA9IHRhYmxlW2luZF0rICgodGFibGVbaW5kKzFdLXRhYmxlW2luZF0pKm9mZnNldCkgLyAyNTYgKi8KLQotICAgICAgICBMX3RtcCA9ICgoV29yZDMyKSh0YWJsZVtpbmQgKyAxXSAtIHRhYmxlW2luZF0pICogb2Zmc2V0KSA+PiA4OwotICAgICAgICBsc3BbaV0gPSBhZGQodGFibGVbaW5kXSwgKFdvcmQxNikgTF90bXAsIHBPdmVyZmxvdyk7Ci0KLSAgICB9Ci0KLSAgICByZXR1cm47Ci19Ci0KLS8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqK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S0tLS0tLS0tLS0tLQotIFBTRVVETy1DT0RFCi0KLVdvcmQxNiBub3JtX2wgKFdvcmQzMiBMX3ZhcjEpCi17Ci0gICAgV29yZDE2IHZhcl9vdXQ7Ci0KLSAgICBpZiAoTF92YXIxID09IDApCi0gICAgewotICAgICAgICB2YXJfb3V0ID0gMDsKLSAgICB9Ci0gICAgZWxzZQotICAgIHsKLSAgICAgICAgaWYgKExfdmFyMSA9PSAoV29yZDMyKSAweGZmZmZmZmZmTCkKLSAgICAgICAgewotICAgICAgICAgICAgdmFyX291dCA9IDMxOwotICAgICAgICB9Ci0gICAgICAgIGVsc2UKLSAgICAgICAgewotICAgICAgICAgICAgaWYgKExfdmFyMSA8IDApCi0gICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgTF92YXIxID0gfkxfdmFyMTsKLSAgICAgICAgICAgIH0KLSAgICAgICAgICAgIGZvciAodmFyX291dCA9IDA7IExfdmFyMSA8IChXb3JkMzIpIDB4NDAwMDAwMDBMOyB2YXJfb3V0KyspCi0gICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgTF92YXIxIDw8PSAxOwotICAgICAgICAgICAgfQotICAgICAgICB9Ci0gICAgfQotCi0jaWYgKFdNT1BTKQotICAgIG11bHRpQ291bnRlcltjdXJyQ291bnRlcl0ubm9ybV9sKys7Ci0jZW5kaWYKLSAgICByZXR1cm4gKHZhcl9vdXQpOwotfQotCi0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0KLSBSRVNPVVJDRVMgVVNFRAotICAgV2hlbiB0aGUgY29kZSBpcyB3cml0dGVuIGZvciBhIHNwZWNpZmljIHRhcmdldCBwcm9jZXNzb3IgdGhlCi0gICAgIHRoZSByZXNvdXJjZXMgdXNlZCBzaG91bGQgYmUgZG9jdW1lbnRlZCBiZWxvdy4KLQotIFNUQUNLIFVTQUdFOi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wLCAgICAgICAgLy8gaW5wdXQgOiBpbnRlZ2VyIHBpdGNoIGxhZwotICAgIFdvcmQxNiBmcmFjLCAgICAgIC8vIGlucHV0IDogZnJhY3Rpb24gb2YgbGFnCi0gICAgV29yZDE2IExfc3ViZnIsICAgLy8gaW5wdXQgOiBzdWJmcmFtZSBzaXplCi0gICAgV29yZDE2IGZsYWczICAgICAgLy8gaW5wdXQgOiBpZiBzZXQsIHVwc2FtcGxpbmcgcmF0ZSA9IDMgKDYgb3RoZXJ3aXNlKQotKQotewotICAgIFdvcmQxNiBpLCBqLCBrOwotICAgIFdvcmQxNiAqcFgwLCAqcFgxLCAqcFgyOwotICAgIGNvbnN0IFdvcmQxNiAqcEMxLCAqcEMyOwotICAgIFdvcmQzMiBzOwotCi0gICAgcFgwID0gJmV4Y1stVDBdOwotCi0gICAgZnJhYyA9IG5lZ2F0ZSAoZnJhYyk7Ci0gICAgaWYgKGZsYWczICE9IDApCi0gICAgewotICAgICAgZnJhYyA9IHNobCAoZnJhYywgMSk7ICAgLy8gaW50ZXJfM2xba10gPSBpbnRlcl82WzIqa10gLT4gaycgPSAyKmsKLSAgICB9Ci0KLSAgICBpZiAoZnJhYyA8IDApCi0gICAgewotICAgICAgICBmcmFjID0gYWRkIChmcmFjLCBVUF9TQU1QX01BWCk7Ci0gICAgICAgIHBYMC0tOwotICAgIH0KLQotICAgIGZvciAoaiA9IDA7IGogPCBMX3N1YmZyOyBqKyspCi0gICAgewotICAgICAgICBwWDEgPSBwWDArKzsKLSAgICAgICAgcFgyID0gcFgwOwotICAgICAgICBwQzEgPSAmaW50ZXJfNltmcmFjXTsKLSAgICAgICAgcEMyID0gJmludGVyXzZbc3ViIChVUF9TQU1QX01BWCwgZnJhYyldOwotCi0gICAgICAgIHMgPSAwOwotICAgICAgICBmb3IgKGkgPSAwLCBrID0gMDsgaSA8IExfSU5URVIxMDsgaSsrLCBrICs9IFVQX1NBTVBfTUFYKQotICAgICAgICB7Ci0gICAgICAgICAgICBzID0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oTF9zdWJmciA+PiAxKTsgaiAhPSAwIDsgai0tKQotICAgIHsKLSAgICAgICAgcFgwKys7Ci0gICAgICAgIHBYMiA9IHBYMDsKLSAgICAgICAgcFgzID0gcFgwKys7Ci0KLSAgICAgICAgcEMxID0gQ29lZmZfMTsKLQotICAgICAgICBzMSAgPSAweDAwMDA0MDAwTDsKLSAgICAgICAgczIgID0gMHgwMDAwNDAwMEw7Ci0KLSAgICAgICAgZm9yIChpID0gTF9JTlRFUjEwID4+IDE7IGkgPiAwOyBpLS0pCi0gICAgICAgIHsKLSAgICAgICAgICAgIHMyICs9ICgoV29yZDMyKSAqIChwWDMtLSkpICogKihwQzEpOwotICAgICAgICAgICAgczEgKz0gKChXb3JkMzIpICogKHBYMykpICogKihwQzErKyk7Ci0gICAgICAgICAgICBzMSArPSAoKFdvcmQzMikgKiAocFgyKyspKSAqICoocEMxKTsKLSAgICAgICAgICAgIHMyICs9ICgoV29yZDMyKSAqIChwWDIpKSAqICoocEMxKyspOwotICAgICAgICAgICAgczIgKz0gKChXb3JkMzIpICogKHBYMy0tKSkgKiAqKHBDMSk7Ci0gICAgICAgICAgICBzMSArPSAoKFdvcmQzMikgKiAocFgzKSkgKiAqKHBDMSsrKTsKLSAgICAgICAgICAgIHMxICs9ICgoV29yZDMyKSAqIChwWDIrKykpICogKihwQzEpOwotICAgICAgICAgICAgczIgKz0gKChXb3JkMzIpICogKHBYMikpICogKihwQzErKyk7Ci0KLSAgICAgICAgfSAvKiBmb3IgKGkgPSBMX0lOVEVSMTA+PjE7IGkgPiAwOyBpLS0pICovCi0KLSAgICAgICAgKihwX2V4YysrKSA9IChXb3JkMTYpKHMxID4+IDE1KTsKLSAgICAgICAgKihwX2V4YysrKSA9IChXb3JkMTYpKHMyID4+IDE1KTsKLQotICAgIH0gLyogZm9yIChqID0gKExfc3ViZnI+PjEpOyBqICE9IDAgOyBqLS0pICovCi0KLSAgICByZXR1cm47Ci19CmRpZmYgLS1naXQgYS9tZWRpYS9saWJzd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oZXIKLSAqIGV4cHJlc3Mgb3IgaW1wbGllZC4KLSAqIFNlZSB0aGUgTGljZW5zZSBmb3IgdGhlIHNwZWNpZmljIGxhbmd1YWdlIGdvdmVybmluZyBwZXJtaXNzaW9ucwotICogYW5kIGxpbWl0YXRpb25zIHVuZGVyIHRoZSBMaWNlbnNlLgotICogLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLQotICovCi0vKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgotUG9ydGlvbnMgb2YgdGhpcyBmaWxlIGFyZSBkZXJpdmVkIGZyb20gdGhlIGZvbGxvd2luZyAzR1BQIHN0YW5kYXJkOgotCi0gICAgM0dQUCBUUyAyNi4wNzMKLSAgICBBTlNJLUMgY29kZSBmb3IgdGhlIEFkYXB0aXZlIE11bHRpLVJhdGUgKEFNUikgc3BlZWNoIGNvZGVjCi0gICAgQXZhaWxhYmxlIGZyb20gaHR0cDovL3d3dy4zZ3BwLm9yZwotCi0oQykgMjAwNCwgM0dQUCBPcmdhbml6YXRpb25hbCBQYXJ0bmVycyAoQVJJQiwgQVRJUywgQ0NTQSwgRVRTSSwgVFRBLCBUVEMpCi1QZXJtaXNzaW9uIHRvIGRpc3RyaWJ1dGUsIG1vZGlmeSBhbmQgdXNlIHRoaXMgZmlsZSB1bmRlciB0aGUgc3RhbmRhcmQgbGljZW5zZQotdGVybXMgbGlzdGVkIGFib3ZlIGhhcyBiZWVuIG9idGFpbmVkIGZyb20gdGhlIGNvcHlyaWdodCBob2xkZXIuCi0qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotLyoKLSoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCi0qCi0qICAgICAgR1NNIEFNUi1OQiBzcGVlY2ggY29kZWMgICBSOTggICBWZXJzaW9uIDcuNS4wICAgTWFyY2ggMiwgMjAwMQotKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgUjk5ICAgVmVyc2lvbiAzLjIuMAotKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgUkVMLTQgVmVyc2lvbiA0LjAuMAotKgotKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKLSoKLSogICAgICBGaWxlICAgICAgICAgICAgIDogcV9wbHNmLmMKLSogICAgICBQdXJwb3NlICAgICAgICAgIDogY29tbW9uIHBhcnQgKGluaXQsIGV4aXQsIHJlc2V0KSBvZiBMU0YgcXVhbnRpemF0aW9uCi0qICAgICAgICAgICAgICAgICAgICAgICAgIG1vZHVsZSAocmVzdCBpbiBxX3Bsc2ZfMy5jIGFuZCBxX3Bsc2ZfNS5jKQotKgotKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKLSovCi0KLS8qCi0qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgotKiAgICAgICAgICAgICAgICAgICAgICAgICBNT0RVTEUgSU5DTFVERSBGSUxFIEFORCBWRVJTSU9OIElECi0qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgotKi8KLQotI2luY2x1ZGUgPHN0ZGxpYi5oPgotCi0jaW5jbHVkZSAicV9wbHNmLmgiCi0KLS8qCi0qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgotKiAgICAgICAgICAgICAgICAgICAgICAgICBJTkNMVURFIEZJTEVTCi0qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgotKi8KLSNpbmNsdWRlICJ0eXBlZGVmLmgiCi0jaW5jbHVkZSAiYmFzaWNfb3AuaCIKLQotCi0vKgotKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKLSogICAgICAgICAgICAgICAgICAgICAgICAgUFVCTElDIFBST0dSQU0gQ09ERQotKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKLSovCi0KLS8qCi0qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgotKgotKiAgRnVuY3Rpb24gICAgOiBRX3Bsc2ZfaW5pdAotKiAgUHVycG9zZSAgICAgOiBBbGxvY2F0ZXMgbWVtb3J5IGFuZCBpbml0aWFsaXplcyBzdGF0ZSB2YXJpYWJsZXMKLSoKLSoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCi0qLwotV29yZDE2IFFfcGxzZl9pbml0KFFfcGxzZlN0YXRlICoqc3RhdGUpCi17Ci0gICAgUV9wbHNmU3RhdGUqIHM7Ci0KLSAgICBpZiAoc3RhdGUgPT0gKFFfcGxzZlN0YXRlICoqKSBOVUxMKQotICAgIHsKLSAgICAgICAgLyogZnByaW50ZihzdGRlcnIsICJRX3Bsc2ZfaW5pdDogaW52YWxpZCBwYXJhbWV0ZXJcbiIpOyAqLwotICAgICAgICByZXR1cm4gLTE7Ci0gICAgfQotICA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0ZW1wOwotCi0gICAgICAgIHRlbXAgPSBsc2ZfcjFfMSAtICgqcF9kaWNvKyspOwotICAgICAgICB0ZW1wID0gKFdvcmQxNikoKCgoV29yZDMyKSB3ZjFfMSkgKiB0ZW1wKSA+PiAxNSk7Ci0gICAgICAgIGRpc3QgKz0gKChXb3JkMzIpIHRlbXApICogdGVtcDsKLQotICAgICAgICB0ZW1wID0gbHNmX3IxXzIgLSAoKnBfZGljbysrKTsKLSAgICAgICAgdGVtcCA9IChXb3JkMTYpKCgoKFdvcmQzMikgd2YxXzIpICogdGVtcCkgPj4gMTUpOwotICAgICAgICBkaXN0ICs9ICgoV29yZDMyKSB0ZW1wKSAqIHRlbXA7Ci0KLSAgICAgICAgdGVtcCA9IGxzZl9yMV8zIC0gKCpwX2RpY28rKyk7Ci0gICAgICAgIHRlbXAgPSAoV29yZDE2KSgoKChXb3JkMzIpIHdmMV8zKSAqIHRlbXApID4+IDE1KTsKLSAgICAgICAgZGlzdCArPSAoKFdvcmQzMikgdGVtcCkgKiB0ZW1wOwotCi0gICAgICAgIGlmIChkaXN0IDwgZGlzdF9taW4pCi0gICAgICAgIHsKLSAgICAgICAgICAgIGRpc3RfbWluID0gZGlzdDsKLSAgICAgICAgICAgIGluZGV4ID0gaTsKLSAgICAgICAgfQotICAgIH0KLQotICAgIC8qIFJlYWRpbmcgdGhlIHNlbGVjdGVkIHZlY3RvciAqLwotCi0gICAgcF9kaWNvID0gZGljbyArIChpbmRleCA8PCAyKTsKLSAgICAqbHNmX3IxKysgPSAqcF9kaWNvKys7Ci0gICAgKmxzZl9yMSsrID0gKnBfZGljbysrOwotICAgICpsc2ZfcjErKyA9ICpwX2RpY28rKzsKLSAgICAqbHNmX3IxID0gKnBfZGljbzsKLQotICAgIHJldHVybihpbmRleCk7Ci0KLX0KLQotLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0KLQotLyoKLS0t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RleCwgaW5kZXgpKV07Ci0gICAgfQotICAgIGVsc2UKLSAgICB7Ci0gICAgICAgZm9yIChpID0gMDsgaSA8IGRpY29fc2l6ZTsgaSsrKQotICAgICAgIHsKLSAgICAgICAgICB0ZW1wID0gc3ViKGxzZl9yMVswXSwgKnBfZGljbysrKTsKLSAgICAgICAgICB0ZW1wID0gbXVsdCh3ZjFbMF0sIHRlbXApOwotICAgICAgICAgIGRpc3QgPSBMX211bHQodGVtcCwgdGVtcCk7Ci0KLSAgICAgICAgICB0ZW1wID0gc3ViKGxzZl9yMVsxXSwgKnBfZGljbysrKTsKLSAgICAgICAgICB0ZW1wID0gbXVsdCh3ZjFbMV0sIHRlbXApOwotICAgICAgICAgIGRpc3QgPSBMX21hYyhkaXN0LCB0ZW1wLCB0ZW1wKTsKLQotICAgICAgICAgIHRlbXAgPSBzdWIobHNmX3IxWzJdLCAqcF9kaWNvKyspOwotICAgICAgICAgIHRlbXAgPSBtdWx0KHdmMVsyXSwgdGVtcCk7Ci0gICAgICAgICAgZGlzdCA9IExfbWFjKGRpc3QsIHRlbXAsIHRlbXApOwotCi0gICAgICAgICAgaWYgKExfc3ViKGRpc3QsIGRpc3RfbWluKSA8IChXb3JkMzIpIDApCi0gICAgICAgICAgewotICAgICAgICAgICAgIGRpc3RfbWluID0gZGlzdDsKLSAgICAgICAgICAgICBpbmRleCA9IGk7Ci0gICAgICAgICAgfQotICAgICAgICAgIHBfZGljbyA9IHBfZGljbyArIDM7IGFkZCgwLDApOwotICAgICAgIH0KLSAgICAgICBwX2RpY28gPSAmZGljb1tzaGwoYWRkKGluZGV4LCBhZGQoaW5kZXgsIGluZGV4KSksMSldOwotICAgIH0KLQotCi0gICAgLy8gUmVhZGluZyB0aGUgc2VsZWN0ZWQgdmVjdG9yCi0gICAgbHNmX3IxWzBdID0gKnBfZGljbysrOwotICAgIGxzZl9yMVsxXSA9ICpwX2RpY28rKzsKLSAgICBsc2ZfcjFbMl0gPSAqcF9kaWNvKys7Ci0KL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AgICAgICAgICAgICAgICAgICAgZGljb19zaXplID0gZGljb19zaXplCi0gICAgICAgICAgICAgICAgICAgICB1c2VfaGFsZiA9IHVzZV9oYWxmKQotICAgICAgIE1PRElGWUlORyhub3RoaW5nKQotICAgICAgIFJFVFVSTklORyhpbmRleCA9IGluZGV4KQotICAgIC0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSovCi0gICAgdHN0X2luZGV4MyA9Ci0gICAgICAgIFZxX3N1YnZlYzMoCi0gICAgICAgICAgICBsc2ZfcjEsCi0gICAgICAgICAgICBkaWNvLAotICAgICAgICAgICAgd2YxLAotICAgICAgICAgICAgZGljb19zaXplLAotICAgICAgICAgICAgdXNlX2hhbGYsCi0gICAgICAgICAgICBwT3ZlcmZsb3cpOwotCi0gICAgcmV0dXJuKHRzdF9pbmRleDMpOwotCi19Ci0KLS8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotCi0KLS8qCi0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0KLSBGVU5DVElPTiBOQU1FOiBRX3Bsc2ZfMwotLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tCi0gSU5QVVQgQU5EIE9VVFBVVCBERUZJTklUSU9OUwotCi0gSW5wdXRzOgotICAgIHN0ID0gcG9pbnRlciB0byBzdHJ1Y3R1cmVzIG9mIHR5cGUgUV9wbHNmU3RhdGUgKFFfcGxzZlN0YXRlKQotICAgIG1vZGUgPSBjb2RlciBtb2RlIChlbnVtKQotICAgIGxzcD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mVjdG9yIHRoYXQgeWllbGRzCi0gICAgICAgLy8gbG93ZXN0IHByZWRpY3Rpb24gcmVzdWlkdWFsIGVuZXJneQotICAgICAgICpwcmVkX2luaXRfaSA9IDA7Ci0gICAgICAgTF9taW5fcHJlZF9pbml0X2VyciA9IDB4N2ZmZmZmZmY7IC8vIDJeMzEgLSAxCi0gICAgICAgZm9yIChqID0gMDsgaiA8IFBBU1RfUlFfSU5JVF9TSVpFOyBqKyspCi0gICAgICAgewotICAgICAgICAgIExfcHJlZF9pbml0X2VyciA9IDA7Ci0gICAgICAgICAgZm9yIChpID0gMDsgaSA8IE07IGkrKykKLSAgICAgICAgICB7Ci0gICAgICAgICAgICAgdGVtcF9wW2ldID0gYWRkKG1lYW5fbHNmW2ldLCBwYXN0X3JxX2luaXRbaipNK2ldKTsKLSAgICAgICAgICAgICB0ZW1wX3IxW2ldID0gc3ViKGxzZjFbaV0sdGVtcF9wW2ldKTsKLSAgICAgICAgICAgICBMX3ByZWRfaW5pdF9lcnIgPSBMX21hYyhMX3ByZWRfaW5pdF9lcnIsIHRlbXBfcjFbaV0sIHRlbXBfcjFbaV0pOwotICAgICAgICAgIH0gIC8vIG5leHQgaQotCi0KLSAgICAgICAgICBpZiAoTF9zdWIoTF9wcmVkX2luaXRfZXJyLCBMX21pbl9wcmVkX2luaXRfZXJyKSA8IChXb3JkMzIpIDApCi0gICAgICAgICAgewotICAgICAgICAgICAgIExfbWluX3ByZWRfaW5pdF9lcnIgPSBMX3ByZWRfaW5pdF9lcnI7Ci0gICAgICAgICAgICAgQ29weSh0ZW1wX3IxLCBsc2ZfcjEsIE0pOwotICAgICAgICAgICAgIENvcHkodGVtcF9wLCBsc2ZfcCwgTSk7Ci0gICAgICAgICAgICAgLy8gU2V0IHplcm9tCi0gICAgICAgICAgICAgQ29weSgmcGFzdF9ycV9pbml0W2oqTV0sIHN0LT5wYXN0X3JxLCBNKTsKLSAgICAgICAgICAgICAqcHJlZF9pbml0X2kgPSBqOwotICAgICAg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V0ZSBMU0Ygd2VpZ2h0aW5nIGZhY3RvcnMgKFExMykgKi8KLQotICAgIExzZl93dCgKLSAgICAgICAgbHNmMSwKLSAgICAgICAgd2YxLAotICAgICAgICBwT3ZlcmZsb3cpOwotCi0gICAgLyogQ29tcHV0ZSBwcmVkaWN0ZWQgTFNGIGFuZCBwcmVkaWN0aW9uIGVycm9yICovCi0gICAgaWYgKG1vZGUgIT0gTVJEVFgpCi0gICAgewotICAgICAgICBmb3IgKGkgPSAwOyBpIDwgTTsgaSsrKQotICAgICAgICB7Ci0gICAgICAgICAgICB0ZW1wID0gKFdvcmQxNikoKCgoV29yZDMyKSBzdC0+cGFzdF9ycVtpXSkgKgotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoKihwcmVkX2ZhY18zICsgaSkpKSA+PiAxNSk7Ci0KLSAgICAgICAgICAgICoobHNmX3AgKyBpKSA9ICoobWVhbl9sc2ZfMyArIGkpICsgdGVtcDsKLQotICAgICAgICAgICAgKihsc2ZfcjEgKyBpKSA9ICoobHNmMSArIGkpIC0gKihsc2ZfcCArIGkpOwotICAgICAgICB9Ci0gICAgfQotICAgIGVsc2UKLSAgICB7Ci0gICAgICAgIC8qIERUWCBtb2RlLCBzZWFyY2ggdGhlIGluaXQgdmVjdG9yIHRoYXQgeWllbGRzICovCi0gICAgICAgIC8qIGxvd2VzdCBwcmVkaWN0aW9uIHJlc3VpZHVhbCBlbmVyZ3kgICAgICAgICAgICovCi0gICAgICAgICpwcmVkX2luaXRfaSA9IDA7Ci0gICAgICAgIExfbWluX3ByZWRfaW5pdF9lcnIgPSAweDdmZmZmZmZmOyAvKiAyXjMxIC0gMSAqLwotCi0gICAgICAgIGZvciAoaiA9IDA7IGogPCBQQVNUX1JRX0lOSVRfU0laRTsgaisrKQotICAgICAgICB7Ci0gICAgICAgICAgICBMX3ByZWRfaW5pdF9lcnIgPSAwOwotICAgICAgICAgICAgZm9yIChpID0gMDsgaSA8IE07IGkrKykKLSAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAqKHRlbXBfcCArIGkpID0gKihtZWFuX2xzZl8zICsgaSkgKyAqKHBhc3RfcnFfaW5pdCArIGogKiBNICsgaSk7Ci0KLSAgICAgICAgICAgICAgICAqKHRlbXBfcjEgKyBpKSA9ICoobHNmMSArIGkpIC0gKih0ZW1wX3AgKyBpKTsKLQotICAgICAgICAgICAgICAgIExfdGVtcCA9ICgoV29yZDMyKSAqICh0ZW1wX3IxICsgaSkpICogKih0ZW1wX3IxICsgaSk7Ci0KLSAgICAgICAgICAgICAgICBMX3ByZWRfaW5pdF9lcnIgPSBMX3ByZWRfaW5pdF9lcnIgKyAoTF90ZW1wIDw8IDEpOwotCi0gICAgICAgICAgICB9ICAvKiBuZXh0IGkgKi8KLQotCi0gICAgICAgICAgICBpZiAoTF9wcmVkX2luaXRfZXJyIDwgTF9taW5fcHJlZF9pbml0X2VycikKLSAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICBMX21pbl9wcmVkX2luaXRfZXJyID0gTF9wcmVkX2luaXRfZXJyOwotCi0gICAgICAgICAgICAgICAgbWVtY3B5KAotICAgICAgICAgICAgICAgICAgICBsc2ZfcjEsCi0gICAgICAgICAgICAgICAgICAgIHRlbXBfcjEsCi0gICAgICAgICAgICAgICAgICAgIE0qc2l6ZW9mKFdvcmQxNikpOwotCi0gICAgICAgICAgICAgICAgbWVtY3B5KAotICAgICAgICAgICAgICAgICAgICBsc2ZfcCwKLSAgICAgICAgICAgICAgICAgICAgdGVtcF9wLAotICAgICAgICAgICAgICAgICAgICBNKnNpemVvZihXb3JkMTYpKTsKLQotICAgICAgICAgICAgICAgIC8qIFNldCB6ZXJvbSAqLwotICAgICAgICAgICAgICAgIG1lbWNweSgKLSAgICAgICAgICAgICAgICAgICAgc3QtPnBhc3RfcnEsCi0gICAgICAgICAgICAgICAgICAgICZwYXN0X3JxX2luaXRbaipNXSwKLSAgICAgICAgICAgICAgICAgICAgTSpzaXplb2YoV29yZDE2KSk7Ci0KLSAgICAgICAgICAgICAgICAqcHJlZF9pbml0X2kgPSBqOwotCi0gICAgICAgICAgICB9IC8qIGVuZGlmICovCi0gICAgICAgIH0gLyogbmV4dCBqICovCi0gICAgfSAvKiBlbmRpZiBNUkRUWCAqLwotCi0gICAgLyotLS0tIFNwbGl0LVZRIG9mIHByZWRpY3Rpb24gZXJyb3IgLS0tLSovCi0gICAgaWYgKChtb2RlID09IE1SNDc1KSB8fCAobW9kZSA9PSBNUjUxNSkpCi0gICAgeyAgIC8qIE1SNDc1LCBNUjUxNSAqLwotCi0gICAgICAgICppbmRpY2UgPQotICAgICAgICAgICAgVnFfc3VidmVjMygKLSAgICAgICAgICAgICAgICBsc2ZfcjEsCi0gICAgICAgICAgICAgICAgZGljbzFfbHNmXzMsCi0gICAgICAgICAgICAgICAgd2YxLAotICAgICAgICAgICAgICAgIERJQ08xX1NJWkUsCi0gICAgICAgICAgICAgICAgMCwKLSAgICAgICAgICAgICAgICBwT3ZlcmZsb3cpOwotCi0gICAgICAgICooaW5kaWNlICsgMSkgPQotICAgICAgICAgICAgVnFfc3VidmVjMygKLSAgICAgICAgICAgICAgICBsc2ZfcjEgKyAzLAotICAgICAgICAgICAgICAgIGRpY28yX2xzZl8zLAotICAgICAgICAgICAgICAgIHdmMSArIDMsCi0gICAgICAgICAgICAgICAgRElDTzJfU0laRSAvIDIsCi0gICAgICAgICAgICAgICAgMSwKLSAgICAgICAgICAgICAgICBwT3ZlcmZsb3cpOwotCi0gICAgICAgICooaW5kaWNlICsgMikgPQotICAgICAgICAgICAgVnFfc3VidmVjNCgKLSAgICAgICAgICAgICAgICBsc2ZfcjEgKyA2LAotICAgICAgICAgICAgICAgIG1yNTE1XzNfbHNmLAotICAgICAgICAgICAgICAgIHdmMSArIDYsCi0gICAgICAgICAgICAgICAgTVI1MTVfM19TSVpFLAotICAgICAgICAgICAgICAgIHBPdmVyZmxvdyk7Ci0KLSAgICB9Ci0gICAgZWxzZSBpZiAobW9kZSA9PSBNUjc5NSkKLSAgICB7ICAgLyogTVI3OTUgKi8KLQotICAgICAgICAqaW5kaWNlID0KLSAgICAgICAgICAgIFZxX3N1YnZlYzMoCi0gICAgICAgICAgICAgICAgbHNmX3IxLAotICAgICAgICAgICAgICAgIG1yNzk1XzFfbHNmLAotICAgICAgICAgICAgICAgIHdmMSwKLSAgICAgICAgICAgICAgICBNUjc5NV8xX1NJWkUsCi0gICAgICAgICAgICAgICAgMCwKLSAgICAgICAgICAgICAgICBwT3ZlcmZsb3cpOwotCi0gICAgICAgICooaW5kaWNlICsgMSkgPQotICAgICAgICAgICAgVnFfc3VidmVjMygKLSAgICAgICAgICAgICAgICBsc2ZfcjEgKyAzLAotICAgICAgICAgICAgICAgIGRpY28yX2xzZl8zLAotICAgICAgICAgICAgICAgIHdmMSArIDMsCi0gICAgICAgICAgICAgICAgRElDTzJfU0laRSwKLSAgICAgICAgICAgICAgICAwLAotICAgICAgICAgICAgICAgIHBPdmVyZmxvdyk7Ci0KLSAgICAgICAgKihpbmRpY2UgKyAyKSA9Ci0gICAgICAgICAgICBWcV9zdWJ2ZWM0KAotICAgICAgICAgICAgICAgIGxzZl9yMSArIDYsCi0gICAgICAgICAgICAgICAgZGljbzNfbHNmXzMsCi0gICAgICAgICAgICAgICAgd2YxICsgNiwKLSAgICAgICAgICAgICAgICBESUNPM19TSVpFLAotICAgICAgICAgICAgICAgIHBPdmVyZmxvdyk7Ci0KLSAgICB9Ci0gICAgZWxzZQotICAgIHsgICAvKiBNUjU5LCBNUjY3LCBNUjc0LCBNUjEwMiAsIE1SRFRYICovCi0KLSAgICAgICAgKmluZGljZSA9Ci0gICAgICAgICAgICBWcV9zdWJ2ZWMzKAotICAgICAgICAgICAgICAgIGxzZl9yMSwKLSAgICAgICAgICAgICAgICBkaWNvMV9sc2ZfMywKLSAgICAgICAgICAgICAgICB3ZjEsCi0gICAgICAgICAgICAgICAgRElDTzFfU0laRSwKLSAgICAgICAgICAgICAgICAwLAotICAgICAgICAgICAgICAgIHBPdmVyZmxvdyk7Ci0KLSAgICAgICAgKihpbmRpY2UgKyAxKSA9Ci0gICAgICAgICAgICBWcV9zdWJ2ZWMzKAotICAgICAgICAgICAgICAgIGxzZl9yMSArIDMsCi0gICAgICAgICAgICAgICAgZGljbzJfbHNmXzMsCi0gICAgICAgICAgICAgICAgd2YxICsgMywKLSAgICAgICAgICAgICAgICBESUNPMl9TSVpFLAotICAgICAgICAgICAgICAgIDAsCi0gICAgICAgICAgICAgICAgcE92ZXJmbG93KTsKLQotICAgICAgICAqKGluZGljZSArIDIpID0KLSAgICAgICAgICAgIFZxX3N1YnZlYzQoCi0gICAgICAgICAgICAgICAgbHNmX3IxICsgNiwKLSAgICAgICAgICAgICAgICBkaWNvM19sc2ZfMywKLSAgICAgICAgICAgICAgICB3ZjEgKyA2LAotICAgICAgICAgICAgICAgIERJQ08zX1NJWkUsCi0gICAgICAgICAgICAgICAgcE92ZXJmbG93KTsKLQotICAgIH0KLQotCi0gICAgLyogQ29tcHV0ZSBxdWFudGl6ZWQgTFNGcyBhbmQgdXBkYXRlIHRoZSBwYXN0IHF1YW50aXplZCByZXNpZHVhbCAqLwotCi0gICAgZm9yIChpID0gMDsgaSA8IE07IGkrKykKLSAgICB7Ci0gICAgICAgICoobHNmMV9xICsgaSkgPSAqKGxzZl9yMSArIGkpICsgKihsc2ZfcCArIGkpOwotICAgICAgICBzdC0+cGFzdF9ycVtpXSA9ICoobHNmX3IxICsgaSk7Ci0gICAgfQotCi0gICAgLyogdmVyaWZpY2F0aW9uIHRoYXQgTFNGcyBoYXMgbWltaW11bSBkaXN0YW5jZSBvZiBMU0ZfR0FQIEh6ICovCi0KLSAgICBSZW9yZGVyX2xzZigKLSAgICAgICAgbHNmMV9xLAotICAgICAgICBMU0ZfR0FQLAotICAgICAgICBNLAotICAgICAgICBwT3ZlcmZsb3cpOwotCi0gICAgLyogIGNvbnZlcnQgTFNGcyB0byB0aGUgY29zaW5lIGRvbWFpbiAqLwotCi0gICAgTHNmX2xzcCgKLSA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Y3Rpb24gcHJvdG90eXBlcyBoZXJlXQotLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSovCi0KLS8qLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLQotOyBMT0NBTCBWQVJJQUJMRSBERUZJTklUSU9OUwotOyBbVmFyaWFibGUgZGVjbGFyYXRpb24gLSBkZWZpbmVkIGhlcmUgYW5kIHVzZWQgb3V0c2lkZSB0aGlzIG1vZHVsZV0KLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0qLwotLyoKLSoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCi0qCi0qICAgICAgR1NNIEFNUi1OQiBzcGVlY2ggY29kZWMgICBSOTggICBWZXJzaW9uIDcuNS4wICAgTWFyY2ggMiwgMjAwMQotKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgUjk5ICAgVmVyc2lvbiAzLjIuMAotKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgUkVMLTQgVmVyc2lvbiA0LjAuMAotKgotKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKLSoKLSogICAgICBGaWxlICAgICAgICAgICAgIDogcV9wbHNmXzMudGFiCi0qICAgICAgUHVycG9zZSAgICAgICAgICA6IFRhYmxlIGZvciByb3V0aW5lIExTRiBWUS4KLSogICAgICAkSWQgJAotKgotKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq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yLCAtMTE0OCwgLTExNTYsCi0gICAgLTI5NCwgICAtNDYsICAgMTEwLAotICAgIC00MTEsICAtMzc0LCAgLTY3OCwKLSAgICAyMTQsICAgNTMxLCAgIDY2OCwKLSAgICAtNDA2LCAgLTQyMCwgLTExOTQsCi0gICAgNDg3LCAgIDIzMiwgICAzMDMsCi0gICAgLTMxOCwgICAgOTEsICAtNDcyLAotICAgIDEyMywgIDEyMzIsICAyNDQ1LAotICAgIC03MjIsICAtOTUyLCAtMTQ5NSwKLSAgICAtNzM4LCAgLTY3NSwgIDEzMzIsCi0gICAgLTU0MywgIC02MDYsICAtMjExLAotICAgIC05NSwgICAtOTgsICAxNTA4LAotICAgIC01NDksICAtNTE0LCAtMTE5MywKLSAgICA0NzMsICAgMjExLCAgICA3MywKLSAgICAtMjg4LCAgLTExMiwgIC0zODksCi0gICAgNTM3LCAgMTMzMiwgIDEyNTgsCi0gICAgLTU2NywgIC03NTUsIC0xNTQ1LAotICAgIDcxLCAgLTI4MywgICA2MzIsCi0gICAgLTE3MCwgIC00ODEsICAtNDkzLAotICAgIDY4MSwgIDEwMDIsICAgODE3LAotICAgIC0zNTYsICAtMzMxLCAgLTg3NywKLSAgICA0MTksICAgNzA2LCAgIDM0NiwKLSAgICAyNDEsICAgLTM0LCAgLTMyNiwKLSAgICAzNzcsICAxOTUwLCAgMTg4MywKLSAgICAtNzI3LCAtMTA3NSwgLTE2MjUsCi0gICAgLTIzMywgIC01NDMsICAgMTE2LAotICAgIC01MjQsICAtODA2LCAgLTU4NSwKLSAgICAtNzMsICAgNDc4LCAgIDcyOSwKLSAgICAtMjg4LCAgLTkyNSwgLTExNDMsCi0gICAgMTczLCAgIDQ0NywgICAtNTIsCi0gICAgNjgsICAtMjI5LCAgLTYwNiwKLSAgICA0NDksICAgNTI5LCAgMTc5NywKLSAgICAtNTkxLCAgLTg3NSwgLTEzNjMsCi0gICAgMTgzLCAgLTE0NCwgICAzMjQsCi0gICAgLTEwMywgIC00NTIsICAtNjY2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EyNCwgIDE0NjQsICAyMjQ0LAotICAgIC00MTcsICAtNzg2LCAtMTU2MiwKLSAgICAtMjI0LCAgLTM4NCwgIDEzNjQsCi0gICAgLTM3NywgIC00NTksICAgLTI1LAotICAgIDM4NSwgICA0ODksICAyMTc0LAotICAgIC0zMzIsICAtNjUxLCAgLTgyOSwKLSAgICA1NDQsICAgNTUzLCAgICA2MSwKLSAgICAyMiwgIC0xMTMsICAgLTg5LAotICAgIDExMjgsICAxNzI1LCAgMTUyNCwKLSAgICAtMjE2LCAgLTM3MywgLTE2NTMsCi0gICAgMTYxLCAgIDMxNiwgICA5MDgsCi0gICAgLTE2NSwgIC0yMjIsICAgLTY3LAotICAgIDEzNjIsICAxMTc1LCAgIDc4OSwKLSAgICA3MywgIC0yNTIsICAtNzY3LAotICAgIDczOCwgICA5MzIsICAgNjE2LAotICAgIDM2MiwgICAyNDYsICAtMTI2LAotICAgIDc4NywgIDI2NTQsICAzMDI3LAotICAgIC02OTEsIC0xMTA2LCAtMjE5MCwKLSAgICAtNTY1LCAgLTU4OCwgICA1MjQsCi0gICAgLTU5MCwgIC05NzksICAtNDkwLAotICAgIC0yNjMsICAgMzk3LCAgIDk4MiwKLSAgICAtNTc3LCAgLTgzNywgIC05NDUsCi0gICAgLTIyLCAgIDQzNSwgICAtNDksCi0gICAgLTE5MCwgIC0xMTgsICAtNjI5LAotICAgIC04OCwgIDEyNDAsICAxNTEzLAotICAgIC02MzYsIC0xMDUxLCAtMTAxOSwKLSAgICAtMjkxLCAgIDE4OSwgICAyNTksCi0gICAgLTI1NywgIC00NzAsICAtNjI5LAotICAgIDE0NSwgICA5NDUsICAgODk0LAotICAgIC0zMjYsICAtMzY0LCAtMTA5NCwKLSAgICA1NDMsICAgMjYwLCAgIDYzMCwKLSAgICAtMjAyLCAgIDE4OSwgIC0yMDksCi0gICAgMzU3LCAgMTM3OSwgIDIwOTEsCi0gICAgLTU2OSwgLTEwNzUsIC0xNDQ5LAotICAgIC03MTQsICAtMjM5L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ChXb3JkMzIpIGxzZl9yMlswXSAqIHdmMl8wKTsKLSAgICBhdXg0ID0gKChXb3JkMzIpIGxzZl9yMlsxXSAqIHdmMl8xKTsKLQotICAgIGZvciAoaSA9IDA7IGkgPCBkaWNvX3NpemU7IGkrKykKLSAgICB7Ci0gICAgICAgIHRlbXAgID0gKGF1eDEgLSAoKFdvcmQzMil3ZjFfMCAqICoocF9kaWNvKyspKSkgPj4gMTU7Ci0gICAgICAgIGRpc3QgID0gKChXb3JkMzIpdGVtcCAqIHRlbXApOwotCi0gICAgICAgIGlmIChkaXN0ID49IGRpc3RfbWluKQotICAgICAgICB7Ci0gICAgICAgICAgICBwX2RpY28gKz0gMzsKLSAgICAgICAgICAgIGNvbnRpbnVlOwotICAgICAgICB9Ci0KLSAgICAgICAgdGVtcCAgPSAoYXV4MiAtICgoV29yZDMyKXdmMV8xICogKihwX2RpY28rKykpKSA+PiAxNTsKLSAgICAgICAgZGlzdCArPSAoKFdvcmQzMil0ZW1wICogdGVtcCk7Ci0KLSAgICAgICAgaWYgKGRpc3QgPj0gZGlzdF9taW4pCi0gICAgICAgIHsKLSAgICAgICAgICAgIHBfZGljbyArPSAyOwotICAgICAgICAgICAgY29udGludWU7Ci0gICAgICAgIH0KLQotICAgICAgICB0ZW1wICA9IChhdXgzIC0gKChXb3JkMzIpd2YyXzAgKiAqKHBfZGljbysrKSkpID4+IDE1OwotICAgICAgICBkaXN0ICs9ICgoV29yZDMyKXRlbXAgKiB0ZW1wKTsKLQotICAgICAgICBpZiAoZGlzdCA+PSBkaXN0X21pbikKLSAgICAgICAgewotICAgICAgICAgICAgcF9kaWNvICs9IDE7Ci0gICAgICAgICAgICBjb250aW51ZTsKLSAgICAgICAgfQotCi0gICAgICAgIHRlbXAgID0gKGF1eDQgLSAoKFdvcmQzMil3ZjJfMSAqICoocF9kaWNvKyspKSkgPj4gMTU7Ci0gICAgICAgIGRpc3QgKz0gKChXb3JkMzIpdGVtcCAqIHRlbXApOwotCi0KLSAgICAg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IC0xMjU2LCAtMTA1OSwgLTEzMzEsIC0xMTM0LAotICAgICAgICAtOTgyLCAtMTEzMywgLTExNDksIC0xNTA0LAotICAgICAgICAtMTA4MCwgLTEzMDgsIC0xMDIwLCAtMTE4MywKLSAgICAgICAgLTk4MCwgLTE0ODYsIC05NjcsIC0xNDk1LAotICAgICAgICAtOTg4LCAtOTIyLCAtMTA0NywgLTEwNzcsCi0gICAgICAgIC04MzgsIC0xMTc5LCAtODU4LCAtMTIyMiwKLSAgICAgICAgLTExMzEsIC0xMDQxLCAtMTA2NCwgLTc2NywKLSAgICAgICAgLTg3MiwgLTExNTcsIC03MDEsIC04ODAsCi0gICAgICAgIC03MDYsIC05MDYsIC03NzQsIC0xMDE2LAotICAgICAgICAtNTc4LCAtMTA4MCwgLTgwMSwgLTE0NzgsCi0gICAgICAgIC01OTEsIC0xMTExLCAtNTkyLCAtMTE0NiwKLSAgICAgICAgLTcxMywgLTEzODgsIC02NDAsIC0xMzc2LAotICAgICAgICAtNTk3LCAtMTA1OSwgLTQxNiwgLTkwMywKLSAgICAgICAgLTY4NiwgLTgzMiwgLTY2MSwgLTcwOCwKLSAgICAgICAgLTQ0NCwgLTg2OCwgLTQ5MCwgLTkyMSwKLSAgICAgICAgLTM3NCwgLTc3NiwgLTYxOSwgLTExNzAsCi0gICAgICAgIC01ODUsIC01NDksIC03NjksIC03OTUsCi0gICAgICAgIC00MzUsIC02NTksIC01MzAsIC03NDEsCi0gICAgICAgIC00OTgsIC04MzcsIC0zNTcsIC01OTcsCi0gICAgICAgIC0yNzksIC04NzEsIC0yNDMsIC04ODcsCi0gICAgICAgIC0yODIsIC02NjUsIC0yODAsIC02NjcsCi0gICAgICAgIC0xNjUsIC01NjAsIC0zOTQsIC05MDMsCi0gICAgICAgIC0zNjIsIC00MTAsIC00NDgsIC01ODMsCi0gICAgICAgIC00MDksIC01NzQsIC0zMTMsIC0zNTcsCi0gICAgICAgIC02MzcsIC01NDgsIC01NzAsIC00MzYsCi0gICAgIC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i0gICAgICAgIC03MzgsIC0xMDk0LCAtNzM4LCAtMTE1NCwKLSAgICAgICAgLTc4NCwgLTgwMSwgLTgxMCwgLTc4NiwKLSAgICAgICAgLTg5MiwgLTUyMCwgLTEwMDAsIC04MTgsCi0gICAgICAgIC02NDQsIC05NjUsIC01NzcsIC04ODIsCi0gICAgICAgIC01NDEsIC02OTQsIC02NzEsIC05MTcsCi0gICAgICAgIC01OTUsIC02NDIsIC02NDYsIC02MTUsCi0gICAgICAgIC05NTYsIC02MjEsIC05MjUsIC01MTUsCi0gICAgICAgIC03MjcsIC00ODMsIC04MTUsIC00ODUsCi0gICAgICAgIC04NDAsIC01NzgsIC00NDAsIC03MTMsCi0gICAgICAgIC01NzgsIC0zMjUsIC02NTcsIC02NzAsCi0gICAgICAgIC0zODYsIC01NzAsIC00NDEsIC02NjYsCi0gICAgICAgIC01MTQsIC03ODcsIC0zOTIsIC01MjksCi0gICAgICAgIC01MjIsIC00NTMsIC00ODcsIC00MjMsCi0gICAgICAgIC02MTYsIC01ODUsIC02MTcsIC0xNTcsCi0gICAgICAgIC02NjIsIC0yNjgsIC02ODAsIC0zNDgsCi0gICAgICAgIC0zMjIsIC0zMjMsIC02MzIsIC00NDQsCi0gICAgICAgIC0zMDQsIC00MzAsIC0zMzIsIC00NTgsCi0gICAgICAgIC0yNzcsIC00NjgsIC02NTksIC03OTMsCi0gICAgICAgIC0zMTksIC02MzYsIC0yMjcsIC01NTQsCi0gICAgICAgIC0zNzMsIC0zNDcsIC0zMzQsIC0yMTAsCi0gICAgICAgIC00NTYsIC0xOTIsIC01MzAsIC0yNDIsCi0gICAgICAgIC0yMTYsIC0xOTgsIC0zNjYsIC0zNzAsCi0gICAgICAgIC0zMzgsIC0xNjEsIC00MDksIC03NDgsCi0gICAgICAgIC0xMDcsIC0zODAsIC0yOTQsIC02NDMsCi0gICAgICAgIC0yMjMsIC02NjUsIC0yMzQsIC03NDEsCi0gICAgICAgIC0xNDEsIC00OTYsIC0xMzAsIC01M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Ujc0ICovCi0KLSAgICBjb25zdCBXb3JkMTYgdGFibGVfZ2Fpbl9oaWdocmF0ZXNbVlFfU0laRV9ISUdIUkFURVMqNF0gPQotICAgIHsKLQotICAgICAgICAvKgotICAgICAgICAgKiBOb3RlOiBjb2x1bW4gNCAocXVhX2VuZXIpIGNvbnRhaW5zIHRoZSBvcmlnaW5hbCB2YWx1ZXMgZnJvbSBJUzY0MQotICAgICAgICAgKiAgICAgICB0byBlbnN1cmUgYml0LWV4YWN0bmVzczsgaG93ZXZlciwgdGhleSBhcmUgbm90IGV4YWN0bHkgdGhlCi0gICAgICAgICAqICAgICAgIHJvdW5kZWQgdmFsdWUgb2YgKDIwKmxvZzEwKGdfZmFjKSkKLSAgICAgICAgICoKLSAgICAgICAgICovCi0KLSAgICAgICAgLypnX3BpdCwgICAgZ19mYWMsICBxdWFfZW5lcl9NUjEyMiwgcXVhX2VuZXIgKi8KLSAgICAgICAgNTc3LCAgICAgIDY2MiwgICAgICAgICAgIC0yNjkyLCAgIC0xNjIxNCwKLSAgICAgICAgODA2LCAgICAgMTgzNiwgICAgICAgICAgIC0xMTg1LCAgICAtNzEzNSwKLSAgICAgICAgMzEwOSwgICAgIDEwNTIsICAgICAgICAgICAtMjAwOCwgICAtMTIwODYsCi0gICAgICAgIDQxODEsICAgICAxMzg3LCAgICAgICAgICAgLTE2MDAsICAgIC05NjI5LAotICAgICAgICAyMzczLCAgICAgMTQyNSwgICAgICAgICAgIC0xNTYwLCAgICAtOTM5NCwKLSAgICAgICAgMzI0OCwgICAgIDE5ODUsICAgICAgICAgICAtMTA3MCwgICAgLTY0NDIsCi0gICAgICAgIDE4MjcsICAgICAyMzIwLCAgICAgICAgICAgIC04NDAsICAgIC01MDU2LAotICAgICAgICA5NDEsICAgICAzMzE0LCAgICAgICAgICAgIC0zMTMsICAgIC0xODg1LAotICAgICAgICAyMzUxLCAgICAgMjk3NywgICAgICAgICAgICAtNDcxLCAgICAtMjgzOCwKLSAgICAgICAgMzYxNiwgICAgIDI0MjAsICAgICAgICAgICAgLTc3NywgICAgLTQ2ODEsCi0gICAgICAgIDM0NTEsICAgICAzMDk2LCAgICAgICAgICAgIC00MTQsICAgIC0yNDkwLAotICAgICAgICAyOTU1LCAgICAgNDMwMSwgICAgICAgICAgICAgIDcyLCAgICAgIDQzNCwKLSAgICAgICAgMTg0OCwgICAgIDQ1MDAsICAgICAgICAgICAgIDEzOSwgICAgICA4MzYsCi0gICAgICAgIDM4ODQsICAgICA1NDE2LCAgICAgICAgICAgICA0MTMsICAgICAyNDg0LAotICAgICAgICAxMTg3LCAgICAgNzIxMCwgICAgICAgICAgICAgODM1LCAgICAgNTAzMCwKLSAgICAgICAgMzA4MywgICAgIDkwMDAsICAgICAgICAgICAgMTE2MywgICAgIDcwMDIsCi0gICAgICAgIDczODQsICAgICAgODgzLCAgICAgICAgICAgLTIyNjcsICAgLTEzNjQ3LAotICAgICAgICA1OTYyLCAgICAgMTUwNiwgICAgICAgICAgIC0xNDc4LCAgICAtODkwMCwKLSAgICAgICAgNTE1NSwgICAgIDIxMzQsICAgICAgICAgICAgLTk2MywgICAgLTU4MDAsCi0gICAgICAgIDc5NDQsICAgICAyMDA5LCAgICAgICAgICAgLTEwNTIsICAgIC02MzM1LAotICAgICAgICA2NTA3LCAgICAgMjI1MCwgICAgICAgICAgICAtODg1LCAgICAtNTMyNywKLSAgICAgICAgNzY3MCwgICAgIDI3NTIsICAgICAgICAgICAgLTU4OCwgICAgLTM1MzcsCi0gICAgICAgIDU5NTIsICAgICAzMDE2LCAgICAgICAgICAgIC00NTIsICAgIC0yNzI0LAotICAgICAgICA0ODk4LCAgICAgMzc2NCwgICAgICAgICAgICAtMTI1LCAgICAgLTc1MSwKLSAgICAgICAgNjk4OSwgICAgIDM1ODgsICAgICAgICAgICAgLTE5NiwgICAgLTExNzcsCi0gICAgICAgIDgxNzQsICAgICAzOTc4LCAgICAgICAgICAgICAtNDMsICAgICAtMjYwLAotICAgICAgICA2MDY0LCAgICAgNDQwNCwgICAgICAgICAgICAgMTA3LCAgICAgIDY0NSwKLSAgICAgICAgNzcwOSwgICAgIDUwODcsICAgICAgICAgICAgIDMyMCwgICAgIDE5MjgsCi0gICAgICAgIDU1MjMsICAgICA2MDIxLCAgICAgICAgICAgICA1NjksICAgICAzNDI2LAotICAgICAgICA3NzY5LCAgICAgNzEyNiwgICAgICAgICAgICAgODE4LCAgICAgNDkyNiwKLSAgICAgICAgNjA2MCwgICAgIDc5MzgsICAgICAgICAgICAgIDk3NywgICAgIDU4ODUsCi0gICAgICAgIDU1OTQsICAgIDExNDg3LCAgICAgICAgICAgIDE1MjMsICAgICA5MTcyLAotICAgICAgICAxMDU4MSwgICAgIDEzNTYsICAgICAgICAgICAtMTYzMywgICAgLTk4MzEsCi0gICAgICAgIDkwNDksICAgICAxNTk3LCAgICAgICAgICAgLTEzOTEsICAgIC04MzgwLAotICAgICAgICA5Nzk0LCAgICAgMjAzNSwgICAgICAgICAgIC0xMDMzLCAgICAtNjIyMCwKLSAgICAgICAgODk0NiwgICAgIDI0MTUsICAgICAgICAgICAgLTc4MCwgICAgLTQ3MDAsCi0gICAgICAgIDEwMjk2LCAgICAgMjU4NCwgICAgICAgICAgICAtNjgxLCAgICAtNDA5OSwKLSAgICAgICAgOTQwNywgICAgIDI3MzQsICAgICAgICAgICAgLTU5NywgICAgLTM1OTUsCi0gICAgICAgIDg3MDAsICAgICAzMjE4LCAgICAgICAgICAgIC0zNTYsICAgIC0yMTQ0LAotICAgICAgICA5NzU3LCAgICAgMzM5NSwgICAgICAgICAgICAtMjc3LCAgICAtMTY2OSwKLSAgICAgICAgMTAxNzcsICAgICAzODkyLCAgICAgICAgICAgICAtNzUsICAgICAtNDU0LAotICAgICAgICA5MTcwLCAgICAgNDUyOCwgICAgICAgICAgICAgMTQ4LCAgICAgIDg5MSwKLSAgICAgICAgMTAxNTIsICAgICA1MDA0LCAgICAgICAgICAgICAyOTYsICAgICAxNzgxLAotICAgICAgICA5MTE0LCAgICAgNTczNSwgICAgICAgICAgICAgNDk3LCAgICAgMjk5MywKLSAgICAgICAgMTA1MDAsICAgICA2MjY2LCAgICAgICAgICAgICA2MjgsICAgICAzNzgyLAotICAgICAgICAxMDExMCwgICAgIDc2MzEsICAgICAgICAgICAgIDkxOSwgICAgIDU1MzQsCi0gICAgICAgIDg4NDQsICAgICA4NzI3LCAgICAgICAgICAgIDExMTcsICAgICA2NzI4LAotICAgICAgICA4OTU2LCAgICAxMjQ5NiwgICAgICAgICAgICAxNjQ4LCAgICAgOTkyMSwKLSAgICAgICAgMTI5MjQsICAgICAgOTc2LCAgICAgICAgICAgLTIxMTksICAgLTEyNzUzLAotICAgICAgICAxMTQzNSwgICAgIDE3NTUsICAgICAgICAgICAtMTI1MiwgICAgLTc1MzksCi0gICAgICAgIDEyMTM4LCAgICAgMjMyOCwgICAgICAgICAgICAtODM1LCAgICAtNTAyNCwKLSAgICAgICAgMTEzODgsICAgICAyMzY4LCAgICAgICAgICAgIC04MTAsICAgIC00ODcyLAotICAgICAgICAxMDcwMCwgICAgIDMwNjQsICAgICAgICAgICAgLTQyOSwgICAgLTI1ODAsCi0gICAgICAgIDEyMzMyLCAgICAgMjg2MSwgICAgICAgICAgICAtNTMwLCAgICAtMzE5MiwKLSAgICAgICAgMTE3MjIsICAgICAzMzI3LCAgICAgICAgICAgIC0zMDcsICAgIC0xODQ4LAotICAgICAgICAxMTI3MCwgICAgIDM3MDAsICAgICAgICAgICAgLTE1MCwgICAgIC05MDQsCi0gICAgICAgIDEwODYxLCAgICAgNDQxMywgICAgICAgICAgICAgMTEwLCAgICAgIDY2MywKLSAgICAgICAgMTIwODIsICAgICA0NTMzLCAgICAgICAgICAgICAxNTAsICAgICAgOTAyLAotICAgICAgICAxMTI4MywgICAgIDUyMDUsICAgICAgICAgICAgIDM1NCwgICAgIDIxMzIsCi0gICAgICAgIDExOTYwLCAgICAgNjMwNSwgICAgICAgICAgICAgNjM3LCAgICAgMzgzNywKLSAgICAgICAgMTExNjcsICAgICA3NTM0LCAgICAgICAgICAgICA5MDAsICAgICA1NDIwLAotICAgICAgICAxMjEyOCwgICAgIDgzMjksICAgICAgICAgICAgMTA0OSwgICAgIDYzMTIsCi0gICAgICAgIDEwOTY5LCAgICAxMDc3NywgICAgICAgICAgICAxNDI5LCAgICAgODYwNCwKLSAgICAgICAgMTAzMDAsICAgIDE3Mzc2LCAgICAgICAgICAgIDIxMzUsICAgIDEyODUzLAotICAgICAgICAxMzg5OSwgICAgIDE2ODEsICAgICAgICAgICAtMTMxNiwgICAgLTc5MjEsCi0gICAgICAgIDEyNTgwLCAgICAgMjA0NSwgICAgICAgICAgIC0xMDI2LCAgICAtNjE3OSwKLSAgICAgICAgMTMyNjUsICAgICAyNDM5LCAgICAgICAgICAgIC03NjYsICAgIC00NjEwLAotICAgICAgICAxNDAzMywgICAgIDI5ODksICAgICAgICAgICAgLTQ2NSwgICAgLTI4MDIsCi0gICAgICAgIDEzNDUyLCAgICAgMzA5OCwgICAgICAgICAgICAtNDEzLCAgICAtMjQ4MiwKLSAgICAgICAgMTIzOTYsICAgICAzNjU4LCAgICAgICAgICAgIC0xNjcsICAgIC0xMDA2LAotICAgICAgICAxMzUxMCwgICAgIDM3ODAsICAgICAgICAgICAgLTExOSwgICAgIC03MTMsCi0gICAgICAgIDEyODgwLCAgICAgNDI3MiwgICAgICAgICAgICAgIDYyLCAgICAgIDM3NCwKLSAgICAgICAgMTM1MzMsICAgICA0ODYxLCAgICAgICAgICAgICAyNTMsICAgICAxNTIzLAotICAgICAgICAxMjY2NywgICAgIDU0NTcsICAgICAgICAgICAgIDQyNCwgICAgIDI1NTIsCi0gICAgICAgIDEzODU0LCAgICAgNjEwNiwgICAgICAgICAgICAgNTkwLCAgICAgMzU1MSwKLSAgICAgICAgMTMwMzEsICAgICA2NDgzLCAgICAgICAgICAgICA2NzgsICAgICA0MDg0LAotICAgICAgICAxMzU1NywgICAgIDc3MjEsICAgICAgICAgICAgIDkzNywgICAgIDU2MzksCi0gICAgICAgIDEyOTU3LCAgICAgOTMxMSwgICAgICAgICAgICAxMjEzLCAgICAgNzMwNCwKLSAgICAgICAgMTM3MTQsICAgIDExNTUxLCAgICAgICAgICAgIDE1MzIsICAgICA5MjIxLAotICAgICAgICAxMjU5MSwgICAgMTUyMDYsICAgICAgICAgICAgMTkzOCwgICAgMTE2NjcsCi0gICAgICAgIDE1MTEzLCAgICAgMTU0MCwgICAgICAgICAgIC0xNDQ1LCAgICAtODcwMCwKLSAgICAgICAgMTUwNzIsICAgICAyMzMzLCAgICAgICAgICAgIC04MzIsICAgIC01MDA3LAotICAgICAgICAxNDUyNywgICAgIDI1MTEsICAgICAgICAgICAgLTcyMywgICAgLTQzNTIsCi0gICAgICAgIDE0NjkyLCAgICAgMzE5OSwgICAgICAgICAgICAtMzY1LCAgICAtMjE5NywKLSAgICAgICAgMTUzODIsICAgICAzNTYwLCAgICAgICAgICAgIC0yMDcsICAgIC0xMjQ3LAotICAgICAgICAxNDEzMywgICAgIDM5NjAsICAgICAgICAgICAgIC01MCwgICAgIC0zMDAsCi0gICAgICAgIDE1MTAyLCAgICAgNDIzNiwgICAgICAgICAgICAgIDUwLCAgICAgIDI5OCwKLSAgICAgICAgMTQzMzIsICAgICA0ODI0LCAgICAgICAgICAgICAyNDIsICAgICAxNDU0LAotICAgICAgICAxNDg0NiwgICAgIDU0NTEsICAgICAgICAgICAgIDQyMiwgICAgIDI1NDIsCi0gICAgICAgIDE1MzA2LCAgICAgNjA4MywgICAgICAgICAgICAgNTg0LCAgICAgMzUxOCwKLSAgICAgICAgMTQzMjksICAgICA2ODg4LCAgICAgICAgICAgICA3NjgsICAgICA0NjIzLAotICAgICAgICAxNTA2MCwgICAgIDc2ODksICAgICAgICAgICAgIDkzMCwgICAgIDU2MDIsCi0gICAgICAgIDE0NDA2LCAgICAgOTQyNiwgICAgICAgICAgICAxMjMxLCAgICAgNzQxMywKLSAgICAgICAgMTUzODcsICAgICA5NzQxLCAgICAgICAgICAgIDEyODAsICAgICA3NzA2LAotICAgICAgICAxNDgyNCwgICAgMTQyNzEsICAgICAgICAgICAgMTg0NCwgICAgMTExMDIsCi0gICAgICAgIDEzNjAwLCAgICAyNDkzOSwgICAgICAgICAgICAyNjY5LCAgICAxNjA2NywKLSAgICAgICAgMTYzOTYsICAgICAxOTY5LCAgICAgICAgICAgLTEwODIsICAgIC02NTE3LAotICAgICAgICAxNjgxNywgICAgIDI4MzIsICAgICAgICAgICAgLTU0NSwgICAgLTMyODMsCi0gICAgICAgIDE1NzEzLCAgICAgMjg0MywgICAgICAgICAgICAtNTM5LCAgICAtMzI0OCwKLSAgICAgICAgMTYxMDQsICAgICAzMzM2LCAgICAgICAgICAgIC0zMDMsICAgIC0xODI1LAotICAgICAgICAxNjM4NCwgICAgIDM5NjMsICAgICAgICAgICAgIC00OSwgICAgIC0yOTQsCi0gICAgICAgIDE2OTQwLCAgICAgNDU3OSwgICAgICAgICAgICAgMTY1LCAgICAgIDk5MiwKLSAgICAgICAgMTU3MTEsICAgICA0NTk5LCAgICAgICAgICAgICAxNzEsICAgICAxMDMwLAotICAgICAgICAxNjIyMiwgICAgIDU0NDgsICAgICAgICAgICAgIDQyMSwgICAgIDI1MzcsCi0gICAgICAgIDE2ODMyLCAgICAgNjM4MiwgICAgICAgICAgICAgNjU1LCAgICAgMzk0NSwKLSAgICAgICAgMTU3NDUsICAgICA3MTQxLCAgICAgICAgICAgICA4MjEsICAgICA0OTQ0LAotICAgICAgICAxNjMyNiwgICAgIDc0NjksICAgICAgICAgICAgIDg4OCwgICAgIDUzNDMsCi0gICAgICAgIDE2NjExLCAgICAgODYyNCwgICAgICAgICAgICAxMTAwLCAgICAgNjYyMiwKLSAgICAgICAgMTcwMjgsICAgIDEwNDE4LCAgICAgICAgICAgIDEzNzksICAgICA4MzAzLAotICAgICAgICAxNTkwNSwgICAgMTE4MTcsICAgICAgICAgICAgMTU2NSwgICAgIDk0MjMsCi0gICAgICAgIDE2ODc4LCAgICAxNDY5MCwgICAgICAgICAgICAxODg3LCAgICAxMTM2MCwKLSAgICAgICAgMTY1MTUsICAgIDIwODcwLCAgICAgICAgICAgIDI0MDYsICAgIDE0NDgzLAotICAgICAgICAxODE0MiwgICAgIDIwODMsICAgICAgICAgICAgLTk5OSwgICAgLTYwMTMsCi0gICAgICAgIDE5NDAxLCAgICAgMzE3OCwgICAgICAgICAgICAtMzc1LCAgICAtMjI1NywKLSAgICAgICAgMTc1MDgsICAgICAzNDI2LCAgICAgICAgICAgIC0yNjQsICAgIC0xNTg5LAotICAgICAgICAyMDA1NCwgICAgIDQwMjcsICAgICAgICAgICAgIC0yNSwgICAgIC0xNTEsCi0gICAgICAgIDE4MDY5LCAgICAgNDI0OSwgICAgICAgICAgICAgIDU0LCAgICAgIDMyNiwKLSAgICAgICAgMTg5NTIsICAgICA1MDY2LCAgICAgICAgICAgICAzMTQsICAgICAxODkwLAotICAgICAgICAxNzcxMSwgICAgIDU0MDIsICAgICAgICAgICAgIDQwOSwgICAgIDI0NjEsCi0gICAgICAgIDE5ODM1LCAgICAgNjE5MiwgICAgICAgICAgICAgNjEwLCAgICAgMzY3NiwKLSAgICAgICAgMTc5NTAsICAgICA3MDE0LCAgICAgICAgICAgICA3OTUsICAgICA0Nzg0LAotICAgICAgICAyMTMxOCwgICAgIDc4NzcsICAgICAgICAgICAgIDk2NiwgICAgIDU4MTYsCi0gICAgICAgIDE3OTEwLCAgICAgOTI4OSwgICAgICAgICAgICAxMjEwLCAgICAgNzI4MywKLSAgICAgICAgMTkxNDQsICAgICA5MjkwLCAgICAgICAgICAgIDEyMTAsICAgICA3Mjg0LAotICAgICAgICAyMDUxNywgICAgMTEzODEsICAgICAgICAgICAgMTUxMCwgICAgIDkwODksCi0gICAgICAgIDE4MDc1LCAgICAxNDQ4NSwgICAgICAgICAgICAxODY2LCAgICAxMTIzNCwKLSAgICAgICAgMTk5OTksICAgIDE3ODgyLCAgICAgICAgICAgIDIxNzcsICAgIDEzMTA4LAotICAgICAgICAxODg0MiwgICAgMzI3NjQsICAgICAgICAgICAgMzA3MiwgICAgMTg0OTQKLSAgICB9OwotCi0KLSAgICAvKiB0YWJsZSB1c2VkIGluICdsb3cnIHJhdGVzOiBNUjQ3NSwgTVI1MTUsIE1SNTkgKi8KLQotICAgIGNvbnN0IFdvcmQxNiB0YWJsZV9nYWluX2xvd3JhdGVzW1ZRX1NJWkVfTE9XUkFURVMqNF0gPQotICAgIHsKLSAgICAgICAgLypnX3BpdCwgICAgZ19mYWMsICBxdWFfZW5lcl9NUjEyMiwgcXVhX2VuZXIgKi8KLSAgICAgICAgMTA4MTMsICAgIDI4NzUzLCAgICAgICAgICAgIDI4NzksICAgIDE3MzMzLAotICAgICAgICAyMDQ4MCwgICAgIDI3ODUsICAgICAgICAgICAgLTU3MCwgICAgLTM0MzEsCi0gICAgICAgIDE4ODQxLCAgICAgNjU5NCwgICAgICAgICAgICAgNzAzLCAgICAgNDIzNSwKLSAgICAgICAgNjIyNSwgICAgIDc0MTMsICAgICAgICAgICAgIDg3NiwgICAgIDUyNzYsCi0gICAgICAgIDE3MjAzLCAgICAxMDQ0NCwgICAgICAgICAgICAxMzgzLCAgICAgODMyNSwKLSAgICAgICAgMjE2MjYsICAgICAxMjY5LCAgICAgICAgICAgLTE3MzEsICAgLTEwNDIyLAotICAgICAgICAyMTEzNSwgICAgIDQ0MjMsICAgICAgICAgICAgIDExMywgICAgICA2ODMsCi0gICAgICAgIDExMzA0LCAgICAgMTU1NiwgICAgICAgICAgIC0xNDMwLCAgICAtODYwOSwKLSAgICAgICAgMTkwMDUsICAgIDEyODIwLCAgICAgICAgICAgIDE2ODYsICAgIDEwMTQ4LAotICAgICAgICAxNzM2NywgICAgIDI0OTgsICAgICAgICAgICAgLTczMSwgICAgLTQzOTgsCi0gICAgICAgIDE3ODU4LCAgICAgNDgzMywgICAgICAgICAgICAgMjQ0LCAgICAgMTQ3MiwKLSAgICAgICAgOTk5NCwgICAgIDI0OTgsICAgICAgICAgICAgLTczMSwgICAgLTQzOTgsCi0gICAgICAgIDE3NTMwLCAgICAgNzg2NCwgICAgICAgICAgICAgOTY0LCAgICAgNTgwMiwKLSAgICAgICAgMTQyNTQsICAgICAxODg0LCAgICAgICAgICAgLTExNDcsICAgIC02OTA3LAotICAgICAgICAxNTg5MiwgICAgIDMxNTMsICAgICAgICAgICAgLTM4NywgICAgLTIzMjcsCi0gICAgICAgIDY3MTcsICAgICAxODAyLCAgICAgICAgICAgLTEyMTMsICAgIC03MzAzLAotICAgICAgICAxODE4NiwgICAgMjAxOTMsICAgICAgICAgICAgMjM1NywgICAgMTQxODksCi0gICAgICAgIDE4MDIyLCAgICAgMzAzMSwgICAgICAgICAgICAtNDQ1LCAgICAtMjY3OCwKLSAgICAgICAgMTY3MTEsICAgICA1ODU3LCAgICAgICAgICAgICA1MjgsICAgICAzMTgxLAotICAgICAgICA4ODQ3LCAgICAgNDAxNCwgICAgICAgICAgICAgLTMwLCAgICAgLTE4MCwKLSAgICAgICAgMTU4OTIsICAgICA4OTcwLCAgICAgICAgICAgIDExNTgsICAgICA2OTcyLAotICAgICAgICAxODAyMiwgICAgIDEzOTIsICAgICAgICAgICAtMTU5NCwgICAgLTk1OTksCi0gICAgICAgIDE2NzExLCAgICAgNDA5NiwgICAgICAgICAgICAgICAwLCAgICAgICAgMCwKLSAgICAgICAgODE5MiwgICAgICA2NTUsICAgICAgICAgICAtMjcwOCwgICAtMTYzMDUsCi0gICAgICAgIDE1MjM3LCAgICAxMzkyNiwgICAgICAgICAgICAxODA4LCAgICAxMDg4NCwKLSAgICAgICAgMTQyNTQsICAgICAzMTEyLCAgICAgICAgICAgIC00MDYsICAgIC0yNDQ0LAotICAgICAgICAxNDA5MCwgICAgIDQ2NjksICAgICAgICAgICAgIDE5MywgICAgIDExNjUsCi0gICAgICAgIDU0MDYsICAgICAyNzAzLCAgICAgICAgICAgIC02MTQsICAgIC0zNjk3LAotICAgICAgICAxMzQzNCwgICAgIDY1NTMsICAgICAgICAgICAgIDY5NCwgICAgIDQxODAsCi0gICAgICAgIDEyNDUxLCAgICAgIDkwMSwgICAgICAgICAgIC0yMjM3LCAgIC0xMzQ2OCwKLSAgICAgICAgMTI0NTEsICAgICAyNjYyLCAgICAgICAgICAgIC02MzcsICAgIC0zODMzLAotICAgICAgICAzNzY4LCAgICAgIDY1NSwgICAgICAgICAgIC0yNzA4LCAgIC0xNjMwNSwKLSAgICAgICAgMTQ3NDUsICAgIDIzNTExLCAgICAgICAgICAgIDI1ODIsICAgIDE1NTQzLAotICAgICAgICAxOTE2OSwgICAgIDI0NTcsICAgICAgICAgICAgLTc1NSwgICAgLTQ1NDYsCi0gICAgICAgIDIwMTUyLCAgICAgNTA3OSwgICAgICAgICAgICAgMzE4LCAgICAgMTkxMywKLSAgICAgICAgNjg4MSwgICAgIDQwOTYsICAgICAgICAgICAgICAgMCwgICAgICAgIDAsCi0gICAgICAgIDIwNDgwLCAgICAgODU2MCwgICAgICAgICAgICAxMDg5LCAgICAgNjU1NiwKLSAgICAgICAgMTk2NjAsICAgICAgNzM3LCAgICAgICAgICAgLTI1MzQsICAgLTE1MjU1LAotICAgICAgICAxOTAwNSwgICAgIDQyNTksICAgICAgICAgICAgICA1OCwgICAgICAzNDcsCi0gICAgICAgIDc4NjQsICAgICAyMDg4LCAgICAgICAgICAgIC05OTUsICAgIC01OTkzLAotICAgICAgICAxMTQ2OCwgICAgMTIyODgsICAgICAgICAgICAgMTYyMywgICAgIDk3NzEsCi0gICAgICAgIDE1ODkyLCAgICAgMTQ3NCwgICAgICAgICAgIC0xNTEwLCAgICAtOTA5MCwKLSAgICAgICAgMTU3MjgsICAgICA0NjI4LCAgICAgICAgICAgICAxODAsICAgICAxMDg2LAotICAgICAgICA5MTc1LCAgICAgMTQzMywgICAgICAgICAgIC0xNTUyLCAgICAtOTM0MSwKLSAgICAgICAgMTYwNTYsICAgICA3MDA0LCAgICAgICAgICAgICA3OTMsICAgICA0NzcyLAotICAgICAgICAxNDgyNywgICAgICA3MzcsICAgICAgICAgICAtMjUzNCwgICAtMTUyNTUsCi0gICAgICAgIDE1MDczLCAgICAgMjI1MiwgICAgICAgICAgICAtODg0LCAgICAtNTMyMSwKLSAgICAgICAgNTA3OSwgICAgIDEyMjgsICAgICAgICAgICAtMTc4MCwgICAtMTA3MTQsCi0gICAgICAgIDEzMjcxLCAgICAxNzMyNiwgICAgICAgICAgICAyMTMxLCAgICAxMjgyNywKLSAgICAgICAgMTY1NDcsICAgICAyMzM0LCAgICAgICAgICAgIC04MzEsICAgIC01MDAyLAotICAgICAgICAxNTA3MywgICAgIDU4MTYsICAgICAgICAgICAgIDUxOCwgICAgIDMxMTgsCi0gICAgICAgIDM5MzIsICAgICAzNjg2LCAgICAgICAgICAgIC0xNTYsICAgICAtOTM4LAotICAgICAgICAxNDI1NCwgICAgIDg2MDEsICAgICAgICAgICAgMTA5NiwgICAgIDY1OTgsCi0gICAgICAgIDE2ODc1LCAgICAgIDc3OCwgICAgICAgICAgIC0yNDU0LCAgIC0xNDc3NCwKLSAgICAgICAgMTUwNzMsICAgICAzODA5LCAgICAgICAgICAgIC0xMDcsICAgICAtNjQ2LAotICAgICAgICA2MDYyLCAgICAgIDYxNCwgICAgICAgICAgIC0yODA0LCAgIC0xNjg3OSwKLSAgICAgICAgOTMzOCwgICAgIDkyNTYsICAgICAgICAgICAgMTIwNCwgICAgIDcyNTEsCi0gICAgICAgIDEzMjcxLCAgICAgMTc2MSwgICAgICAgICAgIC0xMjQ3LCAgICAtNzUwOCwKLSAgICAgICAgMTMyNzEsICAgICAzNTIyLCAgICAgICAgICAgIC0yMjMsICAgIC0xMzQzLAotICAgICAgICAyNDU3LCAgICAgMTk2NiwgICAgICAgICAgIC0xMDg0LCAgICAtNjUyOSwKLSAgICAgICAgMTE0NjgsICAgICA1NTI5LCAgICAgICAgICAgICA0NDMsICAgICAyNjY4LAotICAgICAgICAxMDQ4NSwgICAgICA3MzcsICAgICAgICAgICAtMjUzNCwgICAtMTUyNTUsCi0gICAgICAgIDExNjMyLCAgICAgMzE5NCwgICAgICAgIC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NiAqcF9pbnB1dF9wdHIgICAgPSAmaW5wdXRfcHRyW2lucHV0X2xlbi0xLU1dOwotCi0gICAgZm9yIChpID0gaW5wdXRfbGVuID4+IDI7IGkgIT0gMDsgaS0tKQotICAgIHsKLSAgICAgICAgczEgICAgICAgPSAweDAwMDA4MDBMOwotICAgICAgICBzMiAgICAgICA9IDB4MDAwMDgwMEw7Ci0gICAgICAgIHMzICAgICAgID0gMHgwMDAwODAwTDsKLSAgICAgICAgczQgICAgICAgPSAweDAwMDA4MDBMOwotICAgICAgICBwX2NvZWYgID0gJmNvZWZfcHRyW01dOwotICAgICAgICBwX2lucHV0MSA9IHBfaW5wdXRfcHRyLS07Ci0gICAgICAgIHBfaW5wdXQyID0gcF9pbnB1dF9wdHItLTsKLSAgICAgICAgcF9pbnB1dDMgPSBwX2lucHV0X3B0ci0tOwotICAgICAgICBwX2lucHV0NCA9IHBfaW5wdXRfcHRyLS07Ci0KLSAgICAgICAgZm9yIChqID0gTSA+PiAxOyBqICE9IDA7IGotLSkKLSAgICAgICAgewotICAgICAgICAgICAgczEgKz0gKChXb3JkMzIpICogKHBfY29lZikgKiAqKHBfaW5wdXQxKyspKTsKLSAgICAgICAgICAgIHMyICs9ICgoV29yZDMyKSAqIChwX2NvZWYpICogKihwX2lucHV0MisrKSk7Ci0gICAgICAgICAgICBzMyArPSAoKFdvcmQzMikgKiAocF9jb2VmKSAqICoocF9pbnB1dDMrKykpOwotICAgICAgICAgICAgczQgKz0gKChXb3JkMzIpICogKHBfY29lZi0tKSAqICoocF9pbnB1dDQrKykpOwotICAgICAgICAgICAgczEgKz0gKChXb3JkMzIpICogKHBfY29lZikgKiAqKHBfaW5wdXQxKyspKTsKLSAgICAgICAgICAgIHMyICs9ICgoV29yZDMyKSAqIChwX2NvZWYpICogKihwX2lucHV0MisrKSk7Ci0gICAgICAgICAgICBzMyArPSAoKFdvcmQzMikgKiAocF9jb2VmKSAqICoocF9pbnB1dDMrKykpOwotICAgICAgICAgICAgczQgKz0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i0vKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgotUG9ydGlvbnMgb2YgdGhpcyBmaWxlIGFyZSBkZXJpdmVkIGZyb20gdGhlIGZvbGxvd2luZyAzR1BQIHN0YW5kYXJkOgotCi0gICAgM0dQUCBUUyAyNi4wNzMKLSAgICBBTlNJLUMgY29kZSBmb3IgdGhlIEFkYXB0aXZlIE11bHRpLVJhdGUgKEFNUikgc3BlZWNoIGNvZGVjCi0gICAgQXZhaWxhYmxlIGZyb20gaHR0cDovL3d3dy4zZ3BwLm9yZwotCi0oQykgMjAwNCwgM0dQUCBPcmdhbml6YXRpb25hbCBQYXJ0bmVycyAoQVJJQiwgQVRJUywgQ0NTQSwgRVRTSSwgVFRBLCBUVEMpCi1QZXJtaXNzaW9uIHRvIGRpc3RyaWJ1dGUsIG1vZGlmeSBhbmQgdXNlIHRoaXMgZmlsZSB1bmRlciB0aGUgc3RhbmRhcmQgbGljZW5zZQotdGVybXMgbGlzdGVkIGFib3ZlIGhhcyBiZWVuIG9idGFpbmVkIGZyb20gdGhlIGNvcHlyaWdodCBob2xkZXIuCi0qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotLyoKLSoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCi0qICAgICAgR1NNIEFNUi1OQiBzcGVlY2ggY29kZWMgICBSOTggICBWZXJzaW9uIDcuNS4wICAgTWFyY2ggMiwgMjAwMQotKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgUjk5ICAgVmVyc2lvbiAzLjIuMAotKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgUkVMLTQgVmVyc2lvbiA0LjAuMAotKgotKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKLSoKLSogICAgICBGaWxlICAgICAgICAgICAgIDogc2V0X3plcm8uaAotKgotKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKLSovCi0vKgotKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKLSogICAgICAgICAgICAgICAgICAgICAgICAgTU9EVUxFIElOQ0xVREUgRklMRSBBTkQgVkVSU0lPTiBJRAotKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKLSovCi0jaW5jbHVkZSAic2V0X3plcm8uaCIKLQotLyoKLSoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCi0qICAgICAgICAgICAgICAgICAgICAgICAgIElOQ0xVREUgRklMRVMKLSoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCi0qLwotI2luY2x1ZGUgInR5cGVkZWYuaCIKLSNpbmNsdWRlICJiYXNpY19vcC5oIgotCi0vKgotKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKLSogICAgICAgICAgICAgICAgICAgICAgICAgUFVCTElDIFBST0dSQU0gQ09ERQotKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKLSovCi12b2lkIFNldF96ZXJvKAotICAgIFdvcmQxNiB4W10s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AgICAgICAgIGlmICh2YXIxIDwgMCkKLSAgICAgICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgICAgIHJlc3VsdCA9ICh+KCh+dmFyMSkgPj4gdmFyMikpOwotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICBlbHNlCi0gICAgICAgICAgICAgICAgewotICAgICAgICAgICAgICAgICAgICByZXN1bHQgPSAodmFyMSA+PiB2YXIyKTsKLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICB9Ci0gICAgICAgIH0KLSAgICAgICAgZWxzZQotICAgICAgICB7Ci0gICAgICAgICAgICBpZiAodmFyMiA8IC0xNikKLSAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICB2YXIyID0gLTE2OwotICAgICAgICAgICAgfQotCi0gICAgICAgICAgICB2YXIyID0gLXZhcjI7ICAgLyogU2hpZnQgcmlnaHQgbmVnYXRpdmUgaXMgZXF1aXZhbGVudCAqLwotICAgICAgICAgICAgLyogICB0byBzaGlmdGluZyBsZWZ0IHBvc2l0aXZlLiAgICAgICAqLwotCi0gICAgICAgICAgICB0ZW1wX3JlcyA9ICgoV29yZDMyKSB2YXIxKSA8PCB2YXIyOwotICAgICAgICAgICAgcmVzdWx0ID0gKFdvcmQxNikodGVtcF9yZXMpOwotCi0gICAgICAgICAgICBpZiAodGVtcF9yZXMgIT0gKFdvcmQzMikgcmVzdWx0KQotICAgICAgICAgICAgewotICAgICAgICAgICAgICAgICpwT3ZlcmZsb3cgPSAxOwotICAgICAgICAgICAgICAgIHJlc3VsdCA9ICgodmFyMSA+IDApID8gTUFYXzE2IDogTUlOXzE2KTsKLSAgICAgICAgICAgIH0KLSAgICAgICAgfQotCi0gICAgfQotICAgIGVsc2UKLSAgICB7Ci0gICAgICAgIHJlc3VsdCA9IHZhcjE7Ci0gICAgfQotCi0gICAgcmV0dXJuIChyZXN1bHQpOwotfQotCmRpZmYgLS1naXQgYS9tZWRpYS9saWJzdGFnZWZyaWdodC9jb2RlY3M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gV29yZDE2IGE7Ci0gICAgV29yZDE2IHRtcDsKLSAgICBXb3JkMzIgTF95OwotCi0gICAgLyoKLSAgICAgICAgICB5ID0gc3FydCh4KQotICAgICAgICAgIHggPSBmICogMl4tZSwgICAwLjUgPD0gZiA8IDEgICAobm9ybWFsaXphdGlvbikKLSAgICAgICAgICB5ID0gc3FydChmKSAqIDJeKC1lLzIpCi0gICAgICAgICAgYSkgZSA9IDJrICAgLS0+IHkgPSBzcXJ0KGYpICAgKiAyXi1rICAoayA9IGUgZGl2IDIsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMC43MDcgPD0gc3FydChmKSA8IDEpCi0gICAgICAgICAgYikgZSA9IDJrKzEgLS0+IHkgPSBzcXJ0KGYvMikgKiAyXi1rICAoayA9IGUgZGl2IDIsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMC41IDw9IHNxcnQoZi8yKSA8IDAuNzA3KQotICAgICAqLwotCi0gICAgaWYgKExfeCA8PSAoV29yZDMyKSAwKQotICAgIHsKLSAgICAgICAgKnBFeHAgPSAwOwotICAgICAgICByZXR1cm4gKFdvcmQzMikgMDsKLSAgICB9Ci0KLSAgICBlID0gbm9ybV9sKExfeCkgJiAweEZGRkU7ICAgICAgICAgICAgICAgLyogZ2V0IG5leHQgbG93ZXIgRVZFTiBub3JtLiBleHAgICovCi0gICAgTF94ID0gTF9zaGwoTF94LCBlLCBwT3ZlcmZsb3cpOyAgICAgICAgIC8qIExfeCBpcyBub3JtYWxpemVkIHRvIFswLjI1Li4xKSAqLwotICAgICpwRXhwID0gZTsgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvKiByZXR1cm4gMipleHBvbmVudCAob3IgUTEpICAgICAgKi8KLQotICAgIExfeCA+Pj0gMTA7Ci0gICAgaSA9IChXb3JkMTYpKExfeCA+PiAxNSkgJiA2MzsgICAgICAgICAgICAvKiBFeHRyYWN0IGIyNS1iM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cm5iX2Z4cF9tYWNfMTZfYnlfMTZiYigoV29yZDMyKSAqIChwX3grKyksIChXb3JkMzIpICogKHBfYSsrKSwgMHgwMDAwMDgwMEwpOwotICAgICAgICBzMSA9IGFtcm5iX2Z4cF9tc3VfMTZfYnlfMTZiYigoV29yZDMyKSAqIChwX2ErKyksIChXb3JkMzIpICogKHBfeXkxKSwgczEpOwotCi0gICAgICAgIGZvciAoaiA9IChNID4+IDEpIC0gMjsgaiAhPSAwOyBqLS0pCi0gICAgICAgIHsKLSAgICAgICAgICAgIHMyID0gYW1ybmJfZnhwX21zdV8xNl9ieV8xNmJiKChXb3JkMzIpICogKHBfYSksIChXb3JkMzIpICogKHBfeXkxLS0pLCBzMik7Ci0gICAgICAgICAgICBzMSA9IGFtcm5iX2Z4cF9tc3VfMTZfYnlfMTZiYigoV29yZDMyKSAqIChwX2ErKyksIChXb3JkMzIpICogKHBfeXkxKSwgczEpOwotICAgICAgICAgICAgczIgPSBhbXJuYl9meHBfbXN1XzE2X2J5XzE2YmIoKFdvcmQzMikgKiAocF9hKSwgKFdvcmQzMikgKiAocF95eTEtLSksIHMyKTsKLSAgICAgICAgICAgIHMxID0gYW1ybmJfZnhwX21zdV8xNl9ieV8xNmJiKChXb3JkMzIpICogKHBfYSsrKSwgKFdvcmQzMikgKiAocF95eTEpLCBzMSk7Ci0gICAgICAgICAgICBzMiA9IGFtcm5iX2Z4cF9tc3VfMTZfYnlfMTZiYigoV29yZDMyKSAqIChwX2EpLCAoV29yZDMyKSAqIChwX3l5MS0tKSwgczIpOwotICAgICAgICAgICAgczEgPSBhbXJuYl9meHBfbXN1XzE2X2J5XzE2YmIoKFdvcmQzMikgKiAocF9hKyspLCAoV29yZDMyKSAqIChwX3l5MSksIHMxKTsKLSAgICAgICAgfQotCi0gICAgICAgIC8qIGNoZWNrIGZvciBvdmVyZmxvdyBvbiBzMSAqLwotICAgICAgICBpZiAoKFVXb3JkMzIpKHMxIC0gMHhmODAwMDAwMEwpIDwgMHgwZmZmZmZmZkwpCi0gICAgICAgIHsKLSAgICAgICAgICAgIHRlbXAgPSAoV29yZDE2KShzMSA+PiAxMik7Ci0gICAgICAgIH0KLSAgICAgICAgZWxzZSBpZiAoczEgPiAweDA3ZmZmZmZmTCkKLSAgICAgICAgewotICAgICAgICAgICAgdGVtcCA9IE1BWF8xNjsKLSAgICAgICAgfQotICAgICAgICBlbHNlCi0gICAgICAgIHsKLSAgICAgICAgICAgIHRlbXAgPSBNSU5fMTY7Ci0gICAgICAgIH0KLQotICAgICAgICBzMiA9IGFtcm5iX2Z4cF9tc3VfMTZfYnlfMTZiYigoV29yZDMyKWFbMV0sIChXb3JkMzIpdGVtcCwgczIpOwotCi0gICAgICAgICooeXkrKykgID0gdGVtcDsKLSAgICAgICAgKihwX3krKykgPSB0ZW1wOwotCi0gICAgICAgIHBfeXkxID0geXk7Ci0KLSAgICAgICAgLyogY2hlY2sgZm9yIG92ZXJmbG93IG9uIHMyICovCi0gICAgICAgIGlmICgoVVdvcmQzMikoczIgLSAweGY4MDAwMDAwTCkgPCAweDBmZmZmZmZmTCkKLSAgICAgICAgewotICAgICAgICAgICAgdGVtcCA9IChXb3JkMTYpKHMyID4+IDEyKTsKLSAgICAgICAgfQotICAgICAgICBlbHNlIGlmIChzMiA+IDB4MDdmZmZmZmZMKQotICAgICAgICB7Ci0gICAgICAgICAgICB0ZW1wID0gTUFYXzE2OwotICAgICAgICB9Ci0gICAgICAgIGVsc2UKLSAgICAgICAgewotICAgICAgICAgICAgdGVtcCA9IE1JTl8xNjsKLSAgICAgICAgfQotCi0gICAgICAgICooeXkrKykgID0gdGVtcDsKLSAgICAgICAgKihwX3krKykgPSB0ZW1wOwotICAgIH0KLQotICAgIHBfeXkxID0gJnlbTS0xXTsKLQotICAgIGZvciAoaSA9IChsZyAtIE0pID4+IDE7IGkgIT0gMDsgaS0tKQotICAgIHsKLSAgICAgICAgcF9hICA9IGE7Ci0KLSAgICAgICAgczEgPSBhbXJuYl9meHBfbWFjXzE2X2J5XzE2YmIoKFdvcmQzMikgKiAocF94KyspLCAoV29yZDMyKSAqIChwX2EpLCAweDAwMDAwODAwTCk7Ci0gICAgICAgIHMyID0gYW1ybmJfZnhwX21hY18xNl9ieV8xNmJiKChXb3JkMzIpICogKHBfeCsrKSwgKFdvcmQzMikgKiAocF9hKyspLCAweDAwMDAwODAwTCk7Ci0gICAgICAgIHMxID0gYW1ybmJfZnhwX21zdV8xNl9ieV8xNmJiKChXb3JkMzIpICogKHBfYSsrKSwgKFdvcmQzMikgKiAocF95eTEpLCBzMSk7Ci0KLSAgICAgICAgZm9yIChqID0gKE0gPj4gMSkgLSAyOyBqICE9IDA7IGotLSkKLSAgICAgICAgewotICAgICAgICAgICAgczIgPSBhbXJuYl9meHBfbXN1XzE2X2J5XzE2YmIoKFdvcmQzMikgKiAocF9hKSwgKFdvcmQzMikgKiAocF95eTEtLSksIHMyKTsKLSAgICAgICAgICAgIHMxID0gYW1ybmJfZnhwX21zdV8xNl9ieV8xNmJiKChXb3JkMzIpICogKHBfYSsrKSwgKFdvcmQzMikgKiAocF95eTEpLCBzMSk7Ci0gICAgICAgICAgICBzMiA9IGFtcm5iX2Z4cF9tc3VfMTZfYnlfMTZiYigoV29yZDMyKSAqIChwX2EpLCAoV29yZDMyKSAqIChwX3l5MS0tKSwgczIpOwotICAgICAgICAgICAgczEgPSBhbXJuYl9meHBfbXN1XzE2X2J5XzE2YmIoKFdvcmQzMikgKiAocF9hKyspLCAoV29yZDMyKSAqIChwX3l5MSksIHMxKTsKLSAgICAgICAgICAgIHMyID0gYW1ybmJfZnhwX21zdV8xNl9ieV8xNmJiKChXb3JkMzIpICogKHBfYSksIChXb3JkMzIpICogKHBfeXkxLS0pLCBzMik7Ci0gICAgICAgICAgICBzMSA9IGFtcm5iX2Z4cF9tc3VfMTZfYnlfMTZiYigoV29yZDMyKSAqIChwX2ErKyksIChXb3JkMzIpICogKHBfeXkxKSwgczEpOwotICAgICAgICB9Ci0KLSAgICAgICAgaWYgKChVV29yZDMyKShzMSAtIDB4ZjgwMDAwMDBMKSA8IDB4MGZmZmZmZmZMKQotICAgICAgICB7Ci0gICAgICAgICAgICB0ZW1wID0gKFdvcmQxNikoczEgPj4gMTIpOwotICAgICAgICB9Ci0gICAgICAgIGVsc2UgaWYgKHMxID4gMHgwN2ZmZmZmZkwpCi0gICAgICAgIHsKLSAgICAgICAgICAgIHRlbXAgPSBNQVhfMTY7Ci0gICAgICAgIH0KLSAgICAgICAgZWxzZQotICAgICAgICB7Ci0gICAgICAgICAgICB0ZW1wID0gTUlOXzE2OwotICAgICAgICB9Ci0KLSAgICAgICAgczIgPSBhbXJuYl9meHBfbXN1XzE2X2J5XzE2YmIoKFdvcmQzMilhWzFdLCAoV29yZDMyKXRlbXAsIHMyKTsKLQotICAgICAgICAqKHBfeSsrKSA9IHRlbXA7Ci0gICAgICAgIHBfeXkxID0gcF95OwotCi0gICAgICAgIGlmICgoVVdvcmQzMikoczIgLSAweGY4MDAwMDAwTCkgPCAweDBmZmZmZmZmTCkKLSAgICAgICAgewotICAgICAgICAgICAgKihwX3krKykgPSAoV29yZDE2KShzMiA+PiAxMik7Ci0gICAgICAgIH0KLSAgICAgICAgZWxzZSBpZiAoczIgPiAweDA3ZmZmZmZmTCkKLSAgICAgICAgewotICAgICAgICAgICAgKihwX3krKykgPSBNQVhfMTY7Ci0gICAgICAgIH0KLSAgICAgICAgZWxzZQotICAgICAgICB7Ci0gICAgICAgICAgICAqKHBfeSsrKSA9IE1JTl8xNjsKLSAgICAgICAgfQotICAgIH0KLQotICAgIC8qIFVwZGF0ZSBvZiBtZW1vcnkgaWYgdXBkYXRlPT0xICovCi0gICAgaWYgKHVwZGF0ZSAhPSAwKQotICAgIHsKLSAgICAgICAgbWVtY3B5KG1lbSwgJnlbbGctTV0sIE0qc2l6ZW9mKFdvcmQxNikpOwotICAgIH0KLQotICAgIHJldHVybjsKLX0KZGlmZiAtLWdpdCBhL21lZGlhL2xpYnN0YWdlZnJpZ2h0L2NvZG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wgLyogaSAgIDogbGV2ZWwgY2FsY3VsYXRlIGF0IHRoZSBlbmQgb2YgICAgICAgICAgICAgICAgKi8KLSAgICAvKiAgICAgICB0aGUgcHJldmlvdXMgZnJhbWUgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotICAgIC8qIG8gICA6IGxldmVsIG9mIHNpZ25hbCBjYWxjdWxhdGVkIGZyb20gdGhlIGxhc3QgICAgICovCi0gICAgLyogICAgICAgKGNvdW50MiAtIGNvdW50MSkgc2FtcGxlcyAgICAgICAgICAgICAgICAgICAgKi8KLSAgICBXb3JkMTYgY291bnQxLCAgICAgLyogaSAgIDogbnVtYmVyIG9mIHNhbXBsZXMgdG8gYmUgY291bnRlZCAgICAgICAgICAgICAgKi8KLSAgICBXb3JkMTYgY291bnQyLCAgICAgLyogaSAgIDogbnVtYmVyIG9mIHNhbXBsZXMgdG8gYmUgY291bnRlZCAgICAgICAgICAgICAgKi8KLSAgICBXb3JkMTYgaW5kX20sICAgICAgLyogaSAgIDogc3RlcCBzaXplIGZvciB0aGUgaW5kZXggb2YgdGhlIGRhdGEgYnVmZmVyICAgKi8KLSAgICBXb3JkMTYgaW5kX2EsICAgICAgLyogaSAgIDogc3RhcnRpbmcgaW5kZXggb2YgdGhlIGRhdGEgYnVmZmVyICAgICAgICAgICAgKi8KLSAgICBXb3JkMTYgc2NhbGUsICAgICAgLyogaSAgIDogc2NhbGluZyBmb3IgdGhlIGxldmVsIGNhbGN1bGF0aW9uICAgICAgICAgICAgKi8KLSAgICBGbGFnICAqcE92ZXJmbG93ICAgLyogbyA6IEZsYWcgc2V0IHdoZW4gb3ZlcmZsb3cgb2NjdXJzICAgICAgICAgICAgICAgICAgKi8KLSkKLXsKLSAgICBXb3JkMzIgbF90ZW1wMTsKLSAgICBXb3JkMzIgbF90ZW1wMjsKLSAgICBXb3JkMTYgbGV2ZWw7Ci0gICAgV29yZDE2IGk7Ci0KLSAgICBsX3RlbXAxID0gMEw7Ci0KLSAgICBmb3IgKGkgP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IDggbGFzdCB2YWQtZGVjaXNpb25zIGhhdmUgYmVlbiAiMCIsIHJlaW5pdGlhbGl6ZSBzdGF0X2NvdW50ICovCi0gICAgICAgIGlmICgoc3QtPnZhZHJlZyAmIDB4N2Y4MCkgPT0gMCkKLSAgICAgICAgewotICAgICAgICAgICAgc3QtPnN0YXRfY291bnQgPSBTVEFUX0NPVU5UOwotICAgICAgICB9Ci0gICAgICAgIGVsc2UKLSAgICAgICAgewotICAgICAgICAgICAgc3RhdF9yYXQgPSAwOwotICAgICAgICAgICAgZm9yIChpID0gMDsgaSA8IENPTVBMRU47IGkrKykKLSAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICBpZiAobGV2ZWxbaV0gPiBzdC0+YXZlX2xldmVsW2ldKQotICAgICAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAgICAgbnVtID0gbGV2ZWxbaV07Ci0gICAgICAgICAgICAgICAgICAgIGRlbm9tID0gc3QtPmF2ZV9sZXZlbFtpXTsKLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgZWxzZQotICAgICAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAgICAgbnVtID0gc3QtPmF2ZV9sZXZlbFtpXTsKLSAgICAgICAgICAgICAgICAgICAgZGVub20gPSBsZXZlbFtpXTsKLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgLyogTGltaXQgbmltaW11bSB2YWx1ZSBvZiBudW0gYW5kIGRlbm9tIHRvIFNUQVRfVEhSX0xFVkVMICovCi0gICAgICAgICAgICAgICAgaWYgKG51bSA8IFNUQVRfVEhSX0xFVkVMKQotICAgICAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAgICAgbnVtID0gU1RBVF9USFJfTEVWRUw7Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgIGlmIChkZW5vbSA8IFNUQVRfVEhSX0xFVkVMKQotICAgICAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAgICAgZGVub20gPSBTVEFUX1RIUl9MRVZFTDsKLSAgICAgICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgICAgICBleHAgPSBub3JtX3MoZGVub20pOwotCi0gICAgICAgICAgICAgICAgZGVub20gPSBzaGwoZGVub20sIGV4cCwgcE92ZXJmbG93KTsKLQotICAgICAgICAgICAgICAgIC8qIHN0YXRfcmF0ID0gbnVtL2Rlbm9tICogNjQgKi8KLSAgICAgICAgICAgICAgICB0ZW1wID0gc2hyKG51bSwgMSwgcE92ZXJmbG93KTsKLSAgICAgICAgICAgICAgICB0ZW1wID0gZGl2X3ModGVtcCwgZGVub20pOwotCi0gICAgICAgICAgICAgICAgc3RhdF9yYXQgPSBhZGQoc3RhdF9yYXQsIHNocih0ZW1wLCBzdWIoOCwgZXhwLCBwT3ZlcmZsb3cpLCBwT3ZlcmZsb3cpLCBwT3ZlcmZsb3cpOwotICAgICAgICAgICAgfQotCi0gICAgICAgICAgICAvKiBjb21wYXJlIHN0YXRfcmF0IHdpdGggYSB0aHJlc2hvbGQgYW5kIHVwZGF0ZSBzdGF0X2NvdW50ICovCi0gICAgICAgICAgICBpZiAoc3RhdF9yYXQgPiBTVEFUX1RIUikKLSAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICBzdC0+c3RhdF9jb3VudCA9IFNUQVRfQ09VTlQ7Ci0gICAgICAgICAgICB9Ci0gICAgICAgICAgICBlbHNlCi0gICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgaWYgKChzdC0+dmFkcmVnICYgMHg0MDAwKSAhPSAwKQotICAgICAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAgICAgaWYgKHN0LT5zdGF0X2NvdW50ICE9IDApCi0gICAgICAgICAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAgICAgICAgIHN0LT5zdGF0X2NvdW50ID0gc3ViKHN0LT5zdGF0X2NvdW50LCAxLCBwT3ZlcmZsb3cpOwotICAgICAgICAgICAgICAgICAgICB9Ci0gICAgICA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KSAmJgotICAgICAgICAgICAgKChzdC0+cGl0Y2ggJiAweDc4MDApID09IDApCi0gICAgICAgICAgICAmJiAoc3QtPmNvbXBsZXhfaGFuZ19jb3VudCA9PSAwKSkKLSAgICB7Ci0gICAgICAgIGFscGhhX3VwID0gQUxQSEFfVVAxOwotICAgICAgICBhbHBoYV9kb3duID0gQUxQSEFfRE9XTjE7Ci0gICAgfQotICAgIGVsc2UKLSAgICB7Ci0gICAgICAgIGlmICgoc3QtPnN0YXRfY291bnQgPT0gMCkKLSAgICAgICAgICAgICAgICAmJiAoc3QtPmNvbXBsZXhfaGFuZ19jb3VudCA9PSAwKSkKLSAgICAgICAgewotICAgICAgICAgICAgYWxwaGFfdXAgPSBBTFBIQV9VUDI7Ci0gICAgICAgICAgICBhbHBoYV9kb3duID0gQUxQSEFfRE9XTjI7Ci0gICAgICAgIH0KLSAgICAgICAgZWxzZQotICAgICAgICB7Ci0gICAgICAgICAgICBhbHBoYV91cCA9IDA7Ci0gICAgICAgICAgICBhbHBoYV9kb3duID0gQUxQSEEzOwotICAgICAgICAgICAgYmNrcl9hZGQgPSAwOwotICAgICAgICB9Ci0gICAgfQotCi0gICAgLyogVXBkYXRlIG5vaXNlIGVzdGltYXRlIChiY2tyX2VzdCkgKi8KLSAgICBmb3IgKGkgPSAwOyBpIDwgQ09NUExFTjsgaSsrKQotICAgIHsKLSAgICAgICAgV29yZDE2IHRlbXA7Ci0KLSAgICAgICAgdGVtcCA9IHN1YihzdC0+b2xkX2xldmVsW2ldLCBzdC0+YmNrcl9lc3RbaV0sIHBPdmVyZmxvdyk7Ci0KLSAgICAgICAgaWYgKHRlbXAgPCAwKQotICAgICAgICB7IC8qIHVwZGF0ZSBkb3dud2FyZHMqLwotICAgICAgICAgICAgdGVtcCA9IG11bHRfcihhbHBoYV9kb3duLCB0ZW1wLCBwT3ZlcmZsb3cpOwotICAgICAgICAgICAgdGVtcCA9IGFkZChzdC0+YmNrcl9lc3RbaV0sIHRlbXAsIHBPdmVyZmxvdyk7Ci0KLSAgICAgICAgICAgIHN0LT5iY2tyX2VzdFtpXSA9IGFkZCgtMiwgdGVtcCwgcE92ZXJmbG93KTsKLQotICAgICAgICAgICAgLyogbGltaXQgbWluaW11bSB2YWx1ZSBvZiB0aGUgbm9pc2UgZXN0aW1hdGUgdG8gTk9JU0VfTUlOICovCi0gICAgICAgICAgICBpZiAoc3QtPmJja3JfZXN0W2ldIDwgTk9JU0VfTUlOKQotICAgICAgICAgICAgewotICAgICAgICAgICAgICAgIHN0LT5iY2tyX2VzdFtpXSA9IE5PSVNFX01JTjsKLSAgICAgICAgICAgIH0KLSAgICAgICAgfQotICAgICAgICBlbHNlCi0gICAgICAgIHsgLyogdXBkYXRlIHVwd2FyZHMgKi8KLSAgICAgICAgICAgIHRlbXAgPSBtdWx0X3IoYWxwaGFfdXAsIHRlbXAsIHBPdmVyZmxvdyk7Ci0gICAgICAgICAgICB0ZW1wID0gYWRkKHN0LT5iY2tyX2VzdFtpXSwgdGVtcCwgcE92ZXJmbG93KTsKLSAgICAgICAgICAgIHN0LT5iY2tyX2VzdFtpXSA9IGFkZChiY2tyX2FkZCwgdGVtcCwgcE92ZXJmbG93KTsKLQotICAgICAgICAgICAgLyogbGltaXQgbWF4aW11bSB2YWx1ZSBvZiB0aGUgbm9pc2UgZXN0aW1hdGUgdG8gTk9JU0VfTUFYICovCi0gICAgICAgICAgICBpZiAoc3QtPmJja3JfZXN0W2ldID4gTk9JU0VfTUFYKQotICAgICAgICAgICAgewotICAgICAgICAgICAgICAgIHN0LT5iY2tyX2VzdFtpXSA9IE5PSVNFX01BWDsKLSAgICAgICAgICAgIH0KLSAgICAgICAgfQotICAgIH0KLQotICAgIC8qIFVwZGF0ZSBzaWduYWwgbGV2ZWxzIG9mIHRoZSBwcmV2aW91cyBmcmFtZSAob2xkX2xldmVsKSAqLwotICAgIGZvciAoaSA9IDA7IGkgPCBDT01QTEVOOyBpKyspCi0gICAgewotICAgICAgICBzdC0+b2xkX2xldmVsW2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ZXJmbG93IG9jY3VycyAgICAgICAgICAgICovCi0pCi17Ci0gICAgV29yZDE2IGFscGhhOyAgICAgICAgICAgIC8qIFExNSAqLwotICAgIFdvcmQzMiBMX3RtcDsgICAgICAgICAgICAvKiBRMzEgKi8KLQotCi0gICAgLyogYWRhcHQgc3BlZWQgb24gb3duIHN0YXRlICovCi0gICAgaWYgKHN0LT5iZXN0X2NvcnJfaHAgPCBzdC0+Y29ycl9ocF9mYXN0KSAvKiBkZWNyZWFzZSAqLwotICAgIHsKLSAgICAgICAgaWYgKHN0LT5jb3JyX2hwX2Zhc3QgPCBDVkFEX1RIUkVTSF9BREFQVF9ISUdIKQotICAgICAgICB7ICAvKiBsb3cgc3RhdGUgICovCi0gICAgICAgICAgICBhbHBoYSA9IENWQURfQURBUFRfRkFTVDsKLSAgICAgICAgfQotICAgICAgICBlbHNlCi0gICAgICAgIHsgIC8qIGhpZ2ggc3RhdGUgKi8KLSAgICAgICAgICAgIGFscGhhID0gQ1ZBRF9BREFQVF9SRUFMTFlfRkFTVDsKLSAgICAgICAgfQotICAgIH0KLSAgICBlbHNlICAvKiBpbmNyZWFzZSAqLwotICAgIHsKLSAgICAgICAgaWYgKHN0LT5jb3JyX2hwX2Zhc3QgPCBDVkFEX1RIUkVTSF9BREFQVF9ISUdIKQotICAgICAgICB7Ci0gICAgICAgICAgICBhbHBoYSA9IENWQURfQURBUFRfRkFTVDsKLSAgICAgICAgfQotICAgICAgICBlbHNlCi0gICAgICAgIHsKLSAgICAgICAgICAgIGFscGhhID0gQ1ZBRF9BREFQVF9TTE9XOwotICAgICAgICB9Ci0gICAgfQotCi0gICAgTF90bXAgPSBMX2RlcG9zaXRfaChzdC0+Y29ycl9ocF9mYXN0KTsKLSAgICBMX3RtcCA9IExfbXN1KExfdG1wLCBhbHBoYSwgc3QtPmNvcnJfaHBfZmFzdCwgcE92ZXJmbG93KTsKLSAgICBMX3RtcCA9IExfbWFjKExfdG1wLCBhbHBoYSwgc3QtPmJlc3RfY29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FtclBhcmFtcy0+ZUFNUkZyYW1lRm9ybWF0ID0gT01YX0FVRElPX0FNUkZyYW1lRm9ybWF0Q29uZm9ybWFuY2U7Ci0KLSAgICAgICAgICAgIGlmICghaXNDb25maWd1cmVkKCkpIHsKLSAgICAgICAgICAgICAgICBhbXJQYXJhbXMtPm5CaXRSYXRlID0gMDsKLSAgICAgICAgICAgICAgICBhbXJQYXJhbXMtPmVBTVJCYW5kTW9kZSA9IE9NWF9BVURJT19BTVJCYW5kTW9kZVVudXNlZDsKLSAgICAgICAgICAgIH0gZWxzZSB7Ci0gICAgICAgICAgICAgICAgYW1yUGFyYW1zLT5uQml0UmF0ZSA9IDA7Ci0gICAgICAgICAgICAgICAgYW1yUGFyYW1zLT5lQU1SQmFuZE1vZGUgPQotICAgICAgICAgICAgICAgICAgICBtTW9kZSA9PSBNT0RFX05BUlJPVwotICAgICAgICAgICAgICAgICAgICAgICAgPyBPTVhfQVVESU9fQU1SQmFuZE1vZGVOQjAgOiBPTVhfQVVESU9fQU1SQmFuZE1vZGVXQjA7Ci0gICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgIHJldHVybiBPTVhfRXJyb3JOb25lOwotICAgICAgICB9Ci0KLSAgICAgICAgY2FzZSBPTVhfSW5kZXhQYXJhbUF1ZGlvUGNtOgotICAgICAgICB7Ci0gICAgICAgICAgICBPTVhfQVVESU9fUEFSQU1fUENNTU9ERVRZUEUgKnBjbVBhcmFtcyA9Ci0gICAgICAgICAgICAgICAgKE9NWF9BVURJT19QQVJBTV9QQ01NT0RFVFlQRSAqKXBhcmFtczsKLQotICAgICAgICAgICAgaWYgKHBjbVBhcmFtcy0+blBvcnRJbmRleCAhPSAxKSB7Ci0gICAgICAgICAgICAgICAgcmV0dXJuIE9NWF9FcnJvclVuZGVmaW5lZDsKLSAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgcGNtUGFyYW1zLT5uQ2hhbm5lbHMgPSAxOwotICAgICAgICAgICAgcGNtUGFyYW1zLT5lTnV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ICAgICAgIGNvbnN0IE9NWF9QQVJBTV9DT01QT05FTlRST0xFVFlQRSAqcm9sZVBhcmFtcyA9Ci0gICAgICAgICAgICAgICAgKGNvbnN0IE9NWF9QQVJBTV9DT01QT05FTlRST0xFVFlQRSAqKXBhcmFtczsKLQotICAgICAgICAgICAgaWYgKG1Nb2RlID09IE1PREVfTkFSUk9XKSB7Ci0gICAgICAgICAgICAgICAgaWYgKHN0cm5jbXAoKGNvbnN0IGNoYXIgKilyb2xlUGFyYW1zLT5jUm9sZSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAiYXVkaW9fZGVjb2Rlci5hbXJuYiIsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgT01YX01BWF9TVFJJTkdOQU1FX1NJWkUgLSAxKSkgewotICAgICAgICAgICAgICAgICAgICByZXR1cm4gT01YX0Vycm9yVW5kZWZpbmVkOwotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgIH0gZWxzZSB7Ci0gICAgICAgICAgICAgICAgaWYgKHN0cm5jbXAoKGNvbnN0IGNoYXIgKilyb2xlUGFyYW1zLT5jUm9sZSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAiYXVkaW9fZGVjb2Rlci5hbXJ3YiIsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgT01YX01BWF9TVFJJTkdOQU1FX1NJWkUgLSAxKSkgewotICAgICAgICAgICAgICAgICAgICByZXR1cm4gT01YX0Vycm9yVW5kZWZpbmVkOwotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgcmV0dXJuIE9NWF9FcnJvck5vbmU7Ci0gICAgICAgIH0KLQotICAgICAgICBjYXNlIE9NWF9JbmRleFBhcmFtQXVkaW9BbXI6Ci0gICAgICAgIHsKLSAgICAgICAgICAgIGNvbnN0IE9NWF9BVURJT19QQVJBTV9BTVJUWVBFICphYWNQYXJhbXMgPQotICAgICAgICAgICAgICAgIChjb25zdCBPTVhfQVVESU9fUEFSQU1fQU1SVFlQRSAqKXBhcmFtczsKLQotICAgICAgICAgICAgaWYgKGFhY1BhcmFtcy0+blBvcnRJbmRleCAhPSAwKSB7Ci0gICAgICAgICAgICAgICAgcmV0dXJuIE9NWF9FcnJvclVuZGVmaW5lZDsKLSAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgcmV0dXJuIE9NWF9FcnJvck5vbmU7Ci0gICAgICAgIH0KLQotICAgICAgICBjYXNlIE9NWF9JbmRleFBhcmFtQXVkaW9QY206Ci0gICAgICAgIHsKLSAgICAgICAgICAgIGNvbnN0IE9NWF9BVURJT19QQVJBTV9QQ01NT0RFVFlQRSAqcGNtUGFyYW1zID0KLSAgICAgICAgICAgICAgICAoT01YX0FVRElPX1BBUkFNX1BDTU1PREVUWVBFICopcGFyYW1zOwotCi0gICAgICAgICAgICBpZiAocGNtUGFyYW1zLT5uUG9ydEluZGV4ICE9IDEpIHsKLSAgICAgICAgICAgICAgICByZXR1cm4gT01YX0Vycm9yVW5kZWZpbmVkOwotICAgICAgICAgICAgfQotCi0gICAgICAgICAgICByZXR1cm4gT01YX0Vycm9yTm9uZTsKLSAgICAgICAgfQotCi0gICAgICAgIGRlZmF1bHQ6Ci0gICAgICAgICAgICByZXR1cm4gU2ltcGxlU29mdE9NWENvbXBvbmVudDo6aW50ZXJuYWxTZXRQYXJhbWV0ZXIoaW5kZXgsIHBhcmFtcyk7Ci0gICAgfQotfQotCi1ib29sIFNvZnRBTVI6OmlzQ29uZmlndXJlZCgpIGNvbnN0IHsKLSAgICByZXR1cm4gbUlucHV0QnVmZmVyQ291bnQgPiAwOwotfQotCi1zdGF0aWMgc2l6ZV90IGdldEZyYW1lU2l6ZSh1bnNpZ25lZCBGVCkgewotICAgIHN0YXRpYyBjb25zdCBzaXplX3Qga0ZyYW1lU2l6ZVdCWzldID0gewotICAgICAgICAxMzIsIDE3NywgMjUzLCAyODUsIDMxNywgMzY1LCAzOTcsIDQ2MSwgNDc3Ci0gICAgfTsKLQotICAgI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ZEJ5VXMgPSBmYWxzZTsKLSAgICAgICAgICAgIG5vdGlmeUVtcHR5QnVmZmVyRG9uZShpbkhlYWRlcik7Ci0KLSAgICAgICAgICAgIG91dEhlYWRlci0+bkZpbGxlZExlbiA9IDA7Ci0gICAgICAgICAgICBvdXRIZWFkZXItPm5GbGFncyA9IE9NWF9CVUZGRVJGTEFHX0VPUzsKLQotICAgICAgICAgICAgb3V0UXVldWUuZXJhc2Uob3V0UXVldWUuYmVnaW4oKSk7Ci0gICAgICAgICAgICBvdXRJbmZvLT5tT3duZWRCeVVzID0gZmFsc2U7Ci0gICAgICAgICAgICBub3RpZnlGaWxsQnVmZmVyRG9uZShvdXRIZWFkZXIpOwotICAgICAgICAgICAgcmV0dXJuOwotICAgICAgICB9Ci0KLSAgICAgICAgaWYgKGluSGVhZGVyLT5uT2Zmc2V0ID09IDApIHsKLSAgICAgICAgICAgIG1BbmNob3JUaW1lVXMgPSBpbkhlYWRlci0+blRpbWVTdGFtcDsKLSAgICAgICAgICAgIG1OdW1TYW1wbGVzT3V0cHV0ID0gMDsKLSAgICAgICAgfQotCi0gICAgICAgIGNvbnN0IHVpbnQ4X3QgKmlucHV0UHRyID0gaW5IZWFkZXItPnBCdWZmZXIgKyBpbkhlYWRlci0+bk9mZnNldDsKLSAgICAgICAgaW50MzJfdCBudW1CeXRlc1JlYWQ7Ci0KLSAgICAgICAgaWYgKG1Nb2RlID09IE1PREVfTkFSUk9XKSB7Ci0gICAgICAgICAgICBudW1CeXRlc1JlYWQgPQotICAgICAgICAgICAgICAgIEFNUkRlY29kZShtU3RhdGUsCi0gICAgICAgICAgICAgICAgICAoRnJhbWVfVHlwZV8zR1BQKSgoaW5wdXRQdHJbMF0gPj4gMykgJiAweDBmKSwKLSAgICAgICAgICAgICAgICAgIChVV29yZDggKikmaW5wdXRQdHJbMV0sCi0gICAgICAgICAgICAgICAgICByZWludGVycHJldF9jYXN0PGludDE2X3QgKj4ob3V0SGVhZGVyLT5wQnVmZmVyKSwKLSAgICAgICAgICAgICAgICAgIE1JTUVfSUVURik7Ci0KLSAgICAgICAgICAgIGlmIChudW1CeXRlc1JlYWQgPT0gLTEpIHsKLSAgICAgICAgICAgICAgICBBTE9HRSgiUFYgQU1SIGRlY29kZXIgQU1SRGVjb2RlKCkgY2FsbCBmYWlsZWQiKTsKLQotICAgICAgICAgICAgICAgIG5vdGlmeShPTVhfRXZlbnRFcnJvciwgT01YX0Vycm9yVW5kZWZpbmVkLCAwLCBOVUxMKTsKLSAgICAgICAgICAgICAgICBtU2lnbmFsbGVkRXJyb3IgPSB0cnVlOwotCi0gICAgICAgICAgICAgICAgcmV0dXJuOwotICAgICAgICAgICAgfQotCi0gICAgICAgICAgICArK251bUJ5dGVzUmVhZDsgIC8vIEluY2x1ZGUgdGhlIGZyYW1lIHR5cGUgaGVhZGVyIGJ5dGUuCi0KLSAgICAgICAgICAgIGlmIChzdGF0aWNfY2FzdDxzaXplX3Q+KG51bUJ5dGVzUmVhZCkgPiBpbkhlYWRlci0+bkZpbGxlZExlbikgewotICAgICAgICAgICAgICAgIC8vIFRoaXMgaXMgYmFkLCBzaG91bGQgbmV2ZXIgaGF2ZSBoYXBwZW5lZCwgYnV0IGRpZC4gQWJvcnQgbm93LgotCi0gICAgICAgICAgICAgICAgbm90aWZ5KE9NWF9FdmVudEVycm9yLCBPTVhfRXJyb3JVbmRlZmluZWQsIDAsIE5VTEwpOwotICAgICAgICAgICAgICAgIG1TaWduYWxsZWRFcnJvciA9IHRydWU7Ci0KLSAgICAgICAgICAgICAgICByZXR1cm47Ci0gICAgICAgICAgICB9Ci0gICAgICAgIH0gZWxzZSB7Ci0gICAgICAgICAgICBpbnQxNiBtb2RlID0gKChpbnB1dFB0clswXSA+PiAzKSAmIDB4MGYpOwotICAgICAgICAgICAgc2l6ZV90IGZyYW1lU2l6ZSA9IGdldEZyYW1lU2l6ZShtb2RlKTsKLSAgICAgICAgICAgIENIRUNLX0dFKGluSGVhZGVyLT5uRmlsbGVkTGVuLCBmcmFtZVNpemUpOwotCi0gICAgICAgICAgICBpbnQxNiBmcmFtZVR5cGU7Ci0gICAgICAgICAgICBSWF9TdGF0ZV93YiByeF9zdGF0ZTsKLSAgICAgICAgICAgIG1pbWVfdW5zb3J0aW5nKAotICAgICAgICAgICAgICAgICAgICBjb25zdF9jYXN0PHVpbnQ4X3QgKj4oJmlucHV0UHRyWzFdKSwKLSAgICAgICAgICAgICAgICAgICAgbUlucHV0U2FtcGxlQnVmZmVyLAotICAgICAgICAgICAgICAgICAgICAmZnJhbWVUeXBlLCAmbW9kZSwgMSwgJnJ4X3N0YXRlKTsKLQotICAgICAgICAgICAgaW50MTZfdCAqb3V0UHRyID0gKGludDE2X3QgKilvdXRIZWFkZXItPnBCdWZmZXI7Ci0KLSAgICAgICAgICAgIGludDE2X3QgbnVtU2FtcGxlc091dHB1dDsKLSAgICAgICAgICAgIHB2RGVjb2Rlcl9BbXJXYigKLSAgICAgICAgICAgICAgICAgICAgbW9kZSwgbUlucHV0U2FtcGxlQnVmZmVyLAotICAgICAgICAgICAgICAgICAgICBvdXRQdHIsCi0gICAgICAgICAgICAgICAgICAgICZudW1TYW1wbGVzT3V0cHV0LAotICAgICAgICAgICAgICAgICAgICBtRGVjb2RlckJ1ZiwgZnJhbWVUeXBlLCBtRGVjb2RlckNvb2tpZSk7Ci0KLSAgICAgICAgICAgIENIRUNLX0VRKChpbnQpbnVtU2FtcGxlc091dHB1dCwgKGludClrTnVtU2FtcGxlc1BlckZyYW1lV0IpOwotCi0gICAgICAgICAgICBmb3IgKGludCBpID0gMDsgaSA8IGtOdW1TYW1wbGVzUGVyRnJhbWVXQjsgKytpKSB7Ci0gICAgICAgICAgICAgICAgLyogRGVsZXRlIHRoZSAyIExTQnMgKDE0LWJpdCBvdXRwdXQpICovCi0gICAgICAgICAgICAgICAgb3V0UHRyW2ldICY9IDB4ZmZmQzsKLSAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgbnVtQnl0ZXNSZWFkID0gZnJhbWVTaXplOwotICAgICAgICB9Ci0KLSAgICAgICAgaW5IZWFkZXItPm5PZmZzZXQgKz0gbnVtQnl0ZXNSZWFkOwotICAgICAgICBpbkhlYWRlci0+bkZpbGxlZExlbiAtPSBudW1CeXRlc1JlYWQ7Ci0KLSAgICAgICAgb3V0SGVhZGVyLT5uRmxhZ3MgPSAwOwotICAgICAgICBvdXRIZWFkZXItPm5PZmZzZXQgPSAwOwotCi0gICAgICAgIGlmIChtTW9kZSA9PSBNT0RFX05BUlJPVykgewotICAgICAgICAgICAgb3V0SGVhZGVyLT5uRmlsbGVkTGVuID0ga051bVNhbXBsZXNQZXJGcmFtZU5CICogc2l6ZW9mKGludDE2X3QpOwotCi0gICAgICAgICAgICBvdXRIZWFkZXItPm5UaW1lU3RhbXAgPQotICAgICAgICAgICAgICAgIG1BbmNob3JUaW1lVXMKLSAgICAgICAgICAgICAgICAgICAgKyAobU51bVNhbXBsZXNPdXRwdXQgKiAxMDAwMDAwbGwpIC8ga1NhbXBsZVJhdGVOQjsKLQotICAgICAgICAgICAgbU51bVNhbXBsZXNPdXRwdXQgKz0ga051bVNhbXBsZXNQZXJGcmFtZU5COwotICAgICAgICB9IGVsc2UgewotICAgICAgICAgICAgb3V0SGVhZGVyLT5uRmlsbGVkTGVuID0ga051bVNhbXBsZXNQZXJGcmFtZVdCICogc2l6ZW9mKGludDE2X3QpOwotCi0gICAgICAgICAgICBvdXRIZWFkZXItPm5UaW1lU3RhbXAgPQotICAgICAgICAgICAgICAgIG1BbmNob3JUaW1lVXMKLSAgICAgICAgICAgICAgICAgICAgKyAobU51bVNhbXBsZXNPdXRwdXQgKiAxMDAwMDAwbGwpIC8ga1NhbXBsZVJhdGVXQjsKLQotICAgICAgICAgICAgbU51bVNhbXBsZXNPdXRwdXQgKz0ga051bVNhbXBsZXNQZXJGcmFtZVdCOwotICAgICAgICB9Ci0KLSAgICAgICAgaWYgKGluSGVhZGVyLT5uRmlsbGVkTGVuID09IDApIHsKLSAgICAgICAgICAgIGluS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ZlcmZsb3cpOwotICAgICAgICBub3JtUHJvZCA9IHB2X3JvdW5kKExfYWNjLCBwT3ZlcmZsb3cpOwotCi0gICAgICAgIG11bHQgPSBkaXZfcygxNjM4NCwgbm9ybVByb2QpOwotCi0gICAgICAgIGZvciAoaiA9IDA7IGogPCBpOyBqKyspCi0gICAgICAgIHsKLSAgICAgICAgICAgIExfYWNjID0gTF9kZXBvc2l0X2goYVN0YXRlW2pdKTsKLSAgICAgICAgICAgIExfYWNjID0gTF9tc3UoTF9hY2MsIHJlZmxbaV0sIGFTdGF0ZVtpLWotMV0sIHBPdmVyZmxvdyk7Ci0KLSAgICAgICAgICAgIHRlbXAgPSBwdl9yb3VuZChMX2FjYywgcE92ZXJmbG93KTsKLSAgICAgICAgICAgIExfdGVtcCA9IExfbXVsdChtdWx0LCB0ZW1wLCBwT3ZlcmZsb3cpOwotICAgICAgICAgICAgTF90ZW1wID0gTF9zaHJfcihMX3RlbXAsIHNjYWxlLCBwT3ZlcmZsb3cpOwotCi0gICAgICAgICAgICBpZiAoTF9hYnMoTF90ZW1wKSA+IDMyNzY3KQotICAgICAgICAgICAgewotICAgICAgICAgICAgICAgIGZvciAoaSA9IDA7IGkgPCBNOyBpKyspCi0gICAgICAgICAgICAgICAgewotICAgICAgICAgICAgICAgICAgICByZWZsW2ldID0gMDsKLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgYnJlYWs7Ci0gICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgIGJTdGF0ZVtqXSA9IGV4dHJhY3RfbChMX3RlbXApOwotICAgICAgICB9Ci0KLSAgICAgICAgZm9yIChqID0gMDsgaiA8IGk7IGorKykKLSAgICAgICAgewotICAgICAgICAgICAgYVN0YXRlW2pdID0gYlN0YXRlW2pdOwotICAgICAgICB9Ci0gICAgfQotICAgIHJldHVybjsKLX0KLQotCi0KLQotCi0KLQpkaWZmIC0tZ2l0IGEvbWVkaWEvbGlic3RhZ2VmcmlnaHQvY29kZWNzL2Ft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qLwotCi0gICAgICAgIC8qIHMgPSBnYWluX291dCAvIGdhaW5faW4gKi8KLSAgICAgICAgdGVtcCA9IGRpdl9zKGdhaW5fb3V0LCBnYWluX2luKTsKLQotICAgICAgICAvKiBzID0gTF9kZXBvc2l0X2wgKHRlbXApOyAqLwotICAgICAgICBzID0gKFdvcmQzMikgdGVtcDsKLSAgICAgICAgcyA9IHMgPDwgNzsKLSAgICAgICAgcyA9IExfc2hyKHMsIGV4cCwgcE92ZXJmbG93KTsgICAgICAvKiBhZGQgZXhwb25lbnQgKi8KLQotICAgICAgICBzID0gSW52X3NxcnQocywgcE92ZXJmbG93KTsgICAgLyogZnVuY3Rpb24gcmVzdWx0ICovCi0gICAgICAgIExfdGVtcCA9IHMgPDwgOTsKLQotICAgICAgICBpID0gKFdvcmQxNikoKExfdGVtcCArIChXb3JkMzIpIDB4MDAwMDgwMDBMKSA+PiAxNik7Ci0KLSAgICAgICAgLyogZzAgPSBpICogKDEtYWdjX2ZhYykgKi8KLSAgICAgICAgdGVtcCA9IDMyNzY3IC0gYWdjX2ZhYzsKLQotICAgICAgICBnMCA9IChXb3JkMTYpKCgoV29yZDMyKSBpICogdGVtcCkgPj4gMTUpOwotCi0gICAgfQotCi0gICAgLyogY29tcHV0ZSBnYWluW25dID0gYWdjX2ZhYyAqIGdhaW5bbi0xXQotICAgICAgICAgICAgICAgICAgICAgICAgKyAoMS1hZ2NfZmFjKSAqIHNxcnQoZ2Fpbl9pbi9nYWluX291dCkgKi8KLSAgICAvKiBzaWdfb3V0W25dID0gZ2FpbltuXSAqIHNpZ19vdXRbbl0gICAgICAgICAgICAgICAgICAgICAgICAqLwotCi0gICAgZ2FpbiA9IHN0LT5wYXN0X2dhaW47Ci0gICAgcF9zaWdfb3V0ID0gc2lnX291dDsKLQotICAgIGZvciAoaSA9IDA7IGkgPCBsX3RybTsgaSsrKQotICAgIHsKLSAgICAgICAgLyogZ2FpbiA9IG11bHQgKGdhaW4sIGFnY19mYWMsIHBPdmVyZm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tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tKgotICAgICAgICAgKiAgZzAgPSBzcXJ0KGdhaW5faW4vZ2Fpbl9vdXQpOyAgICAgICAgICAgICAgICAgICAgICoKLSAgICAgICAgICotLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0qLwotCi0gICAgICAgIC8qIHMgPSBnYWluX291dCAvIGdhaW5faW4gKi8KLSAgICAgICAgdGVtcCA9IGRpdl9zKGdhaW5fb3V0LCBnYWluX2luKTsKLQotICAgICAgICAvKiBzID0gTF9kZXBvc2l0X2wgKHRlbXApOyAqLwotICAgICAgICBzID0gKFdvcmQzMil0ZW1wOwotCi0gICAgICAgIGlmIChzID4gKFdvcmQzMikgMHgwMEZGRkZGRkwpCi0gICAgICAgIHsKLSAgICAgICAgICAgIHMgPSBNQVhfMzI7Ci0gICAgICAgIH0KLSAgICAgICAgZWxzZSBpZiAocyA8IChXb3JkMzIpIDB4RkYwMDAwMDBMKQotICAgICAgICB7Ci0gICAgICAgICAgICBzID0gTUlOXzMyOwotICAgICAgICB9Ci0gICAgICAgIGVsc2UKLSAgICAgICAgewotICAgICAgICAgICAgcyA9IHMgPDwgNzsKLSAgICAgICAgfQotICAgICAgICBzID0gTF9zaHIocywgZXhwLCBwT3ZlcmZsb3cpOyAgICAgIC8qIGFkZCBleHBvbmVudCAqLwotCi0gICAgICAgIHMgPSBJbnZfc3FydChzLCBwT3ZlcmZsb3cpOyAgICAvKiBmdW5jdGlvbiByZXN1bHQgKi8KLQotICAgICAgICBpZiAocyA+IChXb3JkMzIpIDB4MDAzRkZGRkZMKQotICAgICAgICB7Ci0gICAgICAgICAgICBMX3RlbXAgPSBNQVhfMzI7Ci0gICAgICAgIH0KLSAgICAgICAgZWxzZSBpZiAocyA8IChXb3JkMzIpIDB4RkZDMDAwMDBMKQotICAgICAgICB7Ci0gICAgICAgICAgICBMX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IChmcmFtZV90eXBlID09IEFNUl9TSUQpCi0gICAgIFRIRU4KLSAgICAgICAgIC8vIENsZWFyIG1vZGUgc3RvcmUgcHJpb3IgdG8gcmVhZGluZyBtb2RlIGluZm8gZnJvbSBpbnB1dCBidWZmZXIKLSAgICAgICAgIG1vZGUgPSAwCi0KLSAgICAgICAgIEZPUiBpID0gMCBUTyBOVU1fQU1SU0lEX1JYTU9ERV9CSVRTLTEKLQotICAgICAgICAgICAgIG1vZGUgfD0gKGRlY19ldHNfaW5wdXRfYmZyW0FNUlNJRF9SWE1PREVfQklUX09GRlNFVCtpXSA8PCBpKQotCi0gICAgICAgICBFTkRGT1IKLQotICAgICAgICAgSUYgKGRlY19ldHNfaW5wdXRfYmZyW0FNUlNJRF9SWFRZUEVfQklUX09GRlNFVF0gPT0gMCkKLSAgICAgICAgIFRIRU4KLSAgICAgICAgICAgICByeF90eXBlID0gUlhfU0lEX0ZJUlNUCi0KLSAgICAgICAgIEVMU0UKLSAgICAgICAgICAgICByeF90eXBlID0gUlhfU0lEX1VQREFURQotCi0gICAgICAgICBFTkRJRgotCi0gICAgIEVMU0VJRiAoKGZyYW1lX3R5cGUgPiBBTVJfU0lEKSAmJiAoZnJhbWVfdHlwZSA8IE5PX0RBVEEpKQotICAgICBUSEVOCi0gICAgICAgICAvLyBVc2UgcHJldmlvdXMgbW9kZQotICAgICAgICAgbW9kZSA9IGRlY29kZXJfc3RhdGUtPnByZXZfbW9kZQotCi0gICAgICAgICAvLyBVbnN1cHBvcnRlZCBTSUQgZnJhbWVzCi0gICAgICAgICByeF90eXBlID0gUlhfU1BFRUNIX0JBRDsKLQotICAgICBFTFNFCi0gICAgICAgICAvLyBVc2UgcHJldmlvdXMgbW9kZQotICAgICAgICAgbW9kZSA9IGRlY29kZXJfc3RhdGUtPnByZXZfbW9kZQotCi0gICAgICAgICAvLyBObyBkYXRhIHJlY2VpdmVkCi0gICAgICAgICByeF90eXBlID0gUlhfTk9fREFUQTsKLQotICAgICBFTkRJ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gICAgIHJ4X3R5cGUgPSBSWF9TUEVFQ0hfR09PRDsKLSAgICAgICAgfQotICAgICAgICBlbHNlIGlmIChmcmFtZV90eXBlID09IEFNUl9TSUQpCi0gICAgICAgIHsKLSAgICAgICAgICAgIC8qIENsZWFyIG1vZGUgc3RvcmUgcHJpb3IgdG8gcmVhZGluZyBtb2RlIGluZm8gZnJvbSBpbnB1dCBidWZmZXIgKi8KLSAgICAgICAgICAgIG1vZGVTdG9yZSA9IDA7Ci0KLSAgICAgICAgICAgIGZvciAoaSA9IDA7IGkgPCBOVU1fQU1SU0lEX1JYTU9ERV9CSVRTOyBpKyspCi0gICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgdGVtcEludCA9IGRlY19ldHNfaW5wdXRfYmZyW0FNUlNJRF9SWE1PREVfQklUX09GRlNFVCtpXSA8PCBpOwotICAgICAgICAgICAgICAgIG1vZGVTdG9yZSB8PSB0ZW1wSW50OwotICAgICAgICAgICAgfQotICAgICAgICAgICAgbW9kZSA9IChlbnVtIE1vZGUpIG1vZGVTdG9yZTsKLQotICAgICAgICAgICAgLyogR2V0IFJYIGZyYW1lIHR5cGUgKi8KLSAgICAgICAgICAgIGlmIChkZWNfZXRzX2lucHV0X2JmcltBTVJTSURfUlhUWVBFX0JJVF9PRkZTRVRdID09IDApCi0gICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgcnhfdHlwZSA9IFJYX1NJRF9GSVJTVDsKLSAgICAgICAgICAgIH0KLSAgICAgICAgICAgIGVsc2UKLSAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICByeF90eXBlID0gUlhfU0lEX1VQREFURTsKLSAgICAgICAgICAgIH0KLSAgICAgICAgfQotICAgICAgICBlbHNlIGlmIChmcmFtZV90eXBlIDwgQU1SX05PX0RBVEEpCi0gICAgICAgIHsKLSAgICAgICAgICAgIC8qIEludmFsaWQgZnJhbWVfdHlwZSwgcmV0dXJuIGVycm9yIGNvZGUgKi8KLSAgICAgICAgICAgIGJ5d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gKi8KLSAgICB9Ci0gICAgZWxzZSBpZiAoc3QtPmJnSGFuZ292ZXIgPiA4KQotICAgIHsKLSAgICAgICAgbHRwTGltaXQgPSAxNTU2NTsgICAgICAgLyogMC45NSAgUTE0ICovCi0gICAgfQotICAgIGVsc2UKLSAgICB7Ci0gICAgICAgIGx0cExpbWl0ID0gMTM5MjY7ICAgICAgIC8qIDAuODUgIFExNCAqLwotICAgIH0KLQotICAgIC8qIHdlYWsgc29ydCBvZiB2b2ljaW5nIGluZGljYXRpb24uICovCi0gICAgcHJldlZvaWNlZCA9IEZBTFNFOwotCi0gICAgaWYgKGdtZWRfbigmbHRwR2Fpbkhpc3RbNF0sIDUpID4gbHRwTGltaXQpCi0gICAgewotICAgICAgICBwcmV2Vm9pY2VkID0gVFJVRTsKLSAgICB9Ci0KLSAgICBpZiAoc3QtPmJnSGFuZ292ZXIgPiAyMCkKLSAgICB7Ci0gICAgICAgIGlmIChnbWVkX24obHRwR2Fpbkhpc3QsIDkpID4gbHRwTGltaXQpCi0gICAgICAgIHsKLSAgICAgICAgICAgIHByZXZWb2ljZWQgPSBUUlVFOwotICAgICAgICB9Ci0gICAgICAgIGVsc2UKLSAgICAgICAgewotICAgICAgICAgICAgcHJldlZvaWNlZCA9IEZBTFNFOwotICAgICAgICB9Ci0gICAgfQotCi0KLSAgICBpZiAocHJldlZvaWNlZCkKLSAgICB7Ci0gICAgICAgICp2b2ljZWRIYW5nb3ZlciA9IDA7Ci0gICAgfQotICAgIGVsc2UKLSAgICB7Ci0gICAgICAgIHRlbXAgPSAqdm9pY2VkSGFuZ292ZXIgKyAxOwotCi0gICAgICAgIGlmICh0ZW1wID4gMTApCi0gICAgICAgIHsKLSAgICAgICAgICAgICp2b2ljZWRIYW5nb3ZlciA9IDEwOwotICAgICAgICB9Ci0gICAgICAgIGVsc2UKLSAgICAgICAgewotICAgICAgICAgICAgKnZvaWNlZEhhbmdvdmVyID0gdGVtcDsKLSAgICAgICAgfQotICAgIH0KLQotICAgIH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wLjI1OwotICAgICAgICAgdG1wX2RpZmYgPSBzdWIoZGlmZiwgNDUwNik7ICAgLy8gMC41NSBpbiBRMTMKLQotICAgICAgICAgLy8gbWF4KDAuMCwgZGlmZi0wLjU1KQotICAgICAgICAgaWYgKHRtcF9kaWZmID4gMCkKLSAgICAgICAgIHsKLSAgICAgICAgICAgIHRtcDEgPSB0bXBfZGlmZjsKLSAgICAgICAgIH0KLSAgICAgICAgIGVsc2UKLSAgICAgICAgIHsKLSAgICAgICAgICAgIHRtcDEgPSAwOwotICAgICAgICAgfQotCi0gICAgICAgICAvLyBtaW4oMC4yNSwgdG1wMSkKLSAgICAgICAgIGlmIChzdWIoMjA0OCwgdG1wMSkgPCAwKQotICAgICAgICAgewotICAgICAgICAgICAgYmdNaXggPSA4MTkyOwotICAgICAgICAgfQotICAgICAgICAgZWxzZQotICAgICAgICAgewotICAgICAgICAgICAgYmdNaXggPSBzaGwodG1wMSwgMik7Ci0gICAgICAgICB9Ci0gICAgICB9Ci0gICAgICBlbHNlCi0gICAgICB7Ci0gICAgICAgICAvLyBiZ01peCA9IG1pbigwLjI1LCBtYXgoMC4wLCBkaWZmLTAuNDApKSAvIDAuMjU7Ci0gICAgICAgICB0bXBfZGlmZiA9IHN1YihkaWZmLCAzMjc3KTsgLy8gMC40IGluIFExMwotCi0gICAgICAgICAvLyBtYXgoMC4wLCBkaWZmLTAuNDApCi0gICAgICAgICBpZiAodG1wX2RpZmYgPiAwKQotICAgICAgICAgewotICAgICAgICAgICAgdG1wMSA9IHRtcF9kaWZmOwotICAgICAgICAgfQotICAgICAgICAgZWxzZQotICAgICAgICAgewotICAgICAgICAgICAgdG1wMSA9IDA7Ci0gICAgICAgICB9Ci0KLSAgICAgICAgIC8vIG1pbigwLjI1LCB0bXAxKQotICAgICAgICAgaWYgKHN1YigyMDQ4LCB0bXAxKSA8IDApCi0gICAgICAgICB7Ci0gICAgICAgICAgICBiZ01peCA9IDgxOTI7Ci0gICAgICAgICB9Ci0gICAgICAgICBlbHNlCi0gICAgICAgICB7Ci0gICAgICAgICAgICBiZ01peCA9IHNobCh0bXAxLCAyKTsKLSAgICAgICAgIH0KLSAgICAgIH0KLQotICAgICAgaWYgKChzdWIoc3QtPmhhbmdDb3VudCwgNDApIDwgMCkgfHwgKHN1YihkaWZmLCA1MzI1KSA+IDApKSAvLyAwLjY1IGluIFExMwotICAgICAgewotICAgICAgICAgYmdNaXggPSA4MTkyOyAgLy8gZGlzYWJsZSBtaXggaWYgdG9vIHNob3J0IHRpbWUgc2luY2UKLSAgICAgIH0KLQotICAgICAgLy8gU21vb3RoZW4gdGhlIGNiIGdhaW4gdHJhamVjdG9yeQotICAgICAgLy8gc21vb3RoaW5nIGRlcGVuZHMgb24gbWl4IGNvbnN0YW50IGJnTWl4Ci0gICAgICBMX3N1bSA9IExfbXVsdCg2NTU0LCBzdC0+Y2JHYWluSGlzdG9yeVsyXSk7IC8vIDAuMiBpbiBRMTU7IExfc3VtIGluIFExNwotICAgICAgZm9yIChpID0gMzsgaSA8IExfQ0JHQUlOSElTVDsgaSsrKQotICAgICAgewotICAgICAgICAgTF9zdW0gPSBMX21hYyhMX3N1bSwgNjU1NCwgc3QtPmNiR2Fpbkhpc3RvcnlbaV0pOwotICAgICAgfQotICAgICAgY2JHYWluTWVhbiA9IHB2X3JvdW5kKExfc3VtKTsgICAgICAgICAgICAgICAgICAgICAgLy8gUTEKLQotICAgICAgLy8gbW9yZSBzbW9vdGhpbmcgaW4gZXJyb3IgYW5kIGJnIG5vaXNlIChOQiBubyBERkkgdXNlZCAgaGVyZSkKLSAgICAgIGlmICgoKGJmaSAhPSAwKSB8fCAocHJldl9iZiAhPSAwKSkgJiYgKGluQmFja2dyb3VuZE5vaXNlICE9IDApICYmCi0gICAgICAgICAgKChzdWIobW9kZSwgTVI0NzUpID09IDApIHx8Ci0gICAgICAgICAgIChzdWIobW9kZSwgTVI1MTUpID09IDApIHx8Ci0gICAgICAgICAgIChzdWIobW9kZSwgTVI1OSkgPT0gMC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AgZW51bSBNb2RlIG1vZGUsICAgICAgICAgICAvKiBpICAgOiBBTVIgbW9kZSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0gICAgV29yZDE2IGdhaW5fY29kZSwgICAgICAgICAvKiBpICAgOiBDQiBnYWluICAgICAgICAgICAgICAgICAgICAgICAgICAgIFExICovCi0gICAgV29yZDE2IGxzcFtdLCAgICAgICAgICAgICAvKiBpICAgOiBUaGUgTFNQIGZvciB0aGUgY3VycmVudCBmcmFtZSAgICAgUTE1ICovCi0gICAgV29yZDE2IGxzcEF2ZXJbXSwgICAgICAgICAvKiBpICAgOiBUaGUgYXZlcmFnZSBvZiBMU1AgZm9yIDggZnJhbWVzICAgUTE1ICovCi0gICAgV29yZDE2IGJmaSwgICAgICAgICAgICAgICAvKiBpICAgOiBiYWQgZnJhbWUgaW5kaWNhdGlvbiBmbGFnICAgICAgICAgICAgICovCi0gICAgV29yZDE2IHByZXZfYmYsICAgICAgICAgICAvKiBpICAgOiBwcmV2aW91cyBiYWQgZnJhbWUgaW5kaWNhdGlvbiBmbGFnICAgICovCi0gICAgV29yZDE2IHBkZmksICAgICAgICAgICAgICAvKiBpICAgOiBwb3RlbnRpYWwgZGVncmFkZWQgYmFkIGZyYW1lIGluZCBmbGFnICovCi0gICAgV29yZDE2IHByZXZfcGRmLCAgICAgICAgICAvKiBpICAgOiBwcmV2IHBvdC4gZGVncmFkZWQgYmFkIGZyYW1lIGluZCBmbGFnICovCi0gICAgV29yZDE2IGluQmFja2dyb3VuZE5vaXNlLCAvKiBpICAgOiBiYWNrZ3JvdW5kIG5vaXNlIGRlY2lzaW9uICAgICAgICAgICAgICovCi0gICAgV29yZDE2IHZvaWNlZEhhbmdvdmVyLCAgICAvKiBpICAgOiAjIG9mIGZyYW1lcyBhZnRlciBsYXN0IHZvaWNlZCBmcmFtZSAgICovCi0gICAgRmxhZyAgICpwT3ZlcmZsb3cKLSkKLXsKLSAgICBXb3JkMTYgaTsKLSAgICBXb3JkMTYgY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0KLSAgICAgICAgaWYgKHNoaWZ0ID49IDApCi0gICAgICAgIHsKLSAgICAgICAgICAgICoodG1wICsgaSkgPSBzaHIoKih0bXAgKyBpKSwgc2hpZnQsIHBPdmVyZmxvdyk7Ci0gICAgICAgICAgICAvKiBRMTUrUW4tUW0tUXg9UTEzICovCi0gICAgICAgIH0KLSAgICAgICAgZWxzZQotICAgICAgICB7Ci0gICAgICAgICAgICAqKHRtcCArIGkpID0gc2hsKCoodG1wICsgaSksIG5lZ2F0ZShzaGlmdCksIHBPdmVyZmxvdyk7Ci0gICAgICAgICAgICAvKiBRMTUrUW4tUW0tUXg9UTEzICovCi0gICAgICAgIH0KLQotICAgICAgICBkaWZmID0gYWRkKGRpZmYsICoodG1wICsgaSksIHBPdmVyZmxvdyk7ICAgICAgICAgICAvKiBRMTMgKi8KLSAgICB9Ci0KLSAgICAvKiBDb21wdXRlIGhhbmdvdmVyICovCi0KLSAgICBpZiAoZGlmZiA+IDUzMjUpICAgICAgICAgICAgICAgIC8qIDAuNjUgaW4gUTExICovCi0gICAgewotICAgICAgICBzdC0+aGFuZ1ZhciArPSAxOwotICAgIH0KLSAgICBlbHNlCi0gICAgewotICAgICAgICBzdC0+aGFuZ1ZhciA9IDA7Ci0gICAgfQotCi0KLSAgICBpZiAoc3QtPmhhbmdWYXIgPiAxMCkKLSAgICB7Ci0gICAgICAgIC8qIFNwZWVjaCBwZXJpb2QsIHJlc2V0IGhhbmdvdmVyIHZhcmlhYmxlICovCi0gICAgICAgIHN0LT5oYW5nQ291bnQgPSAwOwotICAgIH0KLQotICAgIC8qIENvbXB1dGUgbWl4IGNvbnN0YW50IChiZ01peCkgKi8KLSAgICBiZ01peCA9IDgxOTI7ICAgIC8qIDEgaW4gUTEzICovCi0KLSAgICBpZiAoKG1vZGUgPD0gTVI2NykgfHwgKG1vZGUgPT0gTVIxMDIpKQotICAgICAgICAvKiBNUjQ3NSwgTVI1MTUsIE1SNTksIE1SNjcsIE1SMTAyICovCi0gICAgewotICAgICAgICAvKiBpZiBlcnJvcnMgYW5kIHByZXN1bWVkIG5vaXNlIG1ha2Ugc21vb3RoaW5nIHByb2JhYmlsaXR5IHN0cm9uZ2VyICovCi0KLSAgICAgICAgaWYgKCgoKChwZGZpICE9IDApICYmIChwcmV2X3BkZiAhPSAwKSkgfHwgKGJmaSAhPSAwKSB8fAotICAgICAgICAgICAgICAgIChwcmV2X2JmICE9IDApKQotICAgICAgICAgICAgICAgICYmICh2b2ljZWRIYW5nb3ZlciA+IDEpCi0gICAgICAgICAgICAgICAgJiYgKGluQmFja2dyb3VuZE5vaXNlICE9IDApCi0gICAgICAgICAgICAgICAgJiYgKChtb2RlID09IE1SNDc1KSB8fCAobW9kZSA9PSBNUjUxNSkgfHwKLSAgICAgICAgICAgICAgICAgICAgKG1vZGUgPT0gTVI1OSkpKSkKLSAgICAgICAgewotICAgICAgICAgICAgLyogYmdNaXggPSBtaW4oMC4yNSwgbWF4KDAuMCwgZGlmZi0wLjU1KSkgLyAwLjI1OyAqLwotICAgICAgICAgICAgdG1wX2RpZmYgPSBzdWIoZGlmZiwgNDUwNiwgcE92ZXJmbG93KTsgICAvKiAwLjU1IGluIFExMyAqLwotICAgICAgICB9Ci0gICAgICAgIGVsc2UKLSAgICAgICAgewotICAgICAgICAgICAgLyogYmdNaXggPSBtaW4oMC4yNSwgbWF4KDAuMCwgZGlmZi0wLjQwKSkgLyAwLjI1OyAqLwotICAgICAgICAgICAgdG1wX2RpZmYgPSBzdWIoZGlmZiwgMzI3NywgcE92ZXJmbG93KTsgLyogMC40IGluIFExMyAqLwotICAgICAgICB9Ci0KLSAgICAgICAgLyogbWF4KDAuMCwgZGlmZi0wLjU1KSAgb3IgICovCi0gICAgICAgIC8qIG1heCgwLjAsIGRpZmYtMC40MCkgKi8KLSAgICAgICAgaWYgKHRtcF9kaWZmID4gMCkKLSAgICAgICAgewotICAgICAgICAgICAgdG1wMSA9IHRtcF9kaWZmOwotICAgICAgICB9Ci0gICAgICAgIGVsc2UK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AgLyogbW9yZSBzbW9vdGhpbmcgaW4gZXJyb3IgYW5kIGJnIG5vaXNlIChOQiBubyBERkkgdXNlZCBoZXJlKSAqLwotCi0gICAgICAgIGlmICgoKGJmaSAhPSAwKSB8fCAocHJldl9iZiAhPSAwKSkgJiYgKGluQmFja2dyb3VuZE5vaXNlICE9IDApCi0gICAgICAgICAgICAgICAgJiYgKChtb2RlID09IE1SNDc1KSB8fCAobW9kZSA9PSBNUjUxNSkKLSAgICAgICAgICAgICAgICAgICAgfHwgKG1vZGUgPT0gTVI1OSkpKQotICAgICAgICB7Ci0gICAgICAgICAgICAvKiAwLjE0MyBpbiBRMTU7IExfc3VtIGluIFExNyAgICAqLwotICAgICAgICAgICAgTF9zdW0gPSBMX211bHQoNDY4MSwgc3QtPmNiR2Fpbkhpc3RvcnlbMF0sIHBPdmVyZmxvdyk7Ci0gICAgICAgICAgICBmb3IgKGkgPSAxOyBpIDwgTF9DQkdBSU5ISVNUOyBpKyspCi0gICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgTF9zdW0gPQotICAgICAgICAgICAgICAgICAgICBMX21hYyhMX3N1bSwgNDY4MSwgc3QtPmNiR2Fpbkhpc3RvcnlbaV0sIHBPdmVyZmxvdyk7Ci0gICAgICAgICAgICB9Ci0gICAgICAgICAgICBjYkdhaW5NZWFuID0gcHZfcm91bmQoTF9zdW0sIHBPdmVyZmxvdyk7ICAgICAgICAgICAgICAvKiBRMSAqLwotICAgICAgICB9Ci0KLSAgICAgICAgLyogY2JHYWluTWl4ID0gYmdNaXgqY2JHYWluTWl4ICsgKDEtYmdNaXgpKmNiR2Fpbk1lYW47ICovCi0gICAgICAgIC8qIExfc3VtIGluIFExNSAqLwotICAgICAgICBMX3N1bSA9IExfbXVsdChiZ01peCwgY2JHYWluTWl4LCBwT3ZlcmZsb3cpOwotICAgICAgICBMX3N1bSA9IExfbWFjKExfc3VtLCA4MTkyLCBjYkdhaW5NZWFuLCBwT3ZlcmZsb3cpOwotICAgICAgIC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NWJpdHMgKAotICAgIFdvcmQxNiBpbmRleFtdLCAgICAvLyAoaSkgICAgIDogaW5kZXggb2YgMTAgcHVsc2VzIChzaWduK3Bvc2l0aW9uKQotICAgIFdvcmQxNiBjb2RbXSAgICAgICAvLyAobykgICAgIDogYWxnZWJyYWljIChmaXhlZCkgY29kZWJvb2sgZXhjaXRhdGlvbgotKQotewotICAgIFdvcmQxNiBpLCBqLCBwb3MxLCBwb3MyLCBzaWduLCB0bXA7Ci0KLSAgICBmb3IgKGkgPSAwOyBpIDwgTF9DT0RFOyBpKyspCi0gICAgewotICAgICAgICBjb2RbaV0gPSAwOwotICAgIH0KLQotICAgIC8vIGRlY29kZSB0aGUgcG9zaXRpb25zIGFuZCBzaWducyBvZiBwdWxzZXMgYW5kIGJ1aWxkIHRoZSBjb2Rld29yZAotCi0gICAgZm9yIChqID0gMDsgaiA8IE5CX1RSQUNLOyBqKyspCi0gICAgewotICAgICAgICAvLyBjb21wdXRlIGluZGV4IGkKLQotICAgICAgICB0bXAgPSBpbmRleFtqXTsKLSAgICAgICAgaSA9IHRtcCAmIDc7Ci0gICAgICAgIGkgPSBkZ3JheVtpXTsKLQotICAgICAgICBpID0gZXh0cmFjdF9sIChMX3NociAoTF9tdWx0IChpLCA1KSwgMSkpOwotICAgICAgICBwb3MxID0gYWRkIChpLCBqKTsgLy8gcG9zaXRpb24gb2YgcHVsc2UgImoiCi0KLSAgICAgICAgaSA9IHNociAodG1wLCAzKSAmIDE7Ci0gICAgICAgIGlmIChpID09IDApCi0gICAgICAgIHsKLSAgICAgICAgICAgIHNpZ24gPSA0MDk2OyAvLyArMS4wCi0gICAgICAgIH0KLSAgICAgICAgZWxzZQotICAgICAgICB7Ci0gICAgICAgICAgICBzaWduID0gLTQwOTY7IC8vIC0xLjAKLSAgICAgICAgfQotCi0gICAgICAgIGNvZFtwb3MxXSA9IHNpZ247Ci0KLSAgICAgICAgLy8gY29tcHV0ZSBpbmRleCBpCi0KLSAgICAgICAgaSA9IGluZG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RtcCA9ICooaW5kZXggKyBqKTsKLSAgICAgICAgaSA9IHRtcCAmIDc7Ci0gICAgICAgIGkgPSAqKGRncmF5ICsgaSk7Ci0KLSAgICAgICAgaSA9IChXb3JkMTYpKGkgKiA1KTsKLSAgICAgICAgcG9zMSA9IGkgKyBqOyAvKiBwb3NpdGlvbiBvZiBwdWxzZSAiaiIgKi8KLQotICAgICAgICBpID0gKHRtcCA+PiAzKSAmIDE7Ci0KLSAgICAgICAgaWYgKGkgPT0gMCkKLSAgICAgICAgewotICAgICAgICAgICAgc2lnbiA9IDQwOTY7ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLyogKzEuMCAqLwotICAgICAgICB9Ci0gICAgICAgIGVsc2UKLSAgICAgICAgewotICAgICAgICAgICAgc2lnbiA9IC00MDk2OyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLyogLTEuMCAqLwotICAgICAgICB9Ci0KLSAgICAgICAgKihjb2QgKyBwb3MxKSA9IHNpZ247Ci0KLSAgICAgICAgLyogY29tcHV0ZSBpbmRleCBpICovCi0KLSAgICAgICAgaSA9ICooaW5kZXggKyBqICsgNSkgJiA3OwotICAgICAgICBpID0gKihkZ3JheSArIGkpOwotICAgICAgICBpID0gKFdvcmQxNikoaSAqIDUpOwotCi0gICAgICAgIHBvczIgPSBpICsgajsgICAgICAvKiBwb3NpdGlvbiBvZiBwdWxzZSAiais1IiAqLwotCi0KLSAgICAgICAgaWYgKHBvczIgPCBwb3MxKQotICAgICAgICB7Ci0gICAgICAgICAgICBzaWduID0gbmVnYXRlKHNpZ24pOwotICAgICAgICB9Ci0gICAgICAgICooY29kICsgcG9zMikgKz0gc2lnbjsKLSAgICB9Ci0KLSAgICByZXR1cm47Ci19CmRpZmYgLS1naXQgYS9tZWRpYS9saWJzdGFnZWZyaWdodC9jb2RlY3MvYW1ybmIvZGVjL3NyYy9kMTAzNXBmLmggYi9tZWRpYS9saWJzdGFnZWZyaWdodC9jb2RlY3MvYW1ybmIvZG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AgICAgICAgICAqLwotICAgIFdvcmQxNiBjb2RbXSAgIC8qIG8gOiBhbGdlYnJhaWMgKGZpeGVkKSBjb2RlYm9vayBleGNpdGF0aW9uICAgICovCi0pCi0KLXsKLSAgICBXb3JkMTYgaTsKLSAgICBXb3JkMTYgajsKLQotICAgIFdvcmQxNiBwb3NbTkJfUFVMU0VdOwotCi0gICAgLyogRGVjb2RlIHRoZSBwb3NpdGlvbnMgKi8KLQotICAgIGogPSBpbmRleCAmIDB4MTsKLQotICAgIGluZGV4ID4+PSAxOwotCi0gICAgaSA9IGluZGV4ICYgMHg3OwotCi0gICAgcG9zWzBdID0gaSAqIDUgKyBqICogMiArIDE7Ci0KLQotCi0KLSAgICBpbmRleCA+Pj0gMzsKLQotICAgIGogPSBpbmRleCAmIDB4MzsKLQotICAgIGluZGV4ID4+PSAyOwotCi0gICAgaSA9IGluZGV4ICYgMHg3OwotCi0gICAgaWYgKGogPT0gMykKLSAgICB7Ci0gICAgICAgIHBvc1sxXSA9IGkgKiA1ICsgNDsKLSAgICB9Ci0gICAgZWxzZQotICAgIHsKLSAgICAgICAgcG9zWzFdID0gaSAqIDUgKyBqOwotICAgIH0KLQotCi0KLQotICAgIC8qIGRlY29kZSB0aGUgc2lnbnMgIGFuZCBidWlsZCB0aGUgY29kZXdvcmQgKi8KLSAgICBmb3IgKGkgPSAwOyBpIDwgTF9TVUJGUjsgaSsrKQotICAgIHsKLSAgICAgICAgY29kW2ldID0gMDsKLSAgICB9Ci0KLSAgICBmb3IgKGogPSAwOyBqIDwgTkJfUFVMU0U7IGorKykKLSAgICB7Ci0gICAgICAgIGkgPSBzaWduICYgMTsKLQotICAgICAgICAvKiBUaGlzIGxpbmUgaXMgZXF1aXZhbGVudCB0by4uLgotICAgICAgICAgKgotICAgICAgICAgKgotICAgICAgICAgKiAgaWYgKGkgPT0gMSkKLSAgICAgICAgICogIHsKLSAgICAgICAgICogICAgICBjb2RbcG9zW2pdXSA9IDgxOTE7Ci0gICAgICAgICAq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lzIGZpbGUgdW5kZXIgdGhlIHN0YW5kYXJkIGxpY2Vuc2UKLXRlcm1zIGxpc3RlZCBhYm92ZSBoYXMgYmVlbiBvYnRhaW5lZCBmcm9tIHRoZSBjb3B5cmlnaHQgaG9sZGVyLgotKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLS8qCi0qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgotKgotKiAgICAgIEdTTSBBTVItTkIgc3BlZWNoIGNvZGVjICAgUjk4ICAgVmVyc2lvbiA3LjUuMCAgIE1hcmNoIDIsIDIwMDEKLSogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFI5OSAgIFZlcnNpb24gMy4yLjAKLSogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFJFTC00IFZlcnNpb24gNC4wLjAKLSoKLSoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCi0qCi0qICAgICAgRmlsZSAgICAgICAgICAgICA6IGQyXzExcGYuaAotKiAgICAgIFB1cnBvc2UgICAgICAgICAgOiBBbGdlYnJhaWMgY29kZWJvb2sgZGVjb2RlcgotKgotKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKLSovCi0jaWZuZGVmIGQyXzExcGZfaAotI2RlZmluZSBkMl8xMXBmX2ggIiRJZCAkIgotCi0vKgotKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKLSogICAgICAgICAgICAgICAgICAgICAgICAgSU5DTFVERSBGSUxFUwotKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKLSovCi0jaW5jbHVkZSAidHlwZWRlZi5oIgotCi0jaWZkZWYgX19jcGx1c3BsdXMKLWV4dGVybiAiQyIKLXsKLSNlbmRpZgotCi0gICAgLyoKLSAgICAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgotICAgICogICAgICAgICAgICAgICAgICAgICAgICAgTE9DQUwgVkFSSUFCTEVTIEFORCBUQUJMRVMKLSAgICAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgotICAgICovCi0KLSAgICAvKgotICAgICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCi0gICAgKiAgICAgICAgICAgICAgICAgICAgICAgICBERUZJTklUSU9OIE9GIERBVEEgVFlQRVMKLSAgICAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgotICAgICovCi0KLSAgICAvKgotICAgICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCi0gICAgKiAgICAgICAgICAgICAgICAgICAgICAgICBERUNMQVJBVElPTiBPRiBQUk9UT1RZUEVTCi0gICAgKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKLSAgICAqLwotICAgIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCi0gICAgICoKLSAgICAgKiAg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DE2KShpbmRleCAmIDY0KTsKLQotICAgIGogPj49IDM7Ci0KLSAgICBpID0gaW5kZXggJiA3OwotCi0gICAgayA9Ci0gICAgICAgIHNobCgKLSAgICAgICAgICAgIHN1Yk5yLAotICAgICAgICAgICAgMSwKLSAgICAgICAgICAgIHBPdmVyZmxvdyk7Ci0KLSAgICBrICs9IGo7Ci0KLSAgICAvKiBwb3MwID1pKjUrc3RhcnRQb3Nbaio4K3N1Yk5yKjJdICovCi0gICAgcG9zWzBdID0gaSAqIDUgKyBzdGFydFBvc1trKytdOwotCi0KLSAgICBpbmRleCA+Pj0gMzsKLQotICAgIGkgPSBpbmRleCAmIDc7Ci0KLSAgICAvKiBwb3MxID1pKjUrc3RhcnRQb3Nbaio4K3N1Yk5yKjIgKyAxXSAqLwotICAgIHBvc1sxXSA9IGkgKiA1ICsgc3RhcnRQb3Nba107Ci0KLQotICAgIC8qIGRlY29kZSB0aGUgc2lnbnMgIGFuZCBidWlsZCB0aGUgY29kZXdvcmQgKi8KLQotICAgIGZvciAoaSA9IExfU1VCRlIgLSAxOyBpID49IDA7IGktLSkKLSAgICB7Ci0gICAgICAgIGNvZFtpXSA9IDA7Ci0gICAgfQotCi0gICAgZm9yIChqID0gMDsgaiA8IE5CX1BVTFNFOyBqKyspCi0gICAgewotICAgICAgICBpID0gc2lnbiAmIDB4MTsKLQotICAgICAgICAvKiBUaGlzIGxpbmUgaXMgZXF1aXZhbGVudCB0by4uLgotICAgICAgICAgKgotICAgICAgICAgKgotICAgICAgICAgKiAgaWYgKGkgPT0gMSkKLSAgICAgICAgICogIHsKLSAgICAgICAgICogICAgICBjb2RbcG9zW2pdXSA9IDgxOTE7Ci0gICAgICAgICAqICB9Ci0gICAgICAgICAqICBpZiAoaSA9PSAwKQotICAgICAgICAgKiAgewotICAgICAgICAgKiAgICAgIGNvZFtwb3Nbal1dID0gLTgxOTI7Ci0gICAgICAgICAqICB9Ci0gICAgICAgICAqLwotCi0gICAgICAgIGNvZFtwb3Nbal1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C8qIERlY29kZSB0aGUgcG9zaXRpb25zICovCi0KLSAgICBpID0gaW5kZXggJiAweDc7Ci0KLSAgICBwb3NbMF0gPSBpICogNTsKLQotCi0KLQotCi0gICAgaW5kZXggPj49IDM7Ci0KLSAgICBqID0gaW5kZXggJiAweDE7Ci0KLSAgICBpbmRleCA+Pj0gMTsKLQotICAgIGkgPSBpbmRleCAmIDB4NzsKLQotICAgIHBvc1sxXSA9IGkgKiA1ICsgaiAqIDIgKyAxOwotCi0KLQotCi0KLSAgICBpbmRleCA+Pj0gMzsKLQotICAgIGogPSBpbmRleCAmIDB4MTsKLQotICAgIGluZGV4ID4+PSAxOwotCi0gICAgaSA9IGluZGV4ICYgMHg3OwotCi0gICAgcG9zWzJdID0gaSAqIDUgKyBqICogMiArIDI7Ci0KLQotICAgIC8qIGRlY29kZSB0aGUgc2lnbnMgIGFuZCBidWlsZCB0aGUgY29kZXdvcmQgKi8KLQotICAgIGZvciAoaSA9IDA7IGkgPCBMX1NVQkZSOyBpKyspCi0gICAgewotICAgICAgICBjb2RbaV0gPSAwOwotICAgIH0KLQotICAgIGZvciAoaiA9IDA7IGogPCBOQl9QVUxTRTsgaisrKQotICAgIHsKLSAgICAgICAgaSA9IHNpZ24gJiAxOwotCi0gICAgICAgIC8qIFRoaXMgbGluZSBpcyBlcXVpdmFsZW50IHRvLi4uCi0gICAgICAgICAqCi0gICAgICAgICAqCi0gICAgICAgICAqICBpZiAoaSA9PSAxKQotICAgICAgICAgKiAgewotICAgICAgICAgKiAgICAgIGNvZFtwb3Nbal1dID0gODE5MTsKLSAgICAgICAgICogIH0KLSAgICAgICAgICogIGlmIChpID09IDApCi0gICAgICAgICAqICB7Ci0gICAgICAgICAqICAgICAgY29kW3Bvc1tqXV0gPSAtODE5MjsKLSAgICAgICAgICogIH0KLSAgICAgICAgICovCi0KLSAgICAgICAgY29kW3Bvc1tqXV0gPSBpICogMTYzODMgLSA4MTkyOwotCi0gICAgICAgIHNpZ24gPj49IDE7Ci0KL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BpbmRleCAmIDB4NzsKLQotICAgIGkgPSBkZ3JheVtpXTsKLQotICAgIHBvc1swXSA9IGkgKiA1OyAvKiBwb3MwID1pKjUgKi8KLQotCi0gICAgaW5kZXggPj49IDM7Ci0KLSAgICBpID0gaW5kZXggJiAweDc7Ci0KLSAgICBpID0gZGdyYXlbaV07Ci0KLSAgICBwb3NbMV0gPSBpICogNSArIDE7ICAvKiBwb3MxID1pKjUrMSAqLwotCi0KLQotICAgIGluZGV4ID4+PSAzOwotCi0gICAgaSA9IGluZGV4ICYgMHg3OwotCi0gICAgaSA9IGRncmF5W2ldOwotCi0gICAgcG9zWzJdID0gaSAqIDUgKyAyOyAvKiBwb3MyID1pKjUrMiAqLwotCi0KLQotCi0KLSAgICBpbmRleCA+Pj0gMzsKLQotICAgIGogPSBpbmRleCAmIDB4MTsKLQotICAgIGluZGV4ID4+PSAxOwotCi0gICAgaSA9IGluZGV4ICYgMHg3OwotCi0gICAgaSA9IGRncmF5W2ldOwotCi0gICAgcG9zWzNdID0gaSAqIDUgKyAzICsgajsgLyogcG9zMyA9aSo1KzMraiAqLwotCi0KLSAgICAvKiBkZWNvZGUgdGhlIHNpZ25zICBhbmQgYnVpbGQgdGhlIGNvZGV3b3JkICovCi0KLSAgICBmb3IgKGkgPSAwOyBpIDwgTF9TVUJGUjsgaSsrKQotICAgIHsKLSAgICAgICAgY29kW2ldID0gMDsKLSAgICB9Ci0KLSAgICBmb3IgKGogPSAwOyBqIDwgTkJfUFVMU0U7IGorKykKLSAgICB7Ci0gICAgICAgIGkgPSBzaWduICYgMHgxOwotCi0gICAgICAgIC8qIFRoaXMgbGluZSBpcyBlcXVpdmFsZW50IHRvLi4uCi0gICAgICAgICAqCi0gICAgICAgICAqCi0gICAgICAgICAqICBpZiAoaSA9PSAxKQotICAgICAgICAgKiAgewotICAgICAgICAgKiAgICAgIGNvZFtwb3Nbal1dID0gODE5MTsKLSAgICAgICAgICogIH0KLSAgICAgICAgICogIGlmIChpID09IDApCi0gICA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ci0gICAgICAgIExfbXVsdCgKLSAgICAgICAgICAgIGlhLAotICAgICAgICAgICAgMjUsCi0gICAgICAgICAgICBwT3ZlcmZsb3cpOwotCi0KLSAgICBpYSA9IChXb3JkMTYpKE1TQnMgLSAodGVtcFdvcmQzMiA+PiAxKSk7Ci0gICAgaWIgPQotICAgICAgICBtdWx0KAotICAgICAgICAgICAgaWEsCi0gICAgICAgICAgICA2NTU0LAotICAgICAgICAgICAgcE92ZXJmbG93KTsKLQotICAgIHRlbXBXb3JkMzIgPQotICAgICAgICBMX211bHQoCi0gICAgICAgICAgICBpYiwKLSAgICAgICAgICAgIDUsCi0gICAgICAgICAgICBwT3ZlcmZsb3cpOwotCi0gICAgaWIgPSBpYSAtIChXb3JkMTYpKHRlbXBXb3JkMzIgPj4gMSk7Ci0KLSAgICBpYiA9Ci0gICAgICAgIHNobCgKLSAgICAgICAgICAgIGliLAotICAgICAgICAgICAgMSwKLSAgICAgICAgICAgIHBPdmVyZmxvdyk7Ci0KLQotICAgIGljID0gTFNCcyAtICgoTFNCcyA+PiAyKSA8PCAyKTsKLQotCi0gICAgcG9zX2luZHhbaW5kZXgxXSA9IGliICsgKGljICYgMSk7Ci0KLQotICAgIGliID0KLSAgICAgICAgbXVsdCgKLSAgICAgICAgICAgIGlhLAotICAgICAgICAgICAgNjU1NCwKLSAgICAgICAgICAgIHBPdmVyZmxvdyk7Ci0KLSAgICBpYiA9Ci0gICAgICAgIHNobCgKLSAgICAgICAgICAgIGliLAotICAgICAgICAgICAgMSwKLSAgICAgICAgICAgIHBPdmVyZmxvdyk7Ci0KLQotICAgIHBvc19pbmR4W2luZGV4Ml0gPSBpYiArIChpYyA+PiAxKTsKLQotCi0gICAgaWIgPSBMU0JzID4+IDI7Ci0KLSAgICBpYyA9Ci0gICAgICAgIG11bHQoCi0gICAgICAgICAgICBNU0JzLAotICAgICAgICAgICAgMTMxMSwKLSAgICAgICAgICAgIHBPdmVyZmxvdyk7Ci0KLSAgICBpYyA9Ci0gICA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ICBMU0JzID0gaW5keFtOQl9UUkFDSysyXSU0OwotICAgICAgTVNCczBfMjQgPSAoTVNCcyoyNSsxMikvMzI7Ci0gICAgICBpZiAoKE1TQnMwXzI0LzUpJTI9PTEpCi0gICAgICAgICBwb3NfaW5keFszXSA9ICg0LShNU0JzMF8yNCU1KSkqMiArIExTQnMlMjsKLSAgICAgIGVsc2UKLSAgICAgICAgIHBvc19pbmR4WzNdID0gKE1TQnMwXzI0JTUpKjIgKyBMU0JzJTI7Ci0gICAgICBwb3NfaW5keFs3XSA9IChNU0JzMF8yNC81KSoyICsgTFNCcy8yOwotICAgICAgKi8KLQotICAgIE1TQnMgPSBpbmR4W05CX1RSQUNLX01SMTAyKzJdID4+IDI7Ci0KLSAgICBMU0JzID0gaW5keFtOQl9UUkFDS19NUjEwMisyXSAmIDB4MzsKLQotICAgIHRlbXBXb3JkMzIgPQotICAgICAgICBMX211bHQoCi0gICAgICAgICAgICBNU0JzLAotICAgICAgICAgICAgMjUsCi0gICAgICAgICAgICBwT3ZlcmZsb3cpOwotCi0gICAgaWEgPQotICAgICAgICAoV29yZDE2KQotICAgICAgICBMX3NocigKLSAgICAgICAgICAgIHRlbXBXb3JkMzIsCi0gICAgICAgICAgICAxLAotICAgICAgICAgICAgcE92ZXJmbG93KTsKLQotICAgIGlhICs9IDEyOwotCi0gICAgTVNCczBfMjQgPSBpYSA+PiA1OwotCi0KLSAgICBpYSA9Ci0gICAgICAgIG11bHQoCi0gICAgICAgICAgICBNU0JzMF8yNCwKLSAgICAgICAgICAgIDY1NTQsCi0gICAgICAgICAgICBwT3ZlcmZsb3cpOwotCi0gICAgaWEgJj0gMTsKLQotCi0gICAgaWIgPQotICAgICAgICBtdWx0KAotICAgICAgICAgICAgTVNCczBfMjQsCi0gICAgICAgICAgICA2NTU0LAotICAgICAgICAgICAgcE92ZXJmbG93KTsKLQotICAgIHRlbXBXb3JkMzIgPQotICAgICAgICBMX211bHQoCi0gICAgICAgICAgICBpYiwKLSAgICAgICAgICAgIDUsCi0gICAgICAgICAgICBwT3ZlcmZsb3cpOwotCi0KLSAgICBpYiA9IE1TQnMwXzI0IC0gKFdvcmQxNikodGVtcFdvcmQzMiA+PiAxKTsKLQotICAgIGlmIChpYSA9PSAxKQotICAgIHsKLSAgICAgICAgaWIgPSA0IC0gaWI7Ci0KLSAgICB9Ci0KLQotICAgIGliID0KLSAgICAgICAgc2hsKAotICAgICAgICAgICAgaWIsCi0gICAgICAgICAgICAxLAotICAgICAgICAgICAgcE92ZXJmbG93KTsKLQotICAgIGlhID0gTFNCcyAmIDB4MTsKLQotICAgIHBvc19pbmR4WzNdID0KLSAgICAgICAgYWRkKAotICAgICAgICAgICAgaWIsCi0gICAgICAgICAgICBpYSwKLSAgICAgICAgICAgIHBPdmVyZmxvdyk7Ci0KLSAgICBpYSA9Ci0gICAgICAgIG11bHQoCi0gICAgICAgICAgICBNU0JzMF8yNCwKLSAgICAgICAgICAgIDY1NTQsCi0gICAgICAgICAgICBwT3ZlcmZsb3cpOwotCi0gICAgaWEgPQotICAgICAgICBzaGwoCi0gICAgICAgICAgICBpYSwKLSAgICAgICAgICAgIDEsCi0gICAgICAgICAgICBwT3ZlcmZsb3cpOwotCi0gICAgcG9zX2luZHhbN10gPSBpYSArIChMU0JzID4+IDEpOwotCi19Ci0KLS8qCi0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0KLSBGVU5DVElPTiBOQU1FOiBkZWNfOGk0MF8zMWJpdHMKLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLQotIElOUFVUIEFORCBPVVRQVVQgREVGSU5JVElPTlMKLQotIElucHV0czoKLSAgICBpbmRleCAgIGFycmF5IG9mIHR5cGUgV29yZDE2IC0tICB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qIE5CX1RSQUNLX01SMTAyID0gNCAqLwotICAgIHsKLSAgICAgICAgLyogcG9zaXRpb24gb2YgcHVsc2UgImoiICovCi0KLSAgICAgICAgcG9zMSA9IChsaW5lYXJfY29kZXdvcmRzW2pdIDw8IDIpICsgajsKLQotCi0gICAgICAgIGlmIChsaW5lYXJfc2lnbnNbal0gPT0gMCkKLSAgICAgICAgewotICAgICAgICAgICAgc2lnbiA9IFBPU19DT0RFOyAvKiArMS4wICovCi0gICAgICAgIH0KLSAgICAgICAgZWxzZQotICAgICAgICB7Ci0gICAgICAgICAgICBzaWduID0gLU5FR19DT0RFOyAvKiAtMS4wICovCi0gICAgICAgIH0KLQotICAgICAgICBpZiAocG9zMSA8IExfU1VCRlIpCi0gICAgICAgIHsKLSAgICAgICAgICAgIGNvZFtwb3MxXSA9IHNpZ247ICAgIC8qIGF2b2lkIGJ1ZmZlciBvdmVyZmxvdyAqLwotICAgICAgICB9Ci0KLSAgICAgICAgLyogY29tcHV0ZSBpbmRleCBpICovCi0gICAgICAgIC8qIHBvc2l0aW9uIG9mIHB1bHNlICJqKzQiICovCi0KLSAgICAgICAgcG9zMiA9IChsaW5lYXJfY29kZXdvcmRzW2ogKyA0XSA8PCAyKSArIGo7Ci0KLQotICAgICAgICBpZiAocG9zMiA8IHBvczEpCi0gICAgICAgIHsKLSAgICAgICAgICAgIHNpZ24gPSBuZWdhdGUoc2lnbik7Ci0gICAgICAgIH0KLQotICAgICAgICBpZiAocG9zMiA8IExfU1VCRlIpCi0gICAgICAgIHsKLSAgICAgICAgICAgIGNvZFtwb3MyXSArPSBzaWduOyAgICAgLyogYXZvaWQgYnVmZmVyIG92ZXJmbG93ICovCi0gICAgICAgIH0KLQotCi0gICAgfSAvKiBmb3IgKGogPSAwOyBqIDwgTkJfVFJBQ0tfTVIxMDI7IGorKykgKi8KLQotICAgIHJldHVybjsKLX0KZGlmZiAtLWdpdCBhL21lZGlhL2xpYnN0YWdlZnJpZ2h0L2NvZGVjcy9hbXJu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n5+fn5+fn5+fn5+fn5+fn4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICoKLSAgICAgKiAgZ2MwICAgICA9IFBvdzIoaW50KGQpK2ZyYWMoZCkpICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqCi0gICAgICogICAgICAgICAgPSAyXmV4cCArIDJeZnJhYyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKgotICAgICAqICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICoKLSAgICAgKi0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0qLwotCi0gICAgZ2NfcHJlZChwcmVkX3N0YXRlLCBtb2RlLCBjb2RlLCAmZXhwLCAmZnJhYywKLSAgICAgICAgICAgICZleHBfaW5uX2VuLCAmZnJhY19pbm5fZW4sIHBPdmVyZmxvdyk7Ci0KLSAgICBpbmRleCAmPSAzMTsgICAgICAgICAgICAgICAgICAgIC8qIGluZGV4IDwgMzIsIHRvIGF2b2lkIGJ1ZmZlciBvdmVyZmxvdyAqLwotICAgIHRibF90bXAgPSBpbmRleCArIChpbmRleCA8PCAxKTsKLQotICAgIHAgPSAmcXVhX2dhaW5fY29kZVt0YmxfdG1wXTsKLQotICAgIC8qIERpZmZlcmVudCBzY2FsaW5ncyBiZXR3ZWVuIE1SMTIyIGFuZCB0aGUgb3RoZXIgbW9kZXMgKi8KLSAgICB0ZW1wID0gc3ViKChXb3JkMTYpbW9kZSwgKFdvcmQxNilNUjEyMiwgcE92ZXJmbG93KTsKLSAgICBpZiAodGVtcCA9PSAwKQotICAgIHsKLSAgICAgICAgZ2NvZGUwID0gKFdvcmQxNikoUG93MihleHAsIGZyYWMsIHBPdmVyZmxvdykpOyAgICAvKiBwcmVkaWN0ZWQgZ2FpbiAqLwotICA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0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSovCi0KLQotLyotLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tCi07IEZVTkNUSU9OIENPREUKLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0qLwotCi12b2lkIERfcGxzZl8zKAotICAgIERfcGxzZlN0YXRlICpzdCwgICAvKiBpL286IFN0YXRlIHN0cnVjdCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotICAgIGVudW0gTW9kZSBtb2RlLCAgICAvKiBpICA6IGNvZGVyIG1vZGUgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotICAgIFdvcmQxNiBiZmksICAgICAgICAvKiBpICA6IGJhZCBmcmFtZSBpbmRpY2F0b3IgKHNldCB0byAxIGlmIGEgICAgICAgICAqLwotICAgIC8qICAgICAgYmFkIGZyYW1lIGlzIHJlY2VpdmVkKSAgICAgICAgICAgICAgICAgICAgICovCi0gICAgV29yZDE2ICogaW5kaWNlLCAgIC8qIGkgIDogcXVhbnRpemF0aW9uIGluZGljZXMgb2YgMyBzdWJtYXRyaWNlcywgUTAgICovCi0gICAgV29yZDE2ICogbHNwMV9xLCAgIC8qIG8gIDogcXVhbnRpemVkIDFzdCBMU1AgdmVjdG9yLCAgICAgICAgICAgICAgUTE1ICovCi0gICAgRmxhZyAgKnBPdmVyZmxvdyAgIC8qIG8gOiBGbGFnIHNldCB3aGVuIG92ZXJmbG93IG9jY3VycyAgICAgICAgICAgICAgICovCi0pCi17Ci0gICAgV29yZDE2IGk7Ci0gICAgV29yZDE2IHRlbXA7Ci0gICAgV29yZDE2IGluZGV4OwotCi0gICAgV29yZDE2IGxzZjFfcltNXTsKLSAgICBXb3JkMTYgbHNmMV9xW01dOwotCi0gICAgaWYgKGJmaSAhPSAwKSAgIC8qIGlmIGJhZCBmcmFtZSAqLwotICAgIHsKLSAgICAgICAgLyogdXNlIHRoZSBwYXN0IExTRnMgc2xpZ2h0bHkgc2hpZnRlZCB0b3dhcmRzIHRoZWlyIG1lYW4gKi8KLQotICAgICAgICBmb3IgKGkgPSAwOyBpIDwgTTsgaSsrKQotICAgICAgICB7Ci0gICAgICAgICAgICAvKiBsc2ZpX3FbaV0gPSBBTFBIQSpwYXN0X2xzZl9xW2ldICsgT05FX0FMUEhBKm1lYW5fbHNmW2ldOyAqLwotICAgICAgICAgICAgdGVtcCA9Ci0gICAgICAgICAgICAgICAgbXVsdCgKLSAgICAgICAgICAgICAgICAgICAgc3QtPnBhc3RfbHNmX3FbaV0sCi0gICAgICAgICAgICAgICAgICAgIEFMUEhBLAotICAgICAgICAgICAgICAgICAgICBwT3ZlcmZsb3cpOwotCi0gICAgICAgICAgICBpbmRleCA9Ci0gICAgICAgICAgICAgICAgbXVsdCgKLSAgICAgICAgICAgICAgICAgICAgbWVhbl9sc2ZfM1tpXSwKLSAgICAgICAgICAgICAgICAgICAgT05FX0FMUEhBLAotICAgICAgICAgICAgICAgICAgICBwT3ZlcmZsb3cpOwotCi0gICAgICAgICAgICBsc2YxX3FbaV0gPQotICAgICAgICAgICAgICAgIGFkZCgKLSAgICAgICAgICAgICAgICAgICAgaW5kZXgsCi0gICAgICAgICAgICAgICAgICAgIHRlbXAsCi0gICAgICAgICAgICAgICAgICAgIHBPdmVyZmxvdyk7Ci0gICAgICAgIH0KLQotICAgICAgICAvKiBlc3RpbWF0ZSBwYXN0IHF1YW50aXplZCByZXNpZHVhbCB0byBiZSB1c2VkIGluIG5leHQgZnJhbWUgKi8KLSAgICAgICAgaWYgKG1vZGUgIT0gTVJEVFgpCi0gICAgICAgIHsKLSAgICAgICAgICAgIGZvciAoaSA9IDA7IGkgPCBNOyBpKyspCi0gICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgLyogdGVtcCAgPSBtZWFuX2xzZltpXSArICBwYXN0X3IyX3FbaV0gKiBQUkVEX0ZBQzsgKi8KLQotICAgICAgICAgICAgICAgIHRlbXAgPQotICAgICAgICAgICAgICAgICAgICBtdWx0KAotICAgICAgICAgICAgICAgICAgICAgICAgc3QtPnBhc3Rfcl9xW2ldLAotICAgICAgICAgICAgICAgICAgICAgICAgcHJlZF9mYWNfM1tpXSwKLSAgICAgICAgICAgICAgICAgICAgICAgIHBPdmVyZmxvdyk7Ci0KLSAgICAgICAgICAgICAgICB0ZW1wID0KLSAgICAgICAgICAgICAgICAgICAgYWRkKAotICAgICAgICAgICAgICAgICAgICAgICAgbWVhbl9sc2ZfM1tpXSwKLSAgICAgICAgICAgICAgICAgICAgICAgIHRlbXAsCi0gICAgICAgICAgICAgICAgICAgICAgICBwT3ZlcmZsb3cpOwotCi0gICAgICAgICAgICAgICAgc3QtPnBhc3Rfcl9xW2ldID0KLSAgICAgICAgICAgICAgICAgICAgc3ViKAotICAgICAgICAgICAgICAgICAgICAgICAgbHNmMV9xW2ldLAotICAgICAgICAgICAgICAgICAgICAgICAgdGVtcCwKLSAgICAgICAgICAgICAgICAgICAgICAgIHBPdmVyZmxvdyk7Ci0gICAgICAgICAgICB9Ci0KLSAgICAgICAgfSAvKiBpZiAobW9kZSA9PSBNUkRUWCkgKi8KLSAgICAgICAgZWxzZQotICAgICAgICB7Ci0gICAgICAgICAgICBmb3IgKGkgPSAwOyBpIDwgTTsgaSsrKQotICAgICAgICAgICAgewotICAgICAgICAgICAgICAgIC8qIHRlbXAgID0gbWVhbl9sc2ZbaV0gKyAgcGFzdF9yMl9xW2ldOyAqLwotCi0gICAgICAgICAgICAgICAgdGVtcCA9Ci0gICAgICAgICAgICAgICAgICAgIGFkZCgKLSAgICAgICAgICAgICAgICAgICAgICAgIG1lYW5fbHNmXzNbaV0sCi0gICAgICAgICAgICAgICAgICAgICAgICBzdC0+cGFzdF9yX3FbaV0sCi0gICAgICAgICAgICAgICAgICAgICAgICBwT3ZlcmZsb3cpOwotCi0gICAgICAgICAgICAgICAgc3QtPnBhc3Rfcl9xW2ldID0KLSAgICAgICAgICAgICAgICAgICAgc3ViKAotICAgICAgICAgICAgICAgICAgICAgICAgbHNmMV9xW2ldLAotICAgICAgICAgICAgICAgICAgICAgICAgdGVtcCwKLSAgICAgICAgICAgICAgICAgICAgICAgIHBPdmVyZmxvdyk7Ci0gICAgICAgICAgICB9Ci0gICAgICAgIH0KLQotICAgIH0gLyogaWYgKGJmaSAhPSAwKSAqLwotCi0gICAgZWxzZSAgLyogaWYgZ29vZCBMU0ZzIHJlY2VpdmVkICovCi0gICAgewotCi0gICAgICAgIFdvcmQxNiBpbmRleF9saW1pdF8xID0gMDsKLSAgICAgICAgV29yZDE2IGluZGV4X2xpbWl0XzIgPSAoRElDTzJfU0laRSAtIDEpICogMzsKLSAgICAgICAgV29yZDE2IGluZGV4X2xpbWl0XzMgPSAwOwotCi0gICAgICAgIGNvbnN0IFdvcmQxNiAqcF9jYjE7Ci0gICAgICAgIGNvbnN0IFdvcmQxNiAqcF9jYjI7Ci0gICAgICAgIGNvbnN0IFdvcmQxNiAqcF9jYjM7Ci0gICAgICAgIGNvbnN0IFdvcmQxNiAqcF9kaWNvOwotCi0KLSAgICAgICAgcF9jYjIgPSBkaWNvMl9sc2ZfMzsgICAgLyogc2l6ZSBESUNPMl9TSVpFKjMgKi8KLQotICAgICAgICBpZiAoKG1vZGUgPT0gTVI0NzUpIHx8IChtb2RlID09IE1SNTE1KSkKLSAgICAgICAgeyAgIC8qIE1SNDc1LCBNUjUxNSAqLwotICAgICAgICAgICAgcF9jYjEgPSBkaWNvMV9sc2ZfMzsgICAgLyogc2l6ZSBESUNPMV9TSVpFKjMgKi8KLSAgICAgICAgICAgIHBfY2IzID0gbXI1MTVfM19sc2Y7ICAgIC8qIHNpemUgTVI1MTVfM19TSVpFKjQgKi8KLQotICAgICAgICAgICAgaW5kZXhfbGltaXRfMSA9IChESUNPMV9TSVpFIC0gMSkgKiAzOwotICAgICAgICAgICAgaW5kZXhfbGltaXRfMyA9IChNUjUxNV8zX1NJWkUgLSAxKSAqIDQ7Ci0KLSAgICAgICAgfQotICAgICAgICBlbHNlIGlmIChtb2RlID09IE1SNzk1KQotICAgICAgICB7ICAgLyogTVI3OTUgKi8KLSAgICAgICAgICAgIHBfY2IxID0gbXI3OTVfMV9sc2Y7ICAgIC8qIHNpemUgTVI3OTVfMV9TSVpFKjMgKi8KLSAgICAgICAgICAgIHBfY2IzID0gZGljbzNfbHNmXzM7ICAgIC8qIHNpemUgRElDTzNfU0laRSo0ICovCi0KLSAgICAgICAgICAgIGluZGV4X2xpbWl0XzEgPSAoTVI3OTVfMV9TSVpFIC0gMSkgKiAzOwotICAgICAgICAgICAgaW5kZXhfbGltaXRfMyA9IChESUNPM19TSVpFIC0gMSkgKiA0OwotCi0gICAgICAgIH0KLSAgICAgICAgZWxzZQotICAgICAgICB7ICAgLyogTVI1OSwgTVI2NywgTVI3NCwgTVIxMDIsIE1SRFRYICovCi0gICAgICAgICAgICBwX2NiMSA9IGRpY28xX2xzZl8zOyAgICAvKiBzaXplIERJQ08xX1NJWkUqMyAqLwotICAgICAgICAgICAgcF9jYjMgPSBkaWNvM19sc2ZfMzsgICAgLyogc2l6ZSBESUNPM19TSVpFKjQgKi8KLQotICAgICAgICAgICAgaW5kZXhfbGltaXRfMSA9IChESUNPMV9TSVpFIC0gMSkgKiAzOwotICAgICAgICAgICAgaW5kZXhfbGltaXRfMyA9IChESUNPM19TSVpFIC0gMSkgKiA0OwotCi0gICAgICAgIH0KLQotICAgICAgICAvKiBkZWNvZGUgcHJlZGljdGlvbiByZXNpZHVhbHMgZnJvbSAzIHJlY2VpdmVkIGluZGljZXMgKi8KLQotICAgICAgICBpbmRleCA9ICppbmRpY2UrKzsKLQotICAgICAgICAvKiB0ZW1wID0gMyppbmRleDsgKi8KLSAgICAgICAgdGVtcCA9IGluZGV4ICsgKGluZGV4IDw8IDEpOwotCi0gICAgICAgIGlmICh0ZW1wID4gaW5kZXhfbGltaXRfMSkKLSAgICAgICAgewotICAgICAgICAgICAgdGVtcCA9IGluZGV4X2xpbWl0XzE7ICAvKiBhdm9pZCBidWZmZXIgb3ZlcnJ1biAqLwotICAgICAgICB9Ci0KLSAgICAgICAgcF9kaWNvID0gJnBfY2IxW3RlbXBdOwotCi0gICAgICAgIGxzZjFfclswXSA9ICpwX2RpY28rKzsKLSAgICAgICAgbHNmMV9yWzFdID0gKnBfZGljbysrOwotICAgICAgICBsc2YxX3JbMl0gPSAqcF9kaWNvKys7Ci0KLSAgICAgICAgaW5kZXggPSAqaW5kaWNlKys7Ci0KLSAgICAgICAgaWYgKG1vZGUgPT0gTVI0NzUgfHwgbW9kZSA9PSBNUjUxNSkKLSAgICAgICAgeyAgIC8qIE1SNDc1LCBNUjUxNSBvbmx5IHVzaW5nIGV2ZXJ5IHNlY29uZCBlbnRyeSAqLwotICAgICAgICAgICAgaW5kZXggPDw9IDE7Ci0gICAgICAgIH0KLQotICAgICAgICAvKiB0ZW1wID0gMyppbmRleCAqLwotICAgICAgICB0ZW1wID0gaW5kZXggKyAoaW5kZXggPDwgMSk7Ci0KLSAgICAgICAgaWYgKHRlbXAgPiBpbmRleF9saW1pdF8yKQotICAgICAgICB7Ci0gICAgICAgICAgICB0ZW1wID0gaW5kZXhfbGltaXRfMjsgIC8qIGF2b2lkIGJ1ZmZlciBvdmVycnVuICovCi0gICAgICAgIH0KLQotICAgICAgICBwX2RpY28gPSAmcF9jYjJbdGVtcF07Ci0KLSAgICAgICAgbHNmMV9yWzNdID0gKnBfZGljbysrOwotICAgICAgICBsc2YxX3JbNF0gPSAqcF9kaWNvKys7Ci0gICAgICAgIGxzZjFfcls1XSA9ICpwX2RpY28rKzsKLQotICAgICAgICBpbmRleCA9ICppbmRpY2UrKzsKLQotICAgICAgICB0ZW1wID0gaW5kZXggPDwgMjsKLQotICAgICAgICBpZiAodGVtcCA+IGluZGV4X2xpbWl0XzMpCi0gICAgICAgIHsKLSAgICAgICAgICAgIHRlbXAgPSBpbmRleF9saW1pdF8zOyAgLyogYXZvaWQgYnVmZmVyIG92ZXJydW4gKi8KLSAgICAgICAgfQotCi0KLSAgICAgICAgcF9kaWNvID0gJnBfY2IzW3RlbXBdOwotCi0gICAgICAgIGxzZjFfcls2XSA9ICpwX2RpY28rKzsKLSAgICAgICAgbHNmMV9yWzddID0gKnBfZGljbysrOwotICAgICAgICBsc2YxX3JbOF0gPSAqcF9kaWNvKys7Ci0gICAgICAgIGxzZjFfcls5XSA9ICpwX2RpY28rKzsKLQotICAgICAgICAvKiBDb21wdXRlIHF1YW50aXplZCBMU0ZzIGFuZCB1cGRhdGUgdGhlIHBhc3QgcXVhbnRpemVkIHJlc2lkdWFsICovCi0KLSAgICAgICAgaWYgKG1vZGUgIT0gTVJEVFgpCi0gICAgICAgIHsKLSAgICAgICAgICAgIGZvciAoaSA9IDA7IGkgPCBNOyBpKyspCi0gICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgdGVtcCA9Ci0gICAgICAgICAgICAgICAgICAgIG11bHQoCi0gICAgICAgICAgICAgICAgICAgICAgICBzdC0+cGFzdF9yX3FbaV0sCi0gICAgICAgICAgICAgICAgICAgICAgICBwcmVkX2ZhY18zW2ldLAotICAgICAgICAgICAgICAgICAgICAgICAgcE92ZXJmbG93KTsKLQotICAgICAgICAgICAgICAgIHRlbXAgPQotICAgICAgICAgICAgICAgICAgICBhZGQoCi0gICAgICAgICAgICAgICAgICAgICAgICBtZWFuX2xzZl8zW2ldLAotICAgICAgICAgICAgICAgICAgICAgICAgdGVtcCwKLSAgICAgICAgICAgICAgICAgICAgICAgIHBPdmVyZmxvdyk7Ci0KLSAgICAgICAgICAgICAgICBsc2YxX3FbaV0gPQotICAgICAgICAgICAgICAgICAgICBhZGQoCi0gICAgICAgICAgICAgICAgICAgICAgICBsc2YxX3JbaV0sCi0gICAgICAgICAgICAgICAgICAgICAgICB0ZW1wLAotICAgICAgICAgICAgICAgICAgICAgICAgcE92ZXJmbG93KTsKLQotICAgICAgICAgICAgICAgIHN0LT5wYXN0X3JfcVtpXSA9IGxzZjFfcltpXTsKLSAgICAgICAgICAgIH0KLSAgICAgICAgfQotICAgICAgICBlbHNlCi0gICAgICAgIHsKLSAgICAgICAgICAgIGZvciAoaSA9IDA7IGkgPCBNOyBpKyspCi0gICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgdGVtcCA9Ci0gICAgICAgICAgICAgICAgICAgIGFkZCgKLSAgICAgICAgICAgICAgICAgICAgICAgIG1lYW5fbHNmXzNbaV0sCi0gICAgICAgICAgICAgICAgICAgICAgICBzdC0+cGFzdF9yX3FbaV0sCi0gICAgICAgICAgICAgICAgICAgICAgICBwT3ZlcmZsb3cpOwotCi0gICAgICAgICAgICAgICAgbHNmMV9xW2ldID0KLSAgICAgICAgICAgICAgICAgICAgYWRkKAotICAgICAgICAgICAgICAgICAgICAgICAgbHNmMV9yW2ldLAotICAgICAgICAgICAgICAgICAgICAgICAgdGVtcCwKLSAgICAgICAgICAgICAgICAgICAgICAgIHBPdmVyZmxvdyk7Ci0KLSAgICAgICAgICAgICAgICBzdC0+cGFzdF9yX3FbaV0gPSBsc2YxX3JbaV07Ci0gICAgICAgICAgICB9Ci0gICAgICAgIH0KLQotICAgIH0KLQotICAgIC8qIHZlcmlmaWNhdGlvbiB0aGF0IExTRnMgaGFzIG1pbmltdW0gZGlzdGFuY2Ugb2YgTFNGX0dBUCBIeiAqLwotCi0gICAgUmVvcmRlcl9sc2YoCi0gICAgICAgIGxzZjFfcSwKLSAgICAgICAgTFNGX0dBUCwKLSAgICAgICAgTSwKLSAgICAgICAgcE92ZXJmbG93KTsKLQotICAgIENvcHkoCi0gICAgICAgIGxzZjFfcSwKLSAgICAgICAgc3QtPnBhc3RfbHNmX3EsCi0gICAgICAgIE0pOwotCi0gICAgLyogIGNvbnZlcnQgTFNGcyB0byB0aGUgY29zaW5lIGRvbWFpbiAqLwotCi0g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IHJlY2VpdmVkIGluZGljZXMKLQotICAgICAgICBwX2RpY28gPSAmZGljbzFfbHNmW3NobCAoaW5kaWNlWzBdLCAyKV07Ci0gICAgICAgIGxzZjFfclswXSA9ICpwX2RpY28rKzsKLSAgICAgICAgbHNmMV9yWzFdID0gKnBfZGljbysrOwotICAgICAgICBsc2YyX3JbMF0gPSAqcF9kaWNvKys7Ci0gICAgICAgIGxzZjJfclsxXSA9ICpwX2RpY28rKzsKLQotICAgICAgICBwX2RpY28gPSAmZGljbzJfbHNmW3NobCAoaW5kaWNlWzFdLCAyKV07Ci0gICAgICAgIGxzZjFfclsyXSA9ICpwX2RpY28rKzsKLSAgICAgICAgbHNmMV9yWzNdID0gKnBfZGljbysrOwotICAgICAgICBsc2YyX3JbMl0gPSAqcF9kaWNvKys7Ci0gICAgICAgIGxzZjJfclszXSA9ICpwX2RpY28rKzsKLQotICAgICAgICBzaWduID0gaW5kaWNlWzJdICYgMTsKLSAgICAgICAgaSA9IHNociAoaW5kaWNlWzJdLCAxKTsKLSAgICAgICAgcF9kaWNvID0gJmRpY28zX2xzZltzaGwgKGksIDIpXTsKLQotICAgICAgICBpZiAoc2lnbiA9PSAwKQotICAgICAgICB7Ci0gICAgICAgICAgICBsc2YxX3JbNF0gPSAqcF9kaWNvKys7Ci0gICAgICAgICAgICBsc2YxX3JbNV0gPSAqcF9kaWNvKys7Ci0gICAgICAgICAgICBsc2YyX3JbNF0gPSAqcF9kaWNvKys7Ci0gICAgICAgICAgICBsc2YyX3JbNV0gPSAqcF9kaWNvKys7Ci0gICAgICAgIH0KLSAgICAgICAgZWxzZQotICAgICAgICB7Ci0gICAgICAgICAgICBsc2YxX3JbNF0gPSBuZWdhdGUgKCpwX2RpY28rKyk7Ci0gICAgICAgICAgICBsc2YxX3JbNV0gPSBuZWdhdGUgKCpwX2RpY28rKyk7Ci0gICAgICAgICAgICBsc2YyX3JbNF0gPSBuZWdhdGUgKCpwX2RpY28rKyk7Ci0gICAgICAgICAgICBsc2Y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YWcgc2V0IHdoZW4gb3ZlcmZsb3cgb2NjdXJzICAgICAgICAgICAgICAgICovCi0pCi17Ci0gICAgcmVnaXN0ZXIgV29yZDE2IGk7Ci0gICAgV29yZDE2IHRlbXA7Ci0gICAgV29yZDE2IHNpZ247Ci0KLSAgICBjb25zdCBXb3JkMTYgKnBfZGljbzsKLQotICAgIFdvcmQxNiBsc2YxX3JbTV07Ci0gICAgV29yZDE2IGxzZjJfcltNXTsKLSAgICBXb3JkMTYgbHNmMV9xW01dOwotICAgIFdvcmQxNiBsc2YyX3FbTV07Ci0KLSAgICBpZiAoYmZpICE9IDApICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8qIGlmIGJhZCBmcmFtZSAqLwotICAgIHsKLSAgICAgICAgLyogdXNlIHRoZSBwYXN0IExTRnMgc2xpZ2h0bHkgc2hpZnRlZCB0b3dhcmRzIHRoZWlyIG1lYW4gKi8KLQotICAgICAgICBmb3IgKGkgPSAwOyBpIDwgTTsgaSsrKQotICAgICAgICB7Ci0gICAgICAgICAgICAvKgotICAgICAgICAgICAgICogIGxzZmlfcVtpXSA9IEFMUEhBKnN0LT5wYXN0X2xzZl9xW2ldICsKLSAgICAgICAgICAgICAqICBPTkVfQUxQSEEqbWVhbl9sc2ZbaV07Ci0gICAgICAgICAgICAgKi8KLQotICAgICAgICAgICAgdGVtcCA9Ci0gICAgICAgICAgICAgICAgbXVsdCgKLSAgICAgICAgICAgICAgICAgICAgc3QtPnBhc3RfbHNmX3FbaV0sCi0gICAgICAgICAgICAgICAgICAgIEFMUEhBLAotICAgICAgICAgICAgICAgICAgICBwT3ZlcmZsb3cpOwotCi0gICAgICAgICAgICBzaWduID0KLSAgICAgICAgICAgICAgICBtdWx0KAotICAgICAgICAgICAgICAgICAgICAqKG1lYW5fbHNmXzUgKyBpKSwKLSAgICAgICAgICAgICAgICAgICAgT05FX0FMUEhBLAotICAgICAgICAgICAgICAgICAgICBwT3ZlcmZsb3cpOwotCi0gICAgICAgICAgICAqKGxzZjFfcSArIGkpID0KLSAgICAgICAgICAgICAgICBhZGQoCi0gICAgICAgICAgICAgICAgICAgIHNpZ24sCi0gICAgICAgICAgICAgICAgICAgIHRlbXAsCi0gICAgICAgICAgICAgICAgICAgIHBPdmVyZmxvdyk7Ci0KLSAgICAgICAgICAgICoobHNmMl9xICsgaSkgPSAqKGxzZjFfcSArIGkpOwotCi0gICAgICAgICAgICAvKgotICAgICAgICAgICAgICogZXN0aW1hdGUgcGFzdCBxdWFudGl6ZWQgcmVzaWR1YWwgdG8gYmUgdXNlZCBpbgotICAgICAgICAgICAgICogbmV4dCBmcmFtZQotICAgICAgICAgICAgICovCi0KLSAgICAgICAgICAgIC8qCi0gICAgICAgICAgICAgKiB0ZW1wICA9IG1lYW5fbHNmW2ldICsKLSAgICAgICAgICAgICAqIHN0LT5wYXN0X3JfcVtpXSAqIExTUF9QUkVEX0ZBQ19NUjEyMjsKLSAgICAgICAgICAgICAqLwotCi0gICAgICAgICAgICB0ZW1wID0KLSAgICAgICAgICAgICAgICBtdWx0KAotICAgICAgICAgICAgICAgICAgICBzdC0+cGFzdF9yX3FbaV0sCi0gICAgICAgICAgICAgICAgICAgIExTUF9QUkVEX0ZBQ19NUjEyMiwKLSAgICAgICAgICAgICAgICAgICAgcE92ZXJmbG93KTsKLQotICAgICAgICAgICAgdGVtcCA9Ci0gICAgICAgICAgICAgICAgYWRkKAotICAgICAgICAgICAgICAgICAgICAqKG1lYW5fbHNmXzUgKyBpKSwKLSAgICAgICAgICAgICAgICAgICAgdGVtcCwKLSAgICAgICAgICAgICAgICAgICAgcE92ZXJmbG93KTsKLQotICAgICAgICAgICAgc3QtPnBhc3Rfcl9xW2ldID0KLSAgICAgICAgICAgICAgICBzdWIoCi0gICAgICAgICAgICAgICAgICAgICoobHNmMl9xICsgaSksCi0gICAgICAgICAgICAgICAgICAgIHRlbXAsCi0gICAgICAgICAgICAgICAgICAgIHBPdmVyZmxvdyk7Ci0gICAgICAgIH0KLSAgICB9Ci0gICAgZWxzZQotICAgICAgICAvKiBpZiBnb29kIExTRnMgcmVjZWl2ZWQgKi8KLSAgICB7Ci0gICAgICAgIC8qIGRlY29kZSBwcmVkaWN0aW9uIHJlc2lkdWFscyBmcm9tIDUgcmVjZWl2ZWQgaW5kaWNlcyAqLwotCi0gICAgICAgIHRlbXAgPQotICAgICAgICAgICAgc2hsKAotICAgICAgICAgICAgICAgICooaW5kaWNlKSwKLSAgICAgICAgICAgICAgICAyLAotICAgICAgICAgICAgICAgIHBPdmVyZmxvdyk7Ci0KLSAgICAgICAgcF9kaWNvID0gJmRpY28xX2xzZl81W3RlbXBdOwotCi0gICAgICAgICoobHNmMV9yICsgMCkgPSAqcF9kaWNvKys7Ci0gICAgICAgICoobHNmMV9yICsgMSkgPSAqcF9kaWNvKys7Ci0gICAgICAgICoobHNmMl9yICsgMCkgPSAqcF9kaWNvKys7Ci0gICAgICAgICoobHNmMl9yICsgMSkgPSAqcF9kaWNvKys7Ci0KLSAgICAgICAgdGVtcCA9Ci0gICAgICAgICAgICBzaGwoCi0gICAgICAgICAgICAgICAgKihpbmRpY2UgKyAxKSwKLSAgICAgICAgICAgICAgICAyLAotICAgICAgICAgICAgICAgIHBPdmVyZmxvdyk7Ci0KLSAgICAgICAgcF9kaWNvID0gJmRpY28yX2xzZl81W3RlbXBdOwotCi0gICAgICAgICoobHNmMV9yICsgMikgPSAqcF9kaWNvKys7Ci0gICAgICAgICoobHNmMV9yICsgMykgPSAqcF9kaWNvKys7Ci0gICAgICAgICoobHNmMl9yICsgMikgPSAqcF9kaWNvKys7Ci0gICAgICAgICoobHNmMl9yICsgMykgPSAqcF9kaWNvKys7Ci0KLSAgICAgICAgc2lnbiA9ICooaW5kaWNlICsgMikgJiAxOwotCi0gICAgICAgIGlmICgqKGluZGljZSArIDIpIDwgMCkKLSAgICAgICAgewotICAgICAgICAgICAgaSA9IH4ofigqKGluZGljZSArIDIpKSA+PiAxKTsKLSAgICAgICAgfQotICAgICAgICBlbHNlCi0gICAgICAgIHsKLSAgICAgICAgICAgIGkgPSAqKGluZGljZSArIDIpID4+IDE7Ci0gICAgICAgIH0KLQotICAgICAgICB0ZW1wID0KLSAgICAgICAgICAgIHNobCgKLSAgICAgICAgICAgICAgICBpLAotICAgICAgICAgICAgICAgIDIsCi0gICAgICAgICAgICAgICAgcE92ZXJmbG93KTsKLQotICAgICAgICBwX2RpY28gPSAmZGljbzNfbHNmXzVbdGVtcF07Ci0KLSAgICAgICAgaWYgKHNpZ24gPT0gMCkKLSAgICAgICAgewotICAgICAgICAgICAgKihsc2YxX3IgKyA0KSA9ICpwX2RpY28rKzsKLSAgICAgICAgICAgICoobHNmMV9yICsgNSkgPSAqcF9kaWNvKys7Ci0gICAgICAgICAgICAqKGxzZjJfciArIDQpID0gKnBfZGljbysrOwotICAgICAgICAgICAgKihsc2YyX3IgKyA1KSA9ICpwX2RpY28rKzsKLSAgICAgICAgfQotICAgICAgICBlbHNlCi0gICAgICAgIHsKLSAgICAgICAgICAgICoobHNmMV9yICsgNCkgPSBuZWdhdGUoKnBfZGljbysrKTsKLSAgICAgICAgICAgICoobHNmMV9yICsgNSkgPSBuZWdhdGUoKnBfZGljbysrKTsKLSAgICAgICAgICAgICoobHNmMl9yICsgNCkgPSBuZWdhdGUoKnBfZGljbysrKTsKLSAgICAgICAgICAgICoobHNmMl9yICsgNSkgPSBuZWdhdGUoKnBfZGljbysrKTsKLSAgICAgICAgfQotCi0gICAgICAgIHRlbXAgPQotICAgICAgICAgICAgc2hsKAotICAgICAgICAgICAgICAgICooaW5kaWNlICsgMyksCi0gICAgICAgICAgICAgICAgMiwKLSAgICAgICAgICAgICAgICBwT3ZlcmZsb3cpOwotCi0gICAgICAgIHBfZGljbyA9ICZkaWNvNF9sc2ZfNVt0ZW1wXTsKLQotICAgICAgICAqKGxzZjFfciArIDYpID0gKnBfZGljbysrOwotICAgICAgICAqKGxzZjFfciArIDcpID0gKnBfZGljbysrOwotICAgICAgICAqKGxzZjJfciArIDYpID0gKnBfZGljbysrOwotICAgICAgICAqKGxzZjJfciArIDcpID0gKnBfZGljbysrOwotCi0gICAgICAgIHRlbXAgPQotICAgICAgICAgICAgc2hsKAotICAgICAgICAgICAgICAgICooaW5kaWNlICsgNCksCi0gICAgICAgICAgICAgICAgMiwKLSAgICAgICAgICAgICAgICBwT3ZlcmZsb3cpOwotCi0gICAgICAgIHBfZGljbyA9ICZkaWNvNV9sc2ZfNVt0ZW1wXTsKLQotICAgICAgICAqKGxzZjFfciArIDgpID0gKnBfZGljbysrOwotICAgICAgICAqKGxzZjFfciArIDkpID0gKnBfZGljbysrOwotICAgICAgICAqKGxzZjJfciArIDgpID0gKnBfZGljbysrOwotICAgICAgICAqKGxzZjJfciArIDkpID0gKnBfZGljbysrOwotCi0gICAgICAgIC8qIENvbXB1dGUgcXVhbnRpemVkIExTRnMgYW5kIHVwZGF0ZSB0aGUgcGFzdCBxdWFudGl6ZWQKLSAgICAgICAgcmVzaWR1YWwgKi8KLSAgICAgICAgZm9yIChpID0gMDsgaSA8IE07IGkrKykKLSAgICAgICAgewotICAgICAgICAgICAgdGVtcCA9Ci0gICAgICAgICAgICAgICAgbXVsdCgKLSAgICAgICAgICAgICAgICAgICAgc3QtPnBhc3Rfcl9xW2ldLAotICAgICAgICAgICAgICAgICAgICBMU1BfUFJFRF9GQUNfTVIxMjIsCi0gICAgICAgICAgICAgICAgICAgIHBPdmVyZmxvdyk7Ci0KLSAgICAgICAgICAgIHRlbXAgPQotICAgICAgICAgICAgICAgIGFkZCgKLSAgICAgICAgICAgICAgICAgICAgKihtZWFuX2xzZl81ICsgaSksCi0gICAgICAgICAgICAgICAgICAgIHRlbXAsCi0gICAgICAgICAgICAgICAgICAgIHBPdmVyZmxvdyk7Ci0KLSAgICAgICAgICAgICoobHNmMV9xICsgaSkgPQotICAgICAgICAgICAgICAgIGFkZCgKLSAgICAgICAgICAgICAgICAgICAgKihsc2YxX3IgKyBpKSwKLSAgICAgICAgICAgICAgICAgICAgdGVtcCwKLSAgICAgICAgICAgICAgICAgICAgcE92ZXJmbG93KTsKLQotICAgICAgICAgICAgKihsc2YyX3EgKyBpKSA9Ci0gICAgICAgICAgICAgICAgYWRkKAotICAgICAgICAgICAgICAgICAgICAqKGxzZjJfciArIGkpLAotICAgICAgICAgICAgICAgICAgICB0ZW1wLAotICAgICAgICAgICAgICAgICAgICBwT3ZlcmZsb3cpOwotCi0gICAgICAgICAgICBzdC0+cGFzdF9yX3FbaV0gPSAqKGxzZjJfciArIGkpOwotICAgICAgICB9Ci0gICAgfQotCi0gICAgLyogdmVyaWZpY2F0aW9uIHRoYXQgTFNGcyBoYXZlIG1pbmltdW0gZGlzdGFuY2Ugb2YgTFNGX0dBUCBIeiAqLwotCi0gICAgUmVvcmRlcl9sc2YoCi0gICAgICAgIGxzZjFfcSwKLSAgICAgICAgTFNGX0dBUCwKLSAgICAgICAgTSwKLSAgICAgICAgcE92ZXJmbG93KTsKLQotICAgIFJlb3JkZXJfbHNmKAotICAgICAgICBsc2YyX3EsCi0gICAgICAgIExTRl9HQVAsCi0gICAgICAgIE0sCi0gICAgICAgIHBPdmVyZmxvdyk7Ci0KLSAgICBDb3B5KAotICAgICAgICBsc2YyX3EsCi0gICAgICAgIHN0LT5wYXN0X2xzZl9xLAotICAgICAgICBNKTsKLQotICAgIC8qICBjb252ZXJ0IExTRnMgdG8gdGhlIGNvc2luZSBkb21haW4gKi8KLQotICAgIExzZl9sc3AoCi0gICAgICAgIGxzZjFfcSwKLSAgICAgICAgbHNwMV9xLAotICAgICAgICBNLAotICAgICAgICBwT3ZlcmZsb3cpOwotCi0gICAgTHNmX2xzcCgKLSAgICAgICAgbHNmMl9xLAotICAgICAgICBsc3AyX3EsCi0gICAgICAgIE0sCi0gICAgICAgIHBPdmVyZmxvdyk7Ci0KLSAgICByZXR1cm47Ci19CmRpZmYgLS1naXQgYS9tZWRpYS9saWJzdGFnZWZyaWdodC9jb2RlY3MvYW1ybmIvZGVjL3NyYy9kZWNfYW1yLmNwcCBiL21lZG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AgZW51bSBNb2RlIG1vZGUsICAgICAgICAgICAgLy8gaSAgIDogQU1SIG1vZGUKLSAgICBXb3JkMTYgcGFybVtdLCAgICAgICAgICAgICAvLyBpICAgOiB2ZWN0b3Igb2Ygc3ludGhlc2lzIHBhcmFtZXRlcnMKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoUFJNX1NJWkUpCi0gICAgZW51bSBSWEZyYW1lVHlwZSBmcmFtZV90eXBlLCAvLyBpICAgOiByZWNlaXZlZCBmcmFtZSB0eXBlCi0gICAgV29yZDE2IHN5bnRoW10sICAgICAgICAgICAgLy8gbyAgIDogc3ludGhlc2lzIHNwZWVjaCAoTF9GUkFNRSkKLSAgICBXb3JkMTYgQV90W10gICAgICAgICAgICAgICAvLyBvICAgOiBkZWNvZGVkIExQIGZpbHRlciBpbiA0IHN1YmZyYW1lcwotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChBWl9TSVpFKQotKQotewotICAgIC8vIExQQyBjb2VmZmljaWVudHMKLQotICAgIFdvcmQxNiAqQXo7ICAgICAgICAgICAgICAgIC8vIFBvaW50ZXIgb24gQV90Ci0KLSAgICAvLyBMU1BzCi0KLSAgICBXb3JkMTYgbHNwX25ld1tNXTsKLSAgICBXb3JkMTYgbHNwX21pZFtNXTsKLQotICAgIC8vIExTRnMKLQotICAgIFdvcmQxNiBwcmV2X2xzZltNXTsKLSAgICBXb3JkMTYgbHNmX2lbTV07Ci0KLSAgICAvLyBBbGdlYnJhaWMgY29kZXZlY3RvcgotCi0gICAgV29yZDE2IGNvZGVbTF9TVUJGUl07Ci0KLSAgICAvLyBleGNpdGF0aW9uCi0KLSAgICBXb3JkMTYgZXhjcFtMX1NVQkZSXTsKLSAgICBXb3JkMTYgZXhjX2VuaGFuY2VkW0xfU1VCRlJdOwotCi0gICAgLy8gU2NhbGFycwotCi0gICAgV29yZDE2IGksIGlfc3ViZnI7Ci0gICAgV29yZDE2IFQwLCBUMF9mcmF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AgICAgICAgICAgICoKLSAgICAqICAgICAtIGRlY29kZSBhbGdlYnJhaWMgY29kZSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKgotICAgICogICAgIC0gZGVjb2RlIHBpdGNoIGFuZCBjb2RlYm9vayBnYWlucyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqCi0gICAgKiAgICAgLSBmaW5kIHRoZSBleGNpdGF0aW9uIGFuZCBjb21wdXRlIHN5bnRoZXNpcyBzcGVlY2ggICAgICAgICAgICAgICAgICoKLSAgICAqLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tKgotCi0gICAgLy8gcG9pbnRlciB0byBpbnRlcnBvbGF0ZWQgTFBDIHBhcmFtZXRlcnMKLSAgICBBeiA9IEFfdDsKLQotICAgIGV2ZW5TdWJmciA9IDA7Ci0gICAgc3ViZnJOciA9IC0xOwotICAgIGZvciAoaV9zdWJmciA9IDA7IGlfc3ViZnIgPCBMX0ZSQU1FOyBpX3N1YmZyICs9IExfU1VCRlIpCi0gICAgewotICAgICAgIHN1YmZyTnIgPSBhZGQoc3ViZnJOciwgMSk7Ci0gICAgICAgZXZlblN1YmZyID0gc3ViKDEsIGV2ZW5TdWJmcik7Ci0KLSAgICAgICAvLyBmbGFnIGZvciBmaXJzdCBhbmQgM3RoIHN1YmZyYW1lCi0gICAgICAgcGl0X2ZsYWcgPSBpX3N1YmZyOwotCi0gICAgICAgaWYgKHN1YiAoaV9zdWJmciwgTF9GUkFNRV9CWTIpID09IDApCi0gICAgICAgewotICAgICAgICAgIGlmIChzdWIobW9kZSwgTVI0NzUpICE9IDAgJiYgc3ViKG1vZGUsIE1SNTE1KSAhPSAwKQotICAgICAgICAgIHsKLSAgICAgICAgICAgICBwaXRfZmxhZyA9IDA7Ci0gICAgICAgICAgfQotICAgICAgIH0KLQotICAgICAgIC8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mcgICAgICAgICAgICAgICAgICAgICAgICoKLSAgICAgICAgICAgKi0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0qCi0KLSAgICAgICAgICBkZWx0YV9mcmNfbG93ID0gNTsKLSAgICAgICAgICBkZWx0YV9mcmNfcmFuZ2UgPSA5OwotCi0gICAgICAgICAgaWYgKCBzdWIobW9kZSwgTVI3OTUpID09IDAgKQotICAgICAgICAgIHsKLSAgICAgICAgICAgICBkZWx0YV9mcmNfbG93ID0gMTA7Ci0gICAgICAgICAgICAgZGVsdGFfZnJjX3JhbmdlID0gMTk7Ci0gICAgICAgICAgfQotCi0gICAgICAgICAgdDBfbWluID0gc3ViKHN0LT5vbGRfVDAsIGRlbHRhX2ZyY19sb3cpOwotICAgICAgICAgIGlmIChzdWIodDBfbWluLCBQSVRfTUlOKSA8IDApCi0gICAgICAgICAgewotICAgICAgICAgICAgIHQwX21pbiA9IFBJVF9NSU47Ci0gICAgICAgICAgfQotICAgICAgICAgIHQwX21heCA9IGFkZCh0MF9taW4sIGRlbHRhX2ZyY19yYW5nZSk7Ci0gICAgICAgICAgaWYgKHN1Yih0MF9tYXgsIFBJVF9NQVgpID4gMCkKLSAgICAgICAgICB7Ci0gICAgICAgICAgICAgdDBfbWF4ID0gUElUX01BWDsKLSAgICAgICAgICAgICB0MF9taW4gPSBzdWIodDBfbWF4LCBkZWx0YV9mcmNfcmFuZ2UpOwotICAgICAgICAgIH0KLQotICAgICAgICAgIERlY19sYWczIChpbmRleCwgdDBfbWluLCB0MF9tYXgsIHBpdF9mbGFnLCBzdC0+b2xkX1QwLAotICAgICAgICAgICAgICAgICAgICAmVDAsICZUMF9mcmFjLCBmbGFnNCk7Ci0KLSAgICAgICAgICBzdC0+VDBfbGFnQnVmZiA9IFQwOwotCi0gICAgICAgICAgaWYgKGJmaSAhPSAwKQotICAgICAgICAgIHsKLSAgICAgICAgICAgICBpZiAoc3ViIChzdC0+b2xkX1QwLCBQSVRfTUFYKSA8IDApCi0gICAgICAgICAgICAgeyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gR3JhY2VmdWwgcGl0Y2gKLSAgICAgICAgICAgICAgICBzdC0+b2xkX1QwID0gYWRkKHN0LT5vbGRfVDAsIDEpOyAgICAvLyBkZWdyYWRhdGlvbgotICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICBUMCA9IHN0LT5vbGRfVDA7Ci0gICAgICAgICAgICAgVDBfZnJhYyA9IDA7Ci0KLSAgICAgICAgICAgICBpZiAoIHN0LT5pbkJhY2tncm91bmROb2lzZSAhPSAwICYmCi0gICAgICAgICAgICAgICAgICBzdWIoc3QtPnZvaWNlZEhhbmdvdmVyLCA0KSA+IDAgJiYKLSAgICAgICAgICAgICAgICAgICgoc3ViKG1vZGUsIE1SNDc1KSA9PSAwICkgfHwKLSAgICAgICAgICAgICAgICAgICAoc3ViKG1vZGUsIE1SNTE1KSA9PSAwICkgfHwKLSAgICAgICAgICAgICAgICAgICAoc3ViKG1vZGUsIE1SNTkpID09IDApICkKLSAgICAgICAgICAgICAgICAgICkKLSAgICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgVDAgPSBzdC0+VDBfbGFnQnVmZjsKLSAgICAgICAgICAgICB9Ci0gICAgICAgICAgfQotCi0gICAgICAgICAgUHJlZF9sdF8zb3I2IChzdC0+ZXhjLCBUMCwgVDBfZnJhYywgTF9TVUJGUiwgMSk7Ci0gICAgICAgfQotICAgICAgIGVsc2UKLSAgICAgICB7Ci0gICAgICAgICAgRGVjX2xhZzYgKGluZGV4LCBQSVRfTUlOX01SMTIyLAotICAgICAgICAgICAgICAgICAgICBQSVRfTUFYLCBwaXRfZmxhZywgJlQwLCAmVDBfZnJhYyk7Ci0KLSAgICAgICAgICBpZiAoIGJmaSA9PSAwICYmIChwaXRfZmxhZyA9PSAwIHx8IHN1YiAoaW5kZXgsIDYxKSA8IDApKQotICAgICAgICAgIHsKLSAgICAgICAgICB9Ci0gICAgICAgICAgZWxzZQotICAgICAgICAgIHsKLSAgICAgICAgICAgICBzdC0+VDBfbGFnQnVmZiA9IFQwOwotICAgICAgICAgICAgIFQwID0gc3QtPm9sZF9UMDsKLSAgICAgICAgICAgICBUMF9mcmFjID0gMDsKLSAgICAgICAgICB9Ci0KLSAgICAgICAgICBQcmVkX2x0XzNvcjYgKHN0LT5leGMsIFQwLCBUMF9mcmFjLCBMX1NVQkZSLCAwKTsKLSAgICAgICB9Ci0KLSAgICAgICAgKi0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0qCi0gICAgICAgICogLSAoTVIxMjIgb25seTogRGVjb2RlIHBpdGNoIGdhaW4uKSAgICAgICAgICAgICAgICAgICAgKgotICAgICAgICAqIC0gRGVjb2RlIGlubm92YXRpdmUgY29kZWJvb2suICAgICAgICAgICAgICAgICAgICAgICAgICoKLSAgICAgICAgKiAtIHNldCBwaXRjaCBzaGFycGVuaW5nIGZhY3RvciAgICAgICAgICAgICAgICAgICAgICAgICAqCi0gICAgICAgICotLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tKgotCi0gICAgICAgIGlmIChzdWIgKG1vZGUsIE1SNDc1KSA9PSAwIHx8IHN1YiAobW9kZSwgTVI1MTUpID09IDApCi0gICAgICAgIHsgICAvLyBNUjQ3NSwgTVI1MTUKLSAgICAgICAgICAgaW5kZXggPSAqcGFybSsrOyAgICAgICAgLy8gaW5kZXggb2YgcG9zaXRpb24KLSAgICAgICAgICAgaSA9ICpwYXJtKys7ICAgICAgICAgICAgLy8gc2lnbnMKLQotICAgICAgICAgICBkZWNvZGVfMmk0MF85Yml0cyAoc3ViZnJOciwgaSwgaW5kZXgsIGNvZGUpOwotCi0gICAgICAgICAgIHBpdF9zaGFycCA9IHNobCAoc3QtPnNoYXJwLCAxKTsKLSAgICAgICAgfQotICAgICAgICBlbHNlIGlmIChzdWIgKG1vZGUsIE1SNTkpID09IDApCi0gICAgICAgIHsgICAvLyBNUjU5Ci0gICAgICAgICAgIGluZGV4ID0gKnBhcm0rKzsgICAgICAgIC8vIGluZGV4IG9mIHBvc2l0aW9uCi0gICAgICAgICAgIGkgPSAqcGFybSsrOyAgICAgICAgICAgIC8vIHNpZ25zCi0KLSAgICAgICAgICAgZGVjb2RlXzJpNDBfMTFiaXRzIChpLCBpbmRleCwgY29kZSk7Ci0KLSAgICAgICAgICAgcGl0X3NoYXJwID0gc2hsIChzdC0+c2hhcnAsIDEpOwotICAgICAgICB9Ci0gICAgICAgIGVsc2UgaWYgKHN1YiAobW9kZSwgTVI2NykgPT0gMCkKLSAgICAgICAgeyAgIC8vIE1SNjcKLSAgICAgICAgICAgaW5kZXggPSAqcGFybSsrOyAgICAgICAgLy8gaW5kZXggb2YgcG9zaXRpb24KLSAgICAgICAgICAgaSA9ICpwYXJtKys7ICAgICAgICAgICAgLy8gc2lnbnMKLQotICAgICAgICAgICBkZWNvZGVfM2k0MF8xNGJpdHMgKGksIGluZGV4LCBjb2RlKTsKLQotICAgICAgICAgICBwaXRfc2hhcnAgPSBzaGwgKHN0LT5zaGFycCwgMSk7Ci0gICAgICAgIH0KLSAgICAgICAgZWxzZSBpZiAoc3ViIChtb2RlLCBNUjc5NSkgPD0gMCkKLSAgICAgICAgeyAgIC8vIE1SNzQsIE1SNzk1Ci0gICAgICAgICAgIGluZGV4ID0gKnBhcm0rKzsgICAgICAgIC8vIGluZGV4IG9mIHBvc2l0aW9uCi0gICAgICAgICAgIGkgPSAqcGFybSsrOyAgICAgICAgICAgIC8vIHNpZ25zCi0KLSAgICAgICAgICAgZGVjb2RlXzRpNDBfMTdiaXRzIChpLCBpbmRleCwgY29kZSk7Ci0KLSAgICAgICAgICAgcGl0X3NoYXJwID0gc2hsIChzdC0+c2hhcnAsIDEpOwotICAgICAgICB9Ci0gICAgICAgIGVsc2UgaWYgKHN1YiAobW9kZSwgTVIxMDIpID09IDApCi0gICAgICAgIHsgIC8vIE1SMTAyCi0gICAgICAgICAgIGRlY184aTQwXzMxYml0cyAocGFybSwgY29kZSk7Ci0gICAgICAgICAgIHBhcm0gKz0gNzsKLQotICAgICAgICAgICBwaXRfc2hhcnAgPSBzaGwgKHN0LT5zaGFycCwgMSk7Ci0gICAgICAgIH0KLSAgICAgICAgZWxzZQotICAgICAgICB7ICAvLyBNUjEyMgotICAgICAgICAgICBpbmRleCA9ICpwYXJtKys7Ci0gICAgICAgICAgIGlmIChiZmkgIT0gMCkKLSAgICAgICAgICAgewotICAgICAgICAgICAgICBlY19nYWluX3BpdGNoIChzdC0+ZWNfZ2Fpbl9wX3N0LCBzdC0+c3RhdGUsICZnYWluX3BpdCk7Ci0gICAgICAgICAgIH0KLSAgICAgICAgICAgZWxzZQotICAgICAgICAgICB7Ci0gICAgICAgICAgICAgIGdhaW5fcGl0ID0gZF9nYWluX3BpdGNoIChtb2RlLCBpbmRleCk7Ci0gICAgICAgICAgIH0KLSAgICAgICAgICAgZWNfZ2Fpbl9waXRjaF91cGRhdGUgKHN0LT5lY19nYWluX3Bfc3QsIGJmaSwgc3QtPnByZXZfYmYsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmZ2Fpbl9waXQpOwotCi0gICAgICAgICAgIGRlY18xMGk0MF8zNWJpdHMgKHBhcm0sIGNvZGUpOwotICAgICAgICAgICBwYXJtICs9IDEwOwotCi0gICAgICAgICAgIC8vIHBpdF9zaGFycCA9IGdhaW5fcGl0OwotICAgICAgICAgICAvLyBpZiAocGl0X3NoYXJwID4gMS4wKSBwaXRfc2hhcnAgPSAxLjA7Ci0KLSAgICAgICAgICAgcGl0X3NoYXJwID0gc2hsIChnYWluX3BpdCwgMSk7Ci0gICAgICAgIH0KLQotICAgICAgICAgKi0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0qCi0gICAgICAgICAqIC0gQWRkIHRoZSBwaXRjaCBjb250cmlidXRpb24gdG8gY29kZVtdLiAgICAgICAgICAgICAgICoKLSAgICAgICAgICotLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tKgotICAgICAgICBmb3IgKGkgPSBUMDsgaSA8IExfU1VCRlI7IGkrKykKLSAgICAgICAgewotICAgICAgICAgICB0ZW1wID0gbXVsdCAoY29kZVtpIC0gVDBdLCBwaXRfc2hhcnApOwotICAgICAgICAgICBjb2RlW2ldID0gYWRkIChjb2RlW2ldLCB0ZW1wKTsKLSAgICAgICAgfQotCi0gICAgICAgICAqLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tKgotICAgICAgICAgKiAtIERlY29kZSBjb2RlYm9vayBnYWluIChNUjEyMikgb3IgYm90aCBwaXRjaCAgICAgICAgICAgICAgICoKLSAgICAgICAgICogICBnYWluIGFuZCBjb2RlYm9vayBnYWluIChhbGwgb3RoZXJzKSAgICAgICAgICAgICAgICAgICAgICAqCi0gICAgICAgICAqIC0gVXBkYXRlIHBpdGNoIHNoYXJwZW5pbmcgInNoYXJwIiB3aXRoIHF1YW50aXplZCBnYWluX3BpdCAgKgotICAgICAgICAgKi0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSoKLQotICAgICAgICBpZiAoc3ViIChtb2RlLCBNUjQ3NSkgPT0gMCkKLSAgICAgICAgewotICAgICAgICAgICAvLyByZWFkIGFuZCBkZWNvZGUgcGl0Y2ggYW5kIGNvZGUgZ2FpbgotICAgICAgICAgICBpZiAoZXZlblN1YmZyICE9IDApCi0gICAgICAgICAgIHsKLSAgICAgICAgICAgICAgaW5kZXhfbXI0NzUgPSAqcGFybSsrOyAvLyBpbmRleCBvZiBnYWluKHMpCi0gICAgICAgICAgIH0KLQotICAgICAgICAgICBpZiAoYmZpID09IDApCi0gICAgICAgICAgIHsKLSAgICAgICAgICAgICAgRGVjX2dhaW4oc3QtPnByZWRfc3RhdGUsIG1vZGUsIGluZGV4X21yNDc1LCBjb2RlLAotICAgICAgICAgICAgICAgICAgICAgICBldmVuU3ViZnIsICZnYWluX3BpdCwgJmdhaW5fY29kZSk7Ci0gICAgICAgICAgIH0KLSAgICAgICAgICAgZWxzZQotICAgICAgICAgICB7Ci0gICAgICAgICAgICAgIGVjX2dhaW5fcGl0Y2ggKHN0LT5lY19nYWluX3Bfc3QsIHN0LT5zdGF0ZSwgJmdhaW5fcGl0KTsKLSAgICAgICAgICAgICAgZWNfZ2Fpbl9jb2RlIChzdC0+ZWNfZ2Fpbl9jX3N0LCBzdC0+cHJlZF9zdGF0ZSwgc3QtPnN0YXRlLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICZnYWluX2NvZGUpOwotICAgICAgICAgICB9Ci0gICAgICAgICAgIGVjX2dhaW5fcGl0Y2hfdXBkYXRlIChzdC0+ZWNfZ2Fpbl9wX3N0LCBiZmksIHN0LT5wcmV2X2JmLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJmdhaW5fcGl0KTsKLSAgICAgICAgICAgZWNfZ2Fpbl9jb2RlX3VwZGF0ZSAoc3QtPmVjX2dhaW5fY19zdCwgYmZpLCBzdC0+cHJldl9iZiwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJmdhaW5fY29kZSk7Ci0KLSAgICAgICAgICAgcGl0X3NoYXJwID0gZ2Fpbl9waXQ7Ci0gICAgICAgICAgIGlmIChzdWIgKHBpdF9zaGFycCwgU0hBUlBNQVgpID4gMCkKLSAgICAgICAgICAgewotICAgICAgICAgICAgICAgcGl0X3NoYXJwID0gU0hBUlBNQVg7Ci0gICAgICAgICAgIH0KLQotICAgICAgICB9Ci0gICAgICAgIGVsc2UgaWYgKChzdWIgKG1vZGUsIE1SNzQpIDw9IDApIHx8Ci0gICAgICAgICAgICAgICAgIChzdWIgKG1vZGUsIE1SMTAyKSA9PSAwKSkKLSAgICAgICAgewotICAgICAgICAgICAgLy8gcmVhZCBhbmQgZGVjb2RlIHBpdGNoIGFuZCBjb2RlIGdhaW4KLSAgICAgICAgICAgIGluZGV4ID0gKnBhcm0rKzsgLy8gaW5kZXggb2YgZ2FpbihzKQotCi0gICAgICAgICAgICBpZiAoYmZpID09IDApCi0gICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICBEZWNfZ2FpbihzdC0+cHJlZF9zdGF0ZSwgbW9kZSwgaW5kZXgsIGNvZGUsCi0gICAgICAgICAgICAgICAgICAgICAgICBldmVuU3ViZnIsICZnYWluX3BpdCwgJmdhaW5fY29kZSk7Ci0gICAgICAgICAgICB9Ci0gICAgICAgICAgICBlbHNlCi0gICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICBlY19nYWluX3BpdGNoIChzdC0+ZWNfZ2Fpbl9wX3N0LCBzdC0+c3RhdGUsICZnYWluX3BpdCk7Ci0gICAgICAgICAgICAgICBlY19nYWluX2NvZGUgKHN0LT5lY19nYWluX2Nfc3QsIHN0LT5wcmVkX3N0YXRlLCBzdC0+c3RhdGUsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICZnYWluX2NvZGUpOwotICAgICAgICAgICAgfQotICAgICAgICAgICAgZWNfZ2Fpbl9waXRjaF91cGRhdGUgKHN0LT5lY19nYWluX3Bfc3QsIGJmaSwgc3QtPnByZXZfYmYsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJmdhaW5fcGl0KTsKLSAgICAgICAgICAgIGVjX2dhaW5fY29kZV91cGRhdGUgKHN0LT5lY19nYWluX2Nfc3QsIGJmaSwgc3QtPnByZXZfYmYsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmZ2Fpbl9jb2RlKTsKLQotICAgICAgICAgICAgcGl0X3NoYXJwID0gZ2Fpbl9waXQ7Ci0gICAgICAgICAgICBpZiAoc3ViIChwaXRfc2hhcnAsIFNIQVJQTUFYKSA+IDApCi0gICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICBwaXRfc2hhcnAgPSBTSEFSUE1BWDsKLSAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgaWYgKHN1YiAobW9kZSwgTVIxMDIpID09IDApCi0gICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICBpZiAoc3ViIChzdC0+b2xkX1QwLCBhZGQoTF9TVUJGUiwgNSkpID4gMCkKLSAgICAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAgIHBpdF9zaGFycCA9IHNocihwaXRfc2hhcnAsIDIpOwotICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgfQotICAgICAgICB9Ci0gICAgICAgIGVsc2UKLSAgICAgICAgewotICAgICAgICAgICAvLyByZWFkIGFuZCBkZWNvZGUgcGl0Y2ggZ2FpbgotICAgICAgICAgICBpbmRleCA9ICpwYXJtKys7IC8vIGluZGV4IG9mIGdhaW4ocykKLQotICAgICAgICAgICBpZiAoc3ViIChtb2RlLCBNUjc5NSkgPT0gMCkKLSAgICAgICAgICAgewotICAgICAgICAgICAgICAvLyBkZWNvZGUgcGl0Y2ggZ2FpbgotICAgICAgICAgICAgICBpZiAoYmZpICE9IDApCi0gICAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAgZWNfZ2Fpbl9waXRjaCAoc3QtPmVjX2dhaW5fcF9zdCwgc3QtPnN0YXRlLCAmZ2Fpbl9waXQpOwotICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgIGVsc2UKLSAgICAgICAgICAgICAgewotICAgICAgICAgICAgICAgICBnYWluX3BpdCA9IGRfZ2Fpbl9waXRjaCAobW9kZSwgaW5kZXgpOwotICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgIGVjX2dhaW5fcGl0Y2hfdXBkYXRlIChzdC0+ZWNfZ2Fpbl9wX3N0LCBiZmksIHN0LT5wcmV2X2JmLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJmdhaW5fcGl0KTsKLQotICAgICAgICAgICAgICAvLyByZWFkIGFuZCBkZWNvZGUgY29kZSBnYWluCi0gICAgICAgICAgICAgIGluZGV4ID0gKnBhcm0rKzsKLSAgICAgICAgICAgICAgaWYgKGJmaSA9PSAwKQotICAgICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgIGRfZ2Fpbl9jb2RlIChzdC0+cHJlZF9zdGF0ZSwgbW9kZSwgaW5kZXgsIGNvZGUsICZnYWluX2NvZGUpOwotICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgIGVsc2UKLSAgICAgICAgICAgICAgewotICAgICAgICAgICAgICAgICBlY19nYWluX2NvZGUgKHN0LT5lY19nYWluX2Nfc3QsIHN0LT5wcmVkX3N0YXRlLCBzdC0+c3RhdGUsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJmdhaW5fY29kZSk7Ci0gICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgZWNfZ2Fpbl9jb2RlX3VwZGF0ZSAoc3QtPmVjX2dhaW5fY19zdCwgYmZpLCBzdC0+cHJldl9iZiwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJmdhaW5fY29kZSk7Ci0KLSAgICAgICAgICAgICAgcGl0X3NoYXJwID0gZ2Fpbl9waXQ7Ci0gICAgICAgICAgICAgIGlmIChzdWIgKHBpdF9zaGFycCwgU0hBUlBNQVgpID4gMCkKLSAgICAgICAgICAgICAgewotICAgICAgICAgICAgICAgICBwaXRfc2hhcnAgPSBTSEFSUE1BWDsKLSAgICAgICAgICAgICAgfQotICAgICAgICAgICB9Ci0gICAgICAgICAgIGVsc2UKLSAgICAgICAgICAgeyAvLyBNUjEyMgotICAgICAgICAgICAgICBpZiAoYmZpID09IDApCi0gICAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAgZF9nYWluX2NvZGUgKHN0LT5wcmVkX3N0YXRlLCBtb2RlLCBpbmRleCwgY29kZSwgJmdhaW5fY29kZSk7Ci0gICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgZWxzZQotICAgICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgIGVjX2dhaW5fY29kZSAoc3QtPmVjX2dhaW5fY19zdCwgc3QtPnByZWRfc3RhdGUsIHN0LT5zdGF0ZSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmZ2Fpbl9jb2RlKTsKLSAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICBlY19nYWluX2NvZGVfdXBkYXRlIChzdC0+ZWNfZ2Fpbl9jX3N0LCBiZmksIHN0LT5wcmV2X2JmLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmZ2Fpbl9jb2RlKTsKLQotICAgICAgICAgICAgICBwaXRfc2hhcnAgPSBnYWluX3BpdDsKLSAgICAgICAgICAgfQotICAgICAgICB9Ci0KLSAgICAgICAgLy8gc3RvcmUgcGl0Y2ggc2hhcnBlbmluZyBmb3IgbmV4dCBzdWJmcmFtZQotICAgICAgICAvLyAoZm9yIG1vZGVzIHdoaWNoIHVzZSB0aGUgcHJldmlvdXMgcGl0Y2ggZ2FpbiBmb3IKLSAgICAgICAgLy8gcGl0Y2ggc2hhcnBlbmluZyBpbiB0aGUgc2VhcmNoIHBoYXNlKQotICAgICAgICAvLyBkbyBub3QgdXBkYXRlIHNoYXJwZW5pbmcgaW4gZXZlbiBzdWJmcmFtZXMgZm9yIE1SNDc1Ci0gICAgICAgIGlmIChzdWIobW9kZSwgTVI0NzUpICE9IDAgfHwgZXZlblN1YmZyID09IDApCi0gICAgICAgIHsKLSAgICAgICAgICAgIHN0LT5zaGFycCA9IGdhaW5fcGl0OwotICAgICAgICAgICAgaWYgKHN1YiAoc3QtPnNoYXJwLCBTSEFSUE1BWCkgPiAwKQotICAgICAgICAgICAgewotICAgICAgICAgICAgICAgIHN0LT5zaGFycCA9IFNIQVJQTUFYOwotICAgICAgICAgICAgfQotICAgICAgICB9Ci0KLSAgICAgICAgcGl0X3NoYXJwID0gc2hsIChwaXRfc2hhcnAsIDEpOwotICAgICAgICBpZiAoc3ViIChwaXRfc2hhcnAsIDE2Mzg0KSA+IDApCi0gICAgICAgIHsKLSAgICAgICAgICAgZm9yIChpID0gMDsgaSA8IExfU1VCRlI7IGkrKykKLSAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgIHRlbXAgPSBtdWx0IChzdC0+ZXhjW2ldLCBwaXRfc2hhcnApOwotICAgICAgICAgICAgICAgTF90ZW1wID0gTF9tdWx0ICh0ZW1wLCBnYWluX3BpdCk7Ci0gICAgICAgICAgICAgICBpZiAoc3ViKG1vZGUsIE1SMTIyKT09MCkKLSAgICAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAgIExfdGVtcCA9IExfc2hyIChMX3RlbXAsIDEpOwotICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgZXhjcFtpXSA9IHB2X3JvdW5kIChMX3RlbXApOwotICAgICAgICAgICAgfQotICAgICAgICB9Ci0KLSAgICAgICAgICotLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tKgotICAgICAgICAgKiAtIFN0b3JlIGxpc3Qgb2YgTFRQIGdhaW5zIG5lZWRlZCBpbiB0aGUgc291cmNlICAgICAgICAqCi0gICAgICAgICAqICAgY2hhcmFjdGVyaXN0aWMgZGV0ZWN0b3IgKFNDRCkgICAgICAgICAgICAgICAgICAgICAgICoKLSAgICAgICAgICotLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tKgotICAgICAgICBpZiAoIGJmaSA9PSAwICkKLSAgICAgICAgewotICAgICAgICAgICBmb3IgKGkgPSAwOyBpIDwgODsgaSsrKQotICAgICAgICAgICB7Ci0gICAgICAgICAgICAgIHN0LT5sdHBHYWluSGlzdG9yeVtpXSA9IHN0LT5sdHBHYWluSGlzdG9yeVtpKzFdOwotICAgICAgICAgICB9Ci0gICAgICAgICAgIHN0LT5sdHBHYWluSGlzdG9yeVs4XSA9IGdhaW5fcGl0OwotICAgICAgICB9Ci0KLSAgICAgICAgICotLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tKgotICAgICAgICAgKiAtIExpbWl0IGdhaW5fcGl0IGlmIGluIGJhY2tncm91bmQgbm9pc2UgYW5kIEJGSSAgICAgICAqCi0gICAgICAgICAqICAgZm9yIE1SNDc1LCBNUjUxNSwgTVI1OSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICoKLSAgICAgICAgICotLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tKgotCi0gICAgICAgIGlmICggKHN0LT5wcmV2X2JmICE9IDAgfHwgYmZpICE9IDApICYmIHN0LT5pbkJhY2tncm91bmROb2lzZSAhPSAwICYmCi0gICAgICAgICAgICAgKChzdWIobW9kZSwgTVI0NzUpID09IDApIHx8Ci0gICAgICAgICAgICAgIChzdWIobW9kZSwgTVI1MTUpID09IDApIHx8Ci0gICAgICAgICAgICAgIChzdWIobW9kZSwgTVI1OSkgPT0gMCkpCi0gICAgICAgICAgICAgKQotICAgICAgICB7Ci0gICAgICAgICAgIGlmICggc3ViIChnYWluX3BpdCwgMTIyODgpID4gMCkgICAgLy8gaWYgKGdhaW5fcGl0ID4gMC43NSkgaW4gUTE0Ci0gICAgICAgICAgICAgIGdhaW5fcGl0ID0gYWRkKCBzaHIoIHN1YihnYWluX3BpdCwgMTIyODgpLCAxICksIDEyMjg4ICk7Ci0gICAgICAgICAgICAgIC8vIGdhaW5fcGl0ID0gKGdhaW5fcGl0LTAuNzUpLzIuMCArIDAuNzU7Ci0KLSAgICAgICAgICAgaWYgKCBzdWIgKGdh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gICAgICAgZXhjX2VuaGFuY2VkW2ldID0gc3QtPmV4Y1tpXTsKLQotICAgICAgICAgICAvLyBzdC0+ZXhjW2ldID0gZ2Fpbl9waXQqc3QtPmV4Y1tpXSArIGdhaW5fY29kZSpjb2RlW2ldOwotICAgICAgICAgICBMX3RlbXAgPSBMX211bHQgKHN0LT5leGNbaV0sIHBpdGNoX2ZhYyk7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyAxMi4yOiBRMCAqIFExMwotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gIDcuNDogUTAgKiBRMTQKLSAgICAgICAgICAgTF90ZW1wID0gTF9tYWMgKExfdGVtcCwgY29kZVtpXSwgZ2Fpbl9jb2RlKTsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vIDEyLjI6IFExMiAqIFExCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyAgNy40OiBRMTMgKiBRMQotICAgICAgICAgICBMX3RlbXAgPSBMX3NobCAoTF90ZW1wLCB0bXBfc2hpZnQpOyAgICAgICAgICAgICAgICAgICAvLyBRMTYKLSAgICAgICAgICAgc3QtPmV4Y1tpXSA9IHB2X3JvdW5kIChMX3RlbXApOwotICAgICAgICB9Ci0KLSAgICAgICAgICotLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tKgotICAgICAgICAgKiAtIEFkYXB0aXZlIHBoYXNlIGRpc3BlcnNpb24gICAgICAgICAgICAgICAgICAgICAgICAgICAqCi0gICAgICAgICAqLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSoKLSAgICAgICAgcGhfZGlzcF9yZWxlYXNlKHN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l2ZSBkdXJpbmcgQkZJLioKLSAgICAgICAgICogLSBDb25jZWFsIGRyb3BzIGluIHNpZ25hbCBlbmVyZ3kgaWYgaW4gYmcgbm9pc2UuICAgICAgKgotICAgICAgICAgKi0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0qCi0KLSAgICAgICAgTF90ZW1wID0gMDsKLSAgICAgICAgZm9yIChpID0gMDsgaSA8IExfU1VCRlI7IGkrKykKLSAgICAgICAgewotICAgICAgICAgICAgTF90ZW1wID0gTF9tYWMgKExfdGVtcCwgZXhjX2VuaGFuY2VkW2ldLCBleGNfZW5oYW5jZWRbaV0gKTsKLSAgICAgICAgfQotCi0gICAgICAgIExfdGVtcCA9IExfc2hyIChMX3RlbXAsIDEpOyAgICAgLy8gZXhjRW5lcmd5ID0gc3FydChMX3RlbXApIGluIFEwCi0gICAgICAgIExfdGVtcCA9IHNxcnRfbF9leHAoTF90ZW1wLCAmdGVtcCk7IC8vIGZ1bmN0aW9uIHJlc3VsdAotICAgICAgICBMX3RlbXAgPSBMX3NocihMX3RlbXAsIGFkZCggc2hyKHRlbXAsIDEpLCAxNSkpOwotICAgICAgICBMX3RlbXAgPSBMX3NocihMX3RlbXAsIDIpOyAgICAgICAvLyBUbyBjb3BlIHdpdGggMTYtYml0IGFuZAotICAgICAgICBleGNFbmVyZ3kgPSBleHRyYWN0X2woTF90ZW1wKTsgICAvLyBzY2FsaW5nIGluIGV4X2N0cmwoKQotCi0gICAgICAgIGlmICggKChzdWIgKG1vZGUsIE1SNDc1KSA9PSAwKSB8fAotICAgICAgICAgICAgICAoc3ViIChtb2RlLCBNUjUxNSkgPT0gMCkgfHwKLSAgICAgICAgICAgICAgKHN1YiAobW9kZSwgTVI1OSkgPT0gMCkpICAmJgotICAgICAgICAgICAgIHN1YihzdC0+dm9pY2VkSGFuZ292ZXIsIDUpID4gMCAmJgotICAgICAgICAgICAgIHN0LT5pbkJhY2tncm91bmROb2lzZSAhPSAwICYmCi0gICAgICAgICAgICAgc3ViKHN0LT5zdGF0ZSwgNCkgPCAwICYmCi0gICAgICAgICAgICAgKCAocGRmaSAhPSAwICYmIHN0LT5wcmV2X3BkZiAhPSAwKSB8fAotICAgICAgICAgICAgICAgIGJmaSAhPSAwIHx8Ci0gICAgICAgICAgICAgICAgc3QtPnByZXZfYmYgIT0gMCkgKQotICAgICAgICB7Ci0gICAgICAgICAgIGNhcmVmdWxGbGFnID0gMDsKLSAgICAgICAgICAgaWYgKCBwZGZpICE9IDAgJiYgYmZpID09IDAgKQotICAgICAgICAgICB7Ci0gICAgICAgICAgICAgIGNhcmVmdWxGbGFnID0gMTsKLSAgICAgICAgICAgfQotCi0gICAgICAgICAgIEV4X2N0cmwoZXhjX2VuaGFuY2VkLAotICAgICAgICAgICAgICAgICAgIGV4Y0VuZXJneSwKLSAgICAgICAgICAgICAgICAgICBzdC0+ZXhjRW5lcmd5SGlzdCwKLSAgICAgICAgICAgICAgICAgICBzdC0+dm9pY2VkSGFuZ292ZXIsCi0gICAgICAgICAgICAgICAgICAgc3QtPnByZXZfYmYsCi0gICAgICAgICAgICAgICAgICAgY2FyZWZ1bEZsYWcpOwotICAgICAgICB9Ci0KLSAgICAgICAgaWYgKCBzdC0+aW5CYWNrZ3JvdW5kTm9pc2UgIT0gMCAmJgotICAgICAgICAgICAgICggYmZpICE9IDAgfHwgc3QtPnByZXZfYmYgIT0gMCApICYmCi0gICAgICAgICAgICAgc3ViKHN0LT5zdGF0ZSwgNCkgPCAwICkKLSAgICAgICAgewotICAgICAgICAgICA7IC8vIGRvIG5vdGhpbmchCi0gICAgICAgIH0KLSAgICAgICAgZWxzZQotICAgICAgICB7Ci0gICAgICAgICAgIC8vIFVwZGF0ZSBlbmVyZ3kgaGlzdG9yeSBmb3IgYWxsIG1vZGVzCi0gICAgICAgICAgIGZvciAoaSA9IDA7IGkgPCA4OyBpKyspCi0gICAgICAgICAgIHsKLSAgICAgICAgICAgICAgc3QtPmV4Y0VuZXJneUhpc3RbaV0gPSBzdC0+ZXhjRW5lcmd5SGlzdFtpKzFdOwotICAgICAgICAgICB9Ci0gICAgICAgICAgIHN0LT5leGNFbmVyZ3lIaXN0WzhdID0gZXhjRW5lcmd5OwotICAgICAgICB9Ci0gICAgICAgICAqLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSoKLSAgICAgICAgICogRXhjaXRhdGlvbiBjb250cm9sIG1vZHVsZSBlbmQuICAgICAgICAgICAgICAgICAgICAgICAgKgotICAgICAgICAgKi0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0qCi0KLSAgICAgICAgaWYgKHN1YiAocGl0X3NoYXJwLCAxNjM4NCkgPiAwKQotICAgICAgICB7Ci0gICAgICAgICAgIGZvciAoaSA9IDA7IGkgPCBMX1NVQkZSOyBpKyspCi0gICAgICAgICAgIHsKLSAgICAgICAgICAgICAgZXhjcFtpXSA9IGFkZCAoZXhjcFtpXSwgZXhjX2VuaGFuY2VkW2ldKTsKLSAgICAgICAgICAgfQotICAgICAgICAgICBhZ2MyIChleGNfZW5oYW5jZWQsIGV4Y3AsIExfU1VCRlIpOwotICAgICAgICAgICBPdmVyZmxvdyA9IDA7Ci0gICAgICAgICAgIFN5bl9maWx0IChBeiwgZXhjcCwgJnN5bnRoW2lfc3ViZnJdLCBMX1NVQkZSLAotICAgICAgICAgICAgICAgICAgICAgc3QtPm1lbV9zeW4sIDApOwotICAgICAgICB9Ci0gICAgICAgIGVsc2UKLSAgICAgICAgewotICAgICAgICAgICBPdmVyZmxvdyA9IDA7Ci0gICAgICAgICAgIFN5bl9maWx0IChBeiwgZXhjX2VuaGFuY2VkLCAmc3ludGhbaV9zdWJmcl0sIExfU1VCRlIsCi0gICAgICAgICAgICAgICAgICAgICBzdC0+bWVtX3N5biwgMCk7Ci0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b2xkX2V4Y1swXSwgUElUX01BWCArIExfSU5URVJQT0wpOwotCi0gICAgICAgIC8vIGludGVycG9sYXRlZCBMUEMgcGFyYW1ldGVycyBmb3IgbmV4dCBzdWJmcmFtZQotICAgICAgICBBeiArPSBNUDE7Ci0KLSAgICAgICAgLy8gc3RvcmUgVDAgZm9yIG5leHQgc3ViZnJhbWUKLSAgICAgICAgc3QtPm9sZF9UMCA9IFQwOwotICAgIH0KLQotICAgICAqLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSoKLSAgICAgKiBDYWxsIHRoZSBTb3VyY2UgQ2hhcmFjdGVyaXN0aWMgRGV0ZWN0b3Igd2hpY2ggdXBkYXRlcyAqCi0gICAgICogc3QtPmluQmFja2dyb3VuZE5vaXNlIGFuZCBzdC0+dm9pY2VkSGFuZ292ZXIuICAgICAgICAgKgotICAgICAqLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSoKLQotICAgIHN0LT5pbkJhY2tncm91bmROb2lzZSA9IEJnbl9zY2Qoc3QtPmJhY2tncm91bmRfc3RhdGUsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmKHN0LT5sdHBHYWluSGlzdG9yeVswXSksCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmKHN5bnRoWzBdKSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICYoc3QtPnZvaWNlZEhhbmdvdmVyKSApOwotCi0gICAgZHR4X2RlY19hY3Rpdml0eV91cGRhdGUoc3QtPmR0eERlY29kZXJTdGF0ZSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBzdC0+bHNmU3RhdGUtPnBhc3RfbHNmX3EsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgc3ludGgpOwotCi0gICAgLy8gc3RvcmUgYmZpIGZv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AgICAgICAgICAgIHVzZWQgdG8gcmVwcmVzZW50IGN5Y2xlIGNvdW50IGZvciBlYWNoIHN1YnJvdXRpbmUKLSAgICAgICAgICAgICAgICBjYWxsZWQpCi0gICAgIHdoZXJlOiAoY3ljbGUgY291bnQgdmFyaWFibGUpID0gY3ljbGUgY291bnQgZm9yIFtzdWJyb3V0aW5lCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbmFtZV0KLQotLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tCi0gQ0FVVElPTiBbb3B0aW9uYWxdCi0gW1N0YXRlIGFueSBzcGVjaWFsIG5vdGVzLCBjb25zdHJhaW50cyBvciBjYXV0aW9ucyBmb3IgdXNlcnMgb2YgdGhpcyBmdW5jdGlvbl0KLQotLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tCi0qLwotCi12b2lkIERlY29kZXJfYW1yKAotICAgIERlY29kZXJfYW1yU3RhdGUgKnN0LCAgICAgIC8qIGkvbyA6IFN0YXRlIHZhcmlhYmxlcyAgICAgICAgICAgICAgICAgICAqLwotICAgIGVudW0gTW9kZSBtb2RlLCAgICAgICAgICAgIC8qIGkgICA6IEFNUiBtb2RlICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotICAgIFdvcmQxNiBwYXJtW10sICAgICAgICAgICAgIC8qIGkgICA6IHZlY3RvciBvZiBzeW50aGVzaXMgcGFyYW1ldGVycwotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChQUk1fU0laRSkgICAgICAgICAgICAgICAgICAgICAgICAqLwotICAgIGVudW0gUlhGcmFtZVR5cGUgZnJhbWVfdHlwZSwgLyogaSAgIDogcmVjZWl2ZWQgZnJhbWUgdHlwZSAgICAgICAgICAgICAqLwotICAgIFdvcmQxNiBzeW50aFtdLCAgICAgICAgICAgIC8qIG8gICA6IHN5bnRoZXNpcyBzcGVlY2ggKExfRlJBTUUpICAgICAgICAqLwotICAgIFdvcmQxNiBBX3RbXSAgICAgICAgICAgICAgIC8qIG8gICA6IGRlY29kZWQgTFAgZmlsdGVyIGluIDQgc3ViZnJhbWVzCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKEFaX1NJWkUpICAgICAgICAgICAgICAgICAgICAgICAgICovCi0pCi17Ci0gICAgLyogTFBDIGNvZWZmaWNpZW50cyAqLwotCi0gICAgV29yZDE2ICpBejsgICAgICAgICAgICAgICAgLyogUG9pbnRlciBvbiBBX3QgKi8KLQotICAgIC8qIExTUHMgKi8KLQotICAgIFdvcmQxNiBsc3BfbmV3W01dOwotICAgIFdvcmQxNiBsc3BfbWlkW01dOwotCi0gICAgLyogTFNGcyAqLwotCi0gICAgV29yZDE2IHByZXZfbHNmW01dOwotICAgIFdvcmQxNiBsc2ZfaVtNXTsKLQotICAgIC8qIEFsZ2VicmFpYyBjb2RldmVjdG9yICovCi0KLSAgICBXb3JkMTYgY29kZVtMX1NVQkZSXTsKLQotICAgIC8qIGV4Y2l0YXRpb24gKi8KLQotICAgIFdvcmQxNiBleGNwW0xfU1VCRlJdOwotICAgIFdvcmQxNiBleGNfZW5oYW5jZWRbTF9TVUJGUl07Ci0KLSAgICAvKiBTY2FsYXJzICovCi0KLSAgICBXb3JkMTYgaTsKLSAgICBXb3JkMTYgaV9zdWJmcjsKLSAgICBXb3JkMTYgVDA7Ci0gICAgV29yZDE2IFQwX2ZyYWM7Ci0gICAgV29yZDE2IGluZGV4OwotICAgIFdvcmQxNiBpbmRleF9tcjQ3NSA9IDA7Ci0gICAgV29yZDE2IGdhaW5fcGl0OwotICAgIFdvcmQxNiBnYWluX2NvZGU7Ci0gICAgV29yZDE2IGdhaW5fY29kZV9taXg7Ci0gICAgV29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RUWFN0YXRlICE9IFNQRUVDSCkKLSAgICB7Ci0gICAgICAgIERlY29kZXJfYW1yX3Jlc2V0KHN0LCBNUkRUWCk7Ci0KLSAgICAgICAgZHR4X2RlYygmKHN0LT5kdHhEZWNvZGVyU3RhdGUpLAotICAgICAgICAgICAgICAgIHN0LT5tZW1fc3luLAotICAgICAgICAgICAgICAgICYoc3QtPmxzZlN0YXRlKSwKLSAgICAgICAgICAgICAgICAmKHN0LT5wcmVkX3N0YXRlKSwKLSAgICAgICAgICAgICAgICAmKHN0LT5DYl9nYWluX2F2ZXJTdGF0ZSksCi0gICAgICAgICAgICAgICAgbmV3RFRYU3RhdGUsCi0gICAgICAgICAgICAgICAgbW9kZSwKLSAgICAgICAgICAgICAgICBwYXJtLCBzeW50aCwgQV90LCBwT3ZlcmZsb3cpOwotCi0gICAgICAgIC8qIHVwZGF0ZSBhdmVyYWdlIGxzcCAqLwotICAgICAgICBMc2ZfbHNwKAotICAgICAgICAgICAgc3QtPmxzZlN0YXRlLnBhc3RfbHNmX3EsCi0gICAgICAgICAgICBzdC0+bHNwX29sZCwKLSAgICAgICAgICAgIE0sCi0gICAgICAgICAgICBwT3ZlcmZsb3cpOwotCi0gICAgICAgIGxzcF9hdmcoCi0gICAgICAgICAgICAmKHN0LT5sc3BfYXZnX3N0KSwKLSAgICAgICAgICAgIHN0LT5sc2ZTdGF0ZS5wYXN0X2xzZl9xLAotICAgICAgICAgICAgcE92ZXJmbG93KTsKLQotICAgICAgICBnb3RvIHRoZV9lbmQ7Ci0gICAgfQotCi0gICAgLyogU1BFRUNIIGFjdGlvbiBzdGF0ZSBtYWNoaW5lICAqLwotICAgIGlmICgoZnJhbWVfdHlwZSA9PSBSWF9TUEVFQ0hfQkFEKSB8fCAoZnJhbWVfdHlwZSA9PSBSWF9OT19EQVRBKSB8fAotICAgICAgICAgICAgKGZyYW1lX3R5cGUgPT0gUlhfT05TRVQpKQotICAgIHsKLSAgICAgICAgYmZpID0gMTsKLQotICAgICAgICB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W5kIGdlbmVyYXRlIGludGVycG9sYXRlZCBscGMgY29lZmZpY2llbnRzCi0gICAgICAgZm9yIHRoZSA0IHN1YmZyYW1lcyAqLwotCi0gICAgaWYgKG1vZGUgIT0gTVIxMjIpCi0gICAgewotICAgICAgICBEX3Bsc2ZfMygKLSAgICAgICAgICAgICYoc3QtPmxzZlN0YXRlKSwKLSAgICAgICAgICAgIG1vZGUsCi0gICAgICAgICAgICBiZmksCi0gICAgICAgICAgICBwYXJtLAotICAgICAgICAgICAgbHNwX25ldywKLSAgICAgICAgICAgIHBPdmVyZmxvdyk7Ci0KLSAgICAgICAgLyogQWR2YW5jZSBzeW50aGVzaXMgcGFyYW1ldGVycyBwb2ludGVyICovCi0gICAgICAgIHBhcm0gKz0gMzsKLQotICAgICAgICBJbnRfbHBjXzF0bzMoCi0gICAgICAgICAgICBzdC0+bHNwX29sZCwKLSAgICAgICAgICAgIGxzcF9uZXcsCi0gICAgICAgICAgICBBX3QsCi0gICAgICAgICAgICBwT3ZlcmZsb3cpOwotICAgIH0KLSAgICBlbHNlCi0gICAgewotICAgICAgICBEX3Bsc2ZfNSgKLSAgICAgICAgICAgICYoc3QtPmxzZlN0YXRlKSwKLSAgICAgICAgICAgIGJmaSwKLSAgICAgICAgICAgIHBhcm0sCi0gICAgICAgICAgICBsc3BfbWlkLAotICAgICAgICAgICAgbHNwX25ldywKLSAgICAgICAgICAgIHBPdmVyZmxvdyk7Ci0KLSAgICAgICAgLyogQWR2YW5jZSBzeW50aGVzaXMgcGFyYW1ldGVycyBwb2ludGVyICovCi0gICAgICAgIHBhcm0gKz0gNTsKLQotICAgICAgICBJbnRfbHBjXzFhbmQzKAotICAgICAgICAgICAgc3QtPmxzcF9vbGQsCi0gICAgICAgICAgICBsc3BfbWlkLAotICAgICAgICAgICAgbHNwX25ldywKLSAgICAgICAgICAgIEFfdCwKLSAgICAgICAgICAgIHBPdmVyZmxvdyk7Ci0gICAgfQotCi0gICAgLyogdXBkYXRlIHRoZSBMU1BzIGZvciB0aGUgbmV4dCBmcmFtZSAqLwotICAgIGZvciAoaSA9IDA7IGkgPCBNOyBpKyspCi0gICAgewotICAgICAgICBzdC0+bHNwX29sZFtpXSA9IGxzcF9uZXdbaV07Ci0gICAgfQotCi0gICAgLyotLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0qCi0gICAgICogICAgICAgICAgTG9vcCBmb3IgZXZlcnkgc3ViZnJhbWUgaW4gdGhlIGFuYWx5c2lzIGZyYW1lICAgICAgICAgICAgICAgICAqCi0gICAgICotLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0qCi0gICAgICogVGhlIHN1YmZyYW1lIHNpemUgaXMgTF9TVUJGUiBhbmQgdGhlIGxvb3AgaXMgcmVwZWF0ZWQgTF9GUkFNRS9MX1NVQkZSICAqCi0gICAgICogIHRpbWVzICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqCi0gICAgICogICAgIC0gZGVjb2RlIHRoZSBwaXRjaCBkZWxheSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqCi0gICAgICogICAgIC0gZGVjb2RlIGFsZ2VicmFpYyBjb2RlICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqCi0gICAgICogICAgIC0gZGVjb2RlIHBpdGNoIGFuZCBjb2RlYm9vayBnYWlucyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqCi0gICAgICogICAgIC0gZmluZCB0aGUgZXhjaXRhdGlvbiBhbmQgY29tcHV0ZSBzeW50aGVzaXMgc3BlZWNoICAgICAgICAgICAgICAgICAqCi0gICAgICotLS0tLS0tLS0tLS0tLS0tLS0tLS0tL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yMikKLSAgICAgICAgewotICAgICAgICAgICAgLyogZmxhZzQgaW5kaWNhdGVzIGVuY29kaW5nIHdpdGggNCBiaXQgcmVzb2x1dGlvbjsgICAgICovCi0gICAgICAgICAgICAvKiB0aGlzIGlzIG5lZWRlZCBmb3IgbW9kZSBNUjQ3NSwgTVI1MTUsIE1SNTkgYW5kIE1SNjcgKi8KLQotICAgICAgICAgICAgZmxhZzQgPSAwOwotCi0gICAgICAgICAgICBpZiAoKG1vZGUgPT0gTVI0NzUpIHx8IChtb2RlID09IE1SNTE1KSB8fCAobW9kZSA9PSBNUjU5KSB8fAotICAgICAgICAgICAgICAgICAgICAobW9kZSA9PSBNUjY3KSkKLSAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICBmbGFnNCA9IDE7Ci0gICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgIC8qLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSoKLSAgICAgICAgICAgICogLSBnZXQgcmFuZ2VzIGZvciB0aGUgdDBfbWluIGFuZCB0MF9tYXggICAgICAgICAgICAgICAgKgotICAgICAgICAgICAgKiAtIG9ubHkgbmVlZGVkIGluIGRlbHRhIGRlY29kaW5nICAgICAgICAgICAgICAgICAgICAgICAqCi0gICAgICAgICAgICAqLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSovCi0KLSAgICAgICAgICAgIGRlbHRhX2ZyY19sb3cgPSA1OwotICAgICAgICAgICAgZGVsdGFfZnJjX3JhbmdlID0gOTsKLQotICAgICAgICAgICAgaWYgKG1vZGUgPT0gTVI3OTUpCi0gICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgZGVsdGFfZnJjX2xvdyA9IDEwOwotICAgICAgICAgICAgICAgIGRlbHRhX2ZyY19yYW5nZSA9IDE5OwotICAgICAgICAgICAgfQotCi0gICAgICAgICAgICB0MF9taW4gPSBzdWIoc3QtPm9sZF9UMCwgZGVsdGFfZnJjX2xvdywgcE92ZXJmbG93KTsKLQotICAgICAgICAgICAgaWYgKHQwX21pbiA8IFBJVF9NSU4pCi0gICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgdDBfbWluID0gUElUX01JTjsKLSAgICAgICAgICAgIH0KLSAgICAgICAgICAgIHQwX21heCA9IGFkZCh0MF9taW4sIGRlbHRhX2ZyY19yYW5nZSwgcE92ZXJmbG93KTsKLQotICAgICAgICAgICAgaWYgKHQwX21heCA+IFBJVF9NQVgpCi0gICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgdDBfbWF4ID0gUElUX01BWDsKLSAgICAgICAgICAgICAgICB0MF9taW4gPSB0MF9tYXggLSBkZWx0YV9mcmNfcmFuZ2U7Ci0gICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgIERlY19sYWczKGluZGV4LCB0MF9taW4sIHQwX21heCwgcGl0X2ZsYWcsIHN0LT5vbGRfVDAsCi0gICAgICAgICAgICAgICAgICAgICAmVDAsICZUMF9mcmFjLCBmbGFnNCwgcE92ZXJmbG93KTsKLQotICAgICAgICAgICAgc3QtPlQwX2xhZ0J1ZmYgPSBUMDsKLQotICAgICAgICAgICAgaWYgKGJmaSAhPSAwKQotICAgICAgICAgICAgewotICAgICAgICAgICAgICAgIGlmIChzdC0+b2xkX1QwIDwgUElUX01BWCkKLSAgICAgICAgICAgICAgICB7ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8qIEdyYWNlZnVsIHBpdGNoICovCi0gICAgICAgICAgICAgICAgICAgIHN0LT5vbGRfVDAgKz0gMDsgICAgICAgICAgICAvKiBkZWdyYWRhdGlvbiAgICAqLwotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICBUMCA9IHN0LT5vbGRfVDA7Ci0gICAgICAgICAgICAgICAgVDBfZnJhYyA9IDA7Ci0KLSAgICAgICAgICAgICAgICBpZiAoKHN0LT5pbkJhY2tncm91bmROb2lzZSAhPSAwKSAmJiAoc3QtPnZvaWNlZEhhbmdvdmVyID4gNCkgJiYKLSAgICAgICAgICAgICAgICAgICAgICAgICgobW9kZSA9PSBNUjQ3NSkgfHwgKG1vZGUgPT0gTVI1MTUpIHx8IChtb2RlID09IE1SNTkpKSkKLSAgICAgICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgICAgIFQwID0gc3QtPlQwX2xhZ0J1ZmY7Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgfQotCi0gICAgICAgICAgICBQcmVkX2x0XzNvcjYoc3QtPmV4YywgVDAsIFQwX2ZyYWMsIExfU1VCRlIsIDEsIHBPdmVyZmxvdyk7Ci0gICAgICAgIH0KLSAgICAgICAgZWxzZQotICAgICAgICB7Ci0gICAgICAgICAgICBEZWNfbGFnNihpbmRleCwgUElUX01JTl9NUjEyMiwKLSAgICAgICAgICAgICAgICAgICAgIFBJVF9NQVgsIHBpdF9mbGFnLCAmVDAsICZUMF9mcmFjLCBwT3ZlcmZsb3cpOwotCi0KLSAgICAgICAgICAgIGlmICghKGJmaSA9PSAwICYmIChwaXRfZmxhZyA9PSAwIHx8IGluZGV4IDwgNjEpKSkKLSAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICBzdC0+VDBfbGFnQnVmZiA9IFQwOwotICAgICAgICAgICAgICAgIFQwID0gc3QtPm9sZF9UMDsKLSAgICAgICAgICAgICAgICBUMF9mcmFjID0gMDsKLSAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgUHJlZF9sdF8zb3I2KHN0LT5leGMsIFQwLCBUMF9mcmFjLCBMX1NVQkZSLCAwLCBwT3ZlcmZsb3cpOwotICAgICAgICB9Ci0KLSAgICAgICAgLyotLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tKgotICAgICAgICAgKiAtIChNUjEyMiBvbmx5OiBEZWNvZGUgcGl0Y2ggZ2Fpbi4pICAgICAgICAgICAgICAgICAgICAqCi0gICAgICAgICAqIC0gRGVjb2RlIGlubm92YXRpdmUgY29kZWJvb2suICAgICAgICAgICAgICAgICAgICAgICAgICoKLSAgICAgICAgICogLSBzZXQgcGl0Y2ggc2hhcnBlbmluZyBmYWN0b3IgICAgICAgICAgICAgICAgICAgICAgICAgKgotICAgICAgICAgKi0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0qLwotICAgICAgICBpZiAoKG1vZGUgPT0gTVI0NzUpIHx8IChtb2RlID09IE1SNTE1KSkKLSAgICAgICAgeyAgIC8qIE1SNDc1LCBNUjUxNSAqLwotICAgICAgICAgICAgaW5kZXggPSAqcGFybSsrOyAgICAgICAgLyogaW5kZXggb2YgcG9zaXRpb24gKi8KLSAgICAgICAgICAgIGkgPSAqcGFybSsrOyAgICAgICAgICAgIC8qIHNpZ25zICAgICAgICAgICAgICovCi0KLSAgICAgICAgICAgIGRlY29kZV8yaTQwXzliaXRzKHN1YmZyTnIsIGksIGluZGV4LCBjb2RlLCBwT3ZlcmZsb3cpOwotCi0gICAgICAgICAgICBMX3RlbXAgPSAoV29yZDMyKXN0LT5zaGFycCA8PCAxOwotICAgICAgICAgICAgaWYgKExfdGVtcCAhPSAoV29yZDMyKSgoV29yZDE2KSBMX3RlbXApKQotICAgICAgICAgICAgewotICAgICAgICAgICAgICAgIHBpdF9zaGFycCA9IChzdC0+c2hhcnAgPiAwKSA/IE1BWF8xNiA6IE1JTl8xNjsKLSAgICAgICAgICAgIH0KLSAgICAgICAgICAgIGVsc2UKLSAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICBwaXRfc2hhcnAgPSAoV29yZDE2KSBMX3RlbXA7Ci0gICAgICAgICAgICB9Ci0gICAgICAgIH0KLSAgICAgICAgZWxzZSBpZiAobW9kZSA9PSBNUjU5KQotICAgICAgICB7ICAgLyogTVI1OSAqLwotICAgICAgICAgICAgaW5kZXggPSAqcGFybSsrOyAgICAgICAgLyogaW5kZXggb2YgcG9zaXRpb24gKi8KLSAgICAgICAgICAgIGkgPSAqcGFybSsrOyAgICAgICAgICAgIC8qIHNpZ25zICAgICAgICAgICAgICovCi0KLSAgICAgICAgICAgIGRlY29kZV8yaTQwXzExYml0cyhpLCBpbmRleCwgY29kZSk7Ci0KLSAgICAgICAgICAgIExfdGVtcCA9IChXb3JkMzIpc3QtPnNoYXJwIDw8IDE7Ci0gICAgICAgICAgICBpZiAoTF90ZW1wICE9IChXb3JkMzIpKChXb3JkMTYpIExfdGVtcCkpCi0gICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgcGl0X3NoYXJwID0gKHN0LT5zaGFycCA+IDApID8gTUFYXzE2IDogTUlOXzE2OwotICAgICAgICAgICAgfQotICAgICAgICAgICAgZWxzZQotICAgICAgICAgICAgewotICAgICAgICAgICAgICAgIHBpdF9zaGFycCA9IChXb3JkMTYpIExfdGVtcDsKLSAgICAgICAgICAgIH0KLSAgICAgICAgfQotICAgICAgICBlbHNlIGlmIChtb2RlID09IE1SNjcpCi0gICAgICAgIHsgICAvKiBNUjY3ICovCi0gICAgICAgICAgICBpbmRleCA9ICpwYXJtKys7ICAgICAgICAvKiBpbmRleCBvZiBwb3NpdGlvbiAqLwotICAgICAgICAgICAgaSA9ICpwYXJtKys7ICAgICAgICAgICAgLyogc2lnbnMgICAgICAgICAgICAgKi8KLQotICAgICAgICAgICAgZGVjb2RlXzNpNDBfMTRiaXRzKGksIGluZGV4LCBjb2RlKTsKLQotICAgICAgICAgICAgTF90ZW1wID0gKFdvcmQzMilzdC0+c2hhcnAgPDwgMTsKLSAgICAgICAgICAgIGlmIChMX3RlbXAgIT0gKFdvcmQzMikoKFdvcmQxNikgTF90ZW1wKSkKLSAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICBwaXRfc2hhcnAgPSAoc3QtPnNoYXJwID4gMCkgPyBNQVhfMTYgOiBNSU5fMTY7Ci0gICAgICAgICAgICB9Ci0gICAgICAgICAgICBlbHNlCi0gICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgcGl0X3NoYXJwID0gKFdvcmQxNikgTF90ZW1wOwotICAgICAgICAgICAgfQotICAgICAgICB9Ci0gICAgICAgIGVsc2UgaWYgKG1vZGUgPD0gTVI3OTUpCi0gICAgICAgIHsgICAvKiBNUjc0LCBNUjc5NSAqLwotICAgICAgICAgICAgaW5kZXggPSAqcGFybSsrOyAgICAgICAgLyogaW5kZXggb2YgcG9zaXRpb24gKi8KLSAgICAgICAgICAgIGkgPSAqcGFybSsrOyAgICAgICAgICAgIC8qIHNpZ25zICAgICAgICAgICAgICovCi0KLSAgICAgICAgICAgIGRlY29kZV80aTQwXzE3Yml0cyhpLCBpbmRleCwgY29kZSk7Ci0KLSAgICAgICAgICAgIExfdGVtcCA9IChXb3JkMzIpc3QtPnNoYXJwIDw8IDE7Ci0gICAgICAgICAgICBpZiAoTF90ZW1wICE9IChXb3JkMzIpKChXb3JkMTYpIExfdGVtcCkpCi0gICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgcGl0X3NoYXJwID0gKHN0LT5zaGFycCA+IDApID8gTUFYXzE2IDogTUlOXzE2OwotICAgICAgICAgICAgfQotICAgICAgICAgICAgZWxzZQotICAgICAgICAgICAgewotICAgICAgICAgICAgICAgIHBpdF9zaGFycCA9IChXb3JkMTYpIExfdGVtcDsKLSAgICAgICAgICAgIH0KLSAgICAgICAgfQotICAgICAgICBlbHNlIGlmIChtb2RlID09IE1SMTAyKQotICAgICAgICB7ICAvKiBNUjEwMiAqLwotICAgICAgICAgICAgZGVjXzhpNDBfMzFiaXRzKHBhcm0sIGNvZGUsIHBPdmVyZmxvdyk7Ci0gICAgICAgICAgICBwYXJtICs9IDc7Ci0KLSAgICAgICAgICAgIExfdGVtcCA9IChXb3JkMzIpc3QtPnNoYXJwIDw8IDE7Ci0gICAgICAgICAgICBpZiAoTF90ZW1wICE9IChXb3JkMzIpKChXb3JkMTYpIExfdGVtcCkpCi0gICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgcGl0X3NoYXJwID0gKHN0LT5zaGFycCA+IDApID8gTUFYXzE2IDogTUlOXzE2OwotICAgICAgICAgICAgfQotICAgICAgICAgICAgZWxzZQotICAgICAgICAgICAgewotICAgICAgICAgICAgICAgIHBpdF9zaGFycCA9IChXb3JkMTYpIExfdGVtcDsKLSAgICAgICAgICAgIH0KLSAgICAgICAgfQotICAgICAgICBlbHNlCi0gICAgICAgIHsgIC8qIE1SMTIyICovCi0gICAgICAgICAgICBpbmRleCA9ICpwYXJtKys7Ci0KLSAgICAgICAgICAgIGlmIChiZmkgIT0gMCkKLSAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICBlY19nYWluX3BpdGNoKAotICAgICAgICAgICAgICAgICAgICAmKHN0LT5lY19nYWluX3Bfc3QpLAotICAgICAgICAgICAgICAgICAgICBzdC0+c3RhdGUsCi0gICAgICAgICAgICAgICAgICAgICZnYWluX3BpdCwKLSAgICAgICAgICAgICAgICAgICAgcE92ZXJmbG93KTsKLSAgICAgICAgICAgIH0KLSAgICAgICAgICAgIGVsc2UKLSAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICBnYWluX3BpdCA9IGRfZ2Fpbl9waXRjaChtb2RlLCBpbmRleCk7Ci0gICAgICAgICAgICB9Ci0gICAgICAgICAgICBlY19nYWluX3BpdGNoX3VwZGF0ZSgKLSAgICAgICAgICAgICAgICAmKHN0LT5lY19nYWluX3Bfc3QpLAotICAgICAgICAgICAgICAgIGJmaSwKLSAgICAgICAgICAgICAgICBzdC0+cHJldl9iZiwKLSAgICAgICAgICAgICAgICAmZ2Fpbl9waXQsCi0gICAgICAgICAgICAgICAgcE92ZXJmbG93KTsKLQotCi0gICAgICAgICAgICBkZWNfMTBpNDBfMzViaXRzKHBhcm0sIGNvZGUpOwotICAgICAgICAgICAgcGFybSArPSAxMDsKLQotICAgICAgICAgICAgLyogcGl0X3NoYXJwID0gZ2Fpbl9waXQ7ICAgICAgICAgICAgICAgICAgICovCi0gICAgICAgICAgICAvKiBpZiAocGl0X3NoYXJwID4gMS4wKSBwaXRfc2hhcnAgPSAxLjA7ICAgKi8KLQotICAgICAgICAgICAgTF90ZW1wID0gKFdvcmQzMilnYWluX3BpdCA8PCAxOwotICAgICAgICAgICAgaWYgKExfdGVtcCAhPSAoV29yZDMyKSgoV29yZDE2KSBMX3RlbXApKQotICAgICAgICAgICAgewotICAgICAgICAgICAgICAgIHBpdF9zaGFycCA9IChnYWluX3BpdCA+IDApID8gTUFYXzE2IDogTUlOXzE2OwotICAgICAgICAgICAgfQotICAgICAgICAgICAgZWxzZQotICAgICAgICAgICAgewotICAgICAgICAgICAgICAgIHBpdF9zaGFycCA9IChXb3JkMTYpIExfdGVtcDsKLSAgICAgICAgICAgIH0KLSAgICAgICAgfQotICAgICAgICAvKi0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0qCi0gICAgICAgICAqIC0gQWRkIHRoZSBwaXRjaCBjb250cmlidXRpb24gdG8gY29kZVtdLiAgICAgICAgICAgICAgICoKLSAgICAgICAgICotLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tKi8KLSAgICAgICAgZm9yIChpID0gVDA7IGkgPCBMX1NVQkZSOyBpKyspCi0gICAgICAgIHsKLSAgICAgICAgICAgIHRlbXAgPSBtdWx0KCooY29kZSArIGkgLSBUMCksIHBpdF9zaGFycCwgcE92ZXJmbG93KTsKLSAgICAgICAgICAgICooY29kZSArIGkpID0gYWRkKCooY29kZSArIGkpLCB0ZW1wLCBwT3ZlcmZsb3cpOwotCi0gICAgICAgIH0KLQotICAgICAgICAvKi0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSoKLSAgICAgICAgICogLSBEZWNvZGUgY29kZWJvb2sgZ2FpbiAoTVIxMjIpIG9yIGJvdGggcGl0Y2ggICAgICAgICAgICAgICAqCi0gICAgICAgICAqICAgZ2FpbiBhbmQgY29kZWJvb2sgZ2FpbiAoYWxsIG90aGVycykgICAgICAgICAgICAgICAgICAgICAgKgotICAgICAgICAgKiAtIFVwZGF0ZSBwaXRjaCBzaGFycGVuaW5nICJzaGFycCIgd2l0aCBxdWFudGl6ZWQgZ2Fpbl9waXQgICoKLSAgICAgICAgICotLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0qLwotICAgICAgICBpZiAobW9kZSA9PSBNUjQ3NSkKLSAgICAgICAgewotICAgICAgICAgICAgLyogcmVhZCBhbmQgZGVjb2RlIHBpdGNoIGFuZCBjb2RlIGdhaW4gKi8KLQotICAgICAgICAgICAgaWYgKGV2ZW5TdWJmciAhPSAwKQotICAgICAgICAgICAgewotICAgICAgICAgICAgICAgIGluZGV4X21yNDc1ID0gKnBhcm0rKzsgICAgICAgICAvKiBpbmRleCBvZiBnYWluKHMpICovCi0gICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgIGlmIChiZmkgPT0gMCkKLSAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICBEZWNfZ2FpbigKLSAgICAgICAgICAgICAgICAgICAgJihzdC0+cHJlZF9zdGF0ZSksCi0gICAgICAgICAgICAgICAgICAgIG1vZGUsCi0gICAgICAgICAgICAgICAgICAgIGluZGV4X21yNDc1LAotICAgICAgICAgICAgICAgICAgICBjb2RlLAotICAgICAgICAgICAgICAgICAgICBldmVuU3ViZnIsCi0gICAgICAgICAgICAgICAgICAgICZnYWluX3BpdCwKLSAgICAgICAgICAgICAgICAgICAgJmdhaW5fY29kZSwKLSAgICAgICAgICAgICAgICAgICAgcE92ZXJmbG93KTsKLSAgICAgICAgICAgIH0KLSAgICAgICAgICAgIGVsc2UKLSAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICBlY19nYWluX3BpdGNoKAotICAgICAgICAgICAgICAgICAgICAmKHN0LT5lY19nYWluX3Bfc3QpLAotICAgICAgICAgICAgICAgICAgICBzdC0+c3RhdGUsCi0gICAgICAgICAgICAgICAgICAgICZnYWluX3BpdCwKLSAgICAgICAgICAgICAgICAgICAgcE92ZXJmbG93KTsKLQotICAgICAgICAgICAgICAgIGVjX2dhaW5fY29kZSgKLSAgICAgICAgICAgICAgICAgICAgJihzdC0+ZWNfZ2Fpbl9jX3N0KSwKLSAgICAgICAgICAgICAgICAgICAgJihzdC0+cHJlZF9zdGF0ZSksCi0gICAgICAgICAgICAgICAgICAgIHN0LT5zdGF0ZSwKLSAgICAgICAgICAgICAgICAgICAgJmdhaW5fY29kZSwKLSAgICAgICAgICAgICAgICAgICAgcE92ZXJmbG93KTsKLSAgICAgICAgICAgIH0KLSAgICAgICAgICAgIGVjX2dhaW5fcGl0Y2hfdXBkYXRlKAotICAgICAgICAgICAgICAgICZzdC0+ZWNfZ2Fpbl9wX3N0LAotICAgICAgICAgICAgICAgIGJmaSwKLSAgICAgICAgICAgICAgICBzdC0+cHJldl9iZiwKLSAgICAgICAgICAgICAgICAmZ2Fpbl9waXQsCi0gICAgICAgICAgICAgICAgcE92ZXJmbG93KTsKLQotICAgICAgICAgICAgZWNfZ2Fpbl9jb2RlX3VwZGF0ZSgKLSAgICAgICAgICAgICAgICAmc3QtPmVjX2dhaW5fY19zdCwKLSAgICAgICAgICAgICAgICBiZmksCi0gICAgICAgICAgICAgICAgc3QtPnByZXZfYmYsCi0gICAgICAgICAgICAgICAgJmdhaW5fY29kZSwKLSAgICAgICAgICAgICAgICBwT3ZlcmZsb3cpOwotCi0gICAgICAgICAgICBwaXRfc2hhcnAgPSBnYWluX3BpdDsKLQotICAgICAgICAgICAgaWYgKHBpdF9zaGFycCA+IFNIQVJQTUFYKQotICAgICAgICAgICAgewotICAgICAgICAgICAgICAgIHBpdF9zaGFycCA9IFNIQVJQTUFYOwotICAgICAgICAgICAgfQotCi0gICAgICAgIH0KLSAgICAgICAgZWxzZSBpZiAoKG1vZGUgPD0gTVI3NCkgfHwgKG1vZGUgPT0gTVIxMDIpKQotICAgICAgICB7Ci0gICAgICAgICAgICAvKiByZWFkIGFuZCBkZWNvZGUgcGl0Y2ggYW5kIGNvZGUgZ2FpbiAqLwotICAgICAgICAgICAgaW5kZXggPSAqcGFybSsrOyAgICAgICAgICAgICAgICAgLyogaW5kZXggb2YgZ2FpbihzKSAqLwotCi0gICAgICAgICAgICBpZiAoYmZpID09IDApCi0gICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgRGVjX2dhaW4oCi0gICAgICAgICAgICAgICAgICAgICYoc3QtPnByZWRfc3RhdGUpLAotICAgICAgICAgICAgICAgICAgICBtb2RlLAotICAgICAgICAgICAgICAgICAgICBpbmRleCwKLSAgICAgICAgICAgICAgICAgICAgY29kZSwKLSAgICAgICAgICAgICAgICAgICAgZXZlblN1YmZyLAotICAgICAgICAgICAgICAgICAgICAmZ2Fpbl9waXQsCi0gICAgICAgICAgICAgICAgICAgICZnYWluX2NvZGUsCi0gICAgICAgICAgICAgICAgICAgIHBPdmVyZmxvdyk7Ci0gICAgICAgICAgICB9Ci0gICAgICAgICAgICBlbHNlCi0gICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgZWNfZ2Fpbl9waXRjaCgKLSAgICAgICAgICAgICAgICAgICAgJihzdC0+ZWNfZ2Fpbl9wX3N0KSwKLSAgICAgICAgICAgICAgICAgICAgc3QtPnN0YXRlLAotICAgICAgICAgICAgICAgICAgICAmZ2Fpbl9waXQsCi0gICAgICAgICAgICAgICAgICAgIHBPdmVyZmxvdyk7Ci0KLSAgICAgICAgICAgICAgICBlY19nYWluX2NvZGUoCi0gICAgICAgICAgICAgICAgICAgICYoc3QtPmVjX2dhaW5fY19zdCksCi0gICAgICAgICAgICAgICAgICAgICYoc3QtPnByZWRfc3RhdGUpLAotICAgICAgICAgICAgICAgICAgICBzdC0+c3RhdGUsCi0gICAgICAgICAgICAgICAgICAgICZnYWluX2NvZGUsCi0gICAgICAgICAgICAgICAgICAgIHBPdmVyZmxvdyk7Ci0gICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgIGVjX2dhaW5fcGl0Y2hfdXBkYXRlKAotICAgICAgICAgICAgICAgICYoc3QtPmVjX2dhaW5fcF9zdCksCi0gICAgICAgICAgICAgICAgYmZpLAotICAgICAgICAgICAgICAgIHN0LT5wcmV2X2JmLAotICAgICAgICAgICAgICAgICZnYWluX3BpdCwKLSAgICAgICAgICAgICAgICBwT3ZlcmZsb3cpOwotCi0gICAgICAgICAgICBlY19nYWluX2NvZGVfdXBkYXRlKAotICAgICAgICAgICAgICAgICYoc3QtPmVjX2dhaW5fY19zdCksCi0gICAgICAgICAgICAgICAgYmZpLAotICAgICAgICAgICAgICAgIHN0LT5wcmV2X2JmLAotICAgICAgICAgICAgICAgICZnYWluX2NvZGUsCi0gICAgICAgICAgICAgICAgcE92ZXJmbG93KTsKLQotICAgICAgICAgICAgcGl0X3NoYXJwID0gZ2Fpbl9waXQ7Ci0KLSAgICAgICAgICAgIGlmIChwaXRfc2hhcnAgPiBTSEFSUE1BWCkKLSAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICBwaXRfc2hhcnAgPSBTSEFSUE1BWDsKLSAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgaWYgKG1vZGUgPT0gTVIxMDIpCi0gICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgaWYgKHN0LT5vbGRfVDAgPiAoTF9TVUJGUiArIDUpKQotICAgICAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAgICAgaWYgKHBpdF9zaGFycCA8IDApCi0gICAgICAgICAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAgICAgICAgIHBpdF9zaGFycCA9IH4oKH5waXRfc2hhcnApID4+IDIpOwotICAgICAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgICAgIGVsc2UKLSAgICAgICAgICAgICAgICAgICAgewotICAgICAgICAgICAgICAgICAgICAgICAgcGl0X3NoYXJwID0gcGl0X3NoYXJwID4+IDI7Ci0gICAgICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICB9Ci0gICAgICAgIH0KLSAgICAgICAgZWxzZQotICAgICAgICB7Ci0gICAgICAgICAgICAvKiByZWFkIGFuZCBkZWNvZGUgcGl0Y2ggZ2FpbiAqLwotICAgICAgICAgICAgaW5kZXggPSAqcGFybSsrOyAgICAgICAgICAgICAgICAgLyogaW5kZXggb2YgZ2FpbihzKSAqLwotCi0gICAgICAgICAgICBpZiAobW9kZSA9PSBNUjc5NSkKLSAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAvKiBkZWNvZGUgcGl0Y2ggZ2FpbiAqLwotICAgICAgICAgICAgICAgIGlmIChiZmkgIT0gMCkKLSAgICAgICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgICAgIGVjX2dhaW5fcGl0Y2goCi0gICAgICAgICAgICAgICAgICAgICAgICAmKHN0LT5lY19nYWluX3Bfc3QpLAotICAgICAgICAgICAgICAgICAgICAgICAgc3QtPnN0YXRlLAotICAgICAgICAgICAgICAgICAgICAgICAgJmdhaW5fcGl0LAotICAgICAgICAgICAgICAgICAgICAgICAgcE92ZXJmbG93KTsKLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgZWxzZQotICAgICAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAgICAgZ2Fpbl9waXQgPSBkX2dhaW5fcGl0Y2gobW9kZSwgaW5kZXgpOwotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICBlY19nYWluX3BpdGNoX3VwZGF0ZSgKLSAgICAgICAgICAgICAgICAgICAgJihzdC0+ZWNfZ2Fpbl9wX3N0KSwKLSAgICAgICAgICAgICAgICAgICAgYmZpLAotICAgICAgICAgICAgICAgICAgICBzdC0+cHJldl9iZiwKLSAgICAgICAgICAgICAgICAgICAgJmdhaW5fcGl0LAotICAgICAgICAgICAgICAgICAgICBwT3ZlcmZsb3cpOwotCi0gICAgICAgICAgICAgICAgLyogcmVhZCBhbmQgZGVjb2RlIGNvZGUgZ2FpbiAqLwotICAgICAgICAgICAgICAgIGluZGV4ID0gKnBhcm0rKzsKLQotICAgICAgICAgICAgICAgIGlmIChiZmkgPT0gMCkKLSAgICAgICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgICAgIGRfZ2Fpbl9jb2RlKAotICAgICAgICAgICAgICAgICAgICAgICAgJihzdC0+cHJlZF9zdGF0ZSksCi0gICAgICAgICAgICAgICAgICAgICAgICBtb2RlLAotICAgICAgICAgICAgICAgICAgICAgICAgaW5kZXgsCi0gICAgICAgICAgICAgICAgICAgICAgICBjb2RlLAotICAgICAgICAgICAgICAgICAgICAgICAgJmdhaW5fY29kZSwKLSAgICAgICAgICAgICAgICAgICAgICAgIHBPdmVyZmxvdyk7Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgIGVsc2UKLSAgICAgICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgICAgIGVjX2dhaW5fY29kZSgKLSAgICAgICAgICAgICAgICAgICAgICAgICYoc3QtPmVjX2dhaW5fY19zdCksCi0gICAgICAgICAgICAgICAgICAgICAgICAmKHN0LT5wcmVkX3N0YXRlKSwKLSAgICAgICAgICAgICAgICAgICAgICAgIHN0LT5zdGF0ZSwKLSAgICAgICAgICAgICAgICAgICAgICAgICZnYWluX2NvZGUsCi0gICAgICAgICAgICAgICAgICAgICAgICBwT3ZlcmZsb3cpOwotICAgICAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgICAgIGVjX2dhaW5fY29kZV91cGRhdGUoCi0gICAgICAgICAgICAgICAgICAgICYoc3QtPmVjX2dhaW5fY19zdCksCi0gICAgICAgICAgICAgICAgICAgIGJmaSwKLSAgICAgICAgICAgICAgICAgICAgc3QtPnByZXZfYmYsCi0gICAgICAgICAgICAgICAgICAgICZnYWluX2NvZGUsCi0gICAgICAgICAgICAgICAgICAgIHBPdmVyZmxvdyk7Ci0KLSAgICAgICAgICAgICAgICBwaXRfc2hhcnAgPSBnYWluX3BpdDsKLQotICAgICAgICAgICAgICAgIGlmIChwaXRfc2hhcnAgPiBTSEFSUE1BWCkKLSAgICAgICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgICAgIHBpdF9zaGFycCA9IFNIQVJQTUFYOwotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgIH0KLSAgICAgICAgICAgIGVsc2UKLSAgICAgICAgICAgIHsgLyogTVIxMjIgKi8KLQotICAgICAgICAgICAgICAgIGlmIChiZmkgPT0gMCkKLSAgICAgICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgICAgIGRfZ2Fpbl9jb2RlKAotICAgICAgICAgICAgICAgICAgICAgICAgJihzdC0+cHJlZF9zdGF0ZSksCi0gICAgICAgICAgICAgICAgICAgICAgICBtb2RlLAotICAgICAgICAgICAgICAgICAgICAgICAgaW5kZXgsCi0gICAgICAgICAgICAgICAgICAgICAgICBjb2RlLAotICAgICAgICAgICAgICAgICAgICAgICAgJmdhaW5fY29kZSwKLSAgICAgICAgICAgICAgICAgICAgICAgIHBPdmVyZmxvdyk7Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgIGVsc2UKLSAgICAgICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgICAgIGVjX2dhaW5fY29kZSgKLSAgICAgICAgICAgICAgICAgICAgICAgICYoc3QtPmVjX2dhaW5fY19zdCksCi0gICAgICAgICAgICAgICAgICAgICAgICAmKHN0LT5wcmVkX3N0YXRlKSwKLSAgICAgICAgICAgICAgICAgICAgICAgIHN0LT5zdGF0ZSwKLSAgICAgICAgICAgICAgICAgICAgICAgICZnYWluX2NvZGUsCi0gICAgICAgICAgICAgICAgICAgICAgICBwT3ZlcmZsb3cpOwotICAgICAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgICAgIGVjX2dhaW5fY29kZV91cGRhdGUoCi0gICAgICAgICAgICAgICAgICAgICYoc3QtPmVjX2dhaW5fY19zdCksCi0gICAgICAgICAgICAgICAgICAgIGJmaSwKLSAgICAgICAgICAgICAgICAgICAgc3QtPnByZXZfYmYsCi0gICAgICAgICAgICAgICAgICAgICZnYWluX2NvZGUsCi0gICAgICAgICAgICAgICAgICAgIHBPdmVyZmxvdyk7Ci0KLSAgICAgICAgICAgICAgICBwaXRfc2hhcnAgPSBnYWluX3BpdDsKLSAgICAgICAgICAgIH0KLSAgICAgICAgfQotCi0gICAgICAgIC8qIHN0b3JlIHBpdGNoIHNoYXJwZW5pbmcgZm9yIG5leHQgc3ViZnJhbWUgICAgICAgICAgICAgKi8KLSAgICAgICAgLyogKGZvciBtb2RlcyB3aGljaCB1c2UgdGhlIHByZXZpb3VzIHBpdGNoIGdhaW4gZm9yICAgICAqLwotICAgICAgICAvKiBwaXRjaCBzaGFycGVuaW5nIGluIHRoZSBzZWFyY2ggcGhhc2UpICAgICAgICAgICAgICAgICovCi0gICAgICAgIC8qIGRvIG5vdCB1cGRhdGUgc2hhcnBlbmluZyBpbiBldmVuIHN1YmZyYW1lcyBmb3IgTVI0NzUgKi8KLSAgICAgICAgaWYgKChtb2RlICE9IE1SNDc1KSB8fCAoZXZlblN1YmZyID09IDApKQotICAgICAgICB7Ci0gICAgICAgICAgICBzdC0+c2hhcnAgPSBnYWluX3BpdDsKLQotICAgICAgICAgICAgaWYgKHN0LT5zaGFycCA+IFNIQVJQTUFYKQotICAgICAgICAgICAgewotICAgICAgICAgICAgICAgIHN0LT5zaGFycCA9IFNIQVJQTUFYOwotICAgICAgICAgICAgfQotICAgICAgICB9Ci0KLSAgICAgICAgcGl0X3NoYXJwID0gc2hsKHBpdF9zaGFycCwgMSwgcE92ZXJmbG93KTsKLQotICAgICAgICBpZiAocGl0X3NoYXJwID4gMTYzODQpCi0gICAgICAgIHsKLSAgICAgICAgICAgIGZvciAoaSA9IDA7IGkgPCBMX1NVQkZSOyBpKyspCi0gICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgdGVtcCA9IG11bHQoc3QtPmV4Y1tpXSwgcGl0X3NoYXJwLCBwT3ZlcmZsb3cpOwotICAgICAgICAgICAgICAgIExfdGVtcCA9IExfbXVsdCh0ZW1wLCBnYWluX3BpdCwgcE92ZXJmbG93KTsKLQotICAgICAgICAgICAgICAgIGlmIChtb2RlID09IE1SMTIyKQotICAgICAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAgICAgaWYgKExfdGVtcCA8IDApCi0gICAgICAgICAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAgICAgICAgIExfdGVtcCA9IH4oKH5MX3RlbXApID4+IDEpOwotICAgICAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgICAgIGVsc2UKLSAgICAgICAgICAgICAgICAgICAgewotICAgICAgICAgICAgICAgICAgICAgICAgTF90ZW1wID0gTF90ZW1wID4+IDE7Ci0gICAgICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgKihleGNwICsgaSkgPSBwdl9yb3VuZChMX3RlbXAsIHBPdmVyZmxvdyk7Ci0gICAgICAgICAgICB9Ci0gICAgICAgIH0KLQotICAgICAgICAvKi0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0qCi0gICAgICAgICAqIC0gU3RvcmUgbGlzdCBvZiBMVFAgZ2FpbnMgbmVlZGVkIGluIHRoZSBzb3VyY2UgICAgICAgICoKLSAgICAgICAgICogICBjaGFyYWN0ZXJpc3RpYyBkZXRlY3RvciAoU0NEKSAgICAgICAgICAgICAgICAgICAgICAgKgotICAgICAgICAgKi0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0qLwotCi0gICAgICAgIGl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MC43NSkvMi4wICsgMC43NTsgKi8KLSAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgaWYgKGdhaW5fcGl0ID4gMTQ3NDUpICAgIC8qIGlmIChnYWluX3BpdCA+IDAuOTApIGluIFExNCovCi0gICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgZ2Fpbl9waXQgPSAxNDc0NTsKLSAgICAgICAgICAgIH0KLSAgICAgICAgfQotCi0gICAgICAgIC8qLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSoKLSAgICAgICAgICogIENhbGN1bGF0ZSBDQiBtaXhlZCBnYWluICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKgotICAgICAgICAgKi0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0qLwotICAgICAgICBJbnRfbHNmKAotICAgICAgICAgICAgcHJldl9sc2YsCi0gICAgICAgICAgICBzdC0+bHNmU3RhdGUucGFzdF9sc2ZfcSwKLSAgICAgICAgICAgIGlfc3ViZnIsCi0gICAgICAgICAgICBsc2ZfaSwKLSAgICAgICAgICAgIHBPdmVyZmxvdyk7Ci0KLSAgICAgICAgZ2Fpbl9jb2RlX21peCA9Ci0gICAgICAgICAgICBDYl9nYWluX2F2ZXJhZ2UoCi0gICAgICAgICAgICAgICAgJihzdC0+Q2JfZ2Fpbl9hdmVyU3RhdGUpLAotICAgICAgICAgICAgICAgIG1vZGUsCi0gICAgICAgICAgICAgICAgZ2Fpbl9jb2RlLAotICAgICAgICAgICAgICAgIGxzZl9pLAotICAgICAgICAgICAgICAgIHN0LT5sc3BfYXZnX3N0LmxzcF9tZWFuU2F2ZSwKLSAgICAgICAgICAgICAgICBiZmksCi0gICAgICAgICAgICAgICAgc3QtPnByZXZfYmYsCi0gICAgICAgICAgICAgICAgcGRmaSwKLSAgICAgICAgICAgICAgICBzdC0+cHJldl9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0IDwgMCkKLSAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICBwaXRjaF9mYWMgPSB+KCh+Z2Fpbl9waXQpID4+IDEpOwotICAgICAgICAgICAgfQotICAgICAgICAgICAgZWxzZQotICAgICAgICAgICAgewotICAgICAgICAgICAgICAgIHBpdGNoX2ZhYyA9IGdhaW5fcGl0ID4+IDE7Ci0gICAgICAgICAgICB9Ci0gICAgICAgICAgICB0bXBfc2hpZnQgPSAyOwotICAgICAgICB9Ci0KLSAgICAgICAgLyogY29weSB1bnNjYWxlZCBMVFAgZXhjaXRhdGlvbiB0byBleGNfZW5oYW5jZWQgKHVzZWQgaW4gcGhhc2UKLSAgICAgICAgICogZGlzcGVyc2lvbiBiZWxvdykgYW5kIGNvbXB1dGUgdG90YWwgZXhjaXRhdGlvbiBmb3IgTFRQIGZlZWRiYWNrCi0gICAgICAgICAqLwotICAgICAgICBmb3IgKGkgPSAwOyBpIDwgTF9TVUJGUjsgaSsrKQotICAgICAgICB7Ci0gICAgICAgICAgICBleGNfZW5oYW5jZWRbaV0gPSBzdC0+ZXhjW2ldOwotCi0gICAgICAgICAgICAvKiBzdC0+ZXhjW2ldID0gZ2Fpbl9waXQqc3QtPmV4Y1tpXSArIGdhaW5fY29kZSpjb2RlW2ldOyAqLwotICAgICAgICAgICAgTF90ZW1wID0gTF9tdWx0KHN0LT5leGNbaV0sIHBpdGNoX2ZhYywgcE92ZXJmbG93KTsKLSAgICAgICAgICAgIC8qIDEyLjI6IFEwICogUTEzICovCi0gICAgICAgICAgICAvKiAgNy40OiBRMCAqIFExNCAqLwotICAgICAgICAgICAgTF90ZW1wID0gTF9tYWMoTF90ZW1wLCBjb2RlW2ldLCBnYWluX2NvZGUsIHBPdmVyZmxvdyk7Ci0gICAgICAgICAgICAvKiAxMi4yOiBRMTIgKiBRMSAqLwotICAgICAgICAgICAgLyogIDcuNDogUTEzICogUTEgKi8KLSAgICAgICAgICAgIExfdGVtcCA9IExfc2hsKExfdGVtcCwgdG1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jaXRhdGlvbiBmb3Igc3ludGhlc2lzIHBhcnQgICAgICAgICAgICovCi0gICAgICAgIHBoX2Rpc3AoCi0gICAgICAgICAgICAmKHN0LT5waF9kaXNwX3N0KSwKLSAgICAgICAgICAgIG1vZGUsCi0gICAgICAgICAgICBleGNfZW5oYW5jZWQsCi0gICAgICAgICAgICBnYWluX2NvZGVfbWl4LAotICAgICAgICAgICAgZ2Fpbl9waXQsCi0gICAgICAgICAgICBjb2RlLAotICAgICAgICAgICAgcGl0Y2hfZmFjLAotICAgICAgICAgICAgdG1wX3NoaWZ0LAotICAgICAgICAgICAgcE92ZXJmbG93KTsKLQotICAgICAgICAvKi0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0qCi0gICAgICAgICAqIC0gVGhlIEV4Y2l0YXRpb24gY29udHJvbCBtb2R1bGUgYXJlIGFjdGl2ZSBkdXJpbmcgQkZJLioKLSAgICAgICAgICogLSBDb25jZWFsIGRyb3BzIGluIHNpZ25hbCBlbmVyZ3kgaWYgaW4gYmcgbm9pc2UuICAgICAgKgotICAgICAgICAgKi0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0qLwotICAgICAgICBMX3RlbXAgPSAwOwotICAgICAgICBmb3IgKGkgPSAwOyBpIDwgTF9TVUJGUjsgaSsrKQotICAgICAgICB7Ci0gICAgICAgICAgICBMX3RlbXAgPSBMX21hYyhMX3RlbXAsICooZXhjX2VuaGFuY2VkICsgaSksICooZXhjX2VuaGFuY2VkICsgaSksIHBPdmVyZmxvdyk7Ci0gICAgICAgIH0KLQotICAgICAgICAvKiBleGNFbmVyZ3kgPSBzcXJ0KExfdGVtcCkgaW4gUTAgKi8KLSAgICAgICAgaWYgKExfdGVtcCA8IDApCi0gICAgICAgIHsKLSAgICAgICAgICAgIExfdGVtcCA9IH4oKH5MX3RlbXApID4+IDEpOwotICAgICAgICB9Ci0gICAgICAgIGVsc2UKLSAgICAgICAgewotICAgICAgICAgICAgTF90ZW1wID0gTF90ZW1wID4+IDE7Ci0gICAgICAgIH0KLQotICAgICAgICBMX3RlbXAgPSBzcXJ0X2xfZXhwKExfdGVtcCwgJnRlbXAsIHBPdmVyZmxvdyk7Ci0gICAgICAgIC8qIFRvIGNvcGUgd2l0aCAxNi1iaXQgYW5kIHNjYWxpbmcgaW4gZXhfY3RybCgpICovCi0gICAgICAgIExfdGVtcCA9IExfc2hyKExfdGVtcCwgKFdvcmQxNikoKHRlbXAgPj4gMSkgKyAxNSksIHBPdmVyZmxvdyk7Ci0gICAgICAgIGlmIChMX3RlbXAgPCAwKQotICAgICAgICB7Ci0gICAgICAgICAgICBleGNFbmVyZ3kgPSAoV29yZDE2KSh+KCh+TF90ZW1wKSA+PiAyKSk7Ci0gICAgICAgIH0KLSAgICAgICAgZWxzZQotICAgICAgICB7Ci0gICAgICAgICAgICBleGNFbmVyZ3kgPSAoV29yZDE2KShMX3RlbXAgPj4gMik7Ci0gICAgICAgIH0KLQotICAgICAgICBpZiAoKChtb2RlID09IE1SNDc1KSB8fCAobW9kZSA9PSBNUjUxNSkgfHwgKG1vZGUgPT0gTVI1OSkpICAmJgotICAgICAgICAgICAgICAgIChzdC0+dm9pY2VkSGFuZ292ZXIgPiA1KSAmJiAoc3QtPmluQmFja2dyb3VuZE5vaXNlICE9IDApICYmCi0gICAgICAgICAgICAgICAgKHN0LT5zdGF0ZSA8IDQpICYmCi0gICAgICAgICAgICAgICAgKChwZGZpICE9IDAgJiYgc3QtPnByZXZfcGRmICE9IDApIHx8IGJmaSAhPSAwIHx8IHN0LT5wcmV2X2JmICE9IDApKQotICAgICAgICB7Ci0gICAgICAgICAgICBjYXJlZnVsRmxhZyA9IDA7Ci0KLSAgICAgICAgICAgIGlmIChwZGZpICE9IDAgJiYgYmZpID09IDApCi0gICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgY2FyZWZ1bEZsYWcgPSAxOwotICAgICAgICAgICAgfQotCi0gICAgICAgICAgICBFeF9jdHJsKGV4Y19lbmhhbmNlZCwKLSAgICAgICAgICAgICAgICAgICAgZXhjRW5lcmd5LAotICAgICAgICAgICAgICAgICAgICBzdC0+ZXhjRW5lcmd5SGlzdCwKLSAgICAgICAgICAgICAgICAgICAgc3QtPnZvaWNlZEhhbmdvdmVyLAotICAgICAgICAgICAgICAgICAgICBzdC0+cHJldl9iZiwKLSAgICAgICAgICAgICAgICAgICAgY2FyZWZ1bEZsYWcsIHBPdmVyZmxvdyk7Ci0gICAgICAgIH0KLQotICAgICAgICBpZiAoISgoc3QtPmluQmFja2dyb3VuZE5vaXNlICE9IDApICYmIChiZmkgIT0gMCB8fCBzdC0+cHJldl9iZiAhPSAwKSAmJgotICAgICAgICAgICAgICAgIChzdC0+c3RhdGUgPCA0KSkpCi0gICAgICAgIHsKLSAgICAgICAgICAgIC8qIFVwZGF0ZSBlbmVyZ3kgaGlzdG9yeSBmb3IgYWxsIG1vZGVzICovCi0gICAgICAgICAgICBmb3IgKGkgPSAwOyBpIDwgODsgaSsrKQotICAgICAgICAgICAgewotICAgICAgICAgICAgICAgIHN0LT5leGNFbmVyZ3lIaXN0W2ldID0gc3QtPmV4Y0VuZXJneUhpc3RbaSsxXTsKLSAgICAgICAgICAgIH0KLSAgICAgICAgICAgIHN0LT5leGNFbmVyZ3lIaXN0WzhdID0gZXhjRW5lcmd5OwotICAgICAgICB9Ci0gICAgICAgIC8qLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSoKLSAgICAgICAgICogRXhjaXRhdGlvbiBjb250cm9sIG1vZHVsZSBlbmQuICAgICAgICAgICAgICAgICAgICAgICAgKgotICAgICAgICAgKi0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0qLwotICAgICAgICBpZiAocGl0X3NoYXJwID4gMTYzODQpCi0gICAgICAgIHsKLSAgICAgICAgICAgIGZvciAoaSA9IDA7IGkgPCBMX1NVQkZSOyBpKyspCi0gICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgKihleGNwICsgaSkgPSBhZGQoKihleGNwICsgaSksICooZXhjX2VuaGFuY2VkICsgaSksIHBPdmVyZmxvdyk7Ci0KLSAgICAgICAgICAgIH0KLSAgICAgICAgICAgIGFnYzIoZXhjX2VuaGFuY2VkLCBleGNwLCBMX1NVQkZSLCBwT3ZlcmZsb3cpOwotICAgICAgICAgICAgKnBPdmVyZmxvdyA9IDA7Ci0gICAgICAgICAgICBTeW5fZmlsdChBeiwgZXhjcCwgJnN5bnRoW2lfc3ViZnJdLCBMX1NVQkZSLAotICAgICAgICAgICAgICAgICAgICAgc3QtPm1lbV9zeW4sIDApOwotICAgICAgICB9Ci0gICAgICAgIGVsc2UKLSAgICAgICAgewotICAgICAgICAgICAgKnBPdmVyZmxvdyA9IDA7Ci0gICAgICAgICAgICBTeW5fZmlsdChBeiwgZXhjX2VuaGFuY2VkLCAmc3ludGhbaV9zdWJmcl0sIExfU1VCRlIsCi0gICAgICAgICAgICAgICAgICAgICBzdC0+bWVtX3N5biwgMCk7Ci0gICAgICAgIH0KLQotICAgICAgICBpZiAoKnBPdmVyZmxvdyAhPSAwKSAgICAvKiBUZXN0IGZvciBvdmVyZmxvdyAqLwotICAgICAgICB7Ci0gICAgICAgICAgICBmb3IgKGkgPSBQSVRfTUFYICsgTF9JTlRFUlBPTCArIExfU1VCRlIgLSAxOyBpID49IDA7IGktLSkKLSAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICBpZiAoc3QtPm9sZF9leGNbaV0gPCAwKQotICAgICAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAgICAgc3QtPm9sZF9leGNbaV0gPSB+KCh+c3QtPm9sZF9leGNbaV0pID4+IDIpOwotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICBlbHNlCi0gICAgICAgICAgICAgICAgewotICAgICAgICAgICAgICAgICAgICBzdC0+b2xkX2V4Y1tpXSA9IHN0LT5vbGRfZXhjW2ldID4+IDI7Ci0gICAgICAgICAgICAgICAgfQotCi0gICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgIGZvciAoaSA9IExfU1VCRlIgLSAxOyBpID49IDA7IGktLSkKLSAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICBpZiAoKihleGNfZW5oYW5jZWQgKyBpKSA8IDApCi0gICAgICAgICAgICAgICAgewotICAgICAgICAgICAgICAgICAgICAqKGV4Y19lbmhhbmNlZCArIGkpID0gfigofigqKGV4Y19lbmhhbmNlZCArIGkpKSkgPj4gMik7Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgIGVsc2UKLSAgICAgICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgICAgICooZXhjX2VuaGFuY2VkICsgaSkgPSAqKGV4Y19lbmhhbmNlZCArIGkpID4+IDI7Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgfQotICAgICAgICAgICAgU3luX2ZpbHQoQXosIGV4Y19lbmhhbmNlZCwgJnN5bnRoW2lfc3ViZnJdLCBMX1NVQkZSLCBzdC0+bWVtX3N5biwgMSk7Ci0gICAgICAgIH0KLSAgICAgICAgZWxzZQotICAgICAgICB7Ci0gICAgICAgICAgICBDb3B5KCZzeW50aFtpX3N1YmZyK0xfU1VCRlItTV0sIHN0LT5tZW1fc3luLCBNKTsKLSAgICAgICAgfQotCi0gICAgICAgIC8qLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0qCi0gICAgICAgICAqIFVwZGF0ZSBzaWduYWwgZm9yIG5leHQgZnJhbWUuICAgICAgICAgICAgICAgICAgICAqCi0gICAgICAgICAqIC0+IHNoaWZ0IHRvIHRoZSBsZWZ0IGJ5IExfU1VCRlIgIHN0LT5leGNbXSAgICAgICA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FJldHVybnMgICAgIDogMCBvbiBzdWNjZXNzCi0gICAgICovCi0gICAgV29yZDE2IERlY29kZXJfYW1yX3Jlc2V0KERlY29kZXJfYW1yU3RhdGUgKnN0LCBlbnVtIE1vZGUgbW9kZSk7Ci0KLSAgICAvKgotICAgICAqICBGdW5jdGlvbiAgICA6IERlY29kZXJfYW1yCi0gICAgICogIFB1cnBvc2UgICAgIDogU3BlZWNoIGRlY29kZXIgcm91dGluZS4KLSAgICAgKiAgUmV0dXJucyAgICAgOiAwCi0gICAgICovCi0gICAgdm9pZCBEZWNvZGVyX2FtcigKLSAgICAgICAgRGVjb2Rlcl9hbXJTdGF0ZSAqc3QsICAvKiBpL28gOiBTdGF0ZSB2YXJpYWJsZXMgICAgICAgICAgICAgICAgICAgICAgICovCi0gICAgICAgIGVudW0gTW9kZSBtb2RlLCAgICAgICAgLyogaSAgIDogQU1SIG1vZGUgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotICAgICAgICBXb3JkMTYgcGFybVtdLCAgICAgICAgIC8qIGkgICA6IHZlY3RvciBvZiBzeW50aGVzaXMgcGFyYW1ldGVycwotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKFBSTV9TSVpFKSAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotICAgICAgICBlbnVtIFJYRnJhbWVUeXBlIGZyYW1lX3R5cGUsIC8qIGkgICA6IHJlY2VpdmVkIGZyYW1lIHR5cGUgICAgICAgICAgICAgICAqLwotICAgICAgICBXb3JkMTYgc3ludGhbXSwgICAgICAgIC8qIG8gICA6IHN5bnRoZXNpcyBzcGVlY2ggKExfRlJBTUUpICAgICAgICAgICAgKi8KLSAgICAgICAgV29yZDE2IEFfdFtdICAgICAgICAgICAvKiBvICAgOiBkZWNvZGVkIExQIGZpbHRlciBpbiA0IHN1YmZyYW1lcwotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKEFaX1NJWkUpICAgICAgICAgICAgICAgICAgICAgICAgICA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X01SMTIyOwotICAgIFdvcmQxNiBnX2NvZGU7Ci0gICAgV29yZDMyIExfdG1wOwotICAgIFdvcmQxNiB0ZW1wMTsKLSAgICBXb3JkMTYgdGVtcDI7Ci0KLSAgICAvKiBSZWFkIHRoZSBxdWFudGl6ZWQgZ2FpbnMgKHRhYmxlIGRlcGVuZHMgb24gbW9kZSkgKi8KLSAgICBpbmRleCA9IHNobChpbmRleCwgMiwgcE92ZXJmbG93KTsKLQotICAgIGlmIChtb2RlID09IE1SMTAyIHx8IG1vZGUgPT0gTVI3NCB8fCBtb2RlID09IE1SNjcpCi0gICAgewotICAgICAgICBwID0gJnRhYmxlX2dhaW5faGlnaHJhdGVzW2luZGV4XTsKLQotICAgICAgICAqZ2Fpbl9waXQgPSAqcCsrOwotICAgICAgICBnX2NvZGUgPSAqcCsrOwotICAgICAgICBxdWFfZW5lcl9NUjEyMiA9ICpwKys7Ci0gICAgICAgIHF1YV9lbmVyID0gKnA7Ci0gICAgfQotICAgIGVsc2UKLSAgICB7Ci0gICAgICAgIGlmIChtb2RlID09IE1SNDc1KQotICAgICAgICB7Ci0gICAgICAgICAgICBpbmRleCArPSAoMSBeIGV2ZW5TdWJmcikgPDwgMTsgLyogZXZlblN1YmZyIGlzIDAgb3IgMSAqLwotCi0gICAgICAgICAgICBpZiAoaW5kZXggPiAoTVI0NzVfVlFfU0laRSo0IC0gMikpCi0gICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgaW5kZXggPSAoTVI0NzVfVlFfU0laRSAqIDQgLSAyKTsgLyogYXZvaWQgcG9zc2libGUgYnVmZmVyIG92ZXJmbG93ICovCi0gICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgIHAgPSAmdGFibGVfZ2Fpbl9NUjQ3NVtpbmRleF07Ci0KLSAgICAgICAgICAgICpnYWluX3BpdCA9ICpwKys7Ci0gICAgICAgICAgICBnX2NvZGUgPSAqcCsrOwotCi0gICAgICAgICAgICAvKi0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSoKLSAgICAgICAgICAgICAqICBjYWxjdWxhdGUgcHJlZGljdG9yIHVwZGF0ZSB2YWx1ZXMgKG5vdCBzdG9yZWQgaW4gNC43NSAgKgotICAgICAgICAgICAgICogIHF1YW50aXplciB0YWJsZSB0byBzYXZlIHNwYWNlKTogICAgICAgICAgICAgICAgICAgICAgICAqCi0gICAgICAgICAgICAgKiAgfn5+fn5+fn5+fn5+fn5+fn5+fn5+fn5+fn5+fn5+fn5+fn5+fn5+fn5+fn5+fn5+fn5+fn4gICoKLSAgICAgICAgICAgICAqICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKgotICAgICAgICAgICAgICogICBxdWFfZW5lciAgICAgICA9IGxvZzIoZykgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqCi0gICAgICAgICAgICAgKiAgIHF1YV9lbmVyX01SMTIyID0gMjAqbG9nMTAoZykgICAgICAgICAgICAgICAgICAgICAgICAgICoKLSAgICAgICAgICAgICAqLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tKi8KLQotICAgICAgICAgICAgLyogTG9nMih4IFExMikgPSBsb2cyKHgpICsgMTIgKi8KLSAgICAgICAgICAgIHRlbXAxID0gKFdvcmQxNikgTF9kZXBvc2l0X2woZ19jb2RlKTsKLSAgICAgICAgICAgIExvZzIodGVtcDEsICZleHAsICZmcmFjLCBwT3ZlcmZsb3cpOwotICAgICAgICAgICAgZXhwID0gc3ViKGV4cCwgMTIsIHBPdmVyZmxvdyk7Ci0KLSAgICAgICAgICAgIHRlbXAxID0gc2hyX3IoZnJhYywgNSwgcE92ZXJmbG93KTsKLSAgICAgICAgICAgIHRlbXAyID0gc2hsKGV4cCwgMTAsIHBPdmVyZmxvdyk7Ci0gICAgICAgICAgICBxdWFfZW5lcl9NUjEyMiA9IGFkZCh0ZW1wMSwgdGVtcDIsIHBPdmVyZmxvdyk7Ci0KLSAgICAgICAgICAgIC8qIDI0NjYwIFExMiB+PSA2LjAyMDYgPSAyMCpsb2cxMCgyKSAqLwotICAgICAgICAgICAgTF90bXAgPSBNcHlfMzJfMTYoZXhwLCBmcmFjLCAyNDY2MCwgcE92ZXJmbG93KTsKLSAgICAgICAgICAgIExfdG1wID0gTF9zaGwoTF90bXAsIDEzLCBwT3ZlcmZsb3cpOwotICAgICAgICAgICAgcXVhX2VuZXIgPSBwdl9yb3VuZChMX3RtcCwgcE92ZXJmbG93KTsKLSAgICAgICAgICAgIC8qIFExMiAqIFEwID0gUTEzIC0+IFExMCAqLwotICAgICAgICB9Ci0gICAgICAgIGVsc2UKLSAgICAgICAgewotICAgICAgICAgICAgcCA9ICZ0YWJsZV9nYWluX2xvd3JhdGVzW2luZGV4XTsKLQotICAgICAgICAgICAgKmdhaW5fcGl0ID0gKnArKzsKLSAgICAgICAgICAgIGdfY29kZSA9ICpwKys7Ci0gICAgICAgICAgICBxdWFfZW5lcl9NUjEyMiA9ICpwKys7Ci0gICAgICAgICAgICBxdWFfZW5lciA9ICpwOwotICAgICAgICB9Ci0gICAgfQotCi0gICAgLyotLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tKgotICAgICAqICBwcmVkaWN0IGNvZGVib29rIGdhaW4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICoKLSAgICAgKiAgfn5+fn5+fn5+fn5+fn5+fn5+fn5+ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqCi0gICAgICogIGdjMCAgICAgPSBQb3cyKGludChkKStmcmFjKGQpKSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKgotICAgICAqICAgICAgICAgID0gMl5leHAgKyAyXmZyYWMgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICoKLSAgICAgKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqCi0gICAgICogIGdjb2RlMCAoUTE0KSA9IDJeMTQqMl5mcmFjID0gZ2MwICogMl4oMTQtZXhwKSAgICAgICAgICAgICAgICAgICAgKgotICAgICAqLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSovCi0KLSAgICBnY19wcmVkKHByZWRfc3RhdGUsIG1vZGUsIGNvZGUsICZleHAsICZmcmFjLCBOVUxMLCBOVUxMLCBwT3ZlcmZsb3cpOwotCi0gICAgZ2NvZGUwID0gKFdvcmQxNikgUG93MigxNCwgZnJhYywgcE92ZXJmbG93KTsKLQotICAgIC8qLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tKgotICAgICAqICByZWFkIHF1YW50aXplZCBnYWlucywgdXBkYXRlIHRhYmxlIG9mIHBhc3QgcXVhbnRpemVkIGVuZXJnaWVzICAgKgotICAgICAqICB+fn5+fn5+fn5+fn5+fn5+fn5+fn5+fn5+fn5+fn5+fn5+fn5+fn5+fn5+fn5+fn5+fn5+fn5+fn5+fn5+ICAgKgotICAgICAqICBzdC0+cGFzdF9xdWFfZW4oUTEwKSA9IDIwICogTG9nMTAoZ19mYWMpIC8gY29uc3RhbnQgICAgICAgICAgICAgKgotICAgICAqICAgICAgICAgICAgICAgICAgICAgICA9IExvZzIoZ19mYWMpICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKgotICAgICAqICAgICAgICAgICAgICAgICAgICAgICA9IHF1YV9lbmVyICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKgotICAgICAqICAgICAgICAgICAgICAgICAgICAgICAg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kZWJvb2sgZ2FpbnMKLSAgICAgKi8KLSAgICB2b2lkIERlY19nYWluKAotICAgICAgICBnY19wcmVkU3RhdGUgKnByZWRfc3RhdGUsIC8qIGkvbzogTUEgcHJlZGljdG9yIHN0YXRlICAgICAgICAgICAqLwotICAgICAgICBlbnVtIE1vZGUgbW9kZSwgICAgICAgICAgIC8qIGkgIDogQU1SIG1vZGUgICAgICAgICAgICAgICAgICAgICAqLwotICAgICAgICBXb3JkMTYgaW5kZXgsICAgICAgICAgICAgIC8qIGkgIDogaW5kZXggb2YgcXVhbnRpemF0aW9uLiAgICAgICAqLwotICAgICAgICBXb3JkMTYgY29kZVtdLCAgICAgICAgICAgIC8qIGkgIDogSW5ub3ZhdGl2ZSB2ZWN0b3IuICAgICAgICAgICAqLwotICAgICAgICBXb3JkMTYgZXZlblN1YmZyLCAgICAgICAgIC8qIGkgIDogRmxhZyBmb3IgZXZlbiBzdWJmcmFtZXMgICAgICAqLwotICAgICAgICBXb3JkMTYgKiBnYWluX3BpdCwgICAgICAgIC8qIG8gIDogUGl0Y2ggZ2Fpbi4gICAgICAgICAgICAgICAgICAqLwotICAgICAgICBXb3JkMTYgKiBnYWluX2NvZCwgICAgICAgIC8qIG8gIDogQ29kZSBnYWluLiAgICAgICAgICAgICAgICAgICAqLwotICAgICAgICBGbGFnICAgKiBwT3ZlcmZsb3cKLSAgICApOwotCi0KLQotI2lmZGVmIF9fY3BsdXNwbHVzCi19Ci0jZW5kaWYKLQotI2VuZGlmICAvKiBfREVDX0dBSU5fSF8gKi8KLQotCi0KZGlmZiAtLWdpdCBhL21lZGlhL2xpYnN0YWdlZnJpZ2h0L2NvZGVjcy9hbXJuYi9kZWMvc3JjL2RlY19pbnB1dF9mb3JtYXRfdGFiLmNwcCBiL21lZGlhL2xpYnN0YWdlZnJpZ2h0L2NvZGVjcy9hbXJuYi9kZWMvc3JjL2RlY19pbnB1dF9mb3JtYXRfdGFiLmNwcApkZWxldGVkIGZpbGUgbW9kZSAxMDA2N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ovCi0gICAgY29uc3QgV29yZDE2IFdtZkRlY0J5dGVzUGVyRnJhbWVbMTZdID0KLSAgICB7Ci0gICAgICAgIDEyLCAvKiA0Ljc1ICovCi0gICAgICAgIDEzLCAvKiA1LjE1ICovCi0gICAgICAgIDE1LCAvKiA1LjkwICovCi0gICAgICAgIDE3LCAvKiA2LjcwICovCi0gICAgICAgIDE5LCAvKiA3LjQwICovCi0gICAgICAgIDIwLCAvKiA3Ljk1ICovCi0gICAgICAgIDI2LCAvKiAxMC4yICovCi0gICAgICAgIDMxLCAvKiAxMi4yICovCi0gICAgICAgIDUsIC8qIEdzbUFtciBjb21mb3J0IG5vaXNlICovCi0gICAgICAgIDYsIC8qIEdzbS1FZnIgY29tZm9ydCBub2lzZSAqLwotICAgICAgICA1LCAvKiBJUy02NDEgY29tZm9ydCBub2lzZSAqLwotICAgICAgICA1LCAvKiBQZGMtRWZyIGNvbWZvcnQgbm9pc2UgKi8KLSAgICAgICAgMCwgLyogZnV0dXJlIHVzZSAqLwotICAgICAgICAwLCAvKiBmdXR1cmUgdXNlICovCi0gICAgICAgIDAsIC8qIGZ1dHVyZSB1c2UgKi8KLSAgICAgICAgMCAvKiBObyB0cmFuc21pc3Npb24gKi8KLSAgICB9OwotCi0gICAgLyogVGFibGUgY29udGFpbmluZyB0aGUgbnVtYmVyIG9mIGNvcmUgQU1SIGRhdGEgYnl0ZXMgZm9yICAgKi8KLSAgICAvKiBlYWNoIGNvZGVjIG1vZGUgZm9yIElGMiBpbnB1dCBmb3JtYXQuICAgICAgICAgICAgICAgICAgICAqLwotICAgIGNvbnN0IFdvcmQxNiBJZjJEZWNCeXRlc1BlckZyYW1lWzE2XSA9Ci0gICAgewotICAgICAgICAxMywgLyogNC43NSAqLwotICAgICAgICAxNCwgLyogNS4xNSAqLwotICAgICAgICAxNiwgLyogNS45MCAqLwotICAgICAgICAxOCwgLyogNi43MCAqLwotICAgICAgICAxOSwgLyogNy40MCAqLwotICAgICAgICAyMSwgLyogNy45NSA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tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSovCi0KLXZvaWQgRGVjX2xhZzMoV29yZDE2IGluZGV4LCAgICAgLyogaSA6IHJlY2VpdmVkIHBpdGNoIGluZGV4ICAgICAgICAgICAgICAgICAqLwotICAgICAgICAgICAgICBXb3JkMTYgdDBfbWluLCAgICAvKiBpIDogbWluaW11bSBvZiBzZWFyY2ggcmFuZ2UgICAgICAgICAgICAgICovCi0gICAgICAgICAgICAgIFdvcmQxNiB0MF9tYXgsICAgIC8qIGkgOiBtYXhpbXVtIG9mIHNlYXJjaCByYW5nZSAgICAgICAgICAgICAgKi8KLSAgICAgICAgICAgICAgV29yZDE2IGlfc3ViZnIsICAgLyogaSA6IHN1YmZyYW1lIGZsYWcgICAgICAgICAgICAgICAgICAgICAgICAqLwotICAgICAgICAgICAgICBXb3JkMTYgVDBfcHJldiwgICAvKiBpIDogaW50ZWdlciBwaXRjaCBkZWxheSBvZiBsYXN0IHN1YmZyYW1lCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB1c2VkIGluIDJuZCBhbmQgNHRoIHN1YmZyYW1lcyAgICAgICAgKi8KLSAgICAgICAgICAgICAgV29yZDE2ICogVDAsICAgICAgLyogbyA6IGludGVnZXIgcGFydCBvZiBwaXRjaCBsYWcgICAgICAgICAgICAqLwotICAgICAgICAgICAgICBXb3JkMTYgKiBUMF9mcmFjLCAvKiBvIDogZnJhY3Rpb25hbCBwYXJ0IG9mIHBpdGNoIGxhZyAgICAgICAgICovCi0gICAgICAgICAgICAgIFdvcmQxNiBmbGFnNCwgICAgIC8qIGkgOiBmbGFnIGZvciBlbmNvZGluZyB3aXRoIDQgYml0cyAgICAgICAgKi8KLSAgICAgICAgICAgICAgRmxhZyAgKnBPdmVyZmxvdyAgLyogbyA6IEZsYWcgc2V0IHdoZW4gb3ZlcmZsb3cgb2NjdXJzICAgICAgICAqLwotICAgICAgICAgICAgICkKLXsKLSAgICBXb3JkMTYgaTsKLSAgICBXb3JkMTYgdG1wX2xhZzsKLQotICAgIGlmIChpX3N1YmZyID09IDApICAgIC8qIGlmIDFzdCBvciAzcmQgc3ViZnJhbWUgKi8KLSAgICB7Ci0KLSAgICAgICAgaWYgKGluZGV4IDwgMTk3KQotICAgICAgICB7Ci0KLSAgICAgICAgICAgIHRtcF9sYWcgPSBpbmRleCArIDI7Ci0KLSAgICAgICAgICAgIHRtcF9sYWcgPQotICAgICAgICAgICAgICAgIG11bHQoCi0gICAgICAgICAgICAgICAgICAgIHRtcF9sYWcsCi0gICAgICAgICAgICAgICAgICAgIDEwOTIzLAotICAgICAgICAgICAgICAgICAgICBwT3ZlcmZsb3cpOwotCi0gICAgICAgICAgICBpID0KLSAgICAgICAgICAgICAgICBhZGQoCi0gICAgICAgICAgICAgICAgICAgIHRtcF9sYWcsCi0gICAgICAgICAgICAgICAgICAgIDE5LAotICAgICAgICAgICAgICAgICAgICBwT3ZlcmZsb3cpOwotCi0gICAgICAgICAgICAqVDAgPSBpOwotCi0gICAgICAgICAgICAvKiBpID0gMyAqICgqVDApICovCi0KLSAgICAgICAgICAgIGkgPSBhZGQoaSwgaSwgcE92ZXJmbG93KTsKLSAgICAgICAgICAgIGkgPSBhZGQoaSwgKlQwLCBwT3ZlcmZsb3cpOwotCi0gICAgICAgICAgICB0bXBfbGFnID0KLSAgICAgICAgICAgICAgICBzdWIoCi0gICAgICAgICAgICAgICAgICAgIGluZGV4LAotICAgICAgICAgICAgICAgICAgICBpLAotICAgICAgICAgICAgICAgICAgICBwT3ZlcmZsb3cpOwotCi0gICAgICAgICAgICAqVDBfZnJhYyA9Ci0gICAgICAgICAgICAgICAgYWRkKAotICAgICAgICAgICAgICAgICAgICB0bXBfbGFnLAotICAgICAgICAgICAgICAgICAgICA1OCwKLSAgICAgICAgICAgICAgICAgICAgcE92ZXJmbG93KTsKLSAgICAgICAgfQotICAgICAgICBlbHNlCi0gICAgICAgIHsKLSAgICAgICAgICAgICpUMCA9IGluZGV4IC0gMTEyOwotCi0gICAgICAgICAgICAqVDBfZnJhYyA9IDA7Ci0gICAgICAgIH0KLQotICAgIH0KLSAgICBlbHNlCi0gICAgeyAgLyogMm5kIG9yIDR0aCBzdWJmcmFtZSAqLwotCi0gICAgICAgIGlmIChmbGFnNCA9PSAwKQotICAgICAgICB7Ci0KLSAgICAgICAgICAgIC8qICdub3JtYWwnIGRlY29kaW5nOiBlaXRoZXIgd2l0aCA1IG9yIDYgYml0IHJlc29sdXRpb24gKi8KLQotICAgICAgICAgICAgaSA9Ci0gICAgICAgICAgICAgICAgYWRkKAotICAgICAgICAgICAgICAgICAgICBpbmRleCwKLSAgICAgICAgICAgICAgICAgICAgMiwKLSAgICAgICAgICAgICAgICAgICAgcE92ZXJmbG93KTsKLQotICAgICAgICAgICAgaSA9Ci0gICAgICAgICAgICAgICAgbXVsdCgKLSAgICAgICAgICAgICAgICAgICAgaSwKLSAgICAgICAgICAgICAgICAgICAgMTA5MjMsCi0gICAgICAgICAgICAgICAgICAgIHBPdmVyZmxvdyk7Ci0KLSAgICAgICAgICAgIGkgPQotICAgICAgICAgICAgICAgIHN1YigKLSAgICAgICAgICAgICAgICAgICAgaSwKLSAgICAgICAgICAgICAgICAgICAgMSwKLSAgICAgICAgICAgICAgICAgICAgcE92ZXJmbG93KTsKLQotICAgICAgICAgICAgKlQwID0KLSAgICAgICAgICAgICAgICBhZGQoCi0gICAgICAgICAgICAgICAgICAgIGksCi0gICAgICAgICAgICAgICAgICAgIHQwX21pbiwKLSAgICAgICAgICAgICAgICAgICAgcE92ZXJmbG93KTsKLQotICAgICAgICAgICAgLyogaSA9IDMqICgqVDApICovCi0gICAgICAgICAgICBpID0gYWRkKGFkZChpLCBpLCBwT3ZlcmZsb3cpLCBpLCBwT3ZlcmZsb3cpOwotCi0gICAgICAgICAgICB0bXBfbGFnID0KLSAgICAgICAgICAgICAgICBzdWIoCi0gICAgICAgICAgICAgICAgICAgIGluZGV4LAotICAgICAgICAgICAgICAgICAgICAyLAotICAgICAgICAgICAgICAgICAgICBwT3ZlcmZsb3cpOwotCi0gICAgICAgICAgICAqVDBfZnJhYyA9Ci0gICAgICAgICAgICAgICAgc3ViKAotICAgICAgICAgICAgICAgICAgICB0bXBfbGFnLAotICAgICAgICAgICAgICAgICAgICBpLAotICAgICAgICAgICAgICAgICAgICBwT3ZlcmZsb3cpOwotICAgICAgICB9Ci0gICAgICAgIGVsc2UKLSAgICAgICAgewotCi0gICAgICAgICAgICAvKiBkZWNvZGluZyB3aXRoIDQgYml0IHJlc29sdXRpb24gKi8KLQotICAgICAgICAgICAgdG1wX2xhZyA9IFQwX3ByZXY7Ci0KLSAgICAgICAgICAgIGkgPQotICAgICAgICAgICAgICAgIHN1YigKLSAgICAgICAgICAgICAgICAgICAgdG1wX2xhZywKLSAgICAgICAgICAgICAgICAgICAgdDBfbWluLAotICAgICAgICAgICAgICAgICAgICBwT3ZlcmZsb3cpOwotCi0gICAgICAgICAgICBpZiAoaSA+IDUpCi0gICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgdG1wX2xhZyA9Ci0gICAgICAgICAgICAgICAgICAgIGFkZCgKLSAgICAgICAgICAgICAgICAgICAgICAgIHQwX21pbiwKLSAgICAgICAgICAgICAgICAgICAgICAgIDUsCi0gICAgICAgICAgICAgICAgICAgICAgICBwT3ZlcmZsb3cpOwotICAgICAgICAgICAgfQotCi0gICAgICAgICAgICBpID0KLSAgICAgICAgICAgICAgICBzdWIoCi0gICAgICAgICAgICAgICAgICAgIHQwX21heCwKLSAgICAgICAgICAgICAgICAgICAgdG1wX2xhZywKLSAgICAgICAgICAgICAgICAgICAgcE92ZXJmbG93KTsKLQotICAgICAgICAgICAgaWYgKGkgPiA0KQotICAgICAgICAgICAgewotICAgICAgICAgICAgICAgIHRtcF9sYWcgPQotICAgICAgICAgICAgICAgICAgICBzdWIoCi0gICAgICAgICAgICAgICAgICAgICAgICB0MF9tYXgsCi0gICAgICAgICAgICAgICAgICAgICAgICA0LAotICAgICAgICAgICAgICAgICAgICAgICAgcE92ZXJmbG93KTsKLSAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgaWYgKGluZGV4IDwgNCkKLSAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICBpID0KLSAgICAgICAgICAgICAgICAgICAgc3ViKAotICAgICAgICAgICAgICAgICAgICAgICAgdG1wX2xhZywKLSAgICAgICAgICAgICAgICAgICAgICAgIDUsCi0gICAgICAgICAgICAgICAgICAgICAgICBwT3ZlcmZsb3cpOwotCi0gICAgICAgICAgICAgICAgKlQwID0KLSAgICAgICAgICAgICAgICAgICAgYWRkKAotICAgICAgICAgICAgICAgICAgICAgICAgaSwKLSAgICAgICAgICAgICAgICAgICAgICAgIGluZGV4LAotICAgICAgICAgICAgICAgICAgICAgICAgcE92ZXJmbG93KTsKLQotICAgICAgICAgICAgICAgICpUMF9mcmFjID0gMDsKLSAgICAgICAgICAgIH0KLSAgICAgICAgICAgIGVsc2UKLSAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAvKiA0ID49IGluZGV4IDwgMTIgKi8KLSAgICAgICAgICAgICAgICBpZiAoaW5kZXggPCAxMikKLSAgICAgICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgICAgIGkgPSBpbmRleCAtIDU7Ci0KLSAgICAgICAgICAgICAgICAgICAgaSA9IG11bHQoCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgaSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAxMDkyMywKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBwT3ZlcmZsb3cpOwotCi0gICAgICAgICAgICAgICAgICAgIGktLTsKLQotICAgICAgICAgICAgICAgICAgICAqVDAgPSBhZGQoCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdG1wX2xhZywKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBPdmVyZmxvdyk7Ci0KLSAgICAgICAgICAgICAgICAgICAgaSA9IGFkZCgKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBhZGQoCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGksCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGksCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBPdmVyZmxvdyksCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgaSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBwT3ZlcmZsb3cpOwotCi0gICAgICAgICAgICAgICAgICAgIHRtcF9sYWcgPSBpbmRleCAtIDk7Ci0KLSAgICAgICAgICAgICAgICAgICAgKlQwX2ZyYWMgPQotICAgICAgICAgICAgICAgICAgICAgICAgc3ViKAotICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRtcF9sYWcsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgaSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBwT3ZlcmZsb3cpOwotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICBlbHNlCi0gICAgICAgICAgICAgICAgewotICAgICAgICAgICAgICAgICAgICBpID0gaW5kZXggLSAxMjsKLQotICAgICAgICAgICAgICAgICAgICBpID0KLSAgICAgICAgICAgICAgICAgICAgICAgIGFkZCgKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBpLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRtcF9sYWcsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgcE92ZXJmbG93KTsKLQotICAgICAgICAgICAgICAgICAgICAqVDAgPQotICAgICAgICAgICAgICAgICAgICAgICAgYWRkKAotICAgICAgICAgICAgICAgICAgICAgICAgICAgIGksCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgMSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBwT3ZlcmZsb3cpOwotCi0gICAgICAgICAgICAgICAgICAgICpUMF9mcmFjID0gMDsKLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICB9Ci0KLSAgIC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wdXQgOiBtaW5pbXVtIHBpdGNoIGxhZyAgICAgICAgICAgICAgKi8KLSAgICBXb3JkMTYgcGl0X21heCwgICAgLyogaW5wdXQgOiBtYXhpbXVtIHBpdGNoIGxhZyAgICAgICAgICAgICAgKi8KLSAgICBXb3JkMTYgaV9zdWJmciwgICAgLyogaW5wdXQgOiBzdWJmcmFtZSBmbGFnICAgICAgICAgICAgICAgICAgKi8KLSAgICBXb3JkMTYgKlQwLCAgICAgICAgLyogaW4vb3V0OiBpbnRlZ2VyIHBhcnQgb2YgcGl0Y2ggbGFnICAgICAgKi8KLSAgICBXb3JkMTYgKlQwX2ZyYWMsICAgLyogb3V0cHV0OiBmcmFjdGlvbmFsIHBhcnQgb2YgcGl0Y2ggbGFnICAgKi8KLSAgICBGbGFnICAgKnBPdmVyZmxvdyAgLyogbyA6IEZsYWcgc2V0IHdoZW4gb3ZlcmZsb3cgb2NjdXJzICAgICAgKi8KLSkKLXsKLSAgICBXb3JkMTYgaTsKLSAgICBXb3JkMTYgVDBfbWluOwotICAgIFdvcmQxNiBUMF9tYXg7Ci0gICAgV29yZDE2IGs7Ci0gICAgV29yZDE2IHc7Ci0KLSAgICBpZiAoaV9zdWJmciA9PSAwKSAgICAgICAgICAvKiBpZiAxc3Qgb3IgM3JkIHN1YmZyYW1lICovCi0gICAgewotICAgICAgICBpZiAoaW5kZXggPCA0NjMpCi0gICAgICAgIHsKLSAgICAgICAgICAgIC8qIFQwID0gKGluZGV4KzUpLzYgKyAxNyAqLwotICAgICAgICAgICAgaSA9IGluZGV4ICsgNTsKLSAgICAgICAgICAgIGkgPQotICAgICAgICAgICAgICAgIG11bHQoCi0gICAgICAgICAgICAgICAgICAgIGksCi0gICAgICAgICAgICAgICAgICAgIDU0NjIsCi0gICAgICAgICAgICAgICAgICAgIHBPdmVyZmxvdyk7Ci0KLSAgICAgICAgICAgIGkgPQotICAgICAgICAgICAgICAgIGFkZCgKLSAgICAgICAgICAgICAgICAgICAgaSwKLSAgICAgICAgICAgICAgICAgICAgMTcsCi0gICAgICAgICAgICAgICAgICAgIHBPdmVyZmxvdyk7Ci0KLSAgICAgICAgICAgICpUMCA9IGk7Ci0KLSAgICAgICAgICAgIC8qIGkgPSAzKiAoKlQwKSAqLwotCi0gICAgICAgICAgICBpID0gYWRkKGksIGksIHBPdmVyZmxvdyk7Ci0gICAgICAgICAgICBpID0gYWRkKGksICpUMCwgcE92ZXJmbG93KTsKLQotICAgICAgICAgICAgLyogKlQwX2ZyYWMgPSBpbmRleCAtIFQwKjYgKyAxMDUgKi8KLQotICAgICAgICAgICAgaSA9Ci0gICAgICAgICAgICAgICAgYWRkKAotICAgICAgICAgICAgICAgICAgICBpLAotICAgICAgICAgICAgICAgICAgICBpLAotICAgICAgICAgICAgICAgICAgICBwT3ZlcmZsb3cpOwotCi0gICAgICAgICAgICBpID0KLSAgICAgICAgICAgICAgICBzdWIoCi0gICAgICAgICAgICAgICAgICAgIGluZGV4LAotICAgICAgICAgICAgICAgICAgICBpLAotICAgICAgICAgICAgICAgICAgICBwT3ZlcmZsb3cpOwotCi0gICAgICAgICAgICAqVDBfZnJhYyA9Ci0gICAgICAgICAgICAgICAgYWRkKAotICAgICAgICAgICAgICAgICAgICBpLAotICAgICAgICAgICAgICAgICAgICAxMDUsCi0gICAgICAgICAgICAgICAgICAgIHBPdmVyZmxvdyk7Ci0gICAgICAgIH0KLSAgICAgICAgZWxzZQotICAgICAgICB7Ci0gICAgICAgICAgICAqVDAgPQotICAgICAgICAgICAgICAgIHN1YigKLSAgICAgICAgICAgICAgICAgICAgaW5kZXgsCi0gICAgICAgICAgICAgICAgICAgIDM2OCwKLSAgICAgICAgICAgICAgICAgICAgcE92ZXJmbG93KTsKLQotICAgICAgICAgICAgKlQwX2ZyYWMgPSAwOwotICAgICAgICB9Ci0gICAgfQotICAgIGVsc2UgICAgICAgLyogc2Vjb25kIG9yIGZvdXJ0aCBzdWJmcmFtZSAqLwotICAgIHsKLSAgICAgICAgLyogZmluZCBUMF9taW4gYW5kIFQwX21heCBmb3IgMm5kIChvciA0dGgpIHN1YmZyYW1lICovCi0KLSAgICAgICAgVDBfbWluID0KLSAgICAgICAgICAgIHN1YigKLSAgICAgICAgICAgICAgICAqVDAsCi0gICAgICAgICAgICAgICAgNSwKLSAgICAgICAgICAgICAgICBwT3ZlcmZsb3cpOwotCi0gICAgICAgIGlmIChUMF9taW4gPCBwaXRfbWluKQotICAgICAgICB7Ci0gICAgICAgICAgICBUMF9taW4gPSBwaXRfbWluOwotICAgICAgICB9Ci0KLSAgICAgICAgVDBfbWF4ID0KLSAgICAgICAgICAgIGFkZCgKLSAgICAgICAgICAgICAgICBUMF9taW4sCi0gICAgICAgICAgICAgICAgOSwKLSAgICAgICAgICAgICAgICBwT3ZlcmZsb3cpOwotCi0gICAgICAgIGlmIChUMF9tYXggPiBwaXRfbWF4KQotICAgICAgICB7Ci0gICAgICAgICAgICBUMF9tYXggPSBwaXRfbWF4OwotCi0gICAgICAgICAgICBUMF9taW4gPQotICAgICAgICAgICAgICAgIHN1YigKLSAgICAgICAgICAgICAgICAgICAgVDBfbWF4LAotICAgICAgICAgICAgICAgICAgICA5LAotICAgICAgICAgICAgICAgICAgICBwT3ZlcmZsb3cpOwotICAgICAgICB9Ci0KLSAgICAgICAgLyogaSA9IChpbmRleCs1KS82IC0gMSAqLwotICAgICAgICBpID0KLSAgICAgICAgICAgIGFkZCgKLSAgICAgICAgICAgICAgICBpbmRleCwKLSAgICAgICAgICAgICAgICA1LAotICAgICAgICAgICAgICAgIHBPdmVyZmxvdyk7Ci0KLSAgICAgICAgaSA9Ci0gICAgICAgICAgICBtdWx0KAotICAgICAgICAgICAgICAgIGksCi0gICAgICAgICAgICAgICAgNTQ2MiwKLSAgICAgICAgICAgICAgICBwT3ZlcmZsb3cpOwotCi0gICAgICAgIGkgPQotICAgICAgICAgICAgc3ViKAotICAgICAgICAgICAgICAgIGksCi0gICAgICAgICAgICAgICAgMSwKLSAgICAgICAgICAgICAgICBwT3ZlcmZsb3cpOwotCi0gICAgICAgICpUMCA9Ci0gICAgICAgICAgICBhZGQoCi0gICAgICAgICAgICAgICAgaSwKLSAgICAgICAgICAgICAgICBUMF9taW4sCi0gICAgICAgICAgICAgICAgcE92ZXJmbG93KTsKLQotICAgICAgICAvKiBpID0gMyogKCpUMCkgKi8KLQotICAgICAgICB3ID0gYWRkKGksIGksIHBPdmVyZmxvdyk7Ci0gICAgICAgIGkgPSBhZGQoaSwgdywgcE92ZXJmbG93KTsKLQotICAgICAgICBpID0KLSAgICAgICAgICAgIGFkZCgKLSAgICAgICAgICAgICAgICBpLAotICAgICAgICAgICAgICAgIGksCi0gICAgICAgICAgICAgICAgcE92ZXJmbG93KTsKLQotICAgICAgICBrID0KLSAgICAgICAgICAgIHN1YigKLSAgICAgICAgICAgICAgICBpbmRleCwKLSAgICAgICAgICAgICAgICAzLAotICAgICAgICAgICAgICAgIHBPdmVyZmxvdyk7Ci0KLSAgICAgICAgKlQwX2ZyYWMgPQotICAgICAgICAgICAgc3ViKAotICAgICAgICAgICAgICAgIGssCi0gICAgICAgICAgICAgICAgaSwKLSAgICAgICAgICAgICAgICBwT3ZlcmZsb3cpOwotICAgIH0KLX0KZGlmZiAtLWdpdCBhL21lZGlhL2xpYnN0YWdlZnJpZ2h0L2NvZGVjcy9hbXJuYi9kZWMvc3JjL2RlY19sYWc2LmggYi9tZWRpYS9saWJzdGFnZWZyaWdodC9jb2RlY3MvYW1ybmIvZGVjL3NyYy9kZWNfbGFnNi5oCmRlbGV0ZWQgZmlsZSBtb2RlIDEwMDY0NAppbmRleCA3MzIyYmM4Li4wMDAwMDAwCi0tLSBhL21lZGlhL2xpYnN0YWdlZnJpZ2h0L2NvZGVjcy9hbXJuYi9kZWMvc3JjL2RlY19sYWc2LmgKKysrIC9kZXYvbnVsbApAQCAtMSwxMjQgKzAsMCBAQAotLyogLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS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24KLSAgICAgICAgICAgIGlmIChzdC0+bHNmX2hpc3RfbWVhbltpK2oqTV0gPCAwKQotICAgICAgICAgICAgewotICAgICAgICAgICAgICAgbmVnYXRpdmUgPSAxOwotICAgICAgICAgICAgfQotICAgICAgICAgICAgZWxzZQotICAgICAgICAgICAgewotICAgICAgICAgICAgICAgbmVnYXRpdmUgPSAwOwotICAgICAgICAgICAgfQotICAgICAgICAgICAgc3QtPmxzZl9oaXN0X21lYW5baStqKk1dID0gYWJzX3Moc3QtPmxzZl9oaXN0X21lYW5baStqKk1dKTsKLQotICAgICAgICAgICAgLy8gYXBwbHkgc29mdCBsaW1pdAotICAgICAgICAgICAgaWYgKHN1YihzdC0+bHNmX2hpc3RfbWVhbltpK2oqTV0sIDY1NSkgPiAwKQotICAgICAgICAgICAgewotICAgICAgICAgICAgICAgc3QtPmxzZl9oaXN0X21lYW5baStqKk1dID0KLSAgICAgICAgICAgICAgICAgIGFkZCg2NTUsIHNocihzdWIoc3QtPmxzZl9oaXN0X21lYW5baStqKk1dLCA2NTUpLCAyKSk7Ci0gICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgIC8vIGFwcGx5IGhhcmQgbGltaXQKLSAgICAgICAgICAgIGlmIChzdWIoc3QtPmxzZl9oaXN0X21lYW5baStqKk1dLCAxMzEwKSA+IDApCi0gICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICBzdC0+bHNmX2hpc3RfbWVhbltpK2oqTV0gPSAxMzEwOwotICAgICAgICAgICAgfQotICAgICAgICAgICAgaWYgKG5lZ2F0aXZlICE9IDApCi0gICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICBzdC0+bHNmX2hpc3RfbWVhbltpK2oqTV0gPSAtc3QtPmxzZl9oaXN0X21lYW5baStqKk1dOwotICAgICAgICAgICAgfQotCi0gICAgICAgICB9Ci0gICAgICB9Ci0gICB9Ci0KLSAgIGlmIChzdC0+c2lkX2ZyYW1lICE9IDAgKQotICAgewotICAgICAgLy8gU2V0IG9sZCB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vZ19lbl9oaXN0X3B0ciArIDE7Ci0KLSAgICAgICAgaWYgKHB0ciA9PSBEVFhfSElTVF9TSVpFKQotICAgICAgICB7Ci0gICAgICAgICAgICBwdHIgPSAwOwotICAgICAgICB9Ci0KLSAgICAgICAgc3QtPmxvZ19lbl9oaXN0W3B0cl0gPSBzdC0+bG9nX2VuX2hpc3Rbc3QtPmxvZ19lbl9oaXN0X3B0cl07IC8qIFExMSAqLwotCi0gICAgICAgIC8qIGNvbXB1dGUgbWVhbiBsb2cgZW5lcmd5IGFuZCBsc3AgKgotICAgICAgICAgKiBmcm9tIGRlY29kZWQgc2lnbmFsIChTSURfRklSU1QpICovCi0gICAgICAgIHN0LT5sb2dfZW4gPSAwOwotICAgICAgICBmb3IgKGkgPSBNIC0gMTsgaSA+PSAwOyBpLS0pCi0gICAgICAgIHsKLSAgICAgICAgICAgIExfbHNmW2ldID0gMDsKLSAgICAgICAgfQotCi0gICAgICAgIC8qIGF2ZXJhZ2UgZW5lcmd5IGFuZCBsc3AgKi8KLSAgICAgICAgZm9yIChpID0gRFRYX0hJU1RfU0laRSAtIDE7IGkgPj0gMDsgaS0tKQotICAgICAgICB7Ci0gICAgICAgICAgICBpZiAoc3QtPmxvZ19lbl9oaXN0W2ldIDwgMCkKLSAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICB0ZW1wID0gfigofnN0LT5sb2dfZW5faGlzdFtpXSkgPj4gMyk7Ci0gICAgICAgICAgICB9Ci0gICAgICAgICAgICBlbHNlCi0gICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgdGVtcCA9IHN0LT5sb2dfZW5faGlzdFtpXSA+PiAzOwotICAgICAgICAgICAgfQotICAgICAgICAgICAgc3QtPmxvZ19lbiA9IGFkZChzdC0+bG9nX2VuLCB0ZW1wLCBwT3ZlcmZsb3cpOwotICAgICAgICAgICAgZm9yIChqID0gTSAtIDE7IGogPj0gMDsgai0tKQotICAgICAgICAgICAgewotICAgICAgICAgICAgICAgIExfbHNmW2pdID0gTF9hZGQoTF9sc2Zbal0sCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBMX2RlcG9zaXRfbChzdC0+bHNmX2hpc3RbaSAqIE0gKyBqXSksIHBPdmVyZmxvdyk7Ci0gICAgICAgICAgICB9Ci0gICAgICAgIH0KLQotICAgICAgICBmb3IgKGogPSBNIC0gMTsgaiA+PSAwOyBqLS0pCi0gICAgICAgIHsKLSAgICAgICAgICAgIGlmIChMX2xzZltqXSA8IDApCi0gICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgbHNmW2pdID0gKFdvcmQxNikofigofkxfbHNmW2pdKSA+PiAzKSk7Ci0gICAgICAgICAgICB9Ci0gICAgICAgICAgICBlbHNlCi0gICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgbHNmW2pdID0gKFdvcmQxNikoTF9sc2Zbal0gPj4gMyk7Ci0gICAgICAgICAgICB9Ci0gICAgICAgIH0KLQotICAgICAgICBMc2ZfbHNwKGxzZiwgc3QtPmxzcCwgTSwgcE92ZXJmbG93KTsKLQotICAgICAgICAvKiBtYWtlIGxvZ19lbiBzcGVlY2ggY29kZXIgbW9kZSBpbmRlcGVuZGVudCAqLwotICAgICAgICAvKiBhZGRlZCBhZ2FpbiBsYXRlciBiZWZvcmUgc3ludGhlc2lzICAgICAgICAqLwotICAgICAgICBzdC0+bG9nX2VuID0gc3ViKHN0LT5sb2dfZW4sIHN0LT5sb2dfZW5fYWRqdXN0LCBwT3ZlcmZsb3cpOwotCi0gICAgICAgIC8qIGNvbXB1dGUgbHNmIHZhcmlhYmlsaXR5IHZlY3RvciAqLwotICAgICAgICBDb3B5KHN0LT5sc2ZfaGlzdCwgc3QtPmxzZl9oaXN0X21lYW4sIDgwKTsKLQotICAgICAgICBmb3IgKGkgPSBNIC0gMTsgaSA+PSAwOyBpLS0pCi0gICAgICAgIHsKLSAgICAgICAgICAgIExfbHNmX21lYW4gPSAwOwotICAgICAgICAgICAgLyogY29tcHV0ZSBtZWFuIGxzZiAqLwotICAgICAgICAgICAgZm9yIChqID0gOCAtIDE7IGogPj0gMDsgai0tKQotICAgICAgICAgICAgewotICAgICAgICAgICAgICAgIExfbHNmX21lYW4gPSBMX2FkZChMX2xzZl9tZWFuLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBMX2RlcG9zaXRfbChzdC0+bHNmX2hpc3RfbWVhbltpK2oqTV0pLCBwT3ZlcmZsb3cpOwotICAgICAgICAgICAgfQotCi0gICAgICAgICAgICBpZiAoTF9sc2ZfbWVhbiA8IDApCi0gICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgbHNmX21lYW4gPSAoV29yZDE2KSh+KCh+TF9sc2ZfbWVhbikgPj4gMykpOwotICAgICAgICAgICAgfQotICAgICAgICAgICAgZWxzZQotICAgICAgICAgICAgewotICAgICAgICAgICAgICAgIGxzZl9tZWFuID0gKFdvcmQxNikoTF9sc2ZfbWVhbiA+PiAzKTsKLSAgICAgICAgICAgIH0KLSAgICAgICAgICAgIC8qIHN1YnRyYWN0IG1lYW4gYW5kIGxpbWl0IHRvIHdpdGhpbiByZWFzb25hYmxlIGxpbWl0cyAgKgotICAgICAgICAgICAgKiBtb3Jlb3ZlciB0aGUgdXBwZXIgbHNmJ3MgYXJlIGF0dGVudWF0ZWQgICAgICAgICAgICAgICovCi0gICAgICAgICAgICBmb3IgKGogPSA4IC0gMTsgaiA+PSAwOyBqLS0pCi0gICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgLyogc3VidHJhY3QgbWVhbiAqLwotICAgICAgICAgICAgICAgIHN0LT5sc2ZfaGlzdF9tZWFuW2kraipNXSA9Ci0gICAgICAgICAgICAgICAgICAgIHN1YihzdC0+bHNmX2hpc3RfbWVhbltpK2oqTV0sIGxzZl9tZWFuLCBwT3ZlcmZsb3cpOwotCi0gICAgICAgICAgICAgICAgLyogYXR0ZW51YXRlIGRldmlhdGlvbiBmcm9tIG1lYW4sIGVzcGVjaWFsbHkgZm9yIHVwcGVyIGxzZidzICovCi0gICAgICAgICAgICAgICAgc3QtPmxzZl9oaXN0X21lYW5baStqKk1dID0KLSAgICAgICAgICAgICAgICAgICAgbXVsdChzdC0+bHNmX2hpc3RfbWVhbltpK2oqTV0sIGxzZl9oaXN0X21lYW5fc2NhbGVbaV0sIHBPdmVyZmxvdyk7Ci0KLSAgICAgICAgICAgICAgICAvKiBsaW1pdCB0aGUgZGV2aWF0aW9uICovCi0gICAgICAgICAgICAgICAgaWYgKHN0LT5sc2ZfaGlzdF9tZWFuW2kraipNXSA8IDApCi0gICAgICAgICAgICAgICAgewotICAgICAgICAgICAgICAgICAgICBuZWdhdGl2ZSA9IDE7Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgIGVsc2UKLSAgICAgICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgICAgIG5lZ2F0aXZlID0gMDsKLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgc3QtPmxzZl9oaXN0X21lYW5baStqKk1dID0gYWJzX3Moc3QtPmxzZl9oaXN0X21lYW5baStqKk1dKTsKLQotICAgICAgICAgICAgICAgIC8qIGFwcGx5IHNvZnQgbGltaXQgKi8KLSAgICAgICAgICAgICAgICBpZiAoc3QtPmxzZl9oaXN0X21lYW5baStqKk1dID4gNjU1KQotICAgICAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAgICAgc3QtPmxzZl9oaXN0X21lYW5baStqKk1dID0gNjU1ICsgKChzdC0+bHNmX2hpc3RfbWVhbltpK2oqTV0KLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAtIDY1NSkgPj4gMik7Ci0gICAgICAgICAgICAgICAgfQotCi0gICAgICAgICAgICAgICAgLyogYXBwbHkgaGFyZCBsaW1pdCAqLwotICAgICAgICAgICAgICAgIGlmIChzdC0+bHNmX2hpc3RfbWVhbltpK2oqTV0gPiAxMzEwKQotICAgICAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAgICAgc3QtPmxzZl9oaXN0X21lYW5baStqKk1dID0gMTMxMDsKLSAgICAgICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgICAgICBpZiAobmVnYXRpdmUgIT0gMCkKLSAgICAgICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgICAgIHN0LT5sc2ZfaGlzdF9tZWFuW2kraipNXSA9IC1zdC0+bHNmX2hpc3RfbWVhbltpK2oqTV07Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgfQotICAgICAgICB9Ci0gICAgfQotCi0KLSAgICBpZiAoc3QtPnNpZF9mcmFtZSAhPSAwKQotICAgIHsKLSAgICAgICAgLyogU2V0IG9sZCBTSUQgcGFyYW1ldGVycywgYWx3YXlzIHNoaWZ0ICovCi0gICAgICAgIC8qIGV2ZW4gaWYgdGhlcmUgaXMgbm8gbmV3IHZhbGlkX2RhdGEgICAqLwotICAgICAgICBDb3B5KHN0LT5sc3AsIHN0LT5sc3Bfb2xkLCBNKTsKLSAgICAgICAgc3QtPm9sZF9sb2dfZW4gPSBzdC0+bG9nX2VuOwotCi0gICAgICAgIGlmIChzdC0+dmFsaWRfZGF0YSAhPSAwKSAgIC8qIG5ldyBkYXRhIGF2YWlsYWJsZSAobm8gQ1JDKSAqLwotICAgICAgICB7Ci0gICAgICAgICAgICAvKiBDb21wdXRlIGludGVycG9sYXRpb24gZmFjdG9yLCBzaW5jZSB0aGUgZGl2aXNpb24gb25seSB3b3JrcyAqCi0gICAgICAgICAgICAgKiBmb3IgdmFsdWVzIG9mIHNpbmNlX2xhc3Rfc2lkIDwgMzIgd2UgaGF2ZSB0byBsaW1pdCB0aGUgICAgICAqCi0gICAgICAgICAgICAgKiBpbnRlcnBvbGF0aW9uIHRvIDMyIGZyYW1lcyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotICAgICAgICAgICAgdG1wX2ludF9sZW5ndGggPSBzdC0+c2luY2VfbGFzdF9zaWQ7Ci0gICAgICAgICAgICBzdC0+c2luY2VfbGFzdF9zaWQgPSAwOwotCi0gICAgICAgICAgICBpZiAodG1wX2ludF9sZW5ndGggPj0gMzIpCi0gICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgdG1wX2ludF9sZW5ndGggPSAzMjsKLSAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgTF90ZW1wID0gKChXb3JkMzIpIHRtcF9pbnRfbGVuZ3RoKSA8PCAxMDsKLSAgICAgICAgICAgIGlmIChMX3RlbXAgIT0gKFdvcmQzMikoKFdvcmQxNikgTF90ZW1wKSkKLSAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAqcE92ZXJmbG93ID0gMTsKLSAgICAgICAgICAgICAgICBMX3RlbXAgPSAoV29yZDMyKSgodG1wX2ludF9sZW5ndGggPiAwKSA/IE1BWF8xNiA6IE1JTl8xNik7Ci0gICAgICAgICAgICB9Ci0gICAgICAgICAgICB0ZW1wID0gKFdvcmQxNikgTF90ZW1wOwotCi0gICAgICAgICAgICBpZiAodG1wX2ludF9sZW5ndGggPj0gMikKLSAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICBzdC0+dHJ1ZV9zaWRfcGVyaW9kX2ludiA9IGRpdl9zKDEgPDwgMTAsIHRlbXApOwotICAgICAgICAgICAgfQotICAgICAgICAgICAgZWxzZQotICAgICAgICAgICAgewotICAgICAgICAgICAgICAgIHN0LT50cnVlX3NpZF9wZXJpb2RfaW52ID0gMSA8PCAxNDsgLyogMC41IGl0IFExNSAqLwotICAgICAgICAgICAgfQotCi0gICAgICAgICAgICBJbml0X0RfcGxzZl8zKGxzZlN0YXRlLCBwYXJtWzBdKTsKLSAgICAgICAgICAgIERfcGxzZl8zKGxzZlN0YXRlLCBNUkRUWCwgMCwgJnBhcm1bMV0sIHN0LT5sc3AsIHBPdmVyZmxvdyk7Ci0gICAgICAgICAgICBTZXRfemVybyhsc2ZTdGF0ZS0+cGFzdF9yX3EsIE0pOyAgIC8qIHJlc2V0IGZvciBuZXh0IHNwZWVjaCBmcmFtZSAqLwotCi0gICAgICAgICAgICBsb2dfZW5faW5kZXggPSBwYXJtWzRdOwotICAgICAgICAgICAgLyogUTExIGFuZCBkaXZpZGUgYnkgNCAqLwotICAgICAgICAgICAgaWYgKChsb2dfZW5faW5kZXggPiA2MykgfHwgKGxvZ19lbl9pbmRleCA8IC02NCkpCi0gICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgc3QtPmxvZ19lbiA9IChsb2dfZW5faW5kZXggPiAwKSA/IE1BWF8xNiA6IE1JTl8xNjsKLSAgICAgICAgICAgIH0KLSAgICAgICAgICAgIGVsc2UKLSAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICBzdC0+bG9nX2VuID0gKGxvZ19lbl9pbmRleCkgPDwgKDExIC0gMik7Ci0gICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgIC8qIFN1YnRyYWN0IDIuNSBpbiBRMTEgKi8KLSAgICAgICAgICAgIHN0LT5sb2dfZW4gPSBzdWIoc3QtPmxvZ19lbiwgKDI1NjAgKiAyKSwgcE92ZXJmbG93KTsKLQotICAgICAgICAgICAgLyogSW5kZXggMCBpcyByZXNlcnZlZCBmb3Igc2lsZW5jZSAqLwotICAgICAgICAgICAgaWYgKGxvZ19lbl9pbmRleCA9PSAwKQotICAgICAgICAgICAgewotICAgICAgICAgICAgICAgIHN0LT5sb2dfZW4gPSBNSU5fMTY7Ci0gICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgIC8qIG5vIGludGVycG9sYXRpb24gYXQgc3RhcnR1cCBhZnRlciBjb2RlciByZXNldCAgICAgICAgKi8KLSAgICAgICAgICAgIC8qIG9yIHdoZW4gU0lEX1VQRCBoYXMgYmVlbiByZWNlaXZlZCByaWdodCBhZnRlciBTUEVFQ0ggKi8KLQotICAgICAgICAgICAgaWYgKChzdC0+ZGF0YV91cGRhdGVkID09IDApIHx8Ci0gICAgICAgICAgICAgICAgICAgIChzdC0+ZHR4R2xvYmFsU3RhdGUgPT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SBMX3RlbXApKQotICAgICAgICB7Ci0gICAgICAgICAgICAqcE92ZXJmbG93ID0gMTsKLSAgICAgICAgICAgIExfdGVtcCA9IChXb3JkMzIpKCh0bXBfaW50X2xlbmd0aCA+IDApID8gTUFYXzE2IDogTUlOXzE2KTsKLSAgICAgICAgfQotICAgICAgICB0ZW1wID0gKFdvcmQxNikgTF90ZW1wOwotCi0gICAgICAgIHN0LT50cnVlX3NpZF9wZXJpb2RfaW52ID0gZGl2X3MoMSA8PCAxMCwgdGVtcCk7Ci0KLSAgICAgICAgc3QtPnNpbmNlX2xhc3Rfc2lkID0gMDsKLSAgICAgICAgQ29weShzdC0+bHNwLCBzdC0+bHNwX29sZCwgTSk7Ci0gICAgICAgIHN0LT5vbGRfbG9nX2VuID0gc3QtPmxvZ19lbjsKLSAgICAgICAgLyogc3VidHJhY3QgMS84IGluIFExMSBpLmUgLTYvOCBkQiAqLwotICAgICAgICBzdC0+bG9nX2VuID0gc3ViKHN0LT5sb2dfZW4sIDI1NiwgcE92ZXJmbG93KTsKLSAgICB9Ci0KLSAgICAvKiByZXNldCBpbnRlcnBvbGF0aW9uIGxlbmd0aCB0aW1lcgotICAgICAqIGlmIGRhdGEgaGFzIGJlZW4gdXBkYXRlZC4gICAgICAgICovCi0gICAgaWYgKChzdC0+c2lkX2ZyYW1lICE9IDApICYmCi0gICAgICAgICAgICAoKHN0LT52YWxpZF9kYXRhICE9IDApIHx8Ci0gICAgICAgICAgICAgKChzdC0+dmFsaWRfZGF0YSA9PSAwKSAmJiAoc3QtPmR0eEhhbmdvdmVyQWRkZWQpICE9IDApKSkKLSAgICB7Ci0gICAgICAgIHN0LT5zaW5jZV9sYXN0X3NpZCA9ICAwOwotICAgICAgICBzdC0+ZGF0YV91cGRhdGVkID0gMTsKLSAgICB9Ci0KLSAgICByZXR1cm47Ci19Ci0KLQotLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq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ci0gICAgZWxzZQotICAgIHsKLSAgICAgICAgZW5jU3RhdGUgPSBTUEVFQ0g7Ci0gICAgfQotCi0KLSAgICBpZiAoZW5jU3RhdGUgPT0gU1BFRUNIKQotICAgIHsKLSAgICAgICAgc3QtPmR0eEhhbmdvdmVyQ291bnQgPSBEVFhfSEFOR19DT05TVDsKLSAgICB9Ci0gICAgZWxzZQotICAgIHsKLQotICAgICAgICBpZiAoc3QtPmRlY0FuYUVsYXBzZWRDb3VudCA+IERUWF9FTEFQU0VEX0ZSQU1FU19USFJFU0gpCi0gICAgICAgIHsKLSAgICAgICAgICAgIHN0LT5kdHhIYW5nb3ZlckFkZGVkID0gMTsKLSAgICAgICAgICAgIHN0LT5kZWNBbmFFbGFwc2VkQ291bnQgPSAwOwotICAgICAgICAgICAgc3QtPmR0eEhhbmdvdmVyQ291bnQgPSAwOwotICAgICAgICB9Ci0gICAgICAgIGVsc2UgaWYgKHN0LT5kdHhIYW5nb3ZlckNvdW50ID09IDApCi0gICAgICAgIHsKLSAgICAgICAgICAgIHN0LT5kZWNBbmFFbGFwc2VkQ291bnQgPSAwOwotICAgICAgICB9Ci0gICAgICAgIGVsc2UKLSAgICAgICAgewotICAgICAgICAgICAgc3QtPmR0eEhhbmdvdmVyQ291bnQgLT0gMTsKLSAgICAgICAgfQotICAgIH0KLQotICAgIGlmIChuZXdTdGF0ZSAhPSBTUEVFQ0gpCi0gICAgewotICAgICAgICAvKiBEVFggb3IgRFRYX01VVEUKLSAgICAgICAgICogQ04gZGF0YSBpcyBub3QgaW4gYSBmaXJzdCBTSUQsIGZpcnN0IFNJRHMgYXJlIG1hcmtlZCBhcyBTSURfQkFECi0gICAgICAgICAqICBidXQgd2lsbCBkbyBiYWNrd2FyZHMgYW5hbHlzaXMgaWYgYSBoYW5nb3ZlciBwZXJpb2QgaGFzIGJlZW4gYWRkZWQKLSAgICAgICAgICogIGFjY29yZGluZyB0byB0aGUgc3RhdGUgbWFjaGluZSBhYm92ZQotICAgICAgICAqL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1lbV9zeW5bXSwgICAgICAgICAgICAgICAgLyogaS9vIDogQU1SIGRlY29kZXIgc3RhdGUgICAgICAgICAgICAgICAqLwotICAgICAgICBEX3Bsc2ZTdGF0ZSogbHNmU3RhdGUsICAgICAgICAgICAvKiBpL28gOiBkZWNvZGVyIGxzZiBzdGF0ZXMgICAgICAgICAgICAgICovCi0gICAgICAgIGdjX3ByZWRTdGF0ZSogcHJlZFN0YXRlLCAgICAgICAgIC8qIGkvbyA6IHByZWRpY3Rpb24gc3RhdGVzICAgICAgICAgICAgICAgKi8KLSAgICAgICAgQ2JfZ2Fpbl9hdmVyYWdlU3RhdGUqIGF2ZXJTdGF0ZSwgLyogaS9vIDogQ0IgZ2FpbiBhdmVyYWdlIHN0YXRlcyAgICAgICAgICAqLwotICAgICAgICBlbnVtIERUWFN0YXRlVHlwZSBuZXdfc3RhdGUsICAgICAvKiBpICAgOiBuZXcgRFRYIHN0YXRlICAgICAgICAgICAgICAgICAgICovCi0gICAgICAgIGVudW0gTW9kZSBtb2RlLCAgICAgICAgICAgICAgICAgIC8qIGkgICA6IEFNUiBtb2RlICAgICAgICAgICAgICAgICAgICAgICAgKi8KLSAgICAgICAgV29yZDE2IHBhcm1bXSwgICAgICAgICAgICAgICAgICAgLyogaSAgIDogVmVjdG9yIG9mIHN5bnRoZXNpcyBwYXJhbWV0ZXJzICAqLwotICAgICAgICBXb3JkMTYgc3ludGhbXSwgICAgICAgICAgICAgICAgICAvKiBvICAgOiBzeW50aGVzaXNlZCBzcGVlY2ggICAgICAgICAgICAgICovCi0gICAgICAgIFdvcmQxNiBBX3RbXSwgICAgICAgICAgICAgICAgICAgIC8qIG8gICA6IGRlY29kZWQgTFAgZmlsdGVyIGluIDQgc3ViZnJhbWVzKi8KLSAgICAgICAgRmxhZyAgICpwT3ZlcmZsb3cKLSAgICApOwotCi0gICAgdm9pZCBkdHhfZGVjX2FjdGl2aXR5X3VwZGF0ZShkdHhfZGVjU3RhdGUgKnN0LAotICAgICAgICAgIC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i0gICAgV29yZDE2IHByZXZfYmYsICAgICAgICAgICAvKiBpICAgOiBmbGFnOiBwcmV2aW91cyBmcmFtZSB3YXMgYmFkICAgICAqLwotICAgIFdvcmQxNiAqZ2Fpbl9jb2RlLCAgICAgICAgLyogaS9vIDogZGVjb2RlZCBpbm5vdmF0aW9uIGdhaW4gICAgICAgICAgKi8KLSAgICBGbGFnICAgKnBPdmVyZmxvdwotKQotewotICAgIFdvcmQxNiBpOwotCi0gICAgLyogbGltaXQgZ2Fpbl9jb2RlIGJ5IHByZXZpb3VzIGdvb2QgZ2FpbiBpZiBwcmV2aW91cyBmcmFtZSB3YXMgYmFkICovCi0gICAgaWYgKGJmaSA9PSAwKQotICAgIHsKLSAgICAgICAgaWYgKHByZXZfYmYgIT0gMCkKLSAgICAgICAgewotICAgICAgICAgICAgaWYgKHN1YigqZ2Fpbl9jb2RlLCBzdC0+cHJldl9nYywgcE92ZXJmbG93KSA+IDApCi0gICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgKmdhaW5fY29kZSA9IHN0LT5wcmV2X2djOwotICAgICAgICAgICAgfQotICAgICAgICB9Ci0gICAgICAgIHN0LT5wcmV2X2djID0gKmdhaW5fY29kZTsKLSAgICB9Ci0KLSAgICAvKiB1cGRhdGUgRUMgc3RhdGVzOiBwcmV2aW91cyBnYWluLCBnYWluIGJ1ZmZlciAqLwotICAgIHN0LT5wYXN0X2dhaW5fY29kZSA9ICpnYWluX2NvZGU7Ci0KLSAgICBmb3IgKGkgPSAxOyBpIDwgNTsgaSsrKQotICAgIHsKLSAgICAgICAgc3QtPmdidWZbaSAtIDFdID0gc3QtPmdidWZbaV07Ci0gICAgfQotICAgIHN0LT5nYnVmWzRdID0gKmdhaW5fY29kZTsKLQotICAgIHJldHVybjsKLX0KLQotLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0KLS8qCi0tLS0tLS0tLS0tLS0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gICAvKiBpL28gOiBTdGF0ZSBzdHJ1Y3QgICAgICAgICAgICAgICAgICAgICAqLwotICAgICAgICBnY19wcmVkU3RhdGUgKnByZWRfc3RhdGUsIC8qIGkvbyA6IE1BIHByZWRpY3RvciBzdGF0ZSAgICAgICAgICAgICAgICovCi0gICAgICAgIFdvcmQxNiBzdGF0ZSwgICAgICAgICAgICAgLyogaSAgIDogc3RhdGUgb2YgdGhlIHN0YXRlIG1hY2hpbmUgICAgICAgKi8KLSAgICAgICAgV29yZDE2ICpnYWluX2NvZGUsICAgICAgICAvKiBvICAgOiBkZWNvZGVkIGlubm92YXRpb24gZ2FpbiAgICAgICAgICAqLwotICAgICAgICBGbGFnICAgKnBPdmVyZmxvdwotICAgICk7Ci0KLSAgICAvKgotICAgICAqICBGdW5jdGlvbiAgICA6IGVjX2dhaW5fY29kZV91cGRhdGUKLSAgICAgKiAgUHVycG9zZSAgICAgOiB1cGRhdGUgdGhlIGNvZGVib29rIGdhaW4gY29uY2VhbG1lbnQgc3RhdGU7Ci0gICAgICogICAgICAgICAgICAgICAgbGltaXQgZ2Fpbl9jb2RlIGlmIHRoZSBwcmV2aW91cyBmcmFtZSB3YXMgYmFkCi0gICAgICogICAgICAgICAgICAgICAgQ2FsbCB0aGlzIGZ1bmN0aW9uIGFsd2F5cyBhZnRlciBkZWNvZGluZyAob3IgY29uY2VhbGluZykKLSAgICAgKiAgICAgICAgICAgICAgICB0aGUgZ2FpbgotICAgICAqLwotICAgIHZvaWQgZWNfZ2Fpbl9jb2RlX3VwZGF0ZSgKLSAgICAgICAgZWNfZ2Fpbl9jb2RlU3RhdGUgKnN0LCAgICAvKiBpL28gOiBTdGF0ZSBzdHJ1Y3QgICAgICAgICAgICAgICAgICAgICAqLwotICAgICAgICBXb3JkMTYgYmZpLCAgICAgICAgICAgICAgIC8qIGkgICA6IGZsYWc6IGZyYW1lIGlzIGJhZCAgICAgICAgICAgICAgICovCi0gICAgICAgIFdvcmQxNiBwcmV2X2JmLCAgICA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mFyaWFibGVzICAgICAgICAgICAgICAgICAgICovCi0gICAgICAgIFdvcmQxNiBzdGF0ZSwgICAgICAgICAgIC8qIGkgICA6IHN0YXRlIG9mIHRoZSBzdGF0ZSBtYWNoaW5lICAgICAgICAqLwotICAgICAgICBXb3JkMTYgKmdhaW5fcGl0Y2gsICAgICAvKiBvICAgOiBwaXRjaCBnYWluIChRMTQpICAgICAgICAgICAgICAgICAgKi8KLSAgICAgICAgRmxhZyAgICpwT3ZlcmZsb3cKLSAgICApOwotCi0gICAgLyoKLSAgICAgKiAgRnVuY3Rpb24gICAgOiBlY19nYWluX3BpdGNoX3VwZGF0ZQotICAgICAqICBQdXJwb3NlICAgICA6IHVwZGF0ZSB0aGUgcGl0Y2ggZ2FpbiBjb25jZWFsbWVudCBzdGF0ZTsKLSAgICAgKiAgICAgICAgICAgICAgICBsaW1pdCBnYWluX3BpdGNoIGlmIHRoZSBwcmV2aW91cyBmcmFtZSB3YXMgYmFkCi0gICAgICogICAgICAgICAgICAgICAgQ2FsbCB0aGlzIGZ1bmN0aW9uIGFsd2F5cyBhZnRlciBkZWNvZGluZyAob3IgY29uY2VhbGluZykKLSAgICAgKiAgICAgICAgICAgICAgICB0aGUgZ2FpbgotICAgICAqLwotICAgIHZvaWQgZWNfZ2Fpbl9waXRjaF91cGRhdGUoCi0gICAgICAgIGVjX2dhaW5fcGl0Y2hTdGF0ZSAqc3QsIC8qIGkvbyA6IHN0YXRlIHZhcmlhYmxlcyAgICAgICAgICAgICAgICAgICAqLwotICAgICAgICBXb3JkMTYgYmZpLCAgICAgICAgICAgICAvKiBpICAgOiBmbGFnOiBmcmFtZSBpcyBiYWQgICAgICAgICAgICAgICAgKi8KLSAgICAgICAgV29yZDE2IHByZXZfYmYsICAgICAgICAgLyogaSAgIDogZmxhZzogcHJldmlvdXMgZnJhbWUgd2FzIGJhZCAgICAgICovCi0gICAgICAgIFdvcmQxNiAqZ2Fpbl9waXRjaCwgICAgIC8qIGkvbyA6IHBpdGNoIG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WYgKHggPj0gbnVtT2ZCaXRzW2ZyYW1lX3R5cGVfM2dwcF0pCi0gICAgICAgICAgICAgICAgewotICAgICAgICAgICAgICAgICAgICBicmVhazsKLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgZXRzX291dHB1dF9wdHJbcmVvcmRlckJpdHNbZnJhbWVfdHlwZV8zZ3BwXVt4KytdXSA9Ci0gICAgICAgICAgICAgICAgICAgIChpZjJfaW5wdXRfcHRyW2ldID4+IGopICYgMHgwMTsKLSAgICAgICAgICAgIH0KLSAgICAgICAgfQotICAgIH0KLSAgICBlbHNlCi0gICAgewotICAgICAgICBmb3IgKGogPSA0OyBqIDwgODsgaisrKQotICAgICAgICB7Ci0gICAgICAgICAgICBldHNfb3V0cHV0X3B0clt4KytdID0KLSAgICAgICAgICAgICAgICAoaWYyX2lucHV0X3B0clswXSA+PiBqKSAmIDB4MDE7Ci0gICAgICAgIH0KLSAgICAgICAgZm9yIChpID0gMTsgaSA8IG51bUNvbXByZXNzZWRCeXRlc1tmcmFtZV90eXBlXzNncHBdOyBpKyspCi0gICAgICAgIHsKLSAgICAgICAgICAgIGZvciAoaiA9IDA7IGogPCA4OyBqKyspCi0gICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgZXRzX291dHB1dF9wdHJbeCsrXSA9Ci0gICAgICAgICAgICAgICAgICAgIChpZjJfaW5wdXRfcHRyW2ldID4+IGopICYgMHgwMTsKLSAgICAgICAgICAgIH0KLSAgICAgICAgfQotICAgIH0KLQotICAgIHJldHVybjsKLX0KZGlmZiAtLWdpdCBhL21lZGlhL2xpYnN0YWdlZnJpZ2h0L2NvZGVjcy9hbXJuYi9kZWMvc3JjL2lmMl90b19ldHMuaCBiL21lZGlhL2xpYnN0YWdlZnJpZ2h0L2NvZGVjcy9hbXJuYi9kZWMvc3JjL2lmMl90b19ldHMuaApkZWxldGVkIGZpbGUgbW9kZSAxMDA2NDQKaW5kZXggNDkwNTY1ZC4uMDAwMDAwMAotLS0g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wotICAgIHJlZ2lzdGVyIFdvcmQxNiB0ZW1wMTsKLSAgICByZWdpc3RlciBXb3JkMTYgdGVtcDI7Ci0KLSAgICBpZiAoaV9zdWJmciA9PSAwKQotICAgIHsKLSAgICAgICAgZm9yIChpID0gTSAtIDE7IGkgPj0gMDsgaS0tKQotICAgICAgICB7Ci0gICAgICAgICAgICBpZiAoKihsc2Zfb2xkICsgaSkgPCAwKQotICAgICAgICAgICAgewotICAgICAgICAgICAgICAgIHRlbXAxID0gfih+KCoobHNmX29sZCArIGkpKSA+PiAyKTsKLSAgICAgICAgICAgIH0KLSAgICAgICAgICAgIGVsc2UKLSAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICB0ZW1wMSA9ICoobHNmX29sZCArIGkpID4+IDI7Ci0gICAgICAgICAgICB9Ci0gICAgICAgICAgICBpZiAoKihsc2ZfbmV3ICsgaSkgPCAwKQotICAgICAgICAgICAgewotICAgICAgICAgICAgICAgIHRlbXAyID0gfih+KCoobHNmX25ldyArIGkpKSA+PiAyKTsKLSAgICAgICAgICAgIH0KLSAgICAgICAgICAgIGVsc2UKLSAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICB0ZW1wMiA9ICoobHNmX25ldyArIGkpID4+IDI7Ci0gICAgICAgICAgICB9Ci0gICAgICAgICAgICAqKGxzZl9vdXQgKyBpKSA9IGFkZCgoV29yZDE2KSgqKGxzZl9vbGQgKyBpKSAtIHRlbXAxKSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChXb3JkMTYpdGVtcDIsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwT3ZlcmZsb3cpOwotICAgICAgICB9Ci0gICAgfQotCi0gICAgZWxzZSBpZiAoaV9zdWJmciA9PSA0MCkKLSAgICB7Ci0gICAgICAgIGZvciAoaSA9IE0gLSAxOyBpID49IDA7IGktLSkKLSAgICAgICAgewotICAgICAgICAgICAgaWYgKCoobHNmX29sZCArIGkpIDwgMCkKLSAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICB0ZW1wMSA9IH4ofigqKGxzZl9vbGQgKyBpKSkgPj4gMSk7Ci0gICAgICAgICAgICB9Ci0gICAgICAgICAgICBlbHNlCi0gICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgdGVtcDEgPSAqKGxzZl9vbGQgKyBpKSA+PiAxOwotICAgICAgICAgICAgfQotICAgICAgICAgICAgaWYgKCoobHNmX25ldyArIGkpIDwgMCkKLSAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICB0ZW1wMiA9IH4ofigqKGxzZl9uZXcgKyBpKSkgPj4gMSk7Ci0gICAgICAgICAgICB9Ci0gICAgICAgICAgICBlbHNlCi0gICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgdGVtcDIgPSAqKGxzZl9uZXcgKyBpKSA+PiAxOwotICAgICAgICAgICAgfQotICAgICAgICAgICAgKihsc2Zfb3V0ICsgaSkgPSBhZGQoCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0ZW1wMSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRlbXAyLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcE92ZXJmbG93KTsKLSAgICAgICAgfQotICAgIH0KLQotICAgIGVsc2UgaWYgKGlfc3ViZnIgPT0gODApCi0gICAgewotICAgICAgICBmb3IgKGkgPSBNIC0gMTsgaSA+PSAwOyBpLS0pCi0gICAgICAgIHsKLSAgICAgICAgICAgIGlmICgqKGxzZl9vbGQgKyBpKSA8IDApCi0gICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgdGVtcDEgPSB+KH4oKihsc2Zfb2xkICsgaSkpID4+IDIpOwotICAgICAgICAgICAgfQotICAgICAgICAgICAgZWxzZQotICAgICAgICAgICAgewotICAgICAgICAgICAgICAgIHRlbXAxID0gKihsc2Zfb2xkICsgaSkgPj4gMjsKLSAgICAgICAgICAgIH0KLSAgICAgICAgICAgIGlmICgqKGxzZl9uZXcgKyBpKSA8IDApCi0gICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgdGVtcDIgPSB+KH4oKihsc2ZfbmV3ICsgaSkpID4+IDIpOwotICAgICAgICAgICAgfQotICAgICAgICAgICAgZWxzZQotICAgICAgICAgICAgewotICAgICAgICAgICAgICAgIHRlbXAyID0gKihsc2ZfbmV3ICsgaSkgPj4gMjsKLSAgICAgICAgICAgIH0KLSAgICAgICAgICAgICoobHNmX291dCArIGkpID0gYWRkKChXb3JkMTYpdGVtcDEsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoV29yZDE2KSgqKGxzZl9uZXcgKyBpKSAtIHRlbXAyKSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBPdmVyZmxvdyk7Ci0KLSAgICAgICAgfQotICAgIH0KLQotICAgIGVsc2UgaWYgKGlfc3ViZnIgPT0gMTIwKQotICAgIHsKLSAgICAgICAgZm9yIChpID0gTSAtIDE7IGkgPj0gMDsgaS0tKQotICAgICAgICB7Ci0gICAgICAgICAgICAqKGxzZl9vdXQgKyBpKSA9ICoobHNmX25ldyArIGkpOwotICAgICAgICB9Ci0gICAgfQotCi0gICAgcmV0dXJuOwotfQotCmRpZmYgLS1naXQgYS9tZWRpYS9saWJzdGFnZWZyaWdodC9jb2RlY3MvYW1ybmIvZGVjL3NyYy9sc3BfYXZnLmNwcCBiL21lZGlhL2xpYnN0YWdlZnJpZ2h0L2NvZGVjcy9hbXJuYi9kZWMvc3JjL2xzcF9hdmcuY3BwCmRlbGV0ZWQgZmlsZSBtb2RlIDEwMDY0NAppbmRleCA5YjY1YzdhLi4wMDAwMDAwCi0tLSBhL21lZGlhL2xpYnN0YWdlZnJpZ2h0L2NvZGVjcy9hbXJuYi9kZWMvc3JjL2xzcF9hdmcuY3BwCisrKyAvZGV2L251bGwKQEAgLTEsMzE3ICswLDAgQEAKLS8qIC0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t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0gICAvLyBkb24ndCBtb2RpZnkgdGhlIGlubm92YXRpb24gaWYgaW1wTnIgPj0yICg9IG5vIHBoYXNlIGRpc3ApCi0gICBpZiAoc3ViKG1vZGUsIE1SMTIyKSAhPSAwICYmCi0gICAgICAgc3ViKG1vZGUsIE1SMTAyKSAhPSAwICYmCi0gICAgICAgc3ViKG1vZGUsIE1SNzQpICE9IDAgJiYKLSAgICAgICBzdWIoaW1wTnIsIDIpIDwgMCkKLSAgIHsKLSAgICAgICAvLyB0cmFjayBwdWxzZSBwb3NpdGlvbnMsIHNhdmUgaW5ub3ZhdGlvbiwKLSAgICAgICAgICBhbmQgaW5pdGlhbGl6ZSBuZXcgaW5ub3ZhdGlvbgotICAgICAgIG56ZSA9IDA7Ci0gICAgICAgZm9yIChpID0gMDsgaSA8IExfU1VCRlI7IGkrKykKLSAgICAgICB7Ci0gICAgICAgICAgIGlmIChpbm5vW2ldICE9IDApCi0gICAgICAgICAgIHsKLSAgICAgICAgICAgICAgIHBzX3Bvc3NbbnplXSA9IGk7Ci0gICAgICAgICAgICAgICBuemUgPSBhZGQgKG56ZSwgMSk7Ci0gICAgICAgICAgIH0KLSAgICAgICAgICAgaW5ub19zYXZbaV0gPSBpbm5vW2ldOwotICAgICAgICAgICBpbm5vW2ldID0gMDsKLSAgICAgICB9Ci0gICAgICAgLy8gQ2hvb3NlIGZpbHRlciBjb3JyZXNwb25kaW5nIHRvIGNvZGVjIG1vZGUgYW5kIGRpc3BlcnNpb24gY3JpdGVyaXVtCi0gICAgICAgaWYgKHN1YiAobW9kZSwgTVI3OTUpID09IDApCi0gICAgICAgewotICAgICAgICAgICBpZiAoaW1wTnIgPT0gMCkKLSAgICAgICAgICAgewotICAgICAgICAgICAgICAgcGhfaW1wID0gcGhfaW1wX2xvd19NUjc5NTsKLSAgICAgICAgICAgfQotICAgICAgICAgICBlbHNlCi0gICAgICAgICAgIHsKLSAgICAgICAgICAgICAgIHBoX2ltcCA9IHBoX2ltcF9taWRfTVI3OTU7Ci0gICAgICAgICAgIH0KLSAgICAgICB9Ci0gICAgICAgZWxzZQotICAgICAgIHsKLSAgICAgICAgICAgaWYgKGltcE5yID09IDApCi0gICAgICAgICAgIHsKLSAgICAgICAgICAgICAgIHBoX2ltcCA9IHBoX2ltcF9sb3c7Ci0gICAgICAgICAgIH0KLSAgICAgICAgICAgZWxzZQotICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICBwaF9pbXAgPSBwaF9pbXBfbWlkOwotICAgICAgICAgICB9Ci0gICAgICAgfQotCi0gICAgICAgLy8gRG8gcGhhc2UgZGlzcGVyc2lvbiBvZiBpbm5vdmF0aW9uCi0gICAgICAgZm9yIChuUHVsc2UgPSAwOyBuUHVsc2UgPCBuemU7IG5QdWxzZSsrKQotICAgICAgIHsKLSAgICAgICAgICAgcHBvcyA9IHBzX3Bvc3NbblB1bHNlXTsKLQotICAgICAgICAgICAvLyBjaXJjdWxhciBjb252b2x1dGlvbiB3aXRoIGltcHVsc2UgcmVzcG9uc2UKLSAgICAgICAgICAgaiA9IDA7Ci0gICAgICAgICAgIGZvciAoaSA9IHBwb3M7IGkgPCBMX1NVQkZSOyBpKyspCi0gICAgICAgICAgIHsKLSAgICAgICAgICAgICAgIC8vIGlubm9baTFdICs9IGlubm9fc2F2W3Bwb3NdICogcGhfaW1wW2kxLXBwb3NdCi0gICAgICAgICAgICAgICB0bXAxID0gbXVsdChpbm5vX3NhdltwcG9zXSwgcGhfaW1wW2orK10pOwotICAgICAgICAgICAgICAgaW5ub1tpXSA9IGFkZChpbm5vW2ldLCB0bXAxKTsKLSAgICAgICAgICAgfQotCi0gICAgICAgICAgIGZvciAoaSA9IDA7IGkgPCBwcG9zOyBpKyspCi0gICAgICAgICAgIHsKLSAgICAgICAgICAgICAgIC8vIGlubm9baV0gKz0gaW5ub19zYXZbcHBvc10gKiBwaF9pbXBbTF9TVUJGUi1wcG9zK2ldCi0gICAgICAgICAgICAgICB0bXAxID0gbXVsdChpbm5vX3NhdltwcG9zXSwgcGhfaW1wW2orK10pOwotICAgICAgICAgICAgICAgaW5ub1tpXSA9IGFkZChpbm5vW2ldLCB0bXAxKTsKLSAgICAgICAgICAgfQotICAgICAgIH0KLSAgIH0KLQotICAgLy8gY29tcHV0ZSB0b3RhbCBleGNpdGF0aW9uIGZvciBzeW50aGVzaXMgcGFydCBvZiBkZWNvZGVyCi0gICAvLyAodXNpbmcgbW9kaWZpZWQgaW5ub3ZhdGlvbiBpZiBwaGFzZSBkaXNwZXJzaW9uIGlzIGFjdGl2ZSkKLSAgIGZvciAoaSA9IDA7IGkgPCBMX1NVQkZSOyBpKyspCi0gICB7Ci0gICAgICAgLy8geFtpXSA9IGdhaW5fcGl0KnhbaV0gKyBjYkdhaW4qY29kZVtpXTsKLSAgICAgICBMX3RlbXAgPSBMX211bHQgKCAgICAgICAgeFtpXSwgICAgcGl0Y2hfZmFjKTsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vIDEyLjI6IFEwICogUTEzCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyAgNy40OiBRMCAqIFExNAotICAgICAgIExfdGVtcCA9IExfbWFjICAoTF90ZW1wLCBpbm5vW2ldLCBjYkdhaW4pOwotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gMTIuMjogUTEyICogUTEKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vICA3LjQ6IFExMyAqIFExCi0gICAgICAgTF90ZW1wID0gTF9zaGwgKExfdGVtcCwgdG1wX3NoaWZ0KTsgICAgICAgICAgICAgICAgIC8vIFExNgotICAgICAgIHhbaV0gPSBwdl9yb3VuZCAoTF90ZW1wKTsKLSAgIH0KLQotICAgcmV0dXJuOwotfQotCi0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS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RhdGUgKnN0YXRlLCAgICAvKiBpL28gICAgIDogU3RhdGUgc3RydWN0ICAgICAgICAgICAgICAgICAgICAgICAqLwotICAgIGVudW0gTW9kZSBtb2RlLCAgICAgICAgIC8qIGkgICAgICAgOiBjb2RlYyBtb2RlICAgICAgICAgICAgICAgICAgICAgICAgICovCi0gICAgV29yZDE2IHhbXSwgICAgICAgICAgICAgLyogaS9vIFEwICA6IGluOiAgTFRQIGV4Y2l0YXRpb24gc2lnbmFsICAgICAgICAgKi8KLSAgICAvKiAgICAgICAgICAgb3V0OiB0b3RhbCBleGNpdGF0aW9uIHNpZ25hbCAgICAgICAqLwotICAgIFdvcmQxNiBjYkdhaW4sICAgICAgICAgIC8qIGkgICBRMSAgOiBDb2RlYm9vayBnYWluICAgICAgICAgICAgICAgICAgICAgICovCi0gICAgV29yZDE2IGx0cEdhaW4sICAgICAgICAgLyogaSAgIFExNCA6IExUUCBnYWluICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLSAgICBXb3JkMTYgaW5ub1tdLCAgICAgICAgICAvKiBpL28gUTEzIDogSW5ub3ZhdGlvbiB2ZWN0b3IgKFExMiBmb3IgMTIuMikgICAqLwotICAgIFdvcmQxNiBwaXRjaF9mYWMsICAgICAgIC8qIGkgICBRMTQgOiBwaXRjaCBmYWN0b3IgdXNlZCB0byBzY2FsZSB0aGUKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTFRQIGV4Y2l0YXRpb24gKFExMyBmb3IgMTIuMikgICAgICAqLwotICAgIFdvcmQxNiB0bXBfc2hpZnQsICAgICAgIC8qIGkgICBRMCAgOiBzaGlmdCBmYWN0b3IgYXBwbGllZCB0byBzdW0gb2YKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2NhbGVkIExUUCBleCAmIGlubm92LiBiZWZvcmUKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcm91bmRpbmcgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotICAgIEZsYWcgICAqcE92ZXJmbG93ICAgICAgIC8qIGkvbyAgICAgOiBvdmVmbG93IGluZGljYXRvciAgICAgICAgICAgICAgICAgICovCi0pCi17Ci0gICAgcmVnaXN0ZXIgV29yZDE2IGksIGkxOwotICAgIHJlZ2lzdGVyIFdvcmQxNiB0bXAxOwotICAgIFdvcmQzMiBMX3RlbXA7Ci0gICAgV29yZDMyIExfdGVtcDI7Ci0gICAgV29yZDE2IGltcE5yOyAgICAgICAgICAgLyogaW5kaWNhdG9yIGZvciBhbW91bnQgb2YgZGlzcC4vZmlsdGVyIHVzZWQgKi8KLQotICAgIFdvcmQxNiBpbm5vX3NhdltMX1NVQkZSXTsKLSAgICBXb3JkMTYgcHNfcG9zc1tMX1NVQkZSXTsKLSAgICByZWdpc3RlciBXb3JkMTYgbnplLCBuUHVsc2U7Ci0gICAgV29yZDE2IHBwb3M7Ci0gICAgY29uc3QgV29yZDE2ICpwaF9pbXA7ICAgLyogUG9pbnRlciB0byBwaGFzZSBkaXNwZXJzaW9uIGZpbHRlciAqLwotCi0gICAgV29yZDE2ICpwX2lubm87Ci0gICAgV29yZDE2ICpwX2lubm9fc2F2OwotICAgIFdvcmQxNiAqcF94OwotICAgIGNvbnN0IFdvcmQxNiAqcF9waF9pbXA7Ci0gICAgV29yZDE2IGNfaW5ub19zYXY7Ci0KLSAgICAvKiBVcGRhdGUgTFRQIGdhaW4gbWVtb3J5ICovCi0gICAgLyogVW5yb2xsZWQgRk9SIGxvb3AgYmVsb3cgc2luY2UgUEhER0FJTk1FTVNJWkUgaXMgYXNzdW1lZCB0byBzdGF5ICovCi0gICAgLyogdGhlIHNhbWUuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0gICAgLyogZm9yIChpID0gUEhER0FJTk1FTVNJWkUtMTsgaSA+IDA7IGktLSkgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0gICAgLyogeyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0gICAgLyogICAgc3RhdGUtPmdhaW5NZW1baV0gPSBzdGF0ZS0+Z2Fpbk1lbVtpLTFdOyAgICAgICAgICAgICAgICAgICAgICovCi0gICAgLyogfSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0gICAgc3RhdGUtPmdhaW5NZW1bNF0gPSBzdGF0ZS0+Z2Fpbk1lbVszXTsKLSAgICBzdGF0ZS0+Z2Fpbk1lbVszXSA9IHN0YXRlLT5nYWluTWVtWzJdOwotICAgIHN0YXRlLT5nYWluTWVtWzJdID0gc3RhdGUtPmdhaW5NZW1bMV07Ci0gICAgc3RhdGUtPmdhaW5NZW1bMV0gPSBzdGF0ZS0+Z2Fpbk1lbVswXTsKLSAgICBzdGF0ZS0+Z2Fpbk1lbVswXSA9IGx0cEdhaW47Ci0KLSAgICAvKiBiYXNpYyBhZGFwdGlvbiBvZiBwaGFzZSBkaXNwZXJzaW9uICovCi0KLSAgICBpZiAobHRwR2FpbiA8IFBIRFRIUjJMVFApICAgIC8qIGlmIChsdHBHYWluIDwgMC45KSAqLwotICAgIHsKLSAgICAgICAgaWYgKGx0cEdhaW4gPiBQSERUSFIxTFRQKQotICAgICAgICB7ICAvKiBpZiAobHRwR2FpbiA+IDAuNiAqLwotICAgICAgICAgICAgaW1wTnIgPSAxOyAvKiBtZWRpdW0gZGlzcGVyc2lvbiAqLwotICAgICAgICB9Ci0gICAgICAgIGVsc2UKLSAgICAgICAgewotICAgICAgICAgICAgaW1wTnIgPSAwOyAvKiBtYXhpbXVtIGRpc3BlcnNpb24gKi8KLSAgICAgICAgfQotICAgIH0KLSAgICBlbHNlCi0gICAgewotICAgICAgICBpbXBOciA9IDI7IC8qIG5vIGRpc3BlcnNpb24gKi8KLSAgICB9Ci0KLSAgICAvKiBvbnNldCBpbmRpY2F0b3IgK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0gMCkKLSAgICB7Ci0gICAgICAgIC8qIENoZWNrIExUUCBnYWluIG1lbW9yeSBhbmQgc2V0IGZpbHRlciBhY2NvcmRpbmdseSAqLwotICAgICAgICBpMSA9IDA7Ci0gICAgICAgIGZvciAoaSA9IDA7IGkgPCBQSERHQUlOTUVNU0laRTsgaSsrKQotICAgICAgICB7Ci0gICAgICAgICAgICBpZiAoc3RhdGUtPmdhaW5NZW1baV0gPCBQSERUSFIxTFRQKQotICAgICAgICAgICAgewotICAgICAgICAgICAgICAgIGkxICs9IDE7Ci0gICAgICAgICAgICB9Ci0gICAgICAgIH0KLQotICAgICAgICBpZiAoaTEgPiAyKQotICAgICAgICB7Ci0gICAgICAgICAgICBpbXBOciA9IDA7Ci0gICAgICAgIH0KLSAgICB9Ci0gICAgLyogUmVzdHJpY3QgZGVjcmVhc2UgaW4gcGhhc2UgZGlzcGVyc2lvbiB0byBvbmUgc3RlcCBpZiBub3Qgb25zZXQgKi8KLSAgICBpZiAoKGltcE5yID4gKChzdGF0ZS0+cHJldlN0YXRlKSArIDEpKSAmJiAoc3RhdGUtPm9uc2V0ID09IDApKQotICAgIHsKLSAgICAgICAgaW1wTnIgLT0gMTsKLSAgICB9Ci0KLSAgICAvKiBpZiBvbnNldCwgdXNlIG9uZSBzdGVwIGxlc3MgcGhhc2UgZGlzcGVyc2lvbiAqLwotICAgIGlmICgoaW1wTnIgPCAyKSAmJiAoc3RhdGUtPm9uc2V0ID4gMCkpCi0gICAgewotICAgICAgICBpbXBOciArPSAxOwotICAgIH0KLQotICAgIC8qIGRpc2FibGUgZm9yIHZlcnkgbG93IGxldmVscyAqLwotICAgIGlmIChjYkdhaW4gPCAxMCkKLSAgICB7Ci0gICAgICAgIGltcE5yID0gMjsKLSAgICB9Ci0KLSAgICBpZiAoc3RhdGUtPmxvY2tGdWxsID09IDEpCi0gICAgewotICAgICAgICBpbXBOciA9IDA7Ci0gICAgfQotCi0gICAgLyogdXBkYXRlIHN0YXRpYyBtZW1vcnkgKi8KLSAgICBzdGF0ZS0+cHJldlN0YXRlID0gaW1wTnI7Ci0gICAgc3RhdGUtPnByZXZDYkdhaW4gPSBjYkdhaW47Ci0KLSAgICAvKiBkbyBwaGFzZSBkaXNwZXJzaW9uIGZvciBhbGwgbW9kZXMgYnV0IDEyLjIgYW5kIDcuNDsKLSAgICAgICBkb24ndCBtb2RpZnkgdGhlIGlubm92YXRpb24gaWYgaW1wTnIgPj0yICg9IG5vIHBoYXNlIGRpc3ApICovCi0gICAgaWYgKChtb2RlICE9IE1SMTIyKSAmJiAobW9kZSAhPSBNUjEwMikgJiYgKG1vZGUgIT0gTVI3NCkgJiYgKGltcE5yIDwgMikpCi0gICAgewotICAgICAgICAvKiB0cmFjayBwdWxzZSBwb3NpdGlvbnMsIHNhdmUgaW5ub3ZhdGlvbiwKLSAgICAgICAgICAgYW5kIGluaXRpYWxpemUgbmV3IGlubm92YXRpb24gICAgICAgICAgKi8KLSAgICAgICAgbnplID0gMDsKLSAgICAgICAgcF9pbm5vID0gJmlubm9bMF07Ci0gICAgICAgIHBfaW5ub19zYXYgPSAmaW5ub19zYXZbMF07Ci0KLSAgICAgICAgZm9yIChpID0gMDsgaSA8IExfU1VCRlI7IGkrKykKLSAgICAgICAgewotICAgICAgICAgICAgaWYgKCoocF9pbm5vKSAhPSAwKQotICAgICAgICAgICAgewotICAgICAgICAgICAgICAgIHBzX3Bvc3NbbnplXSA9IGk7Ci0gICAgICAgICAgICAgICAgbnplICs9IDE7Ci0gICAgICAgICAgICB9Ci0gICAgICAgICAgICAqKHBfaW5ub19zYXYrKykgPSAqKHBfaW5ubyk7Ci0gICAgICAgICAgICAqKHBfaW5ubysrKSA9IDA7Ci0gICAgICAgIH0KLQotICAgICAgICAvKiBDaG9vc2UgZmlsdGVyIGNvcnJlc3BvbmRpbmcgdG8gY29kZWMgbW9kZSBhbmQgZGlzcGVyc2lvbiBjcml0ZXJpdW0gKi8KLSAgICAgICAgaWYgKG1vZGUgPT0gTVI3OTUpCi0gICAgICAgIHsKLSAgICAgICAgICAgIGlmIChpbXBOciA9PSAwKQotICAgICAgICAgICAgewotICAgICAgICAgICAgICAgIHBoX2ltcCA9IHBoX2ltcF9sb3dfTVI3OTU7Ci0gICAgICAgICAgICB9Ci0gICAgICAgICAgICBlbHNlCi0gICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgcGhfaW1wID0gcGhfaW1wX21pZF9NUjc5NTsKLSAgICAgICAgICAgIH0KLSAgICAgICAgfQotICAgICAgICBlbHNlCi0gICAgICAgIHsKLSAgICAgICAgICAgIGlmIChpbXBOciA9PSAwKQotICAgICAgICAgICAgewotICAgICAgICAgICAgICAgIHBoX2ltcCA9IHBoX2ltcF9sb3c7Ci0gICAgICAgICAgICB9Ci0gICAgICAgICAgICBlbHNlCi0gICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgcGhfaW1wID0gcGhfaW1wX21pZDsKLSAgICAgICAgICAgIH0KLSAgICAgICAgfQotCi0gICAgICAgIC8qIERvIHBoYXNlIGRpc3BlcnNpb24gb2YgaW5ub3ZhdGlvbiAqLwotICAgICAgICBmb3IgKG5QdWxzZSA9IDA7IG5QdWxzZSA8IG56ZTsgblB1bHNlKyspCi0gICAgICAgIHsKLSAgICAgICAgICAgIHBwb3MgPSBwc19wb3NzW25QdWxzZV07Ci0KLSAgICAgICAgICAgIC8qIGNpcmN1bGFyIGNvbnZvbHV0aW9uIHdpdGggaW1wdWxzZSByZXNwb25zZSAqLwotICAgICAgICAgICAgY19pbm5vX3NhdiA9IGlubm9fc2F2W3Bwb3NdOwotICAgICAgICAgICAgcF9pbm5vID0gJmlubm9bcHBvc107Ci0gICAgICAgICAgICBwX3BoX2ltcCA9IHBoX2ltcDsKLQotICAgICAgICAgICAgZm9yIChpID0gcHBvczsgaSA8IExfU1VCRlI7IGkrKykKLSAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAvKiBpbm5vW2kxXSArPSBpbm5vX3NhdltwcG9zXSAqIHBoX2ltcFtpMS1wcG9zXSAqLwotICAgICAgICAgICAgICAgIExfdGVtcCA9ICgoV29yZDMyKSBjX2lubm9fc2F2ICogKihwX3BoX2ltcCsrKSkgPj4gMTU7Ci0gICAgICAgICAgICAgICAgdG1wMSA9IChXb3JkMTYpIExfdGVtcDsKLSAgICAgICAgICAgICAgICAqKHBfaW5ubykgPSBhZGQoKihwX2lubm8pLCB0bXAxLCBwT3ZlcmZsb3cpOwotICAgICAgICAgICAgICAgIHBfaW5ubyArPSAxOwotICAgICAgICAgICAgfQotCi0gICAgICAgICAgICBwX2lubm8gPSAmaW5ub1swXTsKLQotICAgICAgICAgICAgZm9yIChpID0gMDsgaSA8IHBwb3M7IGkrKykKLSAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAvKiBpbm5vW2ldICs9IGlubm9fc2F2W3Bwb3NdICogcGhfaW1wW0xfU1VCRlItcHBvcytpXSAqLwotICAgICAgICAgICAgICAgIExfdGVtcCA9ICgoV29yZDMyKSBjX2lubm9fc2F2ICogKihwX3BoX2ltcCsrKSkgPj4gMTU7Ci0gICAgICAgICAgICAgICAgdG1wMSA9IChXb3JkMTYpIExfdGVtcDsKLSAgICAgICAgICAgICAgICAqKHBfaW5ubykgPSBhZGQoKihwX2lubm8pLCB0bXAxLCBwT3ZlcmZsb3cpOwotICAgICAgICAgICAgICAgIHBfaW5ubyArPSAxOwotICAgICAgICAgICAgfQotICAgICAgICB9Ci0gICAgfQotCi0gICAgLyogY29tcHV0ZSB0b3RhbCBleGNpdGF0aW9uIGZvciBzeW50aGVzaXMgcGFydCBvZiBkZWNvZGVyCi0gICAgICAgKHVzaW5nIG1vZGlmaWVkIGlubm92YXRpb24gaWYgcGhhc2UgZGlzcGVyc2lvbiBpcyBhY3RpdmUpICovCi0gICAgcF9pbm5vID0gJmlubm9bMF07Ci0gICAgcF94ID0gJnhbMF07Ci0KLSAgICBmb3IgKGkgPSAwOyBpIDwgTF9TVUJGUjsgaSsrKQotICAgIHsKLSAgICAgICAgLyoge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tLS0tLS0tLS0tLS0qLwotCi0gICAgdm9pZCBwaF9kaXNwKAotICAgICAgICBwaF9kaXNwU3RhdGUgKnN0YXRlLCAgICAvKiBpL28gICAgIDogU3RhdGUgc3RydWN0ICAgICAgICAgICAgICAgICAgICAgICAqLwotICAgICAgICBlbnVtIE1vZGUgbW9kZSwgICAgICAgICAvKiBpICAgICAgIDogY29kZWMgbW9kZSAgICAgICAgICAgICAgICAgICAgICAgICAqLwotICAgICAgICBXb3JkMTYgeFtdLCAgICAgICAgICAgICAvKiBpL28gUTAgIDogaW46ICBMVFAgZXhjaXRhdGlvbiBzaWduYWwgICAgICAgICAqLwotICAgICAgICAvKiAgICAgICAgICAgb3V0OiB0b3RhbCBleGNpdGF0aW9uIHNpZ25hbCAgICAgICAqLwotICAgICAgICBXb3JkMTYgY2JHYWluLCAgICAgICAgICAvKiBpICAgUTEgIDogQ29kZWJvb2sgZ2FpbiAgICAgICAgICAgICAgICAgICAgICAqLwotICAgICAgICBXb3JkMTYgbHRwR2FpbiwgICAgICAgICAvKiBpICAgUTE0IDogTFRQIGdhaW4gICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotICAgICAgICBXb3JkMTYgaW5ub1tdLCAgICAgICAgICAvKiBpL28gUTEzIDogSW5ub3ZhdGlvbiB2ZWN0b3IgKFExMiBmb3IgMTIuMikgICAqLwotICAgICAgICBXb3JkMTYgcGl0Y2hfZmFjLCAgICAgICAvKiBpICAgUTE0IDogcGl0Y2ggZmFjdG9yIHVzZWQgdG8gc2NhbGUgdGhlCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIExUUCBleGNpdGF0aW9uIChRMTMgZm9yIDEyLjIpICAgICAgKi8KLSAgICAgICAgV29yZDE2IHRtcF9zaGlmdCwgICAgICAgLyogaSAgIFEwICA6IHNoaWZ0IGZhY3RvciBhcHBsaWVkIHRvIHN1bSBvZgotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzY2FsZWQ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S0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tKi8KLQotICAgIFdvcmQxNiBwcmVlbXBoYXNpc19yZXNldChwcmVlbXBoYXNpc1N0YXRlICpzdCk7Ci0gICAgLyogcmVzZXQgb2YgcHJlZW1waGFzaXMgZmlsdGVyIChpLmUuIHNldCBzdGF0ZSBtZW1vcnkgdG8gemVybykKLSAgICAgICByZXR1cm5zIDAgb24gc3VjY2VzcwotICAgICAqLwotICAgIHZvaWQgcHJlZW1waGFzaXNfZXhpdChwcmVlbXBoYXNpc1N0YXRlICoqc3QpOwotICAgIC8qIGRlLWluaXRpYWxpemUgcHJlZW1waGFzaXMgZmlsdGVyIChpLmUuIGZyZWUgc3RhdHVzIHN0cnVjdCkKLSAgICAgICBzdG9yZXMgTlVMTCBpbiAqc3QKLSAgICAgKi8KLQotICAgIHZvaWQgcHJlZW1waGFzaXMoCi0gICAgICAgIHByZWVtcGhhc2lzU3RhdGUgKnN0LCAvKiAoaS9vKTogcHJlZW1waGFzaXMgZmlsdGVyIHN0YXRlICAgICAgICAgICAgICAgICovCi0gICAgICAgIFdvcmQxNiAqc2lnbmFsLCAgICAvKiAoaS9vKTogaW5wdXQgc2lnbmFsIG92ZXJ3cml0dGVuIGJ5IHRoZSBvdXRwdXQgICAgICovCi0gICAgICAgIFdvcmQxNiBnLCAgICAgICAgICAvKiAoaSkgIDogcHJlZW1waGFzaXMgY29lZmZpY2llbnQgICAgICAgICAgICAgICAgICAgICovCi0gICAgICAgIFdvcmQxNiBMLCAgICAgICAgICAvKiAoaSkgIDogc2l6ZSBvZiBmaWx0ZXJpbmcgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0gICAgICAgIEZsYWcgICAqcE92ZXJmbG93ICAvKiAobykgIDogb3ZlcmZsb3cgaW5kaWNhdG9yICAgICAgICAgICAgICAgICAgICAgICAgICovCi0gICAgKTsKLQotICAgIC8qLS0tLS0tL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ICAgICAgICBXZWlnaHRfQWkoQXosIGdhbW1hM19NUjEyMiwgQXAzKTsKLSAgICAgICAgICAgIFdlaWdodF9BaShBeiwgZ2FtbWE0X01SMTIyLCBBcDQpOwotICAgICAgICB9Ci0gICAgICAgIGVsc2UKLSAgICAgICAgewotICAgICAgICAgICAgV2VpZ2h0X0FpKEF6LCBnYW1tYTMsIEFwMyk7Ci0gICAgICAgICAgICBXZWlnaHRfQWkoQXosIGdhbW1hNCwgQXA0KTsKLSAgICAgICAgfQotCi0gICAgICAgIC8qIGZpbHRlcmluZyBvZiBzeW50aGVzaXMgc3BlZWNoIGJ5IEEoei8wLjcpIHRvIGZpbmQgcmVzMltdICovCi0KLSAgICAgICAgUmVzaWR1KEFwMywgJnN5bl93b3JrW2lfc3ViZnJdLCBzdC0+cmVzMiwgTF9TVUJGUik7Ci0KLSAgICAgICAgLyogdGlsdCBjb21wZW5zYXRpb24gZmlsdGVyICovCi0KLSAgICAgICAgLyogaW1wdWxzZSByZXNwb25zZSBvZiBBKHovMC43KS9BKHovMC43NSkgKi8KLQotICAgICAgICBDb3B5KEFwMywgaCwgTSArIDEpOwotICAgICAgICBtZW1zZXQoJmhbTSArIDFdLCAwLCBzaXplb2YoV29yZDE2KSooTF9IIC0gTSAtIDEpKTsKLSAgICAgICAgU3luX2ZpbHQoQXA0LCBoLCBoLCBMX0gsICZoW00gKyAxXSwgMCk7Ci0KLSAgICAgICAgLyogMXN0IGNvcnJlbGF0aW9uIG9mIGhbXSAqLwotCi0gICAgICAgIExfdG1wID0gMDsKLQotICAgICAgICBmb3IgKGkgPSBMX0ggLSAxOyBpID49IDA7IGktLSkKLSAgICAgICAgewotICAgICAgICAgICAgTF90bXAyID0gKChXb3JkMzIpIGhbaV0pICogaFtpXTsKLQotICAgICAgICAgICAgaWYgKExfdG1wMiAhPSAoV29yZDMyKSAweDQwMDAwMDAwTCkKLSAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICBMX3RtcDIgPSBMX3RtcDIgPDwgMTsKLSAgICAgICAgICAgIH0KLSAgICAgICAgICAgIGVsc2UKLSAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAqcE92ZXJmbG93ID0gMTsKLSAgICAgICAgICAgICAgICBMX3RtcDIgPSBNQVhfMzI7Ci0gICAgICAgICAgICAgICAgYnJlYWs7Ci0gICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgIExfdG1wID0gTF9hZGQoTF90bXAsIExfdG1wMiwgcE92ZXJmbG93KTsKLSAgICAgICAgfQotICAgICAgICB0ZW1wMSA9IChXb3JkMTYpKExfdG1wID4+IDE2KTsKLQotICAgICAgICBMX3RtcCA9IDA7Ci0KLSAgICAgICAgZm9yIChpID0gTF9IIC0gMjsgaSA+PSAwOyBpLS0pCi0gICAgICAgIHsKLSAgICAgICAgICAgIExfdG1wMiA9ICgoV29yZDMyKSBoW2ldKSAqIGhbaSArIDFdOwotCi0gICAgICAgICAgICBpZiAoTF90bXAyICE9IChXb3JkMzIpIDB4NDAwMDAwMDBMKQotICAgICAgICAgICAgewotICAgICAgICAgICAgICAgIExfdG1wMiA9IExfdG1wMiA8PCAxOwotICAgICAgICAgICAgfQotICAgICAgICAgICAgZWxzZQotICAgICAgICAgICAgewotICAgICAgICAgICAgICAgICpwT3ZlcmZsb3cgPSAxOwotICAgICAgICAgICAgICAgIExfdG1wMiA9IE1BWF8zMjsKLSAgICAgICAgICAgICAgICBicmVhazsKLSAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgTF90bXAgPSBMX2FkZChMX3RtcCwgTF90bXAyLCBwT3ZlcmZsb3cpOwotICAgICAgICB9Ci0gICAgICAgIHRlbXAyID0gKFdvcmQxNikoTF90bXAgPj4gMTYpOwotCi0gICAgICAgIGlmICh0ZW1wMiA8PSAwKQotICAgICAgICB7Ci0gICAgICAgICAgICB0ZW1wMiA9IDA7Ci0gICAgICAgIH0KLSAgICAgICAgZWxzZQotICAgICAgICB7Ci0gICAgICAgICAgICBMX3RtcCA9ICgoKFdvc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S0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSovCi0KLSAgICAvKiBUaGUgdGFibGUgY29udGFpbnMgdGhlIGZvbGxvd2luZyBkYXRhOgotICAgICAqCi0gICAgICogICAgZ19waXRjaCgwKSAgICAgICAgKFExNCkgLy8gZm9yIHN1Yi0KLSAgICAgKiAgICBnX2ZhYygwKSAgICAgICAgICAoUTEyKSAvLyBmcmFtZSAwIGFuZCAyCi0gICAgICogICAgZ19waXRjaCgxKSAgICAgICAgKFExNCkgLy8gZm9yIHN1Yi0KLSAgICAgKiAgICBnX2ZhYygyKSAgICAgICAgICAoUTEyKSAvLyBmcmFtZSAxIGFuZCAzCi0gICAgICoKLSAgICAgKi8KLSAgICBjb25zdCBXb3JkMTYgdGFibGVfZ2Fpbl9NUjQ3NVtNUjQ3NV9WUV9TSVpFKjRdID0KLSAgICB7Ci0gICAgICAgIC8qZ19waXQoMCksIGdfZmFjKDApLCAgICAgIGdfcGl0KDEpLCBnX2ZhYygxKSAqLwotICAgICAgICA4MTIsICAgICAgICAgIDEyOCwgICAgICAgICAgIDU0MiwgICAgICAxNDAsCi0gICAgICAgIDI4NzMsICAgICAgICAgMTEzNSwgICAgICAgICAgMjI2NiwgICAgIDM0MDIsCi0gICAgICAgIDIwNjcsICAgICAgICAgIDU2MywgICAgICAgICAxMjY3NywgICAgICA2NDcsCi0gICAgICAgIDQxMzIsICAgICAgICAgMTc5OCwgICAgICAgICAgNTYwMSwgICAgIDUyODUsCi0gICAgICAgIDc2ODksICAgICAgICAgIDM3NCwgICAgICAgICAgMzczNSwgICAgICA0NDEsCi0gICAgICAgIDEwOTEyLCAgICAgICAgIDI2MzgsICAgICAgICAgMTE4MDcsICAgICAyNDk0LAotICAgICAgICAyMDQ5MCwgICAgICAgICAgNzk3LCAgICAgICAgICA1MjE4LCAgICAgIDY3NSwKLSAgICAgICAgNjcyNCwgICAgICAgICA4MzU0LCAgICAgICAgICA1MjgyLCAgICAgMTY5NiwKLSAgICAgICAgMTQ4OCwgICAgICAgICAgNDI4LCAgICAgICAgICA1ODgyLCAgICAgIDQ1MiwKLSAgICAgICAgNTMzMiwgICAgICAgICA0MDcyLCAgICAgICAgICAzNTgzLCAgICAgMTI2OCwKLSAgICAgICAgMjQ2OSwgICAgICAgICAgOTAxLCAgICAgICAgIDE1ODk0LCAgICAgMTAwNSwKLSAgICAgICAgMTQ5ODIsICAgICAgICAgMzI3MSwgICAgICAgICAxMDMzMSwgICAgIDQ4NTgsCi0gICAgICAgIDM2MzUsICAgICAgICAgMjAyMSwgICAgICAgICAgMjU5NiwgICAgICA4MzUsCi0gICAgICAgIDEyMzYwLCAgICAgICAgIDQ4OTIsICAgICAgICAgMTIyMDYsICAgICAxNzA0LAotICAgICAgICAxMzQzMiwgICAgICAgICAxNjA0LCAgICAgICAgICA5MTE4LCAgICAgMjM0MSwKLSAgICAgICAgMzk2OCwgICAgICAgICAxNTM4LCAgICAgICAgICA1NDc5LCAgICAgOTkzNiwKLSAgICAgICAgMzc5NSwgICAgICAgICAgNDE3LCAgICAgICAgICAxMzU5LCAgICAgIDQxNCwKLSAgICAgICAgMzY0MCwgICAgICAgICAxNTY5LCAgICAgICAgICA3OTk1LCAgICAgMzU0MSwKLSAgICAgICAgMTE0MDUsICAgICAgICAgIDY0NSwgICAgICAgICAgODU1MiwgICAgICA2MzUsCi0gICAgICAgIDQwNTYsICAgICAgICAgMTM3NywgICAgICAgICAxNjYwOCwgICAgIDYxMjQsCi0gICAgICAgIDExNDIwLCAgICAgICAgICA3MDAsICAgICAgICAgIDIwMDcsICAgICAgNjA3LAotICAgICAgICAxMjQxNSwgICAgICAgICAxNTc4LCAgICAgICAgIDExMTE5LCAgICAgNDY1NCwKLSAgICAgICAgMTM2ODAsICAgICAgICAgMTcwOCwgICAgICAgICAxMTk5MCwgICAgIDEyMjksCi0gICAgICAgIDc5OTYsICAgICAgICAgNzI5NywgICAgICAgICAxMzIzMSwgICAgIDU3MTUsCi0gICAgICAgIDI0MjgsICAgICAgICAgMTE1OSwgICAgICAgICAgMjA3MywgICAgIDE5NDEsCi0gICAgICAgIDYyMTgsICAgICAgICAgNjEyMSwgICAgICAgICAgMzU0NiwgICAgIDE4MDQsCi0gICAgICAgIDg5MjUsICAgICAgICAgMTgwMiwgICAgICAgICAgODY3OSwgICAgIDE1ODAsCi0gICAgICAgIDEzOTM1LCAgICAgICAgIDM1NzYsICAgICAgICAgMTMzMTMsICAgICA2MjM3LAotICAgICAgICA2MTQyLCAgICAgICAgIDExMzAsICAgICAgICAgIDU5OTQsICAgICAxNzM0LAotICAgICAgICAxNDE0MSwgICAgICAgICA0NjYyLCAgICAgICAgIDExMjcxLCAgICAgMzMyMSwKLSAgICAgICAgMTIyMjYsICAgICAgICAgMTU1MSwgICAgICAgICAxMzkzMSwgICAgIDMwMTUsCi0gICAgICAgIDUwODEsICAgICAgICAxMDQ2NCwgICAgICAgICAgOTQ0NCwgICAgIDY3MDYsCi0gICAgICAgIDE2ODksICAgICAgICAgIDY4MywgICAgICAgICAgMTQzNiwgICAgIDEzMDYsCi0gICAgICAgIDcyMTIsICAgICAgICAgMzkzMywgICAgICAgICAgNDA4MiwgICAgIDI3MTMsCi0gICAgICAgIDc3OTMsICAgICAgICAgIDcwNCwgICAgICAgICAxNTA3MCwgICAgICA4MDIsCi0gICAgICAgIDYyOTksICAgICAgICAgNTIxMiwgICAgICAgICAgNDMzNywgICAgIDUzNTcsCi0gICAgICAgIDY2NzYsICAgICAgICAgIDU0MSwgICAgICAgICAgNjA2MiwgICAgICA2MjYsCi0gICAgICAgIDEzNjUxLCAgICAgICAgIDM3MDAsICAgICAgICAgMTE0OTgsICAgICAyNDA4LAotICAgICAgICAxNjE1NiwgICAgICAgICAgNzE2LCAgICAgICAgIDEyMTc3LCAgICAgIDc1MSwKLSAgICAgICAgODA2NSwgICAgICAgIDExNDg5LCAgICAgICAgICA2MzE0LCAgICAgMjI1NiwKLSAgICAgICAgNDQ2NiwgICAgICAgICAgNDk2LCAgICAgICAgICA3MjkzLCAgICAgIDUyMywKLSAgICAgICAgMTAyMTMsICAgICAgICAgMzgzMywgICAgICAgICAgODM5NCwgICAgIDMwMzcsCi0gICAgICAgIDg0MDMsICAgICAgICAgIDk2NiwgICAgICAgICAxNDIyOCwgICAgIDE4ODAsCi0gICAgICAgIDg3MDMsICAgICAgICAgNTQwOSwgICAgICAgICAxNjM5NSwgICAgIDQ4NjMsCi0gICAgICAgIDc0MjAsICAgICAgICAgMTk3OSwgICAgICAgICAgNjA4OSwgICAgIDEyMzAsCi0gICAgICAgIDkzNzEsICAgICAgICAgNDM5OCwgICAgICAgICAxNDU1OCwgICAgIDMzNjMsCi0gICAgICAgIDEzNTU5LCAgICAgICAgIDI4NzMsICAgICAgICAgMTMxNjMsICAgICAxNDY1LAotICAgICAgICA1NTM0LCAgICAgICAgIDE2NzgsICAgICAgICAgMTMxMzgsICAgIDE0NzcxLAotICAgICAgICA3MzM4LCAgICAgICAgICA2MDAsICAgICAgICAgIDEzMTgsICAgICAgNTQ4LAotICAgICAgICA0MjUyLCAgICAgICAgIDM1MzksICAgICAgICAgMTAwNDQsICAgICAyMzY0LAotICAgICAgICAxMDU4NywgICAgICAgICAgNjIyLCAgICAgICAgIDEzMDg4LCAgICAgIDY2OSwKLSAgICAgICAgMTQxMjYsICAgICAgICAgMzUyNiwgICAgICAgICAgNTAzOSwgICAgIDk3ODQsCi0gICAgICAgIDE1MzM4LCAgICAgICAgICA2MTksICAgICAgICAgIDMxMTUsICAgICAgNTkwLAotICAgICAgICAxNjQ0MiwgICAgICAgICAzMDEzLCAgICAgICAgIDE1NTQyLCAgICAgNDE2OCwKLSAgICAgICAgMTU1MzcsICAgICAgICAgMTYxMSwgICAgICAgICAxNTQwNSwgICAgIDEyMjgsCi0gICAgICAgIDE2MDIzLCAgICAgICAgIDkyOTksICAgICAgICAgIDc1MzQsICAgICA0OTc2LAotICAgICAgICAxOTkwLCAgICAgICAgIDEyMTMsICAgICAgICAgMTE0NDcsICAgICAxMTU3LAotICAgICAgICAxMjUxMiwgICAgICAgICA1NTE5LCAgICAgICAgICA5NDc1LCAgICAgMjY0NCwKLSAgICAgICAgNzcxNiwgICAgICAgICAyMDM0LCAgICAgICAgIDEzMjgwLCAgICAgMjIzOSwKLSAgICAgICAgMTYwMTEsICAgICAgICAgNTA5MywgICAgICAgICAgODA2NiwgICAgIDY3NjEsCi0gICAgICAgIDEwMDgzLCAgICAgICAgIDE0MTMsICAgICAgICAgIDUwMDIsICAgICAyMzQ3LAotICAgICAgICAxMjUyMywgICAgICAgICA1OTc1LCAgICAgICAgIDE1MTI2LCAgICAgMjg5OSwKLSAgICAgICAgMTgyNjQsICAgICAgICAgMjI4OSwgICAgICAgICAxNTgyNywgICAgIDI1MjcsCi0gICAgICAgIDE2MjY1LCAgICAgICAgMTAyNTQsICAgICAgICAgMTQ2NTEsICAgIDExMzE5LAotICAgICAgICAxNzk3LCAgICAgICAgICAzMzcsICAgICAgICAgIDMxMTUsICAgICAgMzk3LAotICAgICAgICAzNTEwLCAgICAgICAgIDI5MjgsICAgICAgICAgIDQ1OTIsICAgICAyNjcwLAotICAgICAgICA3NTE5LCAgICAgICAgICA2MjgsICAgICAgICAgMTE0MTUsICAgICAgNjU2LAotICAgICAgICA1OTQ2LCAgICAgICAgIDI0MzUsICAgICAgICAgIDY1NDQsICAgICA3MzY3LAotICAgICAgICA4MjM4LCAgICAgICAgICA4MjksICAgICAgICAgIDQwMDAsICAgICAgODYzLAotICAgICAgICAxMDAzMiwgICAgICAgICAyNDkyLCAgICAgICAgIDE2MDU3LCAgICAgMzU1MSwKLSAgICAgICAgMTgyMDQsICAgICAgICAgMTA1NCwgICAgICAgICAgNjEwMywgICAgIDE0NTQsCi0gICAgICAgIDU4ODQsICAgICAgICAgNzkwMCwgICAgICAgICAxODc1MiwgICAgIDM0NjgsCi0gICAgICAgIDE4NjQsICAgICAgICAgIDU0NCwgICAgICAgICAgOTE5OCwgICAgICA2ODMsCi0gICAgICAgIDExNjIzLCAgICAgICAgIDQxNjAsICAgICAgICAgIDQ1OTQsICAgICAxNjQ0LAotICAgICAgICAzMTU4LCAgICAgICAgIDExNTcsICAgICAgICAgMTU5NTMsICAgICAyNTYwLAotICAgICAgICAxMjM0OSwgICAgICAgICAzNzMzLCAgICAgICAgIDE3NDIwLCAgICAgNTI2MCwKLSAgICAgICAgNjEwNiwgICAgICAgICAyMDA0LCAgICAgICAgICAyOTE3LCAgICAgMTc0MiwKLSAgICAgICAgMTY0NjcsICAgICAgICAgNTI1NywgICAgICAgICAxNjc4NywgICAgIDE2ODAsCi0gICAgICAgIDE3MjA1LCAgICAgICAgIDE3NTksICAgICAgICAgIDQ3NzMsICAgICAzMjMxLAotICAgICAgICA3Mzg2LCAgICAgICAgIDYwMzUsICAgICAgICAgMTQzNDIsICAgIDEwMDEyLAotICAgICAgICA0MDM1LCAgICAgICAgICA0NDIsICAgICAgICAgIDQxOTQsICAgICAgNDU4LAotICAgICAgICA5MjE0LCAgICAgICAgIDIyNDIsICAgICAgICAgIDc0MjcsICAgICA0MjE3LAotICAgICAgICAxMjg2MCwgICAgICAgICAgODAxLCAgICAgICAgIDExMTg2LCAgICAgIDgyNSwKLSAgICAgICAgMTI2NDgsICAgICAgICAgMjA4NCwgICAgICAgICAxMjk1NiwgICAgIDY1NTQsCi0gICAgICAgIDk1MDUsICAgICAgICAgIDk5NiwgICAgICAgICAgNjYyOSwgICAgICA5ODUsCi0gICAgICAgIDEwNTM3LCAgICAgICAgIDI1MDIsICAgICAgICAgMTUyODksICAgICA1MDA2LAotICAgICAgICAxMjYwMiwgICAgICAgICAyMDU1LCAgICAgICAgIDE1NDg0LCAgICAgMTY1MywKLSAgICAgICAgMTYxOTQsICAgICAgICAgNjkyMSwgICAgICAgICAxNDIzMSwgICAgIDU3OTAsCi0gICAgICAgIDI2MjYsICAgICAgICAgIDgyOCwgICAgICAgICAgNTYxNSwgICAgIDE2ODYsCi0gICAgICAgIDEzNjYzLCAgICAgICAgIDU3NzgsICAgICAgICAgIDM2NjgsICAgICAxNTU0LAotICAgICAgICAxMTMxMywgICAgICAgICAyNjMzLCAgICAgICAgICA5NzcwLCAgICAgMTQ1OSwKLSAgICAgICAgMTQwMDMsICAgICAgICAgNDczMywgICAgICAgICAxNTg5NywgICAgIDYyOTEsCi0gICAgICAgIDYyNzgsICAgICAgICAgMTg3MCwgICAgICAgICAgNzkxMCwgICAgIDIyODUsCi0gICAgICAgIDE2OTc4LCAgICAgICAgIDQ1NzEsICAgICAgICAgMTY1NzYsICAgICAzODQ5LAotICAgICAgICAxNTI0OCwgICAgICAgICAyMzExLCAgICAgICAgIDE2MDIzLCAgICAgMzI0NCwKLSAgICAgICAgMTQ0NTksICAgICAgICAxNzgwOCwgICAgICAgICAxMTg0NywgICAgIDI3NjMsCi0gICAgICAgIDE5ODEsICAgICAgICAgMTQwNywgICAgICAgICAgMTQwMCwgICAgICA4NzYsCi0gICAgICAgIDQzMzUsICAgICAgICAgMzU0NywgICAgICAgICAgNDM5MSwgICAgIDQyMTAsCi0gICAgICAgIDU0MDUsICAgICAgICAgIDY4MCwgICAgICAgICAxNzQ2MSwgICAgICA3ODEsCi0gICAgICAgIDY1MDEsICAgICAgICAgNTExOCwgICAgICAgICAgODA5MSwgICAgIDc2NzcsCi0gICAgICAgIDczNTUsICAgICAgICAgIDc5NCwgICAgICAgICAgODMzMywgICAgIDExODIsCi0gICAgICAgIDE1MDQxLCAgICAgICAgIDMxNjAsICAgICAgICAgMTQ5MjgsICAgICAzMDM5LAotICAgICAgICAyMDQyMSwgICAgICAgICAgODgwLCAgICAgICAgIDE0NTQ1LCAgICAgIDg1MiwKLSAgICAgICAgMTIzMzcsICAgICAgICAxNDcwOCwgICAgICAgICAgNjkwNCwgICAgIDE5MjAsCi0gICAgICAgIDQyMjUsICAgICAgICAgIDkzMywgICAgICAgICAgODIxOCwgICAgIDEwODcsCi0gICAgICAgIDEwNjU5LCAgICAgICAgIDQwODQsICAgICAgICAgMTAwODIsICAgICA0NTMzLAotICAgICAgICAyNzM1LCAgICAgICAgICA4NDAsICAgICAgICAgMjA2NTcsICAgICAxMDgxLAotICAgICAgICAxNjcxMSwgICAgICAgICA1OTY2LCAgICAgICAgIDE1ODczLCAgICAgNDU3OCwKLSAgICAgICAgMTA4NzEsICAgICAgICAgMjU3NCwgICAgICAgICAgMzc3MywgICAgIDExNjYsCi0gICAgICAgIDE0NTE5LCAgICAgICAgIDQwNDQsICAgICAgICAgMjA2OTksICAgICAyNjI3LAotICAgICAgICAxNTIxOSwgICAgICAgICAyNzM0LCAgICAgICAgIDE1Mjc0LCAgICAgMjE4NiwKLSAgICAgICAgNjI1NywgICAgICAgICAzMjI2LCAgICAgICAgIDEzMTI1LCAgICAxOTQ4MCwKLSAgICAgICAgNzE5NiwgICAgICAgICAgOTMwLCAgICAgICAgICAyNDYyLCAgICAgMTYxOCwKLSAgICAgICAgNDUxNSwgICAgICAgICAzMDkyLCAgICAgICAgIDEzODUyLCAgICAgNDI3NywKLSAgICAgICAgMTA0NjAsICAgICAgICAgIDgzMywgICAgICAgICAxNzMzOSwgICAgICA4MTAsCi0gICAgICAgIDE2ODkxLCAgICAgICAgIDIyODksICAgICAgICAgMTU1NDYsICAgICA4MjE3LAotICAgICAgICAxMzYwMywgICAgICAgICAxNjg0LCAgICAgICAgICAzMTk3LCAgICAgMTgzNCwKLSAgICAgICAgMTU5NDgsICAgICAgICAgMjgyMCwgICAgICAgICAxNTgxMiwgICAgIDUzMjcsCi0gICAgICAgIDE3MDA2LCAgICAgICAgIDI0MzgsICAgICAgICAgMTY3ODgsICAgICAxMzI2LAotICAgICAgICAxNTY3MSwgICAgICAgICA4MTU2LCAgICAgICAgIDExNzI2LCAgICAgODU1NiwKLSAgICAgICAgMzc2MiwgICAgICAgICAyMDUzLCAgICAgICAgICA5NTYzLCAgICAgMTMxNywKLSAgICAgICAgMTM1NjEsICAgICAgICAgNjc5MCwgICAgICAgICAxMjIyNywgICAgIDE5MzYsCi0gICAgICAgIDgxODAsICAgICAgICAgMzU1MCwgICAgICAgICAxMzI4NywgICAgIDE3NzgsCi0gICAgICAgIDE2Mjk5LCAgICAgICAgIDY1OTksICAgICAgICAgMTYyOTEsICAgICA3NzU4LAotICAgICAgICA4NTIxLCAgICAgICAgIDI1NTEsICAgICAgICAgIDcyMjUsICAgICAyNjQ1LAotICAgICAgICAxODI2OSwgICAgICAgICA3NDg5LCAgICAgICAgIDE2ODg1LCAgICAgMjI0OCwKLSAgICAgICAgMTc4ODIsICAgICAgICAgMjg4NCwgICAgICAgICAxNzI2NSwgICAgIDMzMjgsCi0gICAgICAgIDk0MTcsICAgICAgICAyMDE2MiwgICAgICAgICAxMTA0MiwgICAgIDgzMjAsCi0gICAgICAgIDEyODYsICAgICAgICAgIDYyMCwgICAgICAgICAgMTQzMSwgICAgICA1ODMsCi0gICAgICAgIDU5OTMsICAgICAgICAgMjI4OSwgICAgICAgICAgMzk3OCwgICAgIDM2MjYsCi0gICAgICAgIDUxNDQsICAgICAgICAgIDc1MiwgICAgICAgICAxMzQwOSwgICAgICA4MzAsCi0gICAgICAgIDU1NTMsICAgICAgICAgMjg2MCwgICAgICAgICAxMTc2NCwgICAgIDU5MDgsCi0gICAgICAgIDEwNzM3LCAgICAgICAgICA1NjAsICAgICAgICAgIDU0NDYsICAgICAgNTY0LAotICAgICAgICAxMzMyMSwgICAgICAgICAzMDA4LCAgICAgICAgIDExOTQ2LCAgICAgMzY4MywKLSAgICAgICAgMTk4ODcsICAgICAgICAgIDc5OCwgICAgICAgICAgOTgyNSwgICAgICA3MjgsCi0gICAgICAgIDEzNjYzLCAgICAgICAgIDg3NDgsICAgICAgICAgIDczOTEsICAgICAzMDUzLAotICAgICAgICAyNTE1LCAgICAgICAgICA3NzgsICAgICAgICAgIDYwNTAsICAgICAgODMzLAotICAgICAgICA2NDY5LCAgICAgICAgIDUwNzQsICAgICAgICAgIDgzMDUsICAgICAyNDYzLAotICAgICAgICA2MTQxLCAgICAgICAgIDE4NjUsICAgICAgICAgMTUzMDgsICAgICAxMjYyLAotICAgICAgICAxNDQwOCwgICAgICAgICA0NTQ3LCAgICAgICAgIDEzNjYzLCAgICAgNDUxNSwKLSAgICAgICAgMzEzNywgICAgICAgICAyOTgzLCAgICAgICAgICAyNDc5LCAgICAgMTI1OSwKLSAgICAgICAgMTUwODgsICAgICAgICAgNDY0NywgICAgICAgICAxNTM4MiwgICAgIDI2MDcsCi0gICAgICAgIDE0NDkyLCAgICAgICAgIDIzOTIsICAgICAgICAgMTI0NjIsICAgICAyNTM3LAotICAgICAgICA3NTM5LCAgICAgICAgIDI5NDksICAgICAgICAgMTI5MDksICAgIDEyMDYwLAotICAgICAgICA1NDY4LCAgICAgICAgICA2ODQsICAgICAgICAgIDMxNDEsICAgICAgNzIyLAotICAgICAgICA1MDgxLCAgICAgICAgIDEyNzQsICAgICAgICAgMTI3MzIsICAgICA0MjAwLAotICAgICAgICAxNTMwMiwgICAgICAgICAgNjgxLCAgICAgICAgICA3ODE5LCAgICAgIDU5MiwKLSAgICAgICAgNjUzNCwgICAgICAgICAyMDIxLCAgICAgICAgIDE2NDc4LCAgICAgODczNywKLSAgICAgICAgMTMzNjQsICAgICAgICAgIDg4MiwgICAgICAgICAgNTM5NywgICAgICA4OTksCi0gICAgICAgIDE0NjU2LCAgICAgICAgIDIxNzgsICAgICAgICAgMTQ3NDEsICAgICA0MjI3LAotICAgICAgICAxNDI3MCwgICAgICAgICAxMjk4LCAgICAgICAgIDEzOTI5LCAgICAgMjAyOSwKLSAgICAgICAgMTU0NzcsICAgICAgICAgNzQ4MiwgICAgICAgICAxNTgxNSwgICAgIDQ1NzIsCi0gICAgICAgIDI1MjEsICAgICAgICAgMjAxMywgICAgICAgICAgNTA2MiwgICAgIDE4MDQsCi0gICAgICAgIDUxNTksICAgICAgICAgNjU4MiwgICAgICAgICAgNzEzMCwgICAgIDM1OTcsCi0gICAgICAgIDEwOTIwLCAgICAgICAgIDE2MTEsICAgICAgICAgMTE3MjksICAgICAxNzA4LAotICAgICAgICAxNjkwMywgICAgICAgICAzNDU1LCAgICAgICAgIDE2MjY4LCAgICAgNjY0MCwKLSAgICAgICAgOTMwNiwgICAgICAgICAxMDA3LCAgICAgICAgICA5MzY5LCAgICAgMjEwNiwKLSAgICAgICAgMTkxODIsICAgICAgICAgNTAzNywgICAgICAgICAxMjQ0MSwgICAgIDQyNjksCi0gICAgICAgIDE1OTE5LCAgICAgICAgIDEzMzIsICAgICAgICAgMTUzNTcsICAgICAzNTEyLAotICAgICAgICAxMTg5OCwgICAgICAgIDE0MTQxLCAgICAgICAgIDE2MTAxLCAgICAgNjg1NCwKLSAgICAgICAgMjAxMCwgICAgICAgICAgNzM3LCAgICAgICAgICAzNzc5LCAgICAgIDg2MSwKLSAgICAgICAgMTE0NTQsICAgICAgICAgMjg4MCwgICAgICAgICAgMzU2NCwgICAgIDM1NDAsCi0gICAgICAgIDkwNTcsICAgICAgICAgMTI0MSwgICAgICAgICAxMjM5MSwgICAgICA4OTYsCi0gICAgICAgIDg1NDYsICAgICAgICAgNDYyOSwgICAgICAgICAxMTU2MSwgICAgIDU3NzYsCi0gICAgICAgIDgxMjksICAgICAgICAgIDU4OSwgICAgICAgICAgODIxOCwgICAgICA1ODgsCi0gICAgICAgIDE4NzI4LCAgICAgICAgIDM3NTUsICAgICAgICAgMTI5NzMsICAgICAzMTQ5LAotICAgICAgICAxNTcyOSwgICAgICAgICAgNzU4LCAgICAgICAgIDE2NjM0LCAgICAgIDc1NCwKLSAgICAgICAgMTUyMjIsICAgICAgICAxMTEzOCwgICAgICAgICAxNTg3MSwgICAgIDIyMDgsCi0gICAgICAgIDQ2NzMsICAgICAgICAgIDYxMCwgICAgICAgICAxMDIxOCwgICAgICA2NzgsCi0gICAgICAgIDE1MjU3LCAgICAgICAgIDQxNDYsICAgICAgICAgIDU3MjksICAgICAzMzI3LAotICAgICAgICA4Mzc3LCAgICAgICAgIDE2NzAsICAgICAgICAgMTk4NjIsICAgICAyMzIxLAotICAgICAgICAxNTQ1MCwgICAgICAgICA1NTExLCAgICAgICAgIDE0MDU0LCAgICAgNTQ4MSwKLSAgICAgICAgNTcyOCwgICAgICAgICAyODg4LCAgICAgICAgICA3NTgwLCAgICAgMTM0NiwKLSAgICAgICAgMTQzODQsICAgICAgICAgNTMyNSwgICAgICAgICAxNjIzNiwgICAgIDM5NTAsCi0gICAgICAgIDE1MTE4LCAgICAgICAgIDM3NDQsICAgICAgICAgMTUzMDYsICAgICAxNDM1LAotICAgICAgICAxNDU5NywgICAgICAgICA0MDcwLCAgICAgICAgIDEyMzAxLCAgICAxNTY5NiwKLSAgICAgICAgNzYxNywgICAgICAgICAxNjk5LCAgICAgICAgICAyMTcwLCAgICAgIDg4NCwKLSAgICAgICAgNDQ1OSwgICAgICAgICA0NTY3LCAgICAgICAgIDE4MDk0LCAgICAgMzMwNiwKLSAgICAgICAgMTI3NDIsICAgICAgICAgIDgxNSwgICAgICAgICAxNDkyNiwgICAgICA5MDcsCi0gICAgICAgIDE1MDE2LCAgICAgICAgIDQyODEsICAgICAgICAgMTU1MTgsICAgICA4MzY4LAotICAgICAgICAxNzk5NCwgICAgICAgICAxMDg3LCAgICAgICAgICAyMzU4LCAgICAgIDg2NSwKLSAgICAgICAgMTYyODEsICAgICAgICAgMzc4NywgICAgICAgICAxNTY3OSwgICAgIDQ1OTYsCi0gICAgICAgIDE2MzU2LCAgICAgICAgIDE1MzQsICAgICAgICAgMTY1ODQsICAgICAyMjEwLAotICAgICAgICAxNjgzMywgICAgICAgICA5Njk3LCAgICAgICAgIDE1OTI5LCAgICAgNDUxMywKLSAgICAgICAgMzI3NywgICAgICAgICAxMDg1LCAgICAgICAgICA5NjQzLCAgICAgMjE4NywKLSAgICAgICAgMTE5NzMsICAgICAgICAgNjA2OCwgICAgICAgICAgOTE5OSwgICAgIDQ0NjIsCi0gICAgICAgIDg5NTUsICAgICAgICAgMTYyOSwgICAgICAgICAxMDI4OSwgICAgIDMwNjIsCi0gICAgICAgIDE2NDgxLCAgICAgICAgIDUxNTUsICAgICAgICAgMTU0NjYsICAgICA3MDY2LAotICAgICAgICAxMzY3OCwgICAgICAgICAyNTQzLCAgICAgICAgICA1MjczLCAgICAgMjI3NywKLSAgICAgICAgMTY3NDYsICAgICAgICAgNjIxMywgICAgICAgICAxNjY1NSwgICAgIDM0MDgsCi0gICAgICAgIDIwMzA0LCAgICAgICAgIDMzNjMsICAgICAgICAgMTg2ODgsICAgICAxOTg1LAotICAgICAgICAxNDE3MiwgICAgICAgIDEyODY3LCAgICAgICAgIDE1MTU0LCAgICAxNTcwMywKLSAgICAgICAgNDQ3MywgICAgICAgICAxMDIwLCAgICAgICAgICAxNjgxLCAgICAgIDg4NiwKLSAgICAgICAgNDMxMSwgICAgICAgICA0MzAxLCAgICAgICAgICA4OTUyLCAgICAgMzY1NywKLSAgICAgICAgNTg5MywgICAgICAgICAxMTQ3LCAgICAgICAgIDExNjQ3LCAgICAgMTQ1MiwKLSAgICAgICAgMTU4ODYsICAgICAgICAgMjIyNywgICAgICAgICAgNDU4MiwgICAgIDY2NDQsCi0gICAgICAgIDY5MjksICAgICAgICAgMTIwNSwgICAgICAgICAgNjIyMCwgICAgICA3OTksCi0gICAgICAgIDEyNDE1LCAgICAgICAgIDM0MDksICAgICAgICAgMTU5NjgsICAgICAzODc3LAotICAgICAgICAxOTg1OSwgICAgICAgICAyMTA5LCAgICAgICAgICA5Njg5LCAgICAgMjE0MSwKLSAgICAgICAgMTQ3NDIsICAgICAgICAgODgzMCwgICAgICAgICAxNDQ4MCwgICAgIDI1OTksCi0gICAgICAgIDE4MTcsICAgICAgICAgMTIzOCwgICAgICAgICAgNzc3MSwgICAgICA4MTMsCi0gICAgICAgIDE5MDc5LCAgICAgICAgIDQ0MTAsICAgICAgICAgIDU1NTQsICAgICAyMDY0LAotICAgICAgICAzNjg3LCAgICAgICAgIDI4NDQsICAgICAgICAgMTc0MzUsICAgICAyMjU2LAotICAgICAgICAxNjY5NywgICAgICAgICA0NDg2LCAgICAgICAgIDE2MTk5LCAgICAgNTM4OCwKLSAgICAgICAgODAyOCwgICAgICAgICAyNzYzLCAgICAgICAgICAzNDA1LCAgICAgMjExOSwKLSAgICAgICAgMTc0MjYsICAgICAgICAgNTQ3NywgICAgICAgICAxMzY5OCwgICAgIDI3ODYsCi0gICAgICAgIDE5ODc5LCAgICAgICAgIDI3MjAsICAgICAgICAgIDkwOTgsICAgICAzODgwLAotICAgICAgICAxODE3MiwgICAgICAgICA0ODMzLCAgICAgICAgIDE3MzM2LCAgICAxMjIwNywKLSAgICAgICAgNTExNiwgICAgICAgICAgOTk2LCAgICAgICAgICA0OTM1LCAgICAgIDk4OCwKLSAgICAgICAgOTg4OCwgICAgICAgICAzMDgxLCAgICAgICAgICA2MDE0LCAgICAgNTM3MSwKLSAgICAgICAgMTU4ODEsICAgICAgICAgMTY2NywgICAgICAgICAgODQwNSwgICAgIDExODMsCi0gICAgICAgIDE1MDg3LCAgICAgICAgIDIzNjYsICAgICAgICAgMTk3NzcsICAgICA3MDAyLAotICAgICAgICAxMTk2MywgICAgICAgICAxNTYyLCAgICAgICAgICA3Mjc5LCAgICAgMTEyOCwKLSAgICAgICAgMTY4NTksICAgICAgICAgMTUzMiwgICAgICAgICAxNTc2MiwgICAgIDUzODEsCi0gICAgICAgIDE0NzA4LCAgICAgICAgIDIwNjUsICAgICAgICAgMjAxMDUsICAgICAyMTU1LAotICAgICAgICAxNzE1OCwgICAgICAgICA4MjQ1LCAgICAgICAgIDE3OTExLCAgICAgNjMxOCwKLSAgICAgICAgNTQ2NywgICAgICAgICAxNTA0LCAgICAgICAgICA0MTAwLCAgICAgMjU3NCwKLSAgICAgICAgMTc0MjEsICAgICAgICAgNjgxMCwgICAgICAgICAgNTY3MywgICAgIDI4ODgsCi0gICAgICAgIDE2NjM2LCAgICAgICAgIDMzODIsICAgICAgICAgIDg5NzUsICAgICAxODMxLAotICAgICAgICAyMDE1OSwgICAgICAgICA0NzM3LCAgICAgICAgIDE5NTUwLCAgICAgNzI5NCwKLSAgICAgICAgNjY1OCwgICAgICAgICAyNzgxLCAgICAgICAgIDExNDcyLCAgICAgMzMyMSwKLSAgICAgICAgMTkzOTcsICAgICAgICAgNTA1NCwgICAgICAgICAxODg3OCwgICAgIDQ3MjIsCi0gICAgICAgIDE2NDM5LCAgICAgICAgIDIzNzMsICAgICAgICAgMjA0MzAsICAgICA0Mzg2LAotICAgICAgICAxMTM1MywgICAgICAgIDI2NTI2LCAgICAgICAgIDExNTkzLCAgICAgMzA2OCwKLSAgICAgICAgMjg2NiwgICAgICAgICAxNTY2LCAgICAgICAgICA1MTA4LCAgICAgMTA3MCwKLSAgICAgICAgOTYxNCwgICAgICAgICA0OTE1LCAgICAgICAgICA0OTM5LCAgICAgMzUzNiwKLSAgICAgICAgNzU0MSwgICAgICAgICAgODc4LCAgICAgICAgIDIwNzE3LCAgICAgIDg1MSwKLSAgICAgICAgNjkzOCwgICAgICAgICA0Mzk1LCAgICAgICAgIDE2Nzk5LCAgICAgNzczMywKLSAgICAgICAgMTAxMzcsICAgICAgICAgMTAxOSwgICAgICAgICAgOTg0NSwgICAgICA5NjQsCi0gICAgICAgIDE1NDk0LCAgICAgICAgIDM5NTUsICAgICAgICAgMTU0NTksICAgICAzNDMwLAotICAgICAgICAxODg2MywgICAgICAgICAgOTgyLCAgICAgICAgIDIwMTIwLCAgICAgIDk2MywKLSAgICAgICAgMTY4NzYsICAgICAgICAxMjg4NywgICAgICAgICAxNDMzNCwgICAgIDQyMDAsCi0gICAgICAgIDY1OTksICAgICAgICAgMTIyMCwgICAgICAgICAgOTIyMiwgICAgICA4MTQsCi0gICAgICAgIDE2OTQyLCAgICAgICAgIDUxMzQsICAgICAgICAgIDU2NjEsICAgICA0ODk4LAotICAgICAgICA1NDg4LCAgICAgICAgIDE3OTgsICAgICAgICAgMjAyNTgsICAgICAzOTYyLAotICAgICAgICAxNzAwNSwgICAgICAgICA2MTc4LCAgICAgICAgIDE3OTI5LCAgICAgNTkyOSwKLSAgICAgICAgOTM2NSwgICAgICAgICAzNDIwLCAgICAgICAgICA3NDc0LCAgICAgMTk3MSwKLSAgICAgICAgMTk1MzcsICAgICAgICAgNTE3NywgICAgICAgICAxOTAwMywgICAgIDMwMDYsCi0gICAgICAgIDE2NDU0LCAgICAgICAgIDM3ODgsICAgICAgICAgMTYwNzAsICAgICAyMzY3LAotICAgICAgICA4NjY0LCAgICAgICAgIDI3NDMsICAgICAgICAgIDk0NDUsICAgIDI2MzU4LAotICAgICAgICAxMDg1NiwgICAgICAgICAxMjg3LCAgICAgICAgICAzNTU1LCAgICAgMTAwOSwKLSAgICAgICAgNTYwNiwgICAgICAgICAzNjIyLCAgICAgICAgIDE5NDUzLCAgICAgNTUxMiwKLSAgICAgICAgMTI0NTMsICAgICAgICAgIDc5NywgICAgICAgICAyMDYzNCwgICAgICA5MTEsCi0gICAgICAgIDE1NDI3LCAgICAgICAgIDMwNjYsICAgICAgICAgMTcwMzcsICAgIDEwMjc1LAotICAgICAgICAxODg4MywgICAgICAgICAyNjMzLCAgICAgICAgICAzOTEzLCAgICAgMTI2OCwKLSAgICAgICAgMTk1MTksICAgICAgICAgMzM3MSwgICAgICAgICAxODA1MiwgICAgIDUyMzAsCi0gICAgICAgIDE5MjkxLCAgICAgICAgIDE2NzgsICAgICAgICAgMTk1MDgsICAgICAzMTcyLAotICAgICAgICAxODA3MiwgICAgICAgIDEwNzU0LCAgICAgICAgIDE2NjI1LCAgICAgNjg0NSwKLSAgICAgICAgMzEzNCwgICAgICAgICAyMjk4LCAgICAgICAgIDEwODY5LCAgICAgMjQzNywKLSAgICAgICAgMTU1ODAsICAgICAgICAgNjkxMywgICAgICAgICAxMjU5NywgICAgIDMzODEsCi0gICAgICAgIDExMTE2LCAgICAgICAgIDMyOTcsICAgICAgICAgMTY3NjIsICAgICAyNDI0LAotICAgICAgICAxODg1MywgICAgICAgICA2NzE1LCAgICAgICAgIDE3MTcxLCAgICAgOTg4NywKLSAgICAgICAgMTI3NDMsICAgICA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zIGZvciB1c2VycyBvZiB0aGlzIGZ1bmN0aW9uXQotCi0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0KLSovCi0KLXZvaWQgR1NNRnJhbWVEZWNvZGUoCi0gICAgU3BlZWNoX0RlY29kZV9GcmFtZVN0YXRlICpzdCwgLyogaW86IHBvc3QgZmlsdGVyIHN0YXRlcyAgICAgICAgICAgICAgICAqLwotICAgIGVudW0gTW9kZSBtb2RlLCAgICAgICAgICAgICAgIC8qIGkgOiBBTVIgbW9kZSAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLSAgICBXb3JkMTYgKnNlcmlhbCwgICAgICAgICAgICAgICAvKiBpIDogc2VyaWFsIGJpdCBzdHJlYW0gICAgICAgICAgICAgICAgICovCi0gICAgZW51bSBSWEZyYW1lVHlwZSBmcmFtZV90eXBlLCAgLyogaSA6IEZyYW1lIHR5cGUgICAgICAgICAgICAgICAgICAgICAgICAqLwotICAgIFdvcmQxNiAqc3ludGgpICAgICAgICAgICAgICAgIC8qIG8gOiBzeW50aGVzaXMgc3BlZWNoIChwb3N0ZmlsdGVyZWQgICAgKi8KLS8qICAgICBvdXRwdXQpICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLQotewotICAgIFdvcmQxNiBwYXJtW01BWF9QUk1fU0laRSArIDFdOyAgLyogU3ludGhlc2lzIHBhcmFtZXRlcnMgICAgICAgICAgICAgICAgKi8KLSAgICBXb3JkMTYgQXpfZGVjW0FaX1NJWkVdOyAgICAgICAgIC8qIERlY29kZWQgQXogZm9yIHBvc3QtZmlsdGVyICAgICAgICAgICovCi0gICAgLyogaW4gNCBzdWJmcmFtZXMgICAgICAgICAgICAgICAgICAgICAgKi8KLSAgICBGbGFnICpwT3ZlcmZsb3cgPSAmKHN0LT5kZWNvZGVyX2FtclN0YXRlLm92ZXJmbG93KTsgIC8qIE92ZXJmbG93IGZsYWcgICovCi0KLSNpZiAhZGVmaW5lZChOTzEzQklUKQotICAgIFdvcmQxNiBpOwotI2VuZGlmCi0KLSAgICAvKiBTZXJpYWwgdG8gcGFyYW1ldGVycyAgICovCi0gICAgaWYgKChmcmFtZV90eXBlID09IFJYX1NJRF9CQUQpIHx8Ci0gICAgICAgICAgICAoZnJhbWVfdHlwZSA9PSBSWF9TSURfVVBEQVRFKSkKLSAgICB7Ci0gICAgICAgIC8qIE92ZXJyaWRlIG1vZGUgdG8gTVJEVFggKi8KLSAgICAgICAgQml0czJwcm0oTVJEVFgsIHNlcmlhbCwgcGFybSk7Ci0gICAgfQotICAgIGVsc2UKLSAgICB7Ci0gICAgICAgIEJpdHMycHJtKG1vZGUsIHNlcmlhbCwgcGFybSk7Ci0gICAgfQotCi0gICAgLyogU3ludGhlc2lzICovCi0gICAgRGVjb2Rlcl9hbXIoCi0gICAgICAgICYoc3QtPmRlY29kZXJfYW1yU3RhdGUpLAotICAgICAgICBtb2RlLAotICAgICAgICBwYXJtLAotICAgICAgICBmcmFtZV90eXBlLAotICAgICAgICBzeW50aCwKLSAgICAgICAgQXpfZGVjKTsKLQotICAgIC8qIFBvc3QtZmlsdGVyICovCi0gICAgUG9zdF9GaWx0ZXIoCi0gICAgICAgICYoc3QtPnBvc3Rfc3RhdGUpLAotICAgICAgICBtb2RlLAotICAgICAgICBzeW50aCwKLSAgICAgICAgQXpfZGVjLAotICAgICAgICBwT3ZlcmZsb3cpOwotCi0gICAgLyogcG9zdCBIUCBmaWx0ZXIsIGFuZCAxNS0+MTYgYml0cyAqLwotICAgIFBvc3RfUHJvY2VzcygKLSAgICAgICAgJihzdC0+cG9zdEhQX3N0YXRlKSwKLSAgICAgICAgc3ludGgsCi0gICAgICAgIExfRlJBTUUsCi0gICAgICAgIHBPdmVyZmxvdyk7Ci0KLSNpZiAhZGVmaW5lZChOTzEzQklUKQotICAgIC8qIFRydW5jYXRlIHRvIDEzIGJpdHMgKi8KLSAgIC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ZWQgZnJvbSB0aGUgY29weXJpZ2h0IGhvbGRlci4KLSoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0vKgotKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKLSoKLSogICAgICBHU00gQU1SIHNwZWVjaCBjb2RlYyAgIFZlcnNpb24gMi4wLjAgICBGZWJydWFyeSA4LCAxOTk5Ci0qCi0qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgotKgotKiAgICAgIEZpbGUgICAgICAgICAgICAgOiBzcF9kZWMuaAotKiAgICAgIFB1cnBvc2UgICAgICAgICAgOiBEZWNvZGluZyBhbmQgcG9zdCBmaWx0ZXJpbmcgb2Ygb25lIHNwZWVjaCBmcmFtZS4KLSoKLQotIERlc2NyaXB0aW9uOiAgUmVwbGFjZWQgImludCIgYW5kL29yICJjaGFyIiB3aXRoIE9TQ0wgZGVmaW5lZCB0eXBlcy4KLQotKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKLSovCi0jaWZuZGVmIHNwX2RlY19oCi0jZGVmaW5lIHNwX2RlY19oICIkSWQgJCIKLQotLyoKLSoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCi0qICAgICAgICAgICAgICAgICAgICAgICAgIElOQ0xVREUgRklMRVMKLSoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCi0qLwotI2luY2x1ZGUgInR5cGVkZWYuaCIKLSNpbmNsdWRlICJjbnN0LmgiCi0jaW5jbHVkZSAiZGVjX2Ftci5oIgotI2luY2x1ZGUgInBzdGZpbHQuaCIKLSNpbmNsdWRlICJwb3N0X3Byby5oIgotI2luY2x1ZGUgIm1vZGUuaCIKLQotLyoKLSoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCi0qICAgICAgICAgICAgICAgICAgICAgICAgIERFRklOSVRJT04gT0YgREFUQSBUWVBFUwotKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKLSovCi10eXBlZGVmIHN0cnVjdAotewotICAgIERlY29kZXJfYW1yU3RhdGUgIGRlY29kZXJfYW1yU3RhdGU7Ci0gICAgUG9zdF9GaWx0ZXJTdGF0ZSAgcG9zdF9zdGF0ZTsKLSAgICBQb3N0X1Byb2Nlc3NTdGF0ZSBwb3N0SFBfc3RhdGU7Ci0gICAgZW51bSBNb2RlIHByZXZfbW9kZTsKLX0gU3BlZWNoX0RlY29kZV9GcmFtZVN0YXRlOwotCi0vKgotKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKLSogICAgICAgICAgICAgICAgICAgICAgICAgREVDTEFSQVRJT04gT0YgUFJPVE9UWVBFUwotKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKLSovCi0KLSNpZiBkZWZpbmVkKF9fY3BsdXNwbHVzKQotZXh0ZXJuICJDIgotewotI2VuZGlmCi0gICAgV29yZDE2IEdTTUluaXREZWNvZGUodm9pZCAqKnN0YXRlX2RhdGEsCi0gICAgV29yZDggKmlkKTsKLSAgICAvKiBpbml0aWFsaXplIG9uZSBpbnN0YW5jZSBvZiB0aGUgc3BlZWNoIGRlY29kZXIKLSAgICAg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U1STkJFbmNvZGVyOjppbnRlcm5hbEdldFBhcmFtZXRlcigKLSAgICAgICAgT01YX0lOREVYVFlQRSBpbmRleCwgT01YX1BUUiBwYXJhbXMpIHsKLSAgICBzd2l0Y2ggKGluZGV4KSB7Ci0gICAgICAgIGNhc2UgT01YX0luZGV4UGFyYW1BdWRpb1BvcnRGb3JtYXQ6Ci0gICAgICAgIHsKLSAgICAgICAgICAgIE9NWF9BVURJT19QQVJBTV9QT1JURk9STUFUVFlQRSAqZm9ybWF0UGFyYW1zID0KLSAgICAgICAgICAgICAgICAoT01YX0FVRElPX1BBUkFNX1BPUlRGT1JNQVRUWVBFICopcGFyYW1zOwotCi0gICAgICAgICAgICBpZiAoZm9ybWF0UGFyYW1zLT5uUG9ydEluZGV4ID4gMSkgewotICAgICAgICAgICAgICAgIHJldHVybiBPTVhfRXJyb3JVbmRlZmluZWQ7Ci0gICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgIGlmIChmb3JtYXRQYXJhbXMtPm5JbmRleCA+IDApIHsKLSAgICAgICAgICAgICAgICByZXR1cm4gT01YX0Vycm9yTm9Nb3JlOwotICAgICAgICAgICAgfQotCi0gICAgICAgICAgICBmb3JtYXRQYXJhbXMtPmVFbmNvZGluZyA9Ci0gICAgICAgICAgICAgICAgKGZvcm1hdFBhcmFtcy0+blBvcnRJbmRleCA9PSAwKQotICAgICAgICAgICAgICAgICAgICA/IE9NWF9BVURJT19Db2RpbmdQQ00gOiBPTVhfQVVESU9fQ29kaW5nQU1SOwotCi0gICAgICAgICAgICByZXR1cm4gT01YX0Vycm9yTm9uZTsKLSAgICAgICAgfQotCi0gICAgICAgIGNhc2UgT01YX0luZGV4UGFyYW1BdWRpb0FtcjoKLSAgICAgICAgewotICAgICAgICAgICAgT01YX0FVRElPX1BBUkFNX0FNUlRZUEUgKmFtclBhcmFtcyA9Ci0gICAgICAgICAgICAgICAgKE9NWF9BVURJT19QQVJBTV9BTVJUWVBFICopcGFyYW1zOwotCi0gICAgICAgIC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0gICAgICAgICAgICAgICAgICAgICAgICAiYXVkaW9fZW5jb2Rlci5hbXJuYiIsCi0gICAgICAgICAgICAgICAgICAgICAgICBPTVhfTUFYX1NUUklOR05BTUVfU0laRSAtIDEpKSB7Ci0gICAgICAgICAgICAgICAgcmV0dXJuIE9NWF9FcnJvclVuZGVmaW5lZDsKLSAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgcmV0dXJuIE9NWF9FcnJvck5vbmU7Ci0gICAgICAgIH0KLQotICAgICAgICBjYXNlIE9NWF9JbmRleFBhcmFtQXVkaW9Qb3J0Rm9ybWF0OgotICAgICAgICB7Ci0gICAgICAgICAgICBjb25zdCBPTVhfQVVESU9fUEFSQU1fUE9SVEZPUk1BVFRZUEUgKmZvcm1hdFBhcmFtcyA9Ci0gICAgICAgICAgICAgICAgKGNvbnN0IE9NWF9BVURJT19QQVJBTV9QT1JURk9STUFUVFlQRSAqKXBhcmFtczsKLQotICAgICAgICAgICAgaWYgKGZvcm1hdFBhcmFtcy0+blBvcnRJbmRleCA+IDEpIHsKLSAgICAgICAgICAgICAgICByZXR1cm4gT01YX0Vycm9yVW5kZWZpbmVkOwotICAgICAgICAgICAgfQotCi0gICAgICAgICAgICBpZiAoZm9ybWF0UGFyYW1zLT5uSW5kZXggPiAwKSB7Ci0gICAgICAgICAgICAgICAgcmV0dXJuIE9NWF9FcnJvck5vTW9yZTsKLSAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgaWYgKChmb3JtYXRQYXJhbXMtPm5Qb3J0SW5kZXggPT0gMAotICAgICAgICAgICAgICAgICAgICAgICAgJiYgZm9ybWF0UGFyYW1zLT5lRW5jb2RpbmcgIT0gT01YX0FVRElPX0NvZGluZ1BDTSkKLSAgICAgICAgICAgICAgICB8fCAoZm9ybWF0UGFyYW1zLT5uUG9ydEluZGV4ID09IDEKLSAgICAgICAgICAgICAgICAgICAgICAgICYmIGZvcm1hdFBhcmFtcy0+ZUVuY29kaW5nICE9IE9NWF9BVURJT19Db2RpbmdBTVIpKSB7Ci0gICAgICAgICAgICAgICAgcmV0dXJuIE9NWF9FcnJvclVuZGVmaW5lZDsKLSAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgcmV0dXJuIE9NWF9FcnJvck5vbmU7Ci0gICAgICAgIH0KLQotICAgICAgICBjYXNlIE9NWF9JbmRleFBhcmFtQXVkaW9BbXI6Ci0gICAgICAgIHsKLSAgICAgICAgICAgIE9NWF9BVURJT19QQVJBTV9BTVJUWVBFICphbXJQYXJhbXMgPQotICAgICAgICAgICAgICAgIChPTVhfQVVESU9fUEFSQU1fQU1SVFlQRSAqKXBhcmFtczsKLQotICAgICAgICAgICAgaWYgKGFtclBhcmFtcy0+blBvcnRJbmRleCAhPSAxKSB7Ci0gICAgICAgICAgICAgICAgcmV0dXJuIE9NWF9FcnJvclVuZGVmaW5lZDsKLSAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgaWYgKGFtclBhcmFtcy0+bkNoYW5uZWxzICE9IDEKLSAgICAgICAgICAgICAgICAgICAgfHwgYW1yUGFyYW1zLT5lQU1SRFRYTW9kZSAhPSBPTVhfQVVESU9fQU1SRFRYTW9kZU9mZgotICAgICAgICAgICAgICAgICAgICB8fCBhbXJQYXJhbXMtPmVBTVJGcmFtZUZvcm1hdAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICE9IE9NWF9BVURJT19BTVJGcmFtZUZvcm1hdEZTRgotICAgICAgICAgICAgICAgICAgICB8fCBhbXJQYXJhbXMtPmVBTVJCYW5kTW9kZSA8IE9NWF9BVURJT19BTVJCYW5kTW9kZU5CMAotICAgICAgICAgICAgICAgICAgICB8fCBhbXJQYXJhbXMtPmVBTVJCYW5kTW9kZSA+IE9NWF9BVURJT19BTVJCYW5kTW9kZU5CNykgewotICAgICAgICAgICAgICAgIHJldHVybiBPTVhfRXJyb3JVbmRlZmluZWQ7Ci0gICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgIG1CaXRSYXRlID0gYW1yUGFyYW1zLT5uQml0UmF0ZTsKLSAgICAgICAgICAgIG1Nb2RlID0gYW1yUGFyYW1zLT5lQU1SQmFuZE1vZGUgLSAxOwotCi0gICAgICAgICAgICBhbXJQYXJhbXMtPmVBTVJEVFhNb2RlID0gT01YX0FVRElPX0FNUkRUWE1vZGVPZmY7Ci0gICAgICAgICAgICBhbXJQYXJhbXMtPmVBTVJGcmFtZUZvcm1hdCA9IE9NWF9BVURJT19BTVJGcmFtZUZvcm1hdEZTRjsKLQotICAgICAgICAgICAgcmV0dXJuIE9NWF9FcnJvck5vbmU7Ci0gICAgICAgIH0KLQotICAgICAgICBjYXNlIE9NWF9JbmRleFBhcmFtQXVkaW9QY206Ci0gICAgICAgIHsKLSAgICAgICAgICAgIE9NWF9BVURJT19QQVJBTV9QQ01NT0RFVFlQRSAqcGNtUGFyYW1zID0KLSAgICAgICAgICAgICAgICAoT01YX0FVRElPX1BBUkFNX1BDTU1PREVUWVBFICopcGFyYW1zOwotCi0gICAgICAgICAgICBpZiAocGNtUGFyYW1zLT5uUG9ydEluZGV4ICE9IDApIHsKLSAgICAgICAgICAgICAgICByZXR1cm4gT01YX0Vycm9yVW5kZWZpbmVkOwotICAgICAgICAgICAgfQotCi0gICAgICAgICAgICBpZiAocGNtUGFyYW1zLT5uQ2hhbm5lbHMgIT0gMQotICAgICAgICAgICAgICAgICAgICB8fCBwY21QYXJhbXMtPm5TYW1wbGluZ1JhdGUgIT0ga1NhbXBsZVJhdGUpIHsKLSAgICAgICAgICAgICAgICByZXR1cm4gT01YX0Vycm9yVW5kZWZpbmVkOwotICAgICAgICAgICAgfQotCi0gICAgICAgICAgICByZXR1cm4gT01YX0Vycm9yTm9uZTsKLSAgICAgICAgfQotCi0KLSAgICAgICAgZGVmYXVsdDoKLSAgICAgICAgICAgIHJldHVybiBTaW1wbGVTb2Z0T01YQ29tcG9uZW50OjppbnRlcm5hbFNldFBhcmFtZXRlcihpbmRleCwgcGFyYW1zKTsKLSAgICB9Ci19Ci0KLXZvaWQgU29mdEFNU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X0JVRkZFUkhFQURFUlRZUEUgKmluSGVhZGVyID0gaW5JbmZvLT5tSGVhZGVyOwotCi0gICAgICAgICAgICBjb25zdCB2b2lkICppbkRhdGEgPSBpbkhlYWRlci0+cEJ1ZmZlciArIGluSGVhZGVyLT5uT2Zmc2V0OwotCi0gICAgICAgICAgICBzaXplX3QgY29weSA9IG51bUJ5dGVzUGVySW5wdXRGcmFtZSAtIG1JbnB1dFNpemU7Ci0gICAgICAgICAgICBpZiAoY29weSA+IGluSGVhZGVyLT5uRmlsbGVkTGVuKSB7Ci0gICAgICAgICAgICAgICAgY29weSA9IGluSGVhZGVyLT5uRmlsbGVkTGVuOwotICAgICAgICAgICAgfQotCi0gICAgICAgICAgICBpZiAobUlucHV0U2l6ZSA9PSAwKSB7Ci0gICAgICAgICAgICAgICAgbUlucHV0VGltZVVzID0gaW5IZWFkZXItPm5UaW1lU3RhbXA7Ci0gICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgIG1lbWNweSgodWludDhfdCAqKW1JbnB1dEZyYW1lICsgbUlucHV0U2l6ZSwgaW5EYXRhLCBjb3B5KTsKLSAgICAgICAgICAgIG1JbnB1dFNpemUgKz0gY29weTsKLQotICAgICAgICAgICAgaW5IZWFkZXItPm5PZmZzZXQgKz0gY29weTsKLSAgICAgICAgICAgIGluSGVhZGVyLT5uRmlsbGVkTGVuIC09IGNvcHk7Ci0KLSAgICAgICAgICAgIC8vICJUaW1lIiBvbiB0aGUgaW5wdXQgYnVmZmVyIGhhcyBpbiBlZmZlY3QgYWR2YW5jZWQgYnkgdGhlCi0gICAgICAgICAgICAvLyBudW1iZXIgb2YgYXVkaW8gZnJhbWVzIHdlIGp1c3QgYWR2YW5jZWQgbk9mZnNldCBieS4KLSAgICAgICAgICAgIGluSGVhZGVyLT5uVGltZVN0YW1wICs9Ci0gICAgICAgICAgICAgICAgKGNvcHkgKiAxMDAwMDAwbGwgLyBrU2FtcGxlUmF0ZSkgLyBzaXplb2YoaW50MTZfdCk7Ci0KLSAgICAgICAgICAgIGlmIChpbkhlYWRlci0+bkZpbGxlZExlbiA9PSAwKSB7Ci0gICAgICAgICAgICAgICAgaWYgKGluSGVhZGVyLT5uRmxhZ3MgJiBPTVhfQlVGRkVSRkxBR19FT1MpIHsKLSAgICAgICAgICAgICAgICAgICAgQUxPR1YoInNhdyBpbnB1dCBFT1MiKTsKLSAgICAgICAgICAgICAgICAgICAgbVNhd0lucHV0RU9TID0gdHJ1ZTsKLQotICAgICAgICAgICAgICAgICAgICAvLyBQYWQgYW55IHJlbWFpbmluZyBkYXRhIHdpdGggemVyb2VzLgotICAgICAgICAgICAgICAgICAgICBtZW1zZXQoKHVpbnQ4X3QgKiltSW5wdXRGcmFtZSArIG1JbnB1dFNpemUsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAwLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgbnVtQnl0ZXNQZXJJbnB1dEZyYW1lIC0gbUlucHV0U2l6ZSk7Ci0KLSAgICAgICAgICAgICAgICAgICAgbUlucHV0U2l6ZSA9IG51bUJ5dGVzUGVySW5wdXRGcmFtZTsKLSAgICAgICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgICAgICBpblF1ZXVlLmVyYXNlKGluUXVldWUuYmVnaW4oKSk7Ci0gICAgICAgICAgICAgICAgaW5JbmZvLT5tT3duZWRCeVVzID0gZmFsc2U7Ci0gICAgICAgICAgICAgICAgbm90aWZ5RW1wdHlCdWZmZXJEb25lKGluSGVhZGVyKTsKLQotICAgICAgICAgICAgICAgIGluRGF0YSA9IE5VTEw7Ci0gICAgICAgICAgICAgICAgaW5IZWFkZXIgPSBOVUxMOwotICAgICAgICAgICAgICAgIGluSW5mbyA9IE5VTEw7Ci0gICAgICAgICAgICB9Ci0gICAgICAgIH0KLQotICAgICAgICAvLyBBdCB0aGlzICBwb2ludCB3ZSBoYXZlIGFsbCB0aGUgaW5wdXQgZGF0YSBuZWNlc3NhcnkgdG8gZW5jb2RlCi0gICAgICAgIC8vIGEgc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B2ZXJzaW9uIG9mIHNwX2VuYy5jICovCi0gICAgZW5jX2luaXRfc3RhdHVzID0gU3BlZWNoX0VuY29kZV9GcmFtZV9pbml0KHNwZWVjaF9lbmNvZGVfZnJhbWUsCi0gICAgICAgICAgICAgICAgICAgICAgZHR4X2VuYWJsZSwKLSAgICAgICAgICAgICAgICAgICAgICAoV29yZDgqKSJlbmNvZGVyIik7Ci0KLSAgICAvKiBJbml0aWFsaXplIFNJRCBzeW5jaHJvbml6YXRpb24gKi8KLSAgICBzaWRfc3luY19pbml0X3N0YXR1cyA9IHNpZF9zeW5jX2luaXQoc2lkX3N5bmNfc3RhdGUpOwotCi0jZWxzZQotICAgIC8qIFVzZSBQViB2ZXJzaW9uIG9mIHNwX2VuYy5jICovCi0gICAgZW5jX2luaXRfc3RhdHVzID0gR1NNSW5pdEVuY29kZShwRW5jU3RydWN0dXJlLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZHR4X2VuYWJsZSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChXb3JkOCopImVuY29kZXIiKTsKLQotICAgIC8qIEluaXRpYWxpemUgU0lEIHN5bmNocm9uaXphdGlvbiAqLwotICAgIHNpZF9zeW5jX2luaXRfc3RhdHVzID0gc2lkX3N5bmNfaW5pdChwU2lkU3luY1N0cnVjdHVyZSk7Ci0KLQotI2VuZGlmCi0KLSAgICBpZiAoKGVuY19pbml0X3N0YXR1cyAhPSAwKSB8fCAoc2lkX3N5bmNfaW5pdF9zdGF0dXMgIT0gMCkpCi0gICAgewotICAgICAgICBpbml0X3N0YXR1cyA9IC0xOwotICAgIH0KLQotICAgIHJldHVybihpbml0X3N0YXR1cyk7Ci19Ci0KLQotLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0KLS8qCi0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0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i0gICAgICAgICBDQUxMIGV0c190b19pZjIoIGZyYW1lX3R5cGVfM2dwcCA9ICpwM2dwcF9mcmFtZV90eXBlLAotICAgICAgICAgICAgICAgICAgICAgICAgICBldHNfaW5wdXRfcHRyID0gJmV0c19vdXRwdXRfYmZyWzBdLAotICAgICAgICAgICAgICAgICAgICAgICAgICBpZjJfb3V0cHV0X3B0ciA9IHBFbmNPdXRwdXQgICAgICAgICApCi0gICAgICAgICAgIE1PRElGWUlORyhub3RoaW5nKQotICAgICAgICAgICBSRVRVUk5JTkcobm90aGluZykKLQotICAgICAgICAgLy8gU2V0IHVwIHRoZSBudW1iZXIgb2YgZW5jb2RlZCBJRjIgYnl0ZXMKLSAgICAgICAgIG51bV9lbmNfYnl0ZXMgPSBJZjJFbmNCeXRlc1BlckZyYW1lWyhpbnQpICpwM2dwcF9mcmFtZV90eXBlXQotCi0gICAgIEVORElGCi0KLSBFTFNFSUYgKG91dHB1dF9mb3JtYXQgPSBBTVJfVFhfRVRTKQotIFRIRU4KLSAgICAgLy8gRW5jb2RlIG9uZSBzcGVlY2ggZnJhbWUgKDIwIG1zKQotICAgICBDQUxMIEdTTUVuY29kZUZyYW1lKCBzdGF0ZV9kYXRhID0gcEVuY1N0YXRlLAotICAgICAgICAgICAgICAgICAgICAgICAgICBtb2RlID0gbW9kZSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgbmV3X3NwZWVjaCA9IHBFbmNJbnB1dCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgc2VyaWFsID0gJmV0c19vdXRwdXRfYmZyWzFdLAotICAgICAgICAgICAgICAgICAgICAgICAgICB1c2VkTW9kZSA9ICZ1c2VkTW9kZSApCi0gICAgICAgTU9ESUZZSU5HKG5vdGhpbmcpCi0gICAgICAgUkVUVVJOSU5HKHJldHVybl92YWx1ZSA9IDApCi0KLSAgICAgLy8gU2F2ZSB1c2VkIG1vZGUKLSAgICAgKnAzZ3BwX2ZyYW1lX3R5cGUgPSAoZW51bSBGcmFt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dHB1dCBidWZmZXIgKi8KLSAgICAgICAgICAgICAgICBpZiAodHhfZnJhbWVfdHlwZSA9PSBUWF9TSURfRklSU1QpCi0gICAgICAgICAgICAgICAgewotICAgICAgICAgICAgICAgICAgICBldHNfb3V0cHV0X2JmcltBTVJTSURfVFhUWVBFX0JJVF9PRkZTRVRdICY9IDB4MDAwMDsKLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgZWxzZSBpZiAodHhfZnJhbWVfdHlwZSA9PSBUWF9TSURfVVBEQVRFKQotICAgICAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAgICAgZXRzX291dHB1dF9iZnJbQU1SU0lEX1RYVFlQRV9CSVRfT0ZGU0VUXSB8PSAweDAwMDE7Ci0gICAgICAgICAgICAgICAgfQotCi0gICAgICAgICAgICAgICAgLyogQWRkIG1vZGUgaW5mb3JtYXRpb24gYml0cyAqLwotICAgICAgICAgICAgICAgIGZvciAoaSA9IDA7IGkgPCBOVU1fQU1SU0lEX1RYTU9ERV9CSVRTOyBpKyspCi0gICAgICAgICAgICAgICAgewotICAgICAgICAgICAgICAgICAgICBldHNfb3V0cHV0X2JmcltBTVJTSURfVFhNT0RFX0JJVF9PRkZTRVQraV0gPQotICAgICAgICAgICAgICAgICAgICAgICAgKG1vZGUgPj4gaSkgJiAweDAwMDE7Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgfQotICAgICAgICB9Ci0gICAgICAgIGVsc2UKLSAgICAgICAgewotICAgICAgICAgICAgLyogVGhpcyBpcyBubyBkYXRhIHRvIHRyYW5zbWl0ICovCi0gICAgICAgICAgICAqcDNncHBfZnJhbWVfdHlwZSA9IChlbnVtIEZyYW1lX1R5cGVfM0dQUClBTVJfTk9fREFUQTsKLSAgICAgICAgfQotCi0gICAgICAgIC8qIEF0IHRoaXMgcG9pbnQsIG91dHB1dCBmb3JtYXQgaXMgRVRTICovCi0gICAgICAgIC8qIERldGVybWluZSB0aGUgb3V0cHV0IGZvcm1h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0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tCi0qLwotCi1Xb3JkMTYgQXV0b2NvcnIoCi0gICAgV29yZDE2IHhbXSwgICAgICAgICAgICAvKiAoaSkgICAgOiBJbnB1dCBzaWduYWwgKExfV0lORE9XKSAgICAgICAgICAgICovCi0gICAgV29yZDE2IG0sICAgICAgICAgICAgICAvKiAoaSkgICAgOiBMUEMgb3JkZXIgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0gICAgV29yZDE2IHJfaFtdLCAgICAgICAgICAvKiAobykgICAgOiBBdXRvY29ycmVsYXRpb25zICAobXNiKSAgICAgICAgICAgICovCi0gICAgV29yZDE2IHJfbFtdLCAgICAgICAgICAvKiAobykgICAgOiBBdXRvY29ycmVsYXRpb25zICAobHNiKSAgICAgICAgICAgICovCi0gICAgY29uc3QgV29yZDE2IHdpbmRbXSwgICAvKiAoaSkgICAgOiB3aW5kb3cgZm9yIExQQyBhbmFseXNpcyAoTF9XSU5ET1cpICovCi0gICAgRmxhZyAgKnBPdmVyZmxvdyAgICAgICAvKiAobykgICAgOiBpbmRpY2F0ZXMgb3ZlcmZsb3cgICAgICAgICAgICAgICAgICovCi0pCi17Ci0gICAgcmVnaXN0ZXIgV29yZDE2IGk7Ci0gICAgcmVnaXN0ZXIgV29yZDE2IGo7Ci0gICAgcmVnaXN0ZXIgV29yZDE2IG5vcm07Ci0KLSAgICBXb3JkMTYgeVtMX1dJTkRPV107Ci0gICAgV29yZDMyIHN1bTsKLSAgICBXb3JkMTYgb3ZlcmZsX3NoZnQ7Ci0KLQotICAgIC8qIEFkZGVkIGZvciBvcHRpbWl6YXRpb24gICovCi0KLQotICAgIFdvcmQxNiB0ZW1wOwotICAgIFdvcmQxNiAqcF94OwotICAgIFdvcmQxNiAqcF95OwotICAgIFdvcmQxNiAqcF95XzE7Ci0gICAgV29yZDE2ICpwX3lfcmVmOwotICAgIFdvcmQxNiAqcF9yaDsKLSAgICBXb3JkMTYgKnBfcmw7Ci0gICAgY29uc3QgV29yZDE2ICpwX3dpbmQ7Ci0gICAgcF95ID0geTsKLSAgICBwX3ggPSB4OwotICAgIHBfd2luZCA9IHdpbmQ7Ci0gICAgLyoKLSAgICAgKiAgV2luZG93aW5nIG9mIHRoZSBzaWduYWwKLSAgICAgKi8KLQotICAgIE9TQ0xfVU5VU0VEX0FSRyhwT3ZlcmZsb3cpOwotCi0gICAgc3VtID0gMEw7Ci0gICAgaiA9IDA7Ci0KLSAgICBmb3IgKGkgPSBMX1dJTkRPVzsgaSAhPSAwOyBpLS0pCi0gICAgewotICAgICAgICB0ZW1wID0gKGFtcm5iX2Z4cF9tYWNfMTZfYnlfMTZiYigoV29yZDMyKSAqIChwX3grKyksIChXb3JkMzIpICogKHBfd2luZCsrKSwgMHgwNDAwMCkpID4+IDE1OwotICAgICAgICAqKHBfeSsrKSA9IHRlbXA7Ci0KLSAgICAgICAgc3VtICs9ICgoV29yZDMyKXRlbXAgKiB0ZW1wKSA8PCAxOwotICAgICAgICBpZiAoc3VtIDwgMCkKLSAgICAgICAgewotICAgICAgICAgICAgLyoKLSAgICAgICAgICAgICAqIGlmIG92ZWZsb3cgZXhpc3QsIHRoZW4gc3RvcCBhY2N1bXVsYXRpb24KLSAgICAgICAgICAgICAqLwotICAgICAgICAgICAgaiA9IDE7Ci0gICAgICAgICAgICBicmVhazsKLSAgICAgICAgfQotCi0gICAgfQotICAgIC8qCi0gICAgICogaWYgb3ZlZmxvdyBleGlzdGVkLCBjb21wbGV0ZSAgd2luZG93aW5nIG9wZXJhdGlvbgotICAgICAqIHdpdGhvdXQgY29tcHV0aW5nIGVuZXJneQotICAgICAqLwotCi0gICAgaWYgKGopCi0gICAgewotICAgICAgICBwX3kgPSAmeVtMX1dJTkRPVy1pXTsKLSAgICAgICAgcF94ID0gJnhbTF9XSU5ET1ctaV07Ci0gICAgICAgIHBfd2luZCA9ICZ3aW5kW0xfV0lORE9XLWldOwotCi0gICAgICAgIGZvciAoOyBpICE9IDA7IGktLSkKLSAgICAgICAgewotICAgICAgICAgICAgdGVtcCA9IChhbXJuYl9meHBfbWFjXzE2X2J5XzE2YmIoKFdvcmQzMikgKiAocF94KyspLCAoV29yZDMyKSAqIChwX3dpbmQrKyksIDB4MDQwMDApKSA+PiAxNTsKLSAgICAgICAgICAgICoocF95KyspID0gdGVtcDsKLSAgICAgICAgfQotICAgIH0KLQotCi0gICAgLyoKLSAgICAgKiAgQ29tcHV0ZSByWzBdIGFuZCB0ZXN0IGZvciBvdmVyZmxvdwotICAgICAqLwotCi0gICAgb3ZlcmZsX3NoZnQgPSAwOwotCi0gICAgLyoKLSAgICAgKiBzY2FsZSBkb3duIGJ5IDEvNCBvbmx5IHdoZW4gbmVlZGVkCi0gICAgICovCi0gICAgd2hpbGUgKGogPT0gMSkKLSAgICB7Ci0gICAgICAgIC8qIElmIG92ZXJmbG93IGRpdmlkZSB5W10gYnkgNCAgICAgICAgICAqLwotICAgICAgICAvKiBGWUk6IEZvciBiZXR0ZXIgcmVzb2x1dGlvbiwgd2UgY291bGQgKi8KLSAgICAgICAgLyogICAgICBkaXZpZGUgeVtdIGJ5IDIgICAgICAgICAgICAgICAgICovCi0gICAgICAgIG92ZXJmbF9zaGZ0ICs9IDQ7Ci0gICAgICAgIHBfeSAgID0gJnlbMF07Ci0gICAgICAgIHN1bSA9IDBMOwotCi0gICAgICAgIGZvciAoaSA9IChMX1dJTkRPVyA+PiAxKTsgaSAhPSAwIDsgaS0tKQotICAgICAgICB7Ci0gICAgICAgICAgICB0ZW1wID0gKnBfeSA+PiAyOwotICAgICAgICAgICAgKihwX3krKykgPSB0ZW1wOwotICAgICAgICAgICAgc3VtICs9ICgoV29yZDMyKXRlbXAgKiB0ZW1wKSA8PCAxOwotICAgICAgICAgICAgdGVtcCA9ICpwX3kgPj4gMjsKLSAgICAgICAgICAgICoocF95KyspID0gdGVtcDsKLSAgICAgICAgICAgIHN1bSArPSAoKFdvcmQzMil0ZW1wICogdGVtc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IGhbXSwgICAgICAgICAvLyAoaSkgIDogaW1wdWxzZSByZXNwb25zZSBvZiB3ZWlnaHRlZCBzeW50aGVzaXMgZmlsdGVyCi0gICAgV29yZDE2IHlbXSwgICAgICAgICAvLyAobykgIDogZmlsdGVyZWQgaW5ub3ZhdGl2ZSBjb2RlCi0gICAgV29yZDE2IGluZHhbXSAgICAgICAvLyAobykgIDogaW5kZXggb2YgMTAgcHVsc2VzIChzaWduK3Bvc2l0aW9uKQotKQotewotICAgIFdvcmQxNiBpLCBqLCBrLCB0cmFjaywgaW5kZXgsIF9zaWduW05CX1BVTFNFXTsKLSAgICBXb3JkMTYgKnAwLCAqcDEsICpwMiwgKnAzLCAqcDQsICpwNSwgKnA2LCAqcDcsICpwOCwgKnA5OwotICAgIFdvcmQzMiBzOwotCi0gICAgZm9yIChpID0gMDsgaSA8IExfQ09ERTsgaSsrKQotICAgIHsKLSAgICAgICAgY29kW2ldID0gMDsKLSAgICB9Ci0gICAgZm9yIChpID0gMDsgaSA8IE5CX1RSQUNLOyBpKyspCi0gICAgewotICAgICAgICBpbmR4W2ldID0gLTE7Ci0gICAgfQotCi0gICAgZm9yIChrID0gMDsgayA8IE5CX1BVTFNFOyBrKyspCi0gICAgewotICAgICAgICAvLyByZWFkIHB1bHNlIHBvc2l0aW9uCi0gICAgICAgIGkgPSBjb2R2ZWNba107Ci0gICAgICAgIC8vIHJlYWQgc2lnbgotICAgICAgICBqID0gc2lnbltpXTsKLQotICAgICAgICBpbmRleCA9IG11bHQgKGksIDY1NTQpOyAgICAgICAgICAgICAgICAgIC8vIGluZGV4ID0gcG9zLzUKLSAgICAgICAgLy8gdHJhY2sgPSBwb3MlNQotICAgICAgICB0cmFjayA9IHN1YiAoaSwgZXh0cmFjdF9sIChMX3NociAoTF9tdWx0IChpbmRleCwgNSksIDEpKSk7Ci0KLSAgICAgICAgaWYgKGogPiAwKQotICAgICAgICB7Ci0gICAgICAgICAgICBjb2RbaV0gPSBhZGQgKGNvZFtpXSwgNDA5Nik7Ci0gICAgICAgICAgICBfc2lnbltrXSA9IDgxOTI7Ci0KLSAgICAgICAgfQotICAgICAgICBlbHNlCi0gICAgICAgIHsKLSAgICAgICAgICAgIGNvZFtpXSA9IHN1YiAoY29kW2ldLCA0MDk2KTsKLSAgICAgICAgICAgIF9zaWduW2tdID0gLTgxOTI7Ci0gICAgICAgICAgICBpbmRleCA9IGFkZCAoaW5kZXgsIDgpOwotICAgICAgICB9Ci0KLSAgICAgICAgaWYgKGluZHhbdHJhY2tdIDwgMCkKLSAgICAgICAgewotICAgICAgICAgICAgaW5keFt0cmFja10gPSBpbmRleDsKLSAgICAgICAgfQotICAgICAgICBlbHNlCi0gICAgICAgIHsKLSAgICAgICAgICAgIGlmICgoKGluZGV4IF4gaW5keFt0cmFja10pICYgOCkgPT0gMCkKLSAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAvLyBzaWduIG9mIDFzdCBwdWxzZSA9PSBzaWduIG9mIDJuZCBwdWxzZQotCi0gICAgICAgICAgICAgICAgaWYgKHN1YiAoaW5keFt0cmFja10sIGluZGV4KSA8PSAwKQotICAgICAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAgICAgaW5keFt0cmFjayArIDVdID0gaW5kZXg7Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgIGVsc2UKLSAgICAgICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgICAgIGluZHhbdHJhY2sgKyA1XSA9IGluZHhbdHJhY2tdOwotICAgICAgICAgICAgICAgICAgICBpbmR4W3RyYWNrXSA9IGluZGV4OwotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgIH0KLSAgICAgICAgICAgIGVsc2UKLSAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAvLyBzaWduIG9mIDFzdCBwdWxzZSAhPSBzaWduIG9mIDJuZCBwdWxzZQotCi0gICAgICAgICAgICAgICAgaWYgKHN1YiAoKFdvcmQxNikoaW5keFt0cmFja10gJiA3KSwgKFdvcmQxNikoaW5kZXggJiA3KSkgPD0gMCkKLSAgICAgICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgICAgIGluZHhbdHJhY2sgKyA1XSA9IGluZHhbdHJhY2tdOwotICAgICAgICAgICAgICAgICAgICBpbmR4W3RyYWNrXSA9IGluZGV4OwotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICBlbHNlCi0gICAgICAgICAgICAgICAgewotICAgICAgICAgICAgICAgICAgICBpbmR4W3RyYWNrICsgNV0gPSBpbmRleDsKLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICB9Ci0gICAgICAgIH0KLSAgICB9Ci0KLSAgICBwMCA9IGggLSBjb2R2ZWNbMF07Ci0gICAgcDEgPSBoIC0gY29kdmVjWzFdOwotICAgIHAyID0gaCAtIGNvZHZlY1syXTsKLSAgICBwMyA9IGggLSBjb2R2ZWNbM107Ci0gICAgcDQgPSBoIC0gY29kdmVjWzRdOwotICAgIHA1ID0gaCAtIGNvZHZlY1s1XTsKLSAgICBwNiA9IGggLSBjb2R2ZWNbNl07Ci0gICAgcDcgPSBoIC0gY29kdmVjWzddOwotICAgIHA4ID0gaCAtIGNvZHZlY1s4XTsKLSAgICBwOSA9IGggLSBjb2R2ZWNbOV07Ci0KLSAgICBmb3IgKGkgPSAwOyBpIDwgTF9DT0RFOyBpKyspCi0gICAgewotICAgICAgICBzID0gMDsKLSAgICAgICAgcyA9IExfbWFjIChzLCAqcDArKywgX3NpZ25bMF0pOwotICAgICAgICBzID0gTF9tYWMgKHMsICpwMSsrLCBfc2lnblsxXSk7Ci0gICAgICAgIHMgPSBMX21hYyAocywgKnAyKyssIF9zaWduWzJdKTsKLSAgICAgICAgcyA9IExfbWFjIChzLCAqcDMrKywgX3NpZ25bM10pOwotICAgICAgICBzID0gTF9tYWMgKHMsICpwNCsrLCBfc2lnbls0XSk7Ci0gICAgICAgIHMgPSBMX21hYyAocywgKnA1KyssIF9zaWduWzVdKTsKLSAgICAgICA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gIC8qIChvKSAgOiBpbmRleCBvZiAxMCBwdWxzZXMgKHNpZ24rcG9zaXRpb24pICAgICAgICAqLwotICAgIEZsYWcgICAqcE92ZXJmbG93ICAgLyogaS9vICA6IG92ZXJmbG93IEZsYWcgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0pCi17Ci0gICAgV29yZDE2IGksIGssIHRyYWNrLCBpbmRleCwgX3NpZ25bTkJfUFVMU0VdOwotICAgIFdvcmQxNiAqcDAsICpwMSwgKnAyLCAqcDMsICpwNCwgKnA1LCAqcDYsICpwNywgKnA4LCAqcDk7Ci0gICAgV29yZDMyIHM7Ci0gICAgV29yZDE2IHRlbXA7Ci0gICAgV29yZDE2ICpwX19zaWduOwotICAgIFdvcmQxNiAqcF95OwotICAgIFdvcmQxNiAqcF9jb2R2ZWM7Ci0KLSAgICBPU0NMX1VOVVNFRF9BUkcocE92ZXJmbG93KTsKLQotICAgIG1lbXNldChjb2QsIDAsIExfQ09ERSpzaXplb2YoKmNvZCkpOwotICAgIG1lbXNldChpbmR4LCAweEZGLCBOQl9UUkFDSypzaXplb2YoKmluZHgpKTsKLQotICAgIHBfX3NpZ24gPSBfc2lnbjsKLQotICAgIHAwID0gJmNvZHZlY1swXTsKLQotICAgIGZvciAoayA9IDA7IGsgPCBOQl9QVUxTRTsgaysrKQotICAgIHsKLSAgICAgICAgLyogcmVhZCBwdWxzZSBwb3NpdGlvbiAqLwotICAgICAgICBpID0gKihwMCsrKTsKLSAgICAgICAgLyogcmVhZCBzaWduICAgICAgICAgICAqLwotCi0gICAgICAgIGluZGV4ID0gKChXb3JkMzIpaSAqIDY1NTQpID4+IDE1OyAgICAgICAvKiBpbmRleCA9IHBvcy81ICAgICovCi0KLSAgICAgICAgLyogdHJhY2sgPSBwb3MlNSAqLwotICAgICAgICAvKiB0cmFjayA9IHN1YiAoaSwgZXh0cmFjdF9sIChMX3NociAoTF9tdWx0IChpbmRleCwgNSksIDEpKSk7ICovCi0gICAgICAgIHRyYWNrID0gaSAtIChpbmRleCAqIDUpOwotCi0gICAgICAgIGlmIChzaWduW2ldID4gMCkKLSAgICAgICAgewotICAgICAgICAgICAgY29kW2ldICs9ICA0MDk2OwotICAgICAgICAgICAgKihwX19zaWduKyspID0gODE5MjsKLQotICAgICAgICB9Ci0gICAgICAgIGVsc2UKLSAgICAgICAgewotICAgICAgICAgICAgY29kW2ldIC09ICA0MDk2OwotICAgICAgICAgICAgKihwX19zaWduKyspID0gLTgxOTI7Ci0gICAgICAgICAgICAvKiBpbmRleCA9IGFkZCAoaW5kZXgsIDgpOyAqLwotICAgICAgICAgICAgaW5kZXggKz0gODsKLSAgICAgICAgfQotCi0gICAgICAgIHAxID0gJmluZHhbdHJhY2tdOwotCi0gICAgICAgIHRlbXAgPSAqcDE7Ci0KLSAgICAgICAgaWYgKHRlbXAgPCAwKQotICAgICAgICB7Ci0gICAgICAgICAgICAqcDEgPSBpbmRleDsKLSAgICAgICAgfQotICAgICAgICBlbHNlCi0gICAgICAgIHsKLSAgICAgICAgICAgIGlmICgoKGluZGV4IF4gdGVtcCkgJiA4KSA9PSAwKQotICAgICAgICAgICAgewotICAgICAgICAgICAgICAgIC8qIHNpZ24gb2YgMXN0IHB1bHNlID09IHNpZ24gb2YgMm5kIHB1bHNlICovCi0KLSAgICAgICAgICAgICAgICAvKiBpZiAoc3ViIChpbmR4W3RyYWNrXSwgaW5kZXgpIDw9IDApICovCi0gICAgICAgICAgICAgICAgaWYgKHRlbXAgPD0gaW5kZXgpCi0gICAgICAgICAgICAgICAgewotICAgICAgICAgICAgICAgICAgICAqKHAxICsgNSkgPSBpbmRleDsKLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgZWxzZQotICAgICAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAgICAgKihwMSArIDUpID0gdGVtcDsKLSAgICAgICAgICAgICAgICAgICAgKnAxID0gaW5kZXg7Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgfQotICAgICAgICAgICAgZWxzZQotICAgICAgICAgICAgewotICAgICAgICAgICAgICAgIC8qIHNpZ24gb2YgMXN0IHB1bHNlICE9IHNpZ24gb2YgMm5kIHB1bHNlICovCi0KLSAgICAgICAgICAgICAgICAvKiBpZiAoc3ViICgoV29yZDE2KShpbmR4W3RyYWNrXSAmIDcpLCAoV29yZDE2KShpbmRleCAmIDcpKSA8PSAwKSAqLwotICAgICAgICAgICAgICAgIGlmICgodGVtcCAmIDcpIDw9IChpbmRleCAmIDcpKQotICAgICAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAgICAgKihwMSArIDUpID0gdGVtcDsKLSAgICAgICAgICAgICAgICAgICAgKnAxID0gaW5kZXg7Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgIGVsc2UKLSAgICAgICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgICAgICoocDEgKyA1KSA9IGluZGV4OwotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgIH0KLSAgICAgICAgfQotICAgIH0KLQotICAgIHBfY29kdmVjID0gJmNvZHZlY1swXTsKLQotICAgIHAwID0gaCAtICoocF9jb2R2ZWMrKyk7Ci0gICAgcDEgPSBoIC0gKihwX2NvZHZlYysrKTsKLSAgICBwMiA9IGggLSAqKHBfY29kdmVjKyspOwotICAgIHAzID0gaCAtICoocF9jb2R2ZWMrKyk7Ci0gICAgcDQgPSBoIC0gKihwX2NvZHZlYysrKTsKLSAgICBwNSA9IGggLSAqKHBfY29kdmVjKyspOwotICAgIHA2ID0gaCAtICoocF9jb2R2ZWMrKyk7Ci0gICAgcDcgPSBoIC0gKihwX2NvZHZlYysrKTsKLSAgICBwOCA9IGggLSAqKHBfY29kdmVjKyspOwotICAgIHA5ID0gaCAtICoocF9jb2R2ZWMrKyk7Ci0KLSAgICBwX3kgPSB5OwotCi0gICAgZm9yIChpID0gTF9DT0RFOyBpICE9IDA7IGktLSkKLSAgICB7Ci0gICAgICAgIHBfX3NpZ24gPSBfc2lnbjsKLQ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HRlZCBzeW50aGVzaXMgZmlsdGVyCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgIGhbLUxfc3ViZnIuLi0xXSBtdXN0IGJlIHNldCB0byB6ZXJvICAgICAgICAgICAgKi8KLSAgICBXb3JkMTYgY29kW10sICAgLyogKG8pICAgOiBhbGdlYnJhaWMgKGZpeGVkKSBjb2RlYm9vayBleGNpdGF0aW9uICAgICAgICAqLwotICAgIFdvcmQxNiB5W10sICAgICAvKiAobykgICA6IGZpbHRlcmVkIGZpeGVkIGNvZGVib29rIGV4Y2l0YXRpb24gICAgICAgICAgICovCi0gICAgV29yZDE2IGluZHhbXSwgIC8qIChvKSAgIDogaW5kZXggb2YgMTAgcHVsc2VzIChzaWduICsgcG9zaXRpb24pICAgICAgICAgKi8KLSAgICBGbGFnICpwT3ZlcmZsb3cgLyogKGkvbykgOiBvdmVyZmxvdyBGbGFnICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotKQotewotICAgIFdvcmQxNiBpcG9zW05CX1BVTFNFXSwgcG9zX21heFtOQl9UUkFDS10sIGNvZHZlY1tOQl9QVUxTRV07Ci0gICAgV29yZDE2IGRuW0xfQ09ERV0sIHNpZ25bTF9DT0RFXTsKLSAgICBXb3JkMTYgcnJbTF9DT0RFXVtMX0NPREVdLCBpOwotCi0gICAgY29yX2hfeChoLCB4LCBkbiwgMiwgcE92ZXJmbG93KTsKLSAgICBzZXRfc2lnbjEyazIoZG4sIGNuLCBzaWduLCBwb3NfbWF4LCBOQl9UUkFDSywgaXBvcywgU1RFUCwgcE92ZXJmbG93KTsKLSAgICBjb3JfaChoLCBzaWduLCByciwgcE92ZXJmbG93KTsKLQotICAgIHNlYXJjaF8xMGFuZDhpNDAoTkJfUFVMU0UsIFNURVAsIE5CX1RSQUNLLAotICAgICAgICAgICAgICAgICAgICAgZG4sIHJyLCBpcG9zLCBwb3NfbWF4LCBjb2R2ZWMsIHBPdmVyZmxvdyk7Ci0KLSAgICBidWlsZF9jb2RlKG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KAotICAgIFdvcmQxNiBkbltdLCAgICAgICAgLyogaSA6IGNvcnJlbGF0aW9uIGJldHdlZW4gdGFyZ2V0IGFuZCBoW10gICAgICAgICAgICAqLwotICAgIFdvcmQxNiBycltdW0xfQ09ERV0sLyogaSA6IG1hdHJpeCBvZiBhdXRvY29ycmVsYXRpb24gICAgICAgICAgICAgICAgICAgICAqLwotICAgIFdvcmQxNiBjb2R2ZWNbXSwgICAgLyogbyA6IGFsZ2VicmFpYyBjb2RlYm9vayB2ZWN0b3IgICAgICAgICAgICAgICAgICAgICAqLwotICAgIEZsYWcgICAqIHBPdmVyZmxvdwotKTsKLQotc3RhdGljIFdvcmQxNiBidWlsZF9jb2RlKAotICAgIFdvcmQxNiBjb2R2ZWNbXSwgICAgLyogaSA6IGFsZ2VicmFpYyBjb2RlYm9vayB2ZWN0b3IgICAgICAgICAgICAgICAgICAgICAqLwotICAgIFdvcmQxNiBkbl9zaWduW10sICAgLyogaSA6IHNpZ24gb2YgZG5bXSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotICAgIFdvcmQxNiBjb2RbXSwgICAgICAgLyogbyA6IGFsZ2VicmFpYyAoZml4ZWQpIGNvZGVib29rIGV4Y2l0YXRpb24gICAgICAgICAqLwotICAgIFdvcmQxNiBoW10sICAgICAgICAgLyogaSA6IGltcHVsc2UgcmVzcG9uc2Ugb2Ygd2VpZ2h0ZWQgc3ludGhlc2lzIGZpbHRlciAqLwotICAgIFdvcmQxNiB5W10sICAgICAgICAgLyogbyA6IGZpbHRlcmVkIGZpeGVkIGNvZGVib29rIGV4Y2l0YXRpb24gICAgICAgICAgICAqLwotICAgIFdvcmQxNiBzaWduW10sICAgICAgLyogbyA6IHNpZ24gb2YgMiBwdWxzZXMgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotICAgIEZsYWcgICAqIHBPdmVyZmxvdwotKTsKLQotLyotLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tL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ciAqLwotICAgIC8qICAgICBoWy1MX3N1YmZyLi4tMV0gbXVzdCBiZSBzZXQgdG8gemVyby4gICAgICAgICAgKi8KLSAgICBXb3JkMTYgVDAsICAgICAgICAgIC8qIGkgOiBQaXRjaCBsYWcgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLSAgICBXb3JkMTYgcGl0Y2hfc2hhcnAsIC8qIGkgOiBMYXN0IHF1YW50aXplZCBwaXRjaCBnYWluICAgICAgICAgICAgICAgICAgICAgKi8KLSAgICBXb3JkMTYgY29kZVtdLCAgICAgIC8qIG8gOiBJbm5vdmF0aXZlIGNvZGVib29rICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLSAgICBXb3JkMTYgeVtdLCAgICAgICAgIC8qIG8gOiBmaWx0ZXJlZCBmaXhlZCBjb2RlYm9vayBleGNpdGF0aW9uICAgICAgICAgICAgKi8KLSAgICBXb3JkMTYgKiBzaWduLCAgICAgIC8qIG8gOiBTaWducyBvZiAyIHB1bHNlcyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLSAgICBGbGFnICAgKiBwT3ZlcmZsb3cgIC8qIG8gOiBGbGFnIHNldCB3aGVuIG92ZXJmbG93IG9jY3VycyAgICAgICAgICAgICAgICAgKi8KLSkKLXsKLSAgICBXb3JkMTYgY29kdmVjW05CX1BVTFNFXTsKLSAgICBXb3JkMTYgZG5bTF9DT0RFXTsKLSAgICBXb3JkMTYgZG4yW0xfQ09ERV07Ci0gICAgV29yZDE2IGRuX3NpZ25bTF9DT0RFXTsKLQotICAgIFdvcmQxNiBycltMX0NPREVdW0xfQ09ERV07Ci0KLSAgICBXb3JkMTYgaTsKLSAgICBXb3JkMTYgaW5kZXg7Ci0gICAgV29yZDE2IHNoYXJwOwotICAgIFdvcmQxNiB0ZW1wV29yZDsKLQotICAgIHNoYXJwID0gcGl0Y2hfc2hhcnAgPDwgMTsKLQotICAgIGlmIChUMCA8IExfQ09ERSkKLSAgICB7Ci0gICAgICAgIGZvciAoaSA9IFQwOyBpIDwgTF9DT0RFOyBpKyspCi0gICAgICAgIHsKLSAgICAgICAgICAgIHRlbXBXb3JkID0KLSAgICAgICAgICAgICAgICBtdWx0KAotICAgICAgICAgICAgICAgICAgICBoW2kgLSBUMF0sCi0gICAgICAgICAgICAgICAgICAgIHNoYXJwLAotICAgICAgICAgICAgICAgICAgICBwT3ZlcmZsb3cpOwotCi0gICAgICAgICAgICBoW2ldID0KLSAgICAgICAgICAgICAgICBhZGQoCi0gICAgICAgICAgICAgICAgICAgIGhbaV0sCi0gICAgICAgICAgICAgICAgICAgIHRlbXBXb3JkLAotICAgICAgICAgICAgICAgICAgICBwT3ZlcmZsb3cpOwotICAgICAgICB9Ci0KLSAgICB9Ci0KLSAgICBjb3JfaF94KAotICAgICAgICBoLAotICAgICAgICB4LAotICAgICAgICBkbiwKLSAgICAgICAgMSwKLSAgICAgICAgcE92ZXJmbG93KTsKLQotICAgIHNldF9zaWduKAotICAgICAgICBkbiwKLSAgICAgICAgZG5fc2lnbiwKLSAgICAgICAgZG4yLAotICAgICAgICA4KTsgLyogZG4yW10gbm90IHVzZWQgaW4gdGhpcyBjb2RlYm9vayBzZWFyY2ggKi8KLQotICAgIGNvcl9oKAotICAgICAgICBoLAotICAgICAgICBkbl9zaWduLAotICAgICAgICByciwKLSAgICAgICAgcE92ZXJmbG93KTsKLQotICAgIHNlYXJjaF8yaTQwKAotICAgICAgICBkbiwKLSAgICAgICAgcnIsCi0gICAgICAgIGNvZHZlYywKLSAgICAgICAgcE92ZXJmbG93KTsKLQotICAgIC8qIGZ1bmN0aW9uIHJlc3VsdCAqLwotCi0gICAgaW5kZXggPQotICAgICAgICBidWlsZF9jb2RlKAotICAgICAgICAgICAgY29kdmVjLAotICAgICAgICAgICAgZG5fc2lnbiwKLSAgICAgICAgICAgIGNvZGUsCi0gICAgICAgICAgICBoLAotICAgICAgICAgICAgeSwKLSAgICAgICAgICAgIHNpZ24sCi0gICAgICAgICAgICBwT3ZlcmZsb3cpOwotCi0gICAgLyoKLSAgICAqIENvbXB1dGUgaW5ub3ZhdGlvbiB2ZWN0b3IgZ2Fpbi4KLSAgICAqIEluY2x1ZGUgZml4ZWQtZ2FpbiBwaXRjaCBjb250cmlidXRpb24gaW50byBjb2RlW10uCi0gICAgKi8KLQotICAgIGlmIChUMCA8IExfQ09ERSkKLSAgICB7Ci0gICAgICAgIGZvciAoaSA9IFQwOyBpIDwgTF9DT0RFOyBpKyspCi0gICAgICAgIHsKLSAgICAgICAgICAgIHRlbXBXb3JkID0KLSAgICAgICAgICAgICAgICBtdWx0KAotICAgICAgICAgICAgICAgICAgICBjb2RlW2kgLSBUMF0sCi0gICAgICAgICAgICAgICAgICAgIHNoYXJwLAotICAgICAgICAgICAgICAgICAgICBwT3ZlcmZsb3cpOwotCi0gICAgICAgICAgICBjb2RlW2ldID0KLSAgICAgICAgICAgICAgICBhZGQoCi0gICAgICAgICAgICAgICAgICAgIGNvZGVbaV0sCi0gICAgICAgICAgICAgICAgICAgIHRlbXBXb3JkLAotICAgICAgICAgICAgICAgICAgICBwT3ZlcmZsb3cpOwotICAgICAgICB9Ci0gICAgfQotCi0gICAgcmV0dXJuIGluZGV4OwotfQotCi0vKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLQotCi0vKgotLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tCi0gRlVOQ1RJT04gTkFNRTogc2VhcmNoXzJpNDAKLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLQotIElOUFVUIEFORCBPVVRQVVQgREVGSU5JVElPTlMKLQotIElucHV0czoKLSAgICBkbiwgY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Ki0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0qLwotICAgICAgICAgICAgZm9yIChpMCA9IGlwb3NbMF07IGkwIDwgTF9DT0RFOyBpMCArPSBTVEVQKQotICAgICAgICAgICAgewotICAgICAgICAgICAgICAgIHBzMCA9IGRuW2kwXTsKLQotICAgICAgICAgICAgICAgIC8qIGFscDAgPSBMX211bHQocnJbaTBdW2kwXSwgXzFfNCwgcE92ZXJmbG93KTsgKi8KLSAgICAgICAgICAgICAgICBhbHAwID0gKFdvcmQzMikgcnJbaTBdW2kwXSA8PCAxNDsKLQotICAgICAgICAgICAgICAgIC8qLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSoKLSAgICAgICAgICAgICAgICAqIGkxIGxvb3A6IDggcG9zaXRpb25zLiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICoKLSAgICAgICAgICAgICAgICAqLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSovCi0KLSAgICAgICAgICAgICAgICBzcSA9IC0xOwotICAgICAgICAgICAgICAgIGFscCA9IDE7Ci0gICAgICAgICAgICAgICAgaXggPSBpcG9zWzFdOwotCi0gICAgICAgICAgICAgICAgLyotLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0qCi0gICAgICAgICAgICAgICAgKiBUaGVzZSBpbmRleCBoYXZlIGxvdyBjb21wbGV4aXR5IGFkZHJlc3MgY29tcHV0YXRpb24gYmVjYXVzZSAgICoKLSAgICAgICAgICAgICAgICAqIHRoZXkgYXJlLCBpbiBmYWN0LCBwb2ludGVycyB3aXRoIGZpeGVkIGluY3JlbWVudC4gRm9yIGV4YW1wbGUsKgotICAgICAgICAgICAgICAgICogInJyW2kwXVtpMl0iIGlzIGEgcG9pbnRlciBpbml0aWFsaXplZCB0byAiJnJyW2kwXVtpcG9zWzJdXSIgICAqCi0gICAgICAgICAgICAgICAgKiBhbmQgaW5jcmVtZW50ZWQgYnkgIlNURVAiLiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICoKLSAgICAgICAgICAgICAgICAqLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tKi8KLQotICAgICAgICAgICAgICAgIGZvciAoaTEgPSBpcG9zWzFdOyBpMSA8IExfQ09ERTsgaTEgKz0gU1RFUCkKLSAgICAgICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgICAgIC8qIGlkeCBpbmNyZW1lbnQgPSBTVEVQICovCi0gICAgICAgICAgICAgICAgICAgIHBzMSA9IGFkZChwczAsIGRuW2kxXSwgcE92ZXJmbG93KTsKLQotICAgICAgICAgICAgICAgICAgICAvKiBhbHAxID0gYWxwMCArIHJyW2kwXVtpMV0gKyAxLzIqcnJbaTFdW2kxXTsgKi8KLQotICAgICAgICAgICAgICAgICAgICAvKiBpZHggaW5jciA9IFNURVAgKi8KLSAgICAgICAgICAgICAgICAgICAgLyogYWxwMSA9IExfbWFjKGFscDAsIHJyW2kxXVtpMV0sIF8xXzQsIHBPdmVyZmxvdyk7ICovCi0gICAgICAgICAgICAgICAgICAgIGFscDEgPSBhbHAwICsgKChXb3JkMzIpIHJyW2kxXVtpMV0gPDwgMTQpOwotCi0gICAgICAgICAgICAgICAgICAgIC8qIGlkeCBpbmNyID0gU1RFUCAqLwotICAgICAgICAgICAgICAgICAgICAvKiBhbHAxID0gTF9tYWMoYWxwMSwgcnJbaTBdW2kxXSwgXzFfMiwgcE92ZXJmbG93KTsgKi8KLSAgICAgICAgICAgICAgICAgICAgYWxwMSArPSAoV29yZDMyKSBycltpMF1baTFdIDw8IDE1OwotCi0gICAgICAgICAgICAgICAgICAgIC8qIHNxMSA9IG11bHQocHMxLCBwczEsIHBPdmVyZmxvdyk7ICovCi0gICAgICAgICAgICAgICAgICAgIHNxMSA9IChXb3JkMTYpKCgoV29yZDMyKSBwczEgKiBwczEpID4+IDE1KTsKLQotICAgICAgICAgICAgICAgICAgICAvKiBhbHBfMTYgPSBwdl9yb3VuZChhbHAxLCBwT3ZlcmZsb3cpOyAqLwotICAgICAgICAgICAgICAgICAgICBhbHBfMTYgPSAoV29yZDE2KSgoYWxwMSArIChXb3JkMzIpIDB4MDAwMDgwMDBMKSA+PiAxNik7Ci0KLSAgICAgICAgICAgICAgICAgICAgLyogcyA9IExfbXVsdChhbHAsIHNxMSwgcE92ZXJmbG93KTsgKi8KLSAgICAgICAgICAgICAgICAgICAgcyA9ICgoV29yZDMyKSBhbHAgKiBzcTEpIDw8IDE7Ci0KLSAgICAgICAgICAgICAgICAgICAgLyogcyA9TF9tc3Uocywgc3EsIGFscF8xNiwgcE92ZXJmbG93KTsgKi8KLSAgICAgICAgICAgICAgICAgICAgcyAtPSAoKChXb3JkMzIpIHNxICogYWxwXzE2KSA8PCAxKTsKLQotICAgICAgICAgICAgICAgICAgICBpZiAocyA+IDApCi0gICAgICAgICAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAgICAgICAgIHNxID0gc3ExOwotICAgICAgICAgICAgICAgICAgICAgICAgYWxwID0gYWxwXzE2OwotICAgICAgICAgICAgICAgICAgICAgICAgaXggPSBpMTsKLSAgICAgICAgICAgICAgICAgICAgfQotCi0gICAgICAgICAgICAgICAgfSAvKiBmb3IgKGkxID0gaXBvc1sxXTsgaTEgPCBMX0NPREU7IGkxICs9IFNURVApICovCi0KLSAgICAgICAgICAgICAgICAvKiBtZW1vcml6ZSBjb2RldmVjdG9yIGlmIHRoaXMgb25lIGlzIGJldHRlciB0aGFuIHRoZSBsYXN0IG9uZS4gKi8KLQotICAgICAgICAgICAgICAgIC8qIHMgPSBMX211bHQoYWxwaywgc3EsIHBPdmVyZmxvdyk7ICovCi0gICAgICAgICAgICAgICAgcyA9ICgoV29yZDMyKSBhbHBrICogc3EpIDw8IDE7Ci0KLSAgICAgICAgICAgICAgICAvKiBzID0gTF9tc3UocywgcHNrLCBhbHAsIHBPdmVyZmxvdyk7ICovCi0gICAgICAgICAgICAgICAgcyAtPSAoKChXb3JkMzIpIHBzayAqIGFscCkgPDwgMSk7Ci0KLSAgICAgICAgICAgICAgICBpZiAocyA+IDApCi0gICAgICAgICAgICAgICAgewotICAgICAgICAgICAgICAgICAgICBwc2sgPSBzcTsKLSAgICAgICAgICAgICAgICAgICAgYWxwayA9IGFscDsKLSAgICAgICAgICAgICAgICAgICAgcF9jb2R2ZWMgPSAmY29kdmVjWzBdOwotCi0gICAgICAgICAgICAgICAgICAgICoocF9jb2R2ZWMrKykgPSBpMDsKLSAgICAgICAgICAgICAgICAgICAgKihwX2NvZHZlYykgPSBpeDsKLSAgICAgICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgIH0gLyogZm9yIChpMCA9IGlwb3NbMF07IGkwIDwgTF9DT0RFOyBpMCArPSBTVEVQKSAqLwotCi0gICAgICAgIH0gLyogZm9yICh0cmFjazIgPSAwOyB0cmFjazIgPCA0OyB0cmFjazIrKykgKi8KLQotICAgIH0gLyogZm9yICh0cmFjazEgPSAwOyB0cmFjazEgPCAyOyB0cmFjazErKykgKi8KLQotICAgIHJldHVybjsKLQotfSAvKiBzZWFyY2hfMmk0MCAqLwotCi0vKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLQotCi0vKgotLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tCi0gRlVOQ1RJT04gTkFNRTogYnVpbGRf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pbHRlciAqLwotICAgIFdvcmQxNiB5W10sICAgICAgICAgLyogbyA6IGZpbHRlcmVkIGlubm92YXRpdmUgY29kZSAgICAgICAgICAgICAgICAgICAgICAqLwotICAgIFdvcmQxNiBzaWduW10sICAgICAgLyogbyA6IHNpZ24gb2YgMiBwdWxzZXMgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotICAgIEZsYWcgICAqIHBPdmVyZmxvdyAgLyogbyA6IEZsYWcgc2V0IHdoZW4gb3ZlcmZsb3cgb2NjdXJzICAgICAgICAgICAgICAgICAqLwotKQotewotICAgIFdvcmQxNiBpOwotICAgIFdvcmQxNiBqOwotICAgIFdvcmQxNiBrOwotICAgIFdvcmQxNiB0cmFjazsKLSAgICBXb3JkMTYgaW5kZXg7Ci0gICAgV29yZDE2IF9zaWduW05CX1BVTFNFXTsKLSAgICBXb3JkMTYgaW5keDsKLSAgICBXb3JkMTYgcnNpZ247Ci0gICAgV29yZDE2IHRlbXBXb3JkOwotCi0gICAgV29yZDE2ICpwMDsKLSAgICBXb3JkMTYgKnAxOwotCi0gICAgV29yZDMyIHM7Ci0KLSAgICBmb3IgKGkgPSAwOyBpIDwgTF9DT0RFOyBpKyspCi0gICAgewotICAgICAgICBjb2RbaV0gPSAwOwotICAgIH0KLQotICAgIGluZHggPSAwOwotICAgIHJzaWduID0gMDsKLQotICAgIGZvciAoayA9IDA7IGsgPCBOQl9QVUxTRTsgaysrKQotICAgIHsKLSAgICAgICAgaSA9IGNvZHZlY1trXTsgICAgICAvKiByZWFkIHB1bHNlIHBvc2l0aW9uICovCi0gICAgICAgIGogPSBkbl9zaWduW2ldOyAgICAgLyogcmVhZCBzaWduICAgICAgICAgICAqLwotCi0gICAgICAgIC8qIGluZGV4ID0gcG9zLzUgKi8KLSAgICAgICAgLyogaW5kZXggPSBtdWx0KGksIDY1NTQsIHBPdmVyZmxvdyk7ICovCi0gICAgICAgIGluZGV4ID0gKFdvcmQxNikoKChXb3JkMzIpIGkgKiA2NTU0KSA+PiAxNSk7Ci0KLSAgICAgICAgLyogdHJhY2sgPSBwb3MlNSAqLwotICAgICAgICAvKiB0ZW1wV29yZCA9Ci0gICAgICAgICAgICBMX211bHQoCi0gICAgICAgICAgICBpbmRleCwKLSAgICAgICAgICAgIDUsCi0gICAgICAgICAgICBwT3ZlcmZsb3cpOyAqLwotICAgICAgICB0ZW1wV29yZCA9ICgoV29yZDMyKSBpbmRleCAqIDUpIDw8IDE7Ci0KLSAgICAgICAgLyogdGVtcFdvcmQgPQotICAgICAgICAgICAgTF9zaHIoCi0gICAgICAgICAgICB0ZW1wV29yZCwKLSAgICAgICAgICAgIDEsCi0gICAgICAgICAgICBwT3ZlcmZsb3cpOyAqLwotICAgICAgICB0ZW1wV29yZCA+Pj0gMTsKLQotCi0gICAgICAgIC8qIHRyYWNrID0KLSAgICAgICAgICAgIHN1YigKLSAgICAgICAgICAgIGksCi0gICAgICAgICAgICB0ZW1wV29yZCwKLSAgICAgICAgICAgIHBPdmVyZmxvdyk7ICovCi0gICAgICAgIHRyYWNrID0gaSAtIHRlbXBXb3JkOwotCi0gICAgICAgIHRlbXBXb3JkID0gdHJhY2s7Ci0KLSAgICAgICAgaWYgKHRlbXBXb3JkID09IDApCi0gICAgICAgIHsKLSAgICAgICAgICAgIHRyYWNrID0gMTsKLQotICAgICAgICAgICAgLyogaW5kZXggPQotICAgICAgICAgICAgICAgIHNobCgKLSAgICAgICAgICAgICAgICBpbmRleCwKLSAgICAgICAgICAgICAgICA2LAotICAgICAgICAgICAgICAgIHBPdmVyZmxvdyk7ICovCi0gICAgICAgICAgICBpbmRleCA8PD0gNjsKLSAgICAgICAgfQotICAgICAgICBlbHNlIGlmICh0cmFjayA9PSAxKQotICAgICAgICB7Ci0gICAgICAgICAgICB0ZW1wV29yZCA9IGs7Ci0KLSAgICAgICAgICAgIGlmICh0ZW1wV29yZCA9PSAwKQotICAgICAgICAgICAgewotICAgICAgICAgICAgICAgIHRyYWNrID0gMDsKLSAgICAgICAgICAgICAgICAvKiBpbmRleCA9Ci0gICAgICAgICAgICAgICAgICAgIHNobCgKLSAgICAgICAgICAgICAgICAgICAgaW5kZXgsCi0gICAgICAgICAgICAgICAgICAgIDEsCi0gICAgICAgICAgICAgICAgICAgIHBPdmVyZmxvdyk7ICovCi0gICAgICAgICAgICAgICAgaW5kZXggPDw9IDE7Ci0gICAgICAgICAgICB9Ci0gICAgICAgICAgICBlbHNlCi0gICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgdHJhY2sgPSAxOwotCi0gICAgICAgICAgICAgICAgLyogdGVtcFdvcmQgPQotICAgICAgICAgICAgICAgICAgICBzaGwoCi0gICAgICAgICAgICAgICAgICAgIGluZGV4LAotICAgICAgICAgICAgICAgICAgICA2LAotICAgICAgICAgICAgICAgICAgICBwT3ZlcmZsb3cpOyAqLwotICAgICAgICAgICAgICAgIHRlbXBXb3JkID0gaW5kZXggPDwgNjsKLQotICAgICAgICAgICAgICAgIC8qIGluZGV4ID0KLSAgICAgICAgICAgICAgICAgICAgYWRkKAotICAgICAgICAgICAgICAgICAgICB0ZW1wV29yZCwKLSAgICAgICAgICAgICAgICAgICAgMTYsCi0gICAgICAgICAgICAgICAgICAgIHBPdmVyZmxvdyk7ICovCi0gICAgICAgICAgICAgICAgaW5kZXggPSB0ZW1wV29yZCArIDE2OwotICAgICAgICAgICAgfQotICAgICAgICB9Ci0gICAgICAgIGVsc2UgaWYgKHRyYWNrID09IDIpCi0gICAgICAgIHsKLSAgICAgICAgICAgIHRyYWNrID0gMTsKLQotICAgICAgICAgICAgLyogdGVtcFdvcmQgPQotICAgICAgICAgICAgICAgIHNobCgKLSAgICAgICAgICAgICAgICBpbmRleCwKLSAgICAgICAgICAgICAgICA2LAotICAgICAgICAgICAgICAgIHBPdmVyZmxvdyk7ICovCi0gICAgICAgICAgICB0ZW1wV29yZCA9IGluZGV4IDw8IDY7Ci0KLSAgICAgICAgICAgIC8qIGluZGV4ID0KLSAgICAgICAgICAgICAgICBhZGQoCi0gICAgICAgICAgICAgICAgdGVtcFdvcmQsCi0gICAgICAgICAgICAgICAgMzIsCi0gICAgICAgICAgICAgICAgcE92ZXJmbG93KTsgKi8KLSAgICAgICAgICAgIGluZGV4ID0gdGVtcFdvcmQgKyAzMjsKLSAgICAgICAgfQotICAgICAgICBlbHNlIGlmICh0cmFjayA9PSAzKQotICAgICAgICB7Ci0gICAgICAgICAgICB0cmFjayA9IDA7Ci0KLSAgICAgICAgICAgIC8qIHRlbXBXb3JkID0KLSAgICAgICAgICAgICAgICBzaGwoCi0gICAgICAgICAgICAgICAgaW5kZXgsCi0gICAgICAgICAgICAgICAgMSwKLSAgICAgICAgICAgICAgICBwT3ZlcmZsb3cpOyAqLwotICAgICAgICAgICAgdGVtcFdvcmQgPSBpbmRleCA8PCAxOwotCi0gICAgICAgICAgICAvKiBpbmRleCA9Ci0gICAgICAgICAgICAgICAgYWRkKAotICAgICAgICAgICAgICAgIHRlbXBXb3JkLAotICAgICAgICAgICAgICAgIDEsCi0gICAgICAgICAgICAgICAgcE92ZXJmbG93KTsgKi8KLSAgICAgICAgICAgIGluZGV4ID0gdGVtcFdvcmQgKyAxOwotICAgICAgICB9Ci0gICAgICAgIGVsc2UgaWYgKHRyYWNrID09IDQpCi0gICAgICAgIHsKLSAgICAgICAgICAgIHRyYWNrID0gMTsKLQotICAgICAgICAgICAgLyogdGVtcFdvcmQgPQotICAgICAgICAgICAgICAgIHNobCgKLSAgICAgICAgICAgICAgICBpbmRleCwKLSAgICAgICAgICAgICAgICA2LAotICAgICAgICAgICAgICAgIHBPdmVyZmxvdyk7ICovCi0gICAgICAgICAgICB0ZW1wV29yZCA9IGluZGV4IDw8IDY7Ci0KLSAgICAgICAgICAgIC8qIGluZGV4ID0KLSAgICAgICAgICAgICAgICBhZGQoCi0gICAgICAgICAgICAgICAgdGVtcFdvcmQsCi0gICAgICAgICAgICAgICAgNDgsCi0gICAgICAgICAgICAgICAgcE92ZXJmbG93KTsgKi8KLSAgICAgICAgICAgIGluZGV4ID0gdGVtcFdvcmQgKyA0ODsKLSAgICAgICAgfQotCi0gICAgICAgIGlmIChqID4gMCkKLSAgICAgICAgewotICAgICAgICAgICAgY29kW2ldID0gODE5MTsKLSAgICAgICAgICAgIF9zaWduW2tdID0gMzI3Njc7Ci0KLSAgICAgICAgICAgIHRlbXBXb3JkID0KLSAgICAgICAgICAgICAgICBzaGwoCi0gICAgICAgICAgICAgICAgICAgIDEsCi0gICAgICAgICAgICAgICAgICAgIHRyYWNrLAotICAgICAgICAgICAgICAgICAgICBwT3ZlcmZsb3cpOwotCi0gICAgICAgICAgICByc2lnbiA9Ci0gICAgICAgICAgICAgICAgYWRkKAotICAgICAgICAgICAgICAgICAgICByc2lnbiwKLSAgICAgICAgICAgICAgICAgICAgdGVtcFdvcmQsCi0gICAgICAgICAgICAgICAgICAgIHBPdmVyZmxvdyk7Ci0gICAgICAgIH0KLSAgICAgICAgZWxzZQotICAgICAgICB7Ci0gICAgICAgICAgICBjb2RbaV0gPSAtODE5MjsKLSAgICAgICAgICAgIF9zaWduW2tdID0gKFdvcmQxNikgLSAzMjc2OEw7Ci0gICAgICAgIH0KLQotICAgICAgICBpbmR4ID0KLSAgICAgICAgICAgIGFkZCgKLSAgICAgICAgICAgICAgICBpbmR4LAotICAgICAgICAgICAgICAgIGluZGV4LAotICAgICAgICAgICAgICAgIHBPdmVyZmxvdyk7Ci0gICAgfQotICAgICpzaWduID0gcnNpZ247Ci0KLSAgICBwMCA9IGggLSBjb2R2ZWNbMF07Ci0gICAgcDEgPSBoIC0gY29kdmVjWzFdOwotCi0gICAgZm9yIChpID0gMDsgaSA8IExfQ09ERTsgaSsrKQotICAgIHsKLSAgICAgICAgcyA9IDA7Ci0KLSAgICAgICAgcyA9Ci0gICAgICAgICAgICBMX21hYygKLSAgICAgICAgICAgICAgICBzLAotICAgICAgICAgICAgICAgICpwMCsrLAotICAgICAgICAgICAgICAgIF9zaWduWzBdLAotICAgICAgICAgICAgICAgIHBPdmVyZmxvdyk7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Xb3JkMTYgY29kdmVjW10sICAgIC8qIG8gOiBhbGdlYnJhaWMgY29kZWJvb2sgdmVjdG9yICAgICAgICAgICAgICAgICAgICAgKi8KLSAgICAgICAgRmxhZyAgICogcE92ZXJmbG93ICAvKiBvIDogRmxhZyBzZXQgd2hlbiBvdmVyZmxvdyBvY2N1cnMgICAgICAgICAgICAgICAgICovCi0gICAgKTsKLQotICAgIHN0YXRpYyBXb3JkMTYgYnVpbGRfY29kZSgKLSAgICAgICAgV29yZDE2IHN1Yk5yLCAgICAgICAvKiBpIDogc3ViZnJhbWUgbnVtYmVyICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0gICAgICAgIFdvcmQxNiBjb2R2ZWNbXSwgICAgLyogaSA6IGFsZ2VicmFpYyBjb2RlYm9vayB2ZWN0b3IgICAgICAgICAgICAgICAgICAgICAqLwotICAgICAgICBXb3JkMTYgZG5fc2lnbltdLCAgIC8qIGkgOiBzaWduIG9mIGRuW10gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLSAgICAgICAgV29yZDE2IGNvZFtdLCAgICAgICAvKiBvIDogYWxnZWJyYWljIChmaXhlZCkgY29kZWJvb2sgZXhjaXRhdGlvbiAgICAgICAgICovCi0gICAgICAgIFdvcmQxNiBoW10sICAgICAgICAgLyogaSA6IGltcHVsc2UgcmVzcG9uc2Ugb2Ygd2VpZ2h0ZWQgc3ludGhlc2lzIGZpbHRlciAqLwotICAgICAgICBXb3JkMTYgeVtdLCAgICAgICAgIC8qIG8gOiBmaWx0ZXJlZCBmaXhlZCBjb2RlYm9vayBleGNpdGF0aW9uICAgICAgICAgICAgKi8KLSAgICAgICAgV29yZDE2IHNpZ25bXSwgICAgICAvKiBvIDogc2lnbiBvZiAyIHB1bHNlcyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0gICAgICAgIEZsYWcgICAqIHBPdmVyZmxvdyAgLyogbyA6IEZsYWcgc2V0IHdoZW4gb3ZlcmZsb3cgb2NjdX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ogaSA6IHN1YmZyYW1lIG51bWJlciAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLSAgICAgICAgV29yZDE2IHhbXSwgICAgICAgICAvKiBpIDogdGFyZ2V0IHZlY3RvciAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotICAgICAgICBXb3JkMTYgaFtdLCAgICAgICAgIC8qIGkgOiBpbXB1bHNlIHJlc3BvbnNlIG9mIHdlaWdodGVkIHN5bnRoZXNpcyAgICovCi0gICAgICAgIC8qICAgICBmaWx0ZXIgaFstTF9zdWJmci4uLTFdIG11c3QgYmUgc2V0IHRvIDAuICovCi0gICAgICAgIFdvcmQxNiBUMCwgICAgICAgICAgLyogaSA6IFBpdGNoIGxhZyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLSAgICAgICAgV29yZDE2IHBpdGNoX3NoYXJwLCAvKiBpIDogTGFzdCBxdWFudGl6ZWQgcGl0Y2ggZ2FpbiAgICAgICAgICAgICAgICAqLwotICAgICAgICBXb3JkMTYgY29kZVtdLCAgICAgIC8qIG8gOiBJbm5vdmF0aXZlIGNvZGVib29rICAgICAgICAgICAgICAgICAgICAgICovCi0gICAgICAgIFdvcmQxNiB5W10sICAgICAgICAgLyogbyA6IGZpbHRlcmVkIGZpeGVkIGNvZGVib29rIGV4Y2l0YXRpb24gICAgICAgKi8KLSAgICAgICAgV29yZDE2ICogc2lnbiwgICAgICAvKiBvIDogU2lnbnMgb2YgMiBwdWxzZXMgICAgICAgICAgICAgICAgICAgICAgICAqLwotICAgICAgICBGbGFnICAgKiBwT3ZlcmZsb3cgIC8qIG8gOiBGbGFnIHNldCB3aGVuIG92ZXJmbG93IG9jY3VycyAgICAgICAgICAgICovCi0gICAgKQotICAgIHsKLSAgICAgICAgV29yZDE2IGNvZHZlY1tOQl9QVUxTRV07Ci0gICAgICAgIFdvcmQxNiBkbltMX0NPREVdOwotICAgICAgICBXb3JkMTYgZG4yW0xfQ09ERV07Ci0gICAgICAgIFdvcmQxNiBkbl9zaWduW0xfQ09ERV07Ci0gICAgICAgIFdvcmQxNiBycltMX0NPREVdW0xfQ09ERV07Ci0KLSAgICAgICAgcmVnaXN0ZXIgV29yZDE2IGk7Ci0KLSAgICAgICAgV29yZDE2IGluZGV4OwotICAgICAgICBXb3JkMTYgc2hhcnA7Ci0gICAgICAgIFdvcmQxNiB0ZW1wOwotICAgICAgICBXb3JkMzIgTF90ZW1wOwotCi0gICAgICAgIExfdGVtcCA9ICgoV29yZDMyKSBwaXRjaF9zaGFycCkgPDwgMTsKLQotICAgICAgICAvKiBDaGVjayBmb3Igb3ZlcmZsb3cgY29uZGl0aW9uICovCi0gICAgICAgIGlmIChMX3RlbXAgIT0gKFdvcmQzMikoKFdvcmQxNikgTF90ZW1wKSkKLSAgICAgICAgewotICAgICAgICAgICAgKihwT3ZlcmZsb3cpID0gMTsKLSAgICAgICAgICAgIHNoYXJwID0gKHBpdGNoX3NoYXJwID4gMCkgPyBNQVhfMTYgOiBNSU5fMTY7Ci0gICAgICAgIH0KLSAgICAgICAgZWxzZQotICAgICAgICB7Ci0gICAgICAgICAgICBzaGFycCA9IChXb3JkMTYpIExfdGVtcDsKLSAgICAgICAgfQotCi0gICAgICAgIGlmIChUMCA8IExfQ09ERSkKLSAgICAgICAgewotICAgICAgICAgICAgZm9yIChpID0gVDA7IGkgPCBMX0NPREU7IGkrKykKLSAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICB0ZW1wID0KLSAgICAgICAgICAgICAgICAgICAgbXVsdCgKLSAgICAgICAgICAgICAgICAgICAgICAgICooaCArIGkgLSBUMCksCi0gICAgICAgICAgICAgICAgICAgICAgICBzaGFycCwKLSAgICAgICAgICAgICAgICAgICAgICAgIHBPdmVyZmxvdyk7Ci0KLSAgICAgICAgICAgICAgICAqKGggKyBpKSA9Ci0gICAgICAgICAgICAgICAgICAgIGFkZCgKLSAgICAgICAgICAgICAgICAgICAgICAgICooaCArIGkpLAotICAgICAgICAgICAgICAgICAgICAgICAgdGVtcCwKLSAgICAgICAgICAgICAgICAgICAgICAgIHBPdmVyZmxvdyk7Ci0gICAgICAgICAgICB9Ci0gICAgICAgIH0KLQotICAgICAgICBjb3JfaF94KAotICAgICAgICAgICAgaCwKLSAgICAgICAgICAgIHgsCi0gICAgICAgICAgICBkbiwKLSAgICAgICAgICAgIDEsCi0gICAgICAgICAgICBwT3ZlcmZsb3cpOwotCi0gICAgICAgIC8qIGRuMltdIG5vdCB1c2VkIGluIHRoaXMgY29kZWJvb2sgc2VhcmNoICovCi0KLSAgICAgICAgc2V0X3NpZ24oCi0gICAgICAgICAgICBkbiwKLSAgICAgICAgICAgIGRuX3NpZ24sCi0gICAgICAgICAgICBkbjIsCi0gICAgICAgICAgICA4KTsKLQotICAgICAgICBjb3JfaCgKLSAgICAgICAgICAgIGgsCi0gICAgICAgICAgICBkbl9zaWduLAotICAgICAgICAgICAgcnIsCi0gICAgICAgICAgICBwT3ZlcmZsb3cpOwotCi0gICAgICAgIHNlYXJjaF8yaTQwKAotICAgICAgICAgICAgc3ViTnIsCi0gICAgICAgICAgICBkbiwKLSAgICAgICAgICAgIHJyLAotICAgICAgICAgICAgY29kdmVjLAotICAgICAgICAgICAgcE92ZXJmbG93KTsKLQotICAgICAgICBpbmRleCA9Ci0gICAgICAgICAgICBidWlsZF9jb2RlKAotICAgICAgICAgICAgICAgIHN1Yk5yLAotICAgICAgICAgICAgICAgIGNvZHZlYywKLSAgICAgICAgICAgICAgICBkbl9zaWduLAotICAgICAgICAgICAgICAgIGNvZGUsCi0gICAgICAgICAgICAgICAgaCwKLSAgICAgICAgICAgICAgICB5LAotICAgICAgICAgICAgICAgIHNpZ24sCi0gICAgICAgICAgICAgICAgcE92ZXJmbG93KTsKLQotICAgICAgICAvKi0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tKgotICAgICAgICAgKiBDb21wdXRlIGlubm92YXRpb24gdmVjdG9yIGdhaW4uICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKgotICAgICAgICAgKiBJbmNsdWRlIGZpeGVkLWdhaW4gcGl0Y2ggY29udHJpYnV0aW9uIGludG8gY29kZVtdLiAgICAgICAgICAgICAgKgotICAgICAgICAgKi0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tKi8KLQotICAgICAgICBpZiAoVDAgPCBMX0NPREUpCi0gICAgICAgIHsKLSAgICAgICAgICAgIGZvciAoaSA9IFQwOyBpIDwgTF9DT0RFOyBpKyspCi0gICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgdGVtcCA9Ci0gICAgICAgICAgICAgICAgICAgIG11bHQoCi0gICAgICAgICAgICAgICAgICAgICAgICAqKGNvZGUgKyBpIC0gVDApLAotICAgICAgICAgICAgICAgICAgICAgICAgc2hhcnAsCi0gICAgICAgICAgICAgICAgICAgICAgICBwT3ZlcmZsb3cpOwotCi0gICAgICAgICAgICAgICAgKihjb2RlICsgaSkgPQotICAgICAgICAgICAgICAgICAgICBhZGQoCi0gICAgICAgICAgICAgICAgICAgICAgICAqKGNvZGUgKyBpKSwKLSAgICAgICAgICAgICAgICAgICAgICAgIHRlbXAsCi0gICAgICAgICAgICAgICAgICAgICAgICBwT3ZlcmZsb3cpOwotICAgICAgICAgICAgfQotICAgICAgICB9Ci0KLSAgICAgICAgcmV0dXJuKGluZGV4KTsKLSAgICB9Ci0KLSAgICAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLQotCi0gICAgLyoKLSAgICAtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0KLSAgICAgRlVOQ1RJT04gTkFNRTog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LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tKgotCi0gICAgICAgICAgICAgIGZvciAoaTAgPSBpcG9zWzBdOyBpMCA8IExfQ09ERTsgaTAgKz0gU1RFUCkgewotCi0gICAgICAgICAgICAgICAgIHBzMCA9IGRuW2kwXTsKLSAgICAgICAgICAgICAgICAgYWxwMCA9IExfbXVsdChycltpMF1baTBdLCBfMV80KTsKLQotICAgICAgICAgICAgICAgKi0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0qCi0gICAgICAgICAgICAgICAqIGkxIGxvb3A6IDggcG9zaXRpb25zLiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICoKLSAgICAgICAgICAgICAgICotLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tKgotCi0gICAgICAgICAgICAgICAgIHNxID0gLTE7Ci0gICAgICAgICAgICAgICAgIGFscCA9IDE7Ci0gICAgICAgICAgICAgICAgIGl4ID0gaXBvc1sxXTsKLQotICAgICAgICAgICAgKi0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0qCi0gICAgICAgICAgICAqICBUaGVzZSBpbmRleCBoYXZlIGxvdyBjb21wbGV4aXR5IGFkZHJlc3MgY29tcHV0YXRpb24gYmVjYXVzZSAgICAgICoKLSAgICAgICAgICAgICogIHRoZXkgYXJlLCBpbiBmYWN0LCBwb2ludGVycyB3aXRoIGZpeGVkIGluY3JlbWVudC4gIEZvciBleGFtcGxlLCAgKgotICAgICAgICAgICAgKiAgInJyW2kwXVtpMl0iIGlzIGEgcG9pbnRlciBpbml0aWFsaXplZCB0byAiJnJyW2kwXVtpcG9zWzJdXSIgICAgICAqCi0gICAgICAgICAgICAqICBhbmQgaW5jcmVtZW50ZWQgYnkgIlNURVAiLiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICoKLSAgICAgICAgICAgICotLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tKgotCi0gICAgICAgICAgICAgICAgIGZvciAoaTEgPSBpcG9zWzFdOyBpMSA8IExfQ09ERTsgaTEgKz0gU1RFUCkgewotICAgICAgICAgICAgICAgICAgICBwczEgPSBhZGQocHMwLCBkbltpMV0pOyAgIC8vIGlkeCBpbmNyZW1lbnQgPSBTVEVQCi0KLSAgICAgICAgICAgICAgICAgICAgLy8gYWxwMSA9IGFscDAgKyBycltpMF1baTFdICsgMS8yKnJyW2kxXVtpMV07Ci0KLSAgICAgICAgICAgICAgICAgICAgYWxwMSA9IExfbWFjKGFscDAsIHJyW2kxXVtpMV0sIF8xXzQpOyAvLyBpZHggaW5jciA9IFNURVAKLSAgICAgICAgICAgICAgICAgICAgYWxwMSA9IExfbWFjKGFscDEsIHJyW2kwXVtpMV0sIF8xXzIpOyAvLyBpZHggaW5jciA9IFNURVAKLQotICAgICAgICAgICAgICAgICAgICBzcTEgPSBtdWx0KHBzMSwgcHMxKTsKLQotICAgICAgICAgICAgICAgICAgICBhbHBfMTYgPSBwdl9yb3VuZChhbHAxKTsKLQotICAgICAgICAgICAgICAgICAgICBzID0gTF9tc3UoTF9tdWx0KGFscCwgc3ExKSwgc3EsIGFscF8xNik7Ci0KLSAgICAgICAgICAgICAgICAgICAgaWYgKHMgPiAwKSB7Ci0gICAgICAgICAgICAgICAgICAgICAgIHNxID0gc3ExOwotICAgICAgICAgICAgICAgICAgICAgICBhbHAgPSBhbHBfMTY7Ci0gICAgICAgICAgICAgICAgICAgICAgIGl4ID0gaTE7Ci0gICAgICAgICAgICAgICAgICAgIH0KLSA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C8qIGkgOiBtYXRyaXggb2YgYXV0b2NvcnJlbGF0aW9uICAgICAgICAgICovCi0gICAgICAgIFdvcmQxNiBjb2R2ZWNbXSwgICAgIC8qIG8gOiBhbGdlYnJhaWMgY29kZWJvb2sgdmVjdG9yICAgICAgICAgICovCi0gICAgICAgIEZsYWcgICAqIHBPdmVyZmxvdyAgIC8qIG8gOiBGbGFnIHNldCB3aGVuIG92ZXJmbG93IG9jY3VycyAgICAgICovCi0gICAgKQotICAgIHsKLSAgICAgICAgcmVnaXN0ZXIgV29yZDE2IGkwOwotICAgICAgICByZWdpc3RlciBXb3JkMTYgaTE7Ci0gICAgICAgIFdvcmQxNiBpeCA9IDA7IC8qIGluaXRpYWxpemF0aW9uIG9ubHkgbmVlZGVkIHRvIGtlZXAgZ2NjIHNpbGVudCAqLwotICAgICAgICByZWdpc3RlciBXb3JkMTYgIHRyYWNrMTsKLSAgICAgICAgV29yZDE2IGlwb3NbTkJfUFVMU0VdOwotICAgICAgICBXb3JkMTYgcHNrOwotICAgICAgICBXb3JkMTYgcHMwOwotICAgICAgICBXb3JkMTYgcHMxOwotICAgICAgICBXb3JkMTYgc3E7Ci0gICAgICAgIFdvcmQxNiBzcTE7Ci0gICAgICAgIFdvcmQxNiBhbHBrOwotICAgICAgICBXb3JkMTYgYWxwOwotICAgICAgICBXb3JkMTYgYWxwXzE2OwotICAgICAgICBXb3JkMzIgczsKLSAgICAgICAgV29yZDMyIGFscDA7Ci0gICAgICAgIFdvcmQzMiBhbHAxOwotICAgICAgICByZWdpc3RlciBXb3JkMTYgaTsKLSAgICAgICAgV29yZDMyIExfdGVtcDsKLSAgICAgICAgV29yZDE2ICpwX2NvZHZlYyA9ICZjb2R2ZWNbMF07Ci0KLSAgICAgICAgT1NDTF9VTlVTRURfQVJHKHBPdmVyZmxvdyk7Ci0KLSAgICAgICAgcHNrID0gLTE7Ci0gICAgICAgIGFscGsgPSAxOwotCi0gICAgICAgIC8qIFVucm9sbGVkIHRoZSBmb2xsb3dpbmcgRk9SIGxvb3AgdG8gc2F2ZSBNSVBTICovCi0gICAgICAgIC8qIGZvciAoaSA9IDA7IGkgPCBOQl9QVUxTRTsgaSsrKSAgICAgICAgICAgKi8KLSAgICAgICAgLyogeyAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotICAgICAgICAvKiAgKihjb2R2ZWMgKyBpKSA9IGk7ICAgICAgICAgICovCi0gICAgICAgIC8qIH0gICAgICAgICAgICAgICAgICAgICAgICAqLwotCi0gICAgICAgICoocF9jb2R2ZWMrKykgPSAwOwotICAgICAgICAqKHBfY29kdmVjKSA9IDE7Ci0KLSAgICAgICAgZm9yICh0cmFjazEgPSAwOyB0cmFjazEgPCAyOyB0cmFjazErKykKLSAgICAgICAgewotICAgICAgICAgICAgLyogZml4IHN0YXJ0aW5nIHBvc2l0aW9uICovCi0KLSAgICAgICAgICAgIGkgPSAoc3ViTnIgPDwgMSkgKyAodHJhY2sxIDw8IDMpOwotICAgICAgICAgICAgKmlwb3MgPSAqKHN0YXJ0UG9zICsgaSk7Ci0gICAgICAgICAgICAqKGlwb3MgKyAxKSA9ICooc3RhcnRQb3MgKyBpICsgMSk7Ci0KLQotICAgICAgICAgICAgLyotLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tKgotICAgICAgICAgICAgICogaTAgbG9vcDogdHJ5IDggcG9zaXRpb25zLiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKgotICAgICAgICAgICAgICotLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tKi8KLQotICAgICAgICAgICAgZm9yIChpMCA9ICppcG9zOyBpMCA8IExfQ09ERTsgaTAgKz0gU1RFUCkKLSAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICBwczAgPSAqKGRuICsgaTApOwotCi0gICAgICAgICAgICAgICAgLyogTGVmdCBzaGlmdCBieSAxIGNvbnZlcnRzIGludGVnZXIgcHJvZHVjdCB0byAqLwotICAgICAgICAgICAgICAgIC8qIGZyYWN0aW9uYWwgcHJvZHVjdC4gICAgICAgICAgICAgICAgICovCi0gICAgICAgICAgICAgICAgYWxwMCA9IChXb3JkMzIpIHJyW2kwXVtpMF0gPDwgMTQ7Ci0KLSAgICAgICAgICAgICAgICAvKi0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tKgotICAgICAgICAgICAgICAgICAqIGkxIGxvb3A6IDggcG9zaXRpb25zLiAgICAgICAgICAgICAgICAgICAgICAgICAgICAqCi0gICAgICAgICAgICAgICAgICotLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSovCi0KLSAgICAgICAgICAgICAgICBzcSA9IC0xOwotICAgICAgICAgICAgICAgIGFscCA9IDE7Ci0gICAgICAgICAgICAgICAgaXggPSAqKGlwb3MgKyAxKTsKLQotICAgICAgICAgICAgICAgIC8qLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0qCi0gICAgICAgICAgICAgICAgICogVGhlc2UgaW5kZXggaGF2ZSBsb3cgY29tcGxleGl0eSBhZGRyZXNzICAgICAgICAgICoKLSAgICAgICAgICAgICAgICAgKiBjb21wdXRhdGlvbiBiZWNhdXNlIHRoZXkgYXJlLCBpbiBmYWN0LCBwb2ludGVycyAgKgotICAgICAgICAgICAgICAgICAqIHdpdGggZml4ZWQgaW5jcmVtZW50LiBGb3IgZXhhbXBsZSwgInJyW2kwXVtpMl0iICAqCi0gICAgICAgICAgICAgICAgICogaXMgYSBwb2ludGVyIGluaXRpYWxpemVkIHRvICImcnJbaTBdW2lwb3NbMl1dIiAgICoKLSAgICAgICAgICAgICAgICAqICBhbmQgaW5jcmVtZW50ZWQgYnkgIlNURVAiLiAgICAgICAgICAgICAgICAgICAgICAgKgotICAgICAgICAgICAgICAgICotLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0qLwotCi0gICAgICAgICAgICAgICAgZm9yIChpMSA9ICooaXBvcyArIDEpOyBpMSA8IExfQ09ERTsgaTEgKz0gU1RFUCkKLSAgICAgICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgICAgIC8qIGlkeCBpbmNyZW1lbnQgPSBTVEVQICovCi0gICAgICAgICAgICAgICAgICAgIC8qIHBzMSA9IGFkZChwczAsICooZG4gKyBpMSksIHBPdmVyZmxvdyk7ICovCi0gICAgICAgICAgICAgICAgICAgIHBzMSA9IHBzMCArIGRuW2kxXTsKLQotICAgICAgICAgICAgICAgICAgICAvKiBhbHAxID0gYWxwMCtycltpMF1baTFdKzEvMipycltpMV1baTFdOyAqLwotCi0gICAgICAgICAgICAgICAgICAgIC8qIGlkeCBpbmNyID0gU1RFUCAqLwotICAgICAgICAgICAgICAgICAgICAvKiBFeHRyYSBsZWZ0IHNoaWZ0IGJ5IDEgY29udmVydHMgaW50ZWdlciAgKi8KLSAgICAgICAgICAgICAgICAgICAgLyogcHJvZHVjdCB0byBmcmFjdGlvbmFsIHByb2R1Y3QgICAgICovCi0gICAgICAgICAgICAgICAgICAgIC8qIGFscDEgPSBMX2FkZChhbHAwLCBzLCBwT3ZlcmZsb3cpOyAqLwotICAgICAgICAgICAgICAgICAgICBhbHAxID0gYWxwMCArICgoV29yZDMyKSBycltpMV1baTFdIDw8IDE0KTsKLQotICAgICAgICAgICAgICAgICAgICAvKiBpZHggaW5jciA9IFNURVAgKi8KLSAgICAgICAgICAgICAgICAgICAgLyogRXh0cmEgbGVmdCBzaGlmdCBieSAxIGNvbnZlcnRzIGludGVnZXIgICovCi0gICAgICAgICAgICAgICAgICAgIC8qIHByb2R1Y3QgdG8gZnJhY3Rpb25hbCBwcm9kdWN0ICAgICAqLwotICAgICAgICAgICAgICAgICAgICAvKiBhbHAxID0gTF9hZGQoYWxwMSwgcywgcE92ZXJmbG93KTsgKi8KLSAgICAgICAgICAgICAgICAgICAgYWxwMSArPSAoV29yZDMyKSBycltpMF1baTFdIDw8IDE1OwotCi0gICAgICAgICAgICAgICAgICAgIC8qIHNxMSA9IG11bHQocHMxLCBwczEsIHBPdmVyZmxvdyk7ICovCi0gICAgICAgICAgICAgICAgICAgIHNxMSA9IChXb3JkMTYpKCgoV29yZDMyKSBwczEgKiBwczEpID4+IDE1KTsKLQotICAgICAgICAgICAgICAgICAgICAvKiBhbHBfMTYgPSBwdl9yb3VuZChhbHAxLCBwT3ZlcmZsb3cpOyAqLwotICAgICAgICAgICAgICAgICAgICBhbHBfMTYgPSAoV29yZDE2KSgoYWxwMSArIChXb3JkMzIpIDB4MDAwMDgwMDBMKSA+PiAxNik7Ci0KLSAgICAgICAgICAgICAgICAgICAgLyogTF90ZW1wID0gTF9tdWx0KGFscCwgc3ExLCBwT3ZlcmZsb3cpOyAqLwotICAgICAgICAgICAgICAgICAgICBMX3RlbXAgPSAoKFdvcmQzMikgYWxwICogc3ExKSA8PCAxOwotCi0gICAgICAgICAgICAgICAgICAgIC8qIHMgPSBMX21zdShMX3RlbXAsIHNxLCBhbHBfMTYsIHBPdmVyZmxvdyk7ICovCi0gICAgICAgICAgICAgICAgICAgIHMgPSBMX3RlbXAgLSAoKChXb3JkMzIpIHNxICogYWxwXzE2KSA8PCAxKTsKLQotICAgICAgICAgICAgICAgICAgICBpZiAocyA+IDApCi0gICAgICAgICAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAgICAgICAgIHNxID0gc3ExOwotICAgICAgICAgICAgICAgICAgICAgICAgYWxwID0gYWxwXzE2OwotICAgICAgICAgICAgICAgICAgICAgICAgaXggPSBpMTsKLSAgICAgICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgICAgIC8qIG1lbW9yaXplIGNvZGV2ZWN0b3IgaWYgdGhpcyBvbmUgaXMgYmV0dGVyIHRoYW4gdGhlIGxhc3Qgb25lLiAqLwotCi0gICAgICAgICAgICAgICAgLyogTF90ZW1wID0gTF9tdWx0KGFscGssIHNxLCBwT3ZlcmZsb3cpOyAqLwotICAgICAgICAgICAgICAgIExfdGVtcCA9ICgoV29yZDMyKSBhbHBrICogc3EpIDw8IDE7Ci0KLSAgICAgICAgICAgICAgICAvKiBzID0gTF9tc3UoTF90ZW1wLCBwc2ssIGFscCwgcE92ZXJmbG93KTsgKi8KLSAgICAgICAgICAgICAgICBzID0gTF90ZW1wIC0gKCgoV29yZDMyKSBwc2sgKiBhbHApIDw8IDEpOwotCi0gICAgICAgICAgICAgICAgaWYgKHMgPiAwKQotICAgICAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAgICAgcHNrID0gc3E7Ci0gICAgICAgICAgICAgICAgICAgIGFscGsgPSBhbHA7Ci0gICAgICAgICAgICAgICAgICAgIHBfY29kdmVjID0gJmNvZHZlY1swXTsKLSAgICAgICAgICAgICAgICAgICAgKihwX2NvZHZlYysrKSA9IGkwOwotICAgICAgICAgICAgICAgICAgICAqKHBfY29kdmVjKSA9IGl4OwotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgIH0KLSAgICAgICAgfQotCi0gICAgICAgIHJldHVybjsKLSAgICB9Ci0KLSAgICAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLQotICAgIC8qCi0gICAgLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tCi0gICAgIEZVTkNUSU9OIE5BTUU6IFRlc3Rfc2VhcmNoXzJpNDAKLSAgICAtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS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bXSwgICAgICAgICAvKiBpIDogY29ycmVsYXRpb24gYmV0d2VlbiB0YXJnZXQgYW5kIGhbXSAqLwotICAgICAgICBXb3JkMTYgcnJbXVtMX0NPREVdLCAvKiBpIDogbWF0cml4IG9mIGF1dG9jb3JyZWxhdGlvbiAgICAgICAgICAqLwotICAgICAgICBXb3JkMTYgY29kdmVjW10sICAgICAvKiBvIDogYWxnZWJyYWljIGNvZGVib29rIHZlY3RvciAgICAgICAgICAqLwotICAgICAgICBGbGFnICAgKiBwT3ZlcmZsb3cgICAvKiBvIDogRmxhZyBzZXQgd2hlbiBvdmVyZmxvdyBvY2N1cnMgICAgICAqLwotICAgICkKLSAgICB7Ci0gICAgICAgIC8qLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLQotICAgICAgICAgQ0FMTCBzZWFyY2hfMmk0MCAoIHN1Yk5yID0gc3ViTnIKLSAgICAgICAgICAgICAgICAgICAgZG4gPSBkbgotICAgICAgICAgICAgICAgICAgICByciA9IHJyCi0gICAgICAgICAgICAgICAgICAgIGNvZHZlYyA9IGNvZHZlYyApCi0gICAgICAgICAgIE1PRElGWUlORyhub3RoaW5nKQotICAgICAgICAgICBSRVRVUk5JTkcobm90aGluZykKLSAgICAgICAgLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSovCi0gICAgICAgIHNlYXJjaF8yaTQwKAotICAgICAgICAgICAgc3ViTnIsCi0gICAgICAgICAgICBkbiwKLSAgICAgICAgICAgIHJyLAotICAgICAgICAgICAgY29kdmVjLAotICAgICAgICAgICAgcE92ZXJmbG93KTsKLQotICAgICAgICByZXR1cm47Ci0gICAgfQotCi0gICAgLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKio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G8gY29kZTsgLTEgZG8gbm90IGNvZGUgdGhpcyBwb3NpdGlvbgotICAgICAgICAgICAwLCAtMSwgMSwgMCwgMSwgLy8gc3ViZnJhbWUgMgotICAgICAgICAgICAwLCAxLCAwLCAtMSwgMSwgLy8gc3ViZnJhbWUgMwotICAgICAgICAgICAwLCAxLCAtMSwgMCwgMX07Ly8gc3ViZnJhbWUgNAotCi0gICAgICAgIHB0ID0gJnRyYWNrVGFibGVbYWRkKHN1Yk5yLCBzaGwoc3ViTnIsIDIpKV07Ci0KLSAgICAgICAgZm9yIChpID0gMDsgaSA8IExfQ09ERTsgaSsrKSB7Ci0gICAgICAgICAgICBjb2RbaV0gPSAwOwotICAgICAgICB9Ci0KLSAgICAgICAgaW5keCA9IDA7Ci0gICAgICAgIHJzaWduID0gMDsKLSAgICAgICAgZm9yIChrID0gMDsgayA8IE5CX1BVTFNFOyBrKyspIHsKLSAgICAgICAgICAgaSA9IGNvZHZlY1trXTsgICAgLy8gcmVhZCBwdWxzZSBwb3NpdGlvbgotICAgICAgICAgICBqID0gZG5fc2lnbltpXTsgICAvLyByZWFkIHNpZ24KLQotICAgICAgICAgICBpbmRleCA9IG11bHQoaSwgNjU1NCk7ICAgIC8vIGluZGV4ID0gcG9zLzUKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyB0cmFjayA9IHBvcyU1Ci0gICAgICAgICAgIHRyYWNrID0gc3ViKGksIGV4dHJhY3RfbChMX3NocihMX211bHQoaW5kZXgsIDUpLCAxKSkpOwotCi0gICAgICAgICAgIGZpcnN0ID0gcHRbdHJhY2tdOwotCi0gICAgICAgICAgIGlmIChmaXJzdCA9PSAwKSB7Ci0gICAgICAgICAgICAgIGlmIChrID09IDApIHsKLSAgICAgICAgICAgICAgICAgdHJhY2sgPSAwOwotICAgICAgICAgICAgICB9IGVsc2UgewotICAgICAgICAgICAgICAgICB0cmFjayA9IDE7Ci0gICAgICAgICAgICAgICAgIGluZGV4ID0gc2hsKGluZGV4LCAzKTsKLSAgICAgICAgICAgICAgfQotICAgICAgICAgICB9IGVsc2UgewotICAgICAgICAgICAgICBpZiAoayA9PSAwKSB7Ci0gICAgICAgICAgICAgICAgIHRyYWNrID0gMDsKLSAgICAgICAgICAgICAgICAgaW5kZXggPSBhZGQoaW5kZXgsIDY0KTsgIC8vIHRhYmxlIGJpdCBpcyBNU0IKLSAgICAgICAgICAgICAgfSBlbHNlIHsKLSAgICAgICAgICAgICAgICAgdHJhY2sgPSAxOwotICAgICAgICAgICAgICAgICBpbmRleCA9IHNobChpbmRleCwgMyk7Ci0gICAgICAgICAgICAgIH0KLSAgICAgICAgICAgfQotCi0gICAgICAgICAgIGlmIChqID4gMCkgewotICAgICAgICAgICAgICBjb2RbaV0gPSA4MTkxOwotICAgICAgICAgICAgICBfc2lnbltrXSA9IDMyNzY3OwotICAgICAgICAgICAgICByc2lnbiA9IGFkZChyc2lnbiwgc2hsKDEsIHRyYWNrKSk7Ci0gICAgICAgICAgIH0gZWxzZSB7Ci0gICAgICAgICAgICAgIGNvZFtpXSA9IC04MTkyOwotICAgICAgICAgICAgICBfc2lnbltrXSA9IChXb3JkMTYpIC0gMzI3NjhMOwotICAgICAgICAgICAgfQotCi0gICAgICAgICAgIGluZHggPSBhZGQoaW5keCwgaW5kZXgpOwotICAgICAgICB9Ci0gICAgICAgICpzaWduID0gcnNpZ247Ci0KLSAgICAgICAgcDAgPSBoIC0gY29kdmVjWzBdOwotICAgICAgICBwMSA9IGggLSBjb2R2ZWNbMV07Ci0KLSAgICAgICAgZm9yIChpID0gMDsgaSA8IExfQ09ERTsgaSsrKSB7Ci0gICAgICAgICAgIHMgPSAwOwotICAgICAgICAgICBzID0gTF9tYWMocywgKnAwKyssIF9zaWduWzBdKTsKLSAgICAgICAgICAgcyA9IExfbWFjKHMsICpwMSsrLCBfc2lnblsxXSk7Ci0gICAgICAgICAgIHlbaV0gPSBwdl9yb3VuZChzKTsKLSAgICAgICAgfQotCi0gICAgICAgIHJldHVybi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LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tCi0gICAgKi8KLQotICAgIHN0YXRpYyBXb3JkMTYgYnVpbGRfY29kZSgKLSAgICAgICAgV29yZDE2IHN1Yk5yLCAgICAgLyogaSA6IHN1YmZyYW1lIG51bWJlciAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotICAgICAgICBXb3JkMTYgY29kdmVjW10sICAvKiBpIDogcG9zaXRpb24gb2YgcHVsc2VzICAgICAgICAgICAgICAgICAgICAgICAgICovCi0gICAgICAgIFdvcmQxNiBkbl9zaWduW10sIC8qIGkgOiBzaWduIG9mIHB1bHNlcyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLSAgICAgICAgV29yZDE2IGNvZFtdLCAgICAgLyogbyA6IGlubm92YXRpdmUgY29kZSB2ZWN0b3IgICAgICAgICAgICAgICAgICAgICAqLwotICAgICAgICBXb3JkMTYgaFtdLCAgICAgICAvKiBpIDogaW1wdWxzZSByZXNwb25zZSBvZiB3ZWlnaHRlZCBzeW50aGVzaXMgICAgICovCi0gICAgICAgIC8qICAgICBmaWx0ZXIgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLSAgICAgICAgV29yZDE2IHlbXSwgICAgICAgLyogbyA6IGZpbHRlcmVkIGlubm92YXRpdmUgY29kZSAgICAgICAgICAgICAgICAgICAqLwotICAgICAgICBXb3JkMTYgc2lnbltdLCAgICAvKiBvIDogc2lnbiBvZiAyIHB1bHNlcyAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0gICAgICAgIEZsYWcgICpwT3ZlcmZsb3cgIC8qIG8gOiBGbGFnIHNldCB3aGVuIG92ZXJmbG93IG9jY3VycyAgICAgICAgICAgICAgKi8KLSAgICApCi0gICAgewotICAgICAgICByZWdpc3RlciBXb3JkMTYgaTsKLSAgICAgICAgcmVnaXN0ZXIgV29yZDE2IGo7Ci0gICAgICAgIHJlZ2lzdGVyIFdvcmQxNiBrOwotICAgICAgICByZWdpc3RlciBXb3JkMTYgdHJhY2s7Ci0gICAgICAgIHJlZ2lzdGVyIFdvcmQxNiBmaXJzdDsKLSAgICAgICAgcmVnaXN0ZXIgV29yZDE2IGluZGV4OwotICAgICAgICByZWdpc3RlciBXb3JkMTYgcnNpZ247Ci0gICAgICAgIFdvcmQxNiBpbmR4OwotICAgICAgICBXb3JkMTYgX3NpZ25bTkJfUFVMU0VdOwotICAgICAgICBXb3JkMTYgKnAwOwotICAgICAgICBXb3JkMTYgKnAxOwotCi0gICAgICAgIGNvbnN0IFdvcmQxNiAqcHQ7Ci0KLSAgICAgICAgV29yZDMyIHM7Ci0KLSAgICAgICAgcHQgPSB0cmFja1RhYmxlICsgc3ViTnIgKyAoc3ViTnIgPDwgMik7Ci0KLSAgICAgICAgZm9yIChpID0gMDsgaSA8IExfQ09ERTsgaSsrKQotICAgICAgICB7Ci0gICAgICAgICAgICAqKGNvZCArIGkpID0gMDsKLSAgICAgICAgfQotCi0gICAgICAgIGluZHggPSAwOwotICAgICAgICByc2lnbiA9IDA7Ci0KLSAgICAgICAgZm9yIChrID0gMDsgayA8IE5CX1BVTFNFOyBrKyspCi0gICAgICAgIHsKLSAgICAgICAgICAgIGkgPSAqKGNvZHZlYyArIGspOyAgLyogcmVhZCBwdWxzZSBwb3NpdGlvbiAqLwotICAgICAgICAgICAgaiA9ICooZG5fc2lnbiArIGkpOyAvKiByZWFkIHNpZ24gICAgICAgICAgICovCi0KLSAgICAgICAgICAgIHMgPSAoKFdvcmQzMikoaSAqIDY1NTQpKSA+PiAxNTsKLSAgICAgICAgICAgIGluZGV4ID0gKFdvcmQxNikgczsgLyogaW5kZXggPSBwb3MvNSAqLwotCi0gICAgICAgICAgICB0cmFjayA9IGkgLSAoNSAqIGluZGV4KTsgICAgLyogdHJhY2sgPSBwb3MlNSAqLwotCi0gICAgICAgICAgICBmaXJzdCA9ICoocHQgKyB0cmFjayk7Ci0KLQotICAgICAgICAgICAgaWYgKGsgPT0gMCkKLSAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICB0cmFjayA9IDA7Ci0KLSAgICAgICAgICAgICAgICBpZiAoZmlyc3QgIT0gMCkKLSAgICAgICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgICAgIGluZGV4ICs9IDY0OyAgLyogdGFibGUgYml0IGlzIE1TQiAqLwotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgIH0KLSAgICAgICAgICAgIGVsc2UKLSAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICB0cmFjayA9IDE7Ci0gICAgICAgICAgICAgICAgaW5kZXggPDw9IDM7Ci0gICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgIGlmIChqID4gMCkKLSAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAqKGNvZCArIGkpID0gODE5MTsKLSAgICAgICAgICAgICAgICAqKF9zaWduICsgaykgPSAzMjc2NzsKLSAgICAgICAgICAgICAgICByc2lnbiArPSAoMSA8PCB0cmFjayk7Ci0gICAgICAgICAgICB9Ci0gICAgICAgICAgICBlbHNlCi0gICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgKihjb2QgKyBpKSA9IH4oODE5MikgKyAxOwotICAgICAgICAgICAgICAgICooX3NpZ24gKyBrKSA9IChXb3JkMTYpKH4oMzI3NjgpICsgMSk7Ci0gICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgIGluZHggKz0gaW5kZXg7Ci0gICAgICAgIH0KLQotICAgICAgICAqc2lnbiA9IHJzaWduOwotCi0gICAgICAgIHAwID0gaCAtICpjb2R2ZWM7Ci0gICAgICAgIHAxID0gaCAtICooY29kdmVjICsgMSk7Ci0KLSAgICAgICAgZm9yIChpID0gMDsgaSA8IExfQ09ERTsgaSsrKQotICAgICAgICB7Ci0gICAgICAgICAgICBzID0gMDsKLSAgICAgICAgICAgIHMgPQotICAgICAgICAgICAgICAgIExfbXVsdCgKLSAgICAgICAgICAgICAgICAgICAgKnAwKyssCi0gICAgICAgICAgICAgICAgICAgICpfc2lnbiwKLSAgICAgICAgICAgICAgICAgICAgcE92ZXJmbG93KTsKLQotICAgICAgICAgICAgcyA9Ci0gICAgICAgICAgICAgICAgTF9tYWMoCi0gICAgICAgICAgICAgICAgICAgIHMsCi0gICAgICAgICAgICAgICAgICAgICpwMSsrLAotICAgICAgICAgICAgICAgICAgICAqKF9zaWduICsgMSksCi0gICAgICAgICAgICAgICAgICAgIHBPdmVyZmxvdyk7Ci0KLSAgICAgICAgICAgICooeSArIGkpID0KLSAgICAgICAgICAgICAgICBwdl9yb3VuZCgKLSAgICAgICAgICAgICAgICAgICAgcywKLSAgICAgICAgICAgICAgICAgICAgcE92ZXJmbG93KTsKLSAgICAgICAgfQotCi0gICAgICAgIHJldHVybihpbmR4KTsKLSAgICB9Ci0KLSAgICAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLQotICAgIC8qCi0gICAgLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tCi0gICAgIEZVTkNUSU9OIE5BTUU6IFRlc3RfYnVpbGRfY29kZQotICAgIC0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLQotICAgICBJTlBVVCBBTkQgT1VUUFVUIERFRklOSVRJT05TCi0KLSAgICAgSW5wdXRzOgotICAgICAgICBzdWJOciA9IHN1YmZyYW1lIG51bWJlciAoV29yZDE2KQotICAgICAgICBjb2R2ZWMgPSB2ZWN0b3IgY29udGFpbmluZyB0aGUgcG9zaXRpb24gb2YgcHVsc2VzIChXb3JkMTYpCi0gICAgICAgIGRuX3N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dvcmQxNiBUZXN0X2J1aWxkX2NvZGUoCi0gICAgICAgIFdvcmQxNiBzdWJOciwgICAgICAvKiBpIDogc3ViZnJhbWUgbnVtYmVyICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0gICAgICAgIFdvcmQxNiBjb2R2ZWNbXSwgICAvKiBpIDogcG9zaXRpb24gb2YgcHVsc2VzICAgICAgICAgICAgICAgICAgICAgICAgICovCi0gICAgICAgIFdvcmQxNiBkbl9zaWduW10sICAvKiBpIDogc2lnbiBvZiBwdWxzZXMgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0gICAgICAgIFdvcmQxNiBjb2RbXSwgICAgICAvKiBvIDogaW5ub3ZhdGl2ZSBjb2RlIHZlY3RvciAgICAgICAgICAgICAgICAgICAgICovCi0gICAgICAgIFdvcmQxNiBoW10sICAgICAgICAvKiBpIDogaW1wdWxzZSByZXNwb25zZSBvZiB3ZWlnaHRlZCBzeW50aGVzaXMgICAgICovCi0gICAgICAgIC8qICAgICBmaWx0ZXIgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLSAgICAgICAgV29yZDE2IHlbXSwgICAgICAgIC8qIG8gOiBmaWx0ZXJlZCBpbm5vdmF0aXZlIGNvZGUgICAgICAgICAgICAgICAgICAgKi8KLSAgICAgICAgV29yZDE2IHNpZ25bXSwgICAgIC8qIG8gOiBzaWduIG9mIDIgcHVsc2VzICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLSAgICAgICAgRmxhZyAgICogcE92ZXJmbG93IC8qIG8gOiBGbGFnIHNldCB3aGVuIG92ZXJmbG93IG9jY3VycyAgICAgICAgICAgICAgKi8KLSAgICApCi0gICAgewotICAgICAgICBXb3JkMTYgIHRlc3RfaW5kZXg7Ci0KLSAgICAgICAgLyotLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tCi0gICAgICAgICBDQUxMIGJ1aWxkX2NvZGUgKCBzdWJOciA9IHN1Yk5yCi0gICAgICAgICAgICAgICAgICAgY29kdmVjID0gY29kdmVjCi0gICAgICAgICAgICAgICAgICAgZG5fc2lnbiA9IGRuX3NpZ24KLSAgICAgICAgICAgICAgICAgICBjb2QgPSBjb2QKLSAgICAgICAgICAgICAgICAgICBoID0gaAotICAgICAgICAgICAgICAgICAgIHkgPSB5Ci0gICAgICAgICAgICAgICAgICAgc2lnbiA9IHNpZ24gKQotICAgICAgICAgICBNT0RJRllJTkcobm90aGluZykKLSAgICAgICAgICAgUkVUVVJOSU5HKGluZHgpCi0gICAgICAgIC0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0qLwotICAgICAgICB0ZXN0X2luZGV4ID0KLSAgICAgICAgICAgIGJ1aWxkX2NvZGUoCi0gICAgICAgICAgICAgICAgc3ViTnIsCi0gICAgICAgICAgICAgICAgY29kdmVjLAotICAgICAgICAgICAgICAgIGRuX3NpZ24sCi0gICAgICAgICAgICAgICAgY29kLAotICAgICAgICAgICAgICAgIGgsCi0gICAgICAgICAgICAgICAgeSwKLSAgICAgICAgICAgICAgICBzaWduLAotICAgICAgICAgICAgICAgIHBPdmVyZmxvdyk7Ci0KLSAgICAgICAgcmV0dXJuKHRlc3RfaW5kZXgpOwotICAgIH0KLQotI2lmZGVmIF9fY3BsdXNwbHVzCi19Ci0jZW5kaWYKZGlmZiAtLWdpdCBhL21lZGlhL2xpYnN0YWdlZnJpZ2h0L2NvZGVjcy9hbXJuYi9lbmMvc3JjL2MyXzlwZi5oIGIvbWVkaWEvbGlic3RhZ2VmcmlnaHQvY29kZWNzL2Ftcm5iL2VuYy9zcmMvYzJfOXBmLmgKZGVsZXRlZCBmaWxlIG1vZGUgMTAwNjQ0CmluZGV4IDIwM2UxZDkuLjAwMDAwMDAKLS0tI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LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLQotICAgIDsgR0xPQkFMIEZVTkNUSU9OIERFRklOSVRJT05TCi0gICAgOyBGdW5jdGlvbiBQcm90b3R5cGUgZGVjbGFyYXRpb24KLSAgICAtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tKi8KLSAgICBXb3JkMTYgY29kZV8yaTQwXzliaXRzKAotICAgICAgICBXb3JkMTYgc3ViTnIsICAgICAgIC8qIGkgOiBzdWJmcmFtZSBudW1iZXIgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLSAgICAgICAgV29yZDE2IHhbXSwgICAgICAgICAvKiBpIDogdGFyZ2V0IHZlY3RvciAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0gICAgICAgIFdvcmQxNiBoW10sICAgICAgICAgLyogaSA6IGltcHVsc2UgcmVzcG9uc2Ugb2Ygd2VpZ2h0ZWQgc3ludGhlc2lzIGZpbHRlciAqLwotICAgICAgICAvKiAgICAgaFstTF9zdWJmci4uLTFdIG11c3QgYmUgc2V0IHRvIHplcm8uICAgICAgICAgICovCi0gICAgICAgIFdvcmQxNiBUMCwgICAgICAgICAgLyogaSA6IFBpdGNoIGxhZyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotICAgICAgICBXb3JkMTYgcGl0Y2hfc2hhcnAsIC8qIGkgOiBMYXN0IHF1YW50aXplZCBwaXRjaCBnYWluICAgICAgICAgICAgICAgICAgICAgKi8KLSAgICAgICAgV29yZDE2IGNvZGVbXSwgICAgICAvKiBvIDogSW5ub3ZhdGl2ZSBjb2RlYm9vayAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0gICAgICAgIFdvcmQxNiB5W10sICAgICAgICAgLyogbyA6I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LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLQotOyBMT0NBTCBGVU5DVElPTiBERUZJTklUSU9OUwotOyBGdW5jdGlvbiBQcm90b3R5cGUgZGVjbGFyYXRpb24KLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0qLwotc3RhdGljIHZvaWQgc2VhcmNoXzNpNDAoCi0gICAgV29yZDE2IGRuW10sICAgICAgICAvKiBpIDogY29ycmVsYXRpb24gYmV0d2VlbiB0YXJnZXQgYW5kIGhbXSAgICAgICAgICAgICovCi0gICAgV29yZDE2IGRuMltdLCAgICAgICAvKiBpIDogbWF4aW11bSBvZiBjb3JyLiBpbiBlYWNoIHRyYWNrLiAgICAgICAgICAgICAgICovCi0gICAgV29yZDE2IHJyW11bTF9DT0RFXSwvKiBpIDogbWF0cml4IG9mIGF1dG9jb3JyZWxhdGlvbiAgICAgICAgICAgICAgICAgICAgICovCi0gICAgV29yZDE2IGNvZHZlY1tdLCAgICAvKiBvIDogYWxnZWJyYWljIGNvZGVib29rIHZlY3RvciAgICAgICAgICAgICAgICAgICAgICovCi0gICAgRmxhZyAgICogcE92ZXJmbG93ICAvKiBvIDogRmxhZyBzZXQgd2hlbiBvdmVyZmxvdyBvY2N1cnMgICAgICAgICAgICAgICAgICovCi0pOwotCi1zdGF0aWMgV29yZDE2IGJ1aWxkX2NvZGUoCi0gICAgV29yZDE2IGNvZHZlY1tdLCAgICAvKiBpIDogYWxnZWJyYWljIGNvZGVib29rIHZlY3RvciAgICAgICAgICAgICAgICAgICAgICovCi0gICAgV29yZDE2IGRuX3NpZ25bXSwgICAvKiBpIDogc2lnbiBvZiBkbltdICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0gICAgV29yZDE2IGNvZFtdLC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xhZyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotICAgIFdvcmQxNiBwaXRjaF9zaGFycCwgLyogaSA6IExhc3QgcXVhbnRpemVkIHBpdGNoIGdhaW4gICAgICAgICAgICAgICAgICAgICAqLwotICAgIFdvcmQxNiBjb2RlW10sICAgICAgLyogbyA6IElubm92YXRpdmUgY29kZWJvb2sgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotICAgIFdvcmQxNiB5W10sICAgICAgICAgLyogbyA6IGZpbHRlcmVkIGZpeGVkIGNvZGVib29rIGV4Y2l0YXRpb24gICAgICAgICAgICAqLwotICAgIFdvcmQxNiAqIHNpZ24sICAgICAgLyogbyA6IFNpZ25zIG9mIDMgcHVsc2VzICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotICAgIEZsYWcgICAqIHBPdmVyZmxvdyAgLyogbyA6IEZsYWcgc2V0IHdoZW4gb3ZlcmZsb3cgb2NjdXJzICAgICAgICAgICAgICAgICAqLwotKQotewotICAgIFdvcmQxNiBjb2R2ZWNbTkJfUFVMU0VdOwotICAgIFdvcmQxNiBkbltMX0NPREVdOwotICAgIFdvcmQxNiBkbjJbTF9DT0RFXTsKLSAgICBXb3JkMTYgZG5fc2lnbltMX0NPREVdOwotICAgIFdvcmQxNiBycltMX0NPREVdW0xfQ09ERV07Ci0gICAgV29yZDE2IGk7Ci0gICAgV29yZDE2IGluZGV4OwotICAgIFdvcmQxNiBzaGFycDsKLSAgICBXb3JkMTYgdGVtcFdvcmQ7Ci0KLSAgICAvKiBzaGFycCA9IHNobChwaXRjaF9zaGFycCwgMSwgcE92ZXJmbG93KTsgKi8KLSAgICBzaGFycCA9IHBpdGNoX3NoYXJwIDw8IDE7Ci0KLSAgICBpZiAoVDAgPCBMX0NPREUpCi0gICAgewotICAgICAgICBmb3IgKGkgPSBUMDsgaSA8IExfQ09ERTsgaSsrKQotICAgICAgICB7Ci0gICAgICAgICAgICB0ZW1wV29yZCA9Ci0gICAgICAgICAgICAgICAgbXVsdCgKLSAgICAgICAgICAgICAgICAgICAgaFtpIC0gVDBdLAotICAgICAgICAgICAgICAgICAgICBzaGFycCwKLSAgICAgICAgICAgICAgICAgICAgcE92ZXJmbG93KTsKLQotICAgICAgICAgICAgaFtpXSA9Ci0gICAgICAgICAgICAgICAgYWRkKAotICAgICAgICAgICAgICAgICAgICBoW2ldLAotICAgICAgICAgICAgICAgICAgICB0ZW1wV29yZCwKLSAgICAgICAgICAgICAgICAgICAgcE92ZXJmbG93KTsKLSAgICAgICAgfQotICAgIH0KLQotICAgIGNvcl9oX3goCi0gICAgICAgIGgsCi0gICAgICAgIHgsCi0gICAgICAgIGRuLAotICAgICAgICAxLAotICAgICAgICBwT3ZlcmZsb3cpOwotCi0gICAgc2V0X3NpZ24oCi0gICAgICAgIGRuLAotICAgICAgICBkbl9zaWduLAotICAgICAgICBkbjIsCi0gICAgICAgIDYpOwotCi0gICAgY29yX2goCi0gICAgICAgIGgsCi0gICAgICAgIGRuX3NpZ24sCi0gICAgICAgIHJyLAotICAgICAgICBwT3ZlcmZsb3cpOwotCi0gICAgc2VhcmNoXzNpNDAoCi0gICAgICAgIGRuLAotICAgICAgICBkbjIsCi0gICAgICAgIHJyLAotICAgICAgICBjb2R2ZWMsCi0gICAgICAgIHBPdmVyZmxvdyk7Ci0KLSAgICAvKiBmdW5jdGlvbiByZXN1bHQgKi8KLSAgICBpbmRleCA9Ci0gICAgICAgIGJ1aWxkX2NvZGUoCi0gICAgICAgICAgICBjb2R2ZWMsCi0gICAgICAgICAgICBkbl9zaWduLAotICAgICAgICAgICAgY29kZSwKLSAgICAgICAgICAgIGgsCi0gICAgICAgICAgICB5LAotICAgICAgICAgICAgc2lnbiwKLSAgICAgICAgICAgIHBPdmVyZmxvdyk7Ci0KLSAgICAvKi0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tKgotICAgICogQ29tcHV0ZSBpbm5vdmF0aW9uIHZlY3RvciBnYWluLiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICoKLSAgICAqIEluY2x1ZGUgZml4ZWQtZ2FpbiBwaXRjaCBjb250cmlidXRpb24gaW50byBjb2RlW10uICAgICAgICAgICAgICAqCi0gICAgKi0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tKi8KLQotICAgIGlmIChUMCA8IExfQ09ERSkKLSAgICB7Ci0gICAgICAgIGZvciAoaSA9IFQwOyBpIDwgTF9DT0RFOyBpKyspCi0gICAgICAgIHsKLSAgICAgICAgICAgIHRlbXBXb3JkID0KLSAgICAgICAgICAgICAgICBtdWx0KAotICAgICAgICAgICAgICAgICAgICBjb2RlW2kgLSBUMF0sCi0gICAgICAgICAgICAgICAgICAgIHNoYXJwLAotICAgICAgICAgICAgICAgICAgICBwT3ZlcmZsb3cpOwotCi0gICAgICAgICAgICBjb2RlW2ldID0KLSAgICAgICAgICAgICAgICBhZGQoCi0gICAgICAgICAgICAgICAgICAgIGNvZGVbaV0sCi0gICAgICAgICAgICAgICAgICAgIHRlbXBXb3JkLAotICAgICAgICAgICAgICAgICAgICBwT3ZlcmZsb3cpOwotICAgICAgICB9Ci0gICAgfQotICAgIHJldHVybiBpbmRleDsKLX0KLQotLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0KLS8qCi0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0KLSBGVU5DVElPTiBOQU1FOiBzZWFyY2hfM2k0MAotLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0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tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSoKLSAgICAgICAgICAgICAqIG1haW4gbG9vcDogdHJ5IDMgdHJhY2tzLiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKgotICAgICAgICAgICAgICotLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0qLwotCi0gICAgICAgICAgICBmb3IgKGkgPSAwOyBpIDwgTkJfUFVMU0U7IGkrKykKLSAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAvKi0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0qCi0gICAgICAgICAgICAgICAgICogaTAgbG9vcDogdHJ5IDggcG9zaXRpb25zLiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKgotICAgICAgICAgICAgICAgICAqLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSovCi0KLSAgICAgICAgICAgICAgICAvKiBhY2NvdW50IGZvciBwdHIuIGluaXQuIChycltpb10pICovCi0gICAgICAgICAgICAgICAgZm9yIChpMCA9IGlwb3NbMF07IGkwIDwgTF9DT0RFOyBpMCArPSBTVEVQKQotICAgICAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAgICAgaWYgKGRuMltpMF0gPj0gMCkKLSAgICAgICAgICAgICAgICAgICAgewotICAgICAgICAgICAgICAgICAgICAgICAgcHMwID0gZG5baTBdOwotCi0gICAgICAgICAgICAgICAgICAgICAgICAvKiBhbHAwID0gTF9tdWx0KHJyW2kwXVtpMF0sXzFfNCwgcE92ZXJmbG93KTsgKi8KLSAgICAgICAgICAgICAgICAgICAgICAgIGFscDAgPSAoV29yZDMyKSBycltpMF1baTBdIDw8IDE0OwotCi0gICAgICAgICAgICAgICAgICAgICAgICAvKi0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0qCi0gICAgICAgICAgICAgICAgICAgICAgICAgKiBpMSBsb29wOiA4IHBvc2l0aW9ucy4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqCi0gICAgICAgICAgICAgICAgICAgICAgICAgKi0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0qLwotCi0gICAgICAgICAgICAgICAgICAgICAgICBzcSA9IC0xOwotICAgICAgICAgICAgICAgICAgICAgICAgYWxwID0gMTsKLSAgICAgICAgICAgICAgICAgICAgICAgIHBzID0gMDsKLSAgICAgICAgICAgICAgICAgICAgICAgIGl4ID0gaXBvc1sxXTsKLQotICAgICAgICAgICAgICAgICAgICAgICAgLyogaW5pdGlhbGl6ZSA0IGluZGV4IGZvciBuZXh0IGxvb3AuICovCi0gICAgICAgICAgICAgICAgICAgICAgICAvKi0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0qCi0gICAgICAgICAgICAgICAgICAgICAgICAgKiAgVGhlc2UgaW5kZXggaGF2ZSBsb3cgY29tcGxleGl0eSBhZGRyZXNzIGNvbXB1dGF0aW9uIGJlY2F1c2UgICAgICAqCi0gICAgICAgICAgICAgICAgICAgICAgICAgKiAgdGhleSBhcmUsIGluIGZhY3QsIHBvaW50ZXJzIHdpdGggZml4ZWQgaW5jcmVtZW50LiAgRm9yIGV4YW1wbGUsICAqCi0gICAgICAgICAgICAgICAgICAgICAgICAgKiAgInJyW2kwXVtpMl0iIGlzIGEgcG9pbnRlciBpbml0aWFsaXplZCB0byAiJnJyW2kwXVtpcG9zWzJdXSIgICAgICAqCi0gICAgICAgICAgICAgICAgICAgICAgICAgKiAgYW5kIGluY3JlbWVudGVkIGJ5ICJTVEVQIi4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqCi0gICAgICAgICAgICAgICAgICAgICAgICAgKi0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0qLwotCi0gICAgICAgICAgICAgICAgICAgICAgICBmb3IgKGkxID0gaXBvc1sxXTsgaTEgPCBMX0NPREU7IGkxICs9IFNURVApCi0gICAgICAgICAgICAgICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgLyogaWR4IGluY3JlbWVudCA9IFNURVAgKi8KLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAvKiBwczEgPSBhZGQocHMwLCBkbltpMV0sIHBPdmVyZmxvdyk7ICovCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgcHMxID0gcHMwICsgZG5baTFdOwotCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgLyogYWxwMSA9IGFscDAgKyBycltpMF1baTFdICsgMS8yKnJyW2kxXVtpMV07ICovCi0KLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAvKiBpZHggaW5jciA9IFNURVAgKi8KLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAvKiBhbHAxID0gTF9tYWMoYWxwMCwgcnJbaTFdW2kxXSwgXzFfNCwgcE92ZXJmbG93KTsgKi8KLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBhbHAxID0gYWxwMCArICgoV29yZDMyKSBycltpMV1baTFdIDw8IDE0KTsKLQotICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8qIGlkeCBpbmNyID0gU1RFUCAqLwotICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8qIGFscDEgPSBMX21hYyhhbHAxLCBycltpMF1baTFdLCBfMV8yLCBwT3ZlcmZsb3cpOyAqLwotICAgICAgICAgICAgICAgICAgICAgICAgICAgIGFscDEgKz0gKFdvcmQzMikgcnJbaTBdW2kxXSA8PCAxNTsKLQotICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8qIHNxMSA9IG11bHQocHMxLCBwczEsIHBPdmVyZmxvdyk7ICovCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgc3ExID0gKFdvcmQxNikoKChXb3JkMzIpIHBzMSAqIHBzMSkgPj4gMTUpOwotCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgLyogYWxwXzE2ID0gcHZfcm91bmQoYWxwMSwgcE92ZXJmbG93KTsgKi8KLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBhbHBfMTYgPSAoV29yZDE2KSgoYWxwMSArIChXb3JkMzIpIDB4MDAwMDgwMDBMKSA+PiAxNik7Ci0KLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAvKiBzID0gTF9tdWx0KGFscCwgc3ExLCBwT3ZlcmZsb3cpOyAqLwotICAgICAgICAgICAgICAgICAgICAgICAgICAgIHMgPSAoKFdvcmQzMikgYWxwICogc3ExKSA8PCAxOwotCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgLyogcyA9IExfbXN1KHMsIHNxLCBhbHBfMTYsIHBPdmVyZmxvdyk7ICovCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgcyAtPSAoKChXb3JkMzIpIHNxICogYWxwXzE2KSA8PCAxKTsKLQotICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChzID4gMCkKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNxID0gc3ExOwotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwcyA9IHBzMTsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYWxwID0gYWxwXzE2OwotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpeCA9IGkxOwotICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICAgICAgICAgIGkxID0gaXg7Ci0KLSAgICAgICAgICAgICAgICAgICAgICAgIC8qLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSoKLSAgICAgICAgICAgICAgICAgICAgICAgICAqIGkyIGxvb3A6IDggcG9zaXRpb25zLiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICoKLSAgICAgICAgICAgICAgICAgICAgICAgICAqLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSovCi0KLSAgICAgICAgICAgICAgICAgICAgICAgIHBzMCA9IHBzOwotCi0gICAgICAgICAgICAgICAgICAgICAgICAvKiBhbHAwID0gTF9tdWx0KGFscCwgXzFfNCwgcE92ZXJmbG93KTsgKi8KLSAgICAgICAgICAgICAgICAgICAgICAgIGFscDAgPSAoV29yZDMyKSBhbHAgPDwgMTQ7Ci0KLSAgICAgICAgICAgICAgICAgICAgICAgIHNxID0gLTE7Ci0gICAgICAgICAgICAgICAgICAgICAgICBhbHAgPSAxOwotICAgICAgICAgICAgICAgICAgICAgICAgcHMgPSAwOwotICAgICAgICAgICAgICAgICAgICAgICAgaXggPSBpcG9zWzJdOwotCi0gICAgICAgICAgICAgICAgICAgICAgICAvKiBpbml0aWFsaXplIDQgaW5kZXggZm9yIG5leHQgbG9vcCAoc2VlIGkxIGxvb3ApICovCi0KLSAgICAgICAgICAgICAgICAgICAgICAgIGZvciAoaTIgPSBpcG9zWzJdOyBpMiA8IExfQ09ERTsgaTIgKz0gU1RFUCkKLSAgICAgICAgICAgICAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAvKiBpbmRleCBpbmNyZW1lbnQgPSBTVEVQICovCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgLyogcHMxID0gYWRkKHBzMCwgZG5baTJdLCBwT3ZlcmZsb3cpOyAqLwotICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBzMSA9IHBzMCArIGRuW2kyXTsKLQotICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8qIGFscDEgPSBhbHAwICsgcnJbaTBdW2kyXSArIHJyW2kxXVtpMl0gKyAxLzIqcnJbaTJdW2kyXTsgKi8KLQotICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8qIGlkeCBpbmNyID0gU1RFUCAqLwotICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8qIGFscDEgPSBMX21hYyhhbHAwLCBycltpMl1baTJdLCBfMV8xNiwgcE92ZXJmbG93KTsgKi8KLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBhbHAxID0gYWxwMCArICgoV29yZDMyKSBycltpMl1baTJdIDw8IDEyKTsKLQotICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8qIGlkeCBpbmNyID0gU1RFUCAqLwotICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8qIGFscDEgPSBMX21hYyhhbHAxLCBycltpMV1baTJdLCBfMV84LCBwT3ZlcmZsb3cpOyAqLwotICAgICAgICAgICAgICAgICAgICAgICAgICAgIGFscDEgKz0gKFdvcmQzMikgcnJbaTFdW2kyXSA8PCAxMzsKLQotICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8qIGlkeCBpbmNyID0gU1RFUCAqLwotICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8qIGFscDEgPSBMX21hYyhhbHAxLHJyW2kwXVtpMl0sIF8xXzgsIHBPdmVyZmxvdyk7ICovCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgYWxwMSArPSAoV29yZDMyKSBycltpMF1baTJdIDw8IDEzOwotCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgLyogc3ExID0gbXVsdChwczEsIHBzMSwgcE92ZXJmbG93KTsgKi8KLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBzcTEgPSAoV29yZDE2KSgoKFdvcmQzMikgcHMxICogcHMxKSA+PiAxNSk7Ci0KLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAvKiBhbHBfMTYgPSBwdl9yb3VuZChhbHAxLCBwT3ZlcmZsb3cpOyAqLwotICAgICAgICAgICAgICAgICAgICAgICAgICAgIGFscF8xNiA9IChXb3JkMTYpKChhbHAxICsgKFdvcmQzMikgMHgwMDAwODAwMEwpID4+IDE2KTsKLQotICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8qIHMgPSBMX211bHQoYWxwLCBzcTEsIHBPdmVyZmxvdyk7ICovCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgcyA9ICgoV29yZDMyKSBhbHAgKiBzcTEpIDw8IDE7Ci0KLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAvKiBzID0gTF9tc3Uocywgc3EsIGFscF8xNiwgcE92ZXJmbG93KTsgKi8KLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBzIC09ICgoKFdvcmQzMikgc3EgKiBhbHBfMTYpIDw8IDEpOwotCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHMgPiAwKQotICAgICAgICAgICAgICAgICAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc3EgPSBzcTE7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBzID0gcHMxOwotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBhbHAgPSBhbHBfMTY7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGl4ID0gaTI7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgICAgICAgICAgaTIgPSBpeDsKLQotICAgICAgICAgICAgICAgICAgICAgICAgLyogbWVtb3JpemUgY29kZXZlY3RvciBpZiB0aGlzIG9uZQotICAgICAgICAgICAgICAgICAgICAgICAgICogaXMgYmV0dGVyIHRoYW4gdGhlIGxhc3Qgb25lLgotICAgICAgICAgICAgICAgICAgICAgICAgICovCi0KLSAgICAgICAgICAgICAgICAgICAgICAgIHMgPSBMX211bHQoYWxwaywgc3EsIHBPdmVyZmxvdyk7Ci0gICAgICAgICAgICAgICAgICAgICAgICAvL3MgPSAoKFdvcmQzMikgYWxwayAqIHNxKSA8PCAxOwotCi0gICAgICAgICAgICAgICAgICAgICAgICBzID0gTF9tc3UocywgcHNrLCBhbHAsIHBPdmVyZmxvdyk7Ci0gICAgICAgICAgICAgICAgICAgICAgICAvL3MgLT0gKCgoV29yZDMyKSBwc2sgKiBhbHApIDw8IDEpOwotCi0gICAgICAgICAgICAgICAgICAgICAgICBpZiAocyA+IDApCi0gICAgICAgICAgICAgICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgcHNrID0gc3E7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgYWxwayA9IGFscDsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBwX2NvZHZlYyA9ICZjb2R2ZWNbMF07Ci0KLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAqKHBfY29kdmVjKyspID0gaTA7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgKihwX2NvZHZlYysrKSA9IGkxOwotICAgICAgICAgICAgICAgICAgICAgICAgICAgICoocF9jb2R2ZWMpID0gaTI7Ci0gICAgICAgICAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgLyotLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tKgotICAgICAgICAgICAgICAgICAqIEN5Y2xpYyBwZXJtdXRhdGlvbiBvZiBpMCwgaTEgYW5kIGkyLiAgICAgICAgICAgICAgICAgICAgICAgICAgICoKLSAgICAgICAgICAgICAgICAgKi0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0qLwotCi0gICAgICAgICAgICAgICAgcG9zID0gaXBvc1syXTsKLSAgICAgICAgICAgICAgICBpcG9zWzJdID0gaXBvc1sxXTsKLSAgICAgICAgICAgICAgICBpcG9zWzFdID0gaXBvc1swXTsKLSAgICAgICAgICAgICAgICBpcG9zWzBdID0gcG9zOwotICAgICAgICAgICAgfQotICAgICAgICB9Ci0gICAgfQotICAgIHJldHVybjsKLX0KLQotLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0KLS8qCi0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0KLSBGVU5DVElPTiBOQU1FOiAgYnVpbGRfY29kZSgpCi0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0KLSBJTlBVVCBBTkQgT1VUUFVUIERFRklOSVRJT05TCi0KLSBJbnB1dHM6Ci0gICAgY29kdmVjW10gICBBcnJheSBvZiB0eXBlIFdvcmQxNiAtLSBwb3NpdGlvbiBvZiBwdWxzZXMKLSAgICBkbl9zaWduW10gIEFycmF5IG9mIHR5cGUgV29yZDE2IC0tIHNpZ24gb2YgcHVsc2VzCi0gICAgaFtdICAgICAgICBBcnJheSBvZiB0eXBlIFdvcmQxNiAtLSBpbXB1bHNlIHJlc3BvbnNlIG9mCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC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GkgLSAoV29yZDE2KSBzOwotCi0gICAgICAgIGlmICh0cmFjayA9PSAxKQotICAgICAgICB7Ci0gICAgICAgICAgICAvKiBpbmRleCA9IHNobChpbmRleCwgNCwgcE92ZXJmbG93KTsgKi8KLSAgICAgICAgICAgIGluZGV4IDw8PSA0OwotICAgICAgICB9Ci0gICAgICAgIGVsc2UgaWYgKHRyYWNrID09IDIpCi0gICAgICAgIHsKLSAgICAgICAgICAgIHRyYWNrID0gMjsKLQotICAgICAgICAgICAgLyogaW5kZXggPSBzaGwoaW5kZXgsIDgsIHBPdmVyZmxvdyk7ICovCi0gICAgICAgICAgICBpbmRleCA8PD0gODsKLSAgICAgICAgfQotICAgICAgICBlbHNlIGlmICh0cmFjayA9PSAzKQotICAgICAgICB7Ci0gICAgICAgICAgICB0cmFjayA9IDE7Ci0KLSAgICAgICAgICAgIC8qIGluZGV4ID0gc2hsKGluZGV4LCA0LCBwT3ZlcmZsb3cpOyAqLwotICAgICAgICAgICAgaW5kZXggPDw9IDQ7Ci0KLSAgICAgICAgICAgIC8qIGluZGV4ID0gYWRkKGluZGV4LCA4LCBwT3ZlcmZsb3cpOyAqLwotICAgICAgICAgICAgaW5kZXggKz0gODsKLSAgICAgICAgfQotICAgICAgICBlbHNlIGlmICh0cmFjayA9PSA0KQotICAgICAgICB7Ci0gICAgICAgICAgICB0cmFjayA9IDI7Ci0KLSAgICAgICAgICAgIC8qIGluZGV4ID0gc2hsKGluZGV4LCA4LCBwT3ZlcmZsb3cpOyAqLwotICAgICAgICAgICAgaW5kZXggPDw9IDg7Ci0KLSAgICAgICAgICAgIC8qIGluZGV4ID0gYWRkKGluZGV4LCAxMjgsIHBPdmVyZmxvdyk7ICovCi0gICAgICAgICAgICBpbmRleCArPSAxMjg7Ci0gICAgICAgIH0KLQotICAgICAgICBpZiAoaiA+IDApCi0gICAgICAgIHsKLSAgICAgICAgICAgIGNvZFtpXSA9IDgxOTE7Ci0gICAgICAgICAgICBfc2lnbltrXSA9IDMyNzY3OwotCi0gICAgICAgICAgICAvKiB0cmFjayA9IHNobCgxLCB0cmFjaywgcE92ZXJmbG93KTsgKi8KLSAgICAgICAgICAgIHRyYWNrID0gMSA8PCB0cmFjazsKLQotICAgICAgICAgICAgLyogcnNpZ24gPSBhZGQocnNpZ24sIHRyYWNrLCBwT3ZlcmZsb3cpOyAqLwotICAgICAgICAgICAgcnNpZ24gKz0gdHJhY2s7Ci0gICAgICAgIH0KLSAgICAgICAgZWxzZQotICAgICAgICB7Ci0gICAgICAgICAgICBjb2RbaV0gPSAtODE5MjsKLSAgICAgICAgICAgIF9zaWduW2tdID0gKFdvcmQxNikgLSAzMjc2OEw7Ci0gICAgICAgIH0KLQotICAgICAgICAvKiBpbmR4ID0gYWRkKGluZHgsIGluZGV4LCBwT3ZlcmZsb3cpOyAqLwotICAgICAgICBpbmR4ICs9IGluZGV4OwotICAgIH0KLSAgICAqc2lnbiA9IHJzaWduOwotCi0gICAgcDAgPSBoIC0gY29kdmVjWzBdOwotICAgIHAxID0gaCAtIGNvZHZlY1sxXTsKLSAgICBwMiA9IGggLSBjb2R2ZWNbMl07Ci0KLSAgICBmb3IgKGkgPSAwOyBpIDwgTF9DT0RFOyBpKyspCi0gICAgewotICAgICAgICBzID0gMDsKLSAgICAgICAgcyA9Ci0gICAgICAgICAgICBMX21hYygKLSAgICAgICAgICAgICAgICBzLAotICAgICAgICAgICAgICAgICpwMCsrLAotICAgICAgICAgICAgICAgIF9zaWduWzBdLAotICAgICAgICAgICAgICAgIHBPdmVyZmxvdyk7Ci0KLSAgICAgICAgcyA9Ci0gICAgICAgICAgICBMX21hYygKLSAgICAgICAgICAgICAgICBzLAotICAgICAgICAgICAgICAgICpwMSsrLAotICAgICAgICAgICAgICAgIF9zaWduWzFdLAotICAgICAgICAgICAgICAgIHBPdmVyZmxvdyk7Ci0KLSAgICAgICAgcyA9Ci0gICAgICAgICAgICBMX21hYygKLSAgICAgICAgICAgICAgICBzLAotICAgICAgICAgICAgICAgICpwMisrLA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Bjb3JyZWxhdGlvbiBiZXR3ZWVuIHRhcmdldCBhbmQgaFtdICAgICAgICAgICAgKi8KLSAgICAgICAgV29yZDE2IGRuMltdLCAgICAgICAvKiBpIDogbWF4aW11bSBvZiBjb3JyLiBpbiBlYWNoIHRyYWNrLiAgICAgICAgICAgICAgICovCi0gICAgICAgIFdvcmQxNiBycltdW0xfQ09ERV0sLyogaSA6IG1hdHJpeCBvZiBhdXRvY29ycmVsYXRpb24gICAgICAgICAgICAgICAgICAgICAqLwotICAgICAgICBXb3JkMTYgY29kdmVjW10sICAgIC8qIG8gOiBhbGdlYnJhaWMgY29kZWJvb2sgdmVjdG9yICAgICAgICAgICAgICAgICAgICAgKi8KLSAgICAgICAgRmxhZyAgICogcE92ZXJmbG93ICAvKiBvIDogRmxhZyBzZXQgd2hlbiBvdmVyZmxvdyBvY2N1cnMgICAgICAgICAgICAgICAgICovCi0gICAgKTsKLQotICAgIHN0YXRpYyBXb3JkMTYgYnVpbGRfY29kZSgKLSAgICAgICAgV29yZDE2IGNvZHZlY1tdLCAgICAvKiBpIDogYWxnZWJyYWljIGNvZGVib29rIHZlY3RvciAgICAgICAgICAgICAgICAgICAgICovCi0gICAgICAgIFdvcmQxNiBkbl9zaWduW10sICAgLyogaSA6IHNpZ24gb2YgZG5bXSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotICAgICAgICBXb3JkMTYgY29kW10sICAgICAgIC8qIG8gOiBhbGdlYnJhaWMgKGZpeGVkKSBjb2RlYm9vayBleGNpdGF0aW9uICAgICAgICAgKi8KLSAgICAgICAgV29yZDE2IGhbXSwgICAgICAgICAvKiBpIDogaW1wdWxzZSByZXNwb25zZSBvZiB3ZWlnaHRlZCBzeW50aGVzaXMgZmlsdGVyICovCi0gICAgICAgIFdvcmQxNiB5W10sICAgICAgICAgLyogbyA6IGZpbHRlcmVkIGZpeGVkIGNvZGVib29rIGV4Y2l0YXRpb24gICAgICAgICAgICAqLwotICAgICAgICBXb3JkMTYgc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LTFdIG11c3QgYmUgc2V0IHRvIHplcm8uICAgICAgICAgICovCi0gICAgICAgIFdvcmQxNiBUMCwgICAgICAgICAgLyogaSA6IFBpdGNoIGxhZyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotICAgICAgICBXb3JkMTYgcGl0Y2hfc2hhcnAsIC8qIGkgOiBMYXN0IHF1YW50aXplZCBwaXRjaCBnYWluICAgICAgICAgICAgICAgICAgICAgKi8KLSAgICAgICAgV29yZDE2IGNvZGVbXSwgICAgICAvKiBvIDogSW5ub3ZhdGl2ZSBjb2RlYm9vayAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0gICAgICAgIFdvcmQxNiB5W10sICAgICAgICAgLyogbyA6IGZpbHRlcmVkIGZpeGVkIGNvZGVib29rIGV4Y2l0YXRpb24gICAgICAgICAgICAqLwotICAgICAgICBXb3JkMTYgKiBzaWduLCAgICAgIC8qIG8gOiBTaWducyBvZiA0IHB1bHNlcyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLSAgICAgICAgRmxhZyAgICogcE92ZXJmbG93ICAvKiBvIDogRmxhZyBzZXQgd2hlbiBvdmVyZmxvdyBvY2N1cnMgICAgICAgICAgICAgICAgICovCi0gICAgKQotICAgIHsKLSAgICAgICAgV29yZDE2IGNvZHZlY1tOQl9QVUxTRV07Ci0gICAgICAgIFdvcmQxNiBkbltMX0NPREVdOwotICAgICAgICBXb3JkMTYgZG4yW0xfQ09ERV07Ci0gICAgICAgIFdvcmQxNiBkbl9zaWduW0xfQ09ERV07Ci0KLSAgICAgICAgV29yZDE2IHJyW0xfQ09ERV1bTF9DT0RFXTsKLSAgICAgICAgV29yZDE2IGk7Ci0gICAgICAgIFdvcmQxNiBpbmRleDsKLSAgICAgICAgV29yZDE2IHNoYXJwOwotICAgICAgICBXb3JkMTYgdGVtcFdvcmQ7Ci0KLSAgICAgICAgc2hhcnAgPSBwaXRjaF9zaGFycCA8PCAxOwotCi0gICAgICAgIGlmIChUMCA8IExfQ09ERSkKLSAgICAgICAgewotICAgICAgICAgICAgZm9yIChpID0gVDA7IGkgPCBMX0NPREU7IGkrKykKLSAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICB0ZW1wV29yZCA9Ci0gICAgICAgICAgICAgICAgICAgIG11bHQoCi0gICAgICAgICAgICAgICAgICAgICAgICBoW2kgLSBUMF0sCi0gICAgICAgICAgICAgICAgICAgICAgICBzaGFycCwKLSAgICAgICAgICAgICAgICAgICAgICAgIHBPdmVyZmxvdyk7Ci0KLSAgICAgICAgICAgICAgICBoW2ldID0KLSAgICAgICAgICAgICAgICAgICAgYWRkKAotICAgICAgICAgICAgICAgICAgICAgICAgaFtpXSwKLSAgICAgICAgICAgICAgICAgICAgICAgIHRlbXBXb3JkLAotICAgICAgICAgICAgICAgICAgICAgICAgcE92ZXJmbG93KTsKLSAgICAgICAgICAgIH0KLSAgICAgICAgfQotCi0gICAgICAgIGNvcl9oX3goCi0gICAgICAgICAgICBoLAotICAgICAgICAgICAgeCwKLSAgICAgICAgICAgIGRuLAotICAgICAgICAgICAgMSwKLSAgICAgICAgICAgIHBPdmVyZmxvdyk7Ci0KLSAgICAgICAgc2V0X3NpZ24oCi0gICAgICAgICAgICBkbiwKLSAgICAgICAgICAgIGRuX3NpZ24sCi0gICAgICAgICAgICBkbjIsCi0gICAgICAgICAgICA0KTsKLQotICAgICAgICBjb3JfaCgKLSAgICAgICAgICAgIGgsCi0gICAgICAgICAgICBkbl9zaWduLAotICAgICAgICAgICAgcnIsCi0gICAgICAgICAgICBwT3ZlcmZsb3cpOwotCi0gICAgICAgIHNlYXJjaF80aTQwKAotICAgICAgICAgICAgZG4sCi0gICAgICAgICAgICBkbjIsCi0gICAgICAgICAgICByciwKLSAgICAgICAgICAgIGNvZHZlYywKLSAgICAgICAgICAgIHBPdmVyZmxvdyk7Ci0KLSAgICAgICAgLyogZnVuY3Rpb24gcmVzdWx0ICovCi0gICAgICAgIGluZGV4ID0KLSAgICAgICAgICAgIGJ1aWxkX2NvZGUoCi0gICAgICAgICAgICAgICAgY29kdmVjLAotICAgICAgICAgICAgICAgIGRuX3NpZ24sCi0gICAgICAgICAgICAgICAgY29kZSwKLSAgICAgICAgICAgICAgICBoLAotICAgICAgICAgICAgICAgIHksCi0gICAgICAgICAgICAgICAgc2lnbiwKLSAgICAgICAgICAgICAgICBwT3ZlcmZsb3cpOwotCi0gICAgICAgIC8qLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0qCi0gICAgICAgICogQ29tcHV0ZSBpbm5vdmF0aW9uIHZlY3RvciBnYWluLiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICoKLSAgICAgICAgKiBJbmNsdWRlIGZpeGVkLWdhaW4gcGl0Y2ggY29udHJpYnV0aW9uIGludG8gY29kZVtdLiAgICAgICAgICAgICAgKgotICAgICAgICAqLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0qLwotCi0gICAgICAgIHRlbXBXb3JkID0gVDAgLSBMX0NPREU7Ci0KLSAgICAgICAgaWYgKHRlbXBXb3JkIDwgMCkKLSAgICAgICAgewotICAgICAgICAgICAgZm9yIChpID0gVDA7IGkgPCBMX0NPREU7IGkrKykKLSAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICB0ZW1wV29yZCA9Ci0gICAgICAgICAgICAgICAgICAgIG11bHQoCi0gICAgICAgICAgICAgICAgICAgICAgICBjb2RlW2kgLSBUMF0sCi0gICAgICAgICAgICAgICAgICAgICAgICBzaGFycCwKLSAgICAgICAgICAgICAgICAgICAgICAgIHBPdmVyZmxvdyk7Ci0KLSAgICAgICAgICAgICAgICBjb2RlW2ldID0KLSAgICAgICAgICAgICAgICAgICAgYWRkKAotICAgICAgICAgICAgICAgICAgICAgICAgY29kZVtpXSwKLSAgIC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IFdvcmQxNiBwczE7Ci0gICAgICAgIFdvcmQxNiBzcTsKLSAgICAgICAgV29yZDE2IHNxMTsKLQotICAgICAgICBXb3JkMTYgYWxwazsKLSAgICAgICAgV29yZDE2IGFscDsKLSAgICAgICAgV29yZDE2IGFscF8xNjsKLSAgICAgICAgV29yZDE2ICpwX2NvZHZlYyA9ICZjb2R2ZWNbMF07Ci0KLSAgICAgICAgV29yZDMyIHM7Ci0gICAgICAgIFdvcmQzMiBhbHAwOwotICAgICAgICBXb3JkMzIgYWxwMTsKLQotICAgICAgICBPU0NMX1VOVVNFRF9BUkcocE92ZXJmbG93KTsKLQotICAgICAgICAvKiBEZWZhdWx0IHZhbHVlICovCi0gICAgICAgIHBzayA9IC0xOwotICAgICAgICBhbHBrID0gMTsKLSAgICAgICAgZm9yIChpID0gMDsgaSA8IE5CX1BVTFNFOyBpKyspCi0gICAgICAgIHsKLSAgICAgICAgICAgICoocF9jb2R2ZWMrKykgPSBpOwotICAgICAgICB9Ci0KLSAgICAgICAgZm9yICh0cmFjayA9IDM7IHRyYWNrIDwgNTsgdHJhY2srKykKLSAgICAgICAgewotICAgICAgICAgICAgLyogZml4IHN0YXJ0aW5nIHBvc2l0aW9uICovCi0KLSAgICAgICAgICAgIGlwb3NbMF0gPSAwOwotICAgICAgICAgICAgaXBvc1sxXSA9IDE7Ci0gICAgICAgICAgICBpcG9zWzJdID0gMjsKLSAgICAgICAgICAgIGlwb3NbM10gPSB0cmFjazsKLQotICAgICAgICAgICAgLyotLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0qCi0gICAgICAgICAgICAgKiBtYWluIGxvb3A6IHRyeSA0IHRyYWNrcy4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICoKLSAgICAgICAgICAgICAqLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tKi8KLQotICAgICAgICAgICAgZm9yIChpID0gMDsgaSA8IE5CX1BVTFNFOyBpKyspCi0gICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgLyotLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tKgotICAgICAgICAgICAgICAgICAqIGkwIGxvb3A6IHRyeSA0IHBvc2l0aW9ucyAodXNlIHBvc2l0aW9uIHdpdGggbWF4IG9mIGNvcnIuKS4gICAgICoKLSAgICAgICAgICAgICAgICAgKi0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0qLwotCi0gICAgICAgICAgICAgICAgZm9yIChpMCA9IGlwb3NbMF07IGkwIDwgTF9DT0RFOyBpMCArPSBTVEVQKQotICAgICAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAgICAgaWYgKGRuMltpMF0gPj0gMCkKLSAgICAgICAgICAgICAgICAgICAgewotICAgICAgICAgICAgICAgICAgICAgICAgcHMwID0gZG5baTBdOwotCi0gICAgICAgICAgICAgICAgICAgICAgICBhbHAwID0gKFdvcmQzMikgcnJbaTBdW2kwXSA8PCAxNDsKLQotICAgICAgICAgICAgICAgICAgICAgICAgLyotLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tKgotICAgICAgICAgICAgICAgICAgICAgICAgICogaTEgbG9vcDogOCBwb3NpdGlvbnMuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKgotICAgICAgICAgICAgICAgICAgICAgICAgICotLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tKi8KLQotICAgICAgICAgICAgICAgICAgICAgICAgc3EgPSAtMTsKLSAgICAgICAgICAgICAgICAgICAgICAgIGFscCA9IDE7Ci0gICAgICAgICAgICAgICAgICAgICAgICBwcyA9IDA7Ci0gICAgICAgICAgICAgICAgICAgICAgICBpeCA9IGlwb3NbMV07Ci0KLSAgICAgICAgICAgICAgICAgICAgICAgIC8qIGluaXRpYWxpemUgNCBpbmRleCBmb3IgbmV4dCBsb29wLiAqLwotICAgICAgICAgICAgICAgICAgICAgICAgLyotLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tKgotICAgICAgICAgICAgICAgICAgICAgICAgICogIFRoZXNlIGluZGV4IGhhdmUgbG93IGNvbXBsZXhpdHkgYWRkcmVzcyBjb21wdXRhdGlvbiBiZWNhdXNlICAgICAgKgotICAgICAgICAgICAgICAgICAgICAgICAgICogIHRoZXkgYXJlLCBpbiBmYWN0LCBwb2ludGVycyB3aXRoIGZpeGVkIGluY3JlbWVudC4gIEZvciBleGFtcGxlLCAgKgotICAgICAgICAgICAgICAgICAgICAgICAgICogICJycltpMF1baTNdIiBpcyBhIHBvaW50ZXIgaW5pdGlhbGl6ZWQgdG8gIiZycltpMF1baXBvc1szXV0iICAgICAgKgotICAgICAgICAgICAgICAgICAgICAgICAgICogIGFuZCBpbmNyZW1lbnRlZCBieSAiU1RFUCIuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKgotICAgICAgICAgICAgICAgICAgICAgICAgICotLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tKi8KLQotICAgICAgICAgICAgICAgICAgICAgICAgZm9yIChpMSA9IGlwb3NbMV07IGkxIDwgTF9DT0RFOyBpMSArPSBTVEVQKQotICAgICAgICAgICAgICAgICAgICAgICAgewotICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8qIGlkeCBpbmNyZW1lbnQgPSBTVEVQICovCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgLyogcHMxID0gYWRkKHBzMCwgZG5baTFdLCBwT3ZlcmZsb3cpOyAqLwotICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBzMSA9IHBzMCArIGRuW2kxXTsKLQotICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8qIGFscDEgPSBhbHAwICsgcnJbaTBdW2kxXSArIDEvMipycltpMV1baTFdOyAqLwotCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgLyogYWxwMSA9IExfbWFjKGFscDAsIHJyW2kxXVtpMV0sIF8xXzQsIHBPdmVyZmxvdyk7ICovCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgYWxwMSA9IGFscDAgKyAoKFdvcmQzMikgcnJbaTFdW2kxXSA8PCAxNCk7Ci0KLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAvKiBhbHAxID0gTF9tYWMoYWxwMSwgcnJbaTBdW2kxXSwgXzFfMiwgcE92ZXJmbG93KTsgKi8KLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBhbHAxICs9IChXb3JkMzIpIHJyW2kwXVtpMV0gPDwgMTU7Ci0KLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAvKiBzcTEgPSBtdWx0KHBzMSwgcHMxLCBwT3ZlcmZsb3cpOyAqLwotICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNxMSA9IChXb3JkMTYpKCgoV29yZDMyKSBwczEgKiBwczEpID4+IDE1KTsKLQotICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8qIGFscF8xNiA9IHB2X3JvdW5kKGFscDEsIHBPdmVyZmxvdyk7ICovCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgYWxwXzE2ID0gKFdvcmQxNikoKGFscDEgKyAoV29yZDMyKSAweDAwMDA4MDAwTCkgPj4gMTYpOwotCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgLyogcyA9IExfbXVsdChhbHAsIHNxMSwgcE92ZXJmbG93KTsgKi8KLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBzID0gKChXb3JkMzIpIGFscCAqIHNxMSkgPDwgMTsKLQotICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8qIHMgPSBMX21zdShzLCBzcSwgYWxwXzE2LCBwT3ZlcmZsb3cpOyAqLwotICAgICAgICAgICAgICAgICAgICAgICAgICAgIHMgLT0gKCgoV29yZDMyKSBzcSAqIGFscF8xNikgPDwgMSk7Ci0KLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAocyA+IDApCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgewotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzcSA9IHNxMTsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcHMgPSBwczE7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGFscCA9IGFscF8xNjsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaXggPSBpMTsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgICAgICAgICBpMSA9IGl4OwotCi0gICAgICAgICAgICAgICAgICAgICAgICAvKi0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0qCi0gICAgICAgICAgICAgICAgICAgICAgICAgKiBpMiBsb29wOiA4IHBvc2l0aW9ucy4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqCi0gICAgICAgICAgICAgICAgICAgICAgICAgKi0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0qLwotCi0gICAgICAgICAgICAgICAgICAgICAgICBwczAgPSBwczsKLQotICAgICAgICAgICAgICAgICAgICAgICAgLyogYWxwMCA9IExfbXVsdChhbHAsIF8xXzQsIHBPdmVyZmxvdyk7ICovCi0gICAgICAgICAgICAgICAgICAgICAgICBhbHAwID0gKFdvcmQzMikgYWxwIDw8IDE0OwotCi0gICAgICAgICAgICAgICAgICAgICAgICBzcSA9IC0xOwotICAgICAgICAgICAgICAgICAgICAgICAgYWxwID0gMTsKLSAgICAgICAgICAgICAgICAgICAgICAgIHBzID0gMDsKLSAgICAgICAgICAgICAgICAgICAgICAgIGl4ID0gaXBvc1syXTsKLQotICAgICAgICAgICAgICAgICAgICAgICAgLyogaW5pdGlhbGl6ZSA0IGluZGV4IGZvciBuZXh0IGxvb3AgKHNlZSBpMSBsb29wKSAqLwotCi0gICAgICAgICAgICAgICAgICAgICAgICBmb3IgKGkyID0gaXBvc1syXTsgaTIgPCBMX0NPREU7IGkyICs9IFNURVApCi0gICAgICAgICAgICAgICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgLyogaW5kZXggaW5jcmVtZW50ID0gU1RFUCAqLwotICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8qIHBzMSA9IGFkZChwczAsIGRuW2kyXSwgcE92ZXJmbG93KTsgKi8KLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBwczEgPSBwczAgKyBkbltpMl07Ci0KLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAvKiBhbHAxID0gYWxwMCArIHJyW2kwXVtpMl0gKyBycltpMV1baTJdICsgMS8yKnJyW2kyXVtpMl07ICovCi0KLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAvKiBpZHggaW5jciA9IFNURVAgKi8KLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAvKiBhbHAxID0gTF9tYWMoYWxwMCwgcnJbaTJdW2kyXSwgXzFfMTYsIHBPdmVyZmxvdyk7ICovCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgYWxwMSA9IGFscDAgKyAoKFdvcmQzMikgcnJbaTJdW2kyXSA8PCAxMik7Ci0KLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAvKiBpZHggaW5jciA9IFNURVAgKi8KLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAvKiBhbHAxID0gTF9tYWMoYWxwMSwgcnJbaTFdW2kyXSwgXzFfOCwgcE92ZXJmbG93KTsgKi8KLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBhbHAxICs9IChXb3JkMzIpIHJyW2kxXVtpMl0gPDwgMTM7Ci0KLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAvKiBpZHggaW5jciA9IFNURVAgKi8KLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAvKiBhbHAxID0gTF9tYWMoYWxwMSxycltpMF1baTJdLCBfMV84LCBwT3ZlcmZsb3cpOyAqLwotICAgICAgICAgICAgICAgICAgICAgICAgICAgIGFscDEgKz0gKFdvcmQzMikgcnJbaTBdW2kyXSA8PCAxMzsKLQotICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8qIHNxMSA9IG11bHQocHMxLCBwczEsIHBPdmVyZmxvdyk7ICovCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgc3ExID0gKFdvcmQxNikoKChXb3JkMzIpIHBzMSAqIHBzMSkgPj4gMTUpOwotCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgLyogYWxwXzE2ID0gcHZfcm91bmQoYWxwMSwgcE92ZXJmbG93KTsgKi8KLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBhbHBfMTYgPSAoV29yZDE2KSgoYWxwMSArIChXb3JkMzIpIDB4MDAwMDgwMDBMKSA+PiAxNik7Ci0KLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAvKiBzID0gTF9tdWx0KGFscCwgc3ExLCBwT3ZlcmZsb3cpOyAqLwotICAgICAgICAgICAgICAgICAgICAgICAgICAgIHMgPSAoKFdvcmQzMikgYWxwICogc3ExKSA8PCAxOwotCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgLyogcyA9IExfbXN1KHMsIHNxLCBhbHBfMTYsIHBPdmVyZmxvdyk7ICovCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgcyAtPSAoKChXb3JkMzIpIHNxICogYWxwXzE2KSA8PCAxKTsKLQotICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChzID4gMCkKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNxID0gc3ExOwotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwcyA9IHBzMTsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYWxwID0gYWxwXzE2OwotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpeCA9IGkyOwotICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICAgICAgICAgIGkyID0gaXg7Ci0KLSAgICAgICAgICAgICAgICAgICAgICAgIC8qLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSoKLSAgICAgICAgICAgICAgICAgICAgICAgICAqIGkzIGxvb3A6IDggcG9zaXRpb25zLiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICoKLSAgICAgICAgICAgICAgICAgICAgICAgICAqLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSovCi0KLSAgICAgICAgICAgICAgICAgICAgICAgIHBzMCA9IHBzOwotICAgICAgICAgICAgICAgICAgICAgICAgYWxwMCA9IExfZGVwb3NpdF9oKGFscCk7Ci0KLSAgICAgICAgICAgICAgICAgICAgICAgIHNxID0gLTE7Ci0gICAgICAgICAgICAgICAgICAgICAgICBhbHAgPSAxOwotICAgICAgICAgICAgICAgICAgICAgICAgcHMgPSAwOwotICAgICAgICAgICAgICAgICAgICAgICAgaXggPSBpcG9zWzNdOwotCi0gICAgICAgICAgICAgICAgICAgICAgICAvKiBpbml0aWFsaXplIDUgaW5kZXggZm9yIG5leHQgbG9vcCAoc2VlIGkxIGxvb3ApICovCi0KLSAgICAgICAgICAgICAgICAgICAgICAgIGZvciAoaTMgPSBpcG9zWzNdOyBpMyA8IExfQ09ERTsgaTMgKz0gU1RFUCkKLSAgICAgICAgICAgICAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAvKiBwczEgPSBhZGQocHMwLCBkbltpM10sIHBPdmVyZmxvdyk7ICovCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgcHMxID0gcHMwICsgZG5baTNdOyAvKiBpbmRleCBpbmNyZW1lbnQgPSBTVEVQICovCi0KLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAvKiBhbHAxID0gYWxwMCArIHJyW2kwXVtpM10gKyBycltpMV1baTNdICsgcnJbaTJdW2kzXSArIDEvMipycltpM11baTNdOyAqLwotCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgLyogYWxwMSA9IExfbWFjKGFscDAsIHJyW2kzXVtpM10sIF8xXzE2LCBwT3ZlcmZsb3cpOyAqLwotICAgICAgICAgICAgICAgICAgICAgICAgICAgIGFscDEgPSBhbHAwICsgKChXb3JkMzIpIHJyW2kzXVtpM10gPDwgMTIpOyAvKiBpZHggaW5jciA9IFNURVAgKi8KLQotICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8qIGFscDEgPSBMX21hYyhhbHAxLCBycltpMl1baTNdLCBfMV84LCBwT3ZlcmZsb3cpOyAqLwotICAgICAgICAgICAgICAgICAgICAgICAgICAgIGFscDEgKz0gKFdvcmQzMikgcnJbaTJdW2kzXSA8PCAxMzsgIC8qIGlkeCBpbmNyID0gU1RFUCAqLwotCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgLyogYWxwMSA9IExfbWFjKGFscDEsIHJyW2kxXVtpM10sIF8xXzgsIHBPdmVyZmxvdyk7ICovCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgYWxwMSArPSAoV29yZDMyKSBycltpMV1baTNdIDw8IDEzOyAgLyogaWR4IGluY3IgPSBTVEVQICovCi0KLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAvKiBhbHAxID0gTF9tYWMoYWxwMSwgcnJbaTBdW2kzXSwgXzFfOCwgcE92ZXJmbG93KTsgKi8KLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBhbHAxICs9IChXb3JkMzIpIHJyW2kwXVtpM10gPDwgMTM7ICAvKiBpZHggaW5jciA9IFNURVAgKi8KLQotICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8qIHNxMSA9IG11bHQocHMxLCBwczEsIHBPdmVyZmxvdyk7ICovCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgc3ExID0gKFdvcmQxNikoKChXb3JkMzIpIHBzMSAqIHBzMSkgPj4gMTUpOwotCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgLyogYWxwXzE2ID0gcHZfcm91bmQoYWxwMSwgcE92ZXJmbG93KTsgKi8KLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBhbHBfMTYgPSAoV29yZDE2KSgoYWxwMSArIChXb3JkMzIpIDB4MDAwMDgwMDBMKSA+PiAxNik7Ci0KLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAvKiBzID0gTF9tdWx0KGFscCwgc3ExLCBwT3ZlcmZsb3cpOyAqLwotICAgICAgICAgICAgICAgICAgICAgICAgICAgIHMgPSAoKFdvcmQzMikgYWxwICogc3ExKSA8PCAxOwotCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgLyogcyA9IExfbXN1KHMsIHNxLCBhbHBfMTYsIHBPdmVyZmxvdyk7ICovCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgcyAtPSAoKChXb3JkMzIpIHNxICogYWxwXzE2KSA8PCAxKTsKLQotICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChzID4gMCkKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNxID0gc3ExOwotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwcyA9IHBzMTsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYWxwID0gYWxwXzE2OwotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpeCA9IGkzOwotICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICAgICAgICAgIH0KLQotCi0gICAgICAgICAgICAgICAgICAgICAgICAvKi0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0qCi0gICAgICAgICAgICAgICAgICAgICAgICAgKiBtZW1vcmlzZSBjb2RldmVjdG9yIGlmIHRoaXMgb25lIGlzIGJldHRlciB0aGFuIHRoZSBsYXN0IG9uZS4gICAqCi0gICAgICAgICAgICAgICAgICAgICAgICAgKi0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0qLwotCi0gICAgICAgICAgICAgICAgICAgICAgICAvKiBzID0gTF9tdWx0KGFscGssIHNxLCBwT3ZlcmZsb3cpOyAqLwotICAgICAgICAgICAgICAgICAgICAgICAgcyA9ICgoV29yZDMyKSBhbHBrICogc3EpIDw8IDE7Ci0KLSAgICAgICAgICAgICAgICAgICAgICAgIC8qIHMgPSBMX21zdShzLCBwc2ssIGFscCwgcE92ZXJmbG93KTsgKi8KLSAgICAgICAgICAgICAgICAgICAgICAgIHMgLT0gKCgoV29yZDMyKSBwc2sgKiBhbHApIDw8IDEpOwotCi0gICAgICAgICAgICAgICAgICAgICAgICBpZiAocyA+IDApCi0gICAgICAgICAgICAgICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgcHNrID0gc3E7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgYWxwayA9IGFscDsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBwX2NvZHZlYyA9ICZjb2R2ZWNbMF07Ci0KLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAqKHBfY29kdmVjKyspID0gaTA7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgKihwX2NvZHZlYysrKSA9IGkxOwotICAgICAgICAgICAgICAgICAgICAgICAgICAgICoocF9jb2R2ZWMrKykgPSBpMjsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAqKHBfY29kdmVjKSA9IGl4OwotICAgICAgICAgICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgfQotCi0gICAgICAgICAgICAgICAgLyotLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tKgotICAgICAgICAgICAgICAgICAqIEN5Y2xpYyBwZXJtdXRhdGlvbiBvZiBpMCxpMSxpMiBhbmQgaTMuICAgICAgICAgICAgICAgICAgICAgICAgICoKLSAgICAgICAgICAgICAgICAgKi0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0qLwotCi0gICAgICAgICAgICAgICAgcG9zID0gaXBvc1szXTsKLSAgICAgICAgICAgICAgICBpcG9zWzNdID0gaXBvc1syXTsKLSAgICAgICAgICAgICAgICBpcG9zWzJdID0gaXBvc1sxXTsKLSAgICAgICAgICAgICAgICBpcG9zWzFdID0gaXBvc1swXTsKLSAgICAgICAgICAgICAgICBpcG9zWzBdID0gcG9zOwotICAgICAgICAgICAgfQotICAgICAgICB9Ci0KLSAgICAgICAgcmV0dXJuOwotICAgIH0KLQotCi0KLQotICAgIC8qKioqK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25dCi0KLSAgICAtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0KLSAgICAqLwotCi0gICAgc3RhdGljIFdvcmQxNgotICAgIGJ1aWxkX2NvZGUoCi0gICAgICAgIFdvcmQxNiBjb2R2ZWNbXSwgIC8qIGkgOiBwb3NpdGlvbiBvZiBwdWxzZXMgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLSAgICAgICAgV29yZDE2IGRuX3NpZ25bXSwgLyogaSA6IHNpZ24gb2YgcHVsc2VzICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotICAgICAgICBXb3JkMTYgY29kW10sICAgICAvKiBvIDogaW5ub3ZhdGl2ZSBjb2RlIHZlY3RvciAgICAgICAgICAgICAgICAgICAgICAgICovCi0gICAgICAgIFdvcmQxNiBoW10sICAgICAgIC8qIGkgOiBpbXB1bHNlIHJlc3BvbnNlIG9mIHdlaWdodGVkIHN5bnRoZXNpcyBmaWx0ZXIgKi8KLSAgICAgICAgV29yZDE2IHlbXSwgICAgICAgLyogbyA6IGZpbHRlcmVkIGlubm92YXRpdmUgY29kZSAgICAgICAgICAgICAgICAgICAgICAqLwotICAgICAgICBXb3JkMTYgc2lnbltdLCAgICAvKiBvIDogaW5kZXggb2YgNCBwdWxzZXMgKHNpZ24rcG9zaXRpb24pICAgICAgICAgICAgICovCi0gICAgICAgIEZsYWcgICAqIHBPdmVyZmxvdyAgLyogbyA6IEZsYWcgc2V0IHdoZW4gb3ZlcmZsb3cgb2NjdXJzICAgICAgICAgICAgICAgKi8KLSAgICApCi0gICAgewotICAgICAgICBXb3JkMTYgaTsKLSAgICAgICAgV29yZDE2IGo7Ci0gICAgICAgIFdvcmQxNiBrOwotICAgICAgICBXb3JkMTYgdHJhY2s7Ci0gICAgICAgIFdvcmQxNiBpbmRleDsKLSAgICAgICAgV29yZDE2IF9zaWduW05CX1BVTFNFXTsKLSAgICAgICAgV29yZDE2IGluZHg7Ci0gICAgICAgIFdvcmQxNiByc2lnbjsKLQotICAgICAgICBXb3JkMTYgKnAwOwotICAgICAgICBXb3JkMTYgKnAxOwotICAgICAgICBXb3JkMTYgKnAyOwotICAgICAgICBXb3JkMTYgKnAzOwotICAgICAgICBXb3JkMTYgKnBfY29kID0gJmNvZFswXTsKLQotICAgICAgICBXb3JkMzIgczsKLQotICAgICAgICBmb3IgKGkgPSAwOyBpIDwgTF9DT0RFOyBpKyspCi0gICAgICAgIHsKLSAgICAgICAgICAgICoocF9jb2QrKykgPSAwOwotICAgICAgICB9Ci0KLSAgICAgICAgaW5keCA9IDA7Ci0gICAgICAgIHJzaWduID0gMDsKLQotICAgICAgICBmb3IgKGsgPSAwOyBrIDwgTkJfUFVMU0U7IGsrKykKLSAgICAgICAgewotICAgICAgICAgICAgaSA9IGNvZHZlY1trXTsgLyogcmVhZCBwdWxzZSBwb3NpdGlvbiAqLwotICAgICAgICAgICAgaiA9IGRuX3NpZ25baV07IC8qIHJlYWQgc2lnbiAgICAgICAgICAqLwotCi0gICAgICAgICAgICAvKiBpbmRleCA9IHBvcy81ICovCi0gICAgICAgICAgICAvKiBpbmRleCA9IG11bHQoaSwgNjU1NCwgcE92ZXJmbG93KTsgKi8KLSAgICAgICAgICAgIGluZGV4ID0gKFdvcmQxNikoKChXb3JkMzIpIGkgKiA2NTU0KSA+PiAxNSk7Ci0KLSAgICAgICAgICAgIC8qIHRyYWNrID0gcG9zJTUgKi8KLSAgICAgICAgICAgIC8qIHMgPSBMX211bHQoaW5kZXgsIDUsIHBPdmVyZmxvdyk7ICovCi0gICAgICAgICAgICBzID0gKChXb3JkMzIpIGluZGV4ICogNSkgPDwgMTsKLQotICAgICAgICAgICAgLyogcyA9IExfc2hyKHMsIDEsIHBPdmVyZmxvdyk7ICovCi0gICAgICAgICAgICBzID4+PSAxOwotCi0gICAgICAgICAgICAvKiB0cmFjayA9IHN1YihpLCAoV29yZDE2KSBzLCBwT3ZlcmZsb3cpOyAqLwotICAgICAgICAgICAgdHJhY2sgPSBpIC0gKFdvcmQxNikgczsKLQotICAgICAgICAgICAgaW5kZXggPSBncmF5W2luZGV4XTsKLQotICAgICAgICAgICAgaWYgKHRyYWNrID09IDEpCi0gICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgLyogaW5kZXggPSBzaGwoaW5kZXgsIDMsIHBPdmVyZmxvdyk7ICovCi0gICAgICAgICAgICAgICAgaW5kZXggPDw9IDM7Ci0gICAgICAgICAgICB9Ci0gICAgICAgICAgICBlbHNlIGlmICh0cmFjayA9PSAyKQotICAgICAgICAgICAgewotICAgICAgICAgICAgICAgIC8qIGluZGV4ID0gc2hsKGluZGV4LCA2LCBwT3ZlcmZsb3cpOyAqLwotICAgICAgICAgICAgICAgIGluZGV4IDw8PSA2OwotICAgICAgICAgICAgfQotICAgICAgICAgICAgZWxzZSBpZiAodHJhY2sgPT0gMykKLSAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAvKiBpbmRleCA9IHNobChpbmRleCwgMTAsIHBPdmVyZmxvdyk7ICovCi0gICAgICAgICAgICAgICAgaW5kZXggPDw9IDEwOwotICAgICAgICAgICAgfQotICAgICAgICAgICAgZWxzZSBpZiAodHJhY2sgPT0gNCkKLSAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICB0cmFjayA9IDM7Ci0KLSAgICAgICAgICAgICAgICAvKiBpbmRleCA9IHNobChpbmRleCwgMTAsIHBPdmVyZmxvdyk7ICovCi0gICAgICAgICAgICAgICAgaW5kZXggPDw9IDEwOwotCi0gICAgICAgICAgICAgICAgLyogaW5kZXggPSBhZGQoaW5kZXgsIDUxMiwgcE92ZXJmbG93KTsgKi8KLSAgICAgICAgICAgICAgICBpbmRleCArPSA1MTI7Ci0gICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgIGlmIChqID4gMCkKLSAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICBjb2RbaV0gPSA4MTkxOwotICAgICAgICAgICAgICAgIF9zaWduW2tdID0gMzI3Njc7Ci0KLSAgICAgICAgICAgICAgICAvKiB0cmFjayA9IHNobCgxLCB0cmFjaywgcE92ZXJmbG93KTsgKi8KLSAgICAgICAgICAgICAgICB0cmFjayA9IDEgPDwgdHJhY2s7Ci0KLSAgICAgICAgICAgICAgICAvKiByc2lnbiA9IGFkZChyc2lnbiwgdHJhY2ssIHBPdmVyZmxvdyk7ICovCi0gICAgICAgICAgICAgICAgcnNpZ24gKz0gdHJhY2s7Ci0gICAgICAgICAgICB9Ci0gICAgICAgICAgICBlbHNlCi0gICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgY29kW2ldID0gLTgxOTI7Ci0gICAgICAgICAgICAgICAgX3NpZ25ba10gPSAoV29yZDE2KSAtIDMyNzY4TDsKLSAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgLyogaW5keCA9IGFkZChpbmR4LCBpbmRleCwgcE92ZXJmbG93KTsgKi8KLSAgICAgICAgICAgIGluZHggKz0gaW5kZXg7Ci0gICAgICAgIH0KLSAgICAgICAgKnNpZ24gPSByc2lnbjsKLQotICAgICAgICBwMCA9IGggLSBjb2R2ZWNbMF07Ci0gICAgICAgIHAxID0gaCAtIGNvZHZlY1sxXTsKLSAgICAgICAgcDIgPSBoIC0gY29kdmVjWzJdOwotICAgICAgICBwMyA9IGggLSBjb2R2ZWNbM107Ci0KLSAgICAgICAgZm9yIChpID0gMDsgaSA8IExfQ09ERTsgaSsrKQotICAgICAgICB7Ci0gICAgICAgICAgICBzID0gMDsKLSAgICAgICAgICAgIHMgPQotICAgICAgICAgICAgICAgIExfbWFjKAotICAgICAgICAgICAgICAgICAgICBzLAotICAgICAgICAgICAgICAgICAgICAqcDArKywKLSAgICAgICAgICAgICAgICAgICAgX3NpZ25bMF0sCi0gICAgICAgICAgICAgICAgICAgIHBPdmVyZmxvdyk7Ci0KLSAgICAgICAgICAgIHMgPQotICAgICAgICAgICAgICAgIExfbWFjKAotICAgICAgICAgICAgICAgICAgICBzLAotICAgICAgICAgICAgICAgICAgICAqcDErKywKLSAgICAgICAgICAgICAgICAgICAgX3NpZ25bMV0sCi0gICAgICAgICAgICAgICAgICAgIHBPdmVyZmxvdyk7Ci0KLSAgICAgICAgICAgIHMgPQotICAgICAgICAgICAgICAgIExfbWFjKAotICAgICAgICAgICAgICAgICAgICBzLAotICAgICAgICAgICAgICAgICAgICAqcDIrKywKLSAgICAgICAgICAgICAgICAgICAgX3NpZ25bMl0sCi0gICAgICAgICAgICAgICAgICAgIHBPdmVyZmxvdyk7Ci0KLSAgICAgICAgICAgIHMgPQotICAgICAgICAgICAgICAgIExfbWFjKAotICAgICAgICAgICAgICAgICAgICBzLAotICAgICAgICAgICAgICAgICAgICAqcDMrKywKLSAgICAgICAgICAgICAgICAgICAgX3NpZ25bM10sCi0gICAgICAgICAgICAgICAgICAgIHBPdmVyZmxvdyk7Ci0KLSAgICAgICAgICAgIHlbaV0gPQotICAgICAgICAgICAgICAgIHB2X3JvdW5kKAotICAgICAgICAgICAgICAgICAgICBzLAotICAgICAgICAgICAgICAgICAgICBwT3ZlcmZsb3cpOwotCi0gICAgICAgIH0gLyogZm9yIChpID0gMDsgaSA8IExfQ09ERTsgaSsrKSAqLwotCi0gICAgICAgIHJldHVybiBpbmR4OwotCi0gICAgfSAvKiBidWlsZF9jb2RlICovCi0KLSNpZmRlZiBfX2NwbHVzcGx1cwotfQotI2VuZGlmCmRpZmYgLS1naXQgYS9tZWRpYS9saWJzdGFnZWZyaWdodC9jb2RlY3MvYW1ybmIvZW5jL3NyYy9jNF8xN3BmLmggYi9tZWRpYS9saWJzdGFnZWZyaWdodC9jb2RlY3MvYW1ybmIvZW5jL3NyYy9jNF8xN3BmLmgKZGVsZXRlZCBmaWxlIG1vZGUgMTAwNjQ0CmluZGV4IDRkYzY2YTkuLjAwMDAwMDAKLS0tIGEvbWVkaWEvbGlic3RhZ2VmcmlnaHQvY29kZWNzL2Ftcm5iL2VuYy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ioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgotICoKLSAqICBGVU5DVElPTjogIGJ1aWxkX2NvZGUoKQotICoKLSAqICBQVVJQT1NFOiBCdWlsZHMgdGhlIGNvZGV3b3JkLCB0aGUgZmlsdGVyZWQgY29kZXdvcmQgYW5kIGEKLSAqICAgbGluZWFyIHVuY29tYmluZWQgdmVyc2lvbiBvZiAgdGhlIGluZGV4IG9mIHRoZQotICogICAgICAgICAgIGNvZGV2ZWN0b3IsIGJhc2VkIG9uIHRoZSBzaWducyBhbmQgcG9zaXRpb25zIG9mIDggIHB1bHNlcy4KLSAqCi0gKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLQotc3RhdGljIHZvaWQgYnVpbGRfY29kZSgKLSAgICBXb3JkMTYgY29kdmVjW10sICAgIC8qIGkgOiBwb3NpdGlvbiBvZiBwdWxzZXMgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotICAgIFdvcmQxNiBzaWduW10sICAgICAgLyogaSA6IHNpZ24gb2YgZFtuXSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0gICAgV29yZDE2IGNvZFtdLCAgICAgICAvKiBvIDogaW5ub3ZhdGl2ZSBjb2RlIHZlY3RvciAgICAgICAgICAgICAgICAgICAgICAgKi8KLSAgICBXb3JkMTYgaFtdLCAgICAgICAgIC8qIGkgOiBpbXB1bHNlIHJlc3BvbnNlIG9mIHdlaWdodGVkIHN5bnRoZXNpcyBmaWx0ZXIqLwotICAgIFdvcmQxNiB5W10sICAgICAgICAgLyogbyA6IGZpbHRlcmVkIGlubm92YXRpdmUgY29kZSAgICAgICAgICAgICAgICAgICAgICovCi0gICAgV29yZDE2IHNpZ25faW5keFtdLCAvKiBvIDogc2lnbnMgb2YgNCAgcHVsc2VzIChzaWducyBvbmx5KSAgICAgICAgICAgICAgKi8KLSAgICBXb3Jk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gICAgICAgICAgICovCi0gICAgICAgIGogPSBzaWduW2ldOwotCi0gICAgICAgIHBvc19pbmRleCA9IGkgPj4gMjsgLyogaW5kZXggPSBwb3MvNCAqLwotCi0gICAgICAgIHRyYWNrID0gaSAmIDM7ICAgICAvKiB0cmFjayA9IHBvcyU0ICovCi0KLSAgICAgICAgaWYgKGogPiAwKQotICAgICAgICB7Ci0gICAgICAgICAgICBjb2RbaV0gPSAoV29yZDE2KSgoV29yZDMyKSBjb2RbaV0gKyBQT1NfQ09ERSk7Ci0KLSAgICAgICAgICAgIF9zaWduW2tdID0gUE9TX1NJR047Ci0gICAgICAgICAgICBzaWduX2luZGV4ID0gMDsgIC8qIGJpdD0wIC0+IHBvc2l0aXZlIHB1bHNlICovCi0gICAgICAgIH0KLSAgICAgICAgZWxzZQotICAgICAgICB7Ci0gICAgICAgICAgICBjb2RbaV0gPSAoV29yZDE2KSgoV29yZDMyKSBjb2RbaV0gLSBORUdfQ09ERSk7Ci0KLSAgICAgICAgICAgIF9zaWduW2tdID0gTkVHX1NJR047Ci0gICAgICAgICAgICBzaWduX2luZGV4ID0gMTsgLyogYml0PTEgPT4gbmVnYXRpdmUgcHVsc2UgKi8KLSAgICAgICAgICAgIC8qIGluZGV4ID0gYWRkIChpbmRleCwgOCk7IDEgPSBuZWdhdGl2ZSAgb2xkIGNvZGUgKi8KLSAgICAgICAgfQotCi0gICAgICAgIGlmIChwb3NfaW5keFt0cmFja10gPCAwKQotICAgICAgICB7ICAgLyogZmlyc3Qgc2V0IGZpcnN0IE5CX1RSQUNLIHB1bHNlcyAgKi8KLSAgICAgICAgICAgIHBvc19pbmR4W3RyYWNrXSA9IHBvc19pbmRleDsKLSAgICAgICAgICAgIHNpZ25faW5keFt0cmFja10gPSBzaWduX2luZGV4OwotICAgICAgICB9Ci0gICAgICAgIGVsc2UKLSAgICAgICAgeyAgIC8qIDJuZCByb3cgb2YgcHVsc2VzICwgdGVzdCBpZiBwb3NpdGlvbnMgbmVlZHMgdG8gYmUgc3dpdGNoZWQgKi8KLSAgICAgICAgICAgIGlmICgoKHNpZ25faW5kZXggXiBzaWduX2luZHhbdHJhY2tdKSAmIDEpID09IDApCi0gICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgLyogc2lnbiBvZiAxc3QgcHVsc2UgPT0gc2lnbiBvZiAybmQgcHVsc2UgKi8KLQotICAgICAgICAgICAgICAgIGlmIChwb3NfaW5keFt0cmFja10gPD0gcG9zX2luZGV4KQotICAgICAgICAgICAgICAgIHsgICAvKiBubyBzd2FwICovCi0gICAgICAgICAgICAgICAgICAgIHBvc19pbmR4W3RyYWNrICsgTkJfVFJBQ0tfTVIxMDJdID0gcG9zX2luZGV4OwotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICBlbHNlCi0gICAgICAgICAgICAgICAgeyAgIC8qIHN3YXAqLwotICAgICAgICAgICAgICAgICAgICBwb3NfaW5keFt0cmFjayArIE5CX1RSQUNLX01SMTAyXSA9IHBvc19pbmR4W3RyYWNrXTsKLQotICAgICAgICAgICAgICAgICAgICBwb3NfaW5keFt0cmFja10gPSBwb3NfaW5kZXg7Ci0gICAgICAgICAgICAgICAgICAgIHNpZ25faW5keFt0cmFja10gPSBzaWduX2luZGV4OwotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgIH0KLSAgICAgICAgICAgIGVsc2UKLSAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAvKiBzaWduIG9mIDFzdCBwdWxzZSAhPSBzaWduIG9mIDJuZCBwdWxzZSAqLwotCi0gICAgICAgICAgICAgICAgaWYgKHBvc19pbmR4W3RyYWNrXSA8PSBwb3NfaW5kZXgpCi0gICAgICAgICAgICAgICAgeyAgLypzd2FwKi8KLSAgICAgICAgICAgICAgICAgICAgcG9zX2luZHhbdHJhY2sgKyBOQl9UUkFDS19NUjEwMl0gPSBwb3NfaW5keFt0cmFja107Ci0KLSAgICAgICAgICAgICAgICAgICAgcG9zX2luZHhbdHJhY2tdID0gcG9zX2luZGV4OwotICAgICAgICAgICAgICAgICAgICBzaWduX2luZHhbdHJhY2tdID0gc2lnbl9pbmRleDsKLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgZWxzZQotICAgICAgICAgICAgICAgIHsgICAvKm5vIHN3YXAgKi8KLSAgICAgICAgICAgICAgICAgICAgcG9zX2luZHhbdHJhY2sgKyBOQl9UUkFDS19NUjEwMl0gPSBwb3NfaW5kZXg7Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgfQotICAgICAgICB9Ci0gICAgfQotCi0gICAgcDAgPSBoIC0gKihwX2NvZHZlYysrKTsKLSAgICBwMSA9IGggLSAqKHBfY29kdmVjKyspOwotICAgIHAyID0gaCAtICoocF9jb2R2ZWMrKyk7Ci0gICAgcDMgPSBoIC0gKihwX2NvZHZlYysrKTsKLSAgICBwNCA9IGggLSAqKHBfY29kdmVjKyspOwotICAgIHA1ID0gaCAtICoocF9jb2R2ZWMrKyk7Ci0gICAgcDYgPSBoIC0gKihwX2NvZHZlYysrKTsKLSAgICBwNyA9IGggLSAqKHBfY29kdmVjKTsKLQotICAgIGZvciAoaSA9IDA7IGkgPCBMX0NPREU7IGkrKykKLSAgICB7Ci0gICAgICAgIHMgPSAwOwotCi0gICAgICAgIHMgPQotICAgICAgICAgICAgTF9tYWMoCi0gICAgICAgICAgICAgICAgcywKLSAgICAgICAgICAgICAgICAqcDArKywKLSAgICAgICAgICAgICAgICBfc2lnblswXSwKLSAgICAgICAgICAgICAgICBwT3ZlcmZsb3cpOwotICAgICAgICBzID0KLSAgICAgICAgICAgIExfbWFjKAotICAgICAgICAgICAgICAgIHMsCi0gICAgICAgICAgICAgICAgKnAxKyssCi0gICAgICAgICAgICAgICAgX3NpZ25bMV0sCi0gICAgICAgICAgICAgICAgcE92ZXJmbG93KTsKLSAgICAgICAgcyA9Ci0gICAgICAgICAgICBMX21hYygKLSAgICAgICAgICAgICAgICBzLAotICAgICAgICAgICAgICAgICpwMisrLAotICAgICAgICAgICAgICAgIF9zaWduWzJdLAotICAgICAgICAgICAgICAgIHBPdmVyZmxvdyk7Ci0gICAgICAgIHMgPQotICAgICAgICAgICAgTF9tYWMoCi0gICAgICAgICAgICAgICAgcywKLSAgICAgICAgICAgICAgICAqcDMrKywKLSAgICAgICAgICAgICAgICBfc2lnblszXSwKLSAgICAgICAgICAgICAgICBwT3ZlcmZsb3cpOwotICAgICAgICBzID0KLSAgICAgICAgICAgIExfbWFjKAotICAgICAgICAgICAgICAgIHMsCi0gICAgICAgICAgICAgICAgKnA0KyssCi0gICAgICAgICAgICAgICAgX3NpZ25bNF0sCi0gICAgICAgICAgICAgICAgcE92ZXJmbG93KTsKLSAgICAgICAgcyA9Ci0gICAgICAgICAgICBMX21hYygKLSAgICAgICAgICAgICAgICBzLAotICAgICAgICAgICAgICAgICpwNSsrLAotICAgICAgICAgICAgICAgIF9zaWduWzVdLAotICAgICAgICAgICAgICAgIHBPdmVyZmxvdyk7Ci0gICAgICAgIHMgPQotICAgICAgICAgICAgTF9tYWMoCi0gICAgICAgICAgICAgICAgcywKLSAgICAgICAgICAgICAgICAqcDYrKywKLSAgICAgICAgICAgICAgICBfc2lnbls2XSwKLSAgICAgICAgICAgICAgICBwT3ZlcmZsb3cpOwotICAgICAgICBzID0KLSAgICAgICAgICAgIExfbWFjKAotICAgICAgICAgICAgICAgIHMsCi0gICAgICAgICAgICAgICAgKnA3KyssCi0gICAgICAgICAgICAgICAgX3NpZ25bN10sCi0gICAgICAgICAgICAgICAgcE92ZXJmbG93KTsKLQotICAgICAgICB5W2ldID0KLSAgICAgICAgICAgIHB2X3JvdW5kKAotICAgICAgICAgICAgICAgIHMsCi0gICAgICAgICAgICAgICAgcE92ZXJmbG93KTsKLQotICAgIH0gLyogZm9yIChpID0gMDsgaSA8IExfQ09ERTsgaSsrKSAqLwotCi19IC8qIGJ1aWxkX2NvZGUgKi8KLQotLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqK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doZW4gb3ZlcmZsb3cgb2NjdXJzICAgICAgICAgICAgICAqLwotewotICAgIFdvcmQxNiBpOwotICAgIFdvcmQxNiBpYTsKLSAgICBXb3JkMTYgaWI7Ci0gICAgV29yZDE2IGljOwotCi0gICAgV29yZDE2ICpwX2luZHggPSAmaW5keFswXTsKLSAgICBXb3JkMTYgKnBfc2lnbl9pbmR4ID0gJnNpZ25faW5keFswXTsKLQotICAgIFdvcmQzMiB0ZW1wV29yZDMyOwotCi0gICAgZm9yIChpID0gMDsgaSA8IE5CX1RSQUNLX01SMTAyOyBpKyspCi0gICAgewotICAgICAgICAqKHBfaW5keCsrKSA9ICoocF9zaWduX2luZHgrKyk7Ci0gICAgfQotCi0gICAgLyogRmlyc3QgaW5kZXgKLSAgICAgIGluZHhbTkJfVFJBQ0tdID0gKGlhLzIrKGliLzIpKjUgKyhpYy8yKSoyNSkqOCArIGlhJTIgKyAoaWIlMikqMiArIChpYyUyKSo0OyAqLwotCi0gICAgaW5keFtOQl9UUkFDS19NUjEwMl0gPQotICAgICAgICBjb21wcmVzczEwKAotICAgICAgICAgICAgcG9zX2luZHhbMF0sCi0gICAgICAgICAgICBwb3NfaW5keFs0XSwKLSAgICAgICAgICAgIHBvc19pbmR4WzFdLAotICAgICAgICAgICAgcE92ZXJmbG93KTsKLQotICAgIC8qIFNlY29uZCBpbmRleAotICAgICAgaW5keFtOQl9UUkFDSysxXSA9IChpYS8yKyhpYi8yKSo1ICsoaWMvMikqMjUpKjggKyBpYSUyICsgKGliJTIpKjIgKyAoaWMlMikqNDsgKi8KLQotICAgIGluZHhbTkJfVFJBQ0tfTVIxMDIrMV0gPQotICAgICAgICBjb21wcmVzczEwKAotICAgICAgICAgICAgcG9zX2luZHhbMl0sCi0gICAgICAgICAgICBwb3NfaW5keFs2XSwKLSAgICAgICAgICAgIHBvc19pbmR4WzVdLAotICAgICAgICAgICAgcE92ZXJmbG93KTsKLQotICAgIC8qCi0gICAgICBUaGlyZCBpbmRleAotICAgICAgaWYgKChpYi8yKSUyID09IDEpCi0gICAgICAgIGluZHhbTkJfVFJBQ0srMl0gPSAoKCgoNC1pYS8yKSArIChpYi8yKSo1KSozMisxMikvMjUpKjQgKyBpYSUyICsgKGliJTIpKjI7Ci0gICAgICBlbHNlCi0gICAgICAgIGluZHhbTkJfVFJBQ0srMl0gPSAoKCgoaWEvMikgKyAgIChpYi8yKSo1KSozMisxMikvMjUpKjQgKyBpYSUyICsgKGliJTIpKjI7Ci0gICAgICAgICovCi0KLSAgICBpYiA9IHBvc19pbmR4WzddID4+IDE7Ci0KLSAgICBpYiAmPSAxOwotCi0gICAgaWEgPSBwb3NfaW5keFszXSA+PiAxOwotCi0gICAgaWYgKGliID09IDEpCi0gICAgewotICAgICAgICBpYSA9IDQgLSBpYTsKLSAgICB9Ci0KLSAgICBpYiA9IHBvc19pbmR4WzddID4+IDE7Ci0KLSAgICB0ZW1wV29yZDMyID0gKChXb3JkMzIpIGliICogNSkgPDwgMTsKLQotICAgIHRlbXBXb3JkMzIgPSB0ZW1wV29yZDMyID4+IDE7Ci0KLSAgICBpYiA9IChXb3JkMTYpIHRlbXBXb3JkMzI7Ci0KLSAgICBpYiArPSBpYTsKLQotICAgIGliIDw8PSA1OwotCi0gICAgaWIgKz0gMTI7Ci0KLSAgICBpYyA9IChXb3JkMTYpKCgoV29yZDMyKSBpYiAqIDEzMTEpID4+IDE1KTsKLQotICAgIGljIDw8PSAyOwotCi0gICAgaWEgPSBwb3NfaW5keFszXSAmIDE7Ci0KLSAgICBpYiA9ICgoV29yZDE2KShwb3NfaW5keFs3XSAmIDEpKSA8PCAxOwotCi0gICAgaWIgKz0gaWM7Ci0KLSAgICBpYiArPSBpYTsKLQotICAgIGluZHhbTkJfVFJBQ0tfTVIxMDIrMl0gPSBpYjsKLQotfSAvKiBjb21wcmVzc19jb2RlICovCi0KLQotLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqK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Z2V0IHZlY3RvciAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotICAgIFdvcmQxNiBjbltdLCAgICAgICAvKiBpIDogcmVzaWR1YWwgYWZ0ZXIgbG9uZyB0ZXJtIHByZWRpY3Rpb24gICAgICAgICAgICAqLwotICAgIFdvcmQxNiBoW10sICAgICAgICAvKiBpIDogaW1wdWxzZSByZXNwb25zZSBvZiB3ZWlnaHRlZCBzeW50aGVzaXMKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZmlsdGVyICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotICAgIFdvcmQxNiBjb2RbXSwgICAgICAvKiBvIDogYWxnZWJyYWljIChmaXhlZCkgY29kZWJvb2sgZXhjaXRhdGlvbiAgICAgICAgICAqLwotICAgIFdvcmQxNiB5W10sICAgICAgICAvKiBvIDogZmlsdGVyZWQgZml4ZWQgY29kZWJvb2sgZXhjaXRhdGlvbiAgICAgICAgICAgICAqLwotICAgIFdvcmQxNiBpbmR4W10sICAgICAvKiBvIDogNyBXb3JkMTYsIGluZGV4IG9mIDggcHVsc2VzIChzaWducytwb3NpdGlvbnMpICAqLwotICAgIEZsYWcgICpwT3ZlcmZsb3cgICAvKiBvIDogRmxhZyBzZXQgd2hlbiBvdmVyZmxvdyBvY2N1cnMgICAgICAgICAgICAgICAgICAqLwotKQotewotICAgIFdvcmQxNiBpcG9zW05CX1BVTFNFXTsKLSAgICBXb3JkMTYgcG9zX21heFtOQl9UUkFDS19NUjEwMl07Ci0gICAgV29yZDE2IGNvZHZlY1tOQl9QVUxTRV07Ci0KLSAgICBXb3JkMTYgZG5bTF9DT0RFXTsKLSAgICBXb3JkMTYgc2lnbltMX0NPREVdOwotCi0gICAgV29yZDE2IHJyW0xfQ09ERV1bTF9DT0RFXTsKLSAgICBXb3JkMTYgbGluZWFyX3NpZ25zW05CX1RSQUNLX01SMTAyXTsKLSAgICBXb3JkMTYgbGluZWFyX2NvZGV3b3Jkc1tOQl9QVUxTRV07Ci0KLSAgICBjb3JfaF94MigKLSAgICAgICAgaCwKLSAgICAgICAgeCwKLSAgICAgICAgZG4sCi0gICAgICAgIDIsCi0gICAgICAgIE5CX1RSQUNLX01SMTAyLAotICAgICAgICBTVEVQX01SMTAyLAotICAgICAgICBwT3ZlcmZsb3cpOwotCi0gICAgLyogMiA9IHVzZSBHU01FRlIgc2NhbGluZyAqLwotCi0gICAgc2V0X3NpZ24xMmsyKAotICAgICAgICBkbiwKLSAgICAgICAgY24sCi0gICAgICAgIHNpZ24sCi0gICAgICAgIHBvc19tYXgsCi0gICAgICAgIE5CX1RSQUNLX01SMTAyLAotICAgICAgICBpcG9zLAotICAgICAgICBTVEVQX01SMTAyLAotICAgICAgICBwT3ZlcmZsb3cpOwotCi0gICAgLyogc2FtZSBzZXRzaWduIGFsZyBhcyBHU00tRUZSIG5ldyBjb25zdGFudHMgdGhvdWdoKi8KLQotICAgIGNvcl9oKAotICAgICAgICBoLAotICAgICAgICBzaWduLAotICAgICAgICByciwKLSAgICAgICAgcE92ZXJmbG93KTsKLQotICAgIHNlYXJjaF8xMGFuZDhpNDAoCi0gICAgICAgIE5CX1BVTFNFLAotICAgICAgICBTVEVQX01SMTAyLAotICAgICAgICBOQl9UUkFDS19NUjEwMiwKLSAgICAgICAgZG4sCi0gICAgICAgIHJyLAotICAgICAgICBpcG9zLAotICAgICAgICBwb3NfbWF4LAotICAgICAgICBjb2R2ZWMsCi0gICAgICAgIHBPdmVyZmxvdyk7Ci0KLSAgICBidWlsZF9jb2RlKAotICAgICAgICBjb2R2ZWMsCi0gICAgICAgIHNpZ24sCi0gICAgICAgIGNvZCwKLSAgICAgICAgaCwKLSAgICAgICAgeSwKLSAgICAgICAgbGluZWFyX3NpZ25zLAotICAgICAgICBsaW5lYXJfY29kZXdvcmRzLAotICAgICAgICBwT3ZlcmZsb3cpOwotCi0gICAgY29tcHJlc3NfY29kZSgKLSAgICAgICAgbGluZWFyX3NpZ25zLAotICAgICAg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KLQotCi0gICAgLyogUElUX01JTl9NUjEyMiAxOCAgICAgICAgTWluaW11bSBwaXRjaCBsYWcgKE1SMTIyIG1vZGUpICAgICAgICAgICAqLwotICAgIC8qIFBJVF9NSU4gICAgICAgMjAgICAgICAgIE1pbmltdW0gcGl0Y2ggbGFnIChhbGwgb3RoZXIgbW9kZXMpICAgICAgKi8KLSAgICAvKiBQSVRfTUFYICAgICAgIDE0MyAgICAgICBNYXhpbXVtIHBpdGNoIGxhZyAgICAgICAgICAgICAgICAgICAgICAgICovCi0KLQotICAgIFdvcmQxNiBpOwotICAgIFdvcmQxNiBqOwotICAgIFdvcmQxNiAqcDsKLSAgICBXb3JkMTYgKnAxOwotICAgIFdvcmQxNiAqcDI7Ci0gICAgV29yZDE2ICpwX3NjYWxfc2lnOwotICAgIFdvcmQzMiB0MTsKLSAgICBXb3JkMzIgdDI7Ci0gICAgV29yZDMyIHQzOwotICAgIFdvcmQzMiB0NDsKLQotICAgIGNvcnIgPSBjb3JyIC0gbGFnX21heCA7Ci0gICAgcF9zY2FsX3NpZyA9ICZzY2FsX3NpZ1stbGFnX21heF07Ci0KLSAgICBmb3IgKGkgPSAoKGxhZ19tYXggLSBsYWdfbWluKSA+PiAyKSArIDE7IGkgPiAwOyBpLS0pCi0gICAgewotICAgICAgICB0MSA9IDA7Ci0gICAgICAgIHQyID0gMDsKLSAgICAgICAgdDMgPSAwOwotICAgICAgICB0NCA9IDA7Ci0gICAgICAgIHAgID0gJnNjYWxfc2lnWzBdOwotICAgICAgICBwMSA9IHBfc2NhbF9zaWcrKzsKLSAgICAgICAgcF9zY2FsX3NpZysrOwotICAgICAgICBwMiA9IHBfc2NhbF9zaWcrKzsKLSAgICAgICAgcF9zY2FsX3NpZysrOwotICAgICAgICBmb3IgKGogPSAoTF9mcmFtZSA+PiAxKTsgaiAhPSAwOyBqLS0pCi0gICAgICAgIHsKLSAgICAgICAgICAgIHQxID0gYW1ybmJfZnhwX21hY18xNl9ieV8xNmJiKChXb3JkMzIpICogKHApLCAoV29yZDMyKSAqIChwMSsrKSwgdDEpOwotICAgICAgICAgICAgdDIgPSBhbXJuYl9meHBfbWFjXzE2X2J5XzE2YmIoKFdvcmQzMikgKiAocCksIChXb3JkMzIpICogKHAxKSwgdDIpOwotICAgICAgICAgICAgdDMgPSBhbXJuYl9meHBfbWFjXzE2X2J5XzE2YmIoKFdvcmQzMikgKiAocCksIChXb3JkMzIpICogKHAyKyspLCB0Myk7Ci0gICAgICAgICAgICB0NCA9IGFtcm5iX2Z4cF9tYWNfMTZfYnlfMTZiYigoV29yZDMyKSAqIChwKyspLCAoV29yZDMyKSAqIChwMiksIHQ0KTsKLQotICAgICAgICAgICAgdDEgPSBhbXJuYl9meHBfbWFjXzE2X2J5XzE2YmIoKFdvcmQzMikgKiAocCksIChXb3JkMzIpICogKHAxKyspLCB0MSk7Ci0gICAgICAgICAgICB0MiA9IGFtcm5iX2Z4cF9tYWNfMTZfYnlfMTZiYigoV29yZDMyKSAqIChwKSwgKFdvcmQzMikgKiAocDEpLCB0Mik7Ci0gICAgICAgICAgICB0MyA9IGFtcm5iX2Z4cF9tYWNfMTZfYnlfMTZiYigoV29yZDMyKSAqIChwKSwgKFdvcmQzMikgKiAocDIrKyksIHQzKTsKLSAgICAgICAgICAgIHQ0ID0gYW1ybmJfZnhwX21hY18xNl9ieV8xNmJiKChXb3JkMzIpICogKHArKyksIChXb3JkMzIpICogKHAyKSwgdDQpOwotICAgICAgICB9Ci0KLSAgICAgICAgKihjb3JyKyspID0gdDEgPDwgMTsKLSAgICAgICAgKihjb3JyKyspID0gdDIgPDwgMTsKLSAgICAgICAgKihjb3JyKyspID0gdDMgPDwgMTsKLSAgICAgICAgKihjb3JyKyspID0gdDQgPDwgMTsKLQotICAgIH0KLQotICAgIHJldHVybjsKLX0KZGlmZiAtLWdpdCBhL21lZGlhL2xpYnN0YWdlZnJpZ2h0L2NvZGVjcy9hbXJuYi9lbmMvc3JjL2NhbGNfY29yLmggYi9tZWRpYS9saWJ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aWZpYyBsYW5ndWFnZSBnb3Zlcm5pbmcgcGVybWlzc2lvbnMKLSAqIGFuZCBsaW1pdGF0aW9ucyB1bmRlciB0aGUgTGljZW5zZS4KLSAqIC0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0KLSAqLwotLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKLVBvcnRpb25zIG9mIHRoaXMgZmlsZSBhcmUgZGVyaXZlZCBmcm9tIHRoZSBmb2xsb3dpbmcgM0dQUCBzdGFuZGFyZDoKLQotICAgIDNHUFAgVFMgMjYuMDczCi0gICAgQU5TSS1DIGNvZGUgZm9yIHRoZSBBZGFwdGl2ZSBNdWx0aS1SYXRlIChBTVIpIHNwZWVjaCBjb2RlYwotICAgIEF2YWlsYWJsZSBmcm9tIGh0dHA6Ly93d3cuM2dwcC5vcmcKLQotKEMpIDIwMDQsIDNHUFAgT3JnYW5pemF0aW9uYWwgUGFydG5lcnMgKEFSSUIsIEFUSVMsIENDU0EsIEVUU0ksIFRUQSwgVFRDKQotUGVybWlzc2lvbiB0byBkaXN0cmlidXRlLCBtb2RpZnkgYW5kIHVzZSB0aGlzIGZpbGUgdW5kZXIgdGhlIHN0YW5kYXJkIGxpY2Vuc2UKLXRlcm1zIGxpc3RlZCBhYm92ZSBoYXMgYmVlbiBvYnRhaW5lZCBmcm9tIHRoZSBjb3B5cmlnaHQgaG9sZGVyLgotKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLS8qCi0qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgotKgotKiAgICAgIEdTTSBBTVItTkIgc3BlZWNoIGNvZGVjICAgUjk4ICAgVmVyc2lvbiA3LjUuMCAgIE1hcmNoIDIsIDIwMDEKLSogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFI5OSAgIFZlcnNpb24gMy4yLjAKLSogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFJFTC00IFZlcnNpb24gNC4wLjAKLSoKLSoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCi0qCi0qICAgICAgRmlsZSAgICAgICAgICAgICA6IGNhbGNfY29yLmgKLSogICAgICBQdXJwb3NlICAgICAgICAgIDogQ2FsY3VsYXRlIGFsbCBjb3JyZWxhdGlvbnMgZm9yIHByaW9yIHRoZSBPTCBMVFAKLSoKLSoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCi0qLwotI2lmbmRlZiBjYWxjX2Nvcl9oCi0jZGVmaW5lIGNhbGNfY29yX2ggIiRJZCAkIgotCi0vKgotKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKLSogICAgICAgICAgICAgICAgICAgICAgICAgSU5DTFVERSBGSUxFUwotKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKLSovCi0jaW5jbHVkZSAidHlwZWRlZi5oIgotCi0jaWZkZWYgX19jcGx1c3BsdXMKLWV4dGVybiAiQyIKLXsKLSNlbmRpZgotCi0gICAgLyoKLSAgICAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgotICAgICogICAgICAgICAgICAgICAgICAgICAgICAgREVDTEFSQVRJT04gT0YgUFJPVE9UWVBFUwotICAgICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCi0gICAgKi8KLSAgICAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgotICAgICAqCi0gICAgICogIEZVTkNUSU9OOiBjb21wX2NvcnIKLSAgICAgKgotICAgICAqICBQVVJQT1NFOiBDYWxjdWxhdGUgYWxsIGNvcnJlbGF0aW9ucyBvZiBzY2FsX3NpZ1tdIGluIGEgZ2l2ZW4gZGVsYXkKLSAgICAgKiAgICAgICAgICAgcmFuZ2UuCi0gICAgICoKLSAgICAgKiAgREVTQ1JJUFRJT046Ci0gICAgICogICAgICBUaGUgY29ycmVsYXRpb24gaXMgZ2l2ZW4gYnkKLSAgICAgKiAgICAgICAgICAgY29yW3RdID0gPHNjYWxfc2lnW25dLCBzY2FsX3NpZ1tuLXRdPiwgIHQ9bGFnX21pbiwuLi4sbGFnX21heAotICAgICAqICAgICAgVGhlIGZ1bmN0aW9ucyBvdXRwdXRzIGFsbCBjb3JyZWxhdGlvbnMgaW4gdGhlIGdpdmVuIHJhbmdlCi0gICAgICoKLSAgICAgKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLSAgICB2b2lkIGNvbXBfY29ycihXb3JkMTYgc2NhbF9zaWdbXSwgICAvKiBpICAgOiBzY2FsZWQgc2lnbmFsLiAgICAgICAgICAgICAgICAgICAgICovCi0gICAgV29yZDE2IExfZnJhbWUsICAgICAvKiBpICAgOiBsZW5ndGggb2YgZnJhbWUgdG8gY29tcHV0ZSBwaXRjaCAgICovCi0gICAgV29yZDE2IGxhZ19tYXgsICAgICAvKiBpICAgOiBtYXhpbXVtIGxhZyAgICAgICAgICAgICAgICAgICAgICAgICovCi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dmF0aW9uICh1bmZpbHRlcmVkKSwgICAgICAgICAgICAgICAgUTEzICovCi0gICAgV29yZDE2IGdhaW5fcGl0LCAgLyogaSAgOiBwaXRjaCBnYWluLCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgUTE0ICovCi0gICAgV29yZDE2IExfc3ViZnIsICAgLyogaSAgOiBTdWJmcmFtZSBsZW5ndGggICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0KLSAgICBXb3JkMTYgZnJhY19lbltdLCAvKiBvICA6IGVuZXJneSBjb2VmZmljaWVudHMgKDQpLCBmcmFjdGlvbiBwYXJ0LCAgICBRMTUgKi8KLSAgICBXb3JkMTYgZXhwX2VuW10sICAvKiBvICA6IGVuZXJneSBjb2VmZmljaWVudHMgKDQpLCBleHBvbmVudCBwYXJ0LCAgICBRMCAgKi8KLSAgICBXb3JkMTYgKmx0cGcsICAgICAvKiBvICA6IExUUCBjb2RpbmcgZ2FpbiAobG9nMigpKSwgICAgICAgICAgICAgICAgICBRMTMgKi8KLSAgICBGbGFnICAgKnBPdmVyZmxvdwotKQotewotICAgIFdvcmQzMiBzMTsgICAgICAvKiBJbnRlcm1lZGlhdGUgZW5lcmd5IGFjY3VtdWxhdG9yICovCi0gICAgV29yZDMyIHMyOyAgICAgIC8qIEludGVybWVkaWF0ZSBlbmVyZ3kgYWNjdW11bGF0b3IgKi8KLSAgICBXb3JkMzIgczM7ICAgICAgLyogSW50ZXJtZWRpYXRlIGVuZXJneSBhY2N1bXVsYXRvciAqLwotICAgIFdvcmQzMiBzNDsgICAgICAvKiBJbnRlcm1lZGlhdGUgZW5lcmd5IGFjY3VtdWxhdG9yICovCi0gICAgV29yZDMyIExfdGVtcDsgICAgICAvKiB0ZW1wb3JhbCAzMiBiaXRzIHN0b3JhZ2UgKi8KLQotICAgIFdvcmQxNiBpOyAgICAgICAvKiBpbmRleCB1c2VkIGluIGFsbCBsb29wcyAqLwotICAgIFdvcmQxNiBleHA7ICAgICAvKiBudW5t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AgICAgICBzID0gTF9tYWMocywgeG4yW2ldLCB5MltpXSk7Ci0KLSAgICAgICAgZXhwID0gbm9ybV9sKHMpOwotICAgICAgICBmcmFjID0gZXh0cmFjdF9oKExfc2hsKHMsIGV4cCkpOwotICAgICAgICBleHAgPSBzdWIoMTUgLSA5LCBleHApOwotCi0KLSAgICAgICAgaWYgKGZyYWMgPD0gMCkKLSAgICAgICAgewotICAgICAgICAgICAgKmNvZF9nYWluX2ZyYWMgPSAwOwotICAgICAgICAgICAgKmNvZF9nYWluX2V4cCA9IDA7Ci0gICAgICAgIH0KLSAgICAgICAgZWxzZQotICAgICAgICB7Ci0gICAgICAgICAgICAvLwotICAgICAgICAgICAgICBnY3UgPSA8eG4yLCB5Mj4gLyBjWzJdCi0gICAgICAgICAgICAgICAgICA9IChmcmFjPj4xKS9mcmFjWzJdICAgICAgICAgICAgICogMl4oZXhwKzEtZXhwWzJdKQotICAgICAgICAgICAgICAgICAgPSBkaXZfcyhmcmFjPj4xLCBmcmFjWzJdKSoyXi0xNSAqIDJeKGV4cCsxLWV4cFsyXSkKLSAgICAgICAgICAgICAgICAgID0gZGl2X3MgKiAyXihleHAtZXhwWzJdLTE0KQotCi0gICAgICAgICAgICAqY29kX2dhaW5fZnJhYyA9IGRpdl9zIChzaHIgKGZyYWMsMSksIGZyYWNfY29lZmZbMl0pOwotICAgICAgICAgICAgKmNvZF9nYWluX2V4cCA9IHN1YiAoc3ViIChleHAsIGV4cF9jb2VmZlsyXSksIDE0KTsKLQotICAgICAgICB9Ci0gICAgfQotfQotCi0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0KLSBSRVNPVVJDRVMgVVNFRCBbb3B0aW9uYWxdCi0KLSBXaGVuIHRoZSBjb2RlIGlzIHdyaXR0ZW4gZm9yIGEgc3BlY2lmaWMgdGFyZ2V0IHByb2Nlc3Nvci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AgICAgICAgICAgICAgICAgIFEwICAqLwotICAgIFdvcmQxNiB4bjJbXSwgICAgICAgLyogaSAgOiBDQiB0YXJnZXQgdmVjdG9yLCAgICAgICAgICAgICAgICAgICAgICAgIFEwICAqLwotICAgIFdvcmQxNiB5MVtdLCAgICAgICAgLyogaSAgOiBBZGFwdGl2ZSBjb2RlYm9vaywgICAgICAgICAgICAgICAgICAgICAgIFEwICAqLwotICAgIFdvcmQxNiBZMltdLCAgICAgICAgLyogaSAgOiBGaWx0ZXJlZCBpbm5vdmF0aXZlIHZlY3RvciwgICAgICAgICAgICAgIFExMiAqLwotICAgIFdvcmQxNiBnX2NvZWZmW10sICAgLyogaSAgOiBDb3JyZWxhdGlvbnMgPHhuIHkxPiA8eTEgeTE+ICAgICAgICAgICAgICAgICAqLwotICAgIC8qICAgICAgY29tcHV0ZWQgaW4gR19waXRjaCgpICAgICAgICAgICAgICAgICAgICAgICAgKi8KLSAgICBXb3JkMTYgZnJhY19jb2VmZltdLCAvKiBvICA6IGVuZXJneSBjb2VmZmljaWVudHMgKDUpLCBmcmFjdGlvbiBwYXJ0LCBRMTUgKi8KLSAgICBXb3JkMTYgZXhwX2NvZWZmW10sIC8qIG8gIDogZW5lcmd5IGNvZWZmaWNpZW50cyAoNSksIGV4cG9uZW50IHBhcnQsICBRMCAgKi8KLSAgICBXb3JkMTYgKmNvZF9nYWluX2ZyYWMsIC8qIG8gIDogb3B0aW11bSBjb2RlYm9vayBnYWluIChmcmFjdGlvbiBwYXJ0KSxRMTUgKi8KLSAgICBXb3JkMTYgKmNvZF9nYWluX2V4cCwgLyogbyAgOiBvcHRpbXVtIGNvZGVib29rIGdhaW4gKGV4cG9uZW50IHBhcnQpLCBRMCAgKi8KLSAgICBGbGFnICAgKnBPdmVyZmxvdwotKQotewotICAgIFdvcmQzMiBzMTsgICAgICAvKiBJbnRlcm1lZGlhdGUgZW5lcmd5IGFjY3VtdWxhdG9yICAqLwotICAgIFdvcmQzMiBzMjsgICAgICAvKiB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Q29tcHV0ZSBzY2FsYXIgcHJvZHVjdCA8eG4yW10sc2NhbGVkX3kyW10+ICovCi0gICAgICAgIHMxID0gMEw7Ci0KLSAgICAgICAgZm9yIChpID0gMDsgaSA8IExfU1VCRlI7IGkrKykKLSAgICAgICAgewotICAgICAgICAgICAgczEgPSBhbXJuYl9meHBfbWFjXzE2X2J5XzE2YmIoKFdvcmQzMikgeG4yW2ldLCAoV29yZDMyKXNjYWxlZF95MltpXSwgczEpOwotICAgICAgICB9Ci0KLSAgICAgICAgczEgPSBzMSA8PCAxOwotCi0gICAgICAgIGV4cCA9IG5vcm1fbChzMSk7Ci0gICAgICAgIGZyYWMgPSAoV29yZDE2KShMX3NobChzMSwgZXhwLCBwT3ZlcmZsb3cpID4+IDE2KTsKLSAgICAgICAgZXhwID0gKDYgLSBleHApOwotCi0gICAgICAgIGlmIChmcmFjIDw9IDApCi0gICAgICAgIHsKLSAgICAgICAgICAgICpjb2RfZ2Fpbl9mcmFjID0gMDsKLSAgICAgICAgICAgICpjb2RfZ2Fpbl9leHAgPSAwOwotICAgICAgICB9Ci0gICAgICAgIGVsc2UKLSAgICAgICAgewotICAgICAgICAgICAgLyoKLSAgICAgICAgICAgIGdjdSA9IDx4bjIsIHNjYWxlZF95Mj4gLyBjWzJdCi0gICAgICAgICAgICAgICAgPSAoZnJhYz4+MSkvZnJhY1syXSAgICAgICAgICAgICAqIDJeKGV4cCsxLWV4cFsyXSkKLSAgICAgICAgICAgICAgICA9IGRpdl9zKGZyYWM+PjEsIGZyYWNbMl0pKjJeLTE1ICogMl4oZXhwKzEtZXhwWzJdKQotICAgICAgICAgICAgICAgID0gZGl2X3MgKiAyXihleHAtZXhwWzJdLTE0KQotICAgICAgICAgICAgKi8KLSAgICAgICAgICAgICpjb2RfZ2Fpbl9mcmFjID0gZGl2X3Moc2hyKGZyYWMsIDEsIHBPdmVyZmxvdyksIGZyYWNfY29lZmZbMl0pOwotICAgICAgICAgICAgKmNvZF9nYWluX2V4cCA9ICg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gICAgKgotICAgICAqIFBVUlBPU0U6ICBjYWxjdWxhdGlvbiBvZiBzZXZlcmFsIGVuZXJneSBjb2VmZmljaWVudHMgZm9yIHVuZmlsdGVyZWQKLSAgICAgKiAgICAgICAgICAgZXhjaXRhdGlvbiBzaWduYWxzIGFuZCB0aGUgTFRQIGNvZGluZyBnYWluCi0gICAgICoKLSAgICAgKiAgICAgICBmcmFjX2VuWzBdKjJeZXhwX2VuWzBdID0gPHJlcyByZXM+ICAgLy8gTFAgcmVzaWR1YWwgZW5lcmd5Ci0gICAgICogICAgICAgZnJhY19lblsxXSoyXmV4cF9lblsxXSA9IDxleGMgZXhjPiAgIC8vIExUUCByZXNpZHVhbCBlbmVyZ3kKLSAgICAgKiAgICAgICBmcmFjX2VuWzJdKjJeZXhwX2VuWzJdID0gPGV4YyBjb2RlPiAgLy8gTFRQL0NCIGlubm92YXRpb24gZG90IHByb2R1Y3QKLSAgICAgKiAgICAgICBmcmFjX2VuWzNdKjJeZXhwX2VuWzNdID0gPGxyZXMgbHJlcz4gLy8gTFRQIHJlc2lkdWFsIGVuZXJneQotICAgICAqICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyAobHJlcyA9IHJlcyAtIGdhaW5fcGl0KmV4YykKLSAgICAgKiAgICAgICBsdHBnID0gbG9nMihMUF9yZXNfZW4gLyBMVFBfcmVzX2VuKQotICAgICAqLwotICAgIHZvaWQKLSAgICBjYWxjX3VuZmlsdF9lbmVyZ2llcygKLSAgICAgICAgV29yZDE2IHJlc1tdLCAgICAgLyogaSAgOiBMUCByZXNpZHVhbCwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgUTAgICovCi0gICAgICAgIFdvcmQxNiBleGNbXSwgICAgIC8qIGkgIDogTFRQIGV4Y2l0YXRpb24gKHVuZmlsdGVyZWQpLCAgICAgICAgICAgICAgIFEwICAqLwotICAgICAgICBXb3JkMTYgY29kZVtdLCAgICAvKiBpICA6IENCIGlubm92YXRpb24gKHVuZmlsdGVyZWQpLCAgICAgICAgICAgICAgICBRMTMgKi8KLSAgICAgICAgV29yZDE2IGdhaW5fcGl0LCAgLyogaSAgOiBwaXRjaCBnYWluLCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgUTE0ICovCi0gICAgICAgIFdvcmQxNiBMX3N1YmZyLCAgIC8qIGkgIDogU3ViZnJhbWUgbGVuZ3RoICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotCi0gICAgICAgIFdvcmQxNiBmcmFjX2VuW10sIC8qIG8gIDogZW5lcmd5IGNvZWZmaWNpZW50cyAoMyksIGZyYWN0aW9uIHBhcnQsICAgIFExNSAqLwotICAgICAgICBXb3JkMTYgZXhwX2VuW10sICAvKiBvICA6IGVuZXJneSBjb2VmZmljaWVudHMgKDMpLCBleHBvbmVudCBwYXJ0LCAgICBRMCAgKi8KLSAgICAgICAgV29yZDE2ICpsdHBnLCAgICAgLyogbyAgOiBMVFAgY29kaW5nIGdhaW4gKGxvZzIoKSksICAgICAgICAgICAgICAgICAgUTEzICovCi0gICAgICAgIEZsYWcgICAqcE92ZXJmbG93Ci0gICAgKTsKLQotICAgIC8qCi0gICAgICogRlVOQ1RJT046IGNhbGNfZmlsdF9lbmVyZ2llcwotICAgICAqCi0gICAgICogUFVSUE9TRTogIGNhbGN1bGF0aW9uIG9mIHNldmVyYWwgZW5lcmd5IGNvZWZmaWNpZW50cyBmb3IgZmlsdGVyZWQKLSAgICAgKiAgICAgICAgICAgZXhjaXRhdGlvbiBzaWduYWxzCi0gICAgICoKLSAgICAgKiAgICAgQ29tcHV0ZSBjb2VmZmljaWVudHMgbmVlZCBmb3IgdGhlIHF1YW50aXphdGlvbiBhbmQgdGhlIG9wdGltdW0KLSAgICAgKiAgICAgY29kZWJvb2sgZ2FpbiBnY3UgKGZvciBNUjQ3NSBvbmx5KS4KLSAgICAgKgotICAgICAqICAgICAgY29lZmZbMF0gPSAgICB5MSB5MQotICAgICAqICAgICAgY29lZmZbMV0gPSAtMiB4biB5MQotICAgICAqICAgICAgY29lZmZbMl0gPSAgICB5MiB5MgotICAgICAqICAgICAgY29lZmZbM10gPSAtMiB4biB5MgotICAgICAqICAgICAgY29lZmZbNF0gPSAgMiB5MSB5MgotICAgICAqCi0gICAgICoKLSAgICAgKiAgICAgIGdjdSA9IDx4bjIsIHkyPiAvIDx5MiwgeTI+ICgwIGlmIDx4bjIsIHkyPiA8PSAwKQotICAgICAqCi0gICAgICogICAgIFByb2R1Y3QgPHkxIHkxPiBhbmQgPHhuIHkxPiBoYXZlIGJlZW4gY29tcHV0ZWQgaW4gR19waXRjaCgpIGFuZAotICAgICAqICAgICBhcmUgaW4gdmVjdG9yIGdfY29lZmZbXS4KLSAgICAgKi8KLSAgICB2b2lkCi0gICAgY2FsY19maWx0X2VuZXJnaWVzKAotICAgICAgICBlbnVtIE1vZGUgbW9kZSwgICAgIC8qIGkgIDogY29kZXIgbW9kZSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLSAgICAgICAgV29yZDE2IHhuW10sICAgICAgICAvKiBpICA6IExUUCB0YXJnZXQgdmVjdG9yLCAgICAgICAgICAgICAgICAgICAgICAgUTAgICovCi0gICAgICAgIFdvcmQxNiB4bjJbXSwgICAgICAgLyogaSAgOiBDQiB0YXJnZXQgdmVjdG9yLCAgICAgICAgICAgICAgICAgICAgICAgIFEwICAqLwotICAgICAgICBXb3JkMTYgeTFbXSwgICAgICAgIC8qIGkgIDogQWRhcHRpdmUgY29kZWJvb2ssICAgICAgICAgICAgICAgICAgICAgICBRMCAgKi8KLSAgICAgICAgV29yZDE2IFkyW10sICAgICAgICAvKiBpICA6IEZpbHRlcmVkIGlubm92YXRpdmUgdmVjdG9yLCAgICAgICAgICAgICAgUTEyICovCi0gICAgICAgIFdvcmQxNiBnX2NvZWZmW10sICAgLyogaSAgOiBDb3JyZWxhdGlvbnMgPHhuIHkxPiA8eTEgeTE+ICAgICAgICAgICAgICAgICAqLwotICAgICAgICAvKiAgICAgIGNvbXB1dGVkIGluIEdfcGl0Y2goKSAgICAgICAgICAgICAgICAgICAgICAgICovCi0KLSAgICAgICAgV29yZDE2IGZyYWNfY29lZmZbXSwvKiBvICA6IGVuZXJneSBjb2VmZmljaWVudHMgKDUpLCBmcmFjdGlvbiBwYXJ0LCAgUTE1ICovCi0gICAgICAgIFdvcmQxNiBleHBfY29lZmZbXSwgLyogbyAgOiBlbmVyZ3kgY29lZmZpY2llbnRzICg1KSwgZXhwb25lbnQgcGFydCwgIFEwICAqLwotICAgICAgICBXb3JkMTYgKmNvZF9nYWluX2ZyYWMsLyogbzogb3B0aW11bSBjb2RlYm9vayBnYWluIChmcmFjdGlvbiBwYXJ0KSwgICBRMTUgKi8KLSAgICAgICAgV29yZDE2ICpjb2RfZ2Fpbl9leHAsIC8qIG86IG9wdGltdW0gY29kZWJvb2sgZ2FpbiAoZXhwb25lbnQgcGFydCksICAgUTAgICovCi0gICAgICAgIEZsYWcgICAqcE92ZXJmbG93Ci0gICAgKTsKLQotICAgIC8qCi0gICAgICogRlVOQ1RJT046IGNhbGNfdGFyZ2V0X2VuZXJneQotICAgICAqCi0gICAgICogUFVSUE9TRTogIGNhbGN1bGF0aW9uIG9mIHRhcmdldCBlbmVyZ3kKLSAgICAgKgotICAgICAqICAgICAgZW4gPSA8eG4sIHhuPgotICAgICAqLwotICAgIHZvaWQKLSAgICBjYWxjX3RhcmdldF9lbmVyZ3koCi0gICAgICAgIFdvcmQxNiB4bltdLCAgICAgLyogaTogTFRQIHRhcmdldCB2ZWN0b3IsICAgICAgICAgICAgICAgICAgICAgICBRMCAgKi8KLSAgICAgICAgV29yZDE2ICplbl9leHAsICAvKiBvOiBvcHRpbXVtIGNvZGVib29rIGdhaW4gKGV4cG9uZW50IHBhcnQpLCAgIFEwICAqLwotICAgICAgICBXb3JkMTYgKmVuX2ZyYWMsICAvKiBvOiBvcHRpbXVtIGNvZGVib29rIGdhaW4gKGZyYWN0aW9uIHBhcnQpLCAgIFExNSAqL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ICAgICAgICAgICAgICAgICAgICAgICovCi0gICAgICAgICAgICAgIFdvcmQxNiBwaXRjaF9zaGFycCwvKiBpIDogTGFzdCBxdWFudGl6ZWQgcGl0Y2ggZ2FpbiwgUTE0ICAgICAgICAqLwotICAgICAgICAgICAgICBXb3JkMTYgZ2Fpbl9waXQsICAgLyogaSA6IFBpdGNoIGdhaW4sIFExNCAgICAgICAgICAgICAgICAgICAgICAgKi8KLSAgICAgICAgICAgICAgV29yZDE2IHJlczJbXSwgICAgIC8qIGkgOiBMb25nIHRlcm0gcHJlZGljdGlvbiByZXNpZHVhbCwgUTAgICAgICovCi0gICAgICAgICAgICAgIFdvcmQxNiBjb2RlW10sICAgICAvKiBvIDogSW5ub3ZhdGl2ZSBjb2RlYm9vaywgUTEzICAgICAgICAgICAgICAqLwotICAgICAgICAgICAgICBXb3JkMTYgeVtdLCAgICAgICAgLyogbyA6IGZpbHRlcmVkIGZpeGVkIGNvZGVib29rIGV4Y2l0YXRpb24gICAgKi8KLSAgICAgICAgICAgICAgLyogICAgIFExMiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLSAgICAgICAgICAgICAgV29yZDE2ICoqYW5hcCwgICAgIC8qIG8gOiBTaWducyBvZiB0aGUgcHVsc2VzICAgICAgICAgICAgICAgICAgICovCi0gICAgICAgICAgICAgIGVudW0gTW9kZSBtb2RlLCAgICAvKiBpIDogY29kZXIgbW9kZSAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotICAgICAgICAgICAgICBXb3JkMTYgc3ViTnIsICAgICAgLyogaSA6IHN1YmZyYW1lIG51bWJlciAgICAgICAgICAgICAgICAgICAgICAgKi8KLSAgICAgICAgICAgICAgRmxhZyAgKnBPdmVyZmxvdykgIC8qIG8gOiBGbGFnIHNldCB3aGVuIG92ZXJmbG93IG9jY3VycyAgICAgICAgICovCi17Ci0gICAgV29yZDE2IGluZGV4OwotICAgIFdvcmQxNiBpOwotICAgIFdvcmQxNiB0ZW1wOwotICAgIFdvcmQxNiBwaXRfc2hhcnBUbXA7Ci0KLSAgICAvKiBGb3IgTVI3NCwgdGhlIHByZSBhbmQgcG9zdCBDQiBwaXRjaCBzaGFycGVuaW5nIGlzIGluY2x1ZGVkIGluIHRoZQotICAgICAqIGNvZGVib29rIHNlYXJjaCByb3V0aW5lLCB3aGlsZSBmb3IgTVIxMjIgaXMgaXQgbm90LgotICAgICAqLwotCi0gICAgaWYgKChtb2RlID09IE1SNDc1KSB8fCAobW9kZSA9PSBNUjUxNSkpCi0gICAgewotICAgICAgICAvKiBNUjQ3NSwgTVI1MTUgKi8KLSAgICAgICAgKigqYW5hcCkrKyA9Ci0gICAgICAgICAgICBjb2RlXzJpNDBfOWJpdHMoCi0gICAgICAgICAgICAgICAgc3ViTnIsCi0gICAgICAgICAgICAgICAgeCwKLSAgICAgICAgICAgICAgICBoLAotICAgICAgICAgICAgICAgIFQwLAotICAgICAgICAgICAgICAgIHBpdGNoX3NoYXJwLAotICAgICAgICAgICAgICAgIGNvZGUsCi0gICAgICAgICAgICAgICAgeSwKLSAgICAgICAgICAgICAgICAmaW5kZXgsCi0gICAgICAgICAgICAgICAgcE92ZXJmbG93KTsKLQotICAgICAgICAqKCphbmFwKSsrID0gaW5kZXg7ICAgIC8qIHNpZ24gaW5kZXggKi8KLSAgICB9Ci0gICAgZWxzZSBpZiAobW9kZSA9PSBNUjU5KQotICAgIHsgICAvKiBNUjU5ICovCi0gICAgICAgICooKmFuYXApKysgPQotICAgICAgICAgICAgY29kZV8yaTQwXzExYml0cygKLSAgICAgICAgICAgICAgICB4LAotICAgICAgICAgICAgICAgIGgsCi0gICAgICAgICAgICAgICAgVDAsCi0gICAgICAgICAgICAgICAgcGl0Y2hfc2hhcnAsCi0gICAgICAgICAgICAgICAgY29kZSwKLSAgICAgICAgICAgICAgICB5LAotICAgICAgICAgICAgICAgICZpbmRleCwKLSAgICAgICAgICAgICAgICBwT3ZlcmZsb3cpOwotCi0gICAgICAgICooKmFuYXApKysgPSBpbmRleDsgICAgLyogc2lnbiBpbmRleCAqLwotICAgIH0KLSAgICBlbHNlIGlmIChtb2RlID09IE1SNjcpCi0gICAgeyAgIC8qIE1SNjcgKi8KLSAgICAgICAgKigqYW5hcCkrKyA9Ci0gICAgICAgICAgICBjb2RlXzNpNDBfMTRiaXRzKAotICAgICAgICAgICAgICAgIHgsCi0gICAgICAgICAgICAgICAgaCwKLSAgICAgICAgICAgICAgICBUMCwKLSAgICAgICAgICAgICAgICBwaXRjaF9zaGFycCwKLSAgICAgICAgICAgICAgICBjb2RlLAotICAgICAgICAgICAgICAgIHksCi0gICAgICAgICAgICAgICAgJmluZGV4LAotICAgICAgICAgICAgICAgIHBPdmVyZmxvdyk7Ci0KLSAgICAgICAgKigqYW5hcCkrKyA9IGluZGV4OyAgICAvKiBzaWduIGluZGV4ICovCi0gICAgfQotICAgIGVsc2UgaWYgKChtb2RlID09IE1SNzQpIHx8IChtb2RlID09IE1SNzk1KSkKLSAgICB7ICAgLyogTVI3NCwgTVI3OTUgKi8KLSAgICAgICAgKigqYW5hcCkrKyA9Ci0gICAgICAgICAgICBjb2RlXzRpNDBfMTdiaXRzKAotICAgICAgICAgICAgICAgIHgsCi0gICAgICAgICAgICAgICAgaCwKLSAgICAgICAgICAgICAgICBUMCwKLSAgICAgICAgICAgICAgICBwaXRjaF9zaGFycCwKLSAgICAgICAgICAgICAgICBjb2RlLAotICAgICAgICAgICAgICAgIHksCi0gICAgICAgICAgICAgICAgJmluZGV4LAotICAgICAgICAgICAgICAgIHBPdmVyZmxvdyk7Ci0KLSAgICAgICAgKigqYW5hcCkrKyA9IGluZGV4OyAgICAvKiBzaWduIGluZGV4ICovCi0gICAgfQotICAgIGVsc2UgaWYgKG1vZGUgPT0gTVIxMDIpCi0gICAgeyAgIC8qIE1SMTAyICovCi0gICAgICAgIC8qLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSoKLSAgICAgICAgICogLSBpbmNsdWRlIHBpdGNoIGNvbnRyaWJ1dGlvbiBpbnRvIGltcHVsc2UgcmVzcC4gaDFbXSAgICAgICAgKgotICAgICAgICAgKi0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0qLwotICAgICAgICAvKiBwaXRfc2hhcnBUbXAgPSBwaXRfc2hhcnA7ICAgICAgICAgICAgICAgICAgICAgKi8KLSAgICAgICAgLyogaWYgKHBpdF9zaGFycFRtcCA+IDEuMCkgcGl0X3NoYXJwVG1wID0gMS4wOyAgICovCi0KLSAgICAgICAgcGl0X3NoYXJwVG1wID0KLSAgICAgICAgICAgIHNobCgKLSAgICAgICAgICAgICAgICBwaXRjaF9zaGFycCwKLSAgICAgICAgICAgICAgICAxLAotICAgICAgICAgICAgICAgIHBPdmVyZmxvdyk7Ci0KLSAgICAgICAgZm9yIChpID0gVDA7IGkgPCBMX1NVQkZSOyBpKyspCi0gICAgICAgIHsKLSAgICAgICAgICAgIHRlbXAgPQotICAgICAgICAgICAgICAgIG11bHQoCi0gICAgICAgICAgICAgICAgICAgIGhbaSAtIFQwXSwKLSAgICAgICAgICAgICAgICAgICAgcGl0X3NoYXJwVG1wLAotICAgICAgICAgICAgICAgICAgICBwT3ZlcmZsb3cpOwotCi0gICAgICAgICAgICBoW2ldID0KLSAgICAgICAgICAgICAgICBhZGQoCi0gICAgICAgICAgICAgICAgICAgIGhbaV0sCi0gICAgICAgICAgICAgICAgICAgIHRlbXAsCi0gICAgICAgICAgICAgICAgICAgIHBPdmVyZmxvdyk7Ci0gICAgICAgIH0KLQotICAgICAgICAvKi0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tKgotICAgICAgICAgKiAtIElubm92YXRpdmUgY29kZWJvb2sgc2VhcmNoIChmaW5kIGluZGV4IGFuZCBnYWluKSAgICAgICAgICAgKgotICAgICAgICAgKi0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tKi8KLSAgICAgICAgY29kZV84aTQwXzMxYml0cygKLSAgICAgICAgICAgIHgsCi0gICAgICAgICAgICByZXMyLAotICAgICAgICAgICAgaCwKLSAgICAgICAgICAgIGNvZGUsCi0gICAgICAgICAgICB5LAotICAgICAgICAgICAgKmFuYXAsCi0gICAgICAgICAgICBwT3ZlcmZsb3cpOwotCi0gICAgICAgICphbmFwICs9IDc7Ci0KLSAgICAgICAgLyotLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tKgotICAgICAgICAgKiAtIEFkZCB0aGUgcGl0Y2ggY29udHJpYnV0aW9uIHRvIGNvZGVbXS4gICAgICAgICAgICAgICAqCi0gICAgICAgICAqLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSovCi0gICAgICAgIGZvciAoaSA9IFQwOyBpIDwgTF9TVUJGUjsgaSsrKQotICAgICAgICB7Ci0gICAgICAgICAgICB0ZW1wID0KLSAgICAgICAgICAgICAgICBtdWx0KAotICAgICAgICAgICAgICAgICAgICBjb2RlW2kgLSBUMF0sCi0gICAgICAgICAgICAgICAgICAgIHBpdF9zaGFycFRtcCwKLSAgICAgICAgICAgICAgICAgICAgcE92ZXJmbG93KTsKLQotICAgICAgICAgICAgY29kZVtpXSA9Ci0gICAgICAgICAgICAgICAgYWRkKAotICAgICAgICAgICAgICAgICAgICBjb2RlW2ldLAotICAgICAgICAgICAgICAgICAgICB0ZW1wLAotICAgICAgICAgICAgICAgICAgICBwT3ZlcmZsb3cpOwotICAgICAgICB9Ci0gICAgfQotICAgIGVsc2UKLSAgICB7ICAvKiBNUjEyMiAqLwotICAgICAgICAvKi0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0qCi0gICAgICAgICAqIC0gaW5jbHVkZSBwaXRjaCBjb250cmlidXRpb24gaW50byBpbXB1bHNlIHJlc3AuIGgxW10gICAgICAgICoKLSAgICAgICAgICotLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tKi8KLQotICAgICAgICAvKiBwaXRfc2hhcnBUbXAgPSBnYWluX3BpdDsgICAgICAgICAgICAgICAgICAgICAgKi8KLSAgICAgICAgLyogaWYgKHBpdF9zaGFycFRtcCA+IDEuMCkgcGl0X3NoYXJwVG1wID0gMS4wOyAgICovCi0KLSAgICAgICAgcGl0X3NoYXJwVG1wID0gc2hsKGdhaW5fcGl0LCAxLCBwT3ZlcmZsb3cpOwotCi0gICAgICAgIGZvciAoaSA9IFQwOyBpIDwgTF9TVUJGUjsgaSsrKQotICAgICAgICB7Ci0gICAgICAgICAgICB0ZW1wID0gKChXb3JkMzIpaFtpIC0gVDBdICogcGl0X3NoYXJwVG1wKSA+PiAxNTsKLSAgICAgICAgICAgIC8qCi0gICAgICAgICAgICAgICAgICAgICBtdWx0KAotICAgICAgICAgICAgICAgICAgICAgICAgICAgIGhbaSAtIFQwXSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgcE92ZXJmbG93KTsKLSAgICAgICAgICAgICovCi0gICAgICAgICAgICBoW2ldID0KLSAgICAgICAgICAgICAgICBhZGQoCi0gICAgICAgICAgICAgICAgICAgIGhbaV0sCi0gICAgICAgICAgICAgICAgICAgIHRlbXAsCi0gICAgICAgICAgICAgICAgICAgIHBPdmVyZmxvdyk7Ci0gICAgICAgIH0KLSAgICAgICAgLyotLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSoKLSAgICAgICAgICogLSBJbm5vdmF0aXZlIGNvZGVib29rIHNlYXJjaCAoZmluZCBpbmRleCBhbmQgZ2FpbikgICAgICAgICAgICoKLSAgICAgICAgICotLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSovCi0KLSAgICAgICAgY29kZV8xMGk0MF8zNWJpdHMoCi0gICAgICAgICAgICB4LAotICAgICAgICAgICAgcmVzMiwKLSAgICAgICAgICAgIGgsCi0gICAgICAgICAgICBjb2RlLAotICAgICAgICAgICAgeSwKLSAgICAgICAgICAgICphbmFwLAotICAgICAgICAgICAgcE92ZXJmbG93KTsKLQotICAgICAgICAqYW5hcCArPSAxMDsKLQotICAgICAgICAvKi0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0qCi0gICAgICAgICAqIC0gQWRkIHRoZSBwaXRjaCBjb250cmlidXRpb24gdG8gY29kZVtdLiAgICAgICAgICAgICAgICoKLSAgICAgICAgICotLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tKi8KLSAgICAgICAgZm9yIChpID0gVDA7IGkgPCBMX1NVQkZSOyBpKyspCi0gICAgICAgIHsKLSAgICAgICAgICAgIHRlbXAgPQotICAgICAgICAgICAgICAgIG11bHQoCi0gICAgICAgICAgICAgICAgICAgIGNvZGVbaSAtIFQwXSwKLSAgICAgICAgICAgICAgICAgICAgcGl0X3NoYXJwVG1wLAotICAgICAgICAgICAgICAgICAgICBwT3ZlcmZsb3cpOwotCi0gICAgICAgICAgICBjb2RlW2ldID0KLSAgICAgICAgICAgICAgICBhZGQoCi0gICAgICAgICAgICAgICAgICAgIGNvZGVbaV0sCi0gICAgICAgICAgICAgICAgICAgIHRlbXAs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3BvbnNlIG9mIHdlaWdodGVkIHN5bnRoZXNpcyAqLwotICAgIC8qICAgICBmaWx0ZXIgaFstTF9zdWJmci4uLTFdIG11c3QgYmUgc2V0IHRvICAqLwotICAgIC8qICAgIHplcm8uIFExMiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotICAgIFdvcmQxNiBUMCwgICAgICAvKiBpIDogUGl0Y2ggbGFnICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLSAgICBXb3JkMTYgcGl0Y2hfc2hhcnAsIC8qIGkgOiBMYXN0IHF1YW50aXplZCBwaXRjaCBnYWluLCBRMTQgICAgICovCi0gICAgV29yZDE2IGdhaW5fcGl0LC8qIGkgOiBQaXRjaCBnYWluLCBRMTQgICAgICAgICAgICAgICAgICAgICAgICAqLwotICAgIFdvcmQxNiByZXMyW10sICAvKiBpIDogTG9uZyB0ZXJtIHByZWRpY3Rpb24gcmVzaWR1YWwsIFEwICAgICAgKi8KLSAgICBXb3JkMTYgY29kZVtdLCAgLyogbyA6IElubm92YXRpdmUgY29kZWJvb2ssIFExMyAgICAgICAgICAgICAgICovCi0gICAgV29yZDE2IHlbXSwgICAgIC8qIG8gOiBmaWx0ZXJlZCBmaXhlZCBjb2RlYm9vayBleGNpdGF0aW9uLCBRMTIgKi8KLSAgICBXb3JkMTYgKiphbmFwLCAgLyogbyA6IFNpZ25zIG9mIHRoZSBwdWxzZXMgICAgICAgICAgICAgICAgICAgICovCi0gICAgZW51bSBNb2RlIG1vZGUsIC8qIGkgOiBjb2RlciBtb2RlICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotICAgIFdvcmQxNiBzdWJOciwgICAvKiBpIDogc3ViZnJhbWUgbnVtYmVyICAgICAgICAgICAgICAgICAgICAgICAgKi8KLSAgICBGbGFnICAqcE92ZXJmbG93ICAvKiBvIDogRmxhZyBzZXQgd2hlbiBvdmVyZmxvdyBvY2N1cnMgICAgICAgICovCi0gICAgICAgICAgICAgICAgICk7Ci0KLSA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vZGUsICAgICAgLy8gaSAgIDogY29kZXIgbW9kZQotICAgIFdvcmQxNiBmcmFtZU9mZnNldCwgIC8vIGkgICA6IE9mZnNldCB0byBzdWJmcmFtZQotICAgIFdvcmQxNiBUX29wW10sICAgICAgIC8vIGkgICA6IE9wZW4gbG9vcCBwaXRjaCBsYWdzCi0gICAgV29yZDE2ICpoMSwgICAgICAgICAgLy8gaSAgIDogSW1wdWxzZSByZXNwb25zZSB2ZWN0b3IgICAgICAgICAgICAgICBRMTIKLSAgICBXb3JkMTYgKmV4YywgICAgICAgICAvLyBpL28gOiBFeGNpdGF0aW9uIHZlY3RvciAgICAgICAgICAgICAgICAgICAgICBRMAotICAgIFdvcmQxNiByZXMyW10sICAgICAgIC8vIGkvbyA6IExvbmcgdGVybSBwcmVkaWN0aW9uIHJlc2lkdWFsICAgICAgICAgIFEwCi0gICAgV29yZDE2IHhuW10sICAgICAgICAgLy8gaSAgIDogVGFyZ2V0IHZlY3RvciBmb3IgcGl0Y2ggc2VhcmNoICAgICAgICAgUTAKLSAgICBXb3JkMTYgbHNwX2ZsYWcsICAgICAvLyBpICAgOiBMU1AgcmVzb25hbmNlIGZsYWcKLSAgICBXb3JkMTYgeG4yW10sICAgICAgICAvLyBvICAgOiBUYXJnZXQgdmVjdG9yIGZvciBjb2RlYm9vayBzZWFyY2ggICAgICBRMAotICAgIFdvcmQxNiB5MVtdLCAgICAgICAgIC8vIG8gICA6IEZpbHRlcmVkIGFkYXB0aXZlIGV4Y2l0YXRpb24gICAgICAgICAgIFEwCi0gICAgV29yZDE2ICpUMCwgICAgICAgICAgLy8gbyAgIDogUGl0Y2ggZGVsYXkgKGludGVnZXIgcGFydCkKLSAgICBXb3JkMTYgKlQwX2ZyYWMsICAgICAvLyBvICAgOiBQaXRjaCBkZWxheSAoZnJhY3Rpb25hbCBwYXJ0KQotICAgIFdvcmQxNiAqZ2Fpbl9waXQsICAgIC8vIG8gICA6IFBpdGNoIGdhaW4gICAgICAgICAgICAgICAgICAg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3AgcGl0Y2ggbGFncyAgICAgICAgICAgICAgICAgICAgICAqLwotICAgIFdvcmQxNiAqaDEsICAgICAgICAgIC8qIGkgICA6IEltcHVsc2UgcmVzcG9uc2UgdmVjdG9yICAgICAgICAgICAgICAgUTEyICovCi0gICAgV29yZDE2ICpleGMsICAgICAgICAgLyogaS9vIDogRXhjaXRhdGlvbiB2ZWN0b3IgICAgICAgICAgICAgICAgICAgICAgUTAgKi8KLSAgICBXb3JkMTYgcmVzMltdLCAgICAgICAvKiBpL28gOiBMb25nIHRlcm0gcHJlZGljdGlvbiByZXNpZHVhbCAgICAgICAgICBRMCAqLwotICAgIFdvcmQxNiB4bltdLCAgICAgICAgIC8qIGkgICA6IFRhcmdldCB2ZWN0b3IgZm9yIHBpdGNoIHNlYXJjaCAgICAgICAgIFEwICovCi0gICAgV29yZDE2IGxzcF9mbGFnLCAgICAgLyogaSAgIDogTFNQIHJlc29uYW5jZSBmbGFnICAgICAgICAgICAgICAgICAgICAgICAgKi8KLSAgICBXb3JkMTYgeG4yW10sICAgICAgICAvKiBvICAgOiBUYXJnZXQgdmVjdG9yIGZvciBjb2RlYm9vayBzZWFyY2ggICAgICBRMCAqLwotICAgIFdvcmQxNiB5bFtdLCAgICAgICAgIC8qIG8gICA6IEZpbHRlcmVkIGFkYXB0aXZlIGV4Y2l0YXRpb24gICAgICAgICAgIFEwICovCi0gICAgV29yZDE2ICpUMCwgICAgICAgICAgLyogbyAgIDogUGl0Y2ggZGVsYXkgKGludGVnZXIgcGFydCkgICAgICAgICAgICAgICAgKi8KLSAgICBXb3JkMTYgKlQwX2ZyYWMsICAgICAvKiBvICAgOiBQaXRjaCBkZWxheSAoZnJhY3Rpb25hbCBwYXJ0KSAgICAgICAgICAgICAqLwotICAgIFdvcmQxNiAqZ2Fpbl9waXQsICAgIC8qIG8gICA6IFBpdGNoIGdhaW4gICAgICAgICAgICAgICAgICAgICAgICAgICAgUTE0ICovCi0gICAgV29yZDE2IGdfY29lZmZbXSwgICAgL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RjaF9mcigKLSAgICAgICAgICAgIGNsU3QtPnBpdGNoU3QsCi0gICAgICAgICAgICBtb2RlLAotICAgICAgICAgICAgVF9vcCwKLSAgICAgICAgICAgIGV4YywKLSAgICAgICAgICAgIHhuLAotICAgICAgICAgICAgaDEsCi0gICAgICAgICAgICBMX1NVQkZSLAotICAgICAgICAgICAgZnJhbWVPZmZzZXQsCi0gICAgICAgICAgICBUMF9mcmFjLAotICAgICAgICAgICAgJnJlc3UzLAotICAgICAgICAgICAgJmluZGV4LAotICAgICAgICAgICAgcE92ZXJmbG93KTsKLQotICAgICooKmFuYXApKysgPSBpbmRleDsKLQotICAgIC8qLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0qCi0gICAgICogICAtIGZpbmQgdW5pdHkgZ2FpbiBwaXRjaCBleGNpdGF0aW9uIChhZGFwaXR2ZSBjb2RlYm9vayBlbnRyeSkgICoKLSAgICAgKiAgICAgd2l0aCBmcmFjdGlvbmFsIGludGVycG9sYXRpb24uICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKgotICAgICAqICAgLSBmaW5kIGZpbHRlcmVkIHBpdGNoIGV4Yy4geTFbXT1leGNbXSBjb252b2x2ZSB3aXRoIGgxW10pICAgICAqCi0gICAgICogICAtIGNvbXB1dGUgcGl0Y2ggZ2FpbiBhbmQgbGltaXQgYmV0d2VlbiAwIGFuZCAxLjIgICAgICAgICAgICAgICoKLSAgICAgKiAgIC0gdXBkYXRlIHRhcmdldCB2ZWN0b3IgZm9yIGNvZGVib29rIHNlYXJjaCAgICAgICAgICAgICAgICAgICAgKgotICAgICAqICAgLSBmaW5kIExUUCByZXNpZHVhbC4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqCi0gICAgICotLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tL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E1SNTE1KSkKLSAgICB7Ci0gICAgICAgICpnYWluX3BpdCA9ICgoV29yZDMyKSAqIGdhaW5fcGl0ID4gMTM5MjYpID8gMTM5MjYgOiAqZ2Fpbl9waXQ7Ci0KLSAgICAgICAgaWYgKGdwY19mbGFnICE9IDApCi0gICAgICAgIHsKLSAgICAgICAgICAgICpncF9saW1pdCA9IEdQX0NMSVA7Ci0gICAgICAgIH0KLSAgICB9Ci0gICAgZWxzZQotICAgIHsKLSAgICAgICAgaWYgKGdwY19mbGFnICE9IDApCi0gICAgICAgIHsKLSAgICAgICAgICAgICpncF9saW1pdCA9IEdQX0NMSVA7Ci0gICAgICAgICAgICAqZ2Fpbl9waXQgPSBHUF9DTElQOwotICAgICAgICB9Ci0gICAgICAgIC8qIEZvciBNUjEyMiwgZ2Fpbl9waXQgaXMgcXVhbnRpemVkIGhlcmUgYW5kIG5vdCBpbiBnYWluUXVhbnQgKi8KLSAgICAgICAgaWYgKG1vZGUgPT0gTVIxMjIpCi0gICAgICAgIHsKLSAgICAgICAgICAgICooKmFuYXApKysgPQotICAgICAgICAgICAgICAgIHFfZ2Fpbl9waXRjaCgKLSAgICAgICAgICAgICAgICAgICAgTVIxMjIsCi0gICAgICAgICAgICAgICAgICAgICpncF9saW1pdCwKLSAgICAgICAgICAgICAgICAgICAgZ2Fpbl9waXQsCi0gICAgICAgICAgICAgICAgICAgIE5VTEwsCi0gICAgICAgICAgICAgICAgICAgIE5VTEwsCi0gICAgICAgICAgICAgICAgICAgIHBPdmVyZmxvdyk7Ci0gICAgICAgIH0KLSAgICB9Ci0KLQotICAgIHBfZXhjICA9ICZleGNbMF07Ci0gICAgcF94biAgID0gICZ4blswXTsKLSAgICBwX3huMiAgPSAmeG4yWzBdOwotICAgIHBfeWwgICA9ICAmeWxbMF07Ci0KLSAgICB0ZW1wID0gKmdhaW5fcGl0OwotCi0gICAgLyogdXBkYXRlIHRhcmdldCB2ZWN0b3IgdW5kIGV2YWx1YXRlIExUUCByZXNpZHVh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KiBpL28gOiBTdGF0ZSBzdHJ1Y3QgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotICAgICAgICB0b25TdGFiU3RhdGUgKnRvblN0LCAvKiBpL28gOiBTdGF0ZSBzdHJ1Y3QgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotICAgICAgICBlbnVtIE1vZGUgbW9kZSwgICAgICAvKiBpICAgOiBjb2RlciBtb2RlICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotICAgICAgICBXb3JkMTYgZnJhbWVPZmZzZXQsICAvKiBpICAgOiBPZmZzZXQgdG8gc3ViZnJhbWUgICAgICAgICAgICAgICAgICAgICAgICAqLwotICAgICAgICBXb3JkMTYgVF9vcFtdLCAgICAgICAvKiBpICAgOiBPcGVuIGxvb3AgcGl0Y2ggbGFncyAgICAgICAgICAgICAgICAgICAgICAqLwotICAgICAgICBXb3JkMTYgKmgxLCAgICAgICAgICAvKiBpICAgOiBJbXB1bHNlIHJlc3BvbnNlIHZlY3RvciAgICAgICAgICAgICAgIFExMiAqLwotICAgICAgICBXb3JkMTYgKmV4YywgICAgICAgICAvKiBpL28gOiBFeGNpdGF0aW9uIHZlY3RvciAgICAgICAgICAgICAgICAgICAgICBRMCAqLwotICAgICAgICBXb3JkMTYgcmVzMltdLCAgICAgICAvKiBpL28gOiBMb25nIHRlcm0gcHJlZGljdGlvbiByZXNpZHVhbCAgICAgICAgICBRMCAqLwotICAgICAgICBXb3JkMTYgeG5bXSwgICAgICAgICAvKiBpICAgOiBUYXJnZXQgdmVjdG9yIGZvciBwaXRjaCBzZWFyY2ggICAgICAgICBRMCAqLwotICAgICAgICBXb3JkMTYgbHNwX2ZsYWcsICAgICAvKiBpICAgOiBMU1AgcmVzb25hbmNlIGZsYWcgICAgICAgICAgICAgICAgICAgICAgICAqLwotICAgICAgICBXb3JkMTYgeG4yW10sICAgICAgICAvKiBvICAgOiBUYXJnZXQgdmVjdG9yIGZvciBjb2RlYm9vayBzZWFyY2ggICAgICBRMCAqLwotICAgICAgICBXb3JkMTYgeTFbXSwgICAgICAgICAvKiBvICAgOiBGaWx0ZXJlZCBhZGFwdGl2ZSBleGNpdGF0aW9uICAgICAgICAgICBRMCAqLwotICAgICAgICBXb3JkMTYgKlQwLCAgICAgICAgICAvKiBvICAgOiBQaXRjaCBkZWxheSAoaW50ZWdlciBwYXJ0KSAgICAgICAgICAgICAgICAqLwotICAgICAgICBXb3JkMTYgKlQwX2ZyYWMsICAgICAvKiBvICAgOiBQaXRjaCBkZWxheSAoZnJhY3Rpb25hbCBwYXJ0KSAgICAgICAgICAgICAqLwotICAgICAgICBXb3JkMTYgKmdhaW5fcGl0LCAgICAvKiBvICAgOiBQaXRjaCBnYWluICAgICAgICAgICAgICAgICAgICAgICAgICAgIFExNCAqLwotICAgICAgICBXb3JkMTYgZ19jb2VmZltdLCAgICAvKiBvICAgOiBDb3JyZWxhdGlvbnMgYmV0d2VlbiB4biwgeTEsICYgeTIgICAgICAgICAqLwotICAgICAgICBXb3JkMTYgKiphbmFwLCAgICAgICAvKiBvICAgOiBBbmFseXNpcyBwYXJhbWV0ZXJzICAgICAgICAgICAgICAgICAgICAgICAqLwotICAgICAgICBXb3JkMTYgKmdwX2xpbWl0LCAgICAvKiBvICAgOiBwaXRjaCBnYWluIGxpbWl0ICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotICAgICAgICBGbGFnICAgKnBPdmVyZmxvdyAgICAvKiBvICAgOiBvdmVyZmxvdyBpbmRpY2F0b3IgICAgICAgICAgICAgICAgICAgICAgICAqLwotICAgICk7Ci0KLSAgICAvKi0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0KLSAgICA7IEVORAotICAgIC0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0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gd2luZG93aW5nICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqCi0gICAgKiAgICAgICAqIExldmluc29uLWR1cmJpbiBhbGdvcml0aG0gdG8gZmluZCBhW10gICAgICAgICAgICAgICAgICAgICAgICAgICoKLSAgICAqICAgICAgICogY29udmVydCBhW10gdG8gbHNwW10gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKgotICAgICogICAgICAgKiBxdWFudGl6ZSBhbmQgY29kZSB0aGUgTFNQcyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqCi0gICAgKiAgICAgICAqIGZpbmQgdGhlIGludGVycG9sYXRlZCBMU1BzIGFuZCBjb252ZXJ0IHRvIGFbXSBmb3IgYWxsICAgICAgICAgICoKLSAgICAqICAgICAgICAgc3ViZnJhbWVzIChib3RoIHF1YW50aXplZCBhbmQgdW5xdWFudGl6ZWQpICAgICAgICAgICAgICAgICAgICAgKgotICAgICotLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0qCi0KLSAgIC8vIExQIGFuYWx5c2lzCi0gICBscGMoc3QtPmxwY1N0LCBtb2RlLCBzdC0+cF93aW5kb3csIHN0LT5wX3dpbmRvd18xMmsyLCBBX3QpOwotCi0KLSAgIC8vIEZyb20gQSh6KSB0byBsc3AuIExTUCBxdWFudGl6YXRpb24gYW5kIGludGVycG9sYXRpb24KLSAgIGxzcChzdC0+bHNwU3QsIG1vZGUsICp1c2VkTW9kZSwgQV90LCBBcV90LCBsc3BfbmV3LCAmYW5hKTsKLQotCi0gICAvLyBCdWZmZXIgbHNwJ3MgYW5kIGVuZXJneQotICAgZHR4X2J1ZmZlcihzdC0+ZHR4X2VuY1N0LAotICAgICAgICAgIGxzcF9uZXcsCi0gICAgICAgICAgc3QtPm5ld19zcGVlY2gpOwotCi0gICAvLyBDaGVjayBpZiBpbiBEVFggbW9kZQotICAgaWYgKHN1YigqdXNlZE1vZGUsIE1SRFRYKSA9PSAwKQotICAgewotICAgICAgZHR4X2VuYyhzdC0+ZHR4X2VuY1N0LAotICAgICAgICAgICAgICBjb21wdXRlX3NpZF9mbGFnLAotICAgICAgICAgICAgICBzdC0+bHNwU3QtPnFTdCwKLSAgICAgICAgICAgICAgc3QtPmdhaW5RdWFudFN0LT5nY19wcmVkU3QsCi0gICAgICAgICAgICAgICZhbmEpOwotCi0gICAgICBTZXRfemVybyhzdC0+b2xkX2V4YywgICAgUElUX01BWCArIExfSU5URVJQT0wpOwotICAgICAgU2V0X3plcm8oc3QtPm1lbV93MCwgICAgIE0pOwotICAgICAgU2V0X3plcm8oc3QtPm1lbV9lcnIsICAgIE0pOwotICAgICAgU2V0X3plcm8oc3QtPnplcm8sICAgICAgIExfU1VCRlIpOwotICAgICAgU2V0X3plcm8oc3QtPmh2ZWMsICAgICAgIExfU1VCRlIpOyAgICAvLyBzZXQgdG8gemVybyAiaDFbLUxfU1VCRlIuLi0xXSIKLSAgICAgIC8vIFJlc2V0IGxzcCBzdGF0ZXMKLSAgICAgIGxzcF9yZXNldChzdC0+bHNwU3QpOwotICAgICAgQ29weShsc3BfbmV3LCBzdC0+bHNwU3QtPmxzcF9vbGQsIE0pOwotICAgICAgQ29weShsc3BfbmV3LCBzdC0+bHNwU3QtPmxzcF9vbGRfcSwgTSk7Ci0KLSAgICAgIC8vIFJlc2V0IGNsTHRwIHN0YXRlcwotICAgICAgY2xfbHRwX3Jlc2V0KHN0LT5jbEx0cFN0KTsKLSAgICAgIHN0LT5zaGFycCA9IFNIQVJQTUlOOwotICAgfQotICAgZWxzZQotICAgewotICAgICAgIC8vIGNoZWNrIHJlc29uYW5jZSBpbiB0aGUgZmlsdGVyCi0gICAgICBsc3BfZmxhZyA9IGNoZWNrX2xzcChzdC0+dG9uU3RhYlN0LCBzdC0+bHNwU3QtPmxzcF9vbGQpOwotICAgfQotCi0gICAgKi0tLS0tLS0tL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IGZpbmQgdGhlIExQQyByZXNpZHVhbCBzaWduYWwgcmVzW10gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKgotICAgICogICAgIC0gY29tcHV0ZSB0aGUgdGFyZ2V0IHNpZ25hbCBmb3IgcGl0Y2ggc2VhcmNoICAgICAgICAgICAgICAgICAgICAgICAqCi0gICAgKiAgICAgLSBjb21wdXRlIGltcHVsc2UgcmVzcG9uc2Ugb2Ygd2VpZ2h0ZWQgc3ludGhlc2lzIGZpbHRlciAoaDFbXSkgICAgICoKLSAgICAqICAgICAtIGZpbmQgdGhlIGNsb3NlZC1sb29wIHBpdGNoIHBhcmFtZXRlcnMgICAgICAgICAgICAgICAgICAgICAgICAgICAgKgotICAgICogICAgIC0gZW5jb2RlIHRoZSBwaXRjaCBkZWFseSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqCi0gICAgKiAgICAgLSB1cGRhdGUgdGhlIGltcHVsc2UgcmVzcG9uc2UgaDFbXSBieSBpbmNsdWRpbmcgZml4ZWQtZ2FpbiBwaXRjaCAgICoKLSAgICAqICAgICAtIGZpbmQgdGFyZ2V0IHZlY3RvciBmb3IgY29kZWJvb2sgc2VhcmNoICAgICAgICAgICAgICAgICAgICAgICAgICAgKgotICAgICogICAgIC0gY29kZWJvb2sgc2VhcmNoICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqCi0gICAgKiAgICAgLSBlbmNvZGUgY29kZWJvb2sgYWRkcmVzcyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICoKLSAgICAqICAgICAtIFZRIG9mIHBpdGNoIGFuZCBjb2RlYm9vayBnYWlucyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKgotICAgICogICAgIC0gZmluZCBzeW50aGVzaXMgc3BlZWNoICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqCi0gICAgKiAgICAgLSB1cGRhdGU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i0gICAgICAgKiAtIFByZXByb2Nlc3Npbmcgb2Ygc3ViZnJhbWUgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKgotICAgICAgICotLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSoKLSAgICAgIGlmIChzdWIoKnVzZWRNb2RlLCBNUjQ3NSkgIT0gMCkKLSAgICAgIHsKLSAgICAgICAgIHN1YmZyYW1lUHJlUHJvYygqdXNlZE1vZGUsIGdhbW1hMSwgZ2FtbWExXzEyazIsCi0gICAgICAgICAgICAgICAgICAgICAgICAgZ2FtbWEyLCBBLCBBcSwgJnN0LT5zcGVlY2hbaV9zdWJmcl0sCi0gICAgICAgICAgICAgICAgICAgICAgICAgc3QtPm1lbV9lcnIsIHN0LT5tZW1fdzAsIHN0LT56ZXJvLAotICAgICAgICAgICAgICAgICAgICAgICAgIHN0LT5haV96ZXJvLCAmc3QtPmV4Y1tpX3N1YmZyXSwKLSAgICAgICAgICAgICAgICAgICAgICAgICBzdC0+aDEsIHhuLCByZXMsIHN0LT5lcnJvcik7Ci0gICAgICB9Ci0gICAgICBlbHNlCi0gICAgICB7IC8vIE1SNDc1Ci0gICAgICAgICBzdWJmcmFtZVByZVByb2MoKnVzZWRNb2RlLCBnYW1tYTEsIGdhbW1hMV8xMmsyLAotICAgICAgICAgICAgICAgICAgICAgICAgIGdhbW1hMiwgQSwgQXEsICZzdC0+c3BlZWNoW2lfc3ViZnJdLAotICAgICAgICAgICAgICAgICAgICAgICAgIHN0LT5tZW1fZXJyLCBtZW1fdzBfc2F2ZSwgc3QtPnplcm8sCi0gICAgICAgICAgICAgICAgICAgICAgICAgc3QtPmFpX3plcm8sICZzdC0+ZXhjW2lfc3ViZnJdLAotICAgICAgICAgICAgICAgICAgICAgICAgIHN0LT5oMSwgeG4sIHJlcywgc3QtPmVycm9yKTsKLQotICAgICAgICAgLy8gc2F2ZS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SwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc3ludGgsIHhuX3NmMCwgY29kZV9zZjAsIHkxLCB5Ml9zZjAsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgIHN0LT5tZW1fc3luLCBzdC0+bWVtX2Vyciwgc3QtPm1lbV93MCwgc3QtPmV4YywKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJnNoYXJwX3NhdmUpOyAvLyBvdmVyd3JpdGVzIHNoYXJwX3NhdmUKLSAgICAgICAgICAgIEFxICs9IE1QMTsKLQotICAgICAgICAgICAgLy8gcmUtcnVuIHByZS1wcm9jZXNzaW5nIHRvIGdldCB4biByaWdodCAobmVlZGVkIGJ5IHBvc3Rwcm9jKQotICAgICAgICAgICAgLy8gKHRoaXMgYWxzbyByZWNvbnN0cnVjdHMgdGhlIHVuc2hhcnBlbmVkIGgxIGZvciBzZiAxKQotICAgICAgICAgICAgc3ViZnJhbWVQcmVQcm9jKCp1c2VkTW9kZSwgZ2FtbWExLCBnYW1tYTFfMTJrMiwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBnYW1tYTIsIEEsIEFxLCAmc3QtPnNwZWVjaFtpX3N1YmZyXSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBzdC0+bWVtX2Vyciwgc3QtPm1lbV93MCwgc3QtPnplcm8sCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgc3QtPmFpX3plcm8sICZzdC0+ZXhjW2lfc3ViZnJdLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgIHN0LT5oMSwgeG4sIHJlcywgc3QtPmVycm9yKTsKLQotICAgICAgICAgICAgLy8gcmUtYnVpbGQgZXhjaXRhdGlvbiBzZiAxIChjaGFuZ2VkIGlmIGxhZyA8IExfU1VCRlIpCi0gICAgICAgICAgICBQcmVkX2x0XzNvcjYoJnN0LT5leGNbaV9zdWJmcl0sIFQwLCBUMF9mcmFjLCBMX1NVQkZSLCAxKTsKLSAgICAgICAgICAgIENvbn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0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0KLSovCi0KLVdvcmQxNiBjb2RfYW1yKAotICAgIGNvZF9hbXJTdGF0ZSAqc3QsICAgICAgICAgIC8qIGkvbyA6IFN0YXRlIHN0cnVjdCAgICAgICAgICAgICAgICAgICAqLwotICAgIGVudW0gTW9kZSBtb2RlLCAgICAgICAgICAgIC8qIGkgICA6IEFNUiBtb2RlICAgICAgICAgICAgICAgICAgICAgICAqLwotICAgIFdvcmQxNiBuZXdfc3BlZWNoW10sICAgICAgIC8qIGkgICA6IHNwZWVjaCBpbnB1dCAoTF9GUkFNRSkgICAgICAgICAqLwotICAgIFdvcmQxNiBhbmFbXSwgICAgICAgICAgICAgIC8qIG8gICA6IEFuYWx5c2lzIHBhcmFtZXRlcnMgICAgICAgICAgICAqLwotICAgIGVudW0gTW9kZSAqdXNlZE1vZGUsICAgICAgIC8qIG8gICA6IHVzZWQgbW9kZSAgICAgICAgICAgICAgICAgICAgICAqLwotICAgIFdvcmQxNiBzeW50aFtdICAgICAgICAgICAgLyogbyAgIDogTG9jYWwgc3ludGhlc2lzICAgICAgICAgICAgICAgICovCi0pCi17Ci0gICAgLyogTFBDIGNvZWZmaWNpZW50cyAqLwotICAgIFdvcmQxNiBBX3RbKE1QMSkgKiA0XTsgICAgICAvKiBBKHopIHVucXVhbnRpemVkIGZvciB0aGUgNCBzdWJmcmFtZXMgKi8KLSAgICBXb3JkMTYgQXFfdFsoTVAxKSAqIDRdOyAgICAgLyogQSh6KSAgIHF1YW50aXplZCBmb3IgdGhlIDQgc3ViZnJhbWVzICovCi0gICAgV29yZDE2ICpBLCAqQXE7ICAgICAgICAgICAgIC8qIFBvaW50ZXIgb24gQV90IGFuZCBBcV90ICAgICAgICAgICAgICAqLwotICAgIFdvcmQxNiBsc3BfbmV3W01dOwotCi0gICAgLyogT3RoZXIgdmVjdG9ycyAqLwotICAgIFdvcmQxNiB4bltMX1NVQkZSXTsgIC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RlYm9vayBleGNpdGF0aW9uICAgICAgICAgICAgKi8KLSAgICBXb3JkMTYgaDFfc2YwW0xfU1VCRlJdOyAgICAgLyogVGhlIGltcHVsc2UgcmVzcG9uc2Ugb2Ygc2YwICAgICAgICAgICovCi0gICAgV29yZDE2IG1lbV9zeW5fc2F2ZVtNXTsgICAgIC8qIEZpbHRlciBtZW1vcnkgICAgICAgICAgICAgICAgICAgICAgICAqLwotICAgIFdvcmQxNiBtZW1fdzBfc2F2ZVtNXTsgICAgICAvKiBGaWx0ZXIgbWVtb3J5ICAgICAgICAgICAgICAgICAgICAgICAgKi8KLSAgICBXb3JkMTYgbWVtX2Vycl9zYXZlW01dOyAgICAgLyogRmlsdGVyIG1lbW9yeSAgICAgICAgICAgICAgICAgICAgICAgICovCi0gICAgV29yZDE2IHNoYXJwX3NhdmU7ICAgICAgICAgIC8qIFNoYXJwZW5pbmcgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotICAgIFdvcmQxNiBldmVuU3ViZnI7ICAgICAgICAgICAvKiBFdmVuIHN1YmZyYW1lIGluZGljYXRvciAgICAgICAgICAgICAgKi8KLSAgICBXb3JkMTYgVDBfc2YwID0gMDsgICAgICAgICAgLyogSW50ZWdlciBwaXRjaCBsYWcgb2Ygc2YwICAgICAgICAgICAgICovCi0gICAgV29yZDE2IFQwX2ZyYWNfc2YwID0gMDsgICAgIC8qIEZyYWN0aW9uYWwgcGl0Y2ggbGFnIG9mIHNmMCAgICAgICAgICAqLwotICAgIFdvcmQxNiBpX3N1YmZyX3NmMCA9IDA7ICAgICAvKiBQb3NpdGlvbiBpbiBleGNbXSBmb3Igc2YwICAgICAgICAgICAgKi8KLSAgICBXb3JkMTYgZ2Fpbl9waXRfc2YwOyAgICAgICAgLyogUXVhbnRpemVkIHBpdGNoIGdhaW4gZm9yIHNmMCAgICAgICAgICovCi0gICAgV29yZDE2IGdhaW5fY29kZV9zZjA7ICAgICAgIC8qIFF1YW50aXplZCBjb2RlYm9vayBnYWluIGZ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9mbGFnID0gdmFkMihzdC0+bmV3X3NwZWVjaCArIDgwLCBzdC0+dmFkU3QsIHBPdmVyZmxvdykgfHwgdmFkX2ZsYWc7Ci0jZWxzZQotICAgICAgICB2YWRfZmxhZyA9IHZhZDEoc3QtPnZhZFN0LCBzdC0+bmV3X3NwZWVjaCwgcE92ZXJmbG93KTsKLSNlbmRpZgotCi0gICAgICAgIC8qIE5CISB1c2VkTW9kZSBtYXkgY2hhbmdlIGhlcmUgKi8KLSAgICAgICAgY29tcHV0ZV9zaWRfZmxhZyA9IHR4X2R0eF9oYW5kbGVyKHN0LT5kdHhfZW5jU3QsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2YWRfZmxhZywKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHVzZWRNb2RlLCBwT3ZlcmZsb3cpOwotICAgIH0KLSAgICBlbHNlCi0gICAgewotICAgICAgICBjb21wdXRlX3NpZF9mbGFnID0gMDsKLSAgICB9Ci0KLSAgICAvKi0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSoKLSAgICAqICAtIFBlcmZvcm0gTFBDIGFuYWx5c2lzOiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKgotICAgICogICAgICAgKiBhdXRvY29ycmVsYXRpb24gKyBsYWcgd2luZG93aW5nICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqCi0gICAgKiAgICAgICAqIExldmluc29uLWR1cmJpbiBhbGdvcml0aG0gdG8gZmluZCBhW10gICAgICAgICAgICAgICAgICAgICAgICAgICoKLSAgICAqICAgICAgICogY29udmVydCBhW10gdG8gbHNwW10gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKgotICAgICogICAgICAgKiBxdWFudGl6ZSBhbmQgY29kZSB0aGUgTF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ByZXNbXSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqCi0gICAgKiAgICAgLSBjb21wdXRlIHRoZSB0YXJnZXQgc2lnbmFsIGZvciBwaXRjaCBzZWFyY2ggICAgICAgICAgICAgICAgICAgICAgICoKLSAgICAqICAgICAtIGNvbXB1dGUgaW1wdWxzZSByZXNwb25zZSBvZiB3ZWlnaHRlZCBzeW50aGVzaXMgZmlsdGVyIChoMVtdKSAgICAgKgotICAgICogICAgIC0gZmluZCB0aGUgY2xvc2VkLWxvb3AgcGl0Y2ggcGFyYW1ldGVycyAgICAgICAgICAgICAgICAgICAgICAgICAgICAqCi0gICAgKiAgICAgLSBlbmNvZGUgdGhlIHBpdGNoIGRlYWx5ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICoKLSAgICAqICAgICAtIHVwZGF0ZSB0aGUgaW1wdWxzZSByZXNwb25zZSBoMVtdIGJ5IGluY2x1ZGluZyBmaXhlZC1nYWluIHBpdGNoICAgKgotICAgICogICAgIC0gZmluZCB0YXJnZXQgdmVjdG9yIGZvciBjb2RlYm9vayBzZWFyY2ggICAgICAgICAgICAgICAgICAgICAgICAgICAqCi0gICAgKiAgICAgLSBjb2RlYm9vayBzZWFyY2ggICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICoKLSAgICAqICAgICAtIGVuY29kZSBjb2RlYm9vayBhZGRyZXNzICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKgotICAgICogICAgIC0gVlEgb2YgcGl0Y2ggYW5kIGNvZGVib29rIGdhaW5zICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqCi0gICAgKiAgICAgLSBmaW5kIHN5bnRoZXNpcyBzcGVlY2ggICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICoKLSAgICAqICAgICAtIHVwZGF0ZSBzdGF0ZXMgb2Ygd2VpZ2h0aW5nIGZpbHRlciAg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tLS0tLS0tLS0tLS0tLS0tLS0tLSoKLSAgICAgICAgKiAtIFByZXByb2Nlc3Npbmcgb2Ygc3ViZnJhbWUgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKgotICAgICAgICAqLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0qLwotCi0gICAgICAgIGlmICgqdXNlZE1vZGUgIT0gTVI0NzUpCi0gICAgICAgIHsKLSAgICAgICAgICAgIHN1YmZyYW1lUHJlUHJvYygqdXNlZE1vZGUsIGdhbW1hMSwgZ2FtbWExXzEyazIsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgZ2FtbWEyLCBBLCBBcSwgJnN0LT5zcGVlY2hbaV9zdWJmcl0sCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgc3QtPm1lbV9lcnIsIHN0LT5tZW1fdzAsIHN0LT56ZXJvLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgIHN0LT5haV96ZXJvLCAmc3QtPmV4Y1tpX3N1YmZyXSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBzdC0+aDEsIHhuLCByZXMsIHN0LT5lcnJvcik7Ci0gICAgICAgIH0KLSAgICAgICAgZWxzZQotICAgICAgICB7IC8qIE1SNDc1ICovCi0gICAgICAgICAgICBzdWJmcmFtZVByZVByb2MoKnVzZWRNb2RlLCBnYW1tYTEsIGdhbW1hMV8xMmsyLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgIGdhbW1hMiwgQSwgQXEsICZzdC0+c3BlZWNoW2lfc3ViZnJdLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgIHN0LT5tZW1fZXJyLCBtZW1fdzBfc2F2ZSwgc3QtPnplcm8sCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgc3QtPmFpX3plcm8sICZzdC0+ZXhjW2lfc3ViZnJdLAotICAgICAgICAgICAgICAgICAgICAgICAg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S0tLS0tLS0tLS0tLS0tKi8KLSAgICAgICAgZ2FpblF1YW50KHN0LT5nYWluUXVhbnRTdCwgKnVzZWRNb2RlLCByZXMsICZzdC0+ZXhjW2lfc3ViZnJdLCBjb2RlLAotICAgICAgICAgICAgICAgICAgeG4sIHhuMiwgIHkxLCB5MiwgZ0NvZWZmLCBldmVuU3ViZnIsIGdwX2xpbWl0LAotICAgICAgICAgICAgICAgICAgJmdhaW5fcGl0X3NmMCwgJmdhaW5fY29kZV9zZjAsCi0gICAgICAgICAgICAgICAgICAmZ2Fpbl9waXQsICZnYWluX2NvZGUsICZhbmEsIHBPdmVyZmxvdyk7Ci0KLSAgICAgICAgLyogdXBkYXRlIGdhaW4gaGlzdG9yeSAqLwotICAgICAgICB1cGRhdGVfZ3BfY2xpcHBpbmcoc3QtPnRvblN0YWJTdCwgZ2Fpbl9waXQsIHBPdmVyZmxvdyk7Ci0KLQotICAgICAgICBpZiAoKnVzZWRNb2RlICE9IE1SNDc1KQotICAgICAgICB7Ci0gICAgICAgICAgICAvKiBTdWJmcmFtZSBQb3N0IFBvcmNlc3NpbmcgKi8KLSAgICAgICAgICAgIHN1YmZyYW1lUG9zdFByb2Moc3QtPnNwZWVjaCwgKnVzZWRNb2RlLCBpX3N1YmZyLCBnYWluX3BpdCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZ2Fpbl9jb2RlLCBBcSwgc3ludGgsIHhuLCBjb2RlLCB5MSwgeTIsIHN0LT5tZW1fc3luLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzdC0+bWVtX2Vyciwgc3QtPm1lbV93MCwgc3QtPmV4YywgJnN0LT5zaGFycCwgcE92ZXJmbG93KTsKLSAgICAgICAgfQotICAgICAgICBlbHNlCi0gICAgICAgIHsKLQotICAgICAgICAgICAgaWYgKGV2ZW5TdWJmciAhPSAwKQotICAgICAgICAgICAgewotICAgICAgICAgICAgICAgIGlfc3ViZnJfc2YwID0gaV9zdWJmcjsKLQotICAgICAgICAgICAgICAgIG1lbWNweSh4bl9zZjAsIHhuLCBMX1NVQkZSKnNpemVvZihXb3JkMTYpKTsKLSAgICAgICAgICAgICAgICBtZW1jcHkoeTJfc2YwLCB5MiwgTF9TVUJGUipzaXplb2YoV29yZDE2KSk7Ci0gICAgICAgICAgICAgICAgbWVtY3B5KGNvZGVfc2YwLCBjb2RlLCBMX1NVQkZSKnNpemVvZihXb3JkMTYpKTsKLQotICAgICAgICAgICAgICAgIFQwX3NmMCA9IFQwOwotICAgICAgICAgICAgICAgIFQwX2ZyYWNfc2YwID0gVDBfZnJhYzsKLQotICAgICAgICAgICAgICAgIC8qIFN1YmZyYW1lIFBvc3QgUG9yY2Vzc2luZyAqLwotICAgICAgICAgICAgICAgIHN1YmZyYW1lUG9zdFByb2Moc3QtPnNwZWVjaCwgKnVzZWRNb2RlLCBpX3N1YmZyLCBnYWluX3BpdCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGdhaW5fY29kZSwgQXEsIHN5bnRoLCB4biwgY29kZSwgeTEsIHkyLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbWVtX3N5bl9zYXZlLCBzdC0+bWVtX2VyciwgbWVtX3cwX3NhdmUsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzdC0+ZXhjLCAmc3QtPnNoYXJwLCBwT3ZlcmZsb3cpOwotICAgICAgICAgICAgICAgIHN0LT5zaGFycCA9IHNoYXJwX3NhdmU7Ci0gICAgICAgICAgICB9Ci0gICAgICAgICAgICBlbHNlCi0gICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgLyogdXBkYXRlIGJvdGggc3ViZnJhbWVzIGZvciB0aGUgTVI0NzUgKi8KLQotICAgICAgICAgICAgICAgIC8qIFJlc3RvcmUgc3RhdGVzIGZvciB0aGUgTVI0NzUgbW9kZSAqLwotICAgICAgICAgICAgICAgIG1lbWNweShzdC0+bWVtX2VyciwgbWVtX2Vycl9zYXZlLCBNKnNpemVvZihXb3JkMTYpKTsKLQotCi0gICAgICAgICAgICAgICAgLyogcmUtYnVpbGQgZXhjaXRhdGlvbiBmb3Igc2YgMCAqLwotICAgICAgICAgICAgICAgIFByZWRfbHRfM29yNigmc3QtPmV4Y1tpX3N1YmZyX3NmMF0sIFQwX3NmMCwgVDBfZnJhY19zZjAsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgIExfU1VCRlIsIDEsIHBPdmVyZmxvdyk7Ci0gICAgICAgICAgICAgICAgQ29udm9sdmUoJnN0LT5leGNbaV9zdWJmcl9zZjBdLCBoMV9zZjAsIHkxLCBMX1NVQkZSKTsKLQotICAgICAgICAgICAgICAgIEFxIC09IE1QMTsKLSAgICAgICAgICAgICAgICBzdWJmcmFtZVBvc3RQcm9jKHN0LT5zcGVlY2gsICp1c2VkTW9kZSwgaV9zdWJmcl9zZjAsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBnYWluX3BpdF9zZjAsIGdhaW5fY29kZV9zZjAsIEFxLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc3ludGgsIHhuX3NmMCwgY29kZV9zZjAsIHkxLCB5Ml9zZjAsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzdC0+bWVtX3N5biwgc3QtPm1lbV9lcnIsIHN0LT5tZW1fdzAsIHN0LT5leGMsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmc2hhcnBfc2F2ZSwgcE92ZXJmbG93KTsgLyogb3ZlcndyaXRlcyBzaGFycF9zYXZlICovCi0gICAgICAgICAgICAgICAgQXEgKz0gTVAxOwotCi0gICAgICAgICAgICAgICAgLyogcmUtcnVuIHByZS1wcm9jZXNzaW5nIHRvIGdldCB4biByaWdodCAobmVlZGVkIGJ5IHBvc3Rwcm9jKSAqLwotICAgICAgICAgICAgICAgIC8qICh0aGlzIGFsc28gcmVjb25zdHJ1Y3RzIHRoZSB1bnNoYXJwZW5lZCBoMSBmb3Igc2YgMSkgICAgICAgKi8KLSAgICAgICAgICAgICAgICBzdWJmcmFtZVByZVByb2MoKnVzZWRNb2RlLCBnYW1tYTEsIGdhbW1hMV8xMmsyLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBnYW1tYTIsIEEsIEFxLCAmc3QtPnNwZWVjaFtpX3N1YmZyXSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc3QtPm1lbV9lcnIsIHN0LT5tZW1fdzAsIHN0LT56ZXJvLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzdC0+YWlfemVybywgJnN0LT5leGNbaV9zdWJmcl0sCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHN0LT5oMSwgeG4sIHJlcywgc3QtPmVycm9yKTsKLQotICAgICAgICAgICAgICAgIC8qIHJlLWJ1aWxkIGV4Y2l0YXRpb24gc2YgMSAoY2hhbmdlZCBpZiBsYWcgPCBMX1NVQkZSKSAqLwotICAgICAgICAgICAgICAgIFByZWRfbHRfM29yNigmc3QtPmV4Y1tpX3N1YmZyXSwgVDAsIFQwX2ZyYWMsIExfU1VCRlIsIDEsIHBPdmVyZmxvdyk7Ci0gICAgICAgICAgICAgICAgQ29udm9sdmUoJnN0LT5leGNbaV9zdWJmcl0sIHN0LT5oMSwgeTEsIExfU1VCRlIpOwotCi0gICAgICAgICAgICAgICAgc3ViZnJhbWVQb3N0UHJvYyhzdC0+c3BlZWNoLCAqdXNlZE1vZGUsIGlfc3ViZnIsIGdhaW5fcGl0LAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZ2Fpbl9jb2RlLCBBcSwgc3ludGgsIHhuLCBjb2RlLCB5MSwgeTIsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzdC0+bWVtX3N5biwgc3QtPm1lbV9lcnIsIHN0LT5tZW1fdzAsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzdC0+ZXhjLCAmc3QtPnNoYXJwLCBwT3ZlcmZsb3cpOwotICA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DEgICAgICAgICA6IExQQyBvcmRlcisxICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICoKLSAgICAgKiAgIExfVE9UQUw3azQgIDogVG90YWwgc2l6ZSBvZiBzcGVlY2ggYnVmZmVyLiAgICAgICAgICAgICAgKgotICAgICAqICAgUElUX01JTjdrNCAgOiBNaW5pbXVtIHBpdGNoIGxhZy4gICAgICAgICAgICAgICAgICAgICAgICAqCi0gICAgICogICBQSVRfTUFYICAgICA6IE1heGltdW0gcGl0Y2ggbGFnLiAgICAgICAgICAgICAgICAgICAgICAgICoKLSAgICAgKiAgIExfSU5URVJQT0wgIDogTGVuZ3RoIG9mIGZpbHRlciBmb3IgaW50ZXJwb2xhdGlvbiAgICAgICAgKgotICAgICAqLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0qLwotICAgIHR5cGVkZWYgc3RydWN0Ci0gICAgewotICAgICAgICAvKiBTcGVlY2ggdmVjdG9yICovCi0gICAgICAgIFdvcmQxNiBvbGRfc3BlZWNoW0xfVE9UQUxdOwotICAgICAgICBXb3JkMTYgKnNwZWVjaCwgKnBfd2luZG93LCAqcF93aW5kb3dfMTJrMjsKLSAgICAgICAgV29yZDE2ICpuZXdfc3BlZWNoOyAgICAgICAgICAgICAvKiBHbG9iYWwgdmFyaWFibGUgKi8KLQotICAgICAgICAvKiBXZWlnaHQgc3BlZWNoIHZlY3RvciAqLwotICAgICAgICBXb3JkMTYgb2xkX3dzcFtMX0ZSQU1FICsgUElUX01BWF07Ci0gICAgICAgIFdvcmQxNiAqd3NwOwotCi0gICAgICAgIC8qIE9MIExUUCBzdGF0ZXMgKi8KLSAgICAgICAgV29yZDE2IG9sZF9sYWdzWzVdOwotICAgICAgICBXb3JkMTYgb2xfZ2Fpbl9mbGdbMl07Ci0KLSAgICAgICAgLyogRXhjaXRhdGlvbiB2ZWN0b3IgKi8KLSAgICAgICAgV29yZDE2IG9s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LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLQotICAgIDsgR0xPQkFMIEZVTkNUSU9OIERFRklOSVRJT05TCi0gICAgOyBbTGlzdCBmdW5jdGlvbiBwcm90b3R5cGVzIGhlcmVdCi0gICAgLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSovCi0gICAgLyoKLSAgICAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgotICAgICoKLSAgICAqICBGdW5jdGlvbiAgICA6IGNvZF9hbXJfaW5pdAotICAgICogIFB1cnBvc2UgICAgIDogQWxsb2NhdGVzIG1lbW9yeSBhbmQgaW5pdGlhbGl6ZXMgc3RhdGUgdmFyaWFibGVzCi0gICAgKiAgRGVzY3JpcHRpb24gOiBTdG9yZXMgcG9pbnRlciB0byBmaWx0ZXIgc3RhdHVzIHN0cnVjdCBpbiAqc3QuIFRoaXMKLSAgICAqICAgICAgICAgICAgICAgIHBvaW50ZXIgaGFzIHRvIGJlIHBhc3NlZCB0byBjb2RfYW1yIGluIGVhY2ggY2FsbC4KLSAgICAqICAgICAgICAgICAgICAgICAtIGluaXRpbGl6ZSBwb2ludGVycyB0byBzcGVlY2ggYnVmZmVyCi0gICAgKiAgICAgICAgICAgICAgICAgLSBpbml0aWFsaXplIHN0YXRpYyAgcG9pbnRlcnMKLSAgICAqICAgICAgICAgICAgICAgICAtIHNldCBzdGF0aWMgdmVjdG9ycyB0byB6ZXJvCi0gICAgKiAgUmV0dXJucyAgICAgOiAwIG9uIHN1Y2Nlc3MKLSAgICAqCi0gICAgKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKLSAgICAqLwotICAgIFdvcmQxNiBjb2RfYW1yX2luaXQoY29kX2FtclN0YXRlICoqc3QsIEZsYWcgZHR4KTsKLQotICAgIC8qCi0gICAgKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKLSAgICAqCi0gICAgKiAgRnVuY3Rpb24gICAgOiBjb2RfYW1yX3Jlc2V0Ci0gICAgKiAgUHVycG9zZSAgICAgOiBSZXNldHMgc3RhdGUgbWVtb3J5Ci0gICAgKiAgUmV0dXJucyAgICAgOiAwIG9uIHN1Y2Nlc3MKLSAgICAqCi0gICAgKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKLSAgICAqLwotICAgIFdvcmQxNiBjb2RfYW1yX3Jlc2V0KGNvZF9hbXJTdGF0ZSAqc3QpOwotCi0gICAgLyoKLSAgICAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgotICAgICoKLSAgICAqICBGdW5jdGlvbiAgICA6IGNvZF9hbXJfZXhpdAotICAgICogIFB1cnBvc2UgICAgIDogVGhlIG1lbW9yeSB1c2VkIGZvciBzdGF0ZSBtZW1vcnkgaXMgZnJlZWQKLSAgICAqICBEZXNjcmlwdGlvbiA6IFN0b3JlcyBOVUxMIGluICpzdAotICAgICoKLSAgICAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgotICAgICovCi0gICAgdm9pZCBjb2RfYW1yX2V4aXQoY29kX2FtclN0YXRlICoqc3QpOwotCi0gICAgLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgotICAgICAqICAgRlVOQ1RJT046ICAgY29kX2Ftcl9maXJzdAotICAgICAqCi0gICAgICogICBQVVJQT1NFOiAgQ29wZXMgd2l0aCBsb29rLWFoZWFkLgotICAgICAqCi0gICAgICogICBJTlBVVFM6Ci0gICAgICogICAgICAgTm8gaW5wdXQgYXJndW1lbnQgYXJlIHBhc3NlZCB0byB0aGlzIGZ1bmN0aW9uLiBIb3dldmVyLCBiZWZvcmUKLSAgICAgKiAgICAgICBjYWxsaW5nIHRoaXMgZnVuY3Rpb24sIDQwIG5ldyBzcGVlY2ggZGF0YSBzaG91bGQgYmUgY29waWVkIHRvIHRoZQotICAgICAqICAgICAgIHZlY3RvciBuZXdfc3BlZWNoW10uIFRoaXMgaXMgYSBnbG9iYWwgcG9pbnRlciB3aGljaCBpcyBkZWNsYXJlZCBpbgotICAgICAqICAgICAgIHRoaXMgZmlsZSAoaXQgcG9pbnRzIHRvIHRoZSBlbmQgb2Ygc3BlZWNoIGJ1ZmZlciBtaW51cyAyMDApLgotICAgICAqCi0gICAgICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLQotICAgIFdvcmQxNiBjb2RfYW1yX2ZpcnN0KGNvZF9hbXJTdGF0ZSAqc3QsICAgICAvKiBpL28gOiBTdGF0ZSBzdHJ1Y3QgICAgICAgICAgICAqLwotICAgICAgICAgICAgICAgICAgICAgICAgIFdvcmQxNiBuZXdfc3BlZWNoW10gICAvKiBpICAgOiBzcGVlY2ggaW5wdXQgKExfRlJBTUUpICAqLwotICAgICAgICAgICAgICAgICAgICAgICAgKTsKLQotICAgIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKLSAgICAgKiAgIEZVTkNUSU9OOiAgIGNvZF9hbXIKLSAgICAgKgotICAgICAqICAgUFVSUE9TRTogIE1haW4gZW5jb2RlciByb3V0aW5lLgotICAgICAqCi0gICAgICogICBERVNDUklQVElPTjogVGhpcyBmdW5j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BwdXJwb3NlcykKLSAgICAgKgotICAgICAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0KLSAgICBXb3JkMTYgY29kX2Ftcihjb2RfYW1yU3RhdGUgKnN0LCAgICAgICAgIC8qIGkvbyA6IFN0YXRlIHN0cnVjdCAgICAgICAgICAgICAgICAgKi8KLSAgICAgICAgICAgICAgICAgICBlbnVtIE1vZGUgbW9kZSwgICAgICAgICAgIC8qIGkgICA6IEFNUiBtb2RlICAgICAgICAgICAgICAgICAgICAgKi8KLSAgICAgICAgICAgICAgICAgICBXb3JkMTYgbmV3X3NwZWVjaFtdLCAgICAgIC8qIGkgICA6IHNwZWVjaCBpbnB1dCAoTF9GUkFNRSkgICAgICAgKi8KLSAgICAgICAgICAgICAgICAgICBXb3JkMTYgYW5hW10sICAgICAgICAgICAgIC8qIG8gICA6IEFuYWx5c2lzIHBhcmFtZXRlcnMgICAgICAgICAgKi8KLSAgICAgICAgICAgICAgICAgICBlbnVtIE1vZGUgKnVzZWRNb2RlLCAgICAgIC8qIG8gICA6IHVzZWQgbW9kZSAgICAgICAgICAgICAgICAgICAgKi8KLSAgICAgICAgICAgICAgICAgICBXb3JkMTYgc3ludGhbXSAgICAgICAgICAgIC8qIG8gICA6IExvY2FsIHN5bnRoZXNpcyAgICAgICAgICAgICAgKi8KLSAgICAgICAgICAgICAgICAgICk7Ci0KLQotI2lmZGVmIF9fY3BsdXNwbHVzCi19Ci0jZW5kaWYKLQotI2VuZGlmICAvKiBfY29kX2Ftcl9oXyAqLwotCi0KLQpkaWZmIC0tZ2l0IGEvbWVkaWEvbGlic3RhZ2VmcmlnaHQvY29kZWNzL2Ftcm5iL2VuYy9zcmMvY29udm9sdmUuY3BwIGIvbWVkaWEvbGlic3RhZ2VmcmlnaHQvY29kZWNzL2Ftcm5iL2VuYy9zcmMvY29udm9sdmUuY3BwCmRlbGV0ZWQgZmlsZSBtb2Rl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nkgc3BlY2lhbCBub3RlcywgY29uc3RyYWludHMgb3IgY2F1dGlvbnMgZm9yIHVzZXJzIG9mIHRoaXMgZnVuY3Rpb25dCi0KLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLQotKi8KLQotdm9pZCBDb252b2x2ZSgKLSAgICBXb3JkMTYgeFtdLCAgICAgICAgLyogKGkpICAgICA6IGlucHV0IHZlY3RvciAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0gICAgV29yZDE2IGhbXSwgICAgICAgIC8qIChpKSAgICAgOiBpbXB1bHNlIHJlc3BvbnNlICAgICAgICAgICAgICAgICAgICAgICAqLwotICAgIFdvcmQxNiB5W10sICAgICAgICAvKiAobykgICAgIDogb3V0cHV0IHZlY3RvciAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLSAgICBXb3JkMTYgTCAgICAgICAgICAgLyogKGkpICAgICA6IHZlY3RvciBzaXplICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0pCi17Ci0gICAgcmVnaXN0ZXIgV29yZDE2IGksIG47Ci0gICAgV29yZDMyIHMxLCBzMjsKLQotCi0gICAgZm9yIChuID0gMTsgbiA8IEw7IG4gPSBuICsgMikKLSAgICB7Ci0KLSAgICAgICAgaCA9IGggKyBuOwotCi0gICAgICAgIHMyID0gKChXb3JkMzIpICogKHgpKSAqICooaC0tKTsKLSAgICAgICAgczEgPSAoKFdvcmQzMikgKiAoeCsrKSkgKiAqKGgpOwotCi0gICAgICAgIGZvciAoaSA9IChuIC0gMSkgPj4gMTsgaSAhPSAwOyBpLS0pCi0gICAgICAgIHsKLSAgICAgICAgICAgIHMyID0gYW1ybmJfZnhwX21hY18xNl9ieV8xNmJiKChXb3JkMzIpICogKHgpLCAoV29yZDMyKSAqIChoLS0pLCBzMik7Ci0gICAgICAgICAgICBzMSA9IGFtcm5iX2Z4cF9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RlIGZvciB0aGUgQWRhcHRpdmUgTXVsdGktUmF0ZSAoQU1SKSBzcGVlY2ggY29kZWMKLSAgICBBdmFpbGFibGUgZnJvbSBodHRwOi8vd3d3LjNncHAub3JnCi0KLShDKSAyMDA0LCAzR1BQIE9yZ2FuaXphdGlvbmFsIFBhcnRuZXJzIChBUklCLCBBVElTLCBDQ1NBLCBFVFNJLCBUVEEsIFRUQykKLVBlcm1pc3Npb24gdG8gZGlzdHJpYnV0ZSwgbW9kaWZ5IGFuZCB1c2UgdGhpcyBmaWxlIHVuZGVyIHRoZSBzdGFuZGFyZCBsaWNlbnNlCi10ZXJtcyBsaXN0ZWQgYWJvdmUgaGFzIGJlZW4gb2J0YWluZWQgZnJvbSB0aGUgY29weXJpZ2h0IGhvbGRlci4KLSoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0vKgotKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKLSoKLSogICAgICBHU00gQU1SLU5CIHNwZWVjaCBjb2RlYyAgIFI5OCAgIFZlcnNpb24gNy41LjAgICBNYXJjaCAyLCAyMDAxCi0qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBSOTkgICBWZXJzaW9uIDMuMi4wCi0qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBSRUwtNCBWZXJzaW9uIDQuMC4wCi0qCi0qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgotKgotKiAgICAgIEZpbGUgICAgICAgICAgICAgOiBjb252b2x2ZS5oCi0qICAgICAgUHVycG9zZSAgICAgICAgICA6IFBlcmZvcm0gdGhlIGNvbnZvbHV0aW9uIGJldHdlZW4gdHdvIHZlY3RvcnMgeFtdCi0qICAgICAgICAgICAgICAgICAgICAgICA6IGFuZCBoW10gYW5kIHdyaXRlIHRoZSByZXN1bHQgaW4gdGhlIHZlY3RvciB5W10uCi0qICAgICAgICAgICAgICAgICAgICAgICA6IEFsbCB2ZWN0b3JzIGFyZSBvZiBsZW5ndGggTCBhbmQgb25seSB0aGUgZmlyc3QKLSogICAgICAgICAgICAgICAgICAgICAgIDogTCBzYW1wbGVzIG9mIHRoZSBjb252b2x1dGlvbiBhcmUgY29tcHV0ZWQuCi0qCi0qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgotKi8KLSNpZm5kZWYgY29udm9sdmVfaAotI2RlZmluZSBjb252b2x2ZV9oICIkSWQgJCIKLQotLyoKLSoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCi0qICAgICAgICAgICAgICAgICAgICAgICAgIElOQ0xVREUgRklMRVMKLSoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCi0qLwotI2luY2x1ZGUgInR5cGVkZWYuaCIKLQotI2lmZGVmIF9fY3BsdXNwbHVzCi1leHRlcm4gIkMiCi17Ci0jZW5kaWYKLQotICAgIC8qCi0gICAgKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKLSAgICAqICAgICAgICAgICAgICAgICAgICAgICAgIERFRklOSVRJT04gT0YgREFUQSBUWVBFUwotICAgICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCi0gICAgKi8KLQotICAgIC8qCi0gICAgKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKLSAgICAqICAgICAgICAgICAgICAgICAgICAgICAgIERFQ0xBUkFUSU9OIE9GIFBST1RPVFlQRVMKLSAgICAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgotICAgICovCi0gICAgdm9pZCBDb252b2x2ZSgKLSAgICAgICAgV29yZDE2IHhbXSwgICAgICAgIC8qIChpKSAgOiBpbnB1dCB2ZWN0b3IgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLSAgICAgICAgV29yZDE2IGhbXSwgICAgICAgIC8qIChpKSAgOiBpbXB1bHNlIHJlc3BvbnNlICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLSAgICAgICAgV29yZDE2IHlbXSwgICAgICAgIC8qIChvKSAgOiBvdXRwdXQgdmVjdG9yICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLSAgICAgICAgV29yZDE2IEwgICAgICAgICAgIC8qIChpKSAgOiB2ZWN0b3Igc2l6ZSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLSAgICApOwotCi0jaWZkZWYgX19jcGx1c3BsdXMKLX0KLSNlbmRpZgotCi0jZW5kaWYKZGlmZiAtLWdpdCBhL21lZGlhL2xpYnN0YWdlZnJpZ2h0L2NvZGVjcy9hbXJuYi9lbmMvc3JjL2Nvcl9oLmNwcCBiL21lZGlhL2xpYnN0YWdlZnJpZ2h0L2NvZGVjcy9hbXJuYi9lbmMvc3JjL2Nvcl9oLmNwcApkZWxldGVkIGZpbGUgbW9kZSAxMDA2NDQKaW5kZXggZTQ2ZDk5Zi4uMDAwMDAwMAotLS0gYS9tZWRpYS9saWJzdGFnZWZyaWdodC9jb2RlY3MvYW1ybmIvZW5jL3NyYy9jb3JfaC5jcHAKKysrIC9kZXYvbnVsbApAQCAtMSw0MjkgKzAsMCBAQAotLyogLS0t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S0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLQotIFBTRVVETy1DT0RFCi0KLXZvaWQgY29yX2ggKAotICAgIFdvcmQxNiBoW10sICAgICAgICAgLy8gKGkpIDogaW1wdWxzZSByZXNwb25zZSBvZiB3ZWlnaHRlZCBzeW50aGVzaXMKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZpbHRlcgotICAgIFdvcmQxNiBzaWduW10sICAgICAgLy8gKGkpIDogc2lnbiBvZiBkW25dCi0gICAgV29yZDE2IHJyW11bTF9DT0RFXSAvLyAobykgOiBtYXRyaXggb2YgYXV0b2NvcnJlbGF0aW9uCi0pCi17Ci0gICAgV29yZDE2IGksIGosIGssIGRlYywgaDJbTF9DT0RFXTsKLSAgICBXb3JkMzIgczsKLQotICAgIC8vIFNjYWxpbmcgZm9yIG1heGltdW0gcHJlY2lzaW9uCi0KLSAgICBzID0gMjsKLSAgICBmb3IgKGkgPSAwOyBpIDwgTF9DT0RFOyBpKyspCi0gICAgICAgIHMgPSBMX21hYyAocywgaFtpXSwgaFtpXSk7Ci0KLSAgICBqID0gc3ViIChleHRyYWN0X2ggKHMpLCAzMjc2Nyk7Ci0gICAgaWYgKGogPT0gMCkKLSAgICB7Ci0gICAgICAgIGZvciAoaSA9IDA7IGkgPCBMX0NPREU7IGkrKykKLSAgICAgICAgewotICAgICAgICAgICAgaDJbaV0gPSBzaHIgKGhbaV0sIDEpOwotICAgICAgICB9Ci0gICAgfQotICAgIGVsc2UKLSAgICB7Ci0gICAgICAgIHMgPSBMX3NociAocywgMSk7Ci0gICAgICAgIGsgPSBleHRyYWN0X2ggKExfc2hsIChJbnZfc3FydCAocyksIDcpKTsKLSAgICAgICAgayA9IG11bHQgKGssIDMyNDQwKTsgICAgICAgICAgICAgICAgICAgICAvLyBrID0gMC45OSprCi0KLSAgICAgICAgZm9yIChpID0gMDsgaSA8IExfQ09ERTsgaSsrKQotICAgICAgICB7Ci0g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A9IGFtcm5iX2Z4cF9tYWNfMTZfYnlfMTZiYigoV29yZDMyKSB0bXAxLCAoV29yZDMyKSB0bXAxLCBzKTsKLSAgICAgICAgdG1wMSA9ICoocF9oKyspOwotICAgICAgICBzID0gYW1ybmJfZnhwX21hY18xNl9ieV8xNmJiKChXb3JkMzIpIHRtcDEsIChXb3JkMzIpIHRtcDEsIHMpOwotCi0gICAgfQotCi0gICAgcyA8PD0gMTsKLQotICAgIGlmIChzICYgTUlOXzMyKQotICAgIHsKLSAgICAgICAgcF9oMiA9IGgyOwotICAgICAgICBwX2ggID0gaDsKLQotICAgICAgICBmb3IgKGkgPSAoTF9DT0RFID4+IDEpOyBpICE9IDA7IGktLSkKLSAgICAgICAgewotICAgICAgICAgICAgKihwX2gyKyspID0gICoocF9oKyspICA+PiAxOwotICAgICAgICAgICAgKihwX2gyKyspID0gICoocF9oKyspICA+PiAxOwotICAgICAgICB9Ci0gICAgfQotICAgIGVsc2UKLSAgICB7Ci0KLSAgICAgICAgcyA+Pj0gMTsKLQotICAgICAgICBzID0gSW52X3NxcnQocywgcE92ZXJmbG93KTsKLQotICAgICAgICBpZiAocyA8IChXb3JkMzIpIDB4MDBmZmZmZmZMKQotICAgICAgICB7Ci0gICAgICAgICAgICAvKiBrID0gMC45OSprICovCi0gICAgICAgICAgICBkZWMgPSAoV29yZDE2KSgoKHMgPj4gOSkgKiAzMjQ0MCkgPj4gMTUpOwotICAgICAgICB9Ci0gICAgICAgIGVsc2UKLSAgICAgICAgewotICAgICAgICAgICAgZGVjID0gMzI0NDA7ICAvKiAwLjk5ICovCi0gICAgICAgIH0KLQotICAgICAgICBwX2ggID0gaDsKLSAgICAgICAgcF9oMiA9IGgyOwotCi0gICAgICAgIGZvciAoaSA9IChMX0NPREUgPj4gMSk7IGkgIT0gMDsgaS0tKQotICAgICAgICB7Ci0gICAgICAgICAgICAqKHBfaDIrKykgPSAoV29yZDE2KSgoYW1ybmJfZnhwX21hY18xNl9ieV8xNmJiKChXb3JkMzIpICogKHBfaCsrKSwgKFdvcmQzMikgZGVjLCAweDAyMEwpKSA+PiA2KTsKLSAgICAgICAgICAgICoocF9oMisrKSA9IChXb3JkMTYpKChhbXJuYl9meHBfbWFjXzE2X2J5XzE2YmIoKFdvcmQzMikgKiAocF9oKyspLCAoV29yZDMyKSBkZWMsIDB4MDIwTCkpID4+IDYpOwotICAgICAgICB9Ci0gICAgfQotICAgIC8qIGJ1aWxkIG1hdHJpeCBycltdICovCi0KLSAgICBzID0gMDsKLQotICAgIHBfaDIgPSBoMjsKLQotICAgIHJyMSA9ICZycltMX0NPREUtMV1bTF9DT0RFLTFdOwotCi0gICAgZm9yIChpID0gTF9DT0RFID4+IDE7IGkgIT0gMCA7IGktLSkKLSAgICB7Ci0gICAgICAgIHRtcDEgICA9ICoocF9oMisrKTsKLSAgICAgICAgcyA9IGFtcm5iX2Z4cF9tYWNfMTZfYnlfMTZiYigoV29yZDMyKSB0bXAxLCAoV29yZDMyKSB0bXAxLCBzKTsKLSAgICAgICAgKnJyMSA9IChXb3JkMTYpKChzICsgMHgwMDAwNDAwMEwpID4+IDE1KTsKLSAgICAgICAgcnIxIC09IChMX0NPREUgKyAxKTsKLSAgICAgICAgdG1wMSAgID0gKihwX2gyKyspOwotICAgICAgICBzID0gYW1ybmJfZnhwX21hY18xNl9ieV8xNmJiKChXb3JkMzIpIHRtcDEsIChXb3JkMzIpIHRtcDEsIHMpOwotICAgICAgICAqcnIxID0gKFdvcmQxNikoKHMgKyAweDAwMDA0MDAwTCkgPj4gMTUpOwotICAgICAgICBycjEgLT0gKExfQ09ERSArIDEpOwotICAgIH0KLQotCi0gICAgcF9ycl9yZWYxID0gcnJbTF9DT0RFLTFdOwotCi0gICAgZm9yIChkZWMgPSAxOyBkZWMgPCBMX0NPREU7IGRlYyArPSAyKQotICAgIHsKLSAgICAgICAgcnIxID0gJnBfcnJfcmVmMVtMX0NPREUtMS1kZWNdOwotCi0gICAgICAgIHJyMiA9ICZycltMX0NPREUtMS1kZWNdW0xfQ09ERS0xXTsKLSAgICAgICAgcnIzID0gJnJyW0xfQ09ERS0xLShkZWMrMSldW0xfQ09ERS0xXTsKLQotICAgICAgICBzICA9IDA7Ci0gICAgICAgIHMyID0gMDsKLQotICAgICAgICBwX3NpZ24xID0gJnNpZ25bTF9DT0RFIC0gMV07Ci0gICAgICAgIHBfc2lnbjIgPSAmc2lnbltMX0NPREUgLSAxIC0gZGVjXTsKLQotICAgICAgICBwX2gyID0gaDI7Ci0gICAgICAgIHBfaCAgPSAmaDJbZGVjXTsKLQotICAgICAgICBmb3IgKGkgPSAoTF9DT0RFIC0gZGVjIC0gMSk7IGkgIT0gMCA7IGktLSkKLSAgICAgICAgewotICAgICAgICAgICAgcyA9IGFtcm5iX2Z4cF9tYWNfMTZfYnlfMTZiYigoV29yZDMyKSAqIChwX2gyKSwgKFdvcmQzMikgKiAocF9oKyspLCBzKTsKLSAgICAgICAgICAgIHMyID0gYW1ybmJfZnhwX21hY18xNl9ieV8xNmJiKChXb3JkMzIpICogKHBfaDIrKyksIChXb3JkMzIpICogKHBfaCksIHMyKTsKLQotICAgICAgICAgICAgdG1wMSAgPSAoV29yZDE2KSgocyArIDB4MDAwMDQwMDBMKSA+PiAxNSk7Ci0gICAgICAgICAgICB0bXAxMSA9IChXb3JkMTYpKChzMiArIDB4MDAwMDQwMDBMKSA+PiAxNSk7Ci0KLSAgICAgICAgICAgIHRtcDIgID0gKChXb3JkMzIpICogKHBfc2lnbjEpICogKihwX3NpZ24yLS0pKSA+PiAxNTsKLSAgICAgICAgICAgIHRtcDIyID0gKChXb3JkMzIpICogKHBfc2lnbjEtLSkgKiAqKHBfc2lnbjIpKSA+PiAxNTsKLQotICAgICAgICAgICAgKnJyMiA9ICgoV29yZDMyKSB0bXAxICogdG1wMikgPj4gMTU7Ci0gICAgICAgICAgICAqKHJyMS0tKSA9ICpycjI7Ci0gICAgICAgICAgICAqcnIxID0gKChXb3JkMzIpIHRtcDExICogdG1wMjIpID4+IDE1Owot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29yZDE2IHNmLCAgICAgLy8gKGkpOiBzY2FsaW5nIGZhY3RvcjogMiBmb3IgMTIuMiwgMSBmb3Igb3RoZXJzCi0gICAgV29yZDE2IG5iX3RyYWNrLC8vIChpKTogdGhlIG51bWJlciBvZiBBQ0IgdHJhY2tzCi0gICAgV29yZDE2IHN0ZXAgICAgLy8gKGkpOiBzdGVwIHNpemUgZnJvbSBvbmUgcHVsc2UgcG9zaXRpb24gdG8gdGhlIG5leHQKLSAgICAgICAgICAgICAgICAgICAgICAgICAgIGluIG9uZSB0cmFjawotKQotewotICAgIFdvcmQxNiBpLCBqLCBrOwotICAgIFdvcmQzMiBzLCB5MzJbTF9DT0RFXSwgbWF4LCB0b3Q7Ci0KLSAgICAvLyBmaXJzdCBrZWVwIHRoZSByZXN1bHQgb24gMzIgYml0cyBhbmQgZmluZCBhYnNvbHV0ZSBtYXhpbXVtCi0KLSAgICB0b3QgPSA1OwotCi0gICAgZm9yIChrID0gMDsgayA8IG5iX3RyYWNrOyBrKyspCi0gICAgewotICAgICAgICBtYXggPSAwOwotICAgICAgICBmb3IgKGkgPSBrOyBpIDwgTF9DT0RFOyBpICs9IHN0ZXApCi0gICAgICAgIHsKLSAgICAgICAgICAgIHMgPSAwOwotICAgICAgICAgICAgZm9yIChqID0gaTsgaiA8IExfQ09ERTsgaisrKQotICAgICAgICAgICAgICAgIHMgPSBMX21hYyAocywgeFtqXSwgaFtqIC0gaV0pOwotCi0gICAgICAgICAgICB5MzJbaV0gPSBzOwotCi0gICAgICAgICAgICBzID0gTF9hYnMgKHMpOwotICAgICAgICAgICAgaWYgKExfc3ViIChzLCBtYXgpID4gKFdvcmQzMikgMEwpCi0gICAgICAgICAgICAgICAgbWF4ID0gczsKLSAgICAgICAgfQotICAgICAgICB0b3QgPSBMX2FkZCAodG90LCBMX3NociAobWF4LCAxKSk7Ci0gICAgfQotCi0gICAgaiA9IHN1YiAobm9ybV9sICh0b3QpLCBzZik7Ci0KLSAgICBmb3IgKGkgPSAwO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XggPSAwOwotICAgICAgICBmb3IgKGkgPSBrOyBpIDwgTF9DT0RFOyBpICs9IFNURVApICAgICAgLyogTF9DT0RFID0gNDA7IFNURVAgPSA1ICovCi0gICAgICAgIHsKLSAgICAgICAgICAgIHMgPSAwOwotICAgICAgICAgICAgcF94ID0gJnhbaV07Ci0gICAgICAgICAgICBwX3B0ciA9IGg7Ci0KLSAgICAgICAgICAgIGZvciAoaiA9IChMX0NPREUgLSBpIC0gMSkgPj4gMTsgaiAhPSAwOyBqLS0pCi0gICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgcyArPSAoKFdvcmQzMikgKiAocF94KyspICogKihwX3B0cisrKSkgPDwgMTsKLSAgICAgICAgICAgICAgICBzICs9ICgoV29yZDMyKSAqIChwX3grKykgKiAqKHBfcHRyKyspKSA8PCAxOwotICAgICAgICAgICAgfQotCi0gICAgICAgICAgICBzICs9ICgoV29yZDMyKSAqIChwX3grKykgKiAqKHBfcHRyKyspKSA8PCAxOwotCi0gICAgICAgICAgICBpZiAoISgoTF9DT0RFIC0gaSkgJiAxKSkgICAgLyogaWYgZXZlbiBudW1iZXIgb2YgaXRlcmF0aW9ucyAqLwotICAgICAgICAgICAgewotICAgICAgICAgICAgICAgIHMgKz0gKChXb3JkMzIpICogKHBfeCsrKSAqICoocF9wdHIrKykpIDw8IDE7Ci0gICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgIHkzMltpXSA9IHM7Ci0KLSAgICAgICAgICAgIGlmIChzIDwgMCkKLSAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICBzID0gLXM7Ci0gICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgIGlmIChzID4gbWF4KQotICAgICAgICAgICAgewotICAgICAgICAgICAgICAgIG1heCA9IHM7Ci0gICAgICAgICAgICB9Ci0gICAgICAgIH0KLQotICAgICAgICB0b3QgKz0gKG1heCA+PiAxKTsKLSAgICB9Ci0KLQotICAgIGogPSBub3JtX2wodG90KSAtIHNmOwotCi0gICAgc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ChvKTogY29ycmVsYXRpb24gYmV0d2VlbiB0YXJnZXQgYW5kIGhbXQotICAgIFdvcmQxNiBzZiwgICAgIC8vIChpKTogc2NhbGluZyBmYWN0b3I6IDIgZm9yIDEyLjIsIDEgZm9yIG90aGVycwotICAgIFdvcmQxNiBuYl90cmFjaywvLyAoaSk6IHRoZSBudW1iZXIgb2YgQUNCIHRyYWNrcwotICAgIFdvcmQxNiBzdGVwICAgIC8vIChpKTogc3RlcCBzaXplIGZyb20gb25lIHB1bHNlIHBvc2l0aW9uIHRvIHRoZSBuZXh0Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICBpbiBvbmUgdHJhY2sKLSkKLXsKLSAgICBXb3JkMTYgaSwgaiwgazsKLSAgICBXb3JkMzIgcywgeTMyW0xfQ09ERV0sIG1heCwgdG90OwotCi0gICAgLy8gZmlyc3Qga2VlcCB0aGUgcmVzdWx0IG9uIDMyIGJpdHMgYW5kIGZpbmQgYWJzb2x1dGUgbWF4aW11bQotCi0gICAgdG90ID0gNTsKLQotICAgIGZvciAoayA9IDA7IGsgPCBuYl90cmFjazsgaysrKQotICAgIHsKLSAgICAgICAgbWF4ID0gMDsKLSAgICAgICAgZm9yIChpID0gazsgaSA8IExfQ09ERTsgaSArPSBzdGVwKQotICAgICAgICB7Ci0gICAgICAgICAgICBzID0gMDsKLSAgICAgICAgICAgIGZvciAoaiA9IGk7IGogPCBMX0NPREU7IGorKykKLSAgICAgICAgICAgICAgICBzID0gTF9tYWMgKHMsIHhbal0sIGhbaiAtIGldKTsKLQotICAgICAgICAgICAgeTMyW2ldID0gczsKLQotICAgICAgICAgICAgcyA9IExfYWJzIChzKTsKLSAgICAgICAgICAgIGlmIChMX3N1YiAocywgbWF4KSA+IChXb3JkMzIpIDBMKQotICAgICAgICAgICAgICAgIG1heCA9IHM7Ci0gICAgICAgIH0KLSAgICAgICAgdG90ID0gTF9hZGQgKHRvdCwgTF9zaHIgKG1heCwgMSkpOwotICAgIH0KLQotICAgIGogPSBzdW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gICAgV29yZDMyIHRvdDsKLQotCi0gICAgLyogZmlyc3Qga2VlcCB0aGUgcmVzdWx0IG9uIDMyIGJpdHMgYW5kIGZpbmQgYWJzb2x1dGUgbWF4aW11bSAqLwotICAgIHRvdCA9IExPRzJfT0ZfMzI7Ci0gICAgZm9yIChrID0gMDsgayA8IG5iX3RyYWNrOyBrKyspCi0gICAgewotICAgICAgICBtYXggPSAwOwotICAgICAgICBmb3IgKGkgPSBrOyBpIDwgTF9DT0RFOyBpICs9IHN0ZXApCi0gICAgICAgIHsKLSAgICAgICAgICAgIHMgPSAwOwotCi0gICAgICAgICAgICBmb3IgKGogPSBpOyBqIDwgTF9DT0RFOyBqKyspCi0gICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgcyA9IGFtcm5iX2Z4cF9tYWNfMTZfYnlfMTZiYigoV29yZDMyKXhbal0sIChXb3JkMzIpaFtqLWldLCBzKTsKLSAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgcyA9IHMgPDwgMTsKLSAgICAgICAgICAgIHkzMltpXSA9IHM7Ci0gICAgICAgICAgICBzID0gTF9hYnMocyk7Ci0KLSAgICAgICAgICAgIGlmIChzID4gbWF4KQotICAgICAgICAgICAgewotICAgICAgICAgICAgICAgIG1heCA9IHM7Ci0gICAgICAgICAgICB9Ci0gICAgICAgIH0KLSAgICAgICAgdG90ID0gKHRvdCArIChtYXggPj4gMSkpOwotICAgIH0KLQotICAgIGogPSBzdWIobm9ybV9sKHRvdCksIHNmLCBwT3ZlcmZsb3cpOwotCi0gICAgZm9yIChpID0gMDsgaSA8IExfQ09ERTsgaSsrKQotICAgIHsKLSAgICAgICAgZG5baV0gPSBwdl9yb3VuZChMX3NobCh5MzJbaV0sIGosIHBPdmVyZmxvdyksIHBPdmVyZmxvdyk7Ci0gICAgfQotCi0gICAgcmV0dXJuOwotfQpkaWZmIC0tZ2l0IGEvbWVkaWEvbGlic3RhZ2VmcmlnaHQvY29kZWNzL2Ftcm5iL2VuYy9zcmMvY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i8KLSAgICAgICAgICAgICBGbGFnICAgKnBPdmVyZmxvdyAgICAgICAgLyogaS9vIDogb3ZlcmZsb3cgaW5kaWNhdG9yICAgICAgICAgICAgKi8KLSAgICAgICAgICAgICkKLXsKLSAgICByZWdpc3RlciBXb3JkMTYgaSwgajsKLSAgICBXb3JkMTYgdGVtcDsKLSAgICBXb3JkMTYgbG9nX2VuOwotICAgIFdvcmQxNiBsc2ZbTV07Ci0gICAgV29yZDE2IGxzcFtNXTsKLSAgICBXb3JkMTYgbHNwX3FbTV07Ci0gICAgV29yZDMyIExfbHNwW01dOwotCi0gICAgLyogVk9YIG1vZGUgY29tcHV0YXRpb24gb2YgU0lEIHBhcmFtZXRlcnMgKi8KLQotICAgIGlmICgoY29tcHV0ZVNpZEZsYWcgIT0gMCkgIHx8Ci0gICAgICAgICAgICAoc3QtPmxvZ19lbl9pbmRleCA9PSAwKSkKLSAgICB7Ci0gICAgICAgIC8qIGNvbXB1dGUgbmV3IFNJRCBmcmFtZSBpZiBzYWZlIGkuZSBkb24ndAotICAgICAgICAgKiBjb21wdXRlIGltbWVkaWF0ZWx5IGFmdGVyIGEgdGFsayBzcHVydCAgKi8KLSAgICAgICAgbG9nX2VuID0gMDsKLSAgICAgICAgZm9yIChpID0gTSAtIDE7IGkgPj0gMDsgaS0tKQotICAgICAgICB7Ci0gICAgICAgICAgICBMX2xzcFtpXSA9IDA7Ci0gICAgICAgIH0KLQotICAgICAgICAvKiBhdmVyYWdlIGVuZXJneSBhbmQgbHNwICovCi0gICAgICAgIGZvciAoaSA9IERUWF9ISVNUX1NJWkUgLSAxOyBpID49IDA7IGktLSkKLSAgICAgICAgewotICAgICAgICAgICAgaWYgKHN0LT5sb2dfZW5faGlzdFtpXSA8IDApCi0gICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgdGVtcCA9IH4oKH4oc3QtPmxvZ19lbl9oaXN0W2ldKSkgPj4gMik7Ci0gICAgICAgICAgICB9Ci0gICAgICAgICAgICBlbHNlCi0gICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgdGVtcCA9IHN0LT5sb2dfZW5faGlzdFtpXSA+PiAyOwotICAgICAgICAgICAgfQotICAgICAgICAgICAgbG9nX2VuID0gYWRkKGxvZ19lbiwgdGVtcCwgcE92ZXJmbG93KTsKLQotICAgICAgICAgICAgZm9yIChqID0gTSAtIDE7IGogPj0gMDsgai0tKQotICAgICAgICAgICAgewotICAgICAgICAgICAgICAgIExfbHNwW2pdID0gTF9hZGQoTF9sc3Bbal0sCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoV29yZDMyKShzdC0+bHNwX2hpc3RbaSAqIE0gKyBqXSksCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwT3ZlcmZsb3cpOwotICAgICAgICAgICAgfQotICAgICAgICB9Ci0KLSAgICAgICAgaWYgKGxvZ19lbiA8IDApCi0gICAgICAgIHsKLSAgICAgICAgICAgIGxvZ19lbiA9IH4oKH5sb2dfZW4pID4+IDEpOwotICAgICAgICB9Ci0gICAgICAgIGVsc2UKLSAgICAgICAgewotICAgICAgICAgICAgbG9nX2VuID0gbG9nX2VuID4+IDE7Ci0gICAgICAgIH0KLQotICAgICAgICBmb3IgKGogPSBNIC0gMTsgaiA+PSAwOyBqLS0pCi0gICAgICAgIHsKLSAgICAgICAgICAgIC8qIGRpdmlkZSBieSA4ICovCi0gICAgICAgICAgICBpZiAoTF9sc3Bbal0gPCAwKQotICAgICAgICAgICAgewotICAgICAgICAgICAgICAgIGxzcFtqXSA9IChXb3JkMTYpKH4oKH5MX2xzcFtqXSkgPj4gMykpOwotICAgICAgICAgICAgfQotICAgICAgICAgICAgZWxzZQotICAgICAgICAgICAgewotICAgICAgICAgICAgICAgIGxzcFtqXSA9IChXb3JkMTYpKExfbHNwW2pdID4+IDMpOwotICAgICAgICAgICAgfQotICAgICAgICB9Ci0KLSAgICAgICAgLyogIHF1YW50aXplIGxvZ2FyaXRobWljIGVuZXJneSB0byA2IGJpdHMgKi8KLSAgICAgICAgLyogKzIuNSBpbiBRMTAgKi8KLSAgICAgICAgc3QtPmxvZ19lbl9pbmRleCA9IGFkZChsb2dfZW4sIDI1NjAsIHBPdmVyZmxvdyk7Ci0gICAgICAgIC8qIGFkZCAwLjUvNCBpbiBRMTAgKi8KLSAgICAgICAgc3QtPmxvZ19lbl9pbmRleCA9IGFkZChzdC0+bG9nX2VuX2luZGV4LCAxMjgsIHBPdmVyZmxvdyk7Ci0gICAgICAgIGlmIChzdC0+bG9nX2VuX2luZGV4IDwgMCkKLSAgICAgICAgewotICAgICAgICAgICAgc3QtPmxvZ19lbl9pbmRleCA9IH4oKH5zdC0+bG9nX2VuX2luZGV4KSA+PiA4KTsKLSAgICAgICAgfQotICAgICAgICBlbHNlCi0gICAgICAgIHsKLSAgICAgICAgICAgIHN0LT5sb2dfZW5faW5kZXggPSBzdC0+bG9nX2VuX2luZGV4ID4+IDg7Ci0gICAgICAgIH0KLQotICAgICAgICAvKi0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSovCi0gICAgICAgIC8qIExpbWl0IHRvIG1heCBhbmQgbWluIGFsbG93YWJsZSA2LWJpdCB2YWx1ZXMgKi8KLSAgICAgICAgLyogTm90ZTogRm9yIGFzc2VtYmx5IGltcGxlbWVudGF0aW9uLCB1c2UgdGhlICAqLwotICAgICAgICAvKiAgICAgICBmb2xsb3dpbmc6ICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0gICAgICAgIC8qICAgICAgIGlmKHN0LT5sb25nX2VuX2luZGV4ID4+IDYgIT0gMCkgICAgICAgKi8KLSAgICAgICAgLyogICAgICAgeyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotICAgICAgICAvKiAgICAgICAgICAgaWYoc3QtPmxvbmdfZW5faW5kZXggPCAwKSAgICAgICAgICovCi0gICAgICAgIC8qICAgICAgICAgICB7ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLSAgICAgICAgLyogICAgICAgICAgICAgICBzdC0+bG9uZ19lbl9pbmRleCA9IDAgICAgICAgICAqLwotICAgICAgICAvKiAgICAgICAgICAgfSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0gICAgICAgIC8qICAgICAgICAgICBlbHNlICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLSAgICAgICAgLyogICAgICAgICAgIHsgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotICAgICAgICAvKiAgICAgICAgICAgICAgIHN0LT5sb25nX2VuX2luZGV4ID0gNjMgICAgICAgICovCi0gICAgICAgIC8qICAgICAgICAgICB9ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLSAgICAgICAgLyogICAgICAgfSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotICAgICAgICAvKi0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSovCi0gICAgICAgIGlmIChzdC0+bG9nX2VuX2luZGV4ID4gNjMpCi0gICAgICAgIHsKLSAgICAgICAgICAgIHN0LT5sb2dfZW5faW5kZXggPSA2MzsKLSAgICAgICAgfQotICAgICAgICBlbHNlIGlmIChzdC0+bG9nX2VuX2luZGV4IDwgMCkKLSAgICAgICAgewotICAgICAgICAgICAgc3QtPmxvZ19lbl9pbmRleCA9IDA7Ci0gICAgICAgIH0KLQotICAgICAgICAvKiB1cGRhdGUgZ2FpbiBwcmVkaWN0b3IgbWVtb3J5ICovCi0gICAgICAgIC8qIFExMSBhbmQgZGl2aWRlIGJ5IDQgKi8KLSAgICAgICAgbG9nX2VuID0gKFdvcmQxNikoKChXb3JkMzIpIHN0LT5sb2dfZW5faW5kZXgpIDw8ICgtMiArIDEwKSk7Ci0KLSAgICAgICAgbG9nX2VuID0gc3ViKGxvZ19lbiwgMTE1NjAsIHBPdmVyZmxvdyk7Ci0KLSAgICAgICAgaWYgKGxv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9IDApCi0gICAgewotICAgICAgICBzdC0+ZHR4SGFuZ292ZXJDb3VudCA9IERUWF9IQU5HX0NPTlNUOwotICAgIH0KLSAgICBlbHNlCi0gICAgeyAgLyogbm9uLXNwZWVjaCAqLwotICAgICAgICBpZiAoc3QtPmR0eEhhbmdvdmVyQ291bnQgPT0gMCkKLSAgICAgICAgeyAgLyogb3V0IG9mIGRlY29kZXIgYW5hbHlzaXMgaGFuZ292ZXIgICovCi0gICAgICAgICAgICBzdC0+ZGVjQW5hRWxhcHNlZENvdW50ID0gMDsKLSAgICAgICAgICAgICp1c2VkTW9kZSA9IE1SRFRYOwotICAgICAgICAgICAgY29tcHV0ZV9uZXdfc2lkX3Bvc3NpYmxlID0gMTsKLSAgICAgICAgfQotICAgICAgICBlbHNlCi0gICAgICAgIHsgLyogaW4gcG9zc2libGUgYW5hbHlzaXMgaGFuZ292ZXIgKi8KLSAgICAgICAgICAgIHN0LT5kdHhIYW5nb3ZlckNvdW50IC09IDE7Ci0KLSAgICAgICAgICAgIC8qIGRlY0FuYUVsYXBzZWRDb3VudCArIGR0eEhhbmdvdmVyQ291bnQgPCAqLwotICAgICAgICAgICAgLyogRFRYX0VMQVBTRURfRlJBTUVTX1RIUkVTSCAgICAgICAgICAgICAgICovCi0gICAgICAgICAgICBjb3VudCA9IGFkZChzdC0+ZGVjQW5hRWxhcHNlZENvdW50LCBzdC0+ZHR4SGFuZ292ZXJDb3VudCwKLSAgICAgICAgICAgICAgICAgICAgICAgIHBPdmVyZmxvdyk7Ci0gICAgICAgICAgICBpZiAoY291bnQgPCBEVFhfRUxBUFNFRF9GUkFNRVNfVEhSRVNIKQotICAgICAgICAgICAgewotICAgICAgICAgICAgICAgICp1c2VkTW9kZSA9IE1SRFRYOwotICAgICAgICAgICAgICAgIC8qIGlmIHNob3J0IHRpbWUgc2luY2UgZGVjb2RlciB1cGRhdGUsICovCi0gICAgICAgICAgICAgICAgLyogZG8gbm90IGFkZCBleHRyYSBITyAgICAgICAgICAgICA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S0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSovCi0gICAgLyoKLSAgICAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgotICAgICogIEZ1bmN0aW9uICAgIDogZHR4X2VuY19pbml0Ci0gICAgKiAgUHVycG9zZSAgICAgOiBBbGxvY2F0ZXMgbWVtb3J5IGFuZCBpbml0aWFsaXplcyBzdGF0ZSB2YXJpYWJsZXMKLSAgICAqICBEZXNjcmlwdGlvbiA6IFN0b3JlcyBwb2ludGVyIHRvIGZpbHRlciBzdGF0dXMgc3RydWN0IGluICpzdC4gVGhpcwotICAgICogICAgICAgICAgICAgICAgcG9pbnRlciBoYXMgdG8gYmUgcGFzc2VkIHRvIGR0eF9lbmMgaW4gZWFjaCBjYWxsLgotICAgICogIFJldHVybnMgICAgIDogMCBvbiBzdWNjZXNzCi0gICAgKgotICAgICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCi0gICAgKi8KLSAgICBXb3JkMTYgZHR4X2VuY19pbml0KGR0eF9lbmNTdGF0ZSAqKnN0KTsKLQotICAgIC8qCi0gICAgKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKLSAgICAqCi0gICAgKiAgRnVuY3Rpb24gICAgOiBkdHhfZW5jX3Jlc2V0Ci0gICAgKiAgUHVycG9zZSAgICAgOiBSZXNldHMgc3RhdGUgbWVtb3J5Ci0gICAgKiAgUmV0dXJucyAgICAgOiAwIG9uIHN1Y2Nlc3MKLSAgICAqCi0gICAgKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKLSAgICAqLwotICAgIFdvcmQxNiBkdHhfZW5jX3Jlc2V0KGR0eF9lbmNTdGF0ZSAqc3QpOwotCi0gICAgLyoKLSAgICAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgotICAgICoKLSAgICAqICBGdW5jdGlvbiAgICA6IGR0eF9lbmNfZXhpdAotICAgICogIFB1cnBvc2UgICAgIDogVGhlIG1lbW9yeSB1c2VkIGZvciBzdGF0ZSBtZW1vcnkgaXMgZnJlZWQKLSAgICAqICBEZXNjcmlwdGlvbiA6IFN0b3JlcyBOVUxMIGluICpzdAotICAgICoKLSAgICAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgotICAgICovCi0gICAgdm9pZCBkdHhfZW5jX2V4aXQoZHR4X2VuY1N0YXRlICoqc3QpOwotCi0gICAgLyoKLSAgICAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgotICAgICoKLSAgICAqICBGdW5jdGlvbiAgICA6IGR0eF9lbmMKLSAgICAqICBQdXJwb3NlICAgICA6Ci0gICAgKiAgRGVzY3JpcHRpb24gOgotICAgICoKLSAgICAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgotICAgICovCi0gICAgdm9pZCBkdHhfZW5jKGR0eF9lbmNTdGF0ZSAqc3QsICAgICAgICAvKiBpL28gOiBTdGF0ZSBzdHJ1Y3QgICAgICAgICAgICAgICAgICAqLwotICAgICAgICAgICAgICAgICBXb3JkMTYgY29tcHV0ZVNpZEZsYWcsICAgLyogaSAgIDogY29tcHV0ZSBTSUQgICAgICAgICAgICAgICAgICAgKi8KLSAgICAgICAgICAgICAgICAgUV9wbHNmU3RhdGUgKnFTdCwgICAgICAgIC8qIGkvbyA6IFF1bmF0aXplciBzdGF0ZSBzdHJ1Y3QgICAgICAgICovCi0gICAgICAgICAgICAgICAgIGdjX3ByZWRTdGF0ZSogcHJlZFN0YXRlLCAvKiBpL28gOiBTdGF0ZSBzdHJ1Y3QgICAgICAgICAgICAgICAgICAqLwotICAgICAgICAgICAgICAgICBXb3JkMTYgKiphbmFwLCAgICAgICAgICAgLyogbyAgIDogYW5hbHlzaXMgcGFyYW1ldGVycyAgICAgICAgICAgKi8KLSAgICAgICAgICAgICAgICAgRmxhZyAgICpwT3ZlcmZsb3cgICAgICAgIC8qIGkvbyA6IG92ZXJmbG93IGluZGljYXRvciAgICAgICAgICAgICovCi0gICAgICAgICAgICAgICAgKTsKLQotICAgIC8qCi0gICAgKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKLSAgICAqCi0gICAgKiAgRnVuY3Rpb24gICAgOiBkdHhfYnVmZmVyCi0gICAgKiAgUHVycG9zZSAgICAgOiBoYW5kbGVzIHRoZSBEVFggYnVmZmVyCi0gICAgKgotICAgICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCi0gICAgKi8KLSAgICB2b2lkIGR0eF9idWZmZXIoZHR4X2VuY1N0YXRlICpzdCwgICAvKiBpL28gOiBTdGF0ZSBzdHJ1Y3QgICAgICAgICAgICAgICAgICAgICovCi0gICAgICAgICAgICAgICAgICAgIFdvcmQxNiBsc3BfbmV3W10sICAgLyogaSAgIDogTFNQIHZlY3RvciAgICAgICAgICAgICAgICAgICAgICAqLwotICAgICAgICAgICAgICAgICAgICBXb3JkMTYgc3BlZWNoW10sICAgIC8qIGkgICA6IHNwZWVjaCBzYW1wbGVzICAgICAgICAgICAgICAgICAgKi8KLSAgICAgICAgICAgICAgICAgICAgRmxhZyAgICpwT3ZlcmZsb3cgICAvKiBpL28gOiBvdmVyZmxvdyBpbmRpY2F0b3IgICAgICAgICAgICAgICovCi0gICAgICAgICAgICAgICAgICAgKTsKLQotICAgIC8qCi0gICAgKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKLSAgICAqCi0gICAgKiAgRnVuY3Rpb24gICAgOiB0eF9kdHhfaGFuZGxlcgotICAgICogIFB1cnBvc2UgICAgIDogYWRkcyBleHRyYSBzcGVlY2ggaGFuZ292ZXIgdG8gYW5hbHl6ZSBzcGVlY2ggb24gdGhlIGRlY29kaW5nIHNpZGUuCi0gICAgKiAgRGVzY3JpcHRpb24gOiByZXR1cm5zIDEgd2hlbiBhIG5ldyBTSUQgYW5hbHlzaXMgbWF5IGJlIG1hZGUKLSAgICAqICAgICAgICAgICAgICAgIG90aGVyd2lzZSBpdCBhZGRzIHRoZSBhcHByb3ByaWF0ZSBoYW5nb3ZlciBhZnRlciBhIHNlcXVlbmNlCi0gICAgKiAgICAgICAgICAgICAgICB3aXRoIG91dCB1cGRhdGVzIG9mIFNJRCBwYXJhbWV0ZXJzIC4KLSAgICAqCi0gICAgKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKLSAgICAqLwotICAgIFdvcmQxNiB0eF9kdHhfaGFuZGxlcihkdHhfZW5jU3RhdGUgKnN0LCAgICAgIC8qIGkvbyA6IFN0YXRlIHN0cnVjdCAgICAgICAgICAgKi8KLSAgICAgICAgICAgICAgICAgICAgICAgICAgV29yZDE2IHZhZF9mbGFnLCAgICAgICAvKiBpICAgOiB2YWQgZGVjaXNpb24gICAgICAgICAgICovCi0gICAgICAgICAgICAgICAgICAgICAgICAgIGVudW0gTW9kZSAqdXNlZE1vZGUsICAgLyogaS9vIDogbW9kZSBjaGFuZ2VkIG9yIG5vdCAgICAqLwotICAgICAgICAgICAgICAgICAgICAgICAgICBGb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ICAgICAgICAqLwotICAgIFdvcmQxNiBUMF9tYXgsICAgICAgIC8qIGkgIDogbWF4aW11bSBvZiBzZWFyY2ggcmFuZ2UgICAgICAgICAgICAgICovCi0gICAgV29yZDE2IGRlbHRhX2ZsYWcsICAgLyogaSAgOiBGbGFnIGZvciAxc3QgKG9yIDNyZCkgc3ViZnJhbWUgICAgICAgKi8KLSAgICBXb3JkMTYgZmxhZzQsICAgICAgICAvKiBpICA6IEZsYWcgZm9yIGVuY29kaW5nIHdpdGggNCBiaXRzICAgICAgICAqLwotICAgIEZsYWcgICAqcE92ZXJmbG93Ci0pCi17Ci0gICAgV29yZDE2IGluZGV4LCBpLCB0bXBfaW5kLCB1cGxhZzsKLSAgICBXb3JkMTYgdG1wX2xhZzsKLSAgICBXb3JkMTYgdGVtcDE7Ci0gICAgV29yZDE2IHRlbXAyOwotCi0KLQotICAgIGlmIChkZWx0YV9mbGFnID09IDApCi0gICAgeyAgLyogaWYgMXN0IG9yIDNyZCBzdWJmcmFtZSAqLwotCi0gICAgICAgIC8qIGVuY29kZSBwaXRjaCBkZWxheSAod2l0aCBmcmFjdGlvbikgKi8KLSAgICAgICAgdGVtcDEgPSBzdWIoVDAsIDg1LCBwT3ZlcmZsb3cpOwotICAgICAgICBpZiAodGVtcDEgPD0gMCkKLSAgICAgICAgewotICAgICAgICAgICAgLyogaW5kZXggPSBUMCozIC0gNTggKyBUMF9mcmFjICAgKi8KLSAgICAgICAgICAgIHRlbXAyID0gYWRkKFQwLCBUMCwgcE92ZXJmbG93KTsKLSAgICAgICAgICAgIGkgPSBhZGQodGVtcDIsIFQwLCBwT3ZlcmZsb3cpOwotICAgICAgICAgICAgdGVtcDIgPSBzdWIoaSwgNTgsIHBPdmVyZmxvdyk7Ci0gICAgICAgICAgICBpbmRleCA9IGFkZCh0ZW1wMiwgVDBfZnJhYywgcE92ZXJmbG93KTsKLSAgICAgICAgfQotICAgICAgICBlbHNlCi0gICAgICAgIHsKLSAgICAgICAgICAgIGluZGV4ID0gYWRkKFQwLCAxMTIsIHBPdmVyZmxvdyk7Ci0gICAgICAgIH0KLSAgICB9Ci0gICAgZWxzZQotICAgIHsgICAvKiBpZiBzZWNvbmQgb3IgZm91cnRoIHN1YmZyYW1lICovCi0gICAgICAgIGlmIChmbGFnNCA9PSAwKQotICAgICAgICB7Ci0KLSAgICAgICAgICAgIC8qICdub3JtYWwnIGVuY29kaW5nOiBlaXRoZXIgd2l0aCA1IG9yIDYgYml0IHJlc29sdXRpb24gKi8KLQotICAgICAgICAgICAgLyogaW5kZXggPSAzKihUMCAtIFQwX21pbikgKyAyICsgVDBfZnJhYyAqLwotICAgICAgICAgICAgaSA9IHN1YihUMCwgVDBfbWluLCBwT3ZlcmZsb3cpOwotICAgICAgICAgICAgdGVtcDIgPSBhZGQoaSwgaSwgcE92ZXJmbG93KTsKLSAgICAgICAgICAgIGkgPSBhZGQodGVtcDIsIGksIHBPdmVyZmxvdyk7Ci0gICAgICAgICAgICB0ZW1wMiA9IGFkZChpLCAyLCBwT3ZlcmZsb3cpOwotICAgICAgICAgICAgaW5kZXggPSBhZGQodGVtcDIsIFQwX2ZyYWMsIHBPdmVyZmxvdyk7Ci0gICAgICAgIH0KLSAgICAgICAgZWxzZQotICAgICAgICB7Ci0KLSAgICAgICAgICAgIC8qIGVuY29kaW5nIHdpdGggNCBiaXQgcmVzb2x1dGlvbiAqLwotCi0gICAgICAgICAgICB0bXBfbGFnID0gVDBfcHJldjsKLSAgICAgICAgICAgIHRlbXAxID0gc3ViKHRtcF9sYWcsIFQwX21pbiwgcE92ZXJmbG93KTsKLSAgICAgICAgICAgIHRlbXAyID0gc3ViKHRlbXAxLCA1LCBwT3ZlcmZsb3cpOwotICAgICAgICAgICAgaWYgKHRlbXAyID4gMCkKLSAgICAgICAgICAgICAgICB0bXBfbGFnID0gYWRkKFQwX21pbiwgNSwgcE92ZXJmbG93KTsKLSAgICAgICAgICAgIHRlbXAxID0gc3ViKFQwX21heCwgdG1wX2xhZywgcE92ZXJmbG93KTsKLSAgICAgICAgICAgIHRlbXAyID0gc3ViKHRlbXAxLCA0LCBwT3ZlcmZsb3cpOwotICAgICAgICAgICAgaWYgKHRlbXAyID4gMCkKLSAgICAgICAgICAgICAgICB0bXBfbGFnID0gc3ViKFQwX21heCwgNCwgcE92ZXJmbG93KTsKLQotICAgICAgICAgICAgdGVtcDEgPSBhZGQoVDAsIFQwLCBwT3ZlcmZsb3cpOwotICAgICAgICAgICAgdGVtcDIgPSBhZGQodGVtcDEsIFQwLCBwT3ZlcmZsb3cpOwotICAgICAgICAgICAgdXBsYWcgPSBhZGQodGVtcDIsIFQwX2ZyYWMsIHBPdmVyZmxvdyk7Ci0KLSAgICAgICAgICAgIGkgPSBzdWIodG1wX2xhZywgMiwgcE92ZXJmbG93KTsKLSAgICAgICAgICAgIHRlbXAxID0gYWRkKGksIGksIHBPdmVyZmxvdyk7Ci0gICAgICAgICAgICB0bXBfaW5kID0gYWRkKHRlbXAxLCBpLCBwT3ZlcmZsb3cpOwotCi0gICAgICAgICAgICB0ZW1wMSA9IHN1Yih0bXBfaW5kLCB1cGxhZywgcE92ZXJmbG93KTsKLSAgICAgICAgICAgIGlmICh0ZW1wMSA+PSAwKQotICAgICAgICAgICAgewotICAgICAgICAgICAgICAgIHRlbXAxID0gc3ViKFQwLCB0bXBfbGFnLCBwT3ZlcmZsb3cpOwotICAgICAgICAgICAgICAgIGluZGV4ID0gYWRkKHRlbXAxLCA1LCBwT3ZlcmZsb3cpOwotICAgICAgICAgICAgfQotICAgICAgICAgICAgZWxzZQotICAgICAgICAgICAgewotCi0gICAgICAgICAgICAgICAgaSA9IGFkZCh0bXBfbGFnLCAxLCBwT3ZlcmZsb3cpOwotICAgICAgICAgICAgICAgIHRlbXAxID0gYWRkKGksIGksIHBPdmVyZmxvdyk7Ci0gICAgICAgICAgICAgICAgaSA9IGFkZCh0ZW1wMSwgaSwgcE92ZXJmbG93KTsKLQotICAgICAgICAgICAgICAgIGlmIChzdWIoaSwgdXBsYW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AgICAgICAgICAgICAgIC8qIG8gIDogUmV0dXJuIGluZGV4IG9mIGVuY29kaW5nICAgICAqLwotICAgICAgICBXb3JkMTYgVDAsICAgICAgICAgICAvKiBpICA6IFBpdGNoIGRlbGF5ICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotICAgICAgICBXb3JkMTYgVDBfZnJhYywgICAgICAvKiBpICA6IEZyYWN0aW9uYWwgcGl0Y2ggZGVsYXkgICAgICAgICAgICAgICAqLwotICAgICAgICBXb3JkMTYgVDBfcHJldiwgICAgICAvKiBpICA6IEludGVnZXIgcGl0Y2ggZGVsYXkgb2YgbGFzdCBzdWJmcmFtZSAqLwotICAgICAgICBXb3JkMTYgVDBfbWluLCAgICAgICAvKiBpICA6IG1pbmltdW0gb2Ygc2VhcmNoIHJhbmdlICAgICAgICAgICAgICAqLwotICAgICAgICBXb3JkMTYgVDBfbWF4LCAgICAgICAvKiBpICA6IG1heGltdW0gb2Ygc2VhcmNoIHJhbmdlICAgICAgICAgICAgICAqLwotICAgICAgICBXb3JkMTYgZGVsdGFfZmxhZywgICAvKiBpICA6IEZsYWcgZm9yIDFzdCAob3IgM3JkKSBzdWJmcmFtZSAgICAgICAqLwotICAgICAgICBXb3JkMTYgZmxhZzQsICAgICAgICAvKiBpICA6IEZsYWcgZm9yIGVuY29kaW5nIHdpdGggNCBiaXRzICAgICAgICAqLwotICAgICAgICBGbGFnICAgKnBPdmVyZmxvdwotICAgICk7Ci0KLQotCi0KLSNpZmRlZiBfX2NwbHVzcGx1cwotfQotI2VuZGlmCi0KLSNlbmRpZiAgLyogX0VOQ19MQUczX0hfICovCi0KLQpkaWZmIC0tZ2l0IGEvbWVkaWEvbGlic3RhZ2VmcmlnaHQvY29kZWNzL2Ftcm5iL2VuYy9zcmMvZW5jX2xhZzYuY3BwIGIvbWVkaWEvbGlic3RhZ2VmcmlnaHQvY29kZWNzL2Ftcm5iL2VuYy9zcmMvZW5jX2xhZzYuY3BwCmRlbGV0ZWQgZmlsZSBtb2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ICAgICAzMiwgLyogMTIuMiAqLwotICAgICAgICA2LCAgLyogR3NtQW1yIGNvbWZvcnQgbm9pc2UgKi8KLSAgICAgICAgNywgIC8qIEdzbS1FZnIgY29tZm9ydCBub2lzZSAqLwotICAgICAgICA2LCAgLyogSVMtNjQxIGNvbWZvcnQgbm9pc2UgKi8KLSAgICAgICAgNiwgIC8qIFBkYy1FZnIgY29tZm9ydCBub2lzZSAqLwotICAgICAgICAwLCAgLyogZnV0dXJlIHVzZSAqLwotICAgICAgICAwLCAgLyogZnV0dXJlIHVzZSAqLwotICAgICAgICAwLCAgLyogZnV0dXJlIHVzZSAqLwotICAgICAgICAxICAgLyogTm8gdHJhbnNtaXNzaW9uICovCi0gICAgfTsKLQotCi0gICAgLyogTnVtYmVyIG9mIGRhdGEgYnl0ZXMgaW4gYW4gZW5jb2RlciBmcmFtZSBmb3IgZWFjaCBjb2RlYyBtb2RlICovCi0gICAgLyogZm9yIElGMiBvdXRwdXQgZm9ybWF0ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0gICAgY29uc3QgV29yZDE2IElmMkVuY0J5dGVzUGVyRnJhbWVbMTZdID0KLSAgICB7Ci0gICAgICAgIDEzLCAvKiA0Ljc1ICovCi0gICAgICAgIDE0LCAvKiA1LjE1ICovCi0gICAgICAgIDE2LCAvKiA1LjkwICovCi0gICAgICAgIDE4LCAvKiA2LjcwICovCi0gICAgICAgIDE5LCAvKiA3LjQwICovCi0gICAgICAgIDIxLCAvKiA3Ljk1ICovCi0gICAgICAgIDI2LCAvKiAxMC4yICovCi0gICAgICAgIDMxLCAvKiAxMi4yICovCi0gICAgICAgIDYsIC8qIEdzbUFtciBjb21mb3J0IG5vaXNlICovCi0gICAgICAgIDYsIC8qIEdzbS1FZnIgY29tZm9ydCBub2lzZSAqLwotICAgICAgICA2LCAvKiBJUy02NDEgY29tZm9ydCBub2lzZSAqLwotICAgICAgICA2LCAvKiBQZGMtRWZyIGNvbWZvcnQgbm9pc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Ki8KLQotdm9pZCBldHNfdG9faWYyKAotICAgIGVudW0gRnJhbWVfVHlwZV8zR1BQIGZyYW1lX3R5cGVfM2dwcCwKLSAgICBXb3JkMTYgKmV0c19pbnB1dF9wdHIsCi0gICAgVVdvcmQ4ICppZjJfb3V0cHV0X3B0cikKLXsKLSAgICBXb3JkMTYgIGk7Ci0gICAgV29yZDE2ICBrOwotICAgIFdvcmQxNiAgaiA9IDA7Ci0gICAgV29yZDE2ICpwdHJfdGVtcDsKLSAgICBXb3JkMTYgIGJpdHNfbGVmdDsKLSAgICBVV29yZDggIGFjY3VtOwotCi0gICAgaWYgKGZyYW1lX3R5cGVfM2dwcCA8IEFNUl9TSUQpCi0gICAgewotICAgICAgICBpZjJfb3V0cHV0X3B0cltqKytdID0gKFVXb3JkOCkoZnJhbWVfdHlwZV8zZ3BwKSB8Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoZXRzX2lucHV0X3B0cltyZW9yZGVyQml0c1tmcmFtZV90eXBlXzNncHBdWzBdXSA8PCA0KSB8Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoZXRzX2lucHV0X3B0cltyZW9yZGVyQml0c1tmcmFtZV90eXBlXzNncHBdWzFdXSA8PCA1KSB8Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoZXRzX2lucHV0X3B0cltyZW9yZGVyQml0c1tmcmFtZV90eXBlXzNncHBdWzJdXSA8PCA2KSB8Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoZXRzX2lucHV0X3B0cltyZW9yZGVyQml0c1tmcmFtZV90eXBlXzNncHBdWzNdXSA8PCA3KTsKLQotICAgICAgICBmb3IgKGkgPSA0OyBpIDwgbnVtT2ZCaXRzW2ZyYW1lX3R5cGVfM2dwcF0gLSA3OykKLSAgICAgICAgewotICAgICAgICAgICAgaWYyX291dHB1dF9wdHJbal0gID0KLSAgICAgICAgICAgICAgICAoVVdvcmQ4KSBldHNfaW5wdXRfcHRyW3Jlb3Jk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ICAgICAgIH0KLQotICAgICAgICBiaXRzX2xlZnQgPSA0ICsgbnVtT2ZCaXRzW2ZyYW1lX3R5cGVfM2dwcF0gLQotICAgICAgICAgICAgICAgICAgICAoKDQgKyBudW1PZkJpdHNbZnJhbWVfdHlwZV8zZ3BwXSkgJiAweEZGRjgpOwotCi0gICAgICAgIGlmIChiaXRzX2xlZnQgIT0gMCkKLSAgICAgICAgewotICAgICAgICAgICAgaWYyX291dHB1dF9wdHJbal0gPSAwOwotCi0gICAgICAgICAgICBmb3IgKGsgPSAwOyBrIDwgYml0c19sZWZ0OyBrKyspCi0gICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgaWYyX291dHB1dF9wdHJbal0gfD0KLSAgICAgICAgICAgICAgICAgICAgKFVXb3JkOCkgZXRzX2lucHV0X3B0cltyZW9yZGVyQml0c1tmcmFtZV90eXBlXzNncHBdW2krK11dIDw8IGs7Ci0gICAgICAgICAgICB9Ci0gICAgICAgIH0KLSAgICB9Ci0gICAgZWxzZQotICAgIHsKLSAgICAgICAgaWYgKGZyYW1lX3R5cGVfM2dwcCAhPSBBTVJfTk9fREFUQSkKLSAgICAgICAgewotICAgICAgICAgICAgLyogRmlyc3Qgb2N0ZXQgY29udGFpbnMgM0dQUCBmcmFtZSB0eXBlIGFuZCAqLwotICAgICAgICAgICAgLyogZmlyc3QgNCBiaXRzIG9mIGVuY29kZWQgcGFyYW1ldGVycyAgICAgICAqLwotICAgICAgICAgICAgaWYyX291dHB1dF9wdHJbaisrXSA9IChVV29yZDgpKGZyYW1lX3R5cGVfM2dwcCkgfAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChldHNfaW5wdXRfcHRyWzBdIDw8IDQpIHwgKGV0c19pbnB1dF9wdHJbMV0gPDwgNSkgfAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChldHNfaW5wdXRfcHRyWzJdIDw8IDYpIHwgKGV0c19pbnB1dF9wdHJbM10gPDwgNyk7Ci0gICAgICAgICA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AgfQotICAgIGVsc2UKLSAgICB7Ci0gICAgICAgIHdtZl9vdXRwdXRfcHRyW2orK10gPSAoVVdvcmQ4KShmcmFtZV90eXBlXzNncHApICYgMHgwZjsKLQotICAgICAgICBwdHJfdGVtcCA9ICZldHNfaW5wdXRfcHRyWzBdOwotCi0gICAgICAgIGZvciAoaSA9IG51bU9mQml0c1tmcmFtZV90eXBlXzNncHBdIC0gNzsgaSA+IDA7IGkgLT0gOCkKLSAgICAgICAgewotICAgICAgICAgICAgYWNjdW0gID0gKFVXb3JkOCkgKiAocHRyX3RlbXArKykgPDwgNzsKLSAgICAgICAgICAgIGFjY3VtIHw9IChVV29yZDgpICogKHB0cl90ZW1wKyspIDw8IDY7Ci0gICAgICAgICAgICBhY2N1bSB8PSAoVVdvcmQ4KSAqIChwdHJfdGVtcCsrKSA8PCA1OwotICAgICAgICAgICAgYWNjdW0gfD0gKFVXb3JkOCkgKiAocHRyX3RlbXArKykgPDwgNDsKLSAgICAgICAgICAgIGFjY3VtIHw9IChVV29yZDgpICogKHB0cl90ZW1wKyspIDw8IDM7Ci0gICAgICAgICAgICBhY2N1bSB8PSAoVVdvcmQ4KSAqIChwdHJfdGVtcCsrKSA8PCAyOwotICAgICAgICAgICAgYWNjdW0gfD0gKFVXb3JkOCkgKiAocHRyX3RlbXArKykgPDwgMTsKLSAgICAgICAgICAgIGFjY3VtIHw9IChVV29yZDgpICogKHB0cl90ZW1wKyspOwotCi0gICAgICAgICAgICB3bWZfb3V0cHV0X3B0cltqKytdID0gYWNjdW07Ci0gICAgICAgIH0KLQotICAgICAgICBiaXRzX2xlZnQgPSBudW1PZkJpdHNbZnJhbWVfdHlwZV8zZ3BwXSAtCi0gICAgICAgICAgICAgICAgICAgIChudW1PZkJpdHNbZnJhbWVfdHlwZV8zZ3BwXSAmIDB4RkZGOCk7Ci0KLSAgICAgICAgd21mX291dHB1dF9wdHJbal0gPSAwOwotCi0gICAgICAgIGZvciAoaSA9IDA7IGkgPCBiaXRzX2xlZ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ICAvKiBpICA6IHN0YXRlIHN0cnVjdCAgICAgICAgICAgICAgICAgICovCi0gICAgV29yZDE2IGx0cGcsICAgICAgICAgLyogaSAgOiBsdHAgY29kaW5nIGdhaW4gKGxvZzIoKSksIFExMyAqLwotICAgIFdvcmQxNiBnYWluX2NvZCwgICAgIC8qIGkgIDogY29kZSBnYWluLCAgICAgICAgICAgICAgICBRMSAgKi8KLSAgICBXb3JkMTYgKmFscGhhLCAgICAgICAvKiBvICA6IGdhaW4gYWRhcHRhdGlvbiBmYWN0b3IsICAgUTE1ICovCi0gICAgRmxhZyAgICpwT3ZlcmZsb3cKLSkKLXsKLSAgICBXb3JkMTYgYWRhcHQ7ICAgICAgLyogYWRhcHRkYXRpb24gc3RhdHVzOyAwLCAxLCBvciAyICAgICAgICovCi0gICAgV29yZDE2IHJlc3VsdDsgICAgIC8qIGFscGhhIGZhY3RvciwgUTEzICAgICAgICAgICAgICAgICAgICAqLwotICAgIFdvcmQxNiBmaWx0OyAgICAgICAvKiBtZWRpYW4tZmlsdGVyZWQgTFRQIGNvZGluZyBnYWluLCBRMTMgKi8KLSAgICBXb3JkMTYgdG1wOwotICAgIFdvcmQxNiBpOwotCi0gICAgLyogYmFzaWMgYWRhcHRhdGlvbiAqLwotICAgIGlmIChsdHBnIDw9IExUUF9HQUlOX1RIUjEpCi0gICAgewotICAgICAgICBhZGFwdCA9IDA7Ci0gICAgfQotICAgIGVsc2UKLSAgICB7Ci0gICAgICAgIGlmIChsdHBnIDw9IExUUF9HQUlOX1RIUjIpCi0gICAgICAgIHsKLSAgICAgICAgICAgIGFkYXB0ID0gMTsKLSAgICAgICAgfQotICAgICAgICBlbHNlCi0gICAgICAgIHsKLSAgICAgICAgICAgIGFkYXB0ID0gMjsKLSAgICAgICAgfQotICAgIH0KLQotICAgIC8qCi0gICAgICogLy8gb25zZXQgaW5kaWNhdG9yCi0gICAgICogaWYgKChjYkdhaW4gPiBvbkZhY3QgKiBjYkdhaW5NZW1bMF0pICYmIChjYk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ci0gICAgICAgICAgICByZXN1bHQgPSAwOwotICAgICAgICB9Ci0gICAgICAgIGVsc2UKLSAgICAgICAgewotICAgICAgICAgICAgaWYgKGZpbHQgPCAwKQotICAgICAgICAgICAgewotICAgICAgICAgICAgICAgIHJlc3VsdCA9IDE2Mzg0OyAgLyogMTYzODQgUTE1ID0gMC41ICovCi0gICAgICAgICAgICB9Ci0gICAgICAgICAgICBlbHNlCi0gICAgICAgICAgICB7ICAgLyogcmVzdWx0ICAgICAgID0gICAwLjUgLSAwLjc1MjU3NDk5KmZpbHQgICAgICovCi0gICAgICAgICAgICAgICAgLyogcmVzdWx0IChRMTUpID0gMTYzODQgLSAyNDY2MCAqIChmaWx0IDw8IDIpICovCi0gICAgICAgICAgICAgICAgZmlsdCA9IHNobChmaWx0LCAyLCBwT3ZlcmZsb3cpOyAgLyogUTE1ICovCi0gICAgICAgICAgICAgICAgcmVzdWx0ID0gbXVsdCgyNDY2MCwgZmlsdCwgcE92ZXJmbG93KTsKLSAgICAgICAgICAgICAgICByZXN1bHQgPSBzdWIoMTYzODQsIHJlc3VsdCwgcE92ZXJmbG93KTsKLSAgICAgICAgICAgIH0KLSAgICAgICAgfQotICAgIH0KLSAgICBlbHNlCi0gICAgewotICAgICAgICByZXN1bHQgPSAwOwotICAgIH0KLSAgICAvKgotICAgICAqICBpZiAocHJldkFscGhhID09IDAuMCkgcmVzdWx0ID0gMC41ICogKHJlc3VsdCArIHByZXZBbHBoYSk7Ci0gICAgICovCi0gICAgaWYgKHN0LT5wcmV2X2FscGhhID09IDApCi0gICAgewotICAgICAgICByZXN1bHQgPSBzaHIocmVzdWx0LCAxLCBwT3ZlcmZsb3cpOwotICAgIH0KLQotICAgIC8qIHN0b3JlIHRoZSByZXN1bHQgKi8KLSAgICAqYWxwaGEgPSByZXN1bHQ7Ci0KLSAgICAvKiB1cGRhdGUgYWRhcHRlciBzdGF0ZSBtZW1vcnkgKi8KLSAgICBzdC0+cHJldl9hbHBoYSA9IHJlc3VsdD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mV0dXJucyAwIG9uIHN1Y2Nlc3MKLSAgICAgKi8KLQotICAgIFdvcmQxNiBnYWluX2FkYXB0X3Jlc2V0KEdhaW5BZGFwdFN0YXRlICpzdCk7Ci0gICAgLyogcmVzZXQgb2YgZ2FpbiBhZGFwdG9yIHN0YXRlIChpLmUuIHNldCBzdGF0ZSBtZW1vcnkgdG8gemVybykKLSAgICAgICByZXR1cm5zIDAgb24gc3VjY2VzcwotICAgICAqLwotCi0gICAgdm9pZCBnYWluX2FkYXB0X2V4aXQoR2FpbkFkYXB0U3RhdGUgKipzdCk7Ci0gICAgLyogZGUtaW5pdGlhbGl6ZSBnYWluIGFkYXB0b3Igc3RhdGUgKGkuZS4gZnJlZSBzdGF0ZSBzdHJ1Y3QpCi0gICAgICAgc3RvcmVzIE5VTEwgaW4gKnN0Ci0gICAgICovCi0KLSAgICAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgotICAgICAqCi0gICAgICogIEZ1bmN0aW9uOiAgIGdhaW5fYWRhcHQoKQotICAgICAqICBQdXJwb3NlOiAgICBjYWxjdWxhdGUgcGl0Y2gvY29kZWJvb2sgZ2FpbiBhZGFwdGF0aW9uIGZhY3RvciBhbHBoYQotICAgICAqICAgICAgICAgICAgICAoYW5kIHVwZGF0ZSB0aGUgYWRhcHRvciBzdGF0ZSkKLSAgICAgKgotICAgICAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgotICAgICAqLwotICAgIHZvaWQgZ2Fpbl9hZGFwdCgKLSAgICAgICAgR2FpbkFkYXB0U3RhdGUgKnN0LCAgLyogaSAgOiBzdGF0ZSBzdHJ1Y3QgICAgICAgICAgICAgICAgICAqLwotICAgICAgICBXb3JkMTYgbHRwZywgICAgICAgICAvKiBpICA6IGx0cCBjb2RpbmcgZ2FpbiAobG9nMigpKSwgUSAgICov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0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tCi0qLwotCi1Xb3JkMTYgR19waXRjaCggICAgICAgICAvKiBvIDogR2FpbiBvZiBwaXRjaCBsYWcgc2F0dXJhdGVkIHRvIDEuMiAgICAgICAqLwotICAgIGVudW0gTW9kZSBtb2RlLCAgICAgLyogaSA6IEFNUiBtb2RlICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLSAgICBXb3JkMTYgeG5bXSwgICAgICAgIC8qIGkgOiBQaXRjaCB0YXJnZXQuICAgICAgICAgICAgICAgICAgICAgICAgICAgIFEwICAqLwotICAgIFdvcmQxNiB5MVtdLCAgICAgICAgLyogaSA6IEZpbHRlcmVkIGFkYXB0aXZlIGNvZGVib29rLiAgICAgICAgICAgICAgUTEyICovCi0gICAgV29yZDE2IGdfY29lZmZbXSwgICAvKiBpIDogQ29ycmVsYXRpb25zIG5lZWQgZm9yIGdhaW4gcXVhbnRpemF0aW9uICAqLwotICAgIFdvcmQxNiBMX3N1YmZyLCAgICAgLyogaSA6IExlbmd0aCBvZiBzdWJmcmFtZS4gICAgICAgICAgICAgICAgICAgICAgKi8KLSAgICBGbGFnICAgKnBPdmVyZmxvdyAgIC8qIGkvbyA6IE92ZXJmbG93IGZsYWcgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0pCi17Ci0KLSAgICBXb3JkMTYgaTsKLSAgICBXb3JkMTYgeHk7Ci0gICAgV29yZDE2IHl5OwotICAgIFdvcmQxNiBleHBfeHk7Ci0gICAgV29yZDE2IGV4cF95eTsKLSAgICBXb3JkMTYgZ2FpbjsKLSAgICBXb3JkMTYgdG1wOwotICAgIFdvcmQzMiBzOwotICAgIFdvcmQzMiBzMTsKLSAgICBXb3JkMzIgTF90ZW1wOyAgICAgICAgICAgICAgICAgICAgICAvKiBVc2UgdGhpcyBhcyBhbiBpbnRlcm1lZGlhdGUgdmFsdWUgKi8KLSAgICBXb3JkMTYgKnBfeG4gPSAmeG5bMF07Ci0gICAgV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3cpOwotICAgIH0KLSAgICBlbHNlCi0gICAgewotICAgICAgICBzID0gMDsgICAgICAgICAgICAgICAgICAgICAgLyogQXZvaWQgY2FzZSBvZiBhbGwgemVyb3MgKi8KLSAgICAgICAgcF95MSA9ICZ5MVswXTsKLSAgICAgICAgZm9yIChpID0gKExfc3ViZnIgPj4gMSk7IGkgIT0gMDsgaS0tKQotICAgICAgICB7Ci0gICAgICAgICAgICB0bXAgPSAqKHBfeTErKykgPj4gMjsKLSAgICAgICAgICAgIHMgPSBhbXJuYl9meHBfbWFjXzE2X2J5XzE2YmIoKFdvcmQzMikgdG1wLCAoV29yZDMyKSB0bXAsIHMpOwotICAgICAgICAgICAgdG1wID0gKihwX3kxKyspID4+IDI7Ci0gICAgICAgICAgICBzID0gYW1ybmJfZnhwX21hY18xNl9ieV8xNmJiKChXb3JkMzIpIHRtcCwgKFdvcmQzMikgdG1wLCBzKTsKLSAgICAgICAgfQotCi0gICAgICAgIHMgPDw9IDE7Ci0gICAgICAgIHMgICs9IDE7ICAgICAgICAgICAgLyogQXZvaWQgY2FzZSBvZiBhbGwgemVyb3MgKi8KLQotICAgICAgICBleHBfeXkgPSBub3JtX2wocyk7Ci0gICAgICAgIExfdGVtcCA9IHMgPDwgZXhwX3l5OwotICAgICAgICB5eSA9IHB2X3JvdW5kKExfdGVtcCwgcE92ZXJmbG93KTsKLSAgICAgICAgZXhwX3l5ID0gZXhwX3l5IC0gNDsKLQotICAgIH0KLQotICAgIC8qIENvbXB1dGUgc2NhbGFyIHByb2R1Y3QgPHhuW10seTFbXT4gKi8KLQotICAgIHMgPSAwOwotICAgIHBfeTEgPSAmeTFbMF07Ci0gICAgKnBPdmVyZmxvdyA9IDA7Ci0KLSAgICBmb3IgKGkgPSBMX3N1YmZyOyBpICE9IDA7IGktLSkKLSAgICB7Ci0gICAgICAgIExfdGVtcCA9ICgoV29yZDMyKSAqIChwX3huKyspICogKihwX3kxKyspKTsKLSAgICAgICAgczEgPSBzOwotICAgICAgICBzID0gczEgKyBMX3RlbXA7Ci0KLSAgICAgICAgaWYgKChzMSBeIExfdGVtcCkgPiAwKQotICAgICAgICB7Ci0gICAgICAgICAgICBpZiAoKHMxIF4gcykgPCAwKQotICAgICAgICAgICAgewotICAgICAgICAgICAgICAgICpwT3ZlcmZsb3cgPSAxOwotICAgICAgICAgICAgICAgIGJyZWFrOwotICAgICAgICAgICAgfQotICAgICAgICB9Ci0gICAgfQotCi0gICAgaWYgKCEoKnBPdmVyZmxvdykpCi0gICAgewotCi0gICAgICAgIHMgPDw9IDE7Ci0gICAgICAgIHMgICs9IDE7ICAgICAgICAgICAgLyogQXZvaWQgY2FzZSBvZiBhbGwgemVyb3MgKi8KLQotICAgICAgICBleHBfeHkgPSBub3JtX2wocyk7ICAgICAgICAgICAgIC8qIE5vdGUgMDw9ZXhwX3l5IDw9IDMxICovCi0gICAgICAgIExfdGVtcCA9IHMgPDwgZXhwX3h5OwotICAgICAgICB4eSA9IHB2X3JvdW5kKExfdGVtcCwgcE92ZXJmbG93KTsKLSAgICB9Ci0gICAgZWxzZQotICAgIHsKLSAgICAgICAgcyA9IDA7ICAgICAgICAgICAgICAgICAgICAgIC8qIEF2b2lkIGNhc2Ugb2YgYWxsIHplcm9zICovCi0gICAgICAgIHBfeTEgPSAmeTFbMF07Ci0gICAgICAgIGZvciAoaSA9IChMX3N1YmZyID4+IDIpOyBpICE9IDA7IGktLSkKLSAgICAgICAgewotICAgICAgICAgICAgTF90ZW1wID0gKFdvcmQzMikoKihwX3kxKyspID4+IDIpOwotICAgICAgICAgICAgcyA9IGFtcm5iX2Z4cF9tYWNfMTZfYnlfMTZiYigoV29yZDMyKSAqIChwX3huKyspLCBMX3RlbXAsIHMpOwotICAgICAgICAgICAgTF90ZW1wID0gKFdvcmQzMikoKihwX3kxKyspID4+IDIpOwotICAgICAgICAgICAgcyA9IGFtcm5iX2Z4cF9tYWNfMTZfYnlfMTZiYigoV29yZDMyKSAqIChwX3huKyspLCBMX3RlbXAsIHMpOwot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CksICBRMTMgICovCi0gICAgLyogICAgICAgKHVuc2hhcnBlbmVkIGZvciBNUjQ3NSkgICAgICAgICAgICovCi0gICAgV29yZDE2IHhuW10sICAgICAgICAgIC8qIGkgICA6IFRhcmdldCB2ZWN0b3IuICAgICAgICAgICAgICAgICAgICAqLwotICAgIFdvcmQxNiB4bjJbXSwgICAgICAgICAvKiBpICAgOiBUYXJnZXQgdmVjdG9yLiAgICAgICAgICAgICAgICAgICAgKi8KLSAgICBXb3JkMTYgeTFbXSwgICAgICAgICAgLyogaSAgIDogQWRhcHRpdmUgY29kZWJvb2suICAgICAgICAgICAgICAgICovCi0gICAgV29yZDE2IFkyW10sICAgICAgICAgIC8qIGkgICA6IEZpbHRlcmVkIGlubm92YXRpdmUgdmVjdG9yLiAgICAgICAqLwotICAgIFdvcmQxNiBnX2NvZWZmW10sICAgICAvKiBpICAgOiBDb3JyZWxhdGlvbnMgPHhuIHkxPiA8eTEgeTE+ICAgICAgKi8KLSAgICAvKiAgICAgICBDb21wdXRlIGluIEdfcGl0Y2goKS4gICAgICAgICAgICAgKi8KLSAgICBXb3JkMTYgZXZlbl9zdWJmcmFtZSwgLyogaSAgIDogZXZlbiBzdWJmcmFtZSBpbmRpY2F0b3IgZmxhZyAgICAgICovCi0gICAgV29yZDE2IGdwX2xpbWl0LCAgICAgIC8qIGkgICA6IHBpdGNoIGdhaW4gbGltaXQgICAgICAgICAgICAgICAgICAqLwotICAgIFdvcmQxNiAqc2YwX2dhaW5fcGl0LCAvKiBvICAgOiBQaXRjaCBnYWluIHNmIDAuICAgTVI0NzUgICAgICAgICAgKi8KLSAgICBXb3JkMTYgKnNmMF9nYWluX2NvZCwgLyogbyAgIDogQ29kZSBnYWluIHNmIDAuICAgIE1SNDc1ICAgICAgICAgICovCi0gICAgV29yZDE2ICpnYWluX3BpdCwgICAgIC8qIGkvbyA6IFBpdGNoIGdhaW4uICAgICAgICAgICAgICAgICAgICAgICAqLwotICAgIFdvcmQxNiAqZ2Fpbl9jb2QsICAgICAvKiBvICAgOiBDb2RlIGdhaW4uICAgICAgICAgICAgICAgICAgICAgICAgKi8KLSAgICAvKiAgICAgICBNUjQ3NTogZ2Fpbl8qIHVucXVhbnRpemVkIGluIGV2ZW4gKi8KLSAgICAvKiAgICAgICBzdWJmcmFtZXMsIHF1YW50aXplZCBvdGhlcndpc2UgICAgKi8KLSAgICBXb3JkMTYgKiphbmFwLCAgICAgICAgLyogbyAgIDogSW5kZXggb2YgcXVhbnRpemF0aW9uICAgICAgICAgICAgICovCi0gICAgRmxhZyAgICpwT3ZlcmZsb3cgICAgIC8qIG8gICA6IG92ZXJmbG93IGluZGljYXRvciAgICAgICAgICAgICAgICAqLwotKQotewotICAgIFdvcmQxNiBleHBfZ2NvZGUwOwotICAgIFdvcmQxNiBmcmFjX2djb2RlMDsKLSAgICBXb3JkMTYgcXVhX2VuZXJfTVIxMjI7Ci0gICAgV29yZDE2IHF1YV9lbmVyOwotICAgIFdvcmQxNiBmcmFjX2NvZWZmWzVdOwotICAgIFdvcmQxNiBleHBfY29lZmZbNV07Ci0gICAgV29yZDE2IGV4cF9lbjsKLSAgICBXb3JkMTYgZnJhY19lbjsKLSAgICBXb3JkMTYgY29kX2dhaW5fZXhwOwotICAgIFdvcmQxNiBjb2RfZ2Fpbl9mcmFjOwotICAgIFdvcmQxNiB0ZW1wOwotCi0gICAgaWYgKG1vZGUgPT0gTVI0NzUpCi0gICAgewotICAgICAgICBpZiAoZXZlbl9zdWJmcmFtZSAhPSAwKQotICAgICAgICB7Ci0gICAgICAgICAgICAvKiBzYXZlIHBvc2l0aW9uIGluIG91dHB1dCBwYXJhbWV0ZXIgc3RyZWFtIGFuZCBjdXJyZW50Ci0gICAgICAgICAgICAgICBzdGF0ZSBvZiBjb2RlYm9vayBnYWluIHByZWRpY3RvciAqLwotICAgICAgICAgICAgc3QtPmdhaW5faWR4X3B0ciA9ICgqYW5hcCkrKzsKLQotLy8gICAgICAgICAgICBnY19wcmVkX2NvcHkoJihzdC0+Z2NfcHJlZFN0KSwgJihzdC0+Z2NfcHJlZFVucVN0KSk7Ci0KLSAgICAgICAgICAgIG1lbWNweShzdC0+Z2NfcHJlZFVucVN0LnBhc3RfcXVhX2VuLAotICAgICAgICAgICAgICAgICAgICAgICAgc3QtPmdjX3ByZWRTdC5wYXN0X3F1YV9lbiwKLSAgICAgICAgICAgICAgICAgICAgICAgIE5QUkVEKnNpemVvZihXb3JkMTYpKTsKLSAgICAgICAgICAgIG1lbWNweShzdC0+Z2NfcHJlZFVucVN0LnBhc3RfcXVhX2VuX01SMTIyLAotICAgICAgICAgICAgICAgICAgICAgICAgc3QtPmdjX3ByZWRTdC5wYXN0X3F1YV9lbl9NUjEyMiwKLSAgICAgICAgICAgICAgICAgICAgICAgIE5QUkVEKnNpemVvZihXb3JkMTYpKTsKLQotCi0gICAgICAgICAgICAvKiBwcmVkaWN0IGNvZGVib29rIGdhaW4gKHVzaW5nICJ1bnF1YW50aXplZCIgcHJlZGljdG9yKSovCi0gICAgICAgICAgICAvKiAobm90ZSB0aGF0IGNvZGVbXSBpcyB1bnNoYXJwZW5lZCBpbiBNUjQ3NSkgICAgICAgICAgICovCi0gICAgICAgICAgICBnY19wcmVkKAotICAgICAgICAgICAgICAgICYoc3QtPmdjX3ByZWRVbnFTdCksCi0gICAgICAgICAgICAgICAgbW9kZSwKLSAgICAgICAgICAgICAgICBjb2RlLAotICAgICAgICAgICAgICAgICZzdC0+c2YwX2V4cF9nY29kZTAsCi0gICAgICAgICAgICAgICAgJnN0LT5zZjBfZnJhY19nY29kZTAsCi0gICAgICAgICAgICAgICAgJmV4cF9lbiwKLSAgICAgICAgICAgICAgICAmZnJhY19lbiwKLSAgICAgICAgICAgICAgICBwT3ZlcmZsb3cpOwotCi0gICAgICAgICAgICAvKiBjYWxjdWxhdGUgZW5lcmd5IGNvZWZmaWNpZW50cyBmb3IgcXVhbnRpemF0aW9uCi0gICAgICAgICAgICAgICBhbmQgc3RvcmUgdGhlbSBpbiBzdGF0ZSBzdHJ1Y3R1cmUgKHdpbGwgYmUgdXNlZAotICAgICAgICAgICAgICAgaW4gbmV4dCBzdWJmcmFtZSB3aGVuIHJlYWwgcXVhbnRpemVyIGlzIHJ1bikgKi8KLSAgICAgICAgICAgIGNhbGNfZmlsdF9lbmVyZ2llcygKLSAgICAgICAgICAgICAgICBtb2RlLAotICAgICAgICAgICAgICAgIHhuLAotICAgICAgICAgICAgICAgIHhuMiwKLSAgICAgICAgICAgICAgICB5MSwKLSAgICAgICAgICAgICAgICBZMiwKLSAgICAgICAgICAgICAgICBnX2NvZWZmLAotICAgICAgICAgICAgICAgIHN0LT5zZjBfZnJhY19jb2VmZiwKLSAgICAgICAgICAgICAgICBzdC0+c2YwX2V4cF9jb2VmZiwKLSAgICAgICAgICAgICAgICAmY29kX2dhaW5fZnJhYywKLSAgICAgICAgICAgICAgICAmY29kX2dhaW5fZXhwLAotICAgICAgICAgICAgICAgIHBPdmVyZmxvdyk7Ci0KLSAgICAgICAgICAgIC8qIHN0b3JlIG9wdGltdW0gY29kZWJvb2sgZ2FpbiAoUTEpICovCi0gICAgICAgICAgICB0ZW1wID0KLSAgICAgICAgICAgICAgICBhZGQoCi0gICAgICAgICAgICAgICAgICAgIGNvZF9nYWluX2V4cCwKLSAgICAgICAgICAgICAgICAgICAgMSwKLSAgICAgICAgICAgICAgICAgICAgcE92ZXJmbG93KTsKLQotICAgICAgICAgICAgKmdhaW5fY29kID0KLSAgICAgICAgICAgICAgICBzaGwoCi0gICAgICAgICAgICAgICAgICAgIGNvZF9nYWluX2ZyYWMsCi0gICAgICAgICAgICAgICAgICAgIHRlbXAsCi0gICAgICAgICAgICAgICAgICAgIHBPdmVyZmxvdyk7Ci0KLSAgICAgICAgICAgIGNhbGNfdGFyZ2V0X2VuZXJneSgKLSAgICAgICAgICAgICAgICB4biwKLSAgICAgICAgICAgICAgICAmc3QtPnNmMF9leHBfdGFyZ2V0X2VuLAotICAgICAgICAgICAgICAgICZzdC0+c2YwX2ZyYWNfdGFyZ2V0X2VuLAotICAgICAgICAgICAgICAgIHBPdmVyZmxvdyk7Ci0KLSAgICAgICAgICAgIC8qIGNhbGN1bGF0ZSBvcHRpbXVtIGNvZGVib29rIGdhaW4gYW5kIHVwZGF0ZQotICAgICAgICAgICAgICAgInVucXVhbnRpemVkIiBwcmVkaWN0b3IgICAgICAgICAgICAgICAgICAgICovCi0gICAgICAgICAgICBNUjQ3NV91cGRhdGVfdW5xX3ByZWQoCi0gICAgICAgICAgICAgICAgJihzdC0+Z2NfcHJlZFVucVN0KSwKLSAgICAgICAgICAgICAgICBzdC0+c2YwX2V4cF9nY29kZTAsCi0gICAgICAgICAgICAgICAgc3QtPnNmMF9mcmFjX2djb2RlMCwKLSAgICAgICAgICAgICAgICBjb2RfZ2Fpbl9leHAsCi0gICAgICAgICAgICAgICAgY29kX2dhaW5fZnJhYywKLSAgICAgICAgICAgICAgICBwT3ZlcmZsb3cpOwotCi0gICAgICAgICAgICAvKiB0aGUgcmVhbCBxdWFudGl6ZXIgaXMgbm90IHJ1biBoZXJlLi4uICovCi0gICAgICAgIH0KLSAgICAgICAgZWxzZQotICAgICAgICB7Ci0gICAgICAgICAgICAvKiBwcmVkaWN0IGNvZGVib29rIGdhaW4gKHVzaW5nICJ1bnF1YW50aXplZCIgcHJlZGljdG9yKSAqLwotICAgICAgICAgICAgLyogKG5vdGUgdGhhdCBjb2RlW10gaXMgdW5zaGFycGVuZWQgaW4gTVI0NzUpICAgICAgICAgICAgKi8KLSAgICAgICAgICAgIGdjX3ByZWQoCi0gICAgICAgICAgICAgICAgJihzdC0+Z2NfcHJlZFVucVN0KSwKLSAgICAgICAgICAgICAgICBtb2RlLAotICAgICAgICAgICAgICAgIGNvZGUsCi0gICAgICAgICAgICAgICAgJmV4cF9nY29kZTAsCi0gICAgICAgICAgICAgICAgJmZyYWNfZ2NvZGUwLAotICAgICAgICAgICAgICAgICZleHBfZW4sCi0gICAgICAgICAgICAgICAgJmZyYWNfZW4sCi0gICAgICAgICAgICAgICAgcE92ZXJmbG93KTsKLQotICAgICAgICAgICAgLyogY2FsY3VsYXRlIGVuZXJneSBjb2VmZmljaWVudHMgZm9yIHF1YW50aXphdGlvbiAqLwotICAgICAgICAgICAgY2FsY19maWx0X2VuZXJnaWVzKAotICAgICAgICAgICAgICAgIG1vZGUsCi0gICAgICAgICAgICAgICAgeG4sCi0gICAgICAgICAgICAgICAgeG4yLAotICAgICAgICAgICAgICAgIHkxLAotICAgICAgICAgICAgICAgIFkyLAotICAgICAgICAgICAgICAgIGdfY29lZmYsCi0gICAgICAgICAgICAgICAgZnJhY19jb2VmZiwKLSAgICAgICAgICAgICAgICBleHBfY29lZmYsCi0gICAgICAgICAgICAgICAgJmNvZF9nYWluX2ZyYWMsCi0gICAgICAgICAgICAgICAgJmNvZF9nYWluX2V4cCwKLSAgICAgICAgICAgICAgICBwT3ZlcmZsb3cpOwotCi0gICAgICAgICAgICBjYWxjX3RhcmdldF9lbmVyZ3koCi0gICAgICAgICAgICAgICAgeG4sCi0gICAgICAgICAgICAgICAgJmV4cF9lbiwKLSAgICAgICAgICAgICAgICAmZnJhY19lbiwKLSAgICAgICAgICAgICAgICBwT3ZlcmZsb3cpOwotCi0gICAgICAgICAgICAvKiBydW4gcmVhbCAoNC1kaW0pIHF1YW50aXplciBhbmQgdXBkYXRlIHJlYWwgZ2FpbiBwcmVkaWN0b3IgKi8KLSAgICAgICAgICAgICpzdC0+Z2Fpbl9pZHhfcHRyID0KLSAgICAgICAgICAgICAgICBNUjQ3NV9nYWluX3F1YW50KAotICAgICAgICAgICAgICAgICAgICAmKHN0LT5nY19wcmVkU3QpLAotICAgICAgICAgICAgICAgICAgICBzdC0+c2YwX2V4cF9nY29kZTAsCi0gICAgICAgICAgICAgICAgICAgIHN0LT5zZjBfZnJhY19nY29kZTAsCi0gICAgICAgICAgICAgICAgICAgIHN0LT5zZjBfZXhwX2NvZWZmLAotICAgICAgICAgICAgICAgICAgICBzdC0+c2YwX2ZyYWNfY29lZmYsCi0gICAgICAgICAgICAgICAgICAgIHN0LT5zZjBfZXhwX3RhcmdldF9lbiwKLSAgICAgICAgICAgICAgICAgICAgc3QtPnNmMF9mcmFjX3RhcmdldF9lbiwKLSAgICAgICAgICAgICAgICAgICAgY29kZSwKLSAgICAgICAgICAgICAgICAgICAgZXhwX2djb2RlMCwKLSAgICAgICAgICAgICAgICAgICAgZnJhY19nY29kZTAsCi0gICAgICAgICAgICAgICAgICAgIGV4cF9jb2VmZiwKLSAgICAgICAgICAgICAgICAgICAgZnJhY19jb2VmZiwKLSAgICAgICAgICAgICAgICAgICAgZXhwX2VuLAotICAgICAgICAgICAgICAgICAgICBmcmFjX2VuLAotICAgICAgICAgICAgICAgICAgICBncF9saW1pdCwKLSAgICAgICAgICAgICAgICAgICAgc2YwX2dhaW5fcGl0LAotICAgICAgICAgICAgICAgICAgICBzZjBfZ2Fpbl9jb2QsCi0gICAgICAgICAgICAgICAgICAgIGdhaW5fcGl0LAotICAgICAgICAgICAgICAgICAgICBnYWluX2NvZCwKLSAgICAgICAgICAgICAgICAgICAgcE92ZXJmbG93KTsKLSAgICAgICAgfQotICAgIH0KLSAgICBlbHNlCi0gICAgewotICAgICAgICAvKi0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0qCi0gICAgICAgICAqICBwcmVkaWN0IGNvZGVib29rIGdhaW4gYW5kIHF1YW50aXplICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICoKLSAgICAgICAgICogIChhbHNvIGNvbXB1dGUgbm9ybWFsaXplZCBDQiBpbm5vdmF0aW9uIGVuZXJneSBmb3IgTVI3OTUpICAgICAgICAgKgotICAgICAgICAgKi0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0qLwotICAgICAgICBnY19wcmVkKAotICAgICAgICAgICAgJihzdC0+Z2NfcHJlZFN0KSwKLSAgICAgICAgICAgIG1vZGUsCi0gICAgICAgICAgICBjb2RlLAotICAgICAgICAgICAgJmV4cF9nY29kZTAsCi0gICAgICAgICAgICAmZnJhY19nY29kZTAsCi0gICAgICAgICAgICAmZXhwX2VuLAotICAgICAgICAgICAgJmZyYWNfZW4sCi0gICAgICAgICAgICBwT3ZlcmZsb3cpOwotCi0gICAgICAgIGlmIChtb2RlID09IE1SMTIyKQotICAgICAgICB7Ci0gICAgICAgICAgICAqZ2Fpbl9jb2QgPQotICAgICAgICAgICAgICAgIEdfY29kZSgKLSAgICAgICAgICAgICAgICAgICAgeG4yLAotICAgICAgICAgICAgICAgICAgICBZMiwKLSAgICAgICAgICAgICAgICAgICAgcE92ZXJmbG93KTsKLQotICAgICAgICAgICAgKigqYW5hcCkrKyA9Ci0gICAgICAgICAgICAgICAgcV9nYWluX2NvZGUoCi0gICAgICAgICAgICAgICAgICAgIG1vZGUsCi0gICAgICAgICAgICAgICAgICAgIGV4cF9nY29kZTAsCi0gICAgICAgICAgICAgICAgICAgIGZyYWNfZ2NvZGUwLAotICAgICAgICAgICAgICAgICAgICBnYWluX2NvZCwKLSAgICAgICAgICAgICAgICAgICAgJnF1YV9lbmVyX01SMTIyLAotICAgICAgICAgICAgICAgICAgICAmcXVhX2VuZXIsCi0gICAgICAgICAgICAgICAgICAgIHBPdmVyZmxvdyk7Ci0gICAgICAgIH0KLSAgICAgICAgZWxzZQotICAgICAgICB7Ci0gICAgICAgICAgICAvKiBjYWxjdWxhdGUgZW5lcmd5IGNvZWZmaWNpZW50cyBmb3IgcXVhbnRpemF0aW9uICovCi0gICAgICAgICAgICBjYWxjX2ZpbHRfZW5lcmdpZXMoCi0gICAgICAgICAgICAgICAgbW9kZSwKLSAgICAgICAgICAgICAgICB4biwKLSAgICAgICAgICAgICAgICB4bjIsCi0gICAgICAgICAgICAgICAgeTEsCi0gICAgICAgICAgICAgICAgWTIsCi0gICAgICAgICAgICAgICAgZ19jb2VmZiwKLSAgICAgICAgICAgICAgICBmcmFjX2NvZWZmLAotICAgICAgICAgICAgICAgIGV4cF9jb2VmZiwKLSAgICAgICAgICAgICAgICAmY29kX2dhaW5fZnJhYywKLSAgICAgICAgICAgICAgICAmY29kX2dhaW5fZXhwLAotICAgICAgICAgICAgICAgIHBPdmVyZmxvdyk7Ci0KLSAgICAgICAgICAgIGlmIChtb2RlID09IE1SNzk1KQotICAgICAgICAgICAgewotICAgICAgICAgICAgICAgIE1SNzk1X2dhaW5fcXVhbnQoCi0gICAgICAgICAgICAgICAgICAgIHN0LT5hZGFwdFN0LAotICAgICAgICAgICAgICAgICAgICByZXMsCi0gICAgICAgICAgICAgICAgICAgIGV4YywKLSAgICAgICAgICAgICAgICAgICAgY29kZSwKLSAgICAgICAgICAgICAgICAgICAgZnJhY19jb2VmZiwKLSAgICAgICAgICAgICAgICAgICAgZXhwX2NvZWZmLAotICAgICAgICAgICAgICAgICAgICBleHBfZW4sCi0gICAgICAgICAgICAgICAgICAgIGZyYWNfZW4sCi0gICAgICAgICAgICAgICAgICAgIGV4cF9nY29kZTAsCi0gICAgICAgICAgICAgICAgICAgIGZyYWNfZ2NvZGUwLAotICAgICAgICAgICAgICAgICAgICBMX1NVQkZSLAotICAgICAgICAgICAgICAgICAgICBjb2RfZ2Fpbl9mcmFjLAotICAgICAgICAgICAgICAgICAgICBjb2RfZ2Fpbl9leHAsCi0gICAgICAgICAgICAgICAgICAgIGdwX2xpbWl0LAotICAgICAgICAgICAgICAgICAgICBnYWluX3BpdCwKLSAgICAgICAgICAgICAgICAgICAgZ2Fpbl9jb2QsCi0gICAgICAgICAgICAgICAgICAgICZxdWFfZW5lcl9NUjEyMiwKLSAgICAgICAgICAgICAgICAgICAgJnF1YV9lbmVyLAotICAgICAgICAgICAgICAgICAgICBhbmFwLAotICAgICAgICAgICAgICAgICAgICBwT3ZlcmZsb3cpOwotICAgICAgICAgICAgfQotICAgICAgICAgICAgZWxzZQotICAgICAgICAgICAgewotICAgICAgICAgICAgICAgICooKmFuYXApKysgPQotICAgICAgICAgICAgICAgICAgICBRdWFfZ2FpbigKLSAgICAgICAgICAgICAgICAgICAgICAgIG1vZGUsCi0gICAgICAgICAgICAgICAgICAgICAgICBleHBfZ2NvZGUwLAotICAgICAgICAgICAgICAgICAgICAgICAgZnJhY19nY29kZTAsCi0gICAgICAgICAgICAgICAgICAgICAgICBmcmFjX2NvZWZmLAotICAgICAgICAgICAgICAgICAgICAgICAgZXhwX2NvZWZmLAotICAgICAgICAgICAgICAgICAgICAgICAgZ3BfbGltaXQsCi0gICAgICAgICAgICAgICAgICAgICAgICBnYWluX3BpdCwKLSAgICAgICAgICAgICAgICAgICAgICAgIGdhaW5fY29kLAotICAgICAgICAgICAgICAgICAgICAgICAgJnF1YV9lbmVyX01SMTIyLAotICAgICAgICAgICAgICAgICAgICAgICAgJnF1YV9lbmVyLAotICAgICAgICAgICAgICAgICAgICAgICAgcE92ZXJmbG93KTsKLSAgICAgICAgICAgIH0KLSAgICAgICAgfQotCi0gICAgICAgIC8qLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tKgotICAgICAgICAgKiAgdXBkYXRlIHRhYmxlIG9mIHBhc3QgcXVhbnRpemVkIGVuZXJnaWVzICAgICAgICAgICAgICAgICAgICAgICAgICoKLSAgICAgICAgICogIH5+fn5+fn5+fn5+fn5+fn5+fn5+fn5+fn5+fn5+fn5+fn5+fn5+fiAgICAgICAgICAgICAgICAgICAgICAgICAqCi0gICAgICAgICAqICBzdC0+cGFzdF9xdWFfZW4oUTEwKSA9IDIwICogTG9nMTAocXVhX2dhaW5fY29kZSkgLyBjb25zdGFudCAgICAgKgotICAgICAgICAgKiAgICAgICAgICAgICAgICAgICAgICAgPSBMb2cyKHF1YV9nYWluX2NvZGUpICAgICAgICAgICAgICAgICAgICAgICoKLSAgICAgICAgICogICAgICAgICAgICAgICA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Ci0gICAgICAgIFdvcmQxNiByZXNbXSwgICAgICAgICAvKiBpICAgOiBMUCByZXNpZHVhbCwgICAgICAgICAgICAgICAgIFEwICAgKi8KLSAgICAgICAgV29yZDE2IGV4Y1tdLCAgICAgICAgIC8qIGkgICA6IExUUCBleGNpdGF0aW9uICh1bmZpbHRlcmVkKSwgUTAgICAqLwotICAgICAgICBXb3JkMTYgY29kZVtdLCAgICAgICAgLyogaSAgIDogQ0IgaW5ub3ZhdGlvbiAodW5maWx0ZXJlZCksICBRMTMgICovCi0gICAgICAgIC8qICAgICAgICh1bnNoYXJwZW5lZCBmb3IgTVI0NzUpICAgICAgICAgICAqLwotICAgICAgICBXb3JkMTYgeG5bXSwgICAgICAgICAgLyogaSAgIDogVGFyZ2V0IHZlY3Rvci4gICAgICAgICAgICAgICAgICAgICovCi0gICAgICAgIFdvcmQxNiB4bjJbXSwgICAgICAgICAvKiBpICAgOiBUYXJnZXQgdmVjdG9yLiAgICAgICAgICAgICAgICAgICAgKi8KLSAgICAgICAgV29yZDE2IHkxW10sICAgICAgICAgIC8qIGkgICA6IEFkYXB0aXZlIGNvZGVib29rLiAgICAgICAgICAgICAgICAqLwotICAgICAgICBXb3JkMTYgWTJbXSwgICAgICAgICAgLyogaSAgIDogRmlsdGVyZWQgaW5ub3ZhdGl2ZSB2ZWN0b3IuICAgICAgICovCi0gICAgICAgIFdvcmQxNiBnX2NvZWZmW10sICAgICAvKiBpICAgOiBDb3JyZWxhdGlvbnMgPHhuIHkxPiA8eTEgeTE+ICAgICAgKi8KLSAgICAgICAgLyogICAgICAgQ29tcHV0ZSBpbiBHX3BpdGNoKCkuICAgICAgICAgICAgICovCi0gICAgICAgIFdvcmQxNiBldmVuX3N1YmZyYW1lLCAvKiBpICAgOiBldmVuIHN1YmZyYW1lIGluZGljYXRvciBmbGFnICAgICAgKi8KLSAgICAgICAgV29yZDE2IGdwX2xpbWl0LCAgICAgIC8qIGkgICA6IHBpdGNoIGdhaW4gbGltaXQgICAgICAgICAgICAgICAgICAqLwotICAgICAgICBXb3JkMTYgKnNmMF9nYWluX3BpdCwgLyogbyAgIDogUGl0Y2ggZ2FpbiBzZiAwLiAgIE1SNDc1ICAgICAgICAgICovCi0gICAgICAgIFdvcmQxNiAqc2YwX2dhaW5fY29kLCAvKiBvICAgOiBDb2RlIGdhaW4gc2YgMC4gICAgTVI0NzUgICAgICAgICAgKi8KLSAgICAgICAgV29yZDE2ICpnYWluX3BpdCwgICAgIC8qIGkvbyA6IFBpdGNoIGdhaW4uICAgICAgICAgICAgICAgICAgICAgICAqLwotICAgICAgICBXb3JkMTYgKmdhaW5fY29kLCAgICAgLyogbyAgIDogQ29kZSBnYWluLiAgICAgICAgICAgICAgICAgICAgICAgICovCi0gICAgICAgIC8qICAgICAgIE1SNDc1OiBnYWluXyogdW5xdWFudGl6ZWQgaW4gZXZlbiAqLwotICAgICAgICAvKiAgICAgICBzdWJmcmFtZXMsIHF1YW50aXplZCBvdGhlcndpc2UgICAgKi8KLSAgICAgICAgV29yZDE2ICoqYW5hcCwgICAgICAgIC8qIG8gICA6IEluZGV4IG9mIHF1YW50aXphdGlvbiAgICAgICAgICAgICAqLwotICAgICAgICBGbGFnICAgKnBPdmVyZmxvdyAgICAgLyogbyAgIDogb3ZlcmZsb3cgaW5kaWNhdG9yICAgICAgICAgICAgICAgICovCi0gICAgKTsKLQotICAgIC8qLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLQotICAgIDsgRU5ECi0gICAgLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSovCi0jaWZkZWYgX19jcGx1c3BsdXMKLX0KLSNlbmRpZgotCi0jZW5kaWYgLyogZ2Fpbl9xX2ggKi8KLQotCmRpZmYgLS1naXQgY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dG9yLiAgICAgICAgICAgICAgICAgICAgICAqLwotICAgIFdvcmQxNiBzY2FsX3NpZ1tdLCAgLyogaSAgIDogc2NhbGVkIHNpZ25hbC4gICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotICAgIFdvcmQxNiBMX2ZyYW1lLCAgICAgLyogaSAgIDogbGVuZ3RoIG9mIGZyYW1lIHRvIGNvbXB1dGUgcGl0Y2ggICAgICAgICAqLwotICAgIFdvcmQxNiBsYWdfbWF4LCAgICAgLyogaSAgIDogbWF4aW11bSBsYWcgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotICAgIFdvcmQxNiBsYWdfbWluLCAgICAgLyogaSAgIDogbWluaW11bSBsYWcgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotICAgIFdvcmQxNiAqY29yX2hwX21heCwgLyogbyAgIDogbWF4IGhpZ2gtcGFzcyBmaWx0ZXJlZCBub3JtLiBjb3JyZWxhdGlvbiAqLwotICAgIEZsYWcgICAqcE92ZXJmbG93ICAgLyogaS9vIDogb3ZlcmZsb3cgRmxhZyAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotKQotewotICAgIFdvcmQxNiBpOwotICAgIFdvcmQxNiAqcCwgKnAxOwotICAgIFdvcmQzMiBtYXgsIHQwLCB0MTsKLSAgICBXb3JkMTYgbWF4MTYsIHQwMTYsIGNvcl9tYXg7Ci0gICAgV29yZDE2IHNoaWZ0LCBzaGlmdDEsIHNoaWZ0MjsKLSAgICBXb3JkMzIgTF90ZW1wOwotCi0gICAgbWF4ID0gTUlOXzMyOwotICAgIHQwID0gMEw7Ci0KLSAgICBmb3IgKGkgPSBsYWdfbWF4IC0gMTsgaSA+IGxhZ19taW47IGktLSkKLSAgICB7Ci0gICAgICAgIC8qIGhpZ2gtcGFzcyBmaWx0ZXJpbmcgKi8KLSAgICAgICAgdDAgPSBMX3NobChjb3JyWy1pXSwgMSwgcE92ZXJmbG93KTsKLSAgICAgICAgTF90ZW1wID0gTF9zdWIod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JBTCBGVU5DVElPTiBERUZJTklUSU9OUwotICAgIDsgW0xpc3QgZnVuY3Rpb24gcHJvdG90eXBlcyBoZXJlXQotICAgIC0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0qLwotICAgIFdvcmQxNiBocF9tYXgoCi0gICAgICAgIFdvcmQzMiBjb3JyW10sICAgICAgLyogaSAgIDogY29ycmVsYXRpb24gdmVjdG9yLiAgICAgICAgICAgICAgICAgICAgICAqLwotICAgICAgICBXb3JkMTYgc2NhbF9zaWdbXSwgIC8qIGkgICA6IHNjYWxlZCBzaWduYWwuICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLSAgICAgICAgV29yZDE2IExfZnJhbWUsICAgICAvKiBpICAgOiBsZW5ndGggb2YgZnJhbWUgdG8gY29tcHV0ZSBwaXRjaCAgICAgICAgICovCi0gICAgICAgIFdvcmQxNiBsYWdfbWF4LCAgICAgLyogaSAgIDogbWF4aW11bSBsYWcgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotICAgICAgICBXb3JkMTYgbGFnX21pbiwgICAgIC8qIGkgICA6IG1pbmltdW0gbGFnICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLSAgICAgICAgV29yZDE2ICpjb3JfaHBfbWF4LCAvKiBvICAgOiBtYXggaGlnaC1wYXNzIGZpbHRlcmVkIG5vcm0uIGNvcnJlbGF0aW9uICovCi0gICAgICAgIEZsYWcgICAqcE92ZXJmbG93ICAgLyogaS9vIDogb3ZlcmZsb3cgRmxhZyAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotICAgICk7Ci0KLSNpZmRlZiBfX2NwbHVzcGx1cwotfQotI2VuZGlmCi0KLSNlbmRpZiAgLyogX0hQX01BWF9IXyAqLwotCi0KZGlmZiAtLWdpdCBhL21lZGlhL2xpYnN0YWdlZnJpZ2h0L2NvZGVjcy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0b3Jlcy9CdWZmZXJzL1BvaW50ZXJzIE5lZWRlZDoKLSAgICBOb25lCi0KLSBPdXRwdXRzOgotICAgIE5vbmUKLQotIFBvaW50ZXJzIGFuZCBCdWZmZXJzIE1vZGlmaWVkOgotICAgIE5vbmUKLQotIExvY2FsIFN0b3JlcyBNb2RpZmllZDoKLSAgICBOb25lCi0KLSBHbG9iYWwgU3RvcmVzIE1vZGlmaWVkOgotICAgIE5vbmUKLQotLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tCi0gRlVOQ1RJT04gREVTQ1JJUFRJT04KLQotICAgICAgRmlsZSAgICAgICAgICAgICA6IGxhZ193aW5kLnRhYgotICAgICAgUHVycG9zZSAgICAgICAgICA6IFRhYmxlIG9mIGxhZ193aW5kb3cgZm9yIGF1dG9jb3JyZWxhdGlvbi4KLQotICotLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSoKLSB8IFRhYmxlIG9mIGxhZ193aW5kb3cgZm9yIGF1dG9jb3JyZWxhdGlvbi4gICAgICAgICAgICB8Ci0gfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfAotIHwgbm9pc2UgZmxvb3IgPSAxLjAwMDEgICA9ICgwLjk5OTkgIG9uIHJbMV0gLi5yWzEwXSkgIHwKLSB8IEJhbmR3aXRkaCBleHBhbnNpb24gPSA2MCBIeiAgICAgICAgICAgICAgICAgICAgICAgICB8Ci0gfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfAotIHwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwKLSB8IGxhZ193aW5kWzBdID0gIDEuMDAwMDAwMDAgICAgKG5vdCBzdG9yZWQpICAgICAgICAgICB8Ci0gfCBsYWdfd2luZFsxXSA9ICAwLjk5ODc5MDM4ICAgICAgICAgICAgICAgICAgICAgICAgICAgfAotIHwgbGFnX3dpbmRbMl0gPSAgMC45OTU0Njg5NyAgICAgICAgICAgICAgICAgICAgICAgICAgIHwKLSB8IGxhZ193aW5kWzNdID0gIDAuOTg5OTU3ODEgICAgICAgICAgICAgICAgICAgICAgICAgICB8Ci0gfCBsYWdfd2luZFs0XSA9ICAwLjk4MjI5MzM3ICAgICAgICAgICAgICAgICAgICAgICAgICAgfAotIHwgbGFnX3dpbmRbNV0gPSAgMC45NzI1MjYxOSAgICAgICAgICAgICAgICAgICAgICAgICAgIHwKLSB8IGxhZ193aW5kWzZdID0gIDAuOTYwNzIwMzYgICAgICAgICAgICAgICAgICAgICAgICAgICB8Ci0gfCBsYWdfd2luZFs3XSA9ICAwLjk0Njk1MjY0ICAgICAgICAgICAgICAgICAgICAgICAgICAgfAotIHwgbGFnX3dpbmRbOF0gPSAgMC45MzEzMTE3OSAgICAgICAgICAgICAgICAgICAgICAgICAgIHwKLSB8IGxhZ193aW5kWzldID0gIDAuOTEzODk3NTcgICAgICAgICAgICAgICAgICAgICAgICAgICB8Ci0gfCBsYWdfd2luZFsxMF09ICAwLjg5NDgxOTY4ICAgICAgICAgICAgICAgICAgICAgICAgICAgfAotIC0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0KLQotLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tCi0gUkVRVUlSRU1FTlRTCi0KLSBOb25lCi0KLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLQotIFJFR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5oW00gKyAxXSwgQW5sW00gKyAxXTsvLyBMUEMgY29lZi5mb3IgbmV4dCBpdGVyYXRpb24gaW4gZG91YmxlCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcHJlYy4KLSAgICBXb3JkMzIgdDAsIHQxLCB0MjsgICAgICAgICAgICAvLyB0ZW1wb3JhcnkgdmFyaWFibGUKLQotICAgIC8vIEsgPSBBWzFdID0gLVJbMV0gLyBSWzBdCi0KLSAgICB0MSA9IExfQ29tcCAoUmhbMV0sIFJsWzFdKTsKLSAgICB0MiA9IExfYWJzICh0MSk7ICAgICAgICAgICAgICAgICAgICAvLyBhYnMgUlsxXQotICAgIHQwID0gRGl2XzMyICh0MiwgUmhbMF0sIFJsWzBdKTsgICAgIC8vIFJbMV0vUlswXQotICAgIGlmICh0MSA+IDApCi0gICAgICAgdDAgPSBMX25lZ2F0ZSAodDApOyAgICAgICAgICAgICAvLyAtUlsxXS9SWzBdCi0gICAgTF9FeHRyYWN0ICh0MCwgJktoLCAmS2wpOyAgICAgICAgICAgLy8gSyBpbiBEUEYKLQotICAgIHJjWzBdID0gcHZfcm91bmQgKHQwKTsKLQotICAgIHQwID0gTF9zaHIgKHQwLCA0KTsgICAgICAgICAgICAgICAgIC8vIEFbMV0gaW4KLSAgICBMX0V4dHJhY3QgKHQwLCAmQWhbMV0sICZBbFsxXSk7ICAgICAvLyBBWzFdIGluIERQRgotCi0gICAgLy8gIEFscGhhID0gUlswXSAqICgxLUsqKjIpCi0KLSAgICB0MCA9IE1weV8zMiAoS2gsIEtsLCBLaCwgS2wpOyAgICAgICAvLyBLKksKLSAgICB0MCA9IExfYWJzICh0MCk7ICAgICAgICAgICAgICAgICAgICAvLyBTb21lIGNhc2UgPDAgISEKLSAgICB0MCA9IExfc3ViICgoV29yZDMyKSAweDdmZmZmZmZmTCwgdDApOyAvLyAxIC0gSypLCi0gICAgTF9FeHRyYWN0ICh0MCwgJmhpLCAmbG8pOyAgICAgICAgICAgLy8gRF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gdDIgPSBMX25lZ2F0ZSAodDIpOyAgICAgICAgIC8vIEsgPS10MC9BbHBoYQotICAgICAgIHQyID0gTF9zaGwgKHQyLCBhbHBfZXhwKTsgICAgICAgLy8gZGVub3JtYWxpemU7IGNvbXBhcmUgdG8gQWxwaGEKLSAgICAgICBMX0V4dHJhY3QgKHQyLCAmS2gsICZLbCk7ICAgICAgIC8vIEsgaW4gRFBGCi0KLSAgICAgICBpZiAoc3ViIChpLCA1KSA8IDApCi0gICAgICAgewotICAgICAgICAgIHJjW2kgLSAxXSA9IHB2X3JvdW5kICh0Mik7Ci0gICAgICAgfQotICAgICAgIC8vIFRlc3QgZm9yIHVuc3RhYmxlIGZpbHRlci4gSWYgdW5zdGFibGUga2VlcCBvbGQgQSh6KQotCi0gICAgICAgaWYgKHN1YiAoYWJzX3MgKEtoKSwgMzI3NTApID4gMCkKLSAgICAgICB7Ci0gICAgICAgICAgZm9yIChqID0gMDsgaiA8PSBNOyBqKyspCi0gICAgICAgICAgewotICAgICAgICAgICAgIEFbal0gPSBzdC0+b2xkX0Fbal07Ci0gICAgICAgICAgfQotCi0gICAgICAgICAgZm9yIChqID0gMDsgaiA8IDQ7IGorKykKLSAgICAgICAgICB7Ci0gICAgICAgICAgICAgcmNbal0gPSAwOwotICAgICAgICAgIH0KLQotICAgICAgICAgIHJldHVybiAwOwotICAgICAgIH0KLSAgICAgICAgKi0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSoKLSAgICAgICAgKiAgQ29tcHV0ZSBuZXcgTFBDIGNvZWZmLiAtPiBBbltpXSAgICAgICAgICoKLSAgICAgICAgKiAgQW5bal09IEFbal0gKyBLKkFbaS1qXSAgICAgLCBqPTEgdG8gaS0xICoKLSAgICAgICAgKiAgQW5baV09IEsgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICoKLSAgICAgICAgKi0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSoKLQotICAgICAgIGZvciAoaiA9IDE7IGogPCBpOyBqKyspCi0gICAgICAgewotICAgICAgICAgIHQwID0gTXB5XzMyIChLaCwgS2wsIEFoW2kgLSBqXSwgQWxbaSAtIGpdKTsKLSAgICAgICAgICB0MCA9IExfYWRkKHQwLCBMX0NvbXAoQWhbal0sIEFsW2pdKSk7Ci0gICAgICAgICAgTF9FeHRyYWN0ICh0MCwgJkFuaFtqXSwgJkFubFtqXSk7Ci0gICAgICAgfQotICAgICAgIHQyID0gTF9zaHIgKHQyLCA0KTsKLSAgICAgICBMX0V4dHJhY3QgKHQyLCAmQW5oW2ldLCAmQW5sW2ldKTsKLQotICAgICAgIC8vICBBbHBoYSA9IEFscGhhICogKDEtSyoqMikKLQotICAgICAgIHQwID0gTXB5XzMyIChLaCwgS2wsIEtoLCBLbCk7ICAgICAgICAgICAvLyBLKksKLSAgICAgICB0MCA9IExfYWJzICh0MCk7ICAgICAgICAgICAgICAgICAgICAgICAgLy8gU29tZSBjYXNlIDwwICEhCi0gICAgICAgdDAgPSBMX3N1YiAoKFdvcmQzMikgMHg3ZmZmZmZmZkwsIHQwKTsgIC8vIDEgLSBLKksKLSAgICAgICBMX0V4dHJhY3QgKHQwLCAmaGksICZsbyk7ICAgICAgICAgICAgICAgLy8gRFBGIGZvcm1hdAotICAgICAgIHQwID0gTXB5XzMyIChhbHBfaCwgYWxwX2wsIGhpLCBsbyk7Ci0KLSAgICAgICAvLyBOb3JtYWxpemUgQWxwaGEKLQotICAgICAgIGogPSBub3JtX2wgKHQwKTsKLSAgICAgICB0MCA9IExfc2hsICh0MCwgaik7Ci0gICAgICAgTF9FeHRyYWN0ICh0MCwgJmFscF9oLCAmYWxwX2wpOyAgICAgICAgIC8vIERQRiBmb3JtYXQKLSAgICAgICBhbHBfZXhwID0gYWRkIChhbHBfZXhwLCBqKTsgICAgICAgICAgICAgLy8gQWRkIG5vcm1hbGl6YXRpb24gdG8KLSAgICAgICAgICAgICAgICAgICAgICAgIC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2IEtoOyAgICAgICAgICAgICAgICAgICAgLyogcmVmbGV4aW9uIGNvZWZmaWNpZW50OyBoaSBhbmQgbG8gICAqLwotICAgIFdvcmQxNiBLbDsKLSAgICBXb3JkMTYgYWxwX2g7ICAgICAgICAgICAgICAgICAvKiBQcmVkaWN0aW9uIGdhaW47IGhpIGxvIGFuZCBleHBvbmVudCovCi0gICAgV29yZDE2IGFscF9sOwotICAgIFdvcmQxNiBhbHBfZXhwOwotICAgIFdvcmQxNiBBaFtNICsgMV07ICAgICAgICAgICAgIC8qIExQQyBjb2VmLiBpbiBkb3VibGUgcHJlYy4gICAgICAgICAgKi8KLSAgICBXb3JkMTYgQWxbTSArIDFdOwotICAgIFdvcmQxNiBBbmhbTSArIDFdOyAgICAgICAgICAgIC8qIExQQyBjb2VmLmZvciBuZXh0IGl0ZXJhdGlvbiBpbiAgICAgKi8KLSAgICBXb3JkMTYgQW5sW00gKyAxXTsgICAgICAgICAgICAvKiBkb3VibGUgcHJlYy4gICAgICAgICAgICAgICAgICAgICAgICovCi0gICAgcmVnaXN0ZXIgV29yZDMyIHQwOyAgICAgICAgICAgLyogdGVtcG9yYXJ5IHZhcmlhYmxlICAgICAgICAgICAgICAgICAqLwotICAgIHJlZ2lzdGVyIFdvcmQzMiB0MTsgICAgICAgICAgIC8qIHRlbXBvcmFyeSB2YXJpYWJsZSAgICAgICAgICAgICAgICAgKi8KLSAgICByZWdpc3RlciBXb3JkMzIgdDI7ICAgICAgICAgICAvKiB0ZW1wb3JhcnkgdmFyaWFibGUgICAgICAgICAgICAgICAgICovCi0KLSAgICBXb3JkMTYgKnBfUmg7Ci0gICAgV29yZDE2ICpwX1JsOwotICAgIFdvcmQxNiAqcF9BaDsKLSAgICBXb3JkMTYgKnBfQWw7Ci0gICAgV29yZDE2ICpwX0FuaDsKLSAgICBXb3JkMTYgKnBfQW5sOwotICAgIFdvcmQxNiAqcF9BOwotCi0gICAgLyogSyA9IEFbMV0gPSAtUlsxXSAvIFJbMF0gKi8KLSAgICB0MSA9ICgoV29yZDMyKSAqIChSaCArIDEpKSA8PCAxNjsKLSAgICB0MSArPSAqKFJsICsgMSkgPDwgMTsKLQotICAgIHQyID0gTF9hYnModDEpOyAgICAgICAgIC8qIGFicyBSWzFdIC0gcmVxdWlyZWQgYnkgRGl2XzMyICovCi0gICAgdDAgPSBEaXZfMzIodDIsICpSaCwgKlJsLCBwT3ZlcmZsb3cpOyAgLyogUlsxXS9SWzBdICAgICAgICAqLwotCi0gICAgaWYgKHQxID4gMCkKLSAgICB7Ci0gICAgICAgIHQwID0gTF9uZWdhdGUodDApOyAgLyogLVJbMV0vUlswXSAgICAgICAqLwotICAgIH0KLQotICAgIC8qIEsgaW4gRFBGICAgICAgICAgKi8KLSAgICBLaCA9IChXb3JkMTYpKHQwID4+IDE2KTsKLSAgICBLbCA9IChXb3JkMTYpKCh0MCA+PiAxKSAtICgoV29yZDMyKShLaCkgPDwgMTUpKTsKLQotICAgICpyYyA9IHB2X3JvdW5kKHQwLCBwT3ZlcmZsb3cpOwotCi0gICAgdDAgPSB0MCA+PiA0OwotCi0gICAgLyogQVsxXSBpbiBEUEYgICAgICAqLwotICAgICooQWggKyAxKSA9IChXb3JkMTYpKHQwID4+IDE2KTsKLQotICAgICooQWwgKyAxKSA9IChXb3JkMTYpKCh0MCA+PiAxKSAtICgoV29yZDMyKSgqKEFoICsgMSkpIDw8IDE1KSk7Ci0KLSAgICAvKiAgQWxwaGEgPSBSWzBdICogKDEtSyoqMikgKi8KLSAgICB0MCA9IE1weV8zMihLaCwgS2wsIEtoLCBLbCwgcE92ZXJmbG93KTsgICAgICAgICAvKiBLKksgICAgICAgICAgICAgICovCi0gICAgdDAgPSBMX2Ficyh0MCk7ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLyogU29tZSBjYXNlIDwwICEhICAqLwotICAgIHQwID0gMHg3ZmZmZmZmZkwgLSB0MDsgICAgICAgICAgICAgICAgICAgICAgICAgIC8qIDEgLSBLKksgICAgICAgICA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ICoocF9BbC0tKSkgPj4gMTUpOwotICAgICAgICAgICAgdDAgKz0gKCgoV29yZDMyKSAqIChwX1JsKyspKiAqKHBfQWgpKSA+PiAxNSk7Ci0gICAgICAgICAgICB0MCArPSAoKFdvcmQzMikgKiAocF9SaCsrKSogKihwX0FoLS0pKTsKLSAgICAgICAgfQotCi0gICAgICAgIHQwID0gdDAgPDwgNTsKLQotICAgICAgICB0MSA9ICgoV29yZDMyKSAqIChSaCArIGkpIDw8IDE2KSArICgoV29yZDMyKSgqKFJsICsgaSkpIDw8IDEpOwotICAgICAgICB0MCArPSB0MTsKLQotICAgICAgICAvKiBLID0gLXQwIC8gQWxwaGEgKi8KLQotICAgICAgICB0MSA9IExfYWJzKHQwKTsKLSAgICAgICAgdDIgPSBEaXZfMzIodDEsIGFscF9oLCBhbHBfbCwgcE92ZXJmbG93KTsgIC8qIGFicyh0MCkvQWxwaGEgICAgICAgICovCi0KLSAgICAgICAgaWYgKHQwID4gMCkKLSAgICAgICAgewotICAgICAgICAgICAgdDIgPSBMX25lZ2F0ZSh0Mik7ICAgICAgICAgIC8qIEsgPS10MC9BbHBoYSAgICAgKi8KLSAgICAgICAgfQotCi0gICAgICAgIHQyID0gTF9zaGwodDIsIGFscF9leHAsIHBPdmVyZmxvdyk7ICAvKiBkZW5vcm1hbGl6ZTsgY29tcGFyZSB0byBBbHBoYSAqLwotICAgICAgICBLaCA9IChXb3JkMTYpKHQyID4+IDE2KTsKLSAgICAgICAgS2wgPSAoV29yZDE2KSgodDIgPj4gMSkgLSAoKFdvcmQzMikoS2gpIDw8IDE1KSk7Ci0KLSAgICAgICAgaWYgKGkgPCA1KQotICAgICAgICB7Ci0gICAgICAgICAgICAqKHJjICsgaSAtIDEpID0gKFdvcmQxNikoKHQyICsgMHgwMDAwODAwMEwpID4+IDE2KTsKLSAgICAgICAgfQotICAgICAgICAvKiBUZXN0IGZvciB1bnN0YWJsZSBmaWx0ZXIuIElmIHVuc3RhYmxlIGtlZXAgb2xkIEEoeikgKi8KLSAgICAgICAgaWYgKChhYnNfcyhLaCkpID4gMzI3NTApCi0gICAgICAgIHsKLSAgICAgICAgICAgIG1lbWNweShBLCAmKHN0LT5vbGRfQVswXSksIHNpemVvZihXb3JkMTYpKihNICsgMSkpOwotICAgICAgICAgICAgbWVtc2V0KHJjLCAwLCBzaXplb2YoV29yZDE2KSo0KTsKLSAgICAgICAgICAgIHJldHVybigwKTsKLSAgICAgICAgfQotICAgICAgICAvKi0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSoKLSAgICAgICAgKiAgQ29tcHV0ZSBuZXcgTFBDIGNvZWZmLiAtPiBBbltpXSAgICAgICAgICoKLSAgICAgICAgKiAgQW5bal09IEFbal0gKyBLKkFbaS1qXSAgICAgLCBqPTEgdG8gaS0xICoKLSAgICAgICAgKiAgQW5baV09IEsgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICoKLSAgICAgICAgKi0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSovCi0gICAgICAgIHBfQWggPSAmQWhbaS0xXTsKLSAgICAgICAgcF9BbCA9ICZBbFtpLTFdOwotICAgICAgICBwX0FuaCA9ICZBbmhbMV07Ci0gICAgICAgIHBfQW5sID0gJkFubFsxXTsKLSAgICAgICAgZm9yIChqID0gMTsgaiA8IGk7IGorKykKLSAgICAgICAgewotICAgICAgICAgICAgdDAgID0gKCgoV29yZDMyKUtoKiAqKHBfQWwtLSkpID4+IDE1KTsKLSAgICAgICAgICAgIHQwICs9ICgoKFdvcmQzMilLbCogKihwX0FoKSkgPj4gMTUpOwotICAgICAgICAgICAgdDAgKz0gKChXb3JkMzIpS2gqICoocF9BaC0tKSk7Ci0KLSAgICAgICAgICAgIHQwICs9IChBaFtqXSA8PCAxNSkgKyBBbFtqXTsKLQotICAgICAgICAgICAgKihwX0FuaCkgPSAoV29yZDE2KSh0MCA+PiAxNSk7Ci0gICAgICAgICAgICAqKHBfQW5sKyspID0gKFdvcmQxNikodDAgLSAoKFdvcmQzMikoKihwX0FuaCsrKSkgPDwgMTUpKTsKLSAgICAgICAgfQotCi0gICAgICAgICoocF9BbmgpID0gKFdvcmQxNikodDIgPj4gMjApOwotICAgICAgICAqKHBfQW5sKSA9IChXb3JkMTYpKCh0MiA+PiA1KSAtICgoV29yZDMyKSgqKEFuaCArIGkpKSA8PCAxNSkpOwotCi0gICAgICAgIC8qICBBbHBoYSA9IEFscGhhICogKDEtSyoqMikgKi8KLQotICAgICAgICB0MCA9IE1weV8zMihLaCwgS2wsIEtoLCBLbCwgcE92ZXJmbG93KTsgIC8qIEsqSyAgICAgICAgICAgICAqLwotICAgICAgICB0MCA9IExfYWJzKHQwKTsgICAgICAgICAgICAgICAgICAgICAgICAgIC8qIFNvbWUgY2FzZSA8MCAhISAqLwotICAgICAgICB0MCA9IDB4N2ZmZmZmZmZMIC0gdDA7ICAgICAgICAgICAgICAgICAgIC8qIDEgLSBLKksgICAgICAgICAgKi8KLQotICAgICAgICBoaSA9IChXb3JkMTYpKHQwID4+IDE2KTsKLSAgICAgICAgbG8gPSAoV29yZDE2KSgodDAgPj4gMSkgLSAoKFdvcmQzMikoaGkpIDw8IDE1KSk7Ci0KLSAgICAgICAgdDAgID0gKCgoV29yZDMyKWFscF9oICogbG8pID4+IDE1KTsKLSAgICAgICAgdDAgKz0gKCgoV29yZDMyKWFscF9sICogaGkpID4+IDE1KTsKLSAgICAgICAgdDAgKz0gKChXb3JkMzIpYWxwX2ggKiBoaSk7Ci0KLSAgICAgICAgdDAgPDw9IDE7Ci0gICAgICAgIC8qIE5vcm1hbGl6ZSBBbHBoYSAqLwotCi0gICAgICAgIGogPSBub3JtX2wodDApOwotICAgICAgICB0MCA8PD0gajsKLSAgICAgICAgYWxwX2ggPSAoV29yZDE2KSh0MCA+PiAxNik7Ci0gICAgICAgIGFscF9sID0gKFdvcmQxNikoKHQwID4+IDEpIC0gKChXb3JkMzIpKGFscF9oK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LSAgIHsKLSAgICAgICAvLyBBdXRvY29ycmVsYXRpb25zCi0gICAgICAgQXV0b2NvcnIoeF8xMmsyLCBNLCBySGlnaCwgckxvdywgd2luZG93XzE2MF84MCk7Ci0gICAgICAgLy8gTGFnIHdpbmRvd2luZwotICAgICAgIExhZ193aW5kb3coTSwgckhpZ2gsIHJMb3cpOwotICAgICAgIC8vIExldmluc29uIER1cmJpbgotICAgICAgIExldmluc29uKHN0LT5sZXZpbnNvblN0LCBySGlnaCwgckxvdywgJmFbTVAxXSwgcmMpOwotCi0gICAgICAgLy8gQXV0b2NvcnJlbGF0aW9ucwotICAgICAgIEF1dG9jb3JyKHhfMTJrMiwgTSwgckhpZ2gsIHJMb3csIHdpbmRvd18yMzJfOCk7Ci0gICAgICAgLy8gTGFnIHdpbmRvd2luZwotICAgICAgIExhZ193aW5kb3coTSwgckhpZ2gsIHJMb3cpOwotICAgICAgIC8vIExldmluc29uIER1cmJpbgotICAgICAgIExldmluc29uKHN0LT5sZXZpbnNvblN0LCBySGlnaCwgckxvdywgJmFbTVAxICogM10sIHJjKTsKLSAgIH0KLSAgIGVsc2UKLSAgIHsKLSAgICAgICAvLyBBdXRvY29ycmVsYXRpb25zCi0gICAgICAgQXV0b2NvcnIoeCwgTSwgckhpZ2gsIHJMb3csIHdpbmRvd18yMDBfNDApOwotICAgICAgIC8vIExhZyB3aW5kb3dpbmcKLSAgICAgICBMYWdfd2luZG93KE0sIHJIaWdoLCByTG93KTsKLSAgICAgICAvLyBMZXZpbnNvbiBEdXJiaW4KLSAgICAgICBMZXZpbnNvbihzdC0+bGV2aW5zb25TdCwgckhpZ2gsIHJMb3csICZhW01QMSAqIDNdLCByYyk7Ci0gICB9Ci0KLSAgIHJldHVybiAwOwotCi0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0KLSBSRVNPVVJDRVMgVVNF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0gTW9kZSBtb2RlLCAgIC8qIGkgIDogY29kZXIgbW9kZSAgICAgICAgICAgICAgICAgICovCi0gICAgV29yZDE2IHhbXSwgICAgICAgLyogaSAgOiBJbnB1dCBzaWduYWwgICAgICAgICAgIFExNSAgKi8KLSAgICBXb3JkMTYgeF8xMmsyW10sICAvKiBpICA6IElucHV0IHNpZ25hbCAoRUZSKSAgICAgUTE1ICAqLwotICAgIFdvcmQxNiBhW10sICAgICAgIC8qIG8gIDogcHJlZGljdG9yIGNvZWZmaWNpZW50cyBRMTIgICovCi0gICAgRmxhZyAgICpwT3ZlcmZsb3cKLSkKLXsKLSAgICBXb3JkMTYgcmNbNF07ICAgICAgICAgICAgICAgICAgLyogRmlyc3QgNCByZWZsZWN0aW9uIGNvZWZmaWNpZW50cyBRMTUgKi8KLSAgICBXb3JkMTYgckxvd1tNUDFdLCBySGlnaFtNUDFdOyAgLyogQXV0b2NvcnJlbGF0aW9ucyBsb3cgYW5kIGhpICAgICAgKi8KLSAgICAvKiBObyBmaXhlZCBRIHZhbHVlIGJ1dCBub3JtYWxpemVkICAqLwotICAgIC8qIHNvIHRoYXQgb3ZlcmZsb3cgaXMgYXZvaWRlZCAgICAgICovCi0KLSAgICBpZiAobW9kZSA9PSBNUjEyMikKLSAgICB7Ci0gICAgICAgIC8qIEF1dG9jb3JyZWxhdGlvbnMgKi8KLSAgICAgICAgQXV0b2NvcnIoeF8xMmsyLCBNLCBySGlnaCwgckxvdywgd2luZG93XzE2MF84MCwgcE92ZXJmbG93KTsKLSAgICAgICAgLyogTGFnIHdpbmRvd2luZyAgICAqLwotICAgICAgICBMYWdfd2luZG93KE0sIHJIaWdoLCByTG93LCBwT3ZlcmZsb3cpOwotICAgICAgICAvKiBMZXZpbnNvbiBEdXJiaW4gICovCi0gICAgICAgIExldmluc29uKHN0LT5sZXZpbnNvblN0LCBySGlnaCwgckxvdywgJmFbTVAxXSwgcmMsIHBPdmVyZmxvdyk7Ci0KLSAgICAgICAgLyogQXV0b2NvcnJlbGF0aW9ucyAqLwotICAgICAgICBBdXRvY29ycih4XzEyazIsIE0sIHJIaWdoLCByTG93LCB3aW5kb3dfMjMyXzgsIHBPdmVyZmxvdyk7Ci0gICAgICAgIC8qIExhZyB3aW5kb3dpbmcgICAgKi8KLSAgICAgICAgTGFnX3dpbmRvdyhNLCBySGlnaCwgckxvdywgcE92ZXJmbG93KTsKLSAgICAgICAgLyogTGV2aW5zb24gRHVyYmluICAqLwotICAgICAgICBMZXZpbnNvbihzdC0+bGV2aW5zb25TdCwgckhpZ2gsIHJMb3csICZhW01QMSAqIDNdLCByYywgcE92ZXJmbG93KTsKLSAgICB9Ci0gICAgZWxzZQotICAgIHsKLSAgICAgICAgLyogQXV0b2NvcnJlbGF0aW9ucyAqLwotICAgICAgICBBdXRvY29ycih4LCBNLCBySGlnaCwgckxvdywgd2luZG93XzIwMF80MCwgcE92ZXJmbG93KTsKLSAgICAgICAgLyogTGFnIHdpbmRvd2luZyAgICAqLwotICAgICAgICBMYWdfd2luZG93KE0sIHJIaWdoLCByTG93LCBwT3ZlcmZsb3cpOwotICAgICAgICAvKiBMZXZpbnNvbiBEdXJiaW4gICovCi0gICAgICAgIExldmluc29uKHN0LT5sZXZpbnNvblN0LCBySGlnaCwgckxvdywgJmFbTVAxICogM10sIHJjLCBwT3ZlcmZsb3cpOwotICAgIH0KLQotfQotCi0KLQotCi0KLQotCi0KLQotCi0KLQotCi0KLQpkaWZmIC0tZ2l0IGEvbWVkaWEvbGlic3RhZ2VmcmlnaHQvY29kZWNzL2Ftcm5iL2VuYy9zcmMvbHBjLmggYi9tZWRpYS9saWJzdGFnZWZyaWdodC9jb2RlY3MvYW1ybmIvZW5jL3NyYy9scGMuaApkZWxldGVkIGZpbGUgbW9kZSAxMDA2NDQKaW5kZXggNzA1YTFkNC4uMDAwMDAwMAotLS0gYS9tZWRpYS9saWJzdGFnZWZyaWdodC9jb2RlY3MvYW1ybmIvZW5jL3NyYy9scGMuaAorKysgL2Rldi9udWxsC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3QsIC8qIGkvbyA6IFN0YXRlIHN0cnVjdCAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotICAgIHZhZFN0YXRlICp2YWRTdCwgICAgICAvKiBpL28gOiBWQUQgc3RhdGUgc3RydWN0ICAgICAgICAgICAgICAgICAgICAgICAgKi8KLSAgICBlbnVtIE1vZGUgbW9kZSwgICAgICAgLyogaSAgIDogY29kZXIgbW9kZSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0gICAgV29yZDE2IHdzcFtdLCAgICAgICAgIC8qIGkgICA6IHNpZ25hbCB1c2VkIHRvIGNvbXB1dGUgdGhlIE9MIHBpdGNoLCBRMCAqLwotICAgIC8qICAgICAgIHVzZXMgc2lnbmFsWy1waXRfbWF4XSB0byBzaWduYWxbLTFdICAgICAqLwotICAgIFdvcmQxNiAqVF9vcCwgICAgICAgICAvKiBvICAgOiBvcGVuIGxvb3AgcGl0Y2ggbGFnLCAgICAgICAgICAgICAgICAgUTAgKi8KLSAgICBXb3JkMTYgb2xkX2xhZ3NbXSwgICAgLyogaSAgIDogaGlzdG9yeSB3aXRoIG9sZCBzdG9yZWQgQ2wgbGFncyAgICAgICAgICovCi0gICAgV29yZDE2IG9sX2dhaW5fZmxnW10sIC8qIGkgICA6IE9MIGdhaW4gZmxhZyAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotICAgIFdvcmQxNiBpZHgsICAgICAgICAgICAvKiBpICAgOiBpbmRleCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLSAgICBGbGFnIGR0eCwgICAgICAgICAgICAgLyogaSAgIDogZHR4IGZsYWc7IHVzZSBkdHg9MSwgZG8gbm90IHVzZSBkdHg9MCAgICovCi0gICAgRmxhZyAqcE92ZXJmbG93ICAgICAgIC8qIGkvbyA6IG92ZXJmbG93IGluZGljYXRvciAgICAgICAgICAgICAgICAgICAgICAqLwotKQotewotICAgIGlmICgobW9kZSAhPSBNUjEwMikpCi0gICAgewotICAgICAgICBvbF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S0tLS0tLS0tLQotIENBVVRJT04gW29wdGlvbmFsXQotIFtTdGF0ZSBhbnkgc3BlY2lhbCBub3RlcywgY29uc3RyYWludHMgb3IgY2F1dGlvbnMgZm9yIHVzZXJzIG9mIHRoaXMgZnVuY3Rpb25dCi0KLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLQotKi8KLQotc3RhdGljIFdvcmQxNiBMYWdfbWF4KCAgLyogbyA6IGxhZyBmb3VuZCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotICAgIHZhZFN0YXRlICp2YWRTdCwgICAgLyogaS9vIDogVkFEIHN0YXRlIHN0cnVjdCAgICAgICAgICAgICAgICAgICAgICAqLwotICAgIFdvcmQzMiBjb3JyW10sICAgICAgLyogaSAgIDogY29ycmVsYXRpb24gdmVjdG9yLiAgICAgICAgICAgICAgICAgICAqLwotICAgIFdvcmQxNiBzY2FsX3NpZ1tdLCAgLyogaSA6IHNjYWxlZCBzaWduYWwuICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotICAgIFdvcmQxNiBMX2ZyYW1lLCAgICAgLyogaSA6IGxlbmd0aCBvZiBmcmFtZSB0byBjb21wdXRlIHBpdGNoICAgICAgICAqLwotICAgIFdvcmQxNiBsYWdfbWF4LCAgICAgLyogaSA6IG1heGltdW0gbGFnICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotICAgIFdvcmQxNiBsYWdfbWluLCAgICAgLyogaSA6IG1pbmltdW0gbGFnICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotICAgIFdvcmQxNiBvbGRfbGFnLCAgICAgLyogaSA6IG9sZCBvcGVuLWxvb3AgbGFnICAgICAgICAgICAgICAgICAgICAgICAqLwotICAgIFdvcmQxNiAqY29yX21heCwgICAgLyogbyA6IG5vcm1hbGl6ZWQgY29ycmVsYXRpb24gb2Ygc2VsZWN0ZWQgbGFnICAqLwotICAgIFdvcmQxNiB3Z2h0X2ZsZywgICAgLyogaSA6IGlzIHdlaWdodGluZyBmdW5jdGlvbiB1c2VkICAgICAgICAgICAgICAqLwotICAgIFdvcmQxNiAqZ2Fpbl9mbGcsICAgLyogbyA6IG9wZW4tbG9vcCBmbGFnICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotICAgIEZsYWcgZHR4LCAgICAgICAgICAgLyogaSA6IGR0eCBmbGFnOyB1c2UgZHR4PTEsIGRvIG5vdCB1c2UgZHR4PTAgICAqLwotICAgIEZsYWcgICAqcE92ZXJmbG93ICAgLyogbyA6IG92ZXJmbG93IGZsYWcgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotKQotewotICAgIFdvcmQxNiBpOwotICAgIFdvcmQxNiBqOwotICAgIFdvcmQxNiAqcDsKLSAgICBXb3JkMTYgKnAxOwotICAgIFdvcmQzMiBtYXg7Ci0gICAgV29yZDMyIHQwOwotICAgIFdvcmQxNiB0MF9oOwotICAgIFdvcmQxNiB0MF9sOwotICAgIFdvcmQxNiBwX21heDsKLSAgICBjb25zdCBXb3JkMTYgKnd3OwotICAgIGNvbnN0IFdvcmQxNiAqd2U7Ci0gICAgV29yZDMyIHQxOwotICAgIFdvcmQxNiB0ZW1wOwotCi0gICAgd3cgPSAmY29ycndlaWdodFsyNTBdOwotICAgIHdlID0gJmNvcnJ3ZWlnaHRbMTIzICsgbGFnX21heCAtIG9sZF9sYWddOwotCi0gICAgbWF4ID0gTUlOXzMyOwotICAgIHBfbWF4ID0gbGFnX21heDsKLQotICAgIGZvciAoaSA9IGxhZ19tYXg7IGkgPj0gbGFnX21pbjsgaS0tKQotICAgIHsKLSAgICAgICAgdDAgPSBjb3JyWy1pXTsKLQotICAgICAgICAvKiBXZWlnaHRpbmcgb2YgdGhlIGNvcnJlbGF0aW9uIGZ1bmN0aW9uLiAgICovCi0gICAgICAgIExfRXh0cmFjdChjb3JyWy1pXSwgJnQwX2gsICZ0MF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AgICAgICAgICAqLwotICAgIFdvcmQxNiBMX2ZyYW1lLCAgICAgICAvKiBpICAgOiBsZW5ndGggb2YgZnJhbWUgdG8gY29tcHV0ZSBwaXRjaCAgICAgICAgICAgICAgICovCi0gICAgV29yZDE2IG9sZF9sYWdzW10sICAgIC8qIGkgICA6IGhpc3Rvcnkgd2l0aCBvbGQgc3RvcmVkIENsIGxhZ3MgICAgICAgICAgICAgICAgKi8KLSAgICBXb3JkMTYgb2xfZ2Fpbl9mbGdbXSwgLyogaSAgIDogT0wgZ2FpbiBmbGFnICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotICAgIFdvcmQxNiBpZHgsICAgICAgICAgICAvKiBpICAgOiBpbmRleCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0gICAgRmxhZyBkdHgsICAgICAgICAgICAgIC8qIGkgICA6IGR0eCBmbGFnOyB1c2UgZHR4PTEsIGRvIG5vdCB1c2UgZHR4PTAgICAgICAgICAgKi8KLSAgICBGbGFnICAgKnBPdmVyZmxvdyAgICAgLyogbyAgIDogb3ZlcmZsb3cgZmxhZyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotKQotewotICAgIFdvcmQxNiBpOwotICAgIFdvcmQxNiBtYXgxOwotICAgIFdvcmQxNiBwX21heDE7Ci0gICAgV29yZDMyIHQwOwotI2lmbmRlZiBWQUQyCi0gICAgV29yZDE2IGNvcnJfaHBfbWF4OwotI2VuZGlmCi0gICAgV29yZDMyIGNvcnJbUElUX01BWCsxXSwgKmNvcnJfcHRyOwotCi0gICAgLyogU2NhbGVkIHNpZ25hbCAqLwotICAgIFdvcmQxNiBzY2FsZWRfc2lnbmFsW1BJVF9NQVggKyBMX0ZSQU1FXTsKLSAgICBXb3JkMTYgKnNjYWxfc2lnOwotCi0gICAgc2NhbF9zaWcgPSAmc2NhbGVkX3NpZ25hbFtwaXRfbWF4XTsKLQotICAgIHQwID0gMEw7Ci0gICAgZm9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LSAgICAvLyBsb29wIGZvciBldmVyeSBwb3NzaWJsZSBwZXJpb2QKLQotICAgIGZvciAoaSA9IHRfbWluOyBpIDw9IHRfbWF4OyBpKyspIHsKLSAgICAgICAgLy8gQ29tcHV0ZSAxL3NxcnQoZW5lcmd5IG9mIGV4Y2ZbXSkKLQotICAgICAgICBzID0gMDsKLSAgICAgICAgZm9yIChqID0gMDsgaiA8IExfc3ViZnI7IGorKykgewotICAgICAgICAgICAgcyA9IExfbWFjIChzLCBzX2V4Y2Zbal0sIHNfZXhjZltqXSk7Ci0gICAgICAgIH0KLQotICAgICAgICBzID0gSW52X3NxcnQgKHMpOwotICAgICAgICBMX0V4dHJhY3QgKHMsICZub3JtX2gsICZub3JtX2wpOwotCi0gICAgICAgIC8vIENvbXB1dGUgY29ycmVsYXRpb24gYmV0d2VlbiB4bltdIGFuZCBleGNmW10KLQotICAgICAgICBzID0gMDsKLSAgICAgICAgZm9yIChqID0gMDsgaiA8IExfc3ViZnI7IGorKykgewotICAgICAgICAgICAgcyA9IExfbWFjIChzLCB4bltqXSwgc19leGNmW2pdKTsKLSAgICAgICAgfQotICAgICAgICBMX0V4dHJhY3QgKHMsICZjb3JyX2gsICZjb3JyX2wpOwotCi0gICAgICAgIC8vIE5vcm1hbGl6ZSBjb3JyZWxhdGlvbiA9IGNvcnJlbGF0aW9uICogKDEvc3FydChlbmVyZ3kpKQotCi0gICAgICAgIHMgPSBNcHlfMzIgKGNvcnJfaCwgY29ycl9sLCBub3JtX2gsIG5vcm1fbCk7Ci0KLSAgICAgICAgY29ycl9ub3JtW2ldID0gZXh0cmFjdF9oIChMX3NobCAocywgMTYpKTsKLQotICAgICAgICAgICAgLy8gbW9kaWZ5IHRoZSBmaWx0ZXJlZCBleGNpdGF0aW9uIGV4Y2ZbXSBmb3IgdGhlIG5leHQgaXRlcmF0aW9uCi0KLSAgICAgICAgaWYgKHN1YiAoaSwgdF9tYXgpICE9IDApIHsKLSAgICAgICAgICAgIGstLTsKLSAgICAg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GNmOwotICAgICAgICBoX2ZhYyA9IDE0OwotICAgICAgICBzY2FsaW5nID0gMjsKLSAgICB9Ci0KLSAgICAvKiBsb29wIGZvciBldmVyeSBwb3NzaWJsZSBwZXJpb2QgKi8KLQotICAgIGZvciAoaSA9IHRfbWluOyBpIDw9IHRfbWF4OyBpKyspCi0gICAgewotICAgICAgICAvKiBDb21wdXRlIDEvc3FydChlbmVyZ3kgb2YgZXhjZltdKSAqLwotCi0gICAgICAgIHMgICA9IHMyID0gMDsKLSAgICAgICAgcF94ICAgICAgPSB4bjsKLSAgICAgICAgcF9zX2V4Y2YgPSBzX2V4Y2Y7Ci0gICAgICAgIGogICAgICAgID0gTF9zdWJmciA+PiAxOwotCi0gICAgICAgIHdoaWxlIChqLS0pCi0gICAgICAgIHsKLSAgICAgICAgICAgIHMgICs9IChXb3JkMzIpICogKHBfeCsrKSAqICoocF9zX2V4Y2YpOwotICAgICAgICAgICAgczIgKz0gKChXb3JkMzIpKCoocF9zX2V4Y2YpKSAqICgqKHBfc19leGNmKSkpOwotICAgICAgICAgICAgcF9zX2V4Y2YrKzsKLSAgICAgICAgICAgIHMgICs9IChXb3JkMzIpICogKHBfeCsrKSAqICoocF9zX2V4Y2YpOwotICAgICAgICAgICAgczIgKz0gKChXb3JkMzIpKCoocF9zX2V4Y2YpKSAqICgqKHBfc19leGNmKSkpOwotICAgICAgICAgICAgcF9zX2V4Y2YrKzsKLSAgICAgICAgfQotCi0gICAgICAgIHMyICAgICA9IHMyIDw8IDE7Ci0gICAgICAgIHMyICAgICA9IEludl9zcXJ0KHMyLCBwT3ZlcmZsb3cpOwotICAgICAgICBub3JtX2ggPSAoV29yZDE2KShzMiA+PiAxNik7Ci0gICAgICAgIG5vcm1fbCA9IChXb3JkMTYpKChzMiA+PiAxKSAtIChub3JtX2ggPDwgMTUpKTsKLSAgICAgICAgY29ycl9oID0gKFdvcmQxNikocyA+PiAxNSk7Ci0gICAgICAgIGNvcnJfbCA9IChXb3JkMTYpKChzKSAtIChjb3JyX2ggPDwgMTUpKTsKLQotICAgICAgICAvKiBOb3JtYWxpemUgY29ycmVsYXRpb24gPSBjb3JyZWxhdGlvbiAqICgxL3NxcnQoZW5lcmd5KSkgKi8KLQotICAgICAgICBzID0gTXB5XzMyKGNvcnJfaCwgY29ycl9sLCBub3JtX2gsIG5vcm1fbCwgcE92ZXJmbG93KTsKLQotICAgICAgICBjb3JyX25vcm1baV0gPSAoV29yZDE2KSBzIDsKLQotICAgICAgICAvKiBtb2RpZnkgdGhlIGZpbHRlcmVkIGV4Y2l0YXRpb24gZXhjZltdIGZvciB0aGUgbmV4dCBpdGVyYXRpb24gKi8KLSAgICAgICAgaWYgKGkgIT0gdF9tYXgpCi0gICAgICAgIHsKLSAgICAgICAgICAgIGstLTsKLSAgICAgICAgICAgIHRlbXAgPSBleGNba107Ci0gICAgICAgICAgICBwX3NfZXhjZiA9ICZzX2V4Y2ZbTF9zdWJmciAtIDFdOwotICAgICAgICAgICAgcF9oID0gJmhbTF9zdWJmciAtIDFdOwotCi0gICAgICAgICAgICBwX2V4Y2YgPSAmc19leGNmW0xfc3ViZnIgLSAyXTsKLSAgICAgICAgICAgIGZvciAoaiA9IChMX3N1YmZyIC0gMSkgPj4gMTsgaiAhPSAwOyBqLS0pCi0gICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgcyA9ICgoV29yZDMyKSB0ZW1wICogKihwX2gtLSkpID4+IGhfZmFjOwotICAgICAgICAgICAgICAgICoocF9zX2V4Y2YtLSkgPSAoV29yZDE2KSBzICArICoocF9leGNmLS0pOwotICAgICAgICAgICAgICAgIHMgPSAoKFdvcmQzMikgdGVtcCAqICoocF9oLS0pKSA+PiBoX2ZhYzsKLSAgICAgICAgICAgICAgICAqKHBfc19leGNmLS0pID0gKFdvcmQxNikgcyAgKyAqKHBfZXhjZi0tKTsKLSAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgcyA9ICgoV29yZDMyKSB0ZW1wICogKihwX2gpKSA+PiBoX2ZhY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Y2ggICAgICAgICAgICovCi0gICAgV29yZDE2ICpmcmFjLCAgICAgIC8qIGkvbyA6IHN0YXJ0IHBvaW50IG9mIHNlYXJjaCAtCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZyYWN0aW9uYWwgcGl0Y2ggICAgICAgICovCi0gICAgV29yZDE2IGxhc3RfZnJhYywgIC8qIGkgICA6IGVuZHBvaW50IG9mIHNlYXJjaCAgICAgICovCi0gICAgV29yZDE2IGNvcnJbXSwgICAgIC8qIGkgICA6IG5vcm1hbGl6ZWQgY29ycmVsYXRpb24gICovCi0gICAgV29yZDE2IGZsYWczLCAgICAgIC8qIGkgICA6IHN1YnNhbXBsZSByZXNvbHV0aW9uCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICgzOiA9MSAvIDY6ID0wKSAgICAgICAgICovCi0gICAgRmxhZyAgICpwT3ZlcmZsb3cKLSkKLXsKLSAgICBXb3JkMTYgaTsKLSAgICBXb3JkMTYgbWF4OwotICAgIFdvcmQxNiBjb3JyX2ludDsKLQotICAgIC8qIFRlc3QgdGhlIGZyYWN0aW9ucyBhcm91bmQgVDAgYW5kIGNob29zZSB0aGUgb25lIHdoaWNoIG1heGltaXplcyAgICovCi0gICAgLyogdGhlIGludGVycG9sYXRlZCBub3JtYWxpemVkIGNvcnJlbGF0aW9uLiAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLQotICAgIG1heCA9IEludGVycG9sXzNvcjYoJmNvcnJbKmxhZ10sICpmcmFjLCBmbGFnMywgcE92ZXJmbG93KTsKLSAgICAvKiBmdW5jdGlvbiByZXN1bHQgKi8KLQotICAgIGZvciAoaSA9ICpmcmFjICsgMTsgaSA8PSBsYXN0X2ZyYWM7IGkrKykKLSAgICB7Ci0gICAgICAgIGNvcnJfaW50ID0gSW50ZXJwb2xfM29yNigmY29yclsqbGFnXSwgaSwgZmxhZzMsIHBPdmVyZmxvdyk7Ci0gICAgICAgIGlmIChjb3JyX2ludCA+IG1heCkKLSAgICAgICAgewotICAgICAgICAgICAgbWF4ID0gY29ycl9pbnQ7Ci0gICAgICAgICAgICAqZnJhYyA9IGk7Ci0gICAgICAgIH0KLSAgICB9Ci0KLSAgICBpZiAoZmxhZzMgPT0gMCkKLSAgICB7Ci0gICAgICAgIC8qIExpbWl0IHRoZSBmcmFjdGlvbiB2YWx1ZSBpbiB0aGUgaW50ZXJ2YWwgWy0yLC0xLDAsMSwyLDNdICovCi0KLSAgICAgICAgaWYgKCpmcmFjID09IC0zKQotICAgICAgICB7Ci0gICAgICAgICAgICAqZnJhYyA9IDM7Ci0gICAgICAgICAgICAoKmxhZyktLTsKLSAgICAgICAgfQotICAgIH0KLSAgICBlbHNlCi0gICAgewotICAgICAgICAvKiBsaW1pdCB0aGUgZnJhY3Rpb24gdmFsdWUgYmV0d2VlbiAtMSBhbmQgMSAqLwotCi0gICAgICAgIGlmICgqZnJhYyA9PSAtMikKLSAgICAgICAgewotICAgICAgICAgICAgKmZyYWMgPSAxOwotICAgICAgICAgICAgKCpsYWcpLS07Ci0gICAgICAgIH0KLSAgICAgICAgaWYgKCpmcmFjID09IDIpCi0gICAgICAgIHsKLSAgICAgICAgICAgICpmcmFjID0gLTE7Ci0gICAgICAgICAgICAoKmxhZykrKzsKLSAgICAgICAgfQotICAgIH0KLX0KLQotLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0KLQotLyoKLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLQotIEZVTkNUSU9OIE5BTUU6IGdldFJhbmdlCi0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0KLSBJTlBVVCBBTkQg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0YXRlICpzdCwgICAvKiBpL28gOiBTdGF0ZSBzdHJ1Y3QgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotICAgIGVudW0gTW9kZSBtb2RlLCAgICAgIC8qIGkgICA6IGNvZGVjIG1vZGUgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0gICAgV29yZDE2IFRfb3BbXSwgICAgICAgLyogaSAgIDogb3BlbiBsb29wIHBpdGNoIGxhZ3MgICAgICAgICAgICAgICAgICAgICAgKi8KLSAgICBXb3JkMTYgZXhjW10sICAgICAgICAvKiBpICAgOiBleGNpdGF0aW9uIGJ1ZmZlciAgICAgICAgICAgICAgICAgICAgICBRMCAqLwotICAgIFdvcmQxNiB4bltdLCAgICAgICAgIC8qIGkgICA6IHRhcmdldCB2ZWN0b3IgICAgICAgICAgICAgICAgICAgICAgICAgIFEwICovCi0gICAgV29yZDE2IGhbXSwgICAgICAgICAgLyogaSAgIDogaW1wdWxzZSByZXNwb25zZSBvZiBzeW50aGVzaXMgYW5kCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgd2VpZ2h0aW5nIGZpbHRlcnMgICAgICAgICAgICAgICAgICAgICBRMTIgKi8KLSAgICBXb3JkMTYgTF9zdWJmciwgICAgICAvKiBpICAgOiBMZW5ndGggb2Ygc3ViZnJhbWUgICAgICAgICAgICAgICAgICAgICAgICAqLwotICAgIFdvcmQxNiBpX3N1YmZyLCAgICAgIC8qIGkgICA6IHN1YmZyYW1lIG9mZnNldCAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0gICAgV29yZDE2ICpwaXRfZnJhYywgICAgLyogbyAgIDogcGl0Y2ggcGVyaW9kIChmcmFjdGlvbmFsKSAgICAgICAgICAgICAgICAgKi8KLSAgICBXb3JkMTYgKnJlc3UzLCAgICAgICAvKiBvICAgOiBzdWJzYW1wbGUgcmVzb2x1dGlvbiAxLzMgKD0xKSBvciAxLzYgKD0wKSAqLwotICAgIFdvcmQxNiAqYW5hX2luZG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AgICAgICAgICAgIC8qIGxpbWl0IHNlYXJjaCBhcm91bmQgVDAgdG8gdGhlIHJpZ2h0IHNpZGUgKi8KLSAgICAgICAgICAgICAgICBmcmFjID0gMDsKLSAgICAgICAgICAgICAgICBzZWFyY2hGcmFjKCZsYWcsICZmcmFjLCBsYXN0X2ZyYWMsIGNvcnIsIGZsYWczLCBwT3ZlcmZsb3cpOwotICAgICAgICAgICAgfQotICAgICAgICAgICAgZWxzZSBpZiAobGFnID09ICh0bXBfbGFnICsgMSkpCi0gICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgLyogbGltaXQgc2VhcmNoIGFyb3VuZCBUMCB0byB0aGUgbGVmdCBzaWRlICovCi0gICAgICAgICAgICAgICAgbGFzdF9mcmFjID0gMDsKLSAgICAgICAgICAgICAgICBzZWFyY2hGcmFjKCZsYWcsICZmcmFjLCBsYXN0X2ZyYWMsIGNvcnIsIGZsYWczLCBwT3ZlcmZsb3cpOwotICAgICAgICAgICAgfQotICAgICAgICAgICAgZWxzZQotICAgICAgICAgICAgewotICAgICAgICAgICAgICAgIC8qIG5vIGZyYWN0aW9uYWwgc2VhcmNoICovCi0gICAgICAgICAgICAgICAgZnJhYyA9IDA7Ci0gICAgICAgICAgICB9Ci0gICAgICAgIH0KLSAgICAgICAgZWxzZQotICAgICAgICAgICAgLyogdGVzdCB0aGUgZnJhY3Rpb25zIGFyb3VuZCBUMCAqLwotICAgICAgICAgICAgc2VhcmNoRnJhYygmbGFnLCAmZnJhYywgbGFzdF9mcmFjLCBjb3JyLCBmbGFnMywgcE92ZXJmbG93KTsKLSAgICB9Ci0KLSAgICAvKi0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tKgotICAgICAqICAgICAgICAgICAgICAgICAgICAgICAgICAgZW5jb2RlIHBpdGNoICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqCi0gICAgIC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uIGZyZWUgc3RhdHVzIHN0cnVjdCkKLSAgICAgICBzdG9yZXMgTlVMTCBpbiAqc3QKLSAgICAgKi8KLQotICAgIFdvcmQxNiBQaXRjaF9mciggICAgICAgICAvKiBvICAgOiBwaXRjaCBwZXJpb2QgKGludGVnZXIpICAgICAgICAgICAgICAgICAgICAqLwotICAgICAgICBQaXRjaF9mclN0YXRlICpzdCwgICAvKiBpL28gOiBTdGF0ZSBzdHJ1Y3QgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotICAgICAgICBlbnVtIE1vZGUgbW9kZSwgICAgICAvKiBpICAgOiBjb2RlYyBtb2RlICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotICAgICAgICBXb3JkMTYgVF9vcFtdLCAgICAgICAvKiBpICAgOiBvcGVuIGxvb3AgcGl0Y2ggbGFncyAgICAgICAgICAgICAgICAgICAgICAqLwotICAgICAgICBXb3JkMTYgZXhjW10sICAgICAgICAvKiBpICAgOiBleGNpdGF0aW9uIGJ1ZmZlciAgICAgICAgICAgICAgICAgICAgICAgICAqLwotICAgICAgICBXb3JkMTYgeG5bXSwgICAgICAgICAvKiBpICAgOiB0YXJnZXQgdmVjdG9yICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotICAgICAgICBXb3JkMTYgaFtdLCAgICAgICAgICAvKiBpICAgOiBpbXB1bHNlIHJlc3BvbnNlIG9mIHN5bnRoZXNpcyBhbmQKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB3ZWlnaHRpbmcgZmlsdGVycyAgICAgICAgICAgICAgICAgICAgICAgICAqLwotICAgICAgICBXb3JkMTYgTF9zdWJmciwgICAgICAvKiBpICAgOiBMZW5ndGggb2Ygc3ViZnJhbWUgICAgICAgICAgICAgICAgICAgICAgICAqLwotICAgICAgICBXb3JkMTYgaV9zdWJmciwgICAgICAvKiBpICAgOiBzdWJmcmFtZSBvZmZzZXQgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotICAgICAg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cmQxNiBzY2FsX3NpZ1tdLCAgLyogaSAgIDogc2NhbGVkIHNpZ25hbC4gICAgICAgICAgICAgICAgICAgICAgICAgICovCi0gICAgV29yZDE2IHNjYWxfZmFjLCAgICAvKiBpICAgOiBzY2FsZWQgc2lnbmFsIGZhY3Rvci4gICAgICAgICAgICAgICAgICAgKi8KLSAgICBXb3JkMTYgc2NhbF9mbGFnLCAgIC8qIGkgICA6IGlmIDEgdXNlIEVGUiBjb21wYXRpYmxlIHNjYWxpbmcgICAgICAgICAqLwotICAgIFdvcmQxNiBMX2ZyYW1lLCAgICAgLyogaSAgIDogbGVuZ3RoIG9mIGZyYW1lIHRvIGNvbXB1dGUgcGl0Y2ggICAgICAgICovCi0gICAgV29yZDE2IGxhZ19tYXgsICAgICAvKiBpICAgOiBtYXhpbXVtIGxhZyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLSAgICBXb3JkMTYgbGFnX21pbiwgICAgIC8qIGkgICA6IG1pbmltdW0gbGFnICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotICAgIFdvcmQxNiAqY29yX21heCwgICAgLyogbyAgIDogbm9ybWFsaXplZCBjb3JyZWxhdGlvbiBvZiBzZWxlY3RlZCBsYWcgICovCi0gICAgV29yZDMyICpybWF4LCAgICAgICAvKiBvICAgOiBtYXgoPHNbaV0qc1tqXT4pICAgICAgICAgICAgICAgICAgICAgICAgKi8KLSAgICBXb3JkMzIgKnIwLCAgICAgICAgIC8qIG8gICA6IHJlc2lkdWFsIGVuZXJneSAgICAgICAgICAgICAgICAgICAgICAgICAqLwotICAgIEZsYWcgZHR4LCAgICAgICAgICAgLyogaSAgIDogZHR4IGZsYWc7IHVzZSBkdHg9MSwgZG8gbm90IHVzZSBkdHg9MCAgICovCi0gICAgRmxhZyAqcE92ZXJmbG93ICAgICAvKiBpL28gOiBvdmVyZmxvdyBGbGFnICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLSkKLSNlbHNlCi1zdGF0aWMgV29yZDE2IExhZ19tYXgoICAvKiBvICAgOiBsYWcgZm91bmQgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLSAgICB2YWRTdGF0ZSAqdmFkU3QsICAgIC8qIGkvbyA6IFZBRCBzdGF0ZSBzdHJ1Y3QgICAgICAgICAgICAgICAgICAgICAgICAqLwotICAgIFdvcmQzMiBjb3JyW10sICAgICAgLyogaSAgIDogY29ycmVsYXRpb24gdmVjdG9yLiAgICAgICAgICAgICAgICAgICAgICovCi0gICAgV29yZDE2IHNjYWxfc2lnW10sICAvKiBpICAgOiBzY2FsZWQgc2lnbmFsLiAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLSAgICBXb3JkMTYgc2NhbF9mYWMsICAgIC8qIGkgICA6IHNjYWxlZCBzaWduYWwgZmFjdG9yLiAgICAgICAgICAgICAgICAgICAqLwotICAgIFdvcmQxNiBzY2FsX2ZsYWcsICAgLyogaSAgIDogaWYgMSB1c2UgRUZSIGNvbXBhdGlibGUgc2NhbGluZyAgICAgICAgICovCi0gICAgV29yZDE2IExfZnJhbWUsICAgICAvKiBpICAgOiBsZW5ndGggb2YgZnJhbWUgdG8gY29tcHV0ZSBwaXRjaCAgICAgICAgKi8KLSAgICBXb3JkMTYgbGFnX21heCwgICAgIC8qIGkgICA6IG1heGltdW0gbGFnICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotICAgIFdvcmQxNiBsYWdfbWluLCAgICAgLyogaSAgIDogbWluaW11bSBsYWcgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0gICAgV29yZDE2ICpjb3JfbWF4LCAgICAvKiBvICAgOiBub3JtYWxpemVkIGNvcnJlbGF0aW9uIG9mIHNlbGVjdGVkIGxhZyAgKi8KLSAgICBGbGFnIGR0eCwgICAgICAgICAgIC8qIGkgICA6IGR0eCBmbGFnOyB1c2UgZHR4PTEsIGRvIG5vdCB1c2UgZHR4PTAgICAqLwotICAgIEZsYWcgKnBPdmVyZmxvdyAgICAgLyogaS9vIDogb3ZlcmZsb3cgRmxhZyAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0pCi0jZW5kaWYKLXsKLSAgICByZWdpc3RlciBXb3JkMTYgaTsKLSAgICBXb3JkMTYgKnA7Ci0gICAgV29yZDMyIG1heDsKLSAgICBXb3JkMzIgdDA7Ci0gICAgV29yZDE2IG1heF9oOwotICAgIFdvcmQxNiBtYXhfbDsKLSAgICBXb3JkMTYgZW5lcl9oOwotICAgIFdvcmQxNiBlbmVyX2w7Ci0gICAgV29yZDE2IHBfbWF4ID0gMDsgLyogaW5pdGlhbGl6YXRpb24gb25seSBuZWVkZWQgdG8ga2VlcCBnY2Mgc2lsZW50ICovCi0gICAgV29yZDMyIExfdGVtcDsKLSAgICBXb3JkMzIgTF90ZW1wXzI7Ci0gICAgV29yZDMyIExfdGVtcF8zOwotICAgIFdvcmQzMiAgKnBfY29yciA9ICZjb3JyWy1sYWdfbWF4XTsKLQotICAgIG1heCA9IE1JTl8zMjsKLSAgICBwX21heCA9IGxhZ19tYXg7Ci0KLSAgICBmb3IgKGkgPSBsYWdfbWF4OyBpID49IGxhZ19taW47IGktLSkKLSAgICB7Ci0gICAgICAgIC8qIFRoZSBuZWdhdGl2ZSBhcnJheSBpbmRleCBpcyBlcXVpdmFsZW50IHRvIGEgbmVnYXRpdmUgKi8KLSAgICAgICAgLyogYWRkcmVzcyBvZmZzZXQsIGkuZS4sIGNvcnJbLWldID09ICooY29yciAtIGkpICAgICAgICAqLwotICAgICAgICBpZiAoKihwX2NvcnIrKykgPj0gbWF4KQotICAgICAgICB7Ci0gICAgICAgICAgICBwX2NvcnItLTsKLSAgICAgICAgICAgIG1heCA9ICoocF9jb3JyKyspOwotICAgICAgICAgICAgcF9tYXggPSBpOwotICAgICAgICB9Ci0gICAgfQotCi0gICAgLyogY29tcHV0ZSBlbmVyZ3kgKi8KLQotICAgIHQwID0gMDsKLQotICAgIC8qIFRoZSBuZWdhdGl2ZSBhcnJheSBpbmRleCBpcyBlcXVpdmFsZW50IHRvIGEgbmVnYXRpdmUgICAgICAgICAgKi8KLSAgICAvKiBhZGRyZXNzIG9mZnNldCwgaS5lLiwgc2NhbF9zaWdbLXBfbWF4XSA9PSAqKHNjYWxfc2lnIC0gcF9tYXgpICovCi0gICAgcCA9ICZzY2FsX3NpZ1stcF9tYXhdOwotICAgIGZvciAoaSA9IChMX2ZyYW1lID4+IDIpOyBpICE9IDA7IGktLSkKLSAgICB7Ci0gICAgICAgIHQwID0gYW1ybmJfZnhwX21hY18xNl9ieV8xNmJiKChXb3JkMzIpICogKHApLCAoV29yZDMyKSAqIChwKSwgdDApOwotICAgICAgICBwKys7Ci0gICAgICAgIHQwID0gYW1ybmJfZnhwX21hY18xNl9ieV8xNmJiKChXb3JkMzIpICogKHApLCAoV29yZDMyKSAqIChwKSwgdDApOwotICAgICAgICBwKys7Ci0gICAgICAgIHQwID0gYW1ybmJfZnhwX21hY18xNl9ieV8xNmJiKChXb3JkMzIpICogKHApLCAoV29yZDMyKSAqIChwKSwgdDApOwotICAgICAgICBwKys7Ci0gICAgICAgIHQwID0gYW1ybmJfZnhwX21hY18xNl9ieV8xNmJiKChXb3JkMzIpICogKHApLCAoV29yZDMyKSAqIChwKSwgdDApOwotICAgICAgICBwKys7Ci0gICAgfQotCi0gICAgdDAgPDw9IDE7Ci0gICAgLyogMS9zcXJ0KGVuZXJneSkgKi8KLQotICAgIGlmIChkdHgpCi0gICAgeyAgLyogbm8gdGVzdCgpIGNhbGwgc2luY2UgdGhpcyBpZiBpcyBvbmx5IGluIHNpbXVsYXRpb24gZW52ICovCi0gICAgICAgIC8qIGNoZWNrIHRvbmUgKi8KLSNpZmRlZiBWQUQyCi0gICAgICAgICpybWF4ID0gbWF4OwotICAgICAgICAqcjAgPSB0MDsKLSNlbHNlCi0gICAgICAgIC8qIGNoZWNrIHRvbmUgKi8KLSAgICAgICAgdmFkX3RvbmVfZGV0ZWN0aW9uKHZhZFN0LCBtYXgsIHQwLCBwT3ZlcmZsb3cpOwotI2VuZGlmCi0gICAgfQotCi0gICAgdDAgPSBJbnZfc3FydCh0MCwgcE92ZXJmbG93KTsKLQotICAgIGlmIChzY2FsX2ZsYWcpCi0gICAgewotICAgICAgICBpZiAodDAgPiAoV29yZDMyKSAweDNmZmZmZmZmTCkKLSAgICAgICAgewotICAgICAgICAgICAgdDAgPSBNQVhfMzI7Ci0gICAgICAgIH0KLSAgICAgICAgZWxzZQotICAgICAgICB7Ci0gICAgICAgICAgICB0MCA9IHQwIDw8IDE7Ci0gICAgICAgIH0KLSAgICB9Ci0KLSAgICAvKiBtYXggPSBtYXgvc3FydChlbmVyZ3kpICAqLwotICAgIC8qIFRoZSBmb2xsb3dpbmcgY29kZSBpcyBhbiBpbmxpbmVkIHZlcnNpb24gb2YgKi8KLSAgICAvKiBMX0V4dHJhY3QgKG1heCwgJm1heF9oLCAmbWF4X2wpLCBpLmUuICAgICAgICovCi0gICAgLyogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotICAgIC8qICptYXhfaCA9IGV4dHJhY3RfaCAobWF4KTsgICAgICAgICAgICAgICAgICAgKi8KLSAgICBtYXhfaCA9IChXb3JkMTYpKG1heCA+PiAxNik7Ci0KLSAgICAvKiBMX3RlbXBfMiA9IExfc2hyKG1heCwxKSwgd2hpY2ggaXMgdXNlZCBpbiAgICAgICovCi0gICAgLyogdGhlIGNhbGN1bGF0aW9uIG9mICptYXhfbCAoc2VlIG5leHQgb3BlcmF0aW9uKSAqLwotICAgIExfdGVtcF8yID0gbWF4ID4+IDE7Ci0KLSAgICAvKiAqbWF4X2wgPSBleHRyYWN0X2wgKExfbXN1IChMX3NociAobWF4LCAxKSwgKm1heF9oLCAxNjM4NCkpOyAqLwotICAgIExfdGVtcF8zID0gKFdvcmQzMikobWF4X2ggPDwgMTUpOwotCi0gICAgTF90ZW1wID0gTF90ZW1wXzIgLSBMX3RlbXBfMzsKLQotICAgIG1heF9sID0gKFdvcmQxNilMX3RlbXA7Ci0KLSAgICAvKiBUaGUgZm9sbG93aW5nIGNvZGUgaXMgYW4gaW5saW5lZCB2ZXJzaW9uIG9mICovCi0gICAgLyogTF9FeHRyYWN0ICh0MCwgJmVuZXJfaCwgJmVuZXJfbCksIGkuZS4gICAgICAqLwotICAgIC8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLSAgICAvKiAqZW5lcl9oID0gZXh0cmFjdF9oICh0MCk7ICAgICAgICAgICAgICAgICAgICovCi0gICAgZW5lcl9oID0gKFdvcmQxNikodDAgPj4gMTYpOwotCi0gICAgLyogTF90ZW1wXzIgPSBMX3Nocih0MCwxKSwgd2hpY2ggaXMgdXNlZCBpbiAgICAgICAgKi8KLSAgICAvKiB0aGUgY2FsY3VsYXRpb24gb2YgKmVuZXJfbCAoc2VlIG5leHQgb3BlcmF0aW9uKSAqLwotCi0gICAgTF90ZW1wXzIgPSB0MCA+PiAxOwotCi0gICAgTF90ZW1wXzMgPSAoV29yZDMyKShlbmVyX2ggPDwgMTUpOwotCi0gICAgTF90ZW1wID0gTF90ZW1wXzIgLSBMX3RlbXBfMzsKLQotICAgIGVuZXJfbCA9IChXb3JkMTYpTF90ZW1wOwotCi0gICAgdDAgPSBNcHlfMzIobWF4X2gsIG1heF9sLCBlbmVyX2gsIGVuZXJfbCwgcE92ZXJmbG93KTsKLQotICAgIGlmIChzY2FsX2ZsYWcpCi0gICAgewotICAgICAgICB0MCA9IExfc2hyKHQwLCBzY2FsX2ZhYywgcE92ZXJmbG93KTsKLQotICAgICAgICBpZiAodDAgPiAoV29yZDMyKSAwWDAwMDBGRkZGTCkKLSAgICAgICAgewotICAgICAgICAgICAgKmNvcl9tYXggPSBNQVhfMTY7Ci0gICAgICAgIH0KLSAgICAgICAgZWxzZSBpZiAodDAgPCAoV29yZDMyKSAweEZGRkYwMDAwTCkKLSAgICAgICAgewotICAgICAgICAgICAgKmNvcl9tYXggPSBNSU5fMTY7Ci0gICAgICAgIH0KLSAgICA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UUyBHU00gQU1SIHNwZWVjaCBjb2RlYywgUjk5IC0gVmVyc2lvbiAzLjIuMCwgTWFyY2ggMiwgMjAwMQotCi0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0KLSBQU0VVRE8tQ09ERQotCi0jaWZkZWYgVkFEMgotIENBTEwgTGFnX21heChjb3JyID0gY29ycgotICAgICAgICAgIHNjYWxfc2lnID0gc2NhbF9zaWcKLSAgICAgICAgICBzY2FsX2ZhYyA9IHNjYWxfZmFjCi0gICAgICAgICAgc2NhbF9mbGFnID0gc2NhbF9mbGFnCi0gICAgICAgICAgTF9mcmFtZSA9IExfZnJhbWUKLSAgICAgICAgICBsYWdfbWF4ID0gbGFnX21heAotICAgICAgICAgIGxhZ19taW4gPSBsYWdfbWluCi0gICAgICAgICAgY29yX21heCA9IGNvcl9tYXgKLSAgICAgICAgICBybWF4ID0gcm1heAotICAgICAgICAgIHIwID0gcjAKLSAgICAgICAgICBkdHggPSBkdHgKLSAgICAgICAgICBwT3ZlcmZsb3cgPSBwT3ZlcmZsb3cpCi0gICBNT0RJRllJTkcobm90aGluZykKLSAgIFJFVFVSTklORyh0ZW1wKQotCi0jZWxzZQotIENBTEwgTGFnX21heCh2YWRTdCA9IHZhZFN0Ci0gICAgICAgICAgY29yciA9IGNvcnIKLSAgICAgICAgICBzY2FsX3NpZyA9IHNjYWxfc2lnCi0gICAgICAgICAgc2NhbF9mYWMgPSBzY2FsX2ZhYwotICAgICAgICAgIHNjYWxfZmxhZyA9IHNjYWxfZmxhZwotICAgICAgICAgIExfZnJhbWUgPSBMX2ZyYW1lCi0gICAgICAgICAgbGFnX21heCA9IGxhZ19tYXgKLSAgICAgICAgICBsYWdfbWluID0gbGFnX21pbgotICAgICAgICAgIGNvcl9tYXggPSBjb3JfbWF4Ci0gICAgICAgICAgZHR4ID0gZHR4Ci0gICAg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VuY3Rpb25dCi0KLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLQotKi8KLQotI2lmZGVmIFZBRDIKLVdvcmQxNiBMYWdfbWF4X3dyYXBwZXIoICAvKiBvICAgOiBsYWcgZm91bmQgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0gICAgV29yZDMyIGNvcnJbXSwgICAgICAvKiBpICAgOiBjb3JyZWxhdGlvbiB2ZWN0b3IuICAgICAgICAgICAgICAgICAgICAgKi8KLSAgICBXb3JkMTYgc2NhbF9zaWdbXSwgIC8qIGkgICA6IHNjYWxlZCBzaWduYWwuICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotICAgIFdvcmQxNiBzY2FsX2ZhYywgICAgLyogaSAgIDogc2NhbGVkIHNpZ25hbCBmYWN0b3IuICAgICAgICAgICAgICAgICAgICovCi0gICAgV29yZDE2IHNjYWxfZmxhZywgICAvKiBpICAgOiBpZiAxIHVzZSBFRlIgY29tcGF0aWJsZSBzY2FsaW5nICAgICAgICAgKi8KLSAgICBXb3JkMTYgTF9mcmFtZSwgICAgIC8qIGkgICA6IGxlbmd0aCBvZiBmcmFtZSB0byBjb21wdXRlIHBpdGNoICAgICAgICAqLwotICAgIFdvcmQxNiBsYWdfbWF4LCAgICAgLyogaSAgIDogbWF4aW11bSBsYWcgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0gICAgV29yZDE2IGxhZ19taW4sICAgICAvKiBpICAgOiBtaW5pbXVtIGxhZyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLSAgICBXb3JkMTYgKmNvcl9tYXgsICAgIC8qIG8gICA6IG5vcm1hbGl6ZWQgY29ycmVsYXRpb24gb2Ygc2VsZWN0ZWQgbGFnICAqLwotICAgIFdvcmQzMiAqcm1heCwgICAgICAgLyogbyAgIDogbWF4KDxzW2ldKnNbal0+KSAgICAgICAgICAgICAgICAgICAgICAgICovCi0gICAgV29yZDMyICpyMCwgICAgICAgICAvKiBvICAgOiByZXNpZHVhbCBlbmVyZ3kgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLSAgICBGbGFnIGR0eCwgICAgICAgICAgIC8qIGkgICA6IGR0eCBmbGFnOyB1c2UgZHR4PTEsIGRvIG5vdCB1c2UgZHR4PTAgICAqLwotICAgIEZsYWcgKnBPdmVyZmxvdyAgICAgLyogaS9vIDogb3ZlcmZsb3cgRmxhZyAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0pCi17Ci0gICAgV29yZDE2IHRlbXA7Ci0KLSAgICB0ZW1wID0gTGFnX21heChjb3JyLCBzY2FsX3NpZywgc2NhbF9mYWMsIHNjYWxfZmxhZywgTF9mcmFtZSwgbGFnX21heCwKLSAgICAgICAgICAgICAgICAgICBsYWdfbWluLCBjb3JfbWF4LCBybWF4LCByMCwgZHR4LCBwT3ZlcmZsb3cpOwotCi0gICAgcmV0dXJuKHRlbXApOwotfQotCi0jZWxzZQotV29yZDE2IExhZ19tYXhfd3JhcHBlciggIC8qIG8gICA6IGxhZyBmb3VuZCAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLSAgICB2YWRTdGF0ZSAqdmFkU3QsICAgIC8qIGkvbyA6IFZBRCBzdGF0ZSBzdHJ1Y3QgICAgICAgICAgICAgICAgICAgICAgICAqLwotICAgIFdvcmQzMiBjb3JyW10sICAgICAgLyogaSAgIDogY29ycmVsYXRpb24gdmVjdG9yLiAgICAgICAgICAgICAgICAgICAgICovCi0gICAgV29yZDE2IHNjYWxfc2lnW10sICAvKiBpICAgOiBzY2FsZWQgc2lnbmFsLiAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLSAgICBXb3JkMTYgc2NhbF9mYWMsICAgIC8qIGkgICA6IHNjYWxlZCBzaWduYWwgZmFjdG9yLiAgICAgICAgICAgICAgICAgICAqLwotICAgIFdvcmQxNiBzY2FsX2ZsYWcsICAgLyogaSAgIDogaWYgMSB1c2UgRUZSIGNvbXBhdGlibGUgc2NhbGluZyAgICAgICAgICovCi0gICAgV29yZDE2IExfZnJhbWUsICAgICAvKiBpICAgOiBsZW5ndGggb2YgZnJhbWUgdG8gY29tcHV0ZSBwaXRjaCAgICAgICAgKi8KLSAgICBXb3JkMTYgbGFnX21heCwgICAgIC8qIGkgICA6IG1heGltdW0gbGFnICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotICAgIFdvcmQxNiBsYWdfbWluLCAgICAgLyogaSAgIDogbWluaW11bSBsYWcgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0gICAgV29yZDE2ICpjb3JfbWF4LCAgICAvKiBvICAgOiBub3JtYWxpemVkIGNvcnJlbGF0aW9uIG9mIHNlbGVjdGVkIGxhZyAgKi8KLSAgICBGbGFnIGR0eCwgICAgICAgICAgIC8qIGkgICA6IGR0eCBmbGFnOyB1c2UgZHR4PTEsIGRvIG5vdCB1c2UgZHR4PTAgICAqLwotICAgIEZsYWcgKnBPdmVyZmxvdyAgICAgLyogaS9vIDogb3ZlcmZsb3cgRmxhZyAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0pCi17Ci0gICAgV29yZDE2IHRlbXA7Ci0KLSAgICB0ZW1wID0gTGFnX21heCh2YWRTdCwgY29yciwgc2NhbF9zaWcsIHNjYWxfZmFjLCBzY2FsX2ZsYWcsIExfZnJhbWUsCi0gICAgICAgICAgICAgICAgICAgbGFnX21heCwgbGFnX21pbiwgY29yX21heCwgZHR4LCBwT3ZlcmZsb3cpOwotCi0gICAgcmV0dXJuKHRlbXApOwotfQotCi0jZW5kaWYKLQotLyotLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tCi07IEVuZCBGdW5jdGlvbjogTGFnX21heF93cmFwcGVyCi0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tL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UQyCi0gICAgaWYgKGR0eCkKLSAgICB7ICAgLyogbm8gdGVzdCgpIGNhbGwgc2luY2UgdGhpcyBpZiBpcyBvbmx5IGluIHNpbXVsYXRpb24gZW52ICovCi0gICAgICAgIC8qIHVwZGF0ZSB0b25lIGRldGVjdGlvbiAqLwotICAgICAgICBpZiAoKG1vZGUgPT0gTVI0NzUpIHx8IChtb2RlID09IE1SNTE1KSkKLSAgICAgICAgewotICAgICAgICAgICAgdmFkX3RvbmVfZGV0ZWN0aW9uX3VwZGF0ZSh2YWRTdCwgMSwgcE92ZXJmbG93KTsKLSAgICAgICAgfQotICAgICAgICBlbHNlCi0gICAgICAgIHsKLSAgICAgICAgICAgIHZhZF90b25lX2RldGVjdGlvbl91cGRhdGUodmFkU3QsIDAsIHBPdmVyZmxvdyk7Ci0gICAgICAgIH0KLSAgICB9Ci0jZW5kaWYKLQotCi0gICAgdDAgPSAwTDsKLSAgICBwX3NpZ25hbCA9ICZzaWduYWxbLXBpdF9tYXhdOwotCi0gICAgZm9yIChpID0gLXBpdF9tYXg7IGkgPCBMX2ZyYW1lOyBpKyspCi0gICAgewotICAgICAgICB0MCArPSAoKChXb3JkMzIpICogKHBfc2lnbmFsKSkgKiAqKHBfc2lnbmFsKSkgPDwgMTsKLSAgICAgICAgcF9zaWduYWwrKzsKLSAgICAgICAgaWYgKHQwIDwgMCkKLSAgICAgICAgewotICAgICAgICAgICAgdDAgPSBNQVhfMzI7Ci0gICAgICAgICAgICBicmVhazsKLSAgICAgICAgfQotCi0gICAgfQotCi0gICAgLyotLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSoKLSAgICAgKiBTY2FsaW5nIG9mIGlucHV0IHNpZ25hbC4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKgotICAgICAqICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqCi0gICAgICogICBp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UpICYgMSkKLSAgICAgICAgewotICAgICAgICAgICAgKihzY2FsX3NpZykgPSAoV29yZDE2KSgoKFdvcmQzMikgKiAocF9zaWduYWwpID4+IDMpKTsKLSAgICAgICAgfQotCi0gICAgICAgIHNjYWxfZmFjID0gMzsKLSAgICB9Ci0gICAgZWxzZSBpZiAodDAgPCAoV29yZDMyKTEwNDg1NzZMKQotICAgICAgICAvKiBpZiAodDAgPCAyXjIwKSAqLwotICAgIHsKLSAgICAgICAgZm9yIChpID0gKHBpdF9tYXggKyBMX2ZyYW1lKSA+PiAxOyBpICE9IDA7IGktLSkKLSAgICAgICAgewotICAgICAgICAgICAgKihzY2FsX3NpZysrKSA9IChXb3JkMTYpKCgoV29yZDMyKSAqIChwX3NpZ25hbCsrKSA8PCAzKSk7Ci0gICAgICAgICAgICAqKHNjYWxfc2lnKyspID0gKFdvcmQxNikoKChXb3JkMzIpICogKHBfc2lnbmFsKyspIDw8IDMpKTsKLSAgICAgICAgfQotCi0gICAgICAgIGlmICgocGl0X21heCArIExfZnJhbWUpICYgMSkKLSAgICAgICAgewotICAgICAgICAgICAgKihzY2FsX3NpZykgPSAoV29yZDE2KSgoKFdvcmQzMikgKiAocF9zaWduYWwpIDw8IDMpKTsKLSAgICAgICAgfQotICAgICAgICBzY2FsX2ZhYyA9IC0zOwotICAgIH0KLSAgICBlbHNlCi0gICAgewotCi0gICAgICAgIG1lbWNweShzY2FsX3NpZywgcF9zaWduYWwsIChMX2ZyYW1lICsgcGl0X21heCkqc2l6ZW9mKCpzaWduYWwpKTsKLSAgICAgICAgc2NhbF9mYWMgPSAwOwotICAgIH0KLQotICAgIC8qIGNhbGN1bGF0ZSBhbGwgY29yZWVsYXRpb25zIG9mIHNjYWxfc2lnLCBmcm9tIHBpdF9taW4gdG8gcGl0X21heCAqLwotICAgIGNvcnJfcHRyID0gJmNvcnJbcGl0X21heF07Ci0KLSAgICBzY2FsX3NpZyA9ICZzY2FsZWRfc2lnbmFsW3BpdF9tYXhdOwotCi0gICAgY29tcF9jb3JyKHNjYWxfc2lnLCBMX2ZyYW1lLCBwaXRfbWF4LCBwaXRfbWluLCBjb3JyX3B0cik7Ci0KLSAgICAvKi0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tKgotICAgICAqICBUaGUgcGl0Y2ggbGFnIHNlYXJjaCBpcyBkaXZpZGVkIGluIHRocmVlIHNlY3Rpb25zLiAgICAgICAgICAgICAgICAqCi0gICAgICogIEVhY2ggc2VjdGlvbiBjYW5ub3QgaGF2ZSBhIHBpdGNoIG11bHRpcGxlLiAgICAgICAgICAgICAgICAgICAgICAgICoKLSAgICAgKiAgV2UgZmluZCBhIG1heGltdW0gZm9yIGVhY2ggc2VjdGlvbi4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKgotICAgICAqICBXZSBjb21wYXJlIHRoZSBtYXhpbXVtIG9mIGVhY2ggc2VjdGlvbiBieSBmYXZvcmluZyBzbWFsbCBsYWdzLiAgICAqCi0gICAgICogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICoKLSAgICAgKiAgRmlyc3Qgc2VjdGlvbjogIGxhZyBkZWxheSA9IHBpdF9tYXggICAgIGRvd250byA0KnBpdF9taW4gICAgICAgICAgKgotICAgICAqICBTZWNvbmQgc2VjdGlvbjogbGFnIGRlbGF5ID0gNCpwaXRfbWluLTEgZG93bnRvIDIqcGl0X21pbiAgICAgICAgICAqCi0gICAgICogIFRoaXJkIHNlY3Rpb246ICBsYWcgZGVsYXkgPSAyKnBpdF9taW4tMSBkb3dudG8gcGl0X21pbiAgICAgICAgICAgICoKLSAgICAgKi0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tKi8KLQotICAgIC8qIG1vZG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0YXRlICp2YWRTdCwgICAvKiBpL28gOiBWQUQgc3RhdGUgc3RydWN0ICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0gICAgICAgIGVudW0gTW9kZSBtb2RlLCAgICAvKiBpICAgOiBjb2RlciBtb2RlICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0gICAgICAgIFdvcmQxNiBzaWduYWxbXSwgICAvKiBpICAgOiBzaWduYWwgdXNlZCB0byBjb21wdXRlIHRoZSBvcGVuIGxvb3AgcGl0Y2ggICovCi0gICAgICAgIC8qICAgIHNpZ25hbFstcGl0X21heF0gdG8gc2lnbmFsWy0xXSBzaG91bGQgYmUga25vd24gKi8KLSAgICAgICAgV29yZDE2IHBpdF9taW4sICAgIC8qIGkgICA6IG1pbmltdW0gcGl0Y2ggbGFnICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLSAgICAgICAgV29yZDE2IHBpdF9tYXgsICAgIC8qIGkgICA6IG1heGltdW0gcGl0Y2ggbGFnICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLSAgICAgICAgV29yZDE2IExfZnJhbWUsICAgIC8qIGkgICA6IGxlbmd0aCBvZiBmcmFtZSB0byBjb21wdXRlIHBpdGNoICAgICAgICAgICAgKi8KLSAgICAgICAgV29yZDE2IGlkeCwgICAgICAgIC8qIGkgICA6IGZyYW1lIGluZGV4ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLSAgICAgICAgRmxhZyBkdHgsICAgICAgICAgIC8qIGkgICA6IGR0eCBmbGFnOyB1c2UgZHR4PTEsIGRvIG5vdCB1c2UgZHR4PTAgICAgICAgKi8KLSAgICAgICAgRmxhZyAqcE92ZXJmbG93ICAgIC8qIGkvbyA6IG92ZXJmbG93IEZsYWcgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLSAgICApOwotCi0KLSNpZmRlZiBfX2NwbHVzcGx1cwotfQotI2VuZGlmCi0KLSNlbmRpZiAgLyogUElUQ0hfT0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GFydCBwb3NpdGlvbiBpbiBzcGVlY2ggdmVjdG9yLCAgIFEwICAqLwotICAgIFdvcmQxNiBzcGVlY2hbXSwgICAgICAgICAgIC8qIGkgIDogc3BlZWNoLCAgICAgICAgICAgICAgICAgICAgICAgICAgICBRMCAgKi8KLSAgICBXb3JkMTYgbWVtX3dbXSwgICAgICAgICAgICAvKiBpL286IHN5bnRoZXNpcyBmaWx0ZXIgbWVtb3J5IHN0YXRlLCAgICAgUTAgICovCi0gICAgV29yZDE2IHdzcFtdLCAgICAgICAgICAgICAgLyogbyAgOiB3ZWlnaHRlZCBzcGVlY2ggICAgICAgICAgICAgICAgICAgIFEwICAqLwotICAgIEZsYWcgICAqcE92ZXJmbG93ICAgICAgICAgIC8qIG8gIDogb3ZlcmZsb3cgaW5kaWNhdG9yICAgICAgICAgICAgICAgICAgICAgKi8KLSkKLXsKLSAgICBXb3JkMTYgQXAxW01QMV07ICAgICAgICAgICAgLyogQSh6KSB3aXRoIHNwZWN0cmFsIGV4cGFuc2lvbiAgICAgICAgICovCi0gICAgV29yZDE2IEFwMltNUDFdOyAgICAgICAgICAgIC8qIEEoeikgd2l0aCBzcGVjdHJhbCBleHBhbnNpb24gICAgICAgICAqLwotICAgIGNvbnN0IFdvcmQxNiAqZzE7ICAgICAgICAgICAvKiBQb2ludGVyIHRvIGNvcnJlY3QgZ2FtbW1hMSB2ZWN0b3IgICAgKi8KLSAgICBXb3JkMTYgYU9mZnNldDsKLSAgICBXb3JkMTYgaTsKLQotICAgIGlmIChtb2RlIDw9IE1SNzk1KQotICAgIHsKLSAgICAgICAgZzEgPSBnYW1tYTE7Ci0gICAgfQotICAgIGVsc2UKLSAgICB7Ci0gICAgICAgIGcxID0gZ2FtbWExXzEyazI7Ci0gICAgfQotCi0gICAgaWYgKGZyYW1lT2Zmc2V0ID4gMCkKLSAgICB7Ci0gICAgICAgIGFPZmZzZXQgPSAyICogTVAxOwotICAgIH0KLSAgICBlbHNlCi0gICAgewotICAgICAgICBhT2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KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgotUG9ydGlvbnMgb2YgdGhpcyBmaWxlIGFyZSBkZXJpdmVkIGZyb20gdGhlIGZvbGxvd2luZyAzR1BQIHN0YW5kYXJkOgotCi0gICAgM0dQUCBUUyAyNi4wNzMKLSAgICBBTlNJLUMgY29kZSBmb3IgdGhlIEFkYXB0aXZlIE11bHRpLVJhdGUgKEFNUikgc3BlZWNoIGNvZGVjCi0gICAgQXZhaWxhYmxlIGZyb20gaHR0cDovL3d3dy4zZ3BwLm9yZwotCi0oQykgMjAwNCwgM0dQUCBPcmdhbml6YXRpb25hbCBQYXJ0bmVycyAoQVJJQiwgQVRJUywgQ0NTQSwgRVRTSSwgVFRBLCBUVEMpCi1QZXJtaXNzaW9uIHRvIGRpc3RyaWJ1dGUsIG1vZGlmeSBhbmQgdXNlIHRoaXMgZmlsZSB1bmRlciB0aGUgc3RhbmRhcmQgbGljZW5zZQotdGVybXMgbGlzdGVkIGFib3ZlIGhhcyBiZWVuIG9idGFpbmVkIGZyb20gdGhlIGNvcHlyaWdodCBob2xkZXIuCi0qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotLyoKLSoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCi0qCi0qICAgICAgR1NNIEFNUi1OQiBzcGVlY2ggY29kZWMgICBSOTggICBWZXJzaW9uIDcuNS4wICAgTWFyY2ggMiwgMjAwMQotKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgUjk5ICAgVmVyc2lvbiAzLjIuMAotKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgUkVMLTQgVmVyc2lvbiA0LjAuMAotKgotKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKLSoKLSogICAgICBGaWxlICAgICAgICAgICAgIDogcHJlX3Byb2MuaAotKiAgICAgIFB1cnBvc2UgICAgICAgICAgOiBQcmVwcm9jZXNzaW5nIG9mIGlucHV0IHNwZWVjaC4KLSoKLQotIERlc2NyaXB0aW9uOiAgUmVwbGFjZWQgImludCIgYW5kL29yICJjaGFyIiB3aXRoIE9TQ0wgZGVmaW5lZCB0eXBlcy4KLQotKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKLSovCi0jaWZuZGVmIHByZV9wcm9jX2gKLSNkZWZpbmUgcHJlX3Byb2NfaCAiJElkICQiCi0KLS8qCi0qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgotKiAgICAgICAgICAgICAgICAgICAgICAgICBJTkNMVURFIEZJTEVTCi0qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgotKi8KLSNpbmNsdWRlICJ0eXBlZGVmLmgiCi0KLSNpZmRlZiBfX2NwbHVzcGx1cwotZXh0ZXJuICJDIgotewotI2VuZGlmCi0KLSAgICAvKgotICAgICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCi0gICAgKiAgICAgICAgICAgICAgICAgICAgICAgICBMT0NBTCBWQVJJQUJMRVMgQU5EIFRBQkxFUwotICAgICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCi0gICAgKi8KLQotICAgIC8qCi0gICAgKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKLSAgICAqICAgICAgICAgICAgICAgICAgICAgICAgIERFRklOSVRJT04gT0YgREFUQSBUWVBFUwotICAgICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCi0gICAgKi8KLSAgICB0eXBlZGVmIHN0cnVjdAotICAgIHsKLSAgICAgICAgV29yZDE2IHkyX2hpOwotICAgICAgICBXb3JkMTYgeTJfbG87Ci0gICAgICAgIFdvcmQxNiB5MV9oaTsKLSAgICAgICAgV29yZDE2IHkxX2xvOwotICAgICAgICBXb3JkMTYgeDA7Ci0gICAgICAgIFdvcmQxNiB4MTsKLSAgICB9IFByZV9Qcm9jZXNzU3RhdGU7Ci0KLSAgICAvKgotICAgICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCi0gICAgKiAgICAgICAgICAgICAgICAgICAgICAgICBERUNMQVJBVElPTiBPRiBQUk9UT1RZUEVTCi0gICAgKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKLSAgICAqLwotCi0gICAgV29yZDE2IFByZV9Qcm9jZXNzX2luaXQoUHJlX1Byb2Nlc3NTdGF0ZSAqKnN0KTsKLSAgICAvKiBpbml0aWFsaXplIG9uZSBpbnN0YW5jZSBvZiB0aGUgcHJlIHByb2Nlc3Npbmcgc3RhdGUuCi0gICAgICAgU3RvcmVzIHBvaW50ZXIgdG8gZmlsdGVyIHN0YXR1cyBzdHJ1Y3QgaW4gKnN0LiBUaGlzIHBvaW50ZXIgaGFzIHRvCi0gICAgICAgYmUgcGFzc2VkIHRvIFByZV9Qcm9jZXNzIGluIGVhY2ggY2FsbC4KLSAgICAgICByZXR1cm5zIDAgb24gc3VjY2V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bmVkIGZyb20gdGhlIGNvcHlyaWdodCBob2xkZXIuCi0qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotLyoKLSoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCi0qCi0qICAgICAgR1NNIEFNUi1OQiBzcGVlY2ggY29kZWMgICBSOTggICBWZXJzaW9uIDcuNS4wICAgTWFyY2ggMiwgMjAwMQotKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgUjk5ICAgVmVyc2lvbiAzLjIuMAotKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgUkVMLTQgVmVyc2lvbiA0LjAuMAotKgotKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKLSoKLSogICAgICBGaWxlICAgICAgICAgICAgIDogcHJtMmJpdHMuaAotKiAgICAgIFB1cnBvc2UgICAgICAgICAgOiBDb252ZXJ0cyB0aGUgZW5jb2RlciBwYXJhbWV0ZXIgdmVjdG9yIGludG8gYQotKiAgICAgICAgICAgICAgICAgICAgICAgOiB2ZWN0b3Igb2Ygc2VyaWFsIGJpdHMuCi0qCi0qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgotKi8KLSNpZm5kZWYgcHJtMmJpdHNfaAotI2RlZmluZSBwcm0yYml0c19oICIkSWQgJCIKLQotLyoKLSoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCi0qICAgICAgICAgICAgICAgICAgICAgICAgIElOQ0xVREUgRklMRVMKLSoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCi0qLwotI2luY2x1ZGUgInR5cGVkZWYuaCIKLSNpbmNsdWRlICJtb2RlLmgiCi0KLSNpZmRlZiBfX2NwbHVzcGx1cwotZXh0ZXJuICJDIgotewotI2VuZGlmCi0KLSAgICAvKgotICAgICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCi0gICAgKiAgICAgICAgICAgICAgICAgICAgICAgICBERUZJTklUSU9OIE9GIERBVEEgVFlQRVMKLSAgICAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgotICAgICovCi0KLSAgICAvKgotICAgICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCi0gICAgKiAgICAgICAgICAgICAgICAgICAgICAgICBERUNMQVJBVElPTiBPRiBQUk9UT1RZUEVTCi0gICAgKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKLSAgICAqLwotICAgIHZvaWQgUHJtMmJpdHMoCi0gICAgICAgIGVudW0gTW9kZSBtb2RlLCAgICAvKiBpIDogQU1SIG1vZGUgKi8KLSAgICAgICAgV29yZDE2IHBybVtdLCAgICAgIC8qIGlucHV0IDogYW5hbHlzaXMgcGFyYW1ldGVycyAgICAgICAgICAgICAgICAgICAgICAgKi8KLSAgICAgICAgV29yZDE2IGJpdHNbXSAgICAgIC8qIG91dHB1dDogc2VyaWFsIGJpdHMgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLSAgICApOwotCi0jaWZkZWYgX19jcGx1c3BsdXMKLX0KLSNlbmRpZgotCi0jZW5kaWYKZG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LS0tLS0tLS0tCi0qLwotCi1Xb3JkMTYgcV9nYWluX2NvZGUoICAgICAgICAgLyogbyAgOiBxdWFudGl6YXRpb24gaW5kZXgsICAgICAgICAgICAgUTAgICovCi0gICAgZW51bSBNb2RlIG1vZGUsICAgICAgICAgLyogaSAgOiBBTVIgbW9kZSAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0gICAgV29yZDE2IGV4cF9nY29kZTAsICAgICAgLyogaSAgOiBwcmVkaWN0ZWQgQ0IgZ2FpbiAoZXhwb25lbnQpLCAgUTAgICovCi0gICAgV29yZDE2IGZyYWNfZ2NvZGUwLCAgICAgLyogaSAgOiBwcmVkaWN0ZWQgQ0IgZ2FpbiAoZnJhY3Rpb24pLCAgUTE1ICovCi0gICAgV29yZDE2ICpnYWluLCAgICAgICAgICAgLyogaS9vOiBxdWFudGl6ZWQgZml4ZWQgY29kZWJvb2sgZ2FpbiwgUTEgICovCi0gICAgV29yZDE2ICpxdWFfZW5lcl9NUjEyMiwgLyogbyAgOiBxdWFudGl6ZWQgZW5lcmd5IGVycm9yLCAgICAgICAgUTEwICovCi0gICAgLyogICAgICAoZm9yIE1SMTIyIE1BIHByZWRpY3RvciB1cGRhdGUpICAgICovCi0gICAgV29yZDE2ICpxdWFfZW5lciwgICAgICAgLyogbyAgOiBxdWFudGl6ZWQgZW5lcmd5IGVycm9yLCAgICAgICAgUTEwICovCi0gICAgLyogICAgICAoZm9yIG90aGVyIE1BIHByZWRpY3RvciB1cGRhdGUpICAgICovCi0gICAgRmxhZyAgICpwT3ZlcmZsb3cKLSkKLXsKLSAgICBjb25zdCBXb3JkMTYgKnA7Ci0gICAgV29yZDE2IGk7Ci0gICAgV29yZDE2IGluZGV4OwotICAgIFdvcmQxNiBnY29kZTA7Ci0gICAgV29yZDE2IGVycjsKLSAgICBXb3JkMTYgZXJyX21pbjsKLSAgICBXb3JkMTYgZ19xMDsKLSAgICBXb3JkMTYgdGVtcDsKLQotICAgIGlmIChtb2RlID09IE1SMTIyKQotICAgIHsKLSAgICAgICAgZ19xMCA9ICpnYWluID4+IDE7IC8qIFExIC0+IFEwICovCi0gICAgfQotICAgIGVsc2UKLSAgICB7Ci0gICAgICAgIGdfcTAgPSAqZ2FpbjsKLSAgICB9Ci0KLSAgICAvKi0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0qCi0gICAgICogIHByZWRpY3RlZCBjb2RlYm9vayBnYWluICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKgotICAgICAqICB+fn5+fn5+fn5+fn5+fn5+fn5+fn5+fiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICoKLSAgICAgKiAgZ2MwICAgICA9IFBvdzIoaW50KGQpK2ZyYWMoZCkpICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqCi0gICAgICogICAgICAgICAgPSAyXmV4cCArIDJeZnJhYyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKgotICAgICAqICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICoKLSAgICAgKi0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0qLwotCi0gICAgZ2NvZGUwID0gKFdvcmQxNikgUG93MihleHBfZ2NvZGUwLCBmcmFjX2djb2RlMCwgcE92ZXJmbG93KTsgIC8qIHByZWRpY3RlZCBnYWluICovCi0KLSAgICBpZiAobW9kZSA9PSBNUjEyMikKLSAgICB7Ci0gICAgICAgIGdjb2RlMCA9IHNobChnY29kZTAsIDQsIHBPdmVyZmxvdyk7Ci0gICAgfQotICAgIGVsc2UKLSAgICB7Ci0gICAgICAgIGdjb2RlMCA9IHNobChnY29kZTAsIDUsIHBPdmVyZmxvdyk7Ci0gICAgfQotCi0gICAgLyotLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tKgotICAgICAqICAgICAgICAgICAgICAgICAgIFNlYXJjaCBmb3IgYmVzdCBxdWFudGl6ZXIgICAgICAgICAgICAgICAgICAgICAgICAqCi0gICAgICotLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tKi8KLQotICAgIHAgPSAmcXVhX2dhaW5fY29kZVswXTsKLSAgICBlcnJfbWluID0gKChXb3JkMzIpZ2NvZGUwICogKihwKyspKSA+PiAxNTsKLSAgICBlcnJfbWluID0gIGdfcTAgLSBlcnJfbWluOwotICAgIGlmIChlcnJfbWluIDwgMCkKLSAgICB7Ci0gICAgICAgIGVycl9taW4gPSAtZXJyX21pbjsKLSAgICB9Ci0KLSAgICBwICs9IDI7ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8qIHNraXAgcXVhbnRpemVkIGVuZXJneSBlcnJvcnMgKi8KLSAgICBpbmRleCA9IDA7Ci0KLSAgICBmb3IgKGkgPSAxOyBpIDwgTkJfUVVBX0NPREU7IGkrKykKLSAgICB7Ci0gICAgICAgIGVyciA9ICgoV29yZDMyKWdjb2RlMCAqICoocCsrKSkgPj4gMTU7Ci0gICAgICAgIGVyciA9ICBnX3EwIC0gZXJyOwotCi0gICAgICAgIGlmIChlcnIgPCAwKQotICAgICAgICB7Ci0gICAgICAgICAgICBlcnIgPSAtZXJyOwotICAgICAgICB9Ci0KLSAgICAgICAgcCArPSAyOyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8qIHNraXAgcXVhbnRpemVkIGVuZXJneSBlcnJvciAqLwotCi0gICAgICAgIGlmIChlcnIgPCBlcnJfbWluKQotICAgICAgICB7Ci0gICAgICAgICAgICBlcnJfbW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0tLS0tLS0tLS0tLS0tLQotICAgIDsgR0xPQkFMIEZVTkNUSU9OIERFRklOSVRJT05TCi0gICAgOyBGdW5jdGlvbiBQcm90b3R5cGUgZGVjbGFyYXRpb24KLSAgICAtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tKi8KLQotICAgIC8qLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0qCi0gICAgICogRnVuY3Rpb24gcV9nYWluX2NvZGUoKSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICoKLSAgICAgKiB+fn5+fn5+fn5+fn5+fn5+fn5+fn5+fn5+fn5+fn5+fn5+fn5+fn4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKgotICAgICAqIFNjYWxhciBxdWFudGl6YXRpb24gb2YgdGhlIGlubm92YXRpdmUgY29kZWJvb2sgZ2Fpbi4gICAgICAgICAgICAgICAgICAgICAqCi0gICAgICogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICoKLSAgICAgKiBnY19wcmVkKCkgaXMgdXNlZCBmb3IgTUEgcHJlZGljdGlvbiBvZiB0aGUgaW5ub3ZhdGlvbiBlbmVyZ3kgICAgICAgICAgICAgKgotICAgICAqLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0qLwotICAgIFdvcmQxNiBxX2dhaW5fY29kZSggICAgICAgICAvKiBvICA6IHF1YW50aXphdGlvbiBpbmRleCwgICAgICAgICAgICBRMCAgKi8KLSAgICAgICAgZW51bSBNb2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ICAgIGluZGV4ID0gMDsKLQotICAgIGZvciAoaSA9IDE7IGkgPCBOQl9RVUFfUElUQ0g7IGkrKykKLSAgICB7Ci0gICAgICAgIGlmIChxdWFfZ2Fpbl9waXRjaFtpXSA8PSBncF9saW1pdCkKLSAgICAgICAgewotICAgICAgICAgICAgZXJyID0gc3ViKCpnYWluLCBxdWFfZ2Fpbl9waXRjaFtpXSwgcE92ZXJmbG93KTsKLSAgICAgICAgICAgIGVyciA9IGFic19zKGVycik7Ci0KLSAgICAgICAgICAgIGlmIChlcnIgPCBlcnJfbWluKQotICAgICAgICAgICAgewotICAgICAgICAgICAgICAgIGVycl9taW4gPSBlcnI7Ci0gICAgICAgICAgICAgICAgaW5kZXggPSBpOwotICAgICAgICAgICAgfQotICAgICAgICB9Ci0gICAgfQotCi0gICAgaWYgKG1vZGUgPT0gTVI3OTUpCi0gICAgewotICAgICAgICAvKiBpbiBNUjc5NSBtb2RlLCBjb21wdXRlIHRocmVlIGdhaW5fcGl0IGNhbmRpZGF0ZXMgYXJvdW5kIHRoZSBpbmRleAotICAgICAgICAgKiBmb3VuZCBpbiB0aGUgcXVhbnRpemF0aW9uIGxvb3A6IHRoZSBpbmRleCBmb3VuZCBhbmQgdGhlIHR3byBkaXJlY3QKLSAgICAgICAgICogbmVpZ2hib3VycywgZXhjZXB0IGZvciB0aGUgZXh0cmVtZSBjYXNlcyAoaT0wIG9yIGk9TkJfUVVBX1BJVENILTEpLAotICAgICAgICAgKiB3aGVyZSB0aGUgZGlyZWN0IG5laWdoYm91ciBhbmQgdGhlIG5laWdoYm91ciB0byB0aGF0IGlzIHVzZWQuCi0gICAgICAgICAqLwotICAgICAgICBXb3JkMTYgaWk7Ci0KLSAgICAgICAgaWYgKGluZGV4ID09IDApCi0gICAgICAgIHsKLSAgICAgICAgICAgIGlpID0gaW5kZXg7Ci0gICAgICAgIH0KLSAgICAgICAgZWxzZQotICAgICAgICB7Ci0gICAgICAgICAgICBpZiAoaW5kZXggPT0gKE5CX1F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AgIDUyODIsICAgICAxNjk2LAotICAgIDE0ODgsICAgICAgICAgIDQyOCwgICAgICAgICAgNTg4MiwgICAgICA0NTIsCi0gICAgNTMzMiwgICAgICAgICA0MDcyLCAgICAgICAgICAzNTgzLCAgICAgMTI2OCwKLSAgICAyNDY5LCAgICAgICAgICA5MDEsICAgICAgICAgMTU4OTQsICAgICAxMDA1LAotICAgIDE0OTgyLCAgICAgICAgIDMyNzEsICAgICAgICAgMTAzMzEsICAgICA0ODU4LAotICAgIDM2MzUsICAgICAgICAgMjAyMSwgICAgICAgICAgMjU5NiwgICAgICA4MzUsCi0gICAgMTIzNjAsICAgICAgICAgNDg5MiwgICAgICAgICAxMjIwNiwgICAgIDE3MDQsCi0gICAgMTM0MzIsICAgICAgICAgMTYwNCwgICAgICAgICAgOTExOCwgICAgIDIzNDEsCi0gICAgMzk2OCwgICAgICAgICAxNTM4LCAgICAgICAgICA1NDc5LCAgICAgOTkzNiwKLSAgICAzNzk1LCAgICAgICAgICA0MTcsICAgICAgICAgIDEzNTksICAgICAgNDE0LAotICAgIDM2NDAsICAgICAgICAgMTU2OSwgICAgICAgICAgNzk5NSwgICAgIDM1NDEsCi0gICAgMTE0MDUsICAgICAgICAgIDY0NSwgICAgICAgICAgODU1MiwgICAgICA2MzUsCi0gICAgNDA1NiwgICAgICAgICAxMzc3LCAgICAgICAgIDE2NjA4LCAgICAgNjEyNCwKLSAgICAxMTQyMCwgICAgICAgICAgNzAwLCAgICAgICAgICAyMDA3LCAgICAgIDYwNywKLSAgICAxMjQxNSwgICAgICAgICAxNTc4LCAgICAgICAgIDExMTE5LCAgICAgNDY1NCwKLSAgICAxMzY4MCwgICAgICAgICAxNzA4LCAgICAgICAgIDExOTkwLCAgICAgMTIyOSwKLSAgICA3OTk2LCAgICAgICAgIDcyOTcsICAgICAgICAgMTMyMzEsICAgICA1NzE1LAotICAgIDI0MjgsICAgICAgICAgMTE1OSwgICAgICAgICAgMjA3MywgICAgIDE5NDEsCi0gICAgNjIxOCwgICAgICAgICA2MTIxLCAgICAgICAgICAzNTQ2LCAgICAgMTgwNCwKLSAgICA4OTI1LCAgICAgICAgIDE4MDIsICAgICAgICAgIDg2NzksICAgICAxNTgwLAotICAgIDEzOTM1LCAgICAgICAgIDM1NzYsICAgICAgICAgMTMzMTMsICAgICA2MjM3LAotICAgIDYxNDIsICAgICAgICAgMTEzMCwgICAgICAgICAgNTk5NCwgICAgIDE3MzQsCi0gICAgMTQxNDEsICAgICAgICAgNDY2MiwgICAgICAgICAxMTI3MSwgICAgIDMzMjEsCi0gICAgMTIyMjYsICAgICAgICAgMTU1MSwgICAgICAgICAxMzkzMSwgICAgIDMwMTUsCi0gICAgNTA4MSwgICAgICAgIDEwNDY0LCAgICAgICAgICA5NDQ0LCAgICAgNjcwNiwKLSAgICAxNjg5LCAgICAgICAgICA2ODMsICAgICAgICAgIDE0MzYsICAgICAxMzA2LAotICAgIDcyMTIsICAgICAgICAgMzkzMywgICAgICAgICAgNDA4MiwgICAgIDI3MTMsCi0gICAgNzc5MywgICAgICAgICAgNzA0LCAgICAgICAgIDE1MDcwLCAgICAgIDgwMiwKLSAgICA2Mjk5LCAgICAgICAgIDUyMTIsICAgICAgICAgIDQzMzcsICAgICA1MzU3LAotICAgIDY2NzYsICAgICAgICAgIDU0MSwgICAgICAgICAgNjA2MiwgICAgICA2MjYsCi0gICAgMTM2NTEsICAgICAgICAgMzcwMCwgICAgICAgICAxMTQ5OCwgICAgIDI0MDgsCi0gICAgMTYxNTYsICAgICAgICAgIDcxNiwgICAgICAgICAxMjE3NywgICAgICA3NTEsCi0gICAgODA2NSwgICAgICAgIDExNDg5LCAgICAgICAgICA2MzE0LCAgICAgMjI1NiwKLSAgICA0NDY2LCAgICAgICAgICA0OTYsICAgICAgICAgIDcyOTMsICAgICAgNTIzLAotICAgIDEwMjEzLCAgICAgICAgIDM4MzMsICAgICAgICAgIDgzOTQsICAgICAzMDM3LAotICAgIDg0MDMsICAgICAgICAgIDk2NiwgICAgICAgICAxNDIyOCwgICAgIDE4ODAsCi0gICAgODcwMywgICAgICAgICA1NDA5LCAgICAgICAgIDE2Mzk1LCAgICAgNDg2MywKLSAgICA3NDIwLCAgICAgICAgIDE5NzksICAgICAgICAgIDYwODksICAgICAxMjMwLAotICAgIDkzNzEsICAgICAgICAgNDM5OCwgICAgICAgICAxNDU1OCwgICAgIDMzNjMsCi0gICAgMTM1NTksICAgICAgICAgMjg3MywgICAgICAgICAxMzE2MywgICAgIDE0NjUsCi0gICAgNTUzNCwgICAgICAgICAxNjc4LCAgICAgICAgIDEzMTM4LCAgICAxNDc3MSwKLSAgICA3MzM4LCAgICAgICAgICA2MDAsICAgICAgICAgIDEzMTgsICAgICAgNTQ4LAotICAgIDQyNTIsICAgICAgICAgMzUzOSwgICAgICAgICAxMDA0NCwgICAgIDIzNjQsCi0gICAgMTA1ODcsICAgICAgICAgIDYyMiwgICAgICAgICAxMzA4OCwgICAgICA2NjksCi0gICAgMTQxMjYsICAgICAgICAgMzUyNiwgICAgICAgICAgNTAzOSwgICAgIDk3ODQsCi0gICAgMTUzMzgsICAgICAgICAgIDYxOSwgICAgICAgICAgMzExNSwgICAgICA1OTAsCi0gICAgMTY0NDIsICAgICAgICAgMzAxMywgICAgICAgICAxNTU0MiwgICAgIDQxNjgsCi0gICAgMTU1MzcsICAgICAgICAgMTYxMSwgICAgICAgICAxNTQwNSwgICAgIDEyMjgsCi0gICAgMTYwMjMsICAgICAgICAgOTI5OSwgICAgICAgICAgNzUzNCwgICAgIDQ5NzYsCi0gICAgMTk5MCwgICAgICAgICAxMjEzLCAgICAgICAgIDExNDQ3LCAgICAgMTE1NywKLSAgICAxMjUxMiwgICAgICAgICA1NTE5LCAgICAgICAgICA5NDc1LCAgICAgMjY0NCwKLSAgICA3NzE2LCAgICAgICAgIDIwMzQsICAgICAgICAgMTMyODAsICAgICAyMjM5LAotICAgIDE2MDExLCAgICAgICAgIDUwOTMsICAgICAgICAgIDgwNjYsICAgICA2NzYxLAotICAgIDEwMDgzLCAgICAgICAgIDE0MTMsICAgICAgICAgIDUwMDIsICAgICAyMzQ3LAotICAgIDEyNTIzLCAgICAgICAgIDU5NzUsICAgICAgICAgMTUxMjYsICAgICAyODk5LAotICAgIDE4MjY0LCAgICAgICAgIDIyODksICAgICAgICAgMTU4MjcsICAgICAyNTI3LAotICAgIDE2MjY1LCAgICAgICAgMTAyNTQsICAgICAgICAgMTQ2NTEsICAgIDExMzE5LAotICAgIDE3OTcsICAgICAgICAgIDMzNywgICAgICAgICAgMzExNSwgICAgICAzOTcsCi0gICAgMzUxMCwgICAgICAgICAyOTI4LCAgICAgICAgICA0NTkyLCAgICAgMjY3MCwKLSAgICA3NTE5LCAgICAgICAgICA2MjgsICAgICAgICAgMTE0MTUsICAgICAgNjU2LAotICAgIDU5NDYsICAgICAgICAgMjQzNSwgICAgICAgICAgNjU0NCwgICAgIDczNjcsCi0gICAgODIzOCwgICAgICAgICAgODI5LCAgICAgICAgICA0MDAwLCAgICAgIDg2MywKLSAgICAxMDAzMiwgICAgICAgICAyNDkyLCAgICAgICAgIDE2MDU3LCAgICAgMzU1MSwKLSAgICAxODIwNCwgICAgICAgICAxMDU0LCAgICAgICAgICA2MTAzLCAgICAgMTQ1NCwKLSAgICA1ODg0LCAgICAgICAgIDc5MDAsICAgICAgICAgMTg3NTIsICAgICAzNDY4LAotICAgIDE4NjQsICAgICAgICAgIDU0NCwgICAgICAgICAgOTE5OCwgICAgICA2ODMsCi0gICAgMTE2MjMsICAgICAgICAgNDE2MCwgICAgICAgICAgNDU5NCwgICAgIDE2NDQsCi0gICAgMzE1OCwgICAgICAgICAxMTU3LCAgICAgICAgIDE1OTUzLCAgICAgMjU2MCwKLSAgICAxMjM0OSwgICAgICAgICAzNzMzLCAgICAgICAgIDE3NDIwLCAgICAgNTI2MCwKLSAgICA2MTA2LCAgICAgICAgIDIwMDQsICAgICAgICAgIDI5MTcsICAgICAxNzQyLAotICAgIDE2NDY3LCAgICAgICAgIDUyNTcsICAgICAgICAgMTY3ODcsICAgICAxNjgwLAotICAgIDE3MjA1LCAgICAgICAgIDE3NTksICAgICAgICAgIDQ3NzMsICAgICAzMjMxLAotICAgIDczODYsICAgICAgICAgNjAzNSwgICAgICAgICAxNDM0MiwgICAgMTAwMTIsCi0gICAgNDAzNSwgICAgICAgICAgNDQyLCAgICAgICAgICA0MTk0LCAgICAgIDQ1OCwKLSAgICA5MjE0LCAgICAgICAgIDIyNDIsICAgICAgICAgIDc0MjcsICAgICA0MjE3LAotICAgIDEyODYwLCAgICAgICAgICA4MDEsICAgICAgICAgMTExODYsICAgICAgODI1LAotICAgIDEyNjQ4LCAgICAgICAgIDIwODQsICAgICAgICAgMTI5NTYsICAgICA2NTU0LAotICAgIDk1MDUsICAgICAgICAgIDk5NiwgICAgICAgICAgNjYyOSwgICAgICA5ODUsCi0gICAgMTA1MzcsICAgICAgICAgMjUwMiwgICAgICAgICAxNTI4OSwgICAgIDUwMDYsCi0gICAgMTI2MDIsICAgICAgICAgMjA1NSwgICAgICAgICAxNTQ4NCwgICAgIDE2NTMsCi0gICAgMTYxOTQsICAgICAgICAgNjkyMSwgICAgICAgICAxNDIzMSwgICAgIDU3OTAsCi0gICAgMjYyNiwgICAgICAgICAgODI4LCAgICAgICAgICA1NjE1LCAgICAgMTY4NiwKLSAgICAxMzY2MywgICAgICAgICA1Nzc4LCAgICAgICAgICAzNjY4LCAgICAgMTU1NCwKLSAgICAxMTMxMywgICAgICAgICAyNjMzLCAgICAgICAgICA5NzcwLCAgICAgMTQ1OSwKLSAgICAxNDAwMywgICAgICAgICA0NzMzLCAgICAgICAgIDE1ODk3LCAgICAgNjI5MSwKLSAgICA2Mjc4LCAgICAgICAgIDE4NzAsICAgICAgICAgIDc5MTAsICAgICAyMjg1LAotICAgIDE2OTc4LCAgICAgICAgIDQ1NzEsICAgICAgICAgMTY1NzYsICAgICAzODQ5LAotICAgIDE1MjQ4LCAgICAgICAgIDIzMTEsICAgICAgICAgMTYwMjMsICAgICAzMjQ0LAotICAgIDE0NDU5LCAgICAgICAgMTc4MDgsICAgICAgICAgMTE4NDcsICAgICAyNzYzLAotICAgIDE5ODEsICAgICAgICAgMTQwNywgICAgICAgICAgMTQwMCwgICAgICA4NzYsCi0gICAgNDMzNSwgICAgICAgICAzNTQ3LCAgICAgICAgICA0MzkxLCAgICAgNDIxMCwKLSAgICA1NDA1LCAgICAgICAgICA2ODAsICAgICAgICAgMTc0NjEsICAgICAgNzgxLAotICAgIDY1MDEsICAgICAgICAgNTExOCwgICAgICAgICAgODA5MSwgICAgIDc2NzcsCi0gICAgNzM1NSwgICAgICAgICAgNzk0LCAgICAgICAgICA4MzMzLCAgICAgMTE4MiwKLSAgICAxNTA0MSwgICAgICAgICAzMTYwLCAgICAgICAgIDE0OTI4LCAgICAgMzAzOSwKLSAgICAyMDQyMSwgICAgICAgICAgODgwLCAgICAgICAgIDE0NTQ1LCAgICAgIDg1MiwKLSAgICAxMjMzNywgICAgICAgIDE0NzA4LCAgICAgICAgICA2OTA0LCAgICAgMTkyMCwKLSAgICA0MjI1LCAgICAgICAgICA5MzMsICAgICAgICAgIDgyMTgsICAgICAxMDg3LAotICAgIDEwNjU5LCAgICAgICAgIDQwODQsICAgICAgICAgMTAwODIsICAgICA0NTMzLAotICAgIDI3MzUsICAgICAgICAgIDg0MCwgICAgICAgICAyMDY1NywgICAgIDEwODEsCi0gICAgMTY3MTEsICAgICAgICAgNTk2NiwgICAgICAgICAxNTg3MywgICAgIDQ1NzgsCi0gICAgMTA4NzEsICAgICAgICAgMjU3NCwgICAgICAgICAgMzc3MywgICAgIDExNjYsCi0gICAgMTQ1MTksICAgICAgICAgNDA0NCwgICAgICAgICAyMDY5OSwgICAgIDI2MjcsCi0gICAgMTUyMTksICAgICAgICAgMjczNCwgICAgICAgICAxNTI3NCwgICAgIDIxODYsCi0gICAgNjI1NywgICAgICAgICAzMjI2LCAgICAgICAgIDEzMTI1LCAgICAxOTQ4MCwKLSAgICA3MTk2LCAgICAgICAgICA5MzAsICAgICAgICAgIDI0NjIsICAgICAxNjE4LAotICAgIDQ1MTUsICAgICAgICAgMzA5MiwgICAgICAgICAxMzg1MiwgICAgIDQyNzcsCi0gICAgMTA0NjAsICAgICAgICAgIDgzMywgICAgICAgICAxNzMzOSwgICAgICA4MTAsCi0gICAgMTY4OTEsICAgICAgICAgMjI4OSwgICAgICAgICAxNTU0NiwgICAgIDgyMTcsCi0gICAgMTM2MDMsICAgICAgICAgMTY4NCwgICAgICAgICAgMzE5NywgICAgIDE4MzQsCi0gICAgMTU5NDgsICAgICAgICAgMjgyMCwgICAgICAgICAxNTgxMiwgICAgIDUzMjcsCi0gICAgMTcwMDYsICAgICAgICAgMjQzOCwgICAgICAgICAxNjc4OCwgICAgIDEzMjYsCi0gICAgMTU2NzEsICAgICAgICAgODE1NiwgICAgICAgICAxMTcyNiwgICAgIDg1NTYsCi0gICAgMzc2MiwgICAgICAgICAyMDUzLCAgICAgICAgICA5NTYzLCAgICAgMTMxNywKLSAgICAxMzU2MSwgICAgICAgICA2NzkwLCAgICAgICAgIDEyMjI3LCAgICAgMTkzNiwKLSAgICA4MTgwLCAgICAgICAgIDM1NTAsICAgICAgICAgMTMyODcsICAgICAxNzc4LAotICAgIDE2Mjk5LCAgICAgICAgIDY1OTksICAgICAgICAgMTYyOTEsICAgICA3NzU4LAotICAgIDg1MjEsICAgICAgICAgMjU1MSwgICAgICAgICAgNzIyNSwgICAgIDI2NDUsCi0gICAgMTgyNjksICAgICAgICAgNzQ4OSwgICAgICAgICAxNjg4NSwgICAgIDIyNDgsCi0gICAgMTc4ODIsICAgICAgICAgMjg4NCwgICAgICAgICAxNzI2NSwgICAgIDMzMjgsCi0gICAgOTQxNywgICAgICAgIDIwMTYyLCAgICAgICAgIDExMDQyLCAgICAgODMyMCwKLSAgICAxMjg2LCAgICAgICAgICA2MjAsICAgICAgICAgIDE0MzEsICAgICAgNTgzLAotICAgIDU5OTMsICAgICAgICAgMjI4OSwgICAgICAgICAgMzk3OCwgICAgIDM2MjYsCi0gICAgNTE0NCwgICAgICAgICAgNzUyLCAgICAgICAgIDEzNDA5LCAgICAgIDgzMCwKLSAgICA1NTUzLCAgICAgICAgIDI4NjAsICAgICAgICAgMTE3NjQsICAgICA1OTA4LAotICAgIDEwNzM3LCAgICAgICAgICA1NjAsICAgICAgICAgIDU0NDYsICAgICAgNTY0LAotICAgIDEzMzIxLCAgICAgICAgIDMwMDgsICAgICAgICAgMTE5NDYsICAgICAzNjgzLAotICAgIDE5ODg3LCAgICAgICAgICA3OTgsICAgICAgICAgIDk4MjUsICAgICAgNzI4LAotICAgIDEzNjYzLCAgICAgICAgIDg3NDgsICAgICAgICAgIDczOTEsICAgICAzMDUzLAotICAgIDI1MTUsICAgICAgICAgIDc3OCwgICAgICAgICAgNjA1MCwgICAgICA4MzMsCi0gICAgNjQ2OSwgICAgICAgICA1MDc0LCAgICAgICAgICA4MzA1LCAgICAgMjQ2MywKLSAgICA2MTQxLCAgICAgICAgIDE4NjUsICAgICAgICAgMTUzMDgsICAgICAxMjYyLAotICAgIDE0NDA4LCAgICAgICAgIDQ1NDcsICAgICAgICAgMTM2NjMsICAgICA0NTE1LAotICAgIDMxMzcsICAgICAgICAgMjk4MywgICAgICAgICAgMjQ3OSwgICAgIDEyNTksCi0gICAgMTUwODgsICAgICAgICAgNDY0NywgICAgICAgICAxNTM4MiwgICAgIDI2MDcsCi0gICAgMTQ0OTIsICAgICAgICAgMjM5MiwgICAgICAgICAxMjQ2MiwgICAgIDI1MzcsCi0gICAgNzUzOSwgICAgICAgICAyOTQ5LCAgICAgICAgIDEyOTA5LCAgICAxMjA2MCwKLSAgICA1NDY4LCAgICAgICAgICA2ODQsICAgICAgICAgIDMxNDEsICAgICAgNzIyLAotICAgIDUwODEsICAgICAgICAgMTI3NCwgICAgICAgICAxMjczMiwgICAgIDQyMDAsCi0gICAgMTUzMDIsICAgICAgICAgIDY4MSwgICAgICAgICAgNzgxOSwgICAgICA1OTIsCi0gICAgNjUzNCwgICAgICAgICAyMDIxLCAgICAgICAgIDE2NDc4LCAgICAgODczNywKLSAgICAxMzM2NCwgICAgICAgICAgODgyLCAgICAgICAgICA1Mzk3LCAgICAgIDg5OSwKLSAgICAxNDY1NiwgICAgICAgICAyMTc4LCAgICAgICAgIDE0NzQxLCAgICAgNDIyNywKLSAgICAxNDI3MCwgICAgICAgICAxMjk4LCAgICAgICAgIDEzOTI5LCAgICAgMjAyOSwKLSAgICAxNTQ3NywgICAgICAgICA3NDgyLCAgICAgICAgIDE1ODE1LCAgICAgNDU3MiwKLSAgICAyNTIxLCAgICAgICAgIDIwMTMsICAgICAgICAgIDUwNjIsICAgICAxODA0LAotICAgIDUxNTksICAgICAgICAgNjU4MiwgICAgICAgICAgNzEzMCwgICAgIDM1OTcsCi0gICAgMTA5MjAsICAgICAgICAgMTYxMSwgICAgICAgICAxMTcyOSwgICAgIDE3MDgsCi0gICAgMTY5MDMsICAgICAgICAgMzQ1NSwgICAgICAgICAxNjI2OCwgICAgIDY2NDAsCi0gICAgOTMwNiwgICAgICAgICAxMDA3LCAgICAgICAgICA5MzY5LCAgICAgMjEwNiwKLSAgICAxOTE4MiwgICAgICAgICA1MDM3LCAgICAgICAgIDEyNDQxLCAgICAgNDI2OSwKLSAgICAxNTkxOSwgICAgICAgICAxMzMyLCAgICAgICAgIDE1MzU3LCAgICAgMzUxMiwKLSAgICAxMTg5OCwgICAgICAgIDE0MTQxLCAgICAgICAgIDE2MTAxLCAgICAgNjg1NCwKLSAgICAyMDEwLCAgICAgICAgICA3MzcsICAgICAgICAgIDM3NzksICAgICAgODYxLAotICAgIDExNDU0LCAgICAgICAgIDI4ODAsICAgICAgICAgIDM1NjQsICAgICAzNTQwLAotICAgIDkwNTcsICAgICAgICAgMTI0MSwgICAgICAgICAxMjM5MSwgICAgICA4OTYsCi0gICAgODU0NiwgICAgICAgICA0NjI5LCAgICAgICAgIDExNTYxLCAgICAgNTc3NiwKLSAgICA4MTI5LCAgICAgICAgICA1ODksICAgICAgICAgIDgyMTgsICAgICAgNTg4LAotICAgIDE4NzI4LCAgICAgICAgIDM3NTUsICAgICAgICAgMTI5NzMsICAgICAzMTQ5LAotICAgIDE1NzI5LCAgICAgICAgICA3NTgsICAgICAgICAgMTY2MzQsICAgICAgNzU0LAotICAgIDE1MjIyLCAgICAgICAgMTExMzgsICAgICAgICAgMTU4NzEsICAgICAyMjA4LAotICAgIDQ2NzMsICAgICAgICAgIDYxMCwgICAgICAgICAxMDIxOCwgICAgICA2NzgsCi0gICAgMTUyNTcsICAgICAgICAgNDE0NiwgICAgICAgICAgNTcyOSwgICAgIDMzMjcsCi0gICAgODM3NywgICAgICAgICAxNjcwLCAgICAgICAgIDE5ODYyLCAgICAgMjMyMSwKLSAgICAxNTQ1MCwgICAgICAgICA1NTExLCAgICAgICAgIDE0MDU0LCAgICAgNTQ4MSwKLSAgICA1NzI4LCAgICAgICAgIDI4ODgsICAgICAgICAgIDc1ODAsICAgICAxMzQ2LAotICAgIDE0Mzg0LCAgICAgICAgIDUzMjUsICAgICAgICAgMTYyMzYsICAgICAzOTUwLAotICAgIDE1MTE4LCAgICAgICAgIDM3NDQsICAgICAgICAgMTUzMDYsICAgICAxNDM1LAotICAgIDE0NTk3LCAgICAgICAgIDQwNzAsICAgICAgICAgMTIzMDEsICAgIDE1Njk2LAotICAgIDc2MTcsICAgICAgICAgMTY5OSwgICAgICAgICAgMjE3MCwgICAgICA4ODQsCi0gICAgNDQ1OSwgICAgICAgICA0NTY3LCAgICAgICAgIDE4MDk0LCAgICAgMzMwNiwKLSAgICAxMjc0MiwgICAgICAgICAgODE1LCAgICAgICAgIDE0OTI2LCAgICAgIDkwNywKLSAgICAxNTAxNiwgICAgICAgICA0MjgxLCAgICAgICAgIDE1NTE4LCAgICAgODM2OCwKLSAgICAxNzk5NCwgICAgICAgICAxMDg3LCAgICAgICAgICAyMzU4LCAgICAgIDg2NSwKLSAgICAxNjI4MSwgICAgICAgICAzNzg3LCAgICAgICAgIDE1Njc5LCAgICAgNDU5NiwKLSAgICAxNjM1NiwgICAgICAgICAxNTM0LCAgICAgICAgIDE2NTg0LCAgICAgMjIxMCwKLSAgICAxNjgzMywgICAgICAgICA5Njk3LCAgICAgICAgIDE1OTI5LCAgICAgNDUxMywKLSAgICAzMjc3LCAgICAgICAgIDEwODUsICAgICAgICAgIDk2NDMsICAgICAyMTg3LAotICAgIDExOTczLCAgICAgICAgIDYwNjgsICAgICAgICAgIDkxOTksICAgICA0NDYyLAotICAgIDg5NTUsICAgICAgICAgMTYyOSwgICAgICAgICAxMDI4OSwgICAgIDMwNjIsCi0gICAgMTY0ODEsICAgICAgICAgNTE1NSwgICAgICAgICAxNTQ2NiwgICAgIDcwNjYsCi0gICAgMTM2NzgsICAgICAgICAgMjU0MywgICAgICAgICAgNTI3MywgICAgIDIyNzcsCi0gICAgMTY3NDYsICAgICAgICAgNjIxMywgICAgICAgICAxNjY1NSwgICAgIDM0MDgsCi0gICAgMjAzMDQsICAgICAgICAgMzM2MywgICAgICAgICAxODY4OCwgICAgIDE5ODUsCi0gICAgMTQxNzIsICAgICAgICAxMjg2NywgICAgICAgICAxNTE1NCwgICAgMTU3MDMsCi0gICAgNDQ3MywgICAgICAgICAxMDIwLCAgICAgICAgICAxNjgxLCAgICAgIDg4NiwKLSAgICA0MzExLCAgICAgICAgIDQzMDEsICAgICAgICAgIDg5NTIsICAgICAzNjU3LAotICAgIDU4OTMsICAgICAgICAgMTE0NywgICAgICAgICAxMTY0NywgICAgIDE0NTIsCi0gICAgMTU4ODYsICAgICAgICAgMjIyNywgICAgICAgICAgNDU4MiwgICAgIDY2NDQsCi0gICAgNjkyOSwgICAgICAgICAxMjA1LCAgICAgICAgICA2MjIwLCAgICAgIDc5OSwKLSAgICAxMjQxNSwgICAgICAgICAzNDA5LCAgICAgICAgIDE1OTY4LCAgICAgMzg3NywKLSAgICAxOTg1OSwgICAgICAgICAyMTA5LCAgICAgICAgICA5Njg5LCAgICAgMjE0MSwKLSAgICAxNDc0MiwgICAgICAgICA4ODMwLCAgICAgICAgIDE0NDgwLCAgICAgMjU5OSwKLSAgICAxODE3LCAgICAgICAgIDEyMzgsICAgICAgICAgIDc3NzEsICAgICAgODEzLAotICAgIDE5MDc5LCAgICAgICAgIDQ0MTAsICAgICAgICAgIDU1NTQsICAgICAyMDY0LAotICAgIDM2ODcsICAgICAgICAgMjg0NCwgICAgICAgICAxNzQzNSwgICAgIDIyNTYsCi0gICAgMTY2OTcsICAgICAgICAgNDQ4NiwgICAgICAgICAxNjE5OSwgICAgIDUzODgsCi0gICAgODAyOCwgICAgICAgICAyNzYzLCAgICAgICAgICAzNDA1LCAgICAgMjExOSwKLSAgICAxNzQyNiwgICAgICAgICA1NDc3LCAgICAgICAgIDEzNjk4LCAgICAgMjc4NiwKLSAgICAxOTg3OSwgICAgICAgICAyNzIwLCAgICAgICAgICA5MDk4LCAgICAgMzg4MCwKLSAgICAxODE3MiwgICAgICAgICA0ODMzLCAgICAgICAgIDE3MzM2LCAgICAxMjIwNywKLSAgICA1MTE2LCAgICAgICAgICA5OTYsICAgICAgICAgIDQ5MzUsICAgICAgOTg4LAotICAgIDk4ODgsICAgICAgICAgMzA4MSwgICAgICAgICAgNjAxNCwgICAgIDUzNzEsCi0gICAgMTU4ODEsICAgICAgICAgMTY2NywgICAgICAgICAgODQwNSwgICAgIDExODMsCi0gICAgMTUwODcsICAgICAgICAgMjM2NiwgICAgICAgICAxOTc3NywgICAgIDcwMDIsCi0gICAgMTE5NjMsICAgICAgICAgMTU2MiwgICAgICAgICAgNzI3OSwgICAgIDExMjgsCi0gICAgMTY4NTksICAgICAgICAgMTUzMiwgICAgICAgICAxNTc2MiwgICAgIDUzODEsCi0gICAgMTQ3MDgsICAgICAgICAgMjA2NSwgICAgICAgICAyMDEwNSwgICAgIDIxNTUsCi0gICAgMTcxNTgsICAgICAgICAgODI0NSwgICAgICAgICAxNzkxMSwgICAgIDYzMTgsCi0gICAgNTQ2NywgICAgICAgICAxNTA0LCAgICAgICAgICA0MTAwLCAgICAgMjU3NCwKLSAgICAxNzQyMSwgICAgICAgICA2ODEwLCAgICAgICAgICA1NjczLCAgICAgMjg4OCwKLSAgICAxNjYzNiwgICAgICAgICAzMzgyLCAgICAgICAgICA4OTc1LCAgICAgMTgzMSwKLSAgICAyMDE1OSwgICAgICAgICA0NzM3LCAgICAgICAgIDE5NTUwLCAgICAgNzI5NCwKLSAgICA2NjU4LCAgICAgICAgIDI3ODEsICAgICAgICAgMTE0NzIsICAgICAzMzIxLAotICAgIDE5Mzk3LCAgICAgICAgIDUwNTQsICAgICAgICAgMTg4NzgsICAgICA0NzIyLAotICAgIDE2NDM5LCAgICAgICAgIDIzNzMsICAgICAgICAgMjA0MzAsICAgICA0Mzg2LAotICAgIDExMzUzLCAgICAgICAgMjY1MjYsICAgICAgICAgMTE1OTMsICAgICAzMDY4LAotICAgIDI4NjYsICAgICAgICAgMTU2NiwgICAgICAgICAgNTEwOCwgICAgIDEwNzAsCi0gICAgOTYxNCwgICAgICAgICA0OTE1LCAgICAgICAgICA0OTM5LCAgICAgMzUzNiwKLSAgICA3NTQxLCAgICAgICAgICA4NzgsICAgICAgICAgMjA3MTcsICAgICAgODUxLAotICAgIDY5MzgsICAgICAgICAgNDM5NSwgICAgICAgICAxNjc5OSwgICAgIDc3MzMsCi0gICAgMTAxMzcsICAgICAgICAgMTAxOSwgICAgICAgICAgOTg0NSwgICAgICA5NjQsCi0gICAgMTU0OTQsICAgICAgICAgMzk1NSwgICAgICAgICAxNTQ1OSwgICAgIDM0MzAsCi0gICAgMTg4NjMsICAgICAgICAgIDk4MiwgICAgICAgICAyMDEyMCwgICAgICA5NjMsCi0gICAgMTY4NzYsICAgICAgICAxMjg4NywgICAgICAgICAxNDMzNCwgICAgIDQyMDAsCi0gICAgNjU5OSwgICAgICAgICAxMjIwLCAgICAgICAgICA5MjIyLCAgICAgIDgxNCwKLSAgICAxNjk0MiwgICAgICAgICA1MTM0LCAgICAgICAgICA1NjYxLCAgICAgNDg5OCwKLSAgICA1NDg4LCAgICAgICAgIDE3OTgsICAgICAgICAgMjAyNTgsICAgICAzOTYyLAotICAgIDE3MDA1LCAgICAgICAgIDYxNzgsICAgICAgICAgMTc5MjksICAgICA1OTI5LAotICAgIDkzNjUsICAgICAgICAgMzQyMCwgICAgICAgICAgNzQ3NCwgICAgIDE5NzEsCi0gICAgMTk1MzcsICAgICAgICAgNTE3NywgICAgICAgICAxOTAwMywgICAgIDMwMDYsCi0gICAgMTY0NTQsICAgICAgICAgMzc4OCwgICAgICAgICAxNjA3MCwgICAgIDIzNjcsCi0gICAgODY2NCwgICAgICAgICAyNzQzLCAgICAgICAgICA5NDQ1LCAgICAyNjM1OCwKLSAgICAxMDg1NiwgICAgICAgICAxMjg3LCAgICAgICAgICAzNTU1LCAgICAgMTAwOSwKLSAgICA1NjA2LCAgICAgICAgIDM2MjIsICAgICAgICAgMTk0NTMsICAgICA1NTEyLAotICAgIDEyNDUzLCAgICAgICAgICA3OTcsICAgICAgICAgMjA2MzQsICAgICAgOTExLAotICAgIDE1NDI3LCAgICAgICAgIDMwNjYsICAgICAgICAgMTcwMzcsICAgIDEwMjc1LAotICAgIDE4ODgzLCAgICAgICAgIDI2MzMsICAgICAgICAgIDM5MTMsICAgICAxMjY4LAotICAgIDE5NTE5LCAgICAgICAgIDMzNzEsICAgICAgICAgMTgwNTIsICAgICA1MjMwLAotICAgIDE5MjkxLCAgICAgICAgIDE2NzgsICAgICAgICAgMTk1MDgsICAgICAzMTcyLAotICAgIDE4MDcyLCAgICAgICAgMTA3NTQsICAgICAgICAgMTY2MjUsICAgICA2ODQ1LAotICAgIDMxMzQsICAgICAgICAgMjI5OCwgICAgICAgICAxMDg2OSwgICAgIDI0MzcsCi0gICAgMTU1ODAsICAgICAgICAgNjkxMywgICAgICAgICAxMjU5NywgICAgIDMzODEsCi0gICAgMTExMTYsICAgICAgICAgMzI5NywgICAgICAgICAxNjc2MiwgICAgIDI0MjQsCi0gICAgMTg4NTMsICAgICAgICAgNjcxNSwgICAgICAgICAxNzE3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ICAgICoKLSAgICAgKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICoKLSAgICAgKiAgIHF1YV9lbmVyICAgICAgID0gbG9nMihnKSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICoKLSAgICAgKiAgIHF1YV9lbmVyX01SMTIyID0gMjAqbG9nMTAoZykgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICoKLSAgICAgKi0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSovCi0KLSAgICAvKiBMb2cyKHggUTEyKSA9IGxvZzIoeCkgKyAxMiAqLwotICAgIExvZzIoKFdvcmQzMikgZ19jb2RlLCAmZXhwLCAmZnJhYywgcE92ZXJmbG93KTsKLSAgICBleHAgLT0gMTI7Ci0KLSAgICB0bXAgPSBzaHJfcihmcmFjLCA1LCBwT3ZlcmZsb3cpOwotICAgIHF1YV9lbmVyX01SMTIyID0gZXhwIDw8IDEwOwotICAgIHF1YV9lbmVyX01SMTIyID0gdG1wICsgcXVhX2VuZXJfTVIxMjI7Ci0KLSAgICAvKiAyNDY2MCBRMTIgfj0gNi4wMjA2ID0gMjAqbG9nMTAoMikgKi8KLSAgICBMX3RtcCA9IE1weV8zMl8xNihleHAsIGZyYWMsIDI0NjYwLCBwT3ZlcmZsb3cpOwotICAgIExfdG1wID0gTF90bXAgPDwgMTM7Ci0KLSAgICAvKiBRMTIgKiBRMCA9IFExMyAtPiBRMTAgKi8KLSAgICBxdWFfZW5lciA9IChXb3JkMTYpKChMX3RtcCArIChXb3JkMzIpIDB4MDAwMDgwMDBMKSA+PiAxNik7Ci0KLSAgICBnY19wcmVkX3VwZGF0ZShwcmVkX3N0LCBxdWFfZW5lcl9NUjEyMiwgcXVhX2VuZXIpOwotCi0gICAgcmV0dXJuOwotfQotCi0vKioqKioqKioqK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gPSBjb2RfZ2Fpbl9leHAgLSBleHBfZ2NvZGUwOwotICAgICAgICB0bXAgLT0gMTsKLQotICAgICAgICBMb2cyKChXb3JkMzIpIGZyYWMsICZleHAsICZmcmFjLCBwT3ZlcmZsb3cpOwotICAgICAgICBleHAgKz0gdG1wOwotCi0gICAgICAgIC8qIGNhbGN1bGF0ZSBwcmVkaWN0aW9uIGVycm9yIChsb2cyLCBRMTApICovCi0gICAgICAgIHF1YV9lbmVyX01SMTIyID0gc2hyX3IoZnJhYywgNSwgcE92ZXJmbG93KTsKLSAgICAgICAgdG1wID0gZXhwIDw8IDEwOwotICAgICAgICBxdWFfZW5lcl9NUjEyMiArPSB0bXA7Ci0KLSAgICAgICAgaWYgKHF1YV9lbmVyX01SMTIyID4gTUFYX1FVQV9FTkVSX01SMTIyKQotICAgICAgICB7Ci0gICAgICAgICAgICBxdWFfZW5lciA9IE1BWF9RVUFfRU5FUjsKLSAgICAgICAgICAgIHF1YV9lbmVyX01SMTIyID0gTUFYX1FVQV9FTkVSX01SMTIyOwotICAgICAgICB9Ci0gICAgICAgIGVsc2UKLSAgICAgICAgewotICAgICAgICAgICAgLyogY2FsY3VsYXRlIHByZWRpY3Rpb24gZXJyb3IgKDIwKmxvZzEwLCBRMTApICovCi0gICAgICAgICAgICBMX3RtcCA9IE1weV8zMl8xNihleHAsIGZyYWMsIDI0NjYwLCBwT3ZlcmZsb3cpOwotICAgICAgICAgICAgLyogMjQ2NjAgUTEyIH49IDYuMDIwNiA9IDIwKmxvZzEwKDIpICovCi0gICAgICAgICAgICBMX3RtcCA9ICBMX3NobChMX3RtcCwgMTMsIHBPdmVyZmxvdyk7Ci0gICAgICAgICAgICBxdWFfZW5lciA9IHB2X3JvdW5kKExfdG1wLCBwT3ZlcmZsb3cpOwotCi0gICAgICAgICAgICAvKiBRMTIgKiBRMCA9IFExMyAtPiBRMjYgLT4gUTEwICAgICAqLwotICAgICAgICB9Ci0gICAgfQotCi0gICAgLyogdXBkYXRlIE1BIH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IH5+fn5+fn5+fn5+fn5+fn5+fn5+fn5+ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKgotICAgICAqICBnYzAgICAgID0gMl5leHBfZ2NvZGUwICsgMl5mcmFjX2djb2RlMCAgICAgICAgICAgICAgICAgICAgICAgICAgICoKLSAgICAgKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqCi0gICAgICogIGdjb2RlMCAoUTE0KSA9IDJeMTQqMl5mcmFjX2djb2RlMCA9IGdjMCAqIDJeKDE0LWV4cF9nY29kZTApICAgICAgKgotICAgICAqLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSoKLQotICAgIHNmMF9nY29kZTAgPSBleHRyYWN0X2woUG93MigxNCwgc2YwX2ZyYWNfZ2NvZGUwKSk7Ci0gICAgc2YxX2djb2RlMCA9IGV4dHJhY3RfbChQb3cyKDE0LCBzZjFfZnJhY19nY29kZTApKTsKLQotICAgICAqIEZvciBlYWNoIHN1YmZyYW1lLCB0aGUgZXJyb3IgZW5lcmd5IChzdW0pIHRvIGJlIG1pbmltaXplZCBjb25zaXN0cwotICAgICAqIG9mIGZpdmUgdGVybXMsIHRbMC4uNF0uCi0gICAgICoKLSAgICAgKiAgICAgICAgICAgICAgICAgICAgICB0WzBdID0gICAgZ3BeMiAgKiA8eTEgeTE+Ci0gICAgICogICAgICAgICAgICAgICAgICAgICAgdFsxXSA9IC0yKmdwICAgICogPHhuIHkxPgotICAgICAqICAgICAgICAgICAgICAgICAgICAgIHRbMl0gPSAgICBnY14yICAqIDx5MiB5Mj4KLSAgICAgKiAgICAgICAgICAgICAgICAgICAgICB0WzNdID0gLTIqZ2MgICAgKiA8eG4geTI+Ci0gICAgICogICAgICAgICAgICAgICAgICAgICAgdFs0XSA9ICAyKmdwKmdjICogPHkxIH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gIGNvZWZmaWNpZW50cyAwLi40Ci0gICAgICAgICAgICBleHAgPSAtMTsKLSAgICAgICAgfQotICAgIH0KLQotICAgIGZvciAoaSA9IDA7IGkgPCA1OyBpKyspCi0gICAgewotICAgICAgICBleHBfbWF4W2ldID0gYWRkIChleHBfbWF4W2ldLCBleHApOwotICAgIH0KLQotICAgICAqLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSoKLSAgICAgKiAgRmluZCBtYXhpbXVtIGV4cG9uZW50OiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqCi0gICAgICogIH5+fn5+fn5+fn5+fn5+fn5+fn5+fn4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKgotICAgICAqICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICoKLSAgICAgKiAgRm9yIHRoZSBzdW0gb3BlcmF0aW9uLCBhbGwgdGVybXMgbXVzdCBoYXZlIHRoZSBzYW1lIHNjYWxpbmc7ICAgICAqCi0gICAgICogIHRoYXQgc2NhbGluZyBzaG91bGQgYmUgbG93IGVub3VnaCB0byBwcmV2ZW50IG92ZXJmbG93LiBUaGVyZS0gICAgKgotICAgICAqICBmb3JlLCB0aGUgbWF4aW11bSBzY2FsZSBpcyBkZXRlcm1pbmVkIGFuZCBhbGwgY29lZmZpY2llbnRzIGFyZSAgICoKLSAgICAgKiAgcmUtc2NhbGVkOiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqCi0gICAgICogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKgotICAgICAqICAgIGV4cCA9IG1heChleHBfbWF4W2ldKSArIDE7ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICoKLSAgICAgKiAgICBlID0gZXhwX21heFtpXS1leHA7ICAgICAgICAgZSA8PSAwISAgICAgICAgICAgICAgICAgICAgICAgICAgICAqCi0gICAgICogICAgY1tpXSA9IGNbaV0qMl5lICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKgotICAgICAqLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSoKLQotICAgIGV4cCA9IGV4cF9tYXhbMF07Ci0gICAgZm9yIChpID0gMTsgaSA8IDEwOyBpKyspCi0gICAgewotICAgICAgICBpZiAoc3ViKGV4cF9tYXhbaV0sIGV4cCkgPiAwKQotICAgICAgICB7Ci0gICAgICAgICAgICBleHAgPSBleHBfbWF4W2ldOwotICAgICAgICB9Ci0gICAgfQotICAgIGV4cCA9IGFkZChleHAsIDEpOyAgICAgIC8vIFRvIGF2b2lkIG92ZXJmbG93Ci0KLSAgICBwID0gJnNmMF9mcmFjX2NvZWZmWzBdOwotICAgIGZvciAoaSA9IDA7IGkgPCA1OyBpKyspIHsKLSAgICAgICAgdG1wID0gc3ViKGV4cCwgZXhwX21heFtpXSk7Ci0gICAgICAgIExfdG1wID0gTF9kZXBvc2l0X2goKnArKyk7Ci0gICAgICAgIExfdG1wID0gTF9zaHIoTF90bXAsIHRtcCk7Ci0gICAgICAgIExfRXh0cmFjdChMX3RtcCwgJmNvZWZmW2ldLCAmY29lZmZfbG9baV0pOwotICAgIH0KLSAgICBwID0gJnNmMV9mcmFjX2NvZWZmWzBdOwotICAgIGZvciAoOyBpIDwgMTA7IGkrKykgewotICAgICAgICB0bXAgPSBzdWIoZXhwLCBleHBfbWF4W2ldKTsKLSAgICAgICAgTF90bXAgPSBMX2RlcG9zaXRfaCgqcCsrKTsKLSAgICAgICAgTF90bXAgPSBMX3NocihMX3RtcCwgdG1wKTsKLSAgICAgICAgTF9FeHRyYWN0KExfdG1wLCAmY29lZmZbaV0sICZjb2VmZl9sb1tpXSk7Ci0gICAgfQotCi0gICAgLy8tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tKgotICAgICAqICBDb2RlYm9vayBzZWFyY2g6ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICoKLSAgICAgKiAgfn5+fn5+fn5+fn5+fn5+fiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqCi0gICAgICogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKgotICAgICAqICBGb3IgZWFjaCBwYWlyIChnX3BpdGNoLCBnX2ZhYykgaW4gdGhlIHRhYmxlIGNhbGN1bGF0ZSB0aGUgICAgICAgICoKLSAgICAgKiAgdGVybXMgdFswLi40XSBhbmQgc3VtIHRoZW0gdXA7IHRoZSByZXN1bHQgaXMgdGhlIG1lYW4gc3F1YXJlZCAgICAqCi0gICAgICogIGVycm9yIGZvciB0aGUgcXVhbnRpemVkIGdhaW5zIGZyb20gdGhlIHRhYmxlLiBUaGUgaW5kZXggZm9yIHRoZSAgKgotICAgICAqICBtaW5pbXVtIE1TRSBpcyBzdG9yZWQgYW5kIGZpbmFsbHkgdXNlZCB0byByZXRyaWV2ZSB0aGUgcXVhbnRpemVkICoKLSAgICAgKiAgZ2FpbnMgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqCi0gICAgICotLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tCi0KLSAgICAvLyBzdGFydCB3aXRoICJpbmZpbml0ZSIgTVNFCi0gICAgZGlzdF9taW4gPSB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nArKzsKLQotICAgICAgICBpZiAodG1wIDw9IDAgJiYgc3ViKGdfcGl0Y2gsIGdwX2xpbWl0KSA8PSAwKQotICAgICAgICB7Ci0gICAgICAgICAgICBnX2NvZGUgPSBtdWx0KGdfY29kZSwgc2YxX2djb2RlMCk7Ci0gICAgICAgICAgICBnMl9waXRjaCA9IG11bHQoZ19waXRjaCwgZ19waXRjaCk7Ci0gICAgICAgICAgICBnMl9jb2RlID0gbXVsdChnX2NvZGUsIGdfY29kZSk7Ci0gICAgICAgICAgICBnX3BpdF9jb2QgPSBtdWx0KGdfY29kZSwgZ19waXRjaCk7Ci0KLSAgICAgICAgICAgIExfdG1wID0gTWFjXzMyXzE2KExfdG1wLCBjb2VmZls1XSwgY29lZmZfbG9bNV0sIGcyX3BpdGNoKTsKLSAgICAgICAgICAgIExfdG1wID0gTWFjXzMyXzE2KExfdG1wLCBjb2VmZls2XSwgY29lZmZfbG9bNl0sIGdfcGl0Y2gpOwotICAgICAgICAgICAgTF90bXAgPSBNYWNfMzJfMTYoTF90bXAsIGNvZWZmWzddLCBjb2VmZl9sb1s3XSwgZzJfY29kZSk7Ci0gICAgICAgICAgICBMX3RtcCA9IE1hY18zMl8xNihMX3RtcCwgY29lZmZbOF0sIGNvZWZmX2xvWzhdLCBnX2NvZGUpOwotICAgICAgICAgICAgTF90bXAgPSBNYWNfMzJfMTYoTF90bXAsIGNvZWZmWzldLCBjb2VmZl9sb1s5XSwgZ19waXRfY29kKTsKLQotICAgICAgICAgICAgLy8gc3RvcmUgdGFibGUgaW5kZXggaWYgTVNFIGZvciB0aGlzIGluZGV4IGlzIGxvd2VyCi0gICAgICAgICAgICAgICB0aGFuIHRoZSBtaW5pbXVtIE1TRSBzZWVuIHNvIGZhcgotICAgICAgICAgICAgaWYgKExfc3ViKExfdG1wLCBkaXN0X21pbikgPCAoV29yZDMyKSAwKQotICAgICAgICAgICAgewotICAgICAgICAgICAgICAgIGRpc3RfbWluID0gTF90bXA7Ci0gICAgICAgICAgIC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ZW50KSwgICAgICBRMCAgKi8KLSAgICBXb3JkMTYgc2YxX2ZyYWNfZ2NvZGUwLCAgICAvKiBpICA6IHByZWRpY3RlZCBDQiBnYWluIChmcmFjdGlvbiksICAgICAgUTE1ICovCi0gICAgV29yZDE2IHNmMV9leHBfY29lZmZbXSwgICAgLyogaSAgOiBlbmVyZ3kgY29lZmYuICg1KSwgZXhwb25lbnQgcGFydCwgIFEwICAqLwotICAgIFdvcmQxNiBzZjFfZnJhY19jb2VmZltdLCAgIC8qIGkgIDogZW5lcmd5IGNvZWZmLiAoNSksIGZyYWN0aW9uIHBhcnQsICBRMTUgKi8KLSAgICAvKiAgICAgIChmcmFjX2NvZWZmIGFuZCBleHBfY29lZmYgY29tcHV0ZWQgaW4gICovCi0gICAgLyogICAgICAgY2FsY19maWx0X2VuZXJnaWVzKCkpICAgICAgICAgICAgICAgICAqLwotICAgIFdvcmQxNiBzZjFfZXhwX3RhcmdldF9lbiwgIC8qIGkgIDogZXhwb25lbnQgb2YgdGFyZ2V0IGVuZXJneSwgICAgICAgICBRMCAgKi8KLSAgICBXb3JkMTYgc2YxX2ZyYWNfdGFyZ2V0X2VuLCAvKiBpICA6IGZyYWN0aW9uIG9mIHRhcmdldCBlbmVyZ3ksICAgICAgICAgUTE1ICovCi0KLSAgICBXb3JkMTYgZ3BfbGltaXQsICAgICAgICAgICAvKiBpICA6IHBpdGNoIGdhaW4gbGltaXQgICAgICAgICAgICAgICAgICAgICAgICovCi0KLSAgICBXb3JkMTYgKnNmMF9nYWluX3BpdCwgICAgICAvKiBvICA6IFBpdGNoIGdhaW4sICAgICAgICAgICAgICAgICAgICAgICAgUTE0ICovCi0gICAgV29yZDE2ICpzZjBfZ2Fpbl9jb2QsICAgICAgLyogbyAgOiBDb2RlIGdhaW4sICAgICAgICAgICAgICAgICAgICAgICAgIFExICAqLwotCi0gICAgV29yZDE2ICpzZjFfZ2Fpbl9waXQsICAgICAgLyogbyAgOiBQaXRjaCBnYWluLCAgICAgICAgICAgICAgICAgICAgICAgIFExNCAqLwotICAgIFdvcmQxNiAqc2YxX2dhaW5fY29kLCAgICAgIC8qIG8gIDogQ29kZSBnYWluLCAgICAgICAgICAgICAgICAgICAgICAgICBRMSAgKi8KLSAgICBGbGFnICAgKnBPdmVyZmxvdyAgICAgICAgICAvKiBvICA6IG92ZXJmbG93IGluZGljYXRvciAgICAgICAgICAgICAgICAgICAgICovCi0pCi17Ci0gICAgY29uc3QgV29yZDE2ICpwOwotICAgIFdvcmQxNiBpOwotICAgIFdvcmQxNiBpbmRleCA9IDA7Ci0gICAgV29yZDE2IHRtcDsKLSAgICBXb3JkMTYgZXhwOwotICAgIFdvcmQxNiBzZjBfZ2NvZGUwOwotICAgIFdvcmQxNiBzZjFfZ2NvZGUwOwotICAgIFdvcmQxNiBnX3BpdGNoOwotICAgIFdvcmQxNiBnMl9waXRjaDsKLSAgICBXb3JkMTYgZ19jb2RlOwotICAgIFdvcmQxNiBnMl9jb2RlOwotICAgIFdvcmQxNiBnX3BpdF9jb2Q7Ci0gICAgV29yZDE2IGNvZWZmWzEwXTsKLSAgICBXb3JkMTYgY29lZmZfbG9bMTBdOwotICAgIFdvcmQxNiBleHBfbWF4WzEwXTsgIC8qIDAuLjQ6IHNmMDsgNS4uOTogc2YxICovCi0gICAgV29yZDMyIExfdG1wOwotICAgIFdvcmQzMiBkaXN0X21pbjsKLQotICAgIC8qLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSoKLSAgICAgKiAgcHJlZGljdGVkIGNvZGVib29rIGdhaW4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqCi0gICAgICogIH5+fn5+fn5+fn5+fn5+fn5+fn5+fn5+ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKgotICAgICAqICBnYzAgICAgID0gMl5leHBfZ2NvZGUwICsgMl5mcmFjX2djb2RlMCAgICAgICAgICAgICAgICAgICAgICAgICAgICoKLSAgICAgKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqCi0gICAgICogIGdjb2RlMCAoUTE0KSA9IDJeMTQqMl5mcmFjX2djb2RlMCA9IGdjMCAqIDJeKDE0LWV4cF9nY29kZTApICAgICAgKgotICAgICAqLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSovCi0KLSAgICBzZjBfZ2NvZGUwID0gKFdvcmQxNikoUG93MigxNCwgc2YwX2ZyYWNfZ2NvZGUwLCBwT3ZlcmZsb3cpKTsKLSAgICBzZjFfZ2NvZGUwID0gKFdvcmQxNikoUG93MigxNCwgc2YxX2ZyYWNfZ2NvZGUwLCBwT3ZlcmZsb3cpKTsKLQotICAgIC8qCi0gICAgICogRm9yIGVhY2ggc3ViZnJhbWUsIHRoZSBlcnJvciBlbmVyZ3kgKHN1bSkgdG8gYmUgbWluaW1pemVkIGNvbnNpc3RzCi0gICAgICogb2YgZml2ZSB0ZXJtcywgdFswLi40XS4KLSAgICAgKgotICAgICAqICAgICAgICAgICAgICAgICAgICAgIHRbMF0gPSAgICBncF4yICAqIDx5MSB5MT4KLSAgICAgKiAgICAgICAgICAgICAgICAgICAgICB0WzFdID0gLTIqZ3AgICAgKiA8eG4geTE+Ci0gICAgICogICAgICAgICAgICAgICAgICAgICAgdFsyXSA9ICAgIGdjXjIgICogPHkyIHkyPgotICAgICAqICAgICAgICAgICAgICAgICAgICAgIHRbM10gPSAtMipnYyAgICAqIDx4biB5Mj4KLSAgICAgKiAgICAgICAgICAgICAgICAgICAgICB0WzRdID0gIDIqZ3AqZ2MgKiA8eTEgeTI+Ci0gICAgICoKLSAgICAgKi8KLQotICAgIC8qIHNmIDAgKi8KLSAgICAvKiBkZXRlcm1pbmUgdGhlIHNjY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FyZ2V0IGVuZXJneSBkaWZmZXJlbmNlOyBzZXQgZXhwIHRvICsxIG9yIC0xIHRvIHNjYWxlCi0gICAgICogdXAvZG93biBjb2VmZmljaWVudHMgZm9yIHNmIDEKLSAgICAgKi8KLSAgICB0bXAgPSBzaHJfcihzZjFfZnJhY190YXJnZXRfZW4sIDEsIHBPdmVyZmxvdyk7ICAvKiB0bXAgPSBjZWlsKDAuNSplbihzZjEpKSAqLwotCi0gICAgaWYgKHRtcCA+IHNmMF9mcmFjX3RhcmdldF9lbikgICAgICAgICAgLyogdG1wID4gZW4oc2YwKT8gKi8KLSAgICB7Ci0gICAgICAgIC8qCi0gICAgICAgICAqIHRhcmdldF9lbmVyZ3koc2YxKSA+IDIqdGFyZ2V0X2VuZXJneShzZjApCi0gICAgICAgICAqICAgLT4gc2NhbGUgdXAgTVNFKHNmMCkgYnkgMiBieSBhZGRpbmcgMSB0byBleHBvbmVudHMgMC4uNAotICAgICAgICAgKi8KLSAgICAgICAgZXhwID0gMTsKLSAgICB9Ci0gICAgZWxzZQotICAgIHsKLSAgICAgICAgdG1wID0gKChzZjBfZnJhY190YXJnZXRfZW4gKyAzKSA+PiAyKTsgLyogdG1wPWNlaWwoMC4yNSplbihzZjApKSAqLwotCi0gICAgICAgIGlmICh0bXAgPiBzZjFfZnJhY190YXJnZXRfZW4pICAgICAgLyogdG1wID4gZW4oc2YxKT8gKi8KLSAgICAgICAgewotICAgICAgICAgICAgLyoKLSAgICAgICAgICAgICAqIHRhcmdldF9lbmVyZ3koc2YxKSA8IDAuMjUqdGFyZ2V0X2VuZXJneShzZjApCi0gICAgICAgICAgICAgKiAgIC0+IHNjYWxlIGRvd24gTVNFKHNmMCkgYnkgMC41IGJ5IHN1YnRyYWN0aW5nIDEgZnJvbQotICAgICAgICAgICAgICogICAgICBjb2VmZmljaWVudHMgMC4uNAotICAgICAgICAgICAgICovCi0gICAgICAgICAgICBleHAgPSAtMTsKLSAgICAgICAgfQotICAgIH0KLQotICAgIGZvciAoaSA9IDA7IGkgPCA1OyBpKyspCi0gICAgewotICAgICAgICBleHBfbWF4W2ldICs9IGV4cDsKLSAgICB9Ci0KLSAgICAvKi0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0qCi0gICAgICogIEZpbmQgbWF4aW11bSBleHBvbmVudDogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKgotICAgICAqICB+fn5+fn5+fn5+fn5+fn5+fn5+fn5+ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICoKLSAgICAgKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqCi0gICAgICogIEZvciB0aGUgc3VtIG9wZXJhdGlvbiwgYWxsIHRlcm1zIG11c3QgaGF2ZSB0aGUgc2FtZSBzY2FsaW5nOyAgICAgKgotICAgICAqICB0aGF0IHNjYWxpbmcgc2hvdWxkIGJlIGxvdyBlbm91Z2ggdG8gcHJldmVudCBvdmVyZmxvdy4gVGhlcmUtICAgICoKLSAgICAgKiAgZm9yZSwgdGhlIG1heGltdW0gc2NhbGUgaXMgZGV0ZXJtaW5lZCBhbmQgYWxsIGNvZWZmaWNpZW50cyBhcmUgICAqCi0gICAgICogIHJlLXNjYWxlZDogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKgotICAgICAqICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICoKLSAgICAgKiAgICBleHAgPSBtYXgoZXhwX21heFtpXSkgKyAxOyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqCi0gICAgICogICAgZSA9IGV4cF9tYXhbaV0tZXhwOyAgICAgICAgIGUgPD0gMCEgICAgICAgICAgICAgICAgICAgICAgIC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ci0gICAgICAgIGNvZWZmW2ldID0gKFdvcmQxNikoTF90bXAgPj4gMTYpOwotICAgICAgICBjb2VmZl9sb1tpXSA9IChXb3JkMTYpKChMX3RtcCA+PiAxKSAtICgoTF90bXAgPj4gMTYpIDw8IDE1KSk7Ci0gICAgfQotCi0KLSAgICAvKi0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0qCi0gICAgICogIENvZGVib29rIHNlYXJjaDogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKgotICAgICAqICB+fn5+fn5+fn5+fn5+fn5+ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICoKLSAgICAgKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqCi0gICAgICogIEZvciBlYWNoIHBhaXIgKGdfcGl0Y2gsIGdfZmFjKSBpbiB0aGUgdGFibGUgY2FsY3VsYXRlIHRoZSAgICAgICAgKgotICAgICAqICB0ZXJtcyB0WzAuLjRdIGFuZCBzdW0gdGhlbSB1cDsgdGhlIHJlc3VsdCBpcyB0aGUgbWVhbiBzcXVhcmVkICAgICoKLSAgICAgKiAgZXJyb3IgZm9yIHRoZSBxdWFudGl6ZWQgZ2FpbnMgZnJvbSB0aGUgdGFibGUuIFRoZSBpbmRleCBmb3IgdGhlICAqCi0gICAgICogIG1pbmltdW0gTVNFIGlzIHN0b3JlZCBhbmQgZmluYWxseSB1c2VkIHRvIHJldHJpZXZlIHRoZSBxdWFudGl6ZWQgKgotICAgICAqICBnYWlucyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICoKLSAgICAgKi0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tL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pY3RvciB1c2luZyBxdWFudGl6ZWQgZ2FpbnMgKi8KLSAgICB0bXAgPSBpbmRleCA8PCAyOwotICAgIE1SNDc1X3F1YW50X3N0b3JlX3Jlc3VsdHMocHJlZF9zdCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICZ0YWJsZV9nYWluX01SNDc1W3RtcF0sCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzZjBfZ2NvZGUwLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2YwX2V4cF9nY29kZTAsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzZjBfZ2Fpbl9waXQsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzZjBfZ2Fpbl9jb2QsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwT3ZlcmZsb3cpOwotCi0gICAgLyogY2FsY3VsYXRlIG5ldyBwcmVkaWN0ZWQgZ2FpbiBmb3Igc3ViZnJhbWUgMSAodGhpcyB0aW1lIHVzaW5nCi0gICAgICAgdGhlIHJlYWwsIHF1YW50aXplZCBnYWlucykgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0gICAgZ2NfcHJlZChwcmVkX3N0LCBNUjQ3NSwgc2YxX2NvZGVfbm9zaGFycCwKLSAgICAgICAgICAgICZzZjFfZXhwX2djb2RlMCwgJnNmMV9mcmFjX2djb2RlMCwKLSAgICAgICAgICAgICZzZjBfZXhwX2djb2RlMCwgJnNmMF9nY29kZTAsIC8qIGR1bW15IGFyZ3MgKi8KLSAgICAgICAgICAgIHBPdmVyZmxvdyk7Ci0KLSAgICBzZjFfZ2NvZGUwID0gKFdvcmQxNikoUG93MigxNCwgc2YxX2ZyYWNfZ2NvZGUwLCBwT3ZlcmZsb3cpKTsKLQotICAgIHRtcCArPSAyOwotICAgIE1SNDc1X3F1YW50X3N0b3JlX3Jlc3VsdHMoCi0gICAgICAgIHByZWRfc3QsCi0gICAgICAgICZ0YWJsZV9nYWluX01S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gICAgLyotLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tCi0gICAgOyBHTE9CQUwgRlVOQ1RJT04gREVGSU5JVElPTlMKLSAgICA7IFtMaXN0IGZ1bmN0aW9uIHByb3RvdHlwZXMgaGVyZV0KLSAgICAtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tKi8KLQotICAgIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCi0gICAgICoKLSAgICAgKiBGVU5DVElPTjogIE1SNDc1X3VwZGF0ZV91bnFfcHJlZCgpCi0gICAgICoKLSAgICAgKiBQVVJQT1NFOiAgIHVzZSBvcHRpbXVtIGNvZGVib29rIGdhaW4gYW5kIHVwZGF0ZSAidW5xdWFudGl6ZWQiCi0gICAgICogICAgICAgICAgICBnYWluIHByZWRpY3RvciB3aXRoIHRoZSAoYm91bmRlZCkgcHJlZGljdGlvbiBlcnJvcgotICAgICAqCi0gICAgICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0gICAgdm9pZAotICAgIE1SNDc1X3VwZGF0ZV91bnFfcHJlZCgKLSAgICAgICAgZ2NfcHJlZFN0YXRlICpwcmVkX3N0LCAvKiBpL286IGdhaW4gcHJlZGljdG9yIHN0YXRlIHN0cnVjdCAgICAgICAgICAgICovCi0gICAgICAgIFdvcmQxNiBleHBfZ2NvZGUwLCAgICAgLyogaSAgOiBwcmVkaWN0ZWQgQ0IgZ2FpbiAoZXhwb25lbnQpLCAgICAgIFEwICAqLwotICAgICAgICBXb3JkMTYgZnJhY19nY29kZTAsICAgIC8qIGkgIDogcHJlZGljdGVkIENCIGdhaW4gKGZyYWN0aW9uKSwgICAgICBRMTUgKi8KLSAgICAgICAgV29yZDE2IGNvZF9nYWluX2V4cCwgICAvKiBpICA6IG9wdGltdW0gY29kZWJvb2sgZ2FpbiAoZXhwb25lbnQpLCAgUTAgICovCi0gICAgICAgIFdvcmQxNiBjb2RfZ2Fpbl9mcmFjLCAgLyogaSAgOiBvcHRpbXVtIGNvZGVib29rIGdhaW4gKGZyYWN0aW9uKSwgIFExNSAqLwotICAgICAgICBGbGFnICAgKnBPdmVyZmxvdyAgICAgIC8qIG8gIDogb3ZlcmZsb3cgaW5kaWNhdG9yICAgICAgICAgICAgICAgICAgICAgKi8KLSAgICApOwotCi0gICAgLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKLSAgICAgKgotICAgICAqIEZVTkNUSU9OOiAgTVI0NzVfZ2Fpbl9xdWFudCgpCi0gICAgICoKLSAgICAgKiBQVVJQT1NFOiBRdWFudGl6YXRpb24gb2YgcGl0Y2ggYW5kIGNvZGVib29rIGdhaW5zIGZvciB0d28gc3ViZnJhbWVzCi0gICAgICogICAgICAgICAgKHVzaW5nIHByZWRpY3RlZCBjb2RlYm9vayBnYWluKQotICAgICAqCi0gICAgICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0KLSAgICBXb3JkMTYKLSAgICBNUjQ3NV9nYWluX3F1YW50KCAgICAgICAgICAgICAgLyogbyAgOiBpbmRleCBvZiBxdWFudGl6YXRpb24uICAgICAgICAgICAgICAgICAqLwotICAgICAgICBnY19wcmVkU3RhdGUgKnByZWRfc3QsICAgICAvKiBpL286IGdhaW4gcHJlZGljdG9yIHN0YXRlIHN0cnVjdCAgICAgICAgICAgICovCi0KLSAgICAgICAgLyogZGF0YSBmcm9tIHN1YmZyYW1lIDAgKG9yIDIp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X2djb2RlMCAgICAgLS0gV29yZDE2ICAgICAgIC0tIHByZWRpY3RlZCBDQiBnYWluIChleHBvbmVudCksIFEwCi0gICAgZ2NvZGUwICAgICAgICAgLS0gV29yZDE2ICAgICAgIC0tIHByZWRpY3RlZCBDQiBnYWluIChub3JtLikKLSAgICBnX3BpdGNoX2NhbmRbXSAtLSBXb3JkMTYgYXJyYXkgLS0gUGl0Y2ggZ2FpbiBjYW5kaWRhdGVzICgzKSwgICAgUTE0Ci0gICAgZ19waXRjaF9jaW5kW10gLS0gV29yZDE2IGFycmF5IC0tIFBpdGNoIGdhaW4gY2FuZC4gaW5kaWNlcyAoMyksIFEwCi0gICAgZnJhY19jb2VmZltdICAgLS0gV29yZDE2IGFycmF5IC0tIGNvZWZmaWNpZW50cyAoNSksICAgICAgICAgICAgIFExNQotICAgIGV4cF9jb2VmZltdICAgIC0tIFdvcmQxNiBhcnJheSAtLSBlbmVyZ3kgY29lZmZpY2llbnRzICg1KSwgICAgICBRMAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb2VmZmljaWVudHMgZnJvbSBjYWxjX2ZpbHRfZW5lcigpCi0KLSBPdXRwdXRzOgotICAgIGdhaW5fcGl0ICAgICAgIC0tIFBvaW50ZXIgdG8gV29yZDE2IC0tIFBpdGNoIGdhaW4sICAgICAgICAgICAgICAgICAgICAgUTE0Ci0gICAgZ2Fpbl9waXRfaW5kICAgLS0gUG9pbnRlciB0byBXb3JkMTYgLS0gUGl0Y2ggZ2FpbiBpbmRleCwgICAgICAgICAgICAgICBRMAotICAgIGdhaW5fY29kICAgICAgIC0tIFBvaW50ZXIgdG8gV29yZDE2IC0tIENvZGUgZ2FpbiwgICAgICAgICAgICAgICAgICAgICAgUTEKLSAgICBnYWluX2NvZF9pbmQgICAtLSBQb2ludGVyIHRvIFdvcmQxNiAtLSBDb2RlIGdhaW4gaW5kZXgsICAgICAgICAgICAgICAgIFEwCi0gICAgcXVhX2VuZXJfTVIxMjIgLS0g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pbiwgICAgICAgICAgICAgICAgICAgUTE0ICovCi0gICAgV29yZDE2ICpnYWluX3BpdF9pbmQsICAgICAvKiBvICA6IFBpdGNoIGdhaW4gaW5kZXgsICAgICAgICAgICAgIFEwICAqLwotICAgIFdvcmQxNiAqZ2Fpbl9jb2QsICAgICAgICAgLyogbyAgOiBDb2RlIGdhaW4sICAgICAgICAgICAgICAgICAgICBRMSAgKi8KLSAgICBXb3JkMTYgKmdhaW5fY29kX2luZCwgICAgIC8qIG8gIDogQ29kZSBnYWluIGluZGV4LCAgICAgICAgICAgICAgUTAgICovCi0gICAgV29yZDE2ICpxdWFfZW5lcl9NUjEyMiwgICAvKiBvICA6IHF1YW50aXplZCBlbmVyZ3kgZXJyb3IsICAgICAgIFExMCAqLwotICAgIC8qICAgICAgKGZvciBNUjEyMiBNQSBwcmVkaWN0b3IgdXBkYXRlKSAgICovCi0gICAgV29yZDE2ICpxdWFfZW5lciwgICAgICAgICAvKiBvICA6IHF1YW50aXplZCBlbmVyZ3kgZXJyb3IsICAgICAgIFExMCAqLwotICAgIC8qICAgICAgKGZvciBvdGhlciBNQSBwcmVkaWN0b3IgdXBkYXRlKSAgICovCi0gICAgRmxhZyAgICpwT3ZlcmZsb3cgICAgICAgICAvKiBvICA6IG92ZXJmbG93IGluZGljYXRvciAgICAgICAgICAgICAgICAqLwotKQotewotICAgIGNvbnN0IFdvcmQxNiAqcDsKLSAgICBXb3JkMTYgaTsKLSAgICBXb3JkMTYgajsKLSAgICBXb3JkMTYgY29kX2luZDsKLSAgICBXb3JkMTYgcGl0X2luZDsKLSAgICBXb3JkMTYgZV9tYXg7Ci0gICAgV29yZDE2IGV4cF9jb2RlOwotICAgIFdvcmQxNiBnX3BpdGNoOwotICAgIFdvcmQxNiBnMl9waXRjaDsKLSAgICBXb3JkMTYgZ19jb2RlOwotICAgIFdvcmQxNiBnMl9jb2RlX2g7Ci0gICAgV29yZDE2IGcyX2NvZGVfbDsKLSAgICBXb3JkMTYgZ19waXRfY29kX2g7Ci0gICAgV29yZDE2IGdfcGl0X2NvZF9sOwotICAgIFdvcmQxNiBjb2VmZls1XTsKLSAgICBXb3JkMTYgY29lZmZfbG9bNV07Ci0gICAgV29yZDE2IGV4cF9tYXhbNV07Ci0gICAgV29yZDMyIExfdG1wOwotICAgIFdvcmQzMiBMX3RtcDA7Ci0gICAgV29yZDMyIGRpc3RfbWluOwotCi0gICAgLyoKLSAgICAgKiBUaGUgZXJyb3IgZW5lcmd5IChzdW0pIHRvIGJlIG1pbmltaXplZCBjb25zaXN0cyBvZiBmaXZlIHRlcm1zLCB0WzAuLjRdLgotICAgICAqCi0gICAgICogICAgICAgICAgICAgICAgICAgICAgdFswXSA9ICAgIGdwXjIgICogPHkxIHkxPgotICAgICAqICAgICAgICAgICAgICAgICAgICAgIHRbMV0gPSAtMipncCAgICAqIDx4biB5MT4KLSAgICAgKiAgICAgICAgICAgICAgICAgICAgICB0WzJdID0gICAgZ2NeMiAgKiA8eTIgeTI+Ci0gICAgICogICAgICAgICAgICAgICAgICAgICAgdFszXSA9IC0yKmdjICAgICogPHhuIHkyPgotICAgICAqICAgICAgICAgICAgICAgICAgICAgIHRbNF0gPSAgMipncCpnYyAqIDx5MSB5Mj4KLSAgICAgKgotICAgICAqLwotCi0gICAgLyogZGV0ZXJtaW5lIHRoZSBzY2FsaW5nIGV4cG9uZW50IGZvciBnX2NvZGU6IGVjID0gZWMwIC0gMTAgKi8KLSAgICBleHBfY29kZSA9IHN1YihleHBfZ2NvZGUwLCAxMCwgcE92ZXJmbG93KTsKLQotICAgIC8qIGNhbGN1bGF0ZSBleHBfbWF4W2ldID0gc1tpXS0xICovCi0gICAgZXhwX21heFswXSA9IHN1YihleHBfY29lZmZbMF0sIDEzLCBwT3ZlcmZsb3cpOwotICAgIGV4cF9tYXhbMV0gPSBzdWIoZXhwX2NvZWZmWzFdLCAxNCwgcE92ZXJmbG93KTsKLSAgICBleHBfbWF4WzJdID0gYWRkKGV4cF9jb2VmZlsyXSwgYWRkKDE1LCBzaGwoZXhwX2NvZGUsIDEsIHBPdmVyZmxvdyksIHBPdmVyZmxvdyksIHBPdmVyZmxvdyk7Ci0gICAgZXhwX21heFszXSA9IGFkZChleHBfY29lZmZbM10sIGV4cF9jb2RlLCBwT3ZlcmZsb3cpOwotICAgIGV4cF9tYXhbNF0gPSBhZGQoZXhwX2NvZWZmWzRdLCBhZGQoZXhwX2NvZGUsIDEsIHBPdmVyZmxvdyksIHBPdmVyZmxvdyk7Ci0KLQotICAgIC8qLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSoKLSAgICAgKiAgRmluZCBtYXhpbXVtIGV4cG9uZW50OiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqCi0gICAgICogIH5+fn5+fn5+fn5+fn5+fn5+fn5+fn4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKgotICAgICAqICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICoKLSAgICAgKiAgRm9yIHRoZSBzdW0gb3BlcmF0aW9uLCBhbGwgdGVybXMgbXVzdCBoYXZlIHRoZSBzYW1lIHNjYWxpbmc7ICAgICAqCi0gICAgICogIHRoYXQgc2NhbGluZyBzaG91bGQgYmUgbG93IGVub3VnaCB0byBwcmV2ZW50IG92ZXJmbG93LiBUaGVyZS0gICAgKgotICAgICAqICBmb3JlLCB0aGUgbWF4aW11bSBzY2FsZSBpcyBkZXRlcm1pbmVkIGFuZCBhbGwgY29lZmZpY2llbnRzIGFyZSAgICoKLSAgICAgKiAgcmUtc2NhbGVkOiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqCi0gICAgICogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKgotICAgICAqICAgIGVfbWF4ID0gbWF4KGV4cF9tYXhbaV0pICsgMTsgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICoKLSAgICAgKiAgICBlID0gZXhwX21heFtpXS1lX21heDsgICAgICAgICBlIDw9IDAhICAgICAgICAgICAgICAgICAgICAgICAgICAqCi0gICAgICogICAgY1tpXSA9IGNbaV0qMl5lICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKgotICAgICAqLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSovCi0KLSAgICBlX21heCA9IGV4cF9tYXhbMF07Ci0gICAgZm9yIChpID0gMTsgaSA8IDU7IGkrKykgICAgIC8qIGltcGxlbWVudGVkIGZsYXR0ZW5lZCAqLwotICAgIHsKLSAgICAgICAgaWYgKGV4cF9tYXhbaV0gPiBlX21heCkKLSAgICAgICAgewotICAgICAgICAgICAgZV9tYXggPSBleHBfbWF4W2ldOwotICAgICAgICB9Ci0gICAgfQotCi0gICAgZV9tYXggPSBhZGQoZV9tYXgsIDEsIHBPdmVyZmxvdyk7ICAgICAgLyogVG8gYXZvaWQgb3ZlcmZsb3cgKi8KLQotICAgIGZvciAoaSA9IDA7IGkgPCA1OyBpKyspCi0gICAgewotICAgICAgICBqID0gc3ViKGVfbWF4LCBleHBfbWF4W2ldLCBwT3ZlcmZsb3cpOwotICAgICAgICBMX3RtcCA9IExfZGVwb3NpdF9oKGZyYWNfY29lZmZbaV0pOwotICAgICAgICBMX3RtcCA9IExfc2hyKExfdG1wLCBqLCBwT3ZlcmZsb3cpOwotICAgICAgICBMX0V4dHJhY3QoTF90bXAsICZjb2VmZltpXSwgJmNvZWZmX2xvW2ldLCBwT3ZlcmZsb3cpOwotICAgIH0KLQotCi0gICAgLyotLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tKgotICAgICAqICBDb2RlYm9vayBzZWFyY2g6ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICoKLSAgICAgKiAgfn5+fn5+fn5+fn5+fn5+fiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqCi0gICAgICogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKgotICAgICAqICBGb3IgZWFjaCBvZiB0aGUgY2FuZGlhdGVzIExUUCBnYWlucyBpbiBnX3BpdGNoX2NhbmRbXSwgdGhlIHRlcm1zICoKLSAgICAgKiAgdFswLi40XSBhcmUgY2FsY3VsYXRlZCBmcm9tIHRoZSB2YWx1ZXMgaW4gdGhlIHRhYmxlIChhbmQgdGhlICAgICAqCi0gICAgICogIHBpdGNoIGdhaW4gY2FuZGlkYXRlKSBhbmQgc3VtbWVkIHVwOyB0aGUgcmVzdWx0IGlzIHRoZSBtZWFuICAgICAgKgotICAgICAqICBzcXVhcmVkIGVycm9yIGZvciB0aGUgTFBUL0NCIGdhaW4gcGFpci4gVGhlIGluZGV4IGZvciB0aGUgbWluaS0gICoKLSAgICAgKiAgbXVtIE1TRSBpcyBzdG9yZWQgYW5kIGZpbmFsbHkgdXNlZCB0byByZXRyaWV2ZSB0aGUgcXVhbnRpemVkIENCICAqCi0gICAgICogIGdhaW4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKgotICAgICAqLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSovCi0KLSAgICAvKiBzdGFydCB3aXRoICJpbmZpbml0ZSIgTVNFICovCi0gICAgZGlzdF9taW4gPSBNQVhfMzI7Ci0g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SwgcE92ZXJmbG93KTsKLSAgICAgICAgICAgIExfRXh0cmFjdChMX3RtcCwgJmcyX2NvZGVfaCwgJmcyX2NvZGVfbCwgcE92ZXJmbG93KTsKLQotICAgICAgICAgICAgTF90bXAgPSBMX211bHQoZ19jb2RlLCBnX3BpdGNoLCBwT3ZlcmZsb3cpOwotICAgICAgICAgICAgTF9FeHRyYWN0KExfdG1wLCAmZ19waXRfY29kX2gsICZnX3BpdF9jb2RfbCwgcE92ZXJmbG93KTsKLQotICAgICAgICAgICAgTF90bXAgPSBNYWNfMzIoTF90bXAwLCBjb2VmZlsyXSwgY29lZmZfbG9bMl0sCi0gICAgICAgICAgICAgICAgICAgICAgICAgICBnMl9jb2RlX2gsIGcyX2NvZGVfbCwgcE92ZXJmbG93KTsKLSAgICAgICAgICAgIExfdG1wID0gTWFjXzMyXzE2KExfdG1wLCBjb2VmZlszXSwgY29lZmZfbG9bM10sCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICBnX2NvZGUsIHBPdmVyZmxvdyk7Ci0gICAgICAgICAgICBMX3RtcCA9IE1hY18zMihMX3RtcCwgY29lZmZbNF0sIGNvZWZmX2xvWzRdLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgZ19waXRfY29kX2gsIGdfcGl0X2NvZF9sLCBwT3ZlcmZsb3cpOwotCi0gICAgICAgICAgICAvKiBzdG9yZSB0YWJsZSBpbmRleCBpZiBNU0UgZm9yIHRoaXMgaW5kZXggaXMgbG93ZXIKLSAgICAgICAgICAgICAgIHRoYW4gdGhlIG1pbmltdW0gTVNFIHNlZW4gc28gZmFyOyBhbHNvIHN0b3JlIHRoZQotICAgICAgICAgICAgICAgcGl0Y2ggZ2FpbiBmb3IgdGhpcyAoc28gZmFyKSBsb3dlc3QgTVNFICAgICAgICAgICovCi0gICAgICAgICAgICBpZiAoTF90bXAgPCBkaXN0X21pbikKLSAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICBkaXN0X21pbiA9IExfdG1wOwotICAgIC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vZGUwICAgLS0gV29yZDE2IC0tIHByZWRpY3RlZCBDQiBnYWluIChleHBvbmVudCksICAgICAgICAgICAgICAgICBRMAotICAgIGdjb2RlMCAgICAgICAtLSBXb3JkMTYgLS0gcHJlZGljdGVkIENCIGdhaW4gKG5vcm0uKSwgICAgICAgICAgICAgICAgICAgIFExNAotICAgIGZyYWNfZW5bXSAgICAtLSBXb3JkMTYgYXJyYXkgLS0gZW5lcmd5IGNvZWZmaWNpZW50cyAoNCksIGZyYWN0aW9uIHBhcnQsIFExNQotICAgIGV4cF9lbltdICAgICAtLSBXb3JkMTYgYXJyYXkgLS0gZW5lcmd5IGNvZWZmaWNpZW50cyAoNCksIGV4cG9uZW50IHBhcnQsIFEwCi0gICAgYWxwaGEgICAgICAgIC0tIFdvcmQxNiAtLSBnYWluIGFkYXB0b3IgZmFjdG9yICg+MCksICAgICAgICAgICAgICAgICAgICAgUTE1Ci0KLSAgICBnYWluX2NvZF91bnEgLS0gV29yZDE2IC0tIENvZGUgZ2FpbiAodW5xdWFudGl6ZWQpCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoc2NhbGluZzogUTEwIC0gZXhwX2djb2RlMCkKLQotICAgIGdhaW5fY29kICAgICAtLSBQb2ludGVyIHRvIFdvcmQxNiAtLSBDb2RlIGdhaW4gKHByZS0vcXVhbnRpemVkKSwgICAgICAgIFExCi0KLSBPdXRwdXRzOgotICAgIHF1YV9lbmVyX01SMTIyIC0tIFBvaW50ZXIgdG8gV29yZDE2IC0tIHF1YW50aXplZCBlbmVyZ3kgZXJyb3IsICAgICAgIFExMAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChmb3IgTVIxMjIgTUEgcHJlZGljdG9yIHVwZGF0ZSkKLSAgICBxdWFfZW5lciAgICAgICAtLSBQb2ludGVyIHRvIFdvcmQxNiAtLSBxdWFudGl6ZWQgZW5lcmd5IGVycm9yLCAgICAgICBRMTAKLSAgICAgICAgICAgICAgICAgICAgICAg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A6IGVuZXJneSBjb2VmZmljaWVudHMgKDQpLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZXBvbmVudCBwYXJ0LCAgICAgICAgICAgICAgICAgUTAgICovCi0gICAgV29yZDE2IGFscGhhLCAgICAgICAgICAgLyogaSAgOiBnYWluIGFkYXB0b3IgZmFjdG9yICg+MCksICAgICBRMTUgKi8KLSAgICBXb3JkMTYgZ2Fpbl9jb2RfdW5xLCAgICAvKiBpICA6IENvZGUgZ2FpbiAodW5xdWFudGl6ZWQpICAgICAgICAgICAqLwotICAgIC8qICAgICAgKHNjYWxpbmc6IFExMCAtIGV4cF9nY29kZTApICAgICAgICovCi0gICAgV29yZDE2ICpnYWluX2NvZCwgICAgICAgLyogaS9vOiBDb2RlIGdhaW4gKHByZS0vcXVhbnRpemVkKSwgICBRMSAgKi8KLSAgICBXb3JkMTYgKnF1YV9lbmVyX01SMTIyLCAvKiBvICA6IHF1YW50aXplZCBlbmVyZ3kgZXJyb3IsICAgICAgIFExMCAqLwotICAgIC8qICAgICAgKGZvciBNUjEyMiBNQSBwcmVkaWN0b3IgdXBkYXRlKSAgICovCi0gICAgV29yZDE2ICpxdWFfZW5lciwgICAgICAgLyogbyAgOiBxdWFudGl6ZWQgZW5lcmd5IGVycm9yLCAgICAgICBRMTAgKi8KLSAgICAvKiAgICAgIChmb3Igb3RoZXIgTUEgcHJlZGljdG9yIHVwZGF0ZSkgICAqLwotICAgIEZsYWcgICAqcE92ZXJmbG93ICAgICAgIC8qIG8gIDogb3ZlcmZsb3cgaW5kaWNhdG9yICAgICAgICAgICAgICAgICovCi0pCi17Ci0gICAgY29uc3QgV29yZDE2ICpwOwotICAgIFdvcmQxNiBpOwotICAgIFdvcmQxNiBpbmRleDsKLSAgICBXb3JkMTYgdG1wOwotICAgIFdvcmQxNiBvbmVfYWxwaGE7Ci0gICAgV29yZDE2IGV4cDsKLSAgICBXb3JkMTYgZV9tYXg7Ci0KLSAgICBXb3JkMTYgZzJfcGl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AgICAgICAgdFsxXSAgICsgICAgICAgICAgICAgIHRbMl0gICAgKyAgICAgICAgICB0WzNdCi0KLSAgICAgICAgZGlzdCA9IGQxICsgZDI7Ci0KLSAgICAgICAgICBkMSA9ICgxLjAgLSBhbHApICogSW5uRW4gKiAoZ2N1IC0gZ2NbaV0pXjIgPSB0WzRdCi0gICAgICAgICAgICAgICAtLS0tLS0tLS0tLS0tLS0tLS0tICAgIC0tLQotCi0gICAgICAgICAgZDIgPSAgICAgICAgYWxwICAqIChSZXNFbiAtIDIuMCAqIHNxcnQoUmVzRW4qRXhFbikgKyBFeEVuKTsKLSAgICAgICAgICAgICAgICAgICAgICAtLS0gICAgIC0tLS0tICAgLS0tICAgICAgICAtLS0tLQotCi0gICAgICAgICAgICAgPSAgICAgICAgYWxwICAqIChzcXJ0KEV4RW4pIC0gc3FydChSZXNFbikpXjIKLSAgICAgICAgICAgICAgICAgICAgICAtLS0gICAgICAgICAgICAgICAgICAtLS0tLS0tLS0tLQotCi0gICAgICAgICAgICAgPSAgICAgICAgICAgICAgIChzcXJ0KGFFeEVuKSAtIHNxcnQoYWxwKlJlc0VuKSleMgotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAtLS0tLS0tLS0tLS0tLS0KLQotICAgICAgICAgICAgID0gICAgICAgICAgICAgICAoc3FydChhRXhFbikgLSAgICAgICB0WzBdICAgICApXjIKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLS0tLQotCi0gICAgICovCi0KLSAgICAvKgotICAgICAqIGNhbGN1bGF0ZSBzY2FsaW5ncyBvZiB0aGUgY29uc3RhbnQgdGVybXMKLSAgICAgKi8KLSAgICBnYWluX2NvZGUgPSBzaGwoKmdhaW5fY29kLCBzdWIoMTAsIGV4cF9nY29kZTAsIHBPdmVyZmxvdyksIHBPdmVyZmxvdyk7ICAgLyogUTEgIC0+IFExMSAoLWVjMCkgKi8KLSAgICBnMl9waXRjaCA9IG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ICZxdWFfZ2Fpbl9jb2RlWzBdOwotCi0gICAgZm9yIChpID0gMDsgaSA8IE5CX1FVQV9DT0RFOyBpKyspCi0gICAgewotICAgICAgICBnX2NvZGUgPSAqcCsrOyAgICAgICAgICAgICAgICAgICAvKiB0aGlzIGlzIGdfZmFjIChRMTEpICAqLwotICAgICAgICBwKys7ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvKiBza2lwIGxvZzIoZ19mYWMpICAgICAqLwotICAgICAgICBwKys7ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvKiBza2lwIDIwKmxvZzEwKGdfZmFjKSAqLwotICAgICAgICBnX2NvZGUgPSBtdWx0KGdfY29kZSwgZ2NvZGUwLCBwT3ZlcmZsb3cpOwotCi0gICAgICAgIC8qIG9ubHkgY29udGludWUgaWYgICAgZ2NbaV0gICAgICAgICAgICA8IDIuMCpnYwotICAgICAgICAgICB3aGljaCBpcyBlcXVpdi4gdG8gIGdfY29kZSAoUTEwLWVjMCkgPCBnYWluX2NvZGUgKFExMS1lYzApICovCi0KLSAgICAgICAgaWYgKGdfY29kZSA+PSBnYWluX2NvZGUpCi0gICAgICAgIHsKLSAgICAgICAgICAgIGJyZWFrOwotICAgICAgICB9Ci0KLSAgICAgICAgTF90bXAgPSBMX211bHQoZ19jb2RlLCBnX2NvZGUsIHBPdmVyZmxvdyk7Ci0gICAgICAgIExfRXh0cmFjdChMX3RtcCwgJmcyX2NvZGVfaCwgJmcyX2NvZGVfbCwgcE92ZXJmbG93KTsKLQotICAgICAgICB0bXAgPSBzdWIoZ19jb2RlLCBnYWluX2NvZF91bnEsIHBPdmVyZmxvdyk7Ci0gICAgICAgIExfdG1wID0gTF9tdWx0KHRtcCwgdG1wLCBwT3ZlcmZsb3cpOwotICAgICAgICBMX0V4dHJhY3QoTF90bXAsICZkMl9jb2RlX2gsICZkMl9jb2RlX2wsIHBPdmVyZmxvdyk7Ci0KLSAgICAgICAgLyogdDIsIHQzLCB0NCAqLwotICAgICAgICBMX3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LS0tLS0tKgotICAgICAqICByZWFkIHF1YW50aXplZCBnYWlucyBhbmQgbmV3IHZhbHVlcyBmb3IgTUEgcHJlZGljdG9yIG1lbW9yaWVzICAgKgotICAgICAqICB+fn5+fn5+fn5+fn5+fn5+fn5+fn5+fn5+fn5+fn5+fn5+fn5+fn5+fn5+fn5+fn5+fn5+fn5+fn5+fn5+ICAgKgotICAgICAqLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tKi8KLQotICAgIC8qIFJlYWQgdGhlIHF1YW50aXplZCBnYWlucyAqLwotICAgIHAgPSAmcXVhX2dhaW5fY29kZVthZGQoYWRkKGluZGV4LCBpbmRleCwgcE92ZXJmbG93KSwgaW5kZXgsIHBPdmVyZmxvdyldOwotICAgIGdfY29kZSA9ICpwKys7Ci0gICAgKnF1YV9lbmVyX01SMTIyID0gKnArKzsKLSAgICAqcXVhX2VuZXIgPSAqcDsKLQotICAgIC8qLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tKgotICAgICAqICBjYWxjdWxhdGUgZmluYWwgZml4ZWQgY29kZWJvb2sgZ2FpbjogICAgICAgICAgICAgICAgICAgICAgICAgICAgKgotICAgICAqICB+fn5+fn5+fn5+fn5+fn5+fn5+fn5+fn5+fn5+fn5+fn5+fn4gICAgICAgICAgICAgICAgICAgICAgICAgICAgKgotICAgICAqICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKgotICAgICAqICAgZ2MgPSBnYzAgKiBnICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKgotICAgICAqLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t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AgLS0gUG9pbnRlciB0byBXb3JkMTYgLS0gUGl0Y2ggZ2FpbiwgICAgICAgICAgICAgIFExNAotCi0gICAgZ2Fpbl9waXQgICAgICAgLS0gUG9pbnRlciB0byBXb3JkMTYgLS0gUGl0Y2ggZ2FpbiwgICAgICAgICAgICAgICAgICAgUTE0Ci0gICAgZ2Fpbl9jb2QgICAgICAgLS0gUG9pbnRlciB0byBXb3JkMTYgLS0gQ29kZSBnYWluLCAgICAgICAgICAgICAgICAgICAgUTEKLSAgICBxdWFfZW5lcl9NUjEyMiAtLSBQb2ludGVyIHRvIFdvcmQxNiAtLSBxdWFudGl6ZWQgZW5lcmd5IGVycm9yLCAgICAgICBRMTAKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoZm9yIE1SMTIyIE1BIHByZWRpY3RvciB1cGRhdGUpCi0KLSAgICBxdWFfZW5lciAgICAgICAtLSBQb2ludGVyIHRvIFdvcmQxNiAtLSBxdWFudGl6ZWQgZW5lcmd5IGVycm9yLCAgICAgICBRMTAKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoZm9yIG90aGVyIE1BIHByZWRpY3RvciB1cGRhdGUpCi0KLSAgICBhbmFwICAgICAgICAgICAtLSBEb3VibGUgUG9pbnRlciB0byBXb3JkMTYgLS0gSW5kZXggb2YgcXVhbnRpemF0aW9uCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKGZpcnN0IGdhaW4gcGl0Y2gsIHRoZW4gY29kZSBwaXRjaCkKLQotICAgIHBPdmVyZmxvdyAgICAgIC0tIFBvaW50ZXIgdG8gRmxhZyAtLSBvdmVyZmxvdyBpbmRpY2F0b3IKLQotIFJldHVybnM6Ci0gICAgTm9uZQotCi0gR2xvYmFsIFZhcmlhYmxlcyBVc2VkOgotICAgIE5vbmUKLQotIExvY2FsIFZhcmlhYmxlcyBOZWVkZWQ6Ci0gICAgTm9uZQotCi0tLS0tLS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jb2RlW10sICAgICAgICAgICAgLyogaSAgOiBDQiBpbm5vdmF0aW9uICh1bmZpbHRlcmVkKSwgICBRMTMgICovCi0gICAgV29yZDE2IGZyYWNfY29lZmZbXSwgICAgICAvKiBpICA6IGNvZWZmaWNpZW50cyAoNSksICAgICAgICAgICAgIFExNSAgKi8KLSAgICBXb3JkMTYgZXhwX2NvZWZmW10sICAgICAgIC8qIGkgIDogZW5lcmd5IGNvZWZmaWNpZW50cyAoNSksICAgICAgUTAgICAqLwotICAgIC8qICAgICAgY29lZmZpY2llbnRzIGZyb20gY2FsY19maWx0X2VuZXIoKSAqLwotICAgIFdvcmQxNiBleHBfY29kZV9lbiwgICAgICAgLyogaSAgOiBpbm5vdmF0aW9uIGVuZXJneSAoZXhwb25lbnQpLCBRMCAgICovCi0gICAgV29yZDE2IGZyYWNfY29kZV9lbiwgICAgICAvKiBpICA6IGlubm92YXRpb24gZW5lcmd5IChmcmFjdGlvbiksIFExNSAgKi8KLSAgICBXb3JkMTYgZXhwX2djb2RlMCwgICAgICAgIC8qIGkgIDogcHJlZGljdGVkIENCIGdhaW4gKGV4cG9uZW50KSwgUTAgICAqLwotICAgIFdvcmQxNiBmcmFjX2djb2RlMCwgICAgICAgLyogaSAgOiBwcmVkaWN0ZWQgQ0IgZ2FpbiAoZnJhY3Rpb24pLCBRMTUgICovCi0gICAgV29yZDE2IExfc3ViZnIsICAgICAgICAgICAvKiBpICA6IFN1YmZyYW1lIGxlbmd0aCAgICAgICAgICAgICAgICAgICAgKi8KLSAgICBXb3JkMTYgY29kX2dhaW5fZnJhYywgICAgIC8qIGkgIDogb3B0LiBjb2RlYm9vayBnYWluIChmcmFjdGlvbiksUTE1ICAqLwotICAgIFdvcmQxNiBjb2RfZ2Fpbl9leHAsICAgICAgLyogaSAgOiBvcHQuIGNvZGVib29rIGdhaW4gKGV4cG9uZW50KSwgUTAgICovCi0gICAgV29yZDE2IGdwX2xpbWl0LCAgICAgICAgICAvKiBpICA6IHBpdGNoIGdhaW4gbGltaXQgICAgICAgICAgICAgICAgICAgKi8KLSAgICBXb3JkMTYgKmdhaW5fcGl0LCAgICAgICAgIC8qIGkvbzogUGl0Y2ggZ2FpbiwgICAgICAgICAgICAgICAgICAgUTE0ICAqLwotICAgIFdvcmQxNiAqZ2Fpbl9jb2QsICAgICAgICAgLyogbyAgOiBDb2RlIGdhaW4sICAgICAgICAgICAgICAgICAgICBRMSAgICovCi0gICAgV29yZDE2ICpxdWFfZW5lcl9NUjEyMiwgICAvKiBvICA6IHF1YW50aXplZCBlbmVyZ3kgZXJyb3IsICAgICAgIFExMCAgKi8KLSAgICAvKiAgICAgIChmb3IgTVIxMjIgTUEgcHJlZGljdG9yIHVwZGF0ZSkgICAgKi8KLSAgICBXb3JkMTYgKnF1YV9lbmVyLCAgICAgICAgIC8qIG8gIDogcXVhbnRpemVkIGVuZXJneSBlcnJvciwgICAgICAgUTEwICAqLwotICAgIC8qICAgICAgKGZvciBvdGhlciBNQSBwcmVkaWN0b3IgdXBkYXRlKSAgICAqLwotICAgIFdvcmQxNiAqKmFuYXAsICAgICAgICAgICAgLyogbyAgOiBJbmRleCBvZiBxdWFudGl6YXRpb24gICAgICAgICAgICAgICovCi0gICAgLyogICAgICAoZmlyc3QgZ2FpbiBwaXRjaCwgdGhlbiBjb2RlIHBpdGNoKSovCi0gICAgRmxhZyAgICpwT3ZlcmZsb3cgICAgICAgICAvKiBvICA6IG92ZXJmbG93IGluZGljYXRvciAgICAgICAgICAgICAgICAqLwotKQotewotICAgIFdvcmQxNiBmcmFjX2VuWzRdOwotICAgIFdvcmQxNiBleHBfZW5bNF07Ci0gICAgV29yZDE2IGx0cGcsIGFscGhhLCBnY29kZTA7Ci0gICAgV29yZDE2IGdfcGl0Y2hfY2FuZFszXTsgICAgICAvKiBwaXRjaCBnYWluIGNhbmRpZGF0ZXMgICBRMTQgKi8KLSAgICBXb3JkMTYgZ19waXRjaF9jaW5kWzNdOyAgICAgIC8qIHBpdGNoIGdhaW4gaW5kaWNlcyAgICAgIFEwICAqLwotICAgIFdvcmQxNiBnYWluX3BpdF9pbmRleDsKLSAgICBXb3JkMTYgZ2Fpbl9jb2RfaW5kZXg7Ci0gICAgV29yZDE2IGV4cDsKLSAgICBXb3JkMTYgZ2Fpbl9jb2RfdW5xOyAgICAgICAgIC8qIGNvZGUgZ2FpbiAodW5xLikgUSgxMC1leHBfZ2NvZGUwKSAgKi8KLQotCi0gICAgLyogZ2V0IGxpc3Qgb2YgY2FuZGlkYXRlIHF1YW50aXplZCBwaXRjaCBnYWluIHZhbHVlcwotICAgICAqIGFuZCBjb3JyZXNwb25kaW5nIHF1YW50aXphdGlvbiBpbmRpY2VzCi0gICAgICovCi0gICAgZ2Fpbl9waXRfaW5kZXggPSBxX2dhaW5fcGl0Y2goTVI3OTUsIGdwX2xpbWl0LCBnYWluX3BpdCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBnX3BpdGNoX2NhbmQsIGdfcGl0Y2hfY2luZCwgcE92ZXJmbG93KTsKLQotICAgIC8qLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSoKLSAgICAgKiAgcHJlZGljdGVkIGNvZGVib29rIGdhaW4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqCi0gICAgICogIH5+fn5+fn5+fn5+fn5+fn5+fn5+fn5+ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKgotICAgICAqICBnYzAgICAgID0gMl5leHBfZ2NvZGUwICsgMl5mcmFjX2djb2RlMCAgICAgICAgICAgICAgICAgICAgICAgICAgICoKLSAgICAgKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqCi0gICAgICogIGdjb2RlMCAoUTE0KSA9IDJeMTQqMl5mcmFjX2djb2RlMCA9IGdjMCAqIDJeK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S0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tCi0gICAgOyBHTE9CQUwgRlVOQ1RJT04gREVGSU5JVElPTlMKLSAgICA7IEZ1bmN0aW9uIFByb3RvdHlwZSBkZWNsYXJhdGlvbgotICAgIC0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0qLwotICAgIHZvaWQKLSAgICBNUjc5NV9nYWluX3F1YW50KAotICAgICAgICBHYWluQWRhcHRTdGF0ZSAqYWRhcHRfc3QsIC8qIGkvbzogZ2FpbiBhZGFwdGVyIHN0YXRlIHN0cnVjdHVyZSAgICAgICAqLwotICAgICAgICBXb3JkMTYgcmVzW10sICAgICAgICAgICAgIC8qIGkgIDogTFAgcmVzaWR1YWwsICAgICAgICAgICAgICAgICAgUTAgICAqLwotICAgICAgICBXb3JkMTYgZXhjW10sICAgICAgICAgICAgIC8qIGkgIDogTFRQIGV4Y2l0YXRpb24gKHVuZmlsdGVyZWQpLCAgUTAgICAqLwotICAgICAgICBXb3JkMTYgY29kZVtdLCAgICAgICAgICAgIC8qIGkgIDogQ0IgaW5ub3ZhdGlvbiAodW5maWx0ZXJlZCksICAgUTEzICAqLwotICAgICAgICBXb3JkMTYgZnJhY19jb2VmZltdLCAgICAgIC8qIGkgIDogY29lZmZpY2llbnRzICg1KSwgICAgICAgICAgICAgUTE1ICAqLwotICAgICAgICBXb3JkMTYgZXhwX2NvZWZmW10sICAgICAgIC8qIGkgIDogZW5lcmd5IGNvZWZmaWNpZW50cyAoNSksICAgICAgUTAgICAqLwotICAgICAgICAvKiAgICAgIGNvZWZmaWNpZW50cyBmcm9tIGNhbGNfZmlsdF9lbmVyKCkgKi8KLSAgICAgICAgV29yZDE2IGV4cF9jb2RlX2VuLCAgICAgICAvKiBpICA6IGlubm92YXRpb24gZW5lcmd5IChleHBvbmVudCksIFEwICAgKi8KLSAgICAgICAgV29yZDE2IGZyYWNfY29kZV9lbiwgICAgICAvKiBpICA6IGlubm92YXRpb24gZW5lcmd5IChmcmFjdGlvbiksIFExNSAgKi8KLSAgICAgICAgV29yZDE2IGV4cF9nY29kZTAsICAgICAgICAvKiBpICA6IHByZWRpY3RlZCBDQiBnYWluIChleHBvbmVudCksIFEwICAgKi8KLSAgICAgICAgV29yZDE2IGZyYWNfZ2NvZGUwLCAgICAgICAvKiBpICA6IHByZWRpY3RlZCBDQiBnYWluIChmcmFjdGlvbiksIFExNSAgKi8KLSAgICAgICAgV29yZDE2IExfc3ViZnIsICAgICAgICAgICAvKiBpICA6IFN1YmZyYW1lIGxlbmd0aCAgICAgICAgICAgICAgICAgICAgKi8KLSAgICAgICAgV29yZDE2IGNvZF9nYWluX2ZyYWMsICAgICAvKiBpICA6IG9wdC4gY29kZWJvb2sgZ2FpbiAoZnJhY3Rpb24pLFExNSAgKi8KLSAgICAgICAgV29yZDE2IGNvZF9nYWluX2V4cCwgICAgICAvKiBpICA6IG9wdC4gY29kZWJvb2sgZ2FpbiAoZXhwb25lbnQpLCBRMCAgKi8KLSAgICAgICAgV29yZDE2IGdwX2xpbWl0LCAgICAgICAgICAvKiBpICA6IHBpdGNoIGdhaW4gbGltaXQgICAgICAgICAgICAgICAgICAgKi8KLSAgICAgICAgV29yZDE2ICpnYWluX3BpdCwgICAgICAgICAvKiBpL286IFBpdGNoIGdhaW4gKHVucXVhbnQvcXVhbnQpLCAgIFExNCAgKi8KLSAgICAgICAgV29yZDE2ICpnYWluX2NvZCwgICAgICAgICAvKiBvICA6IENvZGUgZ2FpbiwgICAgICAgICAgICAgICAgICAgIFExICAgKi8KLSAgICAgICAgV29yZDE2ICpxdWFfZW5lcl9NUjEyMiwgICAvKiBvICA6IHF1YW50aXplZCBlbmVyZ3kgZXJyb3IsICAgICAgIFExMCAgKi8KLSAgICAgICAgLyogICAgICAoZm9yIE1SMTIyIE1BIHByZWRpY3RvciB1cGRhdGUpICA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ICAgICAgICAgKi8KLSAgICBlbnVtIE1vZGUgbW9kZSwgICAgICAgICAvKiBpICA6IEFNUiBtb2RlICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0gICAgV29yZDE2IGV4cF9nY29kZTAsICAgICAgLyogaSAgOiBwcmVkaWN0ZWQgQ0IgZ2FpbiAoZXhwb25lbnQpLCAgICAgIFEwICAqLwotICAgIFdvcmQxNiBmcmFjX2djb2RlMCwgICAgIC8qIGkgIDogcHJlZGljdGVkIENCIGdhaW4gKGZyYWN0aW9uKSwgICAgICBRMTUgKi8KLSAgICBXb3JkMTYgZnJhY19jb2VmZltdLCAgICAvKiBpICA6IGVuZXJneSBjb2VmZi4gKDUpLCBmcmFjdGlvbiBwYXJ0LCAgUTE1ICovCi0gICAgV29yZDE2IGV4cF9jb2VmZltdLCAgICAgLyogaSAgOiBlbmVyZ3kgY29lZmYuICg1KSwgZXhwb25lbnQgcGFydCwgIFEwICAqLwotICAgIC8qICAgICAgKGZyYWNfY29lZmYgYW5kIGV4cF9jb2VmZiBjb21wdXRlZCBpbiAgKi8KLSAgICAvKiAgICAgICBjYWxjX2ZpbHRfZW5lcmdpZXMoKSkgICAgICAgICAgICAgICAgICovCi0gICAgV29yZDE2IGdwX2xpbWl0LCAgICAgICAgLyogaSAgOiBwaXRjaCBnYWluIGxpbWl0ICAgICAgICAgICAgICAgICAgICAgICAqLwotICAgIFdvcmQxNiAqZ2Fpbl9waXQsICAgICAgIC8qIG8gIDogUGl0Y2ggZ2FpbiwgICAgICAgICAgICAgICAgICAgICAgICBRMTQgKi8KLSAgICBXb3JkMTYgKmdhaW5fY29kLCAgICAgICAvKiBvICA6IENvZGUgZ2FpbiwgICAgICAgICAgICAgICAgICAgICAgICAgUTEgICovCi0gICAgV29yZDE2ICpxdWFfZW5lcl9NUjEyMiwgLyogbyAgOiBxdWFudGl6ZWQgZW5lcmd5IGVycm9yLCAgICAgICAgICAgIFExMCAqLwotICAgIC8qICAgICAgKGZvciBNUjEy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2dhaW5faGlnaHJhdGVzOwotICAgIH0KLSAgICBlbHNlCi0gICAgewotICAgICAgICB0YWJsZV9sZW4gPSBWUV9TSVpFX0xPV1JBVEVTOwotICAgICAgICB0YWJsZV9nYWluID0gdGFibGVfZ2Fpbl9sb3dyYXRlczsKLSAgICB9Ci0KLSAgICAvKi0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0qCi0gICAgICogIHByZWRpY3RlZCBjb2RlYm9vayBnYWluICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKgotICAgICAqICB+fn5+fn5+fn5+fn5+fn5+fn5+fn5+fiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICoKLSAgICAgKiAgZ2MwICAgICA9IDJeZXhwX2djb2RlMCArIDJeZnJhY19nY29kZTAgICAgICAgICAgICAgICAgICAgICAgICAgICAqCi0gICAgICogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKgotICAgICAqICBnY29kZTAgKFExNCkgPSAyXjE0KjJeZnJhY19nY29kZTAgPSBnYzAgKiAyXigxNC1leHBfZ2NvZGUwKSAgICAgICoKLSAgICAgKi0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0qLwotCi0gICAgZ2NvZGUwID0gKFdvcmQxNikoUG93MigxNCwgZnJhY19nY29kZTAsIHBPdmVyZmxvdykpOwotCi0gICAgLyotLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tKgotICAgICAqICBTY2FsaW5nIGNvbnNpZGVyYXRpb25zOiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICoKLSAgICAgKiAgfn5+fn5+fn5+fn5+fn5+fn5+fn5+fn4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqCi0gICAgICotLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tKi8KLQotICAgIC8qCi0gICAgICogVGhlIGVycm9yIGVuZXJneSAoc3VtKSB0byBiZSBtaW5pbWl6ZWQgY29uc2lzdHMgb2YgZml2ZSB0ZXJtcywgdFswLi40XS4KLSAgICAgKgotICAgICAqICAgICAgICAgICAgICAgICAgICAgIHRbMF0gPSAgICBncF4yICAqIDx5MSB5MT4KLSAgICAgKiAgICAgICAgICAgICAgICAgICAgICB0WzFdID0gLTIqZ3AgICAgKiA8eG4geTE+Ci0gICAgICogICAgICAgICAgICAgICAgICAgICAgdFsyXSA9ICAgIGdjXjIgICogPHkyIHkyPgotICAgICAqICAgICAgICAgICAgICAgICAgICAgIHRbM10gPSAtMipnYyAgICAqIDx4biB5Mj4KLSAgICAgKiAgICAgICAgICAgICAgICAgICAgICB0WzRdID0gIDIqZ3AqZ2MgKiA8eTEgeTI+Ci0gICAgICoKLSAgICAgKi8KLQotICAgIC8qIGRldGVybWluZSB0aGUgc2NhbGluZyBleHBvbmVudCBmb3IgZ19jb2RlOiBlYyA9IGVjMCAtIDExICovCi0gICAgZXhwX2NvZGUgPSBzdWIoZXhwX2djb2RlMCwgMTEsIHBPdmVyZmxvdyk7Ci0KLSAgICAvKiBjYWxjdWxhdGUgZXhwX21heFtpXSA9IHNbaV0tMSAqLwotICAgIGV4cF9tYXhbMF0gPSBzdWIoZXhwX2NvZWZmWzBdLCAxMywgcE92ZXJmbG93KTsKLSAgICBleHBfbWF4WzFdID0gc3ViKGV4cF9jb2VmZlsxXSwgMTQsIHBPdmVyZmxvdyk7Ci0KLSAgICB0ZW1wID0gc2hsKGV4cF9jb2RlLCAxLCBwT3ZlcmZsb3cpOwotICAgIHRlbXAgPSBhZGQoMTUsIHRlbXAsIHBPdmVyZmxvdyk7Ci0gICAgZXhwX21heFsyXSA9IGFkZChleHBfY29lZmZbMl0sIHRlbXAsIHBPdmVyZmxvdyk7Ci0KLSAgICBleHBfbWF4WzNdID0gYWRkKGV4cF9jb2VmZlszXSwgZXhwX2NvZGUsIHBPdmVyZmxvdyk7Ci0KLSAgICB0ZW1wID0gYWRkKDEsIGV4cF9jb2RlLCBwT3ZlcmZsb3cpOwotICAgIGV4cF9tYXhbNF0gPSBhZGQoZXhwX2NvZWZmWzRdLCB0ZW1wLCBwT3ZlcmZsb3cpOwotCi0KLSAgICAvKi0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0qCi0gICAgICogIEZpbmQgbWF4aW11bSBleHBvbmVudDogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKgotICAgICAqICB+fn5+fn5+fn5+fn5+fn5+fn5+fn5+ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICoKLSAgICAgKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqCi0gICAgICogIEZvciB0aGUgc3VtIG9wZXJhdGlvbiwgYWxsIHRlcm1zIG11c3QgaGF2ZSB0aGUgc2FtZSBzY2FsaW5nOyAgICAgKgotICAgICAqICB0aGF0IHNjYWxpbmcgc2hvdWxkIGJlIGxvdyBlbm91Z2ggdG8gcHJldmVudCBvdmVyZmxvdy4gVGhlcmUtICAgICoKLSAgICAgKiAgZm9yZSwgdGhlIG1heGltdW0gc2NhbGUgaXMgZGV0ZXJtaW5lZCBhbmQgYWxsIGNvZWZmaWNpZW50cyBhcmUgICAqCi0gICAgICogIHJlLXNjYWxlZDogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKgotICAgICAqICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICoKLSAgICAgKiAgICBlX21heCA9IG1heChleHBfbWF4W2ldKSArIDE7ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqCi0gICAgICogICAgZSA9IGV4cF9tYXhbaV0tZV9tYXg7ICAgICAgICAgZSA8PSAwISAgICAgICAgICAgICAgICAgICAgICAgICAgKgotICAgICAqICAgIGNbaV0gPSBjW2ldKjJeZSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICoKLSAgICAgKi0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0qLwotCi0gICAgZV9tYXggPSBleHBfbWF4WzBdOwotICAgIGZvciAoaSA9IDE7IGkgPCA1OyBpKyspCi0gICAgewotICAgICAgICBpZiAoZXhwX21heFtpXSA+IGVfbWF4KQotICAgICAgICB7Ci0gICAgICAgICAgICBlX21heCA9IGV4cF9tYXhbaV07Ci0gICAgICAgIH0KLSAgICB9Ci0KLSAgICBlX21heCA9IGFkZChlX21heCwgMSwgcE92ZXJmbG93KTsgICAgICAvKiBUbyBhdm9pZCBvdmVyZmxvdyAqLwotCi0gICAgZm9yIChpID0gMDsgaSA8IDU7IGkrKykKLSAgICB7Ci0gICAgICAgIGogPSBzdWIoZV9tYXgsIGV4cF9tYXhbaV0sIHBPdmVyZmxvdyk7Ci0gICAgICAgIExfdG1wID0gTF9kZXBvc2l0X2goZnJhY19jb2VmZltpXSk7Ci0gICAgICAgIExfdG1wID0gTF9zaHIoTF90bXAsIGosIHBPdmVyZmxvdyk7Ci0gICAgICAgIExfRXh0cmFjdChMX3RtcCwgJmNvZWZmW2ldLCAmY29lZmZfbG9baV0sIHBPdmVyZmxvdyk7Ci0gICAgfQotCi0KLSAgICAvKi0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0qCi0gICAgICogIENvZGVib29rIHNlYXJjaDogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKgotICAgICAqICB+fn5+fn5+fn5+fn5+fn5+ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICoKLSAgICAgKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqCi0gICAgICogIEZvciBlYWNoIHBhaXIgKGdfcGl0Y2gsIGdfZmFjKSBpbiB0aGUgdGFibGUgY2FsY3VsYXRlIHRoZSAgICAgICAgKgotICAgICAqICB0ZXJtcyB0WzAuLjRdIGFuZCBzdW0gdGhlbSB1cDsgdGhlIHJlc3VsdCBpcyB0aGUgbWVhbiBzcXVhcmVkICAgICoKLSAgICAgKiAgZXJyb3IgZm9yIHRoZSBxdWFudGl6ZWQgZ2FpbnMgZnJvbSB0aGUgdGFibGUuIFRoZSBpbmRleCBmb3IgdGhlICAqCi0gICAgICogIG1pbmltdW0gTVNFIGlzIHN0b3JlZCBhbmQgZmluYWxseSB1c2VkIHRvIHJldHJpZXZlIHRoZSBxdWFudGl6ZWQgKgotICAgICAqICBnYWlucyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICoKLSAgICAgKi0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0qLwotCi0gICAgLyogc3RhcnQgd2l0aCAiaW5maW5pdGUiIE1TRSAqLwotICAgIGRpc3RfbWluID0gTUFYXzMyOwotCi0gICAgcCA9ICZ0YWJsZV9nYWluWzBdOwotCi0gICAgZm9yIChpID0gMDsgaSA8IHRhYmxlX2xlbjsgaSsrKQotICAgIHsKLSAgICAgICAgZ19waXRjaCA9ICpwKys7Ci0gICAgICAgIGdfY29kZSA9ICpwKys7ICAgICAgICAgICAgICAgICAgIC8qIHRoaXMgaXMgZ19mYWMgICAgICAgICovCi0gICAgICAgIHArKzsgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8qIHNraXAgbG9nMihnX2ZhYykgICAgICovCi0gICAgICAgIHArKzsgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8qIHNraXAgMjAqbG9nMTAoZ19mYWMpICovCi0KLSAgICAgICAgaWYgKGdfcGl0Y2ggPD0gZ3BfbGltaXQpCi0gICAgICAgIHsKLSAgICAgICAgICAgIGdfY29kZSA9IG11bHQoZ19jb2RlLCBnY29kZTAsIHBPdmVyZmxvdyk7Ci0gICAgICAgICAgICBnMl9waXRjaCA9IG11bHQoZ19waXRjaCwgZ19waXRjaCwgcE92ZXJmbG93KTsKLSAgICAgICAgICAgIGcyX2NvZGUgPSBtdWx0KGdfY29kZSwgZ19jb2RlLCBwT3ZlcmZsb3cpOwotICAgICAgICAgICAgZ19waXRfY29kID0gbXVsdChnX2NvZGUsIGdfcGl0Y2gsIHBPdmVyZmxvdyk7Ci0KLSAgICAgICAgICAgIExfdG1wID0gTXB5XzMyXzE2KGNvZWZmWzBdLCBjb2VmZl9sb1swXSwgZzJfcGl0Y2gsIHBPdmVyZmxvdyk7Ci0gICAgICAgICAgICBMX3RtcDIgPSBNcHlfMzJfMTYoY29lZmZbMV0sIGNvZWZmX2xvWzFdLCBnX3BpdGNoLCBwT3ZlcmZsb3cpOwotICAgICAgICAgICAgTF90bXAgPSBMX2FkZChMX3RtcCwgTF90bXAyLCBwT3ZlcmZsb3cpOwotCi0gICAgICAgICAgICBMX3RtcDIgPSBNcHlfMzJfMTYoY29lZmZbMl0sIGNvZWZmX2xvWzJdLCBnMl9jb2RlLCBwT3ZlcmZsb3cpOwotICAgICAgICAgICAg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AsIHJyW2kwXVtpMV0sIF8xXzgpOwotCi0gICAgICAvLwotICAgICAgLy8gaTIgYW5kIGkzIGxvb3AKLSAgICAgIC8vCi0KLSAgICAgIGZvciAoaTMgPSBpcG9zWzNdOyBpMyA8IExfQ09ERTsgaTMgKz0gc3RlcCkKLSAgICAgIHsKLSAgICAgICAgIHMgPSBMX211bHQgKHJyW2kzXVtpM10sIF8xXzgpOyAgICAgICAvLyBpbmRleCBpbmNyPSBzdGVwK0xfQ09ERQotICAgICAgICAgcyA9IExfbWFjIChzLCBycltpMF1baTNdLCBfMV80KTsgICAgIC8vIGluZGV4IGluY3JlbWVudCA9IHN0ZXAKLSAgICAgICAgIHMgPSBMX21hYyAocywgcnJbaTFdW2kzXSwgXzFfNCk7ICAgICAvLyBpbmRleCBpbmNyZW1lbnQgPSBzdGVwCi0gICAgICAgICBycnZbaTNdID0gcHZfcm91bmQgKHMpOwotICAgICAgfQotCi0gICAgICAvLyBEZWZhdWx0IHZhbHVlCi0gICAgICBzcSA9IC0xOwotICAgICAgYWxwID0gMTsKLSAgICAgIHBzID0gMDsKLSAgICAgIGlhID0gaXBvc1syXTsKLSAgICAgIGliID0gaXBvc1szXTsKLQotICAgICAgZm9yIChpMiA9IGlwb3NbMl07IGkyIDwgTF9DT0RFOyBpMiArPSBzdGVwKQotICAgICAgewotICAgICAgICAgLy8gaW5kZXggaW5jcmVtZW50ID0gc3RlcAotICAgICAgICAgcHMxID0gYWRkIChwczAsIGRuW2kyXSk7Ci0KLSAgICAgICAgIC8vIGluZGV4IGluY3I9IHN0ZXArTF9DT0RFCi0gICAgICAgICBhbHAxID0gTF9tYWMgKGFscDAsIHJyW2kyXVtpMl0sIF8xXzE2KTsKLQotICAgICAgICAgLy8gaW5kZXggaW5jcmVtZW50ID0gc3RlcAotICAgICAgICAgYWxwMSA9IExfbWFjIChhbHAxLCBycltpMF1baTJdLCBfMV84KTsKLQotICAgICAgICAgLy8gaW5kZXggaW5jcmVtZW50ID0gc3RlcAotICAgICAgICAgYWxwMSA9IExfbWFjIChhbHAxLCBycltpMV1baTJdLCBfMV84KTsKLQotICAgICAgICAgZm9yIChpMyA9IGlwb3NbM107IGkzIDwgTF9DT0RFOyBpMyArPSBzdGVwKQotICAgICAgICAgewotICAgICAgICAgICAgLy8gaW5kZXggaW5jcmVtZW50ID0gc3RlcAotICAgICAgICAgICAgcHMyID0gYWRkIChwczEsIGRuW2kzXSk7Ci0KLSAgICAgICAgICAgIC8vIGluZGV4IGluY3JlbWVudCA9IHN0ZXAKLSAgICAgICAgICAgIGFscDIgPSBMX21hYyAoYWxwMSwgcnJ2W2kzXSwgXzFfMik7Ci0KLSAgICAgICAgICAgIC8vIGluZGV4IGluY3JlbWVudCA9IHN0ZXAKLSAgICAgICAgICAgIGFscDIgPSBMX21hYyAoYWxwMiwgcnJbaTJdW2kzXSwgXzFfOCk7Ci0KLSAgICAgICAgICAgIHNxMiA9IG11bHQgKHBzMiwgcHMyKTsKLQotICAgICAgICAgICAgYWxwXzE2ID0gcHZfcm91bmQgKGFscDIpOwotCi0gICAgICAgICAgICBzID0gTF9tc3UgKExfbXVsdCAoYWxwLCBzcTIpLCBzcSwgYWxwXzE2KTsKLQotICAgICAgICAgICAgaWYgKHMgPiAwKQotICAgICAgICAgICAgewotICAgICAgICAgICAgICAgc3EgPSBzcTI7Ci0gICAgICAgICAgICAgICBwcyA9IHBzMjsKLSAgICAgICAgICAgICAgIGFscCA9IGFscF8xNjsKLSAgICAgICAgICAgICAgIGlhID0gaTI7Ci0gICAgICAgICAgICAgICBpYiA9IGkzOwotICAgICAgICAgICAgfQotICAgICAgICAgfQotICAgICAgfQotICAgICAgaTIgPSBpYTsKLSAgICAgIGkzID0gaWI7Ci0KLSAgICAgICAgLy8KLSAgICAgICAgLy8gaTQgYW5kIGk1IGxvb3A6Ci0gICAgICAgIC8vCi0KLSAgICAgICAgcHMwID0gcHM7Ci0gICAgICAgIGFscDAgPSBMX211bHQgKGFscCwgXzFfMik7Ci0KLSAgICAgICAgZm9yIChpNSA9IGlwb3NbNV07IGk1IDwgTF9DT0RFOyBpNSArPSBzdGVwKQotICAgICAgICB7Ci0gICAgICAgICAgICBzID0gTF9tdWx0IChycltpNV1baTVdLCBfMV84KTsKLSAgICAgICAgICAgIHMgPSBMX21hYyAocywgcnJbaTBdW2k1XSwgXzFfNCk7Ci0gICAgICAgICAgICBzID0gTF9tYWMgKHMsIHJyW2kxXVtpNV0sIF8xXzQpOwotICAgICAgICAgICAgcyA9IExfbWFjIChzLCBycltpMl1baTVdLCBfMV80KTsKLSAgICAgICAgICAgIHMgPSBMX21hYyAocywgcnJbaTNdW2k1XSwgXzFfNCk7Ci0gICAgICAgICAgICBycnZbaTVdID0gcHZfcm91bmQgKHMpOwotICAgICAgICB9Ci0KLSAgICAgICAgLy8gRGVmYXVsdCB2YWx1ZQotICAgICAgICBzcSA9IC0xOwotICAgICAgICBhbHAgPSAxOwotICAgICAgICBwcyA9IDA7Ci0gICAgICAgIGlhID0gaXBvc1s0XTsKLSAgICAgICAgaWIgPSBpcG9zWzVdOwotCi0gICAgICAgIGZvciAoaTQgPSBpcG9zWzRdOyBpNCA8IExfQ09ERTsgaTQgKz0gc3RlcCkKLSAgICAgICAgewotICAgICAgICAgICAgcHMxID0gYWRkIChwczAsIGRuW2k0XSk7Ci0KLSAgICAgICAgICAgIGFscDEgPSBMX21hYyAoYWxwMCwgcnJbaTRdW2k0XSwgXzFfMzIpOwotICAgICAgICAgICAgYWxwMSA9IExfbWFjIChhbHAxLCBycltpMF1baTRdLCBfMV8xNik7Ci0gICAgICAgICAgICBhbHAxID0gTF9tYWMgKGFscDEsIHJyW2kxXVtpNF0sIF8xXzE2KTsKLSAgICAgICAgICAgIGFscDEgPSBMX21hYyAoYWxwMSwgcnJbaTJdW2k0XSwgXzFfMTYpOwotICAgICAgICAgICAgYWxwMSA9IExfbWFjIChhbHAxLCBycltpM11baTRdLCBfMV8xNik7Ci0KLSAgICAgICAgICAgIGZvciAoaTUgPSBpcG9zWzVdOyBpNSA8IExfQ09ERTsgaTUgKz0gc3RlcCkKLSAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICBwczIgPSBhZGQgKHBzMSwgZG5baTVdKTsKLQotICAgICAgICAgICAgICAgIGFscDIgPSBMX21hYyAoYWxwMSwgcnJ2W2k1XSwgXzFfNCk7Ci0gICAgICAgICAgICAgICAgYWxwMiA9IExfbWFjIChhbHAyLCBycltpNF1baTVdLCBfMV8xNik7Ci0KLSAgICAgICAgICAgICAgICBzcTIgPSBtdWx0IChwczIsIHBzMik7Ci0KLSAgICAgICAgICAgICAgICBhbHBfMTYgPSBwdl9yb3VuZCAoYWxwMik7Ci0KLSAgICAgICAgICAgICAgICBzID0gTF9tc3UgKExfbXVsdCAoYWxwLCBzcTIpLCBzcSwgYWxwXzE2KTsKLQotICAgICAgICAgICAgICAgIGlmIChzID4gMCkKLSAgICAgICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgICAgIHNxID0gc3EyOwotICAgICAgICAgICAgICAgICAgICBwcyA9IHBzMjsKLSAgICAgICAgICAgICAgICAgICAgYWxwID0gYWxwXzE2OwotICAgICAgICAgICAgICAgICAgICBpYSA9IGk0OwotICAgICAgICAgICAgICAgICAgICBpYiA9IGk1OwotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgIH0KLSAgICAgICAgfQotICAgICAgICBpNCA9IGlhOwotICAgICAgICBpNSA9IGliOwotCi0gICAgICAgIC8vCi0gICAgICAgIC8vIGk2IGFuZCBpNyBsb29wOgotICAgICAgICAvLwotCi0gICAgICAgIHBzMCA9IHBzOwotICAgICAgICBhbHAwID0gTF9tdWx0IChhbHAsIF8xXzIpOwotCi0gICAgICAgIGZvciAoaTcgPSBpcG9zWzddOyBpNyA8IExfQ09ERTsgaTcgKz0gc3RlcCkKLSAgICAgICAgewotICAgICAgICAgICAgcyA9IExfbXVsdCAocnJbaTddW2k3XSwgXzFfMTYpOwotICAgICAgICAgICAgcyA9IExfbWFjIChzLCBycltpMF1baTddLCBfMV84KTsKLSAgICAgICAgICAgIHMgPSBMX21hYyAocywgcnJbaTFdW2k3XSwgXzFfOCk7Ci0gICAgICAgICAgICBzID0gTF9tYWMgKHMsIHJyW2kyXVtpN10sIF8xXzgpOwotICAgICAgICAgICAgcyA9IExfbWFjIChzLCBycltpM11baTddLCBfMV84KTsKLSAgICAgICAgICAgIHMgPSBMX21hYyAocywgcnJbaTRdW2k3XSwgXzFfOCk7Ci0gICAgICAgICAgICBzID0gTF9tYWMgKHMsIHJyW2k1XVtpN10sIF8xXzgpOwotICAgICAgICAgICAgcnJ2W2k3XSA9IHB2X3JvdW5kIChzKTsKLSAgICAgICAgfQotCi0gICAgICAgIC8vIERlZmF1bHQgdmFsdWUKLSAgICAgICAgc3EgPSAtMTsKLSAgICAgICAgYWxwID0gMTsKLSAgICAgICAgcHMgPSAwOwotICAgICAgICBpYSA9IGlwb3NbNl07Ci0gICAgICAgIGliID0gaXBvc1s3XTsKLQotICAgICAgICBmb3IgKGk2ID0gaXBvc1s2XTsgaTYgPCBMX0NPREU7IGk2ICs9IHN0ZXApCi0gICAgICAgIHsKLSAgICAgICAgICAgIHBzMSA9IGFkZCAocHMwLCBkbltpNl0pOwotCi0gICAgICAgICAgICBhbHAxID0gTF9tYWMgKGFscDAsIHJyW2k2XVtpNl0sIF8xXzY0KTsKLSAgICAgICAgICAgIGFscDEgPSBMX21hYyAoYWxwMSwgcnJbaTBdW2k2XSwgXzFfMzIpOwotICAgICAgICAgICAgYWxwMSA9IExfbWFjIChhbHAxLCBycltpMV1baTZdLCBfMV8zMik7Ci0gICAgICAgICAgICBhbHAxID0gTF9tYWMgKGFscDEsIHJyW2kyXVtpNl0sIF8xXzMyKTsKLSAgICAgICAgICAgIGFscDEgPSBMX21hYyAoYWxwMSwgcnJbaTNdW2k2XSwgXzFfMzIpOwotICAgICAgICAgICAgYWxwMSA9IExfbWFjIChhbHAxLCBycltpNF1baTZdLCBfMV8zMik7Ci0gICAgICAgICAgICBhbHAxID0gTF9tYWMgKGFscDEsIHJyW2k1XVtpNl0sIF8xXzMyKTsKLQotICAgICAgICAgICAgZm9yIChpNyA9IGlwb3NbN107IGk3IDwgTF9DT0RFOyBpNyArPSBzdGVwKQotICAgICAgICAgICAgewotICAgICAgICAgICAgICAgIHBzMiA9IGFkZCAocHMxLCBkbltpN10pOwotCi0gICAgICAgICAgICAgICAgYWxwMiA9IExfbWFjIChhbHAxLCBycnZbaTddLCBfMV80KTsKLSAgICAgICAgICAgICAgICBhbHAyID0gTF9tYWMgKGFscDIsIHJyW2k2XVtpN10sIF8xXzMyKTsKLQotICAgICAgICAgICAgICAgIHNxMiA9IG11bHQgKHBzMiwgcHMyKTsKLQotICAgICAgICAgICAgICAgIGFscF8xNiA9IHB2X3JvdW5kIChhbHAyKTsKLQotICAgICAgICAgICAgICAgIHMgPSBMX21zdSAoTF9tdWx0IChhbHAsIHNxMiksIHNxLCBhbHBfMTYpOwotCi0gICAgICAgICAgICAgICAgaWYgKHMgPiAwKQotICAgICAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAgICAgc3EgPSBzcTI7Ci0gICAgICAgICAgICAgICAgICAgIHBzID0gcHMyOwotICAgICAgICAgICAgICAgICAgICBhbHAgPSBhbHBfMTY7Ci0gICAgICAgICAgICAgICAgICAgIGlhID0gaTY7Ci0gICAgICAgICAgICAgICAgICAgIGliID0gaTc7Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgfQotICAgICAgICB9Ci0gICAgICAgIGk2ID0gaWE7Ci0gICAgICAgIGk3ID0gaWI7Ci0KLSAgICAgICAgLy8gbm93IGZpbmlzaGVkIHNlYXJjaGluZyBhIHNldCBvZiA4IHB1bHNlcwotCi0gICAgICAgIGlmKGdzbWVmckZsYWcgIT0gMCl7Ci0gICAgICAgICAgIC8vIGdvIG9uIHdpdGggdGhlIHR3byBsYXN0IHB1bHNlcyBmb3IgR1NNRUZSCi0gICAgICAgICAgIC8vCi0gICAgICAgICAgIC8vIGk4IGFuZCBpOSBsb29wOgotICAgICAgICAgICAvLwotCi0gICAgICAgICAgIHBzMCA9IHBzOwotICAgICAgICAgICBhbHAwID0gTF9tdWx0IChhbHAsIF8xXzIpOwotCi0gICAgICAgICAgIGZvciAoaTkgPSBpcG9zWzldOyBpOSA8IExfQ09ERTsgaTkgKz0gc3RlcCkKLSAgICAgICAgICAgewotICAgICAgICAgICAgICBzID0gTF9tdWx0IChycltpOV1baTldLCBfMV8xNik7Ci0gICAgICAgICAgICAgIHMgPSBMX21hYyAocywgcnJbaTBdW2k5XSwgXzFfOCk7Ci0gICAgICAgICAgICAgIHMgPSBMX21hYyAocywgcnJbaTFdW2k5XSwgXzFfOCk7Ci0gICAgICAgICAgICAgIHMgPSBMX21hYyAocywgcnJbaTJdW2k5XSwgXzFfOCk7Ci0gICAgICAgICAgICAgIHMgPSBMX21hYyAocywgcnJbaTNdW2k5XSwgXzFfOCk7Ci0gICAgICAgICAgICAgIHMgPSBMX21hYyAocywgcnJbaTRdW2k5XSwgXzFfOCk7Ci0gICAgICAgICAgICAgIHMgPSBMX21hYyAocywgcnJbaTVdW2k5XSwgXzFfOCk7Ci0gICAgICAgICAgICAgIHMgPSBMX21hYyAocywgcnJbaTZdW2k5XSwgXzFfOCk7Ci0gICAgICAgICAgICAgIHMgPSBMX21hYyAocywgcnJbaTddW2k5XSwgXzFfOCk7Ci0gICAgICAgICAgICAgIHJydltpOV0gPSBwdl9yb3VuZCAocyk7Ci0gICAgICAgICAgIH0KLQotICAgICAgICAgICAvLyBEZWZhdWx0IHZhbHVlCi0gICAgICAgICAgIHNxID0gLTE7Ci0gICAgICAgICAgIGFscCA9IDE7Ci0gICAgICAgICAgIHBzID0gMDsKLSAgICAgICAgICAgaWEgPSBpcG9zWzhdOwotICAgICAgICAgICBpYiA9IGlwb3NbOV07Ci0KLSAgICAgICAgICAgZm9yIChpOCA9IGlwb3NbOF07IGk4IDwgTF9DT0RFOyBpOCArPSBzdGVwKQotICAgICAgICAgICB7Ci0gICAgICAgICAgICAgIHBzMSA9IGFkZCAocHMwLCBkbltpOF0pOwotCi0gICAgICAgICAgICAgIGFscDEgPSBMX21hYyAoYWxwMCwgcnJbaThdW2k4XSwgXzFfMTI4KTsKLSAgICAgICAgICAgICAgYWxwMSA9IExfbWFjIChhbHAxLCBycltpMF1baThdLCBfMV82NCk7Ci0gICAgICAgICAgICAgIGFscDEgPSBMX21hYyAoYWxwMSwgcnJbaTFdW2k4XSwgXzFfNjQpOwotICAgICAgICAgICAgICBhbHAxID0gTF9tYWMgKGFscDEsIHJyW2kyXVtpOF0sIF8xXzY0KTsKLSAgICAgICAgICAgICAgYWxwMSA9IExfbWFjIChhbHAxLCBycltpM11baThdLCBfMV82NCk7Ci0gICAgICAgICAgICAgIGFscDEgPSBMX21hYyAoYWxwMSwgcnJbaTRdW2k4XSwgXzFfNjQpOwotICAgICAgICAgICAgICBhbHAxID0gTF9tYWMgKGFscDEsIHJyW2k1XVtpOF0sIF8xXzY0KTsKLSAgICAgICAgICAgICAgYWxwMSA9IExfbWFjIChhbHAxLCBycltpNl1baThdLCBfMV82NCk7Ci0gICAgICAgICAgICAgIGFscDEgPSBMX21hYyAoYWxwMSwgcnJbaTddW2k4XSwgXzFfNjQpOwotCi0gICAgICAgICAgICAgIGZvciAoaTkgPSBpcG9zWzldOyBpOSA8IExfQ09ERTsgaTkgKz0gc3RlcCkKLSAgICAgICAgICAgICAgewotICAgICAgICAgICAgICAgICBwczIgPSBhZGQgKHBzMSwgZG5baTldKTsKLQotICAgICAgICAgICAgICAgICBhbHAyID0gTF9tYWMgKGFscDEsIHJydltpOV0sIF8xXzgpOwotICAgICAgICAgICAgICAgICBhbHAyID0gTF9tYWMgKGFscDIsIHJyW2k4XVtpOV0sIF8xXzY0KTsKLQotICAgICAgICAgICAgICAgICBzcTIgPSBtdWx0IChwczIsIHBzMik7Ci0KLSAgICAgICAgICAgICAgICAgYWxwXzE2ID0gcHZfcm91bmQgKGFscDIpOwotCi0gICAgICAgICAgICAgICAgIHMgPSBMX21zdSAoTF9tdWx0IChhbHAsIHNxMiksIHNxLCBhbHBfMTYpOwotCi0gICAgICAgICAgICAgICAgIGlmIChzID4gMCkKLSAgICAgICAgICAgICAgICAgewotICAgICAgICAgICAgICAgICAgICBzcSA9IHNxMjsKLSAgICAgICAgICAgICAgICAgICAgcHMgPSBwczI7Ci0gICAgICAgICAgICAgICAgICAgIGFscCA9IGFscF8xNjsKLSAgICAgICAgICAgICAgICAgICAgaWEgPSBpODsKLSAgICAgICAgICAgICAgICAgICAgaWIgPSBpOTsKLSAgICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICB9Ci0gICAgICAgICAgIH0KLSAgICAgICAgfSAvLyBlbmQgIGdzbWVmckZsYWcKLQotICAgICAgICAvLwotICAgICAgICAvLyB0ZXN0IGFuZCBtZW1vcmlzZSBpZiB0aGlzIGNvbWJpbmF0aW9uIGlzIGJldHRlciB0aGFuIHRoZSBsYXN0IG9uZS8KLSAgICAgICAgLy8KLQotICAgICAgICBzID0gTF9tc3UgKExfbXVsdCAoYWxwaywgc3EpLCBwc2ssIGFscCk7Ci0KLSAgICAgICAgaWYgKHMgPiAwKQotICAgICAgICB7Ci0gICAgICAgICAgICBwc2sgPSBzcTsKLSAgICAgICAgICAgIGFscGsgPSBhbHA7Ci0gICAgICAgICAgICBjb2R2ZWNbMF0gPSBpMDsKLSAgICAgICAgICAgIGNvZHZlY1sxXSA9IGkxOwotICAgICAgICAgICAgY29kdmVjWzJdID0gaTI7Ci0gICAgICAgICAgICBjb2R2ZWNbM10gPSBpMzsKLSAgICAgICAgICAgIGNvZHZlY1s0XSA9IGk0OwotICAgICAgICAgICAgY29kdmVjWzVdID0gaTU7Ci0gICAgICAgICAgICBjb2R2ZWNbNl0gPSBpNjsKLSAgICAgICAgICAgIGNvZHZlY1s3XSA9IGk3OwotCi0gICAgICAgICAgICBpZiAoZ3NtZWZyRmxhZyAhPSAwKQotICAgICAgICAgICAgewotICAgICAgICAgICAgICAgY29kdmVjWzh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AgICAgICAvKiBhbHAwID0gTF9tdWx0IChycltpMF1baTBdLCBfMV8xNiwgcE92ZXJmbG93KTsgKi8KLSAgICAgICAgYWxwMCA9IChXb3JkMzIpIHJyW2kwXVtpMF0gPDwgMTI7Ci0KLSAgICAgICAgLyogYWxwMCA9IExfbWFjIChhbHAwLCBycltpMV1baTFdLCBfMV8xNiwgcE92ZXJmbG93KTsgKi8KLSAgICAgICAgYWxwMCArPSAoV29yZDMyKSBycltpMV1baTFdIDw8IDEyOwotCi0gICAgICAgIC8qIGFscDAgPSBMX21hYyAoYWxwMCwgcnJbaTBdW2kxXSwgXzFfOCwgcE92ZXJmbG93KTsgKi8KLSAgICAgICAgYWxwMCArPSAoV29yZDMyKSBycltpMF1baTFdIDw8IDEzOwotICAgICAgICBhbHAwICs9IDB4MDAwMDgwMDBMOwotCi0gICAgICAgIC8qLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSoKLSAgICAgICAgKiBpMiBhbmQgaTMgbG9vcDogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqCi0gICAgICAgICotLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tKi8KLQotICAgICAgICBwX3RlbXAxID0gdGVtcDE7Ci0gICAgICAgIGZvciAoaTMgPSBpcG9zWzNdOyBpMyA8IExfQ09ERTsgaTMgKz0gc3RlcCkKLSAgICAgICAgewotICAgICAgICAgICAgcF90ZW1wMiA9ICZycltpM11bMF07Ci0gICAgICAgICAgICBzICA9IChXb3JkMzIpICogKHBfdGVtcDIgKyBpMykgPj4gMTsKLSAgICAgICAgICAgIHMgKz0gKFdvcmQzMikgKiAocF90ZW1wMiArIGkwKTsKLSAgICAgICAgICAgIHMgKz0gKFdvcmQzMikgKiAocF90ZW1wMiArIGkxKTsKLSAgICAgICAgICAgICoocF90ZW1wMSsrKSA9IHBzMCArIGRuW2kzXTsKLSAgICAgICAgICAgICoocF90ZW1wMSsrKSA9IChXb3JkMTYpKChzICsgMikgPj4gMik7Ci0gICAgICAgIH0KLQotICAgICAgICAvKiBEZWZhdWx0IHZhbHVlICovCi0gICAgICAgIHNxID0gLTE7Ci0gICAgICAgIGFscCA9IDE7Ci0gICAgICAgIHBzID0gMDsKLSAgICAgICAgaWEgPSBpcG9zWzJdOwotICAgICAgICBpYiA9IGlwb3NbM107Ci0KLSAgICAgICAgcyA9IChhbHAwID4+IDEyKTsKLQotICAgICAgICBmb3IgKGogPSBpcG9zWzJdOyBqIDwgTF9DT0RFOyBqICs9IHN0ZXApCi0gICAgICAgIHsKLSAgICAgICAgICAgIC8qIGluZGV4IGluY3JlbWVudCA9IHN0ZXAgICovCi0gICAgICAgICAgICBwX3RlbXAyID0gJnJyW2pdWzBdOwotCi0gICAgICAgICAgICBhbHAxID0gKHMgKyAoV29yZDMyKSAqIChwX3RlbXAyICsgaikpID4+IDE7Ci0KLSAgICAgICAgICAgIGFscDEgKz0gKFdvcmQzMikgKiAocF90ZW1wMiArIGkwKTsKLQotICAgICAgICAgICAgYWxwMSArPSAoV29yZDMyKSAqIChwX3RlbXAyICsgaTEpOwotCi0gICAgICAgICAgICBwX3RlbXAxID0gdGVtcDE7Ci0gICAgICAgICAgICBwczEgPSBkbltqXTsKLQotCi0gICAgICAgICAgICBmb3IgKGkzID0gaXBvc1szXTsgaTMgPCBMX0NPREU7IGkzICs9IHN0ZXApCi0gICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgLyogaW5kZXggaW5jcmVtZW50ID0gc3RlcCAqLwotICAgICAgICAgICAgICAgIHBzMiA9IHBzMSArICoocF90ZW1wMSsrKTsKLQotICAgICAgICAgICAgICAgIHNxMiA9IChXb3JkMTYpKCgoV29yZDMyKSBwczIgKiBwczIpID4+IDE1KTsKLQotICAgICAgICAgICAgICAgIGFscDIgPSAoYWxwMSArIHBfdGVtcDJbaTNdKSA+PiAyOwotICAgICAgICAgICAgICAgIGFscDIgPSAoYWxwMiArICoocF90ZW1wMSsrKSkgPj4gMTsgIC8qICBhbHAyIGlzIGFsd2F5cyA+IDAgICovCi0gICAgICAgICAgICAgICAgaWYgKCgoV29yZDMyKSBzcTIgKiBhbHApID4gKChXb3JkMzIpIHNxICogYWxwMikpCi0gICAgICAgICAgICAgICAgewotICAgICAgICAgICAgICAgICAgICBzcSA9IHNxMjsKLSAgICAgICAgICAgICAgICAgICAgcHMgPSBwczI7Ci0gICAgICAgICAgICAgICAgICAgIGFscCA9IChXb3JkMTYpYWxwMjsKLSAgICAgICAgICAgICAgICAgICAgaWEgPSBqOwotICAgICAgICAgICAgICAgICAgICBpYiA9IGkzOwotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgIH0KLQotICAgICAgICB9Ci0gICAgICAgIGkyID0gaWE7Ci0gICAgICAgIGkzID0gaWI7Ci0gICAgICAgIGluZGV4WzJdID0gaWE7Ci0gICAgICAgIGluZGV4WzNdID0gaWI7Ci0KLSAgICAgICAgLyotLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tKgotICAgICAgICAqIGk0IGFuZCBpNSBsb29wOiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICoKLSAgICAgICAgKi0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0qLwotCi0gICAgICAgIGFscDAgPSAoKFdvcmQzMikgYWxwIDw8IDE1KSArIDB4MDAwMDgwMDBMOwotICAgICAgICBwX3RlbXAxID0gdGVtcDE7Ci0KLSAgICAgICAgZm9yIChpNSA9IGlwb3NbNV07IGk1IDwgTF9DT0RFOyBpNSArPSBzdGVwKQotICAgICAgICB7Ci0gICAgICAgICAgICBwX3RlbXAyID0gJnJyW2k1XVswXTsKLSAgICAgICAgICAgIHMgPSAoV29yZDMyKSAqIChwX3RlbXAyICsgaTUpID4+IDE7Ci0gICAgICAgICAgICBzICs9IChXb3JkMzIpICogKHBfdGVtcDIgKyBpMCk7Ci0gICAgICAgICAgICBzICs9IChXb3JkMzIpICogKHBfdGVtcDIgKyBpMSk7Ci0gICAgICAgICAgICBzICs9IChXb3JkMzIpICogKHBfdGVtcDIgKyBpMik7Ci0gICAgICAgICAgICBzICs9IChXb3JkMzIpICogKHBfdGVtcDIgKyBpMyk7Ci0KLSAgICAgICAgICAgICoocF90ZW1wMSsrKSA9IHBzICsgZG5baTVdOwotICAgICAgICAgICAgKihwX3RlbXAxKyspID0gKFdvcmQxNikoKHMgKyAyKSA+PiAyKTsKLSAgICAgICAgfQotCi0gICAgICAgIC8qIERlZmF1bHQgdmFsdWUgKi8KLSAgICAgICAgc3EgPSAtMTsKLSAgICAgICAgYWxwID0gMTsKLSAgICAgICAgcHMgPSAwOwotICAgICAgICBpYSA9IGlwb3NbNF07Ci0gICAgICAgIGliID0gaXBvc1s1XTsKLQotICAgICAgICBmb3IgKGogPSBpcG9zWzRdOyBqIDwgTF9DT0RFOyBqICs9IHN0ZXApCi0gICAgICAgIHsKLSAgICAgICAgICAgIC8qIHBzMSA9IGFkZCAocHMwLCBkbltpNF0sIHBPdmVyZmxvdyk7ICovCi0gICAgICAgICAgICBwX3RlbXAyID0gJnJyW2pdWzBdOwotCi0gICAgICAgICAgICAvKiBhbHAxID0gTF9tYWMgKGFscDAsIHJyW2k0XVtpNF0sIF8xXzMyLCBwT3ZlcmZsb3cpOyAqLwotICAgICAgICAgICAgYWxwMSA9IGFscDAgKyAoKFdvcmQzMikgKiAocF90ZW1wMiArIGopIDw8IDExKTsKLQotICAgICAgICAgICAgLyogYWxwMSA9IExfbWFjIChhbHAxLCBycltpMF1baTRdLCBfMV8xNiwgcE92ZXJmbG93KTsgKi8KLSAgICAgICAgICAgIGFscDEgKz0gKFdvcmQzMikgKiAocF90ZW1wMiArIGkwKSA8PCAxMjsKLQotICAgICAgICAgICAgLyogYWxwMSA9IExfbWFjIChhbHAxLCBycltpMV1baTRdLCBfMV8xNiwgcE92ZXJmbG93KTsgKi8KLSAgICAgICAgICAgIGFscDEgKz0gKFdvcmQzMikgKiAocF90ZW1wMiArIGkxKSA8PCAxMjsKLQotICAgICAgICAgICAgLyogYWxwMSA9IExfbWFjIChhbHAxLCBycltpMl1baTRdLCBfMV8xNiwgcE92ZXJmbG93KTsgKi8KLSAgICAgICAgICAgIGFscDEgKz0gKFdvcmQzMikgKiAocF90ZW1wMiArIGkyKSA8PCAxMjsKLQotICAgICAgICAgICAgLyogYWxwMSA9IExfbWFjIChhbHAxLCBycltpM11baTRdLCBfMV8xNiwgcE92ZXJmbG93KTsgKi8KLSAgICAgICAgICAgIGFscDEgKz0gKFdvcmQzMikgKiAocF90ZW1wMiArIGkzKSA8PCAxMjsKLQotICAgICAgICAgICAgcF90ZW1wMSA9IHRlbXAxOwotICAgICAgICAgICAgcHMxID0gIGRuW2pdOwotCi0gICAgICAgICAgICBmb3IgKGk1ID0gaXBvc1s1XTsgaTUgPCBMX0NPREU7IGk1ICs9IHN0ZXApCi0gICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgcHMyID0gcHMxICsgKihwX3RlbXAxKyspOwotCi0gICAgICAgICAgICAgICAgYWxwMiA9IGFscDEgKyAoKFdvcmQzMikgKiAocF90ZW1wMiArIGk1KSA8PCAxMik7Ci0KLSAgICAgICAgICAgICAgICBhbHBfMTYgPSAoV29yZDE2KSgoYWxwMiArICgoV29yZDMyKSAqIChwX3RlbXAxKyspIDw8IDE0KSkgPj4gMTYpOwotICAgICAgICAgICAgICAgIHNxMiA9IChXb3JkMTYpKCgoV29yZDMyKSBwczIgKiBwczIpID4+IDE1KTsKLQotICAgICAgICAgICAgICAgIGlmICgoKFdvcmQzMikgc3EyICogYWxwKSA+ICgoV29yZDMyKSBzcSAqIGFscF8xNikpCi0gICAgICAgICAgICAgICAgewotICAgICAgICAgICAgICAgICAgICBzcSA9IHNxMjsKLSAgICAgICAgICAgICAgICAgICAgcHMgPSBwczI7Ci0gICAgICAgICAgICAgICAgICAgIGFscCA9IGFscF8xNjsKLSAgICAgICAgICAgICAgICAgICAgaWEgPSBqOwotICAgICAgICAgICAgICAgICAgICBpYiA9IGk1OwotICAgICAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgfQotICAgICAgICB9Ci0gICAgICAgIGk0ID0gaWE7Ci0gICAgICAgIGk1ID0gaWI7Ci0gICAgICAgIGluZGV4WzRdID0gaWE7Ci0gICAgICAgIGluZGV4WzVdID0gaWI7Ci0KLSAgICAgICAgLyotLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tKgotICAgICAgICAqIGk2IGFuZCBpNyBsb29wOiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICoKLSAgICAgICAgKi0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0qLwotCi0gICAgICAgIGFscDAgPSAoKFdvcmQzMikgYWxwIDw8IDE1KSArIDB4MDAwMDgwMDBMOwotCi0gICAgICAgIHBfdGVtcDEgPSB0ZW1wMTsKLQotICAgICAgICBmb3IgKGk3ID0gaXBvc1s3XTsgaTcgPCBMX0NPREU7IGk3ICs9IHN0ZXApCi0gICAgICAgIHsKLSAgICAgICAgICAgIHMgPSAoV29yZDMyKSBycltpN11baTddID4+IDE7Ci0gICAgICAgICAgICBzICs9IChXb3JkMzIpIHJyW2kwXVtpN107Ci0gICAgICAgICAgICBzICs9IChXb3JkMzIpIHJyW2kxXVtpN107Ci0gICAgICAgICAgICBzICs9IChXb3JkMzIpIHJyW2kyXVtpN107Ci0gICAgICAgICAgICBzICs9IChXb3JkMzIpIHJyW2kzXVtpN107Ci0gICAgICAgICAgICBzICs9IChXb3JkMzIpIHJyW2k0XVtpN107Ci0gICAgICAgICAgICBzICs9IChXb3JkMzIpIHJyW2k1XVtpN107Ci0gICAgICAgICAgICAqKHBfdGVtcDErKykgPSBwcyArIGRuW2k3XTsKLSAgICAgICAgICAgICoocF90ZW1wMSsrKSA9IChXb3JkMTYpKChzICsgNCkgPj4gMyk7Ci0gICAgICAgIH0KLQotCi0gICAgICAgIC8qIERlZmF1bHQgdmFsdWUgKi8KLSAgICAgICAgc3EgPSAtMTsKLSAgICAgICAgYWxwID0gMTsKLSAgICAgICAgcHMgPSAwOwotICAgICAgICBpYSA9IGlwb3NbNl07Ci0gICAgICAgIGliID0gaXBvc1s3XTsKLQotICAgICAgICBmb3IgKGogPSBpcG9zWzZdOyBqIDwgTF9DT0RFOyBqICs9IHN0ZXApCi0gICAgICAgIHsKLSAgICAgICAgICAgIC8qIHBzMSA9IGFkZCAocHMwLCBkbltpNl0sIHBPdmVyZmxvdyk7ICovCi0KLSAgICAgICAgICAgIHBfdGVtcDIgPSAoV29yZDE2ICopICYgcnJbal07Ci0KLSAgICAgICAgICAgIC8qIGFscDEgPSBMX21hYyAoYWxwMCwgcnJbaTZdW2k2XSwgXzFfNjQsIHBPdmVyZmxvdyk7ICovCi0gICAgICAgICAgICBhbHAxID0gYWxwMCArICgoV29yZDMyKSAqIChwX3RlbXAyICsgaikgPDwgMTApOwotCi0gICAgICAgICAgICAvKiBhbHAxID0gTF9tYWMgKGFscDEsIHJyW2kwXVtpNl0sIF8xXzMyLCBwT3ZlcmZsb3cpOyAqLwotICAgICAgICAgICAgYWxwMSArPSAoV29yZDMyKSAqIChwX3RlbXAyICsgaTApIDw8IDExOwotCi0KLSAgICAgICAgICAgIC8qIGFscDEgPSBMX21hYyAoYWxwMSwgcnJbaTFdW2k2XSwgXzFfMzIsIHBPdmVyZmxvdyk7ICovCi0gICAgICAgICAgICBhbHAxICs9IChXb3Jk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yspIDw8IDE0KSkgPj4gMTYpOwotCi0gICAgICAgICAgICAgICAgc3EyID0gKFdvcmQxNikoKChXb3JkMzIpIHBzMiAqIHBzMikgPj4gMTUpOwotCi0gICAgICAgICAgICAgICAgaWYgKCgoV29yZDMyKSBzcTIgKiBhbHApID4gKChXb3JkMzIpIHNxICogYWxwXzE2KSkKLSAgICAgICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgICAgIHNxID0gc3EyOwotICAgICAgICAgICAgICAgICAgICBwcyA9IHBzMjsKLSAgICAgICAgICAgICAgICAgICAgYWxwID0gYWxwXzE2OwotICAgICAgICAgICAgICAgICAgICBpYSA9IGo7Ci0gICAgICAgICAgICAgICAgICAgIGliID0gaTc7Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgfQotICAgICAgICB9Ci0KLSAgICAgICAgaTYgPSBpYTsKLSAgICAgICAgaTcgPSBpYjsKLSAgICAgICAgaW5kZXhbNl0gPSBpYTsKLSAgICAgICAgaW5kZXhbN10gPSBpYjsKLQotICAgICAgICAvKiBub3cgZmluaXNoZWQgc2VhcmNoaW5nIGEgc2V0IG9mIDggcHVsc2VzICovCi0KLSAgICAgICAgaWYgKGdzbWVmckZsYWcgIT0gMCkKLSAgICAgICAgewotICAgICAgICAgICAgLyogZ28gb24gd2l0aCB0aGUgdHdvIGxhc3QgcHVsc2VzIGZvciBHU01FRlIgICAgICAgICAgICAgICAgICAgICAgKi8KLSAgICAgICAgICAgIC8qLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSoKLSAgICAgICAgICAgICogaTggYW5kIGk5IGxvb3A6ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKgotICAgICAgICAgICAgKi0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0qLwotCi0gICAgICAgICAgICBhbHAwID0gKChXb3JkMzIpIGFscCA8PCAxNSkgKyAweDAwMDA4MDAwTDsKLQotICAgICAgICAgICAgcF90ZW1wMSA9IHRlbXAxOwotCi0gICAgICAgICAgICBmb3IgKGk5ID0gaXBvc1s5XTsgaTkgPCBMX0NPREU7IGk5ICs9IHN0ZXApCi0gICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgcyA9IChXb3JkMzIpIHJyW2k5XVtpOV0gPj4gMTsKLSAgICAgICAgICAgICAgICBzICs9IChXb3JkMzIpIHJyW2kwXVtpOV07Ci0gICAgICAgICAgICAgICAgcyArPSAoV29yZDMyKSBycltpMV1baTldOwotICAgICAgICAgICAgICAgIHMgKz0gKFdvcmQzMikgcnJbaTJdW2k5XTsKLSAgICAgICAgICAgICAgICBzICs9IChXb3JkMzIpIHJyW2kzXVtpOV07Ci0gICAgICAgICAgICAgICAgcyArPSAoV29yZDMyKSBycltpNF1baTldOwotICAgICAgICAgICAgICAgIHMgKz0gKFdvcmQzMikgcnJbaTVdW2k5XTsKLSAgICAgICAgICAgICAgICBzICs9IChXb3JkMzIpIHJyW2k2XVtpOV07Ci0gICAgICAgICAgICAgICAgcyArPSAoV29yZDMyKSBycltpN11baTldOwotCi0gICAgICAgICAgICAgICAgKihwX3RlbXAxKyspID0gcHMgKyBkbltpOV07Ci0gICAgICAgICAgICAgICAgKihwX3RlbXAxKyspID0gKFdvcmQxNikoKHMgKyA0KSA+PiAzKTsKLSAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgLyogRGVmYXVsdCB2YWx1ZSAqLwotICAgICAgICAgICAgc3EgPSAtMTsKLSAgICAgICAgICAgIGFscCA9IDE7Ci0gICAgICAgICAgICBwcyA9IDA7Ci0gICAgICAgICAgICBpYSA9IGlwb3NbOF07Ci0gICAgICAgICAgICBpYiA9IGlwb3NbOV07Ci0KLSAgICAgICAgICAgIGZvciAoaiA9IGlwb3NbOF07IGogPCBMX0NPREU7IGogKz0gc3RlcCkKLSAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAvKiBwczEgPSBhZGQgKHBzMCwgZG5baThdLCBwT3ZlcmZsb3cpOyAqLwotICAgICAgICAgICAgICAgIHBfdGVtcDIgPSAmcnJbal1bMF07Ci0KLSAgICAgICAgICAgICAgICAvKiBhbHAxID0gTF9tYWMgKGFscDAsIHJyW2k4XVtpOF0sIF8xXzEyOCwgcE92ZXJmbG93KTsgKi8KLSAgICAgICAgICAgICAgICBhbHAxID0gYWxwMCArICgoV29yZDMyKSAqIChwX3RlbXAyICsgaikgPDwgOSk7Ci0KLSAgICAgICAgICAgICAgICAvKiBhbHAxID0gTF9tYWMgKGFscDEsIHJyW2kwXVtpOF0sIF8xXzY0LCBwT3ZlcmZsb3cpOyAqLwotICAgICAgICAgICAgICAgIGFscDEgKz0gKFdvcmQzMikgcnJbaTBdW2pdIDw8IDEwOwotCi0gICAgICAgICAgICAgICAgLyogYWxwMSA9IExfbWFjIChhbHAxLCBycltpMV1baThdLCBfMV82NCwgcE92ZXJmbG93KTsgKi8KLSAgICAgICAgICAgICAgICBhbHAxICs9IChXb3JkMzIpIHJyW2kxXVtqXSA8PCAxMDsKLQotICAgICAgICAgICAgICAgIC8qIGFscDEgPSBMX21hYyAoYWxwMSwgcnJbaTJdW2k4XSwgXzFfNjQsIHBPdmVyZmxvdyk7ICovCi0gICAgICAgICAgICAgICAgYWxwMSArPSAoV29yZDMyKSBycltpMl1bal0gPDwgMTA7Ci0KLSAgICAgICAgICAgICAgICAvKiBhbHAxID0gTF9tYWMgKGFscDEsIHJyW2kzXVtpOF0sIF8xXzY0LCBwT3ZlcmZsb3cpOyAqLwotICAgICAgICAgICAgICAgIGFscDEgKz0gKFdvcmQzMikgcnJbaTNdW2pdIDw8IDEwOwotCi0gICAgICAgICAgICAgICAgLyogYWxwMSA9IExfbWFjIChhbHAxLCBycltpNF1baThdLCBfMV82NCwgcE92ZXJmbG93KTsgKi8KLSAgICAgICAgICAgICAgICBhbHAxICs9IChXb3JkMzIpIHJyW2k0XVtqXSA8PCAxMDsKLQotICAgICAgICAgICAgICAgIC8qIGFscDEgPSBMX21hYyAoYWxwMSwgcnJbaTVdW2k4XSwgXzFfNjQsIHBPdmVyZmxvdyk7ICovCi0gICAgICAgICAgICAgICAgYWxwMSArPSAoV29yZDMyKSBycltpNV1bal0gPDwgMTA7Ci0KLSAgICAgICAgICAgICAgICAvKiBhbHAxID0gTF9tYWMgKGFscDEsIHJyW2k2XVtpOF0sIF8xXzY0LCBwT3ZlcmZsb3cpOyAqLwotICAgICAgICAgICAgICAgIGFscDEgKz0gKFdvcmQzMikgcnJbaTZdW2pdIDw8IDEwOwotCi0gICAgICAgICAgICAgICAgLyogYWxwMSA9IExfbWFjIChhbHAxLCBycltpN11baThdLCBfMV82NCwgcE92ZXJmbG93KTsgKi8KLSAgICAgICAgICAgICAgICBhbHAxICs9IChXb3JkMzIpIHJyW2k3XVtqXSA8PCAxMDsKLQotICAgICAgICAgICAgICAgIHBfdGVtcDEgPSB0ZW1wMTsKLSAgICAgICAgICAgICAgICBwczEgPSBkbltqXTsKLQotICAgICAgICAgICAgICAgIGZvciAoaTkgPSBpcG9zWzldOyBpOSA8IExfQ09ERTsgaTkgKz0gc3RlcCkKLSAgICAgICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgICAgIC8qIHBzMiA9IGFkZCAocHMxLCBkbltpOV0sIHBPdmVyZmxvdyk7ICovCi0gICAgICAgICAgICAgICAgICAgIHBzMiA9IHBzMSArICoocF90ZW1wMSsrKTsKLQotICAgICAgICAgICAgICAgICAgICAvKiBzcTIgPSBtdWx0IChwczIsIHBzMiwgcE92ZXJmbG93KTsgKi8KLSAgICAgICAgICAgICAgICAgICAgc3EyID0gKFdvcmQxNikoKChXb3JkMzIpIHBzMiAqIHBzMikgPj4gMTUpOwotCi0gICAgICAgICAgICAgICAgICAgIC8qIGFscDIgPSBMX21hYyAoYWxwMSwgcnJ2W2k5XSwgXzFfOCwgcE92ZXJmbG93KTsgKi8KLSAgICAgICAgICAgICAgICAgICAgYWxwMiA9IGFscDEgKyAoKFdvcmQzMikgKiAocF90ZW1wMiArIGk5KSA8PCAxMCkgOwotCi0gICAgICAgICAgICAgICAgICAgIC8qIGFscDIgPSBMX21hYyAoYWxwMiwgcnJbaThdW2k5XSwgXzFfNjQsIHBPdmVyZmxvdyk7ICovCi0gICAgICAgICAgICAgICAgICAgIGFscF8xNiA9IChXb3JkMTYpKChhbHAyICsgKChXb3JkMzIpICogKHBfdGVtcDErKykgPDwgMTMpKSA+PiAxNik7Ci0KLSAgICAgICAgICAgICAgICAgICAgaWYgKCgoV29yZDMyKSBzcTIgKiBhbHApID4gKChXb3JkMzIpIHNxICogYWxwXzE2KSkKLSAgICAgICAgICAgICAgICAgICAgewotICAgICAgICAgICAgICAgICAgICAgICAgc3EgPSBzcTI7Ci0gICAgICAgICAgICAgICAgICAgICAgICBwcyA9IHBzMjsKLSAgICAgICAgICAgICAgICAgICAgICAgIGFscCA9IGFscF8xNjsKLSAgICAgICAgICAgICAgICAgICAgICAgIGlhID0gajsKLSAgICAgICAgICAgICAgICAgICAgICAgIGliID0gaTk7Ci0gICAgICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgIGluZGV4WzhdID0gaWE7Ci0gICAgICAgICAgICBpbmRleFs5XSA9IGliOwotCi0gICAgICAgIH0vKiBlbmQgIGdzbWVmckZsYWcgKi8KLQotICAgICAgICAvKi0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0gICoKLSAgICAgICAgICogdGVzdCBhbmQgbWVtb3Jpc2UgaWYgdGhpcyBjb21iaW5hdGlvbiBpcyBiZXR0ZXIgdGhhbiB0aGUgbGFzdCBvbmUuKgotICAgICAgICAgKi0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0qLwotCi0gICAgICAgIGlmICgoKFdvcmQzMikgYWxwayAqIHNxKSA+ICgoV29yZDMyKSBwc2sgKiBhbHApKQotICAgICAgICB7Ci0gICAgICAgICAgICBwc2sgPSBzcTsKLSAgICAgICAgICAgIGFscGsgPSBhbHA7Ci0KLSAgICAgICAgICAgIGlmIChnc21lZnJGbGFnICE9IDApCi0gICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgbWVtY3B5KGNvZHZlYywgaW5kZXgsICgyKk5CX1RSQUNLKSpzaXplb2YoKmluZGV4KSk7Ci0gICAgICAgICAgICB9Ci0gICAgICAgICAgICBlbHNlCi0gICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgbWVtY3B5KGNvZHZlYywgaW5kZXgsICgyKk5CX1RSQUNLX01SMTAyKSpzaXplb2YoKmluZGV4KSk7Ci0gICAgICAgICAgICB9Ci0KLSAgICAgICAgfQotICAgICAgICAvKi0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0qCi0gICAgICAgICogQ3ljbGljIHBlcm11dGF0aW9uIG9mIGkxLGkyLGkzLGk0LGk1LGk2LGk3LChpOCBhbmQgaTkpLiAgICAgICAgICAqCi0gICAgICAgICotLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tKi8KLQotICAgICAgICBwb3MgPSBpcG9zWzFdOwotICAgICAgICBmb3IgKGogPSAxLCBrID0gMjsgayA8IG5iUHVsc2U7IGorKywgaysrKQotICAgICAgICB7Ci0gICAgICAgICAgICBpcG9zW2pdID0gaXBvc1trXTsKLSAgICAgICAgfQotICAgICAgICBpcG9zW25iUHVsc2UtMV0gPSBwb3M7Ci0gICAgfSAvKiBlbmQgMS4ubmJUcmF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gICAgdmFsID0gZG5baV07Ci0KLSAgICAgICAgaWYgKHZhbCA+PSAwKQotICAgICAgICB7Ci0gICAgICAgICAgICBzaWduW2ldID0gMzI3Njc7Ci0gICAgICAgIH0KLSAgICAgICAgZWxzZQotICAgICAgICB7Ci0gICAgICAgICAgICBzaWduW2ldID0gLTMyNzY3OwotICAgICAgICAgICAgdmFsID0gbmVnYXRlKHZhbCk7Ci0gICAgICAgICAgICBkbltpXSA9IHZhbDsgICAgIC8qIG1vZGlmeSBkbltdIGFjY29yZGluZyB0byB0aGUgZml4ZWQgc2lnbiAqLwotICAgICAgICB9Ci0KLSAgICAgICAgZG4yW2ldID0gdmFsOwotICAgIH0KLQotICAgIC8qIGtlZXAgOC1uIG1heGltdW0gcG9zaXRpb25zLzggb2YgZWFjaCB0cmFjayBhbmQgc3RvcmUgaXQgaW4gZG4yW10gKi8KLQotICAgIGZvciAoaSA9IDA7IGkgPCBOQl9UUkFDSzsgaSsrKQotICAgIHsKLSAgICAgICAgZm9yIChrID0gMDsgayA8ICg4IC0gbik7IGsrKykKLSAgICAgICAgewotICAgICAgICAgICAgbWluID0gMHg3ZmZmOwotICAgICAgICAgICAgZm9yIChqID0gaTsgaiA8IExfQ09ERTsgaiArPSBTVEVQKQotICAgICAgICAgICAgewotICAgICAgICAgICAgICAgIGlmIChkbjJbal0gPj0gMCkKLSAgICAgICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgICAgIGlmIChkbjJbal0gPCBtaW4pCi0gICAgICAgICAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAgICAgICAgIG1pbiA9IGRuMltqXTsKLSAgICAgICAgICAgICAgICAgICAgICAgIHBvcyA9IGo7Ci0gICAgICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICB9Ci0gICAgICAgICAgICBkbjJbcG9zXSA9IC0xOwotICAgICAgICB9Ci0gICAgfQotCi0gICAgcmV0dXJuOwotfQotCi0vKioqKioqKioqKioqK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ci0KLSAgICBmb3IgKGkgPSAwOyBpIDwgTF9DT0RFOyBpKyspCi0gICAgewotICAgICAgICB2YWwgPSBkbltpXTsKLSAgICAgICAgY29yID0gcHZfcm91bmQgKExfc2hsIChMX21hYyAoTF9tdWx0IChrX2NuLCBjbltpXSksIGtfZG4sIHZhbCksIDEwKSk7Ci0KLSAgICAgICAgaWYgKGNvciA+PSAwKQotICAgICAgICB7Ci0gICAgICAgICAgICBzaWduW2ldID0gMzI3Njc7ICAgICAgICAgICAgICAgICAgICAgIC8vIHNpZ24gPSArMQotICAgICAgICB9Ci0gICAgICAgIGVsc2UKLSAgICAgICAgewotICAgICAgICAgICAgc2lnbltpXSA9IC0zMjc2NzsgICAgICAgICAgICAgICAgICAgICAvLyBzaWduID0gLTEKLSAgICAgICAgICAgIGNvciA9IG5lZ2F0ZSAoY29yKTsKLSAgICAgICAgICAgIHZhbCA9IG5lZ2F0ZSAodmFsKTsKLSAgICAgICAgfQotICAgICAgICAvLyBtb2RpZnkgZG5bXSBhY2NvcmRpbmcgdG8gdGhlIGZpeGVkIHNpZ24KLSAgICAgICAgZG5baV0gPSB2YWw7Ci0gICAgICAgIGVuW2ldID0gY29yOwotICAgIH0KLQotICAgIG1heF9vZl9hbGwgPSAtMTsKLSAgICBmb3IgKGkgPSAwOyBpIDwgbmJfdHJhY2s7IGkrKykKLSAgICB7Ci0gICAgICAgIG1heCA9IC0xOwotCi0gICAgICAgIGZvciAoaiA9IGk7IGogPCBMX0NPREU7IGogKz0gc3RlcCkKLSAgICAgICAgewotICAgICAgICAgICAgY29yID0gZW5bal07Ci0gICAgICAgICAgICB2YWwgPSBzdWIgKGNvciwgbWF4KTsKLQotICAgICAgICAgICAgaWYgKHZhbCA+IDApCi0gICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgbWF4ID0gY29yOwotICAgICAgICAgICAgICAgIHBvcyA9IGo7Ci0gICAgICAgICAgICB9Ci0gICAgICAgIH0KLSAgICAgICAgLy8gc3RvcmUgbWF4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ICAgICAgICAgICAgICAgICAgICAgICAgICovCi0gICAgV29yZDE2IHBvc19tYXhbXSwgICAvKiBvICAgOiBwb3NpdGlvbiBvZiBtYXhpbXVtIGNvcnJlbGF0aW9uICAgICAgICAgICAgKi8KLSAgICBXb3JkMTYgbmJfdHJhY2ssICAgIC8qIGkgICA6IG51bWJlciBvZiB0cmFja3MgdHJhY2tzICAgICAgICAgICAgICAgICAgICAqLwotICAgIFdvcmQxNiBpcG9zW10sICAgICAgLyogbyAgIDogc3RhcnRpbmcgcG9zaXRpb24gZm9yIGVhY2ggcHVsc2UgICAgICAgICAgICovCi0gICAgV29yZDE2IHN0ZXAsICAgICAgICAvKiBpICAgOiB0aGUgc3RlcCBzaXplIGluIHRoZSB0cmFja3MgICAgICAgICAgICAgICAgKi8KLSAgICBGbGFnICAgKnBPdmVyZmxvdyAgIC8qIGkvbzogb3ZlcmZsb3cgZmxhZyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotKQotewotICAgIFdvcmQxNiBpLCBqOwotICAgIFdvcmQxNiB2YWw7Ci0gICAgV29yZDE2IGNvcjsKLSAgICBXb3JkMTYga19jbjsKLSAgICBXb3JkMTYga19kbjsKLSAgICBXb3JkMTYgbWF4OwotICAgIFdvcmQxNiBtYXhfb2ZfYWxsOwotICAgIFdvcmQxNiBwb3MgPSAwOyAvKiBpbml0aWFsaXphdGlvbiBvbmx5IG5lZWRlZCB0byBrZWVwIGdjYyBzaWxlbnQgKi8KLSAgICBXb3JkMTYgZW5bTF9DT0RFXTsgICAgICAgICAgICAgICAgICAvKiBjb3JyZWxhdGlvbiB2ZWN0b3IgKi8KLSAgICBXb3JkMzIgczsKLSAgICBXb3JkMzIgdDsKLSAgICBXb3JkMzIgTF90ZW1wOwotICAgIFdvcmQxNiAqcF9jbjsKLSAgICBXb3JkMTYgKnBfZG47Ci0gICAgV29yZDE2ICpwX3NpZ247Ci0gICAgV29yZDE2ICpwX2VuOwotCi0gICAgLyogY2FsY3VsYXRlIGV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2NuICogKihwX2NuLS0pKSA8PCAxOwotICAgICAgICB2YWwgPSBkbltpXTsKLSAgICAgICAgcyA9IExfbWFjKExfdGVtcCwga19kbiwgdmFsLCBwT3ZlcmZsb3cpOwotICAgICAgICBMX3RlbXAgPSBMX3NobChzLCAxMCwgcE92ZXJmbG93KTsKLSAgICAgICAgY29yID0gcHZfcm91bmQoTF90ZW1wLCBwT3ZlcmZsb3cpOwotCi0gICAgICAgIGlmIChjb3IgPj0gMCkKLSAgICAgICAgewotICAgICAgICAgICAgKihwX3NpZ24tLSkgPSAzMjc2NzsgICAgICAgICAgICAgICAgICAgICAgLyogc2lnbiA9ICsxICovCi0gICAgICAgIH0KLSAgICAgICAgZWxzZQotICAgICAgICB7Ci0gICAgICAgICAgICAqKHBfc2lnbi0tKSA9IC0zMjc2NzsgICAgICAgICAgICAgICAgICAgICAvKiBzaWduID0gLTEgKi8KLSAgICAgICAgICAgIGNvciA9IG5lZ2F0ZShjb3IpOwotCi0gICAgICAgICAgICAvKiBtb2RpZnkgZG5bXSBhY2NvcmRpbmcgdG8gdGhlIGZpeGVkIHNpZ24gKi8KLSAgICAgICAgICAgIGRuW2ldID0gbmVnYXRlKHZhbCk7Ci0gICAgICAgIH0KLQotICAgICAgICAqKHBfZW4tLSkgPSBjb3I7Ci0gICAgfQotCi0gICAgbWF4X29mX2FsbCA9IC0xOwotICAgIGZvciAoaSA9IDA7IGkgPCBuYl90cmFjazsgaSsrKQotICAgIHsKLSAgICAgICAgbWF4ID0gLTE7Ci0KLSAgICAgICAgZm9yIChqID0gaTsgaiA8IExfQ09ERTsgaiArPSBzdGVwKQotICAgICAgICB7Ci0gICAgICAgICAgICBjb3IgPSBlbltqXTsKLSAgICAgICAgICAgIGlmIChjb3IgPiBtYXgpCi0gICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgbWF4ID0gY29yOwotICAgICAgICAgICAgICAgIHBvcyA9IGo7Ci0gICAgICAgICAgICB9Ci0gICAgICAgIH0KLSAgICAgICA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S0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLQotIENBVVRJT04gW29wdGlvbmFsXQotIFtTdGF0ZSBhbnkgc3BlY2lhbCBub3RlcywgY29uc3RyYWludHMgb3IgY2F1dGlvbnMgZm9yIHVzZXJzIG9mIHRoaXMgZnVuY3Rpb25dCi0KLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLQotKi8KLQotdm9pZCBzdWJmcmFtZVByZVByb2MoCi0gICAgZW51bSBNb2RlIG1vZGUsICAgICAgICAgICAgLyogaSAgOiBjb2RlciBtb2RlICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0gICAgY29uc3QgV29yZDE2IGdhbW1hMVtdLCAgICAgLyogaSAgOiBzcGVjdHJhbCBleHAuIGZhY3RvciAxICAgICAgICAgICAgICAgICovCi0gICAgY29uc3QgV29yZDE2IGdhbW1hMV8xMmsyW10sLyogaSAgOiBzcGVjdHJhbCBleHAuIGZhY3RvciAxIGZvciBFRlIgICAgICAgICovCi0gICAgY29uc3QgV29yZDE2IGdhbW1hMltdLCAgICAgLyogaSAgOiBzcGVjdHJhbCBleHAuIGZhY3RvciAyICAgICAgICAgICAgICAgICovCi0gICAgV29yZDE2ICpBLCAgICAgICAgICAgICAgICAgLyogaSAgOiBBKHopIHVucXVhbnRpemVkIGZvciB0aGUgNCBzdWJmcmFtZXMgICovCi0gICAgV29yZDE2ICpBcSwgICAgICAgICAgICAgICAgLyogaSAgOiBBKHopICAgcXVhbnRpemVkIGZvciB0aGUgNCBzdWJmcmFtZXMgICovCi0gICAgV29yZDE2ICpzcGVlY2gsICAgICAgICAgICAgLyogaSAgOiBzcGVlY2ggc2VnbWVudCAgICAgICAgICAgICAgICAgICAgICAgICovCi0gICAgV29yZDE2ICptZW1fZXJyLCAgICAgICAgICAgLyogaSAgOiBwb2ludGVyIHRvIGVycm9yIHNpZ25hbCAgICAgICAgICAgICAgICovCi0gICAgV29yZDE2ICptZW1fdzAsICAgICAgICAgICAgLyogaSAgOiBtZW1vcnkgb2Ygd2VpZ2h0aW5nIGZpbHRlciAgICAgICAgICAgICovCi0gICAgV29yZDE2ICp6ZXJvLCAgICAgICAgICAgICAgLyogaSAgOiBwb2ludGVyIHRvIHplcm8gdmVjdG9yICAgICAgICAgICAgICAgICovCi0gICAgV29yZDE2IGFpX3plcm9bXSwgICAgICAgICAgLyogbyAgOiBoaXN0b3J5IG9mIHdlaWdodGVkIHN5bnRoLiBmaWx0ZXIgICAgICovCi0gICAgV29yZDE2IGV4Y1tdLCAgICAgICAgICAgICAgLyogbyAgOiBsb25nIHRlcm0gcHJlZGljdGlvbiByZXNpZHVhbCAgICAgICAgICovCi0gICAgV29yZDE2IGgxW10sICAgICAgICAgICAgICAgLyogbyAgOiBpbXB1bHNlIHJlc3BvbnNlICAgICAgICAgICAgICAgICAgICAgICovCi0gICAgV29yZDE2IHhuW10sICAgICAgICAgICAgICAgLyogbyAgOiB0YXJnZXQgdmVjdG9yIGZvciBwaXRjaCBzZWFyY2ggICAgICAgICovCi0gICAgV29yZDE2IHJlczJbXSwgICAgICAgICAgICAgLyogbyAgOiBsb25nIHRlcm0gcHJlZGljdGlvbiByZXNpZHVhbCAgICAgICAgICovCi0gICAgV29yZDE2IGVycm9yW10gICAgICAgICAgICAgLyogbyAgOiBlcnJvciBvZiBMUEMgc3ludGhlc2lzIGZpbHRlciAgICAgICAgICovCi0pCi17Ci0gICAgV29yZDE2IEFwMVtNUDFdOyAgICAgICAgICAgICAgLyogQSh6KSB3aXRoIHNwZWN0cmFsIGV4cGFuc2lvbiAgICAgICAgICovCi0gICAgV29yZDE2IEFwMltNUDFdOyAgICAgICAgICAgICAgLyogQSh6KSB3aXRoIHNwZWN0cmFsIGV4cGFuc2lvbiAgICAgICAgICovCi0gICAgY29uc3QgV29yZDE2ICpnMTsgICAgICAgICAgICAgLyogUG9pbnRlciB0byBj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gOiBzcGVjdHJhbCBleHAuIGZhY3RvciAxICAgICAgICAgICAgICAgICovCi0gICAgICAgIGNvbnN0IFdvcmQxNiBnYW1tYTFfMTJrMltdLC8qIGkgIDogc3BlY3RyYWwgZXhwLiBmYWN0b3IgMSBmb3IgRUZSICAgICAgICAqLwotICAgICAgICBjb25zdCBXb3JkMTYgZ2FtbWEyW10sICAgICAvKiBpICA6IHNwZWN0cmFsIGV4cC4gZmFjdG9yIDIgICAgICAgICAgICAgICAgKi8KLSAgICAgICAgV29yZDE2ICpBLCAgICAgICAgICAgICAgICAgLyogaSAgOiBBKHopIHVucXVhbnRpemVkIGZvciB0aGUgNCBzdWJmcmFtZXMgICovCi0gICAgICAgIFdvcmQxNiAqQXEsICAgICAgICAgICAgICAgIC8qIGkgIDogQSh6KSAgIHF1YW50aXplZCBmb3IgdGhlIDQgc3ViZnJhbWVzICAqLwotICAgICAgICBXb3JkMTYgKnNwZWVjaCwgICAgICAgICAgICAvKiBpICA6IHNwZWVjaCBzZWdtZW50ICAgICAgICAgICAgICAgICAgICAgICAgKi8KLSAgICAgICAgV29yZDE2ICptZW1fZXJyLCAgICAgICAgICAgLyogaSAgOiBwb2ludGVyIHRvIGVycm9yIHNpZ25hbCAgICAgICAgICAgICAgICovCi0gICAgICAgIFdvcmQxNiAqbWVtX3cwLCAgICAgICAgICAgIC8qIGkgIDogbWVtb3J5IG9mIHdlaWdodGluZyBmaWx0ZXIgICAgICAgICAgICAqLwotICAgICAgICBXb3JkMTYgKnplcm8sICAgICAgICAgICAgICAvKiBpICA6IHBvaW50ZXIgdG8gemVybyB2ZWN0b3IgICAgICAgICAgICAgICAgKi8KLSAgICAgICAgV29yZDE2IGFpX3plcm9bXSwgICAgICAgICAgLyogbyAgOiBoaXN0b3J5IG9mIHdlaWdodGVkIHN5bnRoLiBmaWx0ZXIgICAgICovCi0gICAgICAgIFdvcmQxNiBleGNbXSwgICAgICAgICAgICAgIC8qIG8gIDogbG9uZyB0ZXJtIHByZWRpY3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VBvc3RQcm9jKAotICAgIFdvcmQxNiAqc3BlZWNoLCAgIC8qIGkgICA6IHNwZWVjaCBzZWdtZW50ICAgICAgICAgICAgICAgICAgICAgICAgKi8KLSAgICBlbnVtIE1vZGUgbW9kZSwgICAvKiBpICAgOiBjb2RlciBtb2RlICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0gICAgV29yZDE2IGlfc3ViZnIsICAgLyogaSAgIDogU3ViZnJhbWUgbnIgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotICAgIFdvcmQxNiBnYWluX3BpdCwgIC8qIGkgICA6IFBpdGNoIGdhaW4gICAgICAgICAgICAgICAgICAgICAgIFExNCAgKi8KLSAgICBXb3JkMTYgZ2Fpbl9jb2RlLCAvKiBpICAgOiBEZWNvZGVkIGlubm92YXRpb24gZ2FpbiAgICAgICAgICAgICAgICovCi0gICAgV29yZDE2ICpBcSwgICAgICAgLyogaSAgIDogQSh6KSBxdWFudGl6ZWQgZm9yIHRoZSA0IHN1YmZyYW1lcyAgICAqLwotICAgIFdvcmQxNiBzeW50aFtdLCAgIC8qIGkgICA6IExvY2FsIHNudGhlc2lzICAgICAgICAgICAgICAgICAgICAgICAgKi8KLSAgICBXb3JkMTYgeG5bXSwgICAgICAvKiBpICAgOiBUYXJnZXQgdmVjdG9yIGZvciBwaXRjaCBzZWFyY2ggICAgICAgICovCi0gICAgV29yZDE2IGNvZGVbXSwgICAgLyogaSAgIDogRml4ZWQgY29kZWJvb2sgZXhpdGF0aW9uICAgICAgICAgICAgICAqLwotICAgIFdvcmQxNiB5MVtdLCAgICAgIC8qIGkgICA6IEZpbHRlcmVkIGFkYXB0aXZlIGV4aXRhdGlvbiAgICAgICAgICAgKi8KLSAgICBXb3JkMTYgeTJbXSwgICAgICAvKiBpICAgOiBGaWx0ZXJlZCBmaXhlZCBjb2RlYm9vayBleGNpdGF0aW9uICAgICovCi0gICAgV29yZDE2ICptZW1fc3luLCAgLyogaS9vIDogbWVtb3J5IG9mIHN5bnR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leGNbIGlfc3ViZnJdOwotICAgIHBfY29kZSA9ICZjb2RlWzBdOwotCi0gICAgZm9yIChpID0gTF9TVUJGUiA+PiAxOyBpICE9IDAgOyBpLS0pCi0gICAgewotICAgICAgICAvKiBleGNbaV0gPSBnYWluX3BpdCpleGNbaV0gKyBnYWluX2NvZGUqY29kZVtpXTsgKi8KLQotICAgICAgICAvKgotICAgICAgICAgKiAgICAgICAgICAgICAgICAgICAgICAxMmsyICBvdGhlcnMKLSAgICAgICAgICogLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tCi0gICAgICAgICAqIGV4YyAgICAgICAgICAgICAgICAgICBRMCAgICAgIFEwCi0gICAgICAgICAqIGdhaW5fcGl0ICAgICAgICAgICAgICBRMTQgICAgIFExNAotICAgICAgICAgKiBwaXRjaF9mYWMgICAgICAgICAgICAgUTEzICAgICBRMTQKLSAgICAgICAgICogICAgcHJvZHVjdDogICAgICAgICAgIFExNCAgICAgUTE1Ci0gICAgICAgICAqCi0gICAgICAgICAqIGNvZGUgICAgICAgICAgICAgICAgICBRMTIgICAgIFExMwotICAgICAgICAgKiBnYWluX2NvZGUgICAgICAgICAgICAgUTEgICAgICBRMQotICAgICAgICAgKiAgICBwcm9kdWN0ICAgICAgICAgICAgUTE0ICAgICBRMTUKLSAgICAgICAgICogICAgc3VtICAgICAgICAgICAgICAgIFExNCAgICAgUTE1Ci0gICAgICAgICAqCi0gICAgICAgICAqIHRlbXBTaGlmdCAgICAgICAgICAgICAyICAgICAgIDEKLSAgICAgICAgICogICAgc3VtPDx0ZW1wU2hpZnQgICAgIFExNiAgICAgUTE2Ci0gICAgICAgICAqIHJlc3VsdCAtPiBleGMgICAgICAgICBRMCAgICAgIFEwCi0gICAgICAgICAqLwotICAgICAgICBMX3RlbXAgICAgID0gKChXb3JkMzIpICogKHBfZXhjKyspICogcGl0Y2hfZmFjKSA8PCAxOwotICAgICAgICBMX3RlbXAyICAgID0gKChXb3JkMzIpICogKHBfZXhjLS0pICogcGl0Y2hfZmFjKSA8PCAxOwotICAgICAgICBMX3RlbXAgICAgKz0gKChXb3JkMzIpICogKHBfY29kZSsrKSAqIGdhaW5fY29kZSkgPDwgMTsKLSAgICAgICAgTF90ZW1wMiAgICs9ICgoV29yZDMyKSAqIChwX2NvZGUrKykgKiBnYWluX2NvZGUpIDw8IDE7Ci0gICAgICAgIExfdGVtcCAgIDw8PSAgdGVtcFNoaWZ0OwotICAgICAgICBMX3RlbXAyICA8PD0gIHRlbXBTaGlmdDsKLSAgICAgICAgKihwX2V4YysrKSA9IChXb3JkMTYpKChMX3RlbXAgICsgMHgwODAwMEwpID4+IDE2KTsKLSAgICAgICAgKihwX2V4YysrKSA9IChXb3JkMTYpKChMX3RlbXAyICsgMHgwODAwMEwpID4+IDE2KTsKLQotICAgIH0KLQotICAgIFN5bl9maWx0KAotICAgICAgICBBcSwKLSAgICAgICAgJmV4Y1tpX3N1YmZyXSwKLSAgICAgICAgJnN5bnRoW2lfc3ViZnJdLAotICAgICAgICBMX1NVQkZSLAotICAgICAgICBtZW1fc3luLAotICAgICAgICAxKTsKLQotICAgIGZvciAoaSA9IExfU1VCRlIgLSBNLCBqID0gMDsgaSA8IExfU1VCRlI7IGkrKywgaisrKQotICAgIHsKLSAgICAgICAgbWVtX2VycltqXSA9IHNwZWVjaFtpX3N1YmZyICsgaV0gLSBzeW50aFtpX3N1YmZyICsgaV07Ci0KLSAgICAgICAgLyoKLSAgICAgICAgICogICAgICAgICAgICAgICAgICAgICAgMTJrMiAgb3RoZXJzCi0gICAgICAgICAqIC0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLQotICAgICAgICAgKiB5MSAgICAgICAgICAgICAgICAgICAgUTAgICAgICBRMAotICAgICAgICAgKiBnYWluX3BpdCAgICAgICAgICAgICAgUTE0ICAgICBRMTQKLSAgICAgICAgICogICAgcHJvZHVjdCAgICAgICAgICAgIFExNSAgICAgUTE1Ci0gICAgICAgICAqICAgIHNoaWZ0ZWQgcHJvZC4gICAgICBRMTYgICAgIFExNgotICAgICAgICAgKiB0ZW1wICAgICAgICAgICAgICAgICAgUTAgICAgICBRMAotICAgICAgICAgKgotICAgICAgICAgKiB5MiAgICAgICAgICAgICAgICAgICAgUTEwICAgICBRMTIKLSAgICAgICAgICogZ2Fpbl9jb2RlICAgICAgICAgICAgIFExICAgICAgUTEKLSAgICAgICAgICogICAgcHJvZHVjdCAgICAgICAgICAgIFExMiAgICAgUTE0Ci0gICAgICAgICAqIGtzaGlmdCAgICAgICAgICAgICAgICAgNCAgICAgICAyCi0gICAgICAgICAqICAgIHNoaWZ0ZWQgcHJvZC4gICAgICBRMTYgICAgIFExNgotICAgICAgICAgKiBrICAgICAgICAgICAgICAgICAgICAgUTAgICAgICBRMAotICAgICAgICAgKiBtZW1fdzAseG4sc3VtICAgICAgICAgUTAgICAgICBRMAotICAgICAgICAgKi8KLQotICAgICAgICBMX3RlbXAgPSAoKFdvcmQzMil5MVtpXSAqIGdhaW5fcGl0KTsKLSAgICAgICAgdGVtcCAgPSAoV29yZDE2KShMX3RlbXAgPj4gMTQpOwotCi0gICAgICAgIExfdGVtcCA9ICgoV29yZDMyKXkyW2ldICogZ2Fpbl9jb2RlKTsKLSAgICAgICAgdGVtcCArPSAoV29yZDE2KShMX3RlbXAgPj4ga1NoaWZ0KTsKLQotICAgICAgICBtZW1fdzBbal0gPSB4bltpXSAtIHRlbXA7Ci0gICAgfQotCi0gICAgcmV0dXJuOwotfQpkaWZmIC0tZ2l0IGEvbWVkaWEvbGlic3RhZ2VmcmlnaHQvY29kZWNzL2Ftcm5iL2VuYy9zcmMvc3BzdHByb2MuaCBiL21lZGlhL2xpYnN0YWdlZnJpZ2h0L2NvZGVjcy9hbXJuYi9lbmMvc3JjL3Nwc3Rwcm9jLmgKZGVsZXRlZCBmaWxlIG1vZGUgMTAwNjQ0CmluZGV4IGVkYzQzZTQuLjAwMDAwMDAKLS0tIGEvbWVkaWEvbGlic3RhZ2VmcmlnaH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WluICAgICAgICAgICAgICAgKi8KLSAgICAgICAgV29yZDE2ICpBcSwgICAgICAgLyogaSAgIDogQSh6KSBxdWFudGl6ZWQgZm9yIHRoZSA0IHN1YmZyYW1lcyAgICAqLwotICAgICAgICBXb3JkMTYgc3ludGhbXSwgICAvKiBpICAgOiBMb2NhbCBzbnRoZXNpcyAgICAgICAgICAgICAgICAgICAgICAgICovCi0gICAgICAgIFdvcmQxNiB4bltdLCAgICAgIC8qIGkgICA6IFRhcmdldCB2ZWN0b3IgZm9yIHBpdGNoIHNlYXJjaCAgICAgICAgKi8KLSAgICAgICAgV29yZDE2IGNvZGVbXSwgICAgLyogaSAgIDogRml4ZWQgY29kZWJvb2sgZXhpdGF0aW9uICAgICAgICAgICAgICAqLwotICAgICAgICBXb3JkMTYgeTFbXSwgICAgICAvKiBpICAgOiBGaWx0ZXJlZCBhZGFwdGl2ZSBleGl0YXRpb24gICAgICAgICAgICovCi0gICAgICAgIFdvcmQxNiB5MltdLCAgICAgIC8qIGkgICA6IEZpbHRlcmVkIGZpeGVkIGNvZGVib29rIGV4Y2l0YXRpb24gICAgKi8KLSAgICAgICAgV29yZDE2ICptZW1fc3luLCAgLyogaS9vIDogbWVtb3J5IG9mIHN5bnRoZXNpcyBmaWx0ZXIgICAgICAgICAgICAqLwotICAgICAgICBXb3JkMTYgKm1lbV9lcnIsICAvKiBvICAgOiBwb2ludGVyIHRvIGVycm9yIHNpZ25hbCAgICAgICAgICAgICAgICovCi0gICAgICAgIFdvcmQxNiAqbWVtX3cwLCAgIC8qIG8gICA6IG1lbW9yeSBvZiB3ZWlnaHRpbmcgZmlsdGVyICAgICAgICAgICAgKi8KLSAgICAgICAgV29yZDE2ICpleGMsICAgICAgLyogbyAgIDogbG9uZyB0ZXJtIHByZWRpY3Rpb24gcmVzaWR1YWwgICAgICAgICAqLwotICAgICAgICBXb3JkMTYgKnNoYXJwLCAgICAvKiBvICAgOiBwaXRjaCBzaGFycGVuaW5nIHZhbHVlICAgICAgICAgIC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BXb3JkMTYgZGlzdF90aDsKLSAgICBXb3JkMTYgKnBfbHNwICAgPSAmbHNwWzNdOwotICAgIFdvcmQxNiAqcF9sc3BfMSA9ICZsc3BbNF07Ci0KLSAgICBPU0NMX1VOVVNFRF9BUkcocE92ZXJmbG93KTsKLSAgICAvKiBDaGVjayBmb3IgYSByZXNvbmFuY2U6ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotICAgIC8qIEZpbmQgbWluaW11bSBkaXN0YW5jZSBiZXR3ZWVuIGxzcFtpXSBhbmQgbHNwW2krMV0gICovCi0KLSAgICBkaXN0X21pbjEgPSBNQVhfMTY7Ci0gICAgZm9yIChpID0gMzsgaSA8IE0gLSAyOyBpKyspCi0gICAgewotICAgICAgICBkaXN0ID0gKihwX2xzcCsrKSAtICoocF9sc3BfMSsrKTsKLQotICAgICAgICBpZiAoZGlzdCA8IGRpc3RfbWluMSkKLSAgICAgICAgewotICAgICAgICAgICAgZGlzdF9taW4xID0gZGlzdDsKLSAgICAgICAgfQotICAgIH0KLQotICAgIGRpc3RfbWluMiA9IE1BWF8xNjsKLSAgICBwX2xzcCAgID0gJmxzcFsxXTsKLSAgICBwX2xzcF8xID0gJmxzcFsyXTsKLQotICAgIGZvciAoaSA9IDE7IGkgPCAzOyBpKyspCi0gICAgewotICAgICAgICBkaXN0ID0gKihwX2xzcCsrKSAtICoocF9sc3BfMSsrKTsKLQotICAgICAgICBpZiAoZGlzdCA8IGRpc3RfbWluMikKLSAgICAgICAgewotICAgICAgICAgICAgZGlzdF9taW4yID0gZGlzdDsKLSAgICAgICAgfQotICAgIH0KLQotICAgIGlmIChsc3BbMV0gPiAzMjAwMCkKLSAgICB7Ci0gICAgICAgIGRpc3RfdGggPSA2MDA7Ci0gICAgfQotICAgIGVsc2UgaWYgKGxzcFsxXSA+IDMwNTAwKQotICAgIHsKLSAgICAgICAgZGlzdF90aCA9IDgwMDsKLSAgICB9Ci0gICAgZWxzZQotICAgIHsKLSAgICAgICAgZGlzdF90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V0gPj4gMjsKLSAgICAgICAgcyA9IG1hY18xNmJ5MTZfdG9faW50MzIocywgdGVtcCwgdGVtcCk7Ci0gICAgfQotCi0KLSAgICBpZiAocyA9PSAwKQotICAgIHsKLSAgICAgICAgZzAgPSAwOwotICAgIH0KLSAgICBlbHNlCi0gICAgewotICAgICAgICBpID0gbm9ybWFsaXplX2Ftcl93YihzKTsKLSAgICAgICAgZ2Fpbl9pbiA9IGFtcl93Yl9yb3VuZChzIDw8IGkpOwotICAgICAgICBleHAgLT0gaTsKLQotICAgICAgICAvKgotICAgICAgICAgKiAgZzAgPSBzcXJ0KGdhaW5faW4vZ2Fpbl9vdXQpCi0gICAgICAgICAqLwotCi0gICAgICAgIHMgPSBkaXZfMTZieTE2KGdhaW5fb3V0LCBnYWluX2luKTsKLSAgICAgICAgcyA9IHNobF9pbnQzMihzLCA3KTsgICAgICAgICAgICAgICAgICAgLyogcyA9IGdhaW5fb3V0IC8gZ2Fpbl9pbiAqLwotICAgICAgICBzID0gc2hyX2ludDMyKHMsIGV4cCk7ICAgICAgICAgICAgICAgICAvKiBhZGQgZXhwb25lbnQgKi8KLQotICAgICAgICBzID0gb25lX292X3NxcnQocyk7Ci0gICAgICAgIGcwID0gYW1yX3diX3JvdW5kKHNobF9pbnQzMihzLCA5KSk7Ci0gICAgfQotICAgIC8qIHNpZ19vdXQobikgPSBnYWluKG4pIHNpZ19vdXQobikgKi8KLQotICAgIGZvciAoaSA9IDA7IGkgPCBsX3RybTsgaSsrKQotICAgIHsKLSAgICAgICAgc2lnX291dFtpXSA9IGV4dHJhY3RfaChzaGxfaW50MzIoZnhwX211bF8xNmJ5MTYoc2lnX291dFtpXSwgZzApLCAzKSk7Ci0KLSAgICB9Ci0KLSAgICByZXR1cm47Ci19Ci0KZGlmZiAtLWdpdCBhL21lZGlhL2xpYnN0YWdlZnJpZ2h0L2NvZGVjcy9hbXJ3Yi9zcmMvYmFuZF9wYXNzXzZrXzdrLmNwcCBiL21lZGlhL2xpYnN0Y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IC8qIGlucHV0OiAgc2lnbmFsICAgICAgICAgICAgICAgICAgKi8KLSAgICBpbnQxNiBsZywgICAgICAgICAgICAgICAgICAgICAgICAgICAgLyogaW5wdXQ6ICBsZW5ndGggb2YgaW5wdXQgICAgICAgICAqLwotICAgIGludDE2IG1lbVtdLCAgICAgICAgICAgICAgICAgICAgICAgICAvKiBpbi9vdXQ6IG1lbW9yeSAoc2l6ZT0zMCkgICAgICAgICovCi0gICAgaW50MTYgeFtdCi0pCi17Ci0gICAgaW50MTYgaSwgajsKLSAgICBpbnQzMiBMX3RtcDE7Ci0gICAgaW50MzIgTF90bXAyOwotICAgIGludDMyIExfdG1wMzsKLSAgICBpbnQzMiBMX3RtcDQ7Ci0KLSAgICBpbnQxNiAqcHRfc2lnbiA9IHNpZ25hbDsKLQotICAgIHB2X21lbWNweSgodm9pZCAqKXgsICh2b2lkICopbWVtLCBMX0ZJUipzaXplb2YoKngpKTsKLQotCi0gICAgZm9yIChpID0gMDsgaSA8IGxnID4+IDI7IGkrKykKLSAgICB7Ci0KLSAgICAgICAgeFsoaTw8MikgKyBMX0ZJUiAgICBdID0gKihwdF9zaWduKSA+PiAyOyAgICAgICAgLyogZ2FpbiBvZiBmaWx0ZXIgPSA0ICovCi0gICAgICAgIHhbKGk8PDIpICsgTF9GSVIgKyAxXSA9ICoocHRfc2lnbiArIDEpID4+IDI7ICAgIC8qIGdhaW4gb2YgZmlsdGVyID0gNCAqLwotICAgICAgICB4WyhpPDwyKSArIExfRklSICsgMl0gPSAqKHB0X3NpZ24gKyAyKSA+PiAyOyAgICAvKiBnYWluIG9mIGZpbHRlciA9IDQgKi8KLSAgICAgICAgeFsoaTw8MikgKyBMX0ZJUiArIDNdID0gKihwdF9zaWduICsgMykgPj4gMjsgICAgLyogZ2FpbiBvZiBmaWx0ZXIgPSA0ICovCi0KLSAgICAgICAgTF90bXAxID0gMHgwMDAwNDAwMDsKLSAgICAgICAgTF90bXAyID0gMHgwMDAwNDAwMDsKLSAgICAgICAgTF90bXAzID0gMHgwMDAwNDAwMDsKLSAgICAgICAgTF90bXA0ID0gMHgwMDAwNDAwMDsKLQotICAgICAgICBMX3RtcDEgLT0gKChpbnQzMil4WyhpPDwyKStMX0ZJUiAgXSA8PCA1KTsKLSAgICAgICAgTF90bXAyIC09ICgoaW50MzIpeFsoaTw8MikrTF9GSVIrMV0gPDwgNSk7Ci0gICAgICAgIExfdG1wMyAtPSAoKGludDMyKXhbKGk8PDIpK0xfRklSKzJdIDw8IDUpOwotICAgICAgICBMX3RtcDQgLT0gKChpbnQzMil4WyhpPDwyKStMX0ZJUiszXSA8PCA1KTsKLQotICAgICAgICBMX3RtcDEgLT0gKChpbnQzMil4WyhpPDwyKV0gPDwgNSk7Ci0gICAgICAgIExfdG1wMiAtPSAoKGludDMyKXhbKGk8PDIpKzFdIDw8IDUpOwotICAgICAgICBMX3RtcDMgLT0gKChpbnQzMil4WyhpPDwyKSsyXSA8PCA1KTsKLSAgICAgICAgTF90bXA0IC09ICgoaW50MzIpeFsoaTw8MikrM10gPDwgNSk7Ci0KLQotICAgICAgICBmb3IgKGogPSAxOyBqIDwgTF9GSVIgLSAxOyBqICs9IDQpCi0gICAgICAgIHsKLSAgICAgICAgICAgIGludDE2IHRtcDEgPSB4WyhpPDwyKStqICBdOwotICAgICAgICAgICAgaW50MTYgdG1wMiA9IHhbKGk8PDIpK2orMV07Ci0gICAgICAgICAgICBpbnQxNiB0bXAzID0geFsoaTw8MikraisyXTsKLQotICAgICAgICAgICAgTF90bXAxID0gZnhwX21hY18xNmJ5MTYodG1wMSwgZmlyXzZrXzdrW2ogIF0sIExfdG1wMSk7Ci0gICAgICAgICAgICBMX3RtcDIgPSBmeHBfbWFjXzE2YnkxNih0bXAyLCBmaXJfNmtfN2tbaiAgXSwgTF90bXAyKTsKLSAgICAgICAgICAgIExfdG1wMSA9IGZ4cF9tYWNfMTZieTE2KHRtcDIsIGZpcl82a183a1tqKzFdLCBMX3RtcDEpOwotICAgICAgICAgICAgTF90bXAyID0gZnhwX21hY18xNmJ5MTYodG1wMywgZmlyXzZrXzdrW2orMV0sIExfdG1wMik7Ci0gICAgICAgICAgICBMX3RtcDMgPSBmeHBfbWFjXzE2YnkxNih0bXAzLCBmaXJfNmtfN2tbaiAgXSwgTF90bXAzKTsKLSAgICAgICAgICAgIExfdG1wMSA9IGZ4cF9tYWNfMTZieTE2KHRtcDMsIGZpcl82a183a1tqKzJdLCBMX3RtcDEpOwotCi0gICAgICAgICAgICB0bXAxID0geFsoaTw8MikraiszXTsKLSAgICAgICAgICAgIHRtcDIgPSB4WyhpPDwyKStqKzRdOwotCi0gICAgICAgICAgICBMX3RtcDIgPSBmeHBfbWFjXzE2YnkxNih0bXAxLCBmaXJfNmtfN2tbaisyXSwgTF90bXAyKTsKLSAgICAgICAgICAgIExfdG1wNCA9IGZ4cF9tYWNfMTZieTE2KHRtcDEsIGZpcl82a183a1tqICBdLCBMX3RtcDQpOwotICAgICAgICAgICAgTF90bXAzID0gZnhwX21hY18xNmJ5MTYodG1wMSwgZmlyXzZrXzdrW2orMV0sIExfdG1wMyk7Ci0gICAgICAgICAgICBMX3RtcDEgPSBmeHBfbWFjXzE2YnkxNih0bXAxLCBmaXJfNmtfN2tbaiszXSwgTF90bXAxKTsKLSAgICAgICAgICAgIExfdG1wMiA9IGZ4cF9tYWNfMTZieTE2KHRtcDIsIGZpcl82a183a1tqKzNdLCBMX3RtcDIpOwotICAgICAgICAgICAgTF90bXA0ID0gZnhwX21hY18xNmJ5MTYodG1wMiwgZmlyXzZrXzdrW2orMV0sIExfdG1wNCk7Ci0gICAgICAgICAgICBMX3RtcDMgPSBmeHBfbWFjXzE2YnkxNih0bXAyLCBmaXJfNmtfN2tbaisyXSwgTF90bXAzKTsKLQotICAgICAgICAgICAgdG1wMSA9IHhbKGk8PDIpK2orNV07Ci0gICAgICAgICAgICB0bXAyID0geFsoaTw8Mikrais2XTsKLQotICAgICAgICAgICAgTF90bXA0ID0gZnhwX21hY18xNmJ5MTYodG1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ovCi0gICAgLyogKGkpIDogaW5kZXggKDUyKTogMTMrMTMrMTMrMTMgPSA1MiBiaXRzLiAgICAgICAgICAgICAqLwotICAgIC8qIChpKSA6IGluZGV4ICg2NCk6IDIrMisyKzIrMTQrMTQrMTQrMTQgPSA2NCBiaXRzLiAgICAgKi8KLSAgICAvKiAoaSkgOiBpbmRleCAoNzIpOiAxMCsyKzEwKzIrMTArMTQrMTArMTQgPSA3MiBiaXRzLiAgICovCi0gICAgLyogKGkpIDogaW5kZXggKDg4KTogMTErMTErMTErMTErMTErMTErMTErMTEgPSA4OCBiaXRzLiAqLwotICAgIGludDE2IG5iYml0cywgICAvKiAoaSkgOiAyMCwgMzYsIDQ0LCA1MiwgNjQsIDcyIG9yIDg4IGJpdHMgICAgICAgICAgICAgICovCi0gICAgaW50MTYgY29kZVtdICAgIC8qIChvKSBROTogYWxnZWJyYWljIChmaXhlZCkgY29kZWJvb2sgZXhjaXRhdGlvbiAgICAgICAgKi8KLSkKLXsKLSAgICBpbnQxNiBrLCBwb3NbNl07Ci0gICAgaW50MzIgTF9pbmRleDsKLSAgICBwdl9tZW1zZXQoY29kZSwgMCwgTF9DT0RFKnNpemVvZigqY29kZSkpOwotCi0gICAgLyogZGVjb2RlIHRoZSBwb3NpdGlvbnMgYW5kIHNpZ25zIG9mIHB1bHNlcyBhbmQgYnVpbGQgdGhlIGNvZGV3b3JkICovCi0KLQotICAgIHN3aXRjaCAobmJiaXRzKQotICAgIHsKLSAgICAgICAgY2FzZSAyMDoKLSAgICAgICAgICAgIGZvciAoayA9IDA7IGsgPCBOQl9UUkFDSzsgaysrKQotICAgICAgICAgICAgewotICAgICAgICAgICAgICAgIExfaW5kZXggPSBpbmRleFtrXTsKLSAgICAgICAgICAgICAgICBkZWNfMXBfTjEoTF9pbmRleCwgNCwgMCwgcG9zKTsKLSAgICAgICAgICAgICAgICBhZGRfcHVsc2VzKHBvcywgMSwgaywgY29kZSk7Ci0gICAgICAgICAgICB9Ci0gICAgICAgICAgICBicmVhazsKLQotICAgICAgICBjYXNlICAzNjoKLSAgICAgICAgICAgIGZvciAoayA9IDA7IGsgPCBOQl9UUkFDSzsgaysrKQotICAgICAgICAgICAgewotICAgICAgICAgICAgICAgIExfaW5kZXggPSBpbmRleFtrXTsKLSAgICAgICAgICAgICAgICBkZWNfMnBfMk4xKExfaW5kZXgsIDQsIDAsIHBvcyk7Ci0gICAgICAgICAgICAgICAgYWRkX3B1bHNlcyhwb3MsIDIsIGssIGNvZGUpOwotICAgICAgICAgICAgfQotICAgICAgICAgICAgYnJlYWs7Ci0gICAgICAgIGNhc2UgNDQ6Ci0gICAgICAgICAgICBmb3IgKGsgPSAwOyBrIDwgTkJfVFJBQ0sgLSAyOyBrKyspCi0gICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgTF9pbmRleCA9IGluZGV4W2tdOwotICAgICAgICAgICAgICAgIGRlY18zcF8zTjEoTF9pbmRleCwgNCwgMCwgcG9zKTsKLSAgICAgICAgICAgICAgICBhZGRfcHVsc2VzKHBvcywgMywgaywgY29kZSk7Ci0gICAgICAgICAgICB9Ci0gICAgICAgICAgICBmb3IgKGsgPSAyOyBrIDwgTkJfVFJBQ0s7IGsrKykKLSAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICBMX2luZGV4ID0gaW5kZXhba107Ci0gICAgICAgICAgICAgICAgZGVjXzJwXzJOMShMX2luZGV4LCA0LCAwLCBwb3MpOwotICAgICAgICAgICAgICAgIGFkZF9wdWxzZXMocG9zLCAyLCBrLCBjb2RlKTsKLSAgICAgICAgICAgIH0KLSAgICAgICAgICAgIGJyZWFrOwotICAgICAgICBjYXNlIDUyOgotICAgICAgICAgICAgZm9yIChrID0gMDsgayA8IE5CX1RSQUNLOyBrKyspCi0gICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgTF9pbmRleCA9IGluZGV4W2tdOwotICAgICAgICAgICAgICAgIGRlY18zcF8zTjEoTF9pbmRleCwgNCwgMCwgcG9zKTsKLSAgICAgICAgICAgICAgICBhZGRfcHVsc2VzKHBvcywgMywgaywgY29kZSk7Ci0gICAgICAgICAgICB9Ci0gICAgICAgICAgICBicmVhazsKLSAgICAgICAgY2FzZSA2NDoKLSAgICAgICAgICAgIGZvciAoayA9IDA7IGsgPCBOQl9UUkFDSzsgaysrKQotICAgICAgICAgICAgewotICAgICAgICAgICAgICAgIExfaW5kZXggPSAoKGludDMyKWluZGV4W2tdIDw8IDE0KSArIGluZGV4W2sgKyBOQl9UUkFDS107Ci0gICAgICAgICAgICAgICAgZGVjXzRwXzROKExfaW5kZXgsIDQsIDAsIHBvcyk7Ci0gICAgICAgICAgICAgICAgYWRkX3B1bHNlcyhwb3MsIDQsIGssIGNvZGUpOwotICAgICAgICAgICAgfQotICAgICAgICAgICAgYnJlYWs7Ci0gICAgICAgIGNhc2UgNzI6Ci0gICAgICAgICAgICBmb3IgKGsgPSAwOyBrIDwgTkJfVFJBQ0sgLSAyOyBrKyspCi0gICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgTF9pbmRleCA9ICgoaW50MzIpaW5kZXhba10gPDwgMTApICsgaW5kZXhbayArIE5CX1RSQUNLXTsKLSAgICAgICAgICAgICAgICBkZWNfNXBfNU4oTF9pbmRleCwgNCwgMCwgcG9zKTsKLSAgICAgICAgICAgICAgICBhZGRfcHVsc2VzKHBvcywgNSwgaywgY29kZSk7Ci0gICAgICAgICAgICB9Ci0gICAgICAgICAgICBmb3IgKGsgPSAyOyBrIDwgTkJfVFJBQ0s7IGsrKykKLSAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICBMX2luZGV4ID0gKChpbnQzMilpbmRleFtrXSA8PCAxNCkgKyBpbmRleFtrICsgTkJfVFJBQ0tdOwotICAgICAgICAgICAgICAgIGRlY180cF80TihMX2luZGV4LCA0LCAwLCBwb3MpOwotICAgICAgICAgICAgICAgIGFkZF9wdWxzZXMocG9zLCA0LCBrLCBjb2RlKTsKLSAgICAgICAgICAgIH0KLSAgICAgICAgICAgIGJyZWFrOwotICAgICAgICBjYXNlIDg4OgotICAgICAgICAgICAgZm9yIChrID0gMDsgayA8IE5CX1RSQUNLOyBrKyspCi0gICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgTF9pbmRleCA9ICgoaW50MzIpaW5kZXhba10gPDwgMTEpICsgaW5kZXhbayArIE5CX1RSQUNLXTsKLSAgICAgICAgICAgICAgICBkZWNfNnBfNk5fMihMX2luZGV4LCA0LCAwLCBwb3MpOwotICAgICAgICAgICAgICAgIGFkZF9wdWxzZXMocG9zLCA2LCBrLCBjb2RlKTsKLSAgICAgICAgICAgIH0KLSAgICAgICAgZGVmYXVsdDoKLSAgICAgICAgICAgIGJyZWFrOwotICAgIH0KLQotCi19Ci0KLQotCi12b2lkIGFkZF9wdWxzZXMoaW50MTYgcG9zW10sIGludDE2IG5iX3B1bHNlLCBpbnQxNiB0cmFjaywgaW50MTYgY29kZVtdKQotewotICAgIGludDE2IGksIGs7Ci0KLSAgICBmb3IgKGsgPSAwOyBrIDwgbmJfcHVsc2U7IGsrKykKLSAgICB7Ci0gICAgICAgIC8qIGkgPSAoKHBvc1trXSAmIChOQl9QT1MtMSkpKk5CX1RSQUNLKSArIHRyYWNrOyAqLwotICAgICAgICBpID0gKChwb3Nba10gJiAoTkJfUE9TIC0gMSkpIDw8IDIpICsgdHJhY2s7Ci0KLSAgICAgICAgaWYgKChwb3Nba10gJiBOQl9QT1MpID09IDApCi0gICAgICAgIHsKLSAgICAgICAgICAgIGNvZGVbaV0gKz0gIDUxMjsKLSAgICAgICAgfQotICAgICAgICBlbHNlCi0gICAgICAgIHsKLSAgICAgICAgICAgIGNvZGVbaV0gLT0gIDUxMjsKLSAgICAgICAgfQotICAgIH0KLQotfQpkaWZmIC0tZ2l0IGEvbWVkaWEvbGlic3RhZ2VmcmlnaHQvY29kZWNzL2FtcndiL3NyYy9kZWNfYWxnX2NvZGVib29rLmNwcCBiL21lZGlhL2xpYnN0YWdlZnJpZ2h0L2NvZGVjcy9hbXJ3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Ci0gICAgbWFzayA9IChpbnQzMikoc3ViX2ludDE2KHNobF9pbnQxNigxLCBOKSwgMSkpOyAvKiBtYXNrID0gKCgxPDxOKS0xKTsgKi8KLSAgICAvKi0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0qCi0gICAgICogRGVjb2RlIDIgcHVsc2VzIHdpdGggMipOKzEgYml0czogICAgICAgICAgICAgICAgICAgICAgKgotICAgICAqLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSovCi0gICAgLyogcG9zMSA9ICgoKGluZGV4ID4+IE4pICYgbWFzaykgKyBvZmZzZXQpOyAqLwotICAgIHBvczEgPSAoaW50MTYpKGFkZF9pbnQzMigoc2hyX2ludDMyKGluZGV4LCBOKSAmIG1hc2spLCAoaW50MzIpKG9mZnNldCkpKTsKLSAgICB0bXAgPSBzaGxfaW50MTYoTiwgMSk7Ci0gICAgaSA9IChpbmRleCA+PiB0bXApICYgMUw7ICAgICAgICAgLyogaSA9IChpbmRleCA+PiAoMipOKSkgJiAxOyAqLwotICAgIHBvczIgPSBhZGRfaW50MTYoKGludDE2KShpbmRleCAmIG1hc2spLCBvZmZzZXQpOyAvKiBwb3MyID0gKChpbmRleCAmIG1hc2spICsgb2Zmc2V0KTsgKi8KLQotICAgIGlmIChwb3MyIDwgcG9zMSkgICAgICAgICAgICAgIC8qICgocG9zMiAtIHBvczEpIDwgMCkgKi8KLSAgICB7Ci0gICAgICAgIGlmIChpID09IDEpCi0gICAgICAgIHsgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLyogKGkgPT0gMSkgKi8KLSAgICAgICAgICAgIHBvczEgKz0gTkJfUE9TOyAgICAgIC8qIHBvczEgKz0gTkJfUE9TOyAqLwotICAgICAgICB9Ci0gICAgICAgIGVsc2UKLSAgICAgICAgewotICAgICAgICAgICAgcG9zMiArP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DMpICovCi0gICAgICAgIGNhc2UgMDoKLSAgICAgICAgICAgIHRtcCA9IChuXzEgPDwgMikgKyAxOwotCi0gICAgICAgICAgICBpZiAoKGluZGV4ID4+IHRtcCkgJiAxKQotICAgICAgICAgICAgeyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvKiAoKChpbmRleCA+PiAoKDQqbl8xKSsxKSkgJiAxKSA9PSAwKSAqLwotICAgICAgICAgICAgICAgIGRlY180cF80TjEoaW5kZXgsIG5fMSwgaiwgcG9zKTsKLSAgICAgICAgICAgIH0KLSAgICAgICAgICAgIGVsc2UKLSAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICBkZWNfNHBfNE4xKGluZGV4LCBuXzEsIG9mZnNldCwgcG9zKTsKLSAgICAgICAgICAgIH0KLSAgICAgICAgICAgIGJyZWFrOwotICAgICAgICBjYXNlIDE6Ci0gICAgICAgICAgICB0bXAgPSAoMyAqIG5fMSkgKyAxOyAvKiBkZWNfMXBfTjEoKGluZGV4Pj4oKDMqbl8xKSsxKSksIG5fMSwgb2Zmc2V0LCBwb3MpICovCi0gICAgICAgICAgICBkZWNfMXBfTjEoaW5kZXggPj4gdG1wLCBuXzEsIG9mZnNldCwgcG9zKTsKLSAgICAgICAgICAgIGRlY18zcF8zTjEoaW5kZXgsIG5fMSwgaiwgcG9zICsgMSk7Ci0gICAgICAgICAgICBicmVhazsKLSAgICAgICAgY2FzZSAyOgotICAgICAgICAgICAgdG1wID0gKG5fMSA8PCAxKSArIDE7ICAgICAgIC8qIGRlY18ycF8yTjEoKGluZGV4Pj4oKDIqbl8xKSsxKSksIG5fMSwgb2Zmc2V0LCBwb3MpOyAqLwotICAgICAgICAgICAgZGVjXzJwXzJOMShpbmRleCA+PiB0bXAsIG5fMSwgb2Zmc2V0LCBwb3MpOwotICAgICAgICAgICAgZGVjXzJwXzJOMShpbmRleCwgbl8xLCBqLCBwb3MgKyAyKTsKLSAgICAgICAgICAgIGJyZWFrOwotICAgICAgICBjY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KDEgPDwgbl8xKTsgICAgICAgLyogaiA9IG9mZnNldCArICgxIDw8IG5fMSk7ICovCi0KLQotICAgIC8qICEhICBOIGFuZCBuXzEgYXJlIGNvbnN0YW50cyAtPiBpdCBkb2Vzbid0IG5lZWQgdG8gYmUgb3BlcmF0ZWQgYnkgQmFzaWMgT3BlcmF0b3JzICovCi0KLSAgICBvZmZzZXRBID0gb2Zmc2V0QiA9IGo7Ci0KLSAgICBpZiAoKChpbmRleCA+PiAoNipOIC0gNSkpICYgMUwpID09IDApCi0gICAgeyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLyogaWYgKCgoaW5kZXggPj4gKCg2Kk4pLTUpKSAmIDEpID09IDApICovCi0gICAgICAgIG9mZnNldEEgPSBvZmZzZXQ7Ci0gICAgfQotICAgIGVsc2UKLSAgICB7Ci0gICAgICAgIG9mZnNldEIgPSBvZmZzZXQ7Ci0gICAgfQotCi0KLSAgICBzd2l0Y2ggKChpbmRleCA+PiAoNipOIC0gNCkpICYgMykKLSAgICB7ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvKiAoaW5kZXggPj4gKCg2Kk4pLTQpKSAmIDMgKi8KLSAgICAgICAgY2FzZSAwOgotICAgICAgICAgICAgZGVjXzVwXzVOKGluZGV4ID4+IE4sIG5fMSwgb2Zmc2V0QSwgcG9zKTsgIC8qIGRlY181cF81TihpbmRleD4+Tiwgbl8xLCBvZmZzZXRBLCBwb3MpOyAqLwotICAgICAgICAgICAgZGVjXzFwX04xKGluZGV4LCBuXzEsIG9mZnNldEEsIHBvcyArIDUpOwotICAgICAgICAgICAgYnJlYWs7Ci0gICAgICAgIGNhc2UgMToKLSAgICAgICAgICAgIGRlY181cF81TihpbmRleCA+PiBOLCBuXzEsIG9mZnNldEEsIHBvcyk7ICAvKiBkZWNfNXBfNU4oaW5kZXg+Pk4sIG5fMSwgb2Zmc2V0QSwgcG9zKTsgKi8KLSAgICAgICAgICAgIGRlY18xcF9OMShp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LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLQotIElOUFVUIEFORCBPVVRQVVQgREVGSU5JVElPTlMKLQotICAgICBpbnQxNiBpbmRleCwgICAgICAgICAgICAgICAgIChpKSAgICAgOiBpbmRleCBvZiBxdWFudGl6YXRpb24uCi0gICAgIGludDE2IG5iaXRzLCAgICAgICAgICAgICAgICAgKGkpICAgICA6IG51bWJlciBvZiBiaXRzICg2IG9yIDcpCi0gICAgIGludDE2IGNvZGVbXSwgICAgICAgICAgICAgICAgKGkpIFE5ICA6IElubm92YXRpdmUgdmVjdG9yLgotICAgICBpbnQxNiBMX3N1YmZyLCAgICAgICAgICAgICAgIChpKSAgICAgOiBTdWJmcmFtZSBsZW5naHQuCi0gICAgIGludDE2ICogZ2Fpbl9waXQsICAgICAgICAgICAgKG8pIFExNCA6IFBpdGNoIGdhaW4uCi0gICAgIGludDMyICogZ2Fpbl9jb2QsICAgICAgICAgICAgKG8pIFExNiA6IENvZGUgZ2Fpbi4KLSAgICAgaW50MTYgYmZpLCAgICAgICAgICAgICAgICAgICAoaSkgICAgIDogYmFkIGZyYW1lIGluZGljYXRvcgotICAgICBpbnQxNiBwcmV2X2JmaSwgICAgICAgICAgICAgIChpKSAgICAgOiBQcmV2aW91cyBCRiBpbmRpY2F0b3IKLSAgICAgaW50MTYgc3RhdGUsICAgICAgICAgICAgICAgICAoaSkgICAgIDogU3RhdGUgb2YgQkZICi0gICAgIGludDE2IHVudXNhYmxlX2ZyYW1lLCAgICAgICAgKGkpICAgICA6IFVGIGluZGljYXRvcgotICAgICBpbnQxNiB2YWRfaGlzdCwgICAgICAgICAgICAgIChpKSAgICAgOiBudW1iZXIgb2Ygbm9uLXNwZWVjaCBmcmFtZXMKLSAgICAgaW50MTYgKiBtZW0gICAgICAgICAgICAgICAgICAoaS9vKSAgIDogc3RhdGljIG1lbW9yeSAoNCB3b3JkcykKLQotLS0tLS0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aW5kZXgsICAgICAgICAgICAgICAgLyogKGkpICAgICA6IGluZGV4IG9mIHF1YW50aXphdGlvbi4gICAgICAqLwotICAgIGludDE2IG5iaXRzLCAgICAgICAgICAgICAgIC8qIChpKSAgICAgOiBudW1iZXIgb2YgYml0cyAoNiBvciA3KSAgICAgKi8KLSAgICBpbnQxNiBjb2RlW10sICAgICAgICAgICAgICAvKiAoaSkgUTkgIDogSW5ub3ZhdGl2ZSB2ZWN0b3IuICAgICAgICAgICovCi0gICAgaW50MTYgTF9zdWJmciwgICAgICAgICAgICAgLyogKGkpICAgICA6IFN1YmZyYW1lIGxlbmdodC4gICAgICAgICAgICAqLwotICAgIGludDE2ICogZ2Fpbl9waXQsICAgICAgICAgIC8qIChvKSBRMTQgOiBQaXRjaCBnYWluLiAgICAgICAgICAgICAgICAgKi8KLSAgICBpbnQzMiAqIGdhaW5fY29kLCAgICAgICAgICAvKiAobykgUTE2IDogQ29kZSBnYWluLiAgICAgICAgICAgICAgICAgICovCi0gICAgaW50MTYgYmZpLCAgICAgICAgICAgICAgICAgLyogKGkpICAgICA6IGJhZCBmcmFtZSBpbmRpY2F0b3IgICAgICAgICAqLwotICAgIGludDE2IHByZXZfYmZpLCAgICAgICAgICAgIC8qIChpKSAgICAgOiBQcmV2aW91cyBCRiBpbmRpY2F0b3IgICAgICAgKi8KLSAgICBpbnQxNiBzdGF0ZSwgICAgICAgICAgICAgICAvKiAoaSkgICAgIDogU3RhdGUgb2YgQkZIICAgICAgICAgICAgICAgICovCi0gICAgaW50MTYgdW51c2FibGVfZnJhbWUsICAgICAgLyogKGkpICAgICA6IFVGIGluZGljYXRvciAgICAgICAgICAgICAgICAqLwotICAgIGludDE2IHZhZF9oaXN0LCAgICAgICAgICAgIC8qIChpKSAgICAgOiBudW1iZXIgb2Ygbm9uLXNwZWVjaCBmcmFtZXMgKi8KLSAgICBpbnQxNiAqIG1lbSAgICAgICAgICAgICAgICAvKiAoaS9vKSAgIDogc3RhdGljIG1lbW9yeSAo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pbiBRMTIgKi8KLQotICAgIC8qCi0gICAgICogQ2FzZSBvZiBlcmFzdXJlLgotICAgICAqLwotCi0gICAgaWYgKGJmaSAhPSAwKQotICAgIHsKLSAgICAgICAgdG1wID0gbWVkaWFuNSgmcGJ1ZlsyXSk7Ci0gICAgICAgICpwYXN0X2dhaW5fcGl0ID0gdG1wOwotCi0gICAgICAgIGlmICgqcGFzdF9nYWluX3BpdCA+IDE1NTY1KQotICAgICAgICB7Ci0gICAgICAgICAgICAqcGFzdF9nYWluX3BpdCA9IDE1NTY1OyAgICAgICAgLyogMC45NSBpbiBRMTQgKi8KLQotICAgICAgICB9Ci0KLSAgICAgICAgaWYgKHVudXNhYmxlX2ZyYW1lICE9IDApCi0gICAgICAgIHsKLSAgICAgICAgICAgICpnYWluX3BpdCA9IG11bHRfaW50MTYocGRvd25fdW51c2FibGVbc3RhdGVdLCAqcGFzdF9nYWluX3BpdCk7Ci0gICAgICAgIH0KLSAgICAgICAgZWxzZQotICAgICAgICB7Ci0gICAgICAgICAgICAqZ2Fpbl9waXQgPSBtdWx0X2ludDE2KHBkb3duX3VzYWJsZVtzdGF0ZV0sICpwYXN0X2dhaW5fcGl0KTsKLSAgICAgICAgfQotICAgICAgICB0bXAgPSBtZWRpYW41KCZnYnVmWzJdKTsKLQotICAgICAgICBpZiAodmFkX2hpc3QgPiAyKQotICAgICAgICB7Ci0gICAgICAgICAgICAqcGFzdF9nYWluX2NvZGUgPSB0bXA7Ci0gICAgICAgIH0KLSAgICAgICAgZWxzZQotICAgICAgICB7Ci0KLSAgICAgICAgICAgIGlmICh1bnVzYWJsZV9mcmFtZSAhPSAwKQotICAgICAgICAgICAgewotICAgICAgICAgICAgICAgICpwYXN0X2dhaW5fY29kZSA9IG11bHRfaW50MTYoY2Rvd25fdW51c2FibGVbc3RhdGVdLCB0bXApOwotICAgICAgICAgICAgfQotICAgICAgICAgICAgZWxzZQotICAgICAgICAgICAgewotICAgICAgICAgICAgICAgICpwYXN0X2dhaW5fY29kZSA9IG11bHRfaW50MTYoY2Rvd25fdXNhYmxlW3N0YXRlXSwgdG1wKTsKLSAgICAgICAgICAgIH0KLSAgICAgICAgfQotCi0gICAgICAgIC8qIHVwZGF0ZSB0YWJsZSBvZiBwYXN0IHF1YW50aXplZCBlbmVyZ2llcyAqLwotCi0gICAgICAgIHRtcCAgPSBwYXN0X3F1YV9lblszXTsKLSAgICAgICAgdG1wMSA9IHBhc3RfcXVhX2VuWzJdOwotICAgICAgICBMX3RtcCAgPSB0bXA7Ci0gICAgICAgIExfdG1wICs9IHRtcDE7Ci0gICAgICAgIHBhc3RfcXVhX2VuWzNdID0gdG1wOwotICAgICAgICB0bXAgID0gcGFzdF9xdWFfZW5bMV07Ci0gICAgICAgIHRtcDEgPSBwYXN0X3F1YV9lblswXTsKLSAgICAgICAgTF90bXAgKz0gdG1wOwotICAgICAgICBMX3RtcCArPSB0bXAxOwotICAgICAgICBwYXN0X3F1YV9lblsyXSA9IHRtcDsKLSAgICAgICAgcXVhX2VuZXIgPSAoaW50MTYpKExfdG1wID4+IDMpOwotICAgICAgICBwYXN0X3F1YV9lblsxXSA9IHRtcDE7Ci0KLQotICAgICAgICBxdWFfZW5lciAtPSAzMDcyOyAgICAvKiAtMyBpbiBRMTAgKi8KLQotICAgICAgICBpZiAocXVhX2VuZXIgPCAtMTQzMzYpCi0gICAgICAgIHsKLSAgICAgICAgICAgIHF1YV9lbmVyID0gLTE0MzM2OyAgICAgICAgICAgICAgICAvKiAtMTQgaW4gUTEwICovCi0gICAgICAgIH0KLQotICAgICAgICBwYXN0X3F1YV9lblswXSA9IHF1YV9lbmVyOwotCi0KLSAgICAgICAgZm9yIChpID0gMTsgaSA8IDU7IGkrKykKLSAgICAgICAgewotICAgICAgICAgICAgZ2J1ZltpIC0gMV0gPSBnYnVmW2ldOwotICAgICAgICAgICAgcGJ1ZltpIC0gMV0gPSBwYnVmW2ldOwotICAgICAgICB9Ci0gICAgICAgIGdidWZbNF0gPSAqcGFzdF9nYWluX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9lblszXSk7ICAgICAgLyogUTEzKlExMCAtPiBRMjQgKi8KLQotICAgIGdjb2RlMCA9IGV4dHJhY3RfaChMX3RtcCk7ICAgICAgICAgICAgIC8qIEZyb20gUTI0IHRvIFE4ICAqLwotCi0gICAgLyoKLSAgICAgKiBnY29kZTAgPSBwb3coMTAuMCwgZ2NvZGUwLzIwKQotICAgICAqICAgICAgICA9IHBvdygyLCAzLjMyMTkyOCpnY29kZTAvMjApCi0gICAgICogICAgICAgID0gcG93KDIsIDAuMTY2MDk2Kmdjb2RlMCkKLSAgICAgKi8KLQotICAgIExfdG1wID0gKChpbnQzMilnY29kZTAgKiA1NDQzKSA+PiA3OyAgICAgIC8qICowLjE2NjA5NiBpbiBRMTUgLT4gUTI0ICAgICAqLwotCi0gICAgaW50MzJfdG9fZHBmKExfdG1wLCAmZXhwX2djb2RlMCwgJmZyYWMpOyAgLyogRXh0cmFjdCBleHBvbmFudCBvZiBnY29kZTAgICovCi0KLSAgICBnY29kZTAgPSAoaW50MTYpKHBvd2VyX29mXzIoMTQsIGZyYWMpKTsgICAgLyogUHV0IDE0IGFzIGV4cG9uYW50IHNvIHRoYXQgICovCi0gICAgLyogb3V0cHV0IG9mIFBvdzIoKSB3aWxsIGJlOiAgICovCi0gICAgLyogMTYzODQgPCBQb3cyKCkgPD0gMzI3NjcgICAgICovCi0gICAgZXhwX2djb2RlMCAtPSAxNDsKLQotICAgIC8qIFJlYWQgdGhlIHF1YW50aXplZCBnYWlucyAqLwotCi0gICAgaWYgKG5iaXRzID09IDYpCi0gICAgewotICAgICAgICBwID0gJnRfcXVhX2dhaW42YltpbmRleDw8MV07Ci0gICAgfQotICAgIGVsc2UKLSAgICB7Ci0gICAgICAgIHAgPSAmdF9xdWFfZ2FpbjdiW2luZGV4PDwxXTsKLSAgICB9Ci0gICAgKmdhaW5fcGl0ID0gKnArKzsgICAgICAgICAgICAgICAgICAgICAgICAgLyogc2VsZWN0ZWQgcGl0Y2ggZ2FpbiBpbiBRMTQgK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Y3RvciAgICAgICAgKi8KLSAgICBpbnQxNiBMLCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLyogKGkpICAgICA6IHZlY3RvciBzaXplICAgICAgICAgICAgICAqLwotICAgIGludDE2ICogbWVtICAgICAgICAgICAgICAgICAgICAgICAgICAvKiAoaS9vKSAgIDogbWVtb3J5ICh5Wy0xXSkgICAgICAgICAgICovCi0pCi17Ci0gICAgaW50MTYgaTsKLSAgICBpbnQzMiBMX3RtcDsKLSAgICBpbnQxNiBsbywgaGk7Ci0KLSAgICBMX3RtcCAgPSAoKGludDMyKXhfaGlbMF0pIDw8IDE2OwotICAgIExfdG1wICs9ICgoaW50MzIpeF9sb1swXSkgPDwgNDsKLSAgICBMX3RtcCAgPSBzaGxfaW50MzIoTF90bXAsIDMpOwotCi0gICAgTF90bXAgPSBmeHBfbWFjXzE2YnkxNigqbWVtLCBtdSwgTF90bXApLAotCi0gICAgICAgICAgICBMX3RtcCA9IHNobF9pbnQzMihMX3RtcCwgMSk7ICAgICAgICAgICAgICAgLyogc2F0dXJhdGlvbiBjYW4gb2NjdXIgaGVyZSAqLwotICAgIHlbMF0gPSBhbXJfd2Jfcm91bmQoTF90bXApOwotCi0gICAgbG8gPSB4X2xvWzFdOwotICAgIGhpID0geF9oaVsxXTsKLSAgICBmb3IgKGkgPSAxOyBpIDwgTCAtIDE7IGkrKykKLSAgICB7Ci0gICAgICAgIExfdG1wICA9ICgoaW50MzIpaGkpIDw8IDE2OwotICAgICAgICBMX3RtcCArPSAoKGludDMyKWxvKSA8PCA0OwotICAgICAgICBMX3RtcCAgPSBzaGxfaW50MzIoTF90bXAsIDMpOwotICAgICAgICBMX3RtcCAgPSBmeHBfbWFjXzE2YnkxNih5W2kgLSAxXSwgbXUsIExfdG1wKSwKLSAgICAgICAgICAgICAgICAgTF90bXAgID0gc2hsX2ludDMyKExfdG1wLCAxKTsgICAgICAgICAgIC8qIHNhdHVyYXRpb24gY2FuIG9jY3VyIGhlcmUgKi8KLSAgIC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VF9TSVpFXTsKLSAgICAgICAgaW50MTYgaGlzdF9wdHI7Ci0gICAgICAgIGludDE2IGxvZ19lbl9pbmRleDsKLSAgICAgICAgaW50MTYgY25nX3NlZWQ7Ci0KLSAgICAgICAgLyogRFRYIGhhbmRsZXIgc3R1ZmYgKi8KLSAgICAgICAgaW50MTYgZHR4SGFuZ292ZXJDb3VudDsKLSAgICAgICAgaW50MTYgZGVjQW5hRWxhcHNlZENvdW50OwotICAgICAgICBpbnQzMiBEWzI4XTsKLSAgICAgICAgaW50MzIgc3VtRFtEVFhfSElTVF9TSVpFXTsKLSAgICB9IGR0eF9lbmNTdGF0ZTsKLQotI2RlZmluZSBTUEVFQ0ggMAotI2RlZmluZSBEVFggMQotI2RlZmluZSBEVFhfTVVURSAyCi0KLSNkZWZpbmUgVFhfU1BFRUNIIDAKLSNkZWZpbmUgVFhfU0lEX0ZJUlNUIDEKLSNkZWZpbmUgVFhfU0lEX1VQREFURSAyCi0jZGVmaW5lIFRYX05PX0RBVEEgMwotCi0jZGVmaW5lIFJYX1NQRUVDSF9HT09EIDAKLSNkZWZpbmUgUlhfU1BFRUNIX1BST0JBQkxZX0RFR1JBREVEIDEKLSNkZWZpbmUgUlhfU1BFRUNIX0xPU1QgMgotI2RlZmluZSBSWF9TUEVFQ0hfQkFEIDMKLSNkZWZpbmUgUlhfU0lEX0ZJUlNUIDQKLSNkZWZpbmUgUlhfU0lEX1VQREFURSA1Ci0jZGVmaW5lIFJYX1NJRF9CQUQgNgotI2RlZmluZSBSWF9OT19EQVRBIDcKLQotICAgIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgotICAgICAqCi0gICAgICogREVGSU5JVElPTiBPRiBEQVRBIFRZUEVTCi0gICAgICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotCi0gICAgdHlwZWRlZiBzdHJ1Y3QKLSAgICB7Ci0gICAgICAgIGludDE2IHNpbmNlX2xhc3Rfc2lkOwotICAgICAgICBpbnQxNiB0cnVlX3NpZF9wZXJpb2RfaW52OwotICAgICAgICBpbnQxNiBsb2dfZW47Ci0gICAgICAgIGludDE2IG9sZF9sb2dfZW47Ci0gICAgICAgIGludDE2IGxldmVsOwotICAgICAgICBpbnQxNiBpc2ZbTV07Ci0gICAgICAgIGludDE2IGlzZl9vbGRbTV07Ci0gICAgICAgIGludDE2IGNuZ19zZWVkOwotCi0gICAgICAgIGludDE2IGlzZl9oaXN0W00gKiBEVFhfSElTVF9TSVpFXTsKLSAgICAgICAgaW50MTYgbG9nX2VuX2hpc3RbRFRYX0hJU1RfU0laRV07Ci0gICAgICAgIGludDE2IGhpc3RfcHRyOwotCi0gICAgICAgIGludDE2IGR0eEhhbmdvdmVyQ291bnQ7Ci0gICAgICAgIGludDE2IGRlY0FuYUVsYXBzZWRDb3VudDsKLQotICAgICAgICBpbnQxNiBzaWRfZnJhbWU7Ci0gICAgICAgIGludDE2IHZhbGlkX2RhdGE7Ci0gICAgICAgIGludDE2IGR0eEhhbmdvdmVyQWRkZWQ7Ci0KLSAgICAgICAgaW50MTYgZHR4R2xvYmFsU3RhdGU7ICAgICAgICAgICAgICAgICAvKiBjb250YWlucyBwcmV2aW91cyBzdGF0ZSAqLwotICAgICAgICAvKiB1cGRhdGVkIGluIG1haW4gZGVjb2RlciAqLwotCi0gICAgICAgIGludDE2IGRhdGFfdXBkYXRlZDsgICAgICAgICAgICAgICAgICAgLyogbWFya2VyIHRvIGtub3cgaWYgQ05JIGRhdGEgaXMgZXZlciByZW5ld2VkICovCi0KLSAgICAgICAgaW50MTYgZGl0aGVyX3NlZWQ7Ci0gICAgICAgIGludDE2IENOX2RpdGg7Ci0KLSAgICB9IGR0eF9kZWNTdGF0ZTsKLQotICAgIGludDE2IGR0eF9lbmNfaW5pdChkdHhfZW5jU3RhdGUgKiogc3QsIGludDE2IGlzZl9pbml0W10pOwotICAgIGludDE2IGR0eF9lbmNfcmVzZXQoZHR4X2VuY1N0YXRlICogc3QsIGludDE2IGlzZl9pbml0W10pOwotICAgIHZvaWQgZHR4X2VuY19leGl0KGR0eF9lbmNTdGF0ZSAqKiBzdCk7Ci0KLSAgICBpbnQxNiBkdHhfZW5jKAotICAgICAgICBkdHhfZW5jU3RhdGUgKiBzdCwgICAgICAgICAgICAgICAgICAgIC8qIGkvbyA6IFN0YXRlIHN0cnVjdCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLSAgICAgICAgaW50MTYgaXNmW01dLCAgICAgICAgICAgICAgICAgICAgICAgIC8qIG8gICA6IENOIElTRiB2ZWN0b3IgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLSAgICAgICAgaW50MTYgKiBleGMyLCAgICAgICAgICAgICAgICAgICAgICAgIC8qIG8gICA6IENOIGV4Y2l0YXRpb24gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLSAgICAgICAgaW50MTYgKiogcHJtcwotICAgICk7Ci0KLSAgICBpbnQxNiBkdHhfYnVmZmVyKAotICAgICAgICBkdHhfZW5jU3RhdGUgKiBzdCwgICAgICAgICAgICAgICAgICAgIC8qIGkvbyA6IFN0YXRlIHN0cnVjdCAgICAgICAgICAgICAgICAgICAgKi8KLSAgICAgICAgaW50MTYgaXNmX25ld1tdLCAgICAgICAgICAgICAgICAgICAgIC8qIGkgICA6IGlzZiB2ZWN0b3IgICAgICAgICAgICAgICAgICAgICAgKi8KLSAgICAgICAgaW50MzIgZW5yLCAgICAgICAgICAgICAgICAgICAgICAgICAgIC8qIGkgICA6IHJlc2lkdWFsIGVuZXJneSAoaW4gTF9GUkFNRSkgICAgKi8KLSAgICAgICAgaW50MTYgY29kZWNfbW9kZQotICAgICk7Ci0KLSAgICB2b2lkIHR4X2R0eF9oYW5kbGVyKGR0eF9lbmNTdGF0ZSAqIHN0LCAgICAgLyogaS9vIDogU3RhdGUgc3RydWN0ICAgICAgICAgICAqLwotICAgICAgICAgICAgICAgICAgICAgICAgaW50MTYgdmFkX2ZsYWcsICAgICAgICAgICAgICAgICAgICAgIC8qIGkgICA6IHZhZCBkZWNpc2lvbiAgICAgICAgICAgKi8KLSAgICAgICAgICAgICAgICAgICAgICAgIGludDE2ICogdXNlZE1vZGUgICAgICAgICAgICAgICAgICAgICAvKiBpL28gOiBtb2RlIGNoYW5nZWQgb3Igbm90ICAgICovCi0gICAgICAgICAgICAgICAgICAgICAgICk7Ci0KLSAgICB2b2lkIFFpc2ZfbnMoCi0gICAgICAgIGludDE2ICogaXNmMSwgICAgICAgICAgICAgICAgICAgICAgICAvKiBpbnB1dCA6IElTRiBpbiB0aGUgZnJlcXVlbmN5IGRvbWFpbiAoMC4uMC41KSAqLwotICAgICAgICBpbnQxNiAqIGlzZl9xLCAgICAgICAgICAgICAgICAgICAgICAgLyogb3V0cHV0OiBxdWFudGl6ZWQgSVNGICAgICAgICAgICAgICAgICAgICAgICAgKi8KLSAgICAgICAgaW50MTYgKiBpbmRpY2UgICAgICAgICAgICAgICAgICAgICAgIC8qIG91dHB1dDogcXVhbnRpemF0aW9uIGluZGljZXMgICAgICAgICAgICAgICAgICovCi0gICAgKTsKLQotCi0gICAgaW50MTYgZHR4X2RlY19hbXJfd2JfcmVzZXQoZHR4X2RlY1N0YXRlICogc3QsIGNvbnN0IGludDE2IGlzZl9pbml0W10pOwotCi0gICAgaW50MTYgZHR4X2RlY19hbXJfd2IoCi0gICAgICAgIGR0eF9kZWNTdGF0ZSAqIHN0LCAgICAgICAgICAgICAgICAgICAgLyogaS9vIDogU3RhdGUgc3RydWN0ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLSAgICAgICAgaW50MTYgKiBleGMyLCAgICAgICAgICAgICAgICAgICAgICAgIC8qIG8gICA6IENOIGV4Y2l0YXRpb24gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotICAgICAgICBpbnQxNiBuZXdfc3RhdGUsICAgICAgICAgICAgICAgICAgICAgLyogaSAgIDogTmV3IERUWCBzdGF0ZSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0gICAgICAgIGludDE2IGlzZltdLCAgICAgICAgICAgICAgICAgICAgICAgICAvKiBvICAgOiBDTiBJU0YgdmVjdG9yICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLSAgICAgICAgaW50MTYgKiogcHJtcwotICAgICk7Ci0KLSAgICB2b2lkIGR0eF9kZWNfYW1yX3diX2FjdGl2aXR5X3VwZGF0ZSgKLSAgICAgICAgZHR4X2RlY1N0YXRlICogc3QsCi0gICAgICAgIGludDE2IGlzZltdLAotICAgICAgICBpbnQxNiBleGNbXSk7Ci0KLQotICAgIGludDE2IHJ4X2Ftcl93Yl9kdHhfaGFuZGxlcigKLSAgICAgICAgZHR4X2RlY1N0YXRlICogc3QsICAgICAgICAgICAgICAgICAgICAvKiBpL28gOiBTdGF0ZSBzdHJ1Y3QgICAgICovCi0gICAgICAgIGludDE2IGZyYW1lX3R5cGUgICAgICAgICAgICAgICAgICAgICAvKiBpICAgOiBGcmFtZSB0eXBlICAgICAgICovCi0gICAgKTsKLQotICAgIHZvaWQgRGlzZl9ucygKLSAgICAgICAgaW50MTYgKiBpbmRpY2UsICAgICAgICAgICAgICAgICAgICAgIC8qIGlucHV0OiAgcXVhbnRpemF0aW9uIGluZGljZXMgICAgICAgICAgICAgICAgICAqLwotICAgICAgICBpbnQxNiAqIGlzZl9xICAgICAgICAgICAgICAgICAgICAgICAgLyogaW5wdXQgOiBJU0YgaW4gdGhlIGZyZXF1ZW5jeSBkb21haW4gKDAuLjAuNSkgICovCi0gICAgKTsKLQotICAgIHZvaWQgYXZlcl9pc2ZfaGlzdG9yeSgKLSAgICAgICAgaW50MTYgaXNmX29sZFtdLAotICAgICAgICBpbnQxNiBp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ICB8IERUWCAgICAgICAgICB8IERUWC8oRFRYX01VVEUpfCBEVFhfTVVURQotICAgICAtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tCi0gICAgIFJYX05PX0RBVEEsICAgICAgICAgICB8IFNQRUVDSCAgICAgICB8IERUWC8oRFRYX01VVEUpfCBEVFhfTVVURQotICAgICBSWF9TUEFSRSAgICAgICAgICAgICAgfChjbGFzczIgZ2FyYi4pfCAgICAgICAgICAgICAgIHwKLSAgICAgLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLQotKi8KLQotLyotLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tCi07IEZVTkNUSU9OIENPREUKLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0qLwotCi0vKgotICogRnVuY3Rpb24gICAgOiBkdHhfZGVjX2Ftcl93YgotICovCi1pbnQxNiBkdHhfZGVjX2Ftcl93YigKLSAgICBkdHhfZGVjU3RhdGUgKiBzdCwgICAgICAgICAgICAgICAgICAgIC8qIGkvbyA6IFN0YXRlIHN0cnVjdCAgICAgICAgICovCi0gICAgaW50MTYgKiBleGMyLCAgICAgICAgICAgICAgICAgICAgICAgIC8qIG8gICA6IENOIGV4Y2l0YXRpb24gICAgICAgICovCi0gICAgaW50MTYgbmV3X3N0YXRlLCAgICAgICAgICAgICAgICAgICAgIC8qIGkgICA6IE5ldyBEVFggc3RhdGUgICAgICAgICovCi0gICAgaW50MTYgaXNmW10sICAgICAgICAgICAgICAgICAgICAgICAgIC8qIG8gICA6IENO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0gICAgICAgICAgICAvKiBDb21wdXRlIGludGVycG9sYXRpb24gZmFjdG9yLCBzaW5jZSB0aGUgZGl2aXNpb24gb25seSB3b3JrcyAqIGZvciB2YWx1ZXMgb2Ygc2luY2VfbGFzdF9zaWQgPAotICAgICAgICAgICAgICogMzIgd2UgaGF2ZSB0byBsaW1pdCB0aGUgICAgICAqIGludGVycG9sYXRpb24gdG8gMzIgZnJhbWVzICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0gICAgICAgICAgICB0bXBfaW50X2xlbmd0aCA9IHN0LT5zaW5jZV9sYXN0X3NpZDsKLQotCi0gICAgICAgICAgICBpZiAodG1wX2ludF9sZW5ndGggPiAzMikKLSAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICB0bXBfaW50X2xlbmd0aCA9IDMyOwotICAgICAgICAgICAgfQotCi0gICAgICAgICAgICBpZiAodG1wX2ludF9sZW5ndGggPj0gMikKLSAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICBzdC0+dHJ1ZV9zaWRfcGVyaW9kX2ludiA9IGRpdl8xNmJ5MTYoMSA8PCAxMCwgc2hsX2ludDE2KHRtcF9pbnRfbGVuZ3RoLCAxMCkpOwotICAgICAgICAgICAgfQotICAgICAgICAgICAgZWxzZQotICAgICAgICAgICAgewotICAgICAgICAgICAgICAgIHN0LT50cnVlX3NpZF9wZXJpb2RfaW52ID0gMSA8PCAxNDsgICAgICAvKiAwLjUgaXQgUTE1ICovCi0gICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgIGluZFswXSA9IFNlcmlhbF9wYXJtKDYsIHBybXMpOwotICAgICAgICAgICAgaW5kWzFdID0gU2VyaWFsX3Bhcm0oNiwgcHJtcyk7Ci0gICAgICAgICAgICBpbmRbMl0gPSBTZXJpYWxfcGFybSg2LCBwcm1zKTsKLSAgICAgICAgICAgIGluZFszXSA9IFNlcmlhbF9wYXJtKDUsIHBybXMpOwotICAgICAgICAgICAgaW5kWzRdID0gU2VyaWFs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gICAgICBwdl9tZW1jcHkoKHZvaWQgKilzdC0+aXNmX29sZCwgKHZvaWQgKilzdC0+aXNmLCBNKnNpemVvZigqc3QtPmlzZikpOwotCi0gICAgICAgICAgICAgICAgc3QtPm9sZF9sb2dfZW4gPSBzdC0+bG9nX2VuOwotICAgICAgICAgICAgfQotICAgICAgICB9ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8qIGVuZGlmIHZhbGlkX2RhdGEgKi8KLSAgICB9ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvKiBlbmRpZiBzaWRfZnJhbWUgKi8KLQotCi0gICAgaWYgKChzdC0+c2lkX2ZyYW1lICE9IDApICYmIChzdC0+dmFsaWRfZGF0YSAhPSAwKSkKLSAgICB7Ci0gICAgICAgIHN0LT5zaW5jZV9sYXN0X3NpZCA9IDA7Ci0gICAgfQotICAgIC8qIEludGVycG9sYXRlIFNJRCBpbmZvICovCi0gICAgaW50X2ZhYyA9IHNobF9pbnQxNihzdC0+c2luY2VfbGFzdF9zaWQsIDEwKTsgLyogUTEwICovCi0gICAgaW50X2ZhYyA9IG11bHRfaW50MTYoaW50X2ZhYywgc3QtPnRydWVfc2lkX3BlcmlvZF9pbnYpOyAgIC8qIFExMCAqIFExNSAtPiBRMTAgKi8KLQotICAgIC8qIE1heGltaXplIHRvIDEuMCBpbiBRMTAgKi8KLQotICAgIGlmIChpbnRfZmFjID4gMTAyNCkKLSAgICB7Ci0gICAgICAgIGludF9mYWMgPSAxMDI0OwotICAgIH0KLSAgICBpbnRfZmFjID0gc2hsX2ludDE2KGludF9mYWMsIDQpOyAgICAgICAgICAgICAvKiBRMTAgLT4gUTE0ICovCi0KLSAgICBMX2xvZ19lbl9pbnQgPSBtdWxfMTZieTE2X3RvX2ludDMyKGludF9mYWMsIHN0LT5sb2dfZW4pOyAvKiBRMTQgKiBROSAtPiBRMjQgKi8KLQotICAgIGZvciAoaSA9IDA7IGkgPCBNOyBpKyspCi0gICAgewotICAgIC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IHByaW9yIHRvIHRoZSBhdmVyYWdpbmcgICAgICAgICAgICAgICAqLwotICAgIGZvciAoayA9IDA7IGsgPCAyOyBrKyspCi0gICAgewotCi0gICAgICAgIGlmIChpbmRpY2VzW2tdICsgMSAhPSAwKQotICAgICAgICB7Ci0gICAgICAgICAgICBmb3IgKGkgPSAwOyBpIDwgTTsgaSsrKQotICAgICAgICAgICAgewotICAgICAgICAgICAgICAgIGlzZl90bXBbayAqIE0gKyBpXSA9IGlzZl9vbGRbaW5kaWNlc1trXSAqIE0gKyBpXTsKLSAgICAgICAgICAgICAgICBpc2Zfb2xkW2luZGljZXNba10gKiBNICsgaV0gPSBpc2Zfb2xkW2luZGljZXNbMl0gKiBNICsgaV07Ci0gICAgICAgICAgICB9Ci0gICAgICAgIH0KLSAgICB9Ci0KLSAgICAvKiBQZXJmb3JtIHRoZSBJU0YgYXZlcmFnaW5nICovCi0gICAgZm9yIChqID0gMDsgaiA8IE07IGorKykKLSAgICB7Ci0gICAgICAgIExfdG1wID0gMDsKLQotICAgICAgICBmb3IgKGkgPSAwOyBpIDwgRFRYX0hJU1RfU0laRTsgaSsrKQotICAgICAgICB7Ci0gICAgICAgICAgICBMX3RtcCA9IGFkZF9pbnQzMihMX3RtcCwgKGludDMyKShpc2Zfb2xkW2kgKiBNICsgal0pKTsKLSAgICAgICAgfQotICAgICAgICBpc2ZfYXZlcltqXSA9IExfdG1wOwotICAgIH0KLQotICAgIC8qIFJldHJpZXZlIGZyb20gaXNmX3RtcFtdW10gdGhlIElTRiB2ZWN0b3JzIHNhdmVkIHByaW9yIHRvIGF2ZXJhZ2luZyAqLwotICAgIGZvciAoayA9IDA7IGsgPCAyOyBrKyspCi0gICAgewotCi0gICAgICAgIGlmIChpbmRpY2VzW2tdICsgMSAhPSAwKQotICAgICAgICB7Ci0gICAgICAgICAgICBmb3IgKGkgPSAwOyBpIDwgTTsgaSsrKQotICAgICAgICAgICAgewotICAgICAgICAgICAgICAgIGlzZl9vbGRbaW5kaWN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ICAgICAgLyogaXNmIGJ1ZmZlcihmcmVxdWVuY3kgZG9tYWluKSAqLwotICAgIGludDE2IHBhc3RfaXNmcVtNXTsgICAgICAgICAgICAgICAgICAgLyogcGFzdCBpc2YgcXVhbnRpemVyICovCi0gICAgaW50MTYgdGlsdF9jb2RlOyAgICAgICAgICAgICAgICAgICAgICAvKiB0aWx0IG9mIGNvZGUgKi8KLSAgICBpbnQxNiBRX29sZDsgICAgICAgICAgICAgICAgICAgICAgICAgIC8qIG9sZCBzY2FsaW5nIGZhY3RvciAqLwotICAgIGludDE2IFFzdWJmcls0XTsgICAgICAgICAgICAgICAgICAgICAgLyogb2xkIG1heGltdW0gc2NhbGluZyBmYWN0b3IgKi8KLSAgICBpbnQzMiBMX2djX3RocmVzOyAgICAgICAgICAgICAgICAgICAgIC8qIHRocmVzaG9sZCBmb3Igbm9pc2UgZW5oYW5jZXIgKi8KLSAgICBpbnQxNiBtZW1fc3luX2hpW01dOyAgICAgICAgICAgICAgICAgIC8qIG1vZGlmaWVkIHN5bnRoZXNpcyBtZW1vcnkgKE1TQikgKi8KLSAgICBpbnQxNiBtZW1fc3luX2xvW01dOyAgICAgICAgICAgICAgICAgIC8qIG1vZGlmaWVkIHN5bnRoZXNpcyBtZW1vcnkgKExTQikgKi8KLSAgICBpbnQxNiBtZW1fZGVlbXBoOyAgICAgICAgICAgICAgICAgICAgIC8qIHNwZWVjaCBkZWVtcGggZmlsdGVyIG1lbW9yeSAqLwotICAgIGludDE2IG1lbV9zaWdfb3V0WzZdOyAgICAgICAgICAgICAgICAgLyogaHA1MCBmaWx0ZXIgbWVtb3J5IGZvciBzeW50aGVzaXMgKi8KLSAgICBpbnQxNiBtZW1fb3ZlcnNhbXBbMiAqIExfRklMVF07ICAgICAgIC8qIHN5bnRoZXNpcyBvdmVyc2FtcGxlZCBmaWx0ZXIgbWVtb3J5ICovCi0gICAgaW50MTYgbWVtX3N5bl9oZltNMTZrXTsgICAgICAgICAgICAgICAvKiBIRiBzeW50aGVzaXMgbWVtb3J5ICovCi0gICAgaW50MTYgbWVtX2hmWzIgKiBMX0ZJTFQxNmtdOyAgICAgICAgICAvKiBIRiBiYW5kLXBhc3MgZmlsdGVyIG1lbW9yeSAqLwotICAgIGludDE2IG1lbV9oZjJbMiAqIExfRklMVDE2a107ICAgICAgICAgLyogSEYgYmFuZC1wYXNzIGZpbHRlciBtZW1vcnkgKi8KLSAgICBpbnQxNiBtZW1faGYzWzIgKiBMX0ZJTFQxNmtdOyAgICAgICAgIC8qIEhGIGJhbmQtcGFzcyBmaWx0ZXIgbWVtb3J5ICovCi0gICAgaW50MTYgc2VlZDsgICAgICAgICAgICAgICAgICAgICAgICAgICAvKiByYW5kb20gbWVtb3J5IGZvciBmcmFtZSBlcmFzdXJlICovCi0gICAgaW50MTYgc2VlZDI7ICAgICAgICAgICAgICAgICAgICAgICAgICAvKiByYW5kb20gbWVtb3J5IGZvciBIRiBnZW5lcmF0aW9uICovCi0gICAgaW50MTYgb2xkX1QwOyAgICAgICAgICAgICAgICAgICAgICAgICAvKiBvbGQgcGl0Y2ggbGFnICovCi0gICAgaW50MTYgb2xkX1QwX2ZyYWM7ICAgICAgICAgICAgICAgICAgICAvKiBvbGQgcGl0Y2ggZnJhY3Rpb24gbGFnICovCi0gICAgaW50MTYgbGFnX2hpc3RbNV07Ci0gICAgaW50MTYgZGVjX2dhaW5bMjNdOyAgICAgICAgICAgICAgICAgICAvKiBnYWluIGRlY29kZXIgbWVtb3J5ICovCi0gICAgaW50MTYgc2VlZDM7ICAgICAgICAgICAgICAgICAgICAgICAgICAvKiByYW5kb20gbWVtb3J5IGZvciBsYWcgY29uY2VhbG1lbnQgKi8KLSAgICBpbnQxNiBkaXNwX21lbVs4XTsgICAgICAgICAgICAgICAgICAgIC8qIHBoYXNlIGRpc3BlcnNpb24gbWVtb3J5ICovCi0gICAgaW50MTYgbWVtX2hwNDAwWzZdOyAgICAgICAgICAgICAgICAgICAvKiBocDQwMCBmaWx0ZXIgbWVtb3J5I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rLAotICAgICAgICBkZmhfTTI0aywKLSAgICAgICAgZGZoX00yNGsKLSAgICB9OwotCi0gICAgcHJtcyA9IGlucHV0X2ZyYW1lOwotICAgIGogPSAwOwotICAgIGkgPSAwOwotCi0gICAgaWYgKG1vZGUgIT0gTVJEVFgpCi0gICAgewotICAgICAgICBpZiAobW9kZSAhPSBNT0RFXzI0aykKLSAgICAgICAgewotICAgICAgICAgICAgLyogY29udmVydCB0aGUgcmVjZWl2ZWQgc2VyaWFsIGJpdHMgKi8KLSAgICAgICAgICAgIHRtcCA9IG5wYXJtcyAtIDE1OwotICAgICAgICAgICAgd2hpbGUgKHRtcCA+IGopCi0gICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgcGFyYW1baV0gPSBTZXJpYWxfcGFybSgxNSwgJnBybXMpOwotICAgICAgICAgICAgICAgIGogKz0gMTU7Ci0gICAgICAgICAgICAgICAgaSsrOwotICAgICAgICAgICAgfQotICAgICAgICAgICAgdG1wID0gbnBhcm1zIC0gajsKLSAgICAgICAgICAgIHBhcmFtW2ldID0gU2VyaWFsX3Bhcm0odG1wLCAmcHJtcyk7Ci0gICAgICAgICAgICBzaGlmdCA9IDE1IC0gdG1wOwotICAgICAgICAgICAgcGFyYW1baV0gPSBzaGxfaW50MTYocGFyYW1baV0sIHNoaWZ0KTsKLSAgICAgICAgfQotICAgICAgICBlbHNlCi0gICAgICAgIHsKLSAgICAgICAgICAgIC8qSWYgbW9kZSBpcyAyMy44NUtiaXQvcywgcmVtb3ZlIGhpZ2ggYmFuZCBlbmVyZ3kgYml0cyAqLwotICAgICAgICAgICAgZm9yIChpID0gMDsgaSA8IDEwOyBpKyspCi0gICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgcGFyYW1baV0gPSBTZXJpYWxfcGFybSgxNSwgJnBybXMpOwotICAgICAgICAgICAgfQotICAgICAgICAgICAgcGFyYW1bMTBdID0gU2VyaWFsX3Bhcm0oMTUsICZwcm1zKSAmIDB4NjFGRjsKLQotICAgICAgICAgICAgZm9yIChpID0gMTE7IGkgPCAxNzsgaSsrKQotICAgICAgICAgICAgewotICAgICAgICAgICAgICAgIHBhcmFtW2ldID0gU2VyaWFsX3Bhcm0oMTUsICZwcm1zKTsKLSAgICAgICAgICAgIH0KLSAgICAgICAgICAgIHBhcmFtWzE3XSA9IFNlcmlhbF9wYXJtKDE1LCAmcHJtcykgJiAweEUwRkY7Ci0KLSAgICAgICAgICAgIGZvciAoaSA9IDE4OyBpIDwgMjQ7IGkrKykKLSAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICBwYXJhbVtpXSA9IFNlcmlhbF9wYXJtKDE1LCAmcHJtcyk7Ci0gICAgICAgICAgICB9Ci0gICAgICAgICAgICBwYXJhbVsyNF0gPSBTZXJpYWxfcGFybSgxNSwgJnBybXMpICYgMHg3RjBGOwotCi0gICAgICAgICAgICBmb3IgKGkgPSAyNTsgaSA8IDMxOyBpKyspCi0gICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgcGFyYW1baV0gPSBTZXJpYWxfcGFybSgxNSwgJnBybXMpOwotICAgICAgICAgICAgfQotCi0gICAgICAgICAgICB0bXAgPSBTZXJpYWxfcGFybSg4LCAmcHJtcyk7Ci0gICAgICAgICAgICBwYXJhbVszMV0gPSBzaGxfaW50MTYodG1wLCA3KTsKLSAgICAgICAgICAgIHNoaWZ0ID0gMDsKLSAgICAgICAgfQotCi0gICAgICAgIC8qIGNoZWNrIGlmIHRoZSBwYXJhbWV0ZXJzIG1hdGNoZXMgdGhlIHBhcmFtZXRlcnMgb2YgdGhlIGNvcnJlc3BvbmRpbmcgZGVjb2RlciBob21pbmcgZnJhbWUgKi8KLSAgICAgICAgdG1wID0gaTsKLSAgICAgICAgaiA9IDA7Ci0gICAgICAgIGZvciAoaSA9IDA7IGkgPCB0bXA7IGkrKykKLSAgICAgICAgewotICAgICAgICAgICAgaiA9IChwYXJhbVtpXSBeIGRoZlttb2RlXVtpXSk7Ci0gICAgICAgICAgICBpZiAoaikK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kgPCAoTTE2ayAtIDEpOyBpKyspCi0gICAgewotICAgICAgICB0bXAgPSBtdWx0X2ludDE2KHN1Yl9pbnQxNihIZklzZltpXSwgSGZJc2ZbaSAtIDFdKSwgY29lZmYpOwotICAgICAgICBJc2ZEaWZmW2kgLSAoTSAtIDEpXSA9IHNobF9pbnQxNih0bXAsIGV4cCk7Ci0gICAgfQotCi0gICAgZm9yIChpID0gTTsgaSA8IChNMTZrIC0gMSk7IGkrKykKLSAgICB7Ci0gICAgICAgIC8qIFRoZSBkaWZmZXJlbmNlIGJldHdlZW4gSVNGKG4pIGFuZCBJU0Yobi0yKSBzaG91bGQgYmUgYXQgbGVhc3QgNTAwIEh6ICovCi0gICAgICAgIHRtcCA9IElzZkRpZmZbaSAtIChNIC0gMSldICsgSXNmRGlmZltpIC0gTV0gLSAxMjgwOwotCi0gICAgICAgIGlmICh0bXAgPCAwKQotICAgICAgICB7Ci0KLSAgICAgICAgICAgIGlmIChJc2ZEaWZmW2kgLSAoTSAtIDEpXSA+IElzZkRpZmZbaSAtIE1dKQotICAgICAgICAgICAgewotICAgICAgICAgICAgICAgIElzZkRpZmZbaSAtIE1dID0gMTI4MCAtIElzZkRpZmZbaSAtIChNIC0gMSldOwotICAgICAgICAgICAgfQotICAgICAgICAgICAgZWxzZQotICAgICAgICAgICAgewotICAgICAgICAgICAgICAgIElzZkRpZmZbaSAtIChNIC0gMSldID0gMTI4MCAtIElzZkRpZmZbaSAtIE1dOwotICAgICAgICAgICAgfQotICAgICAgICB9Ci0gICAgfQotCi0gICAgZm9yIChpID0gTSAtIDE7IGkgPCAoTTE2ayAtIDEpOyBpKyspCi0gICAgewotICAgICAgICBIZklzZltpXSA9IGFkZF9pbnQxNihIZklzZltpIC0gMV0sIElzZkRpZmZbaSAtIChNIC0gMSldKTsKLSAgICB9Ci0KLSAgICBmb3IgKGkgPSAwOyBpIDwgKE0xNmsgLSAxKTsgaSsrKQotICAgIHsKLSAgICAgICAgSGZJc2ZbaV0gPSBtdW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FibGVkICAqLwotKQotewotICAgIGludDE2IGksIGo7Ci0gICAgaW50MzIgZjFbTkMxNmsgKyAxXSwgZjJbTkMxNmtdOwotICAgIGludDE2IG5jOwotICAgIGludDMyIHQwOwotICAgIGludDMyIHQxOwotICAgIGludDE2IHEsIHFfc3VnOwotICAgIGludDMyIHRtYXg7Ci0KLSAgICBuYyA9IG0gPj4gMTsKLQotCi0gICAgaWYgKG5jID4gOCkKLSAgICB7Ci0gICAgICAgIEdldF9pc3BfcG9sXzE2a0h6KCZpc3BbMF0sIGYxLCBuYyk7Ci0gICAgICAgIGZvciAoaSA9IDA7IGkgPD0gbmM7IGkrKykKLSAgICAgICAgewotICAgICAgICAgICAgZjFbaV0gPSBzaGxfaW50MzIoZjFbaV0sIDIpOwotICAgICAgICB9Ci0gICAgICAgIEdldF9pc3BfcG9sXzE2a0h6KCZpc3BbMV0sIGYyLCBuYyAtIDEpOwotICAgICAgICBmb3IgKGkgPSAwOyBpIDw9IG5jIC0gMTsgaSsrKQotICAgICAgICB7Ci0gICAgICAgICAgICBmMltpXSA9IHNobF9pbnQzMihmMltpXSwgMik7Ci0gICAgICAgIH0KLSAgICB9Ci0gICAgZWxzZQotICAgIHsKLSAgICAgICAgR2V0X2lzcF9wb2woJmlzcFswXSwgZjEsIG5jKTsKLSAgICAgICAgR2V0X2lzcF9wb2woJmlzcFsxXSwgZjIsIG5jIC0gMSk7Ci0gICAgfQotCi0gICAgLyoKLSAgICAgKiAgTXVsdGlwbHkgRjIoeikgYnkgKDEgLSB6Xi0yKQotICAgICAqLwotCi0gICAgZm9yIChpID0gbmMgLSAxOyBpID4gMTsgaS0tKQotICAgIHsKLSAgICAgICAgZjJbaV0gLT0gZjJbaSAtIDJdOyAgICAgIC8qIGYyW2ldIC09IGYyW2ktMl07ICovCi0gICAgfQotCi0gICAgLyoKLSAgICAgKiAgU2NhbGUgRjEoeikgYnkgKDEraXNwW20tMV0pICBhbmQgIEYyKHopIGJ5ICgxLWlzcFttLTFdKQotICAgICAqLwotCi0gICAgZm9yIChpID0gMDsgaSA8IG5jOyBpKyspCi0gICAgewotICAgICAgICAvKiBmMVtpXSAqPSAoMS4wICsgaXNwW00tMV0pOyAqLwotCi0gICAgICAgIC8qIGYyW2ldICo9ICgxLjAgLSBpc3BbTS0xXSk7ICovCi0gICAgICAgIHQwID0gZjFbaV07Ci0gICAgICAgIHQxID0gZjJbaV07Ci0gICAgICAgIHQwID0gZnhwX211bDMyX2J5XzE2Yih0MCwgaXNwW20gLSAxXSkgPDwgMTsKLSAgICAgICAgdDEgPSBmeHBfbXVsMzJfYnlfMTZiKHQxLCBpc3BbbSAtIDFdKSA8PCAxOwotICAgICAgICBmMVtpXSArPSB0MDsKLSAgICAgICAgZjJbaV0gLT0gdDE7Ci0KLSAgICB9Ci0KLSAgICAvKgotICAgICAqICBBKHopID0gKEYxKHopK0YyKHopKS8yCi0gICAgICogIEYxKHopIGlzIHN5bW1ldHJpYyBhbmQgRjIoeikgaXMgYW50aXN5bW1ldHJpYwotICAgICAqLwotCi0gICAgLyogYVswXSA9IDEuMDsgKi8KLSAgICBhWzBdID0gNDA5NjsKLSAgICB0bWF4ID0gMTsKLSAgICBqID0gbSAtIDE7Ci0gICAgZm9yIChpID0gMTsgIGkgPCBuYzsgaSsrKQotICAgIHsKLSAgICAgICAgLyogYVtpXSA9IDAuNSooZjFbaV0gKyBmMltpXSk7ICovCi0KLSAgICAgICAgdDAgPSBhZGRfaW50MzIoZjFbaV0sIGYyW2ldKTsgICAgICAgICAgLyogZjFbaV0gKyBmMltpXSAgICAgICAgICAgICAqLwotICAgICAgICAvKiBjb21wdXRlIHQxID0gYWJzKHQwKSAqLwotICAgICAgICB0MSA9IHQwIC0gKHQwIDwgMCk7Ci0gICAgICAgIHQxID0gdDEgXih0MSA+PiAzMSk7ICAvKiB0MSA9IHQxIF5zaWduKHQxKSAqLwotCi0gICAgICAgIHRtYXggfD0gdDE7Ci0gICAgICAgIC8qIGZyb20gUTIzIHRvIFExMiBhbmQ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0gICAgICAgIHsKLSAgICAgICAgICAgIC8qIGFbaV0gPSAwLjUqKGYxW2ldICsgZjJbaV0pOyAqLwotCi0gICAgICAgICAgICB0MCA9IGFkZF9pbnQzMihmMVtpXSwgZjJbaV0pOyAgICAgICAgICAvKiBmMVtpXSArIGYyW2ldICAgICAgICAgICAgICovCi0gICAgICAgICAgICAvKiBmcm9tIFEyMyB0byBRMTIgYW5kICogMC41ICovCi0gICAgICAgICAgICBhW2ldID0gKGludDE2KSgodDAgPj4gcV9zdWcpICsgKCh0MCA+PiAocV9zdWcgLSAxKSkgJiAxKSk7Ci0KLQotICAgICAgICAgICAgLyogYVtqXSA9IDAuNSooZjFbaV0gLSBmMltpXSk7ICovCi0KLSAgICAgICAgICAgIHQwID0gc3ViX2ludDMyKGYxW2ldLCBmMltpXSk7ICAgICAgICAgIC8qIGYxW2ldIC0gZjJbaV0gICAgICAgICAgICAgKi8KLSAgICAgICAgICAgIC8qIGZyb20gUTIzIHRvIFExMiBhbmQgKiAwLjUgKi8KLSAgICAgICAgICAgIGFbal0gPSAoaW50MTYpKCh0MCA+PiBxX3N1ZykgKyAoKHQwID4+IChxX3N1ZyAtIDEpKSAmIDEpKTsKLQotICAgICAgICB9Ci0gICAgICAgIGFbMF0gPj49ICBxOwotICAgIH0KLSAgICBlbHNlCi0gICAgewotICAgICAgICBxX3N1ZyA9IDEyOwotICAgICAgICBxICAgICA9IDA7Ci0gICAgfQotCi0gICAgLyogYVtOQ10gPSAwLjUqZjFbTkNdKigxLjAgKyBpc3BbTS0xXSk7ICovCi0KLQotICAgIHQwID0gKGludDMyKSgoKGludDY0KWYxW25jXSAqIGlzcFttIC0gMV0pID4+IDE2KSA8PCAxOwotCi0KLSAgICB0MCA9IGFkZF9pbnQzMihmMVtuY10sIHQwKTsKLQotICAgIC8qIGZyb20gUTIzIHRvIFExMiBhbmQgKiAwLjUgKi8KLSAgICBhW25jXSA9IChpbnQxNikoKHQwID4+IHFfc3VnKSArICgodDAgPj4gKHFfc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LwotICAgIGZbMV0gPSAtaXNwWzBdIDw8IDk7ICAgICAgICAgICAgICAgICAgICAgIC8qIGZbMV0gPSAtMi4wKmlzcFswXSBpbiBRMjMgICovCi0KLSAgICBmICs9IDI7ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvKiBBZHZhbmNlIGYgcG9pbnRlciAgICAgICAgICAqLwotICAgIGlzcCArPSAyOyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8qIEFkdmFuY2UgaXNwIHBvaW50ZXIgICAgICAgICovCi0KLSAgICBmb3IgKGkgPSAyOyBpIDw9IG47IGkrKykKLSAgICB7Ci0gICAgICAgICpmID0gZlstMl07Ci0KLSAgICAgICAgZm9yIChqID0gMTsgaiA8IGk7IGorKykKLSAgICAgICAgewotCi0gICAgICAgICAgICB0MCA9IGZ4cF9tdWwzMl9ieV8xNmIoZlstMV0sICppc3ApOwotICAgICAgICAgICAgdDAgPSBzaGxfaW50MzIodDAsIDIpOwotCi0gICAgICAgICAgICAqZiAtPSB0MDsgICAgICAgICAgICAgICAgICAgICAgLyogKmYgLT0gdDAgICAgICAgICAgICAqLwotICAgICAgICAgICAgKihmKSArPSBmWy0yXTsgICAgICAgICAgICAgICAgIC8qICpmICs9IGZbLTJdICAgICAgICAgKi8KLSAgICAgICAgICAgIGYtLTsKLQotCi0gICAgICAgIH0KLSAgICAgICAgKmYgLT0gKmlzcCA8PCA5OwotCi0gICAgICAgIGYgKz0gaTsgICAgICAgICAgICAgICAgICAgICAgICAgICAgLyogQWR2YW5jZSBmIHBvaW50ZXIgICAqLwotICAgICAgICBpc3AgKz0gMjsgICAgICAgICAgICAgICAgICAgICAgICAgIC8qIEFkdmFuY2UgaXNwIHBvaW50ZXIgKi8KLSAgICB9Ci19Ci0KLXZvaWQgR2V0X2lzcF9wb2xfMTZrSHooaW50MTYgKiBpc3AsIGludDMyICogZiwgaW50MTYgbikKLXsKLSAgICBpbnQxNiBpLCBqOwotICAgIGludDMyIHQwOwotCi0gICAgLyogQWxsIGNvbXB1dGF0aW9uIGluIFEyMyAqLwotCi0gICAgZlswXSA9IDB4MDAyMDAwMDA7ICAgICAgICAgICAgICAgICAgICAgICAgLyogZlswXSA9IDAuMjU7ICAgICAgICBpbiBRMjMgICovCi0KLSAgICBmWzFdID0gLWlzcFswXSA8PCA3OyAgICAgICAgICAgICAgICAgICAgICAvKiBmWzFdID0gLTAuNSppc3BbMF0gaW4gUTIzICAqLwotCi0gICAgZiArPSAyOyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLyogQWR2YW5jZSBmIHBvaW50ZXIgICAgICAgICAgKi8KLSAgICBpc3AgKz0gMjsgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvKiBBZHZhbmNlIGlzcCBwb2ludGVyICAgICAgICAqLwotCi0gICAgZm9yIChpID0gMjsgaSA8PSBuOyBpKyspCi0gICAgewotICAgICAgICAqZiA9IGZbLTJdOwotCi0gICAgICAgIGZvciAoaiA9IDE7IGogPCBpOyBqKyssIGYtLSkKLSAgICAgICAgewotICAgICAgICAgICAgdDAgPSBmeHBfbXVsMzJfYnlfMTZiKGZbLTFdLCAqaXNwKTsKLSAgICAgICAgICAgIHQwID0gc2hsX2ludDMyKHQwLCAyKTsKLQotICAgICAgICAgICAgKmYgLT0gdDA7ICAgICAgICAgICAgICAgICAgICAgIC8qICpmIC09IHQwICAgICAgICAgICAgKi8KLSAgICAgICAgICAgICpmICs9IGZbLTJdOyAgICAgICAgICAgICAgICAgICAvKiAqZiArPSBmWy0yXSAgICAgICAgICovCi0gICAgICAgIH0KLSAgICAgICAgKmYgLT0gKmlzcCA8PCA3OwotICAgICAgICBmICs9IGk7ICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8qIEFkdmFuY2UgZiBwb2ludGVyICAgKi8KLSAgICAgICAgaXNwICs9IDI7ICAgICAgICAgICAgICAgICAgICAgICAgICAvKiBBZHZhbmNlIGlzcCBwb2ludGVyICovCi0gICAgfQotICAgIHJldHVyb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oqKioqKiogU01BTExFU1QgaGlzdG9yeSBsYWcgKioqKioqKi8KLSAgICBtaW5MYWcgPSBsYWdfaGlzdFswXTsKLSAgICAvKioqKioqKiAgQklHR0VTVCBoaXN0b3J5IGxhZyAqKioqKioqLwotICAgIG1heExhZyA9IGxhZ19oaXN0WzBdOwotICAgIGZvciAoaSA9IDE7IGkgPCBMX0xUUEhJU1Q7IGkrKykKLSAgICB7Ci0gICAgICAgIGlmIChsYWdfaGlzdFtpXSA8IG1pbkxhZykKLSAgICAgICAgewotICAgICAgICAgICAgbWluTGFnID0gbGFnX2hpc3RbaV07Ci0gICAgICAgIH0KLSAgICAgICAgaWYgKGxhZ19oaXN0W2ldID4gbWF4TGFnKQotICAgICAgICB7Ci0gICAgICAgICAgICBtYXhMYWcgPSBsYWdfaGlzdFtpXTsKLSAgICAgICAgfQotICAgIH0KLSAgICAvKioqKioqKioqKipTTUFMTEVTVCBoaXN0b3J5IGdhaW4qKioqKioqKioqKi8KLSAgICBtaW5HYWluID0gZ2Fpbl9oaXN0WzBdOwotICAgIGZvciAoaSA9IDE7IGkgPCBMX0xUUEhJU1Q7IGkrKykKLSAgICB7Ci0KLSAgICAgICAgaWYgKGdhaW5faGlzdFtpXSA8IG1pbkdhaW4pCi0gICAgICAgIHsKLSAgICAgICAgICAgIG1pbkdhaW4gPSBnYWluX2hpc3RbaV07Ci0gICAgICAgIH0KLSAgICB9Ci0gICAgLyoqKkRpZmZlcmVuY2UgYmV0d2VlbiBNQVggYW5kIE1JTiBsYWcqKi8KLSAgICBsYWdEaWYgPSBzdWJfaW50MTYobWF4TGFnLCBtaW5MYWcpOwotCi0KLSAgICBpZiAodW51c2FibGVfZnJhbWUgIT0gMCkKLSAgICB7Ci0gICAgICAgIC8qIExUUC1sYWcgZm9yIFJYX1NQRUVDSF9MT1NUICovCi0gICAgICAgIC8qKioqKioqKioqUmVjb2duaXRpb24gb2YgdGhlIExUUC1oaXN0b3J5KioqKioqKioqLwotCi0gICAgICAgIGlmICgobWluR2FpbiA+IDgxOTIpICYmIChsYWdEaWYgPCAxMCkpCi0gICAgICAgIHsKLSAgICAgICAgICAgICpUMCA9ICpvbGRfVDA7Ci0gICAgICAgIH0KLSAgICAgICAgZWxzZSBpZiAobGFzdEdhaW4gPiA4MTkyICYmIHNlY0xhc3RHYWluID4gODE5MikKLSAgICAgICAgewotICAgICAgICAgICAgKlQwID0gbGFnX2hpc3RbMF07Ci0gICAgICAgIH0KLSAgICAgICAgZWxzZQotICAgICAgICB7Ci0gICAgICAgICAgICAvKioqKioqKipTT1JUKioqKioqKioqKioqLwotICAgICAgICAgICAgLyogVGhlIHNvcnRpbmcgb2YgdGhlIGxhZyBoaXN0b3J5ICovCi0gICAgICAgICAgICBmb3IgKGkgPSAwOyBpIDwgTF9MVFBISVNUOyBpKyspCi0gICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgbGFnX2hpc3QyW2ldID0gbGFnX2hpc3RbaV07Ci0gICAgICAgICAgICB9Ci0gICAgICAgICAgICBpbnNlcnRpb25fc29ydChsYWdfaGlzdDIsIDUpOwotCi0gICAgICAgICAgICAvKiBMYWcgaXMgd2VpZ2h0ZWQgdG93YXJkcyBiaWdnZXIgbGFncyAqLwotICAgICAgICAgICAgLyogYW5kIHJhbmRvbSB2YXJpYXRpb24gaXMgYWRkZWQgKi8KLSAgICAgICAgICAgIGxhZ0RpZiA9IHN1Yl9pbnQxNihsYWdfaGlzdDJbNF0sIGxhZ19oaXN0MlsyXSk7Ci0KLQotICAgICAgICAgICAgaWYgKGxhZ0RpZiA+IDQwKQotICAgICAgICAgICAgewotICAgICAgICAgICAgICAgIGxhZ0RpZiA9IDQwOwotICAgICAgICAgICAgfQotCi0gICAgICAgICAgICBEID0gbm9pc2VfZ2VuX2FtcndiKHNlZWQpOyAgICAgICAgICAgICAgLyogRD17LTEsIC4uLiwxfSAqLwotICAgICAgICAgICAgLyogRDI9ey1sYWdEaWYvMi4ubGFnRGlmLzJ9ICovCi0gICAgICAgICAgICB0bXAgPSBsYWdEaWYgPj4gMTsKLSAgICAgICAgICAgIEQyID0gbXVsdF9pbnQxNih0bXAsIEQpOwotICAgICAgICAgICAgdG1wID0gYWRkX2ludDE2KGFkZF9pbnQxNihsYWdfaGlzdDJbMl0sIGxhZ19oaXN0MlszXSksIGxhZ19oaXN0Mls0XSk7Ci0gICAgICAgICAgICAqVDAgPSBhZGRfaW50MTYobXVsdF9pbnQxNih0bXAsIE9ORV9QRVJfMyksIEQyKTsKLSAgICAgICAgfQotICAgICAgICAvKiBOZXcgbGFnIGlzIG5vdCBhbGxvd2VkIHRvIGJlIGJpZ2dlciBvciBzbWFsbGVyIHRoYW4gbGFzdCBsYWcgdmFsdWVzICovCi0KLSAgICAgICAgaWYgKCpUMCA+IG1heExhZykKLSAgICAgICAgewotICAgICAgICAgICAgKlQwID0gbWF4TGFnOwotICAgICAgICB9Ci0KLSAgICAgICAgaWYgKCpUMCA8IG1pbkxhZykKLSAgICAgICAgewotICAgICAgICAgICAgKlQwID0gbWluTGFnOwotICAgICAgICB9Ci0gICAgfQotICAgIGVsc2UKLSAgICB7Ci0gICAgICAgIC8qIExUUC1sYWcgZm9yIFJYX0JBRF9GUkFNRSAqLwotCi0gICAgICAgIC8qKioqKioqKioqKk1FQU4gbGFnKioqKioqKioqKioqKiovCi0gICAgICAgIG1lYW5MYWcgPSAwOwotICAgICAgICBmb3IgKGkgPSAwOyBpIDwgTF9MVFBISVNUOyBpKyspCi0gICAgICAgIHsKLSAgICAgICAgICAgIG1lYW5MYWcgPSBhZGRfaW50MTYobWVhbkxhZywgbGFnX2hpc3RbaV0pOwotICAgICAgICB9Ci0gICAgICAgIG1lYW5MYWcgPSBtdWx0X2ludDE2KG1lYW5MYWcsIE9ORV9QRVJfTFRQSElTVCk7Ci0KLSAgICAgICAgdG1wICA9ICpUMCAtIG1heExhZzsKLSAgICAgICAgdG1wMiA9ICpUMCAtIGxhc3RMYWc7Ci0KLSAgICAgICAgaWYgKChsYWdEaWYgPCAxMCkgJiYgKCpUMCA+IChtaW5MYWcgLSA1KSkgJiYgKHRtcCA8IDUpKQotICAgICAgICB7Ci0gICAgICAgICAgICAqVDAgPSAqVDA7Ci0gICAgICAgIH0KLSAgICAgICAgZWxzZSBpZiAoKGxhc3RHYWluID4gODE5MikgJiYgKHNlY0xhc3RHYWluID4gODE5MikgJiYgKCh0bXAyICsgMTApID4gMCAmJiB0bXAyIDwgMTApKQotICAgICAgICB7Ci0gICAgICAgICAgICAqVDAgPSAqVDA7Ci0gICAgICAgIH0KLSAgICAgICAgZWxzZSBpZiAoKG1pbkdhaW4gPCA2NTU0KSAmJiAobGFzdEdhaW4gPT0gbWluR2FpbikgJiYgKCpUMCA+IG1pbkxhZyAmJiAqVDAgPCBtYXhMYWcpKQotICAgICAgICB7Ci0gICAgICAgICAgICAqVDAgPSAqVDA7Ci0gICAgICAgIH0KLSAgICAgICAgZWxzZSBpZiAoKGxhZ0RpZiA8IDcwKSAmJiAoKlQwID4gbWluTGFnKSAmJiAoKlQwIDwgbWF4TGFnKSkKLSAgICAgICAgewotICAgICAgICAgICAgKlQwID0gKlQwOwotICAgICAgICB9Ci0gICAgICAgIGVsc2UgaWYgKCgqVDAgPiBtZWFuTGFnKSAmJiAoKlQwIDwgbWF4TGFnKSkKLSAgICAgICAgewotICAgICAgICAgICAgKlQwID0gKlQwOwotICAgICAgICB9Ci0gICAgICAgIGVsc2UKLSAgICAgICAgewotCi0KLSAgICAgICAgICAgIGlmICgobWluR2FpbiA+IDgxOTIpICYgKGxhZ0RpZiA8IDEwKSkKLSAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAqVDAgPSBsYWdfaGlzdFswXTsKLSAgICAgICAgICAgIH0KLSAgICAgICAgICAgIGVsc2UgaWYgKChsYXN0R2FpbiA+IDgxOTIpICYmIChzZWNMYXN0R2FpbiA+IDgxOTIpKQotICAgICAgICAgICAgewotICAgICAgICAgICAgICAgICpUMCA9IGxhZ19oaXN0WzBdOwotICAgICAgICAgICAgfQotICAgICAgICAgICAgZWxzZQotICAgICAgICAgICAgewotICAgICAgICAgICAgICAgIC8qKioqKioqKlNPUlQqKioqKioqKioqKiovCi0gICAgICAgICAgICAgICAgLyogVGhlIHNvcnRpbmcgb2YgdGhlIGxhZyBoaXN0b3J5ICovCi0gICAgICAgICAgICAgICAgZm9yIChpID0gMDsgaSA8IExfTFRQSElTVDsgaSsrKQotICAgICAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAgICAgbGFnX2hpc3QyW2ldID0gbGFnX2hpc3RbaV07Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgIGluc2VydGlvbl9zb3J0KGxhZ19oaXN0MiwgNSk7Ci0KLSAgICAgICAgICAgICAgICAvKiBMYWcgaXMgd2VpZ2h0ZWQgdG93YXJkcyBiaWdnZXIgbGFncyAqLwotICAgICAgICAgICAgICAgIC8qIGFuZCByYW5kb20gdmFyaWF0aW9uIGlzIGFkZGVkICovCi0gICAgICAgICAgICAgICAgbGFnRGlmID0gc3ViX2ludDE2KGxhZ19oaXN0Mls0XSwgbGFnX2hpc3QyWzJdKTsKLQotICAgICAgICAgICAgICAgIGlmIChsYWdEaWYgPiA0MCkKLSAgICAgICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgICAgIGxhZ0RpZiA9IDQwOwotICAgICAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgICAgIEQgPSBub2lzZV9nZW5fYW1yd2Ioc2VlZCk7ICAgICAgICAgIC8qIEQ9ey0xLC4uLCAxfSAqLwotICAgICAgICAgICAgICAgIC8qIEQyPXstbGFnRGlmLzIuLmxhZ0RpZi8yfSAqLwotICAgICAgICAgICAgICAgIHRtcCA9IGxhZ0RpZiA+PiAxOwotICAgICAgICAgICAgICAgIEQyID0gbXVsdF9pbnQxNih0bXAsIEQpOwotICAgICAgICAgICAgICAgIHRtcCA9IGFkZF9pbnQxNihhZGRfaW50MTYobGFnX2hpc3QyWzJdLCBsYWdfaGlzdDJbM10pLCBsYWdf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1wMyk7Ci0gICAgICAgICAgICBMX3RtcDEgPSBmeHBfbWFjXzE2YnkxNih0bXAzLCBmaXJfN2tbaisyXSwgTF90bXAxKTsKLQotICAgICAgICAgICAgdG1wMSA9IHhbKGk8PDIpK2orM107Ci0gICAgICAgICAgICB0bXAyID0geFsoaTw8Mikrais0XTsKLQotICAgICAgICAgICAgTF90bXAyID0gZnhwX21hY18xNmJ5MTYodG1wMSwgZmlyXzdrW2orMl0sIExfdG1wMik7Ci0gICAgICAgICAgICBMX3RtcDQgPSBmeHBfbWFjXzE2YnkxNih0bXAxLCBmaXJfN2tbaiAgXSwgTF90bXA0KTsKLSAgICAgICAgICAgIExfdG1wMyA9IGZ4cF9tYWNfMTZieTE2KHRtcDEsIGZpcl83a1tqKzFdLCBMX3RtcDMpOwotICAgICAgICAgICAgTF90bXAxID0gZnhwX21hY18xNmJ5MTYodG1wMSwgZmlyXzdrW2orM10sIExfdG1wMSk7Ci0gICAgICAgICAgICBMX3RtcDIgPSBmeHBfbWFjXzE2YnkxNih0bXAyLCBmaXJfN2tbaiszXSwgTF90bXAyKTsKLSAgICAgICAgICAgIExfdG1wNCA9IGZ4cF9tYWNfMTZieTE2KHRtcDIsIGZpcl83a1tqKzFdLCBMX3RtcDQpOwotICAgICAgICAgICAgTF90bXAzID0gZnhwX21hY18xNmJ5MTYodG1wMiwgZmlyXzdrW2orMl0sIExfdG1wMyk7Ci0KLSAgICAgICAgICAgIHRtcDEgPSB4WyhpPDwyKStqKzVdOwotICAgICAgICAgICAgdG1wMiA9IHhbKGk8PDIpK2orNl07Ci0KLSAgICAgICAgICAgIExfdG1wNCA9IGZ4cF9tYWNfMTZieTE2KHRtcDEsIGZpcl83a1tqKzJdLCBMX3RtcDQpOwotICAgICAgICAgICAgTF90bXAzID0gZnhwX21hY18xNmJ5MTYodG1wMSwgZmlyXzdrW2orM10sIExfdG1wMyk7Ci0gICAgICAgICAgICBMX3RtcDQgPSBmeHBfbWFjXzE2YnkxNih0bXAyLCBma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tLS0tLS0tLS0tLS0KLTsgRlVOQ1RJT04gQ09ERQotLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSovCi0KLXZvaWQgbWltZV91bnNvcnRpbmcodWludDggdW5zb3J0ZWRfYml0c1tdLAotICAgICAgICAgICAgICAgICAgICBpbnQxNiBzb3J0ZWRfYml0c19pbnRvX2ludDE2W10sCi0gICAgICAgICAgICAgICAgICAgIGludDE2ICogZnJhbWVfdHlwZSwKLSAgICAgICAgICAgICAgICAgICAgaW50MTYgKiBtb2RlLAotICAgICAgICAgICAgICAgICAgICB1aW50OCBxdWFsaXR5LAotICAgICAgICAgICAgICAgICAgICBSWF9TdGF0ZV93YiAqc3QpCi17Ci0KLSAgICBpbnQxNiBpOwotICAgIGludDE2IGo7Ci0gICAgdWludDggdGVtcCA9IDA7Ci0gICAgdWludDggKnVuc29ydGVkX2JpdHNfcHRyID0gKHVpbnQ4Kil1bnNvcnRlZF9iaXRzOwotCi0gICAgLyogcG9pbnRlciB0YWJsZSBmb3IgYml0IHNvcnRpbmcgdGFibGVzICovCi0gICAgY29uc3QgaW50MTYgKkFtcldiU29ydGluZ1RhYmxlc1sxNl0gPQotICAgIHsKLSAgICAgICAgc29ydF82NjAsICAgc29ydF84ODUsIHNvcnRfMTI2NSwgc29ydF8xNDI1LAotICAgICAgICBzb3J0XzE1ODUsICBzb3J0XzE4MjUsIHNvcnRfMTk4NSwgc29ydF8yMzA1LAotICAgICAgICBzb3J0XzIzODUsICAgc29ydF9TSUQsICAgICAgTlVMTCwgICAgICBOVUxMLAotICAgICAgICBOVUxMLCAgICAgICBOVUxMLCAgICAgIE5VTEwsICAgICAgTlVMTAotICAgIH07Ci0KLSAgICBjb25zdCBpbnQxNiAqIHB0X0FtcldiU29ydGluZ1RhYmxlcyAgPSBBbXJXYlNvcnRpbmdUYWJsZXNbKm1vZGVdOwotCi0gICAgLyogY2xlYXIgY29tcHJlc3NlZCBzcGVlY2ggYml0IGJ1ZmZlciAqLwotICAgIHB2X21lbXNldChzb3J0ZWRfYml0c19pbnRvX2ludDE2LAotICAgICAgICAgICAgICAwLAotICAgICAgICAgICAgICB1bnBhY2tlZF9zaXplWyptb2RlXSpzaXplb2YoKnNvcnRlZF9iaXRzX2ludG9faW50MTYpKTsKLQotICAgIC8qIHVucGFjayBhbmQgdW5zb3J0IHNwZWVjaCBvciBTSUQgYml0cyAqLwotCi0KLSAgICBmb3IgKGkgPSB1bnBhY2tlZF9zaXplWyptb2RlXSA+PiAzOyBpICE9IDA7IGktLSkKLSAgICB7Ci0gICAgICAgIHRlbXAgPSAqKHVuc29ydGVkX2JpdHNfcHRyKyspOwotCi0gICAgICAgIGZvciAoaiA9IDI7IGogIT0gMDsgai0tKQotICAgICAgICB7Ci0gICAgICAgICAgICBzd2l0Y2ggKHRlbXAgJiAweGYwKQotICAgICAgICAgICAgewotICAgICAgICAgICAgICAgIGNhc2UgMHhmMDoKLSAgICAgICAgICAgICAgICAgICAgc29ydGVkX2JpdHNfaW50b19pbnQxNlsqKHB0X0FtcldiU29ydGluZ1RhYmxlcysrKV0gPSBCSVRfMTsKLSAgICAgICAgICAgICAgICAgICAgc29ydGVkX2JpdHNfaW50b19pbnQxNlsqKHB0X0FtcldiU29ydGluZ1RhYmxlcysrKV0gPSBCSVRfMTsKLSAgICAgICAgICAgICAgICAgICAgc29ydGVkX2JpdHNfaW50b19pbnQxNlsqKHB0X0FtcldiU29ydGluZ1RhYmxlcysrKV0gPSBCSVRfMTsKLSAgICAgICAgICAgICAgICAgICAgc29ydGVkX2JpdHNfaW50b19pbnQxNlsqKHB0X0FtcldiU29ydGluZ1RhYmxlcysrKV0gPSBCSVRfMTsKLSAgICAgICAgICAgICAgICAgICAgYnJlYWs7Ci0gICAgICAgICAgICAgICAgY2FzZSAweGUwOgotICAgICAgICAgICAgICAgICAgICBzb3J0ZWRfYml0c19pbnRvX2ludDE2WyoocHRfQW1yV2JTb3J0aW5nVGFibGVzKyspXSA9IEJJVF8xOwotICAgICAgICAgICAgICAgICAgICBzb3J0ZWRfYml0c19pbnRvX2ludDE2WyoocHRfQW1yV2JTb3J0aW5nVGFibGVzKyspXSA9IEJJVF8xOwotICAgICAgICAgICAgICAgICAgICBzb3J0ZWRfYml0c19pbnRvX2ludDE2WyoocHRfQW1yV2JTb3J0aW5nVGFibGVzKyspXSA9IEJJVF8xOwotICAgICAgICAgICAgICAgICAgICBwdF9BbXJXYlNvcnRpbmdUYWJsZXMrKzsKLSAgICAgICAgICAgICAgICAgICAgYnJlYWs7Ci0gICAgICAgICAgICAgICAgY2FzZSAweGQwOgotICAgICAgICAgICAgICAgICAgICBzb3J0ZWRfYml0c19pbnRvX2ludDE2WyoocHRfQW1yV2JTb3J0aW5nVGFibGVzKyspXSA9IEJJVF8xOwotICAgICAgICAgICAgICAgICAgICBzb3J0ZWRfYml0c19pbnRvX2ludDE2WyoocHRfQW1yV2JTb3J0aW5nVGFibGVzKyspXSA9IEJJVF8xOwotICAgICAgICAgICAgICAgICAgICBwdF9BbXJXYlNvcnRpbmdUYWJsZXMrKzsKLSAgICAgICAgICAgICAgICAgICAgc29ydGVkX2JpdHNfaW50b19pbnQxNlsqKHB0X0FtcldiU29ydGluZ1RhYmxlcysrKV0gPSBCSVRfMTsKLSAgICAgICAgICAgICAgICAgICAgYnJlYWs7Ci0gICAgICAgICAgICAgICAgY2FzZSAweGMwOgotICAgICAgICAgICAgICAgICAgICBzb3J0ZWRfYml0c19pbnRvX2ludDE2WyoocHRfQW1yV2JTb3J0aW5nVGFibGVzKyspXSA9IEJJVF8xOwotICAgICAgICAgICAgICAgICAgICBzb3J0ZWRfYml0c19pbnRvX2ludDE2WyoocHRfQW1yV2JTb3J0aW5nVGFibGVzKyspXSA9IEJJVF8xOwotICAgICAgICAgICAgICAgICAgICBwdF9BbXJXYlNvcnRpbmdUYWJsZXMgKz0gMjsKLSAgICAgICAgICAgICAgICAgICAgYnJlYWs7Ci0gICAgICAgICAgICAgICAgY2FzZSAweGIwOgotICAgICAgICAgICAgICAgICAgICBzb3J0ZWRfYml0c19pbnRvX2ludDE2WyoocHRfQW1yV2JTb3J0aW5nVGFibGVzKyspXSA9IEJJVF8xOwotICAgICAgICAgICAgICAgICAgICBwdF9BbXJXYlNvcnRpbmdUYWJsZXMrKzsKLSAgICAgICAgICAgICAgICAgICAgc29ydGVkX2JpdHNfaW50b19pbnQxNlsqKHB0X0FtcldiU29ydGluZ1RhYmxlcysrKV0gPSBCSVRfMTsKLSAgICAgICAgICAgICAgICAgICAgc29ydGVkX2JpdHNfaW50b19pbnQxNlsqKHB0X0FtcldiU29ydGluZ1RhYmxlcysrKV0gPSBCSVRfMTsKLSAgICAgICAgICAgICAgICAgICAgYnJlYWs7Ci0gICAgICAgICAgICAgICAgY2FzZSAweGEwOgotICAgICAgICAgICAgICAgICAgICBzb3J0ZWRfYml0c19pbnRvX2ludDE2WyoocHRfQW1yV2JTb3J0aW5nVGFibGVzKyspXSA9IEJJVF8xOwotICAgICAgICAgICAgICAgICAgICBwdF9BbXJXYlNvcnRpbmdUYWJsZXMrKzsKLSAgICAgICAgICAgICAgICAgICAgc29ydGVkX2JpdHNfaW50b19pbnQxNlsqKHB0X0FtcldiU29ydGluZ1RhYmxlcysrKV0gPSBCSVRfMTsKLSAgICAgICAgICAgICAgICAgICAgcHRfQW1yV2JTb3J0aW5nVGFibGVzKys7Ci0gICAgICAgICAgICAgICAgICAgIGJyZWFrOwotICAgICAgICAgICAgICAgIGNhc2UgMHg5MDoKLSAgICAgICAgICAgICAgICAgICAgc29ydGVkX2JpdHNfaW50b19pbnQxNlsqKHB0X0FtcldiU29ydGluZ1RhYmxlcysrKV0gPSBCSVRfMTsKLSAgICAgICAgICAgICAgICAgICAgcHRfQW1yV2JTb3J0aW5nVGFibGVzICs9IDI7Ci0gICAgICAgICAgICAgICAgICAgIHNvcnRlZF9iaXRzX2ludG9faW50MTZbKihwdF9BbXJXYlNvcnRpbmdUYWJsZXMrKyldID0gQklUXzE7Ci0gICAgICAgICAgICAgICAgICAgIGJyZWFrOwotICAgICAgICAgICAgICAgIGNhc2UgMHg4MDoKLSAgICAgICAgICAgICAgICAgICAgc29ydGVkX2JpdHNfaW50b19pbnQxNlsqKHB0X0FtcldiU29ydGluZ1RhYmxlcysrKV0gPSBCSVRfMTsKLSAgICAgICAgICAgICAgICAgICAgcHRfQW1yV2JTb3J0aW5nVGFibGVzICs9IDM7Ci0gICAgICAgICAgICAgICAgICAgIGJyZWFrOwotICAgICAgICAgICAgICAgIGNhc2UgMHg3MDoKLSAgICAgICAgICAgICAgICAgICAgcHRfQW1yV2JTb3J0aW5nVGFibGVzKys7Ci0gICAgICAgICAgICAgICAgICAgIHNvcnRlZF9iaXRzX2ludG9faW50MTZbKihwdF9BbXJXYlNvcnRpbmdUYWJsZXMrKyldID0gQklUXzE7Ci0gICAgICAgICAgICAgICAgICAgIHNvcnRlZF9iaXRzX2ludG9faW50MTZbKihwdF9BbXJXYlNvcnRpbmdUYWJsZXMrKyldID0gQklUXzE7Ci0gICAgICAgICAgICAgICAgICAgIHNvcnRlZF9iaXRzX2ludG9faW50MTZbKihwdF9BbXJXYlNvcnRpbmdUYWJsZXMrKyldID0gQklUXzE7Ci0gICAgICAgICAgICAgICAgICAgIGJyZWFrOwotICAgICAgICAgICAgICAgIGNhc2UgMHg2MDoKLSAgICAgICAgICAgICAgICAgICAgcHRfQW1yV2JTb3J0aW5nVGFibGVzKys7Ci0gICAgICAgICAgICAgICAgICAgIHNvcnRlZF9iaXRzX2ludG9faW50MTZbKihwdF9BbXJXYlNvcnRpbmdUYWJsZXMrKyldID0gQklUXzE7Ci0gICAgICAgICAgICAgICAgICAgIHNvcnRlZF9iaXRzX2ludG9faW50MTZbKihwdF9BbXJXYlNvcnRpbmdUYWJsZXMrKyldID0gQklUXzE7Ci0gICAgICAgICAgICAgICAgICAgIHB0X0FtcldiU29ydGluZ1RhYmxlcysrOwotICAgICAgICAgICAgICAgICAgICBicmVhazsKLSAgICAgICAgICAgICAgICBjYXNlIDB4NTA6Ci0gICAgICAgICAgICAgICAgICAgIHB0X0FtcldiU29ydGluZ1RhYmxlcysrOwotICAgICAgICAgICAgICAgICAgICBzb3J0ZWRfYml0c19pbnRvX2ludDE2WyoocHRfQW1yV2JTb3J0aW5nVGFibGVzKyspXSA9IEJJVF8xOwotICAgICAgICAgICAgICAgICAgICBwdF9BbXJXYlNvcnRpbmdUYWJsZXMrKzsKLSAgICAgICAgICAgICAgICAgICAgc29ydGVkX2JpdHNfaW50b19pbnQxNlsqKHB0X0FtcldiU29ydGluZ1RhYmxlcysrKV0gPSBCSVRfMTsKLSAgICAgICAgICAgICAgICAgICAgYnJlYWs7Ci0gICAgICAgICAgICAgICAgY2FzZSAweDQwOgotICAgICAgICAgICAgICAgICAgICBwdF9BbXJXYlNvcnRpbmdUYWJsZXMrKzsKLSAgICAgICAgICAgICAgICAgICAgc29ydGVkX2JpdHNfaW50b19pbnQxNlsqKHB0X0FtcldiU29ydGluZ1RhYmxlcysrKV0gPSBCSVRfMTsKLSAgICAgICAgICAgICAgICAgICAgcHRfQW1yV2JTb3J0aW5nVGFibGVzICs9IDI7Ci0gICAgICAgICAgICAgICAgICAgIGJyZWFrOwotICAgICAgICAgICAgICAgIGNhc2UgMHgzMDoKLSAgICAgICAgICAgICAgICAgICAgcHRfQW1yV2JTb3J0aW5nVGFibGVzICs9IDI7Ci0gICAgICAgICAgICAgICAgICAgIHNvcnRlZF9iaXRzX2ludG9faW50MTZbKihwdF9BbXJXYlNvcnRpbmdUYWJsZXMrKyldID0gQklUXzE7Ci0gICAgICAgICAgICAgICAgICAgIHNvcnRlZF9iaXRzX2ludG9faW50MTZbKihwdF9BbXJXYlNvcnRpbmdUYWJsZXMrKyldID0gQklUXzE7Ci0gICAgICAgICAgICAgICAgICAgIGJyZWFrOwotICAgICAgICAgICAgICAgIGNhc2UgMHgyMDoKLSAgICAgICAgICAgICAgICAgICAgcHRfQW1yV2JTb3J0aW5nVGFibGVzICs9IDI7Ci0gICAgICAgICAgICAgICAgICAgIHNvcnRlZF9iaXRzX2ludG9faW50MTZbKihwdF9BbXJXYlNvcnRpbmdUYWJsZXMrKyldID0gQklUXzE7Ci0gICAgICAgICAgICAgICAgICAgIHB0X0FtcldiU29ydGluZ1RhYmxlcysrOwotICAgICAgICAgICAgICAgICAgICBicmVhazsKLSAgICAgICAgICAgICAgICBjYXNlIDB4MTA6Ci0gICAgICAgICAgICAgICAgICAgIHB0X0FtcldiU29ydGluZ1RhYmxlcyArPSAzOwotICAgICAgICAgICAgICAgICAgICBzb3J0ZWRfYml0c19pbnRvX2ludDE2WyoocHRfQW1yV2JTb3J0aW5nVGFibGVzKyspXSA9IEJJVF8xOwotICAgICAgICAgICAgICAgICAgICBicmVhazsKLSAgICAgICAgICAgICAgICBkZWZhdWx0OgotICAgICAgICAgICAgICAgICAgICBwdF9BbXJXYlNvcnRpbmdUYWJsZXMgKz0gNDsKLSAgICAgICAgICAgICAgICAgICAgYnJlYWs7Ci0gICAgICAgICAgICB9Ci0gICAgICAgICAgICB0ZW1wIDw8PSA0OwotICAgICAgICB9Ci0gICAgfQotCi0gICAgaWYgKHVucGFja2VkX3NpemVbKm1vZGVdICUgNCkKLSAgICB7Ci0gICAgICAgIHRlbXAgPDw9IDE7Ci0KLSAgICAgICAgaWYgKHRlbXAgJiAweDgwKQotICAgICAgICB7Ci0gICAgICAgICAgICBzb3J0ZWRfYml0c19pbnRvX2ludDE2WyoocHRfQW1yV2JTb3J0aW5nVGFibGVzKyspXSA9IEJJVF8xOwotICAgICAgICB9Ci0gICAgfQotCi0gICAgLyogc2V0IGZyYW1lIHR5cGUgKi8KLSAgICBzd2l0Y2ggKCptb2RlKQotICAgIHsKLSAgICAgICAgY2FzZSBNT0RFXzdrOgotICAgICAgICBjYXNlIE1PREVfOWs6Ci0gICAgICAgIGNhc2UgTU9ERV8xMms6Ci0gICAgICAgIGNhc2UgTU9ERV8xNGs6Ci0gICAgICAgIGNhc2UgTU9ERV8xNms6Ci0gICAgICAgIGNhc2UgTU9ERV8xOGs6Ci0gICAgICAgIGNhc2UgTU9ERV8yMGs6Ci0gICAgICAgIGNhc2UgTU9ERV8yM2s6Ci0gICAgICAgIGNhc2UgTU9ERV8yNGs6Ci0gICAgICAgICAgICBpZiAocXVhbGl0eSkKLSAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAqZnJhbWVfdHlwZSA9IFJYX1NQRUVDSF9HT09EOwotICAgICAgICAgICAgfQotICAgICAgICAgICAgZWxzZQotICAgICAgICAgICAgewotICAgICAgICAgICAgICAgICpmcmFtZV90eXBlID0gUlhfU1BFRUNIX0JBRDsKLSAgICAgICAgICAgIH0KLSAgICAgICAgICAgIGJyZWFrOwotCi0gICAgICAgIGNhc2UgTVJTSUQ6Ci0gICAgICAgICAgICBpZiAocXVhbGl0eSkKLSAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICBpZiAodGVtcCAmIDB4ODApCi0gICAgICAgICAgICAgICAgewotICAgICAgICAgICAgICAgICAgICAqZnJhbWVfdHlwZSA9IFJYX1NJRF9VUERBVEU7Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgIGVsc2UKLSAgICAgICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgICAgICpmcmFtZV90eXBlID0gUlhfU0lEX0ZJUlNUOwotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgIH0KLSAgICAgICAgICAgIGVsc2UKLSAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAqZnJhbWVfdHlwZSA9IFJYX1NJRF9CQUQ7Ci0gICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgIC8qIHNldCBtb2RlIGluZGV4ICovCi0gICAgICAgICAgICAqbW9kZSA9IHN0LT5wcmV2X21vZGU7Ci0gICAgICAgICAgICBicmVhazsKLSAgICAgICAgY2FzZSAxNDogICAgICAgIC8qIFNQRUVDSF9MT1NUICov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OX0xPT1BfQ09FRl9VUCAgICA0Ci0KLS8qLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLQotOyBMT0NBTCBGVU5DVElPTiBERUZJTklUSU9OUwotOyBGdW5jdGlvbiBQcm90b3R5cGUgZGVjbGFyYXRpb24KLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0qLwotCi0jaWZkZWYgX19jcGx1c3BsdXMKLWV4dGVybiAiQyIKLXsKLSNlbmRpZgotCi0KLSAgICAvKiBMb2NhbCBmdW5jdGlvbnMgKi8KLQotICAgIHZvaWQgQW1yV2JVcF9zYW1wKAotICAgICAgICBpbnQxNiAqIHNpZ19kLCAgICAgICAgICAgICAgICAgICAgICAgLyogaW5wdXQ6ICBzaWduYWwgdG8gb3ZlcnNhbXBsaW5nICAqLwotICAgICAgICBpbnQxNiAqIHNpZ191LCAgICAgICAgICAgICAgICAgICAgICAgLyogb3V0cHV0OiBvdmVyc2FtcGxlZCBzaWduYWwgICAgICAqLwotICAgICAgICBpbnQxNiBMX2ZyYW1lICAgICAgICAgICAgICAgICAgICAgICAgLyogaW5wdXQ6ICBsZW5ndGggb2Ygb3V0cHV0ICAgICAgICAqLwotICAgICk7Ci0KLQotICAgIGludDE2IEFtcldiSW50ZXJwb2woICAgICAgICAgICAgICAgICAgICAgIC8qIHJldHVybiByZXN1bHQgb2YgaW50ZXJwb2xhdGlvbiAqLwotICAgICAgICBpbnQxNiAqIHgsICAgICAgICAgICAgICAgICAgICAgICAgICAgLyogaW5wdXQgdmVjdG9yICAgICAgICAgICAgICAgICAgICovCi0gICAgICAgIGNvbnN0IGludDE2ICogZmlyLCAgICAgICAgICAgICAgICAgICAvKiBmaWx0ZXIgY29lZmZpY2llbnQgICA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ywgICAgICAtMTYwLCAgICAgICAgOTYsICAgICAgIC01MiwgICAgICAgIDIzLCAgICAgICAgLTYsCi0gICAgfSwKLSAgICB7Ci0gICAgICAgIC00LCAgICAgICAgMjQsICAgICAgIC02MiwgICAgICAgMTI0LCAgICAgIC0yMTMsICAgICAgIDMzOCwKLSAgICAgICAgLTUxMCwgICAgICAgNzUyLCAgICAgLTExMTEsICAgICAgMTcwOCwgICAgIC0yOTc0LCAgICAgIDgyMTksCi0gICAgICAgIDEyMzY4LCAgICAgLTM0MzIsICAgICAgMTg4MSwgICAgIC0xMjA0LCAgICAgICA4MTIsICAgICAgLTU1MiwKLSAgICAgICAgMzY4LCAgICAgIC0yMzUsICAgICAgIDEzOSwgICAgICAgLTczLCAgICAgICAgMzAsICAgICAgICAtNywKLSAgICB9LAotICAgIHsKLSAgICAgICAgLTcsICAgICAgICAzMCwgICAgICAgLTczLCAgICAgICAxMzksICAgICAgLTIzNSwgICAgICAgMzY4LAotICAgICAgICAtNTUyLCAgICAgICA4MTIsICAgICAtMTIwNCwgICAgICAxODgxLCAgICAgLTM0MzIsICAgICAxMjM2OCwKLSAgICAgICAgODIxOSwgICAgIC0yOTc0LCAgICAgIDE3MDgsICAgICAtMTExMSwgICAgICAgNzUyLCAgICAgIC01MTAsCi0gICAgICAgIDMzOCwgICAgICAtMjEzLCAgICAgICAxMjQsICAgICAgIC02MiwgICAgICAgIDI0LCAgICAgICAgLTQsCi0gICAgfSwKLSAgICB7Ci0gICAgICAgIC02LCAgICAgICAgMjMsICAgICAgIC01MiwgICAgICAgIDk2LCAgICAgIC0xNjAsICAgICAgIDI0NywKLSAgICAgICAgLTM2OSwgICAgICAgNTQyLCAgICAgIC04MDksICAgICAgMTI4OCwgICAgIC0yNDk2LCAgICAgMTUzMTcsCi0gICAgICAgIDM3OTIsICAgICAtMTYxNiwgICAgICAgOTYzLCAgICAgIC02MzQsICAgICAgIDQzMCwgICAgICAtMjkxLAotICAgICAgICAxOTEsICAgICAgLTExOSwg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LSAgICBpbnQxNiAqIHB0X3NpZ191ID0gc2lnX3U7Ci0KLSAgICBmcmFjID0gMTsKLSAgICBmb3IgKGogPSAwOyBqIDwgTF9mcmFtZTsgaisrKQotICAgIHsKLSAgICAgICAgaSA9ICgoaW50MzIpaiAqIElOVl9GQUM1KSA+PiAxMzsgICAgICAgLyogaW50ZWdlciBwYXJ0ID0gcG9zICogMS81ICovCi0KLSAgICAgICAgZnJhYy0tOwotICAgICAgICBpZiAoZnJhYykKLSAgICAgICAgewotICAgICAgICAgICAgKihwdF9zaWdfdSsrKSA9IEFtcldiSW50ZXJwb2woJnNpZ19kW2ldLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZmlyX3VwWyhGQUM1LTEpIC0gZnJhY10sCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBOX0xPT1BfQ09FRl9VUCk7Ci0gICAgICAgIH0KLSAgICAgICAgZWxzZQotICAgICAgICB7Ci0gICAgICAgICAgICAqKHB0X3NpZ191KyspID0gc2lnX2RbaSsxMiAtIE5CX0NPRUZfVVAgXTsKLSAgICAgICAgICAgIGZyYWMgPSBGQUM1OwotICAgICAgICB9Ci0gICAgfQotCi19Ci0KLS8qLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLQotOyBGVU5DVElPTiBDT0RFCi0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tKi8KLQotCi0vKiBGcmFjdGlvbmFsIGludGVycG9sYXRpb24gb2Ygc2lnbmFsIGF0IHBvc2l0aW9uIChmcmFjL3Jlc29sKSAqLwotCi0KLWludDE2IEFtcldiSW50ZXJwb2woICAgICAgICAgICAgICAgICAgICAgIC8qIHJldHVybiByZXN1bHQgb2YgaW50ZXJwb2xhdGlvbiAqLwotICAgIGludDE2ICogeCwgICAgICAgICAgICAgICAgICAgICAgICAgICAvKiBpbnB1dCB2ZWN0b3IgICAgICAgICAgICAgICAgICAgKi8KLSAgICBjb25zdCBpbnQxNiAqZmlyLCAgICAgICAgICAgICAgICAgICAgLyogZmlsdGVyIGNvZWZmaWNpZW50ICAgICAgICAgICAgICovCi0gICAgaW50MTYgbmJfY29lZiAgICAgICAgICAgICAgICAgICAgICAgIC8qIG51bWJlciBvZiBjb2VmZmljaWVudHMgICAgICAgICAqLwotKQotewotICAgIGludDMyIExfc3VtOwotICAgIGNvbnN0IGludDE2ICpwdF9maXIgPSBmaXI7Ci0KLSAgICBpbnQxNiB0bXAxLCB0bXAyLCB0bXAzLCB0bXA0OwotICAgIGludDE2ICpwdF94ID0geCAtIG5iX2NvZWYgLSAobmJfY29lZiA8PCAxKSArIDE7Ci0KLQotICAgIHRtcDEgPSAqKHB0X3grKyk7Ci0gICAgdG1wMiA9ICoocHRfeCsrKTsKLSAgICB0bXAzID0gKihwdF94KyspOwotICAgIHRtcDQgPSAqKHB0X3grKyk7Ci0gICAgTF9zdW0gPSBmeHBfbWFjXzE2YnkxNih0bXAxLCAqKHB0X2ZpcisrKSwgMHgwMDAwMjAwMEwpOwotICAgIExfc3VtID0gZnhwX21hY18xNmJ5MTYodG1wMiwgKihwdF9maXIrKyksIExfc3VtKTsKLSAgICBMX3N1bSA9IGZ4cF9tYWNfMTZieTE2KHRtcDMsICoocHRfZmlyKyspLCBMX3N1bSk7Ci0gICAgTF9zdW0gPSBmeHBfbWFjXzE2YnkxNih0bXA0LCAqKHB0X2ZpcisrKSwgTF9zdW0pOwotICAgIHRtcDEgPSAqKHB0X3grKyk7Ci0gICAgdG1wMiA9ICoocHRfeCsrKTsKLSAgICB0bXAzID0gKihwdF94KyspOwotICAgIHRtcDQgPSAqKHB0X3grKyk7Ci0gICAgTF9zdW0gPSBmeHBfbWFjXzE2YnkxNih0bXA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dhaW5fcGl0OwotCi0gICAgaWYgKHN1Yl9pbnQxNihnYWluX2NvZGUsICpwcmV2X2dhaW5fY29kZSkgPiBzaGxfaW50MTYoKnByZXZfZ2Fpbl9jb2RlLCAxKSkKLSAgICB7Ci0gICAgICAgIC8qIG9uc2V0ICovCi0gICAgICAgIGlmIChzdGF0ZSA8IDIpCi0gICAgICAgIHsKLSAgICAgICAgICAgIHN0YXRlKys7Ci0gICAgICAgIH0KLSAgICB9Ci0gICAgZWxzZQotICAgIHsKLSAgICAgICAgaiA9IDA7Ci0gICAgICAgIGZvciAoaSA9IDA7IGkgPCA2OyBpKyspCi0gICAgICAgIHsKLSAgICAgICAgICAgIGlmIChwcmV2X2dhaW5fcGl0W2ldIDwgcGl0Y2hfMF82KQotICAgICAgICAgICAgewotICAgICAgICAgICAgICAgIGorKzsKLSAgICAgICAgICAgIH0KLSAgICAgICAgfQotCi0gICAgICAgIGlmIChqID4gMikKLSAgICAgICAgewotICAgICAgICAgICAgc3RhdGUgPSAwOwotICAgICAgICB9Ci0gICAgICAgIGlmIChzdGF0ZSA+ICpwcmV2X3N0YXRlICsgMSkKLSAgICAgICAgewotICAgICAgICAgICAgc3RhdGUtLTsKLSAgICAgICAgfQotICAgIH0KLQotICAgICpwcmV2X2dhaW5fY29kZSA9IGdhaW5fY29kZTsKLSAgICAqcHJldl9zdGF0ZSA9IHN0YXRlOwotCi0gICAgLyogY2lyY3VsYXIgY29udm9sdXRpb24gKi8KLQotICAgIHN0YXRlICs9IG1vZGU7ICAgICAgICAgICAgICAvKiBsZXZlbCBvZiBkaXNwZXJzaW9uICovCi0KLSAgICBpZiAoc3RhdGUgPT0gMCkKLSAgICB7Ci0gICAgICAgIGZvciAoaSA9IDA7IGkgPCBMX1NVQkZSOyBpKyspCi0gICAgICAgIHsKLSAgICAgICAgICAgIGlmIChjb2RlW2ldICE9IDApCi0gICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgZm9yIChqID0gMDsgaiA8IExfU1VCRlI7IGorKykKLSAgICAgICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgICAgIGNvZGUyW2kgKyBqXSA9IGFkZF9pbnQxNihjb2RlMltpICsgal0sIG11bHRfaW50MTZfcihjb2RlW2ldLCBwaF9pbXBfbG93W2pdKSk7Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgfQotICAgICAgICB9Ci0gICAgfQotICAgIGVsc2UgaWYgKHN0YXRlID09IDEpCi0gICAgewotICAgICAgICBmb3IgKGkgPSAwOyBpIDwgTF9TVUJGUjsgaSsrKQotICAgICAgICB7Ci0gICAgICAgICAgICBpZiAoY29kZVtpXSAhPSAwKQotICAgICAgICAgICAgewotICAgICAgICAgICAgICAgIGZvciAoaiA9IDA7IGogPCBMX1NVQkZSOyBqKyspCi0gICAgICAgICAgICAgICAgewotICAgICAgICAgICAgICAgICAgICBjb2RlMltpICsgal0gPSBhZGRfaW50MTYoY29kZTJbaSArIGpdLCBtdWx0X2ludDE2X3IoY29kZVtpXSwgcGhfaW1wX21pZFtqXSkpOwotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgIH0KLSAgICAgICAgfQotICAgIH0KLSAgICBpZiAoc3RhdGUgPCAyKQotICAgIHsKLSAgICAgICAgZm9yIChpID0gMDsgaSA8IExfU1VCRlI7IGkrKykKLSAgICAgICAgewotICAgICAgICAgICAgY29kZVtpXSA9IGFkZF9pbnQxNihjb2RlMltpXSwgY29kZTJbaSArIExfU1VCRlJdKTsKLSAgICAgICAgfQotICAgIH0KLSAgICByZXR1cm47Ci19Ci0KZGlmZiAtLWdpdCBhL21lZGlhL2xpYnN0YWdlZnJpZ2h0L2NvZGVjcy9hbXJ3Yi9zcmMvcGl0X3NocnAuY3BwIGIvbWVkaWEvbGlic3RhZ2VmcmlnaHQvY29kZWNzL2FtcndiL3NyYy9waXRfc2hycC5jcHAKZGVsZXRlZCBmaWxlIG1vZGUgMTAwNjQ0CmluZGV4IDRiZmNmOWMuLjAwMDAwMDAKLS0tIG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2OTksICAgIC0yNTk4LCAgICAgNTUzMSwgICAgMTQwMzEsICAgIC0yMTQ3LAotICAgICAgICA3ODAsICAgICAtMjQ5LCAgICAgIC0xNiwgICAgICAxNTMsICAgICAtMjEzLCAgICAgIDIyNiwKLSAgICAgICAgLTIwOSwgICAgICAxNzUsICAgICAtMTMzLCAgICAgICA5MSwgICAgICAtNTUsICAgICAgIDI4LAotICAgICAgICAtMTAsICAgICAgICAyCi0gICAgfSwKLSAgICB7Ci0gICAgICAgIDEsICAgICAgIC03LCAgICAgICAxOSwgICAgICAtMzMsICAgICAgIDQ3LCAgICAgIC01MiwKLSAgICAgICAgNDMsICAgICAgIC05LCAgICAgIC02MCwgICAgICAxNzUsICAgICAtMzU1LCAgICAgIDYyNiwKLSAgICAgICAgLTEwNDQsICAgICAxNzQ5LCAgICAtMzI2NywgICAgMTAzNTksICAgIDEwMzU5LCAgICAtMzI2NywKLSAgICAgICAgMTc0OSwgICAgLTEwNDQsICAgICAgNjI2LCAgICAgLTM1NSwgICAgICAxNzUsICAgICAgLTYwLAotICAgICAgICAtOSwgICAgICAgNDMsICAgICAgLTUyLCAgICAgICA0NywgICAgICAtMzMsICAgICAgIDE5LAotICAgICAgICAtNywgICAgICAgIDEKLSAgICB9LAotICAgIHsKLSAgICAgICAgMiwgICAgICAtMTAsICAgICAgIDI4LCAgICAgIC01NSwgICAgICAgOTEsICAgICAtMTMzLAotICAgICAgICAxNzUsICAgICAtMjA5LCAgICAgIDIyNiwgICAgIC0yMTMsICAgICAgMTUzLCAgICAgIC0xNiwKLSAgICAgICAgLTI0OSwgICAgICA3ODAsICAgIC0yMTQ3LCAgICAxNDAzMSwgICAgIDU1MzEsICAgIC0yNTk4LAotICAgICAgICAxNjk5LCAgICAtMTIwNywgICAgICA4NzEsICAgICAtNjE5LCAgICAgIDQyNCwgICAgIC0yNzUsCi0gICAgICAgIDE2NSwgICAgICAtODgsICAgICAgIDM4LCAgICAgIC0xMCwgICAgICAgLTIsICAgICAgICA0LA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hcnIgPj4gMzEpIF4gTUFYXzE2OwotICAgIH0KLQotICAgIHJldHVybiAoKGludDE2KUxfcHJvZHVjdF9hcnIpOwotfQotCi0KLQotLyotLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tCi0KLSAgICAgRnVuY3Rpb24gTmFtZSA6IHNocl9ybmQKLQotICAgICBQdXJwb3NlIDoKLQotICAgICBTYW1lIGFzIHNocih2YXIxLHZhcjIpIGJ1dCB3aXRoIHJvdW5kaW5nLiBTYXR1cmF0ZSB0aGUgcmVzdWx0IGluIGNhc2Ugb2Z8Ci0gICAgIHVuZGVyZmxvd3Mgb3Igb3ZlcmZsb3dzIDoKLSAgICAgIC0gSWYgdmFyMiBpcyBncmVhdGVyIHRoYW4gemVybyA6Ci0gICAgICAgICAgICBpZiAoc3ViKHNobF9pbnQxNihzaHIodmFyMSx2YXIyKSwxKSxzaHIodmFyMSxzdWIodmFyMiwxKSkpKQotICAgICAgICAgICAgaXMgZXF1YWwgdG8gemVybwotICAgICAgICAgICAgICAgICAgICAgICB0aGVuCi0gICAgICAgICAgICAgICAgICAgICAgIHNocl9ybmQodmFyMSx2YXIyKSA9IHNocih2YXIxLHZhcjIpCi0gICAgICAgICAgICAgICAgICAgICAgIGVsc2UKLSAgICAgICAgICAgICAgICAgICAgICAgc2hyX3JuZCh2YXIxLHZhcjIpID0gYWRkX2ludDE2KHNocih2YXIxLHZhcjIpLDEpCi0gICAgICAtIElmIHZhcjIgaXMgbGVzcyB0aGFuIG9yIGVxdWFsIHRvIHplcm8gOgotICAgICAgICAgICAgICAgICAgICAgICBzaHJfcm5kKHZhcjEsdmFyMikgPSBzaHIodmFyMSx2YXIyKS4KLQotICAgICBDb21wbGV4aXR5IHdlaWdodCA6IDIKLQotICAgICBJbnB1dHMgOgotCi0gICAgICB2YXIxCi0gICAgICAgICAgICAgICAxNiBiaXQg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bm9tIDw8IDIpOwotICAgICAgICAgICAgZm9yIChpdGVyYXRpb24gPSA1OyBpdGVyYXRpb24gPiAwOyBpdGVyYXRpb24tLSkKLSAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICB2YXJfb3V0IDw8PSAzOwotICAgICAgICAgICAgICAgIExfbnVtICAgPDw9IDM7Ci0KLSAgICAgICAgICAgICAgICBpZiAoTF9udW0gPj0gTF9kZW5vbV9ieV80KQotICAgICAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAgICAgTF9udW0gLT0gTF9kZW5vbV9ieV80OwotICAgICAgICAgICAgICAgICAgICB2YXJfb3V0IHw9IDQ7Ci0gICAgICAgICAgICAgICAgfQotCi0gICAgICAgICAgICAgICAgaWYgKExfbnVtID49IExfZGVub21fYnlfMikKLSAgICAgICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgICAgIExfbnVtIC09IExfZGVub21fYnlfMjsKLSAgICAgICAgICAgICAgICAgICAgdmFyX291dCB8PSAgMjsKLSAgICAgICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgICAgICBpZiAoTF9udW0gPj0gKExfZGVub20pKQotICAgICAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAgICAgTF9udW0gLT0gKExfZGVub20pOwotICAgICAgICAgICAgICAgICAgICB2YXJfb3V0IHw9ICAxOwotICAgICAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgfQotICAgICAgICB9Ci0gICAgICAgIGVsc2UKLSAgICAgICAgewotICAgICAgICAgICAgdmFyX291dCA9IE1BWF8xNjsKLSAgICAgICAgfQotICAgIH0KLQotICAgIHJldHVybiAodmFyX291dCk7Ci0KLX0KLQotCi0KLS8qLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLQotCi0gICAgIEZ1bmN0aW9uIE5hbWUgOiBvbmVfb3Zfc3FydAotCi0g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ub3JtYWxpemVkIChpbiBRMzEpIHdpdGggZXhwb25lbnQgKDAuLjMwKS4KLSAqCi0gKiAgQWxnb3JpdGhtOgotICoKLSAqICAgICAgIGRvdF9wcm9kdWN0ID0gc3VtKHhbaV0qeVtpXSkgICAgIGk9MC4uTi0xCi0gLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSovCi0KLWludDMyIERvdF9wcm9kdWN0MTIoICAgLyogKG8pIFEzMTogbm9ybWFsaXplZCByZXN1bHQgKDEgPCB2YWwgPD0gLTEpICovCi0gICAgaW50MTYgeFtdLCAgICAgICAgLyogKGkpIDEyYml0czogeCB2ZWN0b3IgICAgICAgICAgICAgICAgICAgICAgICovCi0gICAgaW50MTYgeVtdLCAgICAgICAgLyogKGkpIDEyYml0czogeSB2ZWN0b3IgICAgICAgICAgICAgICAgICAgICAgICovCi0gICAgaW50MTYgbGcsICAgICAgICAgLyogKGkpICAgIDogdmVjdG9yIGxlbmd0aCAgICAgICAgICAgICAgICAgICAgICovCi0gICAgaW50MTYgKiBleHAgICAgICAgLyogKG8pICAgIDogZXhwb25lbnQgb2YgcmVzdWx0ICgwLi4rMzApICAgICAgICovCi0pCi17Ci0gICAgaW50MTYgaSwgc2Z0OwotICAgIGludDMyIExfc3VtOwotICAgIGludDE2ICpwdF94ID0geDsKLSAgICBpbnQxNiAqcHRfeSA9IHk7Ci0KLSAgICBMX3N1bSA9IDFMOwotCi0KLSAgICBmb3IgKGkgPSBsZyA+PiAzOyBpICE9IDA7IGktLSkKLSAgICB7Ci0gICAgICAgIExfc3VtID0gbWFjXzE2YnkxNl90b19pbnQzMihMX3N1bSwgKihwdF94KyspLCAqKHB0X3krKykpOwotICAgICAgICBMX3N1bSA9IG1hY18xNmJ5MTZfdG9faW50MzIoTF9zdW0sICoocHRfeCsrKSwgKihwdF95KyspKTsKLSAgICAgICAgTF9z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0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSovCi12b2lkIExnMl9ub3JtYWxpemVkKAotICAgIGludDMyIExfeCwgICAgICAgICAvKiAoaSkgOiBpbnB1dCB2YWx1ZSAobm9ybWFsaXplZCkgICAgICAgICAgICAgICAgICAgICovCi0gICAgaW50MTYgZXhwLCAgICAgICAgIC8qIChpKSA6IG5vcm1fbCAoTF94KSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLSAgICBpbnQxNiAqZXhwb25lbnQsICAgLyogKG8pIDogSW50ZWdlciBwYXJ0IG9mIExvZzIuICAgKHJhbmdlOiAwPD12YWw8PTMwKSAqLwotICAgIGludDE2ICpmcmFjdGlvbiAgICAvKiAobykgOiBGcmFjdGlvbmFsIHBhcnQgb2YgTG9nMi4gKHJhbmdlOiAwPD12YWw8MSkgICovCi0pCi17Ci0gICAgaW50MTYgaSwgYSwgdG1wOwotICAgIGludDMyIExfeTsKLQotICAgIGlmIChMX3ggPD0gKGludDMyKSAwKQotICAgIHsKLSAgICAgICAgKmV4cG9uZW50ID0gMDsKLSAgICAgICAgKmZyYWN0aW9uID0gMDs7Ci0gICAgICAgIHJldHVybjsKLSAgICB9Ci0KLSAgICAqZXhwb25lbnQgPSAzMCAtIGV4cDsKLQotICAgIExfeCA+Pj0gOTsKLSAgICBpID0gZXh0cmFjdF9oKExfeCk7ICAgICAgICAgICAgICAgICAvKiBFeHRyYWN0IGIyNS1iMzEgKi8KLSAgICBMX3ggPj49IDE7Ci0gICAgYSA9IChpbnQxNikoTF94KTsgICAgICAgICAgICAgICAgIC8qIEV4dHJhY3QgYjEwLWIyNCBvZiBmcmFjdGlvbiAqLwotICAgIGEgJj0gMHg3ZmZmOwotCi0gICAgaSAtPSAzMjsKLQotICAgIExfeSA9IExfZGVwb3NpdF9oKExvZzJfbm9ybV90YWJsZVtpXSk7ICAgICAgICAgICAgIC8qIHRhYmxlW2ldIDw8ID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ICpmcmFjdGlvbiAgICAvKiAobykgOiBGcmFjdGlvbmFsIHBhcnQgb2YgTG9nMi4gKHJhbmdlOiAwPD12YWw8MSkgKi8KLSkKLXsKLSAgICBpbnQxNiBleHA7Ci0KLSAgICBleHAgPSBub3JtYWxpemVfYW1yX3diKExfeCk7Ci0gICAgTGcyX25vcm1hbGl6ZWQoc2hsX2ludDMyKExfeCwgZXhwKSwgZXhwLCBleHBvbmVudCwgZnJhY3Rpb24pOwotfQotCi0KLS8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgotICoKLSAqICBUaGVzZSBvcGVyYXRpb25zIGFyZSBub3Qgc3RhbmRhcmQgZG91YmxlIHByZWNpc2lvbiBvcGVyYXRpb25zLiAgICAgICAgICAgKgotICogIFRoZXkgYXJlIHVzZWQgd2hlcmUgc2luZ2xlIHByZWNpc2lvbiBpcyBub3QgZW5vdWdoIGJ1dCB0aGUgZnVsbCAzMiBiaXRzICAqCi0gKiAgcHJlY2lzaW9uIGlzIG5vdCBuZWNlc3NhcnkuIEZvciBleGFtcGxlLCB0aGUgZnVuY3Rpb24gRGl2XzMyKCkgaGFzIGEgICAgICoKLSAqICAyNCBiaXRzIHByZWNpc2lvbiB3aGljaCBpcyBlbm91Z2ggZm9yIG91ciBwdXJwb3Nlcy4gICAgICAgICAgICAgICAgICAgICAgKgotICogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqCi0gKiAgVGhlIGRvdWJsZSBwcmVjaXNpb24gbnVtYmVycyB1c2UgYSBzcGVjaWFsIHJlcHJlc2VudGF0aW9uOiAgICAgICAgICAgICAgICoKLSAqICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKgotICogICAgIExfMzIgPSBoaTw8MTYgKyBsbzw8MSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqCi0gKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICoKLSAqICBMXzMyIGlzIGEgMzIgYml0IGludGVnZXIuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKgotICogIGhpIGFuZCBsbyBhcmUgMTYgYml0IHNpZ25lZCBpbnRlZ2Vycy4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqCi0gKiAgQXMgdGhlIGxvdyBwYXJ0IGFsc28gY29udGFpbnMgdGhlIHNpZ24sIHRoaXMgYWxsb3dzIGZhc3QgbXVsdGlwbGljYXRpb24uICoKLSAqICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKgotICogICAgICAweDgwMDAgMDAwMCA8PSBMXzMyIDw9IDB4N2ZmZiBmZmZlLiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqCi0gKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICoKLSAqICBXZSB3aWxsIHVzZSBEUEYgKERvdWJsZSBQcmVjaXNpb24gRm9ybWF0IClpbiB0aGlzIGZpbGUgdG8gc3BlY2lmeSAgICAgICAgKgotICogIHRoaXMgc3BlY2lhbCBmb3JtYXQuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqCi0gKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKLSovCi0KLQotLyotLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t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AgLyogKG8pIFEwICA6IHJlc3VsdCAgICAgICAocmFuZ2U6IDA8PXZhbDw9MHg3ZmZmZmZmZikgKi8KLSAgICAgICAgaW50MTYgZXhwb25hbnQsICAgIC8qIChpKSBRMCAgOiBJbnRlZ2VyIHBhcnQuICAgICAgKHJhbmdlOiAwPD12YWw8PTMwKSAgICovCi0gICAgICAgIGludDE2IGZyYWN0aW9uICAgICAvKiAoaSkgUTE1IDogRnJhY3Rpb25uYWwgcGFydC4gIChyYW5nZTogMC4wPD12YWw8MS4wKSAqLwotICAgICk7Ci0gICAgaW50MzIgRG90X3Byb2R1Y3QxMiggICAgLyogKG8pIFEzMTogbm9ybWFsaXplZCByZXN1bHQgKDEgPCB2YWwgPD0gLTEpICovCi0gICAgICAgIGludDE2IHhbXSwgICAgICAgICAvKiAoaSkgMTJiaXRzOiB4IHZlY3RvciAgICAgICAgICAgICAgICAgICAgICAgKi8KLSAgICAgICAgaW50MTYgeVtdLCAgICAgICAgIC8qIChpKSAxMmJpdHM6IHkgdmVjdG9yICAgICAgICAgICAgICAgICAgICAgICAqLwotICAgICAgICBpbnQxNiBsZywgICAgICAgICAgLyogKGkpICAgIDogdmVjdG9yIGxlbmd0aCAgICAgICAgICAgICAgICAgICAgICovCi0gICAgICAgIGludDE2ICogZXhwICAgICAgICAvKiAobykgICAgOiBleHBvbmVudCBvZiByZXN1bHQgKDAuLiszMCkgICAgICAgKi8KLSAgICApOwotCi0KLSAgICB2b2lkIGFtcndiX2xvZ18yKAotICAgICAgICBpbnQzMiBMX3gsICAgICAgICAvKiAoaSkgOiBpbnB1dCB2YWx1ZSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0gICAgICAgIGludDE2ICpleHBvbmVudCwgIC8qIChvKSA6IEludGVnZXIgcGFydCBvZiBMb2cyLiAgIChyYW5nZTogMDw9dmFsPD0zMCkgKi8KLSAgICAgICAgaW50MTYgKmZyYWN0aW9uICAgLyogKG8pIDogRnJhY3Rpb25hbCBwYXJ0IG9mIExvZzIuIChyYW5nZTogMDw9dmFsPDEpKi8KLSAgICApOwotCi0gICAgdm9pZCBMZzJfbm9ybWFsaXplZCgKLSAgICAgICAgaW50MzIgTF94LCAgICAgICAgIC8qIChpKSA6IGlucHV0IHZhbHVlIChub3JtYWxpemVkKSAgICAgICAgICAgICAgICAgICAgKi8KLSAgICAgICAgaW50MTYgZXhwLCAgICAgICAgIC8qIChpKSA6IG5vcm1fbCAoTF94KSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLSAgICAgICAgaW50MTYgKmV4cG9uZW50LCAgIC8qIChvKSA6IEludGVnZXIgcGFydCBvZiBMb2cyLiAgIChyYW5nZTogMDw9dmFsPD0zMCkgKi8KLSAgICAgICAgaW50MTYgKmZyYWN0aW9uICAgIC8qIChvKSA6IEZyYWN0aW9uYWwgcGFydCBvZiBMb2cyLiAocmFuZ2U6IDA8PXZhbDwxKSAgKi8KLSAgICApOwotCi0KLSAgICBpbnQxNiBtdWx0X2ludDE2X3IoaW50MTYgdmFyMSwgaW50MTYgdmFyMik7ICAgICAgICAgIC8qIE11bHQgd2l0aCByb3VuZCwgMiAqLwotICAgIGludDE2IHNocl9ybmQoaW50MTYgdmFyMSwgaW50MTYgdmFyMik7ICAgICAgICAgLyogU2hpZnQgcmlnaHQgd2l0aCByb3VuZCwgMiAgKi8KLQotICAgIGludDE2IGRpdl8xNmJ5MTYoaW50MTYgdmFyMSwgaW50MTYgdmFyMik7ICAgICAgIC8qIFNob3J0IGRpdmlzaW9uLCAgICAgICAxOCAgKi8KLQotCi0gICAgdm9pZCBpbnQzMl90b19kcGYoaW50MzIgTF8zMiwgaW50MTYgKmhpLCBpbnQxNiAqbG8pOwotICAgIGludDMyIG1weV9kcGZfMzIoaW50MTYgaGkxLCBpbnQxNiBsbzEsIGludDE2IGhpMiwgaW50MTYgbG8yKTsKLQotCi0jZGVmaW5lIG5vcm1fcyggeCkgICAgKG5vcm1hbGl6ZV9hbXJfd2IoICB4KSAtID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lkICopaXNwX2luaXQsIE0qc2l6ZW9mKCppc3BfaW5pdCkpOwotCi0gICAgICAgIHB2X21lbWNweSgodm9pZCAqKWRlY19zdGF0ZS0+aXNmb2xkLCAodm9pZCAqKWlzZl9pbml0LCBNKnNpemVvZigqaXNmX2luaXQpKTsKLSAgICAgICAgZm9yIChpID0gMDsgaSA8IExfTUVBTkJVRjsgaSsrKQotICAgICAgICB7Ci0gICAgICAgICAgICBwdl9tZW1jcHkoKHZvaWQgKikmZGVjX3N0YXRlLT5pc2ZfYnVmW2kgKiBNXSwKLSAgICAgICAgICAgICAgICAgICAgICAodm9pZCAqKWlzZl9pbml0LAotICAgICAgICAgICAgICAgICAgICAgIE0qc2l6ZW9mKCppc2ZfaW5pdCkpOwotICAgICAgICB9Ci0gICAgICAgIC8qIHZhcmlhYmxlIGluaXRpYWxpemF0aW9uICovCi0KLSAgICAgICAgZGVjX3N0YXRlLT5tZW1fZGVlbXBoID0gMDsKLQotICAgICAgICBkZWNfc3RhdGUtPnNlZWQgID0gMjE4NDU7ICAgICAgICAgICAgICAvKiBpbml0IHJhbmRvbSB3aXRoIDIxODQ1ICovCi0gICAgICAgIGRlY19zdGF0ZS0+c2VlZDIgPSAyMTg0NTsKLSAgICAgICAgZGVjX3N0YXRlLT5zZWVkMyA9IDIxODQ1OwotCi0gICAgICAgIGRlY19zdGF0ZS0+c3RhdGUgPSAwOwotICAgICAgICBkZWNfc3RhdGUtPnByZXZfYmZpID0gMDsKLQotICAgICAgICAvKiBTdGF0aWMgdmVjdG9ycyB0byB6ZXJvICovCi0KLSAgICAgICAgcHZfbWVtc2V0KCh2b2lkICopZGVjX3N0YXRlLT5tZW1fc3luX2hmLAotICAgICAgICAgICAgICAgICAgMCwKLSAgICAgICAgICAgICAgICAgIE0xNmsqc2l6ZW9mKCpkZWNfc3RhdGUtPm1lbV9zeW5faGYpKTsKLQotICAgICAgICBwdl9tZW1zZXQoKHZvaWQgKilkZWNfc3RhdGUtPm1lbV9zeW5faGksCi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ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLQotaW50MzIgcHZEZWNvZGVyX0FtcldiKAotICAgIGludDE2IG1vZGUsICAgICAgICAgICAgICAvKiBpbnB1dCA6IHVzZWQgbW9kZSAgICAgICAgICAgICAgICAgICAgICovCi0gICAgaW50MTYgcHJtc1tdLCAgICAgICAgICAgIC8qIGlucHV0IDogcGFyYW1ldGVyIHZlY3RvciAgICAgICAgICAgICAgKi8KLSAgICBpbnQxNiBzeW50aDE2a1tdLCAgICAgICAgLyogb3V0cHV0OiBzeW50aGVzaXMgc3BlZWNoICAgICAgICAgICAgICAqLwotICAgIGludDE2ICogZnJhbWVfbGVuZ3RoLCAgICAvKiBvdXRwdXQ6ICBsZW5naHQgb2YgdGhlIGZyYW1lICAgICAgICAgICovCi0gICAgdm9pZCAqc3BkX3N0YXRlLCAgICAgICAgIC8qIGkvbyAgIDogU3RhdGUgc3RydWN0dXJlICAgICAgICAgICAgICAgKi8KLSAgICBpbnQxNiBmcmFtZV90eXBlLCAgICAgICAgLyogaW5wdXQgOiByZWNlaXZlZCBmcmFtZSB0eXBlICAgICAgICAgICAqLwotICAgIGludDE2IFNjcmF0Y2hNZW1bXQotKQotewotCi0gICAgLyogRGVjb2RlciBzdGF0ZXMgKi8KLSAgICBEZWNvZGVyX1N0YXRlICpzdDsKLQotICAgIGludDE2ICpTY3JhdGNoTWVtMiA9ICZTY3JhdGNoTWVtWyBMX1NVQkZSICsgTF9TVUJGUjE2ayArICgoTF9TVUJGUiArIE0gKyBNMTZrICsxKTw8MSldOwotCi0KLSAgICAvKiBFeGNpdGF0aW9uIHZlY3RvciAqLwotCi0KLSAgICBpbnQxNiAqb2xkX2V4YyA9IFNjcmF0Y2hNZW0yOwotCi0gICAgaW50MTYgKkFxID0gJm9sZF9leGNbKExfRlJBTUUgKyAxKSArIFBJVF9NQVggKyBMX0lOVEVSUE9MXTsvKiBBKHopICAgcXVhbnRpemVkIGZvciB0aGUgNCBzdWJmcmFtZXMgKi8KLQotICAgIGludDE2ICppc3BuZXcgID0gJkFxW05CX1NVQkZSICogKE0gKyAxKV07LyogaW1taXR0YW5jZSBzcGVjdHJhbCBwYWlycyBhdCA0bmQgc2ZyICovCi0gICAgaW50MTYgKmlzZiAgICAgPSAmaXNwbmV3W01dOyAgICAgICAgICAgICAvKiBJU0YgKGZyZXF1ZW5jeSBkb21haW4pIGF0IDRuZCBzZnIgICAgKi8KLSAgICBpbnQxNiAqaXNmX3RtcCA9ICZpc2ZbTV07Ci0gICAgaW50MTYgKmNvZGUgICAgPSAmaXNmX3RtcFtNXTsgICAgICAgICAgICAgLyogYWxnZWJyYWljIGNvZGV2ZWN0b3IgICAgICAgICAgICAgICAgICovCi0gICAgaW50MTYgKmV4Y3AgICAgPSAmY29kZVtMX1NVQkZSXTsKLSAgICBpbnQxNiAqZXhjMiAgICA9ICZleGNwW0xfU1VCRlJdOyAgICAgICAgIC8qIGV4Y2l0YXRpb24gdmVjdG9yICAgICAgICAgICAgICAgICAgICAqLwotICAgIGludDE2ICpIZklzZiAgID0gJmV4YzJbTF9GUkFNRV07Ci0KLQotICAgIGludDE2ICpleGM7Ci0KLSAgICAvKiBMUEMgY29lZmZpY2llbnRzICovCi0KLSAgICBpbnQxNiAqcF9BcTsgICAgICAgICAgICAgICAgICAgICAgICAgIC8qIHB0ciB0byBBKHopIGZvciB0aGUgNCBzdWJmcmFtZXMgICAgICAqLwotCi0KLQotICAgIGludDE2IGZhYywgc3RhYl9mYWMsIHZvaWNlX2ZhYywgUV9uZXcgPSAwOwotICAgIGludDMyIExfdG1wLCBMX2dhaW5fY29kZTsKLQotICAgIC8qIFNjYWxhcnMgKi8KLQotICAgIGludDE2IGksIGosIGlfc3ViZnIsIGluZGV4LCBpbmRbOF0sIHRtcDsKLSAgICBpbnQzMiBtYXg7Ci0gICAgaW50MTYgVDAsIFQwX2ZyYWMsIHBpdF9mbGFnLCBUMF9tYXgsIHNlbGVjdCwgVDBfbWluID0gMDsKLS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otICAgIH0KLSAgICAvKgotICAgICAqICBEVFgtQ05HCi0gICAgICovCi0KLSAgICBpZiAobmV3RFRYU3RhdGUgIT0gU1BFRUNIKSAgICAgLyogQ05HIG1vZGUgKi8KLSAgICB7Ci0gICAgICAgIC8qIGluY3JlYXNlIHNsaWdodGx5IGVuZXJneSBvZiBub2lzZSBiZWxvdyAyMDAgSHogKi8KLQotICAgICAgICAvKiBDb252ZXJ0IElTRnMgdG8gdGhlIGNvc2luZSBkb21haW4gKi8KLSAgICAgICAgSXNmX2lzcChpc2YsIGlzcG5ldywgTSk7Ci0KLSAgICAgICAgSXNwX0F6KGlzcG5ldywgQXEsIE0sIDEpOwotCi0gICAgICAgIHB2X21lbWNweSgodm9pZCAqKWlzZl90bXAsICh2b2lkICopc3QtPmlzZm9sZCwgTSpzaXplb2YoKmlzZl90bXApKTsKLQotCi0gICAgICAgIGZvciAoaV9zdWJmciA9IDA7IGlfc3ViZnIgPCBMX0ZSQU1FOyBpX3N1YmZyICs9IExfU1VCRlIpCi0gICAgICAgIHsKLSAgICAgICAgICAgIGogPSBpX3N1YmZyID4+IDY7Ci0KLSAgICAgICAgICAgIGZvciAoaSA9IDA7IGkgPCBNOyBpKyspCi0gICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgTF90bXAgPSBtdWxfMTZieTE2X3RvX2ludDMyKGlzZl90bXBbaV0sIHN1Yl9pbnQxNigzMjc2NywgaW50ZXJwb2xfZnJhY1tqXSkpOwotICAgICAgICAgICAgICAgIExfdG1wID0gbWFjXzE2YnkxNl90b19pbnQzMihMX3RtcCwgaXNmW2ldLCBpbnRlcnBvbF9mcmFjW2pdKTsKLSAgICAgICAgICAgICAgICBIZklzZltpXSA9IGFtcl93Yl9yb3VuZChMX3RtcCk7Ci0gICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgIHN5bnRoZXNpc19hbXJfd2IoQXEsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICZleGMyW2lfc3ViZnJdLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAwLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmc3ludGgxNmtbaV9zdWJmciAqNS80XSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKHNob3J0KSAxLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICBIZklzZiwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbmJfYml0cywKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbmV3RFRYU3RhdGUsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgIHN0LAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICBiZmksCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgIFNjcmF0Y2hNZW0pOwotICAgICAgICB9Ci0KLSAgICAgICAgLyogcmVzZXQgc3BlZWNoIGNvZGVyIG1lbW9yaWVzICovCi0gICAgICAgIHB2RGVjb2Rlcl9BbXJXYl9SZXNldChzdCwgMCk7Ci0KLSAgICAgICAgcHZfbWVtY3B5KCh2b2lkICopc3QtPmlzZm9sZCwgKHZvaWQgKilpc2YsIE0qc2l6ZW9mKCppc2YpKTsKLQotICAgICAgICBzdC0+cHJldl9iZmkgPSBiZmk7Ci0gICAgICAgIHN0LT5kdHhfZGVjU3QuZHR4R2xvYmFsU3RhdGUgPSBuZXdEVFhTdGF0ZTsKLQotICAgICAgICByZXR1cm4gMDsKLSAgICB9Ci0gICAgLyoKLSAgICAgKiAgQUNFTFAKLSAgICAgKi8KLQotICAgIC8qIGNvcHkgY29kZXIgbWVtb3J5IHN0YXRlIGludG8gd29ya2luZyBzcGFjZSAoaW50ZXJuYWwgbWVtb3J5IGZvciBEU1ApICovCi0KLSAgICBwdl9tZW1jcHkoKHZvaWQgKilvbGRfZXhjLCAodm9pZCAqKXN0LT5vbGRfZXhjLCAoUElUX01BWCArIExfSU5URVJQT0wpKnNpemVvZigqb2xkX2V4YykpOwotCi0gICAgZXhjID0gb2xkX2V4YyArIFBJVF9NQVggKyBMX0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2VpdmVkIGFsc28gaW4gY2FzZSBvZiBCRkksICAgICAgICoKLSAgICAgICAgICogc28gdGhhdCB0aGUgcGFyYW1ldGVyIHBvaW50ZXIgc3RheXMgaW4gc3luYy4gICAgKgotICAgICAgICAgKi0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0qLwotCi0gICAgICAgIGlmIChwaXRfZmxhZyA9PSAwKQotICAgICAgICB7Ci0KLSAgICAgICAgICAgIGlmIChuYl9iaXRzIDw9IE5CQklUU185aykKLSAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICBpbmRleCA9IFNlcmlhbF9wYXJtKDgsICZwcm1zKTsKLQotICAgICAgICAgICAgICAgIGlmIChpbmRleCA8IChQSVRfRlIxXzhiIC0gUElUX01JTikgKiAyKQotICAgICAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAgICAgVDAgPSBQSVRfTUlOICsgKGluZGV4ID4+IDEpOwotICAgICAgICAgICAgICAgICAgICBUMF9mcmFjID0gc3ViX2ludDE2KGluZGV4LCBzaGxfaW50MTYoc3ViX2ludDE2KFQwLCBQSVRfTUlOKSwgMSkpOwotICAgICAgICAgICAgICAgICAgICBUMF9mcmFjID0gc2hsX2ludDE2KFQwX2ZyYWMsIDEpOwotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICBlbHNlCi0gICAgICAgICAgICAgICAgewotICAgICAgICAgICAgICAgICAgICBUMCA9IGFkZF9pbnQxNihpbmRleCwgUElUX0ZSMV84YiAtICgoUElUX0ZSMV84YiAtIFBJVF9NSU4pICogMikpOwotICAgICAgICAgICAgICAgICAgICBUMF9mcmFjID0gMDsKLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICB9Ci0gICAgICAgICAgICBlbHNlCi0gICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgaW5kZXggPSBTZXJpYWxfcGFybSg5LCAmcHJtcyk7Ci0KLSAgICAgICAgICAgICAgICBpZiAoaW5kZXggPCAoUElUX0ZSMiAtIFBJVF9NSU4pICogNCkKLSAgICAgICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgICAgIFQwID0gUElUX01JTiArIChpbmRleCA+PiAyKTsKLSAgICAgICAgICAgICAgICAgICAgVDBfZnJhYyA9IHN1Yl9pbnQxNihpbmRleCwgc2hsX2ludDE2KHN1Yl9pbnQxNihUMCwgUElUX01JTiksIDIpKTsKLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgZWxzZSBpZiAoaW5kZXggPCAoKChQSVRfRlIyIC0gUElUX01JTikgPDwgMikgKyAoKFBJVF9GUjFfOWIgLSBQSVRfRlIyKSA8PCAxKSkpCi0gICAgICAgICAgICAgICAgewotICAgICAgICAgICAgICAgICAgICBpbmRleCAtPSAoUElUX0ZSMiAtIFBJVF9NSU4pIDw8IDI7Ci0gICAgICAgICAgICAgICAgICAgIFQwID0gUElUX0ZSMiArIChpbmRleCA+PiAxKTsKLSAgICAgICAgICAgICAgICAgICAgVDBfZnJhYyA9IHN1Yl9pbnQxNihpbmRleCwgc2hsX2ludDE2KHN1Yl9pbnQxNihUMCwgUElUX0ZSMiksIDEpKTsKLSAgICAgICAgICAgICAgICAgICAgVDBfZnJhYyA9IHNobF9pbnQxNihUMF9mcmFjLCAxKTsKLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgZWxzZQotICAgICAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAgICAgVDAgPSBhZGRfaW50MTYoaW5kZXgsIChQSVRfRlIxXzliIC0gKChQSVRfRlIyIC0gUElUX01JTikgKiA0KSAtICgoUElUX0ZSMV85YiAtIFBJVF9GUjIpICogMikpKTsKLSAgICAgICAgICAgICAgICAgICAgVDBfZnJhYyA9IDA7Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgfQotCi0gICAgICAgICAgICAvKiBmaW5kIFQwX21pbiBhbmQgVDBfbWF4IGZvciBzdWJmcmFtZSAyIGFuZCA0ICovCi0KLSAgICAgICAgICAgIFQwX21pbiA9IFQwIC0gODsKLQotICAgICAgICAgICAgaWYgKFQwX21pbiA8IFBJVF9NSU4pCi0gICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgVDBfbWluID0gUElUX01JTjsKLSAgICAgICAgICAgIH0KLSAgICAgICAgICAgIFQwX21heCA9IFQwX21pbiArIDE1OwotCi0gICAgICAgICAgICBpZiAoVDBfbWF4ID4gUElUX01BWCkKLSAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICBUMF9tYXggPSBQSVRfTUFYOwotICAgICAgICAgICAgICAgIFQwX21pbiA9IFBJVF9NQVggLSAxNTsKLSAgICAgICAgICAgIH0KLSAgICAgICAgfQotICAgICAgICBlbHNlCi0gICAgICAgIHsgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLyogaWYgc3ViZnJhbWUgMiBvciA0ICovCi0KLSAgICAgICAgICAgIGlmIChuYl9iaXRzIDw9IE5CQklUU185aykKLSAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICBpbmRleCA9IFNlcmlhbF9wYXJtKDUsICZwcm1zKTsKLQotICAgICAgICAgICAgICAgIFQwID0gVDBfbWluICsgKGluZGV4ID4+IDEpOwotICAgICAgICAgICAgICAgIFQwX2ZyYWMgPSBzdWJfaW50MTYoaW5kZXgsIHNobF9pbnQxNihUMCAtIFQwX21pbiwgMSkpOwotICAgICAgICAgICAgICAgIFQwX2ZyYWMgPSBzaGxfaW50MTYoVDBfZnJhYywgMSk7Ci0gICAgICAgICAgICB9Ci0gICAgICAgICAgICBlbHNlCi0gICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgaW5kZXggPSBTZXJpYWxfcGFybSg2LCAmcHJtcyk7Ci0KLSAgICAgICAgICAgICAgICBUMCA9IFQwX21pbiArIChpbmRleCA+PiAyKTsKLSAgICAgICAgICAgICAgICBUMF9mcmFjID0gc3ViX2ludDE2KGluZGV4LCBzaGxfaW50MTYoVDAgLSBUMF9taW4sIDIpKTsKLSAgICAgICAgICAgIH0KLSAgICAgICAgfQotCi0gICAgICAgIC8qIGNoZWNrIEJGSSBhZnRlciBwaXRjaCBsYWcgZGVjb2RpbmcgKi8KLQotICAgICAgICBpZiAoYmZpICE9IDApICAgICAgICAgICAgICAgICAgICAgIC8qIGlmIGZyYW1lIGVyYXN1cmUgKi8KLSAgICAgICAgewotICAgICAgICAgICAgbGFnY29uY2VhbCgmKHN0LT5kZWNfZ2FpblsxN10pLCBzdC0+bGFnX2hpc3QsICZUMCwgJihzdC0+b2xkX1QwKSwgJihzdC0+c2VlZDMpLCB1bnVzYWJsZV9mcmFtZSk7Ci0gICAgICAgICAgICBUMF9mcmFjID0gMDsKLSAgICAgICAgfQotICAgICAgICAvKgotICAgICAgICAgKiAgRmluZCB0aGUgcGl0Y2ggZ2FpbiwgdGhlIGludGVycG9sYXRpb24gZmlsdGVyCi0gICAgICAgICAqICBhbmQgdGhlIGFkYXB0aXZlIGNvZGVib29rIHZlY3Rvci4KLSAgICAgICAgICovCi0KLSAgICAgICAgUHJlZF9sdDQoJmV4Y1tpX3N1YmZyXSwgVDAsIFQwX2ZyYWMsIExfU1VCRlIgKyAxKTsKLQotCi0gICAgICAgIGlmICh1bnVzYWJsZV9mcmFtZSkKLSAgICAgICAgewotICAgICAgICAgICAgc2VsZWN0ID0gMTsKLSAgICAgICAgfQotICAgICAgICBlbHNlCi0gICAgICAgIHsKLQotICAgICAgICAgICAgaWYgKG5iX2JpdHMgPD0gTkJCSVRTXzlrKQotICAgICAgICAgICAgewotICAgICAgICAgICAgICAgIHNlbGVjdCA9IDA7Ci0gICAgICAgICAgICB9Ci0gICAgICAgICAgICBlbHNlCi0gICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgc2VsZWN0ID0gU2VyaWFsX3Bhcm1fMWJpdCgmcHJtcyk7Ci0gICAgICAgICAgICB9Ci0gICAgICAgIH0KLQotCi0gICAgICAgIGlmIChzZWxlY3QgPT0gMCkKLSAgICAgICAgewotICAgICAgICAgICAgLyogZmluZCBwaXRjaCBleGNpdGF0aW9uIHdpdGggbHAgZmlsdGVyICovCi0gICAgICAgICAgICBmb3IgKGkgPSAwOyBpIDwgTF9TVUJGUjsgaSsrKQotICAgICAgICAgICAgewotICAgICAgICAgICAgICAgIExfdG1wICA9ICgoaW50MzIpIGV4Y1tpLTEraV9zdWJmcl0gKyBleGNbaSsxK2lfc3ViZnJdKTsKLSAgICAgICAgICAgICAgICBMX3RtcCAqPSA1ODk4OwotICAgICAgICAgICAgICAgIExfdG1wICs9ICgoaW50MzIpIGV4Y1tpK2lfc3ViZnJdICogMjA5NzIpOwotCi0gICAgICAgICAgICAgICAgY29kZVtpXSA9IGFtcl93Yl9yb3VuZChMX3RtcCA8PCAxKTsKLSAgICAgICAgICAgIH0KLSAgICAgICAgICAgIHB2X21lbWNweSgodm9pZCAqKSZleGNbaV9zdWJmcl0sICh2b2lkICopY29kZSwgTF9TVUJGUipzaXplb2YoKmNvZGUpKTsKLQotICAgICAgICB9Ci0gICAgICAgIC8qCi0gICAgICAgICAqIERlY29kZSBpbm5vdmF0aXZlIGNvZGVib29rLgotICAgICAgICAgKiBBZGQgdGhlIGZpeGVkLWdhaW4gcGl0Y2ggY29udHJpYnV0aW9uIHRvIGNvZGVbXS4KLSAgICAgICAgICovCi0KLSAgICAgICAgaWYgKHVudXNhYmxlX2ZyYW1lICE9IDApCi0gICAgICAgIHsKLSAgICAgICAgICAgIC8qIHRoZSBpbm5vdmF0aXZlIGNvZGUgZG9lc24ndCBuZWVkIHRvIGJlIHNjYWxlZCAoc2VlIFFfZ2FpbjIpICovCi0gICAgICAgICAgICBmb3IgKGkgPSAwOyBpIDwgTF9TVUJGUjsgaSsrKQotICAgICAgICAgICAgewotICAgICAgICAgICAgICAgIGNvZGVbaV0gPSBub2lzZV9nZW5fYW1yd2IoJihzdC0+c2VlZCkpID4+IDM7Ci0gICAgICAgICAgICB9Ci0gICAgICAgIH0KLSAgICAgICAgZWxzZSBpZiAobmJfYml0cyA8PSBOQkJJVFNfN2spCi0gICAgICAgIHsKLSAgICAgICAgICAgIGluZFswXSA9IFNlcmlhbF9wYXJtKDEyLCAmcHJtcyk7Ci0gICAgICAgICAgICBkZWNfYWNlbHBfMnBfaW5fNjQoaW5kWzBdLCBjb2RlKTsKLSAgICAgICAgfQotICAgICAgICBlbHNlIGlmIChuYl9iaXRzIDw9IE5CQklUU185aykKLSAgICAgICAgewotICAgICAgICAgICAgZm9yIChpID0gMDsgaSA8IDQ7IGkrKykKLSAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICBpbmRbaV0gPSBTZXJpYWxfcGFybSg1LCAmcHJtcyk7Ci0gICAgICAgICAgICB9Ci0gICAgICAgICAgICBkZWNfYWNlbHBfNHBfaW5fNjQoaW5kLCAyMCwgY29kZSk7Ci0gICAgICAgIH0KLSAgICAgICAgZWxzZSBpZiAobmJfYml0cyA8PSBOQkJJVFNfMTJrKQotICAgICAgICB7Ci0gICAgICAgICAgICBmb3IgKGkgPSAwOyBpIDwgNDsgaSsrKQotICAgICAgICAgICAgewotICAgICAgICAgICAgICAgIGluZFtpXSA9IFNlcmlhbF9wYXJtKDksICZwcm1zKTsKLSAgICAgICAgICAgIH0KLSAgICAgICAgICAgIGRlY19hY2VscF80cF9pbl82NChpbmQsIDM2LCBjb2RlKTsKLSAgICAgICAgfQotICAgICAgICBlbHNlIGlmIChuYl9iaXRzIDw9IE5CQklUU18xNGspCi0gICAgICAgIHsKLSAgICAgICAgICAgIGluZFswXSA9IFNlcmlhbF9wYXJtKDEzLCAmcHJtcyk7Ci0gICAgICAgICAgICBpbmRbMV0gPSBTZXJpYWxfcGFybSgxMywgJnBybXMpOwotICAgICAgICAgICAgaW5kWzJdID0gU2VyaWFsX3Bhcm0oOSwgJnBybXMpOwotICAgICAgICAgICAgaW5kWzNdID0gU2VyaWFsX3Bhcm0oOSwgJnBybXMpOwotICAgICAgICAgICAgZGVjX2FjZWxwXzRwX2luXzY0KGluZCwgNDQsIGNvZGUpOwotICAgICAgICB9Ci0gICAgICAgIGVsc2UgaWYgKG5iX2JpdHMgPD0gTkJCSVRTXzE2aykKLSAgICAgICAgewotICAgICAgICAgICAgZm9yIChpID0gMDsgaSA8IDQ7IGkrKykKLSAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICBpbmRbaV0gPSBTZXJpYWxfcGFybSgxMywgJnBybXMpOwotICAgICAgICAgICAgfQotICAgICAgICAgICAgZGVjX2FjZWxwXzRwX2luXzY0KGluZCwgNTIsIGNvZGUpOwotICAgICAgICB9Ci0gICAgICAgIGVsc2UgaWYgKG5iX2JpdHMgPD0gTkJCSVRTXzE4aykKLSAgICAgICAgewotICAgICAgICAgICAgZm9yIChpID0gMDsgaSA8IDQ7IGkrKykKLSAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICBpbmRbaV0gPSBTZXJpYWxfcGFybSgyLCAmcHJtcyk7Ci0gICAgICAgICAgICB9Ci0gICAgICAgICAgICBmb3IgKGkgPSA0OyBpIDwgODsgaSsrKQotICAgICAgICAgICAgewotICAgICAgICAgICAgICAgIGluZFtpXSA9IFNlcmlhbF9wYXJtKDE0LCAmcHJtcyk7Ci0gICAgICAgICAgICB9Ci0gICAgICAgICAgICBkZWNfYWNlbHBfNHBfaW5fNjQoaW5kLCA2NCwgY29kZSk7Ci0gICAgICAgIH0KLSAgICAgICAgZWxzZSBpZiAobmJfYml0cyA8PSBOQkJJVFNfMjBrKQotICAgICAgICB7Ci0gICAgICAgICAgICBpbmRbMF0gPSBTZXJpYWxfcGFybSgxMCwgJnBybXMpOwotICAgICAgICAgICAgaW5kWzFdID0gU2VyaWFsX3Bhcm0oMTAsICZwcm1zKTsKLSAgICAgICAgICAgIGluZFsyXSA9IFNlcmlhbF9wYXJtKDIsICZwcm1zKTsKLSAgICAgICAgICAgIGluZFszXSA9IFNlcmlhbF9wYXJtKDIsICZwcm1zKTsKLSAgICAgICAgICAgIGluZFs0XSA9IFNlcmlhbF9wYXJtKDEwLCAmcHJtcyk7Ci0gICAgICAgICAgICBpbmRbNV0gPSBTZXJpYWxfcGFybSgxMCwgJnBybXMpOwotICAgICAgICAgICAgaW5kWzZdID0gU2VyaWFsX3Bhcm0oMTQsICZwcm1zKTsKLSAgICAgICAgICAgIGluZFs3XSA9IFNlcmlhbF9wYXJtKDE0LCAmcHJtcyk7Ci0gICAgICAgICAgICBkZWNfYWNlbHBfNHBfaW5fNjQoaW5kLCA3MiwgY29kZSk7Ci0gICAgICAgIH0KLSAgICAgICAgZWxzZQotICAgICAgICB7Ci0gICAgICAgICAgICBmb3IgKGkgPSAwOyBpIDwgODsgaSsrKQotICAgICAgICAgICAgewotICAgICAgICAgICAgICAgIGluZFtpXSA9IFNlcmlhbF9wYXJtKDExLCAmcHJtcyk7Ci0gICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgIGRlY19hY2VscF80cF9pbl82NChpbmQsIDg4LCBjb2RlKTsKLSAgICAgICAgfQotCi0gICAgICAgIHByZWVtcGhfYW1yd2JfZGVjKGNvZGUsIHN0LT50aWx0X2NvZGUsIExfU1VCRlIpOwotCi0gICAgICAgIHRtcCA9IFQwOwotCi0gICAgICAgIGlmIChUMF9mcmFjID4gMikKLSAgICAgICAgewotICAgICAgICAgICAgdG1wKys7Ci0gICAgICAgIH0KLSAgICAgICAgUGl0X3NocnAoY29kZSwgdG1wLCBQSVRfU0hBUlAsIExfU1VCRlIpOwotCi0gICAgICAgIC8qCi0gICAgICAgICAqICBEZWNvZGUgY29kZWJvb2tzIGdhaW5zLgotICAgICAgICAgKi8KLQotICAgICAgICBpZiAobmJfYml0cyA8PSBOQkJJVFNfOWspCi0gICAgICAgIHsKLSAgICAgICAgICAgIGluZGV4ID0gU2VyaWFsX3Bhcm0oNiwgJnBybXMpOyAvKiBjb2RlYm9vayBnYWluIGluZGV4ICovCi0KLSAgICAgICAgICAgIGRlY19nYWluMl9hbXJfd2IoaW5kZXgsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgIDYsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvZGUsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgIExfU1VCRlIsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICZnYWluX3BpdCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJkxfZ2Fpbl9jb2RlLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICBiZmksCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgIHN0LT5wcmV2X2JmaSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc3QtPnN0YXRlLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICB1bnVzYWJsZV9mcmFtZSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc3QtPnZhZF9oaXN0LAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzdC0+ZGVjX2dhaW4pOwotICAgICAgICB9Ci0gICAgICAgIGVsc2UKLSAgICAgICAgewotICAgICAgICAgICAgaW5kZXggPSBTZXJpYWxfcGFybSg3LCAmcHJtcyk7IC8qIGNvZGVib29rIGdhaW4gaW5kZXggKi8KLQotICAgICAgICAgICAgZGVjX2dhaW4yX2Ftcl93YihpbmRleCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgNywKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY29kZSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTF9TVUJGUiwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJmdhaW5fcGl0LAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmTF9nYWluX2NvZGUsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJmaSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc3QtPnByZXZfYmZpLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzdC0+c3RhdGUsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgIHVudXNhYmxlX2ZyYW1lLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzdC0+dmFkX2hpc3QsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgIHN0LT5kZWNfZ2Fpbik7Ci0gICAgICAgIH0KLQotICAgICAgICAvKiBmaW5kIGJlc3Qgc2NhbGluZyB0byBwZXJmb3JtIG9uIGV4Y2l0YXRpb24gKFFfbmV3KSAqLwotCi0gICAgICAgIHRtcCA9IHN0LT5Rc3ViZnJbMF07Ci0gICAgICAgIGZvciAoaSA9IDE7IGkgPCA0OyBpKyspCi0gICAgICAgIHsKLSAgICAgICAgICAgIGlmIChzdC0+UXN1YmZyW2ldIDwgdG1wKQotICAgICAgICAgICAgewotICAgICAgICAgICAgICAgIHRtcCA9IHN0LT5Rc3ViZnJbaV07Ci0gICAgICAgICAgICB9Ci0gICAgICAgIH0KLQotICAgICAgICAvKiBsaW1pdCBzY2FsaW5nIChRX25ldykgdG8gUV9NQVg6IHNlZSBwdl9hbXJfd2JfY25zdC5oIGFuZCBzeW5fZmlsdF8zMigpICovCi0KLSAgICAgICAgaWYgKHRtcCA+IFFfTUFYKQotICAgICAgICB7Ci0gICAgICAgICAgICB0bXAgPSBRX01BWDsKLSAgICAgICAgfQotICAgICAgICBRX25ldyA9IDA7Ci0gICAgICAgIExfdG1wID0gTF9nYWluX2NvZGU7ICAgICAgICAgICAgICAgICAgLyogTF9nYWluX2NvZGUgaW4gUTE2ICovCi0KLQotICAgICAgICB3aGlsZSAoKExfdG1wIDwgMHgwODAwMDAwMEwpICYmIChRX25ldyA8IHRtcCkpCi0gICAgICAgIHsKLSAgICAgICAgICAgIExfdG1wIDw8PSAxOwotICAgICAgICAgICAgUV9uZXcgKz0gMTsKLQotICAgICAgICB9Ci0gICAgICAgIGdhaW5fY29kZSA9IGFtcl93Yl9yb3VuZChMX3RtcCk7ICAgICAgICAgIC8qIHNjYWxlZCBnYWluX2NvZGUgd2l0aCBRbmV3ICovCi0KLSAgICAgICAgc2NhbGVfc2lnbmFsKGV4YyArIGlfc3ViZnIgLSAoUElUX01BWCArIExfSU5URVJQT0wpLAotICAgICAgICAgICAgICAgICAgICAgUElUX01BWCArIExfSU5URVJQT0wgKyBMX1NVQkZSLAotICAgICAgICAgICAgICAgICAgICAgKGludDE2KShRX25ldyAtIHN0LT5RX29sZCkpOwotCi0gICAgICAgIHN0LT5RX29sZCA9IFFfbmV3OwotCi0KLSAgICAgICAgLyoKLSAgICAgICAgICogVXBkYXRlIHBhcmFtZXRlcnMgZm9yIHRoZSBuZXh0IHN1YmZyYW1lLgotICAgICAgICAgKiAtIHRpbHQgb2YgY29kZTogMC4wICh1bnZvaWNlZCkgdG8gMC41ICh2b2ljZWQpCi0gICAgICAgICAqLwotCi0KLSAgICAgICAgaWYgKGJmaSA9PSAwKQotICAgICAgICB7Ci0gICAgICAgICAgICAvKiBMVFAtTGFnIGhpc3RvcnkgdXBkYXRlICovCi0gICAgICAgICAgICBmb3IgKGkgPSA0OyBpID4gMDsgaS0tKQotICAgICAgICAgICAgewotICAgICAgICAgICAgICAgIHN0LT5sYWdfaGlzdFtpXSA9IHN0LT5sYWdfaGlzdFtpIC0gMV07Ci0gICAgICAgICAgICB9Ci0gICAgICAgICAgICBzdC0+bGFnX2hpc3RbMF0gPSBUMDsKLQotICAgICAgICAgICAgc3QtPm9sZF9UMCA9IFQwOwotICAgICAgICAgICAgc3QtPm9sZF9UMF9mcmFjID0gMDsgICAgICAgICAgICAgIC8qIFJlbW92ZSBmcmFjdGlvbiBpbiBjYXNlIG9mIEJGSSAqLwotICAgICAgICB9Ci0gICAgICAgIC8qIGZpbmQgdm9pY2UgZmFjdG9yIGluIFExNSAoMT12b2ljZWQsIC0xPXVudm9pY2VkKSAqLwotCi0gICAgICAgIC8qCi0gICAgICAgICAqIFNjYWxlIGRvd24gYnkgMS84Ci0gICAgICAgICAqLwotICAgICAgICBmb3IgKGkgPSBMX1NVQkZSIC0gMTsgaSA+PSAwOyBpLS0pCi0gICAgICAgIHsKLSAgICAgICAgICAgIGV4YzJbaV0gPSAoZXhjW2lfc3ViZnIgKyBpXSArICgweDAwMDQgKiAoZXhjW2lfc3ViZnIgKyBpXSAhPSBNQVhfMTYpKSkgPj4gMzsKLSAgICAgICAgfQotCi0KLSAgICAgICAgLyogcG9zdCBwcm9jZXNzaW5nIG9mIGV4Y2l0YXRpb24gZWxlbWVudHMgKi8KLQotICAgICAgICBpZiAobmJfYml0cyA8PSBOQkJJVFNfOWspCi0gICAgICAgIHsKLSAgICAgICAgICAgIHBpdF9zaGFycCA9IHNobF9pbnQxNihnYWluX3BpdCwgMSk7Ci0KLSAgICAgICAgICAgIGlmIChwaXRfc2hhcnAgPiAxNjM4NCkKLSAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICBmb3IgKGkgPSAwOyBpIDwgTF9TVUJGUjsgaSsrKQotICAgICAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAgICAgdG1wID0gbXVsdF9pbnQxNihleGMyW2ldLCBwaXRfc2hhcnApOwotICAgICAgICAgICAgICAgICAgICBMX3RtcCA9IG11bF8xNmJ5MTZfdG9faW50MzIodG1wLCBnYWluX3BpdCk7Ci0gICAgICAgICAgICAgICAgICAgIExfdG1wID4+PSAxOwotICAgICAgICAgICAgICAgICAgICBleGNwW2ldID0gYW1yX3diX3JvdW5kKExfdG1wKTsKLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICB9Ci0gICAgICAgIH0KLSAgICAgICAgZWxzZQotICAgICAgICB7Ci0gICAgICAgICAgICBwaXRfc2hhcnAgPSAwOwotICAgICAgICB9Ci0KLSAgICAgICAgdm9pY2VfZmFjID0gdm9pY2VfZmFjdG9yKGV4YzIsIC0zLCBnYWluX3BpdCwgY29kZSwgZ2Fpbl9jb2RlLCBMX1NVQkZSKTsKLQotICAgICAgICAvKiB0aWx0IG9mIGNvZGUgZm9yIG5leHQgc3ViZnJhbWU6IDAuNT12b2ljZWQsIDA9dW52b2ljZWQgKi8KLQotICAgICAgICBzdC0+dGlsdF9jb2RlID0gKHZvaWNlX2ZhYyA+PiAyKSArIDgxOTI7Ci0KLSAgICAgICAgLyoKLSAgICAgICAgICogLSBGaW5kIHRoZSB0b3RhbCBleGNpdGF0aW9uLgotICAgICAgICAgKiAtIEZpbmQgc3ludGhlc2lzIHNwZWVjaCBjb3JyZXNwb25kaW5nIHRvIGV4Y1tdLgotICAgICAgICAgKiAtIEZpbmQgbWF4aW11bSB2YWx1ZSBvZiBleGNpdGF0aW9uIGZvciBuZXh0IHNjYWxpbmcKLSAgICAgICAgICovCi0KLSAgICAgICAgcHZfbWVtY3B5KCh2b2lkICopZXhjMiwgKHZvaWQgKikmZXhjW2lfc3ViZnJdLCBMX1NVQkZSKnNpemVvZigqZXhjMikpOwotICAgICAgICBtYXggPSAxOwotCi0gICAgICAgIGZvciAoaSA9IDA7IGkgPCBMX1NVQkZSOyBpKyspCi0gICAgICAgIHsKLSAgICAgICAgICAgIExfdG1wID0gbXVsXzE2YnkxNl90b19pbnQzMihjb2RlW2ldLCBnYWluX2NvZGUpOwotICAgICAgICAgICAgTF90bXAgPSBzaGxfaW50MzIoTF90bXAsIDUpOwotICAgICAgICAgICAgTF90bXAgPSBtYWNfMTZieTE2X3RvX2ludDMyKExfdG1wLCBleGNbaSArIGlfc3ViZnJdLCBnYWluX3BpdCk7Ci0gICAgICAgICAgICBMX3RtcCA9IHNobF9pbnQzMihMX3RtcCwgMSk7Ci0gICAgICAgICAgICB0bXAgPSBhbXJfd2Jfcm91bmQoTF90bXApOwotICAgICAgICAgICAgZXhjW2kgKyBpX3N1YmZyXSA9IHRtcDsKLSAgICAgICAgICAgIHRtcCA9IHRtcCAtICh0bXAgPCAwKTsKLSAgICAgICAgICAgIG1heCB8PSB0bXAgXih0bXAgPj4gMTUpOyAgLyogfD0gdG1wIF5zaWduKHRtcCkgKi8KLSAgICAgICAgfQotCi0KLSAgICAgICAgLyogdG1wID0gc2NhbGluZyBwb3NzaWJsZSBhY2NvcmRpbmcgdG8gbWF4IHZhbHVlIG9mIGV4Y2l0YXRpb24gKi8KLSAgICAgICAgdG1wID0gYWRkX2ludDE2KG5vcm1fcyhtYXgpLCBRX25ldykgLSAxOwotCi0gICAgICAgIHN0LT5Rc3ViZnJbM10gPSBzdC0+UXN1YmZyWzJdOwotICAgICAgICBzdC0+UXN1YmZyWzJdID0gc3QtPlFzdWJmclsxXTsKLSAgICAgICAgc3QtPlFzdWJmclsxXSA9IHN0LT5Rc3ViZnJbMF07Ci0gICAgICAgIHN0LT5Rc3ViZnJbMF0gPSB0bXA7Ci0KLSAgICAgICAgLyoKLSAgICAgICAgICogcGhhc2UgZGlzcGVyc2lvbiB0byBlbmhhbmNlIG5vaXNlIGluIGxvdyBiaXQgcmF0ZQotICAgICAgICAgKi8KLQotCi0gICAgICAgIGlmIChuYl9iaXRzIDw9IE5CQklUU183aykKLSAgICAgICAgewotICAgICAgICAgICAgaiA9IDA7ICAgICAgLyogaGlnaCBkaXNwZXJzaW9uIGZvciByYXRlIDw9IDcuNSBrYml0L3MgKi8KLSAgICAgICAgfQotICAgICAgICBlbHNlIGlmIChuYl9iaXRzIDw9IE5CQklUU185aykKLSAgICAgICAgewotICAgICAgICAgICAgaiA9IDE7ICAgICAgLyogbG93IGRpc3BlcnNpb24gZm9yIHJhdGUgPD0gOS42IGtiaXQvcyAqLwotICAgICAgICB9Ci0gICAgICAgIGVsc2UKLSAgICAgICAgewotICAgICAgICAgICAgaiA9IDI7ICAgICAgLyogbm8gZGlzcGVyc2lvbiBmb3IgcmF0ZSA+IDkuNiBrYml0L3MgKi8KLSAgICAgICAgfQotCi0gICAgICAgIC8qIExfZ2Fpbl9jb2RlIGluIFExNiAqLwotCi0gICAgICAgIHBoYXNlX2Rpc3BlcnNpb24oKGludDE2KShMX2dhaW5fY29kZSA+PiAxNiksCi0gICAgICAgICAgICAgICAgICAgICAgICAgZ2Fpbl9waXQsCi0gICAgICAgICAgICAgICAgICAgICAgICAgY29kZSwKLSAgICAgICAgICAgICAgICAgICAgICAgICBqLAotICAgICAgICAgICAgICAgICAgICAgICAgIHN0LT5kaXNwX21lbSwKLSAgICAgICAgICAgICAgICAgICAgICAgICBTY3JhdGNoTWVtKTsKLQotICAgICAgICAvKgotICAgICAgICAgKiBub2lzZSBlbmhhbmNlcgotICAgICAgICAgKiAtIEVuaGFuY2UgZXhjaXRhdGlvbiBvbiBub2lzZS4gKG1vZGlmeSBnYWluIG9mIGNvZGUpCi0gICAgICAgICAqICAgSWYgc2lnbmFsIGlzIG5vaXN5IGFuZCBMUEMgZmlsdGVyIGlzIHN0YWJsZSwgbW92ZSBnYWluCi0gICAgICAgICAqICAgb2YgY29kZSAxLjUgZEIgdG93YXJkIGdhaW4gb2YgY29kZSB0aHJlc2hvbGQuCi0gICAgICAgICAqICAgVGhpcyBkZWNyZWFzZSBieSAzIGRCIG5vaXNlIGVuZXJneSB2YXJpYXRpb24uCi0gICAgICAgICAqLwotCi0gICAgICAgIHRtcCA9IDE2Mzg0IC0gKHZvaWNlX2ZhYyA+PiAxKTsgIC8qIDE9dW52b2ljZWQsIDA9dm9pY2VkICovCi0gICAgICAgIGZhYyA9IG11bHRfaW50MTYoc3RhYl9mYWMsIHRtcCk7Ci0KLSAgICAgICAgTF90bXAgPSBMX2dhaW5fY29kZTsKLQotICAgICAgICBpZiAoTF90bXAgPCBzdC0+TF9nY190aHJlcykKLSAgICAgICAgewotICAgICAgICAgICAgTF90bXAgKz0gZnhwX211bDMyX2J5XzE2YihMX2dhaW5fY29kZSwgNjIyNikgPDwgMTsKLQotICAgICAgICAgICAgaWYgKExfdG1wID4gc3QtPkxfZ2NfdGhyZXMpCi0gICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgTF90bXAgPSBzdC0+TF9nY190aHJlczsKLSAgICAgICAgICAgIH0KLSAgICAgICAgfQotICAgICAgICBlbHNlCi0gICAgICAgIHsKLSAgICAgICAgICAgIExfdG1wID0gZnhwX211bDMyX2J5XzE2YihMX2dhaW5fY29kZSwgMjc1MzYpIDw8IDE7Ci0KL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tcCk7Ci0gICAgICAgIExfdG1wID0gbXVsXzE2YnkxNl90b19pbnQzMihhbXJfd2Jfcm91bmQoTF90bXApLCBnYWluX2NvZGUpOwotICAgICAgICBMX3RtcCA9IHNobF9pbnQzMihMX3RtcCwgNSk7Ci0gICAgICAgIExfdG1wID0gbWFjXzE2YnkxNl90b19pbnQzMihMX3RtcCwgZXhjMlswXSwgZ2Fpbl9waXQpOwotICAgICAgICBMX3RtcCA9IHNobF9pbnQzMihMX3RtcCwgMSk7ICAgICAgIC8qIHNhdHVyYXRpb24gY2FuIG9jY3VyIGhlcmUgKi8KLSAgICAgICAgZXhjMlswXSA9IGFtcl93Yl9yb3VuZChMX3RtcCk7Ci0KLQotICAgICAgICBmb3IgKGkgPSAxOyBpIDwgTF9TVUJGUiAtIDE7IGkrKykKLSAgICAgICAgewotICAgICAgICAgICAgTF90bXAgPSAoaW50MzIpKGNvZGVbaV0gPDwgMTYpOwotICAgICAgICAgICAgTF90bXAgPSBtc3VfMTZieTE2X2Zyb21faW50MzIoTF90bXAsIChjb2RlW2kgKyAxXSArIGNvZGVbaSAtIDFdKSwgdG1wKTsKLSAgICAgICAgICAgIExfdG1wID0gbXVsXzE2YnkxNl90b19pbnQzMihhbXJfd2Jfcm91bmQoTF90bXApLCBnYWluX2NvZGUpOwotICAgICAgICAgICAgTF90bXAgPSBzaGxfaW50MzIoTF90bXAsIDUpOwotICAgICAgICAgICAgTF90bXAgPSBtYWNfMTZieTE2X3RvX2ludDMyKExfdG1wLCBleGMyW2ldLCBnYWluX3BpdCk7Ci0gICAgICAgICAgICBMX3RtcCA9IHNobF9pbnQzMihMX3RtcCwgMSk7ICAgICAgIC8qIHNhdHVyYXRpb24gY2FuIG9jY3VyIGhlcmUgKi8KLSAgICAgICAgICAgIGV4YzJbaV0gPSBhbXJfd2Jfcm91bmQoTF90bXApOwotICAgICAgICB9Ci0KLSAgICAgICAgTF90bXAgPSAoaW50MzIpKGNvZGVbTF9TVUJGUiAtIDFdIDw8IDE2KTsKLSAgICAgICAgTF90bXAgPSBtc3VfMTZieTE2X2Zyb21faW50MzIoTF90bXAsIGNvZGVbTF9TVUJGUiAtIDJdLCB0bXApOwotICAgICAgICBMX3RtcCA9IG11bF8xNmJ5MTZfdG9faW50MzIoYW1yX3diX3JvdW5kKExfdG1wKSwgZ2Fpbl9jb2RlKTsKLSAgICAgICAgTF90bXAgPSBzaGxfaW50MzIoTF90bXAsIDUpOwotICAgICAgICBMX3RtcCA9IG1hY18xNmJ5MTZfdG9faW50MzIoTF90bXAsIGV4YzJbTF9TVUJGUiAtIDFdLCBnYWluX3BpdCk7Ci0gICAgICAgIExfdG1wID0gc2hsX2ludDMyKExfdG1wLCAxKTsgICAgICAgLyogc2F0dXJhdGlvbiBjYW4gb2NjdXIgaGVyZSAqLwotICAgICAgICBleGMyW0xfU1VCRlIgLSAxXSA9IGFtcl93Yl9yb3VuZChMX3RtcCk7Ci0KLQotCi0gICAgICAgIGlmIChuYl9iaXRzIDw9IE5CQklUU185aykKLSAgICAgICAgewotICAgICAgICAgICAgaWYgKHBpdF9zaGFycCA+IDE2Mzg0KQotICAgICAgICAgICAgewotICAgICAgICAgICAgICAgIGZvciAoaSA9IDA7IGkgPCBMX1NVQkZSOyBpKyspCi0gICAgICAgICAgICAgICAgewotICAgICAgICAgICAgICAgICAgICBleGNwW2ldID0gYWRkX2ludDE2KGV4Y3BbaV0sIGV4YzJbaV0pOwotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICBhZ2MyX2Ftcl93YihleGMyLCBleGNwLCBMX1NVQkZSKTsKLSAgICAgICAgICAgICAgICBwdl9tZW1jcHkoKHZvaWQgKilleGMyLCAodm9pZCAqKWV4Y3AsIExfU1VCRlIqc2l6ZW9mKCpleGMyKSk7Ci0KLSAgICAgICAgICAgIH0KLSAgICAgICAgfQotICAgICAgICBpZiAobmJfYml0cyA8PSBOQkJJVFNfN2spCi0gICAgICAgIHsKLSAgICAgICAgICAgIGogPSBpX3N1YmZyID4+IDY7Ci0gICAgICAgICAgICBmb3IgKGkgPSAwOyBpIDwgTTsgaSsrKQotICAgICAgICAgICAgewotICAgICAgICAgICAgICAgIExfdG1wID0gbXVsXzE2YnkxNl90b19pbnQzMihpc2ZfdG1wW2ldLCBzdWJfaW50MTYoMzI3NjcsIGludGVycG9sX2ZyYWNbal0pKTsKLSAgICAgICAgICAgICAgICBMX3RtcCA9IG1hY18xNmJ5MTZfdG9faW50MzIoTF90bXAsIGlzZltpXSwgaW50ZXJwb2xfZnJhY1tqXSk7Ci0gICAgICAgICAgICAgICAgSGZJc2ZbaV0gPSBhbXJfd2Jfcm91bmQoTF90bXApOwotICAgICAgICAgICAgfQotICAgICAgICB9Ci0gICAgICAgIGVsc2UKLSAgICAgICAgewotICAgICAgICAgICAgcHZfbWVtc2V0KCh2b2lkICopc3QtPm1lbV9zeW5faGYsCi0gICAgICAgICAgICAgICAgICAgICAgMCwKLSAgICAgICAgICAgICAgICAgICAgICAoTTE2ayAtIE0pKnNpemVvZigqc3QtPm1lbV9zeW5faGYpKTsKLSAgICAgICAgfQotCi0gICAgICAgIGlmIChuYl9iaXRzID49IE5CQklUU18yNGspCi0gICAgICAgIHsKLSAgICAgICAgICAgIGNvcnJfZ2FpbiA9IFNlcmlhbF9wYXJtKDQsICZwcm1zKTsKLSAgICAgICAgfQotICAgICAgICBlbHNlCi0gICAgICAgIHsKLSAgICAgICAgICAgIGNvcnJfZ2FpbiA9IDA7Ci0gICAgICAgIH0KLQotICAgICAgICBzeW50aGVzaXNfYW1yX3diKHBfQXEsCi0gICAgICAgICAgICAgICAgICAgICAgICAgZXhjMiwKLSAgICAgICAgICAgICAgICAgICAgICAgICBRX25ldywKLSAgICAgICAgICAgICAgICAgICAgICAgICAmc3ludGgxNmtbaV9zdWJmciArIChpX3N1YmZyPj4yKV0sCi0gICAgICAgICAgICAgICAgICAgICAgICAgY29ycl9nYWluLAotICAgICAgICAgICAgICAgICAgICAgICAgIEhmSXNmLAotICAgICAgICAgICAgICA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m9pZCAqc3QsIGludDE2ICoqIFNjcmF0Y2hNZW0pOwotCi0gICAgaW50MzIgcHZEZWNvZGVyX0FtcldiKAotICAgICAgICBpbnQxNiBtb2RlLCAgICAgICAgICAgICAgICAgICAgICAgICAgLyogaW5wdXQgOiB1c2VkIG1vZGUgICAgICAgICAgICAgKi8KLSAgICAgICAgaW50MTYgcHJtc1tdLCAgICAgICAgICAgICAgICAgICAgICAgIC8qIGlucHV0IDogcGFyYW1ldGVyIHZlY3RvciAgICAgICovCi0gICAgICAgIGludDE2IHN5bnRoMTZrW10sICAgICAgICAgICAgICAgICAgICAvKiBvdXRwdXQ6IHN5bnRoZXNpcyBzcGVlY2ggICAgICAqLwotICAgICAgICBpbnQxNiAqIGZyYW1lX2xlbmd0aCwgICAgICAgICAgICAgICAgLyogb3V0cHV0OiAgbGVuZ2h0IG9mIHRoZSBmcmFtZSAgKi8KLSAgICAgICAgdm9pZCAqc3BkX3N0YXRlLCAgICAgICAgICAgICAgICAgICAgIC8qIGkvbyAgIDogU3RhdGUgc3RydWN0dXJlICAgICAgICovCi0gICAgICAgIGludDE2IGZyYW1lX3R5cGUsICAgICAgICAgICAgICAgICAgICAvKiBpbnB1dCA6IHJlY2VpdmVkIGZyYW1lIHR5cGUgICAqLwotICAgICAgICBpbnQxNiBTY3JhdGNoTWVtW10KLSAgICApOwotCi0gICAgdm9pZCBwdkRlY29kZXJfQW1yV2JfUmVzZXQodm9pZCAqc3QsIGludDE2IHJlc2V0X2FsbCk7Ci0KLSAgICBpbnQxNiBwdkRlY29kZXJfQW1yV2JfaG9taW5nX2ZyYW1lX3Rlc3QoaW50MTYgaW5wdXRfZnJhbWVbXSwgaW50MTYgbW9kZSk7Ci0KLSAgICBpbnQxNiBwdkRlY29kZXJfQW1yV2JfaG9taW5nX2ZyYW1lX3Rlc3RfZmlyc3QoaW50MTYgaW5wdXRfZnJhbWVbXSwgaW50MTYgbW9kZSk7Ci0KLSAgICBpbnQzMiBwdkRlY29kZXJfQW1yV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i8KLQotICAgIHZvaWQgaXNmX2V4dHJhcG9sYXRpb24oaW50MTYgSGZJc2ZbXSk7Ci0KLSAgICB2b2lkIEluaXRfTGFnY29uYyhpbnQxNiBsYWdfaGlzdFtdKTsKLSAgICB2b2lkIGxhZ2NvbmNlYWwoCi0gICAgICAgIGludDE2IGdhaW5faGlzdFtdLCAgICAgICAgICAgICAgICAgICAvKiAoaSkgOiBHYWluIGhpc3RvcnkgICAgICovCi0gICAgICAgIGludDE2IGxhZ19oaXN0W10sICAgICAgICAgICAgICAgICAgICAvKiAoaSkgOiBTdWJmcmFtZSBzaXplICAgICAgICAgKi8KLSAgICAgICAgaW50MTYgKiBUMCwKLSAgICAgICAgaW50MTYgKiBvbGRfVDAsCi0gICAgICAgIGludDE2ICogc2VlZCwKLSAgICAgICAgaW50MTYgdW51c2FibGVfZnJhbWUKLSAgICApOwotCi0gICAgdm9pZCBhZ2MyX2Ftcl93YigKLSAgICAgICAgaW50MTYgKiBzaWdfaW4sICAgICAgICAgICAgICAgICAgICAgIC8qIGlucHV0IDogcG9zdGZpbHRlciBpbnB1dCBzaWduYWwgICovCi0gICAgICAgIGludDE2ICogc2lnX291dCwgICAgICAgICAgICAgICAgICAgICAvKiBpbi9vdXQ6IHBvc3RmaWx0ZXIgb3V0cHV0IHNpZ25hbCAqLwotICAgICAgICBpbnQxNiBsX3RybSAgICAgICAgICAgICAgICAgICAgICAgICAgLyogaW5wdXQgOiBzdWJmcmFtZSBzaXplICAgICAgICAgICAgKi8KLSAgICApOwotCi0gICAgdm9pZCBsb3dfcGFzc19maWx0XzdrX2luaXQoaW50MTYgbWVtW10pOwotICAgIHZvaWQgbG93X3Bhc3NfZmlsdF83aygKLSAgICAgICAgaW50MTYgc2lnbmFsW10sICAgICAgICAgICAgICAgICAgICAgIC8qIGlucHV0OiAgc2lnbmFsICAgICAgICAgICAgICAgICAgKi8KLSAgICAgICAgaW50MTYgbGcsICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8qIGlucHV0OiAgbGVuZ3RoIG9mIGlucHV0ICAgICAgICAgKi8KLSAgICAgICAgaW50MTYgbWVtW10sICAgICAgICAgICAgICAgICAgICAgICAgIC8qIGluL291dDogbWVtb3J5IChzaXplPTMwKSAgICAgICAgKi8KLSAgICAgICAgaW50MTYgeFtdCi0gICAgKTsKLQotICAgIGludDE2IG1lZGlhbjUoaW50MTYgeFtdKTsKLQotICAgIHZvaWQgSXNwX0F6KAotICAgICAgICBpbnQxNiBpc3BbXSwgICAgICAgICAgICAgICAgICAgICAgICAgLyogKGkpIFExNSA6IEltbWl0dGFuY2Ugc3BlY3RyYWwgcGFpcnMgICAgICAgICAgICAqLwotICAgICAgICBpbnQxNiBhW10sICAgICAgICAgICAgICAgICAgICAgICAgICAgLyogKG8pIFExMiA6IHByZWRpY3RvciBjb2VmZmljaWVudHMgKG9yZGVyID0gTSkgICAqLwotICAgICAgICBpbnQxNiBtLAotICAgICAgICBpbnQxNiBhZGFwdGl2ZV9zY2FsaW5nICAgICAgICAgICAgICAgLyogKGkpIDAgICA6IGFkYXB0aXZlIHNjYWxpbmcgZGlzYWJsZWQgKi8KLSAgICAgICAgLyogICAgIDEgICA6IGFkYXB0aXZlIHNjYWxpbmcgZW5hYmxlZCAgKi8KLSAgICApOwotICAgIHZvaWQgSXNmX2lzcCgKLSAgICAgICAgaW50MTYgaXNmW10sICAgICAgICAgICAgICAgICAgICAgICAgIC8qIChpKSBRMTUgOiBpc2ZbbV0gbm9ybWFsaXplZCAocmFuZ2U6IDAuMDw9dmFsPD0wLjUpICovCi0gICAgICAgIGludDE2IGlzcFtdLCAgICAgICAgICAgICAgICAgICAgICAgICAvKiAobykgUTE1IDogaXNwW21dIChyYW5nZTogLTE8PXZhbDwxKSAgICAgICAgICAgICAgICAqLwotICAgICAgICBpbnQxNiBtICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLyogKGkpICAgICA6IExQQyBvcmRlciAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLSAgICApOwotICAgIHZvaWQgaW50ZXJwb2xhdGVfaXNwKAotICAgICAgICBpbnQxNiBpc3Bfb2xkW10sICAgICAgICAgICAgICAgICAgICAgLyogaW5wdXQgOiBpc3BzIGZyb20gcGFzdCBmcmFtZSAgICAgICAgICAgICAgKi8KLSAgICAgICAgaW50MTYgaXNwX25ld1tdLCAgICAgICAgICAgICAgICAgICAgIC8qIGlucHV0IDogaXNwcyBmcm9tIHByZXNlbnQgZnJhbWUgICAgICAgICAgICovCi0gICAgICAgIGNvbnN0IGludDE2IGZyYWNbXSwgICAgICAgICAgICAgICAgICAvKiBpbnB1dCA6IGZyYWN0aW9uIGZvciAzIGZpcnN0IHN1YmZyIChRMTUpICAqLwotICAgICAgICBpbnQxNiBBeltdICAgICAgICAgICAgICAgICAgICAgICAgICAgLyogb3V0cHV0OiBMUCBjb2VmZmljaWVudHMgaW4gNCBzdWJmcmFtZXMgICAgKi8KLSAgICApOwotICAgIHZvaWQgd2VpZ2h0X2FtcndiX2xwYygKLSAgICAgICAgaW50MTYgYVtdLCAgICAgICAgICAgICAgICAgICAgICAgICAgIC8qIChpKSBRMTIgOiBhW20rMV0gIExQQyBjb2VmZmljaWVudHMgICAgICAgICAgICAgKi8KLSAgICAgICAgaW50MTYgYXBbXSwgICAgICAgICAgICAgICAgICAgICAgICAgIC8qIChvKSBRMTIgOiBTcGVjdHJhbCBleHBhbmRlZCBMUEMgY29lZmZpY2llbnRzICAgKi8KLSAgICAgICAgaW50MTYgZ2FtbWEsICAgICAgICAgICAgICAgICAgICAgICAgIC8qIChpKSBRMTUgOiBTcGVjdHJhbCBleHBhbnNpb24gZmFjdG9yLiAgICAgICAgICAgKi8KLSAgICAgICAgaW50MTYgbSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8qIChpKSAgICAgOiBMUEMgb3JkZXIuICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLSAgICApOwotCi0KLSAgICAvKi0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tKgotICAgICAqICAgICAgICAgICAgICAgICAgICAgICAgaXNmIHF1YW50aXplcnMgICAgICAgICAgICAgICAgICAgICAgICAgICAqCi0gICAgICotLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSovCi0KLSAgICB2b2lkIERpc2ZfbnMoCi0gICAgICAgIGludDE2ICogaW5kaWNlLCAgICAgICAgICAgICAgICAgICAgICAvKiBpbnB1dDogIHF1YW50aXphdGlvbiBpbmRpY2VzICAgICAgICAgICAgICAgICAgKi8KLSAgICAgICAgaW50MTYgKiBpc2ZfcSAgICAgICAgICAgICAgICAgICAgICAgIC8qIGlucHV0IDogSVNGIGluIHRoZSBmcmVxdWVuY3kgZG9tYWluICgwLi4wLjUpICAqLwotICAgICk7Ci0KLSAgICB2b2lkIERwaXNmXzJzXzQ2YigKLSAgICAgICAgaW50MTYgKiBpbmRpY2UsICAgICAgICAgICAgICAgICAgICAgIC8qIGlucHV0OiAgcXVhbnRpemF0aW9uIGluZGljZXMgICAgICAgICAgICAgICAgICAgICAgICovCi0gICAgICAgIGludDE2ICogaXNmX3EsICAgICAgICAgICAgICAgICAgICAgICAvKiBvdXRwdXQ6IHF1YW50aXplZCBJU0YgaW4gZnJlcXVlbmN5IGRvbWFpbiAoMC4uMC41KSAqLwotICAgICAgICBpbnQxNiAqIHBhc3RfaXNmcSwgICAgICAgICAgICAgICAgICAgLyogaS8wICAgOiBwYXN0IElTRiBxdWFudGl6ZXIgICAgICAgICAgICAgICAgICAgICovCi0gICAgICAgIGludDE2ICogaXNmb2xkLCAgICAgICAgICAgICAgICAgICAgICAvKiBpbnB1dCA6IHBhc3QgcXVhbnRpemVkIElTRiAgICAgICAgICAgICAgICAgICAgKi8KLSAgICAgICAgaW50MTYgKiBpc2ZfYnVmLCAgICAgICAgICAgICAgICAgICAgIC8qIGlucHV0IDogaXNmIGJ1ZmZlciAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLSAgICAgICAgaW50MTYgYmZpLCAgICAgICAgICAgICAgICAgICAgICAgICAgIC8qIGlucHV0IDogQmFkIGZyYW1lIGluZGljYXRvciAgICAgICAgICAgICAgICAgICAqLwotICAgICAgICBpbnQxNiBlbmNfZGVjCi0gICAgKTsKLSAgICB2b2lkIERwaXNmXzJzXzM2YigKLSAgICAgICAgaW50MTYgKiBpbmRpY2UsICAgICAgICAgICAgICAgICAgICAgIC8qIGlucHV0OiAgcXVhbnRpemF0aW9uIGluZGljZXMgICAgICAgICAgICAgICAgICAgICAgICovCi0gICAgICAgIGludDE2ICogaXNmX3EsICAgICAgICAgICAgICAgICAgICAgICAvKiBvdXRwdXQ6IHF1YW50aXplZCBJU0YgaW4gZnJlcXVlbmN5IGRvbWFpbiAoMC4uMC41KSAqLwotICAgICAgICBpbnQxNiAqIHBhc3RfaXNmcSwgICAgICAgICAgICAgICAgICAgLyogaS8wICAgOiBwYXN0IElTRiBxdWFudGl6ZXIgICAgICAgICAgICAgICAgICAgICovCi0gICAgICAgIGludDE2ICogaXNmb2xkLCAgICAgICAgICAgICAgICAgICAgICAvKiBpbnB1dCA6IHBhc3QgcXVhbnRpemVkIElTRiAgICAgICAgICAgICAgICAgICAgKi8KLSAgICAgICAgaW50MTYgKiBpc2ZfYnVmLCAgICAgICAgICAgICAgICAgICAgIC8qIGlucHV0IDogaXNmIGJ1ZmZlciAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLSAgICAgICAgaW50MTYgYmZpLCAgICAgICAgICAgICAgICAgICAgICAgICAgIC8qIGlucHV0IDogQmFkIGZyYW1lIGluZGljYXRvciAgICAgICAgICAgICAgICAgICAqLwotICAgICAgICBpbnQxNiBlbmNfZGVjCi0gICAgKTsKLQotCi0gICAgdm9pZCBSZW9yZGVyX2lzZigKLSAgICAgICAgaW50MTYgKiBpc2YsICAgICAgICAgICAgICAgICAgICAgICAgIC8qIChpL28pIFExNTogSVNGIGluIHRoZSBmcmVxdWVuY3kgZG9tYWluICgwLi4wLjUpICovCi0gICAgICAgIGludDE2IG1pbl9kaXN0LCAgICAgICAgICAgICAgICAgICAgICAvKiAoaSkgUTE1ICA6IG1pbmltdW0gZGlzdGFuY2UgdG8ga2VlcCAgICAgICAgICAgICAqLwotICAgICAgICBpbnQxNiBuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLyogKGkpICAgICAgOiBudW1iZXIgb2YgSVNGICAgICAgICAgICAgICAgICAgICAgICAgKi8KLSAgICApOwotCi0gICAgLyotLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSoKLSAgICAgKiAgICAgICAgICAgICAgICAgICAgICAgZmlsdGVyIHByb3RvdHlwZXMgICAgICAgICAgICAgICAgICAgICAgICAgKgotICAgICAqLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0qLwotCi0gICAgdm9pZCBvdmVyc2FtcF8xMms4X3RvXzE2a19pbml0KAotICAgICAgICBpbnQxNiBtZW1bXSAgICAgICAgICAgICAgICAgICAgICAgICAgLyogb3V0cHV0OiBtZW1vcnkgKDIqTkJfQ09FRl9VUCkgc2V0IHRvIHplcm9zICAqLwotICAgICk7Ci0gICAgdm9pZCBvdmVyc2FtcF8xMms4X3RvXzE2aygKLSAgICAgICAgaW50MTYgc2lnMTJrOFtdLCAgICAgICAgICAgICAgICAgICAgIC8qIGlucHV0OiAgc2lnbmFsIHRvIG92ZXJzYW1wbGluZyAgKi8KLSAgICAgICAgaW50MTYgbGcsICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8qIGlucHV0OiAgbGVuZ3RoIG9mIGlucHV0ICAgICAgICAgKi8KLSAgICAgICAgaW50MTYgc2lnMTZrW10sICAgICAgICAgICAgICAgICAgICAgIC8qIG91dHB1dDogb3ZlcnNhbXBsZWQgc2lnbmFsICAgICAgKi8KLSAgICAgICAgaW50MTYgbWVtW10sICAgICAgICAgICAgICAgICAgICAgICAgIC8qIGluL291dDogbWVtb3J5ICgyKk5CX0NPRUZfVVApICAgKi8KLSAgICAgICAgaW50MTYgc2lnbmFsW10KLSAgICApOwotCi0gICAgdm9pZCBoaWdocGFzc181MEh6X2F0XzEyazhfaW5pdChpbnQxNiBtZW1bXSk7Ci0gICAgdm9pZCBoaWdocGFzc181MEh6X2F0XzEyazgoCi0gICAgICAgIGludDE2IHNpZ25hbFtdLCAgICAgICAgICAgICAgICAgICAgICAvKiBpbnB1dC9vdXRwdXQgc2lnbmFsICovCi0gICAgICAgIGludDE2IGxnLCAgICAgICAgICAgICAgICAgICAgICAgICAgICAvKiBsZW5naHQgb2Ygc2lnbmFsICAgICovCi0gICAgICAgIGludDE2IG1lbVtdICAgICAgICAgICAgICAgICAgICAgICAgICAvKiBmaWx0ZXIgbWVtb3J5IFs2XSAgICovCi0gICAgKTsKLSAgICB2b2lkIGhpZ2hwYXNzXzQwMEh6X2F0XzEyazhfaW5pdChpbnQxNiBtZW1bXSk7Ci0gICAgdm9pZCBoaWdocGFzc180MDBIel9hdF8xMms4KAotICAgICAgICBpbnQxNiBzaWduYWxbXSwgICAgICAgICAgICAgICAgICAgICAgLyogaW5wdXQvb3V0cHV0IHNpZ25hbCAqLwotICAgICAgICBpbnQxNiBsZywgICAgICAgICAgICAgICAgICAgICAgICAgICAgLyogbGVuZ2h0IG9mIHNpZ25hbCAgICAqLwotICAgICAgICBpbnQxNiBtZW1bXSAgICAgICAgICAgICAgICAgICAgICAgICAgLyogZmlsdGVyIG1lbW9yeSBbNl0gICAqLwotICAgICk7Ci0KLSAgICB2b2lkIGJhbmRfcGFzc182a183a19pbml0KGludDE2IG1lbVtdKTsKLSAgICB2b2lkIGJhbmRfcGFzc182a183aygKLSAgICAgICAgaW50MTYgc2lnbmFsW10sICAgICAgICAgICAgICAgICAgICAgIC8qIGlucHV0OiAgc2lnbmFsICAgICAgICAgICAgICAgICAgKi8KLSAgICAgICAgaW50MTYgbGcsICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8qIGlucHV0OiAgbGVuZ3RoIG9mIGlucHV0ICAgICAgICAgKi8KLSAgICAgICAgaW50MTYgbWVtW10sICAgICAgICAgICAgICAgICAgICAgICAgIC8qIGluL291dDogbWVtb3J5IChzaXplPTMwKSAgICAgICAgKi8KLSAgICAgICAgaW50MTYgeFtdCi0gICAgKTsKLQotCi0gICAgdm9pZCBwcmVlbXBoX2FtcndiX2RlYygKLSAgICAgICAgaW50MTYgeFtdLCAgICAgICAgICAgICAgICAgICAgICAgICAgIC8qIChpL28pICAgOiBpbnB1dCBzaWduYWwgb3ZlcndyaXR0ZW4gYnkgdGhlIG91dHB1dCAqLwotICAgICAgICBpbnQxNiBtdSwgICAgICAgICAgICAgICAgICAgICAgICAgICAgLyogKGkpIFExNSA6IHByZWVtcGhhc2lzIGNvZWZmaWNpZW50ICAgICAgICAgICAgICAgICovCi0gICAgICAgIGludDE2IGxnICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvKiAoaSkgICAgIDogbGVuZ2h0IG9mIGZpbHRlcmluZyAgICAgICAgICAgICAgICAgICAgKi8KLSAgICApOwotCi0gICAgdm9pZCBkZWVtcGhhc2lzXzMyKAotICAgICAgICBpbnQxNiB4X2hpW10sICAgICAgICAgICAgICAgICAgICAgICAgLyogKGkpICAgICA6IGlucHV0IHNpZ25hbCAoYml0MzEuLjE2KSAqLwotICAgICAgICBpbnQxNiB4X2xvW10sICAgICAgICAgICAgICAgICAgICAgICAgLyogKGkpICAgICA6IGlucHV0IHNpZ25hbCAoYml0MTUuLjQpICAqLwotICAgICAgICBpbnQxNiB5W10sICAgICAgICAgICAgICAgICAgICAgICAgICAgLyogKG8pICAgICA6IG91dHB1dCBzaWduYWwgKHgxNikgICAgICAqLwotICAgICAgICBpbnQxNiBtdSwgICAgICAgICAgICAgICAgICAgICAgICAgICAgLyogKGkpIFExNSA6IGRlZW1waGFzaXMgZmFjdG9yICAgICAgICAqLwotICAgICAgICBpbnQxNiBMLCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLyogKGkpICAgICA6IHZlY3RvciBzaXplICAgICAgICAgICAgICAqLwotICAgICAgICBpbnQxNiAqIG1lbSAgICAgICAgICAgICAgICAgICAgICAgICAgLyogKGkvbykgICA6IG1lbW9yeSAoeVstMV0pICAgICAgICAgICAqLwotICAgICk7Ci0KLQotICAgIHZvaWQgd2Jfc3luX2ZpbHQoCi0gICAgICAgIGludDE2IGFbXSwgICAgICAgICAgICAgICAgICAgICAgICAgICAvKiAoaSkgUTEyIDogYVttKzFdIHByZWRpY3Rpb24gY29lZmZpY2llbnRzICAgICAgICAgICAqLwotICAgICAgICBpbnQxNiBtLCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLyogKGkpICAgICA6IG9yZGVyIG9mIExQIGZpbHRlciAgICAgICAgICAgICAgICAgICAgICAgKi8KLSAgICAgICAgaW50MTYgeFtdLCAgICAgICAgICAgICAgICAgICAgICAgICAgIC8qIChpKSAgICAgOiBpbnB1dCBzaWduYWwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0gICAgICAgIGludDE2IHlbXSwgICAgICAgICAgICAgICAgICAgICAgICAgICAvKiAobykgICAgIDogb3V0cHV0IHNpZ25hbCAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotICAgICAgICBpbnQxNiBsZywgICAgICAgICAgICAgICAgICAgICAgICAgICAgLyogKGkpICAgICA6IHNpemUgb2YgZmlsdGVyaW5nICAgICAgICAgICAgICAgICAgICAgICAgKi8KLSAgICAgICAgaW50MTYgbWVtW10sICAgICAgICAgICAgICAgICAgICAgICAgIC8qIChpL28pICAgOiBtZW1vcnkgYXNzb2NpYXRlZCB3aXRoIHRoaXMgZmlsdGVyaW5nLiAgICovCi0gICAgICAgIGludDE2IHVwZGF0ZSwgICAgICAgICAgICAgICAgICAgICAgICAvKiAoaSkgICAgIDogMD1ubyB1cGRhdGUsIDE9dXBkYXRlIG9mIG1lbW9yeS4gICAgICAgICAqLwotICAgICAgICBpbnQxNiB5X2J1ZltdCi0gICAgKTsKLSAgICB2b2lkIFN5bl9maWx0XzMyKAotICAgICAgICBpbnQxNiBhW10sICAgICAgICAgICAgICAgICAgICAgICAgICAgLyogKGkpIFExMiA6IGFbbSsxXSBwcmVkaWN0aW9uIGNvZWZmaWNpZW50cyAqLwotICAgICAgICBpbnQxNiBtLCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLyogKGkpICAgICA6IG9yZGVyIG9mIExQIGZpbHRlciAgICAgICAgICAgICAqLwotICAgICAgICBpbnQxNiBleGNbXSwgICAgICAgICAgICAgICAgICAgICAgICAgLyogKGkpIFFuZXc6IGV4Y2l0YXRpb24gKGV4Y1tpXSA+PiBRbmV3KSAgICAqLwotICAgICAgICBpbnQxNiBRbmV3LCAgICAgICAgICAgICAgICAgICAgICAgICAgLyogKGkpICAgICA6IGV4YyBzY2FsaW5nID0gMChtaW4pIHRvIDgobWF4KSAqLwotICAgICAgICBpbnQxNiBzaWdfaGlbXSwgICAgICAgICAgICAgICAgICAgICAgLyogKG8pIC8xNiA6IHN5bnRoZXNpcyBoaWdoICAgICAgICAgICAgICAgICAqLwotICAgICAgICBpbnQxNiBzaWdfbG9bXSwgICAgICAgICAgICAgICAgICAgICAgLyogKG8pIC8xNiA6IHN5bnRoZXNpcyBsb3cgICAgICAgICAgICAgICAgICAqLwotICAgICAgICBpbnQxNiBsZyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLyogKGkpICAgICA6IHNpemUgb2YgZmlsdGVyaW5nICAgICAgICAgICAgICAqLwotICAgICk7Ci0KLSAgICAvKi0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tKgotICAgICAqICAgICAgICAgICAgICAgICAgICAgICBwaXRjaCBwcm90b3R5cGVzICAgICAgICAgICAgICAgICAgICAgICAgICAqCi0gICAgICotLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSovCi0KLQotICAgIHZvaWQgUHJlZF9sdDQoCi0gICAgICAgIGludDE2IGV4Y1tdLCAgICAgICAgICAgICAgICAgICAgICAgICAvKiBpbi9vdXQ6IGV4Y2l0YXRpb24gYnVmZmVyICovCi0gICAgICAgIGludDE2IFQwLCAgICAgICAgICAgICAgICAgICAgICAgICAgICAvKiBpbnB1dCA6IGludGVnZXIgcGl0Y2ggbGFnICovCi0gICAgICAgIGludDE2IGZyYWMsICAgICAgICAgICAgICAgICAgICAgICAgICAvKiBpbnB1dCA6IGZyYWN0aW9uIG9mIGxhZyAgICovCi0gICAgICAgIGludDE2IExfc3ViZnIgICAgICAgICAgICAgICAgICAgICAgICAvKiBpbnB1dCA6IHN1YmZyYW1lIHNpemUgICAgICovCi0gICAgKTsKLQotICAgIC8qLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0qCi0gICAgICogICAgICAgICAgICAgICAgICAgICAgIGdhaW4gcHJvdG90eXBlcyAgICAgICAgICAgICAgICAgICAgICAgICAgICoKLSAgICAgKi0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tKi8KLQotCi0gICAgdm9pZCBkZWNfZ2FpbjJfYW1yX3diX2luaXQoCi0gICAgICAgIGludDE2ICogbWVtICAgICAgICAgICAgICAgICAgICAgICAgICAvKiBvdXRwdXQgIDogbWVtb3J5ICg0IHdvcmRzKSAgICAgICovCi0gICAgKTsKLSAgICB2b2lkIGRlY19nYWluMl9hbXJfd2IoCi0gICAgICAgIGludDE2IGluZGV4LCAgICAgICAgICAgICAgICAgICAgICAgICAvKiAoaSkgICAgIDppbmRleCBvZiBxdWFudGl6YXRpb24uICAgICAgICovCi0gICAgICAgIGludDE2IG5iaXRzLCAgICAgICAgICAgICAgICAgICAgICAgICAvKiAoaSkgICAgIDogbnVtYmVyIG9mIGJpdHMgKDYgb3IgNykgICAgICovCi0gICAgICAgIGludDE2IGNvZGVbXSwgICAgICAgICAgICAgICAgICAgICAgICAvKiAoaSkgUTkgIDpJbm5vdmF0aXZlIHZlY3Rvci4gICAgICAgICAgICovCi0gICAgICAgIGludDE2IExfc3ViZnIsICAgICAgICAgICAgICAgICAgICAgICAvKiAoaSkgICAgIDpTdWJmcmFtZSBsZW5naHQuICAgICAgICAgICAgICovCi0gICAgICAgIGludDE2ICogZ2Fpbl9waXQsICAgICAgICAgICAgICAgICAgICAvKiAobykgUTE0IDpQaXRjaCBnYWluLiAgICAgICAgICAgICAgICAgICovCi0gICAgICAgIGludDMyICogZ2Fpbl9jb2QsICAgICAgICAgICAgICAgICAgICAvKiAobykgUTE2IDpDb2RlIGdhaW4uICAgICAgICAgICAgICAgICAgICovCi0gICAgICAgIGludDE2IGJmaSwgICAgICAgICAgICAgICAgICAgICAgICAgICAvKiAoaSkgICAgIDpiYWQgZnJhbWUgaW5kaWNhdG9yICAgICAgICAgICovCi0gICAgICAgIGludDE2IHByZXZfYmZpLCAgICAgICAgICAgICAgICAgICAgICAvKiAoaSkgOiBQcmV2aW91cyBCRiBpbmRpY2F0b3IgICAgICAqLwotICAgICAgICBpbnQxNiBzdGF0ZSwgICAgICAgICAgICAgICAgICAgICAgICAgLyogKGkpIDogU3RhdGUgb2YgQkZIICAgICAgICAgICAgICAgKi8KLSAgICAgICAgaW50MTYgdW51c2FibGVfZnJhbWUsICAgICAgICAgICAgICAgIC8qIChpKSA6IFVGIGluZGljYXRvciAgICAgICAgICAgICovCi0gICAgICAgIGludDE2IHZhZF9oaXN0LCAgICAgICAgICAgICAgICAgICAgICAvKiAoaSkgICAgICAgICA6bnVtYmVyIG9mIG5vbi1zcGVlY2ggZnJhbWVzICAqLwotICAgICAgICBpbnQxNiAqIG1lbSAgICAgICAgICAgICAgICAgICAgICAgICAgLyogKGkvbykgICA6IG1lbW9yeSAoNCB3b3JkcykgICAgICAqLwotICAgICk7Ci0KLSAgICAvKi0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tKgotICAgICAqICAgICAgICAgICAgICAgICAgICAgICBhY2VscCBwcm90b3R5cGVzICAgICAgICAgICAgICAgICAgICAgICAgICAqCi0gICAgICotLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSovCi0KLSAgICB2b2lkIGRlY19hY2VscF8ycF9pbl82NCgKLSAgICAgICAgaW50MTYgaW5kZXgsICAgICAgICAgICAgICAgICAgICAgICAgIC8qIChpKSA6ICAgIDEyIGJpdHMgaW5kZXggICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLSAgICAgICAgaW50MTYgY29kZVtdICAgICAgICAgICAgICAgICAgICAgICAgIC8qIChvKSA6UTkgIGFsZ2VicmFpYyAoZml4ZWQpIGNvZGVib29rIGV4Y2l0YXRpb24gICAgICAgICAgKi8KLSAgICApOwotCi0gICAgdm9pZCBkZWNfYWNlbHBfNHBfaW5fNjQoCi0gICAgICAgIGludDE2IGluZGV4W10sICAgICAgICAgICAgICAgICAgICAgICAvKiAoaSkgOiBpbmRleCAoMjApOiA1KzUrNSs1ID0gMjAgYml0cy4gICAgICAgICAgICAgICAgICovCi0gICAgICAgIC8qIChpKSA6IGluZGV4ICgzNik6IDkrOSs5KzkgPSAzNiBiaXRzLiAgICAgICAgICAgICAgICAgKi8KLSAgICAgICAgLyogKGkpIDogaW5kZXggKDQ0KTogMTMrOSsxMys5ID0gNDQgYml0cy4gICAgICAgICAgICAgICAqLwotICAgICAgICAvKiAoaSkgOiBpbmRleCAoNTIpOiAxMysxMysxMysxMyA9IDUyIGJpdHMuICAgICAgICAgICAgICovCi0gICAgICAgIC8qIChpKSA6IGluZGV4ICg2NCk6IDIrMisyKzIrMTQrMTQrMTQrMTQgPSA2NCBiaXRzLiAgICAgKi8KLSAgICAgICAgLyogKGkpIDogaW5kZXggKDcyKTogMTArMisxMCsyKzEwKzE0KzEwKzE0ID0gNzIgYml0cy4gICAqLwotICAgICAgICAvKiAoaSkgOiBpbmRleCAoODgpOiAxMSsxMSsxMSsxMSsxMSsxMSsxMSsxMSA9IDg4IGJpdHMuICovCi0gICAgICAgIGludDE2IG5iYml0cywgICAgICAgICAgICAgICAgICAgICAgICAvKiAoaSkgOiAyMCwgMzYsIDQ0LCA1MiwgNjQsIDcyIG9yIDg4IGJpdHMgICAgICAgICAgICAgICovCi0gICAgICAgIGludDE2IGNvZGVbXSAgICAgICAgICAgICAgICAgICAgICAgICAvKiAobykgUTk6IGFsZ2VicmFpYyAoZml4ZWQpIGNvZGVib29rIGV4Y2l0YXRpb24gICAgICAgICovCi0gICAgKTsKLSAgICB2b2lkIFBpdF9zaHJwKAotICAgICAgICBpbnQxNiAqIHgsICAgICAgICAgICAgICAgICAgICAgICAgICAgLyogaW4vb3V0OiBpbXB1bHNlIHJlc3BvbnNlIChvciBhbGdlYnJhaWMgY29kZSkgKi8KLSAgICAgICAgaW50MTYgcGl0X2xhZywgICAgICAgICAgICAgICAgICAgICAgIC8qIGlucHV0IDogcGl0Y2ggbGFnICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0gICAgICAgIGludDE2IHNoYXJwLCAgICAgICAgICAgICAgICAgICAgICAgICAvKiBpbnB1dCA6IHBpdGNoIHNoYXJwZW5pbmcgZmFjdG9yIChRMTUpICAgICAgICAqLwotICAgICAgICBpbnQxNiBMX3N1YmZyICAgICAgICAgICAgICAgICAgICAgICAgLyogaW5wdXQgOiBzdWJmcmFtZSBzaXplICAgICAgICAgICAgICAgICAgICAgICAgKi8KLSAgICApOwotCi0KLSAgICAvKi0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tKgotICAgICAqICAgICAgICAgICAgICAgICAgICAgICAgb3RoZXJzIHByb3RvdHlwZXMgICAgICAgICAgICAgICAgICAgICAgICAqCi0gICAgICotLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSovCi0KLSAgICBpbnQxNiB2b2ljZV9mYWN0b3IoICAgICAgICAgICAgICAgICAgICAgICAvKiAobykgUTE1IDogZmFjdG9yICgtMT11bnZvaWNlZCB0byAxPXZvaWNlZCkgKi8KLSAgICAgICAgaW50MTYgZXhjW10sICAgICAgICAgICAgICAgICAgICAgICAgIC8qIChpKSBRX2V4YzogcGl0Y2ggZXhjaXRhdGlvbiAgICAgICAgICAgICAgICAqLwotICAgICAgICBpbnQxNiBRX2V4YywgICAgICAgICAgICAgICAgICAgICAgICAgLyogKGkpICAgICA6IGV4YyBmb3JtYXQgICAgICAgICAgICAgICAgICAgICAgICovCi0gICAgICAgIGludDE2IGdhaW5fcGl0LCAgICAgICAgICAgICAgICAgICAgICAvKiAoaSkgUTE0IDogZ2FpbiBvZiBwaXRjaCAgICAgICAgICAgICAgICAgICAgKi8KLSAgICAgICAgaW50MTYgY29kZVtdLCAgICAgICAgICAgICAgICAgICAgICAgIC8qIChpKSBROSAgOiBGaXhlZCBjb2RlYm9vayBleGNpdGF0aW9uICAgICAgICAqLwotICAgICAgICBpbnQxNiBnYWluX2NvZGUsICAgICAgICAgICAgICAgICAgICAgLyogKGkpIFEwICA6IGdhaW4gb2YgY29kZSAgICAgICAgICAgICAgICAgICAgICovCi0gICAgICAgIGludDE2IExfc3ViZnIgICAgICAgICAgICAgICAgICAgICAgICAvKiAoaSkgICAgIDogc3ViZnJhbWUgbGVuZ3RoICAgICAgICAgICAgICAgICAgKi8KLSAgICApOwotCi0gICAgdm9pZCBzY2FsZV9zaWduYWwoCi0gICAgICAgIGludDE2IHhbXSwgICAgICAgICAgICAgICAgICAgICAgICAgICAvKiAoaS9vKSA6IHNpZ25hbCB0byBzY2FsZSAgICAgICAgICAgICAgICovCi0gICAgICAgIGludDE2IGxnLCAgICAgICAgICAgICAgICAgICAgICAgICAgICAvKiAoaSkgICA6IHNpemUgb2YgeFtdICAgICAgICAgICAgICAgICAgICovCi0gICAgICAgIGludDE2IGV4cCAgICAgICAgICAgICAgICAgICAgICAgICAgICAvKiAoaSkgICA6IGV4cG9uZW50OiB4ID0gcm91bmQoeCA8PCBleHApICovCi0gICAgKTsKLQotICAgIGludDE2IG5vaXNlX2dlbl9hbXJ3YihpbnQxNiAqIHNlZWQpOwotCi0KLSAgICB2b2lkIHBoYXNlX2Rpc3BlcnNpb24oCi0gICAgICAgIGludDE2IGdhaW5fY29kZSwgICAgICAgICAgICAgICAgICAgICAvKiAoaSkgUTAgIDogZ2FpbiBvZiBjb2RlICAgICAgICAgICAgICovCi0gICAgICAgIGludDE2IGdhaW5fcGl0LCAgICAgICAgICAgICAgICAgICAgICAvKiAoaSkgUTE0IDogZ2FpbiBvZiBwaXRjaCAgICAgICAgICAgICovCi0gICAgICAgIGludDE2IGNvZGVbXSwgICAgICAgICAgICAgICAgICAgICAgICAvKiAoaS9vKSAgIDogY29kZSB2ZWN0b3IgICAgICAgICAgICAgICovCi0gICAgICAgIGludDE2IG1vZGUsICAgICAgICAgICAgICAgICAgICAgICAgICAvKiAoaSkgICAgIDogbGV2ZWwsIDA9aGksIDE9bG8sIDI9b2ZmICovCi0gICAgICAgIGludDE2IGRpc3BfbWVtW10sICAgICAgICAgICAgICAgICAgICAvKiAoaS9vKSAgIDogIG1lbW9ye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LSovCi0KLSNpZm5kZWYgUFZBTVJXQkRFQ09ERVJfQkFTSUNfT1BfQVJNVjVfSAotI2RlZmluZSBQVkFNUldCREVDT0RFUl9CQVNJQ19PUF9BUk1WNV9ICi0KLSNpZmRlZiBfX2NwbHVzcGx1cwotZXh0ZXJuICJDIgotewotI2VuZGlmCi0KLQotCi0KLQotI2lmIGRlZmluZWQoUFZfQVJNX1Y1KQotCi0gICAgX19pbmxpbmUgaW50MTYgYWRkX2ludDE2KGludDE2IHZhcjEsIGludDE2IHZhcjIpCi0gICAgewotICAgICAgICBpbnQzMiBMX3Zhcl9vdXQ7Ci0gICAgICAgIGludDMyIExfdmFyX2F1eDsKLQotICAgICAgICBfX2FzbQotICAgICAgICB7Ci0gICAgICAgICAgICBtb3YgTF92YXJfb3V0LCB2YXIxLCBsc2wgIzE2Ci0gICAgICAgICAgICBtb3YgTF92YXJfYXV4LCB2YXIyLCBsc2wgIzE2Ci0gICAgICAgICAgICBxYWRkIExfdmFyX291dCwgTF92YXJfb3V0LCBMX3Zhcl9hdXgKLSAgICAgICAgICAgIG1vdiBMX3Zhcl9vdXQsIExfdmFyX291dCwgYXNyICMxNgotCi0gICAgICAgIH0KLSAgICAgICAgcmV0dXJuIExfdmFyX291dDsKLSAgICB9Ci0KLQotICAgIF9faW5saW5lIGludDE2IHN1Yl9pbnQxNihpbnQxNiB2YXIxLCBpbnQxNiB2YXIyKQotICAgIHsKLSAgICAgICAgaW50MzIgTF92YXJfb3V0OwotICAgICAgICBpbnQzMiBMX3Zhcl9hdXg7Ci0KLSAgICAgICAgX19hc20KLSAgICAgICAgewotICAgICAgICAgICAgbW92IExfdmFyX291dCwgdmFyMSwgbHNsICMxNgotICAgICAgICAgICAgbW92IExfdmFyX2F1eCwgdmFyMiwgbHNsICMxNgotICAgICAgICAgICAgcXN1YiBMX3Zhcl9vdXQsIExfdmFyX291dCwgTF92YXJfYXV4Ci0gICAgICAgICAgICBtb3YgTF92YXJfb3V0LCBMX3Zhcl9vdXQsIGFzciAjMTYKLQotICAgICAgICB9Ci0gICAgICAgIHJldHVybiBMX3Zhcl9vdXQ7Ci0gICAgfQotCi0KLSAgICBfX2lubGluZSBpbnQzMiBhZGRfaW50MzIoaW50MzIgTF92YXIxLCBpbnQzMiBMX3ZhcjIpCi0gICAgewotICAgICAgICBpbnQzMiBMX3Zhcl9vdXQ7Ci0KLSAgICAgICAgX19hc20KLSAgICAgICAgewotICAgICAgICAgICAgcWFkZCBMX3Zhcl9vdXQsIExfdmFyMSwgTF92YXIyCi0gICAgICAgIH0KLSAgICAgICAgcmV0dXJuIExfdmFyX291dDsKLSAgICB9Ci0KLQotICAgIF9faW5saW5lIGludDMyIG1hY18xNmJ5MTZfdG9faW50MzIoaW50MzIgTF92YXIzLCBpbnQxNiB2YXIxLCBpbnQxNiB2YXIyKQotICAgIHsKLSAgICAgICAgaW50MzIgTF92YXJfb3V0OwotCi0KLSAgICAgICAgX19hc20KLSAgICAgICAgewotICAgICAgICAgICAgc211bGJiIExfdmFyX291dCwgdmFyMSwgdmFyMgotICAgICAgICAgICAgcWRhZGQgTF92YXJfb3V0LCBMX3ZhcjMsIExfdmFyX291dAotICAgICAgICB9Ci0gICAgICAgIHJldHVybiBMX3Zhcl9vdXQ7Ci0gICAgfQotCi0gICAgX19pbmxpbmUgaW50MzIgc3ViX2ludDMyKGludDMyIExfdmFyMSwgaW50MzIgTF92YXIyKQotICAgIHsKLSAgICAgICAgaW50MzIgTF92YXJfb3V0OwotCi0gICAgICAgIF9fYXNtCi0gICAgICAgIHsKLSAgICAgICAgICAgIHFzdWIgTF92YXJfb3V0LCBMX3ZhcjEsIExfdmFyMgotICAgICAgICB9Ci0gICAgICAgIHJldHVybiBMX3Zhcl9vdXQ7Ci0gICAgfQotCi0gICAgX19pbmxpbmUgaW50MzIgbXN1XzE2YnkxNl9mcm9tX2ludDMyKGludDMyIExfdmFyMywgaW50MTYgdmFyMSwgaW50MTYgdmFyMikKLSAgICB7Ci0gICAgICAgIGludDMyIExfdmFyX291dDsKLQotCi0gICAgICAgIF9fYXNtCi0gICAgICAgIHsKLSAgICAgICAgICAgIHNtdWxiYiBMX3Zhcl9vdXQsIHZhcjEsIHZhcjIKLSAgICAgICAgICAgIHFkc3ViIExfdmFyX291dCwgTF92YXIzLCBMX3Zhcl9vdXQKLSAgICAgICAgfQotICAgICAgICByZXR1cm4gTF92YXJfb3V0OwotICAgIH0KLQotICAgIF9faW5saW5lIGludDMyIG11bF8xNmJ5MTZfdG9faW50MzIoaW50MTYgdmFyMSwgaW50MTYgdmFyMikKLSAgICB7Ci0gICAgICAgIGludDMyIExfdmFyX291dDsKLQotICAgICAgICBfX2FzbQotICAgICAgICB7Ci0gICAgICAgICAgICBzbXVsYmIgTF92YXJfb3V0LCB2YXIxLCB2YXIyCi0gICAgICAgICAgICBxYWRkIExfdmFyX291dCwgTF92YXJfb3V0LCBMX3Zhcl9vdXQKLSAgICAgICAgfQotICAgICAgICByZXR1cm4gTF92YXJfb3V0OwotICAgIH0KLQotICAgIF9faW5saW5lIGludDE2IG11bHRfaW50MTYoaW50MTYgdmFyMSwgaW50MTYgdmFyMikKLSAgICB7Ci0gICAgICAgIGludDMyIExfdmFyX291dDsKLQotICAgICAgICBfX2FzbQotICAgICAgICB7Ci0gICAgICAgICAgICBzbXVsYmIgTF92YXJfb3V0LCB2YXIxLCB2YXIyCi0gICAgICAgICAgICBtb3YgTF92YXJfb3V0LCBMX3Zhcl9vdXQsIGFzciAjMTUKLSAgICAgICAgfQotICAgICAgICByZXR1cm4gTF92YXJfb3V0OwotICAgIH0KLQotCi0gICAgX19pbmxpbmUgaW50MTYgYW1yX3diX3JvdW5kKGludDMyIExfdmFyMSkKLSAgICB7Ci0gICAgICAgIGludDMyIExfdmFyX291dDsKLQotICAgICAgICBfX2FzbQotICAgICAgICB7Ci0gICAgICAgICAgICBxYWRkIExfdmFyX291dCwgTF92YXIxLCAoaW50MzIpIDB4MDAwMDgwMDBMCi0gICAgICAgICAgICBtb3YgTF92YXJfb3V0LCBMX3Zhcl9vdXQsIGFzciAjMTYKLSAgICAgICAgfQotICAgICAgICByZXR1cm4gTF92YXJfb3V0OwotICAgIH0KLQotCi0KLSAgICBfX2lubGluZSBpbnQxNiBhbXJfd2Jfc2hsMV9yb3VuZChpbnQzMiBMX3ZhcjEpCi0gICAgewotICAgICAgICBpbnQzMiBMX3Zhcl9vdXQ7Ci0KLSAgICAgICAgX19hc20KLSAgICAgICAgewotICAgICAgICAgICAgcWFkZCBMX3Zhcl9vdXQsIExfdmFyMSwgTF92YXIxCi0gICAgICAgICAgICBxYWRkIExfdmFyX291dCwgTF92YXJfb3V0LCAoaW50MzIpIDB4MDAwMDgwMDBMCi0gICAgICAgICAgICBtb3YgTF92YXJfb3V0LCBMX3Zhcl9vdXQsIGFzciAjMTYKLSAgICAgICAgfQotICAgICAgICByZXR1cm4gTF92YXJfb3V0OwotICAgIH0KLQotICAgIF9faW5saW5lIGludDMyIG11bF8zMmJ5MTYoaW50MTYgaGksIGludDE2IGxvLCBpbnQxNiBuKQotICAgIHsKLSAgICAgICAgaW50MzIgSF8zMjsKLSAgICAgICAgaW50MzIgTF8zMjsKLSAgICAgICAgX19hc20KLSAgICAgICAgewotICAgICAgICAgICAgc211bGJiIEhfMzIsIGhpLCBuCi0gICAgICAgICAgICBzbXVsYmIgTF8zMiwgbG8sIG4KLSAgICAgICAgICAgIGFkZCBIXzMyLCBIXzMyLCBMXzMyLCBhc3IgIzE1Ci0gICAgICAgICAgICBxYWRkIEhfMzIsIEhfMzIsIEhfMzIKLSAgICAgICAgfQotCi0gICAgICAgIHJldHVybiAoSF8zMik7Ci0gICAgfQotCi0gICAgX19pbmxpbmUgIGludDMyIGZ4cF9tYWNfMTZieTE2KGNvbnN0IGludDE2IHZhcjEsIGNvbnN0IGludDE2IHZhcjIsIGludDMyIExfYWRkKQotICAgIHsKLSAgICAgICAgX19hc20KLSAgICAgICAgewotICAgICAgICAgICAgc21sYWJiIExfYWRkLCB2YXIxLCB2YXIyLCB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JhY3RfbChMX3NocigodmFyMSB0aW1lcyB2YXIyKSwxNSkpIGFuZAotICAgICAgICAgICAgICAgICAgIG11bHRfaW50MTYoLTMyNzY4LC0zMjc2OCkgPSAzMjc2Ny4KLQotICAgICAgICAgSW5wdXRzIDoKLSAgICAgICAgICB2YXIxCi0gICAgICAgICAgICAgICAgICAgMTYgYml0IHNob3J0IHNpZ25lZCBpbnRlZ2VyIChpbnQxNikgd2hvc2UgdmFsdWUgZmFsbHMgaW4gdGhlCi0gICAgICAgICAgICAgICAgICAgcmFuZ2UgOiAweGZmZmYgODAwMCA8PSB2YXIxIDw9IDB4MDAwMCA3ZmZmLgotCi0gICAgICAgICAgdmFyMgotICAgICAgICAgICAgICAgICAgIDE2IGJpdCBzaG9ydCBzaWduZWQgaW50ZWdlciAoaW50MTYpIHdob3NlIHZhbHVlIGZhbGxzIGluIHRoZQotICAgICAgICAgICAgICAgICAgIHJhbmdlIDogMHhmZmZmIDgwMDAgPD0gdmFyMSA8PSAweDAwMDAgN2ZmZi4KLQotCi0gICAgICAgICBSZXR1cm4gVmFsdWUgOgotICAgICAgICAgICAgICAgICAgIDE2IGJpdCBzaG9ydCBzaWduZWQgaW50ZWdlciAoaW50MTYpIHdob3NlIHZhbHVlIGZhbGxzIGluIHRoZQotICAgICAgICAgICAgICAgICAgIHJhbmdlIDogMHhmZmZmIDgwMDAgPD0gdmFyX291dCA8PSAweDAwMDAgN2ZmZi4KLQotICAgICAtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tKi8KLQotICAgIF9faW5saW5lIGludDE2IG11bHRfaW50MTYoaW50MTYgdmFyMSwgaW50MTYgdmFyMikKLSAgICB7Ci0gICAgICAgIGludDMyIExfcHJvZHVjdDsKLQotICAgICAgICBMX3Byb2R1Y3QgPSAoKGludDMyKSB2YXIxICogKGludDMyKSB2YXIyKSA+PiAxNT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B2YXIyKQotICAgIHsKLSAgICAgICAgaW50MzIgTF92YXJfb3V0OwotICAgICAgICBpbnQzMiBMX211bDsKLQotICAgICAgICBMX211bCAgPSAoKGludDMyKSB2YXIxICogKGludDMyKSB2YXIyKTsKLQotICAgICAgICBpZiAoTF9tdWwgIT0gMHg0MDAwMDAwMCkKLSAgICAgICAgewotICAgICAgICAgICAgTF9tdWwgPDw9IDE7Ci0gICAgICAgIH0KLSAgICAgICAgZWxzZQotICAgICAgICB7Ci0gICAgICAgICAgICBMX211bCA9IE1BWF8zMjsgICAgIC8qIHNhdHVyYXRpb24gKi8KLSAgICAgICAgfQotCi0gICAgICAgIExfdmFyX291dCA9IExfdmFyMyArIExfbXVsOwotCi0gICAgICAgIGlmICgoKExfbXVsIF4gTF92YXIzKSAmIE1JTl8zMikgPT0gMCkgIC8qIHNhbWUgc2lnbiA/ICovCi0gICAgICAgIHsKLSAgICAgICAgICAgIGlmICgoTF92YXJfb3V0IF4gTF92YXIzKSAmIE1JTl8zMikgIC8qIGFkZGl0aW9uIG1hdGNoZXMgc2lnbiA/ICovCi0gICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgTF92YXJfb3V0ID0gKExfdmFyMyA+PiAzMSkgXiBNQVhfMzI7Ci0gICAgICAgICAgICB9Ci0gICAgICAgIH0KLQotICAgICAgICByZXR1cm4gKExfdmFyX291dCk7Ci0gICAgfQotCi0KLQotICAgIC8qLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLQotCi0gICAgICAgICBGdW5jdGlvbiBOYW1lIDogbXN1XzE2YnkxNl9mcm9tX2ludDMyCi0KLSAgICAgICAgIE11bHRpcGx5IHZhcjEgYnkgdmFyMiBhbmQgc2hpZnQgdGhlIHJlc3VsdCBsZWZ0IGJ5IDEuIFN1YnRyYWN0IHRoZSAzMiBiaXQKLSAgICAgICAgIHJlc3V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LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0qLwotCi0gICAgX19pbmxpbmUgIGludDMyIG1zdV8xNmJ5MTZfZnJvbV9pbnQzMihpbnQzMiBMX3ZhcjMsIGludDE2IHZhcjEsIGludDE2IHZhcjIpCi0gICAgewotICAgICAgICBpbnQzMiBMX3Zhcl9vdXQ7Ci0gICAgICAgIGludDMyIExfbXVsOwotCi0gICAgICAgIExfbXVsICA9ICgoaW50MzIpIHZhcjEgKiAoaW50MzIpIHZhcjIpOwotCi0gICAgICAgIGlmIChMX211bCAhPSAweDQwMDAwMDAwKQotICAgICAgICB7Ci0gICAgICAgICAgICBMX211bCA8PD0gMTsKLSAgICAgICAgfQotICAgICAgICBlbHNlCi0gICAgICAgIHsKLSAgICAgICAgICAgIExfbXVsID0gTUFYXzMyOyAgICAgLyogc2F0dXJhdGlvbiAqLwotICAgICAgICB9Ci0KLSAgICAgICAgTF92YXJfb3V0ID0gTF92YXIzIC0gTF9tdWw7Ci0KLSAgICAgICAgaWYgKCgoTF9tdWwgXiBMX3ZhcjMpICYgTUlOXzMyKSAhPSAwKSAgLyogZGlmZmVyZW50IHNpZ24gPyAqLwotICAgICAgICB7Ci0gICAgICAgICAgICBpZiAoKExfdmFyX291dCBeIExfdmFyMykgJiBNSU5fMzIpICAvKiBkaWZmZXJlbmNlIG1hdGNoZXMgc2lnbiA/ICovCi0gICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgTF92YXJfb3V0ID0gKExfdmFyMyA+PiAzMSkgXiBNQVhfMzI7Ci0gICAgICAgICAgICB9Ci0gICAgICAgIH0KLQotICAgICAgICByZXR1cm4gKExfdmFyX291dCk7Ci0gICAgfQotCi0KLSAgICAvKi0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0KLQotICAgICAgICAgRnVuY3Rpb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tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tKi8KLQotCi0gICAgX19pbmxpbmUgIGludDMyIG11bF8xNmJ5MTZfdG9faW50MzIoaW50MTYgdmFyMSwgaW50MTYgdmFyMikKLSAgICB7Ci0gICAgICAgIGludDMyIExfbXVsOwotCi0gICAgICAgIExfbXVsICA9ICgoaW50MzIpIHZhcjEgKiAoaW50MzIpIHZhcjIpOwotCi0gICAgICAgIGlmIChMX211bCAhPSAweDQwMDAwMDAwKQotICAgICAgICB7Ci0gICAgICAgICAgICBMX211bCA8PD0gMTsKLSAgICAgICAgfQotICAgICAgICBlbHNlCi0gICAgICAgIHsKLSAgICAgICAgICAgIExfbXVsID0gTUFYXzMyOyAgICAgLyogc2F0dXJhdGlvbiAqLwotICAgICAgICB9Ci0KLSAgICAgICAgcmV0dXJuIChMX211bCk7Ci0KLSAgICB9Ci0KLSAgICAvKi0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0KLQotICAgICAgICAgRnVuY3Rpb24gTmFtZSA6IGFtcl93Yl9yb3VuZAotCi0gICAgICAgICBSb3VuZCB0aGUgbG93ZXIgMTYgYml0cyBvZiB0aGUgMzIgYml0IGlucHV0IG51bWJlciBpbnRvIHRoZSBNUyAxNiBiaXRzCi0gICAgICAgICB3aXRoIHNhdHVyYXRpb24uIFNoaWZ0IHRoZSByZXN1bHRpbmcgYml0cyByaWdodCBieSAxNiBhbmQgcmV0dXJuIHRoZSAxNgotICAgICAgICAgYml0IG51bWJlcjoKLSAgICAgICAgICAgICAgICAgICAgIHJvdW5kKExfdmFyMSkgPSBleHRyYWN0X2goTF9hZGQoTF92YXIxLDMyNzY4KSkKLQotICAgICAgICAgSW5wdXRzIDoKLSAgICAgICAgICBMX3ZhcjEKLSAgICAgICAgICAgICAgICAgICAzMiBiaXQgbG9uZyBza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iAodmFyX291dCk7Ci0gICAgfQotCi0gICAgLyotLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tCi0gICAgICAgICAgICAgRnVuY3Rpb24gTmFtZSA6IG11bF8zMmJ5MTYKLQotICAgICAgICAgICAgIE11bHRpcGx5IGEgMTYgYml0IGludGVnZXIgYnkgYSAzMiBiaXQgKERQRikuIFRoZSByZXN1bHQgaXMgZGl2aWRlZAotICAgICAgICAgICAgIGJ5IDJeMTUKLQotICAgICAgICAgICAgICAgICAgICBMXzMyID0gKGhpMSpsbzIpPDwxICsgKChsbzEqbG8yKT4+MTUpPDwxCi0KLSAgICAgICAgICAgICBJbnB1dHMgOgotCi0gICAgICAgICAgICAgaGkgICAgICAgICAgaGkgcGFydCBvZiAzMiBiaXQgbnVtYmVyLgotICAgICAgICAgICAgIGxvICAgICAgICAgIGxvIHBhcnQgb2YgMzIgYml0IG51bWJlci4KLSAgICAgICAgICAgICBuICAgICAgICAgICAxNiBiaXQgbnVtYmVyLgotCi0gICAgICAgICAtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tKi8KLQotCi0gICAgX19pbmxpbmUgaW50MzIgbXVsXzMyYnkxNihpbnQxNiBoaSwgaW50MTYgbG8sIGludDE2IG4pCi0gICAgewotICAgICAgICByZXR1cm4gKCgoKChpbnQzMiloaSpuKSkgKyAoKCgoaW50MzIpbG8qbikgPj4gMTUpKSkgPDwgMSk7Ci0gICAgfQotCi0gICAgX19pbmxpbmUgIGludDMyIGZ4cF9tYWNfMTZieTE2KGludDE2IHZhcjEsICBpbnQxNiB2YXIyLCBpbnQzMiBMX2FkZCkKLSAgICB7Ci0KLSAgICAgICAgTF9hZGQgKz0gKGludDMyKXZhcjEgKiB2YXIyO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AgICAgICAgICAgIj0mcippIihMX3Zhcl9hdXgpCi0gICAgICAgICAgICAgICAgICAgIDogInIiKHJhKSwKLSAgICAgICAgICAgICAgICAgICAgInIiKHJiKSk7Ci0KLSAgICAgICAgcmV0dXJuIChpbnQxNilMX3Zhcl9vdXQ7Ci0KLSAgICB9Ci0KLSAgICBzdGF0aWMgaW5saW5lIGludDE2IGFkZF9pbnQxNihpbnQxNiB2YXIxLCBpbnQxNiB2YXIyKQotewotICAgICAgICByZWdpc3RlciBpbnQzMiBMX3Zhcl9vdXQ7Ci0gICAgICAgIHJlZ2lzdGVyIGludDMyIExfdmFyX2F1eDsKLSAgICAgICAgcmVnaXN0ZXIgaW50MzIgcmEgPSAoaW50MzIpdmFyMTsKLSAgICAgICAgcmVnaXN0ZXIgaW50MzIgcmIgPSAoaW50MzIpdmFyMjsKLQotICAgICAgICBhc20gdm9sYXRpbGUoCi0gICAgICAgICAgICAibW92ICAlMCwgJTIsIGxzbCAjMTZcbiIKLSAgICAgICAgICAgICJtb3YgICUxLCAlMywgbHNsICMxNlxuIgotICAgICAgICAgICAgInFhZGQgJTAsICUwLCAlMVxuIgotICAgICAgICAgICAgIm1vdiAgJTAsICUwLCBhc3IgIzE2IgotICAgIDogIj0mcippIihMX3Zhcl9vdXQpLAotICAgICAgICAgICAgIj0mcippIihMX3Zhcl9hdXgpCi0gICAgICAgICAgICAgICAgICAgIDogInIiKHJhKSwKLSAgICAgICAgICAgICAgICAgICAgInIiKHJiKSk7Ci0KLSAgICAgICAgcmV0dXJuIChpbnQxNilMX3Zhcl9vdXQ7Ci0KLSAgICB9Ci0KLSAgICBzdGF0aWMgaW5saW5lICBpbnQzMiBtdWxfMzJieTE2KGludDE2IGhpLCBpbnQxNiBsbywgaW50MTYgbikKLXsKLSAgICAgICAgcmVnaXN0ZXIgaW50MzIgSF8zMjsKLSAgICAgICAgcmVnaXN0ZXIgaW50MzIgTF8zMjsKLSAgICAgICAgcmVnaXN0ZXIgaW50MzIgcmEgPSAoaW50MzIpaGk7Ci0gICAgICAgIHJlZ2lzdGVyIGludDMyIHJiID0gKGludDMyKWxvOwotICAgICAgICByZWdpc3RlciBpbnQzMiByYyA9IChpbnQzMiluOwotCi0KLSAgICAgICAgYXNtIHZvbGF0aWxlKAotICAgICAgICAgICAgInNtdWxiYiAlMCwgJTIsICU0XG4iCi0gICAgICAgICAgICAic211bGJiICUxLCAlMywgJTRcbiIKLSAgICAgICAgICAgICJhZGQgICAgJTAsICUwLCAlMSwgYXNyICMxNVxuIgotICAgICAgICAgICAgInFhZGQgICAlMCwgJTAsICUwIgotICAgIDogIj0mcippIihIXzMyKSwKLSAgICAgICAgICAgICI9JnIqaSIoTF8zMikKLSAgICAgICAgICAgICAgICAgICAgOiAiciIocmEpLAotICAgICAgICAgICAgICAgICAgICAiciIocmIpLAotICAgICAgICAgICAgICAgICAgICAiciIocmMpKTsKLQotICAgICAgICByZXR1cm4gSF8zMjsKLSAgICB9Ci0KLQotICAgIHN0YXRpYyBpbmxpbmUgaW50MzIgc3ViX2ludDMyKGludDMyIExfdmFyMSwgaW50MzIgTF92YXIyKQotewotICAgICAgICByZWdpc3RlciBpbnQzMiBMX3Zhcl9vdXQ7Ci0gICAgICAgIHJlZ2lzdGVyIGludDMyIHJhID0gTF92YXIxOwotICAgICAgICByZWdpc3RlciBpbnQzMiByYiA9IExfdmFyMjsKLQotICAgICAgICBhc20gdm9sYXRpbGUoCi0gICAgICAgICAgICAicXN1YiAlMCwgJTEsICUyIgotICAgIDogIj0mcippIihMX3Zhcl9vdXQpCi0gICAgICAgICAgICAgICAgICAgIDogInIiKHJhKSwKLSAgICAgICAgICAgICAgICAgICAgInIiKHJiKSk7Ci0KLSAgICAgICAgcmV0dXJuIExfdmFyX291dDsKLSAgICB9Ci0KLSAgICBzdGF0aWMgaW5saW5lIGludDMyIGFkZF9pbnQzMihpbnQzMiBMX3ZhcjEsIGludDMyIExfdmFyMikKLXsKLSAgICAgICAgcmVnaXN0ZXIgaW50MzIgTF92YXJfb3V0OwotICAgICAgICByZWdpc3RlciBpbnQzMiByYSA9IExfdmFyMTsKLSAgICAgICAgcmVnaXN0ZXIgaW50MzIgcmIgPSBMX3ZhcjI7Ci0KLSAgICAgICAgYXNtIHZvbGF0aWxlKAotICAgICAgICAgICAgInFhZGQgJTAsICUxLCAlMiIKLSAgICA6ICI9JnIqaSIoTF92YXJfb3V0KQotICAgICAgICAgICAgICAgICAgICA6ICJyIihyYSksCi0gICAgICAgICAgICAgICAgICAgICJyIihyYikpOwotCi0gICAgICAgIHJldHVybiBMX3Zhcl9vdXQ7Ci0gICAgfQotCi0gICAgc3RhdGljIGlubGluZSBpbnQzMiBtc3VfMTZieTE2X2Zyb21faW50MzIoaW50MzIgTF92YXIzLCBpbnQxNiB2YXIxLCBpbnQxNiB2YXIyKQotewotICAgICAgICByZWdpc3RlciBpbnQzMiBMX3Zhcl9vdXQ7Ci0gICAgICAgIHJlZ2lzdGVyIGludDMyIHJhID0gKGludDMyKXZhcjE7Ci0gICAgICAgIHJlZ2lzdGVyIGludDMyIHJiID0gKGludDMyKXZhcjI7Ci0gICAgICAgIHJlZ2lzdGVyIGludDMyIHJjID0gTF92YXIzOwotCi0gICAgICAgIGFzbSB2b2xhdGlsZSgKLSAgICAgICAgICAgICJzbXVsYmIgJTAsICUxLCAlMlxuIgotICAgICAgICAgICAgInFkc3ViICUwLCAlMywgJTAiCi0gICAgOiAiPSZyKmkiKExfdmFyX291dCkKLSAgICAgICAgICAgICAgICAgICAgOiAiciIocmEpLAotICAgICAgICAgICAgICAgICAgICAiciIocmIpLAotICAgICAgICAgICAgICAgICAgICAiciIocmMpKTsKLQotICAgICAgICByZXR1cm4gTF92YXJfb3V0OwotICAgIH0KLQotCi0gICAgc3RhdGljIGlubGluZSBpbnQzMiBtYWNfMTZieTE2X3RvX2ludDMyKGludDMyIExfdmFyMywgaW50MTYgdmFyMSwgaW50MTYgdmFyMikKLXsKLSAgICAgICAgcmVnaXN0ZXIgaW50MzIgTF92YXJfb3V0OwotICAgICAgICByZWdpc3RlciBpbnQzMiByYSA9IChpbnQzMil2YXIxOwotICAgICAgICByZWdpc3RlciBpbnQzMiByYiA9IChpbnQzMil2YXIyOwotICAgICAgICByZWdpc3RlciBpbnQzMiByYyA9IExfdmFyMzsKLQotICAgICAgICBhc20gdm9sYXRpbGUoCi0gICAgICAgICAgICAic211bGJiICUwLCAlMSwgJTJcbiIKLSAgICAgICAgICAgICJxZGFkZCAlMCwgJTMsICUwIgotICAgIDogIj0mcippIihMX3Zhcl9vdXQpCi0gICAgICAgICAgICAgICAgICAgIDogInIiKHJhKSwKLSAgICAgICAgICAgICAgICAgICAgInIiKHJiKSwKLSAgICAgICAgICAgICAgICAgICAgInIiKHJjKSk7Ci0KLSAgICAgICAgcmV0dXJuIExfdmFyX291dDsKLSAgICB9Ci0KLQotICAgIHN0YXRpYyBpbmxpbmUgIGludDMyIG11bF8xNmJ5MTZfdG9faW50MzIoaW50MTYgdmFyMSwgaW50MTYgdmFyMikKLXsKLSAgICAgICAgcmVnaXN0ZXIgaW50MzIgTF92YXJfb3V0OwotICAgICAgICByZWdpc3RlciBpbnQzMiByYSA9IChpbnQzMil2YXIxOwotICAgICAgICByZWdpc3RlciBpbnQzMiByYiA9IChpbnQzMil2YXIyOwotCi0gICAgICAgIGFzbSB2b2xhdGlsZSgKLSAgICAgICAgICAgICJzbXVsYmIgJTAsICUxLCAlMlxuIgotICAgICAgICAgICAgInFhZGQgJTAsICUwLCAlMCIKLSAgICA6ICI9JnIqaSIoTF92YXJfb3V0KQotICAgICAgICAgICAgICAgICAgICA6ICJyIihyYSksCi0gICAgICAgICAgICAgICAgICAgICJyIihyYikpOwotCi0gICAgICAgIHJldHVybiBMX3Zhcl9vdXQ7Ci0gICAgfQotCi0KLSAgICBzdGF0aWMgaW5saW5lIGludDE2IG11bHRfaW50MTYoaW50MTYgdmFyMSwgaW50MTYgdmFyMikKLXsKLSAgICAgICAgcmVnaXN0ZXIgaW50MzIgTF92YXJfb3V0OwotICAgICAgICByZWdpc3RlciBpbnQzMiByYSA9IChpbnQzMil2YXIxOwotICAgICAgICByZWdpc3RlciBpbnQzMiByYiA9IChpbnQzMil2YXIyOwotCi0gICAgICAgIGFzbSB2b2xhdGlsZSgKLSAgICAgICAgICAgICJzbXVsYmIgJTAsICUxLCAlMlxuIgotICAgICAgICAgICAgIm1vdiAlMCwgJTAsIGFzciAjMTUiCi0gICAgOiAiPSZyKmkiKExfdmFyX291dCkKLSAgICAgICAgICAgICAgICAgICAgOiAiciIocmEpLAotICAgICAgICAgICAgICAgICAgICAiciIocmIpKTsKLQotICAgICAgICByZXR1cm4gKGludDE2KUxfdmFyX291dDsKLSAgICB9Ci0KLSAgICBzdGF0aWMgaW5saW5lIGludDE2IGFtcl93Yl9yb3VuZChpbnQzMiBMX3ZhcjEpCi17Ci0gICAgICAgIHJlZ2lzdGVyIGludDMyIExfdmFyX291dDsKLSAgICAgICAgcmVnaXN0ZXIgaW50MzIgcmEgPSAoaW50MzIpTF92YXIxOwotICAgICAgICByZWdpc3RlciBpbnQzMiByYiA9IChpbnQzMikweDAwMDA4MDAwTDsKLQotICAgICAgICBhc20gdm9sYXRpbGUoCi0gICAgICAgICAgICAicWFkZCAlMCwgJTEsICUyXG4iCi0gICAgICAgICAgICAibW92ICUwLCAlMCwgYXNyICMxNiIKLSAgICA6ICI9JnIqaSIoTF92YXJfb3V0KQotICAgICAgICAgICAgICAgICAgICA6ICJyIihyYSksCi0gICAgICAgICAgICAgICAgICAgICJyIihyYikpOwotICAgICAgICByZXR1cm4gKGludDE2KUxfdmFyX291dDsKLSAgICB9Ci0KLSAgICBzdGF0aWMgaW5saW5lIGludDE2IGFtcl93Yl9zaGwxX3JvdW5kKGludDMyIExfdmFyMSkKLXsKLSAgICAgICAgcmVnaXN0ZXIgaW50MzIgTF92YXJfb3V0OwotICAgICAgICByZWdpc3RlciBpbnQzMiByYSA9IChpbnQzMilMX3ZhcjE7Ci0gICAgICAgIHJlZ2lzdGVyIGludDMyIHJiID0gKGludDMyKTB4MDAwMDgwMDBMOwotCi0gICAgICAgIGFzbSB2b2xhdGlsZSgKLSAgICAgICAgICAgICJxYWRkICUwLCAlMSwgJTFcbiIKLSAgICAgICAgICAgICJxYWRkICUwLCAlMCwgJTJcbiIKLSAgICAgICAgICAgICJtb3YgJTAsICUwLCBhc3IgIzE2IgotICAgIDogIj0mcippIihMX3Zhcl9vdXQpCi0gICAgICAgICAgICAgICAgICAgIDogInIiKHJhKSwKLSAgICAgICAgICAgICAgICAgICAgInIiKHJiKSk7Ci0gICAgICAgIHJldHVybiAoaW50MTYpTF92YXJfb3V0OwotICAgIH0KLQotCi0gICAgc3RhdGljIGlubGluZSBpbnQzMiBmeHBfbWFjXzE2YnkxNihjb25zdCBpbnQxNiBMX3ZhcjEsIGNvbnN0IGludDE2IExfdmFyMiwgaW50MzIgTF9hZGQpCi17Ci0gICAgICAgIHJlZ2lzdGVyIGludDMyIHRtcDsKLSAgICAgICAgcmVnaXN0ZXIgaW50MzIgcmEgPSAoaW50MzIpTF92YXIxOwotICAgICAgICByZWdpc3RlciBpbnQzMiByYiA9IChpbnQzMilMX3ZhcjI7Ci0gICAgICAgIHJlZ2lzdGVyIGludDMyIHJjID0gKGludDMyKUxfYWRkOwotCi0gICAgICAgIGFzbSB2b2xhdGlsZSgKLSAgICAgICAgICAgICJzbWxhYmIgJTAsICUxLCAlMiwgJTMiCi0gICAgOiAiPSZyKmkiKHRtcCkKLSAgICAgICAgICAgICAgICAgICAgOiAiciIocmEpLAotICAgICAgICAgICAgICAgICAgICAiciIocmIpLAotICAgICAgICAgICAgICAgICAgICAiciIocmMpKTsKLSAgICAgICAgcmV0dXJuICh0bXApOwotICAgIH0KLQotICAgIHN0YXRpYyBpbmxpbmUgaW50MzIgZnhwX211bF8xNmJ5MTZiYihpbnQxNiBMX3ZhcjEsIGNvbnN0IGludDE2IExfdmFyMikKLXsKLSAgICAgICAgcmVnaXN0ZXIgaW50MzIgdG1wOwotICAgICAgICByZWdpc3RlciBpbnQzMiByYSA9IChpbnQzMilMX3ZhcjE7Ci0gICAgICAgIHJlZ2lzdGVyIGludDMyIHJiID0gKGludDMyKUxfdmFyMjsKLQotICAgICAgICBhc20gdm9sYXRpbGUoCi0gICAgICAgICAgICAic211bGJiICUwLCAlMSwgJTIiCi0gICAgOiAiPSZyKmkiKHRtcCkKLSAgICAgICAgICAgICAgICAgICAgOiAiciIocmEpLAotICAgICAgICAgICAgICAgICAgICAiciIocmIpKTsKLSAgICAgICAgcmV0dXJuICh0bXApOwotICAgIH0KLQotCi0jZGVmaW5lIGZ4cF9tdWxfMTZieTE2KGEsIGIpICBmeHBfbXVsXzE2YnkxNmJiKCAgYSwgYikKLQotCi0gICAgc3RhdGljIGlubGluZSBpbnQzMiBmeHBfbXVsMzJfYnlfMTYoaW50MzIgTF92YXIxLCBjb25zdCBpbnQzMiBMX3ZhcjIpCi17Ci0gICAgICAgIHJlZ2lzdGVyIGludDMyIHRtcDsKLSAgICAgICAgcmVnaXN0ZXIgaW50MzIgcmEgPSAoaW50MzIpTF92YXIxOwotICAgICAgICByZWdpc3RlciBpbnQzMiByYiA9IChpbnQzMilMX3ZhcjI7Ci0KLSAgICAgICAgYXNtIHZvbGF0aWxlKAotICAgICAgICAgICAgInNtdWx3YiAlMCwgJTEsICUyIgotICAgIDogIj0mcippIih0bXApCi0gICAgICAgICAgICAgICAgICAgIDogInIiKHJhKSwKLSAgICAgICAgICAgICAgICAgICAgInIiKHJiKSk7Ci0gICAgICAgIHJldHVybiAodG1wKTsKLSAgICB9Ci0KLSNkZWZpbmUgZnhwX211bDMyX2J5XzE2YiggYSwgYikgICBmeHBfbXVsMzJfYnlfMTYoIGEsIGIpCi0KLQotI2VuZGlmCi0KLSNpZmRlZiBfX2NwbHVzcGx1cwotfQotI2VuZGlmCi0KLQotCi0KLSNlbmRpZiAgIC8qICBQVkFNUldCREVDT0RFUl9CQVNJQ19PUF9HQ0NfQVJNVjVfSCAgKi8KLQpkaWZmIC0tZ2l0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LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tKi8KLQotLyotLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tCi07IERFRklORVMKLTsgSW5jbHVkZSBhbGwgcHJlLXByb2Nlc3NvciBzdGF0ZW1lbnRzIGhlcmUuCi0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tKi8KLQotI2RlZmluZSBMX0ZSQU1FICAgICAgMjU2ICAgICAgICAgICAgICAgICAgIC8qIEZyYW1lIHNpemUgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotI2RlZmluZSBMX1NVQkZSMTZrICAgODAgICAgICAgICAgICAgICAgICAgIC8qIFN1YmZyYW1lIHNpemUgYXQgMTZrSHogICAgICAgICAgICAgICAgICAgICAqLwotCi0jZGVmaW5lIExfU1VCRlIgICAgICA2NCAgICAgICAgICAgICAgICAgICAgLyogU3ViZnJhbWUgc2l6ZSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0jZGVmaW5lIE5CX1NVQkZSICAgICA0ICAgICAgICAgICAgICAgICAgICAgLyogTnVtYmVyIG9mIHN1YmZyYW1lIHBlciBmcmFtZSAgICAgICAgICAgICAgICovCi0KLSNkZWZpbmUgTF9ORVhUICAgICAgIDY0ICAgICAgICAgICAgICAgICAgICAvKiBPdmVyaGVhZCBpbiBMUCBhbmFseXNpcyAgICAgICAgICAgICAgICAgICAgKi8KLSNkZWZpbmUgTF9XSU5ET1cgICAgIDM4NCAgICAgICAgICAgICAgICAgICAvKiB3aW5kb3cgc2l6ZSBpbiBMUCBhbmFseXNpcyAgICAgICAgICAgICAgICAgKi8KLSNkZWZpbmUgTF9UT1RBTCAgICAgIDM4NCAgICAgICAgICAgICAgICAgICAvKiBUb3RhbCBzaXplIG9mIHNwZWVjaCBidWZmZXIuICAgICAgICAgICAgICAgKi8KLSNkZWZpbmUgTSAgICAgICAgICAgIDE2ICAgICAgICAgICAgICAgICAgICAvKiBPcmRlciBvZiBMUCBmaWx0ZXIgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLSNkZWZpbmUgTTE2ayAgICAgICAgICAgICAyMAotCi0jZGVmaW5lIExfRklMVDE2ayAgICAxNSAgICAgICAgICAgICAgICAgICAgLyogRGVsYXkgb2YgZG93bi1zYW1wbGluZyBmaWx0ZXIgICAgICAgICAgICAgICovCi0jZGVmaW5lIExfRklMVCAgICAgICAxMiAgICAgICAgICAgICAgICAgICAgLyogRGVsYXkgb2YgdXAtc2FtcGxpbmcgZmlsdGVyICAgICAgICAgICAgICAgICovCi0KLSNkZWZpbmUgR1BfQ0xJUCAgICAgIDE1NTY1ICAgICAgICAgICAgICAgICAvKiBQaXRjaCBnYWluIGNsaXBwaW5nID0gMC45NSBRMTQgICAgICAgICAgICAgKi8KLSNkZWZpbmUgUElUX1NIQVJQICAgIDI3ODUzICAgICAgICAgICAgICAgICAvKiBwaXRjaCBzaGFycGVuaW5nIGZhY3RvciA9IDAuODUgUTE1ICAgICAgICAgKi8KLQotI2RlZmluZSBQSVRfTUlOICAgICAgMzQgICAgICAgICAgICAgICAgICAgIC8qIE1pbmltdW0gcGl0Y2ggbGFnIHdpdGggcmVzb2x1dGlvbiAxLzQgICAgICAqLwotI2RlZmluZSBQSVRfRlIyICAgICAgMTI4ICAgICAgICAgICAgICAgICAgIC8qIE1pbmltdW0gcGl0Y2ggbGFnIHdpdGggcmVzb2x1dGlvbiAxLzIgICAgICAqLwotI2RlZmluZSBQSVRfRlIxXzliICAgMTYwICAgICAgICAgICAgICAgICAgIC8qIE1pbmltdW0gcGl0Y2ggbGFnIHdpdGggcmVzb2x1dGlvbiAxICAgICAgICAqLwotI2RlZmluZSBQSVRfRlIxXzhiICAgOTIgICAgICAgICAgICAgICAgICAgIC8qIE1pbmltdW0gcGl0Y2ggbGFnIHdpdGggcmVzb2x1dGlvbiAxICAgICAgICAqLwotI2RlZmluZSBQSVRfTUFYICAgICAgMjMxICAgICAgICAgICAgICAgICAgIC8qIE1heGltdW0gcGl0Y2ggbGFnICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotI2RlZmluZSBMX0lOVEVSUE9MICAgKDE2KzEpICAgICAgICAgICAgICAgIC8qIExlbmd0aCBvZiBmaWx0ZXIgZm9yIGludGVycG9sYXRpb24gICAgICAgICAqLwotCi0jZGVmaW5lIE9QTF9ERUNJTSAgICAyICAgICAgICAgICAgICAgICAgICAgLyogRGVjaW1hdGlvbiBpbiBvcGVuLWxvb3AgcGl0Y2ggYW5hbHlzaXMgICAgICovCi0KLSNkZWZpbmUgUFJFRU1QSF9GQUMgIDIyMjgyICAgICAgICAgICAgICAgICAvKiBwcmVlbXBoYXNpcyBmYWN0b3IgKDAuNjggaW4gUTE1KSAgICAgICAgICAgKi8KLSNkZWZpbmUgR0FNTUExICAgICAgIDMwMTQ3ICAgICAgICAgICAgICAgICAvKiBXZWlnaHRpbmcgZmFjdG9yIChudW1lcmF0b3IpICgwLjkyIGluIFExNSkgKi8KLSNkZWZpbmUgVElMVF9GQUMgICAgIDIyMjgyICAgICAgICAgICAgICAgICAvKiB0aWx0IGZhY3RvciAoZGVub21pbmF0b3IpICgwLjY4IGluIFExNSkgICAgKi8KLQotI2RlZmluZSBRX01BWCAgICAgICAgOCAgICAgICAgICAgICAgICAgICAgIC8qIHNjYWxpbmcgbWF4IGZvciBzaWduYWwgKHNlZSBzeW5fZmlsdF8zMikgICAqLwotCi0jZGVmaW5lIFJBTkRPTV9JTklUU0VFRCAgMjE4NDUgICAgICAgICAgICAgLyogb3duIHJhbmRvbSBpbml0IHZhbHVlICAgICAgICAgICAgICAgICAgICAgICovCi0KLSNkZWZpbmUgTF9NRUFOQlVGICAgICAgICAzCi0jZGVmaW5lIE9ORV9QRVJfTUVBTkJVRiAxMDkyM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ICAgIDEwNzIsICAzMDYyLAotICAgIDEyODEsICA0NzU5LAotICAgIDE2NDcsICAxNTM5LAotICAgIDE4NDUsICA3MDIwLAotICAgIDE4NTMsICAgNjM0LAotICAgIDE5OTUsICAyMzM2LAotICAgIDIzNTEsIDE1NDAwLAotICAgIDI2NjEsICAxMTY1LAotICAgIDI3MDIsICAzOTAwLAotICAgIDI3MTAsIDEwMTMzLAotICAgIDMxOTUsICAxNzUyLAotICAgIDM0OTgsICAyNjI0LAotICAgIDM2NjMsICAgODQ5LAotICAgIDM5ODQsICA1Njk3LAotICAgIDQyMTQsICAzMzk5LAotICAgIDQ0MTUsICAxMzA0LAotICAgIDQ2OTUsICAyMDU2LAotICAgIDUzNzYsICA0NTU4LAotICAgIDUzODYsICAgNjc2LAotICAgIDU1MTgsIDIzNTU0LAotICAgIDU1NjcsICA3Nzk0LAotICAgIDU2NDQsICAzMDYxLAotICAgIDU2NzIsICAxNTEzLAotICAgIDU5NTcsICAyMzM4LAotICAgIDY1MzMsICAxMDYwLAotICAgIDY4MDQsICA1OTk4LAotICAgIDY4MjAsICAxNzY3LAotICAgIDY5MzcsICAzODM3LAotICAgIDcyNzcsICAgNDE0LAotICAgIDczMDUsICAyNjY1LAotICAgIDc0NjYsIDExMzA0LAotICAgIDc5NDIsICAgNzk0LAotICAgIDgwMDcsICAxOTgyLAotICAgIDgwMDcsICAxMzY2LAotICAgIDgzMjYsICAzMTA1LAotICAgIDgzMzYsICA0ODEwLAotICAgIDg3MDgsICA3OTU0LAotICAgIDg5ODksICAyMjc5LAotICAgIDkwMzEsICAxMDU1LAotICAgIDkyNDcsICAzNTY4LAotICAgIDkyODMsICAxNjMxLAotICAgIDk2NTQsICA2MzExLAotICAgIDk4MTEsICAyNjA1LAotICAgIDEwMTIwLCAgIDY4MywKLSAgICAxMDE0MywgIDQxNzksCi0gICAgMTAyNDUsICAxOTQ2LAotICAgIDEwMzM1LCAgMTIxOCwKLSAgICAxMDQ2OCwgIDk5NjAsCi0gICA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AxMTEwOCwgMTIxNDQsIDEzMTg0LCAxNDE2NSwgIDM4MDMKLX07Ci0KLQotLyogMjggYml0cyAqLwotLyoKLSAqICBpc2YgY29kZWJvb2tzOiAgc3BsaXQtYnktNSBWUQotICoKLSAqICBjb2RlYm9vayAgIHZlY3RvciBkaW1lbnNpb24gICAgbnVtYmVyIG9mIHZlY3RvcnMKLSAqICB+fn5+fn5+fiAgIH5+fn5+fn5+fn5+fn5+fn4gICAgfn5+fn5+fn5+fn5+fn5+fn4KLSAqICAgICAxICAgICAgICAgICAgMiAgICAgICAgICAgICAgICAgIDY0Ci0gKiAgICAgMiAgICAgICAgICAgIDMgICAgICAgICAgICAgICAgICA2NAotICogICAgIDMgICAgICAgICAgICAzICAgICAgICAgICAgICAgICAgNjQKLSAqICAgICA0ICAgICAgICAgICAgNCAgICAgICAgICAgICAgICAgIDMyCi0gKiAgICAgNSAgICAgICAgICAgIDQgICAgICAgICAgICAgICAgICAzMgotICovCi0KLS8qCi0gKiAxc3Qgc3BsaXQ6ICAgaXNmMCB0byBpc2YxCi0gKi8KLQotCi1jb25zdCBpbnQxNiBkaWNvMV9pc2Zfbm9pc2VbU0laRV9CS19OT0lTRTEqMl0gPQotewotCi0gICAgLTI2OSwgIC02NzMsCi0gICAgLTIyMiwgIC01MzcsCi0gICAgLTIzMywgIC00MzAsCi0gICAgLTEzOCwgIC00NTEsCi0gICAgLTIxMiwgIC0zMzEsCi0gICAgLTE5MiwgIC0yNDEsCi0gICAgLTg3LCAgLTIzMSwKLSAgICAtMTkxLCAgLTEyOCwKLSAgICAtNzAsICAtMTA2LAotICAgIC0xNjQsICAgIC02LAotICAgIDc0LCAgLTE3OSwKLSAgICAyNywgICAtMzMsCi0gICAgLTEwMiwgICAgNzQsCi0gICAgLTE2MiwgICAxMTUsCi0gICAgLTk0LCAgIDE3MiwKLSAgICAtNiwgICAxMzAsCi0gICAgLTE0MywgICAyMzQsCi0gICAgMTQsICAgMjE4LAotICAgIC02NSwgICAyNzAsCi0gICAgODgsICAgMTgyLAotICAgIC0xMjQsICAgMzQxLAotICAgIC00NCwgICAzODEsCi0gICAgMzgsICAgMzM1LAotICAgIDExNywgICAyNzQsCi0gICAgLTExMiwgICA0NTQsCi0gICAgNzQsICAgNDMxLAotICAgIC01LCAgIDQ4OCwKLSAgICAxNzUsICAgMzg0LAotICAgIC04MywgICA1NjEsCi0gICAgMTIyLCAgIDUyOSwKLSAgICAyMSwgICA2MDEsCi0gICAgMjI5LCAgIDQ4MSwKLSAgICAyMzEsICAgMzAzLAotICAgIDIyNiwgICA2MDgsCi0gICAgMzAwLCAgIDM3MiwKLSAgICAyMTAsICAgMTg3LAotICAgIDMwNiwgICAyNjUsCi0gICAgMzI4LCAgIDQ3MywKLSAgICAzODIsICAgMzMxLAotICAgIDM3MSwgICAxMzIsCi0gICAgMTM5LCAgICA1OCwKLSAgICAzNjUsICAgIDIxLAotICAgIDI1MCwgICAtODIsCi0gICAgNDQzLCAgIDIxOCwKLSAgICA0ODMsICAgMTEwLAotICAgIDQyNiwgICA0MTUsCi0gICAgNTc5LCAgIDIyMiwKLSAgICA1MTgsICAgMzMzLAotICAgIDU3MywgICA0NDgsCi0gICAgNDU1LCAgIDUyOSwKLSAgICA2ODUsICAgMzI5LAotICAgIDMzMiwgICA1ODAsCi0gICAgNTk1LCAgIDU5MywKLSAgICA0NjgsICAgNjQ1LAotICAgIDc2MiwgICA1MTcsCi0gICAgMzI2LCAgIDcwOSwKLSAgICA0ODUsICAgNzkzLAotICAgIDEzMCwgICA2ODQsCi0gICAgNjcxLCAgIDczNywKLSAgICAzNTQsICAgODc2LAotICAgIDg4LCAgIDgwNiwKLSAgICAtNjUsICAgNzA2LAotICAgIC0zNSwgIDEwMTYsCi0gICAgMjY2LCAgMTEyMwotfTsKLQotCi0vKgotICogMm5kIHNwbGl0OiAgIGlzZjIgdG8gaXNmNAotICovCi0KLWNvbnN0IGludDE2IGRpY28yX2lzZl9ub2lzZVtTSVpFX0JLX05PSVNFMiozXSA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OCwgICAzMTgsICAgMTMxLAotICAgIC05MywgIC0xOTAsICAgNDIwLAotICAgIC05NywgICAxMjIsICAgNDkxLAotICAgIC03OSwgICAzMTcsICAgMzU1LAotICAgIDEzMCwgICAxMDAsICAgMzI1LAotICAgIDg2LCAgLTI5MywgICAyMTAsCi0gICAgMTMzLCAgIDI1OCwgICAxNjEsCi0gICAgMTc2LCAgIC03MywgICA0NjUsCi0gICAgMTk1LCAgIDMwMCwgICAzODQsCi0gICAgMzQ4LCAgICAyMiwgICAyMjEsCi0gICAgMzc2LCAgIDE4MywgICA0MDksCi0gICAgMzc3LCAgIDI4NiwgICAyMDIsCi0gICAgMjQyLCAgIDIxMywgICA2NTksCi0gICAgMjU3LCAgIDU2NSwgICAyNDgsCi0gICAgMzQ0LCAgIDQwOCwgICAtNzYsCi0gICAgNDA1LCAgIDQ0MCwgICA1MDksCi0gICAgNjEyLCAgIDM4NSwgICAzNzksCi0gICAgNTM2LCAgIDYwNywgICAyMTYsCi0gICAgLTU2LCAgIDU4MiwgICAxOTIsCi0gICAgMTAwLCAgIDUxNywgICA1NjcsCi0gICAgLTM2NSwgICA0NDgsICAgNDQ1LAotICAgIDcyOCwgICAzNDcsICAgIDEwLAotICAgIDUwNSwgICAzNTcsICAgNzU5LAotICAgIDYzNiwgICA1ODIsICAgNjU4LAotICAgIDMzNSwgICA1MTcsICAgODUyLAotICAgIDM3OCwgICA4MDksICAgNTcyLAotICAgIC0xOTUsICAgODc4LCAgIDgyOSwKLSAgICA1MjksICAgNzA3LCAgIDk4NywKLSAgICA5MTgsICAgNzI2LCAgIDM5MiwKLSAgICAxMjUwLCAgIDk5NywgIDEwNjMKLX07Ci0KLS8qCi0gKiAzcmQgc3BsaXQ6ICAgaXNmNSB0byBpc2Y3Ci0gKi8KLQotY29uc3QgaW50MTYgZGljbzNfaXNmX25vaXNlW1NJWkVfQktfTk9JU0UzKjNdID0KLXsKLQotICAgIC04MDUsICAtODM4LCAgLTc3NCwKLSAgICAtNTIyLC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ICAgKgotICogRGVjb2Rpbmcgb2YgSVNGIHBhcmFtZXRlcnMgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKgotICotLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tKi8KLQotdm9pZCBEcGlzZl8yc180NmIoCi0gICAgaW50MTYgKiBpbmRpY2UsICAgLyogaW5wdXQ6ICBxdWFudGl6YXRpb24gaW5kaWNlcyAgICAgICAgICAgICAgICAgICAgICAgKi8KLSAgICBpbnQxNiAqIGlzZl9xLCAgICAvKiBvdXRwdXQ6IHF1YW50aXplZCBJU0YgaW4gZnJlcXVlbmN5IGRvbWFpbiAoMC4uMC41KSAqLwotICAgIGludDE2ICogcGFzdF9pc2ZxLC8qIGkvMCAgIDogcGFzdCBJU0YgcXVhbnRpemVyICAgICAgICAgICAgICAgICAgICAqLwotICAgIGludDE2ICogaXNmb2xkLCAgIC8qIGlucHV0IDogcGFzdCBxdWFudGl6ZWQgSVNGICAgICAgICAgICAgICAgICAgICAqLwotICAgIGludDE2ICogaXNmX2J1ZiwgIC8qIGlucHV0IDogaXNmIGJ1ZmZlciAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotICAgIGludDE2IGJmaSwgICAgICAgIC8qIGlucHV0IDogQmFkIGZyYW1lIGluZGljYXRvciAgICAgICAgICAgICAgICAgICAqLwotICAgIGludDE2IGVuY19kZWMKLSkKLXsKLSAgICBpbnQxNiByZWZfaXNmW01dOwotICAgIGludDE2IGksIGosIHRtcDsKLSAgICBpbnQzMiBMX3RtcDsKLQotCi0gICAgaWYgKGJmaSA9PSAwKSAgICAgICAgICAgICAgICAgICAgICAgICAgLyogR29vZCBmcmFtZSAqLwotICAgIHsKLSAgICAgICAgZm9yIChpID0gMDsgaSA8IDk7IGkrKykKLSAgICAgICAgewotICAgICAgICAgICAgaXNmX3FbaV0gPSBkaWNvMV9pc2ZbKGluZGljZVswXSA8PCAzKSArIGluZGljZVswXSArIGldOwotICAgICAgICB9Ci0gICAgICAgIGZvciAoaSA9IDA7IGkgPCA3OyBpKyspCi0gICAgICAgIHsKLSAgICAgICAgICAgIGlzZl9xW2kgKyA5XSA9IGRpY28yX2lzZlsoaW5kaWNlWzFdIDw8IDMpIC0gaW5kaWNlWzFdICsgaV07Ci0gICAgICAgIH0KLQotICAgICAgICBmb3IgKGkgPSAwOyBpIDwgMzsgaSsrKQotICAgICAgICB7Ci0gICAgICAgICAgICBpc2ZfcVtpXSAgICAgICs9IGRpY28yMV9pc2ZbaW5kaWNlWzJdICogMyArIGldOwotICAgICAgICAgICAgaXNmX3FbaSArIDNdICArPSBkaWNvMjJfaXNmW2luZGljZVszXSAqIDMgKyBpXTsKLSAgICAgICAgICAgIGlzZl9xW2kgKyA2XSAgKz0gZGljbzIzX2lzZltpbmRpY2VbNF0gKiAzICsgaV07Ci0gICAgICAgICAgICBpc2ZfcVtpICsgOV0gICs9IGRpY28yNF9pc2ZbaW5kaWNlWzVdICogMyArIGldOwotICAgICAgICAgICAgaXNmX3FbaSArIDEyXSArPSBkaWNvMjVfaXNmWyhpbmRpY2VbNl0gPDwgMikgKyBpXTsKLSAgICAgICAgfQotCi0gICAgICAgIGlzZl9xW2kgKyAxMl0gKz0gZGljbzI1X2lzZlsoaW5kaWNlWzZdIDw8IDIpICsgaV07Ci0KLSAgICAgICAgZm9yIChpID0gMDsgaSA8IE9SREVSOyBpKyspCi0gICAgICAgIHsKLSAgICAgICAgICAgIHRtcCA9IGlzZl9xW2ldOwotICAgICAgICAgICAgaXNmX3FbaV0gKz0gbWVhbl9pc2ZbaV07Ci0gICAgICAgICAgICBpc2ZfcVtpXSArPSAoKGludDMyKU1VICogcGFzdF9pc2ZxW2ldKSA+PiAxNTsKLSAgICAgICAgICAgIHBhc3RfaXNmcVtpXSA9IHRtcDsKLSAgICAgICAgfQotCi0KLSAgICAgICAgaWYgKGVuY19kZWMpCi0gICAgICAgIHsKLSAgICAgICAgICAgIGZvciAoaSA9IDA7IGkgPCBNOyBpKyspCi0gICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgZm9yIChqID0gKExfTUVBTkJVRiAtIDEpOyBqID4gMDsgai0tKQotICAgICAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAgICAgaXNmX2J1ZltqICogTSArIGldID0gaXNmX2J1ZlsoaiAtIDEpICogTSArIGldOwotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICBpc2ZfYnVmW2ldID0gaXNmX3FbaV07Ci0gICAgICAgICAgICB9Ci0gICAgICAgIH0KLSAgICB9Ci0gICAgZWxzZQotICAgIHsgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8qIGJhZCBmcmFtZSAqLwotICAgICAgICBmb3IgKGkgPSAwOyBpIDwgTTsgaSsrKQotICAgICAgICB7Ci0gICAgICAgICAgICBMX3RtcCA9IG11bF8xNmJ5MTZfdG9faW50MzIobWVhbl9pc2ZbaV0sIDgxOTIpOwotICAgICAgICAgICAgZm9yIChqID0gMDsgaiA8IExfTUVBTkJVRjsgaisrKQotICAgICAgICAgICAgewotICAgICAgICAgICAgICAgIExfdG1wID0gbWFjXzE2YnkxNl90b19pbnQzMihMX3RtcCwgaXNmX2J1ZltqICogTSArIGldLCA4MTkyKTsKLSAgICAgICAgICAgIH0KLSAgICAgICAgICAgIHJlZl9pc2ZbaV0gPSBhbXJfd2Jfcm91bmQoTF90bXApOwotICAgICAgICB9Ci0KLSAgICAgICAgLyogdXNlIHRoZSBwYXN0IElTRnMgc2xpZ2h0bHkgc2hpZnRlZCB0b3dhcmRzIHRoZWlyIG1lYW4gKi8KLSAgICAgICAgZm9yIChpID0gMDsgaSA8IE9SREVSOyBpKyspCi0gICAgICAgIHsKLSAgICAgICAgICAgIGlzZl9xW2ldID0gYWRkX2ludDE2KG11bHRfaW50MTYoQUxQSEEsIGlzZm9sZFtpXSksIG11bHRfaW50MTYoT05FX0FM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VkIElTRiAgICAgICAgICAgICAgICAgICAgKi8KLSAgICBpbnQxNiAqIGlzZl9idWYsICAgLyogaW5wdXQgOiBpc2YgYnVmZmVyICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0gICAgaW50MTYgYmZpLCAgICAgICAgIC8qIGlucHV0IDogQmFkIGZyYW1lIGluZGljYXRvciAgICAgICAgICAgICAgICAgICAqLwotICAgIGludDE2IGVuY19kZWMKLSkKLXsKLSAgICBpbnQxNiByZWZfaXNmW01dOwotICAgIGludDE2IGksIGosIHRtcDsKLSAgICBpbnQzMiBMX3RtcDsKLQotCi0gICAgaWYgKGJmaSA9PSAwKSAgICAgICAgICAgICAgICAgICAgICAgICAgLyogR29vZCBmcmFtZSAqLwotICAgIHsKLSAgICAgICAgZm9yIChpID0gMDsgaSA8IDk7IGkrKykKLSAgICAgICAgewotICAgICAgICAgICAgaXNmX3FbaV0gPSBkaWNvMV9pc2ZbaW5kaWNlWzBdICogOSArIGldOwotICAgICAgICB9Ci0gICAgICAgIGZvciAoaSA9IDA7IGkgPCA3OyBpKyspCi0gICAgICAgIHsKLSAgICAgICAgICAgIGlzZl9xW2kgKyA5XSA9IGFkZF9pbnQxNihkaWNvMl9pc2ZbaW5kaWNlWzFdICogNyArIGldLCBkaWNvMjNfaXNmXzM2YltpbmRpY2VbNF0gKiA3ICsgaV0pOwotICAgICAgICB9Ci0KLSAgICAgICAgZm9yIChpID0gMDsgaSA8IDU7IGkrKykKLSAgICAgICAgewotICAgICAgICAgICAgaXNmX3FbaV0gPSBhZGRfaW50MTYoaXNmX3FbaV0sIGRpY28yMV9pc2ZfMzZiW2luZGljZVsyXSAqIDUgKyBpXSk7Ci0gICAgICAgIH0KLSAgICAgICAgZm9yIChpID0gMDsgaSA8IDQ7IGkrKykKLSAgICAgICAgewotICAgICAgICAgICAgaXNmX3FbaSArIDVdID0gYWRkX2ludDE2KGlzZl9xW2kgKyA1XSwgZGljbzIyX2lzZl8zNmJbKGluZGljZVszXSA8PCAyKSArIGldKTsKLSAgICAgICAgfQotCi0gICAgICAgIGZvciAoaSA9IDA7IGkgPCBPUkRFUjsgaSsrKQotICAgICAgICB7Ci0gICAgICAgICAgICB0bXAgPSBpc2ZfcVtpXTsKLSAgICAgICAgICAgIGlzZl9xW2ldID0gYWRkX2ludDE2KHRtcCwgbWVhbl9pc2ZbaV0pOwotICAgICAgICAgICAgaXNmX3FbaV0gPSBhZGRfaW50MTYoaXNmX3FbaV0sIG11bHRfaW50MTYoTVUsIHBhc3RfaXNmcVtpXSkpOwotICAgICAgICAgICAgcGFzdF9pc2ZxW2ldID0gdG1wOwotICAgICAgICB9Ci0KLQotICAgICAgICBpZiAoZW5jX2RlYykKLSAgICAgICAgewotICAgICAgICAgICAgZm9yIChpID0gMDsgaSA8IE07IGkrKykKLSAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICBmb3IgKGogPSAoTF9NRUFOQlVGIC0gMSk7IGogPiAwOyBqLS0pCi0gICAgICAgICAgICAgICAgewotICAgICAgICAgICAgICAgICAgICBpc2ZfYnVmW2ogKiBNICsgaV0gPSBpc2ZfYnVmWyhqIC0gMSkgKiBNICsgaV07Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgIGlzZl9idWZbaV0gPSBpc2ZfcVtpXTsKLSAgICAgICAgICAgIH0KLSAgICAgICAgfQotICAgIH0KLSAgICBlbHNlCi0gICAgeyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLyogYmFkIGZyYW1lICovCi0gICAgICAgIGZvciAoaSA9IDA7IGkgPCBNOyBpKyspCi0gICAgICAgIHsKLSAgICAgICAgICAgIExfdG1wID0gbXVsXzE2YnkxNl90b19pbnQzMihtZWFuX2lzZltpXSwgODE5Mik7Ci0gICAgICAgICAgICBmb3IgKGogPSAwOyBqIDwgTF9NRUFOQlVGOyBqKyspCi0gICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgTF90bXAgPSBtYWNfMTZieTE2X3RvX2ludDMyKEx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WtlIHN1cmUgdGhhdCB0aGUgIGlzZnMgYXJlIHByb3Blcmx5IG9yZGVyIGFuZCB0byBrZWVwIGEgY2VydGFpbgotICogbWluaW11bSBkaXN0YW5jZSBiZXR3ZWVuIGNvbnNlY3V0aXZlIGlzZnMuCi0gKgotICogICAgQXJndW1lbnQgICAgICAgICBkZXNjcmlwdGlvbiAgICAgICAgICAgICAgICAgICAgIGluL291dAotICogICAgfn5+fn5+fn4gICAgICAgICB+fn5+fn5+fn5+fiAgICAgICAgICAgICAgICAgICAgIH5+fn5+fgotICogICAgIGlzZltdICAgICAgICAgICB2ZWN0b3Igb2YgaXNmcyAgICAgICAgICAgICAgICAgICAgaS9vCi0gKiAgICAgbWluX2Rpc3QgICAgICAgIG1pbmltdW0gcmVxdWlyZWQgZGlzdGFuY2UgICAgICAgICBpCi0gKiAgICAgbiAgICAgICAgICAgICAgIExQQyBvcmRlciAgICAgICAgICAgICAgICAgICAgICAgICBpCi0gKi8KLQotdm9pZCBSZW9yZGVyX2lzZigKLSAgICBpbnQxNiAqIGlzZiwgICAgICAgICAgICAgICAgICAgICAgICAgLyogKGkvbykgUTE1OiBJU0YgaW4gdGhlIGZyZXF1ZW5jeSBkb21haW4gKDAuLjAuNSkgKi8KLSAgICBpbnQxNiBtaW5fZGlzdCwgICAgICAgICAgICAgICAgICAgICAgLyogKGkpIFExNSAgOiBtaW5pbXVtIGRpc3RhbmNlIHRvIGtlZXAgICAgICAgICAgICAgKi8KLSAgICBpbnQxNiBuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLyogKGkpICAgICAgOiBudW1iZXIgb2YgSVNGICAgICAgICAgICAgICAgICAgICAgICAgKi8KLSkKLXsKLSAgICBpbnQxNiBpLCBpc2ZfbWluOwotCi0gICAgaXNmX21pbiA9IG1pbl9kaXN0OwotCi0gICAgZm9yIChpID0gMDsgaSA8IG4gLSAxOyBpKyspCi0gICAgewotICAgICAgICBpZiAoaXNmW2ldIDwgaXNmX21pbikKLSAgICAgICAg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AgdmVjdG9yIGRpbWVuc2lvbiAgICBudW1iZXIgb2YgdmVjdG9ycwotICogIH5+fn5+fn5+ICAgfn5+fn5+fn5+fn5+fn5+fiAgICB+fn5+fn5+fn5+fn5+fn5+fgotICogICAgIDFfMSAgICAgICAgICAgIDkgICAgICAgICAgICAgICAgICAyNTYKLSAqICAgICAxXzIgICAgICAgICAgICA3ICAgICAgICAgICAgICAgICAgMjU2Ci0gKiAgICAgMl8xICAgICAgICAgICAgMyAgICAgICAgICAgICAgICAgIDY0Ci0gKiAgICAgMl8yICAgICAgICAgICAgMyAgICAgICAgICAgICAgICAgIDEyOAotICogICAgIDJfMyAgICAgICAgICAgIDMgICAgICAgICAgICAgICAgICAxMjgKLSAqICAgICAyXzQgICAgICAgICAgICAzICAgICAgICAgICAgICAgICAgMzIKLSAqICAgICAyXzUgICAgICAgICAgICA0ICAgICAgICAgICAgICAgICAgMzIKLSAqLwotCi0vKgotICogMXN0IHN0YWdlIGNvZGVib29rOyAxc3Qgc3BsaXQ6ICAgaXNmMCB0byBpc2Y4Ci0gKi8KLQotY29uc3QgaW50MTYgZGljbzFfaXNmW1NJWkVfQksxKjldID0KLXsKLQotICAgIDU3OSwgIDEwODEsICAxMDM1LCAgIDM5MCwgICAgIDMsICAtMjYzLCAgLTE5OCwgICAtODIsICAgIDM4LAotICAgIDE4LCAgIC02OCwgICAtMTIsICAgMzEzLCAgIDc2MSwgICA0MDUsICAgMjQ5LCAgIDExMSwgICAtNzYsCi0gICAgNzQwLCAgMTI2MywgIDEyOTIsICAxMDA2LCAgIDk5NywgIDEwMTksICAxMDE3LCAgIDk3NiwgICA5MjMsCi0gICAgLTkxLCAgIDgyNywgICA5NDgsICAgNjQ4LCAgIDYxMywgICA1MzUsICAgNTIyLCAgIDQ5MCwgICA0MjEsCi0gICAgNDEsICAgLTQ0LCAgLTI4MSwgIC00NzIsICAgNjUyLCAgIDUzNCwgICAxOTMsICAgMTM1LCAgIC05MCwKLSAgICA0MSwgIC0xMjEsIC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gLTY2MiwgIC05OTksIC0xMTk5LCAtMTI0MywgIC02NzYsICAtMjk3LAotICAgIC02OCwgIC0yNzMsICAtNjExLCAgIDEzNywgIC0xNDYsICAtMzk3LCAgLTYyNywgIC04NDUsICAtMjIwLAotICAgIC0xMTIsICAtMzQ2LCAgLTc5NywgIC04MjYsICAgMjM0LCAgLTEzMiwgIC0xODgsICAtMjc4LCAgLTUyMiwKLSAgICAtMTU5LCAgLTQwNSwgIC03MzQsICAtNDE5LCAgIDI5MywgICAgNzQsICAtMTY3LCAgLTE2NywgICAxODQsCi0gICAgLTE1MywgIC00MzcsICAtODMzLCAtMTA4MCwgIC0zMzYsICAtNDcyLCAgLTU2MSwgIC0zNDAsICAtMjUzLAotICAgIC0xNjksICAtNDIzLCAgLTgyMCwgIC05MDQsICAtMTMxLCAgIC0xOSwgIC0zNDYsICAtNjA0LCAgICAzMSwKLSAgICAzMywgICAtMzEsICAgMzEyLCAgICA2MiwgIC0xNDgsICAgIDQ5LCAgIC01OSwgICA1NjQsICAgNDg2LAotICAgIC0zMDYsICAtMzMzLCAgIDE5NCwgICAtNDQsICAgIDY3LCAgICA3MiwgICAxNDcsICAgMjA1LCAgIDI0MywKLSAgICAtMjA3LCAgIC00OSwgIDEzNjAsICAgOTgzLCAgIDk2OSwgICA5OTEsICAxMDE0LCAgMTExMCwgICA5NzMsCi0gICAgLTIxMSwgIC0xNzIsICAgODgzLCAgIDYyNywgICA3MTEsICAgNjc0LCAgIDcwNSwgICA3OTgsICAgNzQ2LAotICAgIC04OCwgIC0zMjUsICAtNzYzLCAgLTk3NCwgICA2ODcsICAgOTA4LCAgIDUxNCwgICAzODIsICAgMTcyLAotICAgIC0yOTIsICAtNjEyLCAgLTgwNSwgICAgNjMsICAgMTMxLCAgIDI3MCwgICAyNTksICAgMzUyLCAgIDM0OCwKLSAgICAtMjM1LCAgIC04NCwgICA5NTUsICAgODE4LCAgMTEyMCwgIDEyODksICAxNTU5LCAgMTQ4MCwgIDEyODUsCi0gIC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k4LCAgIDQwMCwgICAzMjksICAgMjUyLAotICAgIDE5MSwgICAxODAsICAtMTM3LCAgLTQ2NywgICAyNzIsICAgMTA2LCAgIC05NSwgICAgMTcsICAtMTkyLAotICAgIC04MCwgIC0yOTAsICAtNjI2LCAgIDE5NCwgICA1OTgsICAgMTk2LCAgICAyMSwgIC0yODEsICAgIDc3LAotICAgIDUxMCwgICA4NjQsICAxMTA4LCAgIDgwNywgICA5MzksICAgOTAyLCAgIDkyNSwgICA3MTcsICAgNDgxLAotICAgIDEzNywgICAzNjcsICAgNTM0LCAgIDc2NCwgICA2NzAsICAgMzgyLCAgIDI5NiwgICAxNTMsICAgIDg0LAotICAgIDMwMywgICA0OTcsICAgMTQ0LCAgIC04NSwgIC0xMjUsICAtNTM5LCAgLTQ4MiwgIC00NjQsICAtNzY0LAotICAgIDIzMywgICAzNDcsICAgIDY4LCAgLTE0NywgICAxNjksICAtMjEwLCAgLTI0MiwgIC0yMjYsICAtNDgyLAotICAgIDMwNywgICA0MjIsICAgMTU0LCAgLTE3NSwgIC0zODYsICAtNzIyLCAgLTcyNCwgIC05MDQsIC0xMDE1LAotICAgIDMwOSwgICAzMDgsICAgMTYwLCAgIC02MCwgIC00NzAsICAtNDIwLCAgLTU5OCwgIC03OTEsICAtMjE5LAotICAgIDY4LCAgIDEyMSwgIC0xMzcsICAtNTYwLCAgLTE0NiwgIC00NDYsICAtNTE1LCAgLTQ5NCwgIC03MjksCi0gICAgMTMwLCAgICA1MywgIC0yMjcsICAgIDQ2LCAgIDQ3NCwgICAgMzIsICAtMTYxLCAgLTE5MiwgIC00OTAsCi0gICAgMjEzLCAgIDE2NCwgICAtNzEsICAtNDY1LCAgLTg3NiwgIC0xNjEsICAtNDU2LCAgLTU4NywgICAtNDgsCi0gICAgMjE4LCAgIDExNywgICAgMzksICAgMTc3LCAgLTE5NCwgICAtODgsICAtMjI2LCAgLTQxOCwgICAgNTAsCi0gICAgMjEwLCAgIDU0NywgICA1NjksICAgMjc5LCAgIDEyMSwgICAtNDQsICAgLTUwLCAgICAxMCwgICAtODQsCi0gICAgNTgsICAgMTQwLCAgIDE4MiwgICAgLTUsICAgMjY3LCAgIDExNywgICAxMDYsICAgMjExLCAgIDE5OCwKLSAgICA1MzksICAgODM1LCAgIDkxMywgICA3MTksICAgNjE3LCAgIDU0NCwgICA1OTEsICAgNTY1LCAgIDY0MiwKLSAgICAxNTMsICAgNTU5LCAgIDg3MiwgICA0NjAsICAgMjIyLCAgIDEwOCwgICAxODgsICAgMTgwLCAgIDE4MywKLSAgICAxNTgsICAgMTE5LCAgIDI4NCwgIC0xNTMsICAtMjcxLCAgIDIyOSwgICAgODcsICAgMTEwLCAgIC01NywKLSAgICAtMTgzLCAgICA4MiwgICAxMTgsICAgIDIxLCAgICAxMywgICAgNDAsICAgMTE4LCAgIDE5MSwgICAxODUsCi0gICAgMTYyLCAgIDg4OSwgICA2NTQsICAgMTA4LCAgIC0zNCwgICAyNDQsICAgNDg4LCAgIDU2MSwgICA1MzIsCi0gICAgMTYzLCAgICA1NiwgICA2MDksICAgMzQxLCAgICA1MCwgICAzMjksICAgIDY4LCAgIDI2NiwgICAyMTgsCi0gICAgMTAwLCAgIDIwNiwgICAgMTgsICAtMzA0LCAgLTEwNywgIC00MzYsICAtNDg3LCAgIC02NSwgIC0zMDYsCi0gICAgLTg2LCAgIDE1NCwgICAxMzQsICAgLTMwLCAgIC00NSwgICAtNzMsICAtMTA0LCAgIC04MCwgICAtOTYsCi0gICAgMjQ1LCAgIDMzMCwgICAgMTAsICAtNDQwLCAgLTg0OSwgLTEwODIsICAgIDc5LCAgICA0MCwgIC0yNjUsCi0gICAgMTk2LCAgIDM3MiwgICAyNzIsICAtMTgxLCAgLTQ5MywgIC0zODksICAgMjc1LCAgICA4MCwgICAtNTksCi0gICAgMiwgICAtMTIsICAtMjQ2LCAgLTUwNSwgIC0xMDAsICAtNDM2LCAgICAyMSwgIC0xODcsICAtNDMxLAotICAgIC0yMjEsICAgLTQ4LCAgICAzN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AgIDIwLCAgLTI3NywgIC02MjMsICAtOTgzLCAtMTIyNCwgIC00MTUsICAtNDU4LCAgLTYzOSwKLSAgICAzNDcsICAgNTA5LCAgIDIwOCwgIC0xNzksICAtNDY0LCAgLTcyOCwgICAtNzYsICAtMjM3LCAgLTQ4NiwKLSAgICAtMTAzLCAgLTM0MywgIC03NTYsICAtNzEzLCAgLTI2NSwgIC02MDksICAtMTkxLCAgLTM5OCwgIC02MzYsCi0gICAgLTEyMSwgIC0zODMsICAtNzQ5LCAgIDU2NywgICAyNTIsICAgLTM2LCAgLTM1NCwgIC00MTcsICAgLTUwLAotICAgIDIwNCwgICAxMDAsICAtMTQ5LCAgLTY1MCwgLTEwODEsICAgLTQ3LCAgICAtNywgIC0yNjMsICAgMTExLAotICAgIC00NiwgIC0xODAsICAtMjY3LCAgLTMyNCwgIC01NjIsICAtMzk0LCAgLTY5MiwgICAzOTgsICAgMjkyLAotICAgIDQ4MiwgICA2NzAsICAgNjgzLCAgIDYyNCwgICA0NDIsICAgMTY1LCAgIDExNiwgICAgMzYsICAtMTQ5LAotICAgIDEwOCwgICAyNDcsICAgMjkxLCAgIDI0NywgICAzNTUsICAgMTIyLCAgIDEwOSwgICAyMjQsICAgMjk2LAotICAgIC0xNCwgICA5NDUsICAgOTkwLCAgIDgwMSwgICA3NTUsICAgODE1LCAgIDg0NywgICA5MTMsICAgODkyLAotICAgIDI5MiwgICAzNDksICAgNzI1LCAgIDQ4MiwgICAzODgsICAgMzI5LCAgIDQyOSwgICA2MjAsICAgNjY3LAotICAgIC0zNCwgICAxOTcsICAgMjEzLCAgLTEyNywgICAgODQsICAgNDk0LCAgIDYyMCwgICA1NzUsICAgMzc1LAotICAgIDEyNiwgICAyMDcsICAgMTcyLCAgIDE2NywgICAzNjIsICAgMjAyLCAgIDI5NiwgICAzOTUsICAgNDU1LAotICAgIC02LCAgIDI1MCwgICA1MzksICAgNDY3LCAgIDYzNiwgICA4MDEsICAxMTQ5LCAgMTI4NywgIDExMTgs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gsICAtMzAzLAotICAgIDExNjUsICAxMTA0LCAgIDkzOSwgICA4MjgsICAgNzE2LCAgIDQyNiwgICAxNTUsCi0gICAgNiwgIC0xMDksICAgODIwLCAgIDc3OCwgICA0MTUsICAgMTEzLCAgIC0yNywKLSAgICAzODEsICAgMzM5LCAgIDMxNCwgICAyNjUsICAgMTIxLCAgICAtOSwgIC00NzQsCi0gICAgLTM3MywgICAgNDcsICAgNTg0LCAgIDQ0MiwgICAgOTksICAtMjMxLCAgLTExMywKLSAgICAtNDk2LCAgIC0zOCwgIC0yODUsICAgMjYyLCAgIDMwNSwgICAxNzAsICAgICA0LAotICAgIC01ODcsICAtNTU2LCAgICA2OSwgICAgNjYsICAgNDcxLCAgIDM1NCwgICAgMTMsCi0gICAgLTEzOCwgICAgNzAsICAgLTE4LCAgIDEwNiwgICAgNjcsICAgMTY3LCAgLTMwMiwKLSAgICAtNDQ1LCAgLTE0MSwgICAxODUsICAgMTkxLCAgIDE1MSwgICAgODMsICAtMTMzLAotICAgIC0yNTcsICAtNTIxLCAgLTcyMCwgIC0xOTgsICAgMTM0LCAgIC00NiwgIC0xODIsCi0gICAgLTgxOSwgLTExNjgsICAtNzc3LCAgIDUxMiwgICAzNTksICAgIDk1LCAgLTExMywKLSAgICAxMzcsICAgIC0yLCAgIC03NCwgIC0xMzgsICAtNDAxLCAgLTExNCwgIC0zNzEsCi0gICAgLTI0MiwgIC00NjYsICAgMjA0LCAgIDIyMywgICAtMzEsICAtMjEyLCAgLTE5MiwKLSAgICAtNTMyLCAgLTYzNywgIC00NjYsICAtNjg2LCAgIDI1NiwgICAyNzcsICAtMTM5LAotICAgIC0xMTQxLCAtMTI0NCwgIC0zODEsICAgLTc1LCAgIC01NCwgICAgMTQsICAgIDg4LAotICAgIC0zMTEsICAgMTE1LCAgLTE0MywgIC00OTksICAtMzQzLCAgIDEyNCwgIC00MTYsCi0gICAgLTYxNiwgIC0xNDcsICAtMTM1LCAgICA0MywgICAgLTQsICAgMTIxLCAgL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xLAotICAgIDEwNjYsICAgOTEyLCAgIDYzMSwgICAzODksICAgMjA3LCAgICA4NiwgIC0yMjQsCi0gICAgNTk2LCAgIDUxMiwgICA1OTYsICAgNTA1LCAgIDMxNCwgICAxMjIsICAgLTQ4LAotICAgIDc4NywgICA4NjEsICAgNDQxLCAgIC05MywgIC0zMDMsICAgIDMzLCAgLTE5MCwKLSAgICAyNTcsICAgNDY5LCAgIDMzNywgICAgNTEsICAgIDE1LCAgIDI5OCwgICAtOTMsCi0gICAgMjk1LCAgICA3MywgIC0xMTksICAgIDI1LCAgICAzNiwgICAgMjMsICAgMTA4LAotICAgIC0yOCwgICAgLTMsICAgLTMyLCAgIDExNCwgICAgMjEsICAgMTg1LCAgIDEwNywKLSAgICA0ODIsICAgMzA1LCAgICAxNSwgIC0yNzksICAtMzE5LCAgICA1MiwgICAgOTYsCi0gICAgMjI2LCAgICA0NiwgICAxMTUsICAgIDcyLCAgLTEzNiwgICAxMzMsICAtMTI1LAotICAgIDE4LCAgLTIwNywgIC01NTksICAtNTkwLCAgLTUwMywgIC00ODIsICAgMzIxLAotICAgIC01NzEsICAtNzg5LCAgLTk1MSwgIC0xNzIsICAtNDQxLCAgLTUzOCwgICAxMTMsCi0gICAgMTgxLCAgICAxNCwgIC0zMTAsICAtNjQxLCAtMTAwMSwgIC0yMDIsICAgMTU5LAotICAgIC0xMzYsICAtMzkzLCAgLTQzMywgIC01MTMsICAtOTExLCAgLTE0NCwgICAtMjIsCi0gICAgNzIsICAtMjY1LCAgLTcwNiwgIC05NTQsICAtMTU5LCAgICA1MywgICAzMzIsCi0gICAgLTMzOCwgIC01OTEsICAtODUyLCAgLTM4MywgIC0zOTUsICAgIDU2LCAgICA0NCwKLSAgICA0MywgIC0xNTgsICAtNDY0LCAgLTg5NywgIC02MzEsICAtMTU3LCAgLTI5NCwKLSAgICAtMTYxLCAgLTEyOCwgIC0zMjgsICAtNTczLCAgLTQ4MywgIC0xMjUsICAgIDExLAotICAgIDEwMTcsICAgO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5LCAgMTAyMSwgICA3MTIsICAgNDk2LCAgIDI4MSwgICAtODMsCi0gICAgMjY5LCAgIDQ5MiwgICA3ODcsICAgNjQzLCAgIDM0NywgICAgNzAsICAgMTI0LAotICAgIDMzNiwgICA2MzYsICAgNDk5LCAgICA5MiwgIC0yMjksICAtMTc5LCAgIDE5MSwKLSAgICAyNiwgICA0MDIsICAgNTY0LCAgIDM0MCwgICAxNDksICAgLTExLCAgIDEzNSwKLSAgICAtNDQwLCAgIDU2MSwgICA0NzAsICAgMjA0LCAgIC03MiwgIC0xODYsICAgMTQwLAotICAgIC03MjAsICAgIDE0LCAgIDM1NSwgICAyMjksICAgIDY4LCAgLTEzMywgICA0NjUsCi0gICAgMTEwLCAgIDMxMCwgICAxMDMsICAgIDEyLCAgIDEwNiwgICAgMjksICAgMTU4LAotICAgIC0xNzgsICAgMTEzLCAgIDE2MSwgICAxNDIsICAgMTIxLCAgIDExNSwgICAgMjcsCi0gICAgLTY1MSwgIC00MTQsICAtNjQ1LCAgLTE1MiwgIC0xNjQsICAgLTEzLCAgLTQyOSwKLSAgICAtNjM5LCAgLTk0NCwgIC02ODEsICAtMTA0LCAgIC04MSwgICAgNTIsICAtMTg5LAotICAgIC02NjMsICAtMTY0LCAgLTMxNiwgIC02ODMsICAtOTU0LCAgLTIwNSwgICAtODMsCi0gICAgLTYwOSwgIC02NjksICAtMTcyLCAgLTUxNywgIC02OTQsICAgMjgzLCAgIC04MCwKLSAgICAtNjQ2LCAgLTE1MiwgIC0zODMsICAtNjc4LCAgLTI0NiwgICAtNDAsICAtMTQzLAotICAgIC03NDcsICAtNzk2LCAgLTc0NSwgIC0zOTAsICAgLTk4LCAgICA0MywgICAyNzUsCi0gICAgLTU5OSwgIC0xOTksICAtMzk4LCAgLTQzMywgIC00MzYsICAtNTM4LCAgICAzMSwKLSAgICAtMTEwNywgIC01NjgsICAtMzc2LCAgLTI2NSwgIC0xMjYsICAgLTIxLCAgICAgMSwKLSAgICA4NDcsICAgNTczLCAgIDMwOCwgICAzOTIsICAgMzA1LCAgIDEwMSwgICAgNTUsCi0gICAgMjczLCAgIDI5MywgICAyMDEsICAgMjY3LCAgIDM0NiwgICAyMDEsICAgMTIzLAotICAgIDcyNywgICA0ODAsICAgMjI2LCAgICAgMiwgICAtNjUsICAtMTM4LCAgIDE2NCwKLSAgICAyNzMsICAgMjA4LCAgIDE3MywgICAyOTIsICAgIDEyLCAgIDI1MywgICAxNzQsCi0gICAgMzQwLCAgIDIwNywgICAxODAsICAgIDg4LCAgIDExNiwgICAgNDYsICAgNDc1LAotICAgIC00NjAsICAtMTY2LCAgIC0zMCwgICAgMTMsICAgMTEwLCAgIDE3MywgICAzOTYsCi0gICAgMTM3LCAgICA4OCwgICAgNDMsICAtMTM3LCAgIC05NCwgICAgMzQsICAgMjg0LAotICAgIDk2LCAgIC0xNCwgICAyMjYsICAgIDQwLCAgICA2MywgICAgNzAsICAgMTMwLAotICAgIC00NjcsICAtNzM1LCAtMTAxMiwgLTExNzQsICAtMzA3LCAgIDMwNSwgICAtNjcsCi0gICAgLTYxMiwgIC05MjAsIC0xMTQ2LCAgLTU2NywgICAgLTgsICAgIDkyLCAgIC0yNSwKLSAgICAtMTgyLCAgLTI3MSwgIC00OTIsICAtNzU0LCAgLTg1NywgICAyODcsICAgLTc1LAotICAgIC00OTQsICAtNzg3LCAgLTY4OSwgIC02ODMsICAtNzA5LCAgIDEzNywgIC0zMjYsCi0gICAgLTI4OCwgIC01NTAsICAtOTAzLCAtMTEwNSwgICAzMzQsICAgMzIxLCAgIC02MiwKLSAgICAtMzU0LCAgLTY1MywgIC04MzQsICAtNDQ1LCAgICAgMSwgICAzNzcsICAtMTUyLAotICAgIC0xNjIsICAtMzA2LCAgLTYwOCwgIC05MzcsICAtMjk3LCAgIDI0NywgIC0xOTIsCi0gICAgLTIzNCwgIC00NzcsICAtMjQ0LCAgLTQ4OCwgIC0yNjYsICAgMzQyLCAgLTMzMgotfTsKLQotLyoKLSAqIDJuZCBzdGFnZSBjb2RlYm9vazsgMXN0IHNwbGl0OiAgIGlzZjJfMCB0byBpc2YyXzIKLSAqLwotCi0KLWNvbnN0IGludDE2IGRpY28yMV9pc2ZbU0laRV9CSzIxKjNdID0KLXsKLQotICAgIDMyOSwgICA0MDksICAgMjQ5LAotICAgIC0zMywgICA1MDUsICAgMTYwLAotICAgIC0yOSwgICAtMTQsICAgNTgyLAotICAgIC0yNjIsICAgMTI3LCAgIDM1NCwKLSAgICAxNDUsICAgMjM3LCAgIDE3NSwKLSAgICAtMTUyLCAgIDI0NSwgICAxMjIsCi0gICAgMjcsICAgIDQyLCAgIDM0MCwKLSAgICAtODQsICAgLTkzLCAgIDMxMSwKLSAgICAyODUsICAgMjIyLCAgLTE1NiwKLSAgICA0NywgICAtNDMsICAtNTA0LAotICAgIDIzNCwgICAxMjEsICAgMzg1LAotICAgIDEwNCwgIC0zMTcsICAgIDQ1LAotICAgIDE3NiwgICAxOTUsICAgICA4LAotICAgIDEwNCwgICAtNTksICAgLTk0LAotICAgIDE3NywgICAgNTMsICAgMTkyLAotICAgIC0zNCwgIC0xMjcsICAgMTUyLAotICAgIDU3MCwgICAyNzcsICAgLTM0LAotICAgIC02NywgIC0zMjksICAtNjM5LAotICAgIC0xNTcsICAtMjcyLCAgIDQ2MiwKLSAgICAtMTc3LCAgLTQ2MiwgICAxOTgsCi0gICAgMzIyLCAgIDE3OSwgICAxMTUsCi0gICAgLTM4NiwgICAxNzEsICAgIDE5LAotICAgIDE5LCAgIC0xMiwgICAxOTUsCi0gICAgLTEyMCwgIC0yNTIsICAgMjAxLAotICAgIDMwNCwgICAgMzYsICAtMzM2LAotICAgIC0xMjgsICAtMjIxLCAgLTM4MCwKLSAgICAxNzEsICAtMTg1LCAgIDI5NiwKLSAgICAtMjQyLCAgLTMxMiwgICAgMjMsCi0gICAgMTk4LCAgICAzOSwgICAgMTYsCi0gICAgLTMsICAtMTc3LCAgLTExMSwKLSAgICAxMTEsICAgLTkzLCAgICA3NiwKLSAgICAtOTIsICAtMjIzLCAgICAgNCwKLSAgICAxNzcsICAgNDA2LCAgIC00NCwKLSAgICAtMTY4LCAgIDM4MCwgIC0xNDksCi0gICAgLTQsICAgMjczLCAgIDMzMSwKLSAgICAtNDIwLCAgIDUxMywgICAyNzcsCi0gICAgMjEsICAgMjQ3LCAgICA0NywKLSAgICAtNTgsICAgMTMxLCAgICAtMiwKLSAgICAtMywgICAxMzQsICAgMTgwLAotICAgIC0xNDUsICAgIDQwLCAgIDE3NSwKLSAgICAxODksICAgIDc0LCAgLTE0NSwKLSAgICAtMjcsICAgLTQ1LCAgLTMyNSwKLSAgICAzNzAsICAtMTE0LCAgIC0yMSwKLSAgICAtODMsICAtNDE1LCAgLTE3MywKLSAgICA3NywgICAgOTUsICAgLTUxLAotICAgIC00MCwgICAtMzAsICAgLTY3LAotICAgIDcxLCAgICA4OCwgICAgODYsCi0gICAgLTM1LCAgIC05OCwgICAgMTQsCi0gICAgNjksICAgMTk3LCAgLTMzNCwKLSAgICAtMTk2LCAgICA3OSwgIC0yMzEsCi0gICAgLTM0OCwgIC0xMzcsICAgMjE4LAotICAgIC0zNTIsICAgLTg5LCAgIC04NSwKLSAgICA0NywgICAyMDEsICAtMTMwLAotICAgIC0xNjUsICAgIDM3LCAgIC0xNSwKLSAgICAtNDMsICAgICAzLCAgICA4NiwKLSAgICAtMTYxLCAgLTEwOCwgICAgNzksCi0gICAgODMsICAgIDIxLCAgLTIzNywKLSAgICAtODEsICAtMTQ5LCAgLTIzOCwKLSAgICAxNTAsICAtMTg2LCAgLTI1MSwKLSAgICAtMTg2LCAgLTI0OSwgIC0xNjIsCi0gICAgLTE5LCAgICA2NiwgIC0xMzksCi0gICAgLTI2LCAgIC01MCwgIC0xODEsCi0gICAgMjQsICAgIDExLCAgICAgMCwKLSAgICAtMTMwLCAgLTEwNSwgICAtOTgKLX07Ci0KLQotCi0vKgotICogMm5kIHN0YWdlIGNvZGVib29rOyAybmQgc3BsaXQ6ICAgaXNmMl8zIHRvIGlzZjJfNQotICovCi0KLQotY29uc3QgaW50MTYgZGljbzIyX2lzZltTSVpFX0JLMjIqM10gPQotewotCi0gICAgLTEyNywgICAzMTAsICAgIDQyLAotICAgIC0yNDIsICAgMTk3LCAgICAgNSwKLSAgICAtMTUxLCAgICA4NCwgICAtMTcsCi0gICAgLTIxNCwgICAxMjcsICAtMTQ5LAotICAgIC0yNDcsICAtMTMxLCAgIDE1OSwKLSAgICAtMjY4LCAgLTI2NywgICAtOTUsCi0gICAgLTIxNywgICAgIDEsICAgLTc5LAotICAgIC0yNzEsICAgLTgwLCAgLTE4NSwKLSAgICAtNDUsICAgNDM2LCAgIDE1OSwKLSAgICAxNjUsICAgMTk5LCAgIDM5MSwKLSAgICAtMzMsICAgIDgxLCAgIDE4NywKLSAgICAtNjYsICAgLTQyLCAgIDM1NSwKLSAgICAtMjk4LCAgIC01NywgICAzNDMsCi0gICAgLTEwOCwgIC01MzcsICAgMjI2LAotICAgIC0xNDQsICAgLTIzLCAgIDE5MywKLSAgICAxNzYsICAtNDAyLCAgICA4NywKLSAgICA1MywgICAyOTYsICAgIDI1LAotICAgIC04NCwgICAyNTMsICAtMTA0LAotICAgIC01OCwgICAxMDUsICAtMTI2LAotICAgIC0xNjksICAgMTc0LCAgLTMxNCwKLSAgICAtNDgsICAgIDQ0LCAgLTI5NCwKLSAgICAtMTY0LCAgLTQxNywgIC0yNDIsCi0gICAgLTEzOSwgICAgIDMsICAtMTk0LAotICAgIC0xNTUsICAtMjA3LCAgLTIxMSwKLSAgICAxMTksICAgMzIyLCAgIDIxMywKLSAgICAzMzMsICAgIDUwLCAgIDM4MCwKLSAgICAyMzcsICAgMjQ3LCAgICAtMiwKLSAgICA0NjYsICAgLTE2LCAgIDIwMSwKLSAgICAyMzgsICAtMjU1LCAgLTEwNywKLSAgICA2NywgIC00NDAsICAtMTQ5LAotICAgIDEyMiwgICAtODgsICAtMTM5LAotICAgIDg4LCAgLTI0NywgICAtNzMsCi0gICAgLTQxLCAgIDIzMSwgICAxNjcsCi0gICAgLTYyLCAgIDE1NSwgICAgMTYsCi0gICAgLTY1LCAgICAxNiwgICAgNzcsCi0gICAgLTY4LCAgICAtMiwgICAtNjMsCi0gICAgLTE1MSwgIC0zMDAsICAgMTYwLAotICAgIC0xOCwgIC0zMzMsICAgIDU0LAotICAgIC01NiwgICAtOTQsICAgICA1LAotICAgIDIsICAtMTkwLCAgICAxNCwKLSAgICA5MiwgICAxNDgsICAgMjA5LAotICAgIDEwOCwgICAgIDksICAgMjcyLAotICAgIDEwOCwgICAgMzUsICAgMTEwLAotICAgIDE0MiwgICAtODUsICAgMTQ1LAotICAgIDQ3LCAgLTE1NywgICAyNzksCi0gICAgMywgIC0zMjAsICAgMjQ2LAotICAgIDQzLCAgIC03MiwgICAgNjgsCi0gICAgODYsICAtMjE3LCAgIDEzNSwKLSAgICAzNiwgICAxNDAsICAgIDc5LAotICAgIDU2LCAgIDE3NSwgICAtNDksCi0gICAgMjYsICAgIDQ1LCAgICAgMywKLSAgICA3MywgICAgNTUsICAtMTAxLAotICAgIDEwOSwgIC0xODMsICAtMjQyLAotICAgIC00LCAgLTI4MywgIC0yNDIsCi0gICAgNDgsICAgLTY4LCAgIC00OCwKLSAgICAtNiwgIC0xNTMsICAtMTIyLAotICAgIDE2MSwgICAxOTYsICAgIDk2LAotICAgIDIzMiwgICAgODAsICAgMTkwLAotICAgIDE2NSwgICAgOTcsICAgIDExLAotICAgIDI1OCwgICAtMzEsICAgIDcxLAotICAgIDI2NywgICAtNzcsICAgLTkxLAotICAgIDMxMSwgIC0yMDksICAgIDg3LAotICAgIDE1MiwgICAtMTQsICAgLTIyLAotICAgIDE1MCwgIC0xNDksICAgICA5LAotICAgIC0zMjQsICAgNTU3LCAgIDE4NywKLSAgICAtMzg0LCAgIDMwNywgICAgNDYsCi0gICAgLTI1MSwgICAgMjcsICAgIDc3LAotICAgIC0zNjUsICAgIDc3LCAgIC01MiwKLSAgICAtNDgyLCAgIC04NCwgICAxNjAsCi0gICAgLTQyNCwgIC01MTUsICAgLTY0LAotICAgIC0yOTQsICAtMTIwLCAgICAtNCwKLSAgICAtNDc2LCAgLTExNiwgIC0xMDksCi0gICAgLTk3LCAgIDMxOCwgICAzNjUsCi0gICAgMTA2LCAgIDYyNywgICA0NDUsCi0gICAgLTE5MCwgICAxMjAsICAgMjg3LAotICAgIC0xNDYsICAgIDY1LCAgIDYxOSwKLSAgICAtNDI3LCAgIDI0MiwgICAzNjMsCi0gICAgLTM2MSwgIC0zNzEsICAgNDMyLAotICAgIC0zNDcsICAgMTAyLCAgIDE2OCwKLSAgICAtNjI5LCAgIDE5NSwgICAtMTQsCi0gICAgLTY1LCAgIDQ3NiwgICAtNDcsCi0gICAgLTI5NywgICAzMjAsICAtMTY4LAotICAgIC01NSwgICAzNTYsICAtMjY0LAotICAgIC0zOTEsICAgIDgyLCAgLTI4NiwKLSAgICAtNTEsICAgLTMxLCAgLTU1NiwKLSAgICAtMTc4LCAgLTM5OSwgIC01ODYsCi0gICAgLTIwNSwgICAtNDksICAtMzYwLAotICAgIC0zNDMsICAtMjM4LCAgLTMzNywKLSAgICAyMjAsICAgNDU3LCAgICA1OCwKLSAgICA1NjEsICAgNDY3LCAgIDI1OSwKLSAgICAzNDAsICAgMjcwLCAgLTE2OCwKLSAgICA0NTAsICAgIDc3LCAgLTI4MCwKLSAgICA2MCwgICAxNjcsICAtNDEzLAotICAgIDEzMywgIC0yNTIsICAtNDkyLAotICAgIDIxNiwgICAxNTcsICAtMjkwLAotICAgIDI4MiwgICAgIDAsICAtNDk1LAotICAgIC0yMjYsICAgMjkzLCAgIDE4MywKLSAgICAtMTU3LCAgIDEzNSwgICAxMjIsCi0gICAgLTE1OCwgICAtNTksICAgIDM5LAotICAgIC0xMzMsICAtMTE4LCAgIC05NywKLSAgICAtMzMyLCAgLTMwOSwgICAxMTMsCi0gICAgLTE2MCwgIC00MjUsICAgIC02LAotICAgIC0xNDksICAtMjExLCAgICAyNCwKLSAgICAtODAsICAtMjc3LCAgIC05MCwKLSAgICAtMTEsICAgMTI1LCAgIDMzOCwKLSAgICAxMzAsICAgLTcxLCAgIDQ2NSwKLSAgICA1LCAgIC00NSwgICAxODQsCi0gICAgMjM3LCAgIC05NSwgICAyNTMsCi0gICAgLTEzOSwgIC0xOTcsICAgMjk3LAotICAgIC0xOSwgIC0zMDAsICAgNTExLAotICAgIC02MywgIC0xNTIsICAgMTM5LAotICAgIDI1MCwgIC0yODksICAgMzM2LAotICAgIDEyNCwgICAzMzksICAtMTUwLAotICAgIDM0LCAgIDE3NiwgIC0yMDgsCi0gICAgMTcxLCAgIDE2NiwgIC0xMTYsCi0gICAgOTQsICAgIDM4LCAgLTIyOSwKLSAgICA3NSwgICAtNjUsICAtMzM5LAotICAgIC03OCwgIC0yMDUsICAtMzg1LAotICAgIDAsICAgLTMwLCAgLTE2MywKLSAgICAtNTYsICAtMTEwLCAgLTI0MiwKLSAgICAzMjEsICAgMjQ0LCAgIDE5NCwKLSAgICA1MDUsICAgMjM4LCAgICAtMSwKLSAgICAzMTcsICAgMTE2LCAgICA2NSwKLSAgICAzMDksICAgIDg4LCAgIC03NCwKLSAgICA0NTIsICAgLTUxLCAgIC01MCwKLSAgICAzMzQsICAtMjE3LCAgLTI5MCwKLSAgICAyMTEsICAgIDQxLCAgLTE1MiwKLSAgICAyMzgsICAgLTU1LCAgLTI2MAotfTsKLQotCi0vKgotICogMm5kIHN0YWdlIGNvZGVib29rOyAzcmQgc3BsaXQ6ICAgaXNmMl82IHRvIGlzZjJfOAotICovCi0KLQotY29uc3QgaW50MTYgZGljbzIzX2lzZltTSVpFX0JLMjMqM10gPQotewotCi0gICAgLTEwLCAgIDE1MSwgICAzNTksCi0gICAgMTM2LCAgIDI5OCwgICAyMjMsCi0gICAgMjU1LCAgLTEwNCwgICAyOTAsCi0gICAgNDIzLCAgICAgNiwgICAxODMsCi0gICAgLTI3MCwgIC0yNjksICAgLTk4LAotICAgIC01MiwgICAtODIsICAgIDEzLAotICAgIC04MiwgIC0yNzQsICAgLTk3LAotICAgIDkwLCAgLTI0NiwgICAtNzIsCi0gICAgLTI5OSwgICAtNzAsICAgNDIxLAotICAgIC04OCwgICAzNjUsICAgNDMwLAotICAgIDE4NywgIC0zMTgsICAgMzgxLAotICAgIDM4MCwgICAgMzcsICAgNDg4LAotICAgIC0zNzMsICAtMzE2LCAgICA3OSwKLSAgICAtMzA4LCAgLTEwMSwgICAgIDUsCi0gICAgLTEzNSwgIC00NTEsICAgICA4LAotICAgIDcyLCAgLTQyMSwgIC0xNTQsCi0gICAgMTgwLCAgIDE3MCwgIC0xMjEsCi0gICAgNjIsICAgMTc3LCAgIC00MCwKLSAgICAzMjYsICAgIDgwLCAgLTEwNSwKLSAgICAyNDgsICAgMjYzLCAgICAtNSwKLSAgICAtMTY4LCAgLTE4MSwgIC0yMjEsCi0gICAgLTIsICAgLTIzLCAgLTE1OCwKLSAgICAtMTQsICAtMTQ5LCAgLTEyMSwKLSAgICAxMTksICAgLTkxLCAgLTE0NywKLSAgICAxMTksICAgMzMyLCAgLTE1MywKLSAgICA0OSwgICAzMDMsICAgIDM0LAotICAgIDQ0MiwgICAtNTUsICAgLTY5LAotICAgIDIxNywgICA0NTQsICAgIDU4LAotICAgIC0zNTksICAtMTg3LCAgLTM3NSwKLSAgICAtNDIsICAgIDUwLCAgLTI3NCwKLSAgICAtOCwgIC0yNjcsICAtMjQ5LAotICAgIDg1LCAgIC04NiwgIC0zNDYsCi0gICAgLTc3LCAgIC00MCwgICAzNDUsCi0gICAgODksICAgMTM0LCAgIDIxOSwKLSAgICAxNTYsICAgLTgwLCAgIDE2MCwKLSAgICAxMDgsICAgIDQwLCAgIDExNiwKLSAgICAtMTU4LCAgLTIwNiwgICAgMjksCi0gICAgNSwgICAtMzIsICAgMTc1LAotICAgIC02NSwgIC0xNTgsICAgMTQ2LAotICAgIDU1LCAgIC03OCwgICAgNzMsCi0gICAgLTExNCwgIC0yMjIsICAgMzUzLAotICAgIC00NywgICAgODEsICAgMjExLAotICAgIDQ5LCAgLTE1MSwgICAyNjgsCi0gICAgMTA1LCAgICAgNCwgICAzMDIsCi0gICAgLTI2MywgIC0xMzIsICAgMTgzLAotICAgIC0xNTEsICAgLTI4LCAgIDIwMSwKLSAgICAtMTc3LCAgLTMwNywgICAxNjYsCi0gICAgMTAxLCAgLTIyMSwgICAxMzAsCi0gICAgNzQsICAgIDU4LCAgIC05OCwKLSAgICAzMiwgICAgNDQsICAgIDEzLAotICAgIDE5NCwgICAgMzAsICAtMTQyLAotICAgIDE3MCwgICAgOTYsICAgICA4LAotICAgIC0xMzYsICAtMTE5LCAgIC05MSwKLSAgICAtNjUsICAgICA4LCAgIC01NSwKLSAgICAzLCAgLTE4OCwgICAgMTIsCi0gICAgNDUsICAgLTYzLCAgIC00OSwKLSAgICAxNDksICAgLTIxLCAgIC0xOSwKLSAgICAyNCwgICAxNDQsICAgIDk1LAotICAgIDI1NCwgICAtMjIsICAgIDYwLAotICAgIDE2MSwgICAxOTYsICAgIDk2LAotICAgIC0xNTgsICAgLTYxLCAgICA0OCwKLSAgICAtNzAsICAgIDMzLCAgICA4MiwKLSAgICAtMjMsICAtMzIxLCAgICA1OCwKLSAgICAxNTUsICAtMTQ3LCAgICAgNSwKLSAgICAtMzY0LCAgIDMyOCwgICAgNzcsCi0gICAgLTIxLCAgIDQ1MywgICAxNzMsCi0gICAgLTEwOCwgICAgODIsICAgNjMwLAotICAgIDM2NywgICAyNjMsICAgMjA4LAotICAgIC0zMDAsICAgLTYyLCAgLTE3NiwKLSAgICAtMjA1LCAgIDE0MywgIC0xNTgsCi0gICAgLTE2OSwgIC00MTAsICAtMjY0LAotICAgIDI1NywgIC0yNjksICAtMTAwLAotICAgIC02MzYsICAgMjg5LCAgICAtMiwKLSAgICAtMjkyLCAgIDYyNywgICAxNzMsCi0gICAgLTM4MiwgIC0zNjMsICAgMzg3LAotICAgIDI0OCwgICA1MjQsICAgNDQ3LAotICAgIC01MjEsICAtMTExLCAgLTEwNywKLSAgICAtMzk1LCAgIDExOCwgIC0yNzQsCi0gICAgLTM0MywgIC02ODAsICAtMTI1LAotICAgIC0xNzIsICAtNDQ3LCAgLTY2MywKLSAgICA3NSwgICAxNDgsICAtMzY3LAotICAgIC03OSwgICAyNjMsICAgLTk0LAotICAgIDI0OSwgICAxNDgsICAtMjg2LAotICAgIDM4MCwgICAyNzEsICAtMTYyLAotICAgIC0xNDIsICAgIC00LCAgLTE4NiwKLSAgICAtNTcsICAgMTExLCAgLTEyNSwKLSAgICAtMzUsICAtMTA4LCAgLTI1NCwKLSAgICAxMDAsICAgIDI5LCAgLTI0MiwKLSAgICAtODAsICAgMzAzLCAgLTI2NCwKLSAgICAtNzgsICAgNDY0LCAgIC01NywKLSAgICAyNDgsICAgLTIyLCAgLTQ5NCwKLSAgICA2NjEsICAgNjYyLCAgICA0NCwKLSAgICAtMTkzLCAgIC00MCwgIC0zMzAsCi0gICAgLTE3OCwgICAxNDUsICAtMzM3LAotICAgIC05MCwgIC0xOTksICAtNDAwLAotICAgIC00MCwgICAtMjMsICAtNDk4LAotICAgIC0xOTIsICAgMTE0LCAgIDMxNSwKLSAgICAtNDEsICAgMjQ0LCAgIDE5MCwKLSAgICA4OCwgICAtOTcsICAgNDg1LAotICAgIDI0MSwgICAgODAsICAgMjEyLAotICAgIC0yNDYsICAgIDQwLCAgICA4NywKLSAgICAtMTU2LCAgIDE0NywgICAxMzQsCi0gICAgLTIsICAtMzM0LCAgIDIzOSwKLSAgICAzMDgsICAtMjAzLCAgIDExMCwKLSAgICAtNDU5LCAgIDI1MSwgICA0MjIsCi0gICAgLTIxOCwgICAzMTAsICAgMjI4LAotICAgIC04NiwgIC0zNDYsICAgNjU0LAotICAgIDE4NCwgICAxNzUsICAgNDI1LAotICAgIC00ODEsICAgLTYzLCAgIDE2OSwKLSAgICAtMzQ5LCAgIDExNywgICAxODgsCi0gICAgLTEyNSwgIC01NjAsICAgMzEwLAotICAgIDE1OCwgIC00MTYsICAgIDk0LAotICAgIDQ2LCAgIDE3M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gsICAgLTQ4LAotICAgIDE1NCwgIC0xNDAsICAtMjQzLAotICAgIC03NywgICAgMTgsICAgMTA4LAotICAgIC0zOSwgICAzNTUsICAgIDkxLAotICAgIDg3LCAgICAgOCwgICAxNTUsCi0gICAgLTQsICAgMTU4LCAgIDIzOSwKLSAgICAxMjgsICAgIDk1LCAgIC01NCwKLSAgICA3LCAgIDI0NiwgIC0xMjQsCi0gICAgMjU4LCAgICAxNSwgICAgODksCi0gICAgMjA2LCAgIDIxNiwgICAgOTgsCi0gICAgLTIwMSwgICAgIDksICAgIDE4LAotICAgIC0zMTIsICAgMjMzLCAgIDIwNCwKLSAgICAtMzksICAtMTc0LCAgIDE1NSwKLSAgICAtMTQ0LCAgICAtOSwgICAyODQsCi0gICAgLTU3LCAgICA3MCwgICAtNjksCi0gICAgLTE1NywgICAxODcsICAgIDE4LAotICAgIDU0LCAgIC0zMCwgICAgMjMsCi0gICAgMjQsICAgMTM1LCAgICA1NQotfTsKLQotCi0vKgotICogMm5kIHN0YWdlIGNvZGVib29rOyA1dGggc3BsaXQ6ICAgaXNmMl8xMiB0byBpc2YyXzE1Ci0gKi8KLQotY29uc3QgaW50MTYgZGljbzI1X2lzZltTSVpFX0JLMjUqNF0gPQotewotCi0gICAgMTY5LCAgIDE0MiwgIC0xMTksICAgMTE1LAotICAgIDIwNiwgICAtMjAsICAgIDk0LCAgIDIyNiwKLSAgICAtMTA2LCAgIDMxMywgICAtMjEsICAgIDE2LAotICAgIC02MiwgICAxNjEsICAgIDcxLCAgIDI1NSwKLSAgICAtODksICAgMTAxLCAgLTE4NSwgICAxMjUsCi0gICAgNzIsICAgLTMwLCAgLTIwMSwgICAzNDQsCi0gICAgLTI1OCwgICAgMzMsICAgIC04LCAgICA4MSwKLSAgICAtMTA0LCAgLTE1NCwgICAgNzIsICAgMjk2LAotICAgIDE0NCwgICAtNjgsICAtMjY4LCAgIC0yNSwKLSAgICA4MSwgICAtNzgsICAgLTg3LCAgIDEwNiwKLSAgICAyMiwgICAxNTUsICAtMTg2LCAgLTExOSwKLSAgICAtNDYsICAgLTI4LCAgICAyNywgICAgOTEsCi0gICAgLTExNCwgICAtMzcsICAtMTc1LCAgIC0zMywKLSAgICAtOTQsICAtMjIyLCAgLTE4OSwgICAxMjIsCi0gICAgLTEzMiwgIC0xMTksICAtMTkxLCAgLTI3MCwKLSAgICAtMTcyLCAgLTE3MywgICAgMTgsICAgLTQzLAotICAgIDI3OSwgICAxMzUsICAgLTQyLCAgLTEyOCwKLSAgICAxODcsICAgLTg2LCAgIDIyOSwgIC0xMzgsCi0gICAgMTU5LCAgIDI0MCwgICAxNDAsICAgIDQ2LAotICAgIDY5LCAgICAyNSwgICAyMjcsICAgIDc3LAotICAgIDIxLCAgIDExNSwgICAgMTMsICAgICA4LAotICAgIDY4LCAgLTI0OCwgICAxMjYsICAgIDgxLAotICAgIC0xNTAsICAgMTM3LCAgIDIwNywgICAgLTksCi0gICAgLTE1NCwgIC0xMzMsICAgMjg5LCAgICA2NywKLSAgICAxNDMsICAgLTM3LCAgIC04NiwgIC0zMjYsCi0gICAgMTgwLCAgIC0zMiwgICAgMTksICAgLTIzLAotICAgIDI2LCAgIDE2OCwgICAxMTYsICAtMjMzLAotICAgIC0zMiwgICAtMjYsICAgMTE4LCAgIC03OCwKLSAgICAzLCAgICAtOCwgICAtNDUsICAtMTE1LAotICAgIDU3LCAgLTIxNSwgICAtNTQsICAgLTgzLAotICAgIC0yMDksICAgMTEyLCAgIC0yMiwgIC0xNjcsCi0gICAgLTkxLCAgLTE1MSwgICAxNjgsICAtMjYyCi19OwotCi0KLQotLyogMzYgYml0ICovCi0vKgotICogIGlzZiBjb2RlYm9va3M6ICB0d28tc3RhZ2UgVlEgd2l0aCBzcGxpdC1ieS0zIGluIDJuZCBzdGFnZQotICogICAgICAgICAgICAgICAgMXN0IHN0YWdlIGlzIGtlcHQgdGhlIHNhbWUgYXMgdGhlIDQ2IGJpdCBxdWFudGl6ZXIKLSAqCi0gKiAgY29kZWJvb2sgICB2ZWN0b3IgZGltZW5zaW9uICAgIG51bWJlciBvZiB2ZWN0b3JzCi0gKiAgfn5+fn5+fn4gICB+fn5+fn5+fn5+fn5+fn5+ICAgIH5+fn5+fn5+fn5+fn5+fn5+Ci0gKiAgICAgMV8xICAgICAgICAgICAgOSAgICAgICAgICAgICAgICAgIDI1NgotICogICAgIDFfMiAgICAgICAgICAgIDcgICAgICAgICAgICAgICAgICAyNTYKLSAqICAgICAyXzEgICAgICAgICAgICA1ICAgICAgICAgICAgICAgICAgMTI4Ci0gKiAgICAgMl8yICAgICAgICAgICAgNCAgICAgICAgICAgICAgICAgIDEyOAotICogICAgIDJfMyAgICAgICAgICAgIDcgICAgICAgICAgICAgICAgICA2NAotICovCi0KLWNvbnN0IGludDE2IGRpY28yMV9pc2ZfMzZiW1NJWkVfQksyMV8zNmIqNV0gPQotewotCi0gICAgLTUyLCAgIC05NiwgICAyMTIsICAgMzE1LCAgIC03MywKLSAgICA4MiwgIC0yMDQsICAgMzYzLCAgIDEzNiwgIC0xOTcsCi0gICAgLTEyNiwgIC0zMzEsICAgMTgzLCAgIDIxOCwgICAxNDMsCi0gICAgLTQ5LCAgIC00MSwgICA1NTcsICAgMjMwLCAgICA3MiwKLSAgICAyLCAgIC03MywgICAxNjMsICAgMzc3LCAgIDIyMSwKLSAgICAxMzMsICAgMTExLCAgIDI3OCwgICAyMTUsICAtMTEwLAotICAgIC0xMDIsICAgLTIwLCAgIDI4NCwgICAxMTMsICAgMjczLAotICAgIDg0LCAgIDMxOSwgICAyOTAsICAgIDE4LCAgICA4NSwKLSAgICAtMjUsICAgIC01LCAgIDEyNSwgICAxMzIsICAtMjA0LAotICAgIC0zOCwgICAgLTUsICAgMjg2LCAgICAtOSwgIC0zNTYsCi0gICAgLTE0MCwgIC0yNTYsICAgIDkyLCAgIDExNywgIC0xODksCi0gICAgLTE0NCwgICAxOTEsICAgMzEzLCAgICA1MSwgICAtOTgsCi0gICAgMTY3LCAgIC0xMCwgICAgNDQsICAgMjQ3LCAgICAzNiwKLSAgICAzODEsICAgMTk3LCAgIDIzOCwgICAgNzQsICAgICA2LAotICAgIDM4LCAgLTQwOCwgICAgMjksICAgIC0zLCAgIC04NSwKLSAgICA5MiwgICAyNjYsICAgMTU3LCAgIC0yNSwgIC0yMDAsCi0gICAgMTYxLCAgLTEyMSwgICAgNzAsICAgIDg0LCAgLTE0MCwKLSAgICAtMTYsICAgLTg2LCAgIDExMiwgICAtOTQsICAtMTg5LAotICAgIC0yNjksICAtMjcwLCAgIDM1MSwgICAxMDcsICAgLTI0LAotICAgIC02OCwgICAtNjcsICAgNDkyLCAgLTEwMywgIC0xNTUsCi0gICAgLTUzLCAgLTEzMSwgICAgNjIsICAgMTIyLCAgICAxMCwKLSAgICAxMzUsICAgIDg0LCAgIDI4MywgICAtNTUsICAtMTIwLAotICAgIC0xMiwgIC0yMTksICAgMzMxLCAgIC04MSwgICAxNjcsCi0gICAgMjIwLCAgLTEzNiwgICAxNDcsICAtMTcyLCAgIC00MiwKLSAgICAxNDAsICAgLTk1LCAgLTEwOSwgICAtODgsICAtMTk0LAotICAgIDAsICAgIC0yLCAgICAtNCwgICAtMzMsICAtMzgxLAotICAgIC02NiwgIC0yMTcsICAgMTUyLCAgLTE4NiwgIC00MDIsCi0gICAgMjQ0LCAgIDEwOCwgICAxNTYsICAtMTQwLCAgLTM5NSwKLSAgICAxMTMsICAtMTM2LCAgLTE5NiwgICAxMTAsICAgLTI0LAotICAgIDIxNCwgICAxMTgsICAgIDExLCAgIC02NCwgIC0xMzEsCi0gICAgLTExMCwgIC0yODYsICAgIC02LCAgLTMzMiwgICAgMTYsCi0gICAgOTQsICAgIDk3LCAgICA3OSwgIC0yOTEsICAtMjA1LAotICAgIC01LCAgIC0zOSwgICAtMjAsICAgMjUyLCAgIC05NiwKLSAgICA3NiwgICAxNzQsICAgMTAxLCAgIDE2MywgICAgNjEsCi0gICAgLTY5LCAgLTIzOSwgICAtNTUsICAgMzk5LCAgICAgNiwKLSAgICAtMTE1LCAgIDMxOSwgICAxNjQsICAgMjc1LCAgIDE5NiwKLSAgICAtMTUsICAgIDM2LCAgIC00NywgICAzMzEsICAgMTIxLAotICAgIDIyNiwgICAyMDksICAgMjcxLCAgIDMyNSwgICAxODQsCi0gICAgMTMsICAgLTgwLCAgLTIxOCwgICA0NzEsICAgMzUzLAotICAgIDI4OCwgICAzNzgsICAgIDE2LCAgIC01MSwgICAyNTEsCi0gICAgMTc0LCAgIDExNiwgICAgNTIsICAgMTQ5LCAgLTI3OSwKLSAgICAyMzUsICAgMjc2LCAgICAzOSwgICAxMjAsICAgLTQ4LAotICAgIDAsICAtMTA4LCAgLTEwOCwgICAyNDEsICAtMzM5LAotICAgIC05MywgICA1MzQsICAgIDQ1LCAgICAzMywgICAtODcsCi0gICAgMTk0LCAgIDE0OSwgICAtNzEsICAgNDA1LCAgIC00NCwKLSAgICA0MDksICAgMzcwLCAgICA4MSwgIC0xODYsICAtMTU0LAotICAgIDI1LCAgLTEwMiwgIC00NDgsICAgMTI0LCAgLTE3MywKLSAgICAyMiwgICA0MDgsICAtMTEwLCAgLTMxMCwgIC0yMTQsCi0gICAgLTI2LCAgICAyMywgICAtODMsICAgMTE0LCAgICAxNCwKLSAgICAtMTEwLCAgIDE2NCwgICAgNTIsICAgMjIzLCAgIC04MiwKLSAgICAzNywgICAtMjUsICAtMjYzLCAgIDMwNiwgICAtMTUsCi0gICAgLTQ2NiwgICA0MTUsICAgMjkyLCAgIDE2NSwgICAtMTgsCi0gICAgMjksICAgLTE5LCAgLTE3MSwgICAxNTUsICAgMTgyLAotICAgIDE3OSwgICAxNDQsICAgLTI3LCAgIDIzMSwgICAyNTgsCi0gICAgLTEwMywgIC0yNDcsICAtMzk2LCAgIDIzOCwgICAxMTMsCi0gICAgMzc1LCAgLTE1NCwgIC0xMDksICAgIC00LCAgIDE1NiwKLSAgICA5OCwgICAgODUsICAtMjkyLCAgICAtNSwgIC0xMjQsCi0gICAgMTE2LCAgIDEzOSwgIC0xMTYsICAgLTk4LCAgLTI5NCwKLSAgICAtMTQsICAgLTgzLCAgLTI3OCwgIC0xMTcsICAtMzc4LAotICAgIDEwNiwgICAgMzMsICAtMTA2LCAgLTM0NCwgIC00ODQsCi0gICAgMTE5LCAgICAxNywgIC00MTIsICAgMTM4LCAgIDE2NiwKLSAgICAzODQsICAgMTAxLCAgLTIwNCwgICAgODgsICAtMTU2LAotICAgIC0xMjEsICAtMjg0LCAgLTMwMCwgICAgLTEsICAtMTY2LAotICAgIDI4MCwgICAgMzMsICAtMTUyLCAgLTMxMywgICAtODEsCi0gICAgLTM3LCAgICAyMiwgICAyMjksICAgMTUzLCAgICAzNywKLSAgICAtNjAsICAgLTgzLCAgIDIzNiwgICAgLTgsICAgLTQxLAotICAgIC0xNjksICAtMjI4LCAgIDEyNiwgICAtMjAsICAgMzYzLAotICAgIC0yMzUsICAgIDE3LCAgIDM2NCwgIC0xNTYsICAgMTU2LAotICAgIC0yNSwgICAtMzAsICAgIDcyLCAgIDE0NCwgICAxNTYsCi0gICAgMTUzLCAgIC0yNiwgICAyNTYsICAgIDk3LCAgIDE0NCwKLSAgICAtMjEsICAgLTM3LCAgICA0OCwgICAtNjUsICAgMjUwLAotICAgIDYzLCAgICA3NywgICAyNzMsICAtMTI4LCAgIDEyNCwKLSAgICAtMTI5LCAgIC0yNiwgICAgNDAsICAgICA5LCAgLTExNSwKLSAgICAtNiwgICAgODIsICAgIDM4LCAgIC05MCwgIC0xODIsCi0gICAgLTMzNiwgICAtMTMsICAgIDI4LCAgIDE1OCwgICAgOTEsCi0gICAgLTMwLCAgIDI0MSwgICAxMzcsICAtMTcwLCAgIC0xNywKLSAgICAxNDYsICAgIDE0LCAgIC0xMSwgICAgMzMsICAgIDYxLAotICAgIDE5MiwgICAxOTcsICAgIDU0LCAgIC04NCwgICAgODUsCi0gICAgMjMsICAtMjAwLCAgIC03OCwgICAtMjksICAgMTQwLAotICAgIDEyMiwgICAyMzcsICAgMTA2LCAgLTM0MSwgICAxMzYsCi0gICAgLTU3LCAgLTE0MiwgICAtODUsICAgLTE2LCAgIC03NCwKLSAgICAtNTksICAgLTkwLCAgICAtOCwgIC0xODcsICAgLTIwLAotICAgIC0yMTEsICAtMjY3LCAgIDIxNiwgIC0xNzksICAtMTEwLAotICAgIC01MCwgICAgLTcsICAgMjIwLCAgLTI2NywgICAtNzAsCi0gICAgLTU3LCAgIC00MiwgICAtMTcsICAgLTE1LCAgICA3MSwKLSAgICAzMiwgICAgMjEsICAgIDYzLCAgLTEzNywgICAgMzMsCi0gICAgLTEzNywgIC0xNzUsICAgMTA0LCAgIC02OCwgICAgOTcsCi0gICAgLTY3LCAgIC00MywgICAxMzMsICAtMzAxLCAgIDIyMSwKLSAgICAtMTE2LCAgLTIwMCwgICAtODEsICAgLTkyLCAgLTI3MiwKLSAgICAtNjQsICAgLTQxLCAgIC01NCwgIC0yNDQsICAtMjIwLAotICAgIC0yODcsICAtMjQyLCAgIC01MCwgICAtODcsICAgLTg5LAotICAgIC0yNDUsICAgMjM2LCAgIDEwMiwgIC0xNjYsICAtMjk1LAotICAgIDY2LCAgICAyNCwgIC0xNjIsICAgLTcxLCAgICA5NSwKLSAgICA2NiwgICAxMzYsICAgLTkwLCAgLTIyMCwgICAtMzYsCi0gICAgLTk4LCAgLTE2MSwgIC0yMjIsICAtMTg4LCAgICAyOSwKLSAgICAtMTgsICAgIDE4LCAgIC0xOSwgIC00MTUsICAgICA5LAotICAgIDQ5LCAgICA2MSwgICAxMDAsICAgIDM5LCAgIC01NiwKLSAgICAtMTExLCAgICA4MiwgICAxMzUsICAgLTMxLCAgICA1MiwKLSAgICAtOTAsICAtMTUzLCAgIC05MywgICAxODksICAgMTgyLAotICAgIC0yMTQsICAgMjk1LCAgIDExOSwgICAtNzQsICAgMjg0LAotICAgIDIsICAgMTM3LCAgICAzNywgICAgNDcsICAgMTgyLAotICAgIDkyLCAgIDExNywgICAxODQsICAgLTUzLCAgIDM3MywKLSAgICAtMjEsICAgLTE0LCAgIC0z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4LCAgIDE3NywgIC0yNzIsICAgICAzLAotICAgIDI2NiwgICAxNTYsICAgIDI4LCAgIC02OSwKLSAgICAyNjAsICAgIDg0LCAgIC04NSwgICAgODYsCi0gICAgLTI2NiwgICAxNTQsICAtMjU2LCAgLTE4MiwKLSAgICAtMTcsICAgLTY1LCAgLTMwNCwgICAgLTYsCi0gICAgLTQwLCAgIDE3NSwgIC0xNTEsICAtMTgwLAotICAgIC0yNywgICAgMjcsICAgLTg3LCAgIC02MywKLSAgICAxMjEsICAgMTE0LCAgLTE2NiwgIC00NjksCi0gICAgMTU5LCAgIC02NiwgIC0zMjMsICAtMjMxLAotICAgIDIxNCwgICAxNTIsICAtMTQxLCAgLTIxMiwKLSAgICAxMzcsICAgIDM2LCAgLTE4NCwgICAtNTEsCi0gICAgLTI4MiwgIC0yMzcsICAgIDQwLCAgICAxMCwKLSAgICAtNDgsICAtMjM1LCAgIC0zNywgICAyNTEsCi0gICAgLTU0LCAgLTMyMywgICAxMzYsICAgIDI5LAotICAgIC04OCwgIC0xNzQsICAgMjEzLCAgIDE5OCwKLSAgICAtMzkwLCAgICA5OSwgICAtNjMsICAtMzc1LAotICAgIDEwNywgIC0xNjksICAtMTY0LCAgIDQyNCwKLSAgICA2OSwgIC0xMTEsICAgMTQxLCAgLTE2NywKLSAgICA3NCwgIC0xMjksICAgIDY1LCAgIDE0NCwKLSAgICAtMzUzLCAgLTIwNywgIC0yMDUsICAtMTA5LAotICAgIC0xNjAsICAtMzg2LCAgLTM1NSwgICAgOTgsCi0gICAgLTE3NiwgIC00OTMsICAgLTIwLCAgLTE0MywKLSAgICAtMjUyLCAgLTQzMiwgICAgLTIsICAgMjE2LAotICAgIC05MCwgIC0xNzQsICAtMTY4LCAgLTQxMSwKLSAgICAxMywgIC0yODQsICAtMjI5LCAgLTE2MCwKLSAgICAtODcsICAtMjc5LCAgICAzNCwgIC0yNTEsCi0gICAgLTc1LCAgLTI2MywgICAtNTgsICAgLTQyLAotICAgIDQyMCwgICAgNTMsICAtMjExLCAgLTM1OCwKLSAgICAzODQsICAgLTM1LCAgLTM3NCwgICAzOTYsCi0gICAgNjgsICAtMjI4LCAgIDMyMywgICAgLTIsCi0gICAgMTY3LCAgLTMwNywgICAxOTIsICAgMTk0LAotICAgIDQ1OSwgICAzMjksICAgIC01LCAgLTMzMiwKLSAgICAzNzUsICAgIDc5LCAgICAtNywgICAzMTMsCi0gICAgMjgyLCAgLTEyNCwgICAyMDAsICAgLTkyLAotICAgIDI3MSwgIC0xNjIsICAgLTcwLCAgIDE4MCwKLSAgICAtMTU3LCAgLTI5OCwgIC01MTQsICAtMzA5LAotICAgIDU4LCAgLTE2MywgIC01NDYsICAgIDE4LAotICAgIDEyNCwgIC0zNjQsICAgMTY3LCAgLTIzOCwKLSAgICA4MywgIC00MTEsICAtMTE3LCAgICA5NiwKLSAgICAxNDAsICAtMTEyLCAgLTM4OCwgIC02MjQsCi0gICAgMjU5LCAgLTEzMywgIC0zMTcsICAgIDQxLAotICAgIDE2MywgIC0xMzAsICAgLTY0LCAgLTMzNCwKLSAgICAyMjYsICAtMTY1LCAgLTEyNCwgIC0xMTAsCi0gICAgLTQ2NiwgICAtNjEsICAgICA2LCAgIDIyOSwKLSAgICAtMTUzLCAgIDIwNSwgIC0xNDUsICAgMjQyLAotICAgIC0xNTksICAgIDQ4LCAgIDE5NSwgICAxNDgsCi0gICAgLTU4LCAgICAyOCwgICAgMzEsICAgMjc5LAotICAgIC0zMDMsICAgMTg1LCAgIDI3OSwgICAgLTQsCi0gICAgLTYxLCAgIDE5NywgICAgNTksICAgIDg2LAotICAgIC0xMTQsICAgMTIzLCAgIDE2OCwgICAtNTIsCi0gICAgMzUsICAgIDM2LCAgIDEwMCwgICAxMjYsCi0gICAgLTQwNywgICAxMDIsICAgLTc3LCAgIC00MCwKLSAgICAtMzM4LCAgICAtMSwgIC0zNDIsICAgMTU2LAotICAgIC0xNzksICAgMTA1LCAgIC0zNCwgICAtOTcsCi0gICAgLTE4NSwgICAgODQsICAgLTM1LCAgIDEwOCwKLSAgICAtMTMzLCAgIDEwNywgICAtOTEsICAtMzU3LAotICAgIC0xODAsICAgIDU0LCAgLTIyOSwgICAgMjQsCi0gICAgLTQ0LCAgICA0NywgICAgNDcsICAtMTgyLAotICAgIC02NiwgICAgMTMsICAgIDQ1LCAgICAgNCwKLSAgICAtMzM5LCAgIDI1MSwgICAgNjQsICAgMjI2LAotICAgIC00MiwgICAxMDEsICAtMzUwLCAgIDI3NSwKLSAgICAtOTksICAgMzk4LCAgIDE0MiwgICAxMjEsCi0gICAgMTExLCAgICAxMiwgIC0xMDIsICAgMjYwLAotICAgIDAsICAgNTA1LCAgIDI2MCwgICAtOTQsCi0gICAgMTYxLCAgIDI4NSwgICAtOTYsICAgMjI0LAotICAgIC00LCAgIDIwNiwgICAzMTQsICAgIDMzLAotICAgIDE2NywgICAxMzksICAgIDg4LCAgIDIwNCwKLSAgICAtMjM1LCAgIDMxNiwgICAtNjAsICAgLTI1LAotICAgIC04LCAgLTE1MCwgIC0zMTIsICAgMjAxLAotICAgIC0zNiwgICAyOTIsICAgIDYxLCAgLTEwNCwKLSAgICAtNDAsICAgMTc0LCAgLTE2MiwgICAgNDIsCi0gICAgLTIxLCAgIDQwMiwgICAtMjksICAtMzUxLAotICAgIDIxLCAgIDE1MiwgIC0zNjAsICAgLTkzLAotICAgIDU3LCAgIDE5MSwgICAyMTIsICAtMTk2LAotICAgIDc2LCAgIDE1OCwgICAtMjEsICAgLTY5LAotICAgIC0zMjgsICAtMTg1LCAgIDMzMSwgICAxMTksCi0gICAgLTUzLCAgIDI4NSwgICAgNTYsICAgMzM3LAotICAgIC0xMDcsICAgLTI0LCAgIDQwNSwgICAgMjksCi0gICAgLTE4LCAgIDEzNywgICAyNzIsICAgMjc3LAotICAgIC0yNTUsICAgIDIyLCAgIDE3MywgIC0xOTEsCi0gICAgMjk1LCAgIDMyMiwgICAzMjUsICAgMzAyLAotICAgIDIxLCAgIC0yNywgICAzMzIsICAtMTc4LAotICAgIDExOSwgICAgMTMsICAgMjcxLCAgIDEyOSwKLSAgICAtNDU1LCAgLTE4MCwgICAxMTYsICAtMTkxLAotICAgIC0yMjcsICAgIDYyLCAgLTE0OCwgICA1MjQsCi0gICAgLTE3NiwgIC0yODcsICAgMjgyLCAgLTE1NywKLSAgICAtMjQzLCAgICAxMywgICAxOTksICAgNDMwLAotICAgIC01OSwgICAtNDksICAgMTE1LCAgLTM2NSwKLSAgICA3MiwgIC0xNzIsICAtMTM3LCAgICA5MywKLSAgICAtMTM4LCAgLTEyNiwgICAxNDEsICAgLTg0LAotICAgIDUsICAtMTI0LCAgICAzOCwgICAtMjAsCi0gICAgLTI1OCwgICAzMTEsICAgNjAxLCAgIDIxMywKLSAgICA5NCwgICAxMzAsICAgLTYxLCAgIDUwMiwKLSAgICAtMSwgIC0xNTcsICAgNDg1LCAgIDMxMywKLSAgICAxNDYsICAgLTc0LCAgIDE1OCwgICAzNDUsCi0gICAgMjc2LCAgIDEzNSwgICAyODAsICAgLTU3LAotICAgIDQ5MCwgICAyNTIsICAgIDk5LCAgICA0MywKLSAgICAyNjcsICAgLTc0LCAgIDQyOSwgICAxMDUsCi0gICAgMjc4LCAgIC0yMywgICAxMTksICAgIDk0LAotICAgIC01NDIsICAgNDg4LCAgIDI1NywgIC0xMTUsCi0gICAgLTg0LCAgLTI0NCwgIC00MzgsICAgNDc4LAotICAgIC0xMTMsICAtNTQ1LCAgIDM4NywgICAxMDEsCi0gICAgLTk1LCAgLTMwNiwgICAxMTEsICAgNDk4LAotICAgIDk1LCAgIDE2NiwgICAgMjIsICAtMzAxLAotICAgIDQyMCwgICAtMTUsICAgLTU4LCAgIC03OCwKLSAgICAyNzAsICAgIDI5LCAgIDEyMiwgIC0yODIsCi0gICAgMTYwLCAgLTI0MCwgICAgNTAsICAgLTM4Ci19OwotCi1jb25zdCBpbnQxNiBkaWNvMjNfaXNmXzM2YltTSVpFX0JLMjNfMzZiKjddID0KLXsKLQotICAgIDgxLCAgIC0xOCwgICAgNjgsICAgLTI3LCAgLTEyMiwgIC0yODAsICAgIC00LAotICAgIDQ1LCAgLTE3NywgICAyMDksICAgLTMwLCAgLTEzNiwgICAtNzQsICAgMTMxLAotICAgIC00NCwgICAxMDEsICAgLTc1LCAgIC04OCwgICAtNDgsICAtMTM3LCAgIC01NCwKLSAgICAtMjQ1LCAgIC0yOCwgICAgNjMsICAgLTE4LCAgLTExMiwgIC0xMDMsICAgIDU4LAotICAgIC03OSwgICAgLTYsICAgMjIwLCAgIC02NSwgICAxMTQsICAgLTM1LCAgIC01MCwKLSAgICAxMDksICAgLTY1LCAgIDE0MywgIC0xMTQsICAgMTI5LCAgICA3NiwgICAxMjUsCi0gICAgMTY2LCAgICA5MCwgICAtNjEsICAtMjQyLCAgIDE4NiwgICAtNzQsICAgLTQzLAotICAgIC00NiwgICAtOTIsICAgIDQ5LCAgLTIyNywgICAgMjQsICAtMTU1LCAgICAzOSwKLSAgICA2NywgICAgODUsICAgIDk5LCAgIC00MiwgICAgNTMsICAtMTg0LCAgLTI4MSwKLSAgICAxNDIsICAtMTIyLCAgICAgMCwgICAgMjEsICAtMTQyLCAgIC0xNSwgICAtMTcsCi0gICAgMjIzLCAgICA5MiwgICAtMjEsICAgLTQ4LCAgIC04MiwgICAtMTQsICAtMTY3LAotICAgIDUxLCAgIC0zNywgIC0yNDMsICAgLTMwLCAgIC05MCwgICAgMTgsICAgLTU2LAotICAgIDU0LCAgIDEwNSwgICAgNzQsICAgIDg2LCAgICA2OSwgICAgMTMsICAtMTAxLAotICAgIDE5NiwgICAgNzIsICAgLTg5LCAgICA0MywgICAgNjUsICAgIDE5LCAgICAzOSwKLSAgICAxMjEsICAgIDM0LCAgIDEzMSwgICAtODIsICAgIDI1LCAgIDIxMywgIC0xNTYsCi0gICAgMTAxLCAgLTEwMiwgIC0xMzYsICAgLTIxLCAgICA1NywgICAyMTQsICAgIDIyLAotICAgIDM2LCAgLTEyNCwgICAyMDUsICAgMjA0LCAgICA1OCwgIC0xNTYsICAgLTgzLAotICAgIDgzLCAgLTExNywgICAxMzcsICAgMTM3LCAgICA4NSwgICAxMTYsICAgIDQ0LAotICAgIC05MiwgIC0xNDgsICAgLTY4LCAgICAxMSwgIC0xMDIsICAtMTk3LCAgLTIyMCwKLSAgICAtNzYsICAtMTg1LCAgIC01OCwgICAxMzIsICAgLTI2LCAgLTE4MywgICAgODUsCi0gICAgLTcsICAgLTMxLCAgICAtMiwgICAgMjMsICAgMjA1LCAgLTE1MSwgICAgMTAsCi0gICAgLTI3LCAgIC0zNywgICAgLTUsICAgLTE4LCAgIDI5MiwgICAxMzEsICAgICAxLAotICAgIDExNywgIC0xNjgsICAgICA5LCAgIC05MywgICAgODAsICAgLTU5LCAgLTEyNSwKLSAgICAtMTgyLCAgLTI0NCwgICAgOTgsICAgLTI0LCAgIDEzNSwgICAtMjIsICAgIDk0LAotICAgIDIyMSwgICAgOTcsICAgMTA2LCAgICA0MiwgICAgNDMsICAtMTYwLCAgICA4MywKLSAgICAyNSwgICAtNjQsICAgLTIxLCAgICAgNiwgICAgMTQsICAgLTE1LCAgIDE1NCwKLSAgICAxMjYsICAgIDE1LCAgLTE0MCwgICAxNTAsICAgLTEwLCAgLTIwNywgIC0xMTQsCi0gICAgNzksICAgLTYzLCAgLTIxMSwgICAtNzAsICAgLTI4LCAgLTIxNywgICAxNjUsCi0gICAgNDYsICAgIDM4LCAgIC0yMiwgICAyODEsICAgMTMyLCAgIC02MiwgICAxMDksCi0gICAgMTEyLCAgICA1NCwgIC0xMTIsICAgLTkzLCAgIDIwOCwgICAgMjcsICAgMjk2LAotICAgIDExNSwgICAgMTAsICAtMTQ3LCAgICA0MSwgICAyMTYsICAgIDQyLCAgLTI3NiwKLSAgICA1MCwgIC0xMTUsICAtMjU0LCAgIDE2NywgICAxMTcsICAgIC0yLCAgICA2MSwKLSAgICAxNywgICAxNDQsICAgIDM0LCAgIC03MiwgIC0xODYsICAtMTUwLCAgIDI3MiwKLSAgICAtMjksICAgLTY2LCAgIC04OSwgICAtOTUsICAtMTQ5LCAgIDEyOSwgICAyNTEsCi0gICAgMTIyLCAgICAgMCwgICAtNTAsICAtMjM0LCAgIC05MSwgICAgMzYsICAgIDI2LAotICAgIC0xMDUsICAtMTAyLCAgIC04OCwgIC0xMjEsICAtMjM2LCAgICAtNywgICAtMTEsCi0gICAgLTIwNCwgICAxMDksICAgICA1LCAgLTE5MSwgICAxMDUsICAgLTE1LCAgIDE2MywKLSAgICAtODAsICAgIDMyLCAgIC0yNCwgIC0yMDksICAgIDQxLCAgIDI5NCwgICAgNzAsCi0gICAgLTEwNiwgICAtOTQsICAtMjA0LCAgLTExOCwgICAxMjAsICAgLTUwLCAgIC0zNywKLSAgICAtODIsICAtMjQxLCAgICA0NiwgIC0xMzEsICAgLTI5LCAgIDE1MCwgICAtNTUsCi0gICAgMzMsICAgMTU1LCAgIDEyMCwgICAtODksICAgIC04LCAgICAgNywgICAgNjIsCi0gICAgMjEzLCAgICA4MiwgICAgNjEsICAgIDE4LCAgLTE2MSwgICAxNDQsICAgMTUyLAotICAgIDMwLCAgIDEzMSwgICAgNjUsICAgLTg3LCAgLTI1NSwgICAtMTcsICAtMTA3LAotICAgIC04LCAgICA4NSwgICAtNjQsICAgIDUxLCAgLTE2MiwgICAyMjMsICAgLTUzLAotICAgIC0xMzQsICAgMjYxLCAgICA2OSwgICAtNTYsICAgMjE4LCAgICA3MiwgIC0xMTEsCi0gICAgMiwgICAxNTUsICAtMTEzLCAgIC04NywgICAgNDksICAgIDg1LCAgIC0yOCwKLSAgICAtMTYzLCAgICA0MiwgICAgLTEsICAtMTk2LCAgICAgNywgICAgMzksICAtMjQ1LAotICAgIDE0LCAgLTEzNywgICAtNzksICAgIDExLCAgLTE2MCwgICAyMDIsICAtMjkzLAotICAgIC05NCwgICAgMzMsICAgMjA4LCAgIDEwMCwgICAgNTYsICAgLTQ0LCAgIDMyNiwKLSAgICAtNzgsICAgLTQxLCAgIDIzMiwgICAgMTMsICAtMTQyLCAgIDIyNywgICAgODAsCi0gICAgLTE2LCAgIC04NywgICAyMDEsICAgIDMzLCAgLTEzMywgICAgMTUsICAtMTgzLAotICAgIC01OCwgIC0xOTIsICAgLTQ3LCAgIDE4NCwgIC0xMjgsICAgMTMzLCAgICA5OSwKLSAgICAtMjA1LCAgICAxMSwgIC0xNTUsICAgIDc4LCAgICA1MiwgICAgNzIsICAgMTQxLAotICAgIC0yNDYsICAgIDI2LCAgICA5OSwgICAxNTEsICAgIDU5LCAgIDExNSwgICAtNjQsCi0gICAgLTc5LCAgIC00NywgICAtMTYsICAgLTE0LCAgICAgNiwgICAgNDcsICAgLTQzLAotICAgIC03MiwgIC0xNzgsICAgLTI3LCAgIDE2MiwgICAxMTIsICAgIDQzLCAgLTE3NCwKLSAgICAtMTc1LCAgIDIzOCwgICAxODYsICAgIDcxLCAgIC01NCwgIC0xODgsICAgLTc2LAotICAgIC0yMjUsICAgMjMzLCAgICAzOSwgICAtMzksICAtMTU4LCAgIDEyMiwgICAgNDQsCi0gICAgLTI2LCAgICA0MywgICAgODQsICAgMTMwLCAgIC05MywgICAtNTEsICAgIDIyLAotICAgIDMsICAgIDkyLCAgLTE1MCwgICAxMzYsICAtMTgyLCAgIC01NywgICAgOTcsCi0gICAgLTEzMSwgICAxNzksICAgLTc4LCAgICA4MCwgICAgOTEsICAtMTY1LCAgICA5MCwKLSAgICAtMiwgICAxNDgsICAgIDE1LCAgIDEzMCwgICAgNjUsICAgMTc1LCAgIDExNywKLSAgICAtMTM4LCAgIDExNCwgIC0xMzcsICAgMTMyLCAgICAgMywgICAtMTAsICAtMTg2LAotICAgIDE0MCwgICAgLTQsICAgLTM3LCAgIDI1NCwgICAtNjIsICAgIDkyLCAgLTEwOQotfTsKLQotCmRpZmYgLS1naXQgYS9tZWRpYS9saWJzdGFnZWZyaWdodC9jb2RlY3MvYW1yd2Ivc3JjL3NjYWxlX3NpZ25hbC5jcHAgYi9tZWRpYS9saWJzdGFnZWZyaWdodC9jb2RlY3MvYW1yd2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ChpKSAgIDogZXhwb25lbnQ6IHggPSByb3VuZCh4IDw8IGV4cCkgKi8KLSkKLXsKLSAgICBpbnQxNiBpOwotICAgIGludDE2IHRtcDsKLSAgICBpbnQxNiAqcHRfeDsKLQotCi0gICAgaW50MzIgTF90bXA7Ci0KLQotICAgIGlmIChleHAgPiAwKQotICAgIHsKLSAgICAgICAgZm9yIChpID0gMDsgaSA8IGxnOyBpKyspCi0gICAgICAgIHsKLSAgICAgICAgICAgIExfdG1wID0gc2hsX2ludDMyKCgoaW50MzIpeFtpXSA8PCAxNiksIGV4cCk7ICAgICAgIC8qIHNhdHVyYXRpb24gY2FuIG9jY3VyIGhlcmUgKi8KLSAgICAgICAgICAgIHhbaV0gPSBhbXJfd2Jfcm91bmQoTF90bXApOwotICAgICAgICB9Ci0gICAgfQotICAgIGVsc2UgaWYgKGV4cCA8IDApCi0gICAgewotICAgICAgICBleHAgPSAtZXhwOwotICAgICAgICBleHAgJj0gMHhmOwotICAgICAgICB0bXAgPSAoaW50MTYpKDB4MDAwMDgwMDAgPj4gKDE2IC0gZXhwKSk7Ci0gICAgICAgIHB0X3ggPSB4OwotCi0gICAgICAgIGZvciAoaSA9IGxnID4+IDE7IGkgIT0gMDsgaS0tKQotICAgICAgICB7Ci0gICAgICAgICAgICAqKHB0X3gpICAgPSBhZGRfaW50MTYoKihwdF94KSwgdG1wKSA+PiBleHA7Ci0gICAgICAgICAgICBwdF94Kys7Ci0gICAgICAgICAgICAqKHB0X3gpICAgPSBhZGRfaW50MTYoKihwdF94KSwgdG1wKSA+PiBleHA7Ci0gICAgICAgICAgICBwdF94Kys7Ci0gICAgICAgIH0KLQotICAgIH0KLSAgICByZXR1cm47Ci19CmRpZmYgLS1naXQgYS9tZWRpYS9saWJzdGFnZWZyaWdodC9jb2RlY3MvYW1yd2Ivc3JjL3N5bnRoZXNpc19hbXJfd2IuY3BwIGIvbWVkaWEvbGlic3RhZ2VmcmlnaHQvY29kZWNzL2FtcndiL3NyYy9zeW50aGVz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HN5bnRoZXNpc19hbXJfd2IuY3BwCi0KLSAgICAgRGF0ZTogMDUvMDQvMjAwNwotCi0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0KLSBSRVZJU0lPTiBISVNUT1JZCi0KLQotIERlc2NyaXB0aW9uOgotCi0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0KLSBJTlBVVCBBTkQgT1VUUFVUIERFRklOSVRJT05TCi0KLSAgICAgaW50MTYgQXFbXSwgICAgICAgICAgICAgICAgICAgICAgICAgICBBKHopICA6IHF1YW50aXplZCBBegotICAgICBpbnQxNiBleGNbXSwgICAgICAgICAgICAgICAgICAgICAgICAgIChpKSAgIDogZXhjaXRhdGlvbiBhdCAxMmtIegotICAgICBpbnQxNiBRX25ldywgICAgICAgICAgICAgICAgICAgICAgICAgIChpKSAgIDogc2NhbGluZyBwZXJmb3JtZWQgb24gZXhjCi0gICAgIGludDE2IHN5bnRoMTZrW10sICAgICAgICAgICAgICAgICAgICAgKG8pICAgOiAxNmtIeiBzeW50aGVzaXMgc2lnbmFsCi0gICAgIGludDE2IHBybXMsICAgICAgICAgICAgICAgICAgICAgICAgICAgKGkpICAgOiBjb21wcmVzc2VkIGFtciB3YgotICAgICBpbnQxNiBIZklzZltdLAotICAgICBpbnQxNiBuYl9iaXRzLAotICAgICBpbnQxNiBuZXdEVFhTdGF0ZSwKLSAgICAgRGVjb2Rlcl9TdGF0ZSAqIHN0LCAgICAgICAgICAgICAgICAgICAoaS9vKSA6IFN0YXRlIHN0cnVjdHVyZQotICAgICBpbnQxNiBiZmksICAgICAgICAgICAgICAgICAgICAgICAgICAgIChpKSAgIDogYmFkIGZyYW1lIGluZGljYXRvcgotICAgICBpbnQxNiA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ZWQgb24gZXhjICAgKi8KLSAgICBpbnQxNiBzeW50aDE2a1tdLCAgICAgICAgLyogKG8pICAgOiAxNmtIeiBzeW50aGVzaXMgc2lnbmFsICAgICAqLwotICAgIGludDE2IHBybXMsICAgICAgICAgICAgICAvKiAoaSkgICA6IHBhcmFtZXRlciAgICAgICAgICAgICAgICAgICovCi0gICAgaW50MTYgSGZJc2ZbXSwKLSAgICBpbnQxNiBuYl9iaXRzLAotICAgIGludDE2IG5ld0RUWFN0YXRlLAotICAgIERlY29kZXJfU3RhdGUgKiBzdCwgICAgICAvKiAoaS9vKSA6IFN0YXRlIHN0cnVjdHVyZSAgICAgICAgICAgICovCi0gICAgaW50MTYgYmZpLCAgICAgICAgICAgICAgIC8qIChpKSAgIDogYmFkIGZyYW1lIGluZGljYXRvciAgICAgICAgKi8KLSAgICBpbnQxNiAqU2NyYXRjaE1lbQotKQotewotICAgIGludDE2IGksIGZhYywgZXhwOwotICAgIGludDE2IHRtcDsKLSAgICBpbnQxNiBlbmVyLCBleHBfZW5lcjsKLSAgICBpbnQzMiBMX3RtcDsKLSAgICBpbnQzMiBMX3RtcDI7Ci0KLSAgICBpbnQxNiBIRl9jb3JyX2dhaW47Ci0gICAgaW50MTYgSEZfZ2Fpbl9pbmQ7Ci0gICAgaW50MTYgZ2FpbjEsIGdhaW4yOwotCi0gICAgaW50MTYgKnB0X3N5bnRoOwotICAgIGludDE2ICpwdF9IRjsKLSAgICBpbnQxNiAqc3ludGhfaGkgPSAgU2NyYXRjaE1lbTsKLSAgICBpbnQxNiAqc3ludGhfbG8gPSAmU2NyYXRjaE1lbVtNICsgTF9TVUJGUl07Ci0gICAgaW50MTYgKnN5bnRoICAgID0gJnN5bnRoX2xvW00gKyBMX1NVQkZSXTsKLSAgICBpbnQxNiAqSEYgICAgICAgPSAmc3ludGhbTF9TVUJGUl07Ci0gICAgaW50MTYgKkFwICAgICAgID0gJkhGW0xfU1VCRlIxNmtdOyAgICAgICAvKiBIaWdoIEZyZXF1ZW5jeSB2ZWN0b3IgICAqLwotICAgIGludDE2ICpIZkEgICAgICA9ICZBcFtNMTZrICsgMV07Ci0gICAgaW50MTYgKnB0X3RtcDsKLQotICAgIC8qLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tKgotICAgICAqIHNwZWVjaCBzeW50aGVzaXMgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKgotICAgICAqIH5+fn5+fn5+fn5+fn5+fn4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKgotICAgICAqIC0gRmluZCBzeW50aGVzaXMgc3BlZWNoIGNvcnJlc3BvbmRpbmcgdG8gZXhjMltdLiAgICAgICAgICAgKgotICAgICAqIC0gUGVyZm9ybSBmaXhlZCBkZWVtcGhhc2lzIGFuZCBocCA1MGh6IGZpbHRlcmluZy4gICAgICAgICAgKgotICAgICAqIC0gT3ZlcnNhbXBsaW5nIGZyb20gMTIuOGtIeiB0byAxNmtIei4gICAgICAgICAgICAgICAgICAgICAgKgotICAgICAqLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tKi8KLQotICAgIHB2X21lbWNweSgodm9pZCAqKXN5bnRoX2hpLAotICAgICAgICAgICAgICAodm9pZCAqKXN0LT5tZW1fc3luX2hpLAotICAgICAgICAgICAgICBNKnNpemVvZigqc3ludGhfaGkpKTsKLQotICAgIHB2X21lbWNweSgodm9pZCAqKXN5bnRoX2xvLAotICAgICAgICAgICAgICAodm9pZCAqKXN0LT5tZW1fc3luX2xvLAotICAgICAgICAgICAgICBNKnNpemVvZigqc3ludGhfbG8pKTsKLQotICAgIFN5bl9maWx0XzMyKEFxLCBNLCBleGMsIFFfbmV3LCBzeW50aF9oaSArIE0sIHN5bnRoX2xvICsgTSwgTF9TVUJGUik7Ci0KLSAgICBwdl9tZW1jcHkoKHZvaWQgKilzdC0+bWVtX3N5bl9oaSwKLSAgICAgICAgICAgICAgKHZvaWQgKikoc3ludGhfaGkgKyBMX1NVQkZSKSwKLSAgICAgICAgICAgICAgTSpzaXplb2YoKnN0LT5tZW1fc3luX2hpKSk7Ci0KLSAgICBwdl9tZW1jcHkoKHZvaWQgKilzdC0+bWVtX3N5bl9sbywKLSAgICAgICAgICAgICAgKHZvaWQgKikoc3ludGhfbG8gKyBMX1NVQkZSKSwKLSAgICAgICAgICAgICAgTSpzaXplb2YoKnN0LT5tZW1fc3luX2xvKSk7Ci0KLSAgICBkZWVtcGhhc2lzXzMyKHN5bnRoX2hpICsgTSwKLSAgICAgICAgICAgICAgICAgIHN5bnRoX2xvICsgTSwKLSAgICAgICAgICAgICAgICAgIHN5bnRoLAotICAgICAgICAgICAgICAgICAgUFJFRU1QSF9GQUMsCi0gICAgICAgICAgICAgICAgICBMX1NVQkZSLAotICAgICAgICAgICAgICAgICAgJihzdC0+bWVtX2RlZW1waCkpOwotCi0gICAgaGlnaHBhc3NfNTBIel9hdF8xMms4KHN5bnRoLAotICAgICAgICAgICAgICAgICAgICAgICAgICBMX1NVQkZSLAotICAgICAgICAgICAgICAgICAgICAgICAgICBzdC0+bWVtX3NpZ19vdXQpOwotCi0gICAgb3ZlcnNhbXBfMTJrOF90b18xNmsoc3ludGgsCi0gICAgICAgICAgICAgICAgICAgICAgICAgTF9TVUJGUiwKLSAgICAgICAgICAgICAgICAgICAgICAgICBzeW50aDE2aywKLSAgICAgICAgICAgICAgICAgICAgICAgICBzdC0+bWVtX292ZXJzYW1wLAotICAgICAgICAgICAgICAgICAgICAgICAgIFNjcmF0Y2hNZW0pOwotCi0gICAgLyoKLSAgICAgKiBIRiBub2lzZSBzeW50aGVzaXMKLSAgICAgKiAtIEdlbmVyYXRlIEhGIG5vaXNlIGJldHdlZW4gNS41IGFuZCA3LjUga0h6LgotICAgICAqIC0gU2V0IGVuZXJneSBvZiBub2lzZSBh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gICAgICAgKihwdF90bXApID0gKGludDE2KShmeHBfbXVsXzE2YnkxNigqKHB0X3RtcCksIHRtcCkgPj4gMTUpOwotICAgICAgICBwdF90bXArKzsKLSAgICAgICAgKihwdF90bXApID0gKGludDE2KShmeHBfbXVsXzE2YnkxNigqKHB0X3RtcCksIHRtcCkgPj4gMTUpOwotICAgICAgICBwdF90bXArKzsKLSAgICAgICAgKihwdF90bXApID0gKGludDE2KShmeHBfbXVsXzE2YnkxNigqKHB0X3RtcCksIHRtcCkgPj4gMTUpOwotICAgICAgICBwdF90bXArKzsKLSAgICAgICAgKihwdF90bXApID0gKGludDE2KShmeHBfbXVsXzE2YnkxNigqKHB0X3RtcCksIHRtcCkgPj4gMTUpOwotICAgICAgICBwdF90bXArKzsKLSAgICB9Ci0KLSAgICAvKiBmaW5kIHRpbHQgb2Ygc3ludGhlc2lzIHNwZWVjaCAodGlsdDogMT12b2ljZWQsIC0xPXVudm9pY2VkKSAqLwotCi0gICAgaGlnaHBhc3NfNDAwSHpfYXRfMTJrOChzeW50aCwgTF9TVUJGUiwgc3QtPm1lbV9ocDQwMCk7Ci0KLSAgICBMX3RtcCA9IDFMOwotICAgIExfdG1wMiA9IDFMOwotCi0KLSAgICBMX3RtcCA9IG1hY18xNmJ5MTZfdG9faW50MzIoTF90bXAsIHN5bnRoWzBdLCBzeW50aFswXSk7Ci0KLSAgICBmb3IgKGkgPSAxOyBpIDwgTF9TVUJGUjsgaSsrKQotICAgIHsKLSAgICAgICAgTF90bXAgID0gbWFjXzE2YnkxNl90b19pbnQzMihMX3RtcCwgIHN5bnRoW2ldLCBzeW50aFtpICAgIF0pOwotICAgICAgICBMX3RtcDIgPSBtYWNfMTZieTE2X3RvX2ludDMyKExfdG1wMiwgc3ludGhbaV0sIHN5bnRoW2kgLSAxXSk7Ci0gICAgfQotCi0KLSAgICBleHAgPSBub3JtYWxpemVfYW1yX3diKExfdG1wKTsKLQotICAgIGVuZXIgPSAoaW50MTYpKChMX3RtcCA8PCBle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RtcCA9IEhGOwotICAgICAgICBmb3IgKGkgPSBMX1NVQkZSMTZrID4+IDI7IGkgIT0gMCA7IGktLSkKLSAgICAgICAgewotICAgICAgICAgICAgKihwdF90bXApID0gbXVsdF9pbnQxNigqKHB0X3RtcCksIEhGX2NvcnJfZ2FpbikgPDwgMTsKLSAgICAgICAgICAgIHB0X3RtcCsrOwotICAgICAgICAgICAgKihwdF90bXApID0gbXVsdF9pbnQxNigqKHB0X3RtcCksIEhGX2NvcnJfZ2FpbikgPDwgMTsKLSAgICAgICAgICAgIHB0X3RtcCsrOwotICAgICAgICAgICAgKihwdF90bXApID0gbXVsdF9pbnQxNigqKHB0X3RtcCksIEhGX2NvcnJfZ2FpbikgPDwgMTsKLSAgICAgICAgICAgIHB0X3RtcCsrOwotICAgICAgICAgICAgKihwdF90bXApID0gbXVsdF9pbnQxNigqKHB0X3RtcCksIEhGX2NvcnJfZ2FpbikgPDwgMTsKLSAgICAgICAgICAgIHB0X3RtcCsrOwotICAgICAgICB9Ci0KLSAgICAgICAgLyogSEYgZ2FpbiAqLwotICAgIH0KLSAgICBlbHNlCi0gICAgewotICAgICAgICBwdF90bXAgPSBIRjsKLSAgICAgICAgZm9yIChpID0gTF9TVUJGUjE2ayA+PiAyOyBpICE9IDAgOyBpLS0pCi0gICAgICAgIHsKLSAgICAgICAgICAgICoocHRfdG1wKSA9IG11bHRfaW50MTYoKihwdF90bXApLCB0bXApOwotICAgICAgICAgICAgcHRfdG1wKys7Ci0gICAgICAgICAgICAqKHB0X3RtcCkgPSBtdWx0X2ludDE2KCoocHRfdG1wKSwgdG1wKTsKLSAgICAgICAgICAgIHB0X3RtcCsrOwotICAgICAgICAgICAgKihwdF90bXApID0gbXVsdF9pbnQxNigqKHB0X3RtcCksIHRtcCk7Ci0gICAgICAgICAgICBwdF90bXArKzsKLSAgICAgICAgICAgICoocHRfdG1wKSA9IG11bHRfaW50MTYoKihwdF90bXApLCB0bXApOwotICAgICAgICAgICAgcHRfdG1wKys7Ci0gICAgICAgIH0KLSAgICB9Ci0KLQotICAgIGlmICgobmJfYml0cyA8PSBOQkJJVFNfN2spICYmIChuZXdEVFhTdGF0ZSA9PSBTUEVFQ0gpKQotICAgIHsKLSAgICAgICAgaXNmX2V4dHJhcG9sYXRpb24oSGZJc2YpOwotICAgICAgICBJc3BfQXooSGZJc2YsIEhmQSwgTTE2aywgMCk7Ci0KLSAgICAgICAgd2VpZ2h0X2FtcndiX2xwYyhIZkEsIEFwLCAyOTQ5MSwgTTE2ayk7ICAgICAvKiBmYWM9MC45ICovCi0KLSAgICAgICAgd2Jfc3luX2ZpbHQoQXAsCi0gICAgICAgICAgICAgICAgICAgIE0xNmssCi0gICAgICAgICAgICAgICAgICAgIEhGLAotICAgICAgICAgICAgICAgICAgICBIRiwKLSAgICAgICAgICAgICAgICAgICAgTF9TVUJGUjE2aywKLSAgICAgICAgICAgICAgICAgICAgc3QtPm1lbV9zeW5faGYsCi0gICAgICAgICAgICAgICAgICAgIDEsCi0gICAgICAgICAgICAgICAgICAgIFNjcmF0Y2hNZW0pOwotICAgIH0KLSAgICBlbHNlCi0gICAgewotICAgICAgICAvKiBzeW50aGVzaXMgb2Ygbm9pc2U6IDQuOGtIei4uNS42a0h6IC0tPiA2a0h6Li43a0h6ICovCi0gICAgICAgIHdlaWdodF9hbXJ3Yl9scGMoQXEsIEFwLCAxOTY2MSwgTSk7ICAgICAgICAgLyogZmFjPTAuNiAqLwotCi0gICAgICAgIHdiX3N5bl9maWx0KEFwLAotICAgICAgICAgICAgICAgICAgICBNLAotICAgICAgICAgICAgICAgICAgICBIRiwKLSAgICAgICAgICAgICAgICAgICAgSEYsCi0gICAgICAgICAgICAgICAgICAgIExfU1VCRlIxNmssCi0gICAgICAgICAgICAgICAgICAgIHN0LT5tZW1fc3luX2hmICsgKE0xNmsgLSBNKSwKLSAgICAgICAgICAgICAgICAgICAgMSwKLSAgICAgICAgICAgICAgICAgICAgU2NyYXRjaE1lbSk7Ci0gICAgfQotCi0gICAgLyogbm9pc2UgQmFuZCBQYXNzIGZpbHRlcmluZyAoMW1zIG9mIGRlbGF5KSAqLwotICAgIGJhbmRfcGFzc182a183ayhIRiwKLSAgICAgICAgICAgICAgICAgICAgTF9TVUJGUjE2aywKLSAgICAgICAgICAgICAgICAgICAgc3QtPm1lbV9oZiwKLSAgICAgICAgICAgICAgICAgICAgU2NyYXRjaE1lbSk7Ci0KLQotICAgIGlmIChuYl9iaXRzID49IE5CQklUU18yNGspCi0gICAgewotICAgICAgICAvKiBMb3cgUGFzcyBmaWx0ZXJpbmcgKDcga0h6KSAqLwotICAgICAgICBsb3dfcGFzc19maWx0XzdrKEhGLAotICAgICAgICAgICAgICAgICAgICAgICAgIExfU1VCRlIxNmssCi0gICAgICAgICAgICAgICAgICAgICAgICAgc3QtPm1lbV9oZjMsCi0gICAgICAgICAgICAgICAgICAgICAgICAgU2NyYXRjaE1lbSk7Ci0gICAgfQotICAgIC8qIGFkZCBmaWx0ZXJlZCBIRiBub2lzZSB0byBzcGVlY2ggc3ludGhlc2lzICovCi0KLSAgICBwdF9zeW50aCA9IHN5bnRoMTZrOwotICAgIHB0X0hGID0gSEY7Ci0KLSAgICBmb3IgKGkgPSBMX1NVQkZSMTZrID4+IDE7IGkgIT0gMDsgaS0tKQotICAgIHsKLSAgICAgICAgKihwdF9zeW50aCkgPSBhZGRfaW50MTYoKihwdF9zeW50aCksICoocHRfSEYrKykpOyAvKiBjaGVjayAxNiBiaXQgc2F0dXJhdGlvbiAqLwotICAgICAgICBwdF9zeW50aCsrOwotICAgICAgICAqKHB0X3N5bnRoKSA9IGFkZF9pbnQxNigqKHB0X3N5bnRoKSwgKihwdF9IRisrKSk7Ci0gICAgICAgIHB0X3N5bnRoKys7Ci0gICAgfQotCi19Ci0KZGlmZiAtLWdpdCBhL21lZGlhL2xpYnN0YWdlZnJpZ2h0L2NvZGVjcy9hbXJ3Yi9zcmMvc3ludGhlc2lzX2Ftcl93Yi5oIGIvbWVkaWEvbGlic3RhZ2Vmc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0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0KLSBJTlBVVCBBTkQgT1VUUFVUIERFRklOSVRJT05TCi0KLXdiX3N5bl9maWx0Ci0KLSAgICAgaW50MTYgYVtdLCAgICAgICAgICAgICAgIChpKSBRMTIgOiBhW20rMV0gcHJlZGljdGlvbiBjb2VmZmljaWVudHMKLSAgICAgaW50MTYgbSwgICAgICAgICAgICAgICAgIChpKSAgICAgOiBvcmRlciBvZiBMUCBmaWx0ZXIKLSAgICAgaW50MTYgeFtdLCAgICAgICAgICAgICAgIChpKSAgICAgOiBpbnB1dCBzaWduYWwKLSAgICAgaW50MTYgeVtdLCAgICAgICAgICAgICAgIChvKSAgICAgOiBvdXRwdXQgc2lnbmFsCi0gICAgIGludDE2IGxnLCAgICAgICAgICAgICAgICAoaSkgICAgIDogc2l6ZSBvZiBmaWx0ZXJpbmcKLSAgICAgaW50MTYgbWVtW10sICAgICAgICAgICAgIChpL28pICAgOiBtZW1vcnkgYXNzb2NpYXRlZCB3aXRoIHRoaXMgZmlsdGVyaW5nLgotICAgICBpbnQxNiB1cGRhdGUsICAgICAgICAgICAgKGkpICAgICA6IDA9bm8gdXBkYXRlLCAxPXVwZGF0ZSBvZiBtZW1vcnkuCi0gICAgIGludDE2IHlfYnVmW10KLQotU3luX2ZpbHRfMzIKLQotICAgICBpbnQxNiBhW10sICAgICAgICAgICAgICAoaSkgUTEyIDogYVttKzFdIHByZWRpY3Rpb24gY29lZmZpY2llbnRzCi0gICAgIGludDE2IG0sICAgICAgICAgICAgICAgIChpKSAgICAgOiBvcmRlciBvZiBMUCBmaWx0ZXIKLSAgICAgaW50MTYgZXhjW10sICAgICAgICAgICAgKGkpIFFuZXc6IGV4Y2l0YXRpb24gKGV4Y1tpXSA+PiBRbmV3KQotICAgICBpbnQxNiBRbmV3LCAgICAgICAgICAgICAoaSkgICAgIDog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gICAgLyogKGkpIFExMiA6IGFbbSsxXSBwcmVkaWN0aW9uIGNvZWZmaWNpZW50cyAgICAgICAgICAgKi8KLSAgICBpbnQxNiBtLCAgICAgICAgIC8qIChpKSAgICAgOiBvcmRlciBvZiBMUCBmaWx0ZXIgICAgICAgICAgICAgICAgICAgICAgICovCi0gICAgaW50MTYgeFtdLCAgICAgICAvKiAoaSkgICAgIDogaW5wdXQgc2lnbmFsICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotICAgIGludDE2IHlbXSwgICAgICAgLyogKG8pICAgICA6IG91dHB1dCBzaWduYWwgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLSAgICBpbnQxNiBsZywgICAgICAgIC8qIChpKSAgICAgOiBzaXplIG9mIGZpbHRlcmluZyAgICAgICAgICAgICAgICAgICAgICAgICovCi0gICAgaW50MTYgbWVtW10sICAgICAvKiAoaS9vKSAgIDogbWVtb3J5IGFzc29jaWF0ZWQgd2l0aCB0aGlzIGZpbHRlcmluZy4gICAqLwotICAgIGludDE2IHVwZGF0ZSwgICAgLyogKGkpICAgICA6IDA9bm8gdXBkYXRlLCAxPXVwZGF0ZSBvZiBtZW1vcnkuICAgICAgICAgKi8KLSAgICBpbnQxNiB5X2J1ZltdCi0pCi17Ci0KLSAgICBpbnQxNiBpLCBqOwotICAgIGludDMyIExfdG1wMTsKLSAgICBpbnQzMiBMX3RtcDI7Ci0gICAgaW50MzIgTF90bXAzOwotICAgIGludDMyIExfdG1wNDsKLSAgICBpbnQxNiAqeXk7Ci0KLSAgICAvKiBjb3B5IGluaXRpYWwgZmlsdGVyIHN0YXRlcyBpbnRvIHN5bnRoZXNpcyBidWZmZXIgKi8KLSAgICBwdl9tZW1jcHkoeV9idWYsIG1lbSwgbSpzaXplb2YoKnl5KSk7Ci0KLSAgICB5eSA9ICZ5X2J1ZlttXTsKLQotICAgIC8qIERvIHRoZSBmaWx0ZXJpbmcuICovCi0KLSAgICBmb3IgKGkgPSAwOyBpIDwgbGc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sKLX0KLQotLyotLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tCi07IEZVTkNUSU9OIENPREUKLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0qLwotCi12b2lkIFN5bl9maWx0XzMyKAotICAgIGludDE2IGFbXSwgICAgICAgICAgICAgIC8qIChpKSBRMTIgOiBhW20rMV0gcHJlZGljdGlvbiBjb2VmZmljaWVudHMgKi8KLSAgICBpbnQxNiBtLCAgICAgICAgICAgICAgICAvKiAoaSkgICAgIDogb3JkZXIgb2YgTFAgZmlsdGVyICAgICAgICAgICAgICovCi0gICAgaW50MTYgZXhjW10sICAgICAgICAgICAgLyogKGkpIFFuZXc6IGV4Y2l0YXRpb24gKGV4Y1tpXSA+PiBRbmV3KSAgICAqLwotICAgIGludDE2IFFuZXcsICAgICAgICAgICAgIC8qIChpKSAgICAgOiBleGMgc2NhbGluZyA9IDAobWluKSB0byA4KG1heCkgKi8KLSAgICBpbnQxNiBzaWdfaGlbXSwgICAgICAgICAvKiAobykgLzE2IDogc3ludGhlc2lzIGhpZ2ggICAgICAgICAgICAgICAgICovCi0gICAgaW50MTYgc2lnX2xvW10sICAgICAgICAgLyogKG8pIC8xNiA6IHN5bnRoZXNpcyBsb3cgICAgICAgICAgICAgICAgICAqLwotICAgIGludDE2IGxnICAgICAgICAgICAgICAgIC8qIChpKSAgICAgOiBzaXplIG9mIGZpbHRlcmluZyAgICAgICAgICAgICAgKi8KLSkKLXsKLSAgICBpbnQxNiBpLCBrLCBhMDsKLSAgICBpbnQzMiBMX3RtcDE7Ci0gICAgaW50MzIgTF90bXAyOwotICAgIGludDMyIExfdG1wMzsKLSAgICBpbnQzMiBMX3RtcDQ7Ci0KLSAgICBhMCA9ID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0lOREVYVFlQRSBpbmRleCwgT01YX1BUUiBwYXJhbXMpIHsKLSAgICBzd2l0Y2ggKGluZGV4KSB7Ci0gICAgICAgIGNhc2UgT01YX0luZGV4UGFyYW1BdWRpb1BvcnRGb3JtYXQ6Ci0gICAgICAgIHsKLSAgICAgICAgICAgIE9NWF9BVURJT19QQVJBTV9QT1JURk9STUFUVFlQRSAqZm9ybWF0UGFyYW1zID0KLSAgICAgICAgICAgICAgICAoT01YX0FVRElPX1BBUkFNX1BPUlRGT1JNQVRUWVBFICopcGFyYW1zOwotCi0gICAgICAgICAgICBpZiAoZm9ybWF0UGFyYW1zLT5uUG9ydEluZGV4ID4gMSkgewotICAgICAgICAgICAgICAgIHJldHVybiBPTVhfRXJyb3JVbmRlZmluZWQ7Ci0gICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgIGlmIChmb3JtYXRQYXJhbXMtPm5JbmRleCA+IDApIHsKLSAgICAgICAgICAgICAgICByZXR1cm4gT01YX0Vycm9yTm9Nb3JlOwotICAgICAgICAgICAgfQotCi0gICAgICAgICAgICBmb3JtYXRQYXJhbXMtPmVFbmNvZGluZyA9Ci0gICAgICAgICAgICAgICAgKGZvcm1hdFBhcmFtcy0+blBvcnRJbmRleCA9PSAwKQotICAgICAgICAgICAgICAgICAgICA/IE9NWF9BVURJT19Db2RpbmdQQ00gOiBPTVhfQVVESU9fQ29kaW5nQU1SOwotCi0gICAgICAgICAgICByZXR1cm4gT01YX0Vycm9yTm9uZTsKLSAgICAgICAgfQotCi0gICAgICAgIGNhc2UgT01YX0luZGV4UGFyYW1BdWRpb0FtcjoKLSAgICAgICAgewotICAgICAgICAgICAgT01YX0FVRElPX1BBUkFNX0FNUlRZUEUgKmFtclBhcmFtcyA9Ci0gICAgICAgICAgICAgICAgKE9NWF9BVURJT19QQVJBTV9BTVJUWVBFICopcGFyYW1zOwotCi0gICAgICAgICAgICBpZiAoYW1yUGFyYW1zLT5uUG9ydEluZGV4ICE9IDEpIHsKLSAgICAgICAgICAgICAgICByZXR1cm4gT01YX0Vycm9yVW5kZWZpbmVkOwotICAgICAgICAgICAgfQotCi0gICAgICAgICAgICBhbXJQYXJhbXMtPm5DaGFubmVscyA9IDE7Ci0gICAgICAgICAgICBhbXJQYXJhbXMtPm5CaXRSYXRlID0gbUJpdFJhdGU7Ci0KLSAgICAgICAgICAgIGFtclBhcmFtcy0+ZUFNUkJhbmRNb2RlID0KLSAgICAgICAgICAgICAgICAoT01YX0FVRElPX0FNUkJBTkRNT0RFVFlQRSkobU1vZGUgKyBPTVhfQVVESU9fQU1SQmFuZE1vZGVXQjApOwotCi0gICAgICAgICAgICBhbXJQYXJhbXMtPmVBTVJEVFhNb2RlID0gT01YX0FVRElPX0FNUkRUWE1vZGVPZmY7Ci0gICAgICAgICAgICBhbXJQYXJhbXMtPmVBTVJGcmFtZUZvcm1hdCA9IE9NWF9BVURJT19BTVJGcmFtZUZvcm1hdEZTRjsKLQotICAgICAgICAgICAgcmV0dXJuIE9NWF9FcnJvck5vbmU7Ci0gICAgICAgIH0KLQotICAgICAgICBjYXNlIE9NWF9JbmRleFBhcmFtQXVkaW9QY206Ci0gICAgICAgIHsKLSAgICAgICAgICAgIE9NWF9BVURJT19QQVJBTV9QQ01NT0RFVFlQRSAqcGNtUGFyYW1zID0KLSAgICAgICAgICAgICAgICAoT01YX0FVRElPX1BBUkFNX1BDTU1PREVUWVBFICopcGFyYW1zOwotCi0gICAgICAgICAgICBpZiAocGNtUGFyYW1zLT5uUG9ydEluZGV4ICE9IDApIHsKLSAgICAgICAgICAgICAgICByZXR1cm4gT01YX0Vycm9yVW5kZWZpbmVkOwotICAgICAgICAgICAgfQotCi0gICAgICAgICAgICBwY21QYXJhbXMtPmVOdW1EYXRhID0gT01YX051bWVyaWNhbERhdGFTaWduZWQ7Ci0gICAgICAgICAgICBwY21QYXJhbXMtPmVFbmRpYW4gPSBPTVhfRW5kaWFuQmlnOwotICAgICAgICAgICAgcGNtUGFyYW1zLT5iSW50ZXJsZWF2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ICJhdWRpb19lbmNvZGVyLmFtcndiIiwKLSAgICAgICAgICAgICAgICAgICAgICAgIE9NWF9NQVhfU1RSSU5HTkFNRV9TSVpFIC0gMSkpIHsKLSAgICAgICAgICAgICAgICByZXR1cm4gT01YX0Vycm9yVW5kZWZpbmVkOwotICAgICAgICAgICAgfQotCi0gICAgICAgICAgICByZXR1cm4gT01YX0Vycm9yTm9uZTsKLSAgICAgICAgfQotCi0gICAgICAgIGNhc2UgT01YX0luZGV4UGFyYW1BdWRpb1BvcnRGb3JtYXQ6Ci0gICAgICAgIHsKLSAgICAgICAgICAgIGNvbnN0IE9NWF9BVURJT19QQVJBTV9QT1JURk9STUFUVFlQRSAqZm9ybWF0UGFyYW1zID0KLSAgICAgICAgICAgICAgICAoY29uc3QgT01YX0FVRElPX1BBUkFNX1BPUlRGT1JNQVRUWVBFICopcGFyYW1zOwotCi0gICAgICAgICAgICBpZiAoZm9ybWF0UGFyYW1zLT5uUG9ydEluZGV4ID4gMSkgewotICAgICAgICAgICAgICAgIHJldHVybiBPTVhfRXJyb3JVbmRlZmluZWQ7Ci0gICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgIGlmIChmb3JtYXRQYXJhbXMtPm5JbmRleCA+IDApIHsKLSAgICAgICAgICAgICAgICByZXR1cm4gT01YX0Vycm9yTm9Nb3JlOwotICAgICAgICAgICAgfQotCi0gICAgICAgICAgICBpZiAoKGZvcm1hdFBhcmFtcy0+blBvcnRJbmRleCA9PSAwCi0gICAgICAgICAgICAgICAgICAgICAgICAmJiBmb3JtYXRQYXJhbXMtPmVFbmNvZGluZyAhPSBPTVhfQVVESU9fQ29kaW5nUENNKQotICAgICAgICAgICAgICAgIHx8IChmb3JtYXRQYXJhbXMtPm5Qb3J0SW5kZXggPT0gMQotICAgICAgICAgICAgICAgICAgICAgICAgJiYgZm9ybWF0UGFyYW1zLT5lRW5jb2RpbmcgIT0gT01YX0FVRElPX0NvZGluZ0FNUikpIHsKLSAgICAgICAgICAgICAgICByZXR1cm4gT01YX0Vycm9yVW5kZWZpbmVkOwotICAgICAgICAgICAgfQotCi0gICAgICAgICAgICByZXR1cm4gT01YX0Vycm9yTm9uZTsKLSAgICAgICAgfQotCi0gICAgICAgIGNhc2UgT01YX0luZGV4UGFyYW1BdWRpb0FtcjoKLSAgICAgICAgewotICAgICAgICAgICAgT01YX0FVRElPX1BBUkFNX0FNUlRZUEUgKmFtclBhcmFtcyA9Ci0gICAgICAgICAgICAgICAgKE9NWF9BVURJT19QQVJBTV9BTVJUWVBFICopcGFyYW1zOwotCi0gICAgICAgICAgICBpZiAoYW1yUGFyYW1zLT5uUG9ydEluZGV4ICE9IDEpIHsKLSAgICAgICAgICAgICAgICByZXR1cm4gT01YX0Vycm9yVW5kZWZpbmVkOwotICAgICAgICAgICAgfQotCi0gICAgICAgICAgICBpZiAoYW1yUGFyYW1zLT5uQ2hhbm5lbHMgIT0gMQotICAgICAgICAgICAgICAgICAgICB8fCBhbXJQYXJhbXMtPmVBTVJEVFhNb2RlICE9IE9NWF9BVURJT19BTVJEVFhNb2RlT2ZmCi0gICAgICAgICAgICAgICAgICAgIHx8IGFtclBhcmFtcy0+ZUFNUkZyYW1lRm9ybWF0Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgIT0gT01YX0FVRElPX0FNUkZyYW1lRm9ybWF0RlNGCi0gICAgICAgICAgICAgICAgICAgIHx8IGFtclBhcmFtcy0+ZUFNUkJhbmRNb2RlIDwgT01YX0FVRElPX0FNUkJhbmRNb2RlV0IwCi0gICAgICAgICAgICAgICAgICAgIHx8IGFtclBhcmFtcy0+ZUFNUkJhbmRNb2RlID4gT01YX0FVRElPX0FNUkJhbmRNb2RlV0I4KSB7Ci0gICAgICAgICAgICAgICAgcmV0dXJuIE9NWF9FcnJvclVuZGVmaW5lZDsKLSAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgbUJpdFJhdGUgPSBhbXJQYXJhbXMtPm5CaXRSYXRlOwotCi0gICAgICAgICAgICBtTW9kZSA9IChWT0FNUldCTU9ERSkoCi0gICAgICAgICAgICAgICAgICAgIGFtclBhcmFtcy0+ZUFNUkJhbmRNb2RlIC0gT01YX0FVRElPX0FNUkJhbmRNb2RlV0IwKTsKLQotICAgICAgICAgICAgYW1yUGFyYW1zLT5lQU1SRFRYTW9kZSA9IE9NWF9BVURJT19BTVJEVFhNb2RlT2ZmOwotICAgICAgICAgICAgYW1yUGFyYW1zLT5lQU1SRnJhbWVGb3JtYXQgPSBPTVhfQVVESU9fQU1SRnJhbWVGb3JtYXRGU0Y7Ci0KLSAgICAgICAgICAgIGlmIChWT19FUlJfTk9ORSAhPQotICAgICAgICAgICAgICAgICAgICBtQXBpSGFuZGxlLT5TZXRQYXJhbSgKLSAgICAgICAgICAgICAgICAgICAgICAgIG1FbmNvZGVySGFuZGxlLCBWT19QSURfQU1SV0JfTU9ERSwgICZtTW9kZSkpIHsKLSAgICAgICAgICAgICAgICBBTE9HRSgiRmFpbGVkIHRvIHNldCBBTVJXQiBlbmNvZGVyIG1vZGUgdG8gJWQiLCBtTW9kZSk7Ci0gICAgICAgICAgICAgICAgcmV0dXJuIE9NWF9FcnJvclVuZGVmaW5lZDsKLSAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgcmV0dXJuIE9NWF9FcnJvck5vbmU7Ci0gICAgICAgIH0KLQotICAgICAgICBjYXNlIE9NWF9JbmRleFBhcmFtQXVkaW9QY206Ci0gICAgICAgIHsKLSAgICAgICAgICAgIE9NWF9BVURJT19QQVJBTV9QQ01NT0RFVFlQRSAqcGNtUGFyYW1zID0KLSAgICAgICAgICAgICAgICAoT01YX0FVRElPX1BBUkFNX1BDTU1PREVUWVBFICopcGFyYW1zOwotCi0gICAgICAgICAgICBpZiAocGNtUGFyYW1zLT5uUG9ydEluZGV4ICE9IDApIHsKLSAgICAgICAgICAgICAgICByZXR1cm4gT01YX0Vycm9yVW5kZWZpbmVkOwotICAgICAgICAgICAgfQotCi0gICAgICAgICAgICBpZiAocGNtUGFyYW1zLT5u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aWxsIGRyYWluICJrTnVtU2FtcGxlc1BlckZyYW1lIiBzYW1wbGVzCi0gICAgICAgICAgICAvLyBpbnRvIHRoZSAibUlucHV0RnJhbWUiIGJ1ZmZlciBhbmQgdGhlbiBlbmNvZGUgdGhvc2UKLSAgICAgICAgICAgIC8vIGFzIGEgdW5pdCBpbnRvIGFuIG91dHB1dCBidWZmZXIuCi0KLSAgICAgICAgICAgIGlmIChtU2F3SW5wdXRFT1MgfHwgaW5RdWV1ZS5lbXB0eSgpKSB7Ci0gICAgICAgICAgICAgICAgcmV0dXJuOwotICAgICAgICAgICAgfQotCi0gICAgICAgICAgICBCdWZmZXJJbmZvICppbkluZm8gPSAqaW5RdWV1ZS5iZWdpbigpOwotICAgICAgICAgICAgT01YX0JVRkZFUkhFQURFUlRZUEUgKmluSGVhZGVyID0gaW5JbmZvLT5tSGVhZGVyOwotCi0gICAgICAgICAgICBjb25zdCB2b2lkICppbkRhdGEgPSBpbkhlYWRlci0+cEJ1ZmZlciArIGluSGVhZGVyLT5uT2Zmc2V0OwotCi0gICAgICAgICAgICBzaXplX3QgY29weSA9IG51bUJ5dGVzUGVySW5wdXRGcmFtZSAtIG1JbnB1dFNpemU7Ci0gICAgICAgICAgICBpZiAoY29weSA+IGluSGVhZGVyLT5uRmlsbGVkTGVuKSB7Ci0gICAgICAgICAgICAgICAgY29weSA9IGluSGVhZGVyLT5uRmlsbGVkTGVuOwotICAgICAgICAgICAgfQotCi0gICAgICAgICAgICBpZiAobUlucHV0U2l6ZSA9PSAwKSB7Ci0gICAgICAgICAgICAgICAgbUlucHV0VGltZVVzID0gaW5IZWFkZXItPm5UaW1lU3RhbXA7Ci0gICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgIG1lbWNweSgodWludDhfdCAqKW1JbnB1dEZyYW1lICsgbUlucHV0U2l6ZSwgaW5EYXRhLCBjb3B5KTsKLSAgICAgICAgICAgIG1JbnB1dFNpemUgKz0gY29weTsKLQotICAgICAgICAgICAgaW5IZWFkZXItPm5PZmZzZXQgKz0gY29weTsKLSAgICAgICAgICAgIGluSGVhZGVyLT5uRmlsbGVkTGVuIC09IGNvcHk7Ci0KLSAgICAgICAgICAgIC8vICJUaW1lIiBvbiB0aGUgaW5wdXQgYnVmZmVyIGhhcyBpbiBlZmZlY3QgYWR2YW5jZWQgYnkgdGhlCi0gICAgICAgICAgICAvLyBudW1iZXIgb2YgYXVkaW8gZnJhbWVzIHdlIGp1c3QgYWR2YW5jZWQgbk9mZnNldCBieS4KLSAgICAgICAgICAgIGluSGVhZGVyLT5uVGltZVN0YW1wICs9Ci0gICAgICAgICAgICAgICAgKGNvcHkgKiAxMDAwMDAwbGwgLyBrU2FtcGxlUmF0ZSkgLyBzaXplb2YoaW50MTZfdCk7Ci0KLSAgICAgICAgICAgIGlmIChpbkhlYWRlci0+bkZpbGxlZExlbiA9PSAwKSB7Ci0gICAgICAgICAgICAgICAgaWYgKGluSGVhZGVyLT5uRmxhZ3MgJiBPTVhfQlVGRkVSRkxBR19FT1MpIHsKLSAgICAgICAgICAgICAgICAgICAgQUxPR1YoInNhdyBpbnB1dCBFT1MiKTsKLSAgICAgICAgICAgICAgICAgICAgbVNhd0lucHV0RU9TID0gdHJ1ZTsKLQotICAgICAgICAgICAgICAgICAgICAvLyBQYWQgYW55IHJlbWFpbmluZyBkYXRhIHdpdGggemVyb2VzLgotICAgICAgICAgICAgICAgICAgICBtZW1zZXQoKHVpbnQ4X3QgKiltSW5wdXRGcmFtZSArIG1JbnB1dFNpemUsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAwLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgbnVtQnl0ZXNQZXJJbnB1dEZyYW1lIC0gbUlucHV0U2l6ZSk7Ci0KLSAgICAgICAgICAgICAgICAgICAgbUlucHV0U2l6ZSA9IG51bUJ5dGVzUGVySW5wdXRGcmFtZTsKLSAgICAgICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgICAgICBpblF1ZXVlLmVyYXNlKGluUXVldWU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gICAgICAgICAgTFBDIHByb3RvdHlwZXMgICAgICAgICAgICAgICAgICAgICAgICAgICAqCi0gKi0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tKi8KLQotV29yZDE2IG1lZGlhbjUoV29yZDE2IHhbXSk7Ci0KLXZvaWQgQXV0b2NvcnIoCi0JCVdvcmQxNiB4W10sICAgICAgICAgICAgICAgICAgICAgICAgICAgLyogKGkpICAgIDogSW5wdXQgc2lnbmFsICAgICAgICAgICAgICAgICAgICAgICovCi0JCVdvcmQxNiBtLCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLyogKGkpICAgIDogTFBDIG9yZGVyICAgICAgICAgICAgICAgICAgICAgICAgICovCi0JCVdvcmQxNiByX2hbXSwgICAgICAgICAgICAgICAgICAgICAgICAgLyogKG8pICAgIDogQXV0b2NvcnJlbGF0aW9ucyAgKG1zYikgICAgICAgICAgICovCi0JCVdvcmQxNiByX2xbXSAgICAgICAgICAgICAgICAgICAgICAgICAgLyogKG8pICAgIDogQXV0b2NvcnJlbGF0aW9ucyAgKGxzYikgICAgICAgICAgICovCi0JICAgICApOwotCi12b2lkIExhZ193aW5kb3coCi0JCVdvcmQxNiByX2hbXSwgICAgICAgICAgICAgICAgICAgICAgICAgLyogKGkvbykgICA6IEF1dG9jb3JyZWxhdGlvbnMgIChtc2IpICAgICAgICAgICovCi0JCVdvcmQxNiByX2xbXSAgICAgICAgICAgICAgICAgICAgICAgICAgLyogKGkvbykgICA6IEF1dG9jb3JyZWxhdGlvbnMgIChsc2IpICAgICAgICAgICovCi0JICAgICAgICk7Ci0KLXZvaWQgSW5pdF9MZXZpbnNvbigKLQkJV29yZDE2ICogbWVtICAgICAgICAgICAgICAgICAgICAgICAgICAvKiBvdXRwdXQgIDpzdGF0aWMgbWVtb3J5ICgxOCB3b3JkcykgKi8KLQkJKTsKLQotdm9pZCBMZXZpbnNvbigKLQkJV29yZDE2IFJoW10sICAgICAgICAgICAgICAgICAgICAgICAgICAvKiAoaSkgICAgIDogUmhbTSsxXSBWZWN0b3Igb2YgYXV0b2NvcnJlbGF0aW9ucyAobXNiKSAqLwotCQlXb3JkMTYgUmxbXSwgICAgICAgICAgICAgICAgICAgICAgICAgIC8qIChpKSAgICAgOiBSbFtNKzFdIFZlY3RvciBvZiBhdXRvY29ycmVsYXRpb25zIChsc2IpICovCi0JCVdvcmQxNiBBW10sICAgICAgICAgICAgICAgICAgICAgICAgICAgLyogKG8pIFExMiA6IEFbTV0gICAgTFBDIGNvZWZmaWNpZW50cyAgKG0gPSAxNikgICAgICAgKi8KLQkJV29yZDE2IHJjW10sICAgICAgICAgICAgICAgICAgICAgICAgICAvKiAobykgUTE1IDogcmNbTV0gICBSZWZsZWN0aW9uIGNvZWZmaWNpZW50cy4gICAgICAgICAqLwotCQlXb3JkMTYgKiBtZW0gICAgICAgICAgICAgICAgICAgICAgICAgIC8qIChpL28pICAgOnN0YXRpYyBtZW1vcnkgKDE4IHdvcmRzKSAgICAgICAgICAgICAgICAgICovCi0JICAgICApOwotCi12b2lkIEF6X2lzcCgKLQkJV29yZDE2IGFbXSwgICAgICAgICAgICAgICAgICAgICAgICAgICAvKiAoaSkgUTEyIDogcHJlZGljdG9yIGNvZWZmaWNpZW50cyAgICAgICAgICAgICAgICAgKi8KLQkJV29yZDE2IGlzcFtdLCAgICAgICAgICAgICAgICAgICAgICAgICAvKiAobykgUTE1IDogSW1taXR0YW5jZSBzcGVjdHJhbCBwYWlycyAgICAgICAgICAgICAgKi8KLQkJV29yZDE2IG9sZF9pc3BbXSAgICAgICAgICAgICAgICAgICAgICAvKiAoaSkgICAgIDogb2xkIGlzcFtdIChpbiBjYXNlIG5vdCBmb3VuZCBNIHJvb3RzKSAgKi8KLQkgICApOwotCi12b2lkIElzcF9BeigKLQkJV29yZDE2IGlzcFtdLCAgICAgICAgICAgICAgICAgICAgICAgICAvKiAoaSkgUTE1IDogSW1taXR0YW5jZSBzcGVjdHJhbCBwYWlycyAgICAgICAgICAgICovCi0JCVdvcmQxNiBhW10sICAgICAgICAgICAgICAgICAgICAgICAgICAgLyogKG8pIFExMiA6IHByZWRpY3RvciBjb2VmZmljaWVudHMgKG9yZGVyID0gTSkgICAqLwotCQlXb3JkMTYgbSwKLQkJV29yZDE2IGFkYXB0aXZlX3NjYWxpbmcgICAgICAgICAgICAgICAvKiAoaSkgMCAgIDogYWRhcHRpdmUgc2NhbGluZyBkaXNhYmxlZCAqLwotCQkvKiAgICAgMSAgIDogYWRhcHRpdmUgc2NhbGluZyBlbmFibGVkICAqLwotCSAgICk7Ci0KLXZvaWQgSXNwX2lzZigKLQkJV29yZDE2IGlzcFtdLCAgICAgICAgICAgICAgICAgICAgICAgICAvKiAoaSkgUTE1IDogaXNwW21dIChyYW5nZTogLTE8PXZhbDwxKSAgICAgICAgICAgICAgICAqLwotCQlXb3JkMTYgaXNmW10sICAgICAgICAgICAgICAgICAgICAgICAgIC8qIChvKSBRMTUgOiBpc2ZbbV0gbm9ybWFsaXplZCAocmFuZ2U6IDAuMDw9dmFsPD0wLjUpICovCi0JCVdvcmQxNiBtICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLyogKGkpICAgICA6IExQQyBvcmRlciAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLQkgICAgKTsKLQotdm9pZCBJc2ZfaXNwKAotCQlXb3JkMTYgaXNmW10sICAgICAgICAgICAgICAgICAgICAgICAgIC8qIChpKSBRMTUgOiBpc2ZbbV0gbm9ybWFsaXplZCAocmFuZ2U6IDAuMDw9dmFsPD0wLjUpICovCi0JCVdvcmQxNiBpc3BbXSwgICAgICAgICAgICAgICAgICAgICAgICAgLyogKG8pIFExNSA6IGlzcFttXSAocmFuZ2U6IC0xPD12YWw8MSkgICAgICAgICAgICAgICAgKi8KLQkJV29yZDE2IG0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvKiAoaSkgICAgIDogTFBDIG9yZGVyICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotCSAgICApOwotCi12b2lkIEludF9pc3AoCi0JCVdvcmQxNiBpc3Bfb2xkW10sICAgICAgICAgICAgICAgICAgICAgLyogaW5wdXQgOiBpc3BzIGZyb20gcGFzdCBmcmFtZSAgICAgICAgICAgICAgKi8KLQkJV29yZDE2IGlzcF9uZXdbXSwgICAgICAgICAgICAgICAgICAgICAvKiBpbnB1dCA6IGlzcHMgZnJvbSBwcmVzZW50IGZyYW1lICAgICAgICAgICAqLwotCQlXb3JkMTYgZnJhY1tdLCAgICAgICAgICAgICAgICAgICAgICAgIC8qIGlucHV0IDogZnJhY3Rpb24gZm9yIDMgZmlyc3Qgc3ViZnIgKFExNSkgICovCi0JCVdvcmQxNiBBeltdICAgICAgICAgICAgICAgICAgICAgICAgICAgLyogb3V0cHV0OiBMUCBjb2VmZmljaWVudHMgaW4gNCBzdWJmcmFtZXMgICAgKi8KLQkgICAgKTsKLQotdm9pZCBXZWlnaHRfYSgKLQkJV29yZDE2IGFbXSwgICAgICAgICAgICAgICAgICAgICAgICAgICAvKiAoaSkgUTEyIDogYVttKzFdICBMUEMgY29lZmZpY2llbnRzICAgICAgICAgICAgICovCi0JCVdvcmQxNiBhcFtdLCAgICAgICAgICAgICAgICAgICAgICAgICAgLyogKG8pIFExMiA6IFNwZWN0cmFsIGV4cGFuZGVkIExQQyBjb2VmZmljaWVudHMgICAqLwotCQlXb3JkMTYgZ2FtbWEsICAgICAgICAgICAgICAgICAgICAgICAgIC8qIChpKSBRMTUgOiBTcGVjdHJhbCBleHBhbnNpb24gZmFjdG9yLiAgICAgICAgICAgKi8KLQkJV29yZDE2IG0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvKiAoaSkgICAgIDogTFBDIG9yZGVyLiAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0JICAgICApOwotCi0KLS8qLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0qCi0gKiAgICAgICAgICAgICAgICAgICAgICAgIGlzZiBxdWFudGl6ZXJzICAgICAgICAgICAgICAgICAgICAgICAgICAgKgotICotLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSovCi0KLXZvaWQgUXBpc2ZfMnNfNDZiKAotCQlXb3JkMTYgKiBpc2YxLCAgICAgICAgICAgICAgICAgICAgICAgIC8qIChpKSBRMTUgOiBJU0YgaW4gdGhlIGZyZXF1ZW5jeSBkb21haW4gKDAuLjAuNSkgKi8KLQkJV29yZDE2ICogaXNmX3EsICAgICAgICAgICAgICAgICAgICAgICAvKiAobykgUTE1IDogcXVhbnRpemVkIElTRiAgICAgICAgICAgICAgICgwLi4wLjUpICovCi0JCVdvcmQxNiAqIHBhc3RfaXNmcSwgICAgICAgICAgICAgICAgICAgLyogKGlvKVExNSA6IHBhc3QgSVNGIHF1YW50aXplciAgICAgICAgICAgICAgICAgICAqLwotCQlXb3JkMTYgKiBpbmRpY2UsICAgICAgICAgICAgICAgICAgICAgIC8qIChvKSAgICAgOiBxdWFudGl6YXRpb24gaW5kaWNlcyAgICAgICAgICAgICAgICAgKi8KLQkJV29yZDE2IG5iX3N1cnYgICAgICAgICAgICAgICAgICAgICAgICAvKiAoaSkgICAgIDogbnVtYmVyIG9mIHN1cnZpdm9yICgxLCAyLCAzIG9yIDQpICAgICovCi0JCSk7Ci0KLXZvaWQgUXBpc2ZfMnNfMzZiKAotCQlXb3JkMTYgKiBpc2YxLCAgICAgICAgICAgICAgICAgICAgICAgIC8qIChpKSBRMTUgOiBJU0YgaW4gdGhlIGZyZXF1ZW5jeSBkb21haW4gKDAuLjAuNSkgKi8KLQkJV29yZDE2ICogaXNmX3EsICAgICAgICAgICAgICAgICAgICAgICAvKiAobykgUTE1IDogcXVhbnRpemVkIElTRiAgICAgICAgICAgICAgICgwLi4wLjUpICovCi0JCVdvcmQxNiAqIHBhc3RfaXNmcSwgICAgICAgICAgICAgICAgICAgLyogKGlvKVExNSA6IHBhc3QgSVNGIHF1YW50aXplciAgICAgICAgICAgICAgICAgICAqLwotCQlXb3JkMTYgKiBpbmRpY2UsICAgICAgICAgICAgICAgICAgICAgIC8qIChvKSAgICAgOiBxdWFudGl6YXRpb24gaW5kaWNlcyAgICAgICAgICAgICAgICAgKi8KLQkJV29yZDE2IG5iX3N1cnYgICAgICAgICAgICAgICAgICAgICAgICAvKiAoaSkgICAgIDogbnVtYmVyIG9mIHN1cnZpdm9yICgxLCAyLCAzIG9yIDQpICAgICovCi0JCSk7Ci0KLXZvaWQgRHBpc2ZfMnNfNDZiKAotCQlXb3JkMTYgKiBpbmRpY2UsICAgICAgICAgICAgICAgICAgICAgIC8qIGlucHV0OiAgcXVhbnRpemF0aW9uIGluZGljZXMgICAgICAgICAgICAgICAgICAgICAgICovCi0JCVdvcmQxNiAqIGlzZl9xLCAgICAgICAgICAgICAgICAgICAgICAgLyogb3V0cHV0OiBxdWFudGl6ZWQgSVNGIGluIGZyZXF1ZW5jeSBkb21haW4gKDAuLjAuNSkgKi8KLQkJV29yZDE2ICogcGFzdF9pc2ZxLCAgICAgICAgICAgICAgICAgICAvKiBpLzAgICA6IHBhc3QgSVNGIHF1YW50aXplciAgICAgICAgICAgICAgICAgICAgKi8KLQkJV29yZDE2ICogaXNmb2xkLCAgICAgICAgICAgICAgICAgICAgICAvKiBpbnB1dCA6IHBhc3QgcXVhbnRpemVkIElTRiAgICAgICAgICAgICAgICAgICAgKi8KLQkJV29yZDE2ICogaXNmX2J1ZiwgICAgICAgICAgICAgICAgICAgICAvKiBpbnB1dCA6IGlzZiBidWZmZXIgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0JCVdvcmQxNiBiZmksICAgICAgICAgICAgICAgICAgICAgICAgICAgLyogaW5wdXQgOiBCYWQgZnJhbWUgaW5kaWNhdG9yICAgICAgICAgICAgICAgICAgICovCi0JCVdvcmQxNiBlbmNfZGVjCi0JCSk7Ci0KLXZvaWQgRHBpc2ZfMnNfMzZiKAotCQlXb3JkMTYgKiBpbmRpY2UsICAgICAgICAgICAgICAgICAgICAgIC8qIGlucHV0OiAgcXVhbnRpemF0aW9uIGluZGljZXMgICAgICAgICAgICAgICAgICAgICAgICovCi0JCVdvcmQxNiAqIGlzZl9xLCAgICAgICAgICAgICAgICAgICAgICAgLyogb3V0cHV0OiBxdWFudGl6ZWQgSVNGIGluIGZyZXF1ZW5jeSBkb21haW4gKDAuLjAuNSkgKi8KLQkJV29yZDE2ICogcGFzdF9pc2ZxLCAgICAgICAgICAgICAgICAgICAvKiBpLzAgICA6IHBhc3QgSVNGIHF1YW50aXplciAgICAgICAgICAgICAgICAgICAgKi8KLQkJV29yZDE2ICogaXNmb2xkLCAgICAgICAgICAgICAgICAgICAgICAvKiBpbnB1dCA6IHBhc3QgcXVhbnRpemVkIElTRiAgICAgICAgICAgICAgICAgICAgKi8KLQkJV29yZDE2ICogaXNmX2J1ZiwgICAgICAgICAgICAgICAgICAgICAvKiBpbnB1dCA6IGlzZiBidWZmZXIgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0JCVdvcmQxNiBiZmksICAgICAgICAgICAgICAgICAgICAgICAgICAgLyogaW5wdXQgOiBCYWQgZnJhbWUgaW5kaWNhdG9yICAgICAgICAgICAgICAgICAgICovCi0JCVdvcmQxNiBlbmNfZGVjCi0JCSk7Ci0KLXZvaWQgUWlzZl9ucygKLQkJV29yZDE2ICogaXNmMSwgICAgICAgICAgICAgICAgICAgICAgICAvKiBpbnB1dCA6IElTRiBpbiB0aGUgZnJlcXVlbmN5IGRvbWFpbiAoMC4uMC41KSAqLwotCQlXb3JkMTYgKiBpc2ZfcSwgICAgICAgICAgICAgICAgICAgICAgIC8qIG91dHB1dDogcXVhbnRpemVkIElTRiAgICAgICAgICAgICAgICAgICAgICAgICovCi0JCVdvcmQxNiAqIGluZGljZSAgICAgICAgICAgICAgICAgICAgICAgLyogb3V0cHV0OiBxdWFudGl6YXRpb24gaW5kaWNlcyAgICAgICAgICAgICAgICAgKi8KLQkgICAgKTsKLQotdm9pZCBEaXNmX25zKAotCQlXb3JkMTYgKiBpbmRpY2UsICAgICAgICAgICAgICAgICAgICAgIC8qIGlucHV0OiAgcXVhbnRpemF0aW9uIGluZGljZXMgICAgICAgICAgICAgICAgICAqLwotCQlXb3JkMTYgKiBpc2ZfcSAgICAgICAgICAgICAgICAgICAgICAgIC8qIGlucHV0IDogSVNGIGluIHRoZSBmcmVxdWVuY3kgZG9tYWluICgwLi4wLjUpICAqLwotCSAgICApOwotCi1Xb3JkMTYgU3ViX1ZRKCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLyogb3V0cHV0OiByZXR1cm4gcXVhbnRpemF0aW9uIGluZGV4ICAgICAqLwotCQlXb3JkMTYgKiB4LCAgICAgICAgICAgICAgICAgICAgICAgICAgIC8qIGlucHV0IDogSVNGIHJlc2lkdWFsIHZlY3RvciAgICAgICAgICAgKi8KLQkJV29yZDE2ICogZGljbywgICAgICAgICAgICAgICAgICAgICAgICAvKiBpbnB1dCA6IHF1YW50aXphdGlvbiBjb2RlYm9vayAgICAgICAgICovCi0JCVdvcmQxNiBkaW0sICAgICAgICAgICAgICAgICAgICAgICAgICAgLyogaW5wdXQgOiBkaW1lbnRpb24gb2YgdmVjdG9yICAgICAgICAgICAqLwotCQlXb3JkMTYgZGljb19zaXplLCAgICAgICAgICAgICAgICAgICAgIC8qIGlucHV0IDogc2l6ZSBvZiBxdWFudGl6YXRpb24gY29kZWJvb2sgKi8KLQkJV29yZDMyICogZGlzdGFuY2UgICAgICAgICAgICAgICAgICAgICAvKiBvdXRwdXQ6IGVycm9yIG9mIHF1YW50aXphdGlvbiAgICAgICAgICovCi0JICAgICApOwotCi12b2lkIFJlb3JkZXJfaXNmKAotCQlXb3JkMTYgKiBpc2YsICAgICAgICAgICAgICAgICAgICAgICAgIC8qIChpL28pIFExNTogSVNGIGluIHRoZSBmcmVxdWVuY3kgZG9tYWluICgwLi4wLjUpICovCi0JCVdvcmQxNiBtaW5fZGlzdCwgICAgICAgICAgICAgICAgICAgICAgLyogKGkpIFExNSAgOiBtaW5pbXVtIGRpc3RhbmNlIHRvIGtlZXAgICAgICAgICAgICAgKi8KLQkJV29yZDE2IG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvKiAoaSkgICAgICA6IG51bWJlciBvZiBJU0YgICAgICAgICAgICAgICAgICAgICAgICAqLwotCQkpOwotCi0vKi0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tKgotICogICAgICAgICAgICAgICAgICAgICAgIGZpbHRlciBwcm90b3R5cGVzICAgICAgICAgICAgICAgICAgICAgICAgICoKLSAqLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0qLwotCi12b2lkIEluaXRfRGVjaW1fMTJrOCgKLQkJV29yZDE2IG1lbVtdICAgICAgICAgICAgICAgICAgICAgICAgICAvKiBvdXRwdXQ6IG1lbW9yeSAoMipOQl9DT0VGX0RPV04pIHNldCB0byB6ZXJvcyAqLwotCQkpOwotdm9pZCBEZWNpbV8xMms4KAotCQlXb3JkMTYgc2lnMTZrW10sICAgICAgICAgICAgICAgICAgICAgIC8qIGlucHV0OiAgc2lnbmFsIHRvIGRvd25zYW1wbGluZyAgKi8KLQkJV29yZDE2IGxnLCAgICAgICAgICAgICAgICAgICAgICAgICAgICAvKiBpbnB1dDogIGxlbmd0aCBvZiBpbnB1dCAgICAgICAgICovCi0JCVdvcmQxNiBzaWcxMms4W10sICAgICAgICAgICAgICAgICAgICAgLyogb3V0cHV0OiBkZWNpbWF0ZWQgc2lnbmFsICAgICAgICAqLwotCQlXb3JkMTYgbWVtW10gICAgICAgICAgICAgICAgICAgICAgICAgIC8qIGluL291dDogbWVtb3J5ICgyKk5CX0NPRUZfRE9XTikgKi8KLQkgICAgICAgKTsKLQotdm9pZCBJbml0X0hQNTBfMTJrOChXb3JkMTYgbWVtW10pOwotdm9pZCBIUDUwXzEyazgoCi0JCVdvcmQxNiBzaWduYWxbXSwgICAgICAgICAgICAgICAgICAgICAgLyogaW5wdXQvb3V0cHV0IHNpZ25hbCAqLwotCQlXb3JkMTYgbGcsICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8qIGxlbmdodCBvZiBzaWduYWwgICAgKi8KLQkJV29yZDE2IG1lbVtdICAgICAgICAgICAgICAgICAgICAgICAgICAvKiBmaWx0ZXIgbWVtb3J5IFs2XSAgICovCi0JICAgICAgKTsKLXZvaWQgSW5pdF9IUDQwMF8xMms4KFdvcmQxNiBtZW1bXSk7Ci12b2lkIEhQNDAwXzEyazgoCi0JCVdvcmQxNiBzaWduYWxbXSwgICAgICAgICAgICAgICAgICAgICAgLyogaW5wdXQvb3V0cHV0IHNpZ25hbCAqLwotCQlXb3JkMTYgbGcsICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8qIGxlbmdodCBvZiBzaWduYWwgICAgKi8KLQkJV29yZDE2IG1lbVtdICAgICAgICAgICAgICAgICAgICAgICAgICAvKiBmaWx0ZXIgbWVtb3J5IFs2XSAgICovCi0JICAgICAgICk7Ci0KLXZvaWQgSW5pdF9GaWx0XzZrXzdrKFdvcmQxNiBtZW1bXSk7Ci12b2lkIEZpbHRfNmtfN2soCi0JCVdvcmQxNiBzaWduYWxbXSwgICAgICAgICAgICAgICAgICAgICAgLyogaW5wdXQ6ICBzaWduYWwgICAgICAgICAgICAgICAgICAqLwotCQlXb3JkMTYgbGcsICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8qIGlucHV0OiAgbGVuZ3RoIG9mIGlucHV0ICAgICAgICAgKi8KLQkJV29yZDE2IG1lbVtdICAgICAgICAgICAgICAgICAgICAgICAgICAvKiBpbi9vdXQ6IG1lbW9yeSAoc2l6ZT0zMCkgICAgICAgICovCi0JICAgICAgICk7Ci12b2lkIEZpbHRfNmtfN2tfYXNtKAotCQlXb3JkMTYgc2lnbmFsW10sICAgICAgICAgICAgICAgICAgICAgIC8qIGlucHV0OiAgc2lnbmFsICAgICAgICAgICAgICAgICAgKi8KLQkJV29yZDE2IGxnLCAgICAgICAgICAgICAgICAgICAgICAgICAgICAvKiBpbnB1dDogIGxlbmd0aCBvZiBpbnB1dCAgICAgICAgICovCi0JCVdvcmQxNiBtZW1bXSAgICAgICAgICAgICAgICAgICAgICAgICAgLyogaW4vb3V0OiBtZW1vcnkgKHNpemU9MzApICAgICAgICAqLwotCSAgICAgICApOwotCi12b2lkIExQX0RlY2ltMigKLQkJV29yZDE2IHhbXSwgICAgICAgICAgICAgICAgICAgICAgICAgICAvKiBpbi9vdXQ6IHNpZ25hbCB0byBwcm9jZXNzICAgICAgICAgKi8KLQkJV29yZDE2IGwsICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvKiBpbnB1dCA6IHNpemUgb2YgZmlsdGVyaW5nICAgICAgICAgKi8KLQkJV29yZDE2IG1lbVtdICAgICAgICAgICAgICAgICAgICAgICAgICAvKiBpbi9vdXQ6IG1lbW9yeSAoc2l6ZT0zKSAgICAgICAgICAgKi8KLQkgICAgICApOwotCi12b2lkIFByZWVtcGgoCi0JCVdvcmQxNiB4W10sICAgICAgICAgICAgICAgICAgICAgICAgICAgLyogKGkvbykgICA6IGlucHV0IHNpZ25hbCBvdmVyd3JpdHRlbiBieSB0aGUgb3V0cHV0ICovCi0JCVdvcmQxNiBtdSwgICAgICAgICAgICAgICAgICAgICAgICAgICAgLyogKGkpIFExNSA6IHByZWVtcGhhc2lzIGNvZWZmaWNpZW50ICAgICAgICAgICAgICAgICovCi0JCVdvcmQxNiBsZywgICAgICAgICAgICAgICAgICAgICAgICAgICAgLyogKGkpICAgICA6IGxlbmdodCBvZiBmaWx0ZXJpbmcgICAgICAgICAgICAgICAgICAgICovCi0JCVdvcmQxNiAqIG1lbSAgICAgICAgICAgICAgICAgICAgICAgICAgLyogKGkvbykgICA6IG1lbW9yeSAoeFstMV0pICAgICAgICAgICAgICAgICAgICAgICAgICovCi0JICAgICk7Ci12b2lkIFByZWVtcGgyKAotCQlXb3JkMTYgeFtdLCAgICAgICAgICAgICAgICAgICAgICAgICAgIC8qIChpL28pICAgOiBpbnB1dCBzaWduYWwgb3ZlcndyaXR0ZW4gYnkgdGhlIG91dHB1dCAqLwotCQlXb3JkMTYgbXUsICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8qIChpKSBRMTUgOiBwcmVlbXBoYXNpcyBjb2VmZmljaWVudCAgICAgICAgICAgICAgICAqLwotCQlXb3JkMTYgbGcsICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8qIChpKSAgICAgOiBsZW5naHQgb2YgZmlsdGVyaW5nICAgICAgICAgICAgICAgICAgICAqLwotCQlXb3JkMTYgKiBtZW0gICAgICAgICAgICAgICAgICAgICAgICAgIC8qIChpL28pICAgOiBtZW1vcnkgKHhbLTFdKSAgICAgICAgICAgICAgICAgICAgICAgICAqLwotCSAgICAgKTsKLXZvaWQgRGVlbXBoKAotCQlXb3JkMTYgeFtdLCAgICAgICAgICAgICAgICAgICAgICAgICAgIC8qIChpL28pICAgOiBpbnB1dCBzaWduYWwgb3ZlcndyaXR0ZW4gYnkgdGhlIG91dHB1dCAqLwotCQlXb3JkMTYgbXUsICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8qIChpKSBRMTUgOiBkZWVtcGhhc2lzIGZhY3RvciAgICAgICAgICAgICAgICAgICAgICAqLwotCQlXb3JkMTYgTCwgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8qIChpKSAgICAgOiB2ZWN0b3Igc2l6ZSAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotCQlXb3JkMTYgKiBtZW0gICAgICAgICAgICAgICAgICAgICAgICAgIC8qIChpL28pICAgOiBtZW1vcnkgKHlbLTFdKSAgICAgICAgICAgICAgICAgICAgICAgICAqLwotCSAgICk7Ci12b2lkIERlZW1waDIoCi0JCVdvcmQxNiB4W10sICAgICAgICAgICAgICAgICAgICAgICAgICAgLyogKGkvbykgICA6IGlucHV0IHNpZ25hbCBvdmVyd3JpdHRlbiBieSB0aGUgb3V0cHV0ICovCi0JCVdvcmQxNiBtdSwgICAgICAgICAgICAgICAgICAgICAgICAgICAgLyogKGkpIFExNSA6IGRlZW1waGFzaXMgZmFjdG9yICAgICAgICAgICAgICAgICAgICAgICovCi0JCVdvcmQxNiBMLCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLyogKGkpICAgICA6IHZlY3RvciBzaXplICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0JCVdvcmQxNiAqIG1lbSAgICAgICAgICAgICAgICAgICAgICAgICAgLyogKGkvbykgICA6IG1lbW9yeSAoeVstMV0pICAgICAgICAgICAgICAgICAgICAgICAgICovCi0JICAgICk7Ci12b2lkIERlZW1waF8zMigKLQkJV29yZDE2IHhfaGlbXSwgICAgICAgICAgICAgICAgICAgICAgICAvKiAoaSkgICAgIDogaW5wdXQgc2lnbmFsIChiaXQzMS4uMTYpICovCi0JCVdvcmQxNiB4X2xvW10sICAgICAgICAgICAgICAgICAgICAgICAgLyogKGkpICAgICA6IGlucHV0IHNpZ25hbCAoYml0MTUuLjQpICAqLwotCQlXb3JkMTYgeVtdLCAgICAgICAgICAgICAgICAgICAgICAgICAgIC8qIChvKSAgICAgOiBvdXRwdXQgc2lnbmFsICh4MTYpICAgICAgKi8KLQkJV29yZDE2IG11LCAgICAgICAgICAgICAgICAgICAgICAgICAgICAvKiAoaSkgUTE1IDogZGVlbXBoYXNpcyBmYWN0b3IgICAgICAgICovCi0JCVdvcmQxNiBMLCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLyogKGkpICAgICA6IHZlY3RvciBzaXplICAgICAgICAgICAgICAqLwotCQlXb3JkMTYgKiBtZW0gICAgICAgICAgICAgICAgICAgICAgICAgIC8qIChpL28pICAgOiBtZW1vcnkgKHlbLTFdKSAgICAgICAgICAgKi8KLQkgICAgICApOwotCi12b2lkIERlZW1waF8zMl9hc20oCi0JCVdvcmQxNiB4X2hpW10sICAgICAgICAgICAgICAgICAgICAgICAgLyogKGkpICAgICA6IGlucHV0IHNpZ25hbCAoYml0MzEuLjE2KSAqLwotCQlXb3JkMTYgeF9sb1tdLCAgICAgICAgICAgICAgICAgICAgICAgIC8qIChpKSAgICAgOiBpbnB1dCBzaWduYWwgKGJpdDE1Li40KSAgKi8KLQkJV29yZDE2IHlbXSwgICAgICAgICAgICAgICAgICAgICAgICAgICAvKiAobykgICAgIDogb3V0cHV0IHNpZ25hbCAoeDE2KSAgICAgICovCi0JCVdvcmQxNiAqIG1lbSAgICAgICAgICAgICAgICAgICAgICAgICAgLyogKGkvbykgICA6IG1lbW9yeSAoeVstMV0pICAgICAgICAgICAqLwotCSAgICAgICk7Ci0KLXZvaWQgQ29udm9sdmUoCi0JCVdvcmQxNiB4W10sICAgICAgICAgICAgICAgICAgICAgICAgICAgLyogKGkpICAgICA6IGlucHV0IHZlY3RvciAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0JCVdvcmQxNiBoW10sICAgICAgICAgICAgICAgICAgICAgICAgICAgLyogKGkpIFExNSAgICA6IGltcHVsc2UgcmVzcG9uc2UgICAgICAgICAgICAgICAgICAgICAgICovCi0JCVdvcmQxNiB5W10sICAgICAgICAgICAgICAgICAgICAgICAgICAgLyogKG8pIDEyIGJpdHM6IG91dHB1dCB2ZWN0b3IgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0JCVdvcmQxNiBMICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLyogKGkpICAgICA6IHZlY3RvciBzaXplICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0JICAgICApOwotCi12b2lkIENvbnZvbHZlX2FzbSgKLQkJV29yZDE2IHhbXSwgICAgICAgICAgICAgICAgICAgICAgICAgICAvKiAoaSkgICAgIDogaW5wdXQgdmVjdG9yICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLQkJV29yZDE2IGhbXSwgICAgICAgICAgICAgICAgICAgICAgICAgICAvKiAoaSkgUTE1ICAgIDogaW1wdWxzZSByZXNwb25zZSAgICAgICAgICAgICAgICAgICAgICAgKi8KLQkJV29yZDE2IHlbXSwgICAgICAgICAgICAgICAgICAgICAgICAgICAvKiAobykgMTIgYml0czogb3V0cHV0IHZlY3RvciAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLQkJV29yZDE2IEwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvKiAoaSkgICAgIDogdmVjdG9yIHNpemUgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLQkgICAgICk7Ci0KLXZvaWQgUmVzaWR1KAotCQlXb3JkMTYgYVtdLCAgICAgICAgICAgICAgICAgICAgICAgICAgIC8qIChpKSBRMTIgOiBwcmVkaWN0aW9uIGNvZWZmaWNpZW50cyAgICAgICAgICAgICAgICAgICAgICovCi0JCVdvcmQxNiB4W10sICAgICAgICAgICAgICAgICAgICAgICAgICAgLyogKGkpICAgICA6IHNwZWVjaCAodmFsdWVzIHhbLW0uLi0xXSBhcmUgbmVlZGVkICAgICAgICAgKi8KLQkJV29yZDE2IHlbXSwgICAgICAgICAgICAgICAgICAgICAgICAgICAvKiAobykgICAgIDogcmVzaWR1YWwgc2lnbmFsICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotCQlXb3JkMTYgbGcgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8qIChpKSAgICAgOiBzaXplIG9mIGZpbHRlcmluZyAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0JCSk7Ci0KLXZvaWQgUmVzaWR1X29wdCgKLQkJV29yZDE2IGFbXSwgICAgICAgICAgICAgICAgICAgICAgICAgICAvKiAoaSkgUTEyIDogcHJlZGljdGlvbiBjb2VmZmljaWVudHMgICAgICAgICAgICAgICAgICAgICAqLwotCQlXb3JkMTYgeFtdLCAgICAgICAgICAgICAgICAgICAgICAgICAgIC8qIChpKSAgICAgOiBzcGVlY2ggKHZhbHVlcyB4Wy1tLi4tMV0gYXJlIG5lZWRlZCAgICAgICAgICovCi0JCVdvcmQxNiB5W10sICAgICAgICAgICAgICAgICAgICAgICAgICAgLyogKG8pICAgICA6IHJlc2lkdWFsIHNpZ25hbCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLQkJV29yZDE2IGxnICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvKiAoaSkgICAgIDogc2l6ZSBvZiBmaWx0ZXJpbmcgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotCQkpOwotCi12b2lkIFN5bl9maWx0KAotCVdvcmQxNiBhW10sICAgICAgICAgICAgICAgICAgICAgICAgICAgLyogKGkpIFExMiA6IGFbbSsxXSBwcmVkaWN0aW9uIGNvZWZmaWNpZW50cyAgICAgICAgICAgKi8KLQlXb3JkMTYgeFtdLCAgICAgICAgICAgICAgICAgICAgICAgICAgIC8qIChpKSAgICAgOiBpbnB1dCBzaWduYWwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0JV29yZDE2IHlbXSwgICAgICAgICAgICAgICAgICAgICAgICAgICAvKiAobykgICAgIDogb3V0cHV0IHNpZ25hbCAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotCVdvcmQxNiBsZywgICAgICAgICAgICAgICAgICAgICAgICAgICAgLyogKGkpICAgICA6IHNpemUgb2YgZmlsdGVyaW5nICAgICAgICAgICAgICAgICAgICAgICAgKi8KLQlXb3JkMTYgbWVtW10sICAgICAgICAgICAgICAgICAgICAgICAgIC8qIChpL28pICAgOiBtZW1vcnkgYXNzb2NpYXRlZCB3aXRoIHRoaXMgZmlsdGVyaW5nLiAgICovCi0JV29yZDE2IHVwZGF0ZSAgICAgICAgICAgICAgICAgICAgICAgICAvKiAoaSkgICAgIDogMD1ubyB1cGRhdGUsIDE9dXBkYXRlIG9mIG1lbW9yeS4gICAgICAgICAqLwotCSk7Ci0KLXZvaWQgU3luX2ZpbHRfYXNtKAotCVdvcmQxNiBhW10sICAgICAgICAgICAgICAgICAgICAgICAgICAgLyogKGkpIFExMiA6IGFbbSsxXSBwcmVkaWN0aW9uIGNvZWZmaWNpZW50cyAgICAgICAgICAgKi8KLQlXb3JkMTYgeFtdLCAgICAgICAgICAgICAgICAgICAgICAgICAgIC8qIChpKSAgICAgOiBpbnB1dCBzaWduYWwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0JV29yZDE2IHlbXSwgICAgICAgICAgICAgICAgICAgICAgICAgICAvKiAobykgICAgIDogb3V0cHV0IHNpZ25hbCAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotCVdvcmQxNiBtZW1bXSAgICAgICAgICAgICAgICAgICAgICAgICAgLyogKGkvbykgICA6IG1lbW9yeSBhc3NvY2lhdGVkIHdpdGggdGhpcyBmaWx0ZXJpbmcuICAgKi8KLQkpOwotCi12b2lkIFN5bl9maWx0XzMyKAotCVdvcmQxNiBhW10sICAgICAgICAgICAgICAgICAgICAgICAgICAgLyogKGkpIFExMiA6IGFbbSsxXSBwcmVkaWN0aW9uIGNvZWZmaWNpZW50cyAqLwotCVdvcmQxNiBtLCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLyogKGkpICAgICA6IG9yZGVyIG9mIExQIGZpbHRlciAgICAgICAgICAgICAqLwotCVdvcmQxNiBleGNbXSwgICAgICAgICAgICAgICAgICAgICAgICAgLyogKGkpIFFuZXc6IGV4Y2l0YXRpb24gKGV4Y1tpXSA+PiBRbmV3KSAgICAqLwotCVdvcmQxNiBRbmV3LCAgICAgICAgICAgICAgICAgICAgICAgICAgLyogKGkpICAgICA6IGV4YyBzY2FsaW5nID0gMChtaW4pIHRvIDgobWF4KSAqLwotCVdvcmQxNiBzaWdfaGlbXSwgICAgICAgICAgICAgICAgICAgICAgLyogKG8pIC8xNiA6IHN5bnRoZXNpcyBoaWdoICAgICAgICAgICAgICAgICAqLwotCVdvcmQxNiBzaWdfbG9bXSwgICAgICAgICAgICAgICAgICAgICAgLyogKG8pIC8xNiA6IHN5bnRoZXNpcyBsb3cgICAgICAgICAgICAgICAgICAqLwotCVdvcmQxNiBsZyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLyogKGkpICAgICA6IHNpemUgb2YgZmlsdGVyaW5nICAgICAgICAgICAgICAqLwotCSk7Ci0KLXZvaWQgU3luX2ZpbHRfMzJfYXNtKAotCVdvcmQxNiBhW10sICAgICAgICAgICAgICAgICAgICAgICAgICAgLyogKGkpIFExMiA6IGFbbSsxXSBwcmVkaWN0aW9uIGNvZWZmaWNpZW50cyAqLwotCVdvcmQxNiBtLCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLyogKGkpICAgICA6IG9yZGVyIG9mIExQIGZpbHRlciAgICAgICAgICAgICAqLwotCVdvcmQxNiBleGNbXSwgICAgICAgICAgICAgICAgICAgICAgICAgLyogKGkpIFFuZXc6IGV4Y2l0YXRpb24gKGV4Y1tpXSA+PiBRbmV3KSAgICAqLwotCVdvcmQxNiBRbmV3LCAgICAgICAgICAgICAgICAgICAgICAgICAgLyogKGkpICAgICA6IGV4YyBzY2FsaW5nID0gMChtaW4pIHRvIDgobWF4KSAqLwotCVdvcmQxNiBzaWdfaGlbXSwgICAgICAgICAgICAgICAgICAgICAgLyogKG8pIC8xNiA6IHN5bnRoZXNpcyBoaWdoICAgICAgICAgICAgICAgICAqLwotCVdvcmQxNiBzaWdfbG9bXSwgICAgICAgICAgICAgICAgICAgICAgLyogKG8pIC8xNiA6IHN5bnRoZXNpcyBsb3cgICAgICAgICAgICAgICAgICAqLwotCVdvcmQxNiBsZyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLyogKGkpICAgICA6IHNpemUgb2YgZmlsdGVyaW5nICAgICAgICAgICAgICAqLwotCSk7Ci0vKi0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tKgotICogICAgICAgICAgICAgICAgICAgICAgIHBpdGNoIHByb3RvdHlwZXMgICAgICAgICAgICAgICAgICAgICAgICAgICoKLSAqLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0qLwotCi1Xb3JkMTYgUGl0Y2hfb2woICAgICAgICAgICAgICAgICAgICAgICAgICAgLyogb3V0cHV0OiBvcGVuIGxvb3AgcGl0Y2ggbGFnICAgICAgICAgICAgICAgICAgICAgICAgKi8KLSAgICAgV29yZDE2IHNpZ25hbFtdLCAgICAgICAgICAgICAgICAgICAgICAvKiBpbnB1dCA6IHNpZ25hbCB1c2VkIHRvIGNvbXB1dGUgdGhlIG9wZW4gbG9vcCBwaXRjaCAqLwotLyogc2lnbmFsWy1waXRfbWF4XSB0byBzaWduYWxbLTFdIHNob3VsZCBiZSBrbm93biAqLwotICAgICBXb3JkMTYgcGl0X21pbiwgICAgICAgICAgICAgICAgICAgICAgIC8qIGlucHV0IDogbWluaW11bSBwaXRjaCBsYWcgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0gICAgIFdvcmQxNiBwaXRfbWF4LCAgICAgICAgICAgICAgICAgICAgICAgLyogaW5wdXQgOiBtYXhpbXVtIHBpdGNoIGxhZyAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLSAgICAgV29yZDE2IExfZnJhbWUgICAgICAgICAgICAgICAgICAgICAgICAvKiBpbnB1dCA6IGxlbmd0aCBvZiBmcmFtZSB0byBjb21wdXRlIHBpdGNoICAgICAgICAgICAqLwotKTsKLQotV29yZDE2IFBpdGNoX21lZF9vbCggICAgICAgICAgICAgICAgICAgICAgIC8qIG91dHB1dDogb3BlbiBsb29wIHBpdGNoIGxhZyAgICAgICAgICAgICAgICAgICAgICAgICovCi0gICAgIFdvcmQxNiB3c3BbXSwgICAgICAgICAgICAgICAgICAgICAgICAgLyogaW5wdXQgOiBzaWduYWwgdXNlZCB0byBjb21wdXRlIHRoZSBvcGVuIGxvb3AgcGl0Y2ggKi8KLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvKiB3c3BbLXBpdF9tYXhdIHRvIHdzcFstMV0gc2hvdWxkIGJlIGtub3duICAgKi8KLSAgICAgQ29kZXJfU3RhdGUgKnN0LCAgICAgICAgICAgICAgICAgICAgICAvKiBpL28gOiBnbG9iYWwgY29kZWMgc3RydWN0dXJlICovCi0gICAgIFdvcmQxNiBMX2ZyYW1lICAgICAgICAgICAgICAgICAgICAgICAgLyogaW5wdXQgOiBsZW5ndGggb2YgZnJhbWUgdG8gY29tcHV0ZSBwaXRjaCAgICAgICAgICAgKi8KLSk7Ci0KLVdvcmQxNiBNZWRfb2xhZyggICAgICAgICAgICAgICAgICAgICAgICAgICAvKiBvdXRwdXQgOiBtZWRpYW4gb2YgIDUgcHJldmlvdXMgb3Blbi1sb29wIGxhZ3MgICAgICAgKi8KLSAgICAgV29yZDE2IHByZXZfb2xfbGFnLCAgICAgICAgICAgICAgICAgICAvKiBpbnB1dCAgOiBwcmV2aW91cyBvcGVuLWxvb3AgbGFnICAgICAgICAgICAgICAgICAgICAgKi8KLSAgICAgV29yZDE2IG9sZF9vbF9sYWdbNV0KLSk7Ci0KLXZvaWQgSW5pdF9IcF93c3AoV29yZDE2IG1lbVtdKTsKLXZvaWQgc2NhbGVfbWVtX0hwX3dzcChXb3JkMTYgbWVtW10sIFdvcmQxNiBleHApOwotdm9pZCBIcF93c3AoCi0gICAgIFdvcmQxNiB3c3BbXSwgICAgICAgICAgICAgICAgICAgICAgICAgLyogaSAgIDogd3NwW10gIHNpZ25hbCAgICAgICAqLwotICAgICBXb3JkMTYgaHBfd3NwW10sICAgICAgICAgICAgICAgICAgICAgIC8qIG8gICA6IGh5cGFzcyB3c3BbXSAgICAgICAgKi8KLSAgICAgV29yZDE2IGxnLCAgICAgICAgICAgICAgICAgICAgICAgICAgICAvKiBpICAgOiBsZW5naHQgb2Ygc2lnbmFsICAgICovCi0gICAgIFdvcmQxNiBtZW1bXSAgICAgICAgICAgICAgICAgICAgICAgICAgLyogaS9vIDogZmlsdGVyIG1lbW9yeSBbOV0gICAqLwotKTsKLQotV29yZDE2IFBpdGNoX2ZyNCggICAgICAgICAgICAgICAgICAgICAgICAgIC8qIChvKSAgICAgOiBwaXRjaCBwZXJpb2QuICAgICAgICAgICAgICAgICAgICAgICAgICovCi0gICAgIFdvcmQxNiBleGNbXSwgICAgICAgICAgICAgICAgICAgICAgICAgLyogKGkpICAgICA6IGV4Y2l0YXRpb24gYnVmZmVyICAgICAgICAgICAgICAgICAgICAgKi8KLSAgICAgV29yZDE2IHhuW10sICAgICAgICAgICAgICAgICAgICAgICAgICAvKiAoaSkgICAgIDogdGFyZ2V0IHZlY3RvciAgICAgICAgICAgICAgICAgICAgICAgICAqLwotICAgICBXb3JkMTYgaFtdLCAgICAgICAgICAgICAgICAgICAgICAgICAgIC8qIChpKSBRMTUgOiBpbXB1bHNlIHJlc3BvbnNlIG9mIHN5bnRoL3dndCBmaWx0ZXJzICovCi0gICAgIFdvcmQxNiB0MF9taW4sICAgICAgICAgICAgICAgICAgICAgICAgLyogKGkpICAgICA6IG1pbmltdW0gdmFsdWUgaW4gdGhlIHNlYXJjaGVkIHJhbmdlLiAgKi8KLSAgICAgV29yZDE2IHQwX21heCwgICAgICAgICAgICAgICAgICAgICAgICAvKiAoaSkgICAgIDogbWF4aW11bSB2YWx1ZSBpbiB0aGUgc2VhcmNoZWQgcmFuZ2UuICAqLwotICAgICBXb3JkMTYgKiBwaXRfZnJhYywgICAgICAgICAgICAgICAgICAgIC8qIChvKSAgICAgOiBjaG9zZW4gZnJhY3Rpb24gKDAsIDEsIDIgb3IgMykuICAgICAgICovCi0gICAgIFdvcmQxNiBpX3N1YmZyLCAgICAgICAgICAgICAgICAgICAgICAgLyogKGkpICAgICA6IGluZGljYXRvciBmb3IgZmlyc3Qgc3ViZnJhbWUuICAgICAgICAgKi8KLSAgICAgV29yZDE2IHQwX2ZyMiwgICAgICAgICAgICAgICAgICAgICAgICAvKiAoaSkgICAgIDogbWluaW11bSB2YWx1ZSBmb3IgcmVzb2x1dGlvbiAxLzIgICAgICAqLwotICAgICBXb3JkMTYgdDBfZnIxLCAgICAgICAgICAgICAgICAgICAgICAgIC8qIChpKSAgICAgOiBtaW5pbXVtIHZhbHVlIGZvciByZXNvbHV0aW9uIDEgICAgICAgICovCi0gICAgIFdvcmQxNiBMX3N1YmZyICAgICAgICAgICAgICAgICAgICAgICAgLyogKGkpICAgICA6IExlbmd0aCBvZiBzdWJmcmFtZSAgICAgICAgICAgICAgICAgICAgKi8KLSk7Ci12b2lkIFByZWRfbHQ0KAotICAgICBXb3JkMTYgZXhjW10sICAgICAgICAgICAgICAgICAgICAgICAgIC8qIGluL291dDogZXhjaXRhdGlvbiBidWZmZXIgKi8KLSAgICAgV29yZDE2IFQwLCAgICAgICAgICAgICAgICAgICAgICAgICAgICAvKiBpbnB1dCA6IGludGVnZXIgcGl0Y2ggbGFnICovCi0gICAgIFdvcmQxNiBmcmFjLCAgICAgICAgICAgICAgICAgICAgICAgICAgLyogaW5wdXQgOiBmcmFjdGlvbiBvZiBsYWcgICAqLwotICAgICBXb3JkMTYgTF9zdWJmciAgICAgICAgICAgICAgICAgICAgICAgIC8qIGlucHV0IDogc3ViZnJhbWUgc2l6ZSAgICAgKi8KLSk7Ci0KLXZvaWQgcHJlZF9sdDRfYXNtKAotICAgICBXb3JkMTYgZXhjW10sICAgICAgICAgICAgICAgICAgICAgICAgIC8qIGluL291dDogZXhjaXRhdGlvbiBidWZmZXIgKi8KLSAgICAgV29yZDE2IFQwLCAgICAgICAgICAgICAgICAgICAgICAgICAgICAvKiBpbnB1dCA6IGludGVnZXIgcGl0Y2ggbGFnICovCi0gICAgIFdvcmQxNiBmcmFjLCAgICAgICAgICAgICAgICAgICAgICAgICAgLyogaW5wdXQgOiBmcmFjdGlvbiBvZiBsYWcgICAqLwotICAgICBXb3JkMTYgTF9zdWJmciAgICAgICAgICAgICAgICAgICAgICAgIC8qIGlucHV0IDogc3ViZnJhbWUgc2l6ZSAgICAgKi8KLSk7Ci0KLS8qLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0qCi0gKiAgICAgICAgICAgICAgICAgICAgICAgZ2FpbiBwcm90b3R5cGVzICAgICAgICAgICAgICAgICAgICAgICAgICAgKgotICotLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSovCi0KLVdvcmQxNiBHX3BpdGNoKCAgICAgICAgICAgICAgICAgICAgICAgICAgICAvKiAobykgUTE0IDogR2FpbiBvZiBwaXRjaCBsYWcgc2F0dXJhdGVkIHRvIDEuMiAgICovCi0gICAgIFdvcmQxNiB4bltdLCAgICAgICAgICAgICAgICAgICAgICAgICAgLyogKGkpICAgICA6IFBpdGNoIHRhcmdldC4gICAgICAgICAgICAgICAgICAgICAgICAqLwotICAgICBXb3JkMTYgeTFbXSwgICAgICAgICAgICAgICAgICAgICAgICAgIC8qIChpKSAgICAgOiBmaWx0ZXJlZCBhZGFwdGl2ZSBjb2RlYm9vay4gICAgICAgICAgKi8KLSAgICAgV29yZDE2IGdfY29lZmZbXSwgICAgICAgICAgICAgICAgICAgICAvKiA6IENvcnJlbGF0aW9ucyBuZWVkIGZvciBnYWluIHF1YW50aXphdGlvbi4gKi8KLSAgICAgV29yZDE2IExfc3ViZnIgICAgICAgICAgICAgICAgICAgICAgICAvKiA6IExlbmd0aCBvZiBzdWJmcmFtZS4gICAgICAgICAgICAgICAgICAqLwotKTsKLXZvaWQgSW5pdF9RX2dhaW4yKAotICAgICBXb3JkMTYgKiBtZW0gICAgICAgICAgICAgICAgICAgICAgICAgIC8qIG91dHB1dCAgOnN0YXRpYyBtZW1vcnkgKDIgd29yZHMpICAgICAgKi8KLSk7Ci1Xb3JkMTYgUV9nYWluMiggICAgICAgICAgICAgICAgICAgICAgICAgICAgLyogUmV0dXJuIGluZGV4IG9mIHF1YW50aXphdGlvbi4gICAgICAgICovCi0gICAgIFdvcmQxNiB4bltdLCAgICAgICAgICAgICAgICAgICAgICAgICAgLyogKGkpIFFfeG46VGFyZ2V0IHZlY3Rvci4gICAgICAgICAgICAgICAqLwotICAgICBXb3JkMTYgeTFbXSwgICAgICAgICAgICAgICAgICAgICAgICAgIC8qIChpKSBRX3huOkFkYXB0aXZlIGNvZGVib29rLiAgICAgICAgICAgKi8KLSAgICAgV29yZDE2IFFfeG4sICAgICAgICAgICAgICAgICAgICAgICAgICAvKiAoaSkgICAgIDp4biBhbmQgeTEgZm9ybWF0ICAgICAgICAgICAgICovCi0gICAgIFdvcmQxNiB5MltdLCAgICAgICAgICAgICAgICAgICAgICAgICAgLyogKGkpIFE5ICA6RmlsdGVyZWQgaW5ub3ZhdGl2ZSB2ZWN0b3IuICAqLwotICAgICBXb3JkMTYgY29kZVtdLCAgICAgICAgICAgICAgICAgICAgICAgIC8qIChpKSBROSAgOklubm92YXRpdmUgdmVjdG9yLiAgICAgICAgICAgKi8KLSAgICAgV29yZDE2IGdfY29lZmZbXSwgICAgICAgICAgICAgICAgICAgICAvKiAoaSkgICAgIDpDb3JyZWxhdGlvbnMgPHhuIHkxPiA8eTEgeTE+ICovCi0vKiBDb21wdXRlIGluIEdfcGl0Y2goKS4gICAgICAgICovCi0gICAgIFdvcmQxNiBMX3N1YmZyLCAgICAgICAgICAgICAgICAgICAgICAgLyogKGkpICAgICA6U3ViZnJhbWUgbGVuZ2h0LiAgICAgICAgICAgICAqLwotICAgICBXb3JkMTYgbmJpdHMsICAgICAgICAgICAgICAgICAgICAgICAgIC8qIChpKSAgICAgOiBudW1iZXIgb2YgYml0cyAoNiBvciA3KSAgICAgKi8KLSAgICAgV29yZDE2ICogZ2Fpbl9waXQsICAgICAgICAgICAgICAgICAgICAvKiAoaS9vKVExNDpQaXRjaCBnYWluLiAgICAgICAgICAgICAgICAgICovCi0gICAgIFdvcmQzMiAqIGdhaW5fY29kLCAgICAgICAgICAgICAgICAgICAgLyogKG8pIFExNiA6Q29kZSBnYWluLiAgICAgICAgICAgICAgICAgICAqLwotICAgICBXb3JkMTYgZ3BfY2xpcCwgICAgICAgICAgICAgICAgICAgICAgIC8qIChpKSAgICAgOiBHcCBDbGlwcGluZyBmbGFnICAgICAgICAgICAgKi8KLSAgICAgV29yZDE2ICogbWVtICAgICAgICAgICAgICAgICAgICAgICAgICAvKiAoaS9vKSAgIDpzdGF0aWMgbWVtb3J5ICgyIHdvcmRzKSAgICAgICovCi0pOwotCi12b2lkIEluaXRfRF9nYWluMigKLSAgICAgV29yZDE2ICogbWVtICAgICAgICAgICAgICAgICAgICAgICAgICAvKiBvdXRwdXQgIDpzdGF0aWMgbWVtb3J5ICg0IHdvcmRzKSAgICAgICovCi0pOwotdm9pZCBEX2dhaW4yKAotICAgICBXb3JkMTYgaW5kZXgsICAgICAgICAgICAgICAgICAgICAgICAgIC8qIChpKSAgICAgOmluZGV4IG9mIHF1YW50aXphdGlvbi4gICAgICAgKi8KLSAgICAgV29yZDE2IG5iaXRzLCAgICAgICAgICAgICAgICAgICAgICAgICAvKiAoaSkgICAgIDogbnVtYmVyIG9mIGJpdHMgKDYgb3IgNykgICAgICovCi0gICAgIFdvcmQxNiBjb2RlW10sICAgICAgICAgICAgICAgICAgICAgICAgLyogKGkpIFE5ICA6SW5ub3ZhdGl2ZSB2ZWN0b3IuICAgICAgICAgICAqLwotICAgICBXb3JkMTYgTF9zdWJmciwgICAgICAgICAgICAgICAgICAgICAgIC8qIChpKSAgICAgOlN1YmZyYW1lIGxlbmdodC4gICAgICAgICAgICAgKi8KLSAgICAgV29yZDE2ICogZ2Fpbl9waXQsICAgICAgICAgICAgICAgICAgICAvKiAobykgUTE0IDpQaXRjaCBnYWluLiAgICAgICAgICAgICAgICAgICovCi0gICAgIFdvcmQzMiAqIGdhaW5fY29kLCAgICAgICAgICAgICAgICAgICAgLyogKG8pIFExNiA6Q29kZSBnYWluLiAgICAgICAgICAgICAgICAgICAqLwotICAgICBXb3JkMTYgYmZpLCAgICAgICAgICAgICAgICAgICAgICAgICAgIC8qIChpKSAgICAgOmJhZCBmcmFtZSBpbmRpY2F0b3IgICAgICAgICAgKi8KLSAgICAgV29yZDE2IHByZXZfYmZpLCAgICAgICAgICAgICAgICAgICAgICAvKiAoaSkgOiBQcmV2aW91cyBCRiBpbmRpY2F0b3IgICAgICAqLwotICAgICBXb3JkMTYgc3RhdGUsICAgICAgICAgICAgICAgICAgICAgICAgIC8qIChpKSA6IFN0YXRlIG9mIEJGSCAgICAgICAgICAgICAgICovCi0gICAgIFdvcmQxNiB1bnVzYWJsZV9mcmFtZSwgICAgICAgICAgICAgICAgLyogKGkpIDogVUYgaW5kaWNhdG9yICAgICAgICAgICAgKi8KLSAgICAgV29yZDE2IHZhZF9oaXN0LCAgICAgICAgICAgICAgICAgICAgICAvKiAoaSkgICAgICAgICA6bnVtYmVyIG9mIG5vbi1zcGVlY2ggZnJhbWVzICAqLwotICAgICBXb3JkMTYgKiBtZW0gICAgICAgICAgICAgICAgICAgICAgICAgIC8qIChpL28pICAgOnN0YXRpYyBtZW1vcnkgKDQgd29yZHMpICAgICAgKi8KLSk7Ci0KLS8qLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0qCi0gKiAgICAgICAgICAgICAgICAgICAgICAgYWNlbHAgcHJvdG90eXBlcyAgICAgICAgICAgICAgICAgICAgICAgICAgKgotICotLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSovCi0KLXZvaWQgY29yX2hfeCgKLSAgICAgV29yZDE2IGhbXSwgICAgICAgICAgICAgICAgICAgICAgICAgICAvKiAoaSkgUTEyIDogaW1wdWxzZSByZXNwb25zZSBvZiB3ZWlnaHRlZCBzeW50aGVzaXMgZmlsdGVyICovCi0gICAgIFdvcmQxNiB4W10sICAgICAgICAgICAgICAgICAgICAgICAgICAgLyogKGkpIFEwICA6IHRhcmdldCB2ZWN0b3IgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotICAgICBXb3JkMTYgZG5bXSAgICAgICAgICAgICAgICAgICAgICAgICAgIC8qIChvKSA8MTJiaXQgOiBjb3JyZWxhdGlvbiBiZXR3ZWVuIHRhcmdldCBhbmQgaFtdICAgICAgICAgKi8KLSk7Ci12b2lkIEFDRUxQXzJ0NjRfZngoCi0gICAgIFdvcmQxNiBkbltdLCAgICAgICAgICAgICAgICAgICAgICAgICAgLyogKGkpIDwxMmIgOiBjb3JyZWxhdGlvbiBiZXR3ZWVuIHRhcmdldCB4W10gYW5kIEhbXSAgICAgICovCi0gICAgIFdvcmQxNiBjbltdLCAgICAgICAgICAgICAgICAgICAgICAgICAgLyogKGkpIDwxMmIgOiByZXNpZHVhbCBhZnRlciBsb25nIHRlcm0gcHJlZGljdGlvbiAgICAgICAgICovCi0gICAgIFdvcmQxNiBIW10sICAgICAgICAgICAgICAgICAgICAgICAgICAgLyogKGkpIFExMjogaW1wdWxzZSByZXNwb25zZSBvZiB3ZWlnaHRlZCBzeW50aGVzaXMgZmlsdGVyICovCi0gICAgIFdvcmQxNiBjb2RlW10sICAgICAgICAgICAgICAgICAgICAgICAgLyogKG8pIFE5IDogYWxnZWJyYWljIChmaXhlZCkgY29kZWJvb2sgZXhjaXRhdGlvbiAgICAgICAgICovCi0gICAgIFdvcmQxNiB5W10sICAgICAgICAgICAgICAgICAgICAgICAgICAgLyogKG8pIFE5IDogZmlsdGVyZWQgZml4ZWQgY29kZWJvb2sgZXhjaXRhdGlvbiAgICAgICAgICAgICovCi0gICAgIFdvcmQxNiAqIGluZGV4ICAgICAgICAgICAgICAgICAgICAgICAgLyogKG8pIDogaW5kZXggKDEyKTogNSsxKzUrMSA9IDExIGJpdHMuICAgICAgICAgICAgICAgICAgICAgKi8KLSk7Ci0KLXZvaWQgQUNFTFBfNHQ2NF9meCgKLSAgICAgV29yZDE2IGRuW10sICAgICAgICAgICAgICAgICAgICAgICAgICAvKiAoaSkgPDEyYiA6IGNvcnJlbGF0aW9uIGJldHdlZW4gdGFyZ2V0IHhbXSBhbmQgSFtdICAgICAgKi8KLSAgICAgV29yZDE2IGNuW10sICAgICAgICAgICAgICAgICAgICAgICAgICAvKiAoaSkgPDEyYiA6IHJlc2lkdWFsIGFmdGVyIGxvbmcgdGVybSBwcmVkaWN0aW9uICAgICAgICAgKi8KLSAgICAgV29yZDE2IEhbXSwgICAgICAgICAgICAgICAgICAgICAgICAgICAvKiAoaSkgUTEyOiBpbXB1bHNlIHJlc3BvbnNlIG9mIHdlaWdodGVkIHN5bnRoZXNpcyBmaWx0ZXIgKi8KLSAgICAgV29yZDE2IGNvZGVbXSwgICAgICAgICAgICAgICAgICAgICAgICAvKiAobykgUTkgOiBhbGdlYnJhaWMgKGZpeGVkKSBjb2RlYm9vayBleGNpdGF0aW9uICAgICAgICAgKi8KLSAgICAgV29yZDE2IHlbXSwgICAgICAgICAgICAgICAgICAgICAgICAgICAvKiAobykgUTkgOiBmaWx0ZXJlZCBmaXhlZCBjb2RlYm9vayBleGNpdGF0aW9uICAgICAgICAgICAgKi8KLSAgICAgV29yZDE2IG5iYml0cywgICAgICAgICAgICAgICAgICAgICAgICAvKiAoaSkgOiAyMCwgMzYsIDQ0LCA1MiwgNjQsIDcyIG9yIDg4IGJpdHMgICAgICAgICAgICAgICAgKi8KLSAgICAgV29yZDE2IHNlcl9zaXplLCAgICAgICAgICAgICAgICAgICAgICAvKiAoaSkgOiBiaXQgcmF0ZSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLSAgICAgV29yZDE2IF9pbmRleFtdICAgICAgICAgICAgICAgICAgICAgICAvKiAobykgOiBpbmRleCAoMjApOiA1KzUrNSs1ID0gMjAgYml0cy4gICAgICAgICAgICAgICAgICAgKi8KLQkJCQkJICAgLyogKG8pIDogaW5kZXggKDM2KTogOSs5KzkrOSA9IDM2IGJpdHMuICAgICAgICAgICAgICAgICAgICovCi0JCQkJCSAgIC8qIChvKSA6IGluZGV4ICg0NCk6IDEzKzkrMTMrOSA9IDQ0IGJpdHMuICAgICAgICAgICAgICAgICAqLwotCQkJCQkgICAvKiAobykgOiBpbmRleCAoNTIpOiAxMysxMysxMysxMyA9IDUyIGJpdHMuICAgICAgICAgICAgICAgKi8KLQkJCQkJICAgLyogKG8pIDogaW5kZXggKDY0KTogMisyKzIrMisxNCsxNCsxNCsxNCA9IDY0IGJpdHMuICAgICAgICovCi0JCQkJCSAgIC8qIChvKSA6IGluZGV4ICg3Mik6IDEwKzIrMTArMisxMCsxNCsxMCsxNCA9IDcyIGJpdHMuICAgICAqLwotCQkJCQkgICAvKiAobykgOiBpbmRleCAoODgpOiAxMSsxMSsxMSsxMSsxMSsxMSsxMSsxMSA9IDg4IGJpdHMuICAgKi8KLSk7Ci0KLXZvaWQgUGl0X3NocnAoCi0gICAgIFdvcmQxNiAqIHgsICAgICAgICAgICAgICAgICAgICAgICAgICAgLyogaW4vb3V0OiBpbXB1bHNlIHJlc3BvbnNlIChvciBhbGdlYnJhaWMgY29kZSkgKi8KLSAgICAgV29yZDE2IHBpdF9sYWcsICAgICAgICAgICAgICAgICAgICAgICAvKiBpbnB1dCA6IHBpdGNoIGxhZyAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotICAgICBXb3JkMTYgc2hhcnAsICAgICAgICAgICAgICAgICAgICAgICAgIC8qIGlucHV0IDogcGl0Y2ggc2hhcnBlbmluZyBmYWN0b3IgKFExNSkgICAgICAgICovCi0gICAgIFdvcmQxNiBMX3N1YmZyICAgICAgICAgICAgICAgICAgICAgICAgLyogaW5wdXQgOiBzdWJmcmFtZSBzaXplICAgICAgICAgICAgICAgICAgICAgICAgKi8KLSk7Ci0KLQotLyotLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSoKLSAqICAgICAgICAgICAgICAgICAgICAgICAgb3RoZXJzIHByb3RvdHlwZXMgICAgICAgICAgICAgICAgICAgICAgICAqCi0gKi0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tKi8KLQotdm9pZCBDb3B5KAotICAgICBXb3JkMTYgeFtdLCAgICAgICAgICAgICAgICAgICAgICAgICAgIC8qIChpKSAgIDogaW5wdXQgdmVjdG9yICAgKi8KLSAgICAgV29yZDE2IHlbXSwgICAgICAgICAgICAgICAgICAgICAgICAgICAvKiAobykgICA6IG91dHB1dCB2ZWN0b3IgICovCi0gICAgIFdvcmQxNiBMICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLyogKGkpICAgOiB2ZWN0b3IgbGVuZ3RoICAqLwotKTsKLXZvaWQgU2V0X3plcm8oCi0gICAgIFdvcmQxNiB4W10sICAgICAgICAgICAgICAgICAgICAgICAgICAgLyogKG8pICAgIDogdmVjdG9yIHRvIGNsZWFyICAgICAqLwotICAgICBXb3JkMTYgTCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8qIChpKSAgICA6IGxlbmd0aCBvZiB2ZWN0b3IgICAgKi8KLSk7Ci12b2lkIFVwZHRfdGFyKAotICAgICBXb3JkMTYgKiB4LCAgICAgICAgICAgICAgICAgICAgICAgICAgIC8qIChpKSBRMCAgOiBvbGQgdGFyZ2V0IChmb3IgcGl0Y2ggc2VhcmNoKSAgICAgKi8KLSAgICAgV29yZDE2ICogeDIsICAgICAgICAgICAgICAgICAgICAgICAgICAvKiAobykgUTAgIDogbmV3IHRhcmdldCAoZm9yIGNvZGVib29rIHNlYXJjaCkgICovCi0gICAgIFdvcmQxNiAqIHksICAgICAgICAgICAgICAgICAgICAgICAgICAgLyogKGkpIFEwICA6IGZpbHRlcmVkIGFkYXB0aXZlIGNvZGVib29rIHZlY3RvciAqLwotICAgICBXb3JkMTYgZ2FpbiwgICAgICAgICAgICAgICAgICAgICAgICAgIC8qIChpKSBRMTQgOiBhZGFwdGl2ZSBjb2RlYm9vayBnYWluICAgICAgICAgICAgKi8KLSAgICAgV29yZDE2IEwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvKiAoaSkgICAgIDogc3ViZnJhbWUgc2l6ZSAgICAgICAgICAgICAgICAgICAgICovCi0pOwotV29yZDE2IHZvaWNlX2ZhY3RvciggICAgICAgICAgICAgICAgICAgICAgIC8qIChvKSBRMTUgOiBmYWN0b3IgKC0xPXVudm9pY2VkIHRvIDE9dm9pY2VkKSAqLwotICAgICBXb3JkMTYgZXhjW10sICAgICAgICAgICAgICAgICAgICAgICAgIC8qIChpKSBRX2V4YzogcGl0Y2ggZXhjaXRhdGlvbiAgICAgICAgICAgICAgICAqLwotICAgICBXb3JkMTYgUV9leGMsICAgICAgICAgICAgICAgICAgICAgICAgIC8qIChpKSAgICAgOiBleGMgZm9ybWF0ICAgICAgICAgICAgICAgICAgICAgICAqLwotICAgICBXb3JkMTYgZ2Fpbl9waXQsICAgICAgICAgICAgICAgICAgICAgIC8qIChpKSBRMTQgOiBnYWluIG9mIHBpdGNoICAgICAgICAgICAgICAgICAgICAqLwotICAgICBXb3JkMTYgY29kZVtdLCAgICAgICAgICAgICAgICAgICAgICAgIC8qIChpKSBROSAgOiBGaXhlZCBjb2RlYm9vayBleGNpdGF0aW9uICAgICAgICAqLwotICAgICBXb3JkMTYgZ2Fpbl9jb2RlLCAgICAgICAgICAgICAgICAgICAgIC8qIChpKSBRMCAgOiBnYWluIG9mIGNvZGUgICAgICAgICAgICAgICAgICAgICAqLwotICAgICBXb3JkMTYgTF9zdWJmciAgICAgICAgICAgICAgICAgICAgICAgIC8qIChpKSAgICAgOiBzdWJmcmFtZSBsZW5ndGggICAgICAgICAgICAgICAgICAqLwotKTsKLXZvaWQgU2NhbGVfc2lnKAotICAgICBXb3JkMTYgeFtdLCAgICAgICAgICAgICAgICAgICAgICAgICAgIC8qIChpL28pIDogc2lnbmFsIHRvIHNjYWxlICAgICAgICAgICAgICAgKi8KLSAgICAgV29yZDE2IGxnLCAgICAgICAgICAgICAgICAgICAgICAgICAgICAvKiAoaSkgICA6IHNpemUgb2YgeFtdICAgICAgICAgICAgICAgICAgICovCi0gICAgIFdvcmQxNiBleHAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLyogKGkpICAgOiBleHBvbmVudDogeCA9IHJvdW5kKHggPDwgZXhwKSAqLwotKTsKLQotdm9pZCBTY2FsZV9zaWdfb3B0KAotICAgICBXb3JkMTYgeFtdLCAgICAgICAgICAgICAgICAgICAgICAgICAgIC8qIChpL28pIDogc2lnbmFsIHRvIHNjYWxlICAgICAgICAgICAgICAgKi8KLSAgICAgV29yZDE2IGxnLCAgICAgICAgICAgICAgICAgICAgICAgICAgICAvKiAoaSkgICA6IHNpemUgb2YgeFtdICAgICAgICAgICAgICAgICAgICovCi0gICAgIFdvcmQxNiBleHAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLyogKGkpICAgOiBleHBvbmVudDogeCA9IHJvdW5kKHggPDwgZXhwKSAqLwotKTsKLQotV29yZDE2IFJhbmRvbShXb3JkMTYgKiBzZWVkKTsKLQotdm9pZCBJbml0X2dwX2NsaXAoCi0gICAgIFdvcmQxNiBtZW1bXSAgICAgICAgICAgICAgICAgICAgICAgICAgLyogKG8pIDogbWVtb3J5IG9mIGdhaW4gb2YgcGl0Y2ggY2xpcHBpbmcgYWxnb3JpdGhtICovCi0pOwotV29yZDE2IEdwX2NsaXAoCi0gICAgIFdvcmQxNiBtZW1bXSAgICAgICAgICAgICAgICAgICAgICAgICAgLyogKGkvbykgOiBtZW1vcnkgb2YgZ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kKLSNkZWZpbmUgdm9fbmVnYXRlKGEpCQkgICAgICAgICgtYSkKLSNkZWZpbmUgdm9fTF9zaHJfcihMX3ZhcjEsIHZhcjIpICAgICAgICAoKExfdmFyMSsoKFdvcmQzMikoMUw8PCh2YXIyLTEpKSkpPj52YXIyKQotCi0KLS8qX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fCi18ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfAotfCAgIFByb3RvdHlwZXMgZm9yIGJhc2ljIGFyaXRobWV0aWMgb3BlcmF0b3JzICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwKLXxfX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX198Ci0qLwotc3RhdGljX3ZvIFdvcmQxNiBhZGQgKFdvcmQxNiB2YXIxLCBXb3JkMTYgdmFyMik7CQkJCS8qIFNob3J0IGFkZCwxICovCi1zdGF0aWNfdm8gV29yZDE2IHN1YiAoV29yZDE2IHZhcjEsIFdvcmQxNiB2YXIyKTsJCQkJLyogU2hvcnQgc3ViLDEgKi8KLXN0YXRpY192byBXb3JkMTYgc2hsIChXb3JkMTYgdmFyMSwgV29yZDE2IHZhcjIpOyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLyogU2hvcnQgc2hpZnQgbGVmdCwgICAgMSAgICovCi1zdGF0aWNfdm8gV29yZDE2IHNociAoV29yZDE2IHZhcjEsIFdvcmQxNiB2YXIyKTsgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8qIFNob3J0IHNoaWZ0IHJpZ2h0LCAgIDEgICAqLwotc3RhdGljX3ZvIFdvcmQxNiBtdWx0IChXb3JkMTYgdmFyMSwgV29yZDE2IHZhcjIpOyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvKiBTaG9ydCBtdWx0LCAgICAgICAgICAxICAgKi8KLXN0YXRpY192byBXb3JkMzIgTF9tdWx0IChXb3JkMTYgdmFyMSwgV29yZDE2IHZhcjIpOyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLyogTG9uZyBtdWx0LCAgICAgICAgICAgMSAgICovCi1zdGF0aWNfdm8gV29yZDE2IHZvcm91bmQgKFdvcmQzMiBMX3ZhcjEpOyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8qIFJvdW5kLCAgICAgICAgICAgICAgIDEgICAqLwotc3RhdGljX3ZvIFdvcmQzMiBMX21hYyAoV29yZDMyIExfdmFyMywgV29yZDE2IHZhcjEsIFdvcmQxNiB2YXIyKTsgICAgICAgICAgICAJLyogTWFjLCAgMSAgKi8KLXN0YXRpY192byBXb3JkMzIgTF9tc3UgKFdvcmQzMiBMX3ZhcjMsIFdvcmQxNiB2YXIxLCBXb3JkMTYgdmFyMik7ICAgCQkvKiBNc3UsICAxICAqLwotc3RhdGljX3ZvIFdvcmQzMiBMX2FkZCAoV29yZDMyIExfdmFyMSwgV29yZDMyIExfdmFyMik7ICAgCQkgCS8qIExvbmcgYWRkLCAgICAgICAgMiAqLwotc3RhdGljX3ZvIFdvcmQzMiBMX3N1YiAoV29yZDMyIExfdmFyMSwgV29yZDMyIExfdmFyMik7ICAgCQkJLyogTG9uZyBzdWIsICAgICAgICAyICovCi1zdGF0aWNfdm8gV29yZDE2IG11bHRfciAoV29yZDE2IHZhcjEsIFdvcmQxNiB2YXIyKTsgICAgICAJCSAJLyogTXVsdCB3aXRoIHJvdW5kLCAyICovCi1zdGF0aWNfdm8gV29yZDMyIExfc2hsMihXb3JkMzIgTF92YXIxLCBXb3JkMTYgdmFyMik7ICAgICAgICAgICAgIAkJLyogdmFyMiA+IDAqLwotc3RhdGljX3ZvIFdvcmQzMiBMX3NobCAoV29yZDMyIExfdmFyMSwgV29yZDE2IHZhcjIpOyAgICAJIAkgCS8qIExvbmcgc2hpZnQgbGVmdCwgMiAqLwotc3RhdGljX3ZvIFdvcmQzMiBMX3NociAoV29yZDMyIExfdmFyMSwgV29yZDE2IHZhcjIpOyAgICAJIAkgCS8qIExvbmcgc2hpZnQgcmlnaHQsIDIqLwotc3RhdGljX3ZvIFdvcmQzMiBMX3Nocl9yIChXb3JkMzIgTF92YXIxLCBXb3JkMTYgdmFyMik7IAkJCQkvKiBMb25nIHNoaWZ0IHJpZ2h0IHdpdGggcm91bmQsICAzICAgKi8KLXN0YXRpY192byBXb3JkMTYgbm9ybV9zIChXb3JkMTYgdmFyMSk7ICAgICAgICAgICAgIAkJCQkvKiBTaG9ydCBub3JtLCAgICAgICAgICAgMTUgICovCi1zdGF0aWNfdm8gV29yZDE2IGRpdl9zIChXb3JkMTYgdmFyMSwgV29yZDE2IHZhcjIpOyAJCQkJLyogU2hvcnQgZGl2aXNpb24sICAgICAgIDE4ICAqLwotc3RhdGljX3ZvIFdvcmQxNiBub3JtX2wgKFdvcmQzMiBMX3ZhcjEpOyAgICAgICAgICAgCQkJCS8qIExvbmcgbm9ybSwgICAgICAgICAgICAzMCAgKi8KLQotLypfX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX18KLXwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8Ci18ICAgRnVuY3Rpb25zICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfAotfF9fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX3wKLSovCi0vKl9fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fXwotfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwKLXwgICBGdW5jdGlvbiBOYW1lIDogYWRkICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8Ci18ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfAotfCAgIFB1cnBvc2UgOiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwKLXwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8Ci18ICAgIFBlcmZvcm1zIHRoZSBhZGRpdGlvbiAodmFyMSt2YXIyKSB3aXRoIG92ZXJmbG93IGNvbnRyb2wgYW5kIHNhdHVyYXRpb247fAotfCAgICB0aGUgMTYgYml0IHJlc3VsdCBpcyBzZXQgYXQgKzMyNzY3IHdoZW4gb3ZlcmZsb3cgb2NjdXJzIG9yIGF0IC0zMjc2OCAgIHwKLXwgICAgd2hlbiB1bmRlcmZsb3cgb2NjdXJzLiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8Ci18ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfAotfCAgIENvbXBsZXhpdHkgd2VpZ2h0IDogMSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwKLXwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8Ci18ICAgSW5wdXRzIDogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfAotfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwKLXwgICAgdmFyMSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8Ci18ICAgICAgICAgICAgIDE2IGJpdCBzaG9ydCBzaWduZWQgaW50ZWdlciAoV29yZDE2KSB3aG9zZSB2YWx1ZSBmYWxscyBpbiB0aGUgfAotfCAgICAgICAgICAgICByYW5nZSA6IDB4ZmZmZiA4MDAwIDw9IHZhcjEgPD0gMHgwMDAwIDdmZmYuICAgICAgICAgICAgICAgICAgIHwKLXwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8Ci18ICAgIHZhcjIgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfAotfCAgICAgICAgICAgICAxNiBiaXQgc2hvcnQgc2lnbmVkIGludGVnZXIgKFdvcmQxNikgd2hvc2UgdmFsdWUgZmFsbHMgaW4gdGhlIHwKLXwgICAgICAgICAgICAgcmFuZ2UgOiAweGZmZmYgODAwMCA8PSB2YXIxIDw9IDB4MDAwMCA3ZmZmLiAgICAgICAgICAgICAgICAgICB8Ci18ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfAotfCAgIE91dHB1dHMgOiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwKLXwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8Ci18ICAgIG5vbmUgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfAotfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwKLXwgICBSZXR1cm4gVmFsdWUgOiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8Ci18ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfAotfCAgICB2YXJfb3V0ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwKLXwgICAgICAgICAgICAgMTYgYml0IHNob3J0IHNpZ25lZCBpbnRlZ2VyIChXb3JkMTYpIHdob3NlIHZhbHVlIGZhbGxzIGluIHRoZSB8Ci18ICAgICAgICAgICAgIHJhbmdlIDogMHhmZmZmIDgwMDAgPD0gdmFyX291dCA8PSAweDAwMDAgN2ZmZi4gICAgICAgICAgICAgICAgfAotfF9fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX3wKLSovCi1zdGF0aWNfdm8gV29yZDE2IGFkZCAoV29yZDE2IHZhcjEsIFdvcmQxNiB2YXIyKQotewotCVdvcmQxNiB2YXJfb3V0OwotCVdvcmQzMiBMX3N1bTsKLQlMX3N1bSA9IChXb3JkMzIpIHZhcjEgKyB2YXIyOwotCXZhcl9vdXQgPSBzYXR1cmF0ZSAoTF9zdW0pOwotCXJldHVybiAodmFyX291dCk7Ci19Ci0KLS8qX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fCi18ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfAotfCAgIEZ1bmN0aW9uIE5hbWUgOiBzdWIgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwKLXwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8Ci18ICAgUHVycG9zZSA6ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfAotfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwKLXwgICAgUGVyZm9ybXMgdGhlIHN1YnRyYWN0aW9uICh2YXIxK3ZhcjIpIHdpdGggb3ZlcmZsb3cgY29udHJvbCBhbmQgc2F0dS0gICB8Ci18ICAgIHJhdGlvbjsgdGhlIDE2IGJpdCByZXN1bHQgaXMgc2V0IGF0ICszMjc2NyB3aGVuIG92ZXJmbG93IG9jY3VycyBvciBhdCAgfAotfCAgICAtMzI3Njggd2hlbiB1bmRlcmZsb3cgb2NjdXJzLiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwKLXwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8Ci18ICAgQ29tcGxleGl0eSB3ZWlnaHQgOiAxICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfAotfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwKLXwgICBJbnB1dHMgOiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8Ci18ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfAotfCAgICB2YXIxICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwKLXwgICAgICAgICAgICAgMTYgYml0IHNob3J0IHNpZ25lZCBpbnRlZ2VyIChXb3JkMTYpIHdob3NlIHZhbHVlIGZhbGxzIGluIHRoZSB8Ci18ICAgICAgICAgICAgIHJhbmdlIDogMHhmZmZmIDgwMDAgPD0gdmFyMSA8PSAweDAwMDAgN2ZmZi4gICAgICAgICAgICAgICAgICAgfAotfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwKLXwgICAgdmFyMiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8Ci18ICAgICAgICAgICAgIDE2IGJpdCBzaG9ydCBzaWduZWQgaW50ZWdlciAoV29yZDE2KSB3aG9zZSB2YWx1ZSBmYWxscyBpbiB0aGUgfAotfCAgICAgICAgICAgICByYW5nZSA6IDB4ZmZmZiA4MDAwIDw9IHZhcjEgPD0gMHgwMDAwIDdmZmYuICAgICAgICAgICAgICAgICAgIHwKLXwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8Ci18ICAgT3V0cHV0cyA6ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfAotfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwKLXwgICAgbm9uZSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8Ci18ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfAotfCAgIFJldHVybiBWYWx1ZSA6ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwKLXwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8Ci18ICAgIHZhcl9vdXQgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfAotfCAgICAgICAgICAgICAxNiBiaXQgc2hvcnQgc2lnbmVkIGludGVnZXIgKFdvcmQxNikgd2hvc2UgdmFsdWUgZmFsbHMgaW4gdGhlIHwKLXwgICAgICAgICAgICAgcmFuZ2UgOiAweGZmZmYgODAwMCA8PSB2YXJfb3V0IDw9IDB4MDAwMCA3ZmZmLiAgICAgICAgICAgICAgICB8Ci18X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19ffAotKi8KLQotc3RhdGljX3ZvIFdvcmQxNiBzdWIgKFdvcmQxNiB2YXIxLCBXb3JkMTYgdmFyMikKLXsKLQlXb3JkMTYgdmFyX291dDsKLQlXb3JkMzIgTF9kaWZmOwotCUxfZGlmZiA9IChXb3JkMzIpIHZhcjEgLSB2YXIyOwotCXZhcl9vdXQgPSBzYXR1cmF0ZSAoTF9kaWZmKTsKLQlyZXR1cm4gKHZhcl9vdXQpOwotfQotCi0vKl9fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fXwotfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwKLXwgICBGdW5jdGlvbiBOYW1lIDogc2hsICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8Ci18ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfAotfCAgIFB1cnBvc2UgOiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwKLXwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8Ci18ICAgQXJpdGhtZXRpY2FsbHkgc2hpZnQgdGhlIDE2IGJpdCBpbnB1dCB2YXIxIGxlZnQgdmFyMiBwb3NpdGlvbnMuWmVybyBmaWxsfAotfCAgIHRoZSB2YXIyIExTQiBvZiB0aGUgcmVzdWx0LiBJZiB2YXIyIGlzIG5lZ2F0aXZlLCBhcml0aG1ldGljYWxseSBzaGlmdCAgIHwKLXwgICB2YXIxIHJpZ2h0IGJ5IC12YXIyIHdpdGggc2lnbiBleHRlbnNpb24uIFNhdHVyYXRlIHRoZSByZXN1bHQgaW4gY2FzZSBvZiB8Ci18ICAgdW5kZXJmbG93cyBvciBvdmVyZmxvd3MuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfAotfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwKLXwgICBDb21wbGV4aXR5IHdlaWdodCA6IDEgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8Ci18ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfAotfCAgIElucHV0cyA6ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwKLXwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8Ci18ICAgIHZhcjEgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfAotfCAgICAgICAgICAgICAxNiBiaXQgc2hvcnQgc2lnbmVkIGludGVnZXIgKFdvcmQxNikgd2hvc2UgdmFsdWUgZmFsbHMgaW4gdGhlIHwKLXwgICAgICAgICAgICAgcmFuZ2UgOiAweGZmZmYgODAwMCA8PSB2YXIxIDw9IDB4MDAwMCA3ZmZmLiAgICAgICAgICAgICAgICAgICB8Ci18ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfAotfCAgICB2YXIyICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwKLXwgICAgICAgICAgICAgMTYgYml0IHNob3J0IHNpZ25lZCBpbnRlZ2VyIChXb3JkMTYpIHdob3NlIHZhbHVlIGZhbGxzIGluIHRoZSB8Ci18ICAgICAgICAgICAgIHJhbmdlIDogMHhmZmZmIDgwMDAgPD0gdmFyMSA8PSAweDAwMDAgN2ZmZi4gICAgICAgICAgICAgICAgICAgfAotfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwKLXwgICBPdXRwdXRzIDogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8Ci18ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfAotfCAgICBub25lICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwKLXwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8Ci18ICAgUmV0dXJuIFZhbHVlIDogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfAotfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwKLXwgICAgdmFyX291dCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8Ci18ICAgICAgICAgICAgIDE2IGJpdCBzaG9ydCBzaWduZWQgaW50ZWdlciAoV29yZDE2KSB3aG9zZSB2YWx1ZSBmYWxscyBpbiB0aGUgfAotfCAgICAgICAgICAgICByYW5nZSA6IDB4ZmZmZiA4MDAwIDw9IHZhcl9vdXQgPD0gMHgwMDAwIDdmZmYuICAgICAgICAgICAgICAgIHwKLXxfX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX198Ci0qLwotCi1zdGF0aWNfdm8gV29yZDE2IHNobCAoV29yZDE2IHZhcjEsIFdvcmQxNiB2YXIyKQotewotCVdvcmQxNiB2YXJfb3V0OwotCVdvcmQzMiByZXN1bHQ7Ci0JaWYgKHZhcjIgPCAwKQotCXsKLQkJaWYgKHZhcjIgPCAtMTYpCi0JCQl2YXIyID0gLTE2OwotCQl2YXJfb3V0ID0gdmFyMSA+PiAoKFdvcmQxNiktdmFyMik7Ci0JfQotCWVsc2UKLQl7Ci0JCXJlc3VsdCA9IChXb3JkMzIpIHZhcjEgKigoV29yZDMyKSAxIDw8IHZhcjIpOwotCQlpZiAoKHZhcjIgPiAxNSAmJiB2YXIxICE9IDApIHx8IChyZXN1bHQgIT0gKFdvcmQzMikgKChXb3JkMTYpIHJlc3VsdCkpKQotCQl7Ci0JCQl2YXJfb3V0ID0gKFdvcmQxNikoKHZhcjEgPiAwKSA/IE1BWF8xNiA6IE1JTl8xNik7Ci0JCX0KLQkJZWxzZQotCQl7Ci0JCQl2YXJfb3V0ID0gZXh0cmFjdF9sIChyZXN1bHQpOwotCQl9Ci0JfQotCXJldHVybiAodmFyX291dCk7Ci19Ci0KLS8qX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fCi18ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfAotfCAgIEZ1bmN0aW9uIE5hbWUgOiBzaHIgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwKLXwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8Ci18ICAgUHVycG9zZSA6ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfAotfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwKLXwgICBBcml0aG1ldGljYWxseSBzaGlmdCB0aGUgMTYgYml0IGlucHV0IHZhcjEgcmlnaHQgdmFyMiBwb3NpdGlvbnMgd2l0aCAgICB8Ci18ICAgc2lnbiBleHRlbnNpb24uIElmIHZhcjIgaXMgbmVnYXRpdmUsIGFyaXRobWV0aWNhbGx5IHNoaWZ0IHZhcjEgbGVmdCBieSAgfAotfCAgIC12YXIyIHdpdGggc2lnbiBleHRlbnNpb24uIFNhdHVyYXRlIHRoZSByZXN1bHQgaW4gY2FzZSBvZiB1bmRlcmZsb3dzIG9yIHwKLXwgICBvdmVyZmxvd3MuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8Ci18ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfAotfCAgIENvbXBsZXhpdHkgd2VpZ2h0IDogMSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwKLXwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8Ci18ICAgSW5wdXRzIDogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfAotfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwKLXwgICAgdmFyMSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8Ci18ICAgICAgICAgICAgIDE2IGJpdCBzaG9ydCBzaWduZWQgaW50ZWdlciAoV29yZDE2KSB3aG9zZSB2YWx1ZSBmYWxscyBpbiB0aGUgfAotfCAgICAgICAgICAgICByYW5nZSA6IDB4ZmZmZiA4MDAwIDw9IHZhcjEgPD0gMHgwMDAwIDdmZmYuICAgICAgICAgICAgICAgICAgIHwKLXwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8Ci18ICAgIHZhcjIgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfAotfCAgICAgICAgICAgICAxNiBiaXQgc2hvcnQgc2lnbmVkIGludGVnZXIgKFdvcmQxNikgd2hvc2UgdmFsdWUgZmFsbHMgaW4gdGhlIHwKLXwgICAgICAgICAgICAgcmFuZ2UgOiAweGZmZmYgODAwMCA8PSB2YXIxIDw9IDB4MDAwMCA3ZmZmLiAgICAgICAgICAgICAgICAgICB8Ci18ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfAotfCAgIE91dHB1dHMgOiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwKLXwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8Ci18ICAgIG5vbmUgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfAotfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwKLXwgICBSZXR1cm4gVmFsdWUgOiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8Ci18ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfAotfCAgICB2YXJfb3V0ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwKLXwgICAgICAgICAgICAgMTYgYml0IHNob3J0IHNpZ25lZCBpbnRlZ2VyIChXb3JkMTYpIHdob3NlIHZhbHVlIGZhbGxzIGluIHRoZSB8Ci18ICAgICAgICAgICAgIHJhbmdlIDogMHhmZmZmIDgwMDAgPD0gdmFyX291dCA8PSAweDAwMDAgN2ZmZi4gICAgICAgICAgICAgICAgfAotfF9fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX3wKLSovCi0KLXN0YXRpY192byBXb3JkMTYgc2hyIChXb3JkMTYgdmFyMSwgV29yZDE2IHZhcjIpCi17Ci0JV29yZDE2IHZhcl9vdXQ7Ci0JaWYgKHZhcjIgPCAwKQotCXsKLQkJaWYgKHZhcjIgPCAtMTYpCi0JCQl2YXIyID0gLTE2OwotCQl2YXJfb3V0ID0gc2hsKHZhcjEsIChXb3JkMTYpLXZhcjIpOwotCX0KLQllbHNlCi0JewotCQlpZiAodmFyMiA+PSAxNSkKLQkJewotCQkJdmFyX291dCA9IChXb3JkMTYpKCh2YXIxIDwgMCkgPyAtMSA6IDApOwotCQl9Ci0JCWVsc2UKLQkJewotCQkJaWYgKHZhcjEgPCAwKQotCQkJewotCQkJCXZhcl9vdXQgPSAoV29yZDE2KSh+KCh+dmFyMSkgPj4gdmFyMikpOwotCQkJfQotCQkJZWxzZQotCQkJewotCQkJCXZhcl9vdXQgPSAoV29yZDE2KSh2YXIxID4+IHZhcjIpOwotCQkJfQotCQl9Ci0JfQotCXJldHVybiAodmFyX291dCk7Ci19Ci0KLS8qX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fCi18ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfAotfCAgIEZ1bmN0aW9uIE5hbWUgOiBtdWx0ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwKLXwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8Ci18ICAgUHVycG9zZSA6ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfAotfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwKLXwgICAgUGVyZm9ybXMgdGhlIG11bHRpcGxpY2F0aW9uIG9mIHZhcjEgYnkgdmFyMiBhbmQgZ2l2ZXMgYSAxNiBiaXQgcmVzdWx0ICB8Ci18ICAgIHdoaWNoIGlzIHNjYWxlZCBpLmUuOiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfAotfCAgICAgICAgICAgICBtdWx0KHZhcjEsdmFyMikgPSBleHRyYWN0X2woTF9zaHIoKHZhcjEgdGltZXMgdmFyMiksMTUpKSBhbmQgIHwKLXwgICAgICAgICAgICAgbXVsdCgtMzI3NjgsLTMyNzY4KSA9IDMyNzY3LiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8Ci18ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfAotfCAgIENvbXBsZXhpdHkgd2VpZ2h0IDogMSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwKLXwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8Ci18ICAgSW5wdXRzIDogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfAotfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwKLXwgICAgdmFyMSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8Ci18ICAgICAgICAgICAgIDE2IGJpdCBzaG9ydCBzaWduZWQgaW50ZWdlciAoV29yZDE2KSB3aG9zZSB2YWx1ZSBmYWxscyBpbiB0aGUgfAotfCAgICAgICAgICAgICByYW5nZSA6IDB4ZmZmZiA4MDAwIDw9IHZhcjEgPD0gMHgwMDAwIDdmZmYuICAgICAgICAgICAgICAgICAgIHwKLXwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8Ci18ICAgIHZhcjIgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfAotfCAgICAgICAgICAgICAxNiBiaXQgc2hvcnQgc2lnbmVkIGludGVnZXIgKFdvcmQxNikgd2hvc2UgdmFsdWUgZmFsbHMgaW4gdGhlIHwKLXwgICAgICAgICAgICAgcmFuZ2UgOiAweGZmZmYgODAwMCA8PSB2YXIxIDw9IDB4MDAwMCA3ZmZmLiAgICAgICAgICAgICAgICAgICB8Ci18ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfAotfCAgIE91dHB1dHMgOiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwKLXwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8Ci18ICAgIG5vbmUgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfAotfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwKLXwgICBSZXR1cm4gVmFsdWUgOiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8Ci18ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfAotfCAgICB2YXJfb3V0ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwKLXwgICAgICAgICAgICAgMTYgYml0IHNob3J0IHNpZ25lZCBpbnRlZ2VyIChXb3JkMTYpIHdob3NlIHZhbHVlIGZhbGxzIGluIHRoZSB8Ci18ICAgICAgICAgICAgIHJhbmdlIDogMHhmZmZmIDgwMDAgPD0gdmFyX291dCA8PSAweDAwMDAgN2ZmZi4gICAgICAgICAgICAgICAgfAotfF9fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX3wKLSovCi0KLXN0YXRpY192byBXb3JkMTYgbXVsdCAoV29yZDE2IHZhcjEsIFdvcmQxNiB2YXIyKQotewotCVdvcmQxNiB2YXJfb3V0OwotCVdvcmQzMiBMX3Byb2R1Y3Q7Ci0JTF9wcm9kdWN0ID0gKFdvcmQzMikgdmFyMSAqKFdvcmQzMikgdmFyMjsKLQlMX3Byb2R1Y3QgPSAoTF9wcm9kdWN0ICYgKFdvcmQzMikgMHhmZmZmODAwMEwpID4+IDE1OwotCWlmIChMX3Byb2R1Y3QgJiAoV29yZDMyKSAweDAwMDEwMDAwTCkKLQkJTF9wcm9kdWN0ID0gTF9wcm9kdWN0IHwgKFdvcmQzMikgMHhmZmZmMDAwMEw7Ci0JdmFyX291dCA9IHNhdHVyYXRlIChMX3Byb2R1Y3QpOwotCXJldHVybiAodmFyX291dCk7Ci19Ci0KLS8qX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fCi18ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfAotfCAgIEZ1bmN0aW9uIE5hbWUgOiBMX211bHQgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwKLXwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8Ci18ICAgUHVycG9zZSA6ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfAotfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwKLXwgICBMX211bHQgaXMgdGhlIDMyIGJpdCByZXN1bHQgb2YgdGhlIG11bHRpcGxpY2F0aW9uIG9mIHZhcjEgdGltZXMgdmFyMiAgICB8Ci18ICAgd2l0aCBvbmUgc2hpZnQgbGVmdCBpLmUuOiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfAotfCAgICAgICAgTF9tdWx0KHZhcjEsdmFyMikgPSBMX3NobCgodmFyMSB0aW1lcyB2YXIyKSwxKSBhbmQgICAgICAgICAgICAgICAgICAgfAotfCAgICAgICAgTF9tdWx0KC0zMjc2OCwtMzI3NjgpID0gMjE0NzQ4MzY0Ny4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwKLXwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8Ci18ICAgQ29tcGxleGl0eSB3ZWlnaHQgOiAxICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfAotfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwKLXwgICBJbnB1dHMgOiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8Ci18ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfAotfCAgICB2YXIxICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwKLXwgICAgICAgICAgICAgMTYgYml0IHNob3J0IHNpZ25lZCBpbnRlZ2VyIChXb3JkMTYpIHdob3NlIHZhbHVlIGZhbGxzIGluIHRoZSB8Ci18ICAgICAgICAgICAgIHJhbmdlIDogMHhmZmZmIDgwMDAgPD0gdmFyMSA8PSAweDAwMDAgN2ZmZi4gICAgICAgICAgICAgICAgICAgfAotfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwKLXwgICAgdmFyMiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8Ci18ICAgICAgICAgICAgIDE2IGJpdCBzaG9ydCBzaWduZWQgaW50ZWdlciAoV29yZDE2KSB3aG9zZSB2YWx1ZSBmYWxscyBpbiB0aGUgfAotfCAgICAgICAgICAgICByYW5nZSA6IDB4ZmZmZiA4MDAwIDw9IHZhcjEgPD0gMHgwMDAwIDdmZmYuICAgICAgICAgICAgICAgICAgIHwKLXwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8Ci18ICAgT3V0cHV0cyA6ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfAotfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwKLXwgICAgbm9uZSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8Ci18ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfAotfCAgIFJldHVybiBWYWx1ZSA6ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwKLXwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8Ci18ICAgIExfdmFyX291dCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfAotfCAgICAgICAgICAgICAzMiBiaXQgbG9uZyBzaWduZWQgaW50ZWdlciAoV29yZDMyKSB3aG9zZSB2YWx1ZSBmYWxscyBpbiB0aGUgIHwKLXwgICAgICAgICAgICAgcmFuZ2UgOiAweDgwMDAgMDAwMCA8PSBMX3Zhcl9vdXQgPD0gMHg3ZmZmIGZmZmYuICAgICAgICAgICAgICB8Ci18X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19ffAotKi8KLQotc3RhdGljX3ZvIFdvcmQzMiBMX211bHQgKFdvcmQxNiB2YXIxLCBXb3JkMTYgdmFyMikKLXsKLQlXb3JkMzIgTF92YXJfb3V0OwotCUxfdmFyX291dCA9IChXb3JkMzIpIHZhcjEgKihXb3JkMzIpIHZhcjI7Ci0JaWYgKExfdmFyX291dCAhPSAoV29yZDMyKSAweDQwMDAwMDAwTCkKLQl7Ci0JCUxfdmFyX291dCAqPSAyOwotCX0KLQllbHNlCi0JewotCQlMX3Zhcl9vdXQgPSBNQVhfMzI7Ci0JfQotCXJldHVybiAoTF92YXJfb3V0KTsKLX0KLQotLypfX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX18KLXwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8Ci18ICAgRnVuY3Rpb24gTmFtZSA6IHJvdW5kICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfAotfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwKLXwgICBQdXJwb3NlIDogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8Ci18ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfAotfCAgIFJvdW5kIHRoZSBsb3dlciAxNiBiaXRzIG9mIHRoZSAzMiBiaXQgaW5wdXQgbnVtYmVyIGludG8gdGhlIE1TIDE2IGJpdHMgIHwKLXwgICB3aXRoIHNhdHVyYXRpb24uIFNoaWZ0IHRoZSByZXN1bHRpbmcgYml0cyByaWdodCBieSAxNiBhbmQgcmV0dXJuIHRoZSAxNiB8Ci18ICAgYml0IG51bWJlcjogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfAotfCAgICAgICAgICAgICAgIHJvdW5kKExfdmFyMSkgPSBleHRyYWN0X2goTF9hZGQoTF92YXIxLDMyNzY4KSkgICAgICAgICAgICAgIHwKLXwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8Ci18ICAgQ29tcGxleGl0eSB3ZWlnaHQgOiAxICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfAotfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwKLXwgICBJbnB1dHMgOiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8Ci18ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfAotfCAgICBMX3ZhcjEgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwKLXwgICAgICAgICAgICAgMzIgYml0IGxvbmcgc2lnbmVkIGludGVnZXIgKFdvcmQzMiApIHdob3NlIHZhbHVlIGZhbGxzIGluIHRoZSB8Ci18ICAgICAgICAgICAgIHJhbmdlIDogMHg4MDAwIDAwMDAgPD0gTF92YXIxIDw9IDB4N2ZmZiBmZmZmLiAgICAgICAgICAgICAgICAgfAotfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwKLXwgICBPdXRwdXRzIDogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8Ci18ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfAotfCAgICBub25lICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwKLXwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8Ci18ICAgUmV0dXJuIFZhbHVlIDogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfAotfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwKLXwgICAgdmFyX291dCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8Ci18ICAgICAgICAgICAgIDE2IGJpdCBzaG9ydCBzaWduZWQgaW50ZWdlciAoV29yZDE2KSB3aG9zZSB2YWx1ZSBmYWxscyBpbiB0aGUgfAotfCAgICAgICAgICAgICByYW5nZSA6IDB4ZmZmZiA4MDAwIDw9IHZhcl9vdXQgPD0gMHgwMDAwIDdmZmYuICAgICAgICAgICAgICAgIHwKLXxfX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX198Ci0qLwotCi1zdGF0aWNfdm8gV29yZDE2IHZvcm91bmQgKFdvcmQzMiBMX3ZhcjEpCi17Ci0JV29yZDE2IHZhcl9vdXQ7Ci0JV29yZDMyIExfcm91bmRlZDsKLQlMX3JvdW5kZWQgPSBMX2FkZCAoTF92YXIxLCAoV29yZDMyKSAweDAwMDA4MDAwTCk7Ci0JdmFyX291dCA9IGV4dHJhY3RfaCAoTF9yb3VuZGVkKTsKLQlyZXR1cm4gKHZhcl9vdXQpOwotfQotCi0vKl9fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fXwotfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwKLXwgICBGdW5jdGlvbiBOYW1lIDogTF9tYWMgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8Ci18ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfAotfCAgIFB1cnBvc2UgOiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwKLXwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8Ci18ICAgTXVsdGlwbHkgdmFyMSBieSB2YXIyIGFuZCBzaGlmdCB0aGUgcmVzdWx0IGxlZnQgYnkgMS4gQWRkIHRoZSAzMiBiaXQgICAgfAotfCAgIHJlc3VsdCB0byBMX3ZhcjMgd2l0aCBzYXR1cmF0aW9uLCByZXR1cm4gYSAzMiBiaXQgcmVzdWx0OiAgICAgICAgICAgICAgIHwKLXwgICAgICAgIExfbWFjKExfdmFyMyx2YXIxLHZhcjIpID0gTF9hZGQoTF92YXIzLExfbXVsdCh2YXIxLHZhcjIpKS4gICAgICAgICB8Ci18ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfAotfCAgIENvbXBsZXhpdHkgd2VpZ2h0IDogMSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwKLXwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8Ci18ICAgSW5wdXRzIDogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfAotfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwKLXwgICAgTF92YXIzICAgMzIgYml0IGxvbmcgc2lnbmVkIGludGVnZXIgKFdvcmQzMikgd2hvc2UgdmFsdWUgZmFsbHMgaW4gdGhlICB8Ci18ICAgICAgICAgICAgIHJhbmdlIDogMHg4MDAwIDAwMDAgPD0gTF92YXIzIDw9IDB4N2ZmZiBmZmZmLiAgICAgICAgICAgICAgICAgfAotfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwKLXwgICAgdmFyMSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8Ci18ICAgICAgICAgICAgIDE2IGJpdCBzaG9ydCBzaWduZWQgaW50ZWdlciAoV29yZDE2KSB3aG9zZSB2YWx1ZSBmYWxscyBpbiB0aGUgfAotfCAgICAgICAgICAgICByYW5nZSA6IDB4ZmZmZiA4MDAwIDw9IHZhcjEgPD0gMHgwMDAwIDdmZmYuICAgICAgICAgICAgICAgICAgIHwKLXwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8Ci18ICAgIHZhcjIgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfAotfCAgICAgICAgICAgICAxNiBiaXQgc2hvcnQgc2lnbmVkIGludGVnZXIgKFdvcmQxNikgd2hvc2UgdmFsdWUgZmFsbHMgaW4gdGhlIHwKLXwgICAgICAgICAgICAgcmFuZ2UgOiAweGZmZmYgODAwMCA8PSB2YXIxIDw9IDB4MDAwMCA3ZmZmLiAgICAgICAgICAgICAgICAgICB8Ci18ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfAotfCAgIE91dHB1dHMgOiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwKLXwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8Ci18ICAgIG5vbmUgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfAotfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwKLXwgICBSZXR1cm4gVmFsdWUgOiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8Ci18ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfAotfCAgICBMX3Zhcl9vdXQgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwKLXwgICAgICAgICAgICAgMzIgYml0IGxvbmcgc2lnbmVkIGludGVnZXIgKFdvcmQzMikgd2hvc2UgdmFsdWUgZmFsbHMgaW4gdGhlICB8Ci18ICAgICAgICAgICAgIHJhbmdlIDogMHg4MDAwIDAwMDAgPD0gTF92YXJfb3V0IDw9IDB4N2ZmZiBmZmZmLiAgICAgICAgICAgICAgfAotfF9fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX3wKLSovCi0KLXN0YXRpY192byBXb3JkMzIgTF9tYWMgKFdvcmQzMiBMX3ZhcjMsIFdvcmQxNiB2YXIxLCBXb3JkMTYgdmFyMikKLXsKLQlXb3JkMzIgTF92YXJfb3V0OwotCVdvcmQzMiBMX3Byb2R1Y3Q7Ci0JTF9wcm9kdWN0ID0gKCh2YXIxICogdmFyMikgPDwgMSk7Ci0JTF92YXJfb3V0ID0gTF9hZGQgKExfdmFyMywgTF9wcm9kdWN0KTsKLQlyZXR1cm4gKExfdmFyX291dCk7Ci19Ci0KLS8qX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fCi18ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfAotfCAgIEZ1bmN0aW9uIE5hbWUgOiBMX21zdSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwKLXwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8Ci18ICAgUHVycG9zZSA6ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfAotfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwKLXwgICBNdWx0aXBseSB2YXIxIGJ5IHZhcjIgYW5kIHNoaWZ0IHRoZSByZXN1bHQgbGVmdCBieSAxLiBTdWJ0cmFjdCB0aGUgMzIgICB8Ci18ICAgYml0IHJlc3VsdCB0byBMX3ZhcjMgd2l0aCBzYXR1cmF0aW9uLCByZXR1cm4gYSAzMiBiaXQgcmVzdWx0OiAgICAgICAgICAgfAotfCAgICAgICAgTF9tc3UoTF92YXIzLHZhcjEsdmFyMikgPSBMX3N1YihMX3ZhcjMsTF9tdWx0KHZhcjEsdmFyMikpLiAgICAgICAgIHwKLXwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8Ci18ICAgQ29tcGxleGl0eSB3ZWlnaHQgOiAxICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfAotfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwKLXwgICBJbnB1dHMgOiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8Ci18ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfAotfCAgICBMX3ZhcjMgICAzMiBiaXQgbG9uZyBzaWduZWQgaW50ZWdlciAoV29yZDMyKSB3aG9zZSB2YWx1ZSBmYWxscyBpbiB0aGUgIHwKLXwgICAgICAgICAgICAgcmFuZ2UgOiAweDgwMDAgMDAwMCA8PSBMX3ZhcjMgPD0gMHg3ZmZmIGZmZmYuICAgICAgICAgICAgICAgICB8Ci18ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfAotfCAgICB2YXIxICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwKLXwgICAgICAgICAgICAgMTYgYml0IHNob3J0IHNpZ25lZCBpbnRlZ2VyIChXb3JkMTYpIHdob3NlIHZhbHVlIGZhbGxzIGluIHRoZSB8Ci18ICAgICAgICAgICAgIHJhbmdlIDogMHhmZmZmIDgwMDAgPD0gdmFyMSA8PSAweDAwMDAgN2ZmZi4gICAgICAgICAgICAgICAgICAgfAotfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwKLXwgICAgdmFyMiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8Ci18ICAgICAgICAgICAgIDE2IGJpdCBzaG9ydCBzaWduZWQgaW50ZWdlciAoV29yZDE2KSB3aG9zZSB2YWx1ZSBmYWxscyBpbiB0aGUgfAotfCAgICAgICAgICAgICByYW5nZSA6IDB4ZmZmZiA4MDAwIDw9IHZhcjEgPD0gMHgwMDAwIDdmZmYuICAgICAgICAgICAgICAgICAgIHwKLXwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8Ci18ICAgT3V0cHV0cyA6ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfAotfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwKLXwgICAgbm9uZSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8Ci18ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfAotfCAgIFJldHVybiBWYWx1ZSA6ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwKLXwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8Ci18ICAgIExfdmFyX291dCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfAotfCAgICAgICAgICAgICAzMiBiaXQgbG9uZyBzaWduZWQgaW50ZWdlciAoV29yZDMyKSB3aG9zZSB2YWx1ZSBmYWxscyBpbiB0aGUgIHwKLXwgICAgICAgICAgICAgcmFuZ2UgOiAweDgwMDAgMDAwMCA8PSBMX3Zhcl9vdXQgPD0gMHg3ZmZmIGZmZmYuICAgICAgICAgICAgICB8Ci18X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19ffAotKi8KLQotc3RhdGljX3ZvIFdvcmQzMiBMX21zdSAoV29yZDMyIExfdmFyMywgV29yZDE2IHZhcjEsIFdvcmQxNiB2YXIyKQotewotCVdvcmQzMiBMX3Zhcl9vdXQ7Ci0JV29yZDMyIExfcHJvZHVjdDsKLQlMX3Byb2R1Y3QgPSAodmFyMSAqIHZhcjIpPDwxOwotCUxfdmFyX291dCA9IExfc3ViIChMX3ZhcjMsIExfcHJvZHVjdCk7Ci0JcmV0dXJuIChMX3Zhcl9vdXQpOwotfQotCi0vKl9fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fXwotfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwKLXwgICBGdW5jdGlvbiBOYW1lIDogTF9hZGQgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8Ci18ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfAotfCAgIFB1cnBvc2UgOiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwKLXwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8Ci18ICAgMzIgYml0cyBhZGRpdGlvbiBvZiB0aGUgdHdvIDMyIGJpdHMgdmFyaWFibGVzIChMX3ZhcjErTF92YXIyKSB3aXRoICAgICAgfAotfCAgIG92ZXJmbG93IGNvbnRyb2wgYW5kIHNhdHVyYXRpb247IHRoZSByZXN1bHQgaXMgc2V0IGF0ICsyMTQ3NDgzNjQ3IHdoZW4gIHwKLXwgICBvdmVyZmxvdyBvY2N1cnMgb3IgYXQgLTIxNDc0ODM2NDggd2hlbiB1bmRlcmZsb3cgb2NjdXJzLiAgICAgICAgICAgICAgICB8Ci18ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfAotfCAgIENvbXBsZXhpdHkgd2VpZ2h0IDogMiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwKLXwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8Ci18ICAgSW5wdXRzIDogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfAotfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwKLXwgICAgTF92YXIxICAgMzIgYml0IGxvbmcgc2lnbmVkIGludGVnZXIgKFdvcmQzMikgd2hvc2UgdmFsdWUgZmFsbHMgaW4gdGhlICB8Ci18ICAgICAgICAgICAgIHJhbmdlIDogMHg4MDAwIDAwMDAgPD0gTF92YXIzIDw9IDB4N2ZmZiBmZmZmLiAgICAgICAgICAgICAgICAgfAotfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwKLXwgICAgTF92YXIyICAgMzIgYml0IGxvbmcgc2lnbmVkIGludGVnZXIgKFdvcmQzMikgd2hvc2UgdmFsdWUgZmFsbHMgaW4gdGhlICB8Ci18ICAgICAgICAgICAgIHJhbmdlIDogMHg4MDAwIDAwMDAgPD0gTF92YXIzIDw9IDB4N2ZmZiBmZmZmLiAgICAgICAgICAgICAgICAgfAotfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwKLXwgICBPdXRwdXRzIDogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8Ci18ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfAotfCAgICBub25lICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwKLXwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8Ci18ICAgUmV0dXJuIFZhbHVlIDogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfAotfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwKLXwgICAgTF92YXJfb3V0ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8Ci18ICAgICAgICAgICAgIDMyIGJpdCBsb25nIHNpZ25lZCBpbnRlZ2VyIChXb3JkMzIpIHdob3NlIHZhbHVlIGZhbGxzIGluIHRoZSAgfAotfCAgICAgICAgICAgICByYW5nZSA6IDB4ODAwMCAwMDAwIDw9IExfdmFyX291dCA8PSAweDdmZmYgZmZmZi4gICAgICAgICAgICAgIHwKLXxfX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX198Ci0qLwotCi1zdGF0aWNfdm8gV29yZDMyIExfYWRkIChXb3JkMzIgTF92YXIxLCBXb3JkMzIgTF92YXIyKQotewotCVdvcmQzMiBMX3Zhcl9vdXQ7Ci0JTF92YXJfb3V0ID0gTF92YXIxICsgTF92YXIyOwotCWlmICgoKExfdmFyMSBeIExfdmFyMikgJiBNSU5fMzIpID09IDApCi0JewotCQlpZiAoKExfdmFyX291dCBeIExfdmFyMSkgJiBNSU5fMzIpCi0JCXsKLQkJCUxfdmFyX291dCA9IChMX3ZhcjEgPCAwKSA/IE1JTl8zMiA6IE1BWF8zMjsKLQkJfQotCX0KLQlyZXR1cm4gKExfdmFyX291dCk7Ci19Ci0KLS8qX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fCi18ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfAotfCAgIEZ1bmN0aW9uIE5hbWUgOiBMX3N1YiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwKLXwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8Ci18ICAgUHVycG9zZSA6ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfAotfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwKLXwgICAzMiBiaXRzIHN1YnRyYWN0aW9uIG9mIHRoZSB0d28gMzIgYml0cyB2YXJpYWJsZXMgKExfdmFyMS1MX3ZhcjIpIHdpdGggICB8Ci18ICAgb3ZlcmZsb3cgY29udHJvbCBhbmQgc2F0dXJhdGlvbjsgdGhlIHJlc3VsdCBpcyBzZXQgYXQgKzIxNDc0ODM2NDcgd2hlbiAgfAotfCAgIG92ZXJmbG93IG9jY3VycyBvciBhdCAtMjE0NzQ4MzY0OCB3aGVuIHVuZGVyZmxvdyBvY2N1cnMuICAgICAgICAgICAgICAgIHwKLXwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8Ci18ICAgQ29tcGxleGl0eSB3ZWlnaHQgOiAyICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfAotfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwKLXwgICBJbnB1dHMgOiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8Ci18ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfAotfCAgICBMX3ZhcjEgICAzMiBiaXQgbG9uZyBzaWduZWQgaW50ZWdlciAoV29yZDMyKSB3aG9zZSB2YWx1ZSBmYWxscyBpbiB0aGUgIHwKLXwgICAgICAgICAgICAgcmFuZ2UgOiAweDgwMDAgMDAwMCA8PSBMX3ZhcjMgPD0gMHg3ZmZmIGZmZmYuICAgICAgICAgICAgICAgICB8Ci18ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfAotfCAgICBMX3ZhcjIgICAzMiBiaXQgbG9uZyBzaWduZWQgaW50ZWdlciAoV29yZDMyKSB3aG9zZSB2YWx1ZSBmYWxscyBpbiB0aGUgIHwKLXwgICAgICAgICAgICAgcmFuZ2UgOiAweDgwMDAgMDAwMCA8PSBMX3ZhcjMgPD0gMHg3ZmZmIGZmZmYuICAgICAgICAgICAgICAgICB8Ci18ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfAotfCAgIE91dHB1dHMgOiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwKLXwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8Ci18ICAgIG5vbmUgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfAotfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwKLXwgICBSZXR1cm4gVmFsdWUgOiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8Ci18ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfAotfCAgICBMX3Zhcl9vdXQgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwKLXwgICAgICAgICAgICAgMzIgYml0IGxvbmcgc2lnbmVkIGludGVnZXIgKFdvcmQzMikgd2hvc2UgdmFsdWUgZmFsbHMgaW4gdGhlICB8Ci18ICAgICAgICAgICAgIHJhbmdlIDogMHg4MDAwIDAwMDAgPD0gTF92YXJfb3V0IDw9IDB4N2ZmZiBmZmZmLiAgICAgICAgICAgICAgfAotfF9fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX3wKLSovCi0KLXN0YXRpY192byBXb3JkMzIgTF9zdWIgKFdvcmQzMiBMX3ZhcjEsIFdvcmQzMiBMX3ZhcjIpCi17Ci0JV29yZDMyIExfdmFyX291dDsKLQlMX3Zhcl9vdXQgPSBMX3ZhcjEgLSBMX3ZhcjI7Ci0JaWYgKCgoTF92YXIxIF4gTF92YXIyKSAmIE1JTl8zMikgIT0gMCkKLQl7Ci0JCWlmICgoTF92YXJfb3V0IF4gTF92YXIxKSAmIE1JTl8zMikKLQkJewotCQkJTF92YXJfb3V0ID0gKExfdmFyMSA8IDBMKSA/IE1JTl8zMiA6IE1BWF8zMjsKLQkJfQotCX0KLQlyZXR1cm4gKExfdmFyX291dCk7Ci19Ci0KLQotLypfX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX18KLXwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8Ci18ICAgRnVuY3Rpb24gTmFtZSA6IG11bHRfciAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfAotfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwKLXwgICBQdXJwb3NlIDogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8Ci18ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfAotfCAgIFNhbWUgYXMgbXVsdCB3aXRoIHJvdW5kaW5nLCBpLmUuOiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwKLXwgICAgIG11bHRfcih2YXIxLHZhcjIpID0gZXh0cmFjdF9sKExfc2hyKCgodmFyMSAqIHZhcjIpICsgMTYzODQpLDE1KSkgYW5kICB8Ci18ICAgICBtdWx0X3IoLTMyNzY4LC0zMjc2OCkgPSAzMjc2Ny4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfAotfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwKLXwgICBDb21wbGV4aXR5IHdlaWdodCA6IDIgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8Ci18ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfAotfCAgIElucHV0cyA6ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwKLXwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8Ci18ICAgIHZhcjEgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfAotfCAgICAgICAgICAgICAxNiBiaXQgc2hvcnQgc2lnbmVkIGludGVnZXIgKFdvcmQxNikgd2hvc2UgdmFsdWUgZmFsbHMgaW4gdGhlIHwKLXwgICAgICAgICAgICAgcmFuZ2UgOiAweGZmZmYgODAwMCA8PSB2YXIxIDw9IDB4MDAwMCA3ZmZmLiAgICAgICAgICAgICAgICAgICB8Ci18ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfAotfCAgICB2YXIyICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwKLXwgICAgICAgICAgICAgMTYgYml0IHNob3J0IHNpZ25lZCBpbnRlZ2VyIChXb3JkMTYpIHdob3NlIHZhbHVlIGZhbGxzIGluIHRoZSB8Ci18ICAgICAgICAgICAgIHJhbmdlIDogMHhmZmZmIDgwMDAgPD0gdmFyMSA8PSAweDAwMDAgN2ZmZi4gICAgICAgICAgICAgICAgICAgfAotfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwKLXwgICBPdXRwdXRzIDogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8Ci18ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfAotfCAgICBub25lICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwKLXwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8Ci18ICAgUmV0dXJuIFZhbHVlIDogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfAotfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwKLXwgICAgdmFyX291dCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8Ci18ICAgICAgICAgICAgIDE2IGJpdCBzaG9ydCBzaWduZWQgaW50ZWdlciAoV29yZDE2KSB3aG9zZSB2YWx1ZSBmYWxscyBpbiB0aGUgfAotfCAgICAgICAgICAgICByYW5nZSA6IDB4ZmZmZiA4MDAwIDw9IHZhcl9vdXQgPD0gMHgwMDAwIDdmZmYuICAgICAgICAgICAgICAgIHwKLXxfX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX198Ci0qLwotCi1zdGF0aWNfdm8gV29yZDE2IG11bHRfciAoV29yZDE2IHZhcjEsIFdvcmQxNiB2YXIyKQotewotCVdvcmQxNiB2YXJfb3V0OwotCVdvcmQzMiBMX3Byb2R1Y3RfYXJyOwotCUxfcHJvZHVjdF9hcnIgPSAoV29yZDMyKSB2YXIxICooV29yZDMyKSB2YXIyOyAgICAgICAvKiBwcm9kdWN0ICovCi0JTF9wcm9kdWN0X2FyciArPSAoV29yZDMyKSAweDAwMDA0MDAwTDsgICAgICAvKiByb3VuZCAqLwotCUxfcHJvZHVjdF9hcnIgJj0gKFdvcmQzMikgMHhmZmZmODAwMEw7Ci0JTF9wcm9kdWN0X2FyciA+Pj0gMTU7ICAgICAgIC8qIHNoaWZ0ICovCi0JaWYgKExfcHJvZHVjdF9hcnIgJiAoV29yZDMyKSAweDAwMDEwMDAwTCkgICAvKiBzaWduIGV4dGVuZCB3aGVuIG5lY2Vzc2FyeSAqLwotCXsKLQkJTF9wcm9kdWN0X2FyciB8PSAoV29yZDMyKSAweGZmZmYwMDAwTDsKLQl9Ci0JdmFyX291dCA9IHNhdHVyYXRlIChMX3Byb2R1Y3RfYXJyKTsKLQlyZXR1cm4gKHZhcl9vdXQpOwotfQotCi0vKl9fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fXwotfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwKLXwgICBGdW5jdGlvbiBOYW1lIDogTF9zaGwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8Ci18ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfAotfCAgIFB1cnBvc2UgOiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwKLXwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8Ci18ICAgQXJpdGhtZXRpY2FsbHkgc2hpZnQgdGhlIDMyIGJpdCBpbnB1dCBMX3ZhcjEgbGVmdCB2YXIyIHBvc2l0aW9ucy4gWmVybyAgfAotfCAgIGZpbGwgdGhlIHZhcjIgTFNCIG9mIHRoZSByZXN1bHQuIElmIHZhcjIgaXMgbmVnYXRpdmUsIGFyaXRobWV0aWNhbGx5ICAgIHwKLXwgICBzaGlmdCBMX3ZhcjEgcmlnaHQgYnkgLXZhcjIgd2l0aCBzaWduIGV4dGVuc2lvbi4gU2F0dXJhdGUgdGhlIHJlc3VsdCBpbiB8Ci18ICAgY2FzZSBvZiB1bmRlcmZsb3dzIG9yIG92ZXJmbG93cy4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfAotfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwKLXwgICBDb21wbGV4aXR5IHdlaWdodCA6IDIgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8Ci18ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfAotfCAgIElucHV0cyA6ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwKLXwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8Ci18ICAgIExfdmFyMSAgIDMyIGJpdCBsb25nIHNpZ25lZCBpbnRlZ2VyIChXb3JkMzIpIHdob3NlIHZhbHVlIGZhbGxzIGluIHRoZSAgfAotfCAgICAgICAgICAgICByYW5nZSA6IDB4ODAwMCAwMDAwIDw9IExfdmFyMyA8PSAweDdmZmYgZmZmZi4gICAgICAgICAgICAgICAgIHwKLXwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8Ci18ICAgIHZhcjIgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfAotfCAgICAgICAgICAgICAxNiBiaXQgc2hvcnQgc2lnbmVkIGludGVnZXIgKFdvcmQxNikgd2hvc2UgdmFsdWUgZmFsbHMgaW4gdGhlIHwKLXwgICAgICAgICAgICAgcmFuZ2UgOiAweGZmZmYgODAwMCA8PSB2YXIxIDw9IDB4MDAwMCA3ZmZmLiAgICAgICAgICAgICAgICAgICB8Ci18ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfAotfCAgIE91dHB1dHMgOiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwKLXwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8Ci18ICAgIG5vbmUgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfAotfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwKLXwgICBSZXR1cm4gVmFsdWUgOiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8Ci18ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfAotfCAgICBMX3Zhcl9vdXQgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwKLXwgICAgICAgICAgICAgMzIgYml0IGxvbmcgc2lnbmVkIGludGVnZXIgKFdvcmQzMikgd2hvc2UgdmFsdWUgZmFsbHMgaW4gdGhlICB8Ci18ICAgICAgICAgICAgIHJhbmdlIDogMHg4MDAwIDAwMDAgPD0gTF92YXJfb3V0IDw9IDB4N2ZmZiBmZmZmLiAgICAgICAgICAgICAgfAotfF9fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX3wKLSovCi0KLXN0YXRpY192byBXb3JkMzIgTF9zaGwgKFdvcmQzMiBMX3ZhcjEsIFdvcmQxNiB2YXIyKQotewotCVdvcmQzMiBMX3Zhcl9vdXQgPSAwTDsKLQlpZiAodmFyMiA8PSAwKQotCXsKLQkJaWYgKHZhcjIgPCAtMzIpCi0JCQl2YXIyID0gLTMyOwotCQlMX3Zhcl9vdXQgPSAoTF92YXIxID4+IChXb3JkMTYpLXZhcjIpOwotCX0KLQllbHNlCi0JewotCQlmb3IgKDsgdmF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gICAgICAgICAgICAgICAgICAgICAgICB8Ci18ICAgRnVuY3Rpb24gTmFtZSA6IExfc2hyICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfAotfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwKLXwgICBQdXJwb3NlIDogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8Ci18ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfAotfCAgIEFyaXRobWV0aWNhbGx5IHNoaWZ0IHRoZSAzMiBiaXQgaW5wdXQgTF92YXIxIHJpZ2h0IHZhcjIgcG9zaXRpb25zIHdpdGggIHwKLXwgICBzaWduIGV4dGVuc2lvbi4gSWYgdmFyMiBpcyBuZWdhdGl2ZSwgYXJpdGhtZXRpY2FsbHkgc2hpZnQgTF92YXIxIGxlZnQgICB8Ci18ICAgYnkgLXZhcjIgYW5kIHplcm8gZmlsbCB0aGUgLXZhcjIgTFNCIG9mIHRoZSByZXN1bHQuIFNhdHVyYXRlIHRoZSByZXN1bHQgfAotfCAgIGluIGNhc2Ugb2YgdW5kZXJmbG93cyBvciBvdmVyZmxvd3MuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwKLXwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8Ci18ICAgQ29tcGxleGl0eSB3ZWlnaHQgOiAyICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfAotfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwKLXwgICBJbnB1dHMgOiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8Ci18ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfAotfCAgICBMX3ZhcjEgICAzMiBiaXQgbG9uZyBzaWduZWQgaW50ZWdlciAoV29yZDMyKSB3aG9zZSB2YWx1ZSBmYWxscyBpbiB0aGUgIHwKLXwgICAgICAgICAgICAgcmFuZ2UgOiAweDgwMDAgMDAwMCA8PSBMX3ZhcjMgPD0gMHg3ZmZmIGZmZmYuICAgICAgICAgICAgICAgICB8Ci18ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfAotfCAgICB2YXIyICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwKLXwgICAgICAgICAgICAgMTYgYml0IHNob3J0IHNpZ25lZCBpbnRlZ2VyIChXb3JkMTYpIHdob3NlIHZhbHVlIGZhbGxzIGluIHRoZSB8Ci18ICAgICAgICAgICAgIHJhbmdlIDogMHhmZmZmIDgwMDAgPD0gdmFyMSA8PSAweDAwMDAgN2ZmZi4gICAgICAgICAgICAgICAgICAgfAotfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwKLXwgICBPdXRwdXRzIDogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8Ci18ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfAotfCAgICBub25lICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwKLXwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8Ci18ICAgUmV0dXJuIFZhbHVlIDogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfAotfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwKLXwgICAgTF92YXJfb3V0ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8Ci18ICAgICAgICAgICAgIDMyIGJpdCBsb25nIHNpZ25lZCBpbnRlZ2VyIChXb3JkMzIpIHdob3NlIHZhbHVlIGZhbGxzIGluIHRoZSAgfAotfCAgICAgICAgICAgICByYW5nZSA6IDB4ODAwMCAwMDAwIDw9IExfdmFyX291dCA8PSAweDdmZmYgZmZmZi4gICAgICAgICAgICAgIHwKLXxfX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX198Ci0qLwotCi1zdGF0aWNfdm8gV29yZDMyIExfc2hyIChXb3JkMzIgTF92YXIxLCBXb3JkMTYgdmFyMikKLXsKLQlXb3JkMzIgTF92YXJfb3V0OwotCWlmICh2YXIyIDwgMCkKLQl7Ci0JCWlmICh2YXIyIDwgLTMyKQotCQkJdmFyMiA9IC0zMjsKLQkJTF92YXJfb3V0ID0gTF9zaGwyKExfdmFyMSwgKFdvcmQxNiktdmFyMik7Ci0JfQotCWVsc2UKLQl7Ci0JCWlmICh2YXIyID49IDMxKQotCQl7Ci0JCQlMX3Zhcl9vdXQgPSAoTF92YXIxIDwgMEwpID8gLTEgOiAwOwotCQl9Ci0JCWVsc2UKLQkJewotCQkJaWYgKExfdmFyMSA8IDApCi0JCQl7Ci0JCQkJTF92YXJfb3V0ID0gfigofkxfdmFyMSkgPj4gdmFyMik7Ci0JCQl9Ci0JCQllbHNlCi0JCQl7Ci0JCQkJTF92YXJfb3V0ID0gTF92YXIxID4+IHZhcjI7Ci0JCQl9Ci0JCX0KLQl9Ci0JcmV0dXJuIChMX3Zhcl9vdXQpOwotfQotCi0vKl9fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fXwotfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwKLXwgICBGdW5jdGlvbiBOYW1lIDogTF9zaHJfciAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8Ci18ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfAotfCAgIFB1cnBvc2UgOiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwKLXwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8Ci18ICAgU2FtZSBhcyBMX3NocihMX3ZhcjEsdmFyMikgYnV0IHdpdGggcm91bmRpbmcuIFNhdHVyYXRlIHRoZSByZXN1bHQgaW4gICAgfAotfCAgIGNhc2Ugb2YgdW5kZXJmbG93cyBvciBvdmVyZmxvd3MgOiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwKLXwgICAgLSBJZiB2YXIyIGlzIGdyZWF0ZXIgdGhhbiB6ZXJvIDogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8Ci18ICAgICAgICAgIGlmIChMX3N1YihMX3NobChMX3NocihMX3ZhcjEsdmFyMiksMSksTF9zaHIoTF92YXIxLHN1Yih2YXIyLDEpKSkpfAotfCAgICAgICAgICBpcyBlcXVhbCB0byB6ZXJvICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwKLXwgICAgICAgICAgICAgICAgICAgICB0aGVuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8Ci18ICAgICAgICAgICAgICAgICAgICAgTF9zaHJfcihMX3ZhcjEsdmFyMikgPSBMX3NocihMX3ZhcjEsdmFyMikgICAgICAgICAgICAgfAotfCAgICAgICAgICAgICAgICAgICAgIGVsc2UgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwKLXwgICAgICAgICAgICAgICAgICAgICBMX3Nocl9yKExfdmFyMSx2YXIyKSA9IExfYWRkKExfc2hyKExfdmFyMSx2YXIyKSwxKSAgICB8Ci18ICAgIC0gSWYgdmFyMiBpcyBsZXNzIHRoYW4gb3IgZXF1YWwgdG8gemVybyA6ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfAotfCAgICAgICAgICAgICAgICAgICAgIExfc2hyX3IoTF92YXIxLHZhcjIpID0gTF9zaHIoTF92YXIxLHZhcjIpLiAgICAgICAgICAgIHwKLXwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8Ci18ICAgQ29tcGxleGl0eSB3ZWlnaHQgOiAzICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfAotfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwKLXwgICBJbnB1dHMgOiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8Ci18ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfAotfCAgICBMX3ZhcjEgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwKLXwgICAgICAgICAgICAgMzIgYml0IGxvbmcgc2lnbmVkIGludGVnZXIgKFdvcmQzMikgd2hvc2UgdmFsdWUgZmFsbHMgaW4gdGhlICB8Ci18ICAgICAgICAgICAgIHJhbmdlIDogMHg4MDAwIDAwMDAgPD0gdmFyMSA8PSAweDdmZmYgZmZmZi4gICAgICAgICAgICAgICAgICAgfAotfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwKLXwgICAgdmFyMiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8Ci18ICAgICAgICAgICAgIDE2IGJpdCBzaG9ydCBzaWduZWQgaW50ZWdlciAoV29yZDE2KSB3aG9zZSB2YWx1ZSBmYWxscyBpbiB0aGUgfAotfCAgICAgICAgICAgICByYW5nZSA6IDB4ZmZmZiA4MDAwIDw9IHZhcjEgPD0gMHgwMDAwIDdmZmYuICAgICAgICAgICAgICAgICAgIHwKLXwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8Ci18ICAgT3V0cHV0cyA6ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfAotfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwKLXwgICAgbm9uZSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8Ci18ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfAotfCAgIFJldHVybiBWYWx1ZSA6ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwKLXwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8Ci18ICAgIExfdmFyX291dCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfAotfCAgICAgICAgICAgICAzMiBiaXQgbG9uZyBzaWduZWQgaW50ZWdlciAoV29yZDMyKSB3aG9zZSB2YWx1ZSBmYWxscyBpbiB0aGUgIHwKLXwgICAgICAgICAgICAgcmFuZ2UgOiAweDgwMDAgMDAwMCA8PSB2YXJfb3V0IDw9IDB4N2ZmZiBmZmZmLiAgICAgICAgICAgICAgICB8Ci18X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19ffAotKi8KLQotc3RhdGljX3ZvIFdvcmQzMiBMX3Nocl9yIChXb3JkMzIgTF92YXIxLCBXb3JkMTYgdmFyMikKLXsKLQlXb3JkMzIgTF92YXJfb3V0OwotCWlmICh2YXIyID4gMzEpCi0JewotCQlMX3Zhcl9vdXQgPSAwOwotCX0KLQllbHNlCi0JewotCQlMX3Zhcl9vdXQgPSBMX3NociAoTF92YXIxLCB2YXIyKTsKLQkJaWYgKHZhcjIgPiAwKQotCQl7Ci0JCQlpZiAoKExfdmFyMSAmICgoV29yZDMyKSAxIDw8ICh2YXIyIC0gMSkpKSAhPSAwKQotCQkJewotCQkJCUxfdmFyX291dCsrOwotCQkJfQotCQl9Ci0JfQotCXJldHVybiAoTF92YXJfb3V0KTsKLX0KLQotLypfX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX18KLXwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8Ci18ICAgRnVuY3Rpb24gTmFtZSA6IG5vcm1fcyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfAotfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwKLXwgICBQdXJwb3NlIDogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8Ci18ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfAotfCAgIFByb2R1Y2VzIHRoZSBudW1iZXIgb2YgbGVmdCBzaGlmdCBuZWVkZWQgdG8gbm9ybWFsaXplIHRoZSAxNiBiaXQgdmFyaWEtIHwKLXwgICBibGUgdmFyMSBmb3IgcG9zaXRpdmUgdmFsdWVzIG9uIHRoZSBpbnRlcnZhbCB3aXRoIG1pbmltdW0gb2YgMTYzODQgYW5kICB8Ci18ICAgbWF4aW11bSBvZiAzMjc2NywgYW5kIGZvciBuZWdhdGl2ZSB2YWx1ZXMgb24gdGhlIGludGVydmFsIHdpdGggbWluaW11bSAgfAotfCAgIG9mIC0zMjc2OCBhbmQgbWF4aW11bSBvZiAtMTYzODQ7IGluIG9yZGVyIHRvIG5vcm1hbGl6ZSB0aGUgcmVzdWx0LCB0aGUgIHwKLXwgICBmb2xsb3dpbmcgb3BlcmF0aW9uIG11c3QgYmUgZG9uZSA6ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8Ci18ICAgICAgICAgICAgICAgICAgICBub3JtX3ZhcjEgPSBzaGwodmFyMSxub3JtX3ModmFyMSkpLiAgICAgICAgICAgICAgICAgICAgfAotfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwKLXwgICBDb21wbGV4aXR5IHdlaWdodCA6IDE1ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8Ci18ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfAotfCAgIElucHV0cyA6ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwKLXwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8Ci18ICAgIHZhcjEgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfAotfCAgICAgICAgICAgICAxNiBiaXQgc2hvcnQgc2lnbmVkIGludGVnZXIgKFdvcmQxNikgd2hvc2UgdmFsdWUgZmFsbHMgaW4gdGhlIHwKLXwgICAgICAgICAgICAgcmFuZ2UgOiAweGZmZmYgODAwMCA8PSB2YXIxIDw9IDB4MDAwMCA3ZmZmLiAgICAgICAgICAgICAgICAgICB8Ci18ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfAotfCAgIE91dHB1dHMgOiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwKLXwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8Ci18ICAgIG5vbmUgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfAotfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwKLXwgICBSZXR1cm4gVmFsdWUgOiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8Ci18ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfAotfCAgICB2YXJfb3V0ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwKLXwgICAgICAgICAgICAgMTYgYml0IHNob3J0IHNpZ25lZCBpbnRlZ2VyIChXb3JkMTYpIHdob3NlIHZhbHVlIGZhbGxzIGluIHRoZSB8Ci18ICAgICAgICAgICAgIHJhbmdlIDogMHgwMDAwIDAwMDAgPD0gdmFyX291dCA8PSAweDAwMDAgMDAwZi4gICAgICAgICAgICAgICAgfAotfF9fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX3wKLSovCi0KLXN0YXRpY192byBXb3JkMTYgbm9ybV9zIChXb3JkMTYgdmFyMSkKLXsKLQlXb3JkMTYgdmFyX291dCA9IDA7Ci0JaWYgKHZhcjEgPT0gMCkKLQl7Ci0JCXZhcl9vdXQgPSAwOwotCX0KLQllbHNlCi0JewotCQlpZiAodmFyMSA9PSAtMSkKLQkJewotCQkJdmFyX291dCA9IDE1OwotCQl9Ci0JCWVsc2UKLQkJewotCQkJaWYgKHZhcjEgPCAwKQotCQkJewotCQkJCXZhcjEgPSAoV29yZDE2KX52YXIxOwotCQkJfQotCQkJZm9yICh2YXJfb3V0ID0gMDsgdmFyMSA8IDB4NDAwMDsgdmFyX291dCsrKQotCQkJewotCQkJCXZhcjEgPDw9IDE7Ci0JCQl9Ci0JCX0KLQl9Ci0JcmV0dXJuICh2YXJfb3V0KTsKLX0KLQotLypfX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX18KLXwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8Ci18ICAgRnVuY3Rpb24gTmFtZSA6IGRpdl9zICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfAotfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwKLXwgICBQdXJwb3NlIDogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8Ci18ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfAotfCAgIFByb2R1Y2VzIGEgcmVzdWx0IHdoaWNoIGlzIHRoZSBmcmFjdGlvbmFsIGludGVnZXIgZGl2aXNpb24gb2YgdmFyMSAgYnkgIHwKLXwgICB2YXIyOyB2YXIxIGFuZCB2YXIyIG11c3QgYmUgcG9zaXRpdmUgYW5kIHZhcjIgbXVzdCBiZSBncmVhdGVyIG9yIGVxdWFsICB8Ci18ICAgdG8gdmFyMTsgdGhlIHJlc3VsdCBpcyBwb3NpdGl2ZSAobGVhZGluZyBiaXQgZXF1YWwgdG8gMCkgYW5kIHRydW5jYXRlZCAgfAotfCAgIHRvIDE2IGJpdHMuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwKLXwgICBJZiB2YXIxID0gdmFyMiB0aGVuIGRpdih2YXIxLHZhcjIpID0gMzI3NjcuICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8Ci18ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfAotfCAgIENvbXBsZXhpdHkgd2VpZ2h0IDogMTggICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwKLXwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8Ci18ICAgSW5wdXRzIDogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfAotfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwKLXwgICAgdmFyMSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8Ci18ICAgICAgICAgICAgIDE2IGJpdCBzaG9ydCBzaWduZWQgaW50ZWdlciAoV29yZDE2KSB3aG9zZSB2YWx1ZSBmYWxscyBpbiB0aGUgfAotfCAgICAgICAgICAgICByYW5nZSA6IDB4MDAwMCAwMDAwIDw9IHZhcjEgPD0gdmFyMiBhbmQgdmFyMiAhPSAwLiAgICAgICAgICAgIHwKLXwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8Ci18ICAgIHZhcjIgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfAotfCAgICAgICAgICAgICAxNiBiaXQgc2hvcnQgc2lnbmVkIGludGVnZXIgKFdvcmQxNikgd2hvc2UgdmFsdWUgZmFsbHMgaW4gdGhlIHwKLXwgICAgICAgICAgICAgcmFuZ2UgOiB2YXIxIDw9IHZhcjIgPD0gMHgwMDAwIDdmZmYgYW5kIHZhcjIgIT0gMC4gICAgICAgICAgICB8Ci18ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfAotfCAgIE91dHB1dHMgOiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwKLXwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8Ci18ICAgIG5vbmUgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfAotfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwKLXwgICBSZXR1cm4gVmFsdWUgOiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8Ci18ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfAotfCAgICB2YXJfb3V0ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwKLXwgICAgICAgICAgICAgMTYgYml0IHNob3J0IHNpZ25lZCBpbnRlZ2VyIChXb3JkMTYpIHdob3NlIHZhbHVlIGZhbGxzIGluIHRoZSB8Ci18ICAgICAgICAgICAgIHJhbmdlIDogMHgwMDAwIDAwMDAgPD0gdmFyX291dCA8PSAweDAwMDAgN2ZmZi4gICAgICAgICAgICAgICAgfAotfCAgICAgICAgICAgICBJdCdzIGEgUTE1IHZhbHVlIChwb2ludCBiZXR3ZWVuIGIxNSBhbmQgYjE0KS4gICAgICAgICAgICAgICAgIHwKLXxfX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX198Ci0qLwotCi1zdGF0aWNfdm8gV29yZDE2IGRpdl9zIChXb3JkMTYgdmFyMSwgV29yZDE2IHZhcjIpCi17Ci0JV29yZDE2IHZhcl9vdXQgPSAwOwotCVdvcmQxNiBpdGVyYXRpb247Ci0JV29yZDMyIExfbnVtOwotCVdvcmQzMiBMX2Rlbm9tOwotCWlmICgodmFyMSA8IDApIHx8ICh2YXIyIDwgMCkpCi0JewotCQl2YXJfb3V0ID0gTUFYXzE2OwotCQlyZXR1cm4gdmFyX291dDsKLQl9Ci0JaWYgKHZhcjIgPT0gMCkKLQl7Ci0JCXZhcl9vdXQgPSBNQVhfMTY7Ci0JCXJldHVybiB2YXJfb3V0OwotCX0KLQlpZiAodmFyMSA9PSAwKQotCXsKLQkJdmFyX291dCA9IDA7Ci0JfQotCWVsc2UKLQl7Ci0JCWlmICh2YXIxID09IHZhcjIpCi0JCXsKLQkJCXZhcl9vdXQgPSBNQVhfMTY7Ci0JCX0KLQkJZWxzZQotCQl7Ci0JCQlMX251bSA9IExfZGVwb3NpdF9sICh2YXIxKTsKLQkJCUxfZGVub20gPSBMX2RlcG9zaXRfbCh2YXIyKTsKLQkJCWZvciAoaXRlcmF0aW9uID0gMDsgaXRlcmF0aW9uIDwgMTU7IGl0ZXJhdGlvbisrKQotCQkJewotCQkJCXZhcl9vdXQgPDw9IDE7Ci0JCQkJTF9udW0gPDw9IDE7Ci0JCQkJaWYgKExfbnVtID49IExfZGVub20pCi0JCQkJewotCQkJCQlMX251bSAtPSBMX2Rlbm9tOwotCQkJCQl2YXJfb3V0ICs9IDE7Ci0JCQkJfQotCQkJfQotCQl9Ci0JfQotCXJldHVybiAodmFyX291dCk7Ci19Ci0KLS8qX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fCi18ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfAotfCAgIEZ1bmN0aW9uIE5hbWUgOiBub3JtX2wgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwKLXwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8Ci18ICAgUHVycG9zZSA6ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfAotfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwKLXwgICBQcm9kdWNlcyB0aGUgbnVtYmVyIG9mIGxlZnQgc2hpZnRzIG5lZWRlZCB0byBub3JtYWxpemUgdGhlIDMyIGJpdCB2YXJpYS18Ci18ICAgYmxlIExfdmFyMSBmb3IgcG9zaXRpdmUgdmFsdWVzIG9uIHRoZSBpbnRlcnZhbCB3aXRoIG1pbmltdW0gb2YgICAgICAgICAgfAotfCAgIDEwNzM3NDE4MjQgYW5kIG1heGltdW0gb2YgMjE0NzQ4MzY0NywgYW5kIGZvciBuZWdhdGl2ZSB2YWx1ZXMgb24gdGhlIGluLXwKLXwgICB0ZXJ2YWwgd2l0aCBtaW5pbXVtIG9mIC0yMTQ3NDgzNjQ4IGFuZCBtYXhpbXVtIG9mIC0xMDczNzQxODI0OyBpbiBvcmRlciB8Ci18ICAgdG8gbm9ybWFsaXplIHRoZSByZXN1bHQsIHRoZSBmb2xsb3dpbmcgb3BlcmF0aW9uIG11c3QgYmUgZG9uZSA6ICAgICAgICAgfAotfCAgICAgICAgICAgICAgICAgICBub3JtX0xfdmFyMSA9IExfc2hsKExfdmFyMSxub3JtX2woTF92YXIxKSkuICAgICAgICAgICAgIHwKLXwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8Ci18ICAgQ29tcGxleGl0eSB3ZWlnaHQgOiAzMCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfAotfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwKLXwgICBJbnB1dHMgOiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8Ci18ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfAotfCAgICBMX3ZhcjEgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwKLXwgICAgICAgICAgICAgMzIgYml0IGxvbmcgc2lnbmVkIGludGVnZXIgKFdvcmQzMikgd2hvc2UgdmFsdWUgZmFsbHMgaW4gdGhlICB8Ci18ICAgICAgICAgICAgIHJhbmdlIDogMHg4MDAwIDAwMDAgPD0gdmFyMSA8PSAweDdmZmYgZmZmZi4gICAgICAgICAgICAgICAgICAgfAotfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwKLXwgICBPdXRwdXRzIDogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8Ci18ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfAotfCAgICBub25lICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwKLXwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8Ci18ICAgUmV0dXJuIFZhbHVlIDogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfAotfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwKLXwgICAgdmFyX291dCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8Ci18ICAgICAgICAgICAgIDE2IGJpdCBzaG9ydCBzaWduZWQgaW50ZWdlciAoV29yZDE2KSB3aG9zZSB2YWx1ZSBmYWxscyBpbiB0aGUgfAotfCAgICAgICAgICAgICByYW5nZSA6IDB4MDAwMCAwMDAwIDw9IHZhcl9vdXQgPD0gMHgwMDAwIDAwMWYuICAgICAgICAgICAgICAgIHwKLXxfX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX198Ci0qLwotCi1zdGF0aWNfdm8gV29yZDE2IG5vcm1fbCAoV29yZDMyIExfdmFyMSkKLXsKLQlXb3JkMTYgdmFyX291dCA9IDA7Ci0JaWYgKExfdmFyMSAhPSAwKQotCXsKLQkJdmFyX291dCA9IDMxOwotCQlpZiAoTF92YXIxICE9IChXb3JkMzIpIDB4ZmZmZmZmZmZMKQotCQl7Ci0JCQlMX3ZhcjEgXj0gKExfdmFyMSA+PjMxKTsKLQkJCWZvciAodmFyX291dCA9IDA7IExfdmFyMSA8IChXb3JkMzIpIDB4NDAwMDAwMDBMOyB2YXJfb3V0KyspCi0JCQl7Ci0JCQkJTF92YXIxIDw8PSAxOwotCQkJfQotCQl9Ci0JfQotCXJldHVybiAodmFyX291dCk7Ci19Ci0KLSNlbmRpZiAvL19fQkFTSUNfT1BfSF9fCi0KZGlmZiAtLWdpdCBhL21lZGlhL2xpYnN0YWdlZnJpZ2h0L2NvZGVjcy9hbXJ3YmVuYy9pbmMvYml0cy5oIGIvbWVkaWEvbGlic3RhZ2VmcmlnaHQvY29kZWNzL2FtcndiZW5jL2luYy9iaXRzLmgKZGVsZXRlZCBmaWx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0tLS0tLSovCi0KLSNpZm5kZWYgX19DTlNUX0hfXwotI2RlZmluZSBfX0NOU1RfSF9fCi0KLSNkZWZpbmUgTF9GUkFNRTE2ayAgIDMyMCAgICAgICAgICAgICAgICAgICAvKiBGcmFtZSBzaXplIGF0IDE2a0h6ICAgICAgICAgICAgICAgICAgICAgICAgKi8KLSNkZWZpbmUgTF9GUkFNRSAgICAgIDI1NiAgICAgICAgICAgICAgICAgICAvKiBGcmFtZSBzaXplICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLSNkZWZpbmUgTF9TVUJGUjE2ayAgIDgwICAgICAgICAgICAgICAgICAgICAvKiBTdWJmcmFtZSBzaXplIGF0IDE2a0h6ICAgICAgICAgICAgICAgICAgICAgKi8KLQotI2RlZmluZSBMX1NVQkZSICAgICAgNjQgICAgICAgICAgICAgICAgICAgIC8qIFN1YmZyYW1lIHNpemUgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotI2RlZmluZSBOQl9TVUJGUiAgICAgNCAgICAgICAgICAgICAgICAgICAgIC8qIE51bWJlciBvZiBzdWJmcmFtZSBwZXIgZnJhbWUgICAgICAgICAgICAgICAqLwotCi0jZGVmaW5lIExfTkVYVCAgICAgICA2NCAgICAgICAgICAgICAgICAgICAgLyogT3ZlcmhlYWQgaW4gTFAgYW5hbHlzaXMgICAgICAgICAgICAgICAgICAgICovCi0jZGVmaW5lIExfV0lORE9XICAgICAzODQgICAgICAgICAgICAgICAgICAgLyogd2luZG93IHNpemUgaW4gTFAgYW5hbHlzaXMgICAgICAgICAgICAgICAgICovCi0jZGVmaW5lIExfVE9UQUwgICAgICAzODQgICAgICAgICAgICAgICAgICAgLyogVG90YWwgc2l6ZSBvZiBzcGVlY2ggYnVmZmVyLiAgICAgICAgICAgICAgICovCi0jZGVmaW5lIE0gICAgICAgICAgICAxNiAgICAgICAgICAgICAgICAgICAgLyogT3JkZXIgb2YgTFAgZmlsdGVyICAgICAgICAgICAgICAgICAgICAgICAgICovCi0jZGVmaW5lIE0xNmsgICAgICAgICAyMAotCi0jZGVmaW5lIExfRklMVDE2ayAgICAxNSAgICAgICAgICAgICAgICAgICAgLyogRGVsYXkgb2YgZG93bi1zYW1wbGluZyBmaWx0ZXIgICAgICAgICAgICAgICovCi0jZGVmaW5lIExfRklMVCAgICAgICAxMiAgICAgICAgICAgICAgICAgICAgLyogRGVsYXkgb2YgdXAtc2FtcGxpbmcgZmlsdGVyICAgICAgICAgICAgICAgICovCi0KLSNkZWZpbmUgR1BfQ0xJUCAgICAgIDE1NTY1ICAgICAgICAgICAgICAgICAvKiBQaXRjaCBnYWluIGNsaXBwaW5nID0gMC45NSBRMTQgICAgICAgICAgICAgKi8KLSNkZWZpbmUgUElUX1NIQVJQICAgIDI3ODUzICAgICAgICAgICAgICAgICAvKiBwaXRjaCBzaGFycGVuaW5nIGZhY3RvciA9IDAuODUgUTE1ICAgICAgICAgKi8KLQotI2RlZmluZSBQSVRfTUlOICAgICAgMzQgICAgICAgICAgICAgICAgICAgIC8qIE1pbmltdW0gcGl0Y2ggbGFnIHdpdGggcmVzb2x1dGlvbiAxLzQgICAgICAqLwotI2RlZmluZSBQSVRfRlIyICAgICAgMTI4ICAgICAgICAgICAgICAgICAgIC8qIE1pbmltdW0gcGl0Y2ggbGFnIHdpdGggcmVzb2x1dGlvbiAxLzIgICAgICAqLwotI2RlZmluZSBQSVRfRlIxXzliICAgMTYwICAgICAgICAgICAgICAgICAgIC8qIE1pbmltdW0gcGl0Y2ggbGFnIHdpdGggcmVzb2x1dGlvbiAxICAgICAgICAqLwotI2RlZmluZSBQSVRfRlIxXzhiICAgOTIgICAgICAgICAgICAgICAgICAgIC8qIE1pbmltdW0gcGl0Y2ggbGFnIHdpdGggcmVzb2x1dGlvbiAxICAgICAgICAqLwotI2RlZmluZSBQSVRfTUFYICAgICAgMjMxICAgICAgICAgICAgICAgICAgIC8qIE1heGltdW0gcGl0Y2ggbGFnICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotI2RlZmluZSBMX0lOVEVSUE9MICAgKDE2KzEpICAgICAgICAgICAgICAgIC8qIExlbmd0aCBvZiBmaWx0ZXIgZm9yIGludGVycG9sYXRpb24gICAgICAgICAqLwotCi0jZGVmaW5lIE9QTF9ERUNJTSAgICAyICAgICAgICAgICAgICAgICAgICAgLyogRGVjaW1hdGlvbiBpbiBvcGVuLWxvb3AgcGl0Y2ggYW5hbHlzaXMgICAgICovCi0KLSNkZWZpbmUgUFJFRU1QSF9GQUMgIDIyMjgyICAgICAgICAgICAgICAgICAvKiBwcmVlbXBoYXNpcyBmYWN0b3IgKDAuNjggaW4gUTE1KSAgICAgICAgICAgKi8KLSNkZWZpbmUgR0FNTUExICAgICAgIDMwMTQ3ICAgICAgICAgICAgICAgICAvKiBXZWlnaHRpbmcgZmFjdG9yIChudW1lcmF0b3IpICgwLjkyIGluIFExNSkgKi8KLSNkZWZpbmUgVElMVF9GQUMgICAgIDIyMjgyICAgICAgICAgICAgICAgICAvKiB0aWx0IGZhY3RvciAoZGVub21pbmF0b3IpICgwLjY4IGluIFExNSkgICAgKi8KLQotI2RlZmluZSBRX01BWCAgICAgICAgOCAgICAgICAgICAgICAgICAgICAgIC8qIHNjYWxpbmcgbWF4IGZvciBzaWduYWwgKHNlZSBzeW5fZmlsdF8zMikgICAqLwotCi0jZGVmaW5lIFJBTkRPTV9JTklUU0VFRCAgMjE4NDUgICAgICAgICAgICAgLyogb3duIHJhbmRvbSBpbml0IHZhbHVlICAgICAgICAgICAgICAgICAgICAgICovCi0KLSNkZWZpbmUgTF9NRUFOQlVGICAgICAgICAzCi0jZGVmaW5lIE9ORV9QRVJfTUVBTkJVRiAxMDkyMwotCi0jZGVmaW5lIE1PREVfN2sgICAgICAgMAotI2RlZmluZSBNT0RFXzlrICAgICAgIDEKLSNkZWZpbmUgTU9ERV8xMmsgICAgICAyCi0jZGVmaW5lIE1PREVfMTRrICAgICAgMwotI2RlZmluZSBNT0RFXzE2ayAgICAgIDQKLSNkZWZpbmUg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dvcmQxNiBpc3BvbGRfcVtNXTsgICAgICAgICAgICAgICAgICAgIC8qIHF1YW50aXplZCBvbGQgaXNwICovCi0gICAgV29yZDE2IHBhc3RfaXNmcVtNXTsgICAgICAgICAgICAgICAgICAgLyogcGFzdCBpc2YgcXVhbnRpemVyICovCi0gICAgV29yZDE2IG1lbV93c3A7ICAgICAgICAgICAgICAgICAgICAgICAgLyogd3NwIHZlY3RvciBtZW1vcnkgKi8KLSAgICBXb3JkMTYgbWVtX2RlY2ltMlszXTsgICAgICAgICAgICAgICAgICAvKiB3c3AgZGVjaW1hdGlvbiBmaWx0ZXIgbWVtb3J5ICovCi0gICAgV29yZDE2IG1lbV93MDsgICAgICAgICAgICAgICAgICAgICAgICAgLyogdGFyZ2V0IHZlY3RvciBtZW1vcnkgKi8KLSAgICBXb3JkMTYgbWVtX3N5bltNXTsgICAgICAgICAgICAgICAgICAgICAvKiBzeW50aGVzaXMgbWVtb3J5ICovCi0gICAgV29yZDE2IHRpbHRfY29kZTsgICAgICAgICAgICAgICAgICAgICAgLyogdGlsdCBvZiBjb2RlICovCi0gICAgV29yZDE2IG9sZF93c3BfbWF4OyAgICAgICAgICAgICAgICAgICAgLyogb2xkIHdzcCBtYXhpbXVtIHZhbHVlICovCi0gICAgV29yZDE2IG9sZF93c3Bfc2hpZnQ7ICAgICAgICAgICAgICAgICAgLyogb2xkIHdzcCBzaGlmdCAqLwotICAgIFdvcmQxNiBRX29sZDsgICAgICAgICAgICAgICAgICAgICAgICAgIC8qIG9sZCBzY2FsaW5nIGZhY3RvciAqLwotICAgIFdvcmQxNiBRX21heFsyXTsgICAgICAgICAgICAgICAgICAgICAgIC8qIG9sZCBtYXhpbXVtIHNjYWxpbmcgZmFjdG9yICovCi0gICAgV29yZDE2IGdwX2NsaXBbMl07ICAgICAgICAgICAgICAgICAgICAgLyogZ2FpbiBvZiBwaXRjaCBjbGlwcGluZyBtZW1vcnkgKi8KLSAgICBXb3JkMTYgcXVhX2dhaW5bNF07ICAg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mUgVFhfU1BFRUNIIDAKLSNkZWZpbmUgVFhfU0lEX0ZJUlNUIDEKLSNkZWZpbmUgVFhfU0lEX1VQREFURSAyCi0jZGVmaW5lIFRYX05PX0RBVEEgMwotCi0jZGVmaW5lIFJYX1NQRUVDSF9HT09EIDAKLSNkZWZpbmUgUlhfU1BFRUNIX1BST0JBQkxZX0RFR1JBREVEIDEKLSNkZWZpbmUgUlhfU1BFRUNIX0xPU1QgMgotI2RlZmluZSBSWF9TUEVFQ0hfQkFEIDMKLSNkZWZpbmUgUlhfU0lEX0ZJUlNUIDQKLSNkZWZpbmUgUlhfU0lEX1VQREFURSA1Ci0jZGVmaW5lIFJYX1NJRF9CQUQgNgotI2RlZmluZSBSWF9OT19EQVRBIDcKLQotLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCi0gKgotICogREVGSU5JVElPTiBPRiBEQVRBIFRZUEVTCi0gKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0KLVdvcmQxNiBkdHhfZW5jX2luaXQoZHR4X2VuY1N0YXRlICoqIHN0LCBXb3JkMTYgaXNmX2luaXRbXSwgVk9fTUVNX09QRVJBVE9SICpwTWVtT1ApOwotV29yZDE2IGR0eF9lbmNfcmVzZXQoZHR4X2VuY1N0YXRlICogc3QsIFdvcmQxNiBpc2ZfaW5pdFtdKTsKLXZvaWQgZHR4X2VuY19leGl0KGR0eF9lbmNTdGF0ZSAqKiBzdCwgVk9fTUVNX09QRVJBVE9SICpwTWVtT1ApOwotCi1Xb3JkMTYgZHR4X2VuYygKLSAgICAgZHR4X2VuY1N0YXRlICogc3QsICAgICAgICAgICAgICAgICAgICAvKiBpL28gOiBTdGF0ZSBzdHJ1Y3QgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0gICAgIFdvcmQxNiBpc2ZbTV0sICAgICAgICAgICAgICAgICAgICAgICAgLyogbyAgIDogQ04gSVNGIHZlY3RvciAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotICAgICBXb3JkMTYgKiBleGMyLCAgICAgICAgICAgICAgICAgICAgICAgIC8qIG8gICA6IENOIGV4Y2l0YXRpb24gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLSAgICAgV29yZDE2ICoqIHBybXMKLSk7Ci0KLVdvcmQxNiBkdHhfYnVmZmVyKAotICAgICBkdHhfZW5jU3RhdGUgKiBzdCwgICAgICAgICAgICAgICAgICAgIC8qIGkvbyA6IFN0YXRlIHN0cnVjdCAgICAgICAgICAgICAgICAgICAgKi8KLSAgICAgV29yZDE2IGlzZl9uZXdbXSwgICAgICAgICAgICAgICAgICAgICAvKiBpICAgOiBpc2YgdmVjdG9yICAgICAgICAgICAgICAgICAgICAgICovCi0gICAgIFdvcmQzMiBlbnIsICAgICAgICAgICAgICAgICAgICAgICAgICAgLyogaSAgIDogcmVzaWR1YWwgZW5lcmd5IChpbiBMX0ZSQU1FKSAgICAqLwotICAgICBXb3JkMTYgY29kZWNfbW9kZQotKTsKLQotdm9pZCB0eF9kdHhfaGFuZGxlcihkdHhfZW5jU3RhdGUgKiBzdCwgICAgIC8qIGkvbyA6IFN0YXRlIHN0cnVjdCAgICAgICAgICAgKi8KLSAgICAgV29yZDE2IHZhZF9mbGFnLCAgICAgICAgICAgICAgICAgICAgICAvKiBpICAgOiB2YWQgZGVjaXNpb24gICAgICAgICAgICovCi0gICAgIFdvcmQxNiAqIHVzZWRNb2RlICAgICAgICAgICAgICAgICAgICAgLyogaS9vIDogbW9kZSBjaGFuZ2VkIG9yIG5vdCAgICAqLwotKTsKLQotdm9pZCBRaXNmX25zKAotICAgICBXb3JkMTYgKiBpc2YxLCAgICAgICAgICAgICAgICAgICAgICAgIC8qIGlucHV0IDogSVNGIGluIHRoZSBmcmVxdWVuY3k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gICAgICAgICAgICAgICoKLSAqIGdyaWRbMF0gPSAxLjA7ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICoKLSAqIGdyaWRbZ3JpZF9wb2ludHMrMV0gPSAtMS4wOyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICoKLSAqIGZvciAoaSA9IDE7IGkgPCBncmlkX3BvaW50czsgaSsrKSAgICAgICAgICAgICAgICAgICAgICAgICAgICoKLSAqICAgZ3JpZFtpXSA9IGNvcygoNi4yODMxODUzMDcqaSkvKDIuMCpncmlkX3BvaW50cykpOyAgICAgICAgICoKLSAqICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICoKLSAqLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSovCi0KLS8qIFZlcnNpb24gMTAxIHBvaW50cyAqLwotCi0jZGVmaW5lICAgR1JJRF9QT0lOVFMgICAgIDEwMAotCi1jb25zdCBXb3JkMTYgdm9ncmlkW0dSSURfUE9JTlRTKzFdID17Ci0gICAgMzI3NjcsICAgICAzMjc1MSwgICAgIDMyNzAzLCAgICAgMzI2MjIsICAgICAzMjUwOSwgICAgIDMyMzY0LAotICAgIDMyMTg3LCAgICAgMzE5NzgsICAgICAzMTczOCwgICAgIDMxNDY2LCAgICAgMzExNjQsICAgICAzMDgzMCwKLSAgICAzMDQ2NiwgICAgIDMwMDcyLCAgICAgMjk2NDksICAgICAyOTE5NiwgICAgIDI4NzE0LCAgICAgMjgyMDQsCi0gICAgMjc2NjYsICAgICAyNzEwMSwgICAgIDI2NTA5LCAgICAgMjU4OTEsICAgICAyNTI0OCwgICAgIDI0NTc5LAotICAgIDIzODg2LCAgICAgMjMxNzAsICAgICAyMjQzMSwgICAgIDIxNjY5LCAgICAgMjA4ODcsICAgICAyMDA4MywKLSAgICAxOTI2MCwgICAgID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cXVlbmN5ICA9IDEyODAwIEh6ICAgICAgICAgICAgICAgICAgICAgIHwKLSB8ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8Ci0gfCBTcGVjaWFsIGRvdWJsZSBwcmVjaXNpb24gZm9ybWF0LiBTZWUgIm1hdGhfb3AuYyIgICAgfAotIHwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwKLSB8IGxhZ193aW5kWzBdID0gIDEuMDAwMDAwMDAgICAgKG5vdCBzdG9yZWQpICAgICAgICAgICB8Ci0gfCBsYWdfd2luZFsxXSA9ICAwLjk5OTQ2NjQyICAgICAgICAgICAgICAgICAgICAgICAgICAgfAotIHwgbGFnX3dpbmRbMl0gPSAgMC45OTgxNjY4MCAgICAgICAgICAgICAgICAgICAgICAgICAgIHwKLSB8IGxhZ193aW5kWzNdID0gIDAuOTk2MDA0NTIgICAgICAgICAgICAgICAgICAgICAgICAgICB8Ci0gfCBsYWdfd2luZFs0XSA9ICAwLjk5Mjk4NTEzICAgICAgICAgICAgICAgICAgICAgICAgICAgfAotIHwgbGFnX3dpbmRbNV0gPSAgMC45ODkxMTY1NSAgICAgICAgICAgICAgICAgICAgICAgICAgIHwKLSB8IGxhZ193aW5kWzZdID0gIDAuOTg0NDA4ODAgICAgICAgICAgICAgICAgICAgICAgICAgICB8Ci0gfCBsYWdfd2luZFs3XSA9ICAwLjk3ODg3Mzk3ICAgICAgICAgICAgICAgICAgICAgICAgICAgfAotIHwgbGFnX3dpbmRbOF0gPSAgMC45NzI1MjYxOSAgICAgICAgICAgICAgICAgICAgICAgICAgIHwKLSB8IGxhZ193aW5kWzldID0gIDAuOTY1MzgxODYgICAgICAgICAgICAgICAgICAgICAgICAgICB8Ci0gfCBsYWdfd2luZFsxMF09ICAwLjk1NzQ1OTAzICAgICAgICAgICAgICAgICAgICAgICAgICAgfAotIHwgbGFnX3dpbmRbMTFdPSAgMC45NDg3Nzc5NyAgICAgICAgICAgICAgICAgICAgICAgICAgIHwKLSB8IGxhZ193aW5kWzEyXT0gIDAuOTM5MzYwMzggICAgICAgICAgICAgICAgICAgICAgICAgICB8Ci0gfCBsYWdfd2luZFsxM109ICAwLjkyOTIyOTg2ICAgICAgICAgICAgICAgICAgICAgICAgICAgfAotIHwgbGFnX3dpbmRbMTRdPSAgMC45MTg0MTE1NSAgICAgICAgICAgICAgICAgICAgICAgICAgIHwKLSB8IGxhZ193aW5kWzE1XT0gIDAuOTA2OTMyMTIgICAgICAgICAgICAgICAgICAgICAgICAgICB8Ci0gfCBsYWdfd2luZFsxNl09ICAwLjg5NDgxOTY4ICAgICAgICAgICAgICAgICAgICAgICAgICAgfAotIC0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSovCi0KLSNkZWZpbmUgTSAxNgotCi1zdGF0aWMgV29yZDE2IHZvbGFnX2hbTV0gPSB7Ci0gICAgICAzMjc1MCwKLSAgICAgIDMyNzA3LAotICAgICAgMzI2MzcsCi0gICAgICAzMjUzOCwKLSAgICAgIDMyNDExLAotICAgICAgMzIyNTcsCi0gICAgICAzMjA3NSwKLSAgICAgIDMxODY3LAotICAgICAgMzE2MzMsCi0gICAgICAzMTM3NCwKLSAgICAgIDMxMDg5LAotICAgICAgMzA3ODAsCi0gICAgICAzMDQ0OSwKLSAgICAgIDMwMDk0LAotICAgICAgMjk3MTgsCi0gICAgICAyOTMyMX07Ci0KLXN0YXRpYyBXb3JkMTYgdm9sYWdfbFtNXSA9IHsKLSAgICAgIDE2ODk2LAotICAgICAgMzA0NjQsCi0gICAgICAgMjQ5NiwKLSAgICAgICA0NDgwLAotICAgICAgMTIxNjAsCi0gICAgICAgMzUyMCwKLSAgICAgIDI0MzIwLAotICAgICAgMjQxOTIsCi0gICAgICAyMDczNiwKLSAgICAgICAgNTc2LAotICAgICAgMTgyNDAsCi0gICAgICAzMTQ4OCwKLSA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vciBpbXBsaWVkLgotICoqIFNlZSB0aGUgTGljZW5zZSBmb3IgdGhlIHNwZWNpZmljIGxhbmd1YWdlIGdvdmVybmluZyBwZXJtaXNzaW9ucyBhbmQKLSAqKiBsaW1pdGF0aW9ucyB1bmRlciB0aGUgTGljZW5zZS4KLSAqLwotCi0KLS8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgotKgotKiAgICAgIEZpbGUgICAgICAgICAgICAgOiBsb2cyLmgKLSogICAgICBQdXJwb3NlICAgICAgICAgIDogQ29tcHV0ZXMgbG9nMihMX3gpCi0qCi0qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgotKi8KLSNpZm5kZWYgX19MT0cyX0hfXwotI2RlZmluZSBfX0xPRzJfSF9fCi0KLS8qCi0qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgotKiAgICAgICAgICAgICAgICAgICAgICAgICBJTkNMVURFIEZJTEVTCi0qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgotKi8KLSNpbmNsdWRlICJ0eXBlZGVmLmgiCi0KLS8qCi0qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgotKiAgICAgICAgICAgICAgICAgICAgICAgICBERUZJTklUSU9OIE9GIERBVEEgVFlQRVMKLSoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCi0qLwotCi0vKgotKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKLSogICAgICAgICAgICAgICAgICAgICAgICAgREVDTEFSQVRJT04gT0YgUFJPVE9UWVBFUwotKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKLSovCi12b2lkIExvZzIgKAotCQlXb3JkMzIgTF94LCAgICAgICAgLyogKGkpIDogaW5wdXQgdmFsdWUgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotCQlXb3JkMTYgKmV4cG9uZW50LCAgLyogKG8pIDogSW50ZWdlciBwYXJ0IG9mIExvZzIuICAgKHJhbmdlOiAwPD12YWw8PTMwKSAqLwotCQlXb3JkMTYgKmZyYWN0aW9uICAgLyogKG8pIDogRnJhY3Rpb25hbCBwYXJ0IG9mIExvZzIuIChyYW5nZTogMDw9dmFsPDEpKi8KLQkgICk7Ci0KLXZvaWQgTG9nMl9ub3JtICgKLQkJV29yZDMyIExfeCwgICAgICAgICAvKiAoaSkgOiBpbnB1dCB2YWx1ZSAobm9ybWFsaXplZCkgICAgICAgICAgICAgICAgICAgICovCi0JCVdvcmQxNiBleHAsICAgICAgICAgLyogKGkpIDogbm9ybV9sIChMX3gpICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotCQlXb3JkMTYgKmV4cG9uZW50LCAgIC8qIChvKSA6IEludGVnZXIgcGFydCBvZiBMb2cyLiAgIChyYW5nZTogMDw9dmFsPD0zMCkgKi8KLQkJV29yZDE2ICpmcmFjdGlvbiAgICAvKiAobykgOiBGcmFjdGlvbmFsIHBhcnQgb2YgTG9nMi4gKHJhbmdlOiAwPD12YWw8MSkgICovCi0JICAgICAgICk7Ci0KLSNlbmRpZiAgLy9fX0xPRzJfSF9fCi0KLQpkaWZmIC0tZ2l0IGEvbWVkaWEvbGlic3RhZ2VmcmlnaHQvY29kZWNzL2FtcndiZW5jL2luYy9sb2cyX3RhYi5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ZGVyIHRoZSBMaWNlbnNlLgotICovCi0KLQotCi0vKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgotKgotKiAgICAgIEZpbGUgICAgICAgICAgICAgOiBsb2cyLnRhYgotKiAgICAgIFB1cnBvc2UgICAgICAgICAgOiBUYWJsZSBmb3Igcm91dGluZSBMb2cyKCkuCi0qICAgICAgJElkICQKLSoKLSoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCi0qLwotc3RhdGljIGNvbnN0IFdvcmQxNiB0YWJsZVszM10gPQotewotICAgIDAsIDE0NTUsIDI4NjYsIDQyMzYsIDU1NjgsIDY4NjMsIDgxMjQsIDkzNTIsIDEwNTQ5LCAxMTcxNiwKLSAgICAxMjg1NSwgMTM5NjcsIDE1MDU0LCAxNjExNywgMTcxNTYsIDE4MTcyLCAxOTE2NywgMjAxNDIsIDIxMDk3LCAyMjAzMywKLSAgICAyMjk1MSwgMjM4NTIsIDI0NzM1LCAyNTYwMywgMjY0NTUsIDI3MjkxLCAyODExMywgMjg5MjIsIDI5NzE2LCAzMDQ5NywKLSAgICAzMTI2NiwgMzIwMjMsIDMyNzY3Ci19OwotCmRpZmYgLS1naXQgYS9tZWRpYS9saWJzdGFnZWZyaWdodC9jb2RlY3MvYW1yd2JlbmMvaW5jL21haW4uaCBiL21lZGlhL2xpYnN0YWdlZnJpZ2h0L2NvZGVjcy9hbXJ3YmVuYy9pbmMvbWFpbi5oCmRlbGV0ZWQgZmlsZSBtb2RlIDEwMDY0NAppbmRleCAzYTZmOTYzLi4wMDAwMDAwCi0tLSBhL21lZGlhL2xpYnN0YWdlZnJpZ2h0L2NvZGVjcy9hbXJ3YmVuYy9pbmMvbWFpbi5oCisrKyAvZGV2L251bGwKQEAgLTEsNDUgKzAsMCBAQAotCi0vKgotICoqIENvcHly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0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0qCi0gKiAgICAgICBNYWluIGZ1bmN0aW9ucwkJCQkJCQkgICAgKgotICotLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSovCi0KLSNpZm5kZWYgX19NQUlOX0hfXwotI2RlZmluZSBfX01BSU5fSF9fCi0KLXZvaWQgY29kZXIoCi0gICAgIFdvcmQxNiAqIG1vZGUsICAgICAgICAgICAgICAgICAgICAgICAgLyogaW5wdXQgOiAgdXNlZCBtb2RlICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotICAgICBXb3JkMTYgc3BlZWNoMTZrW10sICAgICAgICAgICAgICAgICAgIC8qIGlucHV0IDogIDMyMCBuZXcgc3BlZWNoIHNhbXBsZXMgKGF0IDE2IGtIeikgICAgKi8KLSAgICAgV29yZDE2IHBybXNbXSwgICAgICAgICAgICAgICAgICAgICAgICAvKiBvdXRwdXQ6ICBvdXRwdXQgcGFyYW1ldGVycyAgICAgICAgICAgKi8KLSAgICAgV29yZDE2ICogc2VyX3NpemUsICAgICAgICAgICAgICAgICAgICAvKiBvdXRwdXQ6ICBiaXQgcmF0ZSBvZiB0aGUgdXNlZCBtb2RlICAgKi8KLSAgICAgdm9pZCAqc3BlX3N0YXRlLCAgICAgICAgICAgICAgICAgICAgICAvKiBpL28gICA6ICBTdGF0ZSBzdHJ1Y3R1cmUgICAgICAgICAgICAgICAgICAgICAgICovCi0gICAgIFdvcmQxNiBhbGxvd19kdHggICAgICAgICAgICAgICAgICAgICAgLyogaW5wdXQgOiAgRFRYIE9OL09GRiAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotKTsKLQotCi0KLXZvaWQgUmVzZXRfZW5jb2Rlcih2b2lkICpzdCwgV29yZDE2IHJlc2V0X2FsbCk7Ci0K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nJhYywgICAgICAgICAgICAgICAgICAgICAgICAvKiAoaS9vKSBRMzE6IG5vcm1hbGl6ZWQgdmFsdWUgKDEuMCA8IGZyYWMgPD0gMC41KSAqLwotCQlXb3JkMTYgKiBleHAgICAgICAgICAgICAgICAgICAgICAgICAgIC8qIChpL28pICAgIDogZXhwb25lbnQgKHZhbHVlID0gZnJhYyB4IDJeZXhwb25lbnQpICovCi0JICAgICk7Ci0KLVdvcmQzMiBQb3cyKCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvKiAobykgUTAgIDogcmVzdWx0ICAgICAgIChyYW5nZTogMDw9dmFsPD0weDdmZmZmZmZmKSAqLwotCQlXb3JkMTYgZXhwb25hbnQsICAgICAgICAgICAgICAgICAgICAgIC8qIChpKSBRMCAgOiBJbnRlZ2VyIHBhcnQuICAgICAgKHJhbmdlOiAwPD12YWw8PTMwKSAgICovCi0JCVdvcmQxNiBmcmFjdGlvbiAgICAgICAgICAgICAgICAgICAgICAgLyogKGkpIFExNSA6IEZyYWN0aW9ubmFsIHBhcnQuICAocmFuZ2U6IDAuMDw9dmFsPDEuMCkgKi8KLQkgICApOwotCi1Xb3JkMzIgRG90X3Byb2R1Y3QxMiggICAgICAgICAgICAgICAgICAgICAgLyogKG8pIFEzMTogbm9ybWFsaXplZCByZXN1bHQgKDEgPCB2YWwgPD0gLTEpICovCi0JCVdvcmQxNiB4W10sICAgICAgICAgICAgICAgICAgICAgICAgICAgLyogKGkpIDEyYml0czogeCB2ZWN0b3IgICAgICAgICAgICAgICAgICAgICAgICovCi0JCVdvcmQxNiB5W10sICAgICAgICAgICAgICAgICAgICAgICAgICAgLyogKGkpIDEyYml0czogeSB2ZWN0b3IgICAgICAgICAgICAgICAgICAgICAgICovCi0JCVdvcmQxNiBsZywgICAgICAgICAgICAgICAgICAgICAgICAgICAgLyogKGkpICAgIDogdmVjdG9yIGxlbmd0aCAgICAgICAgICAgICAgICAgICAgICovCi0JCVdvcmQxNiAqIGV4cCAgICAgICAgICAgICAgICAgICAgICAgICAgLyogKG8pICAgIDogZXhwb25lbnQgb2YgcmVzdWx0ICgwLi4rMzApICAgICAgICovCi0JCSk7Ci0KLVdvcmQzMiBEb3RfcHJvZHVjdDEyX2FzbSggICAgICAgICAgICAgICAgICAgICAgLyogKG8pIFEzMTogbm9ybWFsaXplZCByZXN1bHQgKDEgPCB2YWwgPD0gLTEpICovCi0JCVdvcmQxNiB4W10sICAgICAgICAgICAgICAgICAgICAgICAgICAgLyogKGkpIDEyYml0czogeCB2ZWN0b3IgICAgICAgICAgICAgICAgICAgICAgICovCi0JCVdvcmQxNiB5W10sICAgICAgICAgICAgICAgICAgICAgICAgICAgLyogKGkpIDEyYml0czogeSB2ZWN0b3IgICAgICAgICAgICAgICAgICAgICAgICovCi0JCVdvcmQxNiBsZywgICAgICAgICAgICAgICAgICAgICAgICAgICAgLyogKGkpICAgIDogdmVjdG9yIGxlbmd0aCAgICAgICAgICAgICAgICAgICAgICovCi0JCVdvcmQxNiAqIGV4cCAgICAgICAgICAgICAgICAgICAgICAgICAgLyogKG8pICAgIDogZXhwb25lbnQgb2YgcmVzdWx0ICgwLi4rMzApICAgICAgICovCi0JCSk7Ci0jZW5kaWYgLy9fX01BVEhfT1BfSF9fCi0KZGlmZiAtLWdpdCBhL21lZGlhL2xpYnN0YWdlZnJpZ2h0L2NvZGVjcy9hbXJ3YmVuYy9pbmMvbWVtX2FsaWduLmggYi9tZWRpYS9saWJzdGFnZWZyaWdodC9jb2RlY3MvYW1yd2JlbmMvaW5jL21lbV9hbGlnbi5oCmRlbGV0ZWQgZmlsZSBtb2RlIDEwMDY0NAppbmRleCA0NDI3ODZhMS4uMDAwMDAwMAotLS0gYS9tZWRpYS9saWJzdGFnZWZyaWdodC9jb2RlY3MvYW1yd2JlbmMvaW5jL21lbV9hbGlnbi5oCisrKyAvZGV2L251bGwKQEAgLTEsMzUgKzAsMCBAQAotLyoKLSAqKiBDb3B5cmlnaHQgMjAwMy0yMDEwLCBWaXN1YWxPbiwgSW5jLgotICoqCi0gKiogTGljZW5zZWQgdW5kZXIgdGhlIEFwYWNoZSBMaWNlbnNlLCBWZXJzaW9uIDIuMCAodGhlICJMaWNlbnNlIik7Ci0gKiogeW91IG1heSBub3QgdXNlIHRoaXMgZmlsZSBleGNlcHQgaW4gY29tcGxpYW5jZSB3aXRoIHRoZSBMaWNlbnNlLgotICoqIFlvdSBtYXkgb2J0YWluIGEgY29weSBvZiB0aGUgTGljZW5zZSBhdAotICoqCi0gKiogICAgIGh0dHA6Ly93d3cuYXBhY2hlLm9yZy9saWNlbnNlcy9MSUNFTlNFLTIuMAotICoqCi0gKiogVW5sZXNzIHJlcXVpcmVkIGJ5IGFwcGxpY2FibGUgbGF3IG9yIGFncmVlZCB0byBpbiB3cml0aW5nLCBzb2Z0d2FyZQotICoqIGRpc3RyaWJ1dGVkIHVuZGVyIHRoZSBMaWNlbnNlIGlzIGRpc3RyaWJ1dGVkIG9uIGFuICJBUyBJUyIgQkFTSVMsCi0gKiogV0lUSE9VVCBXQVJSQU5USUVTIE9SIENPTkRJVElPTlMgT0YgQU5ZIEtJTkQsIGVpdGhlciBleHByZXNzIG9yIGltcGxpZWQuCi0gKiogU2VlIHRoZSBMaWNlbnNlIGZvciB0aGUgc3BlY2lmaWMgbGFuZ3VhZ2UgZ292ZXJuaW5nIHBlcm1pc3Npb25zIGFuZAotICoqIGxpbWl0YXRpb25zIHVuZGVyIHRoZSBMaWNlbnNlLgotICovCi0vKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgotCUZpbGU6CQltZW1fYWxpZ24uaAotCi0JQ29udGVudDoJTWVtb3J5IGFsbG9jIGFsaWdubWVudHMgZnVuY3Rpb25zCi0KLSoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0KLSNpZm5kZWYgX19WT19NR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wIHBpdGNoIGxhZyAgICAgICAgICAgICAgICAgICAgICAgICovCi0JCVdvcmQxNiB3c3BbXSwgICAgICAgICAgICAgICAgICAgICAgICAgLyogaW5wdXQgOiBzaWduYWwgdXNlZCB0byBjb21wdXRlIHRoZSBvcGVuIGxvb3AgcGl0Y2ggKi8KLQkJLyogd3NwWy1waXRfbWF4XSB0byB3c3BbLTFdIHNob3VsZCBiZSBrbm93biAgICovCi0JCVdvcmQxNiBMX21pbiwgICAgICAgICAgICAgICAgICAgICAgICAgLyogaW5wdXQgOiBtaW5pbXVtIHBpdGNoIGxhZyAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLQkJV29yZDE2IExfbWF4LCAgICAgICAgICAgICAgICAgICAgICAgICAvKiBpbnB1dCA6IG1heGltdW0gcGl0Y2ggbGFnICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotCQlXb3JkMTYgTF9mcmFtZSwgICAgICAgICAgICAgICAgICAgICAgIC8qIGlucHV0IDogbGVuZ3RoIG9mIGZyYW1lIHRvIGNvbXB1dGUgcGl0Y2ggICAgICAgICAgICovCi0JCVdvcmQxNiBMXzAsICAgICAgICAgICAgICAgICAgICAgICAgICAgLyogaW5wdXQgOiBvbGRfIG9wZW4tbG9vcCBwaXRjaCAgICAgICAgICAgICAgICAgICAgICAgKi8KLQkJV29yZDE2ICogZ2FpbiwgICAgICAgICAgICAgICAgICAgICAgICAvKiBvdXRwdXQ6IG5vcm1hbGl6ZSBjb3JyZWxhdGlvbiBvZiBocF93c3AgZm9yIHRoZSBMYWcgKi8KLQkJV29yZDE2ICogaHBfd3NwX21lbSwgICAgICAgICAgICAgICAgICAvKiBpOm8gICA6IG1lbW9yeSBvZiB0aGUgaHlwYXNzIGZpbHRlciBmb3IgaHBfd3NwW10gKGxnPTkpICAgKi8KLQkJV29yZDE2ICogb2xkX2hwX3dzcCwgICAgICAgICAgICAgICAgICAvKiBpOm8gICA6IGh5cGFzcyB3c3BbXSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotCQlXb3JkMTYgd2dodF9mbGcgICAgICAgICAgICAgICAgICAgICAgIC8qIGlucHV0IDogaXMgd2VpZ2h0aW5nIGZ1bmN0aW9uIHVzZWQgICAgICAgICAgICAgICAgICovCi0JCSk7Ci0KLVdvcmQxNiBNZWRfb2xhZyggICAgICAgICAgICAgICAgICAgICAgICAgICAvKiBvdXRwdXQgOiBtZWRpYW4gb2YgIDUgcHJldmlvdXMgb3Blbi1sb29wIGxhZ3MgICAgICAgKi8KLQkJV29yZDE2IHByZXZfb2xfbGFnLCAgICAgICAgICAgICAgICAgICAvKiBpbnB1dCAgOiBwcmV2aW91cyBvcGVuLWxvb3AgbGFnICAgICAgICAgICAgICAgICAgICAgKi8KLQkJV29yZDE2IG9sZF9vbF9sYWdbNV0KLQkgICAgICAgKTsKLQotdm9pZCBIcF93c3AoCi0JCVdvcmQxNiB3c3BbXSwgICAgICAgICAgICAgICAgICAgICAgICAgLyogaSAgIDogd3NwW10gIHNpZ25hbCAgICAgICAqLwotCQlXb3JkMTYgaHBfd3NwW10sICAgICAgICAgICAgICAgICAgICAgIC8qIG8gICA6IGh5cGFzcyB3c3BbXSAgICAgICAgKi8KLQkJV29yZDE2IGxnLCAgICAgICAgICAgICAgICAgICAgICAgICAgICAvKiBpICAgOiBsZW5naHQgb2Ygc2lnbmFsICAgICovCi0JCVdvcmQxNiBtZW1bXSAgICAgICAgICAgICAgICAgICAgICAgICAgLyogaS9vIDogZmlsdGVyIG1lbW9yeSBbOV0gICAqLwotCSAgICk7Ci0KLSNlbmRpZiAgLy9fX1BfTUVEX09fSF9fCi0KZGlmZiAtLWdpdCBhL21lZGlhL2xpYnN0YWdlZnJpZ2h0L2NvZGVjcy9hbXJ3YmVuYy9pbmMvcF9tZWRfb2wudGFiIGIvbWVkaWEvbGlic3RhZ2VmcmlnaHQvY29kZWNzL2FtcndiZW5jL2luYy9wX21lZF9vbC50YWIKZGVsZXRlZCBmaWxlIG1vZGUgMTAwNjQ0C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qIGxpbWl0YXRpb25zIHVuZGVyIHRoZSBMaWNlbnNlLgotICovCi0KLQotLyotLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSoKLSAqICAgICAgICAgICAgICAgICAgICAgICAgIFFfUFVMU0UuSCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqCi0gKi0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tKgotICogQ29kaW5nIGFuZCBkZWNvZGluZyBvZiBhbGdlYnJhaWMgY29kZWJvb2sJCQkgICAgICAgICAgICAqCi0gKi0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tKi8KLQotI2lmbmRlZiAgX19RX1BVTFNFX0hfXwotI2RlZmluZSAgX19RX1BVTFNFX0hfXwotCi0jaW5jbHVkZSAidHlwZWRlZi5oIgotCi1Xb3JkMzIgcXVhbnRfMXBfTjEoICAgICAgICAgICAgICAgICAgICAgICAgLyogKG8pIHJldHVybiAoTisxKSBiaXRzICAgICAgICAgICAqLwotCQlXb3JkMTYgcG9zLCAgICAgICAgICAgICAgICAgICAgICAgICAgIC8qIChpKSBwb3NpdGlvbiBvZiB0aGUgcHVsc2UgICAgICAgKi8KLQkJV29yZDE2IE4pOyAgICAgICAgICAgICAgICAgICAgICAgICAgICAvKiAoaSkgbnVtYmVyIG9mIGJpdHMgZm9yIHBvc2l0aW9uICovCi0KLVdvcmQzMiBxdWFudF8ycF8yTjEoICAgICAgICAgICAgICAgICAgICAgICAvKiAobykgcmV0dXJuICgyKk4pKzEgYml0cyAgICAgICAgICovCi0JCVdvcmQxNiBwb3MxLCAgICAgICAgICAgICAgICAgICAgICAgICAgLyogKGkpIHBvc2l0aW9uIG9mIHRoZSBwdWxzZSAxICAgICAqLwotCQlXb3JkMTYgcG9zMiwgICAgICAgICAgICAgICAgICAgICAgICAgIC8qIChpKSBwb3NpdGlvbiBvZiB0aGUgcHVsc2UgMiAgICAgKi8KLQkJV29yZDE2IE4pOyAgICAgICAgICAgICAgICAgICAgICAgICAgICAvKiAoaSkgbnVtYmVyIG9mIGJpdHMgZm9yIHBvc2l0aW9uICovCi0KLVdvcmQzMiBxdWFudF8zcF8zTjEoICAgICAgICAgICAgICAgICAgICAgICAvKiAobykgcmV0dXJuICgzKk4pKzEgYml0cyAgICAgICAgICovCi0JCVdvcmQxNiBwb3MxLCAgICAgICAgICAgICAgICAgICAgICAgICAgLyogKGkpIHBvc2l0aW9uIG9mIHRoZSBwdWxzZSAxICAgICAqLwotCQlXb3JkMTYgcG9zMiwgICAgICAgICAgICAgICAgICAgICAgICAgIC8qIChpKSBwb3NpdGlvbiBvZiB0aGUgcHVsc2UgMiAgICAgKi8KLQkJV29yZDE2IHBvczMsICAgICAgICAgICAgICAgICAgICAgICAgICAvKiAoaSkgcG9zaXRpb24gb2YgdGhlIHB1bHNlIDMgICAgICovCi0JCVdvcmQxNiBOKTsgICAgICAgICAgICAgICAgICAgICAgICAgICAgLyogKGkpIG51bWJlciBvZiBiaXRzIGZvciBwb3NpdGlvbiAqLwotCi1Xb3JkMzIgcXVhbnRfNHBfNE4xKCAgICAgICAgICAgICAgICAgICAgICAgLyogKG8pIHJldHVybiAoNCpOKSsxIGJpdHMgICAgICAgICAqLwotCQlXb3JkMTYgcG9zMSwgICAgICAgICAgICAgICAgICAgICAgICAgIC8qIChpKSBwb3NpdGlvbiBvZiB0aGUgcHVsc2UgMSAgICAgKi8KLQkJV29yZDE2IHBvczIsICAgICAgICAgICAgICAgICAgICAgICAgICAvKiAoaSkgcG9zaXRpb24gb2YgdGhlIHB1bHNlIDIgICAgICovCi0JCVdvcmQxNiBwb3MzLCAgICAgICAgICAgICAgICAgICAgICAgICAgLyogKGkpIHBvc2l0aW9uIG9mIHRoZSBwdWxzZSAzICAgICAqLwotCQlXb3JkMTYgcG9zNCwgICAgICAgICAgICAgICAgICAgICAgICAgIC8qIChpKSBwb3NpdGlvbiBvZiB0aGUgcHVsc2UgNCAgICAgKi8KLQkJV29yZDE2IE4pOyAgICAgICAgICAgICAgICAgICAgICAgICAgICAvKiAoaSkgbnVtYmVyIG9mIGJpdHMgZm9yIHBvc2l0aW9uICovCi0KLVdvcmQzMiBxdWFudF80cF80TiggICAgICAgICAgICAgICAgICAgICAgICAvKiAobykgcmV0dXJuIDQqTiBiaXRzICAgICAgICAgICAgICovCi0JCVdvcmQxNiBwb3NbXSwgICAgICAgICAgICAgICAgICAgICAgICAgLyogKGkpIHBvc2l0aW9uIG9mIHRoZSBwdWxzZSAxLi40ICAqLwotCQlXb3JkMTYgTik7ICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8qIChpKSBudW1iZXIgb2YgYml0cyBmb3IgcG9zaXRpb24gKi8KLQotV29yZDMyIHF1YW50XzVwXzVOKCAgICAgICAgICAgICAgICAgICAgICAgIC8qIChvKSByZXR1cm4gNSpOIGJpdHMgICAgICAgICAgICAgKi8KLQkJV29yZDE2IHBvc1tdLCAgICAgICAgICAgICAgICAgICAgICAgICAvKiAoaSkgcG9zaXRpb24gb2YgdGhlIHB1bHNlIDEuLjUgICovCi0JCVdvcmQxNiBOKTsgICAgICAgICAgICAgICAgICAgICAgICAgICAgLyogKGkpIG51bWJlciBvZiBiaXRzIGZvciBwb3NpdGlvbiAqLwotCi1Xb3JkMzIgcXVhbnRfNnBfNk5fMiggICAgICAgICAgICAgICAgICAgICAgLyogKG8pIHJldHVybiAoNipOKS0yIGJpdHMgICAgICAgICAqLwotCQlXb3JkMTYgcG9zW10sICAgICAgICAgICAgICAgICAgICAgICAgIC8qIChpKSBwb3NpdGlvbiBvZiB0aGUgcHVsc2UgMS4uNiAgKi8KLQkJV29yZDE2I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AqLwotIHN0YXRpYyBXb3JkMTYgbWVhbl9pc2Zfbm9pc2VbT1JERVJdID0gewotCi0gICA0NzgsICAxMTAwLCAgMjIxMywgIDMyNjcsICA0MjE5LCAgNTIyMiwgIDYxOTgsICA3MjQwLAotICA4MjI5LCAgOTE1MywgMTAwOTgsIDExMTA4LCAxMjE0NCwgMTMxODQsIDE0MTY1LCAgMzgwM307Ci0KLQotLyogMjggYml0cyAqLwotLyotLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tKgotICogIGlzZiBjb2RlYm9va3M6ICBzcGxpdC1ieS01IFZRICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKgotICogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKgotICogIGNvZGVib29rICAgdmVjdG9yIGRpbWVuc2lvbiAgICBudW1iZXIgb2YgdmVjdG9ycyAgICAgICAgICAgICAgICAgKgotICogIH5+fn5+fn5+ICAgfn5+fn5+fn5+fn5+fn5+fiAgICB+fn5+fn5+fn5+fn5+fn5+fiAgICAgICAgICAgICAgICAgKgotICogICAgIDEgICAgICAgICAgICAyICAgICAgICAgICAgICAgICAgNjQgICAgICAgICAgICAgICAgICAgICAgICAgICAgKgotICogICAgIDIgICAgICAgICAgICAzICAgICAgICAgICAgICAgICAgNjQgICAgICAgICAgICAgICAgICAgICAgICAgICAgKgotICogICAgIDMgICAgICAgICAgICAzICAgICAgICAgICAgICAgICAgNjQgICAgICAgICAgICAgICAgICAgICAgICAgICAgKgotICogICAgIDQgICAgICAgICAgICA0ICAgICAgICAgICAgICAgICAgMzIgICAgICAgICAgICAgICAgICAgICAgICAgICAgKgotICogICAgIDUgICAgICAgICAgICA0ICAgICAgICAgICAgICAgICAgMzIgICAgICAgICAgICAgICAgICAgICAgICAgICAgKgotICotLS0tLS0tLS0tLS0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ycyAgICAgICAgICAgICAgICAgKgotICogIH5+fn5+fn5+ICAgfn5+fn5+fn5+fn5+fn5+fiAgICB+fn5+fn5+fn5+fn5+fn5+fiAgICAgICAgICAgICAgICAgKgotICogICAgIDFfMSAgICAgICAgICAgIDkgICAgICAgICAgICAgICAgICAyNTYgICAgICAgICAgICAgICAgICAgICAgICAgKgotICogICAgIDFfMiAgICAgICAgICAgIDcgICAgICAgICAgICAgICAgICAyNTYgICAgICAgICAgICAgICAgICAgICAgICAgKgotICogICAgIDJfMSAgICAgICAgICAgIDMgICAgICAgICAgICAgICAgICA2NCAgICAgICAgICAgICAgICAgICAgICAgICAgKgotICogICAgIDJfMiAgICAgICAgICAgIDMgICAgICAgICAgICAgICAgICAxMjggICAgICAgICAgICAgICAgICAgICAgICAgKgotICogICAgIDJfMyAgICAgICAgICAgIDMgICAgICAgICAgICAgICAgICAxMjggICAgICAgICAgICAgICAgICAgICAgICAgKgotICogICAgIDJfNCAgICAgICAgICAgIDMgICAgICAgICAgICAgICAgICAzMiAgICAgICAgICAgICAgICAgICAgICAgICAgKgotICogICAgIDJfNSAgICAgICAgICAgIDQgICAgICAgICAgICAgICAgICAzMiAgICAgICAgICAgICAgICAgICAgICAgICAgKgotICotLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tKi8KLQotLyotLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0qCi0gKiAxc3Qgc3RhZ2UgY29kZWJvb2s7IDFzdCBzcGxpdDogICBpc2YwIHRvIGlzZjgKLSAqLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tKi8KLQotc3RhdGljIFdvcmQxNiBkaWNvMV9pc2ZbU0laRV9CSzEqOV0gPSB7Ci0KLSAgIDU3OSwgIDEwODEsICAxMDM1LCA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NzQsICAgIDMyLCAgLTE2MSwgIC0xOTIsICAtNDkwLAotICAgMjEzLCAgIDE2NCwgICAtNzEsICAtNDY1LCAgLTg3NiwgIC0xNjEsICAtNDU2LCAgLTU4NywgICAtNDgsCi0gICAyMTgsICAgMTE3LCAgICAzOSwgICAxNzcsICAtMTk0LCAgIC04OCwgIC0yMjYsICAtNDE4LCAgICA1MCwKLSAgIDIxMCwgICA1NDcsICAgNTY5LCAgIDI3OSwgICAxMjEsICAgLTQ0LCAgIC01MCwgICAgMTAsICAgLTg0LAotICAgIDU4LCAgIDE0MCwgICAxODIsICAgIC01LCAgIDI2NywgICAxMTcsICAgMTA2LCAgIDIxMSwgICAxOTgsCi0gICA1MzksICAgODM1LCAgIDkxMywgICA3MTksICAgNjE3LCAgIDU0NCwgICA1OTEsICAgNTY1LCAgIDY0MiwKLSAgIDE1MywgICA1NTksICAgODcyLCAgIDQ2MCwgICAyMjIsICAgMTA4LCAgIDE4OCwgICAxODAsICAgMTgzLAotICAgMTU4LCAgIDExOSwgICAyODQsICAtMTUzLCAgLTI3MSwgICAyMjksICAgIDg3LCAgIDExMCwgICAtNTcsCi0gIC0xODMsICAgIDgyLCAgIDExOCwgICAgMjEsICAgIDEzLCAgICA0MCwgICAxMTgsICAgMTkxLCAgIDE4NSwKLSAgIDE2MiwgICA4ODksICAgNjU0LCAgIDEwOCwgICAtMzQsICAgMjQ0LCAgIDQ4OCwgICA1NjEsICAgNTMyLAotICAgMTYzLCAgICA1NiwgICA2MDksICAgMzQxLCAgICA1MCwgICAzMjksICAgIDY4LCAgIDI2NiwgICAyMTgsCi0gICAxMDAsICAgMjA2LCAgICAxOCwgIC0zMDQsICAtMTA3LCAgLTQzNiwgIC00ODcsICAgLTY1LCAgLTMwNiwKLSAgIC04NiwgICAxNTQsICAgMTM0LCAgIC0zMCwgICAtNDUsICAgLTczLCAgLTEwNCwgICAtODAsICAgLTk2LAotICAgMjQ1LCAgIDMzMCwgICAgMTAsICAtNDQwLCAgLTg0O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ICAgLTQxLCAgIDIzMSwgICAxNjcsCi0gICAtNjIsICAgMTU1LCAgICAxNiwKLSAgIC02NSwgICAgMTYsICAgIDc3LAotICAgLTY4LCAgICAtMiwgICAtNjMsCi0gIC0xNTEsICAtMzAwLCAgIDE2MCwKLSAgIC0xOCwgIC0zMzMsICAgIDU0LAotICAgLTU2LCAgIC05NCwgICAgIDUsCi0gICAgIDIsICAtMTkwLCAgICAxNCwKLSAgICA5MiwgICAxNDgsICAgMjA5LAotICAgMTA4LCAgICAgOSwgICAyNzIsCi0gICAxMDgsICAgIDM1LCAgIDExMCwKLSAgIDE0MiwgICAtODUsICAgMTQ1LAotICAgIDQ3LCAgLTE1NywgICAyNzksCi0gICAgIDMsICAtMzIwLCAgIDI0NiwKLSAgICA0MywgICAtNzIsICAgIDY4LAotICAgIDg2LCAgLTIxNywgICAxMzUsCi0gICAgMzYsICAgMTQwLCAgICA3OSwKLSAgICA1NiwgICAxNzUsICAgLTQ5LAotICAgIDI2LCAgICA0NSwgICAgIDMsCi0gICAgNzMsICAgIDU1LCAgLTEwMSwKLSAgIDEwOSwgIC0xODMsICAtMjQyLAotICAgIC00LCAgLTI4MywgIC0yNDIsCi0gICAgNDgsICAgLTY4LCAgIC00OCwKLSAgICAtNiwgIC0xNTMsICAtMTIyLAotICAgMTYxLCAgIDE5NiwgICAgOTYsCi0gICAyMzIsICAgIDgwLCAgIDE5MCwKLSAgIDE2NSwgICAgOTcsICAgIDExLAotICAgMjU4LCAgIC0zMSwgICAgNzEsCi0gICAyNjcsICAgLTc3LCAgIC05MSwKLSAgIDMxMSwgIC0yMDksICAgIDg3LAotICAgMTUyLCAgIC0xNCwgICAtMjIsCi0gICAxNTAsICAtMTQ5LCAgICAgOSwKLSAgLTMyNCwgICA1NTcsICAgMTg3LAotICAtMzg0LCAgIDMwNywgICAgNDYsCi0gIC0yNTEsICAgIDI3LCAgICA3NywKLSAgLTM2NSwgICAgNzcsICAgLTUyLAotICAtNDgyLCAgIC04NCwgICAxN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gIDE4MywKLSAgLTI3MCwgIC0yNjksICAgLTk4LAotICAgLTUyLCAgIC04MiwgICAgMTMsCi0gICAtODIsICAtMjc0LCAgIC05NywKLSAgICA5MCwgIC0yNDYsICAgLTcyLAotICAtMjk5LCAgIC03MCwgICA0MjEsCi0gICAtODgsICAgMzY1LCAgIDQzMCwKLSAgIDE4NywgIC0zMTgsICAgMzgxLAotICAgMzgwLCAgICAzNywgICA0ODgsCi0gIC0zNzMsICAtMzE2LCAgICA3OSwKLSAgLTMwOCwgIC0xMDEsICAgICA1LAotICAtMTM1LCAgLTQ1MSwgICAgIDgsCi0gICAgNzIsICAtNDIxLCAgLTE1NCwKLSAgIDE4MCwgICAxNzAsICAtMTIxLAotICAgIDYyLCAgIDE3NywgICAtNDAsCi0gICAzMjYsICAgIDgwLCAgLTEwNSwKLSAgIDI0OCwgICAyNjMsICAgIC01LAotICAtMTY4LCAgLTE4MSwgIC0yMjEsCi0gICAgLTIsICAgLTIzLCAgLTE1OCwKLSAgIC0xNCwgIC0xNDksICAtMTIxLAotICAgMTE5LCAgIC05MSwgIC0xNDcsCi0gICAxMTksICAgMzMyLCAgLTE1MywKLSAgICA0OSwgICAzMDMsICAgIDM0LAotICAgNDQyLCAgIC01NSwgICAtNjksCi0gICAyMTcsICAgNDU0LCAgICA1OCwKLSAgLTM1OSwgIC0xODcsICAtMzc1LAotICAgLTQyLCAgICA1MCwgIC0yNzQsCi0gICAgLTgsICAtMjY3LCAgLTI0OSwKLSAgICA4NSwgICAtODYsICAtMzQ2LAotICAgLTc3LCAgIC00MCwgICAzNDUsCi0gICAgODksICAgMTM0LCAgIDIxOSwKLSAgIDE1NiwgICAtODAsICAgMTYwLAotICAgMTA4LCAgICA0MCwgICAxMTYsCi0gIC0xNTgsICAtMjA2LCAgICAyOSwKLSAgICAgNSwgICAtMzIsICAgMTc1LAotICAgLTY1LCAgLTE1OCwgICAxNDYsCi0gICAgNTUsICAgLTc4LCAgICA3MywKLSAgLTExNCwgIC0yMjIs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zYgYml0ICovCi0vKi0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0qCi0gKiAgaXNmIGNvZGVib29rczogIHR3by1zdGFnZSBWUSB3aXRoIHNwbGl0LWJ5LTMgaW4gMm5kIHN0YWdlICAgICAgICAqCi0gKiAgICAgICAgICAgICAgICAxc3Qgc3RhZ2UgaXMga2VwdCB0aGUgc2FtZSBhcyB0aGUgNDYgYml0IHF1YW50aXplciAqCi0gKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqCi0gKiAgY29kZWJvb2sgICB2ZWN0b3IgZGltZW5zaW9uICAgIG51bWJlciBvZiB2ZWN0b3JzICAgICAgICAgICAgICAgICAqCi0gKiAgfn5+fn5+fn4gICB+fn5+fn5+fn5+fn5+fn5+ICAgIH5+fn5+fn5+fn5+fn5+fn5+ICAgICAgICAgICAgICAgICAqCi0gKiAgICAgMV8xICAgICAgICAgICAgOSAgICAgICAgICAgICAgICAgIDI1NiAgICAgICAgICAgICAgICAgICAgICAgICAqCi0gKiAgICAgMV8yICAgICAgICAgICAgNyAgICAgICAgICAgICAgICAgIDI1NiAgICAgICAgICAgICAgICAgICAgICAgICAqCi0gKiAgICAgMl8xICAgICAgICAgICAgNSAgICAgICAgICAgICAgICAgIDEyOCAgICAgICAgICAgICAgICAgICAgICAgICAqCi0gKiAgICAgMl8yICAgICAgICAgICAgNCAgICAgICAgICAgICAgICAgIDEyOCAgICAgICAgICAgICAgICAgICAgICAgICAqCi0gKiAgICAgMl8zICAgICAgICAgICAgNyAgICAgICAgICAgICAgICAgIDY0ICAgICAgICAgICAgICAgICAgICAgICAgICAqCi0gKi0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0qLwotCi1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ICAgMjgzLCAgIC01NSwgIC0xMjAsCi0gICAtMTIsICAtMjE5LCAgIDMzMSwgICAtODEsICAgMTY3LAotICAgMjIwLCAgLTEzNiwgICAxNDcsICAtMTcyLCAgIC00MiwKLSAgIDE0MCwgICAtOTUsICAtMTA5LCAgIC04OCwgIC0xOTQsCi0gICAgIDAsICAgIC0yLCAgICAtNCwgICAtMzMsICAtMzgxLAotICAgLTY2LCAgLTIxNywgICAxNTIsICAtMTg2LCAgLTQwMiwKLSAgIDI0NCwgICAxMDgsICAgMTU2LCAgLTE0MCwgIC0zOTUsCi0gICAxMTMsICAtMTM2LCAgLTE5NiwgICAxMTAsICAgLTI0LAotICAgMjE0LCAgIDExOCwgICAgMTEsICAgLTY0LCAgLTEzMSwKLSAgLTExMCwgIC0yODYsICAgIC02LCAgLTMzMiwgICAgMTYsCi0gICAgOTQsICAgIDk3LCAgICA3OSwgIC0yOTEsICAtMjA1LAotICAgIC01LCAgIC0zOSwgICAtMjAsICAgMjUyLCAgIC05NiwKLSAgICA3NiwgICAxNzQsICAgMTAxLCAgIDE2MywgICAgNjEsCi0gICAtNjksICAtMjM5LCAgIC01NSwgICAzOTksICAgICA2LAotICAtMTE1LCAgIDMxOSwgICAxNjQsICAgMjc1LCAgIDE5NiwKLSAgIC0xNSwgICAgMzYsICAgLTQ3LCAgIDMzMSwgICAxMjEsCi0gICAyMjYsICAgMjA5LCAgIDI3MSwgICAzMjUsICAgMTg0LAotICAgIDEzLCAgIC04MCwgIC0yMTgsICAgNDcxLCAgIDM1MywKLSAgIDI4OCwgICAzNzgsICAgIDE2LCAgIC01MSwgICAyNTEsCi0gICAxNzQsICAgMTE2LCAgICA1MiwgICAxNDksICAtMjc5LAotICAgMjM1LCAgIDI3NiwgICAgMzksICAgMTIwLCAgIC00OCwKLSAgICAgMCwgIC0xMDgsICAtMTA4LCAgIDI0MSwgIC0zMzksCi0gICAtOTMsICAgNTM0LCAgICA0NSwgICAgMzMsICAgLTg3LAotICAgMTk0LCAgI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AzNjMsCi0gIC0yMzUsICAgIDE3LCAgIDM2NCwgIC0xNTYsICAgMTU2LAotICAgLTI1LCAgIC0zMCwgICAgNzIsICAgMTQ0LCAgIDE1NiwKLSAgIDE1MywgICAtMjYsICAgMjU2LCAgICA5NywgICAxNDQsCi0gICAtMjEsICAgLTM3LCAgICA0OCwgICAtNjUsICAgMjUwLAotICAgIDYzLCAgICA3NywgICAyNzMsICAtMTI4LCAgIDEyNCwKLSAgLTEyOSwgICAtMjYsICAgIDQwLCAgICAgOSwgIC0xMTUsCi0gICAgLTYsICAgIDgyLCAgICAzOCwgICAtOTAsICAtMTgyLAotICAtMzM2LCAgIC0xMywgICAgMjgsICAgMTU4LCAgICA5MSwKLSAgIC0zMCwgICAyNDEsICAgMTM3LCAgLTE3MCwgICAtMTcsCi0gICAxNDYsICAgIDE0LCAgIC0xMSwgICAgMzMsICAgIDYxLAotICAgMTkyLCAgIDE5NywgICAgNTQsICAgLTg0LCAgICA4NSwKLSAgICAyMywgIC0yMDAsICAgLTc4LCAgIC0yOSwgICAxNDAsCi0gICAxMjIsICAgMjM3LCAgIDEwNiwgIC0zNDEsICAgMTM2LAotICAgLTU3LCAgLTE0MiwgICAtODUsICAgLTE2LCAgIC03NCwKLSAgIC01OSwgICAtOTAsICAgIC04LCAgLTE4NywgICAtMjAsCi0gIC0yMTEsICAtMjY3LCAgIDIxNiwgIC0xNzksICAtMTEwLAotICAgLTUwLCAgICAtNywgICAyMjAsICAtMjY3LCAgIC03MCwKLSAgIC01NywgICAtNDIsICAgLTE3LCAgIC0xNSwgICAgNzEsCi0gICAgMzIsICAgIDIxLCAgICA2MywgIC0xMzcsICAgIDMzLAotICAtMTM3LCAgLTE3NSwgICAxMDQsICAgLTY4LCAgICA5NywKLSAgIC02NywgICAtNDMsICAgMTMzLCAgLTMwMSwgICAyMjEsCi0gIC0xMTYsICAtMjAwLCAgIC04MSwgICAtOTIsICAtMjcyLAotICAgLTY0LCAgIC00MSwgICAtNTQsICAtMjQ0LCAgLTIyMCwKLSAgLTI4NywgIC0yNDIsICAgLTUwLCAgIC04NywgICAtODksCi0gIC0yNDUsICAgMjM2LCAgIDEwMiwgIC0xNjYsICAtMjk1LAotICAgIDY2LCAgICAyNCwgIC0xNjIsICAgLTcxLCAgICA5NSwKLSAgICA2NiwgICAxMzYsICAgLTkwLCAgLTIyMCwgICAtMzYsCi0gICAtOTgsICAtMTYxLCAgLTIyMiwgIC0xODgsICAgIDI5LAotICAgLTE4LCAgICAxOCwgICAtMTksICAtNDE1LCAgICAgOSwKLSAgICA0OSwgICAgNjEsICAgMTAwLCAgICAzOSwgICAtNTYsCi0gIC0xMTEsICAgIDgyLCAgIDEzNSwgICAtMzEsICAgIDUyLAotICAgLTkwLCAgLTE1MywgICAtOTMsICAgMTg5LCAgIDE4MiwKLSAgLTIxNCwgICAyOTUsICAgMTE5LCAgIC03NCwgICAyODQsCi0gICAgIDIsICAgMTM3LCAgICAzNywgICAgNDcsICAgMTgyLAotICAgIDkyLCAgIDExNywgICAxODQsICAgLTUzLCAgIDM3MywKLSAgIC0yMSwgICAtMTQsICAgLTM1LCAgIDEzNiwgICAzOTEsCi0gICAxNDYsICAgMTI5LCAgLTE2NCwgICAtMjgsICAgMzMzLAotICAgIDkyLCAgICA4MCwgICAtODQsICAgMTAwLCAgLTEzNCwKLSAgICAtOCwgICAyMTcsICAgLTMyLCAgICAgMywgICAtNDcsCi0gIC0xNTEsICAgMjUxLCAgLTIxNSwgICAxNDIsICAgIDkyLAotICAtMjI0LCAgIDMxMCwgIC0xNzIsICAtMjc1LCAgICA5OCwKLSAgIDE1OSwgICAxNTUsICAtMTc3LCAgIDExMiwgICAgNTMsCi0gICAyMDUsICAgIDI3LCAgICAgOCwgIC0yNDAsICAgMTkyLAotICAgMTY5LCAgIDEyMCwgIC0zMTksICAtMjAxLCAgIDEwNiwKLSAgICAxMSwgICAgMzYsICAgLTg2LCAgLTIzNywgICA0NTUsCi0gIC0xMDksICAtMTU0LCAgLTE2MywgICAxN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IC0xNywKLSAgIDIyMywgICAgOTIsICAgLTIxLCAgIC00OCwgICAtODIsICAgLTE0LCAgLTE2NywKLSAgICA1MSwgICAtMzcsICAtMjQzLCAgIC0zMCwgICAtOTAsICAgIDE4LCAgIC01NiwKLSAgICA1NCwgICAxMDUsICAgIDc0LCAgICA4NiwgICAgNjksICAgIDEzLCAgLTEwMSwKLSAgIDE5NiwgICAgNzIsICAgLTg5LCAgICA0MywgICAgNjUsICAgIDE5LCAgICAzOSwKLSAgIDEyMSwgICAgMzQsICAgMTMxLCAgIC04MiwgICAgMjUsICAgMjEzLCAgLTE1NiwKLSAgIDEwMSwgIC0xMDIsICAtMTM2LCAgIC0yMSwgICAgNTcsICAgMjE0LCAgICAyMiwKLSAgICAzNiwgIC0xMjQsICAgMjA1LCAgIDIwNCwgICAgNTgsICAtMTU2LCAgIC04MywKLSAgICA4MywgIC0xMTcsICAgMTM3LCAgIDEzNywgICAgODUsICAgMTE2LCAgICA0NCwKLSAgIC05MiwgIC0xNDgsICAgLTY4LCAgICAxMSwgIC0xMDIsICAtMTk3LCAgLTIyMCwKLSAgIC03NiwgIC0xODUsICAgLTU4LCAgIDEzMiwgICAtMjYsICAtMTgzLCAgICA4NSwKLSAgICAtNywgICAtMzEsICAgIC0yLCAgICAyMywgICAyMDUsICAtMTUxLCAgICAxMCwKLSAgIC0yNywgICAtMzcsICAgIC01LCAgIC0xOCwgICAyOTIsICAgMTMxLCAgICAgMSwKLSAgIDExNywgIC0xNjgsICAgICA5LCAgIC05MywgICAgODAsICAgLTU5LCAgLTEyNSwKLSAgLTE4MiwgIC0yNDQsICAgIDk4LCAgIC0yNCwgICAxMzUsICAgLTIyLCAgICA5NCwKLSAgIDIyMSwgICAgOTcsICAgMTA2LCAgICA0MiwgICAgNDMsICAtMTYwLCAgICA4MywKLSAgICAyNSwgICAtNjQsICAgLTIxLCAgICAgNiwgICAgMTQsICAgLTE1LCAgIDE1NCwKLSAgIDEyNiwgICAgMTUsICAtMTQwLCAgID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GUgTGljZW5zZS4KLSAqKiBZb3UgbWF5IG9idGFpbiBhIGNvcHkgb2YgdGhlIExpY2Vuc2UgYXQKLSAqKgotICoqICAgICBodHRwOi8vd3d3LmFwYWNoZS5vcmcvbGljZW5zZXMvTElDRU5TRS0yLjAKLSAqKgotICoqIFVubGVzcyByZXF1aXJlZCBieSBhcHBsaWNhYmxlIGxhdyBvciBhZ3JlZWQgdG8gaW4gd3JpdGluZywgc29mdHdhcmUKLSAqKiBkaXN0cmlidXRlZCB1bmRlciB0aGUgTGljZW5zZSBpcyBkaXN0cmlidXRlZCBvbiBhbiAiQVMgSVMiIEJBU0lTLAotICoqIFdJVEhPVVQgV0FSUkFOVElFUyBPUiBDT05ESVRJT05TIE9GIEFOWSBLSU5ELCBlaXRoZXIgZXhwcmVzcyBvciBpbXBsaWVkLgotICoqIFNlZSB0aGUgTGljZW5zZSBmb3IgdGhlIHNwZWNpZmljIGxhbmd1YWdlIGdvdmVybmluZyBwZXJtaXNzaW9ucyBhbmQKLSAqKiBsaW1pdGF0aW9ucyB1bmRlciB0aGUgTGljZW5zZS4KLSAqLwotCi0vKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKLSoKLSogICAgICBGaWxlICAgICAgICAgICAgIDogdHlwZWRlZi5jCi0qICAgICAgUHVycG9zZSAgICAgICAgICA6IEJhc2ljIHR5cGVzLgotKgotKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotCi0jaWZuZGVmIF9fVFlQRURFRl9IX18KLSNkZWZpbmUgX19UWVBFREVGX0hfXwotCi0jdW5kZWYgT1JJR0lOQUxfVFlQRURFRl9IIC8qIGRlZmluZSB0byBnZXQgIm9yaWdpbmFsIiBFVFNJIHZlcnNpb24KLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgb2YgdHlwZWRlZi5oICAgICAgICAgICAg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zc2lvbnMgYW5kCi0gKiogbGltaXRhdGlvbnMgdW5kZXIgdGhlIExpY2Vuc2UuCi0gKi8KLQotLyoKLSoKLSogICAgICBGaWxlICAgICAgICAgICAgIDogdHlwZWRlZnMuaAotKiAgICAgIERlc2NyaXB0aW9uICAgICAgOiBEZWZpbml0aW9uIG9mIHBsYXRmb3JtIGluZGVwZW5kZW50IGRhdGEKLSogICAgICAgICAgICAgICAgICAgICAgICAgdHlwZXMgYW5kIGNvbnN0YW50cwotKgotKgotKiAgICAgIFRoZSBmb2xsb3dpbmcgcGxhdGZvcm0gaW5kZXBlbmRlbnQgZGF0YSB0eXBlcyBhbmQgY29ycmVzcG9uZGluZwotKiAgICAgIHByZXByb2Nlc3NvciAoI2RlZmluZSkgY29uc3RhbnRzIGFyZSBkZWZpbmVkOgotKgotKiAgICAgICAgZGVmaW5lZCB0eXBlICBtZWFuaW5nICAgICAgICAgICBjb3JyZXNwb25kaW5nIGNvbnN0YW50cwotKiAgICAgICAgLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLQotKiAgICAgICAgQ2hhciAgICAgICAgICBjaGFyYWN0ZXIgICAgICAgICAobm9uZSkKLSogICAgICAgIEJvb2wgICAgICAgICAgYm9vbGVhbiAgICAgICAgICAgdHJ1ZSwgZmFsc2UKLSogICAgICAgIFdvcmQ4ICAgICAgICAgOC1iaXQgc2lnbmVkICAgICAgbWluV29yZDgsICAgbWF4V29yZDgKLSogICAgICAgIFVXb3JkOCAgICAgICAgOC1iaXQgdW5zaWduZWQgICAgbWluVVdvcmQ4LCAgbWF4VVdvcmQ4Ci0qICAgICAgICBXb3JkMTYgICAgICAgIDE2LWJpdCBzaWduZWQgICAgIG1pbldvcmQxNiwgIG1heFdvcmQxNgotKiAgICAgICAgVVdvcmQxNiAgICAgICAxNi1iaXQgdW5zaWduZWQgICBtaW5VV29yZDE2LCBtYXhVV29yZDE2Ci0qICAgICAgICBXb3JkMzIgICAgICAgIDMyLWJpdCBzaWduZWQgICAgIG1pbldvcmQzMiwgIG1heFdvcmQzMgotKiAgICAgICAgVVdvcmQzMiAgICAgICAzMi1iaXQgdW5zaWduZWQgICBtaW5VV29yZDMyLCBtYXhVV29yZDMyCi0qICAgICAgICBGbG9hdCAgICAgICAgIGZsb2F0aW5nIHBvaW50ICAgIG1pbkZsb2F0LCAgIG1heEZsb2F0Ci0qCi0qCi0qICAgICAgVGhlIGZvbGxvd2luZyBjb21waWxlIHN3aXRjaGVzIGFyZSAjZGVmaW5lZDoKLSoKLSogICAgICAgIFBMQVRGT1JNICAgICAgc3RyaW5nIGluZGljYXRpbmcgcGxhdGZvcm0gcHJvZ2FtIGlzIGNvbXBpbGVkIG9uCi0qICAgICAgICAgICAgICAgICAgICAgIHBvc3NpYmxlIHZhbHVlczogIk9TRiIsICJQQyIsICJTVU4iCi0qCi0qICAgICAgICBPU0YgICAgICAgICAgIG9ubHkgZGVmaW5lZCBpZiB0aGUgY3VycmVudCBwbGF0Zm9ybSBpcyBhbiBBbHBoYQotKiAgICAgICAgUEMgICAgICAgICAgICBvbmx5IGRlZmluZWQgaWYgdGhlIGN1cnJlbnQgcGxhdGZvcm0gaXMgYSBQQwotKiAgICAgICAgU1VOICAgICAgICAgICBvbmx5IGRlZmluZWQgaWYgdGhlIGN1cnJlbnQgcGxhdGZvcm0gaXMgYSBTdW4KLSoKLSogICAgICAgIExTQkZJUlNUICAgICAgaXMgZGVmaW5lZCBpZiB0aGUgYnl0ZSBvcmRlciBvbiB0aGlzIHBsYXRmb3JtIGlzCi0qICAgICAgICAgICAgICAgICAgICAgICJsZWFzdCBzaWduaWZpY2FudCBieXRlIGZpcnN0IiAtPiBkZWZpbmVkIG9uIERFQyBBbHBoYQotKiAgICAgICAgICAgICAgICAgICAgICBhbmQgUEMsIHVuZGVmaW5lZCBvbiBTdW4KLSoKLSoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCi0qLwotCi0jaWZuZGVmIF9fVFlQRURFRlNfSF9fCi0jZGVmaW5lIF9fVFlQRURFRlNfSF9fCi0KLS8qCi0qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgotKiAgICAgICAgICAgICAgICAgICAgICAgICBJTkNMVURFIEZJTEVTCi0qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgotKi8KLSNpbmNsdWRlIDxmbG9hdC5oPgotI2luY2x1ZGUgPGxpbWl0cy5oPgotCi0KLQotLyoKLSoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCi0qICAgICAgICAgICAgICAgICAgICAgICAgIERFRklOSVRJT04gT0YgQ09OU1RBTlRTCi0qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgotKi8KLS8qCi0gKioqKioqKioqIGRlZmluZSBjaGFyIHR5cGUKLSAqLwotdHlwZWRlZiBjaGFyIENoYXI7Ci0KLS8qCi0gKioqKioqKioqIGRlZmluZSA4IGJpdCBzaWduZWQvdW5zaWduZWQgdHlwZXMgJiBjb25zdGFudHMKLSAqLwotI2lmIFNDSEFSX01BWCA9PSAxMjcKLXR5cGVkZWYgc2lnbmVkIGNoYXIgV29yZDg7Ci0jZGVmaW5lIG1pbldvcmQ4ICBTQ0hBUl9NSU4KLSNkZWZpbmUgbWF4V29yZDggIFNDSEFSX01BWAotCi10eXBlZGVmIHVuc2lnbmVkIGNoYXIgVVdvcmQ4OwotI2RlZmluZSBtaW5VV29yZDggMAotI2RlZmluZSBtYXhVV29yZDggVUNIQVJfTUFYCi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qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0jaW5jbHVkZSAidHlwZWRlZi5oIgotI2luY2x1ZGUgIndiX3ZhZF9jLmgiCi0jaW5jbHVkZSAidm9NZW0uaCIKLQotLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgotICogICAgICAgICAgICAgICAgICAgICAgICAgREVGSU5JVElPTiBPRiBEQVRBIFRZUEVTCi0gKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotCi10eXBlZGVmIHN0cnVjdAotewotCVdvcmQxNiBiY2tyX2VzdFtDT01QTEVOXTsgICAgICAgICAgICAgIC8qIGJhY2tncm91bmQgbm9pc2UgZXN0aW1hdGUgICAgICAgICAgICAgICAgKi8KLQlXb3JkMTYgYXZlX2xldmVsW0NPTVBMRU5dOyAgICAgICAgICAgICAvKiBhdmVyYWdlZCBpbnB1dCBjb21wb25lbnRzIGZvciBzdGF0aW9uYXJ5ICovCi0JLyogZXN0aW1hdGlvbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotCVdvcmQxNiBvbGRfbGV2ZWxbQ09NUExFTl07ICAgICAgICAgICAgIC8qIGlucHV0IGxldmVscyBvZiB0aGUgcHJldmlvdXMgZnJhbWUgICAgICAgKi8KLQlXb3JkMTYgc3ViX2xldmVsW0NPTVBMRU5dOyAgICAgICAgICAgICAvKiBpbnB1dCBsZXZlbHMgY2FsY3VsYXRlZCBhdCB0aGUgZW5kIG9mIGEgZnJhbWUgKGxvb2thaGVhZCkgICovCi0JV29yZDE2IGFfZGF0YTVbRl81VEhfQ05UXVsyXTsgICAgICAgICAgLyogbWVtb3J5IGZvciB0aGUgZmlsdGVyIGJhbmsgICAgICAgICAgICAgICAqLwotCVdvcmQxNiBhX2RhdGEzW0ZfM1RIX0NOVF07ICAgICAgICAgICAgIC8qIG1lbW9yeSBmb3IgdGhlIGZpbHRlciBiYW5rICAgICAgICAgICAgICAgKi8KLQotCVdvcmQxNiBidXJzdF9jb3VudDsgICAgICAgICAgICAgICAgICAgIC8qIGNvdW50cyBsZW5ndGggb2YgYSBzcGVlY2ggYnVyc3QgICAgICAgICAgKi8KLQlXb3JkMTYgaGFuZ19jb3VudDsgICAgICAgICAgICAgICAgICAgICAvKiBoYW5nb3ZlciBjb3VudGVyICAgICAgICAgICAgICAgICAgICAgICAgICovCi0JV29yZDE2IHN0YXRfY291bnQ7ICAgICAgICAgICAgICAgICAgICAgLyogc3RhdGlvbmFyeSBjb3VudGVyICAgICAgICAgICAgICAgICAgICAgICAqLwotCi0JLyogTm90ZSB0aGF0IGVhY2ggb2YgdGhlIGZvbGxvd2luZyB0d28gdmFyaWFibGVzIGhvbGRzIDE1IGZsYWdzLiBFYWNoIGZsYWcgcmVzZXJ2ZXMgMSBiaXQgb2YgdGhlCi0JICogdmFyaWFibGUuIFRoZSBuZXdlc3QgZmxhZyBpcyBpbiB0aGUgYml0IDE1IChhc3N1bWluZyB0aGF0IExTQiBpcyBiaXQgMSBhbmQgTVNCIGlzIGJpdCAxNikuICovCi0JV29yZDE2IHZhZHJlZzsgICAgICAgICAgICAgICAgICAgICAgICAgLyogZmxhZ3MgZm9yIGludGVybWVkaWF0ZSBWQUQgZGVjaXNpb25zICAgICAqLwotCVdvcmQxNiB0b25lX2ZsYWc7ICAgICAgICAgICAgICAgICAgICAgIC8qIHRvbmUgZGV0ZWN0aW9uIGZsYWdzICAgICAgICAgICAgICAgICAgICAgKi8KLQotCVdvcmQxNiBzcF9lc3RfY250OyAgICAgICAgICAgICAgICAgICAgIC8qIGNvdW50ZXIgZm9yIHNwZWVjaCBsZXZlbCBlc3RpbWF0aW9uICAgICAgKi8KLQlXb3JkMTYgc3BfbWF4OyAgICAgICAgICAgICAgICAgICAgICAgICAvKiBtYXhpbXVtIGxldmVsICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0JV29yZDE2IHNwX21heF9jbnQ7ICAgICAgICAgICAgICAgICAgICAgLyogY291bnRzIGZyYW1lcyB0aGF0IGNvbnRhaW5zIHNwZWVjaCAgICAgICAqLwotCVdvcmQxNiBzcGVlY2hfbGV2ZWw7ICAgICAgICAgICAgICAgICAgIC8qIGVzdGltYXRlZCBzcGVlY2ggbGV2ZWwgICAgICAgICAgICAgICAgICAgKi8KLQlXb3JkMzIgcHJldl9wb3dfc3VtOyAgICAgICAgICAgICAgICAgICAvKiBwb3dlciBvZiBwcmV2aW91cyBmcmFtZSAgICAgICAgICAgICAgICAgICovCi0KLX0gVmFkVmFyczsKLQotLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCi0gKgotICogREVDTEFSQVRJT04gT0YgUFJPVE9UWVBFUwotICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotCi1Xb3JkMTYgd2JfdmFkX2luaXQoVmFkVmFycyAqKiBzdCwgVk9fTUVNX09QRVJBVE9SICpwTWVtT1ApOwotV29yZDE2IHdiX3ZhZF9yZXNldChWYWRWYXJzICogc3QpOwotdm9pZCB3Yl92YWRfZXhpdChWYWRWYXJzICoqIHN0LCBWT19NRU1fT1BFUkFUT1IgKnBNZW1PUCk7Ci12b2lkIHdiX3ZhZF90b25lX2RldGVjdGlvbihWYWRWYXJzICogc3QsIFdvcmQxNiBwX2dhaW4pOwotV29yZDE2IHdiX3ZhZChWYWRWYXJzICogc3QsIFdvcmQxNiBpbl9idWZbXSk7Ci0KLSNlbmRpZiAgLy9fX1dCX1ZBRF9IX18KLQotCmRpZmYgLS1naXQgYS9tZWRpYS9saWJzdGFnZWZyaWdodC9jb2RlY3MvYW1yd2J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ZmluZSBTVEFUX1RIUiAxMDAwICAgICAgICAgICAgICAgICAgICAgIC8qIFRocmVzaG9sZCBmb3Igc3RhdGlvbmFyaXR5IGRldGVjdGlvbiAgICAgICAgICAgICAgKi8KLQotLyogTGltaXRzIGZvciBiYWNrZ3JvdW5kIG5vaXNlIGVzdGltYXRlICovCi0jZGVmaW5lIE5PSVNFX01JTiA0MCAgICAgICAgICAgICAgICAgICAgICAgLyogbWluaW11bSAqLwotI2RlZmluZSBOT0lTRV9NQVggMjAwMDAgICAgICAgICAgICAgICAgICAgIC8qIG1heGltdW0gKi8KLSNkZWZpbmUgTk9JU0VfSU5JVCAxNTAgICAgICAgICAgICAgICAgICAgICAvKiBpbml0aWFsICovCi0KLS8qIFRocmVzaG9sZHMgZm9yIHNpZ25hbCBwb3dlciAobm93IGNhbGN1bGF0ZWQgb24gMiBmcmFtZXMpICovCi0jZGVmaW5lIFZBRF9QT1dfTE9XIChXb3JkMzIpMzAwMDBMICAgICAgICAgLyogSWYgaW5wdXQgcG93ZXIgaXMgbG93ZXIgdGhhbiB0aGlzLCBWQUQgaXMgc2V0IHRvIDAgKi8KLSNkZWZpbmUgUE9XX1RPTkVfVEhSIChXb3JkMzIpNjg2MDgwTCAgICAgICAvKiBJZiBpbnB1dCBwb3dlciBpcyBsb3dlcix0b25lIGRldGVjdGlvbiBmbGFnIGlzIGlnbm9yZWQgKi8KLQotLyogQ29uc3RhbnRzIGZvciB0aGUgZmlsdGVyIGJhbmsgKi8KLSNkZWZpbmUgQ09FRkYzICAgMTMzNjMgICAgICAgICAgICAgICAgICAgICAvKiBjb2VmZmljaWVudCBmb3IgdGhlIDNyZCBvcmRlciBmaWx0ZXIgICAgICovCi0jZGVmaW5lIENPRUZGNV8xIDIxOTU1ICAgICAgICAgICAgICAgICAgICAgLyogMXN0IGNvZWZmaWNpZW50IHRoZSBmb3IgNXRoIG9yZGVyIGZpbHRlciAqLwotI2RlZmluZSBDT0VGRjVfMiA2MzkwICAgICAgICAgICAgICA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ciBhZ3JlZWQgdG8gaW4gd3JpdGluZywgc29mdHdhcmUKLUAgKiogZGlzdHJpYnV0ZWQgdW5kZXIgdGhlIExpY2Vuc2UgaXMgZGlzdHJpYnV0ZWQgb24gYW4gIkFTIElTIiBCQVNJUywKLUAgKiogV0lUSE9VVCBXQVJSQU5USUVTIE9SIENPTkRJVElPTlMgT0YgQU5ZIEtJTkQsIGVpdGhlciBleHByZXNzIG9yIGltcGxpZWQuCi1AICoqIFNlZSB0aGUgTGljZW5zZSBmb3IgdGhlIHNwZWNpZmljIGxhbmd1YWdlIGdvdmVybmluZyBwZXJtaXNzaW9ucyBhbmQKLUAgKiogbGltaXRhdGlvbnMgdW5kZXIgdGhlIExpY2Vuc2UuCi1AICovCi0KLUB2b2lkIERlZW1waF8zMigKLUAgICAgIFdvcmQxNiB4X2hpW10sICAgICAgICAgICAgICAgICAgICAgICAgLyogKGkpICAgICA6IGlucHV0IHNpZ25hbCAoYml0MzEuLjE2KSAqLwotQCAgICAgV29yZDE2IHhfbG9bXSwgICAgICAgICAgICAgICAgICAgICAgICAvKiAoaSkgICAgIDogaW5wdXQgc2lnbmFsIChiaXQxNS4uNCkgICovCi1AICAgICBXb3JkMTYgeVtdLCAgICAgICAgICAgICAgICAgICAgICAgICAgIC8qIChvKSAgICAgOiBvdXRwdXQgc2lnbmFsICh4MTYpICAgICAgKi8KLUAgICAgIFdvcmQxNiBtdSwgICAgICAgICAgICAgICAgICAgICAgICAgICAgLyogKGkpIFExNSA6IGRlZW1waGFzaXMgZmFjdG9yICAgICAgICAqLwotQCAgICAgV29yZDE2IEwsICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvKiAoaSkgICAgIDogdmVjdG9yIHNpemUgICAgICAgICAgICAgICovCi1AICAgICBXb3JkMTYgKiBtZW0gICAgICAgICAgICAgICAgICAgICAgICAgIC8qIChpL28pICAgOiBtZW1vcnkgKHlbLTFdKSAgICAgICAgICAgKi8KLUAgICAgICkKLQotQHhfaGkgICAgIFJOICAgICAgUjAKLUB4X2xvICAgICBSTiAgICAgIFIxCi1AeVtdICAgICAgUk4gICAgICBSMgotQCptZW0gICAgIFJOICAgICAgUjMKLQotICAgICAgICAgICAuc2VjdGlvbiAgLnRleHQKLSAgICAgICAgICAgLmdsb2JhbCAgIERlZW1waF8zMl9hc20KLQotRGVlbXBoXzMyX2FzbToKLQotICAgICAgICAgICBTVE1GRCAgIAlyMTMhLCB7cjQgLSByMTIsIHIxNH0KLQkgICBNT1YgICAgICAgICAgcjQsICMyICAgICAgICAgICAgICAgICAgIEBpPTAKLQkgICBMRFJTSCAgICAgICAgcjYsIFtyMF0sICMyICAgICAgICAgICAgIEBsb2FkIHhfaGlbMF0KLQkgICBMRFJTSCAgICAgICAgcjcsIFtyMV0sICMyICAgICAgICAgICAgIEBsb2FkIHhfbG9bMF0KLQkgICBMRFIgICAgICAgICAgcjUsID0yMjI4MiAgICAgICAgICAgICAgIEByNS0tLW11Ci0JICAgTU9WICAgICAgICAgIHIxMSwgIzB4ODAwMAotCi0gICAgICAgICAgIEB5WzBdCi0JICAgTU9WICAgICAgICAgIHIxMCwgcjYsIExTTCAjMTYgICAgICAgICBATF90bXAgPSB4X2hpWzBdPDwxNgotCSAgIE1PViAgICAgICAgICByOCwgIHI1LCBBU1IgIzEgICAgICAgICAgQGZhYyA9IG11ID4+IDEKLQkgICBMRFIgICAgICAgICAgcjUsICBbcjNdCi0JICAgQUREICAgICAgICAgIHIxMiwgcjEwLCByNywgTFNMICM0ICAgICBATF90bXAgKz0geF9sb1swXSA8PCA0Ci0JICAgTU9WICAgICAgICAgIHIxMCwgcjEyLCBMU0wgIzMgICAgICAgICBATF90bXAgPDw9IDMKLQkgICBNVUwgICAgICAgICAgcjksIHI1LCByOAotCSAgIExEUlNIICAgICAgICByNiwgW3IwXSwgIzIgICAgICAgICAgICAgQGxvYWQgeF9oaVsxXQotCSAgIFFEQUREICAgICAgICByMTAsIHIxMCwgcjkKLQkgICBMRFJTSCAgICAgICAgcjcsIFtyMV0sICMyICAgICAgICAgICAgIEBsb2FkIHhfbG9bMV0KLQkgICBNT1YgICAgICAgICAgcjEyLCByMTAsIExTTCAjMSAgICAgICAgIEBMX3RtcCA9IExfbWFjKExfdG1wLCAqbWVtLCBmYWMpCi0JICAgUUFERCAgICAgICAgIHIxMCwgcjEyLCByMTEKLQkgICBNT1YgICAgICAgICAgcjE0LCByMTAsIEFTUiAjMTYgICAgICAgIEB5WzBdID0gcm91bmQoTF90bXApCi0KLQotCSAgIE1PViAgICAgICAgICByMTAsIHI2LCBMU0wgIzE2Ci0JICAgQUREICAgICAgICAgIHIxMiwgcjEwLCByNywgTFNMICM0Ci0gICAgICAgICAgIFNUUkggICAgICAgICByMTQsIFtyMl0sICMyICAgICAgICAgICAgQHVwZGF0ZSB5WzBdCi0JICAgTU9WICAgICAgICAgIHIxMCwgcjEyLCBMU0wgIzMKLQkgICBNVUwgICAgICAgICAgcjksIHIxNCwgcjgKLQkgICBRREFERCAgICAgICAgcjEwLCByMTAsIHI5Ci0JICAgTU9WICAgICAgICAgIHIxMiwgcjEwLCBMU0wgIzEKLQkgICBRQUREICAgICAgICAgcjEwLCByMTIsIHIxMQotCSAgIE1PViAgICAgICAgICByMTQsIHIxMCwgQVNSICMxNiAgICAgICAgQHlbMV0gPSByb3VuZChMX3RtcCkKLQotTE9PUDoKLSAgICAgICAgICAgTERSU0ggICAgICAgIHI2LCBbcjBdLCAjMiAgICAgICAgICAgICBAbG9hZCB4X2hpW10KLQkgICBMRFJTSCAgICAgICAgcjcsIFtyMV0sICMyCi0JICAgU1RSSCAgICAgICAgIHIxNCwgW3IyXSwgIzIKLQkgICBNT1YgICAgICAgICAgcjEwLCByNiwgTFNMICMxNgotCSAgIEFERCAgICAgICAgICByMTIsIHIxMCwgcjcsIExTTCAjNAotCSAgIE1VTCAgICAgICAgICByOSwgcjE0LCByOAotCSAgIE1PViAgICAgICAgICByMTAsIHIxMiwgTFNMICMzCi0JICAgUURBREQgICAgICAgIHIxMCwgcjEwLCByOQotICAgICAgICAgICBMRFJTSCAgICAgICAgcjYsIFtyMF0sICMyICAgICAgICAgICAgIEBsb2FkIHhfaGlbXQotCSAgIE1PViAgICAgICAgICByMTIsIHIxMCwgTFNMICMxCi0JICAgUUFERCAgICAgICAgIHIxMCwgcjEyLCByMTEKLQkgICBMRFJTSCAgICAgICAgcjcsIFtyMV0sICMyCi0JICAgTU9WICAgICAgICAgIHIxNCwgcjEwLCBBU1IgIzE2Ci0KLQkgICBNT1YgICAgICAgICAgcjEwLCByNiwgTFNMICMxNgotCSAgIEFERCAgICAgICAgICByMTIsIHIxMCwgcjcsIExTTCAjNAotCSAgIFNUUkggICAgICAgICByMTQsIFtyMl0sICMyCi0JICAgTVVMICAgICAgICAgIHI5LCByMTQsIHI4Ci0JICAgTU9WICAgICAgICAgIHIxMCwgcjEyLCBMU0wgIzMKLQkgICBRREFERCAgICAgICAgcjEwLCByMTAsIHI5Ci0gICAgICAgICAgIEFERCAgICAgICAgICByNCwgcjQsICMyCi0JICAgTU9WICAgICAgICAgIHIxMiwgcjEwLCBMU0wgIzEKLQkgICBRQUREICAgICAgICAgcjEwLCByMTIsIHIxMQotICAgICAgICAgICBDTVAgICAgICAgICAgcjQsICM2NAotCSAgIE1PViAgICAgICAgICByMTQsIHIxMCwgQVNSICMxNgotCi0gICAgICAgICAgIEJMVCAgICAgICAgICBMT09QCi0gICAgICAgICAgIFNUUiAgICAgICAgICByMTQsIFtyM10KLSAgICAgICAgICAgU1RSSCAgICAgICAgIHIxNCwgW3IyXQotCi0gICAgICAgICAgIExETUZEICAgCXIxMyEsIHtyNCAtIHIxMiwgcjE1fQotCi0JICAgQEVORFAKLQkgICAuRU5ECi0KLQpkaWZmIC0tZ2l0IGEvbWVkaWEvbGlic3RhZ2VmcmlnaHQvY29kZWNzL2FtcndiZW5jL3NyYy9hc20vQVJNVjVFL0RvdF9wX29wdC5zIGIvbWVkaWEvbGlic3RhZ2VmcmlnaHQvY29kZWNzL2FtcndiZW5jL3NyYy9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ZGVyIHRoZSBMaWNlbnNlLgotQCAqLwotQAotQFdvcmQzMiBEb3RfcHJvZHVjdDEyKCAgICAgICAgICAgICAgICAgICAgICAvKiAobykgUTMxOiBub3JtYWxpemVkIHJlc3VsdCAoMSA8IHZhbCA8PSAtMSkgKi8KLUAgICAgICAgV29yZDE2IHhbXSwgICAgICAgICAgICAgICAgICAgICAgICAgICAvKiAoaSkgMTJiaXRzOiB4IHZlY3RvciAgICAgICAgICAgICAgICAgICAgICAgKi8KLUAgICAgICAgV29yZDE2IHlbXSwgICAgICAgICAgICAgICAgICAgICAgICAgICAvKiAoaSkgMTJiaXRzOiB5IHZlY3RvciAgICAgICAgICAgICAgICAgICAgICAgKi8KLUAgICAgICAgV29yZDE2IGxnLCAgICAgICAgICAgICAgICAgICAgICAgICAgICAvKiAoaSkgICAgOiB2ZWN0b3IgbGVuZ3RoICAgICAgICAgICAgICAgICAgICAgKi8KLUAgICAgICAgV29yZDE2ICogZXhwICAgICAgICAgICAgICAgICAgICAgICAgICAvKiAobykgICAgOiBleHBvbmVudCBvZiByZXN1bHQgKDAuLiszMCkgICAgICAgKi8KLUApCi1AKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgotQCAgeFtdICAgLS0tICByMAotQCAgeVtdICAgLS0tICByMQotQCAgbGcgICAgLS0tICByMgotQCAgKmV4cCAgLS0tICByMwotCi0gICAgICAgICAgLnNlY3Rpb24gIC50ZXh0Ci0gCSAgLmdsb2JhbCAgIERvdF9wcm9kdWN0MTJfYXNtCi0KLURvdF9wcm9kdWN0MTJfYXNtOgotCi0gICAgICAgICAgU1RNRkQgICAJICAgIHIxMyEsIHtyNCAtIHIxMiwgcjE0fQotICAgICAgICAgIE1PViAgICAgICAgICAgICAgIHI0LCAjMCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEAgTF9zdW0gPSAwCi0gICAgICAgICAgTU9WICAgICAgICAgICAgICAgcjUsICMwICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgQCBpID0gMAotCi1MT09QOgotICAgICAgICAgIExEUiAgICAgICAgICAgcjYsIFtyMF0sICM0Ci0gICAgICAgICAgTERSICAgICAgICAgICByNywgW3IxXSwgIzQKLSAgICAgICAgICBMRFIgICAgICAgICAgIHI4LCBbcjBdLCAjNAotICAgICAgICAgIFNNTEFCQiAgICAgICAgcjQsIHI2LCByNywgcjQKLSAgICAgICAgICBMRFIgICAgICAgICAgIHI5LCBbcjFdLCAjNAotCSAgU01MQVRUICAgICAgICByNCwgcjYsIHI3LCByNAotCi0JICBMRFIgICAgICAgICAgIHI2LCBbcjBdLCAjNAotCSAgU01MQUJCICAgICAgICByNCwgcjgsIHI5LCByNAotCi0JICBMRFIgICAgICAgICAgIHI3LCBbcjFdLCAjNAotCSAgU01MQVRUICAgICAgICByNCwgcjgsIHI5LCByNAotCSAgTERSICAgICAgICAgICByOCwgW3IwXSwgIzQKLQotCSAgU01MQUJCICAgICAgICByNCwgcjYsIHI3LCByNAotCSAgTERSICAgICAgICAgICByOSwgW3IxXSwgIzQKLQkgIFNNTEFUVCAgICAgICAgcjQsIHI2LCByNywgcjQKLQkgIEFERCAgICAgICAgICAgcjUsIHI1LCAjOAotCSAgU01MQUJCICAgICAgICByNCwgcjgsIHI5LCByNAotCSAgQ01QICAgICAgICAgICByNSwgcjIKLQkgIFNNTEFUVCAgICAgICAgcjQsIHI4LCByOSwgcjQKLQkgIEJMVCAgICAgICAgICAgTE9PUAotCi0gICAgICAgICAgTU9WICAgICAgICAgICByMTIsIHI0LCBMU0wgIzEKLSAgICAgICAgICBBREQgICAgICAgICAgIHIxMiwgcjEyLCAjMSAgICAgICAgICAgICAgICAgICAgICAgICBAIExfc3VtID0gKExfc3VtIDw8IDEpICArIDEKLQkgIE1PViAgICAgICAgICAgcjQsIHIxMgotCi0gICAgICAgICAgQ01QICAgICAgICAgICByMTIsICMwCi0JICBSU0JMVCAgICAgICAgIHI0LCByMTIsICMwCi0gICAgICAgICAgQ0xaICAgICAgICAgICByMTAsIHI0Ci0gICAgICAgICAgU1VCICAgICAgICAgICByMTAsIHIxMCwgIzEgICAgICAgICAgICAgICAgICAgICAgICAgQCBzZnQgPSBub3JtX2woTF9zdW0pCi0gICAgICAgICAgTU9WICAgICAgICAgICByMCwgcjEyLCBMU0wgcjEwICAgICAgICAgICAgICAgICAgICAgQCBMX3N1bSA9IExfc3VtIDw8IHNmdAotICAgICAgICAgIFJTQiAgICAgICAgICAgcjExLCByMTAsICMzMCAgICAgICAgICAgICAgICAgICAgICAgIEAgKmV4cCA9IDMwIC0gc2Z0Ci0gICAgICAgICAgU1RSSCAgICAgICAgICByMTEsIFtyM10KLQotRG90X3Byb2R1Y3QxMl9lbmQ6Ci0KLSAgICAgICAgICBMRE1GRCAgIAkgICAgcjEzISwge3I0IC0gcjEyLCByMTV9Ci0gICAgICAgICAgQEVOREZVTkMKLSAgICAgICAgICAuRU5ECi0KLQpkaWZmIC0tZ2l0IGEvbWVkaWEvbGlic3RhZ2VmcmlnaHQvY29kZWNzL2FtcndiZW5jL3NyYy9hc20vQVJNVjVFL0ZpbHRfNmtfN2tfb3B0LnMgYi9tZWRpYS9saWJzdGFnZWZyaWdodC9jb2RlY3MvYW1yd2JlbmMvc3JjL2FzbS9BUk1WNUUvRmlsdF82a183a19vcHQucwpkZWxldGVkIGZpbGUgbW9kZSAxMDA2NDQKaW5kZXggODU2YWRhOC4uMDAwMDAwMAotLS0gYS9tZWRpYS9saWJzdGFnZWZyaWdodC9jb2RlY3MvYW1yd2JlbmMvc3JjL2FzbS9BUk1WNUUvRmlsdF82a183a19vcHQucworKysgL2Rldi9udWxsCkBAIC0xLDE4NSArMCwwIEBACi1ALyoKLUAgKiogQ29weXJpZ2h0IDIwMDMtMjAxMCwgVmlzdWFsT24sIEluYy4KLUAgKioKLUAgKiogTGljZW5zZWQgdW5kZXIgdGhlIEFwYWNoZSBMaWNlbnNlLCBWZXJzaW9uIDIuMCAodGhlICJMa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AgLyogaW4vb3V0OiBtZW1vcnkgKHNpemU9MzApICAgICAgICAqLwotQCkKLUAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKLUAgcjAgICAgLS0tICBzaWduYWxbXQotQCByMSAgICAtLS0gIGxnCi1AIHIyICAgIC0tLSAgbWVtW10KLQotICAgICAgICAgIC5zZWN0aW9uICAudGV4dAotICAgICAgICAgIC5nbG9iYWwgIEZpbHRfNmtfN2tfYXNtCi0gICAgICAgICAgLmV4dGVybiAgdm9BV0JfQ29weQotICAgICAgICAgIC5leHRlcm4gIGZpcl82a183awotCi1GaWx0XzZrXzdrX2FzbToKLQotICAgICAgICAgIFNUTUZEICAgCQlyMTMhLCB7cjQgLSByMTIsIHIxNH0KLSAgICAgICAgICBTVUIgICAgCQlyMTMsIHIxMywgIzI0MCAgICAgICAgICAgICAgQCB4W0xfU1VCRlIxNmsgKyAoTF9GSVIgLSAxKV0KLSAgICAgICAgICBNT1YgICAgIAkJcjgsIHIwICAgICAgICAgICAgICAgICAgICAgIEAgY29weSBzaWduYWxbXSBhZGRyZXNzCi0gICAgICAgICAgTU9WICAgICAJCXI0LCByMSAgICAgICAgICAgICAgICAgICAgICBAIGNvcHkgbGcgYWRkcmVzcwotICAgICAgICAgIE1PViAgICAgCQlyNSwgcjIgICAgICAgICAgICAgICAgICAgICAgQCBjb3B5IG1lbVtdIGFkZHJlc3MKLQotICAgICAgICAgIE1PViAgICAgCQlyMSwgcjEzCi0gICAgICAgICAgTU9WICAgICAJCXIwLCByMgotICAgICAgICAgIE1PViAgICAgCQlyMiwgIzMwICAgICAgICAgICAgICAgICAgICAgQCBMX0ZJUiAtIDEKLSAgICAgICAgICBCTCAgICAgIAkJdm9BV0JfQ29weSAgICAgICAgICAgICAgICAgICBAIG1lbWNweSh4LCBtZW0sIChMX0ZJUiAtIDEpPDwxKQotCi0gICAgICAgICAgTERSICAgICAJCXIxMCwgTGFibGUxICAgICAgICAgICAgICAgICBAIGdldCBmaXJfN2sgYWRkcmVzcwotCi0gICAgICAgICAgTU9WICAgICAgICAgICAJcjE0LCAjMAotICAgICAgICAgIE1PViAgICAgICAgICAgICAgICAgICByMywgcjggICAgICAgICAgICAgICAgICAgICAgQCBjaGFuZ2UgbXlNZW1Db3B5IHRvIENvcHksIGR1ZSB0byBDb3B5IHdpbGwgY2hhbmdlIHIzIGNvbnRlbnQKLSAgICAgICAgICBBREQgICAgIAkgICAgCXI2LCByMTMsICM2MCAgICAgICAgICAgICAgICBAIGdldCB4W0xfRklSIC0gMV0gYWRkcmVzcwotICAgICAgICAgIE1PViAgICAgICAgICAgCXI3LCByMyAgICAgICAgICAgICAgICAgICAgICBAIGdldCBzaWduYWxbaV0KLUxPT1AxOgotICAgICAgICAgIExEUlNIICAgICAgICAgCXI4LCAgW3I3XSwgIzIKLSAgICAgICAgICBMRFJTSCAgICAgICAgIAlyOSwgIFtyN10sICMyCi0gICAgICAgICAgTU9WICAgICAgICAgICAJcjgsIHI4LCBBU1IgIzIKLSAgICAgICAgICBNT1YgICAgICAgICAgIAlyOSwgcjksIEFTUiAjMgotICAgICAgICAgIExEUlNIICAgICAgICAgCXIxMSwgW3I3XSwgIzIKLSAgICAgICAgICBMRFJTSCAgICAgICAgIAlyMTIsIFtyN10sICMyCi0gICAgICAgICAgTU9WICAgICAgICAgICAJcjExLCByMTEsIEFTUiAjMgotICAgICAgICAgIE1PViAgICAgICAgICAgCXIxMiwgcjEyLCBBU1IgIzIKLSAgICAgICAgICBTVFJIICAgICAgICAgIAlyOCwgW3I2XSwgIzIKLSAgICAgICAgICBTVFJIICAgICAgICAgIAlyOSwgW3I2XSwgIzIKLSAgICAgICAgICBTVFJIICAgICAgICAgIAlyMTEsIFtyNl0sICMyCi0gICAgICAgICAgU1RSSCAgICAgICAgICAJcjEyLCBbcjZdLCAjMgotICAgICAgICAgIExEUlNIICAgICAgICAgCXI4LCAgW3I3XSwgIzIKLSAgICAgICAgICBMRFJTSCAgICAgICAgIAlyOSwgIFtyN10sICMyCi0gICAgICAgICAgTU9WICAgICAgICAgICAJcjgsIHI4LCBBU1IgIzIKLSAgICAgICAgICBNT1YgICAgICAgICAgIAlyOSwgcjksIEFTUiAjMgotICAgICAgICAgIExEUlNIICAgICAgICAgCXIxMSwgW3I3XSwgIzIKLSAgICAgICAgICBMRFJTSCAgICAgICAgIAlyMTIsIFtyN10sICMyCi0gICAgICAgICAgTU9WICAgICAgICAgICAJcjExLCByMTEsIEFTUiAjMgotICAgICAgICAgIE1PViAgICAgICAgICAgCXIxMiwgcjEyLCBBU1IgIzIKLSAgICAgICAgICBTVFJIICAgICAgICAgIAlyOCwgW3I2XSwgIzIKLSAgICAgICAgICBTVFJIICAgICAgICAgIAlyOSwgW3I2XSwgIzIKLSAgICAgICAgICBTVFJIICAgICAgICAgIAlyMTEsIFtyNl0sICMyCi0gICAgICAgICAgU1RSSCAgICAgICAgICAJcjEyLCBbcjZdLCAjMgotICAgICAgICAgIEFERCAgICAgICAgICAgCXIxNCwgcjE0LCAjOAotICAgICAgICAgIENNUCAgICAgICAgICAgCXIxNCwgIzgwCi0gICAgICAgICAgQkxUICAgICAgICAgICAJTE9PUDEKLQotCi0gICAgICAgICAgU1RSICAgICAJCXI1LCBbc3AsICMtNF0gICAgICAgICAgICAgICBAIFBVU0ggIHI1IHRvIHN0YWNrCi0KLSAgICAgICAgICBAIG5vdCB1c2UgcmVnaXN0ZXJzOiByNCwgcjEwLCByMTIsIHIxNCwgcjUKLSAgICAgICAgICBNT1YgICAgIAkJcjQsIHIxMwotICAgICAgICAgIE1PViAgICAgCQlyNSwgIzAgICAgICAgICAgICAgICAgICAgICAgQCBpID0gMAotTE9PUDI6Ci0gICAgICAgICAgTERSICAgICAgICAgICAJcjAsIFtyMTBdCi0KLSAgICAgICAgICBMRFJTSCAgCSAgICAgICAgcjEsIFtyNF0gICAgICAgICAgICAgICAgICAgQCBsb2FkIHhbaV0KLSAgICAgICAgICBMRFJTSCAgIAkgICAgICAgIHIyLCBbcjQsICM2MF0gICAgICAgICAgICAgIEAgbG9hZCB4W2kgKyAzMF0KLSAgICAgICAgICBMRFJTSCAgICAgICAgICAgICAgICAgcjYsIFtyNCwgIzJdICAgICAgICAgICAgICAgQCBsb2FkIHhbaSArIDFdCi0gICAgICAgICAgTERSU0ggICAgICAgICAgICAgICAgIHI3LCBbcjQsICM1OF0gICAgICAgICAgICAgIEAgbG9hZCB4W2kgKyAyOV0KLSAgICAgICAgICBBREQgICAgICAgICAgICAgICAgICAgcjEsIHIxLCByMiAgICAgICAgICAgICAgICAgQCB4W2ldICsgeFtpICsgMzBdCi0gICAgICAgICAgQUREICAgICAgICAgICAgICAgICAgIHI2LCByNiwgcjcgICAgICAgICAgICAgICAgIEAgeFtpICsgMV0gKyB4W2kgKyAyOV0KLSAgICAgICAgICBMRFJTSCAgICAgICAgICAgICAgICAgcjgsIFtyNCwgIzRdICAgICAgICAgICAgICAgQCBsb2FkIHhbaSArIDJdCi0gICAgICAgICAgTERSU0ggICAgICAgICAgICAgICAgIHI5LCBbcjQsICM1Nl0gICAgICAgICAgICAgIEAgbG9hZCB4W2kgKyAyOF0KLQotICAgICAgICAgIFNNVUxCQiAgICAgICAgICAgICAgICByMTQsIHIxLCByMCAgICAgICAgICAgICAgICBAICh4W2ldICsgeFtpICsgMzBdKSAqIGZpcl83a1swXQotICAgICAgICAgIEFERCAgICAgICAgICAgICAgICAgICByOCwgcjgsIHI5ICAgICAgICAgICAgICAgICBAIHhbaSArIDJdICsgeFtpICsgMjhdCi0gICAgICAgICAgU01MQUJUICAgICAgICAgICAgICAgIHIxNCwgcjYsIHIwLCByMTQgICAgICAgICAgIEAgKHhbaSArIDFdICsgeFtpICsgMjldKSAqIGZpcl83a1sxXQotCi0gICAgICAgICAgTERSICAgICAgICAgICAgICAgICAgIHIwLCBbcjEwLCAjNF0KLSAgICAgICAgICBMRFJTSCAgICAgICAgICAgICAgICAgcjEsIFtyNCwgIzZdICAgICAgICAgICAgICAgQCBsb2FkIHhbaSszXQotICAgICAgICAgIExEUlNIICAgICAgICAgICAgICAgICByMiwgW3I0LCAjNTRdICAgICAgICAgICAgICBAIGxvYWQgeFtpKzI3XQotICAgICAgICAgIExEUlNIICAgICAgICAgICAgICAgICByNiwgW3I0LCAjOF0gICAgICAgICAgICAgICBAIGxvYWQgeFtpKzRdCi0gICAgICAgICAgTERSU0ggICAgICAgICAgICAgICAgIHI3LCBbcjQsICM1Ml0gICAgICAgICAgICAgIEAgbG9hZCB4W2krMjZdCi0gICAgICAgICAgQUREICAgICAgICAgICAgICAgICAgIHIxLCByMSwgcjIgICAgICAgICAgICAgICAgIEAgeFtpKzNdICsgeFtpKzI3XQotICAgICAgICAgIEFERCAgICAgICAgICAgICAgICAgICByNiwgcjYsIHI3ICAgICAgICAgICAgICAgICBAIHhbaSs0XSArIHhbaSsyNl0KLSAgICAgICAgICBTTUxBQkIgICAgICAgICAgICAgICAgcjE0LCByOCwgcjAsIHIxNCAgICAgICAgICAgQCAoeFtpICsgMl0gKyB4W2kgKyAyOF0pICogZmlyXzdrWzJdCi0gICAgICAgICAgTERSU0ggICAgICAgICAgICAgICAgIHI4LCBbcjQsICMxMF0gICAgICAgICAgICAgIEAgbG9hZCB4W2krNV0KLSAgICAgICAgICBMRFJTSCAgICAgICAgICAgICAgICAgcjksIFtyNCwgIzUwXSAgICAgICAgICAgICAgQCBsb2FkIHhbaSsyNV0KLSAgICAgICAgICBTTUxBQlQgICAgICAgICAgICAgICAgcjE0LCByMSwgcjAsIHIxNCAgICAgICAgICAgQCAoeFtpKzNdICsgeFtpKzI3XSkgKiBmaXJfN2tbM10KLSAgICAgICAgICBBREQgICAgICAgICAgICAgICAgICAgcjgsIHI4LCByOSAgICAgICAgICAgICAgICAgQCB4W2krNV0gKyB4W2krMjVdCi0KLSAgICAgICAgICBMRFIgICAgICAgICAgICAgICAgICAgcjAsIFtyMTAsICM4XQotICAgICAgICAgIExEUlNIICAgICAgICAgICAgICAgICByMSwgW3I0LCAjMTJdICAgICAgICAgICAgICBAIHhbaSs2XQotICAgICAgICAgIExEUlNIICAgICAgICAgICAgICAgICByMiwgW3I0LCAjNDhdICAgICAgICAgICAgICBAIHhbaSsyNF0KLSAgICAgICAgICBTTUxBQkIgICAgICAgICAgICAgICAgcjE0LCByNiwgcjAsIHIxNCAgICAgICAgICAgQCAoeFtpKzRdICsgeFtpKzI2XSkgKiBmaXJfN2tbNF0KLSAgICAgICAgICBMRFJTSCAgICAgICAgICAgICAgICAgcjYsIFtyNCwgIzE0XSAgICAgICAgICAgICAgQCB4W2krN10KLSAgICAgICAgICBMRFJTSCAgICAgICAgICAgICAgICAgcjcsIFtyNCwgIzQ2XSAgICAgICAgICAgICAgQCB4W2krMjNdCi0gICAgICAgICAgU01MQUJUICAgICAgICAgICAgICAgIHIxNCwgcjgsIHIwLCByMTQgICAgICAgICAgIEAgKHhbaSs1XSArIHhbaSsyNV0pICogZmlyXzdrWzVdCi0gICAgICAgICAgTERSICAgICAgICAgICAgICAgICAgIHIwLCBbcjEwLCAjMTJdCi0gICAgICAgICAgQUREICAgICAgICAgICAgICAgICAgIHIxLCByMSwgcjIgICAgICAgICAgICAgICAgIEAgKHhbaSs2XSArIHhbaSsyNF0pCi0gICAgICAgICAgQUREICAgICAgICAgICAgICAgICAgIHI2LCByNiwgcjcgICAgICAgICAgICAgICAgIEAgKHhbaSs3XSArIHhbaSsyM10pCi0gICAgICAgICAgU01MQUJCICAgICAgICAgICAgICAgIHIxNCwgcjEsIHIwLCByMTQgICAgICAgICAgIEAgKHhbaSs2XSArIHhbaSsyNF0pICogZmlyXzdrWzZdCi0gICAgICAgICAgTERSU0ggICAgICAgICAgICAgICAgIHI4LCBbcjQsICMxNl0gICAgICAgICAgICAgIEAgeFtpKzhdCi0gICAgICAgICAgTERSU0ggICAgICAgICAgICAgICAgIHI5LCBbcjQsICM0NF0gICAgICAgICAgICAgIEAgeFtpKzIyXQotICAgICAgICAgIFNNTEFCVCAgICAgICAgICAgICAgICByMTQsIHI2LCByMCwgcjE0ICAgICAgICAgICBAICh4W2krN10gKyB4W2krMjNdKSAqIGZpcl83a1s3XQotICAgICAgICAgIExEUiAgICAgICAgICAgICAgICAgICByMCwgW3IxMCwgIzE2XQotICAgICAgICAgIExEUlNIICAgICAgICAgICAgICAgICByMSwgW3I0LCAjMThdICAgICAgICAgICAgICBAIHhbaSs5XQotICAgICAgICAgIExEUlNIICAgICAgICAgICAgICAgICByMiwgW3I0LCAjNDJdICAgICAgICAgICAgICBAIHhbaSsyMV0KLSAgICAgICAgICBMRFJTSCAgICAgICAgICAgICAgICAgcjYsIFtyNCwgIzIwXSAgICAgICAgICAgICAgQCB4W2krMTBdCi0gICAgICAgICAgTERSU0ggICAgICAgICAgICAgICAgIHI3LCBbcjQsICM0MF0gICAgICAgICAgICAgIEAgeFtpKzIwXQotICAgICAgICAgIEFERCAgICAgICAgICAgICAgICAgICByOCwgcjgsIHI5ICAgICAgICAgICAgICAgICBAICh4W2krOF0gKyB4W2krMjJdKQotICAgICAgICAgIEFERCAgICAgICAgICAgICAgICAgICByMSwgcjEsIHIyICAgICAgICAgICAgICAgICBAICh4W2krOV0gKyB4W2krMjFdKQotICAgICAgICAgIEFERCAgICAgICAgICAgICAgICAgICByNiwgcjYsIHI3ICAgICAgICAgICAgICAgICBAICh4W2krMTBdICsgeFtpKzIwXSkKLSAgICAgICAgICBTTUxBQkIgICAgICAgICAgICAgICAgcjE0LCByOCwgcjAsIHIxNCAgICAgICAgICAgQCAoeFtpKzhdICsgeFtpKzIyXSkgKiBmaXJfN2tbOF0KLSAgICAgICAgICBMRFJTSCAgICAgICAgICAgICAgICAgcjgsIFtyNCwgIzIyXSAgICAgICAgICAgICAgQCB4W2krMTFdCi0gICAgICAgICAgTERSU0ggICAgICAgICAgICAgICAgIHI5LCBbcjQsICMzOF0gICAgICAgICAgICAgIEAgeFtpKzE5XQotICAgICAgICAgIFNNTEFCVCAgICAgICAgICAgICAgICByMTQsIHIxLCByMCwgcjE0ICAgICAgICAgICBAICh4W2krOV0gKyB4W2krMjFdKSAqIGZpcl83a1s5XQotICAgICAgICAgIExEUiAgICAgICAgICAgICAgICAgICByMCwgW3IxMCwgIzIwXQotICAgICAgICAgIExEUlNIICAgICAgICAgICAgICAgICByMSwgW3I0LCAjMjRdICAgICAgICAgICAgICBAIHhbaSsxMl0KLSAgICAgICAgICBMRFJTSCAgICAgICAgICAgICAgICAgcjIsIFtyNCwgIzM2XSAgICAgICAgICAgICAgQCB4W2krMThdCi0gICAgICAgICAgU01MQUJCICAgICAgICAgICAgICAgIHIxNCwgcjYsIHIwLCByMTQgICAgICAgICAgIEAgKHhbaSsxMF0gKyB4W2krMjBdKSAqIGZpcl83a1sxMF0KLSAgICAgICAgICBMRFJTSCAgICAgICAgICAgICAgICAgcjYsIFtyNCwgIzI2XSAgICAgICAgICAgICAgQCB4W2krMTNdCi0gICAgICAgICAgQUREICAgICAgICAgICAgICAgICAgIHI4LCByOCwgcjkgICAgICAgICAgICAgICAgIEAgKHhbaSsxMV0gKyB4W2krMTldKQotICAgICAgICAgIExEUlNIICAgICAgICAgICAgICAgICByNywgW3I0LCAjMzRdICAgICAgICAgICAgICBAIHhbaSsxN10KLSAgICAgICAgICBTTUxBQlQgICAgICAgICAgICAgICAgcjE0LCByOCwgcjAsIHIxNCAgICAgICAgICAgQCAoeFtpKzExXSArIHhbaSsxOV0pICogZmlyXzdrWzExXQotICAgICAgICAgIExEUiAgICAgICAgICAgICAgICAgICByMCwgW3IxMCwgIzI0XQotICAgICAgICAgIEFERCAgICAgICAgICAgICAgICAgICByMSwgcjEsIHIyICAgICAgICAgICAgICAgICBAIHhbaSsxMl0gKyB4W2krMThdCi0gICAgICAgICAgTERSU0ggICAgICAgICAgICAgICAgIHI4LCBbcjQsICMyOF0gICAgICAgICAgICAgIEAgeFtpKzE0XQotICAgICAgICAgIFNNTEFCQiAgICAgICAgICAgICAgICByMTQsIHIxLCByMCwgcjE0ICAgICAgICAgICBAICh4W2krMTJdICsgeFtpKzE4XSkgKiBmaXJfN2tbMTJdCi0gICAgICAgICAgQUREICAgICAgICAgICAgICAgICAgIHI2LCByNiwgcjcgICAgICAgICAgICAgICAgIEAgKHhbaSsxM10gKyB4W2krMTddKQotICAgICAgICAgIExEUlNIICAgICAgICAgICAgICAgICByOSwgW3I0LCAjMzJdICAgICAgICAgICAgICBAIHhbaSsxNl0KLSAgICAgICAgICBTTUxBQlQgICAgICAgICAgICAgICAgcjE0LCByNiwgcjAsIHIxNCAgICAgICAgICAgQCAoeFtpKzEzXSArIHhbaSsxN10pICogZmlyXzdrWzEzXQotICAgICAgICAgIExEUiAgICAgICAgICAgICAgICAgICByMCwgW3IxMCwgIzI4XQotICAgICAgICAgIEFERCAgICAgICAgICAgICAgICAgICByOCwgcjgsIHI5ICAgICAgICAgICAgICAgICBAICh4W2krMTRdICsgeFtpKzE2XSkKLSAgICAgICAgICBMRFJTSCAgICAgICAgICAgICAgICAgcjEsIFtyNCwgIzMwXSAgICAgICAgICAgICAgQCB4W2krMTVdCi0gICAgICAgICAgU01MQUJCICAgICAgICAgICAgICAgIHIxNCwgcjgsIHIwLCByMTQgICAgICAgICAgIEAgKHhbaSsxNF0gKyB4W2krMTZdKSAqIGZpcl83a1sxNF0KLSAgICAgICAgICBTTUxBQlQgICAgICAgICAgICAgICAgcjE0LCByMSwgcjAsIHIxNCAgICAgICAgICAgQCB4W2krMTVdICogZmlyXzdrWzE1XQotCi0gICAgICAgICAgQUREICAgICAJCXI1LCByNSwgIzEKLSAgICAgICAgICBBREQgICAgIAkJcjE0LCByMTQsICMweDQwMDAKLSAgICAgICAgICBBREQgICAgIAkJcjQsIHI0LCAjMgotICAgICAgICAgIE1PViAgICAgCQlyMSwgcjE0LCBBU1IgIzE1Ci0gICAgICAgICAgQ01QICAgICAJCXI1LCAjODAKLSAgICAgICAgICBTVFJIICAgIAkJcjEsIFtyM10sICMyICAgICAgICAgICAgICAgQHNpZ25hbFtpXSA9IChMX3RtcCArIDB4NDAwMCkg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Ci1AICAgICAgICAgICAgICAgICAgICAgICBXb3JkMTYgTF9zdWJmciwgICAgICAgICAgICAgICAgICAvKiAoaSkgICAgIDogc3ViLWZyYW1lIGxlbmd0aCAqLwotQCAgICAgICAgICAgICAgICAgICAgICAgV29yZDE2IHRfbWluLCAgICAgICAgICAgICAgICAgICAgLyogKGkpICAgICA6IG1pbmltdW0gdmFsdWUgb2YgcGl0Y2ggbGFnLiAgICovCi1AICAgICAgICAgICAgICAgICAgICAgICBXb3JkMTYgdF9tYXgsICAgICAgICAgICAgICAgICAgICAvKiAoaSkgICAgIDogbWF4aW11bSB2YWx1ZSBvZiBwaXRjaCBsYWcuICAgKi8KLUAgICAgICAgICAgICAgICAgICAgICAgIFdvcmQxNiBjb3JyX25vcm1bXSkgICAgICAgICAgICAgIC8qIChvKSBRMTUgOiBub3JtYWxpemVkIGNvcnJlbGF0aW9uICAgICovCi1ACi0KLUAgcjAgLS0tIGV4Y1tdCi1AIHIxIC0tLSB4bltdCi1AIHIyIC0tLSBoW10KLUAgcjMgLS0tIExfc3ViZnIKLUAgcjQgLS0tIHRfbWluCi1AIHI1IC0tLSB0X21heAotQCByNiAtLS0gY29ycl9ub3JtW10KLQotCi0JLnNlY3Rpb24gIC50ZXh0Ci0gICAgICAgIC5nbG9iYWwgICBOb3JtX2NvcnJfYXNtCi0gICAgICAgIC5leHRlcm4gICBDb252b2x2ZV9hc20KLSAgICAgICAgLmV4dGVybiAgIElzcXJ0X24KLUAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKLUAgY29uc3RhbnQKLUAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKLS5lcXUgICAgICAgICBFWEMgICAgICAgICAgICwgICAwCi0uZXF1ICAgICAgICAgWE4gICAgICAgICAgICAsICAgNAotLmVxdSAgICAgICAgIEggICAgICAgICAgICAgLCAgIDgKLS5lcXUgICAgICAgICBMX1NVQkZSICAgICAgICwgICAxMgotLmVxdSAgICAgICAgIHZvU1RBQ0sgICAgICAgLCAgIDE3MgotLmVxdSAgICAgICAgIFRfTUlOICAgICAgICAgLCAgIDIxMgotLmVxdSAgICAgICAgIFRfTUFYICAgICAgICAgLCAgIDIxNgotLmVxdSAgICAgICAgIENPUlJfTk9STSAgICAgLCAgIDIyMAotCi1Ob3JtX2NvcnJfYXNtOgotCi0gICAgICAgIFNUTUZEICAgICAgcjEzISwge3I0IC0gcjEyLCByMTR9Ci0gICAgICAgIFNVQiAgICAgICAgcjEzLCByMTMsICN2b1NUQUNLCi0KLSAgICAgICAgQUREICAgICAgICByOCwgcjEzLCAjMjAgICAgICAgICAgICAgICAgIEBnZXQgdGhlIGV4Y2ZbTF9TVUJGUl0KLSAgICAgICAgTERSICAgICAgICByNCwgW3IxMywgI1RfTUlOXSAgICAgICAgICAgIEBnZXQgdF9taW4KLSAgICAgICAgUlNCICAgICAgICByMTEsIHI0LCAjMCAgICAgICAgICAgICAgICAgIEBrID0gLXRfbWluCi0gICAgICAgIEFERCAgICAgICAgcjUsIHIwLCByMTEsIExTTCAjMSAgICAgICAgICBAZ2V0IHRoZSAmZXhjW2tdCi0KLSAgICAgICAgQHRyYW5zZmVyIENvbnZvbHZlIGZ1bmN0aW9uCi0gICAgICAgIFNUTUZEICAgICAgIHNwISwge3IwIC0gcjN9Ci0gICAgICAgIE1PViAgICAgICAgIHIwLCByNQotICAgICAgICBNT1YgICAgICAgICByMSwgcjIKLSAgICAgICAgTU9WICAgICAgICAgcjIsIHI4ICAgICAgICAgICAgICAgICAgICAgICBAcjIgLS0tIGV4Y2ZbXQotICAgICAgICBCTCAgICAgICAgICBDb252b2x2ZV9hc20KLSAgICAgICAgTERNRkQgICAgICAgc3AhLCB7cjAgLSByM30KLQotICAgICAgICBAIHI4IC0tLSBleGNmW10KLQotCU1PViAgICAgICAgIHIxNCwgcjEgICAgICAgICAgICAgICAgICAgICAgIEBjb3B5IHhuW10gYWRkcmVzcwotICAgICAgICBNT1YgICAgICAgICByNSwgIzY0Ci0gICAgICAgIE1PViAgICAgICAgIHI2LCAjMCAgICAgICAgICAgICAgICAgICAgICAgQExfdG1wID0gMAotICAgICAgICBNT1YgICAgICAgICByNywgIzEKLQotTE9PUDE6Ci0gICAgICAgIExEUiAgICAgICAgIHI5LCAgW3IxNF0sICM0Ci0JTERSICAgICAgICAgcjEwLCBbcjE0XSwgIzQKLQlMRFIgICAgICAgICByMTEsIFtyMTRdLCAjNAotCUxEUiAgICAgICAgIHIxMiwgW3IxNF0sICM0Ci0JU01MQUJCICAgICAgcjYsIHI5LCByOSwgcjYgICAgICAgICAgICAgICBATF90bXAgKz0gKHhuW2ldICogeG5baV0pCi0JU01MQVRUICAgICAgcjYsIHI5LCByOSwgcjYgICAgICAgICAgICAgICBATF90bXAgKz0gKHhuW2krMV0gKiB4bltpKzFdKQotICAgICAgICBTTUxBQkIgICAgICByNiwgcjEwLCByMTAsIHI2Ci0JU01MQVRUICAgICAgcjYsIHIxMCwgcjEwLCByNgotCVNNTEFCQiAgICAgIHI2LCByMTEsIHIxMSwgcjYKLSAgICAgICAgU01MQVRUICAgICAgcjYsIHIxMSwgcjExLCByNgotICAgICAgICBTTUxBQkIgICAgICByNiwgcjEyLCByMTIsIHI2Ci0gICAgICAgIFNNTEFUVCAgICAgIHI2LCByMTIsIHIxMiwgcjYKLSAgICAgICAgU1VCUyAgICAgICAgcjUsIHI1LCAjOAotICAgICAgICBCTkUgICAgICAgICBMT09QMQotCi0JQUREICAgICAgICAgcjksIHI3LCByNiwgTFNMICMxICAgICAgICAgICBATF90bXAgPSAoTF90bXAgPDwgMSkgKyAxCi0JQ0xaICAgICAgICAgcjcsIHI5Ci0JU1VCICAgICAgICAgcjYsIHI3LCAjMSAgICAgICAgICAgICAgICAgICBAZXhwID0gbm9ybV9sKExfdG1wKQotICAgICAgICBSU0IgICAgICAgICByNywgcjYsICMzMiAgICAgICAgICAgICAgICAgIEBleHAgPSAzMiAtIGV4cAotCU1PViAgICAgICAgIHI2LCByNywgQVNSICMxCi0JUlNCICAgICAgICAgcjcsIHI2LCAjMCAgICAgICAgICAgICAgICAgICBAc2NhbGUgPSAtKGV4cCA+PiAxKQotCi0gICAgICAgIEBsb29wIGZvciBldmVyeSBwb3NzaWJsZSBwZXJpb2QKLQlAZm9yKHQgPSB0X21pbkAgdCA8PSB0X21heEAgdCsrKQotCUByNyAtLS0gc2NhbGUgcjQgLS0tIHRfbWluIHI4IC0tLSBleGNmW10KLQotTE9PUEZPUjoKLSAgICAgICAgTU9WICAgICAgICAgcjUsICMwICAgICAgICAgICAgICAgICAgICAgICBATF90bXAgID0gMAotCU1PViAgICAgICAgIHI2LCAjMCAgICAgICAgICAgICAgICAgICAgICAgQExfdG1wMSA9IDAKLQlNT1YgICAgICAgICByOSwgIzY0Ci0JTU9WICAgICAgICAgcjEyLCByMSAgICAgICAgICAgICAgICAgICAgICBAY29weSBvZiB4bltdCi0JQUREICAgICAgICAgcjE0LCByMTMsICMyMCAgICAgICAgICAgICAgICBAY29weSBvZiBleGNmW10KLQlNT1YgICAgICAgICByOCwgIzB4ODAwMAotCi1MT09QaToKLQlMRFIgICAgICAgICByMTEsIFtyMTRdLCAjNCAgICAgICAgICAgICAgIEBsb2FkIGV4Y2ZbaV0sIGV4Y2ZbaSsxXQotICAgICAgICBMRFIgICAgICAgICByMTAsIFtyMTJdLCAjNCAgICAgICAgICAgICAgIEBsb2FkIHhuW2ldLCB4bltpKzFdCi0JU01MQUJCICAgICAgcjYsIHIxMSwgcjExLCByNiAgICAgICAgICAgICBATF90bXAxICs9IGV4Y2ZbaV0gKiBleGNmW2ldCi0JU01MQVRUICAgICAgcjYsIHIxMSwgcjExLCByNiAgICAgICAgICAgICBATF90bXAxICs9IGV4Y2ZbaSsxXSAqIGV4Y2ZbaSsxXQotICAgICAgICBTTUxBQkIgICAgICByNSwgcjEwLCByMTEsIHI1ICAgICAgICAgICAgIEBMX3RtcCArPSB4bltpXSAqIGV4Y2ZbaV0KLQlTTUxBVFQgICAgICByNSwgcjEwLCByMTEsIHI1ICAgICAgICAgICAgIEBMX3RtcCArPSB4bltpKzFdICogZXhjZltpKzFdCi0JTERSICAgICAgICAgcjExLCBbcjE0XSwgIzQgICAgICAgICAgICAgICBAbG9hZCBleGNmW2krMl0sIGV4Y2ZbaSszXQotCUxEUiAgICAgICAgIHIxMCwgW3IxMl0sICM0ICAgICAgICAgICAgICAgQGxvYWQgeG5baSsyXSwgeG5baSszXQotICAgICAgICBTTUxBQkIgICAgICByNiwgcjExLCByMTEsIHI2Ci0JU01MQVRUICAgICAgcjYsIHIxMSwgcjExLCByNgotCVNNTEFCQiAgICAgIHI1LCByMTAsIHIxMSwgcjUKLQlTTUxBVFQgICAgICByNSwgcjEwLCByMTEsIHI1Ci0JU1VCUyAgICAgICAgcjksIHI5LCAjNAotICAgICAgICBCTkUgICAgICAgICBMT09QaQotCi0JQHI1IC0tLSBMX3RtcCwgcjYgLS0tIExfdG1wMQotCU1PViAgICAgICAgIHIxMCwgIzEKLQlBREQgICAgICAgICByNSwgcjEwLCByNSwgTFNMICMxICAgICAgICAgIEBMX3RtcCA9IChMX3RtcCA8PCAxKSArIDEKLQlBREQgICAgICAgICByNiwgcjEwLCByNiwgTFNMICMxICAgICAgICAgIEBMX3RtcDEgPSAoTF90bXAxIDw8IDEpICsgMQotCi0JQ0xaICAgICAgICAgcjEwLCByNQotCUNNUCAgICAgICAgIHI1LCAjMAotCVJTQkxUICAgICAgIHIxMSwgcjUsICMwCi0JQ0xaTFQgICAgICAgcjEwLCByMTEKLQlTVUIgICAgICAgICByMTAsIHIxMCwgIzEgICAgICAgICAgICAgICAgIEBleHAgPSBub3JtX2woTF90bXApCi0KLQlNT1YgICAgICAgICByNSwgcjUsIExTTCByMTAgICAgICAgICAgICAgIEBMX3RtcCA9IChMX3RtcCA8PCBleHApCi0JUlNCICAgICAgICAgcjEwLCByMTAsICMzMCAgICAgICAgICAgICAgICBAZXhwX2NvcnIgPSAzMCAtIGV4cAotCU1PViAgICAgICAgIHIxMSwgcjUsIEFTUiAjMTYgICAgICAgICAgICAgQGNvcnIgPSBleHRyYWN0X2goTF90bXApCi0KLQlDTFogICAgICAgICByNSwgcjYKLQlTVUIgICAgICAgICByNSwgcjUsICMxCi0JTU9WICAgICAgICAgcjYsIHI2LCBMU0wgcjUgICAgICAgICAgICAgICBATF90bXAgPSAoTF90bXAxIDw8IGV4cCkKLQlSU0IgICAgICAgICByNSwgcjUsICMzMCAgICAgICAgICAgICAgICAgIEBleHBfbm9ybSA9IDMwIC0gZXhwCi0KLQlAcjEwIC0tLSBleHBfY29yciwgcjExIC0tLSBjb3JyCi0JQHI2ICAtLS0gTF90bXAsIHI1IC0tLSBleHBfbm9ybQotCi0JQElzcXJ0X24oJkxfdG1wLCAmZXhwX25vcm0pCi0KLQlNT1YgICAgICAgICByMTQsIHIwCi0JTU9WICAgICAgICAgcjEyLCByMQotCi0gICAgICAgIFNUTUZEICAgICAgIHNwISwge3IwIC0gcjQsIHI3IC0gcjEyLCByMTR9Ci0JQUREICAgICAgICAgcjEsIHNwLCAjNAotCUFERCAgICAgICAgIHIwLCBzcCwgIzAKLQlTVFIgICAgICAgICByNiwgW3NwXQotCVNUUkggICAgICAgIHI1LCBbc3AsICM0XQotCUJMICAgICAgICAgIElzcXJ0X24KLQlMRFIgICAgICAgICByNiwgW3NwXQotCUxEUlNIICAgICAgIHI1LCBbc3AsICM0XQotICAgICAgICBMRE1GRCAgICAgICBzcCEsIHtyMCAtIHI0LCByNyAtIHIxMiwgcjE0fQotCU1PViAgICAgICAgIHIwLCByMTQKLQlNT1YgICAgICAgICByMSwgcjEyCi0KLQotCU1PViAgICAgICAgIHI2LCByNiwgQVNSICMxNiAgICAgICAgICAgICAgQG5vcm0gPSBleHRyYWN0X2goTF90bXApCi0JTVVMICAgICAgICAgcjEyLCByNiwgcjExCi0JQUREICAgICAgICAgcjEyLCByMTIsIHIxMiAgICAgICAgICAgICAgICBATF90bXAgPSB2b19MX211bHQoY29yciwgbm9ybSkKLQotCUFERCAgICAgICAgIHI2LCByMTAsIHI1Ci0JQUREICAgICAgICAgcjYsIHI2LCByNyAgICAgICAgICAgICAgICAgICBAZXhwX2NvcnIgKyBleHBfbm9ybSArIHNjYWxlCi0KLSAgICAgICAgQ01QICAgICAgICAgcjYsICMwCi0gICAgICAgIFJTQkxUICAgICAgIHI2LCByNiwgIzAKLQlNT1ZMVCAgICAgICByMTIsIHIxMiwgQVNSIHI2Ci0gICAgICAgIE1PVkdUICAgICAgIHIxMiwgcjEyLCBMU0wgcjYgICAgICAgICAgICAgQExfdG1wID0gTF9zaGwoTF90bXAsIGV4cF9jb3JyICsgZXhwX25vcm0gKyBzY2FsZSkKLQotICAgICAgICBBREQgICAgICAgICByMTIsIHIxMiwgcjgKLSAgICAgICAgTU9WICAgICAgICAgcjEyLCByMTIsIEFTUiAjMTYgICAgICAgICAgICBAdm9fcm91bmQoTF90bXApCi0KLSAgICAgICAgTERSICAgICAgICAgcjUsIFtyMTMsICNDT1JSX05PUk1dICAgICAgICBAIGdldCBjb3JyX25vcm0gYWRkcmVzcwotCUxEUiAgICAgICAgIHI2LCBbcjEzLCAjVF9NQVhdICAgICAgICAgICAgQCBnZXQgdF9tYXgKLQlBREQgICAgICAgICByMTAsIHI1LCByNCwgTFNMICMxICAgICAgICAgIEAgZ2V0IGNvcnJfbm9ybVt0XSBhZGRyZXNzCi0JU1RSSCAgICAgICAgcjEyLCBbcjEwXSAgICAgICAgICAgICAgICAgICBAIGNvcnJfbm9ybVt0XSA9IHZvX3JvdW5kKExfdG1wKQotCi0JQ01QICAgICAgICAgcjQsIHI2Ci0JQkVRICAgICAgICAgTm9ybV9jb3JyX2FzbV9lbmQKLQotCUFERCAgICAgICAgIHI0LCByNCwgIzEgICAgICAgICAgICAgICAgICAgQCB0X21pbiArKwotCi0JUlNCICAgICAgICAgcjUsIHI0LCAjMCAgICAgICAgICAgICAgICAgICBAIGsKLQotCU1PViAgICAgICAgIHI2LCAjNjMgICAgICAgICAgICAgICAgICAgICAgQCBpID0gNjMKLQlNT1YgICAgICAgICByOCwgcjAgICAgICAgICAgICAgICAgICAgICAgIEAgZXhjW10KLQlNT1YgICAgICAgICByOSwgcjIgICAgICAgICAgICAgICAgICAgICAgIEAgaFtdCi0JQUREICAgICAgICAgcjEwLCByMTMsICMyMCAgICAgICAgICAgICAgICBAIGV4Y2ZbXQotCi0JQUREICAgICAgICAgcjgsIHI4LCByNSwgTFNMICMxICAgICAgICAgICBAIGV4Y1trXSBhZGRyZXNzCi0JQUREICAgICAgICAgcjksIHI5LCByNiwgTFNMICMxICAgICAgICAgICBAIGhbaV0gYWRkcmVzcwotCUFERCAgICAgICAgIHIxMCwgcjEwLCByNiwgTFNMICMxICAgICAgICAgQCBleGNmW2ldIGFkZHJlc3MKLQlMRFJTSCAgICAgICByMTEsIFtyOF0gICAgICAgICAgICAgICAgICAgIEAgdG1wID0gZXhjW2tdCi0KLUxPT1BLOgotICAgICAgICBMRFJTSCAgICAgICByOCwgW3I5XSwgIy0yICAgICAgICAgICAgICAgIEAgbG9hZCBoW2ldCi0JTERSU0ggICAgICAgcjEyLCBbcjEwLCAjLTJdICAgICAgICAgICAgICBAIGxvYWQgZXhjZltpIC0gMV0KLQlNVUwgICAgICAgICByMTQsIHIxMSwgcjgKLQlNT1YgICAgICAgICByOCwgcjE0LCBBU1IgIzE1Ci0JQUREICAgICAgICAgcjE0LCByOCwgcjEyCi0JU1RSSCAgICAgICAgcjE0LCBbcjEwXSwgIy0yCi0JU1VCUyAgICAgICAgcjYsIHI2LCAjMQotCUJHVCAgICAgICAgIExPT1BLCi0KLQlMRFJTSCAgICAgICByOCwgW3I5XSAgICAgICAgICAgICAgICAgICAgIEAgbG9hZCBoWzBdCi0JTVVMICAgICAgICAgcjE0LCByMTEsIHI4Ci0gICAgICAgIExEUiAgICAgICAgIHI2LCBbcjEzLCAjVF9NQVhdICAgICAgICAgICAgQCBnZXQgdF9tYXgKLQlNT1YgICAgICAgICByOCwgcjE0LCBBU1IgIzE1Ci0JU1RSSCAgICAgICAgcjgsIFtyMTBdCi0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FwcGxpY2FibGUgbGF3IG9yIGFncmVlZCB0byBpbiB3cml0aW5nLCBzb2Z0d2FyZQotQCAqKiBkaXN0cmlidXRlZCB1bmRlciB0aGUgTGljZW5zZSBpcyBkaXN0cmlidXRlZCBvbiBhbiAiQVMgSVMiIEJBU0lTLAotQCAqKiBXSVRIT1VUIFdBUlJBTlRJRVMgT1IgQ09ORElUSU9OUyBPRiBBTlkgS0lORCwgZWl0aGVyIGV4cHJlc3Mgb3IgaW1wbGllZC4KLUAgKiogU2VlIHRoZSBMaWNlbnNlIGZvciB0aGUgc3BlY2lmaWMgbGFuZ3VhZ2UgZ292ZXJuaW5nIHBlcm1pc3Npb25zIGFuZAotQCAqKiBsaW1pdGF0aW9ucyB1bmRlciB0aGUgTGljZW5zZS4KLUAgKi8KLUAKLUB2b2lkIFN5bl9maWx0XzMyKAotQCAgICAgV29yZDE2IGFbXSwgICAgICAgICAgICAgICAgICAgICAgICAgICAvKiAoaSkgUTEyIDogYVttKzFdIHByZWRpY3Rpb24gY29lZmZpY2llbnRzICovCi1AICAgICBXb3JkMTYgbSwgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8qIChpKSAgICAgOiBvcmRlciBvZiBMUCBmaWx0ZXIgICAgICAgICAgICAgKi8KLUAgICAgIFdvcmQxNiBleGNbXSwgICAgICAgICAgICAgICAgICAgICAgICAgLyogKGkpIFFuZXc6IGV4Y2l0YXRpb24gKGV4Y1tpXSA+PiBRbmV3KSAgICAqLwotQCAgICAgV29yZDE2IFFuZXcsICAgICAgICAgICAgICAgICAgICAgICAgICAvKiAoaSkgICAgIDogZXhjIHNjYWxpbmcgPSAwKG1pbikgdG8gOChtYXgpICovCi1AICAgICBXb3JkMTYgc2lnX2hpW10sICAgICAgICAgICAgICAgICAgICAgIC8qIChvKSAvMTYgOiBzeW50aGVzaXMgaGlnaCAgICAgICAgICAgICAgICAgKi8KLUAgICAgIFdvcmQxNiBzaWdfbG9bXSwgICAgICAgICAgICAgICAgICAgICAgLyogKG8pIC8xNiA6IHN5bnRoZXNpcyBsb3cgICAgICAgICAgICAgICAgICAqLwotQCAgICAgV29yZDE2IGxnICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvKiAoaSkgICAgIDogc2l6ZSBvZiBmaWx0ZXJpbmcgICAgICAgICAgICAgICovCi1AKQotQCoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgotQAotQCBhW10gICAgICAtLS0gcjAKLUAgbSAgICAgICAgLS0tIHIxCi1AIGV4Y1tdICAgIC0tLSByMgotQCBRbmV3ICAgICAtLS0gcjMKLUAgc2lnX2hpW10gLS0tIHI0Ci1AIHNpZ19sb1tdIC0tLSByNQotQCBsZyAgICAgICAtLS0gcjYKLQotICAgICAgICAgIC5zZWN0aW9uICAudGV4dAotICAgICAgICAgIC5nbG9iYWwgIFN5bl9maWx0XzMyX2FzbQotCi1TeW5fZmlsdF8zMl9hc206Ci0KLSAgICAgICAgICBTVE1GRCAgIAlyMTMhLCB7cjQgLSByMTIsIHIxNH0KLSAgICAgICAgICBMRFIgICAgICAgICAgIHI0LCAgW3IxMywgIzQwXSAgICAgICAgICAgICAgICAgIEAgZ2V0IHNpZ19oaVtdIGFkZHJlc3MKLSAgICAgICAgICBMRFIgICAgICAgICAgIHI1LCAgW3IxMywgIzQ0XSAgICAgICAgICAgICAgICAgIEAgZ2V0IHNpZ19sb1tdIGFkZHJlc3MKLQotICAgICAgICAgIExEUlNIICAgICAgICAgcjYsICBbcjBdICAgICAgICAgICAgICAgICAgICAgICAgQCBsb2FkIEFxWzBdCi0gICAgICAgICAgQUREICAgICAgICAgICByNywgIHIzLCAjNCAgICAgICAgICAgICAgICAgICAgICBAIDQgKyBRX25ldwotICAgICAgICAgIE1PViAgICAgICAgICAgcjMsIHI2LCBBU1IgcjcgICAgICAgICAgICAgICAgICAgQCBhMCA9IEFxWzBdID4+ICg0ICsgUV9uZXcpCi0KLSAgICAgICAgICBMRFIgICAgICAgICAgIHIxNCwgPTB4ZmZmZgotICAgICAgICAgIExEUlNIICAgICAgICAgcjYsIFtyMCwgIzJdICAgICAgICAgICAgICAgICAgICAgQCBsb2FkIEFxWzFdCi0gICAgICAgICAgTERSU0ggICAgICAgICByNywgW3IwLCAjNF0gICAgICAgICAgICAgICAgICAgICBAIGxvYWQgQXFbMl0KLSAgICAgICAgICBMRFJTSCAgICAgICAgIHI4LCBbcjAsICM2XSAgICAgICAgICAgICAgICAgICAgIEAgbG9hZCBBcVszXQotICAgICAgICAgIExEUlNIICAgICAgICAgcjksIFtyMCwgIzhdICAgICAgICAgICAgICAgICAgICAgQCBsb2FkIEFxWzRdCi0gICAgICAgICAgQU5EICAgICAgICAgICByNiwgcjYsIHIxNAotICAgICAgICAgIEFORCAgICAgICAgICAgcjgsIHI4LCByMTQKLSAgICAgICAgICBPUlIgICAgICAgICAgIHIxMCwgcjYsIHI3LCBMU0wgIzE2ICAgICAgICAgICAgIEAgQXFbMl0gLS0gQXFbMV0KLSAgICAgICAgICBPUlIgICAgICAgICAgIHIxMSwgcjgsIHI5LCBMU0wgIzE2ICAgICAgICAgICAgIEAgQXFbNF0gLS0gQXFbM10KLSAgICAgICAgICBTVFIgICAgICAgICAgIHIxMCwgW3IxMywgIy00XQotICAgICAgICAgIFNUUiAgICAgICAgICAgcjExLCBbcjEzLCAjLThdCi0KLSAgICAgICAgICBMRFJTSCAgICAgICAgIHI2LCBbcjAsICMxMF0gICAgICAgICAgICAgICAgICAgIEAgbG9hZCBBcVs1XQotICAgICAgICAgIExEUlNIICAgICAgICAgcjcsIFtyMCwgIzEyXSAgICAgICAgICAgICAgICAgICAgQCBsb2FkIEFxWzZdCi0gICAgICAgICAgTERSU0ggICAgICAgICByOCwgW3IwLCAjMTRdICAgICAgICAgICAgICAgICAgICBAIGxvYWQgQXFbN10KLSAgICAgICAgICBMRFJTSCAgICAgICAgIHI5LCBbcjAsICMxNl0gICAgICAgICAgICAgICAgICAgIEAgbG9hZCBBcVs4XQotICAgICAgICAgIEFORCAgICAgICAgICAgcjYsIHI2LCByMTQKLSAgICAgICAgICBBTkQgICAgICAgICAgIHI4LCByOCwgcjE0Ci0gICAgICAgICAgT1JSICAgICAgICAgICByMTAsIHI2LCByNywgTFNMICMxNiAgICAgICAgICAgICBAIEFxWzZdIC0tIEFxWzVdCi0gICAgICAgICAgT1JSICAgICAgICAgICByMTEsIHI4LCByOSwgTFNMICMxNiAgICAgICAgICAgICBAIEFxWzhdIC0tIEFxWzddCi0gICAgICAgICAgU1RSICAgICAgICAgICByMTAsIFtyMTMsICMtMTJdCi0gICAgICAgICAgU1RSICAgICAgICAgICByMTEsIFtyMTMsICMtMTZdCi0KLSAgICAgICAgICBMRFJTSCAgICAgICAgIHI2LCBbcjAsICMxOF0gICAgICAgICAgICAgICAgICAgIEAgbG9hZCBBcVs5XQotICAgICAgICAgIExEUlNIICAgICAgICAgcjcsIFtyMCwgIzIwXSAgICAgICAgICAgICAgICAgICAgQCBsb2FkIEFxWzEwXQotICAgICAgICAgIExEUlNIICAgICAgICAgcjgsIFtyMCwgIzIyXSAgICAgICAgICAgICAgICAgICAgQCBsb2FkIEFxWzExXQotICAgICAgICAgIExEUlNIICAgICAgICAgcjksIFtyMCwgIzI0XSAgICAgICAgICAgICAgICAgICAgQCBsb2FkIEFxWzEyXQotICAgICAgICAgIEFORCAgICAgICAgICAgcjYsIHI2LCByMTQKLSAgICAgICAgICBBTkQgICAgICAgICAgIHI4LCByOCwgcjE0Ci0gICAgICAgICAgT1JSICAgICAgICAgICByMTAsIHI2LCByNywgTFNMICMxNiAgICAgICAgICAgICBAIEFxWzEwXSAtLSBBcVs5XQotICAgICAgICAgIE9SUiAgICAgICAgICAgcjExLCByOCwgcjksIExTTCAjMTYgICAgICAgICAgICAgQCBBcVsxMl0gLS0gQXFbMTFdCi0gICAgICAgICAgU1RSICAgICAgICAgICByMTAsIFtyMTMsICMtMjBdCi0gICAgICAgICAgU1RSICAgICAgICAgICByMTEsIFtyMTMsICMtMjRdCi0KLSAgICAgICAgICBMRFJTSCAgICAgICAgIHI2LCBbcjAsICMyNl0gICAgICAgICAgICAgICAgICAgIEAgbG9hZCBBcVsxM10KLSAgICAgICAgICBMRFJTSCAgICAgICAgIHI3LCBbcjAsICMyOF0gICAgICAgICAgICAgICAgICAgIEAgbG9hZCBBcVsxNF0KLSAgICAgICAgICBMRFJTSCAgICAgICAgIHI4LCBbcjAsICMzMF0gICAgICAgICAgICAgICAgICAgIEAgbG9hZCBBcVsxNV0KLSAgICAgICAgICBMRFJTSCAgICAgICAgIHI5LCBbcjAsICMzMl0gICAgICAgICAgICAgICAgICAgIEAgbG9hZCBBcVsxNl0KLSAgICAgICAgICBBTkQgICAgICAgICAgIHI2LCByNiwgcjE0Ci0gICAgICAgICAgQU5EICAgICAgICAgICByOCwgcjgsIHIxNAotICAgICAgICAgIE9SUiAgICAgICAgICAgcjEwLCByNiwgcjcsIExTTCAjMTYgICAgICAgICAgICAgQCBBcVsxNF0gLS0gQXFbMTNdCi0gICAgICAgICAgT1JSICAgICAgICAgICByMTEsIHI4LCByOSwgTFNMICMxNiAgICAgICAgICAgICBAIEFxWzE2XSAtLSBBcVsxNV0KLSAgICAgICAgICBTVFIgICAgICAgICAgIHIxMCwgW3IxMywgIy0yOF0KLSAgICAgICAgICBTVFIgICAgICAgICAgIHIxMSwgW3IxMywgIy0zMl0KLQotICAgICAgICAgIE1PViAgICAgICAgICAgcjgsICMwICAgICAgICAgICAgICAgICAgICAgICAgICAgQCBpID0gMAotCi1MT09QOgotICAgICAgICAgIExEUlNIICAgICAgICAgcjYsIFtyNSwgIy0yXSAgICAgICAgICAgICAgICAgICAgQCBsb2FkIHNpZ19sb1tpLTFdCi0gICAgICAgICAgTERSU0ggICAgICAgICByNywgW3I1LCAjLTRdICAgICAgICAgICAgICAgICAgICBAIGxvYWQgc2lnX2xvW2ktMl0KLQotICAgICAgICAgIExEUiAgICAgICAgICAgcjExLCBbcjEzLCAjLTRdICAgICAgICAgICAgICAgICAgQCBBcVsyXSAtLSBBcVsxXQotICAgICAgICAgIExEUlNIICAgICAgICAgcjksIFtyNSwgIy02XSAgICAgICAgICAgICAgICAgICAgQCBsb2FkIHNpZ19sb1tpLTNdCi0gICAgICAgICAgTERSU0ggICAgICAgICByMTAsIFtyNSwgIy04XSAgICAgICAgICAgICAgICAgICBAIGxvYWQgc2lnX2xvW2ktNF0KLQotICAgICAgICAgIFNNVUxCQiAgICAgICAgcjEyLCByNiwgcjExICAgICAgICAgICAgICAgICAgICAgQCBzaWdfbG9baS0xXSAqIEFxWzFdCi0KLSAgICAgICAgICBMRFJTSCAgICAgICAgIHI2LCBbcjUsICMtMTBdICAgICAgICAgICAgICAgICAgIEAgbG9hZCBzaWdfbG9baS01XQotICAgICAgICAgIFNNTEFCVCAgICAgICAgcjEyLCByNywgcjExLCByMTIgICAgICAgICAgICAgICAgQCBzaWdfbG9baS0yXSAqIEFxWzJdCi0gICAgICAgICAgTERSICAgICAgICAgICByMTEsIFtyMTMsICMtOF0gICAgICAgICAgICAgICAgICBAIEFxWzRdIC0tIEFxWzNdCi0gICAgICAgICAgTERSU0ggICAgICAgICByNywgW3I1LCAjLTEyXSAgICAgICAgICAgICAgICAgICBAIGxvYWQgc2lnX2xvW2ktNl0KLSAgICAgICAgICBTTUxBQkIgICAgICAgIHIxMiwgcjksIHIxMSwgcjEyICAgICAgICAgICAgICAgIEAgc2lnX2xvW2ktM10gKiBBcVszXQotICAgICAgICAgIExEUlNIICAgICAgICAgcjksIFtyNSwgIy0xNF0gICAgICAgICAgICAgICAgICAgQCBsb2FkIHNpZ19sb1tpLTddCi0gICAgICAgICAgU01MQUJUICAgICAgICByMTIsIHIxMCwgcjExLCByMTIgICAgICAgICAgICAgICBAIHNpZ19sb1tpLTRdICogQXFbNF0KLSAgICAgICAgICBMRFIgICAgICAgICAgIHIxMSwgW3IxMywgIy0xMl0gICAgICAgICAgICAgICAgIEAgQXFbNl0gLS0gQXFbNV0KLSAgICAgICAgICBMRFJTSCAgICAgICAgIHIxMCwgW3I1LCAjLTE2XSAgICAgICAgICAgICAgICAgIEAgbG9hZCBzaWdfbG9baS04XQotICAgICAgICAgIFNNTEFCQiAgICAgICAgcjEyLCByNiwgcjExLCByMTIgICAgICAgICAgICAgICAgQCBzaWdfbG9baS01XSAqIEFxWzVdCi0gICAgICAgICAgTERSU0ggICAgICAgICByNiwgIFtyNSwgIy0xOF0gICAgICAgICAgICAgICAgICBAIGxvYWQgc2lnX2xvW2ktOV0KLSAgICAgICAgICBTTUxBQlQgICAgICAgIHIxMiwgcjcsIHIxMSwgcjEyICAgICAgICAgICAgICAgIEAgc2lnX2xvW2ktNl0gKiBBcVs2XQotICAgICAgICAgIExEUiAgICAgICAgICAgcjExLCBbcjEzLCAjLTE2XSAgICAgICAgICAgICAgICAgQCBBcVs4XSAtLSBBcVs3XQotICAgICAgICAgIExEUlNIICAgICAgICAgcjcsICBbcjUsICMtMjBdICAgICAgICAgICAgICAgICAgQCBsb2FkIHNpZ19sb1tpLTEwXQotICAgICAgICAgIFNNTEFCQiAgICAgICAgcjEyLCByOSwgcjExLCByMTIgICAgICAgICAgICAgICAgQCBzaWdfbG9baS03XSAqIEFxWzddCi0gICAgICAgICAgTERSU0ggICAgICAgICByOSwgW3I1LCAjLTIyXSAgICAgICAgICAgICAgICAgICBAIGxvYWQgc2lnX2xvW2ktMTFdCi0gICAgICAgICAgU01MQUJUICAgICAgICByMTIsIHIxMCwgcjExLCByMTIgICAgICAgICAgICAgICBAIHNpZ19sb1tpLThdICogQXFbOF0KLSAgICAgICAgICBMRFIgICAgICAgICAgIHIxMSwgW3IxMywgIy0yMF0gICAgICAgICAgICAgICAgIEAgQXFbMTBdIC0tIEFxWzldCi0gICAgICAgICAgTERSU0ggICAgICAgICByMTAsW3I1LCAjLTI0XSAgICAgICAgICAgICAgICAgICBAIGxvYWQgc2lnX2xvW2ktMTJdCi0gICAgICAgICAgU01MQUJCICAgICAgICByMTIsIHI2LCByMTEsIHIxMiAgICAgICAgICAgICAgICBAIHNpZ19sb1tpLTldICogQXFbOV0KLSAgICAgICAgICBMRFJTSCAgICAgICAgIHI2LCBbcjUsICMtMjZdICAgICAgICAgICAgICAgICAgIEAgbG9hZCBzaWdfbG9baS0xM10KLSAgICAgICAgICBTTUxBQlQgICAgICAgIHIxMiwgcjcsIHIxMSwgcjEyICAgICAgICAgICAgICAgIEAgc2lnX2xvW2ktMTBdICogQXFbMTBdCi0gICAgICAgICAgTERSICAgICAgICAgICByMTEsIFtyMTMsICMtMjRdICAgICAgICAgICAgICAgICBAIEFxWzEyXSAtLSBBcVsxMV0KLSAgICAgICAgICBMRFJTSCAgICAgICAgIHI3LCBbcjUsICMtMjhdICAgICAgICAgICAgICAgICAgIEAgbG9hZCBzaWdfbG9baS0xNF0KLSAgICAgICAgICBTTUxBQkIgICAgICAgIHIxMiwgcjksIHIxMSwgcjEyICAgICAgICAgICAgICAgIEAgc2lnX2xvW2ktMTFdICogQXFbMTFdCi0gICAgICAgICAgTERSU0ggICAgICAgICByOSwgW3I1LCAjLTMwXSAgICAgICAgICAgICAgICAgICBAIGxvYWQgc2lnX2xvW2ktMTVdCi0gICAgICAgICAgU01MQUJUICAgICAgICByMTIsIHIxMCwgcjExLCByMTIgICAgICAgICAgICAgICBAIHNpZ19sb1tpLTEyXSAqIEFxWzEyXQotCi0gICAgICAgICAgTERSICAgICAgICAgICByMTEsIFtyMTMsICMtMjhdICAgICAgICAgICAgICAgICBAIEFxWzE0XSAtLSBBcVsxM10KLSAgICAgICAgICBMRFJTSCAgICAgICAgIHIxMCwgW3I1LCAjLTMyXSAgICAgICAgICAgICAgICAgIEAgbG9hZCBzaWdfbG9baS0xNl0KLSAgICAgICAgICBTTUxBQkIgICAgICAgIHIxMiwgcjYsIHIxMSwgcjEyICAgICAgICAgICAgICAgIEAgc2lnX2xvW2ktMTNdICogQXFbMTNdCi0gICAgICAgICAgU01MQUJUICAgICAgICByMTIsIHI3LCByMTEsIHIxMiAgICAgICAgICAgICAgICBAIHNpZ19sb1tpLTE0XSAqIEFxWzE0XQotCi0gICAgICAgICAgTERSICAgICAgICAgICByMTEsIFtyMTMsICMtMzJdICAgICAgICAgICAgICAgICBAIEFxWzE2XSAtLSBBcVsxNV0KLSAgICAgICAgICBMRFJTSCAgICAgICAgIHI2LCBbcjJdLCMyICAgICAgICAgICAgICAgICAgICAgIEAgbG9hZCBleGNbaV0KLSAgICAgICAgICBTTUxBQkIgICAgICAgIHIxMiwgcjksIHIxMSwgcjEyICAgICAgICAgICAgICAgIEAgc2lnX2xvW2ktMTVdICogQXFbMTVdCi0gICAgICAgICAgU01MQUJUICAgICAgICByMTIsIHIxMCwgcjExLCByMTIgICAgICAgICAgICAgICBAIHNpZ19sb1tpLTE2XSAqIEFxWzE2XQotICAgICAgICAgIE1VTCAgICAgICAgICAgcjcsIHI2LCByMyAgICAgICAgICAgICAgICAgICAgICAgQCBleGNbaV0gKiBhMAotICAgICAgICAgIFJTQiAgICAgICAgICAgcjE0LCByMTIsICMwICAgICAgICAgICAgICAgICAgICAgQCBMX3RtcAotICAgICAgICAgIE1PViAgICAgICAgICAgcjE0LCByMTQsIEFTUiAjMTEgICAgICAgICAgICAgICAgQCBMX3RtcCA+Pj0gMTEKLSAgICAgICAgICBBREQgICAgICAgICAgIHIxNCwgcjE0LCByNywgTFNMICMxICAgICAgICAgICAgIEAgTF90bXAgKz0gKGV4Y1tpXSAqIGEwKSA8PCAxCi0KLQotICAgICAgICAgIExEUlNIICAgICAgICAgcjYsIFtyNCwgIy0yXSAgICAgICAgICAgICAgICAgICAgQCBsb2FkIHNpZ19oaVtpLTFdCi0gICAgICAgICAgTERSU0ggICAgICAgICByNywgW3I0LCAjLTRdICAgICAgICAgICAgICAgICAgICBAIGxvYWQgc2lnX2hpW2ktMl0KLQotICAgICAgICAgIExEUiAgICAgICAgICAgcjExLCBbcjEzLCAjLTRdICAgICAgICAgICAgICAgICAgQCBBcVsyXSAtLSBBcVsxXQotICAgICAgICAgIExEUlNIICAgICAgICAgcjksIFtyNCwgIy02XSAgICAgICAgICAgICAgICAgICAgQCBsb2FkIHNpZ19oaVtpLTNdCi0gICAgICAgICAgTERSU0ggICAgICAgICByMTAsIFtyNCwgIy04XSAgICAgICAgICAgICAgICAgICBAIGxvYWQgc2lnX2hpW2ktNF0KLSAgICAgICAgICBTTVVMQkIgICAgICAgIHIxMiwgcjYsIHIxMSAgICAgICAgICAgICAgICAgICAgIEAgc2lnX2hpW2ktMV0gKiBBcVsxXQotICAgICAgICAgIExEUlNIICAgICAgICAgcjYsIFtyNCwgIy0xMF0gICAgICAgICAgICAgICAgICAgQCBsb2FkIHNpZ19oaVtpLTVdCi0JICBTTUxBQlQgICAgICAgIHIxMiwgcjcsIHIxMSwgcjEyICAgICAgICAgICAgICAgIEAgc2lnX2hpW2ktMl0gKiBBcVsyXQotCi0gICAgICAgICAgTERSICAgICAgICAgICByMTEsIFtyMTMsICMtOF0gICAgICAgICAgICAgICAgICBAIEFxWzRdIC0tIEFxWzNdCi0gICAgICAgICAgTERSU0ggICAgICAgICByNywgW3I0LCAjLTEyXSAgICAgICAgICAgICAgICAgICBAIGxvYWQgc2lnX2hpW2ktNl0KLQotICAgICAgICAgIFNNTEFCQiAgICAgICAgcjEyLCByOSwgcjExLCByMTIgICAgICAgICAgICAgICAgQCBzaWdfaGlbaS0zXSAqIEFxWzNdCi0JICBMRFJTSCAgICAgICAgIHI5LCBbcjQsICMtMTRdICAgICAgICAgICAgICAgICAgIEAgbG9hZCBzaWdfaGlbaS03XQotCi0JICBTTUxBQlQgICAgICAgIHIxMiwgcjEwLCByMTEsIHIxMiAgICAgICAgICAgICAgIEAgc2lnX2hpW2ktNF0gKiBBcVs0XQotCi0gICAgICAgICAgTERSICAgICAgICAgICByMTEsIFtyMTMsICMtMTJdICAgICAgICAgICAgICAgICBAIEFxWzZdIC0tIEFxWzVdCi0gICAgICAgICAgTERSU0ggICAgICAgICByMTAsIFtyNCwgIy0xNl0gICAgICAgICAgICAgICAgICBAIGxvYWQgc2lnX2hpW2ktOF0KLQotCSAgU01MQUJCICAgICAgICByMTIsIHI2LCByMTEsIHIxMiAgICAgICAgICAgICAgICBAIHNpZ19oaVtpLTVdICogQXFbNV0KLQotCSAgTERSU0ggICAgICAgICByNiwgIFtyNCwgIy0xOF0gICAgICAgICAgICAgICAgICBAIGxvYWQgc2lnX2hpW2ktOV0KLQkgIFNNTEFCVCAgICAgICAgcjEyLCByNywgcjExLCByMTIgICAgICAgICAgICAgICAgQCBzaWdfaGlbaS02XSAqIEFxWzZdCi0KLSAgICAgICAgICBMRFIgICAgICAgICAgIHIxMSwgW3IxMywgIy0xNl0gICAgICAgICAgICAgICAgIEAgQXFbOF0gLS0gQXFbN10KLSAgICAgICAgICBMRFJTSCAgICAgICAgIHI3LCAgW3I0LCAjLTIwXSAgICAgICAgICAgICAgICAgIEAgbG9hZCBzaWdfaGlbaS0xMF0KLQotCSAgU01MQUJCICAgICAgICByMTIsIHI5LCByMTEsIHIxMiAgICAgICAgICAgICAgICBAIHNpZ19oaVtpLTddICogQXFbN10KLQotCSAgTERSU0ggICAgICAgICByOSwgW3I0LCAjLTIyXSAgICAgICAgICAgICAgICAgICBAIGxvYWQgc2lnX2hpW2ktMTFdCi0KLQkgIFNNTEFCVCAgICAgICAgcjEyLCByMTAsIHIxMSwgcjEyICAgICAgICAgICAgICAgQCBzaWdfaGlbaS04XSAqIEFxWzhdCi0KLSAgICAgICAgICBMRFIgICAgICAgICAgIHIxMSwgW3IxMywgIy0yMF0gICAgICAgICAgICAgICAgIEAgQXFbMTBdIC0tIEFxWzldCi0gICAgICAgICAgTERSU0ggICAgICAgICByMTAsW3I0LCAjLTI0XSAgICAgICAgICAgICAgICAgICBAIGxvYWQgc2lnX2hpW2ktMTJdCi0KLQkgIFNNTEFCQiAgICAgICAgcjEyLCByNiwgcjExLCByMTIgICAgICAgICAgICAgICAgQCBzaWdfaGlbaS05XSAqIEFxWzldCi0gICAgICAgICAgTERSU0ggICAgICAgICByNiwgW3I0LCAjLTI2XSAgICAgICAgICAgICAgICAgICBAIGxvYWQgc2lnX2hpW2ktMTNdCi0gICAgICAgICAgU01MQUJUICAgICAgICByMTIsIHI3LCByMTEsIHIxMiAgICAgICAgICAgICAgICBAIHNpZ19oaVtpLTEwXSAqIEFxWzEwXQotCi0gICAgICAgICAgTERSICAgICAgICAgICByMTEsIFtyMTMsICMtMjRdICAgICAgICAgICAgICAgICBAIEFxWzEyXSAtLSBBcVsxMV0KLSAgICAgICAgICBMRFJTSCAgICAgICAgIHI3LCBbcjQsICMtMjhdICAgICAgICAgICAgICAgICAgIEAgbG9hZCBzaWdfaGlbaS0xNF0KLSAgICAgICAgICBTTUxBQkIgICAgICAgIHIxMiwgcjksIHIxMSwgcjEyICAgICAgICAgICAgICAgIEAgc2lnX2hpW2ktMTFdICogQXFbMTFdCi0gICAgICAgICAgTERSU0ggICAgICAgICByOSwgW3I0LCAjLTMwXSAgICAgICAgICAgICAgICAgICBAIGxvYWQgc2lnX2hpW2ktMTVdCi0gICAgICAgICAgU01MQUJUICAgICAgICByMTIsIHIxMCwgcjExLCByMTIgICAgICAgICAgICAgICBAIHNpZ19oaVtpLTEyXSAqIEFxWzEyXQotCi0gICAgICAgICAgTERSICAgICAgICAgICByMTEsIFtyMTMsICMtMjhdICAgICAgICAgICAgICAgICBAIEFxWzE0XSAtLSBBcVsxM10KLSAgICAgICAgICBMRFJTSCAgICAgICAgIHIxMCwgW3I0LCAjLTMyXSAgICAgICAgICAgICAgICAgIEAgbG9hZCBzaWdfaGlbaS0xNl0KLSAgICAgICAgICBTTUxBQkIgICAgICAgIHIxMiwgcjYsIHIxMSwgcjEyICAgICAgICAgICAgICAgIEAgc2lnX2hpW2ktMTNdICogQXFbMTNdCi0gICAgICAgICAgU01MQUJUICAgICAgICByMTIsIHI3LCByMTEsIHIxMiAgICAgICAgICAgICAgICBAIHNpZ19oaVtpLTE0XSAqIEFxWzE0XQotCi0gICAgICAgICAgTERSICAgICAgICAgICByMTEsIFtyMTMsICMtMzJdICAgICAgICAgICAgICAgICBAIEFxWzE2XSAtLSBBcVsxNV0KLSAgICAgICAgICBTTUxBQkIgICAgICAgIHIxMiwgcjksIHIxMSwgcjEyICAgICAgICAgICAgICAgIEAgc2lnX2hpW2ktMTVdICogQXFbMTVdCi0gICAgICAgICAgU01MQUJUICAgICAgICByMTIsIHIxMCwgcjExLCByMTIgICAgICAgICAgICAgICBAIHNpZ19oaVtpLTE2XSAqIEFxWzE2XQotICAgICAgICAgIEFERCAgICAgICAgICAgcjYsIHIxMiwgcjEyICAgICAgICAgICAgICAgICAgICAgQCByMTIgPDwgMQotICAgICAgICAgIFNVQiAgICAgICAgICAgcjE0LCByMTQsIHI2Ci0gICAgICAgICAgTU9WICAgICAgICAgICByMTQsIHIxNCwgTFNMICMzICAgICAgICAgICAgICAgICBAIExfdG1wIDw8PTMKLQotICAgICAgICAgIE1PViAgICAgICAgICAgcjcsIHIxNCwgQVNSICMxNiAgICAgICAgICAgICAgICAgQCBMX3RtcCA+PiAxNgotCi0gICAgICAgICAgTU9WICAgICAgICAgICByMTQsIHIxNCwgQVNSICM0ICAgICAgICAgICAgICAgICBAIExfdG1wID4+PTQKLSAgICAgICAgICBTVFJIICAgICAgICAgIHI3LCBbcjRdLCAjMiAgICAgICAgICAgICAgICAgICAgICAgICBAIHNpZ19oaVtpXSA9IExfdG1wID4+IDE2Ci0gICAgICAgICAgU1VCICAgICAgICAgICByOSwgcjE0LCByNywgTFNMICMxMiAgICAgICAgICAgICBAIHNpZ19sb1tpXSA9IExfdG1wIC0gKHNpZ19oaVtpXSA8PCAxMikKLQotICAgICAgICAgIEFERCAgICAgICAgICAgcjgsIHI4LCAjMQotICAgICAgICAgIFNUUkggICAgICAgICAgcjksIFtyNV0sICMyCi0gICAgICAgICAgQ01QICAgICAgICAgICByOCwgIzY0Ci0gICAgICAgICAgQkxUICAgICAgICAgICBMT09QCi0KLVN5bl9maWx0XzMyX2VuZDoKLQotICAgICAgICAgIExETUZEICAgCSAgICByMTMhL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kFTSVMsCi1AICoqIFdJVEhPVVQgV0FSUkFOVElFUyBPUiBDT05ESVRJT05TIE9GIEFOWSBLSU5ELCBlaXRoZXIgZXhwcmVzcyBvciBpbXBsaWVkLgotQCAqKiBTZWUgdGhlIExpY2Vuc2UgZm9yIHRoZSBzcGVjaWZpYyBsYW5ndWFnZSBnb3Zlcm5pbmcgcGVybWlzc2lvbnMgYW5kCi1AICoqIGxpbWl0YXRpb25zIHVuZGVyIHRoZSBMaWNlbnNlLgotQCAqLwotCi0KLUAqdm9pZCBDb252b2x2ZSAoCi1AKiAgICBXb3JkMTYgeFtdLCAgICAgICAgLyogKGkpICAgICA6IGlucHV0IHZlY3RvciAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi1AKiAgICBXb3JkMTYgaFtdLCAgICAgICAgLyogKGkpICAgICA6IGltcHVsc2UgcmVzcG9uc2UgICAgICAgICAgICAgICAgICAgICAgICovCi1AKiAgICBXb3JkMTYgeVtdLCAgICAgICAgLyogKG8pICAgICA6IG91dHB1dCB2ZWN0b3IgICAgICAgICAgICAgICAgICAgICAgICAgICovCi1AKiAgICBXb3JkMTYgTCAgICAgICAgICAgLyogKGkpICAgICA6IHZlY3RvciBzaXplICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi1AKikKLUAgIHIwIC0tLSB4W10KLUAgIHIxIC0tLSBoW10KLUAgIHIyIC0tLSB5W10KLUAgIHIzIC0tLSBMCi0KLQkuc2VjdGlvbiAgLnRleHQKLSAgICAgICAgLmdsb2JhbCAgIENvbnZvbHZlX2FzbQotCi1Db252b2x2ZV9hc206Ci0KLSAgICAgICAgU1RNRkQgICAgICAgICAgcjEzISwge3I0IC0gcjEyLCByMTR9Ci0gICAgICAgIE1PViAgICAgICAgICAgIHIzLCAgIzAgICAgICAgICAgICAgICAgICAgICAgICAgICBAIG4KLQlNT1YgICAgICAgICAgICByMTEsICMweDgwMDAKLQotTE9PUDoKLSAgICAgICAgQUREICAgICAgICAgICAgcjQsIHIxLCByMywgTFNMICMxICAgICAgICAgICAgICAgIEAgdG1wSCBhZGRyZXNzCi0gICAgICAgIEFERCAgICAgICAgICAgIHI1LCByMywgIzEgICAgICAgICAgICAgICAgICAgICAgICBAIGkgPSBuICsgMQotICAgICAgICBNT1YgICAgICAgICAgICByNiwgcjAgICAgICAgICAgICAgICAgICAgICAgICAgICAgQCB0bXBYID0geAotICAgICAgICBMRFJTSCAgICAgICAgICByOSwgIFtyNl0sICMyICAgICAgICAgICAgICAgICAgICAgQCAqdG1wWCsrCi0gICAgICAgIExEUlNIICAgICAgICAgIHIxMCwgW3I0XSwgIy0yICAgICAgICAgICAgICAgICAgICBAICp0bXBILS0KLSAgICAgICAgU1VCICAgICAgICAgICAgcjUsIHI1LCAjMQotICAgICAgICBNVUwgICAgICAgICAgICByOCwgIHI5LCByMTAKLQotTE9PUDE6Ci0gICAgICAgIENNUCAgICAgICAgICAgIHI1LCAjMAotICAgICAgICBCTEUgICAgICAgICAgICBMMQotCUxEUlNIICAgICAgICAgIHI5LCAgW3I2XSwgIzIgICAgICAgICAgICAgICAgICAgICBAICp0bXBYKysKLQlMRFJTSCAgICAgICAgICByMTAsIFtyNF0sICMtMiAgICAgICAgICAgICAgICAgICAgQCAqdG1wSC0tCi0JTERSU0ggICAgICAgICAgcjEyLCBbcjZdLCAjMiAgICAgICAgICAgICAgICAgICAgIEAgKnRtcFgrKwotCUxEUlNIICAgICAgICAgIHIxNCwgW3I0XSwgIy0yICAgICAgICAgICAgICAgICAgICBAICp0bXBILS0KLQlNTEEgICAgICAgICAgICByOCwgcjksIHIxMCwgcjgKLQlNTEEgICAgICAgICAgICByOCwgcjEyLCByMTQsIHI4Ci0JTERSU0ggICAgICAgICAgcjksICBbcjZdLCAjMiAgICAgICAgICAgICAgICAgICAgIEAgKnRtcFgrKwotCUxEUlNIICAgICAgICAgIHIxMCwgW3I0XSwgIy0yICAgICAgICAgICAgICAgICAgICBAICp0bXBILS0KLQlMRFJTSCAgICAgICAgICByMTIsIFtyNl0sICMyICAgICAgICAgICAgICAgICAgICAgQCAqdG1wWCsrCi0JTERSU0ggICAgICAgICAgcjE0LCBbcjRdLCAjLTIgICAgICAgICAgICAgICAgICAgIEAgKnRtcEgtLQotCU1MQSAgICAgICAgICAgIHI4LCByOSwgcjEwLCByOAotICAgICAgICBTVUJTICAgICAgICAgICByNSwgcjUsICM0Ci0JTUxBICAgICAgICAgICAgcjgsIHIxMiwgcjE0LCByOAotCi0gICAgICAgIEIgICAgICAgICAgICAgIExPT1AxCi0KLUwxOgotCi0gICAgICAgIEFERCAgICAgICAgICAgIHI1LCByMTEsIHI4LCBMU0wgIzEKLSAgICAgICAgTU9WICAgICAgICAgICAgcjUsIHI1LCBMU1IgIzE2ICAgICAgICAgICAgICAgICAgIEBleHRyYWN0X2gocykKLSAgICAgICAgQUREICAgICAgICAgICAgcjMsIHIzLCAjMQotICAgICAgICBTVFJIICAgICAgICAgICByNSwgW3IyXSwgIzIgICAgICAgICAgICAgICAgICAgICAgQHlbbl0KLQotCi0gICAgICAgIEFERCAgICAgICAgICAgIHI0LCByMSwgcjMsIExTTCAjMSAgICAgICAgICAgICAgICBAdG1wSCBhZGRyZXNzCi0gICAgICAgIEFERCAgICAgICAgICAgIHI1LCByMywgIzEKLSAgICAgICAgTU9WICAgICAgICAgICAgcjYsIHIwCi0gICAgICAgIExEUlNIICAgICAgICAgIHI5LCAgW3I2XSwgIzIgICAgICAgICAgICAgICAgICAgICBAICp0bXBYKysKLSAgICAgICAgTERSU0ggICAgICAgICAgcjEwLCBbcjRdLCAjLTIKLSAgICAgICAgTERSU0ggICAgICAgICAgcjEyLCBbcjZdLCAjMgotICAgICAgICBMRFJTSCAgICAgICAgICByMTQsIFtyNF0sICMtMgotCi0gICAgICAgIE1VTCAgICAgICAgICAgIHI4LCByOSwgcjEwCi0gICAgICAgIFNVQiAgICAgICAgICAgIHI1LCByNSwgIzIKLSAgICAgICAgTUxBICAgICAgICAgICAgcjgsIHIxMiwgcjE0LCByOAotCi1MT09QMjoKLSAgICAgICAgQ01QICAgICAgICAgICAgcjUsICMwCi0gICAgICAgIEJMRSAgICAgICAgICAgIEwyCi0JTERSU0ggICAgICAgICAgcjksICBbcjZdLCAjMiAgICAgICAgICAgICAgICAgICAgIEAgKnRtcFgrKwotCUxEUlNIICAgICAgICAgIHIxMCwgW3I0XSwgIy0yICAgICAgICAgICAgICAgICAgICBAICp0bXBILS0KLQlMRFJTSCAgICAgICAgICByMTIsIFtyNl0sICMyICAgICAgICAgICAgICAgICAgICAgQCAqdG1wWCsrCi0JTERSU0ggICAgICAgICAgcjE0LCBbcjRdLCAjLTIgICAgICAgICAgICAgICAgICAgIEAgKnRtcEgtLQotCU1MQSAgICAgICAgICAgIHI4LCByOSwgcjEwLCByOAotCU1MQSAgICAgICAgICAgIHI4LCByMTIsIHIxNCwgcjgKLQlMRFJTSCAgICAgICAgICByOSwgIFtyNl0sICMyICAgICAgICAgICAgICAgICAgICAgQCAqdG1wWCsrCi0JTERSU0ggICAgICAgICAgcjEwLCBbcjRdLCAjLTIgICAgICAgICAgICAgICAgICAgIEAgKnRtcEgtLQotCUxEUlNIICAgICAgICAgIHIxMiwgW3I2XSwgIzIgICAgICAgICAgICAgICAgICAgICBAICp0bXBYKysKLQlMRFJTSCAgICAgICAgICByMTQsIFtyNF0sICMtMiAgICAgICAgICAgICAgICAgICAgQCAqdG1wSC0tCi0JTUxBICAgICAgICAgICAgcjgsIHI5LCByMTAsIHI4Ci0gICAgICAgIFNVQlMgICAgICAgICAgIHI1LCByNSwgIzQKLQlNTEEgICAgICAgICAgICByOCwgcjEyLCByMTQsIHI4Ci0gICAgICAgIEIgICAgICAgICAgICAgIExPT1AyCi0KLUwyOgotICAgICAgICBBREQgICAgICAgICAgICByOCwgcjExLCByOCwgTFNMICMxCi0gICAgICAgIE1PViAgICAgICAgICAgIHI4LCByOCwgTFNSICMxNiAgICAgICAgICAgICAgICAgICBAZXh0cmFjdF9oKHMpCi0gICAgICAgIEFERCAgICAgICAgICAgIHIzLCByMywgIzEKLSAgICAgICAgU1RSSCAgICAgICAgICAgcjgsIFtyMl0sICMyICAgICAgICAgICAgICAgICAgICAgIEB5W25dCi0KLSAgICAgICAgQUREICAgICAgICAgICAgcjQsIHIxLCByMywgTFNMICMxCi0gICAgICAgIEFERCAgICAgICAgICAgIHI1LCByMywgIzEKLSAgICAgICAgTU9WICAgICAgICAgICAgcjYsIHIwCi0gICAgICAgIExEUlNIICAgICAgICAgIHI5LCAgW3I2XSwgIzIKLSAgICAgICAgTERSU0ggICAgICAgICAgcjEwLCBbcjRdLCAjLTIKLSAgICAgICAgTERSU0ggICAgICAgICAgcjEyLCBbcjZdLCAjMgotICAgICAgICBMRFJTSCAgICAgICAgICByMTQsIFtyNF0sICMtMgotICAgICAgICBNVUwgICAgICAgICAgICByOCwgcjksIHIxMAotICAgICAgICBMRFJTSCAgICAgICAgICByOSwgIFtyNl0sICMyCi0gICAgICAgIExEUlNIICAgICAgICAgIHIxMCwgW3I0XSwgIy0yCi0gICAgICAgIE1MQSAgICAgICAgICAgIHI4LCByMTIsIHIxNCwgcjgKLSAgICAgICAgU1VCICAgICAgICAgICAgcjUsIHI1LCAjMwotICAgICAgICBNTEEgICAgICAgICAgICByOCwgcjksIHIxMCwgcjgKLQotTE9PUDM6Ci0gICAgICAgIENNUCAgICAgICAgICAgIHI1LCAjMAotICAgICAgICBCTEUgICAgICAgICAgICBMMwotCUxEUlNIICAgICAgICAgIHI5LCAgW3I2XSwgIzIgICAgICAgICAgICAgICAgICAgICBAICp0bXBYKysKLQlMRFJTSCAgICAgICAgICByMTAsIFtyNF0sICMtMiAgICAgICAgICAgICAgICAgICAgQCAqdG1wSC0tCi0JTERSU0ggICAgICAgICAgcjEyLCBbcjZdLCAjMiAgICAgICAgICAgICAgICAgICAgIEAgKnRtcFgrKwotCUxEUlNIICAgICAgICAgIHIxNCwgW3I0XSwgIy0yICAgICAgICAgICAgICAgICAgICBAICp0bXBILS0KLQlNTEEgICAgICAgICAgICByOCwgcjksIHIxMCwgcjgKLQlNTEEgICAgICAgICAgICByOCwgcjEyLCByMTQsIHI4Ci0JTERSU0ggICAgICAgICAgcjksICBbcjZdLCAjMiAgICAgICAgICAgICAgICAgICAgIEAgKnRtcFgrKwotCUxEUlNIICAgICAgICAgIHIxMCwgW3I0XSwgIy0yICAgICAgICAgICAgICAgICAgICBAICp0bXBILS0KLQlMRFJTSCAgICAgICAgICByMTIsIFtyNl0sICMyICAgICAgICAgICAgICAgICAgICAgQCAqdG1wWCsrCi0JTERSU0ggICAgICAgICAgcjE0LCBbcjRdLCAjLTIgICAgICAgICAgICAgICAgICAgIEAgKnRtcEgtLQotCU1MQSAgICAgICAgICAgIHI4LCByOSwgcjEwLCByOAotICAgICAgICBTVUJTICAgICAgICAgICByNSwgcjUsICM0Ci0JTUxBICAgICAgICAgICAgcjgsIHIxMiwgcjE0LCByOAotICAgICAgICBCICAgICAgICAgICAgICBMT09QMwotCi1MMzoKLSAgICAgICAgQUREICAgICAgICAgICAgcjgsIHIxMSwgcjgsIExTTCAjMQotICAgICAgICBNT1YgICAgICAgICAgICByOCwgcjgsIExTUiAjMTYgICAgICAgICAgICAgICAgICAgQGV4dHJhY3RfaChzKQotICAgICAgICBBREQgICAgICAgICAgICByMywgcjMsICMxCi0gICAgICAgIFNUUkggICAgICAgICAgIHI4LCBbcjJdLCAjMiAgICAgICAgICAgICAgICAgICAgICBAeVtuXQotCi0gICAgICAgIEFERCAgICAgICAgICAgIHI1LCByMywgIzEgICAgICAgICAgICAgICAgICAgICAgICBAIGkgPSBuICsgMQotICAgICAgICBBREQgICAgICAgICAgICByNCwgcjEsIHIzLCBMU0wgIzEgICAgICAgICAgICAgICAgQCB0bXBIIGFkZHJlc3MKLSAgICAgICAgTU9WICAgICAgICAgICAgcjYsIHIwCi0gICAgICAgIE1PViAgICAgICAgICAgIHI4LCAjMAotCi1MT09QNDoKLSAgICAgICAgQ01QICAgICAgICAgICAgcjUsICMwCi0gICAgICAgIEJMRSAgICAgICAgICAgIEw0Ci0JTERSU0ggICAgICAgICAgcjksICBbcjZdLCAjMiAgICAgICAgICAgICAgICAgICAgIEAgKnRtcFgrKwotCUxEUlNIICAgICAgICAgIHIxMCwgW3I0XSwgIy0yICAgICAgICAgICAgICAgICAgICBAICp0bXBILS0KLQlMRFJTSCAgICAgICAgICByMTIsIFtyNl0sICMyICAgICAgICAgICAgICAgICAgICAgQCAqdG1wWCsrCi0JTERSU0ggICAgICAgICAgcjE0LCBbcjRdLCAjLTIgICAgICAgICAgICAgICAgICAgIEAgKnRtcEgtLQotCU1MQSAgICAgICAgICAgIHI4LCByOSwgcjEwLCByOAotCU1MQSAgICAgICAgICAgIHI4LCByMTIsIHIxNCwgcjgKLQlMRFJTSCAgICAgICAgICByOSwgIFtyNl0sICMyICAgICAgICAgICAgICAgICAgICAgQCAqdG1wWCsrCi0JTERSU0ggICAgICAgICAgcjEwLCBbcjRdLCAjLTIgICAgICAgICAgICAgICAgICAgIEAgKnRtcEgtLQotCUxEUlNIICAgICAgICAgIHIxMiwgW3I2XSwgIzIgICAgICAgICAgICAgICAgICAgICBAICp0bXBYKysKLQlMRFJTSCAgICAgICAgICByMTQsIFtyNF0sICMtMiAgICAgICAgICAgICAgICAgICAgQCAqdG1wSC0tCi0JTUxBICAgICAgICAgICAgcjgsIHI5LCByMTAsIHI4Ci0gICAgICAgIFNVQlMgICAgICAgICAgIHI1LCByNSwgIzQKLQlNTEEgICAgICAgICAgICByOCwgcjEyLCByMTQsIHI4Ci0gICAgICAgIEIgICAgICAgICAgICAgIExPT1A0Ci1MNDoKLSAgICAgICAgQUREICAgICAgICAgICAgcjUsIHIxMSwgcjgsIExTTCAjMQotICAgICAgICBNT1YgICAgICAgICAgICByNSwgcjUsIExTUiAjMTYgICAgICAgICAgICAgICAgICAgQGV4dHJhY3RfaChzKQotICAgICAgICBBREQgICAgICAgICAgICByMywgcjMsICMxCi0gICAgICAgIFNUUkggICAgICAgICAgIHI1LCBbcjJdLCAjMiAgICAgICAgICAgICA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BhcHBsaWNhYmxlIGxhdyBvciBhZ3JlZWQgdG8gaW4gd3JpdGluZywgc29mdHdhcmUKLUAgKiogZGlzdHJpYnV0ZWQgdW5kZXIgdGhlIExpY2Vuc2UgaXMgZGlzdHJpYnV0ZWQgb24gYW4gIkFTIElTIiBCQVNJUywKLUAgKiogV0lUSE9VVCBXQVJSQU5USUVTIE9SIENPTkRJVElPTlMgT0YgQU5ZIEtJTkQsIGVpdGhlciBleHByZXNzIG9yIGltcGxpZWQuCi1AICoqIFNlZSB0aGUgTGljZW5zZSBmb3IgdGhlIHNwZWNpZmljIGxhbmd1YWdlIGdvdmVybmluZyBwZXJtaXNzaW9ucyBhbmQKLUAgKiogbGltaXRhdGlvbnMgdW5kZXIgdGhlIExpY2Vuc2UuCi1AICovCi1Ac3RhdGljIHZvaWQgY29yX2hfdmVjXzAxMigKLUAJCVdvcmQxNiBoW10sICAgICAgICAgICAgICAgICAgICAgICAgICAgLyogKGkpIHNjYWxlZCBpbXB1bHNlIHJlc3BvbnNlICAgICAgICAgICAgICAgICAqLwotQAkJV29yZDE2IHZlY1tdLCAgICAgICAgICAgICAgICAgICAgICAgICAvKiAoaSkgc2NhbGVkIHZlY3RvciAoLzgpIHRvIGNvcnJlbGF0ZSB3aXRoIGhbXSAqLwotQAkJV29yZDE2IHRyYWNrLCAgICAgICAgICAgICAgICAgICAgICAgICAvKiAoaSkgdHJhY2sgdG8gdXNlICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi1ACQlXb3JkMTYgc2lnbltdLCAgICAgICAgICAgICAgICAgICAgICAgIC8qIChpKSBzaWduIHZlY3RvciAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLUAJCVdvcmQxNiBycml4aXhbXVtOQl9QT1NdLCAgICAgICAgICAgICAgLyogKGkpIGNvcnJlbGF0aW9uIG9mIGhbeF0gd2l0aCBoW3hdICAgICAgKi8KLUAJCVdvcmQxNiBjb3JfMVtdLCAgICAgICAgICAgICAgICAgICAgICAgLyogKG8pIHJlc3VsdCBvZiBjb3JyZWxhdGlvbiAoTkJfUE9TIGVsZW1lbnRzKSAqLwotQAkJV29yZDE2IGNvcl8yW10gICAgICAgICAgICAgICAgICAgICAgICAvKiAobykgcmVzdWx0IG9mIGNvcnJlbGF0aW9uIChOQl9QT1MgZWxlbWVudHMpICovCi1AKQotQHIwIC0tLS0gaFtdCi1AcjEgLS0tLSB2ZWNbXQotQHIyIC0tLS0gdHJhY2sKLUByMyAtLS0tIHNpZ25bXQotQHI0IC0tLS0gcnJpeGl4W11bTkJfUE9TXQotQHI1IC0tLS0gY29yXzFbXQotQHI2IC0tLS0gY29yXzJbXQotCi0KLSAgICAgICAgICAuc2VjdGlvbiAgLnRleHQKLQkgIC5nbG9iYWwgIGNvcl9oX3ZlY18wMTJfYXNtCi0KLWNvcl9oX3ZlY18wMTJfYXNtOgotCi0gICAgICAgICBTVE1GRCAgICAgICAgIHIxMyEsIHtyNCAtIHIxMiwgcjE0fQotCSBMRFIgICAgICAgICAgIHI0LCBbcjEzLCAjNDBdICAgICAgICAgICAgICAgICAgICBAbG9hZCBycml4aXhbXVtOQl9QT1NdCi0JIEFERCAgICAgICAgICAgcjcsIHI0LCByMiwgTFNMICM1ICAgICAgICAgICAgICAgIEByNyAtLS0gcDAgPSBycml4aXhbdHJhY2tdCi0gICAgICAgICBNT1YgICAgICAgICAgIHI0LCAjMCAgICAgICAgICAgICAgICAgICAgICAgICAgICBAaT0wCi0KLQkgQHIwIC0tLSBoW10sIHIxIC0tLSB2ZWNbXSwgIHIyIC0tLSBwb3MKLQkgQHIzIC0tLSBzaWduW10sIHI0IC0tLSBpLCByNyAtLS0gcDAKLUxPT1BpOgotICAgICAgICAgTU9WICAgICAgICAgICByNSwgIzAgICAgICAgICAgICAgICAgICAgICAgICAgICAgQExfc3VtMSA9IDAKLSAgICAgICAgIE1PViAgICAgICAgICAgcjYsICMwICAgICAgICAgICAgICAgICAgICAgICAgICAgIEBMX3N1bTIgPSAwCi0gICAgICAgICBBREQgICAgICAgICAgIHI5LCByMSwgcjIsIExTTCAjMSAgICAgICAgICAgICAgICBAcDIgPSAmdmVjW3Bvc10KLSAgICAgICAgIE1PViAgICAgICAgICAgcjEwLCByMCAgICAgICAgICAgICAgICAgICAgICAgICAgIEBwMSA9IGgKLSAgICAgICAgIFJTQiAgICAgICAgICAgcjExLCByMiwgIzYyICAgICAgICAgICAgICAgICAgICAgIEBqPTYyLXBvcwotCi1MT09QajE6Ci0JIExEUlNIICAgICAgICAgcjEyLCBbcjEwXSwgIzIKLQkgTERSU0ggICAgICAgICByOCwgIFtyOV0sICMyCi0JIExEUlNIICAgICAgICAgcjE0LCBbcjldCi0JIFNVQlMgICAgICAgICAgcjExLCByMTEsICMxCi0gICAgICAgICBNTEEgICAgICAgICAgIHI1LCByMTIsIHI4LCByNQotICAgICAgICAgTUxBICAgICAgICAgICByNiwgcjEyLCByMTQsIHI2Ci0JIEJHRSAgICAgICAgICAgTE9PUGoxCi0KLQkgTERSU0ggICAgICAgICByMTIsIFtyMTBdLCAjMiAgICAgICAgICAgICAgICAgICAgIEAqcDErKwotCSBNT1YgICAgICAgICAgIHI2LCByNiwgTFNMICMyICAgICAgICAgICAgICAgICAgICAgQExfc3VtMiA9IChMX3N1bTIgPDwgMikKLSAgICAgICAgIE1MQSAgICAgICAgICAgcjUsIHIxMiwgcjE0LCByNQotICAgICAgICAgTU9WICAgICAgICAgICByMTQsICMweDgwMDAKLSAgICAgICAgIE1PViAgICAgICAgICAgcjUsIHI1LCBMU0wgIzIgICAgICAgICAgICAgICAgICAgICBATF9zdW0xID0gKExfc3VtMSA8PCAyKQotICAgICAgICAgQUREICAgICAgICAgICByMTAsIHI2LCByMTQKLSAgICAgICAgIEFERCAgICAgICAgICAgcjksIHI1LCByMTQKLSAgICAgICAgIE1PViAgICAgICAgICAgcjUsIHI5LCBBU1IgIzE2Ci0gICAgICAgICBNT1YgICAgICAgICAgIHI2LCByMTAsIEFTUiAjMTYKLSAgICAgICAgIEFERCAgICAgICAgICAgcjksIHIzLCByMiwgTFNMICMxICAgICAgICAgICAgICAgICBAYWRkcmVzcyBvZiBzaWduW3Bvc10KLSAgICAgICAgIEFERCAgICAgICAgICAgcjgsIHI3LCAjMzIKLSAgICAgICAgIExEUlNIICAgICAgICAgcjEwLCBbcjldLCAjMiAgICAgICAgICAgICAgICAgCSAgQHNpZ25bcG9zXQotCSBMRFJTSCAgICAgICAgIHIxMSwgW3I5XSAgICAgICAgICAgICAgICAgICAgICAgICAgQHNpZ25bcG9zICsgMV0KLQkgTVVMICAgICAgICAgICByMTIsIHI1LCByMTAKLQkgTVVMICAgICAgICAgICByMTQsIHI2LCByMTEKLQkgTU9WICAgICAgICAgICByNSwgcjEyLCBBU1IgIzE1Ci0JIE1PViAgICAgICAgICAgcjYsIHIxNCwgQVNSICMxNQotCSBMRFIgICAgICAgICAgIHI5LCAgW3IxMywgIzQ0XQotCSBMRFIgICAgICAgICAgIHIxMiwgW3IxMywgIzQ4XQotICAgICAgICAgTERSU0ggICAgICAgICByMTAsIFtyN10sICMyICAgICAgICAgICAgICAgICAgICAgIEAqcDArKwotCSBMRFJTSCAgICAgICAgIHIxMSwgW3I4XSAgICAgICAgICAgICAgICAgICAgICAgICAgQCpwMysrCi0gICAgICAgICBBREQgICAgICAgICAgIHI5LCByOSwgcjQsIExTTCAjMQotCSBBREQgICAgICAgICAgIHIxMiwgcjEyLCByNCwgTFNMICMxCi0JIEFERCAgICAgICAgICAgcjUsIHI1LCByMTAKLQkgQUREICAgICAgICAgICByNiwgcjYsIHIxMQotCSBTVFJIICAgICAgICAgIHI1LCBbcjldCi0JIFNUUkggICAgICAgICAgcjYsIFtyMTJdCi0KLSAgICAgICAgIEFERCAgICAgICAgICAgcjIsIHIyLCAjNAotCi0gICAgICAgICBNT1YgICAgICAgICAgIHI1LCAjMCAgICAgICAgICAgICAgICAgICAgICAgICAgICBATF9zdW0xID0gMAotCSBNT1YgICAgICAgICAgIHI2LCAjMCAgICAgICAgICAgICAgICAgICAgICAgICAgICBATF9zdW0yID0gMAotCSBBREQgICAgICAgICAgIHI5LCByMSwgcjIsIExTTCAjMSAgICAgICAgICAgICAgICBAcDIgPSAmdmVjW3Bvc10KLQkgTU9WICAgICAgICAgICByMTAsIHIwICAgICAgICAgICAgICAgICAgICAgICAgICAgQHAxID0gaAotCSBSU0IgICAgICAgICAgIHIxMSwgcjIsICM2MiAgICAgICAgICAgICAgICAgICAgICBAaj02Mi1wb3MKLQkgQUREICAgICAgICAgICByNCwgcjQsICMxICAgICAgICAgICAgICAgICAgICAgICAgQGkrKwotCi1MT09QajI6Ci0JIExEUlNIICAgICAgICAgcjEyLCBbcjEwXSwgIzIKLQkgTERSU0ggICAgICAgICByOCwgIFtyOV0sICMyCi0JIExEUlNIICAgICAgICAgcjE0LCBbcjldCi0JIFNVQlMgICAgICAgICAgcjExLCByMTEsICMxCi0gICAgICAgICBNTEEgICAgICAgICAgIHI1LCByMTIsIHI4LCByNQotICAgICAgICAgTUxBICAgICAgICAgICByNiwgcjEyLCByMTQsIHI2Ci0JIEJHRSAgICAgICAgICAgTE9PUGoyCi0KLQkgTERSU0ggICAgICAgICByMTIsIFtyMTBdLCAjMiAgICAgICAgICAgICAgICAgICAgIEAqcDErKwotCSBNT1YgICAgICAgICAgIHI2LCByNiwgTFNMICMyICAgICAgICAgICAgICAgICAgICAgQExfc3VtMiA9IChMX3N1bTIgPDwgMikKLSAgICAgICAgIE1MQSAgICAgICAgICAgcjUsIHIxMiwgcjE0LCByNQotICAgICAgICAgTU9WICAgICAgICAgICByMTQsICMweDgwMDAKLSAgICAgICAgIE1PViAgICAgICAgICAgcjUsIHI1LCBMU0wgIzIgICAgICAgICAgICAgICAgICAgICBATF9zdW0xID0gKExfc3VtMSA8PCAyKQotICAgICAgICAgQUREICAgICAgICAgICByMTAsIHI2LCByMTQKLSAgICAgICAgIEFERCAgICAgICAgICAgcjksIHI1LCByMTQKLQotICAgICAgICAgTU9WICAgICAgICAgICByNSwgcjksIEFTUiAjMTYKLSAgICAgICAgIE1PViAgICAgICAgICAgcjYsIHIxMCwgQVNSICMxNgotICAgICAgICAgQUREICAgICAgICAgICByOSwgcjMsIHIyLCBMU0wgIzEgICAgICAgICAgICAgICAgIEBhZGRyZXNzIG9mIHNpZ25bcG9zXQotICAgICAgICAgQUREICAgICAgICAgICByOCwgcjcsICMzMgotICAgICAgICAgTERSU0ggICAgICAgICByMTAsIFtyOV0sICMyICAgICAgICAgICAgICAgICAJICBAc2lnbltwb3NdCi0JIExEUlNIICAgICAgICAgcjExLCBbcjldICAgICAgICAgICAgICAgICAgICAgICAgICBAc2lnbltwb3MgKyAxXQotCSBNVUwgICAgICAgICAgIHIxMiwgcjUsIHIxMAotCSBNVUwgICAgICAgICAgIHIxNCwgcjYsIHIxMQotCSBNT1YgICAgICAgICAgIHI1LCByMTIsIEFTUiAjMTUKLQkgTU9WICAgICAgICAgICByNiwgcjE0LCBBU1IgIzE1Ci0JIExEUiAgICAgICAgICAgcjksICBbcjEzLCAjNDRdCi0JIExEUiAgICAgICAgICAgcjEyLCBbcjEzLCAjNDhdCi0gICAgICAgICBMRFJTSCAgICAgICAgIHIxMCwgW3I3XSwgIzIgICAgICAgICAgICAgICAgICAgICAgQCpwMCsrCi0JIExEUlNIICAgICAgICAgcjExLCBbcjhdICAgICAgICAgICAgICAgICAgICAgICAgICBAKnAzKysKLSAgICAgICAgIEFERCAgICAgICAgICAgcjksIHI5LCByNCwgTFNMICMxCi0JIEFERCAgICAgICAgICAgcjEyLCByMTIsIHI0LCBMU0wgIzEKLQkgQUREICAgICAgICAgICByNSwgcjUsIHIxMAotCSBBREQgICAgICAgICAgIHI2LCByNiwgcjExCi0JIFNUUkggICAgICAgICAgcjUsIFtyOV0KLQkgU1RSSCAgICAgICAgICByNiwgW3IxMl0KLQkgQUREICAgICAgICAgICByNCwgcjQsICMxICAgICAgICAgICAgICAgICAgICAgICAgIEBpKzEKLQkgQUREICAgICAgICAgICByMiwgcjIsICM0ICAgICAgICAgICAgICAgIC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dAotCSAuZ2xvYmFsICAgcHJlZF9sdDRfYXNtCi0JIC5leHRlcm4gICBpbnRlcjRfMgotCi1wcmVkX2x0NF9hc206Ci0KLSAgICAgICAgIFNUTUZEICAgICByMTMhLCB7cjQgLSByMTIsIHIxNH0KLSAgICAgICAgIFJTQiAgICAgICByNCwgcjEsICMwICAgICAgICAgICAgICAgICAgICAgICAgIEAtVDAKLSAgICAgICAgIFJTQiAgICAgICByMiwgcjIsICMwICAgICAgICAgICAgICAgICAgICAgICAgIEBmcmFjID0gLWZyYWMKLSAgICAgICAgIEFERCAgICAgICByNSwgcjAsIHI0LCBMU0wgIzEgICAgICAgICAgICAgICAgIEB4ID0gZXhjIC0gVDAKLSAgICAgICAgIENNUCAgICAgICByMiwgIzAKLSAgICAgICAgIEFERExUICAgICByMiwgcjIsICM0ICAgICAgICAgICAgICAgICAgICAgICAgIEBmcmFjICs9IFVQX1NBTVAKLSAgICAgICAgIFNVQkxUICAgICByNSwgcjUsICMyICAgICAgICAgICAgICAgICAgICAgICAgIEB4LS0KLSAgICAgICAgIFNVQiAgICAgICByNSwgcjUsICMzMCAgICAgICAgICAgICAgICAgICAgICAgIEB4IC09IDE1Ci0gICAgICAgICBSU0IgICAgICAgcjQsIHIyLCAjMyAgICAgICAgICAgICAgICAgICAgICAgICBAayA9IDMgLSBmcmFjCi0gICAgICAgICBMRFIgICAgICAgcjYsIFRhYmxlCi0JIE1PViAgICAgICByOCwgcjQsIExTTCAjNgotICAgICAgICAgQE1PViAgICAgICByNywgIzAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEBqID0gMAotICAgICAgICAgQUREICAgICAgIHI4LCByNiwgcjggICAgICAgICAgICAgICAgICAgICAgICAgQHB0cjIgPSAmKGludGVyNF8yW2tdWzBdKQotCi0JIE1PViAgICAgICByMSwgcjUKLQkgTU9WICAgICAgIHI1LCAjMHg4MDAwCi0JIE1PViAgICAgICByMTQsICMyMQotQCB1c2VkIHJlZ2lzdGVyCi0gICAgICAgICBAcjAgLS0tIGV4Y1tdICByMSAtLS0geCAgcjcgLS0tIGogIHI4IC0tLSBwdHIyICByNSAtLS0gMHg4MDAwCi1USFJFRV9MT09QOgotCi0gICAgICAgICBATU9WICAgICAgIHIxLCByNSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgQHB0cjEgPSB4Ci0JIE1PViAgICAgICByMiwgcjggICAgICAgICAgICAgICAgICAgICAgICAgICAgIEBwdHIgPSBwdHIyCi0gICAgICAgICBMRFIgICAgICAgcjMsIFtyMl0sICM0ICAgICAgICAgICAgICAgICAgICAgICBAaFswXSwgaFsxXQotCSBMRFJTSCAgICAgcjQsIFtyMV0sICMyICAgICAgICAgICAgICAgICAgICAgICBAeFswXQotCSBMRFJTSCAgICAgcjYsIFtyMV0sICMyICAgICAgICAgICAgICAgICAgICAgICBAeFsxXQotCSBMRFJTSCAgICAgcjksIFtyMV0sICMyICAgICAgICAgICAgICAgICAgICAgICBAeFsyXQotCi0JIFNNVUxCQiAgICByMTAsIHI0LCByMyAgICAgICAgICAgICAgICAgICAgICAgIEB4WzBdICogaFswXQotCSBTTVVMQkIgICAgcjExLCByNiwgcjMgICAgICAgICAgICAgICAgICAgICAgICBAeFsxXSAqIGhbMF0KLQkgU01VTEJCICAgIHIxMiwgcjksIHIzICAgICAgICAgICAgICAgICAgICAgICAgQHhbMl0gKiBoWzBdCi0KLSAgICAgICAgIExEUlNIICAgICByNCwgW3IxXSwgIzIgICAgICAgICAgICAgICAgICAgICAgIEB4WzNdCi0JIFNNTEFCVCAgICByMTAsIHI2LCByMywgcjEwICAgICAgICAgICAgICAgICAgIEB4WzFdICogaFsxXQotICAgICAgICAgU01MQUJUICAgIHIxMSwgcjksIHIzLCByMTEgICAgICAgICAgICAgICAgICAgQHhbMl0gKiBoWzFdCi0JIFNNTEFCVCAgICByMTIsIHI0LCByMywgcjEyICAgICAgICAgICAgICAgICAgIEB4WzNdICogaFsxXQotCi0JIExEUiAgICAgICByMywgW3IyXSwgIzQgICAgICAgICAgICAgICAgICAgICAgIEBoWzJdLCBoWzNdCi0JIExEUlNIICAgICByNiwgW3IxXSwgIzIgICAgICAgICAgICAgICAgICAgICAgIEB4WzRdCi0JIFNNTEFCQiAgICByMTAsIHI5LCByMywgcjEwICAgICAgICAgICAgICAgICAgIEB4WzJdICogaFsyXQotICAgICAgICAgU01MQUJCICAgIHIxMSwgcjQsIHIzLCByMTEgICAgICAgICAgICAgICAgICAgQHhbM10gKiBoWzJdCi0gICAgICAgICBTTUxBQkIgICAgcjEyLCByNiwgcjMsIHIxMiAgICAgICAgICAgICAgICAgICBAeFs0XSAqIGhbMl0KLQotICAgICAgICAgTERSU0ggICAgIHI5LCBbcjFdLCAjMiAgICAgICAgICAgICAgICAgICAgICAgQHhbNV0KLSAgICAgICAgIFNNTEFCVCAgICByMTAsIHI0LCByMywgcjEwICAgICAgICAgICAgICAgICAgIEB4WzNdICogaFszXQotICAgICAgICAgU01MQUJUICAgIHIxMSwgcjYsIHIzLCByMTEgICAgICAgICAgICAgICAgICAgQHhbNF0gKiBoWzNdCi0gICAgICAgICBTTUxBQlQgICAgcjEyLCByOSwgcjMsIHIxMiAgICAgICAgICAgICAgICAgICBAeFs1XSAqIGhbM10KLQotICAgICAgICAgTERSICAgICAgIHIzLCBbcjJdLCAjNCAgICAgICAgICAgICAgICAgICAgICAgQGhbNF0sIGhbNV0KLSAgICAgICAgIExEUlNIICAgICByNCwgW3IxXSwgIzIgICAgICAgICAgICAgICAgICAgICAgIEB4WzZdCi0gICAgICAgICBTTUxBQkIgICAgcjEwLCByNiwgcjMsIHIxMCAgICAgICAgICAgICAgICAgICBAeFs0XSAqIGhbNF0KLSAgICAgICAgIFNNTEFCQiAgICByMTEsIHI5LCByMywgcjExICAgICAgICAgICAgICAgICAgIEB4WzVdICogaFs0XQotICAgICAgICAgU01MQUJCICAgIHIxMiwgcjQsIHIzLCByMTIgICAgICAgICAgICAgICAgICAgQHhbNl0gKiBoWzRdCi0KLQkgTERSU0ggICAgIHI2LCBbcjFdLCAjMiAgICAgICAgICAgICAgICAgICAgICAgQHhbN10KLQkgU01MQUJUICAgIHIxMCwgcjksIHIzLCByMTAgICAgICAgICAgICAgICAgICAgQHhbNV0gKiBoWzVdCi0JIFNNTEFCVCAgICByMTEsIHI0LCByMywgcjExICAgICAgICAgICAgICAgICAgIEB4WzZdICogaFs1XQotCSBTTUxBQlQgICAgcjEyLCByNiwgcjMsIHIxMiAgICAgICAgICAgICAgICAgICBAeFs3XSAqIGhbNV0KLQotICAgICAgICAgTERSICAgICAgIHIzLCBbcjJdLCAjNCAgICAgICAgICAgICAgICAgICAgICAgQGhbNl0sIGhbN10KLQkgTERSU0ggICAgIHI5LCBbcjFdLCAjMiAgICAgICAgICAgICAgICAgICAgICAgQHhbOF0KLQkgU01MQUJCICAgIHIxMCwgcjQsIHIzLCByMTAgICAgICAgICAgICAgICAgICAgQHhbNl0gKiBoWzZdCi0JIFNNTEFCQiAgICByMTEsIHI2LCByMywgcjExICAgICAgICAgICAgICAgICAgIEB4WzddICogaFs2XQotCSBTTUxBQkIgICAgcjEyLCByOSwgcjMsIHIxMiAgICAgICAgICAgICAgICAgICBAeFs4XSAqIGhbNl0KLQotCSBMRFJTSCAgICAgcjQsIFtyMV0sICMyICAgICAgICAgICAgICAgICAgICAgICBAeFs5XQotCSBTTUxBQlQgICAgcjEwLCByNiwgcjMsIHIxMCAgICAgICAgICAgICAgICAgICBAeFs3XSAqIGhbN10KLQkgU01MQUJUICAgIHIxMSwgcjksIHIzLCByMTEgICAgICAgICAgICAgICAgICAgQHhbOF0gKiBoWzddCi0JIFNNTEFCVCAgICByMTIsIHI0LCByMywgcjEyICAgICAgICAgICAgICAgICAgIEB4WzldICogaFs3XQotCi0JIExEUiAgICAgICByMywgW3IyXSwgIzQgICAgICAgICAgICAgICAgICAgICAgIEBoWzhdLCBoWzldCi0JIExEUlNIICAgICByNiwgW3IxXSwgIzIgICAgICAgICAgICAgICAgICAgICAgIEB4WzEwXQotCSBTTUxBQkIgICAgcjEwLCByOSwgcjMsIHIxMCAgICAgICAgICAgICAgICAgICBAeFs4XSAqIGhbOF0KLQkgU01MQUJCICAgIHIxMSwgcjQsIHIzLCByMTEgICAgICAgICAgICAgICAgICAgQHhbOV0gKiBoWzhdCi0JIFNNTEFCQiAgICByMTIsIHI2LCByMywgcjEyICAgICAgICAgICAgICAgICAgIEB4WzEwXSAqIGhbOF0KLQotCSBMRFJTSCAgICAgcjksIFtyMV0sICMyICAgICAgICAgICAgICAgICAgICAgICBAeFsxMV0KLQkgU01MQUJUICAgIHIxMCwgcjQsIHIzLCByMTAgICAgICAgICAgICAgICAgICAgQHhbOV0gKiBoWzldCi0JIFNNTEFCVCAgICByMTEsIHI2LCByMywgcjExICAgICAgICAgICAgICAgICAgIEB4WzEwXSAqIGhbOV0KLQkgU01MQUJUICAgIHIxMiwgcjksIHIzLCByMTIgICAgICAgICAgICAgICAgICAgQHhbMTFdICogaFs5XQotCi0gICAgICAgICBMRFIgICAgICAgcjMsIFtyMl0sICM0ICAgICAgICAgICAgICAgICAgICAgICBAaFsxMF0sIGhbMTFdCi0JIExEUlNIICAgICByNCwgW3IxXSwgIzIgICAgICAgICAgICAgICAgICAgICAgIEB4WzEyXQotICAgICAgICAgU01MQUJCICAgIHIxMCwgcjYsIHIzLCByMTAgICAgICAgICAgICAgICAgICAgQHhbMTBdICogaFsxMF0KLQkgU01MQUJCICAgIHIxMSwgcjksIHIzLCByMTEgICAgICAgICAgICAgICAgICAgQHhbMTFdICogaFsxMF0KLQkgU01MQUJCICAgIHIxMiwgcjQsIHIzLCByMTIgICAgICAgICAgICAgICAgICAgQHhbMTJdICogaFsxMF0KLQotCSBMRFJTSCAgICAgcjYsIFtyMV0sICMyICAgICAgICAgICAgICAgICAgICAgICBAeFsxM10KLQkgU01MQUJUICAgIHIxMCwgcjksIHIzLCByMTAgICAgICAgICAgICAgICAgICAgQHhbMTFdICogaFsxMV0KLQkgU01MQUJUICAgIHIxMSwgcjQsIHIzLCByMTEgICAgICAgICAgICAgICAgICAgQHhbMTJdICogaFsxMV0KLQkgU01MQUJUICAgIHIxMiwgcjYsIHIzLCByMTIgICAgICAgICAgICAgICAgICAgQHhbMTNdICogaFsxMV0KLQotCSBMRFIgICAgICAgcjMsIFtyMl0sICM0ICAgICAgICAgICAgICAgICAgICAgICBAaFsxMl0sIGhbMTNdCi0JIExEUlNIICAgICByOSwgW3IxXSwgIzIgICAgICAgICAgICAgICAgICAgICAgIEB4WzE0XQotCSBTTUxBQkIgICAgcjEwLCByNCwgcjMsIHIxMCAgICAgICAgICAgICAgICAgICBAeFsxMl0gKiBoWzEyXQotCSBTTUxBQkIgICAgcjExLCByNiwgcjMsIHIxMSAgICAgICAgICAgICAgICAgICBAeFsxM10gKiBoWzEyXQotCSBTTUxBQkIgICAgcjEyLCByOSwgcjMsIHIxMiAgICAgICAgICAgICAgICAgICBAeFsxNF0gKiBoWzEyXQotCi0JIExEUlNIICAgICByNCwgW3IxXSwgIzIgICAgICAgICAgICAgICAgICAgICAgIEB4WzE1XQotCSBTTUxBQlQgICAgcjEwLCByNiwgcjMsIHIxMCAgICAgICAgICAgICAgICAgICBAeFsxM10gKiBoWzEzXQotCSBTTUxBQlQgICAgcjExLCByOSwgcjMsIHIxMSAgICAgICAgICAgICAgICAgICBAeFsxNF0gKiBoWzEzXQotCSBTTUxBQlQgICAgcjEyLCByNCwgcjMsIHIxMiAgICAgICAgICAgICAgICAgICBAeFsxNV0gKiBoWzEzXQotCi0JIExEUiAgICAgICByMywgW3IyXSwgIzQgICAgICAgICAgICAgICAgICAgICAgIEBoWzE0XSwgaFsxNV0KLQkgTERSU0ggICAgIHI2LCBbcjFdLCAjMiAgICAgICAgICAgICAgICAgICAgICAgQHhbMTZdCi0JIFNNTEFCQiAgICByMTAsIHI5LCByMywgcjEwICAgICAgICAgICAgICAgICAgIEB4WzE0XSAqIGhbMTRdCi0JIFNNTEFCQiAgICByMTEsIHI0LCByMywgcjExICAgICAgICAgICAgICAgICAgIEB4WzE1XSAqIGhbMTRdCi0JIFNNTEFCQiAgICByMTIsIHI2LCByMywgcjEyICAgICAgICAgICAgICAgICAgIEB4WzE2XSAqIGhbMTRdCi0KLQkgTERSU0ggICAgIHI5LCBbcjFdLCAjMiAgICAgICAgICAgICAgICAgICAgICAgQHhbMTddCi0gICAgICAgICBTTUxBQlQgICAgcjEwLCByNCwgcjMsIHIxMCAgICAgICAgICAgICAgICAgICBAeFsxNV0gKiBoWzE1XQotCSBTTUxBQlQgICAgcjExLCByNiwgcjMsIHIxMSAgICAgICAgICAgICAgICAgICBAeFsxNl0gKiBoWzE1XQotCSBTTUxBQlQgICAgcjEyLCByOSwgcjMsIHIxMiAgICAgICAgICAgICAgICAgICBAeFsxN10gKiBoWzE1XQotCi0JIExEUiAgICAgICByMywgW3IyXSwgIzQgICAgICAgICAgICAgICAgICAgICAgIEBoWzE2XSwgaFsxN10KLQkgTERSU0ggICAgIHI0LCBbcjFdLCAjMiAgICAgICAgICAgICAgICAgICAgICAgQHhbMThdCi0JIFNNTEFCQiAgICByMTAsIHI2LCByMywgcjEwICAgICAgICAgICAgICAgICAgIEB4WzE2XSAqIGhbMTZdCi0JIFNNTEFCQiAgICByMTEsIHI5LCByMywgcjExICAgICAgICAgICAgICAgICAgIEB4WzE3XSAqIGhbMTZdCi0JIFNNTEFCQiAgICByMTIsIHI0LCByMywgcjEyICAgICAgICAgICAgICAgICAgIEB4WzE4XSAqIGhbMTZdCi0KLSAgICAgICAgIExEUlNIICAgICByNiwgW3IxXSwgIzIgICAgICAgICAgICAgICAgICAgICAgIEB4WzE5XQotCSBTTUxBQlQgICAgcjEwLCByOSwgcjMsIHIxMCAgICAgICAgICAgICAgICAgICBAeFsxN10gKiBoWzE3XQotCSBTTUxBQlQgICAgcjExLCByNCwgcjMsIHIxMSAgICAgICAgICAgICAgICAgICBAeFsxOF0gKiBoWzE3XQotCSBTTUxBQlQgICAgcjEyLCByNiwgcjMsIHIxMiAgICAgICAgICAgICAgICAgICBAeFsxOV0gKiBoWzE3XQotCi0JIExEUiAgICAgICByMywgW3IyXSwgIzQgICAgICAgICAgICAgICAgICAgICAgIEBoWzE4XSwgaFsxOV0KLSAgICAgICAgIExEUlNIICAgICByOSwgW3IxXSwgIzIgICAgICAgICAgICAgICAgICAgICAgIEB4WzIwXQotCSBTTUxBQkIgICAgcjEwLCByNCwgcjMsIHIxMCAgICAgICAgICAgICAgICAgICBAeFsxOF0gKiBoWzE4XQotCSBTTUxBQkIgICAgcjExLCByNiwgcjMsIHIxMSAgICAgICAgICAgICAgICAgICBAeFsxOV0gKiBoWzE4XQotCSBTTUxBQkIgICAgcjEyLCByOSwgcjMsIHIxMiAgICAgICAgICAgICAgICAgICBAeFsyMF0gKiBoWzE4XQotCi0JIExEUlNIICAgICByNCwgW3IxXSwgIzIgICAgICAgICAgICAgICAgICAgICAgIEB4WzIxXQotCSBTTUxBQlQgICAgcjEwLCByNiwgcjMsIHIxMCAgICAgICAgICAgICAgICAgICBAeFsxOV0gKiBoWzE5XQotCSBTTUxBQlQgICAgcjExLCByOSwgcjMsIHIxMSAgICAgICAgICAgICAgICAgICBAeFsyMF0gKiBoWzE5XQotCSBTTUxBQlQgICAgcjEyLCByNCwgcjMsIHIxMiAgICAgICAgICAgICAgICAgICBAeFsyMV0gKiBoWzE5XQotCi0JIExEUiAgICAgICByMywgW3IyXSwgIzQgICAgICAgICAgICAgICAgICAgICAgIEBoWzIwXSwgaFsyMV0KLQkgTERSU0ggICAgIHI2LCBbcjFdLCAjMiAgICAgICAgICAgICAgICAgICAgICAgQHhbMjJdCi0JIFNNTEFCQiAgICByMTAsIHI5LCByMywgcjEwICAgICAgICAgICAgICAgICAgIEB4WzIwXSAqIGhbMjBdCi0JIFNNTEFCQiAgICByMTEsIHI0LCByMywgcjExICAgICAgICAgICAgICAgICAgIEB4WzIxXSAqIGhbMjBdCi0JIFNNTEFCQiAgICByMTIsIHI2LCByMywgcjEyICAgICAgICAgICAgICAgICAgIEB4WzIyXSAqIGhbMjBdCi0KLQkgTERSU0ggICAgIHI5LCBbcjFdLCAjMiAgICAgICAgICAgICAgICAgICAgICAgQHhbMjNdCi0JIFNNTEFCVCAgICByMTAsIHI0LCByMywgcjEwICAgICAgICAgICAgICAgICAgIEB4WzIxXSAqIGhbMjFdCi0JIFNNTEFCVCAgICByMTEsIHI2LCByMywgcjExICAgICAgICAgICAgICAgICAgIEB4WzIyXSAqIGhbMjFdCi0JIFNNTEFCVCAgICByMTIsIHI5LCByMywgcjEyICAgICAgICAgICAgICAgICAgIEB4WzIzXSAqIGhbMjFdCi0KLQkgTERSICAgICAgIHIzLCBbcjJdLCAjNCAgICAgICAgICAgICAgICAgICAgICAgQGhbMjJdLCBoWzIzXQotCSBMRFJTSCAgICAgcjQsIFtyMV0sICMyICAgICAgICAgICAgICAgICAgICAgICBAeFsyNF0KLQkgU01MQUJCICAgIHIxMCwgcjYsIHIzLCByMTAgICAgICAgICAgICAgICAgICAgQHhbMjJdICogaFsyMl0KLQkgU01MQUJCICAgIHIxMSwgcjksIHIzLCByMTEgICAgICAgICAgICAgICAgICAgQHhbMjNdICogaFsyMl0KLQkgU01MQUJCICAgIHIxMiwgcjQsIHIzLCByMTIgICAgICAgICAgICAgICAgICAgQHhbMjRdICogaFsyMl0KLQotICAgICAgICAgTERSU0ggICAgIHI2LCBbcjFdLCAjMiAgICAgICAgICAgICAgICAgICAgICAgQHhbMjVdCi0JIFNNTEFCVCAgICByMTAsIHI5LCByMywgcjEwICAgICAgICAgICAgICAgICAgIEB4WzIzXSAqIGhbMjNdCi0JIFNNTEFCVCAgICByMTEsIHI0LCByMywgcjExICAgICAgICAgICAgICAgICAgIEB4WzI0XSAqIGhbMjNdCi0JIFNNTEFCVCAgICByMTIsIHI2LCByMywgcjEyICAgICAgICAgICAgICAgICAgIEB4WzI1XSAqIGhbMjNdCi0KLQkgTERSICAgICAgIHIzLCBbcjJdLCAjNCAgICAgICAgICAgICAgICAgICAgICAgQGhbMjRdLCBoWzI1XQotICAgICAgICAgTERSU0ggICAgIHI5LCBbcjFdLCAjMiAgICAgICAgICAgICAgICAgICAgICAgQHhbMjZdCi0JIFNNTEFCQiAgICByMTAsIHI0LCByMywgcjEwICAgICAgICAgICAgICAgICAgIEB4WzI0XSAqIGhbMjRdCi0JIFNNTEFCQiAgICByMTEsIHI2LCByMywgcjExICAgICAgICAgICAgICAgICAgIEB4WzI1XSAqIGhbMjRdCi0JIFNNTEFCQiAgICByMTIsIHI5LCByMywgcjEyICAgICAgICAgICAgICAgICAgIEB4WzI2XSAqIGhbMjRdCi0KLQkgTERSU0ggICAgIHI0LCBbcjFdLCAjMiAgICAgICAgICAgICAgICAgICAgICAgQHhbMjddCi0JIFNNTEFCVCAgICByMTAsIHI2LCByMywgcjEwICAgICAgICAgICAgICAgICAgIEB4WzI1XSAqIGhbMjVdCi0JIFNNTEFCVCAgICByMTEsIHI5LCByMywgcjExICAgICAgICAgICAgICAgICAgIEB4WzI2XSAqIGhbMjVdCi0JIFNNTEFCVCAgICByMTIsIHI0LCByMywgcjEyICAgICAgICAgICAgICAgICAgIEB4WzI3XSAqIGhbMjVdCi0KLQkgTERSICAgICAgIHIzLCBbcjJdLCAjNCAgICAgICAgICAgICAgICAgICAgICAgQGhbMjZdLCBoWzI3XQotCSBMRFJTSCAgICAgcjYsIFtyMV0sICMyICAgICAgICAgICAgICAgICAgICAgICBAeFsyOF0KLQkgU01MQUJCICAgIHIxMCwgcjksIHIzLCByMTAgICAgICAgICAgICAgICAgICAgQHhbMjZdICogaFsyNl0KLQkgU01MQUJCICAgIHIxMSwgcjQsIHIzLCByMTEgICAgICAgICAgICAgICAgICAgQHhbMjddICogaFsyNl0KLQkgU01MQUJCICAgIHIxMiwgcjYsIHIzLCByMTIgICAgICAgICAgICAgICAgICAgQHhbMjhdICogaFsyNl0KLQotCSBMRFJTSCAgICAgcjksIFtyMV0sICMyICAgICAgICAgICAgICAgICAgICAgICBAeFsyOV0KLQkgU01MQUJUICAgIHIxMCwgcjQsIHIzLCByMTAgICAgICAgICAgICAgICAgICAgQHhbMjddICogaFsyN10KLQkgU01MQUJUICAgIHIxMSwgcjYsIHIzLCByMTEgICAgICAgICAgICAgICAgICAgQHhbMjhdICogaFsyN10KLQkgU01MQUJUICAgIHIxMiwgcjksIHIzLCByMTIgICAgICAgICAgICAgICAgICAgQHhbMjldICogaFsyN10KLQotCSBMRFIgICAgICAgcjMsIFtyMl0sICM0ICAgICAgICAgICAgICAgICAgICAgICBAaFsyOF0sIGhbMjldCi0JIExEUlNIICAgICByNCwgW3IxXSwgIzIgICAgICAgICAgICAgICAgICAgICAgIEB4WzMwXQotCSBTTUxBQkIgICAgcjEwLCByNiwgcjMsIHIxMCAgICAgICAgICAgICAgICAgICBAeFsyOF0gKiBoWzI4XQotCSBTTUxBQkIgICAgcjExLCByOSwgcjMsIHIxMSAgICAgICAgICAgICAgICAgICBAeFsyOV0gKiBoWzI4XQotCSBTTUxBQkIgICAgcjEyLCByNCwgcjMsIHIxMiAgICAgICAgICAgICAgICAgICBAeFszMF0gKiBoWzI4XQotCi0gICAgICAgICBMRFJTSCAgICAgcjYsIFtyMV0sICMyICAgICAgICAgICAgICAgICAgICAgICBAeFszMV0KLQkgU01MQUJUICAgIHIxMCwgcjksIHIzLCByMTAgICAgICAgICAgICAgICAgICAgQHhbMjldICogaFsyOV0KLQkgU01MQUJUICAgIHIxMSwgcjQsIHIzLCByMTEgICAgICAgICAgICAgICAgICAgQHhbMzBdICogaFsyOV0KLQkgU01MQUJUICAgIHIxMiwgcjYsIHIzLCByMTIgICAgICAgICAgICAgICAgICAgQHhbMzFdICogaFsyOV0KLQotCSBMRFIgICAgICAgcjMsIFtyMl0sICM0ICAgICAgICAgICAgICAgICAgICAgICBAaFszMF0sIGhbMzFdCi0gICAgICAgICBMRFJTSCAgICAgcjksIFtyMV0sICMyICAgICAgICAgICAgICAgICAgICAgICBAeFszMl0KLQkgU01MQUJCICAgIHIxMCwgcjQsIHIzLCByMTAgICAgICAgICAgICAgICAgICAgQHhbMzBdICogaFszMF0KLQkgU01MQUJCICAgIHIxMSwgcjYsIHIzLCByMTEgICAgICAgICAgICAgICAgICAgQHhbMzFdICogaFszMF0KLQkgU01MQUJCICAgIHIxMiwgcjksIHIzLCByMTIgICAgICAgICAgICAgICAgICAgQHhbMzJdICogaFszMF0KLQotCSBMRFJTSCAgICAgcjQsIFtyMV0sICMtNjAgICAgICAgICAgICAgICAgICAgICBAeFszM10KLQkgU01MQUJUICAgIHIxMCwgcjYsIHIzLCByMTAgICAgICAgICAgICAgICAgICAgQHhbMzFdICogaFszMV0KLQkgU01MQUJUICAgIHIxMSwgcjksIHIzLCByMTEgICAgICAgICAgICAgICAgICAgQHhbMzJdICogaFszMV0KLQkgU01MQUJUICAgIHIxMiwgcjQsIHIzLCByMTIgICAgICAgICAgICAgICAgICAgQHhbMzNdICogaFszMV0KLQotCSBAU1NBVCAgICAgIHIxMCwgIzMyLCByMTAsIExTTCAjMgotCSBAU1NBVCAgICAgIHIxMSwgIzMyLCByMTEsIExTTCAjMgotCSBAU1NBVCAgICAgIHIxMiwgIzMyLCByMTIsIExTTCAjMgotCi0JIE1PViAgICAgICByMTAsIHIxMCwgTFNMICMxCi0JIE1PViAgICAgICByMTEsIHIxMSwgTFNMICMxCi0JIE1PViAgICAgICByMTIsIHIxMiwgTFNMICMxCi0KLQkgUUFERCAgICAgIHIxMCwgcjEwLCByMTAKLQkgUUFERCAgICAgIHIxMSwgcjExLCByMTEKLQkgUUFERCAgICAgIHIxMiwgcjEyLCByMTIKLQotCSBRQUREICAgICAgcjEwLCByMTAsIHI1Ci0JIFFBREQgICAgICByMTEsIHIxMSwgcjUKLQkgUUFERCAgICAgIHIxMiwgcjEyLCByNQotCi0JIFNVQlMgICAgICByMTQsIHIxNCwgIzEKLQotCSBNT1YgICAgICAgcjEwLCByMTAsIEFTUiAjMTYKLQkgTU9WICAgICAgIHIxMSwgcjExLCBBU1IgIzE2Ci0JIE1PViAgICAgICByMTIsIHIxMiwgQVNSICMxNgotCi0JIFNUUkggICAgICByMTAsIFtyMF0sICMyCi0JIFNUUkggICAgICByMTEsIFtyMF0sICMyCi0JIFNUUkggICAgICByMTIsIFtyMF0sICMyCi0JIEJORSAgICAgICBUSFJFRV9MT09QCi0KLQkgTU9WICAgICAgIHIyLCByOCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgQHB0ciA9IHB0cjIKLQotTGFzdDJMT09QOgotCi0gICAgICAgICBMRFIgICAgICAgcjMsIFtyMl0sICM0ICAgICAgICAgICAgICAgICAgICAgICBAaFswXSwgaFsxXQotCSBMRFJTSCAgICAgcjQsIFtyMV0sICMyICAgICAgICAgICAgICAgICAgICAgICBAeFswXQotCSBMRFJTSCAgICAgcjYsIFtyMV0sICMyICAgICAgICAgICAgICAgICAgICAgICBAeFsxXQotCSBMRFJTSCAgICAgcjksIFtyMV0sICMyICAgICAgICAgICAgICAgICAgICAgICBAeFsyXQotCi0JIFNNVUxCQiAgICByMTAsIHI0LCByMyAgICAgICAgICAgICAgICAgICAgICAgIEB4WzBdICogaFswXQotCSBTTVVMQkIgICAgcjExLCByNiwgcjMgICAgICAgICAgICAgICAgICAgICAgICBAeFsxXSAqIGhbMF0KLQotCSBTTUxBQlQgICAgcjEwLCByNiwgcjMsIHIxMCAgICAgICAgICAgICAgICAgICBAeFsxXSAqIGhbMV0KLQkgU01MQUJUICAgIHIxMSwgcjksIHIzLCByMTEgICAgICAgICAgICAgICAgICAgQHhbMl0gKiBoWzFdCi0KLQkgTERSICAgICAgIHIzLCBbcjJdLCAjNCAgICAgICAgICAgICAgICAgICAgICAgQGhbMl0sIGhbM10KLQkgTERSU0ggICAgIHI0LCBbcjFdLCAjMiAgICAgICAgICAgICAgICAgICAgICAgQHhbM10KLSAgICAgICAgIExEUlNIICAgICByNiwgW3IxXSwgIzIgICAgICAgICAgICAgICAgICAgICAgIEB4WzRdCi0KLQkgU01MQUJCICAgIHIxMCwgcjksIHIzLCByMTAgICAgICAgICAgICAgICAgICAgQHhbMl0gKiBoWzJdCi0gICAgICAgICBTTUxBQkIgICAgcjExLCByNCwgcjMsIHIxMSAgICAgICAgICAgICAgICAgICBAeFszXSAqIGhbMl0KLQotCSBTTUxBQlQgICAgcjEwLCByNCwgcjMsIHIxMCAgICAgICAgICAgICAgICAgICBAeFszXSAqIGhbM10KLQkgU01MQUJUICAgIHIxMSwgcjYsIHIzLCByMTEgICAgICAgICAgICAgICAgICAgQHhbNF0gKiBoWzNdCi0KLQkgTERSICAgICAgIHIzLCBbcjJdLCAjNCAgICAgICAgICAgICAgICAgICAgICAgQGhbNF0sIGhbNV0KLQkgTERSU0ggICAgIHI5LCBbcjFdLCAjMiAgICAgICAgICAgICAgICAgICAgICAgQHhbNV0KLQkgTERSU0ggICAgIHI0LCBbcjFdLCAjMiAgICAgICAgICAgICAgICAgICAgICAgQHhbNl0KLQotCSBTTUxBQkIgICAgcjEwLCByNiwgcjMsIHIxMCAgICAgICAgICAgICAgICAgICBAeFs0XSAqIGhbNF0KLQkgU01MQUJCICAgIHIxMSwgcjksIHIzLCByMTEgICAgICAgICAgICAgICAgICAgQHhbNV0gKiBoWzRdCi0KLQkgU01MQUJUICAgIHIxMCwgcjksIHIzLCByMTAgICAgICAgICAgICAgICAgICAgQHhbNV0gKiBoWzVdCi0JIFNNTEFCVCAgICByMTEsIHI0LCByMywgcjExICAgICAgICAgICAgICAgICAgIEB4WzZdICogaFs1XQotCi0JIExEUiAgICAgICByMywgW3IyXSwgIzQgICAgICAgICAgICAgICAgICAgICAgIEBoWzZdLCBoWzddCi0JIExEUlNIICAgICByNiwgW3IxXSwgIzIgICAgICAgICAgICAgICAgICAgICAgIEB4WzddCi0JIExEUlNIICAgICByOSwgW3IxXSwgIzIgICAgICAgICAgICAgICAgICAgICAgIEB4WzhdCi0KLQkgU01MQUJCICAgIHIxMCwgcjQsIHIzLCByMTAgICAgICAgICAgICAgICAgICAgQHhbNl0gKiBoWzZdCi0JIFNNTEFCQiAgICByMTEsIHI2LCByMywgcjExICAgICAgICAgICAgICAgICAgIEB4WzddICogaFs2XQotCi0JIFNNTEFCVCAgICByMTAsIHI2LCByMywgcjEwICAgICAgICAgICAgICAgICAgIEB4WzddICogaFs3XQotCSBTTUxBQlQgICAgcjExLCByOSwgcjMsIHIxMSAgICAgICAgICAgICAgICAgICBAeFs4XSAqIGhbN10KLQotCSBMRFIgICAgICAgcjMsIFtyMl0sICM0ICAgICAgICAgICAgICAgICAgICAgICBAaFs4XSwgaFs5XQotCSBMRFJTSCAgICAgcjQsIFtyMV0sICMyICAgICAgICAgICAgICAgICAgICAgICBAeFs5XQotCSBMRFJTSCAgICAgcjYsIFtyMV0sICMyICAgICAgICAgICAgICAgICAgICAgICBAeFsxMF0KLQotCSBTTUxBQkIgICAgcjEwLCByOSwgcjMsIHIxMCAgICAgICAgICAgICAgICAgICBAeFs4XSAqIGhbOF0KLQkgU01MQUJCICAgIHIxMSwgcjQsIHIzLCByMTEgICAgICAgICAgICAgICAgICAgQHhbOV0gKiBoWzhdCi0KLQkgU01MQUJUICAgIHIxMCwgcjQsIHIzLCByMTAgICAgICAgICAgICAgICAgICAgQHhbOV0gKiBoWzldCi0JIFNNTEFCVCAgICByMTEsIHI2LCByMywgcjExICAgICAgICAgICAgICAgICAgIEB4WzEwXSAqIGhbOV0KLQotCSBMRFIgICAgICAgcjMsIFtyMl0sICM0ICAgICAgICAgICAgICAgICAgICAgICBAaFsxMF0sIGhbMTFdCi0JIExEUlNIICAgICByOSwgW3IxXSwgIzIgICAgICAgICAgICAgICAgICAgICAgIEB4WzExXQotCSBMRFJTSCAgICAgcjQsIFtyMV0sICMyICAgICAgICAgICAgICAgICAgICAgICBAeFsxMl0KLQotCSBTTUxBQkIgICAgcjEwLCByNiwgcjMsIHIxMCAgICAgICAgICAgICAgICAgICBAeFsxMF0gKiBoWzEwXQotCSBTTUxBQkIgICAgcjExLCByOSwgcjMsIHIxMSAgICAgICAgICAgICAgICAgICBAeFsxMV0gKiBoWzEwXQotCi0JIFNNTEFCVCAgICByMTAsIHI5LCByMywgcjEwICAgICAgICAgICAgICAgICAgIEB4WzExXSAqIGhbMTFdCi0JIFNNTEFCVCAgICByMTEsIHI0LCByMywgcjExICAgICAgICAgICAgICAgICAgIEB4WzEyXSAqIGhbMTFdCi0KLQkgTERSICAgICAgIHIzLCBbcjJdLCAjNCAgICAgICAgICAgICAgICAgICAgICAgQGhbMTJdLCBoWzEzXQotCSBMRFJTSCAgICAgcjYsIFtyMV0sICMyICAgICAgICAgICAgICAgICAgICAgICBAeFsxM10KLQkgTERSU0ggICAgIHI5LCBbcjFdLCAjMiAgICAgICAgICAgICAgICAgICAgICAgQHhbMTRdCi0KLQkgU01MQUJCICAgIHIxMCwgcjQsIHIzLCByMTAgICAgICAgICAgICAgICAgICAgQHhbMTJdICogaFsxMl0KLQkgU01MQUJCICAgIHIxMSwgcjYsIHIzLCByMTEgICAgICAgICAgICAgICAgICAgQHhbMTNdICogaFsxMl0KLQotCSBTTUxBQlQgICAgcjEwLCByNiwgcjMsIHIxMCAgICAgICAgICAgICAgICAgICBAeFsxM10gKiBoWzEzXQotCSBTTUxBQlQgICAgcjExLCByOSwgcjMsIHIxMSAgICAgICAgICAgICAgICAgICBAeFsxNF0gKiBoWzEzXQotCi0JIExEUiAgICAgICByMywgW3IyXSwgIzQgICAgICAgICAgICAgICAgICAgICAgIEBoWzE0XSwgaFsxNV0KLQkgTERSU0ggICAgIHI0LCBbcjFdLCAjMiAgICAgICAgICAgICAgICAgICAgICAgQHhbMTVdCi0JIExEUlNIICAgICByNiwgW3IxXSwgIzIgICAgICAgICAgICAgICAgICAgICAgIEB4WzE2XQotCi0JIFNNTEFCQiAgICByMTAsIHI5LCByMywgcjEwICAgICAgICAgICAgICAgICAgIEB4WzE0XSAqIGhbMTRdCi0JIFNNTEFCQiAgICByMTEsIHI0LCByMywgcjExICAgICAgICAgICAgICAgICAgIEB4WzE1XSAqIGhbMTRdCi0KLQkgU01MQUJUICAgIHIxMCwgcjQsIHIzLCByMTAgICAgICAgICAgICAgICAgICAgQHhbMTVdICogaFsxNV0KLQkgU01MQUJUICAgIHIxMSwgcjYsIHIzLCByMTEgICAgICAgICAgICAgICAgICAgQHhbMTZdICogaFsxNV0KLQotCSBMRFIgICAgICAgcjMsIFtyMl0sICM0ICAgICAgICAgICAgICAgICAgICAgICBAaFsxNl0sIGhbMTddCi0JIExEUlNIICAgICByOSwgW3IxXSwgIzIgICAgICAgICAgICAgICAgICAgICAgIEB4WzE3XQotCSBMRFJTSCAgICAgcjQsIFtyMV0sICMyICAgICAgICAgICAgICAgICAgICAgICBAeFsxOF0KLQotCSBTTUxBQkIgICAgcjEwLCByNiwgcjMsIHIxMCAgICAgICAgICAgICAgICAgICBAeFsxNl0gKiBoWzE2XQotCSBTTUxBQkIgICAgcjExLCByOSwgcjMsIHIxMSAgICAgICAgICAgICAgICAgICBAeFsxN10gKiBoWzE2XQotCi0JIFNNTEFCVCAgICByMTAsIHI5LCByMywgcjEwICAgICAgICAgICAgICAgICAgIEB4WzE3XSAqIGhbMTddCi0JIFNNTEFCVCAgICByMTEsIHI0LCByMywgcjExICAgICAgICAgICAgICAgICAgIEB4WzE4XSAqIGhbMTddCi0KLQkgTERSICAgICAgIHIzLCBbcjJdLCAjNCAgICAgICAgICAgICAgICAgICAgICAgQGhbMThdLCBoWzE5XQotCSBMRFJTSCAgICAgcjYsIFtyMV0sICMyICAgICAgICAgICAgICAgICAgICAgICBAeFsxOV0KLQkgTERSU0ggICAgIHI5LCBbcjFdLCAjMiAgICAgICAgICAgICAgICAgICAgICAgQHhbMjBdCi0KLQkgU01MQUJCICAgIHIxMCwgcjQsIHIzLCByMTAgICAgICAgICAgICAgICAgICAgQHhbMThdICogaFsxOF0KLQkgU01MQUJCICAgIHIxMSwgcjYsIHIzLCByMTEgICAgICAgICAgICAgICAgICAgQHhbMTldICogaFsxOF0KLQotCSBTTUxBQlQgICAgcjEwLCByNiwgcjMsIHIxMCAgICAgICAgICAgICAgICAgICBAeFsxOV0gKiBoWzE5XQotCSBTTUxBQlQgICAgcjExLCByOSwgcjMsIHIxMSAgICAgICAgICAgICAgICAgICBAeFsyMF0gKiBoWzE5XQotCi0JIExEUiAgICAgICByMywgW3IyXSwgIzQgICAgICAgICAgICAgICAgICAgICAgIEBoWzIwXSwgaFsyMV0KLQkgTERSU0ggICAgIHI0LCBbcjFdLCAjMiAgICAgICAgICAgICAgICAgICAgICAgQHhbMjFdCi0JIExEUlNIICAgICByNiwgW3IxXSwgIzIgICAgICAgICAgICAgICAgICAgICAgIEB4WzIyXQotCi0JIFNNTEFCQiAgICByMTAsIHI5LCByMywgcjEwICAgICAgICAgICAgICAgICAgIEB4WzIwXSAqIGhbMjBdCi0JIFNNTEFCQiAgICByMTEsIHI0LCByMywgcjExICAgICAgICAgICAgICAgICAgIEB4WzIxXSAqIGhbMjBdCi0KLQkgU01MQUJUICAgIHIxMCwgcjQsIHIzLCByMTAgICAgICAgICAgICAgICAgICAgQHhbMjFdICogaFsyMV0KLQkgU01MQUJUICAgIHIxMSwgcjYsIHIzLCByMTEgICAgICAgICAgICAgICAgICAgQHhbMjJdICogaFsyMV0KLQotCSBMRFIgICAgICAgcjMsIFtyMl0sICM0ICAgICAgICAgICAgICAgICAgICAgICBAaFsyMl0sIGhbMjNdCi0JIExEUlNIICAgICByOSwgW3IxXSwgIzIgICAgICAgICAgICAgICAgICAgICAgIEB4WzIzXQotCSBMRFJTSCAgICAgcjQsIFtyMV0sICMyICAgICAgICAgICAgICAgICAgICAgICBAeFsyNF0KLQotCSBTTUxBQkIgICAgcjEwLCByNiwgcjMsIHIxMCAgICAgICAgICAgICAgICAgICBAeFsyMl0gKiBoWzIyXQotCSBTTUxBQkIgICAgcjExLCByOSwgcjMsIHIxMSAgICAgICAgICAgICAgICAgICBAeFsyM10gKiBoWzIyXQotCi0JIFNNTEFCVCAgICByMTAsIHI5LCByMywgcjEwICAgICAgICAgICAgICAgICAgIEB4WzIzXSAqIGhbMjNdCi0JIFNNTEFCVCAgICByMTEsIHI0LCByMywgcjExICAgICAgICAgICAgICAgICAgIEB4WzI0XSAqIGhbMjNdCi0KLQkgTERSICAgICAgIHIzLCBbcjJdLCAjNCAgICAgICAgICAgICAgICAgICAgICAgQGhbMjRdLCBoWzI1XQotCSBMRFJTSCAgICAgcjYsIFtyMV0sICMyICAgICAgICAgICAgICAgICAgICAgICBAeFsyNV0KLQkgTERSU0ggICAgIHI5LCBbcjFdLCAjMiAgICAgICAgICAgICAgICAgICAgICAgQHhbMjZdCi0KLQkgU01MQUJCICAgIHIxMCwgcjQsIHIzLCByMTAgICAgICAgICAgICAgICAgICAgQHhbMjRdICogaFsyNF0KLQkgU01MQUJCICAgIHIxMSwgcjYsIHIzLCByMTEgICAgICAgICAgICAgICAgICAgQHhbMjVdICogaFsyNF0KLQotCSBTTUxBQlQgICAgcjEwLCByNiwgcjMsIHIxMCAgICAgICAgICAgICAgICAgICBAeFsyNV0gKiBoWzI1XQotCSBTTUxBQlQgICAgcjExLCByOSwgcjMsIHIxMSAgICAgICAgICAgICAgICAgICBAeFsyNl0gKiBoWzI1XQotCi0JIExEUiAgICAgICByMywgW3IyXSwgIzQgICAgICAgICAgICAgICAgICAgICAgIEBoWzI2XSwgaFsyN10KLQkgTERSU0ggICAgIHI0LCBbcjFdLCAjMiAgICAgICAgICAgICAgICAgICAgICAgQHhbMjddCi0JIExEUlNIICAgICByNiwgW3IxXSwgIzIgICAgICAgICAgICAgICAgICAgICAgIEB4WzI4XQotCi0JIFNNTEFCQiAgICByMTAsIHI5LCByMywgcjEwICAgICAgICAgICAgICAgICAgIEB4WzI2XSAqIGhbMjZdCi0JIFNNTEFCQiAgICByMTEsIHI0LCByMywgcjExICAgICAgICAgICAgICAgICAgIEB4WzI3XSAqIGhbMjZdCi0KLQkgU01MQUJUICAgIHIxMCwgcjQsIHIzLCByMTAgICAgICAgICAgICAgICAgICAgQHhbMjddICogaFsyN10KLQkgU01MQUJUICAgIHIxMSwgcjYsIHIzLCByMTEgICAgICAgICAgICAgICAgICAgQHhbMjhdICogaFsyN10KLQotCSBMRFIgICAgICAgcjMsIFtyMl0sICM0ICAgICAgICAgICAgICAgICAgICAgICBAaFsyOF0sIGhbMjldCi0JIExEUlNIICAgICByOSwgW3IxXSwgIzIgICAgICAgICAgICAgICAgICAgICAgIEB4WzI5XQotCSBMRFJTSCAgICAgcjQsIFtyMV0sICMyICAgICAgICAgICAgICAgICAgICAgICBAeFszMF0KLQotCSBTTUxBQkIgICAgcjEwLCByNiwgcjMsIHIxMCAgICAgICAgICAgICAgICAgICBAeFsyOF0gKiBoWzI4XQotCSBTTUxBQkIgICAgcjExLCByOSwgcjMsIHIxMSAgICAgICAgICAgICAgICAgICBAeFsyOV0gKiBoWzI4XQotCi0JIFNNTEFCVCAgICByMTAsIHI5LCByMywgcjEwICAgICAgICAgICAgICAgICAgIEB4WzI5XSAqIGhbMjldCi0JIFNNTEFCVCAgICByMTEsIHI0LCByMywgcjExICAgICAgICAgICAgICAgICAgIEB4WzMwXSAqIGhbMjldCi0KLQkgTERSICAgICAgIHIzLCBbcjJdLCAjNCAgICAgICAgICAgICAgICAgICAgICAgQGhbMzBdLCBoWzMxXQotCSBMRFJTSCAgICAgcjYsIFtyMV0sICMyICAgICAgICAgICAgICAgICAgICAgICBAeFszMV0KLQkgTERSU0ggICAgIHI5LCBbcjFdLCAjMiAgICAgICAgICAgICAgICAgICAgICAgQHhbMzJdCi0KLQkgU01MQUJCICAgIHIxMCwgcjQsIHIzLCByMTAgICAgICAgICAgICAgICAgICAgQHhbMzBdICogaFszMF0KLQkgU01MQUJCICAgIHIxMSwgcjYsIHIzLCByMTEgICAgICAgICAgICAgICAgICAgQHhbMzFdICogaFszMF0KLQotCSBTTUxBQlQgICAgcjEwLCByNiwgcjMsIHIxMCAgICAgICAgICAgICAgICAgICBAeFszMV0gKiBoWzMxXQotCSBTTUxBQlQgICAgcjExLCByOSwgcjMsIHIxMSAgICAgICAgICAgICAgICAgICBAeFszMl0gKiBoWzMxXQotCi0JIEBTU0FUICAgICAgcjEwLCAjMzIsIHIx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MTYgeVtdLCAgICAgICAgICAgICAgICAgICAgICAgICAgIC8qIChvKSB4MiAgOiByZXNpZHVhbCBzaWduYWwgICAgICAgKi8KLUAJICAgIFdvcmQxNiBsZyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLyogKGkpICAgICA6IHNpemUgb2YgZmlsdGVyaW5nICAgICAqLwotQAkgICApCi1AYVtdIC0tLSByMAotQHhbXSAtLS0gcjEKLUB5W10gLS0tIHIyCi1AbGcgIC0tLSByMwotCi0gICAgICAgIC5zZWN0aW9uICAudGV4dAotCS5nbG9iYWwgICBSZXNpZHVfb3B0Ci0KLVJlc2lkdV9vcHQ6Ci0KLSAgICAgICAgU1RNRkQgICByMTMhLCB7cjQgLSByMTIsIHIxNH0KLQotICAgICAgICBMRFJIICAgIHI1LCBbcjBdLCAjMgotICAgICAgICBMRFJIICAgIHI2LCBbcjBdLCAjMgotICAgICAgICBPUlIgICAgIHI1LCByNiwgcjUsIExTTCAjMTYgICAgICAgICAgICAgICAgICBAcjUgLS0tIGEwLCBhMQotCi0gICAgICAgIExEUkggICAgcjYsIFtyMF0sICMyCi0JTERSSCAgICByNywgW3IwXSwgIzIKLQlPUlIgICAgIHI2LCByNywgcjYsIExTTCAjMTYgICAgICAgICAgICAgICAgICBAcjYgLS0tIGEyLCBhMwotCi0gICAgICAgIExEUkggICAgcjcsIFtyMF0sICMyCi0JTERSSCAgICByOCwgW3IwXSwgIzIKLQlPUlIgICAgIHI3LCByOCwgcjcsIExTTCAjMTYgICAgICAgICAgICAgICAgICBAcjcgLS0tIGE0LCBhNQotCi0JTERSSCAgICByOCwgW3IwXSwgIzIKLQlMRFJIICAgIHI5LCBbcjBdLCAjMgotCU9SUiAgICAgcjgsIHI5LCByOCwgTFNMICMxNiAgICAgICAgICAgICAgICAgIEByOCAtLS0gYTYsIGE3Ci0KLQlMRFJIICAgIHI5LCBbcjBdLCAjMgotCUxEUkggICAgcjEwLCBbcjBdLCAjMgotCU9SUiAgICAgcjksIHIxMCwgcjksIExTTCAjMTYgICAgICAgICAgICAgICAgIEByOSAtLS0gYTgsIGE5Ci0KLQlMRFJIICAgIHIxMCwgW3IwXSwgIzIKLQlMRFJIICAgIHIxMSwgW3IwXSwgIzIKLQlPUlIgICAgIHIxMCwgcjExLCByMTAsIExTTCAjMTYgICAgICAgICAgICAgICBAcjEwIC0tLSBhMTAsIGExMQotCi0gICAgICAgIExEUkggICAgcjExLCBbcjBdLCAjMgotCUxEUkggICAgcjEyLCBbcjBdLCAjMgotCU9SUiAgICAgcjExLCByMTIsIHIxMSwgTFNMICMxNiAgICAgICAgICAgICAgIEByMTEgLS0tIGExMiwgYTEzCi0KLQlMRFJIICAgIHIxMiwgW3IwXSwgIzIKLQlMRFJIICAgIHI0LCBbcjBdLCAjMgotCU9SUiAgICAgcjEyLCByNCwgcjEyLCBMU0wgIzE2ICAgICAgICAgICAgICAgIEByMTIgLS0tIGExNCwgYTE1Ci0KLQotCVNUTUZEICAgcjEzISwge3I4IC0gcjEyfSAgICAgICAgICAgICAgICAgICAgIEBzdG9yZSByOC1yMTIKLQlMRFJIICAgIHI0LCBbcjBdLCAjMiAgICAgICAgICAgICAgICAgICAgICAgICBAbG9hZCBhMTYKLSAgICAgICAgTU9WICAgICByMTQsIHIzLCBBU1IgIzIgICAgICAgICAgICAgICAgICAgICAgQG9uZSBsb29wIGdldCA0IG91dHB1dHMKLQlBREQgICAgIHIxLCByMSwgIzQKLQlNT1YgICAgIHIwLCByMgotCU9SUiAgICAgcjE0LCByNCwgcjE0LCBMU0wgIzE2ICAgICAgICAgICAgICAgIEByMTQgLS0tIGxvb3BudW0sIGExNgotCi1yZXNpZHVfbG9vcDoKLQotICAgICAgICBMRFIgICAgIHIxMCwgW3IxXSwgIy00ICAgICAgICAgICAgICAgICAgICAgICBAcjEwICAtLS0geFszXSwgeFsyXQotCUxEUiAgICAgcjIsICBbcjFdLCAjLTQgICAgICAgICAgICAgICAgICAgICAgIEByMiAgIC0tLSB4WzFdLCB4WzBdCi0KLQlTTVVMVEIgIHIzLCByNSwgcjIgICAgICAgICAgICAgICAgICAgICAgICAgICBAaTEoMCkgIC0tLSByMyA9IHhbMF0gKiBhMAotICAgICAgICBTTVVMVFQgIHI0LCByNSwgcjIgICAgICAgICAgICAgICAgICAgICAgICAgICBAaTIoMCkgIC0tLSByNCA9IHhbMV0gKiBhMAotCVNNVUxUQiAgcjExLCByNSwgcjEwICAgICAgICAgICAgICAgICAgICAgICAgIEBpMygwKSAgLS0tIHIxMSA9IHhbMl0gKiBhMAotCVNNVUxUVCAgcjEyLCByNSwgcjEwICAgICAgICAgICAgICAgICAgICAgICAgIEBpNCgwKSAgLS0tIHIxMiA9IHhbM10gKiBhMAotCi0gICAgICAgIFNNTEFCQiAgcjQsIHI1LCByMiwgcjQgICAgICAgICAgICAgICAgICAgICAgIEBpMigxKSAgLS0tIHI0ICs9IHhbMF0gKiBhMQotICAgICAgICBTTUxBQlQgIHIxMSwgcjUsIHIyLCByMTEgICAgICAgICAgICAgICAgICAgICBAaTMoMSkgIC0tLSByMTEgKz0geFsxXSAqIGEwCi0gICAgICAgIFNNTEFCQiAgcjEyLCByNSwgcjEwLCByMTIgICAgICAgICAgICAgICAgICAgIEBpNCgxKSAgLS0tIHIxMiArPSB4WzJdICogYTEKLQotCVNNTEFUQiAgcjExLCByNiwgcjIsIHIxMSAgICAgICAgICAgICAgICAgICAgIEBpMygyKSAgLS0tIHIxMSArPSB4WzBdICogYTIKLQlTTUxBVFQgIHIxMiwgcjYsIHIyLCByMTIgICAgICAgICAgICAgICAgICAgICBAaTQoMikgIC0tLSByMTIgKz0geFsxXSAqIGEyCi0JU01MQUJCICByMTIsIHI2LCByMiwgcjEyICAgICAgICAgICAgICAgICAgICAgQGk0KDMpICAtLS0gcjEyICs9IHhbMF0gKiBhMwotCi0JTERSICAgICByMiwgW3IxXSwgIy00ICAgICAgICAgICAgICAgICAgICAgICAgQHIyIC0tLS0geFstMV0sIHhbLTJdCi0KLQlTTUxBQlQgIHIzLCByNS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ciB0aGUgTGljZW5zZSBpcyBkaXN0cmlidXRlZCBvbiBhbiAiQVMgSVMiIEJBU0lTLAotQCAqKiBXSVRIT1VUIFdBUlJBTlRJRVMgT1IgQ09ORElUSU9OUyBPRiBBTlkgS0lORCwgZWl0aGVyIGV4cHJlc3Mgb3IgaW1wbGllZC4KLUAgKiogU2VlIHRoZSBMaWNlbnNlIGZvciB0aGUgc3BlY2lmaWMgbGFuZ3VhZ2UgZ292ZXJuaW5nIHBlcm1pc3Npb25zIGFuZAotQCAqKiBsaW1pdGF0aW9ucyB1bmRlciB0aGUgTGljZW5zZS4KLUAgKi8KLUAKLUB2b2lkIFNjYWxlX3NpZygKLUAJICAgICAgIFdvcmQxNiB4W10sICAgICAgICAgICAgICAgICAgICAgICAgICAgLyogKGkvbykgOiBzaWduYWwgdG8gc2NhbGUgICAgICAgICAgICAgICAqLwotQAkgICAgICAgV29yZDE2IGxnLCAgICAgICAgICAgICAgICAgICAgICAgICAgICAvKiAoaSkgICA6IHNpemUgb2YgeFtdICAgICAgICAgICAgICAgICAgICovCi1ACSAgICAgICBXb3JkMTYgZXhwICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8qIChpKSAgIDogZXhwb25lbnQ6IHggPSByb3VuZCh4IDw8IGV4cCkgKi8KLUAJICAgICAgICkKLUAKLUByMCAtLS0geFtdCi1AcjEgLS0tIGxnCi1AcjIgLS0tIGV4cAotCi0gICAgICAgICAgLnNlY3Rpb24gIC50ZXh0Ci0JICAuZ2xvYmFsICAgU2NhbGVfc2lnX29wdAotCi1TY2FsZV9zaWdfb3B0OgotCi0gICAgICAgICBTVE1GRCAgICAgICAgIHIxMyEsIHtyNCAtIHIxMiwgcjE0fQotCSBTVUIgICAgICAgICAgIHIzLCByMSwgIzEgICAgICAgICAgICAgICAgICBAaSA9IGxnIC0gMQotICAgICAgICAgQ01QICAgICAgICAgICByMiwgIzAgICAgICAgICAgICAgICAgICAgICAgQENvbXBhcmUgZXhwIGFuZCAwCi0JIFJTQiAgICAgICAgICAgcjcsIHIyLCAjMCAgICAgICAgICAgICAgICAgIEBleHAgPSAtZXhwCi0JIEFERCAgICAgICAgICAgcjEwLCByMiwgIzE2ICAgICAgICAgICAgICAgIEAxNiArIGV4cAotICAgICAgICAgQUREICAgICAgICAgICByNCwgcjAsIHIzLCBMU0wgIzEgICAgICAgICAgQHhbaV0gYWRkcmVzcwotCSBNT1YgICAgICAgICAgIHI4LCAjMHg3ZmZmZmZmZgotCSBNT1YgICAgICAgICAgIHI5LCAjMHg4MDAwCi0JIEJMRSAgICAgICAgICAgTE9PUDIKLQotTE9PUDE6Ci0KLSAgICAgICAgIExEUlNIICAgICAgICAgIHI1LCBbcjRdICAgICAgICAgICAgICAgICAgICBAbG9hZCB4W2ldCi0gICAgICAgICBNT1YgICAgICAgICAgIHIxMiwgcjUsIExTTCByMTAKLQkgVEVRICAgICAgICAgICByNSwgcjEyLCBBU1IgcjEwCi0JIEVPUk5FICAgICAgICAgcjEyLCByOCwgcjUsIEFTUiAjMzEKLQkgU1VCUyAgICAgICAgICByMywgcjMsICMxCi0JIFFBREQgICAgICAgICAgcjExLCByMTIsIHI5Ci0JIE1PViAgICAgICAgICAgcjEyLCByMTEsIEFTUiAjMTYKLQkgU1RSSCAgICAgICAgICByMTIsIFtyNF0sICMtMgotCSBCR0UgICAgICAgICAgIExPT1AxCi0gICAgICAgICBCTCAgICAgICAgICAgIFRoZV9lbmQKLQotTE9PUDI6Ci0KLSAgICAgICAgIExEUlNIICAgICAgICAgIHI1LCBbcjRdICAgICAgICAgICAgICAgICAgIEBsb2FkIHhbaV0KLQkgTU9WICAgICAgICAgICByNiwgcjUsIExTTCAjMTYgICAgICAgICAgICBATF90bXAgPSB4W2ldIDw8IDE2Ci0JIE1PViAgICAgICAgICAgcjUsIHI2LCBBU1IgcjcgICAgICAgICAgICAgQExfdG1wID4+PSBleHAKLQkgUUFERCAgICAgICAgICByMTEsIHI1LCByOQotCSBNT1YgICAgICAgICAgIHIxMiwgcjExLCB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JlcXVpcmVkIGJ5IGFwcGxpY2FibGUgbGF3IG9yIGFncmVlZCB0byBpbiB3cml0aW5nLCBzb2Z0d2FyZQotQCAqKiBkaXN0cmlidXRlZCB1bmRlciB0aGUgTGljZW5zZSBpcyBkaXN0cmlidXRlZCBvbiBhbiAiQVMgSVMiIEJBU0lTLAotQCAqKiBXSVRIT1VUIFdBUlJBTlRJRVMgT1IgQ09ORElUSU9OUyBPRiBBTlkgS0lORCwgZWl0aGVyIGV4cHJlc3Mgb3IgaW1wbGllZC4KLUAgKiogU2VlIHRoZSBMaWNlbnNlIGZvciB0aGUgc3BlY2lmaWMgbGFuZ3VhZ2UgZ292ZXJuaW5nIHBlcm1pc3Npb25zIGFuZAotQCAqKiBsaW1pdGF0aW9ucyB1bmRlciB0aGUgTGljZW5zZS4KLUAgKi8KLUAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotQHZvaWQgU3luX2ZpbHQoCi1AICAgICBXb3JkMTYgYVtdLCAgICAgICAgICAgICAgICAgICAgICAgICAgIC8qIChpKSBRMTIgOiBhW20rMV0gcHJlZGljdGlvbiBjb2VmZmljaWVudHMgICAgICAgICAgICovCi1AICAgICBXb3JkMTYgeFtdLCAgICAgICAgICAgICAgICAgICAgICAgICAgIC8qIChpKSAgICAgOiBpbnB1dCBzaWduYWwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi1AICAgICBXb3JkMTYgeVtdLCAgICAgICAgICAgICAgICAgICAgICAgICAgIC8qIChvKSAgICAgOiBvdXRwdXQgc2lnbmFsICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi1AICAgICBXb3JkMTYgbWVtW10sICAgICAgICAgICAgICAgICAgICAgICAgIC8qIChpL28pICAgOiBtZW1vcnkgYXNzb2NpYXRlZCB3aXRoIHRoaXMgZmlsdGVyaW5nLiAgICovCi1AKQotQCoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCi1AIGFbXSAgICAtLS0gICByMAotQCB4W10gICAgLS0tICAgcjEKLUAgeVtdICAgIC0tLSAgIHIyCi1AIG1lbVtdICAtLS0gICByMwotQCBtIC0tLSAgMTYgIGxnIC0tLSA4MCAgdXBkYXRlIC0tLSAxCi0KLSAgICAgICAgICAuc2VjdGlvbiAgLnRleHQKLQkgIC5nbG9iYWwgICBTeW5fZmlsdF9hc20KLSAgICAgICAgICAuZXh0ZXJuICAgdm9BV0JfQ29weQotCi1TeW5fZmlsdF9hc206Ci0KLSAgICAgICAgICBTVE1GRCAgIAlyMTMhLCB7cjQgLSByMTIsIHIxNH0KLSAgICAgICAgICBTVUIgICAgICAgICAgIHIxMywgcjEzLCAjNzAwICAgICAgICAgICAgICAgICAgIEAgeV9idWZbTF9GUkFNRTE2ayArIE0xNmtdCi0KLSAgICAgICAgICBNT1YgICAgICAgICAgIHI0LCByMyAgICAgICAgICAgICAgICAgICAgICAgICAgIEAgY29weSBtZW1bXSBhZGRyZXNzCi0gICAgICAgICAgTU9WICAgICAgICAgICByNSwgcjEzICAgICAgICAgICAgICAgICAgICAgICAgICBAIGNvcHkgeXkgPSB5X2J1ZiBhZGRyZXNzCi0KLSAgICAgICAgICBAIGZvcihpID0gMEAgaSA8IG1AIGkrKykKLSAgICAgICAgICBAewotICAgICAgICAgIEAgICAgKnl5KysgPSBtZW1baV1ACi0gICAgICAgICAgQH0KLQotICAgICAgICAgIExEUkggICAgICAgICAgcjYsICBbcjRdLCAjMgotICAgICAgICAgIExEUkggICAgICAgICAgcjcsICBbcjRdLCAjMgotICAgICAgICAgIExEUkggICAgICAgICAgcjgsICBbcjRdLCAjMgotICAgICAgICAgIExEUkggICAgICAgICAgcjksICBbcjRdLCAjMgotICAgICAgICAgIExEUkggICAgICAgICAgcjEwLCBbcjRdLCAjMgotICAgICAgICAgIExEUkggICAgICAgICAgcjExLCBbcjRdLCAjMgotICAgICAgICAgIExEUkggICAgICAgICAgcjEyLCBbcjRdLCAjMgotICAgICAgICAgIExEUkggICAgICAgICAgcjE0LCBbcjRdLCAjMgotCi0gICAgICAgICAgU1RSSCAgICAgICAgICByNiwgIFtyNV0sICMyCi0gICAgICAgICAgU1RSSCAgICAgICAgICByNywgIFtyNV0sICMyCi0gICAgICAgICAgU1RSSCAgICAgICAgICByOCwgIFtyNV0sICMyCi0gICAgICAgICAgU1RSSCAgICAgICAgICByOSwgIFtyNV0sICMyCi0gICAgICAgICAgU1RSSCAgICAgICAgICByMTAsIFtyNV0sICMyCi0gICAgICAgICAgU1RSSCAgICAgICAgICByMTEsIFtyNV0sICMyCi0gICAgICAgICAgU1RSSCAgICAgICAgICByMTIsIFtyNV0sICMyCi0gICAgICAgICAgU1RSSCAgICAgICAgICByMTQsIFtyNV0sICMyCi0KLSAgICAgICAgICBMRFJIICAgICAgICAgIHI2LCAgW3I0XSwgIzIKLSAgICAgICAgICBMRFJIICAgICAgICAgIHI3LCAgW3I0XSwgIzIKLSAgICAgICAgICBMRFJIICAgICAgICAgIHI4LCAgW3I0XSwgIzIKLSAgICAgICAgICBMRFJIICAgICAgICAgIHI5LCAgW3I0XSwgIzIKLSAgICAgICAgICBMRFJIICAgICAgICAgIHIxMCwgW3I0XSwgIzIKLSAgICAgICAgICBMRFJIICAgICAgICAgIHIxMSwgW3I0XSwgIzIKLSAgICAgICAgICBMRFJIICAgICAgICAgIHIxMiwgW3I0XSwgIzIKLSAgICAgICAgICBMRFJIICAgICAgICAgIHIxNCwgW3I0XSwgIzIKLQotICAgICAgICAgIFNUUkggICAgICAgICAgcjYsICBbcjVdLCAjMgotICAgICAgICAgIFNUUkggICAgICAgICAgcjcsICBbcjVdLCAjMgotICAgICAgICAgIFNUUkggICAgICAgICAgcjgsICBbcjVdLCAjMgotICAgICAgICAgIFNUUkggICAgICAgICAgcjksICBbcjVdLCAjMgotICAgICAgICAgIFNUUkggICAgICAgICAgcjEwLCBbcjVdLCAjMgotICAgICAgICAgIFNUUkggICAgICAgICAgcjExLCBbcjVdLCAjMgotICAgICAgICAgIFNUUkggICAgICAgICAgcjEyLCBbcjVdLCAjMgotICAgICAgICAgIFNUUkggICAgICAgICAgcjE0LCBbcjVdLCAjMgotCi0gICAgICAgICAgTERSU0ggICAgICAgICByNSwgW3IwXSAgICAgICAgICAgICAgICAgICAgICAgICBAIGxvYWQgYVswXQotICAgICAgICAgIE1PViAgICAgICAgICAgcjgsICMwICAgICAgICAgICAgICAgICAgICAgICAgICAgQCBpID0gMAotICAgICAgICAgIE1PViAgICAgICAgICAgcjUsIHI1LCBBU1IgIzEgICAgICAgICAgICAgICAgICAgQCBhMCA9IGFbMF0gPj4gMQotICAgICAgICAgIEBNT1YgICAgICAgICAgIHI0LCByMTMKLSAgICAgICAgICBAIGxvYWQgYWxsIGFbXQotCi0gICAgICAgICAgTERSICAgICAgICAgICByMTQsID0weGZmZmYKLSAgICAgICAgICBMRFJTSCAgICAgICAgIHI2LCBbcjAsICMyXSAgICAgICAgICAgICAgICAgICAgIEAgbG9hZCBhWzFdCi0gICAgICAgICAgTERSU0ggICAgICAgICByNywgW3IwLCAjNF0gICAgICAgICAgICAgICAgICAgICBAIGxvYWQgYVsyXQotICAgICAgICAgIExEUlNIICAgICAgICAgcjksIFtyMCwgIzZdICAgICAgICAgICAgICAgICAgICAgQCBsb2FkIGFbM10KLSAgICAgICAgICBMRFJTSCAgICAgICAgIHIxMSxbcjAsICM4XSAgICAgICAgICAgICAgICAgICAgIEAgbG9hZCBhWzRdCi0gICAgICAgICAgQU5EICAgICAgICAgICByNiwgcjYsIHIxNAotICAgICAgICAgIEFORCAgICAgICAgICAgcjksIHI5LCByMTQKLSAgICAgICAgICBPUlIgICAgICAgICAgIHIxMCwgcjYsIHI3LCBMU0wgIzE2ICAgICAgICAgICAgIEAgLWFbMl0gLS0gLWFbMV0KLSAgICAgICAgICBPUlIgICAgICAgICAgIHIxMiwgcjksIHIxMSwgTFNMICMxNiAgICAgICAgICAgIEAgLWFbNF0gLS0gLWFbM10KLSAgICAgICAgICBTVFIgICAgICAgICAgIHIxMCwgW3IxMywgIy00XQotICAgICAgICAgIFNUUiAgICAgICAgICAgcjEyLCBbcjEzLCAjLThdCi0KLSAgICAgICAgICBMRFJTSCAgICAgICAgIHI2LCBbcjAsICMxMF0gICAgICAgICAgICAgICAgICAgIEAgbG9hZCBhWzVdCi0gICAgICAgICAgTERSU0ggICAgICAgICByNywgW3IwLCAjMTJdICAgICAgICAgICAgICAgICAgICBAIGxvYWQgYVs2XQotICAgICAgICAgIExEUlNIICAgICAgICAgcjksIFtyMCwgIzE0XSAgICAgICAgICAgICAgICAgICAgQCBsb2FkIGFbN10KLSAgICAgICAgICBMRFJTSCAgICAgICAgIHIxMSxbcjAsICMxNl0gICAgICAgICAgICAgICAgICAgIEAgbG9hZCBhWzhdCi0gICAgICAgICAgQU5EICAgICAgICAgICByNiwgcjYsIHIxNAotICAgICAgICAgIEFORCAgICAgICAgICAgcjksIHI5LCByMTQKLSAgICAgICAgICBPUlIgICAgICAgICAgIHIxMCwgcjYsIHI3LCBMU0wgIzE2ICAgICAgICAgICAgIEAgLWFbNl0gLS0gLWFbNV0KLSAgICAgICAgICBPUlIgICAgICAgICAgIHIxMiwgcjksIHIxMSwgTFNMICMxNiAgICAgICAgICAgIEAgLWFbOF0gLS0gLWFbN10KLSAgICAgICAgICBTVFIgICAgICAgICAgIHIxMCwgW3IxMywgIy0xMl0KLSAgICAgICAgICBTVFIgICAgICAgICAgIHIxMiwgW3IxMywgIy0xNl0KLQotICAgICAgICAgIExEUlNIICAgICAgICAgcjYsIFtyMCwgIzE4XSAgICAgICAgICAgICAgICAgICAgQCBsb2FkIGFbOV0KLSAgICAgICAgICBMRFJTSCAgICAgICAgIHI3LCBbcjAsICMyMF0gICAgICAgICAgICAgICAgICAgIEAgbG9hZCBhWzEwXQotICAgICAgICAgIExEUlNIICAgICAgICAgcjksIFtyMCwgIzIyXSAgICAgICAgICAgICAgICAgICAgQCBsb2FkIGFbMTFdCi0gICAgICAgICAgTERSU0ggICAgICAgICByMTEsW3IwLCAjMjRdICAgICAgICAgICAgICAgICAgICBAIGxvYWQgYVsxMl0KLSAgICAgICAgICBBTkQgICAgICAgICAgIHI2LCByNiwgcjE0Ci0gICAgICAgICAgQU5EICAgICAgICAgICByOSwgcjksIHIxNAotICAgICAgICAgIE9SUiAgICAgICAgICAgcjEwLCByNiwgcjcsIExTTCAjMTYgICAgICAgICAgICAgQCAtYVsxMF0gLS0gLWFbOV0KLSAgICAgICAgICBPUlIgICAgICAgICAgIHIxMiwgcjksIHIxMSwgTFNMICMxNiAgICAgICAgICAgIEAgLWFbMTJdIC0tIC1hWzExXQotICAgICAgICAgIFNUUiAgICAgICAgICAgcjEwLCBbcjEzLCAjLTIwXQotICAgICAgICAgIFNUUiAgICAgICAgICAgcjEyLCBbcjEzLCAjLTI0XQotCi0gICAgICAgICAgTERSU0ggICAgICAgICByNiwgW3IwLCAjMjZdICAgICAgICAgICAgICAgICAgICBAIGxvYWQgYVsxM10KLSAgICAgICAgICBMRFJTSCAgICAgICAgIHI3LCBbcjAsICMyOF0gICAgICAgICAgICAgICAgICAgIEAgbG9hZCBhWzE0XQotICAgICAgICAgIExEUlNIICAgICAgICAgcjksIFtyMCwgIzMwXSAgICAgICAgICAgICAgICAgICAgQCBsb2FkIGFbMTVdCi0gICAgICAgICAgTERSU0ggICAgICAgICByMTEsW3IwLCAjMzJdICAgICAgICAgICAgICAgICAgICBAIGxvYWQgYVsxNl0KLSAgICAgICAgICBBTkQgICAgICAgICAgIHI2LCByNiwgcjE0Ci0gICAgICAgICAgQU5EICAgICAgICAgICByOSwgcjksIHIxNAotICAgICAgICAgIE9SUiAgICAgICAgICAgcjEwLCByNiwgcjcsIExTTCAjMTYgICAgICAgICAgICAgQCAtYVsxNF0gLS0gLWFbMTNdCi0gICAgICAgICAgT1JSICAgICAgICAgICByMTIsIHI5LCByMTEsIExTTCAjMTYgICAgICAgICAgICBAIC1hWzE2XSAtLSAtYVsxNV0KLSAgICAgICAgICBTVFIgICAgICAgICAgIHIxMCwgW3IxMywgIy0yOF0KLSAgICAgICAgICBTVFIgICAgICAgICAgIHIxMiwgW3IxMywgIy0zMl0KLQotICAgICAgICAgIEFERCAgICAgICAgICAgcjQsIHIxMywgIzMyCi1MT09QOgotICAgICAgICAgIExEUlNIICAgICAgICAgcjYsICBbcjFdLCAjMiAgICAgICAgICAgICAgICAgICAgQCBsb2FkIHhbaV0KLSAgICAgICAgICBBREQgICAgICAgICAgIHIxMCwgcjQsIHI4LCBMU0wgIzEgICAgICAgICAgICAgIEAgdGVtcF9wID0geXkgKyBpCi0KLSAgICAgICAgICBNVUwgICAgICAgICAgIHIwLCByNSwgcjYgICAgICAgICAgICAgICAgICAgICAgQCBMX3RtcCA9IHhbaV0gKiBhMAotICAgICAgICAgIEAgZm9yKGogPSAxQCBqIDw9IG0sIGorPTgpCi0gICAgICAgICAgTERSICAgICAgICAgICByNywgIFtyMTMsICMtNF0gICAgICAgICAgICAgICAgICBAIC1hWzJdICAtYVsxXQotICAgICAgICAgIExEUlNIICAgICAgICAgcjksICBbcjEwLCAjLTJdICAgICAgICAgICAgICAgICAgQCAqKHRlbXBfcCAtIDEpCi0gICAgICAgICAgTERSU0ggICAgICAgICByMTIsIFtyMTAsICMtNF0gICAgICAgICAgICAgICAgICBAICoodGVtcF9wIC0gMikKLQotCi0gICAgICAgICAgU01VTEJCICAgICAgICByMTQsIHI5LCByNyAgICAgICAgICAgICAgICAgICAgICBAIC1hWzFdICogKCoodGVtcF9wIC0xKSkKLQotICAgICAgICAgIExEUlNIICAgICAgICAgcjYsICBbcjEwLCAjLTZdICAgICAgICAgICAgICAgICAgQCAqKHRlbXBfcCAtIDMpCi0KLSAgICAgICAgICBTTUxBQlQgICAgICAgIHIxNCwgcjEyLCByNywgcjE0ICAgICAgICAgICAgICAgIEAgLWFbMl0gKiAoKih0ZW1wX3AgLSAyKSkKLQotICAgICAgICAgIExEUiAgICAgICAgICAgcjcsICBbcjEzLCAjLThdICAgICAgICAgICAgICAgICAgQCAtYVs0XSAtYVszXQotICAgICAgICAgIExEUlNIICAgICAgICAgcjExLCBbcjEwLCAjLThdICAgICAgICAgICAgICAgICAgQCAqKHRlbXBfcCAtIDQpCi0KLSAgICAgICAgICBTTUxBQkIgICAgICAgIHIxNCwgcjYsIHI3LCByMTQgICAgICAgICAgICAgICAgIEAgLWFbM10gKiAoKih0ZW1wX3AgLTMpKQotCi0gICAgICAgICAgTERSU0ggICAgICAgICByOSwgIFtyMTAsICMtMTBdICAgICAgICAgICAgICAgICBAICoodGVtcF9wIC0gNSkKLQotICAgICAgICAgIFNNTEFCVCAgICAgICAgcjE0LCByMTEsIHI3LCByMTQgICAgICAgICAgICAgICAgQCAtYVs0XSAqICgqKHRlbXBfcCAtNCkpCi0KLSAgICAgICAgICBMRFIgICAgICAgICAgIHI3LCAgW3IxMywgIy0xMl0gICAgICAgICAgICAgICAgIEAgLWFbNl0gIC1hWzVdCi0gICAgICAgICAgTERSU0ggICAgICAgICByMTIsIFtyMTAsICMtMTJdICAgICAgICAgICAgICAgICBAICoodGVtcF9wIC0gNikKLQotICAgICAgICAgIFNNTEFCQiAgICAgICAgcjE0LCByOSwgcjcsIHIxNCAgICAgICAgICAgICAgICAgQCAtYVs1XSAqICgqKHRlbXBfcCAtNSkpCi0KLSAgICAgICAgICBMRFJTSCAgICAgICAgIHI2LCAgW3IxMCwgIy0xNF0gICAgICAgICAgICAgICAgIEAgKih0ZW1wX3AgLSA3KQotCi0gICAgICAgICAgU01MQUJUICAgICAgICByMTQsIHIxMiwgcjcsIHIxNCAgICAgICAgICAgICAgICBAIC1hWzZdICogKCoodGVtcF9wIC0gNikpCi0KLSAgICAgICAgICBMRFIgICAgICAgICAgIHI3LCAgW3IxMywgIy0xNl0gICAgICAgICAgICAgICAgIEAgLWFbOF0gLWFbN10KLSAgICAgICAgICBMRFJTSCAgICAgICAgIHIxMSwgW3IxMCwgIy0xNl0gICAgICAgICAgICAgICAgIEAgKih0ZW1wX3AgLSA4KQotCi0gICAgICAgICAgU01MQUJCICAgICAgICByMTQsIHI2LCByNywgcjE0ICAgICAgICAgICAgICAgICBAIC1hWzddICogKCoodGVtcF9wIC03KSkKLQotICAgICAgICAgIExEUlNIICAgICAgICAgcjksICBbcjEwLCAjLTE4XSAgICAgICAgICAgICAgICAgQCAqKHRlbXBfcCAtIDkpCi0KLSAgICAgICAgICBTTUxBQlQgICAgICAgIHIxNCwgcjExLCByNywgcjE0ICAgICAgICAgICAgICAgIEAgLWFbOF0gKiAoKih0ZW1wX3AgLTgpKQotCi0gICAgICAgICAgTERSICAgICAgICAgICByNywgIFtyMTMsICMtMjBdICAgICAgICAgICAgICAgICBAIC1hWzEwXSAgLWFbOV0KLSAgICAgICAgICBMRFJTSCAgICAgICAgIHIxMiwgW3IxMCwgIy0yMF0gICAgICAgICAgICAgICAgIEAgKih0ZW1wX3AgLSAxMCkKLQotICAgICAgICAgIFNNTEFCQiAgICAgICAgcjE0LCByOSwgcjcsIHIxNCAgICAgICAgICAgICAgICAgQCAtYVs5XSAqICgqKHRlbXBfcCAtOSkpCi0KLSAgICAgICAgICBMRFJTSCAgICAgICAgIHI2LCAgW3IxMCwgIy0yMl0gICAgICAgICAgICAgICAgIEAgKih0ZW1wX3AgLSAxMSkKLQotICAgICAgICAgIFNNTEFCVCAgICAgICAgcjE0LCByMTIsIHI3LCByMTQgICAgICAgICAgICAgICAgQCAtYVsxMF0gKiAoKih0ZW1wX3AgLSAxMCkpCi0KLSAgICAgICAgICBMRFIgICAgICAgICAgIHI3LCAgW3IxMywgIy0yNF0gICAgICAgICAgICAgICAgIEAgLWFbMTJdIC1hWzExXQotICAgICAgICAgIExEUlNIICAgICAgICAgcjExLCBbcjEwLCAjLTI0XSAgICAgICAgICAgICAgICAgQCAqKHRlbXBfcCAtIDEyKQotCi0gICAgICAgICAgU01MQUJCICAgICAgICByMTQsIHI2LCByNywgcjE0ICAgICAgICAgICAgICAgICBAIC1hWzExXSAqICgqKHRlbXBfcCAtMTEpKQotCi0gICAgICAgICAgTERSU0ggICAgICAgICByOSwgIFtyMTAsICMtMjZdICAgICAgICAgICAgICAgICBAICoodGVtcF9wIC0gMTMpCi0KLSAgICAgICAgICBTTUxBQlQgICAgICAgIHIxNCwgcjExLCByNywgcjE0ICAgICAgICAgICAgICAgIEAgLWFbMTJdICogKCoodGVtcF9wIC0xMikpCi0KLSAgICAgICAgICBMRFIgICAgICAgICAgIHI3LCAgW3IxMywgIy0yOF0gICAgICAgICAgICAgICAgIEAgLWFbMTRdIC1hWzEzXQotICAgICAgICAgIExEUlNIICAgICAgICAgcjEyLCBbcjEwLCAjLTI4XSAgICAgICAgICAgICAgICAgQCAqKHRlbXBfcCAtIDE0KQotCi0gICAgICAgICAgU01MQUJCICAgICAgICByMTQsIHI5LCByNywgcjE0ICAgICAgICAgICAgICAgICBAIC1hWzEzXSAqICgqKHRlbXBfcCAtMTMpKQotCi0gICAgICAgICAgTERSU0ggICAgICAgICByNiwgIFtyMTAsICMtMzBdICAgICAgICAgICAgICAgICBAICoodGVtcF9wIC0gMTUpCi0KLSAgICAgICAgICBTTUxBQlQgICAgICAgIHIxNCwgcjEyLCByNywgcjE0ICAgICAgICAgICAgICAgIEAgLWFbMTRdICogKCoodGVtcF9wIC0gMTQpKQotCi0gICAgICAgICAgTERSICAgICAgICAgICByNywgIFtyMTMsICMtMzJdICAgICAgICAgICAgICAgICBAIC1hWzE2XSAtYVsxNV0KLSAgICAgICAgICBMRFJTSCAgICAgICAgIHIxMSwgW3IxMCwgIy0zMl0gICAgICAgICAgICAgICAgIEAgKih0ZW1wX3AgLSAxNikKLQotICAgICAgICAgIFNNTEFCQiAgICAgICAgcjE0LCByNiwgcjcsIHIxNCAgICAgICAgICAgICAgICAgQCAtYVsxNV0gKiAoKih0ZW1wX3AgLTE1KSkKLQotICAgICAgICAgIFNNTEFCVCAgICAgICAgcjE0LCByMTEsIHI3LCByMTQgICAgICAgICAgICAgICAgQCAtYVsxNl0gKiAoKih0ZW1wX3AgLTE2KSkKLQotICAgICAgICAgIFJTQiAgICAgICAgICAgcjE0LCByMTQsIHIwCi0KLSAgICAgICAgICBNT1YgICAgICAgICAgIHI3LCByMTQsIExTTCAjNCAgICAgICAgICAgICAgICAgIEAgTF90bXAgPDw9NAotICAgICAgICAgIEFERCAgICAgICAgICAgcjgsIHI4LCAjMQotICAgICAgICAgIEFERCAgICAgICAgICAgcjE0LCByNywgIzB4ODAwMAotICAgICAgICAgIE1PViAgICAgICAgICAgcjcsIHIxNCwgQVNSICMxNiAgICAgICAgICAgICAgICAgQCAoTF90bXAgKyAweDgwMDApID4+IDE2Ci0gICAgICAgICAgQ01QICAgICAgICAgICByOCwgIzgwCi0gICAgICAgICAgU1RSSCAgICAgICAgICByNywgW3IxMF0gICAgICAgICAgICAgICAgICAgICAgICBAIHl5W2ldCi0gICAgICAgICAgU1RSSCAgICAgICAgICByNywgW3IyXSwgIzIgICAgICAgICAgICAgICAgICAgICBAIHlbaV0KLSAgICAgICAgICBCTFQgICAgICAgICAgIExPT1AKLQotICAgICAgICAgIEAgdXBkYXRlIG1lbVtdCi0gICAgICAgICAgQUREICAgICAgICAgICByNSwgcjEzLCAjMTYwICAgICAgICAgICAgICAgICAgICBAIHl5WzY0XSBhZGRyZXNzCi0gICAgICAgICAgTU9WICAgICAgICAgICByMSwgcjMKLSAgICAgICAgICBNT1YgICAgICAgICAgIHIwLCByNQotICAgICAgICAgIE1PViAgICAgICAgICAgcjIsICMxNgotICAgICAgICAgIEJMICAgICAgICAgICAgdm9BV0JfQ29weQotCi1TeW5fZmlsdF9hc21fZW5kOgotCi0gICAgICAgICAgQUREICAgICAgICAgICByMTMsIHIxMywgIzcwMAotICAgICAgICAgIExETUZEICAgCXIxMyEsIHtyNCAtIHIxMiwgcjE1fQotICAgICAgICAgIEBFTkRGVU5DCi0gICAgICAgICAgLkVORAotCi0KZGlmZiAtLWdpdCBhL21lZGlhL2xpYnN0YWdlZnJpZ2h0L2NvZGVj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ICoqIFNlZSB0aGUgTGljZW5zZSBmb3IgdGhlIHNwZWNpZmljIGxhbmd1YWdlIGdvdmVybmluZyBwZXJtaXNzaW9ucyBhbmQKLUAgKiogbGltaXRhdGlvbnMgdW5kZXIgdGhlIExpY2Vuc2UuCi1AICovCi1ACi1Adm9pZCBEZWVtcGhfMzIoCi1AICAgICBXb3JkMTYgeF9oaVtdLCAgICAgICAgICAgICAgICAgICAgICAgIC8qIChpKSAgICAgOiBpbnB1dCBzaWduYWwgKGJpdDMxLi4xNikgKi8KLUAgICAgIFdvcmQxNiB4X2xvW10sICAgICAgICAgICAgICAgICAgICAgICAgLyogKGkpICAgICA6IGlucHV0IHNpZ25hbCAoYml0MTUuLjQpICAqLwotQCAgICAgV29yZDE2IHlbXSwgICAgICAgICAgICAgICAgICAgICAgICAgICAvKiAobykgICAgIDogb3V0cHV0IHNpZ25hbCAoeDE2KSAgICAgICovCi1AICAgICBXb3JkMTYgbXUsICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8qIChpKSBRMTUgOiBkZWVtcGhhc2lzIGZhY3RvciAgICAgICAgKi8KLUAgICAgIFdvcmQxNiBMLCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLyogKGkpICAgICA6IHZlY3RvciBzaXplICAgICAgICAgICAgICAqLwotQCAgICAgV29yZDE2ICogbWVtICAgICAgICAgICAgICAgICAgICAgICAgICAvKiAoaS9vKSAgIDogbWVtb3J5ICh5Wy0xXSkgICAgICAgICAgICovCi1AICAgICApCi0KLUB4X2hpICAgICBSTiAgICAgIFIwCi1AeF9sbyAgICAgUk4gICAgICBSMQotQHlbXSAgICAgIFJOICAgICAgUjIKLUAqbWVtICAgICBSTiAgICAgIFIzCi0KLSAgICAgICAgICAgLnNlY3Rpb24gIC50ZXh0Ci0gICAgICAgICAgIC5nbG9iYWwgICBEZWVtcGhfMzJfYXNtCi0KLURlZW1waF8zMl9hc206Ci0KLSAgICAgICAgICAgU1RNRkQgICAJcjEzISwge3I0IC0gcjEyLCByMTR9Ci0JICAgTU9WICAgICAgICAgIHI0LCAjMiAgICAgICAgICAgICAgICAgICBAaT0wCi0JICAgTERSU0ggICAgICAgIHI2LCBbcjBdLCAjMiAgICAgICAgICAgICBAbG9hZCB4X2hpWzBdCi0JICAgTERSU0ggICAgICAgIHI3LCBbcjFdLCAjMiAgICAgICAgICAgICBAbG9hZCB4X2xvWzBdCi0JICAgTERSICAgICAgICAgIHI1LCA9MjIyODIgICAgICAgICAgICAgICBAcjUtLS1tdQotCSAgIE1PViAgICAgICAgICByMTEsICMweDgwMDAKLQotICAgICAgICAgICBAeVswXQotCSAgIE1PViAgICAgICAgICByMTAsIHI2LCBMU0wgIzE2ICAgICAgICAgQExfdG1wID0geF9oaVswXTw8MTYKLQkgICBNT1YgICAgICAgICAgcjgsICByNSwgQVNSICMxICAgICAgICAgIEBmYWMgPSBtdSA+PiAxCi0JICAgTERSICAgICAgICAgIHI1LCAgW3IzXQotCSAgIEFERCAgICAgICAgICByMTIsIHIxMCwgcjcsIExTTCAjNCAgICAgQExfdG1wICs9IHhfbG9bMF0gPDwgNAotCSAgIE1PViAgICAgICAgICByMTAsIHIxMiwgTFNMICMzICAgICAgICAgQExfdG1wIDw8PSAzCi0JICAgTVVMICAgICAgICAgIHI5LCByNSwgcjgKLQkgICBMRFJTSCAgICAgICAgcjYsIFtyMF0sICMyICAgICAgICAgICAgIEBsb2FkIHhfaGlbMV0KLQkgICBRREFERCAgICAgICAgcjEwLCByMTAsIHI5Ci0JICAgTERSU0ggICAgICAgIHI3LCBbcjFdLCAjMiAgICAgICAgICAgICBAbG9hZCB4X2xvWzFdCi0JICAgTU9WICAgICAgICAgIHIxMiwgcjEwLCBMU0wgIzEgICAgICAgICBATF90bXAgPSBMX21hYyhMX3RtcCwgKm1lbSwgZmFjKQotCSAgIFFBREQgICAgICAgICByMTAsIHIxMiwgcjExCi0JICAgTU9WICAgICAgICAgIHIxNCwgcjEwLCBBU1IgIzE2ICAgICAgICBAeVswXSA9IHJvdW5kKExfdG1wKQotCi0KLQkgICBNT1YgICAgICAgICAgcjEwLCByNiwgTFNMICMxNgotCSAgIEFERCAgICAgICAgICByMTIsIHIxMCwgcjcsIExTTCAjNAotICAgICAgICAgICBTVFJIICAgICAgICAgcjE0LCBbcjJdLCAjMiAgICAgICAgICAgIEB1cGRhdGUgeVswXQotCSAgIE1PViAgICAgICAgICByMTAsIHIxMiwgTFNMICMzCi0JICAgTVVMICAgICAgICAgIHI5LCByMTQsIHI4Ci0JICAgUURBREQgICAgICAgIHIxMCwgcjEwLCByOQotCSAgIE1PViAgICAgICAgICByMTIsIHIxMCwgTFNMICMxCi0JICAgUUFERCAgICAgICAgIHIxMCwgcjEyLCByMTEKLQkgICBNT1YgICAgICAgICAgcjE0LCByMTAsIEFTUiAjMTYgICAgICAgIEB5WzFdID0gcm91bmQoTF90bXApCi0KLUxPT1A6Ci0gICAgICAgICAgIExEUlNIICAgICAgICByNiwgW3IwXSwgIzIgICAgICAgICAgICAgQGxvYWQgeF9oaVtdCi0JICAgTERSU0ggICAgICAgIHI3LCBbcjFdLCAjMgotCSAgIFNUUkggICAgICAgICByMTQsIFtyMl0sICMyCi0JICAgTU9WICAgICAgICAgIHIxMCwgcjYsIExTTCAjMTYKLQkgICBBREQgICAgICAgICAgcjEyLCByMTAsIHI3LCBMU0wgIzQKLQkgICBNVUwgICAgICAgICAgcjksIHIxNCwgcjgKLQkgICBNT1YgICAgICAgICAgcjEwLCByMTIsIExTTCAjMwotCSAgIFFEQUREICAgICAgICByMTAsIHIxMCwgcjkKLSAgICAgICAgICAgTERSU0ggICAgICAgIHI2LCBbcjBdLCAjMiAgICAgICAgICAgICBAbG9hZCB4X2hpW10KLQkgICBNT1YgICAgICAgICAgcjEyLCByMTAsIExTTCAjMQotCSAgIFFBREQgICAgICAgICByMTAsIHIxMiwgcjExCi0JICAgTERSU0ggICAgICAgIHI3LCBbcjFdLCAjMgotCSAgIE1PViAgICAgICAgICByMTQsIHIxMCwgQVNSICMxNgotCi0JICAgTU9WICAgICAgICAgIHIxMCwgcjYsIExTTCAjMTYKLQkgICBBREQgICAgICAgICAgcjEyLCByMTAsIHI3LCBMU0wgIzQKLQkgICBTVFJIICAgICAgICAgcjE0LCBbcjJdLCAjMgotCSAgIE1VTCAgICAgICAgICByOSwgcjE0LCByOAotCSAgIE1PViAgICAgICAgICByMTAsIHIxMiwgTFNMICMzCi0JICAgUURBREQgICAgICAgIHIxMCwgcjEwLCByOQotICAgICAgICAgICBBREQgICAgICAgICAgcjQsIHI0LCAjMgotCSAgIE1PViAgICAgICAgICByMTIsIHIxMCwgTFNMICMxCi0JICAgUUFERCAgICAgICAgIHIxMCwgcjEyLCByMTEKLSAgICAgICAgICAgQ01QICAgICAgICAgIHI0LCAjNjQKLQkgICBNT1YgICAgICAgICAgcjE0LCByMTAsIEFTUiAjMTYKLQotICAgICAgICAgICBCTFQgICAgICAgICAgTE9PUAotICAgICAgICAgICBTVFIgICAgICAgICAgcjE0LCBbcjNdCi0gICAgICAgICAgIFNUUkggICAgICAgICByMTQsIFtyMl0KLQotICAgICAgICAgICBMRE1GRCAgIAlyMTMhLCB7cjQgLSByMTIsIHIxNX0KLQotCSAgIC5FTkQKLQpkaWZmIC0tZ2l0IGEvbWVkaWEvbGlic3RhZ2VmcmlnaHQvY29kZWNzL2FtcndiZW5jL3NyYy9hc20vQVJNVjcvRG90X3BfbmVvbi5zIGIvbWVkaWEvbGlic3RhZ2VmcmlnaHQvY29kZWNzL2FtcndiZW5jL3NyYy9hc20vQVJNVjcvRG90X3BfbmVvbi5zCmRlbGV0ZWQgZmlsZSBtb2RlIDEwMDY0NAppbmRleCA4MjMwOTQ0ZC4uMDAwMDAwMAotLS0gYS9tZWRpYS9saWJzdGFnZWZyaWdodC9jb2RlY3MvYW1yd2JlbmMvc3JjL2FzbS9BUk1WNy9Eb3RfcF9uZW9uLnMKKysrIC9kZXYvbnVsbApAQCAtMSwxMjcgKzAsMCBAQAotQC8qCi1AICoqIENvcHlyaWdodCAyMD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ICAgICAgICAgLyogKGkpIDEyYml0czogeCB2ZWN0b3IgICAgICAgICAgICAgICAgICAgICAgICovCi1AICAgICAgIFdvcmQxNiB5W10sICAgICAgICAgICAgICAgICAgICAgICAgICAgLyogKGkpIDEyYml0czogeSB2ZWN0b3IgICAgICAgICAgICAgICAgICAgICAgICovCi1AICAgICAgIFdvcmQxNiBsZywgICAgICAgICAgICAgICAgICAgICAgICAgICAgLyogKGkpICAgIDogdmVjdG9yIGxlbmd0aCAgICAgICAgICAgICAgICAgICAgICovCi1AICAgICAgIFdvcmQxNiAqIGV4cCAgICAgICAgICAgICAgICAgICAgICAgICAgLyogKG8pICAgIDogZXhwb25lbnQgb2YgcmVzdWx0ICgwLi4rMzApICAgICAgICovCi1AKQotQCoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgotQCAgeFtdICAgLS0tICByMAotQCAgeVtdICAgLS0tICByMQotQCAgbGcgICAgLS0tICByMgotQCAgKmV4cCAgLS0tICByMwotCi0gICAgICAgICAgLnNlY3Rpb24gICAudGV4dAotICAgICAgICAgIC5nbG9iYWwgICAgRG90X3Byb2R1Y3QxMl9hc20KLQotRG90X3Byb2R1Y3QxMl9hc206Ci0KLSAgICAgICAgICBTVE1GRCAgIAkgICAgcjEzISwge3I0IC0gcjEyLCByMTR9Ci0JICBDTVAgICAgICAgICAgICAgICByMCwgcjEKLQkgIEJFUSAgICAgICAgICAgICAgIExPT1BfRVEKLQotICAgICAgICAgIFZMRDEuUzE2ICAgICAgICAgIHtRMCwgUTF9LCBbcjBdISAgICAgICAgICAgICAgIEBsb2FkIDE2IFdvcmQxNiB4W10KLSAgICAgICAgICBWTEQxLlMxNiAgICAgICAgICB7UTIsIFEzfSwgW3IwXSEgICAgICAgICAgICAgICBAbG9hZCAxNiBXb3JkMTYgeFtdCi0gICAgICAgICAgVkxEMS5TMTYgICAgICAgICAge1E0LCBRNX0sIFtyMF0hICAgICAgICAgICAgICAgQGxvYWQgMTYgV29yZDE2IHhbXQotICAgICAgICAgIFZMRDEuUzE2ICAgICAgICAgIHtRNiwgUTd9LCBbcjBdISAgICAgICAgICAgICAgIEBsb2FkIDE2IFdvcmQxNiB4W10KLQkgIFZMRDEuUzE2ICAgICAgICAgIHtROCwgUTl9LCBbcjFdISAgICAgICAgICAgICAgIEBsb2FkIDE2IFdvcmQxNiB5W10KLQkgIFZMRDEuUzE2ICAgICAgICAgIHtRMTAsIFExMX0sIFtyMV0hICAgICAgICAgICAgIEBsb2FkIDE2IFdvcmQxNiB5W10KLQkgIFZMRDEuUzE2ICAgICAgICAgIHtRMTIsIFExM30sIFtyMV0hICAgICAgICAgICAgIEBsb2FkIDE2IFdvcmQxNiB5W10KLQotICAgICAgICAgIFZNVUxMLlMxNiAgICAgICAgIFExNSwgRDE2LCBEMAotICAgICAgICAgIFZNTEFMLlMxNiAgICAgICAgIFExNSwgRDE3LCBEMQotICAgICAgICAgIFZNTEFMLlMxNiAgICAgICAgIFExNSwgRDE4LCBEMgotICAgICAgICAgIFZNTEFMLlMxNiAgICAgICAgIFExNSwgRDE5LCBEMwotCSAgVkxEMS5TMTYgICAgICAgICAge1EwLCBRMX0sIFtyMV0hICAgICAgICAgICAgICAgQGxvYWQgMTYgV29yZDE2IHlbXQotICAgICAgICAgIFZNTEFMLlMxNiAgICAgICAgIFExNSwgRDIwLCBENAotICAgICAgICAgIFZNTEFMLlMxNiAgICAgICAgIFExNSwgRDIxLCBENQotICAgICAgICAgIFZNTEFMLlMxNiAgICAgICAgIFExNSwgRDIyLCBENgotICAgICAgICAgIFZNTEFMLlMxNiAgICAgICAgIFExNSwgRDIzLCBENwotICAgICAgICAgIFZNTEFMLlMxNiAgICAgICAgIFExNSwgRDI0LCBEOAotICAgICAgICAgIFZNTEFMLlMxNiAgICAgICAgIFExNSwgRDI1LCBEOQotICAgICAgICAgIFZNTEFMLlMxNiAgICAgICAgIFExNSwgRDI2LCBEMTAKLSAgICAgICAgICBWTUxBTC5TMTYgICAgICAgICBRMTUsIEQyNywgRDExCi0gICAgICAgICAgVk1MQUwuUzE2ICAgICAgICAgUTE1LCBEMCwgRDEyCi0gICAgICAgICAgVk1MQUwuUzE2ICAgICAgICAgUTE1LCBEMSwgRDEzCi0gICAgICAgICAgVk1MQUwuUzE2ICAgICAgICAgUTE1LCBEMiwgRDE0Ci0gICAgICAgICAgVk1MQUwuUzE2ICAgICAgICAgUTE1LCBEMywgRDE1Ci0KLSAgICAgICAgICBDTVAgICAgICAgICAgICAgICByMiwgIzY0Ci0gICAgICAgICAgQkVRICAgICAgICAgICAgICAgTGFibGUxCi0gICAgICAgICAgVkxEMS5TMTYgICAgICAgICAge1EwLCBRMX0sIFtyMF0hICAgICAgICAgICAgICAgQGxvYWQgMTYgV29yZDE2IHhbXQotCSAgVkxEMS5TMTYgICAgICAgICAge1EyLCBRM30sIFtyMV0hCi0gICAgICAgICAgVk1MQUwuUzE2ICAgICAgICAgUTE1LCBENCwgRDAKLSAgICAgICAgICBWTUxBTC5TMTYgICAgICAgICBRMTUsIEQ1LCBEMQotICAgICAgICAgIFZNTEFMLlMxNiAgICAgICAgIFExNSwgRDYsIEQyCi0gICAgICAgICAgVk1MQUwuUzE2ICAgICAgICAgUTE1LCBENywgRDMKLQkgIEJMICAgICAgICAgICAgICAgIExhYmxlMQotCi1MT09QX0VROgotICAgICAgICAgIFZMRDEuUzE2ICAgICAgICAgIHtRMCwgUTF9LCBbcjBdIQotCSAgVkxEMS5TMTYgICAgICAgICAge1EyLCBRM30sIFtyMF0hCi0JICBWTEQxLlMxNiAgICAgICAgICB7UTQsIFE1fSwgW3IwXSEKLQkgIFZMRDEuUzE2ICAgICAgICAgIHtRNiwgUTd9LCBbcjBdIQotCSAgVk1VTEwuUzE2ICAgICAgICAgUTE1LCBEMCwgRDAKLQkgIFZNTEFMLlMxNiAgICAgICAgIFExNSwgRDEsIEQxCi0JICBWTUxBTC5TMTYgICAgICAgICBRMTUsIEQyLCBEMgot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gICAgICAgICAgICAgcjEyLCByMTIsIHIxMgotICAgICAgICAgIEFERCAgICAgICAgICAgICAgIHIxMiwgcjEyLCAjMSAgICAgICAgICAgICAgICAgICAgICAgICBAIExfc3VtID0gKExfc3VtIDw8IDEpICArIDEKLQkgIE1PViAgICAgICAgICAgICAgIHI0LCByMTIKLQkgIENNUCAgICAgICAgICAgICAgIHIxMiwgIzAKLQkgIFJTQkxUICAgICAgICAgICAgIHI0LCByMTIsICMwCi0gICAgICAgICAgQ0xaICAgICAgICAgICAgICAgcjEwLCByNAotICAgICAgICAgIFNVQiAgICAgICAgICAgICAgIHIxMCwgcjEwLCAjMSAgICAgICAgICAgICAgICAgICAgICAgICBAIHNmdCA9IG5vcm1fbChMX3N1bSkKLSAgICAgICAgICBNT1YgICAgICAgICAgICAgICByMCwgcjEyLCBMU0wgcjEwICAgICAgICAgICAgICAgICAgICAgQCBMX3N1bSA9IExfc3VtIDw8IHNmdAotICAgICAgICAgIFJTQiAgICAgICAgICAgICAgIHIxMSwgcjEwLCAjMzAgICAgICAgICAgICAgICAgICAgICAgICBAICpleHAgPSAzMCAtIHNmdAotICAgICAgICAgIFNUUkggICAgICAgICAgICAgIHIxMSwgW3IzXQotCi1Eb3RfcHJvZHVjdDEyX2VuZDoKLQotICAgICAgICAgIExETUZEICAgCSAgICByMTMhLCB7cjQgLSByMTIsIHIxNX0KLQotICAgICAgICAgIC5FTkQKLQpkaWZmIC0tZ2l0IGEvbWVkaWEvbGlic3RhZ2VmcmlnaHQvY29kZWNzL2FtcndiZW5jL3NyYy9hc20vQVJNVjcvRmlsdF82a183a19uZW9uLnMgYi9tZWRpYS9saWJzdGFnZWZyaWdodC9jb2RlY3MvYW1yd2JlbmMvc3JjL2FzbS9BUk1WNy9GaWx0XzZrXzdrX25lb24ucwpkZWxldGVkIGZpbGUgbW9kZSAxMDA2NDQKaW5kZXggMTRiYTgyOC4uMDAwMDAwMAotLS0gYS9tZWRpYS9saWJzdGFnZWZyaWdodC9jb2RlY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AgIFdvcmQxNiBzaWduYWxbXSwgICAgICAgICAgICAgICAgICAgICAgLyogaW5wdXQ6ICBzaWduYWwgICAgICAgICAgICAgICAgICAqLwotQCAgICAgV29yZDE2IGxnLCAgICAgICAgICAgICAgICAgICAgICAgICAgICAvKiBpbnB1dDogIGxlbmd0aCBvZiBpbnB1dCAgICAgICAgICovCi1AICAgICBXb3JkMTYgbWVtW10gICAgICAgICAgICAgICAgICAgICAgICAgIC8qIGluL291dDogbWVtb3J5IChzaXplPTMwKSAgICAgICAgKi8KLUApCi1AKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKLUAgcjAgICAgLS0tICBzaWduYWxbXQotQCByMSAgICAtLS0gIGxnCi1AIHIyICAgIC0tLSAgbWVtW10KLQotICAgICAgICAgIC5zZWN0aW9uICAudGV4dAotICAgICAgICAgIC5nbG9iYWwgICBGaWx0XzZrXzdrX2FzbQotICAgICAgICAgIC5leHRlcm4gICBmaXJfNmtfN2sKLQotRmlsdF82a183a19hc206Ci0KLSAgICAgICAgICBTVE1GRCAgIAkJcjEzISwge3IwIC0gcjEyLCByMTR9Ci0gICAgICAgICAgU1VCICAgIAkJcjEzLCByMTMsICMyNDAgICAgICAgICAgICAgIEAgeFtMX1NVQkZSMTZrICsgKExfRklSIC0gMSldCi0gICAgICAgICAgTU9WICAgICAJCXI4LCByMCAgICAgICAgICAgICAgICAgICAgICBAIGNvcHkgc2lnbmFsW10gYWRkcmVzcwotICAgICAgICAgIE1PViAgICAgCQlyNSwgcjIgICAgICAgICAgICAgICAgICAgICAgQCBjb3B5IG1lbVtdIGFkZHJlc3MKLQotICAgICAgICAgIE1PViAgICAgCQlyMCwgcjIKLSAgICAgICAgICBNT1YgICAgIAkJcjEsIHIxMwotCi0JICBWTEQxLlMxNiAgICAgICAgICAgICAge0QwLCBEMSwgRDIsIEQzfSwgW3IwXSEKLQkgIFZMRDEuUzE2ICAgICAgICAgICAgICB7RDQsIEQ1LCBENiwgRDd9LCBbcjBdIQotCi0JICBWU1QxLlMxNiAgICAgICAgICAgICAge0QwLCBEMSwgRDIsIEQzfSwgW3IxXSEKLQkgIFZTVDEuUzE2ICAgICAgICAgICAgICB7RDQsIEQ1LCBENn0sIFtyMV0hCi0JICBWU1QxLlMxNiAgICAgICAgICAgICAgRDdbMF0sIFtyMV0hCi0JICBWU1QxLlMxNiAgICAgICAgICAgICAgRDdbMV0sIFtyMV0hCi0KLQotCi0gICAgICAgICAgTERSICAgICAJCXIxMCwgTGFibGUxICAgICAgICAgICAgICAgICBAIGdldCBmaXJfN2sgYWRkcmVzcwotICAgICAgICAgIE1PViAgICAgICAgICAgICAgICAgICByMywgcjggICAgICAgICAgICAgICAgICAgICAgQCBjaGFuZ2UgbXlNZW1Db3B5IHRvIENvcHksIGR1ZSB0byBDb3B5IHdpbGwgY2hhbmdlIHIzIGNvbnRlbnQKLSAgICAgICAgICBBREQgICAgIAkgICAgCXI2LCByMTMsICM2MCAgICAgICAgICAgICAgICBAIGdldCB4W0xfRklSIC0gMV0gYWRkcmVzcwotICAgICAgICAgIE1PViAgICAgICAgICAgCXI3LCByMyAgICAgICAgICAgICAgICAgICAgICBAIGdldCBzaWduYWxbaV0KLSAgICAgICAgICBAZm9yIChpID0gbGcgLSAxQCBpID49IDBAIGktLSkKLSAgICAgICAgICBAewotICAgICAgICAgIEAgICAgIHhbaSArIExfRklSIC0gMV0gPSBzaWduYWxbaV0gPj4gMkAKLSAgICAgICAgICBAfQotCSAgVkxEMS5TMTYgICAgICAgICAgICAgIHtRMCwgUTF9LCBbcjddIQkJICAgIEAgc2lnbmFsWzBdICB+IHNpZ25hbFsxNV0KLQkgIFZMRDEuUzE2ICAgICAgICAgICAgICB7UTIsIFEzfSwgW3I3XSEgICAgICAgICAgICAgQCBzaWduYWxbMTZdIH4gc2lnbmFsWzMxXQotICAgICAgICAgIFZMRDEuUzE2ICAgICAgICAgICAgICB7UTQsIFE1fSwgW3I3XSEgICAgICAgICAgICAgQCBzaWduYWxbMzJdIH4gc2lnbmFsWzQ3XQotCSAgVkxEMS5TMTYgICAgICAgICAgICAgIHtRNiwgUTd9LCBbcjddISAgICAgICAgICAgICBAIHNpZ25hbFs0OF0gfiBzaWduYWxbNjNdCi0JICBWTEQxLlMxNiAgICAgICAgICAgICAge1E4LCBROX0sIFtyN10hICAgICAgICAgICAgIEAgc2lnbmFsWzY0XSB+IHNpZ25hbFs3OV0KLQkgIFZTSFIuUzE2ICAgICAgICAgICAgICBRMTAsIFEwLCAjMgotICAgICAgICAgIFZTSFIuUzE2ICAgICAgICAgICAgICBRMTEsIFExLCAjMgotICAgICAgICAgIFZTSFIuUzE2ICAgICAgICAgICAgICBRMTIsIFEyLCAjMgotCSAgVlNIUi5TMTYgICAgICAgICAgICAgIFExMywgUTMsICMyCi0JICBWU1QxLlMxNiAgICAgICAgICAgICAge1ExMCwgUTExfSwgW3I2XSEKLQkgIFZTSFIuUzE2ICAgICAgICAgICAgICBRMCwgIFE0LCAjMgotCSAgVlNIUi5TMTYgICAgICAgICAgICAgIFExLCAgUTUsICMyCi0JICBWU0hSLlMxNiAgICAgICAgICAgICAgUTEwLCBRNiwgIzIKLQkgIFZTSFIuUzE2ICAgICAgICAgICAgICBRMTEsIFE3LCAjMgotCSAgVlNIUi5TMTYgICAgICAgICAgICAgIFEyLCAgUTgsICMyCi0JICBWU0hSLlMxNiAgICAgICAgICAgICAgUTMsICBROSwgIzIKLQkgIFZTVDEuUzE2ICAgICAgICAgICAgICB7UTEyLCBRMTN9LCBbcjZdIQotCSAgVlNUMS5TMTYgICAgICAgICAgICAgIHtRMCwgUTF9LCBbcjZdIQotCSAgVlNUMS5TMTYgICAgICAgICAgICAgIHtRMTAsIFExMX0sIFtyNl0hCi0JICBWU1QxLlMxNiAgICAgICAgICAgICAge1EyLCBRM30sIFtyNl0hCi0KLQkgIE1PViAgICAgICAgICAgICAgICAgICByMTIsIHI1Ci0gICAgICAgICAgQFNUUiAgICAgCQlyNSwgW3NwLCAjLTRdICAgICAgICAgICAgICAgQCBQVVNIICByNSB0byBzdGFjawotICAgICAgICAgIEAgbm90IHVzZSByZWdpc3RlcnM6IHI0LCByMTAsIHIxMiwgcjE0LCByNQotICAgICAgICAgIE1PViAgICAgCQlyNCwgcjEzCi0gICAgICAgICAgTU9WICAgICAJCXI1LCAjMCAgICAgICAgICAgICAgICAgICAgICBAIGkgPSAwCi0KLSAgICAgICAgICBAIHI0IC0tLSB4W2ldLCByMTAgLS0tLSBmaXJfNmtfN2sKLSAgICAgICAgICBWTEQxLlMxNiAgICAgICAgICAgICAge1EwLCBRMX0sIFtyMTBdISAgICAgICAgICAgQGZpcl82a183a1swXSAgfiBmaXJfNmtfN2tbMTVdCi0JICBWTEQxLlMxNiAgICAgICAgICAgICAge1EyLCBRM30sIFtyMTBdISAgICAgICAgICAgQGZpcl82a183a1sxNl0gfiBmaXJfNmtfN2tbMzFdCi0gICAgICAgICAgVk1PVi5TMTYgICAgICAgICAgICAgIEQ3WzNdLCByNSAgICAgICAgICAgICAgICAgICAgICAgIEBzZXQgZmlyXzZrXzdLID0gMAotCi0JICBWTEQxLlMxNiAgICAgICAgICAgICAge1E0LCBRNX0sIFtyNF0hICAgICAgICAgICAgQHhbMF0gIH4geFsxNV0KLQkgIFZMRDEuUzE2ICAgICAgICAgICAgICB7UTYsIFE3fSwgW3I0XSEgICAgICAgICAgICBAeFsxNl0gfiBYWzMxXQotCSAgVkxEMS5TMTYgICAgICAgICAgICAgIHtROH0sIFtyNF0hCi0gICAgICAgICAgVk1PVi5TMTYgICAgICAgICAgICAgIFExNSwgIzAKLQotTE9PUF82SzdLOgotCi0gICAgICAgICAgVk1VTEwuUzE2ICAgICAgICAgICAgIFE5LEQ4LEQwWzBdCi0gICAgICAgICAgVk1VTEwuUzE2ICAgICAgICAgICAgIFExMCxEOSxEMVswXQotICAgICAgICAgIFZNVUxMLlMxNiAgICAgICAgICAgICBRMTEsRDksRDBbMF0KLSAgICAgICAgICBWTVVMTC5TMTYgICAgICAgICAgICAgUTEyLEQxMCxEMVswXQotICAgICAgICAgIFZFWFQuOCAgICAgICAgICAgICAgICBRNCxRNCxRNSwjMgotICAgICAgICAgIFZNTEFMLlMxNiAgICAgICAgICAgICBROSxEMTAsRDJbMF0KLSAgICAgICAgICBWTUxBTC5TMTYgICAgICAgICAgICAgUTEwLEQxMSxEM1swXQotICAgICAgICAgIFZNTEFMLlMxNiAgICAgICAgICAgICBRMTEsRDExLEQyWzBdCi0gICAgICAgICAgVk1MQUwuUzE2ICAgICAgICAgICAgIFExMixEMTIsRDNbMF0KLSAgICAgICAgICBWRVhULjggICAgICAgICAgICAgICAgUTUsUTUsUTYsIzIKLSAgICAgICAgICBWTUxBTC5TMTYgICAgICAgICAgICAgUTksRDEyLEQ0WzBdCi0gICAgICAgICAgVk1MQUwuUzE2ICAgICAgICAgICAgIFExMCxEMTMsRDVbMF0KLSAgICAgICAgICBWTUxBTC5TMTYgICAgICAgICAgICAgUTExLEQxMyxENFswXQotICAgICAgICAgIFZNTEFMLlMxNiAgICAgICAgICAgICBRMTIsRDE0LEQ1WzBdCi0gICAgICAgICAgVkVYVC44ICAgICAgICAgICAgICAgIFE2LFE2LFE3LCMyCi0gICAgICAgICAgVk1MQUwuUzE2ICAgICAgICAgICAgIFE5LEQxNCxENlswXQotICAgICAgICAgIFZNTEFMLlMxNiAgICAgICAgICAgICBRMTAsRDE1LEQ3WzBdCi0gICAgICAgICAgVk1MQUwuUzE2ICAgICAgICAgICAgIFExMSxEMTUsRDZbMF0KLQkgIFZNTEFMLlMxNiAgICAgICAgICAgICBRMTIsRDE2LEQ3WzBdCi0JICBWRVhULjggIAkJUTcsUTcsUTgsIzIKLQotCSAgVk1MQUwuUzE2IAkJUTksRDgsRDBbMV0KLQkgIFZNTEFMLlMxNiAgICAgCVExMCxEOSxEMVsxXQotCSAgVkVYVC44IAkJUTgsUTgsUTE1LCMyCi0JICBWTUxBTC5TMTYgCQlRMTEsRDksRDBbM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yLCAgICAgICAgICAgICAgICAgIC8qIChpKSAgICAgOiBzdWItZnJhbWUgbGVuZ3RoICovCi1AICAgICAgICAgICAgICAgICAgICAgICBXb3JkMTYgdF9taW4sICAgICAgICAgICAgICAgICAgICAvKiAoaSkgICAgIDogbWluaW11bSB2YWx1ZSBvZiBwaXRjaCBsYWcuICAgKi8KLUAgICAgICAgICAgICAgICAgICAgICAgIFdvcmQxNiB0X21heCwgICAgICAgICAgICAgICAgICAgIC8qIChpKSAgICAgOiBtYXhpbXVtIHZhbHVlIG9mIHBpdGNoIGxhZy4gICAqLwotQCAgICAgICAgICAgICAgICAgICAgICAgV29yZDE2IGNvcnJfbm9ybVtdKSAgICAgICAgICAgICAgLyogKG8pIFExNSA6IG5vcm1hbGl6ZWQgY29ycmVsYXRpb24gICAgKi8KLUAKLQotQCByMCAtLS0gZXhjW10KLUAgcjEgLS0tIHhuW10KLUAgcjIgLS0tIGhbXQotQCByMyAtLS0gTF9zdWJmcgotQCByNCAtLS0gdF9taW4KLUAgcjUgLS0tIHRfbWF4Ci1AIHI2IC0tLSBjb3JyX25vcm1bXQotCi0KLQkuc2VjdGlvbiAgLnRleHQKLSAgICAgICAgLmdsb2JhbCAgICBOb3JtX2NvcnJfYXNtCi0gICAgICAgIC5leHRlcm4gICAgQ29udm9sdmVfYXNtCi0gICAgICAgIC5leHRlcm4gICAgSXNxcnRfbgotQCoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgotQCBjb25zdGFudAotQCoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgotLmVxdSAgICBFWEMgICAgICAgICAgICAgICAsIDAKLS5lcXUgICAgWE4gICAgICAgICAgICAgICAgLCA0Ci0uZXF1ICAgIEggICAgICAgICAgICAgICAgICwgOAotLmVxdSAgICBMX1NVQkZSICAgICAgICAgICAsIDEyCi0uZXF1ICAgIHZvU1RBQ0sgICAgICAgICAgICwgMTcyCi0uZXF1ICAgIFRfTUlOICAgICAgICAgICAgICwgMjEyCi0uZXF1ICAgIFRfTUFYICAgICAgICAgICAgICwgMjE2Ci0uZXF1ICAgIENPUlJfTk9STSAgICAgICAgICwgMjIwCi0KLU5vcm1fY29ycl9hc206Ci0KLSAgICAgICAgU1RNRkQgICAgICAgICAgcjEzISwge3I0IC0gcjEyLCByMTR9Ci0gICAgICAgIFNVQiAgICAgICAgICAgIHIxMywgcjEzLCAjdm9TVEFDSwotCi0gICAgICAgIEFERCAgICAgICAgICAgIHI4LCByMTMsICMyMCAgICAgICAgICAgICAgICAgQGdldCB0aGUgZXhjZltMX1NVQkZSXQotICAgICAgICBMRFIgICAgICAgICAgICByNCwgW3IxMywgI1RfTUlOXSAgICAgICAgICAgIEBnZXQgdF9taW4KLSAgICAgICAgUlNCICAgICAgICAgICAgcjExLCByNCwgIzAgICAgICAgICAgICAgICAgICBAayA9IC10X21pbgotICAgICAgICBBREQgICAgICAgICAgICByNSwgcjAsIHIxMSwgTFNMICMxICAgICAgICAgIEBnZXQgdGhlICZleGNba10KLQotICAgICAgICBAdHJhbnNmZXIgQ29udm9sdmUgZnVuY3Rpb24KLSAgICAgICAgU1RNRkQgICAgICAgICAgc3AhLCB7cjAgLSByM30KLSAgICAgICAgTU9WICAgICAgICAgICAgcjAsIHI1Ci0gICAgICAgIE1PViAgICAgICAgICAgIHIxLCByMgotICAgICAgICBNT1YgICAgICAgICAgICByMiwgcjggICAgICAgICAgICAgICAgICAgICAgIEByMiAtLS0gZXhjZltdCi0gICAgICAgIEJMICAgICAgICAgICAgIENvbnZvbHZlX2FzbQotICAgICAgICBMRE1GRCAgICAgICAgICBzcCEsIHtyMCAtIHIzfQotCi0gICAgICAgIEAgcjggLS0tIGV4Y2ZbXQotCi0JTU9WICAgICAgICAgICAgcjE0LCByMSAgICAgICAgICAgICAgICAgICAgICAgQGNvcHkgeG5bXSBhZGRyZXNzCi0gICAgICAgIE1PViAgICAgICAgICAgIHI3LCAjMQotCVZMRDEuUzE2ICAgICAgIHtRMCwgUTF9LCBbcjE0XSEKLQlWTEQxLlMxNiAgICAgICB7UTIsIFEzfSwgW3IxNF0hCi0JVkxEMS5TMTYgICAgICAge1E0LCBRNX0sIFtyMTRdIQotCVZMRDEuUzE2ICAgICAgIHtRNiwgUTd9LCBbcjE0XSEKLQotICAgICAgICBWTVVMTC5TMTYgICAgICBRMTAsIEQwLCBEMAotICAgICAgICBWTUxBTC5TMTYgICAgICBRMTAsIEQxLCBEMQotICAgICAgICBWTUxBTC5TMTYgICAgICBRMTAsIEQyLCBEMgotICAgICAgICBWTUxBTC5TMTYgICAgICBRMTAsIEQzLCBEMwotICAgICAgICBWTUxBTC5TMTYgICAgICBRMTAsIEQ0LCBENAotICAgICAgICBWTUxBTC5TMTYgICAgICBRMTAsIEQ1LCBENQotICAgICAgICBWTUxBTC5TMTYgICAgICBRMTAsIEQ2LCBENgotICAgICAgICBWTUxBTC5TMTYgICAgICBRMTAsIEQ3LCBENwotICAgICAgICBWTUxBTC5TMTYgICAgICBRMTAsIEQ4LCBEOAotICAgICAgICBWTUxBTC5TMTYgICAgICBRMTAsIEQ5LCBEOQotCVZNTEFMLlMxNiAgICAgIFExMCwgRDEwLCBEMTAKLQlWTUxBTC5TMTYgICAgICBRMTAsIEQxMSwgRDExCi0JVk1MQUwuUzE2ICAgICAgUTEwLCBEMTIsIEQxMgotCVZNTEFMLlMxNiAgICAgIFExMCwgRDEzLCBEMTMKLQlWTUxBTC5TMTYgICAgICBRMTAsIEQxNCwgRDE0Ci0JVk1MQUwuUzE2ICAgICAgUTEwLCBEMTUsIEQxNQotCi0gICAgICAgIFZRQURELlMzMiAgICAgIEQyMCwgRDIwLCBEMjEKLSAgICAgICAgVk1PVi5TMzIgICAgICAgcjksICBEMjBbMF0KLSAgICAgICAgVk1PVi5TMzIgICAgICAgcjEwLCBEMjBbMV0KLSAgICAgICAgUUFERCAgICAgICAgICAgcjYsIHI5LCByMTAKLQlRQUREICAgICAgICAgICByNiwgcjYsIHI2Ci0gICAgICAgIFFBREQgICAgICAgICAgIHI5LCByNiwgcjcgICAgICAgICAgICAgICAgICAgQExfdG1wID0gKExfdG1wIDw8IDEpICsgMTsKLQlDTFogICAgICAgICAgICByNywgcjkKLQlTVUIgICAgICAgICAgICByNiwgcjcsICMxICAgICAgICAgICAgICAgICAgIEBleHAgPSBub3JtX2woTF90bXApCi0gICAgICAgIFJTQiAgICAgICAgICAgIHI3LCByNiwgIzMyICAgICAgICAgICAgICAgICAgQGV4cCA9IDMyIC0gZXhwCi0JTU9WICAgICAgICAgICAgcjYsIHI3LCBBU1IgIzEKLQlSU0IgICAgICAgICAgICByNywgcjYsICMwICAgICAgICAgICAgICAgICAgIEBzY2FsZSA9IC0oZXhwID4+IDEpCi0KLSAgICAgICAgQGxvb3AgZm9yIGV2ZXJ5IHBvc3NpYmxlIHBlcmlvZAotCUBmb3IodCA9IHRfbWluQCB0IDw9IHRfbWF4QCB0KyspCi0JQHI3IC0tLSBzY2FsZSByNCAtLS0gdF9taW4gcjggLS0tIGV4Y2ZbXQotCi1MT09QRk9SOgotCUFERCAgICAgICAgICAgIHIxNCwgcjEzLCAjMjAgICAgICAgICAgICAgICAgQGNvcHkgb2YgZXhjZltdCi0JTU9WICAgICAgICAgICAgcjEyLCByMSAgICAgICAgICAgICAgICAgICAgICBAY29weSBvZiB4bltdCi0JTU9WICAgICAgICAgICAgcjgsICMweDgwMDAKLQotICAgICAgICBWTEQxLlMxNiAgICAgICB7UTAsIFExfSwgW3IxNF0hICAgICAgICAgICAgICAgICBAIGxvYWQgMTYgZXhjZltdCi0gICAgICAgIFZMRDEuUzE2ICAgICAgIHtRMiwgUTN9LCBbcjE0XSEgICAgICAgICAgICAgICAgIEAgbG9hZCAxNiBleGNmW10KLSAgICAgICAgVkxEMS5TMTYgICAgICAge1E0LCBRNX0sIFtyMTJdISAgICAgICAgICAgICAgICAgQCBsb2FkIDE2IHhbXQotCVZMRDEuUzE2ICAgICAgIHtRNiwgUTd9LCBbcjEyXSEgICAgICAgICAgICAgICAgIEAgbG9hZCAxNiB4W10KLSAgICAgICAgVk1VTEwuUzE2ICAgIFExMCwgRDAsIEQwICAgICAgICAgICAgICAgICAgICAgIEBMX3RtcDEgKz0gZXhjZltdICogZXhjZltdCi0gICAgICAgIFZNVUxMLlMxNiAgICBRMTEsIEQwLCBEOCAgICAgICAgICAgICAgICAgICAgICBATF90bXAgICs9IHhbXSAqIGV4Y2ZbXQotICAgICAgICBWTUxBTC5TMTYgICAgUTEwLCBEMSwgRDEKLSAgICAgICAgVk1MQUwuUzE2ICAgIFExMSwgRDEsIEQ5Ci0gICAgICAgIFZNTEFMLlMxNiAgICBRMTAsIEQyLCBEMgotICAgICAgICBWTUxBTC5TMTYgICAgUTExLCBEMiwgRDEwCi0gICAgICAgIFZNTEFMLlMxNiAgICBRMTAsIEQzLCBEMwotICAgICAgICBWTUxBTC5TMTYgICAgUTExLCBEMywgRDExCi0gICAgICAgIFZNTEFMLlMxNiAgICBRMTAsIEQ0LCBENAotICAgICAgICBWTUxBTC5TMTYgICAgUTExLCBENCwgRDEyCi0gICAgICAgIFZNTEFMLlMxNiAgICBRMTAsIEQ1LCBENQotICAgICAgICBWTUxBTC5TMTYgICAgUTExLCBENSwgRDEzCi0gICAgICAgIFZNTEFMLlMxNiAgICBRMTAsIEQ2LCBENgotICAgICAgICBWTUxBTC5TMTYgICAgUTExLCBENiwgRDE0Ci0gICAgICAgIFZNTEFMLlMxNiAgICBRMTAsIEQ3LCBENwotICAgICAgICBWTUxBTC5TMTYgICAgUTExLCBENywgRDE1Ci0KLQlWTEQxLlMxNiAgICAgICB7UTAsIFExfSwgW3IxNF0hICAgICAgICAgICAgICAgICBAIGxvYWQgMTYgZXhjZltdCi0gICAgICAgIFZMRDEuUzE2ICAgICAgIHtRMiwgUTN9LCBbcjE0XSEgICAgICAgICAgICAgICAgIEAgbG9hZCAxNiBleGNmW10KLSAgICAgICAgVkxEMS5TMTYgICAgICAge1E0LCBRNX0sIFtyMTJdISAgICAgICAgICAgICAgICAgQCBsb2FkIDE2IHhbXQotICAgICAgICBWTEQxLlMxNiAgICAgICB7UTYsIFE3fSwgW3IxMl0hICAgICAgICAgICAgICAgICBAIGxvYWQgMTYgeFtdCi0gICAgICAgIFZNTEFMLlMxNiAgICBRMTAsIEQwLCBEMAotICAgICAgICBWTUxBTC5TMTYgICAgUTExLCBEMCwgRDgKLSAgICAgICAgVk1MQUwuUzE2ICAgIFExMCwgRDEsIEQxCi0gICAgICAgIFZNTEFMLlMxNiAgICBRMTEsIEQxLCBEOQotICAgICAgICBWTUxBTC5TMTYgICAgUTEwLCBEMiwgRDIKLSAgICAgICAgVk1MQUwuUzE2ICAgIFExMSwgRDIsIEQxMAotICAgICAgICBWTUxBTC5TMTYgICAgUTEwLCBEMywgRDMKLSAgICAgICAgVk1MQUwuUzE2ICAgIFExMSwgRDMsIEQxMQotICAgICAgICBWTUxBTC5TMTYgICAgUTEwLCBENCwgRDQKLSAgICAgICAgVk1MQUwuUzE2ICAgIFExMSwgRDQsIEQxMgotICAgICAgICBWTUxBTC5TMTYgICAgUTEwLCBENSwgRDUKLSAgICAgICAgVk1MQUwuUzE2ICAgIFExMSwgRDUsIEQxMwotICAgICAgICBWTUxBTC5TMTYgICAgUTEwLCBENiwgRDYKLSAgICAgICAgVk1MQUwuUzE2ICAgIFExMSwgRDYsIEQxNAotICAgICAgICBWTUxBTC5TMTYgICAgUTEwLCBENywgRDcKLSAgICAgICAgVk1MQUwuUzE2ICAgIFExMSwgRDcsIEQxNQotCi0gICAgICAgIFZRQURELlMzMiAgICAgIEQyMCwgRDIwLCBEMjEKLSAgICAgICAgVlFBREQuUzMyICAgICAgRDIyLCBEMjIsIEQyMwotCi0JVlBBREQuUzMyICAgICAgRDIwLCBEMjAsIEQyMCAgICAgICAgICAgICAgICAgICBARDIwWzBdIC0tLSBMX3RtcDEgPDwgMQotCVZQQURELlMzMiAgICAgIEQyMiwgRDIyLCBEMjIgICAgICAgICAgICAgICAgICAgQEQyMlswXSAtLS0gTF90bXAgPDwgMQotCi0JVk1PVi5TMzIgICAgICAgcjYsIEQyMFswXQotICAgICAgICBWTU9WLlMzMiAgICAgICByNSwgRDIyWzBdCi0KLQlAcjUgLS0tIExfdG1wLCByNiAtLS0gTF90bXAxCi0JTU9WICAgICAgICAgICAgcjEwLCAjMQotCUFERCAgICAgICAgICAgIHI1LCByMTAsIHI1LCBMU0wgIzEgICAgICAgICAgICAgICAgICAgICBATF90bXAgPSAoTF90bXAgPDwgMSkgKyAxCi0JQUREICAgICAgICAgICAgcjYsIHIxMCwgcjYsIExTTCAjMSAgICAgICAgICAgICAgICAgICAgIEBMX3RtcDEgPSAoTF90bXAxIDw8IDEpICsgMQotCi0JQ0xaICAgICAgICAgICAgcjEwLCByNQotCUNNUCAgICAgICAgICAgIHI1LCAjMAotCVJTQkxUICAgICAgICAgIHIxMSwgcjUsICMwCi0JQ0xaTFQgICAgICAgICAgcjEwLCByMTEKLQlTVUIgICAgICAgICAgICByMTAsIHIxMCwgIzEgICAgICAgICAgICAgICAgIEBleHAgPSBub3JtX2woTF90bXApCi0KLQlNT1YgICAgICAgICAgICByNSwgcjUsIExTTCByMTAgICAgICAgICAgICAgIEBMX3RtcCA9IChMX3RtcCA8PCBleHApCi0JUlNCICAgICAgICAgICAgcjEwLCByMTAsICMzMCAgICAgICAgICAgICAgICBAZXhwX2NvcnIgPSAzMCAtIGV4cAotCU1PViAgICAgICAgICAgIHIxMSwgcjUsIEFTUiAjMTYgICAgICAgICAgICAgQGNvcnIgPSBleHRyYWN0X2goTF90bXApCi0KLQlDTFogICAgICAgICAgICByNSwgcjYKLQlTVUIgICAgICAgICAgICByNSwgcjUsICMxCi0JTU9WICAgICAgICAgICAgcjYsIHI2LCBMU0wgcjUgICAgICAgICAgICAgICBATF90bXAgPSAoTF90bXAxIDw8IGV4cCkKLQlSU0IgICAgICAgICAgICByNSwgcjUsICMzMCAgICAgICAgICAgICAgICAgIEBleHBfbm9ybSA9IDMwIC0gZXhwCi0KLQlAcjEwIC0tLSBleHBfY29yciwgcjExIC0tLSBjb3JyCi0JQHI2ICAtLS0gTF90bXAsIHI1IC0tLSBleHBfbm9ybQotCi0JQElzcXJ0X24oJkxfdG1wLCAmZXhwX25vcm0pCi0KLQlNT1YgICAgICAgICAgICByMTQsIHIwCi0JTU9WICAgICAgICAgICAgcjEyLCByMQotCi0gICAgICAgIFNUTUZEICAgICAgICAgIHNwISwge3IwIC0gcjQsIHI3IC0gcjEyLCByMTR9Ci0JQUREICAgICAgICAgICAgcjEsIHNwLCAjNAotCUFERCAgICAgICAgICAgIHIwLCBzcCwgIzAKLQlTVFIgICAgICAgICAgICByNiwgW3NwXQotCVNUUkggICAgICAgICAgIHI1LCBbc3AsICM0XQotCUJMICAgICAgICAgICAgIElzcXJ0X24KLQlMRFIgICAgICAgICAgICByNiwgW3NwXQotCUxEUlNIICAgICAgICAgIHI1LCBbc3AsICM0XQotICAgICAgICBMRE1GRCAgICAgICAgICBzcCEsIHtyMCAtIHI0LCByNyAtIHIxMiwgcjE0fQotCU1PViAgICAgICAgICAgIHIwLCByMTQKLQlNT1YgICAgICAgICAgICByMSwgcjEyCi0KLQotCU1PViAgICAgICAgICAgIHI2LCByNiwgQVNSICMxNiAgICAgICAgICAgICAgQG5vcm0gPSBleHRyYWN0X2goTF90bXApCi0JTVVMICAgICAgICAgICAgcjEyLCByNiwgcjExCi0JQUREICAgICAgICAgICAgcjEyLCByMTIsIHIxMiAgICAgICAgICAgICAgICBATF90bXAgPSB2b19MX211bHQoY29yciwgbm9ybSkKLQotCUFERCAgICAgICAgICAgIHI2LCByMTAsIHI1Ci0JQUREICAgICAgICAgICAgcjYsIHI2LCByNyAgICAgICAgICAgICAgICAgICBAZXhwX2NvcnIgKyBleHBfbm9ybSArIHNjYWxlCi0KLSAgICAgICAgQ01QICAgICAgICAgICAgcjYsICMwCi0gICAgICAgIFJTQkxUICAgICAgICAgIHI2LCByNiwgIzAKLQlNT1ZMVCAgICAgICAgICByMTIsIHIxMiwgQVNSIHI2Ci0gICAgICAgIE1PVkdUICAgICAgICAgIHIxMiwgcjEyLCBMU0wgcjYgICAgICAgICAgICAgQExfdG1wID0gTF9zaGwoTF90bXAsIGV4cF9jb3JyICsgZXhwX25vcm0gKyBzY2FsZSkKLQotICAgICAgICBBREQgICAgICAgICAgICByMTIsIHIxMiwgcjgKLSAgICAgICAgTU9WICAgICAgICAgICAgcjEyLCByMTIsIEFTUiAjMTYgICAgICAgICAgICBAdm9fcm91bmQoTF90bXApCi0KLSAgICAgICAgTERSICAgICAgICAgICAgcjUsIFtyMTMsICNDT1JSX05PUk1dICAgICAgICBAIGdldCBjb3JyX25vcm0gYWRkcmVzcwotCUxEUiAgICAgICAgICAgIHI2LCBbcjEzLCAjVF9NQVhdICAgICAgICAgICAgQCBnZXQgdF9tYXgKLQlBREQgICAgICAgICAgICByMTAsIHI1LCByNCwgTFNMICMxICAgICAgICAgIEAgZ2V0IGNvcnJfbm9ybVt0XSBhZGRyZXNzCi0JU1RSSCAgICAgICAgICAgcjEyLCBbcjEwXSAgICAgICAgICAgICAgICAgICBAIGNvcnJfbm9ybVt0XSA9IHZvX3JvdW5kKExfdG1wKQotCi0JQ01QICAgICAgICAgICAgcjQsIHI2Ci0JQkVRICAgICAgICAgICAgTm9ybV9jb3JyX2FzbV9lbmQKLQotCUFERCAgICAgICAgICAgIHI0LCByNCwgIzEgICAgICAgICAgICAgICAgICAgQCB0X21pbiArKwotCVJTQiAgICAgICAgICAgIHI1LCByNCwgIzAgICAgICAgICAgICAgICAgICAgQCBrCi0KLQlNT1YgICAgICAgICAgICByNiwgIzYzICAgICAgICAgICAgICAgICAgICAgIEAgaSA9IDYzCi0JTU9WICAgICAgICAgICAgcjgsIHIwICAgICAgICAgICAgICAgICAgICAgICBAIGV4Y1tdCi0JTU9WICAgICAgICAgICAgcjksIHIyICAgICAgICAgICAgICAgICAgICAgICBAIGhbXQotCUFERCAgICAgICAgICAgIHIxMCwgcjEzLCAjMjAgICAgICAgICAgICAgICAgQCBleGNmW10KLQotCUFERCAgICAgICAgICAgIHI4LCByOCwgcjUsIExTTCAjMSAgICAgICAgICAgQCBleGNba10gYWRkcmVzcwotCUFERCAgICAgICAgICAgIHI5LCByOSwgcjYsIExTTCAjMSAgICAgICAgICAgQCBoW2ldIGFkZHJlc3MKLQlBREQgICAgICAgICAgICByMTAsIHIxMCwgcjYsIExTTCAjMSAgICAgICAgIEAgZXhjZltpXSBhZGRyZXNzCi0JTERSU0ggICAgICAgICAgcjExLCBbcjhdICAgICAgICAgICAgICAgICAgICBAIHRtcCA9IGV4Y1trXQotCi1MT09QSzoKLSAgICAgICAgTERSU0ggICAgICAgICAgcjgsIFtyOV0sICMtMiAgICAgICAgICAgICAgICBAIGxvYWQgaFtpXQotCUxEUlNIICAgICAgICAgIHIxMiwgW3IxMCwgIy0yXSAgICAgICAgICAgICAgQCBsb2FkIGV4Y2ZbaSAtIDFdCi0JTVVMICAgICAgICAgICAgcjE0LCByMTEsIHI4Ci0JTU9WICAgICAgICAgICAgcjgsIHIxNCwgQVNSICMxNQotCUFERCAgICAgICAgICAgIHIxNCwgcjgsIHIxMgotCVNUUkggICAgICAgICAgIHIxNCwgW3IxMF0sICMtMgotCVNVQlMgICAgICAgICAgIHI2LCByNiwgIzEKLQlCR1QgICAgICAgICAgICBMT09QSwotCi0JTERSU0ggICAgICAgICAgcjgsIFtyOV0gICAgICAgICAgICAgICAgICAgICBAIGxvYWQgaFswXQotCU1VTCAgICAgICAgICAgIHIxNCwgcjExLCByOAotICAgICAgICBMRFIgICAgICAgICAgICByNiwgW3IxMywgI1RfTUFYXSAgICAgICAgICAgIEAgZ2V0IHRfbWF4Ci0JTU9WICAgICAgICAgICAgcjgsIHIxNCwgQVNSICMxNQotCVNUUkggICAgICAgICAgIHI4LCBbcjEwXQotCi0JQ01QICAgICAgICAgICAgcjQsIHI2Ci0JQkxFICAgICAgICAgICAgTE9PUEZPUgotCi1Ob3JtX2NvcnJfYXNtX2VuZDoKLQotICAgICAgICBBREQgICAgICAgICAgICByMTMsIHIxMywgI3ZvU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HJpYnV0ZWQgb24gYW4gIkFTIElTIiBCQVNJUywKLUAgKiogV0lUSE9VVCBXQVJSQU5USUVTIE9SIENPTkRJVElPTlMgT0YgQU5ZIEtJTkQsIGVpdGhlciBleHByZXNzIG9yIGltcGxpZWQuCi1AICoqIFNlZSB0aGUgTGljZW5zZSBmb3IgdGhlIHNwZWNpZmljIGxhbmd1YWdlIGdvdmVybmluZyBwZXJtaXNzaW9ucyBhbmQKLUAgKiogbGltaXRhdGlvbnMgdW5kZXIgdGhlIExpY2Vuc2UuCi1AICovCi1ACi1AKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLUB2b2lkIFN5bl9maWx0XzMyKAotQCAgICAgV29yZDE2IGFbXSwgICAgICAgICAgICAgICAgICAgICAgICAgICAvKiAoaSkgUTEyIDogYVttKzFdIHByZWRpY3Rpb24gY29lZmZpY2llbnRzICovCi1AICAgICBXb3JkMTYgbSwgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8qIChpKSAgICAgOiBvcmRlciBvZiBMUCBmaWx0ZXIgICAgICAgICAgICAgKi8KLUAgICAgIFdvcmQxNiBleGNbXSwgICAgICAgICAgICAgICAgICAgICAgICAgLyogKGkpIFFuZXc6IGV4Y2l0YXRpb24gKGV4Y1tpXSA+PiBRbmV3KSAgICAqLwotQCAgICAgV29yZDE2IFFuZXcsICAgICAgICAgICAgICAgICAgICAgICAgICAvKiAoaSkgICAgIDogZXhjIHNjYWxpbmcgPSAwKG1pbikgdG8gOChtYXgpICovCi1AICAgICBXb3JkMTYgc2lnX2hpW10sICAgICAgICAgICAgICAgICAgICAgIC8qIChvKSAvMTYgOiBzeW50aGVzaXMgaGlnaCAgICAgICAgICAgICAgICAgKi8KLUAgICAgIFdvcmQxNiBzaWdfbG9bXSwgICAgICAgICAgICAgICAgICAgICAgLyogKG8pIC8xNiA6IHN5bnRoZXNpcyBsb3cgICAgICAgICAgICAgICAgICAqLwotQCAgICAgV29yZDE2IGxnICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvKiAoaSkgICAgIDogc2l6ZSBvZiBmaWx0ZXJpbmcgICAgICAgICAgICAgICovCi1AKQotQCoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCi1AIGFbXSAgICAgIC0tLSByMAotQCBtICAgICAgICAtLS0gcjEKLUAgZXhjW10gICAgLS0tIHIyCi1AIFFuZXcgICAgIC0tLSByMwotQCBzaWdfaGlbXSAtLS0gcjQKLUAgc2lnX2xvW10gLS0tIHI1Ci1AIGxnICAgICAgIC0tLSByNgotCi0gICAgICAgICAgLnNlY3Rpb24gIC50ZXh0Ci0gICAgICAgICAgLmdsb2JhbCAgIFN5bl9maWx0XzMyX2FzbQotCi1TeW5fZmlsdF8zMl9hc206Ci0KLSAgICAgICAgICBTVE1GRCAgIAlyMTMhLCB7cjQgLSByMTIsIHIxNH0KLSAgICAgICAgICBMRFIgICAgICAgICAgIHI0LCAgW3IxMywgIzQwXSAgICAgICAgICAgICAgICAgIEAgZ2V0IHNpZ19oaVtdIGFkZHJlc3MKLSAgICAgICAgICBMRFIgICAgICAgICAgIHI1LCAgW3IxMywgIzQ0XSAgICAgICAgICAgICAgICAgIEAgZ2V0IHNpZ19sb1tdIGFkZHJlc3MKLQotICAgICAgICAgIExEUlNIICAgICAgICAgcjYsICBbcjBdLCAjMiAgICAgICAgICAgICAgICAgICAgQCBsb2FkIEFxWzBdCi0gICAgICAgICAgQUREICAgICAgICAgICByNywgIHIzLCAjNCAgICAgICAgICAgICAgICAgICAgICBAIDQgKyBRX25ldwotICAgICAgICAgIE1PViAgICAgICAgICAgcjMsIHI2LCBBU1IgcjcgICAgICAgICAgICAgICAgICAgQCBhMCA9IEFxWzBdID4+ICg0ICsgUV9uZXcpCi0KLQkgIFNVQiAgICAgICAgICAgcjEwLCByNCwgIzMyICAgICAgICAgICAgICAgICAgICAgQC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jggICAgICAgIEQ5LCBEOSwgRDEwLCAjMgotCSAgVkVYVC44ICAgICAgICBEMTAsIEQxMCwgRDExLCAjMgotCi0JICBWUEFERC5TMzIgICAgIEQyOCwgRDIwLCBEMjEKLSAgICAgICAgICBNVUwgICAgICAgICAgIHIxMiwgcjYsIHIzICAgICAgICAgICAgICAgICAgICAgIEBleGNbaV0gKiBhMAotCSAgVlBBREQuUzMyICAgICBEMjksIEQyOCwgRDI4Ci0JICBWRFVQLlMzMiAgICAgIFExMCwgRDI5WzBdICAgICAgICAgICAgICAgICAgICAgIEByZXN1bHQxCi0KLQkgIFZNVUxMLlMxNiAgICAgUTExLCBENCwgRDMKLQkgIFZNTEFMLlMxNiAgICAgUTExLCBENSwgRDIKLSAgICAgICAgICBWU1VCLlMzMiAgICAgIFExMCwgUTE1LCBRMTAKLQkgIEBMX3RtcCA9IExfbXN1KExfdG1wLCBzaWdfaGlbaSAtIGpdLCBhW2pdKUAKLQotCSAgVk1MQUwuUzE2ICAgICBRMTEsIEQ2LCBEMQotCSAgVkVYVC44ICAgICAgICBENCwgRDQsIEQ1LCAjMgotCSAgVk1MQUwuUzE2ICAgICBRMTEsIEQ3LCBEMAotCi0KLQkgIFZFWFQuOCAgICAgICAgRDUsIEQ1LCBENiwgIzIKLQkgIFZFWFQuOCAgICAgICAgRDYsIEQ2LCBENywgIzIKLQotCSAgVlBBREQuUzMyICAgICBEMjgsIEQyMiwgRDIzCi0gICAgICAgICAgVlBBREQuUzMyICAgICBEMjksIEQyOCwgRDI4Ci0gICAgICAgICAgTU9WICAgICAgICAgICByMTQsIHIxMiwgTFNMICMxICAgICAgICAgICAgICAgICBAZXhjW2ldICogYTAgPDwgMQotICAgICAgICAgIFZEVVAuUzMyICAgICAgUTExLCBEMjlbMF0gICAgICAgICAgICAgICAgICAgICAgQHJlc3VsdDIKLQotCi0KLQkgIFZTSFIuUzMyICAgICAgUTEwLCBRMTAsICMxMSAgICAgICAgICAgICAgICAgICAgQHJlc3VsdDEgPj49IDExCi0JICBWU0hMLlMzMiAgICAgIFExMSwgUTExLCAjMSAgICAgICAgICAgICAgICAgICAgIEByZXN1bHQyIDw8PSAxCi0JICBWRFVQLlMzMiAgICAgIFExMiwgcjE0Ci0JICBWQURELlMzMiAgICAgIFExMiwgUTEyLCBRMTAgICAgICAgICAgICAgICAgICAgIEBMX3RtcCA9IExfdG1wIC0gKHJlc3VsdDEgPj49IDExKSAtIChyZXN1bHQyIDw8PSAxKQotCSAgVlNVQi5TMzIgICAgICBRMTIsIFExMiwgUTExCi0KLQkgIFZTSEwuUzMyICAgICAgUTEyLCBRMTIsICMzICAgICAgICAgICAgICAgICAgICAgQExfdG1wIDw8PSAzCi0KLQotCSAgVlNIUk4uUzMyICAgICBEMjAsIFExMiwgIzE2ICAgICAgICAgICAgICAgICAgICBAc2lnX2hpW2ldID0gTF90bXAgPj4gMTZACi0JICBWTU9WLlMxNiAgICAgIHIxMCwgRDIwWzBdCi0JICBWU0hSLlMzMiAgICAgIFExMiwgUTEyLCAjNCAgICAgICAgICAgICAgICAgICAgIEBMX3RtcCA+Pj0gNAotCSAgVkVYVC44ICAgICAgICBENywgRDcsIEQyMCwgIzIKLQkgIFNUUkggICAgICAgICAgcjEwLCBbcjRdLCAjMiAgICAgICAgICAgICAgICAgICAgQHN0b3JlIHNpZ19oaVtpXQotICAgICAgICAgIFZNT1YuUzMyICAgICAgcjExLCBEMjRbMF0gICAgICAgICAgICAgICAgICAgICAgQHIxMSAtLS0gTF90bXAgPj49IDQKLQkgIEFERCAgICAgICAgICAgcjgsIHI4LCAjMQotCSAgU1VCICAgICAgICAgICByMTIsIHIxMSwgcjEwLCBMU0wgIzEyCi0JICBATU9WICAgICAgICAgICByMTEsIHIxMiwgQVNSICMxNiAgICAgICAgICAgICAgICBAc2lnX2xvW2ldCi0JICBWRFVQLlMxNiAgICAgIEQyMSwgcjEyCi0JICBWRVhULjggICAgICAgIEQxMSwgRDExLCBEMjEsICMyCi0JICBTVFJIICAgICAgICAgIH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OU0UtMi4wCi1AICoqCi1AICoqIFVubGVzcyByZXF1aXJlZCBieSBhcHBsaWNhYmxlIGxhdyBvciBhZ3JlZWQgdG8gaW4gd3JpdGluZywgc29mdHdhcmUKLUAgKiogZGlzdHJpYnV0ZWQgdW5kZXIgdGhlIExpY2Vuc2UgaXMgZGlzdHJpYnV0ZWQgb24gYW4gIkFTIElTIiBCQVNJUywKLUAgKiogV0lUSE9VVCBXQVJSQU5USUVTIE9SIENPTkRJVElPTlMgT0YgQU5ZIEtJTkQsIGVpdGhlciBleHByZXNzIG9yIGltcGxpZWQuCi1AICoqIFNlZSB0aGUgTGljZW5zZSBmb3IgdGhlIHNwZWNpZmljIGxhbmd1YWdlIGdvdmVybmluZyBwZXJtaXNzaW9ucyBhbmQKLUAgKiogbGltaXRhdGlvbnMgdW5kZXIgdGhlIExpY2Vuc2UuCi1AICovCi1ACi1AKnZvaWQgQ29udm9sdmUgKAotQCogICAgV29yZDE2IHhbXSwgICAgICAgIC8qIChpKSAgICAgOiBpbnB1dCB2ZWN0b3IgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotQCogICAgV29yZDE2IGhbXSwgICAgICAgIC8qIChpKSAgICAgOiBpbXB1bHNlIHJlc3BvbnNlICAgICAgICAgICAgICAgICAgICAgICAqLwotQCogICAgV29yZDE2IHlbXSwgICAgICAgIC8qIChvKSAgICAgOiBvdXRwdXQgdmVjdG9yICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotQCogICAgV29yZDE2IEwgICAgICAgICAgIC8qIChpKSAgICAgOiB2ZWN0b3Igc2l6ZSAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotQCopCi1ACi1AIHIwIC0tLSB4W10KLUAgcjEgLS0tIGhbXQotQCByMiAtLS0geVtdCi1AIHIzIC0tLSBMCi0KLQkuc2VjdGlvbiAgLnRleHQKLSAgICAgICAgLmdsb2JhbCAgIENvbnZvbHZlX2FzbQotCi1Db252b2x2ZV9hc206Ci0KLSAgICAgICAgU1RNRkQgICAgICAgICAgcjEzISwge3I0IC0gcjEyLCByMTR9Ci0gICAgICAgIE1PViAgICAgICAgICAgIHIzLCAgIzAKLQlNT1YgICAgICAgICAgICByMTEsICMweDgwMDAKLQotTE9PUDoKLSAgICAgICAgQE1PViAgICAgICAgICAgIHI4LCAjMCAgICAgICAgICAgICAgICAgICAgICAgICAgICBAIHMgPSAwCi0gICAgICAgIEFERCAgICAgICAgICAgIHI0LCByMSwgcjMsIExTTCAjMSAgICAgICAgICAgICAgICBAIHRtcEggYWRkcmVzcwotICAgICAgICBBREQgICAgICAgICAgICByNSwgcjMsICMxICAgICAgICAgICAgICAgICAgICAgICAgQCBpID0gbiArIDEKLSAgICAgICAgTU9WICAgICAgICAgICAgcjYsIHIwCi0gICAgICAgIExEUlNIICAgICAgICAgIHI5LCAgW3I2XSwgIzIgICAgICAgICAgICAgICAgICAgICBAICp0bXBYKysKLSAgICAgICAgTERSU0ggICAgICAgICAgcjEwLCBbcjRdICAgICAgICAgICAgICAgICAgICAgICAgIEAgKnRtcEgtLQotICAgICAgICBTVUIgICAgICAgICAgICByNSwgcjUsICMxCi0gICAgICAgIFZNT1YuUzMyICAgICAgIFExMCwgIzAKLSAgICAgICAgTVVMICAgICAgICAgICAgcjgsICByOSwgcjEwCi0KLUxPT1AxOgotICAgICAgICBDTVAgICAgICAgICAgICByNSwgIzAKLSAgICAgICAgQkxFICAgICAgICAgICAgTDEKLSAgICAgICAgU1VCICAgICAgICAgICAgcjQsIHI0LCAjOAotICAgICAgICBNT1YgICAgICAgICAgICByOSwgcjQKLSAgICAgICAgVkxEMS5TMTYgICAgICAgRDAsIFtyNl0hCi0gICAgICAgIFZMRDEuUzE2ICAgICAgIEQxLCBbcjldIQotICAgICAgICBWUkVWNjQuMTYgICAgICBEMSwgRDEKLSAgICAgICAgU1VCUyAgICAgICAgICAgcjUsIHI1LCAjNAotICAgICAgICBWTUxBTC5TMTYgICAgICBRMTAsIEQwLCBEMQotICAgICAgICBCICAgICAgICAgICAgICBMT09QMQotTDE6Ci0gICAgICAgIFZBREQuUzMyICAgICAgIEQyMCwgRDIwLCBEMjEKLSAgICAgICAgVlBBREQuUzMyICAgICAgRDIwLCBEMjAsIEQyMAotICAgICAgICBWTU9WLlMzMiAgICAgICByNSwgRDIwWzBdCi0gICAgICAgIEFERCAgICAgICAgICAgIHI1LCByNSwgcjgKLSAgICAgICAgQUREICAgICAgICAgICAgcjUsIHIxMSwgcjUsIExTTCAjMQotICAgICAgICBNT1YgICAgICAgICAgICByNSwgcjUsIExTUiAjMTYgICAgICAgICAgICAgICAgICAgQGV4dHJhY3RfaChzKQotICAgICAgICBBREQgICAgICAgICAgICByMywgcjMsICMxCi0gICAgICAgIFNUUkggICAgICAgICAgIHI1LCBbcjJdLCAjMiAgICAgICAgICAgICAgICAgICAgICBAeVtuXQotCi0KLSAgICAgICAgQE1PViAgICAgICAgICAgIHI4LCAjMAotICAgICAgICBBREQgICAgICAgICAgICByNCwgcjEsIHIzLCBMU0wgIzEgICAgICAgICAgICAgICAgQHRtcEggYWRkcmVzcwotICAgICAgICBBREQgICAgICAgICAgICByNSwgcjMsICMxCi0gICAgICAgIE1PViAgICAgICAgICAgIHI2LCByMAotICAgICAgICBMRFJTSCAgICAgICAgICByOSwgIFtyNl0sICMyICAgICAgICAgICAgICAgICAgICAgQCAqdG1wWCsrCi0gICAgICAgIExEUlNIICAgICAgICAgIHIxMCwgW3I0XSwgIy0yCi0gICAgICAgIExEUlNIICAgICAgICAgIHIxMiwgW3I2XSwgIzIKLSAgICAgICAgTERSU0ggICAgICAgICAgcjE0LCBbcjRdCi0KLSAgICAgICAgTVVMICAgICAgICAgICAgcjgsIHI5LCByMTAKLSAgICAgICAgU1VCICAgICAgICAgICAgcjUsIHI1LCAjMgotICAgICAgICBNTEEgICAgICAgICAgICByOCwgcjEyLCByMTQsIHI4Ci0KLSAgICAgICAgVk1PVi5TMzIgICAgICAgUTEwLCAjMAotTE9PUDI6Ci0gICAgICAgIENNUCAgICAgICAgICAgIHI1LCAjMAotICAgICAgICBCTEUgICAgICAgICAgICBMMgotICAgICAgICBTVUIgICAgICAgICAgICByNCwgcjQsICM4Ci0gICAgICAgIE1PViAgICAgICAgICAgIHI5LCByNAotICAgICAgICBWTEQxLlMxNiAgICAgICBEMCwgW3I2XSEKLSAgICAgICAgVkxEMS5TMTYgICAgICAgRDEsIFtyOV0hCi0gICAgICAgIFNVQlMgICAgICAgICAgIHI1LCByNSwgIzQKLSAgICAgICAgVlJFVjY0LjE2ICAgICAgRDEsIEQxCi0gICAgICAgIFZNTEFMLlMxNiAgICAgIFExMCwgRDAsIEQxCi0gICAgICAgIEIgICAgICAgICAgICAgIExPT1AyCi1MMjoKLSAgICAgICAgVkFERC5TMzIgICAgICAgRDIwLCBEMjAsIEQyMQotICAgICAgICBWUEFERC5TMzIgICAgICBEMjAsIEQyMCwgRDIwCi0gICAgICAgIFZNT1YuUzMyICAgICAgIHI1LCBEMjBbMF0KLSAgICAgICAgQUREICAgICAgICAgICAgcjgsIHI4LCByNQotICAgICAgICBBREQgICAgICAgICAgICByOCwgcjExLCByOCwgTFNMICMxCi0gICAgICAgIE1PViAgICAgICAgICAgIHI4LCByOCwgTFNSICMxNiAgICAgICAgICAgICAgICAgICBAZXh0cmFjdF9oKHMpCi0gICAgICAgIEFERCAgICAgICAgICAgIHIzLCByMywgIzEKLSAgICAgICAgU1RSSCAgICAgICAgICAgcjgsIFtyMl0sICMyICAgICAgICAgICAgICAgICAgICAgIEB5W25dCi0KLQotICAgICAgICBATU9WICAgICAgICAgICAgcjgsICMwCi0gICAgICAgIEFERCAgICAgICAgICAgIHI0LCByMSwgcjMsIExTTCAjMQotICAgICAgICBBREQgICAgICAgICAgICByNSwgcjMsICMxCi0gICAgICAgIE1PViAgICAgICAgICAgIHI2LCByMAotICAgICAgICBMRFJTSCAgICAgICAgICByOSwgIFtyNl0sICMyCi0gICAgICAgIExEUlNIICAgICAgICAgIHIxMCwgW3I0XSwgIy0yCi0gICAgICAgIExEUlNIICAgICAgICAgIHIxMiwgW3I2XSwgIzIKLSAgICAgICAgTERSU0ggICAgICAgICAgcjE0LCBbcjRdLCAjLTIKLSAgICAgICAgTVVMICAgICAgICAgICAgcjgsIHI5LCByMTAKLSAgICAgICAgTERSU0ggICAgICAgICAgcjksICBbcjZdLCAjMgotICAgICAgICBMRFJTSCAgICAgICAgICByMTAsIFtyNF0KLSAgICAgICAgTUxBICAgICAgICAgICAgcjgsIHIxMiwgcjE0LCByOAotICAgICAgICBTVUIgICAgICAgICAgICByNSwgcjUsICMzCi0gICAgICAgIE1MQSAgICAgICAgICAgIHI4LCByOSwgcjEwLCByOAotCi0gICAgICAgIFZNT1YuUzMyICAgICAgIFExMCwgIzAKLUxPT1AzOgotICAgICAgICBDTVAgICAgICAgICAgICByNSwgIzAKLSAgICAgICAgQkxFICAgICAgICAgICAgTDMKLSAgICAgICAgU1VCICAgICAgICAgICAgcjQsIHI0LCAjOAotICAgICAgICBNT1YgICAgICAgICAgICByOSwgcjQKLSAgICAgICAgVkxEMS5TMTYgICAgICAgRDAsIFtyNl0hCi0gICAgICAgIFZMRDEuUzE2ICAgICAgIEQxLCBbcjldIQotICAgICAgICBWUkVWNjQuMTYgICAgICBEMSwgRDEKLSAgICAgICAgU1VCUyAgICAgICAgICAgcjUsIHI1LCAjNAotICAgICAgICBWTUxBTC5TMTYgICAgICBRMTAsIEQwLCBEMQotICAgICAgICBCICAgICAgICAgICAgICBMT09QMwotCi1MMzoKLSAgICAgICAgVkFERC5TMzIgICAgICAgRDIwLCBEMjAsIEQyMQotICAgICAgICBWUEFERC5TMzIgICAgICBEMjAsIEQyMCwgRDIwCi0gICAgICAgIFZNT1YuUzMyICAgICAgIHI1LCBEMjBbMF0KLSAgICAgICAgQUREICAgICAgICAgICAgcjgsIHI4LCByNQotICAgICAgICBBREQgICAgICAgICAgICByOCwgcjExLCByOCwgTFNMICMxCi0gICAgICAgIE1PViAgICAgICAgICAgIHI4LCByOCwgTFNSICMxNiAgICAgICAgICAgICAgICAgICBAZXh0cmFjdF9oKHMpCi0gICAgICAgIEFERCAgICAgICAgICAgIHIzLCByMywgIzEKLSAgICAgICAgU1RSSCAgICAgICAgICAgcjgsIFtyMl0sICMyICAgICAgICAgICAgICAgICAgICAgIEB5W25dCi0KLSAgICAgICAgQUREICAgICAgICAgICAgcjUsIHIzLCAjMSAgICAgICAgICAgICAgICAgICAgICAgIEAgaSA9IG4gKyAxCi0gICAgICAgIEFERCAgICAgICAgICAgIHI0LCByMSwgcjUsIExTTCAjMSAgICAgICAgICAgICAgICBAIHRtcEggYWRkcmVzcwotICAgICAgICBNT1YgICAgICAgICAgICByNiwgcjAKLSAgICAgICAgVk1PVi5TMzIgICAgICAgUTEwLCAjMAotTE9PUDQ6Ci0gICAgICAgIENNUCAgICAgICAgICAgIHI1LCAjMAotICAgICAgICBCTEUgICAgICAgICAgICBMNAotICAgICAgICBTVUIgICAgICAgICAgICByNCwgcjQsICM4Ci0gICAgICAgIE1PViAgICAgICAgICAgIHI5LCByNAotICAgICAgICBWTEQxLlMxNiAgICAgICBEMCwgW3I2XSEKLSAgICAgICAgVkxEMS5TMTYgICAgICAgRDEsIFtyOV0hCi0gICAgICAgIFZSRVY2NC4xNiAgICAgIEQxLCBEMQotICAgICAgICBTVUJTICAgICAgICAgICByNSwgcjUsICM0Ci0gICAgICAgIFZNTEFMLlMxNiAgICAgIFExMCwgRDAsIEQxCi0gICAgICAgIEIgICAgICAgICAgICAgIExPT1A0Ci1MNDoKLSAgICAgICAgVkFERC5TMzIgICAgICAgRDIwLCBEMjAsIEQyMQotICAgICAgICBWUEFERC5TMzIgICAgICBEMjAsIEQyMCwgRDIwCi0gICAgICAgIFZNT1YuUzMyICAgICAgIHI1LCAgRDIwWzBdCi0gICAgICAgIEFERCAgICAgICAgICAgIHI1LCByMTEsIHI1LCBMU0wgIzEKLSAgICAgICAgTU9WICAgICAgICAgICAgcjUsIHI1LCBMU1IgIzE2ICAgICAgICAgICAgICAgICAgIEBleHRyYWN0X2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Oi8vd3d3LmFwYWNoZS5vcmcvbGljZW5zZXMvTElDRU5TRS0yLjAKLUAgKioKLUAgKiogVW5sZXNzIHJlcXVpcmVkIGJ5IGFwcGxpY2FibGUgbGF3IG9yIGFncmVlZCB0byBpbiB3cml0aW5nLCBzb2Z0d2FyZQotQCAqKiBkaXN0cmlidXRlZCB1bmRlciB0aGUgTGljZW5zZSBpcyBkaXN0cmlidXRlZCBvbiBhbiAiQVMgSVMiIEJBU0lTLAotQCAqKiBXSVRIT1VUIFdBUlJBTlRJRVMgT1IgQ09ORElUSU9OUyBPRiBBTlkgS0lORCwgZWl0aGVyIGV4cHJlc3Mgb3IgaW1wbGllZC4KLUAgKiogU2VlIHRoZSBMaWNlbnNlIGZvciB0aGUgc3BlY2lmaWMgbGFuZ3VhZ2UgZ292ZXJuaW5nIHBlcm1pc3Npb25zIGFuZAotQCAqKiBsaW1pdGF0aW9ucyB1bmRlciB0aGUgTGljZW5zZS4KLUAgKi8KLUAKLUBzdGF0aWMgdm9pZCBjb3JfaF92ZWNfMDEyKAotQAkJV29yZDE2IGhbXSwgICAgICAgICAgICAgICAgICAgICAgICAgICAvKiAoaSkgc2NhbGVkIGltcHVsc2UgcmVzcG9uc2UgICAgICAgICAgICAgICAgICovCi1ACQlXb3JkMTYgdmVjW10sICAgICAgICAgICAgICAgICAgICAgICAgIC8qIChpKSBzY2FsZWQgdmVjdG9yICgvOCkgdG8gY29ycmVsYXRlIHdpdGggaFtdICovCi1ACQlXb3JkMTYgdHJhY2ssICAgICAgICAgICAgICAgICAgICAgICAgIC8qIChpKSB0cmFjayB0byB1c2UgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLUAJCVdvcmQxNiBzaWduW10sICAgICAgICAgICAgICAgICAgICAgICAgLyogKGkpIHNpZ24gdmVjdG9yICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotQAkJV29yZDE2IHJyaXhpeFtdW05CX1BPU10sICAgICAgICAgICAgICAvKiAoaSkgY29ycmVsYXRpb24gb2YgaFt4XSB3aXRoIGhbeF0gICAgICAqLwotQAkJV29yZDE2IGNvcl8xW10sICAgICAgICAgICAgICAgICAgICAgICAvKiAobykgcmVzdWx0IG9mIGNvcnJlbGF0aW9uIChOQl9QT1MgZWxlbWVudHMpICovCi1ACQlXb3JkMTYgY29yXzJbXSAgICAgICAgICAgICAgICAgICAgICAgIC8qIChvKSByZXN1bHQgb2YgY29ycmVsYXRpb24gKE5CX1BPUyBlbGVtZW50cykgKi8KLUApCi1AcjAgLS0tLSBoW10KLUByMSAtLS0tIHZlY1tdCi1AcjIgLS0tLSB0cmFjawotQHIzIC0tLS0gc2lnbltdCi1AcjQgLS0tLSBycml4aXhbXVtOQl9QT1NdCi1AcjUgLS0tLSBjb3JfMVtdCi1AcjYgLS0tLSBjb3JfMltdCi0KLSAgICAgICAgICAgICAgLnNlY3Rpb24gLnRleHQKLQkgICAgICAuZ2xvYmFsICBjb3JfaF92ZWNfMDEyX2FzbQotCi1jb3JfaF92ZWNfMDEyX2FzbToKLQotICAgICAgICAgICAgIFNUTUZEICAgICAgICAgcjEzISwge3I0IC0gcjEyLCByMTR9Ci0JICAgICBMRFIgICAgICAgICAgIHI0LCBbcjEzLCAjNDBdICAgICAgICAgICAgICAgICAgICBAbG9hZCBycml4aXhbXVtOQl9QT1NdCi0JICAgICBBREQgICAgICAgICAgIHI3LCByNCwgcjIsIExTTCAjNSAgICAgICAgICAgICAgICBAcjcgLS0tIHAwID0gcnJpeGl4W3RyYWNrXQotICAgICAgICAgICAgIE1PViAgICAgICAgICAgcjQsICMwICAgICAgICAgICAgICAgICAgICAgICAgICAgIEBpPTAKLQotCSAgICAgQHIwIC0tLSBoW10sIHIxIC0tLSB2ZWNbXSwgIHIyIC0tLSBwb3MKLQkgICAgIEByMyAtLS0gc2lnbltdLCByNCAtLS0gaSwgcjcgLS0tIHAwCi0KLUxPT1BpOgotICAgICAgICAgICAgIE1PViAgICAgICAgICAgcjUsICMwICAgICAgICAgICAgICAgICAgICAgICAgICAgIEBMX3N1bTEgPSAwCi0JICAgICBNT1YgICAgICAgICAgIHI2LCAjMCAgICAgICAgICAgICAgICAgICAgICAgICAgICBATF9zdW0yID0gMAotCSAgICAgQUREICAgICAgICAgICByOSwgcjEsIHIyLCBMU0wgIzEgICAgICAgICAgICAgICAgQHAyID0gJnZlY1twb3NdCi0JICAgICBNT1YgICAgICAgICAgIHIxMCwgcjAgICAgICAgICAgICAgICAgICAgICAgICAgICBAcDEgPSBoCi0JICAgICBSU0IgICAgICAgICAgIHIxMSwgcjIsICM2MiAgICAgICAgICAgICAgICAgICAgICBAaj02Mi1wb3MKLQotTE9PUGoxOgotCSAgICAgTERSU0ggICAgICAgICByMTIsIFtyMTBdLCAjMgotCSAgICAgTERSU0ggICAgICAgICByOCwgIFtyOV0sICMyCi0JICAgICBMRFJTSCAgICAgICAgIHIxNCwgW3I5XQotCSAgICAgU1VCUyAgICAgICAgICByMTEsIHIxMSwgIzEKLSAgICAgICAgICAgICBNTEEgICAgICAgICAgIHI1LCByMTIsIHI4LCByNQotICAgICAgICAgICAgIE1MQSAgICAgICAgICAgcjYsIHIxMiwgcjE0LCByNgotCSAgICAgQkdFICAgICAgICAgICBMT09QajEKLQotCSAgICAgTERSU0ggICAgICAgICByMTIsIFtyMTBdLCAjMiAgICAgICAgICAgICAgICAgICAgIEAqcDErKwotCSAgICAgTU9WICAgICAgICAgICByNiwgcjYsIExTTCAjMiAgICAgICAgICAgICAgICAgICAgIEBMX3N1bTIgPSAoTF9zdW0yIDw8IDIpCi0gICAgICAgICAgICAgTUxBICAgICAgICAgICByNSwgcjEyLCByMTQsIHI1Ci0gICAgICAgICAgICAgTU9WICAgICAgICAgICByMTQsICMweDgwMDAKLSAgICAgICAgICAgICBNT1YgICAgICAgICAgIHI1LCByNSwgTFNMICMyICAgICAgICAgICAgICAgICAgICAgQExfc3VtMSA9IChMX3N1bTEgPDwgMikKLSAgICAgICAgICAgICBBREQgICAgICAgICAgIHIxMCwgcjYsIHIxNAotICAgICAgICAgICAgIEFERCAgICAgICAgICAgcjksIHI1LCByMTQKLSAgICAgICAgICAgICBNT1YgICAgICAgICAgIHI1LCByOSwgQVNSICMxNgotICAgICAgICAgICAgIE1PViAgICAgICAgICAgcjYsIHIxMCwgQVNSICMxNgotICAgICAgICAgICAgIEFERCAgICAgICAgICAgcjksIHIzLCByMiwgTFNMICMxICAgICAgICAgICAgICAgICBAYWRkcmVzcyBvZiBzaWduW3Bvc10KLSAgICAgICAgICAgICBBREQgICAgICAgICAgIHI4LCByNywgIzMyCi0gICAgICAgICAgICAgTERSU0ggICAgICAgICByMTAsIFtyOV0sICMyICAgICAgICAgICAgICAgICAJICBAc2lnbltwb3NdCi0JICAgICBMRFJTSCAgICAgICAgIHIxMSwgW3I5XSAgICAgICAgICAgICAgICAgICAgICAgICAgQHNpZ25bcG9zICsgMV0KLQkgICAgIE1VTCAgICAgICAgICAgcjEyLCByNSwgcjEwCi0JICAgICBNVUwgICAgICAgICAgIHIxNCwgcjYsIHIxMQotCSAgICAgTU9WICAgICAgICAgICByNSwgcjEyLCBBU1IgIzE1Ci0JICAgICBNT1YgICAgICAgICAgIHI2LCByMTQsIEFTUiAjMTUKLQkgICAgIExEUiAgICAgICAgICAgcjksICBbcjEzLCAjNDRdCi0JICAgICBMRFIgICAgICAgICAgIHIxMiwgW3IxMywgIzQ4XQotICAgICAgICAgICAgIExEUlNIICAgICAgICAgcjEwLCBbcjddLCAjMiAgICAgICAgICAgICAgICAgICAgICBAKnAwKysKLQkgICAgIExEUlNIICAgICAgICAgcjExLCBbcjhdICAgICAgICAgICAgICAgICAgICAgICAgICBAKnAzKysKLSAgICAgICAgICAgICBBREQgICAgICAgICAgIHI5LCByOSwgcjQsIExTTCAjMQotCSAgICAgQUREICAgICAgICAgICByMTIsIHIxMiwgcjQsIExTTCAjMQotCSAgICAgQUREICAgICAgICAgICByNSwgcjUsIHIxMAotCSAgICAgQUREICAgICAgICAgICByNiwgcjYsIHIxMQotCSAgICAgU1RSSCAgICAgICAgICByNSwgW3I5XQotCSAgICAgU1RSSCAgICAgICAgICByNiwgW3IxMl0KLQotICAgICAgICAgICAgIEFERCAgICAgICAgICAgcjIsIHIyLCAjNAotCi0gICAgICAgICAgICAgTU9WICAgICAgICAgICByNSwgIzAgICAgICAgICAgICAgICAgICAgICAgICAgICAgQExfc3VtMSA9IDAKLQkgICAgIE1PViAgICAgICAgICAgcjYsICMwICAgICAgICAgICAgICAgICAgICAgICAgICAgIEBMX3N1bTIgPSAwCi0JICAgICBBREQgICAgICAgICAgIHI5LCByMSwgcjIsIExTTCAjMSAgICAgICAgICAgICAgICBAcDIgPSAmdmVjW3Bvc10KLQkgICAgIE1PViAgICAgICAgICAgcjEwLCByMCAgICAgICAgICAgICAgICAgICAgICAgICAgIEBwMSA9IGgKLQkgICAgIFJTQiAgICAgICAgICAgcjExLCByMiwgIzYyICAgICAgICAgICAgICAgICAgICAgIEBqPTYyLXBvcwotCSAgICAgQUREICAgICAgICAgICByNCwgcjQsICMxICAgICAgICAgICAgICAgICAgICAgICAgQGkrKwotCi1MT09QajI6Ci0JICAgICBMRFJTSCAgICAgICAgIHIxMiwgW3IxMF0sICMyCi0JICAgICBMRFJTSCAgICAgICAgIHI4LCAgW3I5XSwgIzIKLQkgICAgIExEUlNIICAgICAgICAgcjE0LCBbcjldCi0JICAgICBTVUJTICAgICAgICAgIHIxMSwgcjExLCAjMQotICAgICAgICAgICAgIE1MQSAgICAgICAgICAgcjUsIHIxMiwgcjgsIHI1Ci0gICAgICAgICAgICAgTUxBICAgICAgICAgICByNiwgcjEyLCByMTQsIHI2Ci0JICAgICBCR0UgICAgICAgICAgIExPT1BqMgotCi0JICAgICBMRFJTSCAgICAgICAgIHIxMiwgW3IxMF0sICMyICAgICAgICAgICAgICAgICAgICAgQCpwMSsrCi0JICAgICBNT1YgICAgICAgICAgIHI2LCByNiwgTFNMICMyICAgICAgICAgICAgICAgICAgICAgQExfc3VtMiA9IChMX3N1bTIgPDwgMikKLSAgICAgICAgICAgICBNTEEgICAgICAgICAgIHI1LCByMTIsIHIxNCwgcjUKLSAgICAgICAgICAgICBNT1YgICAgICAgICAgIHIxNCwgIzB4ODAwMAotICAgICAgICAgICAgIE1PViAgICAgICAgICAgcjUsIHI1LCBMU0wgIzIgICAgICAgICAgICAgICAgICAgICBATF9zdW0xID0gKExfc3VtMSA8PCAyKQotICAgICAgICAgICAgIEFERCAgICAgICAgICAgcjEwLCByNiwgcjE0Ci0gICAgICAgICAgICAgQUREICAgICAgICAgICByOSwgcjUsIHIxNAotCi0gICAgICAgICAgICAgTU9WICAgICAgICAgICByNSwgcjksIEFTUiAjMTYKLSAgICAgICAgICAgICBNT1YgICAgICAgICAgIHI2LCByMTAsIEFTUiAjMTYKLSAgICAgICAgICAgICBBREQgICAgICAgICAgIHI5LCByMywgcjIsIExTTCAjMSAgICAgICAgICAgICAgICAgQGFkZHJlc3Mgb2Ygc2lnbltwb3NdCi0gICAgICAgICAgICAgQUREICAgICAgICAgICByOCwgcjcsICMzMgotICAgICAgICAgICAgIExEUlNIICAgICAgICAgcjEwLCBbcjldLCAjMiAgICAgICAgICAgICAgICAgCSAgQHNpZ25bcG9zXQotCSAgICAgTERSU0ggICAgICAgICByMTEsIFtyOV0gICAgICAgICAgICAgICAgICAgICAgICAgIEBzaWduW3BvcyArIDFdCi0JICAgICBNVUwgICAgICAgICAgIHIxMiwgcjUsIHIxMAotCSAgICAgTVVMICAgICAgICAgICByMTQsIHI2LCByMTEKLQkgICAgIE1PViAgICAgICAgICAgcjUsIHIxMiwgQVNSICMxNQotCSAgICAgTU9WICAgICAgICAgICByNiwgcjE0LCBBU1IgIzE1Ci0JICAgICBMRFIgICAgICAgICAgIHI5LCAgW3IxMywgIzQ0XQotCSAgICAgTERSICAgICAgICAgICByMTIsIFtyMTMsICM0OF0KLSAgICAgICAgICAgICBMRFJTSCAgICAgICAgIHIxMCwgW3I3XSwgIzIgICAgICAgICAgICAgICAgICAgICAgQCpwMCsrCi0JICAgICBMRFJTSCAgICAgICAgIHIxMSwgW3I4XSAgICAgICAgICAgICAgICAgICAgICAgICAgQCpwMysrCi0gICAgICAgICAgICAgQUREICAgICAgICAgICByOSwgcjksIHI0LCBMU0wgIzEKLQkgICAgIEFERCAgICAgICAgICAgcjEyLCByMTIsIHI0LCBMU0wgIzEKLQkgICAgIEFERCAgICAgICAgICAgcjUsIHI1LCByMTAKLQkgICAgIEFERCAgICAgICAgICAgcjYsIHI2LCByMTEKLQkgICAgIFNUUkggICAgICAgICAgcjUsIFtyOV0KLQkgICAgIFNUUkggICAgICAgICAgcjYsIFtyMTJdCi0JICAgICBBREQgICAgICAgICAgIHI0LCByNCwgIzEgICAgICAgICAgICAgICAgICAgICAgICAgQGkrMQotCSAgICAgQUREICAgICAgICAgICByMiwgcjIsICM0ICAgICAgICAgICAgICAgICAgICAgICAgIEBwb3MgKz0gU1RFUAotCSAgICAgQ01QICAgICAgICAgICByNCwgIzE2Ci0KLQkgICAgIEJMVCAgICAgICAgICAgTE9PUGkKLQotdGhlX2VuZDoKLSAgICAgICAgICAgICBMRE1GRCAgICAgICAgIHIxMyEsIHtyNCAtIHIxMiwgcjE1fQotCi0JICAgICAuRU5ECi0KLQotCi0KLQpkaWZmIC0tZ2l0IGEvbWVkaWEvbGlic3RhZ2VmcmlnaHQvY29kZWNzL2FtcndiZW5jL3NyYy9hc20vQVJNVjcvcHJlZF9sdDRfMV9uZW9uLnMgYi9tZWRpYS9saWJzdGFnZWZyaWdodC9jb2RlY3MvYW1yd2JlbmMvc3JjL2FzbS9BUk1WNy9wcmVkX2x0NF8xX25lb24ucwpkZWxldGVkIGZpbGUgbW9kZSAxMDA2NDQKaW5kZXggNmI3ODJjYi4uMDAwMDAwMAotLS0gYS9tZWRpYS9saWJzdGFnZWZyaWdodC9jb2RlY3MvYW1yd2JlbmMvc3JjL2FzbS9BUk1WNy9wcmVkX2x0NF8xX25lb24ucworKysgL2Rldi9udWxsCkBAIC0xLDEwMCArMCwwIEBACi1ALyoKLUAg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UAgICAgIFdvcmQxNiBmcmFjLCAgICAgICAgICAgICAgICAgICAgICAgICAgLyogaW5wdXQgOiBmcmFjdGlvbiBvZiBsYWcgICAqLwotQCAgICAgV29yZDE2IExfc3ViZnIgICAgICAgICAgICAgICAgICAgICAgICAvKiBpbnB1dCA6IHN1YmZyYW1lIHNpemUgICAgICovCi1AKQotQCoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCi1AIHIwICAgIC0tLSAgZXhjW10KLUAgcjEgICAgLS0tICBUMAotQCByMiAgICAtLS0gIGZyYWMKLUAgcjMgICAgLS0tICBMX3N1YmZyCi0KLSAgICAgICAgICAuc2VjdGlvbiAgLnRleHQKLSAgICAgICAgICAuZ2xvYmFsICAgcHJlZF9sdDRfYXNtCi0gICAgICAgICAgLmV4dGVybiAgIGludGVyNF8yCi0KLXByZWRfbHQ0X2FzbToKLQotICAgICAgICAgIFNUTUZEICAgCXIxMyEsIHtyNCAtIHIxMiwgcjE0fQotICAgICAgICAgIFNVQiAgICAgICAgICAgcjQsIHIwLCByMSwgTFNMICMxICAgICAgICAgICAgICAgICAgICAgICAgQCB4ID0gZXhjIC0gVDAKLSAgICAgICAgICBSU0IgICAgICAgICAgIHIyLCByMiwgIzAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEAgZnJhYyA9IC0gZnJhYwotICAgICAgICAgIFNVQiAgICAgICAgICAgcjQsIHI0LCAjMzAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgQCB4IC09IExfSU5URVJQT0wyIC0gMQotICAgICAgICAgIENNUCAgICAgICAgICAgcjIsICMwCi0gICAgICAgICAgQURETFQgICAgICAgICByMiwgcjIsICM0ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBAIGZyYWMgKz0gVVBfU0FNUAotICAgICAgICAgIFNVQkxUICAgICAgICAgcjQsIHI0LCAjMiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgQCB4LS0KLQotICAgICAgICAgIExEUiAgICAgICAgICAgcjExLCBMYWJsZTEKLSAgICAgICAgICBSU0IgICAgICAgICAgIHIyLCByMiwgIzMgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEAgayA9IFVQX1NBTVAgLSAxIC0gZnJhYwotICAgICAgICAgIE1PViAgICAgICAgICAgcjgsICMwICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgQCBqID0gMAotCSAgQUREICAgICAgICAgICByMTEsIHIxMSwgcjIsIExTTCAjNiAgICAgICAgICAgICAgICAgICAgICBAIGdldCBpbnRlcjRfMltrXVtdCi0KLQkgIFZMRDEuUzE2ICAgICAge1EwLCBRMX0sIFtyMTFdIQotCSAgVkxEMS5TMTYgICAgICB7UTIsIFEzfSwgW3IxMV0hCi0KLQkgIE1PViAgICAgICAgICAgcjYsICMweDgwMDAKLQotICAgICAgICAgIFZMRDEuUzE2ICAgICAge1E0LCBRNX0sIFtyNF0hICAgICAgICAgICAgICAgICAgICAgICAgICAgQGxvYWQgMTYgeFtdCi0gICAgICAgICAgVkxEMS5TMTYgICAgICB7UTYsIFE3fSwgW3I0XSEgICAgICAgICAgICAgICAgICAgICAgICAgICBAbG9hZCAxNiB4W10KLQotTE9PUDoKLSAgICAgICAgICBWUURNVUxMLlMxNiAgIFExNSwgRDgsIEQwCi0gICAgICAgICAgVlFETUxBTC5TMTYgICBRMTUsIEQ5LCBEMQotICAgICAgICAgIFZRRE1MQUwuUzE2ICAgUTE1LCBEMTAsIEQyCi0gICAgICAgICAgVlFETUxBTC5TMTYgICBRMTUsIEQxMSwgRDMKLQotICAgICAgICAgIFZRRE1MQUwuUzE2ICAgUTE1LCBEMTIsIEQ0Ci0gICAgICAgICAgVlFETUxBTC5TMTYgICBRMTUsIEQxMywgRDUKLSAgICAgICAgICBWUURNTEFMLlMxNiAgIFExNSwgRDE0LCBENgotICAgICAgICAgIFZRRE1MQUwuUzE2ICAgUTE1LCBEMTUsIEQ3Ci0KLSAgICAgICAgICBMRFJTSCAgICAgICAgIHIxMiwgW3I0XSwgIzIKLQotICAgICAgICAgIFZFWFQuUzE2ICAgICAgRDgsIEQ4LCBEOSwgIzEKLSAgICAgICAgICBWRVhULlMxNiAgICAgIEQ5LCBEOSwgRDEwLCAjMQotICAgICAgICAgIFZFWFQuUzE2ICAgICAgRDEwLCBEMTAsIEQxMSwgIzEKLSAgICAgICAgICBWRVhULlMxNiAgICAgIEQxMSwgRDExLCBEMTIsICMxCi0gICAgICAgICAgVkRVUC5TMTYgICAgICBEMjQsIHIxMgotICAgICAgICAgIFZFWFQuUzE2ICAgICAgRDEyLCBEMTIsIEQxMywgIzEKLSAgICAgICAgICBWRVhULlMxNiAgICAgIEQxMywgRDEzLCBEMTQsICMxCi0KLSAgICAgICAgICBWUUFERC5TMzIgICAgIEQzMCwgRDMwLCBEMzEKLQkgIE1PViAgICAgICAgICAgcjExLCAjMHg4MDAwCi0gICAgICAgICAgVlBBREQuUzMyICAgICBEMzAsIEQzMCwgRDMwCi0gICAgICAgICAgQUREICAgICAgICAgICByOCwgcjgsICMxCi0gICAgICAgICAgVk1PVi5TMzIgICAgICByMTIsIEQzMFswXQotICAgICAgICAgIFZFWFQuUzE2ICAgICAgRDE0LCBEMTQsIEQxNSwgIzEKLQotICAgICAgICAgIFFBREQgICAgICAgICAgcjEsIHIxMiwgcjEyICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgQCBMX3N1bSA9IChMX3N1bSA8PCAyKQotICAgICAgICAgIFZFWFQuUzE2ICAgICAgRDE1LCBEMTUsIEQyNCwgIzEKLSAgICAgICAgICBRQUREICAgICAgICAgIHI1LCByMSwgcjYKLSAgICAgICAgICBNT1YgICAgICAgICAgIHIxLCByNSwgQVNSICMxNgotICAgICAgICAgIENNUCAgICAgICAgICAgcjgsIHIzCi0gICAgICAgICAgU1RSSCAgICAgICAgICByMSwgW3IwXSwgIzIgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBAIGV4Y1tqXSA9IChM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lc3MgcmVxdWlyZWQgYnkgYXBwbGljYWJsZSBsYXcgb3IgYWdyZWVkIHRvIGluIHdyaXRpbmcsIHNvZnR3YXJlCi1AICoqIGRpc3RyaWJ1dGVkIHVuZGVyIHRoZSBMaWNlbnNlIGlzIGRpc3RyaWJ1dGVkIG9uIGFuICJBUyBJUyIgQkFTSVMsCi1AICoqIFdJVEhPVVQgV0FSUkFOVElFUyBPUiBDT05ESVRJT05TIE9GIEFOWSBLSU5ELCBlaXRoZXIgZXhwcmVzcyBvciBpbXBsaWVkLgotQCAqKiBTZWUgdGhlIExpY2Vuc2UgZm9yIHRoZSBzcGVjaWZpYyBsYW5ndWFnZSBnb3Zlcm5pbmcgcGVybWlzc2lvbnMgYW5kCi1AICoqIGxpbWl0YXRpb25zIHVuZGVyIHRoZSBMaWNlbnNlLgotQCAqLwotQAotQHZvaWQgUmVzaWR1ICgKLUAgICAgV29yZDE2IGFbXSwgLyogKGkpICAgICA6IHByZWRpY3Rpb24gY29lZmZpY2llbnRzICAgICAgICAgICAgICAgICAgICAgICovCi1AICAgIFdvcmQxNiB4W10sIC8qIChpKSAgICAgOiBzcGVlY2ggc2lnbmFsICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotQCAgICBXb3JkMTYgeVtdLCAvKiAobykgICAgIDogcmVzaWR1YWwgc2lnbmFsICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLUAgICAgV29yZDE2IGxnICAgLyogKGkpICAgICA6IHNpemUgb2YgZmlsdGVyaW5nICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi1AKQotQGFbXSAgICAgICAgUk4gICAgIHIwCi1AeFtdICAgICAgICBSTiAgICAgcjEKLUB5W10gICAgICAgIFJOICAgICByMgotQGxnICAgICAgICAgUk4gICAgIHIzCi0KLQkuc2VjdGlvbiAgIC50ZXh0Ci0gICAgICAgIC5nbG9iYWwgICAgUmVzaWR1X29wdAotCi1SZXNpZHVfb3B0OgotCi0gICAgICAgIFNUTUZEICAgICAgICAgIHIxMyEsIHtyNCAtIHIxMiwgcjE0fQotICAgICAgICBTVUIgICAgICAgICAgICByNywgcjMsICM0ICAgICAgICAgICAgICAgICAgICAgICBAaSA9IGxnIC0gNAotCi0gICAgICAgIFZMRDEuUzE2ICAgICAgIHtEMCwgRDEsIEQyLCBEM30sIFtyMF0hICAgICAgICAgICAgICBAZ2V0IGFsbCBhW10KLQlWTEQxLlMxNiAgICAgICB7RDR9LCBbcjBdIQotICAgICAgICBWTU9WLlMzMiAgICAgICBROCwgICMweDgwMDAKLQotTE9PUDE6Ci0gICAgICAgIEFERCAgICAgICAgICAgIHI5LCByMSwgcjcsIExTTCAjMSAgICAgICAgICAgICAgIEBjb3B5IHRoZSBhZGRyZXNzCi0gICAgICAgIEFERCAgICAgICAgICAgIHIxMCwgcjIsIHI3LCBMU0wgIzEKLSAgICAgICAgTU9WICAgICAgICAgICAgcjgsIHI5Ci0gICAgICAgIFZMRDEuUzE2ICAgICAgIEQ1LCBbcjhdISAgICAgICAgICAgICAgICAgICAgICAgQGdldCB4W2ldLCB4W2krMV0sIHhbaSsyXSwgeFtpKzNdCi0gICAgICAgIFZRRE1VTEwuUzE2ICAgIFExMCwgRDUsIEQwWzBdICAgICAgICAgICAgICAgICAgQGZpbmlzaCB0aGUgZmlyc3QgTF9tdWx0Ci0KLSAgICAgICAgU1VCICAgICAgICAgICAgcjgsIHI5LCAjMiAgICAgICAgICAgICAgICAgICAgICAgQGdldCB0aGUgeFtpLTFdIGFkZHJlc3MKLSAgICAgICAgVkxEMS5TMTYgICAgICAgRDUsIFtyOF0hCi0gICAgICAgIFZRRE1MQUwuUzE2ICAgIFExMCwgRDUsIEQwWzFdCi0KLSAgICAgICAgU1VCICAgICAgICAgICAgcjgsIHI5LCAjNCAgICAgICAgICAgICAgICAgICAgICAgQGxvYWQgdGhlIHhbaS0yXSBhZGRyZXNzCi0gICAgICAgIFZMRDEuUzE2ICAgICAgIEQ1LCBbcjhdIQotICAgICAgICBWUURNTEFMLlMxNiAgICBRMTAsIEQ1LCBEMFsyXQotCi0gICAgICAgIFNVQiAgICAgICAgICAgIHI4LCByOSwgIzYgICAgICAgICAgICAgICAgICAgICAgIEBsb2FkIHRoZSB4W2ktM10gYWRkcmVzcwotICAgICAgICBWTEQxLlMxNiAgICAgICBENSwgW3I4XSEKLSAgICAgICAgVlFETUxBTC5TMTYgICAgUTEwLCBENSwgRDBbM10KLQotICAgICAgICBTVUIgICAgICAgICAgICByOCwgcjksICM4ICAgICAgICAgICAgICAgICAgICAgICBAbG9hZCB0aGUgeFtpLTRdIGFkZHJlc3MKLSAgICAgICAgVkxEMS5TMTYgICAgICAgRDUsIFtyOF0hCi0gICAgICAgIFZRRE1MQUwuUzE2ICAgIFExMCwgRDUsIEQxWzBdCi0KLSAgICAgICAgU1VCICAgICAgICAgICAgcjgsIHI5LCAjMTAgICAgICAgICAgICAgICAgICAgICAgQGxvYWQgdGhlIHhbaS01XSBhZGRyZXNzCi0gICAgICAgIFZMRDEuUzE2ICAgICAgIEQ1LCBbcjhdIQotICAgICAgICBWUURNTEFMLlMxNiAgICBRMTAsIEQ1LCBEMVsxXQotCi0gICAgICAgIFNVQiAgICAgICAgICAgIHI4LCByOSwgIzEyICAgICAgICAgICAgICAgICAgICAgIEBsb2FkIHRoZSB4W2ktNl0gYWRkcmVzcwotICAgICAgICBWTEQxLlMxNiAgICAgICBENSwgW3I4XSEKLSAgICAgICAgVlFETUxBTC5TMTYgICAgUTEwLCBENSwgRDFbMl0KLQotICAgICAgICBTVUIgICAgICAgICAgICByOCwgcjksICMxNCAgICAgICAgICAgICAgICAgICAgICBAbG9hZCB0aGUgeFtpLTddIGFkZHJlc3MKLSAgICAgICAgVkxEMS5TMTYgICAgICAgRDUsIFtyOF0hCi0gICAgICAgIFZRRE1MQUwuUzE2ICAgIFExMCwgRDUsIEQxWzNdCi0KLSAgICAgICAgU1VCICAgICAgICAgICAgcjgsIHI5LCAjMTYgICAgICAgICAgICAgICAgICAgICAgQGxvYWQgdGhlIHhbaS04XSBhZGRyZXNzCi0gICAgICAgIFZMRDEuUzE2ICAgICAgIEQ1LCBbcjhdIQotICAgICAgICBWUURNTEFMLlMxNiAgICBRMTAsIEQ1LCBEMlswXQotCi0gICAgICAgIFNVQiAgICAgICAgICAgIHI4LCByOSwgIzE4ICAgICAgICAgICAgICAgICAgICAgIEBsb2FkIHRoZSB4W2ktOV0gYWRkcmVzcwotICAgICAgICBWTEQxLlMxNiAgICAgICBENSwgW3I4XSEKLSAgICAgICAgVlFETUxBTC5TMTYgICAgUTEwLCBENSwgRDJbMV0KLQotICAgICAgICBTVUIgICAgICAgICAgICByOCwgcjksICMyMCAgICAgICAgICAgICAgICAgICAgICBAbG9hZCB0aGUgeFtpLTEwXSBhZGRyZXNzCi0gICAgICAgIFZMRDEuUzE2ICAgICAgIEQ1LCBbcjhdIQotICAgICAgICBWUURNTEFMLlMxNiAgICBRMTAsIEQ1LCBEMlsyXQotCi0JU1VCICAgICAgICAgICAgcjgsIHI5LCAjMjIgICAgICAgICAgICAgICAgICAgICAgQGxvYWQgdGhlIHhbaS0xMV0gYWRkcmVzcwotCVZMRDEuUzE2ICAgICAgIEQ1LCBbcjhdIQotCVZRRE1MQUwuUzE2ICAgIFExMCwgRDUsIEQyWzNdCi0KLQlTVUIgICAgICAgICAgICByOCwgcjksICMyNCAgICAgICAgICAgICAgICAgICAgICBAbG9hZCB0aGUgeFtpLTEyXSBhZGRyZXNzCi0JVkxEMS5TMTYgICAgICAgRDUsIFtyOF0hCi0JVlFETUxBTC5TMTYgICAgUTEwLCBENSwgRDNbMF0KLQotCVNVQiAgICAgICAgICAgIHI4LCByOSwgIzI2ICAgICAgICAgICAgICAgICAgICAgIEBsb2FkIHRoZSB4W2ktMTNdIGFkZHJlc3MKLQlWTEQxLlMxNiAgICAgICBENSwgW3I4XSEKLQlWUURNTEFMLlMxNiAgICBRMTAsIEQ1LCBEM1sxXQotCi0JU1VCICAgICAgICAgICAgcjgsIHI5LCAjMjggICAgICAgICAgICAgICAgICAgICAgQGxvYWQgdGhlIHhbaS0xNF0gYWRkcmVzcwotCVZMRDEuUzE2ICAgICAgIEQ1LCBbcjhdIQotCVZRRE1MQUwuUzE2ICAgIFExMCwgRDUsIEQzWzJdCi0KLQlTVUIgICAgICAgICAgICByOCwgcjksICMzMCAgICAgICAgICAgICAgICAgICAgICBAbG9hZCB0aGUgeFtpLTE1XSBhZGRyZXNzCi0JVkxEMS5TMTYgICAgICAgRDUsIFtyOF0h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RvIHNjYWxlICAgICAgICAgICAgICAgKi8KLUAgICAgICAgICAgICAgICBXb3JkMTYgbGcsICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8qIChpKSAgIDogc2l6ZSBvZiB4W10gICAgICAgICAgICAgICAgICAgKi8KLUAgICAgICAgICAgICAgICBXb3JkMTYgZXhwICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8qIChpKSAgIDogZXhwb25lbnQ6IHggPSByb3VuZCh4IDw8IGV4cCkgKi8KLUApCi1AKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKLUAgIHhbXSAgIC0tLSAgcjAKLUAgIGxnICAgIC0tLSAgcjEKLUAgIGV4cCAgIC0tLSAgcjIKLQotICAgICAgICAgIC5zZWN0aW9uICAudGV4dAotICAgICAgICAgIC5nbG9iYWwgICBTY2FsZV9zaWdfb3B0Ci0KLVNjYWxlX3NpZ19vcHQ6Ci0KLSAgICAgICAgICBTVE1GRCAgIAlyMTMhLCB7cjQgLSByMTIsIHIxNH0KLSAgICAgICAgICBNT1YgICAgICAgICAgIHI0LCAjNAotICAgICAgICAgIFZNT1YuUzMyICAgICAgUTE1LCAjMHg4MDAwCi0gICAgICAgICAgVkRVUC5TMzIgICAgICBRMTQsIHIyCi0gICAgICAgICAgTU9WICAgICAgICAgICByNSwgcjAgICAgICAgICAgICAgICAgICAgICAgICAgIEAgY29weSB4W10gYWRkcmVzcwotICAgICAgICAgIENNUCAgICAgICAgICAgcjEsICM2NAotICAgICAgICAgIE1PVkVRICAgICAgICAgcjQsICMxCi0gICAgICAgICAgQkVRICAgICAgICAgICBMT09QCi0JICBDTVAgICAgICAgICAgIHIxLCAjMTI4Ci0JICBNT1ZFUSAgICAgICAgIHI0LCAjMgotCSAgQkVRICAgICAgICAgICBMT09QCi0gICAgICAgICAgQ01QICAgICAgICAgICByMSwgIzI1NgotICAgICAgICAgIEJFUSAgICAgICAgICAgTE9PUAotCSAgQ01QICAgICAgICAgICByMSwgIzgwCi0JICBNT1ZFUSAgICAgICAgIHI0LCAjMQotCSAgQkVRICAgICAgICAgICBMT09QMQotCi1MT09QMToKLSAgICAgICAgICBWTEQxLlMxNiAgICAgIHtRMCwgUTF9LCBbcjVdISAgICAgICAgICAgICAgICAgQGxvYWQgMTYgV29yZDE2IHhbXQotICAgICAgICAgIFZTSExMLlMxNiAgICAgUTEwLCBEMCwgIzE2Ci0gICAgICAgICAgVlNITEwuUzE2ICAgICBRMTEsIEQxLCAjMTYKLSAgICAgICAgICBWU0hMTC5TMTYgICAgIFExMiwgRDIsICMxNgotICAgICAgICAgIFZTSExMLlMxNiAgICAgUTEzLCBEMywgIzE2Ci0gICAgICAgICAgVlNITC5TMzIgICAgICBRMTAsIFExMCwgUTE0Ci0gICAgICAgICAgVlNITC5TMzIgICAgICBRMTEsIFExMSwgUTE0Ci0gICAgICAgICAgVlNITC5TMzIgICAgICBRMTIsIFExMiwgUTE0Ci0gICAgICAgICAgVlNITC5TMzIgICAgICBRMTMsIFExMywgUTE0Ci0gICAgICAgICAgVkFEREhOLlMzMiAgICBEMTYsIFExMCwgUTE1Ci0gICAgICAgICAgVkFEREhOLlMzMiAgICBEMTcsIFExMSwgUTE1Ci0gICAgICAgICAgVkFEREhOLlMzMiAgICBEMTgsIFExMiwgUTE1Ci0gICAgICAgICAgVkFEREhOLlMzMiAgICBEMTksIFExMywgUTE1Ci0gICAgICAgICAgVlNUMS5TMTYgICAgICB7UTgsIFE5fSwgW3IwXSEgICAgICAgICAgICAgICAgIEBzdG9yZSAxNiBXb3JkMTYgeFtdCi0KLUxPT1A6Ci0gICAgICAgICAgVkxEMS5TMTYgICAgICB7UTAsIFExfSwgW3I1XSEgICAgICAgICAgICAgICAgIEBsb2FkIDE2IFdvcmQxNiB4W10KLSAgICAgICAgICBWTEQxLlMxNiAgICAgIHtRMiwgUTN9LCBbcjVdISAgICAgICAgICAgICAgICAgQGxvYWQgMTYgV29yZDE2IHhbXQotICAgICAgICAgIFZMRDEuUzE2ICAgICAge1E0LCBRNX0sIFtyNV0hICAgICAgICAgICAgICAgICBAbG9hZCAxNiBXb3JkMTYgeFtdCi0gICAgICAgICAgVkxEMS5TMTYgICAgICB7UTYsIFE3fSwgW3I1XSEgICAgICAgICAgICAgICAgIEBsb2FkIDE2IFdvcmQxNiB4W10KLQotICAgICAgICAgIFZTSExMLlMxNiAgICAgUTgsIEQwLCAjMTYKLSAgICAgICAgICBWU0hMTC5TMTYgICAgIFE5LCBEMSwgIzE2Ci0gICAgICAgICAgVlNITEwuUzE2ICAgICBRMTAsIEQyLCAjMTYKLSAgICAgICAgICBWU0hMTC5TMTYgICAgIFExMSwgRDMsICMxNgotICAgICAgICAgIFZTSEwuUzMyICAgICAgUTgsIFE4LCBRMTQKLSAgICAgICAgICBWU0hMLlMzMiAgICAgIFE5LCBROSwgUTE0Ci0gICAgICAgICAgVlNITC5TMzIgICAgICBRMTAsIFExMCwgUTE0Ci0gICAgICAgICAgVlNITC5TMzIgICAgICBRMTEsIFExMSwgUTE0Ci0gICAgICAgICAgVkFEREhOLlMzMiAgICBEMTYsIFE4LCBRMTUKLSAgICAgICAgICBWQURESE4uUzMyICAgIEQxNywgUTksIFExNQotICAgICAgICAgIFZBRERITi5TMzIgICAgRDE4LCBRMTAsIFExNQotICAgICAgICAgIFZBRERITi5TMzIgICAgRDE5LCBRMTEsIFExNQotICAgICAgICAgIFZTVDEuUzE2ICAgICAge1E4LCBROX0sIFtyMF0hICAgICAgICAgICAgICAgICBAc3RvcmUgMTYgV29yZDE2IHhbXQotCi0KLSAgICAgICAgICBWU0hMTC5TMTYgICAgIFExMiwgRDQsICMxNgotICAgICAgICAgIFZTSExMLlMxNiAgICAgUTEzLCBENSwgIzE2Ci0gICAgICAgICAgVlNITEwuUzE2ICAgICBRMTAsIEQ2LCAjMTYKLSAgICAgICAgICBWU0hMTC5TMTYgICAgIFExMSwgRDcsICMxNgotICAgICAgICAgIFZTSEwuUzMyICAgICAgUTEyLCBRMTIsIFExNAotICAgICAgICAgIFZTSEwuUzMyICAgICAgUTEzLCBRMTMsIFExNAotICAgICAgICAgIFZTSEwuUzMyICAgICAgUTEwLCBRMTAsIFExNAotICAgICAgICAgIFZTSEwuUzMyICAgICAgUTExLCBRMTEsIFExNAotICAgICAgICAgIFZBRERITi5TMzIgICAgRDE2LCBRMTIsIFExNQotICAgICAgICAgIFZBRERITi5TMzIgICAgRDE3LCBRMTMsIFExNQotICAgICAgICAgIFZBRERITi5TMzIgICAgRDE4LCBRMTAsIFExNQotICAgICAgICAgIFZBRERITi5TMzIgICAgRDE5LCBRMTEsIFExNQotICAgICAgICAgIFZTVDEuUzE2ICAgICAge1E4LCBROX0sIFtyMF0hICAgICAgICAgICAgICAgICBAc3RvcmUgMTYgV29yZDE2IHhbXQotCi0gICAgICAgICAgVlNITEwuUzE2ICAgICBRMTAsIEQ4LCAjMTYKLSAgICAgICAgICBWU0hMTC5TMTYgICAgIFExMSwgRDksICMxNgotICAgICAgICAgIFZTSExMLlMxNiAgICAgUTEyLCBEMTAsICMxNgotICAgICAgICAgIFZTSExMLlMxNiAgICAgUTEzLCBEMTEsICMxNgotICAgICAgICAgIFZTSEwuUzMyICAgICAgUTEwLCBRMTAsIFExNAotICAgICAgICAgIFZTSEwuUzMyICAgICAgUTExLCBRMTEsIFExNAotICAgICAgICAgIFZTSEwuUzMyICAgICAgUTEyLCBRMTIsIFExNAotICAgICAgICAgIFZTSEwuUzMyICAgICAgUTEzLCBRMTMsIFExNAotICAgICAgICAgIFZBRERITi5TMzIgICAgRDE2LCBRMTAsIFExNQotICAgICAgICAgIFZBRERITi5TMzIgICAgRDE3LCBRMTEsIFExNQotICAgICAgICAgIFZBRERITi5TMzIgICAgRDE4LCBRMTIsIFExNQotICAgICAgICAgIFZBRERITi5TMzIgICAgRDE5LCBRMTMsIFExNQotICAgICAgICAgIFZTVDEuUzE2ICAgICAge1E4LCBROX0sIFtyMF0hICAgICAgICAgICAgICAgICBAc3RvcmUgMTYgV29yZDE2IHhbXQotCi0gICAgICAgICAgVlNITEwuUzE2ICAgICBRMTAsIEQxMiwgIzE2Ci0gICAgICAgICAgVlNITEwuUzE2ICAgICBRMTEsIEQxMywgIzE2Ci0gICAgICAgICAgVlNITEwuUzE2ICAgICBRMTIsIEQxNCwgIzE2Ci0gICAgICAgICAgVlNITEwuUzE2ICAgICBRMTMsIEQxNSwgIzE2Ci0gICAgICAgICAgVlNITC5TMzIgICAgICBRMTAsIFExMCwgUTE0Ci0gICAgICAgICAgVlNITC5TMzIgICAgICBRMTEsIFExMSwgUTE0Ci0gICAgICAgICAgVlNITC5TMzIgICAgICBRMTIsIFExMiwgUTE0Ci0gICAgICAgICAgVlNITC5TMzIgICAgICBRMTMsIFExMywgUTE0Ci0gICAgICAgICAgVkFEREhOLlMzMiAgICBEMTYsIFExMCwgUTE1Ci0gICAgICAgICAgVkFEREhOLlMzMiAgICBEMTcsIFExMSwgUTE1Ci0gICAgICAgICAgVkFEREhOLlMzMiAgICBEMTgsIFExMiwgUTE1Ci0gICAgICAgICAgVkFEREhOLlMzMiAgICBEMTksIFExMywgUTE1Ci0gICAgICAgICAgVlNUMS5TMTYgICAgICB7UTgsIFE5fSwgW3IwXSEgICAgICAgICAgICAgICAgIEBzdG9yZSAxNiBXb3JkMTYgeFtdCi0gICAgICAgICAgU1VCUyAgICAgICAgICByNCwgcjQsICMxCi0gICAgICAgICAgQkdUICAgICAgICAgICBMT09QCi0KLQotU2NhbGVfc2lnX2FzbV9lbmQ6Ci0KLSAgICAgICAgICBMRE1GRCAgIAlyMTMhLCB7cjQgLSByMTIsIHIxNX0KLSAgICAgICAgICBARU5ERlVOQwotICAgICAgICAgIC5FTkQKLQotCmRpZmYgLS1naXQgYS9tZWRpYS9saWJzdGFnZWZyaWdodC9jb2RlY3MvYW1yd2JlbmMvc3JjL2FzbS9BUk1WNy9zeW5fZmlsdF9uZW9uLnMgYi9tZWRpYS9saWJzdGFnZWZyaWdodC9jb2RlY3MvY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kCi1AICoqIGxpbWl0YXRpb25zIHVuZGVyIHRoZSBMaWNlbnNlLgotQCAqLwotQAotQHZvaWQgU3luX2ZpbHQoCi1AICAgICBXb3JkMTYgYVtdLCAgICAgICAgICAgICAgICAgICAgICAgICAgIC8qIChpKSBRMTIgOiBhW20rMV0gcHJlZGljdGlvbiBjb2VmZmljaWVudHMgICAgICAgICAgICovCi1AICAgICBXb3JkMTYgeFtdLCAgICAgICAgICAgICAgICAgICAgICAgICAgIC8qIChpKSAgICAgOiBpbnB1dCBzaWduYWwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi1AICAgICBXb3JkMTYgeVtdLCAgICAgICAgICAgICAgICAgICAgICAgICAgIC8qIChvKSAgICAgOiBvdXRwdXQgc2lnbmFsICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi1AICAgICBXb3JkMTYgbWVtW10sICAgICAgICAgICAgICAgICAgICAgICAgIC8qIChpL28pICAgOiBtZW1vcnkgYXNzb2NpYXRlZCB3aXRoIHRoaXMgZmlsdGVyaW5nLiAgICovCi1AKQotQCoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCi1AIGFbXSAgICAtLS0gICByMAotQCB4W10gICAgLS0tICAgcjEKLUAgeVtdICAgIC0tLSAgIHIyCi1AIG1lbVtdICAtLS0gICByMwotQCBtIC0tLSAgMTYgIGxnIC0tLSA4MCAgdXBkYXRlIC0tLSAxCi0KLSAgICAgICAgICAuc2VjdGlvbiAgLnRleHQKLSAgICAgICAgICAuZ2xvYmFsICAgU3luX2ZpbHRfYXNtCi0KLVN5bl9maWx0X2FzbToKLQotICAgICAgICAgIFNUTUZEICAgCXIxMyEsIHtyNCAtIHIxMiwgcjE0fQotICAgICAgICAgIFNVQiAgICAgICAgICAgcjEzLCByMTMsICM3MDAgICAgICAgICAgICAgICAgICAgQCB5X2J1ZltMX0ZSQU1FMTZrICsgTTE2a10KLQotICAgICAgICAgIE1PViAgICAgICAgICAgcjQsIHIzICAgICAgICAgICAgICAgICAgICAgICAgICAgQCBjb3B5IG1lbVtdIGFkZHJlc3MKLSAgICAgICAgICBNT1YgICAgICAgICAgIHI1LCByMTMgICAgICAgICAgICAgICAgICAgICAgICAgIEAgY29weSB5eSA9IHlfYnVmIGFkZHJlc3MKLQotICAgICAgICAgIEAgZm9yKGkgPSAwQCBpIDwgbUAgaSsrKQotICAgICAgICAgIEB7Ci0gICAgICAgICAgQCAgICAqeXkrKyA9IG1lbVtpXUAKLSAgICAgICAgICBAfQotICAgICAgICAgIFZMRDEuUzE2ICAgICAge0QwLCBEMSwgRDIsIEQzfSwgW3I0XSEgICAgICAgICAgQGxvYWQgMTYgbWVtcwotCSAgVlNUMS5TMTYgICAgICB7RDAsIEQxLCBEMiwgRDN9LCBbcjVdISAgICAgICAgICBAc3RvcmUgMTYgbWVtW10gdG8gKnl5Ci0KLSAgICAgICAgICBMRFJTSCAgICAgICAgIHI1LCBbcjBdLCAjMiAgICAgICAgICAgICAgICAgICAgIEAgbG9hZCBhWzBdCi0gICAgICAgICAgTU9WICAgICAgICAgICByOCwgIzAgICAgICAgICAgICAgICAgICAgICAgICAgICBAIGkgPSAwCi0gICAgICAgICAgTU9WICAgICAgICAgICByNSwgcjUsIEFTUiAjMSAgICAgICAgICAgICAgICAgICBAIGEwID0gYVswXSA+PiAxCi0gICAgICAgICAgVk1PVi5TMTYgICAgICBEOFswXSwgcjUKLSAgICAgICAgICBAIGxvYWQgYWxsIGFbXQotICAgICAgICAgIFZMRDEuUzE2ICAgICAge0QwLCBEMSwgRDIsIEQzfSwgW3IwXSEgICAgICAgICAgQCBsb2FkIGFbMV0gfiBhWzE2XQotCSAgVlJFVjY0LjE2ICAgICBEMCwgRDAKLQkgIFZSRVY2NC4xNiAgICAgRDEsIEQxCi0JICBWUkVWNjQuMTYgICAgIEQyLCBEMgotCSAgVlJFVjY0LjE2ICAgICBEMywgRDMKLQkgIE1PViAgICAgICAgICAgcjgsICMwICAgICAgICAgICAgICAgICAgICAgICAgICAgQCBsb29wIHRpbWVzCi0JICBNT1YgICAgICAgICAgIHIxMCwgcjEzICAgICAgICAgICAgICAgICAgICAgICAgIEAgdGVtcCA9IHlfYnVmCi0JICBBREQgICAgICAgICAgIHI0LCByMTMsICMzMiAgICAgICAgICAgICAgICAgICAgIEAgeXlbaV0gYWRkcmVzcwotCi0gICAgICAgICAgVkxEMS5TMTYgICAgICB7RDQsIEQ1LCBENiwgRDd9LCBbcjEwXSEgICAgICAgICBAIGZpcnN0IDE2IHRlbXBfcAotCi1TWU5fTE9PUDoKLQotICAgICAgICAgIExEUlNIICAgICAgICAgcjYsIFtyMV0sICMyICAgICAgICAgICAgICAgICAgICAgQCBsb2FkIHhbaV0KLQkgIE1VTCAgICAgICAgICAgcjEyLCByNiwgcjUgICAgICAgICAgICAgICAgICAgICAgQCBMX3RtcCA9IHhbaV0gKiBhMAotCSAgQUREICAgICAgICAgICByMTAsIHI0LCByOCwgTFNMICMxICAgICAgICAgICAgICBAIHlbaV0sIHl5W2ldIGFkZHJlc3MKLQotCSAgVkRVUC5TMzIgICAgICBRMTAsIHIxMgotCSAgVk1VTEwuUzE2ICAgICBRNSwgRDMsIEQ0Ci0gICAgICAgICAgVk1MQUwuUzE2ICAgICBRNSwgRDIsIEQ1Ci0gICAgICAgICAgVk1MQUwuUzE2ICAgICBRNSwgRDEsIEQ2Ci0gICAgICAgICAgVk1MQUwuUzE2ICAgICBRNSwgRDAsIEQ3Ci0gICAgICAgICAgVkVYVC44ICAgICAgICBENCwgRDQsIEQ1LCAjMgotICAgICAgICAgIFZFWFQuOCAgICAgICAgRDUsIEQ1LCBENiwgIzIKLSAgICAgICAgICBWRVhULjggICAgICAgIEQ2LCBENiwgRDcsICMyCi0gICAgICAgICAgVlBBREQuUzMyICAgICBEMTIsIEQxMCwgRDExCi0gICAgICAgICAgQUREICAgICAgICAgICByOCwgcjgsICMxCi0gICAgICAgICAgVlBBREQuUzMyICAgICBEMTAsIEQxMiwgRDEyCi0KLQkgIFZEVVAuUzMyICAgICAgUTcsIEQxMFswXQotCi0JICBWU1VCLlMzMiAgICAgIFE5LCBRMTAsIFE3Ci0gICAgICAgICAgVlFSU0hSTi5TMzIgICBEMjAsIFE5LCAjMTIKLSAgICAgICAgICBWTU9WLlMxNiAgICAgIHI5LCBEMjBbMF0KLSAgICAgICAgICBWRVhULjggICAgICAgIEQ3LCBENywgRDIwLCAjMgotICAgICAgICAgIENNUCAgICAgICAgICAgcjgsICM4MAotICAgICAgICAgIFNUUkggICAgICAgICAgcjksIFtyMTBdICAgICAgICAgICAgICAgICAgICAgICAgQCB5eVtpXQotICAgICAgICAgIFNUUkggICAgICAgICAgcjksIFtyMl0sICMyICAgICAgICAgICAgICAgICAgICAgQCB5W2ldCi0KLSAgICAgICAgICBCTFQgICAgICAgICAgIFNZTl9MT09QCi0KLSAgICAgICAgICBAIHVwZGF0ZSBtZW1bXQotICAgICAgICAgIEFERCAgICAgICAgICAgcjUsIHIxMywgIzE2MCAgICAgICAgICAgICAgICAgICAgQCB5eVs2NF0gYWRkcmVzcwotCSAgVkxEMS5TMTYgICAgICB7RDAsIEQxLCBEMiwgRDN9LCBbcjVdIQotCSAgVlNUMS5TMTYgICAgICB7RDAsIEQxLCBEMiwgRDN9LCBbcjNdIQotCi1TeW5fZmlsdF9hc21fZW5kOgotCi0gICAgICAgICAgQUREICAgICAgICAgICByMTMsIHIxMywgIzcwMAotICAgICAgICAgIExETUZEICAgCXIxMyEsIHtyNCAtIHIxMiwgcjE1fQotICAgICAgICAgIEBFTkRGVU5DCi0gICAgICAgICAgLkVORAotCi0KZGlmZiAtLWdpdCBhL21lZGlhL2xpYnN0YWdlZnJpZ2h0L2NvZGVjcy9hbXJ3YmVuYy9zcmMvYXV0b2NvcnIuYyBiL21lZGlhL2xpYnN0YWdlZnJpZ2h0L2NvZGVjcy9hbXJ3YmVuYy9zcmMvYXV0b2NvcnIuYwpkZWxldGVkIGZpbGUgbW9kZSAx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KioqKioqCi0qICAgICAgIEZpbGU6IGF1dG9jb3JyLmMgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICoKLSogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKgotKiAgICAgICBEZXNjcmlwdGlvbjpDb21wdXRlIGF1dG9jb3JyZWxhdGlvbnMgb2Ygc2lnbmFsIHdpdGggd2luZG93aW5nICAqCi0qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICoKLSoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLQotI2luY2x1ZGUgInR5cGVkZWYuaCIKLSNpbmNsdWRlICJiYXNpY19vcC5oIgotI2luY2x1ZGUgIm9wZXJfMzJiLmgiCi0jaW5jbHVkZSAiYWNlbHAuaCIKLSNpbmNsdWRlICJoYW1fd2luZC50YWIiCi0KLXZvaWQgQXV0b2NvcnIoCi0JCVdvcmQxNiB4W10sICAgICAgICAgICAgICAgICAgICAgICAgICAgLyogKGkpICAgIDogSW5wdXQgc2lnbmFsICAgICAgICAgICAgICAgICAgICAgICovCi0JCVdvcmQxNiBtLCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLyogKGkpICAgIDogTFBDIG9yZGVyICAgICAgICAgICAgICAgICAgICAgICAgICovCi0JCVdvcmQxNiByX2hbXSwgICAgICAgICAgICAgICAgICAgICAgICAgLyogKG8pIFExNTogQXV0b2NvcnJlbGF0aW9ucyAgKG1zYikgICAgICAgICAgICovCi0JCVdvcmQxNiByX2xbXSAgICAgICAgICAgICAgICAgICAgICAgICAgLyogKG8pICAgIDogQXV0b2NvcnJlbGF0aW9ucyAgKGxzYikgICAgICAgICAgICovCi0JICAgICApCi17Ci0JV29yZDMyIGksIG5vcm0sIHNoaWZ0OwotCVd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B1bmRlciB0aGUgTGljZW5zZSBpcyBkaXN0cmlidXRlZCBvbiBhbiAiQVMgSVMiIEJBU0lTLAotICoqIFdJVEhPVVQgV0FSUkFOVElFUyBPUiBDT05ESVRJT05TIE9GIEFOWSBLSU5ELCBlaXRoZXIgZXhwcmVzcyBvciBpbXBsaWVkLgotICoqIFNlZSB0aGUgTGljZW5zZSBmb3IgdGhlIHNwZWNpZmljIGxhbmd1YWdlIGdvdmVybmluZyBwZXJtaXNzaW9ucyBhbmQKLSAqKiBsaW1pdGF0aW9ucyB1bmRlciB0aGUgTGljZW5zZS4KLSAqLwotCi0vKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKLSogIEZpbGU6IGF6X2lzcC5jCi0qCi0qICBEZXNjcmlwdGlvbjoKLSotLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSoKLSogQ29tcHV0ZSB0aGUgSVNQcyBmcm9tICB0aGUgTFBDIGNvZWZmaWNpZW50cyAgKG9yZGVyPU0pICAgICAgICAgICAgICAgICoKLSotLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSoKLSogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICoKLSogVGhlIElTUHMgYXJlIHRoZSByb290cyBvZiB0aGUgdHdvIHBvbHlub21pYWxzIEYxKHopIGFuZCBGMih6KSAgICAgICAgICoKLSogZGVmaW5lZCBhcyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICoKLSogICAgICAgICAgICAgICBGMSh6KSA9IEEoeikgKyB6Xi1tIEEoel4tMSkgICAgICAgICAgICAgICAgICAgICAgICAgICAgICoKLSogIGFuZCAgICAgICAgICBGMih6KSA9IEEoeikgLSB6Xi1tIEEoel4tMSkgICAgICAgICAgICAgICAgICAgICAgICAgICAgICoKLSogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICoKLSogRm9yIGEgZXZlbiBvcmRlciBtPTJuLCBGMSh6KSBoYXMgTS8yIGNvbmp1Z2F0ZSByb290cyBvbiB0aGUgdW5pdCAgICAgICoKLSogY2lyY2xlIGFuZCBGMih6KSBoYXMgTS8yLTEgY29uanVnYXRlIHJvb3RzIG9uIHRoZSB1bml0IGNpcmNsZSBpbiAgICAgICoKLSogYWRkaXRpb24gdG8gdHdvIHJvb3RzIGF0IDAgYW5kIHBpLiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICoKLSogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICoKLSogRm9yIGEgMTZ0aCBvcmRlciBMUCBhbmFseXNpcywgRjEoeikgYW5kIEYyKHopIGNhbiBiZSB3cml0dGVuIGFzICAgICAgICoKLSogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICoKLSogICBGMSh6KSA9ICgxICsgYVtNXSkgICBQUk9EVUNUICAoMSAtIDIgY29zKHdfaSkgel4tMSArIHpeLTIgKSAgICAgICAgICoKLSogICAgICAgICAgICAgICAgICAgICAgICBpPTAsMiw0LDYsOCwxMCwxMiwxNCAgICAgICAgICAgICAgICAgICAgICAgICAgICoKLSogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICoKLSogICBGMih6KSA9ICgxIC0gYVtNXSkgKDEgLSB6Xi0yKSBQUk9EVUNUICgxIC0gMiBjb3Mod19pKSB6Xi0xICsgel4tMiApICoKLSogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpPTEsMyw1LDcsOSwxMSwxMyAgICAgICAgICAgICAgICAgICAgICoKLSogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICoKLSogVGhlIElTUHMgYXJlIHRoZSBNLTEgZnJlcXVlbmNpZXMgd19pLCBpPTAuLi5NLTIgcGx1cyB0aGUgbGFzdCAgICAgICAgICoKLSogcHJlZGljdG9yIGNvZWZmaWNpZW50IGFbTV0uICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICoKLSotLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSoKLQotKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotCi0jaW5jbHVkZSAidHlwZWRlZi5oIgotI2luY2x1ZGUgImJhc2ljX29wLmgiCi0jaW5jbHVkZSAib3Blcl8zMmIuaCIKLSNpbmNsdWRlICJzdGRpby5oIgotI2luY2x1ZGUgImdyaWQxMDAudGFiIgotCi0jZGVmaW5lIE0gICAxNgotI2RlZmluZSBOQyAgKE0vMikKLQotLyogbG9jYWwgZnVuY3Rpb24gKi8KLXN0YXRpYyBfX2lubGluZSBXb3JkMTYgQ2hlYnBzMihXb3JkMTYgeCwgV29yZDE2IGZbXSwgV29yZDMyIG4pOwotCi12b2lkIEF6X2lzcCgKLQkJV29yZDE2IGFbXSwgICAgICAgICAgICAgICAgICAgICAgICAgICAvKiAoaSkgUTEyIDogcHJlZGljdG9yIGNvZWZmaWNpZW50cyAgICAgICAgICAgICAgICAgKi8KLQkJV29yZDE2IGlzcFtdLCAgICAgICAgICAgICAgICAgICAgICAgICAvKiAobykgUTE1IDogSW1taXR0YW5jZSBzcGVjdHJhbCBwYWlycyAgICAgICAgICAgICAgKi8KLQkJV29yZDE2IG9sZF9pc3BbXSAgICAgICAgICAgICAgICAgICAgICAvKiAoaSkgICAgIDogb2xkIGlzcFtdIChpbiBjYXNlIG5vdCBmb3VuZCBNIHJvb3RzKSAgKi8KLQkgICApCi17Ci0JV29yZDMyIGksIGosIG5mLCBpcCwgb3JkZXI7Ci0JV29yZDE2IHhsb3csIHlsb3csIHhoaWdoLCB5aGlnaCwgeG1pZCwgeW1pZCwgeGludDsKLQlXb3JkMTYgeCwgeSwgc2lnbiwgZXhwOwotCVdvcmQxNiAqY29lZjsKLQlXb3JkMTYgZjFbTkMgKyAxXSwgZjJbTkNdOwotCVdvcmQzMiB0MDsKLQkvKi0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0qCi0JICogZmluZCB0aGUgc3VtIGFuZCBkaWZmIHBvbHlub21pYWxzIEYxKHopIGFuZCBGMih6KSAgICAgICAgICAgKgotCSAqICAgICAgRjEoeikgPSBbQSh6KSArIHpeTSBBKHpeLTEpXSAgICAgICAgICAgICAgICAgICAgICAgICAgICoKLQkgKiAgICAgIEYyKHopID0gW0EoeikgLSB6Xk0gQSh6Xi0xKV0vKDEtel4tMikgICAgICAgICAgICAgICAgICAqCi0JICogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKgotCSAqIGZvciAoaT0wOyBpPE5DOyBpKyspICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICoKLQkgKiB7ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqCi0JICogICBmMVtpXSA9IGFbaV0gKyBhW00taV07ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKgotCSAqICAgZjJbaV0gPSBhW2ldIC0gYVtNLWldOyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICoKLQkgKiB9ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqCi0JICogZjFbTkNdID0gMi4wKmFbTkNdOyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKgotCSAqICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICoKLQkgKiBmb3IgKGk9MjsgaTxOQzsgaSsrKSAgICAgICAgICAgIERpdmlkZSBieSAoMS16Xi0yKSAgICAgICAgICAqCi0JICogICBmMltpXSArPSBmMltpLTJdOyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKgotCSAqLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSovCi0JZm9yIChpID0gMDsgaSA8IE5DOyBpKyspCi0JewotCQl0MCA9IGFbaV0gPDwgMTU7Ci0JCWYxW2ldID0gdm9fcm91bmQodDAgKyAoYVtNIC0gaV0gPDwgMTUpKTsgICAgICAgIC8qID0oYVtpXSthW00taV0pLzIgKi8KLQkJZjJbaV0gPSB2b19yb3VuZCh0MCAtIChhW00gLSBpXSA8PCAxNSkpOyAgICAgICAgLyogPShhW2ldLWFbTS1pXSkvMiAqLwotCX0KLQlmMVtOQ10gPSBhW05DXTsKLQlmb3IgKGkgPSAyOyBpIDwgTkM7IGkrKykgICAgICAgICAgICAgICAvKiBEaXZpZGUgYnkgKDEtel4tMikgKi8KLQkJZjJbaV0gPSBhZGQxKGYyW2ldLCBmMltpIC0gMl0pOwotCi0JLyotLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0qCi0JICogRmluZCB0aGUgSVNQcyAocm9vdHMgb2YgRjEoeikgYW5kIEYyKHopICkgdXNpbmcgdGhlICAgICAgICAgICAgICAgICAqCi0JICogQ2hlYnlzaGV2IHBvbHlub21pYWwgZXZhbHVhdGlvbi4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqCi0JICogVGhlIHJvb3RzIG9mIEYxKHopIGFuZCBGMih6KSBhcmUgYWx0ZXJuYXRpdmVseSBzZWFyY2hlZC4gICAgICAgICAgICAqCi0JICogV2Ugc3RhcnQgYnkgZmluZGluZyB0aGUgZmlyc3Qgcm9vdCBvZiBGMSh6KSB0aGVuIHdlIHN3aXRjaCAgICAgICAgICAqCi0JICogdG8gRjIoeikgdGhlbiBiYWNrIHRvIEYxKHopIGFuZCBzbyBvbiB1bnRpbCBhbGwgcm9vdHMgYXJlIGZvdW5kLiAgICAqCi0JICogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqCi0JICogIC0gRXZhbHVhdGUgQ2hlYnlzaGV2IHBvbC4gYXQgZ3JpZCBwb2ludHMgYW5kIGNoZWNrIGZvciBzaWduIGNoYW5nZS4qCi0JICogIC0gSWYgc2lnbiBjaGFuZ2UgdHJhY2sgdGhlIHJvb3QgYnkgc3ViZGl2aWRpbmcgdGhlIGludGVydmFsICAgICAgICAqCi0JICogICAgMiB0aW1lcyBhbmQgY2tlY2tpbmcgc2lnbiBjaGFuZ2UuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqCi0JICotLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0qLwotCW5mID0gMDsgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLyogbnVtYmVyIG9mIGZvdW5kIGZyZXF1ZW5jaWVzICovCi0JaXAgPSAwOyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvKiBpbmRpY2F0b3IgZm9y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0gZjE7Ci0JCQkJb3JkZXIgPSBOQzsKLQkJCX0KLQkJCXlsb3cgPSBDaGVicHMyKHhsb3csIGNvZWYsIG9yZGVyKTsKLQkJfQotCX0KLQkvKiBDaGVjayBpZiBNLTEgcm9vdHMgZm91bmQgKi8KLQlpZihuZiA8IE0gLSAxKQotCXsKLQkJZm9yIChpID0gMDsgaSA8IE07IGkrKykKLQkJewotCQkJaXNwW2ldID0gb2xkX2lzcFtpXTsKLQkJfQotCX0gZWxzZQotCXsKLQkJaXNwW00gLSAxXSA9IGFbTV0gPDwgMzsgICAgICAgICAgICAgICAgICAgICAgLyogRnJvbSBRMTIgdG8gUTE1IHdpdGggc2F0dXJhdGlvbiAqLwotCX0KLQlyZXR1cm47Ci19Ci0KLS8qLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0qCi0qIGZ1bmN0aW9uICBDaGVicHMyOiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqCi0qICAgICAgICAgICB+fn5+fn5+ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqCi0qICAgIEV2YWx1YXRlcyB0aGUgQ2hlYmlzaGV2IHBvbHlub21pYWwgc2VyaWVzICAgICAgICAgICAgICAgICAqCi0qLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0qCi0qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqCi0qICBUaGUgcG9seW5vbWlhbCBvcmRlciBpcyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqCi0qICAgICBuID0gTS8yICAgKE0gaXMgdGhlIHByZWRpY3Rpb24gb3JkZXIpICAgICAgICAgICAgICAgICAgICAqCi0qICBUaGUgcG9seW5vbWlhbCBpcyBnaXZlbiBieSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqCi0qICAgIEMoeCkgPSBmKDApVF9uKHgpICsgZigxKVRfbi0xKHgpICsgLi4uICtmKG4tMSlUXzEoeCkgKyBmKG4pLzIgKgotKiBBcmd1bWVudHM6ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKgotKiAgeDogICAgIGlucHV0IHZhbHVlIG9mIGV2YWx1YXRpb247IHggPSBjb3MoZnJlcXVlbmN5KSBpbiBRMTUgKgotKiAgZltdOiAgIGNvZWZmaWNpZW50cyBvZiB0aGUgcG9sLiAgICAgICAgICAgICAgICAgICAgICBpbiBRMTEgKgotKiAgbjogICAgIG9yZGVyIG9mIHRoZSBwb2wuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKgotKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKgotKiBUaGUgdmFsdWUgb2YgQyh4KSBpcyByZXR1cm5lZC4gKFNhdHVyZWQgdG8gKy0xLjk5IGluIFExNCkgICAgKgotKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKgotKi0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tKi8KLQotc3RhdGljIF9faW5saW5lIFdvcmQxNiBDaGVicHMyKFdvcmQxNiB4LCBXb3JkMTYgZltdLCBXb3JkMzIgbikKLXsKLQlXb3JkMzIgaSwgY2hlYjsKLQlXb3JkMTYgYjBfaCwgYjBfbCwgYjFfaCwgYjFfbCwgYjJfaCwgYjJfbDsKLQlXb3JkMzIgdDA7Ci0KLQkvKiBOb3RlOiBBbGwgY29tcHV0YXRpb24gYXJlIGRvbmUgaW4gUTI0LiAqLwotCi0JdDAgPSBmWzBdIDw8IDEz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sZSBsYXcgb3IgYWdyZWVkIHRvIGluIHdyaXRpbmcsIHNvZnR3YXJlCi0gKiogZGlzdHJpYnV0ZWQgdW5kZXIgdGhlIExpY2Vuc2UgaXMgZGlzdHJpYnV0ZWQgb24gYW4gIkFTIElTIiBCQVNJUywKLSAqKiBXSVRIT1VUIFdBUlJBTlRJRVMgT1IgQ09ORElUSU9OUyBPRiBBTlkgS0lORCwgZWl0aGVyIGV4cHJlc3Mgb3IgaW1wbGllZC4KLSAqKiBTZWUgdGhlIExpY2Vuc2UgZm9yIHRoZSBzcGVjaWZpYyBsYW5ndWFnZSBnb3Zlcm5pbmcgcGVybWlzc2lvbnMgYW5kCi0gKiogbGltaXRhdGlvbnMgdW5kZXIgdGhlIExpY2Vuc2UuCi0gKi8KLQotLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgotKiAgICAgIEZpbGU6IGMydDY0ZnguYyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKgotKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKgotKgkgICBEZXNjcmlwdGlvbjpQZXJmb3JtcyBhbGdlYnJhaWMgY29kZWJvb2sgc2VhcmNoIGZvciA2LjYwa2JpdHMgbW9kZSoKLSogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICoKLSoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0KLSNpbmNsdWRlICJ0eXBlZGVmLmgiCi0jaW5jbHVkZSAiYmFzaWNfb3AuaCIKLSNpbmNsdWRlICJtYXRoX29wLmgiCi0jaW5jbHVkZSAiYWNlbHAuaCIKLSNpbmNsdWRlICJjbnN0LmgiCi0KLSNkZWZpbmUgTkJfVFJBQ0sgIDIKLSNkZWZpbmUgU1RFUCAgICAgIDIKLSNkZWZpbmUgTkJfUE9TICAgIDMyCi0jZGVmaW5lIE1TSVpFICAgICAxMDI0Ci0KLS8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCi0qIEZ1bmN0aW9uOiAgQUNFTFBfMnQ2NF9meCgpICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKgotKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICoKLSogMTIgYml0cyBhbGdlYnJhaWMgY29kZWJvb2suICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqCi0qIDIgdHJhY2tzIHggMzIgcG9zaXRpb25zIHBlciB0cmFjayA9IDY0IHNhbXBsZXMuICAgICAgICAgICAgICAgICAgICAgICAgKgotKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICoKLSogMTIgYml0cyAtLT4gMiBwdWxzZXMgaW4gYSBmcmFtZSBvZiA2NCBzYW1wbGVzLiAgICAgICAgICAgICAgICAgICAgICAgICAqCi0qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKgotKiBBbGwgcHVsc2VzIGNhbiBoYXZlIHR3byAoMikgcG9zc2libGUgYW1wbGl0dWRlczogKzEgb3IgLTEuICAgICAgICAgICAgICoKLSogRWFjaCBwdWxzZSBjYW4gaGF2ZSAzMiBwb3NzaWJsZSBwb3NpdGlvbnMuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqCi0qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLQotdm9pZCBBQ0VMUF8ydDY0X2Z4KAotCQlXb3JkMTYgZG5bXSwgICAgICAgICAgICAgICAgICAgICAgICAgIC8qIChpKSA8MTJiIDogY29ycmVsYXRpb24gYmV0d2VlbiB0YXJnZXQgeFtdIGFuZCBIW10gICAgICAqLwotCQlXb3JkMTYgY25bXSwgICAgICAgICAgICAgICAgICAgICAgICAgIC8qIChpKSA8MTJiIDogcmVzaWR1YWwgYWZ0ZXIgbG9uZyB0ZXJtIHByZWRpY3Rpb24gICAgICAgICAqLwotCQlXb3JkMTYgSFtdLCAgICAgICAgICAgICAgICAgICAgICAgICAgIC8qIChpKSBRMTI6IGltcHVsc2UgcmVzcG9uc2Ugb2Ygd2VpZ2h0ZWQgc3ludGhlc2lzIGZpbHRlciAqLwotCQlXb3JkMTYgY29kZVtdLCAgICAgICAgICAgICAgICAgICAgICAgIC8qIChvKSBROSA6IGFsZ2VicmFpYyAoZml4ZWQpIGNvZGVib29rIGV4Y2l0YXRpb24gICAgICAgICAqLwotCQlXb3JkMTYgeVtdLCAgICAgICAgICAgICAgICAgICAgICAgICAgIC8qIChvKSBROSA6IGZpbHRlcmVkIGZpeGVkIGNvZGVib29rIGV4Y2l0YXRpb24gICAgICAgICAgICAqLwotCQlXb3JkMTYgKiBpbmRleCAgICAgICAgICAgICAgICAgICAgICAgIC8qIChvKSA6IGluZGV4ICgxMik6IDUrMSs1KzEgPSAxMSBiaXRzLiAgICAgICAgICAgICAgICAgICAqLwotCQkpCi17Ci0JV29yZDMyIGksIGosIGssIGkwLCBpMSwgaXgsIGl5LCBwb3MsIHBvczI7Ci0JV29yZDE2IHBzLCBwc2ssIHBzMSwgcHMyLCBhbHBrLCBhbHAxLCBhbHAyLCBzcTsKLQlXb3JkMTYgYWxwLCB2YWwsIGV4cCwga19jbiwga19kbjsKLQlXb3JkMTYgKnAwLCAqcDEsICpwMiwgKnBzaWduOwotCVdvcmQxNiAqaCwgKmhfaW52LCAqcHRyX2gxLCAq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oqCi0gKiogICAgIGh0dHA6Ly93d3cuYXBhY2hlLm9yZy9saWNlbnNlcy9MSUNFTlNFLTIuMAotICoqCi0gKiogVW5sZXNzIHJlcXVpcmVkIGJ5IGFwcGxpY2FibGUgbGF3IG9yIGFncmVlZCB0byBpbiB3cml0aW5nLCBzb2Z0d2FyZQotICoqIGRpc3RyaWJ1dGVkIHVuZGVyIHRoZSBMaWNlbnNlIGlzIGRpc3RyaWJ1dGVkIG9uIGFuICJBUyBJUyIgQkFTSVMsCi0gKiogV0lUSE9VVCBXQVJSQU5USUVTIE9SIENPTkRJVElPTlMgT0YgQU5ZIEtJTkQsIGVpdGhlciBleHByZXNzIG9yIGltcGxpZWQuCi0gKiogU2VlIHRoZSBMaWNlbnNlIGZvciB0aGUgc3BlY2lmaWMgbGFuZ3VhZ2UgZ292ZXJuaW5nIHBlcm1pc3Npb25zIGFuZAotICoqIGxpbWl0YXRpb25zIHVuZGVyIHRoZSBMaWNlbnNlLgotICovCi0KLS8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgotKiAgICAgIEZpbGU6IGM0dDY0ZnguYyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqCi0qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICoKLSoJICAgRGVzY3JpcHRpb246UGVyZm9ybXMgYWxnZWJyYWljIGNvZGVib29rIHNlYXJjaCBmb3IgaGlnaGVyIG1vZGVzICoKLSogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKgotKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotCi0vKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCi0qIEZ1bmN0aW9uOiBBQ0VMUF80dDY0X2Z4KCkgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqCi0qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqCi0qIDIwLCAzNiwgNDQsIDUyLCA2NCwgNzIsIDg4IGJpdHMgYWxnZWJyYWljIGNvZGVib29rLiAgICAgICAgICAgICAgICAgICAqCi0qIDQgdHJhY2tzIHggMTYgcG9zaXRpb25zIHBlciB0cmFjayA9IDY0IHNhbXBsZXMuICAgICAgICAgICAgICAgICAgICAgICAqCi0qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqCi0qIDIwIGJpdHMgLS0+IDQgcHVsc2VzIGluIGEgZnJhbWUgb2YgNjQgc2FtcGxlcy4gICAgICAgICAgICAgICAgICAgICAgICAqCi0qIDM2IGJpdHMgLS0+IDggcHVsc2VzIGluIGEgZnJhbWUgb2YgNjQgc2FtcGxlcy4gICAgICAgICAgICAgICAgICAgICAgICAqCi0qIDQ0IGJpdHMgLS0+IDEwIHB1bHNlcyBpbiBhIGZyYW1lIG9mIDY0IHNhbXBsZXMuICAgICAgICAgICAgICAgICAgICAgICAqCi0qIDUyIGJpdHMgLS0+IDEyIHB1bHNlcyBpbiBhIGZyYW1lIG9mIDY0IHNhbXBsZXMuICAgICAgICAgICAgICAgICAgICAgICAqCi0qIDY0IGJpdHMgLS0+IDE2IHB1bHNlcyBpbiBhIGZyYW1lIG9mIDY0IHNhbXBsZXMuICAgICAgICAgICAgICAgICAgICAgICAqCi0qIDcyIGJpdHMgLS0+IDE4IHB1bHNlcyBpbiBhIGZyYW1lIG9mIDY0IHNhbXBsZXMuICAgICAgICAgICAgICAgICAgICAgICAqCi0qIDg4IGJpdHMgLS0+IDI0IHB1bHNlcyBpbiBhIGZyYW1lIG9mIDY0IHNhbXBsZXMuICAgICAgICAgICAgICAgICAgICAgICAqCi0qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqCi0qIEFsbCBwdWxzZXMgY2FuIGhhdmUgdHdvICgyKSBwb3NzaWJsZSBhbXBsaXR1ZGVzOiArMSBvciAtMS4gICAgICAgICAgICAqCi0qIEVhY2ggcHVsc2UgY2FuIGhhdmUgc2l4dGVlbiAoMTYpIHBvc3NpYmxlIHBvc2l0aW9ucy4gICAgICAgICAgICAgICAgICAqCi0qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotCi0jaW5jbHVkZSAidHlwZWRlZi5oIgotI2luY2x1ZGUgImJhc2ljX29wLmgiCi0jaW5jbHVkZSAibWF0aF9vcC5oIgotI2luY2x1ZGUgImFjZWxwLmgiCi0jaW5jbHVkZSAiY25zdC5oIgotCi0jaW5jbHVkZSAicV9wdWxzZS5oIgotCi1zdGF0aWMgV29yZDE2IHRpcG9zWzM2XSA9IHsKLQkwLCAxLCAyLCAzLCAgICAgICAgICAgICAgICAgICAgICAgICAgICAvKiBzdGFydGluZyBwb2ludCAmaXBvc1swXSwgMXN0IGl0ZXIgKi8KLQkxLCAyLCAzLCAwLCAgICAgICAgICAgICAgICAgICAgICAgICAgICAvKiBzdGFydGluZyBwb2ludCAmaXBvc1s0XSwgMm5kIGl0ZXIgKi8KLQkyLCAzLCAwLCAxLCAgICAgICAgICAgICAgICAgICAgICAgICAgICAvKiBzdGFydGluZyBwb2ludCAmaXBvc1s4XSwgM3JkIGl0ZXIgKi8KLQkzLCAwLCAxLCAyLCAgICAgICAgICAgICAgICAgICAgICAgICAgICAvKiBzdGFydGluZyBwb2ludCAmaXBvc1sxMl0sIDR0aCBpdGVyICovCi0JMCwgMSwgMiwgMywKLQkxLCAyLCAzLCAwLAotCTIsIDMsIDAsIDEsCi0JMywgMCwgMSwgMiwKLQkwLCAxLCAyLCAzfTsgICAgICAgICAgICAgICAgICAgICAgICAgICAvKiBlbmQgcG9pbnQgZm9yIDI0IHB1bHNlcyAmaXBvc1szNV0sIDR0aCBpdGVyICovCi0KLSNkZWZpbmUgTkJfUFVMU0VfTUFYICAyNAotCi0jZGVmaW5lIExfU1VCRlIgICA2NAotI2RlZmluZSBOQl9UUkFDSyAgNAotI2RlZmluZSBTVEVQICAgICAgNAotI2RlZmluZSBOQl9QT1MgICAgMTYKLSNkZWZpbmUgTVNJWkUgICAgIDI1NgotI2RlZmluZSBOQl9NQVggICAgOAotI2RlZmluZSBOUE1BWFBUICAgKChOQl9QVUxTRV9NQVgrTkJfVFJBQ0stMSkvTkJfVFJBQ0spCi0KLS8qIFByaXZhdGUgZnVuY3Rpb25zICovCi12b2lkIGNvcl9oX3ZlY18wMTIoCi0JCVdvcmQxNiBoW10sICAgICAgICAgICAgICAgICAgICAgICAgICAgLyogKGkpIHNjYWxlZCBpbXB1bHNlIHJlc3BvbnNlICAgICAgICAgICAgICAgICAqLwotCQlXb3JkMTYgdmVjW10sICAgICAgICAgICAgICAgICAgICAgICAgIC8qIChpKSBzY2FsZWQgdmVjdG9yICgvOCkgdG8gY29ycmVsYXRlIHdpdGggaFtdICovCi0JCVdvcmQxNiB0cmFjaywgICAgICAgICAgICAgICAgICAgICAgICAgLyogKGkpIHRyYWNrIHRvIHVzZSAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotCQlXb3JkMTYgc2lnbltdLCAgICAgICAgICAgICAgICAgICAgICAgIC8qIChpKSBzaWduIHZlY3RvciAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLQkJV29yZDE2IHJyaXhpeFtdW05CX1BPU10sICAgICAgICAgICAgICAvKiAoaSkgY29ycmVsYXRpb24gb2YgaFt4XSB3aXRoIGhbeF0gICAgICAqLwotCQlXb3JkMTYgY29yXzFbXSwgICAgICAgICAgICAgICAgICAgICAgIC8qIChvKSByZXN1bHQgb2YgY29ycmVsYXRpb24gKE5CX1BPUyBlbGVtZW50cykgKi8KLQkJV29yZDE2IGNvcl8yW10gICAgICAgICAgICAgICAgICAgICAgICAvKiAobykgcmVzdWx0IG9mIGNvcnJlbGF0aW9uIChOQl9QT1MgZWxlbWVudHMpICovCi0JCSk7Ci0KLXZvaWQgY29yX2hfdmVjXzAxMl9hc20oCi0JCVdvcmQxNiBoW10sICAgICAgICAgICAgICAgICAgICAgICAgICAgLyogKGkpIHNjYWxlZCBpbXB1bHNlIHJlc3BvbnNlICAgICAgICAgICAgICAgICAqLwotCQlXb3JkMTYgdmVjW10sICAgICAgICAgICAgICAgICAgICAgICAgIC8qIChpKSBzY2FsZWQgdmVjdG9yICgvOCkgdG8gY29ycmVsYXRlIHdpdGggaFtdICovCi0JCVdvcmQxNiB0cmFjaywgICAgICAgICAgICAgICAgICAgICAgICAgLyogKGkpIHRyYWNrIHRvIHVzZSAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotCQlXb3JkMTYgc2lnbltdLCAgICAgICAgICAgICAgICAgICAgICAgIC8qIChpKSBzaWduIHZlY3RvciAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLQkJV29yZDE2IHJyaXhpeFtdW05CX1BPU10sICAgICAgICAgICAgICAvKiAoaSkgY29ycmVsYXRpb24gb2YgaFt4XSB3aXRoIGhbeF0gICAgICAqLwotCQlXb3JkMTYgY29yXzFbXSwgICAgICAgICAgICAgICAgICAgICAgIC8qIChvKSByZXN1bHQgb2YgY29ycmVsYXRpb24gKE5CX1BPUyBlbGVtZW50cykgKi8KLQkJV29yZDE2IGNvcl8yW10gICAgICAgICAgICAgICAgICAgICAgICAvKiAobykgcmVzdWx0IG9mIGNvcnJlbGF0aW9uIChOQl9QT1MgZWxlbWVudHMpICovCi0JCSk7Ci0KLXZvaWQgY29yX2hfdmVjXzMwKAotCQlXb3JkMTYgaFtdLCAgICAgICAgICAgICAgICAgICAgICAgICAgIC8qIChpKSBzY2FsZWQgaW1wdWxzZSByZXNwb25zZSAgICAgICAgICAgICAgICAgKi8KLQkJV29yZDE2IHZlY1tdLCAgICAgICAgICAgICAgICAgICAgICAgICAvKiAoaSkgc2NhbGVkIHZlY3RvciAoLzgpIHRvIGNvcnJlbGF0ZSB3aXRoIGhbXSAqLwotCQlXb3JkMTYgdHJhY2ssICAgICAgICAgICAgICAgICAgICAgICAgIC8qIChpKSB0cmFjayB0byB1c2UgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLQkJV29yZDE2IHNpZ25bXSwgICAgICAgICAgICAgICAgICAgICAgICAvKiAoaSkgc2lnbiB2ZWN0b3IgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0JCVdvcmQxNiBycml4aXhbXVtOQl9QT1NdLCAgICAgICAgICAgICAgLyogKGkpIGNvcnJlbGF0aW9uIG9mIGhbeF0gd2l0aCBoW3hdICAgICAgKi8KLQkJV29yZDE2IGNvcl8xW10sICAgICAgICAgICAgICAgICAgICAgICAvKiAobykgcmVzdWx0IG9mIGNvcnJlbGF0aW9uIChOQl9QT1MgZWxlbWVudHMpICovCi0JCVdvcmQxNiBjb3JfMltdICAgICAgICAgICAgICAgICAgICAgICAgLyogKG8pIHJlc3VsdCBvZiBjb3JyZWxhdGlvbiAoTkJfUE9TIGVsZW1lbnRzKSAqLwotCQkpOwotCi12b2lkIHNlYXJjaF9peGl5KAotCQlXb3JkMTYgbmJfcG9zX2l4LCAgICAgICAgICAgICAgICAgICAgIC8qIChpKSBuYiBvZiBwb3MgZm9yIHB1bHNlIDEgKDEuLjgpICAgICAgICovCi0JCVdvcmQxNiB0cmFja194LCAgICAgICAgICAgICAgICAgICAgICAgLyogKGkpIHRyYWNrIG9mIHB1bHNlIDEgICAgICAgICAgICAgICAgICAgKi8KLQkJV29yZDE2IHRyYWNrX3ksICAgICAgICAgICAgICAgICAgICAgICAvKiAoaSkgdHJhY2sgb2YgcHVsc2UgMiAgICAgICAgICAgICAgICAgICAqLwotCQlXb3JkMTYgKiBwcywgICAgICAgICAgICAgICAgICAgICAgICAgIC8qIChpL28pIGNvcnJlbGF0aW9uIG9mIGFsbCBmaXhlZCBwdWxzZXMgICovCi0JCVdvcmQxNiAqIGFscCwgICAgICAgICAgICAgICAgICAgICAgICAgLyogKGkvbykgZW5lcmd5IG9mIGFsbCBmaXhlZCBwdWxzZXMgICAgICAgKi8KLQkJV29yZDE2ICogaXgsICAgICAgICAgICAgICAgICAgICAgICAgICAvKiAobykgcG9zaXRpb24gb2YgcHVsc2UgMSAgICAgICAgICAgICAgICAqLwotCQlXb3JkMTYgKiBpeSwgICAgICAgICAgICAgICAgICAgICAgICAgIC8qIChvKSBwb3NpdGlvbiBvZiBwdWxzZSAyICAgICAgICAgICAgICAgICovCi0JCVdvcmQxNiBkbltdLCAgICAgICAgICAgICAgICAgICAgICAgICAgLyogKGkpIGNvcnIuIGJldHdlZW4gdGFyZ2V0IGFuZCBoW10gICAgICAgKi8KLQkJV29yZDE2IGRuMltdLCAgICAgICAgICAgICAgICAgICAgICAgICAvKiAoaSkgdmVjdG9yIG9mIHNlbGVjdGVkIHBvc2l0aW9ucyAgICAgICAqLwotCQlXb3JkMTYgY29yX3hbXSwgICAgICAgICAgICAgICAgICAgICAgIC8qIChpKSBjb3JyLiBvZiBwdWxzZSAxIHdpdGggZml4ZWQgcHVsc2VzICovCi0JCVdvcmQxNiBjb3JfeVtdLCAgICAgICAgICAgICAgICAgICAgICAgLyogKGkpIGNvcnIuIG9mIHB1bHNlIDIgd2l0aCBmaXhlZCBwdWxzZXMgKi8KLQkJV29yZDE2IHJyaXhpeVtdW01TSVpFXSAgICAgICAgICAgICAgICAvKiAoaSkgY29yci4gb2YgcHVsc2UgMSB3aXRoIHB1bHNlIDIgICAqLwotCQkpOwotCi0KLXZvaWQgQUNFTFBfNHQ2NF9meCgKLQkJV29yZDE2IGRuW10sICAgICAgICAgICAgICAgICAgICAgICAgICAvKiAoaSkgPDEyYiA6IGNvcnJlbGF0aW9uIGJldHdlZW4gdGFyZ2V0IHhbXSBhbmQgSFtdICAgICAgKi8KLQkJV29yZDE2IGNuW10sICAgICAgICAgICAgICAgICAgICAgICAgICAvKiAoaSkgPDEyYiA6IHJlc2lkdWFsIGFmdGVyIGxvbmcgdGVybSBwcmVkaWN0aW9uICAgICAgICAgKi8KLQkJV29yZDE2IEhbXSwgICAgICAgICAgICAgICAgICAgICAgICAgICAvKiAoaSkgUTEyOiBpbXB1bHNlIHJlc3BvbnNlIG9mIHdlaWdodGVkIHN5bnRoZXNpcyBmaWx0ZXIgKi8KLQkJV29yZDE2IGNvZGVbXSwgICAgICAgICAgICAgICAgICAgICAgICAvKiAobykgUTkgOiBhbGdlYnJhaWMgKGZpeGVkKSBjb2RlYm9vayBleGNpdGF0aW9uICAgICAgICAgKi8KLQkJV29yZDE2IHlbXSwgICAgICAgICAgICAgICAgICAgICAgICAgICAvKiAobykgUTkgOiBmaWx0ZXJlZCBmaXhlZCBjb2RlYm9vayBleGNpdGF0aW9uICAgICAgICAgICAgKi8KLQkJV29yZDE2IG5iYml0cywgICAgICAgICAgICAgICAgICAgICAgICAvKiAoaSkgOiAyMCwgMzYsIDQ0LCA1MiwgNjQsIDcyIG9yIDg4IGJpdHMgICAgICAgICAgICAgICAgKi8KLQkJV29yZDE2IHNlcl9zaXplLCAgICAgICAgICAgICAgICAgICAgICAvKiAoaSkgOiBiaXQgcmF0ZSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLQkJV29yZDE2IF9pbmRleFtdICAgICAgICAgICAgICAgICAgICAgICAvKiAobykgOiBpbmRleCAoMjApOiA1KzUrNSs1ID0gMjAgYml0cy4gICAgICAgICAgICAgICAgICAgKi8KLQkJLyogKG8pIDogaW5kZXggKDM2KTogOSs5KzkrOSA9IDM2IGJpdHMuICAgICAgICAgICAgICAgICAgICovCi0JCS8qIChvKSA6IGluZGV4ICg0NCk6IDEzKzkrMTMrOSA9ID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NJWkVdOwotCVdvcmQxNiBpcG9zW05CX1BVTFNFX01BWF07Ci0KLQlzd2l0Y2ggKG5iYml0cykKLQl7Ci0JCWNhc2UgMjA6ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8qIDIwIGJpdHMsIDQgcHVsc2VzLCA0IHRyYWNrcyAqLwotCQkJbmJpdGVyID0gNDsgICAgICAgICAgICAgICAgICAgICAgICAgIC8qIDR4MTZ4MTY9MTAyNCBsb29wICovCi0JCQlhbHAgPSA4MTkyOyAgICAgICAgICAgICAgICAgICAgICAgICAgLyogYWxwID0gMi4wIChRMTIpICovCi0JCQluYl9wdWxzZSA9IDQ7Ci0JCQluYnBvc1swXSA9IDQ7Ci0JCQluYnBvc1sxXSA9IDg7Ci0JCQlicmVhazsKLQkJY2FzZSAzNjogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLyogMzYgYml0cywgOCBwdWxzZXMsIDQgdHJhY2tzICovCi0JCQluYml0ZXIgPSA0OyAgICAgICAgICAgICAgICAgICAgICAgICAgLyogNHgyMHgxNj0xMjgwIGxvb3AgKi8KLQkJCWFscCA9IDQwOTY7ICAgICAgICAgICAgICAgICAgICAgICAgICAvKiBhbHAgPSAxLjAgKFExMikgKi8KLQkJCW5iX3B1bHNlID0gODsKLQkJCW5icG9zWzBdID0gNDsKLQkJCW5icG9zWzFdID0gODsKLQkJCW5icG9zWzJdID0gODsKLQkJCWJyZWFrOwotCQljYXNlIDQ0OiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvKiA0NCBiaXRzLCAxMCBwdWxzZXMsIDQgdHJhY2tzICovCi0JCQluYml0ZXIgPSA0OyAgICAgICAgICAgICAgICAgICAgICAgICAgLyogNHgyNngxNj0xNjY0IGxvb3AgKi8KLQkJCWFscCA9IDQwOTY7ICAgICAgICAgICAgICAgICAgICAgICAgICAvKiBhbHAgPSAxLjAgKFExMikgKi8KLQkJCW5iX3B1bHNlID0gMTA7Ci0JCQluYnBvc1swXSA9IDQ7Ci0JCQluYnBvc1sxXSA9IDY7Ci0JCQluYnBvc1syXSA9IDg7Ci0JCQluYnBvc1szXSA9IDg7Ci0JCQlicmVhazsKLQkJY2FzZSA1MjogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLyogNTIgYml0cywgMTIgcHVsc2VzLCA0IHRyYWNrcyAqLwotCQkJbmJpdGVyID0gNDsgICAgICAgICAgICAgICAgICAgICAgICAgIC8qIDR4MjZ4MTY9MTY2NCBsb29wICovCi0JCQlhbHAgPSA0MDk2OyAgICAgICAgICAgICAgICAgICAgICAgICAgLyogYWxwID0gMS4wIChRMTIpICovCi0JCQluYl9wdWxzZSA9IDEyOwotCQkJbmJwb3NbMF0gPSA0OwotCQkJbmJwb3NbMV0gPSA2OwotCQkJbmJwb3NbMl0gPSA4OwotCQkJbmJwb3NbM10gPSA4OwotCQkJYnJlYWs7Ci0JCWNhc2UgNjQ6ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8qIDY0IGJpdHMsIDE2IHB1bHNlcywgNCB0cmFja3MgKi8KLQkJCW5iaXRlciA9IDM7ICAgICAgICAgICAgICAgICAgICAgICAgICAvKiAzeDM2eDE2PTE3MjggbG9vcCAqLwotCQkJYWxwID0gMzI3NzsgICAgICAgICAgICAgICAgICAgICAgICAgIC8qIGFscCA9IDAuOCAoUTEyKSAqLwotCQkJbmJfcHVsc2UgPSAxNjsKLQkJCW5icG9zWzBdID0gNDsKLQkJCW5icG9zWzFdID0gNDsKLQkJCW5icG9zWzJdID0gNjsKLQkJCW5icG9zWzNdID0gNjsKLQkJCW5icG9zWzRdID0gODsKLQkJCW5icG9zWzVdID0gODsKLQkJCWJyZWFrOwotCQljYXNlIDcyOiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvKiA3MiBiaXRzLCAxOCBwdWxzZXMsIDQgdHJhY2tzICovCi0JCQluYml0ZXIgPSAzOyAgICAgICAgICAgICAgICAgICAgICAgICAgLyogM3gzNXgxNj0xNjgwIGxvb3AgKi8KL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tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0qCi0gKiBGdW5jdGlvbiAgY29yX2hfdmVjKCkgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqCi0gKiB+fn5+fn5+fn5+fn5+fn5+fn5+fn4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqCi0gKiBDb21wdXRlIGNvcnJlbGF0aW9ucyBvZiBoW10gd2l0aCB2ZWNbXSBmb3IgdGhlIHNwZWNpZmllZCB0cmFjay4gICAqCi0gKi0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0qLwotdm9pZCBjb3JfaF92ZWNfMzAoCi0JCVdvcmQxNiBoW10sICAgICAgICAgICAgICAgICAgICAgICAgICAgLyogKGkpIHNjYWxlZCBpbXB1bHNlIHJlc3BvbnNlICAgICAgICAgICAgICAgICAqLwotCQlXb3JkMTYgdmVjW10sICAgICAgICAgICAgICAgICAgICAgICAgIC8qIChpKSBzY2FsZWQgdmVjdG9yICgvOCkgdG8gY29ycmVsYXRlIHdpdGggaFtdICovCi0JCVdvcmQxNiB0cmFjaywgICAgICAgICAgICAgICAgICAgICAgICAgLyogKGkpIHRyYWNrIHRvIHVzZSAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotCQlXb3JkMTYgc2lnbltdLCAgICAgICAgICAgICAgICAgICAgICAgIC8qIChpKSBzaWduIHZlY3RvciAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLQkJV29yZDE2IHJyaXhpeFtdW05CX1BPU10sICAgICAgICAgICAgICAvKiAoaSkgY29ycmVsYXRpb24gb2YgaFt4XSB3aXRoIGhbeF0gICAgICAqLwotCQlXb3JkMTYgY29yXzFbXSwgICAgICAgICAgICAgICAgICAgICAgIC8qIChvKSByZXN1bHQgb2YgY29ycmVsYXRpb24gK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BGaW5kIHRoZSBiZXN0IHBvc2l0aW9ucyBvZiAyIHB1bHNlcyBpbiBhIHN1YmZyYW1lLiAgICAgICAgICAgICAgICAqCi0gKi0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0qLwotCi12b2lkIHNlYXJjaF9peGl5KAotCQlXb3JkMTYgbmJfcG9zX2l4LCAgICAgICAgICAgICAgICAgICAgIC8qIChpKSBuYiBvZiBwb3MgZm9yIHB1bHNlIDEgKDEuLjgpICAgICAgICovCi0JCVdvcmQxNiB0cmFja194LCAgICAgICAgICAgICAgICAgICAgICAgLyogKGkpIHRyYWNrIG9mIHB1bHNlIDEgICAgICAgICAgICAgICAgICAgKi8KLQkJV29yZDE2IHRyYWNrX3ksICAgICAgICAgICAgICAgICAgICAgICAvKiAoaSkgdHJhY2sgb2YgcHVsc2UgMiAgICAgICAgICAgICAgICAgICAqLwotCQlXb3JkMTYgKiBwcywgICAgICAgICAgICAgICAgICAgICAgICAgIC8qIChpL28pIGNvcnJlbGF0aW9uIG9mIGFsbCBmaXhlZCBwdWxzZXMgICovCi0JCVdvcmQxNiAqIGFscCwgICAgICAgICAgICAgICAgICAgICAgICAgLyogKGkvbykgZW5lcmd5IG9mIGFsbCBmaXhlZCBwdWxzZXMgICAgICAgKi8KLQkJV29yZDE2ICogaXgsICAgICAgICAgICAgICAgICAgICAgICAgICAvKiAobykgcG9zaXRpb24gb2YgcHVsc2UgMSAgICAgICAgICAgICAgICAqLwotCQlXb3JkMTYgKiBpeSwgICAgICAgICAgICAgICAgICAgICAgICAgIC8qIChvKSBwb3NpdGlvbiBvZiBwdWxzZSAyICAgICAgICAgICAgICAgICovCi0JCVdvcmQxNiBkbltdLCAgICAgICAgICAgICAgICAgICAgICAgICAgLyogKGkpIGNvcnIuIGJldHdlZW4gdGFyZ2V0IGFuZCBoW10gICAgICAgKi8KLQkJV29yZDE2IGRuMltd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ICAgICAgICAgICAgIGFuZCB3cml0ZSB0aGUgcmVzdWx0IGluIHRoZSB2ZWN0b3IgeVtdCi0KLSoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLQotI2luY2x1ZGUgInR5cGVkZWYuaCIKLSNpbmNsdWRlICJiYXNpY19vcC5oIgotCi12b2lkIENvbnZvbHZlICgKLQkJV29yZDE2IHhbXSwgICAgICAgIC8qIChpKSAgICAgOiBpbnB1dCB2ZWN0b3IgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotCQlXb3JkMTYgaFtdLCAgICAgICAgLyogKGkpICAgICA6IGltcHVsc2UgcmVzcG9uc2UgICAgICAgICAgICAgICAgICAgICAgICovCi0JCVdvcmQxNiB5W10sICAgICAgICAvKiAobykgICAgIDogb3V0cHV0IHZlY3RvciAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLQkJV29yZDE2IEwgICAgICAgICAgIC8qIChpKSAgICAgOiB2ZWN0b3Igc2l6ZSAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotCSAgICAgICkKLXsKLQlXb3JkMzIgIGksIG47Ci0JV29yZDE2ICp0bXBILCp0bXBYOwotCVdvcmQzMiBzOwotCWZvciAobiA9IDA7IG4gPCA2NDspCi0JewotCQl0bXBIID0gaCtuOwotCQl0bXBYID0geDsKLQkJaT1uKzE7Ci0JCXMgPSB2b19tdWx0MzIoKCp0bXBYKyspLCAoKnRtcEgtLSkpO2ktLTsKLQkJd2hpbGUoaT4wKQotCQl7Ci0JCQlzICs9IHZvX211bHQzMigoKnRtcFgrKyksICgqdG1wSC0tKSk7Ci0JCQlzICs9IHZvX211bHQzMigoKnRtcFgrKyksICgqdG1wSC0tKSk7Ci0JCQlzICs9IHZvX211bHQzMigoKnRtcFgrKyksICgqdG1wSC0tKSk7Ci0JCQlzICs9IHZvX211bHQzMigoKnRtcFgrKyksICgqdG1wSC0tKSk7Ci0JCQlp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qIFlvdSBtYXkgb2J0YWluIGEgY29weSBvZiB0aGUgTGljZW5zZSBhdAotICoqCi0gKiogICAgIGh0dHA6Ly93d3cuYXBhY2hlLm9yZy9saWNlbnNlcy9MSUNFTlNFLTIuMAotICoqCi0gKiogVW5sZXNzIHJlcXVpcmVkIGJ5IGFwcGxpY2FibGUgbGF3IG9yIGFncmVlZCB0byBpbiB3cml0aW5nLCBzb2Z0d2FyZQotICoqIGRpc3RyaWJ1dGVkIHVuZGVyIHRoZSBMaWNlbnNlIGlzIGRpc3RyaWJ1dGVkIG9uIGFuICJBUyBJUyIgQkFTSVMsCi0gKiogV0lUSE9VVCBXQVJSQU5USUVTIE9SIENPTkRJVElPTlMgT0YgQU5ZIEtJTkQsIGVpdGhlciBleHByZXNzIG9yIGltcGxpZWQuCi0gKiogU2VlIHRoZSBMaWNlbnNlIGZvciB0aGUgc3BlY2lmaWMgbGFuZ3VhZ2UgZ292ZXJuaW5nIHBlcm1pc3Npb25zIGFuZAotICoqIGxpbWl0YXRpb25zIHVuZGVyIHRoZSBMaWNlbnNlLgotICovCi0KLS8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgotKiAgICAgICBGaWxlOiBjb3JfaF94LmMgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqCi0qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICoKLSoJICAgRGVzY3JpcHRpb246Q29tcHV0ZSBjb3JyZWxhdGlvbiBiZXR3ZWVuIHRhcmdldCAieFtdIiBhbmQgImhbXSIgICoKLSoJICAgICAgICAgICAgICAgRGVzaWduZWQgZm9yIGNvZGVib29rIHNlYXJjaCAoMjQgcHVsc2VzLCA0IHRyYWNrcywgICoKLSoJCQkJICAgNCBwdWxzZXMgcGVyIHRyYWNrLCAxNiBwb3NpdGlvbnMgaW4gZWFjaCB0cmFjaykgdG8gICoKLSoJCQkJICAgYXZvaWQgc2F0dXJhdGlvbi4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICoKLSogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKgotKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotCi0jaW5jbHVkZSAidHlwZWRlZi5oIgotI2luY2x1ZGUgImJhc2ljX29wLmgiCi0jaW5jbHVkZSAibWF0aF9vcC5oIgotCi0jZGVmaW5lIExfU1VCRlIgICA2NAotI2RlZmluZSBOQl9UUkFDSyAgNAotI2RlZmluZSBTVEVQICAgICAgNAotCi12b2lkIGNvcl9oX3goCi0JCVdvcmQxNiBoW10sICAgICAgICAgICAgICAgICAgICAgICAgICAgLyogKGkpIFExMiA6IGltcHVsc2UgcmVzcG9uc2Ugb2Ygd2VpZ2h0ZWQgc3ludGhlc2lzIGZpbHRlciAqLwotCQlXb3JkMTYgeFtdLCAgICAgICAgICAgICAgICAgICAgICAgICAgIC8qIChpKSBRMCAgOiB0YXJnZXQgdmVjdG9yICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLQkJV29yZDE2IGRuW10gICAgICAgICAgICAgICAgICAgICAgICAgICAvKiAobykgPDEyYml0IDogY29ycmVsYXRpb24gYmV0d2VlbiB0YXJnZXQgYW5kIGhbXSAgICAgICAgICovCi0JICAgICkKLXsKLQlXb3JkMzIgaSwgajsKLQlXb3JkMzIgTF90bXAsIHkzMltMX1NVQkZSXSwgTF90b3Q7Ci0JV29yZDE2ICpwMSwgKnAyOwotCVdvcmQzMiAqcDM7Ci0JV29yZDMyIExfbWF4LCBMX21heDEsIExfbWF4MiwgTF9tYXgzOwotCS8qIGZpcnN0IGtlZXAgdGhlIHJlc3VsdCBvbiAzMiBiaXRzIGFuZCBmaW5kIGFic29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VElFUyBPUiBDT05ESVRJT05TIE9GIEFOWSBLSU5ELCBlaXRoZXIgZXhwcmVzcyBvciBpbXBsaWVkLgotICoqIFNlZSB0aGUgTGljZW5zZSBmb3IgdGhlIHNwZWNpZmljIGxhbmd1YWdlIGdvdmVybmluZyBwZXJtaXNzaW9ucyBhbmQKLSAqKiBsaW1pdGF0aW9ucyB1bmRlciB0aGUgTGljZW5zZS4KLSAqLwotCi0vKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKLSogICAgICBGaWxlOiBkZWNpbTU0LmMgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKgotKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqCi0qCSAgIERlc2NyaXB0aW9uOkRlY2ltYXRpb24gb2YgMTZrSHogc2lnbmFsIHRvIDEyLjhrSHogICAgICAgICAgICoKLSogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKgotKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotCi0jaW5jbHVkZSAidHlwZWRlZi5oIgotI2luY2x1ZGUgImJhc2ljX29wLmgiCi0jaW5jbHVkZSAiYWNlbHAuaCIKLSNpbmNsdWRlICJjbnN0LmgiCi0KLSNkZWZpbmUgRkFDNSAgIDUKLSNkZWZpbmUgRE9XTl9GQUMgIDI2MjE1ICAgICAgICAgICAgICAgICAgICAvKiA0LzUgaW4gUTE1ICovCi0KLSNkZWZpbmUgTkJfQ09FRl9ET1dOICAxNQotCi0vKiBMb2NhbCBmdW5jdGlvbnMgKi8KLXN0YXRpYyB2b2lkIERvd25fc2FtcCgKLQkJV29yZDE2ICogc2lnLCAgICAgICAgICAgICAg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CBWZXJzaW9uIDIuMCAodGhlICJMaWNlbnNlIik7Ci0gKiogeW91IG1heSBub3QgdXNlIHRoaXMgZmlsZSBleGNlcHQgaW4gY29tcGxpYW5jZSB3aXRoIHRoZSBMaWNlbnNlLgotICoqIFlvdSBtYXkgb2J0YWluIGEgY29weSBvZiB0aGUgTGljZW5zZSBhdAotICoqCi0gKiogICAgIGh0dHA6Ly93d3cuYXBhY2hlLm9yZy9saWNlbnNlcy9MSUNFTlNFLTIuMAotICoqCi0gKiogVW5sZXNzIHJlcXVpcmVkIGJ5IGFwcGxpY2FibGUgbGF3IG9yIGFncmVlZCB0byBpbiB3cml0aW5nLCBzb2Z0d2FyZQotICoqIGRpc3RyaWJ1dGVkIHVuZGVyIHRoZSBMaWNlbnNlIGlzIGRpc3RyaWJ1dGVkIG9uIGFuICJBUyBJUyIgQkFTSVMsCi0gKiogV0lUSE9VVCBXQVJSQU5USUVTIE9SIENPTkRJVElPTlMgT0YgQU5ZIEtJTkQsIGVpdGhlciBleHByZXNzIG9yIGltcGxpZWQuCi0gKiogU2VlIHRoZSBMaWNlbnNlIGZvciB0aGUgc3BlY2lmaWMgbGFuZ3VhZ2UgZ292ZXJuaW5nIHBlcm1pc3Npb25zIGFuZAotICoqIGxpbWl0YXRpb25zIHVuZGVyIHRoZSBMaWNlbnNlLgotICovCi0KLS8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgotKiAgICAgICBGaWxlOiBkZWVtcGguYyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqCi0qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICoKLSoJICAgRGVzY3JpcHRpb246ZmlsdGVyaW5nIHRocm91Z2ggMS8oMS1tdSB6XiAtMSkgICAgICAgICAgICAgICAgICAgICoKLSoJICAgICAgICAgICAgICAgRGVlbXBoMiAtLT4gc2lnbmFsIGlzIGRpdmlkZWQgYnkgMiAgICAgICAgICAgICAgICAgICoKLSoJCQkJICAgRGVlbXBoXzMyIC0tPiBmb3IgMzIgYml0cyBzaWduYWwuICAgICAgICAgICAgICAgICAgICoKLSogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKgotKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotCi0jaW5jbHVkZSAidHlwZWRlZi5oIgotI2luY2x1ZGUgImJhc2ljX29wLmgiCi0jaW5jbHVkZSAibWF0aF9vcC5oIgotCi12b2lkIERlZW1waCgKLQkJV29yZDE2IHhbXSwgICAgICAgICAgICAgICAgICAgICAgICAgICAvKiAoaS9vKSAgIDogaW5wdXQgc2lnbmFsIG92ZXJ3cml0dGVuIGJ5IHRoZSBvdXRwdXQgKi8KLQkJV29yZDE2IG11LCAgICAgICAgICAgICAgICAgICAgICAgICAgICAvKiAoaSkgUTE1IDogZGVlbXBoYXNpcyBmYWN0b3IgICAgICAgICAgICAgICAgICAgICAgKi8KLQkJV29yZDE2IEwsICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvKiAoaSkgICAgIDogdmVjdG9yIHNpemUgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLQkJV29yZDE2ICogbWVtICAgICAgICAgICAgICAgICAgICAgICAgICAvKiAoaS9vKSAgIDogbWVtb3J5ICh5Wy0xXSkgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLQkgICApCi17Ci0JV29yZDMyIGk7Ci0JV29yZDMyIExfdG1wOwotCi0JTF90bXAgPSBMX2RlcG9zaXRfaCh4WzBdKTsKLQlMX3RtcCA9IExfbWFjKExfdG1wLCAqbWVtLCBtdSk7Ci0JeFswXSA9IHZvX3JvdW5kKExfdG1wKTsKLQotCWZvciAoaSA9IDE7IGkgPCBMOyBpKyspCi0JewotCQlMX3RtcCA9IExfZGVwb3NpdF9oKHhbaV0pOwotCQlMX3RtcCA9IExfbWFjKExfdG1wLCB4W2kgLSAxXSwgbXUpOwotCQl4W2ldID0gdm9yb3VuZChMX3RtcCk7Ci0JfQotCi0JKm1lbSA9IHhbTCAtIDFdOwotCi0JcmV0dXJuOwotfQotCi0KLXZvaWQgRGVlbXBoMigKLQkJV29yZDE2IHhbXSwgICAgICAgICAgICAgICAgICAgICAgICAgICAvKiAoaS9vKSAgIDogaW5wdXQgc2lnbmFsIG92ZXJ3cml0dGVuIGJ5IHRoZSBvdXRwdXQgKi8KLQkJV29yZDE2IG11LCAgICAgICAgICAgICAgICAgICAgICAgICAgICAvKiAoaSkgUTE1IDogZGVlbXBoYXNpcyBmYWN0b3IgICAgICAgICAgICAgICAgICAgICAgKi8KLQkJV29yZDE2IEwsICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvKiAoaSkgICAgIDogdmVjdG9yIHNpemUgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLQkJV29yZDE2ICogbWVtICAgICAgICAgICAgICAgICAgICAgICAgICAvKiAoaS9vKSAgIDogbWVtb3J5ICh5Wy0xXSkgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLQkgICAgKQotewotCVdvcmQzMiBpOwotCVdvcmQzMiBMX3RtcDsKLQlMX3RtcCA9IHhbMF0gPDwgMTU7Ci0JTF90bXAgKz0gKCgqbWVtKSAqIG11KTw8MTsKLQl4WzBdID0gKExfdG1wICsgMHg4MDAwKT4+MTY7Ci0JZm9yIChpID0gMTsgaSA8IEw7IGkrKykKLQl7Ci0JCUxfdG1wID0geFtpXSA8PCAxNTsKLQkJTF90bXAgKz0gKHhbaSAtIDFdICogbXUpPDwxOwotCQl4W2ldID0gKExfdG1wICsgMHg4MDAwKT4+MTY7Ci0JfQotCSptZW0gPSB4W0wgLSAxXTsKLQlyZXR1cm47Ci19Ci0KLQotdm9pZCBEZWVtcGhfMzIoCi0JCVdvcmQxNiB4X2hpW10sICAgICAgICAgICAgICAgICAgICAgICAgLyogKGkpICAgICA6IGlucHV0IHNpZ25hbCAoYml0MzEuLjE2KSAqLwotCQlXb3JkMTYgeF9sb1tdLCAgICAgICAgICAgICAgICAgICAgICAgIC8qIChpKSAgICAgOiBpbnB1dCBzaWduYWwgKGJpdDE1Li40KSAgKi8KLQkJV29yZDE2IHlbXSwgICAgICAgICAgICAgICAgICAgICAgICAgICAvKiAobykgICAgIDogb3V0cHV0IHNpZ25hbCAoeDE2KSAgICAgICovCi0JCVdvcmQxNiBtdSwgICAgICAgICAgICAgICAgICAgICAgICAgICAgLyogKGkpIFExNSA6IGRlZW1waGFzaXMgZmFjdG9yICAgICAgICAqLwotCQlXb3JkMTYgTCwgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8qIChpKSAgICAgOiB2ZWN0b3Igc2l6ZSAgICAgICAgICAgICAgKi8KLQkJV29yZDE2ICogbWVtICAgICAgICAgICAgICAgICAgICAgICAgICAvKiAoaS9vKSAgIDogbWVtb3J5ICh5Wy0xXSkgICAgICAgICAgICovCi0JICAgICAgKQotewotCVdvcmQxNiBmYWM7Ci0JV29yZDMyIGksIExfdG1wOwotCi0JZmFjID0gbXUgPj4gMTsgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8qIFExNSAtLT4gUTE0ICovCi0KLQlMX3RtcCA9IExfZGVwb3NpdF9oKHhfaGlbMF0pOwotCUxfdG1wICs9ICh4X2xvWzBdICogOCk8PDE7Ci0JTF90bXAgPSAoTF90bXAgPDwgMyk7Ci0JTF90bXAgKz0gKCgqbWVtKSAqIGZhYyk8PDE7Ci0JTF90bXAgPSAoTF90bXAgPDwgMSk7Ci0JeVswXSA9IChMX3RtcCArIDB4ODAwMCk+PjE2OwotCi0JZm9yIChpID0gMTsgaSA8IEw7IGkrKykKLQl7Ci0JCUxfdG1wID0gTF9kZXBvc2l0X2goeF9oaVtpXSk7Ci0JCUxfdG1wICs9ICh4X2xvW2ldICogOC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ZSBMaWNlbnNlIGlzIGRpc3RyaWJ1dGVkIG9uIGFuICJBUyBJUyIgQkFTSVMsCi0gKiogV0lUSE9VVCBXQVJSQU5USUVTIE9SIENPTkRJVElPTlMgT0YgQU5ZIEtJTkQsIGVpdGhlciBleHByZXNzIG9yIGltcGxpZWQuCi0gKiogU2VlIHRoZSBMaWNlbnNlIGZvciB0aGUgc3BlY2lmaWMgbGFuZ3VhZ2UgZ292ZXJuaW5nIHBlcm1pc3Npb25zIGFuZAotICoqIGxpbWl0YXRpb25zIHVuZGVyIHRoZSBMaWNlbnNlLgotICovCi0KLS8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgotKiAgICAgICBGaWxlOiBkdHguYyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqCi0qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICoKLSoJICAgIERlc2NyaXB0aW9uOkRUWCBmdW5jdGlvbnMgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKgotKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqCi0qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0KLSNpbmNsdWRlIDxzdGRpby5oPgotI2luY2x1ZGUgPHN0ZGxpYi5oPgotI2luY2x1ZGUgInR5cGVkZWYuaCIKLSNpbmNsdWRlICJiYXNpY19vcC5oIgotI2luY2x1ZGUgIm9wZXJfMzJiLmgiCi0jaW5jbHVkZSAibWF0aF9vcC5oIgotI2luY2x1ZGUgImNuc3QuaCIKLSNpbmNsdWRlICJhY2VscC5oIiAgICAgICAgICAgICAgICAgICAgICAgICAvKiBwcm90b3R5cGUgb2YgZnVuY3Rpb25zICAgICovCi0jaW5jbHVkZSAiYml0cy5oIgotI2luY2x1ZGUgImR0eC5oIgotI2luY2x1ZGUgImxvZzIuaCIKLSNpbmNsdWRlICJtZW1fYWxpZ24uaCIKLQotc3RhdGljIHZvaWQgYXZlcl9pc2ZfaGlzdG9yeSgKLQkJV29yZDE2IGlzZl9vbGRbXSwKLQkJV29yZDE2IGluZGljZXNbXSwKLQkJV29yZDMyIGlzZl9hdmVyW10KLQkJKTsKLQotc3RhdGljIHZvaWQgZmluZF9mcmFtZV9pbmRpY2VzKAotCQlXb3JkMTYgaXNmX29sZF90eFtdLAotCQlXb3JkMTYgaW5kaWNlc1tdLAotCQlkdHhfZW5jU3RhdGUgKiBzdAotCQkpOwotCi1zdGF0aWMgV29yZDE2IGRpdGhlcmluZ19jb250cm9sKAotCQlkdHhfZW5jU3RhdGUgKiBzdAotCQkpOwotCi0vKiBleGNpdGF0aW9uIGVuZXJneSBhZGp1c3RtZW50IGRlcGVuZGluZyBvbiBzcGVlY2ggY29kZXIgbW9kZSB1c2VkLCBRNyAqLwotc3RhdGljIFdvcmQxNiBlbl9hZGp1c3RbOV0gPQotewotCTIzMCwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8qIG1vZGUwID0gN2sgIDogIC01LjRkQiAgKi8KLQkxNzksICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvKiBtb2RlMSA9IDlrICA6ICAtNC4yZEIgICovCi0JMTQxLCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLyogbW9kZTIgPSAxMmsgOiAgLTMuM2RCICAqLwotCTEyOCwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8qIG1vZGUzID0gMTRrIDogIC0zLjBkQiAgKi8KLQkxMjIsICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvKiBtb2RlNCA9IDE2ayA6ICAtMi44NWRCICovCi0JMTE1LCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLyogbW9kZTUgPSAxOGsgOiAgLTIuN2RCICAqLwotCTExNSwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8qIG1vZGU2ID0gMjBrIDogIC0yLjdkQiAgKi8KLQkxMTUsICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvKiBtb2RlNyA9IDIzayA6ICAtMi43ZEIgICovCi0JMTE1ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLyogbW9kZTggPSAyNGsgOiAgLTIuN2RCICAqLwotfTsKLQotLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCi0qCi0qIEZ1bmN0aW9uICAgIDogZHR4X2VuY19pbml0Ci0qCi0qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLVdvcmQxNiBkdHhfZW5jX2luaXQoZHR4X2VuY1N0YXRlICoqIHN0LCBXb3JkMTYgaXNmX2luaXRbXSwgVk9fTUVNX09QRVJBVE9SICpwTWVtT1ApCi17Ci0JZHR4X2VuY1N0YXRlICpzOwotCi0JaWYgKHN0ID09IChkdHhfZW5jU3RhdGUgKiopIE5VTEwpCi0JewotCQlmcHJpbnRmKHN0ZGVyciwgImR0eF9lbmNfaW5pdDogaW52YWxpZCBwYXJhbWV0ZXJcbiIpOwotCQlyZXR1cm4gLTE7Ci0JfQotCSpzdCA9IE5VTEw7Ci0KLQkvKiBhbGxvY2F0ZSBtZW1vcnkgKi8KLQlpZiAoKHMgPSAoZHR4X2VuY1N0YXRlICopbWVtX21hbGxvYyhwTWVtT1AsIHNpemVvZihkdHhfZW5jU3RhdGUpLCAzMiwgVk9fSU5ERVhfRU5DX0FNUldCKSkgPT0gTlVMTCkKLQl7Ci0JCWZwcmludGYoc3RkZXJyLCAiZHR4X2VuY19pbml0OiBjYW4gbm90IG1hb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jc2NzsKLQotCWZvciAoaSA9IDA7IGkgPCAyODsgaSsrKQotCXsKLQkJc3QtPkRbaV0gPSAwOwotCX0KLQotCWZvciAoaSA9IDA7IGkgPCBEVFhfSElTVF9TSVpFIC0gMTsgaSsrKQotCXsKLQkJc3QtPnN1bURbaV0gPSAwOwotCX0KLQotCXJldHVybiAxOwotfQotCi0vKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKLSoKLSogRnVuY3Rpb24gICAgOiBkdHhfZW5jX2V4aXQKLSoKLSoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotdm9pZCBkdHhfZW5jX2V4aXQoZHR4X2VuY1N0YXRlICoqIHN0LCBWT19NRU1fT1BFUkFUT1IgKnBNZW1PUCkKLXsKLQlpZiAoc3QgPT0gTlVMTCB8fCAqc3QgPT0gTlVMTCkKLQkJcmV0dXJuOwotCS8qIGRlYWxsb2NhdGUgbWVtb3J5ICovCi0JbWVtX2ZyZWUocE1lbU9QLCAqc3QsIFZPX0lOREVYX0VOQ19BTVJXQik7Ci0JKnN0ID0gTlVMTDsKLQlyZXR1cm47Ci19Ci0KLQotLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCi0qCi0qIEZ1bmN0aW9uICAgIDogZHR4X2VuYwotKgotKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi1Xb3JkMTYgZHR4X2VuYygKLQkJZHR4X2VuY1N0YXRlICogc3QsICAgICAgICAgICAgICAgICAgICAvKiBpL28gOiBTdGF0ZSBzdHJ1Y3QgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0JCVdvcmQxNiBpc2ZbTV0s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Sk9MTYsIGkuZS4gc2hpZnQgbGVmdCBieSA0ICovCi0JZXhwICs9IDQ7Ci0KLQlmb3IgKGkgPSAwOyBpIDwgTF9GUkFNRTsgaSsrKQotCXsKLQkJdG1wID0gbXVsdChleGMyW2ldLCBnYWluKTsgICAgICAgICAvKiBRMCAqIFExNSAqLwotCQlleGMyW2ldID0gc2hsKHRtcCwgZXhwKTsKLQl9Ci0KLQlyZXR1cm4gMDsKLX0KLQotLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCi0qCi0qIEZ1bmN0aW9uICAgIDogZHR4X2J1ZmZlciBQdXJwb3NlICAgICA6IGhhbmRsZXMgdGhlIERUWCBidWZmZXIKLSoKLSoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotV29yZDE2IGR0eF9idWZmZXIoCi0JCWR0eF9lbmNTdGF0ZSAqIHN0LCAgICAgICAgICAgICAgICAgICAgLyogaS9vIDogU3RhdGUgc3RydWN0ICAgICAgICAgICAgICAgICAgICAqLwotCQlXb3JkMTYgaXNmX25ld1tdLCAgICAgICAgICAgICAgICAgICAgIC8qIGkgICA6IGlzZiB2ZWN0b3IgICAgICAgICAgICAgICAgICAgICAgKi8KLQkJV29yZDMyIGVuciwgICAgICAgICAgICAgICAgICAgICAgICAgICAvKiBpICAgOiByZXNpZHVhbCBlbmVyZ3kgKGluIExfRlJBTUUpICAgICovCi0JCVdvcmQxNiBjb2RlY19tb2RlCi0JCSkKLXsKLQlXb3JkMTYgbG9nX2VuOwotCi0JV29yZDE2IGxvZ19lbl9lOwotCVdvcmQxNiBsb2dfZW5fbTsKLQlzdC0+aGlzdF9wdHIgPSBhZGQoc3QtPmhpc3RfcHRyLCAxKTsKLQlpZihzdC0+aGlzdF9wdHIgPT0gRFRYX0hJU1RfU0laRSkKLQl7Ci0JCXN0LT5oa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SBieSBMX0ZSQU1FPTI1NiksIGkuZSBzdWJ0cmFjdCBsb2cyKDI1NikgPSA4LjAgICgxMDI0IGluIFE3KSAqLwotCS8qIFN1YnRyYWN0IDMgZEIgPSAwLjk5NjU4IGluIGxvZzIoRSkgPSAxMjcgaW4gUTcuICovCi0KLQlsb2dfZW4gPSBzdWIobG9nX2VuLCBhZGQoMTAyNCwgZW5fYWRqdXN0W2NvZGVjX21vZGVdKSk7Ci0KLQkvKiBJbnNlcnQgaW50byB0aGUgYnVmZmVyICovCi0Jc3QtPmxvZ19lbl9oaXN0W3N0LT5oaXN0X3B0cl0gPSBsb2dfZW47Ci0JcmV0dXJuIDA7Ci19Ci0KLS8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgotKgotKiBGdW5jdGlvbiAgICA6IHR4X2R0eF9oYW5kbGVyIFB1cnBvc2UgICAgIDogYWRkcyBleHRyYSBzcGVlY2ggaGFuZ292ZXIKLSogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRvIGFuYWx5emUgc3BlZWNoIG9uCi0qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0aGUgZGVjb2Rpbmcgc2lkZS4KLSoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotdm9pZCB0eF9kdHhfaGFuZGxlcihkdHhfZW5jU3RhdGUgKiBzdCwgICAgIC8qIGkvbyA6IFN0YXRlIHN0cnVjdCAgICAgICAgICAgKi8KLQkJV29yZDE2IHZhZF9mbGFnLCAgICAgICAgICAgICAgICAgICAgICAvKiBpICAgOiB2YWQgZGVjaXNpb24gICAgICAgICAgICovCi0JCVdvcmQxNiAqIHVzZWRNb2RlICAgICAgICAgICAgICAgICAgICAgLyogaS9vIDogbW9kZSBjaGFuZ2VkIG9yIG5vdCAg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qKioqKioqKioqKioqKioKLSogICAgICBGaWxlOiBnX3BpdGNoLmMgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKgotKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqCi0qCSAgIERlc2NyaXB0aW9uOkNvbXB1dGUgdGhlIGdhaW4gb2YgcGl0Y2guIFJlc3VsdCBpbiBRMTIgICAgICAgICoKLSoJICAgICAgICAgICAgICAgaWYoZ2FpbiA8IDApIGdhaW4gPSAwICAgICAgICAgICAgICAgICAgICAgICAgICAgKgotKgkJCQkgICBpZihnYWluID4gMS4yKSBnYWluID0gMS4yICAgICAgICAgICAqCi0qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0KLSNpbmNsdWRlICJ0eXBlZGVmLmgiCi0jaW5jbHVkZSAiYmFzaWNfb3AuaCIKLSNpbmNsdWRlICJtYXRoX29wLmgiCi0KLVdvcmQxNiBHX3BpdGNoKCAgICAgICAgICAgICAgICAgICAgICAgICAgICAvKiAobykgUTE0IDogR2FpbiBvZiBwaXRjaCBsYWcgc2F0dXJhdGVkIHRvIDEuMiAgICovCi0JCVdvcmQxNiB4bltdLCAgICAgICAgICAgICAgICAgICAgICAgICAgLyogKGkpICAgICA6IFBpdGNoIHRhcmdldC4gICAgICAgICAgICAgICAgICAgICAgICAqLwotCQlXb3JkMTYgeTFbXSwgICAgICAgICAgICAgICAgICAgICAgICAgIC8qIChpKSAgICAgOiBmaWx0ZXJlZCBhZGFwdGl2ZSBjb2RlYm9vay4gICAgICAgICAgKi8KLQkJV29yZDE2IGdfY29lZmZbXSwgICAgICAgICAgICAgICAgICAgICAvKiA6IENvcnJlbGF0aW9ucyBuZWVkIGZvciBnYWluIHF1YW50aXphdGlvbi4gICAgICovCi0JCVdvcmQxNiBMX3N1YmZyICAgICAgIC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B0byBpbiB3cml0aW5nLCBzb2Z0d2FyZQotICoqIGRpc3RyaWJ1dGVkIHVuZGVyIHRoZSBMaWNlbnNlIGlzIGRpc3RyaWJ1dGVkIG9uIGFuICJBUyBJUyIgQkFTSVMsCi0gKiogV0lUSE9VVCBXQVJSQU5USUVTIE9SIENPTkRJVElPTlMgT0YgQU5ZIEtJTkQsIGVpdGhlciBleHByZXNzIG9yIGltcGxpZWQuCi0gKiogU2VlIHRoZSBMaWNlbnNlIGZvciB0aGUgc3BlY2lmaWMgbGFuZ3VhZ2UgZ292ZXJuaW5nIHBlcm1pc3Npb25zIGFuZAotICoqIGxpbWl0YXRpb25zIHVuZGVyIHRoZSBMaWNlbnNlLgotICovCi0KLS8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgotKiAgICAgIEZpbGU6IGdwY2xpcC5jICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqCi0qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICoKLSogICAgICBEZXNjcmlwdGlvbjpUbyBhdm9pZCB1bnN0YWJsZSBzeW50aGVzaXMgb24gZnJhbWUgZXJhc3VyZSwgdGhlIGdhaW4gKgotKiAgICAgIG5lZWQgdG8gYmUgbGltaXRlZChnYWluIHBpdGNoIDwgMS4wKSB3aGVuIHRoZSBmb2xsb3dpbmcgICAgICAgICAgICAqCi0qICAgICAgY2FzZSBvY2N1cnMgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICoKLSogICAgICBhIHJlc29uYW5jZSBvbiBMUEMgZmlsdGVyKGxwX2Rpc3AgPCA2MEh6KSAgICAgICAgICAgICAgICAgICAgICAgICAgKgotKiAgICAgIGEgZ29vZCBwaXRjaCBwcmVkaWN0aW9uIChscF9ncCA+IDAuOTUpICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqCi0qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICoKLSoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLSNpbmNsdWRlICJ0eXBlZGVmLmgiCi0jaW5jbHVkZSAiYmFzaWNfb3AuaCIKLQotI2RlZmluZSBESVNUX0lTRl9NQVggICAgMzA3ICAgICAgICAgICAgICAgIC8qIDEyMCBIeiAoNjQwMEh6PTE2Mzg0KSAqLwotI2RlZmluZSBESVNUX0lTRl9USFJFUyAgMTU0ICAgICAgICAgICAgICAgIC8qIDYwICAgICAoNjQwMEh6PTE2Mzg0KSAqLwotI2RlZmluZSBHQUlOX1BJVF9USFJFUyAgMTQ3NDYgICAgICAgICAgICAgIC8qIDAuOSBpbiBRMTQgKi8KLSNkZWZpbmUgR0FJTl9QSVRfTUlOICAgIDk4MzAgICAgICAgICAgICAgICAvKiAwLjYgaW4gUTE0ICovCi0jZGVmaW5lIE0gICAgICAgICAgICAgICAxNgotCi0KLXZvaWQgSW5pdF9ncF9jbGlwKAotCQlXb3JkMTYgbWVtW10gICAgICAgICAgICAgICAgICAgICAgICAgIC8qIChvKSA6IG1lbW9yeSBvZiBnYWluIG9mIHBpdGNoIGNsaXBwaW5nIGFsZ29yaXRobSAqLwotCQkpCi17Ci0JbWVtWzBdID0gRElTVF9JU0ZfTUFYOwotCW1lbVsxXSA9IEdBSU5fUElUX01JTjsKLX0KLQotCi1Xb3JkMTYgR3BfY2xpcCgKLQkJV29yZDE2IG1lbVtdICAgICAgICAgICAgICAgICAgICAgICAgICAvKiAoaS9vKSA6IG1lbW9yeSBvZiBnYWluIG9mIHBpdGNoIGNsaXBwaW5nIGFsZ29yaXRobSAqLwotCSAgICAgICkKLXsKLQlXb3JkMTYgY2xpcCA9IDA7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vcHkgb2YgdGhlIExpY2Vuc2UgYXQKLSAqKgotICoqICAgICBodHRwOi8vd3d3LmFwYWNoZS5vcmcvbGljZW5zZXMvTElDRU5TRS0yLjAKLSAqKgotICoqIFVubGVzcyByZXF1aXJlZCBieSBhcHBsaWNhYmxlIGxhdyBvciBhZ3JlZWQgdG8gaW4gd3JpdGluZywgc29mdHdhcmUKLSAqKiBkaXN0cmlidXRlZCB1bmRlciB0aGUgTGljZW5zZSBpcyBkaXN0cmlidXRlZCBvbiBhbiAiQVMgSVMiIEJBU0lTLAotICoqIFdJVEhPVVQgV0FSUkFOVElFUyBPUiBDT05ESVRJT05TIE9GIEFOWSBLSU5ELCBlaXRoZXIgZXhwcmVzcyBvciBpbXBsaWVkLgotICoqIFNlZSB0aGUgTGljZW5zZSBmb3IgdGhlIHNwZWNpZmljIGxhbmd1YWdlIGdvdmVybmluZyBwZXJtaXNzaW9ucyBhbmQKLSAqKiBsaW1pdGF0aW9ucyB1bmRlciB0aGUgTGljZW5zZS4KLSAqLwotCi0vKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKLSogICAgICAgRmlsZTogaG9taW5nLmMgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKgotKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqCi0qICAgICAgIERlc2NyaXB0aW9uOlBlcmZvcm1zIHRoZSBob21pbmcgcm91dGluZXMgICAgICAgICAgICAgICAgICAgICAgICoKLSogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKgotKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotCi0jaW5jbHVkZSAidHlwZWRlZi5oIgotI2luY2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GxpYW5jZSB3aXRoIHRoZSBMaWNlbnNlLgotICoqIFlvdSBtYXkgb2J0YWluIGEgY29weSBvZiB0aGUgTGljZW5zZSBhdAotICoqCi0gKiogICAgIGh0dHA6Ly93d3cuYXBhY2hlLm9yZy9saWNlbnNlcy9MSUNFTlNFLTIuMAotICoqCi0gKiogVW5sZXNzIHJlcXVpcmVkIGJ5IGFwcGxpY2FibGUgbGF3IG9yIGFncmVlZCB0byBpbiB3cml0aW5nLCBzb2Z0d2FyZQotICoqIGRpc3RyaWJ1dGVkIHVuZGVyIHRoZSBMaWNlbnNlIGlzIGRpc3RyaWJ1dGVkIG9uIGFuICJBUyBJUyIgQkFTSVMsCi0gKiogV0lUSE9VVCBXQVJSQU5USUVTIE9SIENPTkRJVElPTlMgT0YgQU5ZIEtJTkQsIGVpdGhlciBleHByZXNzIG9yIGltcGxpZWQuCi0gKiogU2VlIHRoZSBMaWNlbnNlIGZvciB0aGUgc3BlY2lmaWMgbGFuZ3VhZ2UgZ292ZXJuaW5nIHBlcm1pc3Npb25zIGFuZAotICoqIGxpbWl0YXRpb25zIHVuZGVyIHRoZSBMaWNlbnNlLgotICovCi0KLS8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgotKiAgICAgIEZpbGU6IGhwNDAwLmMgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKgotKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKgotKiAgICAgIERlc2NyaXB0aW9uOiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKgotKiAybmQgb3JkZXIgaGlnaCBwYXNzIGZpbHRlciB3aXRoIGN1dCBvZmYgZnJlcXVlbmN5IGF0IDQwMCBIei4gICAgICAgICAgKgotKiBEZXNpZ25lZCB3aXRoIGNoZWJ5MiBmdW5jdGlvbiBpbiBNQVRMQUIuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKgotKiBPcHRpbWl6ZWQgZm9yIGZpeGVkLXBvaW50IHRvIGdldCB0aGUgZm9sbG93aW5nIGZyZXF1ZW5jeSByZXNwb25zZTogICAgKgotKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKgotKiAgZnJlcXVlbmN5OiAgICAgMEh6ICAgMTAwSHogIDIwMEh6ICAzMDBIeiAgNDAwSHogIDYzMEh6ICAxLjVrSHogIDNrSHogKgotKiAgZEIgbG9zczogICAgIC1pbmZkQiAgLTMwZEIgIC0yMGRCICAtMTBkQiAgLTNkQiAgICs2ZEIgICAgKzFkQiAgICAwZEIgKgotKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKgotKiBBbGdvcml0aG06ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKgotKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKgotKiAgeVtpXSA9IGJbMF0qeFtpXSArIGJbMV0qeFtpLTFdICsgYlsyXSp4W2ktMl0gICAgICAgICAgICAgICAgICAgICAgICAgKgotKiAgICAgICAgICAgICAgICAgICArIGFbMV0qeVtpLTFdICsgYVsyXSp5W2ktMl07ICAgICAgICAgICAgICAgICAgICAgICAgKgotKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKgotKiAgV29yZDE2IGJbM10gPSB7MzY2MCwgLTczMjAsICAzNjYwfTsgICAgICAgaW4gUTEyICAgICAgICAgICAgICAgICAgICAgKgotKiAgV29yZDE2IGFbM10gPSB7NDA5NiwgIDczMjAsIC0zNTQwfTsgICAgICAgaW4gUTEyICAgICAgICAgICAgICAgICAgICAgKgotKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKgotKiAgZmxvYXQgLS0+ICAgYlszXSA9IHswLjg5MzU1NDY4NywgLTEuNzg3MTA5Mzc1LCAgMC44OTM1NTQ2ODd9OyAgICAgICAgKgotKiAgICAgICAgICAgICAgYVszXSA9IHsxLjAwMDAwMDAwMCwgIDEuNzg3MTA5Mzc1LCAtMC44NjQyNTc4MTJ9OyAgICAgICAgKgotKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKgotKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotCi0jaW5jbHVkZSAidHlwZWRlZi5oIgotI2luY2x1ZGUgImJhc2ljX29wLmgiCi0jaW5jbHVkZSAib3Blcl8zMmIuaCIKLSNpbmNsdWRlICJhY2VscC5oIgotCi0vKiBmaWx0ZXIgY29lZmZpY2llbnRzICAqLwotc3RhdGljIFdvcmQxNiBiWzNdID0gezkxNSwgLTE4MzAsIDkxNX07ICAgICAgICAgLyogUTEyICgvNCkgKi8KLXN0YXRpYyBXb3JkMTYgYVszXSA9IHsxNjM4NCwgMjkyODAsIC0xNDE2MH07ICAgIC8qIFExMiAoeDQpICovCi0vKiBJbml0aWFsaXphdGlvbiBvZiBzdGF0aWMgdmFsdWVzICovCi0KLXZvaWQgSW5pdF9IUDQwMF8xMms4KFdvcmQxNiBtZW1bXSkKLXsKLQlTZXRfemVybyhtZW0sIDYpOwotfQotCi0KLXZvaWQgSFA0MDBfMTJrOCgKLQkJV29yZDE2IHNpZ25hbFtdLCAgICAgICAgICAgICAgICAgICAgICAvKiBpbnB1dCBzaWduYWwgLyBvdXRwdXQgaXMgZGl2aWRlZCBie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IGF0Ci0gKioKLSAqKiAgICAgaHR0cDovL3d3dy5hcGFjaGUub3JnL2xpY2Vuc2VzL0xJQ0VOU0UtMi4wCi0gKioKLSAqKiBVbmxlc3MgcmVxdWlyZWQgYnkgYXBwbGljYWJsZSBsYXcgb3IgYWdyZWVkIHRvIGluIHdyaXRpbmcsIHNvZnR3YXJlCi0gKiogZGlzdHJpYnV0ZWQgdW5kZXIgdGhlIExpY2Vuc2UgaXMgZGlzdHJpYnV0ZWQgb24gYW4gIkFTIElTIiBCQVNJUywKLSAqKiBXSVRIT1VUIFdBUlJBTlRJRVMgT1IgQ09ORElUSU9OUyBPRiBBTlkgS0lORCwgZWl0aGVyIGV4cHJlc3Mgb3IgaW1wbGllZC4KLSAqKiBTZWUgdGhlIExpY2Vuc2UgZm9yIHRoZSBzcGVjaWZpYyBsYW5ndWFnZSBnb3Zlcm5pbmcgcGVybWlzc2lvbnMgYW5kCi0gKiogbGltaXRhdGlvbnMgdW5kZXIgdGhlIExpY2Vuc2UuCi0gKi8KLQotLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCi0qICAgICAgRmlsZTogaHA1MC5jICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqCi0qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqCi0qCSAgIERlc2NyaXB0aW9uOiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqCi0qIDJuZCBvcmRlciBoaWdoIHBhc3MgZmlsdGVyIHdpdGggY3V0IG9mZiBmcmVxdWVuY3kgYXQgMzEgSHouICAgICAgICAgICAqCi0qIERlc2lnbmVkIHdpdGggY2hlYnkyIGZ1bmN0aW9uIGluIE1BVExBQi4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqCi0qIE9wdGltaXplZCBmb3IgZml4ZWQtcG9pbnQgdG8gZ2V0IHRoZSBmb2xsb3dpbmcgZnJlcXVlbmN5IHJlc3BvbnNlOiAgICAqCi0qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqCi0qICBmcmVxdWVuY3k6ICAgICAwSHogICAgMTRIeiAgMjRIeiAgIDMxSHogICAzN0h6ICAgNDFIeiAgIDQ3SHogICAgICAgICAqCi0qICBkQiBsb3NzOiAgICAgLWluZmRCICAtMTVkQiAgLTZkQiAgIC0zZEIgIC0xLjVkQiAgLTFkQiAgLTAuNWRCICAgICAgICAqCi0qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqCi0qIEFsZ29yaXRobTogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqCi0qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqCi0qICB5W2ldID0gYlswXSp4W2ldICsgYlsxXSp4W2ktMV0gKyBiWzJdKnhbaS0yXSAgICAgICAgICAgICAgICAgICAgICAgICAqCi0qICAgICAgICAgICAgICAgICAgICsgYVsxXSp5W2ktMV0gKyBhWzJdKnlbaS0yXTsgICAgICAgICAgICAgICAgICAgICAgICAqCi0qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqCi0qICBXb3JkMTYgYlszXSA9IHs0MDUzLCAtODEwNiwgNDA1M307ICAgICAgIGluIFExMiAgICAgICAgICAgICAgICAgICAgICAqCi0qICBXb3JkMTYgYVszXSA9IHs4MTkyLCAxNjIxMSwgLTgwMjF9OyAgICAgICBpbiBRMTIgICAgICAgICAgICAgICAgICAgICAqCi0qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqCi0qICBmbG9hdCAtLT4gICBiWzNdID0gezAuOTg5NTAxOTUzLCAtMS45NzkwMDM5MDYsICAwLjk4OTUwMTk1M307ICAgICAgICAqCi0qICAgICAgICAgICAgICBhWzNdID0gezEuMDAwMDAwMDAwLCAgMS45Nzg4ODE4MzYsIC0wLjk3OTEyNTk3N307ICAgICAgICAqCi0qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0KLSNpbmNsdWRlICJ0eXBlZGVmLmgiCi0jaW5jbHVkZSAiYmFzaWNfb3AuaCIKLSNpbmNsdWRlICJvcGVyXzMyYi5oIgotI2luY2x1ZGUgImNuc3QuaCIKLSNpbmNsdWRlICJhY2VscC5oIgotCi0vKiBmaWx0ZXIgY29lZmZpY2llbnRzICAqLwotc3RhdGljIFdvcmQxNiBiWzNdID0gezQwNTMsIC04MTA2LCA0MDUzfTsgIC8qIFExMiAqLwotc3RhdGljIFdvcmQxNiBhWzNdID0gezgxOTIsIDE2MjExLCAtODAyMX07IC8qIFExMiAoeDIpICovCi0KLS8qIEluaXRpYWxpemF0aW9uIG9mIHN0YXRpYyB2YWx1ZXMgKi8KLQotdm9pZCBJbml0X0hQNTBfMTJrOChXb3JkMTYgbWVtW10pCi17Ci0JU2V0X3plcm8obWVtLCA2KTsKLX0KLQotCi12b2lkIEhQNTBfMTJrOCgKLQkJV29yZDE2IHNpZ25hbFtdLCAgICAgICAgICAgICAgICAgICAgICAvKiBpbnB1dC9vdXRwdXQgc2lnbmFsICovCi0JCVdvcmQxNiBsZywgICAgICAgICAgICAgICAgICAgICAgICAgICAgLyogbGVuZ2h0IG9mIHNpZ25hbCAgICAqLwotCQlXb3JkMTYgbWVtW10gICAgICAgICAgICAgICAgICAgICAgICAgIC8qIGZpbHRlciBtZW1vcnkgWzZdICAgKi8KLQkgICAgICApCi17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V0ZWQgb24gYW4gIkFTIElTIiBCQVNJUywKLSAqKiBXSVRIT1VUIFdBUlJBTlRJRVMgT1IgQ09ORElUSU9OUyBPRiBBTlkgS0lORCwgZWl0aGVyIGV4cHJlc3Mgb3IgaW1wbGllZC4KLSAqKiBTZWUgdGhlIExpY2Vuc2UgZm9yIHRoZSBzcGVjaWZpYyBsYW5ndWFnZSBnb3Zlcm5pbmcgcGVybWlzc2lvbnMgYW5kCi0gKiogbGltaXRhdGlvbnMgdW5kZXIgdGhlIExpY2Vuc2UuCi0gKi8KLQotLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCi0qICAgICAgIEZpbGU6IGhwNmsuYyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqCi0qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqCi0qCURlc2NyaXB0aW9uOjE1dGggb3JkZXIgYmFuZCBwYXNzIDZrSHogdG8gN2tIeiBGSVIgZmlsdGVyICAgICAgICAqCi0qICAgICAgIGZyZXF1ZW5jeTogNGtIeiAgIDVrSHogIDUuNWtIeiAgNmtIeiAgNi41a0h6ICA3a0h6IDcuNWtIeiA4a0h6ICAqCi0qCWRCIGxvc3M6ICAtNjBkQiAgLTQ1ZEIgIC0xM2RCICAgLTNkQiAgIDBkQiAgICAtM2RCIC0xM2RCICAtNDVkQiAqCi0qCSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqCi0qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0KLSNpbmNsdWRlICJ0eXBlZGVmLmgiCi0jaW5jbHVkZSAiYmFzaWNfb3AuaCIKLSNpbmNsdWRlICJhY2VscC5oI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WJ1dGVkIG9uIGFuICJBUyBJUyIgQkFTSVMsCi0gKiogV0lUSE9VVCBXQVJSQU5USUVTIE9SIENPTkRJVElPTlMgT0YgQU5ZIEtJTkQsIGVpdGhlciBleHByZXNzIG9yIGltcGxpZWQuCi0gKiogU2VlIHRoZSBMaWNlbnNlIGZvciB0aGUgc3BlY2lmaWMgbGFuZ3VhZ2UgZ292ZXJuaW5nIHBlcm1pc3Npb25zIGFuZAotICoqIGxpbWl0YXRpb25zIHVuZGVyIHRoZSBMaWNlbnNlLgotICovCi0KLS8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgotKiAgICAgICBGaWxlOiBocF93c3AuYyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKgotKiAgICAgICBEZXNjcmlwdGlvbjogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKgotKiAgICAgICAzbmQgb3JkZXIgaGlnaCBwYXNzIGZpbHRlciB3aXRoIGN1dCBvZmYgZnJlcXVlbmN5IGF0IDE4MEh6ICAgICAgKgotKiBBbGdvcml0aG06ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKgotKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKgotKiAgeVtpXSA9IGJbMF0qeFtpXSArIGJbMV0qeFtpLTFdICsgYlsyXSp4W2ktMl0gKyBiWzNdKnhbaS0zXSAgICAgICAgICAgKgotKiAgICAgICAgICAgICAgICAgICArIGFbMV0qeVtpLTFdICsgYVsyXSp5W2ktMl0gKyBhWzNdKnlbaS0zXTsgICAgICAgICAgKgotKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKgotKiBmbG9hdCBhX2NvZWZbSFBfT1JERVJdPSB7ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKgotKiAgICAtMi42NDQzNjcxMTYwMDY2NGYsICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKgotKiAgICAyLjM1MDg3Mzg2NjI1MzYwZiwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKgotKiAgIC0wLjcwMDAxMTU2OTI3NDI0Zn07ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKgotKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKgotKiBmbG9hdCBiX2NvZWZbSFBfT1JERVIrMV09IHsgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKgotKiAgICAgLTAuODM3ODcwNTc1MDU2NjVmLCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKgotKiAgICAyLjUwOTc1NTcwMDcxMDU4ZiwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKgotKiAgIC0yLjUwOTc1NTcwMDcxMDU4ZiwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKgotKiAgICAwLjgzNzg3MDU3NTA1NjY1Zn07ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKgotKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKgotKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLQotI2luY2x1ZGUgInR5cGVkZWYuaCIKLSNpbmNsdWRlICJiYXNpY19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AgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqCi0qICAgICAgRGVzY3JpcHRpb246SW50ZXJwb2xhdGlvbiBvZiB0aGUgTFAgcGFyYW1ldGVycyBpbiA0IHN1YmZyYW1lcy4gICoKLSogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKgotKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotCi0jaW5jbHVkZSAidHlwZWRlZi5oIgotI2luY2x1ZGUgImJhc2ljX29wLmgiCi0jaW5jbHVkZSAiY25zdC5oIgotI2luY2x1ZGUgImFjZWxwLmgiCi0KLSNkZWZpbmUgTVAxIChNKzEpCi0KLQotdm9pZCBJbnRfaXNwKAotCQlXb3JkMTYgaXNwX29sZFtdLCAgICAgICAgICAgICAgICAgICAgIC8qIGlucHV0IDogaXNwcyBmcm9tIHBhc3QgZnJhbWUgICAgICAgICAgICAgICovCi0JCVdvcmQxNiBpc3BfbmV3W10sICAgICAgICAgICAgICAgICAgICAgLyogaW5wdXQgOiBpc3BzIGZyb20gcHJlc2VudCBmcmFtZSAgICAgICAgICAgKi8KLQkJV29yZDE2IGZyYWNbXSwgICAgICAgICAgICAgICAgICAgICAgICAvKiBpbnB1dCA6IGZyYWN0aW9uIGZvciAzIGZpcnN0IHN1YmZyIChRMTUpICAqLwotCQlXb3JkMTYgQXpbXSAgICAgICAgICAgICAgICAgICAgICAgICAgIC8qIG91dHB1dDogTFAgY29lZmZpY2llbnRzIGluIDQgc3ViZnJhbWVzICAgICovCi0JICAgICkKLXsKLQlXb3JkMzIgaSwgazsKLQlXb3JkMTYgZmFjX29sZCwgZmFjX25ldzsKLQlXb3JkMTYgaXNwW01dOwotCVdvcmQzMiBMX3RtcDsKLQotCWZvciAoayA9IDA7IGsgPCAzOyB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GhlIExpY2Vuc2UuCi0gKiogWW91IG1heSBvYnRhaW4gYSBjb3B5IG9mIHRoZSBMaWNlbnNlIGF0Ci0gKioKLSAqKiAgICAgaHR0cDovL3d3dy5hcGFjaGUub3JnL2xpY2Vuc2VzL0xJQ0VOU0UtMi4wCi0gKioKLSAqKiBVbmxlc3MgcmVxdWlyZWQgYnkgYXBwbGljYWJsZSBsYXcgb3IgYWdyZWVkIHRvIGluIHdyaXRpbmcsIHNvZnR3YXJlCi0gKiogZGlzdHJpYnV0ZWQgdW5kZXIgdGhlIExpY2Vuc2UgaXMgZGlzdHJpYnV0ZWQgb24gYW4gIkFTIElTIiBCQVNJUywKLSAqKiBXSVRIT1VUIFdBUlJBTlRJRVMgT1IgQ09ORElUSU9OUyBPRiBBTlkgS0lORCwgZWl0aGVyIGV4cHJlc3Mgb3IgaW1wbGllZC4KLSAqKiBTZWUgdGhlIExpY2Vuc2UgZm9yIHRoZSBzcGVjaWZpYyBsYW5ndWFnZSBnb3Zlcm5pbmcgcGVybWlzc2lvbnMgYW5kCi0gKiogbGltaXRhdGlvbnMgdW5kZXIgdGhlIExpY2Vuc2UuCi0gKi8KLQotLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCi0qICAgICAgRmlsZTogaXNwX2F6LmMgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICoKLSogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKgotKiAgICAgIERlc2NyaXB0aW9uOkNvbXB1dGUgdGhlIExQQyBjb2VmZmljaWVudHMgZnJvbSBpc3AgKG9yZGVyPU0pICAgICAqCi0qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICoKLSoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq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gICAgICAgICAgICAgICAgICoKLSogICBGaW5kIHRoZSBwb2x5bm9taWFsIEYxKHopIG9yIEYyKHopIGZyb20gdGhlIElTUHMuICAgICAgICoKLSogVGhpcyBpcyBwZXJmb3JtZWQgYnkgZXhwYW5kaW5nIHRoZSBwcm9kdWN0IHBvbHlub21pYWxzOiAgICoKLSogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICoKLSogRjEoeikgPSAgIHByb2R1Y3QgICAoIDEgLSAyIGlzcF9pIHpeLTEgKyB6Xi0yICkgICAgICAgICAgICoKLSogICAgICAgICBpPTAsMiw0LDYsOCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICoKLSogRjIoeikgPSAgIHByb2R1Y3QgICAoIDEgLSAyIGlzcF9pIHpeLTEgKyB6Xi0yICkgICAgICAgICAgICoKLSogICAgICAgICBpPTEsMyw1LDcgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICoKLSogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICoKLSogd2hlcmUgaXNwX2kgYXJlIHRoZSBJU1BzIGluIHRoZSBjb3NpbmUgZG9tYWluLiAgICAgICAgICAgICoKLSotLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSoKLSogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICoKLSogUGFyYW1ldGVyczogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICoKLSogIGlzcFtdICAgOiBpc3AgdmVjdG9yIChjb3NpbmUgZG9tYWluZSkgICAgICAgICBpbiBRMTUgICAgICoKLSogIGZbXSAgICAgOiB0aGUgY29lZmZpY2llbnRzIG9mIEYxIG9yIEYyICAgICAgICBpbiBRMjMgICAgICoKLSogIG4gICAgICAgOiA9PSBOQyBmb3IgRjEoeik7ID09IE5DLTEgZm9yIEYyKHopICAgICAgICAgICAgICoKLSotLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSovCi0KLXN0YXRpYyB2b2lkIEdldF9pc3BfcG9sKFdvcmQxNiAqIGlzcCwgV29yZDMyICogZiwgV29yZDE2IG4pCi17Ci0JV29yZDE2IGhpLCBsbzsKLQlXb3JkMzIgaSwgaiwgdDA7Ci0JLyogQWxsIGNvbXB1dGF0aW9uIGluIFEyMyAqLwotCi0JZlswXSA9IHZvX0xfbXVsdCg0MDk2LCAxMDI0KTsgICAgICAgICAgICAgICAvKiBmWzBdID0gMS4wOyAgICAgICAgaW4gUTIzICAqLwotCWZbMV0gPSB2b19MX211bHQoaXNwWzBdLCAtMjU2KTsgICAgICAgICAgICAgLyogZlsxXSA9IC0yLjAqaXNwWzBdIGluIFEyMyAgKi8KLQotCWYgKz0gMjsgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLyogQWR2YW5jZSBmIHBvaW50ZXIgICAgICAgICAgKi8KLQlpc3AgKz0gMjsgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8qIEFkdmFuY2UgaXNwIHBvaW50ZXIgICAgICAgICovCi0JZm9yIChpID0gMjsgaSA8PSBuOyBpKyspCi0JewotCQkqZiA9IGZbLTJdOwotCQlmb3IgKGogPSAxOyBqIDwgaTsgaisrLCBmLS0pCi0JCXsKLQkJCWhpID0gZlstMV0+PjE2OwotCQkJbG8gPSAoZlstMV0gJiAweGZmZmYpPj4xOwotCi0JCQl0MCA9IE1weV8zMl8xNihoaSwgbG8sICppc3ApOyAgLyogdDAgPSBmWy0xXSAqIGlzcCAgICAqLwotCQkJdDAgPSB0MCA8PCAxOwotCQkJKmYgPSB2b19MX3N1YigqZiwgdDApOyAgICAgICAgICAgICAgLyogKmYgLT0gdDAgICAgICAgICAgICAqLwotCQkJKmYgPSB2b19MX2FkZCgqZiwgZlstMl0pOyAgICAgICAgICAgLyogKmYgKz0gZlstMl0gICAgICAgICAqLwotCQl9Ci0JCSpmIC09ICgqaXNwIDw8IDkpOyAgICAgICAgICAgLyogKmYgLT0gaXNwPDw4ICAgICAgICAqLwotCQlmICs9IGk7ICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8qIEFkdmFuY2UgZiBwb2ludGVyICAgKi8KLQkJaXNwICs9IDI7ICAgICAgICAgICAgICAgICAgICAgICAgICAvKiBBZHZhbmNlIGlzcCBwb2ludGVyICovCi0JfQotCXJldHVybjsKLX0KLQotc3RhdGljIHZvaWQgR2V0X2lzcF9wb2xfMTZrSHooV29yZDE2ICogaXNwLCBXb3JkMzIgKiBmLCBXb3JkMTYgbikKLXsKLQlXb3JkMTYgaGksIGxvOwotCVdvcmQzMiBpLCBqLCB0MDsKLQotCS8qIEFsbCBjb21wdXRhdGlvbiBpbiBRMjMgKi8KLQlmWzBdID0gTF9tdWx0KDQwOTYsIDI1Nik7ICAgICAgICAgICAgICAgIC8qIGZbMF0gPSAxLjA7ICAgICAgICBpbiBRMjMgICovCi0JZlsxXSA9IExfbXVsdChpc3BbMF0sIC02NCk7ICAgICAgICAgICAgICAvKiBmWzFdID0gLTIuMCppc3BbMF0gaW4gUTIzICAqLwotCi0JZiArPSAyOyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvKiBBZHZhbmNlIGYgcG9pbnRlciAgICAgICAgICAqLwotCWlzcCArPSAyOyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLyogQWR2YW5jZSBpc3AgcG9pbnRlciAgICAgICAgKi8KLQotCWZvciAoaSA9IDI7IGkgPD0gbjsgaSsrKQotCXsKLQkJKmYgPSBmWy0yXTsKLQkJZm9yIChqID0gMTsgaiA8IGk7IGorKywgZi0tKQotCQl7Ci0JCQlWT19MX0V4dHJhY3QoZlstMV0sICZoaSwgJmxvKTsKLQkJCXQwID0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B0IGluIGNvbXBsaWFuY2Ugd2l0aCB0aGUgTGljZW5zZS4KLSAqKiBZb3UgbWF5IG9idGFpbiBhIGNvcHkgb2YgdGhlIExpY2Vuc2UgYXQKLSAqKgotICoqICAgICBodHRwOi8vd3d3LmFwYWNoZS5vcmcvbGljZW5zZXMvTElDRU5TRS0yLjAKLSAqKgotICoqIFVubGVzcyByZXF1aXJlZCBieSBhcHBsaWNhYmxlIGxhdyBvciBhZ3JlZWQgdG8gaW4gd3JpdGluZywgc29mdHdhcmUKLSAqKiBkaXN0cmlidXRlZCB1bmRlciB0aGUgTGljZW5zZSBpcyBkaXN0cmlidXRlZCBvbiBhbiAiQVMgSVMiIEJBU0lTLAotICoqIFdJVEhPVVQgV0FSUkFOVElFUyBPUiBDT05ESVRJT05TIE9GIEFOWSBLSU5ELCBlaXRoZXIgZXhwcmVzcyBvciBpbXBsaWVkLgotICoqIFNlZSB0aGUgTGljZW5zZSBmb3IgdGhlIHNwZWNpZmljIGxhbmd1YWdlIGdvdmVybmluZyBwZXJtaXNzaW9ucyBhbmQKLSAqKiBsaW1pdGF0aW9ucyB1bmRlciB0aGUgTGljZW5zZS4KLSAqLwotCi0vKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKLSogICAgICAgRmlsZTogaXNwX2lzZi5jICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKgotKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqCi0qICAgICAgIERlc2NyaXB0aW9uOiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICoKLSoJSXNwX2lzZiAgIFRyYW5zZm9ybWF0aW9uIGlzcCB0byBpc2YgICAgICAgICAgICAgICAgICAgICAgICAgICAgKgotKglJc2ZfaXNwICAgVHJhbnNmb3JtYXRpb24gaXNmIHRvIGlzcCAgICAgICAgICAgICAgICAgICAgICAgICAgICAqCi0qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICoKLSoJVGhlIHRyYW5zZm9ybWF0aW9uIGZyb20gaXNwW2ldIHRvIGlzZltpXSBhbmQgaXNmW2ldIHRvIGlzcFtpXSAgKgotKglhcmUgYXBwcm94aW1hdGVkIGJ5IGEgbG9vay11cCB0YWJsZSBhbmQgaW50ZXJwb2xhdGlvbiAgICAgICAgICAqCi0qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICoKLSoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLQotI2luY2x1ZGUgInR5cGVkZWYuaCIKLSNpbmNsdWRlICJiYXNpY19vcC5oIgotI2luY2x1ZGUgImlzcF9pc2YudGFiIiAgICAgICAgICAgICAgICAgICAgIC8qIExvb2stdXAgdGFibGUgZm9yIHRyYW5zZm9ybWF0aW9ucyAqLwotCi12b2lkIElzcF9pc2YoCi0JCVdvcmQxNiBpc3BbXSwgICAgICAgICAgICAgICAgICAgICAgICAgLyogKGkpIFExNSA6IGlzcFttXSAocmFuZ2U6IC0xPD12YWw8MSkgICAgICAgICAgICAgICAgKi8KLQkJV29yZDE2IGlzZltdLCAgICAgICAgICAgICAgICAgICAgICAgICAvKiAobykgUTE1IDogaXNmW21dIG5vcm1hbGl6ZWQgKHJhbmdlOiAwLjA8PXZhbDw9MC41KSAqLwotCQlXb3JkMTYgbSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8qIChpKSAgICAgOiBMUEMgb3JkZXIgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0JICAgICkKLXsKLQlXb3JkMzIgaSwgaW5kOwotCVdvcmQzMiBMX3RtcDsKLQlpbmQgPSAxMjc7ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8qIGJlZ2luZyBhdCBlbmQgb2YgdGFibGUgLTEgKi8KLQlmb3IgKGkgPSAobSAtIDEpOyBpID49IDA7IGktLSkKLQl7Ci0JCWlmIChpID49IChtIC0gMikpCi0JCXsgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLyogbS0yIGlzIGEgY29uc3RhbnQgKi8KLQkJCWluZCA9IDEyNzsgICAgICAgICAgICAgICAgICAgICAgIC8qIGJlZ2luZyBhdCBlbmQgb2YgdGFibGUgLTEgKi8KLQkJfQotCQkvKiBmaW5kIHZhbHVlIGluIHRhYmxlIHRoYXQgaXMganVzdCBncmVhdGVyIHRoYW4gaXNwW2ldICovCi0JCXdoaWxlICh0YWJsZVtpbmRdIDwgaXNwW2ldKQotCQkJaW5kLS07Ci0JCS8qIGFjb3MoaXNwW2ldKT0gaW5kKjEyOCArICggKCBpc3BbaV0tdGFibGVbaW5kXSApICogc2xvcGVbaW5kXSApLzIwNDggKi8KLQkJTF90bXAgPSB2b19MX211bHQodm9fc3ViKGlzcFtpXSwgdGFibGVbaW5kXSksIHNsb3BlW2luZF0pOwotCQlpc2ZbaV0gPSB2b19yb3VuZCgoTF90bXAgPDwgNCkpOyAgIC8qIChpc3BbaV0tdGFibGVbaW5kXSkqc2xvcGVbaW5kXSk+PjExICovCi0JCWlzZltpXSA9IGFkZDEoaXNmW2ldLCAoaW5kIDw8IDcpKTsKLQl9Ci0JaXNmW20gLSAxXSA9IChpc2ZbbSAtIDFdID4+IDEpOwotCXJldHVybjsKLX0KLQotCi12b2lkIElzZl9pc3AoCi0JCVdvcmQxNiBpc2ZbXSwgICAgICAgICAgICAgICAgICAgICAgICAgLyogKGkpIFExNSA6IGlzZlttXSBub3JtYWxpemVkIChyYW5nZTogMC4wPD12YWw8PTAuNSkgKi8KLQkJV29yZDE2IGlzcFtdLCAgICAgICAgICAgICAgICAgICAgICAgICAvKiAobykgUTE1IDogaXNwW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KiAgICAgIEZpbGU6IGxhZ193aW5kLmMgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqCi0qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICoKLSoJICAgRGVzY3JpcHRpb246IExhZ193aW5kb3dzIG9uIGF1dG9jb3JyZWxhdGlvbnMgICAgICAgICAgICAgICAgKgotKgkgICAgICAgICAgICAgICAgcltpXSAqPSBsYWdfd2luZFtpXSAgICAgICAgICAgICAgICAgICAgICAgICAgICAqCi0qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICoKLSoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLQotI2luY2x1ZGUgInR5cGVkZWYuaCIKLSNpbmNsdWRlICJiYXNpY19vcC5oIgotI2luY2x1ZGUgIm9wZXJfMzJiLmgiCi0jaW5jbHVkZSAibGFnX3dpbmQudGFiIgotCi0KLXZvaWQgTGFnX3dpbmRvdygKLQkJV29yZDE2IHJfaFtdLCAgICAgICAgICAgICAgICAgICAgICAgICAvKiAoaS9vKSAgIDogQXV0b2NvcnJlbGF0aW9ucyAgKG1zYikgICAgICAgICAgKi8KLQkJV29yZDE2IHJfbFtdICAgICAgICAgICAgICAgICAgICAgICAgICAvKiAoaS9vKSAgIDogQXV0b2NvcnJlbGF0aW9ucyAgKGxzYikgICAgICAgICAgKi8KLQkgICAgICAgKQotewotCVdvcmQzMiBpOwotCVdvcmQzMiB4OwotCi0JZm9yIChpID0gMTsgaSA8PSBNOyBpKyspCi0JewotCQl4ID0gTXB5XzMyKHJfaFtpXSwgcl9sW2ldLCB2b2xhZ19oW2kgLSAxXSwgdm9sYWdfbFtpIC0gMV0pOwotCQlyX2hbaV0gPSB4ID4+IDE2OwotCQlyX2xbaV0g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G9yIGltcGxpZWQuCi0gKiogU2VlIHRoZSBMaWNlbnNlIGZvciB0aGUgc3BlY2lmaWMgbGFuZ3VhZ2UgZ292ZXJuaW5nIHBlcm1pc3Npb25zIGFuZAotICoqIGxpbWl0YXRpb25zIHVuZGVyIHRoZSBMaWNlbnNlLgotICovCi0KLS8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgotKiAgICAgIEZpbGU6IGxldmluc29uLmMgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqCi0qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICoKLSogICAgICBEZXNjcmlwdGlvbjpMRVZJTlNPTi1EVVJCSU4gYWxnb3JpdGhtIGluIGRvdWJsZSBwcmVjaXNpb24gICAgICAgKgotKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqCi0qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0vKi0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSoKLSAqICAgICAgICAgICAgICAgICAgICAgICAgIExFVklOU09OLkMJCQkJCSAgICAgKgotICotLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0qCi0gKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICoKLSAqICAgICAgTEVWSU5TT04tRFVSQklOIGFsZ29yaXRobSBpbiBkb3VibGUgcHJlY2lzaW9uICAgICAgICAgICAgICAgICAgICAgICAgKgotICogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqCi0gKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICoKLSAqIEFsZ29yaXRobSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKgotICogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqCi0gKiAgICAgICBSW2ldICAgIGF1dG9jb3JyZWxhdGlvbnMuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICoKLSAqICAgICAgIEFbaV0gICAgZmlsdGVyIGNvZWZmaWNpZW50cy4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKgotICogICAgICAgSyAgICAgICByZWZsZWN0aW9uIGNvZWZmaWNpZW50cy4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqCi0gKiAgICAgICBBbHBoYSAgIHByZWRpY3Rpb24gZ2Fpbi4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICoKLSAqICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKgotICogICAgICAgSW5pdGlhbGl6YXRpb246ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqCi0gKiAgICAgICAgICAgICAgIEFbMF0gPSAxICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICoKLSAqICAgICAgICAgICAgICAgSyAgICA9IC1SWzFdL1JbMF0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKgotICogICAgICAgICAgICAgICBBWzFdID0gSyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqCi0gKiAgICAgICAgICAgICAgIEFscGhhID0gUlswXSAqICgxLUsqKjJdICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICoKLSAqICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKgotICogICAgICAgRG8gZm9yICBpID0gMiB0byBNICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqCi0gKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICoKLSAqICAgICAgICAgICAgUyA9ICBTVU0gKCBSW2pdKkFbaS1qXSAsaj0xLGktMSApICsgIFJbaV0gICAgICAgICAgICAgICAgICAgICAgKgotICogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqCi0gKiAgICAgICAgICAgIEsgPSAtUyAvIEFscGhhICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICoKLSAqICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKgotICogICAgICAgICAgICBBbltqXSA9IEFbal0gKyBLKkFbaS1qXSAgIGZvciBqPTEgdG8gaS0xICAgICAgICAgICAgICAgICAgICAgICAqCi0gKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgd2hlcmUgICBBbltpXSA9IG5ldyBBW2ldICAgICAgICAgICAgICoKLSAqICAgICAgICAgICAgQW5baV09SyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKgotICogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqCi0gKiAgICAgICAgICAgIEFscGhhPUFscGhhICogKDEtSyoqMikgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICoKLSAqICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKgotICogICAgICAgRU5EICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqCi0gKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICoKLSAqIFJlbWFya3Mgb24gdGhlIGR5bmFtaWNzIG9mIHRoZSBjYWxjdWxhdGlvbnMuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKgotICogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqCi0gKiAgICAgICBUaGUgbnVtYmVycyB1c2VkIGFyZSBpbiBkb3VibGUgcHJlY2lzaW9uIGluIHRoZSBmb2xsb3dpbmcgZm9ybWF0IDogICoKLSAqICAgICAgIEEgPSBBSCA8PDE2ICsgQUw8PDEuICBBSCBhbmQgQUwgYXJlIDE2IGJpdCBzaWduZWQgaW50ZWdlcnMuICAgICAgICAgKgotICogICAgICAgU2luY2UgdGhlIExTQidzIGFsc28gY29udGFpbiBhIHNpZ24gYml0LCB0aGlzIGZvcm1hdCBkb2VzIG5vdCAgICAgICAqCi0gKiAgICAgICBjb3JyZXNwb25kIHRvIHN0YW5kYXJkIDMyIGJpdCBpbnRlZ2Vycy4gIFdlIHVzZSB0aGlzIGZvcm1hdCBzaW5jZSAgICoKLSAqICAgICAgIGl0IGFsbG93cyBmYXN0IGV4ZWN1dGlvbiBvZiBtdWx0aXBsaWNhdGlvbnMgYW5kIGRpdmlzaW9ucy4gICAgICAgICAgKgotICogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqCi0gKiAgICAgICAiRFBGIiB3aWxsIHJlZmVyIHRvIHRoaXMgc3BlY2lhbCBmb3JtYXQgaW4gdGhlIGZvbGxvd2luZyB0ZXh0LiAgICAgICoKLSAqICAgICAgIFNlZSBvcGVyXzMyYi5jICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKgotICogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqCi0gKiAgICAgICBUaGUgUltpXSB3ZXJlIG5vcm1hbGl6ZWQgaW4gcm91dGluZSBBVVRPIChoZW5jZSwgUltpXSA8IDEuMCkuICAgICAgICoKLSAqICAgICAgIFRoZSBLW2ldIGFuZCBBbHBoYSBhcmUgdGhlb3JldGljYWxseSA8IDEuMC4gICAgICAgICAgICAgICAgICAgICAgICAgKgotICogICAgICAgVGhlIEFbaV0sIGZvciBhIHNhbXBsaW5nIGZyZXF1ZW5jeSBvZiA4IGtIeiwgYXJlIGluIHByYWN0aWNlICAgICAgICAqCi0gKiAgICAgICBhbHdheXMgaW5mZXJpb3IgdG8gMTYuMC4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICoKLSAqICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKgotICogICAgICAgVGhlc2UgY2hhcmFjdGVyaXN0aWNzIGFsbG93IHN0cmFpZ3RoZm9yd2FyZCBmaXhlZC1wb2ludCAgICAgICAgICAgICAqCi0gKiAgICAgICBpbXBsZW1lbnRhdGlvbi4gIFdlIGNob29zZSB0byByZXByZXNlbnQgdGhlIHBhcmFtZXRlcnMgYXMgICAgICAgICAgICoKLSAqICAgICAgIGZvbGxvd3MgOiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKgotICogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqCi0gKiAgICAgICAgICAgICAgIFJbaV0gICAgUTMxICAgKy0gLjk5Li4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICoKLSAqICAgICAgICAgICAgICAgS1tpXSAgICBRMzEgICArLSAuOTkuLiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKgotICogICAgICAgICAgICAgICBBbHBoYSAgIE5vcm1hbGl6ZWQgLT4gbWFudGlzc2EgaW4gUTMxIHBsdXMgZXhwb25lbnQgICAgICAgICAqCi0gKiAgICAgICAgICAgICAgIEFbaV0gICAgUTI3ICAgKy0gMTUuOTk5Li4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICoKLSAqICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKgotICogICAgICAgVGhlIGFkZGl0aW9ucyBhcmUgcGVyZm9ybWVkIGluIDMyIGJpdC4gIEZvciB0aGUgc3VtbWF0aW9uIHVzZWQgICAgICAqCi0gKiAgICAgICB0byBjYWxjdWxhdGUgdGhlIEtbaV0sIHdlIG11bHRpcGx5IG51bWJlcnMgaW4gUTMxIGJ5IG51bWJlcnMgICAgICAgICoKLSAqICAgICAgIGluIFEyNywgd2l0aCB0aGUgcmVzdWx0IG9mIHRoZSBtdWx0aXBsaWNhdGlvbnMgaW4gUTI3LCAgICAgICAgICAgICAgKgotICogICAgICAgcmVzdWx0aW5nIGluIGEgZHluYW1pYyBvZiArLSAxNi4gIFRoaXMgaXMgc3VmZmljaWVudCB0byBhdm9pZCAgICAgICAqCi0gKiAgICAgICBvdmVyZmxvdywgc2luY2UgdGhlIGZpbmFsIHJlc3VsdCBvZiB0aGUgc3VtbWF0aW9uIGlzICAgICAgICAgICAgICAgICoKLSAqICAgICAgIG5lY2Vzc2FyaWx5IDwgMS4wIGFzIGJvdGggdGhlIEtbaV0gYW5kIEFscGhhIGFyZSAgICAgICAgICAgICAgICAgICAgKgotICogICAgICAgdGhlb3JldGljYWxseSA8IDEuMC4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqCi0gKl9fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fXyovCi0jaW5jbHVkZSAidHlwZWRlZi5oIgotI2luY2x1ZGUgImJhc2ljX29wLmgiCi0jaW5jbHVkZSAib3Blcl8zMmIuaCIKLSNpbmNsdWRlICJhY2VscC5oIgotCi0jZGVmaW5lIE0gICAxNgotI2RlZmluZSBOQyAgKE0vMikKLQotdm9pZCBJbml0X0xldmluc29uKAotCQlXb3JkMTYgKiBtZW0gICAgICAgICAgICAgICAgICAgICAgICAgIC8qIG91dHB1dCAgOnN0YXRpYyBtZW1vcnkgKDE4IHdvcmRzKSAqLwotCQkpCi17Ci0JU2V0X3plcm8obWVtLCAxOCk7ICAgICAgICAgICAgICAgICAgICAgLyogb2xkX0FbMC4uTS0xXSA9IDAsIG9sZF9yY1swLi4xXSA9IDAgKi8KLQlyZXR1cm47Ci19Ci0KLQotdm9pZCBMZXZpbnNvbigKLQkJV29yZDE2IFJoW10sICAgICAgICAgICAgICAgICAgICAgICAgICAvKiAoaSkgICAgIDogUmhbTSsxXSBWZWN0b3Igb2YgYXV0b2NvcnJlbGF0aW9ucyAobXNiKSAqLwotCQlXb3JkMTYgUmxbXSwgICAgICAgICAgICAgICAgICAgICAgICAgIC8qIChpKSAgICAgOiBSbFtNKzFdIFZlY3RvciBvZiBhdXRvY29ycmVsYXRpb25zIChsc2IpICovCi0JCVdvcmQxNiBBW10sICAgICAgICAgICAgICAgICAgICAgICAgICAgLyogKG8pIFExMiA6IEFbTV0gICAgTFBDIGNvZWZmaWNpZW50cyAgKG0gPSAxNikgICAgICAgKi8KLQkJV29yZDE2IHJjW10sICAgICAgICAgICAgICAgICAgICAgICAgICAvKiAobykgUTE1IDogcmNbTV0gICBSZWZsZWN0aW9uIGNvZWZmaWNpZW50cy4gICAgICAgICAqLwotCQlXb3JkMTYgKiBtZW0gICAgICAgICAgICAgICAgICAgICAgICAgIC8qIChpL28pICAgOnN0YXRpYyBtZW1vcnkgKDE4IHdvcmRzKSAgICAgICAgICAgICAgICAgICovCi0JICAgICApCi17Ci0JV29yZDMyIGksIGo7Ci0JV29yZDE2IGhpLCBsbzsKLQlXb3JkMTYgS2gsIEtsOyAgICAgICAgICAgICAgICAgICAgICAgICAvKiByZWZsZWN0aW9uIGNvZWZmaWNpZW50OyBoaSBhbmQgbG8gICAgICAgICAgICovCi0JV29yZDE2IGFscF9oLCBhbHBfbCwgYWxwX2V4cDsgICAgICAgICAgLyogUHJlZGljdGlvbiBnYWluOyBoaSBsbyBhbmQgZXhwb25lbnQgICAgICAgICAqLwotCVdvcmQxNiBBaFtNICsgMV0sIEFsW00gKyAxXTsgICAgICAgICAgIC8qIExQQyBjb2VmLiBpbiBkb3VibGUgcHJlYy4gICAgICAgICAgICAgICAgICAgKi8KLQlXb3JkMTYgQW5oW00gKyAxXSwgQW5sW00gKyAxXTsgICAgICAgICAvKiBMUEMgY29lZi5mb3IgbmV4dCBpdGVyYXRpb24gaW4gZG91YmxlIHByZWMuICovCi0JV29yZDMyIHQwLCB0MSwgdDI7ICAgICAgICAgICAgICAgICAgICAgLyogdGVtcG9yYXJ5IHZhcmlhYmxlICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotCVdvcmQxNiAqb2xkX0EsICpvbGRfcmM7Ci0KLQkvKiBMYXN0IEEoeikgZm9yIGNhc2Ugb2YgdW5z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91IG1heSBvYnRhaW4gYSBjb3B5IG9mIHRoZSBMaWNlbnNlIGF0Ci0gKioKLSAqKiAgICAgaHR0cDovL3d3dy5hcGFjaGUub3JnL2xpY2Vuc2VzL0xJQ0VOU0UtMi4wCi0gKioKLSAqKiBVbmxlc3MgcmVxdWlyZWQgYnkgYXBwbGljYWJsZSBsYXcgb3IgYWdyZWVkIHRvIGluIHdyaXRpbmcsIHNvZnR3YXJlCi0gKiogZGlzdHJpYnV0ZWQgdW5kZXIgdGhlIExpY2Vuc2UgaXMgZGlzdHJpYnV0ZWQgb24gYW4gIkFTIElTIiBCQVNJUywKLSAqKiBXSVRIT1VUIFdBUlJBTlRJRVMgT1IgQ09ORElUSU9OUyBPRiBBTlkgS0lORCwgZWl0aGVyIGV4cHJlc3Mgb3IgaW1wbGllZC4KLSAqKiBTZWUgdGhlIExpY2Vuc2UgZm9yIHRoZSBzcGVjaWZpYyBsYW5ndWFnZSBnb3Zlcm5pbmcgcGVybWlzc2lvbnMgYW5kCi0gKiogbGltaXRhdGlvbnMgdW5kZXIgdGhlIExpY2Vuc2UuCi0gKi8KLQotLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCi0qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICoKLSogICAgICBGaWxlICAgICAgICAgICAgIDogbG9nMi5jICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKgotKiAgICAgIFB1cnBvc2UgICAgICAgICAgOiBDb21wdXRlcyBsb2cyKExfeCkgICAgICAgICAgICAgICAgICAgICAgICAgICAqCi0qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICoKLSoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLQotI2luY2x1ZGUgImxvZzIuaCIKLS8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgotKiAgICAgICAgICAgICAgICAgICAgICAgICBJTkNMVURFIEZJTEVTCi0qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0jaW5jbHVkZSAidHlwZWRlZi5oIgotI2luY2x1ZGUgImJhc2ljX29wLmgiCi0KLS8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKLSogICAgICAgICAgICAgICAgICAgICAgICAgTE9DQUwgVkFSSUFCTEVTIEFORCBUQUJMRVMKLSoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0jaW5jbHVkZSAibG9nMl90YWIuaCIgICAgIC8qIFRhYmxlIGZvciBMb2cyKCkgKi8KLQotLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKLSoKLSogICBGVU5DVElPTjogICBMb2cyX25vcm0oKQotKgotKiAgIFBVUlBPU0U6ICAgQ29tcHV0ZXMgbG9nMihMX3gsIGV4cCksICB3aGVyZSAgIExfeCBpcyBwb3NpdGl2ZSBhbmQKLSogICAgICAgICAgICAgIG5vcm1hbGl6ZWQsIGFuZCBleHAgaXMgdGhlIG5vcm1hbGlzYXRpb24gZXhwb25lbnQKLSogICAgICAgICAgICAgIElmIExfeCBpcyBuZWdhdGl2ZSBvciB6ZXJvLCB0aGUgcmVzdWx0IGlzIDAuCi0qCi0qICAgREVTQ1JJUFRJT046Ci0qICAgICAgICBUaGUgZnVuY3Rpb24gTG9nMihMX3gpIGlzIGFwcHJveGltYXRlZCBieSBhIHRhYmxlIGFuZCBsaW5lYXIKLSogICAgICAgIGludGVycG9sYXRpb24uIFRoZSBmb2xsb3dpbmcgc3RlcHMgYXJlIHVzZWQgdG8gY29tcHV0ZSBMb2cyKExfeCkKLSoKLSogICAgICAgICAgIDEtIGV4cG9uZW50ID0gMzAtbm9ybV9leHBvbmVudAotKiAgICAgICAgICAgMi0gaSA9IGJpdDI1LWIzMSBvZiBMX3g7ICAzMjw9aTw9NjMgIChiZWNhdXNlIG9mIG5vcm1hbGl6YXRpb24pLgotKiAgICAgICAgICAgMy0gYSA9IGJpdDEwLWIyNAotKiAgICAgICAgICAgNC0gaSAtPTMyCi0qICAgICAgICAgICA1LSBmcmFjdGlvbiA9IHRhYmxlW2ldPDwxNiAtICh0YWJsZVtpXSAtIHRhYmxlW2krMV0pICogYSAqIDIKLSoKLSoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0KLXZvaWQgTG9nMl9ub3JtICgKLQkJV29yZDMyIExfeCwgICAgICAgICAvKiAoaSkgOiBpbnB1dCB2YWx1ZSAobm9ybWFsaXplZCkgICAgICAgICAgICAgICAgICAgICovCi0JCVdvcmQxNiBleHAsICAgICAgICAgLyogKGkpIDogbm9ybV9sIChMX3gpICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotCQlXb3JkMTYgKmV4cG9uZW50LCAgIC8qIChvKSA6IEludGVnZXIgcGFydCBvZiBMb2cyLiAgIChyYW5nZTogMDw9dmFsPD0zMCkgKi8KLQkJV29yZDE2ICpmcmFjdGlvbiAgICAvKiAobykgOiBGcmFjdGlvbmFsIHBhcnQgb2YgTG9nMi4gKHJhbmdlOiAwPD12YWw8MSkgICovCi0JICAgICAgICkKLXsKLQlXb3JkMTYgaSwgYSwgdG1wOwotCVdvcmQzMiBMX3k7Ci0JaWYgKExfeCA8PSAoV29yZDMyKSAwKQotCXsKLQkJKmV4cG9uZW50ID0gMDsKLQkJKmZyYWN0aW9uID0gMDsKLQkJcmV0dXJuOwotCX0KLQkqZXhwb25lbnQgPSAoMzAgLSBleHApOwotCUxfeCA9IChMX3ggPj4gOSk7Ci0JaSA9IGV4dHJhY3RfaCAoTF94KTsgICAgICAgICAgICAgICAgLyogRXh0cmFjdCBiMjUtYjMxICovCi0JTF94ID0gKExfeCA+PiAxKTsKLQlhID0gKFdvcmQxNikoTF94KTsgICAgICAgICAgICAgICAgLyogRXh0cmFjdCBiMTAtYjI0IG9mIGZyYWN0aW9uICovCi0JYSA9IChXb3JkMTYpKGEgJiAoV29yZDE2KTB4N2ZmZik7Ci0JaSAtPSAzMjsKLQlMX3kgPSBMX2RlcG9zaXRfaCAodGFibGVbaV0pOyAgICAgICAvKiB0YWJsZVtpXSA8PCAxNiAgICAgICAgKi8KLQl0bXAgPSB2b19zdWIodGFibGVbaV0sIHRhYmxlW2kgKyAxXSk7IC8qIHRhYmxlW2ldIC0gdGFibGVbaSsxXSAqLwotCUxfeSA9IHZvX0xfbXN1IChMX3ksIHRtcCwgYSk7ICAgICAgICAgIC8qIExfeSAtPSB0bXAqYSoyICAgICAgICAqLwotCSpmcmFjdGlvbiA9IGV4dHJhY3RfaCAoTF95KTsKLQotCXJldHVybjsKLX0KLQotLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKLSoKLSogICBGVU5DVElPTjogICBMb2cyKCkKLSoKLSogICBQVVJQT1NFOiAgIENvbXB1dGVzIGxvZzIoTF94KSwgIHdoZXJlICAgTF94IGlzIHBvc2l0aXZlLgotKiAgICAgICAgICAgICAgSWYgTF94IGlzIG5lZ2F0aXZlIG9yIHplcm8sIHRoZSByZXN1bHQgaXMgMC4KLSoKLSogICBERVNDUklQVElPTjoKLSogICAgICAgIG5vcm1hbGl6ZXMgTF94IGFuZCB0aGVuIGNhbGxzIExv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90IHVzZSB0aGlzIGZpbGUgZXhjZXB0IGluIGNvbXBsaWFuY2Ugd2l0aCB0aGUgTGljZW5zZS4KLSAqKiBZb3UgbWF5IG9idGFpbiBhIGNvcHkgb2YgdGhlIExpY2Vuc2UgYXQKLSAqKgotICoqICAgICBodHRwOi8vd3d3LmFwYWNoZS5vcmcvbGljZW5zZXMvTElDRU5TRS0yLjAKLSAqKgotICoqIFVubGVzcyByZXF1aXJlZCBieSBhcHBsaWNhYmxlIGxhdyBvciBhZ3JlZWQgdG8gaW4gd3JpdGluZywgc29mdHdhcmUKLSAqKiBkaXN0cmlidXRlZCB1bmRlciB0aGUgTGljZW5zZSBpcyBkaXN0cmlidXRlZCBvbiBhbiAiQVMgSVMiIEJBU0lTLAotICoqIFdJVEhPVVQgV0FSUkFOVElFUyBPUiBDT05ESVRJT05TIE9GIEFOWSBLSU5ELCBlaXRoZXIgZXhwcmVzcyBvciBpbXBsaWVkLgotICoqIFNlZSB0aGUgTGljZW5zZSBmb3IgdGhlIHNwZWNpZmljIGxhbmd1YWdlIGdvdmVybmluZyBwZXJtaXNzaW9ucyBhbmQKLSAqKiBsaW1pdGF0aW9ucyB1bmRlciB0aGUgTGljZW5zZS4KLSAqLwotCi0vKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKLSogICAgICAgRmlsZTogbHBfZGVjMi5jICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKgotKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqCi0qCURlc2NyaXB0aW9uOkRlY2ltYXRlIGEgdmVjdG9yIGJ5IDIgd2l0aCAybmQgb3JkZXIgZmlyIGZpbHRlciAgICoKLSogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKgotKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotCi0jaW5jbHVkZSAidHlwZWRlZi5oIgotI2luY2x1ZGUgImJhc2ljX29wLmgiCi0jaW5jbHVkZSAiY25zdC5oIgotCi0jZGVmaW5lIExfRklSICA1Ci0jZGVmaW5lIExfTUVNICAoTF9GSVItMikKLQotLyogc3RhdGljIGZsb2F0IGhfZmlyW0xfRklSXSA9IHswLjEzLCAwLjIzLCAwLjI4LCAwLjIzLCAwLjEzfTsgKi8KLS8qIGZpeGVkLXBvaW50OiBzdW0gb2YgY29lZiA9IDMyNzY3IHRvIGF2b2lkIG92ZXJmbG93IG9uIERDICovCi1zdGF0aWMgV29yZDE2IGhfZmlyW0xfRklSXSA9IHs0MjYwLCA3NTM2LCA5MTc1LCA3NTM2LCA0MjYwfTsKLQotdm9pZCBMUF9EZWNpbTIoCi0JCVdvcmQxNiB4W10sICAgICAgICAgICAgICAgICAgICAgICAgICAgLyogaW4vb3V0OiBzaWduYWwgdG8gcHJvY2VzcyAgICAgICAgICovCi0JCVdvcmQxNiBsLCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLyogaW5wdXQgOiBzaXplIG9mIGZpbHRlcmluZyAgICAgICAgICovCi0JCVdvcmQxNiBtZW1bXSAgICAgICAgICAgICAgICAgICAgICAgICAgLyogaW4vb3V0OiBtZW1vcnkgKHNpemU9MykgICAgICAgICAgICovCi0JICAgICAgKQotewotCVdvcmQxNiAqcF94LCB4X2J1ZltMX0ZSQU1FICsgTF9NRU1dOwotCVdvcmQzMiBpLCBqOwotCVdvcmQzMiBMX3RtcDsKLQkvKiBjb3B5IGluaXRpYWwgZmlsdGVyIHN0YXRlcyBpbnRvIGJ1ZmZlciAqLwotCXBfeCA9IHhfYnVmOwotCWZvciAoaSA9IDA7IGkgPCBMX01FTTsgaSsrKQotCXsKLQkJKnBfeCsrID0gbWVtW2ldOwotCQltZW1baV0gPSB4W2w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S4KLSAqKiBZb3UgbWF5IG9idGFpbiBhIGNvcHkgb2YgdGhlIExpY2Vuc2UgYXQKLSAqKgotICoqICAgICBodHRwOi8vd3d3LmFwYWNoZS5vcmcvbGljZW5zZXMvTElDRU5TRS0yLjAKLSAqKgotICoqIFVubGVzcyByZXF1aXJlZCBieSBhcHBsaWNhYmxlIGxhdyBvciBhZ3JlZWQgdG8gaW4gd3JpdGluZywgc29mdHdhcmUKLSAqKiBkaXN0cmlidXRlZCB1bmRlciB0aGUgTGljZW5zZSBpcyBkaXN0cmlidXRlZCBvbiBhbiAiQVMgSVMiIEJBU0lTLAotICoqIFdJVEhPVVQgV0FSUkFOVElFUyBPUiBDT05ESVRJT05TIE9GIEFOWSBLSU5ELCBlaXRoZXIgZXhwcmVzcyBvciBpbXBsaWVkLgotICoqIFNlZSB0aGUgTGljZW5zZSBmb3IgdGhlIHNwZWNpZmljIGxhbmd1YWdlIGdvdmVybmluZyBwZXJtaXNzaW9ucyBhbmQKLSAqKiBsaW1pdGF0aW9ucyB1bmRlciB0aGUgTGljZW5zZS4KLSAqLwotCi0vKl9fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fXwotfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwKLXwgIFRoaXMgZmlsZSBjb250YWlucyBtYXRoZW1hdGljIG9wZXJhdGlvbnMgaW4gZml4ZWQgcG9pbnQuICAgICAgICAgICAgICAgICB8Ci18ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfAotfCAgSXNxcnQoKSAgICAgICAgICAgICAgOiBpbnZlcnNlIHNxdWFyZSByb290ICgxNiBiaXRzIHByZWNpc2lvbikuICAgICAgICAgIHwKLXwgIFBvdzIoKSAgICAgICAgICAgICAgIDogMl54ICAoMTYgYml0cyBwcmVjaXNpb24pLiAgICAgICAgICAgICAgICAgICAgICAgICB8Ci18ICBMb2cyKCkgICAgICAgICAgICAgICA6IGxvZzIgKDE2IGJpdHMgcHJlY2lzaW9uKS4gICAgICAgICAgICAgICAgICAgICAgICAgfAotfCAgRG90X3Byb2R1Y3QoKSAgICAgICAgOiBzY2FsYXIgcHJvZHVjdCBvZiA8eFtdLHlbXT4gICAgICAgICAgICAgICAgICAgICAgIHwKLXwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8Ci18ICBUaGVzZSBvcGVyYXRpb25zIGFyZSBub3Qgc3RhbmRhcmQgZG91YmxlIHByZWNpc2lvbiBvcGVyYXRpb25zLiAgICAgICAgICAgfAotfCAgVGhleSBhcmUgdXNlZCB3aGVyZSBsb3cgY29tcGxleGl0eSBpcyBpbXBvcnRhbnQgYW5kIHRoZSBmdWxsIDMyIGJpdHMgICAgIHwKLXwgIHByZWNpc2lvbiBpcyBub3QgbmVjZXNzYXJ5LiBGb3IgZXhhbXBsZSwgdGhlIGZ1bmN0aW9uIERpdl8zMigpIGhhcyBhICAgICB8Ci18ICAyNCBiaXRzIHByZWNpc2lvbiB3aGljaCBpcyBlbm91Z2ggZm9yIG91ciBwdXJwb3Nlcy4gICAgICAgICAgICAgICAgICAgICAgfAotfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwKLXwgIEluIHRoaXMgZmlsZSwgdGhlIHZhbHVlcyB1c2UgdGhlc2VzIHJlcHJlc2VudGF0aW9uczogICAgICAgICAgICAgICAgICAgICB8Ci18ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfAotfCAgV29yZDMyIExfMzIgICAgIDogc3RhbmRhcmQgc2lnbmVkIDMyIGJpdHMgZm9ybWF0ICAgICAgICAgICAgICAgICAgICAgICAgIHwKLXwgIFdvcmQxNiBoaSwgbG8gICA6IExfMzIgPSBoaTw8MTYgKyBsbzw8MSAgKERQRiAtIERvdWJsZSBQcmVjaXNpb24gRm9ybWF0KSB8Ci18ICBXb3JkMzIgZnJhYywgV29yZDE2IGV4cCA6IExfMzIgPSBmcmFjIDw8IGV4cC0zMSAgKG5vcm1hbGlzZWQgZm9ybWF0KSAgICAgfAotfCAgV29yZDE2IGludCwgZnJhYyAgICAgICAgOiBMXzMyID0gaW50LmZyYWMgICAgICAgIChmcmFjdGlvbmFsIGZvcm1hdCkgICAgIHwKLXxfX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX198Ci0qLwotI2luY2x1ZGUgInR5cGVkZWYuaCIKLSNpbmNsdWRlICJiYXNpY19vcC5oIgotI2luY2x1ZGUgIm1hdGhfb3AuaCIKLQotLypfX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX18KLXwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8Ci18ICAgRnVuY3Rpb24gTmFtZSA6IElzcXJ0ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfAotfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwKLXwgICAgICAgQ29tcHV0ZSAxL3NxcnQoTF94KS4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8Ci18ICAgICAgIGlmIExfeCBpcyBuZWdhdGl2ZSBvciB6ZXJvLCByZXN1bHQgaXMgMSAoN2ZmZmZmZmYpLiAgICAgICAgICAgICAgICAgfAotfC0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLXwKLXwgIEFsZ29yaXRobTogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8Ci18ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfAotfCAgIDEtIE5vcm1hbGl6YXRpb24gb2YgTF94LiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwKLXwgICAyLSBjYWxsIElzcXJ0X24oTF94LCBleHBvbmFudCkgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8Ci18ICAgMy0gTF95ID0gTF94IDw8IGV4cG9uYW50ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfAotfF9fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX3wKLSovCi1Xb3JkMzIgSXNxcnQoICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLyogKG8pIFEzMSA6IG91dHB1dCB2YWx1ZSAocmFuZ2U6IDA8PXZhbDwxKSAgICAgICAgICovCi0JCVdvcmQzMiBMX3ggICAgICAgICAgICAgICAgICAgICAgICAgICAgLyogKGkpIFEwICA6IGlucHV0IHZhbHVlICAocmFuZ2U6IDA8PXZhbDw9N2ZmZmZmZmYpICovCi0JICAgICkKLXsKLQlXb3JkMTYgZXhwOwotCVdvcmQzMiBMX3k7Ci0JZXhwID0gbm9ybV9sKExfeCk7Ci0JTF94ID0gKExfeCA8PCBleHApOyAgICAgICAgICAgICAgICAgLyogTF94IGlzIG5vcm1hbGl6ZWQgKi8KLQlleHAgPSAoMzEgLSBleHApOwotCUlzcXJ0X24oJkxfeCwgJmV4cCk7Ci0JTF95ID0gKExfeCA8PCBleHApOyAgICAgICAgICAgICAgICAgLyogZGVub3JtYWxpemF0aW9uICAgKi8KLQlyZXR1cm4gKExfeSk7Ci19Ci0KLS8qX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fCi18ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfAotfCAgIEZ1bmN0aW9uIE5hbWUgOiBJc3FydF9uICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwKLXwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8Ci18ICAgICAgIENvbXB1dGUgMS9zcXJ0KHZhbHVlKS4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfAotfCAgICAgICBpZiB2YWx1ZSBpcyBuZWdhdGl2ZSBvciB6ZXJvLCByZXN1bHQgaXMgMSAoZnJhYz03ZmZmZmZmZiwgZXhwPTApLiAgIHwKLXwtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS18Ci18ICBBbGdvcml0aG06ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfAotfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwKLXwgICBUaGUgZnVuY3Rpb24gMS9zcXJ0KHZhbHVlKSBpcyBhcHByb3hpbWF0ZWQgYnkgYSB0YWJsZSBhbmQgbGluZWFyICAgICAgICB8Ci18ICAgaW50ZXJwb2xhdGlvbi4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfAotfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwKLXwgICAxLSBJZiBleHBvbmFudCBpcyBvZGQgdGhlbiBzaGlmdCBmcmFjdGlvbiByaWdodCBvbmNlLiAgICAgICAgICAgICAgICAgICB8Ci18ICAgMi0gZXhwb25hbnQgPSAtKChleHBvbmFudC0xKT4+MSkgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfAotfCAgIDMtIGkgPSBiaXQyNS1iMzAgb2YgZnJhY3Rpb24sIDE2IDw9IGkgPD0gNjMgLT5iZWNhdXNlIG9mIG5vcm1hbGl6YXRpb24uIHwKLXwgICA0LSBhID0gYml0MTAtYjI0ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8Ci18ICAgNS0gaSAtPTE2ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfAotfCAgIDYtIGZyYWN0aW9uID0gdGFibGVbaV08PDE2IC0gKHRhYmxlW2ldIC0gdGFibGVbaSsxXSkgKiBhICogMiAgICAgICAgICAgIHwKLXxfX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX198Ci0qLwotc3RhdGljIFdvcmQxNiB0YWJsZV9pc3FydFs0OV0gPQotewotCTMyNzY3LCAzMTc5MCwgMzA4OTQsIDMwMDcwLCAyOTMwOSwgMjg2MDIsIDI3OTQ1LCAyNzMzMCwgMjY3NTUsIDI2MjE0LAotCTI1NzA1LCAyNTIyNSwgMjQ3NzAsIDI0MzM5LCAyMzkzMCwgMjM1NDEsIDIzMTcwLCAyMjgxNywgMjI0NzksIDI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sgICAgICAgICAgICAgICAgICAvKiBFeHRyYWN0IGIxMC1iMjQgKi8KLQlhID0gKFdvcmQxNikgKGEgJiAoV29yZDE2KSAweDdmZmYpOwotCWkgLT0gMTY7Ci0JKmZyYWMgPSBMX2RlcG9zaXRfaCh0YWJsZV9pc3FydFtpXSk7ICAgLyogdGFibGVbaV0gPDwgMTYgICAgICAgICAqLwotCXRtcCA9IHZvX3N1Yih0YWJsZV9pc3FydFtpXSwgdGFibGVfaXNxcnRbaSArIDFdKTsgICAgICAvKiB0YWJsZVtpXSAtIHRhYmxlW2krMV0pICovCi0JKmZyYWMgPSB2b19MX21zdSgqZnJhYywgdG1wLCBhKTsgICAgICAgICAgLyogZnJhYyAtPSAgdG1wKmEqMiAgICAgICAqLwotCi0JcmV0dXJuOwotfQotCi0vKl9fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fXwotfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwKLXwgICBGdW5jdGlvbiBOYW1lIDogUG93MigpICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8Ci18ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfAotfCAgICAgTF94ID0gcG93KDIuMCwgZXhwb25hbnQuZnJhY3Rpb24pICAgICAgICAgKGV4cG9uYW50ID0gaW50ZXJnZXIgcGFydCkgIHwKLXwgICAgICAgICA9IHBvdygyLjAsIDAuZnJhY3Rpb24pIDw8IGV4cG9uYW50ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8Ci18LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tfAotfCAgQWxnb3JpdGhtOiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwKLXwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8Ci18ICAgVGhlIGZ1bmN0aW9uIFBvdzIoTF94KSBpcyBhcHByb3hpbWF0ZWQgYnkgYSB0YWJsZSBhbmQgbGluZWFyICAgICAgICAgICAgfAotfCAgIGludGVycG9sYXRpb24uICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwKLXwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8Ci18ICAgMS0gaSA9IGJpdDEwLWIxNSBvZiBmcmFjdGlvbiwgICAwIDw9IGkgPD0gMzEgICAgICAgICAgICAgICAgICAgICAgICAgICAgfAotfCAgIDItIGEgPSBiaXQwLWI5ICAgb2YgZnJhY3Rpb24gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwKLXwgICAzLSBMX3ggPSB0YWJsZVtpXTw8MTYgLSAodGFibGVbaV0gLSB0YWJsZVtpKzFdKSAqIGEgKiAyICAgICAgICAgICAgICAgICB8Ci18ICAgNC0gTF94ID0gTF94ID4+ICgzMC1leHBvbmFudCkgICAgICh3aXRoIHJvdW5kaW5nKSAgICAgICAgICAgICAgICAgICAgICAgfAotfF9fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX3wKLSovCi1zdGF0aWMgV29yZDE2IHRhYmxlX3BvdzJbMzNdID0KLXsKLQkxNjM4NCwgMTY3NDMsIDE3MTA5LCAxNzQ4NCwgMTc4NjcsIDE4MjU4LCAxODY1OCwgMTkwNjYsIDE5NDg0LCAxOT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ZV9wb3cyW2ldKTsgICAgICAvKiB0YWJsZVtpXSA8PCAxNiAgICAgICAgKi8KLQl0bXAgPSB2b19zdWIodGFibGVfcG93MltpXSwgdGFibGVfcG93MltpICsgMV0pOyAgICAgICAgLyogdGFibGVbaV0gLSB0YWJsZVtpKzFdICovCi0JTF94IC09ICh0bXAgKiBhKTw8MTsgICAgICAgICAgICAgIC8qIExfeCAtPSB0bXAqYSoyICAgICAgICAqLwotCi0JZXhwID0gdm9fc3ViKDMwLCBleHBvbmFudCk7Ci0JTF94ID0gdm9fTF9zaHJfcihMX3gsIGV4cCk7Ci0KLQlyZXR1cm4gKExfeCk7Ci19Ci0KLS8qX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fCi18ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfAotfCAgIEZ1bmN0aW9uIE5hbWUgOiBEb3RfcHJvZHVjdDEyKCkgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwKLXwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8Ci18ICAgICAgIENvbXB1dGUgc2NhbGFyIHByb2R1Y3Qgb2YgPHhbXSx5W10+IHVzaW5nIGFjY3VtdWxhdG9yLiAgICAgICAgICAgICAgfAotfCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwKLXwgICAgICAgVGhlIHJlc3VsdCBpcyBub3JtYWxpemVkIChpbiBRMzEpIHdpdGggZXhwb25lbnQgKDAuLjMwKS4gICAgICAgICAgICB8Ci18LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tfAotfCAgQWxnb3JpdGhtOiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwKLXwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8Ci18ICAgICAgIGRvdF9wcm9kdWN0ID0gc3VtKHhbaV0qeVtpXSkgICAgIGk9MC4uTi0xICAgICAgICAgICAgICAgICAgICAgICAgICAgfAotfF9fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX3wKLSovCi0KLVdvcmQzMiBEb3RfcHJvZHVjdDEyKCAgICAgICAgICAgICAgICAgICAgICAvKiAobykgUTMxOiBub3JtYWxpemVkIHJlc3VsdCAoMSA8IHZhbCA8PSAtMSkgKi8KLQkJV29yZDE2IHhbXSwgICAgICAgICAgICAgICAgICAgICAgICAgICAvKiAoaSkgMTJiaXRzOiB4IHZlY3RvciAgICAgICAgICAgICAgICAgICAgICAgKi8KLQkJV29yZDE2IHlbXSwgICAgICAgICAgICAgICAgICAgICAgICAgICAvKiAoaSkgMTJiaXRzOiB5IHZlY3RvciAgICAgICAgICAgICAgICAgICAgICAgKi8KLQkJV29yZDE2IGxnLCAgICAgICAgICAgICAgICAgICAgICAgICAgICAvKiAoaSkgICAgOiB2ZWN0b3IgbGVuZ3RoICAgICAgICAgICAgICAgICAgICAgKi8KLQkJV29yZDE2ICogZXhwICAgICAgICAgICAgICAgICAgICAgICAgICAvKiAobykgICAgOiBleHBvbmVudCBvZiByZXN1bHQgKDAuLiszMCkgICAgICAgKi8KLQkJKQotewotCVdvcmQxNiBzZnQ7Ci0JV29yZDMyIGksIExfc3VtOwotCUxfc3VtID0gMDsKLQlmb3IgKGkgPSAwOyBpIDwgbGc7IGkrKykKLQl7Ci0JCUxfc3VtICs9IHhbaV0g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Zywgc29mdHdhcmUKLSAqKiBkaXN0cmlidXRlZCB1bmRlciB0aGUgTGljZW5zZSBpcyBkaXN0cmlidXRlZCBvbiBhbiAiQVMgSVMiIEJBU0lTLAotICoqIFdJVEhPVVQgV0FSUkFOVElFUyBPUiBDT05ESVRJT05TIE9GIEFOWSBLSU5ELCBlaXRoZXIgZXhwcmVzcyBvciBpbXBsaWVkLgotICoqIFNlZSB0aGUgTGljZW5zZSBmb3IgdGhlIHNwZWNpZmljIGxhbmd1YWdlIGdvdmVybmluZyBwZXJtaXNzaW9ucyBhbmQKLSAqKiBsaW1pdGF0aW9ucyB1bmRlciB0aGUgTGljZW5zZS4KLSAqLwotCi0vKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgotCUZpbGU6CQltZW1fYWxpZ24uYwotCi0JQ29udGVudDoJTWVtb3J5IGFsbG9jIGFsaWdubWVudHMgZnVuY3Rpb25zCi0KLSoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0KLQotI2luY2x1ZGUJIm1lbV9hbGlnbi5oIgotI2lmZGVmIF9NU0NfVkVSCi0jaW5jbHVkZQk8c3RkZGVmLmg+Ci0jZWxzZQotI2luY2x1ZGUJPHN0ZGludC5oPgotI2VuZGlmCi0KLS8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgotKgotKiBmdW5jdGlvbiBuYW1lOiBtZW1fbWFsbG9jCi0qIGRlc2NyaXB0aW9uOiAgbWFsbG9jIHRoZSBhbGlnbm1lbnRzIG1lbW9yeQotKiByZXR1cm5zOiAgICAgIHRoZSBwb2ludCBvZiB0aGUgbWVtb3J5Ci0qCi0qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqK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ioqKioqKgotICogIFRoaXMgZmlsZSBjb250YWlucyBvcGVyYXRpb25zIGluIGRvdWJsZSBwcmVjaXNpb24uICAgICAgICAgICAgICAgICAgICAgICAqCi0gKiAgVGhlc2Ugb3BlcmF0aW9ucyBhcmUgbm90IHN0YW5kYXJkIGRvdWJsZSBwcmVjaXNpb24gb3BlcmF0aW9ucy4gICAgICAgICAgICoKLSAqICBUaGV5IGFyZSB1c2VkIHdoZXJlIHNpbmdsZSBwcmVjaXNpb24gaXMgbm90IGVub3VnaCBidXQgdGhlIGZ1bGwgMzIgYml0cyAgKgotICogIHByZWNpc2lvbiBpcyBub3QgbmVjZXNzYXJ5LiBGb3IgZXhhbXBsZSwgdGhlIGZ1bmN0aW9uIERpdl8zMigpIGhhcyBhICAgICAqCi0gKiAgMjQgYml0cyBwcmVjaXNpb24gd2hpY2ggaXMgZW5vdWdoIGZvciBvdXIgcHVycG9zZXMuICAgICAgICAgICAgICAgICAgICAgICoKLSAqICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKgotICogIFRoZSBkb3VibGUgcHJlY2lzaW9uIG51bWJlcnMgdXNlIGEgc3BlY2lhbCByZXByZXNlbnRhdGlvbjogICAgICAgICAgICAgICAqCi0gKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICoKLSAqICAgICBMXzMyID0gaGk8PDE2ICsgbG88PDEgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKgotICogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqCi0gKiAgTF8zMiBpcyBhIDMyIGJpdCBpbnRlZ2VyLiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICoKLSAqICBoaSBhbmQgbG8gYXJlIDE2IGJpdCBzaWduZWQgaW50ZWdlcnMuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKgotICogIEFzIHRoZSBsb3cgcGFydCBhbHNvIGNvbnRhaW5zIHRoZSBzaWduLCB0aGlzIGFsbG93cyBmYXN0IG11bHRpcGxpY2F0aW9uLiAqCi0gKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICoKLSAqICAgICAgMHg4MDAwIDAwMDAgPD0gTF8zMiA8PSAweDdmZmYgZmZmZS4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKgotICogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqCi0gKiAgV2Ugd2lsbCB1c2UgRFBGIChEb3VibGUgUHJlY2lzaW9uIEZvcm1hdCApaW4gdGhpcyBmaWxlIHRvIHNwZWNpZnkgICAgICAgICoKLSAqICB0aGlzIHNwZWNpYWwgZm9ybWF0LiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKgotICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCi0qLwotI2luY2x1ZGUgInR5cGVkZWYuaCIKLSNpbmNsdWRlICJiYXNpY19vcC5oIgotI2luY2x1ZGUgIm9wZXJfMzJiLmgiCi0KLS8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgotICogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqCi0gKiAgRnVuY3Rpb24gTF9FeHRyYWN0KCkgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICoKLSAqICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKgotICogIEV4dHJhY3QgZnJvbSBhIDMyIGJpdCBpbnRlZ2VyIHR3byAxNiBiaXQgRFBGLiAgICAgICAgICAgICAgICAgICAgICAgICAgICAqCi0gKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICoKLSAqICBBcmd1bWVudHM6ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKgotICogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqCi0gKiAgIExfMzIgICAgICA6IDMyIGJpdCBpbnRlZ2VyLiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICoKLSAqICAgICAgICAgICAgICAgMHg4MDAwIDAwMDAgPD0gTF8zMiA8PSAweDdmZmYgZmZmZi4gICAgICAgICAgICAgICAgICAgICAgICAgKgotICogICBoaSAgICAgICAgOiBiMTYgdG8gYjMxIG9mIExfMzIgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqCi0gKiAgIGxvICAgICAgICA6IChMXzMyIC0gaGk8PDE2KT4+MSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICoKLSAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgotKi8KLQotX19pbmxpbmUgdm9pZCBWT19MX0V4dHJhY3QgKFdvcmQzMiBMXzMyLCBXb3JkMTYgKmhpLCBXb3JkMTYgKmxvKQotewotCSpoaSA9IChXb3JkMTYpKExfMzIgPj4gMTYpOwotCSpsbyA9IChXb3JkMTYpKChMXzMyICYgMHhmZmZmKSA+PiAxKTsKLQlyZXR1cm47Ci19Ci0KLS8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgotICogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqCi0gKiAgRnVuY3Rpb24gTF9Db21wKCkgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICoKLSAqICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKgotICogIENvbXBvc2UgZnJvbSB0d28gMTYgYml0IERQRiBhIDMyIGJpdCBpbnRlZ2VyLiAgICAgICAgICAgICAgICAgICAgICAgICAgICAqCi0gKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICoKLSAqICAgICBMXzMyID0gaGk8PDE2ICsgbG88PDEgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKgotICogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqCi0gKiAgQXJndW1lbnRzOiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICoKLSAqICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKgotICogICBoaSAgICAgICAgbXNiICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqCi0gKiAgIGxvICAgICAgICBsc2YgKHdpdGggc2lnbikgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICoKLSAqICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKgotICogICBSZXR1cm4gVmFsdWUgOiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqCi0gKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICoKLSAqICAgICAgICAgICAgIDMyIGJpdCBsb25nIHNpZ25lZCBpbnRlZ2VyIChXb3JkMzIpIHdob3NlIHZhbHVlIGZhbGxzIGluIHRoZSAgKgotICogICAgICAgICAgICAgcmFuZ2UgOiAweDgwMDAgMDAwMCA8PSBMXzMyIDw9IDB4N2ZmZiBmZmYwLiAgICAgICAgICAgICAgICAgICAqCi0gKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICoKLSAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgotKi8KLQotV29yZDMyIExfQ29tcCAoV29yZDE2IGhpLCBXb3JkMTYgbG8pCi17Ci0JV29yZDMyIExfMzI7Ci0KLQlMXzMyID0gTF9kZXBvc2l0X2ggKGhpKTsKLQotCXJldHVybiAoTF9tYWMgKExfMzIsIGxvLCAxKSk7ICAgICAgIC8qID0gaGk8PDE2ICsgbG88PDEgKi8KLX0KLQotLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCi0gKiBGdW5jdGlvbiBNcHlfMzIoKSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICoKLSAqICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKgotICogICBNdWx0aXBseSB0d28gMzIgYml0IGludGVnZXJzIChEUEYpLiBUaGUgcmVzdWx0IGlzIGRpdmlkZWQgYnkgMioqMzEgICAgICAqCi0gKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICoKLSAqICAgTF8zMiA9IChoaTEqaGkyKTw8MSArICggKGhpMSpsbzIpPj4xNSArIChsbzEqaGkyKT4+MTUgKTw8MSAgICAgICAgICAgICAgKgotICogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqCi0gKiAgIFRoaXMgb3BlcmF0aW9uIGNhbiBhbHNvIGJlIHZpZXdlZCBhcyB0aGUgbXVsdGlwbGljYXRpb24gb2YgdHdvIFEzMSAgICAgICoKLSAqICAgbnVtYmVyIGFuZCB0aGUgcmVzdWx0IGlzIGFsc28gaW4gUTMxLiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKgotICogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqCi0gKiBBcmd1bWVudHM6ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICoKLSAqICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKgotICogIGhpMSAgICAgICAgIGhpIHBhcnQgb2YgZmlyc3QgbnVtYmVyICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqCi0gKiAgbG8xICAgICAgICAgbG8gcGFydCBvZiBmaXJzdCBudW1iZXIgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICoKLSAqICBoaTIgICAgICAgICBoaSBwYXJ0IG9mIHNlY29uZCBudW1iZXIgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKgotICogIGxvMiAgICAgICAgIGxvIHBhcnQgb2Ygc2Vjb25kIG51bWJlciAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqCi0gKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICoKLSAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgotKi8KLQotX19pbmxpbmUgV29yZDMyICBNcHlfMzIgKFdvcmQxNiBoaTEsIFdvcmQxNiBsbzEsIFdvcmQxNiBoaTIsIFdvcmQxNiBsbzIpCi17Ci0JV29yZDMyIExfMzI7Ci0JTF8zMiA9IChoaTEgKiBoaTIpOwotCUxfMzIgKz0gKGhpMSAqIGxvMikgPj4gMTU7Ci0JTF8zMiArPSAobG8xICogaGkyKSA+PiAxNTsKLQlMXzMyIDw8PSAxOwotCi0JcmV0dXJuIChMXzMyKTsKLX0KLQotLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCi0gKiBGdW5jdGlvbiBNcHlfMzJfMTYoKSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICoKLSAqICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKgotICogICBNdWx0aXBseSBhIDE2IGJpdCBpbnRlZ2VyIGJ5IGEgMzIgYml0IChEUEYpLiBUaGUgcmVzdWx0IGlzIGRpdmlkZWQgICAgICAqCi0gKiAgIGJ5IDIqKjE1ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICoKLSAqICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKgotICogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqCi0gKiAgIExfMzIgPSAoaGkxKmxvMik8PDEgKyAoKGxvMSpsbzIpPj4xNSk8PDEgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICoKLSAqICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKgotICogQXJndW1lbnRzOiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqCi0gKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICoKLSAqICBoaSAgICAgICAgICBoaSBwYXJ0IG9mIDMyIGJpdCBudW1iZXIuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKgotICogIGxvICAgICAgICAgIGxvIHBhcnQgb2YgMzIgYml0IG51bWJlci4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqCi0gKiAgbiAgICAgICAgICAgMTYgYml0IG51bWJlci4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICoKLSAqICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKgotICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCi0qLwotCi1fX2lubGluZSBXb3JkMzIgTXB5XzMyXzE2IChXb3JkMTYgaGksIFdvcmQxNiBsbywgV29yZDE2IG4pCi17Ci0JV29yZDMyIExfMzI7Ci0KLQlMXzMyID0gKGhpICogbik8PDE7Ci0JTF8zMiArPSAoKChsbyAqIG4pPj4xNSk8PDEpOwotCi0JcmV0dXJuIChMXzMyKTsKLX0KLQotLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCi0gKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICoKLSAqICAgRnVuY3Rpb24gTmFtZSA6IERpdl8zMiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKgotICogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqCi0gKiAgIFB1cnBvc2UgOiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICoKLSAqICAgICAgICAgICAgIEZyYWN0aW9uYWwgaW50ZWdlciBkaXZpc2lvbiBvZiB0d28gMzIgYml0IG51bWJlcnMuICAgICAgICAgICAgKgotICogICAgICAgICAgICAgTF9udW0gLyBMX2Rlbm9tLiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqCi0gKiAgICAgICAgICAgICBMX251bSBhbmQgTF9kZW5vbSBtdXN0IGJlIHBvc2l0aXZlIGFuZCBMX251bSA8IExfZGVub20uICAgICAgICoKLSAqICAgICAgICAgICAgIExfZGVub20gPSBkZW5vbV9oaTw8MTYgKyBkZW5vbV9sbzw8MSAgICAgICAgICAgICAgICAgICAgICAgICAgKgotICogICAgICAgICAgICAgZGVub21faGkgaXMgYSBub3JtYWxpemUgbnVtYmVyLiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqCi0gKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICoKLSAqICAgSW5wdXRzIDogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKgotICogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqCi0gKiAgICBMX251bSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICoKLSAqICAgICAgICAgICAgIDMyIGJpdCBsb25nIHNpZ25lZCBpbnRlZ2VyIChXb3JkMzIpIHdob3NlIHZhbHVlIGZhbGxzIGluIHRoZSAgKgotICogICAgICAgICAgICAgcmFuZ2UgOiAweDAwMDAgMDAwMCA8IExfbnVtIDwgTF9kZW5vbSAgICAgICAgICAgICAgICAgICAgICAgICAqCi0gKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICoKLSAqICAgIExfZGVub20gPSBkZW5vbV9oaTw8MTYgKyBkZW5vbV9sbzw8MSAgICAgIChEUEYpICAgICAgICAgICAgICAgICAgICAgICAgKgotICogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqCi0gKiAgICAgICBkZW5vbV9oaSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICoKLSAqICAgICAgICAgICAgIDE2IGJpdCBwb3NpdGl2ZSBub3JtYWxpemVkIGludGVnZXIgd2hvc2UgdmFsdWUgZmFsbHMgaW4gdGhlICAgKgotICogICAgICAgICAgICAgcmFuZ2UgOiAweDQwMDAgPCBoaSA8IDB4N2ZmZiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqCi0gKiAgICAgICBkZW5vbV9sbyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICoKLSAqICAgICAgICAgICAgIDE2IGJpdCBwb3NpdGl2ZSBpbnRlZ2VyIHdob3NlIHZhbHVlIGZhbGxzIGluIHRoZSAgICAgICAgICAgICAgKgotICogICAgICAgICAgICAgcmFuZ2UgOiAwIDwgbG8gPCAweDdmZmYgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqCi0gKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICoKLSAqICAgUmV0dXJuIFZhbHVlIDogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKgotICogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqCi0gKiAgICBMX2RpdiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICoKLSAqICAgICAgICAgICAgIDMyIGJpdCBsb25nIHNpZ25lZCBpbnRlZ2VyIChXb3JkMzIpIHdob3NlIHZhbHVlIGZhbGxzIGluIHRoZSAgKgotICogICAgICAgICAgICAgcmFuZ2UgOiAweDAwMDAgMDAwMCA8PSBMX2RpdiA8PSAweDdmZmYgZmZmZi4gICAgICAgICAgICAgICAgICAqCi0gKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICoKLSAqICBBbGdvcml0aG06ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKgotICogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqCi0gKiAgLSBmaW5kID0gMS9MX2Rlbm9tLiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICoKLSAqICAgICAgRmlyc3QgYXBwcm94aW1hdGlvbjogYXBwcm94ID0gMSAvIGRlbm9tX2hpICAgICAgICAgICAgICAgICAgICAgICAgICAgKgotICogICAgICAxL0xfZGVub20gPSBhcHByb3ggKiAoMi4wIC0gTF9kZW5vbSAqIGFwcHJveCApICAgICAgICAgICAgICAgICAgICAgICAqCi0gKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICoKLSAqICAtICByZXN1bHQgPSBMX251bSAqICgxL0xfZGVub20pICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKgotICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCi0qLwotCi1Xb3JkMzIgRGl2XzMyIChXb3JkMzIgTF9udW0sIFdvcmQxNiBkZW5vbV9oaSwgV29yZDE2IGRlbm9tX2xvKQotewotCVdvcmQxNiBhcHByb3gsIGhpLCBsbywgbl9oaSwgbl9sbzsKLQlXb3JkMzIgTF8zMjsKLQotCS8qIEZpcnN0IGFwcHJveGltYXRpb246IDEgLyBMX2Rlbm9tID0gMS9kZW5vbV9oaSAqLwotCi0JYXBwcm94ID0gZGl2X3MgKChXb3JkMTYpIDB4M2ZmZiwgZGVub21faGkpOwotCi0JLyogMS9MX2Rlbm9tID0gYXBwcm94ICogKDIuMCAtIExfZGVub20gKiBhcHByb3gpICovCi0KLQlMXzMyID0gTXB5XzMyXzE2IChkZW5vbV9oaSwgZGVub21fbG8sIGFwcHJveCk7Ci0KLQlMXzMyID0gTF9zdWIgKChXb3JkMzIpIDB4N2ZmZmZmZmZMLCBMXzMyKTsKLQloaSA9IExfMzIgPj4gMTY7Ci0Jb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cy9MSUNFTlNFLTIuMAotICoqCi0gKiogVW5sZXNzIHJlcXVpcmVkIGJ5IGFwcGxpY2FibGUgbGF3IG9yIGFncmVlZCB0byBpbiB3cml0aW5nLCBzb2Z0d2FyZQotICoqIGRpc3RyaWJ1dGVkIHVuZGVyIHRoZSBMaWNlbnNlIGlzIGRpc3RyaWJ1dGVkIG9uIGFuICJBUyBJUyIgQkFTSVMsCi0gKiogV0lUSE9VVCBXQVJSQU5USUVTIE9SIENPTkRJVElPTlMgT0YgQU5ZIEtJTkQsIGVpdGhlciBleHByZXNzIG9yIGltcGxpZWQuCi0gKiogU2VlIHRoZSBMaWNlbnNlIGZvciB0aGUgc3BlY2lmaWMgbGFuZ3VhZ2UgZ292ZXJuaW5nIHBlcm1pc3Npb25zIGFuZAotICoqIGxpbWl0YXRpb25zIHVuZGVyIHRoZSBMaWNlbnNlLgotICovCi0KLS8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgotKiAgICAgIEZpbGU6IHBfbWVkX29sLmMgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqCi0qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICoKLSogICAgICBEZXNjcmlwdGlvbjogQ29tcHV0ZSB0aGUgb3BlbiBsb29wIHBpdGNoIGxhZyAgICAgICAgICAgICAgICAgICAgKgotKgkgICAgICAgICAgICBvdXRwdXQ6IG9wZW4gbG9vcCBwaXRjaCBsYWcgICAgICAgICAgICAgICAgICAgICAgICAqCi0qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0KLSNpbmNsdWRlICJ0eXBlZGVmLmgiCi0jaW5jbHVkZSAiYmFzaWNfb3AuaCIKLSNpbmNsdWRlICJhY2VscC5oIgotI2luY2x1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VkaWFuNSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqCi0qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqCi0qICAgICAgUmV0dXJucyB0aGUgbWVkaWFuIG9mIHRoZSBzZXQge1hbLTJdLCBYWy0xXSwuLi4sIFhbMl19LCAgICAgICAgICAqCi0qICAgICAgd2hvc2UgZWxlbWVudHMgYXJlIDE2LWJpdCBpbnRlZ2Vycy4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqCi0qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqCi0qICBJbnB1dDogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqCi0qICAgICAgWFstMjoyXSAgIDE2LWJpdCBpbnRlZ2Vycy4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqCi0qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqCi0qICBSZXR1cm46ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqCi0qICAgICAgVGhlIG1lZGlhbiBvZiB7WFstMl0sIFhbLTFdLC4uLiwgWFsyXX0uICAgICAgICAgICAgICAgICAgICAgICAgICAqCi0qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0KLVdvcmQxNiBtZWRpYW41KFdvcmQxNiB4W10pCi17Ci0JV29yZDE2IHgxLCB4MiwgeDMsIHg0LCB4NTsKLQlXb3JkMTYgdG1wOwotCi0JeDEgPSB4Wy0yXTsKLQl4MiA9IHhbLTFdOwotCXgzID0geFswXT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YnV0ZWQgdW5kZXIgdGhlIExpY2Vuc2UgaXMgZGlzdHJpYnV0ZWQgb24gYW4gIkFTIElTIiBCQVNJUywKLSAqKiBXSVRIT1VUIFdBUlJBTlRJRVMgT1IgQ09ORElUSU9OUyBPRiBBTlkgS0lORCwgZWl0aGVyIGV4cHJlc3Mgb3IgaW1wbGllZC4KLSAqKiBTZWUgdGhlIExpY2Vuc2UgZm9yIHRoZSBzcGVjaWZpYyBsYW5ndWFnZSBnb3Zlcm5pbmcgcGVybWlzc2lvbnMgYW5kCi0gKiogbGltaXRhdGlvbnMgdW5kZXIgdGhlIExpY2Vuc2UuCi0gKi8KLQotLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCi0qICAgICAgRmlsZTogcGl0X3NocnAuYyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICoKLSogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKgotKiAgICAgIERlc2NyaXB0aW9uOiBQZXJmb3JtcyBQaXRjaCBzaGFycGVuaW5nIHJvdXRpbmUgICAgICAgICAgICAgICAgICAqCi0qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICoKLSoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLQotI2luY2x1ZGUgInR5cGVkZWYuaCIKLSNpbmNsdWRlICJiYXNpY19vcC5oIgotCi12b2lkIFBpdF9zaHJwKAotCQlXb3JkMTYgKiB4LCAgICAgICAgICAgICAgICAgICAgICAgICAgIC8qIGluL291dDogaW1wdWxzZSByZXNwb25zZSAob3IgYWxnZWJyYWljIGNvZGUpICovCi0JCVdvcmQxNiBwaXRfbGFnLCAgICAgICAgICAgICA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lvbiAyLjAgKHRoZSAiTGljZW5zZSIpOwotICoqIHlvdSBtYXkgbm90IHVzZSB0aGlzIGZpbGUgZXhjZXB0IGluIGNvbXBsaWFuY2Ugd2l0aCB0aGUgTGljZW5zZS4KLSAqKiBZb3UgbWF5IG9idGFpbiBhIGNvcHkgb2YgdGhlIExpY2Vuc2UgYXQKLSAqKgotICoqICAgICBodHRwOi8vd3d3LmFwYWNoZS5vcmcvbGljZW5zZXMvTElDRU5TRS0yLjAKLSAqKgotICoqIFVubGVzcyByZXF1aXJlZCBieSBhcHBsaWNhYmxlIGxhdyBvciBhZ3JlZWQgdG8gaW4gd3JpdGluZywgc29mdHdhcmUKLSAqKiBkaXN0cmlidXRlZCB1bmRlciB0aGUgTGljZW5zZSBpcyBkaXN0cmlidXRlZCBvbiBhbiAiQVMgSVMiIEJBU0lTLAotICoqIFdJVEhPVVQgV0FSUkFOVElFUyBPUiBDT05ESVRJT05TIE9GIEFOWSBLSU5ELCBlaXRoZXIgZXhwcmVzcyBvciBpbXBsaWVkLgotICoqIFNlZSB0aGUgTGljZW5zZSBmb3IgdGhlIHNwZWNpZmljIGxhbmd1YWdlIGdvdmVybmluZyBwZXJtaXNzaW9ucyBhbmQKLSAqKiBsaW1pdGF0aW9ucyB1bmRlciB0aGUgTGljZW5zZS4KLSAqLwotCi0vKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKLSogICAgICBGaWxlOiBwaXRjaF9mNC5jICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKgotKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqCi0qICAgICAgRGVzY3JpcHRpb246IEZpbmQgdGhlIGNsb3NlZCBsb29wIHBpdGNoIHBlcmlvZCB3aXRoICAgICAgICAgICAgICoKLSoJICAgICAgICAgICAgMS80IHN1YnNhbXBsZSByZXNvbHV0aW9uLiAgICAgICAgICAgICAgICAgICAgICAgICAgKgotKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqCi0qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0KLSNpbmNsdWRlICJ0eXBlZGVmLmgiCi0jaW5jbHVkZSAiYmFzaWNfb3AuaCIKLSNpbmNsdWRlICJtYXRoX29wLmgiCi0jaW5jbHVkZSAiYWNlbHAuaCIKLSNpbmNsdWRlICJjbnN0LmgiCi0KLSNkZWZpbmUgVVBfU0FNUCAgICAgIDQKLSNkZWZpbmUgTF9JTlRFUlBPTDEgIDQKLQotLyogTG9jYWwgZnVuY3Rpb25zICovCi0KLSNpZmRlZiBBU01fT1BUCi12b2lkIE5vcm1fY29ycl9hc20oCi0JCVdvcmQxNiBleGNbXSwgICAgICAgICAgICAgICAgICAgICAgICAgLyogKGkpICAgICA6IGV4Y2l0YXRpb24gYnVmZmVyICAgICAgICAgICAgICAgICAgICAgKi8KLQkJV29yZDE2IHhuW10sICAgICAgICAgICAgICAgICAgICAgICAgICAvKiAoaSkgICAgIDogdGFyZ2V0IHZlY3RvciAgICAgICAgICAgICAgICAgICAgICAgICAqLwotCQlXb3JkMTYgaFtdLCAgICAgICAgICAgICAgICAgICAgICAgICAgIC8qIChpKSBRMTUgOiBpbXB1bHNlIHJlc3BvbnNlIG9mIHN5bnRoL3dndCBmaWx0ZXJzICovCi0JCVdvcmQxNiBMX3N1YmZyLAotCQlXb3JkMTYgdF9taW4sICAgICAgICAgICAgICAgICAgICAgICAgIC8qIChpKSAgICAgOiBtaW5pbXVtIHZhbHVlIG9mIHBpdGNoIGxhZy4gICAgICAgICAgICovCi0JCVdvcmQxNiB0X21heCwgICAgICAgICAgICAgICAgICAgICAgICAgLyogKGkpICAgICA6IG1heGltdW0gdmFsdWUgb2YgcGl0Y2ggbGFnLiAgICAgICAgICAgKi8KLQkJV29yZDE2IGNvcnJfbm9ybVtdICAgICAgICAgICAgICAgICAgICAvKiAobykgUTE1IDogbm9ybWFsaXplZCBjb3JyZWxhdGlvbiAgICAgICAgICAgICAgICAqLwotCQkpOwotI2Vsc2UKLXN0YXRpYyB2b2lkIE5vcm1fQ29ycigKLQkJV29yZDE2IGV4Y1tdLCAgICAgICAgICAgICAgICAgICAgICAgICAvKiAoaSkgICAgIDogZXhjaXRhdGlvbiBidWZmZXIgICAgICAgICAgICAgICAgICAgICAqLwotCQlXb3JkMTYgeG5bXSwgICAgICAgICAgICAgICAgICAgICAgICAgIC8qIChpKSAgICAgOiB0YXJnZXQgdmVjdG9yICAgICAgICAgICAgICAgICAgICAgICAgICovCi0JCVdvcmQxNiBoW10sICAgICAgICAgICAgICAgICAgICAgICAgICAgLyogKGkpIFExNSA6IGltcHVsc2UgcmVzcG9uc2Ugb2Ygc3ludGgvd2d0IGZpbHRlcnMgKi8KLQkJV29yZDE2IExfc3ViZnIsCi0JCVdvcmQxNiB0X21pbiwgICAgICAgICAgICAgICAgICAgICAgICAgLyogKGkpICAgICA6IG1pbmltdW0gdmFsdWUgb2YgcGl0Y2ggbGFnLiAgICAgICAgICAgKi8KLQkJV29yZDE2IHRfbWF4LCAgICAgICAgICAgICAgICAgICAgICAgICAvKiAoaSkgICAgIDogbWF4aW11bSB2YWx1ZSBvZiBwaXRjaCBsYWcuICAgICAgICAgICAqLwotCQlXb3JkMTYgY29ycl9ub3JtW10gICAgICAgICAgICAgICAgICAgIC8qIChvKSBRMTUgOiBub3JtYWxpemVkIGNvcnJlbGF0aW9uICAgICAgICAgICAgICAgICovCi0JCSk7Ci0jZW5kaWYKLQotc3RhdGljIFdvcmQxNiBJbnRlcnBvbF80KCAgICAgICAgICAgICAgICAgIC8qIChvKSAgOiBpbnRlcnBvbGF0ZWQgdmFsdWUgICovCi0JCVdvcmQxNiAqIHgsICAgICAgICAgICAgICAgICAgICAgICAgICAgLyogKGkpICA6IGlucHV0IHZlY3RvciAgICAgICAgKi8KLQkJV29yZDMyIGZyYWMgICAgICAgICAgICAgICAgICAgICAgICAgICAvKiAoaSkgIDogZnJhY3Rpb24gKC00Li4rMykgICAqLwotCQkpOwotCi0KLVdvcmQxNiBQaXRjaF9mcjQoICAgICAgICAgICAgICAgICAgICAgICAgICAvKiAobykgICAgIDogcGl0Y2ggcGVyaW9kLiAgICAgICAgICAgICAgICAgICAgICAgICAqLwotCQlXb3JkMTYgZXhjW10sICAgICAgICAgICAgICAgICAgICAgICAgIC8qIChpKSAgICAgOiBleGNpdGF0aW9uIGJ1ZmZlciAgICAgICAgICAgICAgICAgICAgICovCi0JCVdvcmQxNiB4bltdLCAgICAgICAgICAgICAgICAgICAgICAgICAgLyogKGkpICAgICA6IHRhcmdldCB2ZWN0b3IgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLQkJV29yZDE2IGhbXSwgICAgICAgICAgICAgICAgICAgICAgICAgICAvKiAoaSkgUTE1IDogaW1wdWxzZSByZXNwb25zZSBvZiBzeW50aC93Z3QgZmlsdGVycyAqLwotCQlXb3JkMTYgdDBfbWluLCAgICAgICAgICAgICAgICAgICAgICAgIC8qIChpKSAgICAgOiBtaW5pbXVtIHZhbHVlIGluIHRoZSBzZWFyY2hlZCByYW5nZS4gICovCi0JCVdvcmQxNiB0MF9tYXgsICAgICAgICAgICAgICAgICAgICAgICAgLyogKGkpICAgICA6IG1heGltdW0gdmFsdWUgaW4gdGhlIHNlYXJjaGVkIHJhbmdlLiAgKi8KLQkJV29yZDE2ICogcGl0X2ZyYWMsICAgICAgICAgICAgICAgICAgICAvKiAobykgICAgIDogY2hvc2VuIGZyYWN0aW9uICgwLCAxLCAyIG9yIDMpLiAgICAgICAqLwotCQlXb3JkMTYgaV9zdWJmciwgICAgICAgICAgICAgICAgICAgICAgIC8qIChpKSAgICAgOiBpbmRpY2F0b3IgZm9yIGZpcnN0IHN1YmZyYW1lLiAgICAgICA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W9uOiBGaW5kIHRoZSBub3JtYWxpemVkIGNvcnJlbGF0aW9uIGJldHdlZW4gdGhlIHRhcmdldCB2ZWN0b3IgYW5kIHRoZSAgICAqCi0qIGZpbHRlcmVkIHBhc3QgZXhjaXRhdGlvbi4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqCi0qIChjb3JyZWxhdGlvbiBiZXR3ZWVuIHRhcmdldCBhbmQgZmlsdGVyZWQgZXhjaXRhdGlvbiBkaXZpZGVkIGJ5IHRoZSAgICAgICAgICAgICAgICAqCi0qICBzcXVhcmUgcm9vdCBvZiBlbmVyZ3kgb2YgdGFyZ2V0IGFuZCBmaWx0ZXJlZCBleGNpdGF0aW9uKS4gICAgICAgICAgICAgICAgICAgICAgICAqCi0qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0jaWZuZGVmIEFTTV9PUFQKLXN0YXRpYyB2b2lkIE5vcm1fQ29ycigKLQkJV29yZDE2IGV4Y1tdLCAgICAgICAgICAgICAgICAgICAgICAgICAvKiAoaSkgICAgIDogZXhjaXRhdGlvbiBidWZmZXIgICAgICAgICAgICAgICAgICAgICAqLwotCQlXb3JkMTYgeG5bXSwgICAgICAgICAgICAgICAgICAgICAgICAgIC8qIChpKSAgICAgOiB0YXJnZXQgdmVjdG9yICAgICAgICAgICAgICAgICAgICAgICAgICovCi0JCVdvcmQxNiBoW10sICAgICAgICAgICAgICAgICAgICAgICAgICAgLyogKGkpIFExNSA6IGltcHVsc2UgcmVzcG9uc2Ugb2Ygc3ludGgvd2d0IGZpbHRlcnMgKi8KLQkJV29yZDE2IExfc3ViZnIsCi0JCVdvcmQxNiB0X21pbiwgICAgICAgICAgICAgICAgICAgICAgICAgLyogKGkpICAgICA6IG1pbmltdW0gdmFsdWUgb2YgcGl0Y2ggbGFnLiAgICAgICAgICAgKi8KLQkJV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ioqKioqKioqKioqKioqKioqKioqKgotKiBGdW5jdGlvbjogSW50ZXJwb2xfNCgpICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICoKLSogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqCi0qIERlc2NyaXB0aW9uOiBGb3IgaW50ZXJwb2xhdGluZyB0aGUgbm9ybWFsaXplZCBjb3JyZWxhdGlvbiB3aXRoIDEvNCByZXNvbHV0aW9uLiAgICAgKgotKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0KLS8qIDEvNCByZXNvbHV0aW9uIGludGVycG9sYXRpb24gZmlsdGVyICgtMyBkQiBhdCAwLjc5MSpmcy8yKSBpbiBRMTQgKi8KLXN0YXRpYyBXb3JkMTYgaW50ZXI0XzFbNF1bOF0gPQotewotCXstMTIsIDQyMCwgLTE3MzIsIDU0MjksIDEzNDE4LCAtMTI0MiwgNzMsIDMyfSwKLQl7LTI2LCA0NTUsIC0yMTQyLCA5OTEwLCA5OTEwLCAgLTIxNDIsIDQ1NSwgLTI2fSwKLQl7MzIsICA3MywgLTEyNDIsIDEzNDE4LCA1NDI5LCAtMTczMiwgNDIwLCAtMTJ9LAotCXsyMDYsIC03NjYsIDEzNzYsIDE0NzQ2LCAxMzc2LCAtNzY2LCAyMDYsIDB9Ci19OwotCi0vKioqIENvZWZmaWNpZW50cyBpbiBmbG9hdGluZyBwb2ludAotc3RhdGljIGZsb2F0IGludGVyNF8xW1VQX1NBTVAqTF9JTlRFUlBPTDErMV0gPSB7Ci0wLjkwMDAwMCwKLTAuODE4OTU5LCAgMC42MDQ4NTAsICAwLjMzMTM3OSwgIDAuMDgzOTU4LAotLTAuMDc1Nzk1LCAtMC4xMzA3MTcsIC0wLjEw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IT1VUIFdBUlJBTlRJRVMgT1IgQ09ORElUSU9OUyBPRiBBTlkgS0lORCwgZWl0aGVyIGV4cHJlc3Mgb3IgaW1wbGllZC4KLSAqKiBTZWUgdGhlIExpY2Vuc2UgZm9yIHRoZSBzcGVjaWZpYyBsYW5ndWFnZSBnb3Zlcm5pbmcgcGVybWlzc2lvbnMgYW5kCi0gKiogbGltaXRhdGlvbnMgdW5kZXIgdGhlIExpY2Vuc2UuCi0gKi8KLQotLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCi0qICAgICAgRmlsZTogcHJlZF9sdDQuYyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICoKLSogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKgotKiAgICAgIERlc2NyaXB0aW9uOiBDb21wdXRlIHRoZSByZXN1bHQgb2YgbG9uZyB0ZXJtIHByZWRpY3Rpb24gd2l0aCAgICAqCi0qICAgICAgZnJhY3Rpb25hbCBpbnRlcnBvbGF0aW9uIG9mIHJlc29sdXRpb24gMS80ICAgICAgICAgICAgICAgICAgICAgICoKLSogICAgICBvbiByZXR1cm4gZXhjWzAuLkxfc3Vici0xXSBjb250YWlucyB0aGUgaW50ZXJwb2xhdGVkIHNpZ25hbCAgICAgKgotKiAgICAgIChhZGFwdGl2ZSBjb2RlYm9vayBleGNpdGF0aW9uKSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqCi0qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICoKLSoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLQotI2luY2x1ZGUgInR5cGVkZWYuaCIKLSNpbmNsdWRlICJiYX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6IGV4Y2l0YXRpb24gYnVmZmVyICovCi0JCVdvcmQxNiBUMCwgICAgICAgICAgICAgICAgICAgICAgICAgICAgLyogaW5wdXQgOiBpbnRlZ2VyIHBpdGNoIGxhZyAqLwotCQlXb3JkMTYgZnJhYywgICAgICAgICAgICAgICAgICAgICAgICAgIC8qIGlucHV0IDogZnJhY3Rpb24gb2YgbGFnICAgKi8KLQkJV29yZDE2IExfc3ViZnIgICAgICAgICAgICAgICAgICAgICAgICAvKiBpbnB1dCA6IHN1YmZyYW1lIHNpemUgICAgICovCi0JICAgICApCi17Ci0JV29yZDE2IGosIGssICp4OwotCVdvcmQzMiBMX3N1bTsKLQlXb3JkMTYgKnB0ciwgKnB0cjE7Ci0JV29yZDE2ICpwdHIyOwotCi0JeCA9IGV4YyAtIFQwOwotCWZyYWMgPSAtZnJhYzsKLQlpZiAoZnJhYyA8IDApCi0JewotCQlmcmFjICs9IFVQX1NBTVA7Ci0JCXgtLTsKLQl9Ci0JeCAtPSAxNTsgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLyogeCA9IExfSU5URVJQT0wyIC0gMSAqLwotCWsgPSAzIC0gZnJhYzsgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8qIGsgPSBVUF9TQU1QIC0gMSAtIGZyYWMgKi8KLQotCXB0cjIgPSAmKGludGVyNF8yW2tdWzBdKTsKLQlmb3IgKGogPSAwOyBqIDwgTF9zdWJmcjsgaisrKQotCXsKLQkJcHRyID0gcHRyMjsKLQkJcHRyMSA9IHg7Ci0JCUxfc3VtICA9IHZvX211bHQzMigoKnB0cjErKyksICgqcHRyKyspKTsKLQkJTF9zdW0gKz0gdm9fbXVsdDMyKCgqcHRyMSsrKSwgKCpwdHIrKykpOwotCQlMX3N1bSArPSB2b19tdWx0MzIoKCpwdHIxKyspLCAoKnB0cisrKSk7Ci0JCUxfc3VtICs9IHZvX211bHQzMigoKnB0cjErKyksICgqcHRyKyspKTsKLQkJTF9zdW0gKz0gdm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aHJvdWdoIDEgLSBnIHpeLTEgICAgICAgICAqCi0qCSAgICAgICAgICAgUHJlZW1waDIgLS0+IHNpZ25hbCBpcyBtdWx0aXBsaWVkIGJ5IDIgICAgICAgICAgICAgKgotKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICoKLSoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLQotI2luY2x1ZGUgInR5cGVkZWYuaCIKLSNpbmNsdWRlICJiYXNpY19vcC5oIgotCi12b2lkIFByZWVtcGgoCi0JCVdvcmQxNiB4W10sICAgICAgICAgICAgICAgICAgICAgICAgICAgLyogKGkvbykgICA6IGlucHV0IHNpZ25hbCBvdmVyd3JpdHRlbiBieSB0aGUgb3V0cHV0ICovCi0JCVdvcmQxNiBtdSwgICAgICAgICAgICAgICAgICAgICAgICAgICAgLyogKGkpIFExNSA6IHByZWVtcGhhc2lzIGNvZWZmaWNpZW50ICAgICAgICAgICAgICAgICovCi0JCVdvcmQxNiBsZywgICAgICAgICAgICAgICAgICAgICAgICAgICAgLyogKGkpICAgICA6IGxlbmdodCBvZiBmaWx0ZXJpbmcgICAgICAgICAgICAgICAgICAgICovCi0JCVdvcmQxNiAqIG1lbSAgICAgICAgICAgICAgICAgICAgICAgICAgLyogKGkvbykgICA6IG1lbW9yeSAoeFstMV0pICAgICAgICAgICAgICAgICAgICAgICAgICovCi0JICAgICkKLXsKLQlXb3JkMTYgdGVtcDsKLQlXb3JkMzIgaSwgTF90bXA7Ci0KLQl0ZW1wID0geFtsZyAtIDFdOwotCi0JZm9yIChpID0gbGcgLSAxOyBpID4gMDsgaS0tKQotCXsKLQkJTF90bXAgPSBMX2RlcG9zaXRfaCh4W2ldKTsKLQkJTF90bXAgLT0gKHhbaSAtIDFdICogbXUpPDwxOwotCQl4W2ldID0gKExfdG1wICsgMHg4MDAwKT4+MTY7Ci0JfQotCi0JTF90bXAgPSBMX2RlcG9zaXRfaCh4WzBdKTsKLQlMX3RtcCAtPSAoKCptZW0pICogbXUpPDwxOwotCXhbMF0gPSAoTF90bXAgKyAweDgwMDApPj4xNjsKLQotCSptZW0gPSB0ZW1wOwotCi0JcmV0dXJuOwotfQotCi0KLXZvaWQgUHJlZW1waDIoCi0JCVdvcmQxNiB4W10sICAgICAgICAgICAgICAgICAgICAgICAgICAgLyogKGkvbykgICA6IGlucHV0IHNpZ25hbCBvdmVyd3JpdHRlbiBieSB0aGUgb3V0cHV0ICovCi0JCVdvcmQxNiBtdSwgICAgICAgICAgICAgICAgICAgICAgICAgICAgLyogKGkpIFExNSA6IHByZWVtcGhhc2lzIGNvZWZmaWNpZW50ICAgICAgICAgICAgICAgICovCi0JCVdvcmQxNiBsZywgICAgICAgICAgICAgICAgICAgICAgICAgICAgLyogKGkpICAgICA6IGxlbmdodCBvZiBmaWx0ZXJpbmcgICAgICAgICAgICAgICAgICAgICovCi0JCVdvcmQxNiAqIG1lbSAgICAgICAgICAgICAgICAgICAgICAgICAgLyogKGkvbykgICA6IG1lbW9yeSAoeFstMV0pICAgICAgICAgICAgICAgICAgICAgICAgICovCi0JICAgICApCi17Ci0JV29yZDE2IHRlbXA7Ci0JV29yZDMyIGksIExfdG1wOwotCi0JdGVtcCA9IHhbbGcgLSAxXTsKLQotCWZvciAoaSA9IChXb3JkMTYpIChsZyAtIDEpOyBpID4gMDsgaS0tKQotCXsKLQkJTF90bXAgPSBMX2RlcG9zaXRfaCh4W2ldKTsKLQkJTF90bXAgLT0gKHhbaSAtIDFdICogbXUpPDwxOwotCQlMX3RtcCA9IChMX3RtcCA8PCAxKTsKLQkJeFtpXSA9IChMX3RtcCArIDB4ODAwMCk+PjE2OwotCX0KLQotCUxfdG1wID0gTF9kZXBvc2l0X2goeFswXSk7Ci0JTF90bXAgLT0gKCgqbWVtKSAqIG11KTw8MTsKLQlMX3RtcCA9IChMX3RtcCA8PCAxKTsKL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gQU5ZIEtJTkQsIGVpdGhlciBleHByZXNzIG9yIGltcGxpZWQuCi0gKiogU2VlIHRoZSBMaWNlbnNlIGZvciB0aGUgc3BlY2lmaWMgbGFuZ3VhZ2UgZ292ZXJuaW5nIHBlcm1pc3Npb25zIGFuZAotICoqIGxpbWl0YXRpb25zIHVuZGVyIHRoZSBMaWNlbnNlLgotICovCi0KLS8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgotKiAgRmlsZTogcV9nYWluMi5jICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKgotKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKgotKiAgRGVzY3JpcHRpb246ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKgotKiBRdWFudGl6YXRpb24gb2YgcGl0Y2ggYW5kIGNvZGVib29rIGdhaW5zLiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKgotKiBNQSBwcmVkaWN0aW9uIGlzIHBlcmZvcm1lZCBvbiB0aGUgaW5ub3ZhdGlvbiBlbmVyZ3kgKGluIGRCIHdpdGggbWVhbiAgICAgKgotKiByZW1vdmVkKS4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKgotKiBBbiBpbml0aWFsIHByZWRpY3RlZCBnYWluLCBnXzAsIGlzIGZpcnN0IGRldGVybWluZWQgYW5kIHRoZSBjb3JyZWN0aW9uICAgKgotKiBmYWN0b3IgICAgIGFscGhhID0gZ2FpbiAvIGdfMCAgICBpcyBxdWFudGl6ZWQuICAgICAgICAgICAgICAgICAgICAgICAgICAgKgotKiBUaGUgcGl0Y2ggZ2FpbiBhbmQgdGhlIGNvcnJlY3Rp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1YV9lbltpXSAqLwotCX0KLQotCXJldHVybjsKLX0KLQotV29yZDE2IFFfZ2FpbjIoICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8qIFJldHVybiBpbmRleCBvZiBxdWFudGl6YXRpb24uICAgICAgICAgICovCi0JCVdvcmQxNiB4bltdLCAgICAgICAgICAgICAgICAgICAgICAgICAgLyogKGkpIFFfeG46IFRhcmdldCB2ZWN0b3IuICAgICAgICAgICAgICAgKi8KLQkJV29yZDE2IHkxW10sICAgICAgICAgICAgICAgICAgICAgICAgICAvKiAoaSkgUV94bjogQWRhcHRpdmUgY29kZWJvb2suICAgICAgICAgICAqLwotCQlXb3JkMTYgUV94biwgICAgICAgICAgICAgICAgICAgICAgICAgIC8qIChpKSAgICAgOiB4biBhbmQgeTEgZm9ybWF0ICAgICAgICAgICAgICovCi0JCVdvcmQxNiB5MltdLCAgICAgICAgICAgICAgICAgICAgICAgICAgLyogKGkpIFE5ICA6IEZpbHRlcmVkIGlubm92YXRpdmUgdmVjdG9yLiAgKi8KLQkJV29yZDE2IGNvZGVbXSwgICAgICAgICAgICAgICAgICAgICAgICAvKiAoaSkgUTkgIDogSW5ub3ZhdGl2ZSB2ZWN0b3IuICAgICAgICAgICAqLwotCQlXb3JkMTYgZ19jb2VmZltdLCAgICAgICAgICAgICAgICAgICAgIC8qIChpKSAgICAgOiBDb3JyZWxhdGlvbnMgPHhuIHkxPiA8eTEgeTE+ICovCi0JCS8qICAgICAgICAgICBDb21wdXRlIGluIEdfcGl0Y2goKS4gICAgICAgICovCi0JCVdvcmQxNiBMX3N1YmZyLCAgICAgICAgICAgICAgICAgICAgICAgLyogKGkpICAgICA6IFN1YmZyYW1lIGxlbmdodC4gICAgICAgICAgICAgKi8KLQkJV29yZDE2IG5iaXRzLCAgICAgICAgICAgICAgICAgICAgICAgICAvKiAoaSkgICAgIDogbnVtYmVyIG9mIGJpdHMgKDYgb3IgNykgICAgICAqLwotCQlXb3JkMTYgKiBnYWluX3BpdCwgICAgICA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Gl6YXRpb24uICAgICAgICAgICAgICAgICAgKgotCSAqICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKgotCSAqICBjb2VmZlswXSA9ICAgIHkxIHkxICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKgotCSAqICBjb2VmZlsxXSA9IC0yIHhuIHkxICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKgotCSAqICBjb2VmZlsyXSA9ICAgIHkyIHkyICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKgotCSAqICBjb2VmZlszXSA9IC0yIHhuIHkyICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKgotCSAqICBjb2VmZls0XSA9ICAyIHkxIHkyICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKgotCSAqICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKgotCSAqIFByb2R1Y3QgPHkxIHkxPiBhbmQgPHhuIHkxPiBoYXZlIGJlZW4gY29tcHV0ZSBpbiBHX3BpdGNoKCkgYW5kICAgKgotCSAqIGFyZSBpbiB2ZWN0b3IgZ19jb2VmZltdLiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKgotCSAqLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tKi8KLQotCWNvZWZmWzBdID0gZ19jb2VmZlswXTsKLQlleHBfY29lZmZbMF0gPSBnX2NvZWZmWzFdOwotCWNvZWZmWzFdID0gbmVnYXRlKGdfY29lZmZbMl0pOyAgICAgICAgICAgICAgICAgICAgLyogY29lZmZbMV0gPSAtMiB4biB5MSAqLwotCWV4cF9jb2VmZlsxXSA9I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fZW5bM10pPDwxOyAgICAgIC8qIFExMypRMTAgLT4gUTI0ICovCi0KLQlnY29kZTAgPSBleHRyYWN0X2goTF90bXApOyAgICAgICAgICAgICAvKiBGcm9tIFEyNCB0byBROCAgKi8KLQotCS8qLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0qCi0JICogZ2NvZGUwID0gcG93KDEwLjAsIGdjb2RlMC8yMCkgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICoKLQkgKiAgICAgICAgPSBwb3coMiwgMy4zMjE5MjgqZ2NvZGUwLzIwKSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKgotCSAqICAgICAgICA9IHBvdygyLCAwLjE2NjA5NipnY29kZTApICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqCi0JICotLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSovCi0KLQlMX3RtcCA9IHZvX0xfbXVsdChnY29kZTAsIDU0NDMpOyAgICAgICAgICAvKiAqMC4xNjYwOTYgaW4gUTE1IC0+IFEyNCAgICAgKi8KLQlMX3RtcCA9IExfdG1wID4+IDg7ICAgICAgICAgICAgICAgLyogRnJvbSBRMjQgdG8gUTE2ICAgICAgICAgICAgICovCi0JVk9fTF9FeHRyYWN0KExfdG1wLCAmZXhwX2djb2RlMCwgJmZyYWMpOyAgLyogRXh0cmFjdCBleHBvbmVudCBvZiBnY29kZTAgICovCi0KLQlnY29kZTAgPSAoV29yZDE2KShQb3cyKDE0LCBmcmFjKSk7ICAgIC8qIFB1dCAxNCBhcyBleHBvbmVudCBzbyB0aGF0ICAqLwotCS8qIG91dHB1dCBvZiBQb3cyKCkgd2lsbCBiZTogICAqLwotCS8qIDE2Mzg0IDwgUG93MigpIDw9IDMyNzY3ICAgICAqLwotCWV4cF9nY29kZTAgLT0gMTQ7Ci0KLQkvKi0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0qCi0JICogRmluZCB0aGUgYmVzdCBxdWFudGl6ZXIgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKgotCSAqIH5+fn5+fn5+fn5+fn5+fn5+fn5+fn5+ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICoKLQkgKiBCZWZvcmUgZG9pbmcgdGhlIGNvbXB1dGF0aW9uIHdlIG5lZWQgdG8gYWxpbmcgZXhwb25lbnRzIG9mIGNvZWZmW10gICAgICAqCi0JICogdG8gYmUgc3VyZSB0byBoYXZlIHRoZSBtYXhpbXVtIHByZWNpc2lvbi4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKgotCSAqICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICoKLQkgKiBJbiB0aGUgdGFibGUgdGhlIHBpdGNoIGdhaW5zIGFyZSBpbiBRMTQsIHRoZSBjb2RlIGdhaW5zIGFyZSBpbiBRMTEgYW5kICAqCi0JICogYXJlIG11bHRpcGx5IGJ5IGdjb2RlMCB3aGljaCBoYXZlIGJlZW4gbXVsdGlwbHkgYnkgMl5leHBfZ2NvZGUwLiAgICAgICAgKgotCSAqIEFsc28gd2hlbiB3ZSBjb21wdXRlIGdfcGl0Y2gqZ19waXRjaCwgZ19jb2RlKmdfY29kZSBhbmQgZ19waXRjaCpnX2NvZGUgICoKLQkgKiB3ZSBkaXZpZGUgYnkgMl4xNS4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqCi0JICogQ29uc2lkZXJpbmcgYWxsIHRoZSBzY2FsaW5nIGFib3ZlIHdlIGhhdmU6ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKgotCSAqICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICoKLQkgKiAgIGV4cF9jb2RlID0gZXhwX2djb2RlMC0xMSsxNSA9IGV4cF9nY29kZTArNCAgICAgICAgICAgICAgICAgICAgICAgICAgICAqCi0JICogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKgotCSAqICAgZ19waXRjaCpnX3BpdGNoICA9IC0xNC0xNCsxNSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICoKLQkgKiAgIGdfcGl0Y2ggICAgICAgICAgPSAtMTQgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqCi0JICogICBnX2NvZGUqZ19jb2RlICAgID0gKDIqZXhwX2NvZGUpKzE1ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKgotCSAqICAgZ19jb2RlICAgICAgICAgICA9IGV4cF9jb2RlICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICoKLQkgKiAgIGdfcGl0Y2gqZ19jb2RlICAgPSAtMTQgKyBleHBfY29kZSArMTUgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqCi0JICogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKgotCSAqICAgZ19waXRjaCpnX3BpdGNoICogY29lZmZbMF0gIDtleHBfbWF4MCA9IGV4cF9jb2VmZlswXSAtIDEzICAgICAgICAgICAgICoKLQkgKiAgIGdfcGl0Y2ggICAgICAgICAqIGNvZWZmWzFdICA7ZXhwX21heDEgPSBleHBfY29lZmZbMV0gLSAxNCAgICAgICAgICAgICAqCi0JICogICBnX2NvZGUqZ19jb2RlICAgKiBjb2V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GU6IHFfcHVsc2UuYyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqCi0qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICoKLSogICAgICBEZXNjcmlwdGlvbjogQ29kaW5nIGFuZCBkZWNvZGluZyBvZiBhbGdlYnJhaWMgY29kZWJvb2sgICAgICAgICAgKgotKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqCi0qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0KLSNpbmNsdWRlIDxzdGRpby5oPgotI2luY2x1ZGUgInR5cGVkZWYuaCIKLSNpbmNsdWRlICJiYXNpY19vcC5oIgotI2luY2x1ZGUgInFfcHVsc2UuaCIKLQotI2RlZmluZSBOQl9QT1MgMTYgICAgICAgICAgICAgICAgICAgICAgICAgIC8qIHBvcyBpbiB0cmFjaywgbWFzayBmb3Igc2lnbiBiaXQgKi8KLQotV29yZDMyIHF1YW50XzFwX04xKCAgICAgICAgICAgICAgICAgICAgICAgIC8qIChvKSByZXR1cm4gTisxIGJpdHMgICAgICAgICAgICAgKi8KLQkJV29yZDE2IHBvcywgICAgICAgICAgICAgICAgICAgICAgICAvKiAoaSkgcG9zaXRpb24gb2YgdGhlIHB1bHNlICAgICAgICovCi0JCVdvcmQxNiBOKSAgICAgICAgICAgICAgICAgICAgICAgICAgLyogKGkpIG51bWJlciBvZiBiaXRzIGZvciBwb3NpdGlvbiAqLwotewotCVdvcmQxNiBtYXNrOwotCVdvcmQzMiBpbmRleDsKLQotCW1hc2sgPSAoMSA8PCBOKSAtIDE7ICAgICAgICAgICAgICAvKiBtYXNrID0gKCgxPDxOKS0xKTsgKi8KLQkvKi0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tL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yogaW5kZXggPSBxdWFudF8zcF8zTjEocG9zQVswXSwgcG9zQVsxXSwgcG9zQVsyXSwgbl8xKSA8PCBOOyAqLwotCQkJaW5kZXggPSBMX3NobChxdWFudF8zcF8zTjEocG9zQVswXSwgcG9zQVsxXSwgcG9zQVsyXSwgbl8xKSwgTik7Ci0JCQlpbmRleCA9IHZvX0xfYWRkKGluZGV4LCBxdWFudF8xcF9OMShwb3NCWzBdLCBuXzEpKTsgICAgICAgIC8qIGluZGV4ICs9IHF1YW50XzFwX04xKHBvc0JbMF0sIG5fMSk7ICovCi0JCQlicmVhazsKLQkJY2FzZSA0OgotCQkJaW5kZXggPSBxdWFudF80cF80TjEocG9zQVswXSwgcG9zQVsxXSwgcG9zQVsyXSwgcG9zQVszXSwgbl8xKTsKLQkJCWJyZWFrOwotCQlkZWZhdWx0OgotCQkJaW5kZXggPSAwOwotCQkJZnByaW50ZihzdGRlcnIsICJFcnJvciBpbiBmdW5jdGlvbiBxdWFudF80cF80TlxuIik7Ci0JfQotCXRtcCA9ICgoTiA8PCAyKSAtIDIpOyAgICAgICAgICAgICAgIC8qIGluZGV4ICs9IChpICYgMykgPDwgKCg0Kk4pLTIpOyAqLwotCWluZGV4ID0gdm9fTF9hZGQoaW5kZXgsIExfc2hsKChMX2RlcG9zaXRfbChpKSAmICgzTCkpLCB0bXApKTsKLQotCXJldHVybiAoaW5kZXgpOwotfQotCi0KLQotV29yZDMyIHF1YW50XzVwXzVOKCAgICAgICAgICAgICAgICAgICAgICAgIC8qIChvKSByZXR1cm4gNSpOIGJpdHMgICAgICAgICAgICAgKi8KLQkJV29yZDE2IHBvc1tdLCAgICAgICAgICAgICAgICAgICAgICAgICAvKiAoaSkgcG9zaXRpb24gb2YgdGhlIHB1bHNlIDEuLjUgICovCi0JCVdvcmQxNiBOKSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLyogKGkpIG51bWJlciBvZiBiaXRzIGZvciBwb3NpdGlvbiAqLwotewotCVdvcmQxNiBuYl9w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1bmRlciB0aGUgTGljZW5zZSBpcyBkaXN0cmlidXRlZCBvbiBhbiAiQVMgSVMiIEJBU0lTLAotICoqIFdJVEhPVVQgV0FSUkFOVElFUyBPUiBDT05ESVRJT05TIE9GIEFOWSBLSU5ELCBlaXRoZXIgZXhwcmVzcyBvciBpbXBsaWVkLgotICoqIFNlZSB0aGUgTGljZW5zZSBmb3IgdGhlIHNwZWNpZmljIGxhbmd1YWdlIGdvdmVybmluZyBwZXJtaXNzaW9ucyBhbmQKLSAqKiBsaW1pdGF0aW9ucyB1bmRlciB0aGUgTGljZW5zZS4KLSAqLwotCi0vKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCi0qICAgICAgRmlsZTogcWlzZl9ucy5jICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqCi0qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqCi0qICAgICAgRGVzY3JpcHRpb246IENvZGluZy9EZWNvZGluZyBvZiBJU0YgcGFyYW1ldGVycyBmb3IgYmFja2dyb3VuZCBub2lzZS4qCi0qICAgICAgICAgICAgICAgICAgICBUaGUgSVNGIHZlY3RvciBpcyBxdWFudGl6ZWQgdXNpbmcgVlEgd2l0aCBzcGxpdC1ieS01ICAqCi0qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqCi0qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotCi0jaW5jbHVkZSAidHlwZWRlZi5oIgotI2luY2x1ZGUgImJhc2ljX29wLmgiCi0jaW5jbHVkZSAiYWNlbHAuaCIKLSNpbmNsdWRlICJxaXNmX25zLnRhYiIgICAgICAgICAgICAgICAgICAgICAvKiBDb2RlYm9va3Mgb2YgSVNGcyAqLwotCi0vKi0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSoKLSogcm91dGluZTogICBRaXNmX25zKCkgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqCi0qICAgICAgICAgICAgfn5+fn5+fn5+ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKgotKi0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSovCi0KLXZvaWQgUWlzZl9ucygKLQkJV29yZDE2ICogaXNmMSwgICAgICAgICAgICAgICAgICAgICAgICAvKiBpbnB1dCA6IElTRiBpbiB0aGUgZnJlcXVlbmN5IGRvbWFpbiAoMC4uMC41KSAqLwotCQlXb3JkMTYgKiBpc2ZfcSwgICAgICAgICAgICAgICAgICAgICAgIC8qIG91dHB1dDogcXVhbnRpemVkIElTRiAgICAgICAgICAgICAgICAgICAgICAgICovCi0JCVdvcmQxNiAqIGluZGljZSAgICAgICAgICAgICAgICAgICAgICAgLyogb3V0cHV0OiBxdWFudGl6YXRpb24gaW5kaWNlcyAgICAgICAgICAgICAgICAgKi8KLQkgICAgKQotewotCVdvcmQxNiBpOwotCVdvcmQzMiB0bXA7Ci0KLQlmb3IgKGkgPSAwOyBpIDwgT1JERVI7IGkrKykKLQl7Ci0JCWlzZl9xW2ldID0gc3ViKGlzZjFbaV0sIG1lYW5faXNmX25vaXNlW2ldKTsKLQl9Ci0KLQlpbmRpY2VbMF0gPSBTdWJfVlEoJmlzZl9xWzBdLCBkaWNvMV9pc2Zfbm9pc2UsIDIsIFNJWkVfQktfTk9JU0UxLCAmdG1wKTsKLQlpbmRpY2VbMV0gPSBTdWJfVlEoJmlzZl9xWzJdLCBkaWNvMl9pc2Zfbm9pc2UsIDMsIFNJWkVfQktfTk9JU0UyLCAmdG1wKTsKLQlpbmRpY2VbMl0gPSBTdWJfVlEoJmlzZl9xWzVdLCBkaWNvM19pc2Zfbm9pc2UsIDMsIFNJWkVfQktfTk9JU0UzLCAmdG1wKTsKLQlpbmRpY2VbM10gPSBTdWJfVlEoJmlzZl9xWzhdLCBkaWNvNF9pc2Zfbm9pc2UsIDQsIFNJWkVfQktfTk9JU0U0LCAmdG1wKTsKLQlpbmRpY2VbNF0gPSBTdWJfVlEoJmlzZl9xWzEyXSwgZGljbzVfaXNmX25vaXNlLCA0LCBTSVpFX0JLX05PSVNFNSwgJnRtcCk7Ci0KLQkvKiBkZWNvZGluZyB0aGUgSVNGcyAqLwotCi0JRGlzZl9ucyhpbmRpY2UsIGlzZl9xKTsKLQotCXJldHVybjsKLX0KLQotLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCi0qIEZ1bmN0aW9uOiAgIERpc2ZfbnMoKSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICoKLSogICAgICAgICAgICB+fn5+fn5+fn4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKgotKiBEZWNvZGluZyBvZiBJU0YgcGFyYW1ldGVycyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqCi0qLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSoKLSogIEFyZ3VtZW50czogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKgotKiAgICBpbmRpY2VbXSA6IGluZGljZXMgb2YgdGhlIHNlbGVjdGVkIGNvZGVib29rIGVudHJpZXMgICAgICAgICAgICAqCi0qICAgIGlzZltdICAgIDogcXVhbnRpemVkIElTRnMgKGluIGZyZXF1ZW5jeSBkb21haW4pICAgICAgICAgICAgICAgICoKLSoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLQotdm9pZCBEaXNmX25zKAotCQlXb3JkMTYgKiBpbmRpY2UsICAgICAgICAgICAgICAgICAgICAgIC8qIGlucHV0OiAgcXVhbnRpemF0aW9uIGluZGljZXMgICAgICAgICAgICAgICAgICAqLwotCQlXb3JkMTYgKiBpc2ZfcSAgICAgICAgICAgICAgICAgICAgICAgIC8qIGlucHV0IDogSVNGIGluIHRoZSBmcmVxdWVuY3kgZG9tYWluICgwLi4wLjUpICAqLwotCSAgICApCi17Ci0JV29yZDE2IGk7Ci0KLQlmb3IgKGkgPSAwOyBpIDwgMjsgaSsrKQotCXsKLQkJaXNmX3FbaV0gPSBkaWNvMV9pc2Zfbm9pc2VbaW5kaWNlWzBdICogMiArIGldOwotCX0KLQlmb3IgKGkgPSAwOyBpIDwgMzsgaSsrKQotCXsKLQkJaXNmX3FbaSArIDJdID0gZGljbzJfaXNmX25vaXNlW2luZGljZVsxXSAqIDMgKyBpXTsKLQl9Ci0JZm9yIChpID0gMDsgaSA8IDM7IGkrKykKLQl7Ci0JCWlzZl9xW2kgKyA1XSA9IGRpY28zX2lzZl9ub2lzZVtpbmRpY2VbMl0gKiAzICsgaV07Ci0JfQotCWZvciAoaSA9IDA7IGkgPCA0OyBpKyspCi0JewotCQlpc2ZfcVtpICsgOF0gPSBkaWNvNF9pc2Zfbm9pc2VbaW5kaWNlWzNdICogNCArIGldOwotCX0KLQlmb3IgKGkgPSAwOyBpIDwgNDsgaSsrKQotCXsKLQkJaXNmX3FbaSArIDEyXSA9IGRpY281X2lzZl9ub2lzZVtpbmRpY2VbNF0gKiA0ICsgaV07Ci0JfQotCi0JZm9yIChpID0gMDsgaSA8IE9SREVSOyBpKyspCi0JewotCQlpc2ZfcVtpXSA9IGFkZCh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VVQgV0FSUkFOVElFUyBPUiBDT05ESVRJT05TIE9GIEFOWSBLSU5ELCBlaXRoZXIgZXhwcmVzcyBvciBpbXBsaWVkLgotICoqIFNlZSB0aGUgTGljZW5zZSBmb3IgdGhlIHNwZWNpZmljIGxhbmd1YWdlIGdvdmVybmluZyBwZXJtaXNzaW9ucyBhbmQKLSAqKiBsaW1pdGF0aW9ucyB1bmRlciB0aGUgTGljZW5zZS4KLSAqLwotCi0vKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKLSogICAgICAgRmlsZTogYXBpc2ZfMnMuYyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKgotKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqCi0qICAgICAgIERlc2NyaXB0aW9uOiBDb2RpbmcvRGVjb2RlaW5nIG9mIElTRiBwYXJhbWV0ZXJzIHdpdGggcHJlZGljYXRpb24KLSogICAgICAgVGhlIElTRiB2ZWN0b3IgaXMgcXVhbnRpemVkIHVzaW5nIHR3by1zdGFnZSBWUSB3aXRoIHNwbGl0LWJ5LTIgKgotKiAgICAgICBpbiAxc3Qgc3RhZ2UgYW5kIHNwbGl0LWJ5LTUob3IgMykgaW4gdGhlIHNlY29uZCBzdGFnZSAgICAgICAgICAqCi0qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICoKLSoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLQotI2luY2x1ZGUgInR5cGVkZWYuaCIKLSNpbmNsdWRlICJiYXNpY19vcC5oIgotI2luY2x1ZGUgImNuc3QuaCIKLSNpbmNsdWRlICJhY2VscC5oIgotI2luY2x1ZGUgInFwaXNmXzJzLnRhYiIgICAgICAgICAgICAgICAgICAgIC8qIENvZGVib29rcyBvZiBpc2ZzICovCi0KLSNkZWZpbmUgTVUgICAgICAgICAxMDkyMyAgICAgICAgICAgICAgICAgICAvKiBQcmVkaWN0aW9uIGZhY3RvciAgICgxLjAvMy4wKSBpbiBRMTUgKi8KLSNkZWZpbmUgTl9TVVJWX01BWCA0ICAgICAgICAgICAgICAgICAgICAgICAvKiA0IHN1cnZpdm9ycyBtYXggKi8KLSNkZWZpbmUgQUxQSEEgICAgICAyOTQ5MSAgICAgICAgICAgICAgICAgICAvKiAwLiA5IGluIFExNSAgICAgKi8KLSNkZWZpbmUgT05FX0FMUEhBICgzMjc2OC1BTFBIQSkgICAgICAgICAgICAvKiAoMS4wIC0gQUxQSEEpIGluIFExNSAqLwotCi0vKiBwcml2YXRlIGZ1bmN0aW9ucyAqLwotc3RhdGljIHZvaWQgVlFfc3RhZ2UxKAotCQlXb3JkMTYgKiB4LCAgICAgICAgICAgICAgICAgICAgICAgICAgIC8qIGlucHV0IDogSVNGIHJlc2lkdWFsIHZlY3RvciAgICAgICAgICAgKi8KLQkJV29yZDE2ICogZGljbywgICAgICAgICAgICAgICAgICAgICAgICAvKiBpbnB1dCA6IHF1YW50aXphdGlvbiBjb2RlYm9vayAgICAgICAgICovCi0JCVdvcmQxNiBkaW0sICAgICAgICAgICAgICAgICAgICAgICAgICAgLyogaW5wdXQgOiBkaW1lbnRpb24gb2YgdmVjdG9yICAgICAgICAgICAqLwotCQlXb3JkMTYgZGljb19zaXplLCAgICAgICAgICAgICAgICAgICAgIC8qIGlucHV0IDogc2l6ZSBvZiBxdWFudGl6YXRpb24gY29kZWJvb2sgKi8KLQkJV29yZDE2ICogaW5kZXgsICAgICAgICAgICAgICAgICAgICAgICAvKiBvdXRwdXQ6IGluZGljZXMgb2Ygc3Vydml2b3JzICAgICAgICAgICovCi0JCVdvcmQxNiBzdXJ2ICAgICAgICAgICAgICAgICAgICAgICAgICAgLyogaW5wdXQgOiBudW1iZXIgb2Ygc3Vydml2b3IgICAgICAgICAgICAqLwotCQkpOwotCi0vKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKLSogRnVuY3Rpb246ICAgUXBpc2ZfMnNfNDZCKCkgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKgotKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqCi0qIERlc2NyaXB0aW9uOiBRdWFudGl6YXRpb24gb2YgaXNmIHBhcmFtZXRlcnMgd2l0aCBwcmVkaWN0aW9uLiAoNDYgYml0cykgICoKLSogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKgotKiBUaGUgaXNmIHZlY3RvciBpcyBxdWFudGl6ZWQgdXNpbmcgdHdvLXN0YWdlIFZRIHdpdGggc3BsaXQtYnktMiBpbiAgICAgICAqCi0qICAxc3Qgc3RhZ2UgYW5kIHNwbGl0LWJ5LTUgaW4gdGhlIHNlY29uZCBzdGFnZS4gICAgICAgICAgICAgICAgICAgICAgICAgICoKLSoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLQotdm9pZCBRcGlzZl8yc180NmIoCi0JCVdvcmQxNiAqIGlzZjEsICAgICAgICAgICAgICAgICAgICAgICAgLyogKGkpIFExNSA6IElTRiBpbiB0aGUgZnJlcXVlbmN5IGRvbWFpbiAoMC4uMC41KSAqLwotCQlXb3JkMTYgKiBpc2ZfcSwgICAgICAgICAgICAgICAgICAgICAgIC8qIChvKSBRMTUgOiBxdWFudGl6ZWQgSVNGICAgICAgICAgICAgICAgKDAuLjAuNSkgKi8KLQkJV29yZDE2ICogcGFzdF9pc2ZxLCAgICAgICAgICA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FsxXSA9IFN1Yl9WUSgmaXNmX3N0YWdlMlszXSwgZGljbzI1X2lzZiwgNCwgU0laRV9CSzI1LCAmbWluX2Vycik7Ci0JCXRlbXAgPSB2b19MX2FkZCh0ZW1wLCBtaW5fZXJyKTsKLQotCQlpZih0ZW1wIDwgZGlzdGFuY2UpCi0JCXsKLQkJCWRpc3RhbmNlID0gdGVtcDsKLQkJCWluZGljZVsxXSA9IHN1cnYxW2tdOwotCQkJZm9yIChpID0gMDsgaSA8IDI7IGkrKykKLQkJCXsKLQkJCQlpbmRpY2VbaSArIDVdID0gdG1wX2luZFtpXTsKLQkJCX0KLQkJfQotCX0KLQotCURwaXNmXzJzXzQ2YihpbmRpY2UsIGlzZl9xLCBwYXN0X2lzZnEsIGlzZl9xLCBpc2ZfcSwgMCwgMCk7Ci0KLQlyZXR1cm47Ci19Ci0KLS8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgotKiBGdW5jdGlvbjogICBRcGlzZl8yc18zNkIoKSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqCi0qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICoKLSogRGVzY3JpcHRpb246IFF1YW50aXphdGlvbiBvZiBpc2YgcGFyYW1ldGVycyB3aXRoIHByZWRpY3Rpb24uICgzNiBiaXRzKSAgICAgKgotKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqCi0qIFRoZSBpc2YgdmVjdG9yIGlzIHF1YW50aXplZCB1c2luZyB0d28tc3RhZ2UgVlEgd2l0aCBzcGxpdC1ieS0yIGluICAgICAgICAgICoKLSogIDFzdCBzdGFnZSBhbmQgc3BsaXQtYnktMyBpbiB0aGUgc2Vjb25kIHN0YWdlLiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKgotKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotCi12b2lkIFFwaXNmXzJzXzM2YigKLQkJV29yZDE2ICogaXNmMSwgICAgICAgICAgICAgICAgICAgICAgICAvKiAoaSkgUTE1IDogSVNGIGluIHRoZSBmcmVxdWVuY3kgZG9tYWluICgwLi4wLjUpICovCi0JCVdvcmQxNiAqIGlzZl9xLCAgICAgICAgICAgICAgICAgICAgICAgLyogKG8pIFExNSA6IHF1YW50aXplZCBJU0YgICAgICAgICAgICAgICAoMC4uMC41KSAqLwotCQlXb3JkMTYgKiBwYXN0X2lzZnEsICAgICAgICAgICAgICAgICAgIC8qIChpbylRMTUgOiBwYXN0IElTRiBxdWFudGl6ZXIgICAgICAgICAgICAgICAgICAgKi8KLQkJV29yZDE2ICogaW5kaWNlLCAgICAgICAgICAgICAgICAgICAgICAvKiAobykgICAgIDogcXVhbnRpemF0aW9uIGluZGljZXMgICAgICAgICAgICAgICAgICovCi0JCVdvcmQxNiBuYl9zdXJ2ICAgICAgICAgICAgICAgICAgICAgICAgLyogKGkpICAgICA6IG51bWJlciBvZiBzdXJ2aXZvciAoMSwgMiwgMyBvciA0KSAgICAqLwotCQkpCi17Ci0JV29yZDE2IGksIGssIHRtcF9pbmRbNV07Ci0JV29yZDE2IHN1cnYxW05fU1VSVl9NQVhdOyAgICAgICAgICAgICAgLyogaW5kaWNlcyBvZiBzdXJ2aXZvcnMgZnJvbSAxc3Qgc3RhZ2UgKi8KLQlXb3JkMzIgdGVtcCwgbWluX2VyciwgZGlzdGFuY2U7Ci0JV29yZDE2IGlzZltPUkRFUl07Ci0JV29yZDE2IGlzZl9zdGFnZTJbT1JERVJdOwotCi0JZm9yIChpID0gMDsgaSA8IE9SREVSOyBpKyspCi0JewotCQlpc2ZbaV0gPSB2b19zdWIoaXNmMVtpXSwgbWVh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i0JewotCQlmb3IgKGkgPSAwOyBpIDwgNzsgaSsrKQotCQl7Ci0JCQlpc2Zfc3RhZ2UyW2ldID0gdm9fc3ViKGlzZls5ICsgaV0sIGRpY28yX2lzZltpICsgc3VydjFba10gKiA3XSk7Ci0JCX0KLQotCQl0bXBfaW5kWzBdID0gU3ViX1ZRKCZpc2Zfc3RhZ2UyWzBdLCBkaWNvMjNfaXNmXzM2YiwgNywgU0laRV9CSzIzXzM2YiwgJm1pbl9lcnIpOwotCQl0ZW1wID0gbWluX2VycjsKLQotCQlpZih0ZW1wIDwgZGlzdGFuY2UpCi0JCXsKLQkJCWRpc3RhbmNlID0gdGVtcDsKLQkJCWluZGljZVsxXSA9IHN1cnYxW2tdOwotCQkJaW5kaWNlWzRdID0gdG1wX2luZFswXTsKLQkJfQotCX0KLQotCURwaXNmXzJzXzM2YihpbmRpY2UsIGlzZl9xLCBwYXN0X2lzZnEsIGlzZl9xLCBpc2ZfcSwgMCwgMCk7Ci0KLQlyZXR1cm47Ci19Ci0KLS8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKLSogRnVuY3Rpb246IERwaXNmXzJzXzQ2YigpICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICoKLSogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICoKLSogRGVzY3JpcHRpb246IERlY29kaW5nIG9mIElTRiBwYXJhbWV0ZXJzICAgICAgICAgICAgICAgICAgICAgICAgICAgICoKLSoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0KLXZvaWQgRHBpc2ZfMnNfNDZiKAotCQlXb3JkMTYgKiBpbmRpY2UsICAgICAgICAgICAgICAgICAgICAgIC8qIGlucHV0OiAgcXVhbnRpemF0aW9uIGluZGljZXMgICAgICAgICAgICAgICAgICAgICAgICovCi0JCVdvcmQxNiAqIGlzZl9xLCAgICAgICAgICAgICAgICAgICAgICAgLyogb3V0cHV0OiBxdWFudGl6ZWQgSVNGIGluIGZyZXF1ZW5jeSBkb21haW4gKDAuLjAuNSkgKi8KLQkJV29yZDE2ICogcGFzdF9pc2ZxLCAgICAgICAgICAgICAgICAgICAvKiBpLzAgICA6IHBhc3QgSVNGIHF1YW50aXplciAgICAgICAgICAgICAgICAgICAgKi8KLQkJV29yZDE2ICogaXNmb2xkLCAgICAgICAgICAgICAgICAgICAgICAvKiBpbnB1dCA6IHBhc3QgcXVhbnRpemVkIElTRiAgICAgICAgICAgICAgICAgICAgKi8KLQkJV29yZDE2ICogaXNmX2J1ZiwgICAgICAgICAgICAgICAgICAgICAvKiBpbnB1dCA6IGlzZiBidWZmZXIgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0JCVdvcmQxNiBiZmksICAgICAgICAgICAgICAgICAgICAgICAgICAgLyogaW5wdXQgOiBCYWQgZnJhbWUgaW5kaWNhdG9yICAgICAgICAgICAgICAgICAgICovCi0JCVdvcmQxNiBlbmNfZGVjCi0JCSkKLXsKLQlXb3JkMTYgcmVmX2lzZltNXSwgdG1wOwotCVdvcmQzMiBpLCBqLCBMX3RtcDsKLQotCWlmIChiZmkgPT0gMCkgICAgICAgICAgICAgICAgICAgICAgICAgIC8qIEdvb2QgZnJhbWUgKi8KLQl7Ci0JCWZvciAoaSA9IDA7IGkgPCA5OyBpKyspCi0JCXsKLQkJCWlzZl9xW2ldID0gZGljbzFfaXNmW2luZGljZVswXSAqIDkgKyBpXTsKLQkJfQotCQlmb3IgKGkgPSAwOyBpIDwgNzsgaSsrKQotCQl7Ci0JCQlpc2ZfcVtpICsgOV0gPSBkaWNvMl9pc2ZbaW5kaWNlWzFdICogNyArIGldOwotCQl9Ci0KLQkJZm9yIChpID0gMDsgaSA8IDM7IGkrKykKLQkJewotCQkJ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qKioqKioqKioqKioqKioqKioqCi0qIEZ1bmN0aW9uOiAgIERpc2ZfMnNfMzZiKCkgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqCi0qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqCi0qIERlc2NyaXB0aW9uOiBEZWNvZGluZyBvZiBJU0YgcGFyYW1ldGVycyAgICAgICAgICAgICAgICAgICAgICAgICAgICAqCi0qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0KLXZvaWQgRHBpc2ZfMnNfMzZiKAotCQlXb3JkMTYgKiBpbmRpY2UsICAgICAgICAgICAgICAgICAgICAgIC8qIGlucHV0OiAgcXVhbnRpemF0aW9uIGluZGljZXMgICAgICAgICAgICAgICAgICAgICAgICovCi0JCVdvcmQxNiAqIGlzZl9xLCAgICAgICAgICAgICAgICAgICAgICAgLyogb3V0cHV0OiBxdWFudGl6ZWQgSVNGIGluIGZyZXF1ZW5jeSBkb21haW4gKDAuLjAuNSkgKi8KLQkJV29yZDE2ICogcGFzdF9pc2ZxLCAgICAgICAgICAgICAgICAgICAvKiBpLzAgICA6IHBhc3QgSVNGIHF1YW50aXplciAgICAgICAgICAgICAgICAgICAgKi8KLQkJV29yZDE2ICogaXNmb2xkLCAgICAgICAgICAgICAgICAgICAgICAvKiBpbnB1dCA6IHBhc3QgcXVhbnRpemVkIElTRiAgICAgICAgICAgICAgICAgICAgKi8KLQkJV29yZDE2ICogaXNmX2J1ZiwgICAgICAgICAgICAgICAgICAgICAvKiBpbnB1dCA6IGlzZiBidWZmZXIgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0JCVdvcmQxNiBiZmksICAgICAgICAgICAgICAgICAgICAgICAgICAgLyogaW5wdXQgOiBCYWQgZnJhbWUgaW5kaWNhdG9y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CB2b19tdWx0KHBhc3RfaXNmcVtpXSwgTVUpKTsgICAgICAvKiBwcmVkaWN0ZWQgSVNGICovCi0JCQlwYXN0X2lzZnFbaV0gPSB2b19zdWIoaXNmX3FbaV0sIHRtcCk7Ci0JCQlwYXN0X2lzZnFbaV0gPSBwYXN0X2lzZnFbaV0gPj4gMTsgICAgICAgICAvKiBwYXN0X2lzZnFbaV0gKj0gMC41ICovCi0JCX0KLQl9Ci0KLQlSZW9yZGVyX2lzZihpc2ZfcSwgSVNGX0dBUCwgT1JERVIpOwotCi0JcmV0dXJuOwotfQotCi0KLS8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKLSogRnVuY3Rpb246ICBSZW9yZGVyX2lzZigpICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICoKLSogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICoKLSogRGVzY3JpcHRpb246IFRvIG1ha2Ugc3VyZSB0aGF0IHRoZSAgaXNmcyBhcmUgcHJvcGVybHkgb3JkZXIgYW5kIHRvICAgICAgICoKLSogICAgICAgICAgICAgIGtlZXAgYSBjZXJ0YWluIG1pbmltdW0gZGlzdGFuY2UgYmV0d2VlbiBjb25zZWN1dGl2ZSBpc2ZzLiAgICoKLSotLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSoKLSogICAgQXJndW1lbnQgICAgICAgICBkZXNjcmlwdGlvbiAgICAgICAgICAgICAgICAgICAgIGluL291dCAgICAgICAgICAgICAgICoKLSogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICoKLSogICAgIGlzZltdICAgICAgICAgICB2ZWN0b3Igb2YgaXNmcyAgICAgICAgICAgICAgICAgICAgaS9vICAgICAgICAgICAgICAgICoKLSogICAgIG1pbl9kaXN0ICAgICAgICBtaW5pbXVtIHJlcXVpcmVkIGRpc3RhbmNlICAgICAgICAgaSAgICAgICAgICAgICAgICAgICoKLSogICAgIG4gICAgICAgICAgICAgICBMUEMgb3JkZXIgICAgICAgICAgICAgICAgICAgICAgICAgaSAgICAgICAgICAgICAgICAgICoKLSoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0KLXZvaWQgUmVvcmRlcl9pc2YoCi0JCVdvcmQxNiAqIGlzZiwgICAgICAgICAgICAgICAgICAgICAgICAgLyogKGkvbykgUTE1OiBJU0YgaW4gdGhlIGZyZXF1ZW5jeSBkb21haW4gKDAuLjAuNSkgKi8KLQkJV29yZDE2IG1pbl9kaXN0LCAgICAgICAgICAgICAgICAgICAgICAvKiAoaSkgUTE1ICA6IG1pbmltdW0gZGlzdGFuY2UgdG8ga2VlcCAgICAgICAgICAgICAqLwotCQlXb3JkMTYgbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8qIChpKSAgICAgIDogbnVtYmVyIG9mIElTRiAgICAgICAgICAgICAgICAgICAgICAgICovCi0JCSkKLXsKLQlXb3JkMzIgaTsKLQlXb3JkMTYgaXNmX21pbjsKLQotCWlzZl9taW4gPSBtaW5fZGlzdDsKLQlmb3IgKGkgPSAwOyBpIDwgbiAtIDE7IGkrKykKLQl7Ci0JCWlmKGlzZltpXSA8IGlzZl9taW4pCi0JCXsKLQkJCWlzZltpXSA9IGlzZl9taW47Ci0JCX0KLQkJaXNmX21pbiA9IChpc2ZbaV0gKyBtaW5fZGlzdCk7Ci0JfQotCXJldHVybjsKLX0KLQotCi1Xb3JkMTYgU3ViX1ZRKCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLyogb3V0cHV0OiByZXR1cm4gcXVhbnRpemF0aW9uIGluZGV4ICAgICAqLwotCQlXb3JkMTYgKiB4LCAgICAgICAgICAgICAgICAgICAgICAgICAgIC8qIGlucHV0IDogSVNGIHJlc2lkdWFsIHZlY3RvciAgICAgICAgICAgKi8KLQkJV29yZDE2ICogZGljbywgICAgICAgICAgICAgICAgICAgICAgICAvKiBpbnB1dCA6IHF1YW50aXphdGlvbiBjb2RlYm9vayAgICAgICAgICovCi0JCVdvcmQxNiBkaW0sICAgICAgICAgICAgICAgICAgICAgICAgICAgLyogaW5wdXQgOiBkaW1lbnRpb24gb2YgdmVjdG9yICAgICAgICAgICAqLwotCQlXb3JkMTYgZGljb19zaXplLCAgICAgICAgICAgICAgICAgICAgIC8qIGlucHV0IDogc2l6ZSBvZiBxdWFudGl6YXRpb24gY29kZWJvb2sgKi8KLQkJV29yZDMyICogZGlzdGFuY2UgICAgICAgICAgICAgICAgICAgICAvKiBvdXRwdXQ6IGVycm9yIG9mIHF1YW50aXphdGlvbiAgICAgICAgICovCi0JICAgICApCi17Ci0JV29yZDE2IHRlbXAsICpwX2RpY287Ci0JV29yZDMyIGksIGosIGluZGV4OwotCVdvcmQzMiBkaXN0X21pbiwgZGlzdDsKLQotCWRpc3RfbWluID0gTUFYXzMyOwotCXBfZGljbyA9IGRpY287Ci0KLQlpbmRleCA9IDA7Ci0JZm9yIChpID0gMDsgaSA8IGRpY29fc2l6ZTsgaSsrKQotCXsKLQkJZGlzdCA9IDA7Ci0KLQkJZm9yIChqID0gMDsgaiA8IGRpbTsgaisrKQotCQl7Ci0JCQl0ZW1wID0geFtqXSAtICgqcF9kaWNvKyspOwotCQkJZGlzdCArPSAodGVtcCAqIHRlbXApPDwxOwotCQl9Ci0KLQkJaWYoZGlzdCA8IGRpc3RfbWluKQotCQl7Ci0JCQlkaXN0X21pbiA9IGRpc3Q7Ci0JCQlpbmRleCA9IGk7Ci0JCX0KLQl9Ci0KLQkqZGlzdGFuY2UgPSBkaXN0X21pbjsKLQotCS8qIFJlYWRpbmcgdGhlIHNlbGVjdGVkIHZlY3RvciAqLwotCXBfZGljbyA9ICZkaWNvW2luZGV4ICogZGltXTsKLQlmb3IgKGogPSAwOyBqIDwgZGltOyBqKyspCi0JewotCQl4W2pdID0gKnBfZGljbysrOwotCX0KLQotCXJldHVybiBpbmRleDsKLX0KLQotCi1zdGF0aWMgdm9pZCBWUV9zdGFnZTEoCi0JCVdvcmQxNiAqIHgsICAgICAgICAgICAgICAgICAgICAgICAgICAgLyogaW5wdXQgOiBJU0YgcmVzaWR1YWwgdmVjdG9yICAgICAgICAgICAqLwotCQlXb3JkMTYgKiBkaWNvLCAgICAgICAgICAgICAgICAgICAgICAgIC8qIGlucHV0IDogcXVhbnRpemF0aW9uIGNvZGVib29rICAgICAgICAgKi8KLQkJV29yZDE2IGRpbSwgICAgICAgICAgICAgICAgICAgICAgICAgICAvKiBpbnB1dCA6IGRpbWVudGlvbiBvZiB2ZWN0b3IgICAgICAgICAgICovCi0JCVdvcmQxNiBkaWNvX3NpemUsICAgICAgICAgICAgICAgICAgICAgLyogaW5wdXQgOiBzaXplIG9mIHF1YW50aXphdGlvbiBjb2RlYm9vayAqLwotCQlXb3JkMTYgKiBpbmRleCwgICAgICAgICAgICAgICAgICAgICAgIC8qIG91dHB1dDogaW5kaWNlcyBvZiBzdXJ2aXZvcnMgICAgICAgICAgKi8KLQkJV29yZDE2IHN1cnYgICAgICAgICAgICAgICAgICAgICAgICAgICAvKiBpbnB1dCA6IG51bWJlciBvZiBzdXJ2aXZvciAgICAgICAgICAgICovCi0JCSkKLXsKLQlXb3JkMTYgdGVtcCwgKnBfZGljbzsKLQlXb3JkMzIgaSwgaiwgaywgbDsKLQlXb3JkMzIgZGlzdF9taW5bTl9TVVJWX01BWF0sIGRpc3Q7Ci0KLQlkaXN0X21pblswXSA9IE1BWF8zMjsKLQlkaXN0X21pblsxXSA9IE1BWF8zMjsKLQlkaXN0X21pblsyXSA9IE1BWF8zMjsKLQlkaXN0X21pblszXSA9IE1BWF8z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xPbiwgSW5jLgotICoqCi0gKiogTGljZW5zZWQgdW5kZXIgdGhlIEFwYWNoZSBMaWNlbnNlLCBWZXJzaW9uIDIuMCAodGhlICJMaWNlbnNlIik7Ci0gKiogeW91IG1heSBub3QgdXNlIHRoaXMgZmlsZSBleGNlcHQgaW4gY29tcGxpYW5jZSB3aXRoIHRoZSBMaWNlbnNlLgotICoqIFlvdSBtYXkgb2J0YWluIGEgY29weSBvZiB0aGUgTGljZW5zZSBhdAotICoqCi0gKiogICAgIGh0dHA6Ly93d3cuYXBhY2hlLm9yZy9saWNlbnNlcy9MSUNFTlNFLTIuMAotICoqCi0gKiogVW5sZXNzIHJlcXVpcmVkIGJ5IGFwcGxpY2FibGUgbGF3IG9yIGFncmVlZCB0byBpbiB3cml0aW5nLCBzb2Z0d2FyZQotICoqIGRpc3RyaWJ1dGVkIHVuZGVyIHRoZSBMaWNlbnNlIGlzIGRpc3RyaWJ1dGVkIG9uIGFuICJBUyBJUyIgQkFTSVMsCi0gKiogV0lUSE9VVCBXQVJSQU5USUVTIE9SIENPTkRJVElPTlMgT0YgQU5ZIEtJTkQsIGVpdGhlciBleHByZXNzIG9yIGltcGxpZWQuCi0gKiogU2VlIHRoZSBMaWNlbnNlIGZvciB0aGUgc3BlY2lmaWMgbGFuZ3VhZ2UgZ292ZXJuaW5nIHBlcm1pc3Npb25zIGFuZAotICoqIGxpbWl0YXRpb25zIHVuZGVyIHRoZSBMaWNlbnNlLgotICovCi0KLS8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgotKiAgICAgICBGaWxlOiByYW5kb20uYyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqCi0qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICoKLSogICAgICAgRGVzY3JpcHRpb246IFNpZ25lZCAxNiBiaX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S4KLSAqKiBZb3UgbWF5IG9idGFpbiBhIGNvcHkgb2YgdGhlIExpY2Vuc2UgYXQKLSAqKgotICoqICAgICBodHRwOi8vd3d3LmFwYWNoZS5vcmcvbGljZW5zZXMvTElDRU5TRS0yLjAKLSAqKgotICoqIFVubGVzcyByZXF1aXJlZCBieSBhcHBsaWNhYmxlIGxhdyBvciBhZ3JlZWQgdG8gaW4gd3JpdGluZywgc29mdHdhcmUKLSAqKiBkaXN0cmlidXRlZCB1bmRlciB0aGUgTGljZW5zZSBpcyBkaXN0cmlidXRlZCBvbiBhbiAiQVMgSVMiIEJBU0lTLAotICoqIFdJVEhPVVQgV0FSUkFOVElFUyBPUiBDT05ESVRJT05TIE9GIEFOWSBLSU5ELCBlaXRoZXIgZXhwcmVzcyBvciBpbXBsaWVkLgotICoqIFNlZSB0aGUgTGljZW5zZSBmb3IgdGhlIHNwZWNpZmljIGxhbmd1YWdlIGdvdmVybmluZyBwZXJtaXNzaW9ucyBhbmQKLSAqKiBsaW1pdGF0aW9ucyB1bmRlciB0aGUgTGljZW5zZS4KLSAqLwotCi0vKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKLSogIEZpbGU6IHJlc2lkdS5jICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKgotKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqCi0qICBEZXNjcmlwdGlvbjogQ29tcHV0ZSB0aGUgTFBDIHJlc2lkdWFsIGJ5IGZpbHRlcmluZyAgICAgICAgICAgICAgICAgICoKLSogICAgICAgICAgICAgdGhlIGlucHV0IHNwZWVjaCB0aHJvdWdoIEEoeikgICAgICAgICAgICAgICAgICAgICAgICAgICAgKgotKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqCi0qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0KLSNpbmNsdWRlICJ0eXBlZGVmLmgiCi0jaW5jbHVkZSAiYmFzaWNfb3AuaCIKLQotdm9pZCBSZXNpZHUoCi0JCVdvcmQxNiBhW10sICAgICAgICAgICAgICAgICAgICAgICAgICAgLyogKGkpIFExMiA6IHByZWRpY3Rpb24gY29lZmZpY2llbnRzICAgICAgICAgICAgICAgICAgICAgKi8KLQkJV29yZDE2IHhbXSwgICAgICAgICAgICAgICAgICAgICAgICAgICAvKiAoaSkgICAgIDogc3BlZWNoICh2YWx1ZXMgeFstbS4uLTFdIGFyZSBuZWVkZWQgICAgICAgICAqLwotCQlXb3JkMTYgeVtdLCAgICAgICAgICAgICAgICAgICAgICAgICAgIC8qIChvKSB4MiAgOiByZXNpZHVhbCBzaWduYWwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0JCVdvcmQxNiBsZyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLyogKGkpICAgICA6IHNpemUgb2YgZmlsdGVyaW5nICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLQkJKQotewotCVdvcmQxNiBpLCpwMSwgKnAyOwotCVdvcmQzMiBzOwotCWZvciAoaSA9IDA7IGkgPCBsZzsgaSsrKQotCXsKLQkJcDEgPSBhOwotCQlwMiA9ICZ4W2ldOwotCQlzICA9IHZvX211bHQzMigoKnAxKyspLCAoKnAyLS0pKTsKLQkJcyArPSB2b19tdWx0MzIoKCpwMSsrKSwgKCpwMi0tKSk7Ci0JCXMgKz0gdm9fbXVsdDMyKCgqcDErKyksICgqcDItLSkpOwotCQlzICs9IHZvX211bHQzMigoKnAxKyspLCAoKnAyLS0pKTsKLQkJcyArPSB2b19tdWx0MzIoKCpwMSsrKSwgKCpwMi0tKSk7Ci0JCXMgKz0gdm9fbXVsdDMyKCgqcDErKyksICgqcDItLSk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5bmFtaWMgICAgICAgICAgICAqCi0qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICoKLSoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLQotI2luY2x1ZGUgInR5cGVkZWYuaCIKLSNpbmNsdWRlICJiYXNpY19vcC5oIgotCi12b2lkIFNjYWxlX3NpZygKLQkJV29yZDE2IHhbXSwgICAgICAgICAgICAgICAgICAgICAgICAgICAvKiAoaS9vKSA6IHNpZ25hbCB0byBzY2FsZSAgICAgICAgICAgICAgICovCi0JCVdvcmQxNiBsZywgICAgICAgICAgICAgICAgICAgICAgICAgICAgLyogKGkpICAgOiBzaXplIG9mIHhbXSAgICAgICAgICAgICAgICAgICAqLwotCQlXb3JkMTYgZXhwICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8qIChpKSAgIDogZXhwb25lbnQ6IHggPSByb3VuZCh4IDw8IGV4cCkgKi8KLQkgICAgICApCi17Ci0JV29yZDMyIGk7Ci0JV29yZDMyIExfdG1wOwotCWlmKGV4cCA+IDApCi0JewotCQlmb3IgKGkgPSBsZyAtIDEgOyBpID49IDA7IGktLSkKLQkJewotCQkJTF90bXAgPSBMX3NobDIoeFtpXSwgMTYgKyBleHApOwotCQkJeFtpXSA9IGV4dHJhY3RfaChMX2FkZChMX3RtcCwgMHg4MDAwKSk7Ci0JCX0KLQl9Ci0JZWxzZQotCXsKLQkJZXhwID0gLWV4cDsKLQkJZm9yIChpID0gbGcgLSAxOyBpID49IDA7IGktLSkKLQkJewotCQkJTF90bXAgPSB4W2ldIDw8IDE2OwotCQkJTF90bXAgPj49IGV4cDsKLQkJCXhbaV0gPSAoTF90bXAgKyAweDgwMDApPj4xNjsKLQkJfQotCX0KLQlyZXR1cm47Ci19Ci0KLQotCmRpZmYgLS1naXQgYS9tZWRpYS9saWJzdGFnZWZyaWdodC9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ZAotICoqIGxpbWl0YXRpb25zIHVuZGVyIHRoZSBMaWNlbnNlLgotICovCi0KLS8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgotKiAgICAgICBGaWxlOiBzdHJlYW0uYyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqCi0qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICoKLSogICAgICAgRGVzY3JpcHRpb246IFZPTUUgQVBJIEJ1ZmZlciBPcGVyYXRvciBJbXBsZW1lbnQgQ29kZSAgICAgICAgICAgKgotKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqCi0qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0KLSNpbmNsdWRlICJzdHJlYW0uaCIKLQotdm9pZCB2b0FXQl9Jbml0RnJhbWVCdWZmZXIoRnJhbWVTdHJlYW0gKnN0cmVhbSkKLXsKLQlzdHJlYW0tPnNldF9wdHIgPSBOVUxMOwotCXN0cmVhbS0+ZnJhbWVfcHRyX2JrID0gc3RyZWFtLT5mcmFtZV9wdHI7Ci0Jc3RyZWFtLT5zZXRfbGVuID0gMDsKLQlzdHJlYW0tPmZyYW1lYnVmZmVyX2xlbiA9IDA7Ci0Jc3RyZWFtLT5mcmFtZV9zdG9yZWxlbiA9IDA7Ci19Ci0KLXZvaWQgdm9BV0JfVXBkYXRlRnJhbWVCdWZmZXIoCi0JCUZyYW1lU3RyZWFtICpzdHJlYW0sCi0JCVZPX01FTV9PUEVSQVRPUiAqcE1lbU9QCi0JCSkKLXsKLQlpbnQgIGxlbjsKLQlsZW4gID0gTUlOKEZyYW1lX01heHNpemUgLSBzdHJlYW0tPmZyYW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gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKgotKiAgICAgICBEZXNjcmlwdGlvbjogRG8gdGhlIHN5bnRoZXNpcyBmaWx0ZXJpbmcgMS9BKHopICAgICAgICAgICAgICAgICAqCi0qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICoKLSoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLQotI2luY2x1ZGUgInR5cGVkZWYuaCIKLSNpbmNsdWRlICJiYXNpY19vcC5oIgotI2luY2x1ZGUgIm1hdGhfb3AuaCIKLSNpbmNsdWRlICJjbnN0LmgiCi0KLXZvaWQgU3luX2ZpbHQoCi0JCVdvcmQxNiBhW10sICAgICAgICAgICAgICAgICAgICAgICAgICAgLyogKGkpIFExMiA6IGFbbSsxXSBwcmVkaWN0aW9uIGNvZWZmaWNpZW50cyAgICAgICAgICAgKi8KLQkJV29yZDE2IHhbXSwgICAgICAgICAgICAgICAgICAgICAgICAgICAvKiAoaSkgICAgIDogaW5wdXQgc2lnbmFsICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotCQlXb3JkMTYgeVtdLCAgICAgICAgICAgICAgICAgICAgICAgICAgIC8qIChvKSAgICAgOiBvdXRwdXQgc2lnbmFsICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0JCVdvcmQxNiBsZywgICAgICAgICAgICAgICAgICAgICAgICAgICAgLyogKGkpICAgICA6IHNpemUgb2YgZmlsdGVyaW5nICAgICAgICAgICAgICAgICAgICAgICAgKi8KLQkJV29yZDE2IG1lbVtdLCAgICAgICAgICAgICAgICAgICAgICAgICAvKiAoaS9vKSAgIDogbWVtb3J5IGFzc29jaWF0ZWQgd2l0aCB0aGlzIGZpbHRlcmluZy4gICAqLwotCQlXb3JkMTYgdXBkYXRlICAgICAgICAgICAgICAgICAgICAgICAgIC8qI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Mi0tKSk7Ci0JCUxfdG1wIC09IHZvX211bHQzMigoKnAxKyspLCAoKnAyLS0pKTsKLQkJTF90bXAgLT0gdm9fbXVsdDMyKCgqcDErKyksICgqcDItLSkpOwotCQlMX3RtcCAtPSB2b19tdWx0MzIoKCpwMSsrKSwgKCpwMi0tKSk7Ci0JCUxfdG1wIC09IHZvX211bHQzMigoKnAxKyspLCAoKnAyLS0pKTsKLQkJTF90bXAgLT0gdm9fbXVsdDMyKCgqcDErKyksICgqcDItLSkpOwotCQlMX3RtcCAtPSB2b19tdWx0MzIoKCpwMSsrKSwgKCpwMi0tKSk7Ci0JCUxfdG1wIC09IHZvX211bHQzMigoKnAxKSwgKCpwMikpOwotCi0JCUxfdG1wID0gTF9zaGwyKExfdG1wLCA0KTsKLQkJeVtpXSA9IHl5W2ldID0gZXh0cmFjdF9oKExfYWRkKExfdG1wLCAweDgwMDApKTsKLQl9Ci0JLyogVXBkYXRlIG1lbW9yeSBpZiByZXF1aXJlZCAqLwotCWlmICh1cGRhdGUpCi0JCWZvciAoaSA9IDA7IGkgPCAxNjsgaSsrKQotCQl7Ci0JCQltZW1baV0gPSB5eVtsZyAtIDE2ICsgaV07Ci0JCX0KLQlyZXR1cm47Ci19Ci0KLQotdm9pZCBTeW5fZmlsdF8zMigKLQkJV29yZDE2IGFbXSwgICAgICAgICAgICAgICAgICAgICAgICAgICAvKiAoaSkgUTEyIDogYVttKzFdIHByZWRpY3Rpb24gY29lZmZpY2llbnRzICovCi0JCVdvcmQxNiBtLCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLyogKGkpICAgICA6IG9yZGVyIG9mIExQIGZpbHRlciAgICAgICAgICAgICAqLwotCQlXb3JkMTYgZXhjW10sICAgICAgICAgICAgICAgICAgICAgICAgIC8qIChpKSBRbmV3OiBleGNpdGF0aW9uIChleGNbaV0gPj4gUW5ldykgICAgKi8KLQkJV29yZDE2IFFuZXcsICAgICAgICAgICAgICAgICAgICAgICAgICAvKiAoaSkgICAgIDogZ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AgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKgotKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqCi0qICAgICAgIERlc2NyaXB0aW9uOiBVcGRhdGUgdGhlIHRhcmdldCB2ZWN0b3IgZm9yIGNvZGVib29rIHNlYXJjaCAgICAgICoKLSogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKgotKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotCi0jaW5jbHVkZSAidHlwZWRlZi5oIgotI2luY2x1ZGUgImJhc2ljX29wLmgiCi0KLXZvaWQgVXBkdF90YXIoCi0JCVdvcmQxNiAqIHgsICAgICAgICAgICAgICAgICAgICAgICAgICAgLyogKGkpIFEwICA6IG9sZCB0YXJnZXQgKGZvciBwaXRjaCBzZWFyY2gpICAgICAqLwotCQlXb3JkMTYgKiB4MiwgICAgICAgICAgICAgICAgICAgICAgICAgIC8qIChvKSBRMCAgOiBuZXcgdGFyZ2V0IChmb3IgY29kZWJvb2sgc2VhcmNoKSAgKi8KLQkJV29yZDE2ICogeSwgICAgICAgICAgICAgICAgICAgICAgICAgICAvKiAoaSkgUTAgIDogZmlsdGVyZWQgYWRhcHRpdmUgY29kZWJvb2sgdmVjdG9yICovCi0JCVdvcmQxNiBnYWluLCAgICAgICAgICAgICAgICAgICAgICAgICAgLyogKGkpIFExNCA6IGFkYXB0aXZlIGNvZGVib29rIGdhaW4gICAgICAgICAgICAqLwotCQlXb3JkMTYgTCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8qIChpKSAgICAgOiBzdWJmcmFtZSBzaXplICAgICAgICAgICAgICAgICAgICAgKi8KLQkgICAgICkKLXsKLQlXb3JkMzIgaTsKLQlXb3JkMzIgTF90bXA7Ci0KLQlmb3IgK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1dGVkIG9uIGFuICJBUyBJUyIgQkFTSVMsCi0gKiogV0lUSE9VVCBXQVJSQU5USUVTIE9SIENPTkRJVElPTlMgT0YgQU5ZIEtJTkQsIGVpdGhlciBleHByZXNzIG9yIGltcGxpZWQuCi0gKiogU2VlIHRoZSBMaWNlbnNlIGZvciB0aGUgc3BlY2lmaWMgbGFuZ3VhZ2UgZ292ZXJuaW5nIHBlcm1pc3Npb25zIGFuZAotICoqIGxpbWl0YXRpb25zIHVuZGVyIHRoZSBMaWNlbnNlLgotICovCi0KLS8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgotKiAgICAgICBGaWxlOiB1dGlsLmMgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqCi0qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICoKLSogICAgICAgRGVzY3JpcHRpb246IFJlc2V0IGFuZCBDb3B5IGJ1ZmZlciAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKgotKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqCi0qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0KLSNpbmNsdWRlICJ0eXBlZGVmLmgiCi0jaW5jbHVkZSAiYmFzaWNfb3AuaCIKLQotLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCi0qIEZ1bmN0aW9uOiAgU2V0X3plcm8oKSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICoKLSogRGVzY3JpcHRpb246IFNldCB2ZWN0b3IgeFtdIHRvIHplcm8gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKgotKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotCi12b2lkIFNldF96ZXJvKAotCQlXb3JkMTYgeFtdLCAgICAgICAgICAgICAgICAgICAgICAgICAgIC8qIChvKSAgICA6IHZlY3RvciB0byBjbGVhciAgICAgKi8KLQkJV29yZDE2IEwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvKiAoaSkgICAgOiBsZW5ndGggb2YgdmVjdG9yICAgICovCi0JICAgICApCi17Ci0JV29yZDMyIG51bSA9IChXb3JkMzIpTDsKLQlkb3sKLQkJKngrKyA9IDA7Ci0JfXdoaWxlKC0tbnVtICE9MCk7Ci19Ci0KLQotLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgotKiBGdW5jdGlvbjogQ29weSgpICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKgotKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKgotKiBEZXNjcmlwdGlvbjogQ29weSB2ZWN0b3IgeFtdIHRvIHlbXSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKgotKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotCi12b2lkIENvcHkoCi0JCVdvcmQxNiB4W10sICAgICAgICAgICAgICAgICAgICAgICAgICAgLyogKGkpICAgOiBpbnB1dCB2ZWN0b3IgICAqLwotCQlXb3JkMTYgeVtdLCAgICAgICAgICAgICAgICAgICAgICAgICAgIC8qIChvKSAgIDogb3V0cHV0IHZlY3RvciAgKi8KLQkJV29yZDE2IEwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvKiAoaSkgICA6IHZlY3RvciBsZW5ndG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RS0yLjAKLSAqKgotICoqIFVubGVzcyByZXF1aXJlZCBieSBhcHBsaWNhYmxlIGxhdyBvciBhZ3JlZWQgdG8gaW4gd3JpdGluZywgc29mdHdhcmUKLSAqKiBkaXN0cmlidXRlZCB1bmRlciB0aGUgTGljZW5zZSBpcyBkaXN0cmlidXRlZCBvbiBhbiAiQVMgSVMiIEJBU0lTLAotICoqIFdJVEhPVVQgV0FSUkFOVElFUyBPUiBDT05ESVRJT05TIE9GIEFOWSBLSU5ELCBlaXRoZXIgZXhwcmVzcyBvciBpbXBsaWVkLgotICoqIFNlZSB0aGUgTGljZW5zZSBmb3IgdGhlIHNwZWNpZmljIGxhbmd1YWdlIGdvdmVybmluZyBwZXJtaXNzaW9ucyBhbmQKLSAqKiBsaW1pdGF0aW9ucyB1bmRlciB0aGUgTGljZW5zZS4KLSAqLwotCi0vKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKLSogICAgICBGaWxlOiB2b0FNUldCRW5jLmMgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKgotKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqCi0qICAgICAgRGVzY3JpcHRpb246IFBlcmZvcm1zIHRoZSBtYWluIGVuY29kZXIgcm91dGluZSAgICAgICAgICAgICAgICAgICoKLSogICAgICAgICAgICAgICAgICAgRml4ZWQtcG9pbnQgQyBzaW11bGF0aW9uIG9mIEFNUiBXQiBBQ0VMUCBjb2RpbmcgICAgKgotKgkJICAgIGFsZ29yaXRobSB3aXRoIDIwIG1zc3BlZWNoIGZyYW1lcyBmb3IgICAgICAgICAgICAgICoKLSoJCSAgICB3aWRlYmFuZCBzcGVlY2ggc2lnbmFscy4gICAgICAgICAgICAgICAgICAgICAgICAgICAqCi0qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA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0tLS0tLS0tLS0qLwotdm9pZCBjb2RlcigKLQkJV29yZDE2ICogbW9kZSwgICAgICAgICAgICAgICAgICAgICAgICAvKiBpbnB1dCA6ICB1c2VkIG1vZGUgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0JCVdvcmQxNiBzcGVlY2gxNmtbXSwgICAgICAgICAgICAgICAgICAgLyogaW5wdXQgOiAgMzIwIG5ldyBzcGVlY2ggc2FtcGxlcyAoYXQgMTYga0h6KSAgICAqLwotCQlXb3JkMTYgcHJtc1tdLCAgICAgICAgICAgICAgICAgICAgICAgIC8qIG91dHB1dDogIG91dHB1dCBwYXJhbWV0ZXJzICAgICAgICAgICAgICAgICAgICAgKi8KLQkJV29yZDE2ICogc2VyX3NpemUsICAgICAgICAgICAgICAgICAgICAvKiBvdXRwdXQ6ICBiaXQgcmF0ZSBvZiB0aGUgdXNlZCBtb2RlICAgICAgICAgICAgICovCi0JCXZvaWQgKnNwZV9zdGF0ZSwgICAgICAgICAgICAgICAgICAgICAgLyogaS9vICAgOiAgU3RhdGUgc3RydWN0dXJlICAgICAgICAgICAgICAgICAgICAgICAqLwotCQlXb3JkMTYgYWxsb3dfZHR4ICAgICAgICAgICAgICAgICAgICAgIC8qIGlucHV0IDogIERUWCBPTi9PRkYgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLQkgICkKLXsKLQkvKiBDb2RlciBzdGF0ZXMgKi8KLQlDb2Rlcl9TdGF0ZSAqc3Q7Ci0JLyogU3BlZWNoIHZlY3RvciAqLwotCVdvcmQxNiBvbGRfc3BlZWNoW0xfVE9UQUxdOwotCVdvcmQxNiAqbmV3X3NwZWVjaCwgKnNwZWVjaCwgKnBfd2luZG93OwotCi0JLyogV2VpZ2h0ZWQgc3BlZWNoIHZlY3RvciAqLwotCVdvcmQxNiBvbGRfd3NwW0xfRlJBTUUgKyAoUElUX01BWCAvIE9QTF9ERUNJTSldOwotCVdvcmQxNiAqd3NwOwotCi0JLyogRXhjaXRhdGlvbiB2ZWN0b3IgKi8KLQlXb3JkMTYgb2xkX2V4Y1soTF9GUkFNRSArIDEpICsgUElUX01BWCArIExfSU5URVJQT0xdOwotCVdvcmQxNiAqZXhjOwotCi0JLyogTFBDIGNvZWZmaWNpZW50cyAqLwotCVdvcmQxNiByX2hbTSArIDFdLCByX2xbTSArIDFdOyAgICAgICAgIC8qIEF1dG9jb3JyZWxhdGlvbnMgb2Ygd2luZG93ZWQgc3BlZWNoICAqLwotCVdvcmQxNiByY1tNXTsgICAgICAgICAgICAgICAgICAgICAgICAgIC8qIFJlZmxlY3Rpb24gY29lZmZpY2llbnRzLiAgICAgICAgICAgICAqLwotCVdvcmQxNiBBcFtNICsgMV07ICAgICAgICAgICAgICAgICAgICAgIC8qIEEoeikgd2l0aCBzcGVjdHJhbCBleHBhbnNpb24gICAgICAgICAqLwotCVdvcmQxNiBpc3BuZXdbTV07ICAgICAgICAgICAgICAgICAgICAgIC8qIGltbWl0dGFuY2Ugc3BlY3RyYWwgcGFpcnMgYXQgNG5kIHNmciAqLwotCVdvcmQxNiBpc3BuZXdfcVtNXTsgICAgICAgICAgICAgICAgICAgIC8qIHF1YW50aXplZCBJU1BzIGF0IDRuZCBzdWJmcmFtZSAgICAgICAqLwotCVdvcmQxNiBpc2ZbTV07ICAgICAgICAgICAgICAgICAgICAgICAgIC8qIElTRiAoZnJlcXVlbmN5IGRvbWFpbikgYXQgNG5kIHNmciAgICAqLwotCVdvcmQxNiAqcF9BLCAqcF9BcTsgICAgICAgICAgICAgICAgICAgIC8qIHB0ciB0byBBKHopIGZvciB0aGUgNCBzdWJmcmFtZXMgICAgICAqLwotCVdvcmQxNiBBW05CX1NVQkZSICogKE0gKyAxKV07ICAgICAgICAgIC8qIEEoeikgdW5xdWFudGl6ZWQgZm9yIHRoZSA0IHN1YmZyYW1lcyAqLwotCVdvcmQxNiBBcVtOQl9TVUJGUiAqIChNICsgMSldOyAgICAgICAgIC8qIEEoeikgICBxdWFudGl6ZWQgZm9yIHRoZSA0IHN1YmZyYW1lcyAqLwotCi0JLyogT3RoZXIgdmVjdG9ycyAqLwotCVdvcmQxNiB4bltMX1NVQkZSXTsgICAgICAgICAgICAgICAgICAgIC8qIFRhcmdldCB2ZWN0b3IgZm9yIHBpdGNoIHNlYXJjaCAgICAgKi8KLQlXb3JkMTYgeG4yW0xfU1VCRlJdOyAgICAgICAgICAgICAgICAgICAvKiBUYXJnZXQgdmVjdG9yIGZvciBjb2RlYm9vayBzZWFyY2ggICovCi0JV29yZDE2IGRuW0xfU1VCRlJdOyAgICAgICAgICAgICAgICAgICAgLyogQ29ycmVsYXRpb24gYmV0d2VlbiB4bjIgYW5kIGgxICAgICAqLwotCVdvcmQxNiBjbltMX1NVQkZSXTsgICAgICAgICAgICAgICAgICAgIC8qIFRhcmdldCB2ZWN0b3IgaW4gcmVzaWR1YWwgZG9tYWluICAgKi8KLQlXb3JkMTYgaDFbTF9TVUJGUl07ICAgICAgICAgICAgICAgICAgICAvKiBJbXB1bHNlIHJlc3BvbnNlIHZlY3RvciAgICAgICAgICAgICovCi0JV29yZDE2IGgyW0xfU1VCRlJdOyAgICAgICAgICAgICAgICAgICAgLyogSW1wdWxzZSByZXNwb25zZSB2ZWN0b3IgICAgICAgICAgICAqLwotCVdvcmQxNiBjb2RlW0xfU1VCRlJdOyAgICAgICAgICAgICAgICAgIC8qIEZpeGVkIGNvZGVib29rIGV4Y2l0YXRpb24gICAgICAgICAgKi8KLQlXb3JkMTYgeTFbTF9TVUJGUl07ICAgICAgICAgICAgICAgICAgICAvKiBGaWx0ZXJlZCBhZGFwdGl2ZSBleGNpdGF0aW9uICAgICAgICovCi0JV29yZDE2IHkyW0xfU1VCRlJdOyAgICAgICAgICAgICAgICAgICAgLyogRmlsdGVyZWQgYWRhcHRpdmUgZXhjaXRhdGlvbiAgICAgICAqLwotCVdvcmQxNiBlcnJvcltNICsgTF9TVUJGUl07ICAgICAgICAgICAgIC8qIGVycm9yIG9mIHF1YW50aXphdGlvbiAgICAgICAgICAgIC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ci0KLQkqc2VyX3NpemUgPSBuYl9vZl9iaXRzWyptb2RlXTsKLQljb2RlY19tb2RlID0gKm1vZGU7Ci0KLQkvKi0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tKgotCSAqICAgICAgICAgIEluaXRpYWxpemUgcG9pbnRlcnMgdG8gc3BlZWNoIHZlY3Rvci4gICAgICAgICAgICAgICAgICAgICAgICAgICAqCi0JICogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICoKLQkgKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKgotCSAqICAgICAgICAgICAgICAgICAgICB8LS0tLS0tLXwtLS0tLS0tfC0tLS0tLS18LS0tLS0tLXwtLS0tLS0tfC0tLS0tLS18ICAgICAqCi0JICogICAgICAgICAgICAgICAgICAgICBwYXN0IHNwICAgc2YxICAgICBzZjIgICAgIHNmMyAgICAgc2Y0ICAgIExfTkVYVCAgICAgICoKLQkgKiAgICAgICAgICAgICAgICAgICAgPC0tLS0tLS0gIFRvdGFsIHNwZWVjaCBidWZmZXIgKExfVE9UQUwpICAgLS0tLS0tPiAgICAgKgotCSAqICAgICAgICAgICAgICBvbGRfc3BlZWNoICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqCi0JICogICAgICAgICAgICAgICAgICAgIDwtLS0tLS0tICBMUEMgYW5hbHlzaXMgd2luZG93IChMX1dJTkRPVykgIC0tLS0tLT4gICAgICoKLQkgKiAgICAgICAgICAgICAgICAgICAgfCAgICAgICA8LS0gcHJlc2VudCBmcmFtZSAoTF9GUkFNRSkgLS0tLT4gICAgICAgICAgICAgKgotCSAqICAgICAgICAgICAgICAgICAgIHBfd2luZG93IHwgICAgICAgPC0tLS0tIG5ldyBzcGVlY2ggKExfRlJBTUUpIC0tLS0+ICAgICAqCi0JICogICAgICAgICAgICAgICAgICAgICAgICAgICAgfCAgICAgICB8ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICoKLQkgKiAgICAgICAgICAgICAgICAgICAgICAgICAgc3BlZWNoICAgIHwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKgotCSAqICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbmV3X3NwZWVjaCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqCi0JICotLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSovCi0KLQluZXdfc3BlZWNoID0gb2xkX3NwZWVjaCArIExfVE9UQUwgLSBMX0ZSQU1FIC0gTF9GSUxUOyAgICAgICAgIC8qIE5ldyBzcGVlY2ggICAgICovCi0Jc3BlZWNoID0gb2xkX3NwZWVjaCArIExfVE9UQUwgLSBMX0ZSQU1FIC0gTF9ORVhUOyAgICAgICAgICAgICAvKiBQcmVzZW50IGZyYW1lICAqLwotCXBfd2luZG93ID0gb2xkX3NwZWVjaCArIExfVE9UQUwgLSBMX1dJTkRPVzsKLQotCWV4YyA9IG9sZF9leGMgKyBQSVRfTUFYICsgTF9JTlRFUlBPTDsKLQl3c3AgPSBvbGRfd3NwICsgKFBJVF9NQVggLyBPUExfREVDSU0pOwotCi0JLyogY29weSBjb2RlciBtZW1vcnkgc3RhdGUgaW50byB3b3JraW5nIHNwYWNlICovCi0JQ29weShzdC0+b2xkX3NwZWVjaCwgb2xkX3NwZWVjaCwgTF9UT1RBTCAtIExfRlJBTUUpOwotCUNvcHkoc3QtPm9sZF93c3AsIG9sZF93c3AsIFBJVF9NQVggLyBPUExfREVDSU0pOwotCUNvcHkoc3QtPm9sZF9leGMsIG9sZF9leGMsIFBJVF9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m9jZXNzaW5nICovCi0JaWYgKGFsbG93X2R0eCAhPSAwKQotCXsKLQkJLyogTm90ZSB0aGF0IG1vZGUgbWF5IGNoYW5nZSBoZXJlICovCi0JCXR4X2R0eF9oYW5kbGVyKHN0LT5kdHhfZW5jU3QsIHZhZF9mbGFnLCBtb2RlKTsKLQkJKnNlcl9zaXplID0gbmJfb2ZfYml0c1sqbW9kZV07Ci0JfQotCi0JaWYoKm1vZGUgIT0gTVJEVFgpCi0JewotCQlQYXJtX3NlcmlhbCh2YWRfZmxhZywgMSwgJnBybXMpOwotCX0KLQkvKi0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSoKLQkgKiAgUGVyZm9ybSBMUEMgYW5hbHlzaXMgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICoKLQkgKiAgfn5+fn5+fn5+fn5+fn5+fn5+fn4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICoKLQkgKiAgIC0gYXV0b2NvcnJlbGF0aW9uICsgbGFnIHdpbmRvd2luZyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICoKLQkgKiAgIC0gTGV2aW5zb24tZHVyYmluIGFsZ29yaXRobSB0byBmaW5kIGFbXSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICoKLQkgKiAgIC0gY29udmVydCBhW10gdG8gaXNwW10gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICoKLQkgKiAgIC0gY29udmVydCBpc3BbXSB0byBpc2ZbXSBmb3IgcXVhbnRpemF0aW9uICAgICAgICAgICAgICAgICAgICAgICAgICAgICoKLQkgKiAgIC0gcXVhbnRpemUgYW5kIGNvZGUgdGhlIGlzZltdICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICoKLQkgKiAgI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yIHBpdGNoIHNlYXJjaCAgICAgICAgICAgICAgICAgICAgICAgKgotCSAqICAgICAtIGNvbXB1dGUgaW1wdWxzZSByZXNwb25zZSBvZiB3ZWlnaHRlZCBzeW50aGVzaXMgZmlsdGVyIChoMVtdKSAgICAgKgotCSAqICAgICAtIGZpbmQgdGhlIGNsb3NlZC1sb29wIHBpdGNoIHBhcmFtZXRlcnMgICAgICAgICAgICAgICAgICAgICAgICAgICAgKgotCSAqICAgICAtIGVuY29kZSB0aGUgcGl0Y2ggZGVhbHkgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKgotCSAqICAgICAtIGZpbmQgMiBsdCBwcmVkaWN0aW9uICh3aXRoIC8gd2l0aG91dCBMUCBmaWx0ZXIgZm9yIGx0IHByZWQpICAgICAgKgotCSAqICAgICAtIGZpbmQgMiBwaXRjaCBnYWlucyBhbmQgY2hvb3NlIHRoZSBiZXN0IGx0IHByZWRpY3Rpb24uICAgICAgICAgICAgKgotCSAqICAgICAtIGZpbmQgdGFyZ2V0IHZlY3RvciBmb3IgY29kZWJvb2sgc2VhcmNoICAgICAgICAgICAgICAgICAgICAgICAgICAgKgotCSAqICAgICAtIHVwZGF0ZSB0aGUgaW1wdWxzZSByZXNwb25zZSBoMVtdIGZvciBjb2RlYm9vayBzZWFyY2ggICAgICAgICAgICAgKgotCSAqICAgICAtIGNvcnJlbGF0aW9uIGJldHdlZW4gdGFyZ2V0IHZlY3RvciBhbmQgaW1wdWxzZSByZXNwb25zZSAgICAgICAgICAgKgotCSAqICAgICAtIGNvZGVib29rIHNlYXJjaCBhbmQgZW5jb2RpbmcgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKgotCSAqICAgICAtIFZRIG9mIHBpdGNoIGFuZCBjb2RlYm9vayBnYWlucyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKgotCSAqICAgICAtIGZpbmQgdm9pY2luZyBmYWN0b3IgYW5kIHRpbHQgb2YgY29kZ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S0qCi0JCSAqICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqCi0JCSAqICAgICAgICBGaW5kIHRoZSB0YXJnZXQgdmVjdG9yIGZvciBwaXRjaCBzZWFyY2g6ICAgICAgICAgICAgICAgICAgICAgICAqCi0JCSAqICAgICAgICB+fn5+fn5+fn5+fn5+fn5+fn5+fn5+fn5+fn5+fn5+fn5+fn5+fn4gICAgICAgICAgICAgICAgICAgICAgICAqCi0JCSAqICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqCi0JCSAqICAgICAgICAgICAgIHwtLS0tLS18ICByZXNbbl0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqCi0JCSAqIHNwZWVjaFtuXS0tLXwgQSh6KSB8LS0tLS0tLS0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqCi0JCSAqICAgICAgICAgICAgIHwtLS0tLS18ICAgICAgIHwgICB8LS0tLS0tLS18IGVycm9yW25dICB8LS0tLS0tfCAgICAgICAgICAqCi0JCSAqICAgICAgICAgICAgICAgICAgIHplcm8gLS0gKC0pLS18IDEvQSh6KSB8LS0tLS0tLS0tLS18IFcoeikgfC0tIHRhcmdldCAqCi0JCSAqICAgICAgICAgICAgICAgICAgIGV4YyAgICAgICAgICB8LS0tLS0tLS18ICAgICAgICAgICB8LS0tLS0tfCAgICAgICAgICAqCi0JCSAqICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqCi0JCSAqIEluc3RlYWQgb2Ygc3VidHJhY3RpbmcgdGhlIHplcm8taW5wdXQgcmVzcG9uc2Ugb2YgZmlsdGVycyBmcm9tICAgICAgICAqCi0JCSAqIHRoZSB3ZWlnaHRlZCBpbnB1dCBzcGVlY2gsIHRoZSB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ICAgICAgICAgICAgICAgICAgICAgICAgICAqCi0qIFN5bnRoZXNpcyBvZiBzaWduYWwgYXQgMTZrSHogd2l0aCBIRiBleHRlbnNpb24uICAgICAqCi0qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqCi0qLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0qLwotCi1zdGF0aWMgV29yZDE2IHN5bnRoZXNpcygKLQkJV29yZDE2IEFxW10sICAgICAgICAgICAgICAgICAgICAgICAgICAvKiBBKHopICA6IHF1YW50aXplZCBBeiAgICAgICAgICAgICAgICovCi0JCVdvcmQxNiBleGNbXSwgICAgICAgICAgICAgICAgICAgICAgICAgLyogKGkpICAgOiBleGNpdGF0aW9uIGF0IDEya0h6ICAgICAgICAqLwotCQlXb3JkMTYgUV9uZXcsICAgICAgICAgICAgICAgICAgICAgICAgIC8qIChpKSAgIDogc2NhbGluZyBwZXJmb3JtZWQgb24gZXhjICAgKi8KLQkJV29yZDE2IHN5bnRoMTZrW10sICAgICAgICAgICAgICAgICAgICAvKiAobykgICA6IDE2a0h6IHN5bnRoZXNpcyBzaWduYWwgICAgICovCi0JCUNvZGVyX1N0YXRlICogc3QgICAgICAgICAgICAgICAgICAgICAgLyogKGkvbykgOiBTdGF0ZSBzdHJ1Y3R1cmUgICAgICAgICAgICAqLwotCQkpCi17Ci0JV29yZDE2IGZhYywgdG1wLCBleHA7Ci0JV29yZDE2IGVuZXIsIGV4cF9lbmVyOwotCVdvcmQzMiBMX3RtcCwgaTsKLQotCVdvcmQxNiBzeW50aF9oaVtNICsgTF9TVUJGUl0sIHN5bnRoX2xvW00gKyBMX1NVQkZSXTsKLQlXb3JkMTYgc3ludGhbTF9TVUJGUl07Ci0JV29yZDE2IEhGW0xfU1VCRlIxNmtdOyAgICAgICAgICAgICAgICAgLyogSGlnaCBGcmVxdWVuY3kgdmVjdG9yICAgICAgK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rKSAgIC8qIERlbGV0ZSB0aGUgMiBMU0JzICgxNC1iaXQgaW5wdXQpICovCi0JewotCQkqKHNpZ25hbCArIGkpID0gKFdvcmQxNikgKCooc2lnbmFsICsgaSkgJiAweGZmZkMpOwotCX0KLQotCWNvZGVyKCZjb2RpbmdfbW9kZSwgc2lnbmFsLCBwcm1zLCAmbmJfYml0cywgZ0RhdGEsIGFsbG93X2R0eCk7Ci0JcGFja2VkX3NpemUgPSBQYWNrQml0cyhwcm1zLCBjb2RpbmdfbW9kZSwgbW9kZSwgZ0RhdGEpOwotCWlmIChyZXNldF9mbGFnICE9IDApCi0JewotCQlSZXNldF9lbmNvZGVyKGdEYXRhLCAxKTsKLQl9Ci0JcmV0dXJuIHBhY2tlZF9zaXplOwotfQotCi0vKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCi0qCi0qQnJpZWY6IENvZGVjIEFQSSBmdW5jdGlvbiAtLS0gSW5pdGlhbGl6ZSB0aGUgY29kZWMgYW5kIHJldHVybiBhIGNvZGVjIGhhbmRsZQotKgotKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotCi1WT19VMzIgVk9fQVBJIHZvQU1SV0JfSW5pdChWT19IQU5ETEUgKiBwaENvZGVjLCAgICAgICAgICAgICAgICAgICAvKiBvOiB0aGUgYXVkaW8gY29kZWMgaGFuZGxlICovCi0JCQkJCQkgICBWT19BVURJT19DT0RJTkdUWVBFIHZUeXBlLCAgICAgICAgICAgICAvKiBpOiBDb2RlYyBUeXBlIElEICovCi0JCQkJCQkgICBWT19DT0RFQ19JTklUX1VTRVJEQVRBICogcFVzZXJEYXRhICAgICAvKiBpOiBpbml0IFBhcmFtZXRlcnMgKi8KLQkJCQkJCSAgICkKLXsKLQlDb2Rlcl9TdGF0ZSAqc3Q7Ci0JRnJhbWVTdHJlYW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CQltZW1fZnJlZShwTWVtT1AsIGhDb2RlYywgVk9fSU5ERVhfRU5DX0FNUldCKTsKLQkJaENvZGVjID0gTlVMTDsKLQl9Ci0KLQlyZXR1cm4gVk9fRVJSX05PTkU7Ci19Ci0KLS8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgotKgotKiBCcmllZjogdm9HZXRBTVJXQkVuY0FQSSBnZXRzIHRoZSBBUEkgaGFuZGxlIG9mIHRoZSBjb2RlYwotKgotKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0KLVZPX1MzMiBWT19BUEkgdm9HZXRBTVJXQkVuY0FQSSgKLQkJCQkJCQkgICBWT19BVURJT19DT0RFQ0FQSSAqIHBFbmNIYW5kbGUgICAgICAvKiBpL286IENvZGVjIGhhbmRsZSBwb2ludGVyICovCi0JCQkJCQkJICAgKQotewotCWlmKE5VTEwgPT0gcEVuY0hhbmRsZSkKLQkJcmV0dXJuIFZPX0VSUl9JTlZBTElEX0FSRzsKLQlwRW5jSGFuZGxlLT5Jbml0ID0gdm9BTVJXQl9Jbml0OwotCXBFbmNIYW5kbGUtPlNldElucHV0RGF0YSA9IHZvQU1SV0JfU2V0SW5wdXREYXRhOwotCXBFbmNIYW5kbGUtPkdldE91dHB1dERhdGEgPSB2b0FNUldCX0dldE91dHB1dERhdGE7Ci0JcEVuY0hhbmRsZS0+U2V0UGFyYW0gPSB2b0FNUldCX1NldFBhcmFtOwotCXBFbmNIYW5kbGUtPkdldFBhcmFtID0gdm9BTVJXQl9HZXRQYXJhbTsKLQlwRW5jSGFuZGxlLT5VbmluaXQgPSB2b0FNUldCX1VuaW5pdDsKLQotCXJldHVybiBWT19FUlJfTk9ORTsKLX0KLQotI2lmZGVmIF9fY3BsdXNwbHVzCi19Ci0jZW5kaWYKZGlmZiAtL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UgZm9yIHRoZSBzcGVjaWZpYyBsYW5ndWFnZSBnb3Zlcm5pbmcgcGVybWlzc2lvbnMgYW5kCi0gKiogbGltaXRhdGlvbnMgdW5kZXIgdGhlIExpY2Vuc2UuCi0gKi8KLQotLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCi0qICAgRmlsZTogdm9pY2VmYWMuYyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICoKLSogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKgotKiAgIERlc2NyaXB0aW9uOiBGaW5kIHRoZSB2b2ljaW5nIGZhY3RvcnMgKDEgPSB2b2ljZSB0byAtMSA9IHVudm9pY2VkKSAqCi0qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICoKLSoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLQotI2luY2x1ZGUgInR5cGVkZWYuaCIKLSNpbmNsdWRlICJiYXNpY19vcC5oIgotI2luY2x1ZGUgIm1hdGhfb3AuaCIKLQotV29yZDE2IHZvaWNlX2ZhY3RvciggICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLyogKG8pIFExNSAgIDogZmFjdG9yICgtMT11bnZvaWNlZCB0byAxPXZvaWNlZCkgKi8KLQkJV29yZDE2IGV4Y1tdLCAgICAgICAgICAgICAgICAgICAgICAgICAvKiAoaSkgUV9leGMgOiBwaXRjaCBleGNpdGF0aW9uICAgICAgICAgICAgICAgICAqLwotCQlXb3JkMTYgUV9leGMsICAgICAgICAgICAgICAgICAgICAgICAgIC8qIChpKSAgICAgICA6IGV4YyBmb3JtYXQgICAgICAgICAgICAgICAgICAgICAgICovCi0JCVdvcmQxNiBnYWluX3BpdCwgICAgICAgICAgICAgICAgICAgICAgLyogKGkpIFExNCAgIDogZ2FpbiBvZiBwaXRjaCAgICAgICAgICAgICAgICAgICAgKi8KLQkJV29yZDE2IGNvZGVbXSwgICAgICAgICAgICAgICAgICAgICAgICAvKiAoaSkgUTkgICAgOiBGaXhlZCBjb2RlYm9vayBleGNpdGF0aW9uICAgICAgICAqLwotCQlXb3JkMTYgZ2Fpbl9jb2RlLCAgICAgICAgICAgICAgICAgICAgIC8qIChpKSBRMCAgICA6IGdhaW4gb2YgY29kZSAgICAgICAgICAgICAgICAgICAgICovCi0JCVdvcmQxNiBMX3N1YmZyICAgICAgICAgICAgICAgICAgICAgICAgLyogKGkpICAgICAgIDogc3ViZnJhbWUgbGVuZ3RoICAgICAgICAgICAgICAgICAgKi8KLQkJKQotewotCVdvcmQxNiB0bXAsIGV4cCwgZW5lcjEsIGV4cDEsIGVuZXIyLCBleHAyOwotCVdvcmQzMiBpLCBMX3RtcDsKLQotI2lmZGVmIEFTTV9PUFQgICAgICAgICAgICAgICAvKiBhc20gb3B0aW1pemF0aW9uIGJyYW5jaCAqLwotCWVuZXIxID0gZXh0cmFjdF9oKERvdF9wcm9kdWN0MTJfYXNtKGV4YywgZXhjLCBMX3N1YmZyLCAmZXhwMSkpOwotI2Vsc2UKLQllbmVyMSA9IGV4dHJhY3RfaChEb3RfcHJvZHVjdDEyKGV4YywgZXhjLCBMX3N1YmZyLCAmZXhwMSkpOwotI2VuZGlmCi0JZXhwMSA9IGV4cDEgLSAoUV9leGMgKyBRX2V4Yyk7Ci0JTF90bXAgPSB2b19MX211bHQoZ2Fpbl9waXQsIGdhaW5fcGl0KTsKLQlleHAgPSBub3JtX2woTF90bXApOwotCXRtcCA9IGV4dHJhY3RfaChMX3RtcCA8PCBleHApOwotCWVuZXIxID0gdm9fbXVsdChlbmVyMSwgdG1wKTsKLQlleHAxID0gZXhwMSAtIGV4cCAtIDEwOyAgICAgICAgLyogMTAgLT4gZ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pb25zIHVuZGVyIHRoZSBMaWNlbnNlLgotICovCi0KLS8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgotKiAgICAgIEZpbGU6IHdiX3ZhZC5jICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqCi0qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICoKLSogICAgICBEZXNjcmlwdGlvbjogVm9pY2UgQWN0aXZpdHkgRGV0ZWN0aW9uICAgICAgICAgICAgICAgICAgICAgICAgICAgKgotKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqCi0qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0KLSNpbmNsdWRlIDxzdGRsaWIuaD4KLSNpbmNsdWRlIDxzdGRpby5oPgotI2luY2x1ZGUgImNuc3QuaCIKLSNpbmNsdWRlICJ3Yl92YWQuaCIKLSNpbmNsdWRlICJ0eXBlZGVmLmgiCi0jaW5jbHVkZSAiYmFzaWNfb3AuaCIKLSNpbmNsdWRlICJtYXRoX29wLmgiCi0jaW5jbHVkZSAid2JfdmFkX2MuaCIKLSNpbmNsdWRlICJtZW1fYWxpZ24uaCIKLQotLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgotKiAgQ2FsY3VsYXRlIExvZzIgYW5kIHNjYWxlIHRoZSBzaWduYWw6Ci0qCi0qICAgIGlsb2cyKFdvcmQzMiBpbikgPSAtMTAyNCpsb2cxMChpbiAqIDJeLTMxKS9sb2cxMCgyKSwgd2hlcmUgaW4gPSBbMSwgMl4zMS0xXQotKgotKiAgaW5wdXQgICBvdXRwdXQKLSogIDMyNzY4ICAgMTYzODQKLSogIDEgICAgICAgMzE3NDQKLSoKLSogV2hlbiBpbnB1dCBpcyBpbiB0aGUgcmFuZ2Ugb2YgWzEsMl4xNl0sIG1heCBlcnJvciBpcyAwLjAzODAlLgotKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotCi1zdGF0aWMgV29yZDE2IGlsb2cyKCAgICAgICAgICAgICAgICAgICAgICAgLyogcmV0dXJuOiBvdXRwdXQgdmFsdWUgb2YgdGhlIGxvZzIgKi8KLQkJV29yZDE2IG1hbnQgICAgICAgICAgICAgICAgICAgICAgICAvKiBpOiB2YWx1ZSB0byBiZSBjb252ZXJ0ZWQgKi8KLQkJKQotewotCVdvcmQxNiBleCwgZXgyLCByZXM7Ci0JV29yZDMyIGksIGxfdGVtcDsKLQotCWlmIChtYW50IDw9IDApCi0JewotCQltYW50ID0gMTsKLQl9Ci0JZXggPSBub3JtX3MobWFudCk7Ci0JbWFudCA9IG1hbnQgPDwgZXg7Ci0KLQlmb3IgKGkgPSAwOyBpIDwgMzsgaSsrKQotCQltYW50ID0gdm9fbXVsdChtYW50LCBtYW50KTsKLQlsX3RlbXAgPSB2b19MX211bHQobWFudCwgbWFudCk7Ci0KLQlleDIgPSBub3JtX2wobF90ZW1wKTsKLQltYW50ID0gZXh0cmFjdF9oKGxfdGVtcCA8PCBleDIpOwotCi0JcmVzID0gKGV4ICsgMTYpIDw8IDEwOwotCXJlcyA9IGFkZDEocmVzLCAoZXgyIDw8IDYpKTsKLQlyZXMgPSB2b19zdWIoYWRkMShyZXMsIDEyNyksIChtYW50ID4+IDgpKTsKLQlyZXR1cm4gKHJlcyk7Ci19Ci0KLS8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKLSoKLSogICAgIEZ1bmN0a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MTUpKTsKLQkqaW4xID0gZXh0cmFjdF9oKCh2b19MX3N1Yih0ZW1wMSwgdGVtcDIpIDw8IDE1KSk7Ci19Ci0KLS8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKLSoKLSogICAgIEZ1bmN0aW9uICAgICA6IGZpbHRlcjMKLSogICAgIFB1cnBvc2UgICAgICA6IFRoaXJkLW9yZGVyIGhhbGYtYmFuZCBsb3dwYXNzL2hpZ2hwYXNzIGZpbHRlciBwYWlyIHdpdGgKLSogICAgICAgICAgICAgICAgICAgIGRlY2ltYXRpb24uCi0qCi0qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotCi1zdGF0aWMgdm9pZCBmaWx0ZXIzKAotCQlXb3JkMTYgKiBpbjAsICAgICAgICAgICAgICAgICAgICAgICAgIC8qIGkvbyA6IGlucHV0IHZhbHVlczsgb3V0cHV0IGxvdy1wYXNzIHBhcnQgICovCi0JCVdvcmQxNiAqIGluMSwgICAgICAgICAgICAgICAgICAgICAgICAgLyogaS9vIDogaW5wdXQgdmFsdWVzOyBvdXRwdXQgaGlnaC1wYXNzIHBhcnQgKi8KLQkJV29yZDE2ICogZGF0YSAgICAgICAgICAgICAgICAgICAgICAgICAvKiBpL28gOiBmaWx0ZXIgbWVtb3J5ICAgICAgICAgICAgICAgICAgICAgICAqLwotCQkpCi17Ci0JV29yZDE2IHRlbXAxLCB0ZW1wMjsKLQotCXRlbXAxID0gdm9fc3ViKCppbjEsIHZvX211bHQoQ09FRkYzLCAqZGF0YSkpOwotCXRlbXAyID0gYWRkMSgqZGF0YSwgdm9fbXVsdChDT0VGRjMsIHRlbXAxKSk7Ci0JKmRhdGEgPSB0ZW1wMTsKLQotCSppbjEgPSBleHRyYWN0X2goKHZvX0xfc3ViKCppbjAsIHRlbXAyKSA8PCAxNSkpOwotCSppbjAgPSBleHRyYWN0X2goKHZvX0xfYWRkKCppbjAsIHRlbXAyKSA8PCAxNSkpOwotfQotCi0vKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCi0qCi0qICAgICBGdW5jdGlvbiAgIDogbGV2ZWxfY2FsY3VsYXRpb24KLSogICAgIFB1cnBvc2UgICAgOiBDYWxjdWxhdGUgc2lnbmFsIGxldmVsIGluIGEgc3ViLWJhbmQuIExldmVsIGlzIGNhbGN1bGF0ZWQKLSogICAgICAgICAgICAgICAgICBieSBzdW1taW5nIGFic29sdXRlIHZhbHVlcyBvZiB0aGUgaW5wdXQgZGF0YS4KLSoKLSogICAgICAgICAgICAgICAgICBTaWduYWwgbGV2ZWwgY2FsY3VsYXRlZCBmcm9tIG9mIHRoZSBlbmQgb2YgdGhlIGZyYW1lCi0qICAgICAgICAgICAgICAgICAgKGRhdGFbY291bnQxIC0gY291bnQyXSkgaXMgc3RvcmVkIHRvICgqc3ViX2xldmVsKQotKiAgICAgICAgICAgICAgICAgIGFuZCBhZGRlZCB0byB0aGUgbGV2ZWwgb2YgdGhlIG5leHQgZnJhbWUuCi0qCi0qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0KLXN0YXRpYyBXb3JkMTYgbGV2ZWxfY2FsY3VsYXRpb24oICAgICAgICAgICAgICAgICAgICAgIC8qIHJldHVybjogc2lnbmFsIGxldmVsICovCi0JCVdvcmQxNiBkYXRhW10sICAgICAgICAgICAgICAgICAgICAgICAgLyogaSAgIDogc2lnbmFsIGJ1ZmZlciAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0JCVdvcmQxNiAqIHN1Yl9sZXZlbCwgICAgICAgICAgICAgICAgICAgLyogaSAgIDogbGV2ZWwgY2FsY3VsYXRlZCBhdCB0aGUgZW5kIG9mIHRoZSBwcmV2aW91cyBmcmFtZSovCi0JCSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLyogbyAgIDogbGV2ZWwgb2Ygc2lnbmFsIGNhbGN1bGF0ZWQgZnJvbSB0aGUgbGFzdCAgICAgICAgICovCi0JCSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLyogICAgICAgKGNvdW50MiAtIGNvdW50MSkgc2FtcGxlcyAgICAgICAgICAgICAgICAgICAgICAgICovCi0JCVdvcmQxNiBjb3VudDEsICAgICAgICAgICAgICAgICAgICAgICAgLyogaSAgIDogbnVtYmVyIG9mIHNhbXBsZXMgdG8gYmUgY291bnRlZCAgICAgICAgICAgICAgICAgICovCi0JCVdvcmQxNiBjb3VudDIsICAgICAgICAgICAgICAgICAgICAgICAgLyogaSAgIDogbnVtYmVyIG9mIHNhbXBsZXMgdG8gYmUgY291bnRlZCAgICAgICAgICAgICAgICAgICovCi0JCVdvcmQxNiBpbmRfbSwgICAgICAgICAgICAgICAgICAgICAgICAgLyogaSAgIDogc3RlcCBzaXplIGZvciB0aGUgaW5kZXggb2YgdGhlIGRhdGEgYnVmZmVyICAgICAgICovCi0JCVdvcmQxNiBpbmRfYSwgICAgICAgICAgICAgICAgICAgICAgICAgLyogaSAgIDogc3RhcnRpbmcgaW5kZXggb2YgdGhlIGRhdGEgYnVmZmVyICAgICAgICAgICAgICAgICovCi0JCVdvcmQxNiBzY2FsZSAgICAgICAgICAgICAgICAgICAgICAgICAgLyogaSAgIDogc2NhbGluZyBmb3IgdGhlIGxldmVsIGNhbGN1bGF0aW9uICAgICAgICAgICAgICAgICovCi0JCSkKLXsKLQlXb3JkMzIgaSwgbF90ZW1wMSwgbF90ZW1wMjsKLQlXb3JkMTYgbGV2ZWw7Ci0KLQlsX3RlbXAxID0gMEw7Ci0JZm9yIChpID0gY291bnQxOyBpIDwgY291bnQyOyBpKyspCi0JewotCQlsX3RlbXAxICs9IChhYnNfcyhkYXRhW2luZF9tICogaSArIGluZF9hXSk8PDEpOwotCX0KLQotCWxfdGVtcDIgPSB2b19MX2FkZChsX3RlbXAxLCBMX3NobCgqc3ViX2xldmVsLCAxNiAtIHNjYWxlKSk7Ci0JKnN1Yl9sZXZlbCA9IGV4dHJhY3RfaChMX3NobChsX3RlbXAxLCBzY2FsZSkpOwotCi0JZm9yIChpID0gMDsgaSA8IGNvdW50MTsgaSsrKQotCXsKLQkJbF90ZW1wMiArPSAoYWJzX3MoZGF0YVtpbmRfbSAqIGkgKyBpbmRfYV0pPDwxKTsKLQl9Ci0JbGV2ZWwgPSBleHRyYWN0X2goTF9zaGwyKGxfdGVtcDIsIHNjYWxlKSk7Ci0KLQlyZXR1cm4gbGV2ZWw7Ci19Ci0KLS8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKLSoKLSogICAgIEZ1bmN0aW9uICAgICA6IGZpbHRlcl9iYW5rCi0qICAgICBQdXJwb3NlICAgICAgOiBEaXZpZGUgaW5wdXQgc2lnbmFsIGludG8gYmFuZHMgYW5kIGNhbGN1bGF0ZSBsZXZlbCBvZgotKiAgICAgICAgICAgICAgICAgICAgdGhlIHNpZ25hbCBpbiBlYWNoIGJhbmQKLSoKLSoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0KLXN0YXRpYyB2b2lkIGZpbHRlcl9iYW5rKAotCQlWYWRWYXJzICogc3QsICAgICAgICAgICAgICAgICAgICAgICAgIC8qIGkvbyA6IFN0YXRlIHN0cnVjdCAgICAgICAgICAgICAgICovCi0JCVdvcmQxNiBpbltdLCAgICAgICAgICAgICAgICAgICAgICAgICAgLyogaSAgIDogaW5wdXQgZnJhbWUgICAgICAgICAgICAgICAgKi8KLQkJV29yZDE2IGxldmVsW10gICAgICAgICAgICAgICAgICAgICAgICAvKiB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WxfY2FsY3VsYXRpb24odG1wX2J1ZiwgJnN0LT5zdWJfbGV2ZWxbMF0sMiwgOCwgMzIsIDAsIDE3KTsKLX0KLQotLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgotKgotKiAgICAgRnVuY3Rpb24gICA6IHVwZGF0ZV9jbnRybAotKiAgICAgUHVycG9zZSAgICA6IENvbnRyb2wgdXBkYXRlIG9mIHRoZSBiYWNrZ3JvdW5kIG5vaXNlIGVzdGltYXRlLgotKgotKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLQotc3RhdGljIHZvaWQgdXBkYXRlX2NudHJsKAotCQlWYWRWYXJzICogc3QsICAgICAgICAgICAgICAgICAgICAgICAgIC8qIGkvbyA6IFN0YXRlIHN0cnVjdHVyZSAgICAgICAgICAgICAgICAgICAgKi8KLQkJV29yZDE2IGxldmVsW10gICAgICAgICAgICAgICAgICAgICAgICAvKiBpICAgOiBzdWItYmFuZCBsZXZlbHMgb2YgdGhlIGlucHV0IGZyYW1lICovCi0JCSkKLXsKLQlXb3JkMzIgaTsKLQlXb3JkMTYgbnVtLCB0ZW1wLCBzdGF0X3JhdCwgZXhwLCBkZW5vbTsKLQlXb3JkMTYgYWxwaGE7Ci0KLQkvKiBpZiBhIHRvbmUgaGFzIGJlZW4gZGV0ZWN0ZWQgZm9yIGEgd2hpbGUsIGluaXRpYWxpemUgc3RhdF9jb3VudCAqLwotCWlmIChzdWIoKFdvcmQxNikgKHN0LT50b25lX2ZsYWcgJiAweDdjMDApLCAweDdjMDApID09IDApCi0JewotCQlzdC0+c3RhdF9jb3VudCA9IFNUQVRfQ09VTlQ7Ci0JfSBlbHNlCi0JewotCQkvKiBpZiA4IGxhc3QgdmFkLWRlY2lzaW9ucyBoYXZlIGJlZW4gIjAiLCByZWluaXRpYWx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qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotCi1zdGF0aWMgV29yZDE2IGhhbmdvdmVyX2FkZGl0aW9uKCAgICAgICAgICAgICAgICAgICAgICAvKiByZXR1cm46IFZBRF9mbGFnIGluZGljYXRpbmcgZmluYWwgVkFEIGRlY2lzaW9uICovCi0JCVZhZFZhcnMgKiBzdCwgICAgICAgICAgICAgICAgICAgICAgICAgLyogaS9vIDogU3RhdGUgc3RydWN0dXJlICAgICAgICAgICAgICAgICAgICAgKi8KLQkJV29yZDE2IGxvd19wb3dlciwgICAgICAgICAgICAgICAgICAgICAvKiBpICAgOiBmbGFnIHBvd2VyIG9mIHRoZSBpbnB1dCBmcmFtZSAgICAqLwotCQlXb3JkMTYgaGFuZ19sZW4sICAgICAgICAgICAgICAgICAgICAgIC8qIGkgICA6IGhhbmdvdmVyIGxlbmd0aCAqLwotCQlXb3JkMTYgYnVyc3RfbGVuICAgICAgICAgICAgICAgICAgICAgIC8qIGkgICA6IG1pbmltdW0gYnVyc3QgbGVuZ3RoIGZvciBoYW5nb3ZlciBhZGRpdGlvbiAqLwotCQkpCi17Ci0JLyogaWYgdGhlIGlucHV0IHBvd2VyIChwb3dfc3VtKSBpcyBsb3dlciB0aGFuIGEgdGhyZXNob2xkLCBjbGVhciBjb3VudGVycyBhbmQgc2V0IFZBRF9mbGFnIHRvICIwIiAgICAgICAgICovCi0JaWYgKGxvd19wb3dlciAhPSAwKQotCXsKLQkJc3QtPmJ1cnN0X2NvdW50ID0gMDsKLQkJc3QtPmhhbmdfY291bnQgPSAwOwotCQlyZXR1cm4gMDsKLQl9Ci0JLyogdXBkYXRlIHRoZSBjb3VudGVycyAoaGFuZ19jb3VudCwgYnVyc3RfY291bnQpICovCi0JaWYgKChzdC0+dmFkcmVnICYgMHg0MDAwKSAhPSAwKQotCXsKLQkJc3QtPmJ1cnN0X2NvdW50ID0gc3QtPmJ1cnN0X2NvdW50ICsgMTsKLQkJaWYoc3QtPmJ1cnN0X2NvdW50ID49IGJ1cnN0X2xlbikKLQkJewotCQkJc3QtPmhhbmdfY291bnQgPSBoYW5nX2xlbjsKLQkJfQotCQlyZXR1cm4gMTsKLQl9IGVsc2UKLQl7Ci0JCXN0LT5idXJzdF9jb3VudCA9IDA7Ci0JCWlmIChzdC0+aGFuZ19jb3VudCA+IDApCi0JCXsKLQkJCXN0LT5oYW5nX2NvdW50ID0gc3QtPmhhbmdfY291bnQgLSAxOwotCQkJcmV0dXJuIDE7Ci0JCX0KLQl9Ci0JcmV0dXJuIDA7Ci19Ci0KLS8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKLSoKLSogICAgIEZ1bmN0aW9uICAgOiBub2lzZV9lc3RpbWF0ZV91cGRhdGUKLSogICAgIFB1cnBvc2UgICAgOiBVcGRhdGUgb2YgYmFja2dyb3VuZCBub2lzZSBlc3RpbWF0ZQotKgotKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLQotc3RhdGljIHZvaWQgbm9pc2VfZXN0aW1hdGVfdXBkYXRlKAotCQlWYWRWYXJzICogc3QsICAgICAgICAgICAgICAgICAgICAgICAgIC8qIGkvbyA6IFN0YXRlIHN0cnVjdHVyZSAgICAgICAgICAgICAgICAgICAgICAgKi8KLQkJV29yZDE2IGxldmVsW10gICAgICAgICAgICAgICAgICAgICAgICAvKiBpICAgOiBzdWItYmFuZCBsZXZlbHMgb2YgdGhlIGlucHV0IGZyYW1lICovCi0JCSkKLXsKLQlXb3JkMzIgaTsKLQlXb3JkMTYgYWxwaGFfdXAsIGFscGhhX2Rvd24sIGJja3JfYWRkID0gMjsKLQotCS8qIENvbnRyb2wgdXBkYXRlIG9mIGJja3JfZXN0W10gKi8KLQl1cGRhdGVfY250cmwoc3QsIGxldmVsKTsKLQotCS8qIENob29zZSB1cGRhdGUgc3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zICovCi0JCQlzdC0+YmNrcl9lc3RbaV0gPSBhZGQxKGJja3JfYWRkLCBhZGQxKHN0LT5iY2tyX2VzdFtpXSx2b19tdWx0X3IoYWxwaGFfdXAsIHRlbXApKSk7Ci0KLQkJCS8qIGxpbWl0IG1heGltdW0gdmFsdWUgb2YgdGhlIG5vaXNlIGVzdGltYXRlIHRvIE5PSVNFX01BWCAqLwotCQkJaWYoc3QtPmJja3JfZXN0W2ldID4gTk9JU0VfTUFYKQotCQkJewotCQkJCXN0LT5iY2tyX2VzdFtpXSA9IE5PSVNFX01BWDsKLQkJCX0KLQkJfQotCX0KLQotCS8qIFVwZGF0ZSBzaWduYWwgbGV2ZWxzIG9mIHRoZSBwcmV2aW91cyBmcmFtZSAob2xkX2xldmVsKSAqLwotCWZvciAoaSA9IDA7IGkgPCBDT01QTEVOOyBpKyspCi0JewotCQlzdC0+b2xkX2xldmVsW2ldID0gbGV2ZWxbaV07Ci0JfQotfQotCi0vKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCi0qCi0qICAgICBGdW5jdGlvbiAgICAgOiB2YWRfZGVjaXNpb24KLSogICAgIFB1cnBvc2UgICAgICA6IENhbGN1bGF0ZXMgVkFEX2ZsYWcKLSoKLSoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0KLXN0YXRpYyBXb3JkMTYgdmFkX2RlY2lzaW9uKCAgICAgICAgICAgICAgICAgICAgICAgICAgIC8qIHJldHVybiB2YWx1ZSA6IFZBRF9mbGFnICovCi0JCVZhZFZhcnMgKiBzdCwgICAgICAgICAgICAgICAgICAgICAgICAgLyogaS9vIDogU3RhdGUgc3RydWN0dXJlICAgICAgICAgICAgICAgICAgICAgICAqLwotCQlXb3JkMTYgbGV2ZWxbQ09NUExFTl0sICAgICAgICAgICAgICAgIC8qIG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0ZSA9PSAoVmFkVmFycyAqKikgTlVMTCkKLQl7Ci0JCWZwcmludGYoc3RkZXJyLCAidmFkX2luaXQ6IGludmFsaWQgcGFyYW1ldGVyXG4iKTsKLQkJcmV0dXJuIC0xOwotCX0KLQkqc3RhdGUgPSBOVUxMOwotCi0JLyogYWxsb2NhdGUgbWVtb3J5ICovCi0JaWYgKChzID0gKFZhZFZhcnMgKikgbWVtX21hbGxvYyhwTWVtT1AsIHNpemVvZihWYWRWYXJzKSwgMzIsIFZPX0lOREVYX0VOQ19BTVJXQikpID09IE5VTEwpCi0JewotCQlmcHJpbnRmKHN0ZGVyciwgInZhZF9pbml0OiBjYW4gbm90IG1hbGxvYyBzdGF0ZSBzdHJ1Y3R1cmVcbiIpOwotCQlyZXR1cm4gLTE7Ci0JfQotCXdiX3ZhZF9yZXNldChzKTsKLQotCSpzdGF0ZSA9IHM7Ci0KLQlyZXR1cm4gMDsKLX0KLQotLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgotKgotKiAgRnVuY3Rpb246ICAgd2JfdmFkX3Jlc2V0Ci0qICBQdXJwb3NlOiAgICBJbml0aWFsaXplcyBzdGF0ZSBtZW1vcnkKLSoKLSoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0KLVdvcmQxNiB3Yl92YWRfcmVzZXQoICAgICAgICAgICAgICAgICAgICAgICAvKiByZXR1cm46IG5vbi16ZXJvIHdpdGggZXJyb3IsIHplcm8gZm9yIG9rLiAqLwotCQlWYWRWYXJzICogc3RhdGUgICAgICAgICAgICAgICAgICAgICAgIC8qIGkvbyA6IFN0YXRlIHN0cnVjdHVyZSAgICAqLwotCQkpCi17Ci0JV29yZDMyIGksIGo7Ci0KLQlpZiAoc3RhdGUgPT0gKFZhZFZhcnMgKikgTlVMTCkKLQl7Ci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SA9IDA7Ci0JcmV0dXJuIDA7Ci19Ci0KLS8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKLSoKLSogIEZ1bmN0aW9uOiAgIHdiX3ZhZF9leGl0Ci0qICBQdXJwb3NlOiAgICBUaGUgbWVtb3J5IHVzZWQgZm9yIHN0YXRlIG1lbW9yeSBpcyBmcmVlZAotKgotKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLQotdm9pZCB3Yl92YWRfZXhpdCgKLQkJVmFkVmFycyAqKiBzdGF0ZSwgICAgICAgICAgICAgICAgICAgICAgLyogaS9vIDogU3RhdGUgc3RydWN0dXJlICAgICovCi0JCVZPX01FTV9PUEVSQVRPUiAqcE1lbU9QCi0JCSkKLXsKLQlpZiAoc3RhdGUgPT0gTlVMTCB8fCAqc3RhdGUgPT0gTlVMTCkKLQkJcmV0dXJuOwotCS8qIGRlYWxsb2NhdGUgbWVtb3J5ICovCi0JbWVtX2ZyZWUocE1lbU9QLCAqc3RhdGUsIFZPX0lOREVYX0VOQ19BTVJXQik7Ci0JKnN0YXRlID0gTlVMTDsKLQlyZXR1cm47Ci19Ci0KLS8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKLSoKLSogICAgIEZ1bmN0aW9uICAgICA6IHdiX3ZhZF90b25lX2RldGVjdGlvbgotKiAgICAgUHVycG9zZSAgICAgIDogU2VhcmNoIG1heGltdW0gcGl0Y2ggZ2FpbiBmcm9tIGEgZnJhbWUuIFNldCB0b25lIGZsYWcgaWYKLSogICAgICAgICAgICAgICAgICAgIHBpdGNoIGdhaW4gaXMgaGlnaC4gVGhpcyBpcyB1c2VkIHRvIGRldGVjdAotKiAgICAgICAgICAgICAgICAgICAgc2lnbmFsaW5nIHRvbmVzIGFuZCBvdGhlciBzaWduYWxzIHdpdGggaGlnaCBwaXRjaCBnYWluLgotKgotKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLQotdm9pZCB3Yl92YWRfdG9uZV9kZXRlY3Rpb24oCi0JCVZhZFZhcnMgKiBzdCwgICAgICAgICAgICAgICAgICAgICAgICAgLyogaS9vIDogU3RhdGUgc3RydWN0ICAgICAgICAgICAgKi8KLQkJV29yZDE2IHBfZ2FpbiAgICAgICAgICAgICAgICAgICAgICAgICAvKiBwaXRjaCBnYWluICAgICAgKi8KLQkJKQotewotCS8qIHVwZGF0ZSB0b25lIGZsYWcgKi8KLQlzdC0+dG9uZV9mbGFnID0gKHN0LT50b25lX2ZsYWcgPj4gMSk7Ci0KLQkvKiBpZiAocGl0Y2hfZ2FpbiA+IFRPTkVfVEhSKSBzZXQgdG9uZSBmbGFnICovCi0JaWYgKHBfZ2FpbiA+IFRPTkVfVEhSKQotCXsKLQkJc3QtPnRvbmVfZmxhZyA9IChXb3JkMTYpIChzdC0+dG9uZV9mbGFnIHwgMHg0MDAwKTsKLQl9Ci19Ci0KLS8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKLSoKLSogICAgIEZ1bmN0aW9uICAgICA6IHdiX3ZhZAotKiAgICAgUHVycG9zZSAgICAgIDogTWFpbiBwcm9ncmFtIGZvciBWb2ljZSBBY3Rpdml0eSBEZXRlY3Rpb24gKFZBRCkgZm9yIEFNUgotKgotKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLQotV29yZDE2IHdiX3ZhZCggICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8qIFJldHVybiB2YWx1ZSA6IFZBRCBEZ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MCAodGhlICJMaWNlbnNlIik7Ci0gKiogeW91IG1heSBub3QgdXNlIHRoaXMgZmlsZSBleGNlcHQgaW4gY29tcGxpYW5jZSB3aXRoIHRoZSBMaWNlbnNlLgotICoqIFlvdSBtYXkgb2J0YWluIGEgY29weSBvZiB0aGUgTGljZW5zZSBhdAotICoqCi0gKiogICAgIGh0dHA6Ly93d3cuYXBhY2hlLm9yZy9saWNlbnNlcy9MSUNFTlNFLTIuMAotICoqCi0gKiogVW5sZXNzIHJlcXVpcmVkIGJ5IGFwcGxpY2FibGUgbGF3IG9yIGFncmVlZCB0byBpbiB3cml0aW5nLCBzb2Z0d2FyZQotICoqIGRpc3RyaWJ1dGVkIHVuZGVyIHRoZSBMaWNlbnNlIGlzIGRpc3RyaWJ1dGVkIG9uIGFuICJBUyBJUyIgQkFTSVMsCi0gKiogV0lUSE9VVCBXQVJSQU5USUVTIE9SIENPTkRJVElPTlMgT0YgQU5ZIEtJTkQsIGVpdGhlciBleHByZXNzIG9yIGltcGxpZWQuCi0gKiogU2VlIHRoZSBMaWNlbnNlIGZvciB0aGUgc3BlY2lmaWMgbGFuZ3VhZ2UgZ292ZXJuaW5nIHBlcm1pc3Npb25zIGFuZAotICoqIGxpbWl0YXRpb25zIHVuZGVyIHRoZSBMaWNlbnNlLgotICovCi0KLS8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgotKiAgICAgICBGaWxlOiB3ZWlnaHRfYS5jICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqCi0qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICoKLSogICAgICAgRGVzY3JpcHRpb246V2VpZ2h0aW5nIG9mIExQQyBjb2VmZmljaWVudHMgICAgICAgICAgICAgICAgICAgICAgKgotKgkgICAgICAgICAgICAgICBhcFtpXSA9IGFbaV0gKiAoZ2FtbWEgKiogaSkgICAgICAgICAgICAgICAgICAgICAqCi0qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICoKLSoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLQotI2luY2x1ZGUgInR5cGVkZWYuaCIKLSNpbmNsdWRlICJiYXNpY19vcC5oIgotCi12b2lkIFdlaWdodF9hKAotCQlXb3JkMTYgYVtdLCAgICAgICAgICAgICAgICAgICAgICAgICAgIC8qIChpKSBRMTIgOiBhW20rMV0gIExQQyBjb2VmZmljaWVudHMgICAgICAgICAgICAgKi8KLQkJV29yZDE2IGFwW10sICAgICAgICAgICAgICAgICAgICAgICAgICAvKiAobykgUTEyIDogU3BlY3RyYWwgZXhwYW5kZWQgTFBDIGNvZWZmaWNpZW50cyAgICovCi0JCVdvcmQxNiBnYW1tYSwgICAgICAgICAgICAgICAgICAgICAgICAgLyogKGkpIFExNSA6IFNwZWN0cmFsIGV4cGFuc2lvbiBmYWN0b3IuICAgICAgICAgICAqLwotCQlXb3JkMTYgbSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8qIChpKSAgICAgOiBMUEMgb3JkZXIuICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLQkgICAgICkKLXsKLQlXb3JkMzIgbnVtID0gbSAtIDEsIGZhYzsKLQkqYXArKyA9ICphKys7Ci0JZmFjID0gZ2FtbWE7Ci0JZG97Ci0JCSphcCsrID0oV29yZDE2KSgoKHZvX0xfbXVsdCgoKmErKyksIGZhYykpICsgMHg4MDAwKSA+PiAxNik7Ci0JCWZhYyA9ICh2b19MX211bHQoZmFjLCBnYW1tYSkgKyAweDgwMDApID4+IDE2OwotCX13aGlsZSgtLW51bSAhPSAwKTsKLQotCSphcCsrID0gKFdvcmQxNikoKCh2b19MX211bHQoKCphKyspLCBmYWMpKSArIDB4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0gICAgdWludCAgc2FyX3dpZHRoOyAgICAgICAgICAgICAgICAgICAgICAgICAgLyogdSgxNikgKi8KLSAgICB1aW50ICBzYXJfaGVpZ2h0OyAgICAgICAgICAgICAgICAgICAgICAgICAvKiB1KDE2KSAqLwotICAgIHVpbnQgICAgICBvdmVyc2Nhbl9pbmZvX3ByZXNlbnRfZmxhZzsgICAgICAgICAvKiB1KDEpICovCi0gICAgdWludCAgICAgIG92ZXJzY2FuX2FwcHJvcHJpYXRlX2ZsYWc7ICAgICAgICAvKiB1KDEpICovCi0gICAgdWludCAgICAgIHZpZGVvX3NpZ25hbF90eXBlX3ByZXNlbnRfZmxhZzsgICAgIC8qIHUoMSkgKi8KLSAgICB1aW50ICB2aWRlb19mb3JtYXQ7ICAgICAgICAgICAgICAgICAgICAgICAgIC8qIHUoMyksIFRhYmxlIEUtMiwgZGVmYXVsdCA1LCB1bnNwZWNpZmllZCAqLwotICAgIHVpbnQgICAgICB2aWRlb19mdWxsX3JhbmdlX2ZsYWc7ICAgICAgICAgICAgLyogdSgxKSAqLwotICAgIHVpbnQgICAgICBjb2xvdXJfZGVzY3JpcHRpb25fcHJlc2VudF9mbGFnOyAgLyogdSgxKSAqLwotICAgIHVpbnQgIGNvbG91cl9wcmltYXJpZXM7ICAgICAgICAgICAgICAgICAgIC8qIHUoOCksIFRhYmxlIEUtMywgZGVmYXVsdCAyLCB1bnNwZWNpZmllZCAqLwotICAgIHVpbnQgIHRyYW5zZmVyX2NoYXJhY3RlcmlzdGljczsgICAgICAgICAgIC8qIHUoOCksIFRhYmxlIEUtNCwgZGVmYXVsdCAyLCB1bnNwZWNpZmllZCAqLwotICAgIHVpbnQgIG1hdHJpeF9jb2VmZmljaWVudHM7ICAgICAgICAgICAgICAgIC8qIHUoOCksIFRhYmxlIEUtNSwgZGVmYXVsdCAyLCB1bnNwZWNpZmllZCAqLwotICAgIHVpbnQgICAgICBjaHJvbWFfbG9jYXRpb25faW5mb19wcmVzZW50X2ZsYWc7ICAvK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IGludDMyICBvZmZzZXRfZm9yX25vbl9yZWZfcGljOyAgICAgICAvKiBzZSh2KSAqLwotICAgIGludDMyICBvZmZzZXRfZm9yX3RvcF90b19ib3R0b21fZmllbGQ7ICAvKiBzZSh2KSAqLwotICAgIHVpbnQgIG51bV9yZWZfZnJhbWVzX2luX3BpY19vcmRlcl9jbnRfY3ljbGU7ICAgLyogdWUodikgLCByYW5nZSAwLi4yNTUgKi8KLSAgICAvKiBmb3IoIGkgPSAwOyBpIDwgbnVtX3JlZl9mcmFtZXNfaW5fcGljX29yZGVyX2NudF9jeWNsZTsgaSsrICkgKi8KLSAgICBpbnQzMiAgIG9mZnNldF9mb3JfcmVmX2ZyYW1lW01BWF9OVU1fUkVGX0ZSQU1FU19JTl9QSUNfT1JERVJfQ05UX0NZQ0xFXTsgICAgICAgIC8qIHNlKHYpICovCi0gICAgdWludCAgbnVtX3JlZl9mcmFtZXM7ICAgICAgICAgICAgICAgICAgICAgICAgICAgLyogdWUodiksIHJhbmdlIDAuLjE2ICovCi0gICAgdWludCAgIGdhcHNfaW5fZnJhbWVfbnVtX3ZhbHVlX2FsbG93ZWRfZmxhZzsgICAgLyogdSgxKSAqLwotICAgIHVpbnQgIHBpY193aWR0aF9pbl9tYnNfbWludXMxOyAgICAgICAgICAgICAgICAgIC8qIHVlKHYpICovCi0gICAgdWludCAgcGljX2hlaWdodF9pbl9tYXBfdW5pdHNfbWludXMxOyAgICAgICAgICAgLyogdWUodikgKi8KLSAgICB1aW50ICAgZnJhbWVfbWJzX29ubHlfZmxhZzsgICAgICAgICAgICAgICAgICAgICAvKiB1KDEpICovCi0gICAgLyogaWYoICFmcmFtZV9tYnNfb25seV9mbGFnICkgKi8KLSAgICB1aW50ICAgbWJfYWRhcHRpdmVfZnJhbWVfZmllbGRfZmxhZzsgICAgICAgICAgLyogdSgxKSAqLwotICAgIHVpbnQgICBkaXJlY3RfOHg4X2luZmVyZW5jZV9mbGFnOyAgICAvKiB1KDEpLCBtdXN0IGJlID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qLwotICAgIHVpbnQgIGJvdHRvbV9yaWdodFtNQVhfTlVNX1NMSUNFX0dST1VQLTFdOyAgLyogdWUodikgKi8KLSAgICAvKiBlbHNlIGlmKCBzbGljZV9ncm91cF9tYXBfdHlwZSA9ID0gMyB8fCA0IHx8IDUgKi8KLSAgICB1aW50ICBzbGljZV9ncm91cF9jaGFuZ2VfZGlyZWN0aW9uX2ZsYWc7ICAgICAgICAvKiB1KDEpICovCi0gICAgdWludCAgc2xpY2VfZ3JvdXBfY2hhbmdlX3JhdGVfbWludXMxOyAgICAgICAgICAgIC8qIHVlKHYpICovCi0gICAgLyogZWxzZSBpZiggc2xpY2VfZ3JvdXBfbWFwX3R5cGUgPSA9IDYgKSAqLwotICAgIHVpbnQgIHBpY19zaXplX2luX21hcF91bml0c19taW51czE7ICAgICAgICAgIC8qIHVlKHYpICovCi0gICAgLyogZm9yKDA6MTpwaWNfc2l6ZV9pbl9tYXBfdW5pdHNfbWludXMxKSAqLwotICAgIHVpbnQgICpzbGljZV9ncm91cF9pZDsgICAgICAgICAgICAgICAgICAgICAgICAgICAvKiBjb21wbGV0ZSBNQkFtYXAgdSh2KSAqLwotICAgIHVpbnQgIG51bV9yZWZfaWR4X2wwX2FjdGl2ZV9taW51czE7ICAgICAgICAgICAgICAgICAgLyogdWUodiksIHJhbmdlIDAuLjMxICovCi0gICAgdWludCAgbnVtX3JlZl9pZHhfbDFfYWN0aXZlX21pbnVzMTsgICAgICAgICAgICAgICAgICAvKiB1ZSh2KSwgcmFuZ2UgMC4uMzEgKi8KLSAgICB1aW50ICB3ZWlnaHRlZF9wcmVkX2ZsYWc7ICAgICAgICAgICAgICAgICAgICAgICAgICAgLyogdSgxKSAqLwotICAgIHVpbnQgIHdlaWdodGVkX2JpcHJlZF9pZGM7ICAgICAgICAgICAgICAgICAgICAgICAgICAvKiB1KDIpLCByYW5nZSAwLi4yICovCi0gICAgaW50ICAgcGljX2luaXRfcXBfbWludXMyNjsgICAgICAgICAgICAgICAgICAgIC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bTsgICAgICAgICAgICAgIC8qIHUodiksIHNlZSBsb2cybWF4X2ZyYW1lX251bV9taW51czQgKi8KLSAgICAvKiBpZiggIWZyYW1lX21ic19vbmx5X2ZsYWcpICovCi0gICAgdWludCAgICBmaWVsZF9waWNfZmxhZzsgICAgICAgICAvKiB1KDEpICovCi0gICAgLyogaWYoZmllbGRfcGljX2ZsYWcpICovCi0gICAgdWludCBib3R0b21fZmllbGRfZmxhZzsgLyogdSgxKSAqLwotICAgIC8qIGlmKG5hbF91bml0X3R5cGUgPT0gNSkgKi8KLSAgICB1aW50ICAgIGlkcl9waWNfaWQ7ICAgICAgICAgLyogdWUodiksIHJhbmdlIDAuLjY1NTM1ICovCi0gICAgLyogaWYocGljX29yZGVyX2NudF90eXBlPT0wKSAqLwotICAgIHVpbnQgICAgcGljX29yZGVyX2NudF9sc2I7ICAvKiB1KHYpLCByYW5nZSAwLi5NYXhQaWNPcmRlckNudExzYi0xICovCi0gICAgLyogaWYocGljX29yZGVyX3ByZXNlbnRfZmxhZyAmJiAhZmllbGRfcGljX2ZsYWcpICovCi0gICAgaW50MzIgZGVsdGFfcGljX29yZGVyX2NudF9ib3R0b207ICAgLyogc2UodikgKi8KLSAgICAvKiBpZihwaWNfb3JkZXJfY250X3R5cGU9PTEgJiYgIWRlbHRhX3BpY19vcmRlcl9hbHdheXNfemVyb19mbGFnKSAqLwotICAgIC8qIGlmKHBpY19vcmRlcl9wcmVzZW50X2ZsYWcgJiYgIWZpZWxkX3BpY19mbGFnKSAqLwotICAgIGludDMyIGRlbHRhX3BpY19vcmRlcl9jbnRbMl07Ci0gICAgLyogaWYocmVkdW5kYW50X3BpY19jbnRfcHJlc2VudF9mbGFnKSAqLwotICAgIHVpbnQgcmVkdW5kYW50X3BpY19jbnQ7IC8qIHVlKHYpLCByYW5nZSAwLi4xMjcgKi8KLSAgICAvKiBpZihzbGljZV90eXBlID09IEIpICovCi0gICAgdWludCBkaXJlY3Rfc3BhdGlhbF9tdl9wcmVkX2Z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mNsaXBUYWJsZSwgaW50IHBpdGNoKTsKLXN0YXRpYyB2b2lkIEVkZ2VMb29wX0x1bWFfaG9yaXpvbnRhbCh1aW50OCogU3JjUHRyLCB1aW50OCAqU3RyZW5ndGgsIGludCBBbHBoYSwgaW50IEJldGEsIGludCAqY2xpcFRhYmxlLCBpbnQgcGl0Y2gpOwotc3RhdGljIHZvaWQgRWRnZUxvb3BfQ2hyb21hX3ZlcnRpY2FsKHVpbnQ4KiBTcmNQdHIsIHVpbnQ4ICpTdHJlbmd0aCwgaW50IEFscGhhLCBpbnQgQmV0YSwgaW50ICpjbGlwVGFibGUsIGludCBwaXRjaCk7Ci1zdGF0aWMgdm9pZCBFZGdlTG9vcF9DaHJvbWFfaG9yaXpvbnRhbCh1aW50OCogU3JjUHRyLCB1aW50OCAqU3RyZW5ndGgsIGludCBBbHBoYSwgaW50IEJldGEsIGludCAqY2xpcFRhYmxlLCBpbnQgcGl0Y2gpOwotCi0vKgotICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCi0gKiBcYnJpZWYgRmlsdGVyIGFsbCBtYWNyb2Jsb2NrcyBpbiBvcmRlciBvZiBpbmNyZWFzaW5nIG1hY3JvYmxvY2sgYWRkcmVzcy4KLSAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgotKi8KLQotT1NDTF9FWFBPUlRfUkVGIEFWQ1N0YXR1cyBEZWJsb2NrUGljdHVyZShBVkNDb21tb25PYmogKnZpZGVvKQotewotICAgIHVpbnQgICBpLCBqOwotICAgIGludCAgIHBpdGNoID0gdmlkZW8tPmN1cnJQaWMtPnBpdGNoLCBwaXRjaF9jLCB3aWR0aDsKLSAgICB1aW50OCAqU3JjWSwgKlNyY1UsICpTcmNWOwotCi0gICAgU3JjWSA9IHZp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iB0aGUgZmlyc3Qgcm93ICovCi0gICAgewotICAgICAgICBjdXJMIC09IChwaXRjaCA8PCAyKTsKLSAgICAgICAgY3VyQ2IgLT0gKHBpdGNoIDw8IDEpOwotICAgICAgICBjdXJDciAtPSAocGl0Y2ggPDwgMSk7Ci0KLSAgICAgICAgZHN0X2hlaWdodCA9IDIwOwotICAgICAgICBkc3RfaGVpZ2h0YyA9IDEyOwotICAgIH0KLSAgICBlbHNlCi0gICAgewotICAgICAgICBwcmVkX2Jsb2NrICs9IDgwOwotICAgICAgICBwcmVkQ2IgKz0gNDg7Ci0gICAgICAgIHByZWRDciArPSA0ODsKLSAgICAgICAgZHN0X2hlaWdodCA9IDE2OwotICAgICAgICBkc3RfaGVpZ2h0YyA9IDg7Ci0gICAgfQotCi0gICAgaWYgKHhfcG9zKSAvKiBmaW5kIHRoZSB3aWR0aCAqLwotICAgIHsKLSAgICAgICAgY3VyTCAtPSA0OwotICAgICAgICBjdXJDYiAtPSA0OwotICAgICAgICBjdXJDciAtPSA0OwotICAgICAgICBpZiAoeF9wb3MgPT0gKGludCkodmlkZW8tPlBpY1dpZHRoSW5NYnMgLSAxKSkKLSAgICAgICAgewotICAgICAgICAgICAgZHN0X3dpZHRoID0gMjA7Ci0gICAgICAgICAgICBkc3Rfd2lkdGhjID0gMTI7Ci0gICAgICAgIH0KLSAgICAgICAgZWxzZQotICAgICAgICB7Ci0gICAgICAgICAgICBkc3Rfd2lkdGggPSAxNjsKLSAgICAgICAgICAgIGRzdF93aWR0aGMgPSA4OwotICAgICAgICB9Ci0gICAgfQotICAgIGVsc2UKLSAgICB7Ci0gICAgICAgIHByZWRfYmxvY2sgKz0gNDsKLSAgICAgICAgcHJlZENiICs9IDQ7Ci0gICAgICAgIHByZWRDciArPSA0OwotICAgICAgICBkc3Rfd2lkdGggPSAxMjsKLSAgICAgICAgZHN0X3dpZHRoYyA9IDQ7Ci0gICAgfQotCi0gICAgLyogcGVyZm9ybSBjb3B5ICovCi0gICAgZm9yIChqID0gMDsgaiA8IGRzdF9oZWlnaHQ7IGorKykKLSAgICB7Ci0gICAgICAgIG1lbWNweShjdXJMLCBwcmVkX2Jsb2NrLCBkc3Rfd2lkdGgpOwotICAgICAgICBjdXJMICs9IHBpdGNoOwotICAgICAgICBwcmVkX2Jsb2NrICs9IDIwOwotICAgIH0KLSAgICBmb3IgKGogPSAwOyBqIDwgZHN0X2hlaWdodGM7IGorKykKLSAgICB7Ci0gICAgICAgIG1lbWNweShjdXJDYiwgcHJlZENiLCBkc3Rfd2lkdGhjKTsKLSAgICAgICAgbWVtY3B5KGN1ckNyLCBwcmVkQ3IsIGRzdF93aWR0aGMpOwotICAgICAgICBjdXJDYiArPSAocGl0Y2ggPj4gMSk7Ci0gICAgICAgIGN1ckNyICs9IChwaXRjaCA+PiAxKTsKLSAgICAgICAgcHJlZENiICs9IDEyOwotICAgICAgICBwcmVkQ3IgKz0gMTI7Ci0gICAgfQotCi0gICAgaWYgKHhfcG9zICE9IChpbnQpKHZpZGVvLT5QaWNXaWR0aEluTWJzIC0gMSkpIC8qIG5vdyBjb3B5IGZyb20gdGhlIHJpZ2h0LW1vc3QgNCBjb2x1bW5zIHRvIHRoZSBsZWZ0LW1vc3QgNCBjb2x1bW5zICovCi0gICAgewotICAgICAgICBwcmVkX2Jsb2NrID0gdmlkZW8tPnByZWQ7Ci0gICAgICAgIGZvciAoaSA9IDA7IGkgPCAyMDsgaSArPSA0KQotICAgICAgICB7Ci0gICAgICAgICAgICAqKCh1aW50MzIqKXByZWRfYmxvY2spID0gKigodWludDMyKikocHJlZF9ibG9jayArIDE2KSk7Ci0gICAgICAgICAgICBwcmVkX2Jsb2NrICs9IDIwOwotICAgICAgICAgICAgKigodWludDMyKilwcmVkX2Jsb2NrKSA9ICooKHVpbnQzMiopKHByZWRfYmxvY2sgKyAxNikpOwotICAgICAgICAgICAgcHJlZF9ibG9jayArPSAyMDsKLSAgICAgICAgICAgICooKHVpbnQzMiopcHJlZF9ibG9jaykgPSAqKCh1aW50MzIqKShwcmVkX2Jsb2NrICsgMTYpKTsKLSAgICAgICAgICAgIHByZWRfYmxvY2sgKz0gMjA7Ci0gICAgICAgICAgICAqKCh1aW50MzIqKXByZWRfYmxvY2spID0gKigodWludDMyKikocHJlZF9ibG9jayArIDE2KSk7Ci0gICAgICAgICAgICBwcmVkX2Jsb2NrICs9IDIwOwotICAgICAgICB9Ci0KLSAgICAgICAgZm9yIChpID0gMDsgaSA8IDI0OyBpICs9IDQpCi0gICAgICAgIHsKLSAgICAgICAgICAgICooKHVpbnQzMiopcHJlZF9ibG9jaykgPSAqKCh1aW50MzIqKShwcmVkX2Jsb2NrICsgOCkpOwotICAgICAgICAgICAgcHJlZF9ibG9jayArPSAxMjsKLSAgICAgICAgICAgICooKHVpbnQzMiopcHJlZF9ibG9jaykgPSAqKCh1aW50MzIqKShwcmVkX2Jsb2NrICsgOCkpOwotICAgICAgICAgICAgcHJlZF9ibG9jayArPSAxMjsKLSAgICAgICAgICAgICooKHVpbnQzMiopcHJlZF9ibG9jaykgPSAqKCh1aW50MzIqKShwcmVkX2Jsb2NrICsgOCkpOwotICAgICAgICAgICAgcHJlZF9ibG9jayArPSAxMjsKLSAgICAgICAgICAgICooKHVpbnQzMiopcHJlZF9ibG9jaykgPSAqKCh1aW50MzIqKShwcmVkX2Jsb2NrICsgOCkpOwotICAgICAgICAgICAgcHJlZF9ibG9jayArPSAxMjsKLSAgICAgICAgfQotCi0gICAgfQotI2Vsc2UKLSAgICBEZWJsb2NrTWIodmlkZW8sIHhfcG9zLCB5X3BvcywgY3VyTCwgY3VyQ2IsIGN1ckNyKTsKLSNlbmRpZgotCi0gICAgcmV0dXJuIDsKLX0KLSNlbmRpZgotCi0vKgotICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCi0gKiBcYnJpZWYgRGVibG9ja2luZyBmaWx0ZXIgZm9yIG9uZSBtYWNyb2Jsb2NrLgotICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCi0gKi8KLQotdm9pZCBEZWJsb2NrTWIoQVZDQ29tbW9uT2JqICp2aWRlbywgaW50IG1iX3gsIGludCBtYl95LCB1aW50OCAqU3JjWSwgdWludDggKlNyY1UsIHVpbnQ4ICpTcmNWKQotewotICAgIEFWQ01hY3JvYmxvY2sgKk1iUCwgKk1iUTsKLSAgICBpbnQgICAgIGVkZ2UsIFFQLCBRUEM7Ci0gICAgaW50ICAgICBmaWx0ZXJMZWZ0TWJFZGdlRmxhZyA9IChtYl94ICE9IDApOwotICAgIGludCAgICAgZmlsdGVyVG9wTWJFZGdlRmxhZyAgPSAobWJfeSAhPSAwKTsKLSAgICBpbnQgICAgIHBpdGNoID0gdmlkZW8tPmN1cnJQaWMtPnBpdGNoOwotICAgIGludCAgICAgaW5kZXhBLCBpbmRleEIsIHRtcDsKLSAgICBpbnQgICAgIEFscGhhLCBCZXRhLCBBbHBoYV9jLCBCZXRhX2M7Ci0gICAgaW50ICAgICBtYk51bSA9IG1iX3kgKiB2aWRlby0+UGljV2lkdGhJbk1icyArIG1iX3g7Ci0gICAgaW50ICAgICAqY2xpcFRhYmxlLCAqY2xpcFRhYmxlX2MsICpxcF9jbGlwX3RhYjsKLSAgICB1aW50OCAgIFN0cmVuZ3RoWzE2XTsKLSAgICB2b2lkKiAgICAgc3RyOwotCi0gICAgTWJRID0gJih2aWRlby0+bWJsb2NrW21iTnVtXSk7ICAgICAgLy8gY3VycmVudCBNYgotCi0KLSAgICAvLyBJZiBmaWx0ZXIgaXMgZGlzYWJsZWQsIHJldHVybgotICAgIGlmICh2aWRlby0+c2xpY2VIZHItPmRpc2FibGVfZGVibG9ja2luZ19maWx0ZXJfaWRjID09IDEpIHJldHVybjsKLQotICAgIGlmICh2aWRlby0+c2xpY2VIZHItPmRpc2FibGVfZGV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GhhX2MsIEJldGFfYywgY2xpcFRhYmxlX2MsIDEyKTsKLSNlbHNlCi0gICAgICAgICAgICAgICAgRWRnZUxvb3BfQ2hyb21hX2hvcml6b250YWwoU3JjVSArIChlZGdlIDw8IDEpKihwaXRjaCA+PiAxKSwgU3RyZW5ndGggKyAoZWRnZSA8PCAyKSwgQWxwaGFfYywgQmV0YV9jLCBjbGlwVGFibGVfYywgcGl0Y2ggPj4gMSk7Ci0gICAgICAgICAgICAgICAgRWRnZUxvb3BfQ2hyb21hX2hvcml6b250YWwoU3JjViArIChlZGdlIDw8IDEpKihwaXRjaCA+PiAxKSwgU3RyZW5ndGggKyAoZWRnZSA8PCAyKSwgQWxwaGFfYywgQmV0YV9jLCBjbGlwVGFibGVfYywgcGl0Y2ggPj4gMSk7Ci0jZW5kaWYKLSAgICAgICAgICAgIH0KLSAgICAgICAgfQotCi0gICAgfSAvL2VuZCBlZGdlCi0KLSAgICByZXR1cm47Ci19Ci0KLS8qCi0gKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKLSAqIFxicmllZiAgIHJldHVybnMgYSBidWZmZXIgb2YgNCBTdHJlbmd0aCB2YWx1ZXMgZm9yIG9uZSBzdHJpcGUgaW4gYSBtYiAoZm9yIGRpZmZlcmVudCBGcmFtZSB0eXBlcykKLSAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgotKi8KLQotdm9pZCBHZXRTdHJlbmd0aF9FZGdlMCh1aW50OCAqU3RyZW5ndGgsIEFWQ01hY3JvYmxvY2sqIE1iUCwgQVZDTWFjcm9ibG9jayogTWJRLCBpbnQgZGlyKQotewotICAgIGludCB0bXA7Ci0gICAgaW50MTYgKnB0clEsICpwdHJQOwotICAgIHZvaWQq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lbmNlfCA+PSA0Ci0gICAgICAgICAgICAgICAgdG1wID0gKnB0clErKyAtICpwdHJQKys7Ci0gICAgICAgICAgICAgICAgaWYgKHRtcCA8IDApIHRtcCA9IC10bXA7Ci0gICAgICAgICAgICAgICAgaWYgKHRtcCA+PSA0KSAqcFN0cmVuZ3RoID0gMTsKLQotICAgICAgICAgICAgICAgIHRtcCA9ICpwdHJRLS0gLSAqcHRyUC0tOwotICAgICAgICAgICAgICAgIGlmICh0bXAgPCAwKSB0bXAgPSAtdG1wOwotICAgICAgICAgICAgICAgIGlmICh0bXAgPj0gNCkgKnBTdHJlbmd0aCA9IDE7Ci0gICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgIHBTdHJlbmd0aCsrOwotICAgICAgICAgICAgcHRyUSArPSA4OwotICAgICAgICAgICAgcHRyUCArPSA4OwotCi0gICAgICAgICAgICAvLyAybmQgYmxrCi0gICAgICAgICAgICBpZiAoKnBTdHJlbmd0aCA9PSAwKQotICAgICAgICAgICAgewotICAgICAgICAgICAgICAgIC8vIGNoZWNrIHxtdiBkaWZmZXJlbmNlfCA+PSA0Ci0gICAgICAgICAgICAgICAgdG1wID0gKnB0clErKyAtICpwdHJQKys7Ci0gICAgICAgICAgICAgICAgaWYgKHRtcCA8IDApIHRtcCA9IC10bXA7Ci0gICAgICAgICAgICAgICAgaWYgKHRtcCA+PSA0KSAqcFN0cmVuZ3RoID0gMTsKLQotICAgICAgICAgICAgICAgIHRtcCA9ICpwdHJRLS0gLSAqcHRyUC0tOwotICAgICAgICAgICAgICAgIGlmICh0bXAgPCAwKSB0bXAgPSAtdG1wOwotICAgICAgICAgICAgICAgIGlmICh0bXAgPj0gNCkgKnBTdHJlbmd0aCA9IDE7Ci0gICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgIHBTdHJlbmd0aCsrOwotICAgICAgICAgICAgcHRyUSArPSA4OwotICAgICAgICAgICAgcHRyUCArPSA4OwotCi0gICAgICAgICAgICAvLyAzcmQgYmxrCi0gICAgICAgICAgICBpZiAoKnBTdHJlbmd0aCA9PSAwKQotICAgICAgICAgICAgewotICAgICAgICAgICAgICAgIC8vIGNoZWNrIHxtdiBkaWZmZXJlbmNlfCA+PSA0Ci0gICAgICAgICAgICAgICAgdG1wID0gKnB0clErKyAtICpwdHJQKys7Ci0gICAgICAgICAgICAgICAgaWYgKHRtcCA8IDApIHRtcCA9IC10bXA7Ci0gICAgICAgICAgICAgICAgaWYgKHRtcCA+PSA0KSAqcFN0cmVuZ3RoID0gMTsKLQotICAgICAgICAgICAgICAgIHRtcCA9ICpwdHJRLS0gLSAqcHRyUC0tOwotICAgICAgICAgICAgICAgIGlmICh0bXAgPCAwKSB0bXAgPSAtdG1wOwotICAgICAgICAgICAgICAgIGlmICh0bXAgPj0gNCkgKnBTdHJlbmd0aCA9IDE7Ci0gICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgIHBTdHJlbmd0aCsrOwotICAgICAgICAgICAgcHRyUSArPSA4OwotICAgICAgICAgICAgcHRyUCArPSA4OwotCi0gICAgICAgICAgICAvLyA0dGggYmxrCi0gICAgICAgICAgICBpZiAoKnBTdHJlbmd0aCA9PSAwKQotICAgICAgICAgICAgewotICAgICAgICAgICAgICAgIC8vIGNoZWNrIHxtdiBkaWZmZXJlbmNlfCA+PSA0Ci0gICAgICAgICAgICAgICAgdG1wID0gKnB0clErKyAtICpwdHJQKys7Ci0gICAgICAgICAgICAgICAgaWYgKHRtcCA8IDApIHRtcCA9IC10bXA7Ci0gICAgICAgICAgICAgICAgaWYgKHRtcCA+PSA0KSAqcFN0cmVuZ3RoID0gMTsKLQotICAgICAgICAgICAgICAgIHRtcCA9ICpwdHJRLS0gLSAqcHRyUC0tOwotICAgICAgICAgICAgICAgIGlmICh0bXAgPCAwKSB0bXAgPSAtdG1wOwotICAgICAgICAgICAgICAgIGlmICh0bXAgPj0gNCkgKnBTdHJlbmd0aCA9IDE7Ci0gICAgICAgICAgICB9Ci0gICAgICAgIH0KLSAgICAgICAgZWxzZSAgIC8vIEhvcml6b250YWwgRWRnZSAwCi0gICAgICAgIHsKLQotICAgICAgICAgICAgLy8xLiBDaGVjayB0aGUgcmVmX2ZyYW1lX2lkCi0gICAgICAgICAgICByZWZJZHggPSAodm9pZCopTWJRLT5SZWZJZHg7ICAvL2RlLXJlZiB0eXBlLXB1bm5lZCBwb2ludGVyCi0gICAgICAgICAgICBwdHJRID0gKGludDE2KilyZWZJZHg7Ci0gICAgICAgICAgICByZWZJZHggPSAodm9pZCopTWJQLT5SZWZJZHg7ICAvL2RlLXJlZiB0eXBlLXB1bm5lZCBwb2ludGVyCi0gICAgICAgICAgICBwdHJQID0gKGludDE2KilyZWZJZHg7Ci0gICAgICAgICAgICBwU3RyZW5ndGggPSBTdHJlbmd0aDsKLSAgICAgICAgICAgIGlmIChwdHJRWzBdICE9IHB0clBbMl0pIHBTdHJlbmd0aFswXSA9IDE7Ci0gICAgICAgICAgICBpZiAocHRyUVsxXSAhPSBwdHJQWzNdKSBwU3RyZW5ndGhbMl0gPSAxOwotICAgICAgICAgICAgcFN0cmVuZ3RoWzFdID0gcFN0cmVuZ3RoWzBdOwotICAgICAgICAgICAgcFN0cmVuZ3RoWzNdID0gcFN0cmVuZ3RoWzJdOwotCi0gICAgICAgICAgICAvLzIuIENoZWNrIHRoZSBub24temVybyBjb2VmZiBibG9ja3MgKDR4NCkKLSAgICAgICAgICAgIGlmIChNYlEtPm56X2NvZWZmWzBdICE9IDAgfHwgTWJQLT5uel9jb2VmZlsxMl0gIT0gMCkgcFN0cmVuZ3RoWzBdID0gMjsKLSAgICAgICAgICAgIGlmIChNYlEtPm56X2NvZWZmWzFdICE9IDAgfHwgTWJQLT5uel9jb2VmZlsxM10gIT0gMCkgcFN0cmVuZ3RoWzFdID0gMjsKLSAgICAgICAgICAgIGlmIChNYlEtPm56X2NvZWZmWzJdICE9IDAgfHwgTWJQLT5uel9jb2VmZlsxNF0gIT0gMCkgcFN0cmVuZ3RoWzJdID0gMjsKLSAgICAgICAgICAgIGlmIChNYlEtPm56X2NvZWZmWzNdICE9IDAgfHwgTWJQLT5uel9jb2VmZlsxNV0gIT0gMCkgcFN0cmVuZ3RoWzNdID0gMjsKLQotICAgICAgICAgICAgLy8zLiBPbmx5IG5lZWQgdG8gY2hlY2sgdGhlIG12IGRpZmZlcmVuY2UKLSAgICAgICAgICAgIHZwdHIgPSAodm9pZCopTWJRLT5tdkwwOwotICAgICAgICAgICAgcHRyUSA9IChpbnQxNiopdnB0cjsKLSAgICAgICAgICAgIHB0clAgPSAoaW50MTYqKShNYlAtPm12TDAgKyAxMik7IC8vIHBvaW50cyB0byA0eDQgYmxvY2sgIzEyICh0aGUgNHRoIHJvdykKLQotICAgICAgICAgICAgLy8gMXN0IGJsawotICAgICAgICAgICAgaWYgKCpwU3RyZW5ndGggPT0gMCkKLSAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAvLyBjaGVjayB8bXYgZGlmZmVyZW5jZXwgPj0gNAotICAgICAgICAgICAgICAgIHRtcCA9ICpwdHJRKysgLSAqcHRyUCsrOwotICAgICAgICAgICAgICAgIGlmICh0bXAgPCAwKSB0bXAgPSAtdG1wOwotICAgICAgICAgICAgICAgIGlmICh0bXAgPj0gNCkgKnBTdHJlbmd0aCA9IDE7Ci0KLSAgICAgICAgICAgICAgICB0bXAgPSAqcHRyUS0tIC0gKnB0clAtLTsKLSAgICAgICAgICAgICAgICBpZiAodG1wIDwgMCkgdG1wID0gLXRtcDsKLSAgICAgICAgICAgICAgICBpZiAodG1wID49IDQpICpwU3RyZW5ndGggPSAxOwotICAgICAgICAgICAgfQotCi0gICAgICAgICAgICBwU3RyZW5ndGgrKzsKLSAgICAgICAgICAgIHB0clEgKz0gMjsKLSAgICAgICAgICAgIHB0clAgKz0gMjsKLQotICAgICAgICAgICAgLy8gMm5kIGJsawotICAgICAgICAgICAgaWYgKCpwU3RyZW5ndGggID09IDApCi0gICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgLy8gY2hlY2sgfG12IGRpZmZlcmVuY2V8ID49IDQKLSAgICAgICAgICAgICAgICB0bXAgPSAqcHRyUSsrIC0gKnB0clArKzsKLSAgICAgICAgICAgICAgICBpZiAodG1wIDwgMCkgdG1wID0gLXRtcDsKLSAgICAgICAgICAgICAgICBpZiAodG1wID49IDQpICpwU3RyZW5ndGggPSAxOwotCi0gICAgICAgICAgICAgICAgdG1wID0gKnB0clEtLSAtICpwdHJQLS07Ci0gICAgICAgICAgICAgICAgaWYgKHRtcCA8IDApIHRtcCA9IC10bXA7Ci0gICAgICAgICAgICAgICAgaWYgKHRtcCA+PSA0KSAqcFN0cmVuZ3RoID0gMTsKLSAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgcFN0cmVuZ3RoKys7Ci0gICAgICAgICAgICBwdHJRICs9IDI7Ci0gICAgICAgICAgICBwdHJQICs9IDI7Ci0KLSAgICAgICAgICAgIC8vIDNyZCBibGsKLSAgICAgICAgICAgIGlmICgqcFN0cmVuZ3RoICA9PSAwKQotICAgICAgICAgICAgewotICAgICAgICAgICAgICAgIC8vIGNoZWNrIHxtdiBkaWZmZXJlbmNlfCA+PSA0Ci0gICAgICAgICAgICAgICAgdG1wID0gKnB0clErKyAtICpwdHJQKys7Ci0gICAgICAgICAgICAgICAgaWYgKHRtcCA8IDApIHRtcCA9IC10bXA7Ci0gICAgICAgICAgICAgICAgaWYgKHRtcCA+PSA0KSAqcFN0cmVuZ3RoID0gMTsKLQotICAgICAgICAgICAgICAgIHRtcCA9ICpwdHJRLS0gLSAqcHRyUC0tOwotICAgICAgICAgICAgICAgIGlmICh0bXAgPCAwKSB0bXAgPSAtdG1wOwotICAgICAgICAgICAgICAgIGlmICh0bXAgPj0gNCkgKnBTdHJlbmd0aCA9IDE7Ci0gICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgIHBTdHJlbmd0aCsrOwotICAgICAgICAgICAgcHRyUSArPSAyOwotICAgICAgICAgICAgcHRyUCArPSAyOwotCi0gICAgICAgICAgICAvLyA0dGggYmxrCi0gICAgICAgICAgICBpZiAoKnBTdHJlbmd0aCAgPT0gMCkKLSAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAvLyBjaGVjayB8bXYgZGlmZmVyZW5jZXwgPj0gNAotICAgICAgICAgICAgICAgIHRtcCA9ICpwdHJRKysgLSAqcHRyUCsrOwotICAgICAgICAgICAgICAgIGlmICh0bXAgPCAwKSB0bXAgPSAtdG1wOwotICAgICAgICAgICAgICAgIGlmICh0bXAgPj0gNCkgKnBTdHJlbmd0aCA9IDE7Ci0KLSAgICAgICAgICAgICAgICB0bXAgPSAqcHRyUS0tIC0gKnB0clAtLTsKLSAgICAgICAgICAgICAgICBpZiAodG1wIDwgMCkgdG1wID0gLXRtcDsKLSAgICAgICAgICAgICAgICBpZiAodG1wID49IDQpICpwU3RyZW5ndGggPSAxOwotICAgICAgICAgICAgfQotCi0gICAgICAgIH0gLyogZW5kIG9mOiBlbHNlIGlmKGRpciA9PSAwKSAqLwotCi0gICAgfSAvKiBlbmQgb2Y6IGlmKCAhKE1iUC0+bWJNb2RlID09IEFWQ19JNCAuLi4pICovCi19Ci0KLQotdm9pZCBHZXRTdHJlbmd0aF9WZXJ0aWNhbEVkZ2VzKHVpbnQ4ICpTdHJlbmd0aCwgQVZDTWFjcm9ibG9jayogTWJRKQotewotICAgIGludCAgICAgaWR4LCB0bXA7Ci0gICAgaW50MTYgICAqcHRyLCAqcG12eCwgKnBtdnk7Ci0gICAgdWludDggICAqcG56OwotICAgIHVpbnQ4ICAgKnBTdHJlbmd0aCwgKnBTdHI7Ci0gICAgdm9pZCogcmVmSWR4OwotCi0gICAgaWYgKE1iUS0+bWJNb2RlID09IEFWQ19JNCB8fCBNYlEtPm1iTW9kZSA9PSBBVkNfSTE2KQotICAgIHsKLSAgICAgICAgKigoaW50KilTdHJlbmd0aCkgICAgID0gSU5JTlRfU1RSRU5HVEhbMV07ICAgICAgLy8gU3RhcnQgd2l0aCBTdHJlbmd0aD0zLiBvciBTdHJlbmd0aD00IGZ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ZvciAoaWR4ID0gMDsgaWR4IDwgNDsgaWR4ICs9IDIpIC8vIHVucm9sbCB0aGUgbG9vcCwgbWFrZSA0IGl0ZXJhdGlvbnMgdG8gMgotICAgICAgICB7Ci0gICAgICAgICAgICAvLyBmaXJzdC90aGlyZCByb3cgOiAxLDIsMyBvciA5LDEwLDEyCi0gICAgICAgICAgICAvLyBTdHJlbmd0aCA9IDIgZm9yIGEgd2hvbGUgcm93Ci0gICAgICAgICAgICBwbnogPSBNYlEtPm56X2NvZWZmICsgKGlkeCA8PCAyKTsKLSAgICAgICAgICAgIGlmICgqcG56KysgIT0gMCkgKnBTdHJlbmd0aCA9IDI7Ci0gICAgICAgICAgICBpZiAoKnBueisrICE9IDApCi0gICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgKnBTdHJlbmd0aCA9IDI7Ci0gICAgICAgICAgICAgICAgKihwU3RyZW5ndGggKyA0KSA9IDI7Ci0gICAgICAgICAgICB9Ci0gICAgICAgICAgICBpZiAoKnBueisrICE9IDApCi0gICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgKihwU3RyZW5ndGggKyA0KSA9IDI7Ci0gICAgICAgICAgICAgICAgKihwU3RyZW5ndGggKyA4KSA9IDI7Ci0gICAgICAgICAgICB9Ci0gICAgICAgICAgICBpZiAoKnBueiAhPSAwKSAqKHBTdHJlbmd0aCArIDgpID0gMjsKLQotICAgICAgICAgICAgLy8gVGhlbiBTdHJlbmd0aCA9IDEKLSAgICAgICAgICAgIGlmICgqcFN0cmVuZ3RoID09IDApCi0gICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgLy93aXRoaW4gdGhlIHNhbWUgOHg4IGJsb2NrLCBubyBuZWVkIHRvIGNoZWNrIHRoZSByZWZlcmVuY2UgaWQKLSAgICAgICAgICAgICAgICAvL29ubHkgbmVlZCB0byBjaGVjayB0aGUgfG12IGRpZmZlcmVuY2V8ID49IDQKLSAgICAgICAgICAgICAgICB0bXAgPSAqcG12eCAtICoocG12eCAtIDIpOwotICAgICAgICAgICAgICAgIGlmICh0bXAgPCAwKSB0bXAgPSAtdG1wOwotICAgICAgICAgICAgICAgIGlmICh0bXAgPj0gNCkgKnBTdHJlbmd0aCA9IDE7Ci0KLSAgICAgICAgICAgICAgICB0bXAgPSAqcG12eSAtICoocG12eSAtIDIpOwotICAgICAgICAgICAgICAgIGlmICh0bXAgPCAwKSB0bXAgPSAtdG1wOwotICAgICAgICAgICAgICAgIGlmICh0bXAgPj0gNCkgKnBTdHJlbmd0aCA9IDE7Ci0gICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgIHBtdnggKz0gMjsKLSAgICAgICAgICAgIHBtdnkgKz0gMjsKLSAgICAgICAgICAgIHBTdHIgPSBwU3RyZW5ndGggKyA0OwotCi0gICAgICAgICAgICBpZiAoKnBTdHIgPT0gMCkKLSAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAvL2NoZWNrIHRoZSB8bXYgZGlmZmVyZW5jZXwgPj0gNAotICAgICAgICAgICAgICAgIHRtcCA9ICpwbXZ4IC0gKihwbXZ4IC0gMik7Ci0gICAgICAgICAgICAgICAgaWYgKHRtcCA8IDApIHRtcCA9IC10bXA7Ci0gICAgICAgICAgICAgICAgaWYgKHRtcCA+PSA0KSAqcFN0ciA9IDE7Ci0KLSAgICAgICAgICAgICAgICB0bXAgPSAqcG12eSAtICoocG12eSAtIDIpOwotICAgICAgICAgICAgICAgIGlmICh0bXAgPCAwKSB0bXAgPSAtdG1wOwotICAgICAgICAgICAgICAgIGlmICh0bXAgPj0gNCkgKnBTdHIgPSAxOwotICAgICAgICAgICAgfQotCi0gICAgICAgICAgICBwbXZ4ICs9IDI7Ci0gICAgICAgICAgICBwbXZ5ICs9IDI7Ci0gICAgICAgICAgICBwU3RyID0gcFN0cmVuZ3RoICsgODsKLQotICAgICAgICAgICAgaWYgKCpwU3RyID09IDApCi0gICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgLy93aXRoaW4gdGhlIHNhbWUgOHg4IGJsb2NrLCBubyBuZWVkIHRvIGNoZWNrIHRoZSByZWZlcmVuY2UgaWQKLSAgICAgICAgICAgICAgICAvL29ubHkgbmVlZCB0byBjaGVjayB0aGUgfG12IGRpZmZlcmVuY2V8ID49IDQKLSAgICAgICAgICAgICAgICB0bXAgPSAqcG12eCAtICoocG12eCAtIDIpOwotICAgICAgICAgICAgICAgIGlmICh0bXAgPCAwKSB0bXAgPSAtdG1wOwotICAgICAgICAgICAgICAgIGlmICh0bXAgPj0gNCkgKnBTdHIgPSAxOwotCi0gICAgICAgICAgICAgICAgdG1wID0gKnBtdnkgLSAqKHBtdnkgLSAyKTsKLSAgICAgICAgICAgICAgICBpZiAodG1wIDwgMCkgdG1wID0gLXRtcDsKLSAgICAgICAgICAgICAgICBpZiAodG1wID49IDQpICpwU3RyID0gMTsKLSAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgLy8gU2Vjb25kL2ZvdXJ0aCByb3c6IDUsNiw3IG9yIDE0LDE1LDE2Ci0gICAgICAgICAgICAvLyBTdHJlbmd0aCA9IDIgZm9yIGEgd2hvbGUgcm93Ci0gICAgICAgICAgICBwbnogPSBNYlEtPm56X2NvZWZmICsgKChpZHggKyAxKSA8PCAyKTsKLSAgICAgICAgICAgIGlmICgqcG56KysgIT0gMCkgKihwU3RyZW5ndGggKyAxKSA9IDI7Ci0gICAgICAgICAgICBpZiAoKnBueisrICE9IDApCi0gICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgKihwU3RyZW5ndGggKyAxKSA9IDI7Ci0gICAgICAgICAgICAgICAgKihwU3RyZW5ndGggKyA1KSA9IDI7Ci0gICAgICAgICAgICB9Ci0gICAgICAgICAgICBpZiAoKnBueisrICE9IDApCi0gICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgKihwU3RyZW5ndGggKyA1KSA9IDI7Ci0gICAgICAgICAgICAgICAgKihwU3RyZW5ndGggKyA5KSA9IDI7Ci0gICAgICAgICAgICB9Ci0gICAgICAgICAgICBpZiAoKnBueiAhPSAwKSAqKHBTdHJlbmd0aCArIDkpID0gMjsKLQotICAgICAgICAgICAgLy8gVGhlbiBTdHJlbmd0aCA9IDEKLSAgICAgICAgICAgIHBtdnggKz0gNDsKLSAgICAgICAgICAgIHBtdnkgKz0gNDsKLSAgICAgICAgICAgIHBTdHIgPSBwU3RyZW5ndGggKyAxOwotICAgICAgICAgICAgaWYgKCpwU3RyID09IDApCi0gICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgLy93aXRoaW4gdGhlIHNhbWUgOHg4IGJsb2NrLCBubyBuZWVkIHRvIGNoZWNrIHRoZSByZWZlcmVuY2UgaWQKLSAgICAgICAgICAgICAgICAvL29ubHkgbmVlZCB0byBjaGVjayB0aGUgfG12IGRpZmZlcmVuY2V8ID49IDQKLSAgICAgICAgICAgICAgICB0bXAgPSAqcG12eCAtICoocG12eCAtIDIpOwotICAgICAgICAgICAgICAgIGlmICh0bXAgPCAwKSB0bXAgPSAtdG1wOwotICAgICAgICAgICAgICAgIGlmICh0bXAgPj0gNCkgKnBTdHIgPSAxOwotCi0gICAgICAgICAgICAgICAgdG1wID0gKnBtdnkgLSAqKHBtdnkgLSAyKTsKLSAgICAgICAgICAgICAgICBpZiAodG1wIDwgMCkgdG1wID0gLXRtcDsKLSAgICAgICAgICAgICAgICBpZiAodG1wID49IDQpICpwU3RyID0gMTsKLSAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgcG12eCArPSAyOwotICAgICAgICAgICAgcG12eSArPSAyOwotICAgICAgICAgICAgcFN0ciA9IHBTdHJlbmd0aCArIDU7Ci0KLSAgICAgICAgICAgIGlmICgqcFN0ciA9PSAwKQotICAgICAgICAgICAgewotICAgICAgICAgICAgICAgIC8vY2hlY2sgdGhlIHxtdiBkaWZmZXJlbmNlfCA+PSA0Ci0gICAgICAgICAgICAgICAgdG1wID0gKnBtdnggLSAqKHBtdnggLSAyKTsKLSAgICAgICAgICAgICAgICBpZiAodG1wIDwgMCkgdG1wID0gLXRtcDsKLSAgICAgICAgICAgICAgICBpZiAodG1wID49IDQpICpwU3RyID0gMTsKLQotICAgICAgICAgICAgICAgIHRtcCA9ICpwbXZ5IC0gKihwbXZ5IC0gMik7Ci0gICAgICAgICAgICAgICAgaWYgKHRtcCA8IDApIHRtcCA9IC10bXA7Ci0gICAgICAgICAgICAgICAgaWYgKHRtcCA+PSA0KSAqcFN0ciA9IDE7Ci0gICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgIHBtdnggKz0gMjsKLSAgICAgICAgICAgIHBtdnkgKz0gMjsKLSAgICAgICAgICAgIHBTdHIgPSBwU3RyZW5ndGggKyA5OwotCi0gICAgICAgICAgICBpZiAoKnBTdHIgPT0gMCkKLSAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAvL3dpdGhpbiB0aGUgc2FtZSA4eDggYmxvY2ssIG5vIG5lZWQgdG8gY2hlY2sgdGhlIHJlZmVyZW5jZSBpZAotICAgICAgICAgICAgICAgIC8vb25seSBuZWVkIHRvIGNoZWNrIHRoZSB8bXYgZGlmZmVyZW5jZXwgPj0gNAotICAgICAgICAgICAgICAgIHRtcCA9ICpwbXZ4IC0gKihwbXZ4IC0gMik7Ci0gICAgICAgICAgICAgICAgaWYgKHRtcCA8IDApIHRtcCA9IC10bXA7Ci0gICAgICAgICAgICAgICAgaWYgKHRtcCA+PSA0KSAqcFN0ciA9IDE7Ci0KLSAgICAgICAgICAgICAgICB0bXAgPSAqcG12eSAtICoocG12eSAtIDIpOwotICAgICAgICAgICAgICAgIGlmICh0bXAgPCAwKSB0bXAgPSAtdG1wOwotICAgICAgICAgICAgICAgIGlmICh0bXAgPj0gNCkgKnBTdHIgPSAxOwotICAgICAgICAgICAgfQotCi0gICAgICAgICAgICAvLyB1cGRhdGUgc29tZSB2YXJpYWJsZXMgZm9yIHRoZSBuZXh0IHR3byByb3dzCi0gICAgICAgICAgICBwbXZ4ICs9IDQ7Ci0gICAgICAgICAgICBwbXZ5ICs9IDQ7Ci0gICAgICAg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lmIChNYlEtPm56X2NvZWZmWzQraWR4XSAhPSAwKQotICAgICAgICAgICAgewotICAgICAgICAgICAgICAgICpwU3RyZW5ndGggPSAyOwotICAgICAgICAgICAgICAgICoocFN0cmVuZ3RoICsgNCkgPSAyOwotICAgICAgICAgICAgfQotICAgICAgICAgICAgaWYgKE1iUS0+bnpfY29lZmZbOCtpZHhdICE9IDApCi0gICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgKihwU3RyZW5ndGggKyA0KSA9IDI7Ci0gICAgICAgICAgICAgICAgKihwU3RyZW5ndGggKyA4KSA9IDI7Ci0gICAgICAgICAgICB9Ci0gICAgICAgICAgICBpZiAoTWJRLT5uel9jb2VmZlsxMitpZHhdICE9IDApICoocFN0cmVuZ3RoICsgOCkgPSAyOwotCi0gICAgICAgICAgICAvLyBUaGVuIFN0cmVuZ3RoID0gMQotICAgICAgICAgICAgaWYgKCpwU3RyZW5ndGggPT0gMCkKLSAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAvL3dpdGhpbiB0aGUgc2FtZSA4eDggYmxvY2ssIG5vIG5lZWQgdG8gY2hlY2sgdGhlIHJlZmVyZW5jZSBpZAotICAgICAgICAgICAgICAgIC8vb25seSBuZWVkIHRvIGNoZWNrIHRoZSB8bXYgZGlmZmVyZW5jZXwgPj0gNAotICAgICAgICAgICAgICAgIHRtcCA9ICpwbXZ4IC0gKihwbXZ4IC0gOCk7Ci0gICAgICAgICAgICAgICAgaWYgKHRtcCA8IDApIHRtcCA9IC10bXA7Ci0gICAgICAgICAgICAgICAgaWYgKHRtcCA+PSA0KSAqcFN0cmVuZ3RoID0gMTsKLQotICAgICAgICAgICAgICAgIHRtcCA9ICpwbXZ5IC0gKihwbXZ5IC0gOCk7Ci0gICAgICAgICAgICAgICAgaWYgKHRtcCA8IDApIHRtcCA9IC10bXA7Ci0gICAgICAgICAgICAgICAgaWYgKHRtcCA+PSA0KSAqcFN0cmVuZ3RoID0gMTsKLSAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgcG12eCArPSA4OwotICAgICAgICAgICAgcG12eSArPSA4OwotICAgICAgICAgICAgcFN0ciA9IHBTdHJlbmd0aCArIDQ7Ci0KLSAgICAgICAgICAgIGlmICgqcFN0ciA9PSAwKQotICAgICAgICAgICAgewotICAgICAgICAgICAgICAgIC8vY2hlY2sgdGhlIHxtdiBkaWZmZXJlbmNlfCA+PSA0Ci0gICAgICAgICAgICAgICAgdG1wID0gKnBtdnggLSAqKHBtdnggLSA4KTsKLSAgICAgICAgICAgICAgICBpZiAodG1wIDwgMCkgdG1wID0gLXRtcDsKLSAgICAgICAgICAgICAgICBpZiAodG1wID49IDQpICpwU3RyID0gMTsKLQotICAgICAgICAgICAgICAgIHRtcCA9ICpwbXZ5IC0gKihwbXZ5IC0gOCk7Ci0gICAgICAgICAgICAgICAgaWYgKHRtcCA8IDApIHRtcCA9IC10bXA7Ci0gICAgICAgICAgICAgICAgaWYgKHRtcCA+PSA0KSAqcFN0ciA9IDE7Ci0gICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgIHBtdnggKz0gODsKLSAgICAgICAgICAgIHBtdnkgKz0gODsKLSAgICAgICAgICAgIHBTdHIgPSBwU3RyZW5ndGggKyA4OwotCi0gICAgICAgICAgICBpZiAoKnBTdHIgPT0gMCkKLSAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAvL3dpdGhpbiB0aGUgc2FtZSA4eDggYmxvY2ssIG5vIG5lZWQgdG8gY2hlY2sgdGhlIHJlZmVyZW5jZSBpZAotICAgICAgICAgICAgICAgIC8vb25seSBuZWVkIHRvIGNoZWNrIHRoZSB8bXYgZGlmZmVyZW5jZXwgPj0gNAotICAgICAgICAgICAgICAgIHRtcCA9ICpwbXZ4IC0gKihwbXZ4IC0gOCk7Ci0gICAgICAgICAgICAgICAgaWYgKHRtcCA8IDApIHRtcCA9IC10bXA7Ci0gICAgICAgICAgICAgICAgaWYgKHRtcCA+PSA0KSAqcFN0ciA9IDE7Ci0KLSAgICAgICAgICAgICAgICB0bXAgPSAqcG12eSAtICoocG12eSAtIDgpOwotICAgICAgICAgICAgICAgIGlmICh0bXAgPCAwKSB0bXAgPSAtdG1wOwotICAgICAgICAgICAgICAgIGlmICh0bXAgPj0gNCkgKnBTdHIgPSAxOwotICAgICAgICAgICAgfQotCi0gICAgICAgICAgICAvLyBTZWNvbmQvZm91cnRoIHJvdzogNSw2LDcgb3IgMTQsMTUsMTYKLSAgICAgICAgICAgIC8vIFN0cmVuZ3RoID0gMiBmb3IgYSB3aG9sZSByb3cKLSAgICAgICAgICAgIGlmIChNYlEtPm56X2NvZWZmW2lkeCsxXSAhPSAwKSAqKHBTdHJlbmd0aCArIDEpID0gMjsKLSAgICAgICAgICAgIGlmIChNYlEtPm56X2NvZWZmWzQraWR4KzFdICE9IDApCi0gICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgKihwU3RyZW5ndGggKyAxKSA9IDI7Ci0gICAgICAgICAgICAgICAgKihwU3RyZW5ndGggKyA1KSA9IDI7Ci0gICAgICAgICAgICB9Ci0gICAgICAgICAgICBpZiAoTWJRLT5uel9jb2VmZls4K2lkeCsxXSAhPSAwKQotICAgICAgICAgICAgewotICAgICAgICAgICAgICAgICoocFN0cmVuZ3RoICsgNSkgPSAyOwotICAgICAgICAgICAgICAgICoocFN0cmVuZ3RoICsgOSkgPSAyOwotICAgICAgICAgICAgfQotICAgICAgICAgICAgaWYgKE1iUS0+bnpfY29lZmZbMTIraWR4KzFdICE9IDApICoocFN0cmVuZ3RoICsgOSkgPSAyOwotCi0gICAgICAgICAgICAvLyBUaGVuIFN0cmVuZ3RoID0gMQotICAgICAgICAgICAgcG12eCAtPSAxNDsKLSAgICAgICAgICAgIHBtdnkgLT0gMTQ7IC8vIC0xNCA9IC0xNiArIDIKLSAgICAgICAgICAgIHBTdHIgPSBwU3RyZW5ndGggKyAxOwotICAgICAgICAgICAgaWYgKCpwU3RyID09IDApCi0gICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgLy93aXRoaW4gdGhlIHNhbWUgOHg4IGJsb2NrLCBubyBuZWVkIHRvIGNoZWNrIHRoZSByZWZlcmVuY2UgaWQKLSAgICAgICAgICAgICAgICAvL29ubHkgbmVlZCB0byBjaGVjayB0aGUgfG12IGRpZmZlcmVuY2V8ID49IDQKLSAgICAgICAgICAgICAgICB0bXAgPSAqcG12eCAtICoocG12eCAtIDgpOwotICAgICAgICAgICAgICAgIGlmICh0bXAgPCAwKSB0bXAgPSAtdG1wOwotICAgICAgICAgICAgICAgIGlmICh0bXAgPj0gNCkgKnBTdHIgPSAxOwotCi0gICAgICAgICAgICAgICAgdG1wID0gKnBtdnkgLSAqKHBtdnkgLSA4KTsKLSAgICAgICAgICAgICAgICBpZiAodG1wIDwgMCkgdG1wID0gLXRtcDsKLSAgICAgICAgICAgICAgICBpZiAodG1wID49IDQpICpwU3RyID0gMTsKLSAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgcG12eCArPSA4OwotICAgICAgICAgICAgcG12eSArPSA4OwotICAgICAgICAgICAgcFN0ciA9IHBTdHJlbmd0aCArIDU7Ci0KLSAgICAgICAgICAgIGlmICgqcFN0ciA9PSAwKQotICAgICAgICAgICAgewotICAgICAgICAgICAgICAgIC8vY2hlY2sgdGhlIHxtdiBkaWZmZXJlbmNlfCA+PSA0Ci0gICAgICAgICAgICAgICAgdG1wID0gKnBtdnggLSAqKHBtdnggLSA4KTsKLSAgICAgICAgICAgICAgICBpZiAodG1wIDwgMCkgdG1wID0gLXRtcDsKLSAgICAgICAgICAgICAgICBpZiAodG1wID49IDQpICpwU3RyID0gMTsKLQotICAgICAgICAgICAgICAgIHRtcCA9ICpwbXZ5IC0gKihwbXZ5IC0gOCk7Ci0gICAgICAgICAgICAgICAgaWYgKHRtcCA8IDApIHRtcCA9IC10bXA7Ci0gICAgICAgICAgICAgICAgaWYgKHRtcCA+PSA0KSAqcFN0ciA9IDE7Ci0gICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgIHBtdnggKz0gODsKLSAgICAgICAgICAgIHBtdnkgKz0gODsKLSAgICAgICAgICAgIHBTdHIgPSBwU3RyZW5ndGggKyA5OwotCi0gICAgICAgICAgICBpZiAoKnBTdHIgPT0gMCkKLSAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAvL3dpdGhpbiB0aGUgc2FtZSA4eDggYmxvY2ssIG5vIG5lZWQgdG8gY2hlY2sgdGhlIHJlZmVyZW5jZSBpZAotICAgICAgICAgICAgICAgIC8vb25seSBuZWVkIHRvIGNoZWNrIHRoZSB8bXYgZGlmZmVyZW5jZXwgPj0gNAotICAgICAgICAgICAgICAgIHRtcCA9ICpwbXZ4IC0gKihwbXZ4IC0gOCk7Ci0gICAgICAgICAgICAgICAgaWYgKHRtcCA8IDApIHRtcCA9IC10bXA7Ci0gICAgICAgICAgICAgICAgaWYgKHRtcCA+PSA0KSAqcFN0ciA9IDE7Ci0KLSAgICAgICAgICAgICAgICB0bXAgPSAqcG12eSAtICoocG12eSAtIDgpOwotICAgICAgICAgICAgICAgIGlmICh0bXAgPCAwKSB0bXAgPSAtdG1wOwotICAgICAgICAgICAgICAgIGlmICh0bXAgPj0gNCkgKnBTdHIgPSAxOwotICAgICAgICAgICAgfQotCi0gICAgICAgICAgICAvLyB1cGRhdGUgc29tZSB2YXJpYWJsZXMgZm9yIHRoZSBuZXh0IHR3byByb3dzCi0gICAgICAgICAgICBwbXZ4IC09IDE0OwotICAgICAgICAgICAgcG12eSAtPSAxNDsgLy8gLTE0ID0gLTE2ICsgMgotICAgICAgICAgICAgcFN0cmVuZ3RoICs9IDI7Ci0KLSAgICAgICAgfSAvKiBlbmQgb2Y6IGZvcihpZHg9MDsgaWR4PDI7IGlkeCsrKSAqLwotCi0gICAgfSAvKiBlbmQgb2Y6IGVsc2UgaWYoIE1iUS0+bWJNb2RlID09IEFWQ19JNCAuLi4pICovCi19Ci0KLS8qCi0gKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKLSAqIFxicmllZiAgRmlsdGVycyBvbmUgZWRnZSBvZiAxNiAobHVtYSkgb3IgOCAoY2hyb21hKSBwZWwKLSAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgotKi8KLQotdm9pZCBFZGdlTG9vcF9MdW1hX2hvcml6b250YWwodWludDgqIFNyY1B0ciwgdWludDggKlN0cmVuZ3RoLCBpbnQgQWxwaGEsIGludCBCZXRhLCBpbnQgKmNsaXBUYWJsZSwgaW50IHBpdGNoKQotewotICAgIGludCAgcGVsLCBhcCA9IDAsIGFxID0gMCwgU3Rybmc7Ci0gICAgaW50ICBDMCwgYzAsIGRpZiwgQWJzRGVsdGEsIHRtcCwgdG1wMTsKLSAgICBpbnQgIEwyID0gMCwgTDEsIEwwLCBSMCwgUjEsIFIyID0gMCwgUkwwOwotCi0KLSAgICBpZiAoU3RyZW5ndGhbMF0gPT0gNCkgIC8qIElOVFJBIHN0cm9uZyBmaWx0ZXJpbmcgKi8KLSAgICB7Ci0gICAgICAgIGZvciAocGVsID0gMDsgcGVsIDwgMTY7IHBlbCsrKQotICAgICAgICB7Ci0gICAgICAgICAgICBSMCAgPSBTcmNQdHJbMF07Ci0gICAgICAgICAgICBSMSAgPSBTcmNQdHJbcGl0Y2hdOwotICAgICAgICAgICAgTDAgID0gU3JjUHRyWy1waXRjaF07Ci0gICAgICAgICAgICBMMSAgPSBTcmNQdHJbLShwaXRjaDw8MSldOwotCi0gICAgICAgICAgICAvLyB8UjAgLSBSMXwgPCBCZXRhCi0gICAgICAgICAgICB0bXAxID0gUjAgLSBSMTsKLSAgICAgICAgICAgIGlmICh0bXAxIDwgMCkgdG1wMSA9IC10bXAxOwotICAgICAgICAgICAgdG1wID0gKHRtcDEgLSBCZXRhKTsKLQotICAgICAgICAgICAgLy98TDAgLSBMMXwgPCBCZXRhCi0gICAgICAgICAgICB0bXAxID0gTDAgLSBMMTsKLSAgICAgICAgICAgIGlmICh0bXAxIDwgMCkgdG1wMSA9IC10bXAxOwotICAgICAgICAgICAgdG1wICY9ICh0bXAxIC0gQmV0YSk7Ci0KLSAgICAgICAgICAgIC8vfFIwIC0gTDB8IDwgQWxwaGEKLSAgICAgICAgICAgIEFic0RlbHRhID0gUjAgLSBMMDsKLSAgICAgICAgICAgIGlmIChBYnNEZWx0YSA8IDApIEFic0RlbHRhID0gLUFic0RlbHRhOwotICAgICAgICAgICAgdG1wICY9IChBYnNEZWx0YSAtIEFscGhhKTsKLQotICAgICAgICAgICAgaWYgKHRtcCA8IDApCi0gICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgQWJzRGVsdGEgLT0gKChBbHBoYSA+PiAyKSArIDIpOwotICAgICAgICAgICAgICAgIFIyID0gU3JjUHRyW3BpdGNoPDwxXTsgLy9pbmMyCi0gICAgICAgICAgICAgICAgTDIgPSBTcmNQdHJbLShwaXRjaCsocGl0Y2g8PDEpKV07IC8vIC1pbmMzCi0KLSAgICAgICAgICAgICAgICAvLyB8UjAgLSBSMnwgPCBCZXRhICYmIHxSMCAtIEwwfCA8IChBbHBoYS80ICsgMikKLSAgICAgICAgICAgICAgICB0bXAgPSBSMCAtIFIyOwotICAgICAgICAgICAgICAgIGlmICh0bXAgPCAwKSB0bXAgPSAtdG1wOwotICAgICAgICAgICAgICAgIGFxID0gQWJzRGVsdGEgJiAodG1wIC0gQmV0YSk7Ci0KLSAgICAgICAgICAgICAgICAvLyB8TDAgLSBMMnwgPCBCZXRhICYmIHxSMCAtIEwwfCA8IChBbHBoYS80ICsgMikKLSAgICAgICAgICAgICAgICB0bXAgPSBMMCAtIEwyOwotICAgICAgICAgICAgICAgIGlmICh0bXAgPCAwKSB0bXAgPSAtdG1wOwotICAgICAgICAgICAgICAgIGFwID0gQWJzRGVsdGEgJiAodG1wIC0gQmV0YSk7Ci0KLSAgICAgICAgICAgICAgICBpZiAoYXEgPCAwKQotICAgICAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAgICAgdG1wID0gUjEgKyBSMCArIEwwOwotICAgICAgICAgICAgICAgICAgICBTcmNQdHJbMF0gPSAoTDEgKyAodG1wIDw8IDEpICsgIFIyICsgNCkgPj4gMzsKLSAgICAgICAgICAgICAgICAgICAgdG1wICs9IFIyOwotICAgICAgICAgICAgICAgICAgICBTcmNQdHJbcGl0Y2hdICA9ICh0bXAgKyAyKSA+PiAyOwotICAgICAgICAgICAgICAgICAgICBTcmNQdHJbcGl0Y2g8PDFdID0gKCgoU3JjUHRyWyhwaXRjaCsocGl0Y2g8PDEpKV0gKyBSMikgPDwgMSkgKyB0bXAgKyA0KSA+PiAzOwotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICBlbHNlCi0gICAgICAgICAgICAgICAgICAgIFNyY1B0clswXSA9ICgoUjEgPDwgMSkgKyBSMCArIEwxICsgMikgPj4gMjsKLQotICAgICAgICAgICAgICAgIGlmIChhcCA8IDApCi0gICAgICAgICAgICAgICAgewotICAgICAgICAgICAgICAgICAgICB0bXAgPSBMMSArIFIwICsgTDA7Ci0gICAgICAgICAgICAgICAgICAgIFNyY1B0clstcGl0Y2hdICA9IChSMSArICh0bXAgPDwgMSkgKyAgTDIgKyA0KSA+PiAzOwotICAgICAgICAgICAgICAgICAgICB0bXAgKz0gTDI7Ci0gICAgICAgICAgICAgICAgICAgIFNyY1B0clstKHBpdGNoPDwxKV0gPSAodG1wICsgMikgPj4gMjsKLSAgICAgICAgICAgICAgICAgICAgU3JjUHRyWy0ocGl0Y2grKHBpdGNoPDwxKSldID0gKCgoU3JjUHRyWy0ocGl0Y2g8PDIpXSArIEwyKSA8PCAxKSArIHRtcCArIDQpID4+IDM7Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgIGVsc2UKLSAgICAgICAgICAgICAgICAgICAgU3JjUHRyWy1waXRjaF0gPSAoKEwxIDw8IDEpICsgTDAgKyBSMSArIDIpID4+IDI7Ci0KLSAgICAgICAgICAgIH0gLyogaWYodG1wIDwgMCkgKi8KLQotICAgICAgICAgICAgU3JjUHRyICsrOyAvLyBJbmNyZW1lbnQgdG8gbmV4dCBzZXQgb2YgcGl4ZWwKLQotICAgICAgICB9IC8qIGVuZCBvZjogZm9yKHBlbD0wOyBwZWw8MTY7IHBlbCsrKSAqLwotCi0gICAgfSAvKiBpZihTdHJlbmd0aFswXSA9PSA0KSAqLwotCi0gICAgZWxzZSAgIC8qIE5vcm1hbCBmaWx0ZXJpbmcgKi8KLSAgICB7Ci0gICAgICAgIGZvciAocGVsID0gMDsgcGVsIDwgMTY7IHBlbCsrKQotICAgICAgICB7Ci0gICAgICAgICAgICBTdHJuZyA9IFN0cmVuZ3RoW3BlbCA+PiAyXTsKLSAgICAgICAgICAgIGlmIChTdHJuZykKLSAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICBSMCAgPSBTcmNQdHJbMF07Ci0gICAgICAgICAgICAgICAgUjEgID0gU3JjUHRyW3BpdGNoXTsKLSAgICAgICAgICAgICAgICBMMCAgPSBTcmNQdHJbLXBpdGNoXTsKLSAgICAgICAgICAgICAgICBMMSAgPSBTcmNQdHJbLShwaXRjaDw8MSldOyAvLyBpbmMyCi0KLSAgICAgICAgICAgICAgICAvL3xSMCAtIEwwfCA8IEFscGhhCi0gICAgICAgICAgICAgICAgdG1wMSA9IFIwIC0gTDA7Ci0gICAgICAgICAgICAgICAgaWYgKHRtcDEgPCAwKSB0bXAxID0gLXRtcDE7Ci0gICAgICAgICAgICAgICAgdG1wID0gKHRtcDEgLSBBbHBoYSk7Ci0KLSAgICAgICAgICAgICAgICAvLyB8UjAgLSBSMXwgPCBCZXRhCi0gICAgICAgICAgICAgICAgdG1wMSA9IFIwIC0gUjE7Ci0gICAgICAgICAgICAgICAgaWYgKHRtcDEgPCAwKSB0bXAxID0gLXRtcDE7Ci0gICAgICAgICAgICAgICAgdG1wICY9ICh0bXAxIC0gQmV0YSk7Ci0KLSAgICAgICAgICAgICAgICAvL3xMMCAtIEwxfCA8IEJldGEKLSAgICAgICAgICAgICAgICB0bXAxID0gTDAgLSBMMTsKLSAgICAgICAgICAgICAgICBpZiAodG1wMSA8IDApIHRtcDEgPSAtdG1wMTsKLSAgICAgICAgICAgICAgICB0bXAgJj0gKHRtcDEgLSBCZXRhKTsKLQotICAgICAgICAgICAgICAgIGlmICh0bXAgPCAwKQotICAgICAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAgICAgUjIgPSBTcmNQdHJbcGl0Y2g8PDFdOyAvL2luYzIKLSAgICAgICAgICAgICAgICAgICAgTDIgPSBTcmNQdHJbLShwaXRjaCsocGl0Y2g8PDEpKV07IC8vIC1pbmMzCi0KLSAgICAgICAgICAgICAgICAgICAgLy8gfFIwIC0gUjJ8IDwgQmV0YQotICAgICAgICAgICAgICAgICAgICB0bXAgPSBSMCAtIFIyOwotICAgICAgICAgICAgICAgICAgICBpZiAodG1wIDwgMCkgdG1wID0gLXRtcDsKLSAgICAgICAgICAgICAgICAgICAgYXEgPSB0bXAgLSBCZXRhOwotCi0gICAgICAgICAgICAgICAgICAgIC8vIHxMMCAtIEwyfCA8IEJldGEKLSAgICAgICAgICAgICAgICAgICAgdG1wID0gTDAgLSBMMjsKLSAgICAgICAgICAgICAgICAgICAgaWYgKHRtcCA8IDApIHRtcCA9IC10bXA7Ci0gICAgICAgICAgICAgICAgICAgIGFwID0gdG1wIC0gQmV0YTsKLQotCi0gICAgICAgICAgICAgICAgICAgIGMwID0gQzAgPSBjbGlwVGFibGVbU3RybmddOwotICAgICAgICAgICAgICAgICAgICBpZiAoYXAgPCAwKSBjMCsrOwotICAgICAgICAgICAgICAgICAgICBpZiAoYXEgPCAwKSBjMCsrOwotCi0gICAgICAgICAgICAgICAgICAgIC8vZGlmID0gSUNsaXAoLWMwLCBjMCwgKChEZWx0YSA8PCAyKSArIChMMSAtIFIxKSArIDQpID4+IDMpOwotICAgICAgICAgICAgICAgICAgICBkaWYgPSAoKChSMCAtIEwwKSA8PCAyKSArIChMMSAtIFIxKSArIDQpID4+IDM7Ci0gICAgICAgICAgICAgICAgICAgIHRtcCA9IGRpZiArIGMwOwotICAgICAgICAgICAgICAgICAgICBpZiAoKHVpbnQpdG1wID4gKHVpbnQpYzAgPDwgMSkKLSAgICAgICAgICAgICAgICAgICAgewotICAgICAgICAgICAgICAgICAgICAgICAgdG1wID0gfih0bXAgPj4gMzEpOwotICAgICAgICAgICAgICAgICAgICAgICAgZGlmID0gKHRtcCAmIChjMCA8PCAxKSkgLSBjMDsKLSAgICAgICAgICAgICAgICAgICAgfQotCi0gICAgICAgICAgICAgICAgICAgIC8vU3JjUHRyWzBdICAgID0gKHVpbnQ4KUlDbGlwKDAsIDI1NSwgUjAgLSBkaWYpOwotICAgICAgICAgICAgICAgICAgICAvL1NyY1B0clstaW5jXSA9ICh1aW50OClJQ2xpcCgwLCAyNTUsIEwwICsgZGlmKTsKLSAgICAgICAgICAgICAgICAgICAgUkwwID0gUjAgKyBMMDsKLSAgICAgICAgICAgICAgICAgICAgUjAgLT0gZGlmOwotICAgICAgICAgICAgICAgICAgICBMMCArPSBkaWY7Ci0gICAgICAgICAgICAgICAgICAgIGlmICgodWludClSMCA+IDI1NSkKLSAgICAgICAgICAgICAgICAgICAgewotICAgICAgICAgICAgICAgICAgICAgICAgdG1wID0gfihSMCA+PiAzMSk7Ci0gICAgICAgICAgICAgICAgICAgICAgICBSMCA9IHRtcCAmIDI1NTsKLSAgICAgICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgICAgICBpZiAoKHVpbnQpTDAgPiAyNTUpCi0gICAgICAgICAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAgICAgICAgIHRtcCA9IH4oTDAgPj4gMzEpOwotICAgICAgICAgICAgICAgICAgICAgICAgTDAgPSB0bXAgJiAyNTU7Ci0gICAgICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICAgICAgU3JjUHRyWy1waXRjaF0gPSBMMDsKLSAgICAgICAgICAgICAgICAgICAgU3JjUHRyWzBdID0gUjA7Ci0KLSAgICAgICAgICAgICAgICAgICAgaWYgKEMwICE9IDApIC8qIE11bHRpcGxlIHplcm9zIGluIHRoZSBjbGlwIHRhYmxlcyAqLwotICAgICAgICAgICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgICAgICAgICBpZiAoYXEgPCAwKSAgLy8gU3JjUHRyW2luY10gICArPSBJQ2xpcCgtQzAsIEMwLChSMiArICgoUkwwICsgMSkgPj4gMSkgLSAoUjE8PDEpKSA+PiAxKTsKLSAgICAgICAgICAgICAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBSMiA9IChSMiArICgoUkwwICsgMSkgPj4gMSkgLSAoUjEgPDwgMSkpID4+IDE7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgdG1wID0gUjIgKyBDMDsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoKHVpbnQpdG1wID4gKHVpbnQpQzAgPDwgMSkKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRtcCA9IH4odG1wID4+IDMxKTsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgUjIgPSAodG1wICYgKEMwIDw8IDEpKSAtIEMwOwotICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBTcmNQdHJbcGl0Y2hdICs9IFIyOwotICAgICAgICAgICAgICAgICAgICAgICAgfQotCi0gICAgICAgICAgICAgICAgICAgICAgICBpZiAoYXAgPCAwKSAgLy9TcmNQdHJbLWluYzJdICs9IElDbGlwKC1DMCwgQzAsKEwyICsgKChSTDAgKyAxKSA+PiAxKSAtIChMMTw8MSkpID4+IDEpOwotICAgICAgICAgICAgICAgICAgICAgICAgewotICAgICAgICAgICAgICAgICAgICAgICAgICAgIEwyID0gKEwyICsgKChSTDAgKyAxKSA+PiAxKSAtIChMMSA8PCAxKSkgPj4gMTsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICB0bXAgPSBMMiArIEMwOwotICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICgodWludCl0bXAgPiAodWludClDMCA8PCAxKQotICAgICAgICAgICAgICAgICAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdG1wID0gfih0bXAgPj4gMzEpOwotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBMMiA9ICh0bXAgJiAoQzAgPDwgMSkpIC0gQzA7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgICAgICAgICAgICAgIFNyY1B0clstKHBpdGNoPDwxKV0gKz0gTDI7Ci0gICAgICAgICAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgICAgIH0gLyogaWYodG1wIDwgMCkgKi8KLQotICAgICAgICAgICAgfSAvKiBlbmQgb2Y6ICBpZigoU3RybmcgPSBTdHJlbmd0aFtwZWwgPj4gMl0pKSAqLwotCi0gICAgICAgICAgICBTcmNQdHIgKys7IC8vIEluY3JlbWVudCB0byBuZXh0IHNldCBvZiBwaXhlbAotCi0gICAgICAgIH0gLyogZm9yKHBlbD0wOyBwZWw8MTY7IHBlbCsrKSAqLwotCi0gICAgfSAvKiBlbHNlIGlmKFN0cmVuZ3RoWzBdID09IDQpICovCi19Ci0KLXZvaWQgRWRnZUxvb3BfTHVtYV92ZXJ0aWNhbCh1aW50OCogU3JjUHRyLCB1aW50OCAqU3RyZW5ndGgsIGludCBBbHBoYSwgaW50IEJldGEsIGludCAqY2xpcFRhYmxlLCBpbnQgcGl0Y2gpCi17Ci0gICAgaW50ICBwZWwsIGFwID0gMSwgYXEgPSAxOwotICAgIGludCAgQzAsIGMwLCBkaWYsIEFic0RlbHRhLCBTdHJuZywgdG1wLCB0bXAxOwotICAgIGludCAgTDIgPSAwLCBMMSwgTDAsIFIwLCBSMSwgUjIgPSAwOwotICAgIHVpbnQ4ICpwdHIsICpwdHIxOwotICAgIHJlZ2lzdGVyIHVpbnQgUl9pbiwgTF9pbjsKLSAgICB1aW50IFJfb3V0LCBMX291dDsKLQotCi0gICAgaWYgKFN0cmVuZ3RoWzBdID09IDQpICAvKiBJTlRSQSBzdHJvbmcgZmlsdGVyaW5nICovCi0gICAgewotCi0gICAgICAgIGZvciAocGVsID0gMDsgcGVsIDwgMTY7IHBlbCsrKQotICAgICAgICB7Ci0KLSAgICAgICAgICAgIC8vIFJlYWQgOCBwZWxzCi0gICAgICAgICAgICBSX2luID0gKigodWludCAqKVNyY1B0cik7ICAgICAgIC8vIFJfaW4gPSB7UjMsIFIyLCBSMSwgUjB9Ci0gICAgICAgICAgICBMX2luID0gKigodWludCAqKShTcmNQdHIgLSA0KSk7IC8vIExfaW4gPSB7TDAsIEwxLCBMMiwgTDN9Ci0gICAgICAgICAgICBSMSAgID0gKFJfaW4gPj4gOCkgJiAweGZmOwotICAgICAgICAgICAgUjAgICA9IFJfaW4gJiAweGZmOwotICAgICAgICAgICAgTDAgICA9IExfaW4gPj4gMjQ7Ci0gICAgICAgICAgICBMMSAgID0gKExfaW4gPj4gMTYpICYgMHhmZjsKLQotICAgICAgICAgICAgLy8gfFIwIC0gUjF8IDwgQmV0YQotICAgICAgICAgICAgdG1wMSA9IChSX2luICYgMHhmZikgLSBSMTsKLSAgICAgICAgICAgIGlmICh0bXAxIDwgMCkgdG1wMSA9IC10bXAxOwotICAgICAgICAgICAgdG1wID0gKHRtcDEgLSBCZXRhKTsKLQotCi0gICAgICAgICAgICAvL3xMMCAtIEwxfCA8IEJldGEKLSAgICAgICAgICAgIHRtcDEgPSAoTF9pbiA+PiAyNCkgLSBMMTsKLSAgICAgICAgICAgIGlmICh0bXAxIDwgMCkgdG1wMSA9IC10bXAxOwotICAgICAgICAgICAgdG1wICY9ICh0bXAxIC0gQmV0YSk7Ci0KLSAgICAgICAgICAgIC8vfFIwIC0gTDB8IDwgQWxwaGEKLSAgICAgICAgICAgIEFic0RlbHRhID0gKFJfaW4gJiAweGZmKSAtIChMX2luID4+IDI0KTsKLSAgICAgICAgICAgIGlmIChBYnNEZWx0YSA8IDApIEFic0RlbHRhID0gLUFic0RlbHRhOwotICAgICAgICAgICAgdG1wICY9IChBYnNEZWx0YSAtIEFscGhhKTsKLQotICAgICAgICAgICAgaWYgKHRtcCA8IDApCi0gICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgQWJzRGVsdGEgLT0gKChBbHBoYSA+PiAyKSArIDIpOwotICAgICAgICAgICAgICAgIFIyICAgPSAoUl9pbiA+PiAxNikgJiAweGZmOwotICAgICAgICAgICAgICAgIEwyICAgPSAoTF9pbiA+PiA4KSAmIDB4ZmY7Ci0KLSAgICAgICAgICAgICAgICAvLyB8UjAgLSBSMnwgPCBCZXRhICYmIHxSMCAtIEwwfCA8IChBbHBoYS80ICsgMikKLSAgICAgICAgICAgICAgICB0bXAxID0gKFJfaW4gJiAweGZmKSAtIFIyOwotICAgICAgICAgICAgICAgIGlmICh0bXAxIDwgMCkgdG1wMSA9IC10bXAxOwotICAgICAgICAgICAgICAgIGFxID0gQWJzRGVsdGEgJiAodG1wMSAtIEJldGEpOwotCi0gICAgICAgICAgICAgICAgLy8gfEwwIC0gTDJ8IDwgQmV0YSAmJiB8UjAgLSBMMHwgPCAoQWxwaGEvNCArIDIpCi0gICAgICAgICAgICAgICAgdG1wMSA9IChMX2luID4+IDI0KSAtIEwyOwotICAgICAgICAgICAgICAgIGlmICh0bXAxIDwgMCkgdG1wMSA9IC10bXAxOwotICAgICAgICAgICAgICAgIGFwID0gQWJzRGVsdGEgJiAodG1wMSAtIEJldGEpOwotCi0KLSAgICAgICAgICAgICAgICBwdHIgPSBTcmNQdHI7Ci0gICAgICAgICAgICAgICAgaWYgKGFxIDwgMCkKLSAgICAgICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgICAgIFJfb3V0ID0gKFJfaW4gPj4gMjQpIDw8IDI0OyAvLyBLZWVwIFIzIGF0IHRoZSBmb3VydGggYnl0ZQotCi0gICAgICAgICAgICAgICAgICAgIHRtcCAgPSBSMCArIEwwICsgUjE7Ci0gICAgICAgICAgICAgICAgICAgIFJfb3V0IHw9ICgoKHRtcCA8PCAxKSArICBMMSArIFIyICsgNCkgPj4gMyk7Ci0gICAgICAgICAgICAgICAgICAgIHRtcCArPSBSMjsKLSAgICAgICAgICAgICAgICAgICAgUl9vdXQgfD0gKCgodG1wICsgMikgPj4gMikgPDwgOCk7Ci0gICAgICAgICAgICAgICAgICAgIHRtcDEgPSAoKFJfaW4gPj4gMjQpICsgUjIpIDw8IDE7Ci0gICAgICAgICAgICAgICAgICAgIFJfb3V0IHw9ICgoKHRtcDEgKyB0bXAgKyA0KSA+PiAzKSA8PCAxNik7Ci0KLSAgICAgICAgICAgICAgICAgICAgKigodWludCAqKVNyY1B0cikgPSBSX291dDsKLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgZWxzZQotICAgICAgICAgICAgICAgICAgICAqcHRyID0gKChSMSA8PCAxKSArIFIwICsgTDEgKyAyKSA+PiAyOwotCi0KLSAgICAgICAgICAgICAgICBpZiAoYXAgPCAwKQotICAgICAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAgICAgTF9vdXQgPSAoTF9pbiA8PCAyNCkgPj4gMjQ7IC8vIEtlZXAgTDMgYXQgdGhlIGZpcnN0IGJ5dGUKLQotICAgICAgICAgICAgICAgICAgICB0bXAgID0gUjAgKyBMMCArIEwxOwotICAgICAgICAgICAgICAgICAgICBMX291dCB8PSAoKCgodG1wIDw8IDEpICsgUjEgKyBMMiArIDQpID4+IDMpIDw8IDI0KTsKLSAgICAgICAgICAgICAgICAgICAgdG1wICs9IEwyOwotICAgICAgICAgICAgICAgICAgICBMX291dCB8PSAoKCh0bXAgKyAyKSA+PiAyKSA8PCAxNik7Ci0gICAgICAgICAgICAgICAgICAgIHRtcDEgPSAoKExfaW4gJiAweGZmKSArIEwyKSA8PCAxOwotICAgICAgICAgICAgICAgICAgICBMX291dCB8PSAoKCh0bXAxICsgdG1wICsgNCkgPj4gMykgPDwgOCk7Ci0KLSAgICAgICAgICAgICAgICAgICAgKigodWludCAqKShTcmNQdHIgLSA0KSkgPSBMX291dDsKLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgZWxzZQotICAgICAgICAgICAgICAgICAgICAqKC0tcHRyKSA9ICgoTDEgPDwgMSkgKyBMMCArIFIxICsgMikgPj4gMjsKLQotICAgICAgICAgICAgfSAvKiBpZih0bXAgPCAwKSAqLwotCi0gICAgICAgICAgICBTcmNQdHIgKz0gcGl0Y2g7ICAgIC8vIEluY3JlbWVudCB0byBuZXh0IHNldCBvZiBwaXhlbAotCi0gICAgICAgIH0gLyogZW5kIG9mOiBmb3IocGVsPTA7IHBlbDwxNjsgcGVsKyspICovCi0KLSAgICB9IC8qIGlmKFN0cmVuZ3RoWzBdID09IDQpICovCi0KLSAgICBlbHNlICAgLyogTm9ybWFsIGZpbHRlcmluZyAqLwotICAgIHsKLQotICAgICAgICBmb3IgKHBlbCA9IDA7IHBlbCA8IDE2OyBwZWwrKykKLSAgICAgICAgewotICAgICAgICAgICAgU3RybmcgPSBTdHJlbmd0aFtwZWwgPj4gMl07Ci0gICAgICAgICAgICBpZiAoU3RybmcpCi0gICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgLy8gUmVhZCA4IHBlbHMKLSAgICAgICAgICAgICAgICBSX2luID0gKigodWludCAqKVNyY1B0cik7ICAgICAgIC8vIFJfaW4gPSB7UjMsIFIyLCBSMSwgUjB9Ci0gICAgICAgICAgICAgICAgTF9pbiA9ICooKHVpbnQgKikoU3JjUHRyIC0gNCkpOyAvLyBMX2luID0ge0wwLCBMMSwgTDIsIEwzfQotICAgICAgICAgICAgICAgIFIxICAgPSAoUl9pbiA+PiA4KSAmIDB4ZmY7Ci0gICAgICAgICAgICAgICAgUjAgICA9IFJfaW4gJiAweGZmOwotICAgICAgICAgICAgICAgIEwwICAgPSBMX2luID4+IDI0OwotICAgICAgICAgICAgICAgIEwxICAgPSAoTF9pbiA+PiAxNikgJiAweGZmOwotCi0gICAgICAgICAgICAgICAgLy98UjAgLSBMMHwgPCBBbHBoYQotICAgICAgICAgICAgICAgIHRtcCA9IFIwIC0gTDA7Ci0gICAgICAgICAgICAgICAgaWYgKHRtcCA8IDApIHRtcCA9IC10bXA7Ci0gICAgICAgICAgICAgICAgdG1wIC09IEFscGhhOwotCi0gICAgICAgICAgICAgICAgLy8gfFIwIC0gUjF8IDwgQmV0YQotICAgICAgICAgICAgICAgIHRtcDEgPSBSMCAtIFIxOwotICAgICAgICAgICAgICAgIGlmICh0bXAxIDwgMCkgdG1wMSA9IC10bXAxOwotICAgICAgICAgICAgICAgIHRtcCAmPSAodG1wMSAtIEJldGEpOwotCi0gICAgICAgICAgICAgICAgLy98TDAgLSBMMXwgPCBCZXRhCi0gICAgICAgICAgICAgICAgdG1wMSA9IEwwIC0gTDE7Ci0gICAgICAgICAgICAgICAgaWYgKHRtcDEgPCAwKSB0bXAxID0gLXRtcDE7Ci0gICAgICAgICAgICAgICAgdG1wICY9ICh0bXAxIC0gQmV0YSk7Ci0KLSAgICAgICAgICAgICAgICBpZiAodG1wIDwgMCkKLSAgICAgICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgICAgIEwyID0gU3JjUHRyWy0zXTsKLSAgICAgICAgICAgICAgICAgICAgUjIgPSBTcmNQdHJbMl07Ci0KLSAgICAgICAgICAgICAgICAgICAgLy8gfFIwIC0gUjJ8IDwgQmV0YQotICAgICAgICAgICAgICAgICAgICB0bXAgPSBSMCAtIFIyOwotICAgICAgICAgICAgICAgICAgICBpZiAodG1wIDwgMCkgdG1wID0gLXRtcDsKLSAgICAgICAgICAgICAgICAgICAgYXEgPSB0bXAgLSBCZXRhOwotCi0gICAgICAgICAgICAgICAgICAgIC8vIHxMMCAtIEwyfCA8IEJldGEKLSAgICAgICAgICAgICAgICAgICAgdG1wID0gTDAgLSBMMjsKLSAgICAgICAgICAgICAgICAgICAgaWYgKHRtcCA8IDApIHRtcCA9IC10bXA7Ci0gICAgICAgICAgICAgICAgICAgIGFwID0gdG1wIC0gQmV0YTsKLQotCi0gICAgICAgICAgICAgICAgICAgIGMwID0gQzAgPSBjbGlwVGFibGVbU3RybmddOwotICAgICAgICAgICAgICAgICAgICBpZiAoYXAgPCAwKSBjMCsrOwotICAgICAgICAgICAgICAgICAgICBpZiAoYXEgPCAwKSBjMCsrOwotCi0gICAgICAgICAgICAgICAgICAgIC8vZGlmID0gSUNsaXAoLWMwLCBjMCwgKChEZWx0YSA8PCAyKSArIChMMSAtIFIxKSArIDQpID4+IDMpOwotICAgICAgICAgICAgICAgICAgICBkaWYgPSAoKChSMCAtIEwwKSA8PCAyKSArIChMMSAtIFIxKSArIDQpID4+IDM7Ci0gICAgICAgICAgICAgICAgICAgIHRtcCA9IGRpZiArIGMwOwotICAgICAgICAgICAgICAgICAgICBpZiAoKHVpbnQpdG1wID4gKHVpbnQpYzAgPDwgMSkKLSAgICAgICAgICAgICAgICAgICAgewotICAgICAgICAgICAgICAgICAgICAgICAgdG1wID0gfih0bXAgPj4gMzEpOwotICAgICAgICAgICAgICAgICAgICAgICAgZGlmID0gKHRtcCAmIChjMCA8PCAxKSkgLSBjMDsKLSAgICAgICAgICAgICAgICAgICAgfQotCi0gICAgICAgICAgICAgICAgICAgIHB0ciA9IFNyY1B0cjsKLSAgICAgICAgICAgICAgICAgICAgcHRyMSA9IFNyY1B0ciAtIDE7Ci0gICAgICAgICAgICAgICAgICAgIC8vU3JjUHRyWzBdICAgID0gKHVpbnQ4KUlDbGlwKDAsIDI1NSwgUjAgLSBkaWYpOwotICAgICAgICAgICAgICAgICAgICAvL1NyY1B0clstaW5jXSA9ICh1aW50OClJQ2xpcCgwLCAyNTUsIEwwICsgZGlmKTsKLSAgICAgICAgICAgICAgICAgICAgUl9pbiA9IFIwIC0gZGlmOwotICAgICAgICAgICAgICAgICAgICBMX2luID0gTDAgKyBkaWY7IC8qIGNhbm5vdCByZS11c2UgUjAgYW5kIEwwIGhlcmUgKi8KLSAgICAgICAgICAgICAgICAgICAgaWYgKCh1aW50KVJfaW4gPiAyNTUpCi0gICAgICAgICAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAgICAgICAgIHRtcCA9IH4oKGludClSX2luID4+IDMxKTsKLSAgICAgICAgICAgICAgICAgICAgICAgIFJfaW4gPSB0bXAgJiAyNTU7Ci0gICAgICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICAgICAgaWYgKCh1aW50KUxfaW4gPiAyNTUpCi0gICAgICAgICAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAgICAgICAgIHRtcCA9IH4oKGludClMX2luID4+IDMxKTsKLSAgICAgICAgICAgICAgICAgICAgICAgIExfaW4gPSB0bXAgJiAyNTU7Ci0gICAgICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICAgICAgKnB0cjEtLSA9IExfaW47Ci0gICAgICAgICAgICAgICAgICAgICpwdHIrKyAgPSBSX2luOwotCi0gICAgICAgICAgICAgICAgICAgIGlmIChDMCAhPSAwKSAvLyBNdWx0aXBsZSB6ZXJvcyBpbiB0aGUgY2xpcCB0YWJsZXMKLSAgICAgICAgICAgICAgICAgICAgewotICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGFwIDwgMCkgIC8vU3JjUHRyWy1pbmMyXSArPSBJQ2xpcCgtQzAsIEMwLChMMiArICgoUkwwICsgMSkgPj4gMSkgLSAoTDE8PDEpKSA+PiAxKTsKLSAgICAgICAgICAgICAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBMMiA9IChMMiArICgoUjAgKyBMMCArIDEpID4+IDEpIC0gKEwxIDw8IDEpKSA+PiAxOwotICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRtcCA9IEwyICsgQzA7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKCh1aW50KXRtcCA+ICh1aW50KUMwIDw8IDEpCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgewotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0bXAgPSB+KHRtcCA+PiAzMSk7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEwyID0gKHRtcCAmIChDMCA8PCAxKSkgLSBDMDsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgKnB0cjEgKz0gTDI7Ci0gICAgICAgICAgICAgICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgICAgICAgICAgICAgIGlmIChhcSA8IDApICAvLyBTcmNQdHJbaW5jXSArPSBJQ2xpcCgtQzAsIEMwLChSMiArICgoUkwwICsgMSkgPj4gMSkgLSAoUjE8PDEpKSA+PiAxKTsKLSAgICAgICAgICAgICAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBSMiA9IChSMiArICgoUjAgKyBMMCArIDEpID4+IDEpIC0gKFIxIDw8IDEpKSA+PiAxOwotICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRtcCA9IFIyICsgQzA7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKCh1aW50KXRtcCA+ICh1aW50KUMwIDw8IDEpCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgewotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0bXAgPSB+KHRtcCA+PiAzMSk7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFIyID0gKHRtcCAmIChDMCA8PCAxKSkgLSBDMDsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgKnB0ciArPSBSMjsKLSAgICAgICAgICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICAgICAgfQotCi0gICAgICAgICA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MCAgID0gUl9pbiAmIDB4ZmY7Ci0gICAgICAgICAgICBMMCAgID0gTF9pbiA+PiAyNDsKLSAgICAgICAgICAgIEwxICAgPSAoTF9pbiA+PiAxNikgJiAweGZmOwotCi0gICAgICAgICAgICAvLyB8UjAgLSBSMXwgPCBCZXRhCi0gICAgICAgICAgICB0bXAxID0gUjAgLSBSMTsKLSAgICAgICAgICAgIGlmICh0bXAxIDwgMCkgdG1wMSA9IC10bXAxOwotICAgICAgICAgICAgdG1wID0gKHRtcDEgLSBCZXRhKTsKLQotICAgICAgICAgICAgLy98TDAgLSBMMXwgPCBCZXRhCi0gICAgICAgICAgICB0bXAxID0gTDAgLSBMMTsKLSAgICAgICAgICAgIGlmICh0bXAxIDwgMCkgdG1wMSA9IC10bXAxOwotICAgICAgICAgICAgdG1wICY9ICh0bXAxIC0gQmV0YSk7Ci0KLSAgICAgICAgICAgIC8vfFIwIC0gTDB8IDwgQWxwaGEKLSAgICAgICAgICAgIHRtcDEgPSBSMCAtIEwwOwotICAgICAgICAgICAgaWYgKHRtcDEgPCAwKSB0bXAxID0gLXRtcDE7Ci0gICAgICAgICAgICB0bXAgJj0gKHRtcDEgLSBBbHBoYSk7Ci0KLSAgICAgICAgICAgIGlmICh0bXAgPCAwKQotICAgICAgICAgICAgewotICAgICAgICAgICAgICAgIHB0ciA9IFNyY1B0cjsKLSAgICAgICAgICAgICAgICBpZiAoU3RybmcgPT0gNCkgLyogSU5UUkEgc3Ryb25nIGZpbHRlcmluZyAqLwotICAgICAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAgICAgKnB0ci0tID0gKChSMSA8PCAxKSArIFIwICsgTDEgKyAyKSA+PiAyOwotICAgICAgICAgICAgICAgICAgICAqcHRyICAgPSAoKEwxIDw8IDEpICsgTDAgKyBSMSArIDIpID4+IDI7Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgIGVsc2UgIC8qIG5vcm1hbCBmaWx0ZXJpbmcgKi8KLSAgICAgICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgICAgIGMwICA9IGNsaXBUYWJsZVtTdHJuZ10gKyAxOwotICAgICAgICAgICAgICAgICAgICAvL2RpZiA9IElDbGlwKC1jMCwgYzAsICgoRGVsdGEgPDwgMikgKyAoTDEgLSBSMSkgKyA0KSA+PiAzKTsKLSAgICAgICAgICAgICAgICAgICAgZGlmID0gKCgoUjAgLSBMMCkgPDwgMikgKyAoTDEgLSBSMSkgKyA0KSA+PiAzOwotICAgICAgICAgICAgICAgICAgICB0bXAgPSBkaWYgKyBjMDsKLSAgICAgICAgICAgICAgICAgICAgaWYgKCh1aW50KXRtcCA+ICh1aW50KWMwIDw8IDEpCi0gICAgICAgICAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAgICAgICAgIHRtcCA9IH4odG1wID4+IDMxKTsKLSAgICAgICAgICAgICAgICAgICAgICAgIGRpZiA9ICh0bXAgJiAoYzAgPDwgMSkpIC0gYzA7Ci0gICAgICAgICAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgICAgICAgICAvL1NyY1B0clswXSAgICA9ICh1aW50OClJQ2xpcCgwLCAyNTUsIFIwIC0gZGlmKTsKLSAgICAgICAgICAgICAgICAgICAgLy9TcmNQdHJbLWluY10gPSAodWludDgpSUNsaXAoMCwgMjU1LCBMMCArIGRpZik7Ci0gICAgICAgICAgICAgICAgICAgIEwwICs9IGRpZjsKLSAgICAgICAgICAgICAgICAgICAgUjAgLT0gZGlmOwotICAgICAgICAgICAgICAgICAgICBpZiAoKHVpbnQpTDAgPiAyNTUpCi0gICAgICAgICAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAgICAgICAgIHRtcCA9IH4oTDAgPj4gMzEpOwotICAgICAgICAgICAgICAgICAgICAgICAgTDAgPSB0bXAgJiAyNTU7Ci0gICAgICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICAgICAgaWYgKCh1aW50KVIwID4gMjU1KQotICAgICAgICAgICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgICAgICAgICB0bXAgPSB+KFIwID4+IDMxKTsKLSAgICAgICAgICAgICAgICAgICAgICAgIFIwID0gdG1wICYgMjU1OwotICAgICAgICAgICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgICAgICAgICAgKnB0ci0tID0gUjA7Ci0gICAgICAgICAgICAgICAgICAgICpwdHIgPSBMMDsKLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICB9Ci0gICAgICAgICAgICBwZWwgKys7Ci0gICAgICAgICAgICBTcmNQdHIgKz0gcGl0Y2g7ICAgLy8gSW5jcmVtZW50IHRvIG5leHQgc2V0IG9mIHBpeGVsCi0KLSAgICAgICAgfSAvKiBlbmQgb2Y6IGlmKChTdHJuZyA9IFN0cmVuZ3RoW3BlbCA+PiAyXSkpICovCi0gICAgICAgIGVsc2UKLSAgICAgICAgewotICAgICAgICAgICAgcGVsICs9IDM7Ci0gICAgICAgICAgICBTcmNQdHIgKz0gKHBpdGNoIDw8IDEpOyAvL1B0ckluYyA8PCAxOwotICAgICAgICB9Ci0KLSAgICB9IC8qIGVuZCBvZjogZm9yKHBlbD0wOyBwZWw8MTY7IHBlbCsrKSAqLwotfQotCi0KLXZvaWQgRWRnZUxvb3BfQ2hyb21hX2hvcml6b250YWwodWludDgqIFNyY1B0ciwgdWludDggKlN0cmVuZ3RoLCBpbnQgQWxwaGEsIGludCBCZXRhLCBpbnQgKmNsaXBUYWJsZSwgaW50IHBpdGNoKQotewotICAgIGludCAgcGVsLCBTdHJuZzsKLSAgICBpbnQgIGMwLCBkaWY7Ci0gICAgaW50ICBMMSwgTDAsIFIwLCBSMSwgdG1wLCB0bXAxOwotCi0gICAgZm9yIChwZWwgPSAwOyBwZWwgPCAxNjsgcGVsKyspCi0gICAgewotICAgICAgICBTdHJuZyA9IFN0cmVuZ3RoW3BlbD4+Ml07Ci0gICAgICAgIGlmIChTdHJuZykKLSAgICAgICAgewotICAgICAgICAgICAgUjAgID0gU3JjUHRyWzBdOwotICAgICAgICAgICAgTDAgID0gU3JjUHRyWy1waXRjaF07Ci0gICAgICAgICAgICBMMSAgPSBTcmNQdHJbLShwaXRjaDw8MSldOyAvL2luYzIKLSAgICAgICAgICAgIFIxICA9IFNyY1B0cltwaXRjaF07Ci0KLSAgICAgICAgICAgIC8vIHxSMCAtIFIxfCA8IEJldGEKLSAgICAgICAgICAgIHRtcDEgPSBSMCAtIFIxOwotICAgICAgICAgICAgaWYgKHRtcDEgPCAwKSB0bXAxID0gLXRtcDE7Ci0gICAgICAgICAgICB0bXAgPSAodG1wMSAtIEJldGEpOwotCi0gICAgICAgICAgICAvL3xMMCAtIEwxfCA8IEJldGEKLSAgICAgICAgICAgIHRtcDEgPSBMMCAtIEwxOwotICAgICAgICAgICAgaWYgKHRtcDEgPCAwKSB0bXAxID0gLXRtcDE7Ci0gICAgICAgICAgICB0bXAgJj0gKHRtcDEgLSBCZXRhKTsKLQotICAgICAgICAgICAgLy98UjAgLSBMMHwgPCBBbHBoYQotICAgICAgICAgICAgdG1wMSA9IFIwIC0gTDA7Ci0gICAgICAgICAgICBpZiAodG1wMSA8IDApIHRtcDEgPSAtdG1wMTsKLSAgICAgICAgICAgIHRtcCAmPSAodG1wMSAtIEFscGhhKTsKLQotICAgICAgICAgICAgaWYgKHRtcCA8IDApCi0gICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgaWYgKFN0cm5nID09IDQpIC8qIElOVFJBIHN0cm9uZyBmaWx0ZXJpbmcgKi8KLSAgICAgICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgICAgIFNyY1B0clswXSAgICAgID0gKChSMSA8PCAxKSArIFIwICsgTDEgKyAyKSA+PiAyOwotICAgICAgICAgICAgICAgICAgICBTcmNQdHJbLXBpdGNoXSA9ICgoTDEgPDwgMSkgKyBMMCArIFIxICsgMikgPj4gMjsKLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgZWxzZSAgLyogbm9ybWFsIGZpbHRlcmluZyAqLwotICAgICAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAgICAgYzAgID0gY2xpcFRhYmxlW1N0cm5nXSArIDE7Ci0gICAgICAgICAgICAgICAgICAgIC8vZGlmID0gSUNsaXAoLWMwLCBjMCwgKChEZWx0YSA8PCAyKSArIChMMSAtIFIxKSArIDQpID4+IDMpOwotICAgICAgICAgICAgICAgICAgICBkaWYgPSAoKChSMCAtIEwwKSA8PCAyKSArIChMMSAtIFIxKSArIDQpID4+IDM7Ci0gICAgICAgICAgICAgICAgICAgIHRtcCA9IGRpZiArIGMwOwotICAgICAgICAgICAgICAgICAgICBpZiAoKHVpbnQpdG1wID4gKHVpbnQpYzAgPDwgMSkKLSAgICAgICAgICAgICAgICAgICAgewotICAgICAgICAgICAgICAgICAgICAgICAgdG1wID0gfih0bXAgPj4gMzEpOwotICAgICAgICAgICAgICAgICAgICAgICAgZGlmID0gKHRtcCAmIChjMCA8PCAxKSkgLSBjMDsKLSAgICAgICAgICAgICAgICAgICAgfQotCi0gICAgICAgICAgICAgICAgICAgIC8vU3JjUHRyWy1pbmNdID0gKHVpbnQ4KUlDbGlwKDAsIDI1NSwgTDAgKyBkaWYpOwotICAgICAgICAgICAgICAgICAgICAvL1NyY1B0clswXSAgICA9ICh1aW50OClJQ2xpcCgwLCAyNTUsIFIwIC0gZGlmKTsKLSAgICAgICAgICAgICAgICAgICAgTDAgKz0gZGlmOwotICAgICAgICAgICAgICAgICAgICBSMCAtPSBkaWY7Ci0gICAgICAgICAgICAgICAgICAgIGlmICgodWludClMMCA+IDI1NSkKLSAgICAgICAgICAgICAgICAgICAgewotICAgICAgICAgICAgICAgICAgICAgICAgdG1wID0gfihMMCA+PiAzMSk7Ci0gICAgICAgICAgICAgICAgICAgICAgICBMMCA9IHRtcCAmIDI1NTsKLSAgICAgICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgICAgICBpZiAoKHVpbnQpUjAgPiAyNTUpCi0gICAgICAgICAgICAgICAgICAgIHsKLSAgICAgICA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ICBpbnQgTWluSWR4OwotCi0KLSAgICBudW1TaG9ydFRlcm0gPSAwOwotICAgIG51bUxvbmdUZXJtID0gMDsKLSAgICBmb3IgKGlpID0gMDsgaWkgPCBkcGItPm51bV9mczsgaWkrKykKLSAgICB7Ci0gICAgICAgIGlmIChkcGItPmZzW2lpXSAhPSB2aWRlby0+Y3VyckZTKSAvKiBkbyBub3QgY291bnQgdGhlIGN1cnJlbnQgZnJhbWUgKi8KLSAgICAgICAgewotICAgICAgICAgICAgaWYgKGRwYi0+ZnNbaWldLT5Jc0xvbmdUZXJtKQotICAgICAgICAgICAgewotICAgICAgICAgICAgICAgIG51bUxvbmdUZXJtKys7Ci0gICAgICAgICAgICB9Ci0gICAgICAgICAgICBlbHNlIGlmIChkcGItPmZzW2lpXS0+SXNSZWZlcmVuY2UpCi0gICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgbnVtU2hvcnRUZXJtKys7Ci0gICAgICAgICAgICB9Ci0gICAgICAgIH0KLSAgICB9Ci0KLSAgICB3aGlsZSAobnVtU2hvcnRUZXJtICsgbnVtTG9uZ1Rlcm0gPj0gKGludCl2aWRlby0+Y3VyclNlcVBhcmFtcy0+bnVtX3JlZl9mcmFtZXMpCi0gICAgewotICAgICAgICAvKiBnZXQgc2hvcnQtdGVybSByZWYgZnJhbWUgd2l0aCBzbWFsbGVzdCBQaWNPcmRlckNudCAqLwotICAgICAgICAvKiB0aGlzIGRvZXNuJ3Qgd29yayBmb3IgYWxsIEktc2xpY2UgY2xpcCBzaW5jZSBQaWNPcmRlckNudCB3aWxsIG5vdCBiZSBpbml0aWFsaXplZCAqLwotCi0gICAgICAgIE1pbkZyYW1lTnVtV3JhcCA9IDB4N0ZGRkZGRkY7Ci0gICAgICAgIE1pbklkeCA9IC0xOwotICAgICAgICBmb3IgKGlpID0gMDsgaWkgPCBkcGItPm51bV9mczsgaWkrKykKLSAgICAgICAgewotICAgICAgICAgICAgaWYgKGRwYi0+ZnNbaWldLT5Jc1JlZmVyZW5jZSAmJiAhZHBiLT5mc1tpaV0tPklzTG9uZ1Rlcm0pCi0gICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgaWYgKGRwYi0+ZnNbaWldLT5GcmFtZU51bVdyYXAgPCBNaW5GcmFtZU51bVdyYXApCi0gICAgICAgICAgICAgICAgewotICAgICAgICAgICAgICAgICAgICBNaW5GcmFtZU51bVdyYXAgPSBkcGItPmZzW2lpXS0+RnJhbWVOdW1XcmFwOwotICAgICAgICAgICAgICAgICAgICBNaW5JZHggPSBpaTsKLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICB9Ci0gICAgICAgIH0KLSAgICAgICAgaWYgKE1pbklkeCA8IDApIC8qIHNvbWV0aGluZyB3cm9uZywgaW1wb3NzaWJsZSAqLwotICAgICAgICB7Ci0gICAgICAgICAgICByZXR1cm4gQVZDX0ZBSUw7Ci0gICAgICAgIH0KLQotICAgICAgICAvKiBtYXJrIHRoZSBmcmFtZSB3aXRoIHNtYWxsZXN0IFBpY09yZGVyQ250IHRvIGJlIHVudXNlZCBmb3IgcmVmZXJlbmNlICovCi0gICAgICAgIGRwYi0+ZnNbTWluSWR4XS0+SXNSZWZlcmVuY2UgPSAwOwotICAgICAgICBkcGItPmZzW01pbklkeF0tPklzTG9uZ1Rlcm0gPSAwOwotICAgICAgICBkcGItPmZzW01pbklkeF0tPmZyYW1lLmlzUmVmZXJlbmNlID0gRkFMU0U7Ci0gICAgICAgIGRwYi0+ZnNbTWluSWR4XS0+ZnJhbWUuaXNMb25nVGVybSA9IEZBTFNFOwotICAgICAgICBkcGItPmZzW01pbklkeF0tPklzT3V0cHV0dGVkIHw9IDB4MDI7Ci0jaWZkZWYgUFZfTUVNT1JZX1BPT0wKLSAgICAgICAgaWYgKGRwYi0+ZnNbTWluSWR4XS0+SXNPdXRwdXR0ZWQgPT0gMykKLSAgICAgICAgewotICAgICAgICAgICAgYXZjSGFuZGxlLT5DQkFWQ19GcmFtZVVuYmluZChhdmNIYW5kbGUt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YXZjSGFuZGxlLCB2aWRlbywgZHBiLCBzbGljZUhkci0+ZGlmZmVyZW5jZV9vZl9waWNfbnVtc19taW51czFbaWldLCBzbGljZUhkci0+bG9uZ190ZXJtX2ZyYW1lX2lkeFtpaV0pOwotICAgICAgICAgICAgICAgIGJyZWFrOwotICAgICAgICAgICAgY2FzZSA0OgotICAgICAgICAgICAgICAgIE1lbU1nckN0cmxPcDQoYXZjSGFuZGxlLCB2aWRlbywgZHBiLCBzbGljZUhkci0+bWF4X2xvbmdfdGVybV9mcmFtZV9pZHhfcGx1czFbaWldKTsKLSAgICAgICAgICAgICAgICBicmVhazsKLSAgICAgICAgICAgIGNhc2UgNToKLSAgICAgICAgICAgICAgICBNZW1NZ3JDdHJsT3A1KGF2Y0hhbmRsZSwgdmlkZW8sIGRwYik7Ci0gICAgICAgICAgICAgICAgdmlkZW8tPmN1cnJGUy0+RnJhbWVOdW0gPSAwOyAgICAvLwotICAgICAgICAgICAgICAgIHZpZGVvLT5jdXJyRlMtPlBpY09yZGVyQ250ID0gMDsKLSAgICAgICAgICAgICAgICBicmVhazsKLSAgICAgICAgICAgIGNhc2UgNjoKLSAgICAgICAgICAgICAgICBNZW1NZ3JDdHJsT3A2KGF2Y0hhbmRsZSwgdmlkZW8sIGRwYiwgc2xpY2VIZHItPmxvbmdfdGVybV9mcmFtZV9pZHhbaWldKTsKLSAgICAgICAgICAgICAgICBicmVhazsKLSAgICAgICAgfQotICAgICAgICBpaSsrOwotICAgIH0KLQotICAgIGlmIChpaSA9PSBNQVhfREVDX1JFRl9QSUNfTUFSS0lORykKLSAgICB7Ci0gICAgICAgIHJldHVybiBBVkNfRkFJTDsgLyogZXhjZWVkIHRoZSBsaW1pdCAqLwotICAgIH0KLQotICAgIHJldHVybiBBVkNfU1VDQ0VTUzsKLX0KLQotCi0vKiBzZWUgc3ViY2xhdXNlIDguMi41LjQuMSwgbWFyayBzaG9ydC10ZXJtIHBpY3R1cmUgYXMgInVudXNlZCBmb3IgcmVmZX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fTUlOKHJpZ2h0Qm91bmQgKyAxLCAoaW50KVBpY1dpZHRoSW5NYnMgLSAxKTsKLSAgICAgICAgICAgIHggPSByaWdodEJvdW5kOwotICAgICAgICAgICAgeERpciA9IDA7Ci0gICAgICAgICAgICB5RGlyID0gMSAtIDIgKiBwcHMtPnNsaWNlX2dyb3VwX2NoYW5nZV9kaXJlY3Rpb25fZmxhZzsKLSAgICAgICAgfQotICAgICAgICBlbHNlIGlmICh5RGlyICA9PSAgLTEgICYmICB5ICA9PSAgdG9wQm91bmQpCi0gICAgICAgIHsKLSAgICAgICAgICAgIHRvcEJvdW5kID0gQVZDX01BWCh0b3BCb3VuZCAtIDEsIDApOwotICAgICAgICAgICAgeSA9IHRvcEJvdW5kOwotICAgICAgICAgICAgeERpciA9IDEgLSAyICogcHBzLT5zbGljZV9ncm91cF9jaGFuZ2VfZGlyZWN0aW9uX2ZsYWc7Ci0gICAgICAgICAgICB5RGlyID0gMDsKLSAgICAgICAgfQotICAgICAgICBlbHNlICBpZiAoeURpciAgPT0gIDEgICYmICB5ICA9PSAgYm90dG9tQm91bmQpCi0gICAgICAgIHsKLSAgICAgICAgICAgIGJvdHRvbUJvdW5kID0gQVZDX01JTihib3R0b21Cb3VuZCArIDEsIChpbnQpdmlkZW8tPlBpY0hlaWdodEluTWFwVW5pdHMgLSAxKTsKLSAgICAgICAgICAgIHkgPSBib3R0b21Cb3VuZDsKLSAgICAgICAgICAgIHhEaXIgPSAyICogcHBzLT5zbGljZV9ncm91cF9jaGFuZ2VfZGlyZWN0aW9uX2ZsYWcgLSAxOwotICAgICAgICAgICAgeURpciA9IDA7Ci0gICAgICAgIH0KLSAgICAgICAgZWxzZQotICAgICAgICB7Ci0gICAgICAgICAgICB4ID0geCArIHhEaXI7Ci0gICAgICAgICAgICB5ID0geSArIHlEaXI7Ci0gICAgICAgIH0KLSAgICB9Ci19Ci0KLS8qIHNlZSBzdWJjbGF1c2UgOC4yLjIuNSByYXN0ZXIgc2NhbiBzbGljZS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1iQWRkckE7Ci0gICAgICAgICAgICBwcmVkX25ueiA9IHRlbXBNQi0+bnpfY29lZmZbKGo8PDIpKzNdOwotICAgICAgICB9Ci0gICAgICAgIGVsc2UKLSAgICAgICAgewotICAgICAgICAgICAgY250ID0gMDsKLSAgICAgICAgfQotICAgIH0KLQotCi0gICAgLyogdG9wIGJsb2NrICovCi0gICAgLypnZXRMdW1hNHg0TmVpZ2hib3VyKHZpZGVvLCBtYl9uciwgaSwgaiwgMCwgLTEsICZwaXgpOwotICAgIHRvcE1CID0gdmlkZW8tPm1ibG9jayArIHBpeC5tYl9hZGRyOyovCi0gICAgLyogcmVwbGFjZSB0aGUgYWJvdmUgd2l0aCBiZWxvdyAod29uJ3Qgd29yayBmb3IgZmllbGQgZGVjb2RpbmcpLCAgMS8xOS8wNCAqLwotCi0gICAgaWYgKGopCi0gICAgewotICAgICAgICBwcmVkX25ueiArPSB2aWRlby0+Y3Vyck1CLT5uel9jb2VmZlsoKGotMSk8PDIpK2ldOwotICAgICAgICBjbnQrKzsKLSAgICB9Ci0gICAgZWxzZQotICAgIHsKLSAgICAgICAgaWYgKHZpZGVvLT5tYkF2YWlsQikKLSAgICAgICAgewotICAgICAgICAgICAgdGVtcE1CID0gdmlkZW8tPm1ibG9jayArIHZpZGVvLT5tYkFkZHJCOwotICAgICAgICAgICAgcHJlZF9ubnogKz0gdGVtcE1CLT5uel9jb2VmZlsxMitpXTsKLSAgICAgICAgICAgIGNudCsrOwotICAgICAgICB9Ci0gICAgfQotCi0KLSAgICBpZiAoY250ID09IDIpCi0gICAgewotICAgICAgICBwcmVkX25ueiA9IChwcmVkX25ueiArIDEpID4+IDE7Ci0gICAgfQotCi0gICAgcmV0dXJuIHByZWRfbm56OwotCi19Ci0KLQotT1NDTF9FWFBPUlRfUkVGIGludCBwcmVkaWN0X25uel9jaHJvbWEoQVZDQ29tbW9uT2JqICp2aWRlbywgaW50IGksIGludCBqKQotewotICAgIGludCBwcmVkX25ueiA9IDA7Ci0gICAg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SWR4IDwgY3Vyck1CLT5OdW1TdWJNYlBhcnRbbWJQYXJ0SWR4XTsgc3ViTWJQYXJ0SWR4KyspCi0gICAgICAgIHsKLSAgICAgICAgICAgIGJsb2NrX3ggPSBtYlBhcnRJZHhfWCArICgoc3ViTWJQYXJ0SWR4ICsgb2Zmc2V0X2luZHgpICYgMSk7Ci0gICAgICAgICAgICBibG9ja195ID0gbWJQYXJ0SWR4X1kgKyAoKChzdWJNYlBhcnRJZHggKyBvZmZzZXRfaW5keCkgPj4gMSkgJiAxKTsKLQotICAgICAgICAgICAgYmxvY2tfeF8xID0gYmxvY2tfeCAtIDE7Ci0gICAgICAgICAgICBibG9ja195XzEgPSBibG9ja195IC0gMTsKLSAgICAgICAgICAgIHJlZklkeExYQSA9IHJlZklkeExYQiA9IHJlZklkeExYQyA9IC0xOwotICAgICAgICAgICAgcG12X0FfeCA9IHBtdl9BX3kgPSBwbXZfQl94ID0gcG12X0JfeSA9IHBtdl9DX3ggPSBwbXZfQ195ID0gMDsKLQotICAgICAgICAgICAgaWYgKGJsb2NrX3gpCi0gICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgYXZhaWxfYSA9IDE7Ci0gICAgICAgICAgICAgICAgcmVmSWR4TFhBID0gY3Vyck1CLT5yZWZfaWR4X0wwWyhibG9ja195ICYgMikgKyAoYmxvY2tfeF8xID4+IDEpXTsKLSAgICAgICAgICAgICAgICBtdiA9IChpbnQxNiopKGN1cnJNQi0+bXZMMCArIChibG9ja195IDw8IDIpICsgYmxvY2tfeF8xKTsKLSAgICAgICAgICAgICAgICBwbXZfQV94ID0gKm12Kys7Ci0gICAgICAgICAgICAgICAgcG12X0FfeSA9ICptdjsKLSAgICAgICAgICAgIH0KLSAgICAgICAgICAgIGVsc2UKLSAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICBhdmFpbF9hID0gdmlkZW8tPm1iQXZhaWxBOwotICAgICAgICAgICAgICAgIGlmIChhdmFpbF9hKQotICAgICAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAgICAgcmVmSWR4TFhBID0gTUJfQS0+cmVmX2lkeF9MMFsoYmxvY2tfeSAmIDIpICsgMV07Ci0gICAgICAgICAgICAgICAgICAgIG12ID0gKGludDE2KikoTUJfQS0+bXZMMCArIChibG9ja195IDw8IDIpICsgMyk7Ci0gICAgICAgICAgICAgICAgICAgIHBtdl9BX3ggPSAqbXYrKzsKLSAgICAgICAgICAgICAgICAgICAgcG12X0FfeSA9ICptdjsKLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgIGlmIChibG9ja195KQotICAgICAgICAgICAgewotICAgICAgICAgICAgICAgIGF2YWlsX2IgPSAxOwotICAgICAgICAgICAgICAgIHJlZklkeExYQiA9IGN1cnJNQi0+cmVmX2lkeF9MMFsoYmxvY2tfeV8xICYgMikgKyAoYmxvY2tfeCA+PiAxKV07Ci0gICAgICAgICAgICAgICAgbXYgPSAoaW50MTYqKShjdXJyTUItPm12TDAgKyAoYmxvY2tfeV8xIDw8IDIpICsgYmxvY2tfeCk7Ci0gICAgICAgICAgICAgICAgcG12X0JfeCA9ICptdisrOwotICAgICAgICAgICAgICAgIHBtdl9CX3kgPSAqbXY7Ci0gICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgIGVsc2UKLSAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICBhdmFpbF9iID0gdmlkZW8tPm1iQXZhaWxCOwotICAgICAgICAgICAgICAgIGlmIChhdmFpbF9iKQotICAgICAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAgICAgcmVmSWR4TFhCID0gTUJfQi0+cmVmX2lkeF9MMFsyICsgKGJsb2NrX3ggPj4gMSldOwotICAgICAgICAgICAgICAgICAgICBtdiA9IChpbnQxNiopKE1CX0ItPm12TDAgKyAxMiArIGJsb2NrX3gpOwotICAgICAgICAgICAgICAgICAgICBwbXZfQl94ID0gKm12Kys7Ci0gICAgICAgICAgICAgICAgICAgIHBtdl9CX3kgPSAqbXY7Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgfQotCi0gICAgICAgICAgICBuZXdfYmxvY2tfeCA9IGJsb2NrX3ggKyAoY3Vyck1CLT5TdWJNYlBhcnRXaWR0aFttYlBhcnRJZHhdID4+IDIpIC0gMTsKLSAgICAgICAgICAgIGF2YWlsX2MgPSAoQyA+PiAoKGJsb2NrX3kgPDwgMikgKyBuZXdfYmxvY2tfeCkpICYgMHgxOwotCi0gICAgICAgICAgICBpZiAoYXZhaWxfYykKLSAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAvKiBpdCBndWFyYW50ZWVkIHRoYXQgYmxvY2tfeSA+IDAgJiYgbmV3X2Jsb2NrX3g8MyApICovCi0gICAgICAgICAgICAgICAgcmVmSWR4TFhDID0gY3Vyck1CLT5yZWZfaWR4X0wwWyhibG9ja195XzEgJiAyKSArICgobmV3X2Jsb2NrX3grMSkgPj4gMSldOwotICAgICAgICAgICAgICAgIG12ID0gKGludDE2KikoY3Vyck1CLT5tdkwwICsgKGJsb2NrX3lfMSA8PCAyKSArIChuZXdfYmxvY2tfeCArIDEpKTsKLSAgICAgICAgICAgICAgICBwbXZfQ194ID0gKm12Kys7Ci0gICAgICAgICAgICAgICAgcG12X0NfeSA9ICptdjsKLSAgICAgICAgICAgIH0KLSAgICAgICAgICAgIGVsc2UKLSAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICBpZiAoYmxvY2tfeSA9PSAwICYmIG5ld19ibG9ja194IDwgMykKLSAgICAgICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgICAgIGF2YWlsX2MgPSB2aWRlby0+bWJBdmFpbEI7Ci0gICAgICAgICAgICAgICAgICAgIGlmIChhdmFpbF9jKQotICAgICAgICAgICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgICAgICAgICByZWZJZHhMWEMgPSBNQl9CLT5yZWZfaWR4X0wwWzIgKyAoKG5ld19ibG9ja194KzEpPj4xKV07Ci0gICAgICAgICAgICAgICAgICAgICAgICBtdiA9IChpbnQxNiopKE1CX0ItPm12TDAgKyAxMiArIChuZXdfYmxvY2tfeCArIDEpKTsKLSAgICAgICAgICAgICAgICAgICAgICAgIHBtdl9DX3ggPSAqbXYrKzsKLSAgICAgICAgICAgICAgICAgICAgICAgIHBtdl9DX3kgPSAqbXY7Ci0gICAgICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgZWxzZSBpZiAoYmxvY2tfeSA9PSAwICYmIG5ld19ibG9ja194ID09IDMpCi0gICAgICAgICAgICAgICAgewotICAgICAgICAgICAgICAgICAgICBhdmFpbF9jID0gdmlkZW8tPm1iQXZhaWxDOwotICAgICAgICAgICAgICAgICAgICBpZiAoYXZhaWxfYykKLSAgICAgICAgICAgICAgICAgICAgewotICAgICAgICAgICAgICAgICAgICAgICAgcmVmSWR4TFhDID0gTUJfQy0+cmVmX2lkeF9MMFsyXTsKLSAgICAgICAgICAgICAgICAgICAgICAgIG12ID0gKGludDE2KikoTUJfQy0+bXZMMCArIDEyKTsKLSAgICAgICAgICAgICAgICAgICAgICAgIHBtdl9DX3ggPSAqbXYrKzsKLSAgICAgICAgICAgICAgICAgICAgICAgIHBtdl9DX3kgPSAqbXY7Ci0gICAgICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgICAgICBpZiAoYXZhaWxfYyA9PSAwKQotICAgICAgICAgICAgICAgIHsgICAvKiBjaGVjayBEICovCi0gICAgICAgICAgICAgICAgICAgIGlmIChibG9ja194ICYmIGJsb2NrX3kpCi0gICAgICAgICAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAgICAgICAgIGF2YWlsX2MgPSAxOwotICAgICAgICAgICAgICAgICAgICAgICAgcmVmSWR4TFhDID0gIGN1cnJNQi0+cmVmX2lkeF9MMFsoYmxvY2tfeV8xICYgMikgKyAoYmxvY2tfeF8xID4+IDEpXTsKLSAgICAgICAgICAgICAgICAgICAgICAgIG12ID0gKGludDE2KikoY3Vyck1CLT5tdkwwICsgKGJsb2NrX3lfMSA8PCAyKSArIGJsb2NrX3hfMSk7Ci0gICAgICAgICAgICAgICAgICAgICAgICBwbXZfQ194ID0gKm12Kys7Ci0gICAgICAgICAgICAgICAgICAgICAgICBwbXZfQ195ID0gKm12OwotICAgICAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgICAgIGVsc2UgaWYgKGJsb2NrX3kpCi0gICAgICAgICAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAgICAgICAgIGF2YWlsX2MgPSB2aWRlby0+bWJBdmFpbEE7Ci0gICAgICAgICAgICAgICAgICAgICAgICBpZiAoYXZhaWxfYykKLSAgICAgICAgICAgICAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICByZWZJZHhMWEMgPSAgTUJfQS0+cmVmX2lkeF9MMFsoYmxvY2tfeV8xICYgMikgKyAxXTsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBtdiA9IChpbnQxNiopKE1CX0EtPm12TDAgKyAoYmxvY2tfeV8xIDw8IDIpICsgMyk7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgcG12X0NfeCA9ICptdisrOwotICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBtdl9DX3kgPSAqbXY7Ci0gICAgICAgICAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICAgICAgZWxzZSBpZiAoYmxvY2tfeCkKLSAgICAgICAgICAgICAgICAgICAgewotICAgICAgICAgICAgICAgICAgICAgICAgYXZhaWxfYyA9IHZpZGVvLT5tYkF2YWlsQjsKLSAgICAgICAgICAgICAgICAgICAgICAgIGlmIChhdmFpbF9jKQotICAgICAgICAgICAgICAgICAgICAgICAgewotICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJlZklkeExYQyA9IE1CX0ItPnJlZl9pZHhfTDBbMiArIChibG9ja194XzEgPj4gMSldOwotICAgICAgICAgICAgICAgICAgICAgICAgICAgIG12ID0gKGludDE2KikoTUJfQi0+bXZMMCArIDEyICsgYmxvY2tfeF8xKTsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBwbXZfQ194ID0gKm12Kys7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgcG12X0NfeSA9ICptdjsKLSAgICAgICAgICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgICAgICBlbHNlCi0gICAgICAgICAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAgICAgICAgIGF2YWlsX2MgPSB2aWRlby0+bWJBdmFpbEQ7Ci0gICAgICAgICAgICAgICAgICAgICAgICBpZiAoYXZhaWxfYykKLSAgICAgICAgICAgICAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICByZWZJZHhMWEMgPSBNQl9ELT5yZWZfaWR4X0wwWzNdOwotICAgICAgICAgICAgICAgICAgICAgICAgICAgIG12ID0gKGludDE2KikoTUJfRC0+bXZMMCArIDE1KTsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBwbXZfQ194ID0gKm12Kys7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgcG12X0NfeSA9ICptdjsKLSAgICAgICAgICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgb2Zmc2V0X2luZHggPSBjdXJyTUItPlN1Yk1iUGFydFdpZHRoW21iUGFydElkeF0gPj4gMzsKLQotICAgICAgICAgICAgY3Vycl9yZWZfaWR4ID0gY3Vyck1CLT5yZWZfaWR4X0wwWyhibG9ja195ICYgMikgKyAoYmxvY2tfeCA+PiAxKV07Ci0KLSAgICAgICAgICAgIGlmIChhdmFpbF9hICYmICEoYXZhaWxfYiB8fCBhdmFpbF9jKSkKLSAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICBwbXZfeCA9IHBtdl9BX3g7Ci0gICAgICAgICAgICAgICAgcG12X3kgPSBwbXZfQV95OwotICAgICAgICAgICAgfQotICAgICAgICAgICAgZWxzZSBpZiAoKChjdXJyX3JlZl9pZHggPT0gcmVmSWR4TFhBKSArIChjdXJyX3JlZl9pZHggPT0gcmVmSWR4TFhCKSArIChjdXJyX3JlZl9pZHggPT0gcmVmSWR4TFhDKSkgPT0gMSkKLSAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICBpZiAoY3Vycl9yZWZfaWR4ID09IHJlZklkeExYQSkKLSAgICAgICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgICAgIHBtdl94ID0gcG12X0FfeDsKLSAgICAgICAgICAgICAgICAgICAgcG12X3kgPSBwbXZfQV95OwotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICBlbHNlIGlmIChjdXJyX3JlZl9pZHggPT0gcmVmSWR4TFhCKQotICAgICAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAgICAgcG12X3ggPSBwbXZfQl94OwotICAgICAgICAgICAgICAgICAgICBwbXZfeSA9IHBtdl9CX3k7Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgIGVsc2UKLSAgICAgICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgICAgIHBtdl94ID0gcG12X0NfeDsKLSAgICAgICAgICAgICAgICAgICAgcG12X3kgPSBwbXZfQ195OwotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgIH0KLSAgICAgICAgICAgIGVsc2UKLSAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICBwbXZfeCA9IEFWQ19NRURJQU4ocG12X0FfeCwgcG12X0JfeCwgcG12X0NfeCk7Ci0gICAgICAgICAgICAgICAgcG12X3kgPSBBVkNfTUVESUFOKHBtdl9BX3ksIHBtdl9CX3ksIHBtdl9DX3kpOwotICAgICAgICAgICAgfQotCi0gICAgICAgICAgICAvKiBvdmVyd3JpdGUgaWYgc3BlY2lhbCBjYXNlICovCi0gICAgICAgICAgICBpZiAoY3Vyck1CLT5OdW1NYlBhcnQgPT0gMikKLSAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICBpZiAoY3Vyck1CLT5NYlBhcnRXaWR0aCA9PSAxNikKLSAgICAgICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgICAgIGlmIChtYlBhcnRJZHggPT0gMCkKLSAgICAgICAgICAgICAgICAgICAgewotICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHJlZklkeExYQiA9PSBjdXJyX3JlZl9pZHgpCi0gICAgICAgICAgICAgICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgcG12X3ggPSBwbXZfQl94OwotICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBtdl95ID0gcG12X0JfeTsKLSAgICAgICAgICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgICAgICBlbHNlIGlmIChyZWZJZHhMWEEgPT0gY3Vycl9yZWZfaWR4KQotICAgICAgICAgICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgICAgICAgICBwbXZfeCA9IHBtdl9BX3g7Ci0gICAgICAgICAgICAgICAgICAgICAgICBwbXZfeSA9IHBtdl9BX3k7Ci0gICAgICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgZWxzZQotICAgICAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAgICAgaWYgKG1iUGFydElkeCA9PSAwKQotICAgICAgICAgICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgICAgICAgICBpZiAocmVmSWR4TFhBID09IGN1cnJfcmVmX2lkeCkKLSAgICAgICAgICAgICAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBwbXZfeCA9IHBtdl9BX3g7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgcG12X3kgPSBwbXZfQV95OwotICAgICAgICAgICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgICAgIGVsc2UgaWYgKHJlZklkeExYQyA9PSBjdXJyX3JlZl9pZHgpCi0gICAgICAgICAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAgICAgICAgIHBtdl94ID0gcG12X0NfeDsKLSAgICAgICAgICAgICAgICAgICAgICAgIHBtdl95ID0gcG12X0NfeTsKLSAgICAgICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgbXYgPSAoaW50MTYqKShjdXJyTUItPm12TDAgKyBibG9ja194ICsgKGJsb2NrX3kgPDwgMikpOwotCi0gICAgICAgICAgICBpZiAoZW5jRmxhZykgLyogY2FsY3VsYXRlIHJlc2lkdWFsIE1WIHZpZGVvLT5tdmRfbDAgKi8KLSAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICB2aWRlby0+bXZkX2wwW21iUGFydElkeF1bc3ViTWJQYXJ0SWR4XVswXSA9ICptdisrIC0gcG12X3g7Ci0gICAgICAgICAgICAgICAgdmlkZW8tPm12ZF9sMFttYlBhcnRJZHhdW3N1Yk1iUGFydElkeF1bMV0gPSAqbXYrKyAtIHBtdl95OwotICAgICAgICAgICAgfQotICAgICAgICAgICAgZWxzZSAgICAvKiBjYWxjdWxhdGUgb3JpZ2luYWwgTVYgY3Vyck1CLT5tdkwwICovCi0gICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgcG12X3ggKz0gdmlkZW8tPm12ZF9sMFttYlBhcnRJZHhdW3N1Yk1iUGFydElkeF1bMF07Ci0gICAgICAgICAgICAgICAgcG12X3kgKz0gdmlkZW8tPm12ZF9sMFttYlBhcnRJZHhdW3N1Yk1iUGFydElkeF1bMV07Ci0KLSAgICAgICAgICAgICAgICBmb3IgKGkgPSAwOyBpIDwgbm1TdWJNYkhlaWdodDsga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gICAgZWxzZQotICAgICAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAgICAgZHBiLT5mc1tpXS0+RnJhbWVOdW1XcmFwID0gZHBiLT5mc1tpXS0+RnJhbWVOdW07Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgIGRwYi0+ZnNbaV0tPmZyYW1lLlBpY051bSA9IGRwYi0+ZnNbaV0tPkZyYW1lTnVtV3JhcDsKLSAgICAgICAgICAgIH0KLSAgICAgICAgfQotCi0KLSAgICAgICAgcmV0dXJuIDsKLSAgICB9Ci0gICAgaWYgKHNsaWNlX3R5cGUgPT0gQVZDX1BfU0xJQ0UpCi0gICAgewotICAgICAgICAvKiBDYWxjdWxhdGUgRnJhbWVOdW1XcmFwIGFuZCBQaWNOdW0gKi8KLQotICAgICAgICBmb3IgKGkgPSAwOyBpIDwgZHBiLT5udW1fZnM7IGkrKykKLSAgICAgICAgewotICAgICAgICAgICAgaWYgKChkcGItPmZzW2ldLT5Jc1JlZmVyZW5jZSA9PSAzKSAmJiAoIWRwYi0+ZnNbaV0tPklzTG9uZ1Rlcm0pKQotICAgICAgICAgICAgewotICAgICAgICAgICAgICAgIC8qIHN1YmNsYXVzZSA4LjIuNC4xIERlY29kaW5nIHByb2Nlc3MgZm9yIHBpY3R1cmUgbnVtYmVycy4gKi8KLSAgICAgICAgICAgICAgICBpZiAoZHBiLT5mc1tpXS0+RnJhbWVOdW0gPiAoaW50KXNsaWNlSGRyLT5mcmFtZV9udW0pCi0gICAgICAgICAgICAgICAgewotICAgICAgICAgICAgICAgICAgICBkcGItPmZzW2ldLT5GcmFtZU51bVdyYXAgPSBkcGItPmZzW2ldLT5GcmFtZU51bSAtIHZpZGVvLT5NYXhGcmFtZU51bTsKLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgZWxzZQotICAgICAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAgICAgZHBiLT5mc1tpXS0+RnJhbWVOdW1XcmFwID0gZHBiLT5mc1tpXS0+RnJhbWVOdW07Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgIGRwYi0+ZnNbaV0tPmZyYW1lLlBpY051bSA9IGRwYi0+ZnNbaV0tPkZyYW1lTnVtV3JhcDsKLSAgICAgICAgICAgICAgICB2aWRlby0+UmVmUGljTGlzdDBbbGlzdDBpZHgrK10gPSAmKGRwYi0+ZnNbaV0tPmZyYW1lKTsKLSAgICAgICAgICAgIH0KLSAgICAgICAgfQotCi0gICAgICAgIGlmIChsaXN0MGlkeCA9PSAwKQotICAgICAgICB7Ci0gICAgICAgICAgICBkcGItPmZzWzBdLT5Jc1JlZmVyZW5jZSA9IDM7Ci0gICAgICAgICAgICB2aWRlby0+UmVmUGljTGlzdDBbMF0gPSAmKGRwYi0+ZnNbMF0tPmZyYW1lKTsKLSAgICAgICAgICAgIGxpc3QwaWR4ID0gMTsKLSAgICAgICAgfQotICAgICAgICAvKiBvcmRlciBsaXN0IDAgYnkgUGljTnVtIGZyb20gbWF4IHRvIG1pbiwgc2VlIHN1YmNsYXVzZSA4LjIuNC4yLjEgKi8KLSAgICAgICAgU29ydFBpY0J5UGljTnVtKHZpZGVvLT5SZWZQaWNMaXN0MCwgbGlzdDBpZHgpOwotICAgICAgICB2aWRlby0+cmVmTGlzdDBTaXplID0gbGlzdDBpZHg7Ci0KLSAgICAgICAgLyogbG9uZyB0ZXJtIGhhbmRsaW5nICovCi0gICAgICAgIGZvciAoaSA9IDA7IGkgPCBkcGItPm51bV9mczsgaSsrKQotICAgICAgICB7Ci0gICAgICAgICAgICBpZiAoZHBiLT5mc1tpXS0+SXNMb25nVGVybSA9PSAzKQotICAgICAgICAgICAgewotICAgICAgICAgICAgICAgIC8qIHN1YmNsYXVzZSA4LjIuNC4xIERlY29kaW5nIHByb2Nlc3MgZm9yIHBpY3R1cmUgbnVtYmVycy4gKi8KLSAgICAgICAgICAgICAgICBkcGItPmZzW2ldLT5mcmFtZS5Mb25nVGVybVBpY051bSA9IGRwY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5nX29mX3BpY19udW1zX2lkYyA9IHNsaWNlSGRyLT5yZW9yZGVyaW5nX29mX3BpY19udW1zX2lkY19sMDsKLSAgICAgICAgdG1wID0gKHZvaWQqKXNsaWNlSGRyLT5hYnNfZGlmZl9waWNfbnVtX21pbnVzMV9sMDsKLSAgICAgICAgYWJzX2RpZmZfcGljX251bV9taW51czEgPSAoaW50KikgdG1wOwotICAgICAgICB0bXAgPSAodm9pZCopc2xpY2VIZHItPmxvbmdfdGVybV9waWNfbnVtX2wwOwotICAgICAgICBsb25nX3Rlcm1fcGljX2lkeCA9IChpbnQqKSB0bXA7Ci0gICAgfQotICAgIGVsc2UKLSAgICB7Ci0gICAgICAgIGxpc3Rfc2l6ZSA9ICYodmlkZW8tPnJlZkxpc3QxU2l6ZSk7Ci0gICAgICAgIG51bV9yZWZfaWR4X2xYX2FjdGl2ZV9taW51czEgPSBzbGljZUhkci0+bnVtX3JlZl9pZHhfbDFfYWN0aXZlX21pbnVzMTsKLSAgICAgICAgcmVtYXBwaW5nX29mX3BpY19udW1zX2lkYyA9IHNsaWNlSGRyLT5yZW9yZGVyaW5nX29mX3BpY19udW1zX2lkY19sMTsKLSAgICAgICAgdG1wID0gKHZvaWQqKSBzbGljZUhkci0+YWJzX2RpZmZfcGljX251bV9taW51czFfbDE7Ci0gICAgICAgIGFic19kaWZmX3BpY19udW1fbWludXMxID0gKGludCopIHRtcDsKLSAgICAgICAgdG1wID0gKHZvaWQqKSBzbGljZUhkci0+bG9uZ190ZXJtX3BpY19udW1fbDE7Ci0gICAgICAgIGxvbmdfdGVybV9waWNfaWR4ID0gKGludCopdG1wOwotICAgIH0KLQotICAgIG1heFBpY051bSA9IHZpZGVvLT5NYXhQaWNOdW07Ci0gICAgY3VyclBpY051bSA9IHZpZGVvLT5DdXJyUGljTnVtOwotCi0gICAgcGljTnVtTFhQcmVkID0gY3VyclBpY051bTsgLyogaW5pdGlhbCB2YWx1ZSAqLwotCi0gICAgZm9yIChpID0gMDsgcmVtYXBwaW5nX29mX3BpY19udW1zX2lkY1tpXSAhPSAzOyBpKyspCi0gICAgewotICAgICAgICBpZiAoKHJlbWFwcGluZ19vZl9waWNfbnVtc19pZGNbaV0gPiAzKSB8fCAoaSA+PSBNQVhfUkVGX1BJQ19MSVNUX1JFT1JERVJJTkcpKQotICAgICAgICB7Ci0gICAgICAgICAgICByZXR1cm4gQVZDX0ZBSUw7IC8qIG91dCBvZiByYW5nZSAqLwotICAgICAgICB9Ci0gICAgICAgIC8qIHNlZSBzdWJjbGF1c2UgOC4yLjQuMy4xICovCi0gICAgICAgIGlmIChyZW1hcHBpbmdfb2ZfcGljX251bXNfaWRjW2ldIDwgMikKLSAgICAgICAgewotICAgICAgICAgICAgaWYgKHJlbWFwcGluZ19vZl9waWNfbnVtc19pZGNbaV0gPT0gMCkKLSAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICBpZiAocGljTnVtTFhQcmVkIC0gKGFic19kaWZmX3BpY19udW1fbWludXMxW2ldICsgMSkgPCAwKQotICAgICAgICAgICAgICAgICAgICBwaWNOdW1MWE5vV3JhcCA9IHBpY051bUxYUHJlZCAtIChhYnNfZGlmZl9waWNfbnVtX21pbnVzMVtpXSArIDEpICsgbWF4UGljTnVtOwotICAgICAgICAgICAgICAgIGVsc2UKLSAgICAgICAgICAgICAgICAgICAgcGljTnVtTFhOb1dyYXAgPSBwaWNOdW1MWFByZWQgLSAoYWJzX2RpZmZfcGljX251bV9taW51czFbaV0gKyAxKTsKLSAgICAgICAgICAgIH0KLSAgICAgICAgICAgIGVsc2UgLyogKHJlbWFwcGluZ19vZl9waWNfbnVtc19pZGNbaV0gPT0gMSkgKi8KLSAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICBpZiAocGljTnVtTFhQcmVkICsgKGFic19kaWZmX3BpY19udW1fbWludXMxW2ldICsgMSkgID49ICBtYXhQaWNOdW0pCi0gICAgICAgICAgICAgICAgICAgIHBpY051bUxYTm9XcmFwID0gcGljTnVtTFhQcmVkICsgKGFic19kaWZmX3BpY19udW1fbWludXMxW2ldICsgMSkgLSBtYXhQaWNOdW07Ci0gICAgICAgICAgICAgICAgZWxzZQotICAgICAgICAgICAgICAgICAgICBwaWNOdW1MWE5vV3JhcCA9IHBpY051bUxYUHJlZCArIChhYnNfZGlmZl9waWNfbnVtX21pbnVzMVtpXSArIDEpOwotICAgICAgICAgICAgfQotICAgICAgICAgICAgcGljTnVtTFhQcmVkID0gcGljTnVtTFhOb1dyYXA7IC8qIHByZWRpY3Rpb24gZm9yIHRoZSBuZXh0IG9uZSAqLwotCi0gICAgICAgICAgICBpZiAocGljTnVtTFhOb1dyYXAgPiBjdXJyUGljTnVtKQotICAgICAgICAgICAgICAgIHBpY051bUxYID0gcGljTnVtTFhOb1dyYXAgLSBtYXhQaWNOdW07Ci0gICAgICAgICAgICBlbHNlCi0gICAgICAgICAgICAgICAgcGljTnVtTFggPSBwaWNOdW1MWE5vV3JhcDsKLQotICAgICAgICAgICAgc3RhdHVzID0gUmVvcmRlclNob3J0VGVybSh2aWRlbywgcGljTnVtTFgsICZyZWZJZHhMWCwgaXNMMSk7Ci0gICAgICAgICAgICBpZiAoc3RhdHVzICE9IEFWQ19TVUNDRVNTKQotICAgICAgICAgICAgewotICAgICAgICAgICAgICAgIHJldHVybiBzdGF0dXM7Ci0gICAgICAgICAgICB9Ci0gICAgICAgIH0KLSAgICAgICAgZWxzZSAvKiAocmVtYXBwaW5nX29mX3BpY19udW1zX2lkY1tpXSA9PSAyKSwgc3ViY2xhdXNlIDguMi40LjMuMiAqLwotICAgICAgICB7Ci0gICAgICAgICAgICBzdGF0dXMgPSBSZW9yZGVyTG9uZ1Rlcm0odmlkZW8sIGxvbmdfdGVybV9waWNfaWR4W2ldLCAmcmVmSWR4TFgsIGlzTDEpOwotICAgICAgICAgICAgaWYgKHN0YXR1cyAhPSBBVkNfU1VDQ0VTUykKLSAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICByZXR1cm4gc3RhdHVzOwotICAgICAgIC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gICAgICAgICAgIGlmICgoZHBiLT5mc1tpXS0+ZnJhbWUuaXNMb25nVGVybSA9PSBGQUxTRSkgJiYgKGRwYi0+ZnNbaV0tPmZyYW1lLlBpY051bSA9PSBwaWNOdW0pKQotICAgICAgICAgICAgewotICAgICAgICAgICAgICAgIHJldHVybiAmKGRwYi0+ZnNbaV0tPmZyYW1lKTsKLSAgICAgICAgICAgIH0KLSAgICAgICAgfQotCi0gICAgfQotCi0gICAgcmV0dXJuIE5VTEw7Ci19Ci0KLUFWQ1BpY3R1cmVEYXRhKiAgR2V0TG9uZ1Rlcm1QaWMoQVZDQ29tbW9uT2JqICp2aWRlbywgaW50IExvbmd0ZXJtUGljTnVtKQotewotICAgIEFWQ0RlY1BpY0J1ZmZlciAqZHBiID0gdmlkZW8tPmRlY1BpY0J1ZjsKLSAgICBpbnQgaTsKLQotICAgIGZvciAoaSA9IDA7IGkgPCBkcGItPm51bV9mczsgaSsrKQotICAgIHsKLQotICAgICAgICBpZiAoZHBiLT5mc1tpXS0+SXNSZWZlcmVuY2UgPT0gMykKLSAgICAgICAgewotICAgICAgICAgICAgaWYgKChkcGItPmZzW2ldLT5mcmFtZS5pc0xvbmdUZXJtID09IFRSVUUpICYmIChkcGItPmZzW2ldLT5mcmFtZS5Mb25nVGVybVBpY051bSA9PSBMb25ndGVybVBpY051bSkpCi0gICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgcmV0dXJuICYoZHBiLT5mc1tpXS0+ZnJhbWUpOwotICAgICAgICAgICAgfQotICAgICAgICB9Ci0KLSAgICB9Ci0gICAgcmV0dXJuIE5VTEw7Ci19Ci0KLWludCBpc19zaG9ydF9yZWYoQVZDUGljdHVyZURhdGEgKnMpCi17Ci0gICAgcmV0dXJuICgocy0+aXNSZWZlcmVuY2UpICYmICEocy0+aXNMb25nVGVybSkpOwotfQotCi1pbnQgaXNfbG9uZ19yZWYoQVZDUGljdHVyZURhdGEgKnMpCi17Ci0gICAgcmV0dXJuICgocy0+aXNSZWZlcmVuY2UpICYmIChzLT5pc0xvbmdUZXJtKSk7Ci19Ci0KLQotLyogc29ydCBieSBQaWNOdW0sIGRlc2NlbmRpbmcgb3JkZXIgKi8KLXZvaWQgU29ydFBpY0J5UGljTnVtKEFWQ1BpY3R1cmVEYXRhICpkYXRhW10sIGludCBudW0pCi17Ci0gICAgaW50IGksIGo7Ci0gICAgQVZDUGljdHVyZURhdGEgKnRlbXA7Ci0KLSAgICBmb3IgKGkgPSAwOyBpIDwgbnVtIC0gMTsgaSsrKQotICAgIHsKLSAgICAgICAgZm9yIChqID0gaSArIDE7IGogPCBudW07IGorKykKLSAgICAgICAgewotICAgICAgICAgICAgaWYgKGRhdGFbal0tPlBpY051bSA+IGRhdGFbaV0tPlBpY051bSkKLSAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICB0ZW1wID0gZGF0YVtqXTsKLSAgICAgICAgICAgICAgICBkYXRhW2pdID0gZGF0YVtpXTsKLSAgICAgICAgICAgICAgICBkYXRhW2ldID0gdGVtcDsKLSAgICAgICAgICAgIH0KLSAgICAgICAgfQotICAgIH0KLQotICAgIHJldHVybiA7Ci19Ci0KLS8qIHNvcnQgYnkgUGljTnVtLCBhc2NlbmRpbmcgb3JkZXIgKi8KLXZvaWQgU29ydFBpY0J5UGljTnVtTG9uZ1Rlcm0oQVZDUGljdHVyZURhdGEgKmRhdGFbXSwgaW50IG51bSkKLXsKLSAgICBpbnQgaSwgajsKLSAgICBBVkNQaWN0dXJlRGF0YSAqdGVtcDsKLQotICAgIGZvciAoaSA9IDA7IGkgPCBudW0gLSAxOyBpKyspCi0gICAgewotICAgICAgICBmb3IgKGogPSBpICsgMTsgaiA8IG51bTsgaisrKQotICAgICAgICB7Ci0gICAgICAgICAgICBpZiAoZGF0YVtqXS0+TG9uZ1Rlcm1QaWNOdW0gPCBkYXRhW2ldLT5Mb25nVGVybVBpY051bSkKLSAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICB0ZW1wID0gZGF0YVtqXTsKLSAgICAgICAgICAgICAgICBkYXRhW2pdID0gZGF0YVtpXTsKLSAgICAgICAgICAgICAgICBkYXRhW2ldID0gdGVtcDsKLSAgICAgICAgICAgIH0KLSAgICAgICAgfQotICAgIH0KLQotICAgIHJldHVybiA7Ci19Ci0KLQotLyogc29ydCBieSBGcmFtZU51bVdyYXAsIGRlc2NlbmRpbmcgb3JkZXIgKi8KLXZvaWQgU29ydEZyYW1lQnlGcmFtZU51bVdyYXAoQVZDRnJhbWVTdG9yZSAqZGF0YVtdLCBpbnQgbnVtKQotewotICAgIGludCBpLCBqOwotICAgIEFWQ0ZyYW1lU3RvcmUgKnRlbXA7Ci0KLSAgICBmb3IgKGkgPSAwOyBpIDwgbnVtIC0gMTsgaSsrKQotICAgIHsKLSAgICAgICAgZm9yIChqID0gaSArIDE7IGogPCBudW07IGorKykKLSAgICAgICAgewotICAgICAgICAgICAgaWYgKGRhdGFbal0tPkZyYW1lTnVtV3JhcCA+IGRhdGFbaV0tPkZyYW1lTnVtV3JhcCkKLSAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICB0ZW1wID0gZGF0YVtqXTsKLSAgICAgICAgICAgICAgICBkYXRhW2pdID0gZGF0YVtpXTsKLSAgICAgICAgICAgICAgICBkYXRhW2ldID0gdGVtcDsKLSAgICAgICAgICAgIH0KLSAgICAgICAgfQotICAgIH0KLQotICAgIHJldHVybiA7Ci19Ci0KLS8qIHNvcnQgZnJhbWVzIGJ5IExvbmdUZXJtRnJhbWVJZHgsIGFzY2VuZGluZyBvcmRlciAqLwotdm9pZCBTb3J0RnJhbWVCeUxURnJhbWVJZHgoQVZDRnJhbWVTdG9yZSAqZGF0YVtdLCBpbnQgbnVtKQotewotICAgIGludCBpLCBqOwotICAgIEFWQ0ZyYW1lU3RvcmUgKnRlbXA7Ci0KLSAgICBmb3IgKGkgPSAwOyBpIDwgbnVtIC0gMTsgaSsrKQotICAgIHsKLSAgICAgICAgZm9yIChqID0gaSArIDE7IGogPCBudW07IGorKykKLSAgICAgICAgewotICAgICAgICAgICAgaWYgKGRhdGFbal0tPkxvbmdUZXJtRnJhbWVJZHggPCBkYXRhW2ldLT5Mb25nVGVybUZyYW1lSWR4KQotICAgICAgICAgICAgewotICAgICAgICAgICAgICAgIHRlbXAgPSBkYXRhW2pdOwotICAgICAgICAgICAgICAgIGRhdGFbal0gPSBkYXRhW2ldOwotICAgICAgICAgICAgICAgIGRhdGFbaV0gPSB0ZW1wOwotICAgICAgICAgICAgfQotICAgICAgICB9Ci0gICAgfQotCi0gICAgcmV0dXJuIDsKLX0KLQotLyogc29ydCBQaWN0dXJlRGF0YSBieSBQT0MgaW4gZGVzY2VuZGluZyBvcmRlciAqLwotdm9pZCBTb3J0UGljQnlQT0MoQVZDUGljdHVyZURhdGEgKmRhdGFbXSwgaW50IG51bSwgaW50IGRlc2NlbmRpbmcpCi17Ci0gICAgaW50IGksIGo7Ci0gICAgQVZDUGljdHVyZURhdGEgKnRlbXA7Ci0KLSAgICBpZiAoZGVzY2VuZGluZykKLSAgICB7Ci0gICAgICAgIGZvciAoaSA9IDA7IGkgPCBudW0gLSAxOyBpKyspCi0gICAgICAgIHsKLSAgICAgICAgICAgIGZvciAoaiA9IGkgKyAxOyBqIDwgbnVtOyBqKyspCi0gICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgaWYgKGRhdGFbal0tPlBpY09yZGVyQ250ID4gZGF0YVtpXS0+UGljT3JkZXJDbnQpCi0gICAgICAgICAgICAgICAgewotICAgICAgICAgICAgICAgICAgICB0ZW1wID0gZGF0YVtqXTsKLSAgICAgICAgICAgICAgICAgICAgZGF0YVtqXSA9IGRhdGFbaV07Ci0gICAgICAgICAgICAgICAgICAgIGRhdGFbaV0gPSB0ZW1wOwotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgIH0KLSAgICAgICAgfQotICAgIH0KLSAgICBlbHNlCi0gICAgewotICAgICAgICBmb3IgKGkgPSAwOyBpIDwgbnVtIC0gMTsgaSsrKQotICAgICAgICB7Ci0gICAgICAgICAgICBmb3IgKGogPSBpICsgMTsgaiA8IG51bTsgaisrKQotICAgICAgICAgICAgewotICAgICAgICAgICAgICAgIGlmIChkYXRhW2pdLT5QaWNPcmRlckNudCA8IGRhdGFbaV0tPlBpY09yZGVyQ250KQotICAgICAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAgICAgdGVtcCA9IGRhdGFbal07Ci0gICAgICAgICAgICAgICAgICAgIGRhdGFbal0gPSBkYXRhW2ldOwotICAgICAgICAgICAgICAgICAgICBkYXRhW2ldID0gdGVtcDsKLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICB9Ci0gICAgICAgIH0KLSAgICB9Ci0gICAgcmV0dXJuIDsKLX0KLQotLyogc29ydCBQaWN0dXJlRGF0YSBieSBMb25nVGVybVBpY051bSBpbiBhc2NlbmRpbmcgb3JkZXIgKi8KLXZvaWQgU29ydFBpY0J5TFRQaWNOdW0oQVZDUGljdHVyZURhdGEgKmRhdGFbXSwgaW50IG51bSkKLXsKLSAgICBpbnQgaSwgajsKLSAgICBBVkNQaWN0dXJlRGF0YSAqdGVtcDsKLQotICAgIGZvciAoaSA9IDA7IGkgPCBudW0gLSAxOyBpKyspCi0gICAgewotICAgICAgICBmb3IgKGogPSBpICsgMTsgaiA8IG51bTsgaisrKQotICAgICAgICB7Ci0gICAgICAgICAgICBpZiAoZGF0YVtqXS0+TG9uZ1Rlcm1QaWNOdW0gPCBkYXRhW2ldLT5Mb25nVGVybVBpY051bSkKLSAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICB0ZW1wID0gZGF0YVtqXTsKLSAgICAgICAgICAgICAgICBkYXRhW2pdID0gZGF0YVtpXTsKLSAgICAgICAgICAgICAgICBkYXRhW2ldID0gdGVtcDsKLSAgICAgICAgICAgIH0KLSAgICAgICAgfQotICAgIH0KLQotICAgIHJldHVybiA7Ci19Ci0KLS8qIHNvcnQgYnkgUGljT3JkZXJDbnQsIGRlc2NlbmRpbmcgb3JkZXIgKi8KLXZvaWQgU29ydEZyYW1lQnlQT0MoQVZDRnJhbWVTdG9yZSAqZGF0YVtdLCBpbnQgbnVtLCBpbnQgZGVzY2VuZGluZykKLXsKLSAgICBpbnQgaSwgajsKLSAgICBBVkNGcmFtZVN0b3JlICp0ZW1wOwotCi0gICAgaWYgKGRlc2NlbmRpbmcpCi0gICAgewotICAgICAgICBmb3IgKGkgPSAwOyBpIDwgbnVtIC0gMTsgaSsrKQotICAgICAgICB7Ci0gICAgICAgICAgICBmb3IgKGogPSBpICsgMTsgaiA8IG51bTsgaisrKQotICAgICAgICAgICAgewotICAgICAgICAgICAgICAgIGlmIChkYXRhW2pdLT5QaWNPcmRlckNudCA+IGRhdGFbaV0tPlBpY09yZGVyQ250KQotICAgICAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAgICAgdGVtcCA9IGRhdGFbal07Ci0gICAgICAgICAgICAgICAgICAgIGRhdGFbal0gPSBkYXRhW2ldOwotICAgICAgICAgICAgICAgICAgICBkYXRhW2ldID0gdGVtcDsKLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICB9Ci0gICAgICAgIH0KLSAgICB9Ci0gICAgZWxzZQotICAgIHsKLSAgICAgICAgZm9yIChpID0gMDsgaSA8IG51bSAtIDE7IGkrKykKLSAgICAgICAgewotICAgICAgICAgICAgZm9yIChqID0gaSArIDE7IGogPCBudW07IGorKykKLSAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICBpZiAoZGF0YVtqXS0+UGljT3JkZXJDbnQgPCBkYXRhW2ldLT5QaWNPcmRlckNudCkKLSAgICAgICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgICAgIHRlbXAgPSBkYXRhW2pdOwotICAgICAgICAgICAgICAgICAgICBkYXRhW2pdID0gZGF0YVtpXTsKLSAgICAgICAgICAgICAgICAgICAgZGF0YVtpXSA9IHRlbXA7Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgfQotICAgICAgICB9Ci0gICAgfQotCi0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NlIE9NWF9WSURFT19BVkNQcm9maWxlQmFzZWxpbmU6Ci0gICAgICAgICAgICAqcHZQcm9maWxlID0gQVZDX0JBU0VMSU5FOwotICAgICAgICAgICAgcmV0dXJuIE9LOwotICAgICAgICBkZWZhdWx0OgotICAgICAgICAgICAgQUxPR0UoIlVuc3VwcG9ydGVkIG9teCBwcm9maWxlOiAlZCIsIG9teFByb2ZpbGUpOwotICAgIH0KLSAgICByZXR1cm4gQkFEX1ZBTFVFOwotfQotCi1zdGF0aWMgc3RhdHVzX3QgQ29udmVydE9teEF2Y0xldmVsVG9BdmNTcGVjTGV2ZWwoCi0gICAgICAgIGludDMyX3Qgb214TGV2ZWwsIEFWQ0xldmVsICpwdkxldmVsKSB7Ci0gICAgQUxPR1YoIkNvbnZlcnRPbXhBdmNMZXZlbFRvQXZjU3BlY0xldmVsOiAlZCIsIG9teExldmVsKTsKLSAgICBBVkNMZXZlbCBsZXZlbCA9IEFWQ19MRVZFTDVfMTsKLSAgICBzd2l0Y2ggKG9teExldmVsKSB7Ci0gICAgICAgIGNhc2UgT01YX1ZJREVPX0FWQ0xldmVsMToKLSAgICAgICAgICAgIGxldmVsID0gQVZDX0xFVkVMMV9COwotICAgICAgICAgICAgYnJlYWs7Ci0gICAgICAgIGNhc2UgT01YX1ZJREVPX0FWQ0xldmVsMWI6Ci0gICAgICAgICAgICBsZXZlbCA9IEFWQ19MRVZFTDE7Ci0gICAgICAgICAgICBicmVhazsKLSAgICAgICAgY2FzZSBPTVhfVklERU9fQVZDTGV2ZWwxMToKLSAgICAgICAgICAgIGxldmVsID0gQVZDX0xFVkVMMV8xOwotICAgICAgICAgICAgYnJlYWs7Ci0gICAgICAgIGNhc2UgT01YX1ZJREVPX0FWQ0xldmVsMTI6Ci0gICAgICAgICAgICBsZXZlbCA9IEFWQ19MRVZFTDFfMjsKLSAgICAgICAgICAgIGJyZWFrOwotICAgICAgICBjYXNlIE9NWF9WSURFT19BVkNMZXZlbDEzOgotICAgICAgICAgICAgbGV2ZWwgPSBBVkNfTEVWRUwxXzM7Ci0gICAgICAgICAgICBicmVhazsKLSAgICAgICAgY2FzZSBPTVhfVklERU9fQVZDTGV2ZWwyOgotICAgICAgICAgICAgbGV2ZWwgPSBBVkNfTEVWRUwyOwotICAgICAgICAgICAgYnJlYWs7Ci0gICAgICAgIGNhc2UgT01YX1ZJREVPX0FWQ0xldmVsMjE6Ci0gICAgICAgICAgICBsZXZlbCA9IEFWQ19MRVZFTDJfMTsKLSAgICAgICAgICAgIGJyZWFrOwotICAgICAgICBjYXNlIE9NWF9WSURFT19BVkNMZXZlbDIyOgotICAgICAgICAgICAgbGV2ZWwgPSBBVkNfTEVWRUwyXzI7Ci0gICAgICAgICAgICBicmVhazsKLSAgICAgICAgY2FzZSBPTVhfVklERU9fQVZDTGV2ZWwzOgotICAgICAgICAgICAgbGV2ZWwgPSBBVkNfTEVWRUwzOwotICAgICAgICAgICAgYnJlYWs7Ci0gICAgICAgIGNhc2UgT01YX1ZJREVPX0FWQ0xldmVsMzE6Ci0gICAgICAgICAgICBsZXZlbCA9IEFWQ19MRVZFTDNfMTsKLSAgICAgICAgICAgIGJyZWFrOwotICAgICAgICBjYXNlIE9NWF9WSURFT19BVkNMZXZlbDMyOgotICAgICAgICAgICAgbGV2ZWwgPSBBVkNfTEVWRUwzXzI7Ci0gICAgICAgICAgICBicmVhazsKLSAgICAgICAgY2FzZSBPTVhfVklERU9fQVZDTGV2ZWw0OgotICAgICAgICAgICAgbGV2ZWwgPSBBVkNfTEVWRUw0OwotICAgICAgICAgICAgYnJlYWs7Ci0gICAgICAgIGNhc2UgT01YX1ZJREVPX0FWQ0xldmVsNDE6Ci0gICAgICAgICAgICBsZXZlbCA9IEFWQ19MRVZFTDRfMTsKLSAgICAgICAgICAgIGJyZWFrOwotICAgICAgICBjYXNlIE9NWF9WSURFT19BVkNMZXZlbDQyOgotICAgICAgICAgICAgbGV2ZWwgPSBBVkNfTEVWRUw0XzI7Ci0gICAgICAgICAgICBicmVhazsKLSAgICAgICAgY2FzZSBPTVhfVklERU9fQVZDTGV2ZWw1OgotICAgICAgICAgICAgbGV2ZWwgPSBBVkNfTEVWRUw1OwotICAgICAgICAgICAgYnJlYWs7Ci0gICAgICAgIGNhc2UgT01YX1ZJREVPX0FWQ0xldmVsNTE6Ci0gICAgICAgICAgICBsZXZlbCA9IEFWQ19MRVZFTDVfMTsKLSAgICAgICAgICAgIGJyZWFrOwotICAgICAgICBkZWZhdWx0OgotICAgICAgICAgICAgQUxPR0UoIlVua25vd24gb214IGxldmVsOiAlZCIsIG9teExldmVsKTsKLSAgICAgICAgICAgIHJldHVybiBCQURfVkFMVUU7Ci0gICAgfQotICAgICpwdkxldmVsID0gbGV2ZWw7Ci0gICAgcmV0dXJuIE9LOwotfQotCi1pbmxpbmUgc3RhdGljIHZvaWQgQ29udmVydFlVVjQyMFNlbWlQbGFuYXJUb1lVVjQyMFBsYW5hcigKLSAgICAgICAgdWludDhfdCAqaW55dXYsIHVpbnQ4X3QqIG91dHl1diwKLSAgICAgICAgaW50MzJfdCB3aWR0aCwgaW50MzJfdCBoZWlnaHQpIHsKLQotICAgIGludDMyX3Qgb3V0WXNpemUgPSB3aWR0aCAqIGhlaWdodDsKLSAgICB1aW50MzJfdCAqb3V0eSA9ICAodWludDMyX3QgKikgb3V0eXV2OwotICAgIHVpbnQxNl90ICpvdXRjYiA9ICh1aW50MTZfdCAqKSAob3V0eXV2ICsgb3V0WXNpemUpOwotICAgIHVpbnQxNl90ICpvdXRjciA9ICh1aW50MTZfdCAqKSAob3V0eXV2ICsgb3V0WXNpemUgKyAob3V0WXNpemUgPj4gMikpOwotCi0gICAgLyogWSBjb3B5aW5nICovCi0gICAgbWVtY3B5KG91dHksIGlueXV2LCBvdXRZc2l6ZSk7Ci0KLSAgICAvKiBVICYgViBjb3B5aW5nICovCi0gICAgdWludDMyX3QgKmlueXV2XzQgPSAodWludDMyX3QgKikgKGlueXV2ICsgb3V0WXNpemUpOwotICAgIGZvciAoaW50MzJ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gICBvdXRQdHIgKz0gKGRhdGFMZW5ndGggKyA0KTsgIC8vIDQgYnl0ZXMgZm9yIG5leHQgc3RhcnQgY29kZQotICAgICAgICAgICAgICAgICAgICBkYXRhTGVuZ3RoID0gb3V0cHV0QnVmZmVyLT5zaXplKCkgLQotICAgICAgICAgICAgICAgICAgICAgICAgICAgIChvdXRwdXRCdWZmZXItPnJhbmdlX2xlbmd0aCgpICsgNCk7Ci0gICAgICAgICAgICAgICAgICAgIGJyZWFrOwotICAgICAgICAgICAgICAgIGNhc2UgQVZDX05BTFRZUEVfUFBTOgotICAgICAgICAgICAgICAgICAgICArK21OdW1JbnB1dEZyYW1lczsKLSAgICAgICAgICAgICAgICAgICAgbWVtY3B5KCgodWludDhfdCAqKSBvdXRwdXRCdWZmZXItPmRhdGEoKSkgKwotICAgICAgICAgICAgICAgICAgICAgICAgICAgIG91dHB1dEJ1ZmZlci0+cmFuZ2VfbGVuZ3RoKCksCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgIlx4MDBceDAwXHgwMFx4MDEiLCA0KTsKLSAgICAgICAgICAgICAgICAgICAgb3V0cHV0QnVmZmVyLT5zZXRfcmFuZ2UoMCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBkYXRhTGVuZ3RoICsgb3V0cHV0QnVmZmVyLT5yYW5nZV9sZW5ndGgoKSArIDQpOwotICAgICAgICAgICAgICAgICAgICBvdXRwdXRCdWZmZXItPm1ldGFfZGF0YSgpLT5zZXRJbnQzMihrS2V5SXNDb2RlY0NvbmZpZywgMSk7Ci0gICAgICAgICAgICAgICAgICAgIG91dHB1dEJ1ZmZlci0+bWV0YV9kYXRhKCktPnNldEludDY0KGtLZXlUaW1lLCAwKTsKLSAgICAgICAgICAgICAgICAgICAgKm91dCA9IG91dHB1dEJ1ZmZlcjsKLSAgICAgICAgICAgICAgICAgICAgcmV0dXJuIE9LOwotICAgICAgICAgICAgICAgIGRlZmF1bHQ6Ci0gICAgICAgICAgICAgICAgICAgIEFMT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2h0ICogdmlkZW9JbnB1dC5waXRjaDsKLSAgICAgICAgdmlkZW9JbnB1dC5ZQ2JDclsyXSA9IHZpZGVvSW5wdXQuWUNiQ3JbMV0gKwotICAgICAgICAgICAgKCh2aWRlb0lucHV0LmhlaWdodCAqIHZpZGVvSW5wdXQucGl0Y2gpID4+IDIpOwotICAgICAgICB2aWRlb0lucHV0LmRpc3Bfb3JkZXIgPSBtTnVtSW5wdXRGcmFtZXM7Ci0KLSAgICAgICAgZW5jb2RlclN0YXR1cyA9IFBWQVZDRW5jU2V0SW5wdXQobUhhbmRsZSwgJnZpZGVvSW5wdXQpOwotICAgICAgICBpZiAoZW5jb2RlclN0YXR1cyA9PSBBVkNFTkNfU1VDQ0VTUyB8fAotICAgICAgICAgICAgZW5jb2RlclN0YXR1cyA9PSBBVkNFTkNfTkVXX0lEUikgewotICAgICAgICAgICAgbVJlYWR5Rm9yTmV4dEZyYW1lID0gZmFsc2U7Ci0gICAgICAgICAgICArK21OdW1JbnB1dEZyYW1lczsKLSAgICAgICAgICAgIGlmIChlbmNvZGVyU3RhdHVzID09IEFWQ0VOQ19ORVdfSURSKSB7Ci0gICAgICAgICAgICAgICAgbUlzSURSRnJhbWUgPSAxOwotICAgICAgICAgICAgfQotICAgICAgICB9IGVsc2UgewotICAgICAgICAgICAgaWYgKGVuY29kZXJTdGF0dXMgPCBBVkNFTkNfU1VDQ0VTUykgewotICAgICAgICAgICAgICAgIG91dHB1dEJ1ZmZlci0+cmVsZWFzZSgpOwotICAgICAgICAgICAgICAgIHJldHVybiBVTktOT1dOX0VSUk9SOwotICAgICAgICAgICAgfSBlbHNlIHsKLSAgICAgICAgICAgICAgICBvdXRwdXRCdWZmZXItPnNldF9yYW5nZSgwLCAwKTsKLSAgICAgICAgICAgICAgICAqb3V0ID0gb3V0cHV0QnVmZmVyOwotICAgICAgICAgICAgICAgIHJldHVybiBPSzsKLSAgICAgICAgICAgIH0KLSAgICAgICAgfQotICAgIH0KLQotICAgIC8vIEVuY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QVMgSVMiIEJBU0lTLAotICogV0lUSE9VVCBXQVJSQU5USUVTIE9SIENPTkRJVElPTlMgT0YgQU5ZIEtJTkQsIGVpdGhlcgotICogZXhwcmVzcyBvciBpbXBsaWVkLgotICogU2VlIHRoZSBMaWNlbnNlIGZvciB0aGUgc3BlY2lmaWMgbGFuZ3VhZ2UgZ292ZXJuaW5nIHBlcm1pc3Npb25zCi0gKiBhbmQgbGltaXRhdGlvbnMgdW5kZXIgdGhlIExpY2Vuc2UuCi0gKiAtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tCi0gKi8KLSNpbmNsdWRlICJhdmNlbmNfYXBpLmgiCi0jaW5jbHVkZSAiYXZjZW5jX2xpYi5oIgotCi0vKiA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0gKi8KLS8qICBGdW5jdGlvbiA6IFBWQVZDR2V0TkFMVHlwZSgpICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogIERhdGUgICAgIDogMTEvNC8yMDAzICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgUHVycG9zZSAgOiBTbmlmZiBOQUwgdHlwZSBmcm9tIHRoZSBiaXRzdHJlYW0gICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICBJbi9vdXQgICA6ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogIFJldHVybiAgIDogQVZDRU5DX1NVQ0NFU1MgaWYgc3VjY2VlZCwgQVZDRU5DX0ZBSUwgaWYgZmFpbC4gICAgICAgICAgICAgICovCi0vKiAgTW9kaWZpZWQgOiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PSAqLwotT1NDTF9FWFBPUlRfUkVGIEFWQ0VuY19TdGF0dXMgUFZBVkNFbmNHZXROQUxUeXBlKHVuc2lnbmVkIGNoYXIgKmJpdHN0cmVhbSwgaW50IHNpemUsCi0gICAgICAgIGludCAqbmFsX3R5cGUsIGludCAqbmFsX3JlZl9pZGMpCi17Ci0gICAgaW50IGZvcmJpZGRlbl96ZXJvX2JpdDsKLSAgICBpZiAoc2l6ZSA+IDApCi0gICAgewotICAgICAgICBmb3JiaWRkZW5femVyb19iaXQgPSBiaXRzdHJlYW1bMF0gPj4gNzsKLSAgICAgICAgaWYgKGZvcmJpZGRlbl96ZXJvX2JpdCAhPSAwKQotICAgICAgICAgICAgcmV0dXJuIEFWQ0VOQ19GQUlMOwotICAgICAgICAqbmFsX3JlZl9pZGMgPSAoYml0c3RyZWFtWzBdICYgMHg2MCkgPj4gNTsKLSAgICAgICAgKm5hbF90eXBlID0gYml0c3RyZWFtWzBdICYgMHgxRjsKLSAgICAgICAgcmV0dXJuIEFWQ0VOQ19TVUNDRVNTOwotICAgIH0KLQotICAgIHJldHVybiBBVkNFTkNfRkFJTDsKLX0KLQotCi0vKiA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0gKi8KLS8qICBGdW5jdGlvbiA6IFBWQVZDRW5jSW5pdGlhbGl6ZSgpICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogIERhdGUgICAgIDogMy8xOC8yMDA0ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgUHVycG9zZSAgOiBJbml0aWFsaXplIHRoZSBlbmNvZGVyIGxpYnJhcnksIGFsbG9jYXRlIG1lbW9yeSBhbmQgdmVyaWZ5ICAgKi8KLS8qICAgICAgICAgICAgICB0aGUgcHJvZmlsZS9sZXZlbCBzdXBwb3J0L3NldHRpbmdzLiAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogIEluL291dCAgIDogRW5jb2RpbmcgcGFyYW1ldGVycy4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgUmV0dXJuICAgOiBBVkNFTkNfU1VDQ0VTUyBmb3Igc3VjY2Vzcy4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICBNb2RpZmllZCA6ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09ICovCi1PU0NMX0VYUE9SVF9SRUYgQVZDRW5jX1N0YXR1cyBQVkFWQ0VuY0luaXRpYWxpemUoQVZDSGFuZGxlICphdmNIYW5kbGUsIEFWQ0VuY1BhcmFtcyAqZW5jUGFyYW0sCi0gICAgICAgIHZvaWQqIGV4dFNQUywgdm9pZCogZXh0UFBTKQotewotICAgIEFWQ0VuY19TdGF0dXMgc3RhdHVzOwotICAgIEFWQ0VuY09iamVjdCAqZW5jdmlkOwotICAgIEFWQ0NvbW1vbk9iaiAqdmlkZW87Ci0gICAgdWludDMyICp1c2VyRGF0YSA9ICh1aW50MzIqKSBhdmNIYW5kbGUtPnVzZXJEYXRhOwotICAgIGludCBmcmFtZXNpemU7Ci0KLSAgICBpZiAoYXZjSGFuZGxlLT5BVkNPYmplY3QgIT0gTlVMTCkKLSAgICB7Ci0gICAgICAgIHJldHVybiBBVkNFTkNfQUxSRUFEWV9JTklUSUFMSVpFRDsgLyogSXQncyBhbHJlYWR5IGluaXRpYWxpemVkLCBuZWVkIHRvIGNsZWFudXAgZmlyc3QgKi8KLSAgICB9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NpemUgdGhhdCBhcHBzIHNob3VsZCBhbGxvY2F0ZSBmb3IgICovCi0vKiAgICAgICAgICAgICAgb3V0cHV0IGJ1ZmZlci4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICBJbi9vdXQgICA6ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogIFJldHVybiAgIDogQVZDRU5DX1NVQ0NFU1MgZm9yIHN1Y2Nlc3MuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgTW9kaWZpZWQgOiAgIHNpemUgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PSAqLwotCi1PU0NMX0VYUE9SVF9SRUYgQVZDRW5jX1N0YXR1cyBQVkFWQ0VuY0dldE1heE91dHB1dEJ1ZmZlclNpemUoQVZDSGFuZGxlICphdmNIYW5kbGUsIGludCogc2l6ZSkKLXsKLSAgICBBVkNFbmNPYmplY3QgKmVuY3ZpZCA9IChBVkNFbmNPYmplY3QqKWF2Y0hhbmRsZS0+QVZDT2JqZWN0OwotCi0gICAgaWYgKGVuY3ZpZCA9PSBOVUxMKQotICAgIHsKLSAgICAgICAgcmV0dXJuIEFWQ0VOQ19VTklOSVRJQUxJWkVEOwotICAgIH0KLQotICAgICpzaXplID0gZW5jdmlkLT5yYXRlQ3RybC0+Y3BiU2l6ZTsKLQotICAgIHJldHVybiBBVkNFTkNfU1VDQ0VTUzsKLX0KLQotLyogPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09ICovCi0vKiAgRnVuY3Rpb24gOiBQVkFWQ0VuY1NldElucHV0KCkgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICBEYXRlICAgICA6IDQvMTgvMjAwNCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogIFB1cnBvc2UgIDogVG8gZmVlZCBhbiB1bmVuY29kZWQgb3JpZ2luYWwgZnJhbWUgdG8gdGhlIGVuY29kZXIgbGlicmFyeS4gICovCi0vKiAgSW4vb3V0ICAgOiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICBSZXR1cm4gICA6IEFWQ0VOQ19TVUNDRVNTIGZvciBzdWNjZXNzLiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogIE1vZGlmaWVkIDogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0gKi8KLU9TQ0xfRVhQT1JUX1JFRiBBVkNFbmNfU3RhdHVzIFBWQVZDRW5jU2V0SW5wdXQoQVZDSGFuZGxlICphdmNIYW5kbGUsIEFWQ0ZyYW1lSU8gKmlucHV0KQotewotICAgIEFWQ0VuY09iamVjdCAqZW5jdmlkID0gKEFWQ0VuY09iamVjdCopYXZjSGFuZGxlLT5BVkNPYmplY3Q7Ci0gICAgQVZDQ29tbW9uT2JqICp2aWRlbyA9IGVuY3ZpZC0+Y29tbW9uOwotICAgIEFWQ1JhdGVDb250cm9sICpyYXRlQ3RybCA9IGVuY3ZpZC0+cmF0ZUN0cmw7Ci0KLSAgICBBVkNFbmNfU3RhdHVzIHN0YXR1czsKLSAgICB1aW50IGZyYW1lTnVtOwotCi0gICAgaWYgKGVuY3ZpZCA9PSBOVUxMKQotICAgIHsKLSAgICAgICAgcmV0dXJuIEFWQ0VOQ19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IGFsbCAzIGFib3ZlLgotfQotCi0vKiA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0gKi8KLS8qICBGdW5jdGlvbiA6IFBWQVZDRW5jb2RlTkFMKCkgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogIERhdGUgICAgIDogNC8yOS8yMDA0ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgUHVycG9zZSAgOiBUbyBlbmNvZGUgb25lIE5BTC9zbGljZS4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICBJbi9vdXQgICA6ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogIFJldHVybiAgIDogQVZDRU5DX1NVQ0NFU1MgZm9yIHN1Y2Nlc3MuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgTW9kaWZpZWQgOiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PSAqLwotT1NDTF9FWFBPUlRfUkVGIEFWQ0VuY19TdGF0dXMgUFZBVkNFbmNvZGVOQUwoQVZDSGFuZGxlICphdmNIYW5kbGUsIHVuc2lnbmVkIGNoYXIgKmJ1ZmZlciwgdW5zaWduZWQgaW50ICpidWZfbmFsX3NpemUsIGludCAqbmFsX3R5cGUpCi17Ci0gICAgQVZDRW5jT2JqZWN0ICplbmN2aWQgPSAoQVZDRW5jT2JqZWN0KilhdmNIYW5kbGUtPkFWQ09iamVjdDsKLSAgICBBVkNDb21tb25PYmogKnZpZGVvID0gZW5jdmlkLT5jb21tb247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ICAgICB7Ci0gICAgICAgICAgICAgICAgcmV0dXJuIHN0YXR1czsKLSAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgc3RhdHVzID0gQVZDRW5jb2RlU2xpY2UoZW5jdmlkKTsKLQotICAgICAgICAgICAgdmlkZW8tPnNsaWNlX2lkKys7Ci0KLSAgICAgICAgICAgIC8qIGNsb3NpbmcgdGhlIE5BTCB3aXRoIHRyYWlsaW5nIGJpdHMgKi8KLSAgICAgICAgICAgIEJpdHN0cmVhbVRyYWlsaW5nQml0cyhiaXRzdHJlYW0sIGJ1Zl9uYWxfc2l6ZSk7Ci0KLSAgICAgICAgICAgICpidWZfbmFsX3NpemUgPSBiaXRzdHJlYW0tPndyaXRlX3BvczsKLQotICAgICAgICAgICAgZW5jdmlkLT5yYXRlQ3RybC0+bnVtRnJhbWVCaXRzICs9ICgoKmJ1Zl9uYWxfc2l6ZSkgPDwgMyk7Ci0KLSAgICAgICAgICAgICpuYWxfdHlwZSA9IHZpZGVvLT5uYWxfdW5pdF90eXBlOwotCi0gICAgICAgICAgICBpZiAoc3RhdHVzID09IEFWQ0VOQ19QSUNUVVJFX1JFQURZKQotICAgICAgICAgICAgewotICAgICAgICAgICAgICAgIHN0YXR1cyA9IFJDVXBkYXRlRnJhbWUoZW5jdmlkKTsKLSAgICAgICAgICAgICAgICBpZiAoc3RhdHVzID09IEFWQ0VOQ19TS0lQUEVEX1BJQ1RVUkUpIC8qIHNraXAgY3VycmVudCBmcmFtZSAqLwotICAgICAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAgICAgRFBCUmVsZWFzZUN1cnJlbnRGcmFtZShhdmNIYW5kbGUsIHZpZGVvKTsKLSAgICAgICAgICAgICAgICAgICAgZW5jdmlkLT5lbmNfc3RhdGUgPSBBVkNFbmNfQW5hbHl6aW5nX0ZyYW1lOwotCi0gICAgICAgICAgICAgICAgICAgIHJldHVybiBzdGF0dXM7Ci0gICAgICAgICAgICAgICAgfQotCi0gICAgICAgICAgICAgICAgLyogcGVyZm9ybSBsb29wLWZpbHRlcmluZyBvbiB0aGUgZW50aXJlIGZyYW1lICovCi0gICAgICAgICAgICAgICAgRGVibG9ja1BpY3R1cmUodmlkZW8pOwotCi0gICAgICAgICAgICAgICAgLyogdXBkYXRlIHRoZSBvcmlnaW5hbCBmcmFtZSBhcnJheSAqLwotICAgICAgICAgICAgICAgIGVuY3ZpZC0+cHJldkNvZGVkRnJhbWVOdW0gPSBlbmN2aWQtPmN1cnJJbnB1dC0+Y29kaW5nX29yZGVyOwotCi0gICAgICAgICAgICAgICAgLyogc3RvcmUgdGhlIGVuY29kZWQgcGljdHVyZSBpbiB0aGUgRFBCIGJ1ZmZlciAqLwotICAgICAgICAgICAgICAgIFN0b3JlUGljdHVyZUluRFBCKGF2Y0hhbmRsZSwgdmlkZW8pOwotCi0gICAgICAgICAgICAgICAgaWYgKHZpZGVvLT5jdXJyUGljLT5pc1JlZmVyZW5jZSkKLSAgICAgICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgICAgIHZpZGVvLT5QcmV2UmVmRnJhbWVOdW0gPSB2aWRlby0+c2xpY2VIZHItPmZyYW1lX251bTsKLSAgICAgICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgICAgICAvKiB1cGRhdGUgUE9DIHJlbGF0ZWQgdmFyaWFibGVzICovCi0gICAgICAgICAgICAgICAgUG9zdFBPQyh2aWRlbyk7Ci0KLSAgICAgICAgICAgICAgICBlbmN2aWQtPmVuY19zdGF0ZSA9IEFWQ0VuY19BbmFseXppbmdfRnJhbWU7Ci0gICAgICAgICAgICAgICAgc3RhdHVzID0gQVZDRU5DX1BJQ1RVUkVfUkVBRFk7Ci0KLSAgICAgICAgICAgIH0KLSAgICAgICAgICAgIGJyZWFrOwotICAgICAgICBkZWZhdWx0OgotICAgICAgICAgICAgc3RhdHVzID0gQVZDRU5DX1dST05HX1NUQVRFOwotICAgIH0KLQotICAgIHJldHVybiBzdGF0dXM7Ci19Ci0KLS8qID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PSAqLwotLyogIEZ1bmN0aW9uIDogUFZBVkNFbmNHZXRPdmVycnVuQnVmZmVyKCkgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgUHVycG9zZSAgOiBUbyByZXRyaWV2ZSB0aGUgb3ZlcnJ1biBidWZmZXIuIENoZWNrIHdoZXRoZXIgb3ZlcnJ1biBidWZmZXIgKi8KLS8qICAgICAgICAgICAgICBpcyB1c2VkIG9yIG5vdCBiZWZvcmUgcmV0dXJuaW5nICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogIEluL291dCAgIDogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgUmV0dXJuICAgOiBQb2ludGVyIHRvIHRoZSBpbnRlcm5hbCBvdmVycnVuIGJ1ZmZlci4gICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICBNb2RpZmllZCA6ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09ICovCi1PU0NMX0VYUE9SVF9SRUYgdWludDgqIFBWQVZDRW5jR2V0T3ZlcnJ1bkJ1ZmZlcihBVkNIYW5kbGUqIGF2Y0hhbmRsZSkKLXsKLSAgICBBVkNFbmNPYmplY3QgKmVuY3ZpZCA9IChBVkNFbmNPYmplY3QqKWF2Y0hhbmRsZS0+QVZDT2JqZWN0OwotICAgIEFWQ0VuY0JpdHN0cmVhbSAqYml0c3RyZWFtID0gZW5jdmlkLT5iaXRzdHJlYW07Ci0KLSAgICBpZiAoYml0c3RyZWFtLT5vdmVycnVuQnVmZmVyID09IGJpdHN0cmVhbS0+Yml0c3RyZWFtQnVmZmVyKSAvKiBPQiBpcyB1c2VkICovCi0gICAgewotICAgICAgICByZXR1cm4gZW5jdmlkLT5vdmVycnVuQnVmZmVyOwotICAgIH0KLSAgICBlbHNlCi0gICAgewotICAgICAgICByZXR1cm4gTlVMTDsKLSAgICB9Ci19Ci0KLQotLyogPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09ICovCi0vKiAgRnVuY3Rpb24gOiBQVkFWQ0VuY0dldFJlY29uKCkgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICBEYXRlICAgICA6IDQvMjkvMjAwNCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogIFB1cnBvc2UgIDogVG8gcmV0cmlldmUgdGhlIG1vc3QgcmVjZW50bHkgZW5jb2RlZCBmcmFtZS4gICAgICAgICAgICAgICAgICovCi0vKiAgICAgICAgICAgICAgYXNzdW1lIHRoYXQgdXNlciB3aWxsIG1ha2UgYSBjb3B5IGlmIHRoZXkgd2FudCB0byBob2xkIG9uICAgKi8KLS8qICAgICAgICAgICAgICB0byBpdC4gT3RoZXJ3aXNlLCBpdCBpcyBub3QgZ3VhcmFudGVlZCB0byBiZSByZXNlcnZlZC4gICAgICAqLwotLyogICAgICAgICAgICAgIE1vc3QgYXBwbGljYXRpb25zIHByZWZlciB0byBzZWUgb3JpZ2luYWwgZnJhbWUgcmF0aGVyIHRoYW4gICovCi0vKiAgICAgICAgICAgICAgcmVjb25zdHJ1Y3RlZCBmcmFtZS4gU28sIHdlIGFyZSBzdGF5aW5nIGF3YXJlIGZyb20gY29tcGxleCAgKi8KLS8qICAgICAgICAgICAgICBidWZmZXJpbmcgbWVjaGFuaXNtLiBJZiBuZWVkZWQsIGNhbiBiZSBhZGRlZCBsYXRlci4gICAgICAgICAqLwotLyogIEluL291dCAgIDogICAgICAgICAgICAgICAgICAgICA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XJyRlMtPlBpY09yZGVyQ250OwotICAgIHJlY29uLT5jb2Rpbmdfb3JkZXIgPSBjdXJyRlMtPkZyYW1lTnVtOwotICAgIHJlY29uLT5pZCA9ICh1aW50MzIpIGN1cnJGUy0+YmFzZV9kcGI7IC8qIHVzZSB0aGUgcG9pbnRlciBhcyB0aGUgaWQgKi8KLQotICAgIGN1cnJGUy0+SXNPdXRwdXR0ZWQgfD0gMTsKLQotICAgIHJldHVybiBBVkNFTkNfU1VDQ0VTUzsKLX0KLQotT1NDTF9FWFBPUlRfUkVGIEFWQ0VuY19TdGF0dXMgUFZBVkNFbmNSZWxlYXNlUmVjb24oQVZDSGFuZGxlICphdmNIYW5kbGUsIEFWQ0ZyYW1lSU8gKnJlY29uKQotewotICAgIE9TQ0xfVU5VU0VEX0FSRyhhdmNIYW5kbGUpOwotICAgIE9TQ0xfVU5VU0VEX0FSRyhyZWNvbik7Ci0KLSAgICByZXR1cm4gQVZDRU5DX1NVQ0NFU1M7IC8vZm9yIG5vdwotfQotCi0vKiA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0gKi8KLS8qICBGdW5jdGlvbiA6IFBWQVZDQ2xlYW5VcEVuY29kZXIoKSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogIERhdGUgICAgIDogNC8xOC8yMDA0ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgUHVycG9zZSAgOiBUbyBjbGVhbiB1cCBtZW1vcmllcyBhbGxvY2F0ZWQgYnkgUFZBVkNFbmNJbml0aWFsaXplKCkgICAgICAgKi8KLS8qICBJbi9vdXQgICA6ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogIFJldHVybiAgIDogQVZDRU5DX1NVQ0NFU1MgZm9yIHN1Y2Nlc3MuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgTW9kaWZpZWQgOiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PSAqLwotT1NDTF9FWFBPUlRfUkVGIHZvaWQgICAgUFZBVkNDbGVhblVwRW5jb2RlcihBVkNIYW5kbGUgKmF2Y0hhbmRsZSkKLXsKLSAgICBBVkNFbmNPYmplY3QgKmVuY3ZpZCA9IChBVkNFbmNPYmplY3QqKSBhdmNIYW5kbGUtPkFWQ09iamVjdDsKLSAgICBBVkNDb21tb25PYmogKnZpZGVvOwotICAgIHVpbnQzMiAqdXNlckRhdGEgPSAodWludDMyKikgYXZjSGFuZGxlLT51c2VyRGF0YTsKLQotICAgIGlmIChlbmN2aWQgIT0gTlVMTCkKLSAgICB7Ci0gICAgICAgIENsZWFuTW90aW9uU2VhcmNoTW9kdWxlKGF2Y0hhbmRsZSk7Ci0KLSAgICAgICAgQ2xlYW51cFJhdGVDb250cm9sTW9kdWxlKGF2Y0hhbmRsZSk7Ci0KLSAgICAgICAgaWYgKGVuY3ZpZC0+ZnVuY3Rpb25Qb2ludGVyICE9IE5VTEwpCi0gICAgICAgIHsKLSAgICAgICAgICAgIGF2Y0hhbmRsZS0+Q0JBVkNfRnJlZSh1c2VyRGF0YSwgKGludCllbmN2aWQtPmZ1bmN0aW9uUG9pbnRlcik7Ci0gICAgICAgIH0KLQotICAgICAgICBpZiAoZW5jdmlkLT5taW5fY29zdCkKLSAgICAgICAgewotICAgICAgICAgICAgYXZjSGFuZGxlLT5DQkFWQ19GcmVlKHVzZXJEYXRhLCAoaW50KWVuY3ZpZC0+bWluX2Nvc3QpOwotICAgICAgICB9Ci0KLSAgICAgICAgaWYgKGVuY3ZpZC0+aW50cmFTZWFyY2gpCi0g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fQotICAgICAgICAgICAgaWYgKHZpZGVvLT5kZWNQaWNCdWYgIT0gTlVMTCkKLSAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICBDbGVhblVwRFBCKGF2Y0hhbmRsZSwgdmlkZW8pOwotICAgICAgICAgICAgICAgIGF2Y0hhbmRsZS0+Q0JBVkNfRnJlZSh1c2VyRGF0YSwgKGludCl2aWRlby0+ZGVjUGljQnVmKTsKLSAgICAgICAgICAgIH0KLSAgICAgICAgICAgIGlmICh2aWRlby0+c2xpY2VIZHIgIT0gTlVMTCkKLSAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICBhdmNIYW5kbGUtPkNCQVZDX0ZyZWUodXNlckRhdGEsIChpbnQpdmlkZW8tPnNsaWNlSGRyKTsKLSAgICAgICAgICAgIH0KLSAgICAgICAgICAgIGlmICh2aWRlby0+Y3VyclBpY1BhcmFtcyAhPSBOVUxMKQotICAgICAgICAgICAgewotICAgICAgICAgICAgICAgIGlmICh2aWRlby0+Y3VyclBpY1BhcmFtcy0+c2xpY2VfZ3JvdXBfaWQpCi0gICAgICAgICAgICAgICAgewotICAgICAgICAgICAgICAgICAgICBhdmNIYW5kbGUtPkNCQVZDX0ZyZWUodXNlckRhdGEsIChpbnQpdmlkZW8tPmN1cnJQaWNQYXJhbXMtPnNsaWNlX2dyb3VwX2lkKTsKLSAgICAgICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgICAgICBhdmNIYW5kbGUtPkNCQVZDX0ZyZWUodXNlckRhdGEsIChpbnQpdmlkZW8tPmN1cnJQaWNQYXJhbXMpOwotICAgICAgICAgICAgfQotICAgICAgICAgICAgaWYgKHZpZGVvLT5jdXJyU2VxUGFyYW1zICE9IE5VTEwpCi0gICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgYXZjSGFuZGxlLT5DQkFWQ19GcmVlKHVzZXJEYXRhLCAoaW50KXZpZGVvLT5jdXJyU2VxUGFyYW1zKTsKLSAgICAgICAgICAgIH0KLSAgICAgICA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wotCi0gICAgQVZDRnJhbWVJTyAgICAgICAgICAqY3VycklucHV0OyAvKiBwb2ludGVyIHRvIHRoZSBjdXJyZW50IGlucHV0IGZyYW1lICovCi0KLSAgICBpbnQgICAgICAgICAgICAgICAgIGN1cnJTbGljZUdyb3VwOyAvKiBjdXJyZW50bHkgZW5jb2RlZCBzbGljZSBncm91cCBpZCAqLwotCi0gICAgaW50ICAgICBsZXZlbFsyNF1bMTZdLCBydW5bMjRdWzE2XTsgLyogc2NyYXRjaCBtZW1vcnkgKi8KLSAgICBpbnQgICAgIGxldmVsZGNbMTZdLCBydW5kY1sxNl07IC8qIGZvciBEQyBjb21wb25lbnQgKi8KLSAgICBpbnQgICAgIGxldmVsY2RjWzE2XSwgcnVuY2RjWzE2XTsgLyogZm9yIGNocm9tYSBEQyBjb21wb25lbnQgKi8KLSAgICBpbnQgICAgIG51bWNvZWZjZGNbMl07IC8qIG51bWJlciBvZiBjb2VmZmljaWVudCBmb3IgY2hyb21hIERDICovCi0gICAgaW50ICAgICBudW1jb2VmZGM7ICAgICAgLyogbnVtYmVyIG9mIGNvZWZmaWNpZW50cyBmb3IgREMgY29tcG9uZW50ICovCi0KLSAgICBpbnQgICAgIHFwX2NvbnN0OwotICAgIGludCAgICAgcXBfY29uc3RfYzsKLSAgICAvKioqKioqKioqIGludHJhIHByZWRpY3Rpb24gc2NyYXRjaCBtZW1vcnkgKioqKioqKioqKioqKioqKioqKioqKi8KLSAgICB1aW50OCAgIHByZWRfaTE2W0FWQ051bUkxNlByZWRNb2RlXVsyNTZdOyAvKiBzYXZlIHByZWRpY3Rpb24gZm9yIE1CICovCi0gICAgdWludDggICBwcmVkX2k0W0FWQ051bUk0UHJlZE1vZGVdWzE2XTsgIC8qIHNhdmUgcHJlZGljdGlvbiBmb3IgYmxrICovCi0gICAgdWludDggICBwcmVkX2ljW0FWQ051bUlDaHJvbWFNb2RlXVsxMjhdOyAgLyogZm9yIDIgY2hyb21hICovCi0KLSAgICBpbnQgICAgIG1v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lud2lkdGgsIHVpbnQ4ICpvdXQsIGludCBvdXRwaXRjaCwKLSAgICAgICAgICAgICAgICAgICAgaW50IGJsa3dpZHRoLCBpbnQgYmxraGVpZ2h0KTsKLQotICAgIHZvaWQgZUhvcnpJbnRlcnAxTUModWludDggKmluLCBpbnQgaW5waXRjaCwgdWludDggKm91dCwgaW50IG91dHBpdGNoLAotICAgICAgICAgICAgICAgICAgICAgICAgaW50IGJsa3dpZHRoLCBpbnQgYmxraGVpZ2h0LCBpbnQgZHgpOwotCi0gICAgdm9pZCBlSG9yekludGVycDJNQyhpbnQgKmluLCBpbnQgaW5waXRjaCwgdWludDggKm91dCwgaW50IG91dHBpdGNoLAotICAgICAgICAgICAgICAgICAgICAgICAgaW50IGJsa3dpZHRoLCBpbnQgYmxraGVpZ2h0LCBpbnQgZHgpOwotCi0gICAgdm9pZCBlSG9yekludGVycDNNQyh1aW50OCAqaW4sIGludCBpbnBpdGNoLCBpbnQgKm91dCwgaW50IG91dHBpdGNoLAotICAgICAgICAgICAgICAgICAgICAgICAgaW50IGJsa3dpZHRoLCBpbnQgYmxraGVpZ2h0KTsKLQotICAgIHZvaWQgZVZlcnRJbnRlcnAxTUModWludDggKmluLCBpbnQgaW5waXRjaCwgdWludDggKm91dCwgaW50IG91dHBpdGNoLAotICAgICAgICAgICAgICAgICAgICAgICAgaW50IGJsa3dpZHRoLCBpbnQgYmxraGVpZ2h0LCBpbnQgZHkpOwotCi0gICAgdm9pZCBlVmVydEludGVycDJNQyh1aW50OCAqaW4sIGludCBpbnBpdGNoLCBpbnQgKm91dCwgaW50IG91dHBpdGNoLAotICAgICAgICAgICAgICAgICAgICAgICAgaW50IGJsa3dpZHRoLCBpbnQgYmxraGVpZ2h0KTsKLQotICAgIHZvaWQgZVZlcnRJbnRlcnAzTUMoaW50ICppbiwgaW50IGlucGl0Y2gsIHVpbnQ4ICpvdXQsIGludCBvdXRwaXRjaCwKLSAgICAgICAgICAgICAgICAgICAgICAgIGludCBibGt3aWR0aCwgaW50IGJsa2hlaWdodCwgaW50IGR5KTsKLQotICAgIHZvaWQgZURpYWdvbmFsSW50ZXJwTUModWludDggKmluMSwgdWludDggKmluMiwgaW50IGlucGl0Y2gsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICB1aW50OCAqb3V0LCBpbnQgb3V0cGl0Y2gsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICBpbnQgYmxrd2lkdGgsIGludCBibGtoZWlnaHQpOwotCi0gICAgdm9pZCBlQ2hyb21hTW90aW9uQ29tcCh1aW50OCAqcmVmLCBpbnQgcGljd2lkdGgsIGludCBwaWNoZWlnaHQsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICBpbnQgeF9wb3MsIGludCB5X3BvcywgdWludDggKnByZWQsIGludCBwcmVkX3BpdGNoLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgaW50IGJsa3dpZHRoLCBpbnQgYmxraGVpZ2h0KTsKLQotICAgIHZvaWQgZUNocm9tYURpYWdvbmFsTUNfU0lNRCh1aW50OCAqcFJlZiwgaW50IHNyY1BpdGNoLCBpbnQgZHgsIGludCBkeSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdWludDggKnBPdXQsIGludCBwcmVkUGl0Y2gsIGludCBibGt3aWR0aCwgaW50IGJsa2hlaWdodCk7Ci0KLSAgICB2b2lkIGVDaHJvbWFIb3Jpem9udGFsTUNfU0lNRCh1aW50OCAqcFJlZiwgaW50IHNyY1BpdGNoLCBpbnQgZHgsIGludCBkeSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB1aW50OCAqcE91dCwgaW50IHByZWRQaXRjaCwgaW50IGJsa3dpZHRoLCBpbnQgYmxraGVpZ2h0KTsKLQotICAgIHZvaWQgZUNocm9tYVZlcnRpY2FsTUNfU0lNRCh1aW50OCAqcFJlZiwgaW50IHNyY1BpdGNoLCBpbnQgZHgsIGludCBkeSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdWludDggKnBPdXQsIGludCBwcmVkUGl0Y2gsIGludCBibGt3aWR0aCwgaW50IGJsa2hlaWdodCk7Ci0KLSAgICB2b2lkIGVDaHJvbWFGdWxsTUNfU0lNRCh1aW50OCAqcFJlZiwgaW50IHNyY1BpdGNoLCBpbnQgZHgsIGludCBkeSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICB1aW50OCAqcE91dCwgaW50IHByZWRQaXRjaCwgaW50IGJsa3dpZHRoLCBpbnQgYmxraGVpZ2h0KTsKLQotICAgIHZvaWQgZUNocm9tYVZlcnRpY2FsTUMyX1NJTUQodWludDggKnBSZWYsIGludCBzcmNQaXRjaCwgaW50IGR4LCBpbnQgZHksCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB1aW50OCAqcE91dCwgaW50IHByZWRQaXRjaCwgaW50IGJsa3dpZHRoLCBpbnQgYmxraGVpZ2h0KTsKLQotICAgIHZvaWQgZUNocm9tYUhvcml6b250YWxNQzJfU0lNRCh1aW50OCAqcFJlZiwgaW50IHNyY1BpdGNoLCBpbnQgZHgsIGludCBkeSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdWludDggKnBPdXQsIGludCBwcmVkUGl0Y2gsIGludCBibGt3aWR0aCwgaW50IGJsa2hlaWdodCk7Ci0KLSAgICB2b2lkIGVDaHJvbWFEaWFnb25hbE1DMl9TSU1EKHVpbnQ4ICpwUmVmLCBpbnQgc3JjUGl0Y2gsIGludCBkeCwgaW50IGR5LAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdWludDggKnBPdXQsIGludCBwcmVkUGl0Y2gsIGludCBibGt3aWR0aCwgaW50IGJsa2hlaWdodCk7Ci0KLQotICAgIC8qLS0tLS0tLS0tLS0tLS0gbW90aW9uX2VzdC5jIC0tLS0tLS0tLS0tLS0tLSovCi0KLSAgICAvKioKLSAgICBBbGxvY2F0ZSBhbmQgaW5pdGlhbGl6ZSBhcnJheXMgbmVjZXNzYXJ5IGZvciBtb3R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GludCBtYk51bSwKLS8vICAgICAgICAgICAgICAgICAgICAgICAgICAgaW50IG51bV9wYXNzKTsKLQotICAgIC8qKgotICAgIFBlcmZvcm0gZnVsbC1wZWwgZXhoYXVzdGl2ZSBzZWFyY2ggYXJvdW5kIHRoZSBwcmVkaWN0ZWQgTVYuCi0gICAgXHBhcmFtICJlbmN2aWQiICJQb2ludGVyIHRvIEFWQ0VuY09iamVjdCBzdHJ1Y3R1cmUuIgotICAgIFxwYXJhbSAicHJldiIgICAiUG9pbnRlciB0byB0aGUgcmVmZXJlbmNlIGZyYW1lLiIKLSAgICBccGFyYW0gImN1ciIgICAgIlBvaW50ZXIgdG8gdGhlIGlucHV0IG1hY3JvYmxvY2suIgotICAgIFxwYXJhbSAiaW1pbiIgICAiUG9pbnRlciB0byBtaW5pbWFsIG12ICh4KS4iCi0gICAgXHBhcmFtICJqbWluIiAgICJQb2ludGVyIHRvIG1pbmltYWwgbXYgKHkpLiIKLSAgICBccGFyYW0gImlsb3csIGloaWdoLCBqbG93LCBqaGlnaCIgICAiTG93ZXIgYm91bmQgb24gc2VhcmNoIHJhbmdlLiIKLSAgICBccGFyYW0gImNtdngsIGNtdnkiICJQcmVkaWN0ZWQgTVYgdmFsdWUuIgotCi0gICAgXHJldHVybiAiVGhlIGNvc3QgZnVuY3Rpb24gb2YgdGhlIGJlc3QgY2FuZGlkYXRlLiIKLSAgICAqLwotICAgIGludCBBVkNGdWxsU2VhcmNoKEFWQ0VuY09iamVjdCAqZW5jdmlkLCB1aW50OCAqcHJldiwgdWludDggKmN1ciwKLSAgICAgICAgICAgICAgICAgICAgICBpbnQgKmltaW4sIGludCAqam1pbiwgaW50IGlsb3csIGludCBpaGlnaCwgaW50IGpsb3csIGludCBqaGlnaCwKLSAgICAgICAgICAgICAgICAgICAgICBpbnQgY212eCwgaW50IGNtdnkpOwotCi0gICAgLyoqCi0gICAgU2VsZWN0IGNhbmRpZGF0ZXMgZnJvbSBuZWlnaGJvcmluZyBibG9ja3MgYW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IE9GIEFOWSBLSU5ELCBlaXRoZXIKLSAqIGV4cHJlc3Mgb3IgaW1wbGllZC4KLSAqIFNlZSB0aGUgTGljZW5zZSBmb3IgdGhlIHNwZWNpZmljIGxhbmd1YWdlIGdvdmVybmluZyBwZXJtaXNzaW9ucwotICogYW5kIGxpbWl0YXRpb25zIHVuZGVyIHRoZSBMaWNlbnNlLgotICogLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLQotICovCi0jaW5jbHVkZSAiYXZjZW5jX2xpYi5oIgotCi0jZGVmaW5lIFdPUkRfU0laRSAzMgotCi0vKiBhcnJheSBmb3IgdHJhaWxpbmcgYml0IHBhdHRlcm4gYXMgZnVuY3Rpb24gb2YgbnVtYmVyIG9mIGJpdHMgKi8KLS8qIHRoZSBmaXJzdCBvbmUgaXMgdW51c2VkLiAqLwotY29uc3Qgc3RhdGljIHVpbnQ4IHRyYWlsaW5nX2JpdHNbOV0gPSB7MCwgMHgxLCAweDIsIDB4NCwgMHg4LCAweDEwLCAweDIwLCAweDQwLCAweDgwfTsKLQotLyogPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09ICovCi0vKiAgRnVuY3Rpb24gOiBCaXRzdHJlYW1Jbml0KCkgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICBEYXRlICAgICA6IDExLzQvMjAwMyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogIFB1cnBvc2UgIDogUG9wdWxhdGUgYml0c3RyZWFtIHN0cnVjdHVyZSB3aXRoIGJpdHN0cmVhbSBidWZmZXIgYW5kIHNpemUgICovCi0vKiAgICAgICAgICAgICBpdCBhbHNvIGluaXRpYWxpemVzIGludGVybmFsIGRhdGEgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICBJbi9vdXQgICA6ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogIFJldHVybiAgIDogQVZDRU5DX1NVQ0NFU1MgaWYgc3VjY2Vzc2VkLCBBVkNFTkNfRkFJTCBpZiBmYWlsZWQuICAgICAgICAgICAgICAqLwotLyogIE1vZGlmaWVkIDogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0gKi8KLS8qIHwtLS0tLS0tLXwtLS0tLS0tLXwtLS0tfn5+fn4tLS0tLXwtLS0tLS0tLS18LS0tLS0tLS0tfC0tLS0tLS0tLXwKLSAgIF4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBed3JpdGVfcG9zICAgICAgICAgIF5idWZfc2l6ZQotICAgYml0c3RyZWFtQnVmZmVyICAgICAgICAgICAgICAgICAgPC0tLS0tLS0tLT4KLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGN1cnJlbnRfd29yZAotCi0gICB8LS0tLS14eHh4eHh4eHh4eHh4fCAgPSBjdXJyZW50X3dvcmQgMzIgb3IgMTYgYml0cwotICAgIDwtLS0tPgotICAgICBiaXRfbGVmdAotID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PSAqLwotCi1BVkNFbmNfU3RhdHVzIEJpdHN0cmVhbUVuY0luaXQoQVZDRW5jQml0c3RyZWFtICpzdHJlYW0sIHVpbnQ4ICpidWZmZXIsIGludCBidWZfc2l6ZSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB1aW50OCAqb3ZlcnJ1bkJ1ZmZlciwgaW50IG9CU2l6ZSkKLXsKLSAgICBpZiAoc3RyZWFtID09IE5VTEwgfHwgYnVmZmVyID09IE5VTEwgfHwgYnVmX3NpemUgPD0gMCkKLSAgICB7Ci0gICAgICAgIHJldHVybiBBVkNFTkNfQklUU1RSRUFNX0lOSVRfRkFJTDsKLSAgICB9Ci0KLSAgICBzdHJlYW0tPmJpdHN0cmVhbUJ1ZmZlciA9IGJ1ZmZlcjsKLQotICAgIHN0cmVhbS0+YnVmX3NpemUgPSBidWZfc2l6ZTsKLQotICAgIHN0cmVhbS0+d3JpdGVfcG9zID0gMDsKLQotICAgIHN0cmVhbS0+Y291bnRfemVyb3MgPSAwOwotCi0gICAgc3RyZWFtLT5jdXJyZW50X3dvcmQgPSAwOwotCi0gICAgc3RyZWFtLT5iaXRfbGVmdCA9IFdPUkRfU0laRTsKLQotICAgIHN0cmVhbS0+b3ZlcnJ1bkJ1ZmZlciA9IG92ZXJydW5CdWZmZXI7Ci0KLSAgICBzdHJlYW0tPm9CU2l6ZSA9IG9CU2l6ZTsKLQotICAgIHJldHVybiBBVkNFTkNfU1VDQ0VTUzsKLX0KLQotLyogPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09ICovCi0vKiAgRnVuY3Rpb24gOiBBVkNCaXRzdHJlYW1TYXZlV29yZCgpICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgRGF0ZSAgICAgOiAzLzI5LzIwMDQgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICBQdXJwb3NlICA6IFNhdmUgdGhlIGN1cnJlbnRfd29yZCBpbnRvIHRoZSBidWZmZXIsIGJ5dGUtc3dhcCwgYW5kICAgICAgICAqLwotLyogICAgICAgICAgICAgIGFkZCBlbXVsYXRpb24gcHJldmVudGlvbiBpbnNlcnRpb24uICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgSW4vb3V0ICAgOiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICBSZXR1cm4gICA6IEFWQ0VOQ19TVUNDRVNTIGlmIHN1Y2Nlc3NlZCwgQVZDRU5DX1dSSVRFX0ZBSUwgaWYgYnVmZmVyIGlzICAqLwotLyogICAgICAgICAgICAgIGZ1bGwuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgTW9kaWZpZWQgOiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PSAqLwotQVZDRW5jX1N0YXR1cyBBVkNCaXRzdHJlYW1TYXZlV29yZChBVkNFbmNCaXRzdHJlYW0gKnN0cmVhbSkKLXsKLSAgICBpbnQgbnVtX2JpdHM7Ci0gICAgdWludDggKndyaXRlX3BudCwgYnl0ZTsKLSAgICB1aW50IGN1cnJlbnRfd29yZDsKLQotICAgIC8qIGNoZWNrIG51bWJlciBvZiBieXRlcyBpbiBjdXJyZW50X3dvcmQsIG11c3QgYWx3YXlzIGJlIGJ5dGUtYWxpZ25lZCEhISEgKi8KLSAgICBudW1fYml0cyA9IFdPUkRfU0laRSAtIHN0cmVhbS0+Yml0X2xlZnQ7IC8qIG11c3QgYmUgbXVsdGlwbGUgb2YgOCAhISovCi0KLSAgICBpZiAoc3RyZWFtLT5idWZfc2l6ZSAtIHN0cmVhbS0+d3JpdGVfcG9zIDw9IChudW1fYml0cyA+PiAzKSArIDIpIC8qIDIgbW9yZSBieXRlcyBmb3IgcG9zc2libGUgRVBCUyAqLwotICAgIHsKLSAgICAgICAgaWYgKEFWQ0VOQ19TVUNDRVNTICE9IEFWQ0JpdHN0cmVhbVVzZU92ZXJydW5CdWZmZXIoc3RyZWFtLCAobnVtX2JpdHMgPj4gMykgKyAyKSkKLSAgICAgICAgewotICAgICAgICAgICAgcmV0dXJuIEFWQ0VOQ19CSVRTVFJFQU1fQlVGRkVSX0ZVTEw7Ci0gICAgICAgIH0KLSAgICB9Ci0KLSAgICAvKiB3cml0ZSB3b3JkLCBieXRlLWJ5LWJ5dGUgKi8KLSAgICB3cml0ZV9wbnQgPSBzdHJlYW0tPmJpdHN0cmVhbUJ1ZmZlciArIHN0cmVhbS0+d3JpdGVfcG9zOwotICAgIGN1cnJlbnRfd29yZCA9IHN0cmVhbS0+Y3VycmVudF93b3JkOwotICAgIHdoaWxlIChudW1fYml0cykgLyogbm8gbmVlZCB0byBjaGVjayBzdHJlYW0tPmJ1Zl9zaXplIGFuZCBzdHJlYW0tPndyaXRlX3BvcywgdGFrZW4gY2FyZSBhbHJlYWR5ICovCi0gICAgewotICAgICAgICBudW1fYml0cyAtPSA4OwotICAgICAgICBieXRlID0gKGN1cnJlbnRfd29yZCA+PiBudW1fYml0cykgJiAweEZGOwotICAgICAgICBpZiAoYnl0ZSAhPSAwKQotICAgICAgICB7Ci0gICAgICAgICAgICAqd3JpdGVfcG50KysgPSBieXRlOwotICAgICAgICAgICAgc3RyZWFtLT53cml0ZV9wb3MrKzsKLSAgICAgICAgICAgIHN0cmVhbS0+Y291bnRfemVyb3MgPSAwOwotICAgICAgICB9Ci0gICAgICAgIGVsc2UKLSAgICAgICAgewotICAgICAgICAgICAgc3RyZWFtLT5jb3VudF96ZXJvcysrOwotICAgICAgICAgICAgKndyaXRlX3BudCsrID0gYnl0ZTsKLSAgICAgICAgICAgIHN0cmVhbS0+d3JpdGVfcG9zKys7Ci0gICAgICAgICAgICBpZiAoc3RyZWFtLT5jb3VudF96ZXJvcyA9PSAyKQotICAgICAgICAgICAgeyAgIC8qIGZvciBudW1fYml0cyA9IDMyLCB0aGlzIGNhbiBhZGQgMiBtb3JlIGJ5dGVzIGV4dHJhIGZvciBFUEJTICovCi0gICAgICAgICAgICAgICAgKndyaXRlX3BudCsrID0gMHgzOwotICAgICAgICAgICAgICAgIHN0cmVhbS0+d3JpdGVfcG9zKys7Ci0gICAgICAgICAgICAgICAgc3RyZWFtLT5jb3VudF96ZXJvcyA9IDA7Ci0gICAgICAgICAgICB9Ci0gICAgICAgIH0KLSAgICB9Ci0KLSAgICAvKiByZXNldCBjdXJyZW50X3dvcmQgYW5kIGJpdF9sZWZ0ICovCi0gICAgc3RyZWFtLT5jdXJyZW50X3dvcmQgPSAwOwotICAgIHN0cmVhbS0+Yml0X2xlZnQgPSBXT1JEX1NJWkU7Ci0KLSAgICByZXR1cm4gQVZDRU5DX1NVQ0NFU1M7Ci19Ci0KLS8qID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PSAqLwotLyogIEZ1bmN0aW9uIDogQml0c3RyZWFtV3JpdGVCaXRzKCkgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgRGF0ZSAgICAgOiAzLzI5LzIwMDQgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICBQdXJwb3NlICA6IFdyaXRlIHVwIHRvIG1hY2hpbmUgd29yZC4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogIEluL291dCAgIDogVW51c2VkIGJpdHMgaW4gJ2NvZGUnIG11c3QgYmUgYWxsIHplcm9zLiAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgUmV0dXJuICAgOiBBVkNFTkNfU1VDQ0VTUyBpZiBzdWNjZXNzZWQsIEFWQ0VOQ19XUklURV9GQUlMIGlmIGJ1ZmZlciBpcyAgKi8KLS8qICAgICAgICAgICAgICBmdWxsLiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogIE1vZGlmaWVkIDogICA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XRfbGVmdCA9PSAwKSAvKiBwcmVwYXJlIGZvciB0aGUgbmV4dCB3b3JkICovCi0gICAgICAgIHsKLSAgICAgICAgICAgIHN0YXR1cyA9IEFWQ0JpdHN0cmVhbVNhdmVXb3JkKHN0cmVhbSk7Ci0gICAgICAgICAgICByZXR1cm4gc3RhdHVzOwotICAgICAgICB9Ci0gICAgfQotICAgIGVsc2UKLSAgICB7Ci0gICAgICAgIHN0cmVhbS0+Y3VycmVudF93b3JkID0gKGN1cnJlbnRfd29yZCA8PCBiaXRfbGVmdCkgfCAoY29kZSA+PiAobkJpdHMgLSBiaXRfbGVmdCkpOwotCi0gICAgICAgIG5CaXRzIC09IGJpdF9sZWZ0OwotCi0gICAgICAgIHN0cmVhbS0+Yml0X2xlZnQgPSAwOwotCi0gICAgICAgIHN0YXR1cyA9IEFWQ0JpdHN0cmVhbVNhdmVXb3JkKHN0cmVhbSk7IC8qIHNhdmUgY3VycmVudCB3b3JkICovCi0KLSAgICAgICAgc3RyZWFtLT5iaXRfbGVmdCA9IFdPUkRfU0laRSAtIG5CaXRzOwotCi0gICAgICAgIHN0cmVhbS0+Y3VycmVudF93b3JkID0gY29kZTsgLyogbm8gZXh0cmEgbWFza2luZyBmb3IgY29kZSwgbXVzdCBiZSBoYW5kbGVkIGJlZm9yZSBzYXZpbmcgKi8KLSAgICB9Ci0KLSAgICByZXR1cm4gc3RhdHVzOwotfQotCi0KLS8qID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PSAqLwotLyogIEZ1bmN0aW9uIDogQml0c3RyZWFtV3JpdGUxQml0KCkgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgRGF0ZSAgICAgOiAzLzMwLzIwMDQgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICBQdXJwb3NlICA6IFdyaXRlIDEgYml0ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogIEluL291dCAgIDogVW51c2VkIGJpdHMgaW4gJ2NvZGUnIG11c3QgYmUgYWxsIHplcm9zLiAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgUmV0dXJuICAgOiBBVkNFTkNfU1VDQ0VTUyBpZiBzdWNjZXNzZWQsIEFWQ0VOQ19XUklURV9GQUlMIGlmIGJ1ZmZlciBpcyAgKi8KLS8qICAgICAgICAgICAgICBmdWxsLiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogIE1vZGlmaWVkIDogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0gKi8KLUFWQ0VuY19TdGF0dXMgQml0c3RyZWFtV3JpdGUxQml0KEFWQ0VuY0JpdHN0cmVhbSAqc3RyZWFtLCB1aW50IGNvZGUpCi17Ci0gICAgQVZDRW5jX1N0YXR1cyBzdGF0dXM7Ci0gICAgdWludCBjdXJyZW50X3dvcmQgPSBzdHJlYW0tPmN1cnJlbnRfd29yZDsKLQotICAgIC8vREVCVUdfTE9HKHVzZXJEYXRhLEFWQ19MT0dUWVBFX0lORk8sIkJpdHN0cmVhbVdyaXRlMUJpdCIsY29kZSwtMSk7Ci0KLSAgICAvL2lmKDEgPD0gYml0X2xlZnQpIC8qIG1vcmUgYml0cyBsZWZ0IGluIGN1cnJlbnRfd29yZCAqLwotICAgIC8qIHdlIGNhbiBhc3N1bWUgdGhhdCB0aGVyZSBhbHdheXMgYmUgcG9zaXRpdmUgYml0X2xlZnQgaW4gdGhlIGN1cnJlbnQgd29yZCAqLwotICAgIHN0cmVhbS0+Y3VycmVudF93b3JkID0gKGN1cnJlbnRfd29yZCA8PCAxKSB8IGNvZGU7Ci0gICAgc3RyZWFtLT5iaXRfbGVmdC0tOwotICAgIGlmIChzdHJlYW0tPmJpdF9sZWZ0ID09IDApIC8qIHByZXBhcmUgZm9yIHRoZSBuZXh0IHdvcmQgKi8KLSAgICB7Ci0gICAgICAgIHN0YXR1cyA9IEFWQ0JpdHN0cmVhbVNhdmVXb3JkKHN0cmVhbSk7Ci0gICAgICAgIHJldHVybiBzdGF0dXM7Ci0gICAgfQotCi0gICAgcmV0dXJuIEFWQ0VOQ19TVUNDRVNTOwotfQotCi0KLS8qID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PSAqLwotLyogIEZ1bmN0aW9uIDogQml0c3RyZWFtVHJhaWxpbmdCaXRzKCkgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgRGF0ZSAgICAgOiAzLzMxLzIwMDQgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICBQdXJwb3NlICA6IEFkZCB0cmFpbGluZyBiaXRzIGFuZCByZXBvcnQgdGhlIGZpbmFsIEVCU1Agc2l6ZS4gICAgICAgICAgICAqLwotLyogIEluL291dCAgIDogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgUmV0dXJuICAgOiBBVkNFTkNfU1VDQ0VTUyBpZiBzdWNjZXNzZWQsIEFWQ0VOQ19XUklURV9GQUlMIGlmIGJ1ZmZlciBpcyAgKi8KLS8qICAgICAgICAgICAgICBmdWxsLiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogIE1vZGlmaWVkIDogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiA9PT09PT09PT09PT09PT09PT09P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ICAgICAgICAgaWYgKGVuY3ZpZC0+b3ZlcnJ1bkJ1ZmZlcikKLSAgICAgICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgICAgIGVuY3ZpZC0+YXZjSGFuZGxlLT5DQkFWQ19GcmVlKCh1aW50MzIqKWVuY3ZpZC0+YXZjSGFuZGxlLT51c2VyRGF0YSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKGludCllbmN2aWQtPm92ZXJydW5CdWZmZXIpOwotICAgICAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgICAgIGVuY3ZpZC0+b0JTaXplID0gc3RyZWFtLT5vQlNpemU7Ci0gICAgICAgICAgICAgICAgZW5jdmlkLT5vdmVycnVuQnVmZmVyID0gKHVpbnQ4KikgZW5jdmlkLT5hdmNIYW5kbGUtPkNCQVZDX01hbGxvYyhlbmN2aWQtPmF2Y0hhbmRsZS0+dXNlckRhdGEsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc3RyZWFtLT5vQlNpemUsIERFRkFVTFRfQVRUUik7Ci0KLSAgICAgICAgICAgICAgICBzdHJlYW0tPm92ZXJydW5CdWZmZXIgPSBlbmN2aWQtPm92ZXJydW5CdWZmZXI7Ci0gICAgICAgICAgICAgICAgaWYgKHN0cmVhbS0+b3ZlcnJ1bkJ1ZmZlciA9PSBOVUxMKQotICAgICAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAgICAgcmV0dXJuIEFWQ0VOQ19GQUlMOwotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgLy8gY29weSBldmVyeXRoaW5nIHRvIG92ZXJydW4gYnVmZmVyIGFuZCBzdGFydCB1c2luZyBpdC4KLSAgICAgICAgICAgIG1lbWNweShzdHJlYW0tPm92ZXJydW5CdWZmZXIsIHN0cmVhbS0+Yml0c3RyZWFtQnVmZmVyLCBzdHJlYW0tPndyaXRlX3Bvcyk7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Jsb2NrOwotICAgIHVpbnQ4ICpwcmVkID0gdmlkZW8tPnByZWRfYmxvY2s7IC8vIHNpemUgMTYgZm9yIGEgNHg0IGJsb2NrCi0gICAgaW50IHByZWRfcGl0Y2ggPSB2aWRlby0+cHJlZF9waXRjaDsKLSAgICBpbnQgcjAsIHIxLCByMiwgcjMsIGosIGssIGlkeDsKLSAgICBpbnQgKmxldmVsLCAqcnVuOwotICAgIGludCBRcSwgUnEsIHFfYml0cywgcXBfY29uc3QsIHF1YW50OwotICAgIGludCBkYXRhLCBsZXYsIHplcm9fcnVuOwotICAgIGludCBudW1jb2VmZjsKLQotICAgIGNvZWYgKz0gKChibGtpZHggJiAweDMpIDw8IDIpICsgKChibGtpZHggPj4gMikgPDwgNik7IC8qIHBvaW50IHRvIHRoZSA0eDQgYmxvY2sgKi8KLQotICAgIC8qIGZpcnN0IHRha2UgYSA0eDQgdHJhbnNmb3JtICovCi0gICAgLyogaG9yaXpvbnRhbCAqLwotICAgIGogPSA0OwotICAgIHdoaWxlIChqID4gMCkKLSAgICB7Ci0gICAgICAgIC8qIGNhbGN1bGF0ZSB0aGUgcmVzaWR1ZSBmaXJzdCAqLwotICAgICAgICByMCA9IG9yZ1swXSAtIHByZWRbMF07ICAgLyogT1BUSU1JWkVBQkxFICovCi0gICAgICAgIHIxID0gb3JnWzFdIC0gcHJlZFsxXTsKLSAgICAgICAgcjIgPSBvcmdbMl0gLSBwcmVkWzJdOwotICAgICAgICByMyA9IG9yZ1szXSAtIHByZWRbM107Ci0KLSAgICAgICAgcjAgKz0gcjM7ICAgICAgICAgICAvL3B0clswXSArIHB0clszXTsKLSAgICAgICAgcjMgPSByMCAtIChyMyA8PCAxKTsgICAgLy9wdHJbMF0gLSBwdHJbM107Ci0gICAgICAgIHIxICs9IHIyOyAgICAgICAgICAgLy9wdHJbMV0gKyBwdHJbMl07Ci0gICAgICAgIHIyID0gcjEgLSAocjIgPDwgMSk7ICAgIC8vcHRyWzFdIC0gcHRyWzJdOwotCi0gICAgICAgIGNvZWZbMF0gPSByMCArIHIxOwotICAgICAgICBjb2VmWzJdID0gcjAgLSByMTsKLSAgICAgICAgY29lZlsxXSA9IChyMyA8PCAxKSArIHIyOwotICAgICAgICBjb2VmWzNdID0gcjMgLSAocjIgPDwgMSk7Ci0KLSAgICAgICAgY29lZiArPSAxNjsKLSAgICAgICAgb3JnICs9IG9yZ19waXRjaDsKLSAgICAgICAgcHJlZCArPSBwcmVkX3BpdGNoOwotICAgICAgICBqLS07Ci0gICAgfQotICAgIC8qIHZlcnRpY2FsICovCi0gICAgY29lZiAtPSA2NDsKLSAgICBwcmVkIC09IChwcmVkX3BpdGNoIDw8IDIpOwotICAgIGogPSA0OwotICAgIHdoaWxlIChqID4gMCkgICAvKiBPUFRJTUlaQUJMRSAqLwotICAgIHsKLSAgICAgICAgcjAgPSBjb2VmWzBdICsgY29lZls0OF07Ci0gICAgICAgIHIzID0gY29lZlswXSAtIGNvZWZbNDhdOwotICAgICAgICByMSA9IGNvZWZbMTZdICsgY29lZlszMl07Ci0gICAgICAgIHIyID0gY29lZlsxNl0gLSBjb2VmWzMyXTsKLQotICAgICAgICBjb2VmWzBdID0gcjAgKyByMTsKLSAgICAgICAgY29lZlszMl0gPSByMCAtIHIxOwotICAgICAgICBjb2VmWzE2XSA9IChyMyA8PCAxKSArIHIyOwotICAgICAgICBjb2VmWzQ4XSA9IHIzIC0gKHIyIDw8IDEpOwotCi0gICAgICAgIGNvZWYrKzsKLSAgICAgICAgai0tOwotICAgIH0KLQotICAgIGNvZWYgLT0gNDsKLQotICAgIC8qIHF1YW50ICovCi0gICAgbGV2ZWwgPSBlbmN2aWQtPmxldmVsW3JhczJkZWNbYmxraWR4XV07Ci0gICAgcnVuID0gZW5jdmlkLT5ydW5bcmFzMmRlY1tibGtpZHhdXTsKLQotICAgIFJxID0gdmlkZW8tPlFQeV9tb2RfNjsKLSAgICBRcSA9IHZpZGVvLT5RUHlfZGl2XzY7Ci0gICAgcXBfY29uc3QgPSBlbmN2aWQtPnFwX2NvbnN0OwotICAgIHFfYml0cyA9IDE1ICsgUXE7Ci0KLSAgICB6ZXJvX3J1biA9IDA7Ci0gICAgbnVtY29lZmYgPSAwOwotICAgIGZvciAoayA9IDA7IGsgPCAxNjsgaysrKQotICAgIHsKLSAgICAgICAgaWR4ID0gWlpfU0NBTl9CTE9DS1trXTsgLyogbWFwIGJhY2sgdG8gcmFzdGVyIHNjYW4gb3JkZXIgKi8KLSAgICAgICAgZGF0YSA9IGNvZWZbaWR4XTsKLSAgICAgICAgcXVhbnQgPSBxdWFudF9jb2VmW1JxXVtrXTsKLSAgICAgICAgaWYgKGRhdGEgPiAwKQotICAgICAgICB7Ci0gICAgICAgICAgICBsZXYgPSBkYXRhICogcXVhbnQgKyBxcF9jb25zdDsKLSAgICAgICAgfQotICAgICAgICBlbHNlCi0gICAgICAgIHsKLSAgICAgICAgICAgIGxldiA9IC1kYXRhICogcXVhbnQgKyBxcF9jb25zdDsKLSAgICAgICAgfQotICAgICAgICBsZXYgPj49IHFfYml0czsKLSAgICAgICAgaWYgKGxldikKLSAgICAgICAgewotICAgICAgICAgICAgKmNvZWZfY29zdCArPSAoKGxldiA+IDEpID8gTUFYX1ZBTFVFIDogQ09FRkZfQ09TVFtESVNBQkxFX1RIUkVTSE9MRElOR11bemVyb19ydW5dKTsKLQotICAgICAgICAgICAgLyogZGVxdWFudCAqLwotICAgICAgICAgICAgcXVhbnQgPSBkZXF1YW50X2NvZWZyZXNbUnFdW2tdOwotICAgICAgICAgICAgaWYgKGRhdGEgPiAwKQotICAgICAgICAgICAgewotICAgICAgICAgICAgICAgIGxldmVsW251bWNvZWZmXSA9IGxldjsKLSAgICAgICAgICAgICAgICBjb2VmW2lkeF0gPSAobGV2ICogcXVhbnQpIDw8IFFxOwotICAgICAgICAgICAgfQotICAgICAgICAgICAgZWxzZQotICAgICAgICAgICAgewotICAgICAgICAgICAgICAgIGxldmVsW251bWNvZWZmXSA9IC1sZXY7Ci0gICAgICAgICAgICAgICAgY29lZltpZHhdID0gKC1sZXYgKiBxdWFudCkgPDwgUXE7Ci0gICAgICAgICAgICB9Ci0gICAgICAgICAgICBydW5bbnVtY29lZmYrK10gPSB6ZXJvX3J1bjsKLSAgICAgICAgICAgIHplcm9fcnVuID0gMDsKLSAgICAgICAgfQotICAgICAgICBlbHNlCi0gICAgICAgIHsKLSAgICAgICAgICAgIHplcm9fcnVuKys7Ci0gICAgICAgICAgICBjb2VmW2lkeF0gPSAwOwotICAgICAgICB9Ci0gICAgfQotCi0gICAgaWYgKHZpZGVvLT5jdXJyTUItPm1iX2ludHJhKSAvLyBvbmx5IGRvIGludmVyc2UgdHJhbnNmb3JtIHdpdGggaW50cmEgYmxvY2sKLSAgICB7Ci0gICAgICAgIGlmIChudW1jb2VmZikgLyogdGhlbiBkbyBpbnZlcnNlIHRyYW5zZm9ybSAqLwotICAgICAgICB7Ci0gICAgICAgICAgICBmb3IgKGogPSA0OyBqID4gMDsgai0tKSAvKiBob3Jpem9udGFsICovCi0gICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgcjAgPSBjb2VmWzBdICsgY29lZlsyXTsKLSAgICAgICAgICAgICAgICByMSA9IGNvZWZbMF0gLSBjb2VmWzJdOwotICAgICAgICAgICAgICAgIHIyID0gKGNvZWZbMV0gPj4gMSkgLSBjb2VmWzNdOwotICAgICAgICAgICAgICAgIHIzID0gY29lZlsxXSArIChjb2VmWzNdID4+IDEpOwotCi0gICAgICAgICAgICAgICAgY29lZlswXSA9IHIwICsgcjM7Ci0gICAgICAgICAgICAgICAgY29lZlsxXSA9IHIxICsgcjI7Ci0gICAgICAgICAgICAgICAgY29lZlsyXSA9IHIxIC0gcjI7Ci0gICAgICAgICAgICAgICAgY29lZlszXSA9IHIwIC0gcjM7Ci0KLSAgICAgICAgICAgICAgICBjb2VmICs9IDE2OwotICAgICAgICAgICAgfQotCi0gICAgICAgICAgICBjb2VmIC09IDY0OwotICAgICAgICAgICAgZm9yIChqID0gNDsgaiA+IDA7IGotLSkgLyogdmVydGljYWwsIGhhcyB0byBiZSBkb25lIGFmdGVyIGhvcml6b250YWwgKi8KLSAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICByMCA9IGNvZWZbMF0gKyBjb2VmWzMyXTsKLSAgICAgICAgICAgICAgICByMSA9IGNvZWZbMF0gLSBjb2VmWzMyXTsKLSAgICAgICAgICAgICAgICByMiA9IChjb2VmWzE2XSA+PiAxKSAtIGNvZWZbNDhdOwotICAgICAgICAgICAgICAgIHIzID0gY29lZlsxNl0gKyAoY29lZls0OF0gPj4gMSk7Ci0gICAgICAgICAgICAgICAgcjAgKz0gcjM7Ci0gICAgICAgICAgICAgICAgcjMgPSAocjAgLSAocjMgPDwgMSkpOyAvKiByMC1yMyAqLwotICAgICAgICAgICAgICAgIHIxICs9IHIyOwotICAgICAgICAgICAgICAgIHIyID0gKHIxIC0gKHIyIDw8IDEpKTsgLyogcjEtcjIgKi8KLSAgICAgICAgICAgICAgICByMCArPSAzMjsKLSAgICAgICAgICAgICAgICByMSArPSAzMjsKLSAgICAgICAgICAgICAgICByMiArPSAzMjsKLSAgICAgICAgICAgICAgICByMyArPSAzMjsKLQotICAgICAgICAgICAgICAgIHIwID0gcHJlZFswXSArIChyMCA+PiA2KTsKLSAgICAgICAgICAgICAgICBpZiAoKHVpbnQpcjAgPiAweEZGKSAgIHIwID0gMHhGRiAmICh+KHIwID4+IDMxKSk7ICAvKiBjbGlwICovCi0gICAgICAgICAgICAgICAgcjEgPSAqKHByZWQgKz0gcHJlZF9waXRjaCkgKyAocjEgPj4gNik7Ci0gICAgICAgICAgICAgICAgaWYgKCh1aW50KXIxID4gMHhGRikgICByMSA9IDB4RkYgJiAofihyMSA+PiAzMSkpOyAgLyogY2xpcCAqLwotICAgICAgICAgICAgICAgIHIyID0gKihwcmVkICs9IHByZWRfcGl0Y2gpICsgKHIyID4+IDYpOwotICAgICAgICAgICAgICAgIGlmICgodWludClyMiA+IDB4RkYpICAgcjIgPSAweEZGICYgKH4ocjIgPj4gMzEpKTsgIC8qIGNsaXAgKi8KLSAgICAgICAgICAgICAgICByMyA9IHByZWRbcHJlZF9waXRjaF0gKyAocjMgPj4gNik7Ci0gICAgICAgICAgICAgICAgaWYgKCh1aW50KXIzID4gMHhGRikgICByMyA9IDB4RkYgJiAofihyMyA+PiAzMSkpOyAgLyogY2xpcCAqLwotCi0gICAgICAgICAgICAgICAgKmN1ciA9IHIwOwotICAgICAgICAgICAgICAgICooY3VyICs9IHBpdGNoKSA9IHIxOwotICAgICAgICAgICAgICAgICooY3VyICs9IHBpdGNoKSA9IHIyOwotICAgICAgICAgICAgICAgIGN1cltwaXRjaF0gPSByMzsKLSAgICAgICAgICAgICAgICBjdXIgLT0gKHBpdGNoIDw8IDEpOwotICAgICAgICAgICAgICAgIGN1cisrOwotICAgICAgICAgICAgICAgIHByZWQgLT0gKHByZWRfcGl0Y2ggPDwgMSk7Ci0gICAgICAgICAgICAgICAgcHJlZCsrOwotICAgICAgICAgICAgICAgIGNvZWYrKzsKLSAgICAgICAgICAgIH0KLSAgICAgICAgfQotICAgICAgICBlbHNlICAvLyBjb3B5IGZyb20gcHJlZCB0byBjdXIKLSAgICAgICAgewotICAgICAgICAgICAgKigodWludDMyKiljdXIpID0gKigodWludDMyKilwcmVkKTsKLSAgICAgICAgICAgICooKHVpbnQzMiopKGN1ciArPSBwaXRjaCkpID0gKigodWludDMyKikocHJlZCArPSBwcmVkX3BpdGNoKSk7Ci0gICAgICAgICAgICAqKCh1aW50MzIqKShjdXIgKz0gcGl0Y2gpKSA9ICooKHVpbnQzMiopKHByZWQgKz0gcHJlZF9waXRjaCkpOwotICAgICAgICAgICAgKigodWludDMyKikoY3VyICs9IHBpdGNoKSkgPSAqKCh1aW50MzIqKShwcmVkICs9IHByZWRfcGl0Y2gpKTsKLSAgICAgICAgfQotICAgIH0KLQotICAgIHJldHVybiBudW1jb2VmZjsKLX0KLQotCi12b2lkIE1CSW50ZXJJZGN0KEFWQ0NvbW1vbk9iaiAqdmlkZW8sIHVpbnQ4ICpjdXJMLCBBVkNNYWNyb2Jsb2NrICpjdXJyTUIsIGludCBwaWNQaXRjaCkKLXsKLSAgICBpbnQxNiAqY29lZiwgKmNvZWY4ID0gdmlkZW8tPmJsb2NrOwotICAgIHVpbnQ4ICpjdXI7ICAvLyB0aGUgc2FtZSBhcyBjdXJMCi0gICAgaW50IGI4LCBiNDsKLSAgICBpbnQgcjAsIHIxLCByMiwgcjMsIGosIGJsa2lkeDsKLQotICAgIGZvciAoYjggPSAwOyBiOCA8IDQ7IGI4KyspCi0gICAgewotICAgICAgICBjdXIgPSBjdXJMOwotICAgICAgICBjb2VmID0gY29lZjg7Ci0KLSAgICAgICAgaWYgKGN1cnJNQi0+Q0JQJigxIDw8IGI4KSkKLSAgICAgICAgewotICAgICAgICAgICAgZm9yIChiNCA9IDA7IGI0IDwgNDsgYjQrKykKLSAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICBibGtpZHggPSBibGtJZHgyYmxrWFlbYjhdW2I0XTsKLSAgICAgICAgICAgICAgICAvKiBkbyBJRENUICovCi0gICAgICAgICAgICAgICAgaWYgKGN1cnJNQi0+bnpfY29lZmZbYmxraWR4XSkKLSAgICAgICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgICAgIGZvciAoaiA9IDQ7IGogPiAwOyBqLS0pIC8qIGhvcml6b250YWwgKi8KLSAgICAgICAgICAgICAgICAgICAgewotICAgICAgICAgICAgICAgICAgICAgICAgcjAgPSBjb2VmWzBdICsgY29lZlsyXTsKLSAgICAgICAgICAgICAgICAgICAgICAgIHIxID0gY29lZlswXSAtIGNvZWZbMl07Ci0gICAgICAgICAgICAgICAgICAgICAgICByMiA9IChjb2VmWzFdID4+IDEpIC0gY29lZlszXTsKLSAgICAgICAgICAgICAgICAgICAgICAgIHIzID0gY29lZlsxXSArIChjb2VmWzNdID4+IDEpOwotCi0gICAgICAgICAgICAgICAgICAgICAgICBjb2VmWzBdID0gcjAgKyByMzsKLSAgICAgICAgICAgICAgICAgICAgICAgIGNvZWZbMV0gPSByMSArIHIyOwotICAgICAgICAgICAgICAgICAgICAgICAgY29lZlsyXSA9IHIxIC0gcjI7Ci0gICAgICAgICAgICAgICAgICAgICAgICBjb2VmWzNdID0gcjAgLSByMzsKLQotICAgICAgICAgICAgICAgICAgICAgICAgY29lZiArPSAxNjsKLSAgICAgICAgICAgICAgICAgICAgfQotCi0gICAgICAgICAgICAgICAgICAgIGNvZWYgLT0gNjQ7Ci0gICAgICAgICAgICAgICAgICAgIGZvciAoaiA9IDQ7IGogPiAwOyBqLS0pIC8qIHZlcnRpY2FsLCBoYXMgdG8gYmUgZG9uZSBhZnRlciBob3Jpem9udGFsICovCi0gICAgICAgICAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAgICAgICAgIHIwID0gY29lZlswXSArIGNvZWZbMzJdOwotICAgICAgICAgICAgICAgICAgICAgICAgcjEgPSBjb2VmWzBdIC0gY29lZlszMl07Ci0gICAgICAgICAgICAgICAgICAgICAgICByMiA9IChjb2VmWzE2XSA+PiAxKSAtIGNvZWZbNDhdOwotICAgICAgICAgICAgICAgICAgICAgICAgcjMgPSBjb2VmWzE2XSArIChjb2VmWzQ4XSA+PiAxKTsKLSAgICAgICAgICAgICAgICAgICAgICAgIHIwICs9IHIzOwotICAgICAgICAgICAgICAgICAgICAgICAgcjMgPSAocjAgLSAocjMgPDwgMSkpOyAvKiByMC1yMyAqLwotICAgICAgICAgICAgICAgICAgICAgICAgcjEgKz0gcjI7Ci0gICAgICAgICAgICAgICAgICAgICAgICByMiA9IChyMSAtIChyMiA8PCAxKSk7IC8qIHIxLXIyICovCi0gICAgICAgICAgICAgICAgICAgICAgICByMCArPSAzMjsKLSAgICAgICAgICAgICAgICAgICAgICAgIHIxICs9IDMyOwotICAgICAgICAgICAgICAgICAgICAgICAgcjIgKz0gMzI7Ci0gICAgICAgICAgICAgICAgICAgICAgICByMyArPSAzMjsKLQotICAgICAgICAgICAgICAgICAgICAgICAgcjAgPSBjdXJbMF0gKyAocjAgPj4gNik7Ci0gICAgICAgICAgICAgICAgICAgICAgICBpZiAoKHVpbnQpcjAgPiAweEZGKSAgIHIwID0gMHhGRiAmICh+KHIwID4+IDMxKSk7ICAvKiBjbGlwICovCi0gICAgICAgICAgICAgICAgICAgICAgICAqY3VyID0gcjA7Ci0gICAgICAgICAgICAgICAgICAgICAgICByMSA9ICooY3VyICs9IHBpY1BpdGNoKSArIChyMSA+PiA2KTsKLSAgICAgICAgICAgICAgICAgICAgICAgIGlmICgodWludClyMSA+IDB4RkYpICAgcjEgPSAweEZGICYgKH4ocjEgPj4gMzEpKTsgIC8qIGNsaXAgKi8KLSAgICAgICAgICAgICAgICAgICAgICAgICpjdXIgPSByMTsKLSAgICAgICAgICAgICAgICAgICAgICAgIHIyID0gKihjdXIgKz0gcGljUGl0Y2gpICsgKHIyID4+IDYpOwotICAgICAgICAgICAgICAgICAgICAgICAgaWYgKCh1aW50KXIyID4gMHhGRikgICByMiA9IDB4RkYgJiAofihyMiA+PiAzMSkpOyAgLyogY2xpcCAqLwotICAgICAgICAgICAgICAgICAgICAgICAgKmN1ciA9IHIyOwotICAgICAgICAgICAgICAgICAgICAgICAgcjMgPSBjdXJbcGljUGl0Y2hdICsgKHIzID4+IDYpOwotICAgICAgICAgICAgICAgICAgICAgICAgaWYgKCh1aW50KXIzID4gMHhGRikgICByMyA9IDB4RkYgJiAofihyMyA+PiAzMSkpOyAgLyogY2xpcCAqLwotICAgICAgICAgICAgICAgICAgICAgICAgY3VyW3BpY1BpdGNoXSA9IHIzOwotCi0gICAgICAgICAgICAgICAgICAgICAgICBjdXIgLT0gKHBpY1BpdGNoIDw8IDEpOwotICAgICAgICAgICAgICAgICAgICAgICAgY3VyKys7Ci0gICAgICAgICAgICAgICAgICAgICAgICBjb2VmKys7Ci0gICAgICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICAgICAgY3VyIC09IDQ7Ci0gICAgICAgICAgICAgICAgICAgIGNvZWYgLT0gNDsKLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgaWYgKGI0JjEpCi0gICAgICAgICAgICAgICAgewotICAgICAgICAgICAgICAgICAgICBjdXIgKz0gKChwaWNQaXRjaCA8PCAyKSAtIDQpOwotICAgICAgICAgICAgICAgICAgICBjb2VmICs9IDYwOwotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICBlbHNlCi0gICAgICAgICAgICAgICAgewotICAgICAgICAgICAgICAgICAgICBjdXIgKz0gNDsKLSAgICAgICAgICAgICAgICAgICAgY29lZiArPSA0OwotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgIH0KLSAgICAgICAgfQotCi0gICAgICAgIGlmIChiOCYxKQotICAgICAgICB7Ci0gICAgICAgICAgICBjdXJMICs9ICgocGljUGl0Y2ggPDwgMykgLSA4KTsKLSAgICAgICAgICAgIGNvZWY4ICs9IDEyMDsKLSAgICAgICAgfQotICAgICAgICBlbHNlCi0gICAgICAgIHsKLSAgICAgICAgICAgIGN1ckwgKz0gODsKLSAgICAgICAgICAgIGNvZWY4ICs9IDg7Ci0gICAgICAgIH0KLSAgICB9Ci0KLSAgICByZXR1cm4gOwotfQotCi0vKiBwZXJmb3JtYSBkY3QsIHF1YW50LCBpcXVhbnQsIGlkY3QgZm9yIHRoZSBlbnRpcmUgTUIgKi8KLXZvaWQgZGN0X2x1bWFfMTZ4MTYoQVZDRW5jT2JqZWN0ICplbmN2aWQsIHVpbnQ4ICpjdXJMLCB1aW50OCAqb3JnTCkKLXsKLSAgICBBVkNDb21tb25PYmogKnZpZGVvID0gZW5jdmlkLT5jb21tb247Ci0gICAgaW50IHBpdGNoID0gdmlkZW8tPmN1cnJQaWMtPnBpdGNoOwotICAgIGludCBvcmdfcGl0Y2ggPSBlbmN2aWQtPmN1cnJJbnB1dC0+cGl0Y2g7Ci0gICAgQVZDTWFjcm9ibG9jayAqY3Vyck1CID0gdmlkZW8tPmN1cnJNQjsKLSAgICBpbnQxN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KLQotICAgICAgICAgICAgKmNvZWYrKyA9IHIwICsgcjE7Ci0gICAgICAgICAgICAqY29lZisrID0gKHIzIDw8IDEpICsgcjI7Ci0gICAgICAgICAgICAqY29lZisrID0gcjAgLSByMTsKLSAgICAgICAgICAgICpjb2VmKysgPSByMyAtIChyMiA8PCAxKTsKLSAgICAgICAgfQotICAgICAgICBvcmdMICs9IChvcmdfcGl0Y2ggLSAxNik7Ci0gICAgfQotICAgIHByZWQgLT0gMjU2OwotICAgIGNvZWYgLT0gMjU2OwotICAgIC8qIHZlcnRpY2FsICovCi0gICAgZm9yIChibGtfeSA9IDQ7IGJsa195ID4gMDsgYmxrX3ktLSkKLSAgICB7Ci0gICAgICAgIGZvciAoaiA9IDE2OyBqID4gMDsgai0tKQotICAgICAgICB7Ci0gICAgICAgICAgICByMCA9IGNvZWZbMF0gKyBjb2VmWzQ4XTsKLSAgICAgICAgICAgIHIzID0gY29lZlswXSAtIGNvZWZbNDhdOwotICAgICAgICAgICAgcjEgPSBjb2VmWzE2XSArIGNvZWZbMzJdOwotICAgICAgICAgICAgcjIgPSBjb2VmWzE2XSAtIGNvZWZbMzJdOwotCi0gICAgICAgICAgICBjb2VmWzBdID0gcjAgKyByMTsKLSAgICAgICAgICAgIGNvZWZbMzJdID0gcjAgLSByMTsKLSAgICAgICAgICAgIGNvZWZbMTZdID0gKHIzIDw8IDEpICsgcjI7Ci0gICAgICAgICAgICBjb2VmWzQ4XSA9IHIzIC0gKHIyIDw8IDEpOwotCi0gICAgICAgICAgICBjb2VmKys7Ci0gICAgICAgIH0KLSAgICAgICAgY29lZiArPSA0ODsKLSAgICB9Ci0KLSAgICAvKiB0aGVuIHBlcmZvcm0gREMgdHJhbnNmb3JtICovCi0gICAgY29lZiAtPSAyNTY7Ci0gICAgZm9yIChqID0gNDsgaiA+IDA7IGotLSkKLSAgICB7Ci0gICAgICAgIHIwID0gY29lZlswXSArIGNvZWZbMTJdOwotICAgICAgICByMyA9IGNvZWZbMF0gLSBjb2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SAgICB6ZXJvX3J1biA9IDA7Ci0gICAgbmNvZWZmID0gMDsKLSAgICBmb3IgKGsgPSAwOyBrIDwgMTY7IGsrKykgLyogaW4gemlnemFnIHNjYW4gb3JkZXIgKi8KLSAgICB7Ci0gICAgICAgIGlkeCA9IFpJR1pBRzJSQVNURVJEQ1trXTsKLSAgICAgICAgZGF0YSA9IGNvZWZbaWR4XTsKLSAgICAgICAgaWYgKGRhdGEgPiAwKSAgIC8vIHF1YW50Ci0gICAgICAgIHsKLSAgICAgICAgICAgIGxldiA9IGRhdGEgKiBxdWFudCArIChxcF9jb25zdCA8PCAxKTsKLSAgICAgICAgfQotICAgICAgICBlbHNlCi0gICAgICAgIHsKLSAgICAgICAgICAgIGxldiA9IC1kYXRhICogcXVhbnQgKyAocXBfY29uc3QgPDwgMSk7Ci0gICAgICAgIH0KLSAgICAgICAgbGV2ID4+PSAocV9iaXRzICsgMSk7Ci0gICAgICAgIGlmIChsZXYpIC8vIGRlcXVhbnQKLSAgICAgICAgewotICAgICAgICAgICAgaWYgKGRhdGEgPiAwKQotICAgICAgICAgICAgewotICAgICAgICAgICAgICAgIGxldmVsW25jb2VmZl0gPSBsZXY7Ci0gICAgICAgICAgICAgICAgY29lZltpZHhdID0gbGV2OwotICAgICAgICAgICAgfQotICAgICAgICAgICAgZWxzZQotICAgICAgICAgICAgewotICAgICAgICAgICAgICAgIGxldmVsW25jb2VmZl0gPSAtbGV2OwotICAgICAgICAgICAgICAgIGNvZWZbaWR4XSA9IC1sZXY7Ci0gICAgICAgICAgICB9Ci0gICAgICAgICAgICBydW5bbmNvZWZmKytdID0gemVyb19ydW47Ci0gICAgICAgICAgICB6ZXJvX3J1biA9IDA7Ci0gICAgICAgIH0KLSAgICAgICAgZWxzZQotICAgICAgICB7Ci0gICAgICAgICAgICB6ZXJvX3J1bisrOwotICAgICAgICAgICAgY29lZltpZHhdID0gMDsKLSAgICAgICAgfQotICAgIH0KLQotICAgIC8qIGludmVyc2UgdHJhbnNmb3JtIERDICovCi0gICAgZW5jdmlkLT5udW1jb2VmZGMgPSBuY29lZmY7Ci0gICAgaWYgKG5jb2VmZikKLSAgICB7Ci0gICAgICAgIHF1YW50ID0gZGVxdWFudF9jb2VmcmVzW1JxXVswXTsKLQotICAgICAgICBmb3IgKGogPSAwOyBqIDwgNDsgaisrKQotICAgICAgICB7Ci0gICAgICAgICAgICBtMCA9IGNvZWZbMF0gKyBjb2VmWzRdOwotICAgICAgICAgICAgbTEgPSBjb2VmWzBdIC0gY29lZls0XTsKLSAgICAgICAgICAgIG0yID0gY29lZls4XSArIGNvZWZbMTJdOwotICAgICAgICAgICAgbTMgPSBjb2VmWzhdIC0gY29lZlsxMl07Ci0KLQotICAgICAgICAgICAgY29lZlswXSA9IG0wICsgbTI7Ci0gICAgICAgICAgICBjb2VmWzRdID0gbTAgLSBtMjsKLSAgICAgICAgICAgIGNvZWZbOF0gPSBtMSAtIG0zOwotICAgICAgICAgICAgY29lZlsxMl0gPSBtMSArIG0zOwotICAgICAgICAgICAgY29lZiArPSA2NDsKLSAgICAgICAgfQotCi0gICAgICAgIGNvZWYgLT0gMjU2OwotCi0gICAgICAgIGlmIChRcSA+PSAyKSAgLyogdGhpcyB3YXkgc2hvdWxkIGJlIGZhc3RlciB0aGFuIEpNICovCi0gICAgICAgIHsgICAgICAgICAgIC8qIHRoZXkgdXNlICgoKG00KnNjYWxlKTw8KFFQeS82KSkrMik+PjIgZm9yIGJvdGggY2FzZXMuICovCi0gICAgICAgICAgICBRcSAtPSAyOwotICAgICAgICAgICAgZm9yIChqID0gMDsgaiA8IDQ7IGorKykKLSAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICBtMCA9IGNvZWZbMF0gKyBjb2VmWzY0XTsKLSAgICAgICAgICAgICAgICBtMSA9IGNvZWZbMF0gLSBjb2VmWzY0XTsKLSAgICAgICAgICAgICAgICBtMiA9IGNvZWZbMTI4XSArIGNvZWZbMTkyXTsKLSAgICAgICAgICAgICAgICBtMyA9IGNvZWZbMTI4XSAtIGNvZWZbMTkyXTsKLQotICAgICAgICAgICAgICAgIGNvZWZbMF0gPSAoKG0wICsgbTIpICogcXVhbnQpIDw8IFFxOwotICAgICAgICAgICAgICAgIGNvZWZbNjRdID0gKChtMCAtIG0yKSAqIHF1YW50KSA8PCBRcTsKLSAgICAgICAgICAgICAgICBjb2VmWzEyOF0gPSAoKG0xIC0gbTMpICogcXVhbnQpIDw8IFFxOwotICAgICAgICAgICAgICAgIGNvZWZbMTkyXSA9ICgobTEgKyBtMykgKiBxdWFudCkgPDwgUXE7Ci0gICAgICAgICAgICAgICAgY29lZiArPSA0OwotICAgICAgICAgICAgfQotICAgICAgICAgICAgUXEgKz0gMjsgLyogcmVzdG9yZSB0aGUgdmFsdWUgKi8KLSAgICAgICAgfQotICAgICAgICBlbHNlCi0gICAgICAgIHsKLSAgICAgICAgICAgIFFxID0gMiAtIFFxOwotICAgICAgICAgICAgb2Zmc2V0ID0gMSA8PCAoUXEgLSAxKTsKLQotICAgICAgICAgICAgZm9yIChqID0gMDsgaiA8IDQ7IGorKykKLSAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICBtMCA9IGNvZWZbMF0gKyBjb2VmWzY0XTsKLSAgICAgICAgICAgICAgICBtMSA9IGNvZWZbMF0gLSBjb2VmWzY0XTsKLSAgICAgICAgICAgICAgICBtMiA9IGNvZWZbMTI4XSArIGNvZWZbMTkyXTsKLSAgICAgICAgICAgICAgICBtMyA9IGNvZWZbMTI4XSAtIGNvZWZbMTkyXTsKLQotICAgICAgICAgICAgICAgIGNvZWZbMF0gPSAoKChtMCArIG0yKSAqIHF1YW50ICsgb2Zmc2V0KSA+PiBRcSk7Ci0gICAgICAgICAgICAgICAgY29lZls2NF0gPSAoKChtMCAtIG0yKSAqIHF1YW50ICsgb2Zmc2V0KSA+PiBRcSk7Ci0gICAgICAgICAgICAgICAgY29lZlsxMjhdID0gKCgobTEgLSBtMykgKiBxdWFudCArIG9mZnNldCkgPj4gUXEpOwotICAgICA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AgICAgICAgICAgZm9yIChrID0gMTsgayA8IDE2OyBrKyspCi0gICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgaWR4ID0gWlpfU0NBTl9CTE9DS1trXTsgLyogbWFwIGJhY2sgdG8gcmFzdGVyIHNjYW4gb3JkZXIgKi8KLSAgICAgICAgICAgICAgICBkYXRhID0gY29lZltpZHhdOwotICAgICAgICAgICAgICAgIHF1YW50ID0gcXVhbnRfY29lZltScV1ba107Ci0gICAgICAgICAgICAgICAgaWYgKGRhdGEgPiAwKQotICAgICAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAgICAgbGV2ID0gZGF0YSAqIHF1YW50ICsgcXBfY29uc3Q7Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgIGVsc2UKLSAgICAgICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgICAgIGxldiA9IC1kYXRhICogcXVhbnQgKyBxcF9jb25zdDsKLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgbGV2ID4+PSBxX2JpdHM7Ci0gICAgICAgICAgICAgICAgaWYgKGxldikKLSAgICAgICAgICAgICAgICB7ICAgLyogZGVxdWFudCAqLwotICAgICAgICAgICAgICAgICAgICBxdWFudCA9IGRlcXVhbnRfY29lZnJlc1tScV1ba107Ci0gICAgICAgICAgICAgICAgICAgIGlmIChkYXRhID4gMCkKLSAgICAgICAgICAgICAgICAgICAgewotICAgICAgICAgICAgICAgICAgICAgICAgbGV2ZWxbbmNvZWZmXSA9IGxldjsKLSAgICAgICAgICAgICAgICAgICAgICAgIGNvZWZbaWR4XSA9IChsZXYgKiBxdWFudCkgPDwgUXE7Ci0gICAgICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICAgICAgZWxzZQotICAgICAgICAgICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgICAgICAgICBsZXZlbFtuY29lZmZdID0gLWxldjsKLSAgICAgICAgICAgICAgICAgICAgICAgIGNvZWZbaWR4XSA9ICgtbGV2ICogcXVhbnQpIDw8IFFxOwotICAgICAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgICAgIHJ1bltuY29lZmYrK10gPSB6ZXJvX3J1bjsKLSAgICAgICAgICAgICAgICAgICAgemVyb19ydW4gPSAwOwotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICBlbHNlCi0gICAgICAgICAgICAgICAgewotICAgICAgICAgICAgICAgICAgICB6ZXJvX3J1bisrOwotICAgICAgICAgICAgICAgICAgICBjb2VmW2lkeF0gPSAwOwotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgY3Vyck1CLT5uel9jb2VmZltibGtJZHgyYmxrWFlbYjhdW2I0XV0gPSBuY29lZmY7IC8qIGluIHJhc3RlciBzY2FuICEhISAqLwotICAgICAgICAgICAgaWYgKG5jb2VmZikKLSAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICBjdXJyTUItPkNCUCB8PSAoMSA8PCBiOCk7Ci0KLSAgICAgICAgICAgICAgICAvLyBkbyBpbnZlcnNlIHRyYW5zZm9ybSBoZXJlCi0gICAgICAgICAgICAgICAgZm9yIChqID0gNDsgaiA+IDA7IGotLSkKLSAgICAgICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgICAgIHIwID0gY29lZlswXSArIGNvZWZbMl07Ci0gICAgICAgICAgICAgICAgICAgIHIxID0gY29lZlswXSAtIGNvZWZbMl07Ci0gICAgICAgICAgICAgICAgICAgIHIyID0gKGNvZWZbMV0gPj4gMSkgLSBjb2VmWzNdOwotICAgICAgICAgICAgICAgICAgICByMyA9IGNvZWZbMV0gKyAoY29lZlszXSA+PiAxKTsKLQotICAgICAgICAgICAgICAgICAgICBjb2VmWzBdID0gcjAgKyByMzsKLSAgICAgICAgICAgICAgICAgICAgY29lZlsxXSA9IHIxICsgcjI7Ci0gICAgICAgICAgICAgICAgICAgIGNvZWZbMl0gPSByMSAtIHIyOwotICAgICAgICAgICAgICAgICAgICBjb2VmWzNdID0gcjAgLSByMzsKLQotICAgICAgICAgICAgICAgICAgICBjb2VmICs9IDE2OwotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICBjb2VmIC09IDY0OwotICAgICAgICAgICAgICAgIGZvciAoaiA9IDQ7IGogPiAwOyBqLS0pCi0gICAgICAgICAgICAgICAgewotICAgICAgICAgICAgICAgICAgICByMCA9IGNvZWZbMF0gKyBjb2VmWzMyXTsKLSAgICAgICAgICAgICAgICAgICAgcjEgPSBjb2VmWzBdIC0gY29lZlszMl07Ci0gICAgICAgICAgICAgICAgICAgIHIyID0gKGNvZWZbMTZdID4+IDEpIC0gY29lZls0OF07Ci0gICAgICAgICAgICAgICAgICAgIHIzID0gY29lZlsxNl0gKyAoY29lZls0OF0gPj4gMSk7Ci0KLSAgICAgICAgICAgICAgICAgICAgcjAgKz0gcjM7Ci0gICAgICAgICAgICAgICAgICAgIHIzID0gKHIwIC0gKHIzIDw8IDEpKTsgLyogcjAtcjMgKi8KLSAgICAgICAgICAgICAgICAgICAgcjEgKz0gcjI7Ci0gICAgICAgICAgICAgICAgICAgIHIyID0gKHIxIC0gKHIyIDw8IDEpKTsgLyogcjEtcjIgKi8KLSAgICAgICAgICAgICAgICAgICAgcjAgKz0gMzI7Ci0gICAgICAgICAgICAgICAgICAgIHIxICs9IDMyOwotICAgICAgICAgICAgICAgICAgICByMiArPSAzMjsKLSAgICAgICAgICAgICAgICAgICAgcjMgKz0gMzI7Ci0gICAgICAgICAgICAgICAgICAgIHIwID0gcHJlZFswXSArIChyMCA+PiA2KTsKLSAgICAgICAgICAgICAgICAgICAgaWYgKCh1aW50KXIwID4gMHhGRikgICByMCA9IDB4RkYgJiAofihyMCA+PiAzMSkpOyAgLyogY2xpcCAqLwotICAgICAgICAgICAgICAgICAgICByMSA9IHByZWRbMTZdICsgKHIxID4+IDYpOwotICAgICAgICAgICAgICAgICAgICBpZiAoKHVpbnQpcjEgPiAweEZGKSAgIHIxID0gMHhGRiAmICh+KHIxID4+IDMxKSk7ICAvKiBjbGlwICovCi0gICAgICAgICAgICAgICAgICAgIHIyID0gcHJlZFszMl0gKyAocjIgPj4gNik7Ci0gICAgICAgICAgICAgICAgICAgIGlmICgodWludClyMiA+IDB4RkYpICAgcjIgPSAweEZGICYgKH4ocjIgPj4gMzEpKTsgIC8qIGNsaXAgKi8KLSAgICAgICAgICAgICAgICAgICAgcjMgPSBwcmVkWzQ4XSArIChyMyA+PiA2KTsKLSAgICAgICAgICAgICAgICAgICAgaWYgKCh1aW50KXIzID4gMHhGRikgICByMyA9IDB4RkYgJiAofihyMyA+PiAzMSkpOyAgLyogY2xpcCAqLwotICAgICAgICAgICAgICAgICAgICAqY3VyTCA9IHIwOwotICAgICAgICAgICAgICAgICAgICAqKGN1ckwgKz0gcGl0Y2gpID0gcjE7Ci0gICAgICAgICAgICAgICAgICAgICooY3VyTCArPSBwaXRjaCkgPSByMjsKLSAgICAgICAgICAgICAgICAgICAgY3VyTFtwaXRjaF0gPSByMzsKLSAgICAgICAgICAgICAgICAgICAgY3VyTCAtPSAocGl0Y2ggPDwgMSk7Ci0gICAgICAgICAgICAgICAgICAgIGN1ckwrKzsKLSAgICAgICAgICAgICAgICAgICAgcHJlZCsrOwotICAgICAgICAgICAgICAgICAgICBjb2VmKys7Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgfQotICAgICAgICAgICAgZWxzZSAgLy8gZG8gREMtb25seSBpbnZlcnNlCi0gICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgbTAgPSBjb2VmWzBdICsgMzI7Ci0KLSAgICAgICAgICAgICAgICBmb3IgKGogPSA0OyBqID4gMDsgai0tKQotICAgICAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAgICAgcjAgPSBwcmVkWzBdICsgKG0wID4+IDYpOwotICAgICAgICAgICAgICAgICAgICBpZiAoKHVpbnQpcjAgPiAweEZGKSAgIHIwID0gMHhGRiAmICh+KHIwID4+IDMxKSk7ICAvKiBjbGlwICovCi0gICAgICAgICAgICAgICAgICAgIHIxID0gcHJlZFsxNl0gKyAobTAgPj4gNik7Ci0gICAgICAgICAgICAgICAgICAgIGlmICgodWludClyMSA+IDB4RkYpICAgcjEgPSAweEZGICYgKH4ocjEgPj4gMzEpKTsgIC8qIGNsaXAgKi8KLSAgICAgICAgICAgICAgICAgICAgcjIgPSBwcmVkWzMyXSArIChtMCA+PiA2KTsKLSAgICAgICAgICAgICAgICAgICAgaWYgKCh1aW50KXIyID4gMHhGRikgICByMiA9IDB4RkYgJiAofihyMiA+PiAzMSkpOyAgLyogY2xpcCAqLwotICAgICAgICAgICAgICAgICAgICByMyA9IHByZWRbNDhdICsgKG0wID4+IDYpOwotICAgICAgICAgICAgICAgICAgICBpZiAoKHVpbnQpcjMgPiAweEZGKSAgIHIzID0gMHhGRiAmICh+KHIzID4+IDMxKSk7ICAvKiBjbGlwICovCi0gICAgICAgICAgICAgICAgICAgICpjdXJMID0gcjA7Ci0gICAgICAgICAgICAgICAgICAgICooY3VyTCArPSBwaXRjaCkgPSByMTsKLSAgICAgICAgICAgICAgICAgICAgKihjdXJMICs9IHBpdGNoKSA9IHIyOwotICAgICAgICAgICAgICAgICAgICBjdXJMW3BpdGNoXSA9IHIzOwotICAgICAgICAgICAgICAgICAgICBjdXJMIC09IChwaXRjaCA8PCAxKTsKLSAgICAgICAgICAgICAgICAgICAgY3VyTCsrOwotICAgICAgICAgICAgICAgICAgICBwcmVkKys7Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgIGNvZWYgKz0gNDsKLSAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgcnVuICs9IDE2OyAgLy8gZm9sbG93IGNvZGluZyBvcmRlcgotICAgICAgICAgICAgbGV2ZWwgKz0gMTY7Ci0gICAgICAgICAgICBjdXJMICs9IG9mZnNldF9jdXJbYjQmMV07Ci0gICAgICAgICAgICBwcmVkICs9IG9mZnNldF9wcmVkW2I0JjFdOwotICAgICAgICAgICAg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b2VmZl9jb3N0OwotCi0gICAgaWYgKGNyKQotICAgIHsKLSAgICAgICAgY29lZiArPSA4OwotICAgICAgICBwcmVkICs9IDg7Ci0gICAgfQotCi0gICAgaWYgKGN1cnJNQi0+bWJfaW50cmEgPT0gMCkgLy8gaW50ZXIgbW9kZQotICAgIHsKLSAgICAgICAgcHJlZCA9IGN1ckM7Ci0gICAgICAgIHByZWRfcGl0Y2ggPSBwaXRjaDsKLSAgICB9Ci0KLSAgICAvKiBkbyA0eDQgdHJhbnNmb3JtICovCi0gICAgLyogaG9yaXpvbnRhbCAqLwotICAgIGZvciAoaiA9IDg7IGogPiAwOyBqLS0pCi0gICAgewotICAgICAgICBmb3IgKGJsa194ID0gMjsgYmxrX3ggPiAwOyBibGtfeC0tKQotICAgICAgICB7Ci0gICAgICAgICAgICAvKiBjYWxjdWxhdGUgdGhlIHJlc2lkdWUgZmlyc3QgKi8KLSAgICAgICAgICAgIHIwID0gKm9yZ0MrKyAtICpwcmVkKys7Ci0gICAgICAgICAgICByMSA9ICpvcmdDKysgLSAqcHJlZCsrOwotICAgICAgICAgICAgcjIgPSAqb3JnQysrIC0gKnByZWQrKzsKLSAgICAgICAgICAgIHIzID0gKm9yZ0MrKyAtICpwcmVkKys7Ci0KLSAgICAgICAgICAgIHIwICs9IHIzOyAgICAgICAgICAgLy9wdHJbMF0gKyBwdHJbM107Ci0gICAgICAgICAgICByMyA9IHIwIC0gKHIzIDw8IDEpOyAgICAvL3B0clswXSAtIHB0clszXTsKLSAgICAgICAgICAgIHIxICs9IHIyOyAgICAgICAgICAgLy9wdHJbMV0gKyBwdHJbMl07Ci0gICAgICAgICAgICByMiA9IHIxIC0gKHIyIDw8IDEpOyAgICAvL3B0clsxXSAtIHB0clsyXTsKLQotICAgICAgICAgICAgKmNvZWYrKyA9IHIwICsgcjE7Ci0gICAgICAgICAgICAqY29lZisrID0gKHIzIDw8IDEpICsgcjI7Ci0gICAgICAgICAgICAqY29lZisrID0gcjAgLSByMTsKLSAgICAgICAgICAgICpjb2VmKysgPSByMyAtIChyMiA8PCAxKTsKLQotICAgICAgICB9Ci0gICAgICAgIGNvZWYgKz0gODsgLy8gY29lZiBwaXRjaCBpcyAxNgotICAgICAgICBwcmVkICs9IChwcmVkX3BpdGNoIC0gOCk7IC8vIHByZWRfcGl0Y2ggaXMgMTYKLSAgICAgICAgb3JnQyArPSAob3JnX3BpdGNoIC0gOCk7Ci0gICAgfQotICAgIHByZWQgLT0gKHByZWRfcGl0Y2ggPDwgMyk7Ci0gICAgY29lZiAtPSAxMjg7Ci0gICAgLyogdmVydGljYWwgKi8KLSAgICBmb3IgKGJsa195ID0gMjsgYmxrX3kgPiAwOyBibGtfeS0tKQotICAgIHsKLSAgICAgICAgZm9yIChqID0gODsgaiA+IDA7IGotLSkKLSAgICAgICAgewotICAgICAgICAgICAgcjAgPSBjb2VmWzBdICsgY29lZls0OF07Ci0gICAgICAgICAgICByMyA9IGNvZWZbMF0gLSBjb2VmWzQ4XTsKLSAgICAgICAgICAgIHIxID0gY29lZlsxNl0gKyBjb2VmWzMyXTsKLSAgICAgICAgICAgIHIyID0gY29lZlsxNl0gLSBjb2VmWzMyXTsKLQotICAgICAgICAgICAgY29lZlswXSA9IHIwICsgcjE7Ci0gICAgICAgICAgICBjb2VmWzMyXSA9IHIwIC0gcjE7Ci0gICAgICAgICAgICBjb2VmWzE2XSA9IChyMyA8PCAxKSArIHIyOwotICAgICAgICAgICAgY29lZls0OF0gPSByMyAtIChyMiA8PCAxKTsKLQotICAgICAgICAgICAgY29lZisrOwotICAgICAgICB9Ci0gICAgICAgIGNvZWYgKz0gNTY7Ci0gICAgfQotICAgIC8qIHRoZW4gcGVyZm9ybSBEQyB0cmFuc2Zvcm0gKi8KLSAgICBjb2VmIC09IDEyODsKLQotICAgIC8qIDJ4MiB0cmFuc2Zvcm0gb2YgREMgY29tcG9uZW50cyovCi0gICAgcjAgPSBjb2VmWzBdOwotICAgIHIxID0gY29lZls0XTsKLSAgICByMiA9IGNvZWZbNjRdOwotICAgIHIzID0gY29lZls2OF07Ci0KLSAgICBjb2VmWzBdID0gcjAgKyByMSArIHIyICsgcjM7Ci0gICAgY29lZls0XSA9IHIwIC0gcjEgKyByMiAtIHIzOwotICAgIGNvZWZbNjRdID0gcjAgKyByMSAtIHIyIC0gcjM7Ci0gICAgY29lZls2OF0gPSByMCAtIHIxIC0gcjIgKyByMzsKLQotICAgIFFxICAgID0gdmlkZW8tPlFQY19kaXZfNjsKLSAgICBScSAgICA9IHZpZGVvLT5RUGNfbW9kXzY7Ci0gICAgcXVhbnQgPSBxdWFudF9jb2VmW1JxXVswXTsKLSAgICBxX2JpdHMgICAgPSAxNSArIFFxOwotICAgIHFwX2NvbnN0ID0gZW5jdmlkLT5xcF9jb25zdF9jOwotCi0gICAgemVyb19ydW4gPSAwOwotICAgIG5jb2VmZiA9IDA7Ci0gICAgcnVuID0gZW5jdmlkLT5ydW5jZGMgKyAoY3IgPDwgMik7Ci0gICAgbGV2ZWwgPSBlbmN2aWQtPmxldmVsY2RjICsgKGNyIDw8IDIpOwotCi0gICAgLyogaW4gemlnemFnIHNjYW4gb3JkZXIgKi8KLSAgICBmb3IgKGsgPSAwOyBrIDwgNDsgaysrKQotICAgIHsKLSAgICAgICAgaWR4ID0gKChrID4+IDEpIDw8IDYpICsgKChrICYgMSkgPDwgMik7Ci0gICAgICAgIGRhdGEgPSBjb2VmW2lkeF07Ci0gICAgICAgIGlmIChkYXRhID4gMCkKLSAgICAgICAgewotICAgICAgICAgICAgbGV2ID0gZGF0YSAqIHF1YW50ICsgKHFwX2NvbnN0IDw8IDEpOwotICAgICAgICB9Ci0gICAgICAgIGVsc2UKLSAgICAgICAgewotICAgICAgICAgICAgbGV2ID0gLWRhdGEgKiBxdWFudCArIChxcF9jb25zdCA8PCAxKTsKLSAgICAgICAgfQotICAgICAgICBsZXYgPj49IChxX2JpdHMgKyAxKTsKLSAgICAgICAgaWYgKGxldikKLSAgICAgICAgewotICAgICAgICAgICAgaWYgKGRhdGEgPiAwKQotICAgICAgICAgICAgewotICAgICAgICAgICAgICAgIGxldmVsW25jb2VmZl0gPSBsZXY7Ci0gICAgICAgICAgICAgICAgY29lZltpZHhdID0gbGV2OwotICAgICAgICAgICAgfQotICAgICAgICAgICAgZWxzZQotICAgICAgICAgICAgewotICAgICAgICAgICAgICAgIGxldmVsW25jb2VmZl0gPSAtbGV2OwotICAgICAgICAgICAgICAgIGNvZWZbaWR4XSA9IC1sZXY7Ci0gICAgICAgICAgICB9Ci0gICAgICAgICAgICBydW5bbmNvZWZmKytdID0gemVyb19ydW47Ci0gICAgICAgICAgICB6ZXJvX3J1biA9IDA7Ci0gICAgICAgIH0KLSAgICAgICAgZWxzZQotICAgICAgICB7Ci0gICAgICAgICAgICB6ZXJvX3J1bisrOwotICAgICAgICAgICAgY29lZltpZHhdID0gMDsKLSAgICAgICAgfQotICAgIH0KLQotICAgIGVuY3ZpZC0+bnVtY29lZmNkY1tjcl0gPSBuY29lZmY7Ci0KLSAgICBpZiAobmNvZWZmKQotICAgIHsKLSAgICAgICAgY3Vyck1CLT5DQlAgfD0gKDEgPDwgNCk7IC8vIERDIHByZXNlbnQKLSAgICAgICAgLy8gZG8gaW52ZXJzZSB0cmFuc2Zvcm0KLSAgICAgICAgcXVhbnQgPSBkZXF1YW50X2NvZWZyZXNbUnFdWzBdOwotCi0gICAgICAgIHIwID0gY29lZlswXSArIGNvZWZbNF07Ci0gICAgICAgIHIxID0gY29lZlswXSAtIGNvZWZbNF07Ci0gICAgICAgIHIyID0gY29lZls2NF0gKyBjb2VmWzY4XTsKLSAgICAgICAgcjMgPSBjb2VmWzY0XSAtIGNvZWZbNjhdOwotCi0gICAgICAgIHIwICs9IHIyOwotICAgICAgICByMiA9IHIwIC0gKHIyIDw8IDEpOwotICAgICAgICByMSArPSByMzsKLSAgICAgICAgcjMgPSByMSAtIChyMyA8PCAxKTsKLQotICAgICAgICBpZiAoUXEgPj0gMSkKLSAgICAgICAgewotICAgICAgICAgICAgUXEgLT0gMTsKLSAgICAgICAgICAgIGNvZWZbMF0gPSAocjAgKiBxdWFudCkgPDwgUXE7Ci0gICAgICAgICAgICBjb2VmWzRdID0gKHIxICogcXVhbnQpIDw8IFFxOwotICAgICAgICAgICAgY29lZls2NF0gPSAocjIgKiBxdWFudCkgPDwgUXE7Ci0gICAgICAgICAgICBjb2VmWzY4XSA9IChyMyAqIHF1YW50KSA8PCBRcTsKLSAgICAgICAgICAgIFFxKys7Ci0gICAgICAgIH0KLSAgICAgICAgZWxzZQotICAgICAgICB7Ci0gICAgICAgICAgICBjb2VmWzBdID0gKHIwICogcXVhbnQpID4+IDE7Ci0gICAgICAgICAgICBjb2VmWzRdID0gKHIxICogcXVhbnQpID4+IDE7Ci0gICAgICAgICAgICBjb2VmWzY0XSA9IChyMiAqIHF1YW50KSA+PiAxOwotICAgICAgICAgICAgY29lZls2OF0gPSAocjMgKiBxdWFudCkgPj4gMTsKLSAgICAgICAgfQotICAgIH0KLQotICAgIC8qIG5vdyBkbyBBQyB6aWd6YWcgc2NhbiwgcXVhbnQsIGlxdWFudCBhbmQgaXRyYW5zICovCi0gICAgaWYgKGNyKQotICAgIHsKLSAgICAgICAgcnVuID0gZW5jdmlkLT5ydW5bMjBdOwotICAgICAgICBsZXZlbCA9IGVuY3ZpZC0+bGV2ZWxbMjBdOwotICAgIH0KLSAgICBlbHNlCi0gICAgewotICAgICAgICBydW4gPSBlbmN2aWQtPnJ1blsxNl07Ci0gICAgICAgIGxldmVsID0gZW5jdmlkLT5sZXZlbFsxNl07Ci0gICAgfQotCi0gICAgLyogb2Zmc2V0IGJ0dyA0eDQgYmxvY2sgKi8KLSAgICBvZmZzZXRfY3VyWzBdID0gMDsKLSAgICBvZmZzZXRfY3VyWzFdID0gKHBpdGNoIDw8IDIpIC0gODsKLSAgICBvZmZzZXRfcHJlZFswXSA9IDA7Ci0gICAgb2Zmc2V0X3ByZWRbMV0gPSAocHJlZF9waXRjaCA8PCAyKSAtIDg7Ci0gICAgb2Zmc2V0X2NvZWZbMF0gPSAwOwotICAgIG9mZnNldF9jb2VmWzFdID0gNTY7Ci0KLSAgICBjb2VmZl9jb3N0ID0gMDsKLQotICAgIGZvciAoYjQgPSAwOyBiNCA8IDQ7IGI0KyspCi0gICAgewotICAgICAgICB6ZXJvX3J1biA9IDA7Ci0gICAgICAgIG5jb2VmZiA9IDA7Ci0gICAgICAgIGZvciAoayA9IDE7IGsgPCAxNjsgaysrKSAvKiBpbiB6aWd6YWcgc2NhbiBvcmRlciAqLwotICAgICAgICB7Ci0gICAgICAgICAgICBpZHggPSBaWl9TQ0FOX0JMT0NLW2tdOyAvKiBtYXAgYmFjayB0byByYXN0ZXIgc2NhbiBvcmRlciAqLwotICAgICAgICAgICAgZGF0YSA9IGNvZWZbaWR4XTsKLSAgICAgICAgICAgIHF1YW50ID0gcXVhbnRfY29lZltScV1ba107Ci0gICAgICAgICAgICBpZiAoZGF0YSA+IDApCi0gICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgbGV2ID0gZGF0YSAqIHF1YW50ICsgcXBfY29uc3Q7Ci0gICAgICAgICAgICB9Ci0gICAgICAgICAgICBlbHNlCi0gICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgbGV2ID0gLWRhdGEgKiBxdWFudCArIHFwX2NvbnN0OwotICAgICAgICAgICAgfQotICAgICAgICAgICAgbGV2ID4+PSBxX2JpdHM7Ci0gICAgICAgICAgICBpZiAobGV2KQotICAgICAgICAgICAgewotICAgICAgICAgICAgICAgIC8qIGZvciBSRCBwZXJmb3JtYW5jZSovCi0gICAgICAgICAgICAgICAgaWYgKGxldiA+IDEpCi0gICAgICAgICAgICAgICAgICAgIGNvZWZmX2Nvc3QgKz0gTUFYX1ZBTFVFOyAgICAgICAgICAgICAgICAvLyBzZXQgaGlnaCBjb3N0LCBzaGFsbCBub3QgYmUgZGlzY2FyZGVkCi0gICAgICAgICAgICAgICAgZWxzZQotICAgICAgICAgICAgICAgICAgICBjb2VmZl9jb3N0ICs9IENPRUZGX0NPU1RbRElTQUJMRV9USFJFU0hPTERJTkddW3plcm9fcnVuXTsKLQotICAgICAgICAgICAgICAgIC8qIGRlcXVhbnQgKi8KLSAgICAgICAgICAgICAgICBxdWFudCA9IGRlcXVhbnRfY29lZnJlc1tScV1ba107Ci0gICAgICAgICAgICAgICAgaWYgKGRhdGEgPiAwKQotICAgICAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAgICAgbGV2ZWxbbmNvZWZmXSA9IGxldjsKLSAgICAgICAgICAgICAgICAgICAgY29lZltpZHhdID0gKGxldiAqIHF1YW50KSA8PCBRcTsKLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgZWxzZQotICAgICAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAgICAgbGV2ZWxbbmNvZWZmXSA9IC1sZXY7Ci0gICAgICAgICAgICAgICAgICAgIGNvZWZbaWR4XSA9ICgtbGV2ICogcXVhbnQpIDw8IFFxOwotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICBydW5bbmNvZWZmKytdID0gemVyb19ydW47Ci0gICAgICAgICAgICAgICAgemVyb19ydW4gPSAwOwotICAgICAgICAgICAgfQotICAgICAgICAgICAgZWxzZQotICAgICAgICAgICAgewotICAgICAgICAgICAgICAgIHplcm9fcnVuKys7Ci0gICAgICAgICAgICAgICAgY29lZltpZHhdID0gMDsKLSAgICAgICAgICAgIH0KLSAgICAgICAgfQotCi0gICAgICAgIG56X3RlbXBbYjRdID0gbmNvZWZmOyAvLyByYXN0ZXIgc2NhbgotCi0gICAgICAgIC8vIGp1c3QgYWR2YW5jZSB0aGUgcG9pbnRlcnMgZm9yIG5vdywgZG8gSURDVCBsYXRlcgotICAgICAgICBjb2VmICs9IDQ7Ci0gICAgICAgIHJ1biArPSAxNjsKLSAgICAgICAgbGV2ZWwgKz0gMTY7Ci0gICAgICAgIGNvZWYgKz0gb2Zmc2V0X2NvZWZbYjQmMV07Ci0gICAgfQotCi0gICAgLyogcmV3aW5kIHRoZSBwb2ludGVycyAqLwotICAgIGNvZWYgLT0gMTI4OwotCi0gICAgaWYgKGNvZWZmX2Nvc3QgPCBfQ0hST01BX0NPRUZGX0NPU1RfKQotICAgIHsKLSAgICAgICAgLyogaWYgaXQncyBub3QgZWZmaWNpZW50IHRvIGVuY29kZSBhbnkgYmxvY2tzLgotICAgICAgICBKdXN0IGRvIERDIG9ubHkgKi8KLSAgICAgICAgLyogV2UgY2FuIHJlc2V0IGxldmVsIGFuZCBydW4gYWxzbywgYnV0IHNldHRpbmcgbnogdG8gemVybyBzaG91bGQgYmUgZW5vdWdoLiAqLwotICAgICAgICBjdXJyTUItPm56X2NvZWZmWzE2Kyhjcjw8MSldID0gMDsKLSAgICAgICAgY3Vyck1CLT5uel9jb2VmZlsxNysoY3I8PDEpXSA9IDA7Ci0gICAgICAgIGN1cnJNQi0+bnpfY29lZmZbMjArKGNyPDwxKV0gPSAwOwotICAgICAgICBjdXJyTUItPm56X2NvZWZmWzIxKyhjcjw8MSldID0gMDsKLQotICAgICAgICBmb3IgKGI0ID0gMDsgYjQgPCA0OyBiNCsrKQotICAgICAgICB7Ci0gICAgICAgICAgICAvLyBkbyBEQy1vbmx5IGludmVyc2UKLSAgICAgICAgICAgIG0wID0gY29lZlswXSArIDMyOwotCi0gICAgICAgICAgICBmb3IgKGogPSA0OyBqID4gMDsgai0tKQotICAgICAgICAgICAgewotICAgICAgICAgICAgICAgIHIwID0gcHJlZFswXSArIChtMCA+PiA2KTsKLSAgICAgICAgICAgICAgICBpZiAoKHVpbnQpcjAgPiAweEZGKSAgIHIwID0gMHhGRiAmICh+KHIwID4+IDMxKSk7ICAvKiBjbGlwICovCi0gICAgICAgICAgICAgICAgcjEgPSAqKHByZWQgKz0gcHJlZF9waXRjaCkgKyAobTAgPj4gNik7Ci0gICAgICAgICAgICAgICAgaWYgKCh1aW50KXIxID4gMHhGRikgICByMSA9IDB4RkYgJiAofihyMSA+PiAzMSkpOyAgLyogY2xpcCAqLwotICAgICAgICAgICAgICAgIHIyID0gcHJlZFtwcmVkX3BpdGNoXSArIChtMCA+PiA2KTsKLSAgICAgICAgICAgICAgICBpZiAoKHVpbnQpcjIgPiAweEZGKSAgIHIyID0gMHhGRiAmICh+KHIyID4+IDMxKSk7ICAvKiBjbGlwICovCi0gICAgICAgICAgICAgICAgcjMgPSBwcmVkW3ByZWRfcGl0Y2g8PDFdICsgKG0wID4+IDYpOwotICAgICAgICAgICAgICAgIGlmICgodWludClyMyA+IDB4RkYpICAgcjMgPSAweEZGICYgKH4ocjMgPj4gMzEpKTsgIC8qIGNsaXAgKi8KLSAgICAgICAgICAgICAgICAqY3VyQyA9IHIwOwotICAgICAgICAgICAgICAgICooY3VyQyArPSBwaXRjaCkgPSByMTsKLSAgICAgICAgICAgICAgICAqKGN1ckMgKz0gcGl0Y2gpID0gcjI7Ci0gICAgICAgICAgICAgICAgY3VyQ1twaXRjaF0gPSByMzsKLSAgICAgICAgICAgICAgICBjdXJDIC09IChwaXRjaCA8PCAxKTsKLSAgICAgICAgICAgICAgICBjdXJDKys7Ci0gICAgICAgICAgICAgICAgcHJlZCArPSAoMSAtIHByZWRfcGl0Y2gpOwotICAgICAgICAgICAgfQotICAgICAgICAgICAgY29lZiArPSA0OwotICAgICAgICAgICAgY3VyQyArPSBvZmZzZXRfY3VyW2I0JjFdOwotICAgICAgICAgICAgcHJlZCArPSBvZmZzZXRfcHJlZFtiNCYxXTsKLSAgICAgICAgICAgIGNvZWYgKz0gb2Zmc2V0X2NvZWZbYjQmMV07Ci0gICAgICAgIH0KLSAgICB9Ci0gICAgZWxzZSAvLyBub3QgZHJvcHBpbmcgYW55dGhpbmcsIGNvbnRpbnVlIHdpdGggdGhlIElEQ1QKLSAgICB7Ci0gICAgICAgIGZvciAoYjQgPSAwOyBiNCA8IDQ7IGI0KyspCi0gICAgICAgIHsKLSAgICAgICAgICAgIG5jb2VmZiA9IG56X3RlbXBbYjRdIDsgLy8gaW4gcmFzdGVyIHNjYW4KLSAgICAgICAgICAgIGN1cnJNQi0+bnpfY29lZmZbMTYrKGI0JjEpKyhjcjw8MSkrKChiND4+MSk8PDIpXSA9IG5jb2VmZjsgLy8gaW4gcmFzdGVyIHNjYW4KLQotICAgICAgICAgICAgaWYgKG5jb2VmZikgLy8gZG8gYSBjaGVjayBvbiB0aGUgbm9uemVyby1jb2VmZgotICAgICAgICAgICAgewotICAgICAgICAgICAgICAgIGN1cnJNQi0+Q0JQIHw9ICgyIDw8IDQpOwotCi0gICAgICAgICAgICAgICAgLy8gZG8gaW52ZXJzZSB0cmFuc2Zvcm0gaGVyZQotICAgICAgICAgICAgICAgIGZvciAoaiA9IDQ7IGogPiAwOyBqLS0pCi0gICAgICAgICAgICAgICAgewotICAgICAgICAgICAgICAgICAgICByMCA9IGNvZWZbMF0gKyBjb2VmWzJdOwotICAgICAgICAgICAgICAgICAgICByMSA9IGNvZWZbMF0gLSBjb2VmWzJdOwotICAgICAgICAgICAgICAgICAgICByMiA9IChjb2VmWzFdID4+IDEpIC0gY29lZlszXTsKLSAgICAgICAgICAgICAgICAgICAgcjMgPSBjb2VmWzFdICsgKGNvZWZbM10gPj4gMSk7Ci0KLSAgICAgICAgICAgICAgICAgICAgY29lZlswXSA9IHIwICsgcjM7Ci0gICAgICAgICAgICAgICAgICAgIGNvZWZbMV0gPSByMSArIHIyOwotICAgICAgICAgICAgICAgICAgICBjb2VmWzJdID0gcjEgLSByMjsKLSAgICAgICAgICAgICAgICAgICAgY29lZlszXSA9IHIwIC0gcjM7Ci0KLSAgICAgICAgICAgICAgICAgICAgY29lZiArPSAxNjsKLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgY29lZiAtPSA2NDsKLSAgICAgICAgICAgICAgICBmb3IgKGogPSA0OyBqID4gMDsgai0tKQotICAgICAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAgICAgcjAgPSBjb2VmWzBdICsgY29lZlszMl07Ci0gICAgICAgICAgICAgICAgICAgIHIxID0gY29lZlswXSAtIGNvZWZbMzJdOwotICAgICAgICAgICAgICAgICAgICByMiA9IChjb2VmWzE2XSA+PiAxKSAtIGNvZWZbNDhdOwotICAgICAgICAgICAgICAgICAgICByMyA9IGNvZWZbMTZdICsgKGNvZWZbNDhdID4+IDEpOwotCi0gICAgICAgICAgICAgICAgICAgIHIwICs9IHIzOwotICAgICAgICAgICAgICAgICAgICByMyA9IChyMCAtIChyMyA8PCAxKSk7IC8qIHIwLXIzICovCi0gICAgICAgICAgICAgICAgICAgIHIxICs9IHIyOwotICAgICAgICAgICAgICAgICAgICByMiA9IChyMSAtIChyMiA8PCAxKSk7IC8qIHIxLXIyICovCi0gICAgICAgICAgICAgICAgICAgIHIwICs9IDMyOwotICAgICAgICAgICAgICAgICAgICByMSArPSAzMjsKLSAgICAgICAgICAgICAgICAgICAgcjIgKz0gMzI7Ci0gICAgICAgICAgICAgICAgICAgIHIzICs9IDMyOwotICAgICAgICAgICAgICAgICAgICByMCA9IHByZWRbMF0gKyAocjAgPj4gNik7Ci0gICAgICAgICAgICAgICAgICAgIGlmICgodWludClyMCA+IDB4RkYpICAgcjAgPSAweEZGICYgKH4ocjAgPj4gMzEpKTsgIC8qIGNsaXAgKi8KLSAgICAgICAgICAgICAgICAgICAgcjEgPSAqKHByZWQgKz0gcHJlZF9waXRjaCkgKyAocjEgPj4gNik7Ci0gICAgICAgICAgICAgICAgICAgIGlmICgodWludClyMSA+IDB4RkYpICAgcjEgPSAweEZGICYgKH4ocjEgPj4gMzEpKTsgIC8qIGNsaXAgKi8KLSAgICAgICAgICAgICAgICAgICAgcjIgPSBwcmVkW3ByZWRfcGl0Y2hdICsgKHIyID4+IDYpOwotICAgICAgICAgICAgICAgICAgICBpZiAoKHVpbnQpcjIgPiAweEZGKSAgIHIyID0gMHhGRiAmICh+KHIyID4+IDMxKSk7ICAvKiBjbGlwICovCi0gICAgICAgICAgICAgICAgICAgIHIzID0gcHJlZFtwcmVkX3BpdGNoPDwxXSArIChyMyA+PiA2KTsKLSAgICAgICAgICAgICAgICAgICAgaWYgKCh1aW50KXIzID4gMHhGRikgICByMyA9IDB4RkYgJiAofihyMyA+PiAzMSkpOyAgLyogY2xpcCAqLwotICAgICAgICAgICAgICAgICAgICAqY3VyQyA9IHIwOwotICAgICAgICAgICAgICAgICAgICAqKGN1ckMgKz0gcGl0Y2gpID0gcjE7Ci0gICAgICAgICAgICAgICAgICAgICooY3VyQyArPSBwaXRjaCkgPSByMjsKLSAgICAgICAgICAgICAgICAgICAgY3VyQ1twaXRjaF0gPSByMzsKLSAgICAgICAgICAgICAgICAgICAgY3VyQyAtPSAocGl0Y2ggPDwgMSk7Ci0gICAgICAgICAgICAgICAgICAgIGN1ckMrKzsKLSAgICAgICAgICAgICAgICAgICAgcHJlZCArPSAoMSAtIHByZWRfcGl0Y2gpOwotICAgICAgICAgICAgICAgICAgICBjb2VmKys7Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgfQotICAgICAgICAgICAgZWxzZQotICAgICAgICAgICAgewotICAgICAgICAgICAgICAgIC8vIGRvIERDLW9ubHkgaW52ZXJzZQotICAgICAgICAgICAgICAgIG0wID0gY29lZlswXSArIDMyOwotCi0gICAgICAgICAgICAgICAgZm9yIChqID0gNDsgaiA+IDA7IGotLSkKLSAgICAgICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgICAgIHIwID0gcHJlZFswXSArIChtMCA+PiA2KTsKLSAgICAgICAgICAgICAgICAgICAgaWYgKCh1aW50KXIwID4gMHhGRikgICByMCA9IDB4RkYgJiAofihyMCA+PiAzMSkpOyAgLyogY2xpcCAqLwotICAgICAgICAgICAgICAgICAgICByMSA9ICoocHJlZCArPSBwcmVkX3BpdGNoKSArIChtMCA+PiA2KTsKLSAgICAgICAgICAgICAgICAgICAgaWYgKCh1aW50KXIxID4gMHhGRikgICByMSA9IDB4RkYgJiAofihyMSA+PiAzMSkpOyAgLyogY2xpcCAqLwotICAgICAgICAgICAgICAgICAgICByMiA9IHByZWRbcHJlZF9waXRjaF0gKyAobTAgPj4gNik7Ci0gICAgICAgICAgICAgICAgICAgIGlmICgodWludClyMiA+IDB4RkYpICAgcjIgPSAweEZGICYgKH4ocjIgPj4gMzEpKTsgIC8qIGNsaXAgKi8KLSAgICAgICAgICAgICAgICAgICAgcjMgPSBwcmVkW3ByZWRfcGl0Y2g8PDFdICsgKG0wID4+IDYpOwotICAgICAgICAgICAgICAgICAgICBpZiAoKHVpbnQpcjMgPiAweEZGKSAgIHIzID0gMHhGRiAmICh+KHIzID4+IDMxKSk7ICAvKiBjbGlwICovCi0gICAgICAgICAgICAgICAgICAgICpjdXJDID0gcjA7Ci0gICAgICAgICAgICAgICAgICAgICooY3VyQyArPSBwaXRjaCkgPSByMTsKLSAgICAgICAgICAgICAgICAgICAgKihjdXJDICs9IHBpdGNoKSA9IHIyOwotICAgICAgICAgICAgICAgICAgICBjdXJDW3BpdGNoXSA9IHIzOwotICAgICAgICAgICAgICAgICAgICBjdXJDIC09IChwaXRjaCA8PCAxKTsKLSAgICAgICAgICAgICAgICAgICAgY3VyQysrOwotICAgICAgICAgICAgICAgICAgICBwcmVkICs9ICgxIC0gcHJlZF9waXRjaCk7Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgIGNvZWYgKz0gNDsKLSAgICAgICAgICAgIH0KLSAgICAgICAgICAgIGN1ckMgKz0gb2Zmc2V0X2N1cltiNCYxXTsKLSAgICAgICAgICAgIHByZWQgKz0gb2Zmc2V0X3ByZWRbYjQmMV07Ci0gICAgICAgICAgICBjb2VmICs9IG9mZnNldF9jb2VmW2I0JjFdOwotICAgICAgICB9Ci0gICAgfQotCi0gICAgcmV0dXJuIDsKLX0KLQotCi0vKiBvbmx5IERDIHRyYW5zZm9ybSAqLwotaW50IFRyYW5zUXVhbnRJbnRyYTE2REMoQVZDRW5jT2JqZWN0ICplbmN2aWQpCi17Ci0gICAgQVZDQ29tbW9uT2JqICp2aWRlbyA9IGVuY3ZpZC0+Y29tbW9uOwotICAgIGludDE2ICpibG9jayA9IHZpZGVvLT5ibG9jazsKLSAgICBpbnQgKmxldmVsID0gZW5jdmlkLT5sZXZlbGRjOwotICAgIGludCAqcnVuID0gZW5jdmlkLT5ydW5kYzsKLSAgICBpbnQxNiAqcHRyID0gYmxvY2s7Ci0gICAgaW50IHIwLCByMSwgcjIsIHIzLCBqOwotICAgIGludCBRcSA9IHZpZGVvLT5RUHlfZGl2XzY7Ci0gICAgaW50IFJxID0gdmlkZW8tPlFQeV9tb2RfNjsKLSAgICBpbnQgcV9iaXRzLCBxcF9jb25zdCwgcXVhbnQ7Ci0gICAgaW50IGRhdGEsIGxldiwgemVyb19ydW47Ci0gICAgaW50IGssIG5jb2VmZiwgaWR4OwotCi0gICAgLyogREMgdHJhbnNmb3JtICovCi0gICAgLyogaG9yaXpvbnRhbCAqLwotICAgIGogPSA0OwotICAgIHdoaWxlIChqKQotICAgIHsKLSAgICAgICAgcjAgPSBwdHJbMF0gKyBwdHJbMTJdOwotICAgICAgICByMyA9IHB0clswXSAtIHB0clsxMl07Ci0gICAgICAgIHIxID0gcHRyWzRdICsgcHRyWzhdOwotICAgICAgICByMiA9IHB0cls0XSAtIHB0cls4XTsKLQotICAgICAgICBwdHJbMF0gPSByMCArIHIxOwotICAgICAgICBwdHJbOF0gPSByMCAtIHIxOwotICAgICAgICBwdHJbNF0gPSByMyArIHIyOwotICAgICAgICBwdHJbMTJdID0gcjMgLSByMjsKLSAgICAgICAgcHRyICs9IDY0OwotICAgICAgICBqLS07Ci0gICAgfQotICAgIC8qIHZlcnRpY2FsICovCi0gICAgcHRyID0gYmxvY2s7Ci0gICAgaiA9IDQ7Ci0gICAgd2hpbGUgKGopCi0gICAgewotICAgICAgICByMCA9IHB0clswXSArIHB0clsxOTJdOwotICAgICAgICByMyA9IHB0clswXSAtIHB0clsxOTJdOwotICAgICAgICByMSA9IHB0cls2NF0gKyBwdHJbMTI4XTsKLSAgICAgICAgcjIgPSBwdHJbNjRdIC0gcHRyWzEyOF07Ci0KLSAgICAgICAgcHRyWzBdID0gKHIwICsgcjEpID4+IDE7Ci0gICAgICAgIHB0clsxMjhdID0gKHIwIC0gcjEpID4+IDE7Ci0gICAgICAgIHB0cls2NF0gPSAocjMgKyByMikgPj4gMTsKLSAgICAgICAgcHRyWzE5Ml0gPSAocjMgLSByMikgPj4gMTsKLSAgICAgICAgcHRyICs9IDQ7Ci0gICAgICAgIGotLTsKLSAgICB9Ci0KLSAgICBxdWFudCA9IHF1YW50X2NvZWZbUnFdWzBdOwotICAgIHFfYml0cyAgICA9IDE1ICsgUXE7Ci0gICAgcXBfY29uc3QgPSAoMSA8PCBxX2JpdHMpIC8gMzsgICAgLy8gaW50cmEKLQotICAgIHplcm9fcnVuID0gMDsKLSAgICBuY29lZmYgPSAwOwotCi0gICAgZm9yIChrID0gMDsgayA8IDE2OyBrKyspIC8qIGluIHppZ3phZyBzY2FuIG9yZGVyICovCi0gICAgewotICAgICAgICBpZHggPSBaSUdaQUcyUkFTVEVSRENba107Ci0gICAgICAgIGRhdGEgPSBibG9ja1tpZHhdOwotICAgICAgICBpZiAoZGF0YSA+IDApCi0gICAgICAgIHsKLSAgICAgICAgICAgIGxldiA9IGRhdGEgKiBxdWFudCArIChxcF9jb25zdCA8PCAxKTsKLSAgICAgICAgfQotICAgICAgICBlbHNlCi0gICAgICAgIHsKLSAgICAgICAgICAgIGxldiA9IC1kYXRhICogcXVhbnQgKyAocXBfY29uc3QgPDwgMSk7Ci0gICAgICAgIH0KLSAgICAgICAgbGV2ID4+PSAocV9iaXRzICsgMSk7Ci0gICAgICAgIGlmIChsZXYpCi0gICAgICAgIHsKLSAgICAgICAgICAgIGlmIChkYXRhID4gMCkKLSAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICBsZXZlbFtuY29lZmZdID0gbGV2OwotICAgICAgICAgICAgICAgIGJsb2NrW2lkeF0gPSBsZXY7Ci0gICAgICAgICAgICB9Ci0gICAgICAgICAgICBlbHNlCi0gICAgICAgICAgICB7Ci0gICAg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vY2tbNF0gPSByMCAtIHIxICsgcjIgLSByMzsKLSAgICBibG9ja1s2NF0gPSByMCArIHIxIC0gcjIgLSByMzsKLSAgICBibG9ja1s2OF0gPSByMCAtIHIxIC0gcjIgKyByMzsKLQotICAgIFFxICAgID0gdmlkZW8tPlFQY19kaXZfNjsKLSAgICBScSAgICA9IHZpZGVvLT5RUGNfbW9kXzY7Ci0gICAgcXVhbnQgPSBxdWFudF9jb2VmW1JxXVswXTsKLSAgICBxX2JpdHMgICAgPSAxNSArIFFxOwotICAgIGlmIChzbGljZV90eXBlID09IEFWQ19JX1NMSUNFKQotICAgIHsKLSAgICAgICAgcXBfY29uc3QgPSAoMSA8PCBxX2JpdHMpIC8gMzsKLSAgICB9Ci0gICAgZWxzZQotICAgIHsKLSAgICAgICAgcXBfY29uc3QgPSAoMSA8PCBxX2JpdHMpIC8gNjsKLSAgICB9Ci0KLSAgICB6ZXJvX3J1biA9IDA7Ci0gICAgbmNvZWZmID0gMDsKLQotICAgIGZvciAoayA9IDA7IGsgPCA0OyBrKyspIC8qIGluIHppZ3phZyBzY2FuIG9yZGVyICovCi0gICAgewotICAgICAgICBpZHggPSAoKGsgPj4gMSkgPDwgNikgKyAoKGsgJiAxKSA8PCAyKTsKLSAgICAgICAgZGF0YSA9IGJsb2NrW2lkeF07Ci0gICAgICAgIGlmIChkYXRhID4gMCkKLSAgICAgICAgewotICAgICAgICAgICAgbGV2ID0gZGF0YSAqIHF1YW50ICsgKHFwX2NvbnN0IDw8IDEpOwotICAgICAgICB9Ci0gICAgICAgIGVsc2UKLSAgICAgICAgewotICAgICAgICAgICAgbGV2ID0gLWRhdGEgKiBxdWFudCArIChxcF9jb25zdCA8PCAxKTsKLSAgICAgICAgfQotICAgICAgICBsZXYgPj49IChxX2JpdHMgKyAxKTsKLSAgICAgICAgaWYgKGxldikKLSAgICAgICAgewotICAgICAgICAgICAgaWYgKGRhdGEgPiAwKQotICAgICAgICAgICAgewotICAgICAgICAgICAgICAgIGxldmVsW25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UX1MobGFtYmRhX21vdGlvbiwgbW90LT54ICsgeGhbaF0sIG1vdC0+eSArIHloW2hdLCBjbXZ4LCBjbXZ5KTsKLSAgICAgICAgZCArPSBtdmNvc3Q7Ci0KLSAgICAgICAgaWYgKGQgPCBkbWluKQotICAgICAgICB7Ci0gICAgICAgICAgICBkbWluID0gZDsKLSAgICAgICAgICAgIGhtaW4gPSBoOwotICAgICAgICAgICAgc2F0ZF9taW4gPSBkIC0gbXZjb3N0OwotICAgICAgICB9Ci0gICAgfQotCi0gICAgbW90LT5zYWQgPSBkbWluOwotICAgIG1vdC0+eCArPSB4aFtobWluXTsKLSAgICBtb3QtPnkgKz0geWhbaG1pbl07Ci0gICAgZW5jdmlkLT5iZXN0X2hwZWxfcG9zID0gaG1pbjsKLQotICAgIC8qKiogc2VhcmNoIGZvciBxdWFydGVyLXBlbCAqKioqLwotICAgIEdlbmVyYXRlUXVhcnRQZWxQcmVkKGVuY3ZpZC0+YmlsaW5fYmFzZVtobWluXSwgJihlbmN2aWQtPnFwZWxfY2FuZFswXVswXSksIGhtaW4pOwotCi0gICAgZW5jdmlkLT5iZXN0X3FwZWxfcG9zID0gcW1pbiA9IC0xOwotCi0gICAgZm9yIChxID0gMDsgcSA8IDg7IHErKykKLSAgICB7Ci0gICAgICAgIGQgPSBTQVREX01CKGVuY3ZpZC0+cXBlbF9jYW5kW3FdLCBjdXIsIGRtaW4pOwotICAgICAgICBtdmNvc3QgPSBNVl9DT1NUX1MobGFtYmRhX21vdGlvbiwgbW90LT54ICsgeHFbcV0sIG1vdC0+eSArIHlxW3FdLCBjbXZ4LCBjbXZ5KTsKLSAgICAgICAgZCArPSBtdmNvc3Q7Ci0gICAgICAgIGlmIChkIDwgZG1pbikKLSAgICAgICAgewotICAgICAgICAgICAgZG1pbiA9IGQ7Ci0gICAgICAgICAgICBxbWluID0gcTsKLSAgICAgICAgICAgIHNhdGRfbWluID0gZCAtIG12Y29zdDsKLSAgICAgICAgfQotICAgIH0KLQotICAgIG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ICAgIC8qIHRvIGJlIG9wdGltaXplZCBsYXRlciBiYXNlZCBvbiBieXRlLW9mZnNldCBsb2FkICovCi0gICAgcmVmID0gbmNhbmQgLSAzIC0gbHggLSAobHggPDwgMSk7IC8qIG1vdmUgYmFjayAoLTMsLTMpICovCi0gICAgZHN0ID0gc3VicGVsX3ByZWQ7Ci0KLSAgICBkc3QgLT0gNDsgLyogb2Zmc2V0ICovCi0gICAgZm9yIChqID0gMDsgaiA8IDIyOyBqKyspIC8qIDI0eDIyICovCi0gICAgewotICAgICAgICBpID0gNjsKLSAgICAgICAgd2hpbGUgKGkgPiAwKQotICAgICAgICB7Ci0gICAgICAgICAgICB0bXAzMiA9ICpyZWYrKzsKLSAgICAgICAgICAgIHRtcDggPSAqcmVmKys7Ci0gICAgICAgICAgICB0bXAzMiB8PSAodG1wOCA8PCA4KTsKLSAgICAgICAgICAgIHRtcDggPSAqcmVmKys7Ci0gICAgICAgICAgICB0bXAzMiB8PSAodG1wOCA8PCAxNik7Ci0gICAgICAgICAgICB0bXA4ID0gKnJlZisrOwotICAgICAgICAgICAgdG1wMzIgfD0gKHRtcDggPDwgMjQpOwotICAgICAgICAgICAgKigodWludDMyKikoZHN0ICs9IDQpKSA9IHRtcDMyOwotICAgICAgICAgICAgaS0tOwotICAgICAgICB9Ci0gICAgICAgIHJlZiArPSAobHggLSAyNCk7Ci0gICAgfQotCi0gICAgLyogZnJvbSB0aGUgZmlyc3QgYXJyYXksIHdlIGRvIGhvcml6b250YWwgaW50ZXJwICovCi0gICAgcmVmID0gc3VicGVsX3ByZWQgKyAyOwotICAgIGRzdF8xNiA9IHRtcF9ob3J6OyAvKiAxNyB4IDIyICovCi0KLSAgICBmb3IgKGogPSA0OyBqID4gMDsgai0tKQotICAgIHsKLSAgICAgICAgZm9yIChpID0gMTY7IGkgPiAwOyBpIC09IDQpCi0gICAgICAgIHsKLSAgICAgICAgICAgIGEgPSByZWZbLTJdOwotICAgICAgICAgICAgYiA9IHJlZlstMV07Ci0gICAgICAgICAgICBjID0gcmVmWzBdOwotICAgICAgICAgICAgZCA9IHJlZlsxXTsKLSAgICAgICAgICAgIGUgPSByZWZbMl07Ci0gICAgICAgICAgICBmID0gcmVmWzNdOwotICAgICAgICAgICAgKmRzdF8xNisrID0gYSArIGYgLSA1ICogKGIgKyBlKSArIDIwICogKGMgKyBkKTsKLSAgICAgICAgICAgIGEgPSByZWZbNF07Ci0gICAgICAgICAgICAqZHN0XzE2KysgPSBiICsgYSAtIDUgKiAoYyArIGYpICsgMjAgKiAoZCArIGUpOwotICAgICAgICAgICAgYiA9IHJlZls1XTsKLSAgICAgICAgICAgICpkc3RfMTYrKyA9IGMgKyBiIC0gNSAqIChkICsgYSkgKyAyMCAqIChlICsgZik7Ci0gICAgICAgICAgICBjID0gcmVmWzZdOwotICAgICAgICAgICAgKmRzdF8xNisrID0gZCArIGMgLSA1ICogKGUgKyBiKSArIDIwICogKGYgKyBhKTsKLQotICAgICAgICAgICAgcmVmICs9IDQ7Ci0gICAgICAgIH0KLSAgICAgICAgLyogZG8gdGhlIDE3dGggY29sdW1uIGhlcmUgKi8KLSAgICAgICAgZCA9IHJlZlszXTsKLSAgICAgICAgKmRzdF8xNiA9ICBlICsgZCAtIDUgKiAoZiArIGMpICsgMjAgKiAoYSArIGIpOwotICAgICAgICBkc3RfMTYgKz0gMjsgLyogc3RyaWRlIGZvciB0bXBfaG9yeiBpcyAxOCAqLwotICAgICAgICByZWYgKz0gODsgIC8qIHN0cmlkZSBmb3IgcmVmIGlzIDI0ICovCi0gICAgICAgIGlmIChqID09IDMpICAvLyBtb3ZlIDE4IGxpbmVzIGRvd24KLSAgICAgICAgewotICAgICAgICAgICAgZHN0XzE2ICs9IDMyNDsvLzE4KjE4OwotICAgICAgICAgICAgcmVmICs9IDQzMjsvLzE4KjI0OwotICAgICAgICB9Ci0gICAgfQotCi0gICAgcmVmIC09IDQ4MDsvLzIwKjI0OwotICAgIGRzdF8xNiAtPSAzNjA7Ly8yMCoxODsKLSAgICBkc3QgPSBzdWJwZWxfcHJlZCArIFYwUV9IMlEgKiBTVUJQRUxfUFJFRF9CTEtfU0laRTsgLyogZ28gdG8gdGhlIDE0dGggYXJyYXkgMTd4MTgqLwotCi0gICAgZm9yIChqID0gMTg7IGogPiAwOyBqLS0pCi0gICAgewotICAgICAgICBmb3IgKGkgPSAxNjsgaSA+IDA7IGkgLT0gNCkKLSAgICAgICAgewotICAgICAgICAgICAgYSA9IHJlZlstMl07Ci0gICAgICAgICAgICBiID0gcmVmWy0xXTsKLSAgICAgICAgICAgIGMgPSByZWZbMF07Ci0gICAgICAgICAgICBkID0gcmVmWzFdOwotICAgICAgICAgICAgZSA9IHJlZlsyXTsKLSAgICAgICAgICAgIGYgPSByZWZbM107Ci0gICAgICAgICAgICB0bXAzMiA9IGEgKyBmIC0gNSAqIChiICsgZSkgKyAyMCAqIChjICsgZCk7Ci0gICAgICAgICAgICAqZHN0XzE2KysgPSB0bXAzMjsKLSAgICAgICAgICAgIHRtcDMyID0gKHRtcDMyICsgMTYpID4+IDU7Ci0gICAgICAgICAgICBDTElQX1JFU1VMVCh0bXAzMikKLSAgICAgICAgICAgICpkc3QrKyA9IHRtcDMyOwotCi0gICAgICAgICAgICBhID0gcmVmWzRdOwotICAgICAgICAgICAgdG1wMzIgPSBiICsgYSAtIDUgKiAoYyArIGYpICsgMjAgKiAoZCArIGUpOwotICAgICAgICAgICAgKmRzdF8xNisrID0gdG1wMzI7Ci0gICAgICAgICAgICB0bXAzMiA9ICh0bXAzMiArIDE2KSA+PiA1OwotICAgICAgICAgICAgQ0xJUF9SRVNVTFQodG1wMzIpCi0gICAgICAgICAgICAqZHN0KysgPSB0bXAzMjsKLQotICAgICAgICAgICAgYiA9IHJlZls1XTsKLSAgICAgICAgICAgIHRtcDMyID0gYyArIGIgLSA1ICogKGQgKyBhKSArIDIwICogKGUgKyBmKTsKLSAgICAgICAgICAgICpkc3RfMTYrKyA9IHRtcDMyOwotICAgICAgICAgICAgdG1wMzIgPSAodG1wMzIgKyAxNikgPj4gNTsKLSAgICAgICAgICAgIENMSVBfUkVTVUxUKHRtcDMyKQotICAgICAgICAgICAgKmRzdCsrID0gdG1wMzI7Ci0KLSAgICAgICAgICAgIGMgPSByZWZbNl07Ci0gICAgICAgICAgICB0bXAzMiA9IGQgKyBjIC0gNSAqIChlICsgYikgKyAyMCAqIChmICsgYSk7Ci0gICAgICAgICAgICAqZHN0XzE2KysgPSB0bXAzMjsKLSAgICAgICAgICAgIHRtcDMyID0gKHRtcDMyICsgMTYpID4+IDU7Ci0gICAgICAgICAgICBDTElQX1JFU1VMVCh0bXAzMikKLSAgICAgICAgICAgICpkc3QrKyA9IHRtcDMyOwotCi0gICAgICAgICAgICByZWYgKz0gNDsKLSAgICAgICAgfQotICAgICAgICAvKiBkbyB0aGUgMTd0aCBjb2x1bW4gaGVyZSAqLwotICAgICAgICBkID0gcmVmWzNdOwotICAgICAgICB0bXAzMiA9ICBlICsgZCAtIDUgKiAoZiArIGMpICsgMjAgKiAoYSArIGIpOwotICAgICAgICAqZHN0XzE2ID0gdG1wMzI7Ci0gICAgICAgIHRtcDMyID0gKHRtcDMyICsgMTYpID4+IDU7Ci0gICAgICAgIENMSVBfUkVTVUxUKHRtcDMyKQotICAgICAgICAqZHN0ID0gdG1wMzI7Ci0KLSAgICAgICAgZHN0ICs9IDg7ICAvKiBzdHJpZGUgZm9yIGRzdCBpcyAyNCAqLwotICAgICAgICBkc3RfMTYgKz0gMjsgLyogc3RyaWRlIGZvciB0bXBfaG9yeiBpcyAxOCAqLwotICAgICAgICByZWYgKz0gODsgIC8qIHN0cmlkZSBmb3IgcmVmIGlzIDI0ICovCi0gICAgfQotCi0KLSAgICAvKiBEbyBtaWRkbGUgcG9pbnQgZmlsdGVyaW5nKi8KLSAgICBzcmNfMTYgPSB0bXBfaG9yejsgLyogMTcgeCAyMiAqLwotICAgIGRzdCA9IHN1YnBlbF9wcmVkICsgVjJRX0gyUSAqIFNVQlBFTF9QUkVEX0JMS19TSVpFOyAvKiAxMnRoIGFycmF5IDE3eDE3Ki8KLSAgICBkc3QgLT0gMjQ7IC8vIG9mZnNldAotICAgIGZvciAoaSA9IDA7IGkgPCAxNzsgaSsrKQotICAgIHsKLSAgICAgICAgZm9yIChqID0gMTY7IGogPiAwOyBqIC09IDQpCi0gICAgICAgIHsKLSAgICAgICAgICAgIGEgPSAqc3JjXzE2OwotICAgICAgICAgICAgYiA9ICooc3JjXzE2ICs9IDE4KTsKLSAgICAgICAgICAgIGMgPSAqKHNyY18xNiArPSAxOCk7Ci0gICAgICAgICAgICBkID0gKihzcmNfMTYgKz0gMTgpOwotICAgICAgICAgICAgZSA9ICooc3JjXzE2ICs9IDE4KTsKLSAgICAgICAgICAgIGYgPSAqKHNyY18xNiArPSAxOCk7Ci0KLSAgICAgICAgICAgIHRtcDMyID0gYSArIGYgLSA1ICogKGIgKyBlKSArIDIwICogKGMgKyBkKTsKLSAgICAgICAgICAgIHRtcDMyID0gKHRtcDMyICsgNTEyKSA+PiAxMDsKLSAgICAgICAgICAgIENMSVBfUkVTVUxUKHRtcDMyKQotICAgICAgICAgICAgKihkc3QgKz0gMjQpID0gdG1wMzI7Ci0KLSAgICAgICAgICAgIGEgPSAqKHNyY18xNiArPSAxOCk7Ci0gICAgICAgICAgICB0bXAzMiA9IGIgKyBhIC0gNSAqIChjICsgZikgKyAyMCAqIChkICsgZSk7Ci0gICAgICAgICAgICB0bXAzMiA9ICh0bXAzMiArIDUxMikgPj4gMTA7Ci0gICAgICAgICAgICBDTElQX1JFU1VMVCh0bXAzMikKLSAgICAgICAgICAgICooZHN0ICs9IDI0KSA9IHRtcDMyOwotCi0gICAgICAgICAgICBiID0gKihzcmNfMTYgKz0gMTgpOwotICAgICAgICAgICAgdG1wMzIgPSBjICsgYiAtIDUgKiAoZCArIGEpICsgMjAgKiAoZSArIGYpOwotICAgICAgICAgICAgdG1wMzIgPSAodG1wMzIgKyA1MTIpID4+IDEwOwotICAgICAgICAgICAgQ0xJUF9SRVNVTFQodG1wMzIpCi0gICAgICAgICAgICAqKGRzdCArPSAyNCkgPSB0bXAzMjsKLQotICAgICAgICAgICAgYyA9ICooc3JjXzE2ICs9IDE4KTsKLSAgICAgICAgICAgIHRtcDMyID0gZCArIGMgLSA1ICogKGUgKyBiKSArIDIwICogKGYgKyBhKTsKLSAgICAgICAgICAgIHRtcDMyID0gKHRtcDMyICsgNTEyKSA+PiAxMDsKLSAgICAgICAgICAgIENMSVBfUkVTVUxUKHRtcDMyKQotICAgICAgICAgICAgKihkc3QgKz0gMjQpID0gdG1wMzI7Ci0KLSAgICAgICAgICAgIHNyY18xNiAtPSAoMTggPDwgMik7Ci0gICAgICAgIH0KLQotICAgICAgICBkID0gc3JjXzE2WzkwXTsgLy8gMTgqNQotICAgICAgICB0bXAzMiA9IGUgKyBkIC0gNSAqIChmICsgYykgKyAyMCAqIChhICsgYik7Ci0gICAgICAgIHRtcDMyID0gKHRtcDMyICsgNTEyKSA+PiAxMDsKLSAgICAgICAgQ0xJUF9SRVNVTFQodG1wMzIpCi0gICAgICAgIGRzdFsyNF0gPSB0bXAzMjsKLQotICAgICAgICBzcmNfMTYgLT0gKCgxOCA8PCA0KSAtIDEpOwotICAgICAgICBkc3QgLT0gKCgyNCA8PCA0KSAtIDEpOwotICAgIH0KLQotICAgIC8qIGRvIHZlcnRpY2FsIGludGVycG9sYXRpb24gKi8KLSAgICByZWYgPSBzdWJwZWxfcHJlZCArIDI7Ci0gICAgZHN0ID0gc3VicGVsX3ByZWQgKyBWMlFfSDBRICogU1VCUEVMX1BSRURfQkxLX1NJWkU7IC8qIDEwdGggYXJyYXkgMTh4MTcgKi8KLSAgICBkc3QgLT0gMjQ7IC8vIG9mZnNldAotCi0gICAgZm9yIChpID0gMjsgaSA+IDA7IGktLSkKLSAgICB7Ci0gICAgICAgIGZvciAoaiA9IDE2OyBqID4gMDsgaiAtPSA0KQotICAgICAgICB7Ci0gICAgICAgICAgICBhID0gKnJlZjsKLSAgICAgICAgICAgIGIgPSAqKHJlZiArPSAyNCk7Ci0gICAgICAgICAgICBjID0gKihyZWYgKz0gMjQpOwotICAgICAgICAgICAgZCA9ICoocmVmICs9IDI0KTsKLSAgICAgICAgICAgIGUgPSAqKHJlZiArPSAyNCk7Ci0gICAgICAgICAgICBmID0gKihyZWYgKz0gMjQpOwotCi0gICAgICAgICAgICB0bXAzMiA9IGEgKyBmIC0gNSAqIChiICsgZSkgKyAyMCAqIChjICsgZCk7Ci0gICAgICAgICAgICB0bXAzMiA9ICh0bXAzMiArIDE2KSA+PiA1OwotICAgICAgICAgICAgQ0xJUF9SRVNVTFQodG1wMzIpCi0gICAgICAgICAgICAqKGRzdCArPSAyNCkgPSB0bXAzMjsgIC8vIDEwdGgKLQotICAgICAgICAgICAgYSA9ICoocmVmICs9IDI0KTsKLSAgICAgICAgICAgIHRtcDMyID0gYiArIGEgLSA1ICogKGMgKyBmKSArIDIwICogKGQgKyBlKTsKLSAgICAgICAgICAgIHRtcDMyID0gKHRtcDMyICsgMTYpID4+IDU7Ci0gICAgICAgICAgICBDTElQX1JFU1VMVCh0bXAzMikKLSAgICAgICAgICAgICooZHN0ICs9IDI0KSA9IHRtcDMyOyAgLy8gMTB0aAotCi0gICAgICAgICAgICBiID0gKihyZWYgKz0gMjQpOwotICAgICAgICAgICAgdG1wMzIgPSBjICsgYiAtIDUgKiAoZCArIGEpICsgMjAgKiAoZSArIGYpOwotICAgICAgICAgICAgdG1wMzIgPSAodG1wMzIgKyAxNikgPj4gNTsKLSAgICAgICAgICAgIENMSVBfUkVTVUxUKHRtcDMyKQotICAgICAgICAgICAgKihkc3QgKz0gMjQpID0gdG1wMzI7ICAvLyAxMHRoCi0KLSAgICAgICAgICAgIGMgPSAqKHJlZiArPSAyNCk7Ci0gICAgICAgICAgICB0bXAzMiA9IGQgKyBjIC0gNSAqIChlICsgYikgKyAyMCAqIChmICsgYSk7Ci0gICAgICAgICAgICB0bXAzMiA9ICh0bXAzMiArIDE2KSA+PiA1OwotICAgICAgICAgICAgQ0xJUF9SRVNVTFQodG1wMzIpCi0gICAgICAgICAgICAqKGRzdCArPSAyNCkgPSB0bXAzMjsgIC8vIDEwdGgKLQotICAgICAgICAgICAgcmVmIC09ICgyNCA8PCAyKTsKLSAgICAgICAgfQotCi0gICAgICAgIGQgPSByZWZbMTIwXTsgLy8gMjQqNQotICAgICAgICB0bXAzMiA9IGUgKyBkIC0gNSAqIChmICsgYykgKyAyMCAqIChhICsgYik7Ci0gICAgICAgIHRtcDMyID0gKHRtcDMyICsgMTYpID4+IDU7Ci0gICAgICAgIENMSVBfUkVTVUxUKHRtcDMyKQotICAgICAgICBkc3RbMjRdID0gdG1wMzI7ICAvLyAxMHRoCi0KLSAgICAgICAgZHN0IC09ICgoMjQgPDwgNCkgLSAxKTsKLSAgICAgICAgcmVmIC09ICgoMjQgPDwgNCkgLSAxKTsKLSAgICB9Ci0KLSAgICAvLyBub3RlIHRoYXQgdXNpbmcgU0lNRCBoZXJlIGRvZXNuJ3QgaGVscCBtdWNoLCB0aGUgY3ljbGUgYWxtb3N0IHN0YXlzIHRoZSBzYW1lCi0gICAgLy8gb25lIGNhbiBqdXN0IHVzZSB0aGUgYWJvdmUgY29kZSBhbmQgY2hhbmdlIHRoZSBmb3IoaT0yIHRvIGZvcihpPTE4Ci0gICAgZm9yIChpID0gMTY7IGkgPiAwOyBpIC09IDQpCi0gICAgewotICAgICAgICBtc2sgPSAwOwotICAgICAgICBmb3IgKGogPSAxNzsgaiA+IDA7IGotLSkKLSAgICAgICAgewotICAgICAgICAgICAgYSA9ICooKHVpbnQzMiopcmVmKTsgLyogbG9hZCA0IGJ5dGVzICovCi0gICAgICAgICAgICBiID0gKGEgPj4gOCkgJiAweEZGMDBGRjsgLyogc2Vjb25kIGFuZCBmb3VydGggYnl0ZSAqLwotICAgICAgICAgICAgYSAmPSAweEZGMDBGRjsKLQotICAgICAgICAgICAgYyA9ICooKHVpbnQzMiopKHJlZiArIDEyMCkpOwotICAgICAgICAgICAgZCA9IChjID4+IDgpICYgMHhGRjAwRkY7Ci0gICAgICAgICAgICBjICY9IDB4RkYwMEZGOwotCi0gICAgICAgICAgICBhICs9IGM7Ci0gICAgICAgICAgICBiICs9IGQ7Ci0KLSAgICAgICAgICAgIGUgPSAqKCh1aW50MzIqKShyZWYgKyA3MikpOyAvKiBlLCBmICovCi0gICAgICAgICAgICBmID0gKGUgPj4gOCkgJiAweEZGMDBGRjsKLSAgICAgICAgICAgIGUgJj0gMHhGRjAwRkY7Ci0KLSAgICAgICAgICAgIGMgPSAqKCh1aW50MzIqKShyZWYgKyA0OCkpOyAvKiBjLCBkICovCi0gICAgICAgICAgICBkID0gKGMgPj4gOCkgJiAweEZGMDBGRjsKLSAgICAgICAgICAgIGMgJj0gMHhGRjAwRkY7Ci0KLSAgICAgICAgICAgIGMgKz0gZTsKLSAgICAgICAgICAgIGQgKz0gZjsKLQotICAgICAgICAgICAgYSArPSAyMCAqIGM7Ci0gICAgICAgICAgICBiICs9IDIwICogZDsKLSAgICAgICAgICAgIGEgKz0gMHgxMDAwMTA7Ci0gICAgICAgICAgICBiICs9IDB4MTAwMDEwOwotCi0gICAgICAgICAgICBlID0gKigodWludDMyKikocmVmICs9IDI0KSk7IC8qIGUsIGYgKi8KLSAgICAgICAgICAgIGYgPSAoZSA+PiA4KSAmIDB4RkYwMEZGOwotICAgICAgICAgICAgZSAmPSAweEZGMDBGRjsKLQotICAgICAgICAgICAgYyA9ICooKHVpbnQzMiopKHJlZiArIDcyKSk7IC8qIGMsIGQgKi8KLSAgICAgICAgICAgIGQgPSAoYyA+PiA4KSAmIDB4RkYwMEZGOwotICAgICAgICAgICAgYyAmPSAweEZGMDBGRjsKLQotICAgICAgICAgICAgYyArPSBlOwotICAgICAgICAgICAgZCArPSBmOwotCi0gICAgICAgICAgICBhIC09IDUgKiBjOwotICAgICAgICAgICAgYiAtPSA1ICogZDsKLQotICAgICAgICAgICAgYyA9IGEgPDwgMTY7Ci0gICAgICAgICAgICBkID0gYiA8PCAxNjsKLSAgICAgICAgICAgIENMSVBfVVBQRVIxNihhKQotICAgICAgICAgICAgQ0xJUF9VUFBFUjE2KGMpCi0gICAgICAgICAgICBDTElQX1VQUEVSMTYoYikKLSAgICAgICAgICAgIENMSVBfVVBQRVIxNihkKQotCi0gICAgICAgICAgICBhIHw9IChjID4+IDE2KTsKLSAgICAgICAgICAgIGIgfD0gKGQgPj4gMTYpOwotICAgICAgICAgICAgLy8gIGE+Pj01OwotICAgICAgICAgICAgLy8gIGI+Pj01OwotICAgICAgICAgICAgLyogY2xpcCAqLwotICAgICAgICAgICAgLy8gIG1zayB8PSBiOyAgbXNrfD1hOwotICAgICAgICAgICAgLy8gIGEgJj0gMHhGRjAwRkY7Ci0gICAgICAgICAgICAvLyAgYiAmPSAweEZGMDBGRjsKLSAgICAgICAgICAgIGEgfD0gKGIgPDwgOCk7ICAvKiBwYWNrIGl0IGJhY2sgKi8KLQotICAgICAgICAgICAgKigodWludDE2KikoZHN0ICs9IDI0KSkgPSBhICYgMHhGRkZGOyAvL2RzdCBpcyBub3Qgd29yZC1hbGlnbmVkLgotICAgICAgICAgICAgKigodWludDE2KikoZHN0ICsgMikpID0gYSA+PiAxNjsKLQotICAgICAgICB9Ci0gICAgICAgIGRzdCAtPSA0MDQ7IC8vIDI0KjE3LTQKLSAgICAgICAgcmVmIC09IDQwNDsKLSAgICAgICAgLyogICAgICBpZihtc2sgJiAweEZGMDBGRjAwKSAvLyBuZWVkIGNsaXBwaW5nCi0gICAgICAgICAgICAgICAgewotICAgICAgICAgICAgICAgICAgICBWZXJ0SW50ZXJwV0NsaXAoZHN0LHJlZik7IC8vIHJlLWRvIDQgY29sdW1uIHdpdGggY2xpcAotICAgICAgICAgICAgICAgIH0qLwotICAgIH0KLQotICAgIHJldHVybiA7Ci19Ci0KLXZvaWQgVmVydEludGVycFdDbGlwKHVpbnQ4ICpkc3QsIHVpbnQ4ICpyZWYpCi17Ci0gICAgaW50IGksIGo7Ci0gICAgaW50IGEsIGIsIGMsIGQsIGUsIGY7Ci0gICAgaW50MzIgdG1wMzI7Ci0KLSAgICBkc3QgLT0gNDsKLSAgICByZWYgLT0gNDsKLQotICAgIGZvciAoaSA9IDQ7IGkgPiAwOyBpLS0pCi0gICAgewotICAgICAgICBmb3IgKGogPSAxNjsgaiA+IDA7IGogLT0gNCkKLSAgICAgICAgewotICAgICAgICAgICAgYSA9ICpyZWY7Ci0gICAgICAgICAgICBiID0gKihyZWYgKz0gMjQpOwotICAgICAgICAgICAgYyA9ICoocmVmICs9IDI0KTsKLSAgICAgICAgICAgIGQgPSAqKHJlZiArPSAyNCk7Ci0gICAgICAgICAgICBlID0gKihyZWYgKz0gMjQpOwotICAgICAgICAgICAgZiA9ICoocmVmICs9IDI0KTsKLQotICAgICAgICAgICAgdG1wMzIgPSBhICsgZiAtIDUgKiAoYiArIGUpICsgMjAgKiAoYyArIGQpOwotICAgICAgICAgICAgdG1wMzIgPSAodG1wMzIgKyAxNikgPj4gNTsKLSAgICAgICAgICAgIENMSVBfUkVTVUxUKHRtcDMyKQotICAgICAgICAgICAgKihkc3QgKz0gMjQpID0gdG1wMzI7ICAvLyAxMHRoCi0KLSAgICAgICAgICAgIGEgPSAqKHJlZiArPSAyNCk7Ci0gICAgICAgICAgICB0bXAzMiA9IGIgKyBhIC0gNSAqIChjICsgZikgKyAyMCAqIChkICsgZSk7Ci0gICAgICAgICAgICB0bXAzMiA9ICh0bXAzMiArIDE2KSA+PiA1OwotICAgICAgICAgICAgQ0xJUF9SRVNVTFQodG1wMzIpCi0gICAgICAgICAgICAqKGRzdCArPSAyNCkgPSB0bXAzMjsgIC8vIDEwdGgKLQotICAgICAgICAgICAgYiA9ICoocmVmICs9IDI0KTsKLSAgICAgICAgICAgIHRtcDMyID0gYyArIGIgLSA1ICogKGQgKyBhKSArIDIwICogKGUgKyBmKTsKLSAgICAgICAgICAgIHRtcDMyID0gKHRtcDMyICsgMTYpID4+IDU7Ci0gICAgICAgICAgICBDTElQX1JFU1VMVCh0bXAzMikKLSAgICAgICAgICAgICooZHN0ICs9IDI0KSA9IHRtcDMyOyAgLy8gMTB0aAotCi0gICAgICAgICAgICBjID0gKihyZWYgKz0gMjQpOwotICAgICAgICAgICAgdG1wMzIgPSBkICsgYyAtIDUgKiAoZSArIGIpICsgMjAgKiAoZiArIGEpOwotICAgICAgICAgICAgdG1wMzIgPSAodG1wMzIgKyAxNikgPj4gNTsKLSAgICAgICAgICAgIENMSVBfUkVTVUxUKHRtcDMyKQotICAgICAgICAgICAgKihkc3QgKz0gMjQpID0gdG1wMzI7ICAvLyAxMHRoCi0KLSAgICAgICAgICAgIHJlZiAtPSAoMjQgPDwgMik7Ci0gICAgICAgIH0KLQotICAgICAgICBkID0gcmVmWzEyMF07IC8vIDI0KjUKLSAgICAgICAgdG1wMzIgPSBlICsgZCAtIDUgKiAoZiArIGMpICsgMjAgKiAoYSArIGIpOwotICAgICAgICB0bXAzMiA9ICh0bXAzMiArIDE2KSA+PiA1OwotICAgICAgICBDTElQX1JFU1VMVCh0bXAzMikKLSAgICAgICAgZHN0WzI0XSA9IHRtcDMyOyAgLy8gMTB0aAotCi0gICAgICAgIGRzdCAtPSAoKDI0IDw8IDQpIC0gMSk7Ci0gICAgICAgIHJlZiAtPSAoKDI0IDw8IDQpIC0gMSk7Ci0gICAgfQotCi0gICAgcmV0dXJuIDsKLX0KLQotCi12b2lkIEdlbmVyYXRlUXVhcnRQZWxQcmVkKHVpbnQ4ICoqYmlsaW5fYmFzZSwgdWludDggKnFwZWxfY2FuZCwgaW50IGhwZWxfcG9zKQotewotICAgIC8vIGZvciBldmVuIHZhbHVlIG9mIGhwZWxfcG9zLCBzdGFydCB3aXRoIHBhdHRlcm4gMSwgb3RoZXJ3aXNlLCBzdGFydCB3aXRoIHBhdHRlcm4gMgotICAgIGludCBpLCBqOwotCi0gICAgdWludDggKmMxID0gcXBlbF9jYW5kOwotICAgIHVpbnQ4ICp0bCA9IGJpbGluX2Jhc2VbMF07Ci0gICAgdWludDggKnRyID0gYmlsaW5fYmFzZVsxXTsKLSAgICB1aW50OCAqYmwgPSBiaWxpbl9iYXNlWzJdOwotICAgIHVpbnQ4ICpiciA9IGJpbGluX2Jhc2VbM107Ci0gICAgaW50IGEsIGIsIGMsIGQ7Ci0gICAgaW50IG9mZnNldCA9IDEgLSAoMzg0ICogNyk7Ci0KLSAgICBpZiAoIShocGVsX3BvcyYxKSkgLy8gZGlhbW9uZCBwYXR0ZXJuCi0gICAgewotICAgICAgICBqID0gMTY7Ci0gICAgICAgIHdoaWxlIChqLS0pCi0gICAgICAgIHsKLSAgICAgICAgICAgIGkgPSAxNjsKLSAgICAgICAgICAgIHdoaWxlIChpLS0pCi0gICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgZCA9IHRyWzI0XTsKLSAgICAgICAgICAgICAgICBhID0gKnRyKys7Ci0gICAgICAgICAgICAgICAgYiA9IGJsWzFdOwotICAgICAgICAgICAgICAgIGMgPSAqYnIrKzsKLQotICAgICAgICAgICAgICAgICpjMSA9IChjICsgYSArIDEpID4+IDE7Ci0gICAgICAgICAgICAgICAgKihjMSArPSAzODQpID0gKGIgKyBhICsgMSkgPj4gMTsgLyogYzIgKi8KLSAgICAgICAgICAgICAgICAqKGMxICs9IDM4NCkgPSAoYiArIGMgKyAxKSA+PiAxOyAvKiBjMyAqLwotICAgICAgICAgICAgICAgICooYzEgKz0gMzg0KSA9IChiICsgZCArIDEpID4+IDE7IC8qIGM0ICovCi0KLSAgICAgICAgICAgICAgICBiID0gKmJsKys7Ci0KLSAgICAgICAgICAgICAgICAqKGMxICs9IDM4NCkgPSAoYyArIGQgKyAxKSA+PiAxOyAgLyogYzUgKi8KLSAgICAgICAgICAgICAgICAqKGMxICs9IDM4NCkgPSAoYiArIGQgKyAxKSA+PiAxOyAgLyogYzYgKi8KLSAgICAgICAgICAgICAgICAqKGMxICs9IDM4NCkgPSAoYiArIGMgKyAxKSA+PiAxOyAgLyogYzcgKi8KLSAgICAgICAgICAgICAgICAqKGMxICs9IDM4NCkgPSAoYiArIGEgKyAxKSA+PiAxOyAgLyogYzggKi8KLQotICAgICAgICAgICAgICAgIGMxICs9IG9mZnNldDsKLSAgICAgICAgICAgIH0KLSAgICAgICAgICAgIC8vIGFkdmFuY2UgdG8gdGhlIG5leHQgbGluZSwgcGl0Y2ggaXMgMjQKLSAgICAgICAgICAgIHRsICs9IDg7Ci0gICAgICAgICAgICB0ciArPSA4OwotICAgICAgICAgICAgYmwgKz0gODsKLSAgICAgICAgICAgIGJyICs9IDg7Ci0gICAgICAgICAgICBjMSArPSA4OwotICAgICAgICB9Ci0gICAgfQotICAgIGVsc2UgLy8gc3RhciBwYXR0ZXJuCi0gICAgewotICAgICAgICBqID0gMTY7Ci0gICAgICAgIHdoaWxlIChqLS0pCi0gICAgICAgIHsKLSAgICAgICAgICAgIGkgPSAxNjsKLSAgICAgICAgICAgIHdoaWxlIChpLS0pCi0gICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgYSA9ICpicisrOwotICAgICAgICAgICAgICAgIGIgPSAqdHIrKzsKLSAgICAgICAgICAgICAgICBjID0gdGxbMV07Ci0gICAgICAgICAgICAgICAgKmMxID0gKGEgKyBiICsgMSkgPj4gMTsKLSAgICAgICAgICAgICAgICBiID0gYmxbMV07Ci0gICAgICAgICAgICAgICAgKihjMSArPSAzODQpID0gKGEgKyBjICsgMSkgPj4gMTsgLyogYzIgKi8KLSAgICAgICAgICAgICAgICBjID0gdGxbMjVdOwotICAgICAgICAgICAgICAgICooYzEgKz0gMzg0KSA9IChhICsgYiArIDEpID4+IDE7IC8qIGMzICovCi0gICAgICAgICAgICAgICAgYiA9IHRyWzIzXTsKLSAgICAgICAgICAgICAgICAqKGMxICs9IDM4NCkgPSAoYSArIGMgKyAxKSA+PiAxOyAvKiBjNCAqLwotICAgICAgICAgICAgICAgIGMgPSB0bFsyNF07Ci0gICAgICAgICAgICAgICAgKihjMSArPSAzODQpID0gKGEgKyBiICsgMSkgPj4gMTsgLyogYzUgKi8KLSAgICAgICAgICAgICAgICBiID0gKmJsKys7Ci0gICAgICAgICAgICAgICAgKihjMSArPSAzODQpID0gKGEgKyBjICsgMSkgPj4gMTsgLyogYzYgKi8KLSAgICAgICAgICAgICAgICBjID0gKnRsKys7Ci0gICAgICAgICAgICAgICAgKihjMSArPSAzODQpID0gKGEgKyBiICsgMSkgPj4gMTsgLyogYzcgKi8KLSAgICAgICAgICAgICAgICAqKGMxICs9IDM4NCkgPSAoYSArIGMgKyAxKSA+PiAxOyAvKiBjOCAqLwotCi0gICAgICAgICAgICAgICAgYzEgKz0gb2Zmc2V0OwotICAgICAgICAgICAgfQotICAgICAgICAgICAgLy8gYWR2YW5jZSB0byB0aGUgbmV4dCBsaW5lLCBwaXRjaCBpcyAyNAotICAgICAgICAgICAgdGwgKz0gODsKLSAgICAgICAgICAgIHRyICs9IDg7Ci0gICAgICAgICAgICBibCArPSA4OwotICAgICAgICAgICAgYnIgKz0gODsKLSAgICAgICAgICAgIGMxICs9IDg7Ci0gICAgICAgIH0KLSAgICB9Ci0KLSAgICByZXR1cm4gOwotfQotCi0KLS8qIGFzc3VtaW5nIGNhbmQgYWx3YXlzIGhhcyBhIHBpdGNoIG9mIDI0ICovCi1pbnQgU0FURF9NQih1aW50OCAqY2FuZCwgdWludDggKmN1ciwgaW50IGRtaW4pCi17Ci0gICAgaW50IGNvc3Q7Ci0KLQotICAgIGRtaW4gPSAoZG1pbiA8PCAxNikgfCAyNDsKLSAgICBjb3N0ID0gQVZDU0FEX01hY3JvYmxvY2tfQyhjYW5kLCBjdXIsIGRtaW4sIE5VTEwpOwotCi0gICAgcmV0dXJuIGNvc3Q7Ci19Ci0KLQotCi0KLQpkaWZmIC0tZ2l0IGEvbWVkaWEvbGlic3RhZ2VmcmlnaHQvY29kZWNzL2F2Yy9lbmMvc3JjL2hlYWRlci5jcHAgYi9tZWRpYS9saWJzdGFnZWZyaWdodC9jb2RlY3MvYXZjL2VuYy9zcmMvaGVhZGVyLmNwcApkZWxldGVkIGZpbGUgb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M0ICsgNCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNsaWNlSGRyLT5waWNfb3JkZXJfY250X2xzYik7Ci0KLSAgICAgICAgaWYgKGN1cnJQUFMtPnBpY19vcmRlcl9wcmVzZW50X2ZsYWcgJiYgIXNsaWNlSGRyLT5maWVsZF9waWNfZmxhZykKLSAgICAgICAgewotICAgICAgICAgICAgc3RhdHVzID0gc2VfdihzdHJlYW0sIHNsaWNlSGRyLT5kZWx0YV9waWNfb3JkZXJfY250X2JvdHRvbSk7IC8qIDMyIGJpdHMgKi8KLSAgICAgICAgfQotICAgIH0KLSAgICBpZiAoY3VyclNQUy0+cGljX29yZGVyX2NudF90eXBlID09IDEgJiYgIWN1cnJTUFMtPmRlbHRhX3BpY19vcmRlcl9hbHdheXNfemVyb19mbGFnKQotICAgIHsKLSAgICAgICAgc3RhdHVzID0gc2VfdihzdHJlYW0sIHNsaWNlSGRyLT5kZWx0YV9waWNfb3JkZXJfY250WzBdKTsgICAgLyogMzIgYml0cyAqLwotICAgICAgICBpZiAoY3VyclBQUy0+cGljX29yZGVyX3ByZXNlbnRfZmxhZyAmJiAhc2xpY2VIZHItPmZpZWxkX3BpY19mbGFnKQotICAgICAgICB7Ci0gICAgICAgICAgICBzdGF0dXMgPSBzZV92KHN0cmVhbSwgc2xpY2VIZHItPmRlbHRhX3BpY19vcmRlcl9jbnRbMV0pOyAvKiAzMiBiaXRzICovCi0gICAgICAgIH0KLSAgICB9Ci0KLSAgICBpZiAoY3VyclBQUy0+cmVkdW5kYW50X3BpY19jbnRfcHJlc2VudF9mbGFnKQotICAgIHsKLSAgICAgICAgc3RhdHVzID0gdWVfdihzdHJlYW0sIHNsaWNlSGRyLT5yZWR1bmRhbnRfcGljX2NudCk7Ci0gICAgfQotCi0gICAgaWYgKHNsaWNlX3R5cGUgPT0gQVZDX0JfU0xJQ0UpCi0gICAgewotICAgICAgICBzdGF0dXMgPSBCaXRzdHJlYW1Xcml0ZTFCaXQoc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fcGljX2xpc3RfcmVvcmRlcmluZ19mbGFnX2wwKTsKLSAgICAgICAgaWYgKHNsaWNlSGRyLT5yZWZfcGljX2xpc3RfcmVvcmRlcmluZ19mbGFnX2wwKQotICAgICAgICB7Ci0gICAgICAgICAgICBpID0gMDsKLSAgICAgICAgICAgIGRvCi0gICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgc3RhdHVzID0gdWVfdihzdHJlYW0sIHNsaWNlSGRyLT5yZW9yZGVyaW5nX29mX3BpY19udW1zX2lkY19sMFtpXSk7Ci0gICAgICAgICAgICAgICAgaWYgKHNsaWNlSGRyLT5yZW9yZGVyaW5nX29mX3BpY19udW1zX2lkY19sMFtpXSA9PSAwIHx8Ci0gICAgICAgICAgICAgICAgICAgICAgICBzbGljZUhkci0+cmVvcmRlcmluZ19vZl9waWNfbnVtc19pZGNfbDBbaV0gPT0gMSkKLSAgICAgICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgICAgIHN0YXR1cyA9IHVlX3Yoc3RyZWFtLCBzbGljZUhkci0+YWJzX2RpZmZfcGljX251bV9taW51czFfbDBbaV0pOwotICAgICAgICAgICAgICAgICAgICAvKiB0aGlzIGNoZWNrIHNob3VsZCBiZSBpbiBJbml0U2xpY2UoKSwgaWYgd2UgZXZlciB1c2UgaXQgKi8KLSAgICAgICAgICAgICAgICAgICAgLyppZihzbGljZUhkci0+cmVvcmRlcmluZ19vZl9waWNfbnVtc19pZGNfbDBbaV0gPT0gMCAmJgotICAgICAgICAgICAgICAgICAgICAgICAgc2xpY2VIZHItPmFic19kaWZmX3BpY19udW1fbWludXMxX2wwW2ldID4gdmlkZW8tPk1heFBpY051bS8yIC0xKQotICAgICAgICAgICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gQVZDRU5DX1JFRl9QSUNfUkVPUkRFUl9GQUlMOyAvLyBvdXQgb2YgcmFuZ2UKLSAgICAgICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgICAgICBpZihzbGljZUhkci0+cmVvcmRlcmluZ19vZl9waWNfbnVtc19pZGNfbDBbaV0gPT0gMSAmJgotICAgICAgICAgICAgICAgICAgICAgICAgc2xpY2VIZHItPmFic19kaWZmX3BpY19udW1fbWludXMxX2wwW2ldID4gdmlkZW8tPk1heFBpY051bS8yIC0yKQotICAgICAgICAgICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gQVZDRU5DX1JFRl9QSUNfUkVPUkRFUl9GQUlMOyAvLyBvdXQgb2YgcmFuZ2UKLSAgICAgICAgICAgICAgICAgICAgfSovCi0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgIGVsc2UgaWYgKHNsaWNlSGRyLT5yZW9yZGVyaW5nX29mX3BpY19udW1zX2lkY19sMFtpXSA9PSAyKQotICAgICAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAgICAgc3RhdHVzID0gdWVfdihzdHJlYW0sIHNsaWNlSGRyLT5sb25nX3Rlcm1fcGljX251bV9sMFtpXSk7Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgIGkrKzsKLSAgICAgICAgICAgIH0KLSAgICAgICAgICAgIHdoaWxlIChzbGljZUhkci0+cmVvcmRlcmluZ19vZl9waWNfbnVtc19pZGNfbDBbaV0gIT0gMwotICAgICAgICAgICAgICAgICAgICAmJiBpIDw9IChpbnQpc2xpY2VIZHItPm51bV9yZWZfaWR4X2wwX2FjdGl2ZV9taW51czEgKyAxKSA7Ci0gICAgICAgIH0KLSAgICB9Ci0gICAgaWYgKHNsaWNlX3R5cGUgPT0gQVZDX0JfU0xJQ0UpCi0gICAgewotICAgICAgICBzdGF0dXMgPSBCaXRzdHJlYW1Xcml0ZTFCaXQoc3RyZWFtLCBzbGljZUhkci0+cmVmX3BpY19saXN0X3Jlb3JkZXJpbmdfZmxhZ19sMSk7Ci0gICAgICAgIGlmIChzbGljZUhkci0+cmVmX3BpY19saXN0X3Jlb3JkZXJpbmdfZmxhZ19sMSkKLSAgICAgICAgewotICAgICAgICAgICAgaSA9IDA7Ci0gICAgICAgICAgICBkbwotICAgICAgICAgICAgewotICAgICAgICAgICAgICAgIHN0YXR1cyA9IHVlX3Yoc3RyZWFtLCBzbGljZUhkci0+cmVvcmRlcmluZ19vZl9waWNfbnVtc19pZGNfbDFbaV0pOwotICAgICAgICAgICAgICAgIGlmIChzbGljZUhkci0+cmVvcmRlcmluZ19vZl9waWNfbnVtc19pZGNfbDFbaV0gPT0gMCB8fAotICAgICAgICAgICAgICAgICAgICAgICAgc2xpY2VIZHItPnJlb3JkZXJpbmdfb2ZfcGljX251bXNfaWRjX2wxW2ldID09IDEpCi0gICAgICAgICAgICAgICAgewotICAgICAgICAgICAgICAgICAgICBzdGF0dXMgPSB1ZV92KHN0cmVhbSwgc2xpY2VIZHItPmFic19kaWZmX3BpY19udW1fbWludXMxX2wxW2ldKTsKLSAgICAgICAgICAgICAgICAgICAgLyogVGhpcyBjaGVjayBzaG91bGQgYmUgaW4gSW5pdFNsaWNlKCkgaWYgd2UgZXZlciB1c2UgaXQKLSAgICAgICAgICAgICAgICAgICAgaWYoc2xpY2VIZHItPnJlb3JkZXJpbmdfb2ZfcGljX251bXNfaWRjX2wxW2ldID09IDAgJiYKLSAgICAgICAgICAgICAgICAgICAgICAgIHNsaWNlSGRyLT5hYnNfZGlmZl9waWNfbnVtX21pbnVzMV9sMVtpXSA+IHZpZGVvLT5NYXhQaWNOdW0vMiAtMSkKLSAgICAgICAgICAgICAgICAgICAgewotICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIEFWQ0VOQ19SRUZfUElDX1JFT1JERVJfRkFJTDsgLy8gb3V0IG9mIHJhbmdlCi0gICAgICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICAgICAgaWYoc2xpY2VIZHItPnJlb3JkZXJpbmdfb2ZfcGljX251bXNfaWRjX2wxW2ldID09IDEgJiYKLSAgICAgICAgICAgICAgICAgICAgICAgIHNsaWNlSGRyLT5hYnNfZGlmZl9waWNfbnVtX21pbnVzMV9sMVtpXSA+IHZpZGVvLT5NYXhQaWNOdW0vMiAtMikKLSAgICAgICAgICAgICAgICAgICAgewotICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIEFWQ0VOQ19SRUZfUElDX1JFT1JERVJfRkFJTDsgLy8gb3V0IG9mIHJhbmdlCi0gICAgICAgICAgICAgICAgICAgIH0qLwotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICBlbHNlIGlmIChzbGljZUhkci0+cmVvcmRlcmluZ19vZl9waWNfbnVtc19pZGNfbDFbaV0gPT0gMikKLSAgICAgICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgICAgIHN0YXR1cyA9IHVlX3Yoc3RyZWFtLCBzbGljZUhkci0+bG9uZ190ZXJtX3BpY19udW1fbDFbaV0pOwotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICBpKys7Ci0gICAgICAgICAgICB9Ci0gICAgICAgICAgICB3aGlsZSAoc2xpY2VIZHItPnJlb3JkZXJpbmdfb2ZfcGljX251bXNfaWRjX2wxW2ldICE9IDMKLSAgICAgICAgICAgICAgICAgICAgJiYgaSA8PSAoaW50KXNsaWNlSGRyLT5udW1fcmVmX2lkeF9sMV9hY3RpdmVfbWludXMxICsgMSkgOwotICAgICAgICB9Ci0gICAgfQotCi0gICAgcmV0dXJuIHN0YXR1czsKLX0KLQotLyoqIHNlZSBzdWJjbGF1c2UgNy40LjMuMyAqLwotQVZDRW5jX1N0YXR1cyBkZWNfcmVmX3BpY19tYXJraW5nKEFWQ0NvbW1vbk9iaiAqdmlkZW8sIEFWQ0VuY0JpdHN0cmVhbSAqc3RyZWFtLCBBVkNTbGljZUhlYWRlciAqc2xpY2VIZHIpCi17Ci0gICAgaW50IGk7Ci0gICAgQVZDRW5jX1N0YXR1cyBzdGF0dXMgPSBBVkNFTkNfU1VDQ0VTUzsKLQotICAgIGlmICh2aWRlby0+bmFsX3VuaXRfd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hbmFnZW1lbnRfY29udHJvbF9vcGVyYXRpb25baV0pOwotICAgICAgICAgICAgICAgIGlmIChzbGljZUhkci0+bWVtb3J5X21hbmFnZW1lbnRfY29udHJvbF9vcGVyYXRpb25baV0gPT0gMSB8fAotICAgICAgICAgICAgICAgICAgICAgICAgc2xpY2VIZHItPm1lbW9yeV9tYW5hZ2VtZW50X2NvbnRyb2xfb3BlcmF0aW9uW2ldID09IDMpCi0gICAgICAgICAgICAgICAgewotICAgICAgICAgICAgICAgICAgICBzdGF0dXMgPSB1ZV92KHN0cmVhbSwgc2xpY2VIZHItPmRpZmZlcmVuY2Vfb2ZfcGljX251bXNfbWludXMxW2ldKTsKLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgaWYgKHNsaWNlSGRyLT5tZW1vcnlfbWFuYWdlbWVudF9jb250cm9sX29wZXJhdGlvbltpXSA9PSAyKQotICAgICAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAgICAgc3RhdHVzID0gdWVfdihzdHJlYW0sIHNsaWNlSGRyLT5sb25nX3Rlcm1fcGljX251bVtpXSk7Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgIGlmIChzbGljZUhkci0+bWVtb3J5X21hbmFnZW1lbnRfY29udHJvbF9vcGVyYXRpb25baV0gPT0gMyB8fAotICAgICAgICAgICAgICAgICAgICAgICAgc2xpY2VIZHItPm1lbW9yeV9tYW5hZ2VtZW50X2NvbnRyb2xfb3BlcmF0aW9uW2ldID09IDYpCi0gICAgICAgICAgICAgICAgewotICAgICAgICAgICAgICAgICAgICBzdGF0dXMgPSB1ZV92KHN0cmVhbSwgc2xpY2VIZHItPmxvbmdfdGVybV9mcmFtZV9pZHhbaV0pOwotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICBpZiAoc2xpY2VIZHItPm1lbW9yeV9tYW5hZ2VtZW50X2NvbnRyb2xfb3BlcmF0aW9uW2ldID09IDQpCi0gICAgICAgICAgICAgICAgewotIC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ci0gICAgQVZDRnJhbWVJTyAgKmN1cnJJbnB1dCA9IGVuY3ZpZC0+Y3VycklucHV0OwotICAgIGludCBpOwotCi0gICAgc3dpdGNoIChjdXJyU1BTLT5waWNfb3JkZXJfY250X3R5cGUpCi0gICAgewotICAgICAgICBjYXNlIDA6IC8qIFBPQyBNT0RFIDAgLCBzdWJjbGF1c2UgOC4yLjEuMSAqLwotICAgICAgICAgICAgLyogZW5jb2RpbmcgcGFydCAqLwotICAgICAgICAgICAgaWYgKHZpZGVvLT5uYWxfdW5pdF90eXBlID09IEFWQ19OQUxUWVBFX0lEUikKLSAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICBlbmN2aWQtPmRpc3BPcmRQT0NSZWYgPSBjdXJySW5wdXQtPmRpc3Bfb3JkZXI7Ci0gICAgICAgICAgICB9Ci0gICAgICAgICAgICB3aGlsZSAoY3VycklucHV0LT5kaXNwX29yZGVyIDwgZW5jdmlkLT5kaXNwT3JkUE9DUmVmKQotICAgICAgICAgICAgewotICAgICAgICAgICAgICAgIGVuY3ZpZC0+ZGlzcE9yZFBPQ1JlZiAtPSB2aWRlby0+TWF4UGljT3JkZXJDbnRMc2I7Ci0gICAgICAgICAgICB9Ci0gICAgICAgICAgICBzbGljZUhkci0+cGljX29yZGVyX2NudF9sc2IgPSBjdXJySW5wdXQtPmRpc3Bfb3JkZXIgLSBlbmN2aWQtPmRpc3BPcmRQT0NSZWY7Ci0gICAgICAgICAgICB3aGlsZSAoc2xpY2VIZHItPnBpY19vcmRlcl9jbnRfbHNiID49IHZpZGVvLT5NYXhQaWNPcmRlckNudExzYikKLSAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICBzbGljZUhkci0+cGljX29yZGVyX2NudF9sc2IgLT0gdmlkZW8tPk1heFBpY09yZGVyQ250THNiOwotICAgICAgICAgICAgfQotICAgICAgICAgICAgLyogZGVjb2RpbmcgcGFydCAqLwotICAgICAgICAgICAgLyogQ2FsY3VsYXRlIHRoZSBNU0JzIG9mIGN1cnJlbnQgcGljdHVyZSAqLwotICAgICAgICAgICAgaWYgKHZpZGVvLT5uYWxfdW5pdF90eXBlID09IEFWQ19OQUxUWVBFX0lEUikKLSAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICB2aWRlby0+cHJldlBpY09yZGVyQ250TXNiID0gMDsKLSAgICAgICAgICAgICAgICB2aWRlby0+cHJldlBpY09yZGVyQ250THNiID0gMDsKLSAgICAgICAgICAgIH0KLSAgICAgICAgICAgIGlmIChzbGljZUhkci0+cGljX29yZGVyX2NudF9sc2IgIDwgIHZpZGVvLT5wcmV2UGljT3JkZXJDbnRMc2IgICYmCi0gICAgICAgICAgICAgICAgICAgICh2aWRlby0+cHJldlBpY09yZGVyQ250THNiIC0gc2xpY2VIZHItPnBpY19vcmRlcl9jbnRfbHNiKSAgPj0gKHZpZGVvLT5NYXhQaWNPcmRlckNudExzYiAvIDIpKQotICAgICAgICAgICAgICAgIHZpZGVvLT5QaWNPcmRlckNudE1zYiA9IHZpZGVvLT5wcmV2UGljT3JkZXJDbnRNc2IgKyB2aWRlby0+TWF4UGljT3JkZXJDbnRMc2I7Ci0gICAgICAgICAgICBlbHNlIGlmIChzbGljZUhkci0+cGljX29yZGVyX2NudF9sc2IgID4gIHZpZGVvLT5wcmV2UGljT3JkZXJDbnRMc2IgICYmCi0gICAgICAgICAgICAgICAgICAgICAoc2xpY2VIZHItPnBpY19vcmRlcl9jbnRfbHNiIC0gdmlkZW8tPnByZXZQaWNPcmRlckNudExzYikgID4gKHZpZGVvLT5NYXhQaWNPcmRlckNudExzYiAvIDIpKQotICAgICAgICAgICAgICAgIHZpZGVvLT5QaWNPcmRlckNudE1zYiA9IHZpZGVvLT5wcmV2UGljT3JkZXJDbnRNc2IgLSB2aWRlby0+TWF4UGljT3JkZXJDbnRMc2I7Ci0gICAgICAgICAgICBlbHNlCi0gICAgICAgICAgICAgICAgdmlkZW8tPlBpY09yZGVyQ250TXNiID0gdmlkZW8tPnByZXZQaWNPcmRlckNudE1zYjsKLQotICAgICAgICAgICAgLyogSlZULUkwMTAgcGFnZSA4MSBpcyBkaWZmZXJlbnQgZnJvbSBKTTcuMyAqLwotICAgICAgICAgICAgaWYgKCFzbGljZUhkci0+ZmllbGRfcGljX2ZsYWcgfHwgIXNsaWNlSGRyLT5ib3R0b21fZmllbGRfZmxhZykKLSAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICB2aWRlby0+UGljT3JkZXJDbnQgPSB2aWRlby0+VG9wRmllbGRPcmRlckNudCA9IHZpZGVvLT5QaWNPcmRlckNudE1zYiArIHNsaWNlSGRyLT5waWNfb3JkZXJfY250X2xzYjsKLSAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgaWYgKCFzbGljZUhkci0+ZmllbGRfcGljX2ZsYWcpCi0gICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgdmlkZW8tPkJvdHRvbUZpZWxkT3JkZXJDbnQgPSB2aWRlby0+VG9wRmllbGRPcmRlckNudCArIHNsaWNlSGRyLT5kZWx0YV9waWNfb3JkZXJfY250X2JvdHRvbTsKLSAgICAgICAgICAgIH0KLSAgICAgICAgICAgIGVsc2UgaWYgKHNsaWNlSGRyLT5ib3R0b21fZmllbGRfZmxhZykKLSAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICB2aWRlby0+UGljT3JkZXJDbnQgPSB2aWRlby0+Qm90dG9tRmllbGRPcmRlckNudCA9IHZpZGVvLT5QaWNPcmRlckNudE1zYiArIHNsaWNlSGRyLT5waWNfb3JkZXJfY250X2xzYjsKLSAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgaWYgKCFzbGljZUhkci0+ZmllbGRfcGljX2ZsYWcpCi0gICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgdmlkZW8tPlBpY09yZGVyQ250ID0gQVZDX01JTih2aWRlby0+VG9wRmllbGRPcmRlckNudCwgdmlkZW8tPkJvdHRvbUZpZWxkT3JkZXJDbnQpOwotICAgICAgICAgICAgfQotCi0gICAgICAgICAgICBpZiAodmlkZW8tPmN1cnJQaWNQYXJhbXMtPnBpY19vcmRlcl9wcmVzZW50X2ZsYWcgJiYgIXNsaWNlSGRyLT5maWVsZF9waWNfZmxhZykKLSAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICBzbGljZUhkci0+ZGVsdGFfcGljX29yZGVyX2NudF9ib3R0b20gPSAwOyAvKiBkZWZhdWx0ZWQgdG8gemVybyAqLwotICAgICAgICAgICAgfQotCi0gICAgICAgICAgICBicmVhazsKLSAgICAgICAgY2FzZSAxOiAvKiBQT0MgTU9ERSAxLCBzdWJjbGF1c2UgOC4yLjEuMiAqLwotICAgICAgICAgICAgLyogY2FsY3VsYXRlIEZyYW1lTnVtT2Zmc2V0ICovCi0gICAgICAgICAgICBpZiAodmlkZW8tPm5hbF91bml0X3R5cGUgPT0gQVZDX05BTFRZUEVfSURSKQotICAgICAgICAgICAgewotICAgICAgICAgICAgICAgIGVuY3ZpZC0+ZGlzcE9yZFBPQ1JlZiA9IGN1cnJJbnB1dC0+ZGlzcF9vcmRlcjsgIC8qIHJlc2V0IHRoZSByZWZlcmVuY2UgcG9pbnQgKi8KLSAgICAgICAgICAgICAgICB2aWRlby0+cHJldkZyYW1lTnVtT2Zmc2V0ID0gMDsKLSAgICAgICAgICAgICAgICB2aWRlby0+RnJhbWVOdW1PZmZzZXQgPSAwOwotICAgICAgICAgICAgfQotICAgICAgICAgICAgZWxzZSBpZiAodmlkZW8tPnByZXZGcmFtZU51bSA+IHNsaWNlSGRyLT5mcmFtZV9udW0pCi0gICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgdmlkZW8tPkZyYW1lTnVtT2Zmc2V0ID0gdmlkZW8tPnByZXZGcmFtZU51bU9mZnNldCArIHZpZGVvLT5NYXhGcmFtZU51bTsKLSAgICAgICAgICAgIH0KLSAgICAgICAgICAgIGVsc2UKLSAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICB2aWRlby0+RnJhbWVOdW1PZmZzZXQgPSB2aWRlby0+cHJldkZyYW1lTnVtT2Zmc2V0OwotICAgICAgICAgICAgfQotICAgICAgICAgICAgLyogY2FsY3VsYXRlIGFic0ZyYW1lTnVtICovCi0gICAgICAgICAgICBpZiAoY3VyclNQUy0+bnVtX3JlZl9mcmFtZXNfaW5fcGljX29yZGVyX2NudF9jeWNsZSkKLSAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICB2aWRlby0+YWJzRnJhbWVOdW0gPSB2aWRlby0+RnJhbWVOdW1PZmZzZXQgKyBzbGljZUhkci0+ZnJhbWVfbnVtOwotICAgICAgICAgICAgfQotICAgICAgICAgICAgZWxzZQotICAgICAgICAgICAgewotICAgICAgICAgICAgICAgIHZpZGVvLT5hYnNGcmFtZU51bSA9IDA7Ci0gICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgIGlmICh2aWRlby0+YWJzRnJhbWVOdW0gPiAwICYmIHZpZGVvLT5uYWxfcmVmX2lkYyA9PSAwKQotICAgICAgICAgICAgewotICAgICAgICAgICAgICAgIHZpZGVvLT5hYnNGcmFtZU51bS0tOwotICAgICAgICAgICAgfQotCi0gICAgICAgICAgICAvKiBkZXJpdmUgcGljT3JkZXJDbnRDeWNsZUNudCBhbmQgZnJhbWVOdW1JblBpY09yZGVyQ250Q3ljbGUgKi8KLSAgICAgICAgICAgIGlmICh2aWRlby0+YWJzRnJhbWVOdW0gPiAwKQotICAgICAgICAgICAgewotICAgICAgICAgICAgICAgIHZpZGVvLT5waWNPcmRlckNudEN5Y2xlQ250ID0gKHZpZGVvLT5hYnNGcmFtZU51bSAtIDEpIC8gY3VyclNQUy0+bnVtX3JlZl9mcmFtZXNfaW5fcGljX29yZGVyX2NudF9jeWNsZTsKLSAgICAgICAgICAgICAgICB2aWRlby0+ZnJhbWVOdW1JblBpY09yZGVyQ250Q3ljbGUgPSAodmlkZW8tPmFic0ZyYW1lTnVtIC0gMSkgJSBjdXJyU1BTLT5udW1fcmVmX2ZyYW1lc19pbl9waWNfb3JkZXJfY250X2N5Y2xlOwotICAgICAgICAgICAgfQotICAgICAgICAgICAgLyogZGVyaXZlIGV4cGVjdGVkRGVsdGFQZXJQaWNPcmRlckNudEN5Y2xlLCB0aGlzIHZhbHVlIGNhbiBiZSBjb21wdXRlZCB1cCBmcm9udC4gKi8KLSAgICAgICAgICAgIHZpZGVvLT5leHBlY3RlZERlbHRhUGVyUGljT3JkZXJDbnRDeWNsZSA9IDA7Ci0gICAgICAgICAgICBmb3IgKGkgPSAwOyBpIDwgKGludCljdXJyU1BTLT5udW1fcmVmX2ZyYW1lc19pbl9waWNfb3JkZXJfY250X2N5Y2xlOyBpKyspCi0gICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgdmlkZW8tPmV4cGVjdGVkRGVsdGFQZXJQaWNPcmRlckNudEN5Y2xlICs9IGN1cnJTUFMtPm9mZnNldF9mb3JfcmVmX2ZyYW1lW2ldOwotICAgICAgICAgICAgfQotICAgICAgICAgICAgLyogZGVyaXZlIGV4cGVjdGVkUGljT3JkZXJDbnQgKi8KLSAgICAgICAgICAgIGlmICh2aWRlby0+YWJzRnJhbWVOdW0pCi0gICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgdmlkZW8tPmV4cGVjdGVkUGljT3JkZXJDbnQgPSB2aWRlby0+cGljT3JkZXJDbnRDeWNsZUNudCAqIHZpZGVvLT5leHBlY3RlZERlbHRhUGVyUGljT3JkZXJDbnRDeWNsZTsKLSAgICAgICAgICAgICAgICBmb3IgKGkgPSAwOyBpIDw9IHZpZGVvLT5mcmFtZU51bUluUGljT3JkZXJDbnRDeWNsZTsgaSsrKQotICAgICAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAgICAgdmlkZW8tPmV4cGVjdGVkUGljT3JkZXJDbnQgKz0gY3VyclNQUy0+b2Zmc2V0X2Zvcl9yZWZfZnJhbWVbaV07Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgfQotICAgICAgICAgICAgZWxzZQotICAgICAgICAgICAgewotICAgICAgICAgICAgICAgIHZpZGVvLT5leHBlY3RlZFBpY09yZGVyQ250ID0gMDsKLSAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgaWYgKHZpZGVvLT5uYWxfcmVmX2lkYyA9PSAwKQotICAgICAgICAgICAgewotICAgICAgICAgICAgICAgIHZpZGVvLT5leHBlY3RlZFBpY09yZGVyQ250ICs9IGN1cnJTUFMtPm9mZnNldF9mb3Jfbm9uX3JlZl9waWM7Ci0gICAgICAgICAgICB9Ci0gICAgICAgICAgICAvKiBkZXJpdmUgVG9wRmllbGRPcmRlckNudCBhbmQgQm90dG9tRmllbGRPcmRlckNudCAqLwotICAgICAgICAgICAgLyogZW5jb2RpbmcgcGFydCAqLwotICAgICAgICAgICAgaWYgKCFjdXJyU1BTLT5kZWx0YV9waWNfb3JkZXJfYWx3YXlzX3plcm9fZmxhZykKLSAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICBzbGljZUhkci0+ZGVsdGFfcGljX29yZGVyX2NudFswXSA9IGN1cnJJbnB1dC0+ZGlzcF9vcmRlciAtIGVuY3ZpZC0+ZGlzcE9yZFBPQ1JlZiAtIHZpZGVvLT5leHBlY3RlZFBpY09yZGVyQ250OwotCi0gICAgICAgICAgICAgICAgaWYgKHZpZGVvLT5jdXJyUGljUGFyYW1zLT5waWNfb3JkZXJfcHJlc2VudF9mbGFnICYmICFzbGljZUhkci0+ZmllbGRfcGljX2ZsYWcpCi0gICAgICAgICAgICAgICAgewotICAgICAgICAgICAgICAgICAgICBzbGljZUhkci0+ZGVsdGFfcGljX29yZGVyX2NudFsxXSA9IHNsaWNlSGRyLT5kZWx0YV9waWNfb3JkZXJfY250WzBdOyAvKiBzaG91bGQgYmUgY2FsY3VsYXRlZCBmcm9tIGN1cnJJbnB1dC0+Ym90dG9tX2ZpZWxkLT5kaXNwX29yZGVyICovCi0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgIGVsc2UKLSAgICAgICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgICAgIHNsaWNlSGRyLT5kZWx0YV9waWNfb3JkZXJfY250WzFdID0gMDsKLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICB9Ci0gICAgICAgICAgICBlbHNlCi0gICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgc2xpY2VIZHItPmRlbHRhX3BpY19vcmRlcl9jbnRbMF0gPSBzbGljZUhkci0+ZGVsdGFfcGljX29yZGVyX2NudFsxXSA9IDA7Ci0gICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgIGlmIChzbGljZUhkci0+ZmllbGRfcGljX2ZsYWcgPT0gMCkKLSAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICB2aWRlby0+VG9wRmllbGRPcmRlckNudCA9IHZpZGVvLT5leHBlY3RlZFBpY09yZGVyQ250ICsgc2xpY2VIZHItPmRlbHRhX3BpY19vcmRlcl9jbnRbMF07Ci0gICAgICAgICAgICAgICAgdmlkZW8tPkJvdHRvbUZpZWxkT3JkZXJDbnQgPSB2aWRlby0+VG9wRmllbGRPcmRlckNudCArIGN1cnJTUFMtPm9mZnNldF9mb3JfdG9wX3RvX2JvdHRvbV9maWVsZCArIHNsaWNlSGRyLT5kZWx0YV9waWNfb3JkZXJfY250WzFdOwotCi0gICAgICAgICAgICAgICAgdmlkZW8tPlBpY09yZGVyQ250ID0gQVZDX01JTih2aWRlby0+VG9wRmllbGRPcmRlckNudCwgdmlkZW8tPkJvdHRvbUZpZWxkT3JkZXJDbnQpOwotICAgICAgICAgICAgfQotICAgICAgICAgICAgZWxzZSBpZiAoc2xpY2VIZHItPmJvdHRvbV9maWVsZF9mbGFnID09IDApCi0gICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgdmlkZW8tPlRvcEZpZWxkT3JkZXJDbnQgPSB2aWRlby0+ZXhwZWN0ZWRQaWNPcmRlckNudCArIHNsaWNlSGRyLT5kZWx0YV9waWNfb3JkZXJfY250WzBdOwotICAgICAgICAgICAgICAgIHZpZGVvLT5QaWNPcmRlckNudCA9IHZpZGVvLT5Ub3BGaWVsZE9yZGVyQ250OwotICAgICAgICAgICAgfQotICAgICAgICAgICAgZWxzZQotICAgICAgICAgICAgewotICAgICAgICAgICAgICAgIHZpZGVvLT5Cb3R0b21GaWVsZE9yZGVyQ250ID0gdmlkZW8tPmV4cGVjdGVkUGljT3JkZXJDbnQgKyBjdXJyU1BTLT5vZmZzZXRfZm9yX3RvcF90b19ib3R0b21fZmllbGQgKyBzbGljZUhkci0+ZGVsdGFfcGljX29yZGVyX2NudFswXTsKLSAgICAgICAgICAgICAgICB2aWRlby0+UGljT3JkZXJDbnQgPSB2aWRlby0+Qm90dG9tRmllbGRPcmRlckNudDsKLSAgICAgICAgICAgIH0KLSAgICAgICAgICAgIGJyZWFrOwotCi0KLSAgICAgICAgY2FzZSAyOiAvKiBQT0MgTU9ERSAyLCBzdWJjbGF1c2UgOC4yLjEuMyAqLwotICAgICAgICAgICAgLyogZGVjb2Rpbmcgb3JkZXIgbXVzdCBiZSB0aGUgc2FtZSBhcyBkaXNwbGF5IG9yZGVyICovCi0gICAgICAgICAgICAvKiB3ZSBkb24ndCBjaGVjayBmb3IgdGhhdC4gVGhlIGRlY29kZXIgd2lsbCBqdXN0IG91dHB1dCBpbiBkZWNvZGluZyBvcmRlci4gKi8KLSAgICAgICAgICAgIC8qIENoZWNrIGZvciAyIGNvbnNlY3V0aXZlIG5vbi1yZWZlcmVuY2UgZnJhbWUgKi8KLSAgICAgICAgICAgIGlmICh2aWRlby0+bmFsX3JlZl9pZGMgPT0gMCkKLSAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICBpZiAoZW5jdmlkLT5kaXNwT3JkUE9DUmVmID09IDEpCi0gICAgICAgICAgICAgICAgewotICAgICAgICAgICAgICAgICAgICByZXR1cm4gQVZDRU5DX0NPTlNFQ1VUSVZFX05PTlJFRjsKLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgZW5jdmlkLT5kaXNwT3JkUE9DUmVmID0gMTsgIC8qIGFjdCBhcyBhIGZsYWcgZm9yIG5vbiByZWYgKi8KLSAgICAgICAgICAgIH0KLSAgICAgICAgICAgIGVsc2UKLSAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICBlbmN2aWQtPmRpc3BPcmRQT0NSZWYgPSAwOwotICAgICAgICAgICAgfQotCi0KLSAgICAgICAgICAgIGlmICh2aWRlby0+bmFsX3VuaXRfdHlwZSA9PSBBVkNfTkFMVFlQRV9JRFIpCi0gICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgdmlkZW8tPkZyYW1lTnVtT2Zmc2V0ID0gMDsKLSAgICAgICAgICAgIH0KLSAgICAgICAgICAgIGVsc2UgaWYgKHZpZGVvLT5wcmV2RnJhbWVOdW0gPiBzbGljZUhkci0+ZnJhbWVfbnVtKQotICAgICAgICAgICAgewotICAgICAgICAgICAgICAgIHZpZGVvLT5GcmFtZU51bU9mZnNldCA9IHZpZGVvLT5wcmV2RnJhbWVOdW1PZmZzZXQgKyB2aWRlby0+TWF4RnJhbWVOdW07Ci0gICAgICAgICAgICB9Ci0gICAgICAgICAgICBlbHNlCi0gICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgdmlkZW8tPkZyYW1lTnVtT2Zmc2V0ID0gdmlkZW8tPnByZXZGcmFtZU51bU9mZnNldDsKLSAgICAgICAgICAgIH0KLSAgICAgICAgICAgIC8qIGRlcml2ZSB0ZW1wUGljT3JkZXJDbnQsIHdlIGp1c3QgdXNlIFBpY09yZGVyQ250ICovCi0gICAgICAgICAgICBpZiAodmlkZW8tPm5hbF91bml0X3R5cGUgPT0gQVZDX05BTFRZUEVfSURSKQotICAgICAgICAgICAgewotICAgICAgICAgICAgICAgIHZpZGVvLT5QaWNPcmRlckNudCA9IDA7Ci0gICAgICAgICAgICB9Ci0gICAgICAgICAgICBlbHNlIGlmICh2aWRlby0+bmFsX3JlZl9pZGMgPT0gMCkKLSAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICB2aWRlby0+UGljT3JkZXJDbnQgPSAyICogKHZpZGVvLT5GcmFtZU51bU9mZnNldCArIHNsaWNlSGRyLT5mcmFtZV9udW0pIC0gMTsKLSAgICAgICAgICAgIH0KLSAgICAgICAgICAgIGVsc2UKLSAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICB2aWRlby0+UGljT3JkZXJDbnQgPSAyICogKHZpZGVvLT5GcmFtZU51bU9mZnNldCArIHNsaWNlSGRyLT5mcmFtZV9udW0pOwotICAgICAgICAgICAgfQotICAgICAgICAgICAgLyogZGVyaXZlIFRvcEZpZWxkT3JkZXJDbnQgYW5kIEJvdHRvbUZpZWxkT3JkZXJDbnQgKi8KLSAgICAgICAgICAgIGlmIChzbGljZUhkci0+ZmllbGRfcGljX2ZsYWcgPT0gMCkKLSAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICB2aWRlby0+VG9wRmllbGRPcmRlckNudCA9IHZpZGVvLT5Cb3R0b21GaWVsZE9yZGVyQ250ID0gdmlkZW8tPlBpY09yZGVyQ250OwotICAgICAgICAgICAgfQotICAgICAgICAgICAgZWxzZSBpZiAoc2xpY2VIZHItPmJvdHRvbV9maWVsZF9mbGFnKQotICAgICAgICAgICAgewotICAgICAgICAgICAgICAgIHZpZGVvLT5Cb3R0b21GaWVsZE9yZGVyQ250ID0gdmlkZW8tPlBpY09yZGVyQ250OwotICAgICAgICAgICAgfQotICAgICAgICAgICAgZWxzZQotICAgICAgICAgICAgewotICAgICAgICAgICAgICAgIHZpZGVvLT5Ub3BGaWVsZE9yZGVyQ250ID0gdmlkZW8tPlBpY09yZGVyQ250OwotICAgICAgICAgICAgfQotICAgICAgICAgICAgYnJlYWs7Ci0gICAgICAgIGRlZmF1bHQ6Ci0gICAgICAgICAgICByZXR1cm4gQVZDRU5DX1BPQ19GQUlMOwotICAgIH0KLQotICAgIHJldHVybiBBVkNFTkNfU1VDQ0VTUzsKLX0KLQotLyoqIHNlZSBzdWJjbGF1c2UgOC4yLjEgKi8KLUFWQ0VuY19TdGF0dXMgUG9zdFBPQyhBVkNDb21tb25PYmogKnZpZGVvKQotewotICAgIEFWQ1NsaWNlSGVhZGVyICpzbGljZUhkciA9IHZpZGVvLT5zbGljZUhkcjsKLSAgICBBVkNTZXFQYXJhbVNldCAqY3VyclNQUyA9IHZpZGVvLT5jdXJyU2VxUGFyYW1zOwotCi0gICAgdmlkZW8tPnByZXZGcmFtZU51bSA9IHNsaWNlSGRyLT5mcmFtZV9udW07Ci0KLSAgICBzd2l0Y2ggKGN1cnJTUFMtPnBpY19vcmRlcl9jbnRfdHlwZSkKLSAgICB7Ci0gICAgICAgIGNhc2UgMDogLyogc3ViY2xhdXNlIDguMi4xLjEgKi8KLSAgICAgICAgICAgIGlmICh2aWRlby0+bWVtX21ncl9jdHJsX2VxXzUpCi0gICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgdmlkZW8tPnByZXZQaWNPcmRlckNudE1zYiA9IDA7Ci0gICAgICAgICAgICAgICAgdmlkZW8tPnByZXZQaWNPcmRlckNudExzYiA9IHZpZGVvLT5Ub3BGaWVsZE9yZGVyQ250OwotICAgICAgICAgICAgfQotICAgICAgICAgICAgZWxzZQotICAgICAgICAgICAgewotICAgICAgICAgICAgICAgIHZpZGVvLT5wcmV2UGljT3JkZXJDbnRNc2IgPSB2aWRlby0+UGljT3JkZXJDbnRNc2I7Ci0gICAgICAgICAgICAgICAgdmlkZW8tPnByZXZQaWNPcmRlckNudExzYiA9IHNsaWNlSGRyLT5waWNfb3JkZXJfY250X2xzYjsKLSAgICAgICAgICAgIH0KLSAgICAgICAgICAgIGJyZWFrOwotICAgICAgICBjYXNlIDE6ICAvKiBzdWJjbGF1c2UgOC4yLjEuMiBhbmQgOC4yLjEuMyAqLwotICAgICAgICBjYXNlIDI6Ci0gICAgICAgICAgICBpZiAodmlkZW8tPm1lbV9tZ3JfY3RybF9lcV81KQotICAgICAgICAgICAgewotICAgICAgICAgICAgICAgIHZpZGVvLT5wcmV2RnJhbWVO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ovCi0gICAgICAgIHZpZGVvLT5NYXhQaWNOdW0gPSB2aWRlby0+TWF4RnJhbWVOdW07Ci0KLSAgICAgICAgLyoqKioqKioqKioqKiogc2V0IHRoZSBTUFMgKioqKioqKioqKioqKioqKioqKi8KLSAgICAgICAgc2VxUGFyYW0tPnNlcV9wYXJhbWV0ZXJfc2V0X2lkID0gMDsgLyogc3RhcnQgd2l0aCB6ZXJvICovCi0gICAgICAgIC8qIFBPQyAqLwotICAgICAgICBzZXFQYXJhbS0+cGljX29yZGVyX2NudF90eXBlID0gZW5jUGFyYW0tPnBvY190eXBlOyAvKiBQT0MgdHlwZSAqLwotICAgICAgICBpZiAoZW5jUGFyYW0tPnBvY190eXBlID09IDApCi0gICAgICAgIHsKLSAgICAgICAgICAgIGlmICgvKmVuY1BhcmFtLT5sb2cyX21heF9wb2NfbHNiX21pbnVzXzQ8MCB8fCAobm8gbmVlZCwgaXQncyB1bnNpZ25lZCkqLwotICAgICAgICAgICAgICAgIGVuY1BhcmFtLT5sb2cyX21heF9wb2NfbHNiX21pbnVzXzQgPiAxMikKLSAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICByZXR1cm4gQVZDRU5DX0lOVkFMSURfUE9DX0xTQjsKLSAgICAgICAgICAgIH0KLSAgICAgICAgICAgIHNlcVBhcmFtLT5sb2cyX21heF9waWNfb3JkZXJfY250X2xzYl9taW51czQgPSBlbmNQYXJhbS0+bG9nMl9tYXhfcG9jX2xzYl9taW51c180OwotICAgICAgICB9Ci0gICAgICAgIGVsc2UgaWYgKGVuY1BhcmFtLT5wb2NfdHlwZSA9PSAxKQotICAgICAgICB7Ci0gICAgICAgICAgICBzZXFQYXJhbS0+ZGVsdGFfcGljX29yZGVyX2Fsd2F5c196ZXJvX2ZsYWcgPSBlbmNQYXJhbS0+ZGVsdGFfcG9jX3plcm9fZmxhZzsKLSAgICAgICAgICAgIHNlcVBhcmFtLT5vZmZzZXRfZm9yX25vbl9yZWZfcGljID0gZW5jUGFyYW0tPm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lcVBhcmFtLT5sb2cyX21heF9mcmFtZV9udW1fbWludXM0ID0gZXh0Uy0+bG9nMl9tYXhfZnJhbWVfbnVtX21pbnVzNDsKLSAgICAgICAgdmlkZW8tPk1heEZyYW1lTnVtID0gMSA8PCAoZXh0Uy0+bG9nMl9tYXhfZnJhbWVfbnVtX21pbnVzNCArIDQpOwotICAgICAgICB2aWRlby0+TWF4UGljTnVtID0gdmlkZW8tPk1heEZyYW1lTnVtOwotICAgICAgICBpZiAoZW5jUGFyYW0tPmlkcl9wZXJpb2QgPiAoaW50KSh2aWRlby0+TWF4RnJhbWVOdW0pIHx8IChlbmNQYXJhbS0+aWRyX3BlcmlvZCA9PSAtMSkpCi0gICAgICAgIHsKLSAgICAgICAgICAgIGVuY1BhcmFtLT5pZHJfcGVyaW9kID0gKGludCl2aWRlby0+TWF4RnJhbWVOdW07Ci0gICAgICAgIH0KLQotICAgICAgICBzZXFQYXJhbS0+cGljX29yZGVyX2NudF90eXBlID0gZXh0Uy0+cGljX29yZGVyX2NudF90eXBlOwotICAgICAgICBpZiAoc2VxUGFyYW0tPnBpY19vcmRlcl9jbnRfdHlwZSA9PSAwKQotICAgICAgICB7Ci0gICAgICAgICAgICBpZiAoLypleHRTLT5sb2cyX21heF9waWNfb3JkZXJfY250X2xzYl9taW51czQ8MCB8fCAobm8gbmVlZCBpdCdzIHVuc2lnbmVkKSovCi0gICAgICAgICAgICAgICAgZXh0Uy0+bG9nMl9tYXhfcGljX29yZGVyX2NudF9sc2JfbWludXM0ID4gMTIpCi0gICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgcmV0dXJuIEFWQ0VOQ19JTlZBTElEX1BPQ19MU0I7Ci0gICAgICAgICAgICB9Ci0gICAgICAgICAgICBzZXFQYXJhbS0+bG9nMl9tYXhfcGljX29yZGVyX2NudF9sc2JfbWludXM0ID0gZXh0Uy0+bG9nMl9tYXhfcGljX29yZGVyX2NudF9sc2JfbWludXM0OwotICAgICAgICB9Ci0gICAgICAgIGV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TsKLSAgICAgICAgICAgIHN3aXRjaCAoZW5jUGFyYW0tPmZtb190eXBlKQotICAgICAgICAgICAgewotICAgICAgICAgICAgICAgIGNhc2UgMDoKLSAgICAgICAgICAgICAgICAgICAgZm9yIChpaSA9IDA7IGlpIDw9IChpbnQpcGljUGFyYW0tPm51bV9zbGljZV9ncm91cHNfbWludXMxOyBpaSsrKQotICAgICAgICAgICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgICAgICAgICBwaWNQYXJhbS0+cnVuX2xlbmd0aF9taW51czFbaWldID0gZW5jUGFyYW0tPnJ1bl9sZW5ndGhfbWludXMxW2lpXTsKLSAgICAgICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgICAgICBicmVhazsKLSAgICAgICAgICAgICAgICBjYXNlIDI6Ci0gICAgICAgICAgICAgICAgICAgIGZvciAoaWkgPSAwOyBpaSA8IChpbnQpcGljUGFyYW0tPm51bV9zbGljZV9ncm91cHNfbWludXMxOyBpaSsrKQotICAgICAgICAgICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgICAgICAgICBwaWNQYXJhbS0+dG9wX2xlZnRbaWldID0gZW5jUGFyYW0tPnRvcF9sZWZ0W2lpXTsKLSAgICAgICAgICAgICAgICAgICAgICAgIHBpY1BhcmFtLT5ib3R0b21fcmlnaHRbaWldID0gZW5jUGFyYW0tPmJvdHRvbV9yaWdodFtpaV07Ci0gICAgICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICAgICAgYnJlYWs7Ci0gICAgICAgICAgICAgICAgY2FzZSAzOgotICAgICAgICAgICAgICAgIGNhc2UgNDoKLSAgICAgICAgICAgICAgICBjYXNlIDU6Ci0gICAgICAgICAgICAgICAgICAgIGlmIChlbmNQYXJhbS0+Y2hhbmdlX2Rpcl9mbGFnID09IEFWQ19PTikKLSAgICAgICAgICAgICAgICAgICAgewotICAgICAgICAgICAgICAgICAgICAgICAgcGljUGFyYW0tPnNsaWNlX2dyb3VwX2NoYW5nZV9kaXJlY3Rpb25fZmxhZyA9IFRSVUU7Ci0gICAgICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICAgICAgZWxzZQotICAgICAgICAgICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgICAgICAgICBwaWNQYXJhbS0+c2xpY2VfZ3JvdXBfY2hhbmdlX2RpcmVjdGlvbl9mbGFnID0gRkFMU0U7Ci0gICAgICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICAgICAgaWYgKC8qZW5jUGFyYW0tPmNoYW5nZV9yYXRlX21pbnVzMSA8IDAgfHwgKG5vIG5lZWQgaXQncyB1bnNpZ25lZCkgKi8KLSAgICAgICAgICAgICAgICAgICAgICAgIGVuY1BhcmFtLT5jaGFuZ2VfcmF0ZV9taW51czEgPiB2aWRlby0+UGljU2l6ZUluTWFwVW5pdHMgLSAxKQotICAgICAgICAgICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gQVZDRU5DX0lOVkFMSURfQ0hBTkdFX1JBVEU7Ci0gICAgICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICAgICAgcGljUGFyYW0tPnNsaWNlX2dyb3VwX2NoYW5nZV9yYXRlX21pbnVzMSA9IGVuY1BhcmFtLT5jaGFuZ2VfcmF0ZV9taW51czE7Ci0gICAgICAgICAgICAgICAgICAgIHZpZGVvLT5TbGljZUdyb3VwQ2hhbmdlUmF0ZSA9IHBpY1BhcmFtLT5zbGljZV9ncm91cF9jaGFuZ2VfcmF0ZV9taW51czEgKyAxOwotICAgICAgICAgICAgICAgICAgICBicmVhazsKLSAgICAgICAgICAgICAgICBjYXNlIDY6Ci0gICAgICAgICAgICAgICAgICAgIHBpY1BhcmFtLT5waWNfc2l6ZV9pbl9tYXBfdW5pdHNfbWludXMxID0gdmlkZW8tPlBpY1NpemVJbk1hcFVuaXRzIC0gMTsKLQotICAgICAgICAgICAgICAgICAgICAvKiBhbGxvY2F0ZSBwaWNQYXJhbS0+c2xpY2VfZ3JvdXBfaWQgKi8KLSAgICAgICAgICAgICAgICAgICAgcGljUGFyYW0tPnNsaWNlX2dyb3VwX2lkID0gKHVpbnQqKWF2Y0hhbmRsZS0+Q0JBVkNfTWFsbG9jKHVzZXJEYXRhLCBzaXplb2YodWludCkgKiB2aWRlby0+UGljU2l6ZUluTWFwVW5pdHMsIERFRkFVTFRfQVRUUik7Ci0gICAgICAgICAgICAgICAgICAgIGlmIChwaWNQYXJhbS0+c2xpY2VfZ3JvdXBfaWQgPT0gTlVMTCkKLSAgICAgICAgICAgICAgICAgICAgewotICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIEFWQ0VOQ19NRU1PUllfRkFJTDsKLSAgICAgICAgICAgICAgICAgICAgfQotCi0gICAgICAgICAgICAgICAgICAgIGlmIChlbmNQYXJhbS0+c2xpY2VfZ3JvdXAgPT0gTlVMTCkKLSAgICAgICAgICAgICAgICAgICAgewotICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIEFWQ0VOQ19FTkNQQVJBTV9NRU1fRkFJTDsKLSAgICAgICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgICAgICBmb3IgKGlpID0gMDsgaWkgPCAoaW50KXZpZGVvLT5QaWNTaXplSW5NYXBVbml0czsgaWkrKykKLSAgICAgICAgICAgICAgICAgICAgewotICAgICAgICAgICAgICAgICAgICAgICAgcGljUGFyYW0tPnNsaWNlX2dyb3VwX2lkW2lpXSA9IGVuY1BhcmFtLT5zbGljZV9ncm91cFtpaV07Ci0gICAgICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICAgICAgYnJlYWs7Ci0gICAgICAgICAgICAgICAgZGVmYXVsdDoKLSAgICAgICAgICAgICAgICAgICAgcmV0dXJuIEFWQ0VOQ19JTlZBTElEX0ZNT19UWVBFOwotICAgICAgICAgICAgfQotICAgICAgICB9Ci0gICAgICAgIHBpY1BhcmFtLT5udW1fcmVmX2lkeF9sMF9hY3RpdmVfbWludXMxID0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cmFtLT5udW1fc2xpY2VfZ3JvdXBzX21pbnVzMSA9IGV4dFAtPm51bV9zbGljZV9ncm91cHNfbWludXMxOwotCi0gICAgICAgIGlmIChwaWNQYXJhbS0+bnVtX3NsaWNlX2dyb3Vwc19taW51czEgPiAwKQotICAgICAgICB7Ci0gICAgICAgICAgICBwaWNQYXJhbS0+c2xpY2VfZ3JvdXBfbWFwX3R5cGUgPSBleHRQLT5zbGljZV9ncm91cF9tYXBfdHlwZTsKLSAgICAgICAgICAgIHN3aXRjaCAoZXh0UC0+c2xpY2VfZ3JvdXBfbWFwX3R5cGUpCi0gICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgY2FzZSAwOgotICAgICAgICAgICAgICAgICAgICBmb3IgKGlpID0gMDsgaWkgPD0gKGludClleHRQLT5udW1fc2xpY2VfZ3JvdXBzX21pbnVzMTsgaWkrKykKLSAgICAgICAgICAgICAgICAgICAgewotICAgICAgICAgICAgICAgICAgICAgICAgcGljUGFyYW0tPnJ1bl9sZW5ndGhfbWludXMxW2lpXSA9IGV4dFAtPnJ1bl9sZW5ndGhfbWludXMxW2lpXTsKLSAgICAgICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgICAgICBicmVhazsKLSAgICAgICAgICAgICAgICBjYXNlIDI6Ci0gICAgICAgICAgICAgICAgICAgIGZvciAoaWkgPSAwOyBpaSA8IChpbnQpcGljUGFyYW0tPm51bV9zbGljZV9ncm91cHNfbWludXMxOyBpaSsrKQotICAgICAgICAgICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgICAgICAgICBwaWNQYXJhbS0+dG9wX2xlZnRbaWldID0gZXh0UC0+dG9wX2xlZnRbaWldOwotICAgICAgICAgICAgICAgICAgICAgICAgcGljUGFyYW0tPmJvdHRvbV9yaWdodFtpaV0gPSBleHRQLT5ib3R0b21fcmlnaHRbaWldOwotICAgICAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgICAgIGJyZWFrOwotICAgICAgICAgICAgICAgIGNhc2UgMzoKLSAgICAgICAgICAgICAgICBjYXNlIDQ6Ci0gICAgICAgICAgICAgICAgY2FzZSA1OgotICAgICAgICAgICAgICAgICAgICBwaWNQYXJhbS0+c2xpY2VfZ3JvdXBfY2hhbmdlX2RpcmVjdGlvbl9mbGFnID0gZXh0UC0+c2xpY2VfZ3JvdXBfY2hhbmdlX2RpcmVjdGlvbl9mbGFnOwotICAgICAgICAgICAgICAgICAgICBpZiAoLypleHRQLT5zbGljZV9ncm91cF9jaGFuZ2VfcmF0ZV9taW51czEgPCAwIHx8IChubyBuZWVkLCBpdCdzIHVuc2lnbmVkKSAqLwotICAgICAgICAgICAgICAgICAgICAgICAgZXh0UC0+c2xpY2VfZ3JvdXBfY2hhbmdlX3JhdGVfbWludXMxID4gdmlkZW8tPlBpY1NpemVJbk1hcFVuaXRzIC0gMSkKLSAgICAgICAgICAgICAgICAgICAgewotICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIEFWQ0VOQ19JTlZBTElEX0NIQU5HRV9SQVRFOwotICAgICAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgICAgIHBpY1BhcmFtLT5zbGljZV9ncm91cF9jaGFuZ2VfcmF0ZV9taW51czEgPSBleHRQLT5zbGljZV9ncm91cF9jaGFuZ2VfcmF0ZV9taW51czE7Ci0gICAgICAgICAgICAgICAgICAgIHZpZGVvLT5TbGljZUdyb3VwQ2hhbmdlUmF0ZSA9IHBpY1BhcmFtLT5zbGljZV9ncm91cF9jaGFuZ2VfcmF0ZV9taW51czEgKyAxOwotICAgICAgICAgICAgICAgICAgICBicmVhazsKLSAgICAgICAgICAgICAgICBjYXNlIDY6Ci0gICAgICAgICAgICAgICAgICAgIGlmIChleHRQLT5waWNfc2l6ZV9pbl9tYXBfdW5pdHNfbWludXMxICE9IHZpZGVvLT5QaWNTaXplSW5NYXBVbml0cyAtIDEpCi0gICAgICAgICAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBBVkNFTkNfTk9UX1NVUFBPUlRFRDsKLSAgICAgICAgICAgICAgICAgICAgfQotCi0gICAgICAgICAgICAgICAgICAgIHBpY1BhcmFtLT5waWNfc2l6ZV9pbl9tYXBfdW5pdHNfbWludXMxID0gZXh0UC0+cGljX3NpemVfaW5fbWFwX3VuaXRzX21pbnVzMTsKLQotICAgICAgICAgICAgICAgICAgICAvKiBhbGxvY2F0ZSBwaWNQYXJhbS0+c2xpY2VfZ3JvdXBfaWQgKi8KLSAgICAgICAgICAgICAgICAgICAgcGljUGFyYW0tPnNsaWNlX2dyb3VwX2lkID0gKHVpbnQqKWF2Y0hhbmRsZS0+Q0JBVkNfTWFsbG9jKHVzZXJEYXRhLCBzaXplb2YodWludCkgKiB2aWRlby0+UGljU2l6ZUluTWFwVW5pdHMsIERFRkFVTFRfQVRUUik7Ci0gICAgICAgICAgICAgICAgICAgIGlmIChwaWNQYXJhbS0+c2xpY2VfZ3JvdXBfaWQgPT0gTlVMTCkKLSAgICAgICAgICAgICAgICAgICAgewotICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIEFWQ0VOQ19NRU1PUllfRkFJTDsKLSAgICAgICAgICAgICAgICAgICAgfQotCi0gICAgICAgICAgICAgICAgICAgIGlmIChleHRQLT5zbGljZV9ncm91cF9pZCA9PSBOVUxMKQotICAgICAgICAgICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gQVZDRU5DX0VOQ1BBUkFNX01FTV9GQUlMOwotICAgICAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgICAgIGZvciAoaWkgPSAwOyBpaSA8IChpbnQpdmlkZW8tPlBpY1NpemVJbk1hcFVuaXRzOyBpaSsrKQotICAgICAgICAgICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgICAgICAgICBwaWNQYXJhbS0+c2xpY2VfZ3JvdXBfaWRbaWldID0gZXh0UC0+c2xpY2VfZ3JvdXBfaWRbaWldOwotICAgICAgICA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KSh2aWRlby0+UGljU2l6ZUluTWJzICogcmF0ZUN0cmwtPmZyYW1lX3JhdGUgKyAwLjUpOwotICAgIGRwYl9zaXplID0gKHNlcVBhcmFtLT5udW1fcmVmX2ZyYW1lcyAqIHZpZGVvLT5QaWNTaXplSW5NYnMgKiAzKSA+PiA2OwotCi0gICAgaWYgKHNlcVBhcmFtLT5sZXZlbF9pZGMgPT0gMCkgLyogZmluZCBsZXZlbCBmb3IgdGhpcyBzZXR0aW5nICovCi0gICAgewotICAgICAgICBmb3IgKGlpID0gMDsgaWkgPCBNQVhfTEVWRUxfSURYOyBpaSsrKQotICAgICAgICB7Ci0gICAgICAgICAgICBpZiAobWJfcGVyX3NlYyA8PSBNYXhNQlBTW2lpXSAmJgotICAgICAgICAgICAgICAgICAgICB2aWRlby0+UGljU2l6ZUluTWJzIDw9ICh1aW50KU1heEZTW2lpXSAmJgotICAgICAgICAgICAgICAgICAgICByYXRlQ3RybC0+Yml0UmF0ZSA8PSAoaW50MzIpTWF4QlJbaWldKjEwMDAgJiYKLSAgICAgICAgICAgICAgICAgICAgcmF0ZUN0cmwtPmNwYlNpemUgPD0gKGludDMyKU1heENQQltpaV0qMTAwMCAmJgotICAgICAgICAgICAgICAgICAgICByYXRlQ3RybC0+bXZSYW5nZSA8PSBNYXhWbXZSW2lpXSAmJgotICAgICAgICAgICAgICAgICAgICBkcGJfc2l6ZSA8PSBNYXhEUEJYMltpaV0qNTEyKQotICAgICAgICAgICAgewotICAgICAgICAgICAgICAgIHNlcVBhcmFtLT5sZXZlbF9pZGMgPSBtYXBJZHgyTGV2W2lpXTsKLSAgICAgICAgICAgICAgICBicmVhazsKLSAgICAgICAgICAgIH0KLSAgICAgICAgfQotICAgICAgICBpZiAoc2VxUGFyYW0tPmxldmVsX2lkYyA9PSAwKQotICAgICAgICB7Ci0gICAgICAgICAgICByZXR1cm4gQVZDRU5DX0xFVkVMX05PVF9TVVBQT1JURUQ7Ci0gICAgICAgIH0KLSAgICB9Ci0KLSA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4ZWwgYXJlIHRoZQotICAgICAgICBhY3R1YWwgcmVjb25zdHJ1Y3RlZCBwaXhlbHMuICovCi0gICAgICAgIGludHJhID0gSW50cmFEZWNpc2lvbkFCRShlbmN2aWQsIG1pbl9jb3N0LCBjdXJMLCBwaWNQaXRjaCk7Ci0gICAgfQotCi0gICAgaWYgKGludHJhID09IHRydWUgfHwgdmlkZW8tPnNsaWNlX3R5cGUgPT0gQVZDX0lfU0xJQ0UpCi0gICAgewotICAgICAgICBvcmdZID0gY3VycklucHV0LT5ZQ2JDclswXSArIHlfcG9zICogb3JnUGl0Y2ggKyB4X3BvczsKLQotICAgICAgICAvKiBpMTYgbW9kZSBzZWFyY2ggKi8KLSAgICAgICAgLyogZ2VuZXJhdGUgYWxsIHRoZSBwcmVkaWN0aW9ucyAqLwotICAgICAgICBpbnRyYXByZWRfbHVtYV8xNngxNihlbmN2aWQpOwotCi0gICAgICAgIC8qIGV2YWx1YXRlIHRoZW0gb25lIGJ5IG9uZSAqLwotICAgICAgICBmaW5kX2Nvc3RfMTZ4MTYoZW5jdmlkLCBvcmdZLCAmbWluX2Nvc3QpOwotCi0gICAgICAgIGlmICh2aWRlby0+c2xpY2VfdHlwZSA9PSBBVkNfUF9TTElDRSkKLSAgICAgICAgewotICAgICAgICAgICAgLyogc2F2ZSBjdXJyZW50IGludGVyIHByZWRpY3Rpb24gKi8KLSAgICAgICAgICAgIHNhdmVkX2ludGVyID0gZW5jdmlkLT5zdWJwZWxfcHJlZDsgLyogcmV1c2UgZXhpc3RpbmcgYnVmZmVyICovCi0gICAgICAgICAgICBqID0gMTY7Ci0gICAgICAgICAgICBjdXJMIC09IDQ7Ci0gICAgICAgICAgICBwaWNQaXRjaCAtPSAxNjsKLSAgICAgICAgICAgIHdoaWxlIChqLS0pCi0gICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgKnNhdmVkX2ludGVyKysgPSAqKCh1aW50MzIqKShjdXJMICs9IDQpKTsKLSAgICAgICAgICAgICAgICAqc2F2ZWRfaW50ZXIrKyA9ICooKHVpbnQzMiopKGN1ckwgKz0gNCkpOwotICAgICAgICAgICAgICAgICpzYXZlZF9pbnRlcisrID0gKigodWludDMyKikoY3VyTCArPSA0KSk7Ci0gICAgICAgICAgICAgICAgKnNhdmVkX2ludGVyKysgPSAqKCh1aW50MzIqKShjdXJMICs9IDQpKTsKLSAgICAgICAgICAgICAgICBjdXJMICs9IHBpY1BpdGNoOwotICAgICAgICAgICAgfQotCi0gICAgICAgIH0KLQotICAgICAgICAvKiBpNCBtb2RlIHNlYXJjaCAqLwotICAgICAgICBtYl9pbnRyYTR4NF9zZWFyY2goZW5jdmlkLCAmbWluX2Nvc3QpOwotCi0gICAgICAgIGVuY3ZpZC0+bWluX2Nvc3RbbWJudW1dID0gbWluX2Nvc3Q7IC8qIHVwZGF0ZSBtaW5fY29zdCAqLwotICAgIH0KLQotCi0gICAgaWYgKGN1cnJNQi0+bWJfaW50cmEpCi0gICAgewotICAgICAgICBjaHJvbWFfaW50cmFfc2VhcmNoKGVuY3ZpZCk7Ci0KLSAgICAgICAgLyogbmVlZCB0byBzZXQgdGhpcyBpbiBvcmRlciBmb3IgdGhlIE1CSW50ZXJQcmVkaWN0aW9uIHRvIHdvcmshISAqLwotICAgICAgICBtZW1zZXQoY3Vyck1CLT5tdkwwLCAwLCBzaXplb2YoaW50MzIpKjE2KTsKLSAgICAgICAgY3Vyck1CLT5yZWZfaWR4X0wwWzBdID0gY3Vyck1CLT5yZWZfaWR4X0wwWzFdID0KLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGN1cnJNQi0+cmVmX2lkeF9MMFsyXSA9IGN1cnJNQi0+cmVmX2lkeF9MMFszXSA9IC0xOwotICAgIH0KLSAgICBlbHNlIGlmICh2aWRlby0+c2xpY2VfdHlwZSA9PSBBVkNfUF9TTElDRSAmJiBpbnRyYSA9PSB0cnVlKQotICAgIHsKLSAgICAgICAgLyogcmVzdG9yZSBjdXJyZW50IGludGVyIHByZWR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4ICpjdXJMID0gY3VyclBpYy0+U2wgKyBvZmZzZXQ7IC8qIHBvaW50IHRvIHJlY29uc3RydWN0ZWQgZnJhbWUgKi8KLSAgICB1aW50MzIgd29yZDEsIHdvcmQyLCB3b3JkMywgd29yZDQ7Ci0gICAgdWludDMyIHN1bSA9IDA7Ci0KLSAgICBpbnQgYV8xNiwgYiwgYywgZmFjdG9yX2M7Ci0gICAgdWludDggKmNvbXBfcmVmX3gwLCAqY29tcF9yZWZfeDEsICpjb21wX3JlZl95MCwgKmNvbXBfcmVmX3kxOwotICAgIGludCBIID0gMCwgViA9IDAsIHRtcCwgdmFsdWU7Ci0gICAgaW50IGk7Ci0KLSAgICBpZiAodmlkZW8tPmludHJhQXZhaWxCKQotICAgIHsKLSAgICAgICAgLy9nZXQgdmVydGljYWwgcHJlZGljdGlvbiBtb2RlCi0gICAgICAgIHRvcCA9IGN1ckwgLSBwaXRjaDsKLQotICAgICAgICBwcmVkID0gZW5jdmlkLT5wcmVkX2kxNltBVkNfSTE2X1ZlcnRpY2FsXSAtIDE2OwotCi0gICAgICAgIHdvcmQxID0gKigodWludDMyKikodG9wKSk7ICAvKiByZWFkIDQgYnl0ZXMgZnJvbSB0b3AgKi8KLSAgICAgICAgd29yZDIgPSAqKCh1aW50MzIqKSh0b3AgKyA0KSk7IC8qIHJlYWQgNCBieXRlcyBmcm9tIHRvcCAqLwotICAgICAgICB3b3JkMyA9ICooKHVpbnQzMiopKHRvcCArIDgpKTsgLyogcmVhZCA0IGJ5dGVzIGZyb20gdG9wICovCi0gICAgICAgIHdvcmQ0ID0gKigodWludDMyKikodG9wICsgMTIpKTsgLyogcmVhZCA0IGJ5dGVzIGZyb20gdG9wICovCi0KLSAgICAgICAgZm9yIChpID0gMDsgaSA8IDE2OyBpKyspCi0gICAgICAgIHsKLSAgICAgICAgICAgICooKHVpbnQzMiopKHByZWQgKz0gMTYpKSA9IHdvcmQxOwotICAgICAgICAgICAgKigodWludDMyKikocHJlZCArIDQpKSA9IHdvcmQyOwotICAgICAgICAgICAgKigodWludDMyKikocHJlZCArIDgpKSA9IHdvcmQzOwotICAgICAgICAgICAgKigodWludDMyKikocHJlZCArIDEyKSkgPSB3b3JkNDsKLQotICAgICAgICB9Ci0KLSAgICAgICAgc3VtID0gd29yZDEgJiAweEZGMDBGRjsKLSAgICAgICAgd29yZDEgPSAod29yZDEgPj4gOCkgJiAweEZGMDBGRjsKLSAgICAgICAgc3VtICs9IHdvcmQxOwotICAgICAgICB3b3JkMSA9ICh3b3JkMiAmIDB4RkYwMEZGKTsKLSAgICAgICAgc3VtICs9IHdvcmQxOwotICAgICAgICB3b3JkMiA9ICh3b3JkMiA+PiA4KSAmIDB4RkYwMEZGOwotICAgICAgICBzdW0gKz0gd29yZDI7Ci0gICAgICAgIHdvcmQxID0gKHdvcmQzICYgMHhGRjAwRkYpOwotICAgICAgICBzdW0gKz0gd29yZDE7Ci0gICAgICAgIHdvcmQzID0gKHdvcmQzID4+IDgpICYgMHhGRjAwRkY7Ci0gICAgICAgIHN1bSArPSB3b3JkMzsKLSAgICAgICAgd29yZDEgPSAod29yZDQgJiAweEZGMDBGRik7Ci0gICAgICAgIHN1bSArPSB3b3JkMTsKLSAgICAgICAgd29yZDQgPSAod29yZDQgPj4gOCkgJiAweEZGMDBGRjsKLSAgICAgICAgc3VtICs9IHdvcmQ0OwotCi0gICAgICAgIHN1bSArPSAoc3VtID4+IDE2KTsKLSAgICAgICAgc3VtICY9IDB4RkZGRjsKLQotICAgICAgICBpZiAoIXZpZGVvLT5pbnRyYUF2YWlsQSkKLSAgICAgICAgewotICAgICAgICAgICAgc3VtID0gKHN1bSArIDgpID4+IDQ7Ci0gICAgICAgIH0KLSAgICB9Ci0KLSAgICBpZiAodmlkZW8tPmludHJhQXZhaWxBKQotICAgIHsKLSAgICAgICAgLy8gZ2V0IGhvcml6b250YWwgbW9kZQotICAgICAgICBsZWZ0ID0gY3VyTCAtIDEgLSBwaXRjaDsKLQotICAgICAgICBwcmVkID0gZW5jdmlkLT5wcmVkX2kxNltBVkNfSTE2X0hvcml6b250YWxdIC0gMTY7Ci0KLSAgICAgICAgZm9yIChpID0gMDsgaSA8IDE2OyBpKyspCi0gICAgICAgIHsKLSAgICAgICAgICAgIHdvcmQxID0gKihsZWZ0ICs9IHBpdGNoKTsKLSAgICAgICAgICAgIHN1bSArPSB3b3JkMTsKLQotICAgICAgICAgICAgd29yZDEgPSAod29yZDEgPDwgOCkgfCB3b3JkMTsKLSAgICAgICAgICAgIHdvcmQxID0gKHdvcmQxIDw8IDE2KSB8IHdvcmQxOyAvKiBtYWtlIGl0IDQgKi8KLQotICAgICAgICAgICAgKih1aW50MzIqKShwcmVkICs9IDE2KSA9IHdvcmQxOwotICAgICAgICAgICAgKih1aW50MzIqKShwcmVkICsgNCkgPSB3b3JkMTsKLSAgICAgICAgICAgICoodWludDMyKikocHJlZCArIDgpID0gd29yZDE7Ci0gICAgICAgICAgICAqKHVpbnQzMiopKHByZWQgKyAxMikgPSB3b3JkMTsKLSAgICAgICAgfQotCi0gICAgICAgIGlmICghdmlkZW8tPmludHJhQXZhaWxCKQotICAgICAgICB7Ci0gICAgICAgICAgICBzdW0gPSAoc3VtICsgOCkgPj4gNDsKLSAgICAgICAgfQotICAgICAgICBlbHNlCi0gICAgICAgIHsKLSAgICAgICAgICAgIHN1bSA9IChzdW0gKyAxNikgPj4gNTsKLSAgICAgICAgfQotICAgIH0KLQotICAgIC8vIGdldCBEQyBtb2RlCi0gICAgaWYgKCF2aWRlby0+aW50cmFBdmFpbEEgJiYgIXZpZGVvLT5pbnRyYUF2YWlsQikKLSAgICB7Ci0gICAgICAgIHN1bSA9IDB4ODA4MDgwODA7Ci0gICAgfQotICAgIGVsc2UKLSAgICB7Ci0gICAgICAgIHN1bSA9IChzdW0gPDwgOCkgfCBzdW07Ci0gICAgICAgIHN1bSA9IChzdW0gPDwgMTYpIHwgc3VtOwotICAgIH0KLQotICAgIHByZWQgPSBlbmN2aWQtPnByZWRfaTE2W0FWQ19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HVlKQotICAgICAgICAgICAgd29yZDEgPSAod29yZDEpIHwgKHZhbHVlIDw8IDI0KTsKLSAgICAgICAgICAgICooKHVpbnQzMiopKHByZWQgKz0gMTYpKSA9IHdvcmQxOwotICAgICAgICAgICAgdmFsdWUgPSBmYWN0b3JfYyA+PiA1OwotICAgICAgICAgICAgZmFjdG9yX2MgKz0gYjsKLSAgICAgICAgICAgIENMSVBfUkVTVUxUKHZhbHVlKQotICAgICAgICAgICAgd29yZDEgPSB2YWx1ZTsKLSAgICAgICAgICAgIHZhbHVlID0gZmFjdG9yX2MgPj4gNTsKLSAgICAgICAgICAgIGZhY3Rvcl9jICs9IGI7Ci0gICAgICAgICAgICBDTElQX1JFU1VMVCh2YWx1ZSkKLSAgICAgICAgICAgIHdvcmQxID0gKHdvcmQxKSB8ICh2YWx1ZSA8PCA4KTsKLSAgICAgICAgICAgIHZhbHVlID0gZmFjdG9yX2MgPj4gNTsKLSAgICAgICAgICAgIGZhY3Rvcl9jICs9IGI7Ci0gICAgICAgICAgICBDTElQX1JFU1VMVCh2YWx1ZSkKLSAgICAgICAgICAgIHdvcmQxID0gKHdvcmQxKSB8ICh2YWx1ZSA8PCAxNik7Ci0gICAgICAgICAgICB2YWx1ZSA9IGZhY3Rvcl9jID4+IDU7Ci0gICAgICAgICAgICBmYWN0b3JfYyArPSBiOwotICAgICAgICAgICAgQ0xJUF9SRVNVTFQodmFsdWUpCi0gICAgICAgICAgICB3b3JkMSA9ICh3b3JkMSkgfCAodmFsdWUgPDwgMjQpOwotICAgICAgICAgICAgKigodWludDMyKikocHJlZCArIDQpKSA9IHdvcmQxOwotICAgICAgICAgICAgdmFsdWUgPSBmYWN0b3JfYyA+PiA1OwotICAgICAgICAgICAgZmFjdG9yX2MgKz0gYjsKLSAgICAgICAgICAgIENMSVBfUkVTVUxUKHZhbHVlKQotICAgICAgICAgICAgd29yZDEgPSB2YWx1ZTsKLSAgICAgICAgICAgIHZhbHVlID0gZmFjdG9yX2MgPj4gNTsKL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bTEgKz0gbTI7Ci0gICAgICAgICAgICBtMiA9IG0xIC0gKG0yIDw8IDEpOwotICAgICAgICAgICAgcHJlc1swXSA9IG0wICsgbTE7Ci0gICAgICAgICAgICBwcmVzWzJdID0gbTAgLSBtMTsKLSAgICAgICAgICAgIHByZXNbMV0gPSBtMiArIG0zOwotICAgICAgICAgICAgcHJlc1szXSA9IG0zIC0gbTI7Ci0KLSAgICAgICAgICAgIG9yZyArPSA0OwotICAgICAgICAgICAgcHJlcyArPSA0OwotICAgICAgICAgICAgcHJlZCArPSA0OwotICAgICAgICAgICAgay0tOwotICAgICAgICB9Ci0gICAgICAgIG9yZyArPSBvcmdfcGl0Y2g7Ci0gICAgfQotICAgIC8qIHZlcnRpY2FsIHRyYW5zZm9ybSAqLwotICAgIGNvc3QgPSAwOwotICAgIGZvciAoaiA9IDA7IGogPCA0OyBqKyspCi0gICAgewotICAgICAgICBwcmVzID0gcmVzICsgKGogPDwgNik7Ci0gICAgICAgIGsgPSAxNjsKLSAgICAgICAgd2hpbGUgKGsgPiAwKQotICAgICAgICB7Ci0gICAgICAgICAgICBtMCA9IHByZXNbMF07Ci0gICAgICAgICAgICBtMyA9IHByZXNbMzw8NF07Ci0gICAgICAgICAgICBtMCArPSBtMzsKLSAgICAgICAgICAgIG0zID0gbTAgLSAobTMgPDwgMSk7Ci0gICAgICAgICAgICBtMSA9IHByZXNbMTw8NF07Ci0gICAgICAgICAgICBtMiA9IHByZXNbMjw8NF07Ci0gICAgICAgICAgICBtMSArPSBtMjsKLSAgICAgICAgICAgIG0yID0gbTEgLSAobTIgPDwgMSk7Ci0gICAgICAgICAgICBwcmVzWzBdID0gbTAgPSBtMCArIG0xOwotCi0gICAgICAgICAgICBpZiAoayYweDMpICAvLyBvbmx5IHN1bSB1cCBub24gREMgdmFsdWVzLgotICAgICAgICAgICAgewotICAgICAgICAgICAgICAgIGNvc3QgKz0gKChtMCA+IDApID8gbTAgOiAtbTApOwotICAgICAgICAgICAgfQotCi0gICAgICAgICAgICBtMSA9IG0wIC0gKG0xIDw8IDEpOwotICAgICAgICAgICAgY29zdCArPSAoKG0xID4gMCkgPyBtMSA6IC1tMSk7Ci0gICAgICAgICAgICBtMyA9IG0yICsgbTM7Ci0gICAgICAgICAgICBjb3N0ICs9ICgobTMgPiAwKSA/IG0zIDogLW0zKTsKLSAgICAgICAgICAgIG0yID0gbTMgLSAobTIgPDwgMSk7Ci0gICAgICAgICAgICBjb3N0ICs9ICgobTIgPiAwKSA/IG0yIDogLW0yKTsKLQotICAgICAgICAgICAgcHJlcysrOwotICAgICAgICAgICAgay0tOwotICAgICAgICB9Ci0gICAgICAgIGlmICgoY29zdCA+PiAxKSA+IG1pbl9jb3N0KSAvKiBlYXJseSBkcm9wIG91dCAqLwotICAgICAgICB7Ci0gICAgICAgICAgICByZXR1cm4gKGNvc3QgPj4gMSk7Ci0gICAgICAgIH0KLSAgICB9Ci0KLSAgICAvKiBIYWRhbWFyZCBvZiB0aGUgREMgY29lZmZpY2llbnQgKi8KLSAgICBwcmVzID0gcmVzOwotICAgIGsgPSA0OwotICAgIHdoaWxlIChrID4gMCkKLSAgICB7Ci0gICAgICAgIG0wID0gcHJlc1swXTsKLSAgICAgICAgbTMgPSBwcmVzWzM8PDJdOwotICAgICAgICBtMCA+Pj0gMjsKLSAgICAgICAgbTAgKz0gKG0zID4+IDIpOwotICAgICAgICBtMyA9IG0wIC0gKG0zID4+IDEpOwotICAgICAgICBtMSA9IHByZXNbMTw8Ml07Ci0gICAgICAgIG0yID0gcHJlc1syPDwyXTsKLSAgICAgICAgbTEgPj49IDI7Ci0gICAgICAgIG0xICs9IChtMiA+PiAyKTsKLSAgICAgICAgbTIgPSBtMSAtIChtMiA+PiAxKTsKLSAgICAgICAgcHJlc1swXSA9IChtMCArIG0xKTsKLSAgICAgICAgcHJlc1syPDwyXSA9IChtMCAtIG0xKTsKLSAgICAgICAgcHJlc1sxPDwyXSA9IChtMiArIG0zKTsKLSAgICAgICAgcHJlc1szPDwyXSA9IChtMyAtIG0yKTsKLSAgICAgICAgcHJlcyArPSAoNCA8PCA0KTsKLSAgICAgICAgay0tOwotICAgIH0KLQotICAgIHByZXMgPSByZXM7Ci0gICAgayA9IDQ7Ci0gICAgd2hpbGUgKGsgPiAwKQotICAgIHsKLSAgICAgICAgbTAgPSBwcmVzWzBdOwotICAgICAgICBtMyA9IHByZXNbMzw8Nl07Ci0gICAgICAgIG0wICs9IG0zOwotICAgICAgICBtMyA9IG0wIC0gKG0zIDw8IDEpOwotICAgICAgICBtMSA9IHByZXNbMTw8Nl07Ci0gICAgICAgIG0yID0gcHJlc1syPDw2XTsKLSAgICAgICAgbTEgKz0gbTI7Ci0gICAgICAgIG0yID0gbTEgLSAobTIgPDwgMSk7Ci0gICAgICAgIG0wID0gbTAgKyBtMTsKLSAgICAgICAgY29zdCArPSAoKG0wID49IDApID8gbTAgOiAtbTApOwotICAgICAgICBtMSA9IG0wIC0gKG0xIDw8IDEpOwotICAgICAgICBjb3N0ICs9ICgobTEgPj0gMCkgPyBtMSA6IC1tMSk7Ci0gICAgICAgIG0zID0gbTIgKyBtMzsKLSAgICAgICAgY29zdCArPSAoKG0zID49IDApID8gbTMgOiAtbTMpOwotICAgICAgICBtMiA9IG0zIC0gKG0yIDw8IDEpOwotICAgICAgICBjb3N0ICs9ICgobTIgPj0gMCkgPyBtMiA6IC1tMik7Ci0gICAgICAgIHByZXMgKz0gNDsKLQotICAgICAgICBpZiAoKGNvc3QgPj4gMSkgPiBtaW5fY29zdCkgLyogZWFybHkgZHJvcCBvdXQgKi8KLSAgICAgICAgewotICAgICAgICAgICAgcmV0dXJuIChjb3N0ID4+IDEpOwotICAgICAgICB9Ci0KLSAgICAgICAgay0tOwotICAgIH0KLQotICAgIHJldHVybiAoY29zdCA+PiAxKTsKLX0KLQotCi12b2lkIG1iX2ludHJhNHg0X3NlYXJjaChBVkNFbmNPYmplY3QgKmVuY3ZpZCwgaW50ICptaW5fY29zdCkKLXsKLSAgICBBVkNDb21tb25PYm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IG9wZXJhdGlvbiBpbnNpZGUgZGN0X2x1bWEKLQotICAgIGZvciAoYjggPSAwOyBiOCA8IDQ7IGI4KyspCi0gICAgewotICAgICAgICBjb21wID0gY3VyTDsKLSAgICAgICAgb3JnNCA9IG9yZzg7Ci0KLSAgICAgICAgZm9yIChiNCA9IDA7IGI0IDwgNDsgYjQrKykKLSAgICAgICAgewotICAgICAgICAgICAgYmxraWR4ID0gYmxrSWR4MmJsa1hZW2I4XVtiNF07Ci0gICAgICAgICAgICBjb3N0NHg0ID0gYmxrX2ludHJhNHg0X3NlYXJjaChlbmN2aWQsIGJsa2lkeCwgY29tcCwgb3JnNCk7Ci0gICAgICAgICAgICBjb3N0ICs9IGNvc3Q0eDQ7Ci0gICAgICAgICAgICBpZiAoY29zdCA+ICptaW5fY29zdCkKLSAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICBjdXJyTUItPm1iX2ludHJhID0gbWJfaW50cmE7IC8vIHJlc3RvcmUgdGhlIHZhbHVlCi0gICAgICAgICAgICAgICAgcmV0dXJuIDsKLSAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgLyogZG8gcmVzaWR1ZSwgWGZybSwgUSwgaW52USwgaW52WGZybSwgcmVjb24gYW5kIHNhdmUgdGhlIERDVCBjb2Vmcy4qLwotICAgICAgICAgICAgdmlkZW8tPnByZWRfYmxvY2sgPSBlbmN2aWQtPnByZWRfaTRbY3Vyck1CLT5pNE1vZGVbYmxraWR4XV07Ci0gICAgICAgICAgICBudW1jb2VmID0gZGN0X2x1bWEoZW5jdmlkLCBibGtpZHgsIGNvbXAsIG9yZzQsICZkdW1teSk7Ci0gICAgICAgICAgICBjdXJyTUItPm56X2NvZWZmW2Jsa2lkeF0gPSBudW1jb2VmOwotICAgICAgICAgICAgaWYgKG51bWNvZWYpCi0gICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgdmlkZW8tPmNicDR4NCB8PSAoMSA8PCBibGtpZHgpOwotICAgICAgICAgICAgICAgIGN1cnJNQi0+Q0JQIHw9ICgxIDw8IGI4KTsKLSAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgaWYgKGI0JjEpCi0gICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgY29tcCArPSAoKHBpdGNoIDw8IDIpIC0gNCk7Ci0gICAgICAgICAgICAgICAgb3JnNCArPSAoKG9yZ19waXRjaCA8PCAyKSAtIDQpOwotICAgICAgICAgICAgfQotICAgICAgICAgICAgZWxzZQotICAgICAgICAgICAgewotICAgICAgICAgICAgICAgIGNvbXAgKz0gNDsKLSAgICAgICAgICAgICAgICBvcmc0ICs9IDQ7Ci0gICAgICAgICAgICB9Ci0gICAgICAgIH0KLQotICAgICAgICBpZiAoYjgmMSkKLSAgICAgICAgewotICAgICAgICAgICAgY3VyTCArPSAoKHBpdGNoIDw8IDMpIC0gOCk7Ci0gICAgICAgICAgICBvcmc4ICs9ICgob3JnX3BpdGNoIDw8IDMpIC0gOCk7Ci0gICAgICAgIH0KLSAgICAgICAgZWxzZQotICAgICAgICB7Ci0gICAgICAgICAgICBjdXJMICs9IDg7Ci0gICAgICAgICAgICBvcmc4ICs9IDg7Ci0gICAgICAgIH0KLSAgICB9Ci0KLSAgICBjdXJyTUItPm1iX2ludHJhID0gbWJfaW50cmE7IC8vIHJlc3RvcmUgdGhlIHZhbHVlCi0KLSAgICBpZiAoY29zdCA8ICptaW5fY29zdCkKLSAgICB7Ci0gICAgICAgICptaW5fY29zdCA9IGNvc3Q7Ci0gICAgICAgIGN1cnJNQi0+bWJNb2RlID0gQVZDX0k0OwotICAgICAgICBjdXJyTUItPm1iX2ludHJhID0gMTsKLSAgICB9Ci0KLSAgICByZXR1cm4gOwotfQotCi0KLS8qIHNlYXJjaCBmb3IgaTQgbW9kZSBmb3IgYSA0eDQgYmxvY2sgKi8KLWludCBibGtfaW50cmE0eDRfc2VhcmNoKEFWQ0VuY09iamVjdCAqZW5jdmlkLCBpbnQgYmxraWR4LCB1aW50OCAqY3VyLCB1aW50OCAqb3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gKGF2YWlsYWJpbGl0eS50b3ApCi0gICAgICAgIHsKLSAgICAgICAgICAgIERDID0gKFBfQSArIFBfQiArIFBfQyArIFBfRCArIERDICsgNCkgPj4gMzsKLSAgICAgICAgfQotICAgICAgICBlbHNlCi0gICAgICAgIHsKLSAgICAgICAgICAgIERDID0gKERDICsgMikgPj4gMjsKLQotICAgICAgICB9Ci0gICAgfQotICAgIGVsc2UgaWYgKGF2YWlsYWJpbGl0eS50b3ApCi0gICAgewotICAgICAgICBEQyA9IChQX0EgKyBQX0IgKyBQX0MgKyBQX0QgKyAyKSA+PiAyOwotCi0gICAgfQotICAgIGVsc2UKLSAgICB7Ci0gICAgICAgIERDID0gMTI4OwotICAgIH0KLQotICAgIHRlbXAgPSBEQyB8IChEQyA8PCA4KTsKLSAgICB0ZW1wID0gdGVtcCB8ICh0ZW1wIDw8IDE2KTsKLSAgICAqKCh1aW50MzIqKXByZWQpID0gdGVtcDsKLSAgICAqKCh1aW50MzIqKShwcmVkICs9IDQpKSA9IHRlbXA7Ci0gICAgKigodWludDMyKikocHJlZCArPSA0KSkgPSB0ZW1wOwotICAgICooKHVpbnQzMiopKHByZWQgKz0gNCkpID0gdGVtcDsKLQotICAgIC8qIERvd24tbGVmdCAqLwotICAgIG1vZGVfYXZhaWxbQVZDX0k0X0RpYWdvbmFsX0Rvd25fTGVmdF0gPSAwOwotCi0gICAgaWYgKGF2YWlsYWJpbGl0eS50b3ApCi0gICAgewotICAgICAgICBtb2RlX2F2YWlsW0FWQ19JNF9EaWFnb25hbF9Eb3duX0xlZnRdID0gMTsKLQotICAgICAgICBwcmVkID0gZW5jdmlkLT5wcmVkX2k0W0FWQ19JNF9EaWFnb25hbF9Eb3duX0xlZnRdOwotCi0gICAgICAgIHIwID0gUF9BOwotICAgICAgICByMSA9IFBfQjsKLSAgICAgICAgcjIgPSBQX0M7Ci0gICAgICAgIHIzID0gUF9EOwotCi0gICAgICAgIHIwICs9IChyMSA8PCAxKTsKLSAgICAgICAgcjAgKz0gcjI7Ci0gICAgICAgIHIwICs9IDI7Ci0gICAgICAgIHIwID4+PSAyOwotICAgICAgICByMSArPSAocjIgPDwgMSk7Ci0gICAgICAgIHIxICs9IHIzOwotICAgICAgICByMSArPSAyOwotICAgICAgICByMSA+Pj0gMjsKLQotICAgICAgICBpZiAoYXZhaWxhYmlsaXR5LnRvcF9yaWdodCkKLSAgICAgICAgewotICAgICAgICAgICAgcjQgPSBQX0U7Ci0gICAgICAgICAgICByNSA9IFBfRjsKLSAgICAgICAgICAgIHI2ID0gUF9HOwotICAgICAgICAgICAgcjcgPSBQX0g7Ci0KLSAgICAgICAgICAgIHIyICs9IChyMyA8PCAxKTsKLSAgICAgICAgICAgIHIyICs9IHI0OwotICAgICAgICAgICAgcjIgKz0gMjsKLSAgICAgICAgICAgIHIyID4+PSAyOwotICAgICAgICAgICAgcjMgKz0gKHI0IDw8IDEpOwotICAgICAgICAgICAgcjMgKz0gcjU7Ci0gICAgICAgICAgICByMyArPSAyOwotICAgICAgICAgICAgcjMgPj49IDI7Ci0gICAgICAgICAgICByNCArPSAocjUgPDwgMSk7Ci0gICAgICAgICAgICByNCArPSByNjsKLSAgICAgICAgICAgIHI0ICs9IDI7Ci0gICAgICAgICAgICByNCA+Pj0gMjsKLSAgICAgICAgICAgIHI1ICs9IChyNiA8PCAxKTsKLSAgICAgICAgICAgIHI1ICs9IHI3OwotICAgICAgICAgICAgcjUgKz0gMjsKLSAgICAgICAgICAgIHI1ID4+PSAyOwotICAgICAgICAgICAgcjYgKz0gKDMgKiByNyk7Ci0gICAgICAgICAgICByNiArPSAyOwotICAgICAgICAgICAgcjYgPj49IDI7Ci0gICAgICAgICAgICB0ZW1wID0gcjAgfCAocjEgPDwgOCk7Ci0gICAgICAgICAgICB0ZW1wIHw9IChyMiA8PCAxNik7Ci0gICAgICAgICAgICB0ZW1wIHw9IChyMyA8PCAyNCk7Ci0gICAgICAgICAgICAqKCh1aW50MzIqKXByZWQpID0gdGVtcDsKLQotICAgICAgICAgICAgdGVtcCA9ICh0ZW1wID4+IDgpIHwgKHI0IDw8IDI0KTsKLSAgICAgICAgICAgICooKHVpbnQzMiopKHByZWQgKz0gNCkpID0gdGVtcDsKLQotICAgICAgICAgICAgdGVtcCA9ICh0ZW1wID4+IDgpIHwgKHI1IDw8IDI0KTsKLSAgICAgICAgICAgICooKHVpbnQzMiopKHByZWQgKz0gNCkpID0gdGVtcDsKLQotICAgICAgICAgICAgdGVtcCA9ICh0ZW1wID4+IDgpIHwgKHI2IDw8IDI0KTsKLSAgICAgICAgICAgICooKHVpbnQzMiopKHByZWQgKz0gNCkpID0gdGVtcDsKLSAgICAgICAgfQotICAgICAgICBlbHNlCi0gICAgICAgIHsKLSAgICAgICAgICAgIHIyICs9IChyMyAqIDMpOwotICAgICAgICAgICAgcjIgKz0gMjsKLSAgICAgICAgICAgIHIyID4+PSAyOwotICAgICAgICAgICAgcjMgPSAoKHIzIDw8IDIpICsgMik7Ci0gICAgICAgICAgICByMyA+Pj0gMjsKLQotICAgICAgICAgICAgdGVtcCA9IHIwIHwgKHIxIDw8IDgpOwotICAgICAgICAgICAgdGVtcCB8PSAocjIgPDwgMTYpOwotICAgICAgICAgICAgdGVtcCB8PSAocjMgPDwgMjQpOwotICAgICAgICAgICAgKigodWludDMyKilwcmVkKSA9IHRlbXA7Ci0KLSAgICAgICAgICAgIHRlbXAgPSAodGVtcCA+PiA4KSB8IChyMyA8PCAyNCk7Ci0gICAgICAgICAgICAqKCh1aW50MzIqKShwcmVkICs9IDQpKSA9IHRlbXA7Ci0KLSAgICAgICAgICAgIHRlbXAgPSAodGVtcCA+PiA4KSB8IChyMyA8PCAyNCk7Ci0gICAgICAgICAgICAqKCh1aW50MzIqKShwcmVkICs9IDQpKSA9IHRlbXA7Ci0KLSAgICAgICAgICAgIHRlbXAgPSAodGVtcCA+PiA4KSB8IChyMyA8PCAyNCk7Ci0gICAgICAgICAgICAqKCh1aW50MzIqKShwcmVkICs9IDQpKSA9IHRlbXA7Ci0K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gPDwgMTYpOwotICAgICAgICB0ZW1wIHw9IChRMSA8PCAyNCk7Ci0gICAgICAgICooKHVpbnQzMiopKHByZWQgKz0gNCkpID0gIHRlbXA7Ci0KLQotICAgICAgICAvKiBIb3Jpem9udGFsIERvd24gKi8KLSAgICAgICAgbW9kZV9hdmFpbFtBVkNfSTRfSG9yaXpvbnRhbF9Eb3duXSA9IDE7Ci0gICAgICAgIHByZWQgPSBlbmN2aWQtPnByZWRfaTRbQVZDX0k0X0hvcml6b250YWxfRG93bl07Ci0KLQotICAgICAgICBRMiA9IChQX0EgKyAyICogUF9CICsgUF9DICsgMikgPj4gMjsKLSAgICAgICAgUDIgPSAoUF9YICsgMiAqIFBfQSArIFBfQiArIDIpID4+IDI7Ci0gICAgICAgIEQgPSAoUF9JICsgMiAqIFBfWCArIFBfQSArIDIpID4+IDI7Ci0gICAgICAgIFAwID0gUF9YICsgUF9JICsgMTsKLSAgICAgICAgUTAgPSBQX0kgKyBQX0ogKyAxOwotICAgICAgICBSMCA9IFBfSiArIFBfSyArIDE7Ci0gICAgICAgIFMwID0gUF9LICsgUF9MICsgMTsKLQotICAgICAgICBQMSA9IChQMCArIFEwKSA+PiAyOwotICAgICAgICBRMSA9IChRMCArIFIwKSA+PiAyOwotICAgICAgICBSMSA9IChSMCArIFMwKSA+PiAyOwotCi0gICAgICAgIFAwID4+PSAxOwotICAgICAgICBRMCA+Pj0gMTsKLSAgICAgICAgUjAgPj49IDE7Ci0gICAgICAgIFMwID4+PSAxOwotCi0KLSAgICAgICAgLyogd2UgY2FuIHBhY2sgdGhlc2UgKi8KLSAgICAgICAgdGVtcCA9IFAwIHwgKEQgPDwgOCk7ICAgLy9bUDAgRCAgUDIgUTJdCi0gICAgICAgIC8vW1EwIFAxIFAwIEQgXQotICAgICAgICB0ZW1wIHw9IChQMiA8PCAxNik7ICAvL1tSMCBRMSBRMCBQMV0KLSAgICAgICAgdGVtcCB8PSAoUTIgPDwgMjQpOyAvL1tTMCBSMSBSMCBRMV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pZC0+aTRfc2FkID0gbWluX3NhZDsKLSAgICB9Ci0gICAgZWxzZQotICAgIHsKLSAgICAgICAgZW5jdmlkLT5pNF9zYWQgKz0gbWluX3NhZDsKLSAgICB9Ci0KLSAgICByZXR1cm4gbWluX2Nvc3Q7Ci19Ci0KLWludCBGaW5kTW9zdFByb2JhYmxlSTRNb2RlKEFWQ0NvbW1vbk9iaiAqdmlkZW8sIGludCBibGtpZHgpCi17Ci0gICAgaW50IGRjT25seVByZWRpY3Rpb25GbGFnOwotICAgIEFWQ01hY3JvYmxvY2sgKmN1cnJNQiA9IHZpZGVvLT5jdXJyTUI7Ci0gICAgaW50IGludHJhNHg0UHJlZE1vZGVBLCBpbnRyYTR4NFByZWRNb2RlQiwgcHJlZEludHJhNHg0UHJlZE1vZGU7Ci0KLQotICAgIGRjT25seVByZWRpY3Rpb25GbGFnID0gMDsKLSAgICBpZiAoYmxraWR4JjB4MykKLSAgICB7Ci0gICAgICAgIGludHJhNHg0UHJlZE1vZGVBID0gY3Vyck1CLT5pNE1vZGVbYmxraWR4LTFdOyAvLyBibG9jayB0byB0aGUgbGVmdAotICAgIH0KLSAgICBlbHNlIC8qIGZvciBibGsgMCwgNCwgOCwgMTIgKi8KLSAgICB7Ci0gICAgICAgIGlmICh2aWRlby0+aW50cmFBdmFpbEEpCi0gICAgICAgIHsKLSAgICAgICAgICAgIGlmICh2aWRlby0+bWJsb2NrW3ZpZGVvLT5tYkFkZHJBXS5tYk1vZGUgPT0gQVZDX0k0KQotICAgICAgICAgICAgewotICAgICAgICAgICAgICAgIGludHJhNHg0UHJlZE1vZGVBID0gdmlkZW8tPm1ibG9ja1t2aWRlby0+bWJBZGRyQV0uaTRNb2RlW2Jsa2lkeCArIDNdOwotICAgICAgICAgICAgfQotICAgICAgICAgICAgZWxzZQotICAgICAgICAgICAgewotICAgICAgICAgICAgICAgIGludHJhNHg0UHJlZE1vZGVBID0gQVZDX0k0X0RDOwotICAgICAgICAgICAgfQotICAgICAgICB9Ci0gICAgICAgIGVsc2UKLSAgICAgICAgewotICAgICAgICAgICAgZGNPbmx5UHJlZGljdGlvbkZsYWcgPSAxOwotICAgICAgICAgICAgZ290byBQUkVEX1JFU1VMVF9SRUFEWTsgIC8vIHNraXAgYmVsb3cKLSAgICAgICAgfQotICAgIH0KLQotICAgIGlmIChibGtpZHggPj4gMikKLSAgICB7Ci0gICAgICAgIGludHJhNHg0UHJlZE1vZGVCID0gY3Vyck1CLT5pNE1vZGVbYmxraWR4LTRdOyAvLyBibG9jayBhYm92ZQotICAgIH0KLSAgICBlbHNlIC8qIGJsb2NrIDAsIDEsIDIsIDMgKi8KLSAgICB7Ci0gICAgICAgIGlmICh2aWRlby0+aW50cmFBdmFpbEIpCi0gICAgICAgIHsKLSAgICAgICAgICAgIGlmICh2aWRlby0+bWJsb2NrW3ZpZGVvLT5tYkFkZHJCXS5tYk1vZGUgPT0gQVZDX0k0KQotICAgICAgICAgICAgewotICAgICAgICAgICAgICAgIGludHJhNHg0UHJlZE1vZGVCID0gdmlkZW8tPm1ibG9ja1t2aWRlby0+bWJBZGRyQl0uaTRNb2RlW2Jsa2lkeCsxMl07Ci0gICAgICAgICAgICB9Ci0gICAgICAgICAgICBlbHNlCi0gICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgaW50cmE0eDRQcmVkTW9kZUIgPSBBVkNfSTRfREM7Ci0gICAgICAgICAgICB9Ci0gICAgICAgIH0KLSAgICAgICAgZWxzZQotICAgICAgICB7Ci0gICAgICAgICAgICBkY09ubHlQcmVkaWN0aW9uRmxhZyA9IDE7Ci0gICAgICAgIH0KLSAgICB9Ci0KLVBSRURfUkVTVUxUX1JFQURZOgotICAgIGlmIChkY09ubHlQcmVkaWN0aW9uRmxhZykKLSAgICB7Ci0gICAgICAgIGludHJhNHg0UHJlZE1vZGVBID0gaW50cmE0eDRQcmVkTW9kZUIgPSBBVkNfSTRfREM7Ci0gICAgfQotCi0gICAgcHJlZEludHJhNHg0UHJlZE1vZGUgPSBBVkN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HsKLSAgICAgICAgbTAgPSBwcmVzWzBdOwotICAgICAgICBtMyA9IHByZXNbMTJdOwotICAgICAgICBtMCArPSBtMzsKLSAgICAgICAgbTMgPSBtMCAtIChtMyA8PCAxKTsKLSAgICAgICAgbTEgPSBwcmVzWzRdOwotICAgICAgICBtMiA9IHByZXNbOF07Ci0gICAgICAgIG0xICs9IG0yOwotICAgICAgICBtMiA9IG0xIC0gKG0yIDw8IDEpOwotICAgICAgICBwcmVzWzBdID0gbTAgKyBtMTsKLSAgICAgICAgcHJlc1s4XSA9IG0wIC0gbTE7Ci0gICAgICAgIHByZXNbNF0gPSBtMiArIG0zOwotICAgICAgICBwcmVzWzEyXSA9IG0zIC0gbTI7Ci0KLSAgICAgICAgcHJlcysrOwotICAgICAgICBrLS07Ci0KLSAgICB9Ci0KLSAgICBwcmVzID0gcmVzOwotICAgIGsgPSA0OwotICAgIHdoaWxlIChrID4gMCkKLSAgICB7Ci0gICAgICAgIHRtcDEgPSAqcHJlcysrOwotICAgICAgICBzYXRkICs9ICgodG1wMSA+PSAwKSA/IHRtcDEgOiAtdG1wMSk7Ci0gICAgICAgIHRtcDEgPSAqcHJlcysrOwotICAgICAgICBzYXRkICs9ICgodG1wMSA+PSAwKSA/IHRtcDEgOiAtdG1wMSk7Ci0gICAgICAgIHRtcDEgPSAqcHJlcysrOwotICAgICAgICBzYXRkICs9ICgodG1wMSA+PSAwKSA/IHRtcDEgOiAtdG1wMSk7Ci0gICAgICAgIHRtcDEgPSAqcHJlcysrOwotICAgICAgICBzYXRkICs9ICgodG1wMSA+PSAwKSA/IHRtcDEgOiAtdG1wMSk7Ci0gICAgICAgIGstLTsKLSAgICB9Ci0KLSAgICBzYXRkID0gKHNhdGQgKyAxKSA+PiAxOwotICAgICpjb3N0ICs9IHNhdGQ7Ci0KLSAgICByZXR1cm4gOwotfQotCi12b2lkIGNocm9tYV9pbnRyYV9zZWFyY2goQVZDRW5jT2JqZWN0ICplbmN2aWQpCi17Ci0gICAgQVZDQ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jb3N0LCBtaW5jb3N0OwotCi0gICAgLyogZXZhbHVhdGUgREMgbW9kZSAqLwotICAgIGlmICh2aWRlby0+aW50cmFBdmFpbEIgJiB2aWRlby0+aW50cmFBdmFpbEEpCi0gICAgewotICAgICAgICBjb21wX3JlZl94ID0gY3VyQ2IgLSBwaXRjaDsKLSAgICAgICAgY29tcF9yZWZfeSA9IGN1ckNiIC0gMTsKLQotICAgICAgICBmb3IgKGkgPSAwOyBpIDwgMjsgaSsrKQotICAgICAgICB7Ci0gICAgICAgICAgICBwcmVkX2EgPSAqKCh1aW50MzIqKWNvbXBfcmVmX3gpOwotICAgICAgICAgICAgY29tcF9yZWZfeCArPSA0OwotICAgICAgICAgICAgcHJlZF9iID0gKHByZWRfYSA+PiA4KSAmIDB4RkYwMEZGOwotICAgICAgICAgICAgcHJlZF9hICY9IDB4RkYwMEZGOwotICAgICAgICAgICAgcHJlZF9hICs9IHByZWRfYjsKLSAgICAgICAgICAgIHByZWRfYSArPSAocHJlZF9hID4+IDE2KTsKLSAgICAgICAgICAgIHN1bV94MCA9IHByZWRfYSAmIDB4RkZGRjsKLQotICAgICAgICAgICAgcHJlZF9hID0gKigodWludDMyKiljb21wX3JlZl94KTsKLSAgICAgICAgICAgIHByZWRfYiA9IChwcmVkX2EgPj4gOCkgJiAweEZGMDBGRjsKLSAgICAgICAgICAgIHByZWRfYSAmPSAweEZGMDBGRjsKLSAgICAgICAgICAgIHByZWRfYSArPSBwcmVkX2I7Ci0gICAgICAgICAgICBwcmVkX2EgKz0gKHByZWRfYSA+PiAxNik7Ci0gICAgICAgICAgICBzdW1feDEgPSBwcmVkX2EgJiAweEZGRkY7Ci0KLSAgICAgICAgICAgIHByZWRfMVtpXSA9IChzdW1feDEgKyAyKSA+PiAyOwotCi0gICAgICAgICAgICBzdW1feTAgPSAqY29tcF9yZWZfeTsKLSAgICAgICAgICAgIHN1bV95MCArPSAqKGNvbXBfcmVmX3kgKz0gcGl0Y2gpOwotICAgICAgICAgICAgc3VtX3kwICs9ICooY29tcF9yZWZfeSArPSBwaXRjaCk7Ci0gICAgICAgICAgICBzdW1feTAgKz0gKihjb21wX3JlZl95ICs9IHBpdGNoKTsKLQotICAgICAgICAgICAgc3VtX3kxID0gKihjb21wX3JlZl95ICs9IHBpdGNoKTsKLSAgICAgICAgICAgIHN1bV95MSArPSAqKGNvbXBfcmVmX3kgKz0gcGl0Y2gpOwotICAgICAgICAgICAgc3VtX3kxICs9ICooY29tcF9yZWZfeSArPSBwaXRjaCk7Ci0gICAgICAgICAgICBzdW1feTEgKz0gKihjb21wX3JlZl95ICs9IHBpdGNoKTsKLQotICAgICAgICAgICAgcHJlZF8yW2ldID0gKHN1bV95MSArIDIpID4+IDI7Ci0KLSAgICAgICAgICAgIHByZWRfMFtpXSA9IChzdW1feTAgKyBzdW1feDAgKyA0KSA+PiAzOwotICAgICAgICAgICAgcHJlZF8zW2ldID0gKHN1bV95MSArIHN1bV94MSArIDQpID4+IDM7Ci0KLSAgICAgICAgICAgIGNvbXBfcmVmX3ggPSBjdXJDciAtIHBpdGNoOwotICAgICAgICAgICAgY29tcF9yZWZfeSA9IGN1ckNyIC0gMTsKLSAgICAgICAgfQotICAgIH0KLQotICAgIGVsc2UgaWYgKHZpZGVvLT5pbnRyYUF2YWlsQSkKLSAgICB7Ci0gICAgICAgIGNvbXBfcmVmX3kgPSBjdXJDYiAtIDE7Ci0gICAgICAgIGZvciAoaSA9IDA7IGkgPCAyOyBpKyspCi0gICAgICAgIHsKLSAgICAgICAgICAgIHN1bV95MCA9ICpjb21wX3JlZl95OwotICAgICAgICAgICAgc3VtX3kwICs9ICooY29tcF9yZWZfeSArPSBwaXRjaCk7Ci0gICAgICAgICAgICBzdW1feTAgKz0gKihjb21wX3JlZl95ICs9IHBpdGNoKTsKLSAgICAgICAgICAgIHN1bV95MCArPSAqKGNvbXBfcmVmX3kgKz0gcGl0Y2gpOwotCi0gICAgICAgICAgICBzdW1feTEgPSAqKGNvbXBfcmVmX3kgKz0gcGl0Y2gpOwotICAgICAgICAgICAgc3VtX3kxICs9ICooY29tcF9yZWZfeSArPSBwaXRjaCk7Ci0gICAgICAgICAgICBzdW1feTEgKz0gKihjb21wX3JlZl95ICs9IHBpdGNoKTsKLSAgICAgICAgICAgIHN1bV95MSArPSAqKGNvbXBfcmVmX3kgKz0gcGl0Y2gpOwotCi0gICAgICAgICAgICBwcmVkXzBbaV0gPSBwcmVkXzFbaV0gPSAoc3VtX3kwICsgMikgPj4gMjsKLSAgICAgICAgICAgIHByZWRfMltpXSA9IHByZWRfM1tpXSA9IChzdW1feTEgKyAyKSA+PiAyOwotCi0gICAgICAgICAgICBjb21wX3JlZl95ID0gY3VyQ3IgLSAxOwotICAgICAgICB9Ci0gICAgfQotICAgIGVsc2UgaWYgKHZpZGVvLT5pbnRyYUF2YWlsQikKLSAgICB7Ci0gICAgICAgIGNvbXBfcmVmX3ggPSBjdXJDYiAtIHBpdGNoOwotICAgICAgICBmb3IgKGkgPSAwOyBpIDwgMjsgaSsrKQotICAgICAgICB7Ci0gICAgICAgICAgICBwcmVkX2EgPSAqKCh1aW50MzIqKWNvbXBfcmVmX3gpOwotICAgICAgICAgICAgY29tcF9yZWZfeCArPSA0OwotICAgICAgICAgICAgcHJlZF9iID0gKHByZWRfYSA+PiA4KSAmIDB4RkYwMEZGOwotICAgICAgICAgICAgcHJlZF9hICY9IDB4RkYwMEZGOwotICAgICAgICAgICAgcHJlZF9hICs9IHByZWRfYjsKLSAgICAgICAgICAgIHByZWRfYSArPSAocHJlZF9hID4+IDE2KTsKLSAgICAgICAgICAgIHN1bV94MCA9IHByZWRfYSAmIDB4RkZGRjsKLQotICAgICAgICAgICAgcHJlZF9hID0gKigodWludDMyKiljb21wX3JlZl94KTsKLSAgICAgICAgICAgIHByZWRfYiA9IChwcmVkX2EgPj4gOCkgJiAweEZGMDBGRjsKLSAgICAgICAgICAgIHByZWRfYSAmPSAweEZGMDBGRjsKLSAgICAgICAgICAgIHByZWRfYSArPSBwcmVkX2I7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b3IgKGogPSAwOyBqIDwgNDsgaisrKSAvKiA0IGxpbmVzICovCi0gICAgewotICAgICAgICAqKCh1aW50MzIqKXByZWQpID0gcHJlZF9hOwotICAgICAgICAqKCh1aW50MzIqKShwcmVkICsgNCkpID0gcHJlZF9iOwotICAgICAgICAqKCh1aW50MzIqKShwcmVkICsgOCkpID0gcHJlZF9jOwotICAgICAgICAqKCh1aW50MzIqKShwcmVkICsgMTIpKSA9IHByZWRfZDsKLSAgICAgICAgcHJlZCArPSAxNjsgLyogbW92ZSB0byB0aGUgbmV4dCBsaW5lICovCi0gICAgfQotCi0gICAgcHJlZF9hID0gcHJlZF8yWzBdOwotICAgIHByZWRfYiA9IHByZWRfM1swXTsKLSAgICBwcmVkX2EgfD0gKHByZWRfYSA8PCA4KTsKLSAgICBwcmVkX2EgfD0gKHByZWRfYSA8PCAxNik7Ci0gICAgcHJlZF9iIHw9IChwcmVkX2IgPDwgOCk7Ci0gICAgcHJlZF9iIHw9IChwcmVkX2IgPDwgMTYpOwotCi0gICAgcHJlZF9jID0gcHJlZF8yWzFdOwotICAgIHByZWRfZCA9IHByZWRfM1sxXTsKLSAgICBwcmVkX2MgfD0gKHByZWRfYyA8PCA4KTsKLSAgICBwcmVkX2MgfD0gKHByZWRfYyA8PCAxNik7Ci0gICAgcHJlZF9kIHw9IChwcmVkX2QgPDwgOCk7Ci0gICAgcHJlZF9kIHw9IChwcmVkX2QgPDwgMTYpOwotCi0gICAgZm9yIChqID0gMDsgaiA8IDQ7IGorKykgLyogNCBsaW5lcyAqLwotICAgIHsKLSAgICAgICAgKigodWludDMyKilwcmVkKSA9IHByZWRfYTsKLSAgICAgICAgKigodWludDMyKikocHJlZCArIDQpKSA9IHByZWRfYjsKLSAgICAgICAgKigodWludDMyKikocHJlZCArIDgpKSA9IHByZWRfYzsKLSAgICAgICAgKigodWludDMyKikocHJlZCArIDEyKSkgPSBwcmVkX2Q7Ci0gICAgICAgIHByZWQgKz0gMTY7IC8qIG1vdmUgdG8gdGhlIG5leHQgbGluZSAqLwotICAgIH0KLQotICAgIC8qIHByZWRpY3QgaG9yaXpvbnRhbCBtb2RlICovCi0gICAgaWYgKHZpZGVvLT5pbnRyYUF2YWlsQSkKLSAgICB7Ci0gICAgICAgIGNvbXBfcmVmX3kgPSBjdXJDYiAtIDE7Ci0gICAgICAgIGNvbXBfcmVmX3ggPSBjdXJDciAtIDE7Ci0gICAgICAgIHByZWQgPSBlbmN2aWQtPnByZWRfaWNbQVZDX0lDX0hvcml6b250YWxdOwotCi0gICAgICAgIGZvciAoaSA9IDQ7IGkgPCA2OyBpKyspCi0gICAgICAgIHsKLSAgICAgICAgICAgIGZvciAoaiA9IDA7IGogPCA0OyBqKyspCi0gICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgcHJlZF9hID0gKmNvbXBfcmVmX3k7Ci0gICAgICAgICAgICAgICAgY29tcF9yZWZfeSArPSBwaXRjaDsKLSAgICAgICAgICAgICAgICBwcmVkX2EgfD0gKHByZWRfYSA8PCA4KTsKLSAgICAgICAgICAgICAgICBwcmVkX2EgfD0gKHByZWRfYSA8PCAxNik7Ci0gICAgICAgICAgICAgICAgKigodWludDMyKilwcmVkKSA9IHByZWRfYTsKLSAgICAgICAgICAgICAgICAqKCh1aW50MzIqKShwcmVkICsgNCkpID0gcHJlZF9hOwotCi0gICAgICAgICAgICAgICAgcHJlZF9hID0gKmNvbXBfcmVmX3g7Ci0gICAgICAgICAgICAgICAgY29tcF9yZWZfeCArPSBwaXRjaDsKLSAgICAgICAgICAgICAgICBwcmVkX2EgfD0gKHByZWRfYSA8PCA4KTsKLSAgICAgICAgICAgICAgICBwcmVkX2EgfD0gKHByZWRfYSA8PCAxNik7Ci0gICAgICAgICAgICAgICAgKigodWludDMyKikocHJlZCArIDgpKSA9IHByZWRfYTsKLSAgICAgICAgICAgICAgICAqKCh1aW50MzIqKShwcmVkICsgMTIpKSA9IHByZWRfYTsKLQotICAgICAgICAgICAgICAgIHByZWQgKz0gMTY7Ci0gICAgICAgICAgICB9Ci0gICAgICAgIH0KLSAgICB9Ci0KLSAgICAvKiB2ZXJ0aWNhbCBtb2RlICovCi0gICAgaWYgKHZpZGVvLT5pbnRyYUF2YWlsQikKLSAgICB7Ci0gICAgICAgIGNvbXBfcmVmX3ggPSBjdXJDYiAtIHBpdGNoOwotICAgICAgICBjb21wX3JlZl95ID0gY3VyQ3IgLSBwaXRjaDsKLSAgICAgICAgcHJlZCA9IGVuY3ZpZC0+cHJlZF9pY1tBVkNfSUNfVmVydGljYWxdOwotCi0gICAgICAgIHByZWRfYSA9ICooKHVpbnQzMiopY29tcF9yZWZfeCk7Ci0gICAgICAgIHByZWRfYiA9ICooKHVpbnQzMiopKGNvbXBfcmVmX3ggKyA0KSk7Ci0gICAgICAgIHByZWRfYyA9ICooKHVpbnQzMiopY29tcF9yZWZfeSk7Ci0gICAgICAgIHByZWRfZCA9ICooKHVpbnQzMiopKGNvbXBfcmVmX3kgKyA0KSk7Ci0KLSAgICAgICAgZm9yIChqID0gMDsgaiA8IDg7IGorKykKLSAgICAgICAgewotICAgICAgICAgICAgKigodWludDMyKilwcmVkKSA9IHByZWRfYTsKLSAgICAgICAgICAgICooKHVpbnQzMiopKHByZWQgKyA0KSkgPSBwcmVkX2I7Ci0gICAgICAgICAgICAqKCh1aW50MzIqKShwcmVkICsgOCkpID0gcHJlZF9jOwotICAgICAgICAgICAgKigodWludDMyKikocHJlZCArIDEyKSkgPSBwcmVkX2Q7Ci0gICAgICAgICAgICBwcmVkICs9IDE2OwotICAgICAgICB9Ci0gICAgfQotCi0gICAgLyogSW50cmFfQ2hyb21hX1BsYW5lICovCi0gICAgaWYgKHZpZGVvLT5pbnRyYUF2YWlsQSAmJiB2aWRlby0+aW50cmFBdmFpbEIgJiYgdmlkZW8tPmludHJhQXZhaWxEKQotICAgIHsKLSAgICAgICAgY29tcF9yZWZfeCA9IGN1ckNiIC0gcGl0Y2g7Ci0gICAgICAgIGNvbXBfcmVmX3kgPSBjdXJDYiAtIDE7Ci0gICAgICAgIHRvcGxlZnQgPSBjdXJDYlstcGl0Y2gtMV07Ci0KLSAgICAgICAgcHJlZCA9IGVuY3ZpZC0+cHJlZF9pY1tBVkNfSUNfUGxhbmVdOwotICAgICAgICBmb3IgKGNvbXBvbmVudCA9IDA7IGNvbXBvbmVudCA8IDI7IGNvbXBvbmVudCsrKQotICAgICAgICB7Ci0gICAgICAgICAgICBIID0gViA9IDA7Ci0gICAgICAgICAgICBjb21wX3JlZl94MCA9IGNvbXBfcmVmX3ggKyA0OwotICAgICAgICAgICAgY29tcF9yZWZfeDEgPSBjb21wX3JlZl94ICsgMjsKLSAgICAgICAgICAgIGNvbXBfcmVmX3kwID0gY29tcF9yZWZfeSArIChwaXRjaCA8PCAyKTsKLSAgICAgICAgICAgIGNvbXBfcmVmX3kxID0gY29tcF9yZWZfeSArIChwaXRjaCA8PCAxKTsKLSAgICAgICAgICAgIGZvciAoaSA9IDE7IGkgPCA0OyBpKyspCi0gICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgSCArPSBpICogKCpjb21wX3JlZl94MCsrIC0gKmNvbXBfcmVmX3gxLS0pOwotICAgICAgICAgICAgICAgIFYgKz0gaSAqICgqY29tcF9yZWZfeTAgLSAqY29tcF9yZWZfeTEpOwotICAgICAgICAgICAgICAgIGNvbXBfcmVmX3kwICs9IHBpdGNoOwotICAgICAgICAgICAgICAgIGNvbXBfcmVmX3kxIC09IHBpdGNoOwotICAgICAgICAgICAgfQotICAgICAgICAgICAgSCArPSBpICogKCpjb21wX3JlZl94MCsrIC0gdG9wbGVmdCk7Ci0gICAgICAgICAgICBWICs9IGkgKiAoKmNvbXBfcmVmX3kwIC0gKmNvbXBfcmVmX3kxKTsKLQotICAgICAgICAgICAgYV8xNiA9ICgoKihjb21wX3JlZl94ICsgNykgKyAqKGNvbXBfcmVmX3kgKyA3ICogcGl0Y2gpKSA8PCA0KSArIDE2OwotICAgICAgICAgICAgYiA9ICgxNyAqIEggKyAxNikgPj4gNTsKLSAgICAgICAgICAgIGMgPSAoMTcgKiBWICsgMTYpID4+IDU7Ci0KLSAgICAgICAgICAgIHByZWRfYSA9IDA7Ci0gICAgICAgICAgICBmb3IgKGkgPSA0OyBpIDwgNjsgaSsrKQotICAgICAgICAgICAgewotICAgICAgICAgICAgICAgIGZvciAoaiA9IDA7IGogPCA0OyBqKyspCi0gICAgICAgICAgICAgICAgewotICAgICAgICAgICAgICAgICAgICBmYWN0b3JfYyA9IGFfMTYgKyBjICogKHByZWRfYSsrIC0gMyk7Ci0KLSAgICAgICAgICAgICAgICAgICAgZmFjdG9yX2MgLT0gMyAqIGI7Ci0KLSAgICAgICAgICAgICAgICAgICAgdmFsdWUgPSBmYWN0b3JfYyA+PiA1OwotICAgICAgICAgICAgICAgICAgICBmYWN0b3JfYyArPSBiOwotICAgICAgICAgICAgICAgICAgICBDTElQX1JFU1VMVCh2YWx1ZSkKLSAgICAgICAgICAgICAgICAgICAgcHJlZF9iID0gdmFsdWU7Ci0gICAgICAgICAgICAgICAgICAgIHZhbHVlID0gZmFjdG9yX2MgPj4gNTsKLSAgICAgICAgICAgICAgICAgICAgZmFjdG9yX2MgKz0gYjsKLSAgICAgICAgICAgICAgICAgICAgQ0xJUF9SRVNVTFQodmFsdWUpCi0gICAgICAgICAgICAgICAgICAgIHByZWRfYiB8PSAodmFsdWUgPDwgOCk7Ci0gICAgICAgICAgICAgICAgICAgIHZhbHVlID0gZmFjdG9yX2MgPj4gNTsKLSAgICAgICAgICAgICAgICAgICAgZmFjdG9yX2MgKz0gYjsKLSAgICAgICAgICAgICAgICAgICAgQ0xJUF9SRVNVTFQodmFsdWUpCi0gICAgICAgICAgICAgICAgICAgIHByZWRfYiB8PSAodmFsdWUgPDwgMTYpOwotICAgICAgICAgICAgICAgICAgICB2YWx1ZSA9IGZhY3Rvcl9jID4+IDU7Ci0gICAgICAgICAgICAgICAgICAgIGZhY3Rvcl9jICs9IGI7Ci0gICAgICAgICAgICAgICAgICAgIENMSVBfUkVTVUxUKHZhbHVlKQotICAgICAgICAgICAgICAgICAgICBwcmVkX2IgfD0gKHZhbHVlIDw8IDI0KTsKLSAgICAgICAgICAgICAgICAgICAgKigodWludDMyKilwcmVkKSA9IHByZWRfYjsKLQotICAgICAgICAgICAgICAgICAgICB2YWx1ZSA9IGZhY3Rvcl9jID4+IDU7Ci0gICAgICAgICAgICAgICAgICAgIGZhY3Rvcl9jICs9IGI7Ci0gICAgICAgICAgICAgICAgICAgIENMSVBfUkVTVUxUKHZhbHVlKQotICAgICAgICAgICAgICAgICAgICBwcmVkX2IgPSB2YWx1ZTsKLSAgICAgICAgICAgICAgICAgICAgdmFsdWUgPSBmYWN0b3JfYyA+PiA1OwotICAgICAgICAgICAgICAgICAgICBmYWN0b3JfYyArPSBiOwotICAgICAgICAgICAgICAgICAgICBDTElQX1JFU1VMVCh2YWx1ZSkKLSAgICAgICAgICAgICAgICAgICAgcHJlZF9iIHw9ICh2YWx1ZSA8PCA4KTsKLSAgICAgICAgICAgICAgICAgICAgdmFsdWUgPSBmYWN0b3JfYyA+PiA1OwotICAgICAgICAgICAgICAgICAgICBmYWN0b3JfYyArPSBiOwotICAgICAgICAgICAgICAgICAgICBDTElQX1JFU1VMVCh2YWx1ZSkKLSAgICAgICAgICAgICAgICAgICAgcHJlZF9iIHw9ICh2YWx1ZSA8PCAxNik7Ci0gICAgICAgICAgICAgICAgICAgIHZhbHVlID0gZmFjdG9yX2MgPj4gNTsKLSAgICAgICAgICAgICAgICAgICAgZmFjdG9yX2MgKz0gYjsKLSAgICAgICAgICAgICAgICAgICAgQ0xJUF9SRVNVTFQodmFsdWUpCi0gICAgICAgICAgICAgICAgICAgIHByZWRfYiB8PSAodmFsdWUgPDwgMjQpOwotICAgICAgICAgICAgICAgICAgICAqKCh1aW50MzIqKShwcmVkICsgNCkpID0gcHJlZF9iOwotICAgICAgICAgICAgICAgICAgICBwcmVkICs9IDE2OwotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgIH0KLQotICAgICAg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JlbmNlIGJldHdlZW4gb3JnQ2IsIG9yZ0NyIGFuZCBwcmVkICovCi0gICAgaW50MTYgcmVzWzEyOF0sICpwcmVzOyAvLyByZXNpZHVlCi0gICAgaW50IG0wLCBtMSwgbTIsIG0zLCB0bXAxOwotICAgIGludCBqLCBrOwotCi0gICAgcHJlcyA9IHJlczsKLSAgICBvcmdfcGl0Y2ggLT0gODsKLSAgICAvLyBob3Jpem9udGFsIHRyYW5zZm9ybQotICAgIGZvciAoaiA9IDA7IGogPCA4OyBqKyspCi0gICAgewotICAgICAgICBrID0gMjsKLSAgICAgICAgd2hpbGUgKGsgPiAwKQotICAgICAgICB7Ci0gICAgICAgICAgICBtMCA9IG9yZ0NiWzBdIC0gcHJlZFswXTsKLSAgICAgICAgICAgIG0zID0gb3JnQ2JbM10gLSBwcmVkWzNdOwotICAgICAgICAgICAgbTAgKz0gbTM7Ci0gICAgICAgICAgICBtMyA9IG0wIC0gKG0zIDw8IDEpOwotICAgICAgICAgICAgbTEgPSBvcmdDYlsxXSAtIHByZWRbMV07Ci0gICAgICAgICAgICBtMiA9IG9yZ0NiWzJdIC0gcHJlZFsyXTsKLSAgICAgICAgICAgIG0xICs9IG0yOwotICAgICAgICAgICAgbTIgPSBtMSAtIChtMiA8PCAxKTsKLSAgICAgICAgICAgIHByZXNbMF0gPSBtMCArIG0xOwotICAgICAgICAgICAgcHJlc1syXSA9IG0wIC0gbTE7Ci0gICAgICAgICAgICBwcmVzWzFdID0gbTIgKyBtMzsKLSAgICAgICAgICAgIHByZXNbM10gPSBtMyAtIG0yOwotCi0gICAgICAgICAgICBvcmdDYiArPSA0OwotICAgICAgICAgICAgcHJlcyArPSA0OwotICAgICAgICAgICAgcHJlZCArPSA0OwotICAgICAgICAgICAgay0tOwotICAgICAgICB9Ci0gICAgICAgIG9yZ0NiICs9IG9yZ19waXRjaDsKLSAgICAgICAgayA9IDI7Ci0gICAgICAgIHdoaWxlIChrID4gMCkKLSAgICAgICAgewotICAgICAgICAgICAgbTAgPSBvcmdDclswXSAtIHByZWRbMF07Ci0gICAgICAgICAgICBtMyA9IG9yZ0NyWzNdIC0gcHJlZFszXTsKLSAgICAgICAgICAgIG0wICs9IG0zOwotICAgICAgICAgICAgbTMgPSBtMCAtIChtMyA8PCAxKTsKLSAgICAgICAgICAgIG0xID0gb3JnQ3JbMV0gLSBwcmVkWzFdOwotICAgICAgICAgICAgbTIgPSBvcmdDclsyXSAtIHByZWRbMl07Ci0gICAgICAgICAgICBtMSArPSBtMjsKLSAgICAgICAgICAgIG0yID0gbTEgLSAobTIgPDwgMSk7Ci0gICAgICAgICAgICBwcmVzWzBdID0gbTAgKyBtMTsKLSAgICAgICAgICAgIHByZXNbMl0gPSBtMCAtIG0xOwotICAgICAgICAgICAgcHJlc1sxXSA9IG0yICsgbTM7Ci0gICAgICAgICAgICBwcmVzWzNdID0gbTMgLSBtMjsKLQotICAgICAgICAgICAgb3JnQ3IgKz0gNDsKLSAgICAgICAgICAgIHByZXMgKz0gNDsKLSAgICAgICAgICAgIHByZWQgKz0gNDsKLSAgICAgICAgICAgIGstLTsKLSAgICAgICAgfQotICAgICAgICBvcmdDciArPSBvcmdfcGl0Y2g7Ci0gICAgfQotCi0gICAgLyogdmVydGljYWwgdHJhbnNmb3JtICovCi0gICAgZm9yIChqID0gMDsgaiA8IDI7IGorKykKLSAgICB7Ci0gICAgICAgIHByZXMgPSByZXMgKyAoaiA8PCA2KTsKLSAgICAgICAgayA9IDE2OwotICAgICAgICB3aGlsZSAoayA+IDApCi0gICAgICAgIHsKLSAgICAgICAgICAgIG0wID0gcHJlc1swXTsKLSAgICAgICAgICAgIG0zID0gcHJlc1szPDw0XTsKLSAgICAgICAgICAgIG0wICs9IG0zOwotICAgICAgICAgICAgbTMgPSBtMCAtIChtMyA8PCAxKTsKLSAgICAgICAgICAgIG0xID0gcHJlc1sxPDw0XTsKLSAgICAgICAgICAgIG0yID0gcHJlc1syPDw0XTsKLSAgICAgICAgICAgIG0xICs9IG0yOwotICAg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RSQVBSRURfTU9ERTsKLQotICAgIGlmIChjdXJyTUItPm1iTW9kZSA9PSBBVkNfSTE2KQotICAgIHsKLSAgICAgICAgY3Vyck1CLT5pMTZNb2RlID0gRklYRURfSTE2X01PREU7Ci0KLSAgICAgICAgaWYgKEZJWEVEX0kxNl9NT0RFID09IEFWQ19JMTZfVmVydGljYWwgJiYgIXZpZGVvLT5pbnRyYUF2YWlsQikKLSAgICAgICAgewotICAgICAgICAgICAgY3Vyck1CLT5pMTZNb2RlID0gQVZDX0kxNl9EQzsKLSAgICAgICAgfQotCi0gICAgICAgIGlmIChGSVhFRF9JMTZfTU9ERSA9PSBBVkNfSTE2X0hvcml6b250YWwgJiYgIXZpZGVvLT5pbnRyYUF2YWlsQSkKLSAgICAgICAgewotICAgICAgICAgICAgY3Vyck1CLT5pMTZNb2RlID0gQVZDX0kxNl9EQzsKLSAgICAgICAgfQotCi0gICAgICAgIGlmIChGSVhFRF9JMTZfTU9ERSA9PSBBVkNfSTE2X1BsYW5lICYmICEodmlkZW8tPmludHJhQXZhaWxBICYmIHZpZGVvLT5pbnRyYUF2YWlsQiAmJiB2aWRlby0+aW50cmFBdmFpbEQpKQotICAgICAgICB7Ci0gICAgICAgICAgICBjdXJyTUItPmkxNk1vZGUgPSBBVkNfSTE2X0RDOwotICAgICAgICB9Ci0gICAgfQotICAgIGVsc2UgLy9pZihjdXJyTUItPm1iTW9kZSA9PSBBVkNfSTQpCi0gICAgewotICAgICAgICBmb3IgKGluZHggPSAwOyBpbmR4IDwgMTY7IGluZHgrKykKLSAgICAgICAgewotICAgICAgICAgICAgYmxvY2tfeCA9IGJsa0lkeDJibGtYW2luZHhdOwotICAgICAgICAgICAgYmxvY2tfeSA9IGJsa0lkeDJibGtZW2luZHhdOwotCi0gICAgICAgICAgICBjdXJyTUItPmk0TW9kZVsoYmxvY2tfeTw8MikrYmxvY2tfeF0gPSBGSVhFRF9JNF9NT0RFOwotCi0gICAgICAgICAgICBpZiAoRklYRURfSTRfTU9ERSA9PSBBVkNfSTRfVmVydGljYWwgJiYgIShibG9ja195ID4gMCB8fCB2aWRlby0+aW50cmFBdmFpbEIpKQotICAgICAgICAgICAgewotICAgICAgICAgICAgICAgIGN1cnJNQi0+aTRNb2RlWyhibG9ja195PDwyKStibG9ja194XSA9IEFWQ19JNF9EQzsKLSAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgaWYgKEZJWEVEX0k0X01PREUgPT0gQVZDX0k0X0hvcml6b250YWwgJiYgIShibG9ja194IHx8IHZpZGVvLT5pbnRyYUF2YWlsQSkpCi0gICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgY3Vyck1CLT5pNE1vZGVbKGJsb2NrX3k8PDIpK2Jsb2NrX3hdID0gQVZDX0k0X0RDOwotICAgICAgICAgICAgfQotCi0gICAgICAgICAgICBpZiAoRklYRURfSTRfTU9ERSA9PSBBVkNfSTRfRGlhZ29uYWxfRG93bl9MZWZ0ICYmCi0gICAgICAgICAgICAgICAgICAgIChibG9ja195ID09IDAgJiYgIXZpZGVvLT5pbnRyYUF2YWlsQikpCi0gICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgY3Vyck1CLT5pNE1vZGVbKGJsb2NrX3k8PDIpK2Jsb2NrX3hdID0gQVZDX0k0X0RDOwotICAgICAgICAgICAgfQotCi0gICAgICAgICAgICBpZiAoRklYRURfSTRfTU9ERSA9PSBBVkNfSTRfRGlhZ29uYWxfRG93bl9SaWdodCAmJgotICAgICAgICAgICAgICAgICAgICAhKChibG9ja195ICYmIGJsb2NrX3gpCi0gICAgICAgICAgICAgICAgICAgICAgfHwgKGJsb2NrX3kgJiYgdmlkZW8tPmludHJhQXZhaWxBKQotICAgICAgICAgICAgICAgICAgICAgIHx8IChibG9ja194ICYmIHZpZGVvLT5pbnRyYUF2YWlsQikKLSAgICAgICAgICAgICAgICAgICAgICB8fCAodmlkZW8tPmludHJhQXZhaWxBICYmIHZpZGVvLT5pbnRyYUF2YWlsRCAmJiB2aWRlby0+aW50cmFBdmFpbEIpKSkKLSAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICBjdXJyTUItPmk0TW9kZVsoYmxvY2tfeTw8MikrYmxvY2tfeF0gPSBBVkNfSTRfREM7Ci0gICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgIGlmIChGSVhFRF9JNF9NT0RFID09IEFWQ19JNF9WZXJ0aWNhbF9SaWdodCAmJgotICAgICAgICAgICAgICAgICAgICAhKChibG9ja195ICYmIGJsb2NrX3gpCi0gICAgICAgICAgICAgICAgICAgICAgfHwgKGJsb2NrX3kgJiYgdmlkZW8tPmludHJhQXZhaWxBKQotICAgICAgICAgICAgICAgICAgICAgIHx8IChibG9ja194ICYmIHZpZGVvLT5pbnRyYUF2YWlsQikKLSAgICAgICAgICAgICAgICAgICAgICB8fCAodmlkZW8tPmludHJhQXZhaWxBICYmIHZpZGVvLT5pbnRyYUF2YWlsRCAmJiB2aWRlby0+aW50cmFBdmFpbEIpKSkKLSAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICBjdXJyTUItPmk0TW9kZVsoYmxvY2tfeTw8MikrYmxvY2tfeF0gPSBBVkNfSTRfREM7Ci0gICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgIGlmIChGSVhFRF9JNF9NT0RFID09IEFWQ19JNF9Ib3Jpem9udGFsX0Rvd24gJiYKLSAgICAgICAgICAgICAgICAgICAgISgoYmxvY2tfeSAmJiBibG9ja194KQotICAgICAgICAgICAgICAgICAgICAgIHx8IChibG9ja195ICYmIHZpZGVvLT5pbnRyYUF2YWlsQSkKLSAgICAgICAgICAgICAgICAgICAgICB8fCAoYmxvY2tfeCAmJiB2aWRlby0+aW50cmFBdmFpbEIpCi0gICAgICAgICAgICAgICAgICAgICAgfHwgKHZpZGVvLT5pbnRyYUF2YWlsQSAmJiB2aWRlby0+aW50cmFBdmFpbEQgJiYgdmlkZW8tPmludHJhQXZhaWxCKSkpCi0gICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgY3Vyck1CLT5pNE1vZGVbKGJsb2NrX3k8PDIpK2Jsb2NrX3hdID0gQVZDX0k0X0RDOwotICAgICAgICAgICAgfQotCi0gICAgICAgICAgICBpZiAoRklYRURfSTRfTU9ERSA9PSBBVkNfSTRfVmVydGljYWxfTGVmdCAmJgotICAgICAgICAgICAgICAgICAgICAoYmxvY2tfeSA9PSAwICYmICF2aWRlby0+aW50cmFBdmFpbEIpKQotICAgICAgICAgICAgewotICAgICAgICAgICAgICAgIGN1cnJNQi0+aTRNb2RlWyhibG9ja195PDwyKStibG9ja194XSA9IEFWQ19JNF9EQzsKLSAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgaWYgKEZJWEVEX0k0X01PREUgPT0gQVZDX0k0X0hvcml6b250YWxfVXAgJiYgIShibG9ja194IHx8IHZpZGVvLT5pbnRyYUF2YWlsQSkpCi0gICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgY3Vyck1CLT5pNE1vZGVbKGJsb2NrX3k8PDIpK2Jsb2NrX3hdID0gQVZDX0k0X0RDOwotICAgICAgICAgICAgfQotICAgICAgICB9Ci0gICAgfQotCi0gICAgY3Vyck1CLT5pbnRyYV9jaHJvbWFfcHJlZF9tb2RlID0gRklYRURfSU5UUkFfQ0hST01BX01PREU7Ci0KLSAgICBpZiAoRklYRURfSU5UUkFfQ0hST01BX01PREUgPT0gQVZDX0lDX0hvcml6b250YWwgJiYgISh2aWRlby0+aW50cmFBdmFpbEEpKQotICAgIHsKLSAgICAgICAgY3Vyck1CLT5pbnRyYV9jaHJvbWFfcHJlZF9tb2RlID0gQVZDX0lDX0RDOwotICAgIH0KLQotICAgIGlmIChGSVhFRF9JTlRSQV9DSFJPTUFfTU9ERSA9PSBBVkNfSUNfVmVydGljYWwgJiYgISh2aWRlby0+aW50cmFBdmFpbEIpKQotICAgIHsKLSAgICAgICAgY3Vyck1CLT5pbnRyYV9jaHJvbWFfcHJlZF9tb2RlID0gQVZDX0lDX0RDOwotICAgIH0KLQotICAgIGlmICh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fREMgKi8KLSAgICAgICAgc2FkNCA9IFNBRF9DaHJvbWFfREModmlkZW8sIGN1ckNiLCBjdXJDciwgNjU1MzYpOwotICAgICAgICBjdXJyTUItPmludHJhX2Nocm9tYV9wcmVkX21vZGUgPSBBVkNfSUNfREM7Ci0KLSAgICAgICAgLyogSW50cmFfQ2hyb21hX0hvcml6b250YWwgKi8KLSAgICAgICAgaWYgKHZpZGVvLT5pbnRyYUF2YWlsQSkKLSAgICAgICAgewotICAgICAgICAgICAgLyogY2hlY2sgYXZhaWxhYmlsaXR5IG9mIGxlZnQgKi8KLSAgICAgICAgICAgIHNhZCA9IFNBRF9DaHJvbWFfSG9yeih2aWRlbywgY3VyQ2IsIGN1ckNyLCBzYWQ0KTsKLSAgICAgICAgICAgIGlmIChzYWQgPCBzYWQ0KQotICAgICAgICAgICAgewotICAgICAgICAgICAgICAgIHNhZDQgPSBzYWQ7Ci0gICAgICAgICAgICAgICAgY3Vyck1CLT5pbnRyYV9jaHJvbWFfcHJlZF9tb2RlID0gQVZDX0lDX0hvcml6b250YWw7Ci0gICAgICAgICAgICB9Ci0gICAgICAgIH0KLQotICAgICAgICAvKiBJbnRyYV9DaHJvbWFfVmVydGljYWwgKi8KLSAgICAgICAgaWYgKHZpZGVvLT5pbnRyYUF2YWlsQikKLSAgICAgICAgewotICAgICAgICAgICAgLyogY2hlY2sgYXZhaWxhYmlsaXR5IG9mIHRvcCAqLwotICAgICAgICAgICAgc2FkID0gU0FEX0Nocm9tYV9WZXJ0KHZpZGVvLCBjdXJDYiwgY3VyQ3IsIHNhZDQpOwotCi0gICAgICAgICAgICBpZiAoc2FkIDwgc2FkNCkKLSAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICBzYWQ0ID0gc2FkOwotICAgICAgICAgICAgICAgIGN1cnJNQi0+aW50cmFfY2hyb21hX3ByZWRfbW9kZSA9IEFWQ19JQ19WZXJ0aWNhbDsKLSAgICAgICAgICAgIH0KLSAgICAgICAgfQotCi0gICAgICAgIC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DIpICogcGljUGl0Y2ggKyAoYmxvY2tfeCA8PCAyKTsKLSAgICAgICAgICAgIGVMdW1hTW90aW9uQ29tcChyZWZfbCwgcGljUGl0Y2gsIHBpY0hlaWdodCwgeF9wb3MsIHlfcG9zLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8qY29tcF9TbCArIG9mZnNldCArIG9mZnNldF94LCovCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgcHJlZEJsb2NrICsgb2Zmc2V0UCwgcGljUGl0Y2gsIE1iV2lkdGgsIE1iSGVpZ2h0KTsKLQotICAgICAgICAgICAgb2Zmc2V0UCA9IChibG9ja195ICogcGljV2lkdGgpICsgKGJsb2NrX3ggPDwgMSk7Ci0gICAgICAgICAgICBlQ2hyb21hTW90aW9uQ29tcChyZWZfQ2IsIHBpY1dpZHRoID4+IDEsIHBpY0hlaWdodCA+PiAxLCB4X3BvcywgeV9wb3MsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvKmNvbXBfU2NiICsgIG9mZnNldEMsKi8KLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHByZWRDYiArIG9mZnNldFAsIHBpY1BpdGNoID4+IDEsIE1iV2lkdGggPj4gMSwgTWJIZWlnaHQgPj4gMSk7Ci0gICAgICAgICAgICBlQ2hyb21hTW90aW9uQ29tcChyZWZfQ3IsIHBpY1dpZHRoID4+IDEsIHBpY0hlaWdodCA+PiAxLCB4X3BvcywgeV9wb3MsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvKmNvbXBfU2NyICsgIG9mZnNldEMsKi8KLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHByZWRDciArIG9mZnNldFAsIHBpY1BpdGNoID4+IDEsIE1iV2lkdGggPj4gMSwgTWJIZWlnaHQgPj4gMSk7Ci0KLSAgICAgICAgICAgIG9mZnNldF9pbmR4ID0gY3Vyck1CLT5TdWJNYlBhcnRXaWR0aFttYlBhcnRJZHhdID4+IDM7Ci0gICAgICAgIH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QgLSBibGt3aWR0aDsKLQotICAgIC8vc3dpdGNoKHhfcG9zJjB4Myl7Ci0gICAgc3dpdGNoICgoKHVpbnQzMilyZWYpJjB4MykKLSAgICB7Ci0gICAgICAgIGNhc2UgMToKLSAgICAgICAgICAgIG9mZnNldCA9ICBwaWNwaXRjaCAtIGJsa3dpZHRoIC0gMzsKLSAgICAgICAgICAgIGZvciAoaiA9IDA7IGogPCBibGtoZWlnaHQ7IGorKykKLSAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICBwaXgxID0gKnJlZisrOwotICAgICAgICAgICAgICAgIHBpeDIgPSAqKCh1aW50MTYqKXJlZik7Ci0gICAgICAgICAgICAgICAgcmVmICs9IDI7Ci0gICAgICAgICAgICAgICAgcmVzdWx0ID0gKHBpeDIgPDwgOCkgfCBwaXgxOwotCi0gICAgICAgICAgICAgICAgZm9yIChpID0gMzsgaSA8IGJsa3dpZHRoOyBpICs9IDQpCi0gICAgICAgICAgICAgICAgewotICAgICAgICAgICAgICAgICAgICBwaXg0ID0gKigodWludDMyKilyZWYpOwotICAgICAgICAgICAgICAgICAgICByZWYgKz0gNDsKLSAgICAgICAgICAgICAgICAgICAgcHJldl9waXggPSAocGl4NCA8PCAyNCkgJiAweEZGMDAwMDAwOyAvKiBtYXNrIG91dCBieXRlIGJlbG9uZyB0byBwcmV2aW91cyB3b3JkICovCi0gICAgICAgICAgICAgICAgICAgIHJlc3VsdCB8PSBwcmV2X3BpeDsKLSAgICAgICAgICAgICAgICAgICAgKigodWludDMyKilvdXQpID0gcmVzdWx0OyAgLyogd3JpdGUgNCBieXRlcyAqLwotICAgICAgICAgICAgICAgICAgICBvdXQgKz0gNDsKLSAgICAgICAgICAgICAgICAgICAgcmVzdWx0ID0gcGl4NCA+PiA4OyAvKiBmb3IgdGhlIG5leHQgbG9vcCAqLwotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICByZWYgKz0gb2Zmc2V0OwotICAgICAgICAgICAgICAgIG91dCArPSBvdXRfb2Zmc2V0OwotICAgICAgICAgICAgfQotICAgICAgICAgICAgYnJlYWs7Ci0gICAgICAgIGNhc2UgMjoKLSAgICAgICAgICAgIG9mZnNldCA9ICBwaWNwaXRjaCAtIGJsa3dpZHRoIC0gMjsKLSAgICAgICAgICAgIGZvciAoaiA9IDA7IGogPCBibGtoZWlnaHQ7IGorKykKLSAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICByZXN1bHQgPSAqKCh1aW50MTYqKXJlZik7Ci0gICAgICAgICAgICAgICAgcmVmICs9IDI7Ci0gICAgICAgICAgICAgICAgZm9yIChpID0gMjsgaSA8IGJsa3dpZHRoOyBpICs9IDQpCi0gICAgICAgICAgICAgICAgewotICAgICAgICAgICAgICAgICAgICBwaXg0ID0gKigodWludDMyKilyZWYpOwotICAgICAgICAgICAgICAgICAgICByZWYgKz0gNDsKLSAgICAgICAgICAgICAgICAgICAgcHJldl9waXggPSAocGl4NCA8PCAxNikgJiAweEZGRkYwMDAwOyAvKiBtYXNrIG91dCBieXRlIGJlbG9uZyB0byBwcmV2aW91cyB3b3JkICovCi0gICAgICAgICAgICAgICAgICAgIHJlc3VsdCB8PSBwcmV2X3BpeDsKLSAgICAgICAgICAgICAgICAgICAgKigodWludDMyKilvdXQpID0gcmVzdWx0OyAgLyogd3JpdGUgNCBieXRlcyAqLwotICAgICAgICAgICAgICAgICAgICBvdXQgKz0gNDsKLSAgICAgICAgICAgICAgICAgICAgcmVzdWx0ID0gcGl4NCA+PiAxNjsgLyogZm9yIHRoZSBuZXh0IGxvb3AgKi8KLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgcmVmICs9IG9mZnNldDsKLSAgICAgICAgICAgICAgICBvdXQgKz0gb3V0X29mZnNldDsKLSAgICAgICAgICAgIH0KLSAgICAgICAgICAgIGJyZWFrOwotICAgICAgICBjYXNlIDM6Ci0gICAgICAgICAgICBvZmZzZXQgPSAgcGljcGl0Y2ggLSBibGt3aWR0aCAtIDE7Ci0gICAgICAgICAgICBmb3IgKGogPSAwOyBqIDwgYmxraGVpZ2h0OyBqKyspCi0gICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgcmVzdWx0ID0gKnJlZisrOwotICAgICAgICAgICAgICAgIGZvciAoaSA9IDE7IGkgPCBibGt3aWR0aDsgaSArPSA0KQotICAgICAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAgICAgcGl4NCA9ICooKHVpbnQzMiopcmVmKTsKLSAgICAgICAgICAgICAgICAgICAgcmVmICs9IDQ7Ci0gICAgICAgICAgICAgICAgICAgIHByZXZfcGl4ID0gKHBpeDQgPDwgOCkgJiAweEZGRkZGRjAwOyAvKiBtYXNrIG91dCBieXRlIGJlbG9uZyB0byBwcmV2aW91cyB3b3JkICovCi0gICAgICAgICAgICAgICAgICAgIHJlc3VsdCB8PSBwcmV2X3BpeDsKLSAgICAgICAgICAgICAgICAgICAgKigodWludDMyKilvdXQpID0gcmVzdWx0OyAgLyogd3JpdGUgNCBieXRlcyAqLwotICAgICAgICAgICAgICAgICAgICBvdXQgKz0gNDsKLSAgICAgICAgICAgICAgICAgICAgcmVzdWx0ID0gcGl4NCA+PiAyNDsgLyogZm9yIHRoZSBuZXh0IGxvb3AgKi8KLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgcmVmICs9IG9mZnNldDsKLSAgICAgICAgICAgICAgICBvdXQgKz0gb3V0X29mZnNldDsKLSAgICAgICAgICAgIH0KLSAgICAgICAgICAgIGJyZWFrOwotICAgIH0KLX0KLQotdm9pZCBlSG9yekludGVycDFNQyh1aW50OCAqaW4sIGludCBpbnBpdGNoLCB1aW50OCAqb3V0LCBpbnQgb3V0cGl0Y2gsCi0gICAgICAgICAgICAgICAgICAgIGludCBibGt3aWR0aCwgaW50IGJsa2hlaWdodCwgaW50IGR4KQotewotICAgIHVpbnQ4ICpwX3JlZjsKLSAgICB1aW50MzIgKnBfY3VyOwotICAgIHVpbnQzMiB0bXAsIHBrcmVzOwotICAgIGludCByZXN1bHQsIGN1cnJfb2Zmc2V0LCByZWZfb2Zmc2V0OwotICAgIGludCBqOwotICAgIGludDMyIHIwLCByMSwgcjIsIHIzLCByNCwgcjU7Ci0gICAgaW50MzIgcjEzLCByNjsKLQotICAgIHBfY3VyID0gKHVpbnQzMiopb3V0OyAvKiBhc3N1bWUgaXQncyB3b3JkIGFsaWduZWQgKi8KLSAgICBjdXJyX29mZnNldCA9IChvdXRwaXRjaCAtIGJsa3dpZHRoKSA+PiAyOwotICAgIHBfcmVmID0gaW47Ci0gICAgcmVmX29mZnNldCA9IGlucGl0Y2ggLSBibGt3aWR0aDsKLQotICAgIGlmIChkeCYxKQotICAgIHsKLSAgICAgICAgZHggPSAoKGR4ID4+IDEpID8gLTMgOiAtNCk7IC8qIHVzZSBpbiAzLzQgcGVsICovCi0gICAgICAgIHBfcmVmIC09IDI7Ci0gICAgICAgIHIxMyA9IDA7Ci0gICAgICAgIGZvciAoaiA9IGJsa2hlaWdodDsgaiA+IDA7IGotLSkKLSAgICAgICAgewotICAgICAgICAgICAgdG1wID0gKHVpbnQzMikocF9yZWYgKyBibGt3aWR0aCk7Ci0gICAgICAgICAgICByMCA9IHBfcmVmWzBdOwotICAgICAgICAgICAgcjEgPSBwX3JlZlsyXTsKLSAgICAgICAgICAgIHIwIHw9IChyMSA8PCAxNik7ICAgICAgICAgICAvKiAwLGMsMCxhICovCi0gICAgICAgICAgICByMSA9IHBfcmVmWzFdOwotICAgICAgICAgICAgcjIgPSBwX3JlZlszXTsKLSAgICAgICAgICAgIHIxIHw9IChyMiA8PCAxNik7ICAgICAgICAgICAvKiAwLGQsMCxiICovCi0gICAgICAgICAgICB3aGlsZSAoKHVpbnQzMilwX3JlZiA8IHRtcCkKLSAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICByMiA9ICoocF9yZWYgKz0gNCk7IC8qIG1vdmUgcG9pbnRlciB0byBlICovCi0gICAgICAgICAgICAgICAgcjMgPSBwX3JlZlsyXTsKLSAgICAgICAgICAgICAgICByMiB8PSAocjMgPDwgMTYpOyAgICAgICAgICAgLyogMCxnLDAsZSAqLwotICAgICAgICAgICAgICAgIHIzID0gcF9yZWZbMV07Ci0gICAgICAgICAgICAgICAgcjQgPSBwX3JlZlszXTsKLSAgICAgICAgICAgICAgICByMyB8PSAocjQgPDwgMTYpOyAgICAgICAgICAgLyogMCxoLDAsZiAqLwotCi0gICAgICAgICAgICAgICAgcjQgPSByMCArIHIzOyAgICAgICAvKiBjK2gsIGErZiAqLwotICAgICAgICAgICAgICAgIHI1ID0gcjAgKyByMTsgICAvKiBjK2QsIGErYiAqLwotICAgICAgICAgICAgICAgIHI2ID0gcjIgKyByMzsgICAvKiBnK2gsIGUrZiAqLwotICAgICAgICAgICAgICAgIHI1ID4+PSAxNjsKLSAgICAgICAgICAgICAgICByNSB8PSAocjYgPDwgMTYpOyAgIC8qIGUrZiwgYytkICovCi0gICAgICAgICAgICAgICAgcjQgKz0gcjUgKiAyMDsgICAgICAvKiBjKzIwKmUrMjAqZitoLCBhKzIwKmMrMjAqZCtmICovCi0gICAgICAgICAgICAgICAgcjQgKz0gMHgxMDAwMTA7IC8qICsxNiwgKzE2ICovCi0gICAgICAgICAgICAgICAgcjUgPSByMSArIHIyOyAgICAgICAvKiBkK2csIGIrZSAqLwotICAgICAgICAgICAgICAgIHI0IC09IHI1ICogNTsgICAgICAgLyogYy01KmQrMjAqZSsyMCpmLTUqZytoLCBhLTUqYisyMCpjKzIwKmQtNSplK2YgKi8KLSAgICAgICAgICAgICAgICByNCA+Pj0gNTsKLSAgICAgICAgICAgICAgICByMTMgfD0gcjQ7ICAgICAgLyogY2hlY2sgY2xpcHBpbmcgKi8KLQotICAgICAgICAgICAgICAgIHI1ID0gcF9yZWZbZHgrMl07Ci0gICAgICAgICAgICAgICAgcjYgPSBwX3JlZltkeCs0XTsKLSAgICAgICAgICAgICAgICByNSB8PSAocjYgPDwgMTYpOwotICAgICAgICAgICAgICAgIHI0ICs9IHI1OwotICAgICAgICAgICAgICAgIHI0ICs9IDB4MTAwMDE7Ci0gICAgICAgICAgICAgICAgcjQgPSAocjQgPj4gMSkgJiAweEZGMDBGRjsKLQotICAgICAgICAgICAgICAgIHI1ID0gcF9yZWZbNF07ICAvKiBpICovCi0gICAgICAgICAgICAgICAgcjYgPSAocjUgPDwgMTYpOwotICAgICAgICAgICAgICAgIHI1ID0gcjYgfCAocjIgPj4gMTYpOy8qIDAsaSwwLGcgKi8KLSAgICAgICAgICAgICAgICByNSArPSByMTsgICAgICAgLyogZCtpLCBiK2cgKi8gLyogcjUgbm90IGZyZWUgKi8KLSAgICAgICAgICAgICAgICByMSA+Pj0gMTY7Ci0gICAgICAgICAgICAgICAgcjEgfD0gKHIzIDw8IDE2KTsgLyogMCxmLDAsZCAqLyAvKiByMSBoYXMgY2hhbmdlZCAqLwotICAgICAgICAgICAgICAgIHIxICs9IHIyOyAgICAgICAvKiBmK2csIGQrZSAqLwotICAgICAgICAgICAgICAgIHI1ICs9IDIwICogcjE7ICAvKiBkKzIwZisyMGcraSwgYisyMGQrMjBlK2cgKi8KLSAgICAgICAgICAgICAgICByMCA+Pj0gMTY7Ci0gICAgICAgICAgICAgICAgcjAgfD0gKHIyIDw8IDE2KTsgLyogMCxlLDAsYyAqLyAvKiByMCBoYXMgY2hhbmdlZCAqLwotICAgICAgICAgICAgICAgIHIwICs9IHIzOyAgICAgICAvKiBlK2gsIGMrZiAqLwotICAgICAgICAgICAgICAgIHI1ICs9IDB4MTAwMDEwOyAvKiAxNiwxNiAqLwotICAgICAgICAgICAgICAgIHI1IC09IHIwICogNTsgICAgICAgLyogZC01ZSsyMGYrMjBnLTVoK2ksIGItNWMrMjBkKzIwZS01ZitnICovCi0gICAgICAgICAgICAgICAgcjUgPj49IDU7Ci0gICAgICAgICAgICAgICAgcjEzIHw9IHI1OyAgICAgIC8qIGNoZWNrIGNsaXBwaW5nICovCi0KLSAgICAgICAgICAgICAgICByMCA9IHBfcmVmW2R4KzNdOwotICAgICAgICAgICAgICAgIHIxID0gcF9yZWZbZHgrNV07Ci0gICAgICAgICAgICAgICAgcjAgfD0gKHIxIDw8IDE2KTsKLSAgICAgICAgICAgICAgICByNSArPSByMDsKLSAgICAgICAgICAgICAgICByNSArPSAweDEwMDAxOwotICAgICAgICAgICAgICAgIHI1ID0gKHI1ID4+IDEpICYgMHhGRjAwRkY7Ci0KLSAgICAgICAgICAgICAgICByNCB8PSAocjUgPDwgOCk7ICAgIC8qIHBhY2sgdGhlbSB0b2dldGhlciAqLwotICAgICAgICAgICAgICAgICpwX2N1cisrID0gcjQ7Ci0gICAgICAgICAgICAgICAgcjEgPSByMzsKLSAgICAgICAgICAgICAgICByMCA9IHIyOwotICAgICAgICAgICAgfQotICAgICAgICAgICAgcF9jdXIgKz0gY3Vycl9vZmZzZXQ7IC8qIG1vdmUgdG8gdGhlIG5leHQgbGluZSAqLwotICAgICAgICAgICAgcF9yZWYgKz0gcmVmX29mZnNldDsgIC8qICAgIHJlZl9vZmZzZXQgPSBpbnBpdGNoLWJsa3dpZHRoOyAqLwotCi0gICAgICAgICAgICBpZiAocjEzJjB4RkYwMDA3MDApIC8qIG5lZWQgY2xpcHBpbmcgKi8KLSAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAvKiBtb3ZlIGJhY2sgdG8gdGhlIGJlZ2lubmluZyBvZiB0aGUgbGluZSAqLwotICAgICAgICAgICAgICAgIHBfcmVmIC09IChyZWZfb2Zmc2V0ICsgYmxrd2lkdGgpOyAgIC8qIGlucHV0ICovCi0gICAgICAgICAgICAgICAgcF9jdXIgLT0gKG91dHBpdGNoID4+IDIpOwotCi0gICAgICAgICAgICAgICAgdG1wID0gKHVpbnQzMikocF9yZWYgKyBibGt3aWR0aCk7Ci0gICAgICAgICAgICAgICAgZm9yICg7ICh1aW50MzIpcF9yZWYgPCB0bXA7KQotICAgICAgICAgICAgICAgIHsKLQotICAgICAgICAgICAgICAgICAgICByMCA9ICpwX3JlZisrOwotICAgICAgICAgICAgICAgICAgICByMSA9ICpwX3JlZisrOwotICAgICAgICAgICAgICAgICAgICByMiA9ICpwX3JlZisrOwotICAgICAgICAgICAgICAgICAgICByMyA9ICpwX3JlZisrOwotICAgICAgICAgICAgICAgICAgICByNCA9ICpwX3JlZisrOwotICAgICAgICAgICAgICAgICAgICAvKiBmaXJzdCBwaXhlbCAqLwotICAgICAgICAgICAgICAgICAgICByNSA9ICpwX3JlZisrOwotICAgICAgICAgICAgICAgICAgICByZXN1bHQgPSAocjAgKyByNSk7Ci0gICAgICAgICAgICAgICAgICAgIHIwID0gKHIxICsgcjQpOwotICAgICAgICAgICAgICAgICAgICByZXN1bHQgLT0gKHIwICogNSk7Ly9yZXN1bHQgLT0gcjA7ICByZXN1bHQgLT0gKHIwPDwyKTsKLSAgICAgICAgICAgICAgICAgICAgcjAgPSAocjIgKyByMyk7Ci0gICAgICAgICAgICAgICAgICAgIHJlc3VsdCArPSAocjAgKiAyMCk7Ly9yZXN1bHQgKz0gKHIwPDw0KTsgICAgcmVzdWx0ICs9IChyMDw8Mik7Ci0gICAgICAgICAgICAgICAgICAgIHJlc3VsdCA9IChyZXN1bHQgKyAxNikgPj4gNTsKLSAgICAgICAgICAgICAgICAgICAgQ0xJUF9SRVNVTFQocmVzdWx0KQotICAgICAgICAgICAgICAgICAgICAvKiAzLzQgcGVsLCAgbm8gbmVlZCB0byBjbGlwICovCi0gICAgICAgICAgICAgICAgICAgIHJlc3VsdCA9IChyZXN1bHQgKyBwX3JlZltkeF0gKyAxKTsKLSAgICAgICAgICAgICAgICAgICAgcGtyZXMgPSAocmVzdWx0ID4+IDEpIDsKLSAgICAgICAgICAgICAgICAgICAgLyogc2Vjb25kIHBpeGVsICovCi0gICAgICAgICAgICAgICAgICAgIHIwID0gKnBfcmVmKys7Ci0gICAgICAgICAgICAgICAgICAgIHJlc3VsdCA9IChyMSArIHIwKTsKLSAgICAgICAgICAgICAgICAgICAgcjEgPSAocjIgKyByNSk7Ci0gICAgICAgICAgICAgICAgICAgIHJlc3VsdCAtPSAocjEgKiA1KTsvL3Jlc3VsdCAtPSByMTsgIHJlc3VsdCAtPSAocjE8PDIpOwotICAgICAgICAgICAgICAgICAgICByMSA9IChyMyArIHI0KTsKLSAgICAgICAgICAgICAgICAgICAgcmVzdWx0ICs9IChyMSAqIDIwKTsvL3Jlc3VsdCArPSAocjE8PDQpOyAgICByZXN1bHQgKz0gKHIxPDwyKTsKLSAgICAgICAgICAgICAgICAgICAgcmVzdWx0ID0gKHJlc3VsdCArIDE2KSA+PiA1OwotICAgICAgICAgICAgICAgICAgICBDTElQX1JFU1VMVChyZXN1bHQpCi0gICAgICAgICAgICAgICAgICAgIC8qIDMvNCBwZWwsICBubyBuZWVkIHRvIGNsaXAgKi8KLSAgICAgICAgICAgICAgICAgICAgcmVzdWx0ID0gKHJlc3VsdCArIHBfcmVmW2R4XSArIDEpOwotICAgICAgICAgICAgICAgICAgICByZXN1bHQgPSAocmVzdWx0ID4+IDEpOwotICAgICAgICAgICAgICAgICAgICBwa3JlcyAgfD0gKHJlc3VsdCA8PCA4KTsKLSAgICAgICAgICAgICAgICAgICAgLyogdGhpcmQgcGl4ZWwgKi8KLSAgICAgICAgICAgICAgICAgICAgcjEgPSAqcF9yZWYrKzsKLSAgICAgICAgICAgICAgICAgICAgcmVzdWx0ID0gKHIyICsgcjEpOwotICAgICAgICAgICAgICAgICAgICByMiA9IChyMyArIHIwKTsKLSAgICAgICAgICAgICAgICAgICAgcmVzdWx0IC09IChyMiAqIDUpOy8vcmVzdWx0IC09IHIyOyAgcmVzdWx0IC09IChyMjw8Mik7Ci0gICAgICAgICAgICAgICAgICAgIHIyID0gKHI0ICsgcjUpOwotICAgICAgICAgICAgICAgICAgICByZXN1bHQgKz0gKHIyICogMjApOy8vcmVzdWx0ICs9IChyMjw8NCk7ICAgIHJlc3VsdCArPSAocjI8PDIpOwotICAgICAgICAgICAgICAgICAgICByZXN1bHQgPSAocmVzdWx0ICsgMTYpID4+IDU7Ci0gICAgICAgICAgICAgICAgICAgIENMSVBfUkVTVUxUKHJlc3VsdCkKLSAgICAgICAgICAgICAgICAgICAgLyogMy80IHBlbCwgIG5vIG5lZWQgdG8gY2xpcCAqLwotICAgICAgICAgICAgICAgICAgICByZXN1bHQgPSAocmVzdWx0ICsgcF9yZWZbZHhdICsgMSk7Ci0gICAgICAgICAgICAgICAgICAgIHJlc3VsdCA9IChyZXN1bHQgPj4gMSk7Ci0gICAgICAgICAgICAgICAgICAgIHBrcmVzICB8PSAocmVzdWx0IDw8IDE2KTsKLSAgICAgICAgICAgICAgICAgICAgLyogZm91cnRoIHBpeGVsICovCi0gICAgICAgICAgICAgICAgICAgIHIyID0gKnBfcmVmKys7Ci0gICAgICAgICAgICAgICAgICAgIHJlc3VsdCA9IChyMyArIHIyKTsKLSAgICAgICAgICAgICAgICAgICAgcjMgPSAocjQgKyByMSk7Ci0gICAgICAgICAgICAgICAgICAgIHJlc3VsdCAtPSAocjMgKiA1KTsvL3Jlc3VsdCAtPSByMzsgIHJlc3VsdCAtPSAocjM8PDIpOwotICAgICAgICAgICAgICAgICAgICByMyA9IChyNSArIHIwKTsKLSAgICAgICAgICAgICAgICAgICAgcmVzdWx0ICs9IChyMyAqIDIwKTsvL3Jlc3VsdCArPSAocjM8PDQpOyAgICByZXN1bHQgKz0gKHIzPDwyKTsKLSAgICAgICAgICAgICAgICAgICAgcmVzdWx0ID0gKHJlc3VsdCArIDE2KSA+PiA1OwotICAgICAgICAgICAgICAgICAgICBDTElQX1JFU1VMVChyZXN1bHQpCi0gICAgICAgICAgICAgICAgICAgIC8qIDMvNCBwZWwsICBubyBuZWVkIHRvIGNsaXAgKi8KLSAgICAgICAgICAgICAgICAgICAgcmVzdWx0ID0gKHJlc3VsdCArIHBfcmVmW2R4XSArIDEpOwotICAgICAgICAgICAgICAgICAgICByZXN1bHQgPSAocmVzdWx0ID4+IDEpOwotICAgICAgICAgICAgICAgICAgICBwa3JlcyAgfD0gKHJlc3VsdCA8PCAyNCk7Ci0gICAgICAgICAgICAgICAgICAgICpwX2N1cisrID0gcGtyZXM7IC8qIHdyaXRlIDQgcGl4ZWxzICovCi0gICAgICAgICAgICAgICAgICAgIHBfcmVmIC09IDU7ICAvKiBvZmZzZXQgYmFjayB0byB0aGUgbWlkZGxlIG9mIGZpbHRlciAqLwotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICBwX2N1ciArPSBjdXJyX29mZnNldDsgIC8qIG1vdmUgdG8gdGhlIG5leHQgbGluZSAqLwotICAgICAgICAgICAgICAgIHBfcmVmICs9IHJlZl9vZmZzZXQ7ICAgIC8qIG1vdmUgdG8gdGhlIG5leHQgbGluZSAqLwotICAgICAgICAgICAgfQotICAgICAgICB9Ci0gICAgfQotICAgIGVsc2UKLSAgICB7Ci0gICAgICAgIHBfcmVmIC09IDI7Ci0gICAgICAgIHIxMyA9IDA7Ci0gICAgICAgIGZvciAoaiA9IGJsa2hlaWdodDsgaiA+IDA7IGotLSkKLSAgICAgICAgewotICAgICAgICAgICAgdG1wID0gKHVpbnQzMikocF9yZWYgKyBibGt3aWR0aCk7Ci0gICAgICAgICAgICByMCA9IHBfcmVmWzBdOwotICAgICAgICAgICAgcjEgPSBwX3JlZlsyXTsKLSAgICAgICAgICAgIHIwIHw9IChyMSA8PCAxNik7ICAgICAgICAgICAvKiAwLGMsMCxhICovCi0gICAgICAgICAgICByMSA9IHBfcmVmWzFdOwotICAgICAgICAgICAgcjIgPSBwX3JlZlszXTsKLSAgICAgICAgICAgIHIxIHw9IChyMiA8PCAxNik7ICAgICAgICAgICAvKiAwLGQsMCxiICovCi0gICAgICAgICAgICB3aGlsZSAoKHVpbnQzMilwX3JlZiA8IHRtcCkKLSAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICByMiA9ICoocF9yZWYgKz0gNCk7IC8qIG1vdmUgcG9pbnRlciB0byBlICovCi0gICAgICAgICAgICAgICAgcjMgPSBwX3JlZlsyXTsKLSAgICAgICAgICAgICAgICByMiB8PSAocjMgPDwgMTYpOyAgICAgICAgICAgLyogMCxnLDAsZSAqLwotICAgICAgICAgICAgICAgIHIzID0gcF9yZWZbMV07Ci0gICAgICAgICAgICAgICAgcjQgPSBwX3JlZlszXTsKLSAgICAgICAgICAgICAgICByMyB8PSAocjQgPDwgMTYpOyAgICAgICAgICAgLyogMCxoLDAsZiAqLwotCi0gICAgICAgICAgICAgICAgcjQgPSByMCArIHIzOyAgICAgICAvKiBjK2gsIGErZiAqLwotICAgICAgICAgICAgICAgIHI1ID0gcjAgKyByMTsgICAvKiBjK2QsIGErYiAqLwotICAgICAgICAgICAgICAgIHI2ID0gcjIgKyByMzsgICAvKiBnK2gsIGUrZiAqLwotICAgICAgICAgICAgICAgIHI1ID4+PSAxNjsKLSAgICAgICAgICAgICAgICByNSB8PSAocjYgPDwgMTYpOyAgIC8qIGUrZiwgYytkICovCi0gICAgICAgICAgICAgICAgcjQgKz0gcjUgKiAyMDsgICAgICAvKiBjKzIwKmUrMjAqZitoLCBhKzIwKmMrMjAqZCtmICovCi0gICAgICAgICAgICAgICAgcjQgKz0gMHgxMDAwMTA7IC8qICsxNiwgKzE2ICovCi0gICAgICAgICAgICAgICAgcjUgPSByMSArIHIyOyAgICAgICAvKiBkK2csIGIrZSAqLwotICAgICAgICAgICAgICAgIHI0IC09IHI1ICogNTsgICAgICAgLyogYy01KmQrMjAqZSsyMCpmLTUqZytoLCBhLTUqYisyMCpjKzIwKmQtNSplK2YgKi8KLSAgICAgICAgICAgICAgICByNCA+Pj0gNTsKLSAgICAgICAgICAgICAgICByMTMgfD0gcjQ7ICAgICAgLyogY2hlY2sgY2xpcHBpbmcgKi8KLSAgICAgICAgICAgICAgICByNCAmPSAweEZGMDBGRjsgLyogbWFzayAqLwotCi0gICAgICAgICAgICAgICAgcjUgPSBwX3JlZls0XTsgIC8qIGkgKi8KLSAgICAgICAgICAgICAgICByNiA9IChyNSA8PCAxNik7Ci0gICAgICAgICAgICAgICAgcjUgPSByNiB8IChyMiA+PiAxNik7LyogMCxpLDAsZyAqLwotICAgICAgICAgICAgICAgIHI1ICs9IHIxOyAgICAgICAvKiBkK2ksIGIrZyAqLyAvKiByNSBub3QgZnJlZSAqLwotICAgICAgICAgICAgICAgIHIxID4+PSAxNjsKLSAgICAgICAgICAgICAgICByMSB8PSAocjMgPDwgMTYpOyAvKiAwLGYsMCxkICovIC8qIHIxIGhhcyBjaGFuZ2VkICovCi0gICAgICAgICAgICAgICAgcjEgKz0gcjI7ICAgICAgIC8qIGYrZywgZCtlICovCi0gICAgICAgICAgICAgICAgcjUgKz0gMjAgKiByMTsgIC8qIGQrMjBmKzIwZytpLCBiKzIwZCsyMGUrZyAqLwotICAgICAgICAgICAgICAgIHIwID4+PSAxNjsKLSAgICAgICAgICAgICAgICByMCB8PSAocjIgPDwgMTYpOyAvKiAwLGUsMCxjICovIC8qIHIwIGhhcyBjaGFuZ2VkICovCi0gICAgICAgICAgICAgICAgcjAgKz0gcjM7ICAgICAgIC8qIGUraCwgYytmICovCi0gICAgICAgICAgICAgICAgcjUgKz0gMHgxMDAwMTA7IC8qIDE2LDE2ICovCi0gICAgICAgICAgICAgICAgcjUgLT0gcjAgKiA1OyAgICAgICAvKiBkLTVlKzIwZisyMGctNWgraSwgYi01YysyMGQrMjBlLTVmK2cgKi8KLSAgICAgICAgICAgICAgICByNSA+Pj0gNTsKLSAgICAgICAgICAgICAgICByMTMgfD0gcjU7ICAgICAgLyogY2hlY2sgY2xpcHBpbmcgKi8KLSAgICAgICAgICAgICAgICByNSAmPSAweEZGMDBGRjsgLyogbWFzayAqLwotCi0gICAgICAgICAgICAgICAgcjQgfD0gKHI1IDw8IDgpOyAgICAvKiBwYWNrIHRoZW0gdG9nZXRoZXIgKi8KLSAgICAgICAgICAgICAgICAqcF9jdXIrKyA9IHI0OwotICAgICAgICAgICAgICAgIHIxID0gcjM7Ci0gICAgICAgICAgICAgICAgcjAgPSByMjsKLSAgICAgICAgICAgIH0KLSAgICAgICAgICAgIHBfY3VyICs9IGN1cnJfb2Zmc2V0OyAvKiBtb3ZlIHRvIHRoZSBuZXh0IGxpbmUgKi8KLSAgICAgICAgICAgIHBfcmVmICs9IHJlZl9vZmZzZXQ7ICAvKiAgICByZWZfb2Zmc2V0ID0gaW5waXRjaC1ibGt3aWR0aDsgKi8KLQotICAgICAgICAgICAgaWYgKHIxMyYweEZGMDAwNzAwKSAvKiBuZWVkIGNsaXBwaW5nICovCi0gICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgLyogbW92ZSBiYWNrIHRvIHRoZSBiZWdpbm5pbmcgb2YgdGhlIGxpbmUgKi8KLSAgICAgICAgICAgICAgICBwX3JlZiAtPSAocmVmX29mZnNldCArIGJsa3dpZHRoKTsgICAvKiBpbnB1dCAqLwotICAgICAgICAgICAgICAgIHBfY3VyIC09IChvdXRwaXRjaCA+PiAyKTsKLQotICAgICAgICAgICAgICAgIHRtcCA9ICh1aW50MzIpKHBfcmVmICsgYmxrd2lkdGgpOwotICAgICAgICAgICAgICAgIGZvciAoOyAodWludDMyKXBfcmVmIDwgdG1wOykKLSAgICAgICAgICAgICAgICB7Ci0KLSAgICAgICAgICAgICAgICAgICAgcjAgPSAqcF9yZWYrKzsKLSAgICAgICAgICAgICAgICAgICAgcjEgPSAqcF9yZWYrKzsKLSAgICAgICAgICAgICAgICAgICAgcjIgPSAqcF9yZWYrKzsKLSAgICAgICAgICAgICAgICAgICAgcjMgPSAqcF9yZWYrKzsKLSAgICAgICAgICAgICAgICAgICAgcjQgPSAqcF9yZWYrKzsKLSAgICAgICAgICAgICAgICAgICAgLyogZmlyc3QgcGl4ZWwgKi8KLSAgICAgICAgICAgICAgICAgICAgcjUgPSAqcF9yZWYrKzsKLSAgICAgICAgICAgICAgICAgICAgcmVzdWx0ID0gKHIwICsgcjUpOwotICAgICAgICAgICAgICAgICAgICByMCA9IChyMSArIHI0KTsKLSAgICAgICAgICAgICAgICAgICAgcmVzdWx0IC09IChyMCAqIDUpOy8vcmVzdWx0IC09IHIwOyAgcmVzdWx0IC09IChyMDw8Mik7Ci0gICAgICAgICAgICAgICAgICAgIHIwID0gKHIyICsgcjMpOwotICAgICAgICAgICAgICAgICAgICByZXN1bHQgKz0gKHIwICogMjApOy8vcmVzdWx0ICs9IChyMDw8NCk7ICAgIHJlc3VsdCArPSAocjA8PDIpOwotICAgICAgICAgICAgICAgICAgICByZXN1bHQgPSAocmVzdWx0ICsgMTYpID4+IDU7Ci0gICAgICAgICAgICAgICAgICAgIENMSVBfUkVTVUxUKHJlc3VsdCkKLSAgICAgICAgICAgICAgICAgICAgcGtyZXMgID0gcmVzdWx0OwotICAgICAgICAgICAgICAgICAgICAvKiBzZWNvbmQgcGl4ZWwgKi8KLSAgICAgICAgICAgICAgICAgICAgcjAgPSAqcF9yZWYrKzsKLSAgICAgICAgICAgICAgICAgICAgcmVzdWx0ID0gKHIxICsgcjApOwotICAgICAgICAgICAgICAgICAgICByMSA9IChyMiArIHI1KTsKLSAgICAgICAgICAgICAgICAgICAgcmVzdWx0IC09IChyMSAqIDUpOy8vcmVzdWx0IC09IHIxOyAgcmVzdWx0IC09IChyMTw8Mik7Ci0gICAgICAgICAgICAgICAgICAgIHIxID0gKHIzICsgcjQpOwotICAgICAgICAgICAgICAgICAgICByZXN1bHQgKz0gKHIxICogMjApOy8vcmVzdWx0ICs9IChyMTw8NCk7ICAgIHJlc3VsdCArPSAocjE8PDIpOwotICAgICAgICAgICAgICAgICAgICByZXN1bHQgPSAocmVzdWx0ICsgMTYpID4+IDU7Ci0gICAgICAgICAgICAgICAgICAgIENMSVBfUkVTVUxUKHJlc3VsdCkKLSAgICAgICAgICAgICAgICAgICAgcGtyZXMgIHw9IChyZXN1bHQgPDwgOCk7Ci0gICAgICAgICAgICAgICAgICAgIC8qIHRoaXJkIHBpeGVsICovCi0gICAgICAgICAgICAgICAgICAgIHIxID0gKnBfcmVmKys7Ci0gICAgICAgICAgICAgICAgICAgIHJlc3VsdCA9IChyMiArIHIxKTsKLSAgICAgICAgICAgICAgICAgICAgcjIgPSAocjMgKyByMCk7Ci0gICAgICAgICAgICAgICAgICAgIHJlc3VsdCAtPSAocjIgKiA1KTsvL3Jlc3VsdCAtPSByMjsgIHJlc3VsdCAtPSAocjI8PDIpOwotICAgICAgICAgICAgICAgICAgICByMiA9IChyNCArIHI1KTsKLSAgICAgICAgICAgICAgICAgICAgcmVzdWx0ICs9IChyMiAqIDIwKTsvL3Jlc3VsdCArPSAocjI8PDQpOyAgICByZXN1bHQgKz0gKHIyPDwyKTsKLSAgICAgICAgICAgICAgICAgICAgcmVzdWx0ID0gKHJlc3VsdCArIDE2KSA+PiA1OwotICAgICAgICAgICAgICAgICAgICBDTElQX1JFU1VMVChyZXN1bHQpCi0gICAgICAgICAgICAgICAgICAgIHBrcmVzICB8PSAocmVzdWx0IDw8IDE2KTsKLSAgICAgICAgICAgICAgICAgICAgLyogZm91cnRoIHBpeGVsICovCi0gICAgICAgICAgICAgICAgICAgIHIyID0gKnBfcmVmKys7Ci0gICAgICAgICAgICAgICAgICAgIHJlc3VsdCA9IChyMyArIHIyKTsKLSAgICAgICAgICAgICAgICAgICAgcjMgPSAocjQgKyByMSk7Ci0gICAgICAgICAgICAgICAgICAgIHJlc3VsdCAtPSAocjMgKiA1KTsvL3Jlc3VsdCAtPSByMzsgIHJlc3VsdCAtPSAocjM8PDIpOwotICAgICAgICAgICAgICAgICAgICByMyA9IChyNSArIHIwKTsKLSAgICAgICAgICAgICAgICAgICAgcmVzdWx0ICs9IChyMyAqIDIwKTsvL3Jlc3VsdCArPSAocjM8PDQpOyAgICByZXN1bHQgKz0gKHIzPDwyKTsKLSAgICAgICAgICAgICAgICAgICAgcmVzdWx0ID0gKHJlc3VsdCArIDE2KSA+PiA1OwotICAgICAgICAgICAgICAgICAgICBDTElQX1JFU1VMVChyZXN1bHQpCi0gICAgICAgICAgICAgICAgICAgIHBrcmVzICB8PSAocmVzdWx0IDw8IDI0KTsKLSAgICAgICAgICAgICAgICAgICAgKnBfY3VyKysgPSBwa3JlczsgICAvKiB3cml0ZSA0IHBpeGVscyAqLwotICAgICAgICAgICAgICAgICAgICBwX3JlZiAtPSA1OwotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICBwX2N1ciArPSBjdXJyX29mZnNldDsgLyogbW92ZSB0byB0aGUgbmV4dCBsaW5lICovCi0gICAgICAgICAgICAgICAgcF9yZWYgKz0gcmVmX29mZnNldDsKLSAgICAgICAgICAgIH0KLSAgICAgICAgfQotICAgIH0KLQotICAgIHJldHVybiA7Ci19Ci0KLXZvaWQgZUhvcnpJbnRlcnAyTUMoaW50ICppbiwgaW50IGlucGl0Y2gsIHVpbnQ4ICpvdXQsIGludCBvdXRwaXRjaCwKLSAgICAgICAgICAgICAgICAgICAgaW50IGJsa3dpZHRoLCBpbnQgYmxraGVpZ2h0LCBpbnQgZHgpCi17Ci0gICAgaW50ICpwX3JlZjsKLSAgICB1aW50MzIgKnBfY3VyOwotICAgIHVpbnQzMiB0bXAsIHBrcmVzOwotICAgIGludCByZXN1bHQsIHJlc3VsdDIsIGN1cnJfb2Zmc2V0LCByZWZfb2Zmc2V0OwotICAgIGludCBqLCByMCwgcjEsIHIyLCByMywgcjQsIHI1OwotCi0gICAgcF9jdXIgPSAodWludDMyKilvdXQ7IC8qIGFzc3VtZSBpdCdzIHdvcmQgYWxpZ25lZCAqLwotICAgIGN1cnJfb2Zmc2V0ID0gKG91dHBpdGNoIC0gYmxrd2lkdGgpID4+IDI7Ci0gICAgcF9yZWYgPSBpbjsKLSAgICByZWZfb2Zmc2V0ID0gaW5waXRjaCAtIGJsa3dpZHRoOwotCi0gICAgaWYgKGR4JjEpCi0gICAgewotICAgICAgICBkeCA9ICgoZHggPj4gMSkgPyAtMyA6IC00KTsgLyogdXNlIGluIDMvNCBwZWwgKi8KLQotICAgICAgICBmb3IgKGogPSBibGtoZWlnaHQ7IGogPiAwIDsgai0tKQotICAgICAgICB7Ci0gICAgICAgICAgICB0bXAgPSAodWludDMyKShwX3JlZiArIGJsa3dpZHRoKTsKLSAgICAgICAgICAgIGZvciAoOyAodWludDMyKXBfcmVmIDwgdG1wOykKLSAgICAgICAgICAgIHsKLQotICAgICAgICAgICAgICAgIHIwID0gcF9yZWZbLTJdOwotICAgICAgICAgICAgICAgIHIxID0gcF9yZWZbLTFdOwotICAgICAgICAgICAgICAgIHIyID0gKnBfcmVmKys7Ci0gICAgICAgICAgICAgICAgcjMgPSAqcF9yZWYrKzsKLSAgICAgICAgICAgICAgICByNCA9ICpwX3JlZisrOwotICAgICAgICAgICAgICAgIC8qIGZpcnN0IHBpeGVsICovCi0gICAgICAgICAgICAgICAgcjUgPSAqcF9yZWYrKzsKLSAgICAgICAgICAgICAgICByZXN1bHQgPSAocjAgKyByNSk7Ci0gICAgICAgICAgICAgICAgcjAgPSAocjEgKyByNCk7Ci0gICAgICAgICAgICAgICAgcmVzdWx0IC09IChyMCAqIDUpOy8vcmVzdWx0IC09IHIwOyAgcmVzdWx0IC09IChyMDw8Mik7Ci0gICAgICAgICAgICAgICAgcjAgPSAocjIgKyByMyk7Ci0gICAgICAgICAgICAgICAgcmVzdWx0ICs9IChyMCAqIDIwKTsvL3Jlc3VsdCArPSAocjA8PDQpOyAgICByZXN1bHQgKz0gKHIwPDwyKTsKLSAgICAgICAgICAgICAgICByZXN1bHQgPSAocmVzdWx0ICsgNTEyKSA+PiAxMDsKLSAgICAgICAgICAgICAgICBDTElQX1JFU1VMVChyZXN1bHQpCi0gICAgICAgICAgICAgICAgcmVzdWx0MiA9ICgocF9yZWZbZHhdICsgMTYpID4+IDUpOwotICAgICAgICAgICAgICAgIENMSVBfUkVTVUxUKHJlc3VsdDIpCi0gICAgICAgICAgICAgICAgLyogMy80IHBlbCwgIG5vIG5lZWQgdG8gY2xpcCAqLwotICAgICAgICAgICAgICAgIHJlc3VsdCA9IChyZXN1bHQgKyByZXN1bHQyICsgMSk7Ci0gICAgICAgICAgICAgICAgcGtyZXMgPSAocmVzdWx0ID4+IDEpOwotICAgICAgICAgICAgICAgIC8qIHNlY29uZCBwaXhlbCAqLwotICAgICAgICAgICAgICAgIHIwID0gKnBfcmVmKys7Ci0gICAgICAgICAgICAgICAgcmVzdWx0ID0gKHIxICsgcjApOwotICAgICAgICAgICAgICAgIHIxID0gKHIyICsgcjUpOwotICAgICAgICAgICAgICAgIHJlc3VsdCAtPSAocjEgKiA1KTsvL3Jlc3VsdCAtPSByMTsgIHJlc3VsdCAtPSAocjE8PDIpOwotICAgICAgICAgICAgICAgIHIxID0gKHIzICsgcjQpOwotICAgICAgICAgICAgICAgIHJlc3VsdCArPSAocjEgKiAyMCk7Ly9yZXN1bHQgKz0gKHIxPDw0KTsgICAgcmVzdWx0ICs9IChyMTw8Mik7Ci0gICAgICAgICAgICAgICAgcmVzdWx0ID0gKHJlc3VsdCArIDUxMikgPj4gMTA7Ci0gICAgICAgICAgICAgICAgQ0xJUF9SRVNVTFQocmVzdWx0KQotICAgICAgICAgICAgICAgIHJlc3VsdDIgPSAoKHBfcmVmW2R4XSArIDE2KSA+PiA1KTsKLSAgICAgICAgICAgICAgICBDTElQX1JFU1VMVChyZXN1bHQyKQotICAgICAgICAgICAgICAgIC8qIDMvNCBwZWwsICBubyBuZWVkIHRvIGNsaXAgKi8KLSAgICAgICAgICAgICAgICByZXN1bHQgPSAocmVzdWx0ICsgcmVzdWx0MiArIDEpOwotICAgICAgICAgICAgICAgIHJlc3VsdCA9IChyZXN1bHQgPj4gMSk7Ci0gICAgICAgICAgICAgICAgcGtyZXMgIHw9IChyZXN1bHQgPDwgOCk7Ci0gICAgICAgICAgICAgICAgLyogdGhpcmQgcGl4ZWwgKi8KLSAgICAgICAgICAgICAgICByMSA9ICpwX3JlZisrOwotICAgICAgICAgICAgICAgIHJlc3VsdCA9IChyMiArIHIxKTsKLSAgICAgICAgICAgICAgICByMiA9IChyMyArIHIwKTsKLSAgICAgICAgICAgICAgICByZXN1bHQgLT0gKHIyICogNSk7Ly9yZXN1bHQgLT0gcjI7ICByZXN1bHQgLT0gKHIyPDwyKTsKLSAgICAgICAgICAgICAgICByMiA9IChyNCArIHI1KTsKLSAgICAgICAgICAgICAgICByZXN1bHQgKz0gKHIyICogMjApOy8vcmVzdWx0ICs9IChyMjw8NCk7ICAgIHJlc3VsdCArPSAocjI8PDIpOwotICAgICAgICAgICAgICAgIHJlc3VsdCA9IChyZXN1bHQgKyA1MTIpID4+IDEwOwotICAgICAgICAgICAgICAgIENMSVBfUkVTVUxUKHJlc3VsdCkKLSAgICAgICAgICAgICAgICByZXN1bHQyID0gKChwX3JlZltkeF0gKyAxNikgPj4gNSk7Ci0gICAgICAgICAgICAgICAgQ0xJUF9SRVNVTFQocmVzdWx0MikKLSAgICAgICAgICAgICAgICAvKiAzLzQgcGVsLCAgbm8gbmVlZCB0byBjbGlwICovCi0gICAgICAgICAgICAgICAgcmVzdWx0ID0gKHJlc3VsdCArIHJlc3VsdDIgKyAxKTsKLSAgICAgICAgICAgICAgICByZXN1bHQgPSAocmVzdWx0ID4+IDEpOwotICAgICAgICAgICAgICAgIHBrcmVzICB8PSAocmVzdWx0IDw8IDE2KTsKLSAgICAgICAgICAgICAgICAvKiBmb3VydGggcGl4ZWwgKi8KLSAgICAgICAgICAgICAgICByMiA9ICpwX3JlZisrOwotICAgICAgICAgICAgICAgIHJlc3VsdCA9IChyMyArIHIyKTsKLSAgICAgICAgICAgICAgICByMyA9IChyNCArIHIxKTsKLSAgICAgICAgICAgICAgICByZXN1bHQgLT0gKHIzICogNSk7Ly9yZXN1bHQgLT0gcjM7ICByZXN1bHQgLT0gKHIzPDwyKTsKLSAgICAgICAgICAgICAgICByMyA9IChyNSArIHIwKTsKLSAgICAgICAgICAgICAgICByZXN1bHQgKz0gKHIzICogMjApOy8vcmVzdWx0ICs9IChyMzw8NCk7ICAgIHJlc3VsdCArPSAocjM8PDIpOwotICAgICAgICAgICAgICAgIHJlc3VsdCA9IChyZXN1bHQgKyA1MTIpID4+IDEwOwotICAgICAgICAgICAgICAgIENMSVBfUkVTVUxUKHJlc3VsdCkKLSAgICAgICAgICAgICAgICByZXN1bHQyID0gKChwX3JlZltkeF0gKyAxNikgPj4gNSk7Ci0gICAgICAgICAgICAgICAgQ0xJUF9SRVNVTFQocmVzdWx0MikKLSAgICAgICAgICAgICAgICAvKiAzLzQgcGVsLCAgbm8gbmVlZCB0byBjbGlwICovCi0gICAgICAgICAgICAgICAgcmVzdWx0ID0gKHJlc3VsdCArIHJlc3VsdDIgKyAxKTsKLSAgICAgICAgICAgICAgICByZXN1bHQgPSAocmVzdWx0ID4+IDEpOwotICAgICAgICAgICAgICAgIHBrcmVzICB8PSAocmVzdWx0IDw8IDI0KTsKLSAgICAgICAgICAgICAgICAqcF9jdXIrKyA9IHBrcmVzOyAvKiB3cml0ZSA0IHBpeGVscyAqLwotICAgICAgICAgICAgICAgIHBfcmVmIC09IDM7ICAvKiBvZmZzZXQgYmFjayB0byB0aGUgbWlkZGxlIG9mIGZpbHRlciAqLwotICAgICAgICAgICAgfQotICAgICAgICAgICAgcF9jdXIgKz0gY3Vycl9vZmZzZXQ7ICAvKiBtb3ZlIHRvIHRoZSBuZXh0IGxpbmUgKi8KLSAgICAgICAgICAgIHBfcmVmICs9IHJlZl9vZmZzZXQ7ICAgIC8qIG1vdmUgdG8gdGhlIG5leHQgbGluZSAqLwotICAgICAgICB9Ci0gICAgfQotICAgIGVsc2UKLSAgICB7Ci0gICAgICAgIGZvciAoaiA9IGJsa2hlaWdodDsgaiA+IDAgOyBqLS0pCi0gICAgICAgIHsKLSAgICAgICAgICAgIHRtcCA9ICh1aW50MzIpKHBfcmVmICsgYmxrd2lkdGgpOwotICAgICAgICAgICAgZm9yICg7ICh1aW50MzIpcF9yZWYgPCB0bXA7KQotICAgICAgICAgICAgewotCi0gICAgICAgICAgICAgICAgcjAgPSBwX3JlZlstMl07Ci0gICAgICAgICAgICAgICAgcjEgPSBwX3JlZlstMV07Ci0gICAgICAgICAgICAgICAgcjIgPSAqcF9yZWYrKzsKLSAgICAgICAgICAgICAgICByMyA9ICpwX3JlZisrOwotICAgICAgICAgICAgICAgIHI0ID0gKnBfcmVmKys7Ci0gICAgICAgICAgICAgICAgLyogZmlyc3QgcGl4ZWwgKi8KLSAgICAgICAgICAgICAgICByNSA9ICpwX3JlZisrOwotICAgICAgICAgICAgICAgIHJlc3VsdCA9IChyMCArIHI1KTsKLSAgICAgICAgICAgICAgICByMCA9IChyMSArIHI0KTsKLSAgICAgICAgICAgICAgICByZXN1bHQgLT0gKHIwICogNSk7Ly9yZXN1bHQgLT0gcjA7ICByZXN1bHQgLT0gKHIwPDwyKTsKLSAgICAgICAgICAgICAgICByMCA9IChyMiArIHIzKTsKLSAgICAgICAgICAgICAgICByZXN1bHQgKz0gKHIwICogMjApOy8vcmVzdWx0ICs9IChyMDw8NCk7ICAgIHJlc3VsdCArPSAocjA8PDIpOwotICAgICAgICAgICAgICAgIHJlc3VsdCA9IChyZXN1bHQgKyA1MTIpID4+IDEwOwotICAgICAgICAgICAgICAgIENMSVBfUkVTVUxUKHJlc3VsdCkKLSAgICAgICAgICAgICAgICBwa3JlcyAgPSByZXN1bHQ7Ci0gICAgICAgICAgICAgICAgLyogc2Vjb25kIHBpeGVsICovCi0gICAgICAgICAgICAgICAgcjAgPSAqcF9yZWYrKzsKLSAgICAgICAgICAgICAgICByZXN1bHQgPSAocjEgKyByMCk7Ci0gICAgICAgICAgICAgICAgcjEgPSAocjIgKyByNSk7Ci0gICAgICAgICAgICAgICAgcmVzdWx0IC09IChyMSAqIDUpOy8vcmVzdWx0IC09IHIxOyAgcmVzdWx0IC09IChyMTw8Mik7Ci0gICAgICAgICAgICAgICAgcjEgPSAocjMgKyByNCk7Ci0gICAgICAgICAgICAgICAgcmVzdWx0ICs9IChyMSAqIDIwKTsvL3Jlc3VsdCArPSAocjE8PDQpOyAgICByZXN1bHQgKz0gKHIxPDwyKTsKLSAgICAgICAgICAgICAgICByZXN1bHQgPSAocmVzdWx0ICsgNTEyKSA+PiAxMDsKLSAgICAgICAgICAgICAgICBDTElQX1JFU1VMVChyZXN1bHQpCi0gICAgICAgICAgICAgICAgcGtyZXMgIHw9IChyZXN1bHQgPDwgOCk7Ci0gICAgICAgICAgICAgICAgLyogdGhpcmQgcGl4ZWwgKi8KLSAgICAgICAgICAgICAgICByMSA9ICpwX3JlZisrOwotICAgICAgICAgICAgICAgIHJlc3VsdCA9IChyMiArIHIxKTsKLSAgICAgICAgICAgICAgICByMiA9IChyMyArIHIwKTsKLSAgICAgICAgICAgICAgICByZXN1bHQgLT0gKHIyICogNSk7Ly9yZXN1bHQgLT0gcjI7ICByZXN1bHQgLT0gKHIyPDwyKTsKLSAgICAgICAgICAgICAgICByMiA9IChyNCArIHI1KTsKLSAgICAgICAgICAgICAgICByZXN1bHQgKz0gKHIyICogMjApOy8vcmVzdWx0ICs9IChyMjw8NCk7ICAgIHJlc3VsdCArPSAocjI8PDIpOwotICAgICAgICAgICAgICAgIHJlc3VsdCA9IChyZXN1bHQgKyA1MTIpID4+IDEwOwotICAgICAgICAgICAgICAgIENMSVBfUkVTVUxUKHJlc3VsdCkKLSAgICAgICAgICAgICAgICBwa3JlcyAgfD0gKHJlc3VsdCA8PCAxNik7Ci0gICAgICAgICAgICAgICAgLyogZm91cnRoIHBpeGVsICovCi0gICAgICAgICAgICAgICAgcjIgPSAqcF9yZWYrKzsKLSAgICAgICAgICAgICAgICByZXN1bHQgPSAocjMgKyByMik7Ci0gICAgICAgICAgICAgICAgcjMgPSAocjQgKyByMSk7Ci0gICAgICAgICAgICAgICAgcmVzdWx0IC09IChyMyAqIDUpOy8vcmVzdWx0IC09IHIzOyAgcmVzdWx0IC09IChyMzw8Mik7Ci0gICAgICAgICAgICAgICAgcjMgPSAocjUgKyByMCk7Ci0gICAgICAgICAgICAgICAgcmVzdWx0ICs9IChyMyAqIDIwKTsvL3Jlc3VsdCArPSAocjM8PDQpOyAgICByZXN1bHQgKz0gKHIzPDwyKTsKLSAgICAgICAgICAgICAgICByZXN1bHQgPSAocmVzdWx0ICsgNTEyKSA+PiAxMDsKLSAgICAgICAgICAgICAg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AgIGZvciAoOyAodWludDMyKXBfcmVmIDwgdG1wOykKLSAgICAgICAgewotCi0gICAgICAgICAgICByMCA9IHBfcmVmWy0yXTsKLSAgICAgICAgICAgIHIxID0gcF9yZWZbLTFdOwotICAgICAgICAgICAgcjIgPSAqcF9yZWYrKzsKLSAgICAgICAgICAgIHIzID0gKnBfcmVmKys7Ci0gICAgICAgICAgICByNCA9ICpwX3JlZisrOwotICAgICAgICAgICAgLyogZmlyc3QgcGl4ZWwgKi8KLSAgICAgICAgICAgIHI1ID0gKnBfcmVmKys7Ci0gICAgICAgICAgICByZXN1bHQgPSAocjAgKyByNSk7Ci0gICAgICAgICAgICByMCA9IChyMSArIHI0KTsKLSAgICAgICAgICAgIHJlc3VsdCAtPSAocjAgKiA1KTsvL3Jlc3VsdCAtPSByMDsgIHJlc3VsdCAtPSAocjA8PDIpOwotICAgICAgICAgICAgcjAgPSAocjIgKyByMyk7Ci0gICAgICAgICAgICByZXN1bHQgKz0gKHIwICogMjApOy8vcmVzdWx0ICs9IChyMDw8NCk7ICAgIHJlc3VsdCArPSAocjA8PDIpOwotICAgICAgICAgICAgKnBfY3VyKysgPSByZXN1bHQ7Ci0gICAgICAgICAgICAvKiBzZWNvbmQgcGl4ZWwgKi8KLSAgICAgICAgICAgIHIwID0gKnBfcmVmKys7Ci0gICAgICAgICAgICByZXN1bHQgPSAocjEgKyByMCk7Ci0gICAgICAgICAgICByMSA9IChyMiArIHI1KTsKLSAgICAgICAgICAgIHJlc3VsdCAtPSAocjEgKiA1KTsvL3Jlc3VsdCAtPSByMTsgIHJlc3VsdCAtPSAocjE8PDIpOwotICAgICAgICAgICAgcjEgPSAocjMgKyByNCk7Ci0gICAgICAgICAgICByZXN1bHQgKz0gKHIxICogMjApOy8vcmVzdWx0ICs9IChyMTw8NCk7ICAgIHJlc3VsdCArPSAocjE8PDIpOwotICAgICAgICAgICAgKnBfY3VyKysgPSByZXN1bHQ7Ci0gICAgICAgICAgICAvKiB0aGlyZCBwaXhlbCAqLwotICAgICAgICAgICAgcjEgPSAqcF9yZWYrKzsKLSAgICAgICAgICAgIHJlc3VsdCA9IChyMiArIHIxKTsKLSAgICAgICAgICAgIHIyID0gKHIzICsgcjApOwotICAgICAgICAgICAgcmVzdWx0IC09IChyMiAqIDUpOy8vcmVzdWx0IC09IHIyOyAgcmVzdWx0IC09IChyMjw8Mik7Ci0gICAgICAgICAgICByMiA9IChyNCArIHI1KTsKLSAgICAgICAgICAgIHJlc3VsdCArPSAocjIgKiAyMCk7Ly9yZXN1bHQgKz0gKHIyPDw0KTsgICAgcmVzdWx0ICs9IChyMjw8Mik7Ci0gICAgICAgICAgICAqcF9jdXIrKyA9IHJlc3VsdDsKLSAgICAgICAgICAgIC8qIGZvdXJ0aCBwaXhlbCAqLwotICAgICAgICAgICAgcjIgPSAqcF9yZWYrKzsKLSAgICAgICAgICAgIHJlc3VsdCA9IChyMyArIHIyKTsKLSAgICAgICAgICAgIHIzID0gKHI0ICsgcjEpOwotICAgICAgICAgICAgcmVzdWx0IC09IChyMyAqIDUpOy8vcmVzdWx0IC09IHIzOyAgcmVzdWx0IC09IChyMzw8Mik7Ci0gICAgICAgICAgICByMyA9IChyNSArIHIwKTsKLSAgICAgICAgICAgIHJlc3VsdCArPSAocjMgKiAyMCk7Ly9yZXN1bHQgKz0gKHIzPDw0KTsgICAgcmVzdWx0ICs9IChyMzw8Mik7Ci0gICAgICAgICAgICAqcF9jdXIrKyA9IHJlc3VsdDsKLSAgICAgICAgICAgIHBfcmVmIC09IDM7IC8qIG1vdmUgYmFjayB0byB0aGUgbWlkZGxlIG9mIHRoZSBmaWx0ZXIgKi8KLSAgICAgICAgfQotICAgICAgICBwX2N1ciArPSBjdXJyX29mZnNldDsgLyogbW92ZSB0byB0aGUgbmV4dCBsaW5lICovCi0gICAgICAgIHBfcmVmICs9IHJlZl9vZmZzZXQ7Ci0gICAgfQotCi0gICAgcmV0dXJuIDsKLX0KLXZvaWQgZVZlcnRJbnRlcnAxTUModWludDggKmluLCBpbnQgaW5waXRjaCwgdWludDggKm91dCwgaW50IG91dHBpdGNoLAotICAgICAgICAgICAgICAgICAgICBpbnQgYmxrd2lkdGgsIGludCBibGtoZWlnaHQsIGludCBkeSkKLXsKLSAgICB1aW50OCAqcF9jdXIsICpwX3JlZjsKLSAgICB1aW50MzIgdG1wOwotICAgIGludCByZXN1bHQsIGN1cnJfb2Zmc2V0LCByZWZfb2Zmc2V0OwotICAgIGludCBqLCBpOwotICAgIGludDMyIHIwLCByMSwgcjIsIHIzLCByNCwgcjUsIHI2LCByNywgcjgsIHIxMzsKLSAgICB1aW50OCAgdG1wX2luWzI0XVsyNF07Ci0KLSAgICAvKiBub3Qgd29yZC1hbGlnbmVkICovCi0gICAgaWYgKCgodWludDMyKWluKSYweDMpCi0gICAgewotICAgICAgICBlQ3JlYXRlQWxpZ24oaW4sIGlucGl0Y2gsIC0yLCAmdG1wX2luWzBdWzBdLCBibGt3aWR0aCwgYmxraGVpZ2h0ICsgNSk7Ci0gICAgICAgIGluID0gJnRtcF9pblsyXVswXTsKLSAgICAgICAgaW5waXRjaCA9IDI0OwotICAgIH0KLSAgICBwX2N1ciA9IG91dDsKLSAgICBjdXJyX29mZnNldCA9IDEgLSBvdXRwaXRjaCAqIChibGtoZWlnaHQgLSAxKTsgLyogb2Zmc2V0IHZlcnRpY2FsbHkgYmFjayB1cCBhbmQgb25lIHBpeGVsIHRvIHJpZ2h0ICovCi0gICAgcmVmX29mZnNldCA9IGJsa2hlaWdodCAqIGlucGl0Y2g7IC8qIGZvciBsaW1pdCAqLwotCi0gICAgY3Vycl9vZmZzZXQgKz0gMzsKLQotICAgIGlmIChkeSYxKQotICAgIHsKLSAgICAgICAgZHkgPSAoZHkgPj4gMSkgPyAwIDogLWlucGl0Y2g7Ci0KLSAgICAgICAgZm9yIChqID0gMDsgaiA8IGJsa3dpZHRoOyBqICs9IDQsIGluICs9IDQpCi0gICAgICAgIHsKLSAgICAgICAgICAgIHIxMyA9IDA7Ci0gICAgICAgICAgICBwX3JlZiA9IGluOwotICAgICAgICAgICAgcF9jdXIgLT0gb3V0cGl0Y2g7ICAvKiBjb21wZW5zYXRlIGZvciB0aGUgZmlyc3Qgb2Zmc2V0ICovCi0gICAgICAgICAgICB0bXAgPSAodWludDMyKShwX3JlZiArIHJlZl9vZmZzZXQpOyAvKiBsaW1pdCAqLwotICAgICAgICAgICAgd2hpbGUgKCh1aW50MzIpcF9yZWYgPCB0bXApICAvKiB0aGUgbG9vcCB1bi1yb2xsZWQgICovCi0gICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgcjAgPSAqKCh1aW50MzIqKShwX3JlZiAtIChpbnBpdGNoIDw8IDEpKSk7IC8qIGxvYWQgNCBieXRlcyAqLwotICAgICAgICAgICAgICAgIHBfcmVmICs9IGlucGl0Y2g7Ci0gICAgICAgICAgICAgICAgcjYgPSAocjAgPj4gOCkgJiAweEZGMDBGRjsgLyogc2Vjb25kIGFuZCBmb3VydGggYnl0ZSAqLwotICAgICAgICAgICAgICAgIHIwICY9IDB4RkYwMEZGOwotCi0gICAgICAgICAgICAgICAgcjEgPSAqKCh1aW50MzIqKShwX3JlZiArIChpbnBpdGNoIDw8IDEpKSk7ICAvKiByMSwgcjcsIHJlZlszXSAqLwotICAgICAgICAgICAgICAgIHI3ID0gKHIxID4+IDgpICYgMHhGRjAwRkY7Ci0gICAgICAgICAgICAgICAgcjEgJj0gMHhGRjAwRkY7Ci0KLSAgICAgICAgICAgICAgICByMCArPSByMTsKLSAgICAgICAgICAgICAgICByNiArPSByNzsKLQotICAgICAgICAgICAgICAgIHIyID0gKigodWludDMyKilwX3JlZik7IC8qIHIyLCByOCwgcmVmWzFdICovCi0gICAgICAgICAgICAgICAgcjggPSAocjIgPj4gOCkgJiAweEZGMDBGRjsKLSAgICAgICAgICAgICAgICByMiAmPSAweEZGMDBGRjsKLQotICAgICAgICAgICAgICAgIHIxID0gKigodWludDMyKikocF9yZWYgLSBpbnBpdGNoKSk7IC8qIHIxLCByNywgcmVmWzBdICovCi0gICAgICAgICAgICAgICAgcjcgPSAocjEgPj4gOCkgJiAweEZGMDBGRjsKLSAgICAgICAgICAgICAgICByMSAmPSAweEZGMDBGRjsKLSAgICAgICAgICAgICAgICByMSArPSByMjsKLQotICAgICAgICAgICAgICAgIHI3ICs9IHI4OwotCi0gICAgICAgICAgICAgICAgcjAgKz0gMjAgKiByMTsKLSAgICAgICAgICAgICAgICByNiArPSAyMCAqIHI3OwotICAgICAgICAgICAgICAgIHIwICs9IDB4MTAwMDEwOwotICAgICAgICAgICAgICAgIHI2ICs9IDB4MTAwMDEwOwotCi0gICAgICAgICAgICAgICAgcjIgPSAqKCh1aW50MzIqKShwX3JlZiAtIChpbnBpdGNoIDw8IDEpKSk7IC8qIHIyLCByOCwgcmVmWy0xXSAqLwotICAgICAgICAgICAgICAgIHI4ID0gKHIyID4+IDgpICYgMHhGRjAwRkY7Ci0gICAgICAgICAgICAgICAgcjIgJj0gMHhGRjAwRkY7Ci0KLSAgICAgICAgICAgICAgICByMSA9ICooKHVpbnQzMiopKHBfcmVmICsgaW5waXRjaCkpOyAvKiByMSwgcjcsIHJlZlsyXSAqLwotICAgICAgICAgICAgICAgIHI3ID0gKHIxID4+IDgpICYgMHhGRjAwRkY7Ci0gICAgICAgICAgICAgICAgcjEgJj0gMHhGRjAwRkY7Ci0gICAgICAgICAgICAgICAgcjEgKz0gcjI7Ci0KLSAgICAgICAgICAgICAgICByNyArPSByODsKLQotICAgICAgICAgICAgICAgIHIwIC09IDUgKiByMTsKLSAgICAgICAgICAgICAgICByNiAtPSA1ICogcjc7Ci0KLSAgICAgICAgICAgICAgICByMCA+Pj0gNTsKLSAgICAgICAgICAgICAgICByNiA+Pj0gNTsKLSAgICAgICAgICAgICAgICAvKiBjbGlwICovCi0gICAgICAgICAgICAgICAgcjEzIHw9IHI2OwotICAgICAgICAgICAgICAgIHIxMyB8PSByMDsKLSAgICAgICAgICAgICAgICAvL0NMSVBQQUNLKHI2LHJlc3VsdCkKLQotICAgICAgICAgICAgICAgIHIxID0gKigodWludDMyKikocF9yZWYgKyBkeSkpOwotICAgICAgICAgICAgICAgIHIyID0gKHIxID4+IDgpICYgMHhGRjAwRkY7Ci0gICAgICAgICAgICAgICAgcjEgJj0gMHhGRjAwRkY7Ci0gICAgICAgICAgICAgICAgcjAgKz0gcjE7Ci0gICAgICAgICAgICAgICAgcjYgKz0gcjI7Ci0gICAgICAgICAgICAgICAgcjAgKz0gMHgxMDAwMTsKLSAgICAgICAgICAgICAgICByNiArPSAweDEwMDAxOwotICAgICAgICAgICAgICAgIHIwID0gKHIwID4+IDEpICYgMHhGRjAwRkY7Ci0gICAgICAgICAgICAgICAgcjYgPSAocjYgPj4gMSkgJiAweEZGMDBGRjsKLQotICAgICAgICAgICAgICAgIHIwIHw9IChyNiA8PCA4KTsgIC8qIHBhY2sgaXQgYmFjayAqLwotICAgICAgICAgICAgICAgICooKHVpbnQzMiopKHBfY3VyICs9IG91dHBpdGNoKSkgPSByMDsKLSAgICAgICAgICAgIH0KLSAgICAgICAgICAgIHBfY3VyICs9IGN1cnJfb2Zmc2V0OyAvKiBvZmZzZXQgdG8gdGhlIG5leHQgcGl4ZWwgKi8KLSAgICAgICAgICAgIGlmIChyMTMgJiAweEZGMDAwNzAwKSAvKiB0aGlzIGNvbHVtbiBuZWVkIGNsaXBwaW5nICovCi0gICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgcF9jdXIgLT0gNDsKLSAgICAgICAgICAgICAgICBmb3IgKGkgPSAwOyBpIDwgNDsgaSsrKQotICAgICAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAgICAgcF9yZWYgPSBpbiArIGk7Ci0gICAgICAgICAgICAgICAgICAgIHBfY3VyIC09IG91dHBpdGNoOyAgLyogY29tcGVuc2F0ZSBmb3IgdGhlIGZpcnN0IG9mZnNldCAqLwotCi0gICAgICAgICAgICAgICAgICAgIHRtcCA9ICh1aW50MzIpKHBfcmVmICsgcmVmX29mZnNldCk7IC8qIGxpbWl0ICovCi0gICAgICAgICAgICAgICAgICAgIHdoaWxlICgodWludDMyKXBfcmVmIDwgdG1wKQotICAgICAgICAgICAgICAgICAgICB7ICAgICAgICAgICAgICAgICAgICAgICAgICAgLyogbG9vcCB1bi1yb2xsZWQgKi8KLSAgICAgICAgICAgICAgICAgICAgICAgIHIwID0gKihwX3JlZiAtIChpbnBpdGNoIDw8IDEpKTsKLSAgICAgICAgICAgICAgICAgICAgICAgIHIxID0gKihwX3JlZiAtIGlucGl0Y2gpOwotICAgICAgICAgICAgICAgICAgICAgICAgcjIgPSAqcF9yZWY7Ci0gICAgICAgICAgICAgICAgICAgICAgICByMyA9ICoocF9yZWYgKz0gaW5waXRjaCk7ICAvKiBtb2RpZnkgcG9pbnRlciBiZWZvcmUgbG9hZGluZyAqLwotICAgICAgICAgICAgICAgICAgICAgICAgcjQgPSAqKHBfcmVmICs9IGlucGl0Y2gpOwotICAgICAgICAgICAgICAgICAgICAgICAgLyogZmlyc3QgcGl4ZWwgKi8KLSAgICAgICAgICAgICAgICAgICAgICAgIHI1ID0gKihwX3JlZiArPSBpbnBpdGNoKTsKLSAgICAgICAgICAgICAgICAgICAgICAgIHJlc3VsdCA9IChyMCArIHI1KTsKLSAgICAgICAgICAgICAgICAgICAgICAgIHIwID0gKHIxICsgcjQpOwotICAgICAgICAgICAgICAgICAgICAgICAgcmVzdWx0IC09IChyMCAqIDUpOy8vcmVzdWx0IC09IHIwOyAgcmVzdWx0IC09IChyMDw8Mik7Ci0gICAgICAgICAgICAgICAgICAgICAgICByMCA9IChyMiArIHIzKTsKLSAgICAgICAgICAgICAgICAgICAgICAgIHJlc3VsdCArPSAocjAgKiAyMCk7Ly9yZXN1bHQgKz0gKHIwPDw0KTsgICAgcmVzdWx0ICs9IChyMDw8Mik7Ci0gICAgICAgICAgICAgICAgICAgICAgICByZXN1bHQgPSAocmVzdWx0ICsgMTYpID4+IDU7Ci0gICAgICAgICAgICAgICAgICAgICAgICBDTElQX1JFU1VMVChyZXN1bHQpCi0gICAgICAgICAgICAgICAgICAgICAgICAvKiAzLzQgcGVsLCAgbm8gbmVlZCB0byBjbGlwICovCi0gICAgICAgICAgICAgICAgICAgICAgICByZXN1bHQgPSAocmVzdWx0ICsgcF9yZWZbZHktKGlucGl0Y2g8PDEpXSArIDEpOwotICAgICAgICAgICAgICAgICAgICAgICAgcmVzdWx0ID0gKHJlc3VsdCA+PiAxKTsKLSAgICAgICAgICAgICAgICAgICAgICAgICoocF9jdXIgKz0gb3V0cGl0Y2gpID0gcmVzdWx0OwotICAgICAgICAgICAgICAgICAgICAgICAgLyogc2Vjb25kIHBpeGVsICovCi0gICAgICAgICAgICAgICAgICAgICAgICByMCA9ICoocF9yZWYgKz0gaW5waXRjaCk7Ci0gICAgICAgICAgICAgICAgICAgICAgICByZXN1bHQgPSAocjEgKyByMCk7Ci0gICAgICAgICAgICAgICAgICAgICAgICByMSA9IChyMiArIHI1KTsKLSAgICAgICAgICAgICAgICAgICAgICAgIHJlc3VsdCAtPSAocjEgKiA1KTsvL3Jlc3VsdCAtPSByMTsgIHJlc3VsdCAtPSAocjE8PDIpOwotICAgICAgICAgICAgICAgICAgICAgICAgcjEgPSAocjMgKyByNCk7Ci0gICAgICAgICAgICAgICAgICAgICAgICByZXN1bHQgKz0gKHIxICogMjApOy8vcmVzdWx0ICs9IChyMTw8NCk7ICAgIHJlc3VsdCArPSAocjE8PDIpOwotICAgICAgICAgICAgICAgICAgICAgICAgcmVzdWx0ID0gKHJlc3VsdCArIDE2KSA+PiA1OwotICAgICAgICAgICAgICAgICAgICAgICAgQ0xJUF9SRVNVTFQocmVzdWx0KQotICAgICAgICAgICAgICAgICAgICAgICAgLyogMy80IHBlbCwgIG5vIG5lZWQgdG8gY2xpcCAqLwotICAgICAgICAgICAgICAgICAgICAgICAgcmVzdWx0ID0gKHJlc3VsdCArIHBfcmVmW2R5LShpbnBpdGNoPDwxKV0gKyAxKTsKLSAgICAgICAgICAgICAgICAgICAgICAgIHJlc3VsdCA9IChyZXN1bHQgPj4gMSk7Ci0gICAgICAgICAgICAgICAgICAgICAgICAqKHBfY3VyICs9IG91dHBpdGNoKSA9IHJlc3VsdDsKLSAgICAgICAgICAgICAgICAgICAgICAgIC8qIHRoaXJkIHBpeGVsICovCi0gICAgICAgICAgICAgICAgICAgICAgICByMSA9ICoocF9yZWYgKz0gaW5waXRjaCk7Ci0gICAgICAgICAgICAgICAgICAgICAgICByZXN1bHQgPSAocjIgKyByMSk7Ci0gICAgICAgICAgICAgICAgICAgICAgICByMiA9IChyMyArIHIwKTsKLSAgICAgICAgICAgICAgICAgICAgICAgIHJlc3VsdCAtPSAocjIgKiA1KTsvL3Jlc3VsdCAtPSByMjsgIHJlc3VsdCAtPSAocjI8PDIpOwotICAgICAgICAgICAgICAgICAgICAgICAgcjIgPSAocjQgKyByNSk7Ci0gICAgICAgICAgICAgICAgICAgICAgICByZXN1bHQgKz0gKHIyICogMjApOy8vcmVzdWx0ICs9IChyMjw8NCk7ICAgIHJlc3VsdCArPSAocjI8PDIpOwotICAgICAgICAgICAgICAgICAgICAgICAgcmVzdWx0ID0gKHJlc3VsdCArIDE2KSA+PiA1OwotICAgICAgICAgICAgICAgICAgICAgICAgQ0xJUF9SRVNVTFQocmVzdWx0KQotICAgICAgICAgICAgICAgICAgICAgICAgLyogMy80IHBlbCwgIG5vIG5lZWQgdG8gY2xpcCAqLwotICAgICAgICAgICAgICAgICAgICAgICAgcmVzdWx0ID0gKHJlc3VsdCArIHBfcmVmW2R5LShpbnBpdGNoPDwxKV0gKyAxKTsKLSAgICAgICAgICAgICAgICAgICAgICAgIHJlc3VsdCA9IChyZXN1bHQgPj4gMSk7Ci0gICAgICAgICAgICAgICAgICAgICAgICAqKHBfY3VyICs9IG91dHBpdGNoKSA9IHJlc3VsdDsKLSAgICAgICAgICAgICAgICAgICAgICAgIC8qIGZvdXJ0aCBwaXhlbCAqLwotICAgICAgICAgICAgICAgICAgICAgICAgcjIgPSAqKHBfcmVmICs9IGlucGl0Y2gpOwotICAgICAgICAgICAgICAgICAgICAgICAgcmVzdWx0ID0gKHIzICsgcjIpOwotICAgICAgICAgICAgICAgICAgICAgICAgcjMgPSAocjQgKyByMSk7Ci0gICAgICAgICAgICAgICAgICAgICAgICByZXN1bHQgLT0gKHIzICogNSk7Ly9yZXN1bHQgLT0gcjM7ICByZXN1bHQgLT0gKHIzPDwyKTsKLSAgICAgICAgICAgICAgICAgICAgICAgIHIzID0gKHI1ICsgcjApOwotICAgICAgICAgICAgICAgICAgICAgICAgcmVzdWx0ICs9IChyMyAqIDIwKTsvL3Jlc3VsdCArPSAocjM8PDQpOyAgICByZXN1bHQgKz0gKHIzPDwyKTsKLSAgICAgICAgICAgICAgICAgICAgICAgIHJlc3VsdCA9IChyZXN1bHQgKyAxNikgPj4gNTsKLSAgICAgICAgICAgICAgICAgICAgICAgIENMSVBfUkVTVUxUKHJlc3VsdCkKLSAgICAgICAgICAgICAgICAgICAgICAgIC8qIDMvNCBwZWwsICBubyBuZWVkIHRvIGNsaXAgKi8KLSAgICAgICAgICAgICAgICAgICAgICAgIHJlc3VsdCA9IChyZXN1bHQgKyBwX3JlZltkeS0oaW5waXRjaDw8MSldICsgMSk7Ci0gICAgICAgICAgICAgICAgICAgICAgICByZXN1bHQgPSAocmVzdWx0ID4+IDEpOwotICAgICAgICAgICAgICAgICAgICAgICAgKihwX2N1ciArPSBvdXRwaXRjaCkgPSByZXN1bHQ7Ci0gICAgICAgICAgICAgICAgICAgICAgICBwX3JlZiAtPSAoaW5waXRjaCA8PCAxKTsgIC8qIG1vdmUgYmFjayB0byBjZW50ZXIgb2YgdGhlIGZpbHRlciBvZiB0aGUgbmV4dCBvbmUgKi8KLSAgICAgICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgICAgICBwX2N1ciArPSAoY3Vycl9vZmZzZXQgLSAzKTsKLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICB9Ci0gICAgICAgIH0KLSAgICB9Ci0gICAgZWxzZQotICAgIHsKLSAgICAgICAgZm9yIChqID0gMDsgaiA8IGJsa3dpZHRoOyBqICs9IDQsIGluICs9IDQpCi0gICAgICAgIHsKLSAgICAgICAgICAgIHIxMyA9IDA7Ci0gICAgICAgICAgICBwX3JlZiA9IGluOwotICAgICAgICAgICAgcF9jdXIgLT0gb3V0cGl0Y2g7ICAvKiBjb21wZW5zYXRlIGZvciB0aGUgZmlyc3Qgb2Zmc2V0ICovCi0gICAgICAgICAgICB0bXAgPSAodWludDMyKShwX3JlZiArIHJlZl9vZmZzZXQpOyAvKiBsaW1pdCAqLwotICAgICAgICAgICAgd2hpbGUgKCh1aW50MzIpcF9yZWYgPCB0bXApICAvKiB0aGUgbG9vcCB1bi1yb2xsZWQgICovCi0gICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgcjAgPSAqKCh1aW50MzIqKShwX3JlZiAtIChpbnBpdGNoIDw8IDEpKSk7IC8qIGxvYWQgNCBieXRlcyAqLwotICAgICAgICAgICAgICAgIHBfcmVmICs9IGlucGl0Y2g7Ci0gICAgICAgICAgICAgICAgcjYgPSAocjAgPj4gOCkgJiAweEZGMDBGRjsgLyogc2Vjb25kIGFuZCBmb3VydGggYnl0ZSAqLwotICAgICAgICAgICAgICAgIHIwICY9IDB4RkYwMEZGOwotCi0gICAgICAgICAgICAgICAgcjEgPSAqKCh1aW50MzIqKShwX3JlZiArIChpbnBpdGNoIDw8IDEpKSk7ICAvKiByMSwgcjcsIHJlZlszXSAqLwotICAgICAgICAgICAgICAgIHI3ID0gKHIxID4+IDgpICYgMHhGRjAwRkY7Ci0gICAgICAgICAgICAgICAgcjEgJj0gMHhGRjAwRkY7Ci0KLSAgICAgICAgICAgICAgICByMCArPSByMTsKLSAgICAgICAgICAgICAgICByNiArPSByNzsKLQotICAgICAgICAgICAgICAgIHIyID0gKigodWludDMyKilwX3JlZik7IC8qIHIyLCByOCwgcmVmWzFdICovCi0gICAgICAgICAgICAgICAgcjggPSAocjIgPj4gOCkgJiAweEZGMDBGRjsKLSAgICAgICAgICAgICAgICByMiAmPSAweEZGMDBGRjsKLQotICAgICAgICAgICAgICAgIHIxID0gKigodWludDMyKikocF9yZWYgLSBpbnBpdGNoKSk7IC8qIHIxLCByNywgcmVmWzBdICovCi0gICAgICAgICAgICAgICAgcjcgPSAocjEgPj4gOCkgJiAweEZGMDBGRjsKLSAgICAgICAgICAgICAgICByMSAmPSAweEZGMDBGRjsKLSAgICAgICAgICAgICAgICByMSArPSByMjsKLQotICAgICAgICAgICAgICAgIHI3ICs9IHI4OwotCi0gICAgICAgICAgICAgICAgcjAgKz0gMjAgKiByMTsKLSAgICAgICAgICAgICAgICByNiArPSAyMCAqIHI3OwotICAgICAgICAgICAgICAgIHIwICs9IDB4MTAwMDEwOwotICAgICAgICAgICAgICAgIHI2ICs9IDB4MTAwMDEwOwotCi0gICAgICAgICAgICAgICAgcjIgPSAqKCh1aW50MzIqKShwX3JlZiAtIChpbnBpdGNoIDw8IDEpKSk7IC8qIHIyLCByOCwgcmVmWy0xXSAqLwotICAgICAgICAgICAgICAgIHI4ID0gKHIyID4+IDgpICYgMHhGRjAwRkY7Ci0gICAgICAgICAgICAgICAgcjIgJj0gMHhGRjAwRkY7Ci0KLSAgICAgICAgICAgICAgICByMSA9ICooKHVpbnQzMiopKHBfcmVmICsgaW5waXRjaCkpOyAvKiByMSwgcjcsIHJlZlsyXSAqLwotICAgICAgICAgICAgICAgIHI3ID0gKHIxID4+IDgpICYgMHhGRjAwRkY7Ci0gICAgICAgICAgICAgICAgcjEgJj0gMHhGRjAwRkY7Ci0gICAgICAgICAgICAgICAgcjEgKz0gcjI7Ci0KLSAgICAgICAgICAgICAgICByNyArPSByODsKLQotICAgICAgICAgICAgICAgIHIwIC09IDUgKiByMTsKLSAgICAgICAgICAgICAgICByNiAtPSA1ICogcjc7Ci0KLSAgICAgICAgICAgICAgICByMCA+Pj0gNTsKLSAgICAgICAgICAgICAgICByNiA+Pj0gNTsKLSAgICAgICAgICAgICAgICAvKiBjbGlwICovCi0gICAgICAgICAgICAgICAgcjEzIHw9IHI2OwotICAgICAgICAgICAgICAgIHIxMyB8PSByMDsKLSAgICAgICAgICAgICAgICAvL0NMSVBQQUNLKHI2LHJlc3VsdCkKLSAgICAgICAgICAgICAgICByMCAmPSAweEZGMDBGRjsKLSAgICAgICAgICAgICAgICByNiAmPSAweEZGMDBGRjsKLSAgICAgICAgICAgICAgICByMCB8PSAocjYgPDwgOCk7ICAvKiBwYWNrIGl0IGJhY2sgKi8KLSAgICAgICAgICAgICAgICAqKCh1aW50MzIqKShwX2N1ciArPSBvdXRwaXRjaCkpID0gcjA7Ci0gICAgICAgICAgICB9Ci0gICAgICAgICAgICBwX2N1ciArPSBjdXJyX29mZnNldDsgLyogb2Zmc2V0IHRvIHRoZSBuZXh0IHBpeGVsICovCi0gICAgICAgICAgICBpZiAocjEzICYgMHhGRjAwMDcwMCkgLyogdGhpcyBjb2x1bW4gbmVlZCBjbGlwcGluZyAqLwotICAgICAgICAgICAgewotICAgICAgICAgICAgICAgIHBfY3VyIC09IDQ7Ci0gICAgICAgICAgICAgICAgZm9yIChpID0gMDsgaSA8IDQ7IGkrKykKLSAgICAgICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgICAgIHBfcmVmID0gaW4gKyBpOwotICAgICAgICAgICAgICAgICAgICBwX2N1ciAtPSBvdXRwaXRjaDsgIC8qIGNvbXBlbnNhdGUgZm9yIHRoZSBmaXJzdCBvZmZzZXQgKi8KLSAgICAgICAgICAgICAgICAgICAgdG1wID0gKHVpbnQzMikocF9yZWYgKyByZWZfb2Zmc2V0KTsgLyogbGltaXQgKi8KLSAgICAgICAgICAgICAgICAgICAgd2hpbGUgKCh1aW50MzIpcF9yZWYgPCB0bXApCi0gICAgICAgICAgICAgICAgICAgIHsgICAgICAgICAgICAgICAgICAgICAgICAgICAvKiBsb29wIHVuLXJvbGxlZCAqLwotICAgICAgICAgICAgICAgICAgICAgICAgcjAgPSAqKHBfcmVmIC0gKGlucGl0Y2ggPDwgMSkpOwotICAgICAgICAgICAgICAgICAgICAgICAgcjEgPSAqKHBfcmVmIC0gaW5waXRjaCk7Ci0gICAgICAgICAgICAgICAgICAgICAgICByMiA9ICpwX3JlZjsKLSAgICAgICAgICAgICAgICAgICAgICAgIHIzID0gKihwX3JlZiArPSBpbnBpdGNoKTsgIC8qIG1vZGlmeSBwb2ludGVyIGJlZm9yZSBsb2FkaW5nICovCi0gICAgICAgICAgICAgICAgICAgICAgICByNCA9ICoocF9yZWYgKz0gaW5waXRjaCk7Ci0gICAgICAgICAgICAgICAgICAgICAgICAvKiBmaXJzdCBwaXhlbCAqLwotICAgICAgICAgICAgICAgICAgICAgICAgcjUgPSAqKHBfcmVmICs9IGlucGl0Y2gpOwotICAgICAgICAgICAgICAgICAgICAgICAgcmVzdWx0ID0gKHIwICsgcjUpOwotICAgICAgICAgICAgICAgICAgICAgICAgcjAgPSAocjEgKyByNCk7Ci0gICAgICAgICAgICAgICAgICAgICAgICByZXN1bHQgLT0gKHIwICogNSk7Ly9yZXN1bHQgLT0gcjA7ICByZXN1bHQgLT0gKHIwPDwyKTsKLSAgICAgICAgICAgICAgICAgICAgICAgIHIwID0gKHIyICsgcjMpOwotICAgICAgICAgICAgICAgICAgICAgICAgcmVzdWx0ICs9IChyMCAqIDIwKTsvL3Jlc3VsdCArPSAocjA8PDQpOyAgICByZXN1bHQgKz0gKHIwPDwyKTsKLSAgICAgICAgICAgICAgICAgICAgICAgIHJlc3VsdCA9IChyZXN1bHQgKyAxNikgPj4gNTsKLSAgICAgICAgICAgICAgICAgICAgICAgIENMSVBfUkVTVUxUKHJlc3VsdCkKLSAgICAgICAgICAgICAgICAgICAgICAgICoocF9jdXIgKz0gb3V0cGl0Y2gpID0gcmVzdWx0OwotICAgICAgICAgICAgICAgICAgICAgICAgLyogc2Vjb25kIHBpeGVsICovCi0gICAgICAgICAgICAgICAgICAgICAgICByMCA9ICoocF9yZWYgKz0gaW5waXRjaCk7Ci0gICAgICAgICAgICAgICAgICAgICAgICByZXN1bHQgPSAocjEgKyByMCk7Ci0gICAgICAgICAgICAgICAgICAgICAgICByMSA9IChyMiArIHI1KTsKLSAgICAgICAgICAgICAgICAgICAgICAgIHJlc3VsdCAtPSAocjEgKiA1KTsvL3Jlc3VsdCAtPSByMTsgIHJlc3VsdCAtPSAocjE8PDIpOwotICAgICAgICAgICAgICAgICAgICAgICAgcjEgPSAocjMgKyByNCk7Ci0gICAgICAgICAgICAgICAgICAgICAgICByZXN1bHQgKz0gKHIxICogMjApOy8vcmVzdWx0ICs9IChyMTw8NCk7ICAgIHJlc3VsdCArPSAocjE8PDIpOwotICAgICAgICAgICAgICAgICAgICAgICAgcmVzdWx0ID0gKHJlc3VsdCArIDE2KSA+PiA1OwotICAgICAgICAgICAgICAgICAgICAgICAgQ0xJUF9SRVNVTFQocmVzdWx0KQotICAgICAgICAgICAgICAgICAgICAgICAgKihwX2N1ciArPSBvdXRwaXRjaCkgPSByZXN1bHQ7Ci0gICAgICAgICAgICAgICAgICAgICAgICAvKiB0aGlyZCBwaXhlbCAqLwotICAgICAgICAgICAgICAgICAgICAgICAgcjEgPSAqKHBfcmVmICs9IGlucGl0Y2gpOwotICAgICAgICAgICAgICAgICAgICAgICAgcmVzdWx0ID0gKHIyICsgcjEpOwotICAgICAgICAgICAgICAgICAgICAgICAgcjIgPSAocjMgKyByMCk7Ci0gICAgICAgICAgICAgICAgICAgICAgICByZXN1bHQgLT0gKHIyICogNSk7Ly9yZXN1bHQgLT0gcjI7ICByZXN1bHQgLT0gKHIyPDwyKTsKLSAgICAgICAgICAgICAgICAgICAgICAgIHIyID0gKHI0ICsgcjUpOwotICAgICAgICAgICAgICAgICAgICAgICAgcmVzdWx0ICs9IChyMiAqIDIwKTsvL3Jlc3VsdCArPSAocjI8PDQpOyAgICByZXN1bHQgKz0gKHIyPDwyKTsKLSAgICAgICAgICAgICAgICAgICAgICAgIHJlc3VsdCA9IChyZXN1bHQgKyAxNikgPj4gNTsKLSAgICAgICAgICAgICAgICAgICAgICAgIENMSVBfUkVTVUxUKHJlc3VsdCkKLSAgICAgICAgICAgICAgICAgICAgICAgICoocF9jdXIgKz0gb3V0cGl0Y2gpID0gcmVzdWx0OwotICAgICAgICAgICAgICAgICAgICAgICAgLyogZm91cnRoIHBpeGVsICovCi0gICAgICAgICAgICAgICAgICAgICAgICByMiA9ICoocF9yZWYgKz0gaW5waXRjaCk7Ci0gICAgICAgICAgICAgICAgICAgICAgICByZXN1bHQgPSAocjMgKyByMik7Ci0gICAgICAgICAgICAgICAgICAgICAgICByMyA9IChyNCArIHIxKTsKLSAgICAgICAgICAgICAgICAgICAgICAgIHJlc3VsdCAtPSAocjMgKiA1KTsvL3Jlc3VsdCAtPSByMzsgIHJlc3VsdCAtPSAocjM8PDIpOwotICAgICAgICAgICAgICAgICAgICAgICAgcjMgPSAocjUgKyByMCk7Ci0gICAgICAgICAgICAgICAgICAgICAgICByZXN1bHQgKz0gKHIzICogMjApOy8vcmVzdWx0ICs9IChyMzw8NCk7ICAgIHJlc3VsdCArPSAocjM8PDIpOwotICAgICAgICAgICAgICAgICAgICAgICAgcmVzdWx0ID0gKHJlc3VsdCArIDE2KSA+PiA1OwotICAgICAgICAgICAgICAgICAgICAgICAgQ0xJUF9SRVNVTFQocmVzdWx0KQotICAgICAgICAgICAgICAgICAgICAgICAgKihwX2N1ciArPSBvdXRwaXRjaCkgPSByZXN1bHQ7Ci0gICAgICAgICAgICAgICAgICAgICAgICBwX3JlZiAtPSAoaW5waXRjaCA8PCAxKTsgIC8qIG1vdmUgYmFjayB0byBjZW50ZXIgb2YgdGhlIGZpbHRlciBvZiB0aGUgbmV4dCBvbmUgKi8KLSAgICAgICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgICAgICBwX2N1ciArPSAoY3Vycl9vZmZzZXQgLSAzKTsKLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICB9Ci0gICAgICAgIH0KLSAgICB9Ci0KLSAgICByZXR1cm4gOwotfQotCi12b2lkIGVWZ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yA9ICoocF9yZWYgKz0gaW5waXRjaCk7ICAvKiBtb2RpZnkgcG9pbnRlciBiZWZvcmUgbG9hZGluZyAqLwotICAgICAgICAgICAgcjQgPSAqKHBfcmVmICs9IGlucGl0Y2gpOwotICAgICAgICAgICAgLyogZmlyc3QgcGl4ZWwgKi8KLSAgICAgICAgICAgIHI1ID0gKihwX3JlZiArPSBpbnBpdGNoKTsKLSAgICAgICAgICAgIHJlc3VsdCA9IChyMCArIHI1KTsKLSAgICAgICAgICAgIHIwID0gKHIxICsgcjQpOwotICAgICAgICAgICAgcmVzdWx0IC09IChyMCAqIDUpOy8vcmVzdWx0IC09IHIwOyAgcmVzdWx0IC09IChyMDw8Mik7Ci0gICAgICAgICAgICByMCA9IChyMiArIHIzKTsKLSAgICAgICAgICAgIHJlc3VsdCArPSAocjAgKiAyMCk7Ly9yZXN1bHQgKz0gKHIwPDw0KTsgICAgcmVzdWx0ICs9IChyMDw8Mik7Ci0gICAgICAgICAgICAqKHBfY3VyICs9IG91dHBpdGNoKSA9IHJlc3VsdDsKLSAgICAgICAgICAgIC8qIHNlY29uZCBwaXhlbCAqLwotICAgICAgICAgICAgcjAgPSAqKHBfcmVmICs9IGlucGl0Y2gpOwotICAgICAgICAgICAgcmVzdWx0ID0gKHIxICsgcjApOwotICAgICAgICAgICAgcjEgPSAocjIgKyByNSk7Ci0gICAgICAgICAgICByZXN1bHQgLT0gKHIxICogNSk7Ly9yZXN1bHQgLT0gcjE7ICByZXN1bHQgLT0gKHIxPDwyKTsKLSAgICAgICAgICAgIHIxID0gKHIzICsgcjQpOwotICAgICAgICAgICAgcmVzdWx0ICs9IChyMSAqIDIwKTsvL3Jlc3VsdCArPSAocjE8PDQpOyAgICByZXN1bHQgKz0gKHIxPDwyKTsKLSAgICAgICAgICAgICoocF9jdXIgKz0gb3V0cGl0Y2gpID0gcmVzdWx0OwotICAgICAgICAgICAgLyogdGhpcmQgcGl4ZWwgKi8KLSAgICAgICAgICAgIHIxID0gKihwX3JlZiArPSBpbnBpdGNoKTsKLSAgICAgICAgICAgIHJlc3VsdCA9IChyMiArIHIxKTsKLSAgICAgICAgICAgIHIyID0gKHIzICsgcjApOwotICAgICAgICAgICAgcmVzdWx0IC09IChyMiAqIDUpOy8vcmVzdWx0IC09IHIyOyAgcmVzdWx0IC09IChyMjw8Mik7Ci0gICAgICAgICAgICByMiA9IChyNCArIHI1KTsKLSAgICAgICAgICAgIHJlc3VsdCArPSAocjIgKiAyMCk7Ly9yZXN1bHQgKz0gKHIyPDw0KTsgICAgcmVzdWx0ICs9IChyMjw8Mik7Ci0gICAgICAgICAgICAqKHBfY3VyICs9IG91dHBpdGNoKSA9IHJlc3VsdDsKLSAgICAgICAgICAgIC8qIGZvdXJ0aCBwaXhlbCAqLwotICAgICAgICAgICAgcjIgPSAqKHBfcmVmICs9IGlucGl0Y2gpOwotICAgICAgICAgICAgcmVzdWx0ID0gKHIzICsgcjIpOwotICAgICAgICAgICAgcjMgPSAocjQgKyByMSk7Ci0gICAgICAgICAgICByZXN1bHQgLT0gKHIzICogNSk7Ly9yZXN1bHQgLT0gcjM7ICByZXN1bHQgLT0gKHIzPDwyKTsKLSAgICAgICAgICAgIHIzID0gKHI1ICsgcjApOwotICAgICAgICAgICAgcmVzdWx0ICs9IChyMyAqIDIwKTsvL3Jlc3VsdCArPSAocjM8PDQpOyAgICByZXN1bHQgKz0gKHIzPDwyKTsKLSAgICAgICAgICAgICoocF9jdXIgKz0gb3V0cGl0Y2gpID0gcmVzdWx0OwotICAgICAgICAgICAgcF9yZWYgLT0gKGlucGl0Y2ggPDwgMSk7ICAvKiBtb3ZlIGJhY2sgdG8gY2VudGVyIG9mIHRoZSBmaWx0ZXIgb2YgdGhlIG5leHQgb25lICovCi0gICAgICAgIH0KLSAgICAgICAgcF9jdXIgKz0gY3Vycl9vZmZzZXQ7Ci0gICAgfQotCi0gICAgcmV0dXJuIDsKLX0KLQotdm9pZCBlVmVydEludGVycDNNQyhpbnQgKmluLCBpbnQgaW5waXRjaCwgdWludDggKm91dCwgaW50IG91dHBpdGNoLAotICAgICAgICAgICAgICAgICAgICBpbnQgYmxrd2lkdGgsIGludCBibGtoZWlnaHQsIGludCBkeSkKLXsKLSAgICB1aW50OCAqcF9jdXI7Ci0gICAgaW50ICpwX3JlZjsKLSAgICB1aW50MzIgdG1wOwotICAgIGludCByZXN1bHQsIHJlc3VsdDIsIGN1cnJfb2Zmc2V0LCByZWZfb2Zmc2V0OwotICAgIGludCBqLCByMCwgcjEsIHIyLCByMywgcjQsIHI1OwotCi0gICAgcF9jdXIgPSBvdXQ7Ci0gICAgY3Vycl9vZmZzZXQgPSAxIC0gb3V0cGl0Y2ggKiAoYmxraGVpZ2h0IC0gMSk7IC8qIG9mZnNldCB2ZXJ0aWNhbGx5IGJhY2sgdXAgYW5kIG9uZSBwaXhlbCB0byByaWdodCAqLwotICAgIHJlZl9vZmZzZXQgPSBibGtoZWlnaHQgKiBpbnBpdGNoOyAvKiBmb3IgbGltaXQgKi8KLQotICAgIGlmIChkeSYxKQotICAgIHsKLSAgICAgICAgZHkgPSAoZHkgPj4gMSkgPyAtKGlucGl0Y2ggPDwgMSkgOiAtKGlucGl0Y2ggPDwgMSkgLSBpbnBpdGNoOwotCi0gICAgICAgIGZvciAoaiA9IDA7IGogPCBibGt3aWR0aDsgaisrKQotICAgICAgICB7Ci0gICAgICAgICAgICBwX2N1ciAtPSBvdXRwaXRjaDsgLyogY29tcGVuc2F0ZSBmb3IgdGhlIGZpcnN0IG9mZnNldCAqLwotICAgICAgICAgICAgcF9yZWYgPSBpbisrOwotCi0gICAgICAgICAgICB0bXAgPSAodWludDMyKShwX3JlZiArIHJlZl9vZmZzZXQpOyAvKiBsaW1pdCAqLwotICAgICAgICAgICAgd2hpbGUgKCh1aW50MzIpcF9yZWYgPCB0bXApCi0gICAgICAgICAgICB7ICAgICAgICAgICAgICAgICAgICAgICAgICAgLyogbG9vcCB1bi1yb2xsZWQgKi8KLSAgICAgICAgICAgICAgICByMCA9ICoocF9yZWYgLSAoaW5waXRjaCA8PCAxKSk7Ci0gICAgICAgICAgICAgICAgcjEgPSAqKHBfcmVmIC0gaW5waXRjaCk7Ci0gICAgICAgICAgICAgICAgcjIgPSAqcF9yZWY7Ci0gICAgICAgICAgICAgICAgcjMgPSAqKHBfcmVmICs9IGlucGl0Y2gpOyAgLyogbW9kaWZ5IHBvaW50ZXIgYmVmb3JlIGxvYWRpbmcgKi8KLSAgICAgICAgICAgICAgICByNCA9ICoocF9yZWYgKz0gaW5waXRjaCk7Ci0gICAgICAgICAgICAgICAgLyogZmlyc3QgcGl4ZWwgKi8KLSAgICAgICAgICAgICAgICByNSA9ICoocF9yZWYgKz0gaW5waXRjaCk7Ci0gICAgICAgICAgICAgICAgcmVzdWx0ID0gKHIwICsgcjUpOwotICAgICAgICAgICAgICAgIHIwID0gKHIxICsgcjQpOwotICAgICAgICAgICAgICAgIHJlc3VsdCAtPSAocjAgKiA1KTsvL3Jlc3VsdCAtPSByMDsgIHJlc3VsdCAtPSAocjA8PDIpOwotICAgICAgICAgICAgICAgIHIwID0gKHIyICsgcjMpOwotICAgICAgICAgICAgICAgIHJlc3VsdCArPSAocjAgKiAyMCk7Ly9yZXN1bHQgKz0gKHIwPDw0KTsgICAgcmVzdWx0ICs9IChyMDw8Mik7Ci0gICAgICAgICAgICAgICAgcmVzdWx0ID0gKHJlc3VsdCArIDUxMikgPj4gMTA7Ci0gICAgICAgICAgICAgICAgQ0xJUF9SRVNVTFQocmVzdWx0KQotICAgICAgICAgICAgICAgIHJlc3VsdDIgPSAoKHBfcmVmW2R5XSArIDE2KSA+PiA1KTsKLSAgICAgICAgICAgICAgICBDTElQX1JFU1VMVChyZXN1bHQyKQotICAgICAgICAgICAgICAgIC8qIDMvNCBwZWwsICBubyBuZWVkIHRvIGNsaXAgKi8KLSAgICAgICAgICAgICAgICByZXN1bHQgPSAocmVzdWx0ICsgcmVzdWx0MiArIDEpOwotICAgICAgICAgICAgICAgIHJlc3VsdCA9IChyZXN1bHQgPj4gMSk7Ci0gICAgICAgICAgICAgICAgKihwX2N1ciArPSBvdXRwaXRjaCkgPSByZXN1bHQ7Ci0gICAgICAgICAgICAgICAgLyogc2Vjb25kIHBpeGVsICovCi0gICAgICAgICAgICAgICAgcjAgPSAqKHBfcmVmICs9IGlucGl0Y2gpOwotICAgICAgICAgICAgICAgIHJlc3VsdCA9IChyMSArIHIwKTsKLSAgICAgICAgICAgICAgICByMSA9IChyMiArIHI1KTsKLSAgICAgICAgICAgICAgICByZXN1bHQgLT0gKHIxICogNSk7Ly9yZXN1bHQgLT0gcjE7ICByZXN1bHQgLT0gKHIxPDwyKTsKLSAgICAgICAgICAgICAgICByMSA9IChyMyArIHI0KTsKLSAgICAgICAgICAgICAgICByZXN1bHQgKz0gKHIxICogMjApOy8vcmVzdWx0ICs9IChyMTw8NCk7ICAgIHJlc3VsdCArPSAocjE8PDIpOwotICAgICAgICAgICAgICAgIHJlc3VsdCA9IChyZXN1bHQgKyA1MTIpID4+IDEwOwotICAgICAgICAgICAgICAgIENMSVBfUkVTVUxUKHJlc3VsdCkKLSAgICAgICAgICAgICAgICByZXN1bHQyID0gKChwX3JlZltkeV0gKyAxNikgPj4gNSk7Ci0gICAgICAgICAgICAgICAgQ0xJUF9SRVNVTFQocmVzdWx0MikKLSAgICAgICAgICAgICAgICAvKiAzLzQgcGVsLCAgbm8gbmVlZCB0byBjbGlwICovCi0gICAgICAgICAgICAgICAgcmVzdWx0ID0gKHJlc3VsdCArIHJlc3VsdDIgKyAxKTsKLSAgICAgICAgICAgICAgICByZXN1bHQgPSAocmVzdWx0ID4+IDEpOwotICAgICAgICAgICAgICAgICoocF9jdXIgKz0gb3V0cGl0Y2gpID0gcmVzdWx0OwotICAgICAgICAgICAgICAgIC8qIHRoaXJkIHBpeGVsICovCi0gICAgICAgICAgICAgICAgcjEgPSAqKHBfcmVmICs9IGlucGl0Y2gpOwotICAgICAgICAgICAgICAgIHJlc3VsdCA9IChyMiArIHIxKTsKLSAgICAgICAgICAgICAgICByMiA9IChyMyArIHIwKTsKLSAgICAgICAgICAgICAgICByZXN1bHQgLT0gKHIyICogNSk7Ly9yZXN1bHQgLT0gcjI7ICByZXN1bHQgLT0gKHIyPDwyKTsKLSAgICAgICAgICAgICAgICByMiA9IChyNCArIHI1KTsKLSAgICAgICAgICAgICAgICByZXN1bHQgKz0gKHIyICogMjApOy8vcmVzdWx0ICs9IChyMjw8NCk7ICAgIHJlc3VsdCArPSAocjI8PDIpOwotICAgICAgICAgICAgICAgIHJlc3VsdCA9IChyZXN1bHQgKyA1MTIpID4+IDEwOwotICAgICAgICAgICAgICAgIENMSVBfUkVTVUxUKHJlc3VsdCkKLSAgICAgICAgICAgICAgICByZXN1bHQyID0gKChwX3JlZltkeV0gKyAxNikgPj4gNSk7Ci0gICAgICAgICAgICAgICAgQ0xJUF9SRVNVTFQocmVzdWx0MikKLSAgICAgICAgICAgICAgICAvKiAzLzQgcGVsLCAgbm8gbmVlZCB0byBjbGlwICovCi0gICAgICAgICAgICAgICAgcmVzdWx0ID0gKHJlc3VsdCArIHJlc3VsdDIgKyAxKTsKLSAgICAgICAgICAgICAgICByZXN1bHQgPSAocmVzdWx0ID4+IDEpOwotICAgICAgICAgICAgICAgICoocF9jdXIgKz0gb3V0cGl0Y2gpID0gcmVzdWx0OwotICAgICAgICAgICAgICAgIC8qIGZvdXJ0aCBwaXhlbCAqLwotICAgICAgICAgICAgICAgIHIyID0gKihwX3JlZiArPSBpbnBpdGNoKTsKLSAgICAgICAgICAgICAgICByZXN1bHQgPSAocjMgKyByMik7Ci0gICAgICAgICAgICAgICAgcjMgPSAocjQgKyByMSk7Ci0gICAgICAgICAgICAgICAgcmVzdWx0IC09IChyMyAqIDUpOy8vcmVzdWx0IC09IHIzOyAgcmVzdWx0IC09IChyMzw8Mik7Ci0gICAgICAgICAgICAgICAgcjMgPSAocjUgKyByMCk7Ci0gICAgICAgICAgICAgICAgcmVzdWx0ICs9IChyMyAqIDIwKTsvL3Jlc3VsdCArPSAocjM8PDQpOyAgICByZXN1bHQgKz0gKHIzPDwyKTsKLSAgICAgICAgICAgICAgICByZXN1bHQgPSAocmVzdWx0ICsgNTEyKSA+PiAxMDsKLSAgICAgICAgICAgICAgICBDTElQX1JFU1VMVChyZXN1bHQpCi0gICAgICAgICAgICAgICAgcmVzdWx0MiA9ICgocF9yZWZbZHldICsgMTYpID4+IDUpOwotICAgICAgICAgICAgICAgIENMSVBfUkVTVUxUKHJlc3VsdDIpCi0gICAgICAgICAgICAgICAgLyogMy80IHBlbCwgIG5vIG5lZWQgdG8gY2xpcCAqLwotICAgICAgICAgICAgICAgIHJlc3VsdCA9IChyZXN1bHQgKyByZXN1bHQyICsgMSk7Ci0gICAgICAgICAgICAgICAgcmVzdWx0ID0gKHJlc3VsdCA+PiAxKTsKLSAgICAgICAgICAgICAgICAqKHBfY3VyICs9IG91dHBpdGNoKSA9IHJlc3VsdDsKLSAgICAgICAgICAgICAgICBwX3JlZiAtPSAoaW5waXRjaCA8PCAxKTsgIC8qIG1vdmUgYmFjayB0byBjZW50ZXIgb2YgdGhlIGZpbHRlciBvZiB0aGUgbmV4dCBvbmUgKi8KLSAgICAgICAgICAgIH0KLSAgICAgICAgICAgIHBfY3VyICs9IGN1cnJfb2Zmc2V0OwotICAgICAgICB9Ci0gICAgfQotICAgIGVsc2UKLSAgICB7Ci0gICAgICAgIGZvciAoaiA9IDA7IGogPCBibGt3aWR0aDsgaisrKQotICAgICAgICB7Ci0gICAgICAgICAgICBwX2N1ciAtPSBvdXRwaXRjaDsgLyogY29tcGVuc2F0ZSBmb3IgdGhlIGZpcnN0IG9mZnNldCAqLwotICAgICAgICAgICAgcF9yZWYgPSBpbisrOwotCi0gICAgICAgICAgICB0bXAgPSAodWludDMyKShwX3JlZiArIHJlZl9vZmZzZXQpOyAvKiBsaW1pdCAqLwotICAgICAgICAgICAgd2hpbGUgKCh1aW50MzIpcF9yZWYgPCB0bXApCi0gICAgICAgICAgICB7ICAgICAgICAgICAgICAgICAgICAgICAgICAgLyogbG9vcCB1bi1yb2xsZWQgKi8KLSAgICAgICAgICAgICAgICByMCA9ICoocF9yZWYgLSAoaW5waXRjaCA8PCAxKSk7Ci0gICAgICAgICAgICAgICAgcjEgPSAqKHBfcmVmIC0gaW5waXRjaCk7Ci0gICAgICAgICAgICAgICAgcjIgPSAqcF9yZWY7Ci0gICAgICAgICAgICAgICAgcjMgPSAqKHBfcmVmICs9IGlucGl0Y2gpOyAgLyogbW9kaWZ5IHBvaW50ZXIgYmVmb3JlIGxvYWRpbmcgKi8KLSAgICAgICAgICAgICAgICByNCA9ICoocF9yZWYgKz0gaW5waXRjaCk7Ci0gICAgICAgICAgICAgICAgLyogZmlyc3QgcGl4ZWwgKi8KLSAgICAgICAgICAgICAgICByNSA9ICoocF9yZWYgKz0gaW5waXRjaCk7Ci0gICAgICAgICAgICAgICAgcmVzdWx0ID0gKHIwICsgcjUpOwotICAgICAgICAgICAgICAgIHIwID0gKHIxICsgcjQpOwotICAgICAgICAgICAgICAgIHJlc3VsdCAtPSAocjAgKiA1KTsvL3Jlc3VsdCAtPSByMDsgIHJlc3VsdCAtPSAocjA8PDIpOwotICAgICAgICAgICAgICAgIHIwID0gKHIyICsgcjMpOwotICAgICAgICAgICAgICAgIHJlc3VsdCArPSAocjAgKiAyMCk7Ly9yZXN1bHQgKz0gKHIwPDw0KTsgICAgcmVzdWx0ICs9IChyMDw8Mik7Ci0gICAgICAgICAgICAgICAgcmVzdWx0ID0gKHJlc3VsdCArIDUxMikgPj4gMTA7Ci0gICAgICAgICAgICAgICAgQ0xJUF9SRVNVTFQocmVzdWx0KQotICAgICAgICAgICAgICAgICoocF9jdXIgKz0gb3V0cGl0Y2gpID0gcmVzdWx0OwotICAgICAgICAgICAgICAgIC8qIHNlY29uZCBwaXhlbCAqLwotICAgICAgICAgICAgICAgIHIwID0gKihwX3JlZiArPSBpbnBpdGNoKTsKLSAgICAgICAgICAgICAgICByZXN1bHQgPSAocjEgKyByMCk7Ci0gICAgICAgICAgICAgICAgcjEgPSAocjIgKyByNSk7Ci0gICAgICAgICAgICAgICAgcmVzdWx0IC09IChyMSAqIDUpOy8vcmVzdWx0IC09IHIxOyAgcmVzdWx0IC09IChyMTw8Mik7Ci0gICAgICAgICAgICAgICAgcjEgPSAocjMgKyByNCk7Ci0gICAgICAgICAgICAgICAgcmVzdWx0ICs9IChyMSAqIDIwKTsvL3Jlc3VsdCArPSAocjE8PDQpOyAgICByZXN1bHQgKz0gKHIxPDwyKTsKLSAgICAgICAgICAgICAgICByZXN1bHQgPSAocmVzdWx0ICsgNTEyKSA+PiAxMDsKLSAgICAgICAgICAgICAgICBDTElQX1JFU1VMVChyZXN1bHQpCi0gICAgICAgICAgICAgICAgKihwX2N1ciArPSBvdXRwaXRjaCkgPSByZXN1bHQ7Ci0gICAgICAgICAgICAgICAgLyogdGhpcmQgcGl4ZWwgKi8KLSAgICAgICAgICAgICAgICByMSA9ICoocF9yZWYgKz0gaW5waXRjaCk7Ci0gICAgICAgICAgICAgICAgcmVzdWx0ID0gKHIyICsgcjEpOwotICAgICAgICAgICAgICAgIHIyID0gKHIzICsgcjApOwotICAgICAgICAgICAgICAgIHJlc3VsdCAtPSAocjIgKiA1KTsvL3Jlc3VsdCAtPSByMjsgIHJlc3VsdCAtPSAocjI8PDIpOwotICAgICAgICAgICAgICAgIHIyID0gKHI0ICsgcjUpOwotICAgICAgICAgICAgICAgIHJlc3VsdCArPSAocjIgKiAyMCk7Ly9yZXN1bHQgKz0gKHIyPDw0KTsgICAgcmVzdWx0ICs9IChyMjw8Mik7Ci0gICAgICAgICAgICAgICAgcmVzdWx0ID0gKHJlc3VsdCArIDUxMikgPj4gMTA7Ci0gICAgICAgICAgICAgICAgQ0xJUF9SRVNVTFQocmVzdWx0KQotICAgICAgICAgICAgICAgICoocF9jdXIgKz0gb3V0cGl0Y2gpID0gcmVzdWx0OwotICAgICAgICAgICAgICAgIC8qIGZvdXJ0aCBwaXhlbCAqLwotICAgICAgICAgICAgICAgIHIyID0gKihwX3JlZiArPSBpbnBpdGNoKTsKLSAgICAgICAgICAgICAgICByZXN1bHQgPSAocjMgKyByMik7Ci0gICAgICAgICAgICAgICAgcjMgPSAocjQgKyByMSk7Ci0gICAgICAgICAgICAgICAgcmVzdWx0IC09IChyMyAqIDUpOy8vcmVzdWx0IC09IHIzOyAgcmVzdWx0IC09IChyMzw8Mik7Ci0gICAgICAgICAgICAgICAgcjMgPSAocjUgKyByMCk7Ci0gICAgICAgICAgICAgICAgcmVzdWx0ICs9IChyMyAqIDIwKTsvL3Jlc3VsdCArPSAocjM8PDQpOyAgICByZXN1bHQgKz0gKHIzPDwyKTsKLSAgICAgICAgICAgICAgICByZXN1bHQgPSAocmVzdWx0ICsgNTEyKSA+PiAxMDsKLSAgICAgICAgICAgICAgICBDTElQX1JFU1VMVChyZXN1bHQpCi0gICAgICAgICAgICAgICAgKihwX2N1ciArPSBvdXRwaXRjaCkgPSByZXN1bHQ7Ci0gICAgICAgICAgICAgICAgcF9yZWYgLT0gKGlucGl0Y2ggPDwgMSk7ICAvKiBtb3ZlIGJhY2sgdG8gY2VudGVyIG9mIHRoZSBmaWx0ZXIgb2YgdGhlIG5leHQgb25lICovCi0gICAgICAgICAgICB9Ci0gICAgICAgICAgICBwX2N1ciArPSBjdXJyX29mZnNldDsKLSAgICAgICAgfQotICAgIH0KLQotICAgIHJldHVybiA7Ci19Ci0KLXZvaWQgZURpYWdvbmFsSW50ZXJwTUModWludDggKmluMSwgdWludDggKmluMiwgaW50IGlucGl0Y2gsCi0gICAgICAgICAgICAgICAgICAgICAgIHVpbnQ4ICpvdXQsIGludCBvdXRwaXRjaCwKLSAgICAgICAgICAgICAgICAgICAgICAgaW50IGJsa3dpZHRoLCBpbnQgYmxraGVpZ2h0KQotewotICAgIGludCBqLCBpOwotICAgIGludCByZXN1bHQ7Ci0gICAgdWludDggKnBfY3VyLCAqcF9yZWYsICpwX3RtcDg7Ci0gICAgaW50IGN1cnJfb2Zmc2V0LCByZWZfb2Zm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OyAgICAvKiAwLGQsMCxiICovCi0gICAgICAgIC8vcjAgJj0gMHhGRjAwRkY7ICAgICAgICAgICAvKiAwLGMsMCxhICovCi0gICAgICAgIC8qIEl0IGlzIGZhc3RlciB0byByZWFkIDEgYnl0ZSBhdCBhIHRpbWUgKi8KLSAgICAgICAgcjAgPSBwX3JlZlswXTsKLSAgICAgICAgcjEgPSBwX3JlZlsyXTsKLSAgICAgICAgcjAgfD0gKHIxIDw8IDE2KTsgICAgICAgICAgIC8qIDAsYywwLGEgKi8KLSAgICAgICAgcjEgPSBwX3JlZlsxXTsKLSAgICAgICAgcjIgPSBwX3JlZlszXTsKLSAgICAgICAgcjEgfD0gKHIyIDw8IDE2KTsgICAgICAgICAgIC8qIDAsZCwwLGIgKi8KLQotICAgICAgICB3aGlsZSAoKHVpbnQzMilwX3JlZiA8IHRtcCkKLSAgICAgICAgewotICAgICAgICAgICAgLy9yMiA9ICooKHVpbnQzMiopKHBfcmVmKz00KSk7LyogaCxnLGYsZSAqLwotICAgICAgICAgICAgLy9yMyA9IChyMj4+OCkmMHhGRjAwRkY7ICAvKiAwLGgsMCxmICovCi0gICAgICAgICAgICAvL3IyICY9IDB4RkYwMEZGOyAgICAgICAgICAgLyogMCxnLDAsZSAqLwotICAgICAgICAgICAgLyogSXQgaXMgZmFzdGVyIHRvIHJlYWQgMSBieXRlIGF0IGEgdGltZSAqLwotICAgICAgICAgICAgcjIgPSAqKHBfcmVmICs9IDQpOwotICAgICAgICAgICAgcjMgPSBwX3JlZlsyXTsKLSAgICAgICAgICAgIHIyIHw9IChyMyA8PCAxNik7ICAgICAgICAgICAvKiAwLGcsMCxlICovCi0gICAgICAgICAgICByMyA9IHBfcmVmWzFdOwotICAgICAgICAgICAgcjQgPSBwX3JlZlszXTsKLSAgICAgICAgICAgIHIzIHw9IChyNCA8PCAxNik7ICAgICAgICAgICAvKiAwLGgsMCxmICovCi0KLSAgICAgICAgICAgIHI0ID0gcjAgKyByMzsgICAgICAgLyogYytoLCBhK2YgKi8KLSAgICAgICAgICAgIHI1ID0gcjAgKyByMTsgICAvKiBjK2QsIGErYiAqLwotICAgICAgICAgICAgcjYgPSByMiArIHIzOyAgIC8qIGcraCwgZStmICovCi0gICAgICAgICAgICByNSA+Pj0gMTY7Ci0gICAgICAgICAgICByNSB8PSAocjYgPDwgMTYpOyAgIC8qIGUrZiwgYytkICovCi0gICAgICAgICAgICByNCArPSByNSAqIDIwOyAgICAgIC8qIGMrMjAqZSsyMCpmK2gsIGErMjAqYysyMCpkK2YgKi8KLSAgICAgICAgICAgIHI0ICs9IDB4MTAwMDEwOyAvKiArMTYsICsxNiAqLwotICAgICAgICAgICAgcjUgPSByMSArIHIyOyAgICAgICAvKiBkK2csIGIrZSAqLwotICAgICAgICAgICAgcjQgLT0gcjUgKiA1OyAgICAgICAvKiBjLTUqZCsyMCplKzIwKmYtNSpnK2gsIGEtNSpiKzIwKmMrMjAqZC01KmUrZiAqLwotICAgICAgICAgICAgcjQgPj49IDU7Ci0gICAgICAgICAgICByMTMgfD0gcjQ7ICAgICAgLyogY2hlY2sgY2xpcHBpbmcgKi8KLSAgICAgICAgICAgIHI0ICY9IDB4RkYwMEZGOyAvKiBtYXNrICovCi0KLSAgICAgICAgICAgIHI1ID0gcF9yZWZbNF07ICAvKiBpICovCi0gICAgICAgICAgICByNiA9IChyNSA8PCAxNik7Ci0gICAgICAgICAgICByNSA9IHI2IHwgKHIyID4+IDE2KTsvKiAwLGksMCxnICovCi0gICAgICAgICAgICByNSArPSByMTsgICAgICAgLyogZCtpLCBiK2cgKi8gLyogcjUgbm90IGZyZWUgKi8KLSAgICAgICAgICAgIHIxID4+PSAxNjsKLSAgICAgICAgICAgIHIxIHw9IChyMyA8PCAxNik7IC8qIDAsZiwwLGQgKi8gLyogcjEgaGFzIGNoYW5nZWQgKi8KLSAgICAgICAgICAgIHIxICs9IHIyOyAgICAgICAvKiBmK2csIGQrZSAqLwotICAgICAgICAgICAgcjUgKz0gMjAgKiByMTsgIC8qIGQrMjBmKzIwZytpLCBiKzIwZCsyMGUrZyAqLwotICAgICAgICAgICAgcjAgPj49IDE2OwotICAgICAgICAgICAgcjAgfD0gKHIyIDw8IDE2KTsgLyogMCxlLDAsYyAqLyAvKiByMCBoYXMgY2hhbmdlZCAqLwotICAgICAgICAgICAgcjAgKz0gcjM7ICAgICAgIC8qIGUraCwgYytmICovCi0gICAgICAgICAgICByNSArPSAweDEwMDAxMDsgLyogMTYsMTYgKi8KLSAgICAgICAgICAgIHI1IC09IHIwICogNTsgICAgICAgLyogZC01ZSsyMGYrMjBnLTVoK2ksIGItNWMrMjBkKzIwZS01ZitnICovCi0gICAgICAgICAgICByNSA+Pj0gNTsKLSAgICAgICAgICAgIHIxMyB8PSByNTsgICAgICAvKiBjaGVjayBjbGlwcGluZyAqLwotICAgICAgICAgICAgcjUgJj0gMHhGRjAwRkY7IC8qIG1hc2sgKi8KLQotICAgICAgICAgICAgcjQgfD0gKHI1IDw8IDgpOyAgICAvKiBwYWNrIHRoZW0gdG9nZXRoZXIgKi8KLSAgICAgICAgICAgICpwX3RtcCsrID0gcjQ7Ci0gICAgICAgICAgICByMSA9IHIzOwotICAgICAgICAgICAgcjAgPSByMjsKLSAgICAgICAgfQotICAgICAgICBwX3RtcCArPSAoKDI0IC0gYmxrd2lkdGgpID4+IDIpOyAvKiBtb3ZlIHRvIHRoZSBuZXh0IGxpbmUgKi8KLSAgICAgICAgcF9yZWYgKz0gcmVmX29mZnNldDsgIC8qICAgIHJlZl9vZmZzZXQgPSBpbnBpdGNoLWJsa3dpZHRoOyAqLwotCi0gICAgICAgIGlmIChyMTMmMHhGRjAwMDcwMCkgLyogbmVlZCBjbGlwcGluZyAqLwotICAgICAgICB7Ci0gICAgICAgICAgICAvKiBtb3ZlIGJhY2sgdG8gdGhlIGJlZ2lubmluZyBvZiB0aGUgbGluZSAqLwotICAgICAgICAgICAgcF9yZWYgLT0gKHJlZl9vZmZzZXQgKyBibGt3aWR0aCk7ICAgLyogaW5wdXQgKi8KLSAgICAgICAgICAgIHBfdG1wIC09IDY7IC8qIGludGVybWVkaWF0ZSBvdXRwdXQgKi8KLSAgICAgICAgICAgIHRtcCA9ICh1aW50MzIpKHBfcmVmICsgYmxrd2lkdGgpOwotICAgICAgICAgICAgd2hpbGUgKCh1aW50MzIpcF9yZWYgPCB0bXApCi0gICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgcjAgPSAqcF9yZWYrKzsKLSAgICAgICAgICAgICAgICByMSA9ICpwX3JlZisrOwotICAgICAgICAgICAgICAgIHIyID0gKnBfcmVmKys7Ci0gICAgICAgICAgICAgICAgcjMgPSAqcF9yZWYrKzsKLSAgICAgICAgICAgICAgICByNCA9ICpwX3JlZisrOwotICAgICAgICAgICAgICAgIC8qIGZpcnN0IHBpeGVsICovCi0gICAgICAgICAgICAgICAgcjUgPSAqcF9yZWYrKzsKLSAgICAgICAgICAgICAgICByZXN1bHQgPSAocjAgKyByNSk7Ci0gICAgICAgICAgICAgICAgcjAgPSAocjEgKyByNCk7Ci0gICAgICAgICAgICAgICAgcmVzdWx0IC09IChyMCAqIDUpOy8vcmVzdWx0IC09IHIwOyAgcmVzdWx0IC09IChyMDw8Mik7Ci0gICAgICAgICAgICAgICAgcjAgPSAocjIgKyByMyk7Ci0gICAgICAgICAgICAgICAgcmVzdWx0ICs9IChyMCAqIDIwKTsvL3Jlc3VsdCArPSAocjA8PDQpOyAgICByZXN1bHQgKz0gKHIwPDwyKTsKLSAgICAgICAgICAgICAgICByZXN1bHQgPSAocmVzdWx0ICsgMTYpID4+IDU7Ci0gICAgICAgICAgICAgICAgQ0xJUF9SRVNVTFQocmVzdWx0KQotICAgICAgICAgICAgICAgIHBrcmVzID0gcmVzdWx0OwotICAgICAgICAgICAgICAgIC8qIHNlY29uZCBwaXhlbCAqLwotICAgICAgICAgICAgICAgIHIwID0gKnBfcmVmKys7Ci0gICAgICAgICAgICAgICAgcmVzdWx0ID0gKHIxICsgcjApOwotICAgICAgICAgICAgICAgIHIxID0gKHIyICsgcjUpOwotICAgICAgICAgICAgICAgIHJlc3VsdCAtPSAocjEgKiA1KTsvL3Jlc3VsdCAtPSByMTsgIHJlc3VsdCAtPSAocjE8PDIpOwotICAgICAgICAgICAgICAgIHIxID0gKHIzICsgcjQpOwotICAgICAgICAgICAgICAgIHJlc3VsdCArPSAocjEgKiAyMCk7Ly9yZXN1bHQgKz0gKHIxPDw0KTsgICAgcmVzdWx0ICs9IChyMTw8Mik7Ci0gICAgICAgICAgICAgICAgcmVzdWx0ID0gKHJlc3VsdCArIDE2KSA+PiA1OwotICAgICAgICAgICAgICAgIENMSVBfUkVTVUxUKHJlc3VsdCkKLSAgICAgICAgICAgICAgICBwa3JlcyB8PSAocmVzdWx0IDw8IDgpOwotICAgICAgICAgICAgICAgIC8qIHRoaXJkIHBpeGVsICovCi0gICAgICAgICAgICAgICAgcjEgPSAqcF9yZWYrKzsKLSAgICAgICAgICAgICAgICByZXN1bHQgPSAocjIgKyByMSk7Ci0gICAgICAgICAgICAgICAgcjIgPSAocjMgKyByMCk7Ci0gICAgICAgICAgICAgICAgcmVzdWx0IC09IChyMiAqIDUpOy8vcmVzdWx0IC09IHIyOyAgcmVzdWx0IC09IChyMjw8Mik7Ci0gICAgICAgICAgICAgICAgcjIgPSAocjQgKyByNSk7Ci0gICAgICAgICAgICAgICAgcmVzdWx0ICs9IChyMiAqIDIwKTsvL3Jlc3VsdCArPSAocjI8PDQpOyAgICByZXN1bHQgKz0gKHIyPDwyKTsKLSAgICAgICAgICAgICAgICByZXN1bHQgPSAocmVzdWx0ICsgMTYpID4+IDU7Ci0gICAgICAgICAgICAgICAgQ0xJUF9SRVNVTFQocmVzdWx0KQotICAgICAgICAgICAgICAgIHBrcmVzIHw9IChyZXN1bHQgPDwgMTYpOwotICAgICAgICAgICAgICAgIC8qIGZvdXJ0aCBwaXhlbCAqLwotICAgICAgICAgICAgICAgIHIyID0gKnBfcmVmKys7Ci0gICAgICAgICAgICAgICAgcmVzdWx0ID0gKHIzICsgcjIpOwotICAgICAgICAgICAgICAgIHIzID0gKHI0ICsgcjEpOwotICAgICAgICAgICAgICAgIHJlc3VsdCAtPSAocjMgKiA1KTsvL3Jlc3VsdCAtPSByMzsgIHJlc3VsdCAtPSAocjM8PDIpOwotICAgICAgICAgICAgICAgIHIzID0gKHI1ICsgcjApOwotICAgICAgICAgICAgICAgIHJlc3VsdCArPSAocjMgKiAyMCk7Ly9yZXN1bHQgKz0gKHIzPDw0KTsgICAgcmVzdWx0ICs9IChyMzw8Mik7Ci0gICAgICAgICAgICAgICAgcmVzdWx0ID0gKHJlc3VsdCArIDE2KSA+PiA1OwotICAgICAgICAgICAgICAgIENMSVBfUkVTVUxUKHJlc3VsdCkKLSAgICAgICAgICAgICAgICBwa3JlcyB8PSAocmVzdWx0IDw8IDI0KTsKLQotICAgICAgICAgICAgICAgICpwX3RtcCsrID0gcGtyZXM7IC8qIHdyaXRlIDQgcGl4ZWwgKi8KLSAgICAgICAgICAgICAgICBwX3JlZiAtPSA1OwotICAgICAgICAgICAgfQotICAgICAgICAgICAgcF90bXAgKz0gKCgyNCAtIGJsa3dpZHRoKSA+PiAyKTsgLyogbW92ZSB0byB0aGUgbmV4dCBsaW5lICovCi0gICAgICAgICAgICBwX3JlZiArPSByZWZfb2Zmc2V0OyAgLyogICAgcmVmX29mZnNldCA9IGlucGl0Y2gtYmxrd2lkdGg7ICovCi0gICAgICAgIH0KLSAgICB9Ci0KLSAgICAvKiAgcGVyZm9ybSB2ZXJ0aWNhbCBpbnRlcnBvbGF0aW9uICovCi0gICAgLyogbm90IHdvcmQtYWxpZ25lZCAqLwotICAgIGlmICgoKHVpbnQzMilpbjIpJjB4MykKLSAgICB7Ci0gICAgICAgIGVDcmVhdGVBbGlnbihpbjIsIGlucGl0Y2gsIC0yLCAmdG1wX2luWzBdWzBdLCBibGt3aWR0aCwgYmxraGVpZ2h0ICsgNSk7Ci0gICAgICAgIGluMiA9ICZ0bXBfaW5bMl1bMF07Ci0gICAgICAgIGl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cmVmOFsyXTsKLSAgICAgICAgICAgIHIwIHw9IChyMTw8MTYpOyAgICAgICAgIHI2ID0gcF9yZWY4WzFdOyAgICAgICAgIHIxID0gcF9yZWY4WzNdOwotICAgICAgICAgICAgcjYgfD0gKHIxPDwxNik7ICAgICAgICAgcF9yZWYrPWlucGl0Y2g7ICovCi0gICAgICAgICAgICByMCA9ICooKHVpbnQzMiopKHBfcmVmIC0gKGlucGl0Y2ggPDwgMSkpKTsgLyogbG9hZCA0IGJ5dGVzICovCi0gICAgICAgICAgICBwX3JlZiArPSBpbnBpdGNoOwotICAgICAgICAgICAgcjYgPSAocjAgPj4gOCkgJiAweEZGMDBGRjsgLyogc2Vjb25kIGFuZCBmb3VydGggYnl0ZSAqLwotICAgICAgICAgICAgcjAgJj0gMHhGRjAwRkY7Ci0KLSAgICAgICAgICAgIC8qcF9yZWY4ID0gcF9yZWYrKGlucGl0Y2g8PDEpOwotICAgICAgICAgICAgcjEgPSBwX3JlZjhbMF07ICAgICAgICAgcjcgPSBwX3JlZjhbMl07ICAgICAgICAgcjEgfD0gKHI3PDwxNik7Ci0gICAgICAgICAgICByNyA9IHBfcmVmOFsxXTsgICAgICAgICByMiA9IHBfcmVmOFszXTsgICAgICAgICByNyB8PSAocjI8PDE2KTsqLwotICAgICAgICAgICAgcjEgPSAqKCh1aW50MzIqKShwX3JlZiArIChpbnBpdGNoIDw8IDEpKSk7ICAvKiByMSwgcjcsIHJlZlszXSAqLwotICAgICAgICAgICAgcjcgPSAocjEgPj4gOCkgJiAweEZGMDBGRjsKLSAgICAgICAgICAgIHIxICY9IDB4RkYwMEZGOwotCi0gICAgICAgICAgICByMCArPSByMTsKLSAgICAgICAgICAgIHI2ICs9IHI3OwotCi0gICAgICAgICAgICAvKnIyID0gcF9yZWZbMF07ICAgICAgICAgICAgcjggPSBwX3JlZlsyXTsgICAgICAgICAgcjIgfD0gKHI4PDwxNik7Ci0gICAgICAgICAgICByOCA9IHBfcmVmWzFdOyAgICAgICAgICByMSA9IHBfcmVmWzNdOyAgICAgICAgICByOCB8PSAocjE8PDE2KTsqLwotICAgICAgICAgICAgcjIgPSAqKCh1aW50MzIqKXBfcmVmKTsgLyogcjIsIHI4LCByZWZbMV0gKi8KLSAgICAgICAgICAgIHI4ID0gKHIyID4+IDgpICYgMHhGRjAwRkY7Ci0gICAgICAgICAgICByMiAmPSAweEZGMDBGRjsKLQotICAgICAgICAgICAgLypwX3JlZjggPSBwX3JlZi1pbnBpdGNoOyAgICAgICAgICAgcjEgPSBwX3JlZjhbMF07ICAgICAgICAgcjcgPSBwX3JlZjhbMl07Ci0gICAgICAgICAgICByMSB8PSAocjc8PDE2KTsgICAgICAgICByMSArPSByMjsgICAgICAgICAgIHI3ID0gcF9yZWY4WzFdOwotICAgICAgICAgICAgcjIgPSBwX3JlZjhbM107ICAgICAgICAgcjcgfD0gKHIyPDwxNik7Ki8KLSAgICAgICAgICAgIHIxID0gKigodWludDMyKikocF9yZWYgLSBpbnBpdGNoKSk7IC8qIHIxLCByNywgcmVmWzBdICovCi0gICAgICAgICAgICByNyA9IChyMSA+PiA4KSAmIDB4RkYwMEZGOwotICAgICAgICAgICAgcjEgJj0gMHhGRjAwRkY7Ci0gICAgICAgICAgICByMSArPSByMjsKLQotICAgICAgICAgICAgcjcgKz0gcjg7Ci0KLSAgICAgICAgICAgIHIwICs9IDIwICogcjE7Ci0gICAgICAgICAgICByNiArPSAyMCAqIHI3OwotICAgICAgICAgICAgcjAgKz0gMHgxMDAwMTA7Ci0gICAgICAgICAgICByNiArPSAweDEwMDAxMDsKLQotICAgICAgICAgICAgLypwX3JlZjggPSBwX3JlZi0oaW5waXRjaDw8MSk7ICAgICAgICAgIHIyID0gcF9yZWY4WzBdOyAgICAgICAgIHI4ID0gcF9yZWY4WzJdOwotICAgICAgICAgICAgcjIgfD0gKHI4PDwxNik7ICAgICAgICAgcjggPSBwX3JlZjhbMV07ICAgICAgICAgcjEgPSBwX3JlZjhbM107ICAgICAgICAgcjggfD0gKHIxPDwxNik7Ki8KLSAgICAgICAgICAgIHIyID0gKigodWludDMyKikocF9yZWYgLSAoaW5waXRjaCA8PCAxKSkpOyAvKiByMiwgcjgsIHJlZlstMV0gKi8KLSAgICAgICAgICAgIHI4ID0gKHIyID4+IDgpICYgMHhGRjAwRkY7Ci0gICAgICAgICAgICByMiAmPSAweEZGMDBGRjsKLQotICAgICAgICAgICAgLypwX3JlZjggPSBwX3JlZitpbnBpdGNoOyAgICAgICAgICAgcjEgPSBwX3JlZjhbMF07ICAgICAgICAgcjcgPSBwX3JlZjhbMl07Ci0gICAgICAgICAgICByMSB8PSAocjc8PDE2KTsgICAgICAgICByMSArPSByMjsgICAgICAgICAgIHI3ID0gcF9yZWY4WzFdOwotICAgICAgICAgICAgcjIgPSBwX3JlZjhbM107ICAgICAgICAgcjcgfD0gKHIyPDwxNik7Ki8KLSAgICAgICAgICAgIHIxID0gKigodWludDMyKikocF9yZWYgKyBpbnBpdGNoKSk7IC8qIHIxLCByNywgcmVmWzJdICovCi0gICAgICAgICAgICByNyA9IChyMSA+PiA4KSAmIDB4RkYwMEZGOwotICAgICAgICAgICAgcjEgJj0gMHhGRjAwRkY7Ci0gICAgICAgICAgICByMSArPSByMjsKLQotICAgICAgICAgICAgcjcgKz0gcjg7Ci0KLSAgICAgICAgICAgIHIwIC09IDUgKiByMTsKLSAgICAgICAgICAgIHI2IC09IDUgKiByNzsKLQotICAgICAgICAgICAgcjAgPj49IDU7Ci0gICAgICAgICAgICByNiA+Pj0gNTsKLSAgICAgICAgICAgIC8qIGNsaXAgKi8KLSAgICAgICAgICAgIHIxMyB8PSByNjsKLSAgICAgICAgICAgIHIxMyB8PSByMDsKLSAgICAgICAgICAgIC8vQ0xJUFBBQ0socjYscmVzdWx0KQotICAgICAgICAgICAgLyogYWRkIHdpdGggaG9yaXpvbnRhbCByZXN1bHRzICovCi0gICAgICAgICAgICByMTAgPSAqKCh1aW50MzIqKShwX3RtcDggKz0gMjQpKTsKLSAgICAgICAgICAgIHI5ID0gKHIxMCA+PiA4KSAmIDB4RkYwMEZGOwotICAgICAgICAgICAgcjEwICY9IDB4RkYwMEZGOwotCi0gICAgICAgICAgICByMCArPSByMTA7Ci0gICAgICAgICAgICByMCArPSAweDEwMDAxOwotICAgICAgICAgICAgcjAgPSAocjAgPj4gMSkgJiAweEZGMDBGRjsgICAvKiBtYXNrIHRvIDggYnl0ZXMgKi8KLQotICAgICAgICAgICAgcjYgKz0gcjk7Ci0gICAgICAgICAgICByNiArPSAweDEwMDAxOwotICAgICAgICAgICAgcjYgPSAocjYgPj4gMSkgJiAweEZGMDBGRjsgICAvKiBtYXNrIHRvIDggYnl0ZXMgKi8KLQotICAgICAgICAgICAgcjAgfD0gKHI2IDw8IDgpOyAgLyogcGFjayBpdCBiYWNrICovCi0gICAgICAgICAgICAqKCh1aW50MzIqKShwX2N1ciArPSBvdXRwaXRjaCkpID0gcjA7Ci0gICAgICAgIH0KLSAgICAgICAgcF9jdXIgKz0gY3Vycl9vZmZzZXQ7IC8qIG9mZnNldCB0byB0aGUgbmV4dCBwaXhlbCAqLwotICAgICAgICBpZiAocjEzICYgMHhGRjAwMDcwMCkgLyogdGhpcyBjb2x1bW4gbmVlZCBjbGlwcGluZyAqLwotICAgICAgICB7Ci0gICAgICAgICAgICBwX2N1ciAtPSA0OwotICAgICAgICAgICAgZm9yIChpID0gMDsgaSA8IDQ7IGkrKykKLSAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICBwX3JlZiA9IGluMiArIGk7Ci0gICAgICAgICAgICAgICAgcF90bXA4ID0gJih0bXBfcmVzWzBdW2oraV0pOyAvKiBpbnRlcm1lZGlhdGUgcmVzdWx0ICovCi0gICAgICAgICAgICAgICAgcF90bXA4IC09IDI0OyAgLyogY29tcGVuc2F0ZSBmb3IgdGhlIGZpcnN0IG9mZnNldCAqLwotICAgICAgICAgICAgICAgIHBfY3VyIC09IG91dHBpdGNoOyAgLyogY29tcGVuc2F0ZSBmb3IgdGhlIGZpcnN0IG9mZnNldCAqLwotICAgICAgICAgICAgICAgIHRtcCA9ICh1aW50MzIpKHBfcmVmICsgcGtyZXMpOyAvKiBsaW1pdCAqLwotICAgICAgICAgICAgICAgIHdoaWxlICgodWludDMyKXBfcmVmIDwgdG1wKSAgLyogdGhlIGxvb3AgdW4tcm9sbGVkICAqLwotICAgICAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAgICAgcjAgPSAqKHBfcmVmIC0gKGlucGl0Y2ggPDwgMSkpOwotICAgICAgICAgICAgICAgICAgICByMSA9ICoocF9yZWYgLSBpbnBpdGNoKTsKLSAgICAgICAgICAgICAgICAgICAgcjIgPSAqcF9yZWY7Ci0gICAgICAgICAgICAgICAgICAgIHIzID0gKihwX3JlZiArPSBpbnBpdGNoKTsgIC8qIG1vZGlmeSBwb2ludGVyIGJlZm9yZSBsb2FkaW5nICovCi0gICAgICAgICAgICAgICAgICAgIHI0ID0gKihwX3JlZiArPSBpbnBpdGNoKTsKLSAgICAgICAgICAgICAgICAgICAgLyogZmlyc3QgcGl4ZWwgKi8KLSAgICAgICAgICAgICAgICAgICAgcjUgPSAqKHBfcmVmICs9IGlucGl0Y2gpOwotICAgICAgICAgICAgICAgICAgICByZXN1bHQgPSAocjAgKyByNSk7Ci0gICAgICAgICAgICAgICAgICAgIHIwID0gKHIxICsgcjQpOwotICAgICAgICAgICAgICAgICAgICByZXN1bHQgLT0gKHIwICogNSk7Ly9yZXN1bHQgLT0gcjA7ICByZXN1bHQgLT0gKHIwPDwyKTsKLSAgICAgICAgICAgICAgICAgICAgcjAgPSAocjIgKyByMyk7Ci0gICAgICAgICAgICAgICAgICAgIHJlc3VsdCArPSAocjAgKiAyMCk7Ly9yZXN1bHQgKz0gKHIwPDw0KTsgICAgcmVzdWx0ICs9IChyMDw8Mik7Ci0gICAgICAgICAgICAgICAgICAgIHJlc3VsdCA9IChyZXN1bHQgKyAxNikgPj4gNTsKLSAgICAgICAgICAgICAgICAgICAgQ0xJUF9SRVNVTFQocmVzdWx0KQotICAgICAgICAgICAgICAgICAgICB0bXBfcmVzdWx0ID0gKihwX3RtcDggKz0gMjQpOyAgLyogbW9kaWZ5IHBvaW50ZXIgYmVmb3JlIGxvYWRpbmcgKi8KLSAgICAgICAgICAgICAgICAgICAgcmVzdWx0ID0gKHJlc3VsdCArIHRtcF9yZXN1bHQgKyAxKTsgIC8qIG5vIGNsaXAgKi8KLSAgICAgICAgICAgICAgICAgICAgcmVzdWx0ID0gKHJlc3VsdCA+PiAxKTsKLSAgICAgICAgICAgICAgICAgICAgKihwX2N1ciArPSBvdXRwaXRjaCkgPSByZXN1bHQ7Ci0gICAgICAgICAgICAgICAgICAgIC8qIHNlY29uZCBwaXhlbCAqLwotICAgICAgICAgICAgICAgICAgICByMCA9ICoocF9yZWYgKz0gaW5waXRjaCk7Ci0gICAgICAgICAgICAgICAgICAgIHJlc3VsdCA9IChyMSArIHIwKTsKLSAgICAgICAgICAgICAgICAgICAgcjEgPSAocjIgKyByNSk7Ci0gICAgICAgICAgICAgICAgICAgIHJlc3VsdCAtPSAocjEgKiA1KTsvL3Jlc3VsdCAtPSByMTsgIHJlc3VsdCAtPSAocjE8PDIpOwotICAgICAgICAgICAgICAgICAgICByMSA9IChyMyArIHI0KTsKLSAgICAgICAgICAgICAgICAgICAgcmVzdWx0ICs9IChyMSAqIDIwKTsvL3Jlc3VsdCArPSAocjE8PDQpOyAgICByZXN1bHQgKz0gKHIxPDwyKTsKLSAgICAgICAgICAgICAgICAgICAgcmVzdWx0ID0gKHJlc3VsdCArIDE2KSA+PiA1OwotICAgICAgICAgICAgICAgICAgICBDTElQX1JFU1VMVChyZXN1bHQpCi0gICAgICAgICAgICAgICAgICAgIHRtcF9yZXN1bHQgPSAqKHBfdG1wOCArPSAyNCk7ICAvKiBpbnRlcm1lZGlhdGUgcmVzdWx0ICovCi0gICAgICAgICAgICAgICAgICAgIHJlc3VsdCA9IChyZXN1bHQgKyB0bXBfcmVzdWx0ICsgMSk7ICAvKiBubyBjbGlwICovCi0gICAgICAgICAgICAgICAgICAgIHJlc3VsdCA9IChyZXN1bHQgPj4gMSk7Ci0gICAgICAgICAgICAgICAgICAgICoocF9jdXIgKz0gb3V0cGl0Y2gpID0gcmVzdWx0OwotICAgICAgICAgICAgICAgICAgICAvKiB0aGlyZCBwaXhlbCAqLwotICAgICAgICAgICAgICAgICAgICByMSA9ICoocF9yZWYgKz0gaW5waXRjaCk7Ci0gICAgICAgICAgICAgICAgICAgIHJlc3VsdCA9IChyMiArIHIxKTsKLSAgICAgICAgICAgICAgICAgICAgcjIgPSAocjMgKyByMCk7Ci0gICAgICAgICAgICAgICAgICAgIHJlc3VsdCAtPSAocjIgKiA1KTsvL3Jlc3VsdCAtPSByMjsgIHJlc3VsdCAtPSAocjI8PDIpOwotICAgICAgICAgICAgICAgICAgICByMiA9IChyNCArIHI1KTsKLSAgICAgICAgICAgICAgICAgICAgcmVzdWx0ICs9IChyMiAqIDIwKTsvL3Jlc3VsdCArPSAocjI8PDQpOyAgICByZXN1bHQgKz0gKHIyPDwyKTsKLSAgICAgICAgICAgICAgICAgICAgcmVzdWx0ID0gKHJlc3VsdCArIDE2KSA+PiA1OwotICAgICAgICAgICAgICAgICAgICBDTElQX1JFU1VMVChyZXN1bHQpCi0gICAgICAgICAgICAgICAgICAgIHRtcF9yZXN1bHQgPSAqKHBfdG1wOCArPSAyNCk7ICAvKiBpbnRlcm1lZGlhdGUgcmVzdWx0ICovCi0gICAgICAgICAgICAgICAgICAgIHJlc3VsdCA9IChyZXN1bHQgKyB0bXBfcmVzdWx0ICsgMSk7ICAvKiBubyBjbGlwICovCi0gICAgICAgICAgICAgICAgICAgIHJlc3VsdCA9IChyZXN1bHQgPj4gMSk7Ci0gICAgICAgICAgICAgICAgICAgICoocF9jdXIgKz0gb3V0cGl0Y2gpID0gcmVzdWx0OwotICAgICAgICAgICAgICAgICAgICAvKiBmb3VydGggcGl4ZWwgKi8KLSAgICAgICAgICAgICAgICAgICAgcjIgPSAqKHBfcmVmICs9IGlucGl0Y2gpOwotICAgICAgICAgICAgICAgICAgICByZXN1bHQgPSAocjMgKyByMik7Ci0gICAgICAgICAgICAgICAgICAgIHIzID0gKHI0ICsgcjEpOwotICAgICAgICAgICAgICAgICAgICByZXN1bHQgLT0gKHIzICogNSk7Ly9yZXN1bHQgLT0gcjM7ICByZXN1bHQgLT0gKHIzPDwyKTsKLSAgICAgICAgICAgICAgICAgICAgcjMgPSAocjUgKyByMCk7Ci0gICAgICAgICAgICAgICAgICAgIHJlc3VsdCArPSAocjMgKiAyMCk7Ly9yZXN1bHQgKz0gKHIzPDw0KTsgICAgcmVzdWx0ICs9IChyMzw8Mik7Ci0gICAgICAgICAgICAgICAgICAgIHJlc3VsdCA9IChyZXN1bHQgKyAxNikgPj4gNTsKLSAgICAgICAgICAgICAgICAgICAgQ0xJUF9SRVNVTFQocmVzdWx0KQotICAgICAgICAgICAgICAgICAgICB0bXBfcmVzdWx0ID0gKihwX3RtcDggKz0gMjQpOyAgLyogaW50ZXJtZWRpYXRlIHJlc3VsdCAqLwotICAgICAgICAgICAgICAgICAgICByZXN1bHQgPSAocmVzdWx0ICsgdG1wX3Jlc3VsdCArIDEpOyAgLyogbm8gY2xpcCAqLwotICAgICAgICAgICAgICAgICAgICByZXN1bHQgPSAocmVzdWx0ID4+IDEpOwotICAgICAgICAgICAgICAgICAgICAqKHBfY3VyICs9IG91dHBpdGNoKSA9IHJlc3VsdDsKLSAgICAgICAgICAgICAgICAgICAgcF9yZWYgLT0gKGlucGl0Y2ggPDwgMSk7ICAvKiBtb3ZlIGJhY2sgdG8gY2VudGVyIG9mIHRoZSBmaWx0ZXIgb2YgdGhlIG5leHQgb25lICovCi0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgIHBfY3VyICs9IChjdXJyX29mZnNldCAtIDMpOwotICAgICAgICAgICAgfQotICAgICAgICB9Ci0gICAgfQotCi0gICAgcmV0dXJuIDsKLX0KLQotLyogcG9zaXRpb24gRyAqLwotdm9pZCBlRnVsbFBlbE1DKHVpbnQ4ICppbiwgaW50IGlucGl0Y2gsIHVpbnQ4ICpvdXQsIGludCBvdXRwaXRjaCwKLSAgICAgICAgICAgICAgICBpbnQgYmxrd2lkdGgsIGludCBibGtoZWlnaHQpCi17Ci0gICAgaW50IGksIGo7Ci0gICAgaW50IG9mZnNldF9pbiA9IGlucGl0Y2ggLSBibGt3aWR0aDsKLSAgICBpbnQgb2Zmc2V0X291dCA9IG91dHBpdGNoIC0gYmxrd2lkdGg7Ci0gICAgdWludDMyIHRlbXA7Ci0gICAgdWludDggYnl0ZTsKLQotICAgIGlmICgoKHVpbnQzMilpbikmMykKLSAgICB7Ci0gICAgICAgIGZvciAoaiA9IGJsa2hlaWdodDsgaiA+IDA7IGotLSkKLSAgICAgICAgewotICAgICAgICAgICAgZm9yIChpID0gYmxrd2lkdGg7IGkgPiAwOyBpIC09IDQpCi0gICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgdGVtcCA9ICppbisrOwotICAgICAgICAgICAgICAgIGJ5dGUgPSAqaW4rKzsKLSAgICAgICAgICAgICAgICB0ZW1wIHw9IChieXRlIDw8IDgpOwotICAgICAgICAgICAgICAgIGJ5dGUgPSAqaW4rKzsKLSAgICAgICAgICAgICAgICB0ZW1wIHw9IChieXRlIDw8IDE2KTsKLSAgICAgICAgICAgICAgICBieXRlID0gKmluKys7Ci0gICAgICAgICAgICAgICAgdGVtcCB8PSAoYnl0ZSA8PCAyNCk7Ci0KLSAgICAgICAgICAgICAgICAqKCh1aW50MzIqKW91dCkgPSB0ZW1wOyAvKiB3cml0ZSA0IGJ5dGVzICovCi0gICAgICAgICAgICAgICAgb3V0ICs9IDQ7Ci0gICAgICAgICAgICB9Ci0gICAgICAgICAgICBvdXQgKz0gb2Zmc2V0X291dDsKLSAgICAgICAgICAgIGluICs9IG9mZnNldF9pbjsKLSAgICAgICAgfQotICAgIH0KLSAgICBlbHNlCi0gICAgewotICAgICAgICBmb3IgKGogPSBibGtoZWlnaHQ7IGogPiAwOyBqLS0pCi0gICAgICAgIHsKLSAgICAgICAgICAgIGZvciAoaSA9IGJsa3dpZHRoOyBpID4gMDsgaSAtPSA0KQotICAgICAgICAgICAgewotICAgICAgICAgICAgICAgIHRlbXAgPSAqKCh1aW50MzIqKWluKTsKLSAgICAgICAgICAgICAgICAqKCh1aW50MzIqKW91dCkgPSB0ZW1wOwotICAgICAgICAgICAgICAgIGluICs9IDQ7Ci0gICAgICAgICAgICAgICAgb3V0ICs9IDQ7Ci0gICAgICAgICAgICB9Ci0gICAgICAgICAgICBvdXQgKz0gb2Zmc2V0X291dDsKLSAgICAgICAgICAgIGluICs9IG9mZnNldF9pbjsKLSAgICAgICAgfQotICAgIH0KLSAgICByZXR1cm4gOwotfQotCi12b2lkIGVQYWRDaHJvbWEodWludDggKnJlZiwgaW50IHBpY3dpZHRoLCBpbnQgcGljaGVpZ2h0LCBpbnQgcGljcGl0Y2gsIGludCB4X3BvcywgaW50IHlfcG9zKQotewotICAgIGludCBwYWRfaGVpZ2h0OwotICAgIGludCBwYWRfd2lkdGg7Ci0gICAgdWludDggKnN0YXJ0OwotICAgIHVpbnQzMiB3b3JkMSwgd29yZDIsIHdvcmQzOwotICAgIGludCBvZmZzZXQsIGo7Ci0KLQotICAgIHBhZF9oZWlnaHQgPSA4ICsgKCh5X3BvcyAmIDcpID8gMSA6IDApOwotICAgIHBhZF93aWR0aCA9IDggKyAoKHhfcG9zICYgNykgPyAxIDogMCk7Ci0KLSAgICB5X3BvcyA+Pj0gMzsKLSAgICB4X3BvcyA+Pj0gMzsKLSAgICAvLyBwYWQgdmVydGljYWwgZmlyc3QKLSAgICBpZiAoeV9wb3MgPCAwKSAvLyBuZWVkIHRvIHBhZCB1cAotICAgIHsKLSAgICAgICAgaWYgKHhfcG9zIDwgLTgpIHN0YXJ0ID0gcmVmIC0gODsKLSAgICAgICAgZWxzZSBpZiAoeF9wb3MgKyBwYWRfd2lkdGggPiBwaWN3aWR0aCArIDcpIHN0YXJ0ID0gcmVmICsgcGljd2lkdGggKyA3IC0gcGFkX3dpZHRoOwotICAgICAgICBlbHNlIHN0YXJ0ID0gcmVmICsgeF9wb3M7Ci0KLSAgICAgICAgLyogd29yZC1hbGlnbiBzdGFydCAqLwotICAgICAgICBvZmZzZXQgPSAodWludDMyKXN0YXJ0ICYgMHgzOwotICAgICAgICBpZiAob2Zmc2V0KSBzdGFydCAtPSBvZmZzZXQ7Ci0KLSAgICAgICAgd29yZDEgPSAqKCh1aW50MzIqKXN0YXJ0KTsKLSAgICAgICAgd29yZDIgPSAqKCh1aW50MzIqKShzdGFydCArIDQpKTsKLSAgICAgICAgd29yZDMgPSAqKCh1aW50MzIqKShzdGFydCArIDgpKTsKLQotICAgICAgICAvKiBwYWQgdXAgTiByb3dzICovCi0gICAgICAgIGogPSAteV9wb3M7Ci0gICAgICAgIGlmIChqID4gOCkgaiA9IDg7Ci0gICAgICAgIHdoaWxlIChqLS0pCi0gICAgICAgIHsKLSAgICAgICAgICAgICooKHVpbnQzMiopKHN0YXJ0IC09IHBpY3BpdGNoKSkgPSB3b3JkMTsKLSAgICAgICAgICAgICooKHVpbnQzMiopKHN0YXJ0ICsgNCkpID0gd29yZDI7Ci0gICAgICAgICAgICAqKCh1aW50MzIqKShzdGFydCArIDgpKSA9IHdvcmQzOwotICAgICAgICB9Ci0KLSAgICB9Ci0gICAgZWxzZSBpZiAoeV9wb3MgKyBwYWRfaGVpZ2h0ID49IHBpY2hlaWdodCkgLyogcGFkIGRvd24gKi8KLSAgICB7Ci0gICAgICAgIGlmICh4X3BvcyA8IC04KSBzdGFydCA9IHJlZiArIHBpY3BpdGNoICogKHBpY2hlaWdodCAtIDEpIC0gODsKLSAgICAgICAgZWxzZSBpZiAoeF9wb3MgKyBwYWRfd2lkdGggPiBwaWN3aWR0aCArIDcpIHN0YXJ0ID0gcmVmICsgcGljcGl0Y2ggKiAocGljaGVpZ2h0IC0gMSkgKwotICAgICAgICAgICAgICAgICAgICBwaWN3aWR0aCArIDcgLSBwYWRf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ICAgIHN0YXJ0IC09IHBpY3BpdGNoOwotICAgICAgICB3aGlsZSAoai0tKQotICAgICAgICB7Ci0gICAgICAgICAgICB3b3JkMSA9ICooc3RhcnQgKz0gcGljcGl0Y2gpOwotICAgICAgICAgICAgd29yZDEgfD0gKHdvcmQxIDw8IDgpOwotICAgICAgICAgICAgd29yZDEgfD0gKHdvcmQxIDw8IDE2KTsKLSAgICAgICAgICAgICooKHVpbnQzMiopKHN0YXJ0ICsgMSkpID0gd29yZDE7Ci0gICAgICAgICAgICAqKCh1aW50MzIqKShzdGFydCArIDUpKSA9IHdvcmQxOwotICAgICAgICB9Ci0gICAgfQotCi0gICAgcmV0dXJuIDsKLX0KLQotCi12b2lkIGVDaHJvbWFNb3Rpb25Db21wKHVpbnQ4ICpyZWYsIGludCBwaWN3aWR0aCwgaW50IHBpY2hlaWdodCwKLSAgICAgICAgICAgICAgICAgICAgICAgaW50IHhfcG9zLCBpbnQgeV9wb3MsCi0gICAgICAgICAgICAgICAgICAgICAgIHVpbnQ4ICpwcmVkLCBpbnQgcGljcGl0Y2gsCi0gICAgICAgICAgICAgICAgICAgICAgIGludCBibGt3aWR0aCwgaW50IGJsa2hlaWdodCkKLXsKLSAgICBpbnQgZHgsIGR5OwotICAgIGludCBvZmZzZXRfZHgsIG9mZnNldF9keTsKLSAgICBpbnQgaW5kZXg7Ci0KLSAgICBlUGFkQ2hyb21hKHJlZiwgcGljd2lkdGgsIHBpY2hlaWdodCwgcGljcGl0Y2gsIHhfcG9zLCB5X3Bvcyk7Ci0KLSAgICBkeCA9IHhfcG9zICYgNzsKLSAgICBkeSA9IHlfcG9zICYgNzsKLSAgICBvZmZzZXRfZHggPSAoZHggKyA3KSA+PiAzOwotICAgIG9mZnNldF9keSA9IChkeSArIDcpID4+IDM7Ci0gICAgeF9wb3MgPSB4X3BvcyA+PiAzOyAgLyogcm91bmQgaXQgdG8gZnVsbC1wZWwgcmVzb2x1dGlvbiAqLwotICAgIHlfcG9zID0geV9wb3MgPj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AgICAgICAgcjAgfD0gKHJlZlsyXSA8PCAxNik7Ci0gICAgICAgICAgICByZXN1bHQwID0gZHhfOCAqIHIwOwotCi0gICAgICAgICAgICByMSA9IHJlZlsxXSB8IChyZWZbM10gPDwgMTYpOwotICAgICAgICAgICAgcmVzdWx0MCArPSBkeCAqIHIxOwotICAgICAgICAgICAgKihpbnQzMiAqKW91dCA9IHJlc3VsdDA7Ci0KLSAgICAgICAgICAgIHJlc3VsdDAgPSBkeF84ICogcjE7Ci0KLSAgICAgICAgICAgIHIyID0gcmVmWzRdOwotICAgICAgICAgICAgcjAgPSByMCA+PiAxNjsKLSAgICAgICAgICAgIHIxID0gcjAgfCAocjIgPDwgMTYpOwotICAgICAgICAgICAgcmVzdWx0MCArPSBkeCAqIHIxOwotICAgICAgICAgICAgKihpbnQzMiAqKShvdXQgKyAxNikgPSByZXN1bHQwOwotCi0gICAgICAgICAgICByZWYgKz0gNDsKLSAgICAgICAgICAgIG91dCArPSA0OwotICAgICAgICAgICAgcjAgPSByMjsKLSAgICAgICAgfQotICAgICAgICBwUmVmICs9IHNyY1BpdGNoOwotICAgICAgICBvdXQgKz0gKDMyIC0gYmxrd2lkdGgpOwotICAgIH0KLQotLy8gIHBSZWYgLT0gc3JjUGl0Y2gqKGJsa2hlaWdodCsxKTsKLSAgICByZWYgPSB0ZW1wOwotCi0gICAgZm9yIChqID0gMDsgaiA8IGJsa3dpZHRoOyBqICs9IDQpCi0gICAgewotICAgICAgICByMCA9ICooaW50MzIgKilyZWY7Ci0gICAgICAgIHIxID0gKihpbnQzMiAqKShyZWYgKyAxNik7Ci0gICAgICAgIHJlZiArPSAzMjsKLSAgICAgICAgb3V0ID0gcE91dDsKLSAgICAgICAgZm9yIChpID0gMDsgaSA8IChibGtoZWlnaHQgPj4gMSk7IGkrKykKLSAgICAgICAgewotICAgICAgICAgICAgcmVzdWx0MCA9IGR5XzggKiByMCArIDB4MDAyMDAwMjA7Ci0gICAgICAgICAgICByMiA9ICooaW50MzIgKilyZWY7Ci0gICAgICAgICAgICByZXN1bHQwICs9IGR5ICogcjI7Ci0gICAgICAgICAgICByZXN1bHQwID4+PSA2OwotICAgICAgICAgICAgcmVzdWx0MCAmPSAweDAwRkYwMEZGOwotICAgICAgICAgICAgcjAgPSByMjsKLQotICAgICAgICAgICAgcmVzdWx0MSA9IGR5XzggKiByMSArIDB4MDAyMDAwMjA7Ci0gICAgICAgICAgICByMyA9ICooaW50MzIgKikocmVmICsgMTYpOwotICAgICAgICAgICAgcmVzdWx0MSArPSBkeSAqIHIzOwotICAgICAgICAgICAgcmVzdWx0MSA+Pj0gNjsKLSAgICAgICAgICAgIHJlc3VsdDEgJj0gMHgwMEZGMDBGRjsKLSAgICAgICAgICAgIHIxID0gcjM7Ci0gICAgICAgICAgICAqKGludDMyICopb3V0ID0gcmVzdWx0MCB8IChyZXN1bHQxIDw8IDgpOwotICAgICAgICAgICAgb3V0ICs9IHByZWRQaXRjaDsKLSAgICAgICAgICAgIHJlZiArPSAzMjsKLQotICAgICAgICAgICAgcmVzdWx0MCA9IGR5XzggKiByMCArIDB4MDAyMDAwMjA7Ci0gICAgICAgICAgICByMiA9ICooaW50MzIgKilyZWY7Ci0gICAgICAgICAgICByZXN1bHQwICs9IGR5ICogcjI7Ci0gICAgICAgICAgICByZXN1bHQwID4+PSA2OwotICAgICAgICAgICAgcmVzdWx0MCAmPSAweDAwRkYwMEZGOwotICAgICAgICAgICAgcjAgPSByMjsKLQotICAgICAgICAgICAgcmVzdWx0MSA9IGR5XzggKiByMSArIDB4MDAyMDAwMjA7Ci0gICAgICAgICAgICByMyA9ICooaW50MzIgKikocmVmICsgMTYpOwotICAgICAgICAgICAgcmVzdWx0MSArPSBkeSAqIHIzOwotICAgICAgICAgICAgcmVzdWx0MSA+Pj0gNjsKLSAgICAgICAgICAgIHJlc3VsdDEgJj0gMHgwMEZGMDBGRjsKLSAgICAgICAgICAgIHIxID0gcjM7Ci0gICAgICAgICAgICAqKGludDMyICopb3V0ID0gcmVzdWx0MCB8IChyZXN1bHQxIDw8IDgpOwotICAgICAgICAgICAgb3V0ICs9IHByZWRQaXRjaDsKLSAgICAgICAgICAgIHJlZiArPSAzMjsKLSAgICAgICAgfQotICAgICAgICBwT3V0ICs9IDQ7Ci0gICAgICAgIHJlZiA9IHRlbXAgKyA0OyAvKiBzaW5jZSBpdCBjYW4gb25seSBpdGVyYXRlIHR3aWNlIG1heCAqLwotICAgIH0KLSAgICByZXR1cm47Ci19Ci0KLXZvaWQgZUNocm9tYUhvcml6b250YWxNQ19TSU1EKHVpbnQ4ICpwUmVmLCBpbnQgc3JjUGl0Y2gsIGludCBkeCwgaW50IGR5LAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdWludDggKnBPdXQsIGludCBwcmVkUGl0Y2gsIGludCBibGt3aWR0aCwgaW50IGJsa2hlaWdodCkKLXsKLSAgICAodm9pZCkoZHkpOwotCi0gICAgaW50MzIgcjAsIHIxLCByMiwgcmVzdWx0MCwgcmVzdWx0MTsKLSAgICB1aW50OCAqcmVmLCAqb3V0OwotICAgIGludCBpLCBqOwotICAgIGludCBkeF84ID0gOCAtIGR4OwotCi0gICAgLyogaG9yaXpvbnRhbCBmaXJzdCAqLwotICAgIGZvciAoaSA9IDA7IGkgPCBibGtoZWlnaHQ7IGkrKykKLSAgICB7Ci0gICAgICAgIHJlZiA9IHBSZWY7Ci0gICAgICAgIG91dCA9IHBPdXQ7Ci0KLSAgICAgICAgcjAgPSByZWZbMF07Ci0gICAgICAgIGZvciAoaiA9IDA7IGogPCBibGt3aWR0aDsgaiArPSA0KQotICAgICAgICB7Ci0gICAgICAgICAgICByMCB8PSAocmVmWzJdIDw8IDE2KTsKLSAgICAgICAgICAgIHJlc3VsdDAgPSBkeF84ICogcjAgKyAweDAwMDQwMDA0OwotCi0gICAgICAgICAgICByMSA9IHJlZlsxXSB8IChyZWZbM10gPDwgMTYpOwotICAgICAgICAgICAgcmVzdWx0MCArPSBkeCAqIHIxOwotICAgICAgICAgICAgcmVzdWx0MCA+Pj0gMzsKLSAgICAgICAgICAgIHJlc3VsdDAgJj0gMHgwMEZGMDBGRjsKLQotICAgICAgICAgICAgcmVzdWx0MSA9IGR4XzggKiByMSArIDB4MDAwNDAwMDQ7Ci0KLSAgICAgICAgICAgIHIyID0gcmVmWzRdOwotICAgICAgICAgICAgcjAgPSByMCA+PiAxNjsKLSAgICAgICAgICAgIHIxID0gcjAgfCAocjIgPDwgMTYpOwotICAgICAgICAgICAgcmVzdWx0MSArPSBkeCAqIHIxOwotICAgICAgICAgICAgcmVzdWx0MSA+Pj0gMzsKLSAgICAgICAgICAgIHJlc3VsdDEgJj0gMHgwMEZGMDBGRjsKLQotICAgICAgICAgICAgKihpbnQzMiAqKW91dCA9IHJlc3VsdDAgfCAocmVzdWx0MSA8PCA4KTsKLQotICAgICAgICAgICAgcmVmICs9IDQ7Ci0gICAgICAgICAgICBvdXQgKz0gNDsKLSAgICAgICAgICAgIHIwID0gcjI7Ci0gICAgICAgIH0KLQotICAgICAgICBwUmVmICs9IHNyY1BpdGNoOwotICAgICAgICBwT3V0ICs9IHByZWRQaXRjaDsKLSAgICB9Ci0gICAgcmV0dXJuOwotfQotCi12b2lkIGVDaHJvbWFWZXJ0aWNhbE1DX1NJTUQodWludDggKnBSZWYsIGludCBzcmNQaXRjaCwgaW50IGR4LCBpbnQgZHksCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgdWludDggKnBPdXQsIGludCBwcmVkUGl0Y2gsIGludCBibGt3aWR0aCwgaW50IGJsa2hlaWdodCkKLXsKLSAgICAodm9pZCkoZHgpOwotCi0gICAgaW50MzIgcjAsIHIxLCByMiwgcjMsIHJlc3VsdDAsIHJlc3VsdDE7Ci0gICAgaW50IGksIGo7Ci0gICAgdWludDggKnJlZiwgKm91dDsKLSAgICBpbnQgZHlfOCA9IDggLSBkeTsKLSAgICAvKiB2ZXJ0aWNhbCBmaXJzdCAqLwotICAgIGZvciAoaSA9IDA7IGkgPCBibGt3aWR0aDsgaSArPSA0KQotICAgIHsKLSAgICAgICAgcmVmID0gcFJlZjsKLSAgICAgICAgb3V0ID0gcE91dDsKLQotICAgICAgICByMCA9IHJlZlswXSB8IChyZWZbMl0gPDwgMTYpOwotICAgICAgICByMSA9IHJlZlsxXSB8IChyZWZbM10gPDwgMTYpOwotICAgICAgICByZWYgKz0gc3JjUGl0Y2g7Ci0gICAgICAgIGZvciAoaiA9IDA7IGogPCBibGtoZWlnaHQ7IGorKykKLSAgICAgICAgewotICAgICAgICAgICAgcmVzdWx0MCA9IGR5XzggKiByMCArIDB4MDAwNDAwMDQ7Ci0gICAgICAgICAgICByMiA9IHJlZlswXSB8IChyZWZbMl0gPDwgMTYpOwotICAgICAgICAgICAgcmVzdWx0MCArPSBkeSAqIHIyOwotICAgICAgICAgICAgcmVzdWx0MCA+Pj0gMzsKLSAgICAgICAgICAgIHJlc3VsdDAgJj0gMHgwMEZGMDBGRjsKLSAgICAgICAgICAgIHIwID0gcjI7Ci0KLSAgICAgICAgICAgIHJlc3VsdDEgPSBkeV84ICogcjEgKyAweDAwMDQwMDA0OwotICAgICAgICAgICAgcjMgPSByZWZbMV0gfCAocmVmWzNdIDw8IDE2KTsKLSAgICAgICAgICAgIHJlc3VsdDEgKz0gZHkgKiByMzsKLSAgICAgICAgICAgIHJlc3VsdDEgPj49IDM7Ci0gICAgICAgICAgICByZXN1bHQxICY9IDB4MDBGRjAwRkY7Ci0gICAgICAgICAgICByMSA9IHIzOwotICAgICAgICAgICAgKihpbnQzMiAqKW91dCA9IHJlc3VsdDAgfCAocmVzdWx0MSA8PCA4KTsKLSAgICAgICAgICAgIHJlZiArPSBzcmNQaXRjaDsKLSAgICAgICAgICAgIG91dCArPSBwcmVkUGl0Y2g7Ci0gICAgICAgIH0KLSAgICAgICAgcE91dCArPSA0OwotICAgICAgICBwUmVmICs9IDQ7Ci0gICAgfQotICAgIHJldHVybjsKLX0KLQotdm9pZCBlQ2hyb21hRGlhZ29uYWxNQzJfU0lNRCh1aW50OCAq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50IHNyY1BpdGNoLCBpbnQgZHgsIGludCBkeSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdWludDggKnBPdXQsIGludCBwcmVkUGl0Y2gsIGludCBibGt3aWR0aCwgaW50IGJsa2hlaWdodCkKLXsKLSAgICAodm9pZCkoZHgpOwotICAgICh2b2lkKShibGt3aWR0aCk7Ci0KLSAgICBpbnQzMiByMCwgcjEsIHJlc3VsdDsKLSAgICBpbnQgaTsKLSAgICBpbnQgZHlfOCA9IDggLSBkeTsKLSAgICByMCA9IHBSZWZbMF0gfCAocFJlZlsxXSA8PCAxNik7Ci0gICAgcFJlZiArPSBzcmNQaXRjaDsKLSAgICBmb3IgKGkgPSAwOyBpIDwgYmxraGVpZ2h0OyBpKyspCi0gICAgewotICAgICAgICByZXN1bHQgPSBkeV84ICogcjAgKyAweDAwMDQwMDA0OwotICAgICAgICByMSA9IHBSZWZbMF0gfCAocFJlZlsxXSA8PCAxNik7Ci0gICAgICAgIHJlc3VsdCArPSBkeSAqIHIxOwotICAgICAgICByZXN1bHQgPj49IDM7Ci0gICAgICAgIHJlc3VsdCAmPSAweDAwRkYwMEZGOwotICAgICAgICAqKGludDE2ICopcE91dCA9IChyZXN1bHQgPj4gOCkgfCAocmVzdWx0ICYgMHhGRik7Ci0gICAgICAgIHIwID0gcjE7Ci0gICAgICAgIHBSZWYgKz0gc3JjUGl0Y2g7Ci0gICAgICAgIHBPdXQgKz0gcHJlZFBpdGNoOwotICAgIH0KLSAgICByZXR1cm47Ci19Ci0KLXZvaWQgZUNocm9tYUZ1bGxNQ19TSU1EKHVpbnQ4ICpwUmVmLCBpbnQgc3JjUGl0Y2gsIGludCBkeCwgaW50IGR5LAotICAgICAgICAgICAgICAgICAgICAgICAgdWludDggKnBPdXQsIGludCBwcmVkUGl0Y2gsIGludCBibGt3aWR0aCwgaW50IGJsa2hlaWdodCkKLXsKLSAgICAodm9pZCkoZHgpOwotICAgICh2b2lkKShkeSk7Ci0KLSAgICBpbnQgaSwgajsKLSAgICBpbnQgb2Zmc2V0X2luID0gc3JjUGl0Y2ggLSBibGt3aWR0aDsKLSAgICBpbnQgb2Zmc2V0X291dCA9IHByZWRQaXRjaCAtIGJsa3dpZHRoOwotICAgIHVpbnQxNiB0ZW1wOwotICAgIHVpbnQ4IGJ5dGU7Ci0KLSAgICBpZiAoKCh1aW50MzIpcFJlZikmMSkKLSAgICB7Ci0gICAgICAgIGZvciAoaiA9IGJsa2hlaWdodDsgaiA+IDA7IGotLSkKLSAgICAgICAgewotICAgICAgICAgICAgZm9yIChpID0gYmxrd2lkdGg7IGkgPiAwOyBpIC09IDIpCi0gICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgdGVtcCA9ICpwUmVmKys7Ci0gICAgICAgICAgICAgICAgYnl0ZSA9ICpwUmVmKys7Ci0gICAgICAgICAgICAgICAgdGVtcCB8PSAoYnl0ZSA8PCA4KTsKLSAgICAgICAgICAgICAgICAqKCh1aW50MTYqKXBPdXQpID0gdGVtcDsgLyogd3JpdGUgMiBieXRlcyAqLwotICAgICAgICAgICAgICAgIHBPdXQgKz0gMjsKLSAgICAgICAgICAgIH0KLSAgICAgICAgICAgIHBPdXQgKz0gb2Zmc2V0X291dDsKLSAgICAgICAgICAgIHBSZWYgKz0gb2Zmc2V0X2luOwotICAgICAgICB9Ci0gICAgfQotICAgIGVsc2UKLSAgICB7Ci0gICAgICAgIGZvciAoaiA9IGJsa2hlaWdodDsgaiA+IDA7IGotLSkKLSAgICAgICAgewotICAgICAgICAgICAgZm9yIChpID0gYmxrd2lkdGg7IGkgPiAwOyBpIC09IDIpCi0gICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgdGVtcCA9ICooKHVpbnQxNiopcFJlZik7Ci0gICAgICAgICAgICAgICAgKigodWludDE2KilwT3V0KSA9IHRlbXA7Ci0gICAgICAgICAgICAgICAgcFJlZiArPSAyOwotICAgICAgICAgICAgICAgIHBPdXQgKz0gMjsKLSAgICAgICAgICAgIH0KLSAgICAgICA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Ci0KLSAgICAgICAgICAgIG1ibnVtID0gaiAqIG1id2lkdGggKyBzdGFydF9pOwotCi0gICAgICAgICAgICBmb3IgKGkgPSBzdGFydF9pOyBpIDwgbWJ3aWR0aDsgaSArPSBpbmNyX2kpCi0gICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgdmlkZW8tPm1iTnVtID0gbWJudW07Ci0gICAgICAgICAgICAgICAgdmlkZW8tPmN1cnJNQiA9IGN1cnJNQiA9IG1ibG9jayArIG1ibnVtOwotICAgICAgICAgICAgICAgIG1vdF9tYl8xNngxNiA9IG1vdDE2eDE2ICsgbWJudW07Ci0KLSAgICAgICAgICAgICAgICBjdXIgPSBjdXJySW5wdXQtPllDYkNyWzBdICsgb2Zmc2V0OwotCi0gICAgICAgICAgICAgICAgaWYgKGN1cnJNQi0+bWJfaW50cmEgPT0gMCkgLyogZm9yIElOVEVSIG1vZGUgKi8KLSAgICAgICAgICAgICAgICB7Ci0jaWYgZGVmaW5lZChIVEZNKQotICAgICAgICAgICAgICAgICAgICBIVEZNUHJlcGFyZUN1ck1CX0FWQyhlbmN2aWQsICZodGZtX3N0YXQsIGN1ciwgcGl0Y2gpOwotI2Vsc2UKLSAgICAgICAgICAgICAgICAgICAgQVZDUHJlcGFyZUN1ck1CKGVuY3ZpZCwgY3VyLCBwaXRjaCk7Ci0jZW5kaWYKLSAgICAgICAgICAgICAgICAgICAgLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLSAgICAgICAgICAgICAgICAgICAgLyoqKioqKioqIGZ1bGwtcGVsIDFNViBzZWFyY2ggKioqKioqKioqKioqKioqKioqKioqKi8KLQotICAgICAgICAgICAgICAgICAgICBBVkNNQk1vdGlvblNlYXJjaChlbmN2aWQsIGN1ciwgYmVzdF9jYW5kLCBpIDw8IDQsIGogPDwgNCwgdHlwZV9wcmVkLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBGU19lbiwgJmhwX2d1ZXNzKTsKLQotICAgICAgICAgICAgICAgICAgICBhYmVfY29zdCA9IGVuY3ZpZC0+bWluX2Nvc3RbbWJudW1dID0gbW90X21iXzE2eDE2LT5zYWQ7Ci0KLSAgICAgICAgICAgICAgICAgICAgLyogc2V0IG1iTW9kZSBhbmQgTVZzICovCi0gICAgICAgICAgICAgICAgICAgIGN1cnJNQi0+bWJNb2RlID0gQVZDX1AxNjsKLSAgICAgICAgICAgICAgICAgICAgY3Vyck1CLT5NQlBhcnRQcmVkTW9kZVswXVswXSA9IEFWQ19QcmVkX0wwOwotICAgICAgICAgICAgICAgICAgICBtdl91aW50MzIgPSAoKG1vdF9tYl8xNngxNi0+eSkgPDwgMTYpIHwgKChtb3RfbWJfMTZ4MTYtPngpICYgMHhmZmZmKTsKLSAgICAgICAgICAgICAgICAgICAgZm9yIChrID0gMDsgayA8IDMyOyBrICs9IDIpCi0gICAgICAgICAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAgICAgICAgIGN1cnJNQi0+bXZMMFtrPj4xXSA9IG12X3VpbnQzMjsKLSAgICAgICAgICAgICAgICAgICAgfQotCi0gICAgICAgICAgICAgICAgICAgIC8qIG1ha2UgYSBkZWNpc2lvbiB3aGV0aGVyIGl0IHNob3VsZCBiZSB0ZXN0ZWQgZm9yIGludHJhIG9yIG5vdCAqLwotICAgICAgICAgICAgICAgICAgICBpZiAoaSAhPSBtYndpZHRoIC0gMSAmJiBqICE9IG1iaGVpZ2h0IC0gMSAmJiBpICE9IDAgJiYgaiAhPSAwKQotICAgICAgICAgICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgICAgICAgICBpZiAoZmFsc2UgPT0gSW50cmFEZWNpc2lvbkFCRSgmYWJlX2Nvc3QsIGN1ciwgcGl0Y2gsIHRydWUpKQotICAgICAgICAgICAgICAgICAgICAgICAgewotICAgICAgICAgICAgICAgICAgICAgICAgICAgIGludHJhU2VhcmNoW21ibnVtXSA9IDA7Ci0gICAgICAgICAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgICAgICAgICBlbHNlCi0gICAgICAgICAgICAgICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgTnVtSW50cmFTZWFyY2grKzsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICByYXRlQ3RybC0+TUFEb2ZNQlttYm51bV0gPSBhYmVfY29zdDsKLSAgICAgICAgICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgICAgICBlbHNlIC8vIGJvdW5kYXJ5IE1CcywgYWx3YXlzIGRvIGludHJhIHNlYXJjaAotICAgICAgICAgICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgICAgICAgICBOdW1JbnRyYVNlYXJjaCsrOwotICAgICAgICAgICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgICAgICAgICAgdG90YWxTQUQgKz0gKGludCkgcmF0ZUN0cmwtPk1BRG9mTUJbbWJudW1dOy8vbW90X21iXzE2eDE2LT5zYWQ7Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgIGVsc2UgICAgLyogSU5UUkEgdXBkYXRlLCB1c2UgZm9yIHByZWRpY3Rpb24gKi8KLSAgICAgICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgICAgIG1vdF9tYl8xNngxNlswXS54ID0gbW90X21iXzE2eDE2WzBdLnkgPSAwOwotCi0gICAgICAgICAgICAgICAgICAgIC8qIHJlc2V0IGFsbCBvdGhlciBNVnMgdG8gemVybyAqLwotICAgICAgICAgICAgICAgICAgICAvKiBtb3RfbWJfMTZ4OCwgbW90X21iXzh4MTYsIG1vdF9tYl84eDgsIGV0Yy4gKi8KLSAgICAgICAgICAgICAgICAgICAgYWJlX2Nvc3QgPSBlbmN2aWQtPm1pbl9jb3N0W21ibnVtXSA9IDB4N0ZGRkZGRkY7ICAvKiBtYXggdmFsdWUgZm9yIGludCAqLwotCi0gICAgICAgICAgICAgICAgICAgIGlmIChpICE9IG1id2lkdGggLSAxICYmIGogIT0gbWJoZWlnaHQgLSAxICYmIGkgIT0gMCAmJiBqICE9IDApCi0gICAgICAgICAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAgICAgICAgIEludHJhRGVjaXNpb25BQkUoJmFiZV9jb3N0LCBjdXIsIHBpdGNoLCBmYWxzZSk7Ci0KLSAgICAgICAgICAgICAgICAgICAgICAgIHJhdGVDdHJsLT5NQURvZk1CW21ibnVtXSA9IGFiZV9jb3N0OwotICAgICAgICAgICAgICAgICAgICAgICAgdG90YWxTQUQgKz0gYWJlX2Nvc3Q7Ci0gICAgICAgICAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgICAgICAgICBOdW1JbnRyYVNlYXJjaCsrIDsKLSAgICAgICAgICAgICAgICAgICAgLyogY2Fubm90IGRvIEkxNiBwcmVkaWN0aW9uIGhlcmUgYmVjYXVzZSBpdCBuZWVkcyBmdWxsIGRlY29kaW5nLiAqLwotICAgICAgICAgICAgICAgICAgICAvLyBpbnRyYVNlYXJjaFttYm51bV0gPSAxOwotCi0gICAgICAgICAgICAgICAgfQotCi0gICAgICAgICAgICAgICAgbWJudW0gKz0gaW5jcl9pOwotICAgICAgICAgICAgICAgIG9mZnNldCArPSAoaW5jcl9pIDw8IDQpOwotCi0gICAgICAgICAgICB9IC8qIGZvciBpICovCi0gICAgICAgIH0gLyogZm9yIGogKi8KLQotICAgICAgICAvKiBzaW5jZSB3ZSBjYW5ub3QgZG8gaW50cmEvaW50ZXIgZGVjaXNpb24gaGVyZSwgdGhlIFNDRCBoYXMgdG8gYmUKLSAgICAgICAgYmFzZWQgb24gb3RoZXIgY3JpdGVyaWEgc3VjaCBhcyBtb3Rpb24gdmVjdG9ycyBjb2hlcmVuY3kgb3IgdGhlIFNBRCAqLwotICAgICAgICBpZiAoaW5jcl9pID4gMSAmJiBudW1Mb29wKSAvKiBzY2VuZSBjaGFuZ2Ugb24gYW5kIGZpcnN0IGxvb3AgKi8KLSAgICAgICAgewotICAgICAgICAgICAgLy9pZihOdW1JbnRyYVNlYXJjaCA+ICgodG90YWxNQj4+Myk8PDEpICsgKHRvdGFsTUI+PjMpKSAvKiA3NSUgb2YgNTAlTUJzICovCi0gICAgICAgICAgICBpZiAoTnVtSW50cmFTZWFyY2gqOTkgPiAoNDgqdG90YWxNQikpIC8qIDIwJSBvZiA1MCVNQnMgKi8KLSAgICAgICAgICAgICAgICAvKiBuZWVkIHRvIGRvIG1vcmUgaW52ZXN0aWdhdGlvbiBhYm91dCB0aGlzIHRocmVzaG9sZCBzaW5jZSB0aGUgTnVtSW50cmFTZWFyY2gKLSAgICAgICAgICAgICAgICBvbmx5IHNob3cgcG90ZW50aWFsIGludHJhIE1Ccywgbm90IHRoZSBhY3R1YWwgb25lICovCi0gICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgLyogd2UgY2FuIGNob29zZSB0byBqdXN0IGVuY29kZSBJX1NMSUNFIHdpdGhvdXQgSURSICovCi0gICAgICAgICAgICAgICAgLy92aWRlby0+bmFsX3VuaXRfdHlwZSA9IEFWQ19OQUxUWVBFX0lEUjsKLSAgICAgICAgICAgICAgICB2aWRlby0+bmFsX3VuaXRfdHlwZSA9IEFWQ19OQUxUWVBFX1NMSUNFOwotICAgICAgICAgICAgICAgIHZpZGVvLT5zbGljZUhkci0+c2xpY2VfdHlwZSA9IEFWQ19JX0FMTF9TTElDRTsKLSAgICAgICAgICAgICAgICB2aWRlby0+c2xpY2VfdHlwZSA9IEFWQ19JX1NMSUNFOwotICAgICAgICAgICAgICAgIG1lbXNldChpbnRyYVNlYXJjaCwgMSwgc2l6ZW9mKHVpbnQ4KSp0b3RhbE1CKTsKLSAgICAgICAgICAgICAgICBpID0gdG90YWxNQjsKLSAgICAgICAgICAgICAgICB3aGlsZSAoaS0tKQotICAgICAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAgICAgbWJsb2NrW2ldLm1iX2ludHJhID0gMTsKLSAgICAgICAgICAgICAgICAgICAgZW5jdmlkLT5taW5fY29zdFtpXSA9IDB4N0ZGRkZGRkY7ICAvKiBtYXggdmFsdWUgZm9yIGludCAqLwotICAgICAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgICAgIHJhdGVDdHJsLT50b3RhbFNBRCA9IHRvdGFsU0FEICogMjsgIC8qIFNBRCAqLwotCi0gICAgICAgICAgICAgICAgcmV0dXJuIDsKLSAgICAgICAgICAgIH0KLSAgICAgICAgfQotICAgICAgICAvKioqKioqKiogbm8gc2NlbmUgY2hhbmdlLCBjb250aW51ZSBtb3Rpb24gc2VhcmNoICoqKioqKioqKioqKioqKioqKioqKiovCi0gICAgICAgIHN0YXJ0X2kgPSAwOwotICAgICAgICB0eXBlX3ByZWQrKzsgLyogc2Vjb25kIHBhc3MgKi8KLSAgICB9Ci0KLSAgICByYXRlQ3RybC0+dG90YWxTQUQgPSB0b3RhbFNBRDsgIC8qIFNBRCAqLwotCi0jaWZkZWYgSFRGTQotICAgIC8qKioqKiBIWVBPVEhFU0lTIFRFU1RJTkcgKioqKioqKiovCi0gICAgaWYgKGNvbGxlY3QpCi0gICAgewotICAgICAgICBjb2xsZWN0ID0gMDsKLSAgICAgICAgVXBkYXRlSFRGTShlbmN2aWQsIG5ld3ZhciwgZXhwX2xhbWRhLCAmaHRmbV9zdGF0KTsKLSAgICB9Ci0gICAgLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLSNlbmRpZgotCi0gICAgcmV0dXJuIDsKLX0KLQotLyo9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KLSAgICBGdW5jdGlvbjogICBQYWRkaW5nRWRnZQotICAgIERhdGU6ICAgICAgIDA5LzE2LzIwMDAKLSAgICBQdXJwb3NlOiAgICBQYWQgZWRnZSBvZiBhIFZvcAotPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT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LSAgICB9Ci0KLSAgICAvKiBwYWQgYm90dG9tICovCi0gICAgZHN0IC09IDE2OwotICAgIGkgPSAxNjsKLSAgICB3aGlsZSAoaS0tKQotICAgIHsKLSAgICAgICAgbWVtY3B5KGRzdCwgZHN0IC0gcGl0Y2gsIHBpdGNoKTsKLSAgICAgICAgZHN0ICs9IHBpdGNoOwotICAgIH0KLQotCi0gICAgcmV0dXJuIDsKLX0KLQotLyo9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KLSAgICBGdW5jdGlvbjogICBBVkNSYXN0ZXJJbnRyYVVwZGF0ZQotICAgIERhdGU6ICAgICAgIDIvMjYvMDEKLSAgICBQdXJwb3NlOiAgICBUbyByYXN0ZXItc2NhbiBhc3NpZ24gSU5UUkEtdXBkYXRlIC4KLSAgICAgICAgICAgICAgICBOIG1hY3JvYmxvY2tzIGFyZSB1cGRhdGVkIChhbHNvIHdhcyBwcm9ncmFtbWFibGUpLgotPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09Ki8KLXZvaWQgQVZDUmFzdGVySW50cmFVcGRhdGUoQVZDRW5jT2JqZWN0ICplbmN2aWQsIEFWQ01hY3JvYmxvY2sgKm1ibG9jaywgaW50IHRvdGFsTUIsIGludCBudW1SZWZyZXNoKQotewotICAgIGludCBpbmR4LCBpOwotCi0gICAgaW5keCA9IGVuY3ZpZC0+Zmlyc3RJbnRyYVJlZnJlc2hNQkluZHg7Ci0gICAgZm9yIChpID0gMDsgaSA8IG51bVJlZnJlc2ggJiYgaW5keCA8IHRvdGFsTUI7IGkrKykKLSAgICB7Ci0gICAgICAgIChtYmxvY2sgKyBpbmR4KS0+bWJfaW50cmEgPSAxOwotICAgICAgICBlbmN2aWQtPmludHJhU2VhcmNoW2luZHgrK10gPSAxOwotICAgIH0KLQotICAgIC8qIGlmIHJl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wgY212eCwgY212eSk7Ci0KLSAgICAgICAgbmNhbmQgPSByZWYgKyBpbWluICsgam1pbiAqIGx4OwotICAgIH0KLSAgICBlbHNlCi0gICAgeyAgIC8qICAgICAgIGZ1bGxzZWFyY2ggdGhlIHRvcCByb3cgdG8gb25seSB1cHRvICgwLDMpIE1CICovCi0gICAgICAgIC8qICAgICAgIHVwdG8gMzAlIGNvbXBsZXhpdHkgc2F2aW5nIHdpdGggdGhlIHNhbWUgY29tcGxleGl0eSAqLwotICAgICAgICBpZiAodmlkZW8tPlByZXZSZWZGcmFtZU51bSA9PSAwICYmIGowID09IDAgJiYgaTAgPD0gNjQgJiYgdHlwZV9wcmVkICE9IDEpCi0gICAgICAgIHsKLSAgICAgICAgICAgICpocF9ndWVzcyA9IDA7IC8qIG5vIGd1ZXNzIGZvciBmYXN0IGhhbGYtcGVsICovCi0gICAgICAgICAgICBkbWluID0gIEFWQ0Z1bGxTZWFyY2goZW5jdmlkLCByZWYsIGN1ciwgJmltaW4sICZqbWluLCBpbG93LCBpaGlnaCwgamxvdywgamhpZ2gsIGNtdngsIGNtdnkpOwotICAgICAgICAgICAgbmNhbmQgPSByZWYgKyBpbWluICsgam1pbiAqIGx4OwotICAgICAgICB9Ci0gICAgICAgIGVsc2UKLSAgICAgICAgewotICAgICAgICAgICAgLyoqKioqKioqKioqKioqIGluaXRpYWxpemUgY2FuZGlkYXRlICoqKioqKioqKioqKioqKioqKioqKioqKioqLwotCi0gICAgICAgICAgICBkbWluID0gNjU1MzU7Ci0KLSAgICAgICAgICAgIC8qIGNoZWNrIGlmIGFsbCBhcmUgZXF1YWwgKi8KLSAgICAgICAgICAgIGlmIChudW1fY2FuID09IEFMTF9DQU5EX0VRVUFMKQotICAgICAgICAgICAgewotICAgICAgICAgICAgICAgIGkgPSBpMCArIG12eFswXTsKLSAgICAgICAgICAgICAgICBqID0gajAgKyBtdnlbMF07Ci0KLSAgICAgICAgICAgICAgICBpZiAoaSA+PSBpbG93ICYmIGkgPD0gaWhpZ2ggJiYgaiA+PSBqbG93ICYmIGogPD0gamhpZ2gpCi0gICAgICAgICAgICAgICAgewotICAgICAgICAgICAgICAgICAgICBjYW5kID0gcmVmICsgaSArIGogKiBseDsKLQotICAgICAgICAgICAgICAgICAgICBkID0gKCpTQURfTWFjcm9ibG9jaykoY2FuZCwgY3VyLCAoZG1pbiA8PCAxNikgfCBseCwgZXh0cmFfaW5mbyk7Ci0gICAgICAgICAgICAgICAgICAgIG12Y29zdCA9IE1WX0NPU1QobGFtYmRhX21vdGlvbiwgbXZzaGlmdCwgaSAtIGkwLCBqIC0gajAsIGNtdngsIGNtdnkpOwotICAgICAgICAgICAgICAgICAgICBkICs9ICBtdmNvc3Q7Ci0KLSAgICAgICAgICAgICAgICAgICAgaWYgKGQgPCBkbWluKQotICAgICAgICAgICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgICAgICAgICBkbWluID0gZDsKLSAgICAgICAgICAgICAgICAgICAgICAgIGltaW4gPSBpOwotICAgICAgICAgICAgICAgICAgICAgICAgam1pbiA9IGo7Ci0gICAgICAgICAgICAgICAgICAgICAgICBuY2FuZCA9IGNhbmQ7Ci0gICAgICAgICAgICAgICAgICAgICAgICBtaW5fc2FkID0gZCAtIG12Y29zdDsgLy8gZm9yIHJhdGUgY29udHJvbAotICAgICAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgfQotICAgICAgICAgICAgZWxzZQotICAgICAgICAgICAgewotICAgICAgICAgICAgICAgIC8qKioqKioqKioqKioqKiBldmFsdWF0ZSB1bmlxdWUgY2FuZGlkYXRlcyAqKioqKioqKioqKioqKioqKioqKioqLwotICAgICAgICAgICAgICAgIGZvciAoayA9IDA7IGsgPCBudW1fY2FuOyBrKyspCi0gICAgICAgICAgICAgICAgewotICAgICAgICAgICAgICAgICAgICBpID0gaTAgKyBtdnhba107Ci0gICAgICAgICAgICAgICAgICAgIGogPSBqMCArIG12eVtrXTsKLQotICAgICAgICAgICAgICAgICAgICBpZiAoaSA+PSBpbG93ICYmIGkgPD0gaWhpZ2ggJiYgaiA+PSBqbG93ICYmIGogPD0gamhpZ2gpCi0gICAgICAgICAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAgICAgICAgIGNhbmQgPSByZWYgKyBpICsgaiAqIGx4OwotICAgICAgICAgICAgICAgICAgICAgICAgZCA9ICgqU0FEX01hY3JvYmxvY2spKGNhbmQsIGN1ciwgKGRtaW4gPDwgMTYpIHwgbHgsIGV4dHJhX2luZm8pOwotICAgICAgICAgICAgICAgICAgICAgICAgbXZjb3N0ID0gTVZfQ09TVChsYW1iZGFfbW90aW9uLCBtdnNoaWZ0LCBpIC0gaTAsIGogLSBqMCwgY212eCwgY212eSk7Ci0gICAgICAgICAgICAgICAgICAgICAgICBkICs9ICBtdmNvc3Q7Ci0KLSAgICAgICAgICAgICAgICAgICAgICAgIGlmIChkIDwgZG1pbikKLSAgICAgICAgICAgICAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBkbWluID0gZDsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBpbWluID0gaTsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBqbWluID0gajsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBuY2FuZCA9IGNhbmQ7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgbWluX3NhZCA9IGQgLSBtdmNvc3Q7IC8vIGZvciByYXRlIGNvbnRyb2wKLSAgICAgICAgICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgLyoqKioqKioqKioqKioqKioqKiogbG9jYWwgcmVmaW5lbWVudCAqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0gICAgICAgICAgICBjZW50ZXJfYWdhaW4gPSAwOwotICAgICAgICAgICAgbGFzdF9sb2MgPSBuZXdfbG9jID0gMDsKLSAgICAgICAgICAgIC8vICAgICAgICAgIG5jYW5kID0gcmVmICsgam1pbipseCArIGltaW47ICAvKiBjZW50ZXIgb2YgdGhlIHNlYXJjaCAqLwotICAgICAgICAgICAgc3RlcCA9IDA7Ci0gICAgICAgICAgICBkblswXSA9IGRtaW47Ci0gICAgICAgICAgICB3aGlsZSAoIWNlbnRlcl9hZ2FpbiAmJiBzdGVwIDw9IG1heF9zdGVwKQotICAgICAgICAgICAgewotCi0gICAgICAgICAgICAgICAgQVZDTW92ZU5laWdoYm9yU0FEKGRuLCBsYXN0X2xvYyk7Ci0KLSAgICAgICAgICAgICAgICBjZW50ZXJfYWdhaW4gPSAxOwotICAgICAgICAgICAgICAgIGkgPSBpbWluOwotICAgICAgICAgICAgICAgIGogPSBqbWluIC0gMTsKLSAgICAgICAgICAgICAgICBjYW5kID0gcmVmICsgaSArIGogKiBseDsKLQotICAgICAgICAgICAgICAgIC8qICBzdGFydGluZyBmcm9tIFswLC0xXSAqLwotICAgICAgICAgICAgICAgIC8qIHNwaXJhbCBjaGVjayBvbmUgc3RlcCBhdCBhIHRpbWUqLwotICAgICAgICAgICAgICAgIGZvciAoayA9IDI7IGsgPD0gODsgayArPSAyKQotICAgICAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAgICAgaWYgKCF0YWJfZXhjbHVkZVtsYXN0X2xvY11ba10pIC8qIGV4Y2x1ZGUgbGFzdCBzdGVwIGNvbXB1dGF0aW9uICovCi0gICAgICAgICAgICAgICAgICAgIHsgICAgICAgLyogbm90IGFscmVhZHkgY29tcHV0ZWQgKi8KLSAgICAgICAgICAgICAgICAgICAgICAgIGlmIChpID49IGlsb3cgJiYgaSA8PSBpaGlnaCAmJiBqID49IGpsb3cgJiYgaiA8PSBqaGlnaCkKLSAgICAgICAgICAgICAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBkID0gKCpTQURfTWFjcm9ibG9jaykoY2FuZCwgY3VyLCAoZG1pbiA8PCAxNikgfCBseCwgZXh0cmFfaW5mbyk7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgbXZjb3N0ID0gTVZfQ09TVChsYW1iZGFfbW90aW9uLCBtdnNoaWZ0LCBpIC0gaTAsIGogLSBqMCwgY212eCwgY212eSk7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgZCArPSBtdmNvc3Q7Ci0KLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBkbltrXSA9IGQ7IC8qIGtlZXAgaXQgZm9yIGhhbGYgcGVsIHVzZSAqLwotCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGQgPCBkbWluKQotICAgICAgICAgICAgICAgICAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbmNhbmQgPSBjYW5kOwotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBkbWluID0gZDsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaW1pbiA9IGk7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGptaW4gPSBqOwotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjZW50ZXJfYWdhaW4gPSAwOwotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBuZXdfbG9jID0gazsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbWluX3NhZCA9IGQgLSBtdmNvc3Q7IC8vIGZvciByYXRlIGNvbnRyb2wKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICAgICAgaWYgKGsgPT0gOCkgIC8qIGVuZCBzaWRlIHNlYXJjaCovCi0gICAgICAgICAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAgICAgICAgIGlmICghY2VudGVyX2FnYWluKQotICAgICAgICAgICAgICAgICAgICAgICAgewotICAgICAgICAgICAgICAgICAgICAgICAgICAgIGsgPSAtMTsgLyogc3RhcnQgZGlhZ29uYWwgc2VhcmNoICovCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgY2FuZCAtPSBseDsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBqLS07Ci0gICAgICAgICAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICAgICAgZWxzZQotICAgICAgICAgICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgICAgICAgICBuZXh0ID0gcmVmaW5lX25leHRba11bMF07Ci0gICAgICAgICAgICAgICAgICAgICAgICBpICs9IG5leHQ7Ci0gICAgICAgICAgICAgICAgICAgICAgICBjYW5kICs9IG5leHQ7Ci0gICAgICAgICAgICAgICAgICAgICAgICBuZXh0ID0gcmVmaW5lX25leHRba11bMV07Ci0gICAgICAgICAgICAgICAgICAgICAgICBqICs9IG5leHQ7Ci0gICAgICAgICAgICAgICAgICAgICAgICBjYW5kICs9IGx4ICogbmV4dDsKLSAgICAgICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICBsYXN0X2xvYyA9IG5ld19sb2M7Ci0gICAgICAgICAgICAgICAgc3RlcCArKzsKLSAgICAgICAgICAgIH0KLSAgICAgICAgICAgIGlmICghY2VudGVyX2FnYWluKQotICAgICAgICAgICAgICAgIEFWQ01vdmVOZWlnaGJvclNBRChkbiwgbGFzdF9sb2MpOwotCi0gICAgICAgICAgICAqaHBfZ3Vlc3MgPSBBVkNGaW5kTWluKGRuKTsKLQotICAgICAgICAgICAgZW5jdmlkLT5yYXRlQ3RybC0+TUFEb2ZNQlttYm51bV0gPSBtaW5fc2FkIC8gMjU2LjA7Ci0gICAgICAgIH0KLSAgICB9Ci0KLSAgICBtb3QxNngxNlttYm51bV0uc2FkID0gZG1pbjsKLSAgICBtb3QxNngxNlttYm51bV0ueCA9IChpbWluIC0gaTApIDw8IDI7Ci0gICAgbW90MTZ4MTZbbWJudW1dLnkgPS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A8IDE2OyBqKyspCi0gICAgewotICAgICAgICBmb3IgKGkgPSAwOyBpIDwgMTY7IGkrKykKLSAgICAgICAgewotICAgICAgICAgICAgKnJlZisrID0gKm5jYW5kKys7Ci0gICAgICAgIH0KLSAgICAgICAgcmVmICs9IChseCAtIDE2KTsKLSAgICAgICAgbmNhbmQgKz0gODsKLSAgICB9Ci0KLSAgICByZXR1cm4gOwotfQotCi0jZW5kaWYKLQotLyo9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09Ci0gICAgRnVuY3Rpb246ICAgQVZDRnVsbFNlYXJjaAotICAgIERhdGU6ICAgICAgIDA5LzE2LzIwMDAKLSAgICBQdXJwb3NlOiAgICBQZXJmb3JtIGZ1bGwtc2VhcmNoIG1vdGlvbiBlc3RpbWF0aW9uIG92ZXIgdGhlIHJhbmdlIG9mIHNlYXJjaAotICAgICAgICAgICAgICAgIHJlZ2lvbiBpbiBhIHNwaXJhbC1vdXR3YXJkIG1hbm5lci4KLSAgICBJbnB1dC9PdXRwdXQ6ICAgVmlkZW9FbmNEYXRhLCBjdXJyZW50IFZvbCwgcHJldmlvdSBWb3AsIHBvaW50ZXIgdG8gdGhlIGxlZnQgY29ybmVyIG9mCi0gICAgICAgICAgICAgICAgY3VycmVudCBWT1AsIGN1cnJlbnQgY29vcmQgKGFsc28gb3V0cHV0KSwgYm91bmRhcmllcy4KLT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0qLwotaW50IEFWQ0Z1bGxTZWFyY2goQVZDRW5jT2JqZWN0ICplbmN2aWQsIHVpbnQ4ICpwcmV2LCB1aW50OCAqY3VyLAotICAgICAgICAgICAgICAgICAgaW50ICppbWluLCBpbnQgKmptaW4sIGludCBpbG93LCBpbnQgaWhpZ2gsIGludCBqbG93LCBpbnQgamhpZ2gsCi0gICAg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G1pbjsKLSAgICBkbWluICs9IG12Y29zdDsKLQotICAgIC8qIHBlcmZvcm0gc3BpcmFsIHNlYXJjaCAqLwotICAgIGZvciAoayA9IDE7IGsgPD0gcmFuZ2U7IGsrKykKLSAgICB7Ci0KLSAgICAgICAgaSA9IGkwIC0gazsKLSAgICAgICAgaiA9IGowIC0gazsKLQotICAgICAgICBjYW5kID0gcHJldiArIGkgKyBqICogbHg7Ci0KLSAgICAgICAgZm9yIChsID0gMDsgbCA8IDgqazsgbCsrKQotICAgICAgICB7Ci0gICAgICAgICAgICAvKiBubyBuZWVkIGZvciBib3VuZGFyeSBjaGVja2luZyBhZ2FpbiAqLwotICAgICAgICAgICAgaWYgKGkgPj0gaWxvdyAmJiBpIDw9IGloaWdoICYmIGogPj0gamxvdyAmJiBqIDw9IGpoaWdoKQotICAgICAgICAgICAgewotICAgICAgICAgICAgICAgIGQgPSAoKlNBRF9NYWNyb2Jsb2NrKShjYW5kLCBjdXIsIChkbWluIDw8IDE2KSB8IGx4LCAodm9pZCopZXh0cmFfaW5mbyk7Ci0gICAgICAgICAgICAgICAgbXZjb3N0ID0gTVZfQ09TVChsYW1iZGFfbW90aW9uLCBtdnNoaWZ0LCBpIC0gaTAsIGogLSBqMCwgY212eCwgY212eSk7Ci0gICAgICAgICAgICAgICAgZCArPSAgbXZjb3N0OwotCi0gICAgICAgICAgICAgICAgaWYgKGQgPCBkbWluKQotICAgICAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAgICAgZG1pbiA9IGQ7Ci0gICAgICAgICAgICAgICAgICAgICppbWluID0gaTsKLSAgICAgICAgICAgICAgICAgICAgKmptaW4gPSBqOwotICAgICAgICAgICAgICAgICAgICBtaW5fc2FkID0gZCAtIG12Y29zdDsKLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgIGlmIChsIDwgKGsgPDwgMSkpCi0gICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgaSsrOwotICAgICAgICAgICAgICAgIGNhbmQrKzsKLSAgICAgICAgICAgIH0KLSAgICAgICAgICAgIGVsc2UgaWYgKGwgPCAoayA8PCAyKSkKLSAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICBqKys7Ci0gICAgICAgICAgICAgICAgY2FuZCArPSBseDsKLSAgICAgICAgICAgIH0KLSAgICAgICAgICAgIGVsc2UgaWYgKGwgPCAoKGsgPDwgMikgKyAoayA8PCAxKSkpCi0gICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgaS0tOwotICAgICAgICAgICAgICAgIGNhbmQtLTsKLSAgICAgICAgICAgIH0KLSAgICAgICAgICAgIGVsc2UKLSAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICBqLS07Ci0gICAgICAgICAgICAgICAgY2FuZCAtPSBseDsKLSAgICAgICAgICAgIH0KLSAgICAgICAgfQotICAgIH0KLQotICAgIGVuY3ZpZC0+cmF0ZUN0cmwtPk1BRG9mTUJbZW5jdmlkLT5jb21tb24tPm1iTnVtXSA9IChtaW5fc2FkIC8gMjU2LjApOyAvLyBmb3IgcmF0ZSBjb250cm9sCi0KLSAgICByZXR1cm4gZG1pbjsKLX0KLQotLyo9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09Ci0gICAgRnVuY3Rpb246ICAgQVZDQ2FuZGlkYXRlU2VsZWN0aW9uCi0gICAgRGF0ZTogICAgICAgMDkvMTYvMjAwMAotICAgIFB1cnBvc2U6ICAgIEZpbGwgdXAgdGhlIGxpc3Qgb2YgY2FuZGlkYXRlIHVzaW5nIHNwYXRpby10ZW1wb3JhbCBjb3JyZWxhdGlvbgotICAgICAgICAgICAgICAgIGFtb25nIG5laWdoYm9yaW5nIGJsb2Nrcy4KLSAgICBJbnB1dC9PdXRwdXQ6ICAgdHlwZV9wcmVkID0gMDogZmlyc3QgcGFzcywgMTogc2Vjb25kIHBhc3MsIG9yIG5vIFNDRAotICAgIE1vZGlmaWVkOiAgICwgMDkvMjMvMDEsIGdldCByaWQgb2YgcmVkdW5kYW50IGNhbmRpZGF0ZXMgYmVmb3JlIHBhc3NpbmcgYmFjay4KLSAgICAgICAgICAgICAgICAsIDA5LzExLzA3LCBhZGRlZCByZXR1cm4gZm9yIG1vZGlmaWVkIHByZWRpY3RlZCBNViwgdGhpcyB3aWxsIGJlCi0gICAgICAgICAgICAgICAgICAgIG5lZWRlZCBmb3IgYm90aCBmYXN0IHNlYXJjaCBhbmQgZnVsbHNlYXJjaC4KLT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0qLwotCi12b2lkIEFWQ0NhbmRpZGF0ZVNlbGVjdGlvbihpbnQgKm12eCwgaW50ICptdnksIGludCAqbnVtX2NhbiwgaW50IGltYiwgaW50IGptYiwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgIEFWQ0VuY09iamVjdCAqZW5jdmlkLCBpbnQgdHlwZV9wcmVkLCBpbnQgKmNtdngsIGludCAqY212eSkKLXsKLSAgICBBVkNDb21tb25PYmogKnZpZGVvID0gZW5jdmlkLT5jb21tb247Ci0gICAgQVZDTVYgKm1vdDE2eDE2ID0gZW5jdmlkLT5tb3QxNngxNjsKLSAgICBBVkNNViAqcG1vdDsKLSAgICBpbnQgbWJudW0gPSB2aWRlby0+bWJOdW07Ci0gICAgaW50IG1id2lkdGggPSB2aWRlby0+UGljV2lkdGhJbk1iczsKLSAgICBpbnQgbWJoZWlnaHQgPSB2aWRlby0+UGljSGVpZ2h0SW5NYnM7Ci0gICAgaW50IGksIGosIHNhbWUsIG51bTE7Ci0KLSAgICAvKiB0aGlzIHBhcnQgaXMgZm9yIHByZWRpY3RlZCBNViAqLwotICAgIGludCBwbXZBX3ggPSAwLCBwbXZBX3kgPSAwLCBwbXZCX3ggPSAwLCBwbXZCX3kgPSAwLCBwbXZDX3ggPSAwLCBwbXZDX3kgPSAwOwotICAgIGludCBhdmFpbEEgPSAwLCBhdmFpbEIgPSAwLCBhdmFpbEMgPSAwOwotCi0gICAgKm51bV9jYW4gPSAwOwotCi0gICAgaWYgKHZpZGVvLT5QcmV2UmVmRnJhbWVOdW0gIT0gMCkgLy8gcHJldmlvdXMgZnJhbWUgaXMgYW4gSURSIGZyYW1lCi0gICAgewotICAgICAgICAvKiBTcGF0aW8tVGVtcG9yYWwgQ2FuZGlkYXRlIChmaXZlIGNhbmRpZGF0ZXMpICovCi0gICAgICAgIGlmICh0eXBlX3ByZWQgPT0gMCkgLyogZmlyc3QgcGFzcyAqLwotICAgICAgICB7Ci0gICAgICAgICAgICBwbW90ID0gJm1vdDE2eDE2W21ibnVtXTsgLyogc2FtZSBjb29yZGluYXRlIHByZXZpb3VzIGZyYW1lICovCi0gICAgICAgICAgICBtdnhbKCpudW1fY2FuKV0gPSAocG1vdC0+eCkgPj4gMjsKLSAgICAgICAgICAgIG12eVsoKm51bV9jYW4pKytdID0gKHBtb3QtPnkpID4+IDI7Ci0gICAgICAgICAgICBpZiAoaW1iID49IChtYndpZHRoID4+IDEpICYmIGltYiA+IDApICAvKmxlZnQgbmVpZ2hib3IgcHJldmlvdXMgZnJhbWUgKi8KLSAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICBwbW90ID0gJm1vdDE2eDE2W21ibnVtLTFdOwotICAgICAgICAgICAgICAgIG12eFsoKm51bV9jYW4pXSA9IChwbW90LT54KSA+PiAyOwotICAgICAgICAgICAgICAgIG12eVsoKm51bV9jYW4pKytdID0gKHBtb3QtPnkpID4+IDI7Ci0gICAgICAgICAgICB9Ci0gICAgICAgICAgICBlbHNlIGlmIChpbWIgKyAxIDwgbWJ3aWR0aCkgICAvKnJpZ2h0IG5laWdoYm9yIHByZXZpb3VzIGZyYW1lICovCi0gICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgcG1vdCA9ICZtb3QxNngxNlttYm51bSsxXTsKLSAgICAgICAgICAgICAgICBtdnhbKCpudW1fY2FuKV0gPSAocG1vdC0+eCkgPj4gMjsKLSAgICAgICAgICAgICAgICBtdnlbKCpudW1fY2FuKSsrXSA9IChwbW90LT55KSA+PiAyOwotICAgICAgICAgICAgfQotCi0gICAgICAgICAgICBpZiAoam1iIDwgbWJoZWlnaHQgLSAxKSAgLypib3R0b20gbmVpZ2hib3IgcHJldmlvdXMgZnJhbWUgKi8KLSAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICBwbW90ID0gJm1vdDE2eDE2W21ibnVtK21id2lkdGhdOwotICAgICAgICAgICAgICAgIG12eFsoKm51bV9jYW4pXSA9IChwbW90LT54KSA+PiAyOwotICAgICAgICAgICAgICAgIG12eVsoKm51bV9jYW4pKytdID0gKHBtb3QtPnkpID4+IDI7Ci0gICAgICAgICAgICB9Ci0gICAgICAgICAgICBlbHNlIGlmIChqbWIgPiAwKSAgIC8qdXBwZXIgbmVpZ2hib3IgcHJldmlvdXMgZnJhbWUgKi8KLSAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICBwbW90ID0gJm1vdDE2eDE2W21ibnVtLW1id2lkdGhdOwotICAgICAgICAgICAgICAgIG12eFsoKm51bV9jYW4pXSA9IChwbW90LT54KSA+PiAyOwotICAgICAgICAgICAgICAgIG12eVsoKm51bV9jYW4pKytdID0gKHBtb3QtPnkpID4+IDI7Ci0gICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgIGlmIChpbWIgPiAwICYmIGptYiA+IDApICAvKiB1cHBlci1sZWZ0IG5laWdoYm9yIGN1cnJlbnQgZnJhbWUqLwotICAgICAgICAgICAgewotICAgICAgICAgICAgICAgIHBtb3QgPSAmbW90MTZ4MTZbbWJudW0tbWJ3aWR0aC0xXTsKLSAgICAgICAgICAgICAgICBtdnhbKCpudW1fY2FuKV0gPSAocG1vdC0+eCkgPj4gMjsKLSAgICAgICAgICAgICAgICBtdnlbKCpudW1fY2FuKSsrXSA9IChwbW90LT55KSA+PiAyOwotICAgICAgICAgICAgfQotICAgICAgICAgICAgaWYgKGptYiA+IDAgJiYgaW1iIDwgbWJoZWlnaHQgLSAxKSAgLyogdXBwZXIgcmlnaHQgbmVpZ2hib3IgY3VycmVudCBmcmFtZSovCi0gICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgcG1vdCA9ICZtb3QxNngxNlttYm51bS1tYndpZHRoKzFdOwotICAgICAgICAgICAgICAgIG12eFsoKm51bV9jYW4pXSA9IChwbW90LT54KSA+PiAyOwotICAgICAgICAgICAgICAgIG12eVsoKm51bV9jYW4pKytdID0gKHBtb3QtPnkpID4+IDI7Ci0gICAgICAgICAgICB9Ci0gICAgICAgIH0KLSAgICAgICAgZWxzZSAgICAvKiBzZWNvbmQgcGFzcyAqLwotICAgICAgICAgICAgLyogb3JpZ2luYWwgU1QxIGFsZ29yaXRobSAqLwotICAgICAgICB7Ci0gICAgICAgICAgICBwbW90ID0gJm1vdDE2eDE2W21ibnVtXTsgLyogc2FtZSBjb29yZGluYXRlIHByZXZpb3VzIGZyYW1lICovCi0gICAgICAgICAgICBtdnhbKCpudW1fY2FuKV0gPSAocG1vdC0+eCkgPj4gMjsKLSAgICAgICAgICAgIG12eVsoKm51bV9jYW4pKytdID0gKHBtb3QtPnkpID4+IDI7Ci0KLSAgICAgICAgICAgIGlmIChpbWIgPiAwKSAgLypsZWZ0IG5laWdoYm9yIGN1cnJlbnQgZnJhbWUgKi8KLSAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICBwbW90ID0gJm1vdDE2eDE2W21ibnVtLTFdOwotICAgICAgICAgICAgICAgIG12eFsoKm51bV9jYW4pXSA9IChwbW90LT54KSA+PiAyOwotICAgICAgICAgICAgICAgIG12eVsoKm51bV9jYW4pKytdID0gKHBtb3QtPnkpID4+IDI7Ci0gICAgICAgICAgICB9Ci0gICAgICAgICAgICBpZiAoam1iID4gMCkgIC8qdXBwZXIgbmVpZ2hib3IgY3VycmVudCBmcmFtZSAqLwotICAgICAgICAgICAgewotICAgICAgICAgICAgICAgIHBtb3QgPSAmbW90MTZ4MTZbbWJudW0tbWJ3aWR0aF07Ci0gICAgICAgICAgICAgICAgbXZ4WygqbnVtX2NhbildID0gKHBtb3QtPngpID4+IDI7Ci0gICAgICAgICAgICAgICAgbXZ5WygqbnVtX2NhbikrK10gPSAocG1vdC0+eSkgPj4gMjsKLSAgICAgICAgICAgIH0KLSAgICAgICAgICAgIGlmIChpbWIgPCBtYndpZHRoIC0gMSkgIC8qcmlnaHQgbmVpZ2hib3IgcHJldmlvdXMgZnJhbWUgKi8KLSAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICBwbW90ID0gJm1vdDE2eDE2W21ibnVtKzFdOwotICAgICAgICAgICAgICAgIG12eFsoKm51bV9jYW4pXSA9IChwbW90LT54KSA+PiAyOwotICAgICAgICAgICAgICAgIG12eVsoKm51bV9jYW4pKytdID0gKHBtb3QtPnkpID4+IDI7Ci0gICAgICAgICAgICB9Ci0gICAgICAgICAgICBpZiAoam1iIDwgbWJoZWlnaHQgLSAxKSAgLypib3R0b20gbmVpZ2hib3IgcHJldmlvdXMgZnJhbWUgKi8KLSAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICBwbW90ID0gJm1vdDE2eDE2W21ibnVtK21id2lkdGhdOwotICAgICAgICAgICAgICAgIG12eFsoKm51bV9jYW4pXSA9IChwbW90LT54KSA+PiAyOwotICAgICAgICAgICAgICAgIG12eVsoKm51bV9jYW4pKytdID0gKHBtb3QtPnkpID4+IDI7Ci0gICAgICAgICAgICB9Ci0gICAgICAgIH0KLQotICAgICAgICAvKiBnZXQgcHJlZGljdGVkIE1WICovCi0gICAgICAgIGlmIChpbWIgPiAwKSAgICAvKiBnZXQgTVYgZnJvbSBsZWZ0IChBKSBuZWlnaGJvciBlaXRoZXIgb24gY3VycmVudCBvciBwcmV2aW91cyBmcmFtZSAqLwotICAgICAgICB7Ci0gICAgICAgICAgICBhdmFpbEEgPSAxOwotICAgICAgICAgICAgcG1vdCA9ICZtb3QxNngxNlttYm51bS0xXTsKLSAgICAgICAgICAgIHBtdkFfeCA9IHBtb3QtPng7Ci0gICAgICAgICAgICBwbXZBX3kgPSBwbW90LT55OwotICAgICAgICB9Ci0KLSAgICAgICAgaWYgKGptYiA+IDApIC8qIGdldCBNViBmcm9tIHRvcCAoQikgbmVpZ2hib3IgZWl0aGVyIG9uIGN1cnJlbnQgb3IgcHJldmlvdXMgZnJhbWUgKi8KLSAgICAgICAgewotICAgICAgICAgICAgYXZhaWxCID0gMTsKLSAgICAgICAgICAgIHBtb3QgPSAmbW90MTZ4MTZbbWJudW0tbWJ3aWR0aF07Ci0gICAgICAgICAgICBwbXZCX3ggPSBwbW90LT54OwotICAgICAgICAgICAgcG12Ql95ID0gcG1vdC0+eTsKLQotICAgICAgICAgICAgYXZhaWxDID0gMTsKLQotICAgICAgICAgICAgaWYgKGltYiA8IG1id2lkdGggLSAxKSAvKiBnZXQgTVYgZnJvbSB0b3AtcmlnaHQgKEMpIG5laWdoYm9yIG9mIGN1cnJlbnQgZnJhbWUgKi8KLSAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICBwbW90ID0gJm1vdDE2eDE2W21ibnVtLW1id2lkdGgrMV07Ci0gICAgICAgICAgICB9Ci0gICAgICAgICAgICBlbHNlIC8qIGdldCBNViBmcm9tIHRvcC1sZWZ0IChEKSBuZWlnaGJvciBvZiBjdXJyZW50IGZyYW1lICovCi0gICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgcG1vdCA9ICZtb3QxNngxNlttYm51bS1tYndpZHRoLTFdOwotICAgICAgICAgICAgfQotICAgICAgICAgICAgcG12Q194ID0gcG1vdC0+eDsKLSAgICAgICAgICAgIHBtdkNfeSA9IHBtb3QtPnk7Ci0gICAgICAgIH0KLQotICAgIH0KLSAgICBlbHNlICAvKiBvbmx5IFNwYXRpYWwgQ2FuZGlkYXRlIChmb3VyIGNhbmRpZGF0ZXMpKi8KLSAgICB7Ci0gICAgICAgIGlmICh0eXBlX3ByZWQgPT0gMCkgLypmaXJzdCBwYXNzKi8KLSAgICAgICAgewotICAgICAgICAgICAgaWYgKGltYiA+IDEpICAvKiBuZWlnaGJvciB0d28gYmxvY2tzIGF3YXkgdG8gdGhlIGxlZnQgKi8KLSAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICBwbW90ID0gJm1vdDE2eDE2W21ibnVtLTJdOwotICAgICAgICAgICAgICAgIG12eFsoKm51bV9jYW4pXSA9IChwbW90LT54KSA+PiAyOwotICAgICAgICAgICAgICAgIG12eVsoKm51bV9jYW4pKytdID0gKHBtb3QtPnkpID4+IDI7Ci0gICAgICAgICAgICB9Ci0gICAgICAgICAgICBpZiAoaW1iID4gMCAmJiBqbWIgPiAwKSAgLyogdXBwZXItbGVmdCBuZWlnaGJvciAqLwotICAgICAgICAgICAgewotICAgICAgICAgICAgICAgIHBtb3QgPSAmbW90MTZ4MTZbbWJudW0tbWJ3aWR0aC0xXTsKLSAgICAgICAgICAgICAgICBtdnhbKCpudW1fY2FuKV0gPSAocG1vdC0+eCkgPj4gMjsKLSAgICAgICAgICAgICAgICBtdnlbKCpudW1fY2FuKSsrXSA9IChwbW90LT55KSA+PiAyOwotICAgICAgICAgICAgfQotICAgICAgICAgICAgaWYgKGptYiA+IDAgJiYgaW1iIDwgbWJoZWlnaHQgLSAxKSAgLyogdXBwZXIgcmlnaHQgbmVpZ2hib3IgKi8KLSAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICBwbW90ID0gJm1vdDE2eDE2W21ibnVtLW1id2lkdGgrMV07Ci0gICAgICAgICAgICAgICAgbXZ4WygqbnVtX2NhbildID0gKHBtb3QtPngpID4+IDI7Ci0gICAgICAgICAgICAgICAgbXZ5WygqbnVtX2NhbikrK10gPSAocG1vdC0+eSkgPj4gMjsKLSAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgLyogZ2V0IHByZWRpY3RlZCBNViAqLwotICAgICAgICAgICAgaWYgKGltYiA+IDEpICAgIC8qIGdldCBNViBmcm9tIDJuZCBsZWZ0IChBKSBuZWlnaGJvciBlaXRoZXIgb2YgY3VycmVudCBmcmFtZSAqLwotICAgICAgICAgICAgewotICAgICAgICAgICAgICAgIGF2YWlsQSA9IDE7Ci0gICAgICAgICAgICAgICAgcG1vdCA9ICZtb3QxNngxNlttYm51bS0yXTsKLSAgICAgICAgICAgICAgICBwbXZBX3ggPSBwbW90LT54OwotICAgICAgICAgICAgICAgIHBtdkFfeSA9IHBtb3QtPnk7Ci0gICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgIGlmIChqbWIgPiAwICYmIGltYiA+IDApIC8qIGdldCBNViBmcm9tIHRvcC1sZWZ0IChCKSBuZWlnaGJvciBvZiBjdXJyZW50IGZyYW1lICovCi0gICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgYXZhaWxCID0gMTsKLSAgICAgICAgICAgICAgICBwbW90ID0gJm1vdDE2eDE2W21ibnVtLW1id2lkdGgtMV07Ci0gICAgICAgICAgICAgICAgcG12Ql94ID0gcG1vdC0+eDsKLSAgICAgICAgICAgICAgICBwbXZCX3kgPSBwbW90LT55OwotICAgICAgICAgICAgfQotCi0gICAgICAgICAgICBpZiAoam1iID4gMCAmJiBpbWIgPCBtYndpZHRoIC0gMSkKLSAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICBhdmFpbEMgPSAxOwotICAgICAgICAgICAgICAgIHBtb3QgPSAmbW90MTZ4MTZbbWJudW0tbWJ3aWR0aCsxXTsKLSAgICAgICAgICAgICAgICBwbXZDX3ggPSBwbW90LT54OwotICAgICAgICAgICAgICAgIHBtdkNfeSA9IHBtb3QtPnk7Ci0gICAgICAgICAgICB9Ci0gICAgICAgIH0KLS8vI2lmZGVmIFNDRU5FX0NIQU5HRV9ERVRFQ1RJT04KLSAgICAgICAgLyogc2Vjb25kIHBhc3MgKFNUMiBhbGdvcml0aG0pKi8KLSAgICAgICAgZWxzZQotICAgICAgICB7Ci0gICAgICAgICAgICBpZiAodHlwZV9wcmVkID09IDEpIC8qICA0LzcvMDEgKi8KLSAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICBpZiAoaW1iID4gMCkgIC8qbGVmdCBuZWlnaGJvciBjdXJyZW50IGZyYW1lICovCi0gICAgICAgICAgICAgICAgewotICAgICAgICAgICAgICAgICAgICBwbW90ID0gJm1vdDE2eDE2W21ibnVtLTFdOwotICAgICAgICAgICAgICAgICAgICBtdnhbKCpudW1fY2FuKV0gPSAocG1vdC0+eCkgPj4gMjsKLSAgICAgICAgICAgICAgICAgICAgbXZ5WygqbnVtX2NhbikrK10gPSAocG1vdC0+eSkgPj4gMjsKLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgaWYgKGptYiA+IDApICAvKnVwcGVyIG5laWdoYm9yIGN1cnJlbnQgZnJhbWUgKi8KLSAgICAgICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgICAgIHBtb3QgPSAmbW90MTZ4MTZbbWJudW0tbWJ3aWR0aF07Ci0gICAgICAgICAgICAgICAgICAgIG12eFsoKm51bV9jYW4pXSA9IChwbW90LT54KSA+PiAyOwotICAgICAgICAgICAgICAgICAgICBtdnlbKCpudW1fY2FuKSsrXSA9IChwbW90LT55KSA+PiAyOwotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICBpZiAoaW1iIDwgbWJ3aWR0aCAtIDEpICAvKnJpZ2h0IG5laWdoYm9yIGN1cnJlbnQgZnJhbWUgKi8KLSAgICAgICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgICAgIHBtb3QgPSAmbW90MTZ4MTZbbWJudW0rMV07Ci0gICAgICAgICAgICAgICAgICAgIG12eFsoKm51bV9jYW4pXSA9IChwbW90LT54KSA+PiAyOwotICAgICAgICAgICAgICAgICAgICBtdnlbKCpudW1fY2FuKSsrXSA9IChwbW90LT55KSA+PiAyOwotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICBpZiAoam1iIDwgbWJoZWlnaHQgLSAxKSAgLypib3R0b20gbmVpZ2hib3IgY3VycmVudCBmcmFtZSAqLwotICAgICAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAgICAgcG1vdCA9ICZtb3QxNngxNlttYm51bSttYndpZHRoXTsKLSAgICAgICAgICAgICAgICAgICAgbXZ4WygqbnVtX2NhbildID0gKHBtb3QtPngpID4+IDI7Ci0gICAgICAgICAgICAgICAgICAgIG12eVsoKm51bV9jYW4pKytdID0gKHBtb3QtPnkpID4+IDI7Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgfQotICAgICAgICAgICAgLy8jZWxzZQotICAgICAgICAgICAgZWxzZSAvKiBvcmlnaW5hbCBTVDEgYWxnb3JpdGhtICovCi0gICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgaWYgKGltYiA+IDApICAvKmxlZnQgbmVpZ2hib3IgY3VycmVudCBmcmFtZSAqLwotICAgICAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAgICAgcG1vdCA9ICZtb3QxNngxNlttYm51bS0xXTsKLSAgICAgICAgICAgICAgICAgICAgbXZ4WygqbnVtX2NhbildID0gKHBtb3QtPngpID4+IDI7Ci0gICAgICAgICAgICAgICAgICAgIG12eVsoKm51bV9jYW4pKytdID0gKHBtb3QtPnkpID4+IDI7Ci0KLSAgICAgICAgICAgICAgICAgICAgaWYgKGptYiA+IDApICAvKnVwcGVyLWxlZnQgbmVpZ2hib3IgY3VycmVudCBmcmFtZSAqLwotICAgICAgICAgICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgICAgICAgICBwbW90ID0gJm1vdDE2eDE2W21ibnVtLW1id2lkdGgtMV07Ci0gICAgICAgICAgICAgICAgICAgICAgICBtdnhbKCpudW1fY2FuKV0gPSAocG1vdC0+eCkgPj4gMjsKLSAgICAgICAgICAgICAgICAgICAgICAgIG12eVsoKm51bV9jYW4pKytdID0gKHBtb3QtPnkpID4+IDI7Ci0gICAgICAgICAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICBpZiAoam1iID4gMCkgIC8qdXBwZXIgbmVpZ2hib3IgY3VycmVudCBmcmFtZSAqLwotICAgICAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAgICAgcG1vdCA9ICZtb3QxNngxNlttYm51bS1tYndpZHRoXTsKLSAgICAgICAgICAgICAgICAgICAgbXZ4WygqbnVtX2NhbildID0gKHBtb3QtPngpID4+IDI7Ci0gICAgICAgICAgICAgICAgICAgIG12eVsoKm51bV9jYW4pKytdID0gKHBtb3QtPnkpID4+IDI7Ci0KLSAgICAgICAgICAgICAgICAgICAgaWYgKGltYiA8IG1iaGVpZ2h0IC0gMSkgIC8qdXBwZXItcmlnaHQgbmVpZ2hib3IgY3VycmVudCBmcmFtZSAqLwotICAgICAgICAgICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgICAgICAgICBwbW90ID0gJm1vdDE2eDE2W21ibnVtLW1id2lkdGgrMV07Ci0gICAgICAgICAgICAgICAgICAgICAgICBtdnhbKCpudW1fY2FuKV0gPSAocG1vdC0+eCkgPj4gMjsKLSAgICAgICAgICAgICAgICAgICAgICAgIG12eVsoKm51bV9jYW4pKytdID0gKHBtb3QtPnkpID4+IDI7Ci0gICAgICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgIC8qIGdldCBwcmVkaWN0ZWQgTVYgKi8KLSAgICAgICAgICAgIGlmIChpbWIgPiAwKSAgICAvKiBnZXQgTVYgZnJvbSBsZWZ0IChBKSBuZWlnaGJvciBlaXRoZXIgb24gY3VycmVudCBvciBwcmV2aW91cyBmcmFtZSAqLwotICAgICAgICAgICAgewotICAgICAgICAgICAgICAgIGF2YWlsQSA9IDE7Ci0gICAgICAgICAgICAgICAgcG1vdCA9ICZtb3QxNngxNlttYm51bS0xXTsKLSAgICAgICAgICAgICAgICBwbXZBX3ggPSBwbW90LT54OwotICAgICAgICAgICAgICAgIHBtdkFfeSA9IHBtb3QtPnk7Ci0gICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgIGlmIChqbWIgPiAwKSAvKiBnZXQgTVYgZnJvbSB0b3AgKEIpIG5laWdoYm9yIGVpdGhlciBvbiBjdXJyZW50IG9yIHByZXZpb3VzIGZyYW1lICovCi0gICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgYXZhaWxCID0gMTsKLSAgICAgICAgICAgICAgICBwbW90ID0gJm1vdDE2eDE2W21ibnVtLW1id2lkdGhdOwotICAgICAgICAgICAgICAgIHBtdkJfeCA9IHBtb3QtPng7Ci0gICAgICAgICAgICAgICAgcG12Ql95ID0gcG1vdC0+eTsKLQotICAgICAgICAgICAgICAgIGF2YWlsQyA9IDE7Ci0KLSAgICAgICAgICAgICAgICBpZiAoaW1iIDwgbWJ3aWR0aCAtIDEpIC8qIGdldCBNViBmcm9tIHRvcC1yaWdodCAoQykgbmVpZ2hib3Igb2YgY3VycmVudCBmcmFtZSAqLwotICAgICAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAgICAgcG1vdCA9ICZtb3QxNngxNlttYm51bS1tYndpZHRoKzFdOwotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICBlbHNlIC8qIGdldCBNViBmcm9tIHRvcC1sZWZ0IChEKSBuZWlnaGJvciBvZiBjdXJyZW50IGZyYW1lICovCi0gICAgICAgICAgICAgICAgewotICAgICAgICAgICAgICAgICAgICBwbW90ID0gJm1vdDE2eDE2W21ibnVtLW1id2lkdGgtMV07Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgIHBtdkNfeCA9IHBtb3QtPng7Ci0gICAgICAgICAgICAgICAgcG12Q195ID0gcG1vdC0+eTsKLSAgICAgICAgICAgIH0KLSAgICAgICAgfQotLy8jZW5kaWYKLSAgICB9Ci0KLSAgICAvKiAgMy8yMy8wMSwgcmVtb3ZlIHJlZHVuZGFudCBjYW5kaWRhdGUgKHBvc3NpYmxlIGstbWVhbikgKi8KLSAgICBudW0xID0gKm51bV9jYW47Ci0gICAgKm51bV9jYW4gPSAxOwotICAgIGZvciAoaSA9IDE7IGkgPCBudW0xOyBpKyspCi0gICAgewotICAgICAgICBzYW1lID0gMDsKLSAgICAgICAgaiA9IDA7Ci0gICAgICAgIHdoaWxlICghc2FtZSAmJiBqIDwgKm51bV9jYW4pCi0gICAgICAgIHsKLSNpZiAoQ0FORElEQVRFX0RJU1RBTkNFPT0wKQotICAgICAgICAgICAgaWYgKG12eFtpXSA9PSBtdnhbal0gJiYgbXZ5W2ldID09IG12eVtqXSkKLSNlbHNlCi0gICAgICAgICAgICAvLyBtb2RpZmllZCBrLW1lYW4sICAzLzI0LzAxLCBzaG91bGRuJ3QgYmUgZ3JlYXRlciB0aGFuIDMKLSAgICAgICAgICAgIGlmIChBVkNfQUJTKG12eFtpXSAtIG12eFtqXSkgKyBBVkNfQUJTKG12eVtpXSAtIG12eVtqXSkgPCBDQU5ESURBVEVfRElTVEFOQ0UpCi0jZW5kaWYKLSAgICAgICAgICAgICAgICBzYW1lID0gMTsKLSAgICAgICAgICAgIGorKzsKLSAgICAgICAgfQotICAgICAgICBpZiAoIXNhbWUpCi0gICAgICAgIHsKLSAgICAgICAgICAgIG12eFsqbnVtX2Nhbl0gPSBtdnhbaV07Ci0gICAgICAgICAgICBtdnlbKm51bV9jYW5dID0gbXZ5W2ldOwotICAgICAgICAgICAgKCpudW1fY2FuKSsrOwotICAgICAgICB9Ci0gICAgfQotCi0gICAgaWYgKG51bTEgPT0gNSAmJiAqbnVtX2NhbiA9PSAxKQotICAgICAgICAqbnVtX2NhbiA9IEFMTF9DQU5EX0VRVUFMOyAvKiBhbGwgYXJlIGVxdWFsICovCi0KLSAgICAvKiBjYWxjdWxhdGUgcHJlZGljdGVkIE1WICovCi0KLSAgICBpZiAoYXZhaWxBICYmICEoYXZhaWxCIHx8IGF2YWlsQykpCi0gICAgewotICAgICAgICAqY212eCA9IHBtdkFfeDsKLSAgICAgICAgKmNtdnkgPSBwbXZBX3k7Ci0gICAgfQotICAgIGVsc2UKLSAgICB7Ci0gICAgICAgICpjbXZ4ID0gQVZDX01FRElBTihwbXZBX3gsIHBtdkJfeCwgcG12Q194KTsKLSAgICAgICAgKmNtdnkgPSBBVkNfTUVESUFOKHBtdkFfeSwgcG12Ql95LCBwbXZDX3kpOwotICAgIH0KLQotICAgIHJldHVybiA7Ci19Ci0KLQotLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKLSAgICBGdW5jdGlvbjogICBBVkNNb3ZlTmVpZ2hib3JTQUQKLSAgICBEYXRlOiAgICAgICAzLzI3LzAxCi0gICAgUHVycG9zZTogICAgTW92ZSBuZWlnaGJvcmluZyBTQUQgYXJvdW5kIHdoZW4gY2VudGVyIGhhcyBzaGlmdGVkCi0qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotCi12b2lkIEFWQ01vdmVOZWlnaGJvclNBRChpbnQgZG5bXSwgaW50IG5ld19sb2MpCi17Ci0gICAgaW50IHRtcFs5XTsKLSAgICB0bXBbMF0gPSBkblswXTsKLSAgICB0bXBbMV0gPSBkblsxXTsKLSAgICB0bXBbMl0gPSBkblsyXTsKLSAgICB0bXBbM10gPSBkblszXTsKLSAgICB0bXBbNF0gPSBkbls0XTsKLSAgICB0bXBbNV0gPSBkbls1XTsKLSAgICB0bXBbNl0gPSBkbls2XTsKLSAgICB0bXBbN10gPSBkbls3XTsKLSAgICB0bXBbOF0gPSBkbls4XTsKLSAgICBkblswXSA9IGRuWzFdID0gZG5bMl0gPSBkblszXSA9IGRuWzRdID0gZG5bNV0gPSBkbls2XSA9IGRuWzddID0gZG5bOF0gPSA2NTUzNjsKLQotICAgIHN3aXRjaCAobmV3X2xvYykKLSAgICB7Ci0gICAgICAgIGNhc2UgMDoKLSAgICAgICAgICAgIGJyZWFrOwotICAgICAgICBjYXNlIDE6Ci0gICAgICAgICAgICBkbls0XSA9IHRtcFsyXTsKLSAgICAgICAgICAgIGRuWzVdID0gdG1wWzBdOwotICAgICAgICAgICAgZG5bNl0gPSB0bXBbOF07Ci0gICAgICAgICAgICBicmVhazsKLSAgICAgICAgY2FzZSAyOgotICAgICAgICAgICAgZG5bNF0gPSB0bXBbM107Ci0gICAgICAgICAgICBkbls1XSA9IHRtcFs0XTsKLSAgICAgICAgICAgIGRuWzZdID0gdG1wWzBdOwotICAgICAgICAgICAgZG5bN10gPSB0bXBbOF07Ci0gICAgICAgICAgICBkbls4XSA9IHRtcFsxXTsKLSAgICAgICAgICAgIGJyZWFrOwotICAgICAgICBjYXNlIDM6Ci0gICAgICAgICAgICBkbls2XSA9IHRtcFs0XTsKLSAgICAgICAgICAgIGRuWzddID0gdG1wWzBdOwotICAgICAgICAgICAgZG5bOF0gPSB0bXBbMl07Ci0gICAgICAgICAgICBicmVhazsKLSAgICAgICAgY2FzZSA0OgotICAgICAgICAgICAgZG5bMV0gPSB0bXBbMl07Ci0gICAgICAgICAgICBkblsyXSA9IHRtcFszXTsKLSAgICAgICAgICAgIGRuWzZdID0gdG1wWzVdOwotICAgICAgICAgICAgZG5bN10gPSB0bXBbNl07Ci0gICAgICAgICAgICBkbls4XSA9IHRtcFswXTsKLSAgICAgICAgICAgIGJyZWFrOwotICAgICAgICBjYXNlIDU6Ci0gICAgICAgICAgICBkblsxXSA9IHRtcFswXTsKLSAgICAgICAgICAgIGRuWzJdID0gdG1wWzRdOwotICAgICAgICAgICAgZG5bOF0gPSB0bXBbNl07Ci0gICAgICAgICAgICBicmVhazsKLSAgICAgICAgY2FzZSA2OgotICAgICAgICAgICAgZG5bMV0gPSB0bXBbOF07Ci0gICAgICAgICAgICBkblsyXSA9IHRtcFswXTsKLSAgICAgICAgICAgIGRuWzNdID0gdG1wWzRdOwotICAgICAgICAgICAgZG5bNF0gPSB0bXBbNV07Ci0gICAgICAgICAgICBkbls4XSA9IHRtcFs3XTsKLSAgICAgICAgICAgIGJyZWFrOwotICAgICAgICBjYXNlIDc6Ci0gICAgICAgICAgICBkblsyXSA9IHRtcFs4XTsKLSAgICAgICAgICAgIGRuWzNdID0gdG1wWzBdOwotICAgICAgICAgICAgZG5bNF0gPSB0bXBbNl07Ci0gICAgICAgICAgICBicmVhazsKLSAgICAgICAgY2FzZSA4OgotICAgICAgICAgICAgZG5bMl0gPSB0bXBbMV07Ci0gICAgICAgICAgICBkblszXSA9IHRtcFsyXTsKLSAgICAgICAgICAgIGRuWzRdID0gdG1wWzBdOwotICAgICAgICAgICAgZG5bNV0gPSB0bXBbNl07Ci0gICAgICAgICAgICBkbls2XSA9IHRtcFs3XTsKLSAgICAgICAgICAgIGJyZWFrOwotICAgIH0KLSAgICBkblswXSA9IHRtcFtuZXdfbG9jXTsKLQotICAgIHJldHVybiA7Ci19Ci0KLS8qICAzLzI4LzAxLCBmaW5kIG1pbmltYWwgb2YgZG5bOV0gKi8KLQotaW50IEFWQ0ZpbmRNaW4oaW50IGRuW10pCi17Ci0gICAgaW50IG1pbiwgaTsKLSAgICBpbnQgZG1pbjsKLQotICAgIGRtaW4gPSBkblsxXTsKLSAgICBtaW4gPSAxOwotICAgIGZvciAoaSA9IDI7IGkgPCA5OyBpKyspCi0gICAgewotICAgICAgICBpZiAoZG5baV0gPCBkbWluKQotICAgICAgICB7Ci0gICAgICAgICAgICBkbWluID0gZG5baV07Ci0gICAgICAgICAgICBtaW4gPSBpOwotICAgICAgICB9Ci0gICAgfQotCi0gICAgcmV0dXJuIG1pbjsKLX0KLQotCi0KZGlmZiAtLWdpdCBhL21lZGlhL2xpYnN0YWdlZnJpZ2h0L2NvZGVjcy9hdmMvZW5jL3NyYy9yYXRlX2NvbnRyb2wuY3BwIGIvbWVkaWEvbGlic3RhZ2VmcmlnaHQvY29kZWNzL2F2Yy9lbmMvc3JjL3JhdGVfY29udHJvbC5jcHAKZGVsZXRlZCBmaWxlIG1vZGUgMTAwNjQ0CmluZGV4IDE1YjU1ZmIuLjAwMDAwMDAKLS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ElEUiovCi0gICAgICAgIHsKLSAgICAgICAgICAgIC8qIHNldCBmcmFtZSB0eXBlIHRvIElEUi1mcmFtZSAqLwotICAgICAgICAgICAgaWYgKHJhdGVDdHJsLT5pZHJQZXJpb2QpCi0gICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgZW5jdmlkLT5tb2RUaW1lUmVmICs9ICh1aW50MzIpKHJhdGVDdHJsLT5pZHJQZXJpb2QgKiAxMDAwIC8gcmF0ZUN0cmwtPmZyYW1lX3JhdGUpOwotICAgICAgICAgICAgICAgICpmcmFtZU51bSAtPSByYXRlQ3RybC0+aWRyUGVyaW9kOwotICAgICAgICAgICAgfQotICAgICAgICAgICAgZWxzZQotICAgICAgICAgICAgewotICAgICAgICAgICAgICAgIGVuY3ZpZC0+bW9kVGltZVJlZiArPSAodWludDMyKSh2aWRlby0+TWF4RnJhbWVOdW0gKiAxMDAwIC8gcmF0ZUN0cmwtPmZyYW1lX3JhdGUpOwotICAgICAgICAgICAgICAgICpmcmFtZU51bSAtPSB2aWRlby0+TWF4RnJhbWVOdW07Ci0gICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgIHZpZGVvLT5uYWxfdW5pdF90eXBlID0gQVZDX05BTFRZUEVfSURSOwotICAgICAgICAgICAgc2xpY2VIZHItPnNsaWNlX3R5cGUgPSBBVkNfSV9BTExfU0xJQ0U7Ci0gICAgICAgICAgICB2aWRlby0+c2xpY2VfdHlwZSA9IEFWQ19JX1NMSUNFOwotICAgICAgICAgICAgZW5jdmlkLT5wcmV2UHJvY0ZyYW1lTnVtID0gKmZyYW1lTnVtOwotICAgICAgICB9Ci0gICAgICAgIGVsc2UKLSAgICAgICAgewotICAgICAgICAgICAgdmlkZW8tPm5hbF91bml0X3R5cGUgPSBBVkNfTkFMVFlQRV9TTElDRTsKLSAgICAgICAgICAgIHNsaWNlSGRyLT5zbGljZV90eXBlID0gQVZDX1BfQUxMX1NMSUNFOwotICAgICAgICAgICAgdmlkZW8tPnNsaWNlX3R5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ci0gICAgICAgICAgICBMMSA9IDAuNjsKLSAgICAgICAgICAgIEwyID0gMS40OwotICAgICAgICAgICAgTDMgPSAyLjQ7Ci0gICAgICAgIH0KLQotICAgICAgICBpZiAocmF0ZUN0cmwtPmluaXRRUCA9PSAwKQotICAgICAgICB7Ci0gICAgICAgICAgICBpZiAoYnBwIDw9IEwxKQotICAgICAgICAgICAgICAgIHFwID0gMzU7Ci0gICAgICAgICAgICBlbHNlIGlmIChicHAgPD0gTDIpCi0gICAgICAgICAgICAgICAgcXAgPSAyNTsKLSAgICAgICAgICAgIGVsc2UgaWYgKGJwcCA8PSBMMykKLSAgICAgICAgICAgICAgICBxcCA9IDIwOwotICAgICAgICAgICAgZWxzZQotICAgICAgICAgICAgICAgIHFwID0gMTU7Ci0gICAgICAgICAgICByYXRlQ3RybC0+aW5pdFFQID0gcXA7Ci0gICAgICAgIH0KLQotICAgICAgICByYXRlQ3RybC0+UWMgPSByYXRlQ3RybC0+aW5pdFFQOwotICAgIH0KLQotICAgIHJldHVybiBBVkNFTkNfU1VDQ0VTUzsKLQotQ0xFQU5VUF9SQzoKLQotICAgIENsZWFudXBSYXRlQ29udHJvbE1vZHVsZShhdmNIYW5kbGUpOwotICAgIHJldHVybiBBVkNFTkNfTUVNT1JZX0ZBSUw7Ci0KLX0KLQotCi12b2lkIENsZWFudXBSYXRlQ29udHJvbE1vZHVsZShBVkNIYW5kbGUgKmF2Y0hhbmRsZSkKLXsKLSAgICBBVkNFbmNPYmplY3QgKmVuY3ZpZCA9IChBVkNFbmNPYmplY3QqKSBhdmNIYW5kbGUtPkFWQ09iamVjdDsKLSAgICBBVkNSYXRlQ29udHJvbCAqcmF0ZUN0cmwgPSBlbmN2aWQtPnJhdGVDdHJsOwotICAgIGludCBpOwotCi0gICAgaWYgKHJhdGVDdHJsLT5NQURvZk1CKQotICAgIHsKLSAgICAgICAgYXZjSGFuZGxlLT5DQkFWQ19GcmVlKGF2Y0hhbmRsZS0+dXNlckRhdGEsIChpbnQ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ZyYW1lUmFuZ2UgJiYgcHJldl9tYWQgPCAwLjAwMSkgLyogZmluZCBmaXJzdCBvbmUgd2l0aCBub256ZXJvIHByZXZfbWFkICovCi0gICAgICAgIHsKLSAgICAgICAgICAgIHByZXZfbWFkID0gcE1QLT5wUkRTYW1wbGVzW2ldWzBdLm1hZDsKLSAgICAgICAgICAgIGkrKzsKLSAgICAgICAgfQotCi0gICAgICAgIGlmIChpIDwgcE1QLT5mcmFtZVJhbmdlKQotICAgICAgICB7Ci0gICAgICAgICAgICBwcmV2X2FjdHVhbF9iaXRzID0gcE1QLT5wUkRTYW1wbGVzW2ktMV1bMF0uYWN0dWFsX2JpdHM7Ci0KLSAgICAgICAgICAgIGZvciAoaiA9IDA7IGkgPCBwTVAtPmZyYW1lUmFuZ2U7IGkrKykKLSAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICBpZiAocE1QLT5wUkRTYW1wbGVzW2ldWzBdLm1hZCAhPSAwICYmCi0gICAgICAgICAgICAgICAgICAgICAgICBBVkNfQUJTKHByZXZfbWFkIC0gY3Vycl9tYWQpID4gQVZDX0FCUyhwTVAtPnBSRFNhbXBsZXNbaV1bMF0ubWFkIC0gY3Vycl9tYWQpKQotICAgICAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAgICAgcHJldl9tYWQgPSBwTVAtPnBSRFNhbXBsZXNbaV1bMF0ubWFkOwotICAgICAgICAgICAgICAgICAgICBwcmV2X2FjdHVhbF9iaXRzID0gcE1QLT5wUkRTYW1wbGVzW2ldWzBdLmFjdHVhbF9iaXRzOwotICAgICAgICAgICAgICAgICAgICBqID0gaTsKLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICB9Ci0gICAgICAgICAgICBwcmV2X1FQID0gUVAyUXN0ZXAocE1QLT5wUkRTYW1wbGVzW2pdWzBdLlFQKTsKLQotICAgICAgICAgICAgZm9yIChpID0gMTsgaSA8IHBNUC0+c2FtcGxlc1BlckZyYW1lW2pdOyBpKyspCi0gICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgaWYgKEFWQ19BQlMocHJldl9hY3R1YWxfYml0cyAtIGN1cnJfdGFyZ2V0KSA+IEFWQ19BQlMocE1QLT5wUkRTYW1wbGVzW2pdW2ldLmFjdHVhbF9iaXRzIC0gY3Vycl90YXJnZXQpKQotICAgICAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAgICAgcHJldl9hY3R1YWxfYml0cyA9IHBNUC0+cFJEU2FtcGxlc1tqXVtpXS5hY3R1YWxfYml0czsKLSAgICAgICAgICAgICAgICAgICAgcHJldl9RUCA9IFFQMlFzdGVwKHBNUC0+cFJEU2FtcGxlc1tqXVtpXS5RUCk7Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgfQotICAgICAgICB9Ci0gICAgfQotCi0gICAgLy8gcXVhZHJhdGljIGFwcHJveGltYXRpb24KLSAgICBpZiAocHJldl9tYWQgPiAwLjAwMSkgLy8gb25seSB3aGVuIHByZXZfbWFkIGlzIGdyZWF0ZXIgdGhhbiAwLCBvdGhlcndpc2Uga2VlcCB1c2luZyB0aGUgc2FtZSBRUAotICAgIHsKLSAgICAgICAgcHJldl9SRCA9IChPc2NsRmxvYXQpcHJldl9hY3R1YWxfYml0cyAvIHByZXZfbWFkOwotICAgICAgICAvL3JhdGVDdHJsLT5RYyA9IChJbnQpKHByZXZfUVAgKiBzcXJ0KHByZXZfYWN0dWFsX2JpdHMvY3Vycl90YXJnZXQpICsgMC40KTsKLSAgICAgICAgaWYgKHByZXZfUVAgPT0gMC42MjUpIC8vIGFkZGVkIHRoaXMgdG8gYWxsb3cgZ2V0dGluZyBvdXQgb2YgUVAgPSAwIGVhc2lseQotICAgICAgICB7Ci0gICAgICAgICAgICBRc3RlcCA9IChpbnQpKHByZXZfUkQgLyBjdXJyX1JEICsgMC41KTsKLSAgICAgICAgfQotICAgICAgICBlbHNlCi0gICAgICAgIHsKLSAgICAgICAgICAgIC8vICAgICAgcmF0ZUN0cmwtPlFjID0o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N0cmVhbSBpcyBieXRlLWFsaWduZWQgKi8KLSAgICBqID0gMTY7Ci0gICAgd2hpbGUgKGogPiAwKQotICAgIHsKLSNpZiAoV09SRF9TSVpFPT0zMikKLSAgICAgICAgZm9yIChpID0gMDsgaSA8IDQ7IGkrKykKLSAgICAgICAgewotICAgICAgICAgICAgY29kZSA9ICooKHVpbnQqKXBTcmMpOwotICAgICAgICAgICAgcFNyYyArPSA0OwotICAgICAgICAgICAgKigodWludCopcERzdCkgPSBjb2RlOwotICAgICAgICAgICAgcERzdCArPSA0OwotICAgICAgICAgICAgc3RhdHVzID0gQml0c3RyZWFtV3JpdGVCaXRzKHN0cmVhbSwgMzIsIGNvZGUpOwotICAgICAgICB9Ci0jZWxzZQotICAgICAgICBmb3IgKGkgPSAwOyBpIDwgODsgaSsrKQotICAgICAgICB7Ci0gICAgICAgICAgICBjb2RlID0gKigodWludCopcFNyYyk7Ci0gICAgICAgICAgICBwU3JjICs9IDI7Ci0gICAgICAgICAgICAqKCh1aW50KilwRHN0KSA9IGNvZGU7Ci0gICAgICAgICAgICBwRHN0ICs9IDI7Ci0gICAgICAgICAgICBzdGF0dXMgPSBCaXRzdHJlYW1Xcml0ZUJpdHMoc3RyZWFtLCAxNiwgY29kZSk7Ci0gICAgICAgIH0KLSNlbmRpZgotICAgICAgICBwRHN0ICs9IG9mZnNldDsKLSAgICAgICAgcFNyYyArPSBvZmZzZXQ7Ci0gICAgICAgIGotLTsKLSAgICB9Ci0gICAgaWYgKHN0YXR1cyAhPSBBVkNFTkNfU1VDQ0VTUykgIC8qIGNoZWNrIG9ubHkgb25jZSBwZXIgbGluZSAqLwotICAgICAgICByZXR1cm4gc3RhdHVzOwotCi0gICAgcERzdCA9IHZpZGVvLT5jdXJyUGljLT5TY2IgKyAoKG9mZnNldDEgKyB4X3Bvc2l0aW9uKSA+PiAyKTsKLSAgICBwU3JjID0gY3VycklucHV0LT5ZQ2JDclsxXSArICgob2Zmc2V0MSArIHhfcG9zaXRpb24pID4+IDIpOwotICAgIG9mZnNldCA+Pj0gMTsKLQotICAgIGogPSA4OwotICAgIHdoaWxlIChqID4gMCkKLSAgICB7Ci0jaWYgKFdPUkRfU0laRT09MzIpCi0gICAgICAgIGZvciAoaSA9IDA7IGkgPCAyOyBpKyspCi0gICAgICAgIHsKLSAgICAgICAgICAgIGNvZGUgPSAqKCh1aW50KilwU3JjKTsKLSAgICAgICAgICAgIHBTcmMgKz0gNDsKLSAgICAgICAgICAgICooKHVpbnQqKXBEc3QpID0gY29kZTsKLSAgICAgICAgICAgIHBEc3QgKz0gNDsKLSAgICAgICAgICAgIHN0YXR1cyA9IEJpdHN0cmVhbVdyaXRlQml0cyhzdHJlYW0sIDMyLCBjb2RlKTsKLSAgICAgICAgfQotI2Vsc2UKLSAgICAgICAgZm9yIChpID0gMDsgaSA8IDQ7IGkrKykKLSAgICAgICAgewotICAgICAgICAgICAgY29kZSA9ICooKHVpbnQqKXBTcmMpOwotICAgICAgICAgICAgcFNyYyArPSAyOwotICAgICAgICAgICAgKigodWludCopcERzdCkgPSBjb2RlOwotICAgICAgICAgICAgcERzdCArPSAyOwotICAgICAgICAgICAgc3RhdHVzID0gQml0c3RyZWFtV3JpdGVCaXRzKHN0cmVhbSwgMTYsIGNvZGUpOwotICAgICAgICB9Ci0jZW5kaWYKLSAgICAgICAgcERzdCArPSBvZmZzZXQ7Ci0gICAgICAgIHBTcmMgKz0gb2Zmc2V0OwotICAgICAgICBqLS07Ci0gICAgfQotCi0gICAgaWYgKHN0YXR1cyAhPSBBVkNFTkNfU1VDQ0VTUykgIC8qIGNoZWNrIG9ubHkgb25jZSBwZXIgbGluZSAqLwotICAgICAgICByZXR1cm4gc3RhdHVzOwotCi0gICAgcERzdCA9IHZpZGVvLT5jdXJyUGljLT5TY3IgKyAoKG9mZnNldDEgKyB4X3Bvc2l0aW9uKSA+PiAyKTsKLSAgICBwU3JjID0gY3VycklucHV0LT5ZQ2JDclsyXSArICgob2Zmc2V0MSArIHhfcG9zaXRpb24pID4+IDIpOwotCi0gICAgaiA9IDg7Ci0gICAgd2hpbGUgKGogPiAwKQotICAgIHsKLSNpZiAoV09SRF9TSVpFPT0zMikKLSAgICAgICAgZm9yIChpID0gMDsgaSA8IDI7IGkrKykKLSAgICAgICAgewotICAgICAgICAgICAgY29kZSA9ICooKHVpbnQqKXBTcmMpOwotICAgICAgICAgICAgcFNyYyArPSA0OwotICAgICAgICAgICAgKigodWludCopcERzdCkgPSBjb2RlOwotICAgICAgICAgICAgcERzdCArPSA0OwotICAgICAgICAgICAgc3RhdHVzID0gQml0c3RyZWFtV3JpdGVCaXRzKHN0cmVhbSwgMzIsIGNvZGUpOwotICAgICAgICB9Ci0jZWxzZQotICAgICAgICBmb3IgKGkgPSAwOyBpIDwgNDsgaSsrKQotICAgICAgICB7Ci0gICAgICAgICAgICBjb2RlID0gKigodWludCopcFNyYyk7Ci0gICAgICAgICAgICBwU3JjICs9IDI7Ci0gICAgICAgICAgICAqKCh1aW50KilwRHN0KSA9IGNvZGU7Ci0gICAgICAgICAgICBwRHN0ICs9IDI7Ci0gICAgICAgICAgICBzdGF0dXMgPSBCaXRzdHJlYW1Xcml0ZUJpdHMoc3RyZWFtLCAxNiwgY29kZSk7Ci0gICAgICAgIH0KLSNlbmRpZgotICAgICAgICBwRHN0ICs9IG9mZnNldDsKLSAgICAgICAgcFNyYyArPSBvZmZzZXQ7Ci0gICAgICAgIGotLTsKLSAgICB9Ci0KLSAgICByZXR1cm4gc3RhdHVzOwotfQotCi0KLUFWQ0VuY19TdGF0dXMgZW5jX3Jlc2lkdWFsX2Jsb2NrKEFWQ0VuY09iamVjdCAqZW5jdmlkLCBBVkNSZXNpZHVhbFR5cGUgdHlwZSwgaW50IGNpbmR4LCBBVkNNYWNyb2Jsb2NrICpjdXJyTUIpCi17Ci0gICAgQVZDRW5jX1N0YXR1cyBzdGF0dXMgPSBBVkNFTkNfU1VDQ0VTUzsKLSAgICBBVkNDb21tb25PYmogKnZpZGVvID0gZW5jdmlkL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SAgICAgICAgICAgIHJ1biA9IGVuY3ZpZC0+cnVuZGM7Ci0gICAgICAgICAgICBUb3RhbENvZWZmID0gY2luZHg7IC8qIHNwZWNpYWwgY2FzZSAqLwotICAgICAgICAgICAgYmluZHggPSAwOwotICAgICAgICAgICAgY2luZHggPSAwOwotICAgICAgICAgICAgYnJlYWs7Ci0gICAgICAgIGNhc2UgQVZDX0ludHJhMTZBQzoKLSAgICAgICAgICAgIG1heE51bUNvZWZmID0gMTU7Ci0gICAgICAgICAgICBsZXZlbCA9IGVuY3ZpZC0+bGV2ZWxbY2luZHhdOwotICAgICAgICAgICAgcnVuID0gZW5jdmlkLT5ydW5bY2luZHhdOwotICAgICAgICAgICAgVG90YWxDb2VmZiA9IGN1cnJNQi0+bnpfY29lZmZbYmluZHhdOwotICAgICAgICAgICAgYnJlYWs7Ci0gICAgICAgIGNhc2UgQVZDX0Nocm9tYURDOiAgLyogaG93IHRvIGRpZmZlcmVudGlhdGUgQ2IgZnJvbSBDciAqLwotICAgICAgICAgICAgbWF4TnVtQ29lZmYgPSA0OwotICAgICAgICAgICAgY2RjID0gMTsKLSAgICAgICAgICAgIGlmIChjaW5keCA+PSA4KQotICAgICAgICAgICAgewotICAgICAgICAgICAgICAgIGxldmVsID0gZW5jdmlkLT5sZXZlbGNkYyArIDQ7Ci0gICAgICAgICAgICAgICAgcnVuID0gZW5jdmlkLT5ydW5jZGMgKyA0OwotICAgICAgICAgICAgICAgIFRvdGFsQ29lZmYgPSBjaW5keCAtIDg7ICAvKiBzcGVjaWFsIGNhc2UgKi8KLSAgICAgICAgICAgIH0KLSAgICAgICAgICAgIGVsc2UKLSAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICBsZXZlbCA9IGVuY3ZpZC0+bGV2ZWxjZGM7Ci0gICAgICAgICAgICAgICAgcnVuID0gZW5jdmlkLT5ydW5jZGM7Ci0gICAgICAgICAgICAgICAgVG90YWxDb2VmZiA9IGNpbmR4OyAgLyogc3BlY2lhbCBjYXNlICovCi0gICAgICAgICAgICB9Ci0gICAgICAgICAgICBicmVhazsKLSAgICAgICAgY2FzZSBBVkNfQ2hyb21hQUM6Ci0gICAgICAgICAgICBtYXhOdW1Db2VmZiA9IDE1OwotICAgICAgICAgICAgY2FjID0gMTsKLSAgICAgICAgICAgIGxldmVsID0gZW5jdmlkLT5sZXZlbFtjaW5keF07Ci0gICAgICAgICAgICBydW4gPSBlbmN2aWQtPnJ1bltjaW5keF07Ci0gICAgICAgICAgICBjaW5keCAtPSAxNjsKLSAgICAgICAgICAgIGJpbmR4ID0gMTYgKyBibGtJZHgyYmxrWFlbY2luZHg+PjJdW2NpbmR4JjNdOwotICAgICAgICAgICAgY2luZHggKz0gMTY7Ci0gICAgICAgICAgICBUb3RhbENvZWZmID0gY3Vyck1CLT5uel9jb2VmZltiaW5keF07Ci0gICAgICAgICAgICBicmVhazsKLSAgICAgICAgZGVmYXVsdDoKLSAgICAgICAgICAgIHJldHVybiBBVkNFTkNfRkFJTDsKLSAgICB9Ci0KLQotICAgIC8qIGZpbmQgVHJhaWxpbmdPbmVzICovCi0gICAgVHJhaWxpbmdPbmVzID0gMDsKLSAgICB6ZXJvc0xlZnQgPSAwOwotICAgIGkgPSBUb3RhbENvZWZmIC0gMTsKLSAgICBuQyA9IDE7Ci0gICAgd2hpbGUgKGkgPj0gMCkKLSAgICB7Ci0gICAgICAgIHplcm9zTGVmdCArPSBydW5baV07Ci0gICAgICAgIGlmIChuQyAmJiAobGV2ZWxbaV0gPT0gMSB8fCBsZXZlbFtpXSA9PSAtMSkpCi0gICAgICAgIHsKLSAgICAgICAgICAgIFRyYWlsaW5nT25lcysrOwotICAgICAgICB9Ci0gICAgICAgIGVsc2UKLSAgICAgICAgewotICAgICAgICAgICAgbkMgPSAwOwotICAgICAgICB9Ci0gICAgICAgIGktLTsKLSAgICB9Ci0gICAgaWYgKFRyYWlsaW5nT25lcyA+IDMpCi0gICAgewotICAgICAgICBUcmFpbGluZ09uZXMgPSAzOyAvKiBjbGlwIGl0ICovCi0gICAgfQotCi0gICAgaWYgKCFjZGMpCi0gICAgewotICAgICAgICBpZiAoIWNhYykgIC8qIG5vdCBjaHJvbWEgKi8KLSAgICAgICAgewotICAgICAgICAgICAgbkMgPSBwcmVkaWN0X25ueih2aWRlbywgYmluZHggJiAzLCBiaW5keCA+PiAyKTsKLSAgICAgICAgfQotICAgICAgICBlbHNlIC8qIGNocm9tYSBhYyBidXQgbm90IGNocm9tYSBkYyAqLwotICAgICAgICB7Ci0gICAgICAgICAgICBuQyA9IHByZWRpY3Rfbm56X2Nocm9tYSh2aWRlbywgYmluZHggJiAzLCBiaW5keCA+PiAyKTsKLSAgICAgICAgfQotCi0gICAgICAgIHN0YXR1cyA9IGNlX1RvdGFsQ29lZmZUcmFpbGluZ09uZXMoc3RyZWFtLCBUcmFpbGluZ09uZXMsIFRvdGFsQ29lZmYsIG5DKTsKLSAgICB9Ci0gICAgZWxzZQotICAgIHsKLSAgICAgICAgbkMgPSAtMTsgLyogQ2hyb21hIERDIGxldmVsICovCi0gICAgICAgIHN0YXR1cyA9IGNlX1RvdGFsQ29lZmZUcmFpbGluZ09uZXNDaHJvbWFEQyhzdHJlYW0sIFRyYWlsaW5nT25lcywgVG90YWxDb2VmZik7Ci0gICAgfQotCi0gICAgLyogVGhpcyBwYXJ0IGlzIGRvbmUgcXVpdGUgZGlmZmVyZW50bHkgaW4gUmVhZENvZWY0eDRfQ0FWTEMoKSAqLwotICAgIGlmIChUb3RhbENvZWZmID4gMCkKLSAgICB7Ci0KLSAgICAgICAgaSA9IFRvdGFsQ29lZmYgLSAxOwotCi0gICAgICAgIGlmIChUcmFpbGluZ09uZXMpIC8qIGtlZXAgcmVhZGluZyB0aGUgc2lnbiBvZiB0aG9zZSB0cmFpbGluZyBvbmVzICovCi0gICAgICAgIHsKLSAgICAgICAgICAgIG5DID0gVHJhaWxpbmdPbmVzOwotICAgICAgICAgICAgdHJhaWxpbmdfb25lc19zaWduX2ZsYWcgPSAwOwotICAgICAgICAgICAgd2hpbGUgKG5DKQotICAgICAgICAgICAgewotICAgICAgICAgICAgICAgIHRyYWlsaW5nX29uZXNfc2lnbl9mbGFnIDw8PSAxOwotICAgICAgICAgICAgICAgIHRyYWlsaW5nX29uZXNfc2lnbl9mbGFnIHw9ICgodWludDMyKWxldmVsW2ktLV0gPj4gMzEpOyAvKiAwIG9yIHBvc2l0aXZlLCAxIGZvciBuZWdhdGl2ZSAqLwotICAgICAgICAgICAgICAgIG5DLS07Ci0gICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgIC8qIGluc3RlYWQgb2Ygd3JpdGluZyBvbmUgYml0IGF0IGEgdGltZSwgcmVhZCB0aGUgd2hvbGUgdGhpbmcgYXQgb25jZSAqLwotICAgICAgICAgICAgc3RhdHVzID0gQml0c3RyZWFtV3JpdGVCaXRzKHN0cmVhbSwgVHJhaWxpbmdPbmVzLCB0cmFpbGluZ19vbmVzX3NpZ25fZmxhZyk7Ci0gICAgICAgIH0KLQotICAgICAgICBsZXZlbF90d29fb3JfaGlnaGVyID0gMTsKLSAgICAgICAgaWYgKFRvdGFsQ29lZmYgPiAzICYmIFRyYWlsaW5nT25lcyA9PSAzKQotICAgICAgICB7Ci0gICAgICAgICAgICBsZXZlbF90d29fb3JfaGlnaGVyID0gMDsKLSAgICAgICAgfQotCi0gICAgICAgIGlmIChUb3RhbENvZWZmID4gMTAgJiYgVHJhaWxpbmdPbmVzIDwgMykKLSAgICAgICAgewotICAgICAgICAgICAgdmxjbnVtID0gMTsKLSAgICAgICAgfQotICAgICAgICBlbHNlCi0gICAgICAgIHsKLSAgICAgICAgICAgIHZsY251bSA9IDA7Ci0gICAgICAgIH0KLQotICAgICAgICAvKiB0aGVuIGRvIHRoaXMgVG90YWxDb2VmZi1UcmFpbGluZ09uZXMgdGltZXMgKi8KLSAgICAgICAgZm9yIChpID0gVG90YWxDb2VmZiAtIFRyYWlsaW5nT25lcyAtIDE7IGkgPj0gMDsgaS0tKQotICAgICAgICB7Ci0gICAgICAgICAgICB2YWx1ZSA9IGxldmVsW2ldOwotICAgICAgICAgICAgYWJzdmFsdWUgPSAodmFsdWUgPj0gMCkgPyB2YWx1ZSA6IC12YWx1ZTsKLQotICAgICAgICAgICAgaWYgKGxldmVsX3R3b19vcl9oaWdoZXIpCi0gICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgaWYgKHZhbHVlID4gMCkgdmFsdWUtLTsKLSAgICAgICAgICAgICAgICBlbHNlICAgIHZhbHVlKys7Ci0gICAgICAgICAgICAgICAgbGV2ZWxfdHdvX29yX2hpZ2hlciA9IDA7Ci0gICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgIGlmICh2YWx1ZSA+PSAwKQotICAgICAgICAgICAgewotICAgICAgICAgICAgICAgIHNpZ24gPSAwOwotICAgICAgICAgICAgfQotICAgICAgICAgICAgZWxzZQotICAgICAgICAgICAgewotICAgICAgICAgICAgICAgIHNpZ24gPSAxOwotICAgICAgICAgICAgICAgIHZhbHVlID0gLXZhbHVlOwotICAgICAgICAgICAgfQotCi0gICAgICAgICAgICBpZiAodmxjbnVtID09IDApIC8vIFZMQzEKLSAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICBpZiAodmFsdWUgPCA4KQotICAgICAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAgICAgc3RhdHVzID0gQml0c3RyZWFtV3JpdGVCaXRzKHN0cmVhbSwgdmFsdWUgKiAyICsgc2lnbiAtIDEsIDEpOwotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICBlbHNlIGlmICh2YWx1ZSA8IDggKyA4KQotICAgICAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAgICAgc3RhdHVzID0gQml0c3RyZWFtV3JpdGVCaXRzKHN0cmVhbSwgMTQgKyAxICsgNCwgKDEgPDwgNCkgfCAoKHZhbHVlIC0gOCkgPDwgMSkgfCBzaWduKTsKLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgZWxzZQotICAgICAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAgICAgc3RhdHVzID0gQml0c3RyZWFtV3JpdGVCaXRzKHN0cmVhbSwgMTQgKyAyICsgMTIsICgxIDw8IDEyKSB8ICgodmFsdWUgLSAxNikgPDwgMSkgfCBzaWduKSA7Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgfQotICAgICAgICAgICAgZWxzZSAgLy8gVkxDTgotICAgICAgICAgICAgewotICAgICAgICAgICAgICAgIHNoaWZ0ID0gdmxjbnVtIC0gMTsKLSAgICAgICAgICAgICAgICBlc2NhcGUgPSAoMTUgPDwgc2hpZnQpICsgMTsKLSAgICAgICAgICAgICAgICBudW1QcmVmaXggPSAodmFsdWUgLSAxKSA+PiBzaGlmdDsKLSAgICAgICAgICAgICAgICBzdWZtYXNrID0gfigoMHhmZmZmZmZmZikgPDwgc2hpZnQpOwotICAgICAgICAgICAgICAgIHN1ZmZpeCA9ICh2YWx1ZSAtIDEpICYgc3VmbWFzazsKLSAgICAgICAgICAgICAgICBpZiAodmFsdWUgPCBlc2NhcGUpCi0gICAgICAgICAgICAgICAgewotICAgICAgICAgICAgICAgICAgICBzdGF0dXMgPSBCaXRzdHJlYW1Xcml0ZUJpdHMoc3RyZWFtLCBudW1QcmVmaXggKyB2bGNudW0gKyAxLCAoMSA8PCAoc2hpZnQgKyAxKSkgfCAoc3VmZml4IDw8IDEpIHwgc2lnbik7Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgIGVsc2UKLSAgICAgICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgICAgIHN0YXR1cyA9IEJpdHN0cmVhbVdyaXRlQml0cyhzdHJlYW0sIDI4LCAoMSA8PCAxMikgfCAoKHZhbHVlIC0gZXNjYXBlKSA8PCAxKSB8IHNpZ24pOwotICAgICAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgfQotCi0gICAgICAgICAgICBpZiAoYWJzdmFsdWUgPiBpbmNWbGNbdmxjbnVtXSkKLSAgICAgICAgICAgICAgICB2bGNudW0rKzsKLQotICAgICAgICAgICAgaWYgKGkgPT0gVG90YWxDb2VmZiAtIFRyYWlsaW5nT25lcyAtIDEgJiYgYWJzdmFsdWUgPiAzKQotICAgICAgICAgICAgICAgIHZsY251bSA9IDI7Ci0gICAgICAgIH0KLQotICAgICAgICBpZiAoc3RhdHVzICE9IEFWQ0VOQ19TVUNDRVNTKSAgLyogb2NjYXNpb25hbGx5IGNoZWNrIHRoZSBiaXRzdHJlYW0gKi8KLSAgICAgICAgewotICAgICAgICAgICAgcmV0dXJuIHN0YXR1czsKLSAgICAgICAgfQotICAgICAgICBpZiAoVG90YWxDb2VmZiA8IG1heE51bUNvZWZmKQotICAgICAgICB7Ci0gICAgICAgICAgICBpZiAoIWNkYykKLSAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICBjZV9Ub3RhbFplcm9zKHN0cmVhbSwgemVyb3NMZWZ0LCBUb3RhbENvZWZmKTsKLSAgICAgICAgICAgIH0KLSAgICAgICAgICAgIGVsc2UKLSAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICBjZV9Ub3RhbFplcm9zQ2hyb21hREMoc3RyZWFtLCB6ZXJvc0xlZnQsIFRvdGFsQ29lZmYpOwotICAgICAgICAgICAgfQotICAgICAgICB9Ci0gICAgICAgIGVsc2UKLSAgICAgICAgewotICAgICAgICAgICAgemVyb3NMZWZ0ID0gMDsKLSAgICAgICAgfQotCi0gICAgICAgIGkgPSBUb3RhbENvZWZmIC0gMTsKLSAgICAgICAgd2hpbGUgKGkgPiAwKSAvKiBkb24ndCBkbyB0aGUgbGFzdCBvbmUgKi8KLSAgICAgICAgewotICAgICAgICAgICAgaWYgKHplcm9zTGVmdCA+IDApCi0gICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgY2VfUnVuQmVmb3JlKHN0cmVhbSwgcnVuW2ldLCB6ZXJvc0xlZnQpOwotICAgICAgICAgICAgfQotCi0gICAgICAgICAgICB6ZXJvc0xlZnQgP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i0KLSNlbmRpZgotCi0KLS8qIGNvbnNpc3Qgb2YKLWludCBBVkNTQURfTWFjcm9ibG9ja19DKHVpbnQ4ICpyZWYsdWludDggKmJsayxpbnQgZG1pbixpbnQgbHgsdm9pZCAqZXh0cmFfaW5mbykKLWludCBBVkNTQURfTUJfSFRGTV9Db2xsZWN0KHVpbnQ4ICpyZWYsdWludDggKmJsayxpbnQgZG1pbixpbnQgbHgsdm9pZCAqZXh0cmFfaW5mbykKLWludCBBVkNTQURfTUJfSFRGTSh1aW50OCAqcmVmLHVpbnQ4ICpibGssaW50IGRtaW4saW50IGx4LHZvaWQgKmV4dHJhX2luZm8pCi0qLwotCi0KLS8qPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09Ci0gICAgRnVuY3Rpb246ICAgU0FEX01hY3JvYmxvY2sKLSAgICBEYXRlOiAgICAgICAwOS8wNy8yMDAwCi0gICAgUHVycG9zZTogICAgQ29tcHV0ZSBTQUQgMTZ4MTYgYmV0d2VlbiBibGsgYW5kIHJlZi4KLSAgICBUbyBkbzogICAgICBVbmlmb3JtIHN1YnNhbXBsaW5nIHdpbGwgYmUgaW5zZXJ0ZWQgbGF0ZXIhCi0gICAgICAgICAgICAgICAgSHlwb3RoZXNpcyBUZXN0aW5nIEZhc3QgTWF0Y2hpbmcgdG8gYmUgdXNlZCBsYXRlciEKLSAgICBDaGFuZ2VzOgotICAgIDExLzcvMDA6ICAgIGltcGxlbWVudGVkIE1NWAotICAgIDEvMjQvMDE6ICAgIGltcGxlbWVudGVkIFNTRQotPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09Ki8KLS8qKioqKioqKioqIEMgKioqKioqKioqKioqLwotaW50IEFWQ1NBRF9NYWNyb2Jsb2NrX0ModWludDggKnJlZiwgdWludDggKmJsaywgaW50IGRtaW5fbHgsIHZvaWQgKmV4dHJhX2luZm8pCi17Ci0gICAgKHZvaWQpKGV4dHJhX2luZm8pOwotCi0gICAgaW50MzIgeDEwOwotICAgIGludCBkbWluID0gKHVpbnQzMilkbWluX2x4ID4+IDE2OwotICAgIGludCBseCA9IGRtaW5fbHggJiAweEZGRkY7Ci0KLSAgICBOVU1fU0FEX01CX0NBTEwoKTsKLQotICAgIHgxMCA9IHNpbWRfc2FkX21iKHJlZiwgYmxrLCBkbWluLCBseCk7Ci0KLSAgICByZXR1cm4geDEwOwotfQotCi0jaWZkZWYgSFRGTSAgIC8qIEhURk0gd2l0aCB1bmlmb3JtIHN1YnNhbXBsaW5nIGltcGxlbWVudGF0aW9uIDIvMjgvMDEgKi8KLS8qPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09Ci0gICAgRnVuY3Rpb246ICAgQVZDQVZDU0FEX01CX0hURk1fQ29sbGVjdCBhbmQgQVZDU0FEX01CX0hURk0KLSAgICBEYXRlOiAgICAgICAzLzIvMQotICAgIFB1cnBvc2U6ICAgIENvbXB1dGUgdGhlIFNBRCBvbiBhIDE2eDE2IGJsb2NrIHVzaW5nCi0gICAgICAgICAgICAgICAgdW5pZm9ybSBzdWJzYW1wbGluZyBhbmQgaHlwb3RoZXNpcyB0ZXN0aW5nIGZhc3QgbWF0Y2hpbmcKLSAgICAgICAgICAgICAgICBmb3IgZWFybHkgZHJvcG91dC4gU0FEX01CX0hQX0hURk1fQ29sbGVjdCBpcyB0byBjb2xsZWN0Ci0gICAgICAgICAgICAgICAgdGhlIHN0YXRpc3RpY3MgdG8gY29tcHV0ZSB0aGUgdGhyZXNob2xkcyB0byBiZSB1c2VkIGluCi0gICAgICAgICAgICAgICAgU0FEX01CX0hQX0hURk0uCi0gICAgSW5wdXQvT3V0cHV0OgotICAgIENoYW5nZXM6Ci0gID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PSovCi0KLWludCBBV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AgICAgICBzYWQgPSBTVUJfU0FEKHNhZCwgdG1wLCB0bXAyKTsKLQotICAgICAgICBOVU1fU0FEX01CKCk7Ci0KLSAgICAgICAgc2FkZGF0YVtpXSA9IHNhZDsKLQotICAgICAgICBpZiAoaSA+IDApCi0gICAgICAgIHsKLSAgICAgICAgICAgIGlmICgodWludDMyKXNhZCA+ICgodWludDMyKWRtaW5fbHggPj4gMTYpKQotICAgICAgICAgICAgewotICAgICAgICAgICAgICAgIGRpZm1hZCA9IHNhZGRhdGFbMF0gLSAoKHNhZGRhdGFbMV0gKyAxKSA+PiAxKTsKLSAgICAgICAgICAgICAgICAoKmFic19kaWZfbWFkX2F2ZykgKz0gKChkaWZtYWQgPiAwKSA/IGRpZm1hZCA6IC1kaWZtYWQpOwotICAgICAgICAgICAgICAgICgqY291bnRicmVhaykrKzsKLSAgICAgICAgICAgICAgICByZXR1cm4gc2FkOwotICAgICAgICAgICAgfQotICAgICAgICB9Ci0gICAgfQotCi0gICAgZGlmbWFkID0gc2FkZGF0YVswXSAtICgoc2FkZGF0YVsxXSArIDEpID4+IDEpOwotICAgICgqYWJzX2RpZl9tYWRfYXZnKSArPSAoKGRpZm1hZCA+IDApID8gZGlmbWFkIDogLWRpZm1hZCk7Ci0gICAgKCpjb3VudGJyZWFrKSsrOwotICAgIHJldHVybiBzYWQ7Ci19Ci0KLWludCBBVkNTQURfTUJfSFRGTSh1aW50OCAqcmVmLCB1aW50OCAqYmxrLCBpbnQgZG1pbl9seCwgdm9pZCAqZXh0cmFfaW5mbykKLXsKLSAgICBpbnQgc2FkID0gMDsKLSAgICB1aW50OCAqcDE7Ci0KLSAgICBpbnQgaTsKLSAgICBpbnQgdG1wLCB0bXAyOwotICAgIGludCBseDQgPSAoZG1pbl9seCA8PCAyKSAmIDB4M0ZGRkM7Ci0gICAgaW50IHNhZHN0YXIgPSAwLCBtYWRzdGFyOwotICAgIGludCAqbnJtbHpfdGggPSAoaW50KikgZXh0cmFfaW5mbzsKLSAgICBpbnQgKm9mZnNldFJlZiA9IChpbnQqKSBleHRyYV9pbmZvICsgMzI7Ci0gICAgdWludDMyIGN1cl93b3JkOwotCi0gICAgbWFkc3RhciA9ICh1aW50MzIpZG1pbl9seCA+PiAyMDsKLQotICAgIE5VTV9TQURfTUJfQ0FMTCgpOwotCi0gICAgYmxrIC09IDQ7Ci0gICAgZm9yIChpID0gMDsgaSA8IDE2OyBpKyspCi0gICAgewotICAgICAgICBwMSA9IHJlZiArIG9mZnNldFJlZltpXTsKLSAgICAgICAgY3VyX3dvcmQgPSAqKCh1aW50MzIqKShibGsgKz0gNCkpOwotICAgICAgICB0bXAgPSBwMVsxMl07Ci0gICAgICAgIHRtcDIgPSAoY3VyX3dvcmQgPj4gMjQpICYgMHhGRjsKLSAgICAgICAgc2FkID0gU1VCX1NBRChzYWQsIHRtcCwgdG1wMik7Ci0gICAgICAgIHRtcCA9IHAxWzhdOwotICAgICAgICB0bXAyID0gKGN1cl93b3JkID4+IDE2KSAmIDB4RkY7Ci0gICAgICAgIHNhZCA9IFNVQl9TQUQoc2FkLCB0bXAsIHRtcDIpOwotICAgICAgICB0bXAgPSBwMVs0XTsKLSAgICAgICAgdG1wMiA9IChjdXJfd29yZCA+PiA4KSAmIDB4RkY7Ci0gICAgICAgIHNhZCA9IFNVQl9TQUQoc2FkLCB0bXAsIHRtcDIpOwotICAgICAgICB0bXAgPSBwMVswXTsKLSAgICAgICAgcDEgKz0gbHg0OwotICAgICAgICB0bXAyID0gKGN1cl93b3JkICYgMHhGRik7Ci0gICAgICAgIHNhZCA9IFNVQl9TQUQoc2FkLCB0bXAsIHRtcDIpOwotCi0gICAgICAgIGN1cl93b3JkID0gKigodWludDMyKikoYmxrICs9IDQpKTsKLSAgICAgICAgdG1wID0gcDFbMTJdOwotICAgICAgICB0bXAyID0gKGN1cl93b3JkID4+IDI0KSAmIDB4RkY7Ci0gICAgICAgIHNhZCA9IFNVQl9TQUQoc2FkLCB0bXAsIHRtcDIpOwotICAgICAgICB0bX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oIHJlZ2lvbgotICAgIENoYW5nZXM6Ci0gICAgMTEvNy8wMDogICAgaW1wbGVtZW50ZWQgTU1YCi0gID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PSovCi0vKj09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQotICAgIEZ1bmN0aW9uOiAgIEFWQ1NBRF9NQl9IYWxmUGVsX0MKLSAgICBEYXRlOiAgICAgICAwNC8zMC8yMDAxCi0gICAgUHVycG9zZTogICAgQ29tcHV0ZSBTQUQgMTZ4MTYgYmV0d2VlbiBibGsgYW5kIHJlZiBpbiBoYWxmcGVsCi0gICAgICAgICAgICAgICAgcmVzb2x1dGlvbiwKLSAgICBDaGFuZ2VzOgotICA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0qLwotLyogT25lIGNvbXBvbmVudCBpcyBoYWxmLXBlbCAqLwotaW50IEFWQ1NBRF9NQl9IYWxmUGVsX0N4aHloKHVpbnQ4ICpyZWYsIHVpbnQ4ICpibGssIGludCBkbWluX3J4LCB2b2lkICpleHRyYV9pbmZvKQotewotICAgICh2b2lkKShleHRyYV9pbmZvKTsKLQotICAgIGludCBpLCBqOwotICAgIGludCBzYWQgPSAwOwotICAgIHVpbnQ4ICpraywgKnAxLCAqcDIsICpwMywgKnA0OwotLy8gIGludCBzdW1yZWY9MDsKLSAgICBpbnQgdGVtcDsKLSAgICBpbnQgcnggPSBkbWluX3J4ICYgMHhGRkZGOwotCi0gICAgTlVNX1NBRF9IUF9NQl9DQUxMKCk7Ci0KLSAgICBwMSA9IHJlZjsKLSAgICBwMiA9IHJlZiArIDE7Ci0gICAgcDMgPSByZWYgKyByeDsKLSAgICBwNCA9IHJlZiArIHJ4ICsgMTsKLSAgICBrayAgPSBibGs7Ci0KLSAgICBmb3IgKGkgPSAwOyBpIDwgMTY7IGkrKykKLSAgICB7Ci0gICAgICAgIGZvciAoaiA9IDA7IGogPCAxNjsgaisrKQotICAgICAgICB7Ci0KLSAgICAgICAgICAgIHRlbXAgPSAoKHAxW2pdICsgcDJbal0gKyBwM1tqXSArIHA0W2pdICsgMikgPj4gMikgLSAqa2srKzsKLSAgICAgICAgICAgIHNhZCArPSBBVkNfQUJTKHRlbXApOwotICAgICAgICB9Ci0KLSAgICAgICAgTlVNX1NBRF9IUF9NQigpOwotCi0gICAgICAgIGlmIChzYWQgPiAoaW50KSgodWludDMyKWRtaW5fcnggPj4gMTYpKQotICAgICAgICAgICAgcmV0dXJuIHNhZDsKLQotICAgICAgICBwMSArPSByeDsKLSAgICAgICAgcDMgKz0gcng7Ci0gICAgICAgIHAyICs9IHJ4OwotICAgICAgICBwNCArPSByeDsKLSAgICB9Ci0gICAgcmV0dXJuIHNhZDsKLX0KLQotaW50IEFWQ1NBRF9NQl9IYWxmUGVsX0N5aCh1aW50OCAqcmVmLCB1aW50OCAqYmxrLCBpbnQgZG1pbl9yeCwgdm9pZCAqZXh0cmFfaW5mbykKLXsKLSAgICAodm9pZCkoZXh0cmFfaW5mbyk7Ci0KLSAgICBpbnQgaSwgajsKLSAgICBpbnQgc2FkID0gMDsKLSAgICB1aW50OCAqa2ssICpwMSwgKnAyOwotLy8gIGludCBzdW1yZWY9MDsKLSAgICBpbnQgdGVtcDsKLSAgICBpbnQgcnggPSBkbWluX3J4ICYgMHhGRkZGOwotCi0gICAgTlVNX1NBRF9IUF9NQl9DQUxMKCk7Ci0KLSAgICBwMSA9IHJlZjsKLSAgICBwMiA9IHJlZiArIHJ4OyAvKiBlaXRoZXIgbGVmdC9yaWdodCBvciB0b3AvYm90dG9tIHBpeGVsICovCi0gICAga2sgID0gYmxrOwotCi0gICAgZm9yIChpID0gMDsgaSA8IDE2OyBpKyspCi0gICAgewotICAgICAgICBmb3IgKGogPSAwOyBqIDwgMTY7IGorKykKLSAgICAgICAgewotCi0gICAgICAgICAgICB0ZW1wID0gKChwMVtqXSArIHAyW2pdICsgMSkgPj4gMSkgLSAqa2srKzsKLSAgICAgICAgICAgIHNhZCArPSBBVkNfQUJTKHRlbXApOwotICAgICAgICB9Ci0KLSAgICAgICAgTlVNX1NBRF9IUF9NQigpOwotCi0gICAgICAgIGlmIChzYWQgPiAoaW50KSgodWludDMyKWRtaW5fcnggPj4gMTYpKQotICAgICAgICAgICAgcmV0dXJuIHNhZDsKLSAgICAgICAgcDEgKz0gcng7Ci0gICAgICAgIHAyICs9IHJ4OwotICAgIH0KLSAgICByZXR1cm4gc2FkOwotfQotCi1pbnQgQVZDU0FEX01CX0hhbGZQZWxfQ3hoKHVpbnQ4ICpyZWYsIHVpbnQ4ICpibGssIGludCBkbWluX3J4LCB2b2lkICpleHRyYV9pbmZvKQotewotICAgICh2b2lkKShleHRyYV9pbmZvKTsKLQotICAgIGludCBpLCBqOwotICAgIGludCBzYWQgPSAwOwotICAgIHVpbnQ4ICpraywgKnAxOwotICAgIGludCB0ZW1wOwotICAgIGludCByeCA9IGRtaW5fcnggJiAweEZGRkY7Ci0KLSAgICBOVU1fU0FEX0hQX01CX0NBTEwoKTsKLQotICAgIHAxID0gcmVmOwotICAgIGtrICA9IGJsazsKLQotICAgIGZvciAoaSA9IDA7IGkgPCAxNjsgaSsrKQotICAgIHsKLSAgICAgICAgZm9yIChqID0gMDsgaiA8IDE2OyBqKyspCi0gICAgICAgIHsKLQotICAgICAgICAgICAgdGVtcCA9ICgocDFbal0gKyBwMVtqKzFdICsgMSkgPj4gMSkgLSAqa2srKzsKLSAgICAgICAgICAgIHNhZCArPSBBVkNfQUJTKHRlbXApOwotICAgICAgICB9Ci0KLSAgICAgICAgTlVNX1NBRF9IUF9NQigpOwotCi0gICAgICAgIGlmIChzYWQgPiAoaW50KSgodWludDMyKWRtaW5fcnggPj4gMTYpKQotICAgICAgICAgICAgcmV0dXJuIHNhZDsKLSAgICAgICAgcDEgKz0gcng7Ci0gICAgfQotICAgIH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WYgKyBvZmZzZXRSZWZbaV07Ci0gICAgICAgIHAyID0gcDEgKyByeDsKLQotICAgICAgICBqID0gNDsvKiA0IGxpbmVzICovCi0gICAgICAgIGRvCi0gICAgICAgIHsKLSAgICAgICAgICAgIGN1cl93b3JkID0gKigodWludDMyKikoYmxrICs9IDQpKTsKLSAgICAgICAgICAgIHRtcCA9IHAxWzEyXSArIHAyWzEyXTsKLSAgICAgICAgICAgIHRtcDIgPSBwMVsxM10gKyBwMlsxM107Ci0gICAgICAgICAgICB0bXAgKz0gdG1wMjsKLSAgICAgICAgICAgIHRtcDIgPSAoY3VyX3dvcmQgPj4gMjQpICYgMHhGRjsKLSAgICAgICAgICAgIHRtcCArPSAyOwotICAgICAgICAgICAgc2FkID0gSU5URVJQMl9TVUJfU0FEKHNhZCwgdG1wLCB0bXAyKTs7Ci0gICAgICAgICAgICB0bXAgPSBwMVs4XSArIHAyWzhdOwotICAgICAgICAgICAgdG1wMiA9IHAxWzldICsgcDJbOV07Ci0gICAgICAgICAgICB0bXAgKz0gdG1wMjsKLSAgICAgICAgICAgIHRtcDIgPSAoY3VyX3dvcmQgPj4gMTYpICYgMHhGRjsKLSAgICAgICAgICAgIHRtcCArPSAyOwotICAgICAgICAgICAgc2FkID0gSU5URVJQMl9TVUJfU0FEKHNhZCwgdG1wLCB0bXAyKTs7Ci0gICAgICAgICAgICB0bXAgPSBwMVs0XSArIHAyWzRdOwotICAgICAgICAgICAgdG1wMiA9IHAxWzVdICsgcDJbNV07Ci0gICAgICAgICAgICB0bXAgKz0gdG1wMjsKLSAgICAgICAgICAgIHRtcDIgPSAoY3VyX3dvcmQgPj4gOCkgJiAweEZGOwotICAgICAgICAgICAgdG1wICs9IDI7Ci0gICAgICAgICAgICBzYWQgPSBJTlRFUlAyX1NVQl9TQUQoc2FkLCB0bXAsIHRtcDIpOzsKLSAgICAgICAgICAgIHRtcDIgPSBwMVsxXSArIHAyWzFdOwotICAgICAgICAgICAgdG1wID0gcDFbMF0gKyBwMlswXTsKLSAgICAgICAgICAgIHAxICs9IHJlZnd4NDsKLSAgICAgICAgICAgIHAyICs9IHJlZnd4NDsKLSAgICAgICAgICAgIHRtcCArPSB0bXAyOwotICAgICAgICAgICAgdG1wMiA9IChjdXJfd29yZCAmIDB4RkYpOwotICAgICAgICAgICAgdG1wICs9IDI7Ci0gICAgICAgICAgICBzYWQgPSBJTlRFUlAyX1NVQl9TQUQoc2FkLCB0bXAsIHRtcDIpOzsKLSAgICAgICAgfQotICAgICAgICB3aGlsZSAoLS1qKTsKLQotICAgICAgICBOVU1fU0FEX0hQX01CKCk7Ci0KLSAgICAgICAgc2FkZGF0YVtpXSA9IHNhZDsKLQotICAgICAgICBpZiAoaSA+IDApCi0gICAgICAgIHsKLSAgICAgICAgICAgIGlmIChzYWQgPiAoKHVpbnQzMilkbWluX3J4ID4+IDE2KSkKLSAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICBkaWZtYWQgPSBzYWRkYXRhWzBdIC0gKChzYWRkYXRhWzFdICsgMSkgPj4gMSk7Ci0gICAgICAgICAgICAgICAgKCphYnNfZGlmX21hZF9hdmcpICs9ICgoZGlmbWFkID4gMCkgPyBkaWZtYWQgOiAtZGlmbWFkKTsKLSAgICAgICAgICAgICAgICAoKmNvdW50YnJlYWspKys7Ci0gICAgICAgICAgICAgICAgcmV0dXJuIHNhZDsKLSAgICAgICAgICAgIH0KLSAgICAgICAgfQotICAgIH0KLSAgICBkaWZtYWQgPSBzYWRkYXRhWzBdIC0gKChzYWRkYXRhWzFdICsgMSkgPj4gMSk7Ci0gICAgKCphYnNfZGlmX21hZF9hdmcpICs9ICgoZGlmbWFkID4gMCkgPyBkaWZtYWQgOiAtZGlmbWFkKTsKLSAgICAoKmNvdW50YnJlYWspKys7Ci0KLSAgICByZXR1cm4gc2FkOwotfQotCi1pbnQgQVZDQVZDU0FEX01CX0hQX0hURk1fQ29sbGVjdHloKHVpbnQ4ICpyZWYsIHVpbnQ4ICpibGssIGludCBkbWluX3J4L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ICAgdG1wKys7Ci0gICAgICAgICAgICB0bXAyICs9IHRtcDsKLSAgICAgICAgICAgIHRtcCA9IChjdXJfd29yZCA+PiAyNCkgJiAweEZGOwotICAgICAgICAgICAgc2FkID0gSU5URVJQMV9TVUJfU0FEKHNhZCwgdG1wLCB0bXAyKTs7Ci0gICAgICAgICAgICB0bXAgPSBwMVs4XTsKLSAgICAgICAgICAgIHRtcDIgPSBwMls4XTsKLSAgICAgICAgICAgIHRtcCsrOwotICAgICAgICAgICAgdG1wMiArPSB0bXA7Ci0gICAgICAgICAgICB0bXAgPSAoY3VyX3dvcmQgPj4gMTYpICYgMHhGRjsKLSAgICAgICAgICAgIHNhZCA9IElOVEVSUDFfU1VCX1NBRChzYWQsIHRtcCwgdG1wMik7OwotICAgICAgICAgICAgdG1wID0gcDFbNF07Ci0gICAgICAgICAgICB0bXAyID0gcDJbNF07Ci0gICAgICAgICAgICB0bXArKzsKLSAgICAgICAgICAgIHRtcDIgKz0gdG1wOwotICAgICAgICAgICAgdG1wID0gKGN1cl93b3JkID4+IDgpICYgMHhGRjsKLSAgICAgICAgICAgIHNhZCA9IElOVEVSUDFfU1VCX1NBRChzYWQsIHRtcCwgdG1wMik7OwotICAgICAgICAgICAgdG1wID0gcDFbMF07Ci0gICAgICAgICAgICBwMSArPSByZWZ3eDQ7Ci0gICAgICAgICAgICB0bXAyID0gcDJbMF07Ci0gICAgICAgICAgICBwMiArPSByZWZ3eDQ7Ci0gICAgICAgICAgICB0bXArKzsKLSAgICAgICAgICAgIHRtcDIgKz0gdG1wOwotICAgICAgICAgICAgdG1wID0gKGN1cl93b3JkICYgMHhGRik7Ci0gICAgICAgICAgICBzYWQgPSBJTlRFUlAxX1NVQl9TQUQoc2FkLCB0bXAsIHRtcDIpOzsKLSAgICAgICAgfQotICAgICAgICB3aGlsZSAoLS1qKTsKLQotICAgICAgICBOVU1fU0FEX0hQX01CKCk7Ci0KLSAgICAgICAgc2FkZGF0YVtpXSA9IHNhZDsKLQotICAgICAgICBpZiAoaSA+IDApCi0gICAgICAgIHsKLSAgICAgICAgICAgIGlmIChzYWQgPiAoKHVpbnQzMilkbWluX3J4ID4+IDE2KSkKLSAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICBkaWZtYWQgPSBzYWRkYXRhWzBdIC0gKChzYWRkYXRhWzFdICsgMSkgPj4gMSk7Ci0gICAgICAgICAgICAgICAgKCphYnNfZGlmX21hZF9hdmcpICs9ICgoZGlmbWFkID4gMCkgPyBkaWZtYWQgOiAtZGlmbWFkKTsKLSAgICAgICAgICAgICAgICAoKmNvdW50YnJlYWspKys7Ci0gICAgICAgICAgICAgICAgcmV0dXJuIHNhZDsKLSAgICAgICAgICAgIH0KLSAgICAgICAgfQotICAgIH0KLSAgICBkaWZtYWQgPSBzYWRkYXRhWzBdIC0gKChzYWRkYXRhWzFdICsgMSkgPj4gMSk7Ci0gICAgKCphYnNfZGlmX21hZF9hdmcpICs9ICgoZGlmbWFkID4gMCkgPyBkaWZtYWQgOiAtZGlmbWFkKTsKLSAgICAoKmNvdW50YnJlYWspKys7Ci0KLSAgICByZXR1cm4gc2FkOwotfQotCi1pbnQgQVZDQVZDU0FEX01CX0hQX0hURk1fQ29sbGVjdHhoKHVpbnQ4ICpyZWYsIHVpbnQ4ICpibGssIGludCBkbWluX3J4LCB2b2lkICpleHRyYV9pbmZvKQotewotICAgIGludCBpLCBqOwotICAgIGludCBzYWQgPSAwOwotICAgIHVpbnQ4ICpwMTsKLSAgICBpbnQgcnggPSBkbWluX3J4ICYgMHhGRkZGOwotICAgIGludCByZWZ3eDQgPSByeCA8PCAyOwotICAgIGludCBzYWRkYXRhWzE2XTsgICAgICAvKiB1c2VkIHdoZW4gY29sbGVjdGluZyBmbGFnIChnbG9iYWwpIGlzIG9uICovCi0gICAgaW50IGRpZm1hZCwgdG1wLCB0bXAyOwotICAgIGludCBtYWRzdGFyOwotICAgIEhURk1fU3RhdCAqaHRmbV9zdGF0ID0gKEhURk1fU3RhdCopIGV4dHJhX2luZm87Ci0gICAgaW50ICphYnNfZGlmX21hZF9hdmcgPSAmKGh0Zm1fc3RhdC0+YWJzX2RpZl9tYWRfYXZnKTsKLSAgICBVSW50ICpjb3VudGJyZWFrID0gJihodGZtX3N0YXQtPmNvdW50YnJlYWspOwotICAgIGludCAqb2Zmc2V0UmVmID0gaHRmbV9zdGF0LT5vZmZzZXRSZWY7Ci0gICAgdWludDMyIGN1cl93b3JkOwotCi0gICAgbWFkc3RhciA9ICh1aW50MzIpZG1pbl9yeCA+PiAyMDsKLQotICAgIE5VTV9TQURfSFBfTUJfQ0FMTCgpOwotCi0gICAgYmxrIC09IDQ7Ci0KLSAgICBmb3IgKGkgPSAwOyBpIDwgMTY7IGkrKykgLyogMTYgc3RhZ2VzICovCi0gICAgewotICAgICAgICBwMSA9IHJlZiArIG9mZnNldFJlZltpXTsKLQotICAgICAgICBqID0gNDsgLyogNCBsaW5lcyAqLwotICAgICAgICBkbwotICAgICAgICB7Ci0gICAgICAgICAgICBjdXJfd29yZCA9ICooKHVpbnQzMiopKGJsayArPSA0KSk7Ci0gICAgICAgICAgICB0bXAgPSBwMVsxMl07Ci0gICAgICAgICAgICB0bXAyID0gcDFbMTNdOwotICAgICAgICAgICAgdG1wKys7Ci0gICAgICAgICAgICB0bXAyICs9IHRtcDsKLSAgICAgICAgICAgIHRtcCA9IChjdXJfd29yZCA+PiAyNCkgJiAweEZGOwotICAgICAgICAgICAgc2FkID0gSU5URVJQMV9TVUJfU0FEKHNhZCwgdG1wLCB0bXAyKTs7Ci0gICAgICAgICAgICB0bXAgPSBwMVs4XTsKLSAgICAgICAgICAgIHRtcDIgPSBwMVs5XTsKLSAgICAgICAgICAgIHRtcCsrOwotICAgICAgICAgICAgdG1wMiArPSB0bXA7Ci0gICAgICAgICAgICB0bXAgPSAoY3VyX3dvcmQgPj4gMTYpICYgMHhGRjsKLSAgICAgICAgICAgIHNhZCA9IElOVEVSUDFfU1VCX1NBRChzYWQsIHRtcCwgdG1wMik7OwotICAgICAgICAgICAgdG1wID0gcDFbNF07Ci0gICAgICAgICAgICB0bXAyID0gcDFbNV07Ci0gICAgICAgICAgICB0bXArKzsKLSAgICAgICAgICAgIHRtcDIgKz0gdG1wOwotICAgICAgICAgICAgdG1wID0gKGN1cl93b3JkID4+IDgpICYgMHhGRjsKLSAgICAgICAgICAgIHNhZCA9IElOVEVSUDFfU1VCX1NBRChzYWQsIHRtcCwgdG1wMik7OwotICAgICAgICAgICAgdG1wID0gcDFbMF07Ci0gICAgICAgICAgICB0bXAyID0gcDFbMV07Ci0gICAgICAgICAgICBwMSArPSByZWZ3eDQ7Ci0gICAgICAgICAgICB0bXArKzsKLSAgICAgICAgICAgIHRtcDIgKz0gdG1wOwotICAgICAgICAgICAgdG1wID0gKGN1cl93b3JkICYgMHhGRik7Ci0gICAgICAgICAgICBzYWQgPSBJTlRFUlAxX1NVQl9TQUQoc2FkLCB0bXAsIHRtcDIpOzsKLSAgICAgICAgfQotICAgICAgICB3aGlsZSAoLS1qKTsKLQotICAgICAgICBOVU1fU0FEX0hQX01CKCk7Ci0KLSAgICAgICAgc2FkZGF0YVtpXSA9IHNhZDsKLQotICAgICAgICBpZiAoaSA+IDApCi0gICAgICAgIHsKLSAgICAgICAgICAgIGlmIChzYWQgPiAoKHVpbnQzMilkbWluX3J4ID4+IDE2KSkKLSAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICBkaWZtYWQgPSBzYWRkYXRhWzBdIC0gKChzYWRkYXRhWzFdICsgMSkgPj4gMSk7Ci0gICAgICAgICAgICAgICAgKCphYnNfZGlmX21hZF9hdmcpICs9ICgoZGlmbWFkID4gMCkgPyBkaWZtYWQgOiAtZGlmbWFkKTsKLSAgICAgICAgICAgICAgICAoKmNvdW50YnJlYWspKys7Ci0gICAgICAgICAgICAgICAgcmV0dXJuIHNhZDsKLSAgICAgICAgICAgIH0KLSAgICAgICAgfQotICAgIH0KLSAgICBkaWZtYWQgPSBzYWRkYXRhWzBdIC0gKChzYWRkYXRhW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gICAgICAgICAgIHRtcCArPSB0bXAyOwotICAgICAgICAgICAgdG1wMiA9IChjdXJfd29yZCA+PiAyNCkgJiAweEZGOwotICAgICAgICAgICAgdG1wICs9IDI7Ci0gICAgICAgICAgICBzYWQgPSBJTlRFUlAyX1NVQl9TQUQoc2FkLCB0bXAsIHRtcDIpOzsKLSAgICAgICAgICAgIHRtcCA9IHAxWzhdICsgcDJbOF07Ci0gICAgICAgICAgICB0bXAyID0gcDFbOV0gKyBwMls5XTsKLSAgICAgICAgICAgIHRtcCArPSB0bXAyOwotICAgICAgICAgICAgdG1wMiA9IChjdXJfd29yZCA+PiAxNikgJiAweEZGOwotICAgICAgICAgICAgdG1wICs9IDI7Ci0gICAgICAgICAgICBzYWQgPSBJTlRFUlAyX1NVQl9TQUQoc2FkLCB0bXAsIHRtcDIpOzsKLSAgICAgICAgICAgIHRtcCA9IHAxWzRdICsgcDJbNF07Ci0gICAgICAgICAgICB0bXAyID0gcDFbNV0gKyBwMls1XTsKLSAgICAgICAgICAgIHRtcCArPSB0bXAyOwotICAgICAgICAgICAgdG1wMiA9IChjdXJfd29yZCA+PiA4KSAmIDB4RkY7Ci0gICAgICAgICAgICB0bXAgKz0gMjsKLSAgICAgICAgICAgIHNhZCA9IElOVEVSUDJfU1VCX1NBRChzYWQsIHRtcCwgdG1wMik7OwotICAgICAgICAgICAgdG1wMiA9IHAxWzFdICsgcDJbMV07Ci0gICAgICAgICAgICB0bXAgPSBwMVswXSArIHAyWzBdOwotICAgICAgICAgICAgcDEgKz0gcmVmd3g0OwotICAgICAgICAgICAgcDIgKz0gcmVmd3g0OwotICAgICAgICAgICAgdG1wICs9IHRtcDI7Ci0gICAgICAgICAgICB0bXAyID0gKGN1cl93b3JkICYgMHhGRik7Ci0gICAgICAgICAgICB0bXAgKz0gMjsKLSAgICAgICAgICAgIHNhZCA9IElOVEVSUDJfU1VCX1NBRChzYWQsIHRtcCwgdG1wMik7OwotICAgICAgICB9Ci0gICAgICAgIHdoaWxlICgt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ICAgICAgICAgICB0bXAgPSBwMVsxMl07Ci0gICAgICAgICAgICB0bXAyID0gcDJbMTJdOwotICAgICAgICAgICAgdG1wKys7Ci0gICAgICAgICAgICB0bXAyICs9IHRtcDsKLSAgICAgICAgICAgIHRtcCA9IChjdXJfd29yZCA+PiAyNCkgJiAweEZGOwotICAgICAgICAgICAgc2FkID0gSU5URVJQMV9TVUJfU0FEKHNhZCwgdG1wLCB0bXAyKTs7Ci0gICAgICAgICAgICB0bXAgPSBwMVs4XTsKLSAgICAgICAgICAgIHRtcDIgPSBwMls4XTsKLSAgICAgICAgICAgIHRtcCsrOwotICAgICAgICAgICAgdG1wMiArPSB0bXA7Ci0gICAgICAgICAgICB0bXAgPSAoY3VyX3dvcmQgPj4gMTYpICYgMHhGRjsKLSAgICAgICAgICAgIHNhZCA9IElOVEVSUDFfU1VCX1NBRChzYWQsIHRtcCwgdG1wMik7OwotICAgICAgICAgICAgdG1wID0gcDFbNF07Ci0gICAgICAgICAgICB0bXAyID0gcDJbNF07Ci0gICAgICAgICAgICB0bXArKzsKLSAgICAgICAgICAgIHRtcDIgKz0gdG1wOwotICAgICAgICAgICAgdG1wID0gKGN1cl93b3JkID4+IDgpICYgMHhGRjsKLSAgICAgICAgICAgIHNhZCA9IElOVEVSUDFfU1VCX1NBRChzYWQsIHRtcCwgdG1wMik7OwotICAgICAgICAgICAgdG1wID0gcDFbMF07Ci0gICAgICAgICAgICBwMSArPSByZWZ3eDQ7Ci0gICAgICAgICAgICB0bXAyID0gcDJbMF07Ci0gICAgICAgICAgICBwMiArPSByZWZ3eDQ7Ci0gICAgICAgICAgICB0bXArKzsKLSAgICAgICAgICAgIHRtcDIgKz0gdG1wOwotICAgICAgICAgICAgdG1wID0gKGN1cl93b3JkICYgMHhGRik7Ci0gICAgICAgICAgICBzYWQgPSBJTlRFUlAxX1NVQl9TQUQoc2FkLCB0bXAsIHRtcDIpOzsKLSAgICAgICAgfQotICAgICAgICB3aGlsZSAoLS1qKTsKLQotICAgIC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JdOwotICAgICAgICAgICAgdG1wMiA9IHAxWzEzXTsKLSAgICAgICAgICAgIHRtcCsrOwotICAgICAgICAgICAgdG1wMiArPSB0bXA7Ci0gICAgICAgICAgICB0bXAgPSAoY3VyX3dvcmQgPj4gMjQpICYgMHhGRjsKLSAgICAgICAgICAgIHNhZCA9IElOVEVSUDFfU1VCX1NBRChzYWQsIHRtcCwgdG1wMik7OwotICAgICAgICAgICAgdG1wID0gcDFbOF07Ci0gICAgICAgICAgICB0bXAyID0gcDFbOV07Ci0gICAgICAgICAgICB0bXArKzsKLSAgICAgICAgICAgIHRtcDIgKz0gdG1wOwotICAgICAgICAgICAgdG1wID0gKGN1cl93b3JkID4+IDE2KSAmIDB4RkY7Ci0gICAgICAgICAgICBzYWQgPSBJTlRFUlAxX1NVQl9TQUQoc2FkLCB0bXAsIHRtcDIpOzsKLSAgICAgICAgICAgIHRtcCA9IHAxWzRdOwotICAgICAgICAgICAgdG1wMiA9IHAxWzVdOwotICAgICAgICAgICAgdG1wKys7Ci0gICAgICAgICAgICB0bXAyICs9IHRtcDsKLSAgICAgICAgICAgIHRtcCA9IChjdXJfd29yZCA+PiA4KSAmIDB4RkY7Ci0gICAgICAgICAgICBzYWQgPSBJTlRFUlAxX1NVQl9TQUQoc2FkLCB0bXAsIHRtcDIpOzsKLSAgICAgICAgICAgIHRtcCA9IHAxWzBdOwotICAgICAgICAgICAgdG1wMiA9IHAxWzFdOwotICAgICAgICAgICAgcDEgKz0gcmVmd3g0OwotICAgICAgICAgICAgdG1wKys7Ci0gICAgICAgICAgICB0bXAyICs9IHRtcDsKLSAgICAgICAgICAgIHRtcCA9IChjdXJfd29yZCAmIDB4RkYpOwotICAgICAgICAgICAgc2FkID0gSU5URVJQMV9TVUJfU0FEKHNhZCwgdG1wLCB0bXAyKTs7Ci0gICAgICAgIH0KLSAgICAgICAgd2hpbGUgKC0taik7Ci0KLSAgICAgICAgTlVNX1NBRF9IUF9NQigpOwotCi0gICAgICAgIHNhZHN0YXI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DsKLQotICAgICAgICB4NiA9IDB4RkZGRjAwRkY7Ci0KLSAgICAgICAgcmVmIC09IGx4OwotICAgICAgICBibGsgLT0gMTY7Ci0KLSAgICAgICAgeDggPSAxNjsKLQotTE9PUF9TQUQwOgotICAgICAgICAvKioqKioqIHByb2Nlc3MgOCBwaXhlbHMgKioqKioqLwotICAgICAgICB4MTAgPSAqKCh1aW50MzIqKShyZWYgKz0gbHgpKTsKLSAgICAgICAgeDExID0gKigodWludDMyKikocmVmICsgNCkpOwotICAgICAgICB4MTIgPSAqKCh1aW50MzIqKShibGsgKz0gMTYpKTsKLSAgICAgICAgeDE0ID0gKigodWludDMyKikoYmxrICsgNCkpOwotCi0gICAgICAgIC8qIHByb2Nlc3MgeDExICYgeDE0ICovCi0gICAgICAgIHgxMSA9IHNhZF80cGl4ZWwoeDExLCB4MTQsIHg5KTsKLQotICAgICAgICAvKiBwcm9jZXNzIHgxMiAmIHgxMCAqLwotICAgICAgICB4MTAgPSBzYWRfNHBpeGVsKHgxMCwgeDEyLCB4OSk7Ci0KLSAgICAgICAgeDUgPSB4NSArIHgxMDsgLyogYWNjdW11bGF0ZSBsb3cgYnl0ZXMgKi8KLSAgICAgICAgeDEwID0geDEwICYgKHg2IDw8IDgpOyAvKiB4MTAgJiAweEZGMDBGRjAwICovCi0gICAgICAgIHg0ID0geDQgKyAoKHVpbnQzMil4MTAgPj4gOCk7ICAvKiBhY2N1bXVsYXRlIGhpZ2ggYnl0ZXMgKi8KLSAgICAgICAgeDUgPSB4NSArIHgxMTsgIC8qIGFjY3VtdWxhdGUgbG93IGJ5dGVzICovCi0gICAgICAgIHgxMSA9IHgxMSAmICh4NiA8PCA4KTsgLyogeDExICYgMHhGRjAwRkYwMCAqLwotICAgICAgICB4NCA9IHg0ICsgKCh1aW50MzIpeDExID4+IDgpOyAgLyogYWNjdW11bGF0ZSBoaWdoIGJ5dGVzICovCi0KLSAgICAgICAgLyoqKioqKiBwcm9jZXNzIDggcGl4ZWxzICoqKioqKi8KLSAgICAgICAgeDEwID0gKigodWludDMyKikocmVmICsgOCkpOwotICAgICAgICB4MTEgPSAqKCh1aW50MzIqKShyZWYgKyAxMikpOwotICAgICAgICB4MTIgPSAqKCh1aW50MzIqKShibGsgKyA4KSk7Ci0gICAgICAgIHgxNCA9ICooKHVpbnQzMiopKGJsayArIDEyKSk7Ci0KLSAgICAgICAgLyogcHJvY2VzcyB4MTEgJiB4MTQgKi8KLSAgICAgICAgeDExID0gc2FkXzRwaXhlbCh4MTEsIHgxNCwgeDkpOwotCi0gICAgICAgIC8qIHByb2Nlc3MgeDEyICYgeDEwICovCi0gICAgICAgIHgxMCA9IHNhZF80cGl4ZWwoeDEwLCB4MTIsIHg5KTsKLQotICAgICAgICB4NSA9IHg1ICsgeDEwOyAgLyogYWNjdW11bGF0ZSBsb3cgYnl0ZXMgKi8KLSAgICAgICAgeDEwID0geDEwICYgKHg2IDw8IDgpOyAvKiB4MTAgJiAweEZGMDBGRjAwICovCi0gICAgICAgIHg0ID0geDQgKyAoKHVpbnQzMil4MTAgPj4gOCk7IC8qIGFjY3VtdWxhdGUgaGlnaCBieXRlcyAqLwotICAgICAgICB4NSA9IHg1ICsgeDExOyAgLyogYWNjdW11bGF0ZSBsb3cgYnl0ZXMgKi8KLSAgICAgICAgeDExID0geDExICYgKHg2IDw8IDgpOyAvKiB4MTEgJiAweEZGMDBGRjAwICovCi0gICAgICAgIHg0ID0geDQgKyAoKHVpbnQzMil4MTEgPj4gOCk7ICAvKiBhY2N1bXVsYXRlIGhpZ2ggYnl0ZXMgKi8KLQotICAgICAgICAvKioqKioqKioqKioqKioqKi8KLSAgICAgICAgeDEwID0geDUgLSAoeDQgPDwgOCk7IC8qIGV4dHJhY3QgbG93IGJ5dGVzICovCi0gICAgICAgIHgxMCA9IHgxMCArIHg0OyAgICAgLyogYWRkIHdpdGggaGlnaCBieXRlcyAqLwotICAgICAgICB4MTAgPSB4MTAgKyAoeDEwIDw8IDE2KTsgLyogYWRkIHdpdGggbG93ZXIgaGFsZiB3b3JkICovCi0KLSAgICAgICAgaWYgKChpbnQpKCh1aW50MzIpeDEwID4+IDE2KSA8PSBkbWluKSAvKiBjb21wYXJlIHdpdGggZG1pbiAqLwotICAgICAgICB7Ci0gICAgICAgICAgICBpZiAoLS14OCkKLSAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICBnb3RvIExPT1BfU0FEMDsKLSAgICAgICAgICAgIH0KLQotICAgICAgICB9Ci0KLSAgICAgICAgcmV0dXJuICgodWludDMyKXgxMCA+PiAxNik7Ci0KLVNhZE1CT2Zmc2V0MzoKLQotICAgICAgICByZXR1cm4gc2FkX21iX29mZnNldDMocmVmLCBibGssIGx4LCBkbWluKTsKLQotU2FkTUJPZmZzZXQyOgotCi0gICAgICAgIHJldHVybiBzYWRfbWJfb2Zmc2V0MihyZWYsIGJsaywgbHgsIGRtaW4pOwotCi1TYWRNQk9mZnNldDE6Ci0KLSAgICAgICAgcmV0dXJuIHNhZF9tYl9vZmZzZXQxKHJlZiwgYmxrLCBseCwgZG1pbik7Ci0KLSAgICB9Ci0KLSNlbGlmIGRlZmluZWQoX19DQ19BUk0pICAvKiBvbmx5IHdvcmsgd2l0aCBhcm0gdjUgKi8KLQotICAgIF9faW5saW5lIGludDMyIFNVQl9TQUQoaW50MzIgc2FkLCBpbnQzMiB0bXAsIGludDMyIHRtcDIpCi0gICAgewotICAgICAgICBfX2FzbQotICAgICAgICB7Ci0gICAgICAgICAgICByc2JzICAgIHRtcCwgdG1wLCB0bXAyIDsKLSAgICAgICAgICAgIHJzYm1pICAgdG1wLCB0bXAsICMwIDsKLSAgICAgICAgICAgIGFkZCAgICAgc2FkLCBzYWQsIHRtcCA7Ci0gICAgICAgIH0KLQotICAgICAgICByZXR1cm4gc2FkOwotICAgIH0KLQotICAgIF9faW5saW5lIGludDMyIHNhZF80cGl4ZWwoaW50MzIgc3JjMSwgaW50MzIgc3JjMiwgaW50MzIgbWFzaykKLSAgICB7Ci0gICAgICAgIGludDMyIHg3OwotCi0gICAgICAgIF9fYXNtCi0gICAgICAgIHsKLSAgICAgICAgICAgIEVPUiAgICAgeDcsIHNyYzIsIHNyYzE7ICAgICAvKiBjaGVjayBvZGQvZXZlbiBjb21iaW5hdGlvbiAqLwotICAgICAgICAgICAgU1VCUyAgICBzcmMxLCBzcmMyLCBzcmMxOwotICAgICAgICAgICAgRU9SICAgICB4NywgeDcsIHNyYzE7Ci0gICAgICAgICAgICBBTkQgICAgIHg3LCBtYXNrLCB4NywgbHNyICMxOwotICAgICAgICAgICAgT1JSQ0MgICB4NywgeDcsICMweDgwMDAwMDAwOwotICAgICAgICAgICAgUlNCICAgICB4NywgeDcsIHg3LCBsc2wgIzg7Ci0gICAgICAgICAgICBBREQgICAgIHNyYzEsIHNyYzEsIHg3LCBhc3IgIzc7ICAgLyogYWRkIDB4RkYgdG8gdGhlIG5lZ2F0aXZlIGJ5dGUsIGFkZCBiYWNrIGNhcnJ5ICovCi0gICAgICAgICAgICBFT1IgICAgIHNyYzEsIHNyYzEsIHg3LCBhc3IgIzc7ICAgLyogdGFrZSBhYnNvbHV0ZSB2YWx1ZSBvZiBuZWdhdGl2ZSBieXRlICovCi0gICAgICAgIH0KLQotICAgICAgICByZXR1cm4gc3JjMTsKLSAgICB9Ci0KLSAgICBfX2lubGluZSBpbnQzMiBzYWRfNHBpeGVsTihpbnQzMiBzcmMxLCBpbnQzMiBzcmMyLCBpbnQzMiBtYXNrKQotICAgIHsKLSAgICAgICAgaW50MzIgeDc7Ci0KLSAgICAgICAgX19hc20KLSAgICAgICAgewotICAgICAgICAgICAgRU9SICAgICAgeDcsIHNyYzIsIHNyYzE7ICAgICAgICAvKiBjaGVjayBvZGQvZXZlbiBjb21iaW5hdGlvbiAqLwotICAgICAgICAgICAgQUREUyAgICAgc3JjMSwgc3JjMiwgc3JjMTsKLSAgICAgICAgICAgIEVPUiAgICAgIHg3LCB4Nywgc3JjMTsgICAgICAvKiBvbmx5IG9kZCBieXRlcyBuZWVkIHRvIG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CIKLQotI3VuZGVmIE5VTUJFUgotI2RlZmluZSBOVU1CRVIgMgotI3VuZGVmIFNISUZUCi0jZGVmaW5lIFNISUZUIDE2Ci0jdW5kZWYgSU5DX1g4Ci0jZGVmaW5lIElOQ19YOCAweDEwMDAwMDAxCi0jaW5jbHVkZSAic2FkX21iX29mZnNldC5oIgotCi0jdW5kZWYgTlVNQkVSCi0jZGVmaW5lIE5VTUJFUiAxCi0jdW5kZWYgU0hJRlQKLSNkZWZpbmUgU0hJRlQgOAotI3VuZGVmIElOQ19YOAotI2RlZmluZSBJTkNfWDggMHgwODAwMDAwMQotI2luY2x1ZGUgInNhZF9tYl9vZmZzZXQuaCIKLQotCi0gICAgX19pbmxpbmUgaW50MzIgc2ltZF9zYWRfbWIodWludDggKnJlZiwgdWludDggKmJsaywgaW50IGRtaW4sIGludCBseCkKLSAgICB7Ci0gICAgICAgIGludDMyIHg0LCB4NSwgeDYsIHg4LCB4OSwgeDEwLCB4MTEsIHgxMiwgeDE0OwotCi0gICAgICAgIHg5ID0gMHg4MDgwODA4MDsgLyogY29uc3QuICovCi0gICAgICAgIHg0ID0geDUgPSAwOwotCi0gICAgICAgIF9fYXNtCi0gICAgICAgIHsKLSAgICAgICAgICAgIE1PVlMgICAgeDgsIHJlZiwgbHNsICMzMSA7Ci0gICAgICAgICAgICBCSEkgICAgIFNhZE1CT2Zmc2V0MzsKLSAgICAgICAgICAgIEJDUyAgICAgU2FkTUJPZmZzZXQyOwotICAgICAgICAgICAgQk1JICAgICBTYWRNQk9mZnNldDE7Ci0KLSAgICAgICAgICAgIE1WTiAgICAgeDYsICMweEZGMDA7Ci0gICAgICAgIH0KLUxPT1BfU0FEMDoKLSAgICAgICAgLyoqKioqKiBwcm9jZXNzIDggcGl4ZWxzICoqKioqKi8KLSAgICAgICAgeDExID0gKigoaW50MzIqKShyZWYgKyAxMikpOwotICAgICAgICB4MTAgPSAqKChpbnQzMiopKHJlZiArIDgpKTsKLSAgICAgICAgeDE0ID0gKigoaW50MzIqKShibGsgKyAxMikpOwotICAgICAgICB4MTIgPSAqKChpbnQzMiopKGJsayArIDgpKTsKLQotICAgICAgICAvKiBwcm9jZXNzIHgxMSAmIHgxNCAqLwotICAgICAgICB4MTEgPSBzYWRfNHBpeGVsKHgxMSwgeDE0LCB4OSk7Ci0KLSAgICAgICAgLyogcHJvY2VzcyB4MTIgJiB4MTAgKi8KLSAgICAgICAgeDEwID0gc2FkXzRwaXhlbCh4MTAsIHgxMiwgeDkpOwotCi0gICAgICAgIHg1ID0geDUgKyB4MTA7ICAvKiBhY2N1bXVsYXRlIGxvdyBieXRlcyAqLwotICAgICAgICB4MTAgPSB4MTAgJiAoeDYgPDwgOCk7IC8qIHgxMCAmIDB4RkYwMEZGMDAgKi8KLSAgICAgICAgeDQgPSB4NCArICgodWludDMyKXgxMCA+PiA4KTsgLyogYWNjdW11bGF0ZSBoaWdoIGJ5dGVzICovCi0gICAgICAgIHg1ID0geDUgKyB4MTE7ICAvKiBhY2N1bXVsYXRlIGxvdyBieXRlcyAqLwotICAgICAgICB4MTEgPSB4MTEgJiAoeDYgPDwgOCk7IC8qIHgxMSAmIDB4RkYwMEZGMDAgKi8KLSAgICAgICAgeDQgPSB4NCArICgodWludDMyKXgxMSA+PiA4KTsgIC8qIGFjY3VtdWxhdGUgaGlnaCBieXRlcyAqLwotCi0gICAgICAgIF9fYXNtCi0gICAgICAgIHsKLSAgICAgICAgICAgIC8qKioqKiogcHJvY2VzcyA4IHBpeGVscyAqKioqKiovCi0gICAgICAgICAgICBMRFIgICAgIHgxMSwgW3JlZiwgIzRdOwotICAgICAgICAgICAgTERSICAgICB4MTAsIFtyZWZdLCBseCA7Ci0gICAgICAgICAgICBMRFIgICAgIHgxNCwgW2JsaywgIzRdOwotICAgICAgICAgICAgTERSICAgICB4MTIsIFtibGtdLCAjMTYgOwotICAgICAgICB9Ci0KLSAgICAgICAgLyogcHJvY2VzcyB4MTEgJiB4MTQgKi8KLSAgICAgICAgeDExID0gc2FkXzRwaXhlbCh4MTEsIHgxNCwgeDkpOwotCi0gICAgICAgIC8qIHByb2Nlc3MgeDEyICYgeDEwICovCi0gICAgICAgIHgxMCA9IHNhZF80cGl4ZWwoeDEwLCB4MTIsIHg5KTsKLQotICAgICAgICB4NSA9IHg1ICsgeDEwOyAgLyogYWNjdW11bGF0ZSBsb3cgYnl0ZXMgKi8KLSAgICAgICAgeDEwID0geDEwICYgKHg2IDw8IDgpOyAvKiB4MTAgJiAweEZGMDBGRjAwICovCi0gICAgICAgIHg0ID0geDQgKyAoKHVpbnQzMil4MTAgPj4gOCk7IC8qIGFjY3VtdWxhdGUgaGlnaCBieXRlcyAqLwotICAgICAgICB4NSA9IHg1ICsgeDExOyAgLyogYWNjdW11bGF0ZSBsb3cgYnl0ZXMgKi8KLSAgICAgICAgeDExID0geDExICYgKHg2IDw8IDgpOyAvKiB4MTEgJiAweEZGMDBGRjAwICovCi0gICAgICAgIHg0ID0geDQgKyAoKHVpbnQzMil4MTEgPj4gOCk7ICAvKiBhY2N1bXVsYXRlIGhpZ2ggYnl0ZXMgKi8KLQotICAgICAgICAvKioqKioqKioqKioqKioqKi8KLSAgICAgICAgeDEwID0geDUgLSAoeDQgPDwgOCk7IC8qIGV4dHJhY3QgbG93IGJ5dGVzICovCi0gICAgICAgIHgxMCA9IHgxMCArIHg0OyAgICAgLyogYWRkIHdpdGggaGlnaCBieXRlcyAqLwotICAgICAgICB4MTAgPSB4MTAgKyAoeDEwIDw8IDE2KTsgLyogYWRkIHdpdGggbG93ZXIgaGFsZiB3b3JkICovCi0KLSAgICAgICAgX19hc20KLSAgICAgICAgewotICAgICAgICAgICAgLyoqKioqKioqKioqKioqKiovCi0gICAgICAgICAgICBSU0JTICAgIHgxMSwgZG1pbiwgeDEwLCBsc3IgIzE2OwotICAgICAgICAgICAgQURETFNTICB4OCwgeDgsICMweDEwMDAwMDAxOwotICAgICAgICAgICAgQkxTICAgICBMT09QX1NBRDA7Ci0gICAgICAgIH0KLQotICAgICAgICByZ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SElGVAotI2RlZmluZSBTSElGVCAxNgotI3VuZGVmIElOQ19YOAotI2RlZmluZSBJTkNfWDggMHgxMDAwMDAwMQotI2luY2x1ZGUgInNhZF9tYl9vZmZzZXQuaCIKLQotI3VuZGVmIE5VTUJFUgotI2RlZmluZSBOVU1CRVIgMQotI3VuZGVmIFNISUZUCi0jZGVmaW5lIFNISUZUIDgKLSN1bmRlZiBJTkNfWDgKLSNkZWZpbmUgSU5DX1g4IDB4MDgwMDAwMDEKLSNpbmNsdWRlICJzYWRfbWJfb2Zmc2V0LmgiCi0KLQotICAgIF9faW5saW5lIGludDMyIHNpbWRfc2FkX21iKHVpbnQ4ICpyZWYsIHVpbnQ4ICpibGssIGludCBkbWluLCBpbnQgbHgpCi0gICAgewotICAgICAgICBpbnQzMiB4NCwgeDUsIHg2LCB4OCwgeDksIHgxMCwgeDExLCB4MTIsIHgxNDsKLQotICAgICAgICB4OSA9IDB4ODA4MDgwODA7IC8qIGNvbnN0LiAqLwotICAgICAgICB4NCA9IHg1ID0gMDsKLQotICAgICAgICB4OCA9ICh1aW50MzIpcmVmICYgMHgzOwotICAgICAgICBpZiAoeDggPT0gMykKLSAgICAgICAgICAgIGdvdG8gU2FkTUJPZmZzZXQzOwotICAgICAgICBpZiAoeDggPT0gMikKLSAgICAgICAgICAgIGdvdG8gU2FkTUJPZmZzZXQyOwotICAgICAgICBpZiAoeDggPT0gMSkKLSAgICAgICAgICAgIGdvdG8gU2FkTUJPZmZzZXQxOwotCi0gICAgICAgIHg4ID0gMTY7Ci0vLy8KLV9fYXNtX18gdm9sYXRpbGUoIk1WTgklMCwgIzB4RkYwMCI6ICI9ciIoeDYpKTsKLQotTE9PUF9TQUQwOgotICAgICAgICAvKioqKioqIHByb2Nlc3MgOCBwaXhlbHMgKioqKioqLwotICAgICAgICB4MTEgPSAqKChpbnQzMiopKHJlZiArIDEyKSk7Ci0gICAgICAgIHgxMCA9ICooKGludDMyKikocmVmICsgOCkpOwotICAgICAgICB4MTQgPSA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5VTUJFUj09MikKLV9faW5saW5lIGludDMyIHNhZF9tYl9vZmZzZXQyKHVpbnQ4ICpyZWYsIHVpbnQ4ICpibGssIGludCBseCwgaW50IGRtaW4pCi0jZWxpZiAoTlVNQkVSPT0xKQotX19pbmxpbmUgaW50MzIgc2FkX21iX29mZnNldDEodWludDggKnJlZiwgdWludDggKmJsaywgaW50IGx4LCBpbnQgZG1pbikKLSNlbmRpZgotewotICAgIGludDMyIHg0LCB4NSwgeDYsIHg4LCB4OSwgeDEwLCB4MTEsIHgxMiwgeDE0OwotCi0gICAgLy8gIHg1ID0gKHg0PDw4KSAtIHg0OwotICAgIHg0ID0geDUgPSAwOwotICAgIHg2ID0gMHhGRkZGMDBGRjsKLSAgICB4OSA9IDB4ODA4MDgwODA7IC8qIGNvbnN0LiAqLwotICAgIHJlZiAtPSBOVU1CRVI7IC8qIGJpYyByZWYsIHJlZiwgIzMgKi8KLSAgICByZWYgLT0gbHg7Ci0gICAgYmxrIC09IDE2OwotICAgIHg4ID0gMTY7Ci0KLSNpZiAoTlVNQkVSPT0zKQotTE9PUF9TQUQzOgotI2VsaWYgKE5VTUJFUj09MikKLUxPT1BfU0FEMjoKLSNlbGlmIChOVU1CRVI9PTEpCi1MT09QX1NBRDE6Ci0jZW5kaWYKLSAgICAvKioqKioqIHByb2Nlc3MgOCBwaXhlbHMgKioqKioqLwotICAgIHgxMCA9ICooKHVpbnQzMiopKHJlZiArPSBseCkpOyAvKiBEIEMgQiBBICovCi0gICAgeDExID0gKigodWludDMyKikocmVmICsgNCkpOyAgICAvKiBIIEcgRiBFICovCi0gICAgeDEyID0gKigodWludDMyKikocmVmICsgOCkpOyAgICAvKiBMIEsgSiBJICovCi0KLSAgICB4MTAgPSAoKHVpbnQzMil4MTAgPj4gU0hJRlQpOyAvKiAwIDAgMCBEICovCi0gICAgeDEwID0geDEwIHwgKHgxMSA8PCAoMzIgLSBTSElGVCkpOyAgICAgICAgLyogRyBGIEUgRCAqLwotICAgIHgxMSA9IC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gKi8KLQotICAgIC8qKioqKioqKioqKioqKioqLwotICAgIHgxMCA9IHg1IC0gKHg0IDw8IDgpOyAvKiBleHRyYWN0IGxvdyBieXRlcyAqLwotICAgIHgxMCA9IHgxMCArIHg0OyAgICAgLyogYWRkIHdpdGggaGlnaCBieXRlcyAqLwotICAgIHgxMCA9IHgxMCArICh4MTAgPDwgMTYpOyAvKiBhZGQgd2l0aCBsb3dlciBoYWxmIHdvcmQgKi8KLQotICAgIGlmICgoaW50KSgodWludDMyKXgxMCA+PiAxNikgPD0gZG1pbikgLyogY29tcGFyZSB3aXRoIGRtaW4gKi8KLSAgICB7Ci0gICAgICAgIGlmICgtLXg4KQotICAgICAgICB7Ci0jaWYgKE5VTUJFUj09MykKLSAgICAgICAgICAgIGdvdG8gICAgICAgICBMT09QX1NBRDM7Ci0jZWxpZiAoTlVNQkVSPT0yKQotICAgICAgICAgICAgZ290byAgICAgICAgIExPT1BfU0FEMjsKLSNlbGlmIChOVU1CRVI9PTEpCi0gICAgICAgICAgICBnb3RvICAgICAgICAgTE9PUF9TQUQxOwotI2VuZGlmCi0gICAgICAgIH0KLQotICAgIH0KLQotICAgIHJldHVybiAoKHVpbnQzMil4MTAgPj4gMTYpOwotfQotCi0jZWxpZiBkZWZpbmVkKF9fQ0NfQVJNKSAgLyogb25seSB3b3JrIHdpdGggYXJtIHY1ICovCi0KLSNpZiAoTlVNQkVSPT0zKQotX19pbmxpbmUgaW50MzIgc2FkX21iX29mZnNldDModWludDggKnJlZiwgdWludDggKmJsaywgaW50IGx4LCBpbnQgZG1pbiwgaW50MzIgeDgpCi0jZWxpZiAoTlVNQkVSPT0yKQotX19pbmxpbmUgaW50MzIgc2FkX21iX29mZnNldDIodWludDggKnJlZiwgdWludDggKmJsaywgaW50IGx4LCBpbnQgZG1pbiwgaW50MzIgeDgpCi0jZWxpZiAoTlVNQkVSPT0xKQotX19pbmxpbmUgaW50MzIgc2FkX21iX29mZnNldDEodWludDggKnJlZiwgdWludDggKmJsaywg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wotICAgIHgxMCA9IHNhZF80cGl4ZWxOKHgxMCwgeDEyLCB4OSk7Ci0KLSAgICBzdW1fYWNjdW11bGF0ZTsKLQotICAgIF9fYXNtewotICAgICAgICAvKioqKioqIHByb2Nlc3MgOCBwaXhlbHMgKioqKioqLwotICAgICAgICBMRFIgICAgICB4MTEsIFtyZWYsICM0XTsKLSAgICAgICAgTERSICAgICAgeDEyLCBbcmVmLCAjOF07Ci0gICAgICAgIExEUiAgeDEwLCBbcmVmXSwgbHggOwotICAgICAgICBMRFIgIHgxNCwgW2JsaywgIzRdOwotCi0gICAgICAgIE1WTiAgICAgIHgxMCwgeDEwLCBsc3IgI1NISUZUOwotICAgICAgICBCSUMgICAgICB4MTAsIHgxMCwgeDExLCBsc2wgIygzMi1TSElGVCk7Ci0gICAgICAgIE1WTiAgICAgIHgxMSwgeDExLCBsc3IgI1NISUZUOwotICAgICAgICBCSUMgICAgICB4MTEsIHgxMSwgeDEyLCBsc2wgIygzMi1TSElGVCk7Ci0KLSAgICAgICAgTERSICAgICAgeDEyLCBbYmxrXSwgIzE2OwotICAgIH0KLQotICAgIC8qIHByb2Nlc3MgeDExICYgeDE0ICovCi0gICAgeDExID0gc2FkXzRwaXhlbE4oeDExLCB4MTQsIHg5KTsKLQotICAgIC8qIHByb2Nlc3MgeDEyICYgeDEwICovCi0gICAgeDEwID0gc2FkXzRwaXhlbE4oeDEwLCB4MTIsIHg5KTsKLQotICAgIHN1bV9hY2N1bXVsYXRlOwotCi0gICAgLyoqKioqKioqKioqKioqKiovCi0gICAgeDEwID0geDUgLSAoeDQgPDwgOCk7IC8qIGV4dHJhY3QgbG93IGJ5dGVzICovCi0gICAgeDEwID0geDEwICsgeDQ7ICAgICAvKiBhZGQgd2l0aCBoaWdoIGJ5dGVzICovCi0gICAgeDEwID0geDEwICsgKHgxMCA8PCAxNik7IC8qIGFkZCB3aXRoIGxvd2VyIGhhbGYgd29yZCAqLwotCi0gICAgX19hc217Ci0gICAgICAgIFJTQlMgICA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pbnQzMiopKGJsayArIDgpKTsKLQotICAgIC8qIHByb2Nlc3MgeDExICYgeDE0ICovCi0gICAgeDExID0gc2FkXzRwaXhlbE4oeDExLCB4MTQsIHg5KTsKLQotICAgIC8qIHByb2Nlc3MgeDEyICYgeDEwICovCi0gICAgeDEwID0gc2FkXzRwaXhlbE4oeDEwLCB4MTIsIHg5KTsKLQotICAgIHN1bV9hY2N1bXVsYXRlOwotCi0gICAgLyoqKioqKiBwcm9jZXNzIDggcGl4ZWxzICoqKioqKi8KLSAgICB4MTEgPSAqKChpbnQzMiopKHJlZiArIDQpKTsKLSAgICB4MTIgPSAqKChpbnQzMiopKHJlZiArIDgpKTsKLSAgICB4MTAgPSAqKChpbnQzMiopcmVmKTsgcmVmICs9IGx4OwotICAgIHgxNCA9ICooKGludDMyKikoYmxrICsgNCkpOwotCi0jaWYgKFNISUZUPT04KQotX19hc21fXyB2b2xhdGlsZSgiTVZOICAgJTAsICUwLCBsc3IgIzhcblx0QklDICAgJTAsICUwLCAlMSxsc2wgIzI0XG5cdE1WTiAgICUxLCAlMSxsc3IgIzhcblx0QklDICAgJTEsICUxLCAlMixsc2wgIzI0IjogIj0mciIoeDEwKSwgIj0mciIoeDExKTogInIiKHgxMikpOwotI2VsaWYgKFNISUZUPT0xNikKLV9fYXNtX18gdm9sYXRpbGUoIk1WTiAgICUwLCAlMCwgbHNyICMxNlxuXHRCSUMgICAlMCwgJTAsICUxLGxzbCAjMTZcblx0TVZOICAgJTEsICUxLGxzciAjMTZcblx0QklDICAgJTEsICUxLCAlMixsc2wgIzE2IjogIj0mciIoeDEwKSwgIj0mciIoeDExKTogInIiKHgxMikpOwotI2VsaWYgKFNISUZUPT0yNCkKLV9fYXNtX18gdm9sYXRpbGUoIk1WTiAgICUwLCAlMCwgbHNyICMyNFxuXHRCSUMgICAlMCwgJTAsICUxLGxzbCAjOFxuXHRNVk4gICAlMSwgJTEsbHNyICMyNFxuXHRCSUMgICAlMSwgJTEsICUyLGxzbCAjOCI6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haWxEKQotICAgICAgICAgICAgewotICAgICAgICAgICAgICAgIHZpZGVvLT5pbnRyYUF2YWlsRCA9IHZpZGVvLT5tYmxvY2tbdmlkZW8tPm1iQWRkckRdLm1iX2ludHJhOwotICAgICAgICAgICAgfQotICAgICAgICB9Ci0KLSAgICAgICAgLyogZW5jb2RlX29uZV9tYWNyb2Jsb2NrKCkgKi8KLSAgICAgICAgc3RhdHVzID0gRW5jb2RlTUIoZW5jdmlkKTsKLSAgICAgICAgaWYgKHN0YXR1cyAhPSBBVkNFTkNfU1VDQ0VTUykKLSAgICAgICAgewotICAgICAgICAgICAgYnJlYWs7Ci0gICAgICAgIH0KLQotICAgICAgICAvKiBnbyB0byBuZXh0IE1CICovCi0gICAgICAgIEN1cnJNYkFkZHIrKzsKLQotICAgICAgICB3aGlsZSAoKHVpbnQpdmlkZW8tPk1iVG9TbGljZUdyb3VwTWFwW0N1cnJNYkFkZHJdICE9IHNsaWNlX2dyb3VwX2lkICYmCi0gICAgICAgICAgICAgICAgKHVpbnQpQ3Vyck1iQWRkciA8IHZpZGVvLT5QaWNTaXplSW5NYnMpCi0gICAgICAgIHsKLSAgICAgICAgICAgIEN1cnJNYkFkZHIrKzsKLSAgICAgICAgfQotCi0gICAgICAgIGlmICgodWludClDdXJyTWJBZGRyID49IHZpZGVvLT5QaWNTaXplSW5NYnMpCi0gICAgICAgIHsKLSAgICAgICAgICAgIC8qIGVuZCBvZiBzbGljZSwgcmV0dXJuLCBidXQgYmVmb3JlIHRoYXQgY2hlY2sgdG8gc2VlIGlmIHRoZXJlIGFyZSBvdGhlciBzbGljZXMKLSAgICAgICAgICAgIHRvIGJlIGVuY29kZWQuICovCi0gICAgICAgICAgICBlbmN2aWQtPmN1cnJTbGljZUdyb3VwKys7Ci0gICAgICAgICAgICBpZiAoZW5jdmlkLT5jdXJyU2xpY2VHcm91cCA+IChpbnQpcHBzLT5udW1fc2xpY2VfZ3JvdXBzX21pbnVzMSkgLyogbm8gbW9yZSBzbGljZSBncm91cCAqLwotICAgICAgICAgICAgewotICAgICAgICAgICAgICAgIHN0YXR1cyA9IEFWQ0VOQ19QSUNUVVJFX1JFQURZOwotICAgICAgICAgICAgICAgIGJyZWFrOwotICAgICAgICAgICAgfQotICAgICAgICAgICAgZWxzZQotICAgICAgICAgICAgewotICAgICAgICAgICAgICAgIC8qIGZpbmQgZmlyc3RfbWJfbnVtIGZvciB0aGUgbmV4dCBzbGljZSAqLwotICAgICAgICAgICAgICAgIEN1cnJNYkFkZHIgPSAwOwotICAgICAgICAgICAgICAgIHdoaWxlICh2aWRlby0+TWJUb1NsaWNlR3JvdXBNYXBbQ3Vyck1iQWRkcl0gIT0gZW5jdmlkLT5jdXJyU2xpY2VHcm91cCAmJgotICAgICAgICAgICAgICAgICAgICAgICAgKHVpbnQpQ3Vyck1iQWRkciA8IHZpZGVvLT5QaWNTaXplSW5NYnMpCi0gICAgICAgICAgICAgICAgewotICAgICAgICAgICAgICAgICAgICBDdXJyTWJBZGRyKys7Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgIGlmICgodWludClDdXJyTWJBZGRyID49IHZpZGVvLT5QaWNTaXplSW5NYnMpCi0gICAgICAgICAgICAgICAgewotICAgICAgICAgICAgICAgICAgICBzdGF0dXMgPSBBVkNFTkNfU0xJQ0VfRU1QVFk7IC8qIGVycm9yLCBvbmUgc2xpY2UgZ3JvdXAgaGFzIG5vIE1CcyBpbiBpdCAqLwotICAgICAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgICAgIHZpZGVvLT5tYk51bSA9IEN1cnJNYkFkZHI7Ci0gICAgICAgICAgICAgICAgc3RhdHVzID0gQVZDRU5DX1NVQ0NFU1M7Ci0gICAgICAgICAgICAgICAgYnJlYWs7Ci0gICAgICAgICAgICB9Ci0gICAgICAgIH0KLSAgICB9Ci0KLSAgICBpZiAodmlkZW8tPm1iX3NraXBfcnVuID4gMCkKLSAgICB7Ci0gICAgICAgIC8qIHdyaXRlIHNraXBfcnVuICovCi0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b2VmZltibGtpZHhdID0gbnVtY29lZmY7Ci0gICAgICAgICAgICAgICAgaWYgKG51bWNvZWZmKQotICAgICAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAgICAgdmlkZW8tPmNicDR4NCB8PSAoMSA8PCBibGtpZHgpOwotICAgICAgICAgICAgICAgICAgICBjdXJyTUItPkNCUCB8PSAoMSA8PCBiOCk7Ci0gICAgICAgICAgICAgICAgfQotCi0gICAgICAgICAgICAgICAgaWYgKGI0JjEpCi0gICAgICAgICAgICAgICAgewotICAgICAgICAgICAgICAgICAgICBjdXIgKz0gKChwaWNQaXRjaCA8PCAyKSAtIDQpOwotICAgICAgICAgICAgICAgICAgICBvcmc0ICs9ICgob3JnUGl0Y2ggPDwgMikgLSA0KTsKLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgZWxzZQotICAgICAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAgICAgY3VyICs9IDQ7Ci0gICAgICAgICAgICAgICAgICAgIG9yZzQgKz0gNDsKLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgIC8qIG1vdmUgdGhlIElEQ1QgcGFydCBvdXQgb2YgZGN0X2x1bWEgdG8gYWNjb21tb2RhdGUgdGhlIGNoZWNrCi0gICAgICAgICAgICAgICBmb3IgY29lZmZfY29zdC4gKi8KLQotICAgICAgICAgICAgaWYgKChjdXJyTUItPkNCUCYoMSA8PCBiOCkpICYmIChjb3N0OCA8PSBfTFVNQV9DT0VGRl9DT1NUXykpCi0gICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgY29zdDggPSAwOyAvLyByZXNldCBpdAotCi0gICAgICAgICAgICAgICAgY3Vyck1CLT5DQlAgXj0gKDEgPDwgYjgpOwotICAgICAgICAgICAgICAgIGJsa2lkeCA9IGJsa0lkeDJibGtYWVtiOF1bMF07Ci0KLSAgICAgICAgICAgICAgICBjdXJyTUItPm56X2NvZWZmW2Jsa2lkeF0gPSAwOwotICAgICAgICAgICAgICAgIGN1cnJNQi0+bnpfY29lZmZbYmxraWR4KzFdID0gMDsKLSAgICAgICAgICAgICAgICBjdXJyTUItPm56X2NvZWZmW2Jsa2lkeCs0XSA9IDA7Ci0gICAgICAgICAgICAgICAgY3Vyck1CLT5uel9jb2VmZltibGtpZHgrNV0gPSAwOwotICAgICAgICAgICAgfQotCi0gICAgICAgICAgICBjb3N0MTYgKz0gY29zdDg7Ci0KLSAgICAgICAgICAgIGlmIChiOCYxKQotICAgICAgICAgICAgewotICAgICAgICAgICAgICAgIGN1ciAtPSA4OwotICAgICAgICAgICAgICAgIG9yZzQgLT0gODsKLSAgICAgICAgICAgIH0KLSAgICAgICAgICAgIGVsc2UKLSAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICBjdXIgKz0gKDggLSAocGljUGl0Y2ggPDwgMykpOwotICAgICAgICAgICAgICAgIG9yZzQgKz0gKDggLSAob3JnUGl0Y2ggPDwgMykpOwotICAgICAgICAgICAgfQotICAgICAgICB9Ci0KLSAgICAgICAgLyogYWZ0ZXIgdGhlIHdob2xlIE1CLCB3ZSBkbyBhbm90aGVyIGNoZWNrIGZvciBjb2VmZl9jb3N0ICovCi0gICAgICAgIGlmICgoY3Vyck1CLT5DQlAmMHhGKSAmJiAoY29zdDE2IDw9IF9MVU1BX01CX0NPRUZGX0NPU1RfKSkKLSAgICAgICAgewotICAgICAgICAgICAgY3Vyck1CLT5DQlAgPSAwOyAgLy8gcmVzZXQgaXQgdG8gemVybwotICAgICAgICAgICAgbWVtc2V0KGN1cnJNQi0+bnpfY29lZmYsIDAsIHNpemVvZih1aW50OCkqMTYpOwotICAgICAgICB9Ci0KLSAgICAgICAgLy8gbm93IHdlIGRvIElEQ1QKLSAgICAgICAgTUJJbnRlcklkY3QodmlkZW8sIGN1ckwsIGN1cnJNQiwgcGljUGl0Y2gpOwotCi0vLyAgICAgIHZpZGVvLT5wcmVkX2Jsb2NrID0gdmlkZW8tPnByZWQgKyAyN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pcHBlZCBNQiwgZW5jb2RlcyBpdCwKLSAgICAgICAgICAgIHNldCB2aWRlby0+UVB5cHJldiA9IGN1cnJNQi0+UVB5OyAqLwotCi0gICAgLyogNS4gdmxjIGVuY29kZSAqLwotCi0gICAgLyogY2hlY2sgZm9yIHNraXBwZWQgbWFjcm9ibG9jaywgSU5URVIgb25seSAqLwotICAgIGlmICghY3Vyck1CLT5tYl9pbnRyYSkKLSAgICB7Ci0gICAgICAgIC8qIGRlY2lkZSB3aGV0aGVyIHRoaXMgTUIgKGZvciBpbnRlciBNQikgc2hvdWxkIGJlIHNraXBwZWQgaWYgdGhlcmUncyBub3RoaW5nIGxlZnQuICovCi0gICAgICAgIGlmICghY3Vyck1CLT5DQlAgJiYgY3Vyck1CLT5OdW1NYlBhcnQgPT0gMSAmJiBjdXJyTUItPlFQeSA9PSB2aWRlby0+UVB5KQotICAgICAgICB7Ci0gICAgICAgICAgICBpZiAoY3Vyck1CLT5NQlBhcnRQcmVkTW9kZVswXVswXSA9PSBBVkNfUHJlZF9MMCAmJiBjdXJyTUItPnJlZl9pZHhfTDBbMF0gPT0gMCkKLSAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICBNQl9BID0gJnZpZGVvLT5tYmxvY2tbdmlkZW8tPm1iQWRkckFdOwotICAgICAgICAgICAgICAgIE1CX0IgPSAmdmlkZW8tPm1ibG9ja1t2aWRlby0+bWJBZGRyQl07Ci0KLSAgICAgICAgICAgICAgICBpZiAoIXZpZGVvLT5tYkF2YWlsQSB8fCAhdmlkZW8tPm1iQXZhaWxCKQotICAgICAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAgICAgaWYgKGN1cnJNQi0+bXZMMFswXSA9PSAwKSAvKiBib3RoIG12IGNvbXBvbmVudHMgYXJlIHplcm9zLiovCi0gICAgICAgICAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAgICAgICAgIGN1cnJNQi0+bWJNb2RlID0gQVZDX1NLSVA7Ci0gICAgICAgICAgICAgICAgICAgICAgICB2aWRlby0+bXZkX2wwWzBdWzBdWzBdID0gMDsKLSAgICAgICAgICAgICAgICAgICAgICAgIHZpZGVvLT5tdmRfbDBbMF1bMF1bMV0gPSAwOwotICAgICAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgIGVsc2UKLSAgICAgICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgICAgIGlmICgoTUJfQS0+cmVmX2lkeF9MMFsxXSA9PSAwICYmIE1CX0EtPm12TDBbM10gPT0gMCkgfHwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAoTUJfQi0+cmVmX2lkeF9MMFsyXSA9PSAwICYmIE1CX0ItPm12TDBbMTJdID09IDApKQotICAgICAgICAgICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgICAgICAgICBpZiAoY3Vyck1CLT5tdkwwWzBdID09IDApIC8qIGJvdGggbXYgY29tcG9uZW50cyBhcmUgemVyb3MuKi8KLSAgICAgICAgICAgICAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBjdXJyTUItPm1iTW9kZSA9IEFWQ19TS0lQOwotICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZpZGVvLT5tdmRfbDBbMF1bMF1bMF0gPSAwOwotICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZpZGVvLT5tdmRfbDBbMF1bMF1bMV0gPSAwOwotICAgICAgICAgICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgICAgIGVsc2UgaWYgKHZpZGVvLT5tdmRfbDBbMF1bMF1bMF0gPT0gMCAmJiB2aWRlby0+bXZkX2wwWzBdWzBdWzFdID09IDApCi0gICAgICAgICAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAgICAgICAgIGN1cnJNQi0+bWJNb2RlID0gQVZDX1NLSVA7Ci0gICAgICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgIGlmIChjdXJyTUItPm1iTW9kZSA9PSBBVkNfU0tJUCkKLSAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICB2aWRlby0+bWJfc2tpcF9ydW4rKzsKLQotICAgICAgICAgICAgICAgIC8qIHNldCBwYXJhbWV0ZXJzICovCi0gICAgICAgICAgICAgICAgLyogbm90IHN1cmUgd2hldGhlciB3ZSBuZWVkIHRoZSBmb2xsb3dpbmdzICovCi0gICAgICAgICAgICAgICAgaWYgKHNsaWNlX3R5cGUgPT0gQVZDX1BfU0xJQ0UpCi0gICAgICAgICAgICAgICAgewotICAgICAgICAgICAgICAgICAgICBjdXJyTUItPm1iTW9kZSA9IEFWQ19TS0lQOwotICAgICAgICAgICAgICAgICAgICBjdXJyTUItPk1iUGFydFdpZHRoID0gY3Vyck1CLT5NYlBhcnRIZWlnaHQgPSAxNjsKLSAgICAgICAgICAgICAgICAgICAgY3Vyck1CLT5NQlBhcnRQcmVkTW9kZVswXVswXSA9IEFWQ19QcmVkX0wwOwotICAgICAgICAgICAgICAgICAgICBjdXJyTUItPk51bU1iUGFydCA9IDE7Ci0gICAgICAgICAgICAgICAgICAgIGN1cnJNQi0+TnVtU3ViTWJQYXJ0WzBdID0gY3Vyck1CLT5OdW1TdWJNYlBhcnRbMV0gPQotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjdXJyTUItPk51bVN1Yk1iUGFydFsyXSA9IGN1cnJNQi0+TnVtU3ViTWJQYXJ0WzNdID0gMTsKLSAgICAgICAgICAgICAgICAgICAgY3Vyck1CLT5TdWJNYlBhcnRXaWR0aFswXSA9IGN1cnJNQi0+U3ViTWJQYXJ0V2lkdGhbMV0gPQotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGN1cnJNQi0+U3ViTWJQYXJ0V2lkdGhbMl0gPSBjdXJyTUItPlN1Yk1iUGFydFdpZHRoWzNdID0gY3Vyck1CLT5NYlBhcnRXaWR0aDsKLSAgICAgICAgICAgICAgICAgICAgY3Vyck1CLT5TdWJNYlBhcnRIZWlnaHRbMF0gPSBjdXJyTUItPlN1Yk1iUGFydEhlaWdodFsxXSA9Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGN1cnJNQi0+U3ViTWJQYXJ0SGVpZ2h0WzJdID0gY3Vyck1CLT5TdWJNYlBhcnRIZWlnaHRbM10gPSBjdXJyTUItPk1iUGFydEhlaWdodDsKLQotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICBlbHNlIGlmIChzbGljZV90eXBlID09IEFWQ19CX1NMSUNFKQotICAgICAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAgICAgY3Vyck1CLT5tYk1vZGUgPSBBVkNfU0tJUDsKLSAgICAgICAgICAgICAgICAgICAgY3Vyck1CLT5NYlBhcnRXaWR0aCA9IGN1cnJNQi0+TWJQYXJ0SGVpZ2h0ID0gODsKLSAgICAgICAgICAgICAgICAgICAgY3Vyck1CLT5NQlBhcnRQcmVkTW9kZVswXVswXSA9IEFWQ19EaXJlY3Q7Ci0gICAgICAgICAgICAgICAgICAgIGN1cnJNQi0+TnVtTWJQYXJ0ID0gLTE7Ci0gICAgICAgICAgICAgICAgfQotCi0gICAgICAgICAgICAgICAgLyogZm9yIHNraXBwZWQgTUIsIGFsd2F5cyBsb29rIGF0IHRoZSBmaXJzdCBlbnRyeSBpbiBSZWZQaWNMaXN0ICovCi0gICAgICAgICAgICAgICAgY3Vyck1CLT5SZWZJZHhbMF0gPSBjdXJyTUItPlJlZklkeFsxXSA9Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY3Vyck1CLT5SZWZJZHhbMl0gPSBjdXJyTUItPlJlZklkeFszXSA9IHZpZGVvLT5SZWZQaWNMaXN0MFswXS0+UmVmSWR4OwotCi0gICAgICAgICAgIC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ICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgICAgIHJldHVybiBzdGF0dXM7Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgfQotICAgICAgICB9Ci0gICAgfQotCi0gICAgLyogY2hyb21hICovCi0gICAgaWYgKGN1cnJNQi0+Q0JQICYgKDMgPDwgNCkpIC8qIGNocm9tYSBEQyByZXNpZHVhbCBwcmVzZW50ICovCi0gICAgewotICAgICAgICBmb3IgKGI4ID0gMDsgYjggPCAyOyBiOCsrKSAvKiBmb3IgaUNiQ3IgKi8KLSAgICAgICAgewotICAgICAgICAgICAgLyogdmxjIGVuY29kZSBsZXZlbC9ydW4gKi8KLSAgICAgICAgICAgIHN0YXR1cyA9IGVuY19yZXNpZHVhbF9ibG9jayhlbmN2aWQsIEFWQ19DaHJvbWFEQywgZW5jdmlkLT5udW1jb2VmY2RjW2I4XSArIChiOCA8PCAzKSwgY3Vyck1CKTsKLSAgICAgICAgICAgIGlmIChzdGF0dXMgIT0gQVZDRU5DX1NVQ0NFU1MpCi0gICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgcmV0dXJuIHN0YXR1czsKLSAgICAgICAgICAgIH0KLSAgICAgICAgfQotICAgIH0KLQotICAgIGlmIChjdXJyTUItPkNCUCAmICgyIDw8IDQpKQotICAgIHsKLSAgICAgICAgLyogQUMgcGFydCAqLwotICAgICAgICBmb3IgKGI4ID0gMDsgYjggPCAyOyBiOCsrKSAvKiBmb3IgaUNiQ3IgKi8KLSAgICAgICAgewotICAgICAgICAgICAgZm9yIChiNCA9IDA7IGI0IDwgNDsgYjQrKykgIC8qIGZvciBlYWNoIGJsb2NrIGluc2lkZSBDYiBvciBDciAqLwotICAgICAgICAgICAgewotICAgICAgICAgICAgICAgIC8qIHZsYyBlbmNvZGUgbGV2ZWwvcnVuICovCi0gICAgICAgICAgICAgICAgc3RhdHVzID0gZW5jX3Jlc2lkdWFsX2Jsb2NrKGVuY3ZpZCwgQVZDX0Nocm9tYUFDLCAxNiArIChiOCA8PCAyKSArIGI0LCBjdXJyTUIpOwotICAgICAgICAgICAgICAgIGlmIChzdGF0dXMgIT0gQVZDRU5DX1NVQ0NFU1MpCi0gICAgICAgICAgICAgICAgewotICAgICAgICAgICAgICAgICAgICByZXR1cm4gc3RhdHVzOwotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgIH0KLSAgICAgICAgfQotICAgIH0KLQotCi0gICAgbnVtX2JpdHMgPSAzMiArIChlbmN2aWQtPmJpdHN0cmVhbS0+d3JpdGVfcG9zIDw8IDMpIC0gZW5jdmlkLT5iaXRzdHJlYW0tPmJpdF9sZWZ0OwotCi0gICAgUkNQb3N0TUIodmlkZW8sIHJhdGVDdHJsLCBzdGFydF90ZXh0X2JpdHMgLSBzdGFydF9tYl9iaXRzLAotICAgICAgICAgICAgIG51bV9iaXRzIC0gc3RhcnRfdGV4dF9iaXRzKTsKLQotLy8gIG51bV9iaXRzIC09IHN0YXJ0X21iX2JpdHM7Ci0vLyAgZnByaW50ZihmZGVidWcsIk1CICMlZDogJWQgYml0c1xuIixDdXJyTWJBZGRyLG51bV9iaXRzKTsKLS8vICBmY2xvc2UoZmRlYnVnKTsKLSAgICByZXR1cm4gc3RhdHVzOwotfQotCi0vKiBjb3B5IHRoZSBjb250ZW50IGZyb20gcHJlZEJsb2NrIGJhY2sgdG8gdGhlIHJlY29uc3RydWN0ZWQgWVVWIGZyYW1lICovCi12b2lkIENvcHlfTUIodWludDggKmN1ckwsIHVpbnQ4ICpjdXJDYiwgdWludDggKmN1ckNyLCB1aW50OCAqcHJlZEJsb2NrLCBpbnQgcGljUGl0Y2gpCi17Ci0gICAgaW50IGosIG9mZnNldDsKLSAgICB1aW50MzIgKmRzdCwgKmRzdDIsICpzcmM7Ci0KLSAgICBkc3QgPSAodWludDMyKiljdXJMOwotICAgIHNyYyA9ICh1aW50MzIqKXByZWRCbG9jazsKLQotICAgIG9mZnNldCA9IChwaWNQaXRjaCAtIDE2KSA+PiAyOwotCi0gICA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EFWQ19JMTYpCi0gICAgICAgIHsKLSAgICAgICAgICAgIENCUF9jaHJvbSA9IChjdXJyTUItPkNCUCAmIDB4MzApOwotICAgICAgICAgICAgaWYgKGN1cnJNQi0+Q0JQJjB4RikKLSAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICBjdXJyTUItPkNCUCB8PSAweEY7ICAvKiBlaXRoZXIgMHgwIG9yIDB4RiAqLwotICAgICAgICAgICAgICAgIG1iX3R5cGUgPSAxMzsKLSAgICAgICAgICAgIH0KLSAgICAgICAgICAgIGVsc2UKLSAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICBtYl90eXBlID0gMTsKLSAgICAgICAgICAgIH0KLSAgICAgICAgICAgIG1iX3R5cGUgKz0gKENCUF9jaHJvbSA+PiAyKSArIGN1cnJNQi0+aTE2TW9kZTsKLSAgICAgICAgfQotICAgICAgICBlbHNlIC8qIGlmKGN1cnJNQi0+bWJNb2RlID09IEFWQ19JX1BDTSkgKi8KLSAgICAgICAgewotICAgICAgICAgICAgbWJfdHlwZSA9IDI1OwotICAgICAgICB9Ci0gICAgfQotICAgIGVsc2UKLSAgICB7ICAvKiBQLU1CICovLyogbm90ZSB0aGF0IHRoZSBvcmRlciBvZiB0aGUgZW51bSBBVkNNQk1vZGUgY2Fubm90IGJlIGNoYW5nZWQKLSAgICAgICAgc2luY2Ugd2UgdXNlIGl0IGhlcmUuICovCi0gICAgICAgIG1iX3R5cGUgPSBjdXJyTUItPm1iTW9kZSAtIEFWQ19QMTY7Ci0gICAgfQotCi0gICAgaWYgKHNsaWNlX3R5cGUgPT0gQVZDX1BfU0xJQ0UpCi0gICAgewotICAgICAgICBpZiAoY3Vyck1CLT5tYl9pbnRyYSkKLSAgICAgICAgewotICAgICAgICAgICAgbWJfdHlwZSArPSA1OwotICAgICAgICB9Ci0gICAgfQotICAgIC8vIGZvbGxvd2luZyBjb2RlcyBoYXZlIG5vdCBiZWVuIHRlc3RlZCB5ZXQsIG5vdCBuZWVkZWQuCi0gICAgLyogIGVsc2UgaWYoc2xpY2VfdHlwZSA9PSBBVkNfQl9TTElDRSkKLSAgICAgICAgewotICAgICAgICAgICAgaWYoY3Vyck1CLT5tYk1vZGUgPT0gQVZDX0JEaXJlY3QxNikKLSAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICBtYl90eXBlID0gMDsKLSAgICAgICAgICAgIH0KLSAgICAgICAgICAgIGVsc2UgaWYoY3Vyck1CLT5tYk1vZGUgPT0gQVZDX1AxNikKLSAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICBtYl90eXBlID0gY3Vyck1CLT5NQlBhcnRQcmVkTW9kZVswXVswXSArIDE7IC8vIDEgb3IgMgotICAgICAgICAgICAgfQotICAgICAgICAgICAgZWxzZSBpZihjdXJyTUItPm1iTW9kZSA9PSBBVkNfUDgpCi0gICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgbWJfdHlwZSA9IDI2OwotICAgICAgICAgICAgfQotICAgICAgICAgICAgZWxzZSBpZihjdXJyTUItPm1iTW9kZSA9PSBBVkNfUDhyZWYwKQotICAgICAgICAgICAgewotICAgICAgICAgICAgICAgIG1iX3R5cGUgPSAyNzsKLSAgICAgICAgICAgIH0KLSAgICAgICAgICAgIGVsc2UKLSAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICBwYXJ0MSA9IGN1cnJNQi0+bWJNb2RlIC0gQVZDX1AxNng4OwotICAgICAgICAgICAgICAgIHBhcnQyID0gY3Vyck1CLT5NQlBhcnRQcmVkTW9kZVswXVswXTsKLSAgICAgICAgICAgICAgICBwYXJ0MyA9IGN1cnJNQi0+TUJQYXJ0UHJlZE1vZGVbMV1bMF07Ci0gICAgICAgICAgICAgICAgbWJfdHlwZSA9IE1hcFBhcnRzMlR5cGVbcGFydDFdW3BhcnQyXVtwYXJ0M107Ci0gICAgICAgICAgICB9Ci0gICAgICAgIH0KLQotICAgICAgICBpZihzbGljZV90eXBlID09IEFWQ19TSV9TTElDRSkKLSAgICAgICAg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ICE9IEFWQ19QcmVkX0wxKQotICAgICAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAgICAgY29kZSA9IGN1cnJNQi0+cmVmX2lkeF9MMFttYlBhcnRJZHhdOwotICAgICAgICAgICAgICAgICAgICBzdGF0dXMgPSB0ZV92KHN0cmVhbSwgY29kZSwgbWF4X3JlZl9pZHgpOwotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgIH0KLSAgICAgICAgfQotCi0gICAgICAgIC8qIHNlZSBzdWJjbGF1c2UgNy40LjUuMSBmb3IgdGhlIHJhbmdlIG9mIHJlZl9pZHhfbFggKi8KLSAgICAgICAgbWF4X3JlZl9pZHggPSBzbGljZUhkci0+bnVtX3JlZl9pZHhfbDFfYWN0aXZlX21pbnVzMTsKLSAgICAgICAgLyogICAgICBpZih2aWRlby0+TWJhZmZGcmFtZUZsYWcgJiYgY3Vyck1CLT5tYl9maWVsZF9kZWNvZGluZ19mbGFnKQotICAgICAgICAgICAgICAgICAgICBtYXhfcmVmX2lkeCA9IDIqc2xpY2VIZHItPm51bV9yZWZfaWR4X2wxX2FjdGl2ZV9taW51czEgKyAxOwotICAgICAgICAqLwotICAgICAgICAvKiBkZWNvZGUgcmVmIGluZGV4IGZvciBMMSAqLwotICAgICAgICBpZiAoc2xpY2VIZHItPm51bV9yZWZfaWR4X2wxX2FjdGl2ZV9taW51czEgPiAwKQotICAgICAgICB7Ci0gICAgICAgICAgICBmb3IgKG1iUGFydElkeCA9IDA7IG1iUGFydElkeCA8IGN1cnJNQi0+TnVtTWJQYXJ0OyBtYlBhcnRJZHgrKykKLSAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICBpZiAoLyooc2xpY2VIZHItPm51bV9yZWZfaWR4X2wxX2FjdGl2ZV9taW51czE+MCB8fCBjdXJyTUItPm1iX2ZpZWxkX2RlY29kaW5nX2ZsYWcpICYmKi8KLSAgICAgICAgICAgICAgICAgICAgY3Vyck1CLT5NQlBhcnRQcmVkTW9kZVttYlBhcnRJZHhdWzBdICE9IEFWQ19QcmVkX0wwKQotICAgICAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAgICAgc3RhdHVzID0gdGVfdihzdHJlYW0sIGN1cnJNQi0+cmVmX2lkeF9MMVttYlBhcnRJZHhdLCBtYXhfcmVmX2lkeCk7Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgfQotICAgICAgICB9Ci0KLSAgICAgICAgLyogZW5jb2RlIG12ZF9sMCAqLwotICAgICAgICBmb3IgKG1iUGFydElkeCA9IDA7IG1iUGFydElkeCA8IGN1cnJNQi0+TnVtTWJQYXJ0OyBtYlBhcnRJZHgrKykKLSAgICAgICAgewotICAgICAgICAgICAgaWYgKGN1cnJNQi0+TUJQYXJ0UHJlZE1vZGVbbWJQYXJ0SWR4XVswXSAhPSBBVkNfUHJlZF9MMSkKLSAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICBzdGF0dXMgPSBzZV92KHN0cmVhbSwgdmlkZW8tPm12ZF9sMFttYlBhcnRJZHhdWzBdWzBdKTsKLSAgICAgICAgICAgICAgICBzdGF0dXMgPSBzZV92KHN0cmVhbSwgdmlkZW8tPm12ZF9sMFttYlBhcnRJZHhdWzBdWzFdKTsKLSAgICAgICAgICAgIH0KLSAgICAgICAgfQotICAgICAgICAvKiBlbmNvZGUgbXZkX2wxICovCi0gICAgICAgIGZvciAobWJQYXJ0SWR4ID0gMDsgbWJQYXJ0SWR4IDwgY3Vyck1CLT5OdW1NYlBhcnQ7IG1iUGFydElkeCsrKQotICAgICAgICB7Ci0gICAgICAgICAgICBpZiAoY3Vyck1CLT5NQlBhcnRQcmVkTW9kZVttYlBhcnRJZHhdWzBdICE9IEFWQ19QcmVkX0wwKQotICAgICAgICAgICAgewotICAgICAgICAgICAgICAgIHN0YXR1cyA9IHNlX3Yoc3RyZWFtLCB2aWRlby0+bXZkX2wxW21iUGFydElkeF1bMF1bMF0pOwotICAgICAgICAgICAgICAgIHN0YXR1cyA9IHNlX3Y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AgICBpbnQgY29tcG9uZW50LCBTdWJCbG9ja19pbmR4LCBibG9ja194LCBibG9ja195OwotICAgIGludCBkY09ubHlQcmVkaWN0aW9uRmxhZzsKLSAgICB1aW50ICAgIGZsYWc7Ci0gICAgaW50ICAgICByZW0gPSAwOwotICAgIGludCAgICAgbW9kZTsKLSAgICBpbnQgYmluZHggPSAwOwotCi0gICAgZm9yIChjb21wb25lbnQgPSAwOyBjb21wb25lbnQgPCA0OyBjb21wb25lbnQrKykgLyogcGFydGl0aW9uIGluZGV4ICovCi0gICAgewotICAgICAgICBibG9ja194ID0gKChjb21wb25lbnQgJiAxKSA8PCAxKTsKLSAgICAgICAgYmxvY2tfeSA9ICgoY29tcG9uZW50ID4+IDEpIDw8IDEpOwotCi0gICAgICAgIGZvciAoU3ViQmxvY2tfaW5keCA9IDA7IFN1YkJsb2NrX2luZHggPCA0OyBTdWJCbG9ja19pbmR4KyspIC8qIHN1Yi1wYXJ0aXRpb24gaW5kZXggKi8KLSAgICAgICAgewotICAgICAgICAgICAgZGNPbmx5UHJlZGljdGlvbkZsYWcgPSAwOwotICAgICAgICAgICAgaWYgKGJsb2NrX3ggPiAwKQotICAgICAgICAgICAgewotICAgICAgICAgICAgICAgIGludHJhNHg0UHJlZE1vZGVBID0gY3Vyck1CLT5pNE1vZGVbKGJsb2NrX3kgPDwgMikgKyBibG9ja194IC0gMSBdOwotICAgICAgICAgICAgfQotICAgICAgICAgICAgZWxzZQotICAgICAgICAgICAgewotICAgICAgICAgICAgICAgIGlmICh2aWRlby0+aW50cmFBdmFpbEEpCi0gICAgICAgICAgICAgICAgewotICAgICAgICAgICAgICAgICAgICBpZiAodmlkZW8tPm1ibG9ja1t2aWRlby0+bWJBZGRyQV0ubWJNb2RlID09IEFWQ19JNCkKLSAgICAgICAgICAgICAgICAgICAgewotICAgICAgICAgICAgICAgICAgICAgICAgaW50cmE0eDRQcmVkTW9kZUEgPSB2aWRlby0+bWJsb2NrW3ZpZGVvLT5tYkFkZHJBXS5pNE1vZGVbKGJsb2NrX3kgPDwgMikgKyAzXTsKLSAgICAgICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgICAgICBlbHNlCi0gICAgICAgICAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAgICAgICAgIGludHJhNHg0UHJlZE1vZGVBID0gQVZDX0k0X0RDOwotICAgICAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgIGVsc2UKLSAgICAgICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgICAgIGRjT25seVByZWRpY3Rpb25GbGFnID0gMTsKLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgIGlmIChibG9ja195ID4gMCkKLSAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICBpbnRyYTR4NFByZWRNb2RlQiA9IGN1cnJNQi0+aTRNb2RlWygoYmxvY2tfeS0xKSA8PCAyKSArIGJsb2NrX3hdOwotICAgICAgICAgICAgfQotICAgICAgICAgICAgZWxzZQotICAgICAgICAgICAgewotICAgICAgICAgICAgICAgIGlmICh2aWRlby0+aW50cmFBdmFpbEIpCi0gICAgICAgICAgICAgICAgewotICAgICAgICAgICAgICAgICAgICBpZiAodmlkZW8tPm1ibG9ja1t2aWRlby0+bWJBZGRyQl0ubWJNb2RlID09IEFWQ19JNCkKLSAgICAgICAgICAgICAgICAgICAgewotICAgICAgICAgICAgICAgICAgICAgICAgaW50cmE0eDRQcmVkTW9kZUIgPSB2aWRlby0+bWJsb2NrW3ZpZGVvLT5tYkFkZHJCXS5pNE1vZGVbKDMgPDwgMikgKyBibG9ja194XTsKLSAgICAgICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgICAgICBlbHNlCi0gICAgICAgICAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAgICAgICAgIGludHJhNHg0UHJlZE1vZGVCID0gQVZDX0k0X0RDOwotICAgICAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgIGVsc2UKLSAgICAgICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgICAgIGRjT25seVByZWRpY3Rpb25GbGFnID0gMTsKLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgIGlmIChkY09ubHlQcmVkaWN0aW9uRmxhZykKLSAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICBpbnRyYTR4NFByZWRNb2RlQSA9IGludHJhNHg0UHJlZE1vZGVCID0gQVZDX0k0X0RDOwotICAgICAgICAgICAgfQotCi0gICAgICAgICAgICBwcmVkSW50cmE0eDRQcmVkTW9kZSA9IEFWQ19NSU4oaW50cmE0eDRQcmVkTW9kZUEsIGludHJhNHg0UHJlZE1vZGVCKTsKLQotICAgICAgICAgICAgZmxhZyA9IDA7Ci0gICAgICAgICAgICBtb2RlID0gY3Vyck1CLT5pNE1vZGVbKGJsb2NrX3k8PDIpK2Jsb2NrX3hdOwotCi0gICAgICAgICAgICBpZiAobW9kZSA9PSAoQVZDSW50cmE0eDRQcmVkTW9kZSlwcmVkSW50cmE0eDRQcmVkTW9kZSkKLSAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICBmbGFnID0gMTsKLSAgICAgICAgICAgIH0KLSAgICAgICAgICAgIGVsc2UgaWYgKG1vZGUgPCBwcmVkSW50cmE0eDRQcmVkTW9kZSkKLSAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICByZW0gPSBtb2RlOwotICAgICAgICAgICAgfQotICAgICAgICAgICAgZWxzZQotICAgICAgICAgICAgewotICAgICAgICAgICAgICAgIHJlbSA9IG1vZGUgLSAxOwotICAgICAgICAgICAgfQotCi0gICAgICAgICAgICBCaXRzdHJlYW1Xcml0ZTFCaXQoc3RyZWFtLCBmbGFnKTsKLQotICAgICAgICAgICAgaWYgKCFmbGFnKQotICAgICAgICAgICAgewotICAgICAgICAgICAgICAgIEJpdHN0cmVhbVdy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AgICAgICAgICAgY29kZSA9IDM7Ci0gICAgICAgIH0KLSAgICAgICAgc3RhdHVzID0gQml0c3RyZWFtV3JpdGVCaXRzKHN0cmVhbSwgNiwgY29kZSk7Ci0gICAgfQotICAgIGVsc2UKLSAgICB7Ci0gICAgICAgIGlmIChuQyA8IDIpCi0gICAgICAgIHsKLSAgICAgICAgICAgIHZsY251bSA9IDA7Ci0gICAgICAgIH0KLSAgICAgICAgZWxzZSBpZiAobkMgPCA0KQotICAgICAgICB7Ci0gICAgICAgICAgICB2bGNudW0gPSAxOwotICAgICAgICB9Ci0gICAgICAgIGVsc2UKLSAgICAgICAgewotICAgICAgICAgICAgdmxjbnVtID0gMjsKLSAgICAgICAgfQotCi0gICAgICAgIGxlbiA9IHRvdENvZWZmVHJhaWxPbmVbdmxjbnVtXVtUcmFpbGluZ09uZXNdW1RvdGFsQ29lZmZdWzBdOwotICAgICAgICBjb2RlID0gdG90Q29lZmZUcmFpbE9uZVt2bGNudW1dW1RyYWlsaW5nT25lc11bVG90YWxDb2VmZl1bMV07Ci0gICAgICAgIHN0YXR1cyA9IEJpdHN0cmVhbVdyaXRlQml0cyhzdHJlYW0sIGxlbiwgY29kZSk7Ci0gICAgfQotCi0gICAgcmV0dXJuIHN0YXR1czsKLX0KLQotQVZDRW5jX1N0YXR1cyBjZV9Ub3RhbENvZWZmVHJhaWxpbmdPbmVzQ2hyb21hREMoQVZDRW5jQml0c3RyZWFtICpzdHJlYW0sIGludCBUcmFpbGluZ09uZXMsIGludCBUb3RhbENvZWZmKQotewotICAgIGNvbnN0IHN0YXRpYyB1aW50OCB0b3RDb2VmZlRyYWlsT25lQ2hyb21bNF1bNV1bMl0gPQotICAgIHsKLSAgICAgICAgeyB7MiwgMX0sIHs2LCA3fSwgezYsIDR9LCB7NiwgM30sIHs2LCAyfX0sCi0gICAgICAgIHsgezAsIDB9LCB7MSwgMX0sIHs2LCA2fSwgezcsIDN9LCB7OCwgM319LAotICAgICAgICB7IHswLCAwfSwgezAs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saWVkLgotICoqIFNlZSB0aGUgTGljZW5zZSBmb3IgdGhlIHNwZWNpZmljIGxhbmd1YWdlIGdvdmVybmluZyBwZXJtaXNzaW9ucyBhbmQKLSAqKiBsaW1pdGF0aW9ucyB1bmRlciB0aGUgTGljZW5zZS4KLSAqLwotLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKLQlGaWxlOgkJdm9BTVJXQi5oCi0KLQlDb250ZW50OglBTVItV0IgY29kZWMgQVBJcyAmIGRhdGEgdHlwZXMKLQotKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLSNpZm5kZWYgIF9fVk9BTVJXQl9IX18KLSNkZWZpbmUgIF9fVk9BTVJXQl9IX18KLQotI2luY2x1ZGUgICJ2b0F1ZGlvLmgiCi0jaWZkZWYgX19jcGx1c3BsdXMKLWV4dGVybiAiQyIgewotI2VuZGlmIC8qIF9fY3BsdXNwbHVzICovCi0jcHJhZ21hIHBhY2socHVzaCwgNCkKLQotLyohKiB0aGUgYml0IHJhdGUgdGhlIGNvZGVjIHN1cHBvcnRzKi8KLXR5cGVkZWYgZW51bSB7Ci0JVk9BTVJXQl9NRE5PTkUJCT0gLTEsCS8qITwgSW52YWxpZCBtb2RlICovCi0JVk9BTVJXQl9NRDY2CQk9IDAsCS8qITwgNi42MGticHMgICAqLwotCVZPQU1SV0JfTUQ4ODUJCT0gMSwgICAgLyohPCA4Ljg1a2JwcyAgICovCi0JVk9BTVJXQl9NRDEyNjUJCT0gMiwJLyohPCAxMi42NWticHMgICovCi0JVk9BTVJXQl9NRDE0MjUJCT0gMywJLyohPCAxNC4yNWticHMgICovCi0JVk9BTVJXQl9NRDE1ODUJCT0gNCwJLyohPCAxNS44NWJwcyAgICovCi0JVk9BTVJXQl9NRDE4MjUJCT0gNSwJLyohPCAxOC4y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bXMtPm5Qb3J0SW5kZXggIT0gMSkgewotICAgICAgICAgICAgICAgIHJldHVybiBPTVhfRXJyb3JVbmRlZmluZWQ7Ci0gICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgIGlmIChwY21QYXJhbXMtPm5DaGFubmVscyA8IDEgfHwgcGNtUGFyYW1zLT5uQ2hhbm5lbHMgPiAyKSB7Ci0gICAgICAgICAgICAgICAgcmV0dXJuIE9NWF9FcnJvclVuZGVmaW5lZDsKLSAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgaWYocGNtUGFyYW1zLT5uUG9ydEluZGV4ID09IDApIHsKLSAgICAgICAgICAgICAgICBtTnVtQ2hhbm5lbHMgPSBwY21QYXJhbXMtPm5DaGFubmVsczsKLSAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgcmV0dXJuIE9NWF9FcnJvck5vbmU7Ci0gICAgICAgIH0KLQotICAgICAgICBjYXNlIE9NWF9JbmRleFBhcmFtU3RhbmRhcmRDb21wb25lbnRSb2xlOgotICAgICAgICB7Ci0gICAgICAgICAgICBjb25zdCBPTVhfUEFSQU1fQ09NUE9ORU5UUk9MRVRZUEUgKnJvbGVQYXJhbXMgPQotICAgICAgICAgICAgICAgIChjb25zdCBPTVhfUEFSQU1fQ09NUE9ORU5UUk9MRVRZUEUgKilwYXJhbXM7Ci0KLSAgICAgICAgICAgIGlmIChtSXNNTGF3KSB7Ci0gICAgICAgICAgICAgICAgaWYgKHN0cm5jbXAoKGNvbnN0IGNoYXIgKilyb2xlUGFyYW1zLT5jUm9sZSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAiYXVkaW9fZGVjb2Rlci5nNzExbWxhdyIsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgT01YX01BWF9TVFJJTkdOQU1FX1NJWkUgLSAxKSkgewotICAgICAgICAgICAgICAgICAgICByZXR1cm4gT01YX0Vycm9yVW5kZWZpbmVkOwotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgIH0gZWxz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gIG5vdGlmeUZpbGxCdWZmZXJEb25lKG91dEhlYWRlcik7Ci0gICAgICAgIG91dEhlYWRlciA9IE5VTEw7Ci0gICAgfQotfQotCi0vLyBzdGF0aWMKLXZvaWQgU29mdEc3MTE6OkRlY29kZUFMYXcoCi0gICAgICAgIGludDE2X3QgKm91dCwgY29uc3QgdWludDhfdCAqaW4sIHNpemVfdCBpblNpemUpIHsKLSAgICB3aGlsZSAoaW5TaXplLS0gPiAwKSB7Ci0gICAgICAgIGludDMyX3QgeCA9ICppbisrOwotCi0gICAgICAgIGludDMyX3QgaXggPSB4IF4gMHg1NTsKLSAgICAgICAgaXggJj0gMHg3ZjsKLQotICAgICAgICBpbnQzMl90IGlleHAgPSBpeCA+PiA0OwotICAgICAgICBpbnQzMl90IG1hbnQgPSBpeCAmIDB4MGY7Ci0KLSAgICAgICAgaWYgKGlleHAgPiAwKSB7Ci0gICAgICAgICAgICBtYW50ICs9IDE2OwotICAgICAgICB9Ci0KLSAgICAgICAgbWFudCA9IChtYW50IDw8IDQpICsgODsKLQotICAgICAgICBpZiAoaWV4cCA+IDEpIHsKLSAgICAgICAgICAgIG1hbnQgPSBtYW50IDw8IChpZXhwIC0gMSk7Ci0gICAgICAgIH0KLQotICAgICAgICAqb3V0KysgPSAoeCA+IDEyNykgPyBtYW50IDogLW1hbnQ7Ci0gICAgfQotfQotCi0vLyBzdGF0aWMKLXZvaWQgU29mdEc3MTE6OkRlY29kZU1MYXcoCi0gICAgICAgIGludDE2X3QgKm91dCwgY29uc3QgdWludDhfdCAqaW4sIHNpemVfdCBpblNpemUpIHsKLSAgICB3aGlsZSAoaW5TaXplLS0gPiAwKSB7Ci0gICAgICAgIGludDMyX3QgeCA9ICppbisrOwotCi0gICAgICAgIGludDMyX3QgbWFudGlzc2EgPSB+eDsKLSAgICAgICAgaW50MzJfdCBleHBvbmVudCA9IChtYW50aXNzYSA+PiA0KSAmIDc7Ci0gICAgICAgIGludDMyX3Qgc2VnbWVudCA9IGV4cG9uZ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IE9NWF9WSURFT19QQVJBTV9QUk9GSUxFTEVWRUxUWVBFICpwcm9maWxlTGV2ZWwgPQotICAgICAgICAgICAgICAgICAgICAoT01YX1ZJREVPX1BBUkFNX1BST0ZJTEVMRVZFTFRZUEUgKikgcGFyYW1zOwotCi0gICAgICAgICAgICBpZiAocHJvZmlsZUxldmVsLT5uUG9ydEluZGV4ICE9IDApIHsgIC8vIElucHV0IHBvcnQgb25seQotICAgICAgICAgICAgICAgIEFMT0dFKCJJbnZhbGlkIHBvcnQgaW5kZXg6ICVsZCIsIHByb2ZpbGVMZXZlbC0+blBvcnRJbmRleCk7Ci0gICAgICAgICAgICAgICAgcmV0dXJuIE9NWF9FcnJvclVuc3VwcG9ydGVkSW5kZXg7Ci0gICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgIHNpemVfdCBpbmRleCA9IHByb2ZpbGVMZXZlbC0+blByb2ZpbGVJbmRleDsKLSAgICAgICAgICAgIGlmIChtTW9kZSA9PSBNT0RFX0gyNjMpIHsKLSAgICAgICAgICAgICAgICBzaXplX3QgblByb2ZpbGVMZXZlbHMgPQotICAgICAgICAgICAgICAgICAgICBzaXplb2Yoa0gyNjNQcm9maWxlTGV2ZWxzKSAvIHNpemVvZihrSDI2M1Byb2ZpbGVMZXZlbHNbMF0pOwotICAgICAgICAgICAgICAgIGlmIChpbmRleCA+PSBuUHJvZmlsZUxldmVscykgewotICAgICAgICAgICAgICAgICAgICByZXR1cm4gT01YX0Vycm9yTm9Nb3JlOwotICAgICAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgICAgIHByb2ZpbGVMZXZlbC0+ZVByb2ZpbGUgPSBrSDI2M1Byb2ZpbGVMZXZlbHNbaW5kZXhdLm1Qcm9maWxlOwotICAgICAgICAgICAgICAgIHByb2ZpbGVMZXZlbC0+ZUxldmVsID0ga0gyNjNQcm9maWxlTGV2ZWxzW2luZGV4XS5tTGV2ZWw7Ci0gICAgICAgICAgICB9IGVsc2UgewotICAgICAgICAgICAgICAgIHNpemVfdCBuUHJvZmlsZUxldmVscyA9Ci0gICAgICAgICAgICAgICAgICAgIHNpemVvZihrTTRWUHJvZmlsZUxldmVscykgLyBzaXplb2Yoa000VlByb2ZpbGVMZXZlbHNbMF0pOwotICAgICAgICAgICAgICAgIGlmIChpbmRleCA+PSBuUHJvZmlsZUxldmVscykgewotICAgICAgICAgICAgICAgICAgICByZXR1cm4gT01YX0Vycm9yTm9Nb3JlOwotICAgICAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgICAgIHByb2ZpbGVMZXZlbC0+ZVByb2ZpbGUgPSBrTTRWUHJvZmlsZUxldmVsc1tpbmRleF0ubVByb2ZpbGU7Ci0gICAgICAgICAgICAgICAgcHJvZmlsZUxldmVsLT5lTGV2ZWwgPSBrTTRWUHJvZmlsZUxldmVsc1tpbmRleF0ubUxldmVsOwotICAgICAgICAgICAgfQotICAgICAgICAgICAgcmV0dXJuIE9NWF9FcnJvck5vbmU7Ci0gICAgICAgIH0KLQotICAgICAgICBkZWZhdWx0OgotICAgICAgICAgICAgcmV0dXJuIFNpbXBsZVNvZnRPTVhDb21wb25lbnQ6OmludGVybmFsR2V0UGFyYW1ldGVyKGluZGV4LCBwYXJhbXMpOwotICAgIH0KLX0KLQotT01YX0VSUk9SVFlQRSBTb2Z0TVBFRzQ6OmludGVybmFsU2V0UGFyYW1ldGVyKAotICAgICAgICBPTVhfSU5ERVhUWVBFIGluZGV4LCBjb25zdCBPTVhfUFRSIHBhcmFtcykgewotICAgIHN3aXRjaCAoaW5kZXgpIHsKLSAgICAgICAgY2FzZSBPTVhfSW5kZXhQYXJhbVN0YW5kYXJkQ29tcG9uZW50Um9sZToKLSAgICAgICAgewotICAgICAgICAgICAgY29uc3QgT01YX1BBUkFNX0NPTVBPTkVOVFJPTEVUWVBFICpyb2xlUGFyYW1zID0KLSAgICAgICAgICAgICAgICAoY29uc3QgT01YX1BBUkFNX0NPTVBPTkVOVFJPTEVUWVBFICopcGFyYW1zOwotCi0gICAgICAgICAgICBpZiAobU1vZGUgPT0gTU9ERV9NUEVHNCkgewotICAgICAgICAgICAgICAgIGlmIChzdHJuY21wKChjb25zdCBjaGFyICopcm9sZVBhcmFtcy0+Y1JvbGUsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgInZpZGVvX2RlY29kZXIubXBlZzQiLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgIE9NWF9NQVhfU1RSSU5HTkFNRV9TSVpFIC0gMSkpIHsKLSAgICAgICAgICAgICAgICAgICAgcmV0dXJuIE9NWF9FcnJvclVuZGVmaW5lZDsKLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICB9IGVsc2UgewotICAgICAgICAgICAgICAgIGlmIChzdHJuY21wKChjb25zdCBjaGFyICopcm9sZVBhcmFtcy0+Y1JvbGUsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgInZpZGVvX2RlY29kZXIuaDI2MyIsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgT01YX01BWF9TVFJJTkdOQU1FX1NJWkUgLSAxKSkgewotICAgICAgICAgICAgICAgICAgICByZXR1cm4gT01YX0Vycm9yVW5kZWZpbmVkOwotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgcmV0dXJuIE9NWF9FcnJvck5vbmU7Ci0gICAgICAgIH0KLQotICAgICAgICBjYXNlIE9NWF9JbmRleFBhcmFtVmlkZW9Qb3J0Rm9ybWF0OgotICAgICAgICB7Ci0gICAgICAgICAgICBPTVhfVklERU9fUEFSQU1fUE9SVEZPUk1BVFRZUEUgKmZvcm1hdFBhcmFtcyA9Ci0gICAgICAgICAgICAgICAgKE9NWF9WSURFT19QQVJBTV9QT1JURk9STUFUVFlQRSAqKXBhcmFtczsKLQotICAgICAgICAgICAgaWYgKGZvcm1hdFBhcmFtcy0+blBvcnRJbmRleCA+IDEpIHsKLSAgICAgICAgICAgICAgICByZXR1cm4gT01YX0Vycm9yVW5kZWZpbmVkOwotICAgICAgICAgIC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GluSW5mby0+bU93bmVkQnlVcyA9IGZhbHNlOwotICAgICAgICAgICAgbm90aWZ5RW1wdHlCdWZmZXJEb25lKGluSGVhZGVyKTsKLQotICAgICAgICAgICAgKyttSW5wdXRCdWZmZXJDb3VudDsKLQotICAgICAgICAgICAgb3V0SGVhZGVyLT5uRmlsbGVkTGVuID0gMDsKLSAgICAgICAgICAgIG91dEhlYWRlci0+bkZsYWdzID0gT01YX0JVRkZFUkZMQUdfRU9TOwotCi0gICAgICAgICAgICBMaXN0PEJ1ZmZlckluZm8gKj46Oml0ZXJhdG9yIGl0ID0gb3V0UXVldWUuYmVnaW4oKTsKLSAgICAgICAgICAgIHdoaWxlICgoKml0KS0+bUhlYWRlciAhPSBvdXRIZWFkZXIpIHsKLSAgICAgICAgICAgICAgICArK2l0OwotICAgICAgICAgICAgfQotCi0gICAgICAgICAgICBCdWZmZXJJbmZvICpvdXRJbmZvID0gKml0OwotICAgICAgICAgICAgb3V0SW5mby0+bU93bmVkQnlVcyA9IGZhbHNlOwotICAgICAgICAgICAgb3V0UXVldWUuZXJhc2UoaXQpOwotICAgICAgICAgICAgb3V0SW5mbyA9IE5VTEw7Ci0KLSAgICAgICAgICAgIG5vdGlmeUZpbGxCdWZmZXJEb25lKG91dEhlYWRlcik7Ci0gICAgICAgICAgICBvdXRIZWFkZXIgPSBOVUxMOwotICAgICAgICAgICAgcmV0dXJuOwotICAgICAgICB9Ci0KLSAgICAgICAgdWludDhfdCAqYml0c3RyZWFtID0gaW5IZWFkZXItPnBCdWZmZXIgKyBpbkhlYWRlci0+bk9mZnNldDsKLQotICAgICAgICBpZiAoIW1Jbml0aWFsaXplZCkgewotICAgICAgICAgICAgdWludDhfdCAqdm9sX2RhdGFbMV07Ci0gICAgICAgICAgICBpbnQzMl90IHZvbF9zaXplID0gMDsKLQotICAgICAgICAgICAgdm9sX2RhdGFbMF0gPSBOVUxMOwotCi0gICAgICAgICAgICBpZiAoaW5IZWFkZXItPm5GbGFncyAmIE9NWF9CV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B0cnVlOwotICAgICAgICAgICAgICAgIHJldHVybjsKLSAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgUFZTZXRQb3N0UHJvY1R5cGUoKFZpZGVvRGVjQ29udHJvbHMgKikgbUhhbmRsZSwgMCk7Ci0KLSAgICAgICAgICAgIGlmIChpbkhlYWRlci0+bkZsYWdzICYgT01YX0JVRkZFUkZMQUdfQ09ERUNDT05GSUcpIHsKLSAgICAgICAgICAgICAgICBpbkluZm8tPm1Pd25lZEJ5VXMgPSBmYWxzZTsKLSAgICAgICAgICAgICAgICBpblF1ZXVlLmVyYXNlKGluUXVldWUuYmVnaW4oKSk7Ci0gICAgICAgICAgICAgICAgaW5JbmZvID0gTlVMTDsKLSAgICAgICAgICAgICAgICBub3RpZnlFbXB0eUJ1ZmZlckRvbmUoaW5IZWFkZXIpOwotICAgICAgICAgICAgICAgIGluSGVhZGVyID0gTlVMTDsKLSAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgbUluaXRpYWxpemVkID0gdHJ1ZTsKLQotICAgICAgICAgICAgaWYgKG1vZGUgPT0gTVBFRzRfTU9ERSAmJiBwb3J0U2V0dGluZ3NDaGFuZ2VkKCkpIHsKLSAgICAgICAgICAgICAgICByZXR1cm47Ci0gICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgIGNvbnRpbnVlOwotICAgICAgICB9Ci0KLSAgICAgICAgaWYgKCFtRnJhbWVzQ29uZmlndXJlZCkgewotICAgICAgICAgICAgUG9ydEluZm8gKnBvcnQgPSBlZGl0UG9ydEluZm8oMSk7Ci0gICAgICAgICAgICBPTVhfQlVGRkVSSEVBREVSVFlQRSAqb3V0SGVhZGVyID0gcG9ydC0+bUJ1ZmZlcnMuZWRpdEl0ZW1BdCgxKS5tSGVhZGVyOwotCi0gICAgICAgICAgICBQVlNldFJlZmVyZW5jZVlVVihtSGFuZGxlLCBvdXRIZWFkZXItPnBCdWZmZXIpOwotCi0gICAgICAgICAgICBtRnJhbWVzQ29uZmlndXJlZCA9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AgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICBzdW0gPSAoKihzdW1fVl9wdHIgLSAyKSArICgqKHN1bV9WX3B0ciAtIDEpIDw8IDEpICsKLSAgICAgICAgICAgICAgICAgICAgICAgKnN1bV9WX3B0ciArIDgpID4+IDQ7Ci0KLSAgICAgICAgICAgICAgICBSZWNfWV9wdHItLTsKLSAgICAgICAgICAgICAgICBpZiAoKGludCkoKlJlY19ZX3B0ciAtIHN1bSkgPiBtYXhfZGlmZikKLSAgICAgICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgICAgIHN1bSA9ICpSZWNfWV9wdHIgLSBtYXhfZGlmZjsKLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgZWxzZSBpZiAoKGludCkoKlJlY19ZX3B0ciAtIHN1bSkgPCAtbWF4X2RpZmYpCi0gICAgICAgICAgICAgICAgewotICAgICAgICAgICAgICAgICAgICBzdW0gPSAqUmVjX1lfcHRyICsgbWF4X2RpZmY7Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgICpSZWNfWV9wdHIrKyA9ICh1aW50OCkgc3VtOwotICAgICAgICAgICAgfQotICAgICAgICAgICAgUmVjX1lfcHRyKys7Ci0gICAgICAgICAgICBzdW1fVl9wdHIrKzsKLSAgICAgICAgICAgIHNpZ25fVl9wdHIrKzsKLSAgICAgICAgfQotICAgIH0KLQotICAgIC8qLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLQotICAgIDsgUmV0dXJuIG5vdGhpbmcgb3IgZGF0YSBvciBkYXRhIHBvaW50ZXIKLSAgICAtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tKi8KLSAgICByZXR1cm47Ci19Ci0jZW5k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MDNmZmZmZmYsIDB4MDdmZmZmZmYsCi0gICAgMHgwZmZmZmZmZiwgMHgxZmZmZmZmZiwgMHgzZmZmZmZmZiwgMHg3ZmZmZmZmZiwKLSAgICAweGZmZmZmZmZmCi19OwotCi0KLS8qID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PSAqLwotLyogIEZ1bmN0aW9uIDogQml0c3RyZWFtRmlsbENhY2hlKCkgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgRGF0ZSAgICAgOiAwOC8yOS8yMDAwICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICBQdXJwb3NlICA6IFJlYWQgbW9yZSBiaXRzdHJlYW0gZGF0YSBpbnRvIGJ1ZmZlciAmIHRoZSAyNC1ieXRlIGNhY2hlLiAgICAqLwotLyogICAgICAgICAgICAgIFRoaXMgZnVuY3Rpb24gaXMgZGlmZmVyZW50IGZyb20gQml0c3RyZWFtRmlsbEJ1ZmZlciBpbiAgICAgICovCi0vKiAgICAgICAgICAgICAgdGhhdCB0aGUgYnVmZmVyIGlzIHRoZSBmcmFtZS1iYXNlZCBidWZmZXIgcHJvdmlkZWQgYnkgICAgICAgKi8KLS8qICAgICAgICAgICAgICB0aGUgYXBwbGljYXRpb24uICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogIEluL291dCAgIDogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgUmV0dXJuICAgOiBQVl9TVUNDRVNTIGlmIHN1Y2Nlc3NlZCwgUFZfRkFJTCBpZiBmYWlsZWQuICAgICAgICAgICAgICAgICAgKi8KLS8qICBNb2RpZmllZCA6IDQvMTYvMDEgIDogcmVtb3ZlZCByZXR1cm4gb2YgUFZfRU5EX09GX0JV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mVhbS0+aW5jbnRfbmV4dCA9IDA7Ci0gICAgICAgIH0KLSAgICAgICAgZWxzZQotICAgICAgICB7Ci0gICAgICAgICAgICBzdHJlYW0tPmluY250ID0gMzI7Ci0gICAgICAgIH0KLSAgICAgICAgcmV0dXJuIFBWX1NVQ0NFU1M7Ci0gICAgfQotCi0gICAgc3RyZWFtLT5uZXh0X3dvcmQgPSAoKHVpbnQzMil2WzBdIDw8IDI0KSB8ICh2WzFdIDw8IDE2KSB8ICh2WzJdIDw8IDgpIHwgdlszXTsKLSAgICBzdHJlYW0tPnJlYWRfcG9pbnQgKz0gNDsKLQotICAgIHN0cmVhbS0+Y3Vycl93b3JkIHw9IChzdHJlYW0tPm5leHRfd29yZCA+PiBudW1fYml0cyk7IC8vIHRoaXMgaXMgc2FmZQotICAgIHN0cmVhbS0+bmV4dF93b3JkIDw8PSAoMzEgLSBudW1fYml0cyk7Ci0gICAgc3RyZWFtLT5uZXh0X3dvcmQgPDw9IDE7Ci0gICAgc3RyZWFtLT5pbmNudF9uZXh0ICs9IHN0cmVhbS0+aW5jbnQ7Ci0gICAgc3RyZWFtLT5pbmNudCA9IDMyOwotICAgIHJldHVybiBQVl9TVUNDRVNTOwotfQotCi0KLS8qID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PSAqLwotLyogIEZ1bmN0aW9uIDogQml0c3RyZWFtUmVzZXQoKSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgRGF0ZSAgICAgOiAwOC8yOS8yMDAwICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICBQdXJwb3NlICA6IEluaXRpYWxpemUgdGhlIGJpdHN0cmVhbSBidWZmZXIgZm9yIGZyYW1lLWJhc2VkIGRlY29kaW5nLiAgICAqLwotLyogIEluL291dCAgIDogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgUmV0dXJuICAgOiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICBNb2RpZmllZCA6ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09ICovCi12b2lkIEJpdHN0cmVhbVJlc2V0KEJpdHN0cmVhbURlY1ZpZGVvICpzdHJlYW0sIHVpbnQ4ICpidWZmZXIsIGludDMyIGJ1ZmZlcl9zaXplKQotewotICAgIC8qIHNldCB1cCBmcmFtZS1iYXNlZCBiaXRzdHJlYW0gYnVmZmVyICovCi0gICAgb3NjbF9tZW1zZXQoc3RyZWFtLCAwLCBzaXplb2YoQml0c3RyZWFtRGVjVmlkZW8pKTsKLSAgICBzdHJlYW0tPmRhdGFfZW5kX3BvcyA9IGJ1ZmZlcl9zaXplOwotICAgIHN0cmVhbS0+Yml0c3RyZWFtQnVmZmVyID0gYnVmZmVyOwotfQotCi0KLS8qID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PSAqLwotLyogIEZ1bmN0aW9uIDogQml0c3RyZWFtT3BlbigpICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgUHVycG9zZSAgOiBJbml0aWFsaXplIHRoZSBiaXRzdHJlYW0gZGF0YSBzdHJ1Y3R1cmUuICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICBJbi9vdXQgICA6ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogIFJldHVybiAgIDogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgTW9kaWZpZWQgOiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PSAqLwotaW50IEJpdHN0cmVhbU9wZW4oQml0c3RyZWFtRGVjVmlkZW8gKnN0cmVhbSwgaW50KQotewotICAgIGludCBidWZmZXJfc2l6ZSA9IDA7Ci0gICAgLyogc2V0IHVwIGxpbmVhciBiaXRzdHJlYW0gYnVmZmVyICovCi0vLyAgc3RyZWFtLT5jdXJyZW50Qnl0ZVBvcyA9IDA7Ci0gICAgc3RyZWFtLT5kYXRhX2VuZF9wb3MgPSAwOwotCi0gICAgc3RyZWFtLT5pbmNudCA9IDA7Ci0gICAgc3RyZWFtLT5pbmNudF9uZXh0ID0gMDsKLSAgICBzdHJlYW0tPmJpdGNudCA9IDA7Ci0gICAgc3RyZWFtLT5jdXJyX3dvcmQgPSBzdHJlYW0tPm5leHRfd29yZCA9IDA7Ci0gICAgc3RyZWFtLT5yZWFkX3BvaW50ID0gc3RyZWFtLT5kYXRhX2VuZF9wb3M7Ci0gICAgcmV0dXJuIGJ1ZmZlcl9zaXplOwotfQotCi0KLS8qID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PSAqLwotLyogIEZ1bmN0aW9uIDogQml0c3RyZWFtQ2xvc2UoKSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgUHVycG9zZSAgOiBDbGVhbnVwIHRoZSBiaXRzdHJlYW0gZGF0YSBzdHJ1Y3R1cmUuICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICBJbi9vdXQgICA6ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogIFJldHVybiAgIDogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgTW9kaWZpZWQgOiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PSAqLwotdm9pZCBCaXRzdHJlYW1DbG9zZShCaXRzdHJlYW1EZWNWaWRlbyAqKQotewotICAgIHJldHVybjsKLX0KLQotCi0vKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKipDb21tZW50QmVnaW4qKioqKioKLSoKLSogLS0gQml0c3RyZWFtU2hvd0JpdHMzMkhDCi0qIFNob3dzIDMyIGJpdHMKLSoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqQ29tbWVudEVuZCoqKioqKioqLwotCi1QVl9TVEFUVVMgQml0c3RyZWFtU2hvd0JpdHMzMkhDKEJpdHN0cmVhbURlY1ZpZGVvICpzdHJlYW0sIHVpbnQzMiAqY29kZSkKLXsKLSAgICBQVl9TVEFUVVMgc3RhdHVzID0gUFZfU1VDQ0VTUzsKLQotICAgIGlmIChzdHJlYW0tPmluY250IDwgMzIpCi0gICAgewotICAgICAgICAvKiBmcmFtZS1iYXNlZCBkZWNvZGluZyAqLwotICAgICAgICBzdGF0dXMgPSBCaXRzdHJlYW1GaWxsQ2FjaGUoc3RyZWFtKTsKLSAgICB9Ci0gICAgKmNvZGUgPSBzdHJlYW0tPmN1cnJfd29yZDsKLSAgICByZXR1cm4gc3RhdHVzOwotfQotCi0vKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKipDb21tZW50QmVnaW4qKioqKioKLSoKLSogLS0gQml0c3RyZWFtU2hvd0JpdHMzMgotKiBTaG93cyB1cHRvIGFuZCBpbmNsdWRpbmcgMzEgYml0cwotKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKipDb21tZW50RW5kKioqKioqKiovCi1QVl9TVEFUVVMgQml0c3RyZWFtU2hvd0JpdHMzMihCaXRzdHJlYW1EZWNWaWRlbyAqc3RyZWFtLCBpbnQgbmJpdHMsIHVpbnQzMiAqY29kZSkKLXsKLSAgICBQVl9TVEFUVVMgc3RhdHVzID0gUFZfU1VDQ0VTUzsKLQotICAgIGlmIChzdHJlYW0tPmluY250IDwgbmJpdHMpCi0gICAgewotICAgICAgICAvKiBmcmFtZS1iYXNlZCBkZWNvZGluZyAqLwotICAgICAgICBzdGF0dXMgPSBCaXRzdHJlYW1GaWxsQ2FjaGUoc3RyZWFtKTsKLSAgICB9Ci0gICAgKmNvZGUgPSBzdHJlYW0tPmN1cnJfd29yZCA+PiAoMzIgLSBuYml0cyk7Ci0gICAgcmV0dXJuIHN0YXR1czsKLX0KLQotCi0jaWZuZGVmIFBWX0JTX0lOTElORQotLyo9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09ICovCi0vKiAgRnVuY3Rpb246ICAgQml0c3RyZWFtU2hvd0JpdHMxNigpICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICBEYXRlOiAgICAgICAxMi8xOC8yMDAwICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogIFB1cnBvc2U6ICAgIFRvIHNlZSB0aGUgbmV4dCAibmJpdHMiKG5iaXRzPD0xNikgYml0c3RyZWFtIGJpdHMgICAgICAgICAgICovCi0vKiAgICAgICAgICAgICAgd2l0aG91dCBhZHZhbmNpbmcgdGhlIHJlYWQgcG9pbnRlciAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PSovCi1QVl9TVEFUVVMgQml0c3RyZWFtU2hvd0JpdHMxNihCaXRzdHJlYW1EZWNWaWRlbyAqc3RyZWFtLCBpbnQgbmJpdHMsIHVpbnQgKmNvZGUpCi17Ci0gICAgUFZfU1RBVFVTIHN0YXR1cyA9IFBWX1NVQ0NFU1M7Ci0KLQotICAgIGlmIChzdHJlYW0tPmluY250IDwgbmJpdHMpCi0gICAgewotICAgICAgICAvKiBmcmFtZS1iYXNlZCBkZWNvZGluZyAqLwotICAgICAgICBzdGF0dXMgPSBCaXRzdHJlYW1GaWxsQ2FjaGUoc3RyZWFtKTsKLSAgICB9Ci0KLSAgICAqY29kZSA9IHN0cmVhbS0+Y3Vycl93b3JkID4+ICgzMiAtIG5iaXRzKTsKLSAgICByZXR1cm4gc3RhdHVzOwotfQotCi0KLS8qPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PSAqLwotLyogIEZ1bmN0aW9uOiAgIEJpdHN0cmVhbVNob3cxNUJpdHMoKSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgRGF0ZTogICAgICAgMDEvMjMvMjAwMSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICBQdXJwb3NlOiAgICBUbyBzZWUgdGhlIG5leHQgMTUgYml0c3RyZWFtIGJpdHMgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogICAgICAgICAgICAgIHdpdGhvdXQgYWR2YW5jaW5nIHRoZSByZWFkIHBvaW50ZXIgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0qLwotUFZfU1RBVFVTIEJpdHN0cmVhbVNob3cxNUJpdHMoQml0c3RyZWFtRGVjVmlkZW8gKnN0cmVhbSwgdWludCAqY29kZSkKLXsKLSAgICBQVl9TVEFUVVMgc3RhdHVzID0gUFZfU1VDQ0VTUzsKLQotICAgIGlmIChzdHJlYW0tPmluY250IDwgMTUpCi0gICAgewotICAgICAgICAvKiBmcmFtZS1iYXNlZCBkZWNvZGluZyAqLwotICAgICAgICBzdGF0dXMgPSBCaXRzdHJlYW1GaWxsQ2FjaGUoc3RyZWFtKTsKLSAgICB9Ci0gICAgKmNvZGUgPSBzdHJlYW0tPmN1cnJfd29yZCA+PiAxNzsKLSAgICByZXR1cm4gc3RhdHVzOwotfQotLyo9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09ICovCi0vKiAgRnVuY3Rpb246IEJpdHN0cmVhbVNob3cxM0JpdHMgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICBEYXRlOiAgICAgICAwNTA5MjMgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICBQdXJwb3NlOiAgICBGYWNpbGlhdGUgYW5kIHNwZWVkIHVwIHNob3dpbmcgMTMgYml0IGZyb20gYml0c3RyZWFtICAgICAgICAqLwotLyogICAgICAgICAgICAgIHVzZWQgaW4gVmxjVENPRUZGIGRlY29kaW5nICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiA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KQotewotICAgIFBWX1NUQVRVUyBzdGF0dXMgPSBQVl9TVUNDRVNTOwotICAgIHVpbnQgICAgY29kZTsKLQotCi0gICAgaWYgKHN0cmVhbS0+aW5jbnQgPCAxKQotICAgIHsKLSAgICAgICAgLyogZnJhbWUtYmFzZWQgZGVjb2RpbmcgKi8KLSAgICAgICAgc3RhdHVzID0gQml0c3RyZWFtRmlsbENhY2hlKHN0cmVhbSk7Ci0gICAgfQotICAgIGNvZGUgPSBzdHJlYW0tPmN1cnJfd29yZCA+PiAzMTsKLSAgICBQVl9CaXRzdHJlYW1GbHVzaEJpdHMoc3RyZWFtLCAxKTsKLQotICAgIHJldHVybiBjb2RlOwotfQotCi0jZW5kaWYKLQotLyogPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09ICovCi0vKiAgRnVuY3Rpb24gOiBCaXRzdHJlYW1SZWFkQml0czE2KCkgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICBQdXJwb3NlICA6IFJlYWQgYml0cyAobmJpdHMgPD0xNikgZnJvbSBiaXRzdHJlYW0gYnVmZmVyLiAgICAgICAgICAgICAgICAqLwotLyogIEluL291dCAgIDogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgUmV0dXJuICAgOiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PSAqLwotdWludCBCaXRzdHJlYW1SZWFkQml0czE2KEJpdHN0cmVhbURlY1ZpZGVvICpzdHJlYW0sIGludCBuYml0cykKLXsKLSAgICB1aW50IGNvZGU7Ci0KLSAgICBpZiAoc3RyZWFtLT5pbmNudCA8IG5iaXRzKQotICAgIHsKLSAgICAgICAgLyogZnJhbWUtYmFzZWQgZGVjb2RpbmcgKi8KLSAgICAgICAgQml0c3RyZWFtRmlsbENhY2hlKHN0cmVhbSk7Ci0gICAgfQotICAgIGNvZGUgPSBzdHJlYW0tPmN1cnJfd29yZCA+PiAoMzIgLSBuYml0cyk7Ci0gICAgUFZfQml0c3RyZWFtRmx1c2hCaXRzKHN0cmVhbSwgbmJpdHMpOwotICAgIHJldHVybiBjb2RlOwotfQotCi0vKiA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0gKi8KLS8qICBGdW5jdGlvbiA6IEJpdHN0cmVhbVJlYWQxQml0cygpICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogIERhdGUgICAgIDogMTAvMjMvMjAwMCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgUHVycG9zZSAgOiBGYWNpbGlhdGUgYW5kIHNwZWVkIHVwIHJlYWRpbmcgMSBiaXQgZnJvbSBiaXRzdHJlYW0uICAgICAgICAgKi8KLS8qICBJbi9vdXQgICA6ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogIFJldHVybiAgIDogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0gKi8KLQotdWludCBCaXRzdHJlYW1SZWFkMUJpdHMoQml0c3RyZWFtRGVjVmlkZW8gKnN0cmVhbSkKLXsKLSAgICB1aW50ICAgIGNvZGU7Ci0KLSAgICBpZiAoc3RyZWFtLT5pbmNudCA8IDEpCi0gICAgewotICAgICAgICAvKiBmcmFtZS1iYXNlZCBkZWNvZGluZyAqLwotICAgICAgICBCaXRzdHJlYW1GaWxsQ2FjaGUoc3RyZWFtKTsKLSAgICB9Ci0gICAgY29kZSA9IHN0cmVhbS0+Y3Vycl93b3JkID4+IDMxOwotICAgIFBWX0JpdHN0cmVhbUZsdXNoQml0cyhzdHJlYW0sIDEpOwotCi0gICAgcmV0dXJuIGNvZGU7Ci19Ci0KLS8qID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PSAqLwotLyogIEZ1bmN0aW9uIDogUFZfQml0c3RyZWFtRmx1c2hCaXRzQ2hlY2soKSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgUHVycG9zZSAgOiBGbHVzaCBuYml0cyBiaXRzIGZyb20gYml0c3RyZWFtIGJ1ZmZlci4gQ2hlY2sgZm9yIGNhY2hlICAgICAgKi8KLS8qICBJbi9vdXQgICA6ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogIFJldHVybiAgIDogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgTW9kaWZpZWQgOiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PSAqLwotUFZfU1RBVFVTIFBWX0JpdHN0cmVhbUZsdXNoQml0c0NoZWNrKEJpdHN0cmVhbURlY1ZpZGVvICpzdHJlYW0sIGludCBuYml0cykKLXsKLSAgICBQVl9TVEFUVVMgc3RhdHVzID0gUFZfU1VDQ0VTUzsKLQotICAgIHN0cmVhbS0+Yml0Y250ICs9IG5iaXRzOwotICAgIHN0cmVhbS0+aW5jbnQgLT0gbmJpdHM7Ci0gICAgaWYgKHN0cmVhbS0+aW5jbnQgPCAwKQotICAgIHsKLSAgICAgICAgLyogZnJhbWUtYmFzZWQgZGVjb2RpbmcgKi8KLSAgICAgICAgc3RhdHVzID0gQml0c3RyZWFtRmlsbENhY2hlKHN0cmVhbSk7Ci0KLSAgICAgICAgaWYgKHN0cmVhbS0+aW5jbnQgPCAwKQotICAgICAgICB7Ci0gICAgICAgICAgICBzdHJlYW0tPmJpdGNudCArPSBzdHJlYW0tPmluY250OwotICAgICAgICAgICAgc3RyZWFtLT5pbmNudCA9IDA7Ci0gICAgICAgIH0KLSAgICB9Ci0gICAgc3RyZWFtLT5jdXJyX3dvcmQgPDw9IG5iaXRzOwotICAgIHJldHVybiBzdGF0dXM7Ci19Ci0KLS8qID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PSAqLwotLyogIEZ1bmN0aW9uIDogQml0c3RyZWFtUmVhZEJpdHMzMigpICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgUHVycG9zZSAgOiBSZWFkIGJpdHMgZnJvbSBiaXRzdHJlYW0gYnVmZmVyLiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICBJbi9vdXQgICA6ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogIFJldHVybiAgIDogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0gKi8KLXVpbnQzMiBCaXRzdHJlYW1SZWFkQml0czMyKEJpdHN0cmVhbURlY1ZpZGVvICpzdHJlYW0sIGludCBuYml0cykKLXsKLSAgICB1aW50MzIgY29kZTsKLQotICAgIGlmIChzdHJlYW0tPmluY250IDwgbmJpdHMpCi0gICAgewotICAgICAgICAvKiBmcmFtZS1iYXNlZCBkZWNvZGluZyAqLwotICAgICAgICBCaXRzdHJlYW1GaWxsQ2FjaGUoc3RyZWFtKTsKLSAgICB9Ci0gICAgY29kZSA9IHN0cmVhbS0+Y3Vycl93b3JkID4+ICgzMiAtIG5iaXRzKTsKLSAgICBQVl9CaXRzdHJlYW1GbHVzaEJpdHMoc3RyZWFtLCBuYml0cyk7Ci0gICAgcmV0dXJuIGNvZGU7Ci19Ci0KLXVpbnQzMiBCaXRzdHJlYW1SZWFkQml0czMySEMoQml0c3RyZWFtRGVjVmlkZW8gKnN0cmVhbSkKLXsKLSAgICB1aW50MzIgY29kZTsKLQotICAgIEJpdHN0cmVhbVNob3dCaXRzMzJIQyhzdHJlYW0sICZjb2RlKTsKLSAgICBzdHJlYW0tPmJpdGNudCArPSAzMjsKLSAgICBzdHJlYW0tPmluY250ID0gMDsKLSAgICBzdHJlYW0tPmN1cnJfd29yZCA9IDA7Ci0gICAgcmV0dXJuIGNvZGU7Ci19Ci0KLS8qID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PSAqLwotLyogIEZ1bmN0aW9uIDogQml0c3RyZWFtQ2hlY2tFbmRCdWZmZXIoKSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgRGF0ZSAgICAgOiAwMy8zMC8yMDAxICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICBQdXJwb3NlICA6IENoZWNrIHRvIHNlZSBpZiB3ZSBhcmUgYXQgdGhlIGVuZCBvZiBidWZmZXIgICAgICAgICAgICAgICAgICAqLwotLyogIEluL291dCAgIDogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgUmV0dXJuICAgOiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICBNb2RpZmllZCA6ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09ICovCi1QVl9TVEFUVVMgQml0c3RyZWFtQ2hlY2tFbmRCdWZmZXIoQml0c3RyZWFtRGVjVmlkZW8gKnN0cmVhbSkKLXsKLSAgICBpZiAoc3RyZWFtLT5yZWFkX3BvaW50ID49IHN0cmVhbS0+ZGF0YV9lbmRfcG9zICYmIHN0cmVhbS0+aW5jbnQgPD0gMCkgcmV0dXJuIFBWX0VORF9PRl9WT1A7Ci0gICAgcmV0dXJuIFBWX1NVQ0NFU1M7Ci19Ci0KLQotUFZfU1RBVFVTIFBWX0JpdHN0cmVhbVNob3dCaXRzQnl0ZUFsaWduKEJpdHN0cmVhbURlY1ZpZGVvICpzdHJlYW0sIGludCBuYml0cywgdWludDMyICpjb2RlKQotewotICAgIFBWX1NUQVRVUyBzdGF0dXMgPSBQVl9TVUNDRVNTOwotCi0gICAgaW50IG5fc3R1ZmZlZDsKLQotICAgIG5fc3R1ZmZlZCA9IDggLSAoc3RyZWFtLT5iaXRjbnQgJiAweDcpOyAvKiAgMDcvMDUvMDEgKi8KLQotICAgIGlmIChzdHJlYW0tPmluY250IDwgKG5iaXRzICsgbl9zdHVmZmVkKSkKLSAgICB7Ci0gICAgICAgIC8qIGZyYW1lLWJhc2VkIGRlY29kaW5nICovCi0gICAgICAgIHN0YXR1cyA9IEJpdHN0cmVhbUZpbGxDYWNoZShzdHJlYW0pOwotICAgIH0KLQotICAgICpjb2RlID0gKHN0cmVhbS0+Y3Vycl93b3JkIDw8IG5fc3R1ZmZlZCkgPj4gKDMyIC0gbmJpdHMpOwotICAgIHJldHVybi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T09PT09PT09PT09PT09PT0gKi8KLS8qICBGdW5jdGlvbiA6IGdldFBvaW50ZXIoKSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgRGF0ZSAgICAgOiAxMC85OCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogIFB1cnBvc2UgIDogZ2V0IGN1cnJlbnQgcG9zaXRpb24gb2YgZmlsZSBwb2ludGVyICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICBJbi9vdXQgICA6ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgUmV0dXJuICAgOiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0gKi8KLWludDMyIGdldFBvaW50ZXIoQml0c3RyZWFtRGVjVmlkZW8gKnN0cmVhbSkKLXsKLSAgICByZXR1cm4gc3RyZWFtLT5iaXRjbnQ7Ci19Ci0KLQotCi0KLS8qID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0gLwotRnVuY3Rpb24gOiBtb3ZlUG9pbnRlclRvKCkKLURhdGUgICAgIDogMDUvMTQvMjAwNAotUHVycG9zZSAgOiBtb3ZlIGJpdHN0cmVhbSBwb2ludGVyIHRvIGEgZGVzaXJlZCBwb3NpdGlvbgotSW4vb3V0ICAgOgotUmV0dXJuICAgOgotTW9kaWZpZWQgOgotLyA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09ICovCi1QVl9TVEFUVVMgbW92ZVBvaW50ZXJUbyhCaXRzdHJlYW1EZWNWaWRlbyA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aWQgc3R1ZmZpbmcgYXQgY3VycmVudCBwb3NpdGlvbi4gICAgKi8KLS8qICBJbi9vdXQgICA6ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogIFJldHVybiAgIDogUFZfVFJVRSBpZiBzdWNjZXNzZWQsIFBWX0ZBTFNFIGlmIGZhaWxlZC4gICAgICAgICAgICAgICAgICAgICovCi0vKiAgTW9kaWZpZWQgOiAxMi8xOC8yMDAwIDogY2hhbmdlZCB0aGUgcGF0dGVybiB0eXBlIHRvIHVpbnQgICAgKi8KLS8qICAgICAgICAgICAgIDA0LzAxLzIwMDEgOiByZW1vdmVkIFBWX0VORF9PRl9CVUZGRVIgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09ICovCi1Cb29sIHZhbGlkU3R1ZmZpbmcoQml0c3RyZWFtRGVjVmlkZW8gKnN0cmVhbSkKLXsKLSAgICB1aW50IG5fc3R1ZmZlZDsKLSAgICB1aW50IHBhdHRlcm47Ci0KLQotICAgIG5fc3R1ZmZlZCA9IDggLSAoc3RyZWFtLT5iaXRjbnQgJiAweDcpOwotICAgIEJpdHN0cmVhbVNob3dCaXRzMTYoc3RyZWFtLCBuX3N0dWZmZWQsICZwYXR0ZXJuKTsKLSAgICBpZiAocGF0dGVybiA9PSBtc2tbbl9zdHVmZmVkLTFdKSByZXR1cm4gUFZfVFJVRTsKLSAgICByZXR1cm4gUFZfRkFMU0U7Ci19Ci0jaWZkZWYgUFZfQU5ORVhfSUpLVF9TVVBQT1JUCi1Cb29sIHZhbGlkU3R1ZmZpbmdfaDI2MyhCaXRzdHJlYW1EZWNWaWRlbyAqc3RyZWFtKQotewotICAgIHVpbnQgbl9zdHVmZmVkOwotICAgIHVpbnQgcGF0dGVybjsKLQotCi0gICAgbl9zdHVmZmVkID0gKDggLSAoc3RyZWFtLT5iaXRjbnQgJiAweDcpKSAmIDc7ICAvLyAgc3RyZWFtLT5pbmNudCAlIDgKLSAgICBpZiAobl9zdHVmZmVkID09IDApCi0gICAgewotICAgICAgICByZXR1cm4gUFZfVFJVRTsKLSAgICB9Ci0gICAgQml0c3RyZWFtU2hvd0JpdHMxNihzdHJlYW0sIG5fc3R1ZmZlZCwgJnBhdHRlcm4pOwotICAgIGlmIChwYXR0ZXJuID09IDApIHJldHVybiBQVl9UUlVFOwotICAgIHJldHVybiBQVl9GQUxTRTsKLX0KLSNlbmRpZgotCi0KLS8qID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PSAqLwotLyogIEZ1bmN0aW9uIDogUFZTZWFyY2hOZXh0SDI2M0ZyYW1lKCkgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgRGF0ZSAgICAgOiAwNC8wOC8yMDA1ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICBQdXJwb3NlICA6IHNlYXJjaCBmb3IgMHgwMCAweDAwIDB4ODAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogIEluL291dCAgIDogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgUmV0dXJuICAgOiBQVl9TVUNDRVNTIGlmIHN1Y2NlZWRlZCAgb3IgUFZfRU5EX09GX1ZPUCBpZiBmYWlsZWQgICAgICAgICAgKi8KLS8qICBNb2RpZmllZCA6ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09ICovCi1QVl9TVEFUVVM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XJwb3NlICA6IHNlYXJjaCBmb3IgMHgwMCAweDAwIDB4MDEgYW5kIG1vdmUgdGhlIHBvaW50ZXIgdG8gdGhlICAgICAgICAqLwotLyogIGJlZ2lubmluZyBvZiB0aGUgc3RhcnQgY29kZSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgSW4vb3V0ICAgOiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICBSZXR1cm4gICA6IFBWX1NVQ0NFU1MgaWYgc3VjY2VlZGVkICBvciBQVl9FTkRfT0ZfVk9QIGlmIGZhaWxlZCAgICAgICAgICAqLwotLyogIE1vZGlmaWVkIDogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0gKi8KLQotUFZfU1RBVFVTIFBWU2VhcmNoTmV4dE00VkZyYW1lKEJpdHN0cmVhbURlY1ZpZGVvICpzdHJlYW0pCi17Ci0gICAgUFZfU1RBVFVTIHN0YXR1cyA9IFBWX1NVQ0NFU1M7Ci0gICAgdWludDggKnB0cjsKLSAgICBpbnQzMiBpOwotICAgIGludDMyIGluaXRpYWxfYnl0ZV9hbGlnbmVkX3Bvc2l0aW9uID0gKHN0cmVhbS0+Yml0Y250ICsgNykgPj4gMzsKLQotICAgIHB0ciA9IHN0cmVhbS0+Yml0c3RyZWFtQnVmZmVyICsgaW5pdGlhbF9ieXRlX2FsaWduZWRfcG9zaXRpb247Ci0KLSAgICBpID0gUFZMb2NhdGVGcmFtZUhlYWRlcihwdHIsIHN0cmVhbS0+ZGF0YV9lbmRfcG9zIC0gaW5pdGlhbF9ieXRlX2FsaWduZWRfcG9zaXRpb24pOwotICAgIGlmIChzdHJlYW0tPmRhdGFfZW5k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ZUgyNjNGcmFtZUhlYWRlcihwdHIsIChpbnQzMilzdHJlYW0tPmRhdGFfZW5kX3BvcyAtIGJ5dGVfcG9zKSArIGJ5dGVfcG9zOwotfQotCi0vKiA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0gKi8KLS8qICBGdW5jdGlvbiA6IHF1aWNrU2VhcmNoVmlkZW9QYWNrZXRIZWFkZXIoKSAgICAgICAgICAgICAgICovCi0vKiAgRGF0ZSAgICAgOiAwNS8wOC8yMDAwICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICBQdXJwb3NlICA6IFF1aWNrIHNlYXJjaCBmb3IgdGhlIG5leHQgdmlkZW8gcGFja2V0IGhlYWRlciAgICAgICAgKi8KLS8qICBJbi9vdXQgICA6ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICBSZXR1cm4gICA6IFBWX1RSVUUgaWYgc3VjY2Vzc2VkLCBQVl9GQUxTRSBpZiBmYWlsZWQuICAgICAgICAgICAgKi8KLS8qICBNb2RpZmllZCA6ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PSAqLwotUFZfU1RBVFVTIHF1aWNrU2VhcmNoVmlkZW9QYWNrZXRIZWFkZXIoQml0c3RyZWFtRGVjVmlkZW8gKnN0cmVhbSwgaW50IG1hcmtlcl9sZW5ndGgpCi17Ci0gICAgUFZfU1RBVFVTIHN0YXR1cyA9IFBWX1NVQ0NFU1M7Ci0gICAgdWludDMyIHRtcHZhcjsKLQotCi0gICAgaWYgKHN0cmVhbS0+c2VhcmNoZWRfZnJhbWVfYm91bmRhcnkgPT0gMCkKLSAgICB7Ci0gICAgICAgIFBWTG9jYXRlTTRWRnJhbWVCb3VuZGFyeShzdHJlYW0pOwotICAgIH0KLQot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T09PT09PT09PT0gKi8KLS8qICBGdW5jdGlvbiA6IHF1aWNrU2VhcmNoTWFya2VycygpICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogIERhdGUgICAgIDogMDEvMjUvOTkgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgUHVycG9zZSAgOiBRdWljayBzZWFyY2ggZm9yIE1vdGlvbiBtYXJrZXIgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICBJbi9vdXQgICA6ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogIFJldHVybiAgIDogQm9vbGVhbiB0cnVlIG9mIGZhbHNlICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgTW9kaWZpZWQgOiAxMi8xOC8yMDAwIDogMzItYml0IHZlcnNpb24gICAgICAgICAgICAgICAgICAgICovCi0vKiA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0gKi8KLVBWX1NUQVRVUyBxdWlja1NlYXJjaE1vdGlvbk1hcmtlcihCaXRzdHJlYW1EZWNWaWRlbyAqc3RyZWFtKQotLy8gTU06ICgxMTExMTAwMDAwMDAwMDAwMSkKLXsKLSAgICBQVl9TVEFUVVMgc3RhdHVzOwotICAgIHVpbnQzMiB0bXB2YXIsIHRtcHZhcjI7Ci0KLSAgICBpZiAoc3RyZWFtLT5zZWFyY2hlZF9mcmFtZV9ib3VuZGFyeSA9PSAwKQotICAgIHsKLSAgICAgICAgUFZMb2NhdGVNNFZGcmFtZUJvdW5kYXJ5KHN0cmVhbSk7Ci0gICAgfQotCi0gICAgd2hpbGUgKFRSVUUpCi0gICAgewotICAgICAgICBzdGF0dXMgPSBCaXRzdHJlYW1DaGVja0VuZEJ1ZmZlcihzdHJlYW0pOwotICAgICAgICBpZiAoc3RhdHVzID09IFBWX0VORF9PRl9WT1ApIHJldHVybiBQVl9FTkRfT0ZfVk9QOwotCi0gICAgICAgIEJpdHN0cmVhbVNob3dCaXRzMzIoc3RyZWFtLCAxNywgJnRtcHZhcik7Ci0gICAgICAgIGlmICghdG1wdmFyKSByZXR1cm4gUFZfRkFJTDsKLQotICAgICAgICBpZiAodG1wdmFyICYgMSkgLy8gIENoZWNrIGlmIHRoZSAxN3RoIGJpdCBmcm9tIHRoZSBjdXJyIGJpdCBwb3MgaXMgYSAnMScKLSAgICAgICAgewotICAgICAgICAgICAgaWYgKHRtcHZhciA9PSBNT1RJT05fTUFSS0VSX0NPTUIpCi0gICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgcmV0dXJuIFBWX1NVQ0NFU1M7IC8vICBGb3VuZAotICAgICAgICAgICAgfQotICAgICAgICAgICAgZWxzZQotICAgICAgICAgICAgewotICAgICAgICAgICAgICAgIHRtcHZhciA+Pj0gMTsKLSAgICAgICAgICAgICAgICB0bXB2YXIgJj0gMHhGOwotICAgICAgICAgICAgICAgIFBWX0JpdHN0cmVhbUZsdXNoQml0cyhzdHJlYW0sIChpbnQpKDEyICsgZmlyc3RaZXJvW3RtcHZhcl0pKTsKLSAgICAgICAgICAgIH0KLSAgICAgICAgfQotICAgICAgICBlbHNlCi0gICAgICAgIHsKLSAgICAgICAgICAgIC8vICAwMS8yNS85OSBHZXQgdGhlIGZpcnN0IDE2IGJpdHMKLSAgICAgICAgICAgIHRtcHZhciA+Pj0gMTsKLSAgICAgICAgICAgIHRtcHZhcjIgPSB0bXB2YXIgJiAweEY7Ci0KLSAgICAgICAgICAgIC8vICAwMS8yNi85OSBDaGVjayBiaXRzICMxMyB+ICMxNgotICAgICAgICAgICAgaWYgKHRtcHZhcjIpCi0gICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgUFZfQml0c3RyZWFtRmx1c2hCaXRzKHN0cmVhbSwgKGludCkoNyArIGxhc3RPbmVbdG1wdmFyMl0pKTsKLSAgICAgICAgICAgIH0KLSAgICAgICAgICAgIGVsc2UKLSAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICB0bXB2YXIgPj49IDQ7Ci0gICAgICAgICAgICAgICAgdG1wdmFyMiA9IHRtcHZhciAmIDB4RjsKLQotICAgICAgICAgICAgICAgIC8vICAwMS8yNi85OSBDaGVjayBiaXRzICM5IH4gIzEyCi0gICAgICAgICAgICAgICAgaWYgKHRtcHZhcjIpCi0gICAgICAgICAgICAgICAgewotICAgICAgICAgICAgICAgICAgICBQVl9CaXRzdHJlYW1GbHVzaEJpdHMoc3RyZWFtLCAoaW50KSgzICsgbGFzdE9uZVt0bXB2YXIyXSkpOwotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICBlbHNlCi0gICAgICAgICAgICAgICAgewotICAgICAgICAgICAgICAgICAgICB0bXB2YXIgPj49IDQ7Ci0gICAgICAgICAgICAgICAgICAgIHRtcHZhcjIgPSB0bXB2YXIgJiAweEY7Ci0KLSAgICAgICAgICAgICAgICAgICAgLy8gIDAxLzI2Lzk5IENoZWNrIGJpdHMgIzUgfiAjOAotICAgICAgICAgICAgICAgICAgICAvLyBXZSBkb24ndCBuZWVkIHRvIGNoZWNrIGZ1cnRoZXIKLSAgICAgICAgICAgICAgICAgICAgLy8gZm9yIHRoZSBmaXJzdCA1IGJpdHMgc2hvdWxkIGJlIGFsbCAxJ3MKLSAgICAgICAgICAgICAgICAgICAgaWYgKGxhc3RPbmVbdG1wdmFyMl0gPCAyKQotICAgICAgICAgICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgICAgICAgICAvKiB3ZSBhbHJlYWR5IGhhdmUgdG9vIG1hbnkgY29uc2VjdXRpdmUgMCdzLiAqLwotICAgICAgICAgICAgICAgICAgICAgICAgLyogR28gZGlyZWN0bHkgcGFzcyB0aGUgbGFzdCBvZiB0aGUgMTcgYml0cy4gKi8KLSAgICAgICAgICAgICAgICAgICAgICAgIFBWX0JpdHN0cmVhbUZsdXNoQml0cyhzdHJlYW0sIDE3KTsKLSAgICAgICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgICAgICBlbHNlCi0gICAgICAgICAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAgICAgICAgIFBWX0JpdHN0cmVhbUZsdXNoQml0cyhzdHJlYW0sIChpbnQpKGxhc3RPbmVbdG1wdmFyMl0gLSAxKSk7Ci0gICAgICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICB9Ci0gICAgICAgIH0KLQotICAgIH0KLX0KLQotLyogPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09ICovCi0vKiAgRnVuY3Rpb24gOiBxdWlja1NlYXJjaERDTSgpICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICBEYXRlICAgICA6IDAxLzIyLzk5ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogIFB1cnBvc2UgIDogUXVpY2sgc2VhcmNoIGZvciBEQyBNYXJrZXIgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgICAgICAgICAgICAgV2UgYXJlIG5vdCB1c2luZyB0aGUgZmFzdGVzdCBhbGdvcml0aG0gcG9zc2libGUuICBXaGF0IHRoaXMgKi8KLS8qICAgICAgICAgICAgICBmdW5jdGlvbiBkb2VzIGlzIHRvIGxvY2F0ZSAxMSBjb25zZWN1dGl2ZSAwJ3MgYW5kIHRoZW4gICAgICAqLwotLyogICAgICAgICAgICAgIGNoZWNrIGlmIHRoZSA3IGJpdHMgYmVmb3JlIHRoZW0gYW5kIHRoZSAxIGJpdCBhZnRlciB0aGVtICAgICovCi0vKiAgICAgICAgICAgICAgYXJlIGNvcnJlY3QuICAoYWN0dWFsbHkgdGhlIGZpcnN0IHBhcnQgb2YgaXQsIGkuZS4gMTYgMCdzICAgKi8KLS8qICAgICAgICAgICAgICBhbmQgYSAxLiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogIEluL291dCAgIDogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgUmV0dXJuICAgOiBCb29sZWFuIHRydWUgb2YgZmFsc2UgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICBNb2RpZmllZCA6IDEyLzE4LzIwMDAgOiAzMi1iaXQgdmVyc2lvbiAgICAgICAgICAgICAgICAgICAgKi8KLS8qID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PSAqLwotUFZfU1RBVFVTIHF1aWNrU2VhcmNoRENNKEJpdHN0cmVhbURlY1ZpZGVvICpzdHJlYW0pCi0vLyBEQ006ICgxMTAgMTAxMSAwMDAwIDAwMDAgMDAwMSkKLXsKLSAgICBQVl9TVEFUVVMgc3RhdHVzOwotICAgIHVpbnQzMiB0bXB2YXIsIHRtcHZhcjI7Ci0KLSAgICBpZiAoc3RyZWFtLT5zZWFyY2hlZF9mcmFtZV9ib3VuZGFyeSA9PSAwKQotICAgIHsKLSAgICAgICAgUFZMb2NhdGVNNFZGcmFtZUJvdW5kYXJ5KHN0cmVhbSk7Ci0gICAgfQotCi0gICAgd2hpbGUgKFRSVUUpCi0gICAgewotICAgICAgICBzdGF0dXMgPSBCaXRzdHJlYW1DaGVja0VuZEJ1ZmZlcihzdHJlYW0pOwotICAgICAgICBpZiAoc3RhdHVzID09IFBWX0VORF9PRl9WT1ApIHJldHVybiBQVl9FTkRfT0ZfVk9QOwotICAgICAgICBCaXRzdHJlYW1TaG93Qml0czMyKHN0cmVhbSwgMTksICZ0bXB2YXIpOwotCi0gICAgICAgIGlmICh0bXB2YXIgJiAxKSAvLyAgQ2hlY2sgaWYgdGhlIDE3dGggYml0IGZyb20gdGhlIGN1cnIgYml0IHBvcyBpcyBhICcxJwotICAgICAgICB7Ci0gICAgICAgICAgICBpZiAodG1wdmFyID09IERDX01BUktFUikKLSAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICByZXR1cm4gUFZfU1VDQ0VTUzsgLy8gIEZvdW5kCi0gICAgICAgICAgICB9Ci0gICAgICAgICAgICBlbHNlCi0gICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgLy8gIDAxLzI1Lzk5IFdlIHRyZWF0IHRoZSBsYXN0IG9mIHRoZSAxOSBiaXRzIGFzIGl0cyA3dGggYml0ICh3aGljaCBpcwotICAgICAgICAgICAgICAgIC8vIGFsc28gYSBgMScKLSAgICAgICAgICAgICAgICBQVl9CaXRzdHJlYW1GbHVzaEJpdHMoc3RyZWFtLCAxMik7Ci0gICAgICAgICAgICB9Ci0gICAgICAgIH0KLSAgICAgICAgZWxzZQotICAgICAgICB7Ci0gICAgICAgICAgICB0bXB2YXIgPj49IDE7Ci0gICAgICAgICAgICB0bXB2YXIyID0gdG1wdmFyICYgMHhGOwotCi0gICAgICAgICAgICBpZiAodG1wdmFyMikKLSAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICBQVl9CaXRzdHJlYW1GbHVzaEJpdHMoc3RyZWFtLCAoaW50KSg3ICsgbGFzdE9uZVt0bXB2YXIyXSkpOwotICAgICAgICAgICAgfQotICAgICAgICAgICAgZWxzZQotICAgICAgICAgICAgewotICAgICAgICAgICAgICAgIHRtcHZhciA+Pj0gNDsKLSAgICAgICAgICAgICAgICB0bXB2YXIyID0gdG1wdmFyICYgMHhGOwotICAgICAgICAgICAgICAgIGlmICh0bXB2YXIyKQotICAgICAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAgICAgUFZfQml0c3RyZWFtRmx1c2hCaXRzKHN0cmVhbSwgKGludCkoMyArIGxhc3RPbmVbdG1wdmFyMl0pKTsKLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgZWxzZQotICAgICAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAgICAgdG1wdmFyID4+PSA0OwotICAgICAgICAgICAgICAgICAgICB0bXB2YXIyID0gdG1wdmFyICYgMHhGOwotICAgICAgICAgICAgICAgICAgICBpZiAobGFzdE9uZVt0bXB2YXIyXSA8IDIpCi0gICAgICAgICAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAgICAgICAgIC8qIHdlIGFscmVhZHkgaGF2ZSB0b28gbWFueSBjb25zZWN1dGl2ZSAwJ3MuICovCi0gICAgICAgICAgICAgICAgICAgICAgICAvKiBHbyBkaXJlY3RseSBwYXNzIHRoZSBsYXN0IG9mIHRoZSAxNyBiaXRzLiAqLwotICAgICAgICAgICAgICAgICAgICAgICAgUFZfQml0c3RyZWFtRmx1c2hCaXRzKHN0cmVhbSwgMTkpOwotICAgICAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgICAgIGVsc2UKLSAgICAgICAgICAgICAgICAgICAgewotICAgICAgICAgICAgICAgICAgICAgICAgUFZfQml0c3RyZWFtRmx1c2hCaXRzKHN0cmVhbSwgKGludCkobGFzdE9uZVt0bXB2YXIyXSAtIDEpKTsKLSAgICAgICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgIH0KLSAgICAgICAgfQotICAgIH0KLX0KLQotLyogPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09ICovCi0vKiAgRnVuY3Rpb24gOiBxdWlja1NlYXJjaEdPQkhlYWRlcigpICAgMDAwMCAwMDAwIDAwMDAgMDAwMCAxICAgICAgICAgICAgICAgKi8KLS8qICBEYXRlICAgICA6IDA3LzA2LzAxICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogIFB1cnBvc2UgIDogUXVpY2sgc2VhcmNoIG9mIEdPQkhlYWRlciAobm90IGJ5dGUgYWxpZ25lZCkgICAgICAgICAgICAgICAgICovCi0vKiAgSW4vb3V0ICAgOiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICBSZXR1cm4gICA6IEludGVnZXIgdmFsdWUgaW5kaWNhdGVzIHR5cGUgb2YgbWFya2VyIGZvdW5kICAgICAgICAgICAgICAgICAqLwotLyogIE1vZGlmaWVkIDogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0gKi8KLVBWX1NUQVRVUyBxdWlja1NlYXJjaEdPQkhlYWRlcihCaXRzdHJlYW1EZWNWaWRlbyAqc3RyZWFtKQotewotICAgIFBWX1NUQVRVUyBzdGF0dXM7Ci0gICAgaW50IGJ5dGUwLCBieXRlMSwgYnl0ZTIsIHNoaWZ0LCB0bXB2YXI7Ci0KLSAgICBCaXRzdHJlYW1CeXRlQWxpZ25Ob0ZvcmNlU3R1ZmZpbmcoc3RyZWFtKTsKLQotICAgIGlmIChzdHJlYW0tPnNlYXJjaGVkX2ZyYW1lX2JvdW5kYXJ5ID09IDApCi0gICAgewotICAgICAgICBQVkxvY2F0ZUgyNjNGcmFtZUJvdW5kYXJ5KHN0cmVhbSk7Ci0gICAgfQotCi0gICAgd2hpbGUgKFRSVUUpCi0gICAgewotICAgICAgICBzdGF0dXMgPSBCaXRzdHJlYW1DaGVja0VuZEJ1ZmZlcihzdHJlYW0pOwotICAgICAgICBpZiAoc3RhdHVzID09IFBWX0VORF9PRl9WT1ApIHJldHVybiBQVl9FTkRfT0ZfVk9QOwotCi0gICAgICAgIGlmIChzdHJlYW0tPmluY250IDwgMjQpCi0gICAgICAgIHsKLSAgICAgICAgICAgIHN0YXR1cyA9IEJpdHN0cmVhbUZpbGxDYWNoZShzdHJlYW0pOwotICAgICAgICB9Ci0KLQotICAgICAgICBieXRlMSA9IChzdHJlYW0tPmN1cnJfd29yZCA8PCA4KSA+PiAyNDsKLSAgICAgICAgaWYgKGJ5dGUxID09IDApCi0gICAgICAgIHsKLSAgICAgICAgICAgIGJ5dGUyID0gKHN0cmVhbS0+Y3Vycl93b3JkIDw8IDE2KSA+PiAyNDsKLSAgICAgICAgICAgIGlmIChieXRlMikKLSAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICB0bXB2YXIgPSBieXRlMiA+PiA0OwotCi0gICAgICAgICAgICAgICAgaWYgKHRtcHZhcikKLSAgICAgICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgICAgIHNoaWZ0ID0gOSAtIGZpcnN0T25lW3RtcHZhcl07Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgIGVsc2UKLSAgICAgICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgICAgIHNoaWZ0ID0gNSAtIGZpcnN0T25lW2J5dGUyXTsKLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgYnl0ZTAgPSBzdHJlYW0tPmN1cnJfd29yZCA+PiAyNDsKLSAgICAgICAgICAgICAgICBpZiAoKGJ5dGUwICYgbXNrW3NoaWZ0XSkgPT0gMCkKLSAgICAgICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgICAgIFBWX0JpdHN0cmVhbUZsdXNoQml0cyhzdHJlYW0sIDggLSBzaGlmdCk7Ci0gICAgICAgICAgICAgICAgICAgIHJldHVybiBQVl9TVUNDRVNTOwotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICBQVl9CaXRzdHJlYW1GbHVzaEJpdHMoc3RyZWFtLCA4KTsgICAgLyogdGhpcmRfYnl0ZSBpcyBub3QgemVybyAqLwotICAgICAgICAgICAgfQotICAgICAgICB9Ci0KLSAgIC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SAgICAgICAgIC8qICAwNy8xOC8wMSAqLwotICAgICAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAgICAgKCooaWRjdGNvbFZDQTJbYm1hcHI+PjRdKSkoY29lZmZfaW4gKyBpKTsKLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgZWxzZQotICAgICAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAgICAgaWRjdGNvbChjb2VmZl9pbiArIGkpOwotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgIH0KLSAgICAgICAgfQotICAgICAgICBpZiAoKGJpdG1hcGNvbFs0XSB8IGJpdG1hcGNvbFs1XSB8IGJpdG1hcGNvbFs2XSB8IGJpdG1hcGNvbFs3XSkgPT0gMCkKLSAgICAgICAgewotICAgICAgICAgICAgYml0bWFwcm93ID4+PSA0OwotICAgICAgICAgICAgKCooaWRjdHJvd1ZDQTJfaW50cmFbKGludCliaXRtYXByb3ddKSkoY29lZmZfaW4sIGNfY29tcCwgd2lkdGgpOwotICAgICAgICB9Ci0gICAgICAgIGVsc2UKLSAgICAgICAgewotICAgICAgICAgICAgaWRjdHJvd19pbnRyYShjb2VmZl9pbiwgY19jb21wLCB3aWR0aCk7Ci0gICAgICAgIH0KLSAgICB9Ci0jZWxzZQotICAgIHZvaWQgaWRjdF9pbnRyYShpbnQgKmJsb2NrLCB1aW50OCAqY29tcCwgaW50IHdpZHRoKTsKLSAgICBpZGN0X2ludHJhKGNvZWZmX2luLCBjX2NvbXAsIHdpZHRoKTsKLSNlbmRpZgotI2Vsc2UKLSAgICB2b2lkIGlkY3RyZWZfaW50cmEoaW50ICpibG9jaywgdWludDggKmNvbXAsIGludCB3aWR0aCk7Ci0gICAgaWRjdHJlZl9pbnRyYShjb2VmZl9pbiwgY19jb21wLCB3aWR0aCk7Ci0jZW5kaWYKLQotCi0gICAgLyotLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tCi0gICAgOyBSZXR1cm4gbm90aGluZyBvciBkYXRhIG9yIGRhdGEgcG9pbnRlcgotICAgIC0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0qLwotICAgIHJldHVybjsKLX0KLQotLyogIDA4LzA0LzA1LCBubyByZXNpZHVlLCBqdXN0IGNvcHkgZnJvbSBwcmVkIHRvIG91dHB1dCAqLwotdm9pZCBDb3B5X0Jsa190b19Wb3AodWludDggKmRzdCwgdWludDggKnByZWQsIGludCB3aWR0aCkKLXsKLSAgICAvKiBjb3B5IDQgYnl0ZXMgYXQgYSB0aW1lICovCi0gICAgd2lkdGggLT0gNDsKLSAgICAqKCh1aW50MzIqKWRzdCkgPSAqKCh1aW50MzIqKXByZWQpOwotICAgICooKHVpbnQzMiopKGRzdCArPSA0KSkgPSAqKCh1aW50MzIqKShwcmVkICs9IDQpKTsKLSAgICAqKCh1aW50MzIqKShkc3QgKz0gd2lkdGgpKSA9ICooKHVpbnQzMiopKHByZWQgKz0gMTIpKTsKLSAgICAqKCh1aW50MzIqKShkc3QgKz0gNCkpID0gKigodWludDMyKikocHJlZCArPSA0KSk7Ci0gICAgKigodWludDMyKikoZHN0ICs9IHdpZHRoKSkgPSAqKCh1aW50MzIqKShwcmVkICs9IDEyKSk7Ci0gICAgKigodWludDMyKikoZHN0ICs9IDQpKSA9ICooKHVpbnQzMiopKHByZWQgKz0gNCkpOwotICAgICooKHVpbnQzMiopKGRzdCArPSB3aWR0aCkpID0gKigodWludDMyKikocHJlZCArPSAxMikpOwotICAgICooKHVpbnQzMiopKGRzdCArPSA0KSkgPSAqKCh1aW50MzIqKShwcmVkICs9IDQpKTsKLSAgICAqKCh1aW50MzIqKShkc3QgKz0gd2lkdGgpKSA9ICooKHVpbnQzMiopKHByZWQgKz0gMTIpKTsKLSAgICAqKCh1aW50MzIqKShkc3QgKz0gNCkpID0gKigodWludDMyKikocHJlZCArPSA0KSk7Ci0gICAgKigodWludDMyKikoZHN0ICs9IHdpZHRoKSkgPSAqKCh1aW50MzIqKShwcmVkICs9IDEyKSk7Ci0gICAgKigodWludDMyKikoZHN0ICs9IDQpKSA9ICooKHVpbnQzMiopKHByZWQgKz0gNCkpOwotICAgICooKHVpbnQzMiopKGRzdCArPSB3aWR0aCkpID0gKigodWludDMyKikocHJlZCArPSAxMikpOwotICAgICooKHVpbnQzMiopKGRzdCArPSA0KSkgPSAqKCh1aW50MzIqKShwcmVkICs9IDQpKTsKLSAgICAqKCh1aW50MzIqKShkc3QgKz0gd2lkdGgpKSA9ICooKHVpbnQzMiopKHByZWQgKz0gMTIpKTsKLSAgICAqKCh1aW50MzIqKShkc3QgKz0gNCkpID0gKigodWludDMyKikocHJlZCArPSA0KSk7Ci0KLSAgICByZXR1cm4gOwotfQotCi0vKiAgMDgvMDQvMDUgY29tcHV0ZSBJRENUIGFuZCBhZGQgcHJlZGljdGlvbiBhdCB0aGUgZW5kICAqLwotdm9pZCBCbG9ja0lEQ1QoCi0gICAgdWludDggKmRzdCwgIC8qIGRlc3RpbmF0aW9uICovCi0gICAgdWludDggKnByZWQsIC8qIHByZWRpY3Rpb24gYmxvY2ssIHBpdGNoIDE2ICovCi0gICAgaW50MTYgICAqY29lZmZfaW4sICAvKiBEQ1QgZGF0YSwgc2l6ZSA2NCAqLwotICAgIGludCB3aWR0aCwgLyogd2lkdGggb2YgZHN0ICovCi0gICAgaW50IG56X2NvZWZzLAotICAgIHVpbnQ4ICpiaXRtYXBjb2wsCi0gICAgdWludDggYml0bWFwcm93Ci0pCi17Ci0jaWZkZWYgSU5URUdFUl9JRENUCi0jaWZkZWYgRkFTVF9JRENUICAvKiBWQ0EgSURDVCB1c2luZyBuemNvZWZzIGFuZCBiaXRtYXBzKi8KLSAgICBpbnQgaSwgYm1hcHI7Ci0gICAgLyotLS0tLS0tL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gICAgICBibGtbOV0gPSAwOwotICAgICAgICB4NSA9IGJsa1sxNV07Ci0gICAgICAgIGJsa1sxNV0gPSAwOwotICAgICAgICB4NiA9IGJsa1sxM107Ci0gICAgICAgIGJsa1sxM10gPSAwOwotICAgICAgICB4NyA9IGJsa1sxMV07Ci0gICAgICAgIGJsa1sxMV0gPSAwOwotICAgICAgICB4MCA9ICgoKihibGsgKz0gOCkpIDw8IDgpICsgODE5MjsKLSAgICAgICAgYmxrWzBdID0gMDsgICAvKiBmb3IgcHJvcGVyIHJvdW5kaW5nIGluIHRoZSBmb3VydGggc3RhZ2UgKi8KLQotICAgICAgICAvKiBmaXJzdCBzdGFnZSAqLwotICAgICAgICB4OCA9IFc3ICogKHg0ICsgeDUpICsgNDsKLSAgICAgICAgeDQgPSAoeDggKyAoVzEgLSBXNykgKiB4NCkgPj4gMzsKLSAgICAgICAgeDUgPSAoeDggLSAoVzEgKyBXNykgKiB4NSkgPj4gMzsKLSAgICAgICAgeDggPSBXMyAqICh4NiArIHg3KSArIDQ7Ci0gICAgICAgIHg2ID0gKHg4IC0gKFczIC0gVzUpICogeDYpID4+IDM7Ci0gICAgICAgIHg3ID0gKHg4IC0gKFczICsgVzUpICogeDcpID4+IDM7Ci0KLSAgICAgICAgLyogc2Vjb25kIHN0YWdlICovCi0gICAgICAgIHg4ID0geDAgKyB4MTsKLSAgICAgICAgeDAgLT0geDE7Ci0gICAgICAgIHgxID0gVzYgKiAoeDMgKyB4MikgKyA0OwotICAgICAgICB4MiA9ICh4MSAtIChXMiArIFc2KSAqIHgyKSA+PiAzOwotICAgICAgICB4MyA9ICh4MSArIChXMiAtIFc2KSAqIHgzKSA+PiAzOwotICAgICAgICB4MSA9IHg0ICsgeDY7Ci0gICAgICAgIHg0IC09IHg2OwotICAgICAgICB4NiA9IHg1ICsgeDc7Ci0gICAgICAgIHg1IC09IHg3OwotCi0gICAgICAgIC8qIHRoaXJkIHN0YWdlICovCi0gICAgICAgIHg3ID0geDggKyB4MzsKLSAgICAgICAgeDggLT0geDM7Ci0gICAgICAgIHgzID0geDAgKyB4MjsKLSAgICAgICAgeDAgLT0geDI7Ci0gICAgICAgIHgyID0gKDE4MSAqICh4NCArIHg1KSArIDEyOCkgPj4gODsKLSAgICAgICAgeDQgPSAoMTgxICogKHg0IC0geDUpICsgMTI4KSA+PiA4OwotCi0gICAgICAgIC8qIGZvdXJ0aCBzdGFnZSAqLwotICAgICAgICBwcmVkX3dvcmQgPSAqKCh1aW50MzIqKShwcmVkICs9IDEyKSk7IC8qIHJlYWQgNCBieXRlcyBmcm9tIHByZWQgKi8KLQotICAgICAgICByZXMgPSAoeDcgKyB4MSkgPj4gMTQ7Ci0gICAgICAgIEFERF9BTkRfQ0xJUDEocmVzKTsKLSAgICAgICAgcmVzMiA9ICh4MyArIHgyKSA+PiAxNDsKLSAgICAgICAgQUREX0FORF9DTElQMihyZXMyKTsKLSAgICAgICAgZHN0X3dvcmQgPSAocmVzMiA8PCA4KSB8IHJlczsKLSAgICAgICAgcmVzID0gKHgwICsgeDQpID4+IDE0OwotICAgICAgICBBRERfQU5EX0NMSVAzKHJlcyk7Ci0gICAgICAgIGRzdF93b3JkIHw9IChyZXMgPDwgMTYpOwotICAgICAgICByZXMgPSAoeDggKyB4NikgPj4gMTQ7Ci0gICAgICAgIEFERF9BTkRfQ0xJUDQocmVzKTsKLSAgICAgICAgZHN0X3dvcmQgfD0gKHJlcyA8PCAyNCk7Ci0gICAgICAgICooKHVpbnQzMiopKGRzdCArPSB3aWR0aCkpID0gZHN0X3dvcmQ7IC8qIHNhdmUgNCBieXRlcyB0byBkc3QgKi8KLQotICAgICAgICBwcmVkX3dvcmQgPSAqKCh1aW50MzIqKShwcmVkICs9IDQpKTsgLyogcmVhZCA0IGJ5dGVzIGZyb20gcHJlZCAqLwotCi0gICAgICAgIHJlcyA9ICh4OCAtIHg2KSA+PiAxNDsKLSAgICAgICAgQUREX0FORF9DTElQMShyZXMpOwotICAgICAgICByZXMyID0gKHgwIC0geD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YgPSBibGtbNV07Ci0gICAgICAgIGJsa1s1XSA9IDA7Ci0gICAgICAgIHg3ID0gYmxrWzNdOwotICAgICAgICBibGtbM10gPSAwOwotI2lmbmRlZiBGQVNUX0lEQ1QKLSAgICAgICAgLyogc2hvcnRjdXQgKi8gIC8qIGNvdmVyZWQgYnkgaWRjdHJvdzEgIDAxLzkvMjAwMSAqLwotICAgICAgICBpZiAoISh4MSB8IHgyIHwgeDMgfCB4NCB8IHg1IHwgeDYgfCB4NykpCi0gICAgICAgIHsKLSAgICAgICAgICAgIGJsa1swXSA9IGJsa1sxXSA9IGJsa1syXSA9IGJsa1szXSA9IGJsa1s0XSA9IGJsa1s1XSA9IGJsa1s2XSA9IGJsa1s3XSA9IChibGtbMF0gKyAzMikgPj4gNjsKLSAgICAgICAgICAgIHJldHVybjsKLSAgICAgICAgfQotI2VuZGlmCi0gICAgICAgIHgwID0gKChpbnQzMilibGtbMF0gPDwgOCkgKyA4MTkyOwotICAgICAgICBibGtbMF0gPSAwOyAgLyogZm9yIHByb3BlciByb3VuZGluZyBpbiB0aGUgZm91cnRoIHN0YWdlICovCi0KLSAgICAgICAgLyogZmlyc3Qgc3RhZ2UgKi8KLSAgICAgICAgeDggPSBXNyAqICh4NCArIHg1KSArIDQ7Ci0gICAgICAgIHg0ID0gKHg4ICsgKFcxIC0gVzcpICogeDQpID4+IDM7Ci0gICAgICAgIHg1ID0gKHg4IC0gKFcxICsgVzcpICogeDUpID4+IDM7Ci0gICAgICAgIHg4ID0gVzMgKiAoeDYgKyB4NykgKyA0OwotICAgICAgICB4NiA9ICh4OCAtIChXMyAtIFc1KSAqIHg2KSA+PiAzOwotICAgICAgICB4NyA9ICh4OCAtIChXMyArIFc1KSAqIHg3KSA+PiAzOwotCi0gICAgICAgIC8qIHNlY29uZCBzdGFnZSAqLwotICAgICAgICB4OCA9IHgwICsgeDE7Ci0gICAgICAgIHgwIC09IHgxOwotICAgICAgICB4MSA9IFc2ICogKHgzICsgeDIpICsgNDsKLSAgICAgICAgeDIgPSAoeDEgLSAoVzIgKyBXNikgKiB4MikgPj4gMzsKLSAgICAgICAgeDMgPSAoeDEgKyAoVzIgLSBXNikgKiB4MykgPj4gMzsKLSAgICAgICAgeDEgPSB4NCArIHg2OwotICAgICAgICB4NCAtPSB4NjsKLSAgICAgICAgeDYgPSB4NSArIHg3OwotICAgICAgICB4NSAtPSB4NzsKLQotICAgICAgICAvKiB0aGlyZCBzdGFnZSAqLwotICAgICAgICB4NyA9IHg4ICsgeDM7Ci0gICAgICAgIHg4IC09IHgzOwotICAgICAgICB4MyA9IHgwICsgeDI7Ci0gICAgICAgIHgwIC09IHgyOwotICAgICAgICB4MiA9ICgxODEgKiAoeDQgKyB4NSkgKyAxMjgpID4+IDg7Ci0gICAgICAgIHg0ID0gKDE4MSAqICh4NCAtIHg1KSArIDEyOCkgPj4gODsKLQotICAgICAgICAvKiBmb3VydGggc3RhZ2UgKi8KLSAgICAgICAgd29yZCA9ICgoeDcgKyB4MSkgPj4gMTQpOwotICAgICAgICBDTElQX1JFU1VMVCh3b3JkKQotCi0gICAgICAgIHRlbXAgPSAoKHgzICsgeDIpID4+IDE0KTsKLSAgICAgICAgQ0xJUF9SRVNVTFQodGVtcCkKLSAgICAgICAgd29yZCA9IHdvcmQgfCAodGVtcCA8PCA4KTsKLQotICAgICAgICB0ZW1wID0gKCh4MCArIHg0KSA+PiAxNCk7Ci0gICAgICAgIENMSVBfUkVTVUxUKHRlbXApCi0gICAgICAgIHdvcmQgPSB3b3JkIHwgKHRlbXAgPDwgMTYpOwotCi0gICAgICAgIHRlbXAgPSAoKHg4ICsgeDYpID4+IDE0KTsKLSAgICAgICAgQ0xJUF9SRVNVTFQodGVtcCkKLSAgICAgICAgd29yZCA9IHdvcmQgfCAodGVtcCA8PCAyNCk7Ci0gICAgICAgICooKGludDMyKikoY29tcCkpID0gd29yZDsKLQotICAgICAgICB3b3JkID0gKCh4OCAtIHg2KSA+PiAxNCk7Ci0gICAgICAgIENMSVBfUk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LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0qLwotICAgIC8qIGNvbHVtbiAodmVydGljYWwpIElEQ1QKLSAgICAqCi0gICAgKiA3ICAgICAgICAgICAgICAgICAgICAgICAgIHBpICAgICAgICAgMSBkc3RbOCprXSA9IHN1bSBjW2xdICogc3JjWzgqbF0gKgotICAgICogY29zKCAtLSAqICggayArIC0gKSAqIGwgKSBsPTAgICAgICAgICAgICAgICAgICAgICAgICA4ICAgICAgICAgIDIKLSAgICAqCi0gICAgKiB3aGVyZTogY1swXSAgICA9IDEvMTAyNCBjWzEuLjddID0gKDEvMTAyNCkqc3FydCgyKSAqLwotICAgIHgxID0gKGludDMyKWJsa1szMl0gPDwgMTE7Ci0gICAgeDIgPSBibGtbNDhdOwotICAgIHgzID0gYmxrWzE2XTsKLSAgICB4NCA9IGJsa1s4XTsKLSAgICB4NSA9IGJsa1s1Nl07Ci0gICAgeDYgPSBibGtbNDBdOwotICAgIHg3ID0gYmxrWzI0XTsKLSNpZm5kZWYgRkFTVF9JRENUCi0gICAgLyogc2hvcnRjdXQgKi8gICAgICAgIC8qIGNvdmVyZWQgYnkgaWRjdGNvbHVtbjEgIDAxLzkvMjAwMSAqLwotICAgIGlmICghKHgxIHwgeDIgfCB4MyB8IHg0IHwgeDUgfCB4NiB8IHg3KSkKLSAgICB7Ci0gICAgICAgIGJsa1swXSA9IGJsa1s4XSA9IGJsa1sxNl0gPSBibGtbMjRdID0gYmxrWzMyXSA9IGJsa1s0MF0gPSBibGtbNDhdID0gYmxrWzU2XQotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgID0gYmxrWzBdIDw8IDM7Ci0gICAgICAgIHJldHVybjsKLSAgICB9Ci0jZW5kaWYKLQotICAgIHgwID0gKChpbnQzMilibGtbMF0gPDwgMTEpICsgMTI4OwotCi0gICAgLyogZmlyc3Qgc3RhZ2UgKi8KLSAgICB4OCA9IFc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0KLTsgRVhURVJOQUwgRlVOQ1RJT04gUkVGRVJFTkNFUwotOyBEZWNsYXJlIGZ1bmN0aW9ucyBkZWZpbmVkIGVsc2V3aGVyZSBhbmQgcmVmZXJlbmNlZCBpbiB0aGlzIG1vZHVsZQotLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSovCi0KLS8qLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLQotOyBFWFRFUk5BTCBHTE9CQUwgU1RPUkUvQlVGRkVSL1BPSU5URVIgUkVGRVJFTkNFUwotOyBEZWNsYXJlIHZhcmlhYmxlcyB1c2VkIGluIHRoaXMgbW9kdWxlIGJ1dCBkZWZpbmVkIGVsc2V3aGVyZQotLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSovCi0jaWZkZWYgUFZfUE9TVFBST0NfT04KLQotLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKLSAgICBGdW5jdGlvbiBwcm90b3R5cGUgOiB2b2lkIENvbWJpbmVkSG9yelZlcnRGaWx0ZXIoICAgdWludDggKnJlYywKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaW50IHdpZHRoLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpbnQgaGVpZ2h0LAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpbnQgKlFQX3N0b3JlLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpbnQgY2hyLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB1aW50OCAqcHBfbW9kKQotICAgIFBhcmFtZXRlcnMgIDoKLSAgICAgICAgcmVjICAgICA6ICAgcG9pbnRlciB0byB0aGUgZGVjb2RlZCBmcmFtZSBidWZmZXIuCi0gICAgICAgIHdpZHRoICAgOiAgIHdpZHRoIG9mIGRlY29kZWQgZnJhbWUuCi0gICAgICAgIGhlaWdodCAgOiAgIGhlaWdodCBvZiBkZWNvZGVkIGZyYW1lCi0gICAgICAgIFFQX3N0b3JlOiAgIHBvaW50ZXIgdG8gdGhlIGFycmF5IG9mIFFQIGNvcnJlc3BvbmRpbmcgdG8gdGhlIGRlY29kZWQgZnJhbWUuCi0gICAgICAgICAgICAgICAgICAgIEl0IGhhZCBvbmx5IG9uZSB2YWx1ZSBmb3IgZWFjaCBNQi4KLSAgICAgICAgY2hyICAgICA6ICAgbHVtYSBvciBjb2xvciBpbmRpY2F0aW9uCi0gICAgICAgICAgICAgICAgICAgID09IDAgbHVtYQotICAgICAgICAgICAgICAgICAgICA9PSAxIGNvbG9yCi0gICAgICAgIHBwX21vZCAgOiAgIFRoZSBzZW1waG9yZSB1c2VkIGZvciBkZWJsb2NraW5nCi0KLSAgICBSZW1hcmsgICAgICA6ICAgVGhlIGZ1bmN0aW9uIGRvIHRoZSBkZWJsb2NraW5nIG9uIGRlY29kZWQgZnJhbWVzLgotICAgICAgICAgICAgICAgICAgICBGaXJzdCBiYXNlZCBvbiB0aGUgc2VtYXBob3JlIGluZm8uLCBpdCBpcyBkaXZpZGVkIGludG8gaGFyZCBhbmQgc29mdCBmaWx0ZXJpbmcuCi0gICAgICAgICAgICAgICAgICAgIFRvIGRpZmZlcmVudGlhdGUgcmVhbCBhbmQgZmFrZSBlZGdlLCBpdCB0aGVuIGNoZWNrIHRoZSBkaWZmZ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ICAgIC8qLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLQotICAgIDsgRnVuY3Rpb24gYm9keSBoZXJlCi0gICAgLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSovCi0gICAgcHBfdyA9ICh3aWR0aCA+PiAzKTsKLSAgICBwcF9oID0gKGhlaWdodCA+PiAzKTsKLQotICAgIGZvciAobWJyID0gMDsgbWJyIDwgcHBfaDsgbWJyICs9IDIpICAgICAgICAgLyogcm93IG9mIGJsb2NrcyAqLwotICAgIHsKLSAgICAgICAgYnJ3aWR0aCA9IG1iciAqIHBwX3c7ICAgICAgICAgICAgICAgLyogbnVtYmVyIG9mIGJsb2NrcyBhYm92ZSBjdXJyZW50IGJsb2NrIHJvdyAqLwotICAgICAgICBmb3IgKG1iYyA9IDA7IG1iYyA8IHBwX3c7IG1iYyArPSAyKSAgICAgLyogY29sIG9mIGJsb2NrcyAqLwotICAgICAgICB7Ci0gICAgICAgICAgICBpZiAoIWNocikKLSAgICAgICAgICAgICAgICBRUCA9IFFQX3N0b3JlWyhicndpZHRoPj4yKSArIChtYmM+PjEpXTsgLyogUVAgaXMgcGVyIE1CIGJhc2VkIHZhbHVlICovCi0KLSAgICAgICAgICAgIC8qKioqKioqKiogZm9yIGVhY2ggYmxvY2sgKioqKioqKioqKioqKiovCi0gICAgICAgICAgICAvKioqKioqKioqKioqKioqKioqIEhvcml6LiBGaWx0ZXJpbmcgKioqKioqKioqKioqKioqKioqKiovCi0gICAgICAgICAgICBmb3IgKGJyID0gbWJyICsgMTsgYnIgPCBtYnIgKyAzOyBicisrKSAgLyogMngyIGJsb2NrcyAqLwotICAgICAgICAgICAgewotICAgICAgICAgICAgICAgIGJyd2lkdGggKz0gcHBfdzsgICAgICAgICAgICAgICAgICAgIC8qIG51bWJlciBvZiBibG9ja3MgYWJvdmUgJiBsZWZ0IGN1cnJlbnQgYmxvY2sgcm93ICovCi0gICAgICAgICAgICAgICAgLyogdGhlIHByb2ZpbGUgb24gQVJNOTIwVCBzaG93cyBzZXBhcmF0ZSB0aGVzZSB0d28gYm91bmRhcnkgY2hlY2sgaXMgZmFzdGVyIHRoYW4gY29tYmluZSB0aGVtICovCi0gICAgICAgICAgICAgICAgaWYgKGJyIDwgcHBfaCkgICAgICAgICAgICAgICAgICAvKiBib3VuZGFyeSA6IGRvbid0IGRvIGl0IG9uIHRoZSBsb3dlc3Qgcm93IGJsb2NrICovCi0gICAgICAgICAgICAgICAgICAgIGZvciAoYmMgPSBtYmM7IGJjIDwgbWJjICsgMjsgYmMrKykKLSAgICAgICAgICAgICAgICAgICAgewotICAgICAgICAgICAgICAgICAgICAgICAgLyoqKioqKiBjaGVjayBib3VuZGFyeSBmb3IgZGVibG9ja2luZyAqKioqKioqKioqKiovCi0gICAgICAgICAgICAgICAgICAgICAgICBpZiAoYmMgPCBwcF93KSAgICAgICAgICAgICAgLyogYm91bmRhcnkgOiBkb24ndCBkbyBpdCBvbiB0aGUgbW9zdCByaWdodCBjb2wgYmxvY2sgKi8KLSAgICAgICAgICAgICAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBwdHIgPSByZWMgKyAoYnJ3aWR0aCA8PCA2KSArIChiYyA8PCAzKTsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBqVmFsMCA9IGJyd2lkdGggKyBiYzsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoY2hyKSAgICBRUCA9IFFQX3N0b3JlW2pWYWwwXTsKLQotICAgICAgICAgICAgICAgICAgICAgICAgICAgIHB0cl9lID0gcHRyICsgODsgICAgICAgIC8qIHBvaW50ZXIgdG8gd2hlcmUgdGhlIGxvb3AgZW5kcyAqLwotCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKCgocHBfbW9kW2pWYWwwXSYweDAyKSkgJiYgKChwcF9tb2RbalZhbDAtcHBfd10mMHgwMikpKQotICAgICAgICAgICAgICAgICAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLyogSG9yaXogSGFyZCBmaWx0ZXIgKi8KLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZG8KLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgewotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgalZhbDAgPSAqKHB0ciAtIHdpZHRoKTsgICAgIC8qIEMgKi8KLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGpWYWwxID0gKnB0cjsgICAgICAgICAgICAgICAvKiBEICovCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBqVmFsMiA9IGpWYWwxIC0galZhbDA7Ci0KLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICgoKGpWYWwyID4gMCkgJiYgKGpWYWwyIDwgKFFQIDw8IDEpKSkKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfHwgKChqVmFsMiA8IDApICYmIChqVmFsMiA+IC0oUVAgPDwgMSkpKSkgLyogKEQtQykgY29tcGFyZWQgd2l0aCAyUVAgKi8KLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvKiBkaWZmZXJlbnRpYXRlIGJldHdlZW4gcmVhbCBhbmQgZmFrZSBlZGdlICovCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgalZhbDAgPSAoKGpWYWwwICsgalZhbDEpID4+IDEpOyAgICAgLyogKEQrQykvMiAqLwotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICoocHRyIC0gd2lkdGgpID0gKHVpbnQ4KShqVmFsMCk7ICAgIC8qICBDICovCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKnB0ciA9ICh1aW50OCkoalZhbDApOyAgICAgICAgICAvKiAgRCAqLwotCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgalZhbDAgPSAqKHB0ciAtICh3aWR0aCA8PCAxKSk7ICAgICAgLyogQiAqLwotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGpWYWwxID0gKihwdHIgKyB3aWR0aCk7ICAgICAgICAgLyogRSAqLwotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGpWYWwyID0galZhbDEgLSBqVmFsMDsgICAgICAvKiBFLUIgKi8KLQotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChqVmFsMiA+IDApCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgewotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBqVmFsMCArPSAoKGpWYWwyICsgMykgPj4gMik7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGpWYWwxIC09ICgoalZhbDIgKyAzKSA+PiAyKTsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKihwdHIgLSAod2lkdGggPDwgMSkpID0gKHVpbnQ4KWpWYWwwOyAgICAgICAvKiAgc3RvcmUgQiAqLwotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqKHB0ciArIHdpZHRoKSA9ICh1aW50OClqVmFsMTsgICAgICAgICAgLyogc3RvcmUgRSAqLwotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBlbHNlIGlmIChqVmFsMikKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGpWYWwwIC09ICgoMyAtIGpWYWwyKSA+PiAyKTsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgalZhbDEgKz0gKCgzIC0galZhbDIpID4+IDIpOwotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqKHB0ciAtICh3aWR0aCA8PCAxKSkgPSAodWludDgpalZhbDA7ICAgICAgIC8qICBzdG9yZSBCICovCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICoocHRyICsgd2lkdGgpID0gKHVpbnQ4KWpWYWwxOyAgICAgICAgICAvKiBzdG9yZSBFICovCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQotCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgalZhbDAgPSAqKHB0ciAtICh3aWR0aCA8PCAxKSAtIHdpZHRoKTsgIC8qIEEgKi8KLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBqVmFsMSA9ICoocHRyICsgKHdpZHRoIDw8IDEpKTsgICAgICAvKiBGICovCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgalZhbDIgPSBqVmFsMSAtIGpWYWwwOyAgICAgICAgICAgICAgLyogKEYtQSkgKi8KLQotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChqVmFsMiA+IDApCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgewotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBqVmFsMCArPSAoKGpWYWwyICsgNykgPj4gMyk7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGpWYWwxIC09ICgoalZhbDIgKyA3KSA+PiAzKTsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKihwdHIgLSAod2lkdGggPDwgMSkgLSB3aWR0aCkgPSAodWludDgpKGpWYWwwKTsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKihwdHIgKyAod2lkdGggPDwgMSkpID0gKHVpbnQ4KShqVmFsMSk7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGVsc2UgaWYgKGpWYWwyKQotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgalZhbDAgLT0gKCg3IC0galZhbDIpID4+IDMpOwotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBqVmFsMSArPSAoKDcgLSBqVmFsMikgPj4gMyk7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICoocHRyIC0gKHdpZHRoIDw8IDEpIC0gd2lkdGgpID0gKHVpbnQ4KShqVmFsMCk7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICoocHRyICsgKHdpZHRoIDw8IDEpKSA9ICh1aW50OCkoalZhbDEpOwotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0vKiBhM18wID4gMlFQICovCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgd2hpbGUgKCsrcHRyIDwgcHRyX2UpOwotICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBlbHNlICAgLyogSG9yaXogc29mdCBmaWx0ZXIqLwotICAgICAgICAgICAgICAgICAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZG8KLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgewotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgalZhbDAgPSAqKHB0ciAtIHdpZHRoKTsgLyogQiAqLwotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgalZhbDEgPSAqcHRyOyAgICAgICAgICAgLyogQyAqLwotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgalZhbDIgPSBqVmFsMSAtIGpWYWwwOyAgLyogQy1CICovCi0KLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICgoKGpWYWwyID4gMCkgJiYgKGpWYWwyIDwgKFFQKSkpCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHx8ICgoalZhbDIgPCAwKSAmJiAoalZhbDIgPiAtKFFQKSkpKSAvKiAoQy1CKSBjb21wYXJlZCB3aXRoIFFQICovCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB7Ci0KLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBqVmFsMCA9ICgoalZhbDAgKyBqVmFsMSkgPj4gMSk7ICAgICAvKiAoQitDKS8yIGNhbm5vdCBvdmVyZmxvdzsgY2VpbCgpICovCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKihwdHIgLSB3aWR0aCkgPSAodWludDgpKGpWYWwwKTsgICAgLyogQiA9IChCK0MpLzIgKi8KLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqcHRyID0gKHVpbnQ4KWpWYWwwOyAgICAgICAgICAgIC8qIEMgPSAoQitDKS8yICovCi0KLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBqVmFsMCA9ICoocHRyIC0gKHdpZHRoIDw8IDEpKTsgICAgICAvKiBBICovCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgalZhbDEgPSAqKHB0ciArIHdpZHRoKTsgICAgICAgICAvKiBEICovCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgalZhbDIgPSBqVmFsMSAtIGpWYWwwOyAgICAgICAgICAvKiBELUEgKi8KLQotCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGpWYWwyID4gMCkKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGpWYWwxIC09ICgoalZhbDIgKyA3KSA+PiAzKTsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgalZhbDAgKz0gKChqVmFsMiArIDcpID4+IDMpOwotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqKHB0ciAtICh3aWR0aCA8PCAxKSkgPSAodWludDgpalZhbDA7ICAgICAgIC8qIEEgKi8KLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKihwdHIgKyB3aWR0aCkgPSAodWludDgpalZhbDE7ICAgICAgICAgIC8qIEQgKi8KLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZWxzZSBpZiAoalZhbDIpCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgewotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBqVmFsMSArPSAoKDcgLSBqVmFsMikgPj4gMyk7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGpWYWwwIC09ICgoNyAtIGpWYWwyKSA+PiAzKTsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKihwdHIgLSAod2lkdGggPDwgMSkpID0gKHVpbnQ4KWpWYWwwOyAgICAgICAvKiBBICovCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICoocHRyICsgd2lkdGgpID0gKHVpbnQ4KWpWYWwxOyAgICAgICAgICAvKiBEICovCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHdoaWxlICgrK3B0ciA8IHB0cl9lKTsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICB9IC8qIFNvZnQgZmlsdGVyKi8KLSAgICAgICAgICAgICAgICAgICAgICAgIH0vKiBib3VuZGFyeSBjaGVja2luZyovCi0gICAgICAgICAgICAgICAgICAgIH0vKmJjKi8KLSAgICAgICAgICAgIH0vKmJyKi8KLSAgICAgICAgICAgIGJyd2lkdGggLT0gKHBwX3cgPDwgMSk7Ci0gICAgICAgICAgICAvKioqKioqKioqKioqKioqKioqIFZlcnQuIEZpbHRlcmluZyAqKioqKioqKioqKioqKioqKioqKi8KLSAgICAgICAgICAgIGZvciAoYnIgPSBtYnI7IGJyIDwgbWJyICsgMjsgYnIrKykKLSAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICBpZiAoYnIgPCBwcF9oKQotICAgICAgICAgICAgICAgICAgICBmb3IgKGJjID0gbWJjICsgMTsgYmMgPCBtYmMgKyAzOyBiYysrKQotICAgICAgICAgICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgICAgICAgICAvKioqKioqIGNoZWNrIGJvdW5kYXJ5IGZvciBkZWJsb2NraW5nICoqKioqKioqKioqKi8KLSAgICAgICAgICAgICAgICAgICAgICAgIGlmIChiYyA8IHBwX3cpCi0gICAgICAgICAgICAgICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgcHRyID0gcmVjICsgKGJyd2lkdGggPDwgNikgKyAoYmMgPDwgMyk7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgalZhbDAgPSBicndpZHRoICsgYmM7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGNocikgICAgUVAgPSBRUF9zdG9yZVtqVmFsMF07Ci0KLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBwdHJfZSA9IHB0ciArICh3aWR0aCA8PCAzKTsKLQotICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICgoKHBwX21vZFtqVmFsMC0xXSYweDAxKSkgJiYgKChwcF9tb2RbalZhbDBdJjB4MDEpKSkKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8qIFZlcnQgSGFyZCBmaWx0ZXIgKi8KLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZG8KLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgewotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgalZhbDEgPSAqcHRyOyAgICAgICAvKiBEICovCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBqVmFsMCA9ICoocHRyIC0gMSk7IC8qIEMgKi8KLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGpWYWwyID0galZhbDEgLSBqVmFsMDsgIC8qIEQtQyAqLwotCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoKChqVmFsMiA+IDApICYmIChqVmFsMiA8IChRUCA8PCAxKSkpCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHx8ICgoalZhbDIgPCAwKSAmJiAoalZhbDIgPiAtKFFQIDw8IDEpKSkpCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgalZhbDEgPSAoalZhbDAgKyBqVmFsMSkgPj4gMTsgICAvKiAoQytEKS8yICovCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKnB0ciAgICAgICAgPSAgIGpWYWwxOwotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICoocHRyIC0gMSkgID0gICBqVmFsMTsKLQotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGpWYWwxID0gKihwdHIgKyAxKTsgICAgIC8qIEUgKi8KLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBqVmFsMCA9ICoocHRyIC0gMik7ICAgICAvKiBCICovCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgalZhbDIgPSBqVmFsMSAtIGpWYWwwOyAgICAgIC8qIEUtQiAqLwotCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGpWYWwyID4gMCkKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGpWYWwxIC09ICgoalZhbDIgKyAzKSA+PiAyKTsgICAgICAgIC8qIEUgPSBFIC0oRS1CKS80ICovCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGpWYWwwICs9ICgoalZhbDIgKyAzKSA+PiAyKTsgICAgICAgIC8qIEIgPSBCICsoRS1CKS80ICovCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICoocHRyICsgMSkgPSBqVmFsMTsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKihwdHIgLSAyKSA9IGpWYWwwOwotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBlbHNlIGlmIChqVmFsMikKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGpWYWwxICs9ICgoMyAtIGpWYWwyKSA+PiAyKTsgICAgICAgIC8qIEUgPSBFIC0oRS1CKS80ICovCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGpWYWwwIC09ICgoMyAtIGpWYWwyKSA+PiAyKTsgICAgICAgIC8qIEIgPSBCICsoRS1CKS80ICovCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICoocHRyICsgMSkgPSBqVmFsMTsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKihwdHIgLSAyKSA9IGpWYWwwOwotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGpWYWwxID0gKihwdHIgKyAyKTsgICAgIC8qIEYgKi8KLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBqVmFsMCA9ICoocHRyIC0gMyk7ICAgICAvKiBBICovCi0KLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBqVmFsMiA9IGpWYWwxIC0galZhbDA7ICAgICAgICAgIC8qIChGLUEpICovCi0KLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoalZhbDIgPiAwKQotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgalZhbDEgLT0gKChqVmFsMiArIDcpID4+IDMpOyAgICAvKiBGIC09IChGLUEpLzggKi8KLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgalZhbDAgKz0gKChqVmFsMiArIDcpID4+IDMpOyAgICAvKiBBICs9IChGLUEpLzggKi8KLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKihwdHIgKyAyKSA9IGpWYWwxOwotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqKHB0ciAtIDMpID0galZhbDA7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGVsc2UgaWYgKGpWYWwyKQotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgalZhbDEgLT0gKChqVmFsMiAtIDcpID4+IDMpOyAgICAvKiBGIC09IChGLUEpLzggKi8KLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgalZhbDAgKz0gKChqVmFsMiAtIDcpID4+IDMpOyAgICAvKiBBICs9IChGLUEpLzggKi8KLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKihwdHIgKyAyKSA9IGpWYWwxOwotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqKHB0ciAtIDMpID0galZhbDA7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSAgIC8qIGVuZCBvZiB2ZXIgaGFyZCBmaWxldGVyaW5nICovCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgd2hpbGUgKChwdHIgKz0gd2lkdGgpIDwgcHRyX2UpOwotICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBlbHNlICAgLyogVmVydCBzb2Z0IGZpbHRlciovCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgewotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBkbwotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBqVmFsMSA9ICpwdHI7ICAgICAgICAgICAgICAgLyogQyAqLwotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgalZhbDAgPSAqKHB0ciAtIDEpOyAgICAgICAgIC8qIEIgKi8KLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGpWYWwyID0galZhbDEgLSBqVmFsMDsKLQotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKCgoalZhbDIgPiAwKSAmJiAoalZhbDIgPCAoUVApKSkKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfHwgKChqVmFsMiA8IDApICYmIChqVmFsMiA+IC0oUVApKSkpCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB7Ci0KLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBqVmFsMSA9IChqVmFsMCArIGpWYWwxICsgMSkgPj4gMTsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqcHRyID0galZhbDE7ICAgICAgICAgICAvKiBDICovCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKihwdHIgLSAxKSA9IGpWYWwxOyAgICAgLyogQiAqLwotCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgalZhbDEgPSAqKHB0ciArIDEpOyAgICAgLyogRCAqLwotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGpWYWwwID0gKihwdHIgLSAyKTsgICAgIC8qIEEgKi8KLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBqVmFsMiA9IChqVmFsMSAtIGpWYWwwKTsgICAgICAgIC8qIEQtIEEgKi8KLQotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChqVmFsMiA+IDApCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgewotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBqVmFsMSAtPSAoKChqVmFsMikgKyA3KSA+PiAzKTsgICAgICAvKiBEIC09IChELUEpLzggKi8KLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgalZhbDAgKz0gKCgoalZhbDIpICsgNykgPj4gMyk7ICAgICAgLyogQSArPSAoRC1BKS84ICovCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICoocHRyICsgMSkgPSBqVmFsMTsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKihwdHIgLSAyKSA9IGpWYWwwOwotCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGVsc2UgaWYgKGpWYWwyKQotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgalZhbDEgKz0gKCg3IC0gKGpWYWwyKSkgPj4gMyk7ICAgICAgLyogRCAtPSAoRC1BKS84ICovCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGpWYWwwIC09ICgoNyAtIChqVmFsMikpID4+IDMpOyAgICAgIC8qIEEgKz0gKEQtQSkvOCAqLwotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqKHB0ciArIDEpID0galZhbDE7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICoocHRyIC0gMikgPSBqVmFsMDsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgd2hpbGUgKChwdHIgKz0gd2lkdGgpIDwgcHRyX2UpOwotICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0gLyogU29mdCBmaWx0ZXIqLwotICAgICAgICAgICAgICAgICAgICAgICAgfSAvKiBib3VuZGFyeSovCi0gICAgICAgICAgICAgICAgICAgIH0gLypiYyovCi0gICAgICAgICAgICAgICAgYnJ3aWR0aCArPSBwcF93OwotICAgICAgICAgICAgfS8qYnIqLwotICAgICAgICAgICAgYnJ3aWR0aCAtPSAocHBfdyA8PCAxKTsKLSAgICAgICAgfS8qbWJjKi8KLSAgICAgICAgYnJ3aWR0aCArPSAocHBfdyA8PCAxKTsKLSAgICB9LyptYnIqLwotICAgIC8qLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLQotICAgIDsgUmV0dXJuIG5vdGhpbmcgb3IgZGF0YSBvciBkYXRhIHBvaW50ZXIKLSAgICAtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tKi8KLSAgICByZXR1cm47Ci19Ci12b2lkIENvbWJpbmVkSG9yelZlcnRGaWx0ZXJfTm9Tb2Z0RGVibG9ja2luZygKLSAgICB1aW50OCAqcmVjLAotICAgIGludCB3aWR0aCwKLSAgICBpbnQgaGVpZ2h0LAotICAgIGludDE2ICpRUF9zdG9yZSwKLSAgICBpbnQgY2hyLAotICAgIHVpbnQ4ICpwcF9tb2QpCi17Ci0KLSAgICAvKi0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tL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Ci0gICAgICAgICAgICAgICAgUVAgPSBRUF9zdG9yZVsoYnJ3aWR0aD4+MikgKyAobWJjPj4xKV07IC8qIFFQIGlzIHBlciBNQiBiYXNlZCB2YWx1ZSAqLwotCi0gICAgICAgICAgICAvKioqKioqKioqIGZvciBlYWNoIGJsb2NrICoqKioqKioqKioqKioqLwotICAgICAgICAgICAgLyoqKioqKioqKioqKioqKioqKiBIb3Jpei4gRmlsdGVyaW5nICoqKioqKioqKioqKioqKioqKioqLwotICAgICAgICAgICAgZm9yIChiciA9IG1iciArIDE7IGJyIDwgbWJyICsgMzsgYnIrKykgIC8qIDJ4MiBibG9ja3MgKi8KLSAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICBicndpZHRoICs9IHBwX3c7ICAgICAgICAgICAgICAgICAgICAvKiBudW1iZXIgb2YgYmxvY2tzIGFib3ZlICYgbGVmdCBjdXJyZW50IGJsb2NrIHJvdyAqLwotICAgICAgICAgICAgICAgIC8qIHRoZSBwcm9maWxlIG9uIEFSTTkyMFQgc2hvd3Mgc2VwYXJhdGUgdGhlc2UgdHdvIGJvdW5kYXJ5IGNoZWNrIGlzIGZhc3RlciB0aGFuIGNvbWJpbmUgdGhlbSAqLwotICAgICAgICAgICAgICAgIGlmIChiciA8IHBwX2gpICAgICAgICAgICAgICAgICAgLyogYm91bmRhcnkgOiBkb24ndCBkbyBpdCBvbiB0aGUgbG93ZXN0IHJvdyBibG9jayAqLwotICAgICAgICAgICAgICAgICAgICBmb3IgKGJjID0gbWJjOyBiYyA8IG1iYyArIDI7IGJjKyspCi0gICAgICAgICAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAgICAgICAgIC8qKioqKiogY2hlY2sgYm91bmRhcnkgZm9yIGRlYmxvY2tpbmcgKioqKioqKioqKioqLwotICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGJjIDwgcHBfdykgICAgICAgICAgICAgIC8qIGJvdW5kYXJ5IDogZG9uJ3QgZG8gaXQgb24gdGhlIG1vc3QgcmlnaHQgY29sIGJsb2NrICovCi0gICAgICAgICAgICAgICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgcHRyID0gcmVjICsgKGJyd2lkdGggPDwgNikgKyAoYmMgPDwgMyk7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgalZhbDAgPSBicndpZHRoICsgYmM7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGNocikgICAgUVAgPSBRUF9zdG9yZVtqVmFsMF07Ci0KLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBwdHJfZSA9IHB0ciArIDg7ICAgICAgICAvKiBwb2ludGVyIHRvIHdoZXJlIHRoZSBsb29wIGVuZHMgKi8KLQotICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICgoKHBwX21vZFtqVmFsMF0mMHgwMikpICYmICgocHBfbW9kW2pWYWwwLXBwX3ddJjB4MDIpKSkKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8qIEhvcml6IEhhcmQgZmlsdGVyICovCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRvCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGpWYWwwID0gKihwdHIgLSB3aWR0aCk7ICAgICAvKiBDICovCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBqVmFsMSA9ICpwdHI7ICAgICAgICAgICAgICAgLyogRCAqLwotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgalZhbDIgPSBqVmFsMSAtIGpWYWwwOwotCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoKChqVmFsMiA+IDApICYmIChqVmFsMiA8IChRUCA8PCAxKSkpCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHx8ICgoalZhbDIgPCAwKSAmJiAoalZhbDIgPiAtKFFQIDw8IDEpKSkpIC8qIChELUMpIGNvbXBhcmVkIHdpdGggMlFQICovCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLyogZGlmZmVyZW50aWF0ZSBiZXR3ZWVuIHJlYWwgYW5kIGZha2UgZWRnZSAqLwotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGpWYWwwID0gKChqVmFsMCArIGpWYWwxKSA+PiAxKTsgICAgIC8qIChEK0MpLzIgKi8KLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqKHB0ciAtIHdpZHRoKSA9ICh1aW50OCkoalZhbDApOyAgICAvKiAgQyAqLwotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICpwdHIgPSAodWludDgpKGpWYWwwKTsgICAgICAgICAgLyogIEQgKi8KLQotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGpWYWwwID0gKihwdHIgLSAod2lkdGggPDwgMSkpOyAgICAgIC8qIEIgKi8KLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBqVmFsMSA9ICoocHRyICsgd2lkdGgpOyAgICAgICAgIC8qIEUgKi8KLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBqVmFsMiA9IGpWYWwxIC0galZhbDA7ICAgICAgLyogRS1CICovCi0KLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoalZhbDIgPiAwKQotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgalZhbDAgKz0gKChqVmFsMiArIDMpID4+IDIpOwotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBqVmFsMSAtPSAoKGpWYWwyICsgMykgPj4gMik7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICoocHRyIC0gKHdpZHRoIDw8IDEpKSA9ICh1aW50OClqVmFsMDsgICAgICAgLyogIHN0b3JlIEIgKi8KLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKihwdHIgKyB3aWR0aCkgPSAodWludDgpalZhbDE7ICAgICAgICAgIC8qIHN0b3JlIEUgKi8KLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZWxzZSBpZiAoalZhbDIpCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgewotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBqVmFsMCAtPSAoKDMgLSBqVmFsMikgPj4gMik7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGpWYWwxICs9ICgoMyAtIGpWYWwyKSA+PiAyKTsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKihwdHIgLSAod2lkdGggPDwgMSkpID0gKHVpbnQ4KWpWYWwwOyAgICAgICAvKiAgc3RvcmUgQiAqLwotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqKHB0ciArIHdpZHRoKSA9ICh1aW50OClqVmFsMTsgICAgICAgICAgLyogc3RvcmUgRSAqLwotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGpWYWwwID0gKihwdHIgLSAod2lkdGggPDwgMSkgLSB3aWR0aCk7ICAvKiBBICovCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgalZhbDEgPSAqKHB0ciArICh3aWR0aCA8PCAxKSk7ICAgICAgLyogRiAqLwotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGpWYWwyID0galZhbDEgLSBqVmFsMDsgICAgICAgICAgICAgIC8qIChGLUEpICovCi0KLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoalZhbDIgPiAwKQotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgalZhbDAgKz0gKChqVmFsMiArIDcpID4+IDMpOwotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBqVmFsMSAtPSAoKGpWYWwyICsgNykgPj4gMyk7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICoocHRyIC0gKHdpZHRoIDw8IDEpIC0gd2lkdGgpID0gKHVpbnQ4KShqVmFsMCk7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICoocHRyICsgKHdpZHRoIDw8IDEpKSA9ICh1aW50OCkoalZhbDEpOwotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBlbHNlIGlmIChqVmFsMikKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGpWYWwwIC09ICgoNyAtIGpWYWwyKSA+PiAzKTsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgalZhbDEgKz0gKCg3IC0galZhbDIpID4+IDMpOwotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqKHB0ciAtICh3aWR0aCA8PCAxKSAtIHdpZHRoKSA9ICh1aW50OCkoalZhbDApOwotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqKHB0ciArICh3aWR0aCA8PCAxKSkgPSAodWludDgpKGpWYWwxKTsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9LyogYTNfMCA+IDJRUCAqLwotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHdoaWxlICgrK3B0ciA8IHB0cl9lKTsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgICAgICAgICAgICAgIH0vKiBib3VuZGFyeSBjaGVja2luZyovCi0gICAgICAgICAgICAgICAgICAgIH0vKmJjKi8KLSAgICAgICAgICAgIH0vKmJyKi8KLSAgICAgICAgICAgIGJyd2lkdGggLT0gKHBwX3cgPDwgMSk7Ci0gICAgICAgICAgICAvKioqKioqKioqKioqKioqKioqIFZlcnQuIEZpbHRlcmluZyAqKioqKioqKioqKioqKioqKioqKi8KLSAgICAgICAgICAgIGZvciAoYnIgPSBtYnI7IGJyIDwgbWJyICsgMjsgYnIrKykKLSAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICBpZiAoYnIgPCBwcF9oKQotICAgICAgICAgICAgICAgICAgICBmb3IgKGJjID0gbWJjICsgMTsgYmMgPCBtYmMgKyAzOyBiYysrKQotICAgICAgICAgICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgICAgICAgICAvKioqKioqIGNoZWNrIGJvdW5kYXJ5IGZvciBkZWJsb2NraW5nICoqKioqKioqKioqKi8KLSAgICAgICAgICAgICAgICAgICAgICAgIGlmIChiYyA8IHBwX3cpCi0gICAgICAgICAgICAgICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgcHRyID0gcmVjICsgKGJyd2lkdGggPDwgNikgKyAoYmMgPDwgMyk7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgalZhbDAgPSBicndpZHRoICsgYmM7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGNocikgICAgUVAgPSBRUF9zdG9yZVtqVmFsMF07Ci0KLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBwdHJfZSA9IHB0ciArICh3aWR0aCA8PCAzKTsKLQotICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICgoKHBwX21vZFtqVmFsMC0xXSYweDAxKSkgJiYgKChwcF9tb2RbalZhbDBdJjB4MDEpKSkKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8qIFZlcnQgSGFyZCBmaWx0ZXIgKi8KLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZG8KLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgewotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgalZhbDEgPSAqcHRyOyAgICAgICAvKiBEICovCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBqVmFsMCA9ICoocHRyIC0gMSk7IC8qIEMgKi8KLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGpWYWwyID0galZhbDEgLSBqVmFsMDsgIC8qIEQtQyAqLwotCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoKChqVmFsMiA+IDApICYmIChqVmFsMiA8IChRUCA8PCAxKSkpCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHx8ICgoalZhbDIgPCAwKSAmJiAoalZhbDIgPiAtKFFQIDw8IDEpKSkpCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgalZhbDEgPSAoalZhbDAgKyBqVmFsMSkgPj4gMTsgICAvKiAoQytEKS8yICovCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKnB0ciAgICAgICAgPSAgIGpWYWwxOwotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICoocHRyIC0gMSkgID0gICBqVmFsMTsKLQotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGpWYWwxID0gKihwdHIgKyAxKTsgICAgIC8qIEUgKi8KLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBqVmFsMCA9ICoocHRyIC0gMik7ICAgICAvKiBCICovCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgalZhbDIgPSBqVmFsMSAtIGpWYWwwOyAgICAgIC8qIEUtQiAqLwotCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGpWYWwyID4gMCkKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGpWYWwxIC09ICgoalZhbDIgKyAzKSA+PiAyKTsgICAgICAgIC8qIEUgPSBFIC0oRS1CKS80ICovCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGpWYWwwICs9ICgoalZhbDIgKyAzKSA+PiAyKTsgICAgICAgIC8qIEIgPSBCICsoRS1CKS80ICovCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICoocHRyICsgMSkgPSBqVmFsMTsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKihwdHIgLSAyKSA9IGpWYWwwOwotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBlbHNlIGlmIChqVmFsMikKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGpWYWwxICs9ICgoMyAtIGpWYWwyKSA+PiAyKTsgICAgICAgIC8qIEUgPSBFIC0oRS1CKS80ICovCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGpWYWwwIC09ICgoMyAtIGpWYWwyKSA+PiAyKTsgICAgICAgIC8qIEIgPSBCICsoRS1CKS80ICovCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICoocHRyICsgMSkgPSBqVmFsMTsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKihwdHIgLSAyKSA9IGpWYWwwOwotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGpWYWwxID0gKihwdHIgKyAyKTsgICAgIC8qIEYgKi8KLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBqVmFsMCA9ICoocHRyIC0gMyk7ICAgICAvKiBBICovCi0KLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBqVmFsMiA9IGpWYWwxIC0galZhbDA7ICAgICAgICAgIC8qIChGLUEpICovCi0KLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoalZhbDIgPiAwKQotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgalZhbDEgLT0gKChqVmFsMiArIDcpID4+IDMpOyAgICAvKiBGIC09IChGLUEpLzggKi8KLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgalZhbDAgKz0gKChqVmFsMiArIDcpID4+IDMpOyAgICAvKiBBICs9IChGLUEpLzggKi8KLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKihwdHIgKyAyKSA9IGpWYWwxOwotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqKHB0ciAtIDMpID0galZhbDA7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGVsc2UgaWYgKGpWYWwyKQotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgalZhbDEgLT0gKChqVmFsMiAtIDcpID4+IDMpOyAgICAvKiBGIC09IChGLUEpLzggKi8KLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgalZhbDAgKz0gKChqVmFsMiAtIDcpID4+IDMpOyAgICAvKiBBICs9IChGLUEpLzggKi8KLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKihwdHIgKyAyKSA9IGpWYWwxOwotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqKHB0ciAtIDMpID0galZhbDA7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSAgIC8qIGVuZCBvZiB2ZXIgaGFyZCBmaWxldGVyaW5nICovCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgd2hpbGUgKChwdHIgKz0gd2lkdGgpIDwgcHRyX2UpOwotICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgICAgICAgICAgICAgfSAvKiBib3VuZGFyeSovCi0gICAgICAgICAgICAgICAgICAgIH0gLypiYyovCi0gICAgICAgICAgICAgICAgYnJ3aWR0aCArPSBwcF93OwotICAgICAgICAgICAgfS8qYnIqLwotICAgICAgICAgICAgYnJ3aWR0aCAtPSAocHBfdyA8PCAxK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Ci0gICAgcHBfdyA9ICh3aWR0aCA+PiAzKTsKLSAgICBwcF9oID0gKGhlaWdodCA+PiAzKTsKLQotICAgIC8qIFNldCB1cCB2YXJpb3VzIHZhbHVlcyBuZWVkZWQgZm9yIHVwZGF0aW5nIHBvaW50ZXJzIGludG8gcmVjICovCi0gICAgdzEgPSB3aWR0aDsgICAgICAgICAgICAgLyogT2Zmc2V0IHRvIG5leHQgcm93IGluIHBpeGVscyAqLwotICAgIHcyID0gd2lkdGggPDwgMTsgICAgICAgIC8qIE9mZnNldCB0byB0d28gcm93cyBpbiBwaXhlbHMgKi8KLSAgICB3MyA9IHcxICsgdzI7ICAgICAgICAgICAvKiBPZmZzZXQgdG8gdGhyZWUgcm93cyBpbiBwaXhlbHMgKi8KLSAgICB3NCA9IHcyIDw8IDE7ICAgICAgICAgICAvKiBPZmZzZXQgdG8gZm91ciByb3dzIGluIHBpeGVscyAqLwotICAgIGluY3IgPSB3aWR0aCAtIEJMS1NJWkU7IC8qIE9mZnNldCB0byBuZXh0IHJvdyBhZnRlciBwcm9jZXNzaW5nIGJsb2NrICovCi0KLSAgICAvKiBXb3JrIHRocm91Z2ggdGhlIGFyZWEgaG9ydGl6b250YWxseSBieSB0d28gcm93cyBwZXIgc3RlcCAqLwotICAgIGZvciAobWJyID0gMDsgbWJyIDwgcHBfaDsgbWJyICs9IDIpCi0gICAgewotICAgICAgICAvKiBicndpZHRoIGNvbnRhaW5zIHRoZSBibG9jayBudW1iZXIgb2YgdGhlIGxlZnRtb3N0IGJsb2NrCi0gICAgICAgICAqIG9mIHRoZSBjdXJyZW50IHJvdyAqLwotICAgICAgICBicndpZHRoID0gbWJyICogcHBfdzsKLQotICAgICAgICAvKiBXb3JrIHRocm91Z2ggdGhlIGFyZWEgdmVydGljYWxseSBieSB0d28gY29sdW1ucyBwZXIgc3RlcCAqLwotICAgICAgICBmb3IgKG1iYyA9IDA7IG1iYyA8IHBwX3c7IG1iYyArPSAyKQotICAgICAgICB7Ci0gICAgICAgICAgICAvKiBpZiB0aGUgZGF0YSBpcyBsdW1pbmFuY2UgaW5mbywgZ2V0IHRoZSBjb3JyZWN0Ci0gICAgICAgICAgICAgICAgICAgICogcXVhbnRpemF0aW9uIHBhcmFtZW50ZXIuIE9uZSBwYXJhbWV0ZXIgcGVyIG1hY3JvYmxvY2sgKi8KLSAgICAgICAgICAgIGlmICghY2hyKQotICAgICAgICAgICAgewotICAgICAgICAgICAgICAgIC8qIGJyd2lkdGgvNCBpcyB0aGUgbWFjcm9ibG9jayBudW1iZXIgYW5kIG1iYy8yIGlzIHRoZSBtYWNyb2Jsb2NrIGNvbCBudW1iZXIqLwotICAgICAgICAgICAgICAgIFFQID0gUVBfc3RvcmVbKGJyd2lkdGg+PjIpICsgKG1iYz4+MSldOwotICAgICAgICAgICAgfQotCi0gICAgICAgICAgICAvKioqKioqKioqKioqKioqKioqIEhvcml6LiBGaWx0ZXJpbmcgKioqKioqKioqKioqKioqKioqKiovCi0gICAgICAgICAgICAvKiBQcm9jZXNzIGZvdXIgYmxvY2tzIGZvciB0aGUgZmlsdGVyaW5nICAgICAgICAqLwotICAgICAgICAgICAgLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotICAgICAgICAgICAgLyogTG9vcCBvdmVyIHR3byByb3dzIG9mIGJsb2NrcyAqLwotICAgICAgICAgICAgZm9yIChiciA9IG1iciArIDE7IGJyIDwgbWJyICsgMzsgYnIrKykgICAgLyogYnIgaXMgdGhlIHJvdyBjb3VudGVyIGluIGJsb2NrcyAqLwotICAgICAgICAgICAgewotICAgICAgICAgICAgICAgIC8qIFNldCBicndpZHRoIHRvIHRoZSBmaXJzdCAobGVmdG1vc3QpIGJsb2NrIG51bWJlciBvZiB0aGUgbmV4dCByb3cgKi8KLSAgICAgICAgICAgICAgICAvKiBicndpZHRoIGlzIHVzZWQgYXMgYW4gaW5kZXggd2hlbiBjb3VudGluZyBibG9ja3MgKi8KLSAgICAgICAgICAgICAgICBicndpZHRoICs9IHBwX3c7Ci0KLSAgICAgICAgICAgICAgICAvKiBMb29wIG92ZXIgdHdvIGNvbHVtbnMgb2YgYmxvY2tzIGluIHRoZSByb3cgKi8KLSAgICAgICAgICAgICAgICBmb3IgKGJjID0gbWJjOyBiYyA8IG1iYyArIDI7IGJjKyspICAgIC8qIGJjIGlzIHRoZSBjb2x1bW4gY291bnRlciBpbiBibG9ja3MgKi8KLSAgICAgICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgICAgIC8qKioqKiogY2hlY2sgYm91bmRhcnkgZm9yIGRlYmxvY2tpbmcgKioqKioqKioqKioqLwotICAgICAgICAgICAgICAgICAgICAvKiBFeGVjdXRlIGlmIHRoZSByb3cgYW5kIGNvbHVtbiBjb3VudGVycyBhcmUgd2l0aGluIHRoZSBhcmVhICovCi0gICAgICAgICAgICAgICAgICAgIGlmIChiciA8IHBwX2ggJiYgYmMgPCBwcF93KQotICAgICAgICAgICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgICAgICAgICAvKiBTZXQgdGhlIHB0ciB0byB0aGUgZmlyc3QgcGl4ZWwgb2YgdGhlIGZpcnN0IGJsb2NrIG9mIHRoZSBzZWNvbmQgcm93Ci0gICAgICAgICAgICAgICAgICAgICAgICAqIGJyd2lkdGggKiA2NCBpcyB0aGUgcGl4ZWwgcm93IG9mZnNldAotICAgICAgICAgICAgICAgICAgICAgICAgKiBiYyAqIDggaXMgdGhlIHBpeGVsIGNvbHVtbiBvZmZzZXQgKi8KLSAgICAgICAgICAgICAgICAgICAgICAgIHB0ciA9IHJlYyArIChicndpZHRoIDw8IDYpICsgKGJjIDw8IDMpOwotCi0gICAgICAgICAgICAgICAgICAgICAgICAvKiBTZXQgdGhlIGluZGV4IHRvIHRoZSBjdXJyZW50IGJsb2NrIG9mIHRoZSBzZWNvbmQgcm93IGNvdW50aW5nIGluIGJsb2NrcyAqLwotICAgICAgICAgICAgICAgICAgICAgICAgaW5kZXggPSBicndpZHRoICsgYmM7Ci0KLSAgICAgICAgICAgICAgICAgICAgICAgIC8qIGlmIHRoZSBkYXRhIGlzIGNocm9taW5hbmNlIGluZm8sIGdldCB0aGUgY29ycmVjdAotICAgICAgICAgICAgICAgICAgICAgICAgICogcXVhbnRpemF0aW9uIHBhcmFtZW50ZXIuIE9uZSBwYXJhbWV0ZXIgcGVyIGJsb2NrLiAqLwotICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGNocikKLSAgICAgICAgICAgICAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBRUCA9IFFQX3N0b3JlW2luZGV4XTsKLSAgICAgICAgICAgICAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgICAgICAgICAgICAgLyogRXhlY3V0ZSBoYXJkIGhvcml6b250YWwgZmlsdGVyIGlmIHNlbWFwaG9yZSBmb3IgaG9yaXpvbnRhbCBkZWJsb2NraW5nCi0gICAgICAgICAgICAgICAgICAgICAgICAgICogaXMgc2V0IGZvciB0aGUgY3VycmVudCBibG9jayBhbmQgYmxvY2sgaW1tZWRpYXRlbHkgYWJvdmUgaXQgKi8KLSAgICAgICAgICAgICAgICAgICAgICAgIGlmICgoKHBwX21vZFtpbmRleF0mMHgwMikgIT0gMCkgJiYgKChwcF9tb2RbaW5kZXgtcHBfd10mMHgwMikgIT0gMCkpCi0gICAgICAgICAgICAgICAgICAgICAgICB7ICAgLyogSGFyZCBmaWx0ZXIgKi8KLQotICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8qIFNldCBIb3J6SGZsYWcgKGJpdCA0KSBpbiB0aGUgcHBfbW9kIGxvY2F0aW9uICovCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgcHBfbW9kW2luZGV4LXBwX3ddIHw9IDB4MTA7IC8qICA0LzI2LzAwIHJldXNlIHBwX21vZCBmb3IgSG9yekhmbGFnKi8KLQotICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8qIEZpbHRlciBhY3Jvc3MgdGhlIDggcGl4ZWxzIG9mIHRoZSBibG9jayAqLwotICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZvciAoaW5kZXggPSBCTEtTSVpFOyBpbmRleCA+IDA7IGluZGV4LS0pCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgewotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvKiBEaWZmZXJlbmNlIGJldHdlZW4gdGhlIGN1cnJlbnQgcGl4ZWwgYW5kIHRoZSBwaXhlbCBhYm92ZSBpdCAqLwotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBhM18wID0gKnB0ciAtICoocHRyIC0gdzEpOwotCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8qIGlmIHRoZSBtYWduaXR1ZGUgb2YgdGhlIGRpZmZlcmVuY2UgaXMgZ3JlYXRlciB0aGFuIHRoZSBLVGhIIHRocmVzaG9sZAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKiBhbmQgd2l0aGluIHRoZSBxdWFudGl6YXRpb24gcGFyYW1ldGVyLCBhcHBseSBoYXJkIGZpbHRlciAqLwotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoKGEzXzAgPiBLVGhIIHx8IGEzXzAgPCAtS1RoSCkgJiYgYTNfMDxRUCAmJiBhM18wPiAtUVApCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHB0cl9jID0gcHRyIC0gdzM7ICAgLyogUG9pbnRzIHRvIHBpeGVsIHRocmVlIHJvd3MgYWJvdmUgKi8KLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHB0cl9uID0gcHRyICsgdzE7ICAgLyogUG9pbnRzIHRvIHBpeGVsIG9uZSByb3cgYmVsb3cgKi8KLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZbMF0gPSAoaW50KSgqKHB0cl9jIC0gdzMpKTsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZbMV0gPSAoaW50KSgqKHB0cl9jIC0gdzIpKTsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZbMl0gPSAoaW50KSgqKHB0cl9jIC0gdzEpKTsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZbM10gPSAoaW50KSgqcHRyX2MpOwotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdls0XSA9IChpbnQpKCoocHRyX2MgKyB3MSkpOwotCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzdW0gPSB2WzBdCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICArIHZbMV0KLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICsgdlsyXQotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKyAqcHRyX2MKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICsgdls0XQotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKyAoKihwdHJfYyArIHcyKSkKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICsgKCoocHRyX2MgKyB3MykpOyAgLyogQ3VycmVudCBwaXhlbCAqLwotCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBkZWx0YSA9IChzdW0gKyAqcHRyX2MgKyA0KSA+PiAzOyAgIC8qIEF2ZXJhZ2UgcGl4ZWwgdmFsdWVzIHdpdGggcm91bmRpbmcgKi8KLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICoocHRyX2MpID0gKHVpbnQ4KSBkZWx0YTsKLQotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLyogTW92ZSBwb2ludGVyIGRvd24gb25lIHJvdyBvZiBwaXhlbHMgKHBvaW50cyB0byBwaXhlbCB0d28gcm93cwotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICogYWJvdmUgY3VycmVudCBwaXhlbCkgKi8KLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHB0cl9jICs9IHcxOwotCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBmb3IgKGNvdW50ZXIgPSAwOyBjb3VudGVyIDwgNTsgY291bnRlcisrKQotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgewotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8qIFN1YnRyYWN0IG9mZiBoaWdoZXN0IHBpeGVsIGFuZCBhZGQgaW4gcGl4ZWwgYmVsb3cgKi8KLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzdW0gPSBzdW0gLSB2W2NvdW50ZXJdICsgKnB0cl9uOwotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8qIEF2ZXJhZ2UgdGhlIHBpeGVsIHZhbHVlcyB3aXRoIHJvdW5kaW5nICovCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZGVsdGEgPSAoc3VtICsgKnB0cl9jICsgNCkgPj4gMzsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqcHRyX2MgPSAodWludDgpKGRlbHRhKTsKLQotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8qIEluY3JlbWVudCBwb2ludGVycyB0byBuZXh0IHBpeGVsIHJvdyAqLwotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHB0cl9jICs9IHcxOwotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHB0cl9uICs9IHcxOwotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8qIEluY3JlbWVudCBwb2ludGVyIHRvIG5leHQgcGl4ZWwgKi8KLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKytwdHI7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgfSAvKiBpbmRleCovCi0gICAgICAgICAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgICAgICAgICBlbHNlCi0gICAgICAgICAgICAgICAgICAgICAgICB7IC8qIHNvZnQgZmlsdGVyKi8KLQotICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8qIENsZWFyIEhvcnpIZmxhZyAoYml0IDQpIGluIHRoZSBwcF9tb2QgbG9jYXRpb24gKi8KLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBwcF9tb2RbaW5kZXgtcHBfd10gJj0gMHhlZjsgLyogcmVzZXQgMTExMCwxMTExICovCi0KLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBmb3IgKGluZGV4ID0gQkxLU0laRTsgaW5kZXggPiAwOyBpbmRleC0tKQotICAgICAgICAgICAgICAgICAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLyogRGlmZmVyZW5jZSBiZXR3ZWVuIHRoZSBjdXJyZW50IHBpeGVsIGFuZCB0aGUgcGl4ZWwgYWJvdmUgaXQgKi8KLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYTNfMCA9ICoocHRyKSAtICoocHRyIC0gdzEpOwotCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8qIGlmIHRoZSBtYWduaXR1ZGUgb2YgdGhlIGRpZmZlcmVuY2UgaXMgZ3JlYXRlciB0aGFuIHRoZSBLVGggdGhyZXNob2xkLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKiBhcHBseSBzb2Z0IGZpbHRlciAqLwotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoKGEzXzAgPiBLVGggfHwgYTNfMCA8IC1LVGgpKQotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB7Ci0KLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8qIFN1bSBvZiB3ZWlnaHRlZCBkaWZmZXJlbmNlcyAqLwotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYTNfMCArPSAoKCoocHRyIC0gdzIpIC0gKihwdHIgKyB3MSkpIDw8IDEpICsgKGEzXzAgPDwgMik7Ci0KLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8qIENoZWNrIGlmIHN1bSBpcyBsZXNzIHRoYW4gdGhlIHF1YW50aXphdGlvbiBwYXJhbWV0ZXIgKi8KLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChQVl9BQlMoYTNfMCkgPCAoUVAgPDwgMykpCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYTNfMSA9ICoocHRyIC0gdzIpIC0gKihwdHIgLSB3Myk7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYTNfMSArPSAoKCoocHRyIC0gdzQpIC0gKihwdHIgLSB3MSkpIDw8IDEpICsgKGEzXzEgPDwgMik7Ci0KLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBhM18yICA9ICoocHRyICsgdzIpIC0gKihwdHIgKyB3MSk7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYTNfMiArPSAoKCoocHRyKSAtICoocHRyICsgdzMpKSA8PCAxKSArIChhM18yIDw8IDIpOwotCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgQTNfMCA9IFBWX0FCUyhhM18wKSAtIFBWX01JTihQVl9BQlMoYTNfMSksIFBWX0FCUyhhM18yKSk7Ci0KLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoQTNfMCA+IDApCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgewotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBBM18wICs9IEEzXzAgPDwgMjsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgQTNfMCA9IChBM18wICsgMzIpID4+IDY7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChhM18wID4gMCkKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgewotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgQTNfMCA9IC1BM18wOwotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZGVsdGEgPSAoKihwdHIgLSB3MSkgLSAqKHB0cikpID4+IDE7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChkZWx0YSA+PSAwKQotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoZGVsdGEgPj0gQTNfMCkKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBkZWx0YSA9IFBWX01BWChBM18wLCAwKTsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBlbHNlCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChBM18wID4gMCkKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBkZWx0YSA9IDA7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBlbHNlCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZGVsdGEgPSBQVl9NQVgoQTNfMCwgZGVsdGEpOwotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKihwdHIgLSB3MSkgPSAodWludDgpKCoocHRyIC0gdzEpIC0gZGVsdGEpOwotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqKHB0cikgPSAodWludDgpKCoocHRyKSArIGRlbHRhKTsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9IC8qdGhyZXNob2xkKi8KLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvKiBJbmNyZW1lbnQgcG9pbnRlciB0byBuZXh0IHBpeGVsICovCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICsrcHRyOwotICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0gLyppbmRleCovCi0gICAgICAgICAgICAgICAgICAgICAgICB9IC8qIFNvZnQgZmlsdGVyKi8KLSAgICAgICAgICAgICAgICAgICAgfS8qIGJvdW5kYXJ5IGNoZWNraW5nKi8KLSAgICAgICAgICAgICAgICB9LypiYyovCi0gICAgICAgICAgICB9LypiciovCi0gICAgICAgICAgICBicndpZHRoIC09IChwcF93IDw8IDEpOwotCi0KLSAgICAgICAgICAgIC8qKioqKioqKioqKioqKioqKiogVmVydC4gRmlsdGVyaW5nICoqKioqKioqKioqKioqKioqKioqKi8KLSAgICAgICAgICAgIC8qIFByb2Nlc3MgZm91ciBibG9ja3MgZm9yIHRoZSBmaWx0ZXJpbmcgICAgICAgICovCi0gICAgICAgICAgICAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0gICAgICAgICAgICAvKiBMb29wIG92ZXIgdHdvIHJvd3Mgb2YgYmxvY2tzICovCi0gICAgICAgICAgICBmb3IgKGJyID0gbWJyOyBiciA8IG1iciArIDI7IGJyKyspICAgICAgLyogYnIgaXMgdGhlIHJvdyBjb3VudGVyIGluIGJsb2NrcyAqLwotICAgICAgICAgICAgewotICAgICAgICAgICAgICAgIGZvciAoYmMgPSBtYmMgKyAxOyBiYyA8IG1iYyArIDM7IGJjKyspICAvKiBiYyBpcyB0aGUgY29sdW1uIGNvdW50ZXIgaW4gYmxvY2tzICovCi0gICAgICAgICAgICAgICAgewotICAgICAgICAgICAgICAgICAgICAvKioqKioqIGNoZWNrIGJvdW5kYXJ5IGZvciBkZWJsb2NraW5nICoqKioqKioqKioqKi8KLSAgICAgICAgICAgICAgICAgICAgLyogRXhlY3V0ZSBpZiB0aGUgcm93IGFuZCBjb2x1bW4gY291bnRlcnMgYXJlIHdpdGhpbiB0aGUgYXJlYSAqLwotICAgICAgICAgICAgICAgICAgICBpZiAoYnIgPCBwcF9oICYmIGJjIDwgcHBfdykKLSAgICAgICAgICAgICAgICAgICAgewotICAgICAgICAgICAgICAgICAgICAgICAgLyogU2V0IHRoZSBwdHIgdG8gdGhlIGZpcnN0IHBpeGVsIG9mIHRoZSBmaXJzdCBibG9jayBvZiB0aGUgc2Vjb25kIHJvdwotICAgICAgICAgICAgICAgICAgICAgICAgKiBicndpZHRoICogNjQgaXMgdGhlIHBpeGVsIHJvdyBvZmZzZXQKLSAgICAgICAgICAgICAgICAgICAgICAgICogYmMgKiA4IGlzIHRoZSBwaXhlbCBjb2x1bW4gb2Zmc2V0ICovCi0gICAgICAgICAgICAgICAgICAgICAgICBwdHIgPSByZWMgKyAoYnJ3aWR0aCA8PCA2KSArIChiYyA8PCAzKTsKLQotICAgICAgICAgICAgICAgICAgICAgICAgLyogU2V0IHRoZSBpbmRleCB0byB0aGUgY3VycmVudCBibG9jayBvZiB0aGUgc2Vjb25kIHJvdyBjb3VudGluZyBpbiBibG9ja3MgKi8KLSAgICAgICAgICAgICAgICAgICAgICAgIGluZGV4ID0gYnJ3aWR0aCArIGJjOwotCi0gICAgICAgICAgICAgICAgICAgICAgICAvKiBpZiB0aGUgZGF0YSBpcyBjaHJvbWluYW5jZSBpbmZvLCBnZXQgdGhlIGNvcnJlY3QKLSAgICAgICAgICAgICAgICAgICAgICAgICAqIHF1YW50aXphdGlvbiBwYXJhbWVudGVyLiBPbmUgcGFyYW1ldGVyIHBlciBibG9jay4gKi8KLSAgICAgICAgICAgICAgICAgICAgICAgIGlmIChjaHIpCi0gICAgICAgICAgICAgICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgUVAgPSBRUF9zdG9yZVtpbmRleF07Ci0gICAgICAgICAgICAgICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgICAgICAgICAgICAgIC8qIEV4ZWN1dGUgaGFyZCB2ZXJ0aWNhbCBmaWx0ZXIgaWYgc2VtYXBob3JlIGZvciB2ZXJ0aWNhbCBkZWJsb2NraW5nCi0gICAgICAgICAgICAgICAgICAgICAgICAgICogaXMgc2V0IGZvciB0aGUgY3VycmVudCBibG9jayBhbmQgYmxvY2sgaW1tZWRpYXRlbHkgbGVmdCBvZiBpdCAqLwotICAgICAgICAgICAgICAgICAgICAgICAgaWYgKCgocHBfbW9kW2luZGV4LTFdJjB4MDEpICE9IDApICYmICgocHBfbW9kW2luZGV4XSYweDAxKSAhPSAwKSkKLSAgICAgICAgICAgICAgICAgICAgICAgIHsgICAvKiBIYXJkIGZpbHRlciAqLwotCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgLyogU2V0IFZlcnRIZmxhZyAoYml0IDUpIGluIHRoZSBwcF9tb2QgbG9jYXRpb24gb2YgcHJldmlvdXMgYmxvY2sqLwotICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBwX21vZFtpbmRleC0xXSB8PSAweDIwOyAvKiAgNC8yNi8wMCByZXVzZSBwcF9tb2QgZm9yIFZlcnRIZmxhZyovCi0KLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAvKiBGaWx0ZXIgYWNyb3NzIHRoZSA4IHBpeGVscyBvZiB0aGUgYmxvY2sgKi8KLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBmb3IgKGluZGV4ID0gQkxLU0laRTsgaW5kZXggPiAwOyBpbmRleC0tKQotICAgICAgICAgICAgICAgICAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLyogRGlmZmVyZW5jZSBiZXR3ZWVuIHRoZSBjdXJyZW50IHBpeGVsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICogYW5kIHRoZSBwaXhlbCB0byBsZWZ0IG9mIGl0ICovCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGEzXzAgPSAqcHRyIC0gKihwdHIgLSAxKTsKLQotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvKiBpZiB0aGUgbWFnbml0dWRlIG9mIHRoZSBkaWZmZXJlbmNlIGlzIGdyZWF0ZXIgdGhhbiB0aGUgS1RoSCB0aHJlc2hvbGQKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICogYW5kIHdpdGhpbiB0aGUgcXVhbnRpemF0aW9uIHBhcmFtZXRlciwgYXBwbHkgaGFyZCBmaWx0ZXIgKi8KLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKChhM18wID4gS1RoSCB8fCBhM18wIDwgLUtUaEgpICYmIGEzXzA8UVAgJiYgYTNfMD4gLVFQKQotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwdHJfYyA9IHB0ciAtIDM7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwdHJfbiA9IHB0ciArIDE7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2WzBdID0gKGludCkoKihwdHJfYyAtIDMpKTsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZbMV0gPSAoaW50KSgqKHB0cl9jIC0gMikpOwotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdlsyXSA9IChpbnQpKCoocHRyX2MgLSAxKSk7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2WzNdID0gKGludCkoKnB0cl9jKTsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZbNF0gPSAoaW50KSgqKHB0cl9jICsgMSkpOwotCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzdW0gPSB2WzBdCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICArIHZbMV0KLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICsgdlsyXQotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKyAqcHRyX2MKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICsgdls0XQotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKyAoKihwdHJfYyArIDIpKQotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKyAoKihwdHJfYyArIDMpKTsKLQotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZGVsdGEgPSAoc3VtICsgKnB0cl9jICsgNCkgPj4gMzsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICoocHRyX2MpID0gKHVpbnQ4KSBkZWx0YTsKLQotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLyogTW92ZSBwb2ludGVyIGRvd24gb25lIHBpeGVsIHRvIHRoZSByaWdodCAqLwotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcHRyX2MgKz0gMTsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZvciAoY291bnRlciA9IDA7IGNvdW50ZXIgPCA1OyBjb3VudGVyKyspCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLyogU3VidHJhY3Qgb2ZmIGhpZ2hlc3QgcGl4ZWwgYW5kIGFkZCBpbiBwaXhlbCBiZWxvdyAqLwotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHN1bSA9IHN1bSAtIHZbY291bnRlcl0gKyAqcHRyX247Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLyogQXZlcmFnZSB0aGUgcGl4ZWwgdmFsdWVzIHdpdGggcm91bmRpbmcgKi8KLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBkZWx0YSA9IChzdW0gKyAqcHRyX2MgKyA0KSA+PiAzOwotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICpwdHJfYyA9ICh1aW50OCkoZGVsdGEpOwotCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLyogSW5jcmVtZW50IHBvaW50ZXJzIHRvIG5leHQgcGl4ZWwgKi8KLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwdHJfYyArPSAxOwotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHB0cl9uICs9IDE7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLyogSW5jcmVtZW50IHBvaW50ZXJzIHRvIG5leHQgcGl4ZWwgcm93ICovCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHB0ciArPSB3MTsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICB9IC8qIGluZGV4Ki8KLSAgICAgICAgICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICAgICAgICAgIGVsc2UKLSAgICAgICAgICAgICAgICAgICAgICAgIHsgLyogc29mdCBmaWx0ZXIqLwotCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgLyogQ2xlYXIgVmVydEhmbGFnIChiaXQgNSkgaW4gdGhlIHBwX21vZCBsb2NhdGlvbiAqLwotICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBwX21vZFtpbmRleC0xXSAmPSAweGRmOyAvKiByZXNldCAxMTAxLDExMTEgKi8KLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBmb3IgKGluZGV4ID0gQkxLU0laRTsgaW5kZXggPiAwOyBpbmRleC0tKQotICAgICAgICAgICAgICAgICAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLyogRGlmZmVyZW5jZSBiZXR3ZWVuIHRoZSBjdXJyZW50IHBpeGVsIGFuZCB0aGUgcGl4ZWwgYWJvdmUgaXQgKi8KLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYTNfMCA9ICoocHRyKSAtICoocHRyIC0gMSk7Ci0KLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLyogaWYgdGhlIG1hZ25pdHVkZSBvZiB0aGUgZGlmZmVyZW5jZSBpcyBncmVhdGVyIHRoYW4gdGhlIEtUaCB0aHJlc2hvbGQsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqIGFwcGx5IHNvZnQgZmlsdGVyICovCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICgoYTNfMCA+IEtUaCB8fCBhM18wIDwgLUtUaCkpCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHsKLQotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLyogU3VtIG9mIHdlaWdodGVkIGRpZmZlcmVuY2VzICovCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBhM18wICs9ICgoKihwdHIgLSAyKSAtICoocHRyICsgMSkpIDw8IDEpICsgKGEzXzAgPDwgMik7Ci0KLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8qIENoZWNrIGlmIHN1bSBpcyBsZXNzIHRoYW4gdGhlIHF1YW50aXphdGlvbiBwYXJhbWV0ZXIgKi8KLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChQVl9BQlMoYTNfMCkgPCAoUVAgPDwgMykpCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYTNfMSA9ICoocHRyIC0gMikgLSAqKHB0ciAtIDMpOwotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGEzXzEgKz0gKCgqKHB0ciAtIDQpIC0gKihwdHIgLSAxKSkgPDwgMSkgKyAoYTNfMSA8PCAyKTsKLQotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGEzXzIgID0gKihwdHIgKyAyKSAtICoocHRyICsgMSk7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYTNfMiArPSAoKCoocHRyKSAtICoocHRyICsgMykpIDw8IDEpICsgKGEzXzIgPDwgMik7Ci0KLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBBM18wID0gUFZfQUJTKGEzXzApIC0gUFZfTUlOKFBWX0FCUyhhM18xKSwgUFZfQUJTKGEzXzIpKTsKLQotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChBM18wID4gMCkKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEEzXzAgKz0gQTNfMCA8PCAyOwotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBBM18wID0gKEEzXzAgKyAzMikgPj4gNjsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGEzXzAgPiAwKQotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBBM18wID0gLUEzXzA7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBkZWx0YSA9ICgqKHB0ciAtIDEpIC0gKihwdHIpKSA+PiAxOwotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoZGVsdGEgPj0gMCkKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgewotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGRlbHRhID49IEEzXzApCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZGVsdGEgPSBQVl9NQVgoQTNfMCwgMCk7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZWxzZQotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoQTNfMCA+IDApCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZGVsdGEgPSAwOwotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZWxzZQotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgewotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRlbHRhID0gUFZfTUFYKEEzXzAsIGRlbHRhKTsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQotCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICoocHRyIC0gMSkgPSAodWludDgpKCoocHRyIC0gMSkgLSBkZWx0YSk7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICoocHRyKSA9ICh1aW50OCkoKihwdHIpICsgZGVsdGEpOwotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0gLyp0aHJlc2hvbGQqLwotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHB0ciArPSB3MTsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICB9IC8qaW5kZXgqLwotICAgICAgICAgICAgICAgICAgICAgICAgfSAvKiBTb2Z0IGZpbHRlciovCi0gICAgICAgICAgICAgICAgICAgIH0gLyogYm91bmRhcnkqLwotICAgICAgICAgICAgICAgIH0gLypiYyovCi0gICAgICAgICAgICAgICAgLyogSW5jcmVtZW50IHBvaW50ZXIgdG8gbmV4dCByb3cgb2YgcGl4ZWxzICovCi0gICAgICAgICAgICAgICAgYnJ3aWR0aCArPSBwcF93OwotICAgICAgICAgICAgfS8qYnIqLwotICAgICAgICAgICAgYnJ3aWR0aCAtPSAocHBfdyA8PCAxKTsKLQotICAgICAgICAgICAgLyoqKioqKioqKioqKioqKioqKiBEZXJpbmdpbmcgKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotICAgICAgICAgICAgLyogUHJvY2VzcyBmb3VyIGJsb2NrcyBmb3IgdGhlIGZpbHRlcmluZyAgICAgICAgKi8KLSAgICAgICAgICAgIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLSAgICAgICAgICAgIC8qIExvb3Agb3ZlciB0d28gcm93cyBvZiBibG9ja3MgKi8KLSAgICAgICAgICAgIGZvciAoYnIgPSBtYnI7IGJyIDwgbWJyICsgMjsgYnIrKykKLSAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAvKiBMb29wIG92ZXIgdHdvIGNvbHVtbnMgb2YgYmxvY2tzIGluIHRoZSByb3cgKi8KLSAgICAgICAgICAgICAgICBmb3IgKGJjID0gbWJjOyBiYyA8IG1iYyArIDI7IGJjKyspCi0gICAgICAgICAgICAgICAgewotICAgICAgICAgICAgICAgICAgICAvKiBFeGVjdXRlIGlmIHRoZSByb3cgYW5kIGNvbHVtbiBjb3VudGVycyBhcmUgd2l0aGluIHRoZSBhcmVhICovCi0gICAgICAgICAgICAgICAgICAgIGlmIChiciA8IHBwX2ggJiYgYmMgPCBwcF93KQotICAgICAgICAgICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgICAgICAgICAvKiBTZXQgdGhlIGluZGV4IHRvIHRoZSBjdXJyZW50IGJsb2NrICovCi0gICAgICAgICAgICAgICAgICAgICAgICBpbmRleCA9IGJyd2lkdGggKyBiYzsKLQotICAgICAgICAgICAgICAgICAgICAgICAgLyogRXhlY3V0ZSBkZXJpbmdpbmcgaWYgc2VtYXBob3JlIGZvciBkZXJpbmdpbmcgKGJpdC0zIG9mIHBwX21vZCkKLSAgICAgICAgICAgICAgICAgICAgICAgICAqIGlzIHNldCBmb3IgdGhlIGN1cnJlbnQgYmxvY2sgKi8KLSAgICAgICAgICAgICAgICAgICAgICAgIGlmICgocHBfbW9kW2luZGV4XSYweDA0KSAhPSAwKQotICAgICAgICAgICAgICAgICAgICAgICAgewotICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8qIERvbid0IHByb2Nlc3MgZGVyaW5naW5nIGlmIG9uIGFuIGVkZ2UgYmxvY2sgKi8KLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoYnIgPiAwICYmIGJjID4gMCAmJiBiciA8IHBwX2ggLSAxICYmIGJjIDwgcHBfdyAtIDEpCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgewotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvKiBjbnRoZmxhZyA9IHdlaWdodGVkIGF2ZXJhZ2Ugb2YgSG9yekhmbGFnIG9mIGN1cnJlbnQsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqIG9uZSBhYm92ZSwgcHJldmlvdXMgYmxvY2tzKi8KLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY250aGZsYWcgPSAoKHBwX21vZFtpbmRleF0gJiAweDEwKSArCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChwcF9tb2RbaW5kZXgtcHBfd10gJiAweDEwKSArCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICgocHBfbW9kW2luZGV4LTFdID4+IDEpICYgMHgxMCkgKwotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoKHBwX21vZFtpbmRleF0gPj4gMSkgJiAweDEwKSkgPj4gNDsgLyogNC8yNi8wMCovCi0KLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLyogRG8gdGhlIGRlcmluZ2luZyBpZiBkZWNpc2lvbiBmbGFncyBpbmRpY2F0ZSBpdCdzIG5lY2Vzc2FyeSAqLwotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoY250aGZsYWcgPCAzKQotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvKiBpZiB0aGUgZGF0YSBpcyBjaHJvbWluYW5jZSBpbmZvLCBnZXQgdGhlIGNvcnJlY3QKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqIHF1YW50aXphdGlvbiBwYXJhbWVudGVyLiBPbmUgcGFyYW1ldGVyIHBlciBibG9jay4gKi8KLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChjaHIpCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgUVAgPSBRUF9zdG9yZVtpbmRleF07Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8qIFNldCBhbW91bnQgdG8gY2hhbmdlIGx1bWluYW5jZSBpZiBpdCBuZWVkcyB0byBiZSBjaGFuZ2VkCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKiBiYXNlZCBvbiBxdWFudGl6YXRpb24gcGFyYW1ldGVyICovCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBtYXhfZGlmZiA9IChRUCA+PiAyKSArIDQ7Ci0KLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8qIFNldCBwb2ludGVyIHRvIGZpcnN0IHBpeGVsIG9mIGN1cnJlbnQgYmxvY2sgKi8KLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHB0ciA9IHJlYyArIChicndpZHRoIDw8IDYpICsgKGJjIDw8IDMpOwotCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvKiBGaW5kIG1pbmltdW0gYW5kIG1heGltdW0gdmFsdWUgb2YgcGl4ZWwgYmxvY2sgKi8KLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEZpbmRNYXhNaW4ocHRyLCAmbWluX2JsaywgJm1heF9ibGssIGluY3IpOwotCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvKiB0aHJlc2hvbGQgZGV0ZXJtaW5hdGlvbiAqLwotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdGhyZXMgPSAobWF4X2JsayArIG1pbl9ibGsgKyAxKSA+PiAxOwotCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvKiBJZiBwaXhlbCByYW5nZSBpcyBncmVhdGVyIG9yIGVxdWFsIHRoYW4gREVSSU5HX1RIUiwgc21vb3RoIHRoZSByZWdpb24gKi8KLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICgobWF4X2JsayAtIG1pbl9ibGspID49IERFUklOR19USFIpIC8qc21vb3RoIDh4OCByZWdpb24qLwotI2lmbmRlZiBOb01NWAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgewotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8qIHNtb290aCBhbGwgcGl4ZWxzIGluIHRoZSBibG9jayovCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgRGVyaW5nQWRhcHRpdmVTbW9vdGhNTVgocHRyLCB3aWR0aCwgdGhyZXMsIG1heF9kaWZmKTsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KLSNlbHNlCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLyogU2V0dXAgdGhlIHN0YXJ0aW5nIHBvaW50IG9mIHRoZSByZWdpb24gdG8gc21vb3RoICovCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdjAgPSAoYnIgPDwgMykgLSAxOwotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGgwID0gKGJjIDw8IDMpIC0gMTsKLQotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8qc21vb3RoIDh4OCByZWdpb24qLwotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEFkYXB0aXZlU21vb3RoX05vTU1YKHJlYywgdjAsIGgwLCB2MCArIDEsIGgwICsgMSwgdGhyZXMsIHdpZHRoLCBtYXhfZGlmZik7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9Ci0jZW5kaWYKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfS8qY250aGZsYWcqLwotICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0gLypkZXJpbmcgYnI9PTEgb3IgYmM9PTEgKGJvdW5kYXJ5IGJsb2NrKSovCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgZWxzZSAgICAvKiBQcm9jZXNzIHRoZSBib3VuZGFyeSBibG9ja3MgKi8KLSAgICAgICAgICAgICAgICAgICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8qIERlY2lkZSB0byBwZXJmb3JtIGRlYmxvY2tpbmcgYmFzZWQgb24gdGhlIHNlbWFwaG9yZSBmbGFncwotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqIG9mIHRoZSBuZWlnaGJvcmluZyBibG9ja3MgaW4gZWFjaCBjYXNlLiBBIGNlcnRhaW4gbnVtYmVyIG9mCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqIGhhcmQgZmlsdGVyaW5nIGZsYWdzIGhhdmUgdG8gYmUgc2V0IGluIG9yZGVyIHRvIHNpZ25hbCBuZWVkCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqIGZvciBzbW9vdGhpbmcgKi8KLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGJyID4gMCAmJiBiciA8IHBwX2ggLSAxKQotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoYmMgPiAwKQotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgewotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNudGhmbGFnID0gKChwcF9tb2RbaW5kZXgtcHBfd10gJiAweDEwKSArCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKHBwX21vZFtpbmRleF0gJiAweDEwKSArCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKChwcF9tb2RbaW5kZXgtMV0gPj4gMSkgJiAweDEwKSkgPj4gNDsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGVsc2UKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjbnRoZmxhZyA9ICgocHBfbW9kW2luZGV4XSAmIDB4MTApICsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAocHBfbW9kW2luZGV4LXBwX3ddICYgMHgxMCkgKwotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICgocHBfbW9kW2luZGV4XSA+PiAxKSAmIDB4MTApKSA+PiA0OwotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGVsc2UgaWYgKGJjID4gMCAmJiBiYyA8IHBwX3cgLSAxKQotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoYnIgPiAwKQotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgewotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNudGhmbGFnID0gKChwcF9tb2RbaW5kZXgtcHBfd10gJiAweDEwKSArCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKChwcF9tb2RbaW5kZXgtMV0gPj4gMSkgJiAweDEwKSArCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKChwcF9tb2RbaW5kZXhdID4+IDEpICYgMHgxMCkpID4+IDQ7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBlbHNlCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY250aGZsYWcgPSAoKHBwX21vZFtpbmRleF0gJiAweDEwKSArCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKChwcF9tb2RbaW5kZXgtMV0gPj4gMSkgJiAweDEwKSArCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKChwcF9tb2RbaW5kZXhdID4+IDEpICYgMHgxMCkpID4+IDQ7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZWxzZSAvKiBhdCB0aGUgY29ybmVyIGRvIGRlZmF1bHQqLwotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjbnRoZmxhZyA9IDA7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvKiBEbyB0aGUgZGVyaW5naW5nIGlmIGRlY2lzaW9uIGZsYWdzIGluZGljYXRlIGl0J3MgbmVjZXNzYXJ5ICovCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChjbnRoZmxhZyA8IDIpCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHsKLQotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLyogaWYgdGhlIGRhdGEgaXMgY2hyb21pbmFuY2UgaW5mbywgZ2V0IHRoZSBjb3JyZWN0Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqIHF1YW50aXphdGlvbiBwYXJhbWVudGVyLiBPbmUgcGFyYW1ldGVyIHBlciBibG9jay4gKi8KLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChjaHIpCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgUVAgPSBRUF9zdG9yZVtpbmRleF07Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8qIFNldCBhbW91bnQgdG8gY2hhbmdlIGx1bWluYW5jZSBpZiBpdCBuZWVkcyB0byBiZSBjaGFuZ2VkCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKiBiYXNlZCBvbiBxdWFudGl6YXRpb24gcGFyYW1ldGVyICovCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBtYXhfZGlmZiA9IChRUCA+PiAyKSArIDQ7Ci0KLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8qIFNldCBwb2ludGVyIHRvIGZpcnN0IHBpeGVsIG9mIGN1cnJlbnQgYmxvY2sgKi8KLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHB0ciA9IHJlYyArIChicndpZHRoIDw8IDYpICsgKGJjIDw8IDMpOwotCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvKiBGaW5kIG1pbmltdW0gYW5kIG1heGltdW0gdmFsdWUgb2YgcGl4ZWwgYmxvY2sgKi8KLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEZpbmRNYXhNaW4ocHRyLCAmbWluX2JsaywgJm1heF9ibGssIGluY3IpOwotCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvKiB0aHJlc2hvbGQgZGV0ZXJtaW5hdGlvbiAqLwotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdGhyZXMgPSAobWF4X2JsayArIG1pbl9ibGsgKyAxKSA+PiAxOwotCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvKiBTZXR1cCB0aGUgc3RhcnRpbmcgcG9pbnQgb2YgdGhlIHJlZ2lvbiB0byBzbW9vdGgKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqIFRoaXMgaXMgZ29pbmcgdG8gYmUgYSA0eDQgcmVnaW9uICovCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2MCA9IChiciA8PCAzKSArIDE7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBoMCA9IChiYyA8PCAzKSArIDE7Ci0KLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8qIElmIHBpeGVsIHJhbmdlIGlzIGdyZWF0ZXIgb3IgZXF1YWwgdGhhbiBERVJJTkdfVEhSLCBzbW9vdGggdGhlIHJlZ2lvbiAqLwotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKChtYXhfYmxrIC0gbWluX2JsaykgPj0gREVSSU5HX1RIUikKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvKiBTbW9vdGggNHg0IHJlZ2lvbiAqLwotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEFkYXB0aXZlU21vb3RoX05vTU1YKHJlYywgdjAsIGgwLCB2MCAtIDMsIGgwIC0gMywgdGhyZXMsIHdpZHRoLCBtYXhfZGlmZik7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0vKmNudGhmbGFnKi8KLSAgICAgICAgICAgICAgICAgICAgICAgICAgICB9IC8qIGJyPT0wLCBiYz09MCovCi0gICAgICAgICAgICAgICAgICAgICAgICB9ICAvKiBkZXJpbmcqLwotICAgICAgICAgICAgICAgICAgICB9IC8qYm91bmRhcnkgY29uZGl0aW9uKi8KLSAgICAgICAgICA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VkZSAibWJ0eXBlX21vZGUuaCIKLQotI2RlZmluZSBPU0NMX0RJU0FCTEVfV0FSTklOR19DT05ESVRJT05BTF9JU19DT05TVEFOVAotLyogPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09ICovCi0vKiAgRnVuY3Rpb24gOiBEZWNvZGVGcmFtZUNvbWJpbmVkTW9kZSgpICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICBQdXJwb3NlICA6IERlY29kZSBhIGZyYW1lIG9mIE1QRUc0IGJpdHN0cmVhbSBpbiBjb21iaW5lZCBtb2RlLiAgICAgICAgICAqLwotLyogIEluL291dCAgIDogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgUmV0dXJuICAgOiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICBNb2RpZmllZCA6ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgICAgIDAzLzMwLzIwMDAgOiBDbGVhbmVkIHVwIGFuZCBvcHRpbWl6ZWQgdGhlIGNvZGUuICAgICAgICAgICAgICovCi0vKiAgICAgIDAzLzMxLzIwMDAgOiBBZGRlZCBwcm9wZXIgaGFuZGxpbmcgb2YgTUIgc3R1ZmZpbmcuICAgICAgICAgICovCi0vKiAgICAgIDA0LzEzLzIwMDAgOiBSZXdyb3RlIHRoaXMgY29tYmluZWQgbW9kZSBwYXRoIGNvbXBsZXRlbHkgICAgICovCi0vKiAgICAgICAgICAgICAgICAgICAgICAgICAgIHNvIHRoYXQgaXQgaGFuZGxlcyAiQ29tYmluZWQgTW9kZSBXaXRoIEVycm9yICAgKi8KLS8qICAgICAgICAgICAgICAgICAgICAgICAgICAgUmVzaWxpZW5jZS4iICBOb3cgdGhlIGNvZGUgcmVzZW1ibGVzIHRoZSAgICAgICAqLwotLyogICAgICAgICAgICAgICAgICAgICAgICAgICBwc2V1ZG8gY29kZXMgaW4gTVBFRy00IHN0YW5kYXJkIGJldHRlci4gICAgICAgICovCi0vKiAgICAgIDEwLzEzLzIwMDAgOiBBZGQgZmFzdCBWTEMrZGVxdWFudCAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgICAgIDA0LzEzLzIwMDEgOiBmaXggTUJfc3R1ZmZpbmcgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICAgICAgMDgvMDcvMjAwMSA6IHJlbW92ZSBNQnplcm8gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PSAqLwotUFZfU1RBVFVTIERlY29kZUZyYW1lQ29tYmluZWRNb2RlKFZpZGVvRGVjRGF0YSAqdmlkZW8pCi17Ci0gICAgUFZfU1RBVFVTIHN0YXR1czsKLSAgICBpbnQgbWJudW07Ci0gICAgVm9wICpjdXJyVm9wID0gdmlkZW8tPmN1cnJWb3A7Ci0gICAgQml0c3RyZWFtRGVjVmlkZW8gKnN0cmVhbSA9IHZpZGVvLT5iaXRzdHJlYW07Ci0gICAgaW50IHNob3J0VmlkZW9IZWFkZXIgPSB2aWRlby0+c2hvcnRWaWRlb0hlYWRlcjsKLSAgICBpbnQxNiBRUCwgKlFQTUIgPSB2aWRlby0+UVBNQjsKLSAgICB1aW50OCAqTW9kZSA9IHZpZGVvLT5oZWFkZXJJbmZvLk1vZGU7Ci0gICAgaW50IG5Ub3RhbE1CID0gdmlkZW8tPm5Ub3RhbE1COwotICAgIGludCBuTUJQZXJSb3cgPS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AgICAgICBzdHVmZmluZ19sZW5ndGggPSAxMDsKLSAgICAgICAgICAgIGJyZWFrOwotICAgICAgICBkZWZhdWx0IDoKLSAgICAgICAgICAgIG1wNGRlY19sb2coIkRlY29kZUZyYW1lQ29tYmluZWRNb2RlKCk6IFZvcCB0eXBlIG5vdCBzdXBwb3J0ZWQuXG4iKTsKLSAgICAgICAgICAgIHJldHVybiBQVl9GQUlMOwotICAgIH0KLSNpZmRlZiBQVl9BTk5FWF9JSktUX1NVUFBPUlQKLSAgICBpZiAodmlkZW8tPnNob3J0VmlkZW9IZWFkZXIpCi0gICAgewotICAgICAgICBpZiAodmlkZW8tPmFkdmFuY2VkX0lOVFJBKQotICAgICAgICB7Ci0gICAgICAgICAgICBpZiAodmlkZW8tPm1vZGlmaWVkX3F1YW50KQotICAgICAgICAgICAgewotICAgICAgICAgICAgICAgIHZpZGVvLT52bGNEZWNDb2VmZkludHJhID0gJlZsY0RlY1RDT0VGU2hvcnRIZWFkZXJfQW5uZXhJVDsKLSAgICAgICAgICAgICAgICB2aWRlby0+dmxjRGVjQ29lZmZJbnRlciA9ICZWbGNEZWNUQ09FRlNob3J0SGVhZGVyX0FubmV4VDsKLSAgICAgICAgICAgIH0KLSAgICAgICAgICAgIGVsc2UKLSAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICB2aWRlby0+dmxjRGVjQ29lZmZJbnRyYSA9ICZWbGNEZWNUQ09FRlNob3J0SGVhZGVyX0FubmV4STsKLSAgICAgICAgICAgICAgICB2aWRlby0+dmxjRGVjQ29lZmZJbnRlciA9ICZWbGNEZWNUQ09FRlNob3J0SGVhZGVyOwotICAgICAgICAgICAgfQotICAgICAgICB9Ci0gICAgICAgIGVsc2UKLSAgICAgICAgewotICAgICAgICAgICAgaWYgKHZpZGVvLT5tb2RpZmllZF9xdWFudCkKLSAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICB2aWRlby0+dmxjRGVjQ29lZmZJbnRlciA9IHZpZGVvLT52bGNEZWNDb2VmZkludHJhID0gJlZsY0RlY1RDT0VGU2hvcnRIZWFkZXJfQW5uZXhUOwotICAgICAgICAgICAgfQotICAgICAgICAgICAgZWxzZQotICAgICAgICAgICAgewotICAgICAgICAgICAgICAgIHZpZGVvLT52bGNEZWNDb2VmZkludGVyID0gdmlkZW8tPnZsY0RlY0NvZWZmSW50cmEgPSAmVmxjRGVjVENPRUZTaG9ydEhlYWRlcjsKLSAgICAgICAgICAgIH0KLSAgICAgICAgfQotICAgIH0KLQotI2VuZGlmCi0KLSAgICAvKiogSW5pdGlhbGl6ZSBzbGljZU5vICoqKi8KLSAgICBtYm51bSA9IHNsaWNlX2NvdW50ZXIgPSAwOwotLy8gIG9zY2xfbWVtc2V0KHZpZGVvLT5zbGljZU5vLCAwLCBzaXplb2YodWludDgpKm5Ub3RhbE1CKTsKLSAgICBRUCA9IHZpZGVvLT5jdXJyVm9wLT5xdWFudGl6ZXI7Ci0KLSAgICBkbwotICAgIHsKLSAgICAgICAgLyogVGhpcyBzZWN0aW9uIGlzIGVxdWl2YWxlbnQgdG8gbW90aW9uX3NoYXBlX3RleHR1cmUoKSAqLwotICAgICAgICAvKiAgICBpbiB0aGUgTVBFRy00IHN0YW5kYXJkLiAgICAgMDQvMTMvMjAwMCAgICAgICAgICAqLwotICAgICAgICBtYl9zdGFydCA9IG1ibnVtOwotICAgICAgICB2aWRlby0+dXNlUHJldlFQID0gMDsgICAgICAgICAgICAgLyogIDA0LzI3LzAxICovCi0gICAgICAgIHN0YXJ0UGFja2V0ID0gZ2V0UG9pbnRlcihzdHJlYW0pOwotCi0jaWZkZWYgUFZfQU5ORVhfSUpLVF9TVVBQT1JUCi0gICAgICAgIGlmICh2aWRlby0+bW9kaWZpZWRfcXVhbnQpCi0gICAgICAgIHsKLSAgICAgICAgICAgIHZpZGVvLT5RUF9DSFIgPSBNUV9jaHJvbWFfUVBfdGFibGVbUVBdOwotICAgICAgICB9Ci0gICAgICAgIGVsc2UKLSAgICAgICAgewotICAgICAgICA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FkZXIgKi8KLSAgICAgICAgICAgIHN0YXR1cyA9IEdldE1CaGVhZGVyKHZpZGVvLCAmUVApOwotCi0gICAgICAgICAgICBpZiAoc3RhdHVzICE9IFBWX1NVQ0NFU1MpCi0gICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgVmlkZW9EZWNvZGVyRXJyb3JEZXRlY3RlZCh2aWRlbyk7Ci0gICAgICAgICAgICAgICAgdmlkZW8tPm1ibnVtID0gbWJfc3RhcnQ7Ci0gICAgICAgICAgICAgICAgbW92ZVBvaW50ZXJUbyhzdHJlYW0sIChzdGFydFBhY2tldCAmIC04KSk7Ci0gICAgICAgICAgICAgICAgYnJlYWs7Ci0gICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgIC8qIFN0b3JlIHRoZSBRUCB2YWx1ZSBmb3IgbGF0ZXIgdXNlIGluIEFDIHByZWRpY3Rpb24gKi8KLSAgICAgICAgICAgIFFQTUJbbWJudW1dID0gUVA7Ci0KLSAgICAgICAgICAgIGlmIChNb2RlW21ibnVtXSAhPSBNT0RFX1NLSVBQRUQpCi0gICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgLyogZGVjb2RlIHRoZSBEQ1QgY29lZmljaWVudHMgZm9yIHRoZSBNQiAqLwotICAgICAgICAgICAgICAgIHN0YXR1cyA9IEdldE1CRGF0YSh2aWRlbyk7Ci0gICAgICAgICAgICAgICAgaWYgKHN0YXR1cyAhPSBQVl9TVUNDRVNTKQotICAgICAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAgICAgVmlkZW9EZWNvZGVyRXJyb3JEZXRlY3RlZCh2aWRlbyk7Ci0gICAgICAgICAgICAgICAgICAgIHZpZGVvLT5tYm51bSA9IG1iX3N0YXJ0OwotICAgICAgICAgICAgICAgICAgICBtb3ZlUG9pbnRlclRvKHN0cmVhbSwgKHN0YXJ0UGFja2V0ICYgLTgpKTsKLSAgICAgICAgICAgICAgICAgICAgYnJlYWs7Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgfQotICAgICAgICAgICAgZWxzZSAvKiBNT0RFX1NLSVBQRUQgKi8KLSAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICBTa2lwcGVkTUJNb3Rpb25Db21wKHZpZGVvKTsgLyogIDA4LzA0LzA1ICovCi0gICAgICAgICAgICB9Ci0gICAgICAgICAgICAvLyBNb3Rpb24gY29tcGVuc2F0aW9uIGFuZCBwdXQgdmlkZW8tPm1ibG9jay0+cHJlZF9ibG9jawotICAgICAgICAgICAgbWJudW0rKzsKLQotICAgICAgICAgICAgLyogcmVtb3ZlIGFueSBzdHVmZmluZyBiaXRzICovCi0gICAgICAgICAgICBCaXRzdHJlYW1TaG93Qml0czE2KHN0cmVhbSwgc3R1ZmZpbmdfbGVuZ3RoLCAmY29kZSk7Ci0gICAgICAgICAgICB3aGlsZSAoY29kZSA9PSAxKQotICAgICAgICAgICAgewotICAgICAgICAgICAgICAgIFBWX0JpdHN0cmVhbUZsdXNoQml0cyhzdHJlYW0sIHN0dWZmaW5nX2xlbmd0aCk7Ci0gICAgICAgICAgICAgICAgQml0c3RyZWFtU2hvd0JpdHMxNihzdHJlYW0sIHN0dWZmaW5nX2xlbmd0aCwgJmNvZGUpOwotICAgICAgICAgICAgfQotCi0gICAgICAgICAgICAvKiBoYXZlIHdlIHJlYWNoZWQgdGhlIGVuZCBvZiB0aGUgdmlkZW8gcGFja2V0IG9yIHZvcD8gKi8KLSAgICAgICAgICAgIGlmIChzaG9ydFZpZGVvSGVhZGVyKQotICAgICAgICAgICAgewotI2lmZGVmIFBWX0FOTkVYX0lKS1RfU1VQUE9SVAotICAgICAgICAgICAgICAgIGlmICghdmlkZW8tPnNsaWNlX3N0cnVjdHVyZSkKLSAgICAgICAgICAgICAgICB7Ci0jZW5kaWYKLSAgICAgICAgICAgICAgICAgICAgaWYgKG1ibnVtID49IChpbnQpKHZpZGVvLT5tYm51bV9yb3cgKyAxKSp2aWRlby0+bk1CaW5HT0IpICAgLyogIDEwLzExLzAxICovCi0gICAgICAgICAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAgICAgICAgIGlmIChtYm51bSA+PSBuVG90YWxNQikgcmV0dXJuIFBWX1NVQ0NFU1M7Ci0gICAgICAgICAgICAgICAgICAgICAgICBzdGF0dXMgPSBCaXRzdHJlYW1TaG93Qml0czMyKHN0cmVhbSwgR09CX1JFU1lOQ19NQVJLRVJfTEVOR1RILCAmdG1wdmFyKTsKLQotICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHRtcHZhciA9PSBHT0JfUkVTWU5DX01BUktFUikKLSAgICAgICAgICAgICAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKLSAgICAgICAgICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICAgICAgICAgIGVsc2UKLSAgICAgICAgICAgICAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBzdGF0dXMgPSBQVl9CaXRzdHJlYW1TaG93Qml0c0J5dGVBbGlnbihzdHJlYW0sIEdPQl9SRVNZTkNfTUFSS0VSX0xFTkdUSCwgJnRtcHZhcik7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHRtcHZhciA9PSBHT0JfUkVTWU5DX01BUktFUikgYnJlYWs7Ci0gICAgICAgICAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgICAgIH0KLSNpZmRlZiBQVl9BTk5FWF9JSktUX1NVUFBPUlQKLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgZWxzZQotICAgICAgICAgICAgICAgIHsKLQotICAgICAgICAgICAgICAgICAgICBpZiAobWJudW0gPj0gblRvdGFsTUIpICAvKiBpbiBjYXNlIG5vIHZhbGlkIHN0dWZmaW5nICAwNi8yMy8wMSAqLwotICAgICAgICAgICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgICAgICAgICB2YWxpZF9zdHVmZmluZyA9IHZhbGlkU3R1ZmZpbmdfaDI2MyhzdHJlYW0pOwotICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHZhbGlkX3N0dWZmaW5nID09IDApCi0gICAgICAgICAgICAgICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgVmlkZW9EZWNvZGVyRXJyb3JEZXRlY3RlZCh2aWRlbyk7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgQ29uY2VhbFBhY2tldCh2aWRlbywgbWJfc3RhcnQsIG5Ub3RhbE1CLCBzbGljZV9jb3VudGVyKTsKLSAgICAgICAgICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBQVl9TVUNDRVNTOwotICAgICAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgICAgIC8qIEFOTkVYX0sgKi8KLSAgICAgICAgICAgICAgICAgICAgUFZfQml0c3RyZWFtU2hvd0JpdHNCeXRlQWxpZ25Ob0ZvcmNlU3R1ZmZpbmcoc3RyZWFtLCAxNywgJnRtcHZhcik7Ci0gICAgICAgICAgICAgICAgICAgIGlmICh0bXB2YXIgPT0gUkVTWU5DX01BUktFUikKLSAgICAgICAgICAgICAgICAgICAgewotICAgICAgICAgICAgICAgICAgICAgICAgdmFsaWRfc3R1ZmZpbmcgPSB2YWxpZFN0dWZmaW5nX2gyNjMoc3RyZWFtKTsKLSAgICAgICAgICAgICAgICAgICAgICAgIGlmICh2YWxpZF9zdHVmZmluZykKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhazsgLyogIDA2LzIxLzAxICovCi0gICAgICAgICAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgICAgIH0KLSNlbmRpZgotICAgICAgICAgICAgfQotICAgICAgICAgICAgZWxzZQotICAgICAgICAgICAgewotICAgICAgICAgICAgICAgIGlmIChtYm51bSA+PSBuVG90YWxNQikgIC8qIGluIGNhc2Ugbm8gdmFsaWQgc3R1ZmZpbmcgIDA2LzIzLzAxICovCi0gICAgICAgICAgICAgICAgewotICAgICAgICAgICAgICAgICAgICAvKiAgMTEvMDEvMjAwMiBpZiB3ZSBhcmUgYXQgdGhlIGVuZCBvZiB0aGUgZnJhbWUgYW5kIHRoZXJlIGlzIHNvbWUgZ2FyYmFnZSBkYXRhCi0gICAgICAgICAgICAgICAgICAgIGF0IHRoZSBlbmQgb2YgdGhlIGZyYW1lIChpLmUuIG5vIG5leHQgc3RhcnRjb2RlKSBicmVhayBpZiB0aGUgc3R1ZmZpbmcgaXMgdmFsaWQgKi8KLSAgICAgICAgICAgICAgICAgICAgdmFsaWRfc3R1ZmZpbmcgPSB2YWxpZFN0dWZmaW5nKHN0cmVhbSk7Ci0gICAgICAgICAgICAgICAgICAgIGlmICh2YWxpZF9zdHVmZmluZyA9PSAwKQotICAgICAgICAgICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgICAgICAgICAvKiBlbmQgMTEvMDEvMjAwMiAqLwotICAgICAgICAgICAgICAgICAgICAgICAgVmlkZW9EZWNvZGVyRXJyb3JEZXRlY3RlZCh2aWRlbyk7Ci0gICAgICAgICAgICAgICAgICAgICAgICBDb25jZWFsUGFja2V0KHZpZGVvLCBtYl9zdGFydCwgblRvdGFsTUIsIHNsaWNlX2NvdW50ZXIpOwotICAgICAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgICAgIFBWX0JpdHN0cmVhbUJ5dGVBbGlnbihzdHJlYW0pOwotICAgICAgICAgICAgICAgICAgICByZXR1cm4gUFZfU1VDQ0VTUzsKLSAgICAgICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgICAgICBzdGF0dXMgPSBQVl9CaXRzdHJlYW1TaG93Qml0c0J5dGVBbGlnbihzdHJlYW0sIDIzLCAmdG1wdmFyKTsgLyogdGhpcyBjYWxsIGlzIHZhbGlkIGZvciBmX2NvZGUgPCA4ICovCi0gICAgICAgICAgICAgICAgbG9uZ196ZXJvX2JpdHMgPSAhdG1wdmFyOwotCi0gICAgICAgICAgICAgICAgaWYgKCh0bXB2YXIgPj4gKDIzIC0gcmVzeW5jX21hcmtlcl9sZW5ndGgpKSA9PSBSRVNZTkNfTUFSS0VSIHx8IGxvbmdfemVyb19iaXRzKQotICAgICAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAgICAgdmFsaWRfc3R1ZmZpbmcgPSB2YWxpZFN0dWZmaW5nKHN0cmVhbSk7Ci0gICAgICAgICAgICAgICAgICAgIGlmICh2YWxpZF9zdHVmZmluZykKLSAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOyAvKiAgMDYvMjEvMDEgKi8KLSAgICAgICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgIH0KLSAgICAgICAgfQotICAgICAgICB3aGlsZSAoVFJVRSk7Ci0KLSAgICAgICAgaWYgKHNob3J0VmlkZW9IZWFkZXIpCi0gICAgICAgIHsgLyogV2UgbmVlZCB0byBjaGVjayBuZXdnb2IgdG8gcmVmcmVzaCBxdWFudGl6ZXIgKi8KLSNpZmRlZiBQVl9BTk5FWF9JSktUX1NVUFBPUlQKLSAgICAgICAgICAgIGlmICghdmlkZW8tPnNsaWNlX3N0cnVjdHVyZSkKLSAgICAgICAgICAgIHsKLSNlbmRpZgotICAgICAgICAgICAgICAgIHdoaWxlICgoc3RhdHVzID0gUFZfR29iSGVhZGVyKHZpZGVvKSkgPT0gUFZfRkFJTCkKLSAgICAgICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgICAgIGlmICgoc3RhdHVzID0gcXVpY2tTZWFyY2hHT0JIZWFkZXIoc3RyZWFtKSkgIT0gUFZfU1VDQ0VTUykKLSAgICAgICAgICAgICAgICAgICAgewotICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7Ci0gICAgICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgICAgICBtYm51bSA9IGN1cnJWb3AtPmdvYk51bWJlciAqIHZpZGVvLT5uTUJpbkdPQjsKLSNpZmRlZiBQVl9BTk5FWF9JSktUX1NVUFBPUlQKLSAgICAgICAgICAgIH0KLSAgICAgICAgICAgIGVsc2UKLSAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICB3aGlsZSAoKHN0YXR1cyA9IFBWX0gyNjNTbGljZUhlYWRlcih2aWRlbywgJm1ibnVtKSkgPT0gUFZfRkFJTCkKLSAgICAgICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgICAgIGlmICgoc3RhdHVzID0gcXVpY2tTZWFyY2hIMjYzU2xpY2VIZWFkZXIoc3RyZWFtKSkgIT0gUFZfU1VDQ0VTUykKLSAgICAgICAgICAgICAgICAgICAgewotICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7Ci0gICAgICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICB9Ci0KLSNlbmRpZgotICAgICAgICB9Ci0gICAgICAgIGVsc2UKLSAgICAgICAgewotICAgICAgICAgICAgd2hpbGUgKChzdGF0dXMgPSBQVl9SZWFkVmlkZW9QYWNrZXRIZWFkZXIodmlkZW8sICZtYm51bSkpID09IFBWX0ZBSUwpCi0gICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgaWYgKChzdGF0dXMgPSBxdWlja1NlYXJjaFZpZGVvUGFja2V0SGVhZGVyKHN0cmVhbSwgcmVzeW5jX21hcmtlcl9sZW5ndGgpKSAhPSBQVl9TVUNDRVNTKQotICAgICAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAgICAgYnJlYWs7Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgfQotICAgICAgICB9Ci0KLSAgICAgICAgaWYgKHN0YXR1cyA9PSBQVl9FTkRfT0ZfVk9QKQotICAgICAgICB7Ci0gICAgICAgICAgICBtYm51bSA9IG5Ub3RhbE1COwotICAgICAgICB9Ci0KLSAgICAgICAgaWYgKG1ibnVtID4gdmlkZW8tPm1ibnVtICsgMSkKLSAgICAgICAgewotICAgICAgICAgICAgQ29uY2VhbFBhY2tldCh2aWRlbywgdmlkZW8tPm1ibnVtLCBtYm51bSwgc2xpY2VfY291bnRlcik7Ci0gICAgICAgIH0KLSAgICAgICAgUVAgPSB2aWRlby0+Y3VyclZvcC0+cXVhbnRpemVyOwotICAgICAgICBzbGljZV9jb3VudGVyKys7Ci0gICAgICAgIGlmIChtYm51bSA+PSBuVG90YWxNQikgYnJlYWs7Ci0KLSAgICB9Ci0gICAgd2hpbGUgKFRSVUUpOwotICAgIHJldHVybiBQVl9TVUNDRVNTOwotfQotCi0KLS8qID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0gKi8KLS8qICBGdW5jdGlvbiA6IEdldE1CSGVhZGVyKCkgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICBQdXJwb3NlICA6IERlY29kZSBNQiBoZWFkZXIsIG5vdF9jb2RlZCwgbWNicGMsIGFjX3ByZWRfZmxhZywgY2JweSwgZHF1YW50LiAgKi8KLS8qICBJbi9vdXQgICA6ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICBSZXR1cm4gICA6ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICBNb2RpZmllZCA6ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICAgICAgMy8yOS8wMCA6IENoYW5nZWQgdGhlIHJldHVybmVkIHZhbHVlIGFuZCBvcHRpbWl6ZWQgdGhlIGNvZGUuICAgICovCi0vKiAgICAgIDQvMDEvMDEgOiBuZXcgQUNEQyBwcmVkaWN0aW9uIHN0cnVjdHVyZSAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PSAqLwotUFZfU1RBVFVTIEdldE1CaGVhZGVyKFZpZGVvRGVjRGF0YSAqdmlkZW8sIGludDE2ICpRUCkKLXsKLSAgICBCaXRzdHJlYW1EZWNWaWRlbyAqc3RyZWFtID0gdmlkZW8tPmJpdHN0cmVhbTsKLSAgICBpbnQgbWJudW0gPSB2aWRlby0+bWJudW07Ci0gICAgdWludDggKk1vZGUgPSB2aWRlby0+aGVhZGVySW5mby5Nb2RlOwotICAgIGludCB4X3BvcyA9IHZpZGVvLT5tYm51bV9jb2w7Ci0gICAgdHlwZURDU3RvcmUgKkRDID0gdmlkZW8tPnByZWREQyArIG1ibnVtOwotICAgIHR5cGVEQ0FDU3RvcmUgKkRDQUNfcm93ID0gdmlkZW8tPnByZWREQ0FDX3JvdyArIHhfcG9zOwotICAgIHR5cGVEQ0FDU3RvcmUgKkRDQUNfY29sID0gdmlkZW8tPnByZWREQ0FDX2NvbDsKLSAgICBjb25zdCBzdGF0aWMgaW50MTYgIERRX3RhYls0XSA9IHsgLTEsIC0yLCAxLCAyfTsKLQotICAgIGludCBDQlBZLCBDQlBDOwotICAgIGludCBNQnR5cGUsIFZvcFR5cGU7Ci0gICAgaW50IE1DQlBDOwotICAgIHVpbnQgRFFVQU5UOwotICAgIGludCBjb21wOwotICAgIEJvb2wgbWJfY29kZWQ7Ci0KLSAgICBWb3BUeXBlID0gdmlkZW8tPmN1cnJWb3AtPnByZWRpY3Rpb25UeXBlOwotICAgIG1iX2NvZGVkID0gKChWb3BUeXBlID09IElfVk9QKSA/IFRSVUUgOiAhQml0c3RyZWFtUmVhZDFCaXRzX0lOTElORShzdHJlYW0pKTsKLQotICAgIGlmICghbWJfY29kZWQpCi0gICAgewotICAgICAgICAvKiBza2lwcGVkIG1hY3JvYmxvY2sgKi8KLSAgICAgICAgTW9kZVttYm51bV0gPSBNT0RFX1NLSVBQRUQ7Ci0gICAgICAgIC8vb3NjbF9tZW1zZXQoRENBQ19yb3csIDAsIHNpemVvZih0eXBlRENBQ1N0b3JlKSk7ICAgLyogIFNLSVBQRURfQUNEQyAqLwotICAgICAgICAvL29zY2xfbWVtc2V0KERDQUNfY29sLCAwLCBzaXplb2YodHlwZURDQUNTdG9yZSkpOwotICAgICAgICBaRVJPX09VVF82NEJZVEVTKERDQUNfcm93KTsKLSAgICAgICAgWkVST19PVVRfNjRCWVRFUyhEQ0FDX2NvbCk7IC8qICAwOC8xMi8wNSAqLwotCi0gICAgICAgIGZvciAoY29tcCA9IDA7IGNvbXAgPCA2OyBjb21wKyspCi0gICAgICAgIHsKLSAgICAgICAgICAgICgqREMpW2NvbXBdID0gbWlkX2dyYXk7Ci0gICAgICAgIH0KLSAgICB9Ci0gICAgZWxzZQotICAgIHsKLSAgICAgICAgLyogY29kZWQgbWFjcm9ibG9jayAqLwotICAgICAgICBpZiAoVm9wVHlwZSA9PSBJX1ZPUCkKLSAgICAgICAgewotICAgICAgICAgICAgTUNCUEMgPSBQVl9WbGNEZWNNQ0JQQ19jb21faW50cmEoc3RyZWFtKTsKLSAgICAgICAgfQotICAgICAgICBlbHNlCi0gICAgICAgIHsKLSNpZmRlZiBQVl9BTk5FWF9JSktUX1NVUFBPUlQKLSAgICAgICAgICAgIGlmICghdmlkZW8tPmRlYmxvY2tpbmcpCi0gICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgTUNCUEMgPSBQVl9WbGNEZWNNQ0JQQ19jb21faW50ZXIoc3RyZWFtKTsKLSAgICAgICAgICAgIH0KLSAgICAgICAgICAgIGVsc2UKLSAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICBNQ0JQQyA9IFBWX1ZsY0RlY01DQlBDX2NvbV9pbnRlcl9IMjYzKHN0cmVhbSk7Ci0gICAgICAgICAgICB9Ci0jZWxzZQotICAgICAgICAgICAgTUNCUEMgPSBQVl9WbGNEZWNNQ0JQQ19jb21faW50ZXIoc3RyZWFtKTsKLSNlbmRpZgotICAgICAgICB9Ci0KLSAgICAgICAgaWYgKFZMQ19FUlJPUl9ERVRFQ1RFRChNQ0JQQykpCi0gICAgICAgIHsKLSAgICAgICAgICAgIHJldHVybiBQVl9GQUlMOwotICAgICAgICB9Ci0KLSAgICAgICAgTW9kZVttYm51bV0gPSAodWludDgpKE1CdHlwZSA9IE1CdHlwZV9tb2RlW01DQlBDICYgN10pOwotICAgICAgICBDQlBDID0gKE1DQlBDID4+IDQpICYgMzsKLQotI2lmZGVmIFBWX0FOTkVYX0lKS1RfU1VQUE9SVAotICAgICAgICBpZiAoTUJ0eXBlICYgSU5UUkFfTUFTSykKLSAgICAgICAgewotICAgICAgICAgICAgaWYgKCF2aWRlby0+c2hvcnRWaWRlb0hlYWRlcikKLSAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICB2aWRlby0+YWNQcmVkRmxhZ1ttYm51bV0gPSAodWludDgpIEJpdHN0cmVhbVJlYWQxQml0cyhzdHJlYW0pOwotICAgICAgICAgICAgfQotICAgICAgICAgICAgZWxzZQotICAgICAgICAgICAgewotICAgICAgICAgICAgICAgIGlmICh2aWRlby0+YWR2YW5jZWRfSU5UUkEpCi0gICAgICAgICAgICAgICAgewotICAgICAgICAgICAgICAgICAgICBpZiAoIUJpdHN0cmVhbVJlYWQxQml0cyhzdHJlYW0pKQotICAgICAgICAgICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgICAgICAgICB2aWRlby0+YWNQcmVkRmxhZ1ttYm51bV0gPSAwOwotICAgICAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgICAgIGVsc2UKLSAgICAgICAgICAgICAgICAgICAgewotICAgICAgICAgICAgICAgICAgICAgICAgdmlkZW8tPmFjUHJlZEZsYWdbbWJudW1dID0gMTsKLSAgICAgICAgICAgICAgICAgICAgICAgIGlmIChCaXRzdHJlYW1SZWFkMUJpdHMoc3RyZWFtKSkKLSAgICAgICAgICAgICAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICB2aWRlby0+bWJsb2NrLT5kaXJlY3Rpb24gPSAwOwotICAgICAgICAgICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgICAgICAgICAgZWxzZQotICAgICAgICAgICAgICAgICAgICAgICAgewotICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZpZGVvLT5tYmxvY2stPmRpcmVjdGlvbiA9IDE7Ci0gICAgICAgICAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgZWxzZQotICAgICAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAgICAgdmlkZW8tPmFjUHJlZEZsYWdbbWJudW1dID0gMDsKLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICB9Ci0gICAgICAgIH0KLSNlbHNlCi0gICAgICAgIGlmICgoTUJ0eXBlICYgSU5UUkFfTUFTSykgJiYgIXZpZGVvLT5zaG9ydFZpZGVvSGVhZGVyKQotICAgICAgICB7Ci0gICAgICAgICAgICB2aWRlby0+YWNQcmVkRmxhZ1ttYm51bV0gPSAodWludDgpIEJpdHN0cmVhbVJlYWQxQml0c19JTkxJTkUoc3RyZWFtKTsKLSAgICAgICAgfQotICAgICAgICBlbHNlCi0gICAgICAgIHsKLSAgICAgICAgICAgIHZpZGVvLT5hY1ByZWRGbGFnW21ibnVtXSA9IDA7Ci0gICAgICAgIH0KLSNlbmRpZgotICAgICAgICBDQlBZID0gUFZfVmxjRGVjQ0JQWShzdHJlYW0sIE1CdHlwZSAmIElOVFJBX01BU0spOyAvKiBJTlRSQSB8fCBJTlRSQV9RICovCi0gICAgICAgIGlmIChDQlBZIDwgMCkKLSAgICAgICAgewotICAgICAgICAgICAgcmV0dXJuIFBWX0ZBSUw7Ci0gICAgICAgIH0KLQotICAgICAgICAvLyBHVyAwNC8yMy85OQotICAgICAgICB2aWRlby0+aGVhZGVySW5mby5DQlBbbWJudW1dID0gKHVpbnQ4KShDQlBZIDw8IDIgfCAoQ0JQQyAmIDMpKTsKLSNpZmRlZiBQVl9BTk5FWF9JSktUX1NVUFBPUlQKLSAgICAgICAgaWYgKE1CdHlwZSAmIFFfTUFTSykKLSAgICAgICAgewotICAgICAgICAgICAgaWYgKCF2aWRlby0+bW9kaWZpZWRfcXVhbnQpCi0gICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgRFFVQU5UID0gQml0c3RyZWFtUmVhZEJpdHMxNihzdHJlYW0sIDIpOwotICAgICAgICAgICAgICAgICpRUCArPSBEUV90YWJbRFFVQU5UXTsKLQotICAgICAgICAgICAgICAgIGlmICgqUVAgPCAxKSAqUVAgPSAxOwotICAgICAgICAgICAgICAgIGVsc2UgaWYgKCpRUCA+IDMxKSAqUVAgPSAzMTsKLSAgICAgICAgICAgICAgICB2aWRlby0+UVBfQ0hSID0gKlFQOyAgLyogQU5ORVhfVCAqLwotICAgICAgICAgICAgfQotICAgICAgICAgICAgZWxzZQotICAgICAgICAgICAgewotICAgICAgICAgICAgICAgIGlmIChCaXRzdHJlYW1SZWFkMUJpdHMoc3RyZWFtKSkKLSAgICAgICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgICAgIGlmIChCaXRzdHJlYW1SZWFkMUJpdHMoc3RyZWFtKSkKLSAgICAgICAgICAgICAgICAgICAgewotICAgICAgICAgICAgICAgICAgICAgICAgKlFQICs9IERRX3RhYl9Bbm5leF9UXzExWypRUF07Ci0gICAgICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICAgICAgZWxzZQotICAgICAgICAgICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgICAgICAgICAqUVAgKz0gRFFfdGFiX0FubmV4X1RfMTBbKlFQXTsKLSAgICAgICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgICAgICBpZiAoKlFQIDwgMSkgKlFQID0gMTsKLSAgICAgICAgICAgICAgICAgICAgZWxzZSBpZiAoKlFQID4gMzEpICpRUCA9IDMxOwotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICBlbHNlCi0gICAgICAgICAgICAgICAgewotICAgICAgICAgICAgICAgICAgICAqUVAgPSAoaW50MTYpQml0c3RyZWFtUmVhZEJpdHMxNihzdHJlYW0sIDUpOwotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICB2aWRlby0+UVBfQ0hSID0gIE1RX2Nocm9tYV9RUF90YWJsZVsqUVBdOwotICAgICAgICAgICAgfQotICAgICAgICB9Ci0jZWxzZQotICAgICAgICBpZiAoTUJ0eXBlICYgUV9NQVNLKQotICAgICAgICB7Ci0gICAgICAgICAgICBEUVVBTlQgPSBCaXRzdHJlYW1SZWFkQml0czE2KHN0cmVhbSwgMik7Ci0gICAgICAgICAgICAqUVAgKz0gRFFfdGFiW0RRVUFOVF07Ci0KLSAgICAgICAgICAgIGlmICgqUVAgPCAxKSAqUVAgPSAxOwotICAgICAgICAgICAgZWxzZSBpZiAoKlFQID4gMzEpICpRUCA9IDMxOwotICAgICAgICB9Ci0jZW5kaWYKLSAgICB9Ci0gICAgcmV0dXJuIFBWX1NVQ0NFU1M7Ci19Ci0KLQotCi0KLQotLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqQ29tbWVudEJlZ2luKioqKioqCi0qICAgICAgIDMvMTAvMDAgIDogaW5pdGlhbCBtb2RpZmljYXRpb24gdG8gdGhlCi0qICAgICAgICAgICAgICAgIG5ldyBQVi1EZWNvZGVyIExpYiBmb3JtYXQuCi0qICAgICAgIDQvMi8yMDAwIDogQ2xlYW51cCBhbmQgZXJyb3ItaGFuZGxpbmcgbW9kaWZpY2F0aW9uLiAgVGhpcwotKiAgICAgICAgICAgICAgICAgICBmdW5jdGlvbiBoYXMgYmVlbiBkaXZpZ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G9jay0+RENTY2FsYXJDaHIgPSBjYWxfZGNfc2NhbGVyKFFQLCBDSFJPTUlOQU5DRV9EQ19UWVBFKTsKLQotICAgICAgICBmb3IgKGNvbXAgPSAwOyBjb21wIDwgNjsgY29tcCsrKQotICAgICAgICB7Ci0gICAgICAgICAgICBkYXRhQmxvY2sgPSBtYmxvY2stPmJsb2NrW2NvbXBdOyAgICAvKiAxMC8yMC8yMDAwICovCi0KLSAgICAgICAgICAgIGlmICh2aWRlby0+c2hvcnRWaWRlb0hlYWRlcikKLSAgICAgICAgICAgIHsKLSNpZmRlZiBQVl9BTk5FWF9JSktUX1NVUFBPUlQKLSAgICAgICAgICAgICAgICBpZiAoIXZpZGVvLT5hZHZhbmNlZF9JTlRSQSkKLSAgICAgICAgICAgICAgICB7Ci0jZW5kaWYKLSAgICAgICAgICAgICAgICAgICAgRENfY29lZmYgPSAoaW50MTYpIEJpdHN0cmVhbVJlYWRCaXRzMTZfSU5MSU5FKHN0cmVhbSwgOCk7Ci0KLSAgICAgICAgICAgICAgICAgICAgaWYgKChEQ19jb2VmZiAmIDB4N2YpID09IDApIC8qIDEyOCAmIDAgICovCi0gICAgICAgICAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAgICAgICAgIC8qIGN1cnJlbnRseSB3ZSB3aWxsIG9ubHkgc2lnbmFsIEZBSUwgZm9yIDEyOC4gV2Ugd2lsbCBpZ25vcmUgdGhlIDAgY2FzZSAgKi8KLSAgICAgICAgICAgICAgICAgICAgICAgIGlmIChEQ19jb2VmZiA9PSAxMjgpCi0gICAgICAgICAgICAgICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFBWX0ZBSUw7Ci0gICAgICAgICAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgICAgICAgICBlbHNlCi0gICAgICAgICAgICAgICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgVmlkZW9EZWNvZGVyRXJyb3JEZXRlY3RlZCh2aWRlbyk7Ci0gICAgICAgICAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICAgICAgaWYgKERDX2NvZWZmID09IDI1NSkKLSAgICAgICAgICAgICAgICAgICAgewotICAgICAgICAgICAgICAgICAgICAgICAgRENfY29lZmYgPSAxMjg7Ci0gICAgICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICAgICAgZGF0YUJsb2NrWzBdID0gKGludDE2KSBEQ19jb2VmZjsKLSNpZmRlZiBQVl9BTk5FWF9JSktUX1NVUFBPUlQKLSAgICAgICAgICAgICAgICB9Ci0jZW5kaWYKLSAgICAgICAgICAgICAgICBuY29lZmZzW2NvbXBdID0gVmxjRGVxdWFudEgyNjNJbnRyYUJsb2NrX1NIKHZpZGVvLCBjb21wLCBtYmxvY2stPmJpdG1hcGNvbFtjb21wXSwgJm1ibG9jay0+Yml0bWFwcm93W2NvbXBdKTsKLQotICAgICAgICAgICAgfQotICAgICAgICAgICAgZWxzZQotICAgICAgICAgICAgewotICAgICAgICAgICAgICAgIGlmIChzd2l0Y2hlZCA9PSAwKQotICAgICAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAgICAgc3RhdHVzID0gUFZfRGVjb2RlUHJlZGljdGVkSW50cmFEQyhjb21wLCBzdHJlYW0sICZEQ19jb2VmZik7Ci0gICAgICAgICAgICAgICAgICAgIGlmIChzdGF0dXMgIT0gUFZfU1VDQ0VTUykgcmV0dXJuIFBWX0ZBSUw7Ci0KLSAgICAgICAgICAgICAgICAgICAgZGF0YUJsb2NrWzBdID0gKGludDE2KSBEQ19jb2VmZjsKLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgbmNvZWZmc1tjb21wXSA9IFZsY0RlcXVhbnRIMjYzSW50cmFCbG9jayh2aWRlbywgY29tcCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc3dpdGNoZWQsIG1ibG9jay0+Yml0bWFwY29sW2NvbXBdLCAmbWJsb2NrLT5iaXRtYXByb3dbY29tcF0pOwotICAgICAgICAgICAgfQotCi0gICAgICAgICAgICBpZiAoVkxDX0VSUk9SX0RFVEVDVEVEKG5jb2VmZnNbY29tcF0pKQotICAgICAgICAgICAgewotICAgICAgICAgICAgICAgIGlmIChzd2l0Y2hlZCkKLSAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFBWX0ZBSUw7Ci0gICAgICAgICAgICAgICAgZWxzZQotICAgICAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAgICAgbmNvZWZmc1tjb21wXSA9IDE7Ci0gICAgICAgICAgICAgICAgICAgIG9zY2xfbWVtc2V0KChkYXRhQmxvY2sgKyAxKSwgMCwgc2l6ZW9mKGludDE2KSo2Myk7Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgfQotICAgICAgICAgICAgbm9fY29lZmZbY29tcF0gPSBuY29lZmZzW2NvbXBdOwotCi0jaWZkZWYgUFZfUE9TVFBST0NfT04KLSAgICAgICAgICAgIGlmICh2aWRlby0+cG9zdEZpbHRlclR5cGUgIT0gUFZfTk9fUE9TVF9QUk9DKQotICAgICAgICAgICAgICAgICpwcF9tb2RbY29tcF0gPSAodWludDgpIFBvc3RQcm9jU2VtYXBob3JlKGRhdGFCbG9jayk7Ci0jZW5kaWYKLSAgICAgICAgfQotICAgICAgICBNQmxvY2tJRENUKHZpZGVvKTsKLSAgICB9Ci0gICAgZWxzZSAgICAgIC8qIElOVEVSIG1vZGVzICovCi0gICAgeyAgIC8qICBtb3ZlZCBpdCBoZXJlIEF1ZyAxNSwgMjAwNSAqLwotICAgICAgICAvKiBkZWNvZGUgdGhlIG1vdGlvbiB2ZWN0b3IgKGlmIHRoZXJlIGFyZSBhbnkpICovCi0gICAgICAgIHN0YXR1cyA9IFBWX0dldE1CdmVjdG9ycyh2aWRlbywgbW9kZSk7Ci0gICAgICAgIGlmIChzdGF0dXMgIT0gUFZfU1VDQ0VTUykKL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ICAgICAgICAgIGlmICh2aWRlby0+cG9zdEZpbHRlclR5cGUgIT0gUFZfTk9fUE9TVF9QUk9DKQotICAgICAgICAgICAgICAgICAgICAqcHBfbW9kW2NvbXBdID0gKHVpbnQ4KSgobmNvZWZmc1tjb21wXSA+IDMpID8gNCA6IDApOwotI2VuZGlmCi0gICAgICAgICAgICB9Ci0gICAgICAgICAgICBlbHNlCi0gICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgLyogbm8gSURDVCBmb3IgYWxsIHplcm9zIGJsb2NrcyAgMDMvMjgvMjAwMiAqLwotICAgICAgICAgICAgICAgIC8qICAgICAgICAgICAgICBCbG9ja0lEQ1QoKTsgICAgICAgICAgICAgICAgKi8KLSNpZmRlZiBQVl9QT1NUUFJPQ19PTgotICAgICAgICAgICAgICAgIGlmICh2aWRlby0+cG9zdEZpbHRlclR5cGUgIT0gUFZfTk9fUE9TVF9QUk9DKQotICAgICAgICAgICAgICAgICAgICAqcHBfbW9kW2NvbXBdID0gMDsKLSNlbmRpZgotICAgICAgICAgICAgfQotICAgICAgICB9Ci0KLSAgICAgICAgdmlkZW8tPlFQTUJbbWJudW1dID0gdmlkZW8tPlFQX0NIUjsgICAgIC8qIEFOTkVYX1QgKi8KLQotCi0KLSAgICAgICAgKCpEQylbNF0gPSBtaWRfZ3JheTsKLSAgICAgICAgaWYgKENCUCAmIDIpCi0gICAgICAgIHsKLSAgICAgICAgICAgIG5jb2VmZnNbNF0gPSBWbGNEZXF1YW50SDI2M0ludGVyQmxvY2sodmlkZW8sIDQsIG1ibG9jay0+Yml0bWFwY29sWzRdLCAmbWJsb2NrLT5iaXRtYXByb3dbNF0pOwotICAgICAgICAgICAgaWYgKFZMQ19FUlJPUl9ERVRFQ1RFRChuY29lZmZzWzRdKSkgcmV0dXJuIFBWX0ZBSUw7Ci0KLSAgICAgICAgICAgIEJsb2NrSURDVCh2aWRlby0+Y3VyclZvcC0+dUNoYW4gKyAob2Zmc2V0ID4+IDIpICsgKHhfcG9zIDw8IDIpLCBtYmxvY2stPnByZWRfYmxvY2sgKyAyNTYsIG1ibG9jay0+YmxvY2tbNF0sIHdpZHRoID4+IDEsIG5jb2VmZnNbNF0sCi0gICAgICAgICAgICAgICAgICAgICAgbWJsb2NrLT5iaXRtYXBjb2xbNF0sIG1ibG9jay0+Yml0bWFwcm93WzRdKTsKLQotI2lmZGVmIFBWX1BPU1RQUk9DX09OCi0gICAgICAgICAgICAvKiBmb3IgaW50ZXIganVzdCB0ZXN0IGZvciByaW5naW5nICovCi0gICAgICAgICAgICBpZiAodmlkZW8tPnBvc3RGaWx0ZXJUeXBlICE9IFBWX05PX1BPU1RfUFJPQykKLSAgICAgICAgICAgICAgICAqcHBfbW9kWzRdID0gKHVpbnQ4KSgobmNvZWZmc1s0XSA+IDMpID8gNCA6IDApOwotI2VuZGlmCi0gICAgICAgIH0KLSAgICAgICAgZWxzZQotICAgICAgICB7Ci0gICAgICAgICAgICAvKiBubyBJRENUIGZvciBhbGwgemVyb3MgYmxvY2tzICAwMy8yOC8yMDAyICovCi0gICAgICAgICAgICAvKiAgICAgICAgICAgICAgQmxvY2tJRENUKCk7ICAgICAgICAgICAgICAgICovCi0jaWZkZWYgUFZfUE9TVFBST0NfT04KLSAgICAgICAgICAgIGlmICh2aWRlby0+cG9zdEZpbHRlclR5cGUgIT0gUFZfTk9fUE9TVF9QUk9DKQotICAgICAgICAgICAgICAgICpwcF9tb2RbNF0gPSAwOwotI2VuZGlmCi0gICAgICAgIH0KLSAgICAgICAgKCpEQylbNV0gPSBtaWRfZ3JheTsKLSAgICAgICAgaWYgKENCUCAmIDEpCi0gICAgICAgIHsKLSAgICAgICAgICAgIG5jb2VmZnNbNV0gPSBWbGNEZXF1YW50SDI2M0ludGVyQmxvY2sodmlkZW8sIDUsIG1ibG9jay0+Yml0bWFwY29sWzVdLCAmbWJsb2NrLT5iaXRtYXByb3dbNV0pOwotICAgICAgICAgICAgaWYgKFZMQ19FUlJPUl9ERVRFQ1RFRChuY29lZmZzWzVdKSkgcmV0dXJuIFBWX0ZBSUw7Ci0KLSAgICAgICAgICAgIEJsb2NrSURDVCh2aWRlby0+Y3VyclZvcC0+dkNoYW4gKyAob2Zmc2V0ID4+IDIpICsgKHhfcG9zIDw8IDIpLCBtYmxvY2stPnByZWRfYmxvY2sgKyAyNjQsIG1ibG9jay0+YmxvY2tbNV0sIHdpZHRoID4+IDEsIG5jb2VmZnNbNV0sCi0gICAgICAgICAgICAgICAgICAgICAgbWJsb2NrLT5iaXRtYXBjb2xbNV0sIG1ibG9jay0+Yml0bWFwcm93WzVdKTsKLQotI2lmZGVmIFBWX1BPU1RQUk9DX09OCi0gICAgICAgICAgICAvKiBmb3IgaW50ZXIganVzdCB0ZXN0IGZvciByaW5naW5nICovCi0gICAgICAgICAgICBpZiAodmlkZW8tPnBvc3RGaWx0ZXJUeXBlICE9IFBWX05PX1BPU1RfUFJPQykKLSAgICAgICAgICAgICAgICAqcHBfbW9kWzVdID0gKHVpbnQ4KSgobmNvZWZmc1s1XSA+IDMpID8gNCA6IDApOwotI2VuZGlmCi0gICAgICAgIH0KLSAgICAgICAgZWxzZQotICAgICAgICB7Ci0gICAgICAgICAgICAvKiBubyBJRENUIGZvciBhbGwgemVyb3MgYmxvY2tzICAwMy8yOC8yMDAyICovCi0gICAgICAgICAgICAvKiAgICAgICAgICAgICAgQmxvY2tJRENUKCk7ICAgICAgICAgICAgICAgICovCi0jaWZkZWYgUFZfUE9TVFBST0NfT04KLSAgICAgICAgICAgIGlmICh2aWRlby0+cG9zdEZpbHRlclR5cGUgIT0gUFZfTk9fUE9TVF9QUk9DKQotICAgICAgICAgICAgICAgICpwcF9tb2RbNV0gPSAwOwotI2VuZGlmCi0gICAgICAgIH0KLSAgICAgICAgdmlkZW8tPlFQTUJbbWJudW1dID0gUVA7ICAvKiByZXN0b3JlIHRoZSBRUCB2YWx1ZXMgIEFOTkVYX1QqLwotI2Vsc2UKLSAgICAgICAgZm9yIChjb21wID0gMDsgY29tcCA8IDQ7IGNvbXArKykKLSAgICAgICAgewotICAgICAgICAgICAgKCpEQylbY29tcF0gPSBtaWRfZ3JheTsKLSAgICAgICAgICAgIGlmIChDQlAgJiAoMSA8PCAoNSAtIGNvbXApKSkKLSAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICBuY29lZmZzW2NvbXBdID0gVmxjRGVxdWFudEgyNjNJbnRlckJsb2NrKHZpZGVvLCBjb21wLCBtYmxvY2stPmJpdG1hcGNvbFtjb21wXSwgJm1ibG9jay0+Yml0bWFwcm93W2NvbXBdKTsKLSAgICAgICAgICAgICAgICBpZiAoVkxDX0VSUk9SX0RFVEVDVEVEKG5jb2VmZnNbY29tcF0pKSByZXR1cm4gUFZfRkFJTDsKLQotICAgICAgICAgICAgICAgIEJsb2NrSURDVChjX2NvbXAgKyAoY29tcCYyKSood2lkdGggPDwgMikgKyA4Kihjb21wJjEpLCBtYmxvY2stPnByZWRfYmxvY2sgKyAoY29tcCYyKSo2NCArIDgqKGNvbXAmMSksIG1ibG9jay0+YmxvY2tbY29tcF0sIHdpZHRoLCBuY29lZmZzW2NvbXBdLAotICAgICAgICAgICAgICAgICAgICAgICAgICBtYmxvY2stPmJpdG1hcGNvbFtjb21wXSwgbWJsb2NrLT5iaXRtYXByb3dbY29tcF0pOwotCi0jaWZkZWYgUFZfUE9TVFBST0NfT04KLSAgICAgICAgICAgICAgICAvKiBmb3IgaW50ZXIganVzdCB0ZXN0IGZvciByaW5naW5nICovCi0gICAgICAgICAgICAgICAgaWYgKHZpZGVvLT5wb3N0RmlsdGVyVHlwZSAhPSBQVl9OT19QT1NUX1BST0MpCi0gICAgICAgICAgICAgICAgICAgICpwcF9tb2RbY29tcF0gPSAodWludDgpKChuY29lZmZzW2NvbXBdID4gMykgPyA0IDogMCk7Ci0jZW5kaWYKLSAgICAgICAgICAgIH0KLSAgICAgICAgICAgIGVsc2UKLSAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAvKiBubyBJRENUIGZvciBhbGwgemVyb3MgYmxvY2tzICAwMy8yOC8yMDAyICovCi0gICAgICAgICAgICAgICAgLyogICAgICAgICAgICAgIEJsb2NrSURDVCgpOyAgICAgICAgICAgICAgICAqLwotI2lmZGVmIFBWX1BPU1RQUk9DX09OCi0gICAgICAgICAgICAgICAgaWYgKHZpZGVvLT5wb3N0RmlsdGVyVHlwZSAhPSBQVl9OT19QT1NUX1BST0MpCi0gICAgICAgICAgICAgICAgICAgICpwcF9tb2RbY29tcF0gPSAwOwotI2VuZGlmCi0gICAgICAgICAgICB9Ci0gICAgICAgIH0KLQotICAgICAgICAoKkRDKVs0XSA9IG1pZF9ncmF5OwotICAgICAgICBpZiAoQ0JQICYgMikKLSAgICAgICAgewotICAgICAgICAgICAgbmNvZWZmc1s0XSA9IFZsY0RlcXVhbnRIMjYzSW50ZXJCbG9jayh2aWRlbywgNCwgbWJsb2NrLT5iaXRtYXBjb2xbNF0sICZtYmxvY2stPmJpdG1hcHJvd1s0XSk7Ci0gICAgICAgICAgICBpZiAoVkxDX0VSUk9SX0RFVEVDVEVEKG5jb2VmZnNbNF0pKSByZXR1cm4gUFZfRkFJTDsKLQotICAgICAgICAgICAgQmxvY2tJRENUKHZpZGVvLT5jdXJyVm9wLT51Q2hhbiArIChvZmZzZXQgPj4gMikgKyAoeF9wb3MgPDwgMiksIG1ibG9jay0+cHJlZF9ibG9jayArIDI1NiwgbWJsb2NrLT5ibG9ja1s0XSwgd2lkdGggPj4gMSwgbmNvZWZmc1s0XSwKLSAgICAgICAgICAgICAgICAgICAgICBtYmxvY2stPmJpdG1hcGNvbFs0XSwgbWJsb2NrLT5iaXRtYXByb3dbNF0pOwotCi0jaWZkZWYgUFZfUE9TVFBST0NfT04KLSAgICAgICAgICAgIC8qIGZvciBpbnRlciBqdXN0IHRlc3QgZm9yIHJpbmdpbmcgKi8KLSAgICAgICAgICAgIGlmICh2aWRlby0+cG9zdEZpbHRlclR5cGUgIT0gUFZfTk9fUE9TVF9QUk9DKQotICAgICAgICAgICAgICAg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0b3A7IG1ibnVtKyspCi0gICAgewotICAgICAgICB2aWRlby0+bWJudW0gPSBtYm51bTsKLSAgICAgICAgdmlkZW8tPm1ibnVtX3JvdyA9IFBWX0dFVF9ST1cobWJudW0sIHZpZGVvLT5uTUJQZXJSb3cpOwotICAgICAgICB2aWRlby0+bWJudW1fY29sID0gbWJudW0gLSB2aWRlby0+bWJudW1fcm93ICogdmlkZW8tPm5NQlBlclJvdzsKLSAgICAgICAgdmlkZW8tPnNsaWNlTm9bbWJudW1dID0gKHVpbnQ4KSBzbGljZV9jb3VudGVyOwotICAgICAgICBRUCA9IHZpZGVvLT5RUE1CW21ibnVtXTsKLSAgICAgICAgUFZfVmxjRGVjTUNCUENfY29tX2ludHJhKHN0cmVhbSk7Ci0gICAgICAgIEdldE1CaGVhZGVyRGF0YVBhcnRfRFFVQU5UX0RDKHZpZGVvLCAmUVApOwotCi0gICAgICAgIGlmIChpbnRyYV9kY192bGNfdGhyKQotICAgICAgICB7Ci0gICAgICAgICAgICBpZiAodmlkZW8tPnVzZVByZXZRUCkKLSAgICAgICAgICAgICAgICBRUCA9IHZpZGVvLT5RUE1CW21ibnVtLTFdOwotICAgICAgICAgICAgaWYgKGludHJhX2RjX3ZsY190aHIgPT0gNyB8fCBRUCA+PSBpbnRyYV9kY192bGNfdGhyKjIgKyAxMSkgIC8qIGlmIHN3aXRjaGVkIHRoZW4gY29uY2VhbCBmcm9tIHByZXZpb3VzIGZyYW1lICAqLwotICAgICAgICAgICAgewotICAgICAgICAgICAgICAgIENvbmNlYWxQYWNrZXQodmlkZW8sIG1ibnVtLCBtYl9zdG9wLCBzbGljZV9jb3VudGVyKTsKLSAgICAgICAgICAgICAgICB2aWRlby0+bWJudW0gPSBtYl9zdG9wIC0gMTsKLSAgICAgICAgICAgICAgICB2aWRlby0+bWJudW1fcm93ID0gUFZfR0VUX1JPVyh2aWRlby0+bWJudW0sIHZpZGVvLT5uTUJQZXJSb3cpOwotICAgICAgICAgICAgICAgIHZpZGVvLT5tYm51bV9jb2wgPSB2aWRlby0+bWJudW0gLSB2aWRlby0+bWJudW1fcm93ICogdmlkZW8tPm5NQlBlclJvdzsKLSAgICAgICAgICAgICAgICBicmVhazsKLSAgICAgICAgICAgIH0KLSAgICAgICAgfQotCi0gICAgICAgIHZpZGVvLT5oZWFkZXJJbmZvLkNCUFttYm51bV0gPSAwOwotICAgICAgICB2aWRlby0+YWNQcmVkRmxhZ1ttYm51bV0gPSAwOwotICAgICAgICBHZXRNQkRhdGFfRGF0YVBhcnQodmlkZW8pOwotICAgICAgICB2aWRlby0+dXNlUHJldlFQID0gMTsKLSAgICB9Ci0gICAgcmV0dXJuOwotfQotCi0vKiA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09IC8KLUZ1bmN0aW9uIDogQ29uY2VhbFRleHR1cmVfUCgpCi1EYXRlICAgICA6IDA1LzE2LzIwMDAKLVB1cnBvc2UgIDogQ29uY2VhbCB0ZXh0dXJlIGZvciBQLXBhcnRpdGlvbgotSW4vb3V0ICAgOgotUmV0dXJuICAgOgotLyA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09ICovCi0KLXZvaWQgQ29uY2VhbFRleHR1cmVfUChWaWRlb0RlY0RhdGEgKnZpZGVvLCBpbnQgbWJfc3RhcnQsIGludCBtYl9zdG9wLCBpbnQgc2xpY2VfY291bnRlcikKLXsKLSAgICBpbnQgbWJudW07Ci0KLSAgICBmb3IgKG1ibnVtID0gbWJfc3RhcnQ7IG1ibnVtIDwgbWJfc3RvcDsgbWJudW0rKykKLSAgICB7Ci0gICAgICAgIHZpZGVvLT5tYm51bSA9IG1ibnVtOwotICAgICAgICB2aWRlby0+bWJudW1fcm93ID0gUFZfR0VUX1JPVyhtYm51bSwgdmlkZW8tPm5NQlBlclJvdyk7Ci0gICAgICAgIHZpZGVvLT5tYm51bV9jb2wgPSBtYm51bSAtIHZpZGVvLT5tYm51bV9yb3cgKiB2aWRlby0+bk1CUGVyUm93OwotICAgICAgICB2aWRlby0+c2xpY2VOb1ttYm51bV0gPSAodWludDgpIHNsaWNlX2NvdW50ZXI7Ci0gICAgICAgIG9zY2xfbWVtc2V0KHZpZGVvLT5tYmxvY2stPmJsb2NrLCAwLCBzaXplb2YodHlwZU1CU3RvcmUpKTsKLSAgICAgICAgLyogIHRvIGdldCByaWQgb2YgZGFyayByZWdpb24gY2F1c2VkIGJ5IElOVFJBIGJsb2NrcyAqLwotICAgICAgICAvKiAwNS8xOS8yMDAwICovCi0gICAgICAgIGlmICh2aWRlby0+aGVhZGVySW5mby5Nb2RlW21ibnVtXSAmIElOVEVSX01BU0spCi0gICAgICAgIHsKLSAgICAgICAgICAgIE1CTW90aW9uQ29tcCh2aWRlbywgMCk7Ci0gICAgICAgIH0KLSAgICAgICAgZWxzZQotICAgICAgICB7Ci0gICAgICAgICAgICB2aWRlby0+aGVhZGVySW5mby5Nb2RlW21ibnVtXSA9IE1PREVfU0tJUFBFRDsKLSAgICAgICAgICAgIFNraXBwZWRNQk1vdGlvbkNvbXAodmlkZW8pOwotICAgICAgICB9Ci0gICAgfQotCi0gICAgcmV0dXJuOwotfQotCi0vKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCi1GdW5jdGlvbjogICBDb25jZWFsUGFja2V0Ci1QdXJwb3NlIDogICBDb25jZWFsIG1vdGlvbiBhbmQgdGV4dHVyZSBvZiBhIHBhY2tldCBieSBkaXJlY3QKLWNvcHlpbmcgZnJvbSBwcmV2aW91cyBmcmFtZS4KLVJldHVybmVkOiAgIHZvaWQKLU1vZGlmaWVkOgotKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLXZvaWQgQ29uY2VhbFBhY2tldChWaWRlb0RlY0RhdGEgKnZpZGVvLAotICAgICAgICAgICAgICAgICAgIGludCBtYl9zdGFydCwKLSAgICAgICAgICAgICAgICAgICBpbnQgbWJfc3RvcCwKLSAgICAgICAgICAgICAgICAgICBpbnQgc2xpY2VfY291bnRlcikKLXsKLSAgICBpbnQgaTsKLSAgICBmb3IgKGkgPSBtYl9zdGFydDsgaSA8IG1iX3N0b3A7IGkrKykKLSAgICB7Ci0gICAgICAgIENvcHlWb3BNQih2aWRlby0+Y3VyclZvcCwgdmlkZW8tPmNvbmNlYWxGcmFtZSwgaSwgdmlkZW8tPndpZHRoLCB2aWRlby0+aGVpZ2h0KTsKLSAgICAgICAgdmlkZW8tPnNsaWNlTm9baV0gPSAodWludDgpIHNsaWNlX2NvdW50ZXI7Ci0gICAgICAgIHZpZGVvLT5oZWFkZXJJbmZvLk1vZGVbaV0gPSBNT0RFX1NLSVBQRUQ7Ci0gICAgfQotCi0gICAgcmV0dXJuOwotfQotCi0vKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgotRnVuY3Rpb246ICAgQ29weVZvcE1CCi1QdXJwb3NlIDogICBGaWxsIGEgbWFjcm9ibG9jayB3aXRoIHByZXZpb3VzIFZvcC4KLVJldHVybmVkICAgIDogICB2b2lkCi1Nb2RpZmllZDogICA2LzA0LzIwMDEgcmV3cm90ZSB0aGUgZnVuY3Rpb24KLSAgICAgICAgICAgIGNvcGllcyBmcm9tIGNvbmNlYWxGcmFtZQotKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLXZvaWQgQ29weVZvcE1CKFZvcCAqY3VyciwgdWludDggKnByZXZGcmFtZSwgaW50IG1ibnVtLCBpbnQgd2lkdGhfWSwgaW50IGhlaWdodCkKLXsKLSAgICBpbnQgd2lkdGhfQyA9IHdpZHRoX1kgPj4gMTsKLSAgICBpbnQgcm93ID0gTUJfU0laRTsKLSAg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LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0KLSAqLwotI2luY2x1ZGUgIm1wNGRlY19saWIuaCIKLSNpbmNsdWRlICJ2bGNfZGVjb2RlLmgiCi0jaW5jbHVkZSAiYml0c3RyZWFtLmgiCi0jaW5jbHVkZSAic2NhbGluZy5oIgotI2luY2x1ZGUgIm1idHlwZV9tb2RlLmgiCi0jaW5jbHVkZSAiaWRjdC5oIgotCi0jZGVmaW5lIE9TQ0xfRElTQUJMRV9XQVJOSU5HX0NPTkRJVElPTkFMX0lTX0NPTlNUQU5UCi0vKiA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0gKi8KLS8qICBGdW5jdGlvbiA6IERlY29kZUZyYW1lRGF0YVBhcnRNb2RlKCkgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogIFB1cnBvc2UgIDogRGVjb2RlIGEgZnJhbWUgb2YgTVBFRzQgYml0c3RyZWFtIGluIGRhdGFwYXJ0aXRpb25pbmcgbW9kZS4gICovCi0vKiAgSW4vb3V0ICAgOiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICBSZXR1cm4gICA6ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogIE1vZGlmaWVkIDogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICAgICAgMDQvMjUvMjAwMCA6IFJld3JpdGUgdGhlIGRhdGEgcGFydGl0aW9uaW5nIHBhdGggY29tcGxldGVseSAgKi8KLS8qICAgICAgICAgICAgICAgICAgICAgICAgICAgYWNjb3JkaW5nIHRvIHRoZSBwc2V1ZG8gY29kZXMgaW4gTVBFRy00ICAgICAgICAqLwotLyogICAgICAgICAgICAgICAgICAgICAgICAgICBzdGFuZGFyZC4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgTW9kaWZpZWQgOiAwOS8xOC8yMDAwIGFkZCBmYXN0IFZsY0RlY29kZStEZXF1YW50ICAgICAgICAgICAgICAgICAgICAqLwotLyogICAgICAgICAgICAgMDQvMTcvMjAwMSBjbGVhbnVwICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PSAqLwotUFZfU1RBVFVTIERlY29kZUZyYW1lRGF0YVBhcnRNb2RlKFZpZGVvRGVjRGF0YSAqdmlkZW8pCi17Ci0gICAgUFZfU1RBVFVTIHN0YXR1czsKLSAgICBWb3AgKmN1cnJWb3AgPSB2aWRlby0+Y3VyclZvcDsKLSAgICBCaXRzdHJlYW1EZWNWaWRlbyAqc3RyZWFtID0gdmlkZW8tPmJpdHN0cmVhbTsKLQotICAgIGludCBuTUJQZXJSb3cgPSB2aWRlby0+bk1CUGVyUm93OwotCi0gICAgaW50IHZvcFR5cGUgPSBjdXJyVm9wLT5wcmVkaWN0aW9uVHlwZTsKLSAgICBpbnQgbWJudW07Ci0gICAgaW50IG5Ub3RhbE1CID0gdmlkZW8tPm5Ub3RhbE1COwotICAgIGludCBzbGljZV9jb3VudGVyOwotICAgIGludCByZXN5bmNfbWFya2VyX2xlbmd0aDsKLQotICAgIC8qIGNvcHkgYW5kIHBhZCB0byBwcmV2X1ZvcCBmb3IgSU5URVIgY29kaW5nICovCi0gICAgc3dpdGNoICh2b3BUeXBlKQotICAgIHsKLSAgICAgICAgY2FzZSBJX1ZPU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zLzIwMDAgICAgICAqLwotICAgICAgICB2aWRlby0+bWJudW0gPSBtYm51bTsKLSAgICAgICAgdmlkZW8tPm1ibnVtX3JvdyA9IFBWX0dFVF9ST1cobWJudW0sIG5NQlBlclJvdyk7ICAgLyogIFRoaXMgaXMgbmVlZGVkIGlmIG5ibnVtIGlzIHJlYWQgZnJvbSB0aGUgcGFja2V0IGhlYWRlciAqLwotICAgICAgICB2aWRlby0+bWJudW1fY29sID0gbWJudW0gLSB2aWRlby0+bWJudW1fcm93ICogbk1CUGVyUm93OwotCi0gICAgICAgIHN3aXRjaCAodm9wVHlwZSkKLSAgICAgICAgewotICAgICAgICAgICAgY2FzZSBJX1ZPUCA6Ci0gICAgICAgICAgICAgICAgc3RhdHVzID0gRGVjb2RlRGF0YVBhcnRfSV9WaWRlb1BhY2tldCh2aWRlbywgc2xpY2VfY291bnRlcik7Ci0gICAgICAgICAgICAgICAgYnJlYWs7Ci0KLSAgICAgICAgICAgIGNhc2UgUF9WT1AgOgotICAgICAgICAgICAgICAgIHN0YXR1cyA9IERlY29kZURhdGFQYXJ0X1BfVmlkZW9QYWNrZXQodmlkZW8sIHNsaWNlX2NvdW50ZXIpOwotICAgICAgICAgICAgICAgIGJyZWFrOwotCi0gICAgICAgICAgICBkZWZhdWx0IDoKLSAgICAgICAgICAgICAgICBtcDRkZWNfbG9nKCJEZWNvZGVGcmFtZURhdGFQYXJ0TW9kZSgpOiBWb3AgdHlwZSBub3Qgc3VwcG9ydGVkLlxuIik7Ci0gICAgICAgICAgICAgICAgcmV0dXJuIFBWX0ZBSUw7Ci0gICAgICAgIH0KLQotICAgICAgICB3aGlsZSAoKHN0YXR1cyA9IFBWX1JlYWRWaWRlb1BhY2tldEhlYWRlcih2aWRlbywgJm1ibnVtKSkgPT0gUFZfRkFJTCkKLSAgICAgICAgewotICAgICAgICAgICAgaWYgKChzdGF0dXMgPSBxdWlja1NlYXJjaFZpZGVvUGFja2V0SGVhZGVyKHN0cmVhbSwgcmVzeW5jX21hcmtlcl9sZW5ndGgpKSAhPSBQVl9TVUNDRVNTKQotICAgICAgICAgICAgewotICAgICAgICAgICAgICAgIGJyZWFrOwotICAgICAgICAgICAgfQotICAgICAgICB9Ci0KLSAgICAgICAgaWYgKHN0YXR1cyA9PSBQVl9FTkRfT0ZfVk9QKQotICAgICAgICB7Ci0gICAgICAgICAgICBtYm51bSA9IG5Ub3RhbE1COwotICAgICAgICB9Ci0KLSAgICAgICAgaWYgKG1ibnVtID4gdmlkZW8tPm1ibnVtICsgMSkKLSAgICAgICAgewotICAgICAgICAgICAgQ29uY2VhbFBhY2tldCh2aWRlbywgdmlkZW8tPm1ibnVtLCBtYm51bSwgc2xpY2VfY291bnRlcik7Ci0gICAgICAgIH0KLSAgICAgICAgc2xpY2VfY291bnRlcisrOwotICAgICAgICBpZiAobWJudW0gPj0gblRvdGFsTUIpCi0gICAgICAgIHsKLSAgICAgICAgICAgIGJyZWFrOwotICAgICAgICB9Ci0KLQotICAgIH0KLSAgICB3aGlsZSAoVFJVRSk7Ci0KLSAgICByZXR1cm4gUFZfU1VDQ0VTUzsKLX0KLQotCi0vKiA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0gKi8KLS8qICBGdW5jdGlvbiA6IERlY29kZURhdGFQYXJ0X0lfVmlkZW9QYWNrZXQoKSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogIERhdGUgICAgIDogMDQvMjUvMjAwMCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgUHVycG9zZSAgOiBEZWNvZGUgRGF0YSBQYXJ0aXRpb25lZCBNb2RlIFZpZGVvIFBhY2tldCBpbiBJLVZPUCAgICAgICAgICAgKi8KLS8qICBJbi9vdXQgICA6ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogI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otICAgICAgICAgICAgLyogUmVwb3J0IHRoZSBlcnJvciB0byB0aGUgYXBwbGljYXRpb24uICAgMDYvMjAvMjAwMCAqLwotICAgICAgICAgICAgVmlkZW9EZWNvZGVyRXJyb3JEZXRlY3RlZCh2aWRlbyk7Ci0gICAgICAgICAgICB2aWRlby0+bWJudW0gPSBtYl9zdGFydDsKLSAgICAgICAgICAgIG1vdmVQb2ludGVyVG8oc3RyZWFtLCBzdGFydEZpcnN0UGFydCk7Ci0gICAgICAgICAgICByZXR1cm4gUFZfRkFJTDsKLSAgICAgICAgfQotCi0gICAgICAgIHZpZGVvLT5zbGljZU5vW21ibnVtXSA9ICh1aW50OCkgc2xpY2VfY291bnRlcjsKLSAgICAgICAgUVBNQlttYm51bV0gPSBRUDsKLSAgICAgICAgdmlkZW8tPm1ibnVtID0gKyttYm51bTsKLQotICAgICAgICBCaXRzdHJlYW1TaG93Qml0czE2KHN0cmVhbSwgOSwgJmNvZGUpOwotICAgICAgICB3aGlsZSAoY29kZSA9PSAxKQotICAgICAgICB7Ci0gICAgICAgICAgICBQVl9CaXRzdHJlYW1GbHVzaEJpdHMoc3RyZWFtLCA5KTsKLSAgICAgICAgICAgIEJpdHN0cmVhbVNob3dCaXRzMTYoc3RyZWFtLCA5LCAmY29kZSk7Ci0gICAgICAgIH0KLSAgICAgICAgLyogaGF2ZSB3ZSByZWFjaGVkIHRoZSBlbmQgb2YgdGhlIHZpZGVvIHBhY2tldCBvciB2b3A/ICovCi0gICAgICAgIHN0YXR1cyA9IEJpdHN0cmVhbVNob3dCaXRzMzIoc3RyZWFtLCBEQ19NQVJLRVJfTEVOR1RILCAmdG1wdmFyKTsKLQotICAgIH0KLSAgICB3aGlsZSAodG1wdmFyICE9IERDX01BUktFUiAmJiB2aWRlby0+bWJudW0gPCBuVG90YWxNQik7Ci0KLSAgICBpZiAodG1wdmFyID09IERDX01BUktFUikKLSAgICB7Ci0gICAgICAgIFBWX0JpdHN0cmVhbUZsdXNoQml0cyhzdHJl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gICA6IDA0LzI1LzIwMDAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogIFB1cnBvc2UgIDogRGVjb2RlIERhdGEgUGFydGl0aW9uZWQgTW9kZSBWaWRlbyBQYWNrZXQgaW4gUC1WT1AgICAgICAgICAgICovCi0vKiAgSW4vb3V0ICAgOiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICBSZXR1cm4gICA6IFBWX1NVQ0NFU1MgaWYgc3VjY2Vzc2VkLCBQVl9GQUlMIGlmIGZhaWxlZC4gICAgICAgICAgICAgICAgICAqLwotLyogIE1vZGlmaWVkIDogICAwOS8xOC8yMDAwLCAgZmFzdCBWbGNEZWNvZGUrRGVxdWFudCAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgICAgICAgICAgICAgMDQvMTMvMjAwMSwgIGZpeGVkIE1CX3N0dWZmaW5nLCBuZXcgQUNEQyBwcmVkIHN0cnVjdHVyZSwgICovCi0vKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNsZWFudXAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICAgICAgICAgICAgICAwOC8wNy8yMDAxLCAgcmVtb3ZlIE1CemVybyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0gKi8KLVBWX1NUQVRVUyBEZWNvZGVEYXRhUGFydF9QX1ZpZGVvUGFja2V0KFZpZGVvRGVjRGF0YSAqdmlkZW8sIGludCBzbGljZV9jb3VudGVyKQotewotICAgIFBWX1NUQVRVUyBzdGF0dXM7Ci0gICAgdWludDggKk1vZGUgPSB2aWRlby0+aGVhZGVySW5mby5Nb2RlOwotICAgIEJpdHN0cmVhbURlY1ZpZGVvICpzdHJlYW0g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gcmV0dXJuIHN0YXR1czsKLSAgICAgICAgfQotICAgICAgICB2aWRlby0+dXNlUHJldlFQID0gMTsgICAgICAgIC8qICAwNC8yNy8wMSAqLwotICAgICAgICBRUE1CW21ibnVtXSA9IFFQOwotICAgIH0KLQotICAgIHZpZGVvLT51c2VQcmV2UVAgPSAwOyAgLyogIDA0LzI3LzAxICovCi0KLSAgICBmb3IgKG1ibnVtID0gbWJfc3RhcnQ7IG1ibnVtIDwgbWJfZW5kOyBtYm51bSsrKQotICAgIHsKLSAgICAgICAgdmlkZW8tPm1ibnVtID0gbWJudW07Ci0gICAgICAgIHZpZGVvLT5tYm51bV9yb3cgPSBQVl9HRVRfUk9XKG1ibnVtLCBuTUJQZXJSb3cpOyAgLyogIFRoaXMgaXMgbmVlZGVkIGlmIG5ibnVtIGlzIHJlYWQgZnJvbSB0aGUgcGFja2V0IGhlYWRlciAqLwotICAgICAgICB2aWRlby0+bWJudW1fY29sID0gbWJudW0gLSB2aWRlby0+bWJudW1fcm93ICogbk1CUGVyUm93OwotCi0KLSAgICAgICAgaWYgKE1vZGVbbWJudW1dICE9IE1PREVfU0tJUFBFRCkKLSAgICAgICAgewotICAgICAgICAgICAgLyogZGVjb2RlIHRoZSBEQ1QgY29lZmljaWVudHMgZm9yIHRoZSBNQiAqLwotICAgICAgICAgICAgc3RhdHVzID0gR2V0TUJEYXRhX0RhdGFQYXJ0KHZpZGVvKTsKLSAgICAgICAgICAgIGlmIChzdGF0dXMgIT0gUFZfU1VDQ0VTUykKLSAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAvKiBSZXBvcnQgdGhlIGVycm9yIHRvIHRoZSBhcHBsaWNhdGlvbi4gICAwNi8yMC8yMDAwICovCi0gICAgICAgICAgICAgICAgVmlkZW9EZWNvZGVyRXJyb3JEZXRlY3RlZCh2aWRlbyk7Ci0KLSAgICAgICAgICAgICAgICAvKiBDb25jZWFsIHNlY29uZCBwYXJ0aXRpb24sICA1LzE1LzIwMDAgKi8KLSAgICAgICAgICAgICAgICBtb3ZlUG9pbnRlclRvKHN0cmVhbSwgc3RhcnRTZWNvbmRQYXJ0KTsKLSAgICAgICAgICAgICAgICBDb25jZWFsVGV4dHVyZV9QKHZpZGVvLCBtYl9zdGFydCwgbWJfZW5kLCBzbGljZV9jb3VudGVyKTsKLSAgICAgICAgICAgICAgICByZXR1cm4gc3RhdHVzOwotICAgICAgICAgICAgfQotICAgICAgICAgICAgdmlkZW8tPnVzZVByZXZRUCA9IDE7ICAvKiAgMDQvMjcvMDEgKi8KLSAgICAgICAgfQotICAgICAgICBlbHNlCi0gICAgICAgIHsgICAvLyBTS0lQUEVECi0KLSAgICAgICAgICAgIC8qIE1vdGlvbiBjb21wZW5zYXRpb24gYW5kIHB1dCBpdCB0byB2aWRlby0+bWJsb2NrLT5wcmVkX2Jsb2NrICovCi0gICAgICAgICAgICBTa2lwcGVkTUJNb3Rpb25Db21wKHZpZGVvKTsKLQotICAgICAgICAgICAgLy9vc2NsX21lbXNldCh2aWRlby0+cHJlZERDQUNfcm93ICsgdmlkZW8tPm1ibnVtX2NvbCwgMCwgc2l6ZW9mKHR5cGVEQ0FDU3RvcmUpKTsgLyogIFNLSVBQRURfQUNEQyAqLwotICAgICAgICAgICAgLy9vc2NsX21lbXNldCh2aWRlby0+cHJlZERDQUNfY29sLCAwLCBzaXplb2YodHlwZURDQUNTdG9yZSkpOwotICAgICAgICAgICAgLyogIDA4LzA4LzIwMDUgKi8KLSAgICAgICAgICAgIHBieXRlID0gKHVpbnQ4KikodmlkZW8tPnByZWREQ0FDX3JvdyArIHZpZGVvLT5tYm51bV9jb2wpOwotICAgICAgICAgICAgWkVST19PVVRfNjRCWVRFUyhwYnl0ZSk7Ci0gICAgICAgICAgICBwYnl0ZSA9ICh1aW50OCopKHZpZGVvLT5wcmVkRENBQ19jb2wpOwotICAgICAgICAgICAgWkVST19PVVRfNjRCWVRFUyhwYnl0ZSk7Ci0KLSAgICAgICAgfQotICAgIH0KLQotICAgIHZhbGlkX3N0dWZmaW5nID0gdmFsaWRTdHVmZmluZyhzdHJlYW0pOyAgIC8qICAqLwotICAgIGlmICghdmFsaWRfc3R1ZmZpbmcpCi0gICAgewotICAgICAgICBWaWRlb0RlY29kZXJFcnJvckRldGVjdGVkKHZpZGVvKTsKLSAgICAgICAgbW92ZVBvaW50ZXJUbyhzdHJlYW0sIHN0YXJ0U2Vjb25kUGFydCk7IC8qICAqLwotICAgICAgICBDb25jZWFsVGV4dHVyZV9QKHZpZGVvLCBtYl9zdGFydCwgbWJfZW5kLCBzbGljZV9jb3VudGVyKTsKLQotICAgICAgICByZXR1cm4gUFZfRkFJTDsKLSAgICB9Ci0gICAgcmV0dXJuIFBWX1NVQ0NFU1M7Ci19Ci0KLQotLyogPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09ICovCi0vKiAgRnVuY3Rpb24gOiBHZXRNQmhlYWRlckRhdGFQYXJ0X0RRVUFOVF9EQygpICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICBEYXRlICAgICA6IDA0LzI2LzIwMDAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogIFB1cnBvc2UgIDogRGVjb2RlIERRVUFOVCBhbmQgREMgaW4gRGF0YSBQYXJ0aXRpb25lZCBNb2RlIGZvciBib3RoICAgICAgICovCi0vKiAgICAgICAgICAgICBJLVZPUCBhbmQgUC1WT1AuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICBJbi9vdXQgICA6ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogIFJldHVybiAgIDogUFZfU1VDQ0VTUyBpZiBzdWNjZXNzZWQsIFBWX0ZBSUwgaWYgZmFpbGVkLiAgICAgICAgICAgICAgICAgICovCi0vKiAgTW9kaWZpZWQgOiAwMi8xMy8yMDAxIG5ldyBBQ0RDIHByZWRpY3Rpb24gc3RydWN0dXJlLCAgICAgICAgKi8KLS8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY2xlYW51cCAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09ICovCi1QVl9TVEFUVVMgR2V0TUJoZWFkZXJEYXRhUGFydF9EUVVBTlRfREMoVmlkZW9EZWNEYXRhICp2aWRlbywgaW50MTYgKlFQKQotewotICAgIFBWX1NUQVRVUyBzdGF0dXMgPSBQVl9TVUNDRVNTOwotICAgIEJpdHN0cmVhbURlY1ZpZGVvICpzdHJlYW0gPSB2aWRlby0+Yml0c3RyZWFtOwotICAgIGludCBtYm51bSA9IHZpZGVvLT5tYm51bTsKLSAgICBpbnQgaW50cmFfZGNfdmxjX3RociA9IHZpZGVvLT5jdXJyVm9wLT5pbnRyYURDVmxjVGhyOwotICAgIHVpbnQ4ICpNb2RlID0gdmlkZW8tPmhlYWRlckluZm8uTW9kZTsKLSAgICBpbnQgIE1CdHlwZSA9IE1vZGVbbWJudW1dOwotICAgIHR5cGVEQ1N0b3JlICpEQyA9IHZpZGVvLT5wcmVkREMgKyBtYm51bTsKLSAgICBpbnQgIGNvbXA7Ci0gICAgQm9vbCBzd2l0Y2hlZDsKLSAgICB1aW50ICBEUVVBTlQ7Ci0gICAgaW50MTYgUVBfdG1wOwotCi0gICAgY29uc3Qgc3RhdGljIGludCAgRFFfdGFiWzRdID0geyAtMSwgLTIsIDEsIDJ9OwotCi0gICAgaWYgKE1CdHlwZSAmIFFfTUFTSykgICAgICAgICAgICAgLyogSU5UUkFfUSB8fCBJTlRFUl9RICovCi0gICAgewotICAgICAgICBEUVVBTlQgPSBCaXRzdHJlYW1SZWFkQml0czE2KHN0cmVhbSwgMik7Ci0gICAgICAgICpRUCArPSBEUV90YWJbRFFVQU5UXTsKLQotICAgICAgICBpZiAoKlFQIDwgMSkgKlFQID0gMTsKLSAgICAgICAgZWxzZSBpZiAoKlFQID4gMzEpICpRUCA9IDMxOwotICAgIH0KLSAgICBpZiAoTUJ0eXBlICYgSU5UUkFfTUFTSykgIC8qIElOVFJBIHx8IElOVFJBX1EgKi8gLyogbm8gc3dpdGNoLCBjb2RlIERDIHNlcGFyYXRlbHkgKi8KLSAgICB7Ci0gICAgICAgIFFQX3RtcCA9ICpRUDsgICAgICAgICAgICAgICAgICAgICAgLyogcnVubmluZyBRUCAgMDQvMjYvMDEqLwotICAgICAgICBzd2l0Y2hlZCA9IDA7Ci0gICAgICAgIGlmIChpbnRyYV9kY192bGNfdGhyKSAgICAgICAgICAgICAgICAgLyogIDA0LzI3LzAxICovCi0gICAgICAgIHsKLSAgICAgICAgICAgIGlmICh2aWRlby0+dXNlUHJldlFQKQotICAgICAgICAgICAgICAgIFFQX3RtcCA9IHZpZGVvLT5RUE1CW21ibnVtLTFdOwotICAgICAgICAgICAgc3dpdGNoZWQgPSAoaW50cmFfZGNfdmxjX3RociA9PSA3IHx8IFFQX3RtcCA+PSBpbnRyYV9kY192bGNfdGhyICogMiArIDExKTsKLSAgICAgICAgfQotICAgICAgICBpZiAoIXN3aXRjaGVkKQotICAgICAgICB7Ci0gICAgICAgICAgICBmb3IgKGNvbXAgPSAwOyBjb21wIDwgNjsgY29tcCsrKQotICAgICAgICAgICAgewotICAgICAgICAgICAgICAgIHN0YXR1cyA9IFBWX0RlY29kZVByZWRpY3RlZEludHJhREMoY29tcCwgc3RyZWFtLCAoKkRDICsgY29tcCkpOyAgIC8qICAwMy8wMS8wMSAqLwotICAgICAgICAgICAgICAgIGlmIChzdGF0dXMgIT0gUFZfU1VDQ0VTUykgcmV0dXJuIFBWX0ZBSUw7Ci0gICAgICAgICAgICB9Ci0gICAgICAgIH0KLSAgICAgICAgZWxzZQotICAgICAgICB7Ci0gICAgICAgICAgICBmb3IgKGNvbXAgPSAwOyBjb21wIDwgNjsgY29tcCsrKQotICAgICAgICAgICAgewotICAgICAgICAgICAgICAgICgqREMpW2NvbXBdID0gMDsgICAvKiAgMDQvMjYvMDEgbmVlZGVkIGZvciBzd2l0Y2hlZCBjYXNlKi8KLSAgICAgICAgICAgIH0KLSAgICAgICAgfQotICAgIH0KLSAgICByZXR1cm4gc3RhdHVzOwotfQotCi0KLS8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKkNvbW1lbnRCZWdpbioqKioqKgotKiAgICAgICAwNC8yNS8yMDAwIDogSW5pdGlhbCBtb2RpZmljYXRpb24gdG8gdGhlIG5ldyBQViBMaWIgZm9ybWF0LgotKiAgICAgICAwNC8xNy8yMDAxIDogbmV3IEFDREMgcHJlZCBzdHJ1Y3R1cmUKLSoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqQ29tbWVudEVuZCoqKioqKioqLwotUFZfU1RBVFVTIEdldE1CaGVhZGVyRGF0YVBhcnRfUChWaWRlb0RlY0RhdGEgKnZpZGVvKQotewotICAgIEJpdHN0cmVhbURlY1ZpZGVvICpzdHJlYW0gPSB2aWRlby0+Yml0c3RyZWFtOwotICAgIGludCBtYm51bSA9IHZpZGVvLT5tYm51bTsKLSAgICB1aW50OCAqTW9kZSA9IHZpZGVvLT5oZWFkZXJJbmZvLk1vZGU7Ci0gICAgdHlwZURDU3RvcmUgKkRDID0gdmlkZW8tPnByZWREQyArIG1ibnVtOwotICAgIHVpbnQgbm9fZGN0X2ZsYWc7Ci0gICAgaW50IGNvbXA7Ci0gICAgaW50IE1DQlBDOwotCi0gICAgbm9fZGN0X2ZsYWcgPSBCaXRzdHJlYW1SZWFkMUJpdHNfSU5MSU5FKHN0cmVhbSk7Ci0KLSAgICBpZiAobm9fZGN0X2ZsYWcpCi0gICAgewotICAgICAgICAvKiBza2lwcGVkIG1hY3JvYmxvY2sgKi8KLSAgICAgICAgTW9kZVttYm51bV0gPSBNT0RFX1NLSVBQRUQ7Ci0KLSAgICAgICAgZm9yIChjb21wID0gMDsgY29tcCA8IDY7IGNvbXArKykKLSAgICAgICAgewotICAgICAgICAgICAgKCpEQylbY29tcF0gPSBtaWRfZ3JheTsKLSAgICAgICAgICAgIC8qICBBQ0RDIFJFTU9WRSBBQyBjb2VmcyBhcmUgc2V0IGluIERlY29kZURhdGFQYXJ0X1AgKi8KLSAgICAgICAgfQotICAgIH0KLSAgICBlbHNlCi0gICAgewotICAgICAgICAvKiBjb2RlZCBtYWNyb2Jsb2NrICovCi0gICAgICAgIE1DQlBDID0gUFZfVmxjRGVjTUNCUENfY29tX2ludGVyKHN0cmVhbSk7Ci0KLSAgICAgICAgaWYgKFZMQ19FUlJPUl9ERVRFQ1RFRChNQ0JQQykpCi0gICAgICAgIHsKLSAgICAgICAgICAgIHJldHVybiBQVl9GQUlMOwotICAgICAgICB9Ci0KLSAgICAgICAgTW9kZVttYm51bV0gPSAodWludDgpTUJ0eXBlX21vZGVbTUNCUEMgJiA3XTsKLSAgICAgICAgdmlkZW8tPmhlYWRlckluZm8uQ0JQW21ibnVtXSA9ICh1aW50OCkoKE1DQlBDID4+IDQpICYgMyk7Ci0gICAgfQotCi0gICAgcmV0dXJuIFBWX1NVQ0NFU1M7Ci19Ci0KLQotLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqQ29tbWVudEJlZ2luKioqKioqCi0qICAgICAgIDA0LzE3LzAxICBuZXcgQUNEQyBwcmVkIHN0cnVjdHVyZSwgcmVvcmdhbml6ZWQgY29kZSwgY2xlYW51cAotKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKipDb21tZW50RW5kKioqKioqKiovCi1QVl9TVEFUVVMgR2V0TUJEYXRhX0RhdGFQYXJ0KFZpZGVvRGVjRGF0YSAqdmlkZW8pCi17Ci0gIC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gKHZpZGVvLT5wb3N0RmlsdGVyVHlwZSAhPSBQVl9OT19QT1NUX1BST0MpCi0gICAgewotICAgICAgICAvKiogcG9zdC1wcm9jZXNzaW5nICoqKi8KLSAgICAgICAgcHBfbW9kWzBdID0gdmlkZW8tPnBzdHByY1R5cEN1ciArICh5X3BvcyA8PCAxKSAqIChNQl9pbl93aWR0aCA8PCAxKSArICh4X3BvcyA8PCAxKTsKLSAgICAgICAgcHBfbW9kWzFdID0gcHBfbW9kWzBdICsgMTsKLSAgICAgICAgcHBfbW9kWzJdID0gcHBfbW9kWzBdICsgKE1CX2luX3dpZHRoIDw8IDEpOwotICAgICAgICBwcF9tb2RbM10gPSBwcF9tb2RbMl0gKyAxOwotICAgICAgICBwcF9tb2RbNF0gPSB2aWRlby0+cHN0cHJjVHlwQ3VyICsgKFRvdGFsTUIgPDwgMikgKyBtYm51bTsKLSAgICAgICAgcHBfbW9kWzVdID0gcHBfbW9kWzRdICsgVG90YWxNQjsKLSAgICB9Ci0jZW5kaWYKLQotICAgIC8qICBvc2NsX21lbXNldChtYmxvY2stPmJsb2NrLCAwLCBzaXplb2YodHlwZU1CU3RvcmUpKTsgICAgQXVnIDksMjAwNSAqLwotCi0gICAgaWYgKG1vZGUgJiBJTlRSQV9NQVNLKSAvKiBNT0RFX0lOVFJBIHx8IG1vZGUgPT0gTU9ERV9JTlRSQV9RICovCi0gICAgewotICAgICAgICBzd2l0Y2hlZCA9IDA7Ci0gICAgICAgIGlmIChpbnRyYV9kY192bGNfdGhyKQotICAgICAgICB7Ci0gICAgICAgICAgICBpZiAodmlkZW8tPnVzZVByZXZRUCkKLSAgICAgICAgICAgICAgICBRUF90bXAgPSB2aWRlby0+UVBNQlttYm51bS0xXTsgICAvKiBydW5uaW5nIFFQICAwNC8yNi8wMSAqLwotCi0gICAgICAgICAgICBzd2l0Y2hlZCA9IChpbnRyYV9kY192bGNfdGhyID09IDcgfHwgUVBfdG1wID49IGludHJhX2RjX3ZsY190aHIgKiAyICsgMTEpOwotICAgICAgICB9Ci0KLSAgICAgICAgbWJsb2NrLT5EQ1NjYWxhckx1bSA9IGNhbF9kY19zY2FsZXIoUVAsIExVTUlOQU5DRV9EQ19UWVBFKTsgICAgIC8qICAgQUNEQyAwMy8wMS8wMSAqLwotICAgICAgICBtYmxvY2stPkRDU2NhbGFyQ2hyID0gY2FsX2RjX3NjYWxlcihRUCwgQ0hST01JTkFOQ0VfRENfVFlQRSk7Ci0KLSAgICAgICAgZm9yIChjb21wID0gMDsgY29tcCA8IDY7IGNvbXArKykKLSAgICAgICAgewotICAgICAgICAgICAgZGF0YUJsb2NrID0gbWJsb2NrLT5ibG9ja1tjb21wXTsgICAgLyosIDEwLzIwLzIwMDAgKi8KLQotICAgICAgICAgICAgZGF0YUJsb2NrWzBdID0gKCpEQylbY29tcF07Ci0KLSAgICAgICAgICAgIG5jb2VmZnNbY29tcF0gPSBWbGNEZXF1YW50SDI2M0ludHJhQmxvY2sodmlkZW8sIGNvbXAsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgc3dpdGNoZWQsIG1ibG9jay0+Yml0bWFwY29sW2NvbXBdLCAmbWJsb2NrLT5iaXRtYXByb3dbY29tcF0pOwotCi0gICAgICAgICAgICBpZiAoVkxDX0VSUk9SX0RFVEVDVEVEKG5jb2VmZnNbY29tcF0pKSAgICAgICAgIC8qICAqLwotICAgICAgICAgICAgewotICAgICAgICAgICAgICAgIGlmIChzd2l0Y2hlZCkKLSAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFBWX0ZBSUw7Ci0gICAgICAgICAgICAgICAgZWxzZQotICAgICAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAgICAgbmNvZWZmc1tjb21wXSA9IDE7Ci0gICAgICAgICAgICAgICAgICAgIG9zY2xfbWVtc2V0KChkYXRhQmxvY2sgKyAxKSwgMCwgc2l6ZW9mKGludDE2KSo2Myk7Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgfQotICAgICAgICAgICAgbm9fY29lZmZbY29tcF0gPSBuY29lZmZzW2NvbXBdOwotICAgICAgICAgICAgLyogIG1vZGlmaWVkIHRvIG5ldyBzZW1hcGhvcmUgZm9yIHBvc3QtcHJvYyAqLwotICAgICAgICAgICAgLy8gRnV0dXJlIHdvcms6OiBjYW4gYmUgY29tYmluZWQgaW4gdGhlIGRlcXVhbnQgZnVuY3Rpb24KLSAgICAgICAgICAgIC8vIEB0b2RvIERlYmxvY2tpbmcgU2VtYXBob3JlIGZvciBJTlRSQSBibG9jawotI2lmZGVmIFBWX1BPU1RQUk9DX09OCi0gICAgICAgICAgICBpZiAodmlkZW8tPnBvc3RGaWx0ZXJUeXBlICE9IFBWX05PX1BPU1RfUFJPQykKLSAgICAgICAgICAgICAgICAqcHBfbW9kW2NvbXBdID0gKHVpbnQ4KSBQb3N0UHJvY1NlbWFwaG9yZShkYXRhQmxvY2spOwotI2VuZGlmCi0gICAgICAgIH0KLSAgICAgICAgTUJsb2NrSURDVCh2aWRlbyk7Ci0gICAgfQotICAgIGVsc2UgLyogTU9ERSBJTlRFUiovCi0gICAgewotCi0KLQotCi0gICAgICAgIE1CTW90aW9uQ29tcCh2aWRlbywgQ0JQKTsKLSAgICAgICAgb2Zmc2V0ID0gKGludDMyKSh5X3BvcyA8PCA0KSAqIHdpZHRoICsgKHhfcG9zIDw8IDQpOwotICAgICAgICBjX2NvbXAgID0gdmlkZW8tPmN1cnJWb3AtPnlDaGFuICsgb2Zmc2V0OwotCi0KLSAgICAgICAgZm9yIChjb21wID0gMDsgY29tcCA8IDQ7IGNvbXArKykKLSAgICAgICAgewotICAgICAgICAgICAgKCpEQylbY29tcF0gPSBtaWRfZ3JheTsKLQotICAgICAgICAgICAgaWYgKENCUCAmICgxIDw8ICg1IC0gY29tcCkpKQotICAgICAgICAgICAgewotICAgICAgICAgICAgICAgIG5jb2VmZnNbY29tcF0gPSBWbGNEZXF1YW50SDI2M0ludGVyQmxvY2sodmlkZW8sIGNvbXAsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1ibG9jay0+Yml0bWFwY29sW2NvbXBdLCAmbWJsb2NrLT5iaXRtYXByb3dbY29tcF0pOwotICAgICAgICAgICAgICAgIGlmIChWTENfRVJST1JfREVURUNURUQobmNvZWZmc1tjb21wXSkpCi0gICAgICAgICAgICAgICAgICAgIHJldHVybiBQVl9GQUlMOwotCi0KLSAgICAgICAgICAgICAgICBCbG9ja0lEQ1QoY19jb21wICsgKGNvbXAmMikqKHdpZHRoIDw8IDIpICsgOCooY29tcCYxKSwgbWJsb2NrLT5wcmVkX2Jsb2NrICsgKGNvbXAmMikqNjQgKyA4Kihjb21wJjEpLCBtYmxvY2stPmJsb2NrW2NvbXBdLCB3aWR0aCwgbmNvZWZmc1tjb21wXSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgbWJsb2NrLT5iaXRtYXBjb2xbY29tcF0sIG1ibG9jay0+Yml0bWFwcm93W2NvbXBdKTsKLQotICAgICAgICAgICAgfQotICAgICAgICAgICAgZWxzZQotICAgICAgICAgICAgewotICAgICAgICAgICAgICAgIG5jb2VmZnNbY29tcF0gPSAwOwotICAgICAgICAgICAgfQotCi0gICAgICAgICAgICAvKiAgQHRvZG8gRGVibG9ja2luZyBTZW1hcGhvcmUgZm9yIElOVFJBIGJsb2NrLCBmb3IgaW50ZXIganVzdCB0ZXN0IGZvciByaW5naW5nICAqLwotI2lmZGVmIFBWX1BPU1RQUk9DX09OCi0gICAgICAgICAgICBpZiAodmlkZW8tPnBvc3RGaWx0ZXJUeXBlICE9IFBWX05PX1BPU1RfUFJPQykKLSAgICAgICAgICAgICAgICAqcHBfbW9kW2NvbXBdID0gKHVpbnQ4KSgobmNvZWZmc1tjb21wXSA+IDMpID8gNCA6IDApOwotI2VuZGlmCi0gICAgICAgIH0KLQotICAgICAgICAoKkRDKVs0XSA9IG1pZF9ncmF5OwotICAgICAgICBpZiAoQ0JQICYgMikKLSAgICAgICAgewotICAgICAgICAgICAgbmNvZWZmc1s0XSA9IFZsY0RlcXVhbnRIMjYzSW50ZXJCbG9jayh2aWRlbywgNCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbWJsb2NrLT5iaXRtYXBjb2xbNF0sICZtYmxvY2stPmJpdG1hcHJvd1s0XSk7Ci0gICAgICAgICAgICBpZiAoVkxDX0VSUk9SX0RFVEVDVEVEKG5jb2VmZnNbNF0pKQotICAgICAgICAgICAgICAgIHJldHVybiBQVl9GQUlMOwotCi0gICAgICAgICAgICBCbG9ja0lEQ1QodmlkZW8tPmN1cnJWb3AtPnVDaGFuICsgKG9mZnNldCA+PiAyKSArICh4X3BvcyA8PCAyKSwgbWJsb2NrLT5wcmVkX2Jsb2NrICsgMjU2LCBtYmxvY2stPmJsb2NrWzRdLCB3aWR0aCA+PiAxLCBuY29lZmZzWzRdLAotICAgICAgICAgICAgICAgICAgICAgIG1ibG9jay0+Yml0bWFwY29sWzRdLCBtYmxvY2stPmJpdG1hcHJvd1s0XSk7Ci0KLSAgICAgICAgfQotICAgICAgICBlbHNlCi0gICAgICAgIHsKLSAgICAgICAgICAgIG5jb2VmZnNbNF0gPSAwOwotICAgICAgICB9Ci0jaWZkZWYgUFZfUE9TVFBST0NfT04KLSAgICAgICAgaWYgKHZpZGVvLT5wb3N0RmlsdGVyVHlwZSAhPSBQVl9OT19QT1NUX1BST0MpCi0gICAgICAgICAgICAqcHBfbW9kWzRdID0gKHVpbnQ4KSgobmNvZWZmc1s0XSA+IDMpID8gNCA6IDApOwotI2VuZGlmCi0gICAgICAgICgqREMpWzVdID0gbWlkX2dyYXk7Ci0gICAgICAgIGlmIChDQlAgJiAxKQotICAgICAgICB7Ci0gICAgICAgICAgICBuY29lZmZzWzVdID0gVmxjRGVxdWFudEgyNjNJbnRlckJsb2NrKHZpZGVvLCA1LAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBtYmxvY2stPmJpdG1hcGNvbFs1XSwgJm1ibG9j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kKLSAgICAgICAgewotICAgICAgICAgICAgaWYgKGZsYWdfMSkKLSAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICBBQ190bXAgPSBEQ0FDX3Jvd1swXVtiX3h0YWJdOwotICAgICAgICAgICAgICAgIFFQX3RtcCA9IFFQX3N0b3JlW3lfb2Zmc2V0XTsKLSAgICAgICAgICAgICAgICBpZiAoUVBfdG1wID09IFFQKQotICAgICAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAgICAgZm9yIChpID0gMTsgaSA8IDg7IGkrKykKLSAgICAgICAgICAgICAgICAgICAgewotICAgICAgICAgICAgICAgICAgICAgICAgcV9ibG9ja1tpXSA9ICpBQ190bXArKzsKLSAgICAgICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICBlbHNlCi0gICAgICAgICAgICAgICAgewotICAgICAgICAgICAgICAgICAgICBmb3IgKGkgPSAxOyBpIDwgODsgaSsrKQotICAgICAgICAgICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgICAgICAgICB2YWwgPSAoaW50MzIpKCpBQ190bXArKykgKiBRUF90bXA7Ci0gICAgICAgICAgICAgICAgICAgICAgICBxX2Jsb2NrW2ldID0gKHZhbCA8IDApID8gKGludDE2KSgodmFsIC0gUVBfaGFsZikgLyBRUCkgOiAoaW50MTYpKCh2YWwgKyBRUF9oYWxmKSAvIFFQKTsKLSAgICAgICAgICAgICAgICAgICAgICAgIC8qIFZlcnRpY2FsLCB0b3AgUk9XIG9mIGJsb2NrIEMgKi8KLSAgICAgICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgIH0KLSAgICAgICAgfQotICAgIH0KLSAgICBlbHNlCi0gICAgewotICAgICAgICBEQ19wcmVkID0gYmxvY2tfQTsKLSAgICAgICAgKmRpcmVjdGlvbiA9IDA7Ci0gICAgICAgIGlmIChBQ3ByZWRfZmxhZyA9PSAxKQotICAgICAgICB7Ci0gICAgICAgICAgICBpZiAoZmxhZ18wKQotICAgICAgICAgICAgewotICAgICAgICAgICAgICAgIEFDX3RtcCA9IERDQUNfY29sWzBdW2JfeXRhYl07Ci0gICAgICAgICAgICAgICAgUVBfdG1wID0gUVBfc3RvcmVbeF9vZmZzZXRdOwotICAgICAgICAgICAgICAgIGlmIChRUF90bXAgPT0gUVApCi0gICAgICAgICAgICAgICAgewotICAgICAgICAgICAgICAgICAgICBmb3IgKGkgPSAxOyBpIDwgODsgaSsrKQotICAgICAgICAgICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgICAgICAgICBxX2Jsb2NrW2k8PDNdID0gKkFDX3RtcCsrOwotICAgICAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgIGVsc2UKLSAgICAgICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgICAgIGZvciAoaSA9IDE7IGkgPCA4OyBpKyspCi0gICAgICAgICAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAgICAgICAgIHZhbCA9IChpbnQzMikoKkFDX3RtcCsrKSAqIFFQX3RtcDsKLSAgICAgICAgICAgICAgICAgICAgICAgIHFfYmxvY2tbaTw8M10gPSAodmFsIDwgMCkgPyAoaW50MTYpKCh2YWwgLSBRUF9oYWxmKSAvIFFQKSA6IChpbnQxNikoKHZhbCArIFFQX2hhbGYpIC8gUVApOwotICAgICAgICAgICAgICAgICAgICAgICAgLyogVmVydGljYWwsIHRvcCBST1cgb2YgYmxvY2sgQyAqLwotICAgICAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgfQotICAgICAgICB9Ci0gICAgfQotCi0gICAgLyogTm93IHByZWRpY3QgdGhlIERDIGNvZWZmaWNpZW50ICovCi0gICAgUVBfdG1wID0gKGNvbXAgPCA0KSA/IHZpZGVvLT5tYmxvY2stPkRDU2NhbGFyTHVtIDogdmlkZW8tPm1ibG9jay0+RENTY2FsYXJDaHI7Ci0gICA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ICAgIGlmIChmbGFnXzEgPT0gVFJVRSkKLSAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICBxX2Jsb2NrWzBdID0gKGludDE2KSgoYmxvY2tfQSArIGJsb2NrX0MpID4+IDEpOwotICAgICAgICAgICAgfQotICAgICAgICAgICAgZWxzZQotICAgICAgICAgICAgewotICAgICAgICAgICAgICAgIHFfYmxvY2tbMF0gPSAoaW50MTYpYmxvY2tfQTsKLSAgICAgICAgICAgIH0KLSAgICAgICAgfQotICAgICAgICBlbHNlCi0gICAgICAgIHsKLSAgICAgICAgICAgIGlmIChmbGFnXzEgPT0gVFJVRSkKLSAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICBxX2Jsb2NrWzBdID0gKGludDE2KWJsb2NrX0M7Ci0gICAgICAgICAgICB9Ci0gICAgICAgICAgICBlbHNlCi0gICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgcV9ibG9ja1swXSA9IG1pZF9ncmF5OwotICAgICAgICAgICAgfQotICAgICAgICB9Ci0KLSAgICB9Ci0gICAgZWxzZQotICAgIHsKLSAgICAgICAgaWYgKHZpZGVvLT5tYmxvY2stPmRpcmVjdGlvbiA9PSAxKQotICAgICAgICB7Ci0gICAgICAgICAgICBpZiAoZmxhZ18xID09IFRSVUUpCi0gICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgcV9ibG9ja1swXSA9IChpbnQxNilibG9ja19DOwotCi0gICAgICAgICAgICAgICAgQUNfdG1wID0gRENBQ19yb3dbMF1bYl94dGFiXTsKLSAgICAgICAgICAgICAgICBxX2Jsb2NrWzFdID0gQUNfdG1wWzBdOwotICAgICAgICAgICAgICAgIHFfYmxvY2tbMl0gPSBBQ190bXBbMV07Ci0gICAgICAgICAgICAgICAgcV9ibG9ja1szXSA9IEFDX3RtcFsyXTsKLSAgICAgICAgICAgICAgICBxX2Jsb2NrWzRdID0gQUNfdG1wWzNdOwotICAgICAgICAgICAgICAgIHFfYmxvY2tbNV0gPSBBQ190bXBbNF07Ci0gICAgICAgICAgICAgICAgcV9ibG9ja1s2XSA9IEFDX3RtcFs1XTsKLSAgICAgICAgICAgICAgICBxX2Jsb2NrWzddID0gQUNfdG1wWzZdOwotICAgICAgICAgICAgfQotICAgICAgICAgICAgZWxzZQotICAgICAgICAgICAgewotICAgICAgICAgICAgICAgIHFfYmxvY2tbMF0gPSBtaWRfZ3JheTsKLSAgICAgICAgICAgIH0KLSAgICAgICAgfQotICAgICAgICBlbHNlCi0gICAgICAgIHsKLSAgICAgICAgICAgIGlmIChmbGFnXzAgPT0gVFJVRSkKLSAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICBxX2Jsb2NrWzBdID0gKGludDE2KWJsb2NrX0E7Ci0KLSAgICAgICAgICAgICAgICBBQ190bXAgPSBEQ0FDX2NvbFswXVtiX3l0YWJdOwotICAgICAgICAgICAgICAgIHFfYmxvY2tbOF0gPSBBQ190bXBbMF07Ci0gICAgICAgICAgICAgICAgcV9ibG9ja1sxNl0gPSBBQ190bXBbMV07Ci0gICAgICAgICAgICAgICAgcV9ibG9ja1syNF0gPSBBQ190bXBbMl07Ci0gICAgICAgICAgICAgICAgcV9ibG9ja1szMl0gPSBBQ190bXBbM107Ci0gICAgICAgICAgICAgICAgcV9ibG9ja1s0MF0gPSBBQ190bXBbNF07Ci0gICAgICAgICAgICAgICAgcV9ibG9ja1s0OF0gPSBBQ190bXBbNV07Ci0gICAgICAgICAgICAgICAgcV9ibG9ja1s1Nl0gPSBBQ190bXBbNl07Ci0gICAgICAgICAgICB9Ci0gICAgICAgICAgICBlbHNlCi0gICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgcV9ibG9ja1swXSA9IG1pZF9ncmF5OwotICAgICAgICAgICAgfQotICAgICAgICB9Ci0gICAgfQotICAgIC8qLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLQotICAgI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OyBGdW5jdGlvbiBib2R5IGhlcmUKLSAgICAtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tKi8KLSAgICAvKiBjaHJvbWluYW5jZSAqLwotICAgIC8qIERvIHRoZSBmaXJzdCBsaW5lICg3IHBpeGVscyBhdCBhIHRpbWUgPT4gRG9uJ3QgdXNlIE1NWCkqLwotICAgIGZvciAoaF9ibGsgPSAwOyBoX2JsayA8IHdpZHRoOyBoX2JsayArPSBCTEtTSVpFKQotICAgIHsKLSAgICAgICAgbWF4X2RpZmYgPSAoUVBfc3RvcmVbaF9ibGs+PjNdID4+IDIpICsgNDsKLSAgICAgICAgcHRyID0gJlJlY19DW2hfYmxrXTsKLSAgICAgICAgbWF4X2JsayA9IG1pbl9ibGsgPSAqcHRyOwotICAgICAgICBGaW5kTWF4TWluKHB0ciwgJm1pbl9ibGssICZtYXhfYmxrLCB3aWR0aCk7Ci0gICAgICAgIGgwID0gKChoX2JsayAtIDEpID49IDEpID8gKGhfYmxrIC0gMSkgOiAxOwotCi0gICAgICAgIGlmIChtYXhfYmxrIC0gbWluX2JsayA+PSA0KQotICAgICAgICB7Ci0gICAgICAgICAgICB0aHJlcyA9IChtYXhfYmxrICsgbWluX2JsayArIDEpID4+IDE7Ci0KLQotICAgICAgICAgICAgZm9yICh2X3BlbCA9IDE7IHZfcGVsIDwgQkxLU0laRSAtIDE7IHZfcGVsKyspCi0gICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgYWRkcl92ID0gKGludDMyKXZfcGVsICogd2lkdGg7Ci0gICAgICAgICAgICAgICAgcHRyID0gJlJlY19DW2FkZHJfdiArIGgwIC0gMV07Ci0gICAgICAgICAgICAgICAgcHRyMiA9ICZzdW1fdlswXTsKLSAgICAgICAgICAgICAgICBwdHIzID0gJnNpZ25fdlswXTsKLQotICAgICAgICAgICAgICAgIHBlbHUgPSAqKHB0ciAtIHdpZHRoKTsKLSAgICAgICAgICAgICAgICBwZWxjID0gKnB0cjsKLSAgICAgICAgICAgICAgICBwZWxsID0gKihwdHIgKyB3aWR0aCk7Ci0gICAgICAgICAgICAgICAgcHRyKys7Ci0gICAgICAgICAgICAgICAgKnB0cjIrKyA9IHBlbHUgKyAocGVsYyA8PCAxKSArIHBlbGw7Ci0gICAgICAgICAgICAgICAgKnB0cjMrKyA9IElOREVYKHBlbHUsIHRocmVzKSArIElOREVYKHBlbGMsIHRocmVzKSArIElOREVYKHBlbGwsIHRocmVzKTsKLQotICAgICAgICAgICAgICAgIHBlbHUgPSAqKHB0ciAtIHdpZHRoKTsKLSAgICAgICAgICAgICAgICBwZWxjID0gKnB0cjsKLSAgICAgICAgICAgICAgICBwZWxsID0gKihwdHIgKyB3aWR0aCk7Ci0gICAgICAgICAgICAgICAgcHRyKys7Ci0gICAgICAgICAgICAgICAgKnB0cjIrKyA9IHBlbHUgKyAocGVsYyA8PCAxKSArIHBlbGw7Ci0gICAgICAgICAgICAgICAgKnB0cjMrKyA9IElOREVYKHBlbHUsIHRocmVzKSArIElOREVYKHBlbGMsIHRocmVzKSArIElOREVYKHBlbGwsIHRocmVzKTsKLQotICAgICAgICAgICAgICAgIGZvciAoaF9wZWwgPSBoMDsgaF9wZWwgPCBoX2JsayArIEJMS1NJWkUgLSAxOyBoX3BlbCsrKQotICAgICAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAgICAgcGVsdSA9ICoocHRyIC0gd2lkdGgpOwotICAgICAgICAgICAgICAgICAgICBwZWxjID0gKnB0cjsKLSAgICAgICAgICAgICAgICAgICAgcGVsbCA9ICoocHRyICsgd2lkdGgpOwotCi0gICAgICAgICAgICAgICAgICAgICpwdHIyID0gcGVsdSArIChwZWxjIDw8IDEpICsgcGVsbDsKLSAgICAgICAgICAgICAgICAgICAgKnB0cjMgPSBJTkRFWChwZWx1LCB0aHJlcykgKyBJTkRFWChwZWxjLCB0aHJlcykgKyBJTkRFWChwZWxsLCB0aHJlcyk7Ci0KLSAgICAgICAgICAgICAgICAgICAgc3VtMSA9ICoocHRyMyAtIDIpICsgKihwdHIzIC0gMSkgKyAqcHRyMzsKLSAgICAgICAgICAgICAgICAgICAgaWYgKHN1bTEgPT0gMCB8fCBzdW0xID09IDkpCi0gICAgICAgICAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAgICAgICAgIHN1bSA9ICgqKHB0cjIgLSAyKSArICgqKHB0cjIgLSAxKSA8PCAxKSArICpwdHIyICsgOCkgPj4gNDsKLQotICAgICAgICAgICAgICAgICAgICAgICAgcHRyLS07Ci0gICAgICAgICAgICAgICAgICAgICAgICBpZiAoUFZfQUJTKCpwdHIgLSBzdW0pID4gbWF4X2RpZmYpCi0gICAgICAgICAgICAgICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHN1bSA+ICpwdHIpCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHN1bSA9ICpwdHIgKyBtYXhfZGlmZjsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBlbHNlCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHN1bSA9ICpwdHIgLSBtYXhfZGlmZjsKLSAgICAgICAgICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICAgICAgICAgICpwdHIrKyA9ICh1aW50OCkgc3VtOwotICAgICAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgICAgIHB0cisrOwotICAgICAgICAgICAgICAgICAgICBwdHIyKys7Ci0gICAgICAgICAgICAgICAgICAgIHB0cjMrKzsKLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICB9Ci0gICAgICAgIH0KLSAgICB9Ci0KLSAgICBmb3IgKHZfYmxrID0gQkxLU0laRTsgdl9ibGsgPCBoZWlnaHQ7IHZfYmxrICs9IEJMS1NJWkUpCi0gICAgewotICAgICAgICB2MCA9IHZfYmxrIC0gMTsKLSAgICAgICAgLyogRG8gdGhlIGZpcnN0IGJsb2NrIChwaXhlbHM9NyA9PiBObyBNTVgpICovCi0gICAgICAgIG1heF9kaWZmID0gKFFQX3N0b3JlWygoKChpbnQzMil2X2Jsayp3aWR0aCk+PjMpKT4+M10gPj4gMikgKyA0OwotICAgICAgICBwdHIgPSAmUmVjX0NbKGludDMyKXZfYmxrICogd2lkdGhdOwotICAgICAgICBtYXhfYmxrID0gbWluX2JsayA9ICpwdHI7Ci0gICAgICAgIEZpbmRNYXhNaW4ocHRyLCAmbWluX2JsaywgJm1heF9ibGssIGluY3IpOwotCi0gICAgICAgIGlmIChtYXhfYmxrIC0gbWluX2JsayA+PSA0KQotICAgICAgICB7Ci0gICAgICAgICAgICB0aHJlcyA9IChtYXhfYmxrICsgbWluX2JsayArIDEpID4+IDE7Ci0KLSAgICAgICAgICAgIGZvciAodl9wZWwgPSB2MDsgdl9wZWwgPCB2X2JsayArIEJMS1NJWkUgLSAxOyB2X3BlbCsrKQotICAgICAgICAgICAgewotICAgICAgICAgICAgICAgIGFkZHJfdiA9IHZfcGVsICogd2lkdGg7Ci0gICAgICAgICAgICAgICAgcHRyID0gJlJlY19DW2FkZHJfdl07Ci0gICAgICAgICAgICAgICAgcHRyMiA9ICZzdW1fdlswXTsKLSAgICAgICAgICAgICAgICBwdHIzID0gJnNpZ25fdlswXTsKLQotICAgICAgICAgICAgICAgIHBlbHUgPSAqKHB0ciAtIHdpZHRoKTsKLSAgICAgICAgICAgICAgICBwZWxjID0gKnB0cjsKLSAgICAgICAgICAgICAgICBwZWxsID0gKihwdHIgKyB3aWR0aCk7Ci0gICAgICAgICAgICAgICAgcHRyKys7Ci0gICAgICAgICAgICAgICAgKnB0cjIrKyA9IHBlbHUgKyAocGVsYyA8PCAxKSArIHBlbGw7Ci0gICAgICAgICAgICAgICAgKnB0cjMrKyA9IElOREVYKHBlbHUsIHRocmVzKSArIElOREVYKHBlbGMsIHRocmVzKSArIElOREVYKHBlbGwsIHRocmVzKTsKLQotICAgICAgICAgICAgICAgIHBlbHUgPSAqKHB0ciAtIHdpZHRoKTsKLSAgICAgICAgICAgICAgICBwZWxjID0gKnB0cjsKLSAgICAgICAgICAgICAgICBwZWxsID0gKihwdHIgKyB3aWR0aCk7Ci0gICAgICAgICAgICAgICAgcHRyKys7Ci0gICAgICAgICAgICAgICAgKnB0cjIrKyA9IHBlbHUgKyAocGVsYyA8PCAxKSArIHBlbGw7Ci0gICAgICAgICAgICAgICAgKnB0cjMrKyA9IElOREVYKHBlbHUsIHRocmVzKSArIElOREVYKHBlbGMsIHRocmVzKSArIElOREVYKHBlbGwsIHRocmVzKTsKLQotICAgICAgICAgICAgICAgIGZvciAoaF9wZWwgPSAxOyBoX3BlbCA8IEJMS1NJWkUgLSAxOyBoX3BlbCsrKQotICAgICAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAgICAgcGVsdSA9ICoocHRyIC0gd2lkdGgpOwotICAgICAgICAgICAgICAgICAgICBwZWxjID0gKnB0cjsKLSAgICAgICAgICAgICAgICAgICAgcGVsbCA9ICoocHRyICsgd2lkdGgpOwotCi0gICAgICAgICAgICAgICAgICAgICpwdHIyID0gcGVsdSArIChwZWxjIDw8IDEpICsgcGVsbDsKLSAgICAgICAgICAgICAgICAgICAgKnB0cjMgPSBJTkRFWChwZWx1LCB0aHJlcykgKyBJTkRFWChwZWxjLCB0aHJlcykgKyBJTkRFWChwZWxsLCB0aHJlcyk7Ci0KLSAgICAgICAgICAgICAgICAgICAgc3VtMSA9ICoocHRyMyAtIDIpICsgKihwdHIzIC0gMSkgKyAqcHRyMzsKLSAgICAgICAgICAgICAgICAgICAgaWYgKHN1bTEgPT0gMCB8fCBzdW0xID09IDkpCi0gICAgICAgICAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAgICAgICAgIHN1bSA9ICgqKHB0cjIgLSAyKSArICgqKHB0cjIgLSAxKSA8PCAxKSArICpwdHIyICsgOCkgPj4gNDsKLQotICAgICAgICAgICAgICAgICAgICAgICAgcHRyLS07Ci0gICAgICAgICAgICAgICAgICAgICAgICBpZiAoUFZfQUJTKCpwdHIgLSBzdW0pID4gbWF4X2RpZmYpCi0gICAgICAgICAgICAgICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHN1bSA+ICpwdHIpCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHN1bSA9ICpwdHIgKyBtYXhfZGlmZjsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBlbHNlCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHN1bSA9ICpwdHIgLSBtYXhfZGlmZjsKLSAgICAgICAgICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICAgICAgICAgICpwdHIrKyA9ICh1aW50OCkgc3VtOwotICAgICAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgICAgIHB0cisrOwotICAgICAgICAgICAgICAgICAgICBwdHIyKys7Ci0gICAgICAgICAgICAgICAgICAgIHB0cjMrKzsKLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICB9Ci0gICAgICAgIH0KLQotCi0gICAgICAgIC8qIERvIHRoZSByZXN0IGluIE1NWCAqLwotICAgICAgICBmb3IgKGhfYmxrID0gQkxLU0laRTsgaF9ibGsgPCB3aWR0aDsgaF9ibGsgKz0gQkxLU0laRSkKLSAgICAgICAgewotICAgICAgICAgICAgaWYgKChwcF9tb2RbKHZfYmxrLzgpKih3aWR0aC84KStoX2Jsay84XSYweDQpICE9IDApCi0gICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgbWF4X2RpZmYgPSAoUVBfc3RvcmVbKCgoKGludDMyKXZfYmxrKndpZHRoKT4+MykraF9ibGspPj4zXSA+PiAyKSArIDQ7Ci0gICAgICAgICAgICAgICAgcHRyID0gJlJlY19DWyhpbnQzMil2X2JsayAqIHdpZHRoICsgaF9ibGtdOwotICAgICAgICAgICAgICAgIG1heF9ibGsgPSBtaW5fYmxrID0gKn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hyZXNbYmxrc10gPSAobWF4X2JsayArIG1pbl9ibGsgKyAxKSA+PiAxOwotICAgICAgICAgICAgICAgIHJhbmdlW2Jsa3NdID0gbWF4X2JsayAtIG1pbl9ibGs7Ci0KLSAgICAgICAgICAgICAgICBpZiAocmFuZ2VbYmxrc10gPj0gbWF4X3JhbmdlX2JsaykKLSAgICAgICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgICAgIG1heF9yYW5nZV9ibGsgPSByYW5nZVtibGtzXTsKLSAgICAgICAgICAgICAgICAgICAgbWF4X3RocmVzX2JsayA9IHRocmVzW2Jsa3NdOwotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICBibGtzKys7Ci0gICAgICAgICAgICB9Ci0gICAgICAgIH0KLQotICAgICAgICBibGtzID0gMDsKLSAgICAgICAgZm9yICh2X2JsayA9IDA7IHZfYmxrIDwgTUJTSVpFOyB2X2JsayArPSBCTEtTSVpFKQotICAgICAgICB7Ci0gICAgICAgICAgICB2MCA9ICgodl9ibGsgLSAxKSA+PSAxKSA/ICh2X2JsayAtIDEpIDogMTsKLSAgICAgICAgICAgIGZvciAoaF9ibGsgPSBNQl9IOyBoX2JsayA8IE1CX0ggKyBNQlNJWkU7IGhfYmxrICs9IEJMS1NJWkUpCi0gICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgaDAgPSAoKGhfYmxrIC0gMSkgPj0gMSkgPyAoaF9ibGsgLSAxKSA6IDE7Ci0KLSAgICAgICAgICAgICAgICAvKiB0aHJlc2hvbGQgcmVhcnJhbmdlbWVudCBmb3IgZmxhdCByZWdpb24gYWRqYWNlbnQgdG8gbm9uLWZsYXQgcmVnaW9uICovCi0gICAgICAgICAgICAgICAgaWYgKHJhbmdlW2Jsa3NdPDMyICYmIG1heF9yYW5nZV9ibGsgPj0gNjQpCi0gICAgICAgICAgICAgICAgICAgIHRocmVzW2Jsa3NdID0gbWF4X3RocmVzX2JsazsKLQotICAgICAgICAgICAgICAgIC8qIHRocmVzaG9sZCByZWFycmFuZ2VtZW50IGZvciBkZWJsb2NraW5nCi0gICAgICAgICAgICAgICAgKGJsb2NraW5lc3MgYW5ub3lpbmcgYXQgREMgZG9taW5hbnQgcmVnaW9uKSAqLwotICAgICAgICAgICAgICAgIGlmIChtYXhfcmFuZ2VfYmxrID49IDE2KQotICAgICAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAgICAgLyogYWRhcHRpdmUgc21vb3RoaW5nICovCi0gICAgICAgICAgICAgICAgICAgIHRociA9IHRocmVzW2Jsa3NdOwotCi0gICAgICAgICAgICAgICAgICAgIEFkYXB0aXZlU21vb3RoX05vTU1YKFJlY19ZLCB2MCwgaDAsIHZfYmxrLCBoX2JsaywKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdGhyLCB3aWR0aCwgbWF4X2RpZmYpOwotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICBibGtzKys7Ci0gICAgICAgICAgICB9IC8qIGJsb2NrIGxldmVsIChMdW1pbmFuY2UpICovCi0gICAgICAgIH0KLSAgICB9IC8qIG1hY3JvYmxvY2sgbGV2ZWwgKi8KLQotCi0gICAgLyogRG8gdGhlIHJlc3Qgb2YgdGhlIG1hY3JvLWJsb2NrLWxpbmVzICovCi0gICAgZm9yIChNQl9WID0gTUJTSVpFOyBNQl9WIDwgaGVpZ2h0OyBNQl9WICs9IE1CU0laRSkKLSAgICB7Ci0gICAgICAgIC8qIEZpcnN0IG1hY3JvLWJsb2NrICovCi0gICAgICAgIG1heF9kaWZmID0gKFFQX3N0b3JlWygoKChpbnQzMilNQl9WKndpZHRoKT4+NCkpPj40XSA+PiAyKSArIDQ7Ci0gICAgICAgIC8qIHRocmVzaG9sZCBkZXRlcm1pbmF0aW9uICovCi0gICAgICAgIG1heF9yYW5nZV9ibGsgPSBtYXhfdGhyZXNfYmxrID0gMDsKLSAgICAgICAgYmxrcyA9IDA7Ci0gICAgICAgIGZvciAoQkxLX1YgPSAwOyBCTEtfViA8IE1CU0laRTsgQkxLX1YgKz0gQkxLU0laRSkKLSAgICAgICAgewotICAgICAgICAgICAgZm9yIChCTEtfSCA9IDA7IEJMS19IIDwgTUJTSVpFOyBCTEtfSCArPSBCTEtTSVpFKQotICAgICAgICAgICAgewotICAgICAgICAgICAgICAgIHB0ciA9ICZSZWNfWVsoaW50MzIpKE1CX1YgKyBCTEtfVikgKiB3aWR0aCArIEJMS19IXTsKLSAgICAgICAgICAgICAgICBGaW5kTWF4TWluKHB0ciwgJm1pbl9ibGssICZtYXhfYmxrLCBpbmNyKTsKLSAgICAgICAgICAgICAgICB0aHJlc1tibGtzXSA9IChtYXhfYmxrICsgbWluX2JsayArIDEpID4+IDE7Ci0gICAgICAgICAgICAgICAgcmFuZ2VbYmxrc10gPSBtYXhfYmxrIC0gbWluX2JsazsKLQotICAgICAgICAgICAgICAgIGlmIChyYW5nZVtibGtzXSA+PSBtYXhfcmFuZ2VfYmxrKQotICAgICAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAgICAgbWF4X3JhbmdlX2JsayA9IHJhbmdlW2Jsa3NdOwotICAgICAgICAgICAgICAgICAgICBtYXhfdGhyZXNfYmxrID0gdGhyZXNbYmxrc107Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgIGJsa3MrKzsKLSAgICAgICAgICAgIH0KLSAgICAgICAgfQotCi0gICAgICAgIGJsa3MgPSAwOwotICAgICAgICBmb3IgKHZfYmxrID0gTUJfVjsgdl9ibGsgPCBNQl9WICsgTUJTSVpFOyB2X2JsayArPSBCTEtTSVpFKQotICAgICAgICB7Ci0gICAgICAgICAgICB2MCA9IHZfYmxrIC0gMTsKLSAgICAgICAgICAgIGZvciAoaF9ibGsgPSAwOyBoX2JsayA8IE1CU0laRTsgaF9ibGsgKz0gQkxLU0laRSkKLSAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICBoMCA9ICgoaF9ibGsgLSAxKSA+PSAxKSA/IChoX2JsayAtIDEpIDogMTsKLQotICAgICAgICAgICAgICAgIC8qIHRocmVzaG9sZCByZWFycmFuZ2VtZW50IGZvciBmbGF0IHJlZ2lvbiBhZGphY2VudCB0byBub24tZmxhdCByZWdpb24gKi8KLSAgICAgICAgICAgICAgICBpZiAocmFuZ2VbYmxrc108MzIgJiYgbWF4X3JhbmdlX2JsayA+PSA2NCkKLSAgICAgICAgICAgICAgICAgICAgdGhyZXNbYmxrc10gPSBtYXhfdGhyZXNfYmxrOwotCi0gICAgICAgICAgICAgICAgLyogdGhyZXNob2xkIHJlYXJyYW5nZW1lbnQgZm9yIGRlYmxvY2tpbmcKLSAgICAgICAgICAgICAgICAoYmxvY2tpbmVzcyBhbm5veWluZyBhdCBEQyBkb21pbmFudCByZWdpb24pICovCi0gICAgICAgICAgICAgICAgaWYgKG1heF9yYW5nZV9ibGsgPj0gMTYpCi0gICAgICAgICAgICAgICAgewotICAgICAgICAgICAgICAgICAgICAvKiBhZGFwdGl2ZSBzbW9vdGhpbmcgKi8KLSAgICAgICAgICAgICAgICAgICAgdGhyID0gdGhyZXNbYmxrc107Ci0KLSAgICAgICAgICAgICAgICAgICAgQWRhcHRpdmVTbW9vdGhfTm9NTVgoUmVjX1ksIHYwLCBoMCwgdl9ibGssIGhfYmxrLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0aHIsIHdpZHRoLCBtYXhfZGlmZik7Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgIGJsa3MrKzsKLSAgICAgICAgICAgIH0KLSAgICAgICAgfSAvKiBibG9jayBsZXZlbCAoTHVtaW5hbmNlKSAqLwotCi0gICAgICAgIC8qIFJlc3Qgb2YgdGhlIG1hY3JvLWJsb2NrcyAqLwotICAgICAgICBmb3IgKE1CX0ggPSBNQlNJWkU7IE1CX0ggPCB3aWR0aDsgTUJfSCArPSBNQlNJWkUpCi0gICAgICAgIHsKLSAgICAgICAgICAgIG1heF9kaWZmID0gKFFQX3N0b3JlWygoKChpbnQzMilNQl9WKndpZHRoKT4+NCkrTUJfSCk+PjRdID4+IDIpICsgNDsKLQotICAgICAgICAgICAgLyogdGhyZXNob2xkIGRldGVybWluYXRpb24gKi8KLSAgICAgICAgICAgIG1heF9yYW5nZV9ibGsgPSBtYXhfdGhyZXNfYmxrID0gMDsKLSAgICAgICAgICAgIGJsa3MgPSAwOwotCi0gICAgICAgICAgICBtYl9pbmR4ID0gKE1CX1YgLyA4KSAqICh3aWR0aCAvIDgpICsgTUJfSCAvIDg7Ci0gICAgICAgICAgICBmb3IgKEJMS19WID0gMDsgQkxLX1YgPCBNQlNJWkU7IEJMS19WICs9IEJMS1NJWkUpCi0gICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgZm9yIChCTEtfSCA9IDA7IEJMS19IIDwgTUJTSVpFOyBCTEtfSCArPSBCTEtTSVpFKQotICAgICAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAgICAgYmxrX2luZHggPSBtYl9pbmR4ICsgKEJMS19WIC8gOCkgKiB3aWR0aCAvIDggKyBCTEtfSCAvIDg7Ci0gICAgICAgICAgICAgICAgICAgIC8qIFVwZGF0ZSBiYXNlZCBvbiBwcF9tb2Qgb25seSAqLwotICAgICAgICAgICAgICAgICAgICBpZiAoKHBwX21vZFtibGtfaW5keF0mMHg0KSAhPSAwKQotICAgICAgICAgICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgICAgICAgICBwdHIgPSAmUmVjX1lbKGludDMyKShNQl9WICsgQkxLX1YpICogd2lkdGggKyBNQl9IICsgQkxLX0hdOwotICAgICAgICAgICAgICAgICAgICAgICAgRmluZE1heE1pbihwdHIsICZtaW5fYmxrLCAmbWF4X2JsaywgaW5jcik7Ci0gICAgICAgICAgICAgICAgICAgICAgICB0aHJlc1tibGtzXSA9IChtYXhfYmxrICsgbWluX2JsayArIDEpID4+IDE7Ci0gICAgICAgICAgICAgICAgICAgICAgICByYW5nZVtibGtzXSA9IG1heF9ibGsgLSBtaW5fYmxrOwotCi0gICAgICAgICAgICAgICAgICAgICAgICBpZiAocmFuZ2VbYmxrc10gPj0gbWF4X3JhbmdlX2JsaykKLSAgICAgICAgICAgICAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBtYXhfcmFuZ2VfYmxrID0gcmFuZ2VbYmxrc107Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgbWF4X3RocmVzX2JsayA9IHRocmVzW2Jsa3NdOwotICAgICAgICAgICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgICAgIGJsa3MrKzsKLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgIGJsa3MgPSAwOwotICAgICAgICAgICAgZm9yICh2X2JsayA9IE1CX1Y7IHZfYmxrIDwgTUJfViArIE1CU0laRTsgdl9ibGsgKz0gQkxLU0laRSkKLSAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICB2MCA9IHZfYmxrIC0gMTsKLSAgICAgICAgICAgICAgICBtYl9pbmR4ID0gKHZfYmxrIC8gOCkgKiAod2lkdGggLyA4KTsKLSAgICAgICAgICAgICAgICBmb3IgKGhfYmxrID0gTUJfSDsgaF9ibGsgPCBNQl9IICsgTUJTSVpFOyBoX2JsayArPSBCTEtTSVpFKQotICAgICAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAgICAgaDAgPSBoX2JsayAtIDE7Ci0gICAgICAgICAgICAgICAgICAgIGJsa19pbmR4ID0gbWJfaW5keCArIGhfYmxrIC8gODsKLSAgICAgICAgICAgICAgICAgICAgaWYgKChwcF9tb2RbYmxrX2luZHhdJjB4NCkgIT0gMCkKLSAgICAgICAgICAgICAgICAgICAgewotICAgICAgICAgICAgICAgICAgICAgICAgLyogdGhyZXNob2xkIHJlYXJyYW5nZW1lbnQgZm9yIGZsYXQgcmVnaW9uIGFkamFjZW50IHRvIG5vbi1mbGF0IHJlZ2lvbiAqLwotICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHJhbmdlW2Jsa3NdPDMyICYmIG1heF9yYW5nZV9ibGsgPj0gNjQpCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgdGhyZXNbYmxrc10gPSBtYXhfdGhyZXNfYmxrOwotCi0gICAgICAgICAgICAgICAgICAgICAgICAvKiB0aHJlc2hvbGQgcmVhcnJhbmdlbWVudCBmb3IgZGVibG9ja2luZwotICAgICAgICAgICAgICAgICAgICAgICAgKGJsb2NraW5lc3MgYW5ub3lpbmcgYXQgREMgZG9taW5hbnQgcmVnaW9uKSAqLwotICAgICAgICAgICAgICAgICAgICAgICAgaWYgKG1heF9yYW5nZV9ibGsgPj0gMTYpCi0gICAgICAgICAgICAgICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgLyogYWRhcHRpdmUgc21vb3RoaW5nICovCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgdGhyID0gdGhyZXNbYmxrc107Ci0jaWZkZWYgTm9NTVgKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBBZGFwdGl2ZVNtb290aF9Ob01NWChSZWNfWSwgdjAsIGgwLCB2X2JsaywgaF9ibGssCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdGhyLCB3aWR0aCwgbWF4X2RpZmYpOwotI2Vsc2UKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBEZXJpbmdBZGFwdGl2ZVNtb290aE1NWCgmUmVjX1lbdjAqd2lkdGgraDBdLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHdpZHRoLCB0aHIsIG1heF9kaWZmKTsKLSNlbmRpZgotICAgICAgICAgICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgICAgIGJsa3MrKzsKLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICB9IC8qIGJsb2NrIGxldmVs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i8KLSAgICB1aW50OCAqcHJlZF9ibG9jaywgICAgICAvKiBpICovCi0gICAgaW50IHdpZHRoLCAgICAgIC8qIGkgKi8KLSAgICBpbnQgcHJlZF93aWR0aF9ybmQgLyogaSAqLwotKQotewotICAgIHVpbnQgICAgaTsgICAgICAvKiBsb29wIHZhcmlhYmxlICovCi0gICAgaW50IG9mZnNldCwgb2Zmc2V0MjsKLSAgICB1aW50MzIgIHByZWRfd29yZCwgd29yZDEsIHdvcmQyOwotICAgIGludCB0bXA7Ci0KLSAgICAvKiBpbml0aWFsaXplIG9mZnNldCB0byBhZGp1c3QgcGl4ZWwgY291bnRlciAqLwotICAgIC8qICAgIHRoZSBuZXh0IHJvdzsgZnVsbC1wZWwgcmVzb2x1dGlvbiAgICAgICovCi0gICAgb2Zmc2V0ID0gd2lkdGggLSBCX1NJWkU7IC8qIG9mZnNldCBmb3IgcHJldiAqLwotICAgIG9mZnNldDIgPSAocHJlZF93aWR0aF9ybmQgPj4gMSkgLSA0OyAvKiBvZmZzZXQgZm9yIHByZWRfYmxvY2sgKi8KLQotICAgIHRtcCA9ICh1aW50MzIpcHJldiAmIDB4MzsKLSAgICBwcmVkX2Jsb2NrIC09IG9mZnNldDI7IC8qIHByZXNldCAqLwotCi0gICAgaWYgKHRtcCA9PSAwKSAgLyogd29yZC1hbGlnbmVkICovCi0gICAgewotICAgICAgICBmb3IgKGkgPSBCX1NJWkU7IGkgPiAwOyBpLS0pCi0gICAgICAgIHsKLSAgICAgICAgICAgICooKHVpbnQzMiopKHByZWRfYmxvY2sgKz0gb2Zmc2V0MikpID0gKigodWludDMyKilwcmV2KTsKLSAgICAgICAgICAgICooKHVpbnQzMiopKHByZWRfYmxvY2sgKz0gNCkpID0gKigodWludDMyKikocHJldiArIDQpKTsKLSAgICAgICAgICAgIHByZXYgKz0gd2lkdGg7Ci0gICAgICAgIH0KLSAgICAgICAgcmV0dXJuIDE7Ci0gICAgfQotICAgIGVsc2UgaWYgKHRtcCA9PSAxKSAvKiBmaXJzdCBwb3NpdGlvbiAqLwotICAgIHsKLSAgICAgICAgcHJldi0tOyAvKiB3b3JkLWFsaWduZWQgKi8KLQotICAgICAgICBmb3IgKGkgPSBCX1NJWkU7IGkgPiAwOyBpLS0pCi0gICAgICAgIHsKLSAgICAgICAgICAgIHdvcmQxID0gKigodWludDMyKilwcmV2KTsgLyogcmVhZCA0IGJ5dGVzLCBiNCBiMyBiMiBiMSAqLwotICAgICAgICAgICAgd29yZDIgPSAqKCh1aW50MzIqKShwcmV2ICs9IDQpKTsgIC8qIHJlYWQgNCBieXRlcywgYjggYjcgYjYgYjUgKi8KLSAgICAgICAgICAgIHdvcmQxID4+PSA4OyAvKiAwIGI0IGIzIGIyICovCi0gICAgICAgICAgICBwcmVkX3dvcmQgPSB3b3JkMSB8ICh3b3JkMiA8PCAyNCk7ICAvKiBiNSBiNCBiMyBiMiAqLwotICAgICAgICAgICAgKigodWludDMyKikocHJlZF9ibG9jayArPSBvZmZzZXQyKSkgPSBwcmVkX3dvcmQ7Ci0KLSAgICAgICAgICAgIHdvcmQxID0gKigodWludDMyKikocHJldiArPSA0KSk7IC8qIGIxMiBiMTEgYjEwIGI5ICovCi0gICAgICAgICAgICB3b3JkMiA+Pj0gODsgLyogMCBiOCBiNyBiNiAqLwotICAgICAgICAgICAgcHJlZF93b3JkID0gd29yZDIgfCAod29yZDEgPDwgMjQpOyAvKiBiOSBiOCBiNyBiNiAqLwotICAgICAgICAgICAgKigodWludDMyKikocHJlZF9ibG9jayArPSA0KSkgPSBwcmVkX3dvcmQ7Ci0KLSAgICAgICAgICAgIHByZXYgKz0gb2Zmc2V0OwotICAgICAgICB9Ci0KLSAgICAgICAgcmV0dXJuIDE7Ci0gICAgfQotICAgIGVsc2UgaWYgKHRtcCA9PSAyKSAvKiBzZWNvbmQgcG9zaXRpb24gKi8KLSAgICB7Ci0gICAgICAgIHByZXYgLT0gMjsgLyogd29yZDEtYWxpZ25lZCAqLwotCi0gICAgICAgIGZvciAoaSA9IEJfU0laRTsgaSA+IDA7IGktLSkKLSAgICAgICAgewotICAgICAgICAgICAgd29yZDEgPSAqKCh1aW50MzIqKXByZXYpOyAvKiByZWFkIDQgYnl0ZXMsIGI0IGIzIGIyIGIxICovCi0gICAgICAgICAgICB3b3JkMiA9ICooKHVpbnQzMiopKHByZXYgKz0gNCkpOyAgLyogcmVhZCA0IGJ5dGVzLCBiOCBiNyBiNiBiNSAqLwotICAgICAgICAgICAgd29yZDEgPj49IDE2OyAvKiAwIDAgYjQgYjMgKi8KLSAgICAgICAgICAgIHByZWRfd29yZCA9IHdvcmQxIHwgKHdvcmQyIDw8IDE2KTsgIC8qIGI2IGI1IGI0IGIzICovCi0gICAgICAgICAgICAqKCh1aW50MzIqKShwcmVkX2Jsb2NrICs9IG9mZnNldDIpKSA9IHByZWRfd29yZDsKLQotICAgICAgICAgICAgd29yZDEgPSAqKCh1aW50MzIqKShwcmV2ICs9IDQpKTsgLyogYjEyIGIxMSBiMTAgYjkgKi8KLSAgICAgICAgICAgIHdvcmQyID4+PSAxNjsgLyogMCAwIGI4IGI3ICovCi0gICAgICAgICAgICBwcmVkX3dvcmQgPSB3b3JkMiB8ICh3b3JkMSA8PCAxNik7IC8qIGIxMCBiOSBiOCBiNyAqLwotICAgICAgICAgICAgKigodWludDMyKikocHJlZF9ibG9jayArPSA0KSkgPSBwcmVkX3dvcmQ7Ci0KLQotICAgICAgICAgICAgcHJldiArPSBvZmZzZXQ7Ci0gICAgICAgIH0KLQotICAgICAgICByZXR1cm4gMTsKLSAgICB9Ci0gICAgZWxzZSAvKiB0aGlyZCBwb3NpdGlvbiAqLwotICAgIHsKLSAgICAgICAgcHJldiAtPSAzOyAvKiB3b3JkMS1hbGlnbmVkICovCi0KLSAgICAgICAgZm9yIChpID0gQl9TSVpFOyBpID4gMDsgaS0tKQotICAgICAgICB7Ci0gICAgICAgICAgICB3b3JkMSA9ICooKHVpbnQzMiopcHJldik7IC8qIHJlYWQgNCBieXRlcywgYjQgYjMgYjIgYjEgKi8KLSAgICAgICAgICAgIHdvcmQyID0gKigodWludDMyKikocHJldiArPSA0KSk7ICAvKiByZWFkIDQgYnl0ZXMsIGI4IGI3IGI2IGI1ICovCi0gICAgICAgICAgICB3b3JkMSA+Pj0gMjQ7IC8qIDAgMCAwIGI0ICovCi0gICAgICAgICAgICBwcmVkX3dvcmQgPSB3b3JkMSB8ICh3b3JkMiA8PCA4KTsgICAvKiBiNyBiNiBiNSBiNCAqLwotICAgICAgICAgICAgKigodWludDMyKikocHJlZF9ibG9jayArPSBvZmZzZXQyKSkgPSBwcmVkX3dvcmQ7Ci0KLSAgICAgICAgICAgIHdvcmQxID0gKigodWludDMyKikocHJldiArPSA0KSk7IC8qIGIxMiBiMTEgYjEwIGI5ICovCi0gICAgICAgICAgICB3b3JkMiA+Pj0gMjQ7IC8qIDAgMCAwIGI4ICovCi0gICAgICAgICAgICBwcmVkX3dvcmQgPSB3b3JkMiB8ICh3b3JkMSA8PCA4KTsgLyogYjExIGIxMCBiOSBiOCAqLwotICAgICAgICAgICAgKigodWludDMyKikocHJlZF9ibG9jayArPSA0KSkgPSBwcmVkX3dvcmQ7Ci0KLSAgICAgICAgICAgIHByZXYgKz0gb2Zmc2V0OwotICAgICAgICB9Ci0KLSAgICAgICAgcmV0dXJuIDE7Ci0gICAgfQotfQotCi0vKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi1pbnQgR2V0UHJlZEFkdmFuY2VkQnkweDEoCi0gICAgdWludDggKnByZXYsICAgICAgICAvKiBpICovCi0gICAgdWludDggKnByZWRfYmxvY2ssICAgICAgLyogaSAqLwotICAgIGludCB3aWR0aCwgICAgICAvKiBpICovCi0gICAgaW50IHByZWRfd2lkdGhfcm5kIC8qIGkgKi8KLSkKLXsKLSAgICB1aW50ICAgIGk7ICAgICAgLyogbG9vcCB2YXJpYWJsZSAqLwotICAgIGludCBvZmZzZXQsIG9mZnNldD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2ICs9IDQpKTsgLyogYjggYjcgYjYgYjUgKi8KLSAgICAgICAgICAgICAgICB3b3JkMTIgPSAod29yZDEgPj4gOCk7IC8qIDAgYjQgYjMgYjIgKi8KLSAgICAgICAgICAgICAgICB3b3JkMTIgfD0gKHdvcmQyIDw8IDI0KTsgLyogYjUgYjQgYjMgYjIgKi8KLSAgICAgICAgICAgICAgICB3b3JkMyA9IHdvcmQxIHwgd29yZDEyOyAvLyBybmQxID0gMTsgb3RoZXJ3aXNlIHdvcmQzID0gd29yZDEmd29yZDEyCi0gICAgICAgICAgICAgICAgd29yZDEgJj0gbWFzazsKLSAgICAgICAgICAgICAgICB3b3JkMyAmPSAofm1hc2spOyAvKiAweDEwMTAxMDEsIGNoZWNrIGxhc3QgYml0ICovCi0gICAgICAgICAgICAgICAgd29yZDEyICY9IG1hc2s7Ci0gICAgICAgICAgICAgICAgd29yZDEgPj49IDE7Ci0gICAgICAgICAgICAgICAgd29yZDEgPSB3b3JkMSArICh3b3JkMTIgPj4gMSk7Ci0gICAgICAgICAgICAgICAgd29yZDEgKz0gd29yZDM7Ci0gICAgICAgICAgICAgICAgKigodWludDMyKikocHJlZF9ibG9jayArPSBvZmZzZXQyKSkgPSB3b3JkMTsgLyogd3JpdGUgNCBwaXhlbHMgKi8KLQotICAgICAgICAgICAgICAgIHdvcmQxID0gKigodWludDMyKikocHJldiArPSA0KSk7IC8qIGIxMiBiMTEgYjEwIGI5ICovCi0gICAgICAgICAgICAgICAgd29yZDEyID0gKHdvcmQyID4+IDgpOyAvKiAwIGI4IGI3IGI2ICovCi0gICAgICAgICAgICAgICAgd29yZDEyIHw9ICh3b3JkMSA8PCAyNCk7IC8qIGI5IGI4IGI3IGI2ICovCi0gICAgICAgICAgICAgICAgd29yZDMgPSB3b3JkMiB8IHdvcmQxMjsKLSAgICAgICAgICAgICAgICB3b3JkMiAmPSBtYXNrOwotICAgICAgICAgICAgICAgIHdvcmQzICY9ICh+bWFzayk7ICAvKiAweDEwMTAxMDEsIGNoZWNrIGxhc3QgYml0ICovCi0gICAgICAgICAgICAgICAgd29yZDEyICY9IG1hc2s7Ci0gICAgICAgICAgICAgICAgd29yZDIgPj49IDE7Ci0gICAgICAgICAgICAgICAgd29yZDIgPSB3b3JkMiArICh3b3JkMTIgPj4gMSk7Ci0gICAgICAgICAgICAgICAgd29yZDIgKz0gd29yZDM7Ci0gICAgICAgICAgICAgICAgKigodWludDMyKikocHJlZF9ibG9jayArPSA0KSkgPSB3b3JkMjsgLyogd3JpdGUgNCBwaXhlbHMgKi8KLQotICAgICAgICAgICAgICAgIHByZXYgKz0gb2Zmc2V0OwotICAgICAgICAgICAgfQotICAgICAgICAgICAgcmV0dXJuIDE7Ci0gICAgICAgIH0KLSAgICAgICAgZWxzZSAvKiBybmQxID09IDAgKi8KLSAgICAgICAgewotICAgICAgICAgICAgZm9yIChpID0gQl9TSVpFOyBpID4gMDsgaS0tKQotICAgICAgICAgICAgewotICAgICAgICAgICAgICAgIHdvcmQxID0gKigodWludDMyKilwcmV2KTsgLyogYjQgYjMgYjIgYjEgKi8KLQotICAgICAgICAgICAgICAgIHdvcmQyID0gKigodWludDMyKikocHJldiArPSA0KSk7IC8qIGI4IGI3IGI2IGI1ICovCi0gICAgICAgICAgICAgICAgd29yZDEyID0gKHdvcmQxID4+IDgpOyAvKiAwIGI0IGIzIGIyICovCi0gICAgICAgICAgICAgICAgd29yZDEyIHw9ICh3b3JkMiA8PCAyNCk7IC8qIGI1IGI0IGIzIGIyICovCi0gICAgICAgICAgICAgICAgd29yZDMgPSB3b3JkMSAmIHdvcmQxMjsgLy8gcm5kMSA9IDE7IG90aGVyd2lzZSB3b3JkMyA9IHdvcmQxJndvcmQxMgotICAgICAgICAgICAgICAgIHdvcmQxICY9IG1hc2s7Ci0gICAgICAgICAgICAgICAgd29yZDMgJj0gKH5tYXNrKTsgLyogMHgxMDEwMTAxLCBjaGVjayBsYXN0IGJpdCAqLwotICAgICAgICAgICAgICAgIHdvcmQxMiAmPSBtYXNrOwotICAgICAgICAgICAgICAgIHdvcmQxID4+PSAxOwotICAgICAgICAgICAgICAgIHdvcmQxID0gd29yZDEgKyAod29yZDEyID4+IDEpOwotICAgICAgICAgICAgICAgIHdvcmQxICs9IHdvcmQzOwotICAgICAgICAgICAgICAgICooKHVpbnQzMiopKHByZWRfYmxvY2sgKz0gb2Zmc2V0MikpID0gd29yZDE7IC8qIHdyaXRlIDQgcGl4ZWxzICovCi0KLSAgICAgICAgICAgICAgICB3b3JkMSA9ICooKHVpbnQzMiopKHByZXYgKz0gNCkpOyAvKiBiMTIgYjExIGIxMCBiOSAqLwotICAgICAgICAgICAgICAgIHdvcmQxMiA9ICh3b3JkMiA+PiA4KTsgLyogMCBiOCBiNyBiNiAqLwotICAgICAgICAgICAgICAgIHdvcmQxMiB8PSAod29yZDEgPDwgMjQpOyAvKiBiOSBiOCBiNyBiNiAqLwotICAgICAgICAgICAgICAgIHdvcmQzID0gd29yZDIgJiB3b3JkMTI7Ci0gICAgICAgICAgICAgICAgd29yZDIgJj0gbWFzazsKLSAgICAgICAgICAgICAgICB3b3JkMyAmPSAofm1hc2spOyAgLyogMHgxMDEwMTAxLCBjaGVjayBsYXN0IGJpdCAqLwotICAgICAgICAgICAgICAgIHdvcmQxMiAmPSBtYXNrOwotICAgICAgICAgICAgICAgIHdvcmQyID4+PSAxOwotICAgICAgICAgICAgICAgIHdvcmQyID0gd29yZDIgKyAod29yZDEyID4+IDEpOwotICAgICAgICAgICAgICAgIHdvcmQyICs9IHdvcmQzOwotICAgICAgICAgICAgICAgICooKHVpbnQzMiopKHByZWRfYmxvY2sgKz0gNCkpID0gd29yZDI7IC8qIHdyaXRlIDQgcGl4ZWxzICovCi0KLSAgICAgICAgICAgICAgICBwcmV2ICs9IG9mZnNldDsKLSAgICAgICAgICAgIH0KLSAgICAgICAgICAgIHJldHVybiAxOwotICAgICAgICB9IC8qIHJuZDEgKi8KLSAgICB9Ci0gICAgZWxzZSBpZiAodG1wID09IDEpCi0gICAgewotICAgICAgICBwcmV2LS07IC8qIHdvcmQtYWxpZ25lZCAqLwotICAgICAgICBpZiAocm5kMSA9PSAxKQotICAgICAgICB7Ci0gICAgICAgICAgICBmb3IgKGkgPSBCX1NJWkU7IGkgPiAwOyBpLS0pCi0gICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgd29yZDEgPSAqKCh1aW50MzIqKXByZXYpOyAvKiBiMyBiMiBiMSBiMCAqLwotICAgICAgICAgICAgICAgIHdvcmQyID0gKigodWludDMyKikocHJldiArPSA0KSk7IC8qIGI3IGI2IGI1IGI0ICovCi0gICAgICAgICAgICAgICAgd29yZDEyID0gKHdvcmQxID4+IDgpOyAvKiAwIGIzIGIyIGIxICovCi0gICAgICAgICAgICAgICAgd29yZDEgPj49IDE2OyAvKiAwIDAgYjMgYjIgKi8KLSAgICAgICAgICAgICAgICB3b3JkMTIgfD0gKHdvcmQyIDw8IDI0KTsgLyogYjQgYjMgYjIgYjEgKi8KLSAgICAgICAgICAgICAgICB3b3JkMSB8PSAod29yZDIgPDwgMTYpOyAvKiBiNSBiNCBiMyBiMiAqLwotICAgICAgICAgICAgICAgIHdvcmQzID0gd29yZDEgfCB3b3JkMTI7IC8vIHJuZDEgPSAxOyBvdGhlcndpc2Ugd29yZDMgPSB3b3JkMSZ3b3JkMTIKLSAgICAgICAgICAgICAgICB3b3JkMSAmPSBtYXNrOwotICAgICAgICAgICAgICAgIHdvcmQzICY9ICh+bWFzayk7IC8qIDB4MTAxMDEwMSwgY2hlY2sgbGFzdCBiaXQgKi8KLSAgICAgICAgICAgICAgICB3b3JkMTIgJj0gbWFzazsKLSAgICAgICAgICAgICAgICB3b3JkMSA+Pj0gMTsKLSAgICAgICAgICAgICAgICB3b3JkMSA9IHdvcmQxICsgKHdvcmQxMiA+PiAxKTsKLSAgICAgICAgICAgICAgICB3b3JkMSArPSB3b3JkMzsKLSAgICAgICAgICAgICAgICAqKCh1aW50MzIqKShwcmVkX2Jsb2NrICs9IG9mZnNldDIpKSA9IHdvcmQxOyAvKiB3cml0ZSA0IHBpeGVscyAqLwotCi0gICAgICAgICAgICAgICAgd29yZDEgPSAqKCh1aW50MzIqKShwcmV2ICs9IDQpKTsgLyogYjExIGIxMCBiOSBiOCAqLwotICAgICAgICAgICAgICAgIHdvcmQxMiA9ICh3b3JkMiA+PiA4KTsgLyogMCBiNyBiNiBiNSAqLwotICAgICAgICAgICAgICAgIHdvcmQyID4+PSAxNjsgLyogMCAwIGI3IGI2ICovCi0gICAgICAgICAgICAgICAgd29yZDEyIHw9ICh3b3JkMSA8PCAyNCk7IC8qIGI4IGI3IGI2IGI1ICovCi0gICAgICAgICAgICAgICAgd29yZDIgfD0gKHdvcmQxIDw8IDE2KTsgLyogYjkgYjggYjcgYjYgKi8KLSAgICAgICAgICAgICAgICB3b3JkMyA9IHdvcmQyIHwgd29yZDEyOyAvLyBybmQxID0gMTsgb3RoZXJ3aXNlIHdvcmQzID0gd29yZDImd29yZDEyCi0gICAgICAgICAgICAgICAgd29yZDIgJj0gbWFzazsKLSAgICAgICAgICAgICAgICB3b3JkMyAmPSAofm1hc2spOyAvKiAweDEwMTAxMDEsIGNoZWNrIGxhc3QgYml0ICovCi0gICAgICAgICAgICAgICAgd29yZDEyICY9IG1hc2s7Ci0gICAgICAgICAgICAgICAgd29yZDIgPj49IDE7Ci0gICAgICAgICAgICAgICAgd29yZDIgPSB3b3JkMiArICh3b3JkMTIgPj4gMSk7Ci0gICAgICAgICAgICAgICAgd29yZDIgKz0gd29yZDM7Ci0gICAgICAgICAgICAgICAgKigodWludDMyKikocHJlZF9ibG9jayArPSA0KSkgPSB3b3JkMjsgLyogd3JpdGUgNCBwaXhlbHMgKi8KLQotICAgICAgICAgICAgICAgIHByZXYgKz0gb2Zmc2V0OwotICAgICAgICAgICAgfQotICAgICAgICAgICAgcmV0dXJuIDE7Ci0gICAgICAgIH0KLSAgICAgICAgZWxzZSAvKiBybmQxID0gMCAqLwotICAgICAgICB7Ci0gICAgICAgICAgICBmb3IgKGkgPSBCX1NJWkU7IGkgPiAwOyBpLS0pCi0gICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgd29yZDEgPSAqKCh1aW50MzIqKXByZXYpOyAvKiBiMyBiMiBiMSBiMCAqLwotCi0gICAgICAgICAgICAgICAgd29yZDIgPSAqKCh1aW50MzIqKShwcmV2ICs9IDQpKTsgLyogYjcgYjYgYjUgYjQgKi8KLSAgICAgICAgICAgICAgICB3b3JkMTIgPSAod29yZDEgPj4gOCk7IC8qIDAgYjMgYjIgYjEgKi8KLSAgICAgICAgICAgICAgICB3b3JkMSA+Pj0gMTY7IC8qIDAgMCBiMyBiMiAqLwotICAgICAgICAgICAgICAgIHdvcmQxMiB8PSAod29yZDIgPDwgMjQpOyAvKiBiNCBiMyBiMiBiMSAqLwotICAgICAgICAgICAgICAgIHdvcmQxIHw9ICh3b3JkMiA8PCAxNik7IC8qIGI1IGI0IGIzIGIyICovCi0gICAgICAgICAgICAgICAgd29yZDMgPSB3b3JkMSAmIHdvcmQxMjsKLSAgICAgICAgICAgICAgICB3b3JkMSAmPSBtYXNrOwotICAgICAgICAgICAgICAgIHdvcmQzICY9ICh+bWFzayk7IC8qIDB4MTAxMDEwMSwgY2hlY2sgbGFzdCBiaXQgKi8KLSAgICAgICAgICAgICAgICB3b3JkMTIgJj0gbWFzazsKLSAgICAgICAgICAgICAgICB3b3JkMSA+Pj0gMTsKLSAgICAgICAgICAgICAgICB3b3JkMSA9IHdvcmQxICsgKHdvcmQxMiA+PiAxKTsKLSAgICAgICAgICAgICAgICB3b3JkMSArPSB3b3JkMzsKLSAgICAgICAgICAgICAgICAqKCh1aW50MzIqKShwcmVkX2Jsb2NrICs9IG9mZnNldDIpKSA9IHdvcmQxOyAvKiB3cml0ZSA0IHBpeGVscyAqLwotCi0gICAgICAgICAgICAgICAgd29yZDEgPSAqKCh1aW50MzIqKShwcmV2ICs9IDQpKTsgLyogYjExIGIxMCBiOSBiOCAqLwotICAgICAgICAgICAgICAgIHdvcmQxMiA9ICh3b3JkMiA+PiA4KTsgLyogMCBiNyBiNiBiNSAqLwotICAgICAgICAgICAgICAgIHdvcmQyID4+PSAxNjsgLyogMCAwIGI3IGI2ICovCi0gICAgICAgICAgICAgICAgd29yZDEyIHw9ICh3b3JkMSA8PCAyNCk7IC8qIGI4IGI3IGI2IGI1ICovCi0gICAgICAgICAgICAgICAgd29yZDIgfD0gKHdvcmQxIDw8IDE2KTsgLyogYjkgYjggYjcgYjYgKi8KLSAgICAgICAgICAgICAgICB3b3JkMyA9IHdvcmQyICYgd29yZDEyOwotICAgICAgICAgICAgICAgIHdvcmQyICY9IG1hc2s7Ci0gICAgICAgICAgICAgICAgd29yZDMgJj0gKH5tYXNrKTsgLyogMHgxMDEwMTAxLCBjaGVjayBsYXN0IGJpdCAqLwotICAgICAgICAgICAgICAgIHdvcmQxMiAmPSBtYXNrOwotICAgICAgICAgICAgICAgIHdvcmQyID4+PSAxOwotICAgICAgICAgICAgICAgIHdvcmQyID0gd29yZDIgKyAod29yZDEyID4+IDEpOwotICAgICAgICAgICAgICAgIHdvcmQyICs9IHdvcmQzOwotICAgICAgICAgICAgICAgICooKHVpbnQzMiopKHByZWRfYmxvY2sgKz0gNCkpID0gd29yZDI7IC8qIHdyaXRlIDQgcGl4ZWxzICovCi0KLSAgICAgICAgICAgICAgICBwcmV2ICs9IG9mZnNldDsKLSAgICAgICAgICAgIH0KLSAgICAgICAgICAgIHJldHVybiAxOwotICAgICAgICB9IC8qIHJuZDEgKi8KLSAgICB9Ci0gICAgZWxzZSBpZiAodG1wID09IDIpCi0gICAgewotICAgICAgICBwcmV2IC09IDI7IC8qIHdvcmQtYWxpZ25lZCAqLwotICAgICAgICBpZiAocm5kMSA9PSAxKQotICAgICAgICB7Ci0gICAgICAgICAgICBmb3IgKGkgPSBCX1NJWkU7IGkgPiAwOyBpLS0pCi0gICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgd29yZDEgPSAqKCh1aW50MzIqKXByZXYpOyAvKiBiMiBiMSBiMCBiTjEgKi8KLSAgICAgICAgICAgICAgICB3b3JkMiA9ICooKHVpbnQzMiopKHByZXYgKz0gNCkpOyAvKiBiNiBiNSBiNCBiMyAqLwotICAgICAgICAgICAgICAgIHdvcmQxMiA9ICh3b3JkMSA+PiAxNik7IC8qIDAgMCBiMiBiMSAqLwotICAgICAgICAgICAgICAgIHdvcmQxID4+PSAyNDsgLyogMCAwIDAgYjIgKi8KLSAgICAgICAgICAgICAgICB3b3JkMTIgfD0gKHdvcmQyIDw8IDE2KTsgLyogYjQgYjMgYjIgYjEgKi8KLSAgICAgICAgICAgICAgICB3b3JkMSB8PSAod29yZDIgPDwgOCk7IC8qIGI1IGI0IGIzIGIyICovCi0gICAgICAgICAgICAgICAgd29yZDMgPSB3b3JkMSB8IHdvcmQxMjsgLy8gcm5kMSA9IDE7IG90aGVyd2lzZSB3b3JkMyA9IHdvcmQxJndvcmQxMgotICAgICAgICAgICAgICAgIHdvcmQxICY9IG1hc2s7Ci0gICAgICAgICAgICAgICAgd29yZDMgJj0gKH5tYXNrKTsgLyogMHgxMDEwMTAxLCBjaGVjayBsYXN0IGJpdCAqLwotICAgICAgICAgICAgICAgIHdvcmQxMiAmPSBtYXNrOwotICAgICAgICAgICAgICAgIHdvcmQxID4+PSAxOwotICAgICAgICAgICAgICAgIHdvcmQxID0gd29yZDEgKyAod29yZDEyID4+IDEpOwotICAgICAgICAgICAgICAgIHdvcmQxICs9IHdvcmQzOwotICAgICAgICAgICAgICAgICooKHVpbnQzMiopKHByZWRfYmxvY2sgKz0gb2Zmc2V0MikpID0gd29yZDE7IC8qIHdyaXRlIDQgcGl4ZWxzICovCi0KLSAgICAgICAgICAgICAgICB3b3JkMSA9ICooKHVpbnQzMiopKHByZXYgKz0gNCkpOyAvKiBiMTAgYjkgYjggYjcgKi8KLSAgICAgICAgICAgICAgICB3b3JkMTIgPSAod29yZDIgPj4gMTYpOyAvKiAwIDAgYjYgYjUgKi8KLSAgICAgICAgICAgICAgICB3b3JkMiA+Pj0gMjQ7IC8qIDAgMCAwIGI2ICovCi0gICAgICAgICAgICAgICAgd29yZDEyIHw9ICh3b3JkMSA8PCAxNik7IC8qIGI4IGI3IGI2IGI1ICovCi0gICAgICAgICAgICAgICAgd29yZDIgfD0gKHdvcmQxIDw8IDgpOyAvKiBiOSBiOCBiNyBiNiAqLwotICAgICAgICAgICAgICAgIHdvcmQzID0gd29yZDIgfCB3b3JkMTI7IC8vIHJuZDEgPSAxOyBvdGhlcndpc2Ugd29yZDMgPSB3b3JkMSZ3b3JkMTIKLSAgICAgICAgICAgICAgICB3b3JkMiAmPSBtYXNrOwotICAgICAgICAgICAgICAgIHdvcmQzICY9ICh+bWFzayk7IC8qIDB4MTAxMDEwMSwgY2hlY2sgbGFzdCBiaXQgKi8KLSAgICAgICAgICAgICAgICB3b3JkMTIgJj0gbWFzazsKLSAgICAgICAgICAgICAgICB3b3JkMiA+Pj0gMTsKLSAgICAgICAgICAgICAgICB3b3JkMiA9IHdvcmQyICsgKHdvcmQxMiA+PiAxKTsKLSAgICAgICAgICAgICAgICB3b3JkMiArPSB3b3JkMzsKLSAgICAgICAgICAgICAgICAqKCh1aW50MzIqKShwcmVkX2Jsb2NrICs9IDQpKSA9IHdvcmQyOyAvKiB3cml0ZSA0IHBpeGVscyAqLwotICAgICAgICAgICAgICAgIHByZXYgKz0gb2Zmc2V0OwotICAgICAgICAgICAgfQotICAgICAgICAgICAgcmV0dXJuIDE7Ci0gICAgICAgIH0KLSAgICAgICAgZWxzZSAvKiBybmQxID09IDAgKi8KLSAgICAgICAgewotICAgICAgICAgICAgZm9yIChpID0gQl9TSVpFOyBpID4gMDsgaS0tKQotICAgICAgICAgICAgewotICAgICAgICAgICAgICAgIHdvcmQxID0gKigodWludDMyKilwcmV2KTsgLyogYjIgYjEgYjAgYk4xICovCi0gICAgICAgICAgICAgICAgd29yZDIgPSAqKCh1aW50MzIqKShwcmV2ICs9IDQpKTsgLyogYjYgYjUgYjQgYjMgKi8KLSAgICAgICAgICAgICAgICB3b3JkMTIgPSAod29yZDEgPj4gMTYpOyAvKiAwIDAgYjIgYjEgKi8KLSAgICAgICAgICAgICAgICB3b3JkMSA+Pj0gMjQ7IC8qIDAgMCAwIGIyICovCi0gICAgICAgICAgICAgICAgd29yZDEyIHw9ICh3b3JkMiA8PCAxNik7IC8qIGI0IGIzIGIyIGIxICovCi0gICAgICAgICAgICAgICAgd29yZDEgfD0gKHdvcmQyIDw8IDgpOyAvKiBiNSBiNCBiMyBiMiAqLwotICAgICAgICAgICAgICAgIHdvcmQzID0gd29yZDEgJiB3b3JkMTI7IC8vIHJuZDEgPSAxOyBvdGhlcndpc2Ugd29yZDMgPSB3b3JkMSZ3b3JkMTIKLSAgICAgICAgICAgICAgICB3b3JkMSAmPSBtYXNrOwotICAgICAgICAgICAgICAgIHdvcmQzICY9ICh+bWFzayk7IC8qIDB4MTAxMDEwMSwgY2hlY2sgbGFzdCBiaXQgKi8KLSAgICAgICAgICAgICAgICB3b3JkMTIgJj0gbWFzazsKLSAgICAgICAgICAgICAgICB3b3JkMSA+Pj0gMTsKLSAgICAgICAgICAgICAgICB3b3JkMSA9IHdvcmQxICsgKHdvcmQxMiA+PiAxKTsKLSAgICAgICAgICAgICAgICB3b3JkMSArPSB3b3JkMzsKLSAgICAgICAgICAgICAgICAqKCh1aW50MzIqKShwcmVkX2Jsb2NrICs9IG9mZnNldDIpKSA9IHdvcmQxOyAvKiB3cml0ZSA0IHBpeGVscyAqLwotCi0gICAgICAgICAgICAgICAgd29yZDEgPSAqKCh1aW50MzIqKShwcmV2ICs9IDQpKTsgLyogYjEwIGI5IGI4IGI3ICovCi0gICAgICAgICAgICAgICAgd29yZDEyID0gKHdvcmQyID4+IDE2KTsgLyogMCAwIGI2IGI1ICovCi0gICAgICAgICAgICAgICAgd29yZDIgPj49IDI0OyAvKiAwIDAgMCBiNiAqLwotICAgICAgICAgICAgICAgIHdvcmQxMiB8PSAod29yZDEgPDwgMTYpOyAvKiBiOCBiNyBiNiBiNSAqLwotICAgICAgICAgICAgICAgIHdvcmQyIHw9ICh3b3JkMSA8PCA4KTsgLyogYjkgYjggYjcgYjYgKi8KLSAgICAgICAgICAgICAgICB3b3JkMyA9IHdvcmQyICYgd29yZDEyOyAvLyBybmQxID0gMTsgb3RoZXJ3aXNlIHdvcmQzID0gd29yZDEmd29yZDEyCi0gICAgICAgICAgICAgICAgd29yZDIgJj0gbWFzazsKLSAgICAgICAgICAgICAgICB3b3JkMyAmPSAofm1hc2spOyAvKiAweDEwMTAxMDEsIGNoZWNrIGxhc3QgYml0ICovCi0gICAgICAgICAgICAgICAgd29yZDEyICY9IG1hc2s7Ci0gICAgICAgICAgICAgICAgd29yZDIgPj49IDE7Ci0gICAgICAgICAgICAgICAgd29yZDIgPSB3b3JkMiArICh3b3JkMTIgPj4gMSk7Ci0gICAgICAgICAgICAgICAgd29yZDIgKz0gd29yZDM7Ci0gICAgICAgICAgICAgICAgKigodWludDMyKikocHJlZF9ibG9jayArPSA0KSkgPSB3b3JkMjsgLyogd3JpdGUgNCBwaXhlbHMgKi8KLSAgICAgICAgICAgICAgICBwcmV2ICs9IG9mZnNldDsKLSAgICAgICAgICAgIH0KLSAgICAgICAgICAgIHJldHVybiAxOwotICAgICAgICB9Ci0gICAgfQotICAgIGVsc2UgLyogdG1wID0gMyAqLwotICAgIHsKLSAgICAgICAgcHJldiAtPSAzOyAvKiB3b3JkLWFsaWduZWQgKi8KLSAgICAgICAgaWYgKHJuZDEgPT0gMSkKLSAgICAgICAgewotICAgICAgICAgICAgZm9yIChpID0gQl9TSVpFOyBpID4gMDsgaS0tKQotICAgICAgICAgICAgewotICAgICAgICAgICAgICAgIHdvcmQxID0gKigodWludDMyKilwcmV2KTsgLyogYjEgYjAgYk4xIGJOMiAqLwotICAgICAgICAgICAgICAgIHdvcmQyID0gKigodWludDMyKikocHJldiArPSA0KSk7IC8qIGI1IGI0IGIzIGIyICovCi0gICAgICAgICAgICAgICAgd29yZDEyID0gKHdvcmQxID4+IDI0KTsgLyogMCAwIDAgYjEgKi8KLSAgICAgICAgICAgICAgICB3b3JkMTIgfD0gKHdvcmQyIDw8IDgpOyAvKiBiNCBiMyBiMiBiMSAqLwotICAgICAgICAgICAgICAgIHdvcmQxID0gd29yZDI7Ci0gICAgICAgICAgICAgICAgd29yZDMgPSB3b3JkMSB8IHdvcmQxMjsgLy8gcm5kMSA9IDE7IG90aGVyd2lzZSB3b3JkMyA9IHdvcmQxJndvcmQxMgotICAgICAgICAgICAgICAgIHdvcmQxICY9IG1hc2s7Ci0gICAgICAgICAgICAgICAgd29yZDMgJj0gKH5tYXNrKTsgLyogMHgxMDEwMTAxLCBjaGVjayBsYXN0IGJpdCAqLwotICAgICAgICAgICAgICAgIHdvcmQxMiAmPSBtYXNrOwotICAgICAgICAgICAgICAgIHdvcmQxID4+PSAxOwotICAgICAgICAgICAgICAgIHdvcmQxID0gd29yZDEgKyAod29yZDEyID4+IDEpOwotICAgICAgICAgICAgICAgIHdvcmQxICs9IHdvcmQzOwotICAgICAgICAgICAgICAgICooKHVpbnQzMiopKHByZWRfYmxvY2sgKz0gb2Zmc2V0MikpID0gd29yZDE7IC8qIHdyaXRlIDQgcGl4ZWxzICovCi0KLSAgICAgICAgICAgICAgICB3b3JkMSA9ICooKHVpbnQzMiopKHByZXYgKz0gNCkpOyAvKiBiOSBiOCBiNyBiNiAqLwotICAgICAgICAgICAgICAgIHdvcmQxMiA9ICh3b3JkMiA+PiAyNCk7IC8qIDAgMCAwIGI1ICovCi0gICAgICAgICAgICAgICAgd29yZDEyIHw9ICh3b3JkMSA8PCA4KTsgLyogYjggYjcgYjYgYjUgKi8KLSAgICAgICAgICAgICAgICB3b3JkMiA9IHdvcmQxOyAvKiBiOSBiOCBiNyBiNiAqLwotICAgICAgICAgICAgICAgIHdvcmQzID0gd29yZDIgfCB3b3JkMTI7IC8vIHJuZDEgPSAxOyBvdGhlcndpc2Ugd29yZDMgPSB3b3JkMSZ3b3JkMTIKLSAgICAgICAgICAgICAgICB3b3JkMiAmPSBtYXNrOwotICAgICAgICAgICAgICAgIHdvcmQzICY9ICh+bWFzayk7IC8qIDB4MTAxMDEwMSwgY2hlY2sgbGFzdCBiaXQgKi8KLSAgICAgICAgICAgICAgICB3b3JkMTIgJj0gbWFzazsKLSAgICAgICAgICAgICAgICB3b3JkMiA+Pj0gMTsKLSAgICAgICAgICAgICAgICB3b3JkMiA9IHdvcmQyICsgKHdvcmQxMiA+PiAxKTsKLSAgICAgICAgICAgICAgICB3b3JkMiArPSB3b3JkMzsKLSAgICAgICAgICAgICAgICAqKCh1aW50MzIqKShwcmVkX2Jsb2NrICs9IDQpKSA9IHdvcmQyOyAvKiB3cml0ZSA0IHBpeGVscyAqLwotICAgICAgICAgICAgICAgIHByZXYgKz0gb2Zmc2V0OwotICAgICAgICAgICAgfQotICAgICAgICAgICAgcmV0dXJuIDE7Ci0gICAgICAgIH0KLSAgICAgICAgZWxzZQotICAgICAgICB7Ci0gICAgICAgICAgICBmb3IgKGkgPSBCX1NJWkU7IGkgPiAwOyBpLS0pCi0gICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgd29yZDEgPSAqKCh1aW50MzIqKXByZXYpOyAvKiBiMSBiMCBiTjEgYk4yICovCi0gICAgICAgICAgICAgICAgd29yZDIgPSAqKCh1aW50MzIqKShwcmV2ICs9IDQpKTsgLyogYjUgYjQgYjMgYjIgKi8KLSAgICAgICAgICAgICAgICB3b3JkMTIgPSAod29yZDEgPj4gMjQpOyAvKiAwIDAgMCBiMSAqLwotICAgICAgICAgICAgICAgIHdvcmQxMiB8PSAod29yZDIgPDwgOCk7IC8qIGI0IGIzIGIyIGIxICovCi0gICAgICAgICAgICAgICAgd29yZDEgPSB3b3JkMjsKLSAgICAgICAgICAgICAgICB3b3JkMyA9IHdvcmQxICYgd29yZDEyOyAvLyBybmQxID0gMTsgb3RoZXJ3aXNlIHdvcmQzID0gd29yZDEmd29yZDEyCi0gICAgICAgICAgICAgICAgd29yZDEgJj0gbWFzazsKLSAgICAgICAgICAgICAgICB3b3JkMyAmPSAofm1hc2spOyAvKiAweDEwMTAxMDEsIGNoZWNrIGxhc3QgYml0ICovCi0gICAgICAgICAgICAgICAgd29yZDEyICY9IG1hc2s7Ci0gICAgICAgICAgICAgICAgd29yZDEgPj49IDE7Ci0gICAgICAgICAgICAgICAgd29yZDEgPSB3b3JkMSArICh3b3JkMTIgPj4gMSk7Ci0gICAgICAgICAgICAgICAgd29yZDEgKz0gd29yZDM7Ci0gICAgICAgICAgICAgICAgKigodWludDMyKikocHJlZF9ibG9jayArPSBvZmZzZXQyKSkgPSB3b3JkMTsgLyogd3JpdGUgNCBwaXhlbHMgKi8KLQotICAgICAgICAgICAgICAgIHdvcmQxID0gKigodWludDMyKikocHJldiArPSA0KSk7IC8qIGI5IGI4IGI3IGI2ICovCi0gICAgICAgICAgICAgICAgd29yZDEyID0gKHdvcmQyID4+IDI0KTsgLyogMCAwIDAgYjUgKi8KLSAgICAgICAgICAgICAgICB3b3JkMTIgfD0gKHdvcmQxIDw8IDgpOyAvKiBiOCBiNyBiNiBiNSAqLwotICAgICAgICAgICAgICAgIHdvcmQyID0gd29yZDE7IC8qIGI5IGI4IGI3IGI2ICovCi0gICAgICAgICAgICAgICAgd29yZDMgPSB3b3JkMiAmIHdvcmQxMjsgLy8gcm5kMSA9IDE7IG90aGVyd2lzZSB3b3JkMyA9IHdvcmQxJndvcmQxMgotICAgICAgICAgICAgICAgIHdvcmQyICY9IG1hc2s7Ci0gICAgICAgICAgICAgICAgd29yZDMgJj0gKH5tYXNrKTsgLyogMHgxMDEwMTAxLCBjaGVjayBsYXN0IGJpdCAqLwotICAgICAgICAgICAgICAgIHdvcmQxMiAmPSBtYXNrOwotICAgICAgICAgICAgICAgIHdvcmQyID4+PSAxOwotICAgICAgICAgICAgICAgIHdvcmQyID0gd29yZDIgKyAod29yZDEyID4+IDEpOwotICAgICAgICAgICAgICAgIHdvcmQyICs9IHdvcmQzOwotICAgICAgICAgICAgICAgICooKHVpbnQzMiopKHByZWRfYmxvY2sgKz0gNCkpID0gd29yZDI7IC8qIHdyaXRlIDQgcGl4ZWxzICovCi0gICAgICAgICAgICAgICAgcHJldiArPSBvZmZzZXQ7Ci0gICAgICAgICAgICB9Ci0gICAgICAgICAgICByZXR1cm4gMTsKLSAgICAgICAgfQotICAgIH0KLX0KLQotLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotaW50IEdldFByZWRBZHZhbmNlZEJ5MXgwKAotICAgIHVpbnQ4ICpwcmV2LCAgICAgICAgLyogaSAqLwotICAgIHVpbnQ4ICpwcmVkX2Jsb2NrLCAgICAgIC8qIGkgKi8KLSAgICBpbnQgd2lkdGgsICAgICAgLyogaSAqLwotICAgIGludCBwcmVkX3dpZHRoX3JuZCAvKiBpICovCi0pCi17Ci0gICAgdWludCAgICBpOyAgICAgIC8qIGxvb3AgdmFyaWFibGUgKi8KLSAgICBpbnQgb2Zmc2V0LCBvZmZzZXQyOwotICAgIHVpbnQzMiAgd29yZDEsIHdvcmQyLCB3b3JkMywgd29yZDEyLCB3b3JkMjI7Ci0gICAgaW50IHRtcDsKLSAgICBpbnQgcm5kMTsKLSAgICB1aW50MzIgbWFzazsKLQotICAgIC8qIGluaXRpYWxpemUgb2Zmc2V0IHRvIGFkanVzdCBwaXhlbCBjb3VudGVyICovCi0gICAgLyogICAgdGhlIG5leHQgcm93OyBmdWxsLXBlbCByZXNvbHV0aW9uICAgICAgKi8KLSAgICBvZmZzZXQgPSB3aWR0aCAtIEJfU0laRTsgLyogb2Zmc2V0IGZvciBwcmV2ICovCi0gICAgb2Zmc2V0MiA9IChwcmVkX3dpZHRoX3JuZCA+PiAxKSAtIDQ7IC8qIG9mZnNldCBmb3IgcHJlZF9ibG9jayAqLwotCi0gICAgcm5kMSA9IHByZWRfd2lkdGhfcm5kICYgMTsKLQotICAgIC8qIEJyYW5jaCBiYXNlZCBvbiBwaXhlbCBsb2NhdGlvbiAoaGFsZi1wZWwgb3IgZnVsbC1wZWwpIGZvciB4IGFuZCB5ICovCi0gICAgcHJlZF9ibG9jayAtPSBvZmZzZXQyOyAvKiBwcmVzZXQgKi8KLQotICAgIHRtcCA9ICh1aW50MzIpcHJldiAmIDM7Ci0gICAgbWFzayA9IDI1NDsKLSAgICBtYXNrIHw9IChtYXNrIDw8IDgpOwotICAgIG1hc2sgfD0gKG1hc2sgPDwgMTYpOyAvKiAweEZFRkVGRUZFICovCi0KLSAgICBpZiAodG1wID09IDApIC8qIHdvcmQtYWxpZ25lZCAqLwotICAgIHsKLSAgICAgICAgcHJldiAtPSA0OwotICAgICAgICBpZiAocm5kMSA9PSAxKQotICAgICAgICB7Ci0gICAgICAgICAgICBmb3IgKGkgPSBCX1NJWkU7IGkgPiAwOyBpLS0pCi0gICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgd29yZDEgPSAqKCh1aW50MzIqKShwcmV2ICs9IDQpKTsKLSAgICAgICAgICAgICAgICB3b3JkMiA9ICooKHVpbnQzMiopKHByZXYgKyB3aWR0aCkpOwotICAgICAgICAgICAgICAgIHdvcmQzID0gd29yZDEgfCB3b3JkMjsgLy8gcm5kMSA9IDE7IG90aGVyd2lzZSB3b3JkMyA9IHdvcmQxJndvcmQyCi0gICAgICAgICAgICAgICAgd29yZDEgJj0gbWFzazsKLSAgICAgICAgICAgICAgICB3b3JkMyAmPSAofm1hc2spOyAvKiAweDEwMTAxMDEsIGNoZWNrIGxhc3QgYml0ICovCi0gICAgICAgICAgICAgICAgd29yZDIgJj0gbWFzazsKLSAgICAgICAgICAgICAgICB3b3JkMSA+Pj0gMTsKLSAgICAgICAgICAgICAgICB3b3JkMSA9IHdvcmQxICsgKHdvcmQyID4+IDEpOwotICAgICAgICAgICAgICAgIHdvcmQxICs9IHdvcmQzOwotICAgICAgICAgICAgICAgICooKHVpbnQzMiopKHByZWRfYmxvY2sgKz0gb2Zmc2V0MikpID0gd29yZDE7Ci0gICAgICAgICAgICAgICAgd29yZDEgPSAqKCh1aW50MzIqKShwcmV2ICs9IDQpKTsKLSAgICAgICAgICAgICAgICB3b3JkMiA9ICooKHVpbnQzMiopKHByZXYgKyB3aWR0aCkpOwotICAgICAgICAgICAgICAgIHdvcmQzID0gd29yZDEgfCB3b3JkMjsgLy8gcm5kMSA9IDE7IG90aGVyd2lzZSB3b3JkMyA9IHdvcmQxJndvcmQyCi0gICAgICAgICAgICAgICAgd29yZDEgJj0gbWFzazsKLSAgICAgICAgICAgICAgICB3b3JkMyAmPSAofm1hc2spOyAvKiAweDEwMTAxMDEsIGNoZWNrIGxhc3QgYml0ICovCi0gICAgICAgICAgICAgICAgd29yZDIgJj0gbWFzazsKLSAgICAgICAgICAgICAgICB3b3JkMSA+Pj0gMTsKLSAgICAgICAgICAgICAgICB3b3JkMSA9IHdvcmQxICsgKHdvcmQyID4+IDEpOwotICAgICAgICAgICAgICAgIHdvcmQxICs9IHdvcmQzOwotICAgICAgICAgICAgICAgICooKHVpbnQzMiopKHByZWRfYmxvY2sgKz0gNCkpID0gd29yZDE7Ci0KLSAgICAgICAgICAgICAgICBwcmV2ICs9IG9mZnNldDsKLSAgICAgICAgICAgIH0KLSAgICAgICAgICAgIHJldHVybiAxOwotICAgICAgICB9Ci0gICAgICAgIGVsc2UgICAvKiBybmQxID0gMCAqLwotICAgICAgICB7Ci0gICAgICAgICAgICBmb3IgKGkgPSBCX1NJWkU7IGkgPiAwOyBpLS0pCi0gICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgd29yZDEgPSAqKCh1aW50MzIqKShwcmV2ICs9IDQpKTsKLSAgICAgICAgICAgICAgICB3b3JkMiA9ICooKHVpbnQzMiopKHByZXYgKyB3aWR0aCkpOwotICAgICAgICAgICAgICAgIHdvcmQzID0gd29yZDEgJiB3b3JkMjsgIC8qIHJuZDEgPSAwOyAqLwotICAgICAgICAgICAgICAgIHdvcmQxICY9IG1hc2s7Ci0gICAgICAgICAgICAgICAgd29yZDMgJj0gKH5tYXNrKTsgLyogMHgxMDEwMTAxLCBjaGVjayBsYXN0IGJpdCAqLwotICAgICAgICAgICAgICAgIHdvcmQyICY9IG1hc2s7Ci0gICAgICAgICAgICAgICAgd29yZDEgPj49IDE7Ci0gICAgICAgICAgICAgICAgd29yZDEgPSB3b3JkMSArICh3b3JkMiA+PiAxKTsKLSAgICAgICAgICAgICAgICB3b3JkMSArPSB3b3JkMzsKLSAgICAgICAgICAgICAgICAqKCh1aW50MzIqKShwcmVkX2Jsb2NrICs9IG9mZnNldDIpKSA9IHdvcmQxOwotICAgICAgICAgICAgICAgIHdvcmQxID0gKigodWludDMyKikocHJldiArPSA0KSk7Ci0gICAgICAgICAgICAgICAgd29yZDIgPSAqKCh1aW50MzIqKShwcmV2ICsgd2lkdGgpKTsKLSAgICAgICAgICAgICAgICB3b3JkMyA9IHdvcmQxICYgd29yZDI7ICAvKiBybmQxID0gMDsgKi8KLSAgICAgICAgICAgICAgICB3b3JkMSAmPSBtYXNrOwotICAgICAgICAgICAgICAgIHdvcmQzICY9ICh+bWFzayk7IC8qIDB4MTAxMDEwMSwgY2hlY2sgbGFzdCBiaXQgKi8KLSAgICAgICAgICAgICAgICB3b3JkMiAmPSBtYXNrOwotICAgICAgICAgICAgICAgIHdvcmQxID4+PSAxOwotICAgICAgICAgICAgICAgIHdvcmQxID0gd29yZDEgKyAod29yZDIgPj4gMSk7Ci0gICAgICAgICAgICAgICAgd29yZDEgKz0gd29yZDM7Ci0gICAgICAgICAgICAgICAgKigodWludDMyKikocHJlZF9ibG9jayArPSA0KSkgPSB3b3JkMTsKLQotICAgICAgICAgICAgICAgIHByZXYgKz0gb2Zmc2V0OwotICAgICAgICAgICAgfQotICAgICAgICAgICAgcmV0dXJuIDE7Ci0gICAgICAgIH0KLSAgICB9Ci0gICAgZWxzZSBpZiAodG1wID09IDEpCi0gICAgewotICAgICAgICBwcmV2LS07IC8qIHdvcmQtYWxpZ25lZCAqLwotICAgICAgICBpZiAocm5kMSA9PSAxKQotICAgICAgICB7Ci0gICAgICAgICAgICBmb3IgKGkgPSBCX1NJWkU7IGkgPiAwOyBpLS0pCi0gICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgd29yZDEyID0gKigodWludDMyKilwcmV2KTsgLyogcmVhZCBiNCBiMyBiMiBiMSAqLwotICAgICAgICAgICAgICAgIHdvcmQyMiA9ICooKHVpbnQzMiopKHByZXYgKyB3aWR0aCkpOwotCi0gICAgICAgICAgICAgICAgd29yZDEgPSAqKCh1aW50MzIqKShwcmV2ICs9IDQpKTsgLyogcmVhZCBiOCBiNyBiNiBiNSAqLwotICAgICAgICAgICAgICAgIHdvcmQyID0gKigodWludDMyKikocHJldiArIHdpZHRoKSk7Ci0gICAgICAgICAgICAgICAgd29yZDEyID4+PSA4OyAvKiAwIGI0IGIzIGIyICovCi0gICAgICAgICAgICAgICAgd29yZDIyID4+PSA4OwotICAgICAgICAgICAgICAgIHdvcmQxMiA9IHdvcmQxMiB8ICh3b3JkMSA8PCAyNCk7IC8qIGI1IGI0IGIzIGIyICovCi0gICAgICAgICAgICAgICAgd29yZDIyID0gd29yZDIyIHwgKHdvcmQyIDw8IDI0KTsKLSAgICAgICAgICAgICAgICB3b3JkMyA9IHdvcmQxMiB8IHdvcmQyMjsKLSAgICAgICAgICAgICAgICB3b3JkMTIgJj0gbWFzazsKLSAgICAgICAgICAgICAgICB3b3JkMjIgJj0gbWFzazsKLSAgICAgICAgICAgICAgICB3b3JkMyAmPSAofm1hc2spOyAvKiAweDEwMTAxMDEsIGNoZWNrIGxhc3QgYml0ICovCi0gICAgICAgICAgICAgICAgd29yZDEyID4+PSAxOwotICAgICAgICAgICAgICAgIHdvcmQxMiA9IHdvcmQxMiArICh3b3JkMjIgPj4gMSk7Ci0gICAgICAgICAgICAgICAgd29yZDEyICs9IHdvcmQzOwotICAgICAgICAgICAgICAgICooKHVpbnQzMiopKHByZWRfYmxvY2sgKz0gb2Zmc2V0MikpID0gd29yZDEyOwotCi0gICAgICAgICAgICAgICAgd29yZDEyID0gKigodWludDMyKikocHJldiArPSA0KSk7IC8qIHJlYWQgYjEyIGIxMSBiMTAgYjkgKi8KLSAgICAgICAgICAgICAgICB3b3JkMjIgPSAqKCh1aW50MzIqKShwcmV2ICsgd2lkdGgpKTsKLSAgICAgICAgICAgICAgICB3b3JkMSA+Pj0gODsgLyogMCBiOCBiNyBiNiAqLwotICAgICAgICAgICAgICAgIHdvcmQyID4+PSA4OwotICAgICAgICAgICAgICAgIHdvcmQxID0gd29yZDEgfCAod29yZDEyIDw8IDI0KTsgLyogYjkgYjggYjcgYjYgKi8KLSAgICAgICAgICAgICAgICB3b3JkMiA9IHdvcmQyIHwgKHdvcmQyMiA8PCAyNCk7Ci0gICAgICAgICAgICAgICAgd29yZDMgPSB3b3JkMSB8IHdvcmQyOwotICAgICAgICAgICAgICAgIHdvcmQxICY9IG1hc2s7Ci0gICAgICAgICAgICAgICAgd29yZDIgJj0gbWFzazsKLSAgICAgICAgICAgICAgICB3b3JkMyAmPSAofm1hc2spOyAvKiAweDEwMTAxMDEsIGNoZWNrIGxhc3QgYml0ICovCi0gICAgICAgICAgICAgICAgd29yZDEgPj49IDE7Ci0gICAgICAgICAgICAgICAgd29yZDEgPSB3b3JkMSArICh3b3JkMiA+PiAxKTsKLSAgICAgICAgICAgICAgICB3b3JkMSArPSB3b3JkMzsKLSAgICAgICAgICAgICAgICAqKCh1aW50MzIqKShwcmVkX2Jsb2NrICs9IDQpKSA9IHdvcmQxOwotICAgICAgICAgICAgICAgIHByZXYgKz0gb2Zmc2V0OwotICAgICAgICAgICAgfQotICAgICAgICAgICAgcmV0dXJuIDE7Ci0gICAgICAgIH0KLSAgICAgICAgZWxzZSAvKiBybmQxID0gMCAqLwotICAgICAgICB7Ci0gICAgICAgICAgICBmb3IgKGkgPSBCX1NJWkU7IGkgPiAwOyBpLS0pCi0gICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgd29yZDEyID0gKigodWludDMyKilwcmV2KTsgLyogcmVhZCBiNCBiMyBiMiBiMSAqLwotICAgICAgICAgICAgICAgIHdvcmQyMiA9ICooKHVpbnQzMiopKHByZXYgKyB3aWR0aCkpOwotCi0gICAgICAgICAgICAgICAgd29yZDEgPSAqKCh1aW50MzIqKShwcmV2ICs9IDQpKTsgLyogcmVhZCBiOCBiNyBiNiBiNSAqLwotICAgICAgICAgICAgICAgIHdvcmQyID0gKigodWludDMyKikocHJldiArIHdpZHRoKSk7Ci0gICAgICAgICAgICAgICAgd29yZDEyID4+PSA4OyAvKiAwIGI0IGIzIGIyICovCi0gICAgICAgICAgICAgICAgd29yZDIyID4+PSA4OwotICAgICAgICAgICAgICAgIHdvcmQxMiA9IHdvcmQxMiB8ICh3b3JkMSA8PCAyNCk7IC8qIGI1IGI0IGIzIGIyICovCi0gICAgICAgICAgICAgICAgd29yZDIyID0gd29yZDIyIHwgKHdvcmQyIDw8IDI0KTsKLSAgICAgICAgICAgICAgICB3b3JkMyA9IHdvcmQxMiAmIHdvcmQyMjsKLSAgICAgICAgICAgICAgICB3b3JkMTIgJj0gbWFzazsKLSAgICAgICAgICAgICAgICB3b3JkMjIgJj0gbWFzazsKLSAgICAgICAgICAgICAgICB3b3JkMyAmPSAofm1hc2spOyAvKiAweDEwMTAxMDEsIGNoZWNrIGxhc3QgYml0ICovCi0gICAgICAgICAgICAgICAgd29yZDEyID4+PSAxOwotICAgICAgICAgICAgICAgIHdvcmQxMiA9IHdvcmQxMiArICh3b3JkMjIgPj4gMSk7Ci0gICAgICAgICAgICAgICAgd29yZDEyICs9IHdvcmQzOwotICAgICAgICAgICAgICAgICooKHVpbnQzMiopKHByZWRfYmxvY2sgKz0gb2Zmc2V0MikpID0gd29yZDEyOwotCi0gICAgICAgICAgICAgICAgd29yZDEyID0gKigodWludDMyKikocHJldiArPSA0KSk7IC8qIHJlYWQgYjEyIGIxMSBiMTAgYjkgKi8KLSAgICAgICAgICAgICAgICB3b3JkMjIgPSAqKCh1aW50MzIqKShwcmV2ICsgd2lkdGgpKTsKLSAgICAgICAgICAgICAgICB3b3JkMSA+Pj0gODsgLyogMCBiOCBiNyBiNiAqLwotICAgICAgICAgICAgICAgIHdvcmQyID4+PSA4OwotICAgICAgICAgICAgICAgIHdvcmQxID0gd29yZDEgfCAod29yZDEyIDw8IDI0KTsgLyogYjkgYjggYjcgYjYgKi8KLSAgICAgICAgICAgICAgICB3b3JkMiA9IHdvcmQyIHwgKHdvcmQyMiA8PCAyNCk7Ci0gICAgICAgICAgICAgICAgd29yZDMgPSB3b3JkMSAmIHdvcmQyOwotICAgICAgICAgICAgICAgIHdvcmQxICY9IG1hc2s7Ci0gICAgICAgICAgICAgICAgd29yZDIgJj0gbWFzazsKLSAgICAgICAgICAgICAgICB3b3JkMyAmPSAofm1hc2spOyAvKiAweDEwMTAxMDEsIGNoZWNrIGxhc3QgYml0ICovCi0gICAgICAgICAgICAgICAgd29yZDEgPj49IDE7Ci0gICAgICAgICAgICAgICAgd29yZDEgPSB3b3JkMSArICh3b3JkMiA+PiAxKTsKLSAgICAgICAgICAgICAgICB3b3JkMSArPSB3b3JkMzsKLSAgICAgICAgICAgICAgICAqKCh1aW50MzIqKShwcmVkX2Jsb2NrICs9IDQpKSA9IHdvcmQxOwotICAgICAgICAgICAgICAgIHByZXYgKz0gb2Zmc2V0OwotICAgICAgICAgICAgfQotICAgICAgICAgICAgcmV0dXJuIDE7Ci0gICAgICAgIH0KLSAgICB9Ci0gICAgZWxzZSBpZiAodG1wID09IDIpCi0gICAgewotICAgICAgICBwcmV2IC09IDI7IC8qIHdvcmQtYWxpZ25lZCAqLwotICAgICAgICBpZiAocm5kMSA9PSAxKQotICAgICAgICB7Ci0gICAgICAgICAgICBmb3IgKGkgPSBCX1NJWkU7IGkgPiAwOyBpLS0pCi0gICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgd29yZDEyID0gKigodWludDMyKilwcmV2KTsgLyogcmVhZCBiNCBiMyBiMiBiMSAqLwotICAgICAgICAgICAgICAgIHdvcmQyMiA9ICooKHVpbnQzMiopKHByZXYgKyB3aWR0aCkpOwotCi0gICAgICAgICAgICAgICAgd29yZDEgPSAqKCh1aW50MzIqKShwcmV2ICs9IDQpKTsgLyogcmVhZCBiOCBiNyBiNiBiNSAqLwotICAgICAgICAgICAgICAgIHdvcmQyID0gKigodWludDMyKikocHJldiArIHdpZHRoKSk7Ci0gICAgICAgICAgICAgICAgd29yZDEyID4+PSAxNjsgLyogMCAwIGI0IGIzICovCi0gICAgICAgICAgICAgICAgd29yZDIyID4+PSAxNjsKLSAgICAgICAgICAgICAgICB3b3JkMTIgPSB3b3JkMTIgfCAod29yZDEgPDwgMTYpOyAvKiBiNiBiNSBiNCBiMyAqLwotICAgICAgICAgICAgICAgIHdvcmQyMiA9IHdvcmQyMiB8ICh3b3JkMiA8PCAxNik7Ci0gICAgICAgICAgICAgICAgd29yZDMgPSB3b3JkMTIgfCB3b3JkMjI7Ci0gICAgICAgICAgICAgICAgd29yZDEyICY9IG1hc2s7Ci0gICAgICAgICAgICAgICAgd29yZDIyICY9IG1hc2s7Ci0gICAgICAgICAgICAgICAgd29yZDMgJj0gKH5tYXNrKTsgLyogMHgxMDEwMTAxLCBjaGVjayBsYXN0IGJpdCAqLwotICAgICAgICAgICAgICAgIHdvcmQxMiA+Pj0gMTsKLSAgICAgICAgICAgICAgICB3b3JkMTIgPSB3b3JkMTIgKyAod29yZDIyID4+IDEpOwotICAgICAgICAgICAgICAgIHdvcmQxMiArPSB3b3JkMzsKLSAgICAgICAgICAgICAgICAqKCh1aW50MzIqKShwcmVkX2Jsb2NrICs9IG9mZnNldDIpKSA9IHdvcmQxMjsKLQotICAgICAgICAgICAgICAgIHdvcmQxMiA9ICooKHVpbnQzMiopKHByZXYgKz0gNCkpOyAvKiByZWFkIGIxMiBiMTEgYjEwIGI5ICovCi0gICAgICAgICAgICAgICAgd29yZDIyID0gKigodWludDMyKikocHJldiArIHdpZHRoKSk7Ci0gICAgICAgICAgICAgICAgd29yZDEgPj49IDE2OyAvKiAwIDAgYjggYjcgKi8KLSAgICAgICAgICAgICAgICB3b3JkMiA+Pj0gMTY7Ci0gICAgICAgICAgICAgICAgd29yZDEgPSB3b3JkMSB8ICh3b3JkMTIgPDwgMTYpOyAvKiBiMTAgYjkgYjggYjcgKi8KLSAgICAgICAgICAgICAgICB3b3JkMiA9IHdvcmQyIHwgKHdvcmQyMiA8PCAxNik7Ci0gICAgICAgICAgICAgICAgd29yZDMgPSB3b3JkMSB8IHdvcmQyOwotICAgICAgICAgICAgICAgIHdvcmQxICY9IG1hc2s7Ci0gICAgICAgICAgICAgICAgd29yZDIgJj0gbWFzazsKLSAgICAgICAgICAgICAgICB3b3JkMyAmPSAofm1hc2spOyAvKiAweDEwMTAxMDEsIGNoZWNrIGxhc3QgYml0ICovCi0gICAgICAgICAgICAgICAgd29yZDEgPj49IDE7Ci0gICAgICAgICAgICAgICAgd29yZDEgPSB3b3JkMSArICh3b3JkMiA+PiAxKTsKLSAgICAgICAgICAgICAgICB3b3JkMSArPSB3b3JkMzsKLSAgICAgICAgICAgICAgICAqKCh1aW50MzIqKShwcmVkX2Jsb2NrICs9IDQpKSA9IHdvcmQxOwotICAgICAgICAgICAgICAgIHByZXYgKz0gb2Zmc2V0OwotICAgICAgICAgICAgfQotICAgICAgICAgICAgcmV0dXJuIDE7Ci0gICAgICAgIH0KLSAgICAgICAgZWxzZSAvKiBybmQxID0gMCAqLwotICAgICAgICB7Ci0gICAgICAgICAgICBmb3IgKGkgPSBCX1NJWkU7IGkgPiAwOyBpLS0pCi0gICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgd29yZDEyID0gKigodWludDMyKilwcmV2KTsgLyogcmVhZCBiNCBiMyBiMiBiMSAqLwotICAgICAgICAgICAgICAgIHdvcmQyMiA9ICooKHVpbnQzMiopKHByZXYgKyB3aWR0aCkpOwotCi0gICAgICAgICAgICAgICAgd29yZDEgPSAqKCh1aW50MzIqKShwcmV2ICs9IDQpKTsgLyogcmVhZCBiOCBiNyBiNiBiNSAqLwotICAgICAgICAgICAgICAgIHdvcmQyID0gKigodWludDMyKikocHJldiArIHdpZHRoKSk7Ci0gICAgICAgICAgICAgICAgd29yZDEyID4+PSAxNjsgLyogMCAwIGI0IGIzICovCi0gICAgICAgICAgICAgICAgd29yZDIyID4+PSAxNjsKLSAgICAgICAgICAgICAgICB3b3JkMTIgPSB3b3JkMTIgfCAod29yZDEgPDwgMTYpOyAvKiBiNiBiNSBiNCBiMyAqLwotICAgICAgICAgICAgICAgIHdvcmQyMiA9IHdvcmQyMiB8ICh3b3JkMiA8PCAxNik7Ci0gICAgICAgICAgICAgICAgd29yZDMgPSB3b3JkMTIgJiB3b3JkMjI7Ci0gICAgICAgICAgICAgICAgd29yZDEyICY9IG1hc2s7Ci0gICAgICAgICAgICAgICAgd29yZDIyICY9IG1hc2s7Ci0gICAgICAgICAgICAgICAgd29yZDMgJj0gKH5tYXNrKTsgLyogMHgxMDEwMTAxLCBjaGVjayBsYXN0IGJpdCAqLwotICAgICAgICAgICAgICAgIHdvcmQxMiA+Pj0gMTsKLSAgICAgICAgICAgICAgICB3b3JkMTIgPSB3b3JkMTIgKyAod29yZDIyID4+IDEpOwotICAgICAgICAgICAgICAgIHdvcmQxMiArPSB3b3JkMzsKLSAgICAgICAgICAgICAgICAqKCh1aW50MzIqKShwcmVkX2Jsb2NrICs9IG9mZnNldDIpKSA9IHdvcmQxMjsKLQotICAgICAgICAgICAgICAgIHdvcmQxMiA9ICooKHVpbnQzMiopKHByZXYgKz0gNCkpOyAvKiByZWFkIGIxMiBiMTEgYjEwIGI5ICovCi0gICAgICAgICAgICAgICAgd29yZDIyID0gKigodWludDMyKikocHJldiArIHdpZHRoKSk7Ci0gICAgICAgICAgICAgICAgd29yZDEgPj49IDE2OyAvKiAwIDAgYjggYjcgKi8KLSAgICAgICAgICAgICAgICB3b3JkMiA+Pj0gMTY7Ci0gICAgICAgICAgICAgICAgd29yZDEgPSB3b3JkMSB8ICh3b3JkMTIgPDwgMTYpOyAvKiBiMTAgYjkgYjggYjcgKi8KLSAgICAgICAgICAgICAgICB3b3JkMiA9IHdvcmQyIHwgKHdvcmQyMiA8PCAxNik7Ci0gICAgICAgICAgICAgICAgd29yZDMgPSB3b3JkMSAmIHdvcmQyOwotICAgICAgICAgICAgICAgIHdvcmQxICY9IG1hc2s7Ci0gICAgICAgICAgICAgICAgd29yZDIgJj0gbWFzazsKLSAgICAgICAgICAgICAgICB3b3JkMyAmPSAofm1hc2spOyAvKiAweDEwMTAxMDEsIGNoZWNrIGxhc3QgYml0ICovCi0gICAgICAgICAgICAgICAgd29yZDEgPj49IDE7Ci0gICAgICAgICAgICAgICAgd29yZDEgPSB3b3JkMSArICh3b3JkMiA+PiAxKTsKLSAgICAgICAgICAgICAgICB3b3JkMSArPSB3b3JkMzsKLSAgICAgICAgICAgICAgICAqKCh1aW50MzIqKShwcmVkX2Jsb2NrICs9IDQpKSA9IHdvcmQxOwotICAgICAgICAgICAgICAgIHByZXYgKz0gb2Zmc2V0OwotICAgICAgICAgICAgfQotCi0gICAgICAgICAgICByZXR1cm4gMTsKLSAgICAgICAgfQotICAgIH0KLSAgICBlbHNlIC8qIHRtcCA9PSAzICovCi0gICAgewotICAgICAgICBwcmV2IC09IDM7IC8qIHdvcmQtYWxpZ25lZCAqLwotICAgICAgICBpZiAocm5kMSA9PSAxKQotICAgICAgICB7Ci0gICAgICAgICAgICBmb3IgKGkgPSBCX1NJWkU7IGkgPiAwOyBpLS0pCi0gICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgd29yZDEyID0gKigodWludDMyKilwcmV2KTsgLyogcmVhZCBiNCBiMyBiMiBiMSAqLwotICAgICAgICAgICAgICAgIHdvcmQyMiA9ICooKHVpbnQzMiopKHByZXYgKyB3aWR0aCkpOwotCi0gICAgICAgICAgICAgICAgd29yZDEgPSAqKCh1aW50MzIqKShwcmV2ICs9IDQpKTsgLyogcmVhZCBiOCBiNyBiNiBiNSAqLwotICAgICAgICAgICAgICAgIHdvcmQyID0gKigodWludDMyKikocHJldiArIHdpZHRoKSk7Ci0gICAgICAgICAgICAgICAgd29yZDEyID4+PSAyNDsgLyogMCAwIDAgYjQgKi8KLSAgICAgICAgICAgICAgICB3b3JkMjIgPj49IDI0OwotICAgICAgICAgICAgICAgIHdvcmQxMiA9IHdvcmQxMiB8ICh3b3JkMSA8PCA4KTsgLyogYjcgYjYgYjUgYjQgKi8KLSAgICAgICAgICAgICAgICB3b3JkMjIgPSB3b3JkMjIgfCAod29yZDIgPDwgOCk7Ci0gICAgICAgICAgICAgICAgd29yZDMgPSB3b3JkMTIgfCB3b3JkMjI7Ci0gICAgICAgICAgICAgICAgd29yZDEyICY9IG1hc2s7Ci0gICAgICAgICAgICAgICAgd29yZDIyICY9IG1hc2s7Ci0gICAgICAgICAgICAgICAgd29yZDMgJj0gKH5tYXNrKTsgLyogMHgxMDEwMTAxLCBjaGVjayBsYXN0IGJpdCAqLwotICAgICAgICAgICAgICAgIHdvcmQxMiA+Pj0gMTsKLSAgICAgICAgICAgICAgICB3b3JkMTIgPSB3b3JkMTIgKyAod29yZDIyID4+IDEpOwotICAgICAgICAgICAgICAgIHdvcmQxMiArPSB3b3JkMzsKLSAgICAgICAgICAgICAgICAqKCh1aW50MzIqKShwcmVkX2Jsb2NrICs9IG9mZnNldDIpKSA9IHdvcmQxMjsKLQotICAgICAgICAgICAgICAgIHdvcmQxMiA9ICooKHVpbnQzMiopKHByZXYgKz0gNCkpOyAvKiByZWFkIGIxMiBiMTEgYjEwIGI5ICovCi0gICAgICAgICAgICAgICAgd29yZDIyID0gKigodWludDMyKikocHJldiArIHdpZHRoKSk7Ci0gICAgICAgICAgICAgICAgd29yZDEgPj49IDI0OyAvKiAwIDAgMCBiOCAqLwotICAgICAgICAgICAgICAgIHdvcmQyID4+PSAyNDsKLSAgICAgICAgICAgICAgICB3b3JkMSA9IHdvcmQxIHwgKHdvcmQxMiA8PCA4KTsgLyogYjExIGIxMCBiOSBiOCAqLwotICAgICAgICAgICAgICAgIHdvcmQyID0gd29yZDIgfCAod29yZDIyIDw8IDgpOwotICAgICAgICAgICAgICAgIHdvcmQzID0gd29yZDEgfCB3b3JkMjsKLSAgICAgICAgICAgICAgICB3b3JkMSAmPSBtYXNrOwotICAgICAgICAgICAgICAgIHdvcmQyICY9IG1hc2s7Ci0gICAgICAgICAgICAgICAgd29yZDMgJj0gKH5tYXNrKTsgLyogMHgxMDEwMTAxLCBjaGVjayBsYXN0IGJpdCAqLwotICAgICAgICAgICAgICAgIHdvcmQxID4+PSAxOwotICAgICAgICAgICAgICAgIHdvcmQxID0gd29yZDEgKyAod29yZDIgPj4gMSk7Ci0gICAgICAgICAgICAgICAgd29yZDEgKz0gd29yZDM7Ci0gICAgICAgICAgICAgICAgKigodWludDMyKikocHJlZF9ibG9jayArPSA0KSkgPSB3b3JkMTsKLSAgICAgICAgICAgICAgICBwcmV2ICs9IG9mZnNldDsKLSAgICAgICAgICAgIH0KLSAgICAgICAgICAgIHJldHVybiAxOwotICAgICAgICB9Ci0gICAgICAgIGVsc2UgLyogcm5kMSA9IDAgKi8KLSAgICAgICAgewotICAgICAgICAgICAgZm9yIChpID0gQl9TSVpFOyBpID4gMDsgaS0tKQotICAgICAgICAgICAgewotICAgICAgICAgICAgICAgIHdvcmQxMiA9ICooKHVpbnQzMiopcHJldik7IC8qIHJlYWQgYjQgYjMgYjIgYjEgKi8KLSAgICAgICAgICAgICAgICB3b3JkMjIgPSAqKCh1aW50MzIqKShwcmV2ICsgd2lkdGgpKTsKLQotICAgICAgICAgICAgICAgIHdvcmQxID0gKigodWludDMyKikocHJldiArPSA0KSk7IC8qIHJlYWQgYjggYjcgYjYgYjUgKi8KLSAgICAgICAgICAgICAgICB3b3JkMiA9ICooKHVpbnQzMiopKHByZXYgKyB3aWR0aCkpOwotICAgICAgICAgICAgICAgIHdvcmQxMiA+Pj0gMjQ7IC8qIDAgMCAwIGI0ICovCi0gICAgICAgICAgICAgICAgd29yZDIyID4+PSAyNDsKLSAgICAgICAgICAgICAgICB3b3JkMTIgPSB3b3JkMTIgfCAod29yZDEgPDwgOCk7IC8qIGI3IGI2IGI1IGI0ICovCi0gICAgICAgICAgICAgICAgd29yZDIyID0gd29yZDIyIHwgKHdvcmQyIDw8IDgpOwotICAgICAgICAgICAgICAgIHdvcmQzID0gd29yZDEyICYgd29yZDIyOwotICAgICAgICAgICAgICAgIHdvcmQxMiAmPSBtYXNrOwotICAgICAgICAgICAgICAgIHdvcmQyMiAmPSBtYXNrOwotICAgICAgICAgICAgICAgIHdvcmQzICY9ICh+bWFzayk7IC8qIDB4MTAxMDEwMSwgY2hlY2sgbGFzdCBiaXQgKi8KLSAgICAgICAgICAgICAgICB3b3JkMTIgPj49IDE7Ci0gICAgICAgICAgICAgICAgd29yZDEyID0gd29yZDEyICsgKHdvcmQyMiA+PiAxKTsKLSAgICAgICAgICAgICAgICB3b3JkMTIgKz0gd29yZDM7Ci0gICAgICAgICAgICAgICAgKigodWludDMyKikocHJlZF9ibG9jayArPSBvZmZzZXQyKSkgPSB3b3JkMTI7Ci0KLSAgICAgICAgICAgICAgICB3b3JkMTIgPSAqKCh1aW50MzIqKShwcmV2ICs9IDQpKTsgLyogcmVhZCBiMTIgYjExIGIxMCBiOSAqLwotICAgICAgICAgICAgICAgIHdvcmQyMiA9ICooKHVpbnQzMiopKHByZXYgKyB3aWR0aCkpOwotICAgICAgICAgICAgICAgIHdvcmQxID4+PSAyNDsgLyogMCAwIDAgYjggKi8KLSAgICAgICAgICAgICAgICB3b3JkMiA+Pj0gMjQ7Ci0gICAgICAgICAgICAgICAgd29yZDEgPSB3b3JkMSB8ICh3b3JkMTIgPDwgOCk7IC8qIGIxMSBiMTAgYjkgYjggKi8KLSAgICAgICAgICAgICAgICB3b3JkMiA9IHdvcmQyIHwgKHdvcmQyMiA8PCA4KTsKLSAgICAgICAgICAgICAgICB3b3JkMyA9IHdvcmQxICYgd29yZDI7Ci0gICAgICAgICAgICAgICAgd29yZDEgJj0gbWFzazsKLSAgICAgICAgICAgICAgICB3b3JkMiAmPSBtYXNrOwotICAgICAgICAgICAgICAgIHdvcmQzICY9ICh+bWFzayk7IC8qIDB4MTAxMDEwMSwgY2hlY2sgbGFzdCBiaXQgKi8KLSAgICAgICAgICAgICAgICB3b3JkMSA+Pj0gMTsKLSAgICAgICAgICAgICAgICB3b3JkMSA9IHdvcmQxICsgKHdvcmQyID4+IDEpOwotICAgICAgICAgICAgICAgIHdvcmQxICs9IHdvcmQzOwotICAgICAgICAgICAgICAgICooKHVpbnQzMiopKHByZWRfYmxvY2sgKz0gNCkpID0gd29yZDE7Ci0gICAgICAgICAgICAgICAgcHJldiArPSBvZmZzZXQ7Ci0gICAgICAgICAgICB9Ci0gICAgICAgICAgICByZXR1cm4gMTsKLSAgICAgICAgfSAvKiBybmQgKi8KLSAgICB9IC8qIHRtcCAqLwotfQotCi0vKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLWludCBHZXRQcmVkQWR2YW5jZWRCeTF4MSgKLSAgICB1aW50OCAqcHJldiwgICAgICAgIC8qIGkgKi8KLSAgICB1aW50OCAqcHJlZF9ibG9jaywgICAgICAvKiBpICovCi0gICAgaW50IHdpZHRoLCAgICAgIC8qIGkgKi8KLSAgICBpbnQgcHJlZF93aWR0aF9ybmQgLyogaSAqLwotKQotewotICAgIHVpbnQgICAgaTsgICAgICAvKiBsb29wIHZhcmlhYmxlICovCi0gICAgaW50IG9mZnNldCwgb2Zmc2V0MjsKLSAgICB1aW50MzIgIHgxLCB4MiwgeDFtLCB4Mm0sIHkxLCB5MiwgeTFtLCB5Mm07IC8qIG5ldyB3YXkgKi8KLSAgICBpbnQgdG1wOwotICAgIGludCBybmQxLCBybmQyOwotICAgIHVpbnQzMiBtYXNrOwotCi0gICAgLyogaW5pdGlhbGl6ZSBvZmZzZXQgdG8gYWRqdXN0IHBpeGVsIGNvdW50ZXIgKi8KLSAgICAvKiAgICB0aGUgbmV4dCByb3c7IGZ1bGwtcGVsIHJlc29sdXRpb24gICAgICAqLwotICAgIG9mZnNldCA9IHdpZHRoIC0gQl9TSVpFOyAvKiBvZmZzZXQgZm9yIHByZXYgKi8KLSAgICBvZmZzZXQyID0gKHByZWRfd2lkdGhfcm5kID4+IDEpIC0gODsgLyogb2Zmc2V0IGZvciBwcmVkX2Jsb2NrICovCi0KLSAgICBybmQxID0gcHJlZF93aWR0aF9ybmQgJiAxOwotCi0gICAgcm5kMiA9IHJuZDEgKyAxOwotICAgIHJuZDIgfD0gKHJuZDIgPDwgOCk7Ci0gICAgcm5kMiB8PSAocm5kMiA8PCAxNik7Ci0KLSAgICBtYXNrID0gMHgzRjsKLSAgICBtYXNrIHw9IChtYXNrIDw8IDgpOwotICAgIG1hc2sgfD0gKG1hc2sgPDwgMTYpOyAvKiAweDNmM2YzZjNmICovCi0KLSAgICB0bXAgPSAodWludDMyKXByZXYgJiAzOwotCi0gICAgcHJlZF9ibG9jayAtPSA0OyAvKiBwcmVzZXQgKi8KLQotICAgIGlmICh0bXAgPT0gMCkgLyogd29yZC1hbGlnbmVkICovCi0gICAgewotICAgICAgICBmb3IgKGkgPSBCX1NJWkU7IGkgPiAwOyBpLS0pCi0gICAgICAgIHsKLSAgICAgICAgICAgIHgxID0gKigodWludDMyKilwcmV2KTsgLyogbG9hZCBhMyBhMiBhMSBhMCAqLwotICAgICAgICAgICAgeDIgPSAqKCh1aW50MzIqKShwcmV2ICsgd2lkdGgpKTsgLyogbG9hZCBiMyBiMiBiMSBiMCwgYW5vdGhlciBsaW5lICovCi0gICAgICAgICAgICB5MSA9ICooKHVpbnQzMiopKHByZXYgKz0gNCkpOyAvKiBhNyBhNiBhNSBhNCAqLwotICAgICAgICAgICAgeTIgPSAqKCh1aW50MzIqKShwcmV2ICsgd2lkdGgpKTsgLyogYjcgYjYgYjUgYjQgKi8KLQotICAgICAgICAgICAgeDFtID0gKHgxID4+IDIpICYgbWFzazsgLyogemVybyBvdXQgbGFzdCAyIGJpdHMgKi8KLSAgICAgICAgICAgIHgybSA9ICh4MiA+PiAyKSAmIG1hc2s7Ci0gICAgICAgICAgICB4MSA9IHgxIF4oeDFtIDw8IDIpOwotICAgICAgICAgICAgeDIgPSB4MiBeKHgybSA8PCAyKTsKLSAgICAgICAgICAgIHgxbSArPSB4Mm07Ci0gICAgICAgICAgICB4MSArPSB4MjsKLQotICAgICAgICAgICAgLyogeDJtLCB4MiBmcmVlICovCi0gICAgICAgICAgICB5MW0gPSAoeTEgPj4gMikgJiBtYXNrOyAvKiB6ZXJvIG91dCBsYXN0IDIgYml0cyAqLwotICAgICAgICAgICAgeTJtID0gKHkyID4+IDIpICYgbWFzazsKLSAgICAgICAgICAgIHkxID0geTEgXih5MW0gPDwgMik7Ci0gICAgICAgICAgICB5MiA9IHkyIF4oeTJtIDw8IDIpOwotICAgICAgICAgICAgeTFtICs9IHkybTsKLSAgICAgICAgICAgIHkxICs9IHkyOwotCi0gICAgICAgICAgICAvKiB5Mm0sIHkyIGZyZWUgKi8KLSAgICAgICAgICAgIC8qIHgybSwgeDIgZnJlZSAqLwotICAgICAgICAgICAgeDIgPSAqKCh1aW50MzIqKShwcmV2ICs9IDQpKTsgLyogYTExIGExMCBhOSBhOCAqLwotICAgICAgICAgICAgeTIgPSAqKCh1aW50MzIqKShwcmV2ICsgd2lkdGgpKTsgLyogYjExIGIxMCBiOSBiOCAqLwotICAgICAgICAgICAgeDJtID0gKHgyID4+IDIpICYgbWFzazsKLSAgICAgICAgICAgIHkybSA9ICh5MiA+PiAyKSAmIG1hc2s7Ci0gICAgICAgICAgICB4MiA9IHgyIF4oeDJtIDw8IDIpOwotICAgICAgICAgICAgeTIgPSB5MiBeKHkybSA8PCAyKTsKLSAgICAgICAgICAgIHgybSArPSB5Mm07Ci0gICAgICAgICAgICB4MiArPSB5MjsKLSAgICAgICAgICAgIC8qIHkybSwgeTIgZnJlZSAqLwotCi0gICAgICAgICAgICAvKiBub3cgb3BlcmF0ZSBvbiB4MW0sIHgxLCB5MW0sIHkxLCB4Mm0sIHgyICovCi0gICAgICAgICAgICAvKiB4MW0gPSBhMytiMywgYTIrYjIsIGExK2IxLCBhMCtiMCAqLwotICAgICAgICAgICAgLyogeTFtID0gYTcrYjcsIGE2K2I2LCBhNStiNSwgYTQrYjQgKi8KLSAgICAgICAgICAgIC8qIHgybSA9IGExMStiMTEsIGExMCtiMTAsIGE5K2I5LCBhOCtiOCAqLwotICAgICAgICAgICAgLyogeDEsIHkxLCB4MiAqLwotCi0gICAgICAgICAgICB5Mm0gPSB4MW0gPj4gODsKLSAgICAgICAgICAgIHkyID0geDEgPj4gODsKLSAgICAgICAgICAgIHkybSB8PSAoeTFtIDw8IDI0KTsgIC8qIGE0K2I0LCBhMytiMywgYTIrYjIsIGExK2IxICovCi0gICAgICAgICAgICB5MiB8PSAoeTEgPDwgMjQpOwotICAgICAgICAgICAgeDFtICs9IHkybTsgIC8qIGEzK2IzK2E0K2I0LCAuLi4uLiwgYTArYjArYTErYjEgKi8KLSAgICAgICAgICAgIHgxICs9IHkyOwotICAgICAgICAgICAgeDEgKz0gcm5kMjsKLSAgICAgICAgICAgIHgxICY9IChtYXNrIDw8IDIpOwotICAgICAgICAgICAgeDFtICs9ICh4MSA+PiAyKTsKLSAgICAgICAgICAgICooKHVpbnQzMiopKHByZWRfYmxvY2sgKz0gNCkpID0geDFtOyAvKiBzYXZlIHgxbSAqLwotCi0gICAgICAgICAgICB5Mm0gPSB5MW0gPj4gODsKLSAgICAgICAgICAgIHkyID0geTEgPj4gODsKLSAgICAgICAgICAgIHkybSB8PSAoeDJtIDw8IDI0KTsgLyogYTgrYjgsIGE3K2I3LCBhNitiNiwgYTUrYjUgKi8KLSAgICAgICAgICAgIHkyIHw9ICh4MiA8PCAyNCk7Ci0gICAgICAgICAgICB5MW0gKz0geTJtOyAgLyogYTcrYjcrYTgrYjgsIC4uLi4uLCBhNCtiNCthNStiNSAqLwotICAgICAgICAgICAgeTEgKz0geTI7Ci0gICAgICAgICAgICB5MSArPSBybmQyOwotICAgICAgICAgICAgeTEgJj0gKG1hc2sgPDwgMik7Ci0gICAgICAgICAgICB5MW0gKz0gKHkxID4+IDIpOwotICAgICAgICAgICAgKigodWludDMyKikocHJlZF9ibG9jayArPSA0KSkgPSB5MW07IC8qIHNhdmUgeTFtICovCi0KLSAgICAgICAgICAgIHByZWRfYmxvY2sgKz0gb2Zmc2V0MjsKLSAgICAgICAgICAgIHByZXYgKz0gb2Zmc2V0OwotICAgICAgICB9Ci0KLSAgICAgICAgcmV0dXJuIDE7Ci0gICAgfQotICAgIGVsc2UgaWYgKHRtcCA9PSAxKQotICAgIHsKLSAgICAgICAgcHJldi0tOyAvKiB0byB3b3JkLWFsaWduZWQgKi8KLSAgICAgICAgZm9yIChpID0gQl9TSVpFOyBpID4gMDsgaS0tKQotICAgICAgICB7Ci0gICAgICAgICAgICB4MSA9ICooKHVpbnQzMiopcHJldik7IC8qIGxvYWQgYTMgYTIgYTEgYTAgKi8KLSAgICAgICAgICAgIHgyID0gKigodWludDMyKikocHJldiArIHdpZHRoKSk7IC8qIGxvYWQgYjMgYjIgYjEgYjAsIGFub3RoZXIgbGluZSAqLwotICAgICAgICAgICAgeTEgPSAqKCh1aW50MzIqKShwcmV2ICs9IDQpKTsgLyogYTcgYTYgYTUgYTQgKi8KLSAgICAgICAgICAgIHkyID0gKigodWludDMyKikocHJldiArIHdpZHRoKSk7IC8qIGI3IGI2IGI1IGI0ICovCi0KLSAgICAgICAgICAgIHgxbSA9ICh4MSA+PiAyKSAmIG1hc2s7IC8qIHplcm8gb3V0IGxhc3QgMiBiaXRzICovCi0gICAgICAgICAgICB4Mm0gPSAoeDIgPj4gMikgJiBtYXNrOwotICAgICAgICAgICAgeDEgPSB4MSBeKHgxbSA8PCAyKTsKLSAgICAgICAgICAgIHgyID0geDIgXih4Mm0gPDwgMik7Ci0gICAgICAgICAgICB4MW0gKz0geDJtOwotICAgICAgICAgICAgeDEgKz0geDI7Ci0KLSAgICAgICAgICAgIC8qIHgybSwgeDIgZnJlZSAqLwotICAgICAgICAgICAgeTFtID0gKHkxID4+IDIpICYgbWFzazsgLyogemVybyBvdXQgbGFzdCAyIGJpdHMgKi8KLSAgICAgICAgICAgIHkybSA9ICh5MiA+PiAyKSAmIG1hc2s7Ci0gICAgICAgICAgICB5MSA9IHkxIF4oeTFtIDw8IDIpOwotICAgICAgICAgICAgeTIgPSB5MiBeKHkybSA8PCAyKTsKLSAgICAgICAgICAgIHkxbSArPSB5Mm07Ci0gICAgICAgICAgICB5MSArPSB5MjsKLQotICAgICAgICAgICAgLyogeTJtLCB5MiBmcmVlICovCi0gICAgICAgICAgICAvKiB4Mm0sIHgyIGZyZWUgKi8KLSAgICAgICAgICAgIHgyID0gKigodWludDMyKikocHJldiArPSA0KSk7IC8qIGExMSBhMTAgYTkgYTggKi8KLSAgICAgICAgICAgIHkyID0gKigodWludDMyKikocHJldiArIHdpZHRoKSk7IC8qIGIxMSBiMTAgYjkgYjggKi8KLSAgICAgICAgICAgIHgybSA9ICh4MiA+PiAyKSAmIG1hc2s7Ci0gICAgICAgICAgICB5Mm0gPSAoeTIgPj4gMikgJiBtYXNrOwotICAgICAgICAgICAgeDIgPSB4MiBeKHgybSA8PCAyKTsKLSAgICAgICAgICAgIHkyID0geTIgXih5Mm0gPDwgMik7Ci0gICAgICAgICAgICB4Mm0gKz0geTJtOwotICAgICAgICAgICAgeDIgKz0geTI7Ci0gICAgICAgICAgICAvKiB5Mm0sIHkyIGZyZWUgKi8KLQotICAgICAgICAgICAgLyogbm93IG9wZXJhdGUgb24geDFtLCB4MSwgeTFtLCB5MSwgeDJtLCB4MiAqLwotICAgICAgICAgICAgLyogeDFtID0gYTMrYjMsIGEyK2IyLCBhMStiMSwgYTArYjAgKi8KLSAgICAgICAgICAgIC8qIHkxbSA9IGE3K2I3LCBhNitiNiwgYTUrYjUsIGE0K2I0ICovCi0gICAgICAgICAgICAvKiB4Mm0gPSBhMTErYjExLCBhMTArYjEwLCBhOStiOSwgYTgrYjggKi8KLSAgICAgICAgICAgIC8qIHgxLCB5MSwgeDIgKi8KLQotICAgICAgICAgICAgeDFtID4+PSA4IDsKLSAgICAgICAgICAgIHgxID4+PSA4OwotICAgICAgICAgICAgeDFtIHw9ICh5MW0gPDwgMjQpOyAgLyogYTQrYjQsIGEzK2IzLCBhMitiMiwgYTErYjEgKi8KLSAgICAgICAgICAgIHgxIHw9ICh5MSA8PCAyNCk7Ci0gICAgICAgICAgICB5Mm0gPSAoeTFtIDw8IDE2KTsKLSAgICAgICAgICAgIHkyID0gKHkxIDw8IDE2KTsKLSAgICAgICAgICAgIHkybSB8PSAoeDFtID4+IDgpOyAvKiBhNStiNSwgYTQrYjQsIGEzK2IzLCBhMitiMiAqLwotICAgICAgICAgICAgeTIgfD0gKHgxID4+IDgpOwotICAgICAgICAgICAgeDEgKz0gcm5kMjsKLSAgICAgICAgICAgIHgxbSArPSB5Mm07ICAvKiBhNCtiNCthNStiNSwgLi4uLi4sIGExK2IxK2EyK2IyICovCi0gICAgICAgICAgICB4MSArPSB5MjsKLSAgICAgICAgICAgIHgxICY9IChtYXNrIDw8IDIpOwotICAgICAgICAgICAgeDFtICs9ICh4MSA+PiAyKTsKLSAgICAgICAgICAgICooKHVpbnQzMiopKHByZWRfYmxvY2sgKz0gNCkpID0geDFtOyAvKiBzYXZlIHgxbSAqLwotCi0gICAgICAgICAgICB5MW0gPj49IDg7Ci0gICAgICAgICAgICB5MSA+Pj0gODsKLSAgICAgICAgICAgIHkxbSB8PSAoeDJtIDw8IDI0KTsgLyogYTgrYjgsIGE3K2I3LCBhNitiNiwgYTUrYjUgKi8KLSAgICAgICAgICAgIHkxIHw9ICh4MiA8PCAyNCk7Ci0gICAgICAgICAgICB5Mm0gPSAoeDJtIDw8IDE2KTsKLSAgICAgICAgICAgIHkyID0gKHgyIDw8IDE2KTsKLSAgICAgICAgICAgIHkybSB8PSAoeTFtID4+IDgpOyAvKiAgYTkrYjksIGE4K2I4LCBhNytiNywgYTYrYjYsKi8KLSAgICAgICAgICAgIHkyIHw9ICh5MSA+PiA4KTsKLSAgICAgICAgICAgIHkxICs9IHJuZDI7Ci0gICAgICAgICAgICB5MW0gKz0geTJtOyAgLyogYTgrYjgrYTkrYjksIC4uLi4uLCBhNStiNSthNitiNiAqLwotICAgICAgICAgICAgeTEgKz0geTI7Ci0gICAgICAgICAgICB5MSAmPSAobWFzayA8PCAyKTsKLSAgICAgICAgICAgIHkxbSArPSAoeTEgPj4gMik7Ci0gICAgICAgICAgICAqKCh1aW50MzIqKShwcmVkX2Jsb2NrICs9IDQpKSA9IHkxbTsgLyogc2F2ZSB5MW0gKi8KLQotICAgICAgICAgICAgcHJlZF9ibG9jayArPSBvZmZzZXQyOwotICAgICAgICAgICAgcHJldiArPSBvZmZzZXQ7Ci0gICAgICAgIH0KLSAgICAgICAgcmV0dXJuIDE7Ci0gICAgfQotICAgIGVsc2UgaWYgKHRtcCA9PSAyKQotICAgIHsKLSAgICAgICAgcHJldiAtPSAyOyAvKiB0byB3b3JkLWFsaWduZWQgKi8KLSAgICAgICAgZm9yIChpID0gQl9TSVpFOyBpID4gMDsgaS0tKQotICAgICAgICB7Ci0gICAgICAgICAgICB4MSA9ICooKHVpbnQzMiopcHJldik7IC8qIGxvYWQgYTMgYTIgYTEgYTAgKi8KLSAgICAgICAgICAgIHgyID0gKigodWludDMyKikocHJldiArIHdpZHRoKSk7IC8qIGxvYWQgYjMgYjIgYjEgYjAsIGFub3RoZXIgbGluZSAqLwotICAgICAgICAgICAgeTEgPSAqKCh1aW50MzIqKShwcmV2ICs9IDQpKTsgLyogYTcgYTYgYTUgYTQgKi8KLSAgICAgICAgICAgIHkyID0gKigodWludDMyKikocHJldiArIHdpZHRoKSk7IC8qIGI3IGI2IGI1IGI0ICovCi0KLSAgICAgICAgICAgIHgxbSA9ICh4MSA+PiAyKSAmIG1hc2s7IC8qIHplcm8gb3V0IGxhc3QgMiBiaXRzICovCi0gICAgICAgICAgICB4Mm0gPSAoeDIgPj4gMikgJiBtYXNrOwotICAgICAgICAgICAgeDEgPSB4MSBeKHgxbSA8PCAyKTsKLSAgICAgICAgICAgIHgyID0geDIgXih4Mm0gPDwgMik7Ci0gICAgICAgICAgICB4MW0gKz0geDJtOwotICAgICAgICAgICAgeDEgKz0geDI7Ci0KLSAgICAgICAgICAgIC8qIHgybSwgeDIgZnJlZSAqLwotICAgICAgICAgICAgeTFtID0gKHkxID4+IDIpICYgbWFzazsgLyogemVybyBvdXQgbGFzdCAyIGJpdHMgKi8KLSAgICAgICAgICAgIHkybSA9ICh5MiA+PiAyKSAmIG1hc2s7Ci0gICAgICAgICAgICB5MSA9IHkxIF4oeTFtIDw8IDIpOwotICAgICAgICAgICAgeTIgPSB5MiBeKHkybSA8PCAyKTsKLSAgICAgICAgICAgIHkxbSArPSB5Mm07Ci0gICAgICAgICAgICB5MSArPSB5MjsKLQotICAgICAgICAgICAgLyogeTJtLCB5MiBmcmVlICovCi0gICAgICAgICAgICAvKiB4Mm0sIHgyIGZyZWUgKi8KLSAgICAgICAgICAgIHgyID0gKigodWludDMyKikocHJldiArPSA0KSk7IC8qIGExMSBhMTAgYTkgYTggKi8KLSAgICAgICAgICAgIHkyID0gKigodWludDMyKikocHJldiArIHdpZHRoKSk7IC8qIGIxMSBiMTAgYjkgYjggKi8KLSAgICAgICAgICAgIHgybSA9ICh4MiA+PiAyKSAmIG1hc2s7Ci0gICAgICAgICAgICB5Mm0gPSAoeTIgPj4gMikgJiBtYXNrOwotICAgICAgICAgICAgeDIgPSB4MiBeKHgybSA8PCAyKTsKLSAgICAgICAgICAgIHkyID0geTIgXih5Mm0gPDwgMik7Ci0gICAgICAgICAgICB4Mm0gKz0geTJtOwotICAgICAgICAgICAgeDIgKz0geTI7Ci0gICAgICAgICAgICAvKiB5Mm0sIHkyIGZyZWUgKi8KLQotICAgICAgICAgICAgLyogbm93IG9wZXJhdGUgb24geDFtLCB4MSwgeTFtLCB5MSwgeDJtLCB4MiAqLwotICAgICAgICAgICAgLyogeDFtID0gYTMrYjMsIGEyK2IyLCBhMStiMSwgYTArYjAgKi8KLSAgICAgICAgICAgIC8qIHkxbSA9IGE3K2I3LCBhNitiNiwgYTUrYjUsIGE0K2I0ICovCi0gICAgICAgICAgICAvKiB4Mm0gPSBhMTErYjExLCBhMTArYjEwLCBhOStiOSwgYTgrYjggKi8KLSAgICAgICAgICAgIC8qIHgxLCB5MSwgeDIgKi8KLQotICAgICAgICAgICAgeDFtID4+PSAxNiA7Ci0gICAgICAgICAgICB4MSA+Pj0gMTY7Ci0gICAgICAgICAgICB4MW0gfD0gKHkxbSA8PCAxNik7ICAvKiBhNStiNSwgYTQrYjQsIGEzK2IzLCBhMitiMiAqLwotICAgICAgICAgICAgeDEgfD0gKHkxIDw8IDE2KTsKLSAgICAgICAgICAgIHkybSA9ICh5MW0gPDwgOCk7Ci0gICAgICAgICAgICB5MiA9ICh5MSA8PCA4KTsKLSAgICAgICAgICAgIHkybSB8PSAoeDFtID4+IDgpOyAvKiBhNitiNiwgYTUrYjUsIGE0K2I0LCBhMytiMyAqLwotICAgICAgICAgICAgeTIgfD0gKHgxID4+IDgpOwotICAgICAgICAgICAgeDEgKz0gcm5kMjsKLSAgICAgICAgICAgIHgxbSArPSB5Mm07ICAvKiBhNStiNSthNitiNiwgLi4uLi4sIGEyK2IyK2EzK2IzICovCi0gICAgICAgICAgICB4MSArPSB5MjsKLSAgICAgICAgICAgIHgxICY9IChtYXNrIDw8IDIpOwotICAgICAgICAgICAgeDFtICs9ICh4MSA+PiAyKTsKLSAgICAgICAgICAgICooKHVpbnQzMiopKHByZWRfYmxvY2sgKz0gNCkpID0geDFtOyAvKiBzYXZlIHgxbSAqLwotCi0gICAgICAgICAgICB5MW0gPj49IDE2OwotICAgICAgICAgICAgeTEgPj49IDE2OwotICAgICAgICAgICAgeTFtIHw9ICh4Mm0gPDwgMTYpOyAvKiBhOStiOSwgYTgrYjgsIGE3K2I3LCBhNitiNiAqLwotICAgICAgICAgICAgeTEgfD0gKHgyIDw8IDE2KTsKLSAgICAgICAgICAgIHkybSA9ICh4Mm0gPDwgOCk7Ci0gICAgICAgICAgICB5MiA9ICh4MiA8PCA4KTsKLSAgICAgICAgICAgIHkybSB8PSAoeTFtID4+IDgpOyAvKiAgYTEwK2IxMCwgYTkrYjksIGE4K2I4LCBhNytiNywqLwotICAgICAgICAgICAgeTIgfD0gKHkxID4+IDgpOwotICAgICAgICAgICAgeTEgKz0gcm5kMjsKLSAgICAgICAgICAgIHkxbSArPSB5Mm07ICAvKiBhOStiOSthMTArYjEwLCAuLi4uLiwgYTYrYjYrYTcrYjcgKi8KLSAgICAgICAgICAgIHkxICs9IHkyOwotICAgICAgICAgICAgeTEgJj0gKG1hc2sgPDwgMik7Ci0gICAgICAgICAgICB5MW0gKz0gKHkxID4+IDIpOwotICAgICAgICAgICAgKigodWludDMyKikocHJlZF9ibG9jayArPSA0KSkgPSB5MW07IC8qIHNhdmUgeTFtICovCi0KLSAgICAgICAgICAgIHByZWRfYmxvY2sgKz0gb2Zmc2V0MjsKLSAgICAgICAgICAgIHByZXYgKz0gb2Zmc2V0OwotICAgICAgICB9Ci0gICAgICAgIHJldHVybiAxOwotICAgIH0KLSAgICBlbHNlIC8qIHRtcCA9PSAzICovCi0gICAgewotICAgICAgICBwcmV2IC09IDM7IC8qIHRvIHdvcmQtYWxpZ25lZCAqLwotICAgICAgICBmb3IgKGkgPSBCX1NJWkU7IGkgPiAwOyBpLS0pCi0gICAgICAgIHsKLSAgICAgICAgICAgIHgxID0gKigodWludDMyKilwcmV2KTsgLyogbG9hZCBhMyBhMiBhMSBhMCAqLwotICAgICAgICAgICAgeDIgPSAqKCh1aW50MzIqKShwcmV2ICsgd2lkdGgpKTsgLyogbG9hZCBiMyBiMiBiMSBiMCwgYW5vdGhlciBsaW5lICovCi0gICAgICAgICAgICB5MSA9ICooKHVpbnQzMiopKHByZXYgKz0gNCkpOyAvKiBhNyBhNiBhNSBhNCAqLwotICAgICAgICAgICAgeTIgPSAqKCh1aW50MzIqKShwcmV2ICsgd2lkdGgpKTsgLyogYjcgYjYgYjUgYjQgKi8KLQotICAgICAgICAgICAgeDFtID0gKHgxID4+IDIpICYgbWFzazsgLyogemVybyBvdXQgbGFzdCAyIGJpdHMgKi8KLSAgICAgICAgICAgIHgybSA9ICh4MiA+PiAyKSAmIG1hc2s7Ci0gICAgICAgICAgICB4MSA9IHgxIF4oeDFtIDw8IDIpOwotICAgICAgICAgICAgeDIgPSB4MiBeKHgybSA8PCAyKTsKLSAgICAgICAgICAgIHgxbSArPSB4Mm07Ci0gICAgICAgICAgICB4MSArPSB4MjsKLQotICAgICAgICAgICAgLyogeDJtLCB4MiBmcmVlICovCi0gICAgICAgICAgICB5MW0gPSAoeTEgPj4gMikgJiBtYXNrOyAvKiB6ZXJvIG91dCBsYXN0IDIgYml0cyAqLwotICAgICAgICAgICAgeTJtID0gKHkyID4+IDIpICYgbWFzazsKLSAgICAgICAgICAgIHkxID0geTEgXih5MW0gPDwgMik7Ci0gICAgICAgICAgICB5MiA9IHkyIF4oeTJtIDw8IDIpOwotICAgICAgICAgICAgeTFtICs9IHkybTsKLSAgICAgICAgICAgIHkxICs9IHkyOwotCi0gICAgICAgICAgICAvKiB5Mm0sIHkyIGZyZWUgKi8KLSAgICAgICAgICAgIC8qIHgybSwgeDIgZnJlZSAqLwotICAgICAgICAgICAgeDIgPSAqKCh1aW50MzIqKShwcmV2ICs9IDQpKTsgLyogYTExIGExMCBhOSBhOCAqLwotICAgICAgICAgICAgeTIgPSAqKCh1aW50MzIqKShwcmV2ICsgd2lkdGgpKTsgLyogYjExIGIxMCBiOSBiOCAqLwotICAgICAgICAgICAgeDJtID0gKHgyID4+IDIpICYgbWFzazsKLSAgICAgICAgICAgIHkybSA9ICh5MiA+PiAyKSAmIG1hc2s7Ci0gICAgICAgICAgICB4MiA9IHgyIF4oeDJtIDw8IDIpOwotICAgICAgICAgICAgeTIgPSB5MiBeKHkybSA8PCAyKTsKLSAgICAgICAgICAgIHgybSArPSB5Mm07Ci0gICAgICAgICAgICB4MiArPSB5MjsKLSAgICAgICAgICAgIC8qIHkybSwgeTIgZnJlZSAqLwotCi0gICAgICAgICAgICAvKiBub3cgb3BlcmF0ZSBvbiB4MW0sIHgxLCB5MW0sIHkxLCB4Mm0sIHgyICovCi0gICAgICAgICAgICAvKiB4MW0gPSBhMytiMywgYTIrYjIsIGExK2IxLCBhMCtiMCAqLwotICAgICAgICAgICAgLyogeTFtID0gYTcrYjcsIGE2K2I2LCBhNStiNSwgYTQrYjQgKi8KLSAgICAgICAgICAgIC8qIHgybSA9IGExMStiMTEsIGExMCtiMTAsIGE5K2I5LCBhOCtiOCAqLwotICAgICAgICAgICAgLyogeDEsIHkxLCB4MiAqLwotCi0gICAgICAgICAgICB4MW0gPj49IDI0IDsKLSAgICAgICAgICAgIHgxID4+PSAyNDsKLSAgICAgICAgICAgIHgxbSB8PSAoeTFtIDw8IDgpOyAgLyogYTYrYjYsIGE1K2I1LCBhNCtiNCwgYTMrYjMgKi8KLSAgICAgICAgICAgIHgxIHw9ICh5MSA8PCA4KTsKLQotICAgICAgICAgICAgeDFtICs9IHkxbTsgIC8qIGE2K2I2K2E3K2I3LCAuLi4uLiwgYTMrYjMrYTQrYjQgKi8KLSAgICAgICAgICAgIHgxICs9IHkxOwotICAgICAgICAgICAgeDEgKz0gcm5kMjsKLSAgICAgICAgICAgIHgxICY9IChtYXNrIDw8IDIpOwotICAgICAgICAgICAgeDFtICs9ICh4MSA+PiAyKTsKLSAgICAgICAgICAgICooKHVpbnQzMiopKHByZWRfYmxvY2sgKz0gNCkpID0geDFtOyAvKiBzYXZlIHgxbSAqLwotCi0gICAgICAgICAgICB5MW0gPj49IDI0OwotICAgICAgICAgICAgeTEgPj49IDI0OwotICAgICAgICAgICAgeTFtIHw9ICh4Mm0gPDwgOCk7IC8qIGExMCtiMTAsIGE5K2I5LCBhOCtiOCwgYTcrYjcgKi8KLSAgICAgICAgICAgIHkxIHw9ICh4MiA8PCA4KTsKLSAgICA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wKLSAgICAgICAgICAgICooKHVpbnQzMiopKHB0cis9MTYpKSA9IHRlbXA7ICBcCi0gICAgICAgICAgICAqKCh1aW50MzIqKShwdHIrNCkpID0gdGVtcDsgIFwKLSAgICAgICAgICAgICooKHVpbnQzMiopKHB0cis9MTYpKSA9IHRlbXA7ICBcCi0gICAgICAgICAgICAqKCh1aW50MzIqKShwdHIrNCkpID0gdGVtcDsgIH0KLQotI2RlZmluZSBQQURfUk9XICB7ICB0ZW1wID0gKigodWludDMyKilwcmV2KTsgXAotICAgICAgICAgICAgICAgICAgICB0ZW1wMiA9ICooKHVpbnQzMiopKHByZXYrNCkpOyBcCi0gICAgICAgICAgICAqKCh1aW50MzIqKXB0cikgPSAgdGVtcDtcCi0gICAgICAgICAgICAqKCh1aW50MzIqKShwdHIrNCkpID0gIHRlbXAyOyBcCi0gICAgICAgICAgICAqKCh1aW50MzIqKShwdHIrPTE2KSkgPSB0ZW1wOyBcCi0gICAgICAgICAgICAqKCh1aW50MzIqKShwdHIrNCkpID0gdGVtcDI7XAotICAgICAgICAgICAgKigodWludDMyKikocHRyKz0xNikpID0gdGVtcDsgXAotICAgICAgICAgICAgKigodWludDMyKikocHRyKzQpKSA9IHRlbXAyO1wKLSAgICAgICAgICAgICooKHVpbnQzMiopKHB0cis9MTYpKSA9IHRlbXA7IFwKLSAgICAgICAgICAgICooKHVpbnQzMiopKHB0cis0KSkgPSB0ZW1wMjtcCi0gICAgICAgICAgICAqKCh1aW50MzIqKShwdHIrPTE2KSkgPSB0ZW1wOyBcCi0gICAgICAgICAgICAqKCh1aW50MzIqKShwdHIrNCkpID0gdGVtcDI7XAotICAgICAgICAgICAgKigodWludDMyKikocHRyKz0xNikpID0gdGVtcDsgXAotICAgICAgICAgICAgKigodWludDMyKikocHRyKzQpKSA9IHRlbXAyO1wKLSAgICAgICAgICAgICooKHVpbnQzMiopKHB0cis9MTYpKSA9IHRlbXA7IFwKLSAgICAgICAgICAgICooKHVpbnQzMiopKHB0cis0KSkgPSB0ZW1wMjtcCi0gICAgICAgICAgICAqKCh1aW50MzIqKShwdHIrPTE2KSkgPSB0ZW1wOyBcCi0gICAgICAgICAgICAqKCh1aW50MzIqKShwdHIrNCkpID0gdGVtcDI7fQotCi0jZGVmaW5lIFBBRF9FWFRSQV80eDggICAgICAgICAgIHsgICB0ZW1wID0gKigodWludDMyKikocHJldis4KSk7IFwKLSAgICAgICAgICAgICAgICAqKCh1aW50MzIqKXB0cikgPSAgdGVtcDsgXAotICAgICAgICAgICAgICAgICooKHVpbnQzMiopKHB0cis9MTYpKSA9IHRlbXA7IFwKLSAgICAgICAgICAgICAgICAqKCh1aW50MzIqKShwdHIrPTE2KSkgPSB0ZW1wOyBcCi0gICAgICAgICAgICAgICAgKigodWludDMyKikocHRyKz0xNikpID0gdGVtcDsgXAotICAgICAgICAgICAgICAgICooKHVpbnQzMiopKHB0cis9MTYpKSA9IHRlbXA7IFwKLSAgICAgICAgICAgICAgICAqKCh1aW50MzIqKShwdHIrPTE2KSkgPSB0ZW1wOyBcCi0gICAgICAgICAgICAgICAgKigodWludDMyKikocHRyKz0xNikpID0gdGVtcDsgXAotICAgICAgICAgICAgICAgICooKHVpbnQzMiopKHB0cis9MTYpKSA9IHRlbXA7IH0KLQotI2RlZmluZSBQQURfQ09MIHsgdGVtcCA9ICpwcmV2OyBcCi0gICAgICAgICAgICB0ZW1wfD0odGVtcDw8OCk7ICB0ZW1wfD0odGVtcDw8MTYpOyBcCi0gICAgICAgICAgICAqKCh1aW50MzIqKXB0cikgPSB0ZW1wOyBcCi0gICAgICAgICAgICAqKCh1aW50MzIqKShwdHIrNCkpID0gdGVtcDsgXAotICAgICAgICAgICAgdGVtcCA9ICoocHJldis9MTYpOyBcCi0gICAgICAgICAgICB0ZW1wfD0odGVtcDw8OCk7ICB0ZW1wfD0odGVtcDw8MTYpOyBcCi0gICAgICAgICAgICAqKCh1aW50MzIqKShwdHIrPTE2KSkgPSB0ZW1wOyBcCi0gICAgICAgICAgICAqKCh1aW50MzIqKShwdHIrNCkpID0gdGVtcDsgXAotICAgICAgICAgICAgdGVtcCA9ICoocHJldis9MTYpOyBcCi0gICAgICAgICAgICB0ZW1wfD0odGVtcDw8OCk7ICB0ZW1wfD0odGVtcDw8MTYpOyBcCi0gICAgICAgICAgICAqKCh1aW50MzIqKShwdHIrPTE2KSkgPSB0ZW1wOyBcCi0gICAgICAgICAgICAqKCh1aW50MzIqKShwdHIrNCkpID0gdGVtcDsgXAotICAgICAgICAgICAgdGVtcCA9ICoocHJldis9MTYpOyBcCi0gICAgICAgICAgICB0ZW1wfD0odGVtcDw8OCk7ICB0ZW1wfD0odGVtcDw8MTYpOyBcCi0gICAgICAgICAgICAqKCh1aW50MzIqKShwdHIrPTE2KSkgPSB0ZW1wOyBcCi0gICAgICAgICAgICAqKCh1aW50MzIqKShwdHIrNCkpID0gdGVtcDsgXAotICAgICAgICAgICAgdGVtcCA9ICoocHJldis9MTYpOyBcCi0gICAgICAgICAgICB0ZW1wfD0odGVtcDw8OCk7ICB0ZW1wfD0odGVtcDw8MTYpOyBcCi0gICAgICAgICAgICAqKCh1aW50MzIqKShwdHIrPTE2KSkgPSB0ZW1wOyBcCi0gICAgICAgICAgICAqKCh1aW50MzIqKShwdHIrNCkpID0gdGVtcDsgXAotICAgICAgICAgICAgdGVtcCA9ICoocHJldis9MTYpOyBcCi0gICAgICAgICAgICB0ZW1wfD0odGVtcDw8OCk7ICB0ZW1wfD0odGVtcDw8MTYpOyBcCi0gICAgICAgICAgICAqKCh1aW50MzIqKShwdHIrPTE2KSkgPSB0ZW1wOyBcCi0gICAgICAgICAgICAqKCh1aW50MzIqKShwdHIrNCkpID0gdGVtcDsgXAotICAgICAgICAgICAgdGVtcCA9ICoocHJldis9MTYpOyBcCi0gICAgICAgICAgICB0ZW1wfD0odGVtcDw8OCk7ICB0ZW1wfD0odGVtcDw8MTYpOyBcCi0gICAgICAgICAgICAqKCh1aW50MzIqKShwdHIrPTE2KSkgPSB0ZW1wOyBcCi0gICAgICAgICAgICAqKCh1aW50MzIqKShwdHIrNCkpID0gdGVtcDsgXAotICAgICAgICAgICAgdGVtcCA9ICoocHJldis9MTYpOyBcCi0gICAgICAgICAgICB0ZW1wfD0odGVtcDw8OCk7ICB0ZW1wfD0odGVtcDw8MTYpOyBcCi0gICAgICAgICAgICAqKCh1aW50MzIqKShwdHIrPTE2KSkgPSB0ZW1wOyBcCi0gICAgICAgICAgICAqKCh1aW50MzIqKShwdHIrNCkpID0gdGVtcDt9Ci0KLS8qIGNvcHkgOHg4IGJsb2NrICovCi0jZGVmaW5lIENPUFlfQkxPQ0sgIHsgICAgICAgICAgICooKHVpbnQzMiopcHRyKSA9ICooKHVpbnQzMiopcHJldik7IFwKLSAgICAgICAgICAgICooKHVpbnQzMiopKHB0cis0KSkgPSAqKCh1aW50MzIqKShwcmV2KzQpKTsgXAotICAgICAgICAgICAgKigodWludDMyKikocHRyKz0xNikpID0gKigodWludDMyKikocHJldis9d2lkdGgpKTsgXAotICAgICAgICAgICAgKigodWludDMyKikocHRyKzQpKSA9ICooKHVpbnQzMiopKHByZXYrNCkpOyBcCi0gICAgICAgICAgICAqKCh1aW50MzIqKShwdHIrPTE2KSkgPSAqKCh1aW50MzIqKShwcmV2Kz13aWR0aCkpOyBcCi0gICAgICAgICAgICAqKCh1aW50MzIqKShwdHIrNCkpID0gKigodWludDMyKikocHJldis0KSk7IFwKLSAgICAgICAgICAgICooKHVpbnQzMiopKHB0cis9MTYpKSA9ICooKHVpbnQzMiopKHByZXYrPXdpZHRoKSk7IFwKLSAgICAgICAgICAgICooKHVpbnQzMiopKHB0cis0KSkgPSAqKCh1aW50MzIqKShwcmV2KzQpKTsgXAotICAgICAgICAgICAgKigodWludDMyKikocHRyKz0xNikpID0gKigodWludDMyKikocHJldis9d2lkdGgpKTsgXAotICAgICAgICAgICAgKigodWludDMyKikocHRyKzQpKSA9ICooKHVpbnQzMiopKHByZXYrNCkpOyBcCi0gICAgICAgICAgICAqKCh1aW50MzIqKShwdHIrPTE2KSkgPSAqKCh1aW50MzIqKShwcmV2Kz13aWR0aCkpOyBcCi0gICAgICAgICAgICAqKCh1aW50MzIqKShwdHIrNCkpID0gKigodWludDMyKikocHJldis0KSk7IFwKLSAgICAgICAgICAgICooKHVpbnQzMiopKHB0cis9MTYpKSA9ICooKHVpbnQzMiopKHByZXYrPXdpZHRoKSk7IFwKLSAgICAgICAgICAgICooKHVpbnQzMiopKHB0cis0KSkgPSAqKCh1aW50MzIqKShwcmV2KzQpKTsgXAotICAgICAgICAgICAgKigodWludDMyKikocHRyKz0xNikpID0gKigodWludDMyKikocHJldis9d2lkdGgpKTsgXAotICAgICAgICAgICAgKigodWludDMyKikocHRyKzQpKSA9ICooKHVpbnQzMiopKHByZXYrNCkpOyAgfQotCi0jZGVmaW5lIENPUFlfMTJ4OCAgICAgICB7ICAgICAgICooKHVpbnQzMiopcHRyKSA9ICooKHVpbnQzMiopcHJldik7IFwKLSAgICAgICAgICAgICooKHVpbnQzMiopKHB0cis0KSkgPSAqKCh1aW50MzIqKShwcmV2KzQpKTsgXAotICAgICAgICAgICAgKigodWludDMyKikocHRyKzgpKSA9ICooKHVpbnQzMiopKHByZXYrOCkpOyBcCi0gICAgICAgICAgICAqKCh1aW50MzIqKShwdHIrPTE2KSkgPSAqKCh1aW50MzIqKShwcmV2Kz13aWR0aCkpOyBcCi0gICAgICAgICAgICAqKCh1aW50MzIqKShwdHIrNCkpID0gKigodWludDMyKikocHJldis0KSk7IFwKLSAgICAgICAgICAgICooKHVpbnQzMiopKHB0cis4KSkgPSAqKCh1aW50MzIqKShwcmV2KzgpKTsgXAotICAgICAgICAgICAgKigodWludDMyKikocHRyKz0xNikpID0gKigodWludDMyKikocHJldis9d2lkdGgpKTsgXAotICAgICAgICAgICAgKigodWludDMyKikocHRyKzQpKSA9ICooKHVpbnQzMiopKHByZXYrNCkpOyBcCi0gICAgICAgICAgICAqKCh1aW50MzIqKShwdHIrOCkpID0gKigodWludDMyKikocHJldis4KSk7IFwKLSAgICAgICAgICAgICooKHVpbnQzMiopKHB0cis9MTYpKSA9ICooKHVpbnQzMiopKHByZXYrPXdpZHRoKSk7IFwKLSAgICAgICAgICAgICooKHVpbnQzMiopKHB0cis0KSkgPSAqKCh1aW50MzIqKShwcmV2KzQpKTsgXAotICAgICAgICAgICAgKigodWludDMyKikocHRyKzgpKSA9ICooKHVpbnQzMiopKHByZXYrOCkpOyBcCi0gICAgICAgICAgICAqKCh1aW50MzIqKShwdHIrPTE2KSkgPSAqKCh1aW50MzIqKShwcmV2Kz13aWR0aCkpOyBcCi0gICAgICAgICAgICAqKCh1aW50MzIqKShwdHIrNCkpID0gKigodWludDMyKikocHJldis0KSk7IFwKLSAgICAgICAgICAgICooKHVpbnQzMiopKHB0cis4KSkgPSAqKCh1aW50MzIqKShwcmV2KzgpKTsgXAotICAgICAgICAgICAgKigodWludDMyKikocHRyKz0xNikpID0gKigodWludDMyKikocHJldis9d2lkdGgpKTsgXAotICAgICAgICAgICAgKigodWludDMyKikocHRyKzQpKSA9ICooKHVpbnQzMiopKHByZXYrNCkpOyBcCi0gICAgICAgICAgICAqKCh1aW50MzIqKShwdHIrOCkpID0gKigodWludDMyKikocHJldis4KSk7IFwKLSAgICAgICAgICAgICooKHVpbnQzMiopKHB0cis9MTYpKSA9ICooKHVpbnQzMiopKHByZXYrPXdpZHRoKSk7IFwKLSAgICAgICAgICAgICooKHVpbnQzMiopKHB0cis0KSkgPSAqKCh1aW50MzIqKShwcmV2KzQpKTsgXAotICAgICAgICAgICAgKigodWludDMyKikocHRyKzgpKSA9ICooKHVpbnQzMiopKHByZXYrOCkpOyBcCi0gICAgICAgICAgICAqKCh1aW50MzIqKShwdHIrPTE2KSkgPSAqKCh1aW50MzIqKShwcmV2Kz13aWR0aCkpOyBcCi0gICAgICAgICAgICAqKCh1aW50MzIqKShwdHIrNCkpID0gKigodWludDMyKikocHJldis0KSk7IFwKLSAgICAgICAgICAgICooKHVpbnQzMiopKHB0cis4KSkgPSAqKCh1aW50M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cGFkIHRvcCAqLwotICAgICAgICAgICAgcHRyID0gcHJlZCArIDg7Ci0gICAgICAgICAgICBwcmV2ID0gcHJlZCArICg4IDw8IDQpICsgODsKLSAgICAgICAgICAgIFBBRF9ST1cKLQotICAgICAgICAgICAgLyogcGFkIGxlZnQgKi8KLSAgICAgICAgICAgIHB0ciA9IHByZWQgKyAoOCA8PCA0KTsKLSAgICAgICAgICAgIHByZXYgPSBwcmVkICsgKDggPDwgNCkgKyA4OwotICAgICAgICAgICAgUEFEX0NPTAotCi0KLSAgICAgICAgICAgIHB0ciA9IHByZWQgKyAoKCh5cG9zID4+IDEpICsgOCkgPDwgNCkgKyAoeHBvcyA+PiAxKSArIDg7Ci0KLSAgICAgICAgICAgIEdldFByZWRBZHZCVGFibGVbeXBvcyYxXVt4cG9zJjFdKHB0ciwgcHJlZF9ibG9jaywgMTYsIChwcmVkX3dpZHRoIDw8IDEpIHwgcm5kMSk7Ci0KLSAgICAgICAgICAgIHJldHVybiAxOwotICAgICAgICB9Ci0gICAgICAgIGVsc2UgaWYgKCh5cG9zID4+IDEpIDwgKGhlaWdodCAtIEJfU0laRSkpIC8qIHBhZCBsZWZ0IG9mIGZyYW1lICovCi0gICAgICAgIHsKLSAgICAgICAgICAgIC8qIGNvcHkgYmxvY2sgKi8KLSAgICAgICAgICAgIHB0ciA9IHByZWQgKyA4OwotICAgICAgICAgICAgcHJldiA9IGNfcHJldiArICh5cG9zID4+IDEpICogd2lkdGg7Ci0gICAgICAgICAgICBDT1BZX0JMT0NLCi0gICAgICAgICAgICAvKiBjb3B5IGV4dHJhIGxpbmUgKi8KLSAgICAgICAgICAgICooKHVpbnQzMiopKHB0ciArPSAxNikpID0gKigodWludDMyKikocHJldiArPSB3aWR0aCkpOwotICAgICAgICAgICAgKigodWludDMyKikocHRyICsgNCkpID0gKigodWludDMyKikocHJldiArIDQpKTsKLQotICAgICAgICAgICAgLyogcGFkIGxlZnQgKi8KLSAgICAgICAgICAgIHB0ciA9IHByZWQ7Ci0gICAgICAgICAgICBwcmV2ID0gcHJlZCArIDg7Ci0gICAgICAgICAgICBQQURfQ09MCi0gICAgICAgICAgICAvKiBwYWQgZXh0cmEgbGluZSAqLwotICAgICAgICAgICAgdGVtcCA9ICoocHJldiArPSAxNik7Ci0gICAgICAgICAgICB0ZW1wIHw9ICh0ZW1wIDw8IDgpOwotICAgICAgICAgICAgdGVtcCB8PSAodGVtcCA8PCAxNik7Ci0gICAgICAgICAgICAqKCh1aW50MzIqKShwdHIgKz0gMTYpKSA9IHRlbXA7Ci0gICAgICAgICAgICAqKCh1aW50MzIqKShwdHIgKyA0KSkgPSB0ZW1wOwotCi0gICAgICAgICAgICBwdHIgPSBwcmVkICsgOCArICh4cG9zID4+IDEpOwotCi0gICAgICAgICAgICBHZXRQcmVkQWR2QlRhYmxlW3lwb3MmMV1beHBvcyYxXShwdHIsIHByZWRfYmxvY2ssIDE2LCAocHJlZF93aWR0aCA8PCAxKSB8IHJuZDEpOwotCi0gICAgICAgICAgICByZXR1cm4gMTsKLSAgICAgICAgfQotICAgICAgICBlbHNlIC8qIHBhZCBib3R0b20gbGVmdCBvZiBmcmFtZSAqLwotICAgICAgICB7Ci0gICAgICAgICAgICAvKiBjb3B5IHRoZSBibG9jayAqLwotICAgICAgICAgICAgcHRyID0gcHJlZCArIDg7IC8qIHBvaW50IHRvIHRoZSBjZW50ZXIgKi8KLSAgICAgICAgICAgIHByZXYgPSBjX3ByZXYgKyB3aWR0aCAqIChoZWlnaHQgLSA4KTsKLSAgICAgICAgICAgIENPUFlfQkxPQ0sKLQotICAgICAgICAgICAgLyogcGFkIHRoZSBjb3JuZXIgKi8KLSAgICAgICAgICAgIHB0ciA9IHByZWQgKyAoOCA8PCA0KTsKLSAgICAgICAgICAgIHByZXYgPSBwdHIgLSA4OwotICAgICAgICAgICAgUEFEX0NPUk5FUgotCi0gICAgICAgICAgICAvKiBwYWQgYm90dG9tICovCi0gICAgICAgICAgICBwdHIgPSBwcmVkICsgKDggPDwgNCkgKyA4OwotICAgICAgICAgICAgcHJldiA9IHB0ciAtIDE2OwotICAgICAgICAgICAgUEFEX1JPVwotCi0gICAgICAgICAgICAvKiBwYWQgbGVmdCAqLwotICAgICAgICAgICAgcHRyID0gcHJlZCA7Ci0gICAgICAgICAgICBwcmV2ID0gcHRyICsgODsKLSAgICAgICAgICAgIFBBRF9DT0wKLQotICAgICAgICAgICAgcHRyID0gcHJlZCArIDggKyAoKCh5cG9zID4+IDEpIC0gKGhlaWdodCAtIDgpKSA8PCA0KSArICh4cG9zID4+IDEpOwotCi0gICAgICAgICAgICBHZXRQcmVkQWR2QlRhYmxlW3lwb3MmMV1beHBvcyYxXShwdHIsIHByZWRfYmxvY2ssIDE2LCAocHJlZF93aWR0aCA8PCAxKSB8IHJuZDEpOwotCi0gICAgICAgICAgICByZXR1cm4gMTsKLSAgICAgICAgfQotICAgIH0KLSAgICBlbHNlIGlmICgoeHBvcyA+PiAxKSA8ICh3aWR0aCAtIEJfU0laRSkpCi0gICAgewotICAgICAgICBpZiAoeXBvcyA8IDApIC8qIHBhZCB0b3Agb2YgZnJhbWUgKi8KLSAgICAgICAgewotICAgICAgICAgICAgeG9mZnNldCA9IHhwb3MgPj4gMTsKLSAgICAgICAgICAgIHhvZmZzZXQgPSB4b2Zmc2V0ICYgMHgzOyAvKiB3b3JkIGFsaWduIHB0ciAqLwotCi0gICAgICAgICAgICAvKiBjb3B5IGJsb2NrICovCi0gICAgICAgICAgICBwdHIgPSBwcmVkICsgKDggPDwgNCk7Ci0gICAgICAgICAgICBwcmV2ID0gY19wcmV2ICsgKHhwb3MgPj4gMSkgLSB4b2Zmc2V0OwotCi0gICAgICAgICAgICBpZiAoeG9mZnNldCB8fCAoeHBvcyYxKSkgLyogY29weSBleHRyYSA0eDggKi8KLSAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICBDT1BZXzEyeDgKLSAgICAgICAgICAgIH0KLSAgICAgICAgICAgIGVsc2UKLSAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICBDT1BZX0JMT0NLCi0gICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgIC8qIHBhZCB0b3AgKi8KLSAgICAgICAgICAgIHB0ciA9IHByZWQ7Ci0gICAgICAgICAgICBwcmV2ID0gcHJlZCArICg4IDw8IDQpOwotICAgICAgICAgICAgUEFEX1JPVwotICAgICAgICAgICAgaWYgKHhvZmZzZXQgfHwgKHhwb3MmMSkpIC8qIHBhZCBleHRyYSA0eDggKi8KLSAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICBwdHIgPSBwcmVkICsgODsKLSAgICAgICAgICAgICAgICBQQURfRVhUUkFfNHg4Ci0gICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgIHB0ciA9IHByZWQgKyAoKCh5cG9zID4+IDEpICsgOCkgPDwgNCkgKyB4b2Zmc2V0OwotCi0gICAgICAgICAgICBHZXRQcmVkQWR2QlRhYmxlW3lwb3MmMV1beHBvcyYxXShwdHIsIHByZWRfYmxvY2ssIDE2LCAocHJlZF93aWR0aCA8PCAxKSB8IHJuZDEpOwotCi0gICAgICAgICAgICByZXR1cm4gMTsKLSAgICAgICAgfQotICAgICAgICBlbHNlIC8qIHBhZCBib3R0b20gb2YgZnJhbWUgKi8KLSAgICAgICAgewotICAgICAgICAgICAgeG9mZnNldCA9IHhwb3MgPj4gMTsKLSAgICAgICAgICAgIHhvZmZzZXQgPSB4b2Zmc2V0ICYgMHgzOyAvKiB3b3JkIGFsaWduIHB0ciAqLwotICAgICAgICAgICAgLyogY29weSBibG9jayAqLwotICAgICAgICAgICAgcHRyID0gcHJlZCA7Ci0gICAgICAgICAgICBwcmV2ID0gY19wcmV2ICsgd2lkdGggKiAoaGVpZ2h0IC0gOCkgKyAoeHBvcyA+PiAxKSAtIHhvZmZzZXQ7Ci0gICAgICAgICAgICBpZiAoeG9mZnNldCAgfHwgKHhwb3MmMSkpCi0gICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgQ09QWV8xMng4Ci0gICAgICAgICAgICB9Ci0gICAgICAgICAgICBlbHNlCi0gICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgQ09QWV9CTE9DSwotICAgICAgICAgICAgfQotCi0gICAgICAgICAgICAvKiBwYWQgYm90dG9tICovCi0gICAgICAgICAgICBwdHIgPSBwcmVkICsgKDggPDwgNCk7Ci0gICAgICAgICAgICBwcmV2ID0gcHRyIC0gMTY7Ci0gICAgICAgICAgICBQQURfUk9XCi0gICAgICAgICAgICBpZiAoeG9mZnNldCB8fCAoeHBvcyYxKSkKLSAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICBwdHIgPSBwcmVkICsgKDggPDwgNCkgKyA4OwotICAgICAgICAgICAgICAgIFBBRF9FWFRSQV80eDgKLSAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgcHRyID0gcHJlZCArICgoKHlwb3MgPj4gMSkgLSAoaGVpZ2h0IC0gOCkpIDw8IDQpICsgeG9mZnNldDsKLQotICAgICAgICAgICAgR2V0UHJlZEFkdkJUYWJsZVt5cG9zJjFdW3hwb3MmMV0ocHRyLCBwcmVkX2Jsb2NrLCAxNiwgKHByZWRfd2lkdGggPDwgMSkgfCBybmQxKTsKLQotICAgICAgICAgICAgcmV0dXJuIDE7Ci0gICAgICAgIH0KLSAgICB9Ci0gICAgZWxzZQotICAgIHsKLSAgICAgICAgaWYgKHlwb3MgPCAwKSAvKiBwYWQgdG9wIHJpZ2h0IG9mIGZyYW1lICovCi0gICAgICAgIHsKLSAgICAgICAgICAgIC8qIGNvcHkgYmxvY2sgKi8KLSAgICAgICAgICAgIHB0ciA9IHByZWQgKyAoOCA8PCA0KTsKLSAgICAgICAgICAgIHByZXYgPSBjX3ByZXYgKyB3aWR0aCAtIDg7Ci0gICAgICAgICAgICBDT1BZX0JMT0NLCi0KLSAgICAgICAgICAgIC8qIHBhZCB0b3AtcmlnaHQgKi8KLSAgICAgICAgICAgIHB0ciA9IHByZWQgKyA4OwotICAgICAgICAgICAgcHJldiA9IHByZWQgKyAoOCA8PCA0KSArIDc7Ci0gICAgICAgICAgICBQQURfQ09STkVSCi0KLSAgICAgICAgICAgIC8qIHBhZCB0b3AgKi8KLSAgICAgICAgICAgIHB0ciA9IHByZWQgOwotICAgICAgICAgICAgcHJldiA9IHByZWQgKyAoOCA8PCA0KTsKLSAgICAgICAgICAgIFBBRF9ST1c7Ci0KLSAgICAgICAgICAgIC8qIHBhZCByaWdodCAqLwotICAgICAgICAgICAgcHRyID0gcHJlZCArICg4IDw8IDQpICsgODsKLSAgICAgICAgICAgIHByZXYgPSBwdHIgLSAxOwotICAgICAgICAgICAgUEFEX0NPTDsKLQotICAgICAgICAgICAgcHRyID0gcHJlZCArICgoOCArICh5cG9zID4+IDEpKSA8PCA0KSArICg4IC0gKHdpZHRoIC0gKHhwb3MgPj4gMSkpKTsKLQotICAgICAgICAgICAgR2V0UHJlZEFkdkJUYWJsZVt5cG9zJjFdW3hwb3MmMV0ocHRyLCBwcmVkX2Jsb2NrLCAxNiwgKHByZWRfd2lkdGggPDwgMSkgfCBybmQxKTsKLQotICAgICAgICAgICAgcmV0dXJuIDE7Ci0gICAgICAgIH0KLSAgICAgICAgZWxzZSBpZiAoKHlwb3MgPj4gMSkgPCAoaGVpZ2h0IC0gQl9TSVpFKSkgLyogcGFkIHJpZ2h0IG9mIGZyYW1lICovCi0gICAgICAgIHsKLSAgICAgICAgICAgIC8qIGNvcHkgYmxvY2sgKi8KLSAgICAgICAgICAgIHB0ciA9IHByZWQ7Ci0gICAgICAgICAgICBwcmV2ID0gY19wcmV2ICsgKHlwb3MgPj4gMSkgKiB3aWR0aCArIHdpZHRoIC0gODsKLSAgICAgICAgICAgIENPUFlfQkxPQ0sKLSAgICAgICAgICAgIC8qIGNvcHkgZXh0cmEgbGluZSAqLwotICAgICAgICAgICAgKigodWludDMyKikocHRyICs9IDE2KSkgPSAqKCh1aW50MzIqKShwcmV2ICs9IHdpZHRoKSk7Ci0gICAgICAgICAgICAqKCh1aW50MzIqKShwdHIgKyA0KSkgPSAqKCh1aW50MzIqKShwcmV2ICsgNCkpOwotCi0gICAgICAgICAgICAvKiBwYWQgcmlnaHQgKi8KLSAgICAgICAgICAgIHB0ciA9IHByZWQgKyA4OwotICAgICAgICAgICAgcHJldiA9IHB0ciAtIDE7Ci0gICAgICAgICAgICBQQURfQ09MOwotICAgICAgICAgICAgLyogcGFkIGV4dHJhIGxpbmUgKi8KLSAgICAgICAgICAgIHRlbXAgPSAqKHByZXYgKz0gMTYpOwotICAgICAgICAgICAgdGVtcCB8PSAodGVtcCA8PCA4KTsKLSAgICAgICAgICAgIHRlbXAgfD0gKHRlbXAgPDwgMTYpOwotICAgICAgICAgICAgKigodWludDMyKikocHRyICs9IDE2KSkgPSB0ZW1wOwotICAgICAgICAgICAgKigodWludDMyKikocHRyICsgNCkpID0gdGVtcDsKLQotCi0gICAgICAgICAgICBwdHIgPSBwcmVkICsgOCAtICh3aWR0aCAtICh4cG9zID4+IDEpKTsKLQotICAgICAgICAgICAgR2V0UHJlZEFkdkJUYWJsZVt5cG9zJjFdW3hwb3MmMV0ocHRyLCBwcmVkX2Jsb2NrLCAxNiwgKHByZWRfd2lkdGggPDwgMSkgfCBybmQxKTsKLQotICAgICAgICAgICAgcmV0dXJuIDE7Ci0KLSAgICAgICAgfQotICAgICAgICBlbHNlIC8qIHBhZCBib3R0b20gcmlnaHQgb2YgZnJhbWUgKi8KLSAgICAgICAgewotICAgICAgICAgICAgLyogY29weSBibG9jayAqLwotICAgICAgICAgICAgcHRyID0gcHJlZDsKLSAgICAgICAgICAgIHByZXYgPSBjX3ByZXYgKyB3aWR0aCAqIChoZWlnaHQgLSA4KSArIHdpZHRoIC0gODsKLSAgICAgICAgICAgIENPUFlfQkxPQ0sKLQotICAgICAgICAgICAgLyogcGFkIGJvdHRvbS1yaWdodCAqLwotICAgICAgICAgICAgcHRyID0gcHJlZCArICg4IDw8IDQpICsgODsKLSAgICAgICAgICAgIHByZXYgPSBwdHIgLSAxNzsKLSAgICAgICAgICAgI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fIF83XyAgICAgIEModSkgQyh2KQotICAgIGYocix5KSA9IFwgICBcICBGKHUsdiktLS0tIC0tLS1jb3NbKDJyKzEpKnUqcGkvMTZdY29zWygyeSsxKSp2KnBpLzE2XQotICAgICAgICAgL19fIC9fXyAgICAyICAgIDIKLSAgICAgICAgIHU9MCB2PTAKLQotICAgIHdoZXJlICAgQyhpKSA9IDEvc3FydCgyKSAgICBpZiBpPTAKLSAgICAgICAgQyhpKSA9IDEgICAgICAgIG90aGVyd2lzZQotCi0gMi1EIElEQ1QgY2FuIGJlIHNlcGFyYXRlZCBhcyBob3Jpem9udGFsKHJvdy13aXNlKSBhbmQgdmVydGljYWwoY29sdW1uLXdpc2UpCi0gMS1EIElEQ1RzLiBUaGVyZWZvcmUsIDItRCBJRENUIHZhbHVlcyBhcmUgZm91bmQgYnkgdGhlIGZvbGxvd2luZyB0d28gc3RlcHM6Ci0gMS4gRmluZCBob3Jpem9udGFsIDEtRCBJRENUIHZhbHVlcyBmb3IgZWFjaCByb3cgZnJvbSA4cjggZGVxdWFudGl6ZWQgRENUCi0gICAgY29lZmZpY2llbnRzIGJ5IHJvdyBJRENUIG9wZXJhdGlvbi4KLQotICAgICAgICAgIF83XyAgICAgICAgQyh1KQotICAgIGcocix2KSA9ICBcICAgRih1LHYpIC0tLS0gY29zWygycisxKSp1KnBpLzE2XQotICAgICAgICAgIC9fXyAgICAgICAgIDIKLSAgICAgICAgICB1PTAKLQotIDIuIEZpbmQgdmVydGljYWwgMS1EIElEQ1QgdmFsdWVzIGZvciBlYWNoIGNvbHVtbiBmcm9tIHRoZSByZXN1bHRzIG9mIDEKLSAgICBieSBjb2x1bW4gSURDVCBvcGVyYXRpb24uCi0KLSAgICAgICAgICAgICAgXzdfICAgICAgICBDKHYpCi0gICAgZihyLHkpID0gIFwgICBnKHIsdikgLS0tLSBjb3NbKDJ5KzEpKnYqcGkvMTZdCi0gICAgICAgICAgL19fICAgICAgICAgMgotICAgICAgICAgIHY9MAotCi0tLS0tLS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lICovCi0KLSAgICAgICAgcjEgPSBibGtbQl9TSVpFICogNCArIGldIDw8IDExOwotICAgICAgICAvKiBzaW5jZSByb3cgSURDVCByZXN1bHRzIGhhdmUgbmV0IGxlZnQgc2hpZnQgYnkgMyAqLwotICAgICAgICAvKiB0aGlzIGxlZnQgc2hpZnQgYnkgOCBnaXZlcyBuZXQgbGVmdCBzaGlmdCBieSAxMSAqLwotICAgICAgICAvKiBpbiBvcmRlciB0byBtYWludGFpbiB0aGUgc2FtZSBzY2FsZSBhcyB0aGF0IG9mICAqLwotICAgICAgICAvKiBjb2VmZmljaWVudHMgV2kgKi8KLQotICAgICAgICByMiA9IGJsa1tCX1NJWkUgKiA2ICsgaV07Ci0gICAgICAgIHIzID0gYmxrW0JfU0laRSAqIDIgKyBpXTsKLSAgICAgICAgcjQgPSBibGtbQl9TSVpFICogMSArIGldOwotICAgICAgICByNSA9IGJsa1tCX1NJWkUgKiA3ICsgaV07Ci0gICAgICAgIHI2ID0gYmxrW0JfU0laRSAqIDUgKyBpXTsKLSAgICAgICAgcjcgPSBibGtbQl9TSVpFICogMyArIGldOwotCi0gICAgICAgIGlmICghKHIxIHwgcjIgfCByMyB8IHI0IHwgcjUgfCByNiB8IHI3KSkKLSAgICAgICAgewotICAgICAgICAgICAgLyogc2hvcnRjdXQgKi8KLSAgICAgICAgICAgIC8qIGV4ZWN1dGUgaWYgdmFsdWVzIG9mIGcociwxKSB0byBnKHIsNykgaW4gYSBjb2x1bW4qLwotICAgICAgICAgICAgLyogYXJlIGFsbCB6ZXJvcyAqLwotCi0gICAgICAgICAgICAvKiBtYWtlIG91dHB1dCBvZiBJRENUID4+MyBvciBzY2FsZWQgYnkgMS84IGFuZCAqLwotICAgICAgICAgICAgLyogd2l0aCB0aGUgcHJvcGVyIHJvdW5kaW5nICovCi0gICAgICAgICAgICBhID0gKGJsa1tCX1NJWkUgKiAwICsgaV0pIDw8IDM7Ci0gICAgICAgICAgICB0bXBCTEszMltCX1NJWkUgKiAwICsgaV0gPSBhOwotICAgICAgICAgICAgdG1wQkxLMzJbQl9TSVpFICogMSArIGldID0gYTsKLSAgICAgICAgICAgIHRtcEJMSzMyW0JfU0laRSAqIDIgKyBpXSA9IGE7Ci0gICAgICAgICAgICB0bXBCTEszMltCX1NJWkUgKiAzICsgaV0gPSBhOwotICAgICAgICAgICAgdG1wQkxLMzJbQl9TSVpFICogNCArIGldID0gYTsKLSAgICAgICAgICAgIHRtcEJMSzMyW0JfU0laRSAqIDUgKyBpXSA9IGE7Ci0gICAgICAgICAgICB0bXBCTEszMltCX1NJWkUgKiA2ICsgaV0gPSBhOwotICAgICAgICAgICAgdG1wQkxLMzJbQl9TSVpFICogNyArIGldID0gYTsKLSAgICAgICAgfQotICAgICAgICBlbHNlCi0gICAgICAgIHsKLSAgICAgICAgICAgIHIwID0gKGJsa1s4ICogMCArIGldIDw8IDExKSArIDEyODsKLQotICAgICAgICAgICAgLyogZmlyc3Qgc3RhZ2UgKi8KLQotICAgICAgICAgICAgcjggPSBXNyAqIChyNCArIHI1KTsKLSAgICAgICAgICAgIHI0ID0gKHI4ICsgKFcxIC0gVzcpICogcjQpOwotICAgICAgICAgICAgLyogTXVsdGlwbGljYXRpb24gd2l0aCBXaSBpbmNyZWFzZXMgdGhlIG5ldCBsZWZ0ICovCi0gICAgICAgICAgICAvKiBzaGlmdCBmcm9tIDExIHRvIDE0LHdlIGhhdmUgdG8gc2hpZnQgYmFjayBieSAzKi8KLSAgICAgICAgICAgIHI1ID0gKHI4IC0gKFcxICsgVzcpICogcjUpOwotICAgICAgICAgICAgcjggPSBXMyAqIChyNiArIHI3KTsKLSAgICAgICAgICAgIHI2ID0gKHI4IC0gKFczIC0gVzUpICogcjYpOwotICAgICAgICAgICAgcjcgPSAocjggLSAoVzMgKyBXNSkgKiByNyk7Ci0KLSAgICAgICAgICAgIC8qIHNlY29uZCBzdGFnZSAqLwotICAgICAgICAgICAgcjggPSByMCArIHIxOwotICAgICAgICAgICAgcjAgLT0gcjE7Ci0KLSAgICAgICAgICAgIHIxID0gVzYgKiAocjMgKyByMik7Ci0gICAgICAgICAgICByMiA9IChyMSAtIChXMiArIFc2KSAqIHIyKTsKLSAgICAgICAgICAgIHIzID0gKHIxICsgKFcyIC0gVzYpICogcjMpOwotCi0gICAgICAgICAgICByMSA9IHI0ICsgcjY7Ci0gICAgICAgICAgICByNCAtPSByNjsKLSAgICAgICAgICAgIHI2ID0gcjUgKyByNzsKLSAgICAgICAgICAgIHI1IC09IHI3OwotCi0gICAgICAgICAgICAvKiB0aGlyZCBzdGFnZSAqLwotICAgICAgICAgICAgcjcgPSByOCArIHIzOwotICAgICAgICAgICAgcjggLT0gcjM7Ci0gICAgICAgICAgICByMyA9IHIwICsgcjI7Ci0gICAgICAgICAgICByMCAtPSByMjsKLSAgICAgICAgICAgIHIyID0gKDE4MSAqIChyNCArIHI1KSArIDEyOCkgPj4gODsgIC8qIHJvdW5kaW5nICovCi0gICAgICAgICAgICByNCA9ICgxODEgKiAocjQgLSByNSkgKyAxMjgpID4+IDg7Ci0KLSAgICAgICAgICAgIC8qIGZvdXJ0aCBzdGFnZSAqLwotICAgICAgICAgICAgLyogbmV0IHNoaWZ0IG9mIElEQ1QgaXMgPj4zIGFmdGVyIHRoZSBmb2xsb3dpbmcgKi8KLSAgICAgICAgICAgIC8qIHNoaWZ0IG9wZXJhdGlvbiwgaXQgbWFrZXMgb3V0cHV0IG9mIDItRCBJRENUICovCi0gICAgICAgICAgICAvKiBzY2FsZWQgYnkgMS84LCB0aGF0IGlzIHNjYWxlZCB0d2ljZSBieSAgICAgICAqLwotICAgICAgICAgICAgLyogMS8oMipzcXJ0KDIpKSBmb3Igcm93IElEQ1QgYW5kIGNvbHVtbiBJRENULiAgKi8KLSAgICAgICAgICAgIC8qIHNlZSBkZXRhaWwgYW5hbHlzaXMgaW4gZGVzaWduIGRvYy4gICAgICAgICAgICovCi0gICAgICAgICAgICB0bXBCTEszMlswICsgaV0gPSAocjcgKyByMSkgPj4gODsKLSAgICAgICAgICAgIHRtcEJMSzMyWygxPDwzKSArIGldID0gKHIzICsgcjIpID4+IDg7Ci0gICAgICAgICAgICB0bXBCTEszMlsoMjw8MykgKyBpXSA9IChyMCArIHI0KSA+PiA4OwotICAgICAgICAgICAgdG1wQkxLMzJbKDM8PDMpICsgaV0gPSAocjggKyByNikgPj4gODsKLSAgICAgICAgICAgIHRtcEJMSzMyWyg0PDwzKSArIGldID0gKHI4IC0gcjYpID4+IDg7Ci0gICAgICAgICAgICB0bXBCTEszMlsoNTw8MykgKyBpXSA9IChyMCAtIHI0KSA+PiA4OwotICAgICAgICAgICAgdG1wQkxLMzJbKDY8PDMpICsgaV0gPSAocjMgLSByMikgPj4gODsKLSAgICAgICAgICAgIHRtcEJMSzMyWyg3PDwzKSArIGldID0gKHI3IC0gcjEpID4+IDg7Ci0gICAgICAgIH0KLSAgICB9Ci0gICAgLyogcm93IChob3Jpem9udGFsKSBJRENUICovCi0gICAgZm9yIChpID0gMCA7IGkgPCBCX1NJWkU7IGkrKykKLSAgICB7Ci0gICAgICAgIC8qIGluaXRpYWxpemUgYnV0dGVyZmx5IG5vZGVzIGF0IHRoZSBmaXJzdCBzdGFnZSAqLwotCi0gICAgICAgIHIxID0gKChpbnQzMil0bXBCTEszMls0KyhpPDwzKV0pIDw8IDg7Ci0gICAgICAgIC8qIHIxIGxlZnQgc2hpZnQgYnkgMTEgaXMgdG8gbWFpbnRhaW4gdGhlIHNhbWUgICovCi0gICAgICAgIC8qIHNjYWxlIGFzIHRoYXQgb2YgY29lZmZpY2llbnRzIChXMSwuLi5XNykgKi8KLSAgICAgICAgLyogc2luY2UgYmxrWzRdIHdvbid0IG11bHRpcGx5IHdpdGggV2kuICAgICAqLwotICAgICAgICAvKiBzZWUgZGV0YWlsIGRpYWdyYW0gaW4gZGVzaWduIGRvY3VtZW50LiAgICovCi0KLSAgICAgICAgcjIgPSB0bXBCTEszMls2KyhpPDwzKV07Ci0gICAgICAgIHIzID0gdG1wQkxLMzJbMisoaTw8MyldOwotICAgICAgICByNCA9IHRtcEJMSzMyWzErKGk8PDMpXTsKLSAgICAgICAgcjUgPSB0bXBCTEszMls3KyhpPDwzKV07Ci0gICAgICAgIHI2ID0gdG1wQkxLMzJbNSsoaTw8MyldOwotICAgICAgICByNyA9IHRtcEJMSzMyWzMrKGk8PDMpXTsKLQotICAgICAgICBpZiAoIShyMSB8IHIyIHwgcjMgfCByNCB8IHI1IHwgcjYgfCByNykpCi0gICAgICAgIHsKLSAgICAgICAgICAgIC8qIHNob3J0Y3V0ICovCi0gICAgICAgICAgICAvKiBleGVjdXRlIGlmIHZhbHVlcyBvZiBGKDEsdikgdG8gRig3LHYpIGluIGEgcm93Ki8KLSAgICAgICAgICAgIC8qIGFyZSBhbGwgemVyb3MgKi8KLQotICAgICAgICAgICAgLyogb3V0cHV0IG9mIHJvdyBJRENUIHNjYWxlZCBieSA4ICovCi0gICAgICAgICAgICBhID0gKCgoaW50MzIpdG1wQkxLMzJbMCsoaTw8MyldICsgMzIpID4+IDYpOwotICAgICAgICAgICAgQ0xJUF9SRVNVTFQoYSkKLSAgICAgICAgICAgICpjb21wKysgPSBhOwotICAgICAgICAgICAgKmNvbXArKyA9IGE7Ci0gICAgICAgICAgICAqY29tcCsrID0gYTsKLSAgICAgICAgICAgICpjb21wKysgPSBhOwotICAgICAgICAgICAgKmNvbXArKyA9IGE7Ci0gICAgICAgICAgICAqY29tcCsrID0gYTsKLSAgICAgICAgICAgICpjb21wKysgPSBhOwotICAgICAgICAgICAgKmNvbXArKyA9IGE7Ci0KLSAgICAgICAgICAgIGNvbXAgKz0gb2Zmc2V0OwotICAgICAgICB9Ci0KLSAgICAgICAgZWxzZQotICAgICAgICB7Ci0gICAgICAgICAgICAvKiBmb3IgcHJvcGVyIHJvdW5kaW5nIGluIHRoZSBmb3VydGggc3RhZ2UgKi8KLSAgICAgICAgICAgIHIwID0gKCgoaW50MzIpdG1wQkxLMzJbMCsoaTw8MyldKSA8PCA4KSArIDgxOTI7Ci0KLSAgICAgICAgICAgIC8qIGZpcnN0IHN0YWdlICovCi0KLSAgICAgICAgICAgIHI4ID0gVzcgKiAocjQgKyByNSkgKyA0OwotICAgICAgICAgICAgcjQgPSAocjggKyAoVzEgLSBXNykgKiByNCkgPj4gMzsKLSAgICAgICAgICAgIHI1ID0gKHI4IC0gKFcxICsgVzcpICogcjUpID4+IDM7Ci0KLSAgICAgICAgICAgIHI4ID0gVzMgKiAocjYgKyByNykgKyA0OwotICAgICAgICAgICAgcjYgPSAocjggLSAoVzMgLSBXNSkgKiByNikgPj4gMzsKLSAgICAgICAgICAgIHI3ID0gKHI4IC0gKFczICsgVzUpICogcjcpID4+IDM7Ci0KLSAgICAgICAgICAgIC8qIHNlY29uZCBzdGFnZSAqLwotICAgICAgICAgICAgcjggPSByMCArIHIxOwotICAgICAgICAgICAgcjAgLT0gcjE7Ci0KLSAgICAgICAgICAgIHIxID0gVzYgKiAocjMgKyByMikgKyA0OwotICAgICAgICAgICAgcjIgPSAocjEgLSAoVzIgKyBXNikgKiByMikgPj4gMzsKLSAgICAgICAgICAgIHIzID0gKHIxICsgKFcyIC0gVzYpICogcjMpID4+IDM7Ci0KLSAgICAgICAgICAgIHIxID0gcjQgKyByNjsKLSAgICAgICAgICAgIHI0IC09IHI2OwotICAgICAgICAgICAgcjYgPSByNSArIHI3OwotICAgICAgICAgICAgcjUgLT0gcjc7Ci0KLSAgICAgICAgICAgIC8qIHRoaXJkIHN0YWdlICovCi0gICAgICAgICAgICByNyA9IHI4ICsgcjM7Ci0gICAgICAgICAgICByOCAtPSByMzsKLSAgICAgICAgICAgIHIzID0gcjAgKyByMjsKLSAgICAgICAgICAgIHIwIC09IHIyOwotICAgICAgICAgICAgcjIgPSAoMTgxICogKHI0ICsgcjUpICsgMTI4KSA+PiA4OyAgICAvKiByb3VuZGluZyAqLwotICAgICAgICAgICAgcjQgPSAoMTgxICogKHI0IC0gcjUpICsgMTI4KSA+PiA4OwotCi0gICAgICAgICAgICAvKiBmb3VydGggc3RhZ2UgKi8KLSAgICAgICAgICAgIC8qIG5ldCBzaGlmdCBvZiB0aGlzIGZ1bmN0aW9uIGlzIDw8MyBhZnRlciB0aGUgICAgKi8KLSAgICAgICAgICAgIC8qIGZvbGxvd2luZyBzaGlmdCBvcGVyYXRpb24sIGl0IG1ha2VzIG91dHB1dCBvZiAgKi8KLSAgICAgICAgICAgIC8qIHJvdyBJRENUIHNjYWxlZCBieSA4IHRvIHJldGFpbiAzIGJpdHMgcHJlY2lzaW9uKi8KLSAgICAgICAgICAgIGEgPSAoKHI3ICsgcjEpID4+IDE0KTsKLSAgICAgICAgICAgIENMSVBfUkVTVUxUKGEpCi0gICAgICAgICAgICAqY29tcCsrID0gYTsKLSAgICAgICAgICAgIGEgPSAoKHIzICsgcjIpID4+IDE0KTsKLSAgICAgICAgICAgIENMSVBfUkVTVUxUKGEpCi0gICAgICAgICAgICAqY29tcCsrID0gYTsKLSAgICAgICAgICAgIGEgPSAoKHIwICsgcjQpID4+IDE0KTsKLSAgICAgICAgICAgIENMSVBfUkVTVUxUKGEpCi0gICAgICAgICAgICAqY29tcCsrID0gYTsKLSAgICAgICAgICAgIGEgPSAoKHI4ICsgcjYpID4+IDE0KTsKLSAgICAgICAgICAgIENMSVBfUkVTVUxUKGEpCi0gICAgICAgICAgICAqY29tcCsrID0gYTsKLSAgICAgICAgICAgIGEgPSAoKHI4IC0gcjYpID4+IDE0KTsKLSAgICAgICAgICAgIENMSVBfUkVTVUxUKGEpCi0gICAgICAgICAgICAqY29tcCsrID0gYTsKLSAgICAgICAgICAgIGEgPSAoKHIwIC0gcjQpID4+IDE0KTsKLSAgICAgICAgICAgIENMSVBfUkVTVUxUKGEpCi0gICAgICAgICAgICAqY29tcCsrID0gYTsKLSAgICAgICAgICAgIGEgPSAoKHIzIC0gcjIpID4+IDE0KTsKLSAgICAgICAgICAgIENMSVBfUkVTVUxUKGEpCi0gICAgICAgICAgICAqY29tcCsrID0gYTsKLSAgICAgICAgICAgIGEgPSAoKH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ICAgICByNyA9IGJsa1tCX1NJWkUgKiAzICsgaV07Ci0KLSAgICAgICAgaWYgKCEocjEgfCByMiB8IHIzIHwgcjQgfCByNSB8IHI2IHwgcjcpKQotICAgICAgICB7Ci0gICAgICAgICAgICAvKiBzaG9ydGN1dCAqLwotICAgICAgICAgICAgLyogZXhlY3V0ZSBpZiB2YWx1ZXMgb2YgZyhyLDEpIHRvIGcociw3KSBpbiBhIGNvbHVtbiovCi0gICAgICAgICAgICAvKiBhcmUgYWxsIHplcm9zICovCi0KLSAgICAgICAgICAgIC8qIG1ha2Ugb3V0cHV0IG9mIElEQ1QgPj4zIG9yIHNjYWxlZCBieSAxLzggYW5kICovCi0gICAgICAgICAgICAvKiB3aXRoIHRoZSBwcm9wZXIgcm91bmRpbmcgKi8KLSAgICAgICAgICAgIGEgPSAoYmxrW0JfU0laRSAqIDAgKyBpXSkgPDwgMzsKLSAgICAgICAgICAgIHRtcEJMSzMyW0JfU0laRSAqIDAgKyBpXSA9IGE7Ci0gICAgICAgICAgICB0bXBCTEszMltCX1NJWkUgKiAxICsgaV0gPSBhOwotICAgICAgICAgICAgdG1wQkxLMzJbQl9TSVpFICogMiArIGldID0gYTsKLSAgICAgICAgICAgIHRtcEJMSzMyW0JfU0laRSAqIDMgKyBpXSA9IGE7Ci0gICAgICAgICAgICB0bXBCTEszMltCX1NJWkUgKiA0ICsgaV0gPSBhOwotICAgICAgICAgICAgdG1wQkxLMzJbQl9TSVpFICogNSArIGldID0gYTsKLSAgICAgICAgICAgIHRtcEJMSzMyW0JfU0laRSAqIDYgKyBpXSA9IGE7Ci0gICAgICAgICAgICB0bXBCTEszMltCX1NJWkUgKiA3ICsgaV0gPSBhOwotICAgICAgICB9Ci0gICAgICAgIGVsc2UKLSAgICAgICAgewotICAgICAgICAgICAgcjAgPSAoYmxrWzggKiAwICsgaV0gPDwgMTEpICsgMTI4OwotCi0gICAgICAgICAgICAvKiBmaXJzdCBzdGFnZSAqLwotCi0gICAgICAgICAgICByOCA9IFc3ICogKHI0ICsgcjUpOwotICAgICAgICAgICAgcjQgPSAocjggKyAoVzEgLSBXNykgKiByNCk7Ci0gICAgICAgICAgICAvKiBNdWx0aXBsaWNhdGlvbiB3aXRoIFdpIGluY3JlYXNlcyB0aGUgbmV0IGxlZnQgKi8KLSAgICAgICAgICAgIC8qIHNoaWZ0IGZyb20gMTEgdG8gMTQsd2UgaGF2ZSB0byBzaGlmdCBiYWNrIGJ5IDMqLwotICAgICAgICAgICAgcjUgPSAocjggLSAoVzEgKyBXNykgKiByNSk7Ci0gICAgICAgICAgICByOCA9IFczICogKHI2ICsgcjcpOwotICAgICAgICAgICAgcjYgPSAocjggLSAoVzMgLSBXNSkgKiByNik7Ci0gICAgICAgICAgICByNyA9IChyOCAtIChXMyArIFc1KSAqIHI3KTsKLQotICAgICAgICAgICAgLyogc2Vjb25kIHN0YWdlICovCi0gICAgICAgICAgICByOCA9IHIwICsgcjE7Ci0gICAgICAgICAgICByMCAtPSByMTsKLQotICAgICAgICAgICAgcjEgPSBXNiAqIChyMyArIHIyKTsKLSAgICAgICAgICAgIHIyID0gKHIxIC0gKFcyICsgVzYpICogcjIpOwotICAgICAgICAgICAgcjMgPSAocjEgKyAoVzIgLSBXNikgKiByMyk7Ci0KLSAgICAgICAgICAgIHIxID0gcjQgKyByNjsKLSAgICAgICAgICAgIHI0IC09IHI2OwotICAgICAgICAgICAgcjYgPSByNSArIHI3OwotICAgICAgICAgICAgcjUgLT0gcjc7Ci0KLSAgICAgICAgICAgIC8qIHRoaXJkIHN0YWdlICovCi0gICAgICAgICAgICByNyA9IHI4ICsgcjM7Ci0gICAgICAgICAgICByOCAtPSByMzsKLSAgICAgICAgICAgIHIzID0gcjAgKyByMjsKLSAgICAgICAgICAgIHIwIC09IHIyOwotICAgICAgICAgICAgcjIgPSAoMTgxICogKHI0ICsgcjUpICsgMTI4KSA+PiA4OyAgLyogcm91bmRpbmcgKi8KLSAgICAgICAgICAgIHI0ID0gKDE4MSAqIChyNCAtIHI1KSArIDEyOCkgPj4gODsKLQotICAgICAgICAgICAgLyogZm91cnRoIHN0YWdlICovCi0gICAgICAgICAgICAvKiBuZXQgc2hpZnQgb2YgSURDVCBpcyA+PjMgYWZ0ZXIgdGhlIGZvbGxvd2luZyAqLwotICAgICAgICAgICAgLyogc2hpZnQgb3BlcmF0aW9uLCBpdCBtYWtlcyBvdXRwdXQgb2YgMi1EIElEQ1QgKi8KLSAgICAgICAgICAgIC8qIHNjYWxlZCBieSAxLzgsIHRoYXQgaXMgc2NhbGVkIHR3aWNlIGJ5ICAgICAgICovCi0gICAgICAgICAgICAvKiAxLygyKnNxcnQoMikpIGZvciByb3cgSURDVCBhbmQgY29sdW1uIElEQ1QuICAqLwotICAgICAgICAgICAgLyogc2VlIGRldGFpbCBhbmFseXNpcyBpbiBkZXNpZ24gZG9jLiAgICAgICAgICAgKi8KLSAgICAgICAgICAgIHRtcEJMSzMyWzAgKyBpXSA9IChyNyArIHIxKSA+PiA4OwotICAgICAgICAgICAgdG1wQkxLMzJbKDE8PDMpICsgaV0gPSAocjMgKyByMikgPj4gODsKLSAgICAgICAgICAgIHRtcEJMSzMyWygyPDwzKSArIGldID0gKHIwICsgcjQpID4+IDg7Ci0gICAgICAgICAgICB0bXBCTEszMlsoMzw8MykgKyBpXSA9IChyOCArIHI2KSA+PiA4OwotICAgICAgICAgICAgdG1wQkxLMzJbKDQ8PDMpICsgaV0gPSAocjggLSByNikgPj4gODsKLSAgICAgICAgICAgIHRtcEJMSzMyWyg1PDwzKSArIGldID0gKHIwIC0gcjQpID4+IDg7Ci0gICAgICAgICAgICB0bXBCTEszMlsoNjw8MykgKyBpXSA9IChyMyAtIHIyKSA+PiA4OwotICAgICAgICAgICAgdG1wQkxLMzJbKDc8PDMpICsgaV0gPSAocjcgLSByMSkgPj4gODsKLSAgICAgICAgfQotICAgIH0KLSAgICAvKiByb3cgKGhvcml6b250YWwpIElEQ1QgKi8KLSAgICBmb3IgKGkgPSBCX1NJWkUgLSAxOyBpID49IDA7IGktLSkKLSAgICB7Ci0gICAgICAgIC8qIGluaXRpYWxpemUgYnV0dGVyZmx5IG5vZGVzIGF0IHRoZSBmaXJzdCBzdGFnZSAqLwotCi0gICAgICAgIHIxID0gKChpbnQzMil0bXBCTEszMls0KyhpPDwzKV0pIDw8IDg7Ci0gICAgICAgIC8qIHIxIGxlZnQgc2hpZnQgYnkgMTEgaXMgdG8gbWFpbnRhaW4gdGhlIHNhbWUgICovCi0gICAgICAgIC8qIHNjYWxlIGFzIHRoYXQgb2YgY29lZmZpY2llbnRzIChXMSwuLi5XNykgKi8KLSAgICAgICAgLyogc2luY2UgYmxrWzRdIHdvbid0IG11bHRpcGx5IHdpdGggV2kuICAgICAqLwotICAgICAgICAvKiBzZWUgZGV0YWlsIGRpYWdyYW0gaW4gZGVzaWduIGRvY3VtZW50LiAgICovCi0KLSAgICAgICAgcjIgPSB0bXBCTEszMls2KyhpPDwzKV07Ci0gICAgICAgIHIzID0gdG1wQkxLMzJbMisoaTw8MyldOwotICAgICAgICByNCA9IHRtcEJMSzMyWzErKGk8PDMpXTsKLSAgICAgICAgcjUgPSB0bXBCTEszMls3KyhpPDwzKV07Ci0gICAgICAgIHI2ID0gdG1wQkxLMzJbNSsoaTw8MyldOwotICAgICAgICByNyA9IHRtcEJMSzMyWzMrKGk8PDMpXTsKLQotICAgICAgICBpZiAoIShyMSB8IHIyIHwgcjMgfCByNCB8IHI1IHwgcjYgfCByNykpCi0gICAgICAgIHsKLSAgICAgICAgICAgIC8qIHNob3J0Y3V0ICovCi0gICAgICAgICAgICAvKiBleGVjdXRlIGlmIHZhbHVlcyBvZiBGKDEsdikgdG8gRig3LHYpIGluIGEgcm93Ki8KLSAgICAgICAgICAgIC8qIGFyZSBhbGwgemVyb3MgKi8KLQotICAgICAgICAgICAgLyogb3V0cHV0IG9mIHJvdyBJRENUIHNjYWxlZCBieSA4ICovCi0gICAgICAgICAgICBhID0gKHRtcEJMSzMyWzArKGk8PDMpXSArIDMyKSA+PiA2OwotICAgICAgICAgICAgYmxrWzArKGk8PDMpXSA9IGE7Ci0gICAgICAgICAgICBibGtbMSsoaTw8MyldID0gYTsKLSAgICAgICAgICAgIGJsa1syKyhpPDwzKV0gPSBhOwotICAgICAgICAgICAgYmxrWzMrKGk8PDMpXSA9IGE7Ci0gICAgICAgICAgICBibGtbNCsoaTw8MyldID0gYTsKLSAgICAgICAgICAgIGJsa1s1KyhpPDwzKV0gPSBhOwotICAgICAgICAgICAgYmxrWzYrKGk8PDMpXSA9IGE7Ci0gICAgICAgICAgICBibGtbNysoaTw8MyldID0gYTsKLQotICAgICAgICB9Ci0KLSAgICAgICAgZWxzZQotICAgICAgICB7Ci0gICAgICAgICAgICAvKiBmb3IgcHJvcGVyIHJvdW5kaW5nIGluIHRoZSBmb3VydGggc3RhZ2UgKi8KLSAgICAgICAgICAgIHIwID0gKCgoaW50MzIpdG1wQkxLMzJbMCsoaTw8MyldKSA8PCA4KSArIDgxOTI7Ci0KLSAgICAgICAgICAgIC8qIGZpcnN0IHN0YWdlICovCi0KLSAgICAgICAgICAgIHI4ID0gVzcgKiAocjQgKyByNSkgKyA0OwotICAgICAgICAgICAgcjQgPSAocjggKyAoVzEgLSBXNykgKiByNCkgPj4gMzsKLSAgICAgICAgICAgIHI1ID0gKHI4IC0gKFcxICsgVzcpICogcjUpID4+IDM7Ci0KLSAgICAgICAgICAgIHI4ID0gVzMgKiAocjYgKyByNykgKyA0OwotICAgICAgICAgICAgcjYgPSAocjggLSAoVzMgLSBXNSkgKiByNikgPj4gMzsKLSAgICAgICAgICAgIHI3ID0gKHI4IC0gKFczICsgVzUpICogcjcpID4+IDM7Ci0KLSAgICAgICAgICAgIC8qIHNlY29uZCBzdGFnZSAqLwotICAgICAgICAgICAgcjggPSByMCArIHIxOwotICAgICAgICAgICAgcjAgLT0gcjE7Ci0KLSAgICAgICAgICAgIHIxID0gVzYgKiAocjMgKyByMikgKyA0OwotICAgICAgICAgICAgcjIgPSAocjEgLSAoVzIgKyBXNikgKiByMikgPj4gMzsKLSAgICAgICAgICAgIHIzID0gKHIxICsgKFcyIC0gVzYpICogcjMpID4+IDM7Ci0KLSAgICAgICAgICAgIHIxID0gcjQgKyByNjsKLSAgICAgICAgICAgIHI0IC09IHI2OwotICAgICAgICAgICAgcjYgPSByNSArIHI3OwotICAgICAgICAgICAgcjUgLT0gcjc7Ci0KLSAgICAgICAgICAgIC8qIHRoaXJkIHN0YWdlICovCi0gICAgICAgICAgICByNyA9IHI4ICsgcjM7Ci0gICAgICAgICAgICByOCAtPSByMzsKLSAgICAgICAgICAgIHIzID0gcjAgKyByMjsKLSAgICAgICAgICAgIHIwIC09IHIyOwotICAgICAgICAgICAgcjIgPSAoMTgxICogKHI0ICsgcjUpICsgMTI4KSA+PiA4OyAgICAvKiByb3VuZGluZyAqLwotICAgICAgICAgICAgcjQgPSAoMTgxICogKHI0IC0gcjUpICsgMTI4KSA+PiA4OwotCi0gICAgICAgICAgICAvKiBmb3VydGggc3RhZ2UgKi8KLSAgICAgICAgICAgIC8qIG5ldCBzaGlmdCBvZiB0aGlzIGZ1bmN0aW9uIGlzIDw8MyBhZnRlciB0aGUgICAgKi8KLSAgICAgICAgICAgIC8qIGZvbGxvd2luZyBzaGlmdCBvcGVyYXRpb24sIGl0IG1ha2VzIG91dHB1dCBvZiAgKi8KLSAgICAgICAgICAgIC8qIHJvdyBJRENUIHNjYWxlZCBieSA4IHRvIHJldGFpbiAzIGJpdHMgcHJlY2lzaW9uKi8KLSAgICAgICAgICAgIGJsa1swKyhpPDwzKV0gPSAocjcgKyByMSkgPj4gMTQ7Ci0gICAgICAgICAgICBibGtbMSsoaTw8MyldID0gKHIzICsgcjIpID4+IDE0OwotICAgICAgICAgICAgYmxrWzIrKGk8PDMpXSA9IChyMCArIHI0KSA+PiAxNDsKLSAgICAgICAgICAgIGJsa1szKyhpPDwzKV0gPSAocjggKyByNikgPj4gMTQ7Ci0gICAgICAgICAgICBibGtbNCsoaTw8MyldID0gKHI4IC0gcjYpID4+IDE0OwotICAgICAgICAgICAgYmxrWzUrKGk8PDMpXSA9IChyMCAtIHI0KSA+PiAxNDsKLSAgICAgICAgICAgIGJsa1s2KyhpPDwzKV0gPSAocjMgLSByMikgPj4gMTQ7Ci0gICAgICAgICAgICBibGtbNysoaTw8MyldID0gKHI3IC0gcjEpID4+IDE0OwotICAgICAgICB9Ci0gICAgICAgIC8qICBhZGQgd2l0aCBwcmVkaWN0aW9uICwgIDA4LzAzLzA1ICovCi0gICAgICAgIHJlcyA9ICgqcHJlZCsrICsgYmxvY2tbMCsoaTw8MyldKTsKLSAgICAgICAgQ0xJUF9SRVNVTFQocmVzKTsKLSAgICAgICAgKmRzdCsrID0gcmVzOwotICAgICAgICByZXMgPSAoKnByZWQrKyArIGJsb2NrWzErKGk8PDMpXSk7Ci0gICAgICAgIENMSVBfUkVTVUxUKHJlcyk7Ci0gICAgICAgICpkc3QrKyA9IHJlczsKLSAgICAgICAgcmVzID0gKCpwcmVkKysgKyBibG9ja1syKyhpPDwzKV0pOwotICAgICAgICBDTElQX1JFU1VMVChyZXMpOwotICAgICAgICAqZHN0KysgPSByZXM7Ci0gICAgICAgIHJlcyA9ICgqcHJlZCsrICsgYmxvY2tbMysoaTw8MyldKTsKLSAgICAgICAgQ0xJUF9SRVNVTFQocmVzKTsKLSAgICAgICAgKmRzdCsrID0gcmVzOwotICAgICAgICByZXMgPSAoKnByZWQrKyArIGJsb2NrWzQrKGk8PDMpXSk7Ci0gICAgICAgIENMSVBfUkVTVUxUKHJlcyk7Ci0gICAgICAgICpkc3QrKyA9IHJlczsKLSAgICAgICAgcmVzID0gKCpwcmVkKysgKyBibG9ja1s1KyhpPDwzKV0pOwotICAgICAgICBDTElQX1JFU1VMVChyZXMpOwotICAgICAgICAqZHN0KysgPSByZXM7Ci0gICAgICAgIHJlcyA9ICgqcHJlZCsrICsgYmxvY2tbNisoaTw8MyldKTsKLSAgICAgICAgQ0xJUF9SRVNVTFQocmVzKTsKLSAgICAgICAgKmRzdC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S0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tCi0gKi8KLSNpbmNsdWRlICJtcDRkZWYuaCIKLSNpbmNsdWRlICJpZGN0LmgiCi0jaW5jbHVkZSAibW90aW9uX2NvbXAuaCIKLQotI2lmZGVmIEZBU1RfSURDVAotCi0vKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgotKiAgICAgICB2Y2FfaWRjdC5jIDogY3JlYXRlZCA2LzEvOTkgZm9yIHNldmVyYWwgb3B0aW9ucwotKiAgICAgICAgICAgICAgICAgICAgIG9mIGhhcmQtY29kZWQgcmVkdWNlZCBpZGN0IGZ1bmN0aW9uICh1c2luZyBuel9jb2VmcykKLSoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLQotLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotLy9wcmV0ZXN0ZWQgdmVyc2lvbgotdm9pZCBpZGN0cm93MChpbnQxNiAqLCB1aW50OCAqLCB1aW50OCAqLCBpbnQpCi17Ci0gICAgcmV0dXJuIDsKLX0KLXZvaWQgaWRjdGNvbDAoaW50MTYgKikKLXsKLSAgICByZXR1cm4gOwotfQotCi12b2lkIGlkY3Ryb3cxKGludDE2ICpibGssIHVpbnQ4ICpwcmVkLCB1aW50OCAqZHN0LCBpbnQgd2lkdGgpCi17Ci0gICAgLyogc2hvcnRjdXQgKi8KLSAgICBpbnQgdG1wOwotICAgIGludCBpID0gODsKLSAgICB1aW50MzIgcHJlZF93b3JkLCBkc3Rfd29yZDsKLSAgICBpbnQgcmVzLCByZXMyOwotCi0gICAgLyogcHJlc2V0IHRoZSBvZmZzZXQsIHN1Y2ggdGhhdCB3ZSBjYW4gdGFrZSBhZHZhbnRhZ2UgcHJlLW9mZnNldCBhZGRyZXNzaW5nIG1vZGUgICAqLwotICAgIHdpZHRo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d2UgY2FuIHRha2UgYWR2YW50YWdlIHByZS1vZmZzZXQgYWRkcmVzc2luZyBtb2RlICAgKi8KLSAgICB3aWR0aCAtPSA0OwotICAgIGRzdCAtPSB3aWR0aDsKLSAgICBwcmVkIC09IDEyOwotICAgIGJsayAtPSA4OwotCi0gICAgd2hpbGUgKGktLSkKLSAgICB7Ci0gICAgICAgIC8qIHNob3J0Y3V0ICovCi0gICAgICAgIHg0ID0gYmxrWzldOwotICAgICAgICBibGtbOV0gPSAwOwotICAgICAgICB4MCA9ICgoKihibGsgKz0gOCkpIDw8IDgpICsgODE5MjsKLSAgICAgICAgKmJsayA9IDA7ICAvKiBmb3IgcHJvcGVyIHJvdW5kaW5nIGluIHRoZSBmb3VydGggc3RhZ2UgKi8KLQotICAgICAgICAvKiBmaXJzdCBzdGFnZSAqLwotICAgICAgICB4NSA9IChXNyAqIHg0ICsgNCkgPj4gMzsKLSAgICAgICAgeDQgPSAoVzEgKiB4NCArIDQpID4+IDM7Ci0KLSAgICAgICAgLyogdGhpcmQgc3RhZ2UgKi8KLSAgICAgICAgeDIgPSAoMTgxICogKHg0ICsgeDUpICsgMTI4KSA+PiA4OwotICAgICAgICB4MSA9ICgxODEgKiAoeDQgLSB4NSkgKyAxMjgpID4+IDg7Ci0KLSAgICAgICAgLyogZm91cnRoIHN0YWdlICovCi0gICAgICAgIHByZWRfd29yZCA9ICooKHVpbnQzMiopKHByZWQgKz0gMTIpKTsgLyogcmVhZCA0IGJ5dGVzIGZyb20gcHJlZCAqLwotICAgICAgICByZXMgPSAoeDAgKyB4NCkgPj4gMTQ7Ci0gICAgICAgIEFERF9BTkRfQ0xJUDEocmVzKTsKLSAgICAgICAgcmVzMiA9ICh4MCArIHgyKSA+PiAxNDsKLSAgICAgICAgQUREX0FORF9DTElQMihyZXMyKTsKLSAgICAgICAgZHN0X3dvcmQgPSAocmVzMiA8PCA4KSB8IHJlczsKLSAgICAgICAgcmVzID0gKHgwICsgeDEpID4+IDE0OwotICAgICAgIC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AgICB3aGlsZSAoaS0tKQotICAgIHsKLSAgICAgICAgeDIgPSBibGtbMTBdOwotICAgICAgICBibGtbMTBdID0gMDsKLSAgICAgICAgeDEgPSBibGtbOV07Ci0gICAgICAgIGJsa1s5XSA9IDA7Ci0gICAgICAgIHgwID0gKCgqKGJsayArPSA4KSkgPDwgOCkgKyA4MTkyOwotICAgICAgICAqYmxrID0gMDsgICAvKiBmb3IgcHJvcGVyIHJvdW5kaW5nIGluIHRoZSBmb3VydGggc3RhZ2UgKi8KLSAgICAgICAgLyogYm90aCB1cHBlciBhbmQgbG93ZXIqLwotICAgICAgICAvKiBib3RoIHgyb3J4NiBhbmQgeDBvcng0ICovCi0KLSAgICAgICAgeDQgPSB4MDsKLSAgICAgICAgeDYgPSAoVzYgKiB4MiArIDQpID4+IDM7Ci0gICAgICAgIHgyID0gKFcyICogeDIgKyA0KSA+PiAzOwotICAgICAgICB4OCA9IHgwIC0geDI7Ci0gICAgICAgIHgwICs9IHgyOwotICAgICAgICB4MiA9IHg4OwotICAgICAgICB4OCA9IHg0IC0geDY7Ci0gICAgICAgIHg0ICs9IHg2OwotICAgICAgICB4NiA9IHg4OwotCi0gICAgICAgIHg3ID0gKFc3ICogeDEgKyA0KSA+PiAzOwotICAgICAgICB4MSA9IChXMSAqIHgxICsgNCkgPj4gMzsKLSAgICAgICAgeDMgPSB4NzsKLSAgICAgICAgeDUgPSAoMTgxICogKHgxIC0geDcpICsgMTI4KSA+PiA4OwotICAgICAgICB4NyA9ICgxODEgKiAoeDEgKyB4NykgKyAxMjgpID4+IDg7Ci0KLSAgICAgICAgcHJlZF93b3JkID0gKigodWludDMyKikocHJlZCArPSAxMikpOyAvKiByZWFkIDQgYnl0ZXMgZnJvbSBwcmVkICovCi0gICAgICAgIHJlcyA9ICh4MCArIHgxKSA+PiAxNDsKLSAgICAgICAgQUREX0FORF9DTElQMShyZXMpOwotICAgICAgICByZXMyID0gKHg0ICsgeDcpID4+IDE0OwotICAgICAgICBBRERfQU5EX0NMSVAyKHJlczIpOwotICAgICAgICBkc3Rfd29yZCA9IChyZXMyIDw8IDgpIHwgcmVzOwotICAgICAgICByZXMgPSAoeDYgKyB4NSkgPj4gMTQ7Ci0gICAgICAgIEFERF9BTkRfQ0xJUDMocmVzKTsKLSAgICAgICAgZHN0X3dvcmQgfD0gKHJlcyA8PCAxNik7Ci0gICAgICAgIHJlcyA9ICh4MiArIHgzKSA+PiAxNDsKLSAgICAgICAgQUREX0FORF9DTElQNChyZXMpOwotICAgICAgICBkc3Rfd29yZCB8PSAocmVzIDw8IDI0KTsKLSAgICAgICAgKigodWludDMyKikoZHN0ICs9IHdpZHRoKSkgPSBkc3Rfd29yZDsgLyogc2F2ZSA0IGJ5dGVzIHRvIGRzdCAqLwotCi0gICAgICAgIHByZWRfd29yZCA9ICooKHVpbnQzMiopKHByZWQgKz0gNCkpOyAvKiByZWFkIDQgYnl0ZXMgZnJvbSBwcmVkICovCi0gICAgICAgIHJlcyA9ICh4MiAtIHgzKSA+PiAxNDsKLSAgICAgICAgQUREX0FORF9DTElQMShyZXMpOwotICAgICAgICByZXMyID0gKHg2IC0geDUpID4+IDE0OwotICAgICAgICBBRERfQU5EX0NMSVAyKHJlczIpOwotICAgICAgICBkc3Rfd29yZCA9IChyZXMyIDw8IDgpIHwgcmVzOwotICAgICAgICByZXMgPSAoeDQgLSB4NykgPj4gMTQ7Ci0gICAgICAgIEFERF9BTkRfQ0xJUDMocmVzKTsKLSAgICAgICAgZHN0X3dvcmQgfD0gKHJlcyA8PCAxNik7Ci0gICAgICAgIHJlcyA9ICh4MCAtIHgxKSA+PiAxNDsKLSAgICAgICAgQUREX0FORF9DTElQNChyZXMpOwotICAgICAgICBkc3Rfd29yZCB8PSAocmVzIDw8IDI0KTsKLSAgICAgICAgKigodWludDMyKikoZHN0ICs9IDQpKSA9IGRzdF93b3JkOyAvKiBzYXZlIDQgYnl0ZXMgdG8gZHN0ICovCi0gICAgfQotCi0gICAgcmV0dXJuIDsKLX0KLQotdm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LSAgICB1aW50MzIgcHJlZF93b3JkLCBkc3Rfd29yZDsKLSAgICBpbnQgcmVzLCByZXMyOwotCi0gICAgLyogcHJlc2V0IHRoZSBvZmZzZXQsIHN1Y2ggdGhhdCB3ZSBjYW4gdGFrZSBhZHZhbnRhZ2UgcHJlLW9mZnNldCBhZGRyZXNzaW5nIG1vZGUgICAqLwotICAgIHdpZHRoIC09IDQ7Ci0gICAgZHN0IC09IHdpZHRoOwotICAgIHByZWQgLT0gMTI7Ci0gICAgYmxrIC09IDg7Ci0KLSAgICB3aGlsZSAoaS0tKQotICAgIHsKLSAgICAgICAgeDIgPSBibGtbMTBdOwotICAgICAgICBibGtbMTBdID0gMDsKLSAgICAgICAgeDEgPSBibGtbOV07Ci0gICAgICAgIGJsa1s5XSA9IDA7Ci0gICAgICAgIHgzID0gYmxrWzExXTsKLSAgICAgICAgYmxrWzExXSA9IDA7Ci0gICAgICAgIHgwID0gKCgqKGJsayArPSA4KSkgPDwgOCkgKyA4MTkyOwotICAgICAgICAqYmxrID0gMDsgICAgLyogZm9yIHByb3BlciByb3VuZGluZyBpbiB0aGUgZm91cnRoIHN0YWdlICovCi0KLSAgICAgICAgeDQgPSB4MDsKLSAgICAgICAgeDYgPSAoVzYgKiB4MiArIDQpID4+IDM7Ci0gICAgICAgIHgyID0gKFcyICogeDIgKyA0KSA+PiAzOwotICAgICAgICB4OCA9IHgwIC0geDI7Ci0gICAgICAgIHgwICs9IHgyOwotICAgICAgICB4MiA9IHg4OwotICAgICAgICB4OCA9IHg0IC0geDY7Ci0gICAgICAgIHg0ICs9IHg2OwotICAgICAgICB4NiA9IHg4OwotCi0gICAgICAgIHg3ID0gKFc3ICogeDEgKyA0KSA+PiAzOwotICAgICAgICB4MSA9IChXMSAqIHgxICsgNCkgPj4gMzsKLSAgICAgICAgeDUgPSAoVzMgKiB4MyArIDQpID4+IDM7Ci0gICAgICAgIHgzID0gKC0gVzUgKiB4MyArIDQpID4+IDM7Ci0gICAgICAgIHg4ID0ge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Ci0gICAgeDMgKz0geDc7Ci0gICAgeDcgPSAoMTgxICogKHg1ICsgeDgpICsgMTI4KSA+PiA4OwotICAgIHg1ID0gKDE4MSAqICh4NSAtIHg4KSArIDEyOCkgPj4gODsKLQotCi0gICAgYmxrWzBdID0gKHgwICsgeDEpID4+IDg7Ci0gICAgYmxrWzhdID0gKHg0ICsgeDcpID4+IDg7Ci0gICAgYmxrWzE2XSA9ICh4NiArIHg1KSA+PiA4OwotICAgIGJsa1syNF0gPSAoeDIgKyB4MykgPj4gODsKLSAgICBibGtbNTZdID0gKHgwIC0geDEpID4+IDg7Ci0gICAgYmxrWzQ4XSA9ICh4NCAtIHg3KSA+PiA4OwotICAgIGJsa1s0MF0gPSAoeDYgLSB4NSkgPj4gODsKLSAgICBibGtbMzJdID0gKHgyIC0geDMpID4+IDg7Ci0KLSAgICByZXR1cm4gOwotfQotCi12b2lkIGlkY3Ryb3cwX2ludHJhKGludDE2ICosIFBJWEVMICosIGludCkKLXsKLSAgICByZXR1cm4gOwotfQotCi12b2lkIGlkY3Ryb3cxX2ludHJhKGludDE2ICpibGssIFBJWEVMICpjb21wLCBpbnQgd2lkdGgpCi17Ci0gICAgLyogc2hvcnRjdXQgKi8KLSAgICBpbnQzMiB0bXA7Ci0gICAgaW50IGkgPSA4OwotICAgIGludCBvZmZzZXQgPSB3aWR0aDsKLSAgICB1aW50MzIgd29yZDsKLQotICAgIGNvbXAgLT0gb2Zmc2V0OwotICAgIHdoaWxlIChpLS0pCi0gICAgewotICAgICAgICB0bXAgPSAoKGJsa1swXSArIDMyKSA+PiA2KTsKLSAgICAgICAgYmxrWzBdID0gMDsKLSAgICAgICAgQ0xJUF9SRVNVTFQodG1wKQotCi0gICAgICAgIHdvcmQgPSAodG1wIDw8IDgpIHwgdG1wOwotICAgICAgICB3b3JkID0gKHdvcmQgPDwgMTYpIHwgd29yZDsKLQotICAgICAgICAqKCh1aW50MzIqKShjb21wICs9IG9mZnNldCkpID0gd29yZDsKLSAgICAgICAgKigodWludDMyKikoY29tcCArIDQpKSA9IHdvcmQ7Ci0KLQotCi0KLSAgICAgICAgYmxrICs9IEJfU0laRTsKLSAgICB9Ci0gICAgcmV0dXJuOwotfQotCi12b2lkIGlkY3Ryb3cyX2ludHJhKGludDE2ICpibGssIFBJWEVMICpjb21wLCBpbnQgd2lkdGgpCi17Ci0gICAgaW50MzIgeDAsIHgxLCB4MiwgeDQsIHg1LCB0ZW1wOwotICAgIGludCBpID0gODsKLSAgICBpbnQgb2Zmc2V0ID0gd2lkdGg7Ci0gICAgaW50MzIgd29yZDsKLQotICAgIGNvbXAgLT0gb2Zmc2V0OwotICAgIHdoaWxlIChpLS0pCi0gICAgewotICAgICAgICAvKiBzaG9ydGN1dCAqLwotICAgICAgICB4NCA9IGJsa1sxXTsKLSAgICAgICAgYmxrWzFdID0gMDsKLSAgICAgICAgeDAgPSAoKGludDMyKWJsa1swXSA8PCA4KSArIDgxOTI7Ci0gICAgICAgIGJsa1swXSA9IDA7ICAgLyogZm9yIHByb3BlciByb3VuZGluZyBpbiB0aGUgZm91cnRoIHN0YWdlICovCi0KLSAgICAgICAgLyogZmlyc3Qgc3RhZ2UgKi8KLSAgICAgICAgeDUgPSAoVzcgKiB4NCArIDQpID4+IDM7Ci0gICAgICAgIHg0ID0gKFcxICogeDQgKyA0KSA+PiAzOwotCi0gICAgICAgIC8qIHRoaXJkIHN0YWdlICovCi0gICAgICAgIHgyID0gKDE4MSAqICh4NCArIHg1KSArIDEyOCkgPj4gODsKLSAgICAgICAgeDEgPSAoMTgxICogKHg0IC0geDUpICsgMTI4KSA+PiA4OwotCi0gICAgICAgIC8qIGZvdXJ0aCBzdGFnZSAqLwotICAgICAgICB3b3JkID0gKCh4MCArIHg0KSA+PiAxNCk7Ci0gICAgICAgIENMSVBfUkVTVUxUKHdvcmQpCi0KLSAgICAgICAgdGVtcCA9ICgoeDAgKyB4MikgPj4gMTQpOwotICAgICAgICBDTElQX1JFU1VMVCh0ZW1wKQotICAgICAgICB3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OwotICAgIGludCBpID0gODsKLSAgICBpbnQgb2Zmc2V0ID0gd2lkdGg7Ci0gICAgaW50MzIgd29yZDsKLQotICAgIGNvbXAgLT0gb2Zmc2V0OwotCi0gICAgd2hpbGUgKGktLSkKLSAgICB7Ci0gICAgICAgIHgyID0gYmxrWzJdOwotICAgICAgICBibGtbMl0gPSAwOwotICAgICAgICB4MSA9IGJsa1sxXTsKLSAgICAgICAgYmxrWzFdID0gMDsKLSAgICAgICAgeDAgPSAoKGludDMyKWJsa1swXSA8PCA4KSArIDgxOTI7Ci0gICAgICAgIGJsa1swXSA9IDA7LyogZm9yIHByb3BlciByb3VuZGluZyBpbiB0aGUgZm91cnRoIHN0YWdlICovCi0gICAgICAgIC8qIGJvdGggdXBwZXIgYW5kIGxvd2VyKi8KLSAgICAgICAgLyogYm90aCB4Mm9yeDYgYW5kIHgwb3J4NCAqLwotCi0gICAgICAgIHg0ID0geDA7Ci0gICAgICAgIHg2ID0gKFc2ICogeDIgKyA0KSA+PiAzOwotICAgICAgICB4MiA9IChXMiAqIHgyICsgNCkgPj4gMzsKLSAgICAgICAgeDggPSB4MCAtIHgyOwotICAgICAgICB4MCArPSB4MjsKLSAgICAgICAgeDIgPSB4ODsKLSAgICAgICAgeDggPSB4NCAtIHg2OwotICAgICAgICB4NCArPSB4NjsKLSAgICAgICAgeDYgPSB4ODsKLQotICAgICAgICB4NyA9IChXNyAqIHgxICsgNCkgPj4gMzsKLSAgICAgICAgeDEgPSAoVzEgKiB4MSArIDQpID4+IDM7Ci0gICAgICAgIHgzID0geDc7Ci0gICAgICAgIHg1ID0gKDE4MSAqICh4MSAtIHg3KSArIDEyOCkgPj4gODsKLSAgICAgICAgeDcgPSAoMTgxICogKHgxICsgeDcpICsgMTI4KSA+PiA4OwotCi0gICAgICAgIHdvcmQgPSAoKHgwICsgeDEpID4+IDE0KTsKLSAgICAgICAgQ0xJUF9SRVNVTFQod29yZCkKLSAgICAgICAgdGVtcCA9ICgoeDQgKyB4NykgPj4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ICBpbnQzMiB4MCwgeDEsIHgyLCB4MywgeDQsIHg1LCB4NiwgeDcsIHg4LCB0ZW1wOwotICAgIGludCBpID0gODsKLSAgICBpbnQgb2Zmc2V0ID0gd2lkdGg7Ci0gICAgaW50MzIgd29yZDsKLQotICAgIGNvbXAgLT0gb2Zmc2V0OwotCi0gICAgd2hpbGUgKGktLSkKLSAgICB7Ci0gICAgICAgIHgyID0gYmxrWzJdOwotICAgICAgICBibGtbMl0gPSAwOwotICAgICAgICB4MSA9IGJsa1sxXTsKLSAgICAgICAgYmxrWzFdID0gMDsKLSAgICAgICAgeDMgPSBibGtbM107Ci0gICAgICAgIGJsa1szXSA9IDA7Ci0gICAgICAgIHgwID0gKChpbnQzMilibGtbMF0gPDwgOCkgKyA4MTkyOwotICAgICAgICBibGtbMF0gPSAwOy8qIGZvciBwcm9wZXIgcm91bmRpbmcgaW4gdGhlIGZvdXJ0aCBzdGFnZSAqLwotCi0gICAgICAgIHg0ID0geDA7Ci0gICAgICAgIHg2ID0gKFc2ICogeDIgKyA0KSA+PiAzOwotICAgICAgICB4MiA9IChXMiAqIHgyICsgNCkgPj4gMzsKLSAgICAgICAgeDggPSB4MCAtIHgyOwotICAgICAgICB4MCArPSB4MjsKLSAgICAgICAgeDIgPSB4ODsKLSAgICAgICAgeDggPSB4NCAtIHg2OwotICAgICAgICB4NCArPSB4NjsKLSAgICAgICAgeDYgPSB4ODsKLQotICAgICAgICB4NyA9IChXNyAqIHgxICsgNCkgPj4gMzsKLSAgICAgICAgeDEgPSAoVzEgKiB4MSArIDQpID4+IDM7Ci0gICAgICAgIHg1ID0gKFczICogeDMgKyA0KSA+PiAzOwotICAgICAgICB4MyA9ICgtIFc1ICogeDMgKyA0KSA+PiAzOwotICAgICAgICB4OCA9IHgxIC0geDU7Ci0gICAgICAgIHgxICs9IHg1OwotICAgICAgICB4NSA9IHg4OwotICAgICAgICB4OCA9IHg3IC0geDM7Ci0gICAgICAgIHgzICs9IHg3OwotICAgICAgICB4NyA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ICAgICAgZHggPSBweFswXSA9IHB4WzFdID0gcHhbMl0gPSBweFszXSA9IHZpZGVvLT5tb3RYW2ltdl07Ci0gICAgICAgIGR5ID0gcHlbMF0gPSBweVsxXSA9IHB5WzJdID0gcHlbM10gPSB2aWRlby0+bW90WVtpbXZdOwotICAgICAgICBpZiAoKGR4ICYgMykgPT0gMCkKLSAgICAgICAgewotICAgICAgICAgICAgZHggPSBkeCA+PiAxOwotICAgICAgICB9Ci0gICAgICAgIGVsc2UKLSAgICAgICAgewotICAgICAgICAgICAgLyogeCBjb21wb25lbnQgb2YgTVYgaXMgb3InZWQgZm9yIHJvdW5kaW5nICg/KSAqLwotICAgICAgICAgICAgZHggPSAoZHggPj4gMSkgfCAxOwotICAgICAgICB9Ci0KLSAgICAgICAgLyogeSBjb21wb25lbnQgb2YgbW90aW9uIHZlY3RvcjsgZGl2aWRlIGJ5IDIgZm9yIHRvICovCi0gICAgICAgIC8qIGNvbnZlcnQgdG8gZnVsbC1wZWwgcmVzb2x1dGlvbi4gICAgICAgICAgICAgICAgICAqLwotICAgICAgICBpZiAoKGR5ICYgMykgPT0gMCkKLSAgICAgICAgewotICAgICAgICAgICAgZHkgPSBkeSA+PiAxOwotICAgICAgICB9Ci0gICAgICAgIGVsc2UKLSAgICAgICAgewotICAgICAgICAgICAgLyogeSBjb21wb25lbnQgb2YgTVYgaXMgb3InZWQgZm9yIHJvdW5kaW5nICg/KSAqLwotICAgICAgICAgICAgZHkgPSAoZHkgPj4gMSkgfCAxOwotICAgICAgICB9Ci0gICAgfQotICAgIGVsc2UKLSAgICB7Ci0gICAgICAgIHB4WzBdID0gdmlkZW8tPm1vdFhbaW12XTsKLSAgICAgICAgcHhbMV0gPSB2aWRlby0+bW90WFtpbXYrMV07Ci0gICAgICAgIHB4WzJdID0gdmlkZW8tPm1vdFhbaW12K212d2lkdGhdOwotICAgICAgICBweFszXSA9IHZpZGVvLT5tb3RYW2ltdittdndpZHRoKzFdOwotICAgICAgICB4c3VtID0gcH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wZXJmb3JtcyBsdW1pbmFuY2UgcHJlZGljdGlvbiAqLwotICAgIC8qICAgICAgbHVtaW5hbmNlX3ByZWRfbW9kZV9pbnRlcjR2KHhwb3MsIHlwb3MsIHB4LCBweSwgY19wcmV2LAotICAgICAgICAgICAgICAgICAgICB2aWRlby0+bWJsb2NrLT5wcmVkX2Jsb2NrLCB3aWR0aCwgaGVpZ2h0LAotICAgICAgICAgICAgICAgICAgICByb3VuZDEsIG12d2lkdGgsICZ4c3VtLCAmeXN1bSk7Ki8KLSAgICBjX2NvbXAgPSB2aWRlby0+Y3VyclZvcC0+eUNoYW4gKyBvZmZzZXQ7Ci0KLQotICAgIHhwcmVkID0gKGludCkoKHhwb3MgPDwgMSkgKyBweFswXSk7Ci0gICAgeXByZWQgPSAoaW50KSgoeXBvcyA8PCAxKSArIHB5WzBdKTsKLQotICAgIGlmICgoQ0JQID4+IDUpJjEpCi0gICAgewotICAgICAgICBwcmVkID0gcHJlZF9ibG9jazsKLSAgICAgICAgcHJlZF93aWR0aCA9IDE2OwotICAgIH0KLSAgICBlbHNlCi0gICAgewotICAgICAgICBwcmVkID0gY19jb21wOwotICAgICAgICBwcmVkX3dpZHRoID0gd2lkdGg7Ci0gICAgfQotCi0gICAgLyogY2hlY2sgd2hldGhlciB0aGUgTVYgcG9pbnRzIG91dHNpZGUgdGhlIGZyYW1lICovCi0gICAgaWYgKHhwcmVkID49IDAgJiYgeHByZWQgPD0gKCh3aWR0aCA8PCAxKSAtICgyKkJfU0laRSkpICYmCi0gICAgICAgICAgICB5cHJlZCA+PSAwICYmIHlwcmVkIDw9ICgoaGVpZ2h0IDw8IDEpIC0gKDIqQl9TSVpFKSkpCi0gICAgeyAgIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLSAgICAgICAgLyogKHgseSkgaXMgaW5zaWRlIHRoZSBmcmFtZSAqLwotICAgICAgICAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0gICAgICAgIDsKLSAgICAgICAgR2V0UHJlZEFkdkJUYWJsZVt5cHJlZCYxXVt4cHJlZCYxXShjX3ByZXYgKyAoeHByZWQgPj4gMSkgKyAoKHlwcmVkID4+IDEpKndpZHRoKSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwcmVkLCB3aWR0aCwgKHByZWRfd2lkdGggPDwgMSkgfCByb3VuZDEpOwotICAgIH0KLSAgICBlbHNlCi0gICAgeyAgIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0gICAgICAgIC8qICh4LHkpIGlzIG91dHNpZGUgdGhlIGZyYW1lICovCi0gICAgICAgIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0gICAgICAgIEdldFByZWRPdXRzaWRlKHhwcmVkLCB5cHJlZCwgY19wcmV2LAotICAgICAgICAgICAgICAgICAgICAgICBwcmVkLCB3aWR0aCwgaGVpZ2h0LCByb3VuZDEsIHByZWRfd2lkdGgpOwotICAgIH0KLQotCi0gICAgLyogQ29tcHV0ZSBwcmVkaWN0aW9uIHZhbHVlcyBvdmVyIGN1cnJlbnQgbHVtaW5hbmNlIE1CICovCi0gICAgLyogKGJsb2NrcyAxKTsgYWRkIG1vdGlvbiB2ZWN0b3IgcHJpb3IgdG8gaW5wdXQ7ICAgICAgICovCi0gICAgLyogYWRkIDggdG8geF9wb3MgdG8gYWR2YW5jZSB0byBuZXh0IGJsb2NrICAgICAgICAgKi8KLSAgICB4cHJlZCA9IChpbnQpKCgoeHBvcyArIEJfU0laRSkgPDwgMSkgKyBweFsxXSk7Ci0gICAgeXByZWQgPSAoaW50KSgoeXBvcyA8PCAxKSArIHB5WzFdKTsKLQotICAgIGlmICgoQ0JQID4+IDQpJjEpCi0gICAgewotICAgICAgICBwcmVkID0gcHJlZF9ibG9jayArIDg7Ci0gICAgICAgIHByZWRfd2lkdGggPSAxNjsKLSAgICB9Ci0gICAgZWxzZQotICAgIHsKLSAgICAgICAgcHJlZCA9IGNfY29tcCArIDg7Ci0gICAgICAgIHByZWRfd2lkdGggPSB3aWR0aDsKLSAgICB9Ci0KLSAgICAvKiBjaGVjayB3aGV0aGVyIHRoZSBNViBwb2ludHMgb3V0c2lkZSB0aGUgZnJhbWUgKi8KLSAgICBpZiAoeHByZWQgPj0gMCAmJiB4cHJlZCA8PSAoKHdpZHRoIDw8IDEpIC0gKDIqQl9TSVpFKSkgJiYKLSAgICAgICAgICAgIHlwcmVkID49IDAgJiYgeXByZWQgPD0gKChoZWlnaHQgPDwgMSkgLSAoMipCX1NJWkUpKSkKLSAgICB7ICAgLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotICAgICAgICAvKiAoeCx5KSBpcyBpbnNpZGUgdGhlIGZyYW1lICovCi0gICAgICAgIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLSAgICAgICAgR2V0UHJlZEFkdkJUYWJsZVt5cHJlZCYxXVt4cHJlZCYxXShjX3ByZXYgKyAoeHByZWQgPj4gMSkgKyAoKHlwcmVkID4+IDEpKndpZHRoKSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwcmVkLCB3aWR0aCwgKHByZWRfd2lkdGggPDwgMSkgfCByb3VuZDEpOwotICAgIH0KLSAgICBlbHNlCi0gICAgeyAgIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0gICAgICAgIC8qICh4LHkpIGlzIG91dHNpZGUgdGhlIGZyYW1lICovCi0gICAgICAgIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0gICAgICAgIEdldFByZWRPdXRzaWRlKHhwcmVkLCB5cHJlZCwgY19wcmV2LAotICAgICAgICAgICAgICAgICAgICAgICBwcmVkLCB3aWR0aCwgaGVpZ2h0LCByb3VuZDEsIHByZWRfd2lkdGgpOwotICAgIH0KLQotCi0KLSAgICAvKiBDb21wdXRlIHByZWRpY3Rpb24gdmFsdWVzIG92ZXIgY3VycmVudCBsdW1pbmFuY2UgTUIgKi8KLSAgICAvKiAoYmxvY2tzIDIpOyBhZGQgbW90aW9uIHZlY3RvciBwcmlvciB0byBpbnB1dCAgICAgICAgKi8KLSAgICAvKiBhZGQgOCB0byB5X3BvcyB0byBhZHZhbmNlIHRvIGJsb2NrIG9uIG5leHQgcm93ICAgICAgKi8KLSAgICB4cHJlZCA9IChpbnQpKCh4cG9zIDw8IDEpICsgcHhbMl0pOwotICAgIHlwcmVkID0gKGludCkoKCh5cG9zICsgQl9TSVpFKSA8PCAxKSArIHB5WzJdKTsKLQotICAgIGlmICgoQ0JQID4+IDMpJjEpCi0gICAgewotICAgICAgICBwcmVkID0gcHJlZF9ibG9jayArIDEyODsKLSAgICAgICAgcHJlZF93aWR0aCA9IDE2OwotICAgIH0KLSAgICBlbHNlCi0gICAgewotICAgICAgICBwcmVkID0gY19jb21wICsgKHdpZHRoIDw8IDMpOwotICAgICAgICBwcmVkX3dpZHRoID0gd2lkdGg7Ci0gICAgfQotCi0gICAgLyogY2hlY2sgd2hldGhlciB0aGUgTVYgcG9pbnRzIG91dHNpZGUgdGhlIGZyYW1lICovCi0gICAgaWYgKHhwcmVkID49IDAgJiYgeHByZWQgPD0gKCh3aWR0aCA8PCAxKSAtICgyKkJfU0laRSkpICYmCi0gICAgICAgICAgICB5cHJlZCA+PSAwICYmIHlwcmVkIDw9ICgoaGVpZ2h0IDw8IDEpIC0gKDIqQl9TSVpFKSkpCi0gICAgeyAgIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLSAgICAgICAgLyogKHgseSkgaXMgaW5zaWRlIHRoZSBmcmFtZSAqLwotICAgICAgICAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0gICAgICAgIEdldFByZWRBZHZCVGFibGVbeXByZWQmMV1beHByZWQmMV0oY19wcmV2ICsgKHhwcmVkID4+IDEpICsgKCh5cHJlZCA+PiAxKSp3aWR0aCksCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcHJlZCwgd2lkdGgsIChwcmVkX3dpZHRoIDw8IDEpIHwgcm91bmQxKTsKLSAgICB9Ci0gICAgZWxzZQotICAgIHsgICAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotICAgICAgICAvKiAoeCx5KSBpcyBvdXRzaWRlIHRoZSBmcmFtZSAqLwotICAgICAgICAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotICAgICAgICBHZXRQcmVkT3V0c2lkZSh4cHJlZCwgeXByZWQsIGNfcHJldiwKLSAgICAgICAgICAgICAgICAgICAgICAgcHJlZCwgd2lkdGgsIGhlaWdodCwgcm91bmQxLCBwcmVkX3dpZHRoKTsKLSAgICB9Ci0KLQotCi0gICAgLyogQ29tcHV0ZSBwcmVkaWN0aW9uIHZhbHVlcyBvdmVyIGN1cnJlbnQgbHVtaW5hbmNlIE1CICovCi0gICAgLyogKGJsb2NrcyAzKTsgYWRkIG1vdGlvbiB2ZWN0b3IgcHJpb3IgdG8gaW5wdXQ7ICAgICAgICovCi0gICAgLyogYWRkIDggdG8geF9wb3MgYW5kIHlfcG9zIHRvIGFkdmFuY2UgdG8gbmV4dCBibG9jayAgICovCi0gICAgLyogb24gbmV4dCByb3cgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLSAgICB4cHJlZCA9IChpbnQpKCgoeHBvcyArIEJfU0laRSkgPDwgMSkgKyBweFszXSk7Ci0gICAgeXByZWQgPSAoaW50KSgoKHlwb3MgKyBCX1NJWkUpIDw8IDEpICsgcHlbM10pOwotCi0gICAgaWYgKChDQlAgPj4gMikmMSkKLSAgICB7Ci0gICAgICAgIHByZWQgPSBwcmVkX2Jsb2NrICsgMTM2OwotICAgICAgICBwcmVkX3dpZHRoID0gMTY7Ci0gICAgfQotICAgIGVsc2UKLSAgICB7Ci0gICAgICAgIHByZWQgPSBjX2NvbXAgKyAod2lkdGggPDwgMykgKyA4OwotICAgICAgICBwcmVkX3dpZHRoID0gd2lkdGg7Ci0gICAgfQotCi0gICAgLyogY2hlY2sgd2hldGhlciB0aGUgTVYgcG9pbnRzIG91dHNpZGUgdGhlIGZyYW1lICovCi0gICAgaWYgKHhwcmVkID49IDAgJiYgeHByZWQgPD0gKCh3aWR0aCA8PCAxKSAtICgyKkJfU0laRSkpICYmCi0gICAgICAgICAgICB5cHJlZCA+PSAwICYmIHlwcmVkIDw9ICgoaGVpZ2h0IDw8IDEpIC0gKDIqQl9TSVpFKSkpCi0gICAgeyAgIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLSAgICAgICAgLyogKHgseSkgaXMgaW5zaWRlIHRoZSBmcmFtZSAqLwotICAgICAgICAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0gICAgICAgIEdldFByZWRBZHZCVGFibGVbeXByZWQmMV1beHByZWQmMV0oY19wcmV2ICsgKHhwcmVkID4+IDEpICsgKCh5cHJlZCA+PiAxKSp3aWR0aCksCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcHJlZCwgd2lkdGgsIChwcmVkX3dpZHRoIDw8IDEpIHwgcm91bmQxKTsKLSAgICB9Ci0gICAgZWxzZQotICAgIHsgICAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotICAgICAgICAvKiAoeCx5KSBpcyBvdXRzaWRlIHRoZSBmcmFtZSAqLwotICAgICAgICAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotICAgICAgICBHZXRQcmVkT3V0c2lkZSh4cHJlZCwgeXByZWQsIGNfcHJldiwKLSAgICAgICAgICAgICAgICAgICAgICAgcHJlZCwgd2lkdGgsIGhlaWdodCwgcm91bmQxLCBwcmVkX3dpZHRoKTsKLSAgICB9Ci0gICAgLyogQ2FsbCBmdW5jdGlvbiB0byBzZXQgZGUtYmxvY2tpbmcgYW5kIGRlLXJpbmdpbmcgKi8KLSAgICAvKiAgIHNlbWFwaG9yZXMgZm9yIGx1bWluYW5jZSAgICAgICAgICAgICAgICAgICAgICAqLwotCi0jaWZkZWYgUFZfUE9TVFBST0NfT04KLSAgICBpZiAodmlkZW8tPnBvc3RGaWx0ZXJUeXBlICE9IFBWX05PX1BPU1RfUFJPQykKLSAgICB7Ci0gICAgICAgIGlmIChtb2RlJklOVEVSXzFWTUFTSykKLSAgICAgICAgewotICAgICAgICAgICAgcHBfZGVjX3kgPSB2aWRlby0+cHN0cHJjVHlwQ3VyICsgaW12OwotICAgICAgICAgICAgbGxbMF0gPSAxOwotICAgICAgICAgICAgbGxbMV0gPSBtdndpZHRoIC0gMTsKLSAgICAgICAgICAgIGxsWzJdID0gMTsKLSAgICAgICAgICAgIGxsWzNdID0gLW12d2lkdGggLSAxOwotICAgICAgICAgICAgbXNrX2RlYmxvY2sgPSBwcF9zZW1hcGhvcmVfbHVtYSh4cHJlZCwgeXByZWQsIHBwX2RlY195LAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2aWRlby0+cHN0cHJjVHlwUHJ2LCBsbCwgJnRtcCwgcHhbMF0sIHB5WzBdLCBtdndpZHRoLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB3aWR0aCwgaGVpZ2h0KTsKLQotICAgICAgICAgICAgcHBfZGVjX3UgPSB2aWRlby0+cHN0cHJjVHlwQ3VyICsgKHNpemUgPj4gNikgKwotICAgICAgICAgICAgICAgICAgICAgICAoKGltdiArICh4cG9zID4+IDMpKSA+PiAyKTsKLQotICAgICAgICAgICAgcHBfc2VtYXBob3JlX2Nocm9tYV9pbnRlcih4cHJlZCwgeXByZWQsIHBwX2RlY191LAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2aWRlby0+cHN0cHJjVHlwUHJ2LCBkeCwgZHksIG12d2lkdGgsIGhlaWdodCwgc2l6ZSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdG1wLCBtc2tfZGVibG9jayk7Ci0gICAgICAgIH0KLSAgICAgICAgZWxzZQotICAgICAgICB7Ci0gICAgICAgICAgICAvKiBQb3N0LXByb2Nlc3NpbmcgbW9kZSAoTUJNX0lOVEVSOCkgKi8KLSAgICAgICAgICAgIC8qIGRlYmxvY2tpbmcgYW5kIGRlcmluZ2luZykgKi8KLSAgICAgICAgICAgIHBwX2RlY195ID0gdmlkZW8tPnBzdHByY1R5cEN1ciArIGltdjsKLSAgICAgICAgICAgICpwcF9kZWNfeSA9IDQ7Ci0gICAgICAgICAgICAqKHBwX2RlY195ICsgMSkgPSA0OwotICAgICAgICAgICAgKihwcF9kZWNfeSArIG12d2lkdGgpID0gNDsKLSAgICAgICAgICAgICoocHBfZGVjX3kgKyBtdndpZHRoICsgMSkgPSA0OwotICAgICAgICAgICAgcHBfZGVjX3UgPSB2aWRlby0+cHN0cHJjVHlwQ3VyICsgKHNpemUgPj4gNikgKwotICAgICAgICAgICAgICAgICAgICAgICAoKGltdiArICh4cG9zID4+IDMpKSA+PiAyKTsKLSAgICAgICAgICAgICpwcF9kZWNfdSA9IDQ7Ci0gICAgICAgICAgICBwcF9kZWNfdVtzaXplPj44XSA9IDQ7Ci0gICAgICAgIH0KLSAgICB9Ci0jZW5kaWYKLQotCi0gICAgLyogeHByZWQgYW5kIHlwcmVkIGNhbGN1bGF0aW9uIGZvciBDaHJvbWluYW5jZSBpcyAqLwotICAgIC8qIGluIGZ1bGwtcGVsIHJlc29sdXRpb24uICAgICAgICAgICAgICAgICAgICAgICAgKi8KLQotICAgIC8qIENocm9taW5hbmNlICovCi0gICAgLyogd2lkdGggb2YgY2hyb21pbmFuY2UgZGF0YSBpbiBwaXhlbHMgKHkgYXhpcykgKi8KLSAgICB3aWR0aCA+Pj0gMTsKLQotICAgIC8qIGhlaWd0aCBvZiBjaHJvbWluYW5jZSBkYXRhIGluIHBpeGVscyAoeCBheGlzKSAqLwotICAgIGhlaWdodCA+Pj0gMTsKLQotICAgIC8qIFBvaW50ZXIgdG8gcHJldmlvdXMgY2hyb21pbmFuY2UgYiBmcmFtZSAqLwotICAgIGN1X3ByZXYgPSBwcmV2LT51Q2hhb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gICAgICAgcm91bmQxKTsqLwotICAgIGlmICh4cHJlZCA+PSAwICYmIHhwcmVkIDw9ICgod2lkdGggPDwgMSkgLSAoMipCX1NJWkUpKSAmJiB5cHJlZCA+PSAwICYmCi0gICAgICAgICAgICB5cHJlZCA8PSAoKGhlaWdodCA8PCAxKSAtICgyKkJfU0laRSkpKQotICAgIHsKLSAgICAgICAgLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotICAgICAgICAvKiAoeCx5KSBpcyBpbnNpZGUgdGhlIGZyYW1lICovCi0gICAgICAgIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLSAgICAgICAgaWYgKChDQlAgPj4gMSkmMSkKLSAgICAgICAgewotICAgICAgICAgICAgcHJlZCA9IHByZWRfYmxvY2sgKyAyNTY7Ci0gICAgICAgICAgICBwcmVkX3dpZHRoID0gMTY7Ci0gICAgICAgIH0KLSAgICAgICAgZWxzZQotICAgICAgICB7Ci0gICAgICAgICAgICBwcmVkID0gY3VfY29tcDsKLSAgICAgICAgICAgIHByZWRfd2lkdGggPSB3aWR0aDsKLSAgICAgICAgfQotCi0gICAgICAgIC8qIENvbXB1dGUgcHJlZGljdGlvbiBmb3IgQ2hyb21pbmFuY2UgYiAoYmxvY2tbNF0pICovCi0gICAgICAgIEdldFByZWRBZHZCVGFibGVbeXByZWQmMV1beHByZWQmMV0oY3VfcHJldiArICh4cHJlZCA+PiAxKSArICgoeXByZWQgPj4gMSkqd2lkdGgpLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHByZWQsIHdpZHRoLCAocHJlZF93aWR0aCA8PCAxKSB8IHJvdW5kMSk7Ci0KLSAgICAgICAgaWYgKENCUCYxKQotICAgICAgICB7Ci0gICAgICAgICAgICBwcmVkID0gcHJlZF9ibG9jayArIDI2NDsKLSAgICAgICAgICAgIHByZWRfd2lkdGggPSAxNjsKLSAgICAgICAgfQotICAgICAgICBlbHNlCi0gICAgICAgIHsKLSAgICAgICAgICAgIHByZWQgPSBjdl9jb21wOwotICAgICAgICAgICAgcHJlZF93aWR0aCA9IHdpZHRoOwotICAgICAgICB9Ci0gICAgICAgIC8qIENvbXB1dGUgcHJlZGljdGlvbiBmb3IgQ2hyb21pbmFuY2UgciAoYmxvY2tbNV0pICovCi0gICAgICAgIEdldFByZWRBZHZCVGFibGVbeXByZWQmMV1beHByZWQmMV0oY3ZfcHJldiArICh4cHJlZCA+PiAxKSArICgoeXByZWQgPj4gMSkqd2lkdGgpLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHByZWQsIHdpZHRoLCAocHJlZF93aWR0aCA8PCAxKSB8IHJvdW5kMSk7Ci0KLSAgICAgICAgcmV0dXJuIDsKLSAgICB9Ci0gICAgZWxzZQotICAgIHsKLSAgICAgICAgLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLSAgICAgICAgLyogKHgseSkgaXMgb3V0c2lkZSB0aGUgZnJhbWUgKi8KLSAgICAgICAgLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLSAgICAgICAgaWYgKChDQlAgPj4gMSkmMSkKLSAgICAgICAgewotICAgICAgICAgICAgcHJlZCA9IHByZWRfYmxvY2sgKyAyNTY7Ci0gICAgICAgICAgICBwcmVkX3dpZHRoID0gMTY7Ci0gICAgICAgIH0KLSAgICAgICAgZWxzZQotICAgICAgICB7Ci0gICAgICAgICAgICBwcmVkID0gY3VfY29tcDsKLSAgICAgICAgICAgIHByZWRfd2lkdGggPSB3aWR0aDsKLSAgICAgICAgfQotCi0gICAgICAgIC8qIENvbXB1dGUgcHJlZGljdGlvbiBmb3IgQ2hyb21pbmFuY2UgYiAoYmxvY2tbNF0pICovCi0gICAgICAgIEdldFByZWRPdXRzaWRlKHhwcmVkLCB5cHJlZCwgICAgY3VfcHJldiwKLSAgICAgICAgICAgICAgICAgICAgICAgcHJlZCwgd2lkdGgsIGhlaWdodCwgcm91bmQxLCBwcmVkX3dpZHRoKTsKL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Z1bmN0aW9uIDogUHV0U0tJUFBFRF9NQigpCi0gICAgRGF0ZSAgICAgOiAwNC8wMy8yMDAwCi0vID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0gKi8KLQotdm9pZCBQdXRTS0lQUEVEX01CKHVpbnQ4ICpjb21wLCB1aW50OCAqcHJldiwgaW50IHdpZHRoKQotewotICAgIGludDMyICp0ZW1wMCwgKnRlbXAxOwotICAgIGludCAgcm93OwotICAgIHJvdyA9IE1CX1NJWkU7Ci0KLQotICAgIHdoaWxlIChyb3cpCi0gICAgewotICAgICAgICB0ZW1wMCA9IChpbnQzMiAqKXByZXY7Ci0gICAgICAgIHRlbXAxID0gKGludDMyICopY29tcDsKLQotICAgICAgICB0ZW1wMVswXSA9IHRlbXAwWzBdOwotICAgICAgICB0ZW1wMVsxXSA9IHRlbXAwWzFdOwotICAgICAgICB0ZW1wMVsyXSA9IHRlbXAwWzJdOwotICAgICAgICB0ZW1wMVszXSA9IHRlbXAwWzNdOwotCi0gICAgICAgIGNvbXAgKz0gd2lkdGg7Ci0gICAgICAgIHByZXYgKz0gd2lkdGg7Ci0KLSAgICAgICAgdGVtcDAgPSAoaW50MzIgKilwcmV2OwotICAgICAgICB0ZW1wMSA9IChpbnQzMiAqKWNvbXA7Ci0KLSAgICAgICAgdGVtcDFbMF0gPSB0ZW1wMFswXTsKLSAgICAgICAgdGVtcDFbMV0gPSB0ZW1wMFsxXTsKLSAgICAgICAgdGVtcDFbMl0gPSB0ZW1wMFsyXTsKLSAgICAgICAgdGVtcDFbM10gPSB0ZW1wMFszXTsKLQotICAgICAgICBjb21wICs9IHdpZHRoOwotICAgICAgICBwcmV2ICs9IHdpZHRoOwotCi0gICAgICAgIHRlbXAwID0gKGludDMyICopcHJldjsKLSAgICAgICAgdGVtcDEgPSAoaW50MzIgKiljb21wOwotICAgICAgICB0ZW1wMVswXSA9IHRlbXAwWzBdOwotICAgICAgICB0ZW1wMVsxXSA9IHRlbXAwWzFdOwotICAgICAgICB0ZW1wMVsyXSA9IHRlbXAwWzJdOwotICAgICAgICB0ZW1wMVszXSA9IHRlbXAwWzNdOwotCi0KLSAgICAgICAgY29tcCArPSB3aWR0aDsKLSAgICAgICAgcHJldiArPSB3aWR0aDsKLQotICAgICAgICB0ZW1wMCA9IChpbnQzMiAqKXByZXY7Ci0gICAgICAgIHRlbXAxID0gKGludDMyICopY29tcDsKLSAgICAgICAgdGVtcDFbMF0gPSB0ZW1wMFswXTsKLSAgICAgICAgdGVtcDFbMV0gPSB0ZW1wMFsxXTsKLSAgICAgICAgdGVtcDFbMl0gPSB0ZW1wMFsyXTsKLSAgICAgICAgdGVtcDFbM10gPSB0ZW1wMFszXTsKLQotICAgICAgICBjb21wICs9IHdpZHRoOwotICAgICAgICBwcmV2ICs9IHdpZHRoOwotICAgICAgICByb3cgLT0gNDsKLSAgICB9Ci19Ci0KLQotLyogPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PSAvCi0gICAgRnVuY3Rpb24gOiBQdXRTS0lQUEVEX0IoKQotICAgIERhdGUgICAgIDogMDQvMDMvMjAwMAotLyA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09ICovCi0KLXZvaWQgUHV0U0tJUFBFRF9CKHVpbnQ4ICpjb21wLCB1aW50OCAqcHJldiwgaW50IHdpZHRoKQotewotICAgIGludDMyICp0ZW1wMCwgKnRlbXAxOwotICAgIGludCAgcm93OwotCi0gICAgcm93ID0gQl9TSVpFOwotICAgIHdoaWxlIChyb3cpCi0gICAgewotICAgICAgICB0ZW1wMCA9IChpbnQzMiAqKXByZXY7Ci0gICAgICAgIHRlbXAxID0gKGludDMyICopY29tcDsKLQotICAgICAgICB0ZW1wMVswXSA9IHRlbXAwWzBdOwotICAgICAgICB0ZW1wMVsxXSA9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LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSovCi0jaWZkZWYgX19jcGx1c3BsdXMKLWV4dGVybiAiQyIKLXsKLSNlbmRpZgotCi0jZGVmaW5lIENMSVBfUkVTVUxUKHgpICAgICAgaWYoeCAmIC0yNTYpe3ggPSAweEZGICYgKH4oeD4+MzEpKTt9Ci0jZGVmaW5lIEFERF9BTkRfQ0xJUDEoeCkgICAgeCArPSAocHJlZF93b3JkJjB4RkYpOyBDTElQX1JFU1VMVCh4KTsKLSNkZWZpbmUgQUREX0FORF9DTElQMih4KSAgICB4ICs9ICgocHJlZF93b3JkPj44KSYweEZGKTsgQ0xJUF9SRVNVTFQoeCk7Ci0jZGVmaW5lIEFERF9BTkRfQ0xJUDMoeCkgICAgeCArPSAoKHByZWRfd29yZD4+MTYpJjB4RkYpOyBDTElQX1JFU1VMVCh4KTsKLSNkZWZpbmUgQUREX0FORF9DTElQNCh4KSAgICB4ICs9ICgocHJlZF93b3JkPj4yNCkmMHhGRik7IENMSVBfUkVTVUxUKHgpOwotCi0jZGVmaW5lIEFERF9BTkRfQ0xJUCh4LHkpICAgIHsgIHg5ID0gfih4Pj44KTsgXAotICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmKHg5IT0tMSl7IFwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgeDkgPSAoKHVpbnQzMil4OSk+PjI0OyBcCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHkgPSB4OXwoeTw8OCk7IFwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICB9IFwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBlbHNlIFwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICB7ICAgIFwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgeSA9ICB4fCh5PDw4KTsgXAotICAgICAgICAgICAgICAgICAgICAgICAgIC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kX21vZGVfaW50ZXIoCi0gICAgICAgIGludCB4cHJlZCwgICAgICAgICAgLyogaSAqLwotICAgICAgICBpbnQgeXByZWQsICAgICAgICAgIC8qIGkgKi8KLSAgICAgICAgdWludDggKmNfcHJldiwgICAgICAvKiBpICovCi0gICAgICAgIHVpbnQ4ICpwcmVkX2Jsb2NrLCAgLyogaSAqLwotICAgICAgICBpbnQgd2lkdGgsICAgICAgICAgIC8qIGkgKi8KLSAgICAgICAgaW50IGhlaWdodCwgICAgICAgICAvKiBpICovCi0gICAgICAgIGludCByb3VuZDEKLSAgICApOwotCi0gICAgLyotLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSovCi0gICAgLyogZGVmaW5lZCBpbiBsdW1pbmFuY2VfcHJlZF9tb2RlX2ludGVyNHYuYyAqLwotICAgIHZvaWQgbHVtaW5hbmNlX3ByZWRfbW9kZV9pbnRlcjR2KAotICAgICAgICBpbnQgeHBvcywgICAgICAgICAgIC8qIGkgKi8KLSAgICAgICAgaW50IHlwb3MsICAgICAgICAgICAvKiBpICovCi0gICAgICAgIE1PVCAqcHgsICAgICAgICAgICAgLyogaSAqLwotICAgICAgICBNT1QgKnB5LCAgICAgICAgICAgIC8qIGkgKi8KLSAgICAgICAgdWludDggKmNfcHJldiwgICAgICAvKiBpICovCi0gICAgICAgIHVpbnQ4ICpwcmVkX2Jsb2NrLCAgLyogaSAqLwotICAgICAgICBpbnQgd2lkdGgsICAgICAgICAgIC8qIGkgKi8KLSAgICAgICAgaW50IGhlaWdodCwgICAgICAgICAvKiBpICovCi0gICAgICAgIGludCByb3VuZDEsICAgICAgICAgLyogaSAqLwotICAgICAgICBpbnQgbXZ3aWR0aCwgICAgICAgICAgICAvKiBpICovCi0gICAgICAgIGludCAqeHN1bV9wdHIsICAgICAgICAgIC8qIGkvbyAqLwotICAgICAgICBpbnQgKnlzdW1fcH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AgdWludDggICAqcHBfZGVjX3ksICAvKiBpL28gKi8KLSAgICAgICAgdWludDggICAqcHN0cHJjVHlwUHJ2LCAgLyogaSAqLwotICAgICAgICBpbnQgKmxsLCAgICAgICAgLyogaSAqLwotICAgICAgICBpbnQgKm12X2xvYywgICAgLyogaS9vICovCi0gICAgICAgIGludCBkeCwgICAgIC8qIGkgKi8KLSAgICAgICAgaW50IGR5LCAgICAgLyogaSAqLwotICAgICAgICBpbnQgbXZ3aWR0aCwgICAgLyogaSAqLwotICAgICAgICBpbnQgd2lkdGgsICAgICAgLyogaSAqLwotICAgICAgICBpbnQgaGVpZ2h0ICAgICAgLyogaSAqLwotICAgICk7Ci0jZW5kaWYKLSAgICAvKi0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tKi8KLSAgICAvKiBkZWZpbmVkIGluIGdldF9wcmVkX2Fkdl9tYl9hZGQuYyAqLwotICAgIGludCBHZXRQcmVkQWR2YW5jZWRNQigKLSAgICAgICAgaW50IHhwb3MsCi0gICAgICAgIGludCB5cG9zLAotICAgICAgICB1aW50OCAqY19wcmV2LAotICAgICAgICB1aW50OCAqcHJlZF9ibG9jaywKLSAgICAgICAgaW50IHdpZHRoLAotICAgICAgICBpbnQgcm5kMQotICAgICk7Ci0KLSAgICAvKi0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tKi8KLSAgICAvKiBkZWZpbmVkIGluIGdldF9wcmVkX2Fkdl9iX2FkZC5jICovCi0gICAgaW50IEdldFByZWRBZHZhbmNlZEJ5MHgwKAotICAgICAgICB1aW50OCAqY19wcmV2LCAgICAgIC8qIGkgKi8KLSAgICAgICAgdWludDggKnByZWRfYmxvY2ssICAgICAgLyogaSAqLwotICAgICAgICBpbnQgd2lkdGgsICAgICAgLyogaSAqLwotICAgICAgICBpbnQgcHJlZF93aWR0aF9ybmQgLyogaSAqLwotICAgICk7Ci0KLSAgICBpbnQgR2V0UHJlZEFkdmFuY2VkQnkweDEoCi0gICAgICAgIHVpbnQ4ICpjX3ByZXYsICAgICAgLyogaSAqLwotICAgICAgICB1aW50OCAqcHJlZF9ibG9jaywgICAgICAvKiBpICovCi0gICAgICAgIGludCB3aWR0aCwgICAgICAvKiBpICovCi0gICAgICAgIGludCBwcmVkX3dpZHRoX3JuZCAvKiBpICovCi0gICAgKTsKLQotICAgIGludCBHZXRQcmVkQWR2YW5jZWRCeTF4MCgKLSAgICAgICAgdWludDggKmNfcHJldiwgICAgICAvKiBpICovCi0gICAgICAgIHVpbnQ4ICpwcmVkX2Jsb2NrLCAgICAgIC8qIGkgKi8KLSAgICAgICAgaW50IHdpZHRoLCAgICAgIC8qIGkgKi8KLSAgICAgICAgaW50IHByZWRfd2lkdGhfcm5kIC8qIGkgKi8KLSAgICApOwotCi0gICAgaW50IEdldFByZWRBZHZhbmNlZEJ5MXgxKAotICAgICAgICB1aW50OCAqY19wcmV2LCAgICAgIC8qIGkgKi8KLSAgICAgICAgdWludDggKnByZWRfYmxvY2ssICAgICAgLyogaSAqLwotICAgICAgICBpbnQgd2lkdGgsICAgICAgLyogaSAqLwotICAgICAgICBpbnQgcHJlZF93aWR0aF9ybmQgLyogaSAqLwotICAgICk7Ci0KLSAgICAvKi0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tKi8KLSAgICAvKiBkZWZpbmVkIGluIGdldF9wcmVkX291dHNpZGUuYyAqLwotICAgIGludCBHZXRQcmVkT3V0c2lkZSgKLSAgICAgICAgaW50IHhwb3MsCi0gICAgICAgIGludCB5cG9zLAotICAgICAgICB1aW50OCAqY19wcmV2LAotICAgICAgICB1aW50OCAqcHJlZF9ibG9jayw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gKnFfYmxvY2spOwotICAgIHZvaWQgUG9zdEZpbHRlcihWaWRlb0RlY0RhdGEgKnZpZGVvLCBpbnQgZmlsZXJfdHlwZSwgdWludDggKm91dHB1dCk7Ci0gICAgdm9pZCBGaW5kTWF4TWluKHVpbnQ4ICpwdHIsIGludCAqbWluLCBpbnQgKm1heCwgaW50IGluY3IpOwotICAgIHZvaWQgRGVyaW5nQWRhcHRpdmVTbW9vdGhNTVgodWludDggKmltZywgaW50IGluY3IsIGludCB0aHJlcywgaW50IG14ZGYpOwotICAgIHZvaWQgQWRhcHRpdmVTbW9vdGhfTm9NTVgodWludDggKlJlY19ZLCBpbnQgdjAsIGludCBoMCwgaW50IHZfYmxrLCBpbnQgaF9ibGssCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpbnQgdGhyLCBpbnQgd2lkdGgsIGludCBtYXhfZGlmZik7Ci0gICAgdm9pZCBEZXJpbmdpbmdfTHVtYSh1aW50OCAqUmVjX1ksIGludCB3aWR0aCwgaW50IGhlaWdodCwgaW50MTYgKlFQX3N0b3JlLAotICAgICAgICAgICAgICAgICAgICAgICAgaW50IENvbWJpbmVkLCB1aW50OCAqcHBfbW9kKTsKLSAgICB2b2lkIERlcmluZ2luZ19DaHJvbWEodWludDggKlJlY19DLCBpbnQgd2lkdGgsIGludCBoZWlnaHQsIGludDE2ICpRUF9zdG9yZSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgaW50IENvbWJpbmVkLCB1aW50OCAqcHBfbW9kKTsKLSAgICB2b2lkIENvbWJpbmVkSG9yelZlcnRGaWx0ZXIodWludDggKnJlYywgaW50IHdpZHRoLCBpbnQgaGVpZ2h0LCBpbnQxNiAqUVBfc3RvcmUsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGludCBjaHIsIHVpbnQ4ICpwcF9tb2QpOwotICAgIHZvaWQgQ29tYmluZWRIb3J6VmVydEZpbHRlcl9Ob1NvZnREZWJsb2NraW5nKHVpbnQ4ICpyZWMsI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hbnQuYyAsICAwOS8xOC8yMDAwKi8KLSNpZmRlZiBQVl9TVVBQT1JUX01BSU5fUFJPRklMRQotICAgIGludCBWbGNEZXF1YW50TXBlZ0ludHJhQmxvY2sodm9pZCAqdmlkZW8sIGludCBjb21wLCBpbnQgc3dpdGNoZWQsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB1aW50OCAqYml0bWFwY29sLCB1aW50OCAqYml0bWFwcm93KTsKLSAgICBpbnQgVmxjRGVxdWFudE1wZWdJbnRlckJsb2NrKHZvaWQgKnZpZGVvLCBpbnQgY29tcCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHVpbnQ4ICpiaXRtYXBjb2wsIHVpbnQ4ICpiaXRtYXByb3cpOwotI2VuZGlmCi0gICAgaW50IFZsY0RlcXVhbnRIMjYzSW50cmFCbG9jayhWaWRlb0RlY0RhdGEgKnZpZGVvLCBpbnQgY29tcCwgaW50IHN3aXRjaGVkLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdWludDggKmJpdG1hcGNvbCwgdWludDggKmJpdG1hcHJvdyk7Ci0gICAgaW50IFZsY0RlcXVhbnRIMjYzSW50cmFCbG9ja19TSChWaWRlb0RlY0RhdGEgKnZpZGVvLCBpbnQgY29tcCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHVpbnQ4ICpiaXRtYXBjb2wsIHVpbnQ4ICpiaXRtYXByb3cpOwotICAgIGludCBWbGNEZXF1YW50SDI2M0ludGVyQmxvY2soVmlkZW9EZWNEYXRhICp2aWRlbywgaW50IGNvbXAsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB1aW50OCAqYml0bWFwY29sLCB1aW50OCAqYml0bWFwcm93KTsKLQotI2lmZGVmIF9fY3BsdXNwbHVzCi19Ci0jZW5kaWYgLyogX19jcGx1c3BsdXMgKi8KLQotLyotLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tL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ludDggICBtYzsgICAgICAgICAgICAgICAgIC8qIG1vdGlvbl9jb21wZW5zYXRpb25fY29tcGxleGl0eSAgICAgICAqLwotfSBDb21wbGV4aXR5X0VzdDsKLQotCi10eXBlZGVmIHN0cnVjdCB0YWdWb3AKLXsKLSAgICBQSVhFTCAgICp5Q2hhbjsgICAgICAgICAgICAgLyogVGhlIFkgY29tcG9uZW50ICovCi0gICAgUElYRUwgICAqdUNoYW47ICAgICAgICAgICAgIC8qIFRoZSBVIGNvbXBvbmVudCAqLwotICAgIFBJWEVMICAgKnZDaGFuOyAgICAgICAgICAgICAvKiBUaGUgViBjb21wb25lbnQgKi8KLQotICAgIHVpbnQzMiAgdGltZVN0YW1wOyAgICAgICAgICAvKiBWb3AgVGltZVN0YW1wIGluIG1zZWMgKi8KLQotICAgIC8qIEFjdHVhbCBzeW50YXggZWxlbWVudHMgZm9yIFZPUCAoc3RhbmRhcmQpICovCi0gICAgaW50ICAgICBwcmVkaWN0aW9uVHlwZTsgICAgIC8qIFZPUCBwcmVkaWN0aW9uIHR5cGUgKi8KLSAgICB1aW50ICAgIHRpbWVJbmM7ICAgICAgICAgICAgLyogVk9QIHRpbWUgaW5jcmVtZW50IChyZWxhdGl2ZSB0byBsYXN0IG10YikgKi8KLSAgICBpbnQgICAgIHZvcENvZGVkOwotICAgIGludCAgICAgcm91bmRpbmdUeXBlOwotICAgIGludCAgICAgaW50cmFEQ1ZsY1RocjsKLSAgICBpbnQxNiAgICAgICBxdWFudGl6ZXI7ICAgICAgICAgIC8qIFZPUCBxdWFudGl6ZXIgKi8KLSAgICBpbnQgICAgIGZjb2RlRm9yd2FyZDsgICAgICAgLyogVk9QIGR5bmFtaWMgcmFuZ2Ugb2YgbW90aW9uIHZlY3RvcnMgKi8KLSAgICBpbnQgICAgIGZjb2RlQmFja3dhcmQ7ICAgICAgLyogVk9QIGR5bmFtaWMgcmFuZ2Ugb2YgbW90aW9uIHZlY3RvcnMgKi8KLSAgICBpbnQgICAgIHJlZlNlb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WF0cml4ICovCi0gICAgaW50ICAgICBsb2FkTm9uSW50cmFRdWFudE1hdDsgICAvKiBMb2FkIG5vbmludHJhIHF1YW50aXphdGlvbiBtYXRyaXggKi8KLSAgICBpbnQgICAgIGlxbWF0WzY0XTsgICAgICAgICAgICAgIC8qIEludHJhIHF1YW50Lm1hdHJpeCAqLwotICAgIGludCAgICAgbmlxbWF0WzY0XTsgICAgICAgICAgICAgLyogTm9uLWludHJhIHF1YW50Lm1hdHJpeCAqLwotCi0gICAgLyogUGFyYW1ldGVycyB1c2VkIGZvciBzY2FsYWJpbGl0eSAqLwotICAgIGludCAgICAgc2NhbGFiaWxpdHk7ICAgICAgICAgICAgLyogVk9MIHNjYWxhYmlsaXR5IChmbGFnKSAqLwotICAgIGludCAgICAgc2NhbFR5cGU7ICAgICAgICAgICAgICAgLyogdGVtcG9yYWwgPSAwLCBzcGF0aWFsID0gMSwgYm90aCA9IDIgKi8KLQotICAgIGludCAgICAgcmVmVm9sSUQ7ICAgICAgICAgICAgICAgLyogVk9MIGlkIG9mIHJlZmVyZW5jZSBWT0wgKi8KLSAgICBpbnQgICAgIHJlZlNhbXBEaXI7ICAgICAgICAgICAgIC8qIFZPTCByZXNvbC4gb2YgcmVmLiBWT0wgKi8KLSAgICBpbnQgICAgIGhvclNhbXBfbjsgICAgICAgICAgICAgIC8qIFZPTCBob3IuIHJlc2FtcGxpbmcgb2YgcmVmLiBWT0wgZ2l2ZW4gYnkgKi8KLSAgICBpbnQgICAgIGhvclNhbXBfbTsgICAgICAgICAgICAgIC8qICAgICBzYW1wZmFjID0gaG9yX3NhbXBfbi9ob3Jfc2FtcF9tICAgICAgKi8KLSAgICBpbnQgICAgIHZlclNhbXBfbjsgICAgICAgICAgICAgIC8qIFZPTCB2ZXIuIHJlc2FtcGxpbmcgb2YgcmVmLiBWT0wgZ2l2ZW4gYnkgKi8KLSAgICBpbnQgICAgIHZlclNhbXBfbTsgICAgICAgICAgICAgIC8qICAgICBzYW1wZmFjID0gdmV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gICAgICAgICAgIC8qIE5ldyBjaGFuZ2UgdG8gcmlkIG9mIG1lbWNweSgpLiAgMDQvMjQvMjAwMSAqLwotICAgIFZvcCAgICAgICAgICAgICAqKnZvcEhlYWRlcjsgICAgICAgICAgICAvKiBvbmUgZm9yIGVhY2ggbGF5ZXIuICAgMDgvMjkvMjAwMCAqLwotCi0gICAgLyogSS9PIHN0cnVjdHVyZXMgKi8KLSAgICBNYWNyb0Jsb2NrICAgICAgKm1ibG9jazsgICAgICAgICAgICAgICAgICAgIC8qIE1hY3JvYmxvY2sgZGF0YSBzdHJ1Y3R1cmUgKi8KLSAgICB1aW50OCAgICAgICAgICAgKmFjUHJlZEZsYWc7ICAgICAgICAgICAgICAgIC8qICAqLwotCi0gICAgLyogc2NyYXRjaCBtZW1vcnkgdXNlZCBpbiBkYXRhIHBhcnRpdGlvbmVkIG1vZGUgKi8KLSAgICB0eXBlRENTdG9yZSAgICAgKnByZWREQzsgICAgICAgIC8qICBUaGUgREMgY29lZmZzIGZvciBlYWNoIE1CICovCi0gICAgdHlwZURDQUNTdG9yZSAgICpwcmVkRENBQ19yb3c7Ci0gICAgdHlwZURDQUNTdG9yZSAgICpwcmVkRENBQ19jb2w7Ci0KLSAgICBpbnQgICAgICAgICAgICAgdXNlUHJldlFQOyAgICAgICAgICAgICAgLyogcnVubmluZyBRUCBkZWNpc2lvbiBzd2l0Y2ggKi8KLSAgICB1aW50OCAgICAgICAgICAgKnNsaWNlTm87ICAgICAgICAgICAgICAgLyogU2xpY2UgaW5kaWNhdG9yIGZvciBlYWNoIE1CICAqLwotICAgIC8qICAgICBjaGFuZ2VkIHRoaXMgdG8gYSAxRCAgICovCi0gICAgLyogICAgYXJyYXkgZm9yIG9wdGltaXphdGlvbiAgICAqLwotICAgIE1PVCAgICAgICAgICAgICAqbW90WDsgICAgICAgICAgICAgICAgICAvKiBNb3Rpb24gdmVjdG9yIGluIFggZGlyZWN0aW9uICovCi0gICAgTU9UICAgICAgICAgICAgICptb3RZOyAgICAgICAgICAgICAgICAgIC8qIE1vdGlvbiB2ZWN0b3IgaW4gWSBkaXJlY3Rpb24gKi8KLSAgICBIZWFkZXJJbmZvRGVjVmlkZW8gIGhlYWRlckluZm87ICAgICAgICAgLyogTUIgSGVhZGVyIGluZm9ybWF0aW9uICovCi0gICAgaW50MTYgICAgICAgICAgICpRUE1COyAgICAgICAgICAgICAgICAgIC8qIFF1YW50aXplciB2YWx1ZSBmb3IgZWFjaCBNQiAqLwotCi0gICAgdWludDggICAgICAgICAgICpwc3RwcmNUeXBDdXI7ICAgICAgICAgIC8qIFBvc3Rwcm9jZXNzaW5nIHR5cGUgZm9yIGN1cnJlbnQgZnJhbWUgKi8KLSAgICB1aW50OCAgICAgICAgICAgKnBzdHByY1R5cFBydjsgICAgICAgICAgLyogUG9zdHByb2Nlc3NpbmcgdHlwZSBmb3IgcHJldmlvdXMgZnJhbWUgKi8KLSAgICAvKiBzY3JhdGNoIG1lbW9yeSB1c2VkIGluIGFsbCBtb2RlcyAqLwotICAgIGludCAgICAgICAgICAgICBtYm51bTsgICAgICAgICAgICAgICAgICAgICAgLyogIE1hY3JvYmxvY2sgbnVtYmVyICovCi0gICAgdWludCAgICAgICAgICAgIG1ibnVtX3JvdzsKLSAgICBpbnQgICAgICAgICAgICAgbWJudW1fY29sOwotICAgIC8qIEkgYWRkZWQgdGhlc2UgdmFyaWFibGVzIHNpbmNlIHRoZXkgYXJlIHVzZWQgYSBsb3QuICAgMDQvMTMvMjAwMCAqLwotICAgIGludCAgICAgbk1CUGVyUm93LCBuTUJQZXJDb2w7ICAgLyogbnVtYmVyIG9mIE1CcyBpbiBlYWNoIHJvdyAmIGNvbHVtbiAgICAqLwotICAgIGludCAgICAgblRvdGFsTUI7Ci0gICAgLyogZm9yIHNob3J0IHZpZGVvIGhlYWRlciAqLwotICAgIGludCAgICAgbk1CaW5HT0I7ICAgICAgICAgICAgICAgLyogbnVtYmVyIG9mIE1CcyBpbiBHT0IsICAwNS8yMi8wMCAqLwotICAgIGludCAgICAgbkdPQmluVm9wOyAgICAgICAgICAgICAgLyogbnVtYmVyIG9mIEdPQiBpbiBWb3AgICAwNS8yMi8wMCAqLwotICAgIC8qIFZPTCBEaW1lbnNpb25zICovCi0gICAgaW50ICAgICB3aWR0aDsgICAgICAgICAgICAgICAgICAvKiBXaWR0aCAqLwotICAgIGludCAgICAgaGVpZ2h0OyAgICAgICAgICAgICAgICAgLyogSGVpZ2h0ICovCi0gICAgaW50ICAgICBkaXNwbGF5V2lkdGg7ICAgICAgICAgICAgICAgLyogSGFuZGxlIGltYWdlIHdob3NlIHNpemUgaXMgbm90IGEgbXVsdGlwbGUgb2YgMTYuICovCi0gICAgaW50ICAgICBkaXNwbGF5SGVpZ2h0OyAgICAgICAgICAgICAgLyogICBUaGlzIGlzIHRoZSBhY3R1YWwgc2l6ZS4gICAwOC8wOS8yMDAwICAgICAgICAqLwotICAgIGludDMyICAgc2l6ZTsKLSAgICAvKiBNaXNjZWxsYW5lb3VzIGRhdGEgcG9pbnRzIHRvIGJlIHBhc3NlZCAqLwotICAgIGludCAgICAgICAgICAgICBmcmFtZV9pZHg7ICAgICAgICAgICAgICAvKiBDdXJyZW50IGZyYW1lIElEICovCi0gICAgaW50ICAgICAgICAgICAgIGZyYW1lUmF0ZTsgICAgICAgICAgICAgIC8qIE91dHB1dCBmcmFtZSBSYXRlIChvdmVyIDEwIHNlY29uZHMpICovCi0gICAgaW50MzIgICAgICAgICAgIGR1cmF0aW9uOwotICAgIHVpbnQzMiAgICAgICAgICBjdXJyVGltZXN0YW1wOwotICAgIGludCAgICAgICAgICAgICBjdXJyTGF5ZXI7ICAgICAgICAgICAgICAvKiBDdXJyZW50IGZyYW1lIGxheWVyICAqLwotICAgIGludCAgICAgc2hvcnRWaWRlb0hlYWRlcjsgICAgICAgLyogc2hvcnRWaWRlb0hlYWRlciBtb2RlICovCi0gICAgaW50ICAgICBpbnRyYV9hY2RjUHJlZERpc2FibGU7ICAvKiBWT0wgZGlzYWJsZS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Ci0vLyAgICAgIGlmICgqbmV4dF9NQiA8PSB2aWRlby0+bWJudW0pICAgLyogIG5lZWRzIG1vcmUgaW52ZXN0aWdhdGlvbiAqLwotLy8gICAgICAgICAgKm5leHRfTUIgPSB2aWRlby0+bWJudW0rMTsKLQotICAgICAgICBpZiAoKm5leHRfTUIgPj0gblRvdGFsTUIpICAvKiBmaXggIDA0LzA1LzAxICovCi0gICAgICAgIHsKLSAgICAgICAgICAgICpuZXh0X01CID0gdmlkZW8tPm1ibnVtICsgMTsKLSAgICAgICAgICAgIGlmICgqbmV4dF9NQiA+PSBuVG90YWxNQikgICAgLyogdGhpcyBjaGVjayBpcyBuZWVkZWQgICovCi0gICAgICAgICAgICAgICAgKm5leHRfTUIgPSBuVG90YWxNQiAtIDE7Ci0gICAgICAgIH0KLSAgICAgICAgcXVhbnRpemVyID0gKGludDE2KSBCaXRzdHJlYW1SZWFkQml0czE2KHN0cmVhbSwgY3VyclZvbC0+cXVhbnRQcmVjaXNpb24pOwotICAgICAgICBpZiAocXVhbnRpemVyID09IDApIHJldHVybiBQVl9GQUlMOyAgICAgICAgLyogIDA0LzAzLzAxICovCi0KLSAgICAgICAgY3VyclZvcC0+cXVhbnRpemVyID0gcXVhbnRpemVyOwotCi0gICAgICAgIC8qIGlmIHdlIGhhdmUgSEVDLCByZWFkIHNvbWUgcmVkdW5kYW50IFZPUCBoZWFkZXIgaW5mb3JtYXRpb24gKi8KLSAgICAgICAgLyogdGhpcyBwYXJ0IG5lZWRzIGltcHJvdmVtZW50ICAwNC8wNS8wMSAqLwotICAgICAgICBpZiAoQml0c3RyZWFtUmVhZDFCaXRzKHN0cmVhbSkpCi0gICAgICAgIHsKLSAgICAgICAgICAgIGludCB0aW1lX2Jhc2UgPSAtMTsKLQotICAgICAgICAgICAgLyogbW9kdWxvX3RpbWVfYmFzZSAoPyBiaXRzKSAqLwotICAgICAgICAgICAgZG8KLSAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICB0aW1lX2Jhc2UrKzsKLSAgICAgICAgICAgICAgICB0bXB2YXIxNiA9IEJpdHN0cmVhbVJlYWQxQml0cyhzdHJlYW0pOwotICAgICAgICAgICAgfQotICAgICAgICAgICAgd2hpbGUgKHRtcHZhcjE2ID09IDEpOwotCi0gICAgICAgICAgICAvKiBtYXJrZXIgYml0ICovCi0gICAgICAgICAgICBCaXRzdHJlYW1SZWFkMUJpdHMoc3RyZWFtKTsKLQotICAgICAgICAgICAgLyogdm9wX3RpbWVfaW5jcmVtZW50ICgxLTE1IGJpdHMpICovCi0gICAgICAgICAgICBCaXRzdHJlYW1SZWFkQml0czE2KHN0cmVhbSwgY3VyclZvbC0+bmJpdHNUaW1lSW5jUmVzKTsKLQotICAgICAgICAgICAgLyogbWFya2VyIGJpdCAqLwotICAgICAgICAgICAgQml0c3RyZWFtUmVhZDFCaXRzKHN0cmVhbSk7Ci0KLSAgICAgICAgICAgIC8qIHZvcF9wcmVkaWN0aW9uX3R5cGUgKDIgYml0cykgKi8KLSAgICAgICAgICAgIEJpdHN0cmVhbVJlYWRCaXRzMTYoc3RyZWFtLCAyKTsKLQotICAgICAgICAgICAgLyogQWRkZWQgaW50cmFfZGNfdmxjX3RociByZWFkaW5nICAqLwotICAgICAgICAgICAgQml0c3RyZWFtUmVhZEJpdHMxNihzdHJlYW0sIDMpOwotCi0gICAgICAgICAgICAvKiBmY29kZXMgKi8KLSAgICAgICAgICAgIGlmIChjdXJyVm9wLT5wcmVkaWN0aW9uVHlwZSAhPSBJX1ZPUCkKLSAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICBmY29kZV9mb3J3YXJkID0gKGludCkgQml0c3RyZWFtUmVhZEJpdHMxNihzdHJlYW0sIDMpOwotCi0gICAgICAgICAgICAgICAgaWYgKGN1cnJWb3AtPnByZWRpY3Rpb25UeXBlID09IEJfVk9QKQotICAgICAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAgICAgQml0c3RyZWFtUmVhZEJpdHMxNihzdHJlYW0sIDMpOwotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgIH0KLQotICAgICAgICB9Ci0gICAgfQotICAgIGVsc2UKLSAgICB7Ci0gICAgICAgIFBWX0JpdHN0cmVhbUJ5dGVBbGlnbihzdHJlYW0pOyAgLyogICovCi0gICAgICAgIHN0YXR1cyA9IEJpdHN0cmVhbUNoZWNrRW5kQnVmZmVyKHN0cmVhbSk7ICAgLyogcmV0dXJuIGVuZF9vZl9WT1AgIDAzLzMwLzAxICovCi0gICAgICAgIGlmIChzdGF0dXMgIT0gUFZfU1VDQ0VTUykKLSAgICAgICAgewotICAgICAgICAgICAgcmV0dXJuIHN0YXR1czsKLSAgICAgICAgfQotICAgICAgICBzdGF0dXMgPSBCaXRzdHJlYW1TaG93Qml0czMySEMoc3RyZWFtLCAmdG1wdmFyMzIpOyAgIC8qICAwNy8wNy8wMSAqLwotICAgICAgICAvKiAtMTYgPSAweEZGRkZGRkYwKi8KLSAgICAgICAgaWYgKCh0bXB2YXIzMiAmIDB4RkZGRkZGRjApID09IFZJU1VBTF9PQkpFQ1RfU0VRVUVOQ0VfU1RBUlRfQ09ERSkgLyogc3RhcnQgY29kZSBtYXNrIDAwIDAwIDAxICovCi0KLSAgICAgICAgewotICAgICAgICAgICAgLyogd2UgZG9uJ3QgaGF2ZSB0byBjaGVjayBmb3IgbGVnbCBzdHVmZmluZyBoZXJlLiAgIDA1LzA4LzIwMDAgKi8KLSAgICAgICAgICAgIHJldHVybiBQVl9FTkRfT0ZfVk9QOwotICAgICAgICB9Ci0gICAgICAgIGVsc2UKLSAgICAgICAgewotICAgICAgICAgICAgcmV0dXJuIFBWX0ZBSUw7Ci0gICAgICAgIH0KLSAgICB9Ci0KLSAgICByZXR1cm4gUFZfU1VDQ0VTUzsKLX0KLQotCi0KLS8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKkNvbW1lbnRCZWdpbioqKioqKgotKiAgICAgICAzLzEwLzAwICA6IG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gICAgICAgIGlmICgqbmV4dF9NQiA+PSBuVG90YWxNQikgICAgLyogdGhpcyBjaGVjayBpcyBuZWVkZWQgICovCi0gICAgICAgICAgICAgICAgKm5leHRfTUIgPSBuVG90YWxNQiAtIDE7Ci0gICAgICAgIH0KLSAgICAgICAgLyogd2Ugd2lsbCBub3QgcGFyc2Ugc2VicDIgZm9yIGxhcmdlIHBpY3R1cmVzIDNHUFAgKi8KLSAgICAgICAgcXVhbnRpemVyID0gKGludDE2KSBCaXRzdHJlYW1SZWFkQml0czE2KHN0cmVhbSwgNSk7Ci0gICAgICAgIGlmIChxdWFudGl6ZXIgPT0gMCkgcmV0dXJuIFBWX0ZBSUw7Ci0KLSAgICAgICAgY3VyclZvcC0+cXVhbnRpemVyID0gcXVhbnRpemVyOwotICAgICAgICBpZiAoIUJpdHN0cmVhbVJlYWQxQml0cyhzdHJlYW0pKQotICAgICAgICB7Ci0gICAgICAgICAgICByZXR1cm4gUFZfRkFJTDsKLSAgICAgICAgfQotICAgICAgICBjdXJyVm9wLT5nb2JGcmFtZUlEID0gKGludCkgQml0c3RyZWFtUmVhZEJpdHMxNihzdHJlYW0sIDIpOwotICAgIH0KLSAgICBlbHNlCi0gICAgewotICAgICAgICBzdGF0dXMgPSBCaXRzdHJlYW1DaGVja0VuZEJ1ZmZlcihzdHJlYW0pOyAgIC8qIHJldHVybiBlbmRfb2ZfVk9QICAwMy8zMC8wMSAqLwotICAgICAgICBpZiAoc3RhdHVzICE9IFBWX1NVQ0NFU1MpCi0gICAgICAgIHsKLSAgICAgICAgICAgIHJldHVybiBzdGF0dXM7Ci0gICAgICAgIH0KLSAgICAgICAgUFZfQml0c3RyZWFtU2hvd0JpdHNCeXRlQWxpZ24oc3RyZWFtLCBTSE9SVF9WSURFT19TVEFSVF9NQVJLRVJfTEVOR1RILCAmdG1wdmFyKTsKLQotICAgICAgICBpZiAodG1wdmFyID09IFNIT1JUX1ZJREVPX1NUQVJUX01BUktFUikKLSAgICAgICAgewotICAgICA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5cEN1cjsKLQotICAgIGlmICgoZmlsdGVyX3R5cGUgJiBQVl9ERUJMT0NLKSAmJiAoZmlsdGVyX3R5cGUgJiBQVl9ERVJJTkcpKQotICAgIHsKLSAgICAgICAgQ29tYmluZWRIb3J6VmVydFJpbmdGaWx0ZXIob3V0cHV0LCB3aWR0aCwgaGVpZ2h0LCBRUF9zdG9yZSwgMCwgcHBfbW9kKTsKLSAgICB9Ci0gICAgZWxzZQotICAgIHsKLSAgICAgICAgaWYgKGZpbHRlcl90eXBlICYgUFZfREVCTE9DSykKLSAgICAgICAgewotICAgICAgICAgICAgaWYgKHNvZnREZWJsb2NraW5nKQotICAgICAgICAgICAgewotICAgICAgICAgICAgICAgIENvbWJpbmVkSG9yelZlcnRGaWx0ZXIob3V0cHV0LCB3aWR0aCwgaGVpZ2h0LAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgUVBfc3RvcmUsIDAsIHBwX21vZCk7Ci0gICAgICAgICAgICB9Ci0gICAgICAgICAgICBlbHNlCi0gICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgQ29tYmluZWRIb3J6VmVydEZpbHRlcl9Ob1NvZnREZWJsb2NraW5nKG91dHB1dCwgd2lkdGgsIGhlaWdodCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgUVBfc3RvcmUsIDAsIHBwX21vZCk7Ci0gICAgICAgICAgICB9Ci0gICAgICAgIH0KLSAgICAgICAgaWYgKGZpbHRlcl90eXBlICYgUFZfREVSSU5HKQotICAgICAgICB7Ci0gICAgICAgICAgICBEZXJpbmdpbmdfTHVtYShvdXRwdXQsIHdpZHRoLCBoZWlnaHQsIFFQX3N0b3JlLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgY29tYmluZWRfd2l0aF9kZWJsb2NrX2ZpbHRlciwgcHBfbW9kKTsKLQotICAgICAgICB9Ci0gICAgfQotCi0gICAgLyogQ2hyb21hICovCi0KLSAgICBwcF9tb2QgKz0gKG5Ub3RhbE1CIDw8IDIpOwotICAgIG91dHB1dCArPSBzaXplOwotCi0gICAgaWYgKChmaWx0ZXJfdHlwZSAmIFBWX0RFQkxPQ0spICYmIChmaWx0ZXJfdHlwZSAmIFBWX0RFUklORykpCi0gICAgewotICAgICAgICBDb21iaW5lZEhvcnpWZXJ0UmluZ0ZpbHRlcihvdXRwdXQsIChpbnQpKHdpZHRoID4+IDEpLCAoaW50KShoZWlnaHQgPj4gMSksIFFQX3N0b3JlLCAoaW50KSAxLCBwcF9tb2QpOwotICAgIH0KLSAgICBlbHNlCi0gICAgewotICAgICAgICBpZiAoZmlsdGVyX3R5cGUgJiBQVl9ERUJMT0NLKQotICAgICAgICB7Ci0gICAgICAgICAgICBpZiAoc29mdERlYmxvY2tpbmcpCi0gICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgQ29tYmluZWRIb3J6VmVydEZpbHRlcihvdXRwdXQsIChpbnQpKHdpZHRoID4+IDEpLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKGludCkoaGVpZ2h0ID4+IDEpLCBRUF9zdG9yZSwgKGludCkgMSwgcHBfbW9kKTsKLSAgICAgICAgICAgIH0KLSAgICAgICAgICAgIGVsc2UKLSAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICBDb21iaW5lZEhvcnpWZXJ0RmlsdGVyX05vU29mdERlYmxvY2tpbmcob3V0cHV0LCAoaW50KSh3aWR0aCA+PiAxKSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKGludCkoaGVpZ2h0ID4+IDEpLCBRUF9zdG9yZSwgKGludCkgMSwgcHBfbW9kKTsKLSAgICAgICAgICAgIH0KLSAgICAgICAgfQotICAgICAgICBpZiAoZmlsdGVyX3R5cGUgJiBQVl9ERVJJTkcpCi0gICAgICAgIHsKLSAgICAgICAgICAgIERlcmluZ2luZ19DaHJvbWEob3V0cHV0LCAoaW50KSh3aWR0aCA+PiAxKSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKGludCkoaGVpZ2h0ID4+IDEpLCBRUF9zdG9yZSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY29tYmluZWRfd2l0aF9kZWJsb2NrX2ZpbHRlciwgcHBfbW9kKTsKLSAgICAgICAgfQotICAgIH0KLQotICAgIHBwX21vZCArPSBuVG90YWxNQjsKLSAgICBvdXRwdXQgKz0gKHNpemUgPj4gMik7Ci0KLSAgICBpZiAoKGZpbHRlcl90eXBlICYgUFZfREVCTE9DSykgJiYgKGZpbHRlcl90eXBlICYgUFZfREVSSU5HKSkKLSAgICB7Ci0gICAgICAgIENvbWJpbmVkSG9yelZlcnRSaW5nRmlsdGVyKG91dHB1dCwgKGludCkod2lkdGggPj4gMSksIChpbnQpKGhlaWdodCA+PiAxKSwgUVBfc3RvcmUsIChpbnQpIDEsIHBwX21vZCk7Ci0gICAgfQotICAgIGVsc2UKLSAgICB7Ci0gICAgICAgIGlmIChmaWx0ZXJfdHlwZSAmIFBWX0RFQkxPQ0spCi0gICAgICAgIHsKLSAgICAgICAgICAgIGlmIChzb2Z0RGVibG9ja2luZykKLSAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICBDb21iaW5lZEhvcnpWZXJ0RmlsdGVyKG91dHB1dCwgKGludCkod2lkdGggPj4gMSksCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoaW50KShoZWlnaHQgPj4gMSksIFFQX3N0b3JlLCAoaW50KSAxLCBwcF9tb2QpOwotICAgICAgICAgICAgfQotICAgICAgICAgICAgZWxzZQotICAgICAgICAgICAgewotICAgICAgICAgICAgICAgIENvbWJpbmVkSG9yelZlcnRGaWx0ZXJfTm9Tb2Z0RGVibG9ja2luZyhvdXRwdXQsIChpbnQpKHdpZHRoID4+IDEpLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoaW50KSh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ICAgfQotCi0KLSAgICAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqIFZFUlRJQ0FMIEZJTFRFUklORyAqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotICAgIC8qIHZlcnRpY2FsIGZpbHRlcmluZyBvZiBtaWQgc2VjdGlvbnMgbm8gbmVlZCB0byBjaGVjayBuZWlnaGJvcmluZyBRUCdzIGV0YyAqLwotICAgIGlmICghY2hyKQotICAgIHsKLSAgICAgICAgcmVjX3kgPSByZWMgKyAod2lkdGggPDwgMyk7Ci0gICAgICAgIGZvciAoaSA9IDA7IGkgPCAoaGVpZ2h0ID4+IDQpOyBpKyspCi0gICAgICAgIHsKLSAgICAgICAgICAgIGZvciAoaiA9IDA7IGogPCAod2lkdGggPj4gNCk7IGorKykKLSAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICBpZiAobW9kZVttYm51bV0gIT0gTU9ERV9TS0lQUEVEKQotICAgICAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAgICAgayA9IDE2OwotICAgICAgICAgICAgICAgICAgICBzdHJlbmd0aCA9IFNUUkVOR1RIX3RhYltRUF9zdG9yZVttYm51bV1dOwotICAgICAgICAgICAgICAgICAgICB3aGlsZSAoay0tKQotICAgICAgICAgICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgICAgICAgICBBID0gICoocmVjX3kgLSB3aWR0aDIpOwotICAgICAgICAgICAgICAgICAgICAgICAgRCA9ICoocmVjX3kgKyB3aWR0aCk7Ci0gICAgICAgICAgICAgICAgICAgICAgICBBX0QgPSBBIC0gRDsKLSAgICAgICAgICAgICAgICAgICAgICAgIEMgPSAqcmVjX3k7Ci0gICAgICAgICAgICAgICAgICAgICAgICBCID0gKihyZWNfeSAtIHdpZHRoKTsKLSAgICAgICAgICAgICAgICAgICAgICAgIGQgPSAoKChDIC0gQikgPDwgMikgKyBBX0QpOwotCi0gICAgICAgICAgICAgICAgICAgICAgICBpZiAoZCA8IDApCi0gICAgICAgICAgICAgICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgZDEgPSAtKC1kID4+IDMpOwotICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChkMSA8IC0oc3RyZW5ndGggPDwgMSkpCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgewotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBkMSA9IDA7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgICAgICAgICAgICAgIGVsc2UgaWYgKGQxIDwgLXN0cmVuZ3RoKQotICAgICAgICAgICAgICAgICAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZDEgPSAtZDEgLSAoc3RyZW5ndGggPDwgMSk7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgICAgICAgICAgICAgIGQxXzIgPSAtZDEgPj4gMTsKLSAgICAgICAgICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICAgICAgICAgIGVsc2UKLSAgICAgICAgICAgICAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBkMSA9IGQgPj4gMzsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoZDEgPiAoc3RyZW5ndGggPDwgMSkpCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgewotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBkMSA9IDA7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgICAgICAgICAgICAgIGVsc2UgaWYgKGQxID4gc3RyZW5ndGgpCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgewotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBkMSA9IChzdHJlbmd0aCA8PCAxKSAtIGQxOwotICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBkMV8yID0gZDEgPj4gMTsKLSAgICAgICAgICAgICAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgICAgICAgICAgICAgaWYgKEFfRCA8IDApCi0gICAgICAgICAgICAgICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgZDIgPSAtKC1BX0QgPj4gMik7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGQyIDwgLWQxXzIpCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgewotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBkMiA9IC1kMV8yOwotICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICAgICAgICAgIGVsc2UKLSAgICAgICAgICAgICAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBkMiA9IEFfRCA+PiAyOwotICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChkMiA+IGQxXzIpCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgewotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBkMiA9IGQxXzI7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgICAgICAgICAgfQotCi0gICAgICAgICAgICAgICAgICAgICAgICAqKHJlY195IC0gd2lkdGgyKSA9IEEgLSBkMjsKLSAgICAgICAgICAgICAgICAgICAgICAgIHRtcHZhciA9IEIgKyBkMTsKLSAgICAgICAgICAgICAgICAgICAgICAgIENMSVBfUkVTVUxUKHRtcHZhcikKLSAgICAgICAgICAgICAgICAgICAgICAgICoocmVjX3kgLSB3aWR0aCkgPSB0bXB2YXI7Ci0gICAgICAgICAgICAgICAgICAgICAgICB0bXB2YXIgPSBDIC0gZDE7Ci0gICAgICAgICAgICAgICAgICAgICAgICBDTElQX1JFU1VMVCh0bXB2YXIpCi0gICAgICAgICAgICAgICAgICAgICAgICAqcmVjX3kgPSB0bXB2YXI7Ci0gICAgICAgICAgICAgICAgICAgICAgICAqKHJlY195ICsgd2lkdGgpID0gRCArIGQyOwotICAgICAgICAgICAgICAgICAgICAgICAgcmVjX3krKzsKLSAgICAgICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICBlbHNlCi0gICAgICAgICAgICAgICAgewotICAgICAgICAgICAgICAgICAgICByZWNfeSArPSBiX3NpemU7Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgIG1ibnVtKys7Ci0gICAgICAgICAgICB9Ci0gICAgICAgICAgICByZWNfeSArPSAoMTUgKiB3aWR0aCk7Ci0KLSAgICAgICAgfQotICAgIH0KLQotICAgIC8qIFZFUlRJQ0FMIGJvdW5kYXJ5IGJsb2NrcyAqLwotCi0KLSAgICByZWNfeSA9IHJlYyArIHdpZHRoICogYl9zaXplOwotCi0gICAgbWJudW0gPSBuTUJQZXJSb3c7Ci0gICAgZm9yIChpID0gMDsgaSA8IG5NQlBlckNvbCAtIDE7IGkrKykKLSAgICB7Ci0gICAgICAgIGZvciAoaiA9IDA7IGogPCBuTUJQZXJSb3c7IGorKykKLSAgICAgICAgewotICAgICAgICAgICAgaWYgKG1vZGVbbWJudW1dICE9IE1PREVfU0tJUFBFRCB8fCBtb2RlW21ibnVtIC0gbk1CUGVyUm93XSAhPSBNT0RFX1NLSVBQRUQpCi0gICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgayA9IGJfc2l6ZTsKLSAgICAgICAgICAgICAgICBpZiAobW9kZVttYm51bV0gIT0gTU9ERV9TS0lQUEVEKQotICAgICAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAgICAgc3RyZW5ndGggPSBTVFJFTkdUSF90YWJbKGFubmV4X1QgPyAgTVFfY2hyb21hX1FQX3RhYmxlW1FQX3N0b3JlW21ibnVtXV0gOiBRUF9zdG9yZVttYm51bV0pXTsKLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgZWxzZQotICAgICAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAgICAgc3RyZW5ndGggPSBTVFJFTkdUSF90YWJbKGFubmV4X1QgPyAgTVFfY2hyb21hX1FQX3RhYmxlW1FQX3N0b3JlW21ibnVtIC0gbk1CUGVyUm93XV0gOiBRUF9zdG9yZVttYm51bSAtIG5NQlBlclJvd10pXTsKLSAgICAgICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgICAgICB3aGlsZSAoay0tKQotICAgICAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAgICAgQSA9ICAqKHJlY195IC0gd2lkdGgyKTsKLSAgICAgICAgICAgICAgICAgICAgRCA9ICAqKHJlY195ICsgd2lkdGgpOwotICAgICAgICAgICAgICAgICAgICBBX0QgPSBBIC0gRDsKLSAgICAgICAgICAgICAgICAgICAgQyA9ICpyZWNfeTsKLSAgICAgICAgICAgICAgICAgICAgQiA9ICoocmVjX3kgLSB3aWR0aCk7Ci0gICAgICAgICAgICAgICAgICAgIGQgPSAoKChDIC0gQikgPDwgMikgKyBBX0QpOwotCi0gICAgICAgICAgICAgICAgICAgIGlmIChkIDwgMCkKLSAgICAgICAgICAgICAgICAgICAgewotICAgICAgICAgICAgICAgICAgICAgICAgZDEgPSAtKC1kID4+IDMpOwotICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGQxIDwgLShzdHJlbmd0aCA8PCAxKSkKLSAgICAgICAgICAgICAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBkMSA9IDA7Ci0gICAgICAgICAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgICAgICAgICBlbHNlIGlmIChkMSA8IC1zdHJlbmd0aCkKLSAgICAgICAgICAgICAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBkMSA9IC1kMSAtIChzdHJlbmd0aCA8PCAxKTsKLSAgICAgICAgICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICAgICAgICAgIGQxXzIgPSAtZDEgPj4gMTsKLSAgICAgICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgICAgICBlbHNlCi0gICAgICAgICAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAgICAgICAgIGQxID0gZCA+PiAzOwotICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGQxID4gKHN0cmVuZ3RoIDw8IDEpKQotICAgICAgICAgICAgICAgICAgICAgICAgewotICAgICAgICAgICAgICAgICAgICAgICAgICAgIGQxID0gMDsKLSAgICAgICAgICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICAgICAgICAgIGVsc2UgaWYgKGQxID4gc3RyZW5ndGgpCi0gICAgICAgICAgICAgICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgZDEgPSAoc3RyZW5ndGggPDwgMSkgLSBkMTsKLSAgICAgICAgICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICAgICAgICAgIGQxXzIgPSBkMSA+PiAxOwotICAgICAgICAgICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgICAgICAgICAgaWYgKEFfRCA8IDApCi0gICAgICAgICAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAgICAgICAgIGQyID0gLSgtQV9EID4+IDIpOwotICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGQyIDwgLWQxXzIpCi0gICAgICAgICAgICAgICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgZDIgPSAtZDFfMjsKLSAgICAgICAgICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgICAgICBlbHNlCi0gICAgICAgICAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAgICAgICAgIGQyID0gQV9EID4+IDI7Ci0gICAgICAgICAgICAgICAgICAgICAgICBpZiAoZDIgPiBkMV8yKQotICAgICAgICAgICAgICAgICAgICAgICAgewotICAgICAgICAgICAgICAgICAgICAgICAgICAgIGQyID0gZDFfMjsKLSAgICAgICAgICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICAgICAgfQotCi0gICAgICAgICAgICAgICAgICAgICoocmVjX3kgLSB3aWR0aDIpID0gQSAtIGQyOwotICAgICAgICAgICAgICAgICAgICB0bXB2YXIgPSBCICsgZDE7Ci0gICAgICAgICAgICAgICAgICAgIENMSVBfUkVTVUxUKHRtcHZhcikKLSAgICAgICAgICAgICAgICAgICAgKihyZWNfeSAtIHdpZHRoKSA9IHRtcHZhcjsKLSAgICAgICAgICAgICAgICAgICAgdG1wdmFyID0gQyAtIGQxOwotICAgICAgICAgICAgICAgICAgICBDTElQX1JFU1VMVCh0bXB2YXIpCi0gICAgICAgICAgICAgICAgICAgICpyZWNfeSA9IHRtcHZhcjsKLSAgICAgICAgICAgICAgICAgICAgKihyZWNfeSArIHdpZHRoKSA9IEQgKyBkMjsKLSAgICAgICAgICAgICAgICAgICAgcmVjX3krKzsKLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICB9Ci0gICAgICAgICAgICBlbHNlCi0gICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgcmVjX3kgKz0gYl9zaXplOwotICAgICAgICAgICAgfQotICAgICAgICAgICAgbWJudW0rKzsKLSAgICAgICAgfQotICAgICAgICByZWNfeSArPSAoKGJfc2l6ZSAtIDEpICogd2lkdGgpOwotCi0gICAgfQotCi0KLSAgICAvKioqKioqKioqKioqKioqKioqKioqKioqKioqSE9SSVpPTlRBTCBGSUxURVJJTkcgKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0gICAgbWJudW0gPSAwOwotICAgIC8qIEhPUklaT05UQUwgSU5ORVIgKi8KLSAgICBpZiAoIWNocikKLSAgICB7Ci0gICAgICAgIHJlY195ID0gcmVjICsgODsKLSAgICAgICAgb2Zmc2V0ID0gd2lkdGggKiBiX3NpemUgLSBiX3NpemU7Ci0KLSAgICAgICAgZm9yIChpID0gMDsgaSA8IG5NQlBlckNvbDsgaSsrKQotICAgICAgICB7Ci0gICAgICAgICAgICBmb3IgKGogPSAwOyBqIDwgbk1CUGVyUm93OyBqKyspCi0gICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgaWYgKG1vZGVbbWJudW1dICE9IE1PREVfU0tJUFBFRCkKLSAgICAgICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgICAgIGsgPSAxNjsKLSAgICAgICAgICAgICAgICAgICAgc3RyZW5ndGggPSBTVFJFTkdUSF90YWJbUVBfc3RvcmVbbWJudW1dXTsKLSAgICAgICAgICAgICAgICAgICAgd2hpbGUgKGstLSkKLSAgICAgICAgICAgICAgICAgICAgewotICAgICAgICAgICAgICAgICAgICAgICAgQSA9ICAqKHJlY195IC0gMik7Ci0gICAgICAgICAgICAgICAgICAgICAgICBEID0gICoocmVjX3kgKyAxKTsKLSAgICAgICAgICAgICAgICAgICAgICAgIEFfRCA9IEEgLSBEOwotICAgICAgICAgICAgICAgICAgICAgICAgQyA9ICpyZWNfeTsKLSAgICAgICAgICAgICAgICAgICAgICAgIEIgPSAqKHJlY195IC0gMSk7Ci0gICAgICAgICAgICAgICAgICAgICAgICBkID0gKCgoQyAtIEIpIDw8IDIpICsgQV9EKTsKLQotICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGQgPCAwKQotICAgICAgICAgICAgICAgICAgICAgICAgewotICAgICAgICAgICAgICAgICAgICAgICAgICAgIGQxID0gLSgtZCA+PiAzKTsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoZDEgPCAtKHN0cmVuZ3RoIDw8IDEpKQotICAgICAgICAgICAgICAgICAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZDEgPSAwOwotICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBlbHNlIGlmIChkMSA8IC1zdHJlbmd0aCkKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGQxID0gLWQxIC0gKHN0cmVuZ3RoIDw8IDEpOwotICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBkMV8yID0gLWQxID4+IDE7Ci0gICAgICAgICAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgICAgICAgICBlbHNlCi0gICAgICAgICAgICAgICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgZDEgPSBkID4+IDM7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGQxID4gKHN0cmVuZ3RoIDw8IDEpKQotICAgICAgICAgICAgICAgICAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZDEgPSAwOwotICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBlbHNlIGlmIChkMSA+IHN0cmVuZ3RoKQotICAgICAgICAgICAgICAgICAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZDEgPSAoc3RyZW5ndGggPDwgMSkgLSBkMTsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgZDFfMiA9IGQxID4+IDE7Ci0gICAgICAgICAgICAgICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgICAgICAgICAgICAgIGlmIChBX0QgPCAwKQotICAgICAgICAgICAgICAgICAgICAgICAgewotICAgICAgICAgICAgICAgICAgICAgICAgICAgIGQyID0gLSgtQV9EID4+IDIpOwotICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChkMiA8IC1kMV8yKQotICAgICAgICAgICAgICAgICAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZDIgPSAtZDFfMjsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgICAgICAgICBlbHNlCi0gICAgICAgICAgICAgICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgZDIgPSBBX0QgPj4gMjsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoZDIgPiBkMV8yKQotICAgICAgICAgICAgICAgICAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZDIgPSBkMV8yOwotICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgICAgICAgICAgICAgKihyZWNfeSAtIDIpID0gQSAtIGQyOwotICAgICAgICAgICAgICAgICAgICAgICAgdG1wdmFyID0gQiArIGQxOwotICAgICAgICAgICAgICAgICAgICAgICAgQ0xJUF9SRVNVTFQodG1wdmFyKQotICAgICAgICAgICAgICAgICAgICAgICAgKihyZWNfeSAtIDEpID0gdG1wdmFyOwotICAgICAgICAgICAgICAgICAgICAgICAgdG1wdmFyID0gQyAtIGQxOwotICAgICAgICAgICAgICAgICAgICAgICAgQ0xJUF9SRVNVTFQodG1wdmFyKQotICAgICAgICAgICAgICAgICAgICAgICAgKnJlY195ID0gdG1wdmFyOwotICAgICAgICAgICAgICAgICAgICAgICAgKihyZWNfeSArIDEpID0gRCArIGQyOwotICAgICAgICAgICAgICAgICAgICAgICAgcmVjX3kgKz0gd2lkdGg7Ci0gICAgICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICAgICAgcmVjX3kgLT0gb2Zmc2V0OwotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICBlbHNlCi0gICAgICAgICAgICAgICAgewotICAgICAgICAgICAgICAgICAgICByZWNfeSArPSBiX3NpemU7Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgIG1ibnVtKys7Ci0gICAgICAgICAgICB9Ci0gICAgICAgICAgICByZWNfeSArPSAoMTUgKiB3aWR0aCk7Ci0KLSAgICAgICAgfQotICAgIH0KLQotCi0KLSAgICAvKiBIT1JJWk9OVEFMIEVER0UgKi8KLSAgICByZWNfeSA9IHJlYyArIGJfc2l6ZTsKLSAgICBvZmZzZXQgPSB3aWR0aCAqIGJfc2l6ZSAtIGJfc2l6ZTsKLSAgICBtYm51bSA9IDE7Ci0gICAgZm9yIChpID0gMDsgaSA8IG5NQlBlckNvbDsgaSsrKQotICAgIHsKLSAgICAgICAgZm9yIChqID0gMDsgaiA8IG5NQlBlclJvdyAtIDE7IGorKykKLSAgICAgICAgewotICAgICAgICAgICAgaWYgKG1vZGVbbWJudW1dICE9IE1PREVfU0tJUFBFRCB8fCBtb2RlW21ibnVtLTFdICE9IE1PREVfU0tJUFBFRCkKLSAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICBrID0gYl9zaXplOwotICAgICAgICAgICAgICAgIGlmIChtb2RlW21ibnVtXSAhPSBNT0RFX1NLSVBQRUQpCi0gICAgICAgICAgICAgICAgewotICAgICAgICAgICAgICAgICAgICBzdHJlbmd0aCA9IFNUUkVOR1RIX3RhYlsoYW5uZXhfVCA/ICBNUV9jaHJvbWFfUVBfdGFibGVbUVBfc3RvcmVbbWJudW1dXSA6IFFQX3N0b3JlW21ibnVtXSldOwotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICBlbHNlCi0gICAgICAgICAgICAgICAgewotICAgICAgICAgICAgICAgICAgICBzdHJlbmd0aCA9IFNUUkVOR1RIX3RhYlsoYW5uZXhfVCA/ICBNUV9jaHJvbWFfUVBfdGFibGVbUVBfc3RvcmVbbWJudW0gLSAxXV0gOiBRUF9zdG9yZVttYm51bSAtIDFdKV07Ci0gICAgICAgICAgICAgICAgfQotCi0gICAgICAgICAgICAgICAgd2hpbGUgKGstLSkKLSAgICAgICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgICAgIEEgPSAgKihyZWNfeSAtIDIpOwotICAgICAgICAgICAgICAgICAgICBEID0gICoocmVjX3kgKyAxKTsKLSAgICAgICAgICAgICAgICAgICAgQV9EID0gQSAtIEQ7Ci0gICAgICAgICAgICAgICAgICAgIEMgPSAqcmVjX3k7Ci0gICAgICAgICAgICAgICAgICAgIEIgPSAqKHJlY195IC0gMSk7Ci0gICAgICAgICAgICAgICAgICAgIGQgPSAoKChDIC0gQikgPDwgMikgKyBBX0QpOwotCi0gICAgICAgICAgICAgICAgICAgIGlmIChkIDwgMCkKLSAgICAgICAgICAgICAgICAgICAgewotICAgICAgICAgICAgICAgICAgICAgICAgZDEgPSAtKC1kID4+IDMpOwotICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGQxIDwgLShzdHJlbmd0aCA8PCAxKSkKLSAgICAgICAgICAgICAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBkMSA9IDA7Ci0gICAgICAgICAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgICAgICAgICBlbHNlIGlmIChkMSA8IC1zdHJlbmd0aCkKLSAgICAgICAgICAgICAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBkMSA9IC1kMSAtIChzdHJlbmd0aCA8PCAxKTsKLSAgICAgICAgICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICAgICAgICAgIGQxXzIgPSAtZDEgPj4gMTsKLSAgICAgICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgICAgICBlbHNlCi0gICAgICAgICAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAgICAgICAgIGQxID0gZCA+PiAzOwotICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGQxID4gKHN0cmVuZ3RoIDw8IDEpKQotICAgICAgICAgICAgICAgICAgICAgICAgewotICAgICAgICAgICAgICAgICAgICAgICAgICAgIGQxID0gMDsKLSAgICAgICAgICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICAgICAgICAgIGVsc2UgaWYgKGQxID4gc3RyZW5ndGgpCi0gICAgICAgICAgICAgICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgZDEgPSAoc3RyZW5ndGggPDwgMSkgLSBkMTsKLSAgICAgICAgICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICAgICAgICAgIGQxXzIgPSBkMSA+PiAxOwotICAgICAgICAgICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgICAgICAgICAgaWYgKEFfRCA8IDApCi0gICAgICAgICAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAgICAgICAgIGQyID0gLSgtQV9EID4+IDIpOwotICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGQyIDwgLWQxXzIpCi0gICAgICAgICAgICAgICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgZDIgPSAtZDFfMjsKLSAgICAgICAgICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgICAgICBlbHNlCi0gICAgICAgICAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAgICAgICAgIGQyID0gQV9EID4+IDI7Ci0gICAgICAgICAgICAgICAgICAgICAgICBpZiAoZDIgPiBkMV8yKQotICAgICAgICAgICAgICAgICAgICAgICAgewotICAgICAgICAgICAgICAgICAgICAgICAgICAgIGQyID0gZDFfMjsKLSAgICAgICAgICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICAgICAgfQotCi0gICAgICAgICAgICAgICAgICAgICoocmVjX3kgLSAyKSA9IEEgLSBkMjsKLSAgICAgICAgICAgICAgICAgICAgdG1wdmFyID0gQiArIGQxOwotICAgICAgICAgICAgICAgICAgICBDTElQX1JFU1VMVCh0bXB2YXIpCi0gICAgICAgICAgICAgICAgICAgICoocmVjX3kgLSAxKSA9IHRtcHZhcjsKLSAgICAgICAgICAgICAgICAgICAgdG1wdmFyID0gQyAtIGQxOwotICAgICAgICAgICA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W5nLiAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0gICAgICAgICAgICBwb3N0bW9kZSAmPSAweEU7Ci0KLSAgICAgICAgICAgIC8qIERlcmluZ2luZyBpcyBlbmFibGVkIGlmIGFueSBub256ZXJvIGVsZW1lbnRzIGV4aXN0IGluICovCi0gICAgICAgICAgICAvKiBwb3NpdGlvbnMgb3RoZXIgdGhhbiBxX2Jsb2NrWzBdLCBxX2Jsb2NrWzFdIG9yICAgICAgICAqLwotICAgICAgICAgICAgLyogcV9ibG9ja1tCX1NJWkVdLiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLSAgICAgICAgICAgIHBvc3Rtb2RlIHw9IDB4NDsKLQotICAgICAgICAgICAgYnJlYWs7Ci0gICAgICAgIH0KLSAgICB9Ci0KLSAgICAvKiBIb3Jpem9udGFsIGRlYmxvY2tpbmcgYml0IGlzIGVuYWJsZWQgd2hlbiBvbmx5IHRoZSBlbnRpcmUgZmFyICovCi0gICAgLyogbGVmdCBjb2x1bW4sIGkuZS4sIHFfYmxvY2tbbipCX1NJWkVdLCBuID0gMCwgLi4uLCBCX1NJWkUtMSwgICAqLwotICAgIC8qIGFyZSBub24temVyby4gU2luY2UgaW5pdGlhbCBhc3N1bXB0aW9uIGlzIHRoYXQgYWxsIGVsZW1lbnRzLCAgKi8KLSAgICAvKiBleGNlcHQgcV9ibG9ja1swXSwgaXMgemVybywgd2UgbmVlZCB0byBjaGVjayB0aGUgcmVtYWluaW5nICAgICovCi0gICAgLyogZWxlbWVudHMgaW4gdGhlIGZhciBsZWZ0IGNvbHVtbiB0byBkZXRlcm1pbmUgaWYgYWxsIG9yIHNvbWUgICAqLwotICAgIC8qIGFyZSBub24temVyby4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLSAgICBpZiAocV9ibG9ja1tCX1NJWkVdKQotICAgIHsKLSAgICAgICAgLyogQXQgdGhpcyBwb2ludCwgb25seSBxX2Jsb2NrWzBdIGFuZCBxX2Jsb2NrW0JfU0laRV0gYXJlIG5vbi16ZXJvLCAqLwotICAgICAgICAvKiB3aGlsZSBxX2Jsb2NrW24qQl9TSVpFXSwgbiA9IDIsIDMsLi4uLCBCX1NJWkUtMSwgYXJlIHplcm8uICAgICAgICovCi0gICAgICAgIC8qIFRoZXJlZm9yZSwgd2UgbmVlZCB0byBkaXNhYmxlIGhvcml6b250YWwgZGVibG9ja2luZy4gICAgICAgICAgICAgKi8KLSAgICAgICAgcG9zdG1vZGUgJj0gMHhEOwotICAgIH0KLQotICAgIGZvciAoaSA9IDE2OyBpIDwgTkNPRUZGX0JMT0NLOyBpICs9IEJfU0laRSkKLSAgICB7Ci0gICAgICAgIGlmIChxX2Jsb2NrW2ldKQotICAgICAgICB7Ci0gICAgICAgICAgICAvKiBDaGVjayBpZiBxX2Jsb2NrW25dLCBuID0gMipCX1NJWkUsLi4uLChCX1NJWkUtMSkqQl9TSVpFLCAgKi8KLSAgICAgICAgICAgIC8qIGFyZSBub24temVyby4gSWYgYW55IG9mIHRoZW0gdHVybiBvdXQgdG8gYmUgbm9uLXplcm8sICAgICAqLwotICAgICAgICAgICAgLyogd2UgbmVlZCB0byBkaXNhYmxlIGhvcml6b250YWwgZGVibG9ja2luZy4gICAgICAgICAgICAgICAgICovCi0gICAgICAgICAgICBwb3N0bW9kZSAmPSAweEQ7Ci0KLSAgICAgICAgICAgIC8qIERlcmluZ2luZyBpcyBlbmFibGVkIGlmIGFueSBub256ZXJvIGVsZW1lbnRzIGV4aXN0IGluICovCi0gICAgICAgICAgICAvKiBwb3NpdGlvbnMgb3RoZXIgdGhhbiBxX2Jsb2NrWzBdLCBxX2Jsb2NrWzFdIG9yICAgICAgICAqLwotICAgICAgICAgICAgLyogcV9ibG9ja1tCX1NJWkVdLiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLSAgICAgICAgICAgIHBvc3Rtb2RlIHw9IDB4NDsKLQotICAgICAgICAg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gIHBvc3Rtb2RlICY9IDB4QzsKLQotICAgICAgICAgICAgICAgICAgICAvKiBEZXJpbmdpbmcgaXMgZW5hYmxlZCBpZiBhbnkgbm9uemVybyBlbGVtZW50cyBleGlzdCBpbiAqLwotICAgICAgICAgICAgICAgICAgICAvKiBwb3NpdGlvbnMgb3RoZXIgdGhhbiBxX2Jsb2NrWzBdLCBxX2Jsb2NrWzFdIG9yICAgICAgICAqLwotICAgICAgICAgICAgICAgICAgICAvKiBxX2Jsb2NrW0JfU0laRV0uICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotICAgICAgICAgICAgICAgICAgICBwb3N0bW9kZSB8PSAweDQ7Ci0KLSAgICAgICAgICAgICAgICAgICAgLyogU2V0IG91dGVyIEZPUiBsb29wIGNvdW50IHRvIEJfU0laRSB0byBnZXQgb3V0IG9mICovCi0gICAgICAgICAgICAgICAgICAgIC8qIG91dGVyIEZPUiBsb29wICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotICAgICAgICAgICAgICAgICAgICBpID0gQl9TSVpFOwotCi0gICAgICAgICAgICAgICAgICAgIC8qIEdldCBvdXQgb2YgaW5uZXIgRk9SIGxvb3AgKi8KLSAgICAgICAgICAgICAgICAgICAgYnJlYWs7Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgfQotICAgICAgICB9Ci0gICAgfQotCi0gICAgLyotLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tCi0gICAgOyBSZXR1cm4gbm90aGluZyBvciBkYXRhIG9yIGRhdGEgcG9pbnRlcgotICAgIC0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0qLwotICAgIHJldHVybiAocG9zdG1vZGUpOwotfQotCi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S0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0qLwotCi0gICAgICAgIC8qIDA5LzI4LzIwMDAsIG1vZGlmeSBzZW1hcGhvcmUgcHJvcGFnYXRpb24gdG8gKi8KLSAgICAgICAgLyogYWNjb21tb2RhdGUgc21hcnQgaW5kZXhpbmcgKi8KLSAgICAgICAgbW12eCA9IHhwcmVkID4+IDQ7ICAvKiBibG9jayB4IGNvb3IgKi8KLSAgICAgICAgbm12eCA9IG1tdng7Ci0KLSAgICAgICAgbW12eSA9IHlwcmVkID4+IDQ7ICAvKiBibG9jayB5IGNvb3IgKi8KLSAgICAgICAgbm12eSA9IG1tdnk7Ci0KLSAgICAgICAgLyogQ2hlY2sgaWYgTVYgaXMgb3V0c2lkZSB0aGUgZnJhbWUgKi8KLSAgICAgICAgaWYgKG12X2xvYyA9PSAxKQotICAgICAgICB7Ci0gICAgICAgICAgICAvKiBQZXJmb3JtIGJvdW5kYXJ5IGNoZWNrICovCi0gICAgICAgICAgICBpZiAobm12eCA8IDApCi0gICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgbm12eCA9IDA7Ci0gICAgICAgICAgICB9Ci0gICAgICAgICAgICBlbHNlIGlmIChubXZ4ID4gbXZ3aWR0aCAtIDEpCi0gICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgbm12eCA9IG12d2lkdGggLSAxOwotICAgICAgICAgICAgfQotCi0gICAgICAgICAgICBpZiAobm12eSA8IDApCi0gICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgbm12eSA9IDA7Ci0gICAgICAgICAgICB9Ci0gICAgICAgICAgICBlbHNlIGlmIChubXZ5ID4gKGhlaWdodCA+PiA0KSAtIDEpCi0gICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgbm12eSA9IChoZWlnaHQgPj4gNCkgLSAxOwotICAgICAgICAgICAgfQotICAgICAgICB9Ci0KLSAgICAgICAgLyogQ2FsY3VsYXRlIHBvaW50ZXIgd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b21pbmFuY2UgVk9QICAqLwotICAgICAgICAvKiBpcyAobnVtYmVyIG9mIHBpeGVscyBpbiBMdW1pbmFuY2UgVk9QLzQpLCBhbmQgdGhlcmUgYXJlIDY0ICAgICAqLwotICAgICAgICAvKiBwaXhlbHMgaW4gYW4gOHg4IENocm9taW5hbmNlIGJsb2NrLCB0aGUgb2Zmc2V0IGNhbiBiZSAgICAgICovCi0gICAgICAgIC8qIGNhbGN1bGF0ZWQgYXM6ICAgICAgICAgICAgICAgICAgICAgICAgICovCi0gICAgICAgIC8qICBtdl9sb2MgPSAobnVtYmVyIG9mIHBpeGVscyBpbiBMdW1pbmFuY2UgVk9QLyg0KjY0KSkgICAqLwotICAgICAgICAvKiAgICAgICAgID0gc2l6ZS8yNTYgPSBzaXplPj44ICAgICAgICAgICAgICAgKi8KLSAgICAgICAgbXZfbG9jID0gKHNpemUgPj4gOCk7Ci0KLSAgICAgICAgLyogIDExLzMvMDAsIGNoYW5nZSB0aGUgcHJvcGFnYXRpb24gZm9yIGRlYmxvY2tpbmcgKi8KLSAgICAgICAgaWYgKG1za19kZWJsb2NrID09IDApCi0gICAgICAgIHsKLQotICAgICAgICAgICAgLyogRGVibG9ja2luZyBzZW1hcGhvcmUgcHJvcGFnYXRpb24gZm9yIENocm9taW5hbmNlICovCi0gICAgICAgICAgICAvKiBiIHNlbWFwaG9yZXMgICAgICAgICAgICAgICAgICAgICAqLwotICAgICAgICAgICAgKihwcF9kZWNfdSkgPSAwOwotCi0gICAgICAgICAgICAvKiBBZHZhbmNlIG9mZnNldCB0byBwb2ludCB0byBDaHJvbWluYW5jZSByIHNlbWFwaG9yZXMgKi8KLSAgICAgICAgICAgIHBwX2RlY191ICs9IG12X2xvYzsKLQotICAgICAgICAgICAgLyogRGVibG9ja2luZyBzZW1hcGhvcmUgcHJvcGFnYXRpb24gZm9yIENocm9taW5hbmNlICovCi0gICAgICAgICAgICAvKiByIHNlbWFwaG9yZXMgICAgICAgICAgICAgICAgICAgICAqLwotICAgICAgICAgICAgKihwcF9kZWNfdSkgPSAwOwotICAgICAgICB9Ci0gICAgICAgIGVsc2UKLSAgICAgICAgewotICAgICAgICAgICAgLyogRGVyaW5naW5nIHNlbWFwaG9yZSBwcm9wYWdhdGlvbiBmb3IgQ2hyb21pbmFuY2UgQiBibG9jayAqLwotICAgICAgICAgICAgaWYgKCgqKHBwX2RlY191KSY0KSA9PSAwKQotICAgICAgICAgICAgewotICAgICAgICAgICAgICAgICoocHBfZGVjX3UpIHw9ICgoKihwcF9wcmV2MSkgfCAqKHBwX3ByZXYyKSB8Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqKHBwX3ByZXYzKSB8ICoocHBfcHJldjQpKSAmIDB4NCk7Ci0gICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgIC8qIEFkdmFuY2Ugb2Zmc2V0IHRvIHBvaW50IHRvIENocm9taW5hbmNlIHIgc2VtYXBob3JlcyAqLwotICAgICAgICAgICAgcHBfZGVjX3UgKz0gbXZfbG9jOwotICAgICAgICAgICAgcHBfcHJldjEgKz0gbXZfbG9jOwotICAgICAgICAgICAgcHBfcHJldjIgKz0gbXZfbG9jOwotICAgICAgICAgICAgcHBfcHJldjMgKz0gbXZfbG9jOwotICAgICAgICAgICAgcHBfcHJldjQgKz0gbXZfbG9jOwotCi0gICAgICAgICAgICAvKiBEZXJpbmdpbmcgc2VtYXBob3JlIHByb3BhZ2F0aW9uIGZvciBDaHJvbWluYW5jZSBSICovCi0gICAgICAgICAgICBpZiAoKCoocHBfZGVjX3UpJjQpID09IDApCi0gICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgKihwcF9kZWNfdSkgfD0gKCgqKHBwX3ByZXYxKSB8ICoocHBfcHJldjIpIHwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICoocHBfcHJldjMpIHwgKihwcF9wcmV2NCkpICYgMHg0KTsKLSAgICAgICAgICAgIH0KLSAgICAgICAgfQotCi0gICAgICAgIC8qLS0tLS0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tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLQotICAgIDsgRlVOQ1RJT04gQ09ERQotICAgIC0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0qLwotICAgIHVpbnQ4IHBwX3NlbWFwaG9yZV9sdW1hKAotICAgICAgICBpbnQgeHByZWQsICAgICAgLyogaSAqLwotICAgICAgICBpbnQgeXByZWQsICAgICAgLyogaSAqLwotICAgICAgICB1aW50OCAgICpwcF9kZWNfeSwgIC8qIGkvbyAqLwotICAgICAgICB1aW50OCAgICpwc3RwcmNUeXBQcnYsICAvKiBpICovCi0gICAgICAgIGludCAqbGwsICAgICAgICAvKiBpICovCi0gICAgICAgIGludCAqbXZfbG9jLCAgICAvKiBpL28gKi8KLSAgICAgICAgaW50IGR4LCAgICAgLyogaSAqLwotICAgICAgICBpbnQgZHksICAgICAvKiBpICovCi0gICAgICAgIGludCBtdndpZHRoLCAgICAvKiBpICovCi0gICAgICAgIGludCB3aWR0aCwgICAgICAvKiBpICovCi0gICAgICAgIGludCBoZWlnaHQgICAgICAvKiBpICovCi0gICAgKQotICAgIHsKLSAgICAgICAgLyotLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tCi0gICAgICAgIDsgRGVmaW5lIGFsbCBsb2NhbCB2YXJpYWJsZXMKLSAgICAgICAgLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSovCi0gICAgICAgIGludCBraywgbW12eSwgbW12eCwgbm12eCwgbm12eTsKLSAgICAgICAgdWludDggICAqcHBfcHJldjEsICpwc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sb2MgPSAwOwotCi0gICAgICAgICAgICAvKiBDYWxjdWxhdGUgYmxvY2sgeCBjb29yZGluYXRlLiBEaXZpZGUgYnkgMTYgaXMgZm9yICAqLwotICAgICAgICAgICAgLyogY29udmVydGluZyBoYWxmLXBpeGVsIHJlc29sdXRpb24gdG8gYmxvY2sgICAgICAgICAgKi8KLSAgICAgICAgICAgIG1tdnggPSB4cHJlZCA+PiA0OwotCi0gICAgICAgICAgICAvKiBDYWxjdWxhdGUgYmxvY2sgeSBjb29yZGluYXRlLiBEaXZpZGUgYnkgMTYgaXMgZm9yICovCi0gICAgICAgICAgICAvKiBjb252ZXJ0aW5nIGhhbGYtcGl4ZWwgcmVzb2x1dGlvbiB0byBibG9jayAgICAgICAgICovCi0gICAgICAgICAgICBtbXZ5ID0geXByZWQgPj4gNDsKLQotICAgICAgICAgICAgLyogRmluZCBwb3N0IHByb2Nlc3Npbmcgc2VtYXBob3JlIGxvY2F0aW9uIGZvciBibG9jayAqLwotICAgICAgICAgICAgLyogdXNlZCBmb3IgcHJlZGljdGlvbiwgaS5lLiwgICAgICAgICAgICAgICAgKi8KLSAgICAgICAgICAgIC8qIHBwX3ByZXYxID0gJnBzdHByY1R5cFBydlttbXZ5Km12d2lkdGhdW21tdnhdICAgICAgKi8KLSAgICAgICAgICAgIHBwX3ByZXYxID0gcHN0cHJjVHlwUHJ2ICsgbW12eCArIG1tdnkgKiBtdndpZHRoOwotCi0gICAgICAgICAgICAvKiBDaGVjayBpZiBNViBpcyBhIG11bHRpcGxlIG9mIDE2ICovCi0gICAgICAgICAgICBpZiAoKGR4JjB4RikgIT0gMCkKLSAgICAgICAgICAgIHsgICAvKiBkeCBpcyBub3QgYSBtdWx0aXBsZSBvZiAxNiAqLwotCi0gICAgICAgICAgICAgICAgLyogcHBfcHJldjIgaXMgdGhlIGJsb2NrIHRvIHRoZSByaWdodCBvZiAqLwotICAgICAgICAgICAgICAgIC8qIHBwX3ByZXYxIGJsb2NrICAgICAgICAgICAgKi8KLSAgICAgICAgICAgICAgICBwcF9wcmV2MiA9IHBwX3ByZXYxICsgMTsKLQotICAgICAgICAgICAgICAgIGlmICgoZHkmMHhGKSAhPSAwKQotICAgICAgICAgICAgICAgIHsgICAvKiBkeSBpcyBub3QgYSBtdWx0aXBsZSBvZiAxNiAqLwotCi0gICAgICAgICAgICAgICAgICAgIC8qIHBwX3ByZXYzIGlzIHRoZSBibG9jayBiZWxvdyAqLwotICAgICAgICAgICAgICAgICAgICAvKiBwcF9wcmV2MSBibG9jayAgICAgICAgICAqLwotICAgICAgICAgICAgICAgICAgICBwcF9wcmV2MyA9IHBwX3ByZXYxICsgbXZ3aWR0aDsKLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgZWxzZQotICAgICAgICAgICAgICAgIHsgICAvKiBkeSBpcyBhIG11bHRpcGxlIG9mIDE2ICovCi0KLSAgICAgICAgICAgICAgICAgICAgcHBfcHJldjMgPSBwcF9wcmV2MTsKLSAgICAgICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgICAgICAvKiBwcF9wcmV2NCBpcyB0aGUgYmxvY2sgdG8gdGhlIHJpZ2h0IG9mICovCi0gICAgICAgICAgICAgICAgLyogcHBfcHJldjMgYmxvY2suICAgICAgICAgICAqLwotICAgICAgICAgICAgICAgIHBwX3ByZXY0ID0gcHBfcHJldjMgKyAxOwotICAgICAgICAgICAgfQotICAgICAgICAgICAgZWxzZQotICAgICAgICAgICAgeyAgIC8qIGR4IGlzIGEgbXVsdGlwbGUgb2YgMTYgKi8KLQotICAgICAgICAgICAgICAgIHBwX3ByZXYyID0gcHBfcHJldjE7Ci0KLSAgICAgICAgICAgICAgICBpZiAoKGR5JjB4RikgIT0gMCkKLSAgICAgICAgICAgICAgICB7ICAgLyogZHkgaXMgbm90IGEgbXVsdGlwbGUgb2YgMTYgKi8KLQotICAgICAgICAgICAgICAgICAgICAvKiBwcF9wcmV2MyBpcyB0aGUgYmxvY2sgYmVsb3cgKi8KLSAgICAgICAgICAgICAgICAgICAgLyogcHBfcHJldjEgYmxvY2suICAgICAgICAgKi8KLSAgICAgICAgICAgICAgICAgICAgcHBfcHJldjMgPSBwcF9wcmV2MSArIG12d2lkdGg7Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgIGVsc2UKLSAgICAgICAgICAgICAgICB7ICAgLyogZHkgaXMgYSBtdWx0aXBsZSBvZiAxNiAqLwotCi0gICAgICAgICAgICAgICAgICAgIHBwX3ByZXYzID0gcHBfcHJldjE7Ci0gICAgICAgICAgICAgICAgICAgIG1za19kZWJsb2NrID0gMHgzOwotICAgICAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgICAgIHBwX3ByZXY0ID0gcHBfcHJldjM7Ci0gICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgIC8qIFBlcmZvcm0gcG9zdCBwcm9jZXNzaW5nIHNlbWFwaG9yZSBwcm9wYWdhdGlvbiBmb3IgZWFjaCAqLwotICAgICAgICAgICAgLyogb2YgdGhlIDQgYmxvY2tzIGluIGEgTUIuICAgICAgICAgICAgICAgKi8KLSAgICAgICAgICAgIGZvciAoa2sgPSAwOyBrayA8IDQ7IGtrKyspCi0gICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgLyogRGVyaW5naW5nIHNlbWFwaG9yZSBwcm9wYWdhdGlvbiAqLwotICAgICAgICAgICAgICAgIGlmICgoKihwcF9kZWNfeSkgJiA0KSA9PSAwKQotICAgICAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAgICAgKihwcF9kZWNfeSkgfD0gKCgqKHBwX3ByZXYxKSB8ICoocHBfcHJldjIpIHwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqKHBwX3ByZXYzKSB8ICoocHBfcHJldjQpKSAmIDB4NCk7Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgIC8qIERlYmxvY2tpbmcgc2VtYXBob3JlIHByb3BhZ2F0aW9uICovCi0gICAgICAgICAgICAgICAgLyogIDExLzMvMDAsIGNoYW5nZSB0aGUgcHJvcGFnYXRpb24gZm9yIGRlYmxvY2tpbmcgKi8KLSAgICAgICAgICAgICAgICBpZiAobXNrX2RlYmxvY2sgPT0gMCkKLSAgICAgICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgICAgICoocHBfZGVjX3kpID0gMDsKLSAgICAgICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgICAgICBwcF9kZWNfeSArPSBsbFtra107Ci0gICAgICAgICAgICAgICAgcHBfcHJldjEgKz0gbGxba2tdOwotICAgICAgICAgICAgICAgIHBwX3ByZXYyICs9IGxsW2trXTsKLSAgICAgICAgICAgICAgICBwcF9wcmV2MyArPSBsbFtra107Ci0gICAgICAgICAgICAgICAgcHBfcHJldjQgKz0gbGxba2tdOwotICAgICAgICAgICAgfQotCi0gICAgICAgIH0KLSAgICAgICAgZWxzZQotICAgICAgICB7ICAgLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLSAgICAgICAgICAgIC8qICh4LHkpIGlzIG91dHNpZGUgdGhlIGZyYW1lICovCi0gICAgICAgICAgICAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotCi0gICAgICAgICAgICAvKiAgMTAvMjQvMjAwMCBwb3N0X3Byb2Nlc3Npbmcgc2VtYXBob3JlICovCi0gICAgICAgICAgICAvKiBnZW5lcmF0aW9uICovCi0KLSAgICAgICAgICAgIC8qICAxMC8yMy8yMDAwIGJvdW5kYXJ5IGNoZWNraW5nKi8KLSAgICAgICAgICAgICptdl9sb2MgPSAxOwotCi0gICAgICAgICAgICAvKiBQZXJmb3JtIHBvc3QgcHJvY2Vzc2luZyBzZW1hcGhvcmUgcHJvcGFnYXRpb24gZm9yIGVhY2ggKi8KLSAgICAgICAgICAgIC8qIG9mIHRoZSA0IGJsb2NrcyBpbiBhIE1CLiAgICAgICAgICAgICAgICovCi0gICAgICAgICAgICBmb3IgKGtrID0gMDsga2sgPCA0OyBraysrKQotICAgICAgICAgICAgewotICAgICAgICAgICAgICAgIC8qIENhbGN1bGF0ZSBibG9jayB4IGNvb3JkaW5hdGUgYW5kIHJvdW5kICg/KS4gICovCi0gICAgICAgICAgICAgICAgLyogRGl2aWRlIGJ5IDE2IGlzIGZvciBjb252ZXJ0aW5nIGhhbGYtcGl4ZWwgICAgKi8KLSAgICAgICAgICAgICAgICAvKiByZXNvbHV0aW9uIHRvIGJsb2NrLiAgICAgICAgICAgICAqLwotICAgICAgICAgICAgICAgIG1tdnggPSAoeHByZWQgKyAoKGtrICYgMSkgPDwgMykpID4+IDQ7Ci0gICAgICAgICAgICAgICAgbm12eCA9IG1tdng7Ci0KLSAgICAgICAgICAgICAgICAvKiBDYWxjdWxhdGUgYmxvY2sgeSBjb29yZGluYXRlIGFuZCByb3VuZCAoPykuICAqLwotICAgICAgICAgICAgICAgIC8qIERpdmlkZSBieSAxNiBpcyBmb3IgY29udmVydGluZyBoYWxmLXBpeGVsICAgICovCi0gICAgICAgICAgICAgICAgLyogcmVzb2x1dGlvbiB0byBibG9jay4gICAgICAgICAgICAgKi8KLSAgICAgICAgICAgICAgICBtbXZ5ID0gKHlwcmVkICsgKChrayAmIDIpIDw8IDIpKSA+PiA0OwotICAgICAgICAgICAgICAgIG5tdnkgPSBtbXZ5OwotCi0gICAgICAgICAgICAgICAgLyogUGVyZm9ybSBib3VuZGFyeSBjaGVja2luZyAqLwotICAgICAgICAgICAgICAgIGlmIChubXZ4IDwgMCkKLSAgICAgICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgICAgIG5tdnggPSAwOwotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICBlbHNlIGlmIChubXZ4ID4gbXZ3aWR0aCAtIDEpCi0gICAgICAgICAgICAgICAgewotICAgICAgICAgICAgICAgICAgICBubXZ4ID0gbXZ3aWR0aCAtIDE7Ci0gICAgICAgICAgICAgICAgfQotCi0gICAgICAgICAgICAgICAgaWYgKG5tdnkgPCAwKQotICAgICAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAgICAgbm12eSA9IDA7Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgIGVsc2UgaWYgKG5tdnkgPiAoaGVpZ2h0ID4+IDMpIC0gMSkKLSAgICAgICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgICAgIG5tdnkgPSAoaGVpZ2h0ID4+IDMpIC0gMTsKLSAgICAgICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgICAgICAvKiBGaW5kIHBvc3QgcHJvY2Vzc2luZyBzZW1hcGhvcmUgbG9jYXRpb24gZm9yIGJsb2NrICovCi0gICAgICAgICAgICAgICAgLyogdXNlZCBmb3IgcHJlZGljdGlvbiwgaS5lLiwgICAgICAgICAgICAgICAgKi8KLSAgICAgICAgICAgICAgICAvKiBwcF9wcmV2MSA9ICZwc3RwcmNUeXBQcnZbbm12eSptdndpZHRoXVtubXZ4XSAgICAgICovCi0gICAgICAgICAgICAgICAgcHBfcHJldjEgPSBwc3RwcmNUeXBQcnYgKyBubXZ4ICsgbm12eSAqIG12d2lkdGg7Ci0KLSAgICAgICAgICAgICAgICAvKiBDaGVjayBpZiB4IGNvbXBvbmVudCBvZiBNViBpcyBhIG11bHRpcGxlIG9mIDE2ICAgICovCi0gICAgICAgICAgICAgICAgLyogYW5kIGNoZWNrIGlmIGJsb2NrIHggY29vcmRpbmF0ZSBpcyBvdXQgb2YgYm91bmRzICAqLwotICAgICAgICAgICAgICAgIGlmICgoKGR4JjB4RikgIT0gMCkgJiYgKG1tdnggKyAxIDwgbXZ3aWR0aCAtIDEpKQotICAgICAgICAgICAgICAgIHsgICAvKiBkeCBpcyBub3QgYSBtdWx0aXBsZSBvZiAxNiBhbmQgdGhlIGJsb2NrICovCi0gICAgICAgICAgICAgICAgICAgIC8qIHggY29vcmRpbmF0ZSBpcyB3aXRoaW4gdGhlIGJvdW5kcyAgICAgICAgKi8KLQotICAgICAgICAgICAgICAgICAgICAvKiBwcF9wcmV2MiBpcyB0aGUgYmxvY2sgdG8gdGhlIHJpZ2h0IG9mICovCi0gICAgICAgICAgICAgICAgICAgIC8qIHBwX3ByZXYxIGJsb2NrICAgICAgICAgICAgKi8KLSAgICAgICAgICAgICAgICAgICAgcHBfcHJldjIgPSBwcF9wcmV2MSArIDE7Ci0KLSAgICAgICAgICAgICAgICAgICAgLyogQ2hlY2sgaWYgeSBjb21wb25lbnQgb2YgTVYgaXMgYSBtdWx0aXBsZSAqLwotICAgICAgICAgICAgICAgICAgICAvKiBvZiAxNiBhbmQgY2hlY2sgaWYgYmxvY2sgeSBjb29yZGluYXRlIGlzICovCi0gICAgICAgICAgICAgICAgICAgIC8qIG91dCBvZiBib3VuZHMgICAgICAgICAgICAgICAgKi8KLSAgICAgICAgICAgICAgICAgICAgaWYgKCgoZHkmMHhGKSAhPSAwKSAmJiAobW12eSArIDEgPCAoaGVpZ2h0ID4+IDMpIC0gMSkpCi0gICAgICAgICAgICAgICAgICAgIHsgICAvKiBkeSBpcyBub3QgYSBtdWx0aXBsZSBvZiAxNiBhbmQgKi8KLSAgICAgICAgICAgICAgICAgICAgICAgIC8qIHRoZSBibG9jayB5IGNvb3JkaW5hdGUgaXMgICAgICAqLwotICAgICAgICAgICAgICAgICAgICAgICAgLyogd2l0aGluIHRoZSBib3VuZHMgICAgICAgICAgICAgICovCi0KLSAgICAgICAgICAgICAgICAgICAgICAgIC8qIHBwX3ByZXYzIGlzIHRoZSBibG9jayBiZWxvdyAqLwotICAgICAgICAgICAgICAgICAgICAgICAgLyogcHBfcHJldjEgYmxvY2sgICAgICAgICAgKi8KLSAgICAgICAgICAgICAgICAgICAgICAgIHBwX3ByZXYzID0gcHBfcHJldjEgKyBtdndpZHRoOwotCi0gICAgICAgICAgICAgICAgICAgICAgICAvKiBhbGwgcHJlZGljdGlvbiBhcmUgZnJvbSBkaWZmZXJlbnQgYmxvY2tzICovCi0gICAgICAgICAgICAgICAgICAgICAgICBtc2tfZGVibG9jayA9IDB4MzsKLSAgICAgICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgICAgICBlbHNlCi0gICAgICAgICAgICAgICAgICAgIHsgICAvKiBkeSBpcyBhIG11bHRpcGxlIG9mIDE2IG9yIHRoZSBibG9jayAqLwotICAgICAgICAgICAgICAgICAgICAgICAgLyogeSBjb29yZGluYXRlIGlzIG91dCBvZiBib3VuZHMgICAgICAgKi8KLQotICAgICAgICAgICAgICAgICAgICAgICAgcHBfcHJldjMgPSBwcF9wcmV2MTsKLSAgICAgICAgICAgICAgICAgICAgfQotCi0gICAgICAgICAgICAgICAgICAgIC8qIHBwX3ByZXY0IGlzIHRoZSBibG9jayB0byB0aGUgcmlnaHQgb2YgKi8KLSAgICAgICAgICAgICAgICAgICAgLyogcHBfcHJldjMgYmxvY2suICAgICAgICAgICAqLwotICAgICAgICAgICAgICAgICAgICBwcF9wcmV2NCA9IHBwX3ByZXYzICsgMTsKLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgZWxzZQotICAgICAgICAgICAgICAgIHsgICAvKiBkeCBpcyBhIG11bHRpcGxlIG9mIDE2IG9yIHRoZSBibG9jayB4ICovCi0gICAgICAgICAgICAgICAgICAgIC8qIGNvb3JkaW5hdGUgaXMgb3V0IG9mIGJvdW5kcyAgICAgICAgICAgKi8KLQotICAgICAgICAgICAgICAgICAgICBwcF9wcmV2MiA9IHBwX3ByZXYxOwotCi0gICAgICAgICAgICAgICAgICAgIC8qIENoZWNrIGlmIHkgY29tcG9uZW50IG9mIE1WIGlzIGEgbXVsdGlwbGUgKi8KLSAgICAgICAgICAgICAgICAgICAgLyogb2YgMTYgYW5kIGNoZWNrIGlmIGJsb2NrIHkgY29vcmRpbmF0ZSBpcyAqLwotICAgICAgICAgICAgICAgICAgICAvKiBvdXQgb2YgYm91bmRzICAgICAgICAgICAgICAgICovCi0gICAgICAgICAgICAgICAgICAgIGlmICgoKGR5JjB4RikgIT0gMCkgJiYgKG1tdnkgKyAxIDwgKGhlaWdodCA+PiAzKSAtIDEpKQotICAgICAgICAgICAgICAgICAgICB7ICAgLyogZHkgaXMgbm90IGEgbXVsdGlwbGUgb2YgMTYgYW5kICovCi0gICAgICAgICAgICAgICAgICAgICAgICAvKiB0aGUgYmxvY2sgeSBjb29yZGluYXRlIGlzICAgICAgKi8KLSAgICAgICAgICAgICAgICAgICAgICAgIC8qIHdpdGhpbiB0aGUgYm91bmRzICAgICAgICAgICAgICAqLwotCi0gICAgICAgICAgICAgICAgICAgICAgICAvKiBwcF9wcmV2MyBpcyB0aGUgYmxvY2sgYmVsb3cgKi8KLSAgICAgICAgICAgICAgICAgICAgICAgIC8qIHBwX3ByZXYxIGJsb2NrLiAgICAgICAgICovCi0gICAgICAgICAgICAgICAgICAgICAgICBwcF9wcmV2MyA9IHBwX3ByZXYxICsgbXZ3aWR0aDsKLSAgICAgICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgICAgICBlbHNlCi0gICAgICAgICAgICAgICAgICAgIHsgICAvKiBkeSBpcyBhIG11bHRpcGxlIG9mIDE2IG9yIHRoZSBibG9jayAqLwotICAgICAgICAgICAgICAgICAgICAgICAgLyogeSBjb29yZGluYXRlIGlzIG91dCBvZiBib3VuZHMgICAgICAgKi8KLQotICAgICAgICAgICAgICAgICAgICAgICAgcHBfcHJldjMgPSBwcF9wcmV2MTsKLSAgICAgICAgICAgICAgICAgICAgfQotCi0gICAgICAgICAgICAgICAgICAgIHBwX3ByZXY0ID0gcHBfcHJldjM7Ci0gICAgICAgICAgICAgICAgfQotCi0gICAgICAgICAgICAgICAgLyogRGVyaW5naW5nIHNlbWFwaG9yZSBwcm9wYWdhdGlvbiAqLwotICAgICAgICAgICAgICAgIGlmICgoKihwcF9kZWNfeSkmNCkgPT0gMCkKLSAgICAgICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgICAgICoocHBfZGVjX3kpIHw9ICgoKihwcF9wcmV2MSkgfAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICoocHBfcHJldjIpIHwgKihwcF9wcmV2MykgfAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICoocHBfcHJldjQpKSAmIDB4NCk7Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgIC8qIERlYmxvY2tpbmcgc2VtYXBob3JlIHByb3BhZ2F0aW9uICovCi0gICAgICAgICAgICAgICAgLyogIDExLzMvMDAsIGNoYW5nZSB0aGUgcHJvcGFnYT0gKi8KLSAgICAgICAgICAgICAgICAvKiB0aW9uIGZvciBkZWJsb2NraW5nICovCi0gICAgICAgICAgICAgICAgaWYgKG1za19kZWJsb2NrID09IDApCi0gICAgICAgICAgICAgICAgewotICAgICAgICAgICAgICAgICAgICAqKHBwX2RlY195KSA9IDA7Ci0gICAgICAgICAgICAgICAgfQotCi0gICAgICAgICAgICAgICAgcHBfZGVjX3kgKz0gbGxba2tdOwotICAgICAgICAgICAgfQotICAgICAgICB9Ci0KLSAgICAgICAgLyotLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tCi0gICAgICAgIDsgUmV0dXJuIG5vdGhpbmcgb3IgZGF0YSBvciBkYXRhIHBvaW50ZXIKLSAgICAgICAgLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSovCi0gICAgICAgIHJldHVybiAobXNrX2RlYmxvY2spOwotICAgIH0KLSNpZmRlZiBfX2NwbHVzcGx1cwotfQotI2VuZGlmCi0jZW5kaWYKZGlmZiAtLWdpdCBhL21lZGlhL2xpYnN0YWdlZnJpZ2h0L2NvZGVjcy9tNHZfaDI2My9kZWMvc3JjL3B2ZGVjX2FwaS5jcHAgYi9tZWRpYS9saWJzdGFnZWZyaWdodC9jb2RlY3MvbTR2X2gyNjMvZGVjL3NyYy9wdmRlY19hcGkuY3B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GVvWzRdOwotZXh0ZXJuIHR5cGVEQ1N0b3JlICAgICAgICAgIElNRU1fcHJlZERDW1FDSUZfTUJTXTsKLWV4dGVybiB0eXBlRENBQ1N0b3JlICAgICAgICBJTUVNX3ByZWREQ0FDX2NvbFtRQ0lGX01CX1JPV1MrMV07Ci0KLWV4dGVybiBWaWRlb0RlY0RhdGEgICAgICAgICBJTUVNX1ZpZGVvRGVjRGF0YVsxXTsKLWV4dGVybiBWb3AgICAgICAgICAgICAgICAgICBJTUVNX2N1cnJWb3BbMV07Ci1leHRlcm4gVm9wICAgICAgICAgICAgICAgICAgSU1FTV9wcmV2Vm9wWzFdOwotZXh0ZXJuIFBJWEVMICAgICAgICAgICAgICAgIElNRU1fY3VyclZvcF95Q2hhbltRQ0lGX01CUyoxMjgqM107Ci1leHRlcm4gUElYRUwgICAgICAgICAgICAgICAgSU1FTV9wcmV2Vm9wX3lDaGFuW1FDSUZfTUJTKjEyOCozXTsKLWV4dGVybiB1aW50OCAgICAgICAgICAgICAgICBJTUVNX3BzdHByY1R5cEN1cls2KlFDSUZfTUJTXTsKLWV4dGVybiB1aW50OCAgICAgICAgICAgICAgICBJTUVNX3BzdHByY1R5cFBydls2KlFDSUZfTUJTXTsKLQotCi1leHRlcm4gVm9wICAgICAgICAgICAgICAgICAgSU1FTV92b3BIRUFERVJbMl07Ci1leHRlcm4gVm9sICAgICAgICAgICAgICAgICAgSU1FTV9WT0xbMl07Ci1leHRlcm4gVm9wICAgICAgICAgICAgICAgICAgSU1FTV92b3BIZWFkZXJbMl1bMV07Ci1leHRlcm4gVm9sICAgICAgICAgICAgICAgICAgSU1FTV92b2xbMl1bMV07Ci0KLSNlbmRpZgotCi0vKiA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0gKi8KLS8qICBGdW5jdGlvbiA6IFBWSW5pdFZpZGVvRGVjb2RlcigpICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogIERhdGUgICAgIDogMDQvMTEvMjAwMCwgMDgvMjkvMjAwMCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgUHVycG9zZSAgOiBJbml0aWFsaXphdGlvbiBvZiB0aGUgTVBFRy00IHZpZGVvIGRlY29kZXIgbGlicmFyeS4gICAgICAgICAgKi8KLS8qICAgICAgICAgICAgIFRoZSByZXR1cm4gdHlwZSBpcyBCb29sIGluc3RlYWQgb2YgUFZfU1RBVFVTIGJlY2F1c2UgICAgICAgICAqLwotLyogICAgICAgICAgICAgd2UgZG9uJ3Qgd2FudCB0byBleHBvc2UgUFZfU1RBVFVTIHRvIChvdXRzaWRlKSBwcm9ncmFtbWVycyAgICovCi0vKiAgICAgICAgICAgICB0aGF0IHVzZSBvdXIgZGVjb2RlciBsaWJyYXJ5IFNESy4gICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICBJbi9vdXQgICA6ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogIFJldHVybiAgIDogUFZfVFJVRSBpZiBzdWNjZXNzZWQsIFBWX0ZBTFNFIGlmIGZhaWxlZC4gICAgICAgICAgICAgICAgICAgICovCi0vKiAgTW9kaWZpZWQgOiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PSAqLwotT1NDTF9FWFBPUlRfUkVGIEJvb2wgUFZJbml0VmlkZW9EZWNvZGVyKFZpZGVvRGVjQ29udHJvbHMgKmRlY0N0cmwsIHVpbnQ4ICp2b2xidWZbXSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpbnQzMiAqdm9sYnVmX3NpemUsIGludCBuTGF5Z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YXllcnMpOwotI2VuZGlmCi0gICAgICAgIGlmICh2aWRlby0+dm9wSGVhZGVyID09IE5VTEwpIHN0YXR1cyA9IFBWX0ZBTFNFOwotICAgICAgICBlbHNlIG9zY2xfbWVtc2V0KHZpZGVvLT52b3BIZWFkZXIsIDAsIHNpemVvZihWb3AgKikqbkxheWVycyk7Ci0gICAgICAgIHZpZGVvLT5tZW1vcnlVc2FnZSArPSAoc2l6ZW9mKFZvcCAqKSAqIG5MYXllcnMpOwotCi0gICAgICAgIHZpZGVvLT5pbml0aWFsaXplZCA9IFBWX0ZBTFNFOwotICAgICAgICAvKiBEZWNvZGUgdGhlIGhlYWRlciB0byBnZXQgYWxsIGluZm9ybWF0aW9uIHRvIGFsbG9jYXRlIGRhdGEgKi8KLSAgICAgICAgaWYgKHN0YXR1cyA9PSBQVl9UUlVFKQotICAgICAgICB7Ci0gICAgICAgICAgICAvKiBpbml0aWFsaXplIGRlY29kZWQgZnJhbWUgY291bnRlci4gICAwNC8yNC8yMDAxICovCi0gICAgICAgICAgICB2aWRlby0+ZnJhbWVfaWR4ID0gLTE7Ci0KLQotICAgICAgICAgICAgZm9yIChpZHggPSAwOyBpZHggPCBuTGF5ZXJzOyBpZHgrKykKLSAgICAgICAgICAgIHsKLQotI2lmZGVmIERFQ19JTlRFUk5BTF9NRU1PUllfT1BUCi0gICAgICAgICAgICAgICAgdmlkZW8tPnZvcEhlYWRlcltpZHhdID0gSU1FTV92b3BIZWFkZXJbaWR4XTsKLSNlbHNlCi0gICAgICAgICAgICAgICAgdmlkZW8tPnZvcEhlYWRlcltpZHhdID0gKFZvcCAqKSBvc2NsX21hbGxvYyhzaXplb2YoVm9wKSk7Ci0jZW5kaWYKLSAgICAgICAgICAgICAgICBpZiAodmlkZW8tPnZvcEhlYWRlcltpZHhdID09IE5VTEwpCi0gICAgICAgICAgICAgICAgewotICAgICAgICAgICAgICAgICAgICBzdGF0dXMgPSBQVl9GQUxTRTsKLSAgICAgICAgICAgICAgICAgICAgYnJlYWs7Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgIGVsc2UKLSAgICAgICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgICAgIG9zY2xfbWVtc2V0KHZpZGVvLT52b3BIZWFkZXJbaWR4XSwgMCwgc2l6ZW9mKFZvcCkpOwotICAgICAgICAgICAgICAgICAgICB2aWRlby0+dm9wSGVhZGVyW2lkeF0tPnRpbWVTdGFtcCA9IDA7Ci0gICAgICAgICAgICAgICAgICAgIHZpZGVvLT5tZW1vcnlVc2FnZSArPSAoc2l6ZW9mKFZvcCkpOwotICAgICAgICAgICAgICAgIH0KLSNpZmRlZiBERUNfSU5URVJOQUxfTUVNT1JZX09QVAotICAgICAgICAgICAgICAgIHZpZGVvLT52b2xbaWR4XSA9IElNRU1fdm9sW2lkeF07Ci0gICAgICAgICAgICAgICAgdmlkZW8tPm1lbW9yeVVzYWdlICs9IHNpemVvZihWb2wpOwotICAgICAgICAgICAgICAgIG9zY2xfbWVtc2V0KHZpZGVvLT52b2xbaWR4XSwgMCwgc2l6ZW9mKFZvbCkpOwotICAgICAgICAgICAgICAgIGlmICh2aWRlby0+dm9sW2lkeF0gPT0gTlVMTCkgc3RhdHVzID0gUFZfRkFMU0U7Ci0gICAgICAgICAgICAgICAgc3RyZWFtID0gSU1FTV9CaXRzdHJlYW1EZWNWaWRlbzsKLSNlbHNlCi0gICAgICAgICAgICAgICAgdmlkZW8tPnZvbFtpZHhdID0gKFZvbCAqKSBvc2NsX21hbGxvYyhzaXplb2YoVm9sKSk7Ci0gICAgICAgICAgICAgICAgaWYgKHZpZGVvLT52b2xbaWR4XSA9PSBOVUxMKQotICAgICAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAgICAgc3RhdHVzID0gUFZfRkFMU0U7Ci0gICAgICAgICAgICAgICAgICAgIGJyZWFrOwotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICBlbHNlCi0gICAgICAgICAgICAgICAgewotICAgICAgICAgICAgICAgICAgICB2aWRlby0+bWVtb3J5VXNhZ2UgKz0gc2l6ZW9mKFZvbCk7Ci0gICAgICAgICAgICAgICAgICAgIG9zY2xfbWVtc2V0KHZpZGVvLT52b2xbaWR4XSwgMCwgc2l6ZW9mKFZvbCkpOwotICAgICAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgICAgIHN0cmVhbSA9IChCaXRzdHJlYW1EZWNWaWRlbyAqKSBvc2NsX21hbGxvYyhzaXplb2YoQml0c3RyZWFtRGVjVmlkZW8pKTsKLSNlbmRpZgotICAgICAgICAgICAgICAgIHZpZGVvLT5tZW1vcnlVc2FnZSArPSBzaXplb2YoQml0c3RyZWFtRGVjVmlkZW8pOwotICAgICAgICAgICAgICAgIGlmIChzdHJlYW0gPT0gTlVMTCkKLSAgICAgICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgICAgIHN0YXR1cyA9IFBWX0ZBTFNFOwotICAgICAgICAgICAgICAgICAgICBicmVhazsKLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgZWxzZQotICAgICAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAgICAgaW50MzIgYnVmZmVyX3NpemU7Ci0gICAgICAgICAgICAgICAgICAgIGlmICgoYnVmZmVyX3NpemUgPSBCaXRzdHJlYW1PcGVuKHN0cmVhbSwgaWR4KSkgPCAwKQotICAgICAgICAgICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgICAgICAgICBtcDRkZWNfbG9nKCJJbml0VmlkZW9EZWNvZGVyKCk6IENhbid0IGFsbG9jYXRlIGJpdHN0cmVhbSBidWZmZXIuXG4iKTsKLSAgICAgICAgICAgICAgICAgICAgICAgIHN0YXR1cyA9IFBWX0ZBTFNFOwotICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7Ci0gICAgICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICAgICAgdmlkZW8tPm1lbW9yeVVzYWdlICs9IGJ1ZmZlcl9zaXplOwotICAgICAgICAgICAgICAgICAgICB2aWRlby0+dm9sW2lkeF0tPmJpdHN0cmVhbSA9IHN0cmVhbTsKLSAgICAgICAgICAgICAgICAgICAgdmlkZW8tPnZvbFtpZHhdLT52b2xJRCA9IGlkeDsKLSAgICAgICAgICAgICAgICAgICAgdmlkZW8tPnZvbFtpZHhdLT50aW1lSW5jX29mZnNldCA9IDA7ICAvKiAgMTEvMTIvMDEgKi8KLSAgICAgICAgICAgICAgICAgICAgdmlkZW8tPnZsY0RlY0NvZWZmSW50cmEgPSAmVmxjRGVjVENPRUZTaG9ydEhlYWRlcjsKLSAgICAgICAgICAgICAgICAgICAgdmlkZW8tPnZsY0RlY0NvZWZmSW50ZXIgPSAmVmxjRGVjVENPRUZTaG9ydEhlYWRlcjsKLSAgICAgICAgICAgICAgICAgICAgaWYgKG1vZGUgPT0gTVBFRzRfTU9ERSkKLSAgICAgICAgICAgICAgICAgICAgewotICAgICAgICAgICAgICAgICAgICAgICAgLyogU2V0IHVwIFZPTCBoZWFkZXIgYml0c3RyZWFtIGZvciBmcmFtZS1iYXNlZCBkZWNvZGluZy4gIDA4LzMwLzIwMDAgKi8KLSAgICAgICAgICAgICAgICAgICAgICAgIEJpdHN0cmVhbVJlc2V0KHN0cmVhbSwgZGVjQ3RybC0+dm9sYnVmW2lkeF0sIGRlY0N0cmwtPnZvbGJ1Zl9zaXplW2lkeF0pOwotCi0gICAgICAgICAgICAgICAgICAgICAgICBzd2l0Y2ggKERlY29kZVZPTEhlYWRlcih2aWRlbywgaWR4KSkKLSAgICAgICAgICAgICAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBjYXNlIFBWX1NVQ0NFU1MgOgotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoc3RhdHVzID09IFBWX1RSVUUpCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzdGF0dXMgPSBQVl9UUlVFOyAgIC8qICB3ZSB3YW50IHRvIG1ha2Ugc3VyZSB0aGF0IGlmIGZpcnN0IGxheWVyIGlzIGJhZCwgc2Vjb25kIGxheWVyIGlzIGdvb2QgcmV0dXJuIFBWX0ZBSUwgKi8KLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZWxzZQotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc3RhdHVzID0gUFZfRkFMU0U7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOwotI2lmZGVmIFBWX1RPTEVSQVRFX1ZPTF9FUlJPUlMKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBjYXNlIFBWX0JBRF9WT0xIRUFERVI6Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHN0YXR1cyA9IFBWX1RSVUU7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOwotI2VuZGlmCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgZGVmYXVsdCA6Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHN0YXR1cyA9IFBWX0ZBTFNFOwotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKLSAgICAgICAgICAgICAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgICAgIGVsc2UKLSAgICAgICAgICAgICAgICAgICAgewotICAgICAgICAgICAgICAgICAgICAgICAgdmlkZW8tPnNob3J0VmlkZW9IZWFkZXIgPSBQVl9UUlVFOwotICAgICAgICAgICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgICAgICAgICAgaWYgKHZpZGVvLT5zaG9ydFZpZGVvSGVhZGVyID09IFBWX1RSVUUpCi0gICAgICAgICAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAgICAgICAgIG1vZGUgPSBIMjYzX01PREU7Ci0gICAgICAgICAgICAgICAgICAgICAgICAvKiBTZXQgbWF4IHdpZHRoIGFuZCBoZWlnaHQuICBJbiBILjI2MyBtb2RlLCB3ZSB1c2UgICAgKi8KLSAgICAgICAgICAgICAgICAgICAgICAgIC8qICB2b2xidWZfc2l6ZVswXSB0byBwYXNzIGluIHdpZHRoIGFuZCB2b2xidWZfc2l6ZVsxXSAqLwotICAgICAgICAgICAgICAgICAgICAgICAgLyogIHRvIHBhc3MgaW4gaGVpZ2h0LiAgICAgICAgICAgICAgICAgICAgMDQvMjMvMjAwMSAqLwotICAgICAgICAgICAgICAgICAgICAgICAgdmlkZW8tPnByZXZWb3AtPnRlbXBvcmFsUmVmID0gMDsgLyogIDExLzEyLzAxICovCi0gICAgICAgICAgICAgICAgICAgICAgICAvKiBDb21wdXRlIHNvbWUgY29udmVuaWVuY2UgdmFyaWFibGVzOiAgIDA0LzIzLzIwMDEgKi8KLSAgICAgICAgICAgICAgICAgICAgICAgIHZpZGVvLT52b2xbaWR4XS0+cXVhbnRUeXBlID0gMDsKLSAgICAgICAgICAgICAgICAgICAgICAgIHZpZGVvLT52b2xbaWR4XS0+cXVhbnRQcmVjaXNpb24gPSA1OwotICAgICAgICAgICAgICAgICAgICAgICAgdmlkZW8tPnZvbFtpZHhdLT5lcnJvclJlc0Rpc2FibGUgPSAxOwotICAgICAgICAgICAgICAgICAgICAgICAgdmlkZW8tPnZvbFtpZHhdLT5kYXRhUGFydGl0aW9uaW5nID0gMDsKLSAgICAgICAgICAgICAgICAgICAgICAgIHZpZGVvLT52b2xbaWR4XS0+dXNlUmV2ZXJzZVZMQyA9IDA7Ci0gICAgICAgICAgICAgICAgICAgICAgICB2aWRlby0+aW50cmFfYWNkY1ByZWREaXNhYmxlID0gMTsKLSAgICAgICAgICAgICAgICAgICAgICAgIHZpZGVvLT52b2xbaWR4XS0+c2NhbGFiaWxpdHkgPSAwOwotICAgICAgICAgICAgICAgICAgICAgICAgdmlkZW8tPnNpemUgPSAoaW50MzIpd2lkdGggKiBoZWlnaHQ7Ci0KLSAgICAgICAgICAgICAgICAgICAgICAgIHZpZGVvLT5kaXNwbGF5V2lkdGggPS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b0RlY29kZXIoKSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogIERhdGUgICAgIDogMDEvMTQvMjAwMiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgUHVycG9zZSAgOiBSZXNldCB2aWRlbyB0aW1lc3RhbXBzICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICBJbi9vdXQgICA6ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogIFJldHVybiAgIDogUFZfVFJVRSBpZiBzdWNjZXNzZWQsIFBWX0ZBTFNFIGlmIGZhaWxlZC4gICAgICAgICAgICAgICAgICAgICovCi0vKiAgTW9kaWZpZWQgOiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PSAqLwotQm9vbCBQVlJlc2V0VmlkZW9EZWNvZGVyKFZpZGVvRGVjQ29udHJvbHMgKmRlY0N0cmwpCi17Ci0gICAgVmlkZW9EZWNEYXRhICp2aWRlbyA9IChWaWRlb0RlY0RhdGEgKikgZGVjQ3RybC0+dmlkZW9EZWNvZGVyRGF0YTsKLSAgICBpbnQgaWR4OwotCi0gICAgZm9yIChpZHggPSAwOyBpZHggPCBkZWNDdHJsLT5uTGF5ZXJzOyBpZHgrKykKLSAgICB7Ci0gICAgICAgIHZpZGVvLT52b3BIZWFkZXJbaWR4XS0+dGltZVN0YW1wID0gMDsKLSAgICB9Ci0gICAgdmlkZW8tPnByZXZWb3AtPnRpbWVTdGFtcCA9IDA7Ci0gICAgaWYgKGRlY0N0cmwtPm5MYXllcnMgPiAxKQotICAgICAgICB2aWRlby0+cHJldkVuaGNWb3AtPnRpbWVTdGFtcCA9IDA7Ci0KLSAgICBvc2NsX21lbXNldCh2aWRlby0+bWJsb2NrLT5ibG9jaywgMCwgc2l6ZW9mKGludDE2KSo2Kk5DT0VGRl9CTE9DSyk7IC8vICBBdWcgMjMsMjAwNQotCi0gICAgcmV0dXJuIFBWX1RSVUU7Ci19Ci0KLQotLyogPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09ICovCi0vKiAgRnVuY3Rpb24gOiBQVkNsZWFuVXBWaWRlb0RlY29kZXIoKSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICBEYXRlICAgICA6IDA0LzExLzIwMDAsIDA4LzI5LzIwMDAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogIFB1cnBvc2UgIDogQ2xlYW51cCBvZiB0aGUgTVBFRy00IHZpZGVvIGRlY29kZXIgbGlicmFyeS4gICAgICAgICAgICAgICAgICovCi0vKiAgSW4vb3V0ICAgOiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICBSZXR1cm4gICA6IFBWX1RSVUUgaWYgc3VjY2Vzc2VkLCBQVl9GQUxTRSBpZiBmYWlsZWQuICAgICAgICAgICAgICAgICAgICAqLwotLyogIE1vZGlmaWVkIDogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0gKi8KLU9TQ0xfRVhQT1JUX1JFRiBCb29sIFBWQ2xlYW5VcFZpZGVvRGVjb2RlcihWaWRlb0RlY0NvbnRyb2xzICpkZWNDdHJsKQotewotICAgIGludCBpZHg7Ci0gICAgVmlkZW9EZWNEYXRhICp2aWRlbyA9IChWaWRlb0RlY0RhdGEgKikgZGVjQ3RybC0+dmlkZW9EZWNvZGVyRGF0YTsKLSNpZmRlZiBERUNfSU5URVJOQUxfTUVNT1JZX09QVAotICAgIGlmICh2aWRlbykKLSAgICB7Ci0jaWZkZWYgUFZfUE9TVFBST0NfT04KLSAgICAgICAgdmlkZW8tPnBzdHByY1R5cEN1ciA9IE5VTEw7Ci0gICAgICAgIHZpZGVvLT5wc3RwcmNUeXBQcnYgPSBOVUxMOwotI2VuZGlmCi0KLSAgICAgICAgdmlkZW8tPmFjUHJlZEZsYWcgICAgICAgPSBOVUxMOwotICAgICAgICB2aWRlby0+c2xpY2VObyAgICAgICAgICA9IE5VTEw7Ci0gICAgICAgIHZpZGVvLT5tb3RYICAgICAgICAgICAgID0gTlVMTDsKLSAgICAgICAgdmlkZW8tPm1vdFkgICAgICAgICAgICAgPSBOVUxMOwotICAgICAgICB2aWRlby0+bWJsb2NrICAgICAgICAgICA9IE5VTEw7Ci0gICAgICAgIHZpZGVvLT5RUE1CICAgICAgICAgICAgID0gTlVMTDsKLSAgICAgICAgdmlkZW8tPnByZWREQyAgICAgICAgICAgPSBOVUxMOwotICAgICAgICB2aWRlby0+cHJlZERDQUNfcm93ICAgICA9IE5VTEw7Ci0gICAgICAgIHZpZGVvLT5wcmVkRENBQ19jb2wgICAgID0gTlVMTDsKLSAgICAgICAgdmlkZW8tPmhlYWRlckluZm8uTW9kZSAgPSBOVUxMOwotICAgICAgICB2aWRlby0+aGVhZGVySW5mby5DQlAgICA9IE5VTEw7Ci0gICAgICAgIGlmICh2aWRlby0+bnVtYmVyT2ZMYXllcnMgPiAxKQotICAgICAgICB7Ci0gICAgICAgICAgICBpZiAodmlkZW8tPnByZXZFbmhjVm9wKQotICAgICAgICAgICAgewotICAgICAgICAgICAgICAgIHZpZGVvLT5wcmV2RW5oY1ZvcC0+dUNoYW4gPSBOVUxMOwotICAgICAgICAgICAgICAgIHZpZGVvLT5wcmV2RW5oY1ZvcC0+dkNoYW4gPSBOVUxMOwotICAgICAgICAgICAgICAgIGlmICh2aWRlby0+cHJldkVuaGNWb3AtPnlDaGFuKSBvc2NsX2ZyZWUodmlkZW8tPnByZXZFbmhjVm9wLT55Q2hhbik7Ci0gICAgICAgICAgICAgICAgb3NjbF9mcmVlKHZpZGVvLT5wcmV2RW5oY1ZvcCk7Ci0gICAgICAgICAgICB9Ci0gICAgICAgIH0KLSAgICAgICAgaWYgKHZpZGVvLT5jdXJyVm9wKQotICAgICAgICB7Ci0gICAgICAgICAgICB2aWRlby0+Y3VyclZvcC0+dUNoYW4gPSBOVUxMOwotICAgICAgICAgICAgdmlkZW8tPmN1cnJWb3AtPnZDaGFuID0gTlVMTDsKLSAgICAgICAgICAgIGlmICh2aWRlby0+Y3VyclZvcC0+eUNoYW4pCi0gICAgICAgICAgICAgICAgdmlkZW8tPmN1cnJWb3AtPnlDaGFuID0gTlVMTDsKLSAgICAgICAgICAgIHZpZGVvLT5jdXJyVm9wID0gTlVMTDsKLSAgICAgICAgfQotICAgICAgICBpZiAodmlkZW8tPnByZXZWb3ApCi0gICAgICAgIHsKLSAgICAgICAgICAgIHZpZGVvLT5wcmV2Vm9wLT51Q2hhbiA9IE5VTEw7Ci0gICAgICAgICAgICB2aWRlby0+cHJldlZvcC0+dkNoYW4gPSBOVUxMOwotICAgICAgICAgICAgaWYgKHZpZGVvLT5wcmV2Vm9wLT55Q2hhbikKLSAgICAgICAgICAgICAgICB2aWRlby0+cHJldlZvcC0+eUNoYW4gPSBOVUxMOwotICAgICAgICAgICAgdmlkZW8tPnByZXZWb3AgPSBOVUxMOwotICAgICAgICB9Ci0KLSAgICAgICAgaWYgKHZpZGVvLT52b2wpCi0gICAgICAgIHsKLSAgICAgICAgICAgIGZvciAoaWR4ID0gMDsgaWR4IDwgdmlkZW8tPm51bWJlck9mTGF5ZXJzOyBpZHgrKykKLSAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICBpZiAodmlkZW8tPnZvbFtpZHhdKQotICAgICAgICA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KLSAgICAgICAgICAgIHZpZGVvLT5jdXJyVm9wLT51Q2hhbiA9IE5VTEw7Ci0gICAgICAgICAgICB2aWRlby0+Y3VyclZvcC0+dkNoYW4gPSBOVUxMOwotICAgICAgICAgICAgaWYgKHZpZGVvLT5jdXJyVm9wLT55Q2hhbikKLSAgICAgICAgICAgICAgICBvc2NsX2ZyZWUodmlkZW8tPmN1cnJWb3AtPnlDaGFuKTsKLSNlbmRpZgotICAgICAgICAgICAgb3NjbF9mcmVlKHZpZGVvLT5jdXJyVm9wKTsKLSAgICAgICAgfQotICAgICAgICBpZiAodmlkZW8tPnByZXZWb3ApCi0gICAgICAgIHsKLSNpZm5kZWYgUFZfTUVNT1JZX1BPT0wKLSAgICAgICAgICAgIHZpZGVvLT5wcmV2Vm9wLT51Q2hhbiA9IE5VTEw7Ci0gICAgICAgICAgICB2aWRlby0+cHJldlZvcC0+dkNoYW4gPSBOVUxMOwotICAgICAgICAgICAgaWYgKHZpZGVvLT5wcmV2Vm9wLT55Q2hhbikKLSAgICAgICAgICAgICAgICBvc2NsX2ZyZWUodmlkZW8tPnByZXZWb3AtPnlDaGFuKTsKLSNlbmRpZgotICAgICAgICAgICAgb3NjbF9mcmVlKHZpZGVvLT5wcmV2Vm9wKTsKLSAgICAgICAgfQotCi0gICAgICAgIGlmICh2aWRlby0+dm9sKQotICAgICAgICB7Ci0gICAgICAgICAgICBmb3IgKGlkeCA9IDA7IGlkeCA8IHZpZGVvLT5udW1iZXJPZkxheWVyczsgaWR4KyspCi0gICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgaWYgKHZpZGVvLT52b2xbaWR4XSkKLSAgICAgICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgICAgIGlmICh2aWRlby0+dm9sW2lkeF0tPmJpdHN0cmVhbSkKLSAgICAgICAgICAgICAgICAgICAgewotICAgICAgICAgICAgICAgICAgICAgICAgQml0c3RyZWFtQ2xvc2UodmlkZW8tPnZvbFtpZHhdLT5iaXRzdHJlYW0pOwotICAgICAgICAgICAgICAgICAgICAgICAgb3NjbF9mcmVlKHZpZGVvLT52b2xbaWR4XS0+Yml0c3RyZWFtKTsKLSAgICAgICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgICAgICBvc2NsX2ZyZWUodmlkZW8tPnZvbFtpZHhdKTsKLSAgICAgICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgIH0KLSAgICAgICAgICAgIG9zY2xfZnJlZSh2aWRlby0+dm9sKTsKLSAgICAgICAgfQotCi0gICAgICAgIGZvciAoaWR4ID0gMDsgaWR4IDwgdmlkZW8tPm51bWJlck9mTGF5ZXJzOyBpZHgrKykKLSAgICAgICAgewotICAgICAgICAgICAgaWYgKHZpZGVvLT52b3BIZWFkZXJbaWR4XSkgb3NjbF9mcmVlKHZpZGVvLT52b3BIZWFkZXJbaWR4XSk7Ci0gICAgICAgIH0KLQotICAgICAgICBpZiAodmlkZW8tPnZvcEhlYWRlcikgb3NjbF9mcmVlKHZpZGVvLT52b3BIZWFkZXIpOwotCi0gICAgICAgIG9zY2xfZnJlZSh2aWRlbyk7Ci0gICAgICAgIGRlY0N0cmwtPnZpZGVvRGVjb2RlckRhdGEgPSBOVUxMOwotICAgIH0KLSNlbmRpZgotICAgIHJldHVybiBQVl9UUlVFOwotfQotLyogPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09ICovCi0vKiAgRnVuY3Rpb24gOiBQVkdldFZpZGVvRGltZW5zaW9ucygpICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICBEYXRlICAgICA6IDA0MDUwNSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogIFB1cnBvc2UgIDogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgSW4vb3V0ICAgOiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICBSZXR1cm4gICA6IHRoZSBkaXNwbGF5X3dpZHRoIGFuZCBkaXNwbGF5X2hlaWdodCBvZiAgICAgICAgICAgICAgICAgICAgICAqLwotLyogICAgICAgICAgdGhlIGZyYW1lIGluIHRoZSBjdXJyZW50IGxheWVyLiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgTm90ZSAgICAgOiBUaGlzIGlzIG5vdCBhIG1hY3JvIG9yIGlubGluZSBmdW5jdGlvbiBiZWNhdXNlIHdlIGRvICAgICAgICAgKi8KLS8qICAgICAgICAgICAgICBub3Qgd2FudCB0byBleHBvc2Ugb3VyIGludGVybmFsIGRhdGEgc3RydWN0dXJlLiAgICAgICAgICAgICAqLwotLyogIE1vZGlmaWVkIDogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0gKi8KLU9TQ0xfRVhQT1JUX1JFRiB2b2lkIFBWR2V0VmlkZW9EaW1lbnNpb25zKFZpZGVvRGVjQ29udHJvbHMgKmRlY0N0cmwsIGludDMyICpkaXNwbGF5X3dpZHRoLCBpbnQzMiAqZGlzcGxheV9oZWlnaHQpCi17Ci0gICAgVmlkZW9EZWNEYXRhICp2aWRlbyA9IChWaWRlb0RlY0RhdGEgKilkZWNDdHJsLT52aWRlb0RlY29kZXJEYXRhOwotICAgICpkaXNwbGF5X3dpZHRoID0gdmlkZW8tPmRpc3BsYXlXaWR0aDsKLSAgICAqZGlzcGxheV9oZWlnaHQgPSB2aWRlby0+ZGlzcGxheUhlaWdodDsKLX0KLQotT1NDTF9FWFBPUlRfUkVGIHZvaWQgUFZHZXRCdWZmZXJEaW1lbnNpb25zKFZpZGVvRGVjQ29udHJvbHMgKmRlY0N0cmwsIGludDMyICp3aWR0aCwgaW50MzIgKmhlaWdodCkgewotICAgIFZpZGVvRGVjRGF0YSAqdmlkZW8gPSAoVmlkZW9EZWNEYXRhICopZGVjQ3RybC0+dmlkZW9EZWNvZGVyRGF0YTsKLSAgICAqd2lkdGggPSB2aWRlby0+d2lkdGg7Ci0gICAgKmhlaWdodCA9IHZpZGVvLT5oZWlnaHQ7Ci19Ci0KLS8qID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PSAqLwotLyogIEZ1bmN0aW9uIDogUFZHZXRWaWRlb1RpbWVTdGFtcCgpICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgRGF0ZSAgICAgOiAwNC8yNy8yMDAwLCAwOC8yOS8yMDAwICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICBQdXJwb3NlICA6ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogIEluL291dCAgIDogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgUmV0dXJuICAgOiBjdXJyZW50IHRpbWUgc3RhbXAgaW4gbWlsbGlzZWNvbmQuICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICBOb3RlICAgICA6ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogIE1vZGlmaWVkIDogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0gKi8KLXVpbnQzMiBQVkdldFZpZGVvVGltZVN0YW1wKFZpZGVvRGVjQ29udHJvbHMgKmRlY0N0cmwpCi17Ci0gICAgVmlkZW9EZWNEYXRhICp2aWRlbyA9IChWaWRlb0RlY0RhdGEgKilkZWNDdHJsLT52aWRlb0RlY29kZXJEYXRhOwotICAgIHJldHVybiB2aWRlby0+Y3VyclRpbWVzdGFtcDsKLX0KLQotCi0vKiA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0gKi8KLS8qICBGdW5jdGlvbiA6IFBWU2V0UG9zdFByb2NUeXBlKCkgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogIERhdGUgICAgIDogMDcvMDcvMjAwMCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgUHVycG9zZSAgOiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICBJbi9vdXQgICA6ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogIFJldHVybiAgIDogU2V0IHBvc3QtcHJvY2Vzc2luZyBmaWx0ZXIgdHlwZS4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgTm90ZSAgICAgOiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICBNb2RpZmllZCA6IC4gMDgvMjkvMjAwMCBjaGFuZ2VzIHRoZSBuYW1lIGZvciBjb25zaXN0ZW5jeS4gICAgICAgICAgICAgICAqLwotLyogPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09ICovCi1PU0NMX0VYUE9SVF9SRUYgdm9pZCBQVlNldFBvc3RQcm9jVHlwZShWaWRlb0RlY0NvbnRyb2xzICpkZWNDdHJsLCBpbnQgbW9kZSkKLXsKLSAgICBWaWRlb0RlY0RhdGEgKnZpZGVvID0gKFZpZGVvRGVjRGF0YSAqKWRlY0N0cmwtPnZpZGVvRGVjb2RlckRhdGE7Ci0gICAgdmlkZW8tPnBvc3RGaWx0ZXJUeXBlID0gbW9kZTsKLX0KLQotCi0vKiA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0gKi8KLS8qICBGdW5jdGlvbiA6IFBWR2V0RGVjQml0cmF0ZSgpICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogIERhdGUgICAgIDogMDgvMjMvMjAwMCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgUHVycG9zZSAgOiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICBJbi9vdXQgICA6ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogIFJldHVybiAgIDogVGhpcyBmdW5jdGlvbiByZXR1cm5zIHRoZSBhdmVyYWdlIGJpdHMgcGVyIHNlY29uZC4gICAgICAgICAgICovCi0vKiAgTm90ZSAgICAgOiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICBNb2RpZmllZCA6ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09ICovCi1pbnQgUFZHZXREZWNCaXRyYXRlKFZpZGVvRGVjQ29udHJvbHMgKmRlY0N0cmwpCi17Ci0gICAgVmlkZW9EZWNEYXRhICp2aWRlbyA9IChWaWRlb0RlY0RhdGEgKilkZWNDdHJsLT52aWRlb0RlY29kZXJEYXRhOwotICAgIGludCAgICAgaWR4OwotICAgIGludDMyICAgc3VtID0gMDsKLQotICAgIGZvciAoaWR4ID0gMDsgaWR4IDwgQklUUkFURV9BVkVSQUdFX1dJTkRPVzsgaWR4KyspCi0gICAgewotICAgICAgICBzdW0gKz0gdmlkZW8tPm5CaXRzUGVyVm9wW2lkeF07Ci0gICAgfQotICAgIHN1bSA9IChzdW0gKiB2aWRlby0+ZnJhbWVSYXRlKSAvICgxMCAqIEJJVFJBVEVfQVZFUkFHRV9XSU5ET1cpOwotICAgIHJldHVybiAoaW50KSBzdW07Ci19Ci0KLQotLyogPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09ICovCi0vKiAgRnVuY3Rpb24gOiBQVkdldERlY0ZyYW1lcmF0ZSgpICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICBEYXRlICAgICA6IDA4LzIzLzIwMDAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogIFB1cnBvc2UgIDogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgSW4vb3V0ICAgOiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICBSZXR1cm4gICA6IFRoaXMgZnVuY3Rpb24gcmV0dXJucyB0aGUgYXZlcmFnZSBmcmFtZSBwZXIgMTAgc2Vjb25kLiAgICAgICAqLwotLyogIE5vdGUgICAgIDogVGhlIGZwcyBjYW4gYmUgY2FsY3VsYXRlZCBieSBQVkdldERlY0ZyYW1lcmF0ZSgpLzEwICAgICAgICAgICovCi0vKiAgTW9kaWZpZWQgOiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PSAqLwotaW50IFBWR2V0RGVjRnJhbWVyYXRlKFZpZGVvRGVjQ29udHJvbHMgKmRlY0N0cmwpCi17Ci0gICAgVmlkZW9EZWNEYXRhICp2aWRlbyA9IChWaWRlb0RlY0RhdGEgKilkZWNDdHJsLT52aWRlb0RlY29kZXJEYXRhOwotCi0gICAgcmV0dXJuIHZpZGVvLT5mcmFtZVJhdGU7Ci19Ci0KLS8qID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PSAqLwotLyogIEZ1bmN0aW9uIDogUFZHZXRPdXRwdXRGcmFtZSgpICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgRGF0ZSAgICAgOiAwNS8wNy8yMDAxICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICBQdXJwb3NlICA6ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogIEluL291dCAgIDogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgUmV0dXJuICAgOiBUaGlzIGZ1bmN0aW9uIHJldHVybnMgdGhlIHBvaW50ZXIgdG8gdGhlIG91dHB1dCBmcmFtZSAgICAgICAgKi8KLS8qICBOb3RlICAgICA6ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogIE1vZGlmaWVkIDogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0gKi8KLXVpbnQ4ICpQVkdldERlY091dHB1dEZyYW1lKFZpZGVvRGVjQ29udHJvbHMgKmRlY0N0cmwpCi17Ci0gICAgcmV0dXJuIGRlY0N0cmwtPm91dHB1dEZyYW1lOwotfQotCi0vKiA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0gKi8KLS8qICBGdW5jdGlvbiA6IFBWR2V0TGF5ZXJJRCgpICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogIERhdGUgICAgIDogMDcvMDkvMjAwMSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgUHVycG9zZSAgOiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICBJbi9vdXQgICA6ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogIFJldHVybiAgIDogVGhpcyBmdW5jdGlvbiByZXR1cm5zIGRlY29kZWQgZnJhbWUgbGF5ZXIgaWQgKEJBU0UvRU5IQU5DRSkgICovCi0vKiAgTm90ZSAgICAgOiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICBNb2RpZmllZCA6ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09ICovCi1pbnQgUFZHZXRMYXllcklEKFZpZGVvRGVjQ29udHJvbHMgKmRlY0N0cmwpCi17Ci0gICAgVmlkZW9EZWNEYXRhICp2aWRlbyA9IChWaWRlb0RlY0RhdGEgKilkZWNDdHJsLT52aWRlb0RlY29kZXJEYXRhOwotICAgIHJldHVybiB2aWRlby0+Y3VyckxheWVyOwotfQotLyogPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09ICovCi0vKiAgRnVuY3Rpb24gOiBQVkdldERlY01lbW9yeVVzYWdlKCkgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICBEYXRlICAgICA6IDA4LzIzLzIwMDAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogIFB1cnBvc2UgIDogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgSW4vb3V0ICAgOiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICBSZXR1cm4gICA6IFRoaXMgZnVuY3Rpb24gcmV0dXJucyB0aGUgYW1vdW50IG9mIG1lbW9yeSB1c2VkLiAgICAgICAgICAgICAqLwotLyogIE5vdGUgICAgIDogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgTW9kaWZpZWQgOiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PSAqLwotaW50MzIgUFZHZXREZWNNZW1vcnlVc2FnZShWaWRlb0RlY0NvbnRyb2xzICpkZWNDdHJsKQotewotICAgIFZpZGVvRGVjRGF0YSAqdmlkZW8gPSAoVmlkZW9EZWNEYXRhICopZGVjQ3RybC0+dmlkZW9EZWNvZGVyRGF0YTsKLSAgICByZXR1cm4gdmlkZW8tPm1lbW9yeVVzYWdlOwotfQotCi0KLS8qID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PSAqLwotLyogIEZ1bmN0aW9uIDogUFZHZXREZWNCaXRzdHJlYW1Nb2RlKCkgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgRGF0ZSAgICAgOiAwOC8yMy8yMDAwICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICBQdXJwb3NlICA6ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogIEluL291dCAgIDogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgUmV0dXJuICAgOiBUaGlzIGZ1bmN0aW9uIHJldHVybnMgdGhlIGRlY29kaW5nIG1vZGUgb2YgdGhlIGJhc2VsYXllciAgICAgKi8KLS8qICAgICAgICAgICAgICBiaXRzdHJlYW0uICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogIE5vdGUgICAgIDogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgTW9kaWZpZWQgOiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PSAqLwotT1NDTF9FWFBPUlRfUkVGIE1QNERlY29kaW5nTW9kZSBQVkdldERlY0JpdHN0cmVhbU1vZGUoVmlkZW9EZWNDb250cm9scyAqZGVjQ3RybCkKLXsKLSAgICBWaWRlb0RlY0RhdGEgKnZpZGVvID0gKFZpZGVvRGVjRGF0YSAqKWRlY0N0cmwtPnZpZGVvRGVjb2RlckRhdGE7Ci0gICAgaWYgKHZpZGVvLT5zaG9ydFZpZGVvSGVhZGVyKQotICAgIHsKLSAgICAgICAgcmV0dXJuIEgyNjNfTU9ERTsKLSAgICB9Ci0gICAgZWxzZQotICAgIHsKLSAgICAgICAgcmV0dXJuIE1QRUc0X01PREU7Ci0gICAgfQotfQotCi0KLS8qID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PSAqLwotLyogIEZ1bmN0aW9uIDogUFZFeHRyYWN0Vm9sSGVhZGVyKCkgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgRGF0ZSAgICAgOiAwOC8yOS8yMDAwICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICBQdXJwb3NlICA6ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogIEluL291dCAgIDogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgUmV0dXJuICAgOiBFeHRyYWN0IHZvbCBoZWFkZXIgb2YgdGhlIGJpdHN0cmVhbSBmcm9tIGJ1ZmZlcltdLiAgICAgICAgICAgKi8KLS8qICBOb3RlICAgICA6ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogIE1vZGlmaWVkIDogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0gKi8KLUJvb2wgUFZFeHRyYWN0Vm9sSGVhZGVyKHVpbnQ4ICp2aWRlb19idWZmZXIsIHVpbnQ4ICp2b2xfaGVhZGVyLCBpbnQzMiAqdm9sX2hlYWRlcl9zaXplKQotewotICAgIGludCBpZHggPSAtMTsKLSAgICB1aW50OCBzdGFydF9jb2RlX3ByZWZpeFtdID0geyAweDAwLCAweDAwLCAweDAxIH07Ci0gICAgdWludDggaDI2M19wcmVmaXhbXSA9IHsgMHgwMCwgMHgwMCwgMHg4MCB9OwotCi0gICAgaWYgKG9zY2xfbWVtY21wKGgyNjNfcHJlZml4LCB2aWRlb19idWZmZXIsIDMpID09IDApIC8qIHdlIGhhdmUgc2hvcnQgaGVhZGVyIHN0cmVhbSAqLwotICAgIHsKLSAgICAgICAgb3NjbF9tZW1jcHkodm9sX2hlYWRlciwgdmlkZW9fYnVmZmVyLCAzMik7Ci0gICAgICAgICp2b2xfaGVhZGVyX3NpemUgPSAzMjsKLSAgICAgICAgcmV0dXJuIFRSVUU7Ci0gICAgfQotICAgIGVsc2UKLSAgICB7Ci0gICAgICAgIGlmIChvc2NsX21lbWNtcChzdGFydF9jb2RlX3ByZWZpeCwgdmlkZW9fYnVmZmVyLCAzKSB8fAotICAgICAgICAgICAgICAgICh2aWRlb19idWZmZXJbM10gIT0gMHhiMCAmJiB2aWRlb19idWZmZXJbM10gPj0gMHgyMCkpIHJldHVybiBGQUxTRTsKLQotICAgICAgICBkbwotICAgICAgICB7Ci0gICAgICAgICAgICBpZHgrKzsKLSAgICAgICAgICAgIHdoaWxlIChvc2NsX21lbWNtcChzdGFydF9jb2RlX3ByZWZpeCwgdmlkZW9fYnVmZmVyICsgaWR4LCAzKSkKLSAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICBpZHgrKzsKLSAgICAgICAgICAgICAgICBpZiAoaWR4ICsgMyA+PSAqdm9sX2hlYWRlcl9zaXplKSBnb3RvIHF1aXQ7Ci0gICAgICAgICAgICB9Ci0gICAgICAgIH0KLSAgICAgICAgd2hpbGUgKHZpZGVvX2J1ZmZlcltpZHgrM10gIT0gMHhiMyAmJiB2aWRlb19idWZmZXJbaWR4KzNdICE9IDB4YjYpOwotCi0gICAgICAgIG9zY2xfbWVtY3B5KHZvbF9oZWFkZXIsIHZpZGVvX2J1ZmZlciwgaWR4KTsKLSAgICAgICAgKnZvbF9oZWFkZXJfc2l6ZSA9IGlkeDsKLSAgICAgICAgcmV0dXJuIFRSVUU7Ci0gICAgfQotCi1xdWl0OgotICAgIG9zY2xfbWVtY3B5KHZvbF9oZWFkZXIsIHZpZGVvX2J1ZmZlciwgKnZvbF9oZWFkZXJfc2l6ZSk7Ci0gICAgcmV0dXJuIEZBTFNFOwotfQotCi0KLS8qID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PSAqLwotLyogIEZ1bmN0aW9uIDogUFZMb2NhdGVGcmFtZUhlYWRlcigpICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgRGF0ZSAgICAgOiAwNC84LzIwMDUgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICBQdXJwb3NlICA6ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogIEluL291dCAgIDogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgUmV0dXJuICAgOiBSZXR1cm4gdGhlIG9mZnNldCB0byB0aGUgZmlyc3QgU0MgaW4gdGhlIGJ1ZmZlciAgICAgICAgICAgICAgKi8KLS8qICBOb3RlICAgICA6ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogIE1vZGlmaWVkIDogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0gKi8KLWludDMyIFBWTG9jYXRlRnJhbWVIZWFkZXIodWludDggKnB0ciwgaW50MzIgc2l6ZSkKLXsKLSAgICBpbnQgY291bnQgPSAwOwotICAgIGludDMyIGkgPSBzaXplOwotCi0gICAgaWYgKHNpemUgPCAxKQotICAgIHsKLSAgICAgICAgcmV0dXJuIDA7Ci0gICAgfQotICAgIHdoaWxlIChpLS0pCi0gICAgewotICAgICAgICBpZiAoKGNvdW50ID4gMSkgJiYgKCpwdHIgPT0gMHgwMSkpCi0gICAgICAgIHsKLSAgICAgICAgICAgIGkgKz0gMjsKLSAgICAgICAgICAgIGJyZWFrOwotICAgICAgICB9Ci0KLSAgICAgICAgaWYgKCpwdHIrKykKLSAgICAgICAgICAgIGNvdW50ID0gMDsKLSAgICAgICAgZWxzZQotICAgICAgICAgICAgY291bnQrKzsKLSAgICB9Ci0gICAgcmV0dXJuIChzaXplIC0gKGkgKyAxKSk7Ci19Ci0KLQotLyogPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09ICovCi0vKiAgRnVuY3Rpb24gOiBQVkxvY2F0ZUgyNjNGcmFtZUhlYWRlcigpICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICBEYXRlICAgICA6IDA0LzgvMjAwNSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogIFB1cnBvc2UgIDogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgSW4vb3V0ICAgOiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICBSZXR1cm4gICA6IFJldHVybiB0aGUgb2Zmc2V0IHRvIHRoZSBmaXJzdCBTQyBpbiB0aGUgYnVmZmVyICAgICAgICAgICAgICAqLwotLyogIE5vdGUgICAgIDogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgTW9kaWZpZWQgOiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PSAqLwotaW50MzIgUFZMb2NhdGVIMjYzRnJhbWVIZWFkZXIodWludDggKnB0ciwgaW50MzIgc2l6ZSkKLXsKLSAgICBpbnQgY291bnQgPSAwOwotICAgIGludDMyIGkgPSBzaXplOwotCi0gICAgaWYgKHNpemUgPCAxKQotICAgIHsKLSAgICAgICAgcmV0dXJuIDA7Ci0gICAgfQotCi0gICAgd2hpbGUgKGktLSkKLSAgICB7Ci0gICAgICAgIGlmICgoY291bnQgPiAxKSAmJiAoKCpwdHIgJiAweEZDKSA9PSAweDgwKSkKLSAgICAgICAgewotICAgICAgICAgICAgaSArPSAyOwotICAgICAgICAgICAgYnJlYWs7Ci0gICAgICAgIH0KLQotICAgICAgICBpZiAoKnB0cisrKQotICAgICAgICAgICAgY291bnQgPSAwOwotICAgICAgICBlbHNlCi0gICAgICAgICAgICBjb3VudCsrOwotICAgIH0KLSAgICByZXR1cm4gKHNpemUgLSAoaSArIDEpKTsKLX0KLQotCi0vKiA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0gKi8KLS8qICBGdW5jdGlvbiA6IFBWRGVjb2RlVmlkZW9GcmFtZSgpICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogIERhdGUgICAgIDogMDgvMjkvMjAwMCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgUHVycG9zZSAgOiBEZWNvZGUgb25lIHZpZGVvIGZyYW1lIGFuZCByZXR1cm4gYSBZVVYtMTIgaW1hZ2UuICAgICAgICAgICAgKi8KLS8qICBJbi9vdXQgICA6ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogIFJldHVybiAgIDogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgTm90ZSAgICAgOiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICBNb2RpZmllZCA6IDA0LzE3LzIwMDEgcmVtb3ZlZCBQVl9FT1MsIFBWX0VORF9PRl9CVUZGRVIgICAgICAgICAgICAgICovCi0vKiAgICAgICAgICAgOiAwOC8yMi8yMDAyIGJyZWFrIHVwIGludG8gMiBmdW5jdGlvbnMgUFZEZWNvZGVWb3BIZWFkZXIgYW5kICovCi0vKiAgICAgICAgICAgICAgICAgICAgICAgICAgUFZEZWNvZGVWb3BCb2R5ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PSAqLwotT1NDTF9FWFBPUlRfUkVGIEJvb2wgUFZEZWNvZGVWaWRlb0ZyYW1lKFZpZGVvRGVjQ29udHJvbHMgKmRlY0N0cmwsIHVpbnQ4ICpidWZmZXJbXSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB1aW50MzIgdGltZXN0YW1wW10sIGludDMyIGJ1ZmZlcl9zaXplW10sIHVpbnQgdXNlX2V4dF90aW1lc3RhbXBbXSwgdWludDggKmN1cnJZVVYpCi17Ci0gICAgUFZfU1RBVFVTIHN0YXR1cyA9IFBWX0ZBSUw7Ci0gICAgVm9wSGVhZGVySW5mbyBoZWFkZXJfaW5mbzsKLQotICAgIHN0YXR1cyA9IChQVl9TVEFUVVMpUFZEZWNvZGVWb3BIZWFkZXIoZGVjQ3RybCwgYnVmZmVyLCB0aW1lc3RhbXAsIGJ1ZmZlcl9zaXplLCAmaGVhZGVyX2luZm8sIHVzZV9leHRfdGltZXN0YW1wLCBjdXJyWVVWKTsKLSAgICBpZiAoc3RhdHVzICE9IFBWX1RSVUUpCi0gICAgICAgIHJldHVybiBQVl9GQUxTRTsKLQotICAgIGlmIChQVkRlY29kZVZvcEJvZHkoZGVjQ3RybCwgYnVmZmVyX3NpemUpICE9IFBWX1RSVUUpCi0gICAgewotICAgICAgICByZXR1cm4gUFZfRkFMU0U7Ci0gICAgfQotCi0gICAgcmV0dXJuIFBWX1RSVUU7Ci19Ci0KLS8qID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PSAqLwotLyogIEZ1bmN0aW9uIDogUFZEZWNvZGVWb3BIZWFkZXIoKSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgRGF0ZSAgICAgOiAwOC8yMi8yMDAyICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICBQdXJwb3NlICA6IERldGVybWluZSB0YXJnZXQgbGF5ZXIgYW5kIGRlY29kZSB2b3AgaGVhZGVyLCBtb2RpZmllZCBmcm9tICAqLwotLyogICAgICAgICAgICAgIG9yaWdpbmFsIFBWRGVjb2RlVmlkZW9GcmFtZS4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgSW4vb3V0ICAgOiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICBSZXR1cm4gICA6ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogIE5vdGUgICAgIDogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgTW9kaWZpZWQgOiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PSAqLwotQm9vbCBQVkRlY29kZVZvcEhlYWRlcihWaWRlb0RlY0NvbnRyb2xzICpkZWNDdHJsLCB1aW50OCAqYnVmZmVyW10sCi0gICAgICAgICAgICAgICAgICAgICAgIHVpbnQzMiB0aW1lc3RhbXBbXSwgaW50MzIgYnVmZmVyX3NpemVbXSwgVm9wSGVhZGVySW5mbyAqaGVhZGVyX2luZm8sIHVpbnQgdXNlX2V4dF90aW1lc3RhbXAgW10sIHVpbnQ4ICpjdXJyWVVWKQotewotICAgIFZpZGVvRGVjRGF0YSAqdmlkZW8gPSAoVmlkZW9EZWNEYXRhICopIGRlY0N0cmwtPnZpZGVvRGVjb2RlckRhdGE7Ci0gICAgVm9sICpjdXJyVm9sOwotICAgIFZvcCAqY3VyclZvcCA9IHZpZGVvLT5jdXJyVm9wOwotICAgIFZvcCAqKnZvcEhlYWRlciA9IHZpZGVvLT52b3BIZWFkZXI7Ci0gICAgQml0c3RyZWFtRGVjVmlkZW8gKnN0cmVhbTsKLQotICAgIGludCB0YXJnZXRfbGF5ZXI7Ci0KLSNpZmRlZiBQVl9TVVBQT1JUX1RFTVBPUkFMX1NDQUxBQklMSVRZCi0gICAgUFZfU1RBVFVTIHN0YXR1cyA9IFBWX0ZBSUw7Ci0gICAgaW50IGlkeDsKLSAgICBpbnQzMiBkaXNwbGF5X3RpbWU7Ci0KLSAgICAvKiBkZWNpZGUgd2hpY2ggZnJhbWUgdG8gZGVjb2RlIG5leHQgKi8KLSAgICBpZiAoZGVjQ3RybC0+bkxheWVycyA+IDEpCi0gICAgewotICAgICAgICBkaXNwbGF5X3RpbWUgPSB0YXJnZXRfbGF5ZXIgPSAtMTsKLSAgICAgICAgZm9yIChpZHggPSAwOyBpZHggPCBkZWNDdHJsLT5uTGF5ZXJzOyBpZHgrKykKLSAgICAgICAgewotICAgICAgICAgICAgLyogZG8gd2UgaGF2ZSBkYXRhIGZvciB0aGlzIGxheWVyPyAqLwotICAgICAgICAgICAgaWYgKGJ1ZmZlcl9zaXplW2lkeF0gPD0gMCkKLSAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICB0aW1lc3RhbXBbaWR4XSA9IC0xOwotICAgICAgICAgICAgICAgIGNvbnRpbnVlOwotICAgICAgICAgICAgfQotCi0gICAgICAgICAgICAvKiBkaWQgdGhlIGFwcGxpY2F0aW9uIHByb3ZpZGUgYSB0aW1lc3RhbXAgZm9yIHRoaXMgdm9wPyAqLwotICAgICAgICAgICAgaWYgKHRpbWVzdGFtcFtpZHhdIDwgMCkKLSAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICBpZiAodm9wSGVhZGVyW2lkeF0tPnRpbWVTdGFtcCA8IDApCi0gICAgICAgICAgICAgICAgewotICAgICAgICAgICAgICAgICAgICAvKiBkZWNvZGUgdGhlIHRpbWVzdGFtcCBpbiB0aGUgYml0c3RyZWFtICovCi0gICAgICAgICAgICAgICAgICAgIHZpZGVvLT5jdXJyTGF5ZXIgPSBpZHg7Ci0gICAgICAgICAgICAgICAgICAgIHN0cmVhbSA9IHZpZGVvLT52b2xbaWR4XS0+Yml0c3RyZWFtOwotICAgICAgICAgICAgICAgICAgICBCaXRzdHJlYW1SZXNldChzdHJlYW0sIGJ1ZmZlcltpZHhdLCBidWZmZXJfc2l6ZVtpZHhdKTsKLQotICAgICAgICAgICAgICAgICAgICB3aGlsZSAoKHN0YXR1cyA9IERlY29kZVZPUEhlYWRlcih2aWRlbywgdm9wSGVhZGVyW2lkeF0sIEZBTFNFKSkgIT0gUFZfU1VDQ0VTUykKLSAgICAgICAgICAgICAgICAgICAgewotICAgICAgICAgICAgICAgICAgICAgICAgLyogVHJ5IHRvIGZpbmQgYSBWT1AgaGVhZGVyIGluIHRoZSBidWZmZXIuICAgMDgvMzAvMjAwMC4gKi8KLSAgICAgICAgICAgICAgICAgICAgICAgIGlmIChQVlNlYXJjaE5leHRNNFZGcmFtZShzdHJlYW0pICE9IFBWX1NVQ0NFU1MpCi0gICAgICAgICAgICAgICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgLyogaWYgd2UgZG9uJ3QgaGF2ZSBkYXRhIGZvciBlbmhhbmNlbWVudCBsYXllciwgKi8KLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAvKiAgICBkb24ndCBqdXN0IHN0b3AuICAgMDkvMDcvMjAwMC4gICAgICAgICAgKi8KLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBidWZmZXJfc2l6ZVtpZHhdID0gMDsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKLSAgICAgICAgICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgICAgICBpZiAoc3RhdHVzID09IFBWX1NVQ0NFU1MpCi0gICAgICAgICAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAgICAgICAgIHZvcEhlYWRlcltpZHhdLT50aW1lU3RhbXAgPQotICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRpbWVzdGFtcFtpZHhdID0gQ2FsY1ZvcERpc3BsYXlUaW1lKHZpZGVvLT52b2xbaWR4XSwgdm9wSGVhZGVyW2lkeF0sIHZpZGVvLT5zaG9ydFZpZGVvSGVhZGVyKTsKLSAgICAgICAgICAgICAgICAgICAgICAgIGlmIChpZHggPT0gMCkgdm9wSGVhZGVyW2lkeF0tPnJlZlNlbGVjdENvZGUgPSAxOwotICAgICAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgIGVsc2UKLSAgICAgICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgICAgIC8qIFdlJ3ZlIGRlY29kZWQgdGhpcyB2b3AgaGVhZGVyIGluIHRoZSBwcmV2aW91cyBydW4gYWxyZWFkeS4gKi8KLSAgICAgICAgICAgICAgICAgICAgdGltZXN0YW1wW2lkeF0gPSB2b3BIZWFkZXJbaWR4XS0+dGltZVN0YW1wOwotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgLyogVXNlIHRpbWVzdGFtcHMgdG8gc2VsZWN0IHRoZSBuZXh0IFZPUCB0byBiZSBkZWNvZGVkICovCi0gICAgICAgICAgICBpZiAodGltZXN0YW1wW2lkeF0gPj0gMCAmJiAoZGlzcGxheV90aW1lIDwgMCB8fCBkaXNwbGF5X3RpbWUgPiB0aW1lc3RhbXBbaWR4XSkpCi0gICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgZGlzcGxheV90aW1lID0gdGltZXN0YW1wW2lkeF07Ci0gICAgICAgICAgICAgICAgdGFyZ2V0X2xheWVyID0gaWR4OwotICAgICAgICAgICAgfQotICAgICAgICAgICAgZWxzZSBpZiAoZGlzcGxheV90aW1lID09IHRpbWVzdGFtcFtpZHhdKQotICAgICAgICAgICAgewotICAgICAgICAgICAgICAgIC8qIHdlIGhhdmUgdG8gaGFuZGxlIGVpdGhlciBTTlIgb3Igc3BhdGlhbCBzY2FsYWJpbGl0eSBoZXJlLiAqLwotICAgICAgICAgICAgfQotICAgICAgICB9Ci0gICAgICAgIGlmICh0YXJnZXRfbGF5ZXIgPCAwKSByZXR1c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Vl9GQUxTRTsKLSAgICAgICAgQml0c3RyZWFtUmVzZXQoc3RyZWFtLCBidWZmZXJbMF0sIGJ1ZmZlcl9zaXplWzBdKTsKLQotICAgICAgICBpZiAodmlkZW8tPnNob3J0VmlkZW9IZWFkZXIpCi0gICAgICAgIHsKLSAgICAgICAgICAgIHdoaWxlIChEZWNvZGVTaG9ydEhlYWRlcih2aWRlbywgdm9wSGVhZGVyWzBdKSAhPSBQVl9TVUNDRVNTKQotICAgICAgICAgICAgewotICAgICAgICAgICAgICAgIGlmIChQVlNlYXJjaE5leHRIMjYzRnJhbWUoc3RyZWFtKSAhPSBQVl9TVUNDRVNTKQotICAgICAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAgICAgLyogVGhlcmUgaXMgbm8gdm9wIGhlYWRlciBpbiB0aGUgYnVmZmVyLCAgICAqLwotICAgICAgICAgICAgICAgICAgICAvKiAgIGNsZWFuIGJpdHN0cmVhbSBidWZmZXIuICAgICAyLzUvMjAwMSAgICovCi0gICAgICAgICAgICAgICAgICAgIGJ1ZmZlcl9zaXplWzBdID0gMDsKLSAgICAgICAgICAgICAgICAgICAgaWYgKHZpZGVvLT5pbml0aWFsaXplZCA9PSBQVl9GQUxTRSkKLSAgICAgICAgICAgICAgICAgICAgewotICAgICAgICAgICAgICAgICAgICAgICAgdmlkZW8tPmRpc3BsYXlXaWR0aCA9IHZpZGVvLT53aWR0aCA9IDA7Ci0gICAgICAgICAgICAgICAgICAgICAgICB2aWRlby0+ZGlzcGxheUhlaWdodCA9IHZpZGVvLT5oZWlnaHQgPSAwOwotICAgICAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgICAgIHJldHVybiBQVl9GQUxTRTsKLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgIGlmICh1c2VfZXh0X3RpbWVzdGFtcFswXSkKLSAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAvKiBNVEIgZm9yIEgyNjMgaX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HJlYW0gYnVmZmVyLiAgICAgMi81LzIwMDEgICAqLwotICAgICAgICAgICAgICAgICAgICBidWZmZXJfc2l6ZVswXSA9IDA7Ci0gICAgICAgICAgICAgICAgICAgIHJldHVybiBQVl9GQUxTRTsKLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgIGlmICh1c2VfZXh0X3RpbWVzdGFtcFswXSkKLSAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICB2aWRlby0+dm9sWzBdLT50aW1lSW5jX29mZnNldCA9IHZvcEhlYWRlclswXS0+dGltZUluYzsKLSAgICAgICAgICAgICAgICB2aWRlby0+dm9sWzBdLT5tb2R1bG9UaW1lQmFzZSA9IHRpbWVzdGFtcFswXTsgIC8qICAxMS8xMi8yMDAxICovCi0gICAgICAgICAgICAgICAgdm9wSGVhZGVyWzBdLT50aW1lU3RhbXAgPSB0aW1lc3RhbXBbMF07Ci0gICAgICAgICAgICB9Ci0gICAgICAgICAgICBlbHNlCi0gICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgdm9wSGVhZGVyWzBdLT50aW1lU3RhbXAgPSBDYWxjVm9wRGlzcGxheVRpbWUoY3VyclZvbCwgdm9wSGVhZGVyWzBdLCB2aWRlby0+c2hvcnRWaWRlb0hlYWRlcik7Ci0gICAgICAgICAgICB9Ci0gICAgICAgIH0KLQotICAgICAgICAvKiBzZXQgdXAgc29tZSBiYXNlLWxheWVyIG9ubHkgcGFyYW1ldGVycyAqLwotICAgICAgICB2b3BIZWFkZXJbMF0tPnJlZlNlbGVjdENvZGUgPSAxOwotI2lmZGVmIFBWX1NVUFBPUlRfVEVNUE9SQUxfU0NBTEFCSUxJVFkKLSAgICB9Ci0jZW5kaWYKLSAgICB0aW1lc3RhbXBbdGFyZ2V0X2xheWVyXSA9IHZpZGVvLT5jdXJyVGltZXN0YW1wID0gdm9wSGVhZGVyW3RhcmdldF9sYXllcl0tPnRpbWVTdGFtcDsKLSNpZmRlZi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aW5mby0+cmVmU2VsQ29kZSA9IHZvcEhlYWRlclt0YXJnZXRfbGF5ZXJdLT5yZWZTZWxlY3RDb2RlOwotICAgIGhlYWRlcl9pbmZvLT5xdWFudGl6ZXIgPSBjdXJyVm9wLT5xdWFudGl6ZXI7Ci0gICAgLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLQotICAgIHJldHVybiBQVl9UUlVFOwotfQotCi0KLS8qID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PSAqLwotLyogIEZ1bmN0aW9uIDogUFZEZWNvZGVWb3BCb2R5KCkgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgRGF0ZSAgICAgOiAwOC8yMi8yMDAyICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICBQdXJwb3NlICA6IERlY29kZSB2b3AgYm9keSBhZnRlciB0aGUgaGVhZGVyIGlzIGRlY29kZWQsIG1vZGlmaWVkIGZyb20gICAqLwotLyogICAgICAgICAgICAgIG9yaWdpbmFsIFBWRGVjb2RlVmlkZW9GcmFtZS4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgSW4vb3V0ICAgOiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICBSZXR1cm4gICA6ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogIE5vdGUgICAgIDogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgTW9kaWZpZWQgOiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qID09PT09PT09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nN1bWVkID4gY3VyclZvbC0+Yml0c3RyZWFtLT5kYXRhX2VuZF9wb3MpCi0gICAgICAgIHsKLSAgICAgICAgICAgIGJ5dGVzX2NvbnN1bWVkID0gY3VyclZvbC0+Yml0c3RyZWFtLT5kYXRhX2VuZF9wb3M7Ci0gICAgICAgIH0KLQotICAgICAgICBpZiAoYnl0ZXNfY29uc3VtZWQgPCBidWZmZXJfc2l6ZVt0YXJnZXRfbGF5ZXJdKQotICAgICAgICB7Ci0gICAgICAgICAgICAvKiBJZiB3ZSBvbmx5IGNvbnN1bWUgcGFydCBvZiB0aGUgYml0cyBpbiB0aGUgYnVmZmVyLCB0YWtlIHRob3NlICovCi0gICAgICAgICAgICAvKiAgb3V0LiAgICAgMDQvMjQvMjAwMSAqLwotICAgICAgICAgICAgLyogICAgICAgICAgb3NjbF9tZW1jcHkoYnVmZmVyW3RhcmdldF9sYXllcl0sIGJ1ZmZlclt0YXJnZXRfbGF5ZXJdK2J5dGVzX2NvbnN1bWVkLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgIChidWZmZXJfc2l6ZVt0YXJnZXRfbGF5ZXJdLT1ieXRlc19jb25zdW1lZCkpOyAqLwotICAgICAgICAgICAgYnVmZmVyX3NpemVbdGFyZ2V0X2xheWVyXSAtPSBieXRlc19jb25zdW1lZDsKLSAgICAgICAgfQotICAgICAgICBlbHNlCi0gICAgICAgIHsKLSAgICAgICAgICAgIGJ1ZmZlcl9zaXplW3RhcmdldF9sYXllcl0gPSAwOwotICAgICAgICB9Ci0jaWZkZWYgUFZfTUVNT1JZX1BPT0wKLQotICAgICAgICBpZiAodGFyZ2V0X2xheWVyKQotICAgICAgICB7Ci0gICAgICAgICAgICBpZiAodmlkZW8tPnByZXZFbmhjVm9wLT50aW1lU3RhbXAgPiB2aWRlby0+cHJldlZvcC0+dGltZVN0YW1wKQotICAgICAgICAgICAgewotICAgICAgICAgICAgICAgIHZpZGVvLT5wcmV2Vm9wID0gdmlkZW8tPnByZXZFbmhjV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gIC8qIHRoaXMgaXMgbmVjZXNzYXJ5IHRvIGF2b2lkIGZsYXNoYmFjayBwcm9ibGVtcyAgIDA2LzIxLzIwMDIqLwotICAgICAgICB7Ci0gICAgICAgICAgICB2aWRlby0+cHJldkVuaGNWb3AtPnRpbWVTdGFtcCA9IGN1cnJWb3AtPnRpbWVTdGFtcDsKLSAgICAgICAgfQotICAgICAgICBlbHNlCi0gICAgICAgIHsKLSAgICAgICAgICAgIHZpZGVvLT5wcmV2Vm9wLT50aW1lU3RhbXAgPSBjdXJyVm9wLT50aW1lU3RhbXA7Ci0gICAgICAgIH0KLSNlbmRpZgotICAgICAgICB2aWRlby0+dm9wX2NvZGluZ190eXBlID0gY3VyclZvcC0+cHJlZGljdGlvblR5cGU7IC8qICAwNy8wOS8wMSAqLwotICAgICAgICAvKiB0aGUgZm9sbG93aW5nIGlzIG5lY2Vzc2FyeSB0byBhdm9pZCBkaXNwbGF5aW5nIGFuIG5vdENvZGVkIEktVk9QIGF0IHRoZSBiZWdpbm5pbmcgb2YgYSBzZXNzaW9uCi0gICAgICAgIG9yIGFmdGVyIHJhbmRvbSBwb3NpdGlvbmluZyAgMDcvMDMvMDIqLwotICAgICAgICBpZiAoY3VyclZvcC0+cHJlZGljdGlvblR5cGUgPT0gSV9WT1ApCi0gICAgICAgIHsKLSAgICAgICAgICAgIHZpZGVvLT52b3BfY29kaW5nX3R5cGUgPSBQX1ZPUDsKLSAgICAgICAgfQotCi0KLSAgICAgICAgcmV0dXJuIFBWX1RSVUU7Ci0gICAgfQotICAgIC8qID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0gKi8KLSAgICAvKiAgRGVjb2RlIHZvcCBib2R5IChpZiB0aGVyZSBpcyBubyBlcnJvciBpbiB0aGUgaGVhZGVyISkgICovCi0gICAgLyogPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PSAqLwotCi0gICAgLyogZmlyc3QsIHdlIG5lZWQgdG8gc2VsZWN0IGEgcmVmZXJlbmNlIGZyYW1lICovCi0gICAgaWYgKGRlY0N0cmwtPm5MYXllcnMgPiAxKQotICAgIHsKLSAgICAgICAgaWYgKGN1cnJWb3AtPnByZWRpY3Rpb25UeXBlID09IElfVk9QKQotICAgICAgICB7Ci0gICAgICAgICAgICAvKiBkbyBub3RoaW5nIGhlcmUgKi8KLSAgICAgICAgfQotICAgICAgICBlbHNlIGlmIChjdXJyVm9wLT5wcmVkaWN0aW9uVHlwZSA9PSBQX1ZPUCkKLSAgICAgICAgewotICAgICAgICAgICAgc3dpdGNoIChjdXJyVm9wLT5yZWZTZWxlY3RDb2RlKQotICAgICAgICAgICAgewotICAgICAgICAgICAgICAgIGNhc2UgMCA6IC8qIG1vc3QgcmVjZW50bHkgZGVjb2RlZCBlbmhhbmNlbWVudCB2b3AgKi8KLSAgICAgICAgICAgICAgICAgICAgLyogU2V0dXAgdmlkZW8tPnByZXZWb3AgYmVmb3JlIHdlIGNhbGwgUFZfRGVjb2RlVm9wKCkuICAgMDQvMjQvMjAwMSAqLwotICAgICAgICAgICAgICAgICAgICBpZiAodmlkZW8tPnByZXZFbmhjVm9wLT50aW1lU3RhbXAgPj0gdmlkZW8tPnByZXZWb3AtPnRpbWVTdGFtcCkKLSAgICAgICAgICAgICAgICAgICAgICAgIHZpZGVvLT5wcmV2Vm9wID0gdmlkZW8tPnByZXZFbmhjVm9wOwotICAgICAgICAgICAgICAgICAgICBicmVhazsKLQotICAgICAgICAgICAgICAgIGNhc2UgMSA6IC8qIG1vc3QgcmVjZW50bHkgZGlzcGxheWVkIGJhc2UtbGF5ZXIgdm9wICovCi0gICAgICAgICAgICAgICAgICAgIGlmICh0YXJnZXRfbGF5ZXIpCi0gICAgICAgICAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAgICAgICAgIGlmICh2aWRlby0+cHJldkVuaGNWb3AtPnRpbWVTdGFtcCA+IHZpZGVvLT5wcmV2Vm9wLT50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mcgOikuICovCi0KLQotICAgICAgICAgICAgdmlkZW8tPmNvbmNlYWxGcmFtZSA9IHZpZGVvLT5jdXJyVm9wLT55Q2hhbjsgICAgICAgLyogIDA3LzA3LzIwMDEgKi8KLQotICAgICAgICAgICAgdmlkZW8tPnZvcF9jb2RpbmdfdHlwZSA9IHZpZGVvLT5jdXJyVm9wLT5wcmVkaWN0aW9uVHlwZTsgLyogIDA3LzA5LzAxICovCi0KLSAgICAgICAgICAgIGRlY0N0cmwtPm91dHB1dEZyYW1lID0gdmlkZW8tPmN1cnJWb3AtPnlDaGFuOwotCi0gICAgICAgICAgICAvKiBTd2FwIFZPUCBwb2ludGVycy4gIE5vIGVuaGMuIGZyYW1lIG9zY2xfbWVtY3B5KCkgYW55bW9yZSEgICAwNC8yNC8yMDAxICovCi0gICAgICAgICAgICBpZiAodGFyZ2V0X2xheWVyKQotICAgICAgICAgICAgewotICAgICAgICAgICAgICAgIHRlbXBWb3BQdHIgPSB2aWRlby0+cHJldkVuaGNWb3A7Ci0gICAgICAgICAgICAgICAgdmlkZW8tPnByZXZFbmhjVm9wID0gdmlkZW8tPmN1cnJWb3A7Ci0gICAgICAgICAgICAgICAgdmlkZW8tPmN1cnJWb3AgPSB0ZW1wVm9wUHRyOwotICAgICAgICAgICAgfQotICAgICAgICAgICAgZWxzZQotICAgICAgICAgICAgewotICAgICAgICAgICAgICAgIHRlbXBWb3BQdHIgPSB2aWRlby0+cHJldlZvcDsKLSAgICAgICAgICAgICAgICB2aWRlby0+cHJldlZvcCA9IHZpZGVvLT5jdXJyVm9wOwotICAgICAgICAgICAgICAgIHZpZGVvLT5jdXJyVm9wID0gdGVtcFZvcFB0cjsKLSAgICAgICAgICAgIH0KLSAgICAgICAgICAgIGJyZWFrOwotCi0gICAgICAgIGRlZmF1bHQgOgotICAgICAgICAgICAgLyogVGhpcyB3aWxsIG5ldmVyIGhhcHBlbiAqLwotICAgICAgICAgICAgYnJlYWs7Ci0gICAgfQotCi0gICAgcmV0dXJu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W9EZWNvZGVyRXJyb3JEZXRlY3RlZCgpICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgRGF0ZSAgICAgOiAwNi8yMC8yMDAwICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICBQdXJwb3NlICA6ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogIEluL291dCAgIDogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgUmV0dXJuICAgOiBUaGlzIGZ1bmN0aW9uIHdpbGwgYmUgY2FsbGVkIGV2ZXJ5dGltZSBhbiBlcnJvciBpbnQgdGhlICAgICAgKi8KLS8qICAgICAgICAgICAgICBiaXRzdHJlYW0gaXMgZGV0ZWN0ZWQuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogIE5vdGUgICAgIDogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgTW9kaWZpZWQgOiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PSAqLwotdWludCBWaWRlb0RlY29kZXJFcnJvckRldGVjdGVkKFZpZGVvRGVjRGF0YSAqKQotewotICAgIC8qIFRoaXMgaXMgb25seSB1c2VkIGZvciB0cmFwcGluZyBiaXRzdHJlYW0gZXJyb3IgZm9yIGRlYnVnaW5nICovCi0gICAgcmV0dXJuIDA7Ci19Ci0KLSNpZmRlZiBFTkFCTEVfTE9HCi0jaW5jbHVkZSA8c3RkaW8uaD4KLSNpbmNsdWRlIDxzdGRhcmcuaD4KLS8qID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PSAqLwotLyogIEZ1bmN0aW9uIDogbTR2ZGVjX2RwcmludGYoKSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgRGF0ZSAgICAgOiAwOC8xNS8yMDAwICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICBQdXJwb3NlICA6IFRoaXMgaXMgYSBmdW5jdGlvbiB0aGF0IGxvZ3MgbWVzc2FnZXMgaW4gdGhlIG1wZWc0IHZpZGVvICAgICAqLwotLyogICAgICAgICAgICAgZGVjb2Rlci4gIFdlIGNhbiBjYWxsIHRoZSBzdGFuZGFyZCBQYWNrZXRWaWRlbyBQVk1lc3NhZ2UgICAgICovCi0vKiAgICAgICAgICAgICBmcm9tIGluc2lkZSB0aGlzIGZ1bmN0aW9uIGlmIG5lY2Vzc2FyeS4gICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICBJbi9vdXQgICA6ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogIFJldHVybiAgIDogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgTm90ZSAgICAgOiBUbyB0dXJuIG9uIHRoZSBsb2dnaW5nLCBMT0dfTVA0REVDX01FU1NBR0UgbXVzdCBiZSBkZWZpbmVkICAgKi8KLS8qICAgICAgICAgICAgICB3aGVuIGNvbXBpbGluZyB0aGlzIGZpbGUgKG9ubHkgdGhpcyBmaWxlKS4gICAgICAgICAgICAgICAgICAqLwotLyogIE1vZGlmaWVkIDogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0gKi8KLXZvaWQgbTR2ZGVjX2RwcmludGYoY2hhciAqZm9ybWF0LCAuLi4pCi17Ci0gICAgRklMRSAqbG9nX2ZwOwotICAgIHZhX2xpc3QgYXJnczsKLSAgICB2YV9zdGFydChhcmdzLCBmb3JtYXQpOwotCi0gICAgLyogb3BlbiB0aGUgbG9nIGZpbGUgKi8KLSAgICBsb2dfZnAgPSBmb3BlbigiXFxtcDRkZWNfbG9nLnR4dCIsICJhKyIpOwotICAgIGlmIChsb2dfZnAgPT0gTlVMTCkgcmV0dXJuOwotICAgIC8qIG91dHB1dCB0aGUgbWVzc2FnZSAqLwotICAgIHZmcHJpbnRmKGxvZ19mcCwgZm9ybWF0LCBhcmdzKTsKLSAgICBmY2xvc2UobG9nX2ZwKTsKLQotICAgIHZhX2VuZChhcmdzKTsKLX0KLSNlbmRpZgotCi0KLS8qID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PSAqLwotLyogIEZ1bmN0aW9uIDogSXNJbnRyYUZyYW1lKCkgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgRGF0ZSAgICAgOiAwNS8yOS8yMDAwICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICBQdXJwb3NlICA6ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogIEluL291dCAgIDogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgUmV0dXJuICAgOiBUaGUgbW9zdCByZWNlbnRseSBkZWNvZGVkIGZyYW1lIGlzIGFuIEludHJhIGZyYW1lLiAgICAgICAgICAgKi8KLS8qICBOb3RlICAgICA6ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogIE1vZGlmaWVkIDogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0gKi8KLUJvb2wgSXNJbnRyYUZyYW1lKFZpZGVvRGVjQ29udHJvbHMgKmRlY0N0cmwpCi17Ci0gICAgVmlkZW9EZWNEYXRhICp2aWRlbyA9IChWaWRlb0RlY0RhdGEgKilkZWNDdHJsLT52aWRlb0RlY29kZXJEYXRhOwotICAgIHJldHVybiAodmlkZW8tPnZvcF9jb2RpbmdfdHlwZSA9PSBJX1ZPUCk7Ci19Ci0KLS8qID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PSAqLwotLyogIEZ1bmN0aW9uIDogUFZEZWNQb3N0UHJvY2VzcygpICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgRGF0ZSAgICAgOiAwMS8wOS8yMDAyICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICBQdXJwb3NlICA6IFBvc3RQcm9jZXNzIG9uZSB2aWRlbyBmcmFtZSBhbmQgcmV0dXJuIGEgWVVWLTEyIGltYWdlLiAgICAgICAqLwotLyogIEluL291dCAgIDogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgUmV0dXJuICAgOiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICBOb3RlICAgICA6ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogIE1vZGlmaWVkIDogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0gKi8KLXZvaWQgUFZEZWNQb3N0UHJvY2VzcyhWaWRlb0RlY0NvbnRyb2xzICpkZWNDdHJsLCB1aW50OCAqb3V0cHV0WVVWKQotewotICAgIHVpbnQ4ICpvdXRwdXRCdWZmZXI7Ci0jaWZkZWYgUFZfUE9TVFBST0NfT04KLSAgICBWaWRlb0RlY0RhdGEgKnZpZGVvID0gKFZpZGVvRGVjRGF0YSAqKSBkZWNDdHJsLT52aWRlb0RlY29kZXJEYXRhOwotICAgIGludDMyIHRtcHZhcjsKLSAgICBpZiAob3V0cHV0WVVWKQotICAgIHsKLSAgICAgICAgb3V0cHV0QnVmZmVyID0gb3V0cHV0WVVWOwotICAgIH0KLSAgICBlbHNlCi0gICAgewotICAgICAgICBpZiAodmlkZW8tPnBvc3RGaWx0ZXJUeXBlKQotICAgICAgICB7Ci0gICAgICAgICAgICBvdXRwdXRCdWZmZXIgPSB2aWRlby0+Y3VyclZvcC0+eUNoYW47Ci0gICAgICAgIH0KLSAgICAgICAgZWxzZQotICAgICAgICB7Ci0gICAgICAgICAgICBvdXRwdXRCdWZmZXIgPSBkZWNDdHJsLT5vdXRwdXRGcmFtZTsKLSAgICAgICAgfQotICAgIH0KLQotICAgIGlmICh2aWRlby0+cG9zdEZpbHRlclR5cGUpCi0gICAgewotICAgICAgICAvKiBQb3N0LXByb2Nlc3NpbmcsICAqLwotICAgICAgICBQb3N0RmlsdGVyKHZpZGVvLCB2aWRlby0+cG9zdEZpbHRlclR5cGUsIG91dHB1dEJ1ZmZlcik7Ci0gICAgfQotICAgIGVsc2UKLSAgICB7Ci0gICAgICAgIGlmIChvdXRwdXRZVVYpCi0gICAgICAgIHsKLSAgICAgICAgICAgIC8qIENvcHkgZGVjb2RlZCBmcmFtZSB0byB0aGUgb3V0cHV0IGJ1ZmZlci4gKi8KLSAgICAgICAgICAgIHRtcHZhciA9IChpbnQzMil2aWRlby0+d2lkdGggKiB2aWRlby0+aGVpZ2h0OwotICAgICAgICAgICAgb3NjbF9tZW1jcHkob3V0cHV0QnVmZmVyLCBkZWNDdHJsLT5vdXRwdXRGcmFtZSwgdG1wdmFyKjMgLyAyKTsgICAgICAgICAgIC8qICAzLzMvMDEgKi8KLSAgICAgICAgfQotICAgIH0KLSNlbHNlCi0gICAgb3V0cHV0QnVmZmVyID0gZGVjQ3RybC0+b3V0cHV0RnJhbWU7Ci0gICAgb3V0cHV0WVVWOwotI2VuZGlmCi0gICAgZGVjQ3RybC0+b3V0cHV0RnJhbWUgPSBvdXRwdXRCdWZmZXI7Ci0gICAgcmV0dXJuOwotfQotCi0KLS8qID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PSAqLwotLyogIEZ1bmN0aW9uIDogUFZEZWNTZXRSZWZlcmVuY2UoVmlkZW9EZWNDb250cm9scyAqZGVjQ3RybCwgdWludDggKnJlZllVViwgICovCi0vKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGludDMyIHRpbWVzdGFtcCkgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICBEYXRlICAgICA6IDA3LzIyLzIwMDMgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogIFB1cnBvc2UgIDogR2V0IFlVViByZWZlcmVuY2UgZnJhbWUgZnJvbSBleHRlcm5hbCBzb3VyY2UuICAgICAgICAgICAgICAgICovCi0vKiAgSW4vb3V0ICAgOiBZVVYgNC0yLTAgZnJhbWUgY29udGFpbmluZyBuZXcgcmVmZXJlbmNlIGZyYW1lIGluIHRoZSBzYW1lICAgKi8KLS8qICAgOiBkaW1lbnNpb24gYXMgb3JpZ2luYWwsIGkuZS4sIGRvZXNuJ3QgaGF2ZSB0byBiZSBtdWx0aXBsZSBvZiAxNiAhISEuICAqLwotLyogIFJldHVybiAgIDogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgTm90ZSAgICAgOiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICBNb2RpZmllZCA6ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09ICovCi1Cb29sIFBWRGVjU2V0UmVmZXJlbmNlKFZpZGVvRGVjQ29udHJvbHMgKmRlY0N0cmwsIHVpbnQ4ICpyZWZZVVYsIHVpbnQzMiB0aW1lc3RhbXApCi17Ci0gICAgVmlkZW9EZWNEYXRhICp2aWRlbyA9IChWaWRlb0RlY0RhdGEgKikgZGVjQ3RybC0+dmlkZW9EZWNvZGVyRGF0YTsKLSAgICBWb3AgKnByZXZWb3AgPSB2aWRlby0+cHJldlZvcDsKLSAgICBpbnQgd2lkdGggPSB2aWRlby0+d2lkdGg7Ci0gICAgdWludDggKmRzdFB0ciwgKm9yZ1B0ciwgKmRzdFB0cjIsICpvcmdQdHIyOwotICAgIGludDMyIHNpemUgPSAoaW50MzIpd2lkdGggKiB2aWRlby0+aGVpZ2h0OwotCi0KLSAgICAvKiBzZXQgbmV3IHBhcmFtZXRlcnMgKi8KLSAgICBwcmV2Vm9wLT50aW1lU3RhbXAgPSB0aW1lc3RhbXA7Ci0gICAgcHJldlZvcC0+cHJlZGljdGlvblR5cGUgPSBJX1ZPUDsKLQotICAgIGRzdFB0ciA9IHByZXZWb3AtPnlDaGFuOwotICAgIG9yZ1B0ciA9IHJlZllVVjsKLSAgICBvc2NsX21lbWNweShkc3RQdHIsIG9yZ1B0ciwgc2l6ZSk7Ci0gICAgZHN0UHRyID0gcHJldlZvcC0+dUNoYW47Ci0gICAgZHN0UHRyMiA9IHByZXZWb3AtPnZDaGFuOwotICAgIG9yZ1B0ciA9IHJlZllVViArIHNpemU7Ci0gICAgb3JnUHRyMiA9IG9yZ1B0ciArIChzaXplID4+IDIpOwotICAgIG9zY2xfbWVtY3B5KGRzdFB0ciwgb3JnUHRyLCAoc2l6ZSA+PiAyKSk7Ci0gICAgb3NjbF9tZW1jcHkoZHN0UHRyMiwgb3JnUHRyMiwgKHNpemUgPj4gMikpOwotCi0gICAgdmlkZW8tPmNvbmNlYWxGcmFtZSA9IHZpZGVvLT5wcmV2Vm9wLT55Q2hhbjsKLSAgICB2aWRlby0+dm9wX2NvZGluZ190eXBlID0gSV9WT1A7Ci0gICAgZGVjQ3RybC0+b3V0cHV0RnJhbWUgPSB2aWRlby0+cHJldlZvcC0+eUNoYW47Ci0KLSAgICByZXR1cm4gUFZfVFJVRTsKLX0KLQotLyogPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09ICovCi0vKiAgRnVuY3Rpb24gOiBQVkRlY1NldEVuaFJlZmVyZW5jZShWaWRlb0RlY0NvbnRyb2xzICpkZWNDdHJsLCB1aW50OCAqcmVmWVVWLCAgICovCi0vKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGludDMyIHRpbWVzdGFtcCkgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICBEYXRlICAgICA6IDA3LzIzLzIwMDMgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogIFB1cnBvc2UgIDogR2V0IFlVViBlbmhhbmNlIHJlZmVyZW5jZSBmcmFtZSBmcm9tIGV4dGVybmFsIHNvdXJjZS4gICAgICAgICovCi0vKiAgSW4vb3V0ICAgOiBZVVYgNC0yLTAgZnJhbWUgY29udGFpbmluZyBuZXcgcmVmZXJlbmNlIGZyYW1lIGluIHRoZSBzYW1lICAgKi8KLS8qICAgOiBkaW1lbnNpb24gYXMgb3JpZ2luYWwsIGkuZS4sIGRvZXNuJ3QgaGF2ZSB0byBiZSBtdWx0aXBsZSBvZiAxNiAhISEuICAqLwotLyogIFJldHVybiAgIDogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgTm90ZSAgICAgOiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICBNb2RpZmllZCA6ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09ICovCi1Cb29sIFBWRGVjU2V0RW5oUmVmZXJlbmNlKFZpZGVvRGVjQ29udHJvbHMgKmRlY0N0cmwsIHVpbnQ4ICpyZWZZVVYsIHVpbnQzMiB0aW1lc3RhbXApCi17Ci0gICAgVmlkZW9EZWNEYXRhICp2aWRlbyA9IChWaWRlb0RlY0RhdGEgKikgZGVjQ3RybC0+dmlkZW9EZWNvZGVyRGF0YTsKLSAgICBWb3AgKnByZXZFbmhjVm9wID0gdmlkZW8tPnByZXZFbmhjVm9wOwotICAgIHVpbnQ4ICpkc3RQdHIsICpvcmdQdHIsICpkc3RQdHIyLCAqb3JnUHRyMjsKLSAgICBpbnQzMiBzaXplID0gKGludDMyKSB2aWRlby0+d2lkdGggKiB2aWRlby0+aGVpZ2h0OwotCi0gICAgaWYgKHZpZGVvLT5udW1iZXJPZkxheWVycyA8PSAxKQotICAgICAgICByZXR1cm4gUFZfRkFMU0U7Ci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AgICAgICAgICAgICAgICAqLwotLyogIFB1cnBvc2UgIDogR2V0IHRoZSB2b2wgaW5mbyhvbmx5IGJhc2UtbGF5ZXIpLiAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgSW4vb3V0ICAgOiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICBSZXR1cm4gICA6ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogIE5vdGUgICAgIDogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgTW9kaWZpZWQgOiAwNi8yNC8yMDA0ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PSAqLwotQm9vbCBQVkdldFZvbEluZm8oVmlkZW9EZWNDb250cm9scyAqZGVjQ3RybCwgVm9sSW5mbyAqcFZvbEluZm8pCi17Ci0gICAgVm9sICpjdXJyVm9sOwotCi0gICAgaWYgKHBWb2xJbmZvID09IE5VTEwgfHwgZGVjQ3RybCA9PSBOVUxMIHx8IGRlY0N0cmwtPnZpZGVvRGVjb2RlckRhdGEgPT0gTlVMTCB8fAotICAgICAgICAgICAgKChWaWRlb0RlY0RhdGEgKilkZWNDdHJsLT52aWRlb0RlY29kZXJEYXRhKS0+dm9sWzBdID09IE5VTEwpIHJldHVybiBQVl9GQUxTRTsKLQotICAgIGN1cnJWb2wgPSAoKFZpZGVvRGVjRGF0YSAqKShkZWNDdHJsLT52aWRlb0RlY29kZXJEYXRhKSktPnZvbFswXTsKLQotICAgIC8vIGdldCB0aGUgVk9MIGluZm8KLSAgICBwVm9sSW5mby0+c2hvcnRWaWRlb0hlYWRl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E1QRUctNCBWaWRlbyAoSVNPL0lFQyAxNDQ5Ni0yKSBTdGFuZGFyZAotKiBjb25mb3JtaW5nIHByb2R1Y3RzLiBUaGlzIGNvcHlyaWdodCBub3RpY2UgbXVzdCBiZSBpbmNsdWRlZCBpbiBhbGwgY29waWVzIG9yCi0qIGRlcml2YXRpdmUgd29ya3MuCi0qCi0qIENvcHlyaWdodCAoYykgMTk5NgotKgotKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKLSoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqSGVhZGVyQmVnaW4qKioqKioqCi0qCi0qIEZpbGU6IHZsY19kZWNfdGFiLmgKLSoKLSogQXV0aG9yOiAgIFBhdWxvIE51bmVzIChJU1QpIC0gUGF1bG8uTnVuZXNAaXQuaXN0LnV0bC5wdAotKiBDcmVhdGVkOiAgMS1NYXItOTYKLSoKLSogRGVzY3JpcHRpb246IFRoaXMgZmlsZSBjb250YWlucyB0aGUgVkxDIHRhYmxlcyBmb3IgbW9kdWxlIHdoaWNoIGRlYWxzCi0qICAgICAgIHdpdGggVkxDIGRlY29kaW5nLgotKgotKiBOb3RlczogICAgVGhpcyBmaWxlIHdhcyBjcmVhdGVkIGJhc2VkIG9uIHRtbmRlY29kZQotKiAgICAgICBXcml0dGVuIGJ5IEthcmwgT2xhdiBMaWxsZXZvbGQgPGtvbEBudGEubm8+LAotKiAgICAgICAxOTk1IFRlbGVub3IgUiZELgotKiAgICAgICBEb25hdGVkIHRvIHRoZSBNb211c3lzLXByb2plY3QgYXMgYmFja2dyb3VuZCBjb2RlIGJ5Ci0qICAgICAgIFRlbGVub3IuCi0qCi0qICAgICAgIGJhc2VkIG9uIG1wZWcyZGVjb2RlLCAoQykgMTk5NCwgTVBFRyBTb2Z0d2FyZSBTaW11bGF0aW9uIEdyb3VwCi0qICAgICAgIGFuZCBt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ioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqSGVhZGVyQmVnaW4qKioqKioqCi0qCi0qIEZpbGU6IHZsY19kZWMuYwotKgotKiBBdXRob3I6ICAgUGF1bG8gTnVuZXMgKElTVCkgLSBQYXVsby5OdW5lc0BseC5pdC5wdAotKiBDcmVhdGVkOiAgMS1NYXItOTYKLSoKLSogRGVzY3JpcHRpb246IFRoaXMgZmlsZSBjb250YWlucyB0aGUgVkxDIGZ1bmN0aW9ucyBuZWVkZWQgdG8gZGVjb2RlIGEKLSogICAgICAgYml0c3RyZWFtLgotKgotKiBOb3RlczoKLSogICAgICAgVGhlIGZ1bmN0aW9ucyBjb250YWluZWQgaW4gdGhpcyBmaWxlIHdlcmUgYWRhcHRlZCBmcm9tCi0qICAgICAgIHRtbmRlY29kZQotKiAgICAgICBXcml0dGVuIGJ5IEthcmwgT2xhdiBMaWxsZXZvbGQgPGtvbEBudGEubm8+LAotKiAgICAgICAxOTk1IFRlbGVub3IgUiZELgotKiAgICAgICBEb25hdGVkIHRvIHRoZSBNb211c3lzLXByb2plY3QgYXMgYmFja2dyb3VuZCBjb2RlIGJ5Ci0qICAgICAgIFRlbGVub3IuCi0qCi0qICAgICAgIGJhc2VkIG9uIG1wZWcyZGVjb2RlLCAoQykgMTk5NCwgTVBFRyBTb2Z0d2FyZSBTaW11bGF0aW9uIEdyb3VwCi0qICAgICAgIGFuZCBtcGVnMnBsYXksIChDKSAxOTk0IFN0ZWZhbiBFY2thcnQKLSogICAgICAgICAgICAgICAgICAgPHN0ZWZhbkBsaXMuZS10ZWNobmlrLnR1LW11ZW5jaGVuLmRlPgotKgotKgotKiBNb2RpZmllZDogOS1NYXktOTYgUGF1bG8gTnVuZXM6IFJlZm9ybWF0dGVkLiBOZXcgaGVhZGVycy4KLSogICAgICAgICAgICAgIDE3LUphbi05NyBKYW4gRGUgTGFtZWlsbGlldXJlIChISEkpIDogY29ycmVjdGVkIGluCi0qICAgICAgICAgICAgICAwMS4wNS45NyBMdWlzIER1Y2xhLVNvYXJlczogYWRkZWQgUnZsY0RlY1RDT0VGKCkgdG8gYWxsb3cgZGVjb2RpbmcKLSogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBvZiBSZXZlcnNpYmxlIFZMQ3MuCi0qICAgICAgIDA5LjAzLjk4IFBhdWxvIE51bmVzOiBDbGVhbmluZy4KLSoKLSoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqSGVhZGVyRW5kKioqKioqKioqLwotCi0jaW5jbHVkZSAibXA0ZGVjX2xpYi5oIgotI2luY2x1ZGUgInZsY19kZWNfdGFiLmgiCi0jaW5jbHVkZSAidmxjX2RlY29kZS5oIgotI2luY2x1ZGUgImJpdHN0cmVhbS5oIgotI2luY2x1ZGUgIm1heF9sZXZlbC5oIgotCi0KLS8qID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0gLwotICAgIEZ1bmN0aW9uIDogRGVjb2RlVXNlckRhdGEoKQotICAgIERhdGUgICAgIDogMDQvMTAvMjAwMAotICAgIEhpc3RvcnkgIDoKLSAgICBNb2RpZmllZCA6IDA0LzE2LzIwMDEgOiByZW1vdmVkIHN0YXR1cyBjaGVja2luZyBvZiBQVl9CaXRzdHJlYW1GbHVzaEJpdHMKLQotICAgICAgICBUaGlzIGlzIHNpbXBseSBhIHJlYWxpemF0aW9uIG9mIHRoZSB1c2VyX2RhdGEoKSBmdW5jdGlvbgotICAgICAgICBpbiB0aGUgSVNPL0lFQyAxNDQ5Ni0yIG1hbnVhbC4KLS8gPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PSAqLwotUFZfU1RBVFVTIERlY29kZVVzZXJEYXRhKEJpdHN0cmVhbURlY1ZpZGVvICpzdHJlYW0pCi17Ci0gICAgUFZfU1RBVFVTIHN0YXR1czsKLSAgICB1aW50MzIgY29kZTsKLQotICAgIEJpdHN0cmVhbVJlYWRCaXRzMzJIQyhzdHJlYW0pOwotICAgIEJpdHN0cmVhbVNob3dCaXRzMzIoc3RyZWFtLCAyNCwgJmNvZGUpOwotCi0gICAgd2hpbGUgKGNvZGUgIT0gMSkKLSAgICB7Ci0gICAgICAgIC8qIERpc2NhcmQgdXNlciBkYXRhIGZvciBub3cuICAgMDQvMDUvMjAwMCAqLwotICAgICAgICBCaXRzdHJlYW1SZWFkQml0czE2KHN0cmVhbSwgOCk7Ci0gICAgICAgIEJpdHN0cmVhbVNob3dCaXRzMzIoc3RyZWFtLCAyNCwgJmNvZGUpOwotICAgICAgICBzdGF0dXMgPSBCaXRzdHJlYW1DaGVja0VuZEJ1ZmZlcihzdHJlYW0pOwotICAgICAgICBpZiAoc3RhdHVzID09IFBWX0VORF9PRl9WT1ApIHJldHVybiBzdGF0dXM7ICAgIC8qICAwMy8xOS8yMDAyICovCi0gICAgfQotICAgIHJldHVybiBQVl9TVUNDRVNTOwotfQotCi0KLQotLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqQ29tbWVudEJlZ2luKioqKioqCi0qCi0qICAgICAgIDMvMTAvMDAgIDogaW5pdGlhbCBtb2RpZmljYXRpb24gdG8gdGhlCi0qICAgICAgICAgICAgICAgIG5ldyBQVi1EZWNvZGVyIExpYiBmb3JtYXQuCi0qICAgICAgIDMvMjkvMDAgIDogYWRkZWQgcmV0dXJuIGNvZGUgY2hlY2sgdG8gc29tZSBmdW5jdGlvbnMgYW5kCi0qICAgICAgICAgICAgICAgIG9wdGltaXplIHRoZSBjb2RlLgotKgotKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKipDb21tZW50RW5kKioqKioqKiovCi1QVl9TVEFUVVMgUFZfR2V0TUJ2ZWN0b3JzKFZpZGVvRGVjRGF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bXBvbmVudCB4ICovCi0gICAgICAgICAgICAgICAgc3RhdHVzID0gUFZfVmxjRGVjTVYoc3RyZWFtLCAmdmxjX2NvZGVfbWFnKTsKLSAgICAgICAgICAgICAgICBpZiAoc3RhdHVzICE9IFBWX1NVQ0NFU1MpCi0gICAgICAgICAgICAgICAgewotICAgICAgICAgICAgICAgICAgICByZXR1cm4gc3RhdHVzOwotICAgICAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgICAgIG12eCArPSAoTU9UKXZsY19jb2RlX21hZzsKLSAgICAgICAgICAgICAgICBtdnggPSAoTU9UKSgoKG12eCArIDMyKSAmIDB4M0YpIC0gMzIpOwotCi0KLSAgICAgICAgICAgICAgICBzdGF0dXMgPSBQVl9WbGNEZWNNVihzdHJlYW0sICZ2bGNfY29kZV9tYWcpOwotICAgICAgICAgICAgICAgIGlmIChzdGF0dXMgIT0gUFZfU1VDQ0VTUykKLSAgICAgICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgICAgIHJldHVybiBzdGF0dXM7Ci0gICAgICAgICAgICAgICAgfQotCi0gICAgICAgICAgICAgICAgbXZ5ICs9IChNT1QpdmxjX2NvZGVfbWFnOwotICAgICAgICAgICAgICAgIG12eSA9IChNT1QpKCgobXZ5ICsgMzIpICYgMHgzRikgLSAzMik7Ci0KLSAgICAgICAgICAgICAgICBtb3RfeFtwb3Mrb2Zmc2V0XSA9IChNT1QpIG12eDsKLSAgICAgICAgICAgICAgICBtb3RfeVtwb3Mrb2Zmc2V0XSA9IChNT1QpIG12eTsKLSAgICAgICAgICAgIH0KLSAgICAgICAgfQotICAgICAgICBlbHNlCi0gICAgICAgIHsKLSAgICAgICAgICAgIG12X3ByZWRpY3Rpb24odmlkZW8sIDAsICZtdngsICZtdnkpOwotICAgICAgICAgICAgLyogRm9yIFBWT1BzLCBmaWVsZCAgYXBwZWFycyBvbmx5IGluIE1PREVfSU5URVIgJiBNT0RFX0lOVEVSX1EgKi8KLSAgICAgICAgICAgIHN0YXR1cyA9IFBWX1ZsY0RlY01WKHN0cmVhbSwgJnZsY19jb2RlX21hZyk7Ci0gICAgICAgICAgICBpZiAoc3RhdHVzICE9IFBWX1NVQ0NFU1MpCi0gICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgcmV0dXJuIHN0YXR1czsKLSAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgbXZ4ICs9IChNT1QpdmxjX2NvZGVfbWFnOwotICAgICAgICAgICAgbXZ4ID0gKE1PVCkoKChtdnggKyAzMikgJiAweDNGKSAtIDMyKTsKLQotCi0gICAgICAgICAgICBzdGF0dXMgPSBQVl9WbGNEZWNNVihzdHJlYW0sICZ2bGNfY29kZV9tYWcpOwotICAgICAgICAgICAgaWYgKHN0YXR1cyAhPSBQVl9TVUNDRVNTKQotICAgICAgICAgICAgewotICAgICAgICAgICAgICAgIHJldHVybiBzdGF0dXM7Ci0gICAgICAgICAgICB9Ci0KLQotICAgICAgICAgICAgbXZ5ICs9IChNT1QpdmxjX2NvZGVfbWFnOwotICAgICAgICAgICAgbXZ5ID0gKE1PVCkoKChtdnkgKyAzMikgJiAweDNGKSAtIDMyKTsKLQotCi0gICAgICAgICAgICBtb3RfeFtwb3NdID0gbW90X3hbcG9zKzFdID0gKE1PVCkgbXZ4OwotICAgICAgICAgICAgbW90X3lbcG9zXSA9IG1vdF95W3BvcysxXSA9IChNT1QpIG12eTsKLSAgICAgICAgICAgIHBvcyArPSBkb3VibGVXaWR0aDsKLSAgICAgICAgICAgIG1vdF94W3Bvc10gPSBtb3RfeFtwb3MrMV0gPSAoTU9UKSBtdng7Ci0gICAgICAgICAgICBtb3RfeVtwb3NdID0gbW90X3lbcG9zKzFdID0gKE1PVCkgbXZ5OwotICAgICAgICB9Ci0gICAgfQotICAgIGVsc2UKLSAgICB7Ci0jaWZkZWYgUFZfQU5ORVhfSUpLVF9TVVBQT1JUCi0gICAgICAgIGlmIChtb2RlID09IE1PREVfSU5URVI0ViB8fCBtb2RlID09IE1PREVfSU5URVI0Vl9RKQotI2Vsc2UKLSAgICAgICAgaWYgKG1vZGUgPT0gTU9ERV9JTlRFUjRWKQotI2VuZGlmCi0gICAgICAgIHsKLSAgICAgICAgICAgIGZvciAoayA9IDA7IGsgPCA0OyBrKyspCi0gICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgb2Zmc2V0ID0gKGsgJiAxKSArIChrID4+IDEpICogZG91YmxlV2lkdGg7Ci0gICAgICAgICAgICAgICAgbXZfcHJlZGljdGlvbih2aWRlbywgaywgJm12eCwgJm12eSk7Ci0gICAgICAgICAgICAgICAgc3RhdHVzID0gUFZfRGVjb2RlTUJWZWMoc3RyZWFtLCAmbXZ4LCAmbXZ5LCBmX2NvZGVfZik7Ci0gICAgICAgICAgICAgICAgbW90X3hbcG9zK29mZnNldF0gPSAoTU9UKSBtdng7Ci0gICAgICAgICAgICAgICAgbW90X3lbcG9zK29mZnNldF0gPSAoTU9UKSBtdnk7Ci0gICAgICAgICAgICAgICAgaWYgKHN0YXR1cyAhPSBQVl9TVUNDRVNTKQotICAgICAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHN0YXR1czsKLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICB9Ci0gICAgICAgIH0KLSAgICAgICAgZWxzZQotICAgICAgICB7Ci0gICAgICAgICAgICBtdl9wcmVkaWN0aW9uKHZpZGVvLCAwLCAmbXZ4LCAmbXZ5KTsKLSAgICAgICAgICAgIC8qIEZvciBQVk9QcywgZmllbGQgIGFwcGVhcnMgb25seSBpbiBNT0RFX0lOVEVSICYgTU9ERV9JTlRFUl9RICovCi0gICAgICAgICAgICBzdGF0dXMgPSBQVl9EZWNvZGVNQlZlYyhzdHJlYW0sICZtdngsICZtdnksIGZfY29kZV9mKTsKLSAgICAgICAgICAgIG1vdF94W3Bvc10gPSBtb3RfeFtwb3MrMV0gPSAoTU9UKSBtdng7Ci0gICAgICAgICAgICBtb3RfeVtwb3NdID0gbW90X3lbcG9zKzFdID0gKE1PVCkgbXZ5OwotICAgICAgICAgICAgcG9zICs9IGRvdWJsZVdpZHRoOwotICAgICAgICAgICAgbW90X3hbcG9zXSA9IG1vdF94W3BvcysxXSA9IChNT1QpIG12eDsKLSAgICAgICAgICAgIG1vdF95W3Bvc10gPSBtb3RfeVtwb3MrMV0gPSAoTU9UKSBtdnk7Ci0gICAgICAgICAgICBpZiAoc3RhdHVzICE9IFBWX1NVQ0NFU1MpCi0gICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgcmV0dXJuIHN0YXR1czsKLSAgICAgICAgICAgIH0KLSAgICAgICAgfQotICAgIH0KLSAgICByZXR1cm4gUFZfU1VDQ0VTUzsKLX0KLQotCi0vKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKipDb21tZW50QmVnaW4qKioqKioKLSogICAgICAgMy8xMC8wMCAgOiBpbml0aWFsIG1vZGlmaWNhdGlvbiB0byB0aGUKLSogICAgICAgICAgICAgICAgbmV3IFBWLURlY29kZXIgTGliIGZvcm1hdC4KLSogICAgICAgMy8yOS8wMCAgOiBhZGRlZCByZXR1cm4gY29kZSBjaGVjayB0byBzb21lIGZ1bmN0aW9ucwotKiAgICAgICA1LzEwLzAwICA6IGNoZWNrIHdoZXRoZXIgdGhlIGRlY29kZWQgdmVjdG9yIGlzIGxlZ2FsLgotKiAgICAgICA0LzE3LzAxICA6IHVzZSBNT1QgdHlwZQotKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKipDb21tZW50RW5kKioqKioqKiovCi1QVl9TVEFUVVMgUFZfRGVjb2RlTUJWZWMoQml0c3RyZWFtRGVjVmlkZW8gKnN0cmVhbSwgTU9UICptdl94LCBNT1QgKm12X3ksIGludCBmX2NvZGVfZikKLXsKLSAgICBQVl9TVEFUVVMgc3RhdHVzOwotICAgIGludCAgdmxjX2NvZGVfbWFneCwgdmxjX2NvZGVfbWFneTsKLS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0KLSAgICByZXR1cm4gUFZfU1VDQ0VTUzsKLX0KLQotCi0vKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKipDb21tZW50QmVnaW4qKioqKioKLSogICAgICAgMy8zMS8yMDAwIDogaW5pdGlhbCBtb2RpZmljYXRpb24gdG8gdGhlIG5ldyBQVi1EZWNvZGVyIExpYiBmb3JtYXQuCi0qICAgICAgIDUvMTAvMjAwMCA6IGNoZWNrIHRvIHNlZSBpZiB0aGUgZGVjb2RlZCB2ZWN0b3IgZmFsbHMgd2l0aGluCi0qICAgICAgICAgICAgICAgICAgICAgICAgICAgdGhlIGxlZ2FsIGZjb2RlIHJhbmdlLgotKgotKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKipDb21tZW50RW5kKioqKioqKiovCi1QVl9TVEFUVVMgUFZfRGVTY2FsZU1WRCgKLSAgICBpbnQgIGZfY29kZSwgICAgICAgLyogPC0tIE1WIHJhbmdlIGluIDEvMiB1bml0czogMT0zMiwyPTY0LC4uLiw3PTIwNDggICAgICovCi0gICAgaW50ICByZXNpZHVhbCwgICAgIC8qIDwtLSBwYXJ0IG9mIHRoZSBNViBEaWZmLiBGTEMgY29kZWQgICAgICAgICAgICAgICAgICAqLwotICAgIGludCAgdmxjX2NvZGVfbWFnLCAvKiA8LS0gcGFydCBvZiB0aGUgTVYgRGlmZi4gVkxDIGNvZGVkICAgICAgICAgICAgICAgICAgKi8KLSAgICBNT1QgICp2ZWN0b3IgICAgICAgLyogLS0+IE9idGFpbmVkIE1WIGNvbXBvbmVudCBpbiAxLzIgdW5pdHMgICAgICAgICAgICAgICovCi0pCi17Ci0gICAgaW50ICAgaGFsZl9yYW5nZSA9ICgxIDw8IChmX2NvZGUgKyA0KSk7Ci0gICAgaW50ICAgbWFzayA9IChoYWxmX3JhbmdlIDw8IDEpIC0gMTsKLSAgICBpbnQgICBkaWZmX3ZlY3Rvcj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lby0+bWJudW1fY29sOwotICAgIGludCBtYm51bV9yb3cgPSB2aWRlby0+bWJudW1fcm93OwotICAgIHVpbnQ4ICpzbGljZV9uYiA9IHZpZGVvLT5zbGljZU5vOwotICAgIGludCBuTUJQZXJSb3cgPSB2aWRlby0+bk1CUGVyUm93OwotICAgIGludCBuTVZQZXJSb3cgPSBuTUJQZXJSb3cgPDwgMTsKLSAgICBpbnQgbWJudW0gPSB2aWRlby0+bWJudW07Ci0gICAgaW50IHAxeCA9IDAsIHAyeCA9IDAsIHAzeCA9IDA7Ci0gICAgaW50IHAxeSA9IDAsIHAyeSA9IDAsIHAzeSA9IDA7Ci0gICAgaW50IHJ1bGUxID0gMCwgcnVsZTIgPSAwLCBydWxlMyA9IDA7Ci0gICAgaW50ICAgICBpbmR4OwotCi0gICAgaW5keCA9ICgobWJudW1fY29sIDw8IDEpICsgKGJsb2NrICYgMSkpICsgKChtYm51bV9yb3cgPDwgMSkgICsgKGJsb2NrID4+IDEpKSAqIG5NVlBlclJvdyAtIDE7IC8qIGxlZnQgYmxvY2sgKi8KLQotICAgIGlmIChibG9jayAmIDEpICAgICAgICAgICAvKiBibG9jayAxLCAzICovCi0gICAgewotICAgICAgICBwMXggPSBtb3R4ZGF0YVtpbmR4XTsKLSAgICAgICAgcDF5ID0gbW90eWRhdGFbaW5keF07Ci0gICAgICAgIHJ1bGUxID0gMTsKLSAgICB9Ci0gICAgZWxzZSAgICAgICAgICAgICAgICAgICAgLyogYmxvY2sgMCwgMiAqLwotICAgIHsKLSAgICAgICAgaWYgKG1ibnVtX2NvbCA+IDAgJiYgc2xpY2VfbmJbbWJudW1dID09IHNsaWNlX25iW21ibnVtLTFdKQotICAgICAgICB7Ci0gICAgICAgICAgICBwMXggPSBtb3R4ZGF0YVtpbmR4XTsKLSAgICAgICAgICAgIHAxeSA9IG1vdHlkYXRhW2luZHhdOwotICAgICAgICAgICAgcnVsZTEgPSAxOwotICAgICAgICB9Ci0gICAgfQotCi0gICAgaW5keCA9IGluZHggKyAxIC0gbk1WUGVyUm93OyAvKiB1cHBlcl9ibG9jayAqLwotICAgIGlmIChibG9jayA+PiAxKQotICAgIHsKLSAgICAgICAgaW5keCAtPSAoYmxvY2sgJiAxKTsKLSAgICAgICAgcDJ4ID0gbW90eGRhdGFbaW5keF07Ci0gICAgICAgIHAyeSA9IG1vdHlkYXRhW2luZHhdOwotICAgICAgICBwM3ggPSBtb3R4ZGF0YVtpbmR4ICsgMV07Ci0gICAgICAgIHAzeSA9IG1vdHlkYXRhW2luZHggKyAxXTsKLSAgICAgICAgcnVsZTIgPSBydWxlMyA9IDE7Ci0gICAgfQotICAgIGVsc2UKLSAgICB7ICAgICAgICAgICAgICAgICAgICAgICAgICAgLyogYmxvY2sgMCwxICovCi0gICAgICAgIGlmIChtYm51bV9yb3cpCi0gICAgICAgIHsKLSAgICAgICAgICAgIGlmIChzbGljZV9uYlttYm51bV0gPT0gc2xpY2VfbmJbbWJudW0tbk1CUGVyUm93XSkKLSAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICBwMnggPSBtb3R4ZGF0YVtpbmR4XTsKLSAgICAgICAgICAgICAgICBwMnkgPSBtb3R5ZGF0YVtpbmR4XTsKLSAgICAgICAgICAgICAgICBydWxlMiA9IDE7Ci0gICAgICAgICAgICB9Ci0gICAgICAgICAgICBpZiAobWJudW1fY29sIDwgbk1CUGVyUm93IC0gMSAmJiBzbGljZV9uYlttYm51bV0gPT0gc2xpY2VfbmJbbWJudW0tbk1CUGVyUm93KzFdKQotICAgICAgICAgICAgewotICAgICAgICAgICAgICAgIGluZHggPSBpbmR4ICsgMiAtIChibG9jayAmIDEpOwotICAgICAgICAgICAgICAgIHAzeCA9IG1vdHhkYXRhW2luZHhdOwotICAgICAgICAgICAgICAgIHAzeSA9IG1vdHlkYXRhW2luZHhdOwotICAgICAgICAgICAgICAgIHJ1bGUzID0gMTsKLSAgICAgICAgICAgIH0KLSAgICAgICAgfQotICAgIH0KLQotICAgIGlmIChydWxlMSArIH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8IDQpCi0gICAgewotICAgICAgICAqbXYgPSAtMTsKLSAgICAgICAgcmV0dXJuIFBWX0ZBSUw7Ci0gICAgfQotCi0gICAgY29kZSAtPSA0OwotCi0gICAgUFZfQml0c3RyZWFtRmx1c2hCaXRzKHN0cmVhbSwgUFZfVE1OTVZ0YWIyW2NvZGVdLmxlbiArIDEpOwotCi0gICAgKm12ID0gUFZfVE1OTVZ0YWIyW2NvZGVdLnZhbDsKLSAgICByZXR1cm4gc3RhdHVzOwotfQotCi0KLS8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKkNvbW1lbnRCZWdpbioqKioqKgotKiAgICAgICAzLzMwLzIwMDAgOiBpbml0aWFsIG1vZGlmaWNhdGlvbiB0byB0aGUgbmV3IFBWLURlY29kZXIgTGliCi0qICAgICAgICAgICAgICAgICAgICAgICAgICAgZm9ybWF0IGFuZCB0aGUgY2hhbmdlIG9mIGVycm9yLWhhbmRsaW5nIG1ldGhvZC4KLSogICAgICAgNC8xNi8wMSAgIDogcmVtb3ZlZCBzdGF0dXMgY2hlY2tpbmcgb2YgUFZfQml0c3RyZWFtRmx1c2hCaXRzCi0qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKkNvbW1lbnRFbmQqKioqKioqKi8KLQotaW50IFBWX1ZsY0RlY01DQlBDX2NvbV9pbnRyYShCaXRzdHJlYW1EZWNWaWRlbyAqc3RyZWFtKQotewotICAgIHVpbnQgY29kZTsKLQotICAgIEJpdHN0cmVhbVNob3dCaXRzMTYoc3RyZWFtLCA5LCAmY29kZSk7Ci0KLQotICAgIGlmIChjb2RlIDwgOCkKLSAgICB7Ci0gICAgICAgIHJldHVybiBWTENfQ09ERV9FUlJPUjsKLSAgICB9Ci0KLSAgICBjb2RlID4+PSAzOwotCi0gICAgaWYgKGNvZGUgPj0gMzIpCi0gICAgewotICAgICAgICBQVl9CaXRzdHJlYW1GbHVzaEJpdHMoc3RyZWFtLCAxKTsKLSAgICAgICAgcmV0dXJuIDM7Ci0gICAgfQotCi0gICAgUFZfQml0c3RyZWFtRmx1c2hCaXRzKHN0cmVhbSwgUFZfTUNCUEN0YWJpbnRyYVtjb2RlXS5sZW4pOwotCi0gICAgcmV0dXJuIFBWX01DQlBDdGFiaW50cmFbY29kZV0udmFsOwotfQotCi0KLS8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKkNvbW1lbnRCZWdpbioqKioqKgotKgotKiAgICAgICAzLzMwLzIwMDAgOiBpbml0aWFsIG1vZGlmaWNhdGlvbiB0byB0aGUgbmV3IFBWLURlY29kZXIgTGliCi0qICAgICAgICAgICAgICAgICAgICAgICAgICAgZm9ybWF0IGFuZCB0aGUgY2hhbmdlIG9mIGVycm9yLWhhbmRsaW5nIG1ldGhvZC4KLSogICAgICAgNC8xNi8yMDAxIDogcmVtb3ZlZCBjaGVja2luZyBvZiByZXR1cm4gc3RhdHVzIG9mIFBWX0JpdHN0cmVhbUZsdXNoQml0cwotKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKipDb21tZW50RW5kKioqKioqKiovCi0KLWludCBQVl9WbGNEZWNNQ0JQQ19jb21faW50ZXIoQml0c3RyZWFtRGVjVmlkZW8gKnN0cmVhbSkKLXsKLSAgICB1aW50IGNvZGU7Ci0KLSAgICBCaXRzdHJlYW1TaG93Qml0czE2KHN0cmVhbSwgOSwgJmNvZGUpOwotCi0gICAgaWYgKGNvZGUgPT0gMCkKLSAgICB7Ci0gICAgICAgIHJldHVybiBWTENfQ09ERV9FUlJPUjsKLSAgICB9Ci0gICAgZWxzZSBpZiAoY29kZSA+PSAyNTYpCi0gICAgewotICAgICAgICBQVl9CaXRzdHJlYW1GbHVzaEJpdHMoc3RyZWFtLCAxKTsKLSAgICAgICAgcmV0dXJuIDA7Ci0gICAgfQotCi0gICAgUFZf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GlvbiB0byB0aGUgbmV3IFBWLURlY29kZXIgTGliCi0qICAgICAgICAgICAgICAgICAgICAgICAgICAgZm9ybWF0IGFuZCB0aGUgY2hhbmdlIG9mIGVycm9yLWhhbmRsaW5nIG1ldGhvZC4KLSogICAgICAgNC8xNi8yMDAxIDogcmVtb3ZlZCBzdGF0dXMgY2hlY2tpbmcgZm9yIFBWX0JpdHN0cmVhbUZsdXNoQml0cwotKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKipDb21tZW50RW5kKioqKioqKiovCi0KLWludCBQVl9WbGNEZWNDQlBZKEJpdHN0cmVhbURlY1ZpZGVvICpzdHJlYW0sIGludCBpbnRyYSkKLXsKLSAgICBpbnQgQ0JQWSA9IDA7Ci0gICAgdWludCBjb2RlOwotCi0gICAgQml0c3RyZWFtU2hvd0JpdHMxNihzdHJlYW0sIDYsICZjb2RlKTsKLQotCi0gICAgaWYgKGNvZGUgPCAyKQotICAgIHsKLSAgICAgICAgcmV0dXJuIC0xOwotICAgIH0KLSAgICBlbHNlIGlmIChjb2RlID49IDQ4KQotICAgIHsKLSAgICAgICAgUFZfQml0c3RyZWFtRmx1c2hCaXRzKHN0cmVhbSwgMik7Ci0gICAgICAgIENCUFkgPSAxNTsKLSAgICB9Ci0gICAgZWxzZQotICAgIHsKLSAgICAgICAgUFZfQml0c3RyZWFtRmx1c2hCaXRzKHN0cmVhbSwgUFZfQ0JQWXRhYltjb2RlXS5sZW4pOwotICAgICAgICBDQlBZID0gUFZfQ0JQWXRhYltjb2RlXS52YWw7Ci0gICAgfQotCi0gICAgaWYgKGludHJhID09IDApIENCUFkgPSAxNSAtIENCUFk7Ci0gICAgQ0JQWSA9IENCUFkgJiAxNTsKLSAgICByZXR1cm4gQ0JQWTsKLX0KLQotCi0vKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKipDb21tZW50QmVnaW4qKioqKioKLSogICAgICAgMy8zMS8yMDAwIDogaW5pdGlhbCBtb2RpZmljYXRpb24gdG8gdGhlIG5ldyBQVi1EZWNvZGVyIExpYiBmb3JtYXQuCi0qCi0qICAgICAgIDgvMjMvMjAwMCA6IG9wdGltaXplIHRoZSBmdW5jdGlvbiBieSByZW1vdmluZyB1bm5lY2Vzc2FyeSBCaXRzdHJlYW1TaG93Qml0cygpCi0qICAgICAgICAgICAgICAgICAgICAgICBmdW5jdGlvbiBjYWxscy4KLSoKLSogICAgICAgOS82LzIwMDAgOiBjaGFuZ2UgdGhlIEFQSSB0byBjaGVjayBmb3IgZW5kLW9mLWJ1ZmZlciBmb3IgcHJvcGVyCi0qICAgICAgICAgICAgICAgICAgICAgICAgICAgdGVybWluYXRpb24gb2YgZGVjb2RpbmcgcHJvY2Vzcy4KLSoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqQ29tbWVudEVuZCoqKioqKioqLwotUFZfU1RBVFVTIFBWX1ZsY0RlY0ludHJhRENQcmVkU2l6ZShCaXRzdHJlYW1EZWNWaWRlbyAqc3RyZWFtLCBpbnQgY29tcG51bSwgdWludCAqRENfc2l6ZSkKLXsKLSAgICBQVl9TVEFUVVMgc3RhdHVzID0gUFZfRkFJTDsgICAgICAvKiAgMDcvMDkvMDEgKi8KLSAgICB1aW50ICBjb2RlOwotCi0gICAgKkRDX3NpemUgPSAwOwotICAgIGlmIChjb21wbnVtIDwgNCkgIC8qIGx1bWluYW5jZSBibG9jayAqLwotICAgIHsKLQotICAgICAgICBCaXRzdHJlYW1TaG93Qml0czE2KHN0cmVhbSwgMTEsICZjb2RlKTsKLQotICAgICAgICBpZiAoY29kZSA9PSAxKQotICAgICAgICB7Ci0gICAgICAgICAgICAqRENfc2l6ZSA9IDEyOwotICAgICAgICAgICAgUFZfQml0c3RyZWFtRmx1c2hCaXRzKHN0cmVhbSwgMTEpOwotICAgICAgICAgICAgcmV0dXJuIFBWX1NVQ0NFU1M7Ci0gICAgICAgIH0KLSAgICAgICAgY29kZSA+Pj0gMTsKLSAgICAgICAgaWYgKGNvZGUgPT0gMSkKLSAgICAgICAgewotICAgICAgICAgICAgKkRDX3NpemUgPSAxMTsKLSAgICAgICAgICAgIFBWX0JpdHN0cmVhbUZsdXNoQml0cyhzdHJlYW0sIDEwKTsKLSAgICAgICAgICAgIHJldHVybiBQVl9TVUNDRVNTOwotICAgICAgICB9Ci0gICAgICAgIGNvZGUgPj49IDE7Ci0gICAgICAgIGlmIChjb2RlID09IDEpCi0gICAgICAgIHsKLSAgICAgICAgICAgICpEQ19zaXplID0gMTA7Ci0gICAgICAgICAgICBQVl9CaXRzdHJlYW1GbHVzaEJpdHMoc3RyZWFtLCA5KTsKLSAgICAgICAgICAgIHJldHVybiBQVl9TVUNDRVNTOwotICAgICAgICB9Ci0KLSAgICAgICAgY29kZSA+Pj0gMTsKLSAgICAgICAgaWYgKGNvZGUgPT0gMSkKLSAgICAgICAgewotICAgICAgICAgICAgKkRDX3NpemUgPSA5OwotICAgICAgICAgICAgUFZfQml0c3RyZWFtRmx1c2hCaXRzKHN0cmVhbSwgOCk7Ci0gICAgICAgICAgICByZXR1cm4gUFZfU1VDQ0VTUzsKLSAgICAgICAgfQotCi0gICAgICAgIGNvZGUgPj49IDE7Ci0gICAgICAgIGlmIChjb2RlID09IDEpCi0gICAgICAgIHsKLSAgICAgICAgICAgICpEQ19zaXplID0gODsKLSAgICAgICAgICAgIFBWX0JpdHN0cmVhbUZsdXNoQml0cyhzdHJlYW0sIDcpOwotICAgICAgICAgICAgcmV0dXJuIFBWX1NVQ0NFU1M7Ci0gICAgICAgIH0KLQotICAgICAgICBjb2RlID4+PSAxOwotICAgICAgICBpZiAoY29kZSA9PSAxKQotICAgICAgICB7Ci0gICAgICAgICAgICAqRENfc2l6ZSA9IDc7Ci0gICAgICAgICAgICBQVl9CaXRzdHJlYW1GbHVzaEJpdHMoc3RyZWFtLCA2KTsKLSAgICAgICAgICAgIHJldHVybiBQVl9TVUNDRVNTOwotICAgICAgICB9Ci0KLSAgICAgICAgY29kZSA+Pj0gMTsKLSAgICAgICAgaWYgKGNvZGUgPT0gMSkKLSAgICAgICAgewotICAgICAgICAgICAgKkRDX3NpemUgPSA2OwotICAgICAgICAgICAgUFZfQml0c3RyZWFtRmx1c2hCaXRzKHN0cmVhbSwgNSk7Ci0gICAgICAgICAgICByZXR1cm4gUFZfU1VDQ0VTUzsKLSAgICAgICAgfQotCi0gICAgICAgIGNvZGUgPj49IDE7Ci0gICAgICAgIGlmIChjb2RlID09IDEpCi0gICAgICAgIHsKLSAgICAgICAgICAgICpEQ19zaXplID0gNTsKLSAgICAgICAgICAgIFBWX0JpdHN0cmVhbUZsdXNoQml0cyhzdHJlYW0sIDQpOwotICAgICAgICAgICAgcmV0dXJuIFBWX1NVQ0NFU1M7Ci0gICAgICAgIH0KLQotICAgICAgICBjb2RlID4+PSAxOwotICAgICAgICBpZiAoY29kZSA9PSAxKQotICAgICAgICB7Ci0gICAgICAgICAgICAqRENfc2l6ZSA9IDQ7Ci0gICAgICAgICAgICBQVl9CaXRzdHJlYW1GbHVzaEJpdHMoc3RyZWFtLCAzKTsKLSAgICAgICAgICAgIHJldHVybiBQVl9TVUNDRVNTOwotICAgICAgICB9Ci0gICAgICAgIGVsc2UgaWYgKGNvZGUgPT0gMikKLSAgICAgICAgewotICAgICAgICAgICAgKkRDX3NpemUgPSAzOwotICAgICAgICAgICAgUFZfQml0c3RyZWFtRmx1c2hCaXRzKHN0cmVhbSwgMyk7Ci0gICAgICAgICAgICByZXR1cm4gUFZfU1VDQ0VTUzsKLSAgICAgICAgfQotICAgICAgICBlbHNlIGlmIChjb2RlID09IDMpCi0gICAgICAgIHsKLSAgICAgICAgICAgICpEQ19zaXplID0gMDsKLSAgICAgICAgICAgIFBWX0JpdHN0cmVhbUZsdXNoQml0cyhzdHJlYW0sIDMpOwotICAgICAgICAgICAgcmV0dXJuIFBWX1NVQ0NFU1M7Ci0gICAgICAgIH0KLQotICAgICAgICBjb2RlID4+PSAxOwotICAgICAgICBpZiAoY29kZSA9PSAyKQotICAgICAgICB7Ci0gICAgICAgICAgICAqRENfc2l6ZSA9IDI7Ci0gICAgICAgICAgICBQVl9CaXRzdHJlYW1GbHVzaEJpdHMoc3RyZWFtLCAyKTsKLSAgICAgICAgICAgIHJldHVybiBQVl9TVUNDRVNTOwotICAgICAgICB9Ci0gICAgICAgIGVsc2UgaWYgKGNvZGUgPT0gMykKLSAgICAgICAgewotICAgICAgICAgICAgKkRDX3NpemUgPSAxOwotICAgICAgICAgICAgUFZfQml0c3RyZWFtRmx1c2hCaXRzKHN0cmVhbSwgMik7Ci0gICAgICAgICAgICByZXR1cm4gUFZfU1VDQ0VTUzsKLSAgICAgICAgfQotICAgIH0KLSAgICBlbHNlIC8qIGNocm9taW5hbmNlIGJsb2NrICovCi0gICAgewotCi0gICAgICAgIEJpdHN0cmVhbVNob3cxM0JpdHMoc3RyZWFtLCAmY29kZSk7Ci0gICAgICAgIGNvZGUgPj49IDE7Ci0gICAgICAgIGlmIChjb2RlID09IDEpCi0gICAgICAgIHsKLSAgICAgICAgICAgICpEQ19zaXplID0gMTI7Ci0gICAgICAgICAgICBQVl9CaXRzdHJlYW1GbHVzaEJpdHMoc3RyZWFtLCAxMik7Ci0gICAgICAgICAgICByZXR1cm4gUFZfU1VDQ0VTUzsKLSAgICAgICAgfQotCi0gICAgICAgIGNvZGUgPj49IDE7Ci0gICAgICAgIGlmIChjb2RlID09IDEpCi0gICAgICAgIHsKLSAgICAgICAgICAgICpEQ19zaXplID0gMTE7Ci0gICAgICAgICAgICBQVl9CaXRzdHJlYW1GbHVzaEJpdHMoc3RyZWFtLCAxMSk7Ci0gICAgICAgICAgICByZXR1cm4gUFZfU1VDQ0VTUzsKLSAgICAgICAgfQotCi0gICAgICAgIGNvZGUgPj49IDE7Ci0gICAgICAgIGlmIChjb2RlID09IDEpCi0gICAgICAgIHsKLSAgICAgICAgICAgICpEQ19zaXplID0gMTA7Ci0gICAgICAgICAgICBQVl9CaXRzdHJlYW1GbHVzaEJpdHMoc3RyZWFtLCAxMCk7Ci0gICAgICAgICAgICByZXR1cm4gUFZfU1VDQ0VTUzsKLSAgICAgICAgfQotCi0gICAgICAgIGNvZGUgPj49IDE7Ci0gICAgICAgIGlmIChjb2RlID09IDEpCi0gICAgICAgIHsKLSAgICAgICAgICAgICpEQ19zaXplID0gOTsKLSAgICAgICAgICAgIFBWX0JpdHN0cmVhbUZsdXNoQml0cyhzdHJlYW0sIDkpOwotICAgICAgICAgICAgcmV0dXJuIFBWX1NVQ0NFU1M7Ci0gICAgICAgIH0KLQotICAgICAgICBjb2RlID4+PSAxOwotICAgICAgICBpZiAoY29kZSA9PSAxKQotICAgICAgICB7Ci0gICAgICAgICAgICAqRENfc2l6ZSA9IDg7Ci0gICAgICAgICAgICBQVl9CaXRzdHJlYW1GbHVzaEJpdHMoc3RyZWFtLCA4KTsKLSAgICAgICAgICAgIHJldHVybiBQVl9TVUNDRVNTOwotICAgICAgICB9Ci0KLSAgICAgICAgY29kZSA+Pj0gMTsKLSAgICAgICAgaWYgKGNvZGUgPT0gMSkKLSAgICAgICAgewotICAgICAgICAgICAgKkRDX3NpemUgPSA3OwotICAgICAgICAgICAgUFZfQml0c3RyZWFtRmx1c2hCaXRzKHN0cmVhbSwgNyk7Ci0gICAgICAgICAgICByZXR1cm4gUFZfU1VDQ0VTUzsKLSAgICAgICAgfQotCi0gICAgICAgIGNvZGUgPj49IDE7Ci0gICAgICAgIGlmIChjb2RlID09IDEpCi0gICAgICAgIHsKLSAgICAgICAgICAgICpEQ19zaXplID0gNjsKLSAgICAgICAgICAgIFBWX0JpdHN0cmVhbUZsdXNoQml0cyhzdHJlYW0sIDYpOwotICAgICAgICAgICAgcmV0dXJuIFBWX1NVQ0NFU1M7Ci0gICAgICAgIH0KLQotICAgICAgICBjb2RlID4+PSAxOwotICAgICAgICBpZiAoY29kZSA9PSAxKQotICAgICAgICB7Ci0gICAgICAgICAgICAqRENfc2l6ZSA9IDU7Ci0gICAgICAgICAgICBQVl9CaXRzdHJlYW1GbHVzaEJpdHMoc3RyZWFtLCA1KTsKLSAgICAgICAgICAgIHJldHVybiBQVl9TVUNDRVNTOwotICAgICAgICB9Ci0KLSAgICAgICAgY29kZSA+Pj0gMTsKLSAgICAgICAgaWYgKGNvZGUgPT0gMSkKLSAgICAgICAgewotICAgICAgICAgICAgKkRDX3NpemUgPSA0OwotICAgICAgICAgICAgUFZfQml0c3RyZWFtRmx1c2hCaXRzKHN0cmVhbSwgNCk7Ci0gICAgICAgICAgICByZXR1cm4gUFZfU1VDQ0VTUzsKLSAgICAgICAgfQotCi0gICAgICAgIGNvZGUgPj49IDE7Ci0gICAgICAgIGlmIChjb2RlID09IDEpCi0gICAgICAgIHsKLSAgICAgICAgICAgICpEQ19zaXplID0gMzsKLSAgICAgICAgICAgIFBWX0JpdHN0cmVhbUZsdXNoQml0cyhzdHJlYW0sIDMpOwotICAgICAgICAgICAgcmV0dXJuIFBWX1NVQ0NFU1M7Ci0gICAgICAgIH0KLQotICAgICAgICBjb2RlID4+PSAxOwotICAgICAgICB7Ci0gICAgICAgICAgICAqRENfc2l6ZSA9IChpbnQpKDMgLSBjb2RlKTsKLSAgICAgICAgICAgIFBWX0JpdHN0cmVhbUZsdXNoQml0cyhzdHJlYW0sIDIpOwotICAgICAgICAgICAgcmV0dXJuIFBWX1NVQ0NFU1M7Ci0gICAgICAgIH0KLSAgICB9Ci0KLSAgICByZXR1cm4gc3RhdHVzOwotfQotCi0vKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKipDb21tZW50QmVnaW4qKioqKioKLSoKLSoKLSogICAgICAgMy8zMC8yMDAwIDogaW5pdGlhbCBtb2RpZmljYXRpb24gdG8gdGhlIG5ldyBQVi1EZWNvZGVyIExpYgotKiAgICAgICAgICAgICAgICAgICAgICAgICAgIGZvcm1hdCBhbmQgdGhlIGNoYW5nZSBvZiBlcnJvci1oYW5kbGluZyBtZXRob2QuCi0qCi0qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKkNvbW1lbnRFbmQqKioqKioqKi8KLQotCi0KLVBWX1NUQVRVUyBWbGNEZWNUQ09FRkludHJhKEJpdHN0cmVhbURlY1ZpZGVvICpzdHJlYW0sIFRjb2VmICpwVGNvZWYpCi17Ci0gICAgdWludCBjb2RlOwotICAgIGNvbnN0IFZMQ3RhYjIgKnRhYjsKLQotICAgIEJpdHN0cmVhbVNob3cxM0JpdHMoc3RyZWFtLCAmY29kZSk7Ci0KLSAgICAvKiAxMC8xNy8yMDAwLCBwZXJmb3JtIGEgbGl0dGxlIGJpdCBiZXR0ZXIgb24gQVJNIGJ5IHB1dHRpbmcgdGhlIHdob2xlIGZ1bmN0aW9uIGluIFZsY0RlY1RDT0VGRkludHJhICovCi0gICAgLyogIGlmKEdldFRjb2VmZkludHJhKGNvZGUscFRjb2VmLCZ0YWIsc3RyZWFtKSE9UFZfU1VDQ0VTUykgcmV0dXJuIHN0YXR1czsqLwotICAgIGlmIChjb2RlID49IDEwMjQpCi0gICAgewotICAgICAgICB0YWIgPSAmUFZfRENUM0R0YWIzWyhjb2RlID4+IDYpIC0gMTZdOwotICAgIH0KLSAgICBlbHNlCi0gICAgewotICAgICAgICBpZiAoY29kZSA+PSAyNTYpCi0gICAgICAgIHsKLSAgICAgICAgICAgIHRhYiA9ICZQVl9EQ1QzRHRhYjRbKGNvZGUgPj4gMykgLSAzMl07Ci0gICAgICAgIH0KLSAgICAgICAgZWxzZQotICAgICAgICB7Ci0gICAgICAgICAgICBpZiAoY29kZSA+PSAxNikKLSAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICB0YWIgPSAmUFZfRENUM0R0YWI1Wyhjb2RlPj4xKSAtIDhdOwotICAgICAgICAgICAgfQotICAgICAgICAgICAgZWxzZQotICAgICAgICAgICAgewotICAgICAgICAgICAgICAgIHJldHVybiBQVl9G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nRhYixzdHJlYW0pIT1QVl9TVUNDRVNTKSByZXR1cm4gc3RhdHVzOyovCi0gICAgICAgIGlmIChjb2RlID49IDEwMjQpCi0gICAgICAgIHsKLSAgICAgICAgICAgIHRhYiA9ICZQVl9EQ1QzRHRhYjNbKGNvZGUgPj4gNikgLSAxNl07Ci0gICAgICAgIH0KLSAgICAgICAgZWxzZQotICAgICAgICB7Ci0gICAgICAgICAgICBpZiAoY29kZSA+PSAyNTYpCi0gICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgdGFiID0gJlBWX0RDVDNEdGFiNFsoY29kZSA+PiAzKSAtIDMyXTsKLSAgICAgICAgICAgIH0KLSAgICAgICAgICAgIGVsc2UKLSAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICBpZiAoY29kZSA+PSAxNikKLSAgICAgICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgICAgIHRhYiA9ICZQVl9EQ1QzRHRhYjVbKGNvZGU+PjEpIC0gOF07Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgIGVsc2UKLSAgICAgICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgICAgIHJldHVybiBQVl9GQUlMOwotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgIH0KLSAgICAgICAgfQotCi0gICAgICAgIFBWX0JpdHN0cmVhbUZsdXNoQml0cyhzdHJlYW0sIHRhYi0+bGVuICsgMSk7Ci0KLSAgICAgICAgLyogc2lnbiBiaXQgKi8KLSAgICAgICAgcFRjb2VmLT5zaWduID0gKGNvZGUgPj4gKDEyIC0gdGFiLT5sZW4pKSAmIDE7Ci0gICAgICAgIHBUY29lZi0+cnVuID0gKHVpbnQpdGFiLT5ydW47IC8vKHRhYi0+dmFsID4+IDgpICYgMjU1OwotICAgICAgICBwVGNvZWYtPmxldmVsID0gKGludCl0YWItPmxldmVsOyAvL3RhYi0+dmFsICYgMjU1OwotICAgICAgICBwVGNvZWYtPmxhc3QgPSAodWludCl0YWItPmx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ICAgIHRhYiA9ICZQVl9EQ1QzRHRhYjNbKGNvZGUgPj4gNikgLSAxNl07Ci0gICAgICAgICAgICB9Ci0gICAgICAgICAgICBlbHNlCi0gICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgaWYgKGNvZGUgPj0gMjU2KQotICAgICAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAgICAgdGFiID0gJlBWX0RDVDNEdGFiNFsoY29kZSA+PiAzKSAtIDMyXTsKLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgZWxzZQotICAgICAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAgICAgaWYgKGNvZGUgPj0gMTYpCi0gICAgICAgICAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAgICAgICAgIHRhYiA9ICZQVl9EQ1QzRHRhYjVbKGNvZGU+PjEpIC0gOF07Ci0gICAgICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICAgICAgZWxzZQotICAgICAgICAgICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gUFZfRkFJTDsKLSAgICAgICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgUFZfQml0c3RyZWFtRmx1c2hCaXRzKHN0cmVhbSwgdGFiLT5sZW4gKyAxKTsKLSAgICAgICAgICAgIC8qIHNpZ24gYml0ICovCi0gICAgICAgICAgICBwVGNvZWYtPnNpZ24gPSAoY29kZSA+PiAoMTIgLSB0YWItPmxlbikpICYgMTsKLSAgICAgICAgICAgIHBUY29lZi0+cnVuID0gKHVpbnQpdGFiLT5ydW47IC8vKHRhYi0+dmFsID4+IDgpICYgMjU1OwotICAgICAgICAgICAgcFRjb2VmLT5sZXZlbCA9IChpbnQpdGFiLT5sZXZlbDsgLy90YWItPnZhbCAmIDI1NTsKLSAgICAgICAgICAgIHBUY29lZi0+bGFzdCA9ICh1aW50KXRhYi0+bGFzdDsgLy8odGFiLT52YWwgPj4gMTYpICYgMTsKLQotCi0KLSAgICAgICAgICAgIC8qIG5lZWQgdG8gYWRkIGJhY2sgdGhlIG1heCBydW4gKi8KLSAgICAgICAgICAgIGlmIChwVGNvZWYtPmxhc3QpCi0gICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgaWYgKHBUY29lZi0+bGV2ZWwgPiA4KQotICAgICAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFBWX0ZBSUw7Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgIHBUY29lZi0+cnVuID0gcFRjb2VmLT5ydW4gKyBpbnRyYV9tYXhfcnVuMVtwVGNvZWYtPmxldmVsXSArIDE7Ci0gICAgICAgICAgICB9Ci0gICAgICAgICAgICBlbHNlCi0gICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgaWYgKHBUY29lZi0+bGV2ZWwgPiAyNykKLSAgICAgICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgICAgIHJldHVybiBQVl9GQUlMOwotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICBwVGNvZWYtPnJ1biA9IHBUY29lZi0+cnVuICsgaW50cmFfbWF4X3J1bjBbcFRjb2VmLT5sZXZlbF0gKyAxOwotICAgICAgICAgICAgfQotCi0KLSAgICAgICAgfQotICAgICAgICBlbHNlCi0gICAgICAgIHsKLQotICAgICAgICAgICAgY29kZSA9IEJpdHN0cmVhbVJlYWRCaXRzMTZfSU5MSU5FKHN0cmVhbSwgOCk7Ci0gICAgICAgICAgICBwVGNvZWYtPmxhc3QgPSBjb2RlID4+IDc7Ci0gICAgICAgICAgICBwVGNvZWYtPnJ1biA9IChjb2RlID4+IDEpICYgMHgzRjsKLSAgICAgICAgICAgIHBUY29lZi0+bGV2ZWwgPSAoaW50KShCaXRzdHJlYW1SZWFkQml0czE2X0lOTElORShzdHJlYW0sIDEzKSA+PiAxKTsKLQotICAgICAgICAgICAgaWYgKH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XQgKi8KLSAgICAgICAgQml0c3RyZWFtU2hvdzEzQml0cyhzdHJlYW0sICZjb2RlKTsKLQotICAgICAgICAvKiAxMC8xNy8yMDAwLCBwZXJmb3JtIGEgbGl0dGxlIGJpdCBiZXR0ZXIgb24gQVJNIGJ5IHB1dHRpbmcgdGhlIHdob2xlIGZ1bmN0aW9uIGluIFZsY0RlY1RDT0VGRkludGVyICovCi0gICAgICAgIC8qICAgICAgICAgIGlmKEdldFRjb2VmZkludGVyKGNvZGUscFRjb2VmLCZ0YWIsc3RyZWFtKSE9UFZfU1VDQ0VTUykgcmV0dXJuIHN0YXR1czsqLwotICAgICAgICBpZiAoY29kZSA+PSAxMDI0KQotICAgICAgICB7Ci0gICAgICAgICAgICB0YWIgPSAmUFZfRENUM0R0YWIwWyhjb2RlID4+IDYpIC0gMTZdOwotICAgICAgICB9Ci0gICAgICAgIGVsc2UKLSAgICAgICAgewotICAgICAgICAgICAgaWYgKGNvZGUgPj0gMjU2KQotICAgICAgICAgICAgewotICAgICAgICAgICAgICAgIHRhYiA9ICZQVl9EQ1QzRHRhYjFbKGNvZGUgPj4gMykgLSAzMl07Ci0gICAgICAgICAgICB9Ci0gICAgICAgICAgICBlbHNlCi0gICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgaWYgKGNvZGUgPj0gMTYpCi0gICAgICAgICAgICAgICAgewotICAgICAgICAgICAgICAgICAgICB0YWIgPSAmUFZfRENUM0R0YWIyWyhjb2RlPj4xKSAtIDhdOwotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICBlbHNlCi0gICAgICAgICAgICAgICAgewotICAgICAgICAgICAgICAgICAgICByZXR1cm4gUFZfRkFJTDsKLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICB9Ci0gICAgICAgIH0KLSAgICAgICAgUFZfQml0c3RyZWFtRmx1c2hCaXRzKHN0cmVhbSwgdGFiLT5sZW4gKyAxKTsKLSAgICAgICAgcFRjb2VmLT5zaWduID0gKGNvZG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luZyB0aGUgd2hvbGUgZnVuY3Rpb24gaW4gVmxjRGVjVENPRUZGSW50ZXIgKi8KLSAgICAgICAgICAgIC8qaWYoR2V0VGNvZWZmSW50ZXIoY29kZSxwVGNvZWYsJnRhYixzdHJlYW0pIT1QVl9TVUNDRVNTKSByZXR1cm4gc3RhdHVzOyovCi0gICAgICAgICAgICBpZiAoY29kZSA+PSAxMDI0KQotICAgICAgICAgICAgewotICAgICAgICAgICAgICAgIHRhYiA9ICZQVl9EQ1QzRHRhYjBbKGNvZGUgPj4gNikgLSAxNl07Ci0gICAgICAgICAgICB9Ci0gICAgICAgICAgICBlbHNlCi0gICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgaWYgKGNvZGUgPj0gMjU2KQotICAgICAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAgICAgdGFiID0gJlBWX0RDVDNEdGFiMVsoY29kZSA+PiAzKSAtIDMyXTsKLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgZWxzZQotICAgICAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAgICAgaWYgKGNvZGUgPj0gMTYpCi0gICAgICAgICAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAgICAgICAgIHRhYiA9ICZQVl9EQ1QzRHRhYjJbKGNvZGU+PjEpIC0gOF07Ci0gICAgICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICAgICAgZWxzZQotICAgICAgICAgICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gUFZfRkFJTDsKLSAgICAgICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgIH0KLSAgICAgICAgICAgIFBWX0JpdHN0cmVhbUZsdXNoQml0cyhzdHJlYW0sIHRhYi0+bGVuICsgMSk7Ci0gICAgICAgICAgICBwVGNvZWYtPnNpZ24gPSAoY29kZSA+PiAoMTIgLSB0YWItPmxlbikpICYgMTsKLSAgICAgICAgICAgIHBUY29lZi0+cnVuID0gKHVpbnQpdGFiLT5ydW47ICAgICAvLyh0YWItPnZhbCA+PiA0KSAmIDI1NTsKLSAgICAgICAgICAgIHBUY29lZi0+bGV2ZWwgPSAoaW50KXRhYi0+bGV2ZWw7IC8vdGFiLT52YWwgJiAxNTsKLSAgICAgICAgICAgIHBUY29lZi0+bGFzdCA9ICh1aW50KXRhYi0+bGFzdDsgICAvLyh0YWItPnZhbCA+PiAxMikgJiAxOwotCi0gICAgICAgICAgICAvKiBuZWVkIHRvIGFkZCBiYWNrIHRoZSBtYXggcnVuICovCi0gICAgICAgICAgICBpZiAocFRjb2VmLT5sYXN0KQotICAgICAgICAgICAgewotICAgICAgICAgICAgICAgIGlmIChwVGNvZWYtPmxldmVsID4gMykKLSAgICAgICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgICAgIHJldHVybiBQVl9GQUlMOwotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICBwVGNvZWYtPnJ1biA9IHBUY29lZi0+cnVuICsgaW50ZXJfbWF4X3J1bjFbcFRjb2VmLT5sZXZlbF0gKyAxOwotICAgICAgICAgICAgfQotICAgICAgICAgICAgZWxzZQotICAgICAgICAgICAgewotICAgICAgICAgICAgICAgIGlmIChwVGNvZWYtPmxldmVsID4gMTIpCi0gICAgICAgICAgICAgICAgewotICAgICAgICAgICAgICAgICAgICByZXR1cm4gUFZfRkFJTDsKLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgcFRjb2VmLT5ydW4gPSBwVGNvZWYtPnJ1biArIGludGVyX21heF9ydW4wW3BUY29lZi0+bGV2ZWxdICsgMTsKLSAgICAgICAgICAgIH0KLSAgICAgICAgfQotICAgICAgICBlbHNlCi0gICAgICAgIHsKLQotICAgICAgICAgICAgY29kZSA9IEJpdHN0cmVhbVJlYWRCaXRzMTZfSU5MSU5FKHN0cmVhbSwgOCk7Ci0gICAgICAgICAgICBwVGNvZWYtPmxhc3QgPSBjb2RlID4+IDc7Ci0gICAgICAgICAgICBwVGNvZWYtPnJ1biA9IChjb2RlID4+IDEpICYgMHgzRjsKLSAgICAgICAgICAgIHBUY29lZi0+bGV2ZWwgPSAoaW50KShCaXRzdHJlYW1SZWFkQml0czE2X0lOTElORShzdHJlYW0sIDEzKSA+PiAxKTsKLQotCi0KLSAgICAgICAgICAgIGlmIChwVGNvZWYtPmxldmVsID49IDIwNDgpCi0gICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgcFRjb2VmLT5zaWduID0gMTsKLSAgICAgICAgICAgICAgICBwVGNvZWYtPmxldmVsID0gNDA5NiAtIHBUY29lZi0+bGV2ZWw7Ci0gICAgICAgICAgICB9Ci0gICAgICAgICAgICBlbHNlCi0gICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgcFRjb2VmLT5zaWduID0gMDsKLSAgICAgICAgICAgIH0KLSAgICAgICAgfSAvKiBmbGMgKi8KLSAgICB9Ci0KLSAgICByZXR1cm4gUFZfU1VDQ0VTUzsKLQotfSAvKiBWbGNEZWNUQ09FRkludGVyICovCi0KLS8qPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQotICAgIEZ1bmN0aW9uOiAgIFZsY0RlY1RDT0VGU2hvcnRIZWFkZXIoKQotICAgIERhdGUgICAgOiAgIDA0LzI3Lzk5Ci0gICAgUHVycG9zZSA6ICAgTmV3IGZ1bmN0aW9uIHVzZWQgaW4gZGVjb2Rpbmcgb2YgdmlkZW8gcGxhbmVzCi0gICAgICAgICAgICAgICAgd2l0aCBzaG9ydCBoZWFkZXIKLSAgICBNb2RpZmllZDogICAwNS8yMy8yMDAwCi0gICAgICAgICAgICAgICAgZm9yIG5ldyBkZWNvZGVyIHN0cnVjdHVyZS4KLT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PSovCi1QVl9TVEFUVVMgVmxjRGVjVENPRUZTaG9ydEhlYWRlcihCaXRzdHJl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Bjb2RlKTsKLSAgICAgICAgfQotICAgICAgICBlbHNlCi0gICAgICAgIHsKLSAgICAgICAgICAgIHBUY29lZi0+c2lnbiA9IDA7Ci0gICAgICAgICAgICBwVGNvZWYtPmxldmVsID0gY29kZTsKLSAgICAgICAgfQotICAgIH0KLQotCi0gICAgcmV0dXJuIFBWX1NVQ0NFU1M7Ci0KLX0gICAvKiBWbGNEZWNUQ09FRlNob3J0SGVhZGVyX0FubmV4SSAqLwotI2VuZGlmCi0vKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKipDb21tZW50QmVnaW4qKioqKioKLSogICAgICAgMy8zMC8yMDAwIDogaW5pdGlhbCBtb2RpZmljYXRpb24gdG8gdGhlIG5ldyBQVi1EZWNvZGVyIExpYgotKiAgICAgICAgICAgICAgICAgICAgICAgICAgIGZvcm1hdCBhbmQgdGhlIGNoYW5nZSBvZiBlcnJvci1oYW5kbGluZyBtZXRob2QuCi0qICAgICAgICAgICAgICAgICAgICAgICAgICAgVGhlIGNvZWZmaWNpZW50IGlzIG5vdyByZXR1cm5lZCB0aHJ1IGEgcHJlLQotKiAgICAgICAgICAgICAgICAgICAgICAgICAgIGluaXRpYWxpemVkIHBhcmFtZXRlcnMgZm9yIHNwZWVkdXAuCi0qCi0qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKkNvbW1lbnRFbmQqKioqKioqKi8KLQotCi1QVl9TVEFUVVMgUnZsY0RlY1RDT0VGSW50ZXIoQml0c3RyZWFtRGVjVmlkZW8gKnN0cmVhbSwgVGNvZWYgKnBUY29lZikKLXsKLSAgICB1aW50IGNvZGUsIG1hc2s7Ci0gICAgY29uc3QgVkxDdGFiMiAqdGFiMjsKLSAgICBpbnQgY291bnQsIGxlbiwgbnVtWzJdID0gezAsIDB9IC8qICAwMS8zMC8wMSAqLzsKLQotICAgIG1hc2sgPSAweDQwMDA7ICAgICAgLyogbWF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XNrKQotICAgIHsKLSAgICAgICAgY291bnQgPSAxOwotICAgICAgICB3aGlsZSAobWFzayAmJiBjb3VudCA+IDApICAgICAgIC8qIGZpeCAgMy8yOC8wMSAgKi8KLSAgICAgICAgewotICAgICAgICAgICAgbWFzayA9IG1hc2sgPj4gMTsKLSAgICAgICAgICAgIGlmIChjb2RlICYgbWFzaykKLSAgICAgICAgICAgICAgICBjb3VudC0tOwotICAgICAgICAgICAgZWxzZQotICAgICAgICAgICAgICAgIG51bVswXSsrOyAvKiBudW1iZXIgb2YgemVyb3MgaW4gdGhlIG1pZGRsZSAqLwotICAgICAgICAgICAgbGVuKys7Ci0gICAgICAgIH0KLSAgICB9Ci0gICAgZWxzZQotICAgIHsKLSAgICAgICAgY291bnQgPSAyOwotICAgICAgICB3aGlsZSAobWFzayAmJiBjb3VudCA+IDApICAgICAgICAgICAvKiBmaXggIDMvMjgvMDEgICovCi0gICAgICAgIHsKLSAgICAgICAgICAgIG1hc2sgPSBtYXNrID4+IDE7Ci0gICAgICAgICAgICBpZiAoIShjb2RlICYgbWFzaykpCi0gICAgICAgICAgICAgICAgY291bnQtLTsKLSAgICAgICAgICAgIGVsc2UKLSAgICAgICAgICAgICAgICBudW1bY291bnQtMV0rKzsgLyogbnVtYmVyIG9mIG9uZXMgaW4gdGhlIG1pZGRsZSAqLwotICAgICAgICAgICAgbGVuKys7Ci0gICAgICAgIH0KLSAgICB9Ci0KLSAgICBjb2RlID0gY29kZSAmIDB4N2ZmZjsKLSAgICBjb2RlID0gY29kZSA+PiAoMTUgLSAobGVuICsgMSkpOwotCi0gICAgLyogIDEvMzAvMDEsIGFkZCBmYXN0IGRlY29kaW5nIGFsZ29yaXRobSBoZXJlICovCi0gICAgLyogY29kZSBpcyBpbiB0d28gZm9ybXMgOiAweHh4eDB4eHgwMCBvciAweHh4MHh4eDAxCi0gICAgICAgICAgICAgICAgICAgICAgICAgbnVtWzFdIGFuZCBudW1bMF0geAotICAgICAgICAgICAgICAgICAgICAgICAg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W1SZWFkQml0czE2X0lOTElORShzdHJlYW0sIDUpICYgMHgxOyAvKiBmaXggICAwMy8xMy8wMSAqLwotICAgICAgICByZXR1cm4gUFZfU1VDQ0VTUzsKLSAgICB9Ci0KLSAgICBpZiAoY29kZSAmIG1hc2spCi0gICAgewotICAgICAgICBjb3VudCA9IDE7Ci0gICAgICAgIHdoaWxlIChtYXNrICYmIGNvdW50ID4gMCkgICAgICAgICAgICAgICAgICAgICAgICAgIC8qIGZpeCAgMDMvMjgvMDEgKi8KLSAgICAgICAgewotICAgICAgICAgICAgbWFzayA9IG1hc2sgPj4gMTsKLSAgICAgICAgICAgIGlmIChjb2RlICYgbWFzaykKLSAgICAgICAgICAgICAgICBjb3VudC0tOwotICAgICAgICAgICAgZWxzZQotICAgICAgICAgICAgICAgIG51bVswXSsrOyAvKiBudW1iZXIgb2YgemVyb3MgaW4gdGhlIG1pZGRsZSAqLwotICAgICAgICAgICAgbGVuKys7Ci0gICAgICAgIH0KLSAgICB9Ci0gICAgZWxzZQotICAgIHsKLSAgICAgICAgY291bnQgPSAyOwotICAgICAgICB3aGlsZSAobWFzayAmJiBjb3VudCA+IDApICAgICAgICAgICAgICAvKiBmaXggIDAzLzI4LzAxICovCi0gICAgICAgIHsKLSAgICAgICAgICAgIG1hc2sgPSBtYXNrID4+IDE7Ci0gICAgICAgICAgICBpZiAoIShjb2RlICYgbWFzaykpCi0gICAgICAgICAgICAgICAgY291bnQtLTsKLSAgICAgICAgICAgIGVsc2UKLSAgICAgICAgICAgICAgICBudW1bY291bnQtMV0rKzsgLyogbnVtYmVyIG9mIG9uZXMgaW4gdGhlIG1pZGRsZSAqLwotICAgICAgICAgICAgbGVuKys7Ci0gICAgICAgIH0KLSAgICB9Ci0KLSAgICBjb2RlID0gY29kZSAmIDB4N2ZmZjsKLSAgICBjb2RlID0gY29kZSA+PiAoMTUgLSAobGVuICsgMSkpOwotCi0gICAgLyogIDEvMzAvMDEsIGFkZCBmYXN0IGRlY29kaW5nIGFsZ29yaXRobSBoZXJlICovCi0gICAgLyogY29kZSBpcyBpbiB0d28gZm9ybXMgOiAweHh4eDB4eHgwMCBvciAweHh4MHh4eDAxCi0gICAgICAgICAgICAgICAgICAgICAgICAgbnVtWzFdIGFuZCBudW1bMF0geAotICAgICAgICAgICAgICAgICAgICAgICAgb3IgIDogMXh4eHh4MTAgb3IgMXh4eHh4MTEKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbnVtWzBdICB4ICAgICAgKi8KLQotICAgIC8qIGxlbisxIGlzIHRoZSBsZW5ndGggb2YgdGhlIGFib3ZlICovCi0KLSAgICBpZiAobnVtWzFdID4gMTAgfHwgbnVtWzBdID4gMTEpIC8qIGludmFsaWQgUlZMQyBjb2RlICovCi0gICAgICAgIHJldHVybiBQVl9GQUlMOwotCi0gICAgaWYgKGNvZGUgJiAoMSA8PCBsZW4pKQotICAgICAgICB0YWIyID0gUnZsY0RDVHRhYkludHJhICsgMTQ2ICsgKG51bVswXSA8PCAxKSArIChjb2RlICYgMSk7Ci0gICAgZWxzZQotICAgICAgICB0YWIyID0gUnZsY0RDVHRhYkludHJhICsgcHRyUnZsY1RhYltudW1bMV1dICsgKG51bVswXSA8PCAxKSArIChjb2RlICYgMSk7Ci0KLSAgICBQVl9CaXRzdHJlYW1GbHVzaEJpdHMoc3RyZWFtLCAoaW50KSB0YWIyLT5sZW4pOwotICAgIHBUY29lZi0+cnVuID0gKHVpbnQpdGFiMi0+cnVuOy8vKHRhYi0+dmFsID4+IDgpICYgMjU1OwotICAgIHBUY29lZi0+bGV2ZWwgPSAoaW50KXRhYjItPmxldmVsOy8vdGFiLT52YWwgJiAyNTU7Ci0gICAgcFRjb2VmLT5sYXN0ID0gKHVpbnQpdGFiMi0+bGFzdDsvLyh0YWItPnZhbCA+PiAxNikgJiAxOwotCi0gICAgcFRjb2VmLT5zaWduID0gQml0c3RyZWFtUmVhZDFCaXRzX0lOTElORShzdHJlYW0pOwotICAgIHJldHVybiBQVl9TVUNDRVN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ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMCwgMSwgMSwgMSwgMSwgMSwgMSwgMSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAwLCAxLCAxLCAxLCAxLCAxLCAxLCAxLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDAsIDEsIDEsIDEsIDEsIDEsIDEsIDEsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMCwgMSwgMSwgMSwgMSwgMSwgMSwgMSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAwLCAxLCAxLCAxLCAxLCAxLCAxLCAxLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDAsIDEsIDEsIDEsIDEsIDEsIDEsIDEsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMCwgMSwgMSwgMSwgMSwgMSwgMSwgMSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfTsKLXN0YXRpYyBjb25zdCB1aW50OCBtYXNrWzhdID0gLyogIGZvciBmYXN0IGJpdG1hcCAqLwotICAgIHsxMjgsIDY0LCAzMiwgMTYsIDgsIDQsIDIsIDF9OwotCi0KLQotLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqQ29tbWVudEJlZ2luKioqKioqCi0qCi0qIC0tIFZsY0RlcXVhbnRNcGVnQmxvY2sgLS0gRGVjb2RlcyB0aGUgRENUIGNvZWZmaWNpZW50cyBvZiBvbmUgOHg4IGJsb2NrIGFuZCBwZXJmb3JtCi0gICAgICAgICAgICBkZXF1YW50aXphdGlvbiB1c2luZyBNcGVnIG1vZGUuCi0gICAgRGF0ZTogICAgICAgMDgvMDgvMjAwMAotCi0gICAgTW9kaWZpZWQ6ICAgICAgMy8yMS8wMQotICAgICAgICAgICAgICAgIEFkZGVkIHBy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ci0gICAgdHlwZURDQUNTdG9yZSAqRENBQ19yb3cgPSB2aWRlby0+cHJlZERDQUNfcm93ICsgeF9wb3M7Ci0gICAgdHlwZURDQUNTdG9yZSAqRENBQ19jb2wgPSB2aWRlby0+cHJlZERDQUNfY29sOwotICAgIHVpbnQgQUNwcmVkX2ZsYWcgPSAodWludCkgdmlkZW8tPmFjUHJlZEZsYWdbbWJudW1dOwotCi0gICAgLyoqKiBWTEMgKioqKiovCi0gICAgaW50IGksIGosIGs7Ci0gICAgVGNvZWYgcnVuX2xldmVsOwotICAgIGludCBsYXN0LCByZXR1cm5fc3RhdHVzOwotICAgIFZsY0RlY0Z1bmNQIHZsY0RlY0NvZWZmOwotICAgIGludCBkaXJlY3Rpb247Ci0gICAgY29uc3QgaW50ICppbnZfemlnemFnOwotICAgIC8qKiogUXVhbnRpemVyICoqKiovCi0gICAgaW50IGRjX3NjYWxlcjsKLSAgICBpbnQgc3VtOwotICAgIGludCAqcW1hdDsKLSAgICBpbnQzMiB0ZW1wOwotCi0gICAgY29uc3QgaW50IEJfWHRhYls2XSA9IHswLCAxLCAwLCAxLCAyLCAzfTsKLSAgICBjb25zdCBpbnQgQl9ZdGFiWzZdID0gezAsIDAsIDEsIDEsIDIsIDN9OwotCi0gICAgaW50MTYgKmRjYWNfcm93LCAqZGNhY19jb2w7Ci0KLSAgICBkY2FjX3JvdyA9ICgqRENBQ19yb3cpW0JfWHRhYltjb21wXV07Ci0gICAgZGNhY19jb2wgPSAoKkRDQUNfY29sKVtCX1l0YWJbY29tcF1dOwotCi0KLSAgICBpID0gMSAtIHN3aXRjaGVkOwotCi0jaWZkZWYgRkFTVF9JRENUCi0gICAgKigodWludDMyKiliaXRtYXBjb2wpID0gKigodWludDMyKikoYml0bWFwY29sICsgNCkpID0gMDsKLSAgICAqYml0bWFwcm93ID0gMDsKLSNlbmRpZgotCi0KLSAgICAvKiBzZWxlY3Qgd2hpY2ggSHVmZm1hbiB0YWJsZSB0byBiZSB1c2VkICovCi0g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ST1I7Ci0gICAgICAgICAgICAgICAgQUNwcmVkX2ZsYWcgPSAwOyAgICAvKiBubyBvZiBjb2VmZmljaWVudHMgc2hvdWxkIG5vdCBnZXQgcmVzZXQgICAwMy8wNy8yMDAyICovCi0gICAgICAgICAgICAgICAgYnJlYWs7Ci0gICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgIGkgKz0gcnVuX2xldmVsLnJ1bjsKLSAgICAgICAgICAgIGxhc3QgPSBydW5fbGV2ZWwubGFzdDsKLSAgICAgICAgICAgIGlmIChpID49IDY0KQotICAgICAgICAgICAgewotICAgICAgICAgICAgICAgIC8qICBpID0gTkNPRUZGX0JMT0NLOyAqLyAgICAvKiAgMTEvMS8wMCAqLwotICAgICAgICAgICAgICAgIEFDcHJlZF9mbGFnID0gMDsgICAgLyogbm8gb2YgY29lZmZpY2llbnRzIHNob3VsZCBub3QgZ2V0IHJlc2V0ICAgMDMvMDcvMjAwMiAqLwotICAgICAgICAgICAgICAgIGkgPSBWTENfTk9fTEFTVF9CSVQ7Ci0gICAgICAgICAgICAgICAgbGFzdCA9IDE7Ci0gICAgICAgICAgICAgICAgYnJlYWs7Ci0gICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgIGsgPSBpbnZfemlnemFnW2ldOwotCi0gICAgICAgICAgICBpZiAocnVuX2xldmVsLnNpZ24gPT0gMSkKLSAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICBkYXRhYmxvY2tba10gLT0gcnVuX2xldmVsLmxldmVsOwotICAgICAgICAgICAgfQotICAgICAgICAgICAgZWxzZQotICAgICAgICAgICAgewotICAgICAgICAgICAgICAgIGRhdGFibG9ja1trXSArPSBydW5fbGV2ZWwubGV2ZWw7Ci0gICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgIGlmIChBQ19yb3djb2xba10pCi0gICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgdGVtcCA9IChpbnQzMilkYXRhYmxvY2tba10gKiBxbWF0W2tdICogUVA7Ci0gICAgIC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GRjYWNfcm93WzFdICA9IGRhdGFibG9ja1syXTsKLSAgICAgICAgICAgIGRjYWNfcm93WzJdICA9IGRhdGFibG9ja1szXTsKLSAgICAgICAgICAgIGRjYWNfcm93WzNdICA9IGRhdGFibG9ja1s0XTsKLSAgICAgICAgICAgIGRjYWNfcm93WzRdICA9IGRhdGFibG9ja1s1XTsKLSAgICAgICAgICAgIGRjYWNfcm93WzVdICA9IGRhdGFibG9ja1s2XTsKLSAgICAgICAgICAgIGRjYWNfcm93WzZdICA9IGRhdGFibG9ja1s3XTsKLQotICAgICAgICAgICAgZm9yIChqID0gMCwgayA9IDg7IGsgPCA2NDsgayArPSA4LCBqKyspCi0gICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgaWYgKGRjYWNfY29sW2pdID0gZGF0YWJsb2NrW2tdKQotICAgICAgICAgICAgICAgIHsgICAgIC8qIEFDREMgY2xpcHBpbmcgIDAzLzI2LzAxICovCi0gICAgICAgICAgICAgICAgICAgIGlmIChkYXRhYmxvY2tba10gPiAyMDQ3KSBkY2FjX2NvbFtqXSA9IDIwNDc7Ci0gICAgICAgICAgICAgICAgICAgIGVsc2UgaWYgKGRhdGFibG9ja1trXSA8IC0yMDQ4KSBkY2FjX2NvbFtqXSA9IC0yMDQ4OwotCi0gICAgICAgICAgICAgICAgICAgIHRlbXAgPSAoaW50MzIpZGNhY19jb2xbal0gKiBxbWF0W2tdICogUVA7Ci0gICAgICAgICAgICAgICAgICAgIHRlbXAgPSAodGVtcCArICgweDcgJiAodGVtcCA+PiAzMSkpKSA+PiAzOyAgLyogIDAzLzI2LzAxKi8KLSAgICAgICAgICAgICAgICAgICAgaWYgKHRlbXAgPiAyMDQ3KSB0ZW1wID0gMjA0NzsKLSAgICAgICAgICAgICAgICAgICAgZWxzZSBpZiAodGVtcCA8IC0yMDQ4KSB0ZW1wID0gLTIwNDg7Ci0gICAgICAgICAgICAgICAgICAgIGRhdGFibG9ja1trXSA9IChpbnQpdGVtcDsKLSAgICAgICAgICAgICAgICAgICAgc3VtIF49IHRlbXA7IC8qICA3LzUvMDEgKi8KLSNpZmRlZiBGQVNUX0lEQ1QKLSAgICAgICAgICAgICAgICAgICAgYml0bWFwY29sWzBdIHw9IG1hc2tbaz4+M107Ci0jZW5kaWYKLQotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgIH0KLSAgICAgICAgICAgIGZvciAoayA9IDE7IGsgPCA4OyBrKyspCi0gICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgaWYgKGRhdGFibG9ja1trXSkKLSAgICAgICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgICAgIHRlbXAgPSAoaW50MzIpZGF0YWJsb2NrW2tdICogcW1hdFtrXSAqIFFQOwotICAgICAgICAgICAgICAgICAgICB0ZW1wID0gKHRlbXAgKyAoMHg3ICYgKHRlbXAgPj4gMzEpKSkgPj4gMzsgIC8qICAwMy8yNi8wMSovCi0gICAgICAgICAgICAgICAgICAgIGlmICh0ZW1wID4gMjA0NykgdGVtcCA9IDIwNDc7Ci0gICAgICAgICAgICAgICAgICAgIGVsc2UgaWYgKHRlbXAgPCAtMjA0OCkgdGVtcCA9IC0yMDQ4OwotICAgICAgICAgICAgICAgICAgICBkYXRhYmxvY2tba10gPSAoaW50KXRlbXA7Ci0gICAgICAgICAgICAgICAgICAgIHN1bSBePSB0ZW1wOyAvKiAgNy81LzAxICovCi0jaWZkZWYgRkFTVF9JRENUCi0gICAgICAgICAgICAgICAgICAgIGJpdG1hcGNvbFtrXSB8PSAxMjg7Ci0jZW5kaWYKLQotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgIH0KLQotICAgICAgICB9Ci0gICAgICAgIGVsc2UKLSAgICAgICAgewotCi0gICAgICAgICAgICBkY2FjX2NvbFswXSAgPSBkYXRhYmxvY2tbOF07Ci0gICAgICAgICAgICBkY2FjX2NvbFsxXSAgPSBkYXRhYmxvY2tbMTZdOwotICAgICAgICAgICAgZGNhY19jb2xbMl0gID0gZGF0YWJsb2NrWzI0XTsKLSAgICAgICAgICAgIGRjYWNfY29sWzNdICA9IGRhdGFibG9ja1szMl07Ci0gICAgICAgICAgICBkY2FjX2NvbFs0XSAgPSBkYXRhYmxvY2tbNDBdOwotICAgICAgICAgICAgZGNhY19jb2xbNV0gID0gZGF0YWJsb2NrWzQ4XTsKLSAgICAgICAgICAgIGRjYWNfY29sWzZdICA9IGRhdGFibG9ja1s1Nl07Ci0KLQotICAgICAgICAgICAgZm9yIChqID0gMCwgayA9IDE7IGsgPCA4OyBrKyssIGorKykKLSAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICBpZiAoZGNhY19yb3dbal0gPSBkYXRhYmxvY2tba10pCi0gICAgICAgICAgICAgICAgeyAgICAgLyogQUNEQyBjbGlwcGluZyAgMDMvMjYvMDEgKi8KLSAgICAgICAgICAgICAgICAgICAgaWYgKGRhdGFibG9ja1trXSA+IDIwNDcpIGRjYWNfcm93W2pdID0gMjA0NzsKLSAgICAgICAgICAgICAgICAgICAgZWxzZSBpZiAoZGF0YWJsb2NrW2tdIDwgLTIwNDgpIGRjYWNfcm93W2pdID0gLTIwNDg7Ci0KLSAgICAgICAgICAgICAgICAgICAgdGVtcCA9IChpbnQzMilkY2FjX3Jvd1tqXSAqIHFtYXRba10gKiBRUDsKLSAgICAgICAgICAgICAgICAgICAgdGVtcCA9ICh0ZW1wICsgKDB4NyAmICh0ZW1wID4+IDMxKSkpID4+IDM7ICAvKiAgMDMvMjYvMDEgKi8KLSAgICAgICAgICAgICAgICAgICAgaWYgKHRlbXAgPiAyMDQ3KSB0ZW1wID0gMjA0NzsKLSAgICAgICAgICAgICAgICAgICAgZWxzZSBpZiAodGVtcCA8IC0yMDQ4KSB0ZW1wID0gLTIwNDg7Ci0gICAgICAgICAgICAgICAgICAgIGRhdGFibG9ja1trXSA9IChpbnQpdGVtcDsKLSAgICAgICAgICAgICAgICAgICAgc3VtIF49IHRlbXA7Ci0jaWZkZWYgRkFTVF9JRENUCi0gICAgICAgICAgICAgICAgICAgIGJpdG1hcGNvbFtrXSB8PSAxMjg7Ci0jZW5kaWYKLQotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgZm9yIChrID0gODsgayA8IDY0OyBrICs9IDgpCi0gICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgaWYgKGRhdGFibG9ja1trXSkKLSAgICAgICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgICAgIHRlbXAgPSAoaW50MzIpZGF0YWJsb2NrW2tdICogcW1hdFtrXSAqIFFQOwotICAgICAgICAgICAgICAgICAgICB0ZW1wID0gKHRlbXAgKyAoMHg3ICYgKHRlbXAgPj4gMzEpKSkgPj4gMzsgIC8qICAwMy8yNi8wMSAqLwotICAgICAgICAgICAgICAgICAgICBpZiAodGVtcCA+IDIwNDcpIHRlbXAgPSAyMDQ3OwotICAgICAgICAgICAgICAgICAgICBlbHNlIGlmICh0ZW1wIDwgLTIwNDgpIHRlbXAgPSAtMjA0ODsKLSAgICAgICAgICAgICAgICAgICAgZGF0YWJsb2NrW2tdID0gKGludCl0ZW1wOwotICAgICAgICAgICAgICAgICAgICBzdW0gXj0gdGVtcDsKLSNpZmRlZiBGQVNUX0lEQ1QKLSAgICAgICAgICAgICAgICAgICAgYml0bWFwY29sWzBdIHw9IG1hc2tbaz4+M107Ci0jZW5kaWYKLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICB9Ci0KLSAgICAgICAgfQotICAgIH0KLSAgICBlbHNlCi0gICAgewotCi0gICAgICAgIC8qIFN0b3JlIHRoZSBxY29lZmYtdmFsdWVzIG5lZWRlZCBsYXRlciBmb3IgcHJlZGljdGlvbiAqLwotCi0gICAgICAgIGRjYWNfcm93WzBdID0gZGF0YWJsb2NrWzFdOyAgICAgICAgICAgICAgICAvKiAgQUNEQywgbm8gbmVlZCBmb3IgY2xpcHBpbmcgKi8KLSAgICAgICAgZGNhY19yb3dbMV0gPSBkYXRhYmxvY2tbMl07Ci0gICAgICAgIGRjYWNfcm93WzJdID0gZGF0YWJsb2NrWzNdOwotICAgICAgICBkY2FjX3Jvd1szXSA9IGRhdGFibG9ja1s0XTsKLSAgICAgICAgZGNhY19yb3dbNF0gPSBkYXRhYmxvY2tbNV07Ci0gICAgICAgIGRjYWNfcm93WzVdID0gZGF0YWJsb2NrWzZdOwotICAgICAgICBkY2FjX3Jvd1s2XSA9IGRhdGFibG9ja1s3XTsKLQotICAgICAgICBkY2FjX2NvbFswXSA9IGRhdGFibG9ja1s4XTsKLSAgICAgICAgZGNhY19jb2xbMV0gPSBkYXRhYmxvY2tbMTZdOwotICAgICAgICBkY2FjX2NvbFsyXSA9IGRhdGFibG9ja1syNF07Ci0gICAgICAgIGRjYWNfY29sWzNdID0gZGF0YWJsb2NrWzMyXTsKLSAgICAgICAgZGNhY19jb2xbNF0gPSBkYXRhYmxvY2tbNDBdOwotICAgICAgICBkY2FjX2NvbFs1XSA9IGRhdGFibG9ja1s0OF07Ci0gICAgICAgIGRjYWNfY29sWzZdID0gZGF0YWJsb2NrWzU2XTsKLQotICAgICAgICBmb3IgKGsgPSAxOyBrIDwgODsgaysrKQotICAgICAgICB7Ci0gICAgICAgICAgICBpZiAoZGF0YWJsb2NrW2tdKQotICAgICAgICAgICAgewotICAgICAgICAgICAgICAgIHRlbXAgPSAoaW50MzIpZGF0YWJsb2NrW2tdICogcW1hdFtrXSAqIFFQOwotICAgICAgICAgICAgICAgIHRlbXAgPSAodGVtcCArICgweDcgJiAodGVtcCA+PiAzMSkpKSA+PiAzOyAgLyogIDAzLzI2LzAxKi8KLSAgICAgICAgICAgICAgICBpZiAodGVtcCA+IDIwNDcpIHRlbXAgPSAyMDQ3OwotICAgICAgICAgICAgICAgIGVsc2UgaWYgKHRlbXAgPCAtMjA0OCkgdGVtcCA9IC0yMDQ4OwotICAgICAgICAgICAgICAgIGRhdGFibG9ja1trXSA9IChpbnQpdGVtcDsKLSAgICAgICAgICAgICAgICBzdW0gXj0gdGVtcDsgLyogIDcvNS8wMSAqLwotI2lmZGVmIEZBU1RfSURDVAotICAgICAgICAgICAgICAgIGJpdG1hcGNvbFtrXSB8PSAxMjg7Ci0jZW5kaWYKLQotICAgICAgICAgICAgfQotICAgICAgICB9Ci0gICAgICAgIGZvciAoayA9IDg7IGsgPCA2NDsgayArPSA4KQotICAgICAgICB7Ci0gICAgICAgICAgICBpZiAoZGF0YWJsb2NrW2tdKQotICAgICAgICAgICAgewotICAgICAgICAgICAgICAgIHRlbXAgPSAoaW50MzIpZGF0YWJsb2NrW2tdICogcW1hdFtrXSAqIFFQOwotICAgICAgICAgICAgICAgIHRlbXAgPSAodGVtcCArICgweDcgJiAodGVtcCA+PiAzMSkpKSA+PiAzOyAgLyogIDAzLzI2LzAxICovCi0gICAgICAgICAgICAgICAgaWYgKHRlbXAgPiAyMDQ3KSB0ZW1wID0gMjA0NzsKLSAgICAgICAgICAgICAgICBlbHNlIGlmICh0ZW1wIDwgLTIwNDgpIHRlbXAgPSAtMjA0ODsKLSAgICAgICAgICAgICAgICBkYXRhYmxvY2tba10gPSAoaW50KXRlbXA7Ci0gICAgICAgICAgICAgICAgc3VtIF49IHRlbXA7Ci0jaWZkZWYgRkFTVF9JRENUCi0gICAgICAgICAgICAgICAgYml0bWFwY29sWzBdIHw9IG1hc2tbaz4+M107Ci0jZW5kaWYKLSAgICAgICAgICAgIH0KLSAgICAgICAgfQotCi0gICAgfQotCi0KLQotICAgIGlmIChkYXRhYmxvY2tbMF0pCi0gICAgewotICAgICAgICB0ZW1wID0gKGludDMyKWRhdGFibG9ja1swXSAqIGRjX3NjYWxlcjsKLSAgICAgICAgaWYgKHRlbXAgPiAyMDQ3KSB0ZW1wID0gMjA0NzsgICAgICAgICAgICAvKiAgMDMvMTQvMDEgKi8KLSAgICAgICAgZWxzZSBpZiAodGVtcCA8IC0yMDQ4KSAgdGVtcCA9IC0yMDQ4OwotICAgICAgICBkYXRhYmxvY2tbMF0gPSAoaW50KXRlbXA7Ci0gICAgICAgIHN1bSBePSB0ZW1wOwotI2lmZGVmIEZBU1RfSURDVAotICAgICAgICBiaXRtYXBjb2xbMF0gfD0gMTI4OwotI2VuZGlmCi0gICAgfQotCi0gICAgaWYgKChzdW0gJiAxKSA9PSAwKQotICAgIHsKLSAgICAgICAgZGF0YWJsb2NrWzYzXSA9IGRhdGFibG9ja1s2M10gXiAweDE7Ci0jaWZkZWYgRkFTVF9JRENUICAgLyogIDcvNS8wMSwgbmVlZCB0byB1cGRhdGUgYml0bWFwICovCi0gICAgICAgIGlmIChkYXRhYmxvY2tbNjNdKQotICAgICAgICAgICAgYml0bWFwY29sWzddIHw9IDE7Ci0jZW5kaWYKLSAgICAgICAgaSA9ICgtNjQgJiBpKSB8IE5DT0VGRl9CTE9DSzsgICAvKiAgaWYgaSA+IC0xIHRoZW4gaSBpcyBzZXQgdG8gTkNPRUZGX0JMT0NLICovCi0gICAgfQotCi0KLSNpZmRlZiBGQVNUX0lEQ1QKLSAgICBpZiAoaSA+IDEwKQotICAgIHsKLSAgICAgICAgZm9yIChrID0gMTsgayA8IDQ7IGsrKykKLSAgICAgICAgewotICAgICAgICAgICAgaWYgKGJpdG1hcGNvbFtrXSAhPSAwKQotICAgICAgICAgICAgewotICAgICAgICAgICAgICAgICgqYml0bWFwcm93KSB8PSBtYXNrW2tdOwotICAgICAgICAgICAgfQotICAgICAgICB9Ci0gICAgfQotI2VuZGlmCi0KLSAgICAvKiBTdG9yZSB0aGUgcWNvZWZmLXZhbHVlcyBuZWVkZWQgbGF0ZXIgZm9yIHByZWRpY3Rpb24gKi8KLSAgICAoKkRDKVtjb21wXSA9IGRhdGFibG9ja1swXTsKLSAgICByZXR1cm4gaTsKLQotfQotCi0KLS8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKkNvbW1lbnRCZWdpbioqKioqKgotKgotKiAtLSBWbGNEZXF1YW50TXBlZ0ludGVyQmxvY2sgLS0gRGVjb2RlcyB0aGUgRENUIGNvZWZmaWNpZW50cyBvZiBvbmUgOHg4IGJsb2NrIGFuZCBwZXJmb3JtCi0gICAgICAgICAgICBkZXF1YW50aXphdGlvbiB1c2luZyBNcGVnIG1vZGUgZm9yIElOVEVSIGJsb2NrLgotICAgIERhdGU6ICAgICAgIDA4LzA4LzIwMDAKLSAgICBNb2RpZmllZDogICAgICAgICAgICAgIDMvMjEvMDEKLSAgICAgICAgICAgICAgICBjbGVhbiB1cCwgYWRkZWQgY2xpcHBpbmcsIDE2LWJpdCBpbnQgY2FzZSwgbmV3IEFDREMgcHJlZGljdGlvbgotKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotCi0KLWludCBWbGNEZXF1YW50TXBlZ0ludGVyQmxvY2sodm9pZCAqdmlkLCBpbnQgY29tcCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdWludDggKmJpdG1hcGNvbCwgdWludDggKmJpdG1hcHJvdykKLXsKLSAgICBWaWRlb0RlY0RhdGEgKnZpZGVvID0gKFZpZGVvRGVjRGF0YSopIHZpZDsKLSAgICBCaXRzdHJlYW1EZWNWaWRlbyAqc3RyZWFtID0gdmlkZW8tPmJpdHN0cmVhbTsKLSAgICBWb2wgKmN1cnJWb2wgPSB2aWRlby0+dm9sW3ZpZGVvLT5jdXJyTGF5ZXJdOwotICAgIGludDE2ICpkYXRhYmxvY2sgPSB2aWRlby0+bWJsb2NrLT5ibG9ja1tjb21wXTsgLyogMTAvMjAvMjAwMCwgYXNzdW1lIGl0IGhhcyBiZWVuIHJlc2V0IG9mIGFsbC16ZXJvICEhISovCi0gICAgaW50IG1ibnVtID0gdmlkZW8tPm1ibnVtOwotICAgIGludCBRUCA9IHZpZGVvLT5RUE1CW21ibnVtXTsKLSAgICAvKioqIFZMQyAqKioqKi8KLSAgICBpbnQgaSwgazsKLSAgICBUY29lZiBydW5fbGV2ZWw7Ci0gICAgaW50IGxhc3QsIH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ldmVsLnJ1bjsKLSAgICAgICAgbGFzdCA9IHJ1bl9sZXZlbC5sYXN0OwotICAgICAgICBpZiAoaSA+PSA2NCkKLSAgICAgICAgewotICAgICAgICAgICAgLyogIGkgPSBOQ09FRkZfQkxPQ0s7ICovICAgIC8qICAxMS8xLzAwICovCi0gICAgICAgICAgICAvL3JldHVybiBWTENfTk9fTEFTVF9CSVQ7Ci0gICAgICAgICAgICBpID0gVkxDX05PX0xBU1RfQklUOwotICAgICAgICAgICAgbGFzdCA9IDE7Ci0gICAgICAgICAgICBzdW0gPSAxOyAgICAvKiBubyBvZiBjb2VmZmljaWVudHMgc2hvdWxkIG5vdCBnZXQgcmVzZXQgICAwMy8wNy8yMDAyICovCi0gICAgICAgICAgICBicmVhazsKLSAgICAgICAgfQotCi0gICAgICAgIGsgPSB6aWd6YWdfaW52W2ldOwotCi0gICAgICAgIGlmIChydW5fbGV2ZWwuc2lnbiA9PSAxKQotICAgICAgICB7Ci0gICAgICAgICAgICB0ZW1wID0gKC0oaW50MzIpKDIgKiBydW5fbGV2ZWwubGV2ZWwgKyAxKSAqIHFtYXRba10gKiBRUCArIDE1KSA+PiA0OyAvKiAgMDMvMjMvMDEgKi8KLSAgICAgICAgICAgIGlmICh0ZW1wIDwgLTIwNDgpIHRlbXAgPSAtIDIwNDg7Ci0gICAgICAgIH0KLSAgICAgICAgZWxzZQotICAgICAgICB7Ci0gICAgICAgICAgICB0ZW1wID0gKChpbnQzMikoMiAqIHJ1bl9sZXZlbC5sZXZlbCArIDEpICogcW1hdFtrXSAqIFFQKSA+PiA0OyAvKiAgMDMvMjMvMDEgKi8KLSAgICAgICAgICAgIGlmICh0ZW1wID4gMjA0NykgdGVtcCA9IDIwNDc7Ci0gICAgICAgIH0KLQotICAgICAgICBkYXRhYmxvY2tba10gPSAoaW50KXRlbXA7Ci0KLSNpZmRlZiBGQVNUX0lEQ1QKLSAgICAgICAgYml0bWFwY29sW2smMHg3XSB8PSBtYXNrW2s+PjNdOwotI2VuZGlmCi0gICAgICAgIHN1bSBePSB0ZW1wOwotCi0gICAgICAgIGkrKzsKLSAgICB9Ci0gICAgd2hpbGUgKCFsYXN0KTsKLQotICAgIGlmICgoc3VtICYgMSkgPT0gMCkKLSAgICB7Ci0gICAgICAgIGRhdGFibG9ja1s2M10gPSBkYXRhYmxvY2tbNjNdIF4gMHgxOwotI2lmZGVmIEZBU1RfSURDVCAgIC8qICA3LzUvMDEsIG5lZWQgdG8gdXBkYXRlIGJpdG1hcCAqLwotICAgICAgICBpZiAoZGF0YWJsb2NrWzYzXSkKLSAgICAgICAgICAgIGJpdG1hcGNvbFs3XSB8PSAxOwotI2VuZGlmCi0gICAgICAgIGkgPSBOQ09FRkZfQkxPQ0s7Ci0gICAgfQotCi0KLSNpZmRlZiBGQVNUX0lEQ1QKLSAgICBpZiAoaSA+IDEwKQotICAgIHsKLSAgICAgICAgZm9yIChrID0gMTsgayA8IDQ7IGsrKykgICAgICAgICAgICAgICAvKiAgMDcvMTkvMDEgKi8KLSAgICAgICAgewotICAgICAgICAgICAgaWYgKGJpdG1hcGNvbFtrXSAhPSAwKQotICAgICAgICAgICAgewotICAgICAgICAgICAgICAgICgqYml0bWFwcm93KSB8PSBtYXNrW2tdOwotICAgICAgICAgICAgfQotICAgICAgICB9Ci0gICAgfQotI2VuZGlmCi0KLSAgICByZXR1cm4gaTsKLX0KLSNlbmRpZgotLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqQ29tbWVudEJlZ2luKioqKioqCi0qCi0qIC0tIFZsY0RlcXVhbnRJbnRyYUgyNjNCbG9jayAtLSBEZWNvZGVzIHRoZSBEQ1QgY29lZmZpY2llbnRzIG9mIG9uZSA4eDggYmxvY2sgYW5kIHBlcmZvcm0KLSAgICAgICAgICAgIGRlcXVhbnRpemF0aW9uIGluIEguMjYzIG1vZGUgZm9yIElOVFJBIGJsb2NrLgotICAgIERhdGU6ICAgICAgIDA4LzA4LzIwMDAKLSAgICBNb2RpZmllZDogICAgICAgICAgICAgICAzLzIxLzAxCi0gICAgICAgICAgICAgICAgY2xlYW4gdXAsIGFkZGVkIGNsaXBwaW5nLCAxNi1iaXQgaW50IGNhc2UsIHJlbW92ZWQgbXVsdGlwbGUgemlnemFnaW5nCi0qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0KLQotaW50IFZsY0RlcXVhbnRIMjYzSW50cmFCbG9jayhWaWRlb0RlY0RhdGEgKnZpZGVvLCBpbnQgY29tcCwgaW50IHN3aXRjaGVkLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICB1aW50OCAqYml0bWFwY29sLCB1aW50OCAqYml0bWFwcm93KQotewotICAgIEJpdHN0cmVhbURlY1ZpZGVvICpzdHJlYW0gPSB2aWRlby0+Yml0c3RyZWFtOwotICAgIGludDE2ICpkYXRhYmxvY2sgPSB2aWRlby0+bWJsb2NrLT5ibG9ja1tjb21wXTsgLyogMTAvMjAvMjAwMCwgYXNzdW1lIGl0IGhhcyBiZWVuIHJlc2V0IG9mIGFsbC16ZXJvICEhISovCi0gICAgaW50MzIgdGVtcDsKLSAgICBpbnQgbWJudW0gPSB2aWRlby0+bWJudW07Ci0gICAgdWludCBDQlAgPSB2aWRlby0+aGVhZGVySW5mby5DQlBbbWJudW1dOwotICAgIGludCBRUCA9IHZpZGVvLT5RUE1CW21ibnVtXTsKLSAgICB0eXBlRENTdG9yZSAqREMgPSB2aWRlby0+cHJlZERDICsgbWJudW07Ci0gICAgaW50IHhfcG9zID0gdmlkZW8tPm1ibnVtX2NvbDsKLSAgICB0eXBlRENBQ1N0b3JlICpEQ0FDX3JvdyA9IHZpZGVvLT5wcmVkRENBQ19yb3cgKyB4X3BvczsKLSAgICB0eXBlRENBQ1N0b3JlICpEQ0FDX2NvbCA9IHZpZGVvLT5wcmVkRENBQ19jb2w7Ci0gICAgdWludCBBQ3ByZWRfZmx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RpbmcgKi8KLSAgICBkb0RDQUNQcmVkaWN0aW9uKHZpZGVvLCBjb21wLCBkYXRhYmxvY2ssICZkaXJlY3Rpb24pOwotICAgIGlmICghQUNwcmVkX2ZsYWcpIGRpcmVjdGlvbiA9IDA7Ci0KLSAgICBpbnZfemlnemFnID0gemlnemFnX2ludiArIChBQ3ByZWRfZmxhZyA8PCA2KSArIChkaXJlY3Rpb24gPDwgNik7ICAvKiAgMDQvMTcvMDEgKi8KLQotICAgIGkgPSAxOwotICAgIGlmIChDQlAgJiAoMSA8PCAoNSAtIGNvbXApKSkKLSAgICB7Ci0gICAgICAgIGkgPSAxIC0gc3dpdGNoZWQ7Ci0gICAgICAgIGRvCi0gICAgICAgIHsKLSAgICAgICAgICAgIHJldHVybl9zdGF0dXMgPSAoKnZsY0RlY0NvZWZmKShzdHJlYW0sICZydW5fbGV2ZWwpOwotICAgICAgICAgICAgaWYgKHJldHVybl9zdGF0dXMgIT0gUFZfU1VDQ0VTUykKLSAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICBsYXN0ID0gMTsvKiAxMS8xLzIwMDAgbGV0IGl0IHNsaXBzIHVuZGV0ZWN0ZWQsIGp1c3QgbGlrZQotICAgICAgICAgICAgICAgICAgICAgICAgIGluIG9yaWdpbmFsIHZlcnNpb24gKi8KLSAgICAgICAgICAgICAgICBpID0gVkxDX0VSUk9SOwotICAgICAgICAgICAgICAgIEFDcHJlZF9mbGFnID0gMDsgICAvKiBubyBvZiBjb2VmZmljaWVudHMgc2hvdWxkIG5vdCBnZXQgcmVzZXQgICAwMy8wNy8yMDAyICovCi0gICAgICAgICAgICAgICAgYnJlYWs7Ci0gICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgIGkgKz0gcnVuX2xldmVsLnJ1bjsKLSAgICAgICAgICAgIGxhc3QgPSBydW5fbGV2ZWwubGFzdDsKLSAgICAgICAgICAgIGlmIChpID49IDY0KQotICAgICAgICAgICAgewotICAgICAgICAgICAgICAgIEFDcHJlZF9mbGFnID0gMDsgICAgLyogbm8gb2YgY29lZmZpY2llbnRzIHNob3VsZCBub3QgZ2V0IHJlc2V0ICAgMDMvMDcvMjAwMiAqLwotICAgICAgICAgICAgICAgIGkgPSBWTENfTk9fTEFTVF9CSVQ7Ci0gICAgICAgICAgICAgICAgbGFzdCA9IDE7Ci0gICAgICAgICAgICAgICAgYnJlYWs7Ci0gICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgIGsgPSBpbnZfemlnemFnW2ldOwotCi0gICAgICAgICAgICBpZiAocnVuX2xldmVsLnNpZ24gPT0gMSkKLSAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICBkYXRhYmxvY2tba10gLT0gcnVuX2xldmVsLmxldmVsOwotICAgICAgICAgICAgICAgIHNnbl9jb2VmZiA9IC0xOwotICAgICAgICAgICAgfQotICAgICAgICAgICAgZWxzZQotICAgICAgICAgICAgewotICAgICAgICAgICAgICAgIGRhdGFibG9ja1trXSArPSBydW5fbGV2ZWwubGV2ZWw7Ci0gICAgICAgICAgICAgICAgc2duX2NvZWZmID0gMTsKLSAgICAgICAgICAgIH0KLQotCi0gICAgICAgICAgICBpZiAoQUNfcm93Y29sW2tdKSAgIC8qICAxMC8yNS8yMDAwICovCi0gICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgdGVtcCA9IChpbnQzMilRUCAqICgyICogZGF0YWJsb2NrW2tdICsgc2duX2NvZWZmKSAtIHNnbl9jb2VmZiArIChRUCAmIDEpICogc2duX2NvZWZmOwotICAgICAgICAgICAgICAgIGlmICh0ZW1wID4gMjA0NykgdGVtcCA9IDIwNDc7ICAgICAgICAgICAgLyogIDAzLzE0LzAxICovCi0gICAgICAgICAgICAgICAgZWxzZSBpZiAodGVtcCA8IC0yMDQ4KSAgdGVtcCA9IC0yMDQ4OwotICAgICAgICAgICAgICAgIGRhdGFibG9ja1trXSA9IChpbnQxNikgdGVtcDsKLQotI2lmZGVmIEZBU1RfSURDVAotICAgICAgICAgICAgICAgIGJpdG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gICAgICAgICAgIGlmIChkY2FjX2NvbFtqXSkKLSAgICAgICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgICAgIGlmIChkYXRhYmxvY2tba10gPiAwKQotICAgICAgICAgICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgICAgICAgICBpZiAoZGF0YWJsb2NrW2tdID4gMjA0NykgZGNhY19jb2xbal0gPSAyMDQ3OwotICAgICAgICAgICAgICAgICAgICAgICAgc2duX2NvZWZmID0gMTsKLSAgICAgICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgICAgICBlbHNlCi0gICAgICAgICAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAgICAgICAgIGlmIChkYXRhYmxvY2tba10gPCAtMjA0OCkgZGNhY19jb2xbal0gPSAtMjA0ODsKLSAgICAgICAgICAgICAgICAgICAgICAgIHNnbl9jb2VmZiA9IC0xOwotICAgICAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgICAgIHRlbXAgPSAoaW50MzIpUVAgKiAoMiAqIGRhdGFibG9ja1trXSArIHNnbl9jb2VmZikgLSBzZ25fY29lZmYgKyAoUVAgJiAxKSAqIHNnbl9jb2VmZjsKLSAgICAgICAgICAgICAgICAgICAgaWYgKHRlbXAgPiAyMDQ3KSB0ZW1wID0gMjA0NzsgICAgICAgICAgICAvKiAgMDMvMTQvMDEgKi8KLSAgICAgICAgICAgICAgICAgICAgZWxzZSBpZiAodGVtcCA8IC0yMDQ4KSAgdGVtcCA9IC0yMDQ4OwotICAgICAgICAgICAgICAgICAgICBkYXRhYmxvY2tba10gPSAoaW50MTYpIHRlbXA7Ci0jaWZkZWYgRkFTVF9JRENUCi0gICAgICAgICAgICAgICAgICAgIGJpdG1hcGNvbFswXSB8PSBtYXNrW2s+PjNdOwotI2VuZGlmCi0KLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgIGZvciAoayA9IDE7IGsgPCA4OyBrKyspCi0gICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgaWYgKGRhdGFibG9ja1trXSkKLSAgICAgICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgICAgIHNnbl9jb2VmZiA9IChkYXRhYmxvY2tba10gPiAwKSA/IDEgOiAtMTsKLSAgICAgICAgICAgICAgICAgICAgdGVtcCA9IChpbnQzMilRUCAqICgyICogZGF0YWJsb2NrW2tdICsgc2duX2NvZWZmKSAtIHNnbl9jb2VmZiArIChRUCAmIDEpICogc2duX2NvZWZmOwotICAgICAgICAgICAgICAgICAgICBpZiAodGVtcCA+IDIwNDcpIHRlbXAgPSAyMDQ3OyAgICAgICAgICAgIC8qICAwMy8xNC8wMSAqLwotICAgICAgICAgICAgICAgICAgICBlbHNlIGlmICh0ZW1wIDwgLTIwNDgpICB0ZW1wID0gLTIwNDg7Ci0gICAgICAgICAgICAgICAgICAgIGRhdGFibG9ja1trXSA9IChpbnQxNikgdGVtcDsKLSNpZmRlZiBGQVNUX0lEQ1QKLSAgICAgICAgICAgICAgICAgICAgYml0bWFwY29sW2tdIHw9IDEyODsKLSNlbmRpZgotCi0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgfQotICAgICAgICB9Ci0gICAgICAgIGVsc2UKLSAgICAgICAgewotCi0gICAgICAgICAgICBkY2FjX2NvbFswXSAgPSBkYXRhYmxvY2tbOF07Ci0gICAgICAgICAgICBkY2FjX2NvbFsxXSAgPSBkYXRhYmxvY2tbMTZdOwotICAgICAgICAgICAgZGNhY19jb2xbMl0gID0gZGF0YWJsb2NrWzI0XTsKLSAgICAgICAgICAgIGRjYWNfY29sWzNdICA9IGRhdGFibG9ja1szMl07Ci0gICAgICAgICAgICBkY2FjX2NvbFs0XSAgPSBkYXRhYmxvY2tbNDBdOwotICAgICAgICAgICAgZGNhY19jb2xbNV0gID0gZGF0YWJsb2NrWzQ4XTsKLSAgICAgICAgICAgIGRjYWNfY29sWzZdICA9IGRhdGFibG9ja1s1Nl07Ci0KLQotICAgICAgICAgICAgZm9yIChqID0gMCwgayA9IDE7IGsgPCA4OyBrKyssIGorKykKLSAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICBkY2FjX3Jvd1tqXSA9IGRhdGFibG9ja1trXTsKLSAgICAgICAgICAgICAgICBpZiAoZGNhY19yb3dbal0pCi0gICAgICAgICAgICAgICAgewotICAgICAgICAgICAgICAgICAgICBpZiAoZGF0YWJsb2NrW2tdID4gMCkKLSAgICAgICAgICAgICAgICAgICAgewotICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGRhdGFibG9ja1trXSA+IDIwNDcpIGRjYWNfcm93W2pdID0gMjA0NzsKLSAgICAgICAgICAgICAgICAgICAgICAgIHNnbl9jb2VmZiA9IDE7Ci0gICAgICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICAgICAgZWxzZQotICAgICAgICAgICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgICAgICAgICBpZiAoZGF0YWJsb2NrW2tdIDwgLTIwNDgpIGRjYWNfcm93W2pdID0gLTIwNDg7Ci0gICAgICAgICAgICAgICAgICAgICAgICBzZ25fY29lZmYgPSAtMTsKLSAgICAgICAgICAgICAgICAgICAgfQotCi0gICAgICAgICAgICAgICAgICAgIHRlbXAgPSAoaW50MzIpUVAgKiAoMiAqIGRhdGFibG9ja1trXSArIHNnbl9jb2VmZikgLSBzZ25fY29lZmYgKyAoUVAgJiAxKSAqIHNnbl9jb2VmZjsKLSAgICAgICAgICAgICAgICAgICAgaWYgKHRlbXAgPiAyMDQ3KSB0ZW1wID0gMjA0NzsgICAgICAgICAgICAvKiAgMDMvMTQvMDEgKi8KLSAgICAgICAgICAgICAgICAgICAgZWxzZSBpZiAodGVtcCA8IC0yMDQ4KSAgdGVtcCA9IC0yMDQ4OwotICAgICAgICAgICAgICAgICAgICBkYXRhYmxvY2tba10gPSAoaW50KSB0ZW1wOwotI2lmZGVmIEZBU1RfSURDVAotICAgICAgICAgICAgICAgICAgICBiaXRtYXBjb2xba10gfD0gMTI4OwotI2VuZGlmCi0KLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICB9Ci0gICAgICAgICAgICBmb3IgKGsgPSA4OyBrIDwgNjQ7IGsgKz0gOCkKLSAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICBpZiAoZGF0YWJsb2NrW2tdKQotICAgICAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAgICAgc2duX2NvZWZmID0gKGRhdGFibG9ja1trXSA+IDApID8gMSA6IC0xOwotICAgICAgICAgICAgICAgICAgICB0ZW1wID0gKGludDMyKVFQICogKDIgKiBkYXRhYmxvY2tba10gKyBzZ25fY29lZmYpIC0gc2duX2NvZWZmICsgKFFQICYgMSkgKiBzZ25fY29lZmY7Ci0gICAgICAgICAgICAgICAgICAgIGlmICh0ZW1wID4gMjA0NykgdGVtcCA9IDIwNDc7ICAgICAgICAgICAgLyogIDAzLzE0LzAxICovCi0gICAgICAgICAgICAgICAgICAgIGVsc2UgaWYgKHRlbXAgPCAtMjA0OCkgIHRlbXAgPSAtMjA0ODsKLSAgICAgICAgICAgICAgICAgICAgZGF0YWJsb2NrW2tdID0gKGludDE2KSB0ZW1wOwotI2lmZGVmIEZBU1RfSURDVAotICAgICAgICAgICAgICAgICAgICBiaXRtYXBjb2xbMF0gfD0gbWFza1trPj4zXTsKLSNlbmRpZgotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgIH0KLQotICAgICAgICB9Ci0gICAgfQotICAgIGVsc2UKLSAgICB7Ci0gICAgICAgIGRjYWNfcm93WzBdICA9IGRhdGFibG9ja1sxXTsKLSAgICAgICAgZGNhY19yb3dbMV0gID0gZGF0YWJsb2NrWzJdOwotICAgICAgICBkY2FjX3Jvd1syXSAgPSBkYXRhYmxvY2tbM107Ci0gICAgICAgIGRjYWNfcm93WzNdICA9IGRhdGFibG9ja1s0XTsKLSAgICAgICAgZGNhY19yb3dbNF0gID0gZGF0YWJsb2NrWzVdOwotICAgICAgICBkY2FjX3Jvd1s1XSAgPSBkYXRhYmxvY2tbNl07Ci0gICAgICAgIGRjYWNfcm93WzZdICA9IGRhdGFibG9ja1s3XTsKLQotICAgICAgICBkY2FjX2NvbFswXSAgPSBkYXRhYmxvY2tbOF07Ci0gICAgICAgIGRjYWNfY29sWzFdICA9IGRhdGFibG9ja1sxNl07Ci0gICAgICAgIGRjYWNfY29sWzJdICA9IGRhdGFibG9ja1syNF07Ci0gICAgICAgIGRjYWNfY29sWzNdICA9IGRhdGFibG9ja1szMl07Ci0gICAgICAgIGRjYWNfY29sWzRdICA9IGRhdGFibG9ja1s0MF07Ci0gICAgICAgIGRjYWNfY29sWzVdICA9IGRhdGFibG9ja1s0OF07Ci0gICAgICAgIGRjYWNfY29sWzZdICA9IGRhdGFibG9ja1s1Nl07Ci0KLSAgICAgICAgZm9yIChrID0gMTsgayA8IDg7IGsrKykKLSAgICAgICAgewotICAgICAgICAgICAgaWYgKGRhdGFibG9ja1trXSkKLSAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICBzZ25fY29lZmYgPSAoZGF0YWJsb2NrW2tdID4gMCkgPyAxIDogLTE7Ci0gICAgICAgICAgICAgICAgdGVtcCA9IChpbnQzMilRUCAqICgyICogZGF0YWJsb2NrW2tdICsgc2duX2NvZWZmKSAtIHNnbl9jb2VmZiArIChRUCAmIDEpICogc2duX2NvZWZmOwotICAgICAgICAgICAgICAgIGlmICh0ZW1wID4gMjA0NykgdGVtcCA9IDIwNDc7ICAgICAgICAgICAgLyogIDAzLzE0LzAxICovCi0gICAgICAgICAgICAgICAgZWxzZSBpZiAodGVtcCA8IC0yMDQ4KSAgdGVtcCA9IC0yMDQ4OwotICAgICAgICAgICAgICAgIGRhdGFibG9ja1trXSA9IChpbnQxNikgdGVtcDsKLSNpZmRlZiBGQVNUX0lEQ1QKLSAgICAgICAgICAgICAgICBiaXRtYXBjb2xba10gfD0gMTI4OwotI2VuZGlmCi0gICAgICAgICAgICB9Ci0gICAgICAgIH0KLSAgICAgICAgZm9yIChrID0gODsgayA8IDY0OyBrICs9IDgpCi0gICAgICAgIHsKLSAgICAgICAgICAgIGlmIChkYXRhYmxvY2tba10pCi0gICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgc2duX2NvZWZmID0gKGRhdGFibG9ja1trXSA+IDApID8gMSA6IC0xOwotICAgICAgICAgICAgICAgIHRlbXAgPSAoaW50MzIpUVAgKiAoMiAqIGRhdGFibG9ja1trXSArIHNnbl9jb2VmZikgLSBzZ25fY29lZmYgKyAoUVAgJiAxKSAqIHNnbl9jb2VmZjsKLSAgICAgICAgICAgICAgICBpZiAodGVtcCA+IDIwNDcpIHRlbXAgPSAyMDQ3OyAgICAgICAgICAgIC8qICAwMy8xNC8wMSAqLwotICAgICAgICAgICAgICAgIGVsc2UgaWYgKHRlbXAgPCAtMjA0OCkgIHRlbXAgPSAtMjA0ODsKLSAgICAgICAgICAgICAgICBkYXRhYmxvY2tba10gPSAoaW50MTYpIHRlbXA7Ci0jaWZkZWYgRkFTVF9JRENUCi0gICAgICAgICAgICAgICAgYml0bWFwY29sWzBdIHw9IG1hc2tbaz4+M107Ci0jZW5kaWYKLSAgICAgICAgICAgIH0KLSAgICAgICAgfQotICAgIH0KLSAgICBpZiAoZGF0YWJsb2NrWzBdKQotICAgIHsKLSNpZmRlZiBGQVNUX0lEQ1QKLSAgICAgICAgYml0bWFwY29sWzBdIHw9IDEyODsKLSNlbmRpZgotCi0gICAgICAgIHRlbXAgPSAoaW50MzIpZGF0YWJsb2NrWzBdICogZGNfc2NhbGVyOwotICAgICAgICBpZiAodGVtcCA+IDIwNDcpIHRlbXAgPSAyMDQ3OyAgICAgICAgICAgIC8qICAwMy8xNC8wMSAqLwotICAgICAgICBlbHNlIGlmICh0ZW1wIDwgLTIwNDgpICB0ZW1wID0gLTIwNDg7Ci0gICAgICAgIGRhdGFibG9ja1swXSA9IChpbnQxNil0ZW1wOwotICAgIH0KLQotCi0jaWZkZWYgRkFTVF9JRENUCi0gICAgaWYgKGkgPiAx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Gp1c3QgbGlrZQotICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpbiBvcmlnaW5hbCB2ZXJzaW9uICovCi0gICAgICAgICAgICAgICAgICAgIGkgPSBWTENfRVJST1I7Ci0gICAgICAgICAgICAgICAgICAgIGJyZWFrOwotICAgICAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgICAgIGkgKz0gcnVuX2xldmVsLnJ1bjsKLSAgICAgICAgICAgICAgICBsYXN0ID0gcnVuX2xldmVsLmxhc3Q7Ci0gICAgICAgICAgICAgICAgaWYgKGkgPj0gNjQpCi0gICAgICAgICAgICAgICAgewotICAgICAgICAgICAgICAgICAgICAvKiAgaSA9IE5DT0VGRl9CTE9DSzsgKi8gICAgLyogIDExLzEvMDAgKi8KLSAgICAgICAgICAgICAgICAgICAgaSA9IFZMQ19OT19MQVNUX0JJVDsKLSAgICAgICAgICAgICAgICAgICAgbGFzdCA9IDE7Ci0gICAgICAgICAgICAgICAgICAgIGJyZWFrOwotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICBrID0gemlnemFnX2ludltpXTsKLQotICAgICAgICAgICAgICAgIGlmIChydW5fbGV2ZWwuc2lnbiA9PSAwKQotICAgICAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAgICAgdGVtcCA9IChpbnQzMilRUCAqICgyICogcnVuX2xldmVsLmxldmVsICsgMSkgLSAxICsgKFFQICYgMSk7Ci0gICAgICAgICAgICAgICAgICAgIGlmICh0ZW1wID4gMjA0NykgdGVtcCA9IDIwNDc7Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgIGVsc2UKLSAgICAgICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgICAgIHRlbXAgPSAtKGludDMyKVFQICogKDIgKiBydW5fbGV2ZWwubGV2ZWwgKyAxKSArIDEgLSAoUVAgJiAxKTsKLSAgICAgICAgICAgICAgICAgICAgaWYgKHRlbXAgPCAtMjA0OCkgdGVtcCA9IC0yMDQ4OwotICAgICAgICAgICAgICAgIH0KLQotCi0gICAgICAgICAgICAgICAgZGF0YWJsb2NrW2tdID0gKGludDE2KSB0ZW1wOwotCi0jaWZkZWYgRkFTVF9JRENUCi0gICAgICAgICAgICAgICAgYml0bWFwY29sW2smMHg3XSB8PSBtYXNrW2s+PjNdOwotI2VuZGlmCi0gICAgICAgICAgICAgICAgaSsrOwotICAgICAgICAgICAgfQotICAgICAgICAgICAgd2hpbGUgKCFsYXN0KTsKLQotICAgICAgICB9Ci0gICAgICAgIC8qIG5vIEFDREMgcHJlZGljdGlvbiB3aGVuIEFDREMgZGlzYWJsZSAgKi8KLSAgICAgICAgaWYgKGRhdGFibG9ja1swXSkKLSAgICAgICAgewotI2lmZGVmIEZBU1RfSURDVAotICAgICAgICAgICAgYml0bWFwY29sWzBdIHw9IDEyODsKLSNlbmRpZgotICAgICAgICAgICAgZGF0YWJsb2NrWzBdIDw8PSAzOyAgICAgICAgLyogbm8gbmVlZCB0byBjbGlwICAwOS8xOC8yMDAxICovCi0gICAgICAgIH0KLSNpZmRlZiBQVl9BTk5FWF9JSktUX1NVUFBPUlQKLSAgICB9Ci0gICAgZWxzZSAgLyogYWR2YW5jZWRfSU5UUkEgbW9kZSAqLwotICAgIHsKLSAgICAgICAgaSA9IDE7Ci0gICAgICAgIGRvRENBQ1ByZWRpY3Rpb25fSSh2aWRlbywgY29tcCwgZGF0YWJsb2NrKTsKLSAgICAgICAgLyogcGVyZm9ybSBvbmx5IFZMQyBkZWNvZGluZyAqLwotICAgICAgICBpZiAoIUFDcHJlZF9mbGFnKQotICAgICAgICB7Ci0gICAgICAgICAgICBkaXJlY3Rpb24gPSAwOwotICAgICAgICB9Ci0gICAgICAgIGVsc2UKLSAgICAgICAgewotICAgICAgICAgICAgZGlyZWN0aW9uID0gdmlkZW8tPm1ibG9jay0+ZGlyZWN0aW9uOwotICAgICAgICB9Ci0KLSAgICAgICAgaW52X3ppZ3phZyA9IHppZ3phZ19pbnYgKyAoQUNwcmVkX2ZsYWcgPDwgNikgKyAoZGlyZWN0aW9uIDw8IDYpOyAgLyogIDA0LzE3LzAxICovCi0KLSAgICAgICAgaWYgKENCUCAmICgxIDw8ICg1IC0gY29tcCkpKQotICAgICAgICB7Ci0gICAgICAgICAgICBpID0gMDsKLSAgICAgICAgICAgIGRvCi0gICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgcmV0dXJuX3N0YXR1cyA9ICgqdmxjRGVjQ29lZmYpKHN0cmVhbSwgJnJ1bl9sZXZlbCk7Ci0gICAgICAgICAgICAgICAgaWYgKHJldHVybl9zdGF0dXMgIT0gUFZfU1VDQ0VTUykKLSAgICAgICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgICAgIGxhc3QgPSAxOy8qICAxMS8xLzIwMDAgbGV0IGl0IHNsaXBzIHVuZGV0ZWN0ZWQsIGp1c3QgbGlrZQotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaW4gb3JpZ2luYWwgdmVyc2lvbiAqLwotICAgICAgICAgICAgICAgICAgICBpID0gVkxDX0VSUk9SOwotICAgICAgICAgICAgICAgICAgICBBQ3ByZWRfZmxhZyA9IDA7ICAgLyogbm8gb2YgY29lZmZpY2llbnRzIHNob3VsZCBub3QgZ2V0IHJlc2V0ICAgMDMvMDcvMjAwMiAqLwotICAgICAgICAgICAgICAgICAgICBicmVhazsKLSAgICAgICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgICAgICBpICs9IHJ1bl9sZXZlbC5ydW47Ci0gICAgICAgICAgICAgICAgbGFzdCA9IHJ1bl9sZXZlbC5sYXN0OwotICAgICAgICAgICAgICAgIGlmIChpID49IDY0KQotICAgICAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAgICAgLyogICAgICAgICAgICAgICAgICBpID0gTkNPRUZGX0JMT0NLOyAqLyAgICAvKiAgMTEvMS8wMCAqLwotICAgICAgICAgICAgICAgICAgICBBQ3ByZWRfZmxhZyA9IDA7ICAgIC8qIG5vIG9mIGNvZWZmaWNpZW50cyBzaG91bGQgbm90IGdldCByZXNldCAgIDAzLzA3LzIwMDIgKi8KLSAgICAgICAgICAgICAgICAgICAgaSA9IFZMQ19OT19MQVNUX0JJVDsKLSAgICAgICAgICAgICAgICAgICAgbGFzdCA9IDE7Ci0gICAgICAgICAgICAgICAgICAgIGJyZWFrOwotICAgICAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgICAgIGsgPSBpbnZfemlnemFnW2ldOwotCi0gICAgICAgICAgICAgICAgaWYgKHJ1bl9sZXZlbC5zaWduID09IDApCi0gICAgICAgICAgICAgICAgewotICAgICAgICAgICAgICAgICAgICBkYXRhYmxvY2tba10gKz0gKGludDE2KVFQICogMiAqIHJ1bl9sZXZlbC5sZXZlbDsKLSAgICAgICAgICAgICAgICAgICAgaWYgKGRhdGFibG9ja1trXSA+IDIwNDcpIGRhdGFibG9ja1trXSA9IDIwNDc7Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgIGVsc2UKLSAgICAgICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgICAgIGRhdGFibG9ja1trXSAtPSAoaW50MTYpUVAgKiAyICogcnVuX2xldmVsLmxldmVsOwotICAgICAgICAgICAgICAgICAgICBpZiAoZGF0YWJsb2NrW2tdIDwgLTIwNDgpIGRhdGFibG9ja1trXSA9IC0yMDQ4OwotICAgICAgICAgICAgICAgIH0KLSNpZmRlZiBGQVNUX0lEQ1QKLSAgICAgICAgICAgICAgICBiaXRtYXBjb2xbayYweDddIHw9IG1hc2tbaz4+M107Ci0jZW5kaWYKLQotICAgICAgICAgICAgICAgIGkrKzsKLSAgICAgICAgICAgIH0KLSAgICAgICAgICAgIHdoaWxlICghbGFzdCk7Ci0KLSAgICAgICAgfQotICAgICAgICAvLy8vLyBORUVEIFRPIERFUVVBTlQgVEhPU0UgUFJFRElDVEVEIEFDIENPRUZGCi0gICAgICAgIC8qIGRlcXVhbnRpemUgdGhlIHJlc3Qgb2YgQUMgcHJlZGljdGVkIGNvZWZmIHRoYXQgaGF2ZW4ndCBiZWVuIGRlcXVhbnQgKi8KLQotICAgICAgICBpZiAoQUNwcmVkX2ZsYWcpCi0gICAgICAgIHsKLSAgICAgICAgICAgIGkgPSBOQ09FRkZfQkxPQ0s7Ci0gICAgICAgICAgICBmb3IgKGsgPSAxOyBrIDwgODsgaysrKQotICAgICAgICAgICAgewotICAgICAgICAgICAgICAgIGlmIChkYXRhYmxvY2tba10pCi0gICAgICAgICAgICAgICAgewotICAgICAgICAgICAgICAgICAgICBiaXRtYXBjb2xba10gfD0gMTI4OwotICAgICAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgICAgIGlmIChkYXRhYmxvY2tbazw8M10pCi0gICAgICAgICAgICAgICAgewotICAgICAgICAgICAgICAgICAgICBiaXRtYXBjb2xbMF0gfD0gbWFza1trXTsKLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICB9Ci0gICAgICAgIH0KLQotICAgICAgICBkY2FjX3Jvd1swXSAgPSBkYXRhYmxvY2tbMV07Ci0gICAgICAgIGRjYWNfcm93WzFdICA9IGRhdGFibG9ja1syXTsKLSAgICAgICAgZGNhY19yb3dbMl0gID0gZGF0YWJsb2NrWzNdOwotICAgICAgICBkY2FjX3Jvd1szXSAgPSBkYXRhYmxvY2tbNF07Ci0gICAgICAgIGRjYWNfcm93WzRdICA9IGRhdGFibG9ja1s1XTsKLSAgICAgICAgZGNhY19yb3dbNV0gID0gZGF0YWJsb2NrWzZdOwotICAgICAgICBkY2FjX3Jvd1s2XSAgPSBkYXRhYmxvY2tbN107Ci0KLSAgICAgICAgZGNhY19jb2xbMF0gID0gZGF0YWJsb2NrWzhdOwotICAgICAgICBkY2FjX2NvbFsxXSAgPSBkYXRhYmxvY2tbMTZdOwotICAgICAgICBkY2FjX2NvbFsyXSAgPSBkYXRhYmxvY2tbMjRdOwotICAgICAgICBkY2FjX2NvbFszXSAgPSBkYXRhYmxvY2tbMzJdOwotICAgICAgICBkY2FjX2NvbFs0XSAgPSBkYXRhYmxvY2tbNDBdOwotICAgICAgICBkY2FjX2NvbFs1XSAgPSBkYXRhYmxvY2tbNDhdOwotICAgICAgICBkY2FjX2NvbFs2XSAgPSBkYXRhYmxvY2tbNTZdOwotCi0gICAgICAgIGlmIChkYXRhYmxvY2tbMF0pCi0gICAgICAgIHsKLSNpZmRlZiBGQVNUX0lEQ1QKLSAgICAgICAgICAgIGJpdG1hcGNvbFswXSB8PSAxMjg7Ci0jZW5kaWYKLQotICAgICAgICAgICAgZGF0YWJsb2NrWzBdIHw9IDE7Ci0gICAgICAgICAgICBpZiAoZGF0YWJsb2NrWzBdIDwgMCkKLSAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICBkYXRhYmxvY2tbMF0gPSAwOwotICAgICAgICAgICAgfQotICAgICAgICB9Ci0gICAgfQotI2VuZGlmCi0KLSNpZmRlZiBGQVNUX0lEQ1QKLSAgICBpZiAoaSA+IDEwKQotICAgIHsKLSAgICAgICAgZm9yIChrID0gMTsgayA8IDQ7IGsrKykgIC8qIGlmIGkgPiAxMCB0aGVuIGsgPSAwIGRvZXMgbm90IG1hdHRlciAgKi8KLSAgICAgICAgewotICAgICAgICAgICAgaWYgKGJpdG1hcGNvbFtrXSAhPSAwKQotICAgICAgICAgICAgewotICAgICAgICAgICAgICAgICgqYml0bWFwcm93KSB8PSBtYXNrW2tdOyAvKiAoMTw8KDctaSkpOyAqLwotICAgICAgICAgICAgfQotICAgICAgICB9Ci0gICAgfQotI2VuZGlmCi0KLSAgICAvKiBTdG9yZSB0aGUgcWNvZWZmLXZhbHVlcyBuZWVkZWQgbGF0ZXIgZm9yIHByZWRpY3Rpb24gKi8KLSAgICAoKkRDKVtjb21wXSA9IGRhdGFibG9ja1swXTsKLSAgICByZXR1cm4gaTsKLX0KLQotLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqQ29tbWVudEJlZ2luKioqKioqCi0qCi0qIC0tIFZsY0RlcXVhbnRJbnRlckgyNjNCbG9jayAtLSBEZWNvZGVzIHRoZSBEQ1QgY29lZmZpY2llbnRzIG9mIG9uZSA4eDggYmxvY2sgYW5kIHBlcmZvcm0KLSAgICAgICAgICAgIGRlcXVhbnRpemF0aW9uIGluIEguMjYzIG1vZGUgZm9yIElOVEVSIGJsb2NrLgotICAgIERhdGU6ICAgICAgIDA4LzA4LzIwMDAKLSAgICBNb2RpZmllZDogICAgICAgICAgICAgMy8yMS8wMQotICAgICAgICAgICAgICAgIGNsZWFuIHVwLCBhZGRlZCBjbGlwcGluZywgMTYtYml0IGludCBjYXNlCi0qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0KLQotaW50IFZsY0RlcXVhbnRIMjYzSW50ZXJCbG9jayhWaWRlb0RlY0RhdGEgKnZpZGVvLCBpbnQgY29tcCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdWludDggKmJpdG1hcGNvbCwgdWludDggKmJpdG1hcHJvdykKLXsKLSAgICBCaXRzdHJlYW1EZWNWaWRlbyAqc3RyZWFtID0gdmlkZW8tPmJpdHN0cmVhbTsKLSAgICBpbnQxNiAqZGF0YWJsb2NrID0gdmlkZW8tPm1ibG9jay0+YmxvY2tbY29tcF07IC8qIDEwLzIwLzIwMDAsIGFzc3VtZSBpdCBoYXMgYmVlbiByZXNldCBvZiBhbGwtemVybyAhISEqLwotICAgIGludDMyIHRlbXA7Ci0gICAgaW50IG1ibnVtID0gdmlkZW8tPm1ibnVtOwotICAgIGludCBRUCA9IHZpZGVvLT5RUE1CW21ibnVtXTsKLQotICAgIC8qKiogVkxDICoqKioqLwotICAgIGludCBpLCBrOwotICAgIFRjb2VmIHJ1bl9sZXZlbDsKLSAgICBpbnQgbGFzdCwgcmV0dXJuX3N0YXR1czsKLSAgICBWbGNEZWNGdW5jUCB2bGNEZWNDb2VmZjsKLQotICAgIC8qKiogUXVhbnRpemVyICoqKiovCi0KLQotICAgIGkgPSAwOwotCi0jaWZkZWYgRkFTVF9JRENUCi0gICAgKigodWludDMyKiliaXRtYXBjb2wpID0gKigodWludDMyKikoYml0bWFwY29sICsgNCkpID0gMDsKLSAgICAqYml0bWFwcm93ID0gMDsKLSNlbmRpZgotCi0gICAgLyogc2VsZWN0IHdoaWNoIEh1ZmZtYW4gdGFibGUgdG8gYmUgdXNlZCAqLwotICAgIHZsY0RlY0NvZWZmID0gdmlkZW8tPnZsY0RlY0NvZWZmSW50ZXI7Ci0KLSAgICAvKiBlbnRlciB0aGUgemVybyBydW4gZGVjb2RpbmcgbG9vcCAqLwotICAgIGRvCi0gICAgewotICAgICAgICByZXR1cm5fc3RhdHVzID0gKCp2bGNEZWNDb2VmZikoc3RyZWFtLCAmcnVuX2xldmVsKTsKLSAgICAgICAgaWYgKHJldHVybl9zdGF0dXMgIT0gUFZfU1VDQ0VTUykKLSAgICAgICAgewotCi0KLSAgICAgICAgICAgIGxhc3QgPSAxOy8qICAxMS8xLzIwMDAgbGV0IGl0IHNsaXBzIHVuZGV0ZWN0ZWQsIGp1c3QgbGlrZQotICAgICAgICAgICAgICAgICAgICAgaW4gb3JpZ2luYWwgdmVyc2lvbiAqLwotICAgICAgICAgICAgaSA9IC0xOwotICAgICAgICAgICAgYnJlYWs7Ci0gICAgICAgIH0KLQotICAgICAgICBpICs9IHJ1bl9sZXZlbC5ydW47Ci0gICAgICAgIGxhc3QgPSBydW5fbGV2ZWwubGFzdDsKLSAgICAgICAgaWYgKGkgPj0gNjQpCi0gICAgICAgIHsKLSAgICAgICAgICAgIGkgPSAtMTsKLSAgICAgICAgICAgIGxhc3QgPSAxOwotICAgICAgICAgICAgYnJlYWs7Ci0gICAgICAgIH0KLQotICAgICAgICBpZiAocnVuX2xldmVsLnNpZ24gPT0gMCkKLSAgICAgICAgewotICAgICAgICAgICAgdGVtcCA9IChpbnQzMilRUCAqICgyICogcnVuX2xldmVsLmxldmVsICsgMSkgLSAxICsgKFFQICYgMSk7Ci0gICAgICAgICAgICBpZiAodGVtcCA+IDIwNDcpIHRlbXAgPSAyMDQ3OwotCi0gICAgICAgIH0KLSAgICAgICAgZWxzZQotICAgICAgICB7Ci0gICAgICAgICAgICB0ZW1wID0gLShpbnQzMilRUCAqICgyICogcnVuX2xldmVsLmxldmVsICsgMSkgKyAxIC0gKFFQICYgMSk7Ci0gICAgICAgICAgICBpZiAodGVtcCA8IC0yMDQ4KSB0ZW1wID0gLTIwNDg7Ci0gICAgICAgIH0KLQotICAgICAgICBrID0gemlnemFnX2ludltpXTsKLSAgICAgICAgZGF0YWJsb2NrW2tdID0gKGludDE2KXRlbXA7Ci0jaWZkZWYgRkFTVF9JRENUCi0gICAgICAgIGJpdG1hcGNvbFtrJjB4N10gfD0gbWFza1trPj4zXTsKLSNlbmRpZgotICAgICAgICBpKys7Ci0gICAgfQotICAgIHdoaWxlICghbGFzdCk7Ci0KLSNpZmRlZiBGQVNUX0lEQ1QKLSAgICBpZiAoaSA+IDEwKSAgICAgICAgIC8qICAwNy8xOS8wMSAqLwotICAgIHsKLSAgICAgICAgZm9yIChrID0gMTsgayA8IDQ7IGsrKykgICAgICAgLyogIGlmIChpID4gMTAgKSBrID0gMCBkb2VzIG5vdCBtYXR0ZXIgKi8KLSAgICAgICAgewotICAgICAgICAgICAgaWYgKGJpdG1hcGNvbFtrXSAhPSAwKQotICAgICAgICAgICAgewotICAgICAgICAgICAgICAgICgqYml0bWFwcm93KSB8PSBtYXNrW2tdOyAvKiAoMTw8KDctaSkpOyAqLwotICAgICAgICAgICAgfQotICAgICAgICB9Ci0gICAgfQotI2VuZGlmCi0gICAgcmV0dXJuIGk7Ci19Ci0KZGlmZiAtLWdpdCBhL21lZGlhL2xpYnN0YWdlZnJpZ2h0L2NvZGVjcy9tNHZfaDI2My9kZWMvc3JjL3ZsY190YWIuY3BwIGIvbWVkaWEvbGlic3RhZ2VmcmlnaHQvY29kZWNzL200dl9oMjYzL2RlYy9zcmMvdmxjX3RhYi5jcH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MCwgIDAsCi0gICAgIDAsICAwLCAgMCwgIDAsICAwLCAgMCwgIDAsICAwLAotICAgICAwLCAgMCwgIDAsICAwLCAgMCwgIDAsICAwLCAgMAotICAgIH0KLX07Ci0KLQotY29uc3QgaW50IGludGVyX21heF9sZXZlbFsyXVtOQ09FRkZfQkxPQ0tdID0KLXsKLSAgICB7MTIsICA2LCAgNCwgIDMsICAzLCAgMywgIDMsICAyLAotICAgICAgICAyLCAgMiwgIDIsICAxLCAgMSwgIDEsICAxLCAgMSwKLSAgICAgICAgMSwgIDEsICAxLCAgMSwgIDEsICAxLCAgMSwgIDEsCi0gICAgICAgIDEsICAxLCAgMSwgIDAsICAwLCAgMCwgIDAsICAwLAotICAgICAgICAwLCAgMCwgIDAsICAwLCAgMCwgIDAsICAwLCAgMCwKLSAgICAgICAgMCwgIDAsICAwLCAgMCwgIDAsICAwLCAgMCwgIDAsCi0gICAgICAgIDAsICAwLCAgMCwgIDAsICAwLCAgMCwgIDAsICAwLAotICAgICAgICAwLCAgMCwgIDAsICAwLCAgMCwgIDAsICAwLCAgMH0sCi0KLSAgICB7MywgIDIsICAxLCAgMSwgIDEsICAxLCAgMSwgIDEsCi0gICAgIDEsICAxLCAgMSwgIDEsICAxLCAgMSwgIDEsICAxLAotICAgICAxLCAgMSwgIDEsICAxLCAgMSwgIDEsICAxLCAgMSwKLSAgICAgMSwgIDEsICAxLCAgMSwgIDEsICAxLCAgMSwgIDEsCi0gICAgIDEsICAxLCAgMSwgIDEsICAxLCAgMSwgIDEsICAxLAotICAgICAxLCAgMCwgIDAsICAwLCAgMCwgIDAsICAwLCAgMCwKLSAgICAgMCwgIDAsICAwLCAgMCwgIDAsICAwLCAgMCwgIDAsCi0gICAgIDAsICAwLCAgMCwgIDAsICAwLCAgMCwgIDAsICAwfQotfTsKLQotCi1jb25zdCBpbnQgaW50cmFfbWF4X3J1bjBbMjhdID0geyA5OTksIDE0LCAgOSwgIDcsICAzLCAgMiwgIDEsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAxLCAgMSwgIDEsICAxLCAgMCwgIDAsICAwLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMCwgIDAsICAwLCAgMCwgIDAsICAwLCAgMCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDAsICAwLCAgMCwgIDAsICAwLCAgMCwgIDAKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9OwotCi0KLWNvbnN0IGludCBpbnRyYV9tYXhfcnVuMVs5XSA9IHsgOTk5LCAyMCwgIDYsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDEsICAwLCAgMCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMCwgIDAsICAwCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9OwotCi1jb25zdCBpbnQgaW50ZXJfbWF4X3J1bjBbMTNdID0geyA5OTksCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAyNiwgMTAsICA2LCAgMiwgIDEsICAxLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMCwgIDAsICAwLCAgMCwgIDAsICAwCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfTsKLQotCi1jb25zdCBpbnQgaW50ZXJfbWF4X3J1bjFbNF0gPSB7IDk5OSwgNDAsICAxLCAgMCB9OwotCi1jb25zdCBWTENzaG9ydHRhYiBQVl9UTU5NVnRhYjBbXSA9Ci17Ci0gICAgezMsIDR9LCB7IC0zLCA0fSwgezIsIDN9LCB7MiwgM30sIHsgLTIsIDN9LCB7IC0yLCAzfSwgezEsIDJ9LCB7MSwgMn0sIHsxLCAyfSwgezEsIDJ9LAotICAgIHsgLTEsIDJ9LCB7IC0xLCAyfSwgeyAtMSwgMn0sIHsgLTEsIDJ9Ci19OwotCi1jb25zdCBWTENzaG9ydHRhYiBQVl9UTU5NVnRhYjFbXSA9Ci17Ci0gICAgezEyLCAxMH0sIHsgLTEyLCAxMH0sIH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ywgMjQsIDI2LCAyOCwgMzAsIDMyLCAzNSwgMzgsCi0gICAgMjUsIDI2LCAyOCwgMzAsIDMyLCAzNSwgMzgsIDQxLAotICAgIDI3LCAyOCwgMzAsIDMyLCAzNSwgMzgsIDQxLCA0NQotfTsKLQotLyogSU5URVIgKi8KLWNvbnN0IHN0YXRpYyBpbnQgbXBlZ19ucW1hdF9kZWZbNjRdICA9Ci17Ci0gICAgMTYsIDE3LCAxOCwgMTksIDIwLCAyMSwgMjIsIDIzLAotICAgIDE3LCAxOCwgMTksIDIwLCAyMSwgMjIsIDIzLCAyNCwKLSAgICAxOCwgMTksIDIwLCAyMSwgMjIsIDIzLCAyNCwgMjUsCi0gICAgMTksIDIwLCAyMSwgMjIsIDIzLCAyNCwgMjYsIDI3LAotICAgIDIwLCAyMSwgMjIsIDIzLCAyNSwgMjYsIDI3LCAyOCwKLSAgICAyMSwgMjIsIDIzLCAyNCwgMjYsIDI3LCAyOCwgMzAsCi0gICAgMjIsIDIzLCAyNCwgMjYsIDI3LCAyOCwgMzAsIDMxLAotICAgIDIzLCAyNCwgMjUsIDI3LCAyOCwgMzAsIDMxLCAzMwotfTsKLSNlbmRpZgotCi0vKiA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0gKi8KLS8qICBGdW5jdGlvbiA6IENhbGNOdW1CaXRzKCkgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogIFB1cnBvc2UgIDogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgSW4vb3V0ICAgOiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICBSZXR1cm4gICA6IENhbGN1bGF0ZSB0aGUgbWluaW11bSBudW1iZXIgb2YgYml0cyByZXF1aXJlZCB0byAgICAgICAgICAgICAqLwotLyogICAgICAgICAgICAgIHJlcHJlc2VudCB4LiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgTm90ZSAgICAgOiBUaGlzIGlzIGFuIGVxdWl2YWxlbnQgaW1wbGVtZW50YXRpb24gb2YgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICAgICAgICAgICAgICAgICAgICAgIChsb25nKWNlaWwobG9nKChkb3VibGUpeCkvbG9nKDIuMCkpICAgICAgICAgICAgICAgICAqLwotLyogIE1vZGlmaWVkIDogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0gKi8KLWludCBDYWxjTnVtQml0cyh1aW50IHgpCi17Ci0gICAgaW50IGkgPSAxOwotICAgIHdoaWxlICh4ID4+PSAxKSBpKys7Ci0gICAgcmV0dXJuIGk7Ci19Ci0KLQotCi0vKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKipDb21tZW50QmVnaW4qKioqKioKLSoKLSogLS0gRGVjb2RlVm9sSGVhZGVyIC0tIERlY29kZSB0aGUgaGVhZGVyIG9mIGEgVk9MCi0qCi0qICAgMDQvMTAvMjAwMCA6IGluaXRpYWwgbW9kaWZpY2F0aW9uIHRvIHRoZSBuZXcgUFYtRGVjb2RlciBMaWIgZm9ybWF0LgotKiAgIDEwLzEyLzIwMDEgOiByZWplY3Qgbm9uIGNvbXBsaWFudCBiaXRzdHJlYW1zCi0qCi0qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKkNvbW1lbnRFbmQqKioqKioqKi8KLVBWX1NUQVRVUyBEZWNvZGVWT0xIZWFkZXIoVmlkZW9EZWNEYXRh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hhbmdlIHJlcXVpcmVzIHdlIGFsbG93IHN0YXJ0IHdpdGggVmlkZW8gT2JqZWN0IFNlcXVlbmNlICovCi0gICAgICAgIC8qIHZpc3VhbF9vYmplY3Rfc2VxdWVuY2Vfc3RhcnRfY29kZSAgICAgICAgICAgICovCi0gICAgICAgICh2b2lkKSBCaXRzdHJlYW1SZWFkQml0czMySEMoc3RyZWFtKTsKLSAgICAgICAgdG1wdmFyID0gKHVpbnQzMikgQml0c3RyZWFtUmVhZEJpdHMxNihzdHJlYW0sICA4KTsgLyogcHJvZmlsZSAqLwotI2lmbmRlZiBQVl9UT0xFUkFURV9WT0xfRVJST1JTCi0gICAgICAgIGlmIChsYXllcikgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvKiAgICAqLwotICAgICAgICB7Ci0gICAgICAgICAgICAvKiBzdXBwb3J0IFNTUEwwLTIgICovCi0gICAgICAgICAgICBpZiAodG1wdmFyICE9IDB4MTAgJiYgdG1wdmFyICE9IDB4MTEgJiYgdG1wdmFyICE9IDB4MTIgJiYKLSAgICAgICAgICAgICAgICAgICAgdG1wdmFyICE9IDB4QTEgJiYgdG1wdmFyICE9IDB4QTIgICYmIHRtcHZhciAhPSAweEEzLyogQ29yZSBTUEBMMS1MMyAqLykKLSAgICAgICAgICAgICAgICByZXR1cm4gUFZfRkFJTDsKLSAgICAgICAgfQotICAgICAgICBlbHNlCi0gICAgICAgIHsKLSAgICAgICAgICAgIC8qIHN1cHBvcnQgU1BMMC0zICYgU1NQTDAtMiAgICovCi0gICAgICAgICAgICBpZiAodG1wdmFyICE9IDB4MDEgJiYgdG1wdmFyICE9IDB4MDIgJiYgdG1wdmFyICE9IDB4MDMgJiYgdG1wdmFyICE9IDB4MDggJiYKLSAgICAgICAgICAgICAgICAgICAgdG1wdmFyICE9IDB4MTAgJiYgdG1wdmFyICE9IDB4MTEgJiYgdG1wdmFyICE9IDB4MTIgJiYKLSAgICAgICAgICAgICAgICA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4gUFZfRkFJTDsKLSAgICAgICAgfQotICAgICAgICAvKiB2aXN1YWxfb2JqZWN0X3N0YXJ0X2NvZGUgICAgICAgICAgICAgICAgICAgICAqLwotICAgICAgICBCaXRzdHJlYW1TaG93Qml0czMySEMoc3RyZWFtLCAmdG1wdmFyKTsKLSAgICAgICAgaWYgKHRtcHZhciAhPSBWSVNVQUxfT0JKRUNUX1NUQVJUX0NPREUpCi0gICAgICAgIHsKLSAgICAgICAgICAgIGRvCi0gICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgLyogU2VhcmNoIGZvciBWT0xfSEVBREVSICovCi0gICAgICAgICAgICAgICAgc3RhdHVzID0gUFZTZWFyY2hOZXh0TTRWRnJhbWUoc3RyZWFtKTsgLyogc2VhcmNoIDB4MDAgMHgwMCAweDAxICovCi0gICAgICAgICAgICAgICAgaWYgKHN0YXR1cyAhPSBQVl9TVUNDRVNTKSByZXR1cm4gUFZfRkFJTDsgLyogYnJlYWtzIHRoZSBsb29wICovCi0gICAgICAgICAgICAgICAgQml0c3RyZWFtU2hvd0JpdHMzMihzdHJlYW0sIFZPTF9TVEFSVF9DT0RFX0xFTkdUSCwgJnRtcHZhcik7Ci0gICAgICAgICAgICAgICAgUFZfQml0c3RyZWFtRmx1c2hCaXRzKHN0cmVhbSwgOCk7Ci0gICAgICAgICAgICB9Ci0gICAgICAgICAgICB3aGlsZSAodG1wdmFyICE9IFZPTF9TVEFSVF9DT0RFKTsKLSAgICAgICAgICAgIGdvdG8gZGVjb2RlX3ZvbDsKLSAgICAgICAgfQotICAgICAgICBlbHNlCi0gICAgICAgIHsKLSAgICAgICAgICAgIEJpdHN0cmVhbVJlYWRCaXRzMzJIQyhzdHJlYW0pOwotICAgICAgICB9Ci0KLSAgICAgICAgLyogIGlzX3Zpc3VhbF9vYmplY3RfaWRlbnRpZmllciAgICAgICAgICAgICovCi0gICAgICAgIHRtcHZhciA9ICh1aW50MzIpIEJpdHN0cmVhbVJlYWQxQml0cyhzdHJlYW0pOwotICAgICAgICBpZiAodG1wdmFyKQotICAgICAgICB7Ci0gICAgICAgICAgICAvKiB2aXN1YWxfb2JqZWN0X3ZlcmlkICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0gICAgICAgICAgICB0bXB2YXIgPSAodWludDMyKSBCaXRzdHJlYW1SZWFkQml0czE2KHN0cmVhbSwgNCk7Ci0gICAgICAgICAgICAvKiB2aXN1YWxfb2JqZWN0X3ByaW9yaXR5ICAgICAgICAgICAgICAgICAgICAgICAgICovCi0gICAgICAgICAgICB0bXB2YXIgPSAodWludDMyKSBCaXRzdHJlYW1SZWFkQml0czE2KHN0cmVhbSwgMyk7Ci0gICAgICAgIH0KLSAgICAgICAgLyogdmlzdWFsX29iamVjdF90eXBlICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLSAgICAgICAgQml0c3RyZWFtU2hvd0JpdHMzMihzdHJlYW0sIDQsICZ0bXB2YXIpOwotICAgICAgICBpZiAodG1wdmFyID09IDEpCi0gICAgICAgIHsgLyogdmlkZW9fc2lnbmFsX3R5cGUgKi8KLSAgICAgICAgICAgIFBWX0JpdHN0cmVhbUZsdXNoQml0cyhzdHJlYW0sIDQpOwotICAgICAgICAgICAgdG1wdmFyID0gKHVpbnQzMikgQml0c3RyZWFtUmVhZDFCaXRzKHN0cmVhbSk7Ci0gICAgICAgICAgICBpZiAodG1wdmFyID09IDEpCi0gICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgLyogdmlkZW9fZm9ybWF0ICovCi0gICAgICAgICAgICAgICAgdG1wdmFyID0gKHVpbnQzMikgQml0c3RyZWFtUmVhZEJpdHMxNihzdHJlYW0sIDMpOwotICAgICAgICAgICAgICAgIC8qIHZpZGVvX3JhbmdlICAqLwotICAgICAgICAgICAgICAgIHRtcHZhciA9ICh1aW50MzIpIEJpdHN0cmVhbVJlYWQxQml0cyhzdHJlYW0pOwotICAgICAgICAgICAgICAgIC8qIGNvbG9yX2Rlc2NyaXB0aW9uICovCi0gICAgICAgICAgICAgICAgdG1wdmFyID0gKHVpbnQzMikgQml0c3RyZWFtUmVhZDFCaXRzKHN0cmVhbSk7Ci0gICAgICAgICAgICAgICAgaWYgKHRtcHZhciA9PSAxKQotICAgICAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAgICAgLyogY29sb3JfcHJpbWFyaWVzICovCi0gICAgICAgICAgICAgICAgICAgIHRtcHZhciA9ICh1aW50MzIpIEJpdHN0cmVhbVJlYWRCaXRzMTYoc3RyZWFtLCA4KTsKLSAgICAgICAgICAgICAgICAgICAgLyogdHJhbnNmZXJfY2hhcmFjdGVyaXN0aWNzICovCi0gICAgICAgICAgICAgICAgICAgIHRtcHZhciA9ICh1aW50MzIpIEJpdHN0cmVhbVJlYWRCaXRzMTYoc3RyZWFtLCA4KTsKLSAgICAgICAgICAgICAgICAgICAgLyogbWF0cml4X2NvZWZmaWNpZW50cyAqLwotICAgICAgICAgICAgICAgICAgICB0bXB2YXIgPSAodWludDMyKSBCaXRzdHJlYW1SZWFkQml0czE2KHN0cmVhbSwgOCk7Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgfQotICAgICAgICB9Ci0gICAgICAgIGVsc2UKLSAgICAgICAgewotICAgICAgICAgICAgZG8KLSAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAvKiBTZWFyY2ggZm9yIFZPTF9IRUFERVIgKi8KLSAgICAgICAgICAgICAgICBzdGF0dXMgPSBQVlNlYXJjaE5leHRNNFZGcmFtZShzdHJlYW0pOyAvKiBzZWFyY2ggMHgwMCAweDAwIDB4MDEgKi8KLSAgICAgICAgICAgICAgICBpZiAoc3RhdHVzICE9IFBWX1NVQ0NFU1MpIHJldHVybiBQVl9GQUlMOyAvKiBicmVha3MgdGhlIGxvb3AgKi8KLSAgICAgICAgICAgICAgICBCaXRzdHJlYW1TaG93Qml0czMyKHN0cmVhbSwgVk9MX1NUQVJUX0NPREVfTEVOR1RILCAmdG1wdmFyKTsKLSAgICAgICAgICAgICAgICBQVl9CaXRzdHJlYW1GbHVzaEJpdHMoc3RyZWFtLCA4KTsKLSAgICAgICAgICAgIH0KLSAgICAgICAgICAgIHdoaWxlICh0bXB2YXIgIT0gVk9MX1NUQVJUX0NPREUpOwotICAgICAgICAgICAgZ290byBkZWNvZGVfdm9sOwotICAgICAgICB9Ci0KLSAgICAgICAgLyogbmV4dF9zdGFydF9jb2RlKCkgKi8KLSAgICAgICAgc3RhdHVzID0gUFZfQml0c3RyZWFtQnl0ZUFsaWduKHN0cmVhbSk7ICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8qICAxMC8xMi8wMSAqLwotICAgICAgICBzdGF0dXMgPSBCaXRzdHJlYW1TaG93Qml0czMySEMoc3RyZWFtLCAmdG1wdmFyKTsKLQotICAgICAgICBpZiAodG1wdmFyID09IFVTRVJfREFUQV9TVEFSVF9DT0RFKQotICAgICAgICB7Ci0gICAgICAgICAgICAvKiBTb21ldGhpbmcgaGFzIHRvIGJlIGRvbmUgdG8gZGVhbCB3aXRoIHVzZXIgZGF0YSAocGFyc2UgaXQpICAxMS8xMS85OSAqLwotICAgICAgICAgICAgc3RhdHVzID0gRGVjb2RlVXNlckRhdGEoc3RyZWFtKTsKLSAgICAgICAgICAgIGlmIChzdGF0dXMgIT0gUFZfU1VDQ0VTUykgcmV0dXJuIFBWX0ZBSUw7Ci0gICAgICAgIH0KLSAgICAgICAgc3RhdHVzID0gQml0c3RyZWFtU2hvd0JpdHMzMihzdHJlYW0sIDI3LCAmdG1wdmFyKTsgICAvKiAgMTAvMTIvMDEgKi8KLSAgICB9Ci0gICAgZWxzZQotICAgIHsKLSAgICAgICAgLyogICAgICB0bXB2YXIgPSAwOyAgICovICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLyogIDEwLzEyLzAxICovCi0gICAgICAgIHN0YXR1cyA9IEJpdHN0cmVhbVNob3dCaXRzMzIoc3RyZWFtLCAyNywgJnRtcHZhcik7ICAgICAvKiB1bmNvbW1lbnQgdGhpcyBsaW5lIGlmIHlvdSB3YW50Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0byBzdGFydCBkZWNvZGluZyB3aXRoIGEKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZpZGVvX29iamVjdF9zdGFydF9jb2RlICovCi0gICAgfQotCi0gICAgaWYgKHRtcHZhciA9PSBWT19TVEFSVF9DT0RFKQotICAgIHsKLSAgICAgICAgLyoqKioqCi0gICAgICAgICoKLSAgICAgICAgKiAgIFJlYWQgdGhlIFZPTCBoZWFkZXIgZW50cmllcyBmcm9tIHRoZSBiaXRzdHJlYW0KLSAgICAgICAgKgotICAgICAgICAqKioqKi8KLSAgICAgICAgLyogdmlkZW9fb2JqZWN0X3N0YXJ0X2NvZGUgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLSAgICAgICAgdG1wdmFyID0gQml0c3RyZWFtUmVhZEJpdHMzMihzdHJlYW0sIDI3KTsKLSAgICAgICAgdG1wdmFyID0gKHVpbnQzMikgQml0c3RyZWFtUmVhZEJpdHMxNihzdHJlYW0sIDUpOwotCi0KLSAgICAgICAgLyogdmlkZW9fb2JqZWN0X2xheWVyX3N0YXJ0X2NvZGUgICAgICAgICAgICAgICAgICAgKi8KLSAgICAgICAgQml0c3RyZWFtU2hvd0JpdHMzMihzdHJlYW0sIFZPTF9TVEFSVF9DT0RFX0xFTkdUSCwgJnRtcHZhcik7Ci0gICAgICAgIGlmICh0bXB2YXIgIT0gVk9MX1NUQVJUX0NPREUpCi0gICAgICAgIHsKLSAgICAgICAgICAgIHN0YXR1cyA9IEJpdHN0cmVhbUNoZWNrRW5kQnVmZmVyKHN0cmVhbSk7Ci0gICAgICAgICAgICBpZiAoc3RhdHVzID09IFBWX0VORF9PRl9WT1ApCi0gICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgdmlkZW8tPnNob3J0VmlkZW9IZWFkZXIgPSBUUlVFOwotICAgICAgICAgICAgICAgIHJldHVybiBQVl9TVUNDRVNTOwotICAgICAgICAgICAgfQotICAgICAgICAgICAgZWxzZQotICAgICAgICAgICAgewotICAgICAgICAgICAgICAgIGRvCi0gICAgICAgICAgICAgICAgewotICAgICAgICAgICAgICAgICAgICAvKiBTZWFyY2ggZm9yIFZPTF9IRUFERVIgKi8KLSAgICAgICAgICAgICAgICAgICAgc3RhdHVzID0gUFZTZWFyY2hOZXh0TTRWRnJhbWUoc3RyZWFtKTsvKiBzZWFyY2ggMHgwMCAweDAwIDB4MDEgKi8KLSAgICAgICAgICAgICAgICAgICAgaWYgKHN0YXR1cyAhPSBQVl9TVUNDRVNTKSByZXR1cm4gUFZfRkFJTDsgLyogYnJlYWtzIHRoZSBsb29wICovCi0gICAgICAgICAgICAgICAgICAgIEJpdHN0cmVhbVNob3dCaXRzMzIoc3RyZWFtLCBWT0xfU1RBUlRfQ09ERV9MRU5HVEgsICZ0bXB2YXIpOwotICAgICAgICAgICAgICAgICAgICBQVl9CaXRzdHJlYW1GbHVzaEJpdHMoc3RyZWFtLCA4KTsgLyogYWR2YW5jZSB0aGUgYnl0ZSBwdHIgKi8KLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgd2hpbGUgKHRtcHZhciAhPSBWT0xfU1RBUlRfQ09ERSk7Ci0gICAgICAgICAgICB9Ci0gICAgICAgIH0KLSAgICAgICAgZWxzZQotICAgICAgICB7Ci0gICAgICAgICAgICBQVl9CaXRzdHJlYW1GbHVzaEJpdHMoc3RyZWFtLCA4KTsKLSAgICAgICAgfQotCi1kZWNvZGVfdm9sOgotICAgICAgICBQVl9CaXRzdHJlYW1GbHVzaEJpdHMoc3RyZWFtLCBWT0xfU1RBUlRfQ09ERV9MRU5HVEggLSA4KTsKLSAgICAgICAgdmlkZW8tPnNob3J0VmlkZW9IZWFkZXIgPSAwOwotCi0gICAgICAgIC8qIHZvbF9pZCAoNCBiaXRzKSAqLwotICAgICAgICBjdXJyVm9sLT52b2xJRCA9IChpbnQpIEJpdHN0cmVhbVJlYWRCaXRzMTYoc3RyZWFtLCA0KTsKLQotICAgICAgICAvKiBSYW5kb21BY2Nlc3NpYmxlIGZsYWcgKi8KLSAgICAgICAgdG1wdmFyID0gKHVpbnQzMikgQml0c3RyZWFtUmVhZDFCaXRzKHN0cmVhbSk7Ci0KLSAgICAgICAgLyogb2JqZWN0IHR5cGUgKi8KLSAgICAgICAgdG1wdmFyID0gKHVpbnQzMikgQml0c3RyZWFtUmVhZEJpdHMxNihzdHJlYW0sIDgpOyAgICAgICAgICAgICAgICAvKiAgKi8KLQotI2lmZGVmIFBWX1RPTEVSQVRFX1ZPTF9FUlJPUlMKLSAgICAgICAgaWYgKHRtcHZhciA9PSAwKQotICAgICAgICB7Ci0gICAgICAgICAgICBpZiAobGF5ZXIpICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLyogICAgKi8KLSAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAvKiBzdXBwb3J0IFNTUEwwLTIgICovCi0gICAgICAgICAgICAgICAgaWYgKHByb2ZpbGUgIT0gMHgxMCAmJiBwcm9maWxlICE9IDB4MTEgJiYgcHJvZmlsZSAhPSAweDEyKQotICAgICAgICAgICAgICAgICAgICByZXR1cm4gUFZfRkFJTDsKLSAgICAgICAgICAgICAgICB0bXB2YXIgPSAweDAyOwotICAgICAgICAgICAgfQotICAgICAgICAgICAgZWxzZQotICAgICAgICAgICAgewotICAgICAgICAgICAgICAgIC8qIHN1cHBvcnQgU1BMMC0zICYgU1NQTDAtMiAgICovCi0gICAgICAgICAgICAgICAgaWYgKHByb2ZpbGUgIT0gMHgwMSAmJiBwcm9maWxlICE9IDB4MDIgJiYgcHJvZmlsZSAhPSAweDAzICYmIHByb2ZpbGUgIT0gMHgwOCAmJgotICAgICAgICAgICAgICAgICAgICAgICAgcHJvZmlsZSAhPSAweDEwICYmIHByb2ZpbGUgIT0gMHgxMSAmJiBwcm9maWxlICE9IDB4MTIpCi0gICAgICAgICAgICAgICAgICAgIHJldHVybiBQVl9GQUlMOwotICAgICAgICAgICAgICAgIHRtcHZhciA9IDB4MDE7Ci0gICAgICAgICAgICB9Ci0gICAgICAgICAgICBwcm9maWxlIHw9IDB4MDEwMDsKLSAgICAgICAgfQotI2VuZGlmCi0KLSAgICAgICAgaWYgKGxheWVyKQotICAgICAgICB7Ci0gICAgICAgICAgICBpZiAodG1wdmFyICE9IDB4MDIpIHJldHVybiBQVl9GQUlMOwotICAgICAgICB9Ci0gICAgICAgIGVsc2UKLSAgICAgICAgewotICAgICAgICAgICAgaWYgKHRtcHZhciAhPSAweDAxKSByZXR1cm4gUFZfRkFJTDsKLSAgICAgICAgfQotCi0gICAgICAgIC8qIHZlcnNpb24gaWQgc3BlY2lmaWVkPyAqLwotICAgICAgICB0bXB2YXIgPSAodWludDMyKSBCaXRzdHJlYW1SZWFkMUJpdHMoc3RyZWFtKTsKLSAgICAgICAgaWYgKHRtcHZhciA9PSAxKQotICAgICAgICB7Ci0gICAgICAgICAgICAvKiB2ZXJzaW9uIElEICovCi0gICAgICAgICAgICB2ZXJzaW9uX2lkID0gKHVpbnQzMikgQml0c3RyZWFtUmVhZEJpdHMxNihzdHJlYW0sIDQpOwotICAgICAgICAgICAgLyogcHJpb3JpdHkgKi8KLSAgICAgICAgICAgIHRtcHZhciA9ICh1aW50MzIpIEJpdHN0cmVhbVJlYWRCaXRzMTYoc3RyZWFtLCAzKTsKLQotICAgICAgICB9Ci0KLSAgICAgICAgLyogYXNwZWN0IHJhdGlvIGluZm8gKi8KLSAgICAgICAgdG1wdmFyID0gKHVpbnQzMikgQml0c3RyZWFtUmVhZEJpdHMxNihzdHJlYW0sIDQpOwotICAgICAgICBpZiAodG1wdmFyID09IDApIHJldHVybiBQVl9GQUlMOwotICAgICAgICBpZiAodG1wdmFyID09IDB4ZiAvKiBleHRlbmRlZF9wYXIgKi8pCi0gICAgICAgIHsKLSAgICAgICAgICAgIC8qIHdpZHRoICovCi0gICAgICAgICAgICB0bXB2YXIgPSAodWludDMyKSBCaXRzdHJlYW1SZWFkQml0czE2KHN0cmVhbSwgOCk7Ci0gICAgICAgICAgICAvKiBoZWlnaHQgKi8KLSAgICAgICAgICAgIHRtcHZhciA9ICh1aW50MzIpIEJpdHN0cmVhbVJlYWRCaXRzMTYoc3RyZWFtLCA4KTsKLSAgICAgICAgfQotCi0KLSAgICAgICAgLyogY29udHJvbCBwYXJhbWV0ZXJzIHByZXNlbnQ/ICovCi0gICAgICAgIHRtcHZhciA9ICh1aW50MzIpIEJpdHN0cmVhbVJlYWQxQml0cyhzdHJlYW0pOwotCi0gICAgICAgIC8qICBHZXQgdGhlIHBhcmFtZXRlcnMgKHNraXBwZWQpICovCi0gICAgICAgIC8qICAwMy8xMC85OSAqLwotICAgICAgICBpZiAodG1wdmFyKQotICAgICAgICB7Ci0gICAgICAgICAgICAvKiBjaHJvbWFfZm9ybWF0ICAgICAgICAgICAgICAgICAgICAqLwotICAgICAgICAgICAgdG1wdmFyID0gQml0c3RyZWFtUmVhZEJpdHMxNihzdHJlYW0sIDIpOwotICAgICAgICAgICAgaWYgKHRtcHZhciAhPSAxKSByZXR1cm4gUFZfRkFJTDsKLSAgICAgICAgICAgIC8qIGxvd19kZWxheSAgKi8KLSAgICAgICAgICAgIHRtcHZhciA9IEJpdHN0cmVhbVJlYWQxQml0cyhzdHJlYW0pOwotCi0gICAgICAgICAgICAvKiB2YnZfcGFyYW1ldGVycyBwcmVzZW50PyAqLwotICAgICAgICAgICAgdG1wdmFyID0gKHVpbnQzMikgQml0c3RyZWFtUmVhZDFCaXRzKHN0cmVhbSk7Ci0gICAgICAgICAgICBpZiAodG1wdmFyKQotICAgICAgICAgICAgewotICAgICAgICAgICAgICAgIC8qIGZpcnN0X2hhbGZfYml0X3JhdGUgICAgKi8KLSAgICAgICAgICAgICAgICBCaXRzdHJlYW1SZWFkQml0czE2KHN0cmVhbSwgMTUpOwotICAgICAgICAgICAgICAgIGlmICghQml0c3RyZWFtUmVhZDFCaXRzKHN0cmVhbSkpIHJldHVybiBQVl9GQUlMOwotICAgICAgICAgICAgICAgIC8qIGxhdHRlcl9oYWxmX2JpdF9yYXRlICAgKi8KLSAgICAgICAgICAgICAgICBCaXRzdHJlYW1SZWFkQml0czE2KHN0cmVhbSwgMTUpOwotICAgICAgICAgICAgICAgIGlmICghQml0c3RyZWFtUmVhZDFCaXRzKHN0cmVhbSkpIHJldHVybiBQVl9GQUlMOwotICAgICAgICAgICAgICAgIC8qIGZpcnN0X2hhbGZfdmJ2X2J1ZmZlcl9zaXplICAgKi8KLSAgICAgICAgICAgICAgICBCaXRzdHJlYW1SZWFkQml0czE2KHN0cmVhbSwgMTUpOwotICAgICAgICAgICAgICAgIGlmICghQml0c3RyZWFtUmVhZDFCaXRzKHN0cmVhbSkpIHJldHVybiBQVl9GQUlMOwotICAgICAgICAgICAgICAgIC8qIGxhdHRlcl9oYWxmX3Zidl9idWZmZXJfc2l6ZSAgICovCi0gICAgICAgICAgICAgICAgQml0c3RyZWFtUmVhZEJpdHMxNihzdHJlYW0sICAzKTsKLSAgICAgICAgICAgICAgICAvKiBmaXJzdF9oYWxmX3Zidl9vY2N1cGFuY3kgICAgICovCi0gICAgICAgICAgICAgICAgQml0c3RyZWFtUmVhZEJpdHMxNihzdHJlYW0sIDExKTsKLSAgICAgICAgICAgICAgICBpZiAoIUJpdHN0cmVhbVJlYWQxQml0cyhzdHJlYW0pKSByZXR1cm4gUFZfRkFJTDsKLSAgICAgICAgICAgICAgICAvKiBsYXR0ZXJfaGFsZl92YnZfb2NjdXBhbmN5ICAqLwotICAgICAgICAgICAgICAgIEJpdHN0cmVhbVJlYWRCaXRzMTYoc3RyZWFtLCAxNSk7Ci0gICAgICAgICAgICAgICAgaWYgKCFCaXRzdHJlYW1SZWFkMUJpdHMoc3RyZWFtKSkgcmV0dXJuIFBWX0ZBSUw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N0X2xheWVyX2hlaWdodCAoMTMgYml0cykgKi8KLSAgICAgICAgdmlkZW8tPmRpc3BsYXlIZWlnaHQgPSB2aWRlby0+aGVpZ2h0ID0gKGludCkgQml0c3RyZWFtUmVhZEJpdHMxNihzdHJlYW0sIDEzKTsKLQotICAgICAgICAvKiByb3VuZCB1cCB0byBhIG11bHRpcGxlIG9mIE1CX1NJWkUuICAgMDgvMDkvMjAwMCAqLwotICAgICAgICB2aWRlby0+aGVpZ2h0ID0gKHZpZGVvLT5oZWlnaHQgKyAxNSkgJiAtMTY7Ci0vLyAgICAgIHZpZGVvLT5kaXNwbGF5SGVpZ2h0ICs9ICh2aWRlby0+ZGlzcGxheUhlaWdodCAmIDB4MSk7IC8qIGRpc3BsYXllZCBpbWFnZSBzaG91bGQgYmUgZXZlbiBzaXplICovCi0gICAgICAgIGlmICghQml0c3RyZWFtUmVhZDFCaXRzKHN0cmVhbSkpIHJldHVybiBQVl9GQUlMOwotCi0gICAgICAgIC8qICAwMy8xMC85OSAqLwotICAgICAgICAvKiBpbnRlcmxhY2VkICovCi0gICAgICAgIHRtcHZhciA9ICh1aW50MzIpIEJpdHN0cmVhbVJlYWQxQml0cyhzdHJlYW0pOwotICAgICAgICBpZiAodG1wdmFyICE9IDApCi0gICAgICAgIHsKLSAgICAgICAgICAgIG1wNGRlY19sb2coIkRlY29kZVZPTEhlYWRlcigpOiBJbnRlcmxhY2VkIHZpZGVvIGlzIG5vdCBzdXBwb3J0ZWQuXG4iKTsKLSAgICAgICAgICAgIHJldHVybiBQVl9GQUlMOwotICAgICAgICB9Ci0KLSAgICAgICAgLyogb2JtY19kaXNhYmxlICovCi0gICAgICAgIHRtcHZhciA9ICh1aW50MzIpIEJpdHN0cmVhbVJlYWQxQml0cyhzdHJlYW0pOwotICAgICAgICBpZiAodG1wdmFyID09IDApIHJldHVybiBQVl9GQUlMOwotCi0gICAgICAgIGlmICh2ZXJzaW9uX2lkID09IDEpCi0gICAgICAgIHsKLSAgICAgICAgICA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0IGJpdHMpICovCi0gICAgICAgICAgICAgICAgaSA9IDA7Ci0gICAgICAgICAgICAgICAgZG8KLSAgICAgICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgICAgIHFtYXRbKih6aWd6YWdfaW52K2kpXSA9IChpbnQpIEJpdHN0cmVhbVJlYWRCaXRzMTYoc3RyZWFtLCA4KTsKLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgd2hpbGUgKChxbWF0WyooemlnemFnX2luditpKV0gIT0gMCkgJiYgKCsraSA8IDY0KSk7Ci0KLSAgICAgICAgICAgICAgICBmb3IgKGogPSBpOyBqIDwgNjQ7IGorKykKLSAgICAgICAgICAgICAgICAgICAgcW1hdFsqKHppZ3phZ19pbnYraildID0gcW1hdFsqKHppZ3phZ19pbnYraS0xKV07Ci0gICAgICAgICAgICB9Ci0gICAgICAgICAgICBlbHNlCi0gICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgb3NjbF9tZW1jcHkocW1hdCwgbXBlZ19pcW1hdF9kZWYsIDY0KnNpemVvZihpbnQpKTsKLSAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgcW1hdFswXSA9IDA7ICAgICAgICAgICAgIC8qIG5lY2Vzc2FyeSBmb3Igc3dpdGNoZWQgJiYgTVBFRyBxdWFudCAgMDcvMDkvMDEgKi8KLQotICAgICAgICAgICAgLyogbG9hZF9ub25pbnRyYV9xdWFudF9tYXQgKDEgYml0KSAqLwotICAgICAgICAgICAgcW1hdCA9IGN1cnJWb2wtPm5pcW1hdDsKLSAgICAgICAgICAgIGN1cnJWb2wtPmxvYWROb25JbnRyYVF1YW50TWF0ID0gQml0c3RyZWFtUmVhZDFCaXRzKHN0cmVhbSk7Ci0gICAgICAgICAgICBpZiAoY3VyclZvbC0+bG9hZE5vbkludHJhUXVhbnRNYXQpCi0gICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgLyogbm9uaW50cmFfcXVhbnRfbWF0ICg4KjY0IGJpdHMpICovCi0gICAgICAgICAgICAgICAgaSA9IDA7Ci0gICAgICAgICAgICAgICAgZG8KLSAgICAgICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgICAgIHFtYXRbKih6aWd6YWdfaW52K2kpXSA9IChpbnQpIEJpdHN0cmVhbVJlYWRCaXRzMTYoc3RyZWFtLCA4KTsKLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgd2hpbGUgKChxbWF0WyooemlnemFnX2luditpKV0gIT0gMCkgJiYgKCsraSA8IDY0KSk7Ci0KLSAgICAgICAgICAgICAgICBmb3IgKGogPSBpOyBqIDwgNjQ7IGorKykKLSAgICAgICAgICAgICAgICAgICAgcW1hdFsqKHppZ3phZ19pbnYraildID0gcW1hdFsqKHppZ3phZ19pbnYraS0xKV07Ci0gICAgICAgICAgICB9Ci0gICAgICAgICAgICBlbHNlCi0gICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgb3NjbF9tZW1jcHkocW1hdCwgbXBlZ19ucW1hdF9kZWYsIDY0KnNpemVvZihpbnQpKTsKLSAgICAgICAgICAgIH0KLSNlbHNlCi0gICAgICAgICAgICByZXR1cm4gUFZfRkFJTDsKLSNlbmRpZgotICAgICAgICB9Ci0KLSAgICAgICAgaWYgKHZlcnNpb25faWQgIT0gMSkKLSAgICAgICAgewotICAgICAgICAgICAgLyogcXVhcnRlcl9zYW1wbGUgZW5hYmxlZCAqLwotICAgICAgICAgICAgdG1wdmFyID0gQml0c3RyZWFtUmVhZDFCaXRzKHN0cmVhbSk7Ci0gICAgICAgICAgICBpZiAodG1wdmFyKSByZXR1cm4gUFZfRkFJTDsKLSAgICAgICAgfQotCi0gICAgICAgIC8qIGNvbXBsZXhpdHlfZXN0aW1hdGlvbl9kaXNhYmxlICovCi0gICAgICAgIGN1cnJWb2wtPmNvbXBsZXhpdHlfZXN0RGlzYWJsZSA9IEJpdHN0cmVhbVJlYWQxQml0cyhzdHJlYW0pOwotICAgICAgICBpZiAoY3VyclZvbC0+Y29tcGxleGl0eV9lc3REaXNhYmxlID09IDApCi0gICAgICAgIHsKLSAgICAgICAgICAgIGN1cnJWb2wtPmNvbXBsZXhpdHlfZXN0TWV0aG9kID0gQml0c3RyZWFtUmVhZEJpdHMxNihzdHJlYW0sIDIpOwotCi0gICAgICAgICAgICBpZiAoY3VyclZvbC0+Y29tcGxleGl0eV9lc3RNZXRob2QgPCAyKQotICAgICAgICAgICAgewotICAgICAgICAgICAgICAgIC8qIHNoYXBlX2NvbXBsZXhpdHlfZXN0aW1hdGlvbl9kaXNhYmxlICovCi0gICAgICAgICAgICAgICAgdG1wdmFyID0gQml0c3RyZWFtUmVhZDFCaXRzKHN0cmVhbSk7Ci0gICAgICAgICAgICAgICAgaWYgKHRtcHZhciA9PSAwKQotICAgICAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAgICAgbXA0ZGVjX2xvZygiRGVjb2RlVk9MSGVhZGVyKCk6IFNoYXBlIENvbXBsZXhpdHkgZXN0aW1hdGlvbiBpcyBub3Qgc3VwcG9ydGVkLlxuIik7Ci0gICAgICAgICAgICAgICAgICAgIHJldHVybiBQVl9GQUlMOwotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICAvKiB0ZXh0dXJlX2NvbXBsZXhpdHlfZXN0aW1hdGlvbl9zZXRfMV9kaXNhYmxlICovCi0gICAgICAgICAgICAgICAgdG1wdmFyID0gQml0c3RyZWFtUmVhZDFCaXRzKHN0cmVhbSk7Ci0gICAgICAgICAgICAgICAgaWYgKHRtcHZhciA9PSAwKQotICAgICAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAgICAgY3VyclZvbC0+Y29tcGxleGl0eS50ZXh0XzEgPSBCaXRzdHJlYW1SZWFkQml0czE2KHN0cmVhbSwgNCk7Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgIC8qIG1hcmtlciBiaXQgKi8KLSAgICAgICAgICAgICAgICBpZiAoIUJpdHN0cmVhbVJlYWQxQml0cyhzdHJlYW0pKSByZXR1cm4gUFZfRkFJTDsKLSAgICAgICAgICAgICAgICAvKiB0ZXh0dXJlX2NvbXBsZXhpdHlfZXN0aW1hdGlvbl9zZXRfMl9kaXNhYmxlICovCi0gICAgICAgICAgICAgICAgdG1wdmFyID0gQml0c3RyZWFtUmVhZDFCaXRzKHN0cmVhbSk7Ci0gICAgICAgICAgICAgICAgaWYgKHRtcHZhciA9PSAwKQotICAgICAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAgICAgY3VyclZvbC0+Y29tcGxleGl0eS50ZXh0XzIgPSBCaXRzdHJlYW1SZWFkQml0czE2KHN0cmVhbSwgNCk7Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgIC8qIG1vdGlvbl9jb21wZW5zYXRpb25fY29tcGxleGl0eV9kaXNhYmxlICovCi0gICAgICAgICAgICAgICAgdG1wdmFyID0gQml0c3RyZWFtUmVhZDFCaXRzKHN0cmVhbSk7Ci0gICAgICAgICAgICAgICAgaWYgKHRtcHZhciA9PSAwKQotICAgICAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAgICAgY3VyclZvbC0+Y29tcGxleGl0eS5tYyA9IEJpdHN0cmVhbVJlYWRCaXRzMTYoc3RyZWFtLCA2KTsKLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgLyogbWFya2VyIGJpdCAqLwotICAgICAgICAgICAgICAgIGlmICghQml0c3RyZWFtUmVhZDFCaXRzKHN0cmVhbSkpIHJldHVybiBQVl9GQUlMOwotCi0gICAgICAgICAgICAgICAgaWYgKGN1cnJWb2wtPmNvbXBsZXhpdHlfZXN0TWV0aG9kID09IDEpCi0gICAgICAgICAgICAgICAgeyAgIC8qIHZlcnNpb24yX2NvbXBsZXhpdHlfZXN0aW1hdGlvbl9kaXNhYmxlICovCi0gICAgICAgICAgICAgICAgICAgIHRtcHZhciA9IEJpdHN0cmVhbVJlYWQxQml0cyhzdHJlYW0pOwotICAgICAgICAgICAgICAgICAgICBpZiAodG1wdmFyID09IDApCi0gICAgICAgICAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAgICAgICAgIG1wNGRlY19sb2coIkRlY29kZVZPTEhlYWRlcigpOiBzYWRjdCwgcXVhcnRlciBwZWwgbm90IHN1cHBvcnRlZC5cbiIpOwotICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFBWX0ZBSUw7Ci0gICAgICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICB9Ci0gICAgICAgIH0KLQotICAgICAgICAvKiAgMDMvMTAvOTkgKi8KLSAgICAgICAgLyogcmVzeW5jX21hcmtlcl9kaXNhYmxlICovCi0gICAgICAgIGN1cnJWb2wtPmVycm9yUmVzRGlzYWJsZSA9IChpbnQpIEJpdHN0cmVhbVJlYWQxQml0cyhzdHJlYW0pOwotICAgICAgICAvKiBkYXRhX3BhcnRpdGl0aW9uZWQgICAgKi8KLSAgICAgICAgY3VyclZvbC0+ZGF0YVBhcnRpdGlvbmluZyA9IChpbnQpIEJpdHN0cmVhbVJlYWQxQml0cyhzdHJlYW0pOwotCi0gICAgICAgIHZpZGVvLT52bGNEZWNDb2VmZkludHJhID0gJlZsY0RlY1RDT0VGSW50cmE7Ci0gICAgICAgIHZpZGVvLT52bGNEZWNDb2VmZkludGVyID0gJlZsY0RlY1RDT0VGSW50ZXI7Ci0KLSAgICAgICAgaWYgKGN1cnJWb2wtPmRhdGFQYXJ0aXRpb25pbmcpCi0gICAgICAgIHsKLSAgICAgICAgICAgIGlmIChsYXllcikgcmV0dXJuIFBWX0ZBSUw7ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLyogICovCi0gICAgICAgICAgICAvKiByZXZlcnNpYmxlX3ZsYyAqLwotICAgICAgICAgICAgY3VyclZvbC0+dXNlUmV2ZXJzZVZMQyA9IChpbnQpQml0c3RyZWFtUmVhZDFCaXRzKHN0cmVhbSk7Ci0gICAgICAgICAgICBpZiAoY3VyclZvbC0+dXNlUmV2ZXJzZVZMQykKLSAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICB2aWRlby0+dmxjRGVjQ29lZmZJbnRyYSA9ICZSdmxjRGVjVENPRUZJbnRyYTsKLSAgICAgICAgICAgICAgICB2aWRlby0+dmxjRGVjQ29lZmZJbnRlciA9ICZSdmxjRGVjVENPRUZJbnRlcjsKLSAgICAgICAgICAgIH0KLSAgICAgICAgICAgIGN1cnJWb2wtPmVycm9yUmVzRGlzYWJsZSA9IDA7Ci0gICAgICAgIH0KLSAgICAgICAgZWxzZQotICAgICAgICB7Ci0gICAgICAgICAgICBjdXJyVm9sLT51c2VSZXZlcnNlVkxDID0gMDsKLSAgICAgICAgfQotCi0gICAgICAgIGlmICh2ZXJzaW9uX2lkICE9IDEpCi0gICAgICAgIHsKLSAgICAgICAgICAgIC8qIG5ld3ByZWRfZW5hYmxlICovCi0gICAgICAgICAgICB0bXB2YXIgPSBCaXRzdHJlYW1SZWFkMUJpdHMoc3RyZWFtKTsKLSAgICAgICAgICAgIGlmICh0bXB2YXIpIHJldHVybiBQVl9GQUlMOwotCi0gICAgICAgICAgICAvKiByZWR1Y2VkX3Jlc29sdXRpb25fdm9wICovCi0gICAgICAgICAgICB0bXB2YXIgPSBCaXRzdHJlYW1SZWFkMUJpdHMoc3RyZWFtKTsKLSAgICAgICAgICAgIGlmICh0bXB2YXIpIHJldHVybiBQVl9GQUlMOwotCi0gICAgICAgIH0KLQotICAgICAgICAvKiBJbnRyYSBBQy9EQyBwcmVkaWN0aW9uIGlzIGFsd2F5cyB0cnVlICovCi0gICAgICAgIHZpZGVvLT5pbnRyYV9hY2RjUHJlZERpc2FibGUgPSAwOwotICAgICAgICAvKiBzY2FsYWJpbGl0eSAqLwotICAgICAgICBjdXJyVm9sLT5zY2FsYWJpbGl0eSA9IChpbnQpIEJpdHN0cmVhbVJlYWQxQml0cyhzdHJlYW0pOwotCi0gICAgICAgIGlmIChjdXJyVm9sLT5zY2FsYWJpbGl0eSkKLSAgICAgICAgewotICAgICAgICAgICAgaWYgKGxheWVyID09IDApICByZXR1cm4gUFZfRkFJTDsgICAgICAgICAgICAgICAgICAgICAvKiAgKi8KLSAgICAgICAgICAgIC8qIGhpZXJhcmNoeV90eXBlOiAxIDogdGVtcG9yYWwsIDAgOiBzcGF0aWFsICovCi0gICAgICAgICAgICAvKiAgMDMvMTAvOTkgKi8KLSAgICAgICAgICAgIGN1cnJWb2wtPnNjYWxUeXBlID0gKGludCkgQml0c3RyZWFtUmVhZDFCaXRzKHN0cmVhbSk7ICAgICAgICAgICAgICAvKiAgKi8KLSAgICAgICAgICAgIGlmICghY3VyclZvbC0+c2NhbFR5cGUpIHJldHVybiBQVl9GQUlMOwotCi0gICAgICAgICAgICAvKiByZWZfbGF5ZXJfaWQgKDQgYml0cykgKi8KLSAgICAgICAgICAgIGN1cnJWb2wtPnJlZlZvbElEID0gKGludCkgQml0c3RyZWFtUmVhZEJpdHMxNihzdHJlYW0sIDQpOwotICAgICAgICAgICAgaWYgKGxheWVyKSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8qICAqLwotICAgICAgICAgICAgewotICAgICAgICAgICAgICAgIGlmIChjdXJyVm9sLT5yZWZWb2xJRCAhPSB2aWRlby0+dm9sWzBdLT52b2xJRCkgcmV0dXJuIFBWX0ZBSUw7Ci0gICAgICAgICAgICB9Ci0gICAgICAgICAgICAvKiByZWZfbGF5ZXJfc2FtcGxpbmdfZGlyZWMgKDEgYml0cykgICAgICAgICAgICAgICovCi0gICAgICAgICAgICAvKiAgIDEgOiByZWYuIGxheWVyIGhhcyBoaWdoZXIgcmVzb2x1dGlvbiAgICAgICAgICovCi0gICAgICAgICAgICAvKiAgIDAgOiByZWYuIGxheWVyIGhhcyBlcXVhbCBvciBsb3dlciByZXNvbHV0aW9uICovCi0gICAgICAgICAgICBjdXJyVm9sLT5yZWZTYW1wRGlyID0gKGludCkgQml0c3RyZWFtUmVhZDFCaXRzKHN0cm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fU1RBUlRfQ09ERV9MRU5HVEgsICZ0bXB2YXIpOwotICAgICAgICAgICAgICAgIFBWX0JpdHN0cmVhbUZsdXNoQml0cyhzdHJlYW0sIDgpOwotICAgICAgICAgICAgfQotICAgICAgICAgICAgd2hpbGUgKHRtcHZhciAhPSBWT0xfU1RBUlRfQ09ERSk7Ci0gICAgICAgICAgICBnb3RvIGRlY29kZV92b2w7Ci0gICAgICAgIH0KLSAgICB9Ci0jaWZkZWYgUFZfVE9MRVJBVEVfVk9MX0VSUk9SUwotICAgIGlmIChwcm9maWxlID4gMHhGRiB8fCBwcm9maWxlID09IDApCi0gICAgewotICAgICAgICByZXR1cm4gUFZfQkFEX1ZPTEhFQURFUjsKLSAgICB9Ci0jZW5kaWYKLQotICAgIHJldHVybiBzdGF0dXM7Ci19Ci0KLQotLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqQ29tbWVudEJlZ2luKioqKioqCi0qCi0qIC0tIERlY29kZUdPViAtLSBEZWNvZGVzIHRoZSBHcm91cCBvZiBWT1BzIGZyb20gYml0c3RyZWFtCi0qCi0qICAgMDQvMjAvMjAwMCAgaW5pdGlhbCBtb2RpZmljYXRpb24gdG8gdGhlIG5ldyBQVi1EZWNvZGVyIExpYiBmb3JtYXQuCi0qCi0qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKkNvbW1lbnRFbmQqKioqKioqKi8KLVBWX1NUQVRVUyBEZWNvZGVHT1ZIZWFkZXIoQml0c3RyZWFtRGVjVmlkZW8gKnN0cmVhbSwgdWludDMyICp0aW1lX2Jhc2UpCi17Ci0gICAgdWludDMyIHRtcHZhciwgdGltZV9zOwotICAgIGludCBjbG9zZWRfZ292LCBicm9rZW5fbGluazsKLQotICAgIC8qIGdyb3VwX3N0YXJ0X2NvZGUgKDMyIGJpdHMpICovCi0vLyAgIHRtcHZhciA9IEJpdHN0cmVhbVJlYWR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zdHJlYW1SZWFkMUJpdHMoc3RyZWFtKTsKLQotCi0gICAgaWYgKGN1cnJWb3AtPnZvcENvZGVkID09IDApCi0gICAgewotICAgICAgICBzdGF0dXMgPSBQVl9TVUNDRVNTOwotICAgICAgICBnb3RvIHJldHVybl9wb2ludDsKLSAgICB9Ci0KLQotICAgIC8qIHJlYWQgdm9wX3JvdW5kaW5nX3R5cGUgKi8KLSAgICBpZiAoY3VyclZvcC0+cHJlZGljdGlvblR5cGUgPT0gUF9WT1ApCi0gICAgewotICAgICAgICBjdXJyVm9wLT5yb3VuZGluZ1R5cGUgPSAoaW50KSBCaXRzdHJlYW1SZWFkMUJpdHMoc3RyZWFtKTsKLSAgICB9Ci0gICAgZWxzZQotICAgIHsKLSAgICAgICAgY3VyclZvcC0+cm91bmRpbmdUeXBlID0gMDsKLSAgICB9Ci0KLSAgICBpZiAoY3VyclZvbC0+Y29tcGxleGl0eV9lc3REaXNhYmxlID09IDApCi0gICAgewotICAgICAgICBpZiAoY3VyclZvbC0+Y29tcGxleGl0eV9lc3RNZXRob2QgPCAyKSAgIC8qICAgT0NUIDIwMDIgKi8KLSAgICAgICAgewotICAgICAgICAgICAgaWYgKChjdXJyVm9sLT5jb21wbGV4aXR5LnRleHRfMSA+PiAzKSAmIDB4MSkgICAgLyogaW50cmEgICAgICAgICovCi0gICAgICAgICAgICAgICAgQml0c3RyZWFtUmVhZEJpdHMxNihzdHJlYW0sIDgpOwotICAgICAgICAgICAgaWYgKGN1cnJWb2wtPmNvbXBsZXhpdHkudGV4dF8xICYgMHgxKSAgICAgICAgICAgLyogbm90X2NvZGVkICAgICovCi0gICAgICAgICAgICAgICAgQml0c3RyZWFtUmVhZEJpdHMxNihzdHJlYW0sIDgpOwotICAgICAgICAgICAgaWYgKChjdXJyVm9sLT5jb21wbGV4aXR5LnRleHRfMiA+PiAzKSAmIDB4MSkgICAgLyogZGN0X2NvZWZzICAgICovCi0gICAgICAgICAgICAgICAgQml0c3RyZWFtUmVhZEJpdHMxNihzdHJlYW0sIDgpOwotICAgICAgICAgICAgaWYgKChjdXJyVm9sLT5jb21wbGV4aXR5LnRleHRfMiA+PiAyKSAmIDB4MSkgICAgLyogZGN0X2xpbmVzICAgICovCi0gICAgICAgICAgICAgICAgQml0c3RyZWFtUmVhZEJpdHMxNihzdHJlYW0sIDgpOwotICAgICAgICAgICAgaWYgKChjdXJyVm9sLT5jb21wbGV4aXR5LnRleHRfMiA+PiAxKSAmIDB4MSkgICAgLyogdmxjX3N5bWJvbHMgICovCi0gICAgICAgICAgICAgICAgQml0c3RyZWFtUmVhZEJpdHMxNihzdHJlYW0sIDgpOwotICAgICAgICAgICAgaWYgKGN1cnJWb2wtPmNvbXBsZXhpdHkudGV4dF8yICYgMHgxKSAgICAgICAgICAgLyogdmxjX2JpdHMgICAgICovCi0gICAgICAgICAgICAgICAgQml0c3RyZWFtUmVhZEJpdHMxNihzdHJlYW0sIDQpOwotCi0gICAgICAgICAgICBpZiAoY3VyclZvcC0+cHJlZGljdGlvblR5cGUgIT0gSV9WT1ApCi0gICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgaWYgKChjdXJyVm9sLT5jb21wbGV4aXR5LnRleHRfMSA+PiAyKSAmIDB4MSkgICAgLyogaW50ZXIgICAgKi8KLSAgICAgICAgICAgICAgICAgICAgQml0c3RyZWFtUmVhZEJpdHMxNihzdHJlYW0sIDgpOwotICAgICAgICAgICAgICAgIGlmICgoY3VyclZvbC0+Y29tcGxleGl0eS50ZXh0XzEgPj4gMSkgJiAweDEpICAgIC8qIGludGVyXzR2ICovCi0gICAgICAgICAgICAgICAgICAgIEJpdHN0cmVhbVJlYWRCaXRzMTYoc3RyZWFtLCA4KTsKLSAgICAgICAgICAgICAgICBpZiAoKGN1cnJWb2wtPmNvbXBsZXhpdHkubWMgPj4gNSkgJiAweDEpICAgICAgICAvKiBhcG0gICAgICAqLwotICAgICAgICAgICAgICAgICAgICBCaXRzdHJlYW1SZWFkQml0czE2KHN0cmVhbSwgOCk7Ci0gICAgICAgICAgICAgICAgaWYgKChjdXJyVm9sLT5jb21wbGV4aXR5Lm1jID4+IDQpICYgMHgxKSAgICAgICAgLyogbnBtICAgICAgKi8KLSAgICAgICAgICAgICAgICAgICAgQml0c3RyZWFtUmVhZEJpdHMxNihzdHJlYW0sIDgpOwotICAgICAgICAgICAgICAgIC8qIGludGVycG9sYXRlX21jX3EgKi8KLSAgICAgICAgICAgICAgICBpZiAoKGN1cnJWb2wtPmNvbXBsZXhpdHkubWMgPj4gMikgJiAweDEpICAgICAgICAvKiBmb3J3X2JhY2tfbWNfcSAqLwotICAgICAgICAgICAgICAgICAgICBCaXRzdHJlYW1SZWFkQml0czE2KHN0cmVhbSwgOCk7Ci0gICAgICAgICAgICAgICAgaWYgKChjdXJyVm9sLT5jb21wbGV4aXR5Lm1jID4+IDEpICYgMHgxKSAgICAgICAgLyogaGFsZnBlbDIgKi8KLSAgICAgICAgICAgICAgICAgICAgQml0c3RyZWFtUmVhZEJpdHMxNihzdHJlYW0sIDgpOwotICAgICAgICAgICAgICAgIGlmIChjdXJyVm9sLT5jb21wbGV4aXR5Lm1jICYgMHgxKSAgICAgICAgICAgICAgIC8qIGhhbGZwZWw0ICovCi0gICAgICAgICAgICAgICAgICAgIEJpdHN0cmVhbVJlYWRCaXRzMTYoc3RyZWFtLCA4KTsKLSAgICAgICAgICAgIH0KLSAgICAgICAgICAgIGlmIChjdXJyVm9wLT5wcmVkaWN0aW9uVHlwZSA9PSBCX1ZPUCkKLSAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICBpZiAoKGN1cnJWb2wtPmNvbXBsZXhpdHkubWMgPj4gMykgJiAweDEpICAgICAgICAvKiBpbnRlcnBvbGF0ZV9tY19xICovCi0gICAgICAgICAgICAgICAgICAgIEJpdHN0cmVhbVJlYWRCaXRzMTYoc3RyZWFtLCA4KTsKLSAgICAgICAgICAgIH0KLSAgICAgICAgfQotICAgIH0KLQotICAgIC8qIHJlYWQgaW50cmFfZGNfdmxjX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cHJlZGljdGlvblR5cGUgPT0gQl9WT1ApCi0gICAgewotICAgICAgICB0bXB2YXIgPSAodWludDMyKSBCaXRzdHJlYW1SZWFkQml0czE2KHN0cmVhbSwgMyk7Ci0gICAgICAgIGlmICh0bXB2YXIgPCAxKQotICAgICAgICB7Ci0gICAgICAgICAgICBjdXJyVm9wLT5mY29kZUJhY2t3YXJkID0gMTsKLSAgICAgICAgICAgIHN0YXR1cyA9IFBWX0ZBSUw7Ci0gICAgICAgICAgICBnb3RvIHJldHVybl9wb2ludDsKLSAgICAgICAgfQotICAgICAgICBjdXJyVm9wLT5mY29kZUJhY2t3YXJkID0gdG1wdmFyOwotICAgIH0KLSAgICBlbHNlCi0gICAgewotICAgICAgICBjdXJyVm9wLT5mY29kZUJhY2t3YXJkID0gMDsKLSAgICB9Ci0KLSAgICBpZiAoY3VyclZvbC0+c2NhbGFiaWxpdHkpCi0gICAgewotICAgICAgICBjdXJyVm9wLT5yZWZTZWxlY3RDb2RlID0gKGludCkgQml0c3RyZWFtUmVhZEJpdHMxNihzdHJlYW0sIDIpOwotICAgIH0KLQotcmV0dXJuX3BvaW50OgotICAgIHJldHVybiBzdGF0dXM7Ci19Ci0KLQotLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqQ29tbWVudEJlZ2luKioqKioqCi0qCi0qIC0tIFZpZGVvUGxhbmVXaXRoU2hvcnRIZWFkZXIgLS0gRGVjb2RlcyB0aGUgc2hvcnRfdmlkZW9faGVhZGVyIGluZm9ybWF0aW9uIGZyb20gdGhlIGJpdHN0cmVhbQotKiBNb2RpZmllZCA6Ci0gICAgICAgICAgICAgMDQvMjMvMjAwMS4gIFJlbW92ZSB0aGUgY29kZXMgcmVsYXRlZCB0byB0aGUKLSAgICAgICAgICAgICAgICAgImZpcnN0IHBhc3MiIGRlY29kaW5nLiAgV2UgdXNlIGEgZGlmZmVyZW50IGZ1bmN0aW9uCi0gICAgICAgICAgICAgICAg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ICAgICAgICAgICAgIHN0YXR1cyA9IFBWX0ZBSUw7Ci0gICAgICAgICAgICAgICAgZ290byByZXR1cm5fcG9pbnQ7Ci0gICAgICAgICAgICB9Ci0gICAgICAgICAgICB2aWRlby0+ZGlzcGxheVdpZHRoID0gdmlkZW8tPndpZHRoICA9IDE3NjsKLSAgICAgICAgICAgIHZpZGVvLT5kaXNwbGF5SGVpZ2h0ID0gdmlkZW8tPmhlaWdodCAgPSAxNDQ7Ci0gICAgICAgICAgICBicmVhazsKLQotICAgICAgICBjYXNlIDM6Ci0gICAgICAgICAgICBpZiAodmlkZW8tPnNpemUgPCAzNTIqMjg4KQotICAgICAgICAgICAgewotICAgICAgICAgICAgICAgIHN0YXR1cyA9IFBWX0ZBSUw7Ci0gICAgICAgICAgICAgICAgZ290byByZXR1cm5fcG9pbnQ7Ci0gICAgICAgICAgICB9Ci0gICAgICAgICAgICB2aWRlby0+ZGlzcGxheVdpZHRoID0gdmlkZW8tPndpZHRoID0gMzUyOwotICAgICAgICAgICAgdmlkZW8tPmRpc3BsYXlIZWlnaHQgPSB2aWRlby0+aGVpZ2h0ID0gMjg4OwotICAgICAgICAgICAgYnJlYWs7Ci0KLSAgICAgICAgY2FzZSA0OgotICAgICAgICAgICAgaWYgKHZpZGVvLT5zaXplIDwgNzA0KjU3NikKLSAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICBzdGF0dXMgPSBQVl9GQUlMOwotICAgICAgICAgICAgICAgIGdvdG8gcmV0dXJuX3BvaW50OwotICAgICAgICAgICAgfQotICAgICAgICAgICAgdmlkZW8tPmRpc3BsYXlXaWR0aCA9IHZpZGVvLT53aWR0aCA9IDcwNDsKLSAgICAgICAgICAgIHZpZGVvLT5kaXNwbGF5SGVpZ2h0ID0gdmlkZW8tPmhlaWdodCA9IDU3NjsKLSAgICAgICAgICAgIGJyZWFrOwotCi0gICAgICAgIGNhc2UgNToKLSAgICAgICAgICAgIGlmICh2aWRlby0+c2l6ZSA8IDE0MDgqMTE1MikKLSAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICBzdGF0dXMgPSBQVl9GQUlMOwotICAgICAgICAgICAgICAgIGdvdG8gcmV0dXJuX3BvaW50OwotICAgICAgICAgICAgfQotICAgICAgICAgICAgdmlkZW8tPmRpc3BsYXlXaWR0aCA9IHZpZGVvLT53aWR0aCA9IDE0MDg7Ci0gICAgICAgICAgICB2aWRlby0+ZGlzcGxheUhlaWdodCA9IHZpZGVvLT5oZWlnaHQgPSAxMTUyOwotICAgICAgICAgICAgYnJlYWs7Ci0KLSAgICAgICAgY2FzZSA3OgotICAgICAgICAgICAgZXh0ZW5kZWRfUFRZUEUgPSBUUlVFOwotICAgICAgICAgICAgYnJlYWs7Ci0KLSAgICAgICAgZGVmYXVsdDoKLSAgICAgICAgICAgIC8qIE1zZygiSC4yNjMgc291cmNlIGZvcm1hdCBub3QgbGVnYWxcbiIpOyAqLwotICAgICAgICAgICAgc3RhdHVzID0gUFZfRkFJTDsKLSAgICAgICAgICAgIGdvdG8gcmV0dXJuX3BvaW50OwotICAgIH0KLQotCi0gICAgY3VyclZvcC0+cm91bmRpbmdUeXBlID0gMDsKLQotICAgIGlmIChleHRlbmRlZF9QVFlQRSA9PSBGQUxTRSkKLSAgICB7Ci0gICAgICAgIGN1cnJWb3AtPnByZWRpY3Rpb25UeXBlID0gKGludCkgQml0c3RyZWFtUmVhZDFCaXRzKHN0cmVhbSk7Ci0KLSAgICAgICAgLyogZm91cl9yZXNlcnZlZF96ZXJvX2JpdHMgKi8KLSAgICAgICAgaWYgKEJpdHN0cmVhbVJlYWRCaXRzMTYoc3RyZWFtLCA0KSkKLSAgICAgICAgewotICAgICAgICAgICAgbXA0ZGVjX2xvZygiRGVjb2RlU2hvcnRIZWFkZXIoKTogUmVzZXJ2ZWQgYml0cyB3cm9uZy5cbiIpOwotICAgICAgICAgICAgc3RhdHVzID0gUFZfRkFJTDsKLSAgICAgICAgICAgIGdvdG8gcmV0dXJuX3BvaW50OwotICAgICAgICB9Ci0gICAgfQotICAgIGVsc2UKLSAgICB7Ci0gICAgICAgIFVGRVAgPSBCaXRzdHJlYW1SZWFkQml0czE2KHN0cmVhbSwgMyk7Ci0gICAgICAgIGlmIChVRkVQID09IDEpCi0gICAgICAgIHsKLSAgICAgICAgICAgIC8qIHNvdXJjZSBmb3JtYXQgKi8KLSAgICAgICAgICAgIHN3aXRjaCAoQml0c3RyZWFtUmVhZEJpdHMxNihzdHJlYW0sIDMpKQotICAgICAgICAgICAgewotICAgICAgICAgICAgICAgIGNhc2UgMToKLSAgICAgICAgICAgICAgICAgICAgaWYgKHZpZGVvLT5zaXplIDwgMTI4Kjk2KQotICAgICAgICAgICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgICAgICAgICBzdGF0dXMgPSBQVl9GQUlMOwotICAgICAgICAgICAgICAgICAgICAgICAgZ290byByZXR1cm5fcG9pbnQ7Ci0gICAgICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICAgICAgdmlkZW8tPmRpc3BsYXlXaWR0aCA9IHZpZGVvLT53aWR0aCA9ICAxMjg7Ci0gICAgICAgICAgICAgICAgICAgIHZpZGVvLT5kaXNwbGF5SGVpZ2h0ID0gdmlkZW8tPmhlaWdodCAgPSA5NjsKLSAgICAgICAgICAgICAgICAgICAgYnJlYWs7Ci0KLSAgICAgICAgICAgICAgICBjYXNlIDI6Ci0gICAgICAgICAgICAgICAgICAgIGlmICh2aWRlby0+c2l6ZSA8IDE3NioxNDQpCi0gICAgICAgICAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAgICAgICAgIHN0YXR1cyA9IFBWX0ZBSUw7Ci0gICAgICAgICAgICAgICAgICAgICAgICBnb3RvIHJldHVybl9wb2ludDsKLSAgICAgICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgICAgICB2aWRlby0+ZGlzcGxheVdpZHRoID0gdmlkZW8tPndpZHRoICA9IDE3NjsKLSAgICAgICAgICAgICAgICAgICAgdmlkZW8tPmRpc3BsYXlIZWlnaHQgPSB2aWRlby0+aGVpZ2h0ICA9IDE0NDsKLSAgICAgICAgICAgICAgICAgICAgYnJlYWs7Ci0KLSAgICAgICAgICAgICAgICBjYXNlIDM6Ci0gICAgICAgICAgICAgICAgICAgIGlmICh2aWRlby0+c2l6ZSA8IDM1MioyODgpCi0gICAgICAgICAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAgICAgICAgIHN0YXR1cyA9IFBWX0ZBSUw7Ci0gICAgICAgICAgICAgICAgICAgICAgICBnb3RvIHJldHVybl9wb2ludDsKLSAgICAgICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgICAgICB2aWRlby0+ZGlzcGxheVdpZHRoID0gdmlkZW8tPndpZHRoID0gMzUyOwotICAgICAgICAgICAgICAgICAgICB2aWRlby0+ZGlzcGxheUhlaWdodCA9IHZpZGVvLT5oZWlnaHQgPSAyODg7Ci0gICAgICAgICAgICAgICAgICAgIGJyZWFrOwotCi0gICAgICAgICAgICAgICAgY2FzZSA0OgotICAgICAgICAgICAgICAgICAgICBpZiAodmlkZW8tPnNpemUgPCA3MDQqNTc2KQotICAgICAgICAgICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgICAgICAgICBzdGF0dXMgPSBQVl9GQUlMOwotICAgICAgICAgICAgICAgICAgICAgICAgZ290byByZXR1cm5fcG9pbnQ7Ci0gICAgICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICAgICAgdmlkZW8tPmRpc3BsYXlXaWR0aCA9IHZpZGVvLT53aWR0aCA9IDcwNDsKLSAgICAgICAgICAgICAgICAgICAgdmlkZW8tPmRpc3BsYXlIZWlnaHQgPSB2aWRlby0+aGVpZ2h0ID0gNTc2OwotICAgICAgICAgICAgICAgICAgICBicmVhazsKLQotICAgICAgICAgICAgICAgIGNhc2UgNToKLSAgICAgICAgICAgICAgICAgICAgaWYgKHZpZGVvLT5zaXplIDwgMTQwOCoxMTUyKQotICAgICAgICAgICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgICAgICAgICBzdGF0dXMgPSBQVl9GQUlMOwotICAgICAgICAgICAgICAgICAgICAgICAgZ290byByZXR1cm5fcG9pbnQ7Ci0gICAgICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICAgICAgdmlkZW8tPmRpc3BsYXlXaWR0aCA9IHZpZGVvLT53aWR0aCA9IDE0MDg7Ci0gICAgICAgICAgICAgICAgICAgIHZpZGVvLT5kaXNwbGF5SGVpZ2h0ID0gdmlkZW8tPmhlaWdodCA9IDExNTI7Ci0gICAgICAgICAgICAgICAgICAgIGJyZWFrOwotCi0gICAgICAgICAgICAgICAgY2FzZSA2OgotICAgICAgICAgICAgICAgICAgICBjdXN0b21fUEZNVCA9IFRSVUU7Ci0gICAgICAgICAgICAgICAgICAgIGJyZWFrOwotCi0gICAgICAgICAgICAgICAgZGVmYXVsdDoKLSAgICAgICAgICAgICAgICAgICAgLyogTXNnKCJILjI2MyBzb3VyY2UgZm9ybWF0IG5vdCBsZWdhbFxuIik7ICovCi0gICAgICAgICAgICAgICAgICAgIHN0YXR1cyA9IFBWX0ZBSUw7Ci0gICAgICAgICAgICAgICAgICAgIGdvdG8gcmV0dXJuX3BvaW50OwotICAgICAgICAgICAgfQotCi0gICAgICAgICAgICBjdXN0b21fUENGID0gQml0c3RyZWFtUmVhZDFCaXRzKHN0cmVhbSk7Ci0gICAgICAgICAgICAvKiB1bnJlc3RyaWN0ZWQgTVYgKi8KLSAgICAgICAgICAgIGlmIChCaXRzdHJlYW1SZWFkMUJpdHMoc3RyZWFtKSkKLSAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICBzdGF0dXMgPSBQVl9GQUlMOwotICAgICAgICAgICAgICAgIGdvdG8gcmV0dXJuX3BvaW50OwotICAgICAgICAgICAgfQotICAgICAgICAgICAgLyogU0FDICovCi0gICAgICAgICAgICBpZiAoQml0c3RyZWFtUmVhZDFCaXRzKHN0cmVhbSkpCi0gICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgc3RhdHVzID0gUFZfRkFJTDsKLSAgICAgICAgICAgICAgICBnb3RvIHJldHVybl9wb2ludDsKLSAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgLyogQVAgKi8KLSAgICAgICAgICAgIGlmIChCaXRzdHJlYW1SZWFkMUJpdHMoc3RyZWFtKSkKLSAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICBzdGF0dXMgPSBQVl9GQUlMOwotICAgICAgICAgICAgICAgIGdvdG8gcmV0dXJuX3BvaW50OwotICAgICAgICAgICAgfQotCi0gICAgICAgICAgICB2aWRlby0+YWR2YW5jZWRfSU5UUkEgPSBCaXRzdHJlYW1SZWFkMUJpdHMoc3RyZWFtKTsKLQotICAgICAgICAgICAgdmlkZW8tPmRlYmxvY2tpbmcgPSBCaXRzdHJlYW1SZWFkMUJpdHMoc3RyZWFtKTsKLQotICAgICAgICAgICAgdmlkZW8tPnNsaWNlX3N0cnVjdHVyZSA9IEJpdHN0cmVhbVJlYWQxQml0cyhzdHJlYW0pOwotCi0gICAgICAgICAgICAvKiBSUFMsIElTRCwgQUlWICovCi0gICAgICAgICAgICBpZiAoQml0c3RyZWFtUmVhZEJpdHMxNihzdHJlYW0sIDMpKQotICAgICAgICAgICAgewotICAgICAgICAgICAgICAgIHN0YXR1cyA9IFBWX0ZBSUw7Ci0gICAgICAgICAgICAgICAgZ290byByZXR1cm5fcG9pbnQ7Ci0gICAgICAgICAgICB9Ci0gICAgICAgICAgICB2aWRlby0+bW9kaWZpZWRfcXVhbnQgPSBCaXRzdHJlYW1SZWFkMUJpdHMoc3RyZWFtKTsKLQotICAgICAgICAgICAgLyogTWFya2VyIEJpdCBhbmQgcmVzZXJ2ZWQqLwotICAgICAgICAgICAgaWYgKEJpdHN0cmVhbVJlYWRCaXRzMTYoc3RyZWFtLCA0KSAhPSA4KQotICAgICAgICAgICAgewotICAgICAgICAgICAgICAgIHN0YXR1cyA9IFBWX0ZBSUw7Ci0gICAgICAgICAgICAgICAgZ290byByZXR1cm5fcG9pbnQ7Ci0gICAgICAgICAgICB9Ci0gICAgICAgIH0KLSNpZm5kZWYgUFZfQU5ORVhfSUpLVF9TVVBQT1JUCi0gICAgICAgIGlmICh2aWRlby0+YWR2YW5jZWRfSU5UUkEgfCB2aWRlby0+ZGVibG9ja2luZyB8IHZpZGVvLT5tb2RpZmllZF9xdWFudCB8IHZpZGVvLT5tb2RpZmllZF9xdWFudCkKLSAgICAgICAgewotICAgICAgICAgICAgc3RhdHVzID0gUFZfRkFJTDsKLSAgICAgICAgICAgIGdvdG8gcmV0dXJuX3BvaW50OwotICAgICAgICB9Ci0jZW5kaWYKLQotICAgICAgICBpZiAoVUZFUCA9PSAwIHx8IFVGRVAgPT0gMSkKLSAgICAgICAgewotICAgICAgICAgICAgdG1wdmFyID0gQml0c3RyZWFtUmVhZEJpdHMxNihzdHJlYW0sIDMpOwotICAgICAgICAgICAgaWYgKHRtcHZhciA+IDEpCi0gICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgc3RhdHVzID0gUFZfRkFJTDsKLSAgICAgICAgICAgICAgICBnb3RvIHJldHVybl9wb2ludDsKLSAgICAgICAgICAgIH0KLSAgICAgICAgICAgIGN1cnJWb3AtPnByZWRpY3Rpb25UeXBlID0gdG1wdmFyOwotICAgICAgICAgICAgLyogUlBSICovCi0gICAgICAgICAgICBpZiAoQml0c3RyZWFtUmVhZDFCaXRzKHN0cmVhbSkpCi0gICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgc3RhdHVzID0gUFZfRkFJTDsKLSAgICAgICAgICAgICAgICBnb3RvIHJldHVybl9wb2ludDsKLSAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgLyogUlJVICovCi0gICAgICAgICAgICBpZiAoQml0c3RyZWFtUmVhZDFCaXRzKHN0cmVhbSkpCi0gICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgc3RhdHVzID0gUFZfRkFJTDsKLSAgICAgICAgICAgICAgICBnb3RvIHJldHVybl9wb2ludDsKLSAgICAgICAgICAgIH0KLSAgICAgICAgICAgIGN1cnJWb3AtPnJvdW5kaW5nVHlwZSA9IChpbnQpIEJpdHN0cmVhbVJlYWQxQml0cyhzdHJlYW0pOwotICAgICAgICAgICAgaWYgKEJpdHN0cmVhbVJlYWRCaXRzMTYoc3RyZWFtLCAzKSAhPSAxKQotICAgICAgICAgICAgewotICAgICAgICAgICAgICAgIHN0YXR1cyA9IFBWX0ZBSUw7Ci0gICAgICAgICAgICAgICAgZ290byByZXR1cm5fcG9pbnQ7Ci0gICAgICAgICAgICB9Ci0gICAgICAgIH0KLSAgICAgICAgZWxzZQotICAgICAgICB7Ci0gICAgICAgICAgICBzdGF0dXMgPSBQVl9GQUlMOwotICAgICAgICAgICAgZ290byByZXR1cm5fcG9pbnQ7Ci0gICAgICAgIH0KLSAgICAgICAgLyogQ1BNICovCi0gICAgICAgIGlmIChCaXRzdHJlYW1SZWFkMUJpdHMoc3RyZWFtKSkKLSAgICAgICAgewotICAgICAgICAgICAgc3RhdHVzID0gUFZfRkFJTDsKLSAgICAgICAgICAgIGdvdG8gcmV0dXJuX3BvaW50OwotICAgICAgICB9Ci0gICAgICAgIC8qIENQRk1UICovCi0gICAgICAgIGlmIChjdXN0b21fUEZNVCA9PSAxICYmIFVGRVAgPT0gMSkKLSAgICAgICAgewotICAgICAgICAgICAgLyogYXNwZWN0IHJhdGlvICovCi0gICAgICAgICAgICB0bXB2YXIgPSBCaXRzdHJlYW1SZWFkQml0czE2KHN0cmVhbSwgNCk7Ci0gICAgICAgICAgICBpZiAodG1wdmFyID09IDApCi0gICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgc3RhdHVzID0gUFZfRkFJTDsKLSAgICAgICAgICAgICAgICBnb3RvIHJldHVybl9wb2ludDsKLSAgICAgICAgICAgIH0KLSAgICAgICAgICAgIC8qIEV4dGVuZGVkIFBBUiAqLwotICAgICAgICAgICAgaWYgKHRtcHZhciA9PSAweEYpCi0gICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgLyogUmVhZCBwYXJfd2lkdGggYW5kIHBhcl9oZWlnaHQgYnV0IGRvIG5vdGhpbmcgKi8KLSAgICAgICAgICAgICAgICAvKiBwYXJfd2lkdGggKi8KLSAgICAgICAgICAgICAgICB0bXB2YXIgPSBCaXRzdHJlYW1SZWFkQml0czE2KHN0cmVhbSwgOCk7Ci0KLSAgICAgICAgICAgICAgICAvKiBwYXJfaGVpZ2h0ICovCi0gICAgICAgICAgICAgICAgdG1wdmFyID0gQml0c3RyZWFtUmVhZEJpdHMxNihzdHJlYW0sIDgpOwotICAgICAgICAgICAgfQotICAgICAgICAgICAgdG1wdmFyID0gQml0c3RyZWFtUmVhZEJpdHMxNihzdHJlYW0sIDkpOwotCi0gICAgICAgICAgICB2aWRlby0+ZGlzcGxheVdpZHRoID0gKHRtcHZhciArIDEpIDw8IDI7Ci0gICAgICAgICAgICB2aWRlby0+d2lkdGggPSAodmlkZW8tPmRpc3BsYXlXaWR0aCArIDE1KSAmIC0xNjsKLSAgICAgICAgICAgIC8qIG1hcmtlciBiaXQgKi8KLSAgICAgICAgICAgIGlmICghQml0c3RyZWFtUmVhZDFCaXRzKHN0cmVhbSkpCi0gICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgc3RhdHVzID0gUFZfRkFJTDsKLSAgICAgICAgICAgICAgICBnb3RvIHJldHVybl9wb2ludDsKLSAgICAgICAgICAgIH0KLSAgICAgICAgICAgIHRtcHZhciA9IEJpdHN0cmVhbVJlYWRCaXRzMTYoc3RyZWFtLCA5KTsKLSAgICAgICAgICAgIGlmICh0bXB2YXIgPT0gMCkKLSAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICBzdGF0dXMgPSBQVl9GQUlMOwotICAgICAgICAgICAgICAgIGdvdG8gcmV0dXJuX3BvaW50OwotICAgICAgICAgICAgfQotICAgICAgICAgICAgdmlkZW8tPmRpc3BsYXlIZWlnaHQgPSB0bXB2YXIgPDwgMjsKLSAgICAgICAgICAgIHZpZGVvLT5oZWlnaHQgPSAodmlkZW8tPmRpc3BsYXlIZWlnaHQgKyAxNSkgJiAtMTY7Ci0KLSAgICAgICAgICAgIGlmICh2aWRlby0+aGVpZ2h0ICogdmlkZW8tPndpZHRoID4gdmlkZW8tPnNpemUpCi0gICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgc3RhdHVzID0gUFZfRkFJTDsKLSAgICAgICAgICAgICAgICBnb3RvIHJldHVybl9wb2ludDsKLSAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgdmlkZW8tPm5Ub3RhbE1CID0gdmlkZW8tPndpZHRoIC8gTUJfU0laRSAqIHZpZGVvLT5oZWlnaHQgLyBNQl9TSVpFOwotCi0gICAgICAgICAgICBpZiAodmlkZW8tPm5Ub3RhbE1CIDw9IDQ4KQotICAgICAgICAgICAgewotICAgICAgICAgICAgICAgIHZpZGVvLT5uQml0c0Zvck1CSUQgPSA2OwotICAgICAgICAgICAgfQotICAgICAgICAgICAgZWxzZSBpZiAodmlkZW8tPm5Ub3RhbE1CIDw9IDk5KQotICAgICAgICAgICAgewotICAgICAgICAgICAgICAgIHZpZGVvLT5uQml0c0Zvck1CSUQgPSA3OwotICAgICAgICAgICAgfQotICAgICAgICAgICAgZWxzZSBpZiAodmlkZW8tPm5Ub3RhbE1CIDw9IDM5NikKLSAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICB2aWRlby0+bkJpdHNGb3JNQklEID0gOTsKLSAgICAgICAgICAgIH0KLSAgICAgICAgICAgIGVsc2UgaWYgKHZpZGVvLT5uVG90YWxNQiA8PSAxNTg0KQotICAgICAgICAgICAgewotICAgICAgICAgICAgICAgIHZpZGVvLT5uQml0c0Zvck1CSUQgPSAxMTsKLSAgICAgICAgICAgIH0KLSAgICAgICAgICAgIGVsc2UgaWYgKHZpZGVvLT5uVG90YWxNQiA8PSA2MzM2KQotICAgICAgICAgICAgewotICAgICAgICAgICAgICAgIHZpZGVvLT5uQml0c0Zvck1CSUQgPSAxMyA7Ci0gICAgICAgICAgICB9Ci0gICAgICAgICAgICBlbHNlIGlmICh2aWRlby0+blRvdGFsTUIgPD0gOTIxNikKLSAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICB2aWRlby0+bkJpdHNGb3JNQklEID0gMTQgOwotICAgICAgICAgICAgfQotICAgICAgICAgICAgZWxzZQotICAgICAgICAgICAgewotICAgICAgICAgICAgICAgIHN0YXR1cyA9IFBWX0ZBSUw7Ci0gICAgICAgICAgICAgICAgZ290byByZXR1cm5fcG9pbnQ7Ci0gICAgICAgICAgICB9Ci0gICAgICAgIH0KLSAgICAgICAgaWYgKFVGRVAgPT0gMSAmJiBjdXN0b21fUENGID09IDEpCi0gICAgICAgIHsKLSAgICAgICAgICAgIEJpdHN0cmVhbVJlYWQxQml0cyhzdHJlYW0pOwotCi0gICAgICAgICAgICB0bXB2YXIgPSBCaXRzdHJlYW1SZWFkQml0czE2KHN0cmVhbSwgNyk7Ci0gICAgICAgICAgICBpZiAodG1wdmFyID09IDApCi0gICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgc3RhdHVzID0gUFZfRkFJTDsKLSAgICAgICAgICAgICAgICBnb3RvIHJldHVybl9wb2ludDsKLSAgICAgICAgICAgIH0KLSAgICAgICAgfQotCi0gICAgICAgIGlmIChjdXN0b21fUENGID09IDEpCi0gICAgICAgIHsKLSAgICAgICAgICAgIGN1cnJWb3AtPkVUUiA9IEJpdHN0cmVhbVJlYWRCaXRzMTYoc3RyZWFtLCAyKTsKLSAgICAgICAgfQotCi0gICAgICAgIGlmIChVRkVQID09IDEgJiYgdmlkZW8tPnNsaWNlX3N0cnVjdHVyZSA9PSAxKQotICAgICAgICB7Ci0gICAgICAgICAgICAvKiBTU1MgKi8KLSAgICAgICAgICAgIHRtcHZhciA9IEJpdHN0cmVhbVJlYWRCaXRzMTYoc3RyZWFtLCAyKTsKLSAgICAgICAgICAgIGlmICh0bXB2YXIgIT0gMCkKLSAgICAgICAgICAgIHsKLSAgICAgICA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aWRlby0+Y3VyclZvcC0+dUNoYW4gPSB2aWRlby0+Y3VyclZvcC0+eUNoYW4gKyBzaXplOwotICAgIHZpZGVvLT5jdXJyVm9wLT52Q2hhbiA9IHZpZGVvLT5jdXJyVm9wLT51Q2hhbiArIChzaXplID4+IDIpOwotICAgIHZpZGVvLT5wcmV2Vm9wLT51Q2hhbiA9IHZpZGVvLT5wcmV2Vm9wLT55Q2hhbiArIHNpemU7Ci0gICAgdmlkZW8tPnByZXZWb3AtPnZDaGFuID0gdmlkZW8tPnByZXZWb3AtPnVDaGFuICsgKHNpemUgPj4gMik7Ci0KLQotICAgIGN1cnJWb3AtPnF1YW50aXplciA9IChpbnQxNikgQml0c3RyZWFtUmVhZEJpdHMxNihzdHJlYW0sIDUpOwotCi0gICAgaWYgKGN1cnJWb3AtPnF1YW50aXplciA9PSAwKSAgICAgICAgICAgICAgICAgICAgICAgICAgLyogIDA0LzAzLzAxICovCi0gICAgewotICAgICAgICBjdXJyVm9wLT5xdWFudGl6ZXIgPSB2aWRlby0+cHJldlZvcC0+cXVhbnRpemVyOwotICAgICAgICBzdGF0dXMgPSBQVl9GQUlMOwotICAgICAgICBnb3RvIHJldHVybl9wb2ludDsKLSAgICB9Ci0KLQotICAgIC8qIFplcm8gYml0ICovCi0gICAgaWYgKGV4dGVuZGVkX1BUWVBFID09IEZBTFNFKQotICAgIHsKLSAgICAgICAgaWYgKEJpdHN0cmVhbVJlYWQxQml0cyhzdHJlYW0pKQotICAgICAgICB7Ci0gICAgICAgICAgICBtcDRkZWNfbG9nKCJEZWNvZGVTaG9ydEhlYWRlcigpOiBaZXJvIGJpdCB3cm9uZy5cbiIpOwotICAgICAgICAgICAgc3RhdHVzID0gUFZfRkFJTDsKLSAgICAgICAgICAgIGdvdG8gcmV0dXJuX3BvaW50OwotICAgICAgICB9Ci0gICAgfQotICAgIC8qIHBlaSAqLwotICAgIHRtcHZhciA9ICh1aW50MzIpIEJpdHN0cmVhbVJlYWQxQml0cyhzdHJlYW0pOwotCi0gICAgd2hpbGUgKHRtcHZhcikKLSAgICB7Ci0gICAgICAgIHRtcHZhciA9ICh1aW50MzIpIEJpdHN0cmVhbVJlYWRCaXRzMTYoc3RyZWFtLCA4KTsgLyogIlBTUEFSRSIgKi8KLSAgICAgICAgdG1wdmFyID0gKHVpbnQzMikgQml0c3RyZWFtUmVhZDFCaXRzKHN0cmVhbSk7IC8qICJQRUkiICovCi0gICAgfQotCi0gICAgaWYgKHZpZGVvLT5zbGljZV9zdHJ1Y3R1cmUpICAvKiBBTk5FWF9LICovCi0gICAgewotICAgICAgICBpZiAoIUJpdHN0cmVhbVJlYWQxQml0cyhzdHJlYW0pKSAgLyogU0VQQjEgKi8KLSAgICAgICAgewotICAgICAgICAgICAgc3RhdHVzID0gUFZfRkFJTDsKLSAgICAgICAgICAgIGdvdG8gcmV0dXJuX3BvaW50OwotICAgICAgICB9Ci0KLSAgICAgICAgLy8gIGlmIChjdXJyVm9sLT5uQml0c0Zvck1CSUQgLy8KLSAgICAgICAgaWYgKEJpdHN0cmVhbVJlYWRCaXRzMTYoc3RyZWFtLCB2aWRlby0+bkJpdHNGb3JNQklEKSkKLSAgICAgICAgewotICAgICAgICAgICAgc3RhdHVzID0gUFZfRkFJTDsgICAgICAgICAgICAgLyogbm8gQVNPLCBSUyBzdXBwb3J0IGZvciBBbm5leCBLICovCi0gICAgICAgICAgICBnb3RvIHJldHVybl9wb2ludDsKLSAgICAgICAgfQotCi0gICAgICAgIGlmICghQml0c3RyZWFtUmVhZDFCaXRzKHN0cmVhbSkpICAvKlNFUEIzICovCi0gICAgICAgIHsKLSAgICAgICAgICAgIHN0YXR1cyA9IFBWX0ZBSUw7Ci0gICAgICAgICAgICBnb3RvIHJldHVybl9wb2ludDsKLSAgICAgICAgfQotCi0gICAgfQotICAgIC8qIFNldHRpbmcgb2Ygb3RoZXIgVk9QLWhlYWRlciBwYXJhbWV0ZXJzICovCi0gICAgY3VyclZvcC0+Z29iTnVtYmVyID0gMDsKLSAgIC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GhlIHNhbSBwYXRoIG5vdy4KLSoKLSogICAwNS8wNC8yMDAwCi0qICAgICAgICAgICAgICAgICAgIEFkZGVkIHRlbXBvcmFsIHNjYWxhYmlsaXR5IHRvIHRoZSBkZWNvZGVyLgotKgotKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKipDb21tZW50RW5kKioqKioqKiovCi1QVl9TVEFUVVMgUFZfRGVjb2RlVm9wKFZpZGVvRGVjRGF0YSAqdmlkZW8pCi17Ci0gICAgVm9sICpjdXJyVm9sID0gdmlkZW8tPnZvbFt2aWRlby0+Y3VyckxheWVyXTsKLSAgICBQVl9TVEFUVVMgc3RhdHVzOwotICAgIHVpbnQzMiB0bXB2YXI7Ci0KLSAgICAvKioqKioKLSAgICAqICAgRG8gc2NhbGFibGUgb3Igbm9uLXNjYWxhYmxlIGRlY29kaW5nIG9mIHRoZSBjdXJyZW50IFZPUAotICAgICoqKioqLwotCi0gICAgaWYgKCFjdXJyVm9sLT5zY2FsYWJpbGl0eSkKLSAgICB7Ci0gICAgICAgIGlmIChjdXJyVm9sLT5kYXRhUGFydGl0aW9uaW5nKQotICAgICAgICB7Ci0gICAgICAgICAgICAvKiBEYXRhIHBhcnRpdGlvbmluZyBtb2RlIGNvbWVzIGhlcmUgKi8KLSAgICAgICAgICAgIHN0YXR1cyA9IERlY29kZUZyYW1lRGF0YVBhcnRNb2RlKHZpZGVvKTsKLSAgICAgICAgfQotICAgICAgICBlbHNlCi0gICAgICAgIHsKLSAgICAgICAgICAgIC8qIENvbWJpbmVkIG1vZGUgd2l0aCBvciB3aXRob3V0IGVycm9yIHJlc2lsaWVuY2UgKi8KLSAgICAgICAgICAgIC8qICAgIGFuZCBzaG9ydCB2aWRlbyBoZWFkZXIgY29tZXMgaGVyZS4gICAgICAgICAgKi8KLSAgICAgICAgICAgIHN0YXR1cyA9IERlY29kZUZyYW1lQ29tYmluZWRNb2RlKHZpZGVvKTsKLSAgICAgICAgf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ICBNUDRFbmNvZGluZ01vZGUgbW9kZSwKLSAgICAgICAgaW50MzJfdCBvbXhQcm9maWxlLAotICAgICAgICBpbnQzMl90IG9teExldmVsLAotICAgICAgICBQcm9maWxlTGV2ZWxUeXBlKiBwdlByb2ZpbGVMZXZlbCkgewotICAgIEFMT0dWKCJDb252ZXJ0T214UHJvZmlsZUxldmVsOiAlZC8lZC8lZCIsIG1vZGUsIG9teFByb2ZpbGUsIG9teExldmVsKTsKLSAgICBQcm9maWxlTGV2ZWxUeXBlIHByb2ZpbGVMZXZlbDsKLSAgICBpZiAobW9kZSA9PSBIMjYzX01PREUpIHsKLSAgICAgICAgc3dpdGNoIChvbXhQcm9maWxlKSB7Ci0gICAgICAgICAgICBjYXNlIE9NWF9WSURFT19IMjYzUHJvZmlsZUJhc2VsaW5lOgotICAgICAgICAgICAgICAgIGlmIChvbXhMZXZlbCA+IE9NWF9WSURFT19IMjYzTGV2ZWw0NSkgewotICAgICAgICAgICAgICAgICAgICBBTE9HRSgiVW5zdXBwb3J0ZWQgbGV2ZWwgKCVkKSBmb3IgSDI2MyIsIG9teExldmVsKTsKLSAgICAgICAgICAgICAgICAgICAgcmV0dXJuIEJBRF9WQUxVRTsKLSAgICAgICAgICAgICAgICB9IGVsc2UgewotICAgICAgICAgICAgICAgICAgICBBTE9HVygiUFYgZG9lcyBub3Qgc3VwcG9ydCBsZXZlbCBjb25maWd1cmF0aW9uIGZvciBIMjYzIik7Ci0gICAgICAgICAgICAgICAgICAgIHByb2ZpbGVMZXZlbCA9IENPUkVfUFJPRklMRV9MRVZFTDI7Ci0gICAgICAgICAgICAgICAgICAgIGJyZWFrOwotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICBicmVhazsKLSAgICAgICAgICAgIGRlZmF1bHQ6Ci0gICAgICAgICAgICAgICAgQUxPR0UoIlVuc3VwcG9ydGVkIHByb2ZpbGUgKCVkKSBmb3IgSDI2MyIsIG9teFByb2ZpbGUpOwotICAgICAgICAgICAgICAgIHJldHVybiBCQURfVkFMVUU7Ci0gICAgICAgIH0KLSAgICB9IGVsc2UgeyAgLy8gTVBFRzQKLSAgICAgICAgc3dpdGNoIChvbXhQcm9maWxlKSB7Ci0gICAgICAgICAgICBjYXNlIE9NWF9WSURFT19NUEVHNFByb2ZpbGVTaW1wbGU6Ci0gICAgICAgICAgICAgICAgc3dpdGNoIChvbXhMZXZlbCkgewotICAgICAgICAgICAgICAgICAgICBjYXNlIE9NWF9WSURFT19NUEVHNExldmVsMGI6Ci0gICAgICAgICAgICAgICAgICAgICAgICBwcm9maWxlTGV2ZWwgPSBTSU1QTEVfUFJPRklMRV9MRVZFTDA7Ci0gICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKLSAgICAgICAgICAgICAgICAgICAgY2FzZSBPTVhfVklERU9fTVBFRzRMZXZlbDE6Ci0gICAgICAgICAgICAgICAgICAgICAgICBwcm9maWxlTGV2ZWwgPSBTSU1QTEVfUFJPRklMRV9MRVZFTDE7Ci0gICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKLSAgICAgICAgICAgICAgICAgICAgY2FzZSBPTVhfVklERU9fTVBFRzRMZXZlbDI6Ci0gICAgICAgICAgICAgICAgICAgICAgICBwcm9maWxlTGV2ZWwgPSBTSU1QTEVfUFJPRklMRV9MRVZFTDI7Ci0gICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKLSAgICAgICAgICAgICAgICAgICAgY2FzZSBPTVhfVklERU9fTVBFRzRMZXZlbDM6Ci0gICAgICAgICAgICAgICAgICAgICAgICBwcm9maWxlTGV2ZWwgPSBTSU1QTEVfUFJPRklMRV9MRVZFTDM7Ci0gICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKLSAgICAgICAgICAgICAgICAgICAgZGVmYXVsdDoKLSAgICAgICAgICAgICAgICAgICAgICAgIEFMT0dFKCJVbnN1cHBvcnRlZCBsZXZlbCAoJWQpIGZvciBNUEVHNCBzaW1wbGUgcHJvZmlsZSIsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgb214TGV2ZWwpOwotICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIEJBRF9WQUxVRTsKLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgYnJlYWs7Ci0gICAgICAgICAgICBjYXNlIE9NWF9WSURFT19NUEVHNFByb2ZpbGVTaW1wbGVTY2FsYWJsZToKLSAgICAgICAgICAgICAgICBzd2l0Y2ggKG9teExldmVsKSB7Ci0gICAgICAgICAgICAgICAgICAgIGNhc2UgT01YX1ZJREVPX01QRUc0TGV2ZWwwYjoKLSAgICAgICAgICAgICAgICAgICAgICAgIHByb2ZpbGVMZXZlbCA9IFNJTVBMRV9TQ0FMQUJMRV9QUk9GSUxFX0xFVkVMMDsKLSAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOwotICAgICAgICAgICAgICAgICAgICBjYXNlIE9NWF9WSURFT19NUEVHNExldmVsMToKLSAgICAgICAgICAgICAgICAgICAgICAgIHByb2ZpbGVMZXZlbCA9IFNJTVBMRV9TQ0FMQUJMRV9QUk9GSUxFX0xFVkVMMTsKLSAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOwotICAgICAgICAgICAgICAgICAgICBjYXNlIE9NWF9WSURFT19NUEVHNExldmVsMjoKLSAgICAgICAgICAgICAgICAgICAgICAgIHByb2ZpbGVMZXZlbCA9IFNJTVBMRV9TQ0FMQUJMRV9QUk9GSUxFX0xFVkVMMjsKLSAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOwotICAgICAgICAgICAgICAgICAgICBkZWZhdWx0OgotICAgICAgICAgICAgICAgICAgICAgICAgQUxPR0UoIlVuc3VwcG9ydGVkIGxldmVsICglZCkgZm9yIE1QRUc0IHNpbXBsZSAiCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICJzY2FsYWJsZSBwcm9maWxlIiwgb214TGV2ZWwpOwotICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIEJBRF9WQUxVRTsKLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgYnJlYWs7Ci0gICAgICAgICAgICBjYXNlIE9NWF9WSURFT19NUEVHNFByb2ZpbGVDb3JlOgotICAgICAgICAgICAgICAgIHN3aXRjaCAob214TGV2ZWwpIHsKLSAgICAgICAgICAgICAgICAgICAgY2FzZSBPTVhfVklERU9fTVBFRzRMZXZlbDE6Ci0gICAgICAgICAgICAgICAgICAgICAgICBwcm9maWxlTGV2ZWwgPSBDT1JFX1BST0ZJTEVfTEVWRUwxOwotICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7Ci0gICAgICAgICAgICAgICAgICAgIGNhc2UgT01YX1ZJREVPX01QRUc0TGV2ZWwyOgotICAgICAgICAgICAgICAgICAgICAgICAgcHJvZmlsZUxldmVsID0gQ09SRV9QUk9GSUxFX0xFVkVMMjsKLSAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOwotICAgICAgICAgICAgICAgICAgICBkZWZhdWx0OgotICAgICAgICAgICAgICAgICAgICAgICAgQUxPR0UoIlVuc3VwcG9ydGVkIGxldmVsICglZCkgZm9yIE1QRUc0IGNvcmUgIgotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAicHJvZmlsZSIsIG9teExldmVsKTsKLSAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBCQURfVkFMVUU7Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgIGJyZWFrOwotICAgICAgICAgICAgY2FzZSBPTVhfVklERU9fTVBFRzRQcm9maWxlQ29yZVNjYWxhYmxlOgotICAgICAgICAgICAgICAgIHN3aXRjaCAob214TGV2ZWwpIHsKLSAgICAgICAgICAgICAgICAgICAgY2FzZSBPTVhfVklERU9fTVBFRzRMZXZlbDE6Ci0gICAgICAgICAgICAgICAgICAgICAgICBwcm9maWxlTGV2ZWwgPSBDT1JFX1NDQUxBQkxFX1BST0ZJTEVfTEVWRUwxOwotICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7Ci0gICAgICAgICAgICAgICAgICAgIGNhc2UgT01YX1ZJREVPX01QRUc0TGV2ZWwyOgotICAgICAgICAgICAgICAgICAgICAgICAgcHJvZmlsZUxldmVsID0gQ09SRV9TQ0FMQUJMRV9QUk9GSUxFX0xFVkVMMjsKLSAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOwotICAgICAgICAgICAgICAgICAgICBjYXNlIE9NWF9WSURFT19NUEVHNExldmVsMzoKLSAgICAgICAgICAgICAgICAgICAgICAgIHByb2ZpbGVMZXZlbCA9IENPUkVfU0NBTEFCTEVfUFJPRklMRV9MRVZFTDM7Ci0gICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKLSAgICAgICAgICAgICAgICAgICAgZGVmYXVsdDoKLSAgICAgICAgICAgICAgICAgICAgICAgIEFMT0dFKCJVbnN1cHBvcnRlZCBsZXZlbCAoJWQpIGZvciBNUEVHNCBjb3JlICIKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgInNjYWxhYmxlIHByb2ZpbGUiLCBvbXhMZXZlbCk7Ci0gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gQkFEX1ZBTFVFOwotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICBicmVhazsKLSAgICAgICAgICAgIGRlZmF1bHQ6Ci0gICAgICAgICAgICAgICAgQUxPR0UoIlVuc3VwcG9ydGVkIE1QRUc0IHByb2ZpbGUgKCVkKSIsIG9teFByb2ZpbGUpOwotICAgICAgICAgICAgICAgIHJldHVybiBCQURfVkFMVUU7Ci0gICAgICAgIH0KLSAgICB9Ci0KLSAgICAqcHZQcm9maWxlTGV2ZWwgPSBwcm9maWxlTGV2ZWw7Ci0gICAgcmV0dXJuIE9LOwotfQotCi1pbmxpbmUgc3RhdGljIHZvaWQgQ29udmVydFlVVjQyMFNlbWlQbGFuYXJUb1lVVjQyMFBsYW5hcigKLSAgICAgICAgdWludDhfdCAqaW55dXYsIHVpbnQ4X3QqIG91dHl1diwKLSAgICAgICAgaW50MzJfd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KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0vKiAgRmlsZTogY3ZlaS5oICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgUHVycG9zZTogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgRGF0ZTogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgUmV2aXNpb24gSGlzdG9yeTogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiogQGludHJvZHVjdGlvbiAgIENvbW1vbiBWaWRlbyBFbmNvZGVyIEludGVyZmFjZSAoQ1ZFSSkgaXMgaW50ZW5kZWQgdG8gYmUgdXNlZCBieQotICAgIGFwcGxpY2F0aW9uIGRldmVsb3BlcnMgd2hvIHdhbnQgdG8gY3JlYXRlIGEgbXVsdGltZWRpYSBhcHBsaWNhdGlvbiB3aXRoIHZpZGVvCi0gICAgZW5jb2RpbmcgZmVhdHVyZS4gQ1ZFSSBpcyBkZXNpZ25lZCBzdWNoIHRoYXQgbmV3IHZpZGVvIGVuY29kZXIgYWxnb3JpdGhtcyBvcgotICAgIG1vZHVsZXMgY2FuIGJlIHBsdWdnZWQgaW4gc2VhbWxlc3NseSB3aXRob3V0IHVzZXIgaW50ZXJhY3Rpb24uIEluIG90aGVyIHdvcmRzLAotICAgIGFueSBjaGFuZ2VzIHRvIHRoZSBDVkVJIGxpYnJhcnkgYXJlIHRyYW5zcGFyZW50IHRvIHRoZSB1c2Vycy4gVXNlcnMgY2FuIHN0aWxsCi0gICAgdXNlIHRoZSBzYW1lIHNldCBvZiBBUElzIGZvciBuZXcgZW5jb2RpbmcgdG9vbHMuCi0K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ZmljIGxhbmd1YWdlIGdvdmVybmluZyBwZXJtaXNzaW9ucwotICogYW5kIGxpbWl0YXRpb25zIHVuZGVyIHRoZSBMaWNlbnNlLgotICogLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLQotICovCi0vKiBEYXRlOiA4LzAyLzA0ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiBEZXNjcmlwdGlvbjogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgQ2hhbmdlIHRoZSBiaXRzdHJlYW0gcGFyc2luZyBhbGdvcml0aG0uIFVzZSB0ZW1wb3Jhcnkgd29yZCBvZiAyIG9yIDQgYnl0ZXMgICovCi0vKiAgYmVmb3JlIHdyaXRpbmcgaXQgdG8gdGhlIGJpdHN0cmVhbSBidWZmZXIuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgTm90ZSBieXRlQ291bnQgZG9lc24ndCBoYXZlIHRvIGJlIG11bHRpcGxlIG9mIDIgb3IgNCAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotCi0jaW5jbHVkZSAiYml0c3RyZWFtX2lvLmgiCi0jaW5jbHVkZSAibTR2ZW5jX29zY2wuaCIKLSNpbmNsdWRlIDxzdGRsaWIuaD4KLQotc3RhdGljIGNvbnN0IFVDaGFyIE1hc2tbIF0gPQotewotICAgIDB4MDAsIDB4MDEsIDB4MDMsIDB4MDcsIDB4MEYsIDB4MUYsIDB4M0YsIDB4N0YsIDB4RkYKLX07Ci0KLSNkZWZpbmUgV09SRF9TSVpFICAgNCAgIC8qIGZvciAzMi1iaXQgbWFjaGluZSAqLwotCi0vKk5vdGU6Ci0gICAgMS4gVGhlcmUgaXMgYSBwcm9ibGVtIHdoZW4gb3V0cHV0IHRoZSBsYXN0IGJpdHMod2hpY2ggY2FuIG5vdCBmb3JtIGEgYnl0ZSB5ZXQKLSAgICBzbyB3aGVuIHlvdSBvdXRwdXQsIHlvdSBuZWVkIHRvIHN0dWZmIHRvIG1ha2Ugc3VyZSBpdCBpcyBhIGJ5dGUKLSAgICAyLiAgSSBub3cgaGFyZCBjb2RlZCBieXRlIHRvIGJlIDggYml0cyovCi0KLQotLyogPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09ICovCi0vKiAgRnVuY3Rpb24gOiBCaXRTdHJlYW1DcmVhdGVFbmMoSW50IGJ1ZmZlclNpemUgKSAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICBEYXRlICAgICA6IDA4LzI5LzIwMDAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogIFB1cnBvc2UgIDogQ3JlYXRlIGEgYml0c3RyZWFtIHRvIGhvbGQgb25lIGVuY29kZWQgdmlkZW8gcGFja2V0IG9yIGZyYW1lICovCi0vKiAgSW4vb3V0ICAgOiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICAgICAgYnVmZmVyU2l6ZSAgOiAgIHNpemUgb2YgdGhlIGJpdHN0cmVhbSBidWZmZXIgaW4gYnl0ZXMgICAgICAgICAgICAgICAqLwotLyogIFJldHVybiAgIDogUG9pbnRlciB0byB0aGUgQml0c3RyZWFtRW5jVmlkZW8gICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgTW9kaWZpZWQgOiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi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XJydW5CdWZmZXIgPSBOVUxMOwotICAgIHN0cmVhbS0+b0JTaXplID0gMDsKLQotICAgIHJldHVybiBzdHJlYW07Ci19Ci0KLS8qID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PSAqLwotLyogIEZ1bmN0aW9uIDogQml0c3RyZWFtQ2xvc2VFbmMoICkgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgRGF0ZSAgICAgOiAwOC8yOS8yMDAwICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICBQdXJwb3NlICA6IGNsb3NlIGEgYml0c3RyZWFtICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogIEluL291dCAgIDoKLSAgICAgICAgc3RyZWFtICA6ICAgdGhlIGJpdHN0cmVhbSB0byBiZSBjbG9zZWQgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogIFJldHVybiAgIDogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgTW9kaWZpZWQgOiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PSAqLwotCi1Wb2lkICBCaXRzdHJlYW1DbG9zZUVuYyhCaXRzdHJlYW1FbmNWaWRlbyAqc3RyZWFtKQotewotICAgIGlmIChzdHJlYW0pCi0gICAgewotICAgICAgICBpZiAoc3RyZWFtLT5iaXRzdHJlYW1CdWZmZXIpCi0gICAgICAgIHsKLSAgICAgICAgICAgIE00VkVOQ19GUkVFKHN0cmVhbS0+Yml0c3RyZWFtQnVmZmVyKTsKLSAgICAgICAgfQotCi0gICAgICAgIE00VkVOQ19GUkVFKHN0cmVhbSk7Ci0gICAgfQotfQotCi0KLS8qID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PSAqLwotLyogIEZ1bmN0aW9uIDogQml0c3RyZWFtUHV0Qml0cyhCaXRzdHJlYW1FbmNWaWRlbyAqc3RyZWFtLCBJbnQgTGVuZ3RoLAotICAgICAgICAgICAgICAgICAgICAgICAgIEludCBWYWx1ZSkgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgRGF0ZSAgICAgOiAwOC8yOS8yMDAwICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICBQdXJwb3NlICA6IHB1dCBMZW5ndGggKDEtMTYpIG51bWJlciBvZiBiaXRzIHRvIHRoZSBzdHJlYW0gICAgICAgICAgICAgICAqLwotLyogICAgICAgICAgICBmb3IgMzItYml0IG1hY2hpbmUgdGhpcyBmdW5jdGlvbiBjYW4gZG8gdXB0byAzMiBiaXQgaW5wdXQgICAgICovCi0vKiAgSW4vb3V0ICAgOiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICAgICAgc3RyZWFtICAgICAgdGhlIGJpdHN0cmVhbSB3aGVyZSB0aGUgYml0cyBhcmUgcHV0IGluICAgICAgICAgICAgICAgICAqLwotLyogICAgICBMZW5ndGggICAgICBiaXRzIGxlbmd0aCAoc2hvdWxkIGJlbG9uZyB0byAxIHRvIDE2KSAgICAgICAgICAgICAgICAgICovCi0vKiAgICAgIFZhbHVlICAgICAgIHRob3NlIGJpdHMgdmFsdWUgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICBSZXR1cm4gICA6ICBQVl9TVEFUVVMgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogIE1vZGlmaWVkIDogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0gKi8KLVBWX1NUQVRVUyBCaXRzdHJlYW1QdXRCaXRzKEJpdHN0cmVhbUVuY1ZpZGVvICpzdHJlYW0sIEludCBMZW5ndGgsIFVJbnQgVmFsdWUpCi17Ci0gICAgUFZfU1RBVFVTIHN0YXR1czsKLQotICAgIGlmIChzdHJlYW0tPmJpdExlZnQgPiBMZW5ndGgpCi0gICAgewotICAgICAgICBzdHJlYW0tPndvcmQgPDw9IExlbmd0aDsKLSAgICAgICAgc3RyZWFtLT53b3JkIHw9IFZhbHVlOyAgLyogYXNzdW1pbmcgVmFsdWUgaXMgbm90IGxhcmdlciB0aGFuIExlbmd0aCAqLwotICAgICAgICBzdHJlYW0tPmJpdExlZnQgLT0gTGVuZ3RoOwotICAgICAgICByZXR1cm4gUFZfU1VDQ0VTUzsKLSAgICB9Ci0gICAgZWxzZQotICAgIHsKLQotICAgICAgICBzdHJlYW0tPndvcmQgPDw9IHN0cmVhbS0+Yml0TGVmdDsKLSAgICAgICAgTGVuZ3RoIC09IHN0cmVhbS0+Yml0TGVmdDsKLSAgICAgICAgc3RyZWFtLT53b3JkIHw9ICgoVUludClWYWx1ZSA+PiBMZW5ndGgpOwotCi0gICAgICAgIHN0YXR1cyA9IEJpdHN0cmVhbVNhdmVXb3JkKHN0cmVhbSk7Ci0gICAgICAgIGlmIChzdGF0dXMgIT0gUFZfU1VDQ0VTUykKLSAgICAgICAgewotICAgICAgICAgICAgcmV0dXJuIHN0YXR1czsKLSAgICAgICAgfQotCi0gICAgICAgIC8qIHdlIGdvdCBuZXcgTGVuZ3RoIGFuZCBWYWx1ZSAqLwotICAgICAgICAvKiBub3RlIHRoYXQgVmFsdWUgaXMgbm90ICJjbGVhbiIgYmVjYXVzZSBvZiBtc2IgYXJlIG5vdCBtYXNrZWQgb3V0ICovCi0gICAgICAgIHN0cmVhbS0+d29yZCA9IFZhbHVlOwotICAgICAgICBzdHJlYW0tPmJpdExlZnQgLT0gTGVuZ3RoOwotICAgICAgICAvKiBhc3N1bWluZyB0aGF0IExlbmd0aCBpcyBubyBtb3JlIHRoYW4gMTYgYml0cyAqLwotICAgICAgICAvKiBzdHJlYW0tPmJpdExlZnQgc2hvdWxkIGJlIGdyZWF0ZXIgdGhhbiB6ZXJvIGF0IHRoaXMgcG9pbnQgKi8KLSAgICAgICAgLy9pZihzdHJlYW0tPmJpdExlZnQ8PTApCi0gICAgICAgIC8vICBleGl0KC0xKTsKLSAgICAgICAgcmV0dXJuIFBWX1NVQ0NFU1M7Ci0gICAgfQotfQotCi0vKiA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0gKi8KLS8qICBGdW5jdGlvbiA6IEJpdHN0cmVhbVB1dEdUMTZCaXRzKEJpdHN0cmVhbUVuY1ZpZGVvICpzdHJlYW0sIEludCBMZW5ndGgsIFVJbnQzMiBWYWx1ZSkgICAgKi8KLS8qICBEYXRlICAgICA6IDA4LzI5LzIwMDAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogIFB1cnBvc2UgIDogVXNlIHRoaXMgZnVuY3Rpb24gdG8gcHV0IExlbmd0aCAoMTctMzIpIG51bWJlciBvZiBiaXRzIHRvICAgICovCi0vKiAgICAgICAgICAgICAgZm9yIDE2LWJpdCBtYWNoaW5lICB0aGUgc3RyZWFtLiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICBJbi9vdXQgICA6ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogICAgICBzdHJlYW0gICAgICB0aGUgYml0c3RyZWFtIHdoZXJlIHRoZSBiaXRzIGFyZSBwdXQgaW4gICAgICAgICAgICAgICAgICovCi0vKiAgICAgIExlbmd0aCAgICAgIGJpdHMgbGVuZ3RoIChzaG91bGQgYmVsb25nIHRvIDE3IHRvIDMyKSAgICAgICAgICAgICAgICAgKi8KLS8qICAgICAgVmFsdWUgICAgICAgdGhvc2UgYml0cyB2YWx1ZSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogIFJldHVybiAgIDogIFBWX1NUQVRVUyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgTW9kaWZpZWQgOiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PSAqLwotUFZfU1RBVFVTIEJpdHN0cmVhbVB1dEdUMTZCaXRzKEJpdHN0cmVhbUVuY1ZpZGVvICpzdHJlYW0sIEludCBMZW5ndGgsIFVMb25nIFZhbHVlKQotewotICAgIFBWX1NUQVRVUyBzdGF0dXM7Ci0gICAgVUludCB0b3BWYWx1ZTsKLSAgICBJbnQgdG9wTGVuZ3RoOwotCi0gICAgdG9wVmFsdWUgPSAoVmFsdWUgPj4gMTYpOwotICAgIHRvcExlbmd0aCA9IExlbmd0aCAtIDE2OwotCi0gICAgaWYgKHRvcExlbmd0aCA+IDApCi0gICAgewotICAgICAgICBzdGF0dXMgPSBCaXRzdHJlYW1QdXRCaXRzKHN0cmVhbSwgdG9wTGVuZ3RoLCB0b3BWYWx1ZSk7Ci0KLSAgICAgICAgaWYgKHN0YXR1cyAhPSBQVl9TVUNDRVNTKQotICAgICAgICB7Ci0gICAgICAgICAgICByZXR1cm4gc3RhdHVzOwotICAgICAgICB9Ci0KLSAgICAgICAgc3RhdHVzID0gQml0c3RyZWFtUHV0Qml0cyhzdHJlYW0sIDE2LCAoVUludCkoVmFsdWUgJiAweEZGRkYpKTsKLQotICAgICAgICByZXR1cm4gc3RhdHVzOwotICAgIH0KLSAgICBlbHNlCi0gICAgewotICAgICAgICBzdGF0dXMgPSBCaXRzdHJlYW1QdXRCaXRzKHN0cmVhbSwgTGVuZ3RoLCAoVUludClWYWx1ZSk7Ci0gICAgICAgIHJldHVybiBzdGF0dXM7Ci0gICAgfQotfQotCi0vKiA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0gKi8KLS8qICBGdW5jdGlvbiA6IEJpdHN0cmVhbVNhdmVXb3JkICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogIERhdGUgICAgIDogMDgvMDMvMjAwNCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgUHVycG9zZSAgOiBzYXZlIHdyaXR0ZW4gd29yZCBpbnRvIHRoZSBiaXRzdHJlYW0gYnVmZmVyLiAgICAgICAgICAgICAgICAgKi8KLS8qICBJbi9vdXQgICA6ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogICAgICBzdHJlYW0gICAgICB0aGUgYml0c3RyZWFtIHdoZXJlIHRoZSBiaXRzIGFyZSBwdXQgaW4gICAgICAgICAgICAgICAgICovCi0vKiAgUmV0dXJuICAgOiAgUFZfU1RBVFVTICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICBNb2RpZmllZCA6ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09P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NpZiAoV09SRF9TSVpFID09IDQpCi0gICAgc3RyZWFtLT5ieXRlQ291bnQgKz0gNDsKLSAgICBzdHJlYW0tPmJpdExlZnQgPSAzMjsKLSNlbHNlCi0gICAgc3RyZWFtLT5ieXRlQ291bnQgKz0gMjsKLSAgICBzdHJlYW0tPmJpdExlZnQgPSAxNjsKLSNlbmRpZgotCi0gICAgcmV0dXJuIFBWX1NVQ0NFU1M7Ci19Ci0KLQotLyogPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09ICovCi0vKiAgRnVuY3Rpb24gOiBCaXRzdHJlYW1TYXZlUGFydGlhbCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICBEYXRlICAgICA6IDA4LzAzLzIwMDQgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogIFB1cnBvc2UgIDogc2F2ZSB1bmZpbmlzaGVkIHdyaXR0ZW4gd29yZCBpbnRvIHRoZSBiaXRzdHJlYW0gYnVmZmVyLiAgICAgICovCi0vKiAgSW4vb3V0ICAgOiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICAgICAgc3RyZWFtICAgICAgdGhlIGJpdHN0cmVhbSB3aGVyZSB0aGUgYml0cyBhcmUgcHV0IGluICAgICAgICAgICAgICAgICAqLwotLyogIFJldHVybiAgIDogIFBWX1NUQVRVUyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgTW9kaWZpZWQgOiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PSAqLwot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PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0gKi8KLS8qICBGdW5jdGlvbiA6IEJpdHN0cmVhbVNob3J0SGVhZGVyQnl0ZUFsaWduU3R1ZmZpbmcoICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEJpdHN0cmVhbUVuY1ZpZGVvICpzdHJlYW0pICAgICAgICAgICovCi0vKiAgRGF0ZSAgICAgOiAwOC8yOS8yMDAwICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICBQdXJwb3NlICA6IGJpdCBzdHVmZmluZyBmb3IgbmV4dCBzdGFydCBjb2RlIGluIHNob3J0IHZpZGVvIGhlYWRlciAgICAgICAqLwotLyogIEluL291dCAgIDogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgUmV0dXJuICAgOiAgbnVtYmVyIG9mIGJpdHMgdG8gYmUgc3R1ZmZlZCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICBNb2RpZmllZCA6ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09ICovCi0KLUludCBCaXRzdHJlYW1TaG9ydEhlYWRlckJ5dGVBbGlnblN0dWZmaW5nKEJpdHN0cmVhbUVuY1ZpZGVvICpzdHJlYW0pCi17Ci0gICAgVUludCByZXN0Qml0czsKLSAgICBJbnQgZnJhY3Rpb247Ci0KLSAgICByZXN0Qml0cyA9IChzdHJlYW0tPmJpdExlZnQgJiAweDcpOyAvKiBtb2R1bG8gOCAqLwotCi0gICAgaWYgKHJlc3RCaXRzKSAgLypzaG9ydF92aWRlb19oZWFkZXJbMF0gaXMgMSBpbiBoMjYzIGJhc2VsaW5lKi8KLSAgICB7Ci0gICAgICAgIC8qIEguMjYzIHN0eWxlIHN0dWZmaW5nICovCi0gICAgICAgIEJpdHN0cmVhbVB1dEJpdHMoc3RyZWFtLCByZXN0Qml0cywgMCk7Ci0gICAgfQotCi0gICAgaWYgKHN0cmVhbS0+Yml0TGVmdCAhPSAoV09SRF9TSVpFIDw8IDMpKQotICAgIHsKLSAgICAgICAgQml0c3RyZWFtU2F2ZVBhcnRpYWwoc3RyZWFtLCAmZnJhY3Rpb24pOwotICAgIH0KLQotICAgIHJldHVybiByZXN0Qml0czsKLX0KLQotLyogPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09ICovCi0vKiAgRnVuY3Rpb24gOiBCaXRzdHJlYW1NcGVnNEJ5dGVBbGlnblN0dWZmaW5nKEJpdHN0cmVhbUVuY1ZpZGVvICpzdHJlYW0pICAgKi8KLS8qICBEYXRlICAgICA6IDA4LzI5LzIwMDAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogIFB1cnBvc2UgIDogYml0IHN0dWZmaW5nIGZvciBuZXh0IHN0YXJ0IGNvZGUgaW4gTVBFRy00ICAgICAgICAgICAgICAgICAgKi8KLS8qICBJbi9vdXQgICA6ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogIFJldHVybiAgIDogIG51bWJlciBvZiBiaXRzIHRvIGJlIHN0dWZmZWQgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgTW9kaWZpZWQgOiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09P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CBzdHVmZmluZyBmb3IgbmV4dCByZXN5bmMgbWFya2VyKi8KLS8qICBkb2VzIGJpdCBzdHVmZmluZyBmb3IgbmV4dCByZXN5bmMgbWFya2VyCi0gKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIjAiCi0gKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAiMDEiCi0gKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICIwMTEiCi0gKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIjAxMTEiCi0gKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAiMDExMTEiCi0gKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICIwMTExMTEiCi0gKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIjAxMTExMTEiCi0gKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAiMDExMTExMTEiICAgKDgtYml0IGNvZGV3b3JkKQotICovCi0KLS8qSW50IEJpdHN0cmVhbU5leHRSZXN5bmNNYXJrZXJFbmMoQml0c3RyZWFtRW5jVmlkZW8gKnN0cmVhbSkKLXsKLSAgSW50IGNvdW50OwotICBCaXRzdHJlYW1QdXQxQml0cyhzdHJlYW0sMCk7Ci0gIGNvdW50PTgtc3RyZWFtLT50b3RhbEJpdHMgJiA4OwotICBCaXRzdHJlYW1QdXRCaXRzKHN0cmVhbSxjb3VudCxNYXNrW2NvdW50XSk7Ci0gIHJldHVybiBjb3VudDsKLX0qLwotCi0vKiA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0gKi8KLS8qICBGdW5jdGlvbiA6IEJpdHN0cmVhbUFwcGVuZEVuYyggQml0c3RyZWFtRW5jVmlkZW8gKmJpdHN0cmVhbTEsICAgICAgICAgICAqLwotLyogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEJpdHN0cmVhbUVuY1ZpZGVvICpiaXRzdHJlYW0yICAgKSAgICovCi0vKiAgRGF0ZSAgICAgOiAwOC8yOS8yMDAwICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICBQdXJwb3NlICA6IEFwcGVuZCB0aGUgaW50ZXJtZWRpYXRlIGJpdHN0cmVhbSAoYml0c3RyZWFtMikgdG8gdGhlIGVuZCBvZiAqLwotLyogICAgICAgICAgICAgICAgICAgICAgICAgICAgICBvdXRwdXQgYml0c3RyZWFtKGJpdHN0cmVhbTEpICAgICAgICAgICAgICAgICovCi0vKiAgSW4vb3V0ICAgOiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICBSZXR1cm4gICA6ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogIE1vZGlmaWVkIDogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0gKi8KLQotCi1QVl9TVEFUVVMgQml0c3RyZWFtQXBwZW5kRW5jKEJpdHN0cmVhbUVuY1ZpZGVvICpiaXRzdHJlYW0xLCBCaXRzdHJlYW1FbmNWaWRlbyAqYml0c3RyZWFtMikKLXsKLSAgICBQVl9TVEFUVVMgc3RhdHVzOwotICAgIFVDaGFyICpwdHJCUzIsICpwdHJCUzE7Ci0gICAgVUNoYXIgYnl0ZUJTMiwgYnl0ZUJTMTsKLSAgICBJbnQgIG51bWJ5dGUyOwotICAgIEludCBiaXR1c2VkLCBiaXRsZWZ0LCBvZmZzZXQsIGZyYWN0aW9uOwotCi0gIC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Ci0gICAgfQotCi0gICAgYml0c3RyZWFtMS0+d29yZCA9IGJ5dGVCUzEgPj4gYml0bGVmdDsgIC8qIGJpdHN0cmVhbS0+Yml0TGVmdCByZW1haW5zIHRoZSBzYW1lICovCi0KLSAgICAvKiBub3cgc2F2ZSBiczItPndvcmQgaW4gYnMxICovCi0gICAgc3RhdHVzID0gQml0c3RyZWFtUHV0Qml0cyhiaXRzdHJlYW0xLCAoV09SRF9TSVpFIDw8IDMpIC0gYml0c3RyZWFtMi0+Yml0TGVmdCwgYml0c3RyZWFtMi0+d29yZCk7Ci0KLSAgICByZXR1cm4gc3RhdHVzOwotfQotCi0vKiA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0gKi8KLS8qICBGdW5jdGlvbiA6IEJpdHN0cmVhbUFwcGVuZFBhY2tldCggQml0c3RyZWFtRW5jVmlkZW8gKmJpdHN0cmVhbTEsICAgICAgICAqLwotLyogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEJpdHN0cmVhbUVuY1ZpZGVvICpiaXRzdHJlYW0yICAgKSAgICovCi0vKiAgRGF0ZSAgICAgOiAwNS8zMS8yMDAxICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICBQdXJwb3NlICA6IEFwcGVuZCB0aGUgaW50ZXJtZWRpYXRlIGJpdHN0cmVhbSAoYml0c3RyZWFtMikgdG8gdGhlIGVuZCBvZiAqLwotLyogICAgICAgICAgICAgIG91dHB1dCBiaXRzdHJlYW0oYml0c3RyZWFtMSkga25vd2luZyB0aGF0IGJpdHN0cmVhbTEgaXMgYnl0ZS1hbGlnbmVkKi8KLS8qICBJbi9vdXQgICA6ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogIFJldHVybiAgIDogICAgICAgICAgICAgICAgICAgICAg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ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogIFJldHVybiAgIDogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgTW9kaWZpZWQgOiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PSAqLwotUFZfU1RBVFVTIEJpdHN0cmVhbUFwcGVuZFBhY2tldE5vT2Zmc2V0KEJpdHN0cmVhbUVuY1ZpZGVvICpiaXRzdHJlYW0xLCBCaXRzdHJlYW1FbmNWaWRlbyAqYml0c3RyZWFtMikKLXsKLSAgICBQVl9TVEFUVVMgc3RhdHVzID0gUFZfU1VDQ0VTUzsKLSAgICBVQ2hhciAqcHRyQlMyLCAqcHRyQlMxOwotICAgIEludCAgbnVtYnl0ZTI7Ci0gICAgSW50ICBieXRlbGVmdDsKLQotICAgIG51bWJ5dGUyID0gYml0c3RyZWFtMi0+Ynl0ZUNvdW50OwotCi0gICAgaWYgKGJpdHN0cmVhbTEtPmJ5dGVDb3VudCArIGJpdHN0cmVhbTItPmJ5dGVDb3VudCA+IGJpdHN0cmVhbTEtPmJ1ZmZlclNpemUpCi0gICAgewotICAgICAgICBudW1ieXRlMiA9ICBiaXRzdHJlYW0xLT5idWZmZXJTaXplIC0gYml0c3RyZWFtMS0+Ynl0ZUNvdW50OwotICAgICAgICBzdGF0dXMgPSAgUFZfRU5EX09GX0JVRjsgICAgLyogc2lnbmFsIGVuZCBvZiBidWZmZXIgKi8KLSAgICB9Ci0KLSAgICBwdHJCUzEgPSBiaXRzdHJlYW0xLT5iaXRzdHJlYW1CdWZmZXI7IC8qIG1vdmUgcHRyIGJzMSovCi0gICAgcHRyQlMyID0gYml0c3R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hbUVuY1ZpZGVvICpiaXRzdHJlYW0sICAgICAgICAgICAgICAgICovCi0vKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgSW50IGJ5dGVDb3VudCwgSW50IGJpdENvdW50KSAgICAgICAgKi8KLS8qICBEYXRlICAgICA6IDA0LzI4LzIwMDIgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogIFB1cnBvc2UgIDogUmVwb3NpdGlvbiB0aGUgc2l6ZSBvZiB0aGUgYnVmZmVyIGNvbnRlbnQgKGN1cnRhaWwpICAgICAgICAgICovCi0vKiAgSW4vb3V0ICAgOiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICBSZXR1cm4gICA6ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogIE1vZGlmaWVkIDogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0gKi8KLVBWX1NUQVRVUyAgIEJpdHN0cmVhbVJlcG9zKEJpdHN0cmVhbUVuY1ZpZGVvICpiaXRzdHJlYW0sIEludCBieXRlQ291bnQsIEludCBiaXRDb3VudCkKLXsKLSAgICBVQ2hhciAqcHRyLCBieXRlOwotICAgIFVJbnQgd29yZDsKLSAgICBJbnQgZnJhY3Rpb247Ci0KLSAgICBCaXRzdHJlYW1TYXZlUGFydGlhbChiaXRzdHJlYW0sICZmcmFjdGlvbik7Ci0KLSAgICBiaXRzdHJlYW0tPmJ5dGVDb3VudCA9IGJ5dGVDb3VudDsKLSAgICBwdHIgPSBiaXRzdHJlYW0tPmJpdHN0cmVhbUJ1ZmZlciArIGJ5dGVDb3VudDsgLyogZ2V0IGZyYWN0aW9uIG9mIHRoZSBieXRlICovCi0gICAgaWYgKGJpdENvdW50KQotICAgIHsKLSAgICAgICAgYml0c3RyZWFtLT5iaXRMZWZ0ID0gKFdPUkRfU0laRSA8PCAzKSAtIGJpdENvdW50OyAvKiBiaXRDb3VudCBzaG91bGQgYmUgMC0zMSAqLwotICAgICAgICB3b3JkID0gKnB0cisrOwotICAgICAgICBieXRlID0gKnB0cisrOwotICAgICAgICB3b3JkID0gYnl0ZSB8ICh3b3JkIDw8IDgpOwotI2lmIChXT1JEX1NJWkUgPT0gNCkKLSAgICAgICAgYnl0ZSA9ICpwdHIrKzsKLSAgICAgICAgd29yZCA9IGJ5dGUgfCAod29yZCA8PCA4KTsKLSAgICAgICAgYnl0ZSA9ICpwdHIrKzsKLSAgICAgICAgd29yZCA9IGJ5dGUgfCAod29yZCA8PCA4KTsKLSNlbmRpZgotICAgICAgICBiaXRzdHJlYW0tPndvcmQgPSB3b3JkID4+IChiaXRzdHJlYW0tPmJpdExlZnQpOwotICAgIH0KLSAgICBlbHNlCi0gICAgewotICAgICAgICBiaXRzdHJlYW0tPndvcmQgPSAwOwotICAgICAgICBiaXRzdHJlYW0tPmJpdExlZnQgPSAoV09SRF9TSVpFIDw8IDMpOwotICAgIH0KLQotICAgIHJldHVybiBQVl9TVUNDRVNTOwotfQotCi0vKiA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0gKi8KLS8qICBGdW5jdGlvbiA6IEJpdHN0cmVhbUZsdXNoQml0cyhCaXRzdHJlYW1FbmNWaWRlbyAqYml0c3RyZWFtMSwgICAgICAgICAgICAqLwotLyogICAgICAgICAgICAgICAgICAgICAgICAgICAgICBJbnQgbnVtX2JpdF9sZWZ0KSAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgRGF0ZSAgICAgOiAwNC8yNC8yMDAyICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICBQdXJwb3NlICA6IEZsdXNoIGJ1ZmZlciBleGNlcHQgdGhlIGxhc3QgbnVtX2JpdF9sZWZ0IGJpdHMuICAgICAgICAgICAgICAqLwotLyogIEluL291dCAgIDogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgUmV0dXJuICAgOiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICBNb2RpZmllZCA6ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09ICovCi0KLQotUFZfU1RBVFVTIEJpdHN0cmVhbUZsdXNoQml0cyhCaXRzdHJlYW1FbmNWaWRlbyAqYml0c3RyZWFtMSwgSW50IG51bV9iaXRfbGVmdCkKLXsKLSAgICBJbnQgaTsKLSAgICBVQ2hhciAqcHRyRHN0LCAqcHRyU3JjOwotICAgIEludCBsZWZ0b3ZlciwgYml0dXNlZDsKLSAgICBJbnQgbmV3X2J5dGUgPSAobnVtX2JpdF9sZWZ0ID4+IDMpOwotICAgIEludCBuZXdfYml0ID0gbnVtX2JpdF9sZWZ0IC0gKG5ld19ieXRlIDw8IDMpOyAvKiBiZXR3ZWVuIDAtNyAqLwotCi0gICAgcHRyU3JjID0gYml0c3RyZWFtMS0+Yml0c3RyZWFtQnVmZmVyICsgYml0c3RyZWFtMS0+Ynl0ZUNvdW50OwotICAgIHB0ckRzdCA9IGJpdHN0cmVhbTEtPmJpdHN0cmVhbUJ1ZmZlcjsKLQotICAgIGJpdHVzZWQgPSAoV09SRF9TSVpFIDw8IDMpIC0gYml0c3RyZWFtMS0+Yml0TGVmdDsKLQotICAgIGx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U3JjKSA+PiAoOCAtIG5ld19iaXQpOwotICAgIH0KLQotICAgIHJldHVybiBQVl9TVUNDRVNTOwotfQotCi0vKiA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0gKi8KLS8qICBGdW5jdGlvbiA6IEJpdHN0cmVhbVByZXBlbmRQYWNrZXQoIEJpdHN0cmVhbUVuY1ZpZGVvICpiaXRzdHJlYW0xLCAgICAgICAqLwotLyogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEJpdHN0cmVhbUVuY1ZpZGVvICpiaXRzdHJlYW0yICAgKSAgICovCi0vKiAgRGF0ZSAgICAgOiAwNC8yNi8yMDAyICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICBQdXJwb3NlICA6IFByZXBlbmQgdGhlIGludGVybWVkaWF0ZSBiaXRzdHJlYW0gKGJpdHN0cmVhbTIpIHRvIHRoZSBiZWdpbm5pbmcgb2YgKi8KLS8qICAgICAgICAgICAgICBvdXRwdXQgYml0c3RyZWFtKGJpdHN0cmVhbTEpICovCi0vKiAgSW4vb3V0ICAgOiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICBSZXR1cm4gICA6ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogIE1vZGlmaWVkIDogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0gKi8KLVBWX1NUQVRVUyBCaXRzdHJlYW1QcmVwZW5kUGFja2V0KEJpdHN0cmVhbUVuY1ZpZGVvICpiaXRzdHJlYW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dldCB0aGUgYml0IHBvc2l0aW9uLiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogIEluL291dCAgIDogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgUmV0dXJuICAgOiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICBNb2RpZmllZCA6ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09ICovCi1JbnQgQml0c3RyZWFtR2V0UG9zKEJpdHN0cmVhbUVuY1ZpZGVvICpzdHJlYW0pCi17Ci0KLSAgICByZXR1cm4gc3RyZWFtLT5ieXRlQ291bnQqOCArIChXT1JEX1NJWkUgPDwgMykgLSBzdHJlYW0tPmJpdExlZnQ7Ci19Ci0KLXZvaWQgQml0c3RyZWFtRW5jUmVzZXQoQml0c3RyZWFtRW5jVmlkZW8gKnN0cmVhbSkKLXsKLSAgICBzdHJlYW0tPmJpdExlZnQgPSAoV09SRF9TSVpFIDw8IDMpOwotICAgIHN0cmVhbS0+d29yZCA9IDA7Ci0gICAgc3RyZWFtLT5ieXRlQ291bnQgPSAwOwotICAgIHJldHVybiA7Ci19Ci0KLS8qIFRoaXMgZnVuY3Rpb24gc2V0IHRoZSBvdmVycnVuIGJ1ZmZlciwgYW5kIFZpZGVvRW5jRGF0YSBjb250ZXh0IGZvciBjYWxsYmFjayB0byByZWFsbG9jYXRlCi1vdmVycnVuIGJ1ZmZlci4gICovCi1Wb2lkICBCaXRzdHJlYW1TZXRPdmVycnVuQnVmZmVyKEJpdHN0cmVhbUVuY1ZpZGVvKiBzdHJlYW0sIFVDaGFyKiBvdmVycnVuQnVmZmVyL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UgZ292ZXJuaW5nIHBlcm1pc3Npb25zCi0gKiBhbmQgbGltaXRhdGlvbnMgdW5kZXIgdGhlIExpY2Vuc2UuCi0gKiAtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tCi0gKi8KLSNpbmNsdWRlICJtcDRkZWYuaCIKLSNpbmNsdWRlICJtcDRlbmNfbGliLmgiCi0jaW5jbHVkZSAibXA0bGliX2ludC5oIgotI2luY2x1ZGUgImJpdHN0cmVhbV9pby5oIgotI2luY2x1ZGUgInZsY19lbmNvZGUuaCIKLSNpbmNsdWRlICJtNHZlbmNfb3NjbC5oIgotCi1QVl9TVEFUVVMgRW5jb2RlR09CSGVhZGVyKFZpZGVvRW5jRGF0YSAqdmlkZW8sIEludCBHT0JfbnVtYmVyLCBJbnQgcXVhbnRfc2NhbGUsIEludCBiczFzdHJlYW0pOwotCi0vKiA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0gKi8KLS8qICBGdW5jdGlvbiA6IEVuY29kZUZyYW1lQ29tYmluZWRNb2RlKCkgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogIERhdGUgICAgIDogMDkvMDEvMjAwMCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgSGlzdG9yeSAgOiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICBQdXJwb3NlICA6IEVuY29kZSBhIGZyYW1lIG9mIE1QRUc0IGJpdHN0cmVhbSBpbiBDb21iaW5lZCBtb2RlLiAgICAgICAgICAqLwotLyogIEluL291dCAgIDogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgUmV0dXJuICAgOiAgUFZfU1VDQ0VTUyBpZiBzdWNjZXNzZnVsIGVsc2UgUFZfRkFJTCAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICBNb2RpZmllZCA6ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0gKi8KLVBWX1NUQVRVUyBFbmNvZGVGcmFtZUNvbWJpbmVkTW9kZShWaWRlb0VuY0RhdGEgKnZpZGVvKQotewotICAgIFBWX1NUQVRVUyBzdGF0dXMgPSBQVl9TVUNDRVNTOwotICAgIFZvbCAqY3VyclZvbCA9IHZpZGVvLT52b2xbdmlkZW8tPmN1cnJMYXllcl07Ci0gICAgVm9wICpjdXJyVm9wID0gdmlkZW8tPmN1cnJWb3A7Ci0gICAgVmlkZW9FbmNQYXJhbXMgKmVuY1BhcmFtcyA9IHZpZGVvLT5lbmNQYXJhbXM7Ci0gICAgSW50IHdpZHRoID0gY3VyclZvcC0+d2lkdGg7IC8qIGhhcyB0byBiZSBWb3AsIGZvciBtdWx0aXBsZSBvZiAxNiAqLwotICAgIEludCBseCA9IGN1cnJWb3AtPnBpdGNoOyAvKiB3aXRoIHBhZGRpbmcgKi8KLSAgICBJbnQgb2Zmc2V0ID0gMDsKLSAgICBJbnQgaW5kX3gsIGluZF95OwotICAgIEludCBzdGFydF9wYWNrZXRfaGVhZGVyID0gMDsKLSAgICBVQ2hhciAqUVBNQiA9IHZpZGVvLT5RUE1COwotICAgIEludCBRUDsKLSAgICBJbnQgbWJudW0gPSAwLCBzbGljZV9jb3VudGVyID0gMCwgY3Vycl9zbGljZV9jb3VudGVyID0gMDsKLSAgICBJ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bGljZV9jb3VudGVyLCBRUCwgMCk7ICAvL2luZF95ICAgICAvKiBFbmNvZGUgR09CIEhlYWRlciAqLwotICAgICAgICAgICAgICAgIHZpZGVvLT5oZWFkZXJfYml0cyArPSBCaXRzdHJlYW1HZXRQb3MoY3VyclZvbC0+c3RyZWFtKTsgLyogSGVhZGVyIEJpdHMgKi8KLSAgICAgICAgICAgICAgICBjdXJyX3NsaWNlX2NvdW50ZXIgPSBzbGljZV9jb3VudGVyOwotICAgICAgICAgICAgfQotICAgICAgICB9Ci0KLSAgICAgICAgZm9yIChpbmRfeCA9IDA7IGluZF94IDwgY3VyclZvbC0+bk1CUGVyUm93OyBpbmRfeCsrKSAgLyogUm93IE1CIExvb3AgKi8KLSAgICAgICAgewotICAgICAgICAgICAgdmlkZW8tPm91dHB1dE1CLT5tYl94ID0gaW5kX3g7IC8qICA1LzI4LzAxICovCi0gICAgICAgICAgICB2aWRlby0+bWJudW0gPSBtYm51bTsKLSAgICAgICAgICAgIFFQID0gUVBNQlttYm51bV07ICAgLyogYWx3YXlzIHJlYWQgbmV3IFFQICovCi0KLSAgICAgICAgICAgIGlmIChHT0JfSGVhZGVyX0ludGVydmFsKQotICAgICAgICAgICAgICAgIHZpZGVvLT5zbGljZU5vW21ibnVtXSA9IGN1cnJfc2xpY2VfY291bnRlcjsgLyogVXBkYXRlIE1CIHNsaWNlIG51bWJlciAqLwotICAgICAgICAgICAgZWxzZQotICAgICAgICAgICAgICAgIHZpZGVvLT5zbGljZU5vW21ibnVtXSA9IHNsaWNlX2NvdW50ZXI7Ci0KLSAgICAgICAgICAgIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotICAgICAgICAgICAgLyogTUIgUHJlZGljdGlvbjpQdXQgaW50byBNQyBtYWNyb2Jsb2NrLCBzdWJzdHJhY3QgZnJvbSBjdXJyVm9wLCBwdXQgaW4gcHJlZE1CICovCi0gICAgICAgICAgICAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLSAgICAgICAgICAgIGdldE1vdGlvbkNvbXBlbnNhdGVkTUIodmlkZW8sIGluZF94LCBpbmRfeSwgb2Zmc2V0KTsKLQotI2lmbmRlZiBIMjYzX09OTFkKLSAgICAgICAgICAgIGlmIChzdGFydF9wYWNrZXRfaGVhZGVyKQotICAgICAgICAgICAgewotICAgICAgICAgICAgICAgIHNsaWNlX2NvdW50ZXIrKzsgICAgICAgICAgICAgICAgICAgICAgICAvKiBJbmNyZW1lbnQgc2xpY2UgY291bnRlciAqLwotICAgICAgICAgICAgICAgIHZpZGVvLT5zbGljZU5vW21ibnVtXSA9IHNsaWNlX2NvdW50ZXI7ICAvKiBVcGRhdGUgTUIgc2xpY2UgbnVtYmVyKi8KLSAgICAgICAgICAgICAgICB2aWRlby0+aGVhZGVyX2JpdHMgLT0gQml0c3RyZWFtR2V0UG9zKGJzMSk7IC8qIEhlYWRlciBCaXRzICovCi0gICAgICAgICAgICAgICAgdmlkZW8tPlFQX3ByZXYgPSBjdXJyVm9wLT5xdWFudGl6ZXI7Ci0gICAgICAgICAgICAgICAgc3RhdHVzID0gRW5jb2RlVmlkZW9QYWNrZXRIZWFkZXIodmlkZW8sIG1ibnVtLCB2aWRlby0+UVBfcHJldiwgMCk7Ci0gICAgICAgICAgICAgICAgdmlkZW8tPmhlYWRlcl9iaXRzICs9IEJpdHN0cmVhbUdldFBvcyhiczEpOyAvKiBIZWFkZXIgQml0cyAqLwotICAgICAgICAgICAgICAgIG51bUhlYWRlckJpdHMgPSBCaXRzdHJlYW1HZXRQb3MoYnMxKTsKLSAgICAgICAgICAgICAgICBzdGFydF9wYWNrZXRfaGVhZGVyID0gMDsKLSAgICAgICAgICAgICAgICB2aWRlby0+dXNlUHJldlFQID0gMDsKLSAgICAgICAgICAgIH0KLSNlbmRpZgotICAgICAgICAgICAgLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotICAgICAgICAgICAgLyogQ29kZV9NQjogIERDVCwgUSwgUV4oLTEpLCBJRENULCBNb3Rpb24gQ29tcCAqLwotICAgICAgICAgICAgLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotCi0gICAgICAgICAgICBzdGF0dXMgPSAoKkNvZGVNQikodmlkZW8sICZmYXN0RENUZnVuY3Rpb24sIChvZmZzZXQgPDwgNSkgKyBRUCwgbmNvZWZibGNrKTsKLQotICAgICAgICAgICAgLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLSAgICAgICAgICAgIC8qIE1CIFZMQyBFbmNvZGU6IFZMQyBFbmNvZGUgTUIgICAgICovCi0gICAgICAgICAgICAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotCi0gICAgICAgICAgICAoKk1CVmxjRW5jb2RlKSh2aWRlbywgbmNvZWZibGNrLCAodm9pZCopQmxvY2tDb2RlQ29lZmYpOwotCi0gICAgICAgICAgICAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLSAgICAgICAgICAgIC8qIEFzc2VtYmxlIFBhY2tldHM6ICBBc3NlbWJsZSB0aGUgTUIgVkxDIGNvZGVzIGludG8gUGFja2V0cyAqLwotICAgICAgICAgICAgLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0KLSAgICAgICAgICAgIC8qIEFzc2VtYmxlX1BhY2tldCh2aWRlbykgKi8KLSNpZm5kZWYgSDI2M19PTkxZCi0gICAgICAgICAgICBpZiAoIWN1cnJWb2wtPnNob3J0VmlkZW9IZWFkZXIpIC8qIE5vdCBpbiBTaG9ydFZpZGVvSGVhZGVyIG1vZGUgKi8KLSAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICBpZiAoIWN1cnJWb2wtPlJlc3luY01hcmtlckRpc2FibGUpIC8qIFJFU1lOQyBNQVJLRVIgTU9ERSAqLwotICAgICAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAgICAgbnVtX2JpdHMgPSBCaXRzdHJlYW1HZXRQb3MoYnMxKSAtIG51bUhlYWRlckJpdHM7Ci0gICAgICAgICAgICAgICAgICAgIGlmIChudW1fYml0cyA+IHBhY2tldF9zaXplKQotICAgICAgICAgICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgICAgICAgICB2aWRlby0+aGVhZGVyX2JpdHMgKz0gQml0c3RyZWFtTXBlZzRCeXRlQWxpZ25TdHVmZmluZyhiczEpOyAvKiBCeXRlIGFsaWduIFBhY2tldCAqLwotCi0gICAgICAgICAgICAgICAgICAgICAgICBzdGF0dXMgPSBCaXRzdHJlYW1BcHBlbmRQYWNrZXQoY3VyclZvbC0+c3RyZWFtLCBiczEpOyAvKiBQdXQgUGFja2V0IHRvIEJ1ZmZlciAqLwotICAgICAgICAgICAgICAgICAgICAgICAgLyogY29udGludWUgZXZlbiBpZiBzdGF0dXMgPT0gUFZfRU5EX09GX0JVRiwgdG8gZ2V0IHRoZSBzdGF0cyAqLwotCi0gICAgICAgICAgICAgICAgICAgICAgICBCaXRzdHJlYW1FbmNSZXNldChiczEpOwotCi0gICAgICAgICAgICAgICAgICAgICAgICBzdGFydF9wYWNrZXRfaGVhZGVyID0gMTsKLSAgICAgICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICBlbHNlICAgLyogTk8gUkVTWU5DIE1BUktFUiBNT0RFICovCi0gICAgICAgICAgICAgICAgewotICAgICAgICAgICAgICAgICAgICBzdGF0dXMgPSBCaXRzdHJlYW1BcHBlbmRFbmMoY3VyclZvbC0+c3RyZWFtLCBiczEpOyAvKiBJbml0aWFsaXplIHRvIDAgKi8KLSAgICAgICAgICAgICAgICAgICAgLyogY29udGludWUgZXZlbiBpZiBzdGF0dXMgPT0gUFZfRU5EX09GX0JVRiwgdG8gZ2V0IHRoZSBzdGF0cyAqLwotCi0gICAgICAgICAgICAgICAgICAgIEJpdHN0cmVhbUVuY1Jlc2V0KGJzMSk7Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgfQotICAgICAgICAgICAgZWxzZQotI2VuZGlmIC8qIEgyNjNfT05MWSAqLwotICAgICAgICAgICAgeyAgIC8qIFNob3J0VmlkZW9IZWFkZXIgTW9kZSAqLwotICAgICAgICAgICAgICAgIHN0YXR1cyA9IEJpdHN0cmVhbUFwcGVuZEVuYyhjdXJyVm9sLT5zdHJlYW0sIGJzMSk7ICAvKiBJbml0aWFsaXplIHRvIDAgKi8KLSAgICAgICAgICAgICAgICAvKiBjb250aW51ZSBldmVuIGlmIHN0YXR1cyA9PSBQVl9FTkRfT0ZfQlVGLCB0byBnZXQgdGhlIHN0YXRzICovCi0KLSAgICAgICAgICAgICAgICBCaXRzdHJlYW1FbmNSZXNldChiczEpOwotICAgICAgICAgICAgfQotICAgICAgICAgICAgbWJudW0rKzsKLSAgICAgICAgICAgIG9mZnNldCArPSAxNjsKLSAgICAgICAgfSAvKiBFbmQgb2YgRm9yIGluZF94ICovCi0KLSAgICAgICAgb2Zmc2V0ICs9IChseCA8PCA0KSAtIHdpZHRoOwotICAgICAgICBpZiAoY3VyclZvbC0+c2hvcnRWaWRlb0hlYWRlcikgIC8qIFNob3J0VmlkZW9IZWFkZXIgPSAxICovCi0gICAgICAgIHsKLQotICAgICAgICAgICAgaWYgKEdPQl9IZWFkZXJfSW50ZXJ2YWwpICBzbGljZV9jb3VudGVyKys7Ci0gICAgICAgIH0KLQotICAgIH0gLyogRW5kIG9mIEZvciBpbmRfeSAqLwotCi0gICAgaWYgKGN1cnJWb2wtPnNob3J0VmlkZW9IZWFkZXIpIC8qIFNob3J0VmlkZW9IZWFkZXIgPSAxICovCi0gICAgewotCi0gICAgICAgIHZpZGVv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gKi8KLQotICAgIHJldHVybiBzdGF0dXM7IC8qIGlmIHN0YXR1cyA9PSBQVl9FTkRfT0ZfQlVGLCB0aGlzIGZyYW1lIHdpbGwgYmUgcHJlLXNraXBwZWQgKi8KLX0KLQotI2lmbmRlZiBOT19TTElDRV9FTkNPREUKLS8qID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PSAqLwotLyogIEZ1bmN0aW9uIDogRW5jb2RlU2xpY2VDb21iaW5lZE1vZGUoKSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgRGF0ZSAgICAgOiAwNC8xOS8yMDAyICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICBIaXN0b3J5ICA6ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogIFB1cnBvc2UgIDogRW5jb2RlIGEgc2xpY2Ugb2YgTVBFRzQgYml0c3RyZWFtIGluIENvbWJpbmVkIG1vZGUgYW5kIHNhdmUgICovCi0vKiAgICAgICAgICAgICAgdGhlIGN1cnJlbnQgTUIgdG8gY29udGludWUgbmV4dCB0aW1lIGl0IGlzIGNhbGxlZC4gICAgICAgICAgKi8KLS8qICBJbi9vdXQgICA6ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogIFJldHVybiAgIDogIFBWX1NVQ0NFU1MgaWYgc3VjY2Vzc2Z1bCBlbHNlIFBWX0ZBSUwgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgTW9kaWZpZWQgOiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA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oZWFkZXJfYml0cyArPSBCaXRzdHJlYW1HZXRQb3MoYnMxKTsgLyogSGVhZGVyIEJpdHMgKi8KLSNlbmRpZgotICAgICAgICAgICAgZ290byBKVU1QX0lOX1NIOwotICAgICAgICB9Ci0gICAgICAgIGVsc2UgaWYgKGN1cnJWb2wtPlJlc3luY01hcmtlckRpc2FibGUpCi0gICAgICAgIHsKLSAgICAgICAgICAgIGdvdG8gSlVNUF9JTl9TSDsKLSAgICAgICAgfQotICAgICAgICBlbHNlCi0gICAgICAgIHsKLSAgICAgICAgICAgIHN0YXJ0X3BhY2tldF9oZWFkZXIgPSAxOwotICAgICAgICAgICAgZ290byBKVU1QX0lOOwotICAgICAgICB9Ci0gICAgfQotCi0gICAgZm9yIChpbmRfeSA9IDA7IGluZF95IDwgY3VyclZvbC0+bk1CUGVyQ29sOyBpbmRfeSsrKSAgICAvKiBDb2wgTUIgTG9vcCAqLwotICAgIHsKLQotICAgICAgICB2aWRlby0+b3V0cHV0TUItPm1iX3kgPSBpbmRfeTsgLyogIDUvMjgvMDEsIGRvIG5vdCByZW1vdmUgKi8KLQotICAgICAgICBmb3IgKGluZF94ID0gMDsgaW5kX3ggPCBjdXJyVm9sLT5uTUJQZXJSb3c7IGluZF94KyspICAvKiBSb3cgTUIgTG9vcCAqLwotICAgICAgICB7Ci0KLSAgICAgICAgICAgIHZpZGVvLT5vdXRwdXRNQi0+bWJfeCA9IGluZF94OyAvKiAgNS8yOC8wMSwgZG8gbm90IHJlbW92ZSAqLwotICAgICAgICAgICAgdmlkZW8tPm1ibnVtID0gbWJudW07Ci0gICAgICAgICAgICB2aWRlby0+c2xpY2VOb1ttYm51bV0gPSBzbGljZV9jb3VudGVyOyAgICAgIC8qIFVwZGF0ZSBNQiBzbGljZSBudW1iZXIgKi8KLUpVTVBfSU5fU0g6Ci0gICAgICAgICAgICAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLSAgICAgICAgICAgIC8qIE1CIFByZWRpY3Rpb246UHV0IGludG8gTUMgbWFjcm9ibG9jaywgc3Vic3RyYWN0IGZyb20gY3VyclZvcCwgcHV0IGluIHByZWRNQiAqLwotICAgICAgICAgICAgLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0gICAgICAgICAgICBnZXRNb3Rpb25Db21wZW5zYXRlZE1CKHZpZGVvLCBpbmRfeCwgaW5kX3ksIG9mZnNldCk7Ci0KLUpVTVBfSU46Ci0gICAgICAgICAgICBRUCA9IFFQTUJbbWJudW1dOyAgIC8qIGFsd2F5cyByZWFkIG5ldyBRUCAqLwotI2lmbmRlZiBIMjYzX09OTFkKLSAgICAgICAgICAgIGlmIChzdGFydF9wYWNrZXRfaGVhZGVyKQotICAgICAgICAgICAgewotICAgICAgICAgICAgICAgIHNsaWNlX2NvdW50ZXIrKzsgICAgICAgICAgICAgICAgICAgICAgICAvKiBJbmNyZW1lbnQgc2xpY2UgY291bnRlciAqLwotICAgICAgICAgICAgICAgIHZpZGVvLT5zbGljZU5vW21ibnVtXSA9IHNsaWNlX2NvdW50ZXI7ICAvKiBVcGRhdGUgTUIgc2xpY2UgbnVtYmVyKi8KLSAgICAgICAgICAgICAgICB2aWRlby0+UVBfcHJldiA9IGN1cnJWb3AtPnF1YW50aXplcjsgICAgICAgICAgICAgICAgICAgICAgICAvKiBzdG9yZSBRUCAqLwotICAgICAgICAgICAgICAgIG51bV9iaXRzID0gQml0c3RyZWFtR2V0UG9zKGJzMSk7Ci0gICAgICAgICAgICAgICAgc3RhdHVzID0gRW5jb2RlVmlkZW9QYWNrZXRIZWFkZXIodmlkZW8sIG1ibnVtLCB2aWRlby0+UVBfcHJldiwgMSk7Ci0gICAgICAgICAgICAgICAgbnVtSGVhZGVyQml0cyA9IEJpdHN0cmVhbUdldFBvcyhiczEpIC0gbnVtX2JpdHM7Ci0gICAgICAgICAgICAgICAgdmlkZW8tPmhlYWRlcl9iaXRzICs9IG51bUhlYWRlckJpdHM7IC8qIEhlYWRlciBCaXRzICovCi0gICAgICAgICAgICAgICAgc3RhcnRfcGFja2V0X2hlYWRlciA9IDA7Ci0gICAgICAgICAgICAgICAgdmlkZW8tPnVzZVByZXZRUCA9IDA7Ci0gICAgICAgICAgICB9Ci0gICAgICAgICAgICBlbHNlICAvKiBkb24ndCBlbmNvZGUgdGhlIGZpcnN0IE1CIGluIHBhY2tldCBhZ2FpbiAqLwotI2VuZGlmIC8qIEgyNjNfT05MWSAqLwotICAgICAgICAgICAgewotICAgICAgICAgICAgICAgIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLSAgICAgICAgICAgICAgICAvKiBDb2RlX01COiAgRENULCBRLCBRXigtMSksIElEQ1QsIE1vdGlvbiBDb21wICovCi0gICAgICAgICAgICAgICAgLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotICAgICAgICAgICAgICAgIHN0YXR1cyA9ICgqQ29kZU1CKSh2aWRlbywgJmZhc3REQ1RmdW5jdGlvbiwgKG9mZnNldCA8PCA1KSArIFFQLCBuY29lZmJsY2spOwotICAgICAgICAgICAgfQotCi0gICAgICAgICAgICAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotICAgICAgICAgICAgLyogTUIgVkxDIEVuY29kZTogVkxDIEVuY29kZSBNQiAgICAgKi8KLSAgICAgICAgICAgIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0KLSAgICAgICAgICAgIC8qIHNhdmUgdGhlIHN0YXRlIGJlZm9yZSBWTEMgZW5jb2RpbmcgKi8KLSAgICAgICAgICAgIGlmIChyZXN5bmNfbWFya2VyKQotICAgICAgICAgICAgewotICAgICAgICAgICAgICAgIGJpdENvdW50ID0gQml0c3RyZWFtR2V0UG9zKGJzMSk7Ci0gICAgICAgICAgICAgICAgYnl0ZUNvdW50ID0gYml0Q291bnQgPj4gMzsgLyogc2F2ZSB0aGUgc3RhdGUgYmVmb3JlIGVuY29kaW5nICovCi0gICAgICAgICAgICAgICAgYml0Q291bnQgPSBiaXRDb3VudCAmIDB4NzsKLSAgICAgICAgICAgICAgICBtb2RlID0gTW9kZVttYm51bV07Ci0gICAgICAgICAgICAgICAgQ0JQID0gdmlkZW8tPmhlYWRlckluZm8uQ0JQW21ibnVtXTsKLSAgICAgICAgICAgICAgICBmb3IgKGsgPSAwOyBrIDwgNjsgaysrKQotICAgICAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAgICAgTTRWRU5DX01FTUNQWShvdXRwdXRNQltrXSwgdmlkZW8tPm91dHB1dE1CLT5ibG9ja1trXSwgc2l6ZW9mKFNob3J0KSA8PCA2KTsKLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICB9Ci0gICAgICAgICAgICAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLQotICAgICAgICAgICAgKCpNQlZsY0VuY29kZSkodmlkZW8sIG5jb2VmYmxjaywgKHZvaWQqKUJsb2NrQ29kZUNvZWZmKTsKLQotICAgICAgICAgICAgLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0gICAgICAgICAgICAvKiBBc3NlbWJsZSBQYWNrZXRzOiAgQXNzZW1ibGUgdGhlIE1CIFZMQyBjb2RlcyBpbnRvIFBhY2tldHMgKi8KLSAgICAgICAgICAgIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotCi0gICAgICAgICAgICAvKiBBc3NlbWJsZV9QYWNrZXQodmlkZW8pICovCi0jaWZuZGVmIEgyNjNfT05MWQotICAgICAgICAgICAgaWYgKCFjdXJyVm9sLT5zaG9ydFZpZGVvSGVhZGVyKQotICAgICAgICAgICAgewotICAgICAgICAgICAgICAgIGlmICghY3VyclZvbC0+UmVzeW5jTWFya2VyRGlzYWJsZSkKLSAgICAgICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgICAgIC8qIE5vdCBpbiBTaG9ydFZpZGVvSGVhZGVyIG1vZGUgYW5kIFJFU1lOQyBNQVJLRVIgTU9ERSAqLwotCi0gICAgICAgICAgICAgICAgICAgIG51bV9iaXRzID0gQml0c3RyZWFtR2V0UG9zKGJzMSkgOy8vLSBudW1IZWFkZXJCaXRzOyAvLyBpbmNsdWRlIGhlYWRlcgotCi0gICAgICAgICAgICAgICAgICAgIC8qIEFzc2VtYmxlIHBhY2tldCBhbmQgcmV0dXJuIHdoZW4gc2l6ZSByZWFjaGVkICovCi0gICAgICAgICAgICAgICAgICAgIGlmIChudW1fYml0cyA+IHBhY2tldF9zaXplICYmIG1ibnVtICE9IGZpcnN0TUIpCi0gICAgICAgICAgICAgICAgICAgIHsKLQotICAgICAgICAgICAgICAgICAgICAgICAgQml0c3RyZWFtUmVwb3MoYnMxLCBieXRlQ291bnQsIGJpdENvdW50KTsgLyogcmV3aW5kIG9uZSBNQiAqLwotCi0gICAgICAgICAgICAgICAgICAgICAgICB2aWRlby0+aGVhZGVyX2JpdHMgKz0gQml0c3RyZWFtTXBlZzRCeXRlQWxpZ25TdHVmZmluZyhiczEpOyAvKiBCeXRlIGFsaWduIFBhY2tldCAqLwotCi0gICAgICAgICAgICAgICAgICAgICAgICBzdGF0dXMgPSBCaXRzdHJlYW1BcHBlbmRQYWNrZXROb09mZnNldChjdXJyVm9sLT5zdHJlYW0sIGJzMSk7IC8qIFB1dCBQYWNrZXQgdG8gQnVmZmVyICovCi0KLSAgICAgICAgICAgICAgICAgICAgICAgIGlmIChzdGF0dXMgPT0gUFZfRU5EX09GX0JVRikKLSAgICAgICAgICAgICAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICB2aWRlby0+ZW5kX29mX2J1ZiA9IDE7Ci0gICAgICAgICAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgICAgICAgICBlbHNlCi0gICAgICAgICAgICAgICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgQml0c3RyZWFtRW5jUmVzZXQoYnMxKTsKLSAgICAgICAgICAgICAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgICAgICAgICAgICAgc3RhcnRfcGFja2V0X2hlYWRlciA9IDE7Ci0KLSAgICAgICAgICAgICAgICAgICAgICAgIGlmIChtYm51bSA8IG5Ub3RhbE1CIHx8IHZpZGVvLT5lbmRfb2ZfYnVmKSAvKiByZXR1cm4gaGVyZSAqLwotICAgICAgICAgICAgICAgICAgICAgICAgewotICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZpZGVvLT5tYm51bSA9IG1ibnVtOwotICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZpZGVvLT5zbGljZU5vW21ibnVtXSA9IHNsaWNlX2NvdW50ZXI7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgdmlkZW8tPm9mZnNldCA9IG9mZnNldDsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBNb2RlW21ibnVtXSA9IG1vZGU7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgdmlkZW8tPmhlYWRlckluZm8uQ0JQW21ibnVtXSA9IENCUDsKLQotICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZvciAoayA9IDA7IGsgPCA2OyBrKyspCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgewotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBNNFZFTkNfTUVNQ1BZKHZpZGVvLT5vdXRwdXRNQi0+YmxvY2tba10sIG91dHB1dE1CW2tdLCBzaXplb2YoU2hvcnQpIDw8IDYpOwotICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBzdGF0dXM7Ci0gICAgICAgICAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgZWxzZSAgLyogTk8gUkVTWU5DIE1BUktFUiAsIHJldHVybiB3aGVuIGJ1ZmZlciBpcyBmdWxsKi8KLSAgICAgICAgICAgICAgICB7Ci0KLSAgICAgICAgICAgICAgICAgICAgaWYgKG1ibnVtIDwgblRvdGFsTUIgLSAxICYmIGN1cnJWb2wtPnN0cmVhbS0+Ynl0ZUNvdW50ICsgYnMxLT5ieXRlQ291bnQgKyAxID49IGN1cnJWb2wtPnN0cmVhbS0+YnVmZmVyU2l6ZSkKLSAgICAgICAgICAgICAgICAgICAgewotICAgICAgICAgICAgICAgICAgICAgICAgLyogZmluZCBtYXhpbXVtIGJ5dGVzIHRvIGZpdCBpbiB0aGUgYnVmZmVyICovCi0gICAgICAgICAgICAgICAgICAgICAgICBieXRlQ291bnQgPSBjdXJyVm9sLT5zdHJlYW0tPmJ1ZmZlclNpemUgLSBjdXJyVm9sLT5zdHJlYW0tPmJ5dGVDb3VudCAtIDE7Ci0KLSAgICAgICAgICAgICAgICAgICAgICAgIG51bV9iaXRzID0gQml0c3RyZWFtR2V0UG9zKGJzMSkgLSAoYnl0ZUNvdW50IDw8IDMpOwotICAgICAgICAgICAgICAgICAgICAgICAgQml0c3RyZWFtUmVwb3MoYnMxLCBieXRlQ291bnQsIDApOwotICAgICAgICAgICAgICAgICAgICAgICAgc3RhdHVzID0gQml0c3RyZWFtQXBwZW5kUGFja2V0Tm9PZmZzZXQoY3VyclZvbC0+c3RyZWFtLCBiczEpOwotICAgICAgICAgICAgICAgICAgICAgICAgQml0c3RyZWFtRmx1c2hCaXRzKGJzMSwgbnVtX2JpdHMpOwotCi0gICAgICAgICAgICAgICAgICAgICAgICAvKiBtb3ZlIG9uIHRvIG5leHQgTUIgKi8KLSAgICAgICAgICAgICAgICAgICAgICAgIG1ibnVtKysgOwotICAgICAgICAgICAgICAgICAgICAgICAgb2Zmc2V0ICs9IDE2OwotICAgICAgICAgICAgICAgICAgICAgICAgdmlkZW8tPm91dHB1dE1CLT5tYl94Kys7Ci0gICAgICAgICAgICAgICAgICAgICAgICBpZiAodmlkZW8tPm91dHB1dE1CLT5tYl94ID49IGN1cnJWb2wtPm5NQlBlclJvdykKLSAgICAgICAgICAgICAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICB2aWRlby0+b3V0cHV0TUItPm1iX3ggPSAwOwotICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZpZGVvLT5vdXRwdXRNQi0+bWJfeSsrOwotICAgICAgICAgICAgICAgICAgICAgICAgICAgIG9mZnNldCArPSAobHggPDwgNCkgLSB3aWR0aDsKLSAgICAgICAgICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICAgICAgICAgIHZpZGVvLT5tYm51bSA9IG1ibnVtOwotICAgICAgICAgICAgICAgICAgICAgICAgdmlkZW8tPm9mZnNldCA9IG9mZnNldDsKLSAgICAgICAgICAgICAgICAgICAgICAgIHZpZGVvLT5zbGljZU5vW21ibnVtXSA9IHNsaWNlX2NvdW50ZXI7Ci0gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gc3RhdHVzOwotICAgICAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgfQotI2VuZGlmIC8qIEgyNjNfT05MWSAqLwotICAgICAgICAgICAgb2Zmc2V0ICs9IDE2OwotICAgICAgICAgICAgbWJudW0rKzsgLyogaGFzIHRvIGluY3JlbWVudCBiZWZvcmUgU0NELCB0byBwcmVzZXJ2ZSBNb2RlW21ibnVtXSAqLwotCi0gICAgICAgIH0gLyogRW5kIG9mIEZvciBpbmRfeCAqLwotCi0gICAgICAgIG9mZnNldCArPSAobHggPDwgNCkgLSB3aWR0aDsKLQotICAgICAgICBpZiAoY3VyclZvbC0+c2hvcnRWaWRlb0hlYWRlcikgIC8qIFNob3J0VmlkZW9IZWFkZXIgPSAxICovCi0gICAgICAgIHsKLSNpZmRlZiBIMjYzX0dPQl9DSEFOR0VTCi0gICAgICAgICAgICBzbGljZV9jb3VudGVyKys7Ci0gICAgICAgICAgICB2aWRlby0+aGVhZGVyX2JpdHMgKz0gQml0c3RyZWFtU2hvcnRIZWFkZXJCeXRlQWxpZ25TdHVmZmluZyhiczEpOwotI2VuZGlmCi0gICAgICAgICAgICAvL3ZpZGVvLT5oZWFkZXJfYml0cys9Qml0c3RyZWFtU2hvcnRIZWFkZXJCeXRlQWxpZ25TdHVmZmluZyhiczEpOwotCi0gICAgICAgICAgICAvKiBjaGVjayBpZiB0aW1lIHRvIHBhY2tldGl6ZSAqLwotICAgICAgICAgICAgaWYgKGN1cnJWb2wtPnN0cmVhbS0+Ynl0ZUNvdW50ICsgYnMxLT5ieXRlQ291bnQgPiBjdXJyVm9sLT5zdHJlYW0tPmJ1ZmZlclNpemUpCi0gICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgaWYgKGJ5dGVDb3VudCA9PSBieXRlQ291bnQxKSAvKiBhIHNpbmdsZSBHT0IgYmlnZ2VyIHRoYW4gcGFja2V0IHNpemUgKi8KLSAgICAgICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgICAgIHN0YXR1cyA9IEJpdHN0cmVhbUFwcGVuZFBhY2tldE5vT2Zmc2V0KGN1cnJWb2wtPnN0cmVhbSwgYnMxKTsKLSAgICAgICAgICAgICAgICAgICAgc3RhdHVzID0gUFZfRU5EX09GX0JVRjsKLSAgICAgICAgICAgICAgICAgICAgdmlkZW8tPmVuZF9vZl9idWYgPSAxOwotICAgICAgICAgICAgICAgICAgICBzdGFydF9wYWNrZXRfaGVhZGVyID0gMTsKLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgZWxzZSAgICAvKiBmb3Igc2hvcnRfaGVhZGVyIHNjb29jaCBiYWNrIHRvIHByZXZpb3VzIEdPQiAqLwotICAgICAgICAgICAgICAgIHsKLSAgICAgICAgICAg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RfcGFja2V0X2hlYWRlciA9IDE7Ci0gICAgICAgICAgICAgICAgICAgIGlmIChtYm51bSA9PSBuVG90YWxNQikgLyogdGhlcmUncyBvbmUgbW9yZSBHT0IgdG8gcGFja2V0aXplIGZvciB0aGUgbmV4dCByb3VuZCAqLwotICAgICAgICAgICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgICAgICAgICBzdGF0dXMgPSBQVl9FTkRfT0ZfQlVGOwotICAgICAgICAgICAgICAgICAgICAgICAgdmlkZW8tPmVuZF9vZl9idWYgPSAxOwotICAgICAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgfQotCi0gICAgICAgICAgICAgICAgaWYgKG1ibnVtIDwgblRvdGFsTUIpIC8qIHJldHVybiBoZXJlICovCi0gICAgICAgICAgICAgICAgewotICAgICAgICAgICAgICAgICAgICAvKiBtb3ZlIG9uIHRvIG5leHQgTUIgKi8KLSAgICAgICAgICAgICAgICAgICAgdmlkZW8tPm91dHB1dE1CLT5tYl94ID0gMDsKLSAgICAgICAgICAgICAgICAgICAgdmlkZW8tPm91dHB1dE1CLT5tYl95Kys7Ci0gICAgICAgICAgICAgICAgICAgIHZpZGVvLT5tYm51bSA9IG1ibnVtOwotICAgICAgICAgICAgICAgICAgICB2aWRlby0+b2Zmc2V0ID0gb2Zmc2V0OwotICAgICAgICAgICAgICAgICAgICB2aWRlby0+c2xpY2VOb1ttYm51bV0gPSBzbGljZV9jb3VudGVyOwotICAgICAgICAgICAgICAgICAgICByZXR1cm4gc3RhdHVzOwotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgIH0KLSAgICAgICAgICAgIGVsc2UgaWYgKG1ibnVtIDwgblRvdGFsTUIpIC8qIGRvIG5vdCB3cml0ZSBHT0IgaGVhZGVyIGlmIGVuZCBvZiB2b3AgKi8KLSAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICBiaXRDb3VudCA9IEJpdHN0cmVhbUdldFBvcyhiczEpOwotICAgICAgICAgICAgICAg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jdXJyVm9sLT5zdHJlYW0sIGJzMSk7ICAgLyogUHV0IFBhY2tldCB0byBCdWZmZXIgKi8KLSAgICAgICAgICAgICAgICBpZiAoc3RhdHVzID09IFBWX0VORF9PRl9CVUYpCi0gICAgICAgICAgICAgICAgewotICAgICAgICAgICAgICAgICAgICB2aWRlby0+ZW5kX29mX2J1ZiA9IDE7Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgIGVsc2UKLSAgICAgICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgICAgIEJpdHN0cmVhbUVuY1Jlc2V0KGJzMSk7Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgfQotICAgICAgICB9Ci0gICAgICAgIGVsc2UgICAvKiBObyBSZXN5bmMgTWFya2VycyAqLwotICAgICAgICB7Ci0gICAgICAgICAgICB2aWRlby0+aGVhZGVyX2JpdHMgKz0gQml0c3RyZWFtTXBlZzRCeXRlQWxpZ25TdHVmZmluZyhiczEpOyAvKiBCeXRlIEFsaWduICovCi0gICAgICAgICAgICBzdGF0dXMgPSBCaXRzdHJlYW1BcHBlbmRQYWNrZXROb09mZnNldChjdXJyVm9sLT5zdHJlYW0sIGJzMSk7IC8qIEluaXRpYWxpemUgdG8gMCAqLwotICAgICAgICAgICAgaWYgKHN0YXR1cyA9PSBQVl9FTkRfT0ZfQlVGKQotICAgICAgICAgICAgewotICAgICAgICAgICAgICAgIHZpZGVvLT5lbmRfb2ZfYnVmID0gMTsKLSAgICAgICAgICAgIH0KLSAgICAgICAgICAgIGVsc2UKLSAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICBCaXRzdHJlYW1FbmNSZXNldChiczEpOwotICAgICAgICAgICAgfQotICAgICAgICB9Ci0gICAgfQotICAgIGVsc2UKLSNlbmRpZiAvKiBIMjYzX09OTFkgKi8KLSAgICB7Ci0gICAgICAgIGlmICghc3RhcnRfcGFja2V0X2hlYWRlcikgLyogbm90IHlldCBwYWNrZXRpemVkICovCi0gICAgICAgIHsKLSAgICAgICAgICAgIHZpZGVvLT5oZWFkZXJfYml0cyArPSBCaXRzdHJlYW1TaG9ydEhlYWRlckJ5dGVBbGlnblN0dWZmaW5nKGJzMSk7Ci0gICAgICAgICAgICBzdGF0dXMgPSBCaXRzdHJlYW1BcHBlbmRQYWNrZXROb09mZnNldChjdXJyVm9sLT5zdHJlYW0sIGJzMSk7Ci0gICAgICAgICAgICBpZiAoc3RhdHVzID09IFBWX0VORF9PRl9CVUYpCi0gICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgdmlkZW8tPmVuZF9vZl9idWYgPSAxOwotICAgICAgICAgICAgfQotICAgICAgICAgICAgZWxzZQotICAgICAgICAgICAgewotICAgICAgICAgICAgICAgIEJpdHN0cmVhbUVuY1Jlc2V0KGJzMSk7Ci0gICAgICAgICAgICAgICAgdmlkZW8tPmVuZF9vZl9idWYgPSAwOwotICAgICAgICAgICAgfQotICAgICAgICB9Ci0gICAgfQotCi0gICAgdmlkZW8tPm1ibnVtID0gbWJudW07Ci0gICAgaWYgKG1ibnVtIDwgblRvdGFsTUIpCi0gICAgICAgIHZpZGVvLT5zbGljZU5vW21ibnVtXSA9IHNsaWNlX2NvdW50ZXI7Ci0gICAgdmlkZW8tPm9mZnNldCA9IG9mZnNldDsKLQotICAgIHJldHVybiBzdGF0dXM7Ci19Ci0jZW5kaWYgIC8qIE5PX1NMSUNFX0VOQ09ERSAqLwotCi0vKiA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0gKi8KLS8qICBGdW5jdGlvbiA6IEVuY29kZUdPQkhlYWRlcigpICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogIERhdGUgICAgIDogMDkvMDUvMjAwMCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgSGlzdG9yeSAgOiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICBQdXJwb3NlICA6IEVuY29kZSBhIGZyYW1lIG9mIE1QRUc0IGJpdHN0cmVhbSBpbiBDb21iaW5lZCBtb2RlLiAgICAgICAgICAqLwotLyogIEluL291dCAgIDogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgUmV0dXJuICAgOiAgUFZfU1VDQ0VTUyBpZiBzdWNjZXNzZnVsIGVsc2UgUFZfRkFJTCAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICBNb2RpZmllZCA6ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0gKi8KLQotUFZfU1RBVFVTIEVuY29kZUdPQkhlYWRlcihWaWRlb0VuY0RhdGEgKnZpZGVvLCBJbnQgR09CX251bWJlciwgSW50IHF1YW50X3NjYWxlLCBJbnQgYnMxc3RyZWFtKQotewotICAgIFBWX1NUQVRVUyBzdGF0dXMgPSBQVl9TVUNDRVNTOwotICAgIEJpdHN0cmVhbUVuY1ZpZGVvICpzdHJlYW0gPSAoYnMxc3RyZWFtID8gdmlkZW8tPmJpdHN0cmVhbTEgOiB2aWRlby0+dm9sW3ZpZGVvLT5jdXJyTGF5ZXJdLT5zdHJlYW0pOwotCi0gICAgc3RhdHVzID0gQml0c3RyZWFtUHV0R1QxNkJpdHMoc3RyZWFtLCAxNywgR09CX1JFU1lOQ19NQVJLRVIpOyAvKiBnb2JfcmVzeW5jX21hcmtlciAqLwotICAgIHN0YXR1cyA9IEJpdHN0cmV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ICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICBEYXRlICAgICA6IDA5LzYvMjAwMCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogIEhpc3RvcnkgIDogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgUHVycG9zZSAgOiBFbmNvZGUgYSBmcmFtZSBvZiBNUEVHNCBiaXRzdHJlYW0gaW4gZGF0YXBhcnRpdGlvbmluZyBtb2RlLiAgKi8KLS8qICBJbi9vdXQgICA6ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogIFJldHVybiAgIDogIFBWX1NVQ0NFU1MgaWYgc3VjY2Vzc2Z1bCBlbHNlIFBWX0ZBSUwgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgTW9kaWZpZWQgOiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09ICovCi1QVl9TVEFUVVMgRW5jb2RlRnJhbWVEYXRhUGFydE1vZGUoVmlkZW9FbmNEYXRhICp2aWRlbykKLXsKLSAgICBQVl9TVEFUVVMgc3RhdHVzID0gUFZfU1VDQ0VTUzsKLSAgICBWb2wgKmN1cnJWb2wgPSB2aWRlby0+dm9sW3ZpZGVvLT5jdXJyTGF5ZXJdOwotICAgIFZvcCAqY3VyclZvcCA9IHZpZGVvLT5jdXJyVm9wOwotICAgIFZpZGVvRW5jUGFyYW1zICplbmNQYXJhbXMgPSB2aWRlby0+ZW5jUGF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ZWFkZXI7Ci0jaWZuZGVmIE5PX1JWTEMKLSAgICBlbHNlIGlmIChjdXJyVm9sLT51c2VSZXZlcnNlVkxDKQotICAgICAgICBCbG9ja0NvZGVDb2VmZiA9ICZCbG9ja0NvZGVDb2VmZl9SVkxDOwotI2VuZGlmCi0gICAgZWxzZQotICAgICAgICBCbG9ja0NvZGVDb2VmZiA9ICZCbG9ja0NvZGVDb2VmZl9Ob3JtYWw7Ci0KLSAgICB2aWRlby0+dXNlUHJldlFQID0gMDsKLQotICAgIGZvciAoaW5kX3kgPSAwOyBpbmRfeSA8IGN1cnJWb2wtPm5NQlBlckNvbDsgaW5kX3krKykgICAgLyogQ29sIE1CIExvb3AgKi8KLSAgICB7Ci0KLSAgICAgICAgdmlkZW8tPm91dHB1dE1CLT5tYl95ID0gaW5kX3k7IC8qICA1LzI4LzAxICovCi0KLSAgICAgICAgZm9yIChpbmRfeCA9IDA7IGluZF94IDwgY3VyclZvbC0+bk1CUGVyUm93OyBpbmRfeCsrKSAgLyogUm93IE1CIExvb3AgKi8KLSAgICAgICAgewotICAgICAgICAgICAgdmlkZW8tPm91dHB1dE1CLT5tYl94ID0gaW5kX3g7IC8qICA1LzI4LzAxICovCi0gICAgICAgICAgICB2aWRlby0+bWJudW0gPSBtYm51bTsKLSAgICAgICAgICAgIHZpZGVvLT5zbGljZU5vW21ibnVtXSA9IHNsaWNlX2NvdW50ZXI7ICAgICAgLyogVXBkYXRlIE1CIHNsaWNlIG51bWJlciAqLwotICAgICAgICAgICAgUVAgPSBRUE1CW21ibnVtXTsgICAvKiBhbHdheXMgcmVhZCBuZXcgUVAgKi8KLQotICAgICAgICAgICAgLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0gICAgICAgICAgICAvKiBNQiBQcmVkaWN0aW9uOlB1dCBpbnRvIE1DIG1hY3JvYmxvY2ssIHN1YnN0cmFjdCBmcm9tIGN1cnJWb3AsIHB1dCBpbiBwcmVkTUIgKi8KLSAgICAgICAgICAgIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotCi0gICAgICAgICAgICBnZXRNb3Rpb25Db21wZW5zYXRlZE1CKHZpZGVvLCBpbmRfeCwgaW5kX3ksIG9mZnNldCk7Ci0KLSAgICAgICAgICAgIGlmIChzdGFydF9wYWNrZXRfaGVhZGVyKQotICAgICAgICAgICAgewotICAgICAgICAgICAgICAgIHNsaWNlX2NvdW50ZXIrKzsgICAgICAgICAgICAgICAgICAgICAgICAvKiBJbmNyZW1lbnQgc2xpY2UgY291bnRlciAqLwotICAgICAgICAgICAgICAgIHZpZGVvLT5zbGljZU5vW21ibnVtXSA9IHNsaWNlX2NvdW50ZXI7ICAvKiBVcGRhdGUgTUIgc2xpY2UgbnVtYmVyKi8KLSAgICAgICAgICAgICAgICB2aWRlby0+aGVhZGVyX2JpdHMgLT0gQml0c3RyZWFtR2V0UG9zKGJzMSk7IC8qIEhlYWRlciBCaXRzICovCi0gICAgICAgICAgICAgICAgdmlkZW8tPlFQX3ByZXYgPSBjdXJyVm9wLT5xdWFudGl6ZXI7ICAgICAgICAgICAgICAgICAgICAgICAgLyogc3RvcmUgUVAgKi8KLSAgICAgICAgICAgICAgICBzdGF0dXMgPSBFbmNvZGVWaWRlb1BhY2tldEhlYWRlcih2aWRlbywgbWJudW0sIHZpZGVvLT5RUF9wcmV2LCAwKTsKLSAgICAgICAgICAgICAgICB2aWRlby0+aGVhZGVyX2JpdHMgKz0gQml0c3RyZWFtR2V0UG9zKGJzMSk7IC8qIEhlYWRlciBCaXRzICovCi0gICAgICAgICAgICAgICAgbnVtSGVhZGVyQml0cyA9IEJpdHN0cmVhbUdldFBvcyhiczEpOwotICAgICAgICAgICAgICAgIHN0YXJ0X3BhY2tldF9oZWFkZXIgPSAwOwotICAgICAgICAgICAgICAgIHZpZGVvLT51c2VQcmV2UVAgPSAwOwotICAgICAgICAgICAgfQotCi0gICAgICAgICAgICAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0gICAgICAgICAgICAvKiBDb2RlX01COiAgRENULCBRLCBRXigtMSksIElEQ1QsIE1vdGlvbiBDb21wICovCi0gICAgICAgICAgICAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0KLSAgICAgICAgICAgIHN0YXR1cyA9ICgqQ29kZU1CKSh2aWRlbywgJmZhc3REQ1RmdW5jdGlvbiwgKG9mZnNldCA8PCA1KSArIFFQLCBuY29lZmJsY2spOwotCi0gICAgICAgICAgICAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotICAgICAgICAgICAgLyogTUIgVkxDIEVuY29kZTogVkxDIEVuY29kZSBNQiAgICAgKi8KLSAgICAgICAgICAgIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0KLSAgICAgICAgICAgIE1CVmxjRW5jb2RlKHZpZGVvLCBuY29lZmJsY2ssICh2b2lkKilCbG9ja0NvZGVDb2VmZik7Ci0KLSAgICAgICAgICAgIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotICAgICAgICAgICAgLyogQXNzZW1ibGUgUGFja2V0czogIEFzc2VtYmxlIHRoZSBNQiBWTEMgY29kZXMgaW50byBQYWNrZXRzICovCi0gICAgICAgICAgICAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLQotICAgICAgICAgICAgLyogSU5DTFVERSBWT1AgSEVBREVSIElOIENPVU5UICovCi0KLSAgICAgICAgICAgIG51bV9iaXRzID0gQml0c3RyZWFtR2V0UG9zKGJzMSkgKyBCaXRzdHJlYW1HZXRQb3MoYnMyKSArCi0gICAgICAgIC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dHMgKi8KLQotICAgICAgICAgICAgICAgIEJpdHN0cmVhbUVuY1Jlc2V0KGJzMSk7IC8qIEluaXRpYWxpemUgdG8gMCAqLwotICAgICAgICAgICAgICAgIEJpdHN0cmVhbUVuY1Jlc2V0KGJzMik7Ci0gICAgICAgICAgICAgICAgQml0c3RyZWFtRW5jUmVzZXQoYnMzKTsKLSAgICAgICAgICAgICAgICBzdGFydF9wYWNrZXRfaGVhZGVyID0gMTsKLSAgICAgICAgICAgIH0KLSAgICAgICAgICAgIG1ibnVtKys7Ci0gICAgICAgICAgICBvZmZzZXQgKz0gMTY7Ci0gICAgICAgIH0gLyogRW5kIG9mIEZvciBpbmRfeCAqLwotCi0gICAgICAgIG9mZnNldCArPSAobHggPDwgNCkgLSB3aWR0aDsKLSAgICB9IC8qIEVuZCBvZiBGb3IgaW5kX3kgKi8KLQotICAgIGlmICghc3RhcnRfcGFja2V0X2hlYWRlcikKLSAgICB7Ci0gICAgICAgIGlmICh2aWRlby0+Y3VyclZvcC0+cHJlZGljdGlvblR5cGUgPT0gSV9WT1ApCi0gICAgICAgIHsKLSAgICAgICAgICAgIEJpdHN0cmVhbVB1dEdUMTZCaXRzKGJzMSwgMTksIERDX01BUktFUik7ICAgLyogQWRkIGRjX21hcmtlciAqLwotICAgICAgICAgICAgdmlkZW8tPmhlYWRlcl9iaXRzICs9IDE5OwotICAgICAgICB9Ci0gICAgICAgIGVsc2UKLSAgICAgICAgewotICAgICAgICAgICAgQml0c3RyZWFtUHV0R1QxNkJpdHMoYnMxLCAxNywgTU9USU9OX01BUktFUl9DT01CKTsgLyogQWRkIG1vdGlvbl9tYXJrZXIgKi8KLSAgICAgICAgICAgIHZpZGVvLT5oZWFkZXJfYml0cyArPSAxNzsKLSAgICAgICAgfQotICAgICAgICBCaXRzdHJlYW1BcHBlbmRFbmMoYnMxLCBiczIpOwotICAgICAgICBCaXRzdHJlYW1BcHBlbmRFbmMoYnMxLCBiczMpOwotICAgICAgICB2aWRlby0+aGVhZGVyX2JpdHMgKz0gQml0c3RyZWFtTXBlZzRCeXRlQWxpZ25TdHVmZmluZyhiczEpOyAvKiBCeXRlIGFsaWduIFBhY2tldCAqLwotICAgICAgICBzdGF0dXMgPSBCaXRzdHJlYW1BcHBlbmRQYWNrZXQoY3VyclZvbC0+c3RyZWFtLCBiczEpOyAvKiBQdXQgUGFja2V0IHRvIEJ1ZmZlciAqLwotICAgICAgICAvKiBjb250aW51ZSBldmVuIGlmIHN0YXR1cyA9PSBQVl9FTkRfT0ZfQlVGLCB0byBnZXQgdGhlIHN0YXRzICovCi0gICAgICAgIEJpdHN0cmVhbUVuY1Jlc2V0KGJzMSk7IC8qIEluaXRpYWxpemUgdG8gMCAqLwotICAgICAgICBCaXRzdHJlYW1FbmNSZXNldChiczIpOwotICAgICAgICBCaXRzdHJlYW1FbmNSZXNldChiczMpOwotICAgIH0KLQotICAgIHJldHVybiBzdGF0dXM7IC8qIGlmIHN0YXR1cyA9PSBQVl9FTkRfT0ZfQlVGLCB0aGlzIGZyYW1lIHdpbGwgYmUgcHJlLXNraXBwZWQgKi8KLX0KLQotI2lmbmRlZiAgTk9fU0xJQ0VfRU5DT0RFCi0vKiA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0gKi8KLS8qICBGdW5jdGlvbiA6IEVuY29kZVNsaWNlRGF0YVBhcnRNb2RlKCkgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogIERhdGUgICAgIDogMDQvMTkvMjAwMiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgSGlzdG9yeSAgOiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICBQdXJwb3NlICA6IEVuY29kZSBhIHNsaWNlIG9mIE1QRUc0IGJpdHN0cmVhbSBpbiBEYXRhUGFyIG1vZGUgYW5kIHNhdmUgICAqLwotLyogICAgICAgICAgICAgIHRoZSBjdXJyZW50IE1CIHRvIGNvbnRpbnVlIG5leHQgdGltZSBpdCBpcyBjYWxsZWQuICAgICAgICAgICovCi0vKiAgSW4vb3V0ICAgOiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICBSZXR1cm4gICA6ICBQVl9TVUNDRVNTIGlmIHN1Y2Nlc3NmdWwgZWxzZSBQVl9GQUlMICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogIE1vZGlmaWVkIDogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PSAqLwotUFZfU1RBVFVTIEVuY29kZVNsaWNlRGF0YVBhcnRNb2RlKFZpZGVvRW5jRGF0YSAqdmlkZW8pCi17Ci0gICAgUFZfU1RBVFVTIHN0YXR1cyA9IFBWX1NVQ0NFU1M7Ci0gICAgVm9sICpjdXJyVm9sID0gdmlkZW8tPnZvbFt2aWRlby0+Y3VyckxheWVyXTsKLSAgICBWb3AgKmN1cnJWb3AgPSB2aWRlby0+Y3VyclZvcDsKLSAgICBVQ2hhciBtb2RlLCAqTW9kZSA9IHZpZGVvLT5oZWFkZXJJbmZvLk1vZGU7Ci0gICAgVmlkZW9FbmNQYXJhbXMgKmVuY1BhcmFtcyA9IHZpZGVvLT5lbmNQYXJhbXM7Ci0gICAgSW50IG5Ub3RhbE1CID0gY3VyclZvbC0+blRvdGFsTUI7Ci0gICAgSW50IHdpZHRoID0gY3VyclZvcC0+d2lkdGg7IC8qIGhhcyB0byBiZSBWb3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gKi8KLSAgICAgICAgcmV0dXJuIFBWX0ZBSUw7Ci0KLSAgICAvKiBkZXRlcm1pbmUgd2hpY2ggVkxDIHRhYmxlIHRvIGJlIHVzZWQgKi8KLSNpZm5kZWYgTk9fUlZMQwotICAgIGlmIChjdXJyVm9sLT51c2VSZXZlcnNlVkxDKQotICAgICAgICBCbG9ja0NvZGVDb2VmZiA9ICZCbG9ja0NvZGVDb2VmZl9SVkxDOwotICAgIGVsc2UKLSNlbmRpZgotICAgICAgICBCbG9ja0NvZGVDb2VmZiA9ICZCbG9ja0NvZGVDb2VmZl9Ob3JtYWw7Ci0KLSAgICBpZiAobWJudW0gIT0gMCkKLSAgICB7Ci0gICAgICAgIGdvdG8gSlVNUF9JTjsKLSAgICB9Ci0KLSAgICBmb3IgKGluZF95ID0gMDsgaW5kX3kgPCBjdXJyVm9sLT5uTUJQZXJDb2w7IGluZF95KyspICAgIC8qIENvbCBNQiBMb29wICovCi0gICAgewotCi0gICAgICAgIHZpZGVvLT5vdXRwdXRNQi0+bWJfeSA9IGluZF95OyAvKiAgNS8yOC8wMSAqLwotCi0gICAgICAgIGZvciAoaW5kX3ggPSAwOyBpbmRfeCA8IGN1cnJWb2wtPm5NQlBlclJvdzsgaW5kX3grKykgIC8qIFJvdyBNQiBMb29wICovCi0gICAgICAgIHsKLQotICAgICAgICAgICAgdmlkZW8tPm91dHB1dE1CLT5tYl94ID0gaW5kX3g7IC8qICA1LzI4LzAxICovCi0gICAgICAgICAgICB2aWRlby0+bWJudW0gPSBtYm51bTsKLSAgICAgICAgICAgIHZpZGVvLT5zbGljZU5vW21ibnVtXSA9IHNsaWNlX2NvdW50ZXI7ICAgICAgLyogVXBkYXRlIE1CIHNsaWNlIG51bWJlciAqLwotCi0gICAgICAgICAgICAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLSAgICAgICAgICAgIC8qIE1CIFByZWRpY3Rpb246UHV0IGludG8gTUMgbWFjcm9ibG9jaywgc3Vic3RyYWN0IGZyb20gY3VyclZvcCwgcHV0IGluIHByZWRNQiAqLwotICAgICAgICAgICAgLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0gICAgICAgICAgICBnZXRNb3Rpb25Db21wZW5zYXRlZE1CKHZpZGVvLCBpbmRfeCwgaW5kX3ksIG9mZnNldCk7Ci0KLUpVTVBfSU46Ci0KLSAgICAgICAgICAgIFFQID0gUVBNQlttYm51bV07ICAgLyogYWx3YXlzIHJlYWQgbmV3IFFQICovCi0KLSAgICAgICAgICAgIGlmIChzdGFydF9wYWNrZXRfaGVhZGVyKQotICAgICAgICAgICAgewotICAgICAgICAgICAgICAgIHNsaWNlX2NvdW50ZXIrKzsgICAgICAgICAgICAgICAgICAgICAgICAvKiBJbmNyZW1lbnQgc2xpY2UgY291bnRlciAqLwotICAgICAgICAgICAgICAgIHZpZGVvLT5zbGljZU5vW21ibnVtXSA9IHNsaWNlX2NvdW50ZXI7ICAvKiBVcGRhdGUgTUIgc2xpY2UgbnVtYmVyKi8KLSAgICAgICAgICAgICAgICB2aWRlby0+UVBfcHJldiA9IGN1cnJWb3AtPnF1YW50aXplcjsgICAgICAgICAgICAgICAgICAgICAgICAvKiBzdG9yZSBRUCAqLwotICAgICAgICAgICAgICAgIG51bV9iaXRzID0gQml0c3RyZWFtR2V0UG9zKGJzMSk7Ci0gICAgICAgICAgICAgICAgc3RhdHVzID0gRW5jb2RlVmlkZW9QYWNrZXRIZWFkZXIodmlkZW8sIG1ibnVtLCB2aWRlby0+UVBfcHJldiwgMCk7Ci0gICAgICAgICAgICAgICAgbnVtSGVhZGVyQml0cyA9IEJpdHN0cmVhbUdldFBvcyhiczEpIC0gbnVtX2JpdHM7Ci0gICAgICAgICAgICAgICAgdmlkZW8tPmhlYWRlcl9iaXRzICs9IG51bUhlYWRlckJpdHM7IC8qIEhlYWRlciBCaXRzICovCi0gICAgICAgICAgICAgICAgc3RhcnRfcGFja2V0X2hlYWRlciA9IDA7Ci0gICAgICAgICAgICAgICAgdmlkZW8tPnVzZVByZXZRUCA9IDA7Ci0gICAgICAgICAgICB9Ci0gICAgICAgICAgICBlbHNlICAvKiBkb24ndCBlbmNvZGUgdGhlIGZpcnN0IE1CIGluIHBhY2tldCBhZ2FpbiAqLwotICAgICAgICAgICAgewotICAgICAgICAgICAgICAgIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLSAgICAgICAgICAgICAgICAvKiBDb2RlX01COiAgRENULCBRLCBRXigtMSksIElEQ1QsIE1vdGlvbiBDb21wICovCi0gICAgICAgICAgICAgICAgLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotCi0gICAgICAgICAgICAgICAgc3RhdHVzID0gKCpDb2RlTUIpKHZpZGVvLCAmZmFzdERDVGZ1bmN0aW9uLCAob2Zmc2V0IDw8IDUpICsgUVAsIG5jb2VmYmxjayk7Ci0gICAgICAgICAgICAgICAgZm9yIChrID0gMDsgayA8IDY7IGsrKykKLSAgICAgICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgICAgIE00VkVOQ19NRU1DUFkob3V0cHV0TUJba10sIHZpZGVvLT5vdXRwdXRNQi0+YmxvY2tba10sIHNpemVvZihTaG9ydCkgPDwgNik7Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgfQotCi0gICAgICAgICAgICAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotICAgICAgICAgICAgLyogTUIgVkxDIEVuY29kZTogVkxDIEVuY29kZSBNQiAgICAgKi8KLSAgICAgICAgICAgIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0KLSAgICAgICAgICAgIC8qIHNhdmUgdGhlIHN0YXRlIGJlZm9yZSBWTEMgZW5jb2RpbmcgKi8KLSAgICAgICAgICAgIGJpdENvdW50MSA9IEJpdHN0cmVhbUdldFBvcyhiczEpOwotICAgICAgICAgICAgYml0Q291bnQyID0gQml0c3RyZWFtR2V0UG9zKGJzMik7Ci0gICAgICAgICAgICBiaXRDb3VudDMgPSBCaXRzdHJlYW1HZXRQb3MoYnMzKTsKLSAgICAgICAgICAgIGJ5dGVDb3VudDEgPSBiaXRDb3VudDEgPj4gMzsKLSAgICAgICAgICAgIGJ5dGVDb3VudDIgPSBiaXRDb3VudDIgPj4gMzsKLSAgICAgICAgICAgIGJ5dGVDb3VudDMgPSBiaXRDb3VudDMgPj4gMzsKLSAgICAgICAgICAgIGJpdENvdW50MSAmPSAweDc7Ci0gICAgICAgICAgICBiaXRDb3VudDIgJj0gMHg3OwotICAgICAgICAgICAgYml0Q291bnQzICY9IDB4NzsKLSAgICAgICAgICAgIG1vZGUgPSBNb2RlW21ibnVtXTsKLSAgICAgICAgICAgIENCUCA9IHZpZGVvLT5oZWFkZXJJbmZvLkNCUFttYm51bV07Ci0KLSAgICAgICAgICAgIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotCi0gICAgICAgICAgICBNQlZsY0VuY29kZSh2aWRlbywgbmNvZWZibGNrLCAodm9pZCopQmxvY2tDb2RlQ29lZmYpOwotCi0gICAgICAgICAgICAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLSAgICAgICAgICAgIC8qIEFzc2VtYmxlIFBhY2tldHM6ICBBc3NlbWJsZSB0aGUgTUIgVkxDIGNvZGVzIGludG8gUGFja2V0cyAqLwotICAgICAgICAgICAgLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0KLSAgICAgICAgICAgIG51bV9iaXRzID0gQml0c3RyZWFtR2V0UG9zKGJzMSkgKyBCaXRzdHJlYW1HZXRQb3MoYnMyKSArCi0gICAgICAgICAgICAgICAgICAgICAgIEJpdHN0cmVhbUdldFBvcyhiczMpOy8vIC0gbnVtSGVhZGVyQml0czsgLy9pbmNsdWRlIGhlYWRlciBiaXRzCi0KLSAgICAgICAgICAgIC8qIEFzc2VtYmxlX1BhY2tldCh2aWRlbykgKi8KLSAgICAgICAgICAgIGlmIChudW1fYml0cyA+IHBhY2tldF9zaXplICYmIG1ibnVtICE9IGZpcnN0TUIpICAvKiBlbmNvZGluZyBhdCBsZWFzdCBvbmUgbW9yZSBNQiovCi0gICAgICAgICAgICB7Ci0KLSAgICAgICAgICAgICAgICBCaXRzdHJlYW1SZXBvcyhiczEsIGJ5dGVDb3VudDEsIGJpdENvdW50MSk7IC8qIHJld2luZCBvbmUgTUIgKi8KLSAgICAgICAgICAgICAgICBCaXRzdHJlYW1SZXBvcyhiczIsIGJ5dGVDb3VudDIsIGJpdENvdW50Mik7IC8qIHJld2luZCBvbmUgTUIgKi8KLSAgICAgICAgICAgICAgICBCaXRzdHJlYW1SZXBvcyhiczMsIGJ5dGVDb3VudDMsIGJpdENvdW50Myk7IC8qIHJld2luZCBvbmUgTUIgKi8KLQotICAgICAgICAgICAgICAgIGlmICh2aWRlby0+Y3VyclZvcC0+cHJlZGljdGlvblR5cGUgPT0gSV9WT1ApCi0gICAgICAgICAgICAgICAgewotICAgICAgICAgICAgICAgICAgICBCaXRzdHJlYW1QdXRHVDE2Qml0cyhiczEsIDE5LCBEQ19NQVJLRVIpOyAgIC8qIEFkZCBkY19tYXJrZXIgKi8KLSAgICAgICAgICAgICAgICAgICAgdmlkZW8tPmhlYWRlcl9iaXRzICs9IDE5OwotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICBlbHNlCi0gICAgICAgICAgICAgICAgewotICAgICAgICAgICAgICAgICAgICBCaXRzdHJlYW1QdXRHVDE2Qml0cyhiczEsIDE3LCBNT1RJT05fTUFSS0VSX0NPTUIpOyAvKkFkZCBtb3Rpb25fbWFya2VyKi8KLSAgICAgICAgICAgICAgICAgICAgdmlkZW8tPmhlYWRlcl9iaXRzICs9IDE3OwotICAgICAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgICAgIHN0YXR1cyA9IEJpdHN0cmVhbUFwcGVuZEVuYyhiczEsIGJzMik7ICAvKiBDb21iaW5lIHdpdGggYnMyICovCi0gICAgICAgICAgICAgICAgc3RhdHVzID0gQml0c3RyZWFtQXBwZW5kRW5jKGJzMSwgYnMzKTsgIC8qIENvbWJpbmUgd2l0aCBiczMgKi8KLQotICAgICAgICAgICAgICAgIHZpZGVvLT5oZWFkZXJfYml0cyArPSBCaXRzdHJlYW1NcGVnNEJ5dGVBbGlnblN0dWZmaW5nKGJzMSk7IC8qIEJ5dGUgYWxpZ24gUGFja2V0ICovCi0gICAgICAgICAgICAgICAgc3RhdHVzID0gQml0c3RyZWFtQXBwZW5kUGFja2V0Tm9PZmZzZXQoY3VyclZvbC0+c3RyZWFtLCBiczEpOwotCi0gICAgICAgICAgICAgICAgQml0c3RyZWFtRW5jUmVzZXQoYnMyKTsKLSAgICAgICAgICAgICAgICBCaXRzdHJlYW1FbmNSZXNldChiczMpOwotCi0gICAgICAgICAgICAgICAgaWYgKHN0YXR1cyA9PSBQVl9FTkRfT0ZfQlVGKSAvKiBpZiBjYW5ub3QgZml0IGEgYnVmZmVyICovCi0gICAgICAgICAgICAgICAgewotICAgICAgICAgICAgICAgICAgICB2aWRlby0+ZW5kX29mX2J1ZiA9IDE7Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgIGVsc2UKLSAgICAgICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgICAgIEJpdHN0cmVhbUVuY1Jlc2V0KGJzMSk7Ci0gICAgICAgICAgICAgICAgfQotCi0gICAgICAgICAgICAgICAgc3RhcnRfcGFja2V0X2hlYWRlciA9IDE7Ci0KLSAgICAgICAgICAgICAgICBpZiAobWJudW0gPCBuVG90YWxNQiB8fCB2aWRlby0+ZW5kX29mX2J1ZikgLyogcmV0dXJuIGhlcmUgKi8KLSAgICAgICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgICAgIHZpZGVvLT5tYm51bSA9IG1ibnVtOwotICAgICAgICAgICAgICAgICAgICB2aWRlby0+c2xpY2VOb1ttYm51bV0gPSBzbGljZV9jb3VudGVyOwotICAgICAgICAgICAgICAgICAgICB2aWRlby0+b2Zmc2V0ID0gb2Zmc2V0OwotICAgICAgICAgICAgICAgICAgICBNb2RlW21ibnVtXSA9IG1vZGU7Ci0gICAgICAgICAgICAgICAgICAgIHZpZGVvLT5oZWFkZXJJbmZvLkNCUFttYm51bV0gPSBDQlA7Ci0KLSAgICAgICAgICAgICAgICAgICAgZm9yIChrID0gMDsgayA8IDY7IGsrKykKLSAgICAgICAgICAgICAgICAgICAgewotICAgICAgICAgICAgICAgICAgICAgICAgTTRWRU5DX01FTUNQWSh2aWRlby0+b3V0cHV0TUItPmJsb2NrW2tdLCBvdXRwdXRNQltrXSwgc2l6ZW9mKFNob3J0KSA8PCA2KTsKLSAgICAgICAgICAgICAgICAgICAgfQotCi0gICAgICAgICAgICAgICAgICAgIHJldHVybiBzdGF0dXM7Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgfQotCi0gICAgICAgICAgICBvZmZzZXQgKz0gMTY7Ci0gICAgICAgICAgICBtYm51bSsrOyAvKiBoYXMgdG8gaW5jcmVtZW50IGJlZm9yZSBTQ0QsIHRvIHByZXNlcnZlIE1vZGVbbWJudW1dICovCi0gICAgICAgIH0gLyogRW5kIG9mIEZvciBpbmRfeCAqLwotCi0gICAgICAgIG9mZnNldCArPSAobHggPDwgNCkgLSB3aWR0aDsKLQotICAgIH0gLyogRW5kIG9mIEZvciBpbmRfeSAqLwotCi0gICAgaWYgKCFzdGFydF9wYWNrZXRfaGVhZGVyKQotICAgIHsKLSAgICAgICAgaWYgKHZpZGVvLT5jdXJyVm9wLT5wcmVkaWN0aW9uVHlwZSA9PSBJX1ZPUCkKLSAgICAgICAgewotICAg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GlvbiBmb3IgemVybyBNViBmaXJzdAotICAgICAgICBNb2RpZmllZDoKLSAgICAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLQotICAgIFZvaWQgQmxvY2tEQ1RfQUFOd1N1YihTaG9ydCAqb3V0LCBVQ2hhciAqY3VyLCBVQ2hhciAqcHJlZCwgSW50IHdpZHRoKQotICAgIHsKLSAgICAgICAgU2hvcnQgKmRzdDsKLSAgICAgICAgSW50IGswLCBrMSwgazIsIGszLCBrNCwgazUsIGs2LCBrNzsKLSAgICAgICAgSW50IHJvdW5kOwotICAgICAgICBJbnQgazEyID0gMHgwMjJBMDJENDsKLSAgICAgICAgSW50IGsxNCA9IDB4MDE4ODA1M0E7Ci0gICAgICAgIEludCBhYnNfc3VtOwotICAgICAgICBJbnQgbWFzazsKLSAgICAgICAgSW50IHRtcCwgdG1wMjsKLSAgICAgICAgSW50IENvbFRoOwotCi0gICAgICAgIGRzdCA9IG91dCArIDY0IDsKLSAgICAgICAgQ29sVGggPSAqZHN0OwotICAgICAgICBvdXQgKz0gMTI4OwotICAgICAgICByb3VuZCA9IDEgPDwgKEZEQ1RfU0hJRlQgLSAxKTsKLQotICAgICAgICBkbyAgLyogZmRjdF9uZXh0cm93ICovCi0gICAgICAgIHsKLSAgICAgICAgICAgIC8qIGFzc3VtaW5nIHRoZSBibG9jayBpcyB3b3JkLWFsaWduZWQgKi8KLSAgICAgICAgICAgIG1hc2sgPSAweDFGRTsKLSAgICAgICAgICAgIHRtcCA9ICooKEludCopIGN1cik7ICAgIC8qIGNvbnRhaW5zIDQgcGl4ZWxzICovCi0gICAgICAgICAgICB0bXAyID0gKigoSW50KikgcHJlZCk7IC8qIHByZWRpY3Rpb24gNCBwaXhlbHMgKi8KLSAgICAgICAgICAgIGswID0gdG1wMiAmIDB4RkY7Ci0gICAgICAgICAgICBrMSA9IG1hc2sgJiAodG1wIDw8IDEpOwotICAgICAgICAgICAgazAgPSBrMSAtIChrMCA8PCAxKTsKLSAgICAgICAgICAgIGsxID0gKHRtcDIgPj4gOCkgJiAweEZGOwotICAgICAgICAgICAgazIgPSBtYXNrICYgKHRtcCA+PiA3KTsKLSAgICAgICAgICAgIGsxID0gazIgLSAoazEgPDwgMSk7Ci0gICAgICAgICAgICBrMiA9ICh0bXAyID4+IDE2KSAmIDB4RkY7Ci0gICAgICAgICAgICBrMyA9IG1hc2sgJiAodG1wID4+IDE1KTsKLSAgICAgICAgICAgIGsyID0gazMgLSAoazIgPDwgMSk7Ci0gICAgICAgICAgICBrMyA9ICh0bXAyID4+IDI0KSAmIDB4RkY7Ci0gICAgICAgICAgICBrNCA9IG1hc2sgJiAodG1wID4+IDIzKTsKLSAgICAgICAgICAgIGszID0gazQgLSAoazMgPDwgMSk7Ci0gICAgICAgICAgICB0bXAgPSAqKChJbnQqKShjdXIgKyA0KSk7ICAgLyogYW5vdGhlciA0IHBpeGVscyAqLwotICAgICAgICAgICAgdG1wMiA9ICooKEludCopKHByZWQgKyA0KSk7Ci0gICAgICAgICAgICBrNCA9IHRtcDIgJiAweEZGOwotICAgICAgICAgICAgazUgPSBtYXNrICYgKHRtcCA8PCAxKTsKLSAgICAgICAgICAgIGs0ID0gazUgLSAoazQgPDwgMSk7Ci0gICAgICAgICAgICBrNSA9ICh0bXAyID4+IDgpICYgMHhGRjsKLSAgICAgICAgICAgIGs2ID0gbWFzayAmICh0bXAgPj4gNyk7Ci0gICAgICAgICAgICBrNSA9IGs2IC0gKGs1IDw8IDEpOwotICAgICAgICAgICAgazYgPSAodG1wMiA+PiAxNikgJiAweEZGOwotICAgICAgICAgICAgazcgPSBtYXNrICYgKHRtcCA+PiAxNSk7Ci0gICAgICAgICAgICBrNiA9IGs3IC0gKGs2IDw8IDEpOwotICAgICAgICAgICAgazcgPSAodG1wMiA+PiAyNCkgJiAweEZGOwotICAgICAgICAgICAgdG1wID0gbWFzayAmICh0bXAgPj4gMjMpOwotICAgICAgICAgICAgazcgPSB0bXAgLSAoazcgPDwgMSk7Ci0gICAgICAgICAgICBjdXIgKz0gd2lkdGg7Ci0gICAgICAgICAgICBwcmVkICs9IDE2OwotCi0gICAgICAgICAgICAvKiBmZGN0XzEgKi8KLSAgICAgICAgICAgIGswID0gazAgKyBrNzsKLSAgICAgICAgICAgIGs3ID0gazAgLSAoazcgPDwgMSk7Ci0gICAgICAgICAgICBrMSA9IGsxICsgazY7Ci0gICAgICAgICAgICBrNiA9IGsxIC0gKGs2IDw8IDEpOwotICAgICAgICAgICAgazIgPSBrMiArIGs1OwotICAgICAgICAgICAgazUgPSBrMiAtIChrNSA8PCAxKTsKLSAgICAgICAgICAgIGszID0gazMgKyBrNDsKLSAgICAgICAgICAgIGs0ID0gazMgLSAoazQgPDwgMSk7Ci0KLSAgICAgICAgICAgIGswID0gazAgKyBrMzsKLSAgICAgICAgICAgIGszID0gazAgLSAoazMgPDwgMSk7Ci0gICAgICAgICAgICBrMSA9IGsxICsgazI7Ci0gICAgICAgICAgICBrMiA9IGsxIC0gKGsyIDw8IDEpOwotCi0gICAgICAgICAgICBrMCA9IGswICsgazE7Ci0gICAgICAgICAgICBrMSA9IGswIC0gKGsxIDw8IDEpOwotICAgICAgICAgICAgLyoqKioqKioqKiovCi0gICAgICAgICAgICBkc3RbMF0gPSBrMDsKLSAgICAgICAgICAgIGRzdFs0XSA9IGsxOyAvKiBjb2wuIDQgKi8KLSAgICAgICAgICAgIC8qIGZkY3RfMiAqLwotICAgICAgICAgICAgazQgPSBrNCArIGs1OwotICAgICAgICAgICAgazUgPSBrNSArIGs2OwotICAgICAgICAgICAgazYgPSBrNiArIGs3OwotICAgICAgICAgICAgazIgPSBrMiArIGszOwotICAgICAgICAgICAgLyogTVVMMkMgazIsazUsNzI0LEZEQ1RfU0hJRlQgKi8KLSAgICAgICAgICAgIC8qIGswLCBrMSBiZWNvbWUgc2NyYXRjaCAqLwotICAgICAgICAgICAgLyogYXNzdW1lIEZBU1QgTVVMVElQTFkgKi8KLSAgICAgICAgICAgIGsxID0gbWxhNzI0KGsxMiwgazUsIHJvdW5kKTsKLSAgICAgICAgICAgIGswID0gbWxhNzI0KGsxMiwgazIsIHJvdW5kKTsKLQotICAgICAgICAgICAgazUgPSBrMSA+PiBGRENUX1NISUZUOwotICAgICAgICAgICAgazIgPSBrMCA+PiBGRENUX1NISUZUOwotICAgICAgICAgICAgLyoqKioqKioqKioqKioqKioqLwotICAgICAgICAgICAgazIgPSBrMiArIGszOwotICAgICAgICAgICAgazMgPSAoazMgPDwgMSkgLSBrMjsKLSAgICAgICAgICAgIC8qKioqKioqKi8KLSAgICAgICAgICAgIGRzdFsyXSA9IGsyOyAgICAgICAgLyogY29sLiAyICovCi0gICAgICAgICAgICBrMyA8PD0gMTsgICAgICAgLyogc2NhbGUgdXAgY29sLiA2ICovCi0gICAgICAgICAgICBkc3RbNl0gPSBrMzsgLyogY29sLiA2ICovCi0gICAgICAgICAgICAvKiBmZGN0XzMgKi8KLSAgICAgICAgICAgIC8qIFJPVEFURSBrNCxrNiwzOTIsOTQ2LCBGRENUX1NISUZUICovCi0gICAgICAgICAgICAvKiBhc3N1bWUgRkFTVCBNVUxUSVBMWSAqLwotICAgICAgICAgICAgLyogazAsIGsxIGFyZSBvdXRwdXQgKi8KLSAgICAgICAgICAgIGswID0gazQgLSBrNjsKLQotICAgICAgICAgICAgazEgPSBtbGEzOTIoazAsIGsxNCwgcm91bmQpOwotICAgICAgICAgICAgazAgPSBtbGE1NTQoazQsIGsxMiwgazEpOwotICAgICAgICAgICAgazEgPSBtbGExMzM4KGs2LCBrMTQsIGsxKTsKLQotICAgICAgICAgICAgazQgPSBrMCA+PiBGRENUX1NISUZUOwotICAgICAgICAgICAgazYgPSBrMSA+PiBGRENUX1NISUZUOwotICAgICAgICAgICAgLyoqKioqKioqKioqKioqKioqKioqKioqLwotICAgICAgICAgICAgazUgPSBrNSArIGs3OwotICAgICAgICAgICAgazcgPSAoazcgPDwgMSkgLSBrNTsKLSAgICAgICAgICAgIGs0ID0gazQgKyBrNzsKLSAgICAgICAgICAgIGs3ID0gKGs3IDw8IDEpIC0gazQ7Ci0gICAgICAgICAgICBrNSA9IGs1ICsgazY7Ci0gICAgICAgICAgICBrNCA8PD0gMTsgICAgICAgLyogc2NhbGUgdXAgY29sLjUgKi8KLSAgICAgICAgICAgIGs2ID0gazUgLSAoazYgPDwgMSk7Ci0gICAgICAgICAgICAvKioqKioqKiovCi0gICAgICAgICAgICBkc3RbNV0gPSBrNDsgICAgLyogY29sLiA1ICovCi0gICAgICAgICAgICBrNiA8PD0gMjsgICAgICAgLyogc2NhbGUgdXAgY29sLiA3ICovCi0gICAgICAgICAgICBkc3RbMV0gPSBrNTsgICAgLyogY29sLiAxICovCi0gICAgICAgICAgICBkc3RbN10gPSBrNjsgICAgLyogY29sLiA3ICovCi0gICAgICAgICAgICBkc3RbM10gPSBrNzsgICAgLyogY29sLiAzICovCi0gICAgICAgICAgICBkc3QgKz0gODsKLSAgICAgICAgfQotICAgICAgICB3aGlsZSAoZHN0IDwgb3V0KTsKLQotICAgICAgICBvdXQgLT0gNjQ7Ci0gICAgICAgIGRzdCA9IG91dCArIDg7Ci0KLSAgICAgICAgLyogIFZlcnRpY2FsIEJsb2NrIExvb3AgICovCi0gICAgICAgIGRvICAvKiBWZXJ0aWNhbCA4eERDVCBsb29wICovCi0gICAgICAgIHsKLSAgICAgICAgICAgIGswID0gb3V0WzBdOwotICAgICAgICAgICAgazEgPSBvdXRbOF07Ci0gICAgICAgICAgICBrMiA9IG91dFsxNl07Ci0gICAgICAgICAgICBrMyA9IG91dFsyNF07Ci0gICAgICAgICAgICBrNCA9IG91dFszMl07Ci0gICAgICAgICAgICBrNSA9IG91dFs0MF07Ci0gICAgICAgICAgICBrNiA9IG91dFs0OF07Ci0gICAgICAgICAgICBrNyA9IG91dFs1Nl07Ci0gICAgICAgICAgICAvKiBkZWFkem9uZSB0aHJlc2hvbGRpbmcgZm9yIGNvbHVtbiAqLwotCi0gICAgICAgICAgICBhYnNfc3VtID0gc3VtX2FicyhrMCwgazEsIGsyLCBrMywgazQsIGs1LCBrNiwgazcpOwotCi0gICAgICAgICAgICBpZiAoYWJzX3N1bSA8IENvbFRoKQotICAgICAgICAgICAgewotICAgICAgICAgICAgICAgIG91dFswXSA9IDB4N2ZmZjsKLSAgICAgICAgICAgICAgICBvdXQrKzsKLSAgICAgICAgICAgICAgICBjb250aW51ZTsKLSAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgLyogZmRjdF8xICovCi0gICAgICAgICAgICBrMCA9IGswICsgazc7Ci0gICAgICAgICAgICBrNyA9IGswIC0gKGs3IDw8IDEpOwotICAgICAgICAgICAgazEgPSBrMSArIGs2OwotICAgICAgICAgICAgazYgPSBrMSAtIChrNiA8PCAxKTsKLSAgICAgICAgICAgIGsyID0gazIgKyBrNTsKLSAgICAgICAgICAgIGs1ID0gazIgLSAoazUgPDwgMSk7Ci0gICAgICAgICAgICBrMyA9IGszICsgazQ7Ci0gICAgICAgICAgICBrNCA9IGszIC0gKGs0IDw8IDEpOwotCi0gICAgICAgICAgICBrMCA9IGswICsgazM7Ci0gICAgICAgICAgICBrMyA9IGswIC0gKGszIDw8IDEpOwotICAgICAgICAgICAgazEgPSBrMSArIGsyOwotICAgICAgICAgICAgazIgPSBrMSAtIChrMiA8PCAxKTsKLQotICAgICAgICAgICAgazAgPSBrMCArIGsxOwotICAgICAgICAgICAgazEgPSBrMCAtIChrMSA8PCAxKTsKLSAgICAgICAgICAgIC8qKioqKioqKioqLwotICAgICAgICAgICAgb3V0WzMyXSA9IGsxOyAvKiByb3cgNCAqLwotICAgICAgICAgICAgb3V0WzBdID0gazA7IC8qIHJvdyAwICovCi0gICAgICAgICAgICAvKiBmZGN0XzIgKi8KLSAgICAgICAgICAgIGs0ID0gazQgKyBrNTsKLSAgICAgICAgICAgIGs1ID0gazUgKyBrNjsKLSAgICAgICAgICAgIGs2ID0gazYgKyBrNzsKLSAgICAgICAgICAgIGsyID0gazIgKyBrMzsKLSAgICAgICAgICAgIC8qIE1VTDJDIGsyLGs1LDcyNCxGRENUX1NISUZUICovCi0gICAgICAgICAgICAvKiBrMCwgazEgYmVjb21lIHNjcmF0Y2ggKi8KLSAgICAgICAgICAgIC8qIGFzc3VtZSBGQVNUIE1VTFRJUExZICovCi0gICAgICAgICAgICBrMSA9IG1sYTcyNChrMTIsIGs1LCByb3VuZCk7Ci0gICAgICAgICAgICBrMCA9IG1sYTcyNChrMTIsIGsyLCByb3VuZCk7Ci0KLSAgICAgICAgICAgIGs1ID0gazEgPj4gRkRDVF9TSElGVDsKLSAgICAgICAgICAgIGsyID0gazAgPj4gRkRDVF9TSElGVDsKLSAgICAgICAgICAgIC8qKioqKioqKioqKioqKioqKi8KLSAgICAgICAgICAgIGsyID0gazIgKyBrMzsKLSAgICAgICAgICAgIGszID0gKGszIDw8IDEpIC0gazI7Ci0gICAgICAgICAgICBrMyA8PD0gMTsgICAgICAgLyogc2NhbGUgdXAgY29sLiA2ICovCi0gICAgICAgICAgICAvKioqKioqKiovCi0gICAgICAgICAgICBvdXRbNDhdID0gazM7ICAgLyogcm93IDYgKi8KLSAgICAgICAgICAgIG91dFsxNl0gPSBrMjsgICAvKiByb3cgMiAqLwotICAgICAgICAgICAgLyogZmRjdF8zICovCi0gICAgICAgICAgICAvKiBST1RBVEUgazQsazYsMzkyLDk0NiwgRkRDVF9TSElGVCAqLwotICAgICAgICAgICAgLyogYXNzdW1lIEZBU1QgTVVMVElQTFkgKi8KLSAgICAgICAgICAgIC8qIGswLCBrMSBhcmUgb3V0cHV0ICovCi0gICAgICAgICAgICBrMCA9IGs0IC0gazY7Ci0KLSAgICAgICAgICAgIGsxID0gbWxhMzkyKGswLCBrMTQsIHJvdW5kKTsKLSAgICAgICAgICAgIGswID0gbWxhNTU0KGs0LCBrMTIsIGsxKTsKLSAgICAgICAgICAgIGsxID0gbWxhMTMzOChrNiwgazE0LCBrMSk7Ci0KLSAgICAgICAgICAgIGs0ID0gazAgPj4gRkRDVF9TSElGVDsKLSAgICAgICAgICAgIGs2ID0gazEgPj4gRkRDVF9TSElGVDsKLSAgICAgICAgICAgIC8qKioqKioqKioqKioqKioqKioqKioqKi8KLSAgICAgICAgICAgIGs1ID0gazUgKyBrNzsKLSAgICAgICAgICAgIGs3ID0gKGs3IDw8IDEpIC0gazU7Ci0gICAgICAgICAgICBrNCA9IGs0ICsgazc7Ci0gICAgICAgICAgICBrNyA9IChrNyA8PCAxKSAtIGs0OwotICAgICAgICAgICAgazUgPSBrNSArIGs2OwotICAgICAgICAgICAgazQgPDw9IDE7ICAgICAgIC8qIHNjYWxlIHVwIGNvbC4gNSAqLwotICAgICAgICAgICAgazYgPSBrNSAtIChrNiA8PCAxKTsKLSAgICAgICAgICAgIC8qKioqKioqKi8KLSAgICAgICAgICAgIG91dFsyNF0gPSBrNyA7ICAgIC8qIHJvdyAzICovCi0gICAgICAgICAgICBrNiA8PD0gMjsgICAgICAgLyogc2NhbGUgdXAgY29sLiA3ICovCi0gICAgICAgICAgICBvdXRbNTZdID0gazYgOyAgIC8qIHJvdyA3ICovCi0gICAgICAgICAgICBvdXRbOF0gPSBrNSA7ICAgIC8qIHJvdyAxICovCi0gICAgICAgICAgICBvdXRbNDBdID0gazQgOyAgIC8qIHJvdyA1ICovCi0gICAgICAgICAgICBvdXQrKzsKLSAgICAgICAgfQotICAgICAgICB3aGlsZSAoKFVJbnQpb3V0IDwgKFVJbnQpZHN0KSA7Ci0KLSAgICAgICAgcmV0dXJuIDsKLSAgICB9Ci0KLSAgICAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0gICAgLyogIEZ1bmN0aW9uOiAgIEJsb2NrNHg0RENUX0FBTndTdWIKLSAgICAgICAgRGF0ZTogICAgICAgNy8zMS8wMQotICAgICAgICBJbnB1dDoKLSAgICAgICAgT3V0cHV0OiAgICAgb3V0WzY0XSA9PT4gbmV4dCBibG9jawotICAgICAgICBQdXJwb3NlOiAgICBEbyBzdWJ0cmFjdGlvbiBmb3IgemVybyBNViBmaXJzdCBiZWZvcmUgNHg0IERDVAotICAgICAgICBNb2RpZmllZDoKLSAgICAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLQotICAgIFZvaWQgQmxvY2s0eDREQ1RfQUFOd1N1YihTaG9ydCAqb3V0LCBVQ2hhciAqY3VyLCBVQ2hhciAqcHJlZCwgSW50IHdpZHRoKQotICAgIHsKLSAgICAgICAgU2hvcnQgKmRzdDsKLSAgICAgICAgcmVnaXN0ZXIgSW50IGswLCBrMSwgazIsIGszLCBrNCwgazUsIGs2LCBrNzsKLSAgICAgICAgSW50IHJvdW5kOwotICAgICAgICBJbnQgazEyID0gMHgwMjJBMDJENDsKLSAgICAgICAgSW50IGsxNCA9IDB4MDE4ODA1M0E7Ci0gICAgICAgIEludCBtYXNrOwotICAgICAgICBJbnQgdG1wLCB0bXAyOwotICAgICAgICBJbnQgYWJzX3N1bTsKLSAgICAgICAgSW50IENvbFRoOwotCi0gICAgICAgIGRzdCA9IG91dCArIDY0IDsKLSAgICAgICAgQ29sVGggPSAqZHN0OwotICAgICAgICBvdXQgKz0gMTI4OwotICAgICAgICByb3VuZCA9IDEgPDwgKEZEQ1RfU0hJRlQgLSAxKTsKLQotICAgICAgICBkbyAgLyogZmRjdF9uZXh0cm93ICovCi0gICAgICAgIHsKLSAgICAgICAgICAgIC8qIGFzc3VtaW5nIHRoZSBibG9jayBpcyB3b3JkLWFsaWduZWQgKi8KLSAgICAgICAgICAgIG1hc2sgPSAweDFGRTsKLSAgICAgICAgICAgIHRtcCA9ICooKEludCopIGN1cik7ICAgIC8qIGNvbnRhaW5zIDQgcGl4ZWxzICovCi0gICAgICAgICAgICB0bXAyID0gKigoSW50KikgcHJlZCk7IC8qIHByZWRpY3Rpb24gNCBwaXhlbHMgKi8KLSAgICAgICAgICAgIGswID0gdG1wMiAmIDB4RkY7Ci0gICAgICAgICAgICBrMSA9IG1hc2sgJiAodG1wIDw8IDEpOwotICAgICAgICAgICAgazAgPSBrMSAtIChrMCA8PCAxKTsKLSAgICAgICAgICAgIGsxID0gKHRtcDIgPj4gOCkgJiAweEZGOwotICAgICAgICAgICAgazIgPSBtYXNrICYgKHRtcCA+PiA3KTsKLSAgICAgICAgICAgIGsxID0gazIgLSAoazEgPDwgMSk7Ci0gICAgICAgICAgICBrMiA9ICh0bXAyID4+IDE2KSAmIDB4RkY7Ci0gICAgICAgICAgICBrMyA9IG1hc2sgJiAodG1wID4+IDE1KTsKLSAgICAgICAgICAgIGsyID0gazMgLSAoazIgPDwgMSk7Ci0gICAgICAgICAgICBrMyA9ICh0bXAyID4+IDI0KSAmIDB4RkY7Ci0gICAgICAgICAgICBrNCA9IG1hc2sgJiAodG1wID4+IDIzKTsKLSAgICAgICAgICAgIGszID0gazQgLSAoazMgPDwgMSk7Ci0gICAgICAgICAgICB0bXAgPSAqKChJbnQqKShjdXIgKyA0KSk7ICAgLyogYW5vdGhlciA0IHBpeGVscyAqLwotICAgICAgICAgICAgdG1wMiA9ICooKEludCopKHByZWQgKyA0KSk7Ci0gICAgICAgICAgICBrNCA9IHRtcDIgJiAweEZGOwotICAgICAgICAgICAgazUgPSBtYXNrICYgKHRtcCA8PCAxKTsKLSAgICAgICAgICAgIGs0ID0gazUgLSAoazQgPDwgMSk7Ci0gICAgICAgICAgICBrNSA9ICh0bXAyID4+IDgpICYgMHhGRjsKLSAgICAgICAgICAgIGs2ID0gbWFzayAmICh0bXAgPj4gNyk7Ci0gICAgICAgICAgICBrNSA9IGs2IC0gKGs1IDw8IDEpOwotICAgICAgICAgICAgazYgPSAodG1wMiA+PiAxNikgJiAweEZGOwotICAgICAgICAgICAgazcgPSBtYXNrICYgKHRtcCA+PiAxNSk7Ci0gICAgICAgICAgICBrNiA9IGs3IC0gKGs2IDw8IDEpOwotICAgICAgICAgICAgazcgPSAodG1wMiA+PiAyNCkgJiAweEZGOwotICAgICAgICAgICAgdG1wID0gbWFzayAmICh0bXAgPj4gMjMpOwotICAgICAgICAgICAgazcgPSB0bXAgLSAoazcgPDwgMSk7Ci0gICAgICAgICAgICBjdXIgKz0gd2lkdGg7Ci0gICAgICAgICAgICBwcmVkICs9IDE2OwotCi0gICAgICAgICAgICAvKiBmZGN0XzEgKi8KLSAgICAgICAgICAgIGswID0gazAgKyBrNzsKLSAgICAgICAgICAgIGs3ID0gazAgLSAoazcgPDwgMSk7Ci0gICAgICAgICAgICBrMSA9IGsxICsgazY7Ci0gICAgICAgICAgICBrNiA9IGsxIC0gKGs2IDw8IDEpOwotICAgICAgICAgICAgazIgPSBrMiArIGs1OwotICAgICAgICAgICAgazUgPSBrMiAtIChrNSA8PCAxKTsKLSAgICAgICAgICAgIGszID0gazMgKyBrNDsKLSAgICAgICAgICAgIGs0ID0gazMgLSAoazQgPDwgMSk7Ci0KLSAgICAgICAgICAgIGswID0gazAgKyBrMzsKLSAgICAgICAgICAgIGszID0gazAgLSAoazMgPDwgMSk7Ci0gICAgICAgICAgICBrMSA9IGsxICsgazI7Ci0gICAgICAgICAgICBrMiA9IGsxIC0gKGsyIDw8IDEpOwotCi0gICAgICAgICAgICBrMCA9IGswICsgazE7Ci0gICAgICAgICAgICAvKioqKioqKioqKi8KLSAgICAgICAgICAgIGRzdFswXSA9IGswOwotICAgICAgICAgICAgLyogZmRjdF8yICovCi0gICAgICAgICAgICBrNCA9IGs0ICsgazU7Ci0gICAgICAgICAgICBrNSA9IGs1ICsgazY7Ci0gICAgICAgICAgICBrNiA9IGs2ICsgazc7Ci0gICAgICAgICAgICBrMiA9IGsyICsgazM7Ci0gICAgICAgICAgICAvKiBNVUwyQyBrMixrNSw3MjQsRkRDVF9TSElGVCAqLwotICAgICAgICAgICAgLyogazAsIGsxIGJlY29tZSBzY3JhdGNoICovCi0gICAgICAgICAgICAvKiBhc3N1bWUgRkFTVCBNVUxUSVBMWSAqLwotICAgICAgICAgICAgazEgPSBtbGE3MjQoazEyLCBrNSwgcm91bmQpOwotICAgICAgICAgICAgazAgPSBtbGE3MjQoazEyLCBrMiwgcm91bmQpOwotCi0gICAgICAgICAgICBrNSA9IGsxID4+IEZEQ1RfU0hJRlQ7Ci0gICAgICAgICAgICBrMiA9IGswID4+IEZEQ1RfU0hJRlQ7Ci0gICAgICAgICAgICAvKioqKioqKioqKioqKioqKiovCi0gICAgICAgICAgICBrMiA9IGsyICsgazM7Ci0gICAgICAgICAgICAvKioqKioqKiovCi0gICAgICAgICAgICBkc3RbMl0gPSBrMjsgICAgICAgIC8qIGNvbC4gMiAqLwotICAgICAgICAgICAgLyogZmRjdF8zICovCi0gICAgICAgICAgICAvKiBST1RBVEUgazQsazYsMzkyLDk0NiwgRkRDVF9TSElGVCAqLwotICAgICAgICAgICAgLyogYXNzdW1lIEZBU1QgTVVMVElQTFkgKi8KLSAgICAgICAgICAgIC8qIGswLCBrMSBhcmUgb3V0cHV0ICovCi0gICAgICAgICAgICBrMCA9IGs0IC0gazY7Ci0KLSAgICAgICAgICAgIGsxID0gbWxhMzkyKGswLCBrMTQsIHJvdW5kKTsKLSAgICAgICAgICAgIGswID0gbWxhNTU0KGs0LCBrMTIsIGsxKTsKLSAgICAgICAgICAgIGsxID0gbWxhMTMzOChrNiwgazE0LCBrMSk7Ci0KLSAgICAgICAgICAgIGs0ID0gazAgPj4gRkRDVF9TSElGVDsKLSAgICAgICAgICAgIGs2ID0gazEgPj4gRkRDVF9TSElGVDsKLSAgICAgICAgICAgIC8qKioqKioqKioqKioqKioqKioqKioqKi8KLSAgICAgICAgICAgIGs1ID0gazUgKyBrNzsKLSAgICAgICAgICAgIGs3ID0gKGs3IDw8IDEpIC0gazU7Ci0gICAgICAgICAgICBrNyA9IGs3IC0gazQ7Ci0gICAgICAgICAgICBrNSA9IGs1ICsgazY7Ci0gICAgICAgICAgICAvKioqKioqKiovCi0gICAgICAgICAgICBkc3RbMV0gPSBrNTsgICAgICAgIC8qIGNvbC4gMSAqLwotICAgICAgICAgICAgZHN0WzNdID0gazc7ICAgICAgICAvKiBjb2wuIDMgKi8KLSAgICAgICAgICAgIGRzdCArPSA4OwotICAgICAgICB9Ci0gICAgICAgIHdoaWxlIChkc3QgPCBvdXQpOwotCi0gICAgICAgIG91dCAtPSA2NDsKLSAgICAgICAgZHN0ID0gb3V0ICsgNDsKLQotICAgICAgICAvKiAgVmVydGljYWwgQmxvY2sgTG9vcCAgKi8KLSAgICAgICAgZG8gIC8qIFZlcnRpY2FsIDh4RENUIGxvb3AgKi8KLSAgICAgICAgewotICAgICAgICAgICAgazAgPSBvdXRbMF07Ci0gICAgICAgICAgICBrMSA9IG91dFs4XTsKLSAgICAgICAgICAgIGsyID0gb3V0WzE2XTsKLSAgICAgICAgICAgIGszID0gb3V0WzI0XTsKLSAgICAgICAgICAgIGs0ID0gb3V0WzMyXTsKLSAgICAgICAgICAgIGs1ID0gb3V0WzQwXTsKLSAgICAgICAgICAgIGs2ID0gb3V0WzQ4XTsKLSAgICAgICAgICAgIGs3ID0gb3V0WzU2XTsKLQotICAgICAgICAgICAgYWJzX3N1bSA9IHN1bV9hYnMoazAsIGsxLCBrMiwgazMsIGs0LCBrNSwgazYsIGs3KTsKLQotICAgICAgICAgICAgaWYgKGFic19zdW0gPCBDb2xUaCkKLSAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICBvdXRbMF0gPSAweDdmZmY7Ci0gICAgICAgICAgICAgICAgb3V0Kys7Ci0gICAgICAgICAgICAgICAgY29udGludWU7Ci0gICAgICAgICAgICB9Ci0gICAgICAgICAgICAvKiBmZGN0XzEgKi8KLSAgICAgICAgICAgIGswID0gazAgKyBrNzsKLSAgICAgICAgICAgIGs3ID0gazAgLSAoazcgPDwgMSk7Ci0gICAgICAgICAgICBrMSA9IGsxICsgazY7Ci0gICAgICAgICAgICBrNiA9IGsxIC0gKGs2IDw8IDEpOwotICAgICAgICAgICAgazIgPSBrMiArIGs1OwotICAgICAgICAgICAgazUgPSBrMiAtIChrNSA8PCAxKTsKLSAgICAgICAgICAgIGszID0gazMgKyBrNDsKLSAgICAgICAgICAgIGs0ID0gazMgLSAoazQgPDwgMSk7Ci0KLSAgICAgICAgICAgIGswID0gazAgKyBrMzsKLSAgICAgICAgICAgIGszID0gazAgLSAoazMgPDwgMSk7Ci0gICAgICAgICAgICBrMSA9IGsxICsgazI7Ci0gICAgICAgICAgICBrMiA9IGsxIC0gKGsyIDw8IDEpOwotCi0gICAgICAgICAgICBrMCA9IGswICsgazE7Ci0gICAgICAgICAgICAvKioqKioqKioqKi8KLSAgICAgICAgICAgIG91dFswXSA9IGswOyAgIC8qIHJvdyAwICovCi0gICAgICAgICAgICAvKiBmZGN0XzIgKi8KLSAgICAgICAgICAgIGs0ID0gazQgKyBrNTsKLSAgICAgICAgICAgIGs1ID0gazUgKyBrNjsKLSAgICAgICAgICAgIGs2ID0gazYgKyBrNzsKLSAgICAgICAgICAgIGsyID0gazIgKyBrMzsKLSAgICAgICAgICAgIC8qIE1VTDJDIGsyLGs1LDcyNCxGRENUX1NISUZUICovCi0gICAgICAgICAgICAvKiBrMCwgazEgYmVjb21lIHNjcmF0Y2ggKi8KLSAgICAgICAgICAgIC8qIGFzc3VtZSBGQVNUIE1VTFRJUExZICovCi0gICAgICAgICAgICBrMSA9IG1sYTcyNChrMTIsIGs1LCByb3VuZCk7Ci0gICAgICAgICAgICBrMCA9IG1sYTcyNChrMTIsIGsyLCByb3VuZCk7Ci0KLSAgICAgICAgICAgIGs1ID0gazEgPj4gRkRDVF9TSElGVDsKLSAgICAgICAgICAgIGsyID0gazAgPj4gRkRDVF9TSElGVDsKLSAgICAgICAgICAgIC8qKioqKioqKioqKioqKioqKi8KLSAgICAgICAgICAgIGsyID0gazIgKyBrMzsKLSAgICAgICAgICAgIC8qKioqKioqKi8KLSAgICAgICAgICAgIG91dFsxNl0gPSBrMjsgICAgICAgICAgIC8qIHJvdyAyICovCi0gICAgICAgICAgICAvKiBmZGN0XzMgKi8KLSAgICAgICAgICAgIC8qIFJPVEFURSBrNCxrNiwzOTIsOTQ2LCBGRENUX1NISUZUICovCi0gICAgICAgICAgICAvKiBhc3N1bWUgRkFTVCBNVUxUSVBMWSAqLwotICAgICAgICAgICAgLyogazAsIGsxIGFyZSBvdXRwdXQgKi8KLSAgICAgICAgICAgIGswID0gazQgLSBrNjsKLQotICAgICAgICAgICAgazEgPSBtbGEzOTIoazAsIGsxNCwgcm91bmQpOwotICAgICAgICAgICAgazAgPSBtbGE1NTQoazQsIGsxMiwgazEpOwotICAgICAgICAgICAgazEgPSBtbGExMzM4KGs2LCBrMTQsIGsxKTsKLQotICAgICAgICAgICAgazQgPSBrMCA+PiBGRENUX1NISUZUOwotICAgICAgICAgICAgazYgPSBrMSA+PiBGRENUX1NISUZUOwotICAgICAgICAgICAgLyoqKioqKioqKioqKioqKioqKioqKioqLwotICAgICAgICAgICAgazUgPSBrNSArIGs3OwotICAgICAgICAgICAgazcgPSAoazcgPDwgMSkgLSBrNTsKLSAgICAgICAgICAgIGs3ID0gazcgLSBrNCA7Ci0gICAgICAgICAgICBrNSA9IGs1ICsgazY7Ci0gICAgICAgICAgICAvKioqKioqKiovCi0gICAgICAgICAgICBvdXRbMjRdID0gazcgOyAgICAgIC8qIHJvdyAzICovCi0gICAgICAgICAgICBvdXRbOF0gPSBrNSA7ICAgICAgIC8qIHJvdyAxICovCi0gICAgICAgICAgICBvdXQrKzsKLSAgICAgICAgfQotICAgICAgICB3aGlsZSAoKFVJbnQpb3V0IDwgKFVJbnQpZHN0KSA7Ci0KLSAgICAgICAgcmV0dXJuIDsKLSAgICB9Ci0KLSAgICAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0gICAgLyogIEZ1bmN0aW9uOiAgIEJsb2NrMngyRENUX0FBTndTdWIKLSAgICAgICAgRGF0ZTogICAgICAgNy8zMS8wMQotICAgICAgICBJbnB1dDoKLSAgICAgICAgT3V0cHV0OiAgICAgb3V0WzY0XSA9PT4gbmV4dCBibG9jawotICAgICAgICBQdXJwb3NlOiAgICBEbyBzdWJ0cmFjdGlvbiBmb3IgemVybyBNViBmaXJzdCBiZWZvcmUgMngyIERDVAotICAgICAgICBNb2RpZmllZDoKLSAgICAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLQotCi0gICAgVm9pZCBCbG9jazJ4MkRDVF9BQU53U3ViKFNob3J0ICpvdXQsIFVDaGFyICpjdXIsIFVDaGFyICpwcmVkLCBJbnQgd2lkdGgpCi0gICAgewotICAgICAgICBTaG9ydCAqZHN0OwotICAgICAgICByZWdpc3RlciBJbnQgazAsIGsxLCBrMiwgazMsIGs0LCBrNSwgazYsIGs3OwotICAgICAgICBJbnQgcm91bmQ7Ci0gICAgICAgIEludCBrMTIgPSAweDAyMkEwMkQ0OwotICAgICAgICBJbnQgazE0ID0gMHgwMTg4MDNCMjsKLSAgICAgICAgSW50IG1hc2s7Ci0gICAgICAgIEludCB0bXAsIHRtcDI7Ci0gICAgICAgIEludCBhYnNfc3VtOwotICAgICAgICBJbnQgQ29sVGg7Ci0KLSAgICAgICAgZHN0ID0gb3V0ICsgNjQgOwotICAgICAgICBDb2xUaCA9ICpkc3Q7Ci0gICAgICAgIG91dCArPSAxMjg7Ci0gICAgICAgIHJvdW5kID0gMSA8PCAoRkRDVF9TSElGVCAtIDEpOwotCi0gICAgICAgIGRvICAvKiBmZGN0X25leHRyb3cgKi8KLSAgICAgICAgewotICAgICAgICAgICAgLyogYXNzdW1pbmcgdGhlIGJsb2NrIGlzIHdvcmQtYWxpZ25lZCAqLwotICAgICAgICAgICAgbWFzayA9IDB4MUZFOwotICAgICAgICAgICAgdG1wID0gKigoSW50KikgY3VyKTsgICAgLyogY29udGFpbnMgNCBwaXhlbHMgKi8KLSAgICAgICAgICAgIHRtcDIgPSAqKChJbnQqKSBwcmVkKTsgLyogcHJlZGljdGlvbiA0IHBpeGVscyAqLwotICAgICAgICAgICAgazAgPSB0bXAyICYgMHhGRjsKLSAgICAgICAgICAgIGsxID0gbWFzayAmICh0bXAgPDwgMSk7Ci0gICAgICAgICAgICBrMCA9IGsxIC0gKGswIDw8IDEpOwotICAgICAgICAgICAgazEgPSAodG1wMiA+PiA4KSAmIDB4RkY7Ci0gICAgICAgICAgICBrMiA9IG1hc2sgJiAodG1wID4+IDcpOwotICAgICAgICAgICAgazEgPSBrMiAtIChrMSA8PCAxKTsKLSAgICAgICAgICAgIGsyID0gKHRtcDIgPj4gMTYpICYgMHhGRjsKLSAgICAgICAgICAgIGszID0gbWFzayAmICh0bXAgPj4gMTUpOwotICAgICAgICAgICAgazIgPSBrMyAtIChrMiA8PCAxKTsKLSAgICAgICAgICAgIGszID0gKHRtcDIgPj4gMjQpICYgMHhGRjsKLSAgICAgICAgICAgIGs0ID0gbWFzayAmICh0bXAgPj4gMjMpOwotICAgICAgICAgICAgazMgPSBrNCAtIChrMyA8PCAxKTsKLSAgICAgICAgICAgIHRtcCA9ICooKEludCopKGN1ciArIDQpKTsgICAvKiBhbm90aGVyIDQgcGl4ZWxzICovCi0gICAgICAgICAgICB0bXAyID0gKigoSW50KikocHJlZCArIDQpKTsKLSAgICAgICAgICAgIGs0ID0gdG1wMiAmIDB4RkY7Ci0gICAgICAgICAgICBrNSA9IG1hc2sgJiAodG1wIDw8IDEpOwotICAgICAgICAgICAgazQgPSBrNSAtIChrNCA8PCAxKTsKLSAgICAgICAgICAgIGs1ID0gKHRtcDIgPj4gOCkgJiAweEZGOwotICAgICAgICAgICAgazYgPSBtYXNrICYgKHRtcCA+PiA3KTsKLSAgICAgICAgICAgIGs1ID0gazYgLSAoazUgPDwgMSk7Ci0gICAgICAgICAgICBrNiA9ICh0bXAyID4+IDE2KSAmIDB4RkY7Ci0gICAgICAgICAgICBrNyA9IG1hc2sgJiAodG1wID4+IDE1KTsKLSAgICAgICAgICAgIGs2ID0gazcgLSAoazYgPDwgMSk7Ci0gICAgICAgICAgICBrNyA9ICh0bXAyID4+IDI0KSAmIDB4RkY7Ci0gICAgICAgICAgICB0bXAgPSBtYXNrICYgKHRtcCA+PiAyMyk7Ci0gICAgICAgICAgICBrNyA9IHRtcCAtIChrNyA8PCAxKTsKLSAgICAgICAgICAgIGN1ciArPSB3aWR0aDsKLSAgICAgICAgICAgIHByZWQgKz0gMTY7Ci0KLSAgICAgICAgICAgIC8qIGZkY3RfMSAqLwotICAgICAgICAgICAgazAgPSBrMCArIGs3OwotICAgICAgICAgICAgazcgPSBrMCAtIChrNyA8PCAxKTsKLSAgICAgICAgICAgIGsxID0gazEgKyBrNjsKLSAgICAgICAgICAgIGs2ID0gazEgLSAoazYgPDwgMSk7Ci0gICAgICAgICAgICBrMiA9IGsyICsgazU7Ci0gICAgICAgICAgICBrNSA9IGsyIC0gKGs1IDw8IDEpOwotICAgICAgICAgICAgazMgPSBrMyArIGs0OwotICAgICAgICAgICAgazQgPSBrMyAtIChrNCA8PCAxKTsKLQotICAgICAgICAgICAgazAgPSBrMCArIGszOwotICAgICAgICAgICAgazMgPSBrMCAtIChrMyA8PCAxKTsKLSAgICAgICAgICAgIGsxID0gazEgKyBrMjsKLSAgICAgICAgICAgIGsyID0gazEgLSAoazIgPDwgMSk7Ci0KLSAgICAgICAgICAgIGswID0gazAgKyBrMTsKLSAgICAgICAgICAgIC8qKioqKioqKioqLwotICAgICAgICAgICAgZHN0WzBdID0gazA7Ci0gICAgICAgICAgICAvKiBmZGN0XzIgKi8KLSAgICAgICAgICAgIGs0ID0gazQgKyBrNTsKLSAgICAgICAgICAgIGs1ID0gazUgKyBrNjsKLSAgICAgICAgICAgIGs2ID0gazYgKyBrNzsKLSAgICAgICAgICAgIC8qIE1VTDJDIGsyLGs1LDcyNCxGRENUX1NISUZUICovCi0gICAgICAgICAgICAvKiBrMCwgazEgYmVjb21lIHNjcmF0Y2ggKi8KLSAgICAgICAgICAgIC8qIGFzc3VtZSBGQVNUIE1VTFRJUExZICovCi0gICAgICAgICAgICBrMSA9IG1sYTcyNChrMTIsIGs1LCByb3VuZCk7Ci0KLSAgICAgICAgICAgIGs1ID0gazEgPj4gRkRDVF9TSElGVDsKLSAgICAgICAgICAgIC8qKioqKioqKioqKioqKioqKi8KLSAgICAgICAgICAgIC8qKioqKioqKi8KLSAgICAgICAgICAgIC8qIGZkY3RfMyAqLwotICAgICAgICAgICAgLyogUk9UQVRFIGs0LGs2LDM5Miw5NDYsIEZEQ1RfU0hJRlQgKi8KLSAgICAgICAgICAgIC8qIGFzc3VtZSBGQVNUIE1VTFRJUExZICovCi0gICAgICAgICAgICAvKiBrMCwgazEgYXJlIG91dHB1dCAqLwotICAgICAgICAgICAgazEgPSBtbGEzOTIoazQsIGsxNCwgcm91bmQpOwotICAgICAgICAgICAgazEgPSBtbGE5NDYoazYsIGsxNCwgazEpOwotCi0gICAgICAgICAgICBrNiA9IGsxID4+IEZEQ1RfU0hJRlQ7Ci0gICAgICAgICAgICAvKioqKioqKioqKioqKioqKioqKioqKiovCi0gICAgICAgICAgICBrNSA9IGs1ICsgazc7Ci0gICAgICAgICAgICBrNSA9IGs1ICsgazY7Ci0gICAgICAgICAgICAvKioqKioqKiovCi0gICAgICAgICAgICBkc3RbMV0gPSBrNTsKLSAgICAgICAgICAgIGRzdCArPSA4OwotICAgICAgICB9Ci0gICAgICAgIHdoaWxlIChkc3QgPCBvdXQpOwotICAgICAgICBvdXQgLT0gNjQ7Ci0gICAgICAgIGRzdCA9IG91dCArIDI7Ci0gICAgICAgIC8qICBWZXJ0aWNhbCBCbG9jayBMb29wICAqLwotICAgICAgICBkbyAgLyogVmVydGljYWwgOHhEQ1QgbG9vcCAqLwotICAgICAgICB7Ci0gICAgICAgICAgICBrMCA9IG91dFswXTsKLSAgICAgICAgICAgIGsxID0gb3V0WzhdOwotICAgICAgICAgICAgazIgPSBvdXRbMTZdOwotICAgICAgICAgICAgazMgPSBvdXRbMjRdOwotICAgICAgICAgICAgazQgPSBvdXRbMzJdOwotICAgICAgICAgICAgazUgPSBvdXRbNDBdOwotICAgICAgICAgICAgazYgPSBvdXRbNDhdOwotICAgICAgICAgICAgazcgPSBvdXRbNTZdOwotCi0gICAgICAgICAgICBhYnNfc3VtID0gc3VtX2FicyhrMCwgazEsIGsyLCBrMywgazQsIGs1LCBrNiwgazcpOwotCi0gICAgICAgICAgICBpZiAoYWJzX3N1bSA8IENvbFRoKQotICAgICAgICAgICAgewotICAgICAgICAgICAgICAgIG91dFswXSA9IDB4N2ZmZjsKLSAgICAgICAgICAgICAgICBvdXQrKzsKLSAgICAgICAgICAgICAgICBjb250aW51ZTsKLSAgICAgICAgICAgIH0KLSAgICAgICAgICAgIC8qIGZkY3RfMSAqLwotICAgICAgICAgICAgazAgPSBrMCArIGs3OwotICAgICAgICAgICAgazcgPSBrMCAtIChrNyA8PCAxKTsKLSAgICAgICAgICAgIGsxID0gazEgKyBrNjsKLSAgICAgICAgICAgIGs2ID0gazEgLSAoazYgPDwgMSk7Ci0gICAgICAgICAgICBrMiA9IGsyICsgazU7Ci0gICAgICAgICAgICBrNSA9IGsyIC0gKGs1IDw8IDEpOwotICAgICAgICAgICAgazMgPSBrMyArIGs0OwotICAgICAgICAgICAgazQgPSBrMyAtIChrNCA8PCAxKTsKLQotICAgICAgICAgICAgazAgPSBrMCArIGszOwotICAgICAgICAgICAgazMgPSBrMCAtIChrMyA8PCAxKTsKLSAgICAgICAgICAgIGsxID0gazEgKyBrMjsKLSAgICAgICAgICAgIGsyID0gazEgLSAoazIgPDwgMSk7Ci0KLSAgICAgICAgICAgIGswID0gazAgKyBrMTsKLSAgICAgICAgICAgIC8qKioqKioqKioqLwotICAgICAgICAgICAgb3V0WzBdID0gazA7ICAgICAgICAvKiByb3cgMCAqLwotICAgICAgICAgICAgLyogZmRjdF8yICovCi0gICAgICAgICAgICBrNCA9IGs0ICsgazU7Ci0gICAgICAgICAgICBrNSA9IGs1ICsgazY7Ci0gICAgICAgICAgICBrNiA9IGs2ICsgazc7Ci0gICAgICAgICAgICAvKiBNVUwyQyBrMixrNSw3MjQsRkRDVF9TSElGVCAqLwotICAgICAgICAgICAgLyogazAsIGsxIGJlY29tZSBzY3JhdGNoICovCi0gICAgICAgICAgICAvKiBhc3N1bWUgRkFTVCBNVUxUSVBMWSAqLwotICAgICAgICAgICAgazEgPSBtbGE3MjQoazEyLCBrNSwgcm91bmQpOwotCi0gICAgICAgICAgICBrNSA9IGsxID4+IEZEQ1RfU0hJRlQ7Ci0gICAgICAgICAgICAvKioqKioqKioqKioqKioqKiovCi0gICAgICAgICAgICAvKioqKioqKiovCi0gICAgICAgICAgICAvKiBmZGN0XzMgKi8KLSAgICAgICAgICAgIC8qIFJPVEFURSBrNCxrNiwzOTIsOTQ2LCBGRENUX1NISUZUICovCi0gICAgICAgICAgICAvKiBhc3N1bWUgRkFTVCBNVUxUSVBMWSAqLwotICAgICAgICAgICAgLyogazAsIGsxIGFyZSBvdXRwdXQgKi8KLSAgICAgICAgICAgIGsxID0gbWxhMzkyKGs0LCBrMTQsIHJvdW5kKTsKLSAgICAgICAgICAgIGsxID0gbWxhOTQ2KGs2LCBrMTQsIGsxKTsKLQotICAgICAgICAgICAgazYgPSBrMSA+PiBGRENUX1NISUZUOwotICAgICAgICAgICAgLyoqKioqKioqKioqKioqKioqKioqKioqLwotICAgICAgICAgICAgazUgPSBrNSArIGs3OwotICAgICAgICAgICAgazUgPSBrNSArIGs2OwotICAgICAgICAgICAgLyoqKioqKioqLwotICAgICAgICAgICAgb3V0WzhdID0gazUgOyAgICAgICAvKiByb3cgMSAqLwotICAgICAgICAgICAgb3V0Kys7Ci0gICAgICAgIH0KLSAgICAgICAgd2hpbGUgKChVSW50KW91dCA8IChVSW50KWRzdCkgOwotCi0gICAgICAgIHJldHVybiA7Ci0gICAgfQotCi0gICAgLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotICAgIC8qICBGdW5jdGlvbjogICBCbG9ja0RDVF9BQU5JbnRyYQotICAgICAgICBEYXRlOiAgICAgICA4LzkvMDEKLSAgICAgICAgSW5wdXQ6ICAgICAgcmVjCi0gICAgICAgIE91dHB1dDogICAgIG91dFs2NF0gPT0+IG5leHQgYmxvY2sKLSAgICAgICAgUHVycG9zZTogICAgSW5wdXQgZGlyZWN0bHkgZnJvbSByZWMgZnJhbWUuCi0gICAgICAgIE1vZGlmaWVkOgotICAgICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotCi0gICAgVm9pZCBCbG9ja0RDVF9BQU5JbnRyYShTaG9ydCAqb3V0LCBVQ2hhciAqY3VyLCBVQ2hhciAqZHVtbXkyLCBJbnQgd2lkdGgpCi0gICAgewotICAgICAgICBTaG9ydCAqZHN0OwotICAgICAgICBJbnQgazAsIGsxLCBrMiwgazMsIGs0LCBrNSwgazYsIGs3OwotICAgICAgICBJbnQgcm91bmQ7Ci0gICAgICAgIEludCBrMTIgPSAweDAyMkEwMkQ0OwotICAgICAgICBJbnQgazE0ID0gMHgwMTg4MDUzQTsKLSAgICAgICAgSW50IGFic19zdW07Ci0gICAgICAgIEludCBtYXNrOwotICAgICAgICBJbnQgKmN1ckludCwgdG1wOwotICAgICAgICBJbnQgQ29sVGg7Ci0KLSAgICAgICAgT1NDTF9VTlVTRURfQVJHKGR1bW15Mik7Ci0KLSAgICAgICAgZHN0ID0gb3V0ICsgNjQgOwotICAgICAgICBDb2xUaCA9ICpkc3Q7Ci0gICAgICAgIG91dCArPSAxMjg7Ci0gICAgICAgIHJvdW5kID0gMSA8PCAoRkRDVF9TSElGVCAtIDEpOwotCi0gICAgICAgIGRvICAvKiBmZGN0X25leHRyb3cgKi8KLSAgICAgICAgewotICAgICAgICAgICAgbWFzayA9IDB4MUZFOwotICAgICAgICAgICAgY3VySW50ID0gKEludCopIGN1cjsKLSAgICAgICAgICAgIHRtcCA9IGN1ckludFswXTsgICAgLyogY29udGFpbnMgNCBwaXhlbHMgKi8KLSAgICAgICAgICAgIGswID0gbWFzayAmICh0bXAgPDwgMSk7Ci0gICAgICAgICAgICBrMSA9IG1hc2sgJiAodG1wID4+IDcpOwotICAgICAgICAgICAgazIgPSBtYXNrICYgKHRtcCA+PiAxNSk7Ci0gICAgICAgICAgICBrMyA9IG1hc2sgJiAodG1wID4+IDIzKTsKLSAgICAgICAgICAgIHRtcCA9IGN1ckludFsxXTsgICAgLyogYW5vdGhlciA0IHBpeGVscyAqLwotICAgICAgICAgICAgazQgPSAgbWFzayAmICh0bXAgPDwgMSk7Ci0gICAgICAgICAgICBrNSA9ICBtYXNrICYgKHRtcCA+PiA3KTsKLSAgICAgICAgICAgIGs2ID0gIG1hc2sgJiAodG1wID4+IDE1KTsKLSAgICAgICAgICAgIGs3ID0gIG1hc2sgJiAodG1wID4+IDIzKTsKLSAgICAgICAgICAgIGN1ciArPSB3aWR0aDsKLSAgICAgICAgICAgIC8qIGZkY3RfMSAqLwotICAgICAgICAgICAgazAgPSBrMCArIGs3OwotICAgICAgICAgICAgazcgPSBrMCAtIChrNyA8PCAxKTsKLSAgICAgICAgICAgIGsxID0gazEgKyBrNjsKLSAgICAgICAgICAgIGs2ID0gazEgLSAoazYgPDwgMSk7Ci0gICAgICAgICAgICBrMiA9IGsyICsgazU7Ci0gICAgICAgICAgICBrNSA9IGsyIC0gKGs1IDw8IDEpOwotICAgICAgICAgICAgazMgPSBrMyArIGs0OwotICAgICAgICAgICAgazQgPSBrMyAtIChrNCA8PCAxKTsKLQotICAgICAgICAgICAgazAgPSBrMCArIGszOwotICAgICAgICAgICAgazMgPSBrMCAtIChrMyA8PCAxKTsKLSAgICAgICAgICAgIGsxID0gazEgKyBrMjsKLSAgICAgICAgICAgIGsyID0gazEgLSAoazIgPDwgMSk7Ci0KLSAgICAgICAgICAgIGswID0gazAgKyBrMTsKLSAgICAgICAgICAgIGsxID0gazAgLSAoazEgPDwgMSk7Ci0gICAgICAgICAgICAvKioqKioqKioqKi8KLSAgICAgICAgICAgIGRzdFswXSA9IGswOwotICAgICAgICAgICAgZHN0WzRdID0gazE7IC8qIGNvbC4gNCAqLwotICAgICAgICAgICAgLyogZmRjdF8yICovCi0gICAgICAgICAgICBrNCA9IGs0ICsgazU7Ci0gICAgICAgICAgICBrNSA9IGs1ICsgazY7Ci0gICAgICAgICAgICBrNiA9IGs2ICsgazc7Ci0gICAgICAgICAgICBrMiA9IGsyICsgazM7Ci0gICAgICAgICAgICAvKiBNVUwyQyBrMixrNSw3MjQsRkRDVF9TSElGVCAqLwotICAgICAgICAgICAgLyogazAsIGsxIGJlY29tZSBzY3JhdGNoICovCi0gICAgICAgICAgICAvKiBhc3N1bWUgRkFTVCBNVUxUSVBMWSAqLwotICAgICAgICAgICAgazEgPSBtbGE3MjQoazEyLCBrNSwgcm91bmQpOwotICAgICAgICAgICAgazAgPSBtbGE3MjQoazEyLCBrMiwgcm91bmQpOwotCi0gICAgICAgICAgICBrNSA9IGsxID4+IEZEQ1RfU0hJRlQ7Ci0gICAgICAgICAgICBrMiA9IGswID4+IEZEQ1RfU0hJRlQ7Ci0gICAgICAgICAgICAvKioqKioqKioqKioqKioqKiovCi0gICAgICAgICAgICBrMiA9IGsyICsgazM7Ci0gICAgICAgICAgICBrMyA9IChrMyA8PCAxKSAtIGsyOwotICAgICAgICAgICAgLyoqKioqKioqLwotICAgICAgICAgICAgZHN0WzJdID0gazI7ICAgICAgICAvKiBjb2wuIDIgKi8KLSAgICAgICAgICAgIGszIDw8PSAxOyAgICAgICAvKiBzY2FsZSB1cCBjb2wuIDYgKi8KLSAgICAgICAgICAgIGRzdFs2XSA9IGszOyAvKiBjb2wuIDYgKi8KLSAgICAgICAgICAgIC8qIGZkY3RfMyAqLwotICAgICAgICAgICAgLyogUk9UQVRFIGs0LGs2LDM5Miw5NDYsIEZEQ1RfU0hJRlQgKi8KLSAgICAgICAgICAgIC8qIGFzc3VtZSBGQVNUIE1VTFRJUExZICovCi0gICAgICAgICAgICAvKiBrMCwgazEgYXJlIG91dHB1dCAqLwotICAgICAgICAgICAgazAgPSBrNCAtIGs2OwotCi0gICAgICAgICAgICBrMSA9IG1sYTM5MihrMCwgazE0LCByb3VuZCk7Ci0gICAgICAgICAgICBrMCA9IG1sYTU1NChrNCwgazEyLCBrMSk7Ci0gICAgICAgICAgICBrMSA9IG1sYTEzMzgoazYsIGsxNCwgazEpOwotCi0gICAgICAgICAgICBrNCA9IGswID4+IEZEQ1RfU0hJRlQ7Ci0gICAgICAgICAgICBrNiA9IGsxID4+IEZEQ1RfU0hJRlQ7Ci0gICAgICAgICAgICAvKioqKioqKioqKioqKioqKioqKioqKiovCi0gICAgICAgICAgICBrNSA9IGs1ICsgazc7Ci0gICAgICAgICAgICBrNyA9IChrNyA8PCAxKSAtIGs1OwotICAgICAgICAgICAgazQgPSBrNCArIGs3OwotICAgICAgICAgICAgazcgPSAoazcgPDwgMSkgLSBrNDsKLSAgICAgICAgICAgIGs1ID0gazUgKyBrNjsKLSAgICAgICAgICAgIGs0IDw8PSAxOyAgICAgICAvKiBzY2FsZSB1cCBjb2wuNSAqLwotICAgICAgICAgICAgazYgPSBrNSAtIChrNiA8PCAxKTsKLSAgICAgICAgICAgIC8qKioqKioqKi8KLSAgICAgICAgICAgIGRzdFs1XSA9IGs0OyAgICAvKiBjb2wuIDUgKi8KLSAgICAgICAgICAgIGs2IDw8PSAyOyAgICAgICAvKiBzY2FsZSB1cCBjb2wuIDcgKi8KLSAgICAgICAgICAgIGRzdFsxXSA9IGs1OyAgICAvKiBjb2wuIDEgKi8KLSAgICAgICAgICAgIGRzdFs3XSA9IGs2OyAgICAvKiBjb2wuIDcgKi8KLSAgICAgICAgICAgIGRzdFszXSA9IGs3OyAgICAvKiBjb2wuIDMgKi8KLSAgICAgICAgICAgIGRzdCArPSA4OwotICAgICAgICB9Ci0gICAgICAgIHdoaWxlIChkc3QgPCBvdXQpOwotCi0gICAgICAgIG91dCAtPSA2NDsKLSAgICAgICAgZHN0ID0gb3V0ICsgODsKLQotICAgICAgICAvKiAgVmVydGljYWwgQmxvY2sgTG9vcCAgKi8KLSAgICAgICAgZG8gIC8qIFZlcnRpY2FsIDh4RENUIGxvb3AgKi8KLSAgICAgICAgewotICAgICAgICAgICAgazAgPSBvdXRbMF07Ci0gICAgICAgICAgICBrMSA9IG91dFs4XTsKLSAgICAgICAgICAgIGsyID0gb3V0WzE2XTsKLSAgICAgICAgICAgIGszID0gb3V0WzI0XTsKLSAgICAgICAgICAgIGs0ID0gb3V0WzMyXTsKLSAgICAgICAgICAgIGs1ID0gb3V0WzQwXTsKLSAgICAgICAgICAgIGs2ID0gb3V0WzQ4XTsKLSAgICAgICAgICAgIGs3ID0gb3V0WzU2XTsKLSAgICAgICAgICAgIC8qIGRlYWR6b25lIHRocmVzaG9sZGluZyBmb3IgY29sdW1uICovCi0KLSAgICAgICAgICAgIGFic19zdW0gPSBzdW1fYWJzKGswLCBrMSwgazIsIGszLCBrNCwgazUsIGs2LCBrNyk7Ci0KLSAgICAgICAgICAgIGlmIChhYnNfc3VtIDwgQ29sVGgpCi0gICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgb3V0WzBdID0gMHg3ZmZmOwotICAgICAgICAgICAgICAgIG91dCsrOwotICAgICAgICAgICAgICAgIGNvbnRpbnVlOwotICAgICAgICAgICAgfQotCi0gICAgICAgICAgICAvKiBmZGN0XzEgKi8KLSAgICAgICAgICAgIGswID0gazAgKyBrNzsKLSAgICAgICAgICAgIGs3ID0gazAgLSAoazcgPDwgMSk7Ci0gICAgICAgICAgICBrMSA9IGsxICsgazY7Ci0gICAgICAgICAgICBrNiA9IGsxIC0gKGs2IDw8IDEpOwotICAgICAgICAgICAgazIgPSBrMiArIGs1OwotICAgICAgICAgICAgazUgPSBrMiAtIChrNSA8PCAxKTsKLSAgICAgICAgICAgIGszID0gazMgKyBrNDsKLSAgICAgICAgICAgIGs0ID0gazMgLSAoazQgPDwgMSk7Ci0KLSAgICAgICAgICAgIGswID0gazAgKyBrMzsKLSAgICAgICAgICAgIGszID0gazAgLSAoazMgPDwgMSk7Ci0gICAgICAgICAgICBrMSA9IGsxICsgazI7Ci0gICAgICAgICAgICBrMiA9IGsxIC0gKGsyIDw8IDEpOwotCi0gICAgICAgICAgICBrMCA9IGswICsgazE7Ci0gICAgICAgICAgICBrMSA9IGswIC0gKGsxIDw8IDEpOwotICAgICAgICAgICAgLyoqKioqKioqKiovCi0gICAgICAgICAgICBvdXRbMzJdID0gazE7IC8qIHJvdyA0ICovCi0gICAgICAgICAgICBvdXRbMF0gPSBrMDsgLyogcm93IDAgKi8KLSAgICAgICAgICAgIC8qIGZkY3RfMiAqLwotICAgICAgICAgICAgazQgPSBrNCArIGs1OwotICAgICAgICAgICAgazUgPSBrNSArIGs2OwotICAgICAgICAgICAgazYgPSBrNiArIGs3OwotICAgICAgICAgICAgazIgPSBrMiArIGszOwotICAgICAgICAgICAgLyogTVVMMkMgazIsazUsNzI0LEZEQ1RfU0hJRlQgKi8KLSAgICAgICAgICAgIC8qIGswLCBrMSBiZWNvbWUgc2NyYXRjaCAqLwotICAgICAgICAgICAgLyogYXNzdW1lIEZBU1QgTVVMVElQTFkgKi8KLSAgICAgICAgICAgIGsxID0gbWxhNzI0KGsxMiwgazUsIHJvdW5kKTsKLSAgICAgICAgICAgIGswID0gbWxhNzI0KGsxMiwgazIsIHJvdW5kKTsKLQotICAgICAgICAgICAgazUgPSBrMSA+PiBGRENUX1NISUZUOwotICAgICAgICAgICAgazIgPSBrMCA+PiBGRENUX1NISUZUOwotICAgICAgICAgICAgLyoqKioqKioqKioqKioqKioqLwotICAgICAgICAgICAgazIgPSBrMiArIGszOwotICAgICAgICAgICAgazMgPSAoazMgPDwgMSkgLSBrMjsKLSAgICAgICAgICAgIGszIDw8PSAxOyAgICAgICAvKiBzY2FsZSB1cCBjb2wuIDYgKi8KLSAgICAgICAgICAgIC8qKioqKioqKi8KLSAgICAgICAgICAgIG91dFs0OF0gPSBrMzsgICAvKiByb3cgNiAqLwotICAgICAgICAgICAgb3V0WzE2XSA9IGsyOyAgIC8qIHJvdyAyICovCi0gICAgICAgICAgICAvKiBmZGN0XzMgKi8KLSAgICAgICAgICAgIC8qIFJPVEFURSBrNCxrNiwzOTIsOTQ2LCBGRENUX1NISUZUICovCi0gICAgICAgICAgICAvKiBhc3N1bWUgRkFTVCBNVUxUSVBMWSAqLwotICAgICAgICAgICAgLyogazAsIGsxIGFyZSBvdXRwdXQgKi8KLSAgICAgICAgICAgIGswID0gazQgLSBrNjsKLQotICAgICAgICAgICAgazEgPSBtbGEzOTIoazAsIGsxNCwgcm91bmQpOwotICAgICAgICAgICAgazAgPSBtbGE1NTQoazQsIGsxMiwgazEpOwotICAgICAgICAgICAgazEgPSBtbGExMzM4KGs2LCBrMTQsIGsxKTsKLQotICAgICAgICAgICAgazQgPSBrMCA+PiBGRENUX1NISUZUOwotICAgICAgICAgICAgazYgPSBrMSA+PiBGRENUX1NISUZUOwotICAgICAgICAgICAgLyoqKioqKioqKioqKioqKioqKioqKioqLwotICAgICAgICAgICAgazUgPSBrNSArIGs3OwotICAgICAgICAgICAgazcgPSAoazcgPDwgMSkgLSBrNTsKLSAgICAgICAgICAgIGs0ID0gazQgKyBrNzsKLSAgICAgICAgICAgIGs3ID0gKGs3IDw8IDEpIC0gazQ7Ci0gICAgICAgICAgICBrNSA9IGs1ICsgazY7Ci0gICAgICAgICAgICBrNCA8PD0gMTsgICAgICAgLyogc2NhbGUgdXAgY29sLiA1ICovCi0gICAgICAgICAgICBrNiA9IGs1IC0gKGs2IDw8IDEpOwotICAgICAgICAgICAgLyoqKioqKioqLwotICAgICAgICAgICAgb3V0WzI0XSA9IGs3IDsgICAgLyogcm93IDMgKi8KLSAgICAgICAgICAgIGs2IDw8PSAyOyAgICAgICAvKiBzY2FsZSB1cCBjb2wuIDcgKi8KLSAgICAgICAgICAgIG91dFs1Nl0gPSBrNiA7ICAgLyogcm93IDcgKi8KLSAgICAgICAgICAgIG91dFs4XSA9IGs1IDsgICAgLyogcm93IDEgKi8KLSAgICAgICAgICAgIG91dFs0MF0gPSBrNCA7ICAgLyogcm93IDUgKi8KLSAgICAgICAgICAgIG91dCsrOwotICAgICAgICB9Ci0gICAgICAgIHdoaWxlICgoVUludClvdXQgPCAoVUludClkc3QpIDsKLQotICAgICAgICByZXR1cm4gOwotICAgIH0KLQotICAgIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLSAgICAvKiAgRnVuY3Rpb246ICAgQmxvY2s0eDREQ1RfQUFOSW50cmEKLSAgICAgICAgRGF0ZTogICAgICAgOC85LzAxCi0gICAgICAgIElucHV0OiAgICAgIHByZXYKLSAgICAgICAgT3V0cHV0OiAgICAgb3V0WzY0XSA9PT4gbmV4dCBibG9jawotICAgICAgICBQdXJwb3NlOiAgICBJbnB1dCBkaXJlY3RseSBmcm9tIHByZXYgZnJhbWUuIG91dHB1dCAyeDIgRENUCi0gICAgICAgIE1vZGlmaWVkOgotICAgICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotCi0gICAgVm9pZCBCbG9jazR4NERDVF9BQU5JbnRyYShTaG9ydCAqb3V0LCBVQ2hhciAqY3VyLCBVQ2hhciAqZHVtbXkyLCBJbnQgd2lkdGgpCi0gICAgewotICAgICAgICBTaG9ydCAqZHN0OwotICAgICAgICByZWdpc3RlciBJbnQgazAsIGsxLCBrMiwgazMsIGs0LCBrNSwgazYsIGs3OwotICAgICAgICBJbnQgcm91bmQ7Ci0gICAgICAgIEludCBrMTIgPSAweDAyMkEwMkQ0OwotICAgICAgICBJbnQgazE0ID0gMHgwMTg4MDUzQTsKLSAgICAgICAgSW50IG1hc2s7Ci0gICAgICAgIEludCAqY3VySW50LCB0bXA7Ci0gICAgICAgIEludCBhYnNfc3VtOwotICAgICAgICBJbnQgQ29sVGg7Ci0KLSAgICAgICAgT1NDTF9VTlVTRURfQVJHKGR1bW15Mik7Ci0KLSAgICAgICAgZHN0ID0gb3V0ICsgNjQgOwotICAgICAgICBDb2xUaCA9ICpkc3Q7Ci0gICAgICAgIG91dCArPSAxMjg7Ci0gICAgICAgIHJvdW5kID0gMSA8PCAoRkRDVF9TSElGVCAtIDEpOwotCi0gICAgICAgIGRvICAvKiBmZGN0X25leHRyb3cgKi8KLSAgICAgICAgewotICAgICAgICAgICAgbWFzayA9IDB4MUZFOwotICAgICAgICAgICAgY3VySW50ID0gKEludCopIGN1cjsKLSAgICAgICAgICAgIHRtcCA9IGN1ckludFswXTsgICAgLyogY29udGFpbnMgNCBwaXhlbHMgKi8KLSAgICAgICAgICAgIGswID0gbWFzayAmICh0bXAgPDwgMSk7Ci0gICAgICAgICAgICBrMSA9IG1hc2sgJiAodG1wID4+IDcpOwotICAgICAgICAgICAgazIgPSBtYXNrICYgKHRtcCA+PiAxNSk7Ci0gICAgICAgICAgICBrMyA9IG1hc2sgJiAodG1wID4+IDIzKTsKLSAgICAgICAgICAgIHRtcCA9IGN1ckludFsxXTsgICAgLyogYW5vdGhlciA0IHBpeGVscyAqLwotICAgICAgICAgICAgazQgPSAgbWFzayAmICh0bXAgPDwgMSk7Ci0gICAgICAgICAgICBrNSA9ICBtYXNrICYgKHRtcCA+PiA3KTsKLSAgICAgICAgICAgIGs2ID0gIG1hc2sgJiAodG1wID4+IDE1KTsKLSAgICAgICAgICAgIGs3ID0gIG1hc2sgJiAodG1wID4+IDIzKTsKLSAgICAgICAgICAgIGN1ciArPSB3aWR0aDsKLSAgICAgICAgICAgIC8qIGZkY3RfMSAqLwotICAgICAgICAgICAgazAgPSBrMCArIGs3OwotICAgICAgICAgICAgazcgPSBrMCAtIChrNyA8PCAxKTsKLSAgICAgICAgICAgIGsxID0gazEgKyBrNjsKLSAgICAgICAgICAgIGs2ID0gazEgLSAoazYgPDwgMSk7Ci0gICAgICAgICAgICBrMiA9IGsyICsgazU7Ci0gICAgICAgICAgICBrNSA9IGsyIC0gKGs1IDw8IDEpOwotICAgICAgICAgICAgazMgPSBrMyArIGs0OwotICAgICAgICAgICAgazQgPSBrMyAtIChrNCA8PCAxKTsKLQotICAgICAgICAgICAgazAgPSBrMCArIGszOwotICAgICAgICAgICAgazMgPSBrMCAtIChrMyA8PCAxKTsKLSAgICAgICAgICAgIGsxID0gazEgKyBrMjsKLSAgICAgICAgICAgIGsyID0gazEgLSAoazIgPDwgMSk7Ci0KLSAgICAgICAgICAgIGswID0gazAgKyBrMTsKLSAgICAgICAgICAgIC8qKioqKioqKioqLwotICAgICAgICAgICAgZHN0WzBdID0gazA7Ci0gICAgICAgICAgICAvKiBmZGN0XzIgKi8KLSAgICAgICAgICAgIGs0ID0gazQgKyBrNTsKLSAgICAgICAgICAgIGs1ID0gazUgKyBrNjsKLSAgICAgICAgICAgIGs2ID0gazYgKyBrNzsKLSAgICAgICAgICAgIGsyID0gazIgKyBrMzsKLSAgICAgICAgICAgIC8qIE1VTDJDIGsyLGs1LDcyNCxGRENUX1NISUZUICovCi0gICAgICAgICAgICAvKiBrMCwgazEgYmVjb21lIHNjcmF0Y2ggKi8KLSAgICAgICAgICAgIC8qIGFzc3VtZSBGQVNUIE1VTFRJUExZICovCi0gICAgICAgICAgICBrMSA9IG1sYTcyNChrMTIsIGs1LCByb3VuZCk7Ci0gICAgICAgICAgICBrMCA9IG1sYTcyNChrMTIsIGsyLCByb3VuZCk7Ci0KLSAgICAgICAgICAgIGs1ID0gazEgPj4gRkRDVF9TSElGVDsKLSAgICAgICAgICAgIGsyID0gazAgPj4gRkRDVF9TSElGVDsKLSAgICAgICAgICAgIC8qKioqKioqKioqKioqKioqKi8KLSAgICAgICAgICAgIGsyID0gazIgKyBrMzsKLSAgICAgICAgICAgIC8qKioqKioqKi8KLSAgICAgICAgICAgIGRzdFsyXSA9IGsyOyAgICAgICAgLyogY29sLiAyICovCi0gICAgICAgICAgICAvKiBmZGN0XzMgKi8KLSAgICAgICAgICAgIC8qIFJPVEFURSBrNCxrNiwzOTIsOTQ2LCBGRENUX1NISUZUICovCi0gICAgICAgICAgICAvKiBhc3N1bWUgRkFTVCBNVUxUSVBMWSAqLwotICAgICAgICAgICAgLyogazAsIGsxIGFyZSBvdXRwdXQgKi8KLSAgICAgICAgICAgIGswID0gazQgLSBrNjsKLQotICAgICAgICAgICAgazEgPSBtbGEzOTIoazAsIGsxNCwgcm91bmQpOwotICAgICAgICAgICAgazAgPSBtbGE1NTQoazQsIGsxMiwgazEpOwotICAgICAgICAgICAgazEgPSBtbGExMzM4KGs2LCBrMTQsIGsxKTsKLQotICAgICAgICAgICAgazQgPSBrMCA+PiBGRENUX1NISUZUOwotICAgICAgICAgICAgazYgPSBrMSA+PiBGRENUX1NISUZUOwotICAgICAgICAgICAgLyoqKioqKioqKioqKioqKioqKioqKioqLwotICAgICAgICAgICAgazUgPSBrNSArIGs3OwotICAgICAgICAgICAgazcgPSAoazcgPDwgMSkgLSBrNTsKLSAgICAgICAgICAgIGs3ID0gazcgLSBrNDsKLSAgICAgICAgICAgIGs1ID0gazUgKyBrNjsKLSAgICAgICAgICAgIC8qKioqKioqKi8KLSAgICAgICAgICAgIGRzdFsxXSA9IGs1OyAgICAgICAgLyogY29sLiAxICovCi0gICAgICAgICAgICBkc3RbM10gPSBrNzsgICAgICAgIC8qIGNvbC4gMyAqLwotICAgICAgICAgICAgZHN0ICs9IDg7Ci0gICAgICAgIH0KLSAgICAgICAgd2hpbGUgKGRzdCA8IG91dCk7Ci0KLSAgICAgICAgb3V0IC09IDY0OwotICAgICAgICBkc3QgPSBvdXQgKyA0OwotCi0gICAgICAgIC8qICBWZXJ0aWNhbCBCbG9jayBMb29wICAqLwotICAgICAgICBkbyAgLyogVmVydGljYWwgOHhEQ1QgbG9vcCAqLwotICAgICAgICB7Ci0gICAgICAgICAgICBrMCA9IG91dFswXTsKLSAgICAgICAgICAgIGsxID0gb3V0WzhdOwotICAgICAgICAgICAgazIgPSBvdXRbMTZdOwotICAgICAgICAgICAgazMgPSBvdXRbMjRdOwotICAgICAgICAgICAgazQgPSBvdXRbMzJdOwotICAgICAgICAgICAgazUgPSBvdXRbNDBdOwotICAgICAgICAgICAgazYgPSBvdXRbNDhdOwotICAgICAgICAgICAgazcgPSBvdXRbNTZdOwotCi0gICAgICAgICAgICBhYnNfc3VtID0gc3VtX2FicyhrMCwgazEsIGsyLCBrMywgazQsIGs1LCBrNiwgazcpOwotCi0gICAgICAgICAgICBpZiAoYWJzX3N1bSA8IENvbFRoKQotICAgICAgICAgICAgewotICAgICAgICAgICAgICAgIG91dFswXSA9IDB4N2ZmZjsKLSAgICAgICAgICAgICAgICBvdXQrKzsKLSAgICAgICAgICAgICAgICBjb250aW51ZTsKLSAgICAgICAgICAgIH0KLSAgICAgICAgICAgIC8qIGZkY3RfMSAqLwotICAgICAgICAgICAgazAgPSBrMCArIGs3OwotICAgICAgICAgICAgazcgPSBrMCAtIChrNyA8PCAxKTsKLSAgICAgICAgICAgIGsxID0gazEgKyBrNjsKLSAgICAgICAgICAgIGs2ID0gazEgLSAoazYgPDwgMSk7Ci0gICAgICAgICAgICBrMiA9IGsyICsgazU7Ci0gICAgICAgICAgICBrNSA9IGsyIC0gKGs1IDw8IDEpOwotICAgICAgICAgICAgazMgPSBrMyArIGs0OwotICAgICAgICAgICAgazQgPSBrMyAtIChrNCA8PCAxKTsKLQotICAgICAgICAgICAgazAgPSBrMCArIGszOwotICAgICAgICAgICAgazMgPSBrMCAtIChrMyA8PCAxKTsKLSAgICAgICAgICAgIGsxID0gazEgKyBrMjsKLSAgICAgICAgICAgIGsyID0gazEgLSAoazIgPDwgMSk7Ci0KLSAgICAgICAgICAgIGswID0gazAgKyBrMTsKLSAgICAgICAgICAgIC8qKioqKioqKioqLwotICAgICAgICAgICAgb3V0WzBdID0gazA7ICAgLyogcm93IDAgKi8KLSAgICAgICAgICAgIC8qIGZkY3RfMiAqLwotICAgICAgICAgICAgazQgPSBrNCArIGs1OwotICAgICAgICAgICAgazUgPSBrNSArIGs2OwotICAgICAgICAgICAgazYgPSBrNiArIGs3OwotICAgICAgICAgICAgazIgPSBrMiArIGszOwotICAgICAgICAgICAgLyogTVVMMkMgazIsazUsNzI0LEZEQ1RfU0hJRlQgKi8KLSAgICAgICAgICAgIC8qIGswLCBrMSBiZWNvbWUgc2NyYXRjaCAqLwotICAgICAgICAgICAgLyogYXNzdW1lIEZBU1QgTVVMVElQTFkgKi8KLSAgICAgICAgICAgIGsxID0gbWxhNzI0KGsxMiwgazUsIHJvdW5kKTsKLSAgICAgICAgICAgIGswID0gbWxhNzI0KGsxMiwgazIsIHJvdW5kKTsKLQotICAgICAgICAgICAgazUgPSBrMSA+PiBGRENUX1NISUZUOwotICAgICAgICAgICAgazIgPSBrMCA+PiBGRENUX1NISUZUOwotICAgICAgICAgICAgLyoqKioqKioqKioqKioqKioqLwotICAgICAgICAgICAgazIgPSBrMiArIGszOwotICAgICAgICAgICAgLyoqKioqKioqLwotICAgICAgICAgICAgb3V0WzE2XSA9IGsyOyAgICAgICAgICAgLyogcm93IDIgKi8KLSAgICAgICAgICAgIC8qIGZkY3RfMyAqLwotICAgICAgICAgICAgLyogUk9UQVRFIGs0LGs2LDM5Miw5NDYsIEZEQ1RfU0hJRlQgKi8KLSAgICAgICAgICAgIC8qIGFzc3VtZSBGQVNUIE1VTFRJUExZICovCi0gICAgICAgICAgICAvKiBrMCwgazEgYXJlIG91dHB1dCAqLwotICAgICAgICAgICAgazAgPSBrNCAtIGs2OwotCi0gICAgICAgICAgICBrMSA9IG1sYTM5MihrMCwgazE0LCByb3VuZCk7Ci0gICAgICAgICAgICBrMCA9IG1sYTU1NChrNCwgazEyLCBrMSk7Ci0gICAgICAgICAgICBrMSA9IG1sYTEzMzgoazYsIGsxNCwgazEpOwotCi0gICAgICAgICAgICBrNCA9IGswID4+IEZEQ1RfU0hJRlQ7Ci0gICAgICAgICAgICBrNiA9IGsxID4+IEZEQ1RfU0hJRlQ7Ci0gICAgICAgICAgICAvKioqKioqKioqKioqKioqKioqKioqKiovCi0gICAgICAgICAgICBrNSA9IGs1ICsgazc7Ci0gICAgICAgICAgICBrNyA9IChrNyA8PCAxKSAtIGs1OwotICAgICAgICAgICAgazcgPSBrNyAtIGs0IDsKLSAgICAgICAgICAgIGs1ID0gazUgKyBrNjsKLSAgICAgICAgICAgIC8qKioqKioqKi8KLSAgICAgICAgICAgIG91dFsyNF0gPSBrNyA7ICAgICAgLyogcm93IDMgKi8KLSAgICAgICAgICAgIG91dFs4XSA9IGs1IDsgICAgICAgLyogcm93IDEgKi8KLSAgICAgICAgICAgIG91dCsrOwotICAgICAgICB9Ci0gICAgICAgIHdoaWxlICgoVUludClvdXQgPCAoVUludClkc3QpIDsKLQotICAgICAgICByZXR1cm4gOwotICAgIH0KLQotICAgIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLSAgICAvKiAgRnVuY3Rpb246ICAgQmxvY2syeDJEQ1RfQUFOSW50cmEKLSAgICAgICAgRGF0ZTogICAgICAgOC85LzAxCi0gICAgICAgIElucHV0OiAgICAgIHByZXYKLSAgICAgICAgT3V0cHV0OiAgICAgb3V0WzY0XSA9PT4gbmV4dCBibG9jawotICAgICAgICBQdXJwb3NlOiAgICBJbnB1dCBkaXJlY3RseSBmcm9tIHByZXYgZnJhbWUuIG91dHB1dCAyeDIgRENUCi0gICAgICAgIE1vZGlmaWVkOgotICAgICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotCi0gICAgVm9pZCBCbG9jazJ4MkRDVF9BQU5JbnRyYShTaG9ydCAqb3V0LCBVQ2hhciAqY3VyLCBVQ2hhciAqZHVtbXkyLCBJbnQgd2lkdGgpCi0gICAgewotICAgICAgICBTaG9ydCAqZHN0OwotICAgICAgICByZWdpc3RlciBJbnQgazAsIGsxLCBrMiwgazMsIGs0LCBrNSwgazYsIGs3OwotICAgICAgICBJbnQgcm91bmQ7Ci0gICAgICAgIEludCBrMTIgPSAweDAyMkEwMkQ0OwotICAgICAgICBJbnQgazE0ID0gMHgwMTg4MDNCMjsKLSAgICAgICAgSW50IG1hc2s7Ci0gICAgICAgIEludCAqY3VySW50LCB0bXA7Ci0gICAgICAgIEludCBhYnNfc3VtOwotICAgICAgICBJbnQgQ29sVGg7Ci0KLSAgICAgICAgT1NDTF9VTlVTRURfQVJHKGR1bW15Mik7Ci0KLSAgICAgICAgZHN0ID0gb3V0ICsgNjQgOwotICAgICAgICBDb2xUaCA9ICpkc3Q7Ci0gICAgICAgIG91dCArPSAxMjg7Ci0gICAgICAgIHJvdW5kID0gMSA8PCAoRkRDVF9TSElGVCAtIDEpOwotCi0gICAgICAgIGRvICAvKiBmZGN0X25leHRyb3cgKi8KLSAgICAgICAgewotICAgICAgICAgICAgbWFzayA9IDB4MUZFOwotICAgICAgICAgICAgY3VySW50ID0gKEludCopIGN1cjsKLSAgICAgICAgICAgIHRtcCA9IGN1ckludFswXTsgICAgLyogY29udGFpbnMgNCBwaXhlbHMgKi8KLSAgICAgICAgICAgIGswID0gbWFzayAmICh0bXAgPDwgMSk7Ci0gICAgICAgICAgICBrMSA9IG1hc2sgJiAodG1wID4+IDcpOwotICAgICAgICAgICAgazIgPSBtYXNrICYgKHRtcCA+PiAxNSk7Ci0gICAgICAgICAgICBrMyA9IG1hc2sgJiAodG1wID4+IDIzKTsKLSAgICAgICAgICAgIHRtcCA9IGN1ckludFsxXTsgICAgLyogYW5vdGhlciA0IHBpeGVscyAqLwotICAgICAgICAgICAgazQgPSAgbWFzayAmICh0bXAgPDwgMSk7Ci0gICAgICAgICAgICBrNSA9ICBtYXNrICYgKHRtcCA+PiA3KTsKLSAgICAgICAgICAgIGs2ID0gIG1hc2sgJiAodG1wID4+IDE1KTsKLSAgICAgICAgICAgIGs3ID0gIG1hc2sgJiAodG1wID4+IDIzKTsKLSAgICAgICAgICAgIGN1ciArPSB3aWR0aDsKLQotICAgICAgICAgICAgLyogZmRjdF8xICovCi0gICAgICAgICAgICBrMCA9IGswICsgazc7Ci0gICAgICAgICAgICBrNyA9IGswIC0gKGs3IDw8IDEpOwotICAgICAgICAgICAgazEgPSBrMSArIGs2OwotICAgICAgICAgICAgazYgPSBrMSAtIChrNiA8PCAxKTsKLSAgICAgICAgICAgIGsyID0gazIgKyBrNTsKLSAgICAgICAgICAgIGs1ID0gazIgLSAoazUgPDwgMSk7Ci0gICAgICAgICAgICBrMyA9IGszICsgazQ7Ci0gICAgICAgICAgICBrNCA9IGszIC0gKGs0IDw8IDEpOwotCi0gICAgICAgICAgICBrMCA9IGswICsgazM7Ci0gICAgICAgICAgICBrMyA9IGswIC0gKGszIDw8IDEpOwotICAgICAgICAgICAgazEgPSBrMSArIGsyOwotICAgICAgICAgICAgazIgPSBrMSAtIChrMiA8PCAxKTsKLQotICAgICAgICAgICAgazAgPSBrMCArIGsxOwotICAgICAgICAgICAgLyoqKioqKioqKiovCi0gICAgICAgICAgICBkc3RbMF0gPSBrMDsKLSAgICAgICAgICAgIC8qIGZkY3RfMiAqLwotICAgICAgICAgICAgazQgPSBrNCArIGs1OwotICAgICAgICAgICAgazUgPSBrNSArIGs2OwotICAgICAgICAgICAgazYgPSBrNiArIGs3OwotICAgICAgICAgICAgLyogTVVMMkMgazIsazUsNzI0LEZEQ1RfU0hJRlQgKi8KLSAgICAgICAgICAgIC8qIGswLCBrMSBiZWNvbWUgc2NyYXRjaCAqLwotICAgICAgICAgICAgLyogYXNzdW1lIEZBU1QgTVVMVElQTFkgKi8KLSAgICAgICAgICAgIGsxID0gbWxhNzI0KGsxMiwgazUsIHJvdW5kKTsKLQotICAgICAgICAgICAgazUgPSBrMSA+PiBGRENUX1NISUZUOwotICAgICAgICAgICAgLyoqKioqKioqKioqKioqKioqLwotICAgICAgICAgICAgLyoqKioqKioqLwotICAgICAgICAgICAgLyogZmRjdF8zICovCi0gICAgICAgICAgICAvKiBST1RBVEUgazQsazYsMzkyLDk0NiwgRkRDVF9TSElGVCAqLwotICAgICAgICAgICAgLyogYXNzdW1lIEZBU1QgTVVMVElQTFkgKi8KLSAgICAgICAgICAgIC8qIGswLCBrMSBhcmUgb3V0cHV0ICovCi0gICAgICAgICAgICBrMSA9IG1sYTM5MihrNCwgazE0LCByb3VuZCk7Ci0gICAgICAgICAgICBrMSA9IG1sYTk0NihrNiwgazE0LCBrMSk7Ci0KLSAgICAgICAgICAgIGs2ID0gazEgPj4gRkRDVF9TSElGVDsKLSAgICAgICAgICAgIC8qKioqKioqKioqKioqKioqKioqKioqKi8KLSAgICAgICAgICAgIGs1ID0gazUgKyBrNzsKLSAgICAgICAgICAgIGs1ID0gazUgKyBrNjsKLSAgICAgICAgICAgIC8qKioqKioqKi8KLSAgICAgICAgICAgIGRzdFsxXSA9IGs1OwotICAgICAgICAgICAgZHN0ICs9IDg7Ci0gICAgICAgIH0KLSAgICAgICAgd2hpbGUgKGRzdCA8IG91dCk7Ci0gICAgICAgIG91dCAtPSA2NDsKLSAgICAgICAgZHN0ID0gb3V0ICsgMjsKLSAgICAgICAgLyogIFZlcnRpY2FsIEJsb2NrIExvb3AgICovCi0gICAgICAgIGRvICAvKiBWZXJ0aWNhbCA4eERDVCBsb29wICovCi0gICAgICAgIHsKLSAgICAgICAgICAgIGswID0gb3V0WzBdOwotICAgICAgICAgICAgazEgPSBvdXRbOF07Ci0gICAgICAgICAgICBrMiA9IG91dFsxNl07Ci0gICAgICAgICAgICBrMyA9IG91dFsyNF07Ci0gICAgICAgICAgICBrNCA9IG91dFszMl07Ci0gICAgICAgICAgICBrNSA9IG91dFs0MF07Ci0gICAgICAgICAgICBrNiA9IG91dFs0OF07Ci0gICAgICAgICAgICBrNyA9IG91dFs1Nl07Ci0KLSAgICAgICAgICAgIGFic19zdW0gPSBzdW1fYWJzKGswLCBrMSwgazIsIGszLCBrNCwgazUsIGs2LCBrNyk7Ci0KLSAgICAgICAgICAgIGlmIChhYnNfc3VtIDwgQ29sVGgpCi0gICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgb3V0WzBdID0gMHg3ZmZmOwotICAgICAgICAgICAgICAgIG91dCsrOwotICAgICAgICAgICAgICAgIGNvbnRpbnVlOwotICAgICAgICAgICAgfQotICAgICAgICAgICAgLyogZmRjdF8xICovCi0gICAgICAgICAgICBrMCA9IGswICsgazc7Ci0gICAgICAgICAgICBrNyA9IGswIC0gKGs3IDw8IDEpOwotICAgICAgICAgICAgazEgPSBrMSArIGs2OwotICAgICAgICAgICAgazYgPSBrMSAtIChrNiA8PCAxKTsKLSAgICAgICAgICAgIGsyID0gazIgKyBrNTsKLSAgICAgICAgICAgIGs1ID0gazIgLSAoazUgPDwgMSk7Ci0gICAgICAgICAgICBrMyA9IGszICsgazQ7Ci0gICAgICAgICAgICBrNCA9IGszIC0gKGs0IDw8IDEpOwotCi0gICAgICAgICAgICBrMCA9IGswICsgazM7Ci0gICAgICAgICAgICBrMyA9IGswIC0gKGszIDw8IDEpOwotICAgICAgICAgICAgazEgPSBrMSArIGsyOwotICAgICAgICAgICAgazIgPSBrMSAtIChrMiA8PCAxKTsKLQotICAgICAgICAgICAgazAgPSBrMCArIGsxOwotICAgICAgICAgICAgLyoqKioqKioqKiovCi0gICAgICAgICAgICBvdXRbMF0gPSBrMDsgICAgICAgIC8qIHJvdyAwICovCi0gICAgICAgICAgICAvKiBmZGN0XzIgKi8KLSAgICAgICAgICAgIGs0ID0gazQgKyBrNTsKLSAgICAgICAgICAgIGs1ID0gazUgKyBrNjsKLSAgICAgICAgICAgIGs2ID0gazYgKyBrNzsKLSAgICAgICAgICAgIC8qIE1VTDJDIGsyLGs1LDcyNCxGRENUX1NISUZUICovCi0gICAgICAgICAgICAvKiBrMCwgazEgYmVjb21lIHNjcmF0Y2ggKi8KLSAgICAgICAgICAgIC8qIGFzc3VtZSBGQVNUIE1VTFRJUExZICovCi0gICAgICAgICAgICBrMSA9IG1sYTcyNChrMTIsIGs1LCByb3VuZCk7Ci0KLSAgICAgICAgICAgIGs1ID0gazEgPj4gRkRDVF9TSElGVDsKLSAgICAgICAgICAgIC8qKioqKioqKioqKioqKioqKi8KLSAgICAgICAgICAgIC8qKioqKioqKi8KLSAgICAgICAgICAgIC8qIGZkY3RfMyAqLwotICAgICAgICAgICAgLyogUk9UQVRFIGs0LGs2LDM5Miw5NDYsIEZEQ1RfU0hJRlQgKi8KLSAgICAgICAgICAgIC8qIGFzc3VtZSBGQVNUIE1VTFRJUExZICovCi0gICAgICAgICAgICAvKiBrMCwgazEgYXJlIG91dHB1dCAqLwotICAgICAgICAgICAgazEgPSBtbGEzOTIoazQsIGsxNCwgcm91bmQpOwotICAgICAgICAgICAgazEgPSBtbGE5NDYoazYsIGsxNCwgazEpOwotCi0gICAgICAgICAgICBrNiA9IGsxID4+IEZEQ1RfU0hJRlQ7Ci0gICAgICAgICAgICAvKioqKioqKioqKioqKioqKioqKioqKiovCi0gICAgICAgICAgICBrNSA9IGs1ICsgazc7Ci0gICAgICAgICAgICBrNSA9IGs1ICsgazY7Ci0gICAgICAgICAgICAvKioqKioqKiovCi0gICAgICAgICAgICBvdXRbOF0gPSBrNSA7ICAgICAgIC8qIHJvdyAxICovCi0gICAgICAgICAgICBvdXQrKzsKLSAgICAgICAgfQotICAgICAgICB3aGlsZSAoKFVJbnQpb3V0IDwgKFVJbnQpZHN0KSA7Ci0KLSAgICAgICAgcmV0dXJuIDsKLSAgICB9Ci0gICAgLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotICAgIC8qICBGdW5jdGlvbjogICBCbG9jazF4MURDVHdTdWIKLSAgICAgICAgRGF0ZTogICAgICAgOC85LzAxCi0gICAgICAgIElucHV0OiAgICAgIGJsb2NrCi0gICAgICAgIE91dHB1dDogICAgIHkKLSAgICAgICAgUHVycG9zZTogICAgQ29tcHV0ZSBEQyB2YWx1ZSBvbmx5Ci0gICAgICAgIE1vZGlmaWVkOgotICAgICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotICAgIHZvaWQgQmxvY2sxeDFEQ1R3U3ViKFNob3J0ICpvdXQsIFVDaGFyICpjdXIsIFVDaGFyICpwcmVkLCBJbnQgd2lkdGgpCi0gICAgewotICAgICAgICBVQ2hhciAqZW5kOwotICAgICAgICBJbnQgdGVtcCA9IDA7Ci0gICAgICAgIEludCBvZmZzZXQyOwotCi0gICAgICAgIG9mZnNldDIgPSB3aWR0aCAtIDg7Ci0gICAgICAgIGVuZCA9IHByZWQgKyAoMTYgPDwgMyk7Ci0gICAgICAgIGRvCi0gICAgICAgIHsKLSAgICAgICAgICAgIHRlbXAgKz0gKCpjdXIrKyAtICpwcmVkKyspOwotICAgICAgICAgICAgdGVtcCArPSAoKmN1cisrIC0gKnByZWQrKyk7Ci0gICAgICAgICAgICB0ZW1wICs9ICgqY3VyKysgLSAqcHJlZCsrKTsKLSAgICAgICAgICAgIHRlbXAgKz0gKCpjdXIrKyAtICpwcmVkKyspOwotICAgICAgICAgICAgdGVtcCArPSAoKmN1cisrIC0gKnByZWQrKyk7Ci0gICAgICAgICAgICB0ZW1wICs9ICgqY3VyKysgLSAqcHJlZCsrKTsKLSAgICAgICAgICAgIHRlbXAgKz0gKCpjdXIrKyAtICpwcmVkKyspOwotICAgICAgICAgICAgdGVtcCArPSAoKmN1cisrIC0gKnByZWQrKyk7Ci0gICAgICAgICAgICBjdXIgKz0gb2Zmc2V0MjsKLSAgICAgICAgICAgIHByZWQgKz0gODsKLSAgICAgICAgfQotICAgICAgICB3aGlsZSAocHJlZCA8IGVuZCkgOwotCi0gICAgICAgIG91dFsxXSA9IG91dFsyXSA9IG91dFszXSA9IG91dFs0XSA9IG91dFs1XSA9IG91dFs2XSA9IG91dFs3XSA9IDA7Ci0gICAgICAgIG91dFswXSA9IHRlbXAgPj4gMzsKLQotICAgICAgICByZXR1cm4gOwotICAgIH0KLQotICAgIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLSAgICAvKiAgRnVuY3Rpb246ICAgQmxvY2sxeDFEQ1RJbnRyYQotICAgICAgICBEYXRlOiAgICAgICA4LzkvMDEKLSAgICAgICAgSW5wdXQ6ICAgICAgcHJldgotICAgICAgICBPdXRwdXQ6ICAgICBvdXQKLSAgICAgICAgUHVycG9zZTogICAgQ29tcHV0ZSBEQyB2YWx1ZSBvbmx5Ci0gICAgICAgIE1vZGlmaWVkOgotICAgICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotICAgIHZvaWQgQmxvY2sxeDFEQ1RJbnRyYShTaG9ydCAqb3V0LCBVQ2hhciAqY3VyLCBVQ2hhciAqZHVtbXkyLCBJbnQgd2lkdGgpCi0gICAgewotICAgICAgICBVQ2hhciAqZW5kOwotICAgICAgICBJbnQgdGVtcCA9IDA7Ci0gICAgICAgIFVMb25nIHdvcmQ7Ci0KLSAgICAgICAgT1NDTF9VTlVTRURfQVJHKGR1bW15Mik7Ci0KLSAgICAgICAgZW5kID0gY3VyICsgKHdpZHRoIDw8IDMpOwotICAgICAgICBkbwotICAgICAgICB7Ci0gICAgICAgICAgICB3b3JkID0gKigoVUxvbmcqKWN1cik7Ci0gICAgICAgICAgICB0ZW1wICs9ICh3b3JkID4+IDI0KTsKLSAgICAgICAgICAgIHRlbXAgKz0gKCh3b3JkID4+IDE2KSAmIDB4RkYpOwotICAgICAgICAgICAgdGVtcCArPSAoKHdvcmQgPj4gOCkgJiAweEZGKTsKLSAgICAgICAgICAgIHRlbXAgKz0gKHdvcmQgJiAweEZGKTsKLQotICAgICAgICAgICAgd29yZCA9ICooKFVMb25nKikoY3VyICsgNCkpOwotICAgICAgICAgICAgd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AgIDB4MjdDLCAweDI5QywgMHgyQ0MsIDB4MkVDLCAweDMxQywgMHgzM0MsIDB4MzZDLCAweDM4QywKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMHgzQkMsIDB4M0RDLCAweDQwQywgMHg0MkMsIDB4NDVDLCAweDQ3QywgMHg0QUMsIDB4NENDCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfTsKLQotY29uc3Qgc3RhdGljIEludCBDb2xUaEludHJhWzMyXSA9IHswLCAweDFDLCAweDNDLCAweDVDLCAweDdDLCAweDlDLCAweEJDLCAweERDLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAweEZDLCAweDExQywgMHgxM0MsIDB4MTVDLCAweDE3QywgMHgxOUMsIDB4MUJDLCAweDFEQywKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMHgxRkMsIDB4MjFDLCAweDIzQywgMHgyNUMsIDB4MjdDLCAweDI5QywgMHgyQkMsIDB4MkRDLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAweDJGQywgMHgzMUMsIDB4MzNDLCAweDM1QywgMHgzN0MsIDB4MzlDLCAweDNCQywgMHgzREMKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9OwotCi0vKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotLyoqKioqKioqKiogSURDVCBwYXJ0ICoqKioqKioqKioqKioqKioqKioqKioqKioqLwotY29uc3Qgc3RhdGljIHVuc2lnbmVkIGNoYXIgaW1hc2tbOF0gPSB7MTI4LCA2NCwgMzIsIDE2LCA4LCA0LCAyLCAxfTsKLWNvbnN0IHN0YXRpYyB1bnNpZ25lZCBjaGFyIG1hc2tbOF0gPSB7MHg3ZiwgMHhiZiwgMHhkZiwgMHhlZiwgMHhmNywgMHhmYiwgMHhmZCwgMHhmZX07Ci0KLSNkZWZpbmUgVzEgMjg0MSAgICAgICAgICAgICAgICAgLyogMjA0OCpzcXJ0KDIpKmNvcygxKnBpLzE2KSAqLwotI2RlZmluZSBXMiAyNjc2ICAgICAgICAgICAgICAgICAvKiAyMDQ4KnNxcnQoMikqY29zKDIqcGkvMTYpICovCi0jZGVmaW5lIFczIDI0MDggICAgICAgICAgICAgICAgIC8qIDIwNDgqc3FydCgyKSpjb3MoMypwaS8xNikgKi8KLSNkZWZpbmUgVzUgMTYwOSAgICAgICAgICAgICAgICAgLyogMjA0OCpzcXJ0KDIpKmNvcyg1KnBpLzE2KSAqLwotI2RlZmluZSBXNiAxMTA4ICAgICAgICAgICAgICAgICAvKiAyMDQ4KnNxcnQoMikqY29zKDYqcGkvMTYpICovCi0jZGVmaW5lIFc3IDU2NSAgICAgICAgICAgICAgICAgIC8qIDIwNDgqc3FydCgyKSpjb3MoNypwaS8xNikgKi8KLQotI2lmZGVmIF9fY3BsdXNwbHVzCi1leHRlcm4gIkMiCi17Ci0jZW5kaWYKLQotICAgIC8qIFJlZHVjZWQgaW5wdXQgSURDVCAqLwotICAgIHZvaWQgaWRjdF9jb2wwKFNob3J0ICpibGspOwotICAgIHZvaWQgaWRjdF9jb2wxKFNob3J0ICpibGspOwotICAgIHZvaWQgaWRjdF9jb2wyKFNob3J0ICpibGspOwotICAgIHZvaWQgaWRjdF9jb2wzKFNob3J0ICpibGspOwotICAgIHZvaWQgaWRjdF9jb2w0KFNob3J0ICpibGspOwotICAgIHZvaWQgaWRjdF9jb2wweDQwKFNob3J0ICpibGspOwotICAgIHZvaWQgaWRjdF9jb2wweDIwKFNob3J0ICpibGspOwotICAgIHZvaWQgaWRjdF9jb2wweDEwKFNob3J0ICpibGspOwotCi0gICAgdm9pZCBpZGN0X3Jvd0ludGVyKFNob3J0ICpzcmNlLCBVQ2hhciAqcmVjLCBJbnQgbHgpOwotICAgIHZvaWQgaWRjdF9yb3cwSW50ZXIoU2hvcnQgKmJsaywgVUNoYXIgKnJlYywgSW50IGx4KTsKLSAgICB2b2lkIGlkY3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2Z0d2FyZQotICogZGlzdHJpYnV0ZWQgdW5kZXIgdGhlIExpY2Vuc2UgaXMgZGlzdHJpYnV0ZWQgb24gYW4gIkFTIElTIiBCQVNJUywKLSAqIFdJVEhPVVQgV0FSUkFOVElFUyBPUiBDT05ESVRJT05TIE9GIEFOWSBLSU5ELCBlaXRoZXIKLSAqIGV4cHJlc3Mgb3IgaW1wbGllZC4KLSAqIFNlZSB0aGUgTGljZW5zZSBmb3IgdGhlIHNwZWNpZmljIGxhbmd1YWdlIGdvdmVybmluZyBwZXJtaXNzaW9ucwotICogYW5kIGxpbWl0YXRpb25zIHVuZGVyIHRoZSBMaWNlbnNlLgotICogLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLQotICovCi0vKiAgRmlsZW5hbWU6IGRjdF9pbmxpbmUuaCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgRGVzY3JpcHRpb246IEltcGxlbWVudGF0aW9uIGZvciBpbi1saW5lIGZ1bmN0aW9ucyB1c2VkIGluIGRjdC5jcHAgICAgICAgICAgICovCi0vKiAgTW9kaWZpZWQ6ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotI2lmbmRlZiBfRENUX0lOTElORV9IXwotI2RlZmluZSBfRENUX0lOTElORV9IXwotCi0jaWYgIWRlZmluZWQoUFZfQVJNX0dDQ19WNSkgJiYgIWRlZmluZWQoUFZfQVJNX0dDQ19WNCkKLQotX19pbmxpbmUgaW50MzIgbWxhNzI0KGludDMyIG9wMSwgaW50MzIgb3AyLCBpbnQzMiBvcDMpCi17Ci0gICAgaW50MzIgb3V0OwotCi0gICAgT1NDTF9VTlVTRURfQVJHKG9wMSk7Ci0KLSAgICBvdXQgPSBvcDIgKiA3MjQgKyBvcDM7IC8qIG9wMSBpcyBub3QgdXNlZCBoZXJlICovCi0KLSAgICByZXR1cm4gb3V0OwotfQotCi1fX2lubGluZSBpbnQzMiBtbGEzOTIoaW50MzIgazAsIGludDMyIGsxNCwgaW50MzIgcm91bmQpCi17Ci0gICAgaW50MzIgazE7Ci0KLSAgICBPU0NMX1VOVVNFRF9BUkcoazE0KTsKLQotICAgIGsxID0gazAgKiAzOTIgKyByb3VuZDsKLQotICAgIHJldHVybiBrMTsKLX0KLQotX19pbmxpbmUgaW50MzIgbWxhNTU0KGludDMyIGs0LCBpbnQzMiBrMTIsIGludDMyIGsxKQotewotICAgIGludDMyIGswOwotCi0gICAgT1NDTF9VTlVTRURfQVJHKGsxMik7Ci0KLSAgICBrMCA9IGs0ICogNTU0ICsgazE7Ci0KLSAgICByZXR1cm4gazA7Ci19Ci0KLV9faW5saW5lIGludDMyIG1sYTEzMzgoaW50MzIgazYsIGludDMyIGsxNCwgaW50MzIgazEpCi17Ci0gICAgaW50MzIgb3V0OwotCi0gICAgT1NDTF9VTlVTRURfQVJHKGsxNCk7Ci0KLSAgICBvdXQgPSBrNiAqIDEzMzggKyBrMTsKLQotICAgIHJldHVybiBvdXQ7Ci19Ci0KLV9faW5saW5lIGludDMyIG1sYTk0NihpbnQzMiBrNiwgaW50MzIgazE0LCBpbnQzMiBrMSkKLXsKLSAgICBpbnQzMiBvdXQ7Ci0KLSAgICBPU0NMX1VOVVNFRF9BUkcoazE0KTsKLQotICAgIG91dCA9IGs2ICogOTQ2ICsgazE7Ci0KLSAgICByZXR1cm4gb3V0OwotfQotCi1fX2lubGluZSBpbnQzMiBzdW1fYWJzKGludDMyIGswLCBpbnQzMiBrMSwgaW50MzIgazIsIGludDMyIGszLAotICAgICAgICAgICAgICAgICAgICAgICBpbnQzMiBrNCwgaW50MzIgazUsIGludDMyIGs2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MiBtbGEzOTIoaW50MzIgazAsIGludDMyIGsxNCwgaW50MzIgcm91bmQpCi17Ci0gICAgaW50MzIgazE7Ci0KLSAgICBfX2FzbQotICAgIHsKLSAgICAgICAgc21sYWJ0IGsxLCBrMCwgazE0LCByb3VuZAotICAgIH0KLQotICAgIHJldHVybiBrMTsKLX0KLQotX19pbmxpbmUgaW50MzIgbWxhNTU0KGludDMyIGs0LCBpbnQzMiBrMTIsIGludDMyIGsxKQotewotICAgIGludDMyIGswOwotCi0gICAgX19hc20KLSAgICB7Ci0gICAgICAgIHNtbGFidCBrMCwgazQsIGsxMiwgazEKLSAgICB9Ci0KLSAgICByZXR1cm4gazA7Ci19Ci0KLV9faW5saW5lIGludDMyIG1sYTEzMzgoaW50MzIgazYsIGludDMyIGsxNCwgaW50MzIgazEpCi17Ci0gICAgaW50MzIgb3V0OwotCi0gICAgX19hc20KLSAgICB7Ci0gICAgICAgIHNtbGFiYiBvdXQsIGs2LCBrMTQsIGsxCi0gICAgfQotCi0gICAgcmV0dXJuIG91dDsKLX0KLQotX19pbmxpbmUgaW50MzIgbWxhOTQ2KGludDMyIGs2LCBpbnQzMiBrMTQsIGludDMyIGsxKQotewotICAgIGludDMyIG91dDsKLQotICAgIF9fYXNtCi0gICAgewotICAgICAgICBzbWxhYmIgb3V0LCBrNiwgazE0LCBrMQotICAgIH0KLQotICAgIHJldHVybiBvdXQ7Ci19Ci0KLSNlbHNlIC8vIG5vdCBBUk01VEUKLQotCi1fX2lubGluZSBpbnQzMiBtbGE3MjQoaW50MzIgb3AxLCBpbnQzMiBvcDIsIGludDMyIG9wMykKLXsKLSAgICBpbnQzMiBvdXQ7Ci0KLSAgICBfX2FzbQotICAgIHsKLSAgICAgICAgYW5kIG91dCwgb3AyLCAjMHhGRkZGCi0gICAgICAgIG1sYSBvdXQsIG9wMSwgb3V0LCBvcDMKLSAgICB9Ci0KLSAgICByZXR1cm4gb3V0OwotfQotCi1fX2lubGluZSBpbnQzMiBtbGEzOTIoaW50MzIgazAsIGludDMyIGsxNCwgaW50MzIgcm91bmQpCi17Ci0gICAgaW50MzIgazE7Ci0KLSAgICBfX2FzbQotICAgIHsKLSAgICAgICAgbW92IGsxLCBrMTQsIGFzciAjMTYKLSAgICAgICAgbWxhIGsxLCBrMCwgazEsIHJvdW5kCi0gICAgfQotCi0gICAgcmV0dXJuIGsxOwotfQotCi1fX2lubGluZSBpbnQzMiBtbGE1NTQoaW50MzIgazQsIGludDMyIGsxMiwgaW50MzIgazEpCi17Ci0gICAgaW50MzIgazA7Ci0KLSAgICBfX2FzbQotICAgIHsKLSAgICAgICAgbW92ICBrMCwgazEyLCBhc3IgIzE2Ci0gICAgICAgIG1sYSBrMCwgazQsIGswLCBrMQotICAgIH0KLQotICAgIHJldHVybiBrMDsKLX0KLQotX19pbmxpbmUgaW50MzIgbWxhMTMzOChpbnQzMiBrNiwgaW50MzIgazE0LCBpbnQzMiBrMSkKLXsKLSAgICBpbnQzMiBvdXQ7Ci0KLSAgICBfX2FzbQotICAgIHsKLSAgICAgICAgYW5kIG91dCwgazE0LCAweEZGRkYKLSAgICAgICAgbWxhIG91dCwgazYsIG91dCwgazEKLSAgICB9Ci0KLSAgICByZXR1cm4gb3V0OwotfQotCi1fX2lubGluZSBpbnQzMiBtbGE5NDYoaW50MzIgazYsIGludDMyIGsxNCwgaW50MzIgazEpCi17Ci0gICAgaW50MzIgb3V0OwotCi0gICAgX19hc20KLSAgICB7Ci0gICAgICAgIGFuZCBvdXQsIGsxNCwgMHhGRkZGCi0gICAgICAgIG1sYSBvdXQsIGs2LCBvdXQsIGsxCi0gICAgfQotCi0gICAgcmV0dXJuIG91dDsKLX0KLQotI2VuZGlmCi0KLV9faW5saW5lIGludDMyIHN1bV9hYnMoaW50MzIgazAsIGludDMyIGsxLCBpbnQzMiBrMiwgaW50MzIgazMsCi0gICAgICAgICAgICAgICAgICAgICAgIGludDMyIGs0LCBpbnQzMiBrNSwgaW50MzIgazYsIGludDMyIGs3KQotewotICAgIGludDM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DIsIGludDMyIG9wMykKLXsKLSAgICByZWdpc3RlciBpbnQzMiBvdXQ7Ci0gICAgcmVnaXN0ZXIgaW50MzIgYWEgPSAoaW50MzIpb3AxOwotICAgIHJlZ2lzdGVyIGludDMyIGJiID0gKGludDMyKW9wMjsKLSAgICByZWdpc3RlciBpbnQzMiBjYyA9IChpbnQzMilvcDM7Ci0KLSAgICBhc20gdm9sYXRpbGUoInNtbGFiYiAlMCwgJTEsICUyLCAlMyIKLSAgICAgICAgICAgICA6ICI9JnIiKG91dCkKLSAgICAgICAgICAgICAgICAgICAgICAgICA6ICJyIihhYSksCi0gICAgICAgICAgICAgICAgICAgICAgICAgInIiKGJiKSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAiciIoY2MpKTsKLSAgICByZXR1cm4gb3V0OwotfQotCi0KLV9faW5saW5lIGludDMyIG1sYTM5MihpbnQzMiBrMCwgaW50MzIgazE0LCBpbnQzMiByb3VuZCkKLXsKLSAgICByZWdpc3RlciBpbnQzMiBvdXQ7Ci0gICAgcmVnaXN0ZXIgaW50MzIgYWEgPSAoaW50MzIpazA7Ci0gICAgcmVnaXN0ZXIgaW50MzIgYmIgPSAoaW50MzIpazE0OwotICAgIHJlZ2lzdGVyIGludDMyIGNjID0gKGludDMyKXJvdW5kOwotCi0gICAgYXNtIHZvbGF0aWxlKCJzbWxhYnQgJTAsICUxLCAlMiwgJTMiCi0gICAgICAgICAgICAgOiAiPSZyIihvdXQpCi0gICAgICAgICAgICAgICAgICAgICAgICAgOiAiciIoYWEpLAotICAgICAgICAgICAgICAgICAgICAgICAgICJyIihiYiksCi0gICAgICAgICAgICAgICAgICAgICAgICAgInIiKGNjKSk7Ci0KLSAgICByZXR1cm4gb3V0OwotfQotCi1fX2lubGluZSBpbnQzMiBtbGE1NTQoaW50MzIgazQsIGludDMyIGsxMiwgaW50MzIgazEpCi17Ci0gICAgcmVnaXN0ZXIgaW50MzIgb3V0OwotICAgIHJlZ2lzdGVyIGludDMyIGFhID0gKGludDMyKWs0OwotICAgIHJlZ2lzdGVyIGludDMyIGJiID0gKGludDMyKWsxMjsKLSAgICByZWdpc3RlciBpbnQzMiBjYyA9IChpbnQzMilrMTsKLQotICAgIGFzbSB2b2xhdGlsZSgic21sYWJ0ICUwLCAlMSwgJTIsICUzIgotICAgICAgICAgICAgIDogIj0mciIob3V0KQotICAgICAgICAgICAgICAgICAgICAgICAgIDogInIiKGFhKSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAiciIoYmIpLAotICAgICAgICAgICAgICAgICAgICAgICAgICJyIihjYykpOwotCi0gICAgcmV0dXJuIG91dDsKLX0KLQotX19pbmxpbmUgaW50MzIgbWxhMTMzOChpbnQzMiBrNiwgaW50MzIgazE0LCBpbnQzMiBrMSkKLXsKLSAgICByZWdpc3RlciBpbnQzMiBvdXQ7Ci0gICAgcmVnaXN0ZXIgaW50MzIgYWEgPSAoaW50MzIpazY7Ci0gICAgcmVnaXN0ZXIgaW50MzIgYmIgPSAoaW50MzIpazE0OwotICAgIHJlZ2lzdGVyIGludDMyIGNjID0gKGludDMyKWsxOwotCi0gICAgYXNtIHZvbGF0aWxlKCJzbWxhYmIgJTAsICUxLCAlMiwgJTMiCi0gICAgICAgICAgICAgOiAiPSZyIihvdXQpCi0gICAgICAgICAgICAgICAgICAgICAgICAgOiAiciIoYWEpLAotICAgICAgICAgICAgICAgICAgICAgICAgICJyIihiYiksCi0gICAgICAgICAgICAgICAgICAgICAgICAgInIiKGNjKSk7Ci0gICAgcmV0dXJuIG91dDsKLX0KLQotX19pbmxpbmUgaW50MzIgbWxhOTQ2KGludDMyIGs2LCBpbnQzMiBrMTQsIGludDMyIGsxKQotewotICAgIHJlZ2lzdGVyIGludDMyIG91dDsKLSAgICByZWdpc3RlciBpbnQzMiBhYSA9IChpbnQzMilrNjsKLSAgICByZWdpc3RlciBpbnQzMiBiYiA9IChpbnQzMilrMTQ7Ci0gICAgcmVnaXN0ZXIgaW50MzIgY2MgPSAoaW50MzIpazE7Ci0KLSAgICBhc20gdm9sYXRpbGUoInNtbGFiYiAlMCwgJTEsICUyLCAlMyIKLSAgICAgICAgICAgICA6ICI9JnIiKG91dCkKLSAgICAgICAgICAgICAgICAgICAgICAgICA6ICJyIihhYSksCi0gICAgICAgICAgICAgICAgICAgICAgICAgInIiKGJiKSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAiciIoY2MpKTsKLSAgICByZXR1cm4gb3V0OwotfQotCi1fX2lubGluZSBpbnQzMiBzdW1fYWJzKGludDMyIGswLCBpbnQzMiBrMSwgaW50MzIgazIsIGludDMyIGszLAotICAgICAgICAgICAgICAgICAgICAgICBpbnQzMiBrNCwgaW50MzIgazUsIGludDMyIGs2LCBpbnQzMiBrNykKLXsKLSAgICByZWdpc3RlciBpbnQzMiBjYXJyeTsKLSAgICByZWdpc3RlciBpbnQzMiBhYnNfc3VtOwotICAgIHJlZ2lzdGVyIGludDMyIGFhID0gKGludDMyKWswOwotICAgIHJlZ2lzdGVyIGludDMyIGJiID0gKGludDMyKWsxOwotICAgIHJlZ2lzdGVyIGludDMyIGNjID0gKGludDMyKWsyOwotICAgIHJlZ2lzdGVyIGludDMyIGRkID0gKGludDMyKWszOwotICAgIHJlZ2lzdGVyIGludDMyIGVlID0gKGludDMyKWs0OwotICAgIHJlZ2lzdGVyIGludDMyIGZmID0gKGludDMyKWs1OwotICAgIHJlZ2lzdGVyIGludDMyIGdnID0gKGludDMyKWs2OwotICAgIHJlZ2lzdGVyIGludDMyIGhoID0gKGludDMyKWs3OwotCi0gICAgYXNtIHZvbGF0aWxlKCJlb3IgICUwLCAlMiwgJTIsIGFzciAjMzFcblx0IgotICAgICAgICAgICAgICAgICAiZW9ycyAlMSwgJTMsICUzLCBhc3IgIzMxXG5cdCIKLSAgICAgICAgICAgICAgICAgImFkYyAgJTEsICUxLCAlMFxuXHQiCi0gICAgICAgICAgICAgICAgICJlb3JzICUwLCAlNCwgJTQsIGFzciAjMzFcblx0IgotICAgICAgICAgICAgICAgICAiYWRjICAlMSwgJTEsICUwXG5cdCIKLSAgICAgICAgICAgICAgICAgImVvcnMgJTAsICU1LCAlNSwgYXNyICMzMVxuXHQiCi0gICAgICAgICAgICAgICAgICJhZGMgICUxLCAlMSwgJTBcblx0IgotICAgICAgICAgICAgICAgICAiZW9ycyAlMCwgJTYsICU2LCBhc3IgIzMxXG5cdCIKLSAgICAgICAgICAgICAgICAgImFkYyAgJTEsICUxLCAlMFxuXHQiCi0gICAgICAgICAgICAgICAgICJlb3JzICUwLCAlNywgJTcsIGFzciAjMzFcblx0IgotICAgICAgICAgICAgICAgICAiYWRjICAlMSwgJTEsICUwXG5cdCIKLSAgICAgICAgICAgICAgICAgImVvcnMgJTAsICU4LCAlOCwgYXNyICMzMVxuXHQiCi0gICAgICAgICAgICAgICAgICJhZGMgICUxLCAlMSwgJTBcblx0IgotICAgICAgICAgICAgICAgICAiZW9ycyAlMCwgJTksICU5LCBhc3IgIzMxXG5cdCIKLSAgICAgICAgICAgICAgICAgImFkYyAgJTEsICUxLCAlMFxuXHQiCi0KLSAgICAgICAgICAgICA6ICI9JnIiKGNhcnJ5KSwKLSAgICAgICAgICAgICAgICAgIj0mciIoYWJzX3N1bSk6Ci0gICAgICAgICAgICAgICAgICAgICAgICAgInIiKGFhKSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAiciIoYmIpLAotICAgICAgICAgICAgICAgICAgICAgICAgICJyIihjYyksCi0gICAgICAgICAgICAgICAgICAgICAgICAgInIiKGRkKSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAiciIoZWUpLAotICAgICAgICAgICAgICAgICAgICAgICAgICJyIihmZiksCi0gICAgICAgICAgICAgICAgICAgICAgICAgInIiKGdnKSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAiciIoaGgpKTsKLQotICAgIHJldHVybiBhYnNfc3VtOwotfQotCi0jZW5kaWYgLy8gRGlmZi4gT1MKLQotI2VuZGlmIC8vX0RDVF9JTkxJTkVfSF8KLQotCmRpZmYgLS1naXQgYS9tZWR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ESVRJT05TIE9GIEFOWSBLSU5ELCBlaXRoZXIKLSAqIGV4cHJlc3Mgb3IgaW1wbGllZC4KLSAqIFNlZSB0aGUgTGljZW5zZSBmb3IgdGhlIHNwZWNpZmljIGxhbmd1YWdlIGdvdmVybmluZyBwZXJtaXNzaW9ucwotICogYW5kIGxpbWl0YXRpb25zIHVuZGVyIHRoZSBMaWNlbnNlLgotICogLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLQotICovCi0jaW5jbHVkZSAibXA0ZGVmLmgiCi0jaW5jbHVkZSAibXA0bGliX2ludC5oIgotI2luY2x1ZGUgIm1wNGVuY19saWIuaCIKLSNpbmNsdWRlICJkY3QuaCIKLSNpbmNsdWRlICJtNHZlbmNfb3NjbC5oIgotCi0vKiA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0gKi8KLS8qICBGdW5jdGlvbiA6IENvZGVNQl9IMjYzKCApICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogIERhdGUgICAgIDogOC8xNS8yMDAxICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgUHVycG9zZSAgOiBQZXJmb3JtIHJlc2lkdWUgY2FsYyAob25seSB6ZXJvIE1WKSwgRENULCBIMjYzIFF1YW50L0RlcXVhbnQsKi8KLS8qICAgICAgICAgICAgICBJRENUIGFuZCBtb3Rpb24gY29tcGVuc2F0aW9uLk1vZGlmaWVkIGZyb20gRmFzdENvZGVNQigpICAgICAqLwotLyogIElucHV0ICAgIDogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgICAgIHZpZGVvICAgICAgIFZpZGVvIGVuY29kZXIgZGF0YSBzdHJ1Y3R1cmUgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICAgICAgZnVuY3Rpb24gICAgQXBwcm94aW1hdGUgRENUIGZ1bmN0aW9uLCBzY2FsaW5nIGFuZCB0aHJlc2hvbGQgICAgICAgICAqLwotLyogICAgICBuY29lZmJsY2sgICBBcnJheSBmb3IgbGFzdCBub256ZXJvIGNvZWZmIGZvciBzcGVlZHVwIGluIFZsY0VuY29kZSAgICovCi0vKiAgICAgIFFQICAgICAgQ29tYmluZWQgb2Zmc2V0IGZyb20gdGhlIG9yaWdpbiB0byB0aGUgY3VycmVudCAgICAgICAgICAqLwotLyogICAgICAgICAgICAgICAgICBtYWNyb2Jsb2NrICBhbmQgUVAgIGZvciBjdXJyZW50IE1CLiAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgICBPdXRwdXQgICAgIDogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICAgICAgdmlkZW8tPm91dHB1dE1CICAgICBRdWFudGl6ZWQgRENUIGNvZWZmaWNpZW50cy4gICAgICAgICAgICAgICAgICAgICAqLwotLyogICAgICBjdXJyVm9wLT55Q2hhbix1Q2hhbix2Q2hhbiAgUmVjb25zdHJ1Y3RlZCBwaXhlbHMgICAgICAgICAgICAgICAgICAgICovCi0vKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICBSZXR1cm4gICA6ICAgUFZfU1RBVFVTICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogIE1vZGlmaWVkIDogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgICAgICAgICAgMi8yNi8wMQotICAgICAgICAgICAgLW1vZGlmaWVkIHRocmVzaG9sZCBiYXNlZCBvbiBjb3JyZWxhdGlvbiBjb2VmZiAwLjc1IG9ubHkgZm9yIG1vZGUgSC4yNjMKLSAgICAgICAgICAgIC1uY29lZmJsY2tbXSBhcyBpbnB1dCwgIHRvIGtlZXAgcG9zaXRpb24gb2YgbGFzdCBub24temVybyBjb2VmZiovCi0vKiAgICAgICAgICAgOC8xMC8wMQotICAgICAgICAgICAgLW1vZGlmaWVkIHRocmVzaG9sZCBiYXNlZCBvbiBjb3JyZWxhdGlvbiBjb2VmZiAwLjUKLSAgICAgICAgICAgIC11c2VkIGNvbHVtbiB0aHJlc2hvbGQgdG8gc3BlZWR1cCBjb2x1bW4gRENULgotICAgICAgICAgICAgLXVzZWQgYml0bWFwIHppZ3phZyB0byBzcGVlZHVwIFJ1bkxldmVsKCkuICAgICAgICAgICAgICAgICAgICAgICovCi0vKiA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0gKi8KLQotUFZfU1RBVFVTIENvZGVNQl9IMjYzKFZpZGVvRW5jRGF0YSAqdmlkZW8sIGFwcHJveERDVCAqZnVuY3Rpb24sIEludCBRUCwgSW50IG5jb2VmYmxja1tdKQotewotICAgIEludCBzYWQsIGssIENCUCwgbWJudW0gPSB2aWRlby0+bWJudW07Ci0gICAgU2hvcnQgKm91dHB1dCwgKmRhdGFCbG9jazsKLSAgICBVQ2hhciBNb2RlID0gdmlkZW8tPmhlYWRlckluZm8uTW9kZVttYm51bV07Ci0gICAgVUNoYXIgKmJpdG1hcGNvbCwgKmJpdG1hcHJvdyA9IHZpZGVvLT5iaXRtYXByb3c7Ci0gICAgVUludCAgKmJpdG1hcHp6IDsKLSAgICBVQ2hhciBzaG9ydEhlYWRlciA9IHZpZGVvLT52b2xbdmlkZW8tPmN1cnJMYXllcl0tPnNob3J0VmlkZW9IZWFkZXI7Ci0gICAgSW50IGRjX3NjYWxlciA9IDg7Ci0gICAgSW50IGludHJhID0gKE1vZGUgPT0gTU9ERV9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U5JbnRyYTsKLSAgICAgICAgQmxvY2tEQ1Q4eDggPSAmQmxvY2tEQ1RfQUFOSW50cmE7Ci0gICAgICAgIEJsb2NrUXVhbnREZXF1YW50SDI2MyA9ICZCbG9ja1F1YW50RGVxdWFudEgyNjNJbnRyYTsKLSAgICAgICAgQmxvY2tRdWFudERlcXVhbnRIMjYzREMgPSAmQmxvY2tRdWFudERlcXVhbnRIMjYzRENJbnRyYTsKLSAgICAgICAgaWYgKHNob3J0SGVhZGVyKQotICAgICAgICB7Ci0gICAgICAgICAgICBkY19zY2FsZXIgPSA4OwotICAgICAgICB9Ci0gICAgICAgIGVsc2UKLSAgICAgICAgewotICAgICAgICAgICAgZGNfc2NhbGVyID0gY2FsX2RjX3NjYWxlckVOQyhRUCwgMSk7IC8qIGx1bWluYW5jZSBibG9ja3MgKi8KLSAgICAgICAgfQotICAgICAgICBEY3RUaDEgPSAoSW50KShkY19zY2FsZXIgKiAzKTsvLyoxLjgyOQotICAgICAgICBDb2xUaCA9IENvbFRoSW50cmFbUVBdOwotICAgIH0KLSAgICBlbHNlCi0gICAgewotICAgICAgICBCbG9ja0RDVDF4MSA9ICZCbG9jazF4MURDVHdTdWI7Ci0gICAgICAgIEJsb2NrRENUMngyID0gJkJsb2NrMngyRENUX0FBTndTdWI7Ci0gICAgICAgIEJsb2NrRENUNHg0ID0gJkJsb2NrNHg0RENUX0FBTndTdWI7Ci0gICAgICAgIEJsb2NrRENUOHg4ID0gJkJsb2NrRENUX0FBTndTdWI7Ci0KLSAgICAgICAgQmxvY2tRdWFudERlcXVhbnRIMjYzID0gJkJsb2NrUXVhbnREZXF1YW50SDI2M0ludGVyOwotICAgICAgICBCbG9ja1F1YW50RGVxdWFudEgyNjNEQyA9ICZCbG9ja1F1YW50RGVxdWFudEgyNjNEQ0ludGVyOwotICAgICAgICBDb2xUaCA9IENvbFRoSW50ZXJbUVBdOwotICAgICAgICBEY3RUaDEgPSAoSW50KSgxNiAqIFFQKTsgIC8vOSpRUDsKLSAgICB9Ci0KLSAgICByZWMgPSBjdXJyVm9wLT55Q2hhbiArIG9mZnNldDsKLSAgICBpbnB1dCA9IGlucHV0RnJhbWUtPnlDaGFuICsgb2Zmc2V0OwotICAgIGlmIChseCAhPSB3aWR0aCkgaW5wdXQgLT0gKGluZF95IDw8IDkpOyAgLyogbm9uLXBhZGRlZCBvZmZzZXQgKi8KLQotICAgIGRhdGFCbG9jayA9IHZpZGVvLT5kYXRhQmxvY2s7Ci0gICAgcHJlZCA9IHZpZGVvLT5wcmVkaWN0ZWRNQjsKLQotICAgIGZvciAoayA9IDA7IGsgPCA2OyBrKyspCi0gICAgewotICAgICAgICBDQlAgPDw9IDE7Ci0gICAgICAgIGJpdG1hcGNvbCA9IHZpZGVvLT5iaXRtYXBjb2xba107Ci0gICAgICAgIGJpdG1hcHp6ID0gdmlkZW8tPmJpdG1hcHp6W2tdOyAgLyogIDcvMzAvMDEgKi8KLSAgICAgICAgaWYgKGsgPCA0KQotICAgICAgICB7Ci0gICAgICAgICAgICBzYWQgPSB2aWRlby0+bW90W21ibnVtXVtrKzFdLnNhZDsKLSAgICAgICAgICAgIGlmIChrJjEpCi0gICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgcmVjICs9IDg7Ci0gICAgICAgICAgICAgICAgaW5wdXQgKz0gODsKLSAgICAgICAgICAgIH0KLSAgICAgICAgICAgIGVsc2UgaWYgKGsgPT0gMikKLSAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICBkY3RNb2RlID0gKCh3aWR0aCA8PCAzKSAtIDgpOwotICAgICAgICAgICAgICAgIGlucHV0ICs9IGRjdE1vZGU7Ci0gICAgICAgICAgICAgICAgZGN0TW9kZSA9ICgobHggPDwgMykgLSA4KTsKLSAgICAgICAgICAgICAgICByZWMgKz0gZGN0TW9kZTsKLSAgICAgICAgICAgIH0KLSAgICAgICAgfQotICAgICAgICBlbHNlCi0gICAgICAgIHsKLSAgICAgICAgICAgIGlmIChrID09IDQpCi0gICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgcmVjID0gY3VyclZvcC0+dUNoYW4gKyBvZmZzZXRjOwotICAgICAgICAgICAgICAgIGlucHV0ID0gaW5wdXRGcmFtZS0+dUNoYW4gKyBvZmZzZXRjOwotICAgICAgICAgICAgICAgIGlmIChseCAhPSB3aWR0aCkgaW5wdXQgLT0gKGluZF95IDw8IDcpOwotICAgICAgICAgICAgICAgIGx4ID4+PSAxOwotICAgICAgICAgICAgICAgIHdpZHRoID4+PSAxOwotICAgICAgICAgICAgICAgIGlmIChpbnRyYSkKLSAgICAgICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgICAgIHNhZCA9IGdldEJsb2NrU3VtKGlucHV0LCB3aWR0aCk7Ci0gICAgICAgICAgICAgICAgICAgIGlmIChzaG9ydEhlYWRlcikKLSAgICAgICAgICAgICAgICAgICAgICAgIGRjX3NjYWxlciA9IDg7Ci0gICAgICAgICAgICAgICAgICAgIGVsc2UKLSAgICAgICAgICAgICAgICAgICAgewotICAgICAgICAgICAgICAgICAgICAgICAgZGNfc2NhbGVyID0gY2FsX2RjX3NjYWxlckVOQyhRUCwgMik7IC8qIGNocm9taW5hbmNlIGJsb2NrcyAqLwotICAgICAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgICAgIERjdFRoMSA9IChJbnQpKGRjX3NjYWxlciAqIDMpOy8vKjEuODI5Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgIGVsc2UKLSAgICAgICAgICAgICAgICAgICAgc2FkID0gU2FkOHg4KGlucHV0LCBwcmVkLCB3aWR0aCk7Ci0gICAgICAgICAgICB9Ci0gICAgICAgICAgICBlbHNlCi0gICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgcmVjID0gY3VyclZvcC0+dkNoYW4gKyBvZmZzZXRjOwotICAgICAgICAgICAgICAgIGlucHV0ID0gaW5wdXRGcmFtZS0+dkNoYW4gKyBvZmZzZXRjOwotICAgICAgICAgICAgICAgIGlmIChseCAhPSB3aWR0aCkgaW5wdXQgLT0gKGluZF95IDw8IDcpOwotICAgICAgICAgICAgICAgIGlmIChpbnRyYSkKLSAgICAgICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgICAgIHNhZCA9IGdldEJsb2NrU3VtKGlucHV0LCB3aWR0aCk7Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgIGVsc2UKLSAgICAgICAgICAgICAgICAgICAgc2FkID0gU2FkOHg4KGlucHV0LCBwcmVkLCB3aWR0aCk7Ci0gICAgICAgICAgICB9Ci0gICAgICAgIH0KLQotICAgICAgICBpZiAoc2FkIDwgRGN0VGgxICYmICEoc2hvcnRIZWFkZXIgJiYgaW50cmEpKSAvKiBhbGwtemVybyAqLwotICAgICAgICB7ICAgICAgICAgICAgICAgICAgICAgICAvKiBGb3Igc2hvcnRIZWFkZXIgaW50cmEgYmxvY2ssIERDIHZhbHVlIGNhbm5vdCBiZSB6ZXJvICovCi0gICAgICAgICAgICBkY3RNb2RlID0gMDsKLSAgICAgICAgICAgIENCUCB8PSAwOwotICAgICAgICAgICAgbmNvZWZibGNrW2tdID0gMDsKLSAgICAgICAgfQotICAgICAgICBlbHNlIGlmIChzYWQgPCAxOCpRUC8qKFFQPDw0KSovKSAvKiBEQy1vbmx5ICovCi0gICAgICAgIHsKLSAgICAgICAgICAgIGRjdE1vZGUgPSAxOwotICAgICAgICAgICAgQmxvY2tEQ1QxeDEoZGF0YUJsb2NrLCBpbnB1dCwgcHJlZCwgd2lkdGgpOwotCi0gICAgICAgICAgICBDQlAgfD0gKCpCbG9ja1F1YW50RGVxdWFudEgyNjNEQykoZGF0YUJsb2NrLCBvdXRwdXQsICZRdWFudFBhcmFtLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJpdG1hcHJvdyArIGssIGJpdG1hcHp6LCBkY19zY2FsZXIsIHNob3J0SGVhZGVyKTsKLSAgICAgICAgICAgIG5jb2VmYmxja1trXSA9IDE7Ci0gICAgICAgIH0KLSAgICAgICAgZWxzZQotICAgICAgICB7Ci0KLSAgICAgICAgICAgIGRhdGFCbG9ja1s2NF0gPSBDb2xUaDsKLQotICAgICAgICAgICAgaWYgKHNhZCA8IDIyKlFQLyooUVA8PDQpKyhRUDw8MSkqLykgIC8qIDJ4MiBEQ1QgKi8KLSAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICBkY3RNb2RlID0gMjsKLSAgICAgICAgICAgICAgICBCbG9ja0RDVDJ4MihkYXRhQmxvY2ssIGlucHV0LCBwcmVkLCB3aWR0aCk7Ci0gICAgICAgICAgICAgICAgbmNvZWZibGNrW2tdID0gNjsKLSAgICAgICAgICAgIH0KLSAgICAgICAgICAgIGVsc2UgaWYgKHNhZCA8IChRUCA8PCA1KSkgLyogNHg0IERDVCAqLwotICAgICAgICAgICAgewotICAgICAgICAgICAgICAgIGRjdE1vZGUgPSA0OwotICAgICAgICAgICAgICAgIEJsb2NrRENUNHg0KGRhdGFCbG9jaywgaW5wdXQsIHByZWQsIHdpZHRoKTsKLSAgICAgICAgICAgICAgICBuY29lZmJsY2tba10gPSAyNjsKLSAgICAgICAgICAgIH0KLSAgICAgICAgICAgIGVsc2UgLyogRnVsbC1EQ1QgKi8KLSAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICBkY3RNb2RlID0gODsKLSAgICAgICAgICAgICAgICBCbG9ja0RDVDh4OChkYXRhQmxvY2ssIGlucHV0LCBwcmVkLCB3aWR0aCk7Ci0gICAgICAgICAgICAgICAgbmNvZWZibGNrW2tdID0gNjQ7Ci0gICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgIENCUCB8PSAoKkJsb2NrUXVhbnREZXF1YW50SDI2MykoZGF0YUJsb2NrLCBvdXRwdXQsICZRdWFudFBhcmFtLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBiaXRtYXBjb2wsIGJpdG1hcHJvdyArIGssIGJpdG1hcHp6LCBkY3RNb2RlLCBrLCBkY19zY2FsZXIsIHNob3J0SGVhZGVyKTsKLSAgICAgICAgfQotICAgICAgICBCbG9ja0lEQ1RNb3Rpb25Db21wKGRhdGFCbG9jaywgYml0bWFwY29sLCBiaXRtYXByb3dba10sIGRjdE1vZGUsIHJlYywgcHJlZCwgKGx4IDw8IDEpIHwgaW50cmEpOwotICAgICAgICBvdXRwdXQgKz0gNjQ7Ci0gICAgICAgIGlmICghKGsmMSkpCi0gICAgICAgIHsKLSAgICAgICAgICAgIHByZWQgKz0gODsKLSAgICAgICAgfQotICAgICAgICBlbHNlCi0gICAgICAgIHsKLSAgICAgICAgICAgIHByZWQgKz0gMTIwOwotICAgICAgICB9Ci0gICAgfQotCi0gICAgdmlkZW8tPmhlYWRlckluZm8uQ0JQW21ibnVtXSA9IENCUDsgLyogIDUvMTgvMjAwMSAqLwotICAgIHJldHVybiBQVl9TVUNDRVNTOwotfQotCi0jaWZuZGVmIE5PX01QRUdfUVVBTlQKLS8qID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PSAqLwotLyogIEZ1bmN0aW9uIDogQ29kZU1CX01QRUcoICkgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgRGF0ZSAgICAgOiA4LzE1LzIwMDEgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICBQdXJwb3NlICA6IFBlcmZvcm0gcmVzaWR1ZSBjYWxjIChvbmx5IHplcm8gTVYpLCBEQ1QsIE1QRUcgUXVhbnQvRGVxdWFudCwqLwotLyogICAgICAgICAgICAgIElEQ1QgYW5kIG1vdGlvbiBjb21wZW5zYXRpb24uTW9kaWZpZWQgZnJvbSBGYXN0Q29kZU1CKCkgICAgICovCi0vKiAgSW5wdXQgICAgOiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICAgICAgdmlkZW8gICAgICAgVmlkZW8gZW5jb2RlciBkYXRhIHN0cnVjdHVyZSAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogICAgICBmdW5jdGlvbiAgICBBcHByb3hpbWF0ZSBEQ1QgZnVuY3Rpb24sIHNjYWxpbmcgYW5kIHRocmVzaG9sZCAgICAgICAgICovCi0vKiAgICAgIG5jb2VmYmxjayAgIEFycmF5IGZvciBsYXN0IG5vbnplcm8gY29lZmYgZm9yIHNwZWVkdXAgaW4gVmxjRW5jb2RlICAgKi8KLS8qICAgICAgUVAgICAgICBDb21iaW5lZCBvZmZzZXQgZnJvbSB0aGUgb3JpZ2luIHRvIHRoZSBjdXJyZW50ICAgICAgICAgICovCi0vKiAgICAgICAgICAgICAgICAgIG1hY3JvYmxvY2sgIGFuZCBRUCAgZm9yIGN1cnJlbnQgTUIuICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICAgIE91dHB1dCAgICAgOiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogICAgICB2aWRlby0+b3V0cHV0TUIgICAgIFF1YW50aXplZCBEQ1QgY29lZmZpY2llbnRzLiAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgICAgIGN1cnJWb3AtPnlDaGFuLHVDaGFuLHZDaGFuICBSZWNvbnN0cnVjdGVkIHBpeGVscyAgICAgICAgICAgICAgICAgICAgKi8KLS8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogIFJldHVybiAgIDogICBQVl9TVEFUVVMgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgTW9kaWZpZWQgOiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICAgICAgICA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VjICs9IDg7Ci0gICAgICAgICAgICAgICAgaW5wdXQgKz0gODsKLSAgICAgICAgICAgIH0KLSAgICAgICAgICAgIGVsc2UgaWYgKGsgPT0gMikKLSAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICBkY3RNb2RlID0gKCh3aWR0aCA8PCAzKSAtIDgpOwotICAgICAgICAgICAgICAgIGlucHV0ICs9IGRjdE1vZGU7Ci0gICAgICAgICAgICAgICAgZGN0TW9kZSA9ICgobHggPDwgMykgLSA4KTsKLSAgICAgICAgICAgICAgICByZWMgKz0gZGN0TW9kZTsKLSAgICAgICAgICAgIH0KLSAgICAgICAgfQotICAgICAgICBlbHNlCi0gICAgICAgIHsvLyBVLCBWIGJsb2NrCi0gICAgICAgICAgICBpZiAoayA9PSA0KQotICAgICAgICAgICAgewotICAgICAgICAgICAgICAgIHJlYyA9IGN1cnJWb3AtPnVDaGFuICsgb2Zmc2V0YzsKLSAgICAgICAgICAgICAgICBpbnB1dCA9IGlucHV0RnJhbWUtPnVDaGFuICsgb2Zmc2V0YzsKLSAgICAgICAgICAgICAgICBpZiAobHggIT0gd2lkdGgpIGlucHV0IC09IChpbmRfeSA8PCA3KTsKLSAgICAgICAgICAgICAgICBseCA+Pj0gMTsKLSAgICAgICAgICAgICAgICB3aWR0aCA+Pj0gMTsKLSAgICAgICAgICAgICAgICBpZiAoaW50cmEpCi0gICAgICAgICAgICAgICAgewotICAgICAgICAgICAgICAgICAgICBkY19zY2FsZXIgPSBjYWxfZGNfc2NhbGVyRU5DKFFQLCAyKTsgLyogbHVtaW5hbmNlIGJsb2NrcyAqLwotICAgICAgICAgICAgICAgICAgICBEY3RUaDEgPSBkY19zY2FsZXIgKiAzOwotICAgICAgICAgICAgICAgICAgICBzYWQgPSBnZXRCbG9ja1N1bShpbnB1dCwgd2lkdGgpOwotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICBlbHNlCi0gICAgICAgICAgICAgICAgICAgIHNhZCA9IFNhZDh4OChpbnB1dCwgcHJlZCwgd2lkdGgpOwotICAgICAgICAgICAgfQotICAgICAgICAgICAgZWxzZQotICAgICAgICAgICAgewotICAgICAgICAgICAgICAgIHJlYyA9IGN1cnJWb3AtPnZDaGFuICsgb2Zmc2V0YzsKLSAgICAgICAgICAgICAgICBpbnB1dCA9IGlucHV0RnJhbWUtPnZDaGFuICsgb2Zmc2V0YzsKLSAgICAgICAgICAgICAgICBpZiAobHggIT0gd2lkdGgpIGlucHV0IC09IChpbmRfeSA8PCA3KTsKLSAgICAgICAgICAgICAgICBpZiAoaW50cmEpCi0gICAgICAgICAgICAgICAgICAgIHNhZCA9IGdldEJsb2NrU3VtKGlucHV0LCB3aWR0aCk7Ci0gICAgICAgICAgICAgICAgZWxzZQotICAgICAgICAgICAgICAgICAgICBzYWQgPSBTYWQ4eDgoaW5wdXQsIHByZWQsIHdpZHRoKTsKLSAgICAgICAgICAgIH0KLSAgICAgICAgfQotCi0gICAgICAgIGlmIChzYWQgPCBEY3RUaDEpIC8qIGFsbC16ZXJvICovCi0gICAgICAgIHsKLSAgICAgICAgICAgIGRjdE1vZGUgPSAwOwotICAgICAgICAgICAgQ0JQIHw9IDA7Ci0gICAgICAgICAgICBuY29lZmJsY2tba10gPSAwOwotICAgICAgICB9Ci0gICAgICAgIGVsc2UgaWYgKHNhZCA8IERjdFRoMikgLyogREMtb25seSAqLwotICAgICAgICB7Ci0gICAgICAgICAgICBkY3RNb2RlID0gMTsKLSAgICAgICAgICAgIEJsb2NrRENUMXgxKGRhdGFCbG9jaywgaW5wdXQsIHByZWQsIHdpZHRoKTsKLQotICAgICAgICAgICAgQ0JQIHw9ICgqQmxvY2tRdWFudERlcXVhbnRNUEVHREMpKGRhdGFCbG9jaywgb3V0cHV0LCBRUCwgcW1hdCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBiaXRtYXBjb2wsIGJpdG1hcHJvdyArIGssIGJpdG1hcHp6LCBkY19zY2FsZXIpOwotICAgICAgICAgICAgbmNvZWZibGNrW2tdID0gMTsKLSAgICAgICAgfQotICAgICAgICBlbHNlCi0gICAgICAgIHsKLSAgICAgICAgICAgIGRhdGFCbG9ja1s2NF0gPSBDb2xUaDsKLQotICAgICAgICAgICAgaWYgKHNhZCA8IERjdFRoMykgLyogMngyLURDVCAqLwotICAgICAgICAgICAgewotICAgICAgICAgICAgICAgIGRjdE1vZGUgPSAyOwotICAgICAgICAgICAgICAgIEJsb2NrRENUMngyKGRhdGFCbG9jaywgaW5wdXQsIHByZWQsIHdpZHRoKTsKLSAgICAgICAgICAgICAgICBuY29lZmJsY2tba10gPSA2OwotICAgICAgICAgICAgfQotICAgICAgICAgICAgZWxzZSBpZiAoc2FkIDwgRGN0VGg0KSAvKiA0eDQgRENUICovCi0gICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgZGN0TW9kZSA9IDQ7Ci0gICAgICAgICAgICAgICAgQmxvY2tEQ1Q0eDQoZGF0YUJsb2NrLCBpbnB1dCwgcHJlZCwgd2lkdGgpOwotICAgICAgICAgICAgICAgIG5jb2VmYmxja1trXSA9IDI2OwotICAgICAgICAgICAgfQotICAgICAgICAgICAgZWxzZSAvKiBmdWxsLURDVCAqLwotICAgICAgICAgICAgewotICAgICAgICAgICAgICAgIGRjdE1vZGUgPSA4OwotICAgICAgICAgICAgICAgIEJsb2NrRENUOHg4KGRhdGFCbG9jaywgaW5wdXQsIHByZWQsIHdpZHRoKTsKLSAgICAgICAgICAgICAgICBuY29lZmJsY2tba10gPSA2NDsKLSAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgQ0JQIHw9ICgqQmxvY2tRdWFudERlcXVhbnRNUEVHKShkYXRhQmxvY2ssIG91dHB1dCwgUVAsIHFtYXQsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJpdG1hcGNvbCwgYml0bWFwcm93ICsgaywgYml0bWFwenosIGRjdE1vZGUsIGssIGRjX3NjYWxlcik7IC8vCi0gICAgICAgIH0KLSAgICAgICAgZGN0TW9kZSA9IDg7IC8qIGZvciBtaXNtYXRjaCBoYW5kbGUgKi8KLSAgICAgICAgQmxvY2tJRENUTW90aW9uQ29tcChkYXRhQmxvY2ssIGJpdG1hcGNvbCwgYml0bWFwcm93W2tdLCBkY3RNb2RlLCByZWMsIHByZWQsIChseCA8PCAxKSB8IChpbnRyYSkpOwotCi0gICAgICAgIG91dHB1dCArPSA2NDsKLSAgICAgICAgaWYgKCEoayYxKSkKLSAgICAgICAgewotICAgICAgICAgICAgcHJlZCArPSA4OwotICAgICAgICB9Ci0gICAgICAgIGVsc2UKLSAgICAgICAgewotICAgICAgICAgICAgcHJlZCArPSAxMjA7Ci0gICAgICAgIH0KLSAgICB9Ci0KLSAgICB2aWRlby0+aGVhZGVySW5mby5DQlBbbWJudW1dID0gQ0JQOyAvKiAgNS8xOC8yMDAxICovCi0gICAgcmV0dXJuIFBWX1NVQ0NFU1M7Ci19Ci0KLSNlbmRpZgotCi0vKiA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0gKi8KLS8qICBGdW5jdGlvbiA6IGdldEJsb2NrU0FWKCApICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogIERhdGUgICAgIDogOC8xMC8yMDAwICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgUHVycG9zZSAgOiBHZXQgU0FWIGZvciBvbmUgYmxvY2sgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICBJbi9vdXQgICA6IGJsb2NrWzY0XSBjb250YWluIG9uZSBibG9jayBkYXRhICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogIFJldHVybiAgIDogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgTW9kaWZpZWQgOiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PSAqLwotLyogY2FuIGJlIHdyaXR0ZW4gaW4gTU1YIG9yIFNTRSwgIDIvMjIvMjAwMSAqLwotSW50IGdldEJsb2NrU0FWKFNob3J0IGJsb2NrW10pCi17Ci0gICAgSW50IGksIHZhbCwgc2F2ID0gMDsKLQotICAgIGkgPSA4OwotICAgIHdoaWxlIChpLS0pCi0gICAgewotICAgICAgICB2YWwgPSAqYmxvY2srKzsKLSAgICAgICAgaWYgKHZhbCA+IDApICAgIHNhdiArPSB2YWw7Ci0gICAgICAgIGVsc2UgICAgICAgIHNhdiAtPSB2YWw7Ci0gICAgICAgIHZhbCA9ICpibG9jaysrOwotICAgICAgICBpZiAodmFsID4gMCkgICAgc2F2ICs9IHZhbDsKLSAgICAgICAgZWxzZSAgICAgICAgc2F2IC09IHZhbDsKLSAgICAgICAgdmFsID0gKmJsb2NrKys7Ci0gICAgICAgIGlmICh2YWwgPiAwKSAgICBzYXYgKz0gdmFsOwotICAgICAgICBlbHNlICAgICAgICBzYXYgLT0gdmFsOwotICAgICAgICB2YWwgPSAqYmxvY2srKzsKLSAgICAgICAgaWYgKHZhbCA+IDApICAgIHNhdiArPSB2YWw7Ci0gICAgICAgIGVsc2UgICAgICAgIHNhdiAtPSB2YWw7Ci0gICAgICAgIHZhbCA9ICpibG9jaysrOwotICAgICAgICBpZiAodmFsID4gMCkgICAgc2F2ICs9IHZhbDsKLSAgICAgICAgZWxzZSAgICAgICAgc2F2IC09IHZhbDsKLSAgICAgICAgdmFsID0gKmJsb2NrKys7Ci0gICAgICAgIGlmICh2YWwgPiAwKSAgICBzYXYgKz0gdmFsOwotICAgICAgICBlbHNlICAgICAgICBzYXYgLT0gdmFsOwotICAgICAgICB2YWwgPSAqYmxvY2srKzsKLSAgICAgICAgaWYgKHZhbCA+IDApICAgIHNhdiArPSB2YWw7Ci0gICAgICAgIGVsc2UgICAgICAgIHNhdiAtPSB2YWw7Ci0gICAgICAgIHZhbCA9ICpibG9jaysrOwotICAgICAgICBpZiAodmFsID4gMCkgICAgc2F2ICs9IHZhbDsKLSAgICAgICAgZWxzZSAgICAgICAgc2F2IC09IHZhbDsKLSAgICB9Ci0KLSAgICByZXR1cm4gc2F2OwotCi19Ci0KLS8qID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PSAqLwotLyogIEZ1bmN0aW9uIDogU2FkOHg4KCApICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgRGF0ZSAgICAgOiA4LzEwLzIwMDAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICBQdXJwb3NlICA6IEZpbmQgU0FEIGJldHdlZW4gcHJldiBibG9jayBhbmQgY3VycmVudCBibG9jayAgICAgICAgICAgICAgICAqLwotLyogIEluL291dCAgIDogUHJldmlvdXMgYW5kIGN1cnJlbnQgZnJhbWUgYmxvY2sgcG9pbnRlcnMsIGFuZCBmcmFtZSB3aWR0aCAgICovCi0vKiAgUmV0dXJuICAgOiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICBNb2RpZmllZCA6ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogICAgICA4LzE1LzAxLCAgLSBkbyA0IHBpeGVsIGF0IGEgdGltZSAgICBhc3N1bWluZyAzMiBiaXQgcmVnaXN0ZXIgICAgICAgICovCi0vKiA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0gKi8KLUludCBTYWQ4eDgoVUNoYXIgKmN1ciwgVUNoYXIgKnByZXYsIEludCB3aWR0aCkKLXsKLSAgICBVQ2hhciAqZW5kID0gY3VyICsgKHdpZHRoIDw8IDMpOwotICAgIEludCBzYWQgPSAwOwotICAgIEludCAqY3VySW50ID0gKEludCopIGN1cjsKLSAgICBJbnQgKnByZXZJbnQgPSAoSW50KikgcHJldjsKLSAgICBJbnQgY3VyMSwgY3VyMiwgcHJldjEsIHByZXYyOwotICAgIFVJbnQgbWFzaywgc2duX21zayA9IDB4ODA4MDgwODA7Ci0gICAgSW50ICBzdW0yID0gMCwgc3VtNCA9IDA7Ci0gICAgSW50ICB0bXA7Ci0gICAgZG8KLSAgICB7Ci0gICAgICAgIG1hc2sgICAgPSB+KDB4RkYwMCk7Ci0gICAgICAgIGN1cjEgICAgPSBjdXJJbnRbMV07ICAgICAgICAvKiBsb2FkIGN1cls0Li43XSAqLwotICAgICAgICBjdXIyICAgID0gY3VySW50WzBdOwotICAgICAgICBjdXJJbnQgKz0gKHdpZHRoID4+IDIpOyAgICAgLyogbG9hZCBjdXJbMC4uM10gYW5kICs9bHggKi8KLSAgICAgICAgcHJldjEgICA9IHByZXZJbnRbMV07Ci0gICAgICAgIHByZXYyICAgPSBwcmV2SW50WzBdOwotICAgICAgICBwcmV2SW50ICs9IDQ7Ci0KLSAgICAgICAgdG1wICAgICA9IHByZXYyIF4gY3VyMjsKLSAgICAgICAgY3VyMiAgICA9IHByZXYyIC0gY3VyMjsKLSAgICAgICAgdG1wICAgICA9IHRtcCBeIGN1cjI7ICAgICAgIC8qICheKV4oLSkgbGFzdCBiaXQgaXMgb25lIGlmIGNhcnJ5ICovCi0gICAgICAgIHRtcCAgICAgPSBzZ25fbXNrICYgKChVSW50KXRtcCA+PiAxKTsgLyogY2hlY2sgdGhlIHNpZ24gb2YgZWFjaCBieXRlICovCi0gICAgICAgIGlmIChjdXIyIDwgMCkgICB0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DcpOyAvKiB0YWtlIGFic29sdXRlIGJ5IGludmVydGluZyBiaXRzIChFT1IpICovCi0KLSAgICAgICAgc3VtNCAgICA9IHN1bTQgKyBjdXIxOwotICAgICAgICBjdXIxICAgID0gY3VyMSAmIChtYXNrIDw8IDgpOyAgIC8qIG1hc2sgZmlyc3QgYW5kIHRoaXJkIGJ5dGVzICovCi0gICAgICAgIHN1bTIgICAgPSBzdW0yICsgKChVSW50KWN1cjEgPj4gOCk7Ci0gICAgICAgIHN1bTQgICAgPSBzdW00ICsgY3VyMjsKLSAgICAgICAgY3VyMiAgICA9IGN1cjIgJiAobWFzayA8PCA4KTsgICAvKiBtYXNrIGZpcnN0IGFuZCB0aGlyZCBieXRlcyAqLwotICAgICAgICBzdW0yICAgID0gc3VtMiArICgoVUludCljdXIyID4+IDgpOwotICAgIH0KLSAgICB3aGlsZSAoKFVJbnQpY3VySW50IDwgKFVJbnQpZW5kKTsKLQotICAgIGN1cjEgPSBzdW00IC0gKHN1bTIgPDwgOCk7ICAvKiBnZXQgZXZlbi1zdW0gKi8KLSAgICBjdXIxID0gY3VyMSArIHN1bTI7ICAgICAgICAgLyogYWRkIDE2IGJpdCBldmVuLXN1bSBhbmQgb2RkLXN1bSovCi0gICAgY3VyMSA9IGN1cjEgKyAoY3VyMSA8PCAxNik7IC8qIGFkZCB1cHBlciBhbmQgbG93ZXIgMTYgYml0IHN1bSAqLwotICAgIHNhZCAgPSAoKFVJbnQpY3VyMSA+PiAxNik7ICAvKiB0YWtlIHVwcGVyIDE2IGJpdCAqLwotICAgIHJldHVybiBzYWQ7Ci19Ci0KLS8qID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PSAqLwotLyogIEZ1bmN0aW9uIDogZ2V0QmxvY2tTdW0oICkgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgRGF0ZSAgICAgOiA4LzEwLzIwMDAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICBQdXJwb3NlICA6IEZpbmQgc3VtbWF0aW9uIG9mIHZhbHVlIHdpdGhpbiBhIGJsb2NrLiAgICAgICAgICAgICAgICAgICAgICAqLwotLyogIEluL291dCAgIDogUG9pbnRlciB0byBjdXJyZW50IGJsb2NrIGluIGEgZnJhbWUgYW5kIGZyYW1lIHdpZHRoICAgICAgICAgICovCi0vKiAgUmV0dXJuICAgOiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICBNb2RpZmllZCA6ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogICAgICAgICAgOC8xNS8wMSwgIC0gU0lNRCA0IHBpeGVscyBhdCBhIHRpbWUgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PSAqLwotCi1JbnQgZ2V0QmxvY2tTdW0oVUNoYXIgKmN1ciwgSW50IHdpZHRoKQotewotICAgIEludCBzYWQgPSAwLCBzdW00ID0gMCwgc3VtMiA9IDA7Ci0gICAgVUNoYXIgKmVuZCA9IGN1ciArICh3aWR0aCA8PCAzKTsKLSAgICBJbnQgKmN1ckludCA9IChJbnQqKWN1cjsKLSAgICBVSW50IG1hc2sgICA9IH4oMHhGRjAwKTsKLSAgICBJbnQgbG9hZDEsIGxvYWQyOwotCi0gICAgZG8KLSAgICB7Ci0gICAgICAgIGxvYWQxID0gY3VySW50WzFdOwotICAgICAgICBsb2FkMiA9IGN1ckludFswXTsKLSAgICAgICAgY3VySW50ICs9ICh3aWR0aCA+PiAyKTsKLSAgICAgICAgc3VtNCArPSBsb2FkMTsKLSAgICAgICAgbG9hZDEgPSBsb2FkMSAmI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09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0gICAqLwotLyogIEZpbGU6IEZhc3RDb2RlTUIuaCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgRGVzY3JpcHRpb246IFRoaXMgZmlsZSBjb250YWlucyBzdHJ1Y3R1cmUgYW5kIGZ1bmN0aW9uIHByb3RvdHlwZXMgdXNlZAotICAgICAgICAgICAgaW4gRmFzdENvZGVNQigpIGZ1bmN0aW9uLiBXaGVuIGl0IGlzIGRlY2lkZWQgdG8gdXNlIEZhc3RDb2RlTUIKLSAgICAgICAgICAgIGluc3RlYWQgb2YgQ29kZU1CLCBhbGwgb2YgdGhpcyBwcm90b3R5cGVzIHNob3VsZCBiZSBtaWdyYXRlZCB0bwotICAgICAgICAgICAgbXA0ZW5jX2xpYi5oLiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgUmV2OiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICBDcmVhdGVkOiA4LzE0LzAxICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vICovCi0KLXR5cGVkZWYgc3RydWN0IHN0cnVjdF9hcHByb3hEQ1QgIGFwcHJveERDVDsKLXN0cnVjdCBzdHJ1Y3RfYXBwcm94RENUCi17Ci0gICAgY29uc3QgSW50ICpzY2FsZTsKLSAgICBJbnQoKkRDVCkoSW50IGJsb2NrWyBdLCBJbnQgY29lZmZbIF0sIGFwcHJveERDVCAqKTsKLQotICAgIC8vIFRocmVzaG9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nVuY3Rpb24pOwotSW50ICAgICBBcHBWQ0EzX2RjdChJbnQgYmxvY2tbXSwgSW50IG91dFsgXSwgYXBwcm94RENUICpmdW5jdGlvbik7Ci1JbnQgICAgIEFwcFZDQTRfZGN0KEludCBibG9ja1tdLCBJbnQgb3V0WyBdLCBhcHByb3hEQ1QgKmZ1bmN0aW9uKTsKLUludCAgICAgQXBwVkNBNV9kY3QoSW50IGJsb2NrW10sIEludCBvdXRbIF0sIGFwcHJveERDVCAqZnVuY3Rpb24pOwotCi0vKi0tLS0gRmFzdFF1YW50LmMgLS0tLS0qLwotSW50IGNhbF9kY19zY2FsZXJFTkMoSW50IFFQLCBJbnQgdHlwZSkgOwotSW50IEJsb2NrUXVhbnREZXF1YW50SDI2M0ludGVyKEludCAqcmNvZWZmLCBJbnQgKnFjb2VmZiwgc3RydWN0IFFQc3RydWN0ICpRdWFudFBhcmFtLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFVDaGFyIGJpdG1hcGNvbFsgXSwgVUNoYXIgKmJpdG1hcHJvdywgVUludCAqYml0bWFwenosCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgSW50IGRjdE1vZGUsIEludCBjb21wLCBJbnQgZHVtbXkpOwotCi1JbnQgQmxvY2tRdWFudERlcXVhbnRIMjYzSW50cmEoSW50ICpyY29lZmYsIEludCAqcWNvZWZmLCBzdHJ1Y3QgUVBzdHJ1Y3QgKlF1YW50UGFyYW0sCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgVUNoYXIgYml0bWFwY29sWyBdLCBVQ2hhciAqYml0bWFwcm93LCBVSW50ICpiaXRtYXB6eiwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBJbnQgZGN0TW9kZSwgSW50IGNvbXAsIEludCBkY19zY2FsZXIpOwotCi1JbnQgQmxvY2tRdWFudERlcXVhbnRIMjYzRENJbnRlcihJbnQgKnJjb2VmZiwgSW50ICpxY29lZmYsIHN0cnVjdCBRUHN0cnVjdCAqUXVhbnRQYXJhbSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFVDaGFyICpiaXRtYXByb3csIFVJbnQgKmJpdG1hcHp6LCBJbnQgZHVtbXkpOwotCi1JbnQgQmxvY2tRdWFudERlcXVhbnRIMjYzRENJbnRyYShJbnQgKnJjb2VmZiwgSW50ICpxY29lZmYsIHN0cnVjdCBRUHN0cnVjdCAqUXVhbnRQYXJhbSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFVDaGFyICpiaXRtYXByb3csIFVJbnQgKmJpdG1hcHp6LCBJbnQgZGNfc2NhbGVyKTsKLQotSW50IEJsb2NrUXVhbnREZXF1YW50TVBFR0ludGVyKEludCAqcmNvZWZmLCBJbnQgKnFjb2VmZiwgSW50IFFQLCBJbnQgKnFtYXQsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgVUNoYXIgYml0bWFwY29sWyBdLCBVQ2hhciAqYml0bWFwcm93LCBVSW50ICpiaXRtYXB6eiwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBJbnQgRGN0TW9kZSwgSW50IGNvbXAsIEludCBkY19zY2FsZXIpOwotCi1JbnQgQmxvY2tRdWFudERlcXVhbnRNUEVHSW50cmEoSW50ICpyY29lZmYsIEludCAqcWNvZWZmLCBJbnQgUVAsIEludCAqcW1hdCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBVQ2hhciBiaXRtYXBjb2xbIF0sIFVDaGFyICpiaXRtYXByb3csIFVJbnQgKmJpdG1hcHp6LAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEludCBEY3RNb2RlLCBJbnQgY29tcCwgSW50IGRjX3NjYWxlcik7Ci0KLUludCBCbG9ja1F1YW50RGVxdWFudE1QRUdEQ0ludGVyKEludCAqcmNvZWZmLCBJbnQgKnFjb2VmZiwgSW50IFFQLCBJbnQgKnFtYXQsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBVQ2hhciB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S8qIFRoaXMgZnVuY3Rpb24gc2hvdWxkIG5vdCBiZSBjYWxsZWQgYXQgYWxsICoqKiovCi12b2lkIGlkY3Rfcm93MEludGVyKFNob3J0ICpzcmNlLCBVQ2hhciAqcmVjLCBJbnQgbHgpCi17Ci0gICAgT1NDTF9VTlVTRURfQVJHKHNyY2UpOwotCi0gICAgT1NDTF9VTlVTRURfQVJHKHJlYyk7Ci0KLSAgICBPU0NMX1VOVVNFRF9BUkcobHgpOwotCi0gICAgcmV0dXJuOwotfQotCi12b2lkIGlkY3Rfcm93MUludGVyKFNob3J0ICpibGssIFVDaGFyICpyZWMsIEludCBseCkKLXsKLSAgICBpbnQgdG1wOwotICAgIGludCBpID0gODsKLSAgICB1aW50MzIgcHJlZF93b3JkLCBkc3Rfd29yZDsKLSAgICBpbnQgcmVzLCByZXMyOwotCi0gICAgLyogcHJlc2V0IHRoZSBvZmZzZXQsIHN1Y2ggdGhhdCB3ZSBjYW4gdGFrZSBhZHZhbnRhZ2UgcHJlLW9mZnNldCBhZGRyZXNzaW5nIG1vZGUgICAqLwotICAgIHJlYyAtPSBseDsKLSAgICBibGsgLT0gODsKLQotICAgIHdoaWxlIChpLS0pCi0gICAgewotICAgICAgICB0bXAgPSAoKihibGsgKz0gOCkgKyAzMikgPj4gNjsKLSAgICAgICAgKmJsayA9IDA7Ci0KLSAgICAgICAgcHJlZF93b3JkID0gKigodWludDMyKikocmVjICs9IGx4KSk7IC8qIHJlYWQgNCBieXRlcyBmcm9tIHByZWQgKi8KLSAgICAgICAgcmVzID0gdG1wICsgKHByZWRfd29yZCAmIDB4RkYpOwotICAgICAgICBDTElQX1JFU1VMVChyZXMpOwotICAgICAgICByZXMyID0gdG1wICsgKChwcmVkX3dvcmQgPj4gOCkgJiAweEZGKTsKLSAgICAgICAgQ0xJUF9SRVNVTFQocmVzMik7Ci0gICAgICAgIGRzdF93b3JkID0gKHJlczIgPDwgOCkgfCByZXM7Ci0gICAgICAgIHJlcyA9IHRtcCArICgocHJ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xJUDEocmVzKTsKLSAgICAgICAgcmVzMiA9ICh4MCArIHgyKSA+PiAxNDsKLSAgICAgICAgQUREX0FORF9DTElQMihyZXMyKTsKLSAgICAgICAgZHN0X3dvcmQgPSAocmVzMiA8PCA4KSB8IHJlczsKLSAgICAgICAgcmVzID0gKHgwICsgeDEpID4+IDE0OwotICAgICAgICBBRERfQU5EX0NMSVAzKHJlcyk7Ci0gICAgICAgIGRzdF93b3JkIHw9IChyZXMgPDwgMTYpOwotICAgICAgICByZXMgPSAoeDAgKyB4NSkgPj4gMTQ7Ci0gICAgICAgIEFERF9BTkRfQ0xJUDQocmVzKTsKLSAgICAgICAgZHN0X3dvcmQgfD0gKHJlcyA8PCAyNCk7Ci0gICAgICAgICooKHVpbnQzMiopcmVjKSA9IGRzdF93b3JkOyAvKiBzYXZlIDQgYnl0ZXMgdG8gZHN0ICovCi0KLSAgICAgICAgcHJlZF93b3JkID0gKigodWludDMyKikocmVjICsgNCkpOyAvKiByZWFkIDQgYnl0ZXMgZnJvbSBwcmVkICovCi0gICAgICAgIHJlcyA9ICh4MCAtIHg1KSA+PiAxNDsKLSAgICAgICAgQUREX0FORF9DTElQMShyZXMpOwotICAgICAgICByZXMyID0gKHgwIC0geDEpID4+IDE0OwotICAgICAgICBBRERfQU5EX0NMSVAyKHJlczIpOwotICAgICAgICBkc3Rfd29yZCA9IChyZXMyIDw8IDgpIHwgcmVzOwotICAgICAgICByZXMgPSAoeDAgLSB4MikgPj4gMTQ7Ci0gICAgICAgIEFERF9BTkRfQ0xJUDMocmVzKTsKLSAgICAgICAgZHN0X3dvcmQgfD0gKHJlcyA8PCAxNik7Ci0gICAgICAgIHJlcyA9ICh4MCAtIHg0KSA+PiAxNDsKLSAgICAgICAgQUREX0FORF9DTElQNChyZXMpOwotICAgICAgICBkc3Rfd29yZCB8PSAocmVzIDw8IDI0KTsKLSAgICAgICAgKigodWludDMyKikocmVjICsgNCkpID0gZHN0X3dvcmQ7IC8qIHNhdmUgNCBieXRlcy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7Ci0KLSAgICAgICAgeDcgPSAoVzcgKiB4MSArIDQpID4+IDM7Ci0gICAgICAgIHgxID0gKFcxICogeDEgKyA0KSA+PiAzOwotICAgICAgICB4MyA9IHg3OwotICAgICAgICB4NSA9ICgxODEgKiAoeDEgLSB4NykgKyAxMjgpID4+IDg7Ci0gICAgICAgIHg3ID0gKDE4MSAqICh4MSArIHg3KSArIDEyOCkgPj4gODsKLQotICAgICAgICBwcmVkX3dvcmQgPSAqKCh1aW50MzIqKShyZWMgKz0gbHgpKTsgLyogcmVhZCA0IGJ5dGVzIGZyb20gcHJlZCAqLwotICAgICAgICByZXMgPSAoeDAgKyB4MSkgPj4gMTQ7Ci0gICAgICAgIEFERF9BTkRfQ0xJUDEocmVzKTsKLSAgICAgICAgcmVzMiA9ICh4NCArIHg3KSA+PiAxNDsKLSAgICAgICAgQUREX0FORF9DTElQMihyZXMyKTsKLSAgICAgICAgZHN0X3dvcmQgPSAocmVzMiA8PCA4KSB8IHJlczsKLSAgICAgICAgcmVzID0gKHg2ICsgeDUpID4+IDE0OwotICAgICAgICBBRERfQU5EX0NMSVAzKHJlcyk7Ci0gICAgICAgIGRzdF93b3JkIHw9IChyZXMgPDwgMTYpOwotICAgICAgICByZXMgPSAoeDIgKyB4MykgPj4gMTQ7Ci0gICAgICAgIEFERF9BTkRfQ0xJUDQocmVzKTsKLSAgICAgICAgZHN0X3dvcmQgfD0gKHJlcyA8PCAyNCk7Ci0gICAgICAgICooKHVpbnQzMiopcmVjKSA9IGRzdF93b3JkOyAvKiBzYXZlIDQgYnl0ZXMgdG8gZHN0ICovCi0KLSAgICAgICAgcHJlZF93b3JkID0gKigodWludDMyKikocmVjICsgNCkpOyAvKiByZWFkIDQgYnl0ZXMgZnJvbSBwcmVkICovCi0gICAgICAgIHJlcyA9ICh4MiAtIHgzKSA+PiAxNDsKLSAgICAgICAgQUREX0FORF9DTElQMShyZXMpOwotICAgICAgICByZXMyID0gKHg2IC0geDUpID4+IDE0OwotICAgICAgICBBRERfQU5EX0NMSVAyKHJlczIpOwotICAgICAgICBkc3Rfd29yZCA9IChyZXMyIDw8IDgpIHwgcmVzOwotICAgICAgICByZXMgPSAoeDQgLSB4NykgPj4gMTQ7Ci0gICAgICAgIEFERF9BTkRfQ0xJUDMocmVzKTsKLSAgICAgICAgZHN0X3dvcmQgfD0gKHJlcyA8PCAxNik7Ci0gICAgICAgIHJlcyA9ICh4MCAtIHgxKSA+PiAxNDsKLSAgICAgICAgQUREX0FORF9DTElQNChyZXMpOwotICAgICAgICBkc3Rfd29yZCB8PSAocmVzIDw8IDI0KTsKLSAgICAgICAgKigodWludDMyKikocmVjICsgNCkpID0gZHN0X3dvcmQ7IC8qIHNhdmUgNCBieXRlcyB0byBkc3QgKi8KLSAgICB9Ci0KLSAgICByZXR1cm4gOwotfQotCi12b2lkIGlkY3Rfcm93NEludGVyKFNob3J0ICpibGssIFVDaGFyICpyZWMsIEludCBseCkKLXsKLSAgICBpbnQzMiB4MCwgeDEsIHgyLCB4MywgeDQsIHg1LCB4NiwgeDcsIHg4OwotICAgIGludCBpID0gODsKLSAgICB1aW50MzIgcHJlZF93b3JkLCBkc3Rfd29yZDsKLSAgICBpbnQgcmVzLCByZXMyOwotCi0gICAgLyogcHJlc2V0IHRoZSBvZmZzZXQsIHN1Y2ggdGhhdCB3ZSBjYW4gdGFrZSBhZHZhbnRhZ2UgcHJlLW9mZnNldCBhZGRyZXNzaW5nIG1vZGUgICAqLwotICAgIHJlYyAtPSBseDsKLSAgICBibGsgLT0gODsKLQotICAgIHdoaWxlIChpLS0pCi0gICAgewotICAgICAgICB4MiA9IGJsa1sxMF07Ci0gICAgICAgIGJsa1sxMF0gPSAwOwotICAgICAgICB4MSA9IGJsa1s5XTsKLSAgICAgICAgYmxrWzldID0gMDsKLSAgICAgICAgeDMgPSBibGtbMTFdOwotICAgICAgICBibGtbMTFdID0gMDsKLSAgICAgICAgeDAgPSAoKCooYmxrICs9IDgpKSA8PCA4KSArIDgxOTI7Ci0gICAgICAgICpibGsgPSAwOyAgIC8qIGZvciBwcm9wZXIgcm91bmRpbmcgaW4gdGhlIGZvdXJ0aCBzdGFnZSAqLwotCi0gICAgICAgIHg0ID0geDA7Ci0gICAgICAgIHg2ID0gKFc2ICogeDIgKyA0KSA+PiAzOwotICAgICAgICB4MiA9IChXMiAqIHgyICsgNCkgPj4gMzsKLSAgICAgICAgeDggPSB4MCAtIHgyOwotICAgICAgICB4MCArPSB4MjsKLSAgICAgICAgeDIgPSB4ODsKLSAgICAgICAgeDggPSB4NCAtIHg2OwotICAgICAgICB4NCArPSB4NjsKLSAgICAgICAgeDYgPSB4ODsKLQotICAgICAgICB4NyA9IChXNyAqIHgxICsgNCkgPj4gMzsKLSAgICAgICAgeDEgPSAoVzEgKiB4MSArIDQpID4+IDM7Ci0gICAgICAgIHg1ID0gKFczICogeDMgKyA0KSA+PiAzOwotICAgICAgICB4MyA9ICgtIFc1ICogeDMgKyA0KSA+PiAzOwotICAgICAgICB4OCA9IHgxIC0geDU7Ci0gICAgICAgIHgxICs9IHg1OwotICAgICAgICB4NSA9IHg4OwotICAgICAgICB4OCA9IHg3IC0geDM7Ci0gICAgICAgIHgzICs9IHg3OwotICAgICAgICB4NyA9ICgxODEgKiAoeDUgKyB4OCkgKyAxMjgpID4+IDg7Ci0gICAgICAgIHg1ID0gKDE4MSAqICh4NSAtIHg4KSArIDEyOCkgPj4gODsKLQotICAgICAgICBwcmVkX3dvcmQgPSAqKCh1aW50MzIqKShyZWMgKz0gbHgpKTsgLyogcmVhZCA0IGJ5dGVzIGZyb20gcHJlZCAqLwotICAgICAgICByZXMgPSAoeDAgKyB4MSkgPj4gMTQ7Ci0gICAgICAgIEFERF9BTkRfQ0xJUDEocmVzKTsKLSAgICAgICAgcmVzMiA9ICh4NCArIHg3KSA+PiAxNDsKLSAgICAgICAgQUREX0FORF9DTElQMihyZXMyKTsKLSAgICAgICAgZHN0X3dvcmQgPSAocmVzMiA8PCA4KSB8IHJlczsKLSAgICAgICAgcmVzID0gKHg2ICsgeDUpID4+IDE0OwotICAgICAgICBBRERfQU5EX0NMSVAzKHJlcyk7Ci0gICAgICAgIGRzdF93b3JkIHw9IChyZXMgPDwgMTYpOwotICAgICAgICByZXMgPSAoeDIgKyB4MykgPj4gMTQ7Ci0gICAgICAgIEFERF9BTkRfQ0xJUDQocmVzKTsKLSAgICAgICAgZHN0X3dvcmQgfD0gKHJlcyA8PCAyNCk7Ci0gICAgICAgICooKHVpbnQzMiopcmVjKSA9IGRzdF93b3JkOyAvKiBzYXZlIDQgYnl0ZXMgdG8gZHN0ICovCi0KLSAgICAgICAgcHJlZF93b3JkID0gKigodWludDMyKikocmVjICsgNCkpOyAvKiByZWFkIDQgYnl0ZXMgZnJvbSBwcmVkICovCi0gICAgICAgIHJlcyA9ICh4MiAtIHgzKSA+PiAxNDsKLSAgICAgICAgQUREX0FORF9DTElQMShyZXMpOwotICAgICAgICByZXMyID0gKHg2IC0geDUpID4+IDE0OwotICAgICAgICBBRERfQU5EX0NMSVAyKHJlczIpOwotICAgICAgICBkc3Rfd29yZCA9IChyZXMyIDw8IDgpIHwgcmVzOwotICAgICAgICByZXMgPSAoeDQgLSB4NykgPj4gMTQ7Ci0gICAgICAgIEFERF9BTkRfQ0xJUDMocmVzKTsKLSAgICAgICAgZHN0X3dvcmQgfD0gKHJlcyA8PCAxNik7Ci0gICAgICAgIHJlcyA9ICh4MCAtIHgxKSA+PiAxNDsKLSAgICAgICAgQUREX0FORF9DTElQNChyZXMpOwotICAgICAgICBkc3Rfd29yZCB8PSAocmVzIDw8IDI0KTsKLSAgICAgICAgKigodWludDMyKikocmVjICsgNCkpID0gZHN0X3dvcmQ7IC8qIHNhdmUgNCBieXRlcyB0byBkc3QgKi8KLSAgICB9Ci0gICAgcmV0dXJuIDsKLX0KLQotI2lmbmRlZiBTTUFMTF9EQ1QKLXZvaWQgaWRjdF9yb3cweDQwSW50ZXIoU2hvcnQgKmJsaywgVUNoYXIgKnJlYywgSW50IGx4KQotewotICAg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aW50IGkgPSA4OwotICAgIHVpbnQzMiBwcmVkX3dvcmQsIGRzdF93b3JkOwotICAgIGludCByZXMsIHJlczI7Ci0KLSAgICAvKiBwcmVzZXQgdGhlIG9mZnNldCwgc3VjaCB0aGF0IHdlIGNhbiB0YWtlIGFkdmFudGFnZSBwcmUtb2Zmc2V0IGFkZHJlc3NpbmcgbW9kZSAgICovCi0gICAgcmVjIC09IGx4OwotCi0gICAgd2hpbGUgKGktLSkKLSAgICB7Ci0gICAgICAgIHgzID0gYmxrWzNdOwotICAgICAgICBibGtbM10gPSAwOwotICAgICAgICBibGsgKz0gODsKLQotICAgICAgICB4MSA9IChXMyAqIHgzICsgNCkgPj4gMzsKLSAgICAgICAgeDMgPSAoLVc1ICogeDMgKyA0KSA+PiAzOwotCi0gICAgICAgIHg3ID0gKC0xODEgKiAoeDMgKyB4MSkgKyAxMjgpID4+IDg7Ci0gICAgICAgIHg1ID0gKDE4MSAqICh4MyAtIHgxKSArIDEyOCkgPj4gODsKLQotICAgICAgICBwcmVkX3dvcmQgPSAqKCh1aW50MzIqKShyZWMgKz0gbHgpKTsgLyogcmVhZCA0IGJ5dGVzIGZyb20gcHJlZCAqLwotICAgICAgICByZXMgPSAoODE5MiArIHgxKSA+PiAxNDsKLSAgICAgICAgQUREX0FORF9DTElQMShyZXMpOwotICAgICAgICByZXMyID0gKDgxOTIgKyB4NykgPj4gMTQ7Ci0gICAgICAgIEFERF9BTkRfQ0xJUDIocmVzMik7Ci0gICAgICAgIGRzdF93b3JkID0gKHJlczIgPDwgOCkgfCByZXM7Ci0gICAgICAgIHJlcyA9ICg4MTkyICsgeDUpID4+IDE0OwotICAgICAgICBBRERfQU5EX0NMSVAzKHJlcyk7Ci0gICAgICAgIGRzdF93b3JkIHw9IChyZXMgPDwgMTYpOwotICAgICAgICByZXMgPSAoODE5MiArIHgzKSA+PiAxNDsKLSAgICAgICAgQUREX0FORF9DTElQNChyZXMpOwotICAgICAgICBkc3Rfd29yZCB8PSAocmVzID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CB3ZSBjYW4gdGFrZSBhZHZhbnRhZ2UgcHJlLW9mZnNldCBhZGRyZXNzaW5nIG1vZGUgICAqLwotICAgIHJlYyAtPSBseDsKLSAgICBibGsgLT0gODsKLQotICAgIHdoaWxlIChpLS0pCi0gICAgewotICAgICAgICB4MSA9IChpbnQzMilibGtbMTJdIDw8IDg7Ci0gICAgICAgIGJsa1sxMl0gPSAwOwotICAgICAgICB4MiA9IGJsa1sxNF07Ci0gICAgICAgIGJsa1sxNF0gPSAwOwotICAgICAgICB4MyA9IGJsa1sxMF07Ci0gICAgICAgIGJsa1sxMF0gPSAwOwotICAgICAgICB4NCA9IGJsa1s5XTsKLSAgICAgICAgYmxrWzldID0gMDsKLSAgICAgICAgeDUgPSBibGtbMTVdOwotICAgICAgICBibGtbMTVdID0gMDsKLSAgICAgICAgeDYgPSBibGtbMTNdOwotICAgICAgICBibGtbMTNdID0gMDsKLSAgICAgICAgeDcgPSBibGtbMTFdOwotICAgICAgICBibGtbMTFdID0gMDsKLSAgICAgICAgeDAgPSAoKCooYmxrICs9IDgpKSA8PCA4KSArIDgxOTI7Ci0gICAgICAgICpibGsgPSAwOyAgIC8qIGZvciBwcm9wZXIgcm91bmRpbmcgaW4gdGhlIGZvdXJ0aCBzdGFnZSAqLwotCi0gICAgICAgIC8qIGZpcnN0IHN0YWdlICovCi0gICAgICAgIHg4ID0gVzcgKiAoeDQgKyB4NSkgKyA0OwotICAgICAgICB4NCA9ICh4OCArIChXMSAtIFc3KSAqIHg0KSA+PiAzOwotICAgICAgICB4NSA9ICh4OCAtIChXMSArIFc3KSAqIHg1KSA+PiAzOwotICAgICAgICB4OCA9IFczICogKHg2ICsgeDcpICsgNDsKLSAgICAgICAgeDYgPSAoeDggLSAoVzMgLSBXNSkgKiB4NikgPj4gMzsKLSAgICAgICAgeDcgPSAoeDggLSAoVzMgKyBXNSkgKiB4NykgPj4gMzsKLQotICAgICAgICAvKiBzZWNvbmQgc3RhZ2UgKi8KLSAgICAgICAgeDggPSB4MCArIHgxOwotICAgICAgICB4MCAtPSB4MTsKLSAgICAgICAgeDEgPSBXNiAqICh4MyArIHgyKSArIDQ7Ci0gICAgICAgIHgyID0gKHgxIC0gKFcyICsgVzYpICogeDIpID4+IDM7Ci0gICAgICAgIHgzID0gKHgxICsgKFcyIC0gVzYpICogeDMpID4+IDM7Ci0gICAgICAgIHgxID0geDQgKyB4NjsKLSAgICAgICAgeDQgLT0geDY7Ci0gICAgICAgIHg2ID0geDUgKyB4NzsKLSAgICAgICAgeDUgLT0geDc7Ci0KLSAgICAgICAgLyogdGhpcmQgc3RhZ2UgKi8KLSAgICAgICAgeDcgPSB4OCArIHgzOwotICAgICAgICB4OCAtPSB4MzsKLSAgICAgICAgeDMgPSB4MCArIHgyOwotICAgICAgICB4MCAtPSB4MjsKLSAgICAgICAgeDIgPSAoMTgxICogKHg0ICsgeDUpICsgMTI4KSA+PiA4OwotICAgICAgICB4NCA9ICgxODEgKiAoeDQgLSB4NSkgKyAxMjgpID4+IDg7Ci0KLSAgICAgICAgLyogZm91cnRoIHN0YWdlICovCi0gICAgICAgIHByZWRfd29yZCA9ICooKHVpbnQzMiopKHJlYyArPSBseCkpOyAvKiByZWFkIDQgYnl0ZXMgZnJvbSBwcmVkICovCi0KLSAgICAgICAgcmVzID0gKHg3ICsgeDEpID4+IDE0OwotICAgICAgICBBRERfQU5EX0NMSVAxKHJlcyk7Ci0gICAgICAgIHJlczIgPSAoeDMgKyB4MikgPj4gMTQ7Ci0gICAgICAgIEFERF9BTkRfQ0xJUDIocmVzMik7Ci0gICAgICAgIGRzdF93b3JkID0gKHJlczIgPDwgOCkgfCByZXM7Ci0gICAgICAgIHJlcyA9ICh4MCArIHg0KSA+PiAxNDsKLSAgICAgICAgQUREX0FORF9DTElQMyhyZXMpOwotICAgICAgICBkc3Rfd29yZCB8PSAocmVzIDw8IDE2KTsKLSAgICAgICAgcmVzID0gKHg4ICsgeDYpID4+IDE0OwotICAgICAgICBBRERfQU5EX0NMSVA0KHJlcyk7Ci0gICAgICAgIGRzdF93b3JkIHw9IChyZXMgPDwgMjQpOwotICAgICAgICAqKCh1aW50MzIqKXJlYykgPSBkc3Rfd29yZDsgLyogc2F2ZSA0IGJ5dGVzIHRvIGRzdCAqLwotCi0gICAgICAgIHByZWRfd29yZCA9ICooKHVpbnQzMiopKHJlYyArIDQpKTsgLyogcmVhZCA0IGJ5dGVzIGZyb20gcHJlZCAqLwotCi0gICAgICAgIHJlcyA9ICh4OCAtIHg2KSA+PiAxNDsKLSAgICAgICAgQUREX0FORF9DTElQMShyZXMpOwotICAgICAgICByZXMyID0gKHgwIC0geDQpID4+IDE0OwotICAgICAgICBBRERfQU5EX0NMSVAyKHJlczIpOwotICAgICAgICBkc3Rfd29yZCA9IChyZXMyIDw8IDgpIHwgcmVzOwotICAgICAgICByZXMgPSAoeDMgLSB4MikgPj4gMTQ7Ci0gICAgICAgIEFERF9BTkRfQ0xJUDMocmVzKTsKLSAgICAgICAgZHN0X3dvcmQgfD0gKHJlcyA8PCAxNik7Ci0gICAgICAgIHJlcyA9ICh4NyAtIHgxKSA+PiAxNDsKLSAgICAgICAgQUREX0FORF9DTElQNChyZXMpOwotICAgICAgICBkc3Rfd29yZCB8PSAocmVzIDw8IDI0KTsKLSAgICAgICAgKigodWludDMyKikocmVjICsgNCkpID0gZHN0X3dvcmQ7IC8qIHNhdmUgNCBieXRlcyB0byBkc3QgKi8KLSAgICB9Ci0gICAgcmV0dXJuOwotfQotCi12b2lkIGlkY3Rfcm93MEludHJhKFNob3J0ICpzcmNlLCBVQ2hhciAqcmVjLCBJbnQgbHgpCi17Ci0gICAgT1NDTF9VTlVTRURfQVJHKHNyY2UpOwotCi0gICAgT1NDTF9VTlVTRURfQVJHKHJlYyk7Ci0KLSAgICBPU0NMX1VOVVNFRF9BUkcobHgpOwotCi0gICAgcmV0dXJuOwotfQotCi12b2lkIGlkY3Rfcm93MUludHJhKFNob3J0ICpibGssIFVDaGFyICpyZWMsIEludCBseCkKLXsKLSAgICBpbnQzMiB0bXA7Ci0gICAgaW50IGkgPSA4OwotCi0gICAgcmVjIC09IGx4OwotICAgIGJsayAtPSA4OwotICAgIHdoaWxlIChpLS0pCi0gICAgewotICAgICAgICB0bXAgPSAoKCooYmxrICs9IDgpICsgMzIpID4+IDYpOwotICAgICAgICAqYmxrID0gMDsKLSAgICAgICAgQ0xJUF9SRVNVTFQodG1wKQotCi0gICAgICAgIHRtcCB8PSAodG1wIDw8IDgpOwotICAgICAgICB0bXAgfD0gKHRtcCA8PCAxNik7Ci0gICAgICAgICooKHVpbnQzMiopKHJlYyArPSBseCkpID0gdG1wOwotICAgICAgICAqKCh1aW50MzIqKShyZWMgKyA0KSkgPSB0bXA7Ci0gICAgfQotICAgIHJldHVybjsKLX0KLQotdm9pZCBpZGN0X3JvdzJJbnRyYShTaG9ydCAqYmxrLCBVQ2hhciAqcmVjLCBJbnQgbHgpCi17Ci0gICAgaW50MzIgeDAsIHgxLCB4MiwgeDQsIHg1OwotICAgIGludCByZXMsIHJlczI7Ci0gICAgdWludDMyIGRzdF93b3JkOwotICAgIGludCBpID0gODsKLQotICAgIHJlYyAtPSBseDsKLSAgICBibGsgLT0gODsKLSAgICB3aGlsZSAoaS0tKQotICAgIHsKLSAgICAgICAgLyogc2hvcnRjdXQgKi8KLSAgICAgICAgeDQgPSBibGtbOV07Ci0gICAgICAgIGJsa1s5XSA9IDA7Ci0gICAgICAgIHgwID0gKCgqKGJsayArPSA4KSkgPDwgOCkgKyA4MTkyOwotICAgICAgICAqYmxrID0gMDsgICAvKiBmb3IgcHJvcGVyIHJvdW5kaW5nIGluIHRoZSBmb3VydGggc3RhZ2UgKi8KLQotICAgICAgICAvKiBmaXJzdCBzdGFnZSAqLwotICAgICAgICB4NSA9IChXNyAqIHg0ICsgNCkgPj4gMzsKLSAgICAgICAgeDQgPSAoVzEgKiB4NCArIDQpID4+IDM7Ci0KLSAgICAgICAgLyogdGhpcmQgc3RhZ2UgKi8KLSAgICAgICAgeDIgPSAoMTgxICogKHg0ICsgeDUpICsgMTI4KSA+PiA4OwotICAgICAgICB4MSA9ICgxODEgKiAoeDQgLSB4NSkgKyAxMjgpID4+IDg7Ci0KLSAgICAgICAgLyogZm91cnRoIHN0YWdlICovCi0gICAgICAgIHJlcyA9ICgoeDAgKyB4NCkgPj4gMTQpOwotICAgICAgICBDTElQX1JFU1VMVChyZXMpCi0gICAgICAgIHJlczIgPSAoKHgwICsgeDIpID4+IDE0KTsKLSAgICAgICAgQ0xJUF9SRVNVTFQocmVzMikKLSAgICAgICAgZHN0X3dvcmQgPSAocmVzMiA8PCA4KSB8IHJlczsKLSAgICAgICAgcmVzID0gKCh4MCArIHgxKSA+PiAxNCk7Ci0gICAgICAgIENMSVBfUkVTVUxUKHJlcykKLSAgICAgICAgZHN0X3dvcmQgfD0gKHJlcyA8PCAxNik7Ci0gICAgICAgIHJlcyA9ICgoeDAgKyB4NSkgPj4gMTQpOwotICAgICAgICBDTElQX1JFU1VMVChyZXMpCi0gICAgICAgIGRzdF93b3JkIHw9IChyZXMgPDwgMjQpOwotICAgICAgICAqKCh1aW50MzIqKShyZWMgKz0gbHgpKSA9IGRzdF93b3JkOwotCi0gICAgICAgIHJlcyA9ICgoeDAgLSB4NSkgPj4gMTQpOwotICAgICAgICBDTElQX1JFU1VMVChyZXMpCi0gICAgICAgIHJlczIgPSAoKHgwIC0geDEpID4+IDE0KTsKLSAgICAgICAgQ0xJUF9SRVNVTFQocmVzMikKLSAgICAgICAgZHN0X3dvcmQgPSAocmVzMiA8PCA4KSB8IHJlczsKLSAgICAgICAgcmVzID0gKCh4MCAtIHgyKSA+PiAxNCk7Ci0gICAgICAgIENMSVBfUkVTVUxUKHJlcykKLSAgICAgICAgZHN0X3dvcmQgfD0gKHJlcyA8PCAxNik7Ci0gICAgICAgIHJlcyA9ICgoeDAgLSB4NCkgPj4gMTQpOwotICAgICAgICBDTElQX1JFU1VMVChyZXMpCi0gICAgICAgIGRzdF93b3JkIHw9IChyZXMgPDwgMjQp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IHgzID0geDc7Ci0gICAgICAgIHg1ID0gKDE4MSAqICh4MSAtIHg3KSArIDEyOCkgPj4gODsKLSAgICAgICAgeDcgPSAoMTgxICogKHgxICsgeDcpICsgMTI4KSA+PiA4OwotCi0gICAgICAgIHJlcyA9ICgoeDAgKyB4MSkgPj4gMTQpOwotICAgICAgICBDTElQX1JFU1VMVChyZXMpCi0gICAgICAgIHJlczIgPSAoKHg0ICsgeDcpID4+IDE0KTsKLSAgICAgICAgQ0xJUF9SRVNVTFQocmVzMikKLSAgICAgICAgZHN0X3dvcmQgPSAocmVzMiA8PCA4KSB8IHJlczsKLSAgICAgICAgcmVzID0gKCh4NiArIHg1KSA+PiAxNCk7Ci0gICAgICAgIENMSVBfUkVTVUxUKHJlcykKLSAgICAgICAgZHN0X3dvcmQgfD0gKHJlcyA8PCAxNik7Ci0gICAgICAgIHJlcyA9ICgoeDIgKyB4MykgPj4gMTQpOwotICAgICAgICBDTElQX1JFU1VMVChyZXMpCi0gICAgICAgIGRzdF93b3JkIHw9IChyZXMgPDwgMjQpOwotICAgICAgICAqKCh1aW50MzIqKShyZWMgKz0gbHgpKSA9IGRzdF93b3JkOwotCi0gICAgICAgIHJlcyA9ICgoeDIgLSB4MykgPj4gMTQpOwotICAgICAgICBDTElQX1JFU1VMVChyZXMpCi0gICAgICAgIHJlczIgPSAoKHg2IC0geDUpID4+IDE0KTsKLSAgICAgICAgQ0xJUF9SRVNVTFQocmVzMikKLSAgICAgICAgZHN0X3dvcmQgPSAocmVzMiA8PCA4KSB8IHJlczsKLSAgICAgICAgcmVzID0gKCh4NCAtIHg3KSA+PiAxNCk7Ci0gICAgICAgIENMSVBfUkVTVUxUKHJlcykKLSAgICAgICAgZHN0X3dvcmQgfD0gKHJlcyA8PCAxNik7Ci0gICAgICAgIHJlcyA9ICgoeDAgLSB4MSkgPj4gMTQpOwotICAgICAgICBDTElQX1JFU1VMVChyZXMpCi0gICAgICAgIGRzdF93b3JkIHw9IChyZXMgPDwgMjQpOwotICAgICAgICAqKCh1aW50MzIqKShyZWMgKyA0KSkgPSBkc3Rfd29yZDsKLQotICAgIH0KLSAgICByZXR1cm4gOwotfQotCi12b2lkIGlkY3Rfcm93NEludHJhKFNob3J0ICpibGssIFVDaGFyICpyZWMsIEludCBseCkKLXsKLSAgICBpbnQzMiB4MCwgeDEsIHgyLCB4MywgeDQsIHg1LCB4NiwgeDcsIHg4OwotICAgIGludCByZXMsIHJlczI7Ci0gICAgdWludDMyIGRzdF93b3JkOwotICAgIGludCBpID0gODsKLQotICAgIHJlYyAtPSBseDsKLSAgICBibGsgLT0gODsKLSAgICB3aGlsZSAoaS0tKQotICAgIHsKLSAgICAgICAgeDIgPSBibGtbMTBdOwotICAgICAgICBibGtbMTBdID0gMDsKLSAgICAgICAgeDEgPSBibGtbOV07Ci0gICAgICAgIGJsa1s5XSA9IDA7Ci0gICAgICAgIHgzID0gYmxrWzExXTsKLSAgICAgICAgYmxrWzExXSA9IDA7Ci0gICAgICAgIHgwID0gKCgqKGJsayArPSA4KSkgPDwgOCkgKyA4MTkyOwotICAgICAgICAqYmxrID0gMDsgLyogZm9yIHByb3BlciByb3VuZGluZyBpbiB0aGUgZm91cnRoIHN0YWdlICovCi0KLSAgICAgICAgeDQgPSB4MDsKLSAgICAgICAgeDYgPSAoVzYgKiB4MiArIDQpID4+IDM7Ci0gICAgICAgIHgyID0gKFcyICogeDIgKyA0KSA+PiAzOwotICAgICAgICB4OCA9IHgwIC0geDI7Ci0gICAgICAgIHgwICs9IHgyOwotICAgICAgICB4MiA9IHg4OwotICAgICAgICB4OCA9IHg0IC0geDY7Ci0gICAgICAgIHg0ICs9IHg2OwotICAgICAgICB4NiA9IHg4OwotCi0gICAgICAgIHg3ID0gKFc3ICogeDEgKyA0KSA+PiAzOwotICAgICAgICB4MSA9IChXMSAqIHgxICsgNCkgPj4gMzsKLSAgICAgICAgeDUgPSAoVzMgKiB4MyArIDQpID4+IDM7Ci0gICAgICAgIHgzID0gKC0gVzUgKiB4MyArIDQpID4+IDM7Ci0gICAgICAgIHg4ID0geDEgLSB4NTsKLSAgICAgICAgeDEgKz0geDU7Ci0gICAgICAgIHg1ID0geDg7Ci0gICAgICAgIHg4ID0geDcgLSB4MzsKLSAgICAgICAgeDMgKz0geDc7Ci0gICAgICAgIHg3ID0gKDE4MSAqICh4NSArIHg4KSArIDEyOCkgPj4gODsKLSAgICAgICAgeDUgPSAoMTgxICogKHg1IC0geDgpICsgMTI4KSA+PiA4OwotCi0gICAgICAgIHJlcyA9ICgoeDAgKyB4MSkgPj4gMTQpOwotICAgICAgICBDTElQX1JFU1VMVChyZXMpCi0gICAgICAgIHJlczIgPSAoKHg0ICsgeDcpID4+IDE0KTsKLSAgICAgICAgQ0xJUF9SRVNVTFQocmVzMikKLSAgICAgICAgZHN0X3dvcmQgPSAocmVzMiA8PCA4KSB8IHJlczsKLSAgICAgICAgcmVzID0gKCh4NiArIHg1KSA+PiAxNCk7Ci0gICAgICAgIENMSVBfUkVTVUxUKHJlcykKLSAgICAgICAgZHN0X3dvcmQgfD0gKHJlcyA8PCAxNik7Ci0gICAgICAgIHJlcyA9ICgoeDIgKyB4MykgPj4gMTQpOwotICAgICAgICBDTElQX1JFU1VMVChyZXMpCi0gICAgICAgIGRzdF93b3JkIHw9IChyZXMgPDwgMjQpOwotICAgICAgICAqKCh1aW50MzIqKShyZWMgKz0gbHgpKSA9IGRzdF93b3JkOwotCi0gICAgICAgIHJlcyA9ICgoeDIgLSB4MykgPj4gMTQpOwotICAgICAgICBDTElQX1JFU1VMVChyZXMpCi0gICAgICAgIHJlczIgPSAoKHg2IC0geDUpID4+IDE0KTsKLSAgICAgICAgQ0xJUF9SRVNVTFQocmVzMikKLSAgICAgICAgZHN0X3dvcmQgPSAocmVzMiA8PCA4KSB8IHJlczsKLSAgICAgICAgcmVzID0gKCh4NCAtIHg3KSA+PiAxNCk7Ci0gICAgICAgIENMSVBfUkVTVUxUKHJlcykKLSAgICAgICAgZHN0X3dvcmQgfD0gKHJlcyA8PCAxNik7Ci0gICAgICAgIHJlcyA9ICgoeDAgLSB4MSkgPj4gMTQpOwotICAgICAgICBDTElQX1JFU1VMVChyZXMpCi0gICAgICAgIGRzdF93b3JkIHw9IChyZXMgPDwgMjQpOwotICAgICAgICAqKCh1aW50MzIqKShyZWMgKyA0KSkgPSBkc3Rfd29yZDsKLSAgICB9Ci0KLSAgICByZXR1cm4gOwotfQotCi0jaWZuZGVmIFNNQUxMX0RDVAotdm9pZCBpZGN0X3JvdzB4NDBJbnRyYShTaG9ydCAqYmxrLCBVQ2hhciAqcmVjLCBJbnQgbHgpCi17Ci0gICAgaW50MzIgIHgxLCB4MiwgeDQsIHg1OwotICAgIGludCByZXMsIHJlczI7Ci0gICAgdWludDMyIGRzdF93b3JkOwotICAgIGludCBpID0gODsKLQotICAgIHJlYyAtPSBseDsKLQotICAgIHdoaWxlIChpLS0pCi0gICAgewotICAgICAgICAvKiBzaG9ydGN1dCAqLwotICAgICAgICB4NCA9IGJsa1sxXTsKLSAgICAgICAgYmxrWzFdID0gMDsKLSAgICAgICAgYmxrICs9IDg7Ci0KLSAgICAgICAgLyogZmlyc3Qgc3RhZ2UgKi8KLSAgICAgICAgeDUgPSAoVzcgKiB4NCArIDQpID4+IDM7Ci0gICAgICAgIHg0ID0gKFcxICogeDQgKyA0KSA+PiAzOwotCi0gICAgICAgIC8qIHRoaXJkIHN0YWdlICovCi0gICAgICAgIHgyID0gKDE4MSAqICh4NCArIHg1KSArIDEyOCkgPj4gODsKLSAgICAgICAgeDEgPSAoMTgxICogKHg0IC0geDUpICsgMTI4KSA+PiA4OwotCi0gICAgICAgIC8qIGZvdXJ0aCBzdGFnZSAqLwotICAgICAgICByZXMgPSAoKDgxOTIgKyB4NCkgPj4gMTQpOwotICAgICAgICBDTElQX1JFU1VMVChyZXMpCi0gICAgICAgIHJlczIgPSAoKDgxOTIgKyB4MikgPj4gMTQpOwotICAgICAgICBDTElQX1JFU1VMVChyZXMyKQotICAgICAgICBkc3Rfd29yZCA9IChyZXMyIDw8IDgpIHwgcmVzOwotICAgICAgICByZXMgPSAoKDgxOTIgKyB4MSkgPj4gMTQpOwotICAgICAgICBDTElQX1JFU1VMVChyZXMpCi0gICAgICAgIGRzdF93b3JkIHw9IChyZXMgPDwgMTYpOwotICAgICAgICByZXMgPSAoKDgxOTIgKyB4NSkgPj4gMTQpOwotICAgICAgICBDTElQX1JFU1VMVChyZXMpCi0gICAgICAgIGRzdF93b3JkIHw9IChyZXMgPDwgMjQpOwotICAgICAgICAqKCh1aW50MzIqKShyZWMgKz0gbHgpKSA9IGRzdF93b3JkOwotCi0gICAgICAgIHJlcyA9ICgoODE5MiAtIHg1KSA+PiAxNCk7Ci0gICAgICAgIENMSVBfUkVTVUxUKHJlcykKLSAgICAgICAgcmVzMiA9ICgoODE5MiAtIHgxKSA+PiAxNCk7Ci0gICAgICAgIENMSVBfUkVTVUxUKHJlczIpCi0gICAgICAgIGRzdF93b3JkID0gKHJlczIgPDwgOCkgfCByZXM7Ci0gICAgICAgIHJlcyA9ICgoODE5MiAtIHgyKSA+PiAxNCk7Ci0gICAgICAgIENMSVBfUkVTVUxUKHJlcykKLSAgICAgICAgZHN0X3dvcmQgfD0gKHJlcyA8PCAxNik7Ci0gICAgICAgIHJlcyA9ICgoODE5MiAtIHg0KSA+PiAxNCk7Ci0gICAgICAgIENMSVBfUkVTVUxUKHJlcykKLSAgICAgICAgZHN0X3dvcmQgfD0gKHJlcyA8PCAyNCk7Ci0gICAgICAgICooKHVpbnQzMiopKHJlYyArIDQpKSA9IGRzdF93b3JkOwotCi0gICAgfQotICAgIHJldHVybiA7Ci19Ci0KLXZvaWQgaWRjdF9yb3cweDIwSW50cmEoU2hvcnQgKmJsaywgVUNoYXIgKnJlYywgSW50IGx4KQotewotICAgIGludDMyIHgwLCB4MiwgeDQsIHg2OwotICAgIGludCByZXMsIHJlczI7Ci0gICAgdWludDMyIGRzdF93b3JkOwotICAgIGludCBpID0gODsKLQotICAgIHJlYyAtPSBseDsKLSAgICB3aGlsZSAoaS0tKQotICAgIHsKLSAgICAgICAgeDIgPSBibGtbMl07Ci0gICAgICAgIGJsa1syXSA9IDA7Ci0gICAgICAgIGJsayArPSA4OwotCi0gICAgICAgIC8qIGJvdGggdXBwZXIgYW5kIGxvd2VyKi8KLSAgICAgICAgLyogYm90aCB4Mm9yeDYgYW5kIHgwb3J4NCAqLwotICAgICAgICB4NiA9IChXNiAqIHgyICsgNCkgPj4gMzsKLSAgICAgICAgeDIgPSAoVzIgKiB4MiArIDQpID4+IDM7Ci0gICAgICAgIHgwID0gODE5MiArIHgyOwotICAgICAgICB4MiA9IDgxOTIgLSB4MjsKLSAgICAgICAgeDQgPSA4MTkyICsgeDY7Ci0gICAgICAgIHg2ID0gODE5MiAtIHg2OwotCi0gICAgICAgIHJlcyA9ICgoeDApID4+IDE0KTsKLSAgICAgICAgQ0xJUF9SRVNVTFQocmVzKQotICAgICAgICByZXMyID0gKCh4NCkgPj4gMTQpOwotICAgICAgICBDTElQX1JFU1VMVChyZXMyKQotICAgICAgICBkc3Rfd29yZCA9IChyZXMyIDw8IDgpIHwgcmVzOwotICAgICAgICByZXMgPSAoKHg2KSA+PiAxNCk7Ci0gICAgICAgIENMSVBfUkVTVUxUKHJlcykKLSAgICAgICAgZHN0X3dvcmQgfD0gKHJlcyA8PCAxNik7Ci0gICAgICAgIHJlcyA9ICgoeDIpID4+IDE0KTsKLSAgICAgICAgQ0xJUF9SRVNVTFQocmVzKQotICAgICAgICBkc3Rfd29yZCB8PSAocmVzIDw8IDI0KTsKLSAgICAgICAgKigodWludDMyKikocmVjICs9IGx4KSkgPSBkc3Rfd29yZDsKLQotICAgICAgICByZXMgPSAoKHgyKSA+PiAxNCk7Ci0gICAgICAgIENMSVBfUkVTVUxUKHJlcykKLSAgICAgICAgcmVzMiA9ICgoeDYpID4+IDE0KTsKLSAgICAgICAgQ0xJUF9SRVNVTFQocmVzMikKLSAgICAgICAgZHN0X3dvcmQgPSAocmVzMiA8PCA4KSB8IHJlczsKLSAgICAgICAgcmVzID0gKCh4NCkgPj4gMTQpOwotICAgICAgICBDTElQX1JFU1VMVChyZXMpCi0gICAgICAgIGRzdF93b3JkIHw9IChyZXMgPDwgMTYpOwotICAgICAgICByZXMgPSAoKHgwKSA+PiAxNCk7Ci0gICAgICAgIENMSVBfUkVTVUxUKHJlcykKLSAgICAgICAgZHN0X3dvcmQgfD0gKHJlcyA8PCAyNCk7Ci0gICAgICAgICooKHVpbnQzMiopKHJlYyArIDQpKSA9IGRzdF93b3JkOwotCi0gICAgfQotICAgIHJldHVybiA7Ci19Ci0KLXZvaWQgaWRjdF9yb3cweDEwSW50cmEoU2hvcnQgKmJsaywgVUNoYXIgKnJlYywgSW50IGx4KQotewotICAgIGludDMyIHgxLCB4MywgeDUsIHg3OwotICAgIGludCByZXMsIHJlczI7Ci0gICAgdWludDMyIGRzdF93b3JkOwotICAgIGludCBpID0gODsKLQotICAgIHJlYyAtPSBseDsKLSAgICB3aGlsZSAoaS0tKQotICAgIHsKLSAgICAgICAgeDMgPSBibGtbM107Ci0gICAgICAgIGJsa1szXSA9IDAgOwotICAgICAgICBibGsgKz0gODsKLQotICAgICAgICB4MSA9IChXMyAqIHgzICsgNCkgPj4gMzsKLSAgICAgICAgeDMgPSAoVzUgKiB4MyArIDQpID4+IDM7Ci0KLSAgICAgICAgeDcgPSAoMTgxICogKHgzIC0geDEpICsgMTI4KSA+PiA4OwotICAgICAgICB4NSA9ICgtMTgxICogKHgxICsgeDMpICsgMTI4KSA+PiA4OwotCi0gICAgICAgIHJlcyA9ICgoODE5MiArIHgxKSA+PiAxNCk7Ci0gICAgICAgIENMSVBfUkVTVUxUKHJlcykKLSAgICAgICAgcmVzMiA9ICgoODE5MiArIHg3KSA+PiAxNCk7Ci0gICAgICAgIENMSVBfUkVTVUxUKHJlczIpCi0gICAgICAgIGRzdF93b3JkID0gKHJlczIgPDwgOCkgfCByZXM7Ci0gICAgICAgIHJlcyA9ICgoODE5MiArIHg1KSA+PiAxNCk7Ci0gICAgICAgIENMSVBfUkVTVUxUKHJlcykKLSAgICAgICAgZHN0X3dvcmQgfD0gKHJlcyA8PCAxNik7Ci0gICAgICAgIHJlcyA9ICgoODE5MiAtIHgzKSA+PiAxNCk7Ci0gICAgICAgIENMSVBfUkVTVUxUKHJlcykKLSAgICAgICAgZHN0X3dvcmQgfD0gKHJlcyA8PCAyNCk7Ci0gICAgICAgICooKHVpbnQzMiopKHJlYyArPSBseCkpID0gZHN0X3dvcmQ7Ci0KLSAgICAgICAgcmVzID0gKCg4MTkyICsgeDMpID4+IDE0KTsKLSAgICAgICAgQ0xJUF9SRVNVTFQocmVzKQotICAgICAgICByZXMyID0gKCg4MTkyIC0geDUpID4+IDE0KTsKLSAgICAgICAgQ0xJUF9SRVNVTFQocmVzMikKLSAgICAgICAgZHN0X3dvcmQgPSAocmVzMiA8PCA4KSB8IHJlczsKLSAgICAgICAgcmVzID0gKCg4MTkyIC0geDcpID4+IDE0KTsKLSAgICAgICAgQ0xJUF9SRVNVTFQocmVzKQotICAgICAgICBkc3Rfd29yZCB8PSAocmVzIDw8IDE2KTsKLSAgICAgICAgcmVzID0gKCg4MTkyIC0geDEpID4+IDE0KTsKLSAgICAgICAgQ0xJUF9SRVNVTFQocmVzKQotICAgICAgICBkc3Rfd29yZCB8PSAocmVzIDw8IDI0KTsKLSAgICAgICAgKigodWludDMyKikocmVjICsgNCkpID0gZHN0X3dvcmQ7Ci0KLSAgICB9Ci0KLSAgICByZXR1cm4gOwotfQotCi0jZW5kaWYgLyogU01BTExfRENUICovCi12b2lkIGlkY3Rfcm93SW50cmEoU2hvcnQgKmJsaywgVUNoYXIgKnJlYywgSW50IGx4KQotewotICAgIGludDMyIHgwLCB4MSwgeDIsIHgzLCB4NCwgeDUsIHg2LCB4NywgeDg7Ci0gICAgaW50IGkgPSA4OwotICAgIGludCByZXMsIHJlczI7Ci0gICAgdWludDMyIGRzdF93b3JkOwotCi0gICAgYmxrIC09IDg7Ci0gICAgcmVjIC09IGx4OwotCi0gICAgd2hpbGUgKGktLSkKLSAgICB7Ci0gICAgICAgIHgxID0gKGludDMyKWJsa1sxMl0gPDwgODsKLSAgICAgICAgYmxrWzEyXSA9IDA7Ci0gICAgICAgIHgyID0gYmxrWzE0XTsKLSAgICAgICAgYmxrWzE0XSA9IDA7Ci0gICAgICAgIHgzID0gYmxrWzEwXTsKLSAgICAgICAgYmxrWzEwXSA9IDA7Ci0gICAgICAgIHg0ID0gYmxrWzldOwotICAgICAgICBibGtbOV0gPSAwOwotICAgICAgICB4NSA9IGJsa1sxNV07Ci0gICAgICAgIGJsa1sxNV0gPSAwOwotICAgICAgICB4NiA9IGJsa1sxM107Ci0gICAgICAgIGJsa1sxM10gPSAwOwotICAgICAgICB4NyA9IGJsa1sxMV07Ci0gICAgICAgIGJsa1sxMV0gPSAwOwotICAgICAgICB4MCA9ICgoKihibGsgKz0gOCkpIDw8IDgpICsgODE5MjsKLSAgICAgICAgKmJsayA9IDA7ICAvKiBmb3IgcHJvcGVyIHJvdW5kaW5nIGluIHRoZSBmb3VydGggc3RhZ2UgKi8KLQotICAgICAgICAvKiBmaXJzdCBzdGFnZSAqLwotICAgICAgICB4OCA9IFc3ICogKHg0ICsgeDUpICsgNDsKLSAgICAgICAgeDQgPSAoeDggKyAoVzEgLSBXNykgKiB4NCkgPj4gMzsKLSAgICAgICAgeDUgPSAoeDggLSAoVzEgKyBXNykgKiB4NSkgPj4gMzsKLSAgICAgICAgeDggPSBXMyAqICh4NiArIHg3KSArIDQ7Ci0gICAgICAgIHg2ID0gKHg4IC0gKFczIC0gVzUpICogeDYpID4+IDM7Ci0gICAgICAgIHg3ID0gKHg4IC0gKFczICsgVzUpICogeDcpID4+IDM7Ci0KLSAgICAgICAgLyogc2Vjb25kIHN0YWdlICovCi0gICAgICAgIHg4ID0geDAgKyB4MTsKLSAgICAgICAgeDAgLT0geDE7Ci0gICAgICAgIHgxID0gVzYgKiAoeDMgKyB4MikgKyA0OwotICAgICAgICB4MiA9ICh4MSAtIChXMiArIFc2KSAqIHgyKSA+PiAzOwotICAgICAgICB4MyA9ICh4MSArIChXMiAtIFc2KSAqIHgzKSA+PiAzOwotICAgICAgICB4MSA9IHg0ICsgeDY7Ci0gICAgICAgIHg0IC09IHg2OwotICAgICAgICB4NiA9IHg1ICsgeDc7Ci0gICAgICAgIHg1IC09IHg3OwotCi0gICAgICAgIC8qIHRoaXJkIHN0YWdlICovCi0gICAgICAgIHg3ID0geDggKyB4MzsKLSAgICAgICAgeDggLT0geDM7Ci0gICAgICAgIHgzID0geDAgKyB4MjsKLSAgICAgICAgeDAgLT0geDI7Ci0gICAgICAgIHgyID0gKDE4MSAqICh4NCArIHg1KSArIDEyOCkgPj4gODsKLSAgICAgICAgeDQgPSAoMTgxICogKHg0IC0geDUpICsgMTI4KSA+PiA4OwotCi0gICAgICAgIC8qIGZvdXJ0aCBzdGFnZSAqLwotICAgICAgICByZXMgPSAoKHg3ICsgeDEpID4+IDE0KTsKLSAgICAgICAgQ0xJUF9SRVNVTFQocmVzKQotICAgICAgICByZXMyID0gKCh4MyArIHgyKSA+PiAxNCk7Ci0gICAgICAgIENMSVBfUkVTVUxUKHJlczIpCi0gICAgICAgIGRzdF93b3JkID0gcmVzIHwgKHJlczIgPDwgOCk7Ci0gICAgICAgIHJlcyA9ICgoeDAgKyB4NCkgPj4gMTQpOwotICAgICAgICBDTElQX1JFU1VMVChyZXMpCi0gICAgICAgIGRzdF93b3JkIHw9IChyZXMgPDwgMTYpOwotICAgICAgICByZXMgPSAoKHg4ICsgeDYpID4+IDE0KTsKLSAgICAgICAgQ0xJUF9SRVNVTFQocmVzKQotICAgICAgICBkc3Rfd29yZCB8PSAocmVzIDw8IDI0KTsKLSAgICAgICAgKigodWludDMyKikocmVjICs9IGx4KSkgPSBkc3Rfd29yZDsKLQotICAgICAgICByZXMgPSAoKHg4IC0geDYpID4+IDE0KTsKLSAgICAgICAgQ0xJUF9SRVNVTFQocmVzKQotICAgICAgICByZXMyID0gKCh4MCAt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RtcCArICgocHJlZF93b3JkID4+IDgpICYgMHhGRik7Ci0gICAgICAgIENMSVBfUkVTVUxUKHJlczIpOwotICAgICAgICBkc3Rfd29yZCA9IChyZXMyIDw8IDgpIHwgcmVzOwotICAgICAgICByZXMgPSB0bXAgKyAoKHByZWRfd29yZCA+PiAxNikgJiAweEZGKTsKLSAgICAgICAgQ0xJUF9SRVNVTFQocmVzKTsKLSAgICAgICAgZHN0X3dvcmQgfD0gKHJlcyA8PCAxNik7Ci0gICAgICAgIHJlcyA9IHRtcCArICgocHJlZF93b3JkID4+IDI0KSAmIDB4RkYpOwotICAgICAgICBDTElQX1JFU1VMVChyZXMpOwotICAgICAgICBkc3Rfd29yZCB8PSAocmVzIDw8IDI0KTsKLSAgICAgICAgKigodWludDMyKikocmVjICsgNCkpID0gZHN0X3dvcmQ7IC8qIHNhdmUgNCBieXRlcyB0byBkc3QgKi8KLSAgICB9Ci0gICAgcmV0dXJuOwotfQotCi12b2lkIGlkY3Rfcm93MnptdihTaG9ydCAqYmxrLCBVQ2hhciAqcmVjLCBVQ2hhciAqcHJlZCwgSW50IGx4KQotewotICAgIGludDMyIHgwLCB4MSwgeDIsIHg0LCB4NTsKLSAgICBpbnQgaSA9IDg7Ci0gICAgdWludDMyIHByZWRfd29yZCwgZHN0X3dvcmQ7Ci0gICAgaW50IHJlcywgcmVzMjsKLQotICAgIC8qIHByZXNldCB0aGUgb2Zmc2V0LCBzdWNoIHRoYXQgd2UgY2FuIHRha2UgYWR2YW50YWdlIHByZS1vZmZzZXQgYWRkcmVzc2luZyBtb2RlICAgKi8KLSAgICByZWMgLT0gbHg7Ci0gICAgcHJlZCAtPSAxNjsKLSAgICBibGsgLT0gODsKLQotICAgIHdoaWxlIChpLS0pCi0gICAgewotICAgICAgICAvKiBzaG9ydGN1dCAqLwotICAgICAgICB4NCA9IGJsa1s5XTsKLSAgICAgICAgYmxrWzldID0gMDsKLSAgICAgICAgeDAgPSAoKCooYmxrICs9IDgpKSA8PCA4KSArIDgxOTI7Ci0gICAgICAgICpibGsgPSAwOyAgLyogZm9yIHByb3BlciByb3VuZGluZyBpbiB0aGUgZm91cnRoIHN0YWdlICovCi0KLSAgICAgICAgLyogZmlyc3Qgc3RhZ2UgKi8KLSAgICAgICAgeDUgPSAoVzcgKiB4NCArIDQpID4+IDM7Ci0gICAgICAgIHg0ID0gKFcxICogeDQgKyA0KSA+PiAzOwotCi0gICAgICAgIC8qIHRoaXJkIHN0YWdlICovCi0gICAgICAgIHgyID0gKDE4MSAqICh4NCArIHg1KSArIDEyOCkgPj4gODsKLSAgICAgICAgeDEgPSAoMTgxICogKHg0IC0geDUpICsgMTI4KSA+PiA4OwotCi0gICAgICAgIC8qIGZvdXJ0aCBzdGFnZSAqLwotICAgICAgICBwcmVkX3dvcmQgPSAqKCh1aW50MzIqKShwcmVkICs9IDE2KSk7IC8qIHJlYWQgNCBieXRlcyBmcm9tIHByZWQgKi8KLSAgICAgICAgcmVzID0gKHgwICsgeDQpID4+IDE0OwotICAgICAgICBBRERfQU5EX0NMSVAxKHJlcyk7Ci0gICAgICAgIHJlczIgPSAoeDAgKyB4MikgPj4gMTQ7Ci0gICAgICAgIEFERF9BTkRfQ0xJUDIocmVzMik7Ci0gICAgICAgIGRzdF93b3JkID0gKHJlczIgPDwgOCkgfCByZXM7Ci0gICAgICAgIHJlcyA9ICh4MCArIHgxKSA+PiAxNDsKLSAgICAgICAgQUREX0FORF9DTElQMyhyZXMpOwotICAgICAgICBkc3Rfd29yZCB8PSAocmVzIDw8IDE2KTsKLSAgICAgICAgcmVzID0gKHgwICsgeDUpID4+IDE0OwotICAgICAgICBBRERfQU5EX0NMSVA0KHJlcyk7Ci0gICAgICAgIGRzdF93b3JkIHw9IChyZXMgPDwgMjQpOwotICAgICAgICAqKCh1aW50MzIqKShyZWMgKz0gbHgpKSA9IGRzdF93b3JkOyAvKiBzYXZlIDQgYnl0ZXMgdG8gZHN0ICovCi0KLSAgICAgICAgcHJlZF93b3JkID0gKigodWludDMyK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0pCi0gICAgewotICAgICAgICB4MiA9IGJsa1sxMF07Ci0gICAgICAgIGJsa1sxMF0gPSAwOwotICAgICAgICB4MSA9IGJsa1s5XTsKLSAgICAgICAgYmxrWzldID0gMDsKLSAgICAgICAgeDAgPSAoKCooYmxrICs9IDgpKSA8PCA4KSArIDgxOTI7Ci0gICAgICAgICpibGsgPSAwOyAgLyogZm9yIHByb3BlciByb3VuZGluZyBpbiB0aGUgZm91cnRoIHN0YWdlICovCi0gICAgICAgIC8qIGJvdGggdXBwZXIgYW5kIGxvd2VyKi8KLSAgICAgICAgLyogYm90aCB4Mm9yeDYgYW5kIHgwb3J4NCAqLwotCi0gICAgICAgIHg0ID0geDA7Ci0gICAgICAgIHg2ID0gKFc2ICogeDIgKyA0KSA+PiAzOwotICAgICAgICB4MiA9IChXMiAqIHgyICsgNCkgPj4gMzsKLSAgICAgICAgeDggPSB4MCAtIHgyOwotICAgICAgICB4MCArPSB4MjsKLSAgICAgICAgeDIgPSB4ODsKLSAgICAgICAgeDggPSB4NCAtIHg2OwotICAgICAgICB4NCArPSB4NjsKLSAgICAgICAgeDYgPSB4ODsKLQotICAgICAgICB4NyA9IChXNyAqIHgxICsgNCkgPj4gMzsKLSAgICAgICAgeDEgPSAoVzEgKiB4MSArIDQpID4+IDM7Ci0gICAgICAgIHgzID0geDc7Ci0gICAgICAgIHg1ID0gKDE4MSAqICh4MSAtIHg3KSArIDEyOCkgPj4gODsKLSAgICAgICAgeDcgPSAoMTgxICogKHgxICsgeDcpICsgMTI4KSA+PiA4OwotCi0gICAgICAgIHByZWRfd29yZCA9ICooKHVpbnQzMiopKHByZWQgKz0gMTYpKTsgLyogcmVhZCA0IGJ5dGVzIGZyb20gcHJlZCAqLwotICAgICAgICByZXMgPSAoeDAgKyB4MSkgPj4gMTQ7Ci0gICAgICAgIEFERF9BTkRfQ0xJUDEocmVzKTsKLSAgICAgICAgcmVzMiA9ICh4NCArIHg3KSA+PiAxNDsKLSAgICAgICAgQUREX0FORF9DTElQMihyZXMyKTsKLSAgICAgICAgZHN0X3dvcmQgPSAocmVzMiA8PCA4KSB8IHJlczsKLSAgICAgICAgcmVzID0gKHg2ICsgeDUpID4+IDE0OwotICAgICAgICBBRERfQU5EX0NMSVAzKHJlcyk7Ci0gICAgICAgIGRzdF93b3JkIHw9IChyZXMgPDwgMTYpOwotICAgICAgICByZXMgPSAoeDIgKyB4MykgPj4gMTQ7Ci0gICAgICAgIEFERF9BTkRfQ0xJUDQocmVzKTsKLSAgICAgICAgZHN0X3dvcmQgfD0gKHJlcyA8PCAyNCk7Ci0gICAgICAgICooKHVpbnQzMiopKHJlYyArPSBseCkpID0gZHN0X3dvcmQ7IC8qIHNhdmUgNCBieXRlcyB0byBkc3QgKi8KLQotICAgICAgICBwcmVkX3dvcmQgPSAqKCh1aW50MzIqKShwcmVkICsgNCkpOyAvKiByZWFkIDQgYnl0ZXMgZnJvbSBwcmVkICovCi0gICAgICAgIHJlcyA9ICh4MiAtIHgzKSA+PiAxNDsKLSAgICAgICAgQUREX0FORF9DTElQMShyZXMpOwotICAgICAgICByZXMyID0gKHg2IC0geDUpID4+IDE0OwotICAgICAgICBBRERfQU5EX0NMSVAyKHJlczIpOwotICAgICAgICBkc3Rfd29yZCA9IChyZXMyIDw8IDgpIHwgcmVzOwotICAgICAgICByZXMgPSAoeDQgLSB4NykgPj4gMTQ7Ci0gICAgICAgIEFERF9BTkRfQ0xJUDMocmVzKTsKLSAgICAgICAgZHN0X3dvcmQgfD0gKHJlcyA8PCAxNik7Ci0gICAgICAgIHJlcyA9ICh4MCAtIHgxKSA+PiAxNDsKLSAgICAgICAgQUREX0FORF9DTElQNChyZXMpOwotICAgICAgICBkc3Rfd29yZCB8PSAocmVzIDw8IDI0KTsKLSAgICAgICAgKigodWludDMyKikocmVjICsgNCkpID0gZHN0X3dvcmQ7IC8qIHNhdmUgNCBieXRlcyB0byBkc3QgKi8KLSAgICB9Ci0KLSAgICByZXR1cm4gOwotfQotCi12b2lkIGlkY3Rfc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xICogeDEgKyA0KSA+PiAzOwotICAgICAgICB4NSA9IChXMyAqIHgzICsgNCkgPj4gMzsKLSAgICAgICAgeDMgPSAoLSBXNSAqIHgzICsgNCkgPj4gMzsKLSAgICAgICAgeDggPSB4MSAtIHg1OwotICAgICAgICB4MSArPSB4NTsKLSAgICAgICAgeDUgPSB4ODsKLSAgICAgICAgeDggPSB4NyAtIHgzOwotICAgICAgICB4MyArPSB4NzsKLSAgICAgICAgeDcgPSAoMTgxICogKHg1ICsgeDgpICsgMTI4KSA+PiA4OwotICAgICAgICB4NSA9ICgxODEgKiAoeDUgLSB4OCkgKyAxMjgpID4+IDg7Ci0KLSAgICAgICAgcHJlZF93b3JkID0gKigodWludDMyKikocHJlZCArPSAxNikpOyAvKiByZWFkIDQgYnl0ZXMgZnJvbSBwcmVkICovCi0gICAgICAgIHJlcyA9ICh4MCArIHgxKSA+PiAxNDsKLSAgICAgICAgQUREX0FORF9DTElQMShyZXMpOwotICAgICAgICByZXMyID0gKHg0ICsgeDcpID4+IDE0OwotICAgICAgICBBRERfQU5EX0NMSVAyKHJlczIpOwotICAgICAgICBkc3Rfd29yZCA9IChyZXMyIDw8IDgpIHwgcmVzOwotICAgICAgICByZXMgPSAoeDYgKyB4NSkgPj4gMTQ7Ci0gICAgICAgIEFERF9BTkRfQ0xJUDMocmVzKTsKLSAgICAgICAgZHN0X3dvcmQgfD0gKHJlcyA8PCAxNik7Ci0gICAgICAgIHJlcyA9ICh4MiArIHgzKSA+PiAxNDsKLSAgICAgICAgQUREX0FORF9DTElQNChyZXMpOwotICAgICAgICBkc3Rfd29yZCB8PSAocmVzIDw8IDI0KTsKLSAgICAgICAgKigodWludDMyKikocmVjICs9IGx4KSkgPSBkc3Rfd29yZDsgLyogc2F2ZSA0IGJ5dGVzIHRvIGRzdCAqLwotCi0gICAgICAgIHByZWRfd29yZCA9ICooKHVpbnQzMiopKHByZWQgKyA0KSk7IC8qIHJlYWQgNCBieXRlcyBmcm9tIHByZWQgKi8KLSA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YmxrWzFdID0gMDsKLSAgICAgICAgYmxrICs9IDg7ICAvKiBmb3IgcHJvcGVyIHJvdW5kaW5nIGluIHRoZSBmb3VydGggc3RhZ2UgKi8KLQotICAgICAgICAvKiBmaXJzdCBzdGFnZSAqLwotICAgICAgICB4NSA9IChXNyAqIHg0ICsgNCkgPj4gMzsKLSAgICAgICAgeDQgPSAoVzEgKiB4NCArIDQpID4+IDM7Ci0KLSAgICAgICAgLyogdGhpcmQgc3RhZ2UgKi8KLSAgICAgICAgeDIgPSAoMTgxICogKHg0ICsgeDUpICsgMTI4KSA+PiA4OwotICAgICAgICB4MSA9ICgxODEgKiAoeDQgLSB4NSkgKyAxMjgpID4+IDg7Ci0KLSAgICAgICAgLyogZm91cnRoIHN0YWdlICovCi0gICAgICAgIHByZWRfd29yZCA9ICooKHVpbnQzMiopKHByZWQgKz0gMTYpKTsgLyogcmVhZCA0IGJ5dGVzIGZyb20gcHJlZCAqLwotICAgICAgICByZXMgPSAoODE5MiArIHg0KSA+PiAxNDsKLSAgICAgICAgQUREX0FORF9DTElQMShyZXMpOwotICAgICAgICByZXMyID0gKDgxOTIgKyB4MikgPj4gMTQ7Ci0gICAgICAgIEFERF9BTkRfQ0xJUDIocmVzMik7Ci0gICAgICAgIGRzdF93b3JkID0gKHJlczIgPDwgOCkgfCByZXM7Ci0gICAgICAgIHJlcyA9ICg4MTkyICsgeDEpID4+IDE0OwotICAgICAgICBBRERfQU5EX0NMSVAzKHJlcyk7Ci0gICAgICAgIGRzdF93b3JkIHw9IChyZXMgPDwgMTYpOwotICAgICAgICByZXMgPSAoODE5MiArIHg1KSA+PiAxNDsKLSAgICAgICAgQUREX0FORF9DTElQNChyZXMpOwotICAgICAgICBkc3Rfd29yZCB8PSAocmVzIDw8IDI0KTsKLSAgICAgICAgKigodWludDMyKikocmVjICs9IGx4KSkgPSBkc3Rfd29yZDsgLyogc2F2ZSA0IGJ5dGVzIHRvIGRzdCAqLwotCi0gICAgICAgIHByZWRfd29yZCA9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B4MyA9IGJsa1szXTsKLSAgICAgICAgYmxrWzNdID0gMDsKLSAgICAgICAgYmxrICs9IDg7Ci0KLSAgICAgICAgeDEgPSAoVzMgKiB4MyArIDQpID4+IDM7Ci0gICAgICAgIHgzID0gKC1XNSAqIHgzICsgNCkgPj4gMzsKLQotICAgICAgICB4NyA9ICgtMTgxICogKHgzICsgeDEpICsgMTI4KSA+PiA4OwotICAgICAgICB4NSA9ICgxODEgKiAoeDMgLSB4MSkgKyAxMjgpID4+IDg7Ci0KLSAgICAgICAgcHJlZF93b3JkID0gKigodWludDMyKikocHJlZCArPSAxNikpOyAvKiByZWFkIDQgYnl0ZXMgZnJvbSBwcmVkICovCi0gICAgICAgIHJlcyA9ICg4MTkyICsgeDEpID4+IDE0OwotICAgICAgICBBRERfQU5EX0NMSVAxKHJlcyk7Ci0gICAgICAgIHJlczIgPSAoODE5MiArIHg3KSA+PiAxNDsKLSAgICAgICAgQUREX0FORF9DTElQMihyZXMyKTsKLSAgICAgICAgZHN0X3dvcmQgPSAocmVzMiA8PCA4KSB8IHJlczsKLSAgICAgICAgcmVzID0gKDgxOTIgKyB4NSkgPj4gMTQ7Ci0gICAgICAgIEFERF9BTkRfQ0xJUDMocmVzKTsKLSAgICAgICAgZHN0X3dvcmQgfD0gKHJlcyA8PCAxNik7Ci0gICAgICAgIHJlcyA9ICg4MTkyICsgeDMpID4+IDE0OwotICAgICAgICBBRERfQU5EX0NMSVA0KHJlcyk7Ci0gICAgICAgIGRzdF93b3JkIHw9IChyZXMgPDwgMjQpOwotICAgICAgICAqKCh1aW50MzIqKShyZWMgKz0gbHgpKSA9IGRzdF93b3JkOyAvKiBzYXZlIDQgYnl0ZXMgdG8gZHN0ICovCi0KLSAgICAgICAgcHJlZF93b3JkID0gKigodWludDMyKikocHJlZCArIDQpKTsgLyogcmVhZCA0IGJ5dGVzIGZyb20gcHJlZCAqLwotICAgICAgICByZXMgPSAoODE5MiAtIHgzKSA+PiAxNDsKLSAgICAgICAgQUREX0FORF9DTElQMShyZXMpOwotICAgICAgICByZXMyID0gKDgxOTIgLSB4NSkgPj4gMTQ7Ci0gICAgICAgIEFERF9BTkRfQ0xJUDIocmVzMik7Ci0gICAgICAgIGRzdF93b3JkID0gKHJlczIgPDwgOCkgfCByZXM7Ci0gICAgICAgIHJlcyA9ICg4MTkyIC0geDcpID4+IDE0OwotICAgICAgICBBRERfQU5EX0NMSVAzKHJlcyk7Ci0gICAgICAgIGRzdF93b3JkIHw9IChyZXMgPDwgMTYpOwotICAgICAgICByZXMgPSAoODE5MiAtIHgxKSA+PiAxNDsKLSAgICAgICAgQUREX0FORF9DTElQNChyZXMpOwotICAgICAgICBkc3Rfd29yZCB8PSAocmVzIDw8IDI0KTsKLSAgICAgICAgKigodWludDMyKikocmVjICsgNCkpID0gZHN0X3dvcmQ7IC8qIHNhdmUgNCBieXRlcyB0byBkc3QgKi8KLSAgICB9Ci0gICAgcmV0dXJuIDsKLX0KLQotI2VuZGlmIC8qIFNNQUxMX0RDVCAqLwotCi12b2lkIGlkY3Rfcm93em12KFNob3J0ICpibGssIFVDaGFyICpyZWMsIFVDaGFyICpwcmVkLCBJbnQgbHgpCi17Ci0gICAgaW50MzIgeDAsIHgxLCB4MiwgeDMsIHg0LCB4NSwgeDYsIHg3LCB4ODsKLSAgICBpbnQgaSA9IDg7Ci0gICAgdWludDMyIHByZWRfd29yZCwgZHN0X3dvcmQ7Ci0gICAgaW50IHJlcywgcmVzMjsKLQotICAgIC8qIHByZXNldCB0aGUgb2Zmc2V0LCBzdWNoIHRoYXQgd2UgY2FuIHRha2UgYWR2YW50YWdlIHByZS1vZmZzZXQgYWRkcmVzc2luZyBtb2RlICAgKi8KLSAgICByZWMgLT0gbHg7Ci0gICAgcHJlZCAtPSAxNjsKLSAgICBibGsgLT0gODsKLQotICAgIHdoaWxlIChpLS0pCi0gICAgewotICAgICAgICB4MSA9IChpbnQzMilibGtbMTJdIDw8IDg7Ci0gICAgICAgIGJsa1sxMl0gPSAwOwotICAgICAgICB4MiA9IGJsa1sxNF07Ci0gICAgICAgIGJsa1sxNF0gPSAwOwotICAgICAgICB4MyA9IGJsa1sxMF07Ci0gICAgICAgIGJsa1sxMF0gPSAwOwotICAgICAgICB4NCA9IGJsa1s5XTsKLSAgICAgICAgYmxrWzldID0gMDsKLSAgICAgICAgeDUgPSBibGtbMTVdOwotICAgICAgICBibGtbMTVdID0gMDsKLSAgICAgICAgeDYgPSBibGtbMTNdOwotICAgICAgICBibGtbMTNdID0gMDsKLSAgICAgICAgeDcgPSBibGtbMTFdOwotICAgICAgICBibGtbMTFdID0gMDsKLSAgICAgICAgeDAgPSAoKCooYmxrICs9IDgpKSA8PCA4KSArIDgxOTI7Ci0gICAgICAgICpibGsgPSAwOyAgIC8qIGZvciBwcm9wZXIgcm91bmRpbmcgaW4gdGhlIGZvdXJ0aCBzdGFnZSAqLwotCi0gICAgICAgIC8qIGZpcnN0IHN0YWdlICovCi0gICAgICAgIHg4ID0gVzcgKiAoeDQgKyB4NSkgKyA0OwotICAgICAgICB4NCA9ICh4OCArIChXMSAtIFc3KSAqIHg0KSA+PiAzOwotICAgICAgICB4NSA9ICh4OCAtIChXMSArIFc3KSAqIHg1KSA+PiAzOwotICAgICAgICB4OCA9IFczICogKHg2ICsgeDcpICsgNDsKLSAgICAgICAgeDYgPSAoeDggLSAoVzMgLSBXNSkgKiB4NikgPj4gMzsKLSAgICAgICAgeDcgPSAoeDggLSAoVzMgKyBXNSkgKiB4NykgPj4gMzsKLQotICAgICAgICAvKiBzZWNvbmQgc3RhZ2UgKi8KLSAgICAgICAgeDggPSB4MCArIHgxOwotICAgICAgICB4MCAtPSB4MTsKLSAgICAgICAgeDEgPSBXNiAqICh4MyArIHgyKSArIDQ7Ci0gICAgICAgIHgyID0gKHgxIC0gKFcyICsgVzYpICogeDIpID4+IDM7Ci0gICAgICAgIHgzID0gKHgxICsgKFcyIC0gVzYpICogeDMpID4+IDM7Ci0gICAgICAgIHgxID0geDQgKyB4NjsKLSAgICAgICAgeDQgLT0geDY7Ci0gICAgICAgIHg2ID0geDUgKyB4NzsKLSAgICAgICAgeDUgLT0geDc7Ci0KLSAgICAgICAgLyogdGhpcmQgc3RhZ2UgKi8KLSAgICAgICAgeDcgPSB4OCArIHgzOwotICAgICAgICB4OCAtPSB4MzsKLSAgICAgICAgeDMgPSB4MCArIHgyOwotICAgICAgICB4MCAtPSB4MjsKLSAgICAgICAgeDIgPSAoMTgxICogKHg0ICsgeDUpICsgMTI4KSA+PiA4OwotICAgICAgICB4NCA9ICgxODEgKiAoeDQgLSB4NSkgKyAxMjgpID4+IDg7Ci0KLSAgICAgICAgLyogZm91cnRoIHN0YWdlICovCi0gICAgICAgIHByZWRfd29yZCA9ICooKHVpbnQzMiopKHByZWQgKz0gMTYpKTsgLyogcmVhZCA0IGJ5dGVzIGZyb20gcHJlZCAqLwotCi0gICAgICAgIHJlcyA9ICh4NyArIHgxKSA+PiAxNDsKLSAgICAgICAgQUREX0FORF9DTElQMShyZXMpOwotICAgICAgICByZXMyID0gKHgzICsgeDIpID4+IDE0OwotICAgICAgICBBRERfQU5EX0NMSVAyKHJlczIpOwotICAgICAgICBkc3Rfd29yZCA9IChyZXMyIDw8IDgpIHwgcmVzOwotICAgICAgICByZXMgPSAoeDAgKyB4NCkgPj4gMTQ7Ci0gICAgICAgIEFERF9BTkRfQ0xJUDMocmVzKTsKLSAgICAgICAgZHN0X3dvcmQgfD0gKHJlcyA8PCAxNik7Ci0gICAgICAgIHJlcyA9ICh4OCArIHg2KSA+PiAxNDsKLSAgICAgICAgQUREX0FORF9DTElQNChyZXMpOwotICAgICAgICBkc3Rfd29yZCB8PSAocmVzIDw8IDI0KTsKLSAgICAgICAgKigodWludDMyKikocmVjICs9IGx4KSkgPSBkc3Rfd29yZDsgLyogc2F2ZSA0IGJ5dGVzIHRvIGRzdCAqLwotCi0gICAgICAgIHByZWRfd29yZCA9ICooKHVpbnQzMiopKHByZWQgKyA0KSk7IC8qIHJlYWQgNCBieXRlcyBmcm9tIHByZWQgKi8KLQotICAgICAgICByZXMgPSAoeDggLSB4NikgPj4gMTQ7Ci0gICAgICAgIEFERF9BTkRfQ0xJUDEocmVzKTsKLSAgICAgICAgcmVzMiA9ICh4MCAtIHg0KSA+PiAxNDsKLSAgICAgICAgQUREX0FORF9DTElQMihyZXMyKTsKLSAgICAgICAgZHN0X3dvcmQgPSAocmVzMiA8PCA4KSB8IHJlczsKLSAgICAgICAgcmVzID0gKHgzIC0geDIpID4+IDE0OwotICAgICAgICBBRERfQU5EX0NMSVAzKHJlcyk7Ci0gICAgICAgIGRzdF93b3JkIHw9IChyZXMgPDwgMTYpOwotICAgICAgICByZXMgPSAoeDcgLSB4MSkgPj4gMTQ7Ci0gICAgICAgIEFERF9BTkRfQ0xJUDQocmVzKTsKLSAgICAgICAgZHN0X3dvcmQgfD0gKHJlcyA8PCAyNCk7Ci0gICAgICAgICooKHVpbnQzMiopKHJlYyArIDQpKSA9IGRzdF93b3JkOyAvKiBzYXZlIDQgYnl0ZXMgdG8gZHN0ICovCi0gICAgfQotICAgIHJldHVybjsKLX0KLQotLyotLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tCi07ICBFbmQgRnVuY3Rpb246IGlkY3Rjb2wKLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0qLwotLyogPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09ICovCi0vKiAgRnVuY3Rpb24gOiBCbG9ja0lEQ1RNb3Rpb25Db21wICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgRGF0ZSAgICAgOiAxMC8xNi8yMDAwICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICBQdXJwb3NlICA6IGZhc3QgSURDVCByb3V0aW5lICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICBJbi9vdXQgICA6ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogICAgICBJbnQqIGNvZWZmX2luICAgRGVxdWFudGl6ZWQgY29lZmZpY2llbnQKLSAgICAgICAgSW50IGJsb2NrX291dCAgIG91dHB1dCBJRENUIGNvZWZmaWNpZW50Ci0gICAgICAgIEludCBtYXh2YWwgICAgICBjbGlwIHZhbHVlICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICBNb2RpZmllZCA6ICAgNy8zMS8wMSwgYWRkIGNoZWNraW5nIGZvciBhbGwtemVybyBhbmQgREMtb25seSBibG9jay4gICovCi0vKiAgICAgICAgICAgICAgZG8gOCBjb2x1bW5zIGF0IGEgdGltZSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICAgICAgICAgICAgICAgOC8yLzAxLCBkbyBjb2x1bW4gZmlyc3QgdGhlbiByb3ctSURDVC4gICAgICAgICAgICAgICAgICovCi0vKiAgICAgICAgICAgICAgIDgvMi8wMSwgcmVtb3ZlIGNsaXBwaW5nIChpbmNsdWRlZCBpbiBtb3Rpb24gY29tcCkuICAgICAqLwotLyogICAgICAgICAgICAgICA4LzcvMDEsIGNvbWJpbmUgd2l0aCBtb3Rpb24gY29tcC4gICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICAgICAgICAgICAgICAgOC84LzAxLCB1c2UgQUFOIElEQ1QgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogICAgICAgICAgICAgICA5LzQvMDUsIHVzZSBDaGVuJ3MgSURDVCBhbmQgMTYgYml0IGJsb2NrICAgICAgICAgICAgICAgICAgICovCi0vKiA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0gKi8KLXZvaWQgQmxvY2tJRENUTW90aW9uQ29tcChTaG9ydCAqYmxvY2ssIFVDaGFyICpiaXRtYXBjb2wsIFVDaGFyIGJpdG1hcHJvdywKLSAgICAgICAgICAgICAgICAgICAgICAgICBJbnQgZGN0TW9kZSwgVUNoYXIgKnJlYywgVUNoYXIgKnByZWQsIEludCBseF9pbnRyYSkKLXsKLSAgICBJbnQgaTsKLSAgICBJbnQgdG1wLCB0bXAyOwotICAgIFVMb25nIHRtcDQ7Ci0gICAgSW50IGJtYXA7Ci0gICAgU2hvcnQgKnB0ciA9IGJsb2NrOwotICAgIFVDaGFyICplbmRjb2w7Ci0gICAgVUludCBtYXNrID0gMHhGRjsKLSAgICBJbnQgbHggPSBseF9pbnRyYSA+PiAxOwotICAgIEludCBpbnRyYSA9IChseF9pbnRyYSAmIDEpOwotCi0gICAgLyogIGFsbC16ZXJvIGJsb2NrICovCi0gICAgaWYgKGRjdE1vZGUgPT0gMCB8fCBiaXRtYXByb3cgPT0gMCkKLSAgICB7Ci0gICAgICAgIGlmIChpbnRyYSkKLSAgICAgICAgewotICAgICAgICAgICAgKigoVUxvbmcqKXJlYykgPSAqKChVTG9uZyopKHJlYyArIDQpKSA9IDA7Ci0gICAgICAgICAgICAqKChVTG9uZyopKHJlYyArPSBseCkpID0gMDsKLSAgICAgICAgICAgICooKFVMb25nKikocmVjICsgNCkpID0gMDsKLSAgICAgICAgICAgICooKFVMb25nKikocmVjICs9IGx4KSkgPSAwOwotICAgICAgICAgICAgKigoVUxvbmcqKShyZWMgKyA0KSkgPSAwOwotICAgICAgICAgICAgKigoVUxvbmcqKShyZWMgKz0gbHgpKSA9IDA7Ci0gICAgICAgICAgICAqKChVTG9uZyopKHJlYyArIDQpKSA9IDA7Ci0gICAgICAgICAgICAqKChVTG9uZyopKHJlYyArPSBseCkpID0gMDsKLSAgICAgICAgICAgICooKFVMb25nKikocmVjICsgNCkpID0gMDsKLSAgICAgICAgICAgICooKFVMb25nKikocmVjICs9IGx4KSkgPSAwOwotICAgICAgICAgICAgKigoVUxvbmcqKShyZWMgKyA0KSkgPSAwOwotICAgICAgICAgICAgKigoVUxvbmcqKShyZWMgKz0gbHgpKSA9IDA7Ci0gICAgICAgICAgICAqKChVTG9uZyopKHJlYyArIDQpKSA9IDA7Ci0gICAgICAgICAgICAqKChVTG9uZyopKHJlYyArPSBseCkpID0gMDsKLSAgICAgICAgICAgICooKFVMb25nKikocmVjICsgNCkpID0gMDsKLSAgICAgICAgICAgIHJldHVybiA7Ci0gICAgICAgIH0KLSAgICAgICAgZWxzZSAvKiBjb3B5IGZyb20gcHJldmlvdXMgZnJhbWUgKi8KLSAgICAgICAgewotICAgICAgICAgICAgKigoVUxvbmcqKXJlYykgPSAqKChVTG9uZyopcHJlZCk7Ci0gICAgICAgICAgICAqKChVTG9uZyopKHJlYyArIDQpKSA9ICooKFVMb25nKikocHJlZCArIDQpKTsKLSAgICAgICAgICAgICooKFVMb25nKikocmVjICs9IGx4KSkgPSAqKChVTG9uZyopKHByZWQgKz0gMTYpKTsKLSAgICAgICAgICAgICooKFVMb25nKikocmVjICsgNCkpID0gKigoVUxvbmcqKShwcmVkICsgNCkpOwotICAgICAgICAgICAgKigoVUxvbmcqKShyZWMgKz0gbHgpKSA9ICooKFVMb25nKikocHJlZCArPSAxNikpOwotICAgICAgICAgICAgKigoVUxvbmcqKShyZWMgKyA0KSkgPSAqKChVTG9uZyopKHByZWQgKyA0KSk7Ci0gICAgICAgICAgICAqKChVTG9uZyopKHJlYyArPSBseCkpID0gKigoVUxvbmcqKShwcmVkICs9IDE2KSk7Ci0gICAgICAgICAgICAqKChVTG9uZyopKHJlYyArIDQpKSA9ICooKFVMb25nKikocHJlZCArIDQpKTsKLSAgICAgICAgICAgICooKFVMb25nKikocmVjICs9IGx4KSkgPSAqKChVTG9uZyopKHByZWQgKz0gMTYpKTsKLSAgICAgICAgICAgICooKFVMb25nKikocmVjICsgNCkpID0gKigoVUxvbmcqKShwcmVkICsgNCkpOwotICAgICAgICAgICAgKigoVUxvbmcqKShyZWMgKz0gbHgpKSA9ICooKFVMb25nKikocHJlZCArPSAxNikpOwotICAgICAgICAgICAgKigoVUxvbmcqKShyZWMgKyA0KSkgPSAqKChVTG9uZyopKHByZWQgKyA0KSk7Ci0gICAgICAgICAgICAqKChVTG9uZyopKHJlYyArPSBseCkpID0gKigoVUxvbmcqKShwcmVkICs9IDE2KSk7Ci0gICAgICAgICAgICAqKChVTG9uZyopKHJlYyArIDQpKSA9ICooKFVMb25nKikocHJlZCArIDQpKTsKLSAgICAgICAgICAgICooKFVMb25nKikocmVjICs9IGx4KSkgPSAqKChVTG9uZyopKHByZWQgKz0gMTYpKTsKLSAgICAgICAgICAgICooKFVMb25nKikocmVjICsgNCkpID0gKigoVUxvbmcqKShwcmVkICsgNCkpOwotICAgICAgICAgICAgcmV0dXJuIDsKLSAgICAgICAgfQotICAgIH0KLQotICAgIC8qIFRlc3QgZm9yIERDIG9ubHkgYmxvY2sgKi8KLSAgICBpZiAoZGN0TW9kZSA9PSAxIHx8IChiaXRtYXByb3cgPT0gMHg4MCAmJiBiaXRtYXBjb2xbMF0gPT0gMHg4MCkpCi0gICAgewotICAgICAgICBpID0gKChibG9ja1swXSA8PCAzKSArIDMyKSA+PiA2OwotICAgICAgICBibG9ja1swXSA9IDA7Ci0gICAgICAgIGlmIChpbnRyYSkKLSAgICAgICAgewotICAgICAgICAgICAgaWYgKChVSW50KWkgPiBtYXNrKSBpID0gbWFzayAmICh+KGkgPj4gMzEpKTsKLQotICAgICAgICAgICAgdG1wID0gaSB8IChpIDw8IDgpOwotICAgICAgICAgICAgdG1wIHw9ICh0bXAgPDwgMTYpOwotCi0gICAgICAgICAgICAqKChVTG9uZyopcmVjKSA9ICooKFVMb25nKikocmVjICsgNCkpID0gdG1wOwotICAgICAgICAgICAgKigoVUxvbmcqKShyZWMgKz0gbHgpKSA9IHRtcDsKLSAgICAgICAgICAgICooKFVMb25nKikocmVjICsgNCkpID0gdG1wOwotICAgICAgICAgICAgKigoVUxvbmcqKShyZWMgKz0gbHgpKSA9IHRtcDsKLSAgICAgICAgICAgICooKFVMb25nKikocmVjICsgNCkpID0gdG1wOwotICAgICAgICAgICAgKigoVUxvbmcqKShyZWMgKz0gbHgpKSA9IHRtcDsKLSAgICAgICAgICAgICooKFVMb25nKikocmVjICsgNCkpID0gdG1wOwotICAgICAgICAgICAgKigoVUxvbmcqKShyZWMgKz0gbHgpKSA9IHRtcDsKLSAgICAgICAgICAgICooKFVMb25nKikocmVjICsgNCkpID0gdG1wOwotICAgICAgICAgICAgKigoVUxvbmcqKShyZWMgKz0gbHgpKSA9IHRtcDsKLSAgICAgICAgICAgICooKFVMb25nKikocmVjICsgNCkpID0gdG1wOwotICAgICAgICAgICAgKigoVUxvbmcqKShyZWMgKz0gbHgpKSA9IHRtcDsKLSAgICAgICAgICAgICooKFVMb25nKikocmVjICsgNCkpID0gdG1wOwotICAgICAgICAgICAgKigoVUxvbmcqKShyZWMgKz0gbHgpKSA9IHRtcDsKLSAgICAgICAgICAgICooKFVMb25nKikocmVjICsgNCkpID0gdG1wOwotCi0gICAgICAgICAgICByZXR1cm4gOwotICAgICAgICB9Ci0gICAgICAgIGVsc2UKLSAgICAgICAgewotICAgICAgICAgICAgZW5kY29sID0gcmVjICsgKGx4IDw8IDMpOwotICAgICAgICAgICAgZG8KLSAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICB0bXA0ID0gKigoVUxvbmcqKXByZWQpOwotICAgICAgICAgICAgICAgIHRtcDIgPSB0bXA0ICYgMHhGRjsKLSAgICAgICAgICAgICAgICB0bXAyICs9IGk7Ci0gICAgICAgICAgICAgICAgaWYgKChVSW50KXRtcDIgPiBtYXNrKSB0bXAyID0gbWFzayAmICh+KHRtcDIgPj4gMzEpKTsKLSAgICAgICAgICAgICAgICB0bXAgPSAodG1wNCA+PiA4KSAmIDB4RkY7Ci0gICAgICAgICAgICAgICAgdG1wICs9IGk7Ci0gICAgICAgICAgICAgICAgaWYgKChVSW50KXRtcCA+IG1hc2spIHRtcCA9IG1hc2sgJiAofih0bXAgPj4gMzEpKTsKLSAgICAgICAgICAgICAgICB0bXAyIHw9ICh0bXAgPDwgOCk7Ci0gICAgICAgICAgICAgICAgdG1wID0gKHRtcDQgPj4gMTYpICYgMHhGRjsKLSAgICAgICAgICAgICAgICB0bXAgKz0gaTsKLSAgICAgICAgICAgICAgICBpZiAoKFVJbnQpdG1wID4gbWFzaykgdG1wID0gbWFzayAmICh+KHRtcCA+PiAzMSkpOwotICAgICAgICAgICAgICAgIHRtcDIgfD0gKHRtcCA8PCAxNik7Ci0gICAgICAgICAgICAgICAgdG1wID0gKHRtcDQgPj4gMjQpICYgMHhGRjsKLSAgICAgICAgICAgICAgICB0bXAgKz0gaTsKLSAgICAgICAgICAgICAgICBpZiAoKFVJbnQpdG1wID4gbWFzaykgdG1wID0gbWFzayAmICh+KHRtcCA+PiAzMSkpOwotICAgICAgICAgICAgICAgIHRtcDIgfD0gKHRtcCA8PCAyNCk7Ci0gICAgICAgICAgICAgICAgKigoVUxvbmcqKXJlYykgPSB0bXAyOwotCi0gICAgICAgICAgICAgICAgdG1wNCA9ICooKFVMb25nKikocHJlZCArIDQpKTsKLSAgICAgICAgICAgICAgICB0bXAyID0gdG1wNCAmIDB4RkY7Ci0gICAgICAgICAgICAgICAgdG1wMiArPSBpOwotICAgICAgICAgICAgICAgIGlmICgoVUludCl0bXAyID4gbWFzaykgdG1wMiA9IG1hc2sgJiAofih0bXAyID4+IDMxKSk7Ci0gICAgICAgICAgICAgICAgdG1wID0gKHRtcDQgPj4gOCkgJiAweEZGOwotICAgICAgICAgICAgICAgIHRtcCArPSBpOwotICAgICAgICAgICAgICAgIGlmICgoVUludCl0bXAgPiBtYXNrKSB0bXAgPSBtYXNrICYgKH4odG1wID4+IDMxKSk7Ci0gICAgICAgICAgICAgICAgdG1wMiB8PSAodG1wIDw8IDgpOwotICAgICAgICAgICAgICAgIHRtcCA9ICh0bXA0ID4+IDE2KSAmIDB4RkY7Ci0gICAgICAgICAgICAgICAgdG1wICs9IGk7Ci0gICAgICAgICAgICAgICAgaWYgKChVSW50KXRtcCA+IG1hc2spIHRtcCA9IG1hc2sgJiAofih0bXAgPj4gMzEpKTsKLSAgICAgICAgICAgICAgICB0bXAyIHw9ICh0bXAgPDwgMTYpOwotICAgICAgICAgICAgICAgIHRtcCA9ICh0bXA0ID4+IDI0KSAmIDB4RkY7Ci0gICAgICAgICAgICAgICAgdG1wICs9IGk7Ci0gICAgICAgICAgICAgICAgaWYgKChVSW50KXRtcCA+IG1hc2spIHRtcCA9IG1hc2sgJiAofih0bXAgPj4gMzEpKTsKLSAgICAgICAgICAgICAgICB0bXAyIHw9ICh0bXAgPDwgMjQpOwotICAgICAgICAgICAgICAgICooKFVMb25nKikocmVjICsgNCkpID0gdG1wMjsKLQotICAgICAgICAgICAgICAgIHJlYyArPSBseDsKLSAgICAgICAgICAgICAgICBwcmVkICs9IDE2OwotICAgICAgICAgICAgfQotICAgICAgICAgICAgd2hpbGUgKHJlYyA8IGVuZGNvbCk7Ci0gICAgICAgICAgICByZXR1cm4gOwotICAgICAgICB9Ci0gICAgfQotCi0gICAgZm9yIChpID0gMDsgaSA8IGRjdE1vZGU7IGkrKykKLSAgICB7Ci0gICAgICAgIGJtYXAgPSAoSW50KWJpdG1hcGNvbFtpXTsKLSAgICAgICAgaWYgKGJtYXApCi0gICAgICAgIHsKLSAgICAgICAgICAgIGlmICgoYm1hcCYweGYpID09IDApCi0gICAgICAgICAgICAgICAgKCooaWRjdGNvbFZDQVtibWFwPj40XSkpKHB0cik7Ci0gICAgICAgICAgICBlbHNlCi0gICAgICAgICAgICAgICAgaWRjdF9jb2wocHRyKTsKLSAgICAgICAgfQotICAgICAgICBwdHIrKzsKLSAgICB9Ci0KLSAgICBpZiAoKGJpdG1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gKQotCi0vKiB2YXJpYWJsZSBiaXQgcHJlY2lzaW9uIHF1YW50aXphdGlvbiBzY2FsZSAqLwotLyogdXNlZCB0byBhdm9pZCB1c2luZyAzMi1iaXQgbXVsdGlwbGljYXRpb24gKi8KLWNvbnN0IHN0YXRpYyBTaG9ydCBzY2FsZUFycmF5VlszMl0gPSB7MCwgMTYzODQsIDgxOTIsIDU0NjIsICAvKiAxNSAqLwotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA0MDk2LCAzMjc3LCAyNzMxLCAyMzQxLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA0MDk2LCAzNjQxLCAzMjc3LCAyOTc5LCAgLyogMTYgKi8KLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMjczMSwgMjUyMSwgMjM0MSwgMjE4NSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgNDA5NiwgMzg1NiwgMzY0MSwgMzQ1MCwgIC8qIDE3ICovCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDMyNzcsIDMxMjEsIDI5NzksIDI4NTAsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDU0NjIsIDUyNDMsIDUwNDIsIDQ4NTUsICAvKiAxOCAqLwotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA0NjgyLCA0NTIwLCA0MzcwLCA0MjI5Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfTsKLQotLyogc2NhbGUgZm9yIGRjX3NjYWxlciBhbmQgcW1hdCwgbm90ZSwgbm8gdmFsdWUgc21hbGxlciB0aGFuIDggKi8KLWNvbnN0IHN0YXRpYyBTaG9ydCBzY2FsZUFycmF5VjJbNDddID0gezAsIDAsIDAsIDAsIDAsIDAsIDAsIDAsIC8qIDE1ICovCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA0MDk2LCAz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otCi0vL1RhbyBuZWVkIHRvIHJlbW92ZSwgd3JpdGUgYW5vdGhlciB2ZXJzaW9uIG9mIGFicwotLy8jaW5jbHVkZSA8bWF0aC5oPgotCi0vKiA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0gKi8KLS8qICBGdW5jdGlvbiA6IGNhbF9kY19zY2FsZXJFTkMgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogIERhdGUgICAgIDogMDEvMjUvMjAwMCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgUHVycG9zZSAgOiBjYWxjdWxhdGlvbiBvZiBEQyBxdWFudGl6YXRpb24gc2NhbGUgYWNjb3JkaW5nIHRvIHRoZQotICAgICAgICAgICAgICAgaW5jb21pbmcgUSBhbmQgdHlwZTsgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgSW4vb3V0ICAgOiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICAgICAgSW50IFFwICAgICAgUXVhbnRpemVyICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogIFJldHVybiAgIDogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgICAgICAgICBEQyBTY2FsZXIgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICBNb2RpZmllZCA6ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09ICovCi0vKiA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0gKi8KLUludCBjYWxfZGNfc2NhbGVyRU5DKEludCBRUCwgSW50IHR5cGUpCi17Ci0KLSAgICBJbnQgZGNfc2NhbGVyOwotICAgIGlmICh0eXBlID09IDEpCi0gICAgewotICAgICAgICBpZiAoUVAgPiAwICYmIFFQIDwgNSkKLSAgICAgICAgICAgIGRjX3NjYWxlciA9IDg7Ci0gICAgICAgIGVsc2UgaWYgKFFQID4gNCAmJiBRUCA8IDkpCi0gICAgICAgICAgICBkY19zY2FsZXIgPSAyICogUVA7Ci0gICAgICAgIGVsc2UgaWYgKFFQID4gOCAmJiBRUCA8IDI1KQotICAgICAgICAgICAgZGNfc2NhbGVyID0gUVAgKyA4OwotICAgICAgICBlbHNlCi0gICAgICAgICAgICBkY19zY2FsZXIgPSAyICogUVAgLSAxNjsKLSAgICB9Ci0gICAgZWxzZQotICAgIHsKLSAgICAgICAgaWYgKFFQID4gMCAmJiBRUCA8IDUpCi0gICAgICAgICAgICBkY19zY2FsZXIgPSA4OwotICAgICAgICBlbHNlIGlmIChRUCA+IDQgJiYgUVAgPCAyNSkKLSAgICAgICAgICAgIGRjX3NjYWxlciA9IChRUCArIDEzKSAvIDI7Ci0gICAgICAgIGVsc2UKLSAgICAgICAgICAgIGRjX3NjYWxlciA9IFFQIC0gNjsKLSAgICB9Ci0gICAgcmV0dXJuIGRjX3NjYWxlcjsKLX0KLQotCi0vKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKLSBGdW5jdGlvbjogQmxja1F1YW50RGVxdWFudEgyNjMKLSBEYXRlOiAgICAgSnVuZSAxNSwgMTk5OQotIFB1cnBvc2U6ICBDb21iaW5lIEJsb2NrUXVhbnRIMjYzIGFuZCBCbG9ja0RlcXVhbnRIMjYzRU5DCi0gSW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gICAgZWxzZSBhY19jbGlwID0gMjA0NzsgIC8qIGNsaXAgYmV0d2VlbiBbLTIwNDgsMjA0N10gKi8KLQotICAgIC8qIHJlc2V0IGFsbCBiaXRtYXAgdG8gemVybyAqLwotICAgIHRlbXAgPSAoSW50KikgYml0bWFwY29sOwotICAgIHRlbXBbMF0gPSB0ZW1wWzFdID0gMDsKLSAgICBiaXRtYXB6elswXSA9IGJpdG1hcHp6WzFdID0gMDsKLSAgICAqYml0bWFwcm93ID0gMDsKLSAgICBRUHgycGx1cyA8PD0gNDsKLSAgICBRUHgycGx1cyAtPSA4OwotCi0gICAgcmNvZWZmICs9IDY0OyAvKiBhY3R1YWwgZGF0YSBpcyA2NCBpdGVtIGFoZWFkICovCi0gICAgLy9lbmQgID0gcmNvZWZmICsgZGN0TW9kZSAtIDE7Ci0gICAgLy9yY29lZmYtLTsKLSAgICBiY29scHRyLS07Ci0gICAgaSA9IDA7Ci0KLSAgICBkbwotICAgIHsKLSAgICAgICAgYmNvbHB0cisrOwotICAgICAgICAvL3Jjb2VmZisrOwotICAgICAgICAvL2k9MDsKLSAgICAgICAgY29lZmYgPSByY29lZmZbaV07Ci0gICAgICAgIGlmIChjb2VmZiA9PSAweDdmZmYpIC8qIGFsbCB6ZXJvIGNvbHVtbiAqLwotICAgICAgICB7Ci0gICAgICAgICAgICBpKys7Ci0gICAgICAgICAgICBjb250aW51ZTsKLSAgICAgICAgfQotCi0gICAgICAgIGRvCi0gICAgICAgIHsKLSAgICAgICAgICAgIGlmIChjb2VmZiA+PSAtUVB4MnBsdXMgJiYgY29lZmYgPCBRUHgycGx1cykgIC8qIHF1YW50aXplIHRvIHplcm8gKi8KLSAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICBpICs9IDg7Ci0gICAgICAgICAgICAgICAgaWYgKGkgPCAoZGN0TW9kZSA8PCAzKSkKLSAgICAgICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgICAgIGNvZWZmID0gcmNvZWZmW2ldOwotICAgICAgICAgICAgICAgICAgICBpZiAoY29lZmYgPiAtUVB4MnBsdXMgJiYgY29lZmYgPCBRUHgycGx1cykgIC8qIHF1YW50aXplIHRvIHplcm8gKi8KLSAgICAgICAgICAgICAgICAgICAgewotICAgICAgICAgICAgICAgICAgICAgICAgaSArPSA4OwotICAgICAgICAgICAgICAgICAgICAgICAgY29lZmYgPSByY29lZmZbaV07Ci0gICAgICAgICAgICAgICAgICAgICAgICBjb250aW51ZTsKLSAgICAgICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgICAgICBlbHNlCi0gICAgICAgICAgICAgICAgICAgICAgICBnb3RvIE5PTlpFUk8xOwotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgIH0KLSAgICAgICAgICAgIGVsc2UKLSAgICAgICAgICAgIHsKLU5PTlpFUk8xOgotICAgICAgICAgICAgICAgIC8qIHNjYWxpbmcgKi8KLSAgICAgICAgICAgICAgICBxX3ZhbHVlID0gQUFOU2NhbGVbaV07ICAvKiBsb2FkIHNjYWxlIEFBTiAqLwotICAgICAgICAgICAgICAgIHp6ID0gWlpUYWJbaV07ICAvKiB6aWd6YWcgb3JkZXIgKi8KLQotICAgICAgICAgICAgICAgIGNvZWZmID0gYWFuX3NjYWxlKHFfdmFsdWUsIGNvZWZmLCByb3VuZCwgUVBkaXYyKTsKLSAgICAgICAgICAgICAgICBxX3ZhbHVlID0gY29lZmZfcXVhbnQoY29lZmYsIHFfc2NhbGUsIHNoaWZ0KTsKLQotICAgICAgICAgICAgICAgIC8qIGRlcXVhbnRpemF0aW9uICAqLwotICAgICAgICAgICAgICAgIGlmIChxX3ZhbHVlKQotICAgICAgICAgICAgICAgIHsKLQotICAgICAgICAgICAgICAgICAgICAvL2NvZWZmID0gUFZfTUlOKGFjX2NsaXAsUFZfTUFYKC1hY19jbGlwLTEsIHFfdmFsdWUpKTsKLSAgICAgICAgICAgICAgICAgICAgcV92YWx1ZSA9IGNvZWZmX2NsaXAocV92YWx1ZSwgYWNfY2xpcCk7Ci0gICAgICAgICAgICAgICAgICAgIHFjb2VmZlt6ej4+MV0gPSBxX3ZhbHVlOwotCi0gICAgICAgICAgICAgICAgICAgIC8vIGRlcXVhbnQgYW5kIGNsaXAKLSAgICAgICAgICAgICAgICAgICAgLy9jb2VmZiA9IFBWX01JTigyMDQ3LFBWX01BWCgtMjA0OCwgcV92YWx1ZSkpOwotICAgICAgICAgICAgICAgICAgICB0bXAgPSAyMDQ3OwotICAgICAgICAgICAgICAgICAgICBjb2VmZiA9IGNvZWZmX2RlcXVhbnQocV92YWx1ZSwgUVB4MiwgQWRkaXRpb24sIHRtcCk7Ci0gICAgICAgICAgICAgICAgICAgIHJjb2VmZltpLTY0XSA9IGNvZWZmOwotCi0gICAgICAgICAgICAgICAgICAgICgqYmNvbHB0cikgfD0gaW1hc2tbaT4+M107Ci0gICAgICAgICAgICAgICAgICAgIGlmICgoenogPj4gMSkgPiAzMSkgYml0bWFwenpbMV0gfD0gKDEgPDwgKDYzIC0gKHp6ID4+IDEpKSk7Ci0gICAgICAgICAgICAgICAgICAgIGVsc2UgICAgICAgIGJpdG1hcHp6WzBdIHw9ICgxIDw8ICgzMSAtICh6eiA+PiAxKSkpOwotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICBpICs9IDg7Ci0gICAgICAgICAgICAgICAgY29lZmYgPSByY29lZmZbaV07Ci0gICAgICAgICAgICB9Ci0gICAgICAgIH0KLSAgICAgICAgd2hpbGUgKGkgPCAoZGN0TW9kZSA8PCAzKSk7Ci0KLSAgICAgICAgaSArPSAoMSAtIChkY3RNb2RlIDw8IDMpKTsKLSAgICB9Ci0gICAgd2hpbGUgKGkgPCBkY3RNb2RlKSA7Ci0KLSAgICBpID0gZGN0TW9kZTsKLSAgICB0bXAgPSAxIDw8ICg4IC0gaSk7Ci0gICAgd2hpbGUgKGktLSkKLSAgICB7Ci0gICAgICAgIGlmIChiaXRtYXBjb2xbaV0pKCpiaXRtYXByb3cpIHw9IHRtcDsKLSA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Ci0gICAgICAgICAgICAvL3Jjb2VmZisrOwotICAgICAgICAgICAgLy9pPTA7Ci0gICAgICAgICAgICBpKys7Ci0gICAgICAgIH0KLSAgICAgICAgZWxzZQotICAgICAgICB7Ci0gICAgICAgICAgICBxX3ZhbHVlID0gcm91bmQgKyAoY29lZmYgPDwgMTIpOwotICAgICAgICAgICAgY29lZmYgPSBxX3ZhbHVlID4+IDE2OwotICAgICAgICAgICAgaWYgKGNvZWZmID49IDApIGNvZWZmICs9IChkY19zY2FsZXIgPj4gMSkgOwotICAgICAgICAgICAgZWxzZSAgICAgICAgICAgIGNvZWZmIC09IChkY19zY2FsZXIgPj4gMSkgOwotICAgICAgICAgICAgcV92YWx1ZSA9IHNjYWxlQXJyYXlWMltkY19zY2FsZXJdOwotICAgICAgICAgICAgY29lZmYgPSBjb2VmZiAqIHFfdmFsdWU7Ci0gICAgICAgICAgICBjb2VmZiA+Pj0gKDE1ICsgKGRjX3NjYWxlciA+PiA0KSk7Ci0gICAgICAgICAgICBjb2VmZiArPSAoKFVJbnQpY29lZmYgPj4gMzEpOwotCi0gICAgICAgICAgICBpZiAoc2hvcnRIZWFkZXIpCi0gICAgICAgICAgICAgICAgY29lZmYgPSBQVl9NQVgoMSwgUFZfTUlOKDI1NCwgY29lZmYpKTsKLQotICAgICAgICAgICAgaWYgKGNvZWZmKQotICAgICAgICAgICAgewotICAgICAgICAgICAgICAgIHFjb2VmZlswXSA9IGNvZWZmOwotICAgICAgICAgICAgICAgIGNvZWZmID0gY29lZmYgKiBkY19zY2FsZXI7Ci0gICAgICAgICAgICAgICAgY29lZmYgPSBQVl9NQVgoLTIwNDgsIFBWX01JTigyMDQ3LCBjb2VmZikpOwotICAgICAgICAgICAgICAgIHJjb2VmZlstNjRdID0gY29lZmY7Ci0gICAgICAgICAgICAgICAgYml0bWFwY29sWzBdIHw9IDEyODsKLSAgICAgICAgICAgIH0KLSAgICAgICAgICAgIGkgKz0gODsKLSAgICAgICAgfQotICAgIH0KLSAgICAvKiBBQyB2YWx1ZXMgKi8KLSAgICBkbwotICAgIHsKLSAgICAgICAgY29lZmYgPSByY29lZmZbaV07Ci0gICAgICAgIGlmIChjb2VmZiA9PSAweDdmZmYpIC8qIGFsbCB6ZXJvIHJvdyAqLwotICAgICAgICB7Ci0gICAgICAgICAgICBibWNvbHB0cisrOwotICAgICAgICAgICAgaSsrOwotICAgICAgICAgICAgY29udGludWU7Ci0gICAgICAgIH0KLSAgICAgICAgZG8KLSAgICAgICAgewotICAgICAgICAgICAgaWYgKGNvZWZmID49IC1RUHgycGx1cyAmJiBjb2VmZiA8IFFQeDJwbHVzKSAgLyogcXVhbnRpemUgdG8gemVybyAqLwotICAgICAgICAgICAgewotICAgICAgICAgICAgICAgIGkgKz0gODsKLSAgICAgICAgICAgICAgICBpZiAoaSA8IGRjdE1vZGUgPDwgMykKLSAgICAgICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgICAgIGNvZWZmID0gcmNvZWZmW2ldOwotICAgICAgICAgICAgICAgICAgICBpZiAoY29lZmYgPiAtUVB4MnBsdXMgJiYgY29lZmYgPCBRUHgycGx1cykgIC8qIHF1YW50aXplIHRvIHplcm8gKi8KLSAgICAgICAgICAgICAgICAgICAgewotICAgICAgICAgICAgICAgICAgICAgICAgaSArPSA4OwotICAgICAgICAgICAgICAgICAgICAgICAgY29lZmYgPSByY29lZmZbaV07Ci0gICAgICAgICAgICAgICAgICAgICAgICBjb250aW51ZTsKLSAgICAgICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgICAgICBlbHNlCi0gICAgICAgICAgICAgICAgICAgICAgICBnb3RvIE5PTlpFUk8yOwotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgIH0KLSAgICAgICAgICAgIGVsc2UKLSAgICAgICAgICAgIHsKLU5PTlpFUk8yOiAgIC8qIHNjYWxpbmcgKi8KLSAgICAgICAgICAgICAgICBxX3ZhbHVlID0gQUFOU2NhbGVbaV07IC8qICAwOS8wMi8wNSAqLwotCi0gICAgICAgICAgICAgICAgLyogc2NhbGUgYWFuICovCi0gICAgICAgICAgICAgICAgcV92YWx1ZSA9IHNtbGFiYihxX3ZhbHVlLCBjb2VmZiwgcm91bmQpOwotICAgICAgICAgICAgICAgIGNvZWZmID0gcV92YWx1ZSA+PiAxNjsKLSAgICAgICAgICAgICAgICAvKiBxdWFudCAqLwotICAgICAgICAgICAgICAgIHFfdmFsdWUgPSBzbXVsYmIocV9zY2FsZSwgY29lZmYpOyAvKm1vdiAgICAgcV92YWx1ZSwgY29lZmYsIGxzbCAjMTQgKi8KLSAgICAgICAgICAgICAgICAvKnNtdWxsIHRtcCwgY29lZmYsIHFfdmFsdWUsIHFfc2NhbGUqLwotICAgICAgICAgICAgICAgIHFfdmFsdWUgPj49IHNoaWZ0OwotICAgICAgICAgICAgICAgIHFfdmFsdWUgKz0gKChVSW50KXFfdmFsdWUgPj4gMzEpOyAvKiBhZGQgMSBpZiBuZWdhdGl2ZSAqLwotCi0gICAgICAgICAgICAgICAgaWYgKHFfdmFsdWUpCi0gICAgICAgICAgICAgICAgewotICAgICAgICAgICAgICAgICAgICAvL2NvZWZmID0gUFZfTUlOKGFjX2NsaXAsUFZfTUFYKC1hY19jbGlwLTEsIHFfdmFsdWUpKTsKLSAgICAgICAgICAgICAgICAgICAgcV92YWx1ZSA9IGNvZWZmX2NsaXAocV92YWx1ZSwgYWNfY2xpcCk7Ci0gICAgICAgICAgICAgICAgICAgIHFjb2VmZltpXSA9IHFfdmFsdWU7Ci0KLSAgICAgICAgICAgICAgICAgICAgLy8gZGVxdWFudCBhbmQgY2xpcAotICAgICAgICAgICAgICAgICAgICAvL2NvZWZmID0gUFZfTUlOKDIwNDcsUFZfTUFYKC0yMDQ4LCBxX3ZhbHVlKSk7Ci0gICAgICAgICAgICAgICAgICAgIHRtcCA9IDIwNDc7Ci0gICAgICAgICAgICAgICAgICAgIGNvZWZmID0gY29lZmZfZGVxdWFudChxX3ZhbHVlLCBRUHgyLCBBZGRpdGlvbiwgdG1wKTsKLSAgICAgICAgICAgICAgICAgICAgcmNvZWZmW2ktNjRdID0gY29lZmY7Ci0KLSAgICAgICAgICAgICAgICAgICAgKCpibWNvbHB0cikgfD0gaW1hc2tbaT4+M107Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgIGkgKz0gODsKLSAgICAgICAgICAgICAgICBjb2VmZiA9IHJjb2VmZltpXTsKLSAgICAgICAgICAgIH0KLSAgICAgICAgfQotICAgICAgICB3aGlsZSAoaSA8IChkY3RNb2RlIDw8IDMpKSA7Ci0KLSAgICAgICAgLy9xY29lZmYrKzsgLyogbmV4dCBjb2x1bW4gKi8KLSAgICAgICAgYm1jb2xwdHIrKzsKLSAgICAgICAgLy9yY29lZmYrKzsKLSAgICAgICAgaSArPSAoMSAtIChkY3RNb2RlIDw8IDMpKTsgLy9pID0gMDsKLSAgICB9Ci0gICAgd2hpbGUgKGkgPCBkY3RNb2RlKTsvL3doaWxlKHJjb2VmZiA8IGVuZCkgOwotCi0gICAgaSA9IGRjdE1vZGU7Ci0gICAgdG1wID0gMSA8PCAoOCAtIGkpOwotICAgIHdoaWxlIChpLS0pCi0gICAgewotICAgICAgICBpZiAoYml0bWFwY29sW2ldKSgqYml0bWFwcm93KSB8PSB0bXA7Ci0gICAgICAgIHRtcCA8PD0gMTsKLSAgICB9Ci0KLSAgICBpZiAoKCgqYml0bWFwcm93KSYxMjcpIHx8IChiaXRtYXBjb2xbMF0mMTI3KSkgLyogZXhjbHVkZSBEQyAqLwotICAgICAgICByZXR1cm4gMTsKLSAgICBlbHNlCi0gICAgICAgIHJldHVybiAwOwotfQotCi0KLS8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgotIEZ1bmN0aW9uOiBCbGNrUXVhbnREZXF1YW50SDI2M0RDCi0gRGF0ZTogICAgIDUvMy8yMDAxCi0gUHVycG9zZTogICBILjI2MyBxdWFudGl6YXRpb24gbW9kZ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ICAgfQotCi0gICAgcmV0dXJuIDA7Ci19Ci0KLSNpZm5kZWYgTk9fTVBFR19RVUFOVAotLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCi0gRnVuY3Rpb246IEJsY2tRdWFudERlcXVhbnRNUEVHCi0gRGF0ZTogICAgIEp1bmUgMTUsIDE5OTkKLSBQdXJwb3NlOiAgQ29tYmluZSBCbG9ja1F1YW50TVBFRyBhbmQgQmxvY2tEZXF1YW50TVBFR0VOQwotIElucHV0OiAgIGNvZWZmPT4gRENUIGNvZWZmaWNpZW50Ci0gT3V0cHV0OiAgcWNvZWZmPT4gcXVhbnRpemVkIGNvZWZmaWNpZW50Ci0gICAgICAgICAgcmNvZWZmPT4gcmVjb25zdHJ1Y3RlZCBjb2VmZmljaWVudAotIE1vZGlmaWVkOiAgNy81LzAxLCBicmVhayB1cCBmdW5jdGlvbiBmb3IgSW50cmEvSW50ZXIKLSAgICAgICAgICA4LzMvMDEsICB1cGRhdGUgd2l0aCBjaGFuZ2VzIGZyb20gSDI2MyBxdWFudCBtb2RlLgotICAgICAgICAgIDgvMy8wMSwgIGFkZCBjbGlwcGluZyB0byB0aGUgcmVjb25zdHJ1Y3RlZCBjb2VmZmljaWVudCBbLTIwNDgsMjA0N10KLSAgICAgICAgICA4LzYvMDEsICBvcHRpbWl6ZSB1c2luZyBtdWx0aXBsaWNhdGl2ZSBsb29rdXAtdGFibGUuCi0gICAgICAgICAgICAgICAgICAgICBjYW4gYmUgZnVydGhlciBvcHRpbWl6ZWQgdXNpbmcgQVJNIGFzc2VtYmx5LCBlLmcuLAotICAgICAgICAgICAgICAgICAgICAgY2xpcHBpbmcsIDE2LWJpdCBtdWx0LiwgZXRjICEhISEhISEhISEhISEKLSAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLQotSW50IEJsb2NrUXVhbnREZXF1YW50TVBFR0ludGVyKFNob3J0ICpyY29lZmYsIFNob3J0ICpxY29lZmYsIEludCBRUCwgSW50ICpxbWF0LAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFVDaGFyIGJpdG1hcGNvbFsgXSwgVUNoYXIgKmJpdG1hcHJvdywgVUludCAqYml0bWFwenosCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgSW50IGRjdE1vZGUsIEludCBjb21wLCBJbnQgZGNfc2NhbGVyKQotewotICAgIEludCBpLCB6ejsKLSAgICBJbnQgdG1wLCBjb2VmZiwgcV92YWx1ZSA9IDA7Ci0gICAgSW50IHN1bSA9IDA7Ci0gICAgSW50IHN0ZXBzaXplLCBRUHgyID0gUVAgPDwgMTsKLSAgICBJbnQgQ0JQID0gMDsKLSAgICBJbnQgcm91bmQgPSAxIDw8IDE1OwotICAgIEludCBxX3NjYWxlID0gc2NhbGVBcnJheVZbUVBdOwotICAgIEludCBzaGlmdCA9IDE1ICsgKFFQID4+IDMpOwotICAgIFVDaGFyICpiY29scHRyID0gYml0bWFwY29sOwotCi0gICAgT1NDTF9VTlVTRURfQVJHKGRjX3NjYWxlcik7Ci0gICAgT1NDTF9VTlVTRURfQVJHKGNvbXApOwotCi0KLSAgICAqKChJbnQqKWJpdG1hcGNvbCkgPSAqKChJbnQqKShiaXRtYXBjb2wgKyA0KSkgPSAwOwotICAgIGJpdG1hcHp6WzBdID0gYml0bWFwenpbMV0gPSAwOwotICAgICpiaXRtYXByb3cgPSAwOwotCi0gICAgcmNvZWZmICs9IDY0OwotICAgIGkgPSAwOwotICAgIGJjb2xwdHItLTsKLQotICAgIGRvCi0gICAgewotICAgICAgICBiY29scHRyKys7Ci0gICAgICAgIGNvZWZmID0gcmNvZWZmW2ldOwotICAgICAgICBpZiAoY29lZmYgPT0gMHg3ZmZmKSAvKiBhbGwgemVybyBjb2x1bW4gKi8KLSAgICAgICAgewotICAgICAgICAgICAgaSsrOwotICAgICAgICAgICAgY29udGludWU7Ci0gICAgICAgIH0KLSAgICAgICAgZG8KLSAgICAgICAgewotICAgICAgICAgICAgcV92YWx1ZSA9IEFBTlNjYWxlW2ldOyAgLyogIDA5LzAyLzA1IHNjYWxpbmcgZm9yIEFBTiovCi0gICAgICAgICAgICAvKiBhYW4gc2NhbGluZyAqLwotICAgICAgICAgICAgcV92YWx1ZSA9IHNtbGFiYihxX3ZhbHVlLCBjb2VmZiwgcm91bmQpOwotCi0gICAgICAgICAgICBjb2VmZiA9IHFfdmFsdWUgPj4gMTY7Ci0KLSAgICAgICAgICAgIHN0ZXBzaXplID0gcW1hdFtpXTsKLS8vICAgICAgICAgIGlmKGNvZWZmPjApICAgICBjb2VmZiA9ICgxNipjb2VmZiArIChzdGVwc2l6ZS8yKSkgLyBzdGVwc2l6ZTsKLS8vICAgICAgICAgIGVsc2UgICAgICAgICAgICBjb2VmZiA9ICgxNipjb2VmZiAtIChzdGVwc2l6ZS8yKSkgLyBzdGVwc2l6ZTsKLSAgICAgICAgICAgIGNvZWZmIDw8PSA0OwotICAgICAgICAgICAgaWYgKGNvZWZmID49IDApIGNvZWZmICs9IChzdGVwc2l6ZSA+PiAxKSA7Ci0gICAgICAgICAgICBlbHNlICAgICAgICAgICAgY29lZmYgLT0gKHN0ZXBzaXplID4+IDEpIDsKLSAgICAgICAgICAgIHFfdmFsdWUgPSBzY2FsZUFycmF5VjJbc3RlcHNpemVdOwotICAgICAgICAgICAgLyogbXBlZyBxdWFudCB0YWJsZSBzY2FsZSAqLwotICAgICAgICAgICAgY29lZmYgPSBzbXVsYmIoY29lZmYsIHFfdmFsdWUpOwotCi0gICAgICAgICAgICBjb2VmZiA+Pj0gKDE1ICsgKHN0ZXBzaXplID4+IDQpKTsKLSAgICAgICAgICAgIGNvZWZmICs9ICgoVUludCljb2VmZiA+PiAzMSk7Ci0KLSAgICAgICAgICAgIC8qIFFQIHNjYWxlICovCi0gICAgICAgICAgICBpZiAoY29lZmYgPj0gLVFQeDIgJiYgY29lZmYgPCBRUHgyKSAgLyogcXVhbnRpemVkIHRvIHplcm8qLwotICAgICAgICAgICAgewotICAgICAgICAgICAgICAgIGkgKz0gODsKLSAgICAgICAgICAgIH0KLSAgICAgICAgICAgIGVsc2UKLSAgICAgICAgICAgIHsKLS8vICAgICAgICAgICAgICBxX3ZhbHVlID0gY29lZmYvKFFQeDIpOwotICAgICAgICAgICAgICAgIHFfdmFsdWUgPSBjb2VmZl9xdWFudChjb2VmZiwgcV9zY2FsZSwgc2hpZnQpOwotCi0gICAgICAgICAgICAgICAgaWYgKHFfdmFsdWUpICAgICAgICAgICAgICAgIC8qIGRlcXVhbnQgKi8KLSAgICAgICAgICAgICAgICB7Ci0KLSAgICAgICAgICAgICAgICAgICAgenogPSBaWlRhYltpXTsgIC8qIHppZ3phZyBvcmRlciAqLwotCi0gICAgICAgICAgICAgICAgICAgIHRtcCA9IDIwNDc7Ci0KLSAgICAgICAgICAgICAgICAgICAgcV92YWx1ZSA9IGNsaXBfMjA0NyhxX3ZhbHVlLCB0bXApOwotCi0gICAgICAgICAgICAgICAgICAgIHFjb2VmZlt6ej4+MV0gPSBxX3ZhbHVlOwotCi0gICAgICAgICAgICAgICAgICAgIC8vcV92YWx1ZT0oKChjb2VmZioyKStTSUdOMChjb2VmZikpKnN0ZXBzaXplKlFQKS8xNjsKLSAgICAgICAgICAgICAgICAgICAgLyogbm8gbmVlZCBmb3IgU0lHTjAsIG5vIHplcm8gY29taW5nIGluIHRoaXMge30gKi8KLSAgICAgICAgICAgICAgICAgICAgcV92YWx1ZSA9IGNvZWZmX2RlcXVhbnRfbXBlZyhxX3ZhbHVlLCBzdGVwc2l6ZSwgUVAsIHRtcCk7Ci0KLSAgICAgICAgICAgICAgICAgICAgcmNvZWZmW2ktNjRdID0gcV92YWx1ZTsKLQotICAgICAgICAgICAgICAgICAgICBzdW0gKz0gcV92YWx1ZTsKLSAgICAgICAgICAgICAgICAgICAgKCpiY29scHRyKSB8PSBpbWFza1tpPj4zXTsKLSAgICAgICAgICAgICAgICAgICAgaWYgKCh6eiA+PiAxKSA+IDMxKSBiaXRtYXB6elsxXSB8PSAoMSA8PCAoNjMgLSAoenogPj4gMSkpKTsKLSAgICAgICAgICAgICAgICAgICAgZWxzZSAgICAgICAgYml0bWFwenpbMF0gfD0gKDEgPDwgKDMxIC0gKHp6ID4+IDEpKSk7Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgIGkgKz0gODsKLSAgICAgICAgICAgIH0KLSAgICAgICAgICAgIGNvZWZmID0gcmNvZWZmW2ldOwotICAgICAgICB9Ci0gICAgICAgIHdoaWxlIChpIDwgKGRjdE1vZGUgPDwgMykpIDsKLQotICAgICAgICBpICs9ICgxIC0gKGRjdE1vZGUgPDwgMykpOwotICAgIH0KLSAgICB3aGlsZSAoaSA8IGRjdE1vZGUpIDsKLQotICAgIGkgPSBkY3RNb2RlOwotICAgIHRtcCA9IDEgPDwgKDggLSBpKTsKLSAgICB3aGlsZSAoaS0tKQotICAgIHsKLSAgICAgICAgaWYgKGJpdG1hcGNvbFtpXSkoKmJpdG1hcHJvdykgfD0gdG1wOwotICAgICAgICB0bXAgPDw9IDE7Ci0gICAgfQotCi0gICAgaWYgKCpiaXRtYXByb3cpCi0gICAgICAgIENCUCA9IDE7ICAgLyogY2hlY2sgQ0JQIGJlZm9yZSBtaXNtYXRjaCBjb250cm9sLCAgNy81LzAxICovCi0KLSAgICAvKiBNaXNtYXRjaCBjb250cm9sLCAgNS8zLzAxICovCi0gICAgaWYgKENCUCkKLSAgICB7Ci0gICAgICAgIGlmICgoc3VtJjB4MSkgPT0gMCkKLSAgICAgICAgewotICAgICAgICAgICAgcmNvZWZmLS07ICAvKiByY29lZmZbNjNdICovCi0gICAgICAgICAgICBjb2VmZiA9ICpyY29lZmY7Ci0gICAgICAgICAgICBjb2VmZiBePSAweDE7Ci0gICAgICAgICAgICAqcmNvZWZmID0gY29lZmY7Ci0gICAgICAgICAgICBpZiAoY29lZmYpCi0gICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgYml0bWFwY29sWzddIHw9IDE7Ci0gICAgICAgICAgICAgICAgKCpiaXRtYXByb3cpIHw9IDE7Ci0gICAgICAgICAgICB9Ci0gICAgICAgIH0KLSAgICB9Ci0KLSAgICByZXR1cm4gQ0JQOwotfQotCi1JbnQgQmxvY2tRdWFudERlcXVhbnRNUEVHSW50cmEoU2hvcnQgKnJjb2VmZiwgU2hvcnQgKnFjb2VmZiwgSW50IFFQLCBJbnQgKnFtYXQsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgVUNoYXIgYml0bWFwY29sWyBdLCBVQ2hhciAqYml0bWFwcm93LCBVSW50ICpiaXRtYXB6eiwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBJbnQgZGN0TW9kZSwgSW50IGNvbXAsIEludCBkY19zY2FsZXIpCi17Ci0gICAgSW50IGk7Ci0gICAgSW50IHRtcCwgY29lZmYsIHFfdmFsdWUgPSAwOwotICAgIEludCBzdW0gPSAwOwotICAgIEludCBzdGVwc2l6ZTsKLSAgICBJbnQgQ0JQID0gMDsKLSAgICBJbnQgcm91bmQgPSAxIDw8IDE1OwotICAgIEludCBxX3NjYWxlID0gc2NhbGVBcnJheVZbUVBdOwotICAgIEludCBzaGlmdCA9IDE1ICsgKFFQID4+IDMpOwotICAgIEludCByb3VuZDIgPSAoMyAqIFFQICsgMikgPj4gMjsKLSAgICBJbnQgUVB4MnBsdXMgPSAoUVAgPDwgMSkgLSByb3VuZDI7Ci0gICAgVUNoYXIgKmJtY29scHRyID0gYml0bWFwY29sOwotCi0gICAgT1NDTF9VTlVTRURfQVJHKGJpdG1hcHp6KTsKLSAgICBPU0NMX1VOVVNFRF9BUkcoY29tcCk7Ci0KLSAgICAqKChJbnQqKWJpdG1hcGNvbCkgPSAqKChJbnQqKShiaXRtYXBjb2wgKyA0KSkgPSAwOwotICAgICpiaXRtYXByb3cgPSAwOwotCi0gICAgcmNvZWZmICs9IDY0OwotICAgIGkgPSAwOwotCi0gICAgLyogREMgdmFsdWUgKi8KLSAgICBjb2VmZiA9ICpyY29lZmY7Ci0KLSAgICBpZiAoY29lZmYgPT0gMHg3ZmZmKSAvKiBhbGwgemVybyBjb2x1bW4gKi8KLSAgICB7Ci0gICAgICAgIGJtY29scHRyKys7Ci0gICAgICAgIGkrKzsKLSAgICB9Ci0gICAgZWxzZQotICAgIHsKLSAgICAgICAgcV92YWx1ZSA9IHJvdW5kICsgKGNvZWZmIDw8IDEyKTsKLSAgICAgICAgY29lZmYgPSBxX3ZhbHVlID4+IDE2OwotICAgICAgICAvKmlmIChjb2VmZiA+PSAwKSAgIGNvZWZmID0gKGNvZWZmICsgKGRjX3NjYWxlci8yKSkgLyBkY19zY2FsZXI7Ci0gICAgICAgIGVsc2UgICAgICAgICAgICBjb2VmZiA9IChjb2VmZiAtIChkY19zY2FsZXIvMikpIC8gZGNfc2NhbGVyOyovCi0gICAgICAgIGlmIChjb2VmZiA+PSAwKSBjb2VmZiArPSAoZGNfc2NhbGVyID4+IDEpIDsKLSAgICAgICAgZWxzZSAgICAgICAgICAgIGNvZWZmIC09IChkY19zY2FsZXIgPj4gMSkgOwotICAgICAgICBxX3ZhbHVlID0gc2NhbGVBcnJheVYyW2RjX3NjYWxlcl07Ci0KLSAgICAgICAgLyogbXBlZyBxdWFudCB0YWJsZSBzY2FsZSAqLwotICAgICAgICBjb2VmZiA9IHNtdWxiYihjb2VmZiwgcV92YWx1ZSk7Ci0KLSAgICAgICAgY29lZmYgPj49ICgxNSArIChkY19zY2FsZXIgPj4gNCkpOwotICAgICAgICBjb2VmZiArPSAoKFVJbnQpY29lZmYgPj4gMzEpOwotCi0gICAgICAgIGlmIChjb2VmZikKLSAgICAgICAgewotICAgICAgICAgICAgY29lZmYgPSBQVl9NQVgoMSwgUFZfTUlOKDI1NCwgY29lZmYpKTsKLSAgICAgICAgICAgIHFjb2VmZlswXSA9IGNvZWZmOwotCi0gICAgICAgICAgICBjb2VmZiA9IHNtdWxiYihjb2VmZiwgZGNfc2NhbGVyKTsKLQotICAgICAgICAgICAgcV92YWx1ZSA9IGNsaXBfMjA0Nyhjb2VmZiwgMjA0Nyk7Ci0KLSAgICAgICAgICAgIHN1bSA9IHFfdmFsdWU7Ci0KLSAgICAgICAgICAgIHJjb2VmZlstNjRdID0gcV92YWx1ZTsKLQotICAgICAgICAgICAgYml0bWFwY29sWzBdIHw9IDEyODsKLSAgICAgICAgfQotICAgICAgICBpICs9IDg7Ci0gICAgfQotICAgIC8qIEFDIHZhbHVlcyAqLwotICAgIGRvCi0gICAgewotICAgICAgICBjb2VmZiA9IHJjb2VmZltpXTsKLSAgICAgICAgaWYgKGNvZWZmID09IDB4N2ZmZikgLyogYWxsIHplcm8gcm93ICovCi0gICAgICAgIHsKLSAgICAgICAgICAgIGJtY29scHRyKys7Ci0gICAgICAgICAgICBpKys7Ci0gICAgICAgICAgICBjb250aW51ZTsKLSAgICAgICAgfQotICAgICAgICBkbwotICAgICAgICB7Ci0gICAgICAgICAgICAvKiBzY2FsaW5nICovCi0gICAgICAgICAgICBxX3ZhbHVlID0gQUFOU2NhbGVbaV07IC8qICAwOS8wMi8wNSAqLwotCi0gICAgICAgICAgICAvKiBxX3ZhbHVlID0gY29lZmYqcV92YWx1ZSArIHJvdW5kICovCi0gICAgICAgICAgICBxX3ZhbHVlID0gc21sYWJiKGNvZWZmLCBxX3ZhbHVlLCByb3VuZCk7Ci0gICAgICAgICAgICBjb2VmZiA9IHFfdmFsdWUgPj4gMTY7Ci0KLSAgICAgICAgICAgIHN0ZXBzaXplID0gcW1hdFtpXTsKLSAgICAgICAgICAgIC8qaWYoY29lZmY+MCkgICAgICAgY29lZmYgPSAoMTYqY29lZmYgKyAoc3RlcHNpemUvMikpIC8gc3RlcHNpemU7Ci0gICAgICAgICAgICBlbHNlICAgICAgICAgICAgY29lZmYgPSAoMTYqY29lZmYgLSAoc3RlcHNpemUvMikpIC8gc3RlcHNpemU7Ki8KLSAgICAgICAgICAgIGNvZWZmIDw8PSA0OwotICAgICAgICAgICAgaWYgKGNvZWZmID49IDApIGNvZWZmICs9IChzdGVwc2l6ZSA+PiAxKSA7Ci0gICAgICAgICAgICBlbHNlICAgICAgICAgICAgY29lZmYgLT0gKHN0ZXBzaXplID4+IDEpIDsKLSAgICAgICAgICAgIHFfdmFsdWUgPSBzY2FsZUFycmF5VjJbc3RlcHNpemVdOwotCi0gICAgICAgICAgICAvKiBzY2FsZSBtcGVnIHF1YW50ICovCi0gICAgICAgICAgICBjb2VmZiA9IHNtdWxiYihjb2VmZiwgcV92YWx1ZSk7Ci0KLSAgICAgICAgICAgIGNvZWZmID4+PSAoMTUgKyAoc3RlcHNpemUgPj4gNCkpOwotICAgICAgICAgICAgY29lZmYgKz0gKChVSW50KWNvZWZmID4+IDMxKTsKLQotICAgICAgICAgICAgaWYgKGNvZWZmID49IC1RUHgycGx1cyAmJiBjb2VmZiA8IFFQeDJwbHVzKQotICAgICAgICAgICAgewotICAgICAgICAgICAgICAgIGkgKz0gODsKLSAgICAgICAgICAgIH0KLSAgICAgICAgICAgIGVsc2UKLSAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAvL3FfdmFsdWUgPSAoIGNvZWZmICsgU0lHTjAoY29lZmYpKigoMypRUCsyKS80KSkvKDIqUVApOwotICAgICAgICAgICAgICAgIGlmIChjb2VmZiA+IDApIGNvZWZmICs9IHJvdW5kMjsKLSAgICAgICAgICAgICAgICBlbHNlIGlmIChjb2VmZiA8IDApIGNvZWZmIC09IHJvdW5kMjsKLQotICAgICAgICAgICAgICAgIHFfdmFsdWUgPSBzbXVsYmIoY29lZmYsIHFfc2NhbGUpOwotICAgICAgICAgICAgICAgIHFfdmFsdWUgPj49IHNoaWZ0OwotICAgICAgICAgICAgICAgIHFfdmFsdWUgKz0gKChVSW50KXFfdmFsdWUgPj4gMzEpOwotCi0gICAgICAgICAgICAgICAgaWYgKHFfdmFsdWUpCi0gICAgICAgICAgICAgICAgewotICAgICAgICAgICAgICAgICAgICB0bXAgPSAyMDQ3OwotICAgICAgICAgICAgICAgICAgICBxX3ZhbHVlID0gY2xpcF8yMDQ3KHFfdmFsdWUsIHRtcCk7Ci0KLSAgICAgICAgICAgICAgICAgICAgcWNvZWZmW2ldID0gcV92YWx1ZTsKLQotICAgICAgICAgICAgICAgICAgICBzdGVwc2l6ZSA9IHNtdWxiYihzdGVwc2l6ZSwgUVApOwotICAgICAgICAgICAgICAgICAgICBxX3ZhbHVlID0gIHNtdWxiYihxX3ZhbHVlLCBzdGVwc2l6ZSk7Ci0KLSAgICAgICAgICAgICAgICAgICAgcV92YWx1ZSA9IGNvZWZmX2RlcXVhbnRfbXBlZ19pbnRyYShxX3ZhbHVlLCB0bXApOwotICAgICAgICAgICAgICAgICAgICAvL3FfdmFsdWUgPSAoY29lZmYqc3RlcHNpemUqUVAqMikvMTY7Ci0KLSAgICAgICAgICAgICAgICAgICAgcmNvZWZmW2ktNjRdID0gcV92YWx1ZTsKLQotICAgICAgICAgICAgICAgICAgICBzdW0gKz0gcV92YWx1ZTsKLSAgICAgICAgICAgICAgICAgICAgKCpibWNvbHB0cikgfD0gaW1hc2tbaT4+M107Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgIGkgKz0gODsKLSAgICAgICAgICAgIH0KLSAgICAgICAgICAgIGNvZWZmID0gcmNvZWZmW2ldOwotICAgICAgICB9Ci0gICAgICAgIHdoaWxlIChpIDwgKGRjdE1vZGUgPDwgMykpIDsKLQotICAgICAgICBibWNvbHB0cisrOwotICAgICAgICBpICs9ICgxIC0gKGRjdE1vZGUgPDwgMykpOwotICAgIH0KLSAgICB3aGlsZSAoaSA8IGRjdE1vZGUpIDsKLQotICAgIGkgPSBkY3RNb2RlOwotICAgIHRtcCA9IDEgPDwgKDggLSBpKTsKLSAgICB3aGlsZSAoaS0tKQotICAgIHsKLSAgICAgICAgaWYgKGJpdG1hcGNvbFtpXSkoKmJpdG1hcHJvdykgfD0gdG1wOwotICAgICAgICB0bXAgPDw9IDE7Ci0gICAgfQotCi0gICAgaWYgKCgoKmJpdG1hcHJvdykgJjEyNykgfHwgKGJpdG1hcGNvbFswXSYxMjcpKQotICAgICAgICBDQlAgPSAxOyAgLyogY2hlY2sgQ0JQIGJlZm9yZSBtaXNtYXRjaCBjb250cm9sLCAgNy81LzAxICovCi0KLSAgICAvKiBNaXNtYXRjaCBjb250cm9sLCAgNS8zLzAxICovCi0gICAgaWYgKENCUCB8fCBiaXRtYXBjb2xbMF0pCi0gICAgewotICAgICAgICBpZiAoKHN1bSYweDEpID09IDApCi0gICAgICAgIHsKLSAgICAgICAgICAgIHJjb2VmZi0tOyAgLyogcmNvZWZmWzYzXSAqLwotICAgICAgICAgICAgY29lZmYgPSAqcmNvZWZmOwotICAgICAgICAgICAgY29lZmYgXj0gMHgxOwotICAgICAgICAgICAgKnJjb2VmZiA9IGNvZWZmOwotICAgICAgICAgICAgaWYgKGNvZWZmKQotICAgICAgICAgICAgewotICAgICAgICAgICAgICAgIGJpdG1hcGNvbFs3XSB8PSAxOwotICAgICAgICAgICAgICAgICgqYml0bWFwcm93KSB8PSAxOwotICAgICAgICAgICAgfQotICAgICAgICB9Ci0gICAgfQotCi0gICAgcmV0dXJuIENCUDsKLX0KLQotCi0vKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKLSBGdW5jdGlvbjogQmxja1F1YW50RGVxdWFudE1QRUdEQwotIERhdGU6ICAgICA1LzMvMjAwMQotIFB1cnBvc2U6ICBNUEVHIFF1YW50L0RlcXVhbnQgZm9yIERDIG9ubHkgYmxvY2suCi0gKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi1JbnQgQmxvY2tRdWFudERlcXVhbnRNUEVHRENJbnRlcihTaG9ydCAqcmNvZWZmLCBTaG9ydCAqcWNvZWZmLCBJbnQgUVAsIEludCAqcW1hdCwKLSAgICAgICAgICAgICA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mcgaXQgcmVtYWlucyB0aGUgc2FtZSAqLwotICAgICAgICAgICAgICAgIGJpdG1hcGNvbFs3XSB8PSAxOwotICAgICAgICAgICAgICAgICgqYml0bWFwcm93KSB8PSAxOwotICAgICAgICAgICAgfQotICAgICAgICB9Ci0gICAgfQotICAgIHJldHVybiBDQlA7Ci19Ci0KLQotSW50IEJsb2NrUXVhbnREZXF1YW50TVBFR0RDSW50cmEoU2hvcnQgKnJjb2VmZiwgU2hvcnQgKnFjb2VmZiwgSW50IFFQLCBJbnQgKnFtYXQsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBVQ2hhciBiaXRtYXBjb2xbIF0sIFVDaGFyICpiaXRtYXByb3csIFVJbnQgKmJpdG1hcHp6LAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgSW50IGRjX3NjYWxlcikKLXsKLSAgICBJbnQgdG1wLCBjb2VmZiwgcV92YWx1ZTsKLQotICAgIE9TQ0xfVU5VU0VEX0FSRyhRUCk7Ci0gICAgT1NDTF9VTlVTRURfQVJHKHFtYXQpOwotCi0KLSAgICAqKChJbnQqKWJpdG1hcGNvbCkgPSAqKChJbnQqKShiaXRtYXBjb2wgKyA0KSkgPSAwOwotICAgICpiaXRtYXByb3cgPSAwOwotICAgIGNvZWZmID0gcmNvZWZmWzBdOwotCi0gICAgLyppZiAoY29lZmYgPj0gMCkgICB0bXAgPSAoY29lZmYgKyBkY19zY2FsZXIvMikgLyBkY19zY2FsZXI7Ci0gICAgZWxzZSAgICAgICAgICAgIHRtcCA9IChjb2VmZiAtIGRjX3NjYWxlci8yKSAvIGRjX3NjYWxlcjsqLwotICAgIGlmIChjb2VmZiA+PSAwKSBjb2VmZiArPSAoZGNfc2NhbGVyID4+IDEpIDsKLSAgICBlbHNlICAgICAgICAgICAgY29lZmYgLT0gKGRjX3NjYWxlciA+PiAxKSA7Ci0gICAgdG1wID0gc2NhbGVBcnJheVYyW2RjX3NjYWxlcl07Ci0KLSAgICB0bXAgPSB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XIgdGhlIExpY2Vuc2UuCi0gKiAtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tCi0gKi8KLS8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0vKiAgRmlsZW5hbWU6IGZhc3RxdWFudF9pbmxpbmUuaCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICBEZXNjcmlwdGlvbjogSW1wbGVtZW50YXRpb24gZm9yIGluLWxpbmUgZnVuY3Rpb25zIHVzZWQgaW4gZGN0LmNwcCAgICAgICAgICAgKi8KLS8qICBNb2RpZmllZDogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0jaWZuZGVmIF9GQVNUUVVBTlRfSU5MSU5FX0hfCi0jZGVmaW5lIF9GQVNUUVVBTlRfSU5MSU5FX0hfCi0KLSNpbmNsdWRlICJtcDRkZWYuaCIKLQotI2lmICFkZWZpbmVkKFBWX0FSTV9HQ0NfVjUpICYmICFkZWZpbmVkKFBWX0FSTV9HQ0NfVjQpIC8qIEFSTSBHTlUgQ09NUElMRVIgICovCi0KLV9faW5saW5lIGludDMyIGFhbl9zY2FsZShpbnQzMiBxX3ZhbHVlLCBpbnQzMiBjb2VmZiwgaW50MzIgcm91bmQsIGludDMyIFFQZGl2MikKLXsKLSAgICBxX3ZhbHVlID0gY29lZmYgKiBxX3ZhbHVlICsgcm91bmQ7Ci0gICAgY29lZmYgPSBxX3ZhbHVlID4+IDE2OwotICAgIGlmIChjb2VmZiA8IDApICBjb2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i0KLV9faW5saW5lIGludDMyIGFhbl9zY2FsZShpbnQzMiBxX3ZhbHVlLCBpbnQzMiBjb2VmZiwKLSAgICAgICAgICAgICAgICAgICAgICAgICBpbnQzMiByb3VuZCwgaW50MzIgUVBkaXYyKQotewotICAgIHJlZ2lzdGVyIGludDMyIG91dDsKLSAgICByZWdpc3RlciBpbnQzMiBxdiA9IHFfdmFsdWU7Ci0gICAgcmVnaXN0ZXIgaW50MzIgY2YgPSBjb2VmZjsKLSAgICByZWdpc3RlciBpbnQzMiByciA9IHJvdW5kOwotICAgIHJlZ2lzdGVyIGludDMyIHFwID0gUVBkaXYyOwotCi0gICAgYXNtIHZvbGF0aWxlKCJzbWxhYmIgJTAsICUyLCAlMSwgJTNcblx0IgotICAgICAgICAgICAgICAgICAibW92cyAlMCwgJTAsIGFzciAjMTZcblx0IgotICAgICAgICAgICAgICAgICAiYWRkbGUgJTAsICUwLCAlNFxuXHQiCi0gICAgICAgICAgICAgICAgICJzdWJndCAlMCwgJTAsICU0IgotICAgICAgICAgICAgIDogIj0mciIob3V0KQotICAgICAgICAgICAgICAgICAgICAgICAgIDogInIiKHF2KSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAiciIoY2YpLAotICAgICAgICAgICAgICAgICAgICAgICAgICJyIihyciksCi0gICAgICAgICAgICAgICAgICAgICAgICAgInIiKHFwKSk7Ci0gICAgcmV0dXJuIG91dDsKLX0KLQotX19pbmxpbmUgaW50MzIgY29lZmZfcXVhbnQoaW50MzIgY29lZmYsIGludDMyIHFfc2NhbGUsIGludDMyIHNoaWZ0KQotewotICAgIHJlZ2lzdGVyIGludDMyIG91dDsKLSAgICByZWdpc3RlciBpbnQzMiB0ZW1wMTsKLSAgICByZWdpc3RlciBpbnQzMiBjYyA9IGNvZWZmOwotICAgIHJlZ2lzdGVyIGludDMyIHFzID0gcV9zY2FsZTsKLSAgICByZWdpc3RlciBpbnQzMiBzcyA9IHNoaWZ0OwotCi0gICAgYXNtIHZvbGF0aWxlKCJzbXVsYmIgJTAsICUzLCAlMlxuXHQiCi0gICAgICAgICAgICAgICAgICJtb3YgJTEsICUwLCBhc3IgJTRcblx0IgotICAgICAgICAgICAgICAgICAiYWRkICUwLCAlMSwgJTEsIGxzciAjMzEiCi0gICAgICAgICAgICAgOiAiPSZyIihvdXQpLAotICAgICAgICAgICAgICAgICAiPSZyIih0ZW1wMSkKLSAgICAgICAgICAgICAgICAgICAgICAgICA6ICJyIihjYyksCi0gICAgICAgICAgICAgICAgICAgICAgICAgInIiKHFzKSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAiciIoc3MpKTsKLQotICAgIHJldHVybiBvdXQ7Ci19Ci0KLV9faW5saW5lIGludDMyIGNvZWZmX2NsaXAoaW50MzIgcV92YWx1ZSwgaW50MzIgYWNfY2xpcCkKLXsKLSAgICByZWdpc3RlciBpbnQzMiBjb2VmZjsKLQotICAgIGFzbSB2b2xhdGlsZSgiYWRkICAgJTEsICUwLCAlMlxuXHQiCi0gICAgICAgICAgICAgICAgICJzdWJzICAlMSwgJTEsICUyLCBsc2wgIzFcblx0IgotICAgICAgICAgICAgICAgICAiZW9yaGkgJTAsICUyLCAlMCwgYXNyICMzMSIKLSAgICAgICAgICAgICA6ICIrciIocV92YWx1ZSksCi0gICAgICAgICAgICAgICAgICI9JnIiKGNvZWZmKQotICAgICAgICAgICAgICAgICAgICAgICAgIDogInIiKGFjX2NsaXApKTsKLQotICAgIHJldHVybiBxX3ZhbHVlOwotfQotCi1fX2lubGluZSBpbnQzMiBjb2VmZl9kZXF1YW50KGludDMyIHFfdmFsdWUsIGludDMyIFFQeDIsIGludDMyIEFkZGl0aW9uLCBpbnQzMiB0bXApCi17Ci0gICAgcmVnaXN0ZXIgaW50MzIgb3V0OwotICAgIHJlZ2lzdGVyIGludDMyIHRlbXAxOwotICAgIHJlZ2lzdGVyIGludDMyIHF2ID0gcV92YWx1ZTsKLSAgICByZWdpc3RlciBpbnQzMiBxcCA9IFFQeDI7Ci0gICAgcmVnaXN0ZXIgaW50MzIgYWEgPSBBZGRpdGlvbjsKLSAgICByZWdpc3RlciBpbnQzMiB0dCA9IHRtcDsKLQotICAgIGFzbSB2b2xhdGlsZSgiY21wICAgICUyLCAjMFxuXHQiCi0gICAgICAgICAgICAgICAgICJtdWwgICAgJTAsICUyLCAlM1xuXHQiCi0gICAgICAgICAgICAgICAgICJzdWJsdCAgJTAsICUwLCAlNFxuXHQiCi0gICAgICAgICAgICAgICAgICJhZGRnZSAgJTAsICUwLCAlNFxuXHQiCi0gICAgICAgICAgICAgICAgICJhZGQgICAgJTEsICUwLCAlNVxuXHQiCi0gICAgICAgICAgICAgICAgICJzdWJzICAgJTEsICUxLCAjMzg0MFxuXHQiCi0gICAgICAgICAgICAgICAgICJzdWJjc3MgJTEsICUxLCAjMjU0XG5cdCIKLSAgICAgICAgICAgICAgICAgImVvcmhpICAlMCwgJTUsICUwLCBhc3IgIzMxIgotICAgICAgICAgICAgIDogIj0mciIob3V0KSwKLSAgICAgICAgICAgICAgICAgIj0mciIodGVtcDEpCi0gICAgICAgICAgICAgICAgICAgICAgICAgOiAiciIocXYpLAotICAgICAgICAgICAgICAgICAgICAgICAgICJyIihxcCksCi0gICAgICAgICAgICAgICAgICAgICAgICAgInIiKGFhKSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAiciIodHQpKTsKLQotICAgIHJldHVybiBvdXQ7Ci19Ci0KLV9faW5saW5lIGludDMyIHNtbGFiYihpbnQzMiBxX3ZhbHVlLCBpbnQzMiBjb2VmZiwgaW50MzIgcm91bmQpCi17Ci0gICAgcmVnaXN0ZXIgaW50MzIgb3V0OwotICAgIHJlZ2lzdGVyIGludDMyIGFhID0gKGludDMyKXFfdmFsdWU7Ci0gICAgcmVnaXN0ZXIgaW50MzIgYmIgPSAoaW50MzIpY29lZmY7Ci0gICAgcmVnaXN0ZXIgaW50MzIgY2MgPSAoaW50MzIpcm91bmQ7Ci0KLSAgICBhc20gdm9sYXRpbGUoInNtbGFiYiAlMCwgJTEsICUyLCAlMyIKLSAgICAgICAgICAgICA6ICI9JnIiKG91dCkKLSAgICAgICAgICAgICAgICAgICAgICAgICA6ICJyIihhYSksCi0gICAgICAgICAgICAgICAgICAgICAgICAgInIiKGJiKSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAiciIoY2MpKTsKLSAgICByZXR1cm4gb3V0OwotfQotCi1fX2lubGluZSBpbnQzMiBzbXVsYmIoaW50MzIgcV9zY2FsZSwgaW50MzIgY29lZmYpCi17Ci0gICAgcmVnaXN0ZXIgaW50MzIgb3V0OwotICAgIHJlZ2lzdGVyIGludDMyIGFhID0gKGludDMyKXFfc2NhbGU7Ci0gICAgcmVnaXN0ZXIgaW50MzIgYmIgPSAoaW50MzIpY29lZmY7Ci0KLSAgICBhc20gdm9sYXRpbGUoInNtdWxiYiAlMCwgJTEsICUyIgotICAgICAgICAgICAgIDogIj0mciIob3V0KQotICAgICAgICAgICAgICAgICAgICAgICAgIDogInIiKGFhKSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAiciIoYmIpKTsKLSAgICByZXR1cm4gb3V0OwotfQotCi1fX2lubGluZSBpbnQzMiBhYW5fZGNfc2NhbGUoaW50MzIgY29lZmYsIGludDMyIFFQKQotewotICAgIHJlZ2lzdGVyIGludDMyIG91dDsKLSAgICByZWdpc3RlciBpbnQzMiBjYyA9IGNvZWZmOwotICAgIHJlZ2lzdGVyIGludDMyIHFwID0gUVA7Ci0KLSAgICBhc20gdm9sYXRpbGUoImNtcCAlMSwgIzBcblx0IgotICAgICAgICAgICAgICAgICAiYWRkbGUgJTAsICUxLCAlMiwgYXNyICMxXG5cdCIKLSAgICAgICAgICAgICAgICAgInN1Ymd0ICUwLCAlMSwgJTIsIGFzciAjMSIKLSAgICAgICAgICAgICA6ICI9JnIiKG91dCkKLSAgICAgICAgICAgICAgICAgICAgICAgICA6ICJyIihjYyksCi0gICAgICAgICAgICAgICAgICAgICAgICAgInIiKHFwKSk7Ci0gICAgcmV0dXJuIG91dDsKLX0KLQotX19pbmxpbmUgaW50MzIgY2xpcF8yMDQ3KGludDMyIHFfdmFsdWUsIGludDMyIHRtcCkKLXsKLSAgICByZWdpc3RlciBpbnQzMiBjb2VmZjsKLSAgICBhc20gdm9sYXRpbGUoImFkZCAgICAlMSwgJTAsICUyXG5cdCIKLSAgICAgICAgICAgICAgICAgInN1YnMgICAlMSwgJTEsICMweEYwMFxuXHQiCi0gICAgICAgICAgICAgICAgICJzdWJjc3MgJTEsICUxLCAjMHhGRVxuXHQiCi0gICAgICAgICAgICAgICAgICJlb3JoaSAgJTAsICUyLCAlMCwgYXNyICMzMSIKLSAgICAgICAgICAgICA6ICIrciIocV92YWx1ZSksCi0gICAgICAgICAgICAgICAgICI9JnIiKGNvZWZmKQotICAgICAgICAgICAgICAgICAgICAgICAgIDogInIiKHRtcCkpOwotCi0gICAgcmV0dXJuIHFfdmFsdWU7Ci19Ci0KLV9faW5saW5lIGludDMyIGNvZWZmX2RlcXVhbnRfbXBlZyhpbnQzMiBxX3ZhbHVlLCBpbnQzMiBzdGVwc2l6ZSwgaW50MzIgUVAsIGludDMyIHRtcCkKLXsKLSAgICByZWdpc3RlciBpbnQzMiBvdXQ7Ci0gICAgcmVnaXN0ZXIgaW50MzIgdGVtcDE7Ci0gICAgcmVnaXN0ZXIgaW50MzIgcXYgPSBxX3ZhbHVlOwotICAgIHJlZ2lzdGVyIGludDMyIHNzID0gc3RlcHNpemU7Ci0gICAgcmVnaXN0ZXIgaW50MzIgcXAgPSBRUDsKLSAgICByZWdpc3RlciBpbnQzMiB0dCA9IHRtcDsKLQotICAgIGFzbSB2b2xhdGlsZSgibW92cyAgICAlMSwgJTIsIGxzbCAjMVxuXHQiCi0gICAgICAgICAgICAgICAgICJtdWwgICAgICUwLCAlMywgJTRcblx0IgotICAgICAgICAgICAgICAgICAiYWRkZ3QgICAlMSwgJTEsICMxXG5cdCIKLSAgICAgICAgICAgICAgICAgInN1Ymx0ICAgJTEsICUxLCAjMVxuXHQiCi0gICAgICAgICAgICAgICAgICJtdWwgICAgICUwLCAlMSwgJTBcblx0IgotICAgICAgICAgICAgICAgICAiYWRkbHQgICAlMCwgJTAsICMxNVxuXHQiCi0gICAgICAgICAgICAgICAgICJtb3YgICAgICUwLCAlMCwgYXNyICM0XG5cdCIKLSAgICAgICAgICAgICAgICAgImFkZCAgICAgJTEsICUwLCAlNVxuXHQiCi0gICAgICAgICAgICAgICAgICJzdWJzICAgICUxLCAlMSwgIzB4RjAwXG5cdCIKLSAgICAgICAgICAgICAgICAgInN1YmNzcyAgJTEsICUxLCAjMHhGRVxuXHQiCi0gICAgICAgICAgICAgICAgICJlb3JoaSAgICUwLCAlNSwgJTAsIGFzciAjMzEiCi0gICAgICAgICAgICAgOiAiPSZyIihvdXQpLAotICAgICAgICAgICAgICAgICAiPSZyIih0ZW1wMSkKLSAgICAgICAgICAgICAgICAgICAgICAgICA6ICJyIihxdiksCi0gICAgICAgICAgICAgICAgICAgICAgICAgInIiKHNzKSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAiciIocXApLAotICAgICAgICAgICAgICAgICAgICAgICAgICJyIih0dCkpOwotCi0gICAgcmV0dXJuIG91dDsKLQotfQotCi1fX2lubGluZSBpbnQzMiBjb2VmZl9kZXF1YW50X21wZWdfaW50cmEoaW50MzIgcV92YWx1ZSwgaW50MzIgdG1wKQotewotICAgIHJlZ2lzdGVyIGludDMyIG91dDsKLSAgICByZWdpc3RlciBpbnQzMiB0ZW1wMTsKLSAgICByZWdpc3RlciBpbnQzMiBxdiA9IHFfdmFsdWU7Ci0gICAgcmVnaXN0ZXIgaW50MzIgdHQgPSB0bXA7Ci0KLSAgICBhc20gdm9sYXRpbGUoIm1vdnMgICAgJTEsICUyLCBsc2wgIzFcblx0IgotICAgICAgICAgICAgICAgICAiYWRkbHQgICAlMSwgJTEsICMxNVxuXHQiCi0gICAgICAgICAgICAgICAgICJtb3YgICAgICUwLCAlMSwgYXNyICM0XG5cdCIKLSAgICAgICAgICAgICAgICAgImFkZCAgICA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30sCi0gICAgezEsIDQsIDMsIDIsIDEsIDAsIDEsIDIsIDN9LAotICAgIHsxLCAyLCAzLCAyLCAxLCAwLCAwLCAwLCAxfSwKLSAgICB7MSwgMiwgMywgNCwgMywgMiwgMSwgMCwgMX0sCi0gICAgezEsIDAsIDEsIDIsIDMsIDIsIDEsIDAsIDB9Ci19OwotCi0KLS8qPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09Ci0gICAgRnVuY3Rpb246ICAgRmluZEhhbGZQZWxNQgotICAgIERhdGU6ICAgICAgIDEwLzcvMjAwMAotICAgIFB1cnBvc2U6ICAgIEZpbmQgaGFsZiBwZWwgcmVzb2x1dGlvbiBNViBzdXJyb3VuZGluZyB0aGUgZnVsbC1wZWwgTVYKLT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PSovCi0KLXZvaWQgRmluZEhhbGZQZWxNQihWaWRlb0VuY0RhdGEgKnZpZGVvLCBVQ2hhciAqY3VyLCBNT1QgKm1vdCwgVUNoYXIgKm5jYW5kLAotICAgICAgICAgICAgICAgICAgIEludCB4cG9zLCBJbnQgeXBvcywgSW50ICp4aG1pbiwgSW50ICp5aG1pbiwgSW50IGhwX2d1ZXNzKQotewotLy8gIGhwX21lbSA9IFVMb25nICp2ZXJ0QXJyYXk7IC8qIDIweDE3ICovCi0vLyAgICAgICAgICAgVUxvbmcgKmhvcnpBcnJheTsgLyogMjB4MTYgKi8KLS8vICAgICAgICAgICBVTG9uZyAqZGlhZ0FycmF5OyAvKiAyMHgxNyAqLwotICAgIEludCBkbWluLCBkOwotCi0gICAgSW50IHhoLCB5aDsKLSAgICBJbnQgaywga21pbiA9IDA7Ci0gICAgSW50IGltaW4sIGptaW4sIGlsb3csIGpsb3c7Ci0gICAgSW50IGgyNjNfbW9kZSA9IHZpZGVvLT5lbmNQYXJhbXMtPkgyNjNfRW5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W5nZVs3XSA9IDA7Ci0gICAgfQotCi0gICAgeGhtaW5bMF0gPSAwOwotICAgIHlobWluWzBdID0gMDsKLSAgICBkbWluID0gbW90WzBdLnNhZDsKLQotICAgIHhoID0gMDsKLSAgICB5aCA9IC0xOwotICAgIG5jYW5kIC09IGx4OyAvKiBpbml0aWFsIHBvc2l0aW9uICovCi0KLSAgICBmb3IgKGsgPSAyOyBrIDw9IDg7IGsgKz0gMikKLSAgICB7Ci0gICAgICAgIGlmIChkaXN0YW5jZV90YWJbaHBfZ3Vlc3NdW2tdIDwgSFBfRElTVEFOQ0VfVEgpCi0gICAgICAgIHsKLSAgICAgICAgICAgIGlmIChpbl9yYW5nZVtrXSkKLSAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICBkID0gKCooU0FEX01CX0hhbGZQZWxbKCh5aCYxKTw8MSkrKHhoJjEpXSkpKG5jYW5kLCBjdXIsIChkbWluIDw8IDE2KSB8IGx4LCBleHRyYV9pbmZvKTsKLQotICAgICAgICAgICAgICAgIGlmIChkIDwgZG1pbikKLSAgICAgICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgICAgIGRtaW4gPSBkOwotICAgICAgICAgICAgICAgICAgICB4aG1pblswXSA9IHhoOwotICAgICAgICAgICAgICAgICAgICB5aG1pblswXSA9IHloOwotICAgICAgICAgICAgICAgICAgICBrbWluID0gazsKLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgZWxzZSBpZiAoZCA9PSBkbWluICYmCi0gICAgICAgICAgICAgICAgICAgICAgICAgUFZfQUJTKG1vdFswXS54ICsgeGgpICsgUFZfQUJTKG1vdFswXS55ICsgeWgpIDwgUFZfQUJTKG1vdFswXS54ICsgeGhtaW5bMF0pICsgUFZfQUJTKG1vdFswXS55ICsgeWhtaW5bMF0pKQotICAgICAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAgICAgeGhtaW5bMF0gPSB4aDsKLSAgICAgICAgICAgICAgICAgICAgeWhtaW5bMF0gPSB5aDsKLSAgICAgICAgICAgICAgICAgICAga21pbiA9IGs7Ci0gICAgICAgICAgICAgICAgfQotCi0gICAgICAgICAgICB9Ci0gICAgICAgIH0KLSAgICAgICAgeGggKz0gbmV4dF9ocF9wb3Nba11bMF07Ci0gICAgICAgIHloICs9IG5leHRfaHBfcG9zW2tdWzFdOwotICAgICAgICBuY2FuZCArPSBuZXh0X25jYW5kW2tdOwotCi0gICAgICAgIGlmIChrID09IDgpCi0gICAgICAgIHsKLSAgICAgICAgICAgIGlmICh4aG1pblswXSAhPSAwIHx8IHlobWluWzBdICE9IDApCi0gICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgayA9IC0xOwotICAgICAgICAgICAgICAgIGhwX2d1ZXNzID0ga21pbjsKLSAgICAgICAgICAgIH0KLSAgICAgICAgfQotICAgIH0KLQotICAgIG1vdFswXS5zYWQgPSBkbWluOwotICAgIG1vdFswXS54ICs9IHhobWluWzBdOwotICAgIG1vdFswXS55ICs9IHlobWluWzBdOwotCi0gICAgcmV0dXJuIDsKLX0KLQotI2lmbmRlZiBOT19JTlRFUjRWCi0vKj09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQotICAgIEZ1bmN0aW9uOiAgIEZpbmRIYWxmUGVsQmxrCi0gICAgRGF0ZTogICAgICAgMTAvNy8yMDAwCi0gICAgUHVycG9zZTogICAgRmluZCBoYWxmIHBlbCByZXNvbHV0aW9uIE1WIHN1cnJvdW5kaW5nIHRoZSBmdWxsLXBlbCBNVgotICAgICAgICAgICAgICAgIEFuZCBkZWNpZGUgYmV0d2VlbiAxTVYgb3IgNE1WIG1vZGUKLT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PSovCi0vLy8vLyBUSElTIEZVTkNUSU9OIElTIE5PVCBXT1JLSU5HISEhIE5FRUQgVE8gQkUgUklWSVNJVEVECi0KL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ICAgICAgICBpbl9yYW5nZVswXSA9IGluX3JhbmdlWzFdID0gaW5fcmFuZ2VbMl0gPSAwOwotICAgICAgICBlbHNlIGlmIChqbWluID49IGhlaWdodCAtIDEpCi0gICAgICAgICAgICBpbl9yYW5nZVs0XSA9IGluX3JhbmdlWzVdID0gaW5fcmFuZ2VbNl0gPSAwOwotCi0gICAgICAgIC8qKioqKioqKioqKioqKioqIGhhbGYtcGVsIHNlYXJjaCAqKioqKioqKioqKioqKioqKioqKioqKi8KLSAgICAgICAgY3VyOCA9IGN1ciArICgoY29tcCAmIDEpIDw8IDMpICsgKChjb21wICYgMikgPDwgMikgKiB3aWR0aCA7Ci0KLSAgICAgICAgLyogZ2VuZXJhdGUgaGFsZi1wZWwgc2VhcmNoIHJlZ2lvbiAqLwotICAgICAgICB7Ci0gICAgICAgICAgICBjYW5kID0gbmNhbmQ4W2NvbXArMV07Ci0gICAgICAgICAgICBzd2lkdGggPSBseDsKLSAgICAgICAgfQotCi0gICAgICAgIHhobWluW2NvbXArMV0gPSAwOwotICAgICAgICB5aG1pbltjb21wKzFdID0gMDsKLSAgICAgICAgZG1pbiA9IG1vdFtjb21wKzFdLnNhZDsKLQotICAgICAgICB4aCA9IC0xOwotICAgICAgICB5aCA9IC0xOwotICAgICAgICBmb3IgKGsgPSAwOyBrIDwgODsgaysrKQotICAgICAgICB7Ci0gICAgICAgICAgICBpZiAoaW5fcmFuZ2Vba10pCi0gICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgZCA9ICgqU0FEX0Jsa19IYWxmUGVsKShjYW5kLCBjdXI4LCBkbWluLCBseCwgc3dpZHRoLCB4aCwgeWgsIGV4dHJhX2luZm8pOwotCi0gICAgICAgICAgICAgICAgaWYgKGQgPCBkbWluKQotICAgICAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAgICAgZG1pbiA9IGQ7Ci0gICAgICAgICAgICAgICAgICAgIHhobWluW2NvbXArMV0gPSB4aDsKLSAgICAgICAgICAgICAgICAgICAgeWhtaW5bY29tcCsxXSA9IHloOwotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgIH0KLSAgICAgICAgICAgIHhoICs9IG5leHRfaHBfcG9zW2tdWzBdOwotICAgICAgICAgICAgeWggKz0gbmV4dF9ocF9wb3Nba11bMV07Ci0gICAgICAgIH0KLSAgICAgICAgLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotICAgICAgICBtb3RbY29tcCsxXS54ICs9IHhobWluW2NvbXArMV07Ci0gICAgICAgIG1vdFtjb21wKzFdLnkgKz0geWhtaW5bY29tcCsxXTsKLSAgICAgICAgbW90W2NvbXArMV0uc2FkID0gZG1pbjsKLSAgICAgICAgc2FkOCArPSBkbWluOwotCi0gICAgICAgIGlmIChzYWQ4ID49IHNhZDE2IC0gUFJFRl8xNl9WRUMpCi0gICAgICAgIHsKLSAgICAgICAgICAgICptb2RlID0gTU9ERV9JTlRFUjsKLSAgICAgICAgICAgIGZvciAoayA9IDE7IGsgPD0gNDsgaysrKQotICAgICAgICAgICAgewotICAgICAgICAgICAgICAgIG1vdFtrXS5zYWQgPSAobW90WzBdLnNhZCArIDIpID4+IDI7Ci0gICAgICAgICAgICAgICAgbW90W2tdLnggPSBtb3RbMF0ueDsKLSAgICAgICAgICAgICAgICBtb3Rba10ueSA9IG1vdFswXS55OwotICAgICAgICAgICAgfQotICAgICAgICAgICAgcmV0dXJuIHNhZDg7Ci0gICAgICAgIH0KLQotICAgICAgICBobWVtICs9ICgxMCAqIDEwKTsKLSAgICB9Ci0KLSAgICAqbW9kZSA9IE1PREVfSU5URVI0VjsKLQotICAgIHJldHVybiBzYWQ4OwotfQotI2VuZGlmIC8qIE5PX0lOVEVSNFYgKi8KLQpkaWZmIC0tZ2l0IGEvbWVkaWEvbGlic3RhZ2VmcmlnaHQvY29kZWNzL200dl9oMjYzL2VuYy9zcmMvbTR2ZW5jX29zY2wuaCBiL21lZGlhL2xpYnN0YWdlZnJpZ2h0L2NvZ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d1YWdlIGdvdmVybmluZyBwZXJtaXNzaW9ucwotICogYW5kIGxpbWl0YXRpb25zIHVuZGVyIHRoZSBMaWNlbnNlLgotICogLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLQotICovCi0vKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotLyogUmV2aXNpb24gSGlzdG9yeSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogRGF0ZTogMTEvMDQvMDUgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogRGVzY3JpcHRpb246IENyZWF0ZWQgZm9yIGFic3RyYWN0aW5nIG91dCBPU0NMIHN1Y2ggdGhhdCB0aGUgY29kZSBjYW4gYmUgdXNlZCAqLwotLyogICAgICAgICAgYnkgYm90aCBWMyBhbmQgVjQgT1NDTCBsaWJyYXJ5LiBUaGlzIGZpbGUgaXMgZm9yIFY0LiAgICAgICAgICAgICAgICAqLwotLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLQotI2lmbmRlZiBfTTRWRU5DX09TQ0xfSF8KLSNkZWZpbmUgX000VkVOQ19PU0NMX0hfCi0KLSNpbmNsdWRlIDxzdGRsaWIuaD4KLSNpbmNsdWRlIDxtYXRoLmg+Ci0KLSNkZWZpbmUgTTRWRU5DX01BTExPQyhzaXplKSAgICAgICAgICAgICBtYWxsb2Moc2l6ZSkKLSNkZWZpbmUgTTRWRU5DX0ZSRUUocHRyKSAgICAgICAgICAgICAgICBmcmVlKHB0cikKLQotI2RlZmluZSBNNFZFTkNfTUVNU0VUKH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vciBJTlRSQSBjb2RpbmcgKi8KLQotLyo9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KLSAgICBGdW5jdGlvbjogICBDaG9vc2VNb2RlCi0gICAgRGF0ZTogICAgICAgMDkvMjEvMjAwMAotICAgIFB1cnBvc2U6ICAgIENob29zaW5nIGJldHdlZW4gSU5UUkEgb3IgSU5URVIKLSAgICBJbnB1dC9PdXRwdXQ6IFBvaW50ZXIgdG8gdGhlIHN0YXJ0aW5nIHBvaW50IG9mIHRoZSBtYWNyb2Jsb2NrLgotICAgIE5vdGU6Ci09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0qLwotdm9pZCBDaG9vc2VNb2RlX0MoVUNoYXIgKk1vZGUsIFVDaGFyICpjdXIsIEludCBseCwgSW50IG1pbl9TQUQpCi17Ci0gICAgSW50IGksIGo7Ci0gICAgSW50IE1CX21lYW4sIEEsIHRtcCwgVGg7Ci0gICAgSW50IG9mZnNldCA9IChseCA+PiAyKSAtIDQ7Ci0gICAgVUNoYXIgKnAgPSBjdXI7Ci0gICAgSW50ICpwaW50ID0gKEludCAqKSBjdXIsIHRlbXAgPSAwOwotICAgIE1CX21lYW4gPSAwOwotICAgIEEgPSAwOwotICAgIFRoID0gKG1pbl9TQUQgLSBQUkVGX0lOVFJBKSA+PiAxOwotCi0gICAgZm9yIChqID0gMDsgaiA8IDg7IGorKykKLSAgICB7Ci0KLSAgICAgICAgLyogT2RkIFJvd3MgKi8KLSAgICAgICAgdGVtcCArPSAoKnBpbnQrKykgJiAweDAwRkYwMEZGOwotICAgICAgICB0ZW1wICs9ICgqcGludCsrKSAmIDB4MDBGRjAwRkY7Ci0gICAgICAgIHRlbXAgKz0gKCpwaW50KyspICYgMHgwMEZGMDBGRjsKLSAgICAgICAgdGVtcCArPSAoKnBpbnQrKykgJiAweDAwRkYwMEZGOwotICAgICAgICBwaW50ICs9IG9mZnNldDsKLQotICAgICAgICAvKiBFdmVuIFJvd3MgKi8KLSAgICAgICAgdGVtcCArPSAoKnBpbnQrKyA+PiA4KSAmIDB4MDBGRjAwRkY7Ci0gICAgICAgIHRlbXAgKz0gKCpwaW50KysgPj4gOCkgJiAweDAwRkYwMEZGOwotICAgICAgICB0ZW1wICs9ICgqcGludCsrID4+IDgpICYgMHgwMEZGMDBGRjsKLSAgICAgICAgdGVtcCArPSAoKnBpbnQrKyA+PiA4KSAmIDB4MDBGRjAwRkY7Ci0gICAgICAgIHBpbnQgKz0gb2Zmc2V0OwotCi0gICAgfQotCi0gICAgTUJfbWVhbiA9ICgoKHRlbXAgJiAweDAwMDBGRkZGKSkgKyAoKHRlbXAgJiAweEZGRkYwMDAwKSA+PiAxNikpID4+IDc7Ci0KLSAgICBwID0gY3VyOwotICAgIG9mZnNldCA9IGx4IC0gMTY7Ci0gICAgZm9yIChqID0gMDsgaiA8IDE2OyBqKyspCi0gICAgewotICAgICAgICB0ZW1wID0gKGogJiAxKTsKLSAgICAgICAgcCArPSB0ZW1wOwotICAgICAgICBpID0gODsKLSAgICAgICAgd2hpbGUgKGktLSkKLSAgICAgICAgewotICAgICAgICAgICAgdG1wID0gKnAgLSBNQl9tZWFuOwotICAgICAgICAgICAgcCArPSAyOwotICAgICAgICAgICAgaWYgKHRtcCA+IDApIEEgKz0gdG1wOwotICAgICAgICAgICAgZWxzZSAgICBBIC09IHRtcDsKLSAgICAgICAgfQotCi0gICAgICAgIGlmIChBID49IFRoKQotICAgICAgICB7Ci0gICAgICAgICAgICAqTW9kZSA9IE1PREVfSU5URVI7Ci0gICAgICAgICAgICByZXR1cm4gOwotICAgICAgICB9Ci0gICAgICAgIHAgKz0gKG9mZnNldCAtIHRlbXApOwotICAgIH0KLQotICAgIGlmIChBIDwgVGgpCi0gICAgICAgICpNb2RlID0gTU9ERV9JTlRSQTsKLSAgICBlbHNlCi0gICAgICAgICpNb2RlID0gTU9ERV9JTlRFUjsKLQotICAgIHJldHVybiA7Ci19Ci0KLQotLyo9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KLSAgICBGdW5jdGlvbjogICBHZXRIYWxmUGVsTUJSZWdpb24KLSAgICBEYXRlOiAgICAgICAwOS8xNy8yMDAwCi0gICAgUHVycG9zZTogICAgSW50ZXJwb2xhdGUgdGhlIHNlYXJjaCByZWdpb24gZm9yIGhhbGYtcGVsIHNlYXJjaAotICAgIElucHV0L091dHB1dDogICBDZW50ZXIgb2YgdGhlIHNlYXJjaCwgSGFsZi1wZWwgbWVtb3J5LCB3aWR0aAotICAgIE5vdGU6ICAgICAgIHJvdW5kaW5nIHR5cGUgc2hvdWxkIGJlIHBhcmFtZXRlcml6ZWQuCi0gICAgICAgICAgICAgICAgTm93IGZpeGVkIGl0IHRvIHplcm8hISEhISEKLQotPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09Ki8KLQotCi12b2lkIEdldEhhbGZQZWxNQlJlZ2lvbl9DKFVDaGFyICpjYW5kLCBVQ2hhciAqaG1lbSwgSW50IGx4KQotewotICAgIEludCBpLCBqOwotICAgIFVDaGFyICpwMSwgKnAyLCAqcDMsICpwNDsKLSAgICBVQ2hhciAqaG1lbTEgPSBobWVtOwotICAgIFVDaGFyICpobWVtMiA9IGhtZW0xICsgMzM7Ci0gICAgSW50IG9mZnNldCA9IGx4IC0gMTc7Ci0KLSAgICBwMSA9IGNhbmQgLSBseCAtIDE7Ci0gICAgcDIgPSBjYW5kIC0gbHg7Ci0gICAgcDMgPSBjYW5kIC0gMTsKLSAgICBwNCA9IGNhbmQ7Ci0KLSAgICBmb3IgKGogPSAwOyBqIDwgMTY7IGorKykKLSAgICB7Ci0gICAgICAgIGZvciAoaSA9IDA7IGkgPCAxNjsgaSsrKQotICAgICAgICB7Ci0gICAgICAgICAgICAqaG1lbTErKyA9ICgoKnAxKyspICsgKnAyICsgKnAzICsgKnA0ICsgMikgPj4gMjsKLSAgICAgICAgICAgICpobWVtMSsrID0gKCgqcDIrKykgKyAqcDQgKyAxKSA+PiAxOwotICAgICAgICAgICAgKmhtZW0yKysgPSAoKCpwMysrKSArICpwNCArIDEpID4+IDE7Ci0gICAgICAgICAgICAqaG1lbTIrKyA9ICpwNCsrOwotICAgICAgICB9Ci0gICAgICAgIC8qICBsYXN0IHBpeGVsICovCi0gICAgICAgICpobWVtMSsrID0gKCgqcDErKykgKyAoKnAyKyspICsgKnAzICsgKnA0ICsgMikgPj4gMjsKLSAgICAgICAgKmhtZW0yKysgPSAoKCpwMysrKSArICgqcDQrKykgKyAxKSA+PiAxOwotICAgICAgICBobWVtMSArPSAzMzsKLSAgICAgICAgaG1lbTIgKz0gMzM7Ci0gICAgICAgIHAxICs9IG9mZnNldDsKLSAgICAgICAgcDIgKz0gb2Zmc2V0OwotICAgICAgICBwMyArPSBvZmZzZXQ7Ci0gICAgICAgIHA0ICs9IG9mZnNldDsKLSAgICB9Ci0gICAgLyogbGFzdCByb3cgKi8KLSAgICBmb3IgKGkgPSAwOyBpIDwgMTY7IGkrKykKLSAgICB7Ci0gICAgICAgICpobWVtMSsrID0gKCgqcDErKykgKyAqcDIgKyAoKnAzKyspICsgKnA0ICsgMikgPj4gMjsKLSAgICAgICAgKmhtZW0xKysgPSAoKCpwMisrKSArICgqcDQrKykgKyAxKSA+PiAxOwotCi0gICAgfQotICAgICpobWVtMSA9ICgqcDEgKyAqcDIgKyAqcDMgKyAqcDQgKyAyKSA+PiAyOwotCi0gICAgcmV0dXJuIDsKLX0KLQotLyo9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KLSAgIEZ1bmN0aW9uOiAgICBHZXRIYWxmUGVsQmxrUmVnaW9uCi0gICBEYXRlOiAgICAgICAgMDkvMjAvMjAwMAotICAgUHVycG9zZTogSW50ZXJwb2xhdGUgdGhlIHNlYXJjaCByZWdpb24gZm9yIGhhbGYtcGVsIHNlYXJjaAotICAgICAgICAgICAgaW4gNE1WIG1vZGUuCi0gICBJbnB1dC9PdXRwdXQ6ICAgIENlbnRlciBvZiB0aGUgc2VhcmNoLCBIYWxmLXBlbCBtZW1vcnksIHdpZHRoCi0gICBOb3RlOiAgICAgICAgcm91bmRpbmcgdHlwZSBzaG91bGQgYmUgcGFyYW1ldGVyaXplZC4KLSAgICAgICAgICAgIE5vdyBmaXhlZCBpdCB0byB6ZXJvISEhISEhCi0KLT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PSovCi0KLQotdm9pZCBHZXRIYWxmUGVsQmxrUmVnaW9uKFVDaGFyICpjYW5kLCBVQ2hhciAqaG1lbSwgSW50IGx4KQotewotICAgIEludCBpLCBqOwotICAgIFVDaGFyICpwMSwgKnAyLCAqcDMsICpwNDsKLSAgICBVQ2hhciAqaG1lbTEgPSBobWVtOwotICAgIFVDaGFyICpobWVtMiA9IGhtZW0xICsgMTc7Ci0gICAgSW50IG9mZnNldCA9IGx4IC0gOTsKLQotICAgIHAxID0gY2FuZCAtIGx4IC0gMTsKLSAgICBwMiA9IGNhbmQgLSBseDsKLSAgICBwMyA9IGNhbmQgLSAxOwotICAgIHA0ID0gY2FuZDsKLQotICAgIGZvciAoaiA9IDA7IGogPCA4OyBqKyspCi0gICAgewotICAgICAgICBmb3IgKGkgPSAwOyBpIDwgODsgaSsrKQotICAgICAgICB7Ci0gICAgICAgICAgICAqaG1lbTErKyA9ICgoKnAxKyspICsgKnAyICsgKnAzICsgKnA0ICsgMikgPj4gMjsKLSAgICAgICAgICAgICpobWVtMSsrID0gKCgqcDIrKykgKyAqcDQgKyAxKSA+PiAxOwotICAgICAgICAgICAgKmhtZW0yKysgPSAoKCpwMysrKSArICpwNCArIDEpID4+IDE7Ci0gICAgICAgICAgICAqaG1lbTIrKyA9ICpwNCsrOwotICAgICAgICB9Ci0gICAgICAgIC8qICBsYXN0IHBpeGVsICovCi0gICAgICAgICpobWVtMSsrID0gKCgqcDErKykgKyAoKnAyKyspICsgKnAzICsgKnA0ICsgMikgPj4gMjsKLSAgICAgICAgKmhtZW0yKysgPSAoKCpwMysrKSArICgqcDQrKykgKyAxKSA+PiAxOwotICAgICAgICBobWVtMSArPSAxNzsKLSAgICAgICAgaG1lbTIgKz0gMTc7Ci0gICAgICAgIHAxICs9IG9mZnNldDsKLSAgICAgICAgcDIgKz0gb2Zmc2V0OwotICAgICAgICBwMyArPSBvZmZzZXQ7Ci0gICAgICAgIHA0ICs9IG9mZnNldDsKLSAgICB9Ci0gICAgLyogbGFzdCByb3cgKi8KLSAgICBmb3IgKGkgPSAwOyBpIDwgODsgaSsrKQotICAgIHsKLSAgICAgICAgKmhtZW0xKysgPSAoKCpwMSsrKSArICpwMiArICgqcDMrKykgKyAqcDQgKyAyKSA+PiAyOwotICAgICAgICAqaG1lbTErKyA9ICgoKnAyKyspICsgKCpwNCsrKSArIDEpID4+IDE7Ci0KLSAgICB9Ci0gICAgKmhtZW0xID0gKCpwMSArICpwMiArICpwMyArICpwNCArIDIpID4+IDI7Ci0KLSAgICByZXR1cm4gOwotfQotCi0KLS8qPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09Ci0gICAgRnVuY3Rpb246ICAgUGFkZGluZ0VkZ2UKLSAgICBEYXRlOiAgICAgICAwOS8xNi8yMDAwCi0gICAgUHVycG9zZTogICAgUGFkIGVkZ2Ugb2YgYSBWb3AKLSAgICBNb2RpZmljYXRpb246IDA5LzIwLzA1LgotPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09Ki8KLQotdm9pZCAgUGFkZGluZ0VkZ2UoVm9wICpyZWZWb3ApCi17Ci0gICAgVUNoYXIgKnNyYywgKmRzdDsKLSAgICBJbnQgaTsKLSAgICBJ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7Ci0gICAgICAgIE00VkVOQ19NRU1DUFkoZHN0LCBkc3QgLSBwaXRjaCwgcGl0Y2gpOwotICAgICAgICBkc3QgKz0gcGl0Y2g7Ci0gICAgfQotCi0KLSAgICByZXR1cm4gOwotfQotCi0vKj09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KLSAgICBGdW5jdGlvbjogICBDb21wdXRlTUJTdW0KLSAgICBEYXRlOiAgICAgICAxMC8yOC8yMDAwCi0gICAgUHVycG9zZTogICAgQ29tcHV0ZSBzdW0gb2YgYWJzb2x1dGUgdmFsdWUgKFNBVikgb2YgYmxvY2tzIGluIGEgbWFjcm9ibG9jawotICAgICAgICAgICAgICAgIGluIElOVFJBIG1vZGUgbmVlZGVkIGZvciByYXRlIGNvbnRyb2wuIFRodXMsIGluc3RlYWQgb2YKLSAgICAgICAgICAgICAgICBjb21wdXRpbmcgdGhlIFNBViwgd2UgY2FuIGNvbXB1dGUgZmlyc3Qgb3JkZXIgbW9tZW50IG9yCi0gICAgICAgICAgICAgICAgdmFyaWFuY2UgLgotCi0gICAgMTEvMjgvMDA6ICAgIGFkZCBNTVgKLSAgICA5LzMvMDE6ICAgICAgZG8gcGFyYWxsZWwgY29tcCBmb3IgQyBmdW5jdGlvbi4KLT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0qLwotdm9pZCBDb21wdXRlTUJTdW1fQyhVQ2hhciAqY3VyLCBJbnQgbHgsIE1PVCAqbW90X21iKQotewotICAgIEludCBqOwotICAgIEludCAqY0ludCwgKmNJbnQyOwotICAgIEludCBzYWQxID0gMCwgc2FkMiA9IDAsIHNhZDMgPSAwLCBzYWQ0ID0gMDsKLSAgICBJbnQgdG1wLCB0bXAyLCBtYXNrID0gMHgwMEZGMDBGRjsKLQotICAgIGNJbnQgPSAoSW50KiljdXI7ICAgLyogbWFrZSBzdXJlIHRoaXMgaXMgd29yZC1hbGlnbiAqLwotICAgIGNJbnQyID0gKEludCopKGN1ciArIChseCA8PCAzKSk7Ci0gICAgaiA9IDg7Ci0gICAgd2hpbGUgKGotLSkKLSAgICB7Ci0gICAgICAgIHRtcCA9IGNJbnRbM107ICAvKiBsb2FkIDQgcGl4ZWxzIGF0IGEgdGltZSAqLwotICAgICAgICB0bXAyID0gdG1wICYgbWFzazsKLSAgICAgICAgdG1wID0gKHRtcCA+PiA4KSAmIG1hc2s7Ci0gICAgICAgIHRtcCArPSB0bXAyOwotICAgICAgICBzYWQyICs9IHRtcDsKLSAgICAgICAgdG1wID0gY0ludFsyXTsKLSAgICAgICAgdG1wMiA9IHRtcCAmIG1hc2s7Ci0gICAgICAgIHRtcCA9ICh0bXAgPj4gOCkgJiBtYXNrOwotICAgICAgICB0bXAgKz0gdG1wMjsKLSAgICAgICAgc2FkMiArPSB0bXA7Ci0gICAgICAgIHRtcCA9IGNJbnRbMV07Ci0gICAgICAgIHRtcDIgPSB0bXAgJiBtYXNrOwotICAgICAgICB0bXAgPSAodG1wID4+IDgpICYgbWFzazsKLSAgICAgICAgdG1wICs9IHRtcDI7Ci0gICAgICAgIHNhZDEgKz0gdG1wOwotICAgICAgICB0bXAgPSAqY0ludDsKLSAgICAgICAgY0ludCArPSAobHggPj4gMik7Ci0gICAgICAgIHRtcDIgPSB0bXAgJiBtYXNrOwotICAgICAgICB0bXAgPSAodG1wID4+IDgpICYgbWFzazsKLSAgICAgICAgdG1wICs9IHRtcDI7Ci0gICAgICAgIHNhZDEgKz0gdG1wOwotCi0gICAgICAgIHRtcCA9IGNJbnQyWzNdOwotICAgICAgICB0bXAyID0gdG1wICYgbWFzazsKLSAgICAgICAgdG1wID0gKHRtcCA+PiA4KSAmIG1hc2s7Ci0gICAgICAgIHRtcCArPSB0bXAyOwotICAgICAgICBzYWQ0ICs9IHRtcDsKLSAgICAgICAgdG1wID0gY0ludDJbMl07Ci0gICAgICAgIHRtcDIgPSB0bXAgJi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9Wb3AoVUNoYXIgKmNvbXAsIEludCB5Q2hhbltdW05DT0VGRl9CTE9DS10sIEludCB3aWR0aCk7Ci0gICAgdm9pZCBDb3B5X0JfZnJvbV9Wb3AoVUNoYXIgKmNvbXAsIEludCBjQ2hhbltdLCBJbnQgd2lkdGgpOwotICAgIHZvaWQgQ29weV9NQl9pbnRvX1ZvcChVQ2hhciAqY29tcCwgSW50IHlDaGFuW11bTkNPRUZGX0JMT0NLXSwgSW50IHdpZHRoKTsKLSAgICB2b2lkIENvcHlfQl9pbnRvX1ZvcChVQ2hhciAqY29tcCwgSW50IGNDaGFuW10sIEludCB3aWR0aCk7Ci0gICAgdm9pZCBnZXRfTUIoVUNoYXIgKmNfcHJldiwgVUNoYXIgKmNfcHJldl91ICAsIFVDaGFyICpjX3ByZXZfdiwKLSAgICAgICAgICAgICAgICBTaG9ydCBtYls2XVs2NF0sIEludCBseCwgSW50IGx4X3V2KTsKLQotICAgIEludCBHZXRQcmVkQWR2QnkweDAoCi0gICAgICAgIFVDaGFyICpjX3ByZXYsICAgICAgLyogaSAqLwotICAgICAgICBVQ2hhciAqcHJlZF9ibG9jaywgICAgICAvKiBpICovCi0gICAgICAgIEludCBseCwgICAgIC8qIGkgKi8KLSAgICAgICAgSW50IHJuZDEgLyogaSAqLwotICAgICk7Ci0KLSAgICBJbnQgR2V0UHJlZEFkdkJ5MHgxKAotICAgICAgICBVQ2hhciAqY19wcmV2LCAgICAgIC8qIGkgKi8KLSAgICAgICAgVUNoYXIgKnByZWRfYmxvY2ssICAgICAgLyogaSAqLwotICAgICAgICBJbnQgbHgsICAgICAvKiBpICovCi0gICAgICAgIEludCBybmQxIC8qIGkgKi8KLSAgICApOwotCi0gICAgSW50IEdldFByZWRBZHZCeTF4MCgKLSAgICAgICAgVUNoYXIgKmNfcHJldiwgICAgICAvKiBpICovCi0gICAgICAgIFVDaGFyICpwcmVkX2Jsb2NrLCAgICAgIC8qIGkgKi8KLSAgICAgICAgSW50IGx4LCAgICAgLyogaSAqLwotICAgICAgICBJbnQgcm5kMSAvKiBpICovCi0gICAgKTsKLQotICAgIEludCBHZXRQcmVkQWR2QnkxeDEoCi0gICAgICAgIFVDaGFyICpjX3ByZXYsICAgICAgLyogaSAqLwotICAgICAgICBVQ2hhciAqcHJlZF9ibG9jaywgICAgICAvKiBpICovCi0gICAgICAgIEludCBseCwgICAgIC8qIGkgKi8KLSAgICAgICAgSW50IHJuZDEgLyogaSAqLwotICAgICk7Ci0KLSAgICBzdGF0aWMgSW50KCpjb25zdCBHZXRQcmVkQWR2QlRhYmxlWzJdWzJdKShVQ2hhciosIFVDaGFyKiwgSW50LCBJbnQpID0KLSAgICB7Ci0gICAgICAgIHsmR2V0UHJlZEFkdkJ5MHgwLCAmR2V0UHJlZEFkdkJ5MHgxfSwKLSAgICAgICAgeyZHZXRQcmVkQWR2QnkxeDAsICZHZXRQcmVkQWR2QnkxeDF9Ci0gICAgfTsKLQotCi0jaWZkZWYgX19jcGx1c3BsdXMKLX0KLSNlbmRpZgotCi0KLS8qID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PSAqLwotLyogIEZ1bmN0aW9uIDogZ2V0TW90aW9uQ29tcGVuc2F0ZWRNQiggKSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgRGF0ZSAgICAgOiA0LzE3LzIwMDEgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICBQdXJwb3NlICA6IEdldCB0aGUgbW90aW9uIGNvbXBlbnNhdGUgYmxvY2sgaW50byB2aWRlby0+cHJlZGljdGlvbk1CICAgICAqLwotLyogICAgICAgICAgICAgIGFuZCBnZW5lcmF0ZSB2aWRlby0+cHJlZGljdGlvbkVycm9yTUIgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgICAgICAgICAgICAgbW9kaWZpZWQgZnJvbSBNQk1vdGlvbkNvbXAoKSBmdW5jdGlvbiBpbiB0aGUgZGVjb2RlciAgICAgICAgKi8KLS8qICBJbi9vdXQgICA6ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogIFJldHVybiAgIDogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgTW9kaWZpZWQgOiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PSAqLwotCi12b2lkIGdldE1vdGlvbkNvbXBlbnNhdGVkTUIoVmlkZW9FbmNEYXRhICp2aWRlbywgSW50IGluZF94LCBJbnQgaW5kX3ksIEludCBvZmZzZXQpCi17Ci0gICAgVm9wICpwcmV2Vm9wID0gdmlkZW8tPmZvcndhcmRSZWZWb3A7IC8vcmVmZXJlbmNlIGZyYW1lCi0gICAgVm9wICpjdXJyVm9wID0gdmlkZW8tPmN1cnJWb3A7Ci0gICAgSW50IG1ibnVtID0gdmlkZW8tPm1ibnVtOyAgICAgICAvL21iIGluZGV4Ci0gICAgTU9UICptb3QgPSB2aWRlby0+bW90W21ibnVtXTsKLSAgICBJbnQgeXBvcywgeHBvczsKLSAgICBVQ2hhciAqY19wcmV2LCAqY3VfcHJldiwgKmN2X3ByZXY7Ci0gICAgVUNoYXIgKmNfcmVjLCAqY3VfcmVjLCAqY3ZfcmVjOwotICAgIEludCBoZWlnaHQsIHBpdGNoLCBwaXRjaF91diwgaGVpZ2h0X3V2OwotICAgIEludCBtb2RlID0gdmlkZW8tPmhlYWRlckluZm8uTW9kZVttYm51bV07ICAvKiBnZXQgbW9kZSAqLwotICAgIEludCBkeCwgZHk7Ci0gICAgSW50IHhwcmVkLCB5cHJlZDsKLSAgICBJ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b3RbNF0ueDsKLSAgICAgICAgeXN1bSA9IG1vdFsxXS55ICsgbW90WzJdLnkgKyBtb3RbM10ueSArIG1vdFs0XS55OwotCi0gICAgICAgIGR4ID0gUFZfU0lHTih4c3VtKSAqIChyb3VuZHRhYjE2WyhQVl9BQlMoeHN1bSkpICYgMHhGXSArCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoKChQVl9BQlMoeHN1bSkpID4+IDQpIDw8IDEpKTsKLSAgICAgICAgZHkgPSBQVl9TSUdOKHlzdW0pICogKHJvdW5kdGFiMTZbKFBWX0FCUyh5c3VtKSkgJiAweEZdICsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICgoKFBWX0FCUyh5c3VtKSkgPj4gNCkgPDwgMSkpOwotCi0gICAgICAgIHlwcmVkID0geXBvcyArIGR5OwotICAgICAgICB4cHJlZCA9IHhwb3MgKyBkeDsKLQotICAgICAgICBFbmNQcmVkaWN0aW9uX0Nocm9tKHhwcmVkLCB5cHJlZCwgY3VfcHJldiwgY3ZfcHJldiwgY3VfcmVjLCBjdl9yZWMsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgcGl0Y2hfdXYsIChjdXJyVm9wLT53aWR0aCkgPj4gMSwgaGVpZ2h0X3V2LCByb3VuZDEpOwotICAgIH0KLSNlbmRpZgotICAgIGVsc2UKLSAgICB7Ci0gICAgICAgIDsvL3ByaW50ZigiRXJyb3IsIE1PREVfU0tJUFBFRCBpcyBub3QgZGVjaWRlZCB5ZXQhXG4iKTsKLSAgICB9Ci0KLSAgICByZXR1cm4gOwotfQotCi0vKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCi0gICAgRnVuY3Rpb246ICAgRW5jUHJlZGljdGlvbl9JTlRFUgotICAgIERhdGU6ICAgICAgIDA0LzE3LzIwMDEKLSAgICBQdXJwb3NlOiAgICBHZXQgcHJlZGljdGVkIGFyZWEgZm9yIGx1bWluYW5jZSBhbmQgY29tcGVuc2F0ZSB3aXRoIHRoZSByZXNpZHVlLgotICAgICAgICAgICAgICAgIE1vZGlmaWVkIGZyb20gbHVtaW5hbmNlX3ByZWRfbW9kZV9pbnRlcigpIGluIGRlY29kZXIuCi0qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0KLXZvaWQgRW5jUHJlZGljdGlvbl9JTlRFUigKLSAgICBJbnQgeHByZWQsICAgICAgICAgIC8qIGkgKi8KLSAgICBJbnQgeXByZWQsICAgICAgICAgIC8qIGkgKi8KLSAgICBVQ2hhciAqY19wcmV2LCAgICAgICAgICAvKiBpICovCi0gICAgVUNoYXIgKmNfcmVjLCAgICAgICAvKiBpICovCi0gICAgSW50IGx4LCAgICAgICAgIC8qIGkgKi8KLSAgICBJbnQgcm91bmQxICAgICAgICAgIC8qIGkgKi8KLSkKLXsKLSAgICBjX3ByZXYgKz0gKHhwcmVkID4+IDEpICsgKCh5cHJlZCA+PiAxKSAqIGx4KTsKLQotICAgIEdldFByZWRBZHZCVGFibGVbeXByZWQmMV1beHByZWQmMV0oY19wcmV2LCBjX3JlYywgbHgsIHJvdW5kMSk7Ci0KLSAgICBjX3ByZXYgKz0gQl9TSVpFOwotICAgIGNfcmVjICs9IEJfU0laRTsKLQotICAgIEdldFByZWRBZHZCVGFibGVbeXByZWQmMV1beHByZWQmMV0oY19wcmV2LCBjX3JlYywgbHgsIHJvdW5kMSk7Ci0KLSAgICBjX3ByZXYgKz0gKGx4IDw8IDMpIC0gQl9TSVpFOwotICAgIGNfcmVjICs9ICgxNiA8PCAzKSAtIEJfU0laRTsgLyogcGFkZGluZyAqLwotCi0gICAgR2V0UHJlZEFkdkJUYWJsZVt5cHJlZCYxXVt4cHJlZCYxXShjX3ByZXYsIGNfcmVjLCBseCwgcm91bmQxKTsKLQotICAgIGNfcHJldiArPSBCX1NJWkU7Ci0gICAgY19yZWMgKz0gQl9TSVpFOwotCi0gICAgR2V0UHJlZEFkdkJUYWJsZVt5cHJlZCYxXVt4cHJlZCYxXShjX3ByZXYsIGNfcmVjLCBseCwgcm91bmQxKTsKLQotICAgIHJldHVybjsKLX0KLQotI2lmbmRlZiBOT19JTlRFUjRWCi0vKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCi0gICAgRnVuY3Rpb246ICAgRW5jUHJlZGljdGlvbl9JTlRFUjRWCi0gICAgRGF0ZTogICAgICAgMDQvMTcvMjAwMQotICAgIFB1cnBvc2U6ICAgIEdldCBwcmVkaWN0ZWQgYXJlYSBmb3IgbHVtaW5hbmNlIGFuZCBjb21wZW5zYXRlIHdpdGggdGhlIHJlc2lkdWUuCi0gICAgICAgICAgICAgICAgTW9kaWZpZWQgZnJvbSBsdW1pbmFuY2VfcHJlZF9tb2RlX2ludGVyNHYoKSBpbiBkZWNvZGVyLgotKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotCi12b2lkIEVuY1ByZWRpY3Rpb25fSU5URVI0VigKLSAgICBJbnQgeHBvcywgICAgICAgICAgIC8qIGkgKi8KLSAgICBJbnQgeXBvcywgICAgICAgICAgIC8qIGkgKi8KLSAgICBNT1QgKm1vdCwgICAgICAgICAgIC8qIGkgKi8KLSAgICBVQ2hhciAqY19wcmV2LCAgICAgICAgICAvKiBpICovCi0gICAgVUNoYXIgKmNfcmVjLCAgICAgICAgICAgLyogaSAqLwotICAgIEludCBseCwgICAgICAgICAvKiBpICovCi0gICAgSW50IHJvdW5kMSAgICAgICAgICAvKiBpICovCi0pCi17Ci0gICAgSW50IHlwcmVkLCB4cHJlZDsKLQotICAgIHhwcmVkID0gKEludCkoKHhwb3MgPDwgMSkgKyBtb3RbMV0ueCk7Ci0gICAgeXByZWQgPSAoSW50KSgoeXBvcyA8PCAxKSArIG1vdFsxXS55KTsKLQotICAgIEdldFByZWRBZHZCVGFibGVbeXByZWQmMV1beHByZWQmMV0oY19wcmV2ICsgKHhwcmVkID4+IDEpICsgKCh5cHJlZCA+PiAxKSpseCksCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjX3JlYywgbHgsIHJvdW5kMSk7Ci0KLSAgICBjX3JlYyArPSBCX1NJWkU7Ci0KLSAgICB4cHJlZCA9IChJbnQpKCgoeHBvcyArIEJfU0laRSkgPDwgMSkgKyBtb3RbMl0ueCk7Ci0gICAgeXByZWQgPSAoSW50KSgoeXBvcyA8PCAxKSArIG1vdFsyXS55KTsKLQotICAgIEdldFByZWRBZHZCVGFibGVbeXByZWQmMV1beHByZWQmMV0oY19wcmV2ICsgKHhwcmVkID4+IDEpICsgKCh5cHJlZCA+PiAxKSpseCksCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjX3JlYywgbHgsIHJvdW5kMSk7Ci0KLSAgICBjX3JlYyArPSAoMTYgPDwgMykgLSBCX1NJWkU7IC8qIHBhZGRpbmcgKi8KLQotICAgIHhwcmVkID0gKEludCkoKHhwb3MgPDwgMSkgKyBtb3RbM10ueCk7Ci0gICAgeXByZWQgPSAoSW50KSgoKHlwb3MgKyBCX1NJWkUpIDw8IDEpICsgbW90WzNdLnkpOwotCi0gICAgR2V0UHJlZEFkdkJUYWJsZVt5cHJlZCYxXVt4cHJlZCYxXShjX3ByZXYgKyAoeHByZWQgPj4gMSkgKyAoKHlwcmVkID4+IDEpKmx4KSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNfcmVjLCBseCwgcm91bmQxKTsKLQotICAgIGNfcmVjICs9IEJfU0laRTsKLQotICAgIHhwcmVkID0gKEludCkoKCh4cG9zICsgQl9TSVpFKSA8PCAxKSArIG1vdFs0XS54KTsKLSAgICB5cHJlZCA9IChJbnQpKCgoeXBvcyArIEJfU0laRSkgPDwgMSkgKyBtb3RbNF0ueSk7Ci0KLSAgICBHZXRQcmVkQWR2QlRhYmxlW3lwcmVkJjFdW3hwcmVkJjFdKGNfcHJldiArICh4cHJlZCA+PiAxKSArICgoeXByZWQgPj4gMSkqbHgpLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY19yZWMsIGx4LCByb3VuZDEpOwotCi0gICAgcmV0dXJuOwotfQotI2VuZGlmIC8qIE5PX0lOVEVSNFYgKi8KLQotLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgotICAgIEZ1bmN0aW9uOiAgIEVuY1ByZWRpY3Rpb25fQ2hyb20KLSAgICBEYXRlOiAgICAgICAwNC8xNy8yMDAxCi0gICAgUHVycG9zZTogICAgR2V0IHByZWRpY3RlZCBhcmVhIGZvciBjaHJvbWluYW5jZSBhbmQgY29tcGVuc2F0ZSB3aXRoIHRoZSByZXNpZHVlLgotICAgICAgICAgICAgICAgIE1vZGlmaWVkIGZyb20gY2hyb21pbmFuY2VfcHJlZCgpIGluIGRlY29kZXIuCi0qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0KLXZvaWQgRW5jUHJlZGljdGlvbl9DaHJvbSgKLSAgICBJbnQgeHByZWQsICAgICAgICAgIC8qIGkgKi8KLSAgICBJbnQgeXByZWQsICAgICAgICAgIC8qIGkgKi8KLSAgICBVQ2hhciAqY3VfcHJldiwgICAgICAgICAvKiBpICovCi0gICAgVUNoYXIgKmN2X3ByZXYsICAgICAgICAgLyogaSAqLwotICAgIFVDaGFyICpjdV9yZWMsCi0gICAgVUNoYXIgKmN2X3JlYywKLSAgICBJbnQgbHgsCi0gICAgSW50IHdpZHRoX3V2LCAgICAgICAgICAgLyogaSAqLwotICAgIEludCBoZWlnaHRfdXYsICAgICAgICAgIC8qIGkgKi8KLSAgICBJbnQgcm91bmQxICAgICAgICAgIC8qIGkgKi8KLSkKLXsKLSAgICAvKiBjaGVjayB3aGV0aGVyIHRoZSBNViBwb2ludHMgb3V0c2lkZSB0aGUgZnJhbWUgKi8KLSAgICAvKiBDb21wdXRlIHByZWRpY3Rpb24gZm9yIENocm9taW5hbmNlIGIgYmxvY2sgKGJsb2NrWzRdKSAqLwotICAgIGlmICh4cHJlZCA+PSAwICYmIHhwcmVkIDw9ICgod2lkdGhfdXYgPDwgMSkgLSAoMipCX1NJWkUpKSAmJiB5cHJlZCA+PSAwICYmCi0gICAgICAgICAgICB5cHJlZCA8PSAoKGhlaWdodF91diA8PCAxKSAtICgyKkJfU0laRSkpKQotICAgIHsKLSAgICAgICAgLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotICAgICAgICAvKiAoeCx5KSBpcyBpbnNpZGUgdGhlIGZyYW1lICovCi0gICAgICAgIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLQotICAgICAgICAvKiBDb21wdXRlIHByZWRpY3Rpb24gZm9yIENocm9taW5hbmNlIGIgKGJsb2NrWzRdKSAqLwotICAgICAgICBHZXRQcmVkQWR2QlRhYmxlW3lwcmVkJjFdW3hwcmVkJjFdKGN1X3ByZXYgKyAoeHByZWQgPj4gMSkgKyAoKHlwcmVkID4+IDEpKmx4KSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjdV9yZWMsIGx4LCByb3VuZDEpOwotCi0gICAgICAgIC8qIENvbXB1dGUgcHJlZGljdGlvbiBmb3IgQ2hyb21pbmFuY2UgciAoYmxvY2tbNV0pICovCi0gICAgICAgIEdldFByZWRBZHZCVGFibGVbeXByZWQmMV1beHByZWQmMV0oY3ZfcHJldiArICh4cHJlZCA+PiAxKSArICgoeXByZWQgPj4gMSkqbHgpLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGN2X3JlYywgIGx4LCByb3VuZDEpOwotICAgIH0KLSAgICBlbHNlCi0gICAgewotICAgICAgICAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotICAgICAgICAvKiAoeCx5KSBpcyBvdXRzaWRlIHRoZSBmcmFtZSAqLwotICAgICAgICAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotCi0gICAgICAgIC8qIENvbXB1dGUgcHJlZGljdGlvbiBmb3IgQ2hyb21pbmFuY2UgYiAoYmxvY2tbNF0pICovCi0gICAgICAgIEVuY0dldFByZWRPdXRzaWRlKHhwcmVkLCB5cHJlZCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgY3VfcHJldiwgY3VfcmVjLAotICAgICAgICAgICAgICAgICAgICAgICAgICB3aWR0aF91diwgaGVpZ2h0X3V2LCByb3VuZDEpOwotCi0gICAgICAgIC8qIENvbXB1dGUgcHJlZGljdGlvbiBmb3IgQ2hyb21pbmFuY2UgciAoYmxvY2tbNV0pICovCi0gICAgICAgIEVuY0dldFByZWRPdXRzaWRlKHhwcmVkLCB5cHJlZCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgY3ZfcHJldiwgY3ZfcmVjLAotICAgICAgICAgICAgICAgICAgICAgICAgICB3aWR0aF91diwgaGVpZ2h0X3V2LCByb3VuZDEpOwotICAgIH0KLQotICAgIHJldHVybjsKLX0KLS8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKLSAgICBGdW5jdGlvbjogICBHZXRQcmVkQWR2YW5jZWRCCi0gICAgRGF0ZTogICAgICAgMDQvMTcvMjAwMQotICAgIFB1cnBvc2U6ICAgIEdldCBwcmVkaWN0ZWQgYXJlYSAoYmxvY2spIGFuZCBjb21wZW5zYXRlIHdpdGggdGhlIHJlc2lkdWUuCi0gICAgICAgICAgICAgICAgLSBtb2RpZmllZCBmcm9tIEdldFByZWRBZHZhbmNlZEJBZGQgaW4gZGVjb2Rlci4KLSAgICBJbnRwdXQvT3V0cHV0OgotICAgIE1vZGlmaWVkOgotKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotCi1JbnQgR2V0UHJlZEFkdkJ5MHgwKAotICAgIFVDaGFyICpwcmV2LCAgICAgICAgLyogaSAqLwotICAgIFVDaGFyICpyZWMsICAgICAvKiBpICovCi0gICAgSW50IGx4LCAgICAgLyogaSAqLwotICAgIEludCBybmQgLyogaSAqLwotKQotewotICAgIEludCBpOyAgICAgIC8qIGxvb3AgdmFyaWFibGUgKi8KLSAgICBVTG9uZyAgcHJlZF93b3JkLCB3b3JkMSwgd29yZDI7Ci0gICAgSW50IHRtcDsKLQotICAgIE9TQ0xfVU5VU0VEX0FSRyhybmQpOwotCi0gICAgLyogaW5pdGlhbGl6ZSBvZmZzZXQgdG8gYWRqdXN0IHBpeGVsIGNvdW50ZXIgKi8KLSAgICAvKiAgICB0aGUgbmV4dCByb3c7IGZ1bGwtcGVsIHJlc29sdXRpb24gICAgICAqLwotCi0gICAgdG1wID0gKFVMb25nKXByZXYgJiAweDM7Ci0KLSAgICBpZiAodG1wID09IDApICAvKiB3b3JkLWFsaWduZWQgKi8KLSAgICB7Ci0gICAgICAgIHJlYyAtPSAxNjsgLyogcHJlc2V0ICovCi0gICAgICAgIHByZXYgLT0gbHg7Ci0KLSAgICAgICAgZm9yIChpID0gODsgaSA+IDA7IGktLSkKLSAgICAgICAgewotICAgICAgICAgICAgKigoVUxvbmcqKShyZWMgKz0gMTYpKSA9ICooKFVMb25nKikocHJldiArPSBseCkpOwotICAgICAgICAgICAgKigoVUxvbmcqKShyZWMgKyA0KSkgPSAqKChVTG9uZyopKHByZXYgKyA0KSk7Ci0gICAgICAgIH0KLSAgICAgICAgcmV0dXJuIDE7Ci0gICAgfQotICAgIGVsc2UgaWYgKHRtcCA9PSAxKSAvKiBmaXJzdCBwb3NpdGlvbiAqLwotICAgIHsKLSAgICAgICAgcHJldi0tOyAvKiB3b3JkLWFsaWduZWQgKi8KLSAgICAgICAgcmVjIC09IDE2OyAvKiBwcmVzZXQgKi8KLSAgICAgICAgcHJldiAtPSBseDsKLQotICAgICAgICBmb3IgKGkgPSA4OyBpID4gMDsgaS0tKQotICAgICAgICB7Ci0gICAgICAgICAgICB3b3JkMSA9ICooKFVMb25nKikocHJldiArPSBseCkpOyAvKiByZWFkIDQgYnl0ZXMsIGI0IGIzIGIyIGIxICovCi0gICAgICAgICAgICB3b3JkMiA9ICooKFVMb25nKikocHJldiArIDQpKTsgIC8qIHJlYWQgNCBieXRlcywgYjggYjcgYjYgYjUgKi8KLSAgICAgICAgICAgIHdvcmQxID4+PSA4OyAvKiAwIGI0IGIzIGIyICovCi0gICAgICAgICAgICBwcmVkX3dvcmQgPSB3b3JkMSB8ICh3b3JkMiA8PCAyNCk7ICAvKiBiNSBiNCBiMyBiMiAqLwotICAgICAgICAgICAgKigoVUxvbmcqKShyZWMgKz0gMTYpKSA9IHByZWRfd29yZDsKLQotICAgICAgICAgICAgd29yZDEgPSAqKChVTG9uZyopKHByZXYgKyA4KSk7IC8qIGIxMiBiMTEgYjEwIGI5ICovCi0gICAgICAgICAgICB3b3JkMiA+Pj0gODsgLyogMCBiOCBiNyBiNiAqLwotICAgICAgICAgICAgcHJlZF93b3JkID0gd29yZDIgfCAod29yZDEgPDwgMjQpOyAvKiBiOSBiOCBiNyBiNiAqLwotICAgICAgICAgICAgKigoVUxvbmcqKShyZWMgKyA0KSkgPSBwcmVkX3dvcmQ7Ci0gICAgICAgIH0KLQotICAgICAgICByZXR1cm4gMTsKLSAgICB9Ci0gICAgZWxzZSBpZiAodG1wID09IDIpIC8qIHNlY29uZCBwb3NpdGlvbiAqLwotICAgIHsKLSAgICAgICAgcHJldiAtPSAyOyAvKiB3b3JkMS1hbGlnbmVkICovCi0gICAgICAgIHJlYyAtPSAxNjsgLyogcHJlc2V0ICovCi0gICAgICAgIHByZXYgLT0gbHg7Ci0KLSAgICAgICAgZm9yIChpID0gODsgaSA+IDA7IGktLSkKLSAgICAgICAgewotICAgICAgICAgICAgd29yZDEgPSAqKChVTG9uZyopKHByZXYgKz0gbHgpKTsgLyogcmVhZCA0IGJ5dGVzLCBiNCBiMyBiMiBiMSAqLwotICAgICAgICAgICAgd29yZDIgPSAqKChVTG9uZyopKHByZXYgKyA0KSk7ICAvKiByZWFkIDQgYnl0ZXMsIGI4IGI3IGI2IGI1ICovCi0gICAgICAgICAgICB3b3JkMSA+Pj0gMTY7IC8qIDAgMCBiNCBiMyAqLwotICAgICAgICAgICAgcHJlZF93b3JkID0gd29yZDEgfCAod29yZDIgPDwgMTYpOyAgLyogYjYgYjUgYjQgYjMgKi8KLSAgICAgICAgICAgICooKFVMb25nKikocmVjICs9IDE2KSkgPSBwcmVkX3dvcmQ7Ci0KLSAgICAgICAgICAgIHdvcmQxID0gKigoVUxvbmcqKShwcmV2ICsgOCkpOyAvKiBiMTIgYjExIGIxMCBiOSAqLwotICAgICAgICAgICAgd29yZDIgPj49IDE2OyAvKiAwIDAgYjggYjcgKi8KLSAgICAgICAgICAgIHByZWRfd29yZCA9IHdvcmQyIHwgKHdvcmQxIDw8IDE2KTsgLyogYjEwIGI5IGI4IGI3ICovCi0gICAgICAgICAgICAqKChVTG9uZyopKHJlYyArIDQpKSA9IHByZWRfd29yZDsKLSAgICAgICAgfQotCi0gICAgICAgIHJldHVybiAxOwotICAgIH0KLSAgICBlbHNlIC8qIHRoaXJkIHBvc2l0aW9uICovCi0gICAgewotICAgICAgICBwcmV2IC09IDM7IC8qIHdvcmQxLWFsaWduZWQgKi8KLSAgICAgICAgcmVjIC09IDE2OyAvKiBwcmVzZXQgKi8KLSAgICAgICAgcHJldiAtPSBseDsKLQotICAgICAgICBmb3IgKGkgPSA4OyBpID4gMDsgaS0tKQotICAgICAgICB7Ci0gICAgICAgICAgICB3b3JkMSA9ICooKFVMb25nKikocHJldiArPSBseCkpOyAvKiByZWFkIDQgYnl0ZXMsIGI0IGIzIGIyIGIxICovCi0gICAgICAgICAgICB3b3JkMiA9ICooKFVMb25nKikocHJldiArIDQpKTsgIC8qIHJlYWQgNCBieXRlcywgYjggYjcgYjYgYjUgKi8KLSAgICAgICAgICAgIHdvcmQxID4+PSAyNDsgLyogMCAwIDAgYjQgKi8KLSAgICAgICAgICAgIHByZWRfd29yZCA9IHdvcmQxIHwgKHdvcmQyIDw8IDgpOyAgIC8qIGI3IGI2IGI1IGI0ICovCi0gICAgICAgICAgICAqKChVTG9uZyopKHJlYyArPSAxNikpID0gcHJlZF93b3JkOwotCi0gICAgICAgICAgICB3b3JkMSA9ICooKFVMb25nKikocHJldiArIDgpKTsgLyogYjEyIGIxMSBiMTAgYjkgKi8KLSAgICAgICAgICAgIHdvcmQyID4+PSAyNDsgLyogMCAwIDAgYjggKi8KLSAgICAgICAgICAgIHByZWRfd29yZCA9IHdvcmQyIHwgKHdvcmQxIDw8IDgpOyAvKiBiMTEgYjEwIGI5IGI4ICovCi0gICAgICAgICAgICAqKChVTG9uZyopKHJlYyArIDQpKSA9IHByZWRfd29yZDsKLQotICAgICAgICB9Ci0KLSAgICAgICAgcmV0dXJuIDE7Ci0gICAgfQotfQotLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotSW50IEdldFByZWRBZHZCeTB4MSgKLSAgICBVQ2hhciAqcHJldiwgICAgICAgIC8qIGkgKi8KLSAgICBVQ2hhciAqcmVjLCAgICAgLyogaSAqLwotICAgIEludCBseCwgICAgIC8qIGkgKi8KLSAgICBJbnQgcm5kMSAvKiBpICovCi0pCi17Ci0gICAgSW50IGk7ICAgICAgLyogbG9vcCB2YXJpYWJsZSAqLwotICAgIEludCBvZmZzZXQ7Ci0gICAgVUxvbmcgd29yZDEsIHdvcmQyLCB3b3JkMywgd29yZDEyOwotICAgIEludCB0bXA7Ci0gICAgVUxvbmcgbWFzazsKLQotICAgIC8qIGluaXRpYWxpemUgb2Zmc2V0IHRvIGFkanVzdCBwaXhlbCBjb3VudGVyICovCi0gICAgLyogICAgdGhlIG5leHQgcm93OyBmdWxsLXBlbCByZXNvbHV0aW9uICAgICAgKi8KLSAgICBvZmZzZXQgPSBseCAtIEJfU0laRTsgLyogb2Zmc2V0IGZvciBwcmV2ICovCi0KLSAgICAvKiBCcmFuY2ggYmFzZWQgb24gcGl4ZWwgbG9jYXRpb24gKGhhbGYtcGVsIG9yIGZ1bGwtcGVsKSBmb3IgeCBhbmQgeSAqLwotICAgIHJlYyAtPSAxMjsgLyogcHJlc2V0ICovCi0KLSAgICB0bXAgPSAoVUxvbmcpcHJldiAmIDM7Ci0gICAgbWFzayA9IDI1NDsKLSAgICBtYXNrIHw9IChtYXNrIDw8IDgpOwotICAgIG1hc2sgfD0gKG1hc2sgPDwgMTYpOyAvKiAweEZFRkVGRUZFICovCi0KLSAgICBpZiAodG1wID09IDApIC8qIHdvcmQtYWxpZ25lZCAqLwotICAgIHsKLSAgICAgICAgaWYgKHJuZDEgPT0gMSkKLSAgICAgICAgewotICAgICAgICAgICAgZm9yIChpID0gQl9TSVpFOyBpID4gMDsgaS0tKQotICAgICAgICAgICAgewotICAgICAgICAgICAgICAgIHdvcmQxID0gKigoVUxvbmcqKXByZXYpOyAvKiBiNCBiMyBiMiBiMSAqLwotICAgICAgICAgICAgICAgIHdvcmQyID0gKigoVUxvbmcqKShwcmV2ICs9IDQpKTsgLyogYjggYjcgYjYgYjUgKi8KLSAgICAgICAgICAgICAgICB3b3JkMTIgPSAod29yZDEgPj4gOCk7IC8qIDAgYjQgYjMgYjIgKi8KLSAgICAgICAgICAgICAgICB3b3JkMTIgfD0gKHdvcmQyIDw8IDI0KTsgLyogYjUgYjQgYjMgYjIgKi8KLSAgICAgICAgICAgICAgICB3b3JkMyA9IHdvcmQxIHwgd29yZDEyOyAvLyBybmQxID0gMTsgb3RoZXJ3aXNlIHdvcmQzID0gd29yZDEmd29yZDEyCi0gICAgICAgICAgICAgICAgd29yZDEgJj0gbWFzazsKLSAgICAgICAgICAgICAgICB3b3JkMyAmPSAofm1hc2spOyAvKiAweDEwMTAxMDEsIGNoZWNrIGxhc3QgYml0ICovCi0gICAgICAgICAgICAgICAgd29yZDEyICY9IG1hc2s7Ci0gICAgICAgICAgICAgICAgd29yZDEgPj49IDE7Ci0gICAgICAgICAgICAgICAgd29yZDEgPSB3b3JkMSArICh3b3JkMTIgPj4gMSk7Ci0gICAgICAgICAgICAgICAgd29yZDEgKz0gd29yZDM7Ci0gICAgICAgICAgICAgICAgKigoVUxvbmcqKShyZWMgKz0gMTIpKSA9IHdvcmQxOyAvKiB3cml0ZSA0IHBpeGVscyAqLwotCi0gICAgICAgICAgICAgICAgd29yZDEgPSAqKChVTG9uZyopKHByZXYgKz0gNCkpOyAvKiBiMTIgYjExIGIxMCBiOSAqLwotICAgICAgICAgICAgICAgIHdvcmQxMiA9ICh3b3JkMiA+PiA4KTsgLyogMCBiOCBiNyBiNiAqLwotICAgICAgICAgICAgICAgIHdvcmQxMiB8PSAod29yZDEgPDwgMjQpOyAvKiBiOSBiOCBiNyBiNiAqLwotICAgICAgICAgICAgICAgIHdvcmQzID0gd29yZDIgfCB3b3JkMTI7Ci0gICAgICAgICAgICAgICAgd29yZDIgJj0gbWFzazsKLSAgICAgICAgICAgICAgICB3b3JkMyAmPSAofm1hc2spOyAgLyogMHgxMDEwMTAxLCBjaGVjayBsYXN0IGJpdCAqLwotICAgICAgICAgICAgICAgIHdvcmQxMiAmPSBtYXNrOwotICAgICAgICAgICAgICAgIHdvcmQyID4+PSAxOwotICAgICAgICAgICAgICAgIHdvcmQyID0gd29yZDIgKyAod29yZDEyID4+IDEpOwotICAgICAgICAgICAgICAgIHdvcmQyICs9IHdvcmQzOwotICAgICAgICAgICAgICAgICooKFVMb25nKikocmVjICs9IDQpKSA9IHdvcmQyOyAvKiB3cml0ZSA0IHBpeGVscyAqLwotCi0gICAgICAgICAgICAgICAgcHJldiArPSBvZmZzZXQ7Ci0gICAgICAgICAgICB9Ci0gICAgICAgICAgICByZXR1cm4gMTsKLSAgICAgICAgfQotICAgICAgICBlbHNlIC8qIHJuZDEgPT0gMCAqLwotICAgICAgICB7Ci0gICAgICAgICAgICBmb3IgKGkgPSBCX1NJWkU7IGkgPiAwOyBpLS0pCi0gICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgd29yZDEgPSAqKChVTG9uZyopcHJldik7IC8qIGI0IGIzIGIyIGIxICovCi0KLSAgICAgICAgICAgICAgICB3b3JkMiA9ICooKFVMb25nKikocHJldiArPSA0KSk7IC8qIGI4IGI3IGI2IGI1ICovCi0gICAgICAgICAgICAgICAgd29yZDEyID0gKHdvcmQxID4+IDgpOyAvKiAwIGI0IGIzIGIyICovCi0gICAgICAgICAgICAgICAgd29yZDEyIHw9ICh3b3JkMiA8PCAyNCk7IC8qIGI1IGI0IGIzIGIyICovCi0gICAgICAgICAgICAgICAgd29yZDMgPSB3b3JkMSAmIHdvcmQxMjsgLy8gcm5kMSA9IDE7IG90aGVyd2lzZSB3b3JkMyA9IHdvcmQxJndvcmQxMgotICAgICAgICAgICAgICAgIHdvcmQxICY9IG1hc2s7Ci0gICAgICAgICAgICAgICAgd29yZDMgJj0gKH5tYXNrKTsgLyogMHgxMDEwMTAxLCBjaGVjayBsYXN0IGJpdCAqLwotICAgICAgICAgICAgICAgIHdvcmQxMiAmPSBtYXNrOwotICAgICAgICAgICAgICAgIHdvcmQxID4+PSAxOwotICAgICAgICAgICAgICAgIHdvcmQxID0gd29yZDEgKyAod29yZDEyID4+IDEpOwotICAgICAgICAgICAgICAgIHdvcmQxICs9IHdvcmQzOwotICAgICAgICAgICAgICAgICooKFVMb25nKikocmVjICs9IDEyKSkgPSB3b3JkMTsgLyogd3JpdGUgNCBwaXhlbHMgKi8KLQotICAgICAgICAgICAgICAgIHdvcmQxID0gKigoVUxvbmcqKShwcmV2ICs9IDQpKTsgLyogYjEyIGIxMSBiMTAgYjkgKi8KLSAgICAgICAgICAgICAgICB3b3JkMTIgPSAod29yZDIgPj4gOCk7IC8qIDAgYjggYjcgYjYgKi8KLSAgICAgICAgICAgICAgICB3b3JkMTIgfD0gKHdvcmQxIDw8IDI0KTsgLyogYjkgYjggYjcgYjYgKi8KLSAgICAgICAgICAgICAgICB3b3JkMyA9IHdvcmQyICYgd29yZDEyOwotICAgICAgICAgICAgICAgIHdvcmQyICY9IG1hc2s7Ci0gICAgICAgICAgICAgICAgd29yZDMgJj0gKH5tYXNrKTsgIC8qIDB4MTAxMDEwMSwgY2hlY2sgbGFzdCBiaXQgKi8KLSAgICAgICAgICAgICAgICB3b3JkMTIgJj0gbWFzazsKLSAgICAgICAgICAgICAgICB3b3JkMiA+Pj0gMTsKLSAgICAgICAgICAgICAgICB3b3JkMiA9IHdvcmQyICsgKHdvcmQxMiA+PiAxKTsKLSAgICAgICAgICAgICAgICB3b3JkMiArPSB3b3JkMzsKLSAgICAgICAgICAgICAgICAqKChVTG9uZyopKHJlYyArPSA0KSkgPSB3b3JkMjsgLyogd3JpdGUgNCBwaXhlbHMgKi8KLQotICAgICAgICAgICAgICAgIHByZXYgKz0gb2Zmc2V0OwotICAgICAgICAgICAgfQotICAgICAgICAgICAgcmV0dXJuIDE7Ci0gICAgICAgIH0gLyogcm5kMSAqLwotICAgIH0KLSAgICBlbHNlIGlmICh0bXAgPT0gMSkKLSAgICB7Ci0gICAgICAgIHByZXYtLTsgLyogd29yZC1hbGlnbmVkICovCi0gICAgICAgIGlmIChybmQxID09IDEpCi0gICAgICAgIHsKLSAgICAgICAgICAgIGZvciAoaSA9IEJfU0laRTsgaSA+IDA7IGktLSkKLSAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICB3b3JkMSA9ICooKFVMb25nKilwcmV2KTsgLyogYjMgYjIgYjEgYjAgKi8KLSAgICAgICAgICAgICAgICB3b3JkMiA9ICooKFVMb25nKikocHJldiArPSA0KSk7IC8qIGI3IGI2IGI1IGI0ICovCi0gICAgICAgICAgICAgICAgd29yZDEyID0gKHdvcmQxID4+IDgpOyAvKiAwIGIzIGIyIGIxICovCi0gICAgICAgICAgICAgICAgd29yZDEgPj49IDE2OyAvKiAwIDAgYjMgYjIgKi8KLSAgICAgICAgICAgICAgICB3b3JkMTIgfD0gKHdvcmQyIDw8IDI0KTsgLyogYjQgYjMgYjIgYjEgKi8KLSAgICAgICAgICAgICAgICB3b3JkMSB8PSAod29yZDIgPDwgMTYpOyAvKiBiNSBiNCBiMyBiMiAqLwotICAgICAgICAgICAgICAgIHdvcmQzID0gd29yZDEgfCB3b3JkMTI7IC8vIHJuZDEgPSAxOyBvdGhlcndpc2Ugd29yZDMgPSB3b3JkMSZ3b3JkMTIKLSAgICAgICAgICAgICAgICB3b3JkMSAmPSBtYXNrOwotICAgICAgICAgICAgICAgIHdvcmQzICY9ICh+bWFzayk7IC8qIDB4MTAxMDEwMSwgY2hlY2sgbGFzdCBiaXQgKi8KLSAgICAgICAgICAgICAgICB3b3JkMTIgJj0gbWFzazsKLSAgICAgICAgICAgICAgICB3b3JkMSA+Pj0gMTsKLSAgICAgICAgICAgICAgICB3b3JkMSA9IHdvcmQxICsgKHdvcmQxMiA+PiAxKTsKLSAgICAgICAgICAgICAgICB3b3JkMSArPSB3b3JkMzsKLSAgICAgICAgICAgICAgICAqKChVTG9uZyopKHJlYyArPSAxMikpID0gd29yZDE7IC8qIHdyaXRlIDQgcGl4ZWxzICovCi0KLSAgICAgICAgICAgICAgICB3b3JkMSA9ICooKFVMb25nKikocHJldiArPSA0KSk7IC8qIGIxMSBiMTAgYjkgYjggKi8KLSAgICAgICAgICAgICAgICB3b3JkMTIgPSAod29yZDIgPj4gOCk7IC8qIDAgYjcgYjYgYjUgKi8KLSAgICAgICAgICAgICAgICB3b3JkMiA+Pj0gMTY7IC8qIDAgMCBiNyBiNiAqLwotICAgICAgICAgICAgICAgIHdvcmQxMiB8PSAod29yZDEgPDwgMjQpOyAvKiBiOCBiNyBiNiBiNSAqLwotICAgICAgICAgICAgICAgIHdvcmQyIHw9ICh3b3JkMSA8PCAxNik7IC8qIGI5IGI4IGI3IGI2ICovCi0gICAgICAgICAgICAgICAgd29yZDMgPSB3b3JkMiB8IHdvcmQxMjsgLy8gcm5kMSA9IDE7IG90aGVyd2lzZSB3b3JkMyA9IHdvcmQyJndvcmQxMgotICAgICAgICAgICAgICAgIHdvcmQyICY9IG1hc2s7Ci0gICAgICAgICAgICAgICAgd29yZDMgJj0gKH5tYXNrKTsgLyogMHgxMDEwMTAxLCBjaGVjayBsYXN0IGJpdCAqLwotICAgICAgICAgICAgICAgIHdvcmQxMiAmPSBtYXNrOwotICAgICAgICAgICAgICAgIHdvcmQyID4+PSAxOwotICAgICAgICAgICAgICAgIHdvcmQyID0gd29yZDIgKyAod29yZDEyID4+IDEpOwotICAgICAgICAgICAgICAgIHdvcmQyICs9IHdvcmQzOwotICAgICAgICAgICAgICAgICooKFVMb25nKikocmVjICs9IDQpKSA9IHdvcmQyOyAvKiB3cml0ZSA0IHBpeGVscyAqLwotCi0gICAgICAgICAgICAgICAgcHJldiArPSBvZmZzZXQ7Ci0gICAgICAgICAgICB9Ci0gICAgICAgICAgICByZXR1cm4gMTsKLSAgICAgICAgfQotICAgICAgICBlbHNlIC8qIHJuZDEgPSAwICovCi0gICAgICAgIHsKLSAgICAgICAgICAgIGZvciAoaSA9IEJfU0laRTsgaSA+IDA7IGktLSkKLSAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICB3b3JkMSA9ICooKFVMb25nKilwcmV2KTsgLyogYjMgYjIgYjEgYjAgKi8KLQotICAgICAgICAgICAgICAgIHdvcmQyID0gKigoVUxvbmcqKShwcmV2ICs9IDQpKTsgLyogYjcgYjYgYjUgYjQgKi8KLSAgICAgICAgICAgICAgICB3b3JkMTIgPSAod29yZDEgPj4gOCk7IC8qIDAgYjMgYjIgYjEgKi8KLSAgICAgICAgICAgICAgICB3b3JkMSA+Pj0gMTY7IC8qIDAgMCBiMyBiMiAqLwotICAgICAgICAgICAgICAgIHdvcmQxMiB8PSAod29yZDIgPDwgMjQpOyAvKiBiNCBiMyBiMiBiMSAqLwotICAgICAgICAgICAgICAgIHdvcmQxIHw9ICh3b3JkMiA8PCAxNik7IC8qIGI1IGI0IGIzIGIyICovCi0gICAgICAgICAgICAgICAgd29yZDMgPSB3b3JkMSAmIHdvcmQxMjsKLSAgICAgICAgICAgICAgICB3b3JkMSAmPSBtYXNrOwotICAgICAgICAgICAgICAgIHdvcmQzICY9ICh+bWFzayk7IC8qIDB4MTAxMDEwMSwgY2hlY2sgbGFzdCBiaXQgKi8KLSAgICAgICAgICAgICAgICB3b3JkMTIgJj0gbWFzazsKLSAgICAgICAgICAgICAgICB3b3JkMSA+Pj0gMTsKLSAgICAgICAgICAgICAgICB3b3JkMSA9IHdvcmQxICsgKHdvcmQxMiA+PiAxKTsKLSAgICAgICAgICAgICAgICB3b3JkMSArPSB3b3JkMzsKLSAgICAgICAgICAgICAgICAqKChVTG9uZyopKHJlYyArPSAxMikpID0gd29yZDE7IC8qIHdyaXRlIDQgcGl4ZWxzICovCi0KLSAgICAgICAgICAgICAgICB3b3JkMSA9ICooKFVMb25nKikocHJldiArPSA0KSk7IC8qIGIxMSBiMTAgYjkgYjggKi8KLSAgICAgICAgICAgICAgICB3b3JkMTIgPSAod29yZDIgPj4gOCk7IC8qIDAgYjcgYjYgYjUgKi8KLSAgICAgICAgICAgICAgICB3b3JkMiA+Pj0gMTY7IC8qIDAgMCBiNyBiNiAqLwotICAgICAgICAgICAgICAgIHdvcmQxMiB8PSAod29yZDEgPDwgMjQpOyAvKiBiOCBiNyBiNiBiNSAqLwotICAgICAgICAgICAgICAgIHdvcmQyIHw9ICh3b3JkMSA8PCAxNik7IC8qIGI5IGI4IGI3IGI2ICovCi0gICAgICAgICAgICAgICAgd29yZDMgPSB3b3JkMiAmIHdvcmQxMjsKLSAgICAgICAgICAgICAgICB3b3JkMiAmPSBtYXNrOwotICAgICAgICAgICAgICAgIHdvcmQzICY9ICh+bWFzayk7IC8qIDB4MTAxMDEwMSwgY2hlY2sgbGFzdCBiaXQgKi8KLSAgICAgICAgICAgICAgICB3b3JkMTIgJj0gbWFzazsKLSAgICAgICAgICAgICAgICB3b3JkMiA+Pj0gMTsKLSAgICAgICAgICAgICAgICB3b3JkMiA9IHdvcmQyICsgKHdvcmQxMiA+PiAxKTsKLSAgICAgICAgICAgICAgICB3b3JkMiArPSB3b3JkMzsKLSAgICAgICAgICAgICAgICAqKChVTG9uZyopKHJlYyArPSA0KSkgPSB3b3JkMjsgLyogd3JpdGUgNCBwaXhlbHMgKi8KLQotICAgICAgICAgICAgICAgIHByZXYgKz0gb2Zmc2V0OwotICAgICAgICAgICAgfQotICAgICAgICAgICAgcmV0dXJuIDE7Ci0gICAgICAgIH0gLyogcm5kMSAqLwotICAgIH0KLSAgICBlbHNlIGlmICh0bXAgPT0gMikKLSAgICB7Ci0gICAgICAgIHByZXYgLT0gMjsgLyogd29yZC1hbGlnbmVkICovCi0gICAgICAgIGlmIChybmQxID09IDEpCi0gICAgICAgIHsKLSAgICAgICAgICAgIGZvciAoaSA9IEJfU0laRTsgaSA+IDA7IGktLSkKLSAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICB3b3JkMSA9ICooKFVMb25nKilwcmV2KTsgLyogYjIgYjEgYjAgYk4xICovCi0gICAgICAgICAgICAgICAgd29yZDIgPSAqKChVTG9uZyopKHByZXYgKz0gNCkpOyAvKiBiNiBiNSBiNCBiMyAqLwotICAgICAgICAgICAgICAgIHdvcmQxMiA9ICh3b3JkMSA+PiAxNik7IC8qIDAgMCBiMiBiMSAqLwotICAgICAgICAgICAgICAgIHdvcmQxID4+PSAyNDsgLyogMCAwIDAgYjIgKi8KLSAgICAgICAgICAgICAgICB3b3JkMTIgfD0gKHdvcmQyIDw8IDE2KTsgLyogYjQgYjMgYjIgYjEgKi8KLSAgICAgICAgICAgICAgICB3b3JkMSB8PSAod29yZDIgPDwgOCk7IC8qIGI1IGI0IGIzIGIyICovCi0gICAgICAgICAgICAgICAgd29yZDMgPSB3b3JkMSB8IHdvcmQxMjsgLy8gcm5kMSA9IDE7IG90aGVyd2lzZSB3b3JkMyA9IHdvcmQxJndvcmQxMgotICAgICAgICAgICAgICAgIHdvcmQxICY9IG1hc2s7Ci0gICAgICAgICAgICAgICAgd29yZDMgJj0gKH5tYXNrKTsgLyogMHgxMDEwMTAxLCBjaGVjayBsYXN0IGJpdCAqLwotICAgICAgICAgICAgICAgIHdvcmQxMiAmPSBtYXNrOwotICAgICAgICAgICAgICAgIHdvcmQxID4+PSAxOwotICAgICAgICAgICAgICAgIHdvcmQxID0gd29yZDEgKyAod29yZDEyID4+IDEpOwotICAgICAgICAgICAgICAgIHdvcmQxICs9IHdvcmQzOwotICAgICAgICAgICAgICAgICooKFVMb25nKikocmVjICs9IDEyKSkgPSB3b3JkMTsgLyogd3JpdGUgNCBwaXhlbHMgKi8KLQotICAgICAgICAgICAgICAgIHdvcmQxID0gKigoVUxvbmcqKShwcmV2ICs9IDQpKTsgLyogYjEwIGI5IGI4IGI3ICovCi0gICAgICAgICAgICAgICAgd29yZDEyID0gKHdvcmQyID4+IDE2KTsgLyogMCAwIGI2IGI1ICovCi0gICAgICAgICAgICAgICAgd29yZDIgPj49IDI0OyAvKiAwIDAgMCBiNiAqLwotICAgICAgICAgICAgICAgIHdvcmQxMiB8PSAod29yZDEgPDwgMTYpOyAvKiBiOCBiNyBiNiBiNSAqLwotICAgICAgICAgICAgICAgIHdvcmQyIHw9ICh3b3JkMSA8PCA4KTsgLyogYjkgYjggYjcgYjYgKi8KLSAgICAgICAgICAgICAgICB3b3JkMyA9IHdvcmQyIHwgd29yZDEyOyAvLyBybmQxID0gMTsgb3RoZXJ3aXNlIHdvcmQzID0gd29yZDEmd29yZDEyCi0gICAgICAgICAgICAgICAgd29yZDIgJj0gbWFzazsKLSAgICAgICAgICAgICAgICB3b3JkMyAmPSAofm1hc2spOyAvKiAweDEwMTAxMDEsIGNoZWNrIGxhc3QgYml0ICovCi0gICAgICAgICAgICAgICAgd29yZDEyICY9IG1hc2s7Ci0gICAgICAgICAgICAgICAgd29yZDIgPj49IDE7Ci0gICAgICAgICAgICAgICAgd29yZDIgPSB3b3JkMiArICh3b3JkMTIgPj4gMSk7Ci0gICAgICAgICAgICAgICAgd29yZDIgKz0gd29yZDM7Ci0gICAgICAgICAgICAgICAgKigoVUxvbmcqKShyZWMgKz0gNCkpID0gd29yZDI7IC8qIHdyaXRlIDQgcGl4ZWxzICovCi0gICAgICAgICAgICAgICAgcHJldiArPSBvZmZzZXQ7Ci0gICAgICAgICAgICB9Ci0gICAgICAgICAgICByZXR1cm4gMTsKLSAgICAgICAgfQotICAgICAgICBlbHNlIC8qIHJuZDEgPT0gMCAqLwotICAgICAgICB7Ci0gICAgICAgICAgICBmb3IgKGkgPSBCX1NJWkU7IGkgPiAwOyBpLS0pCi0gICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgd29yZDEgPSAqKChVTG9uZyopcHJldik7IC8qIGIyIGIxIGIwIGJOMSAqLwotICAgICAgICAgICAgICAgIHdvcmQyID0gKigoVUxvbmcqKShwcmV2ICs9IDQpKTsgLyogYjYgYjUgYjQgYjMgKi8KLSAgICAgICAgICAgICAgICB3b3JkMTIgPSAod29yZDEgPj4gMTYpOyAvKiAwIDAgYjIgYjEgKi8KLSAgICAgICAgICAgICAgICB3b3JkMSA+Pj0gMjQ7IC8qIDAgMCAwIGIyICovCi0gICAgICAgICAgICAgICAgd29yZDEyIHw9ICh3b3JkMiA8PCAxNik7IC8qIGI0IGIzIGIyIGIxICovCi0gICAgICAgICAgICAgICAgd29yZDEgfD0gKHdvcmQyIDw8IDgpOyAvKiBiNSBiNCBiMyBiMiAqLwotICAgICAgICAgICAgICAgIHdvcmQzID0gd29yZDEgJiB3b3JkMTI7IC8vIHJuZDEgPSAxOyBvdGhlcndpc2Ugd29yZDMgPSB3b3JkMSZ3b3JkMTIKLSAgICAgICAgICAgICAgICB3b3JkMSAmPSBtYXNrOwotICAgICAgICAgICAgICAgIHdvcmQzICY9ICh+bWFzayk7IC8qIDB4MTAxMDEwMSwgY2hlY2sgbGFzdCBiaXQgKi8KLSAgICAgICAgICAgICAgICB3b3JkMTIgJj0gbWFzazsKLSAgICAgICAgICAgICAgICB3b3JkMSA+Pj0gMTsKLSAgICAgICAgICAgICAgICB3b3JkMSA9IHdvcmQxICsgKHdvcmQxMiA+PiAxKTsKLSAgICAgICAgICAgICAgICB3b3JkMSArPSB3b3JkMzsKLSAgICAgICAgICAgICAgICAqKChVTG9uZyopKHJlYyArPSAxMikpID0gd29yZDE7IC8qIHdyaXRlIDQgcGl4ZWxzICovCi0KLSAgICAgICAgICAgICAgICB3b3JkMSA9ICooKFVMb25nKikocHJldiArPSA0KSk7IC8qIGIxMCBiOSBiOCBiNyAqLwotICAgICAgICAgICAgICAgIHdvcmQxMiA9ICh3b3JkMiA+PiAxNik7IC8qIDAgMCBiNiBiNSAqLwotICAgICAgICAgICAgICAgIHdvcmQyID4+PSAyNDsgLyogMCAwIDAgYjYgKi8KLSAgICAgICAgICAgICAgICB3b3JkMTIgfD0gKHdvcmQxIDw8IDE2KTsgLyogYjggYjcgYjYgYjUgKi8KLSAgICAgICAgICAgICAgICB3b3JkMiB8PSAod29yZDEgPDwgOCk7IC8qIGI5IGI4IGI3IGI2ICovCi0gICAgICAgICAgICAgICAgd29yZDMgPSB3b3JkMiAmIHdvcmQxMjsgLy8gcm5kMSA9IDE7IG90aGVyd2lzZSB3b3JkMyA9IHdvcmQxJndvcmQxMgotICAgICAgICAgICAgICAgIHdvcmQyICY9IG1hc2s7Ci0gICAgICAgICAgICAgICAgd29yZDMgJj0gKH5tYXNrKTsgLyogMHgxMDEwMTAxLCBjaGVjayBsYXN0IGJpdCAqLwotICAgICAgICAgICAgICAgIHdvcmQxMiAmPSBtYXNrOwotICAgICAgICAgICAgICAgIHdvcmQyID4+PSAxOwotICAgICAgICAgICAgICAgIHdvcmQyID0gd29yZDIgKyAod29yZDEyID4+IDEpOwotICAgICAgICAgICAgICAgIHdvcmQyICs9IHdvcmQzOwotICAgICAgICAgICAgICAgICooKFVMb25nKikocmVjICs9IDQpKSA9IHdvcmQyOyAvKiB3cml0ZSA0IHBpeGVscyAqLwotICAgICAgICAgICAgICAgIHByZXYgKz0gb2Zmc2V0OwotICAgICAgICAgICAgfQotICAgICAgICAgICAgcmV0dXJuIDE7Ci0gICAgICAgIH0KLSAgICB9Ci0gICAgZWxzZSAvKiB0bXAgPSAzICovCi0gICAgewotICAgICAgICBwcmV2IC09IDM7IC8qIHdvcmQtYWxpZ25lZCAqLwotICAgICAgICBpZiAocm5kMSA9PSAxKQotICAgICAgICB7Ci0gICAgICAgICAgICBmb3IgKGkgPSBCX1NJWkU7IGkgPiAwOyBpLS0pCi0gICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgd29yZDEgPSAqKChVTG9uZyopcHJldik7IC8qIGIxIGIwIGJOMSBiTjIgKi8KLSAgICAgICAgICAgICAgICB3b3JkMiA9ICooKFVMb25nKikocHJldiArPSA0KSk7IC8qIGI1IGI0IGIzIGIyICovCi0gICAgICAgICAgICAgICAgd29yZDEyID0gKHdvcmQxID4+IDI0KTsgLyogMCAwIDAgYjEgKi8KLSAgICAgICAgICAgICAgICB3b3JkMTIgfD0gKHdvcmQyIDw8IDgpOyAvKiBiNCBiMyBiMiBiMSAqLwotICAgICAgICAgICAgICAgIHdvcmQxID0gd29yZDI7Ci0gICAgICAgICAgICAgICAgd29yZDMgPSB3b3JkMSB8IHdvcmQxMjsgLy8gcm5kMSA9IDE7IG90aGVyd2lzZSB3b3JkMyA9IHdvcmQxJndvcmQxMgotICAgICAgICAgICAgICAgIHdvcmQxICY9IG1hc2s7Ci0gICAgICAgICAgICAgICAgd29yZDMgJj0gKH5tYXNrKTsgLyogMHgxMDEwMTAxLCBjaGVjayBsYXN0IGJpdCAqLwotICAgICAgICAgICAgICAgIHdvcmQxMiAmPSBtYXNrOwotICAgICAgICAgICAgICAgIHdvcmQxID4+PSAxOwotICAgICAgICAgICAgICAgIHdvcmQxID0gd29yZDEgKyAod29yZDEyID4+IDEpOwotICAgICAgICAgICAgICAgIHdvcmQxICs9IHdvcmQzOwotICAgICAgICAgICAgICAgICooKFVMb25nKikocmVjICs9IDEyKSkgPSB3b3JkMTsgLyogd3JpdGUgNCBwaXhlbHMgKi8KLQotICAgICAgICAgICAgICAgIHdvcmQxID0gKigoVUxvbmcqKShwcmV2ICs9IDQpKTsgLyogYjkgYjggYjcgYjYgKi8KLSAgICAgICAgICAgICAgICB3b3JkMTIgPSAod29yZDIgPj4gMjQpOyAvKiAwIDAgMCBiNSAqLwotICAgICAgICAgICAgICAgIHdvcmQxMiB8PSAod29yZDEgPDwgOCk7IC8qIGI4IGI3IGI2IGI1ICovCi0gICAgICAgICAgICAgICAgd29yZDIgPSB3b3JkMTsgLyogYjkgYjggYjcgYjYgKi8KLSAgICAgICAgICAgICAgICB3b3JkMyA9IHdvcmQyIHwgd29yZDEyOyAvLyBybmQxID0gMTsgb3RoZXJ3aXNlIHdvcmQzID0gd29yZDEmd29yZDEyCi0gICAgICAgICAgICAgICAgd29yZDIgJj0gbWFzazsKLSAgICAgICAgICAgICAgICB3b3JkMyAmPSAofm1hc2spOyAvKiAweDEwMTAxMDEsIGNoZWNrIGxhc3QgYml0ICovCi0gICAgICAgICAgICAgICAgd29yZDEyICY9IG1hc2s7Ci0gICAgICAgICAgICAgICAgd29yZDIgPj49IDE7Ci0gICAgICAgICAgICAgICAgd29yZDIgPSB3b3JkMiArICh3b3JkMTIgPj4gMSk7Ci0gICAgICAgICAgICAgICAgd29yZDIgKz0gd29yZDM7Ci0gICAgICAgICAgICAgICAgKigoVUxvbmcqKShyZWMgKz0gNCkpID0gd29yZDI7IC8qIHdyaXRlIDQgcGl4ZWxzICovCi0gICAgICAgICAgICAgICAgcHJldiArPSBvZmZzZXQ7Ci0gICAgICAgICAgICB9Ci0gICAgICAgICAgICByZXR1cm4gMTsKLSAgICAgICAgfQotICAgICAgICBlbHNlCi0gICAgICAgIHsKLSAgICAgICAgICAgIGZvciAoaSA9IEJfU0laRTsgaSA+IDA7IGktLSkKLSAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICB3b3JkMSA9ICooKFVMb25nKilwcmV2KTsgLyogYjEgYjAgYk4xIGJOMiAqLwotICAgICAgICAgICAgICAgIHdvcmQyID0gKigoVUxvbmcqKShwcmV2ICs9IDQpKTsgLyogYjUgYjQgYjMgYjIgKi8KLSAgICAgICAgICAgICAgICB3b3JkMTIgPSAod29yZDEgPj4gMjQpOyAvKiAwIDAgMCBiMSAqLwotICAgICAgICAgICAgICAgIHdvcmQxMiB8PSAod29yZDIgPDwgOCk7IC8qIGI0IGIzIGIyIGIxICovCi0gICAgICAgICAgICAgICAgd29yZDEgPSB3b3JkMjsKLSAgICAgICAgICAgICAgICB3b3JkMyA9IHdvcmQxICYgd29yZDEyOyAvLyBybmQxID0gMTsgb3RoZXJ3aXNlIHdvcmQzID0gd29yZDEmd29yZDEyCi0gICAgICAgICAgICAgICAgd29yZDEgJj0gbWFzazsKLSAgICAgICAgICAgICAgICB3b3JkMyAmPSAofm1hc2spOyAvKiAweDEwMTAxMDEsIGNoZWNrIGxhc3QgYml0ICovCi0gICAgICAgICAgICAgICAgd29yZDEyICY9IG1hc2s7Ci0gICAgICAgICAgICAgICAgd29yZDEgPj49IDE7Ci0gICAgICAgICAgICAgICAgd29yZDEgPSB3b3JkMSArICh3b3JkMTIgPj4gMSk7Ci0gICAgICAgICAgICAgICAgd29yZDEgKz0gd29yZDM7Ci0gICAgICAgICAgICAgICAgKigoVUxvbmcqKShyZWMgKz0gMTIpKSA9IHdvcmQxOyAvKiB3cml0ZSA0IHBpeGVscyAqLwotCi0gICAgICAgICAgICAgICAgd29yZDEgPSAqKChVTG9uZyopKHByZXYgKz0gNCkpOyAvKiBiOSBiOCBiNyBiNiAqLwotICAgICAgICAgICAgICAgIHdvcmQxMiA9ICh3b3JkMiA+PiAyNCk7IC8qIDAgMCAwIGI1ICovCi0gICAgICAgICAgICAgICAgd29yZDEyIHw9ICh3b3JkMSA8PCA4KTsgLyogYjggYjcgYjYgYjUgKi8KLSAgICAgICAgICAgICAgICB3b3JkMiA9IHdvcmQxOyAvKiBiOSBiOCBiNyBiNiAqLwotICAgICAgICAgICAgICAgIHdvcmQzID0gd29yZDIgJiB3b3JkMTI7IC8vIHJuZDEgPSAxOyBvdGhlcndpc2Ugd29yZDMgPSB3b3JkMSZ3b3JkMTIKLSAgICAgICAgICAgICAgICB3b3JkMiAmPSBtYXNrOwotICAgICAgICAgICAgICAgIHdvcmQzICY9ICh+bWFzayk7IC8qIDB4MTAxMDEwMSwgY2hlY2sgbGFzdCBiaXQgKi8KLSAgICAgICAgICAgICAgICB3b3JkMTIgJj0gbWFzazsKLSAgICAgICAgICAgICAgICB3b3JkMiA+Pj0gMTsKLSAgICAgICAgICAgICAgICB3b3JkMiA9IHdvcmQyICsgKHdvcmQxMiA+PiAxKTsKLSAgICAgICAgICAgICAgICB3b3JkMiArPSB3b3JkMzsKLSAgICAgICAgICAgICAgICAqKChVTG9uZyopKHJlYyArPSA0KSkgPSB3b3JkMjsgLyogd3JpdGUgNCBwaXhlbHMgKi8KLSAgICAgICAgICAgICAgICBwcmV2ICs9IG9mZnNldDsKLSAgICAgICAgICAgIH0KLSAgICAgICAgICAgIHJldHVybiAxOwotICAgICAgICB9Ci0gICAgfQotfQotCi0vKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi1JbnQgR2V0UHJlZEFkdkJ5MXgwKAotICAgIFVDaGFyICpwcmV2LCAgICAgICAgLyogaSAqLwotICAgIFVDaGFyICpyZWMsICAgICAvKiBpICovCi0gICAgSW50IGx4LCAgICAgLyogaSAqLwotICAgIEludCBybmQxIC8qIGkgKi8KLSkKLXsKLSAgICBJbnQgaTsgICAgICAvKiBsb29wIHZhcmlhYmxlICovCi0gICAgSW50IG9mZnNldDsKLSAgICBVTG9uZyAgd29yZDEsIHdvcmQyLCB3b3JkMywgd29yZDEyLCB3b3JkMjI7Ci0gICAgSW50IHRtcDsKLSAgICBVTG9uZyBtYXNrOwotCi0gICAgLyogaW5pdGlhbGl6ZSBvZmZzZXQgdG8gYWRqdXN0IHBpeGVsIGNvdW50ZXIgKi8KLSAgICAvKiAgICB0aGUgbmV4dCByb3c7IGZ1bGwtcGVsIHJlc29sdXRpb24gICAgICAqLwotICAgIG9mZnNldCA9IGx4IC0gQl9TSVpFOyAvKiBvZmZzZXQgZm9yIHByZXYgKi8KLQotICAgIC8qIEJyYW5jaCBiYXNlZCBvbiBwaXhlbCBsb2NhdGlvbiAoaGFsZi1wZWwgb3IgZnVsbC1wZWwpIGZvciB4IGFuZCB5ICovCi0gICAgcmVjIC09IDEyOyAvKiBwcmVzZXQgKi8KLQotICAgIHRtcCA9IChVTG9uZylwcmV2ICYgMzsKLSAgICBtYXNrID0gMjU0OwotICAgIG1hc2sgfD0gKG1hc2sgPDwgOCk7Ci0gICAgbWFzayB8PSAobWFzayA8PCAxNik7IC8qIDB4RkVGRUZFRkUgKi8KLQotICAgIGlmICh0bXAgPT0gMCkgLyogd29yZC1hbGlnbmVkICovCi0gICAgewotICAgICAgICBwcmV2IC09IDQ7Ci0gICAgICAgIGlmIChybmQxID09IDEpCi0gICAgICAgIHsKLSAgICAgICAgICAgIGZvciAoaSA9IEJfU0laRTsgaSA+IDA7IGktLSkKLSAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICB3b3JkMSA9ICooKFVMb25nKikocHJldiArPSA0KSk7Ci0gICAgICAgICAgICAgICAgd29yZDIgPSAqKChVTG9uZyopKHByZXYgKyBseCkpOwotICAgICAgICAgICAgICAgIHdvcmQzID0gd29yZDEgfCB3b3JkMjsgLy8gcm5kMSA9IDE7IG90aGVyd2lzZSB3b3JkMyA9IHdvcmQxJndvcmQyCi0gICAgICAgICAgICAgICAgd29yZDEgJj0gbWFzazsKLSAgICAgICAgICAgICAgICB3b3JkMyAmPSAofm1hc2spOyAvKiAweDEwMTAxMDEsIGNoZWNrIGxhc3QgYml0ICovCi0gICAgICAgICAgICAgICAgd29yZDIgJj0gbWFzazsKLSAgICAgICAgICAgICAgICB3b3JkMSA+Pj0gMTsKLSAgICAgICAgICAgICAgICB3b3JkMSA9IHdvcmQxICsgKHdvcmQyID4+IDEpOwotICAgICAgICAgICAgICAgIHdvcmQxICs9IHdvcmQzOwotICAgICAgICAgICAgICAgICooKFVMb25nKikocmVjICs9IDEyKSkgPSB3b3JkMTsKLSAgICAgICAgICAgICAgICB3b3JkMSA9ICooKFVMb25nKikocHJldiArPSA0KSk7Ci0gICAgICAgICAgICAgICAgd29yZDIgPSAqKChVTG9uZyopKHByZXYgKyBseCkpOwotICAgICAgICAgICAgICAgIHdvcmQzID0gd29yZDEgfCB3b3JkMjsgLy8gcm5kMSA9IDE7IG90aGVyd2lzZSB3b3JkMyA9IHdvcmQxJndvcmQyCi0gICAgICAgICAgICAgICAgd29yZDEgJj0gbWFzazsKLSAgICAgICAgICAgICAgICB3b3JkMyAmPSAofm1hc2spOyAvKiAweDEwMTAxMDEsIGNoZWNrIGxhc3QgYml0ICovCi0gICAgICAgICAgICAgICAgd29yZDIgJj0gbWFzazsKLSAgICAgICAgICAgICAgICB3b3JkMSA+Pj0gMTsKLSAgICAgICAgICAgICAgICB3b3JkMSA9IHdvcmQxICsgKHdvcmQyID4+IDEpOwotICAgICAgICAgICAgICAgIHdvcmQxICs9IHdvcmQzOwotICAgICAgICAgICAgICAgICooKFVMb25nKikocmVjICs9IDQpKSA9IHdvcmQxOwotCi0gICAgICAgICAgICAgICAgcHJldiArPSBvZmZzZXQ7Ci0gICAgICAgICAgICB9Ci0gICAgICAgICAgICByZXR1cm4gMTsKLSAgICAgICAgfQotICAgICAgICBlbHNlICAgLyogcm5kMSA9IDAgKi8KLSAgICAgICAgewotICAgICAgICAgICAgZm9yIChpID0gQl9TSVpFOyBpID4gMDsgaS0tKQotICAgICAgICAgICAgewotICAgICAgICAgICAgICAgIHdvcmQxID0gKigoVUxvbmcqKShwcmV2ICs9IDQpKTsKLSAgICAgICAgICAgICAgICB3b3JkMiA9ICooKFVMb25nKikocHJldiArIGx4KSk7Ci0gICAgICAgICAgICAgICAgd29yZDMgPSB3b3JkMSAmIHdvcmQyOyAgLyogcm5kMSA9IDA7ICovCi0gICAgICAgICAgICAgICAgd29yZDEgJj0gbWFzazsKLSAgICAgICAgICAgICAgICB3b3JkMyAmPSAofm1hc2spOyAvKiAweDEwMTAxMDEsIGNoZWNrIGxhc3QgYml0ICovCi0gICAgICAgICAgICAgICAgd29yZDIgJj0gbWFzazsKLSAgICAgICAgICAgICAgICB3b3JkMSA+Pj0gMTsKLSAgICAgICAgICAgICAgICB3b3JkMSA9IHdvcmQxICsgKHdvcmQyID4+IDEpOwotICAgICAgICAgICAgICAgIHdvcmQxICs9IHdvcmQzOwotICAgICAgICAgICAgICAgICooKFVMb25nKikocmVjICs9IDEyKSkgPSB3b3JkMTsKLSAgICAgICAgICAgICAgICB3b3JkMSA9ICooKFVMb25nKikocHJldiArPSA0KSk7Ci0gICAgICAgICAgICAgICAgd29yZDIgPSAqKChVTG9uZyopKHByZXYgKyBseCkpOwotICAgICAgICAgICAgICAgIHdvcmQzID0gd29yZDEgJiB3b3JkMjsgIC8qIHJuZDEgPSAwOyAqLwotICAgICAgICAgICAgICAgIHdvcmQxICY9IG1hc2s7Ci0gICAgICAgICAgICAgICAgd29yZDMgJj0gKH5tYXNrKTsgLyogMHgxMDEwMTAxLCBjaGVjayBsYXN0IGJpdCAqLwotICAgICAgICAgICAgICAgIHdvcmQyICY9IG1hc2s7Ci0gICAgICAgICAgICAgICAgd29yZDEgPj49IDE7Ci0gICAgICAgICAgICAgICAgd29yZDEgPSB3b3JkMSArICh3b3JkMiA+PiAxKTsKLSAgICAgICAgICAgICAgICB3b3JkMSArPSB3b3JkMzsKLSAgICAgICAgICAgICAgICAqKChVTG9uZyopKHJlYyArPSA0KSkgPSB3b3JkMTsKLQotICAgICAgICAgICAgICAgIHByZXYgKz0gb2Zmc2V0OwotICAgICAgICAgICAgfQotICAgICAgICAgICAgcmV0dXJuIDE7Ci0gICAgICAgIH0KLSAgICB9Ci0gICAgZWxzZSBpZiAodG1wID09IDEpCi0gICAgewotICAgICAgICBwcmV2LS07IC8qIHdvcmQtYWxpZ25lZCAqLwotICAgICAgICBpZiAocm5kMSA9PSAxKQotICAgICAgICB7Ci0gICAgICAgICAgICBmb3IgKGkgPSBCX1NJWkU7IGkgPiAwOyBpLS0pCi0gICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgd29yZDEyID0gKigoVUxvbmcqKXByZXYpOyAvKiByZWFkIGI0IGIzIGIyIGIxICovCi0gICAgICAgICAgICAgICAgd29yZDIyID0gKigoVUxvbmcqKShwcmV2ICsgbHgpKTsKLQotICAgICAgICAgICAgICAgIHdvcmQxID0gKigoVUxvbmcqKShwcmV2ICs9IDQpKTsgLyogcmVhZCBiOCBiNyBiNiBiNSAqLwotICAgICAgICAgICAgICAgIHdvcmQyID0gKigoVUxvbmcqKShwcmV2ICsgbHgpKTsKLSAgICAgICAgICAgICAgICB3b3JkMTIgPj49IDg7IC8qIDAgYjQgYjMgYjIgKi8KLSAgICAgICAgICAgICAgICB3b3JkMjIgPj49IDg7Ci0gICAgICAgICAgICAgICAgd29yZDEyID0gd29yZDEyIHwgKHdvcmQxIDw8IDI0KTsgLyogYjUgYjQgYjMgYjIgKi8KLSAgICAgICAgICAgICAgICB3b3JkMjIgPSB3b3JkMjIgfCAod29yZDIgPDwgMjQpOwotICAgICAgICAgICAgICAgIHdvcmQzID0gd29yZDEyIHwgd29yZDIyOwotICAgICAgICAgICAgICAgIHdvcmQxMiAmPSBtYXNrOwotICAgICAgICAgICAgICAgIHdvcmQyMiAmPSBtYXNrOwotICAgICAgICAgICAgICAgIHdvcmQzICY9ICh+bWFzayk7IC8qIDB4MTAxMDEwMSwgY2hlY2sgbGFzdCBiaXQgKi8KLSAgICAgICAgICAgICAgICB3b3JkMTIgPj49IDE7Ci0gICAgICAgICAgICAgICAgd29yZDEyID0gd29yZDEyICsgKHdvcmQyMiA+PiAxKTsKLSAgICAgICAgICAgICAgICB3b3JkMTIgKz0gd29yZDM7Ci0gICAgICAgICAgICAgICAgKigoVUxvbmcqKShyZWMgKz0gMTIpKSA9IHdvcmQxMjsKLQotICAgICAgICAgICAgICAgIHdvcmQxMiA9ICooKFVMb25nKikocHJldiArPSA0KSk7IC8qIHJlYWQgYjEyIGIxMSBiMTAgYjkgKi8KLSAgICAgICAgICAgICAgICB3b3JkMjIgPSAqKChVTG9uZyopKHByZXYgKyBseCkpOwotICAgICAgICAgICAgICAgIHdvcmQxID4+PSA4OyAvKiAwIGI4IGI3IGI2ICovCi0gICAgICAgICAgICAgICAgd29yZDIgPj49IDg7Ci0gICAgICAgICAgICAgICAgd29yZDEgPSB3b3JkMSB8ICh3b3JkMTIgPDwgMjQpOyAvKiBiOSBiOCBiNyBiNiAqLwotICAgICAgICAgICAgICAgIHdvcmQyID0gd29yZDIgfCAod29yZDIyIDw8IDI0KTsKLSAgICAgICAgICAgICAgICB3b3JkMyA9IHdvcmQxIHwgd29yZDI7Ci0gICAgICAgICAgICAgICAgd29yZDEgJj0gbWFzazsKLSAgICAgICAgICAgICAgICB3b3JkMiAmPSBtYXNrOwotICAgICAgICAgICAgICAgIHdvcmQzICY9ICh+bWFzayk7IC8qIDB4MTAxMDEwMSwgY2hlY2sgbGFzdCBiaXQgKi8KLSAgICAgICAgICAgICAgICB3b3JkMSA+Pj0gMTsKLSAgICAgICAgICAgICAgICB3b3JkMSA9IHdvcmQxICsgKHdvcmQyID4+IDEpOwotICAgICAgICAgICAgICAgIHdvcmQxICs9IHdvcmQzOwotICAgICAgICAgICAgICAgICooKFVMb25nKikocmVjICs9IDQpKSA9IHdvcmQxOwotICAgICAgICAgICAgICAgIHByZXYgKz0gb2Zmc2V0OwotICAgICAgICAgICAgfQotICAgICAgICAgICAgcmV0dXJuIDE7Ci0gICAgICAgIH0KLSAgICAgICAgZWxzZSAvKiBybmQxID0gMCAqLwotICAgICAgICB7Ci0gICAgICAgICAgICBmb3IgKGkgPSBCX1NJWkU7IGkgPiAwOyBpLS0pCi0gICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgd29yZDEyID0gKigoVUxvbmcqKXByZXYpOyAvKiByZWFkIGI0IGIzIGIyIGIxICovCi0gICAgICAgICAgICAgICAgd29yZDIyID0gKigoVUxvbmcqKShwcmV2ICsgbHgpKTsKLQotICAgICAgICAgICAgICAgIHdvcmQxID0gKigoVUxvbmcqKShwcmV2ICs9IDQpKTsgLyogcmVhZCBiOCBiNyBiNiBiNSAqLwotICAgICAgICAgICAgICAgIHdvcmQyID0gKigoVUxvbmcqKShwcmV2ICsgbHgpKTsKLSAgICAgICAgICAgICAgICB3b3JkMTIgPj49IDg7IC8qIDAgYjQgYjMgYjIgKi8KLSAgICAgICAgICAgICAgICB3b3JkMjIgPj49IDg7Ci0gICAgICAgICAgICAgICAgd29yZDEyID0gd29yZDEyIHwgKHdvcmQxIDw8IDI0KTsgLyogYjUgYjQgYjMgYjIgKi8KLSAgICAgICAgICAgICAgICB3b3JkMjIgPSB3b3JkMjIgfCAod29yZDIgPDwgMjQpOwotICAgICAgICAgICAgICAgIHdvcmQzID0gd29yZDEyICYgd29yZDIyOwotICAgICAgICAgICAgICAgIHdvcmQxMiAmPSBtYXNrOwotICAgICAgICAgICAgICAgIHdvcmQyMiAmPSBtYXNrOwotICAgICAgICAgICAgICAgIHdvcmQzICY9ICh+bWFzayk7IC8qIDB4MTAxMDEwMSwgY2hlY2sgbGFzdCBiaXQgKi8KLSAgICAgICAgICAgICAgICB3b3JkMTIgPj49IDE7Ci0gICAgICAgICAgICAgICAgd29yZDEyID0gd29yZDEyICsgKHdvcmQyMiA+PiAxKTsKLSAgICAgICAgICAgICAgICB3b3JkMTIgKz0gd29yZDM7Ci0gICAgICAgICAgICAgICAgKigoVUxvbmcqKShyZWMgKz0gMTIpKSA9IHdvcmQxMjsKLQotICAgICAgICAgICAgICAgIHdvcmQxMiA9ICooKFVMb25nKikocHJldiArPSA0KSk7IC8qIHJlYWQgYjEyIGIxMSBiMTAgYjkgKi8KLSAgICAgICAgICAgICAgICB3b3JkMjIgPSAqKChVTG9uZyopKHByZXYgKyBseCkpOwotICAgICAgICAgICAgICAgIHdvcmQxID4+PSA4OyAvKiAwIGI4IGI3IGI2ICovCi0gICAgICAgICAgICAgICAgd29yZDIgPj49IDg7Ci0gICAgICAgICAgICAgICAgd29yZDEgPSB3b3JkMSB8ICh3b3JkMTIgPDwgMjQpOyAvKiBiOSBiOCBiNyBiNiAqLwotICAgICAgICAgICAgICAgIHdvcmQyID0gd29yZDIgfCAod29yZDIyIDw8IDI0KTsKLSAgICAgICAgICAgICAgICB3b3JkMyA9IHdvcmQxICYgd29yZDI7Ci0gICAgICAgICAgICAgICAgd29yZDEgJj0gbWFzazsKLSAgICAgICAgICAgICAgICB3b3JkMiAmPSBtYXNrOwotICAgICAgICAgICAgICAgIHdvcmQzICY9ICh+bWFzayk7IC8qIDB4MTAxMDEwMSwgY2hlY2sgbGFzdCBiaXQgKi8KLSAgICAgICAgICAgICAgICB3b3JkMSA+Pj0gMTsKLSAgICAgICAgICAgICAgICB3b3JkMSA9IHdvcmQxICsgKHdvcmQyID4+IDEpOwotICAgICAgICAgICAgICAgIHdvcmQxICs9IHdvcmQzOwotICAgICAgICAgICAgICAgICooKFVMb25nKikocmVjICs9IDQpKSA9IHdvcmQxOwotICAgICAgICAgICAgICAgIHByZXYgKz0gb2Zmc2V0OwotICAgICAgICAgICAgfQotICAgICAgICAgICAgcmV0dXJuIDE7Ci0gICAgICAgIH0KLSAgICB9Ci0gICAgZWxzZSBpZiAodG1wID09IDIpCi0gICAgewotICAgICAgICBwcmV2IC09IDI7IC8qIHdvcmQtYWxpZ25lZCAqLwotICAgICAgICBpZiAocm5kMSA9PSAxKQotICAgICAgICB7Ci0gICAgICAgICAgICBmb3IgKGkgPSBCX1NJWkU7IGkgPiAwOyBpLS0pCi0gICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgd29yZDEyID0gKigoVUxvbmcqKXByZXYpOyAvKiByZWFkIGI0IGIzIGIyIGIxICovCi0gICAgICAgICAgICAgICAgd29yZDIyID0gKigoVUxvbmcqKShwcmV2ICsgbHgpKTsKLQotICAgICAgICAgICAgICAgIHdvcmQxID0gKigoVUxvbmcqKShwcmV2ICs9IDQpKTsgLyogcmVhZCBiOCBiNyBiNiBiNSAqLwotICAgICAgICAgICAgICAgIHdvcmQyID0gKigoVUxvbmcqKShwcmV2ICsgbHgpKTsKLSAgICAgICAgICAgICAgICB3b3JkMTIgPj49IDE2OyAvKiAwIDAgYjQgYjMgKi8KLSAgICAgICAgICAgICAgICB3b3JkMjIgPj49IDE2OwotICAgICAgICAgICAgICAgIHdvcmQxMiA9IHdvcmQxMiB8ICh3b3JkMSA8PCAxNik7IC8qIGI2IGI1IGI0IGIzICovCi0gICAgICAgICAgICAgICAgd29yZDIyID0gd29yZDIyIHwgKHdvcmQyIDw8IDE2KTsKLSAgICAgICAgICAgICAgICB3b3JkMyA9IHdvcmQxMiB8IHdvcmQyMjsKLSAgICAgICAgICAgICAgICB3b3JkMTIgJj0gbWFzazsKLSAgICAgICAgICAgICAgICB3b3JkMjIgJj0gbWFzazsKLSAgICAgICAgICAgICAgICB3b3JkMyAmPSAofm1hc2spOyAvKiAweDEwMTAxMDEsIGNoZWNrIGxhc3QgYml0ICovCi0gICAgICAgICAgICAgICAgd29yZDEyID4+PSAxOwotICAgICAgICAgICAgICAgIHdvcmQxMiA9IHdvcmQxMiArICh3b3JkMjIgPj4gMSk7Ci0gICAgICAgICAgICAgICAgd29yZDEyICs9IHdvcmQzOwotICAgICAgICAgICAgICAgICooKFVMb25nKikocmVjICs9IDEyKSkgPSB3b3JkMTI7Ci0KLSAgICAgICAgICAgICAgICB3b3JkMTIgPSAqKChVTG9uZyopKHByZXYgKz0gNCkpOyAvKiByZWFkIGIxMiBiMTEgYjEwIGI5ICovCi0gICAgICAgICAgICAgICAgd29yZDIyID0gKigoVUxvbmcqKShwcmV2ICsgbHgpKTsKLSAgICAgICAgICAgICAgICB3b3JkMSA+Pj0gMTY7IC8qIDAgMCBiOCBiNyAqLwotICAgICAgICAgICAgICAgIHdvcmQyID4+PSAxNjsKLSAgICAgICAgICAgICAgICB3b3JkMSA9IHdvcmQxIHwgKHdvcmQxMiA8PCAxNik7IC8qIGIxMCBiOSBiOCBiNyAqLwotICAgICAgICAgICAgICAgIHdvcmQyID0gd29yZDIgfCAod29yZDIyIDw8IDE2KTsKLSAgICAgICAgICAgICAgICB3b3JkMyA9IHdvcmQxIHwgd29yZDI7Ci0gICAgICAgICAgICAgICAgd29yZDEgJj0gbWFzazsKLSAgICAgICAgICAgICAgICB3b3JkMiAmPSBtYXNrOwotICAgICAgICAgICAgICAgIHdvcmQzICY9ICh+bWFzayk7IC8qIDB4MTAxMDEwMSwgY2hlY2sgbGFzdCBiaXQgKi8KLSAgICAgICAgICAgICAgICB3b3JkMSA+Pj0gMTsKLSAgICAgICAgICAgICAgICB3b3JkMSA9IHdvcmQxICsgKHdvcmQyID4+IDEpOwotICAgICAgICAgICAgICAgIHdvcmQxICs9IHdvcmQzOwotICAgICAgICAgICAgICAgICooKFVMb25nKikocmVjICs9IDQpKSA9IHdvcmQxOwotICAgICAgICAgICAgICAgIHByZXYgKz0gb2Zmc2V0OwotICAgICAgICAgICAgfQotICAgICAgICAgICAgcmV0dXJuIDE7Ci0gICAgICAgIH0KLSAgICAgICAgZWxzZSAvKiBybmQxID0gMCAqLwotICAgICAgICB7Ci0gICAgICAgICAgICBmb3IgKGkgPSBCX1NJWkU7IGkgPiAwOyBpLS0pCi0gICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgd29yZDEyID0gKigoVUxvbmcqKXByZXYpOyAvKiByZWFkIGI0IGIzIGIyIGIxICovCi0gICAgICAgICAgICAgICAgd29yZDIyID0gKigoVUxvbmcqKShwcmV2ICsgbHgpKTsKLQotICAgICAgICAgICAgICAgIHdvcmQxID0gKigoVUxvbmcqKShwcmV2ICs9IDQpKTsgLyogcmVhZCBiOCBiNyBiNiBiNSAqLwotICAgICAgICAgICAgICAgIHdvcmQyID0gKigoVUxvbmcqKShwcmV2ICsgbHgpKTsKLSAgICAgICAgICAgICAgICB3b3JkMTIgPj49IDE2OyAvKiAwIDAgYjQgYjMgKi8KLSAgICAgICAgICAgICAgICB3b3JkMjIgPj49IDE2OwotICAgICAgICAgICAgICAgIHdvcmQxMiA9IHdvcmQxMiB8ICh3b3JkMSA8PCAxNik7IC8qIGI2IGI1IGI0IGIzICovCi0gICAgICAgICAgICAgICAgd29yZDIyID0gd29yZDIyIHwgKHdvcmQyIDw8IDE2KTsKLSAgICAgICAgICAgICAgICB3b3JkMyA9IHdvcmQxMiAmIHdvcmQyMjsKLSAgICAgICAgICAgICAgICB3b3JkMTIgJj0gbWFzazsKLSAgICAgICAgICAgICAgICB3b3JkMjIgJj0gbWFzazsKLSAgICAgICAgICAgICAgICB3b3JkMyAmPSAofm1hc2spOyAvKiAweDEwMTAxMDEsIGNoZWNrIGxhc3QgYml0ICovCi0gICAgICAgICAgICAgICAgd29yZDEyID4+PSAxOwotICAgICAgICAgICAgICAgIHdvcmQxMiA9IHdvcmQxMiArICh3b3JkMjIgPj4gMSk7Ci0gICAgICAgICAgICAgICAgd29yZDEyICs9IHdvcmQzOwotICAgICAgICAgICAgICAgICooKFVMb25nKikocmVjICs9IDEyKSkgPSB3b3JkMTI7Ci0KLSAgICAgICAgICAgICAgICB3b3JkMTIgPSAqKChVTG9uZyopKHByZXYgKz0gNCkpOyAvKiByZWFkIGIxMiBiMTEgYjEwIGI5ICovCi0gICAgICAgICAgICAgICAgd29yZDIyID0gKigoVUxvbmcqKShwcmV2ICsgbHgpKTsKLSAgICAgICAgICAgICAgICB3b3JkMSA+Pj0gMTY7IC8qIDAgMCBiOCBiNyAqLwotICAgICAgICAgICAgICAgIHdvcmQyID4+PSAxNjsKLSAgICAgICAgICAgICAgICB3b3JkMSA9IHdvcmQxIHwgKHdvcmQxMiA8PCAxNik7IC8qIGIxMCBiOSBiOCBiNyAqLwotICAgICAgICAgICAgICAgIHdvcmQyID0gd29yZDIgfCAod29yZDIyIDw8IDE2KTsKLSAgICAgICAgICAgICAgICB3b3JkMyA9IHdvcmQxICYgd29yZDI7Ci0gICAgICAgICAgICAgICAgd29yZDEgJj0gbWFzazsKLSAgICAgICAgICAgICAgICB3b3JkMiAmPSBtYXNrOwotICAgICAgICAgICAgICAgIHdvcmQzICY9ICh+bWFzayk7IC8qIDB4MTAxMDEwMSwgY2hlY2sgbGFzdCBiaXQgKi8KLSAgICAgICAgICAgICAgICB3b3JkMSA+Pj0gMTsKLSAgICAgICAgICAgICAgICB3b3JkMSA9IHdvcmQxICsgKHdvcmQyID4+IDEpOwotICAgICAgICAgICAgICAgIHdvcmQxICs9IHdvcmQzOwotICAgICAgICAgICAgICAgICooKFVMb25nKikocmVjICs9IDQpKSA9IHdvcmQxOwotICAgICAgICAgICAgICAgIHByZXYgKz0gb2Zmc2V0OwotICAgICAgICAgICAgfQotCi0gICAgICAgICAgICByZXR1cm4gMTsKLSAgICAgICAgfQotICAgIH0KLSAgICBlbHNlIC8qIHRtcCA9PSAzICovCi0gICAgewotICAgICAgICBwcmV2IC09IDM7IC8qIHdvcmQtYWxpZ25lZCAqLwotICAgICAgICBpZiAocm5kMSA9PSAxKQotICAgICAgICB7Ci0gICAgICAgICAgICBmb3IgKGkgPSBCX1NJWkU7IGkgPiAwOyBpLS0pCi0gICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgd29yZDEyID0gKigoVUxvbmcqKXByZXYpOyAvKiByZWFkIGI0IGIzIGIyIGIxICovCi0gICAgICAgICAgICAgICAgd29yZDIyID0gKigoVUxvbmcqKShwcmV2ICsgbHgpKTsKLQotICAgICAgICAgICAgICAgIHdvcmQxID0gKigoVUxvbmcqKShwcmV2ICs9IDQpKTsgLyogcmVhZCBiOCBiNyBiNiBiNSAqLwotICAgICAgICAgICAgICAgIHdvcmQyID0gKigoVUxvbmcqKShwcmV2ICsgbHgpKTsKLSAgICAgICAgICAgICAgICB3b3JkMTIgPj49IDI0OyAvKiAwIDAgMCBiNCAqLwotICAgICAgICAgICAgICAgIHdvcmQyMiA+Pj0gMjQ7Ci0gICAgICAgICAgICAgICAgd29yZDEyID0gd29yZDEyIHwgKHdvcmQxIDw8IDgpOyAvKiBiNyBiNiBiNSBiNCAqLwotICAgICAgICAgICAgICAgIHdvcmQyMiA9IHdvcmQyMiB8ICh3b3JkMiA8PCA4KTsKLSAgICAgICAgICAgICAgICB3b3JkMyA9IHdvcmQxMiB8IHdvcmQyMjsKLSAgICAgICAgICAgICAgICB3b3JkMTIgJj0gbWFzazsKLSAgICAgICAgICAgICAgICB3b3JkMjIgJj0gbWFzazsKLSAgICAgICAgICAgICAgICB3b3JkMyAmPSAofm1hc2spOyAvKiAweDEwMTAxMDEsIGNoZWNrIGxhc3QgYml0ICovCi0gICAgICAgICAgICAgICAgd29yZDEyID4+PSAxOwotICAgICAgICAgICAgICAgIHdvcmQxMiA9IHdvcmQxMiArICh3b3JkMjIgPj4gMSk7Ci0gICAgICAgICAgICAgICAgd29yZDEyICs9IHdvcmQzOwotICAgICAgICAgICAgICAgICooKFVMb25nKikocmVjICs9IDEyKSkgPSB3b3JkMTI7Ci0KLSAgICAgICAgICAgICAgICB3b3JkMTIgPSAqKChVTG9uZyopKHByZXYgKz0gNCkpOyAvKiByZWFkIGIxMiBiMTEgYjEwIGI5ICovCi0gICAgICAgICAgICAgICAgd29yZDIyID0gKigoVUxvbmcqKShwcmV2ICsgbHgpKTsKLSAgICAgICAgICAgICAgICB3b3JkMSA+Pj0gMjQ7IC8qIDAgMCAwIGI4ICovCi0gICAgICAgICAgICAgICAgd29yZDIgPj49IDI0OwotICAgICAgICAgICAgICAgIHdvcmQxID0gd29yZDEgfCAod29yZDEyIDw8IDgpOyAvKiBiMTEgYjEwIGI5IGI4ICovCi0gICAgICAgICAgICAgICAgd29yZDIgPSB3b3JkMiB8ICh3b3JkMjIgPDwgOCk7Ci0gICAgICAgICAgICAgICAgd29yZDMgPSB3b3JkMSB8IHdvcmQyOwotICAgICAgICAgICAgICAgIHdvcmQxICY9IG1hc2s7Ci0gICAgICAgICAgICAgICAgd29yZDIgJj0gbWFzazsKLSAgICAgICAgICAgICAgICB3b3JkMyAmPSAofm1hc2spOyAvKiAweDEwMTAxMDEsIGNoZWNrIGxhc3QgYml0ICovCi0gICAgICAgICAgICAgICAgd29yZDEgPj49IDE7Ci0gICAgICAgICAgICAgICAgd29yZDEgPSB3b3JkMSArICh3b3JkMiA+PiAxKTsKLSAgICAgICAgICAgICAgICB3b3JkMSArPSB3b3JkMzsKLSAgICAgICAgICAgICAgICAqKChVTG9uZyopKHJlYyArPSA0KSkgPSB3b3JkMTsKLSAgICAgICAgICAgICAgICBwcmV2ICs9IG9mZnNldDsKLSAgICAgICAgICAgIH0KLSAgICAgICAgICAgIHJldHVybiAxOwotICAgICAgICB9Ci0gICAgICAgIGVsc2UgLyogcm5kMSA9IDAgKi8KLSAgICAgICAgewotICAgICAgICAgICAgZm9yIChpID0gQl9TSVpFOyBpID4gMDsgaS0tKQotICAgICAgICAgICAgewotICAgICAgICAgICAgICAgIHdvcmQxMiA9ICooKFVMb25nKilwcmV2KTsgLyogcmVhZCBiNCBiMyBiMiBiMSAqLwotICAgICAgICAgICAgICAgIHdvcmQyMiA9ICooKFVMb25nKikocHJldiArIGx4KSk7Ci0KLSAgICAgICAgICAgICAgICB3b3JkMSA9ICooKFVMb25nKikocHJldiArPSA0KSk7IC8qIHJlYWQgYjggYjcgYjYgYjUgKi8KLSAgICAgICAgICAgICAgICB3b3JkMiA9ICooKFVMb25nKikocHJldiArIGx4KSk7Ci0gICAgICAgICAgICAgICAgd29yZDEyID4+PSAyNDsgLyogMCAwIDAgYjQgKi8KLSAgICAgICAgICAgICAgICB3b3JkMjIgPj49IDI0OwotICAgICAgICAgICAgICAgIHdvcmQxMiA9IHdvcmQxMiB8ICh3b3JkMSA8PCA4KTsgLyogYjcgYjYgYjUgYjQgKi8KLSAgICAgICAgICAgICAgICB3b3JkMjIgPSB3b3JkMjIgfCAod29yZDIgPDwgOCk7Ci0gICAgICAgICAgICAgICAgd29yZDMgPSB3b3JkMTIgJiB3b3JkMjI7Ci0gICAgICAgICAgICAgICAgd29yZDEyICY9IG1hc2s7Ci0gICAgICAgICAgICAgICAgd29yZDIyICY9IG1hc2s7Ci0gICAgICAgICAgICAgICAgd29yZDMgJj0gKH5tYXNrKTsgLyogMHgxMDEwMTAxLCBjaGVjayBsYXN0IGJpdCAqLwotICAgICAgICAgICAgICAgIHdvcmQxMiA+Pj0gMTsKLSAgICAgICAgICAgICAgICB3b3JkMTIgPSB3b3JkMTIgKyAod29yZDIyID4+IDEpOwotICAgICAgICAgICAgICAgIHdvcmQxMiArPSB3b3JkMzsKLSAgICAgICAgICAgICAgICAqKChVTG9uZyopKHJlYyArPSAxMikpID0gd29yZDEyOwotCi0gICAgICAgICAgICAgICAgd29yZDEyID0gKigoVUxvbmcqKShwcmV2ICs9IDQpKTsgLyogcmVhZCBiMTIgYjExIGIxMCBiOSAqLwotICAgICAgICAgICAgICAgIHdvcmQyMiA9ICooKFVMb25nKikocHJldiArIGx4KSk7Ci0gICAgICAgICAgICAgICAgd29yZDEgPj49IDI0OyAvKiAwIDAgMCBiOCAqLwotICAgICAgICAgICAgICAgIHdvcmQyID4+PSAyNDsKLSAgICAgICAgICAgICAgICB3b3JkMSA9IHdvcmQxIHwgKHdvcmQxMiA8PCA4KTsgLyogYjExIGIxMCBiOSBiOCAqLwotICAgICAgICAgICAgICAgIHdvcmQyID0gd29yZDIgfCAod29yZDIyIDw8IDgpOwotICAgICAgICAgICAgICAgIHdvcmQzID0gd29yZDEgJiB3b3JkMjsKLSAgICAgICAgICAgICAgICB3b3JkMSAmPSBtYXNrOwotICAgICAgICAgICAgICAgIHdvcmQyICY9IG1hc2s7Ci0gICAgICAgICAgICAgICAgd29yZDMgJj0gKH5tYXNrKTsgLyogMHgxMDEwMTAxLCBjaGVjayBsYXN0IGJpdCAqLwotICAgICAgICAgICAgICAgIHdvcmQxID4+PSAxOwotICAgICAgICAgICAgICAgIHdvcmQxID0gd29yZDEgKyAod29yZDIgPj4gMSk7Ci0gICAgICAgICAgICAgICAgd29yZDEgKz0gd29yZDM7Ci0gICAgICAgICAgICAgICAgKigoVUxvbmcqKShyZWMgKz0gNCkpID0gd29yZDE7Ci0gICAgICAgICAgICAgICAgcHJldiArPSBvZmZzZXQ7Ci0gICAgICAgICAgICB9Ci0gICAgICAgICAgICByZXR1cm4gMTsKLSAgICAgICAgfSAvKiBybmQgKi8KLSAgICB9IC8qIHRtcCAqLwotfQotCi0vKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLUludCBHZXRQcmVkQWR2QnkxeDEoCi0gICAgVUNoYXIgKnByZXYsICAgICAgICAvKiBpICovCi0gICAgVUNoYXIgKnJlYywgICAgIC8qIGkgKi8KLSAgICBJbnQgbHgsICAgICAvKiBpICovCi0gICAgSW50IHJuZDEgLyogaSAqLwotKQotewotICAgIEludCBpOyAgICAgIC8qIGxvb3AgdmFyaWFibGUgKi8KLSAgICBJbnQgb2Zmc2V0OwotICAgIFVMb25nICB4MSwgeDIsIHgxbSwgeDJtLCB5MSwgeTIsIHkxbSwgeTJtOyAvKiBuZXcgd2F5ICovCi0gICAgSW50IHRtcDsKLSAgICBJbnQgcm5kMjsKLSAgICBVTG9uZyBtYXNrOwotCi0gICAgLyogaW5pdGlhbGl6ZSBvZmZzZXQgdG8gYWRqdXN0IHBpeGVsIGNvdW50ZXIgKi8KLSAgICAvKiAgICB0aGUgbmV4dCByb3c7IGZ1bGwtcGVsIHJlc29sdXRpb24gICAgICAqLwotICAgIG9mZnNldCA9IGx4IC0gQl9TSVpFOyAvKiBvZmZzZXQgZm9yIHByZXYgKi8KLQotICAgIHJuZDIgPSBybmQxICsgMTsKLSAgICBybmQyIHw9IChybmQyIDw8IDgpOwotICAgIHJuZDIgfD0gKHJuZDIgPDwgMTYpOwotCi0gICAgbWFzayA9IDB4M0Y7Ci0gICAgbWFzayB8PSAobWFzayA8PCA4KTsKLSAgICBtYXNrIHw9IChtYXNrIDw8IDE2KTsgLyogMHgzZjNmM2YzZiAqLwotCi0gICAgdG1wID0gKFVMb25nKXByZXYgJiAzOwotCi0gICAgcmVjIC09IDQ7IC8qIHByZXNldCAqLwotCi0gICAgaWYgKHRtcCA9PSAwKSAvKiB3b3JkLWFsaWduZWQgKi8KLSAgICB7Ci0gICAgICAgIGZvciAoaSA9IEJfU0laRTsgaSA+IDA7IGktLSkKLSAgICAgICAgewotICAgICAgICAgICAgeDEgPSAqKChVTG9uZyopcHJldik7IC8qIGxvYWQgYTMgYTIgYTEgYTAgKi8KLSAgICAgICAgICAgIHgyID0gKigoVUxvbmcqKShwcmV2ICsgbHgpKTsgLyogbG9hZCBiMyBiMiBiMSBiMCwgYW5vdGhlciBsaW5lICovCi0gICAgICAgICAgICB5MSA9ICooKFVMb25nKikocHJldiArPSA0KSk7IC8qIGE3IGE2IGE1IGE0ICovCi0gICAgICAgICAgICB5MiA9ICooKFVMb25nKikocHJldiArIGx4KSk7IC8qIGI3IGI2IGI1IGI0ICovCi0KLSAgICAgICAgICAgIHgxbSA9ICh4MSA+PiAyKSAmIG1hc2s7IC8qIHplcm8gb3V0IGxhc3QgMiBiaXRzICovCi0gICAgICAgICAgICB4Mm0gPSAoeDIgPj4gMikgJiBtYXNrOwotICAgICAgICAgICAgeDEgPSB4MSBeKHgxbSA8PCAyKTsKLSAgICAgICAgICAgIHgyID0geDIgXih4Mm0gPDwgMik7Ci0gICAgICAgICAgICB4MW0gKz0geDJtOwotICAgICAgICAgICAgeDEgKz0geDI7Ci0KLSAgICAgICAgICAgIC8qIHgybSwgeDIgZnJlZSAqLwotICAgICAgICAgICAgeTFtID0gKHkxID4+IDIpICYgbWFzazsgLyogemVybyBvdXQgbGFzdCAyIGJpdHMgKi8KLSAgICAgICAgICAgIHkybSA9ICh5MiA+PiAyKSAmIG1hc2s7Ci0gICAgICAgICAgICB5MSA9IHkxIF4oeTFtIDw8IDIpOwotICAgICAgICAgICAgeTIgPSB5MiBeKHkybSA8PCAyKTsKLSAgICAgICAgICAgIHkxbSArPSB5Mm07Ci0gICAgICAgICAgICB5MSArPSB5MjsKLQotICAgICAgICAgICAgLyogeTJtLCB5MiBmcmVlICovCi0gICAgICAgICAgICAvKiB4Mm0sIHgyIGZyZWUgKi8KLSAgICAgICAgICAgIHgyID0gKigoVUxvbmcqKShwcmV2ICs9IDQpKTsgLyogYTExIGExMCBhOSBhOCAqLwotICAgICAgICAgICAgeTIgPSAqKChVTG9uZyopKHByZXYgKyBseCkpOyAvKiBiMTEgYjEwIGI5IGI4ICovCi0gICAgICAgICAgICB4Mm0gPSAoeDIgPj4gMikgJiBtYXNrOwotICAgICAgICAgICAgeTJtID0gKHkyID4+IDIpICYgbWFzazsKLSAgICAgICAgICAgIHgyID0geDIgXih4Mm0gPDwgMik7Ci0gICAgICAgICAgICB5MiA9IHkyIF4oeTJtIDw8IDIpOwotICAgICAgICAgICAgeDJtICs9IHkybTsKLSAgICAgICAgICAgIHgyICs9IHkyOwotICAgICAgICAgICAgLyogeTJtLCB5MiBmcmVlICovCi0KLSAgICAgICAgICAgIC8qIG5vdyBvcGVyYXRlIG9uIHgxbSwgeDEsIHkxbSwgeTEsIHgybSwgeDIgKi8KLSAgICAgICAgICAgIC8qIHgxbSA9IGEzK2IzLCBhMitiMiwgYTErYjEsIGEwK2IwICovCi0gICAgICAgICAgICAvKiB5MW0gPSBhNytiNywgYTYrYjYsIGE1K2I1LCBhNCtiNCAqLwotICAgICAgICAgICAgLyogeDJtID0gYTExK2IxMSwgYTEwK2IxMCwgYTkrYjksIGE4K2I4ICovCi0gICAgICAgICAgICAvKiB4MSwgeTEsIHgyICovCi0KLSAgICAgICAgICAgIHkybSA9IHgxbSA+PiA4OwotICAgICAgICAgICAgeTIgPSB4MSA+PiA4OwotICAgICAgICAgICAgeTJtIHw9ICh5MW0gPDwgMjQpOyAgLyogYTQrYjQsIGEzK2IzLCBhMitiMiwgYTErYjEgKi8KLSAgICAgICAgICAgIHkyIHw9ICh5MSA8PCAyNCk7Ci0gICAgICAgICAgICB4MW0gKz0geTJtOyAgLyogYTMrYjMrYTQrYjQsIC4uLi4uLCBhMCtiMCthMStiMSAqLwotICAgICAgICAgICAgeDEgKz0geTI7Ci0gICAgICAgICAgICB4MSArPSBybmQyOwotICAgICAgICAgICAgeDEgJj0gKG1hc2sgPDwgMik7Ci0gICAgICAgICAgICB4MW0gKz0gKHgxID4+IDIpOwotICAgICAgICAgICAgKigoVUxvbmcqKShyZWMgKz0gNCkpID0geDFtOyAvKiBzYXZlIHgxbSAqLwotCi0gICAgICAgICAgICB5Mm0gPSB5MW0gPj4gODsKLSAgICAgICAgICAgIHkyID0geTEgPj4gODsKLSAgICAgICAgICAgIHkybSB8PSAoeDJtIDw8IDI0KTsgLyogYTgrYjgsIGE3K2I3LCBhNitiNiwgYTUrYjUgKi8KLSAgICAgICAgICAgIHkyIHw9ICh4MiA8PCAyNCk7Ci0gICAgICAgICAgICB5MW0gKz0geTJtOyAgLyogYTcrYjcrYTgrYjgsIC4uLi4uLCBhNCtiNCthNStiNSAqLwotICAgICAgICAgICAgeTEgKz0geTI7Ci0gICAgICAgICAgICB5MSArPSBybmQyOwotICAgICAgICAgICAgeTEgJj0gKG1hc2sgPDwgMik7Ci0gICAgICAgICAgICB5MW0gKz0gKHkxID4+IDIpOwotICAgICAgICAgICAgKigoVUxvbmcqKShyZWMgKz0gNCkpID0geTFtOyAvKiBzYXZlIHkxbSAqLwotCi0gICAgICAgICAgICByZWMgKz0gODsKLSAgICAgICAgICAgIHByZXYgKz0gb2Zmc2V0OwotICAgICAgICB9Ci0KLSAgICAgICAgcmV0dXJuIDE7Ci0gICAgfQotICAgIGVsc2UgaWYgKHRtcCA9PSAxKQotICAgIHsKLSAgICAgICAgcHJldi0tOyAvKiB0byB3b3JkLWFsaWduZWQgKi8KLSAgICAgICAgZm9yIChpID0gQl9TSVpFOyBpID4gMDsgaS0tKQotICAgICAgICB7Ci0gICAgICAgICAgICB4MSA9ICooKFVMb25nKilwcmV2KTsgLyogbG9hZCBhMyBhMiBhMSBhMCAqLwotICAgICAgICAgICAgeDIgPSAqKChVTG9uZyopKHByZXYgKyBseCkpOyAvKiBsb2FkIGIzIGIyIGIxIGIwLCBhbm90aGVyIGxpbmUgKi8KLSAgICAgICAgICAgIHkxID0gKigoVUxvbmcqKShwcmV2ICs9IDQpKTsgLyogYTcgYTYgYTUgYTQgKi8KLSAgICAgICAgICAgIHkyID0gKigoVUxvbmcqKShwcmV2ICsgbHgpKTsgLyogYjcgYjYgYjUgYjQgKi8KLQotICAgICAgICAgICAgeDFtID0gKHgxID4+IDIpICYgbWFzazsgLyogemVybyBvdXQgbGFzdCAyIGJpdHMgKi8KLSAgICAgICAgICAgIHgybSA9ICh4MiA+PiAyKSAmIG1hc2s7Ci0gICAgICAgICAgICB4MSA9IHgxIF4oeDFtIDw8IDIpOwotICAgICAgICAgICAgeDIgPSB4MiBeKHgybSA8PCAyKTsKLSAgICAgICAgICAgIHgxbSArPSB4Mm07Ci0gICAgICAgICAgICB4MSArPSB4MjsKLQotICAgICAgICAgICAgLyogeDJtLCB4MiBmcmVlICovCi0gICAgICAgICAgICB5MW0gPSAoeTEgPj4gMikgJiBtYXNrOyAvKiB6ZXJvIG91dCBsYXN0IDIgYml0cyAqLwotICAgICAgICAgICAgeTJtID0gKHkyID4+IDIpICYgbWFzazsKLSAgICAgICAgICAgIHkxID0geTEgXih5MW0gPDwgMik7Ci0gICAgICAgICAgICB5MiA9IHkyIF4oeTJtIDw8IDIpOwotICAgICAgICAgICAgeTFtICs9IHkybTsKLSAgICAgICAgICAgIHkxICs9IHkyOwotCi0gICAgICAgICAgICAvKiB5Mm0sIHkyIGZyZWUgKi8KLSAgICAgICAgICAgIC8qIHgybSwgeDIgZnJlZSAqLwotICAgICAgICAgICAgeDIgPSAqKChVTG9uZyopKHByZXYgKz0gNCkpOyAvKiBhMTEgYTEwIGE5IGE4ICovCi0gICAgICAgICAgICB5MiA9ICooKFVMb25nKikocHJldiArIGx4KSk7IC8qIGIxMSBiMTAgYjkgYjggKi8KLSAgICAgICAgICAgIHgybSA9ICh4MiA+PiAyKSAmIG1hc2s7Ci0gICAgICAgICAgICB5Mm0gPSAoeTIgPj4gMikgJiBtYXNrOwotICAgICAgICAgICAgeDIgPSB4MiBeKHgybSA8PCAyKTsKLSAgICAgICAgICAgIHkyID0geTIgXih5Mm0gPDwgMik7Ci0gICAgICAgICAgICB4Mm0gKz0geTJtOwotICAgICAgICAgICAgeDIgKz0geTI7Ci0gICAgICAgICAgICAvKiB5Mm0sIHkyIGZyZWUgKi8KLQotICAgICAgICAgICAgLyogbm93IG9wZXJhdGUgb24geDFtLCB4MSwgeTFtLCB5MSwgeDJtLCB4MiAqLwotICAgICAgICAgICAgLyogeDFtID0gYTMrYjMsIGEyK2IyLCBhMStiMSwgYTArYjAgKi8KLSAgICAgICAgICAgIC8qIHkxbSA9IGE3K2I3LCBhNitiNiwgYTUrYjUsIGE0K2I0ICovCi0gICAgICAgICAgICAvKiB4Mm0gPSBhMTErYjExLCBhMTArYjEwLCBhOStiOSwgYTgrYjggKi8KLSAgICAgICAgICAgIC8qIHgxLCB5MSwgeDIgKi8KLQotICAgICAgICAgICAgeDFtID4+PSA4IDsKLSAgICAgICAgICAgIHgxID4+PSA4OwotICAgICAgICAgICAgeDFtIHw9ICh5MW0gPDwgMjQpOyAgLyogYTQrYjQsIGEzK2IzLCBhMitiMiwgYTErYjEgKi8KLSAgICAgICAgICAgIHgxIHw9ICh5MSA8PCAyNCk7Ci0gICAgICAgICAgICB5Mm0gPSAoeTFtIDw8IDE2KTsKLSAgICAgICAgICAgIHkyID0gKHkxIDw8IDE2KTsKLSAgICAgICAgICAgIHkybSB8PSAoeDFtID4+IDgpOyAvKiBhNStiNSwgYTQrYjQsIGEzK2IzLCBhMitiMiAqLwotICAgICAgICAgICAgeTIgfD0gKHgxID4+IDgpOwotICAgICAgICAgICAgeDEgKz0gcm5kMjsKLSAgICAgICAgICAgIHgxbSArPSB5Mm07ICAvKiBhNCtiNCthNStiNSwgLi4uLi4sIGExK2IxK2EyK2IyICovCi0gICAgICAgICAgICB4MSArPSB5MjsKLSAgICAgICAgICAgIHgxICY9IChtYXNrIDw8IDIpOwotICAgICAgICAgICAgeDFtICs9ICh4MSA+PiAyKTsKLSAgICAgICAgICAgICooKFVMb25nKikocmVjICs9IDQpKSA9IHgxbTsgLyogc2F2ZSB4MW0gKi8KLQotICAgICAgICAgICAgeTFtID4+PSA4OwotICAgICAgICAgICAgeTEgPj49IDg7Ci0gICAgICAgICAgICB5MW0gfD0gKHgybSA8PCAyNCk7IC8qIGE4K2I4LCBhNytiNywgYTYrYjYsIGE1K2I1ICovCi0gICAgICAgICAgICB5MSB8PSAoeDIgPDwgMjQpOwotICAgICAgICAgICAgeTJtID0gKHgybSA8PCAxNik7Ci0gICAgICAgICAgICB5MiA9ICh4MiA8PCAxNik7Ci0gICAgICAgICAgICB5Mm0gfD0gKHkxbSA+PiA4KTsgLyogIGE5K2I5LCBhOCtiOCwgYTcrYjcsIGE2K2I2LCovCi0gICAgICAgICAgICB5MiB8PSAoeTEgPj4gOCk7Ci0gICAgICAgICAgICB5MSArPSBybmQyOwotICAgICAgICAgICAgeTFtICs9IHkybTsgIC8qIGE4K2I4K2E5K2I5LCAuLi4uLiwgYTUrYjUrYTYrYjYgKi8KLSAgICAgICAgICAgIHkxICs9IHkyOwotICAgICAgICAgICAgeTEgJj0gKG1hc2sgPDwgMik7Ci0gICAgICAgICAgICB5MW0gKz0gKHkxID4+IDIpOwotICAgICAgICAgICAgKigoVUxvbmcqKShyZWMgKz0gNCkpID0geTFtOyAvKiBzYXZlIHkxbSAqLwotCi0gICAgICAgICAgICByZWMgKz0gODsKLSAgICAgICAgICAgIHByZXYgKz0gb2Zmc2V0OwotICAgICAgICB9Ci0gICAgICAgIHJldHVybiAxOwotICAgIH0KLSAgICBlbHNlIGlmICh0bXAgPT0gMikKLSAgICB7Ci0gICAgICAgIHByZXYgLT0gMjsgLyogdG8gd29yZC1hbGlnbmVkICovCi0gICAgICAgIGZvciAoaSA9IEJfU0laRTsgaSA+IDA7IGktLSkKLSAgICAgICAgewotICAgICAgICAgICAgeDEgPSAqKChVTG9uZyopcHJldik7IC8qIGxvYWQgYTMgYTIgYTEgYTAgKi8KLSAgICAgICAgICAgIHgyID0gKigoVUxvbmcqKShwcmV2ICsgbHgpKTsgLyogbG9hZCBiMyBiMiBiMSBiMCwgYW5vdGhlciBsaW5lICovCi0gICAgICAgICAgICB5MSA9ICooKFVMb25nKikocHJldiArPSA0KSk7IC8qIGE3IGE2IGE1IGE0ICovCi0gICAgICAgICAgICB5MiA9ICooKFVMb25nKikocHJldiArIGx4KSk7IC8qIGI3IGI2IGI1IGI0ICovCi0KLSAgICAgICAgICAgIHgxbSA9ICh4MSA+PiAyKSAmIG1hc2s7IC8qIHplcm8gb3V0IGxhc3QgMiBiaXRzICovCi0gICAgICAgICAgICB4Mm0gPSAoeDIgPj4gMikgJiBtYXNrOwotICAgICAgICAgICAgeDEgPSB4MSBeKHgxbSA8PCAyKTsKLSAgICAgICAgICAgIHgyID0geDIgXih4Mm0gPDwgMik7Ci0gICAgICAgICAgICB4MW0gKz0geDJtOwotICAgICAgICAgICAgeDEgKz0geDI7Ci0KLSAgICAgICAgICAgIC8qIHgybSwgeDIgZnJlZSAqLwotICAgICAgICAgICAgeTFtID0gKHkxID4+IDIpICYgbWFzazsgLyogemVybyBvdXQgbGFzdCAyIGJpdHMgKi8KLSAgICAgICAgICAgIHkybSA9ICh5MiA+PiAyKSAmIG1hc2s7Ci0gICAgICAgICAgICB5MSA9IHkxIF4oeTFtIDw8IDIpOwotICAgICAgICAgICAgeTIgPSB5MiBeKHkybSA8PCAyKTsKLSAgICAgICAgICAgIHkxbSArPSB5Mm07Ci0gICAgICAgICAgICB5MSArPSB5MjsKLQotICAgICAgICAgICAgLyogeTJtLCB5MiBmcmVlICovCi0gICAgICAgICAgICAvKiB4Mm0sIHgyIGZyZWUgKi8KLSAgICAgICAgICAgIHgyID0gKigoVUxvbmcqKShwcmV2ICs9IDQpKTsgLyogYTExIGExMCBhOSBhOCAqLwotICAgICAgICAgICAgeTIgPSAqKChVTG9uZyopKHByZXYgKyBseCkpOyAvKiBiMTEgYjEwIGI5IGI4ICovCi0gICAgICAgICAgICB4Mm0gPSAoeDIgPj4gMikgJiBtYXNrOwotICAgICAgICAgICAgeTJtID0gKHkyID4+IDIpICYgbWFzazsKLSAgICAgICAgICAgIHgyID0geDIgXih4Mm0gPDwgMik7Ci0gICAgICAgICAgICB5MiA9IHkyIF4oeTJtIDw8IDIpOwotICAgICAgICAgICAgeDJtICs9IHkybTsKLSAgICAgICAgICAgIHgyICs9IHkyOwotICAgICAgICAgICAgLyogeTJtLCB5MiBmcmVlICovCi0KLSAgICAgICAgICAgIC8qIG5vdyBvcGVyYXRlIG9uIHgxbSwgeDEsIHkxbSwgeTEsIHgybSwgeDIgKi8KLSAgICAgICAgICAgIC8qIHgxbSA9IGEzK2IzLCBhMitiMiwgYTErYjEsIGEwK2IwICovCi0gICAgICAgICAgICAvKiB5MW0gPSBhNytiNywgYTYrYjYsIGE1K2I1LCBhNCtiNCAqLwotICAgICAgICAgICAgLyogeDJtID0gYTExK2IxMSwgYTEwK2IxMCwgYTkrYjksIGE4K2I4ICovCi0gICAgICAgICAgICAvKiB4MSwgeTEsIHgyICovCi0KLSAgICAgICAgICAgIHgxbSA+Pj0gMTYgOwotICAgICAgICAgICAgeDEgPj49IDE2OwotICAgICAgICAgICAgeDFtIHw9ICh5MW0gPDwgMTYpOyAgLyogYTUrYjUsIGE0K2I0LCBhMytiMywgYTIrYjIgKi8KLSAgICAgICAgICAgIHgxIHw9ICh5MSA8PCAxNik7Ci0gICAgICAgICAgICB5Mm0gPSAoeTFtIDw8IDgpOwotICAgICAgICAgICAgeTIgPSAoeTEgPDwgOCk7Ci0gICAgICAgICAgICB5Mm0gfD0gKHgxbSA+PiA4KTsgLyogYTYrYjYsIGE1K2I1LCBhNCtiNCwgYTMrYjMgKi8KLSAgICAgICAgICAgIHkyIHw9ICh4MSA+PiA4KTsKLSAgICAgICAgICAgIHgxICs9IHJuZDI7Ci0gICAgICAgICAgICB4MW0gKz0geTJtOyAgLyogYTUrYjUrYTYrYjYsIC4uLi4uLCBhMitiMithMytiMyAqLwotICAgICAgICAgICAgeDEgKz0geTI7Ci0gICAgICAgICAgICB4MSAmPSAobWFzayA8PCAyKTsKLSAgICAgICAgICAgIHgxbSArPSAoeDEgPj4gMik7Ci0gICAgICAgICAgICAqKChVTG9uZyopKHJlYyArPSA0KSkgPSB4MW07IC8qIHNhdmUgeDFtICovCi0KLSAgICAgICAgICAgIHkxbSA+Pj0gMTY7Ci0gICAgICAgICAgICB5MSA+Pj0gMTY7Ci0gICAgICAgICAgICB5MW0gfD0gKHgybSA8PCAxNik7IC8qIGE5K2I5LCBhOCtiOCwgYTcrYjcsIGE2K2I2ICovCi0gICAgICAgICAgICB5MSB8PSAoeDIgPDwgMTYpOwotICAgICAgICAgICAgeTJtID0gKHgybSA8PCA4KTsKLSAgICAgICAgICAgIHkyID0gKHgyIDw8IDgpOwotICAgICAgICAgICAgeTJtIHw9ICh5MW0gPj4gOCk7IC8qICBhMTArYjEwLCBhOStiOSwgYTgrYjgsIGE3K2I3LCovCi0gICAgICAgICAgICB5MiB8PSAoeTEgPj4gOCk7Ci0gICAgICAgICAgICB5MSArPSBybmQyOwotICAgICAgICAgICAgeTFtICs9IHkybTsgIC8qIGE5K2I5K2ExMCtiMTAsIC4uLi4uLCBhNitiNithNytiNyAqLwotICAgICAgICAgICAgeTEgKz0geTI7Ci0gICAgICAgICAgICB5MSAmPSAobWFzayA8PCAyKTsKLSAgICAgICAgICAgIHkxbSArPSAoeTEgPj4gMik7Ci0gICAgICAgICAgICAqKChVTG9uZyopKHJlYyArPSA0KSkgPSB5MW07IC8qIHNhdmUgeTFtICovCi0KLSAgICAgICAgICAgIHJlYyArPSA4OwotICAgICAgICAgICAgcHJldiArPSBvZmZzZXQ7Ci0gICAgICAgIH0KLSAgICAgICAgcmV0dXJuIDE7Ci0gICAgfQotICAgIGVsc2UgLyogdG1wID09IDMgKi8KLSAgICB7Ci0gICAgICAgIHByZXYgLT0gMzsgLyogdG8gd29yZC1hbGlnbmVkICovCi0gICAgICAgIGZvciAoaSA9IEJfU0laRTsgaSA+IDA7IGktLSkKLSAgICAgICAgewotICAgICAgICAgICAgeDEgPSAqKChVTG9uZyopcHJldik7IC8qIGxvYWQgYTMgYTIgYTEgYTAgKi8KLSAgICAgICAgICAgIHgyID0gKigoVUxvbmcqKShwcmV2ICsgbHgpKTsgLyogbG9hZCBiMyBiMiBiMSBiMCwgYW5vdGhlciBsaW5lICovCi0gICAgICAgICAgICB5MSA9ICooKFVMb25nKikocHJldiArPSA0KSk7IC8qIGE3IGE2IGE1IGE0ICovCi0gICAgICAgICAgICB5MiA9ICooKFVMb25nKikocHJldiArIGx4KSk7IC8qIGI3IGI2IGI1IGI0ICovCi0KLSAgICAgICAgICAgIHgxbSA9ICh4MSA+PiAyKSAmIG1hc2s7IC8qIHplcm8gb3V0IGxhc3QgMiBiaXRzICovCi0gICAgICAgICAgICB4Mm0gPSAoeDIgPj4gMikgJiBtYXNrOwotICAgICAgICAgICAgeDEgPSB4MSBeKHgxbSA8PCAyKTsKLSAgICAgICAgICAgIHgyID0geDIgXih4Mm0gPDwgMik7Ci0gICAgICAgICAgICB4MW0gKz0geDJtOwotICAgICAgICAgICAgeDEgKz0geDI7Ci0KLSAgICAgICAgICAgIC8qIHgybSwgeDIgZnJlZSAqLwotICAgICAgICAgICAgeTFtID0gKHkxID4+IDIpICYgbWFzazsgLyogemVybyBvdXQgbGFzdCAyIGJpdHMgKi8KLSAgICAgICAgICAgIHkybSA9ICh5MiA+PiAyKSAmIG1hc2s7Ci0gICAgICAgICAgICB5MSA9IHkxIF4oeTFtIDw8IDIpOwotICAgICAgICAgICAgeTIgPSB5MiBeKHkybSA8PCAyKTsKLSAgICAgICAgICAgIHkxbSArPSB5Mm07Ci0gICAgICAgICAgICB5MSArPSB5MjsKLQotICAgICAgICAgICAgLyogeTJtLCB5MiBmcmVlICovCi0gICAgICAgICAgICAvKiB4Mm0sIHgyIGZyZWUgKi8KLSAgICAgICAgICAgIHgyID0gKigoVUxvbmcqKShwcmV2ICs9IDQpKTsgLyogYTExIGExMCBhOSBhOCAqLwotICAgICAgICAgICAgeTIgPSAqKChVTG9uZyopKHByZXYgKyBseCkpOyAvKiBiMTEgYjEwIGI5IGI4ICovCi0gICAgICAgICAgICB4Mm0gPSAoeDIgPj4gMikgJiBtYXNrOwotICAgICAgICAgICAgeTJtID0gKHkyID4+IDIpICYgbWFzazsKLSAgICAgICAgICAgIHgyID0geDIgXih4Mm0gPDwgMik7Ci0gICAgICAgICAgICB5MiA9IHkyIF4oeTJtIDw8IDIpOwotICAgICAgICAgICAgeDJtICs9IHkybTsKLSAgICAgICAgICAgIHgyICs9IHkyOwotICAgICAgICAgICAgLyogeTJtLCB5MiBmcmVlICovCi0KLSAgICAgICAgICAgIC8qIG5vdyBvcGVyYXRlIG9uIHgxbSwgeDEsIHkxbSwgeTEsIHgybSwgeDIgKi8KLSAgICAgICAgICAgIC8qIHgxbSA9IGEzK2IzLCBhMitiMiwgYTErYjEsIGEwK2IwICovCi0gICAgICAgICAgICAvKiB5MW0gPSBhNytiNywgYTYrYjYsIGE1K2I1LCBhNCtiNCAqLwotICAgICAgICAgICAgLyogeDJtID0gYTExK2IxMSwgYTEwK2IxMCwgYTkrYjksIGE4K2I4ICovCi0gICAgICAgICAgICAvKiB4MSwgeTEsIHgyICovCi0KLSAgICAgICAgICAgIHgxbSA+Pj0gMjQgOwotICAgICAgICAgICAgeDEgPj49IDI0OwotICAgICAgICAgICAgeDFtIHw9ICh5MW0gPDwgOCk7ICAvKiBhNitiNiwgYTUrYjUsIGE0K2I0LCBhMytiMyAqLwotICAgICAgICAgICAgeDEgfD0gKHkxIDw8IDgpOwotCi0gICAgICAgICAgICB4MW0gKz0geTFtOyAgLyogYTYrYjYrYTcrYjcsIC4uLi4uLCBhMytiMythNCtiNCAqLwotICAgICAgICAgICAgeDEgKz0geTE7Ci0gICAgICAgICAgICB4MSArPSBybmQyOwotICAgICAgICAgICAgeDEgJj0gKG1hc2sgPDwgMik7Ci0gICAgICAgICAgICB4MW0gKz0gKHgxID4+IDIpOwotICAgICAgICAgICAgKigoVUxvbmcqKShyZWMgKz0gNCkpID0geDFtOyAvKiBzYXZlIHgxbSAqLwotCi0gICAgICAgICAgICB5MW0gPj49IDI0OwotICAgICAgICAgICAgeTEgPj49IDI0OwotICAgICAgICAgICAgeTFtIHw9ICh4Mm0gPDwgOCk7IC8qIGExMCtiMTAsIGE5K2I5LCBhOCtiOCwgYTcrYjcgKi8KLSAgICAgICAgICAgIHkxIHw9ICh4MiA8PCA4KTsKLSAgICAgICAgICAgIHkxbSArPSB4Mm07ICAvKiBhMTArYjEwK2ExMStiMTEsIC4uLi4uLCBhNytiNythOCtiOCAqLwotICAgICAgICAgICAgeTEgKz0geDI7Ci0gICAgICAgICAgICB5MSArPSBybmQyOwotICAgICAgICAgICAgeTEgJj0gKG1hc2sgPDwgMik7Ci0gICAgICAgICAgICB5MW0gKz0gKHkxID4+IDIpOwotICAgICAgICAgICAgKigoVUxvbmcqKShyZWMgKz0gNCkpID0geTFtOyAvKiBzYXZlIHkxbSAqLwotCi0gICAgICAgICAgICByZWMgKz0gODsKLSAgICAgICAgICAgIHByZXYgKz0gb2Zmc2V0OwotICAgICAgICB9Ci0gICAgICAgIHJldHVybiAxOwotICAgIH0KLX0KLQotCi0vKj09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09Ci0gICAgRnVuY3Rpb246ICAgRW5jR2V0UHJlZE91dHNpZGUKLSAgICBEYXRlOiAgICAgICAwNC8xNy8yMDAxCi0gICAgUHVycG9zZTogICAgLSBtb2RpZmllZCBmcm9tIEdldFByZWRPdXRzaWRlIGluIHRoZSBkZWNvZGVyLgotICAgIE1vZGlmaWVkOiAgICAwOS8yNC8wNQotICAgICAgICAgICAgICAgIHVzZSB0aGUgZXhpc3Rpbmcgbm9uLWluaXRpYWxpemVkIHBhZGRlZCByZWdpb24KLT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09Ki8KLS8vIG5vdCByZWFsbHkgbmVlZGVkIHNpbmNlIHBhZGRpbmcgaXMgaW5jbHVkZWQKLSNkZWZpbmUgUEFEX0NPUk5FUiAgeyB0ZW1wID0gKnNyYzsgXAotICAgICAgICAgICAgICAgICAgICAgdGVtcCB8PSAodGVtcDw8OCk7IFwKLSAgICAgICAgICAgICAgICAgICAgIHRlbXAgfD0gKHRlbXA8PDE2KTsgXAotICAgICAgICAgICAgICAgICAgICAgKigoVUxvbmcqKWRzdCkgPSB0ZW1wOyBcCi0gICAgICAgICAgICAgICAgICAgICAqKChVTG9uZyopKGRzdCs0KSkgPSB0ZW1wOyBcCi0gICAgICAgICAgICAgICAgICAgICAqKChVTG9uZyopKGRzdCs9bHgpKSA9IHRlbXA7IFwKLSAgICAgICAgICAgICAgICAgICAgICooKFVMb25nKikoZHN0KzQpKSA9IHRlbXA7IFwKLSAgICAgICAgICAgICAgICAgICAgICooKFVMb25nKikoZHN0Kz1seCkpID0gdGVtcDsgXAotICAgICAgICAgICAgICAgICAgICAgKigoVUxvbmcqKShkc3QrNCkpID0gdGVtcDsgXAotICAgICAgICAgICAgICAgICAgICAgKigoVUxvbmcqKShkc3QrPWx4KSkgPSB0ZW1wOyBcCi0gICAgICAgICAgICAgICAgICAgICAqKChVTG9uZyopKGRzdCs0KSkgPSB0ZW1wOyBcCi0gICAgICAgICAgICAgICAgICAgICAqKChVTG9uZyopKGRzdCs9bHgpKSA9IHRlbXA7IFwKLSAgICAgICAgICAgICAgICAgICAgICooKFVMb25nKikoZHN0KzQpKSA9IHRlbXA7IFwKLSAgICAgICAgICAgICAgICAgICAgICooKFVMb25nKikoZHN0Kz1seCkpID0gdGVtcDsgXAotICAgICAgICAgICAgICAgICAgICAgKigoVUxvbmcqKShkc3QrNCkpID0gdGVtcDsgXAotICAgICAgICAgICAgICAgICAgICAgKigoVUxvbmcqKShkc3QrPWx4KSkgPSB0ZW1wOyBcCi0gICAgICAgICAgICAgICAgICAgICAqKChVTG9uZyopKGRzdCs0KSkgPSB0ZW1wOyBcCi0gICAgICAgICAgICAgICAgICAgICAqKChVTG9uZyopKGRzdCs9bHgpKSA9IHRlbXA7IFwKLSAgICAgICAgICAgICAgICAgICAgICooKFVMb25nKikoZHN0KzQpKSA9IHRlbXA7IH0KLQotI2RlZmluZSBQQURfUk9XICAgICB7IHRlbXAgPSAqKChVTG9uZyopc3JjKTsgXAotICAgICAgICAgICAgICAgICAgICAgIHRlbXAyID0gKigoVUxvbmcqKShzcmMrNCkpOyBcCi0gICAgICAgICAgICAgICAgICAgICAgKigoVUxvbmcqKWRzdCkgPSB0ZW1wOyBcCi0gICAgICAgICAgICAgICAgICAgICAgKigoVUxvbmcqKShkc3QrNCkpID0gdGVtcDI7IFwKLSAgICAgICAgICAgICAgICAgICAgICAqKChVTG9uZyopKGRzdCs9bHgpKSA9IHRlbXA7IFwKLSAgICAgICAgICAgICAgICAgICAgICAqKChVTG9uZyopKGRzdCs0KSkgPSB0ZW1wMjsgXAotICAgICAgICAgICAgICAgICAgICAgICooKFVMb25nKikoZHN0Kz1seCkpID0gdGVtcDsgXAotICAgICAgICAgICAgICAgICAgICAgICooKFVMb25nKikoZHN0KzQpKSA9IHRlbXAyOyBcCi0gICAgICAgICAgICAgICAgICAgICAgKigoVUxvbmcqKShkc3QrPWx4KSkgPSB0ZW1wOyBcCi0gICAgICAgICAgICAgICAgICAgICAgKigoVUxvbmcqKShkc3QrNCkpID0gdGVtcDI7IFwKLSAgICAgICAgICAgICAgICAgICAgICAqKChVTG9uZyopKGRzdCs9bHgpKSA9IHRlbXA7IFwKLSAgICAgICAgICAgICAgICAgICAgICAqKChVTG9uZyopKGRzdCs0KSkgPSB0ZW1wMjsgXAotICAgICAgICAgICAgICAgICAgICAgICooKFVMb25nKikoZHN0Kz1seCkpID0gdGVtcDsgXAotICAgICAgICAgICAgICAgICAgICAgICooKFVMb25nKikoZHN0KzQpKSA9IHRlbXAyOyBcCi0gICAgICAgICAgICAgICAgICAgICAgKigoVUxvbmcqKShkc3QrPWx4KSkgPSB0ZW1wOyBcCi0gICAgICAgICAgICAgICAgICAgICAgKigoVUxvbmcqKShkc3QrNCkpID0gdGVtcDI7IFwKLSAgICAgICAgICAgICAgICAgICAgICAqKChVTG9uZyopKGRzdCs9bHgpKSA9IHRlbXA7IFwKLSAgICAgICAgICAgICAgICAgICAgICAqKChVTG9uZyopKGRzdCs0KSkgPSB0ZW1wMjsgfQotCi0jZGVmaW5lIFBBRF9DT0wgICAgIHsgdGVtcCA9ICpzcmM7ICAgdGVtcCB8PSAodGVtcDw8OCk7ICB0ZW1wIHw9ICh0ZW1wPDwxNik7IFwKLSAgICAgICAgICAgICAgICAgICAgICAqKChVTG9uZyopZHN0KSA9IHRlbXA7IFwKLSAgICAgICAgICAgICAgICAgICAgICooKFVMb25nKikoZHN0KzQpKSA9IHRlbXA7IFwKLSAgICAgICAgICAgICAgICAgICAgICB0ZW1wID0gKihzcmMrPWx4KTsgICAgIHRlbXAgfD0gKHRlbXA8PDgpOyAgdGVtcCB8PSAodGVtcDw8MTYpOyBcCi0gICAgICAgICAgICAgICAgICAgICAgKigoVUxvbmcqKShkc3QrPWx4KSkgPSB0ZW1wOyBcCi0gICAgICAgICAgICAgICAgICAgICAqKChVTG9uZyopKGRzdCs0KSkgPSB0ZW1wOyBcCi0gICAgICAgICAgICAgICAgICAgICAgdGVtcCA9ICooc3JjKz1seCk7ICAgICB0ZW1wIHw9ICh0ZW1wPDw4KTsgIHRlbXAgfD0gKHRlbXA8PDE2KTsgXAotICAgICAgICAgICAgICAgICAgICAgICooKFVMb25nKikoZHN0Kz1seCkpID0gdGVtcDsgXAotICAgICAgICAgICAgICAgICAgICAgKigoVUxvbmcqKShkc3QrNCkpID0gdGVtcDsgXAotICAgICAgICAgICAgICAgICAgICAgIHRlbXAgPSAqKHNyYys9bHgpOyAgICAgdGVtcCB8PSAodGVtcDw8OCk7ICB0ZW1wIHw9ICh0ZW1wPDwxNik7IFwKLSAgICAgICAgICAgICAgICAgICAgICAqKChVTG9uZyopKGRzdCs9bHgpKSA9IHRlbXA7IFwKLSAgICAgICAgICAgICAgICAgICAgICooKFVMb25nKikoZHN0KzQpKSA9IHRlbXA7IFwKLSAgICAgICAgICAgICAgICAgICAgICB0ZW1wID0gKihzcmMrPWx4KTsgICAgIHRlbXAgfD0gKHRlbXA8PDgpOyAgdGVtcCB8PSAodGVtcDw8MTYpOyBcCi0gICAgICAgICAgICAgICAgICAgICAgKigoVUxvbmcqKShkc3QrPWx4KSkgPSB0ZW1wOyBcCi0gICAgICAgICAgICAgICAgICAgICAqKChVTG9uZyopKGRzdCs0KSkgPSB0ZW1wOyBcCi0gICAgICAgICAgICAgICAgICAgICAgdGVtcCA9ICooc3JjKz1seCk7ICAgICB0ZW1wIHw9ICh0ZW1wPDw4KTsgIHRlbXAgfD0gKHRlbXA8PDE2KTsgXAotICAgICAgICAgICAgICAgICAgICAgICooKFVMb25nKikoZHN0Kz1seCkpID0gdGVtcDsgXAotICAgICAgICAgICAgICAgICAgICAgKigoVUxvbmcqKShkc3QrNCkpID0gdGVtcDsgXAotICAgICAgICAgICAgICAgICAgICAgIHRlbXAgPSAqKHNyYys9bHgpOyAgICAgdGVtcCB8PSAodGVtcDw8OCk7ICB0ZW1wIHw9ICh0ZW1wPDwxNik7IFwKLSAgICAgICAgICAgICAgICAgICAgICAqKChVTG9uZyopKGRzdCs9bHgpKSA9IHRlbXA7IFwKLSAgICAgICAgICAgICAgICAgICAgICooKFVMb25nKikoZHN0KzQpKSA9IHRlbXA7IFwKLSAgICAgICAgICAgICAgICAgICAgICB0ZW1wID0gKihzcmMrPWx4KTsgICAgIHRlbXAgfD0gKHRlbXA8PDgpOyAgdGVtcCB8PSAodGVtcDw8MTYpOyBcCi0gICAgICAgICAgICAgICAgICAgICAgKigoVUxvbmcqKShkc3QrPWx4KSkgPSB0ZW1wOyBcCi0gICAgICAgICAgICAgICAgICAgICAgKigoVUxvbmcqKShkc3QrNCkpID0gdGVtcDsgfQotCi0KLUludCBFbmNHZXRQcmVkT3V0c2lkZShJbnQgeHBvcywgSW50IHlwb3MsIFVDaGFyICpjX3ByZXYsIFVDaGFyICpyZWMsCi0gICAgICAgICAgICAgICAgICAgICAgSW50IHdpZHRoLCBJbnQgaGVpZ2h0LCBJbnQgcm5kMSkKLXsKLSAgICBJbnQgbHg7Ci0gICAgVUNoYXIgKnNyYywgKmRzdDsKLSAgICBVTG9uZyB0ZW1wLCB0ZW1wMjsKLSAgICBJbnQgeG9mZnNldDsKLQotICAgIGx4ID0gd2lkdGggKyAxNjsgLyogb25seSB3b3JrcyBmb3IgY2hyb21hICovCi0KLSAgICBpZiAoeHBvcyA8IDApCi0gICAgewotICAgICAgICBpZiAoeXBvcyA8IDApIC8qIHBhZCB0b3AtbGVmdCAqLwotICAgICAgICB7Ci0gICAgICAgICAgICAvKiBwYWQgY29ybmVyICovCi0gICAgICAgICAgICBzcmMgPSBjX3ByZXY7Ci0gICAgICAgICAgICBkc3QgPSBjX3ByZXYgLSAobHggPDwgMykgLSA4OwotICAgICAgICAgICAgUEFEX0NPUk5FUgotCi0gICAgICAgICAgICAvKiBwYWQgdG9wICovCi0gICAgICAgICAgICBkc3QgPSBjX3ByZXYgLSAobHggPDwgMyk7Ci0gICAgICAgICAgICBQQURfUk9XCi0KLSAgICAgICAgICAgIC8qIHBhZCBsZWZ0ICovCi0gICAgICAgICAgICBkc3QgPSBjX3ByZXYgLSA4OwotICAgICAgICAgICAgUEFEX0NPTAotCi0gICAgICAgICAgICBHZXRQcmVkQWR2QlRhYmxlW3lwb3MmMV1beHBvcyYxXShjX3ByZXYgKyAoeHBvcyA+PiAxKSArICgoeXBvcyA+PiAxKSpseCksCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZWMsIGx4LCBybmQxKTsKLQotICAgICAgICAgICAgcmV0dXJuIDE7Ci0gICAgICAgIH0KLSAgICAgICAgZWxzZSBpZiAoKHlwb3MgPj4gMSkgPCAoaGVpZ2h0IC0gOCkpIC8qIHBhZCBsZWZ0IG9mIGZyYW1lICovCi0gICAgICAgIHsKLSAgICAgICAgICAgIC8qIHBhZCBsZWZ0ICovCi0gICAgICAgICAgICBzcmMgPSBjX3ByZXYgKyAoeXBvcyA+PiAxKSAqIGx4OwotICAgICAgICAgICAgZHN0ID0gc3JjIC0gODsKLSAgICAgICAgICAgIFBBRF9DT0wKLSAgICAgICAgICAgIC8qIHBhZCBleHRyYSByb3cgKi8KLSAgICAgICAgICAgIHRlbXAgPSAqKHNyYyArPSBseCk7Ci0gICAgICAgICAgICB0ZW1wIHw9ICh0ZW1wIDw8IDgpOwotICAgICAgICAgICAgdGVtcCB8PSAodGVtcCA8PCAxNik7Ci0gICAgICAgICAgICAqKChVTG9uZyopKGRzdCArPSBseCkpID0gdGVtcDsKLSAgICAgICAgICAgICooKFVMb25nKikoZHN0ICsgNCkpID0gdGVtcDsKLQotICAgICAgICAgICAgR2V0UHJlZEFkdkJUYWJsZVt5cG9zJjFdW3hwb3MmMV0oY19wcmV2ICsgKHhwb3MgPj4gMSkgKyAoKHlwb3MgPj4gMSkqbHgpLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmVjLCBseCwgcm5kMSk7Ci0KLSAgICAgICAgICAgIHJldHVybiAxOwotICAgICAgICB9Ci0gICAgICAgIGVsc2UgLyogcGFkIGJvdHRvbS1sZWZ0ICovCi0gICAgICAgIHsKLSAgICAgICAgICAgIC8qIHBhZCBjb3JuZXIgKi8KLSAgICAgICAgICAgIHNyYyA9IGNfcHJldiArIChoZWlnaHQgLSAxKSAqIGx4OwotICAgICAgICAgICAgZHN0ID0gc3JjICsgbHggLSA4OwotICAgICAgICAgICAgUEFEX0NPUk5FUgotCi0gICAgICAgICAgICAvKiBwYWQgYm90dG9tICovCi0gICAgICAgICAgICBkc3QgPSBzcmMgKyBseDsKLSAgICAgICAgICAgIFBBRF9ST1cKLQotICAgICAgICAgICAgLyogcGFkIGxlZnQgKi8KLSAgICAgICAgICAgIHNyYyAtPSAobHggPDwgMyk7Ci0gICAgICAgICAgICBzcmMgKz0gbHg7Ci0gICAgICAgICAgICBkc3QgPSBzcmMgLSA4OwotICAgICAgICAgICAgUEFEX0NPTAotCi0gICAgICAgICAgICBHZXRQcmVkQWR2QlRhYmxlW3lwb3MmMV1beHBvcyYxXShjX3ByZXYgKyAoeHBvcyA+PiAxKSArICgoeXBvcyA+PiAxKSpseCksCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZWMsIGx4LCBybmQxKTsKLQotICAgICAgICAgICAgcmV0dXJuIDE7Ci0gICAgICAgIH0KLSAgICB9Ci0gICAgZWxzZSBpZiAoKHhwb3MgPj4gMSkgPCAod2lkdGggLSA4KSkKLSAgICB7Ci0gICAgICAgIGlmICh5cG9zIDwgMCkgLyogcGFkIHRvcCBvZiBmcmFtZSAqLwotICAgICAgICB7Ci0gICAgICAgICAgICB4b2Zmc2V0ID0gKHhwb3MgPj4gMSkgJiAweDM7Ci0gICAgICAgICAgICBzcmMgPSBjX3ByZXYgKyAoeHBvcyA+PiAxKSAtIHhvZmZzZXQ7Ci0gICAgICAgICAgICBkc3QgPSBzcmMgLSAobHggPDwgMyk7Ci0gICAgICAgICAgICBQQURfUk9XCi0gICAgICAgICAgICBpZiAoeG9mZnNldCB8fCAoeHBvcyYxKSkKLSAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICB0ZW1wID0gKigoVUxvbmcqKShzcmMgKyA4KSk7Ci0gICAgICAgICAgICAgICAgZHN0ID0gc3JjIC0gKGx4IDw8IDMpICsgODsKLSAgICAgICAgICAgICAgICAqKChVTG9uZyopZHN0KSA9IHRlbXA7Ci0gICAgICAgICAgICAgICAgKigoVUxvbmcqKShkc3QgKz0gbHgpKSA9IHRlbXA7Ci0gICAgICAgICAgICAgICAgKigoVUxvbmcqKShkc3QgKz0gbHgpKSA9IHRlbXA7Ci0gICAgICAgICAgICAgICAgKigoVUxvbmcqKShkc3QgKz0gbHgpKSA9IHRlbXA7Ci0gICAgICAgICAgICAgICAgKigoVUxvbmcqKShkc3QgKz0gbHgpKSA9IHRlbXA7Ci0gICAgICAgICAgICAgICAgKigoVUxvbmcqKShkc3QgKz0gbHgpKSA9IHRlbXA7Ci0gICAgICAgICAgICAgICAgKigoVUxvbmcqKShkc3QgKz0gbHgpKSA9IHRlbXA7Ci0gICAgICAgICAgICAgICAgKigoVUxvbmcqKShkc3QgKz0gbHgpKSA9IHRlbXA7Ci0gICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgIEdldFByZWRBZHZCVGFibGVbeXBvcyYxXVt4cG9zJjFdKGNfcHJldiArICh4cG9zID4+IDEpICsgKCh5cG9zID4+IDEpKmx4KSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJlYywgbHgsIHJuZDEpOwotCi0gICAgICAgICAgICByZXR1cm4gMTsKLSAgICAgICAgfQotICAgICAgICBlbHNlIC8qIHBhZCBib3R0b20gb2YgZnJhbWUgKi8KLSAgICAgICAgewotICAgICAgICAgICAgeG9mZnNldCA9ICh4cG9zID4+IDEpICYgMHgzOwotICAgICAgICAgICAgc3JjID0gY19wcmV2ICsgKHhwb3MgPj4gMSkgLSB4b2Zmc2V0ICsgKGhlaWdodCAtIDEpICogbHg7Ci0gICAgICAgICAgICBkc3QgPSBzcmMgKyBseDsKLSAgICAgICAgICAgIFBBRF9ST1cKLSAgICAgICAgICAgIGlmICh4b2Zmc2V0IHx8ICh4cG9zJjEpKQotICAgICAgICAgICAgewotICAgICAgICAgICAgICAgIHRlbXAgPSAqKChVTG9uZyopKHNyYyArIDgpKTsKLSAgICAgICAgICAgICAgICBkc3QgPSBzcmMgKyBseCArIDg7Ci0gICAgICAgICAgICAgICAgKigoVUxvbmcqKWRzdCkgPSB0ZW1wOwotICAgICAgICAgICAgICAgICooKFVMb25nKikoZHN0ICs9IGx4KSkgPSB0ZW1wOwotICAgICAgICAgICAgICAgICooKFVMb25nKikoZHN0ICs9IGx4KSkgPSB0ZW1wOwotICAgICAgICAgICAgICAgICooKFVMb25nKikoZHN0ICs9IGx4KSkgPSB0ZW1wOwotICAgICAgICAgICAgICAgICooKFVMb25nKikoZHN0ICs9IGx4KSkgPSB0ZW1wOwotICAgICAgICAgICAgICAgICooKFVMb25nKikoZHN0ICs9IGx4KSkgPSB0ZW1wOwotICAgICAgICAgICAgICAgICooKFVMb25nKikoZHN0ICs9IGx4KSkgPSB0ZW1wOwotICAgICAgICAgICAgICAgICooKFVMb25nKikoZHN0ICs9IGx4KSkgPSB0ZW1wOwotICAgICAgICAgICAgfQotCi0gICAgICAgICAgICBHZXRQcmVkQWR2QlRhYmxlW3lwb3MmMV1beHBvcyYxXShjX3ByZXYgKyAoeHBvcyA+PiAxKSArICgoeXBvcyA+PiAxKSpseCksCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZWMsIGx4LCBybmQxKTsKLQotICAgICAgICAgICAgcmV0dXJuIDE7Ci0gICAgICAgIH0KLSAgICB9Ci0gICAgZWxzZQotICAgIHsKLSAgICAgICAgaWYgKHlwb3MgPCAwKSAvKiBwYWQgdG9wLXJpZ2h0ICovCi0gICAgICAgIHsKLSAgICAgICAgICAgIC8qIHBhZCBjb3JuZXIgKi8KLSAgICAgICAgICAgIHNyYyA9IGNfcHJldiArIHdpZHRoIC0gMTsKLSAgICAgICAgICAgIGRzdCA9IHNyYyAtIChseCA8PCAzKSArIDE7Ci0gICAgICAgICAgICBQQURfQ09STkVSCi0KLSAgICAgICAgICAgIC8qIHBhZCB0b3AgKi8KLSAgICAgICAgICAgIHNyYyAtPSA3OwotICAgICAgICAgICAgZHN0ID0gc3JjIC0gKGx4IDw8IDMpOwotICAgICAgICAgICAgUEFEX1JPVwotCi0gICAgICAgICAgICAvKiBwYWQgbGVmdCAqLwotICAgICAgICAgICAgc3JjICs9IDc7Ci0gICAgICAgICAgICBkc3QgPSBzcmMgKyAxOwotICAgICAgICAgICAgUEFEX0NPTAotCi0gICAgICAgICAgICBHZXRQcmVkQWR2QlRhYmxlW3lwb3MmMV1beHBvcyYxXShjX3ByZXYgKyAoeHBvcyA+PiAxKSArICgoeXBvcyA+PiAxKSpseCksCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZWMsIGx4LCBybmQxKTsKLQotICAgICAgICAgICAgcmV0dXJuIDE7Ci0gICAgICAgIH0KLSAgICAgICAgZWxzZSBpZiAoKHlwb3MgPj4gMSkgPCAoaGVpZ2h0IC0gQl9TSVpFKSkgLyogcGFkIHJpZ2h0IG9mIGZyYW1lICovCi0gICAgICAgIHsKLSAgICAgICAgICAgIC8qIHBhZCBsZWZ0ICovCi0gICAgICAgICAgICBzcmMgPSBjX3ByZXYgKyAoeXBvcyA+PiAxKSAqIGx4ICsgd2lkdGggLSAxOwotICAgICAgICAgICAgZHN0ID0gc3JjICsgMTsKLSAgICAgICAgICAgIFBBRF9DT0wKLSAgICAgICAgICAgIC8qIHBhZCBleHRyYSByb3cgKi8KLSAgICAgICAgICAgIHRlbXAgPSAqKHNyYyArPSBseCk7Ci0gICAgICAgICAgICB0ZW1wIHw9ICh0ZW1wIDw8IDgpOwotICAgICAgICAgICAgdGVtcCB8PSAodGVtcCA8PCAxNik7Ci0gICAgICAgICAgICAqKChVTG9uZyopKGRzdCArPSBseCkpID0gdGVtcDsKLSAgICAgICAgICAgICooKFVMb25nKikoZHN0ICsgNCkpID0gdGVtcDsKLQotICAgICAgICAgICAgR2V0UHJlZEFkdkJUYWJsZVt5cG9zJjFdW3hwb3MmMV0oY19wcmV2ICsgKHhwb3MgPj4gMSkgKyAoKHlwb3MgPj4gMSkqbHgpLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmVjLCBseCwgcm5kMSk7Ci0KLSAgICAgICAgICAgIHJldHVybiAxOwotICAgICAgICB9Ci0gICAgICAgIGVsc2UgLyogcGFkIGJvdHRvbS1yaWdodCAqLwotICAgICAgICB7Ci0gICAgICAgICAgICAvKiBwYWQgbGVmdCAqLwotICAgICAgICAgICAgc3JjID0gY19wcmV2ICsgKGhlaWdodCAtIDgpICogbHggKyB3aWR0aCAtIDE7Ci0gICAgICAgICAgICBkc3QgPSBzcmMgKyAxOwotICAgICAgICAgICAgUEFEX0NPTAotCi0gICAgICAgICAgICAvKiBwYWQgY29ybmVyICovCi0gICAgICAgICAgICBkc3QgPSBzcmMgKyBseCArIDE7Ci0gICAgICAgICAgICBQQURfQ09STkVSCi0KLSAgICAgICAgICAgIC8qIHBhZCBib3R0b20gKi8KLSAgICAgICAgICAgIHNyYyAtPSA3OwotICAgICAgICAgICAgZHN0ID0gc3JjICsgbHg7Ci0gICAgICAgICAgICBQQURfUk9XCi0KLSAgICAgICAgICAgIEdldFByZWRBZHZCVGFibGVbeXBvcyYxXVt4cG9zJjFdKGNfcHJldiArICh4cG9zID4+IDEpICsgKCh5cG9zID4+IDEpKmx4KSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJlYywgbHgsIHJuZDEpOwotCi0gICAgICAgICAgICByZXR1cm4gMTsKLSAgICAgICAgfQotICAgIH0KLX0KLQotLyogPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PSAvCi0gICAgRnVuY3Rpb24gOiBDb3B5X01CX2Zyb21fVm9wKCkKLSAgICBEYXRlICAgICA6IDA0LzE3LzIwMDEKLSA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09ICovCi0KLXZvaWQgQ29weV9NQl9mcm9tX1ZvcChVQ2hhciAqY29tcCwgSW50IHlDaGFuW11bTkNPRUZGX0JMT0NLXSwgSW50IHBpdGNoKQotewotICAgIEludCByb3csIGNvbCwgaTsKLSAgICBJbnQgKnNyYzEsICpzcmMyOwotICAgIEludCBvZmZzZXQgPSBwaXRjaCAtIE1CX1NJWkU7Ci0gICAgVUxvbmcgdGVtcDsKLQotICAgIGZvciAoaSA9IDA7IGkgPCA0OyBpICs9IDIpCi0gICAgewotICAgICAgICBzcmMxID0geUNoYW5baV07Ci0gICAgICAgIHNyYzIgPSB5Q2hhbltpKzFdOwotCi0gICAgICAgIHJvdyA9IEJfU0laRTsKLSAgICAgICAgd2hpbGUgKHJvdy0tKQotICAgICAgICB7Ci0gICAgICAgICAgICBjb2wgPSBCX1NJWkU7Ci0gICAgICAgICAgICB3aGlsZSAoY29sKQotICAgICAgICAgICAgewotICAgICAgICAgICAgICAgIHRlbXAgPSAqKChVTG9uZyopY29tcCk7Ci0gICAgICAgICAgICAgICAgKnNyYzErKyA9IChJbnQpKHRlbXAgJiAweEZGKTsKLSAgICAgICAgICAgICAgICAqc3JjMSsrID0gKEludCkoKHRlbXAgPj4gOCkgJiAweEZGKTsKLSAgICAgICAgICAgICAgICAqc3JjMSsrID0gKEludCkoKHRlbXAgPj4gMTYpICYgMHhGRik7Ci0gICAgICAgICAgICAgICAgKnNyYzErKyA9IChJbnQpKCh0ZW1wID4+IDI0KSAmIDB4RkYpOwotICAgICAgICAgICAgICAgIGNvbXAgKz0gNDsKLSAgICAgICAgICAgICAgICBjb2wgLT0gNDsKLSAgICAgICAgICAgIH0KLSAgICAgICAgICAgIGNvbCA9IEJfU0laRTsKLSAgICAgICAgICAgIHdoaWxlIChjb2wpCi0gICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgdGVtcCA9ICooKFVMb25nKiljb21wKTsKLSAgICAgICAgICAgICAgICAqc3JjMisrID0gKEludCkodGVtcCAmIDB4RkYpOwotICAgICAgICAgICAgICAgICpzcmMyKysgPSAoSW50KSgodGVtcCA+PiA4KSAmIDB4RkYpOwotICAgICAgICAgICAgICAgICpzcmMyKysgPSAoSW50KSgodGVtcCA+PiAxNikgJiAweEZGKTsKLSAgICAgICAgICAgICAgICAqc3JjMisrID0gKEludCkoKHRlbXAgPj4gMjQpICYgMHhGRik7Ci0gICAgICAgICAgICAgICAgY29tcCArPSA0OwotICAgICAgICAgICAgICAgIGNvbCAtPSA0OwotICAgICAgICAgICAgfQotICAgICAgICAgICAgY29tcCArPSBvZmZzZXQ7Ci0gICAgICAgIH0KLSAgICB9Ci0gICAgcmV0dXJuIDsKLX0KLQotLyogPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PSAvCi0gICAgRnVuY3Rpb24gOiBDb3B5X0JfZnJvbV9Wb3AoKQotICAgIERhdGUgICAgIDogMDQvMTcvMjAwMQotLyA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09ICovCi0KLXZvaWQgQ29weV9CX2Zyb21fVm9wKFVDaGFyICpjb21wLCBJbnQgY0NoYW5bXSwgSW50IHBpdGNoKQotewotICAgIEludCByb3csIGNvbDsKLSAgICBJbnQgb2Zmc2V0ID0gcGl0Y2ggLSBCX1NJWkU7Ci0gICAgVUxvbmcgdGVtcDsKLQotICAgIHJvdyA9IEJfU0laRTsKLSAgICB3aGlsZSAocm93LS0pCi0gICAgewotICAgICAgICBjb2wgPSBCX1NJWkU7Ci0gICAgICAgIHdoaWxlIChjb2wpCi0gICAgICAgIHsKLSAgICAgICAgICAgIHRlbXAgPSAqKChVTG9uZyopY29tcCk7Ci0gICAgICAgICAgICAqY0NoYW4rKyA9IChJbnQpKHRlbXAgJiAweEZGKTsKLSAgICAgICAgICAgICpjQ2hhbisrID0gKEludCkoKHRlbXAgPj4gOCkgJiAweEZGKTsKLSAgICAgICAgICAgICpjQ2hhbisrID0gKEludCkoKHRlbXAgPj4gMTYpICYgMHhGRik7Ci0gICAgICAgICAgICAqY0NoYW4rKyA9IChJbnQpKCh0ZW1wID4+IDI0KSAmIDB4RkYpOwotICAgICAgICAgICAgY29tcCArPSA0OwotICAgICAgICAgICAgY29sIC09IDQ7Ci0gICAgICAgIH0KLSAgICAgICAgY29tcCArPSBvZmZzZXQ7Ci0gICAgfQotfQotCi0vKiA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09IC8KLSAgICBGdW5jdGlvbiA6IENvcHlfTUJfaW50b19Wb3AoKQotICAgIERhdGUgICAgIDogMDQvMTcvMjAwMQotICAgIEhpc3RvcnkgIDogRnJvbSBkZWNvZGVyCi0vID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0gKi8KLQotdm9pZCBDb3B5X01CX2ludG9fVm9wKFVDaGFyICpjb21wLCBJbnQgeUNoYW5bXVtOQ09FRkZfQkxPQ0tdLCBJbnQgcGl0Y2gpCi17Ci0gICAgSW50IHJvdywgY29sLCBpOwotICAgIEludCAqc3JjMSwgKnNyYzI7Ci0gICAgSW50IG9mZnNldCA9IHBpdGNoIC0gTUJfU0laRTsKLSAgICBVQ2hhciBtYXNrID0gMHhGRjsKLSAgICBJbnQgdG1wOwotICAgIFVMb25nIHRlbXA7Ci0KLSAgICBmb3IgKGkgPSAwOyBpIDwgNDsgaSArPSAyKQotICAgIHsKLSAgICAgICAgc3JjMSA9IHlDaGFuW2ldOwotICAgICAgICBzcmMyID0geUNoYW5baSsxXTsKLQotICAgICAgICByb3cgPSBCX1NJWkU7Ci0gICAgICAgIHdoaWxlIChyb3ctLSkKLSAgICAgICAgewotICAgICAgICAgICAgY29sID0gQl9TSVpFOwotICAgICAgICAgICAgd2hpbGUgKGNvbCkKLSAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICB0bXAgPSAoKnNyYzErKyk7Ci0gICAgICAgICAgICAgICAgaWYgKChVSW50KXRtcCA+IG1hc2spIHRtcCA9IG1hc2sgJiAofih0bXAgPj4gMzEpKTsKLSAgICAgICAgICAgICAgICB0ZW1wID0gdG1wIDw8IDI0OwotICAgICAgICAgICAgICAgIHRtcCA9ICgqc3JjMSsrKTsKLSAgICAgICAgICAgICAgICBpZiAoKFVJbnQpdG1wID4gbWFzaykgdG1wID0gbWFzayAmICh+KHRtcCA+PiAzMSkpOwotICAgICAgICAgICAgICAgIHRlbXAgfD0gKHRtcCA8PCAxNik7Ci0gICAgICAgICAgICAgICAgdG1wID0gKCpzcmMxKyspOwotICAgICAgICAgICAgICAgIGlmICgoVUludCl0bXAgPiBtYXNrKSB0bXAgPSBtYXNrICYgKH4odG1wID4+IDMxKSk7Ci0gICAgICAgICAgICAgICAgdGVtcCB8PSAodG1wIDw8IDgpOwotICAgICAgICAgICAgICAgIHRtcCA9ICgqc3JjMSsrKTsKLSAgICAgICAgICAgICAgICBpZiAoKFVJbnQpdG1wID4gbWFzaykgdG1wID0gbWFzayAmICh+KHRtcCA+PiAzMSkpOwotICAgICAgICAgICAgICAgIHRlbXAgfD0gdG1wOwotICAgICAgICAgICAgICAgICooKFVMb25nKiljb21wKSA9IHRlbXA7Ci0gICAgICAgICAgICAgICAgY29tcCArPSA0OwotICAgICAgICAgICAgICAgIGNvbCAtPSA0OwotICAgICAgICAgICAgfQotICAgICAgICAgICAgY29sID0gQl9TSVpFOwotICAgICAgICAgICAgd2hpbGUgKGNvbCkKLSAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICB0bXAgPSAoKnNyYzIrKyk7Ci0gICAgICAgICAgICAgICAgaWYgKChVSW50KXRtcCA+IG1hc2spIHRtcCA9IG1hc2sgJiAofih0bXAgPj4gMzEpKTsKLSAgICAgICAgICAgICAgICB0ZW1wID0gdG1wIDw8IDI0OwotICAgICAgICAgICAgICAgIHRtcCA9ICgqc3JjMisrKTsKLSAgICAgICAgICAgICAgICBpZiAoKFVJbnQpdG1wID4gbWFzaykgdG1wID0gbWFzayAmICh+KHRtcCA+PiAzMSkpOwotICAgICAgICAgICAgICAgIHRlbXAgfD0gKHRtcCA8PCAxNik7Ci0gICAgICAgICAgICAgICAgdG1wID0gKCpzcmMyKyspOwotICAgICAgICAgICAgICAgIGlmICgoVUludCl0bXAgPiBtYXNrKSB0bXAgPSBtYXNrICYgKH4odG1wID4+IDMxKSk7Ci0gICAgICAgICAgICAgICAgdGVtcCB8PSAodG1wIDw8IDgpOwotICAgICAgICAgICAgICAgIHRtcCA9ICgqc3JjMisrKTsKLSAgICAgICAgICAgICAgICBpZiAoKFVJbnQpdG1wID4gbWFzaykgdG1wID0gbWFzayAmICh+KHRtcCA+PiAzMSkpOwotICAgICAgICAgICAgICAgIHRlbXAgfD0gdG1wOwotICAgICAgICAgICAgICAgICooKFVMb25nKiljb21wKSA9IHRlbXA7Ci0gICAgICAgICAgICAgICAgY29tcCArPSA0OwotICAgICAgICAgICAgICAgIGNvbCAtPSA0OwotICAgICAgICAgICAgfQotICAgICAgICAgICAgY29tcCArPSBvZmZzZXQ7Ci0gICAgICAgIH0KLSAgICB9Ci0gICAgcmV0dXJuIDsKLX0KLQotCi0vKiA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09IC8KLSAgICBGdW5jdGlvbiA6IENvcHlfQl9pbnRvX1ZvcCgpCi0gICAgRGF0ZSAgICAgOiAwNC8xNy8yMDAxCi0gICAgSGlzdG9yeSAgOiBGcm9tIGRlY29kZXIKLS8gPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PSAqLwotCi12b2lkIENvcHlfQl9pbnRvX1ZvcChVQ2hhciAqY29tcCwgSW50IGNDaGFuW10sIEludCBwaXRjaCkKLXsKLSAgICBJbnQgcm93LCBjb2w7Ci0gICAgSW50IG9mZnNldCA9IHBpdGNoIC0gQl9TSVpFOwotICAgIEludCB0bXA7Ci0gICAgVUNoYXIgbWFzayA9IDB4RkY7Ci0gICAgVUxvbmcgdGVtcDsKLQotICAgIHJvdyA9IEJfU0laRTsKLSAgICB3aGlsZSAocm93LS0pCi0gICAgewotICAgICAgICBjb2wgPSBCX1NJWkU7Ci0gICAgICAgIHdoaWxlIChjb2wpCi0gICAgICAgIHsKLSAgICAgICAgICAgIHRtcCA9ICgqY0NoYW4rKyk7Ci0gICAgICAgICAgICBpZiAoKFVJbnQpdG1wID4gbWFzaykgdG1wID0gbWFzayAmICh+KHRtcCA+PiAzMSkpOwotICAgICAgICAgICAgdGVtcCA9IHRtcCA8PCAyNDsKLSAgICAgICAgICAgIHRtcCA9ICgqY0NoYW4rKyk7Ci0gICAgICAgICAgICBpZiAoKFVJbnQpdG1wID4gbWFzaykgdG1wID0gbWFzayAmICh+KHRtcCA+PiAzMSkpOwotICAgICAgICAgICAgdGVtcCB8PSAodG1wIDw8IDE2KTsKLSAgICAgICAgICAgIHRtcCA9ICgqY0NoYW4rKyk7Ci0gICAgICAgICAgICBpZiAoKFVJbnQpdG1wID4gbWFzaykgdG1wID0gbWFzayAmICh+KHRtcCA+PiAzMSkpOwotICAgICAgICAgICAgdGVtcCB8PSAodG1wIDw8IDgpOwotICAgICAgICAgICAgdG1wID0gKCpjQ2hhbisrKTsKLSAgICAgICAgICAgIGlmICgoVUludCl0bXAgPiBtYXNrKSB0bXAgPSBtYXNrICYgKH4odG1wID4+IDMxKSk7Ci0gICAgICAgICAgICB0ZW1wIHw9IHRtcDsKLSAgICAgICAgICAgICooKFVMb25nKiljb21wKSA9IHRlbXA7Ci0gICAgICAgICAgICBjb21wICs9IDQ7Ci0gICAgICAgICAgICBjb2wgLT0gNDsKLSAgICAgICAgfQotICAgICAgICBjb21wICs9IG9mZnNldDsKLSAgICB9Ci19Ci0KLS8qID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PSAqLwotLyogIEZ1bmN0aW9uIDogZ2V0X01CKCApICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgRGF0ZSAgICAgOiAxMC8wMy8yMDAwICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICBQdXJwb3NlICA6IENvcHkgNCBZIHRvIHJlZmVyZW5jZSBmcmFtZSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogIEluL291dCAgIDogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgUmV0dXJuICAgOiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICBNb2RpZmllZCA6ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09ICovCi12b2lkIGdldF9NQihVQ2hhciAqY19wcmV2LCBVQ2hhciAqY19wcmV2X3UgICwgVUNoYXIgKmNfcHJldl92LAotICAgICAgICAgICAgU2hvcnQgbWJbNl1bNjRdLCBJbnQgbHgsIEludCBseF91dikKLQotewotICAgIEludCBpLCBqLCBjb3VudCA9IDAsIGNvdW50MSA9IDA7Ci0gICAgSW50IGsxID0gbHggLSBNQl9TSVpFLCBrMiA9IGx4X3V2IC0gQl9TSVpFOwotCi0gICAgZm9yIChpID0gMDsgaSA8IEJfU0laRTsgaSsrKQotICAgIHsKLSAgICAgICAgZm9yIChqID0gMDsgaiA8IEJfU0laRTsgaisrKQotICAgICAgICB7Ci0gICAgICAgICAgICBtYlswXVtjb3VudF0gPSAoSW50KSgqY19wcmV2KyspOwotICAgICAgICAgICAgbWJbNF1bY291bnRdID0gKEludCkoKmNfcHJldl91KyspOwotICAgICAgICAgICAgbWJbNV1bY291bnQrK10gPSAoSW50KSgqY19wcmV2X3YrKyk7Ci0gICAgICAgIH0KLQotICAgICAgICBmb3IgKGogPSAwOyBqIDwgQl9TSVpFOyBqKyspCi0gICAgICAgICAgICBtYlsxXVtjb3VudDErK10gPSAoSW50KSgqY19wcmV2KyspOwotCi0gICAgICAgIGNfcHJldiArPSBrMTsKLSAgICAgICAgY19wcmV2X3UgKz0gazI7Ci0gICAgICAgIGNfcHJldl92ICs9IGsyOwotCi0KLSAgICB9Ci0KLSAgICBjb3VudCA9IGNvdW50MSA9IDA7Ci0gICAgZm9yIChpID0gMDsgaSA8IEJfU0laRTsgaSsrKQotICAgIHsKLSAgICAgICAgZm9yIChqID0gMDsgaiA8IEJfU0laRTsgaisrKQotICAgICAgICAgICAgbWJbMl1bY291bnQrK10gPSAoSW50KSgqY19wcmV2KyspOwotCi0gICAgICAgIGZvciAoaiA9IDA7IGogPCBCX1NJWkU7IGorKykKLSAgICAgICAgICAgIG1iWzNdW2NvdW50MSsrXSA9IChJbnQpKCpjX3ByZXYrKyk7Ci0KLSAgICAgICAgY19wcmV2ICs9IGsxOwotICAgIH0KLX0KLQotdm9pZCBQdXRTa2lwcGVkQmxvY2soVUNoYXIgKnJlYywgVUNoYXIgKnByZXYsIEludCBseCkKLXsKLSAgICBVQ2hhciAqZW5kOwotICAgIEludCBvZmZzZXQgPSAobHggLSA4KSA+PiAyOwotICAgIEludCAqc3JjLCAqZHN0OwotCi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oaWxlIChudW1Mb29wLS0pCi0gICAgewotICAgICAgICBmb3IgKGogPSAwOyBqIDwgbWJoZWlnaHQ7IGorKykKLSAgICAgICAgewotICAgICAgICAgICAgaWYgKGluY3JfaSA+IDEpCi0gICAgICAgICAgICAgICAgc3RhcnRfaSA9IChzdGFydF9pID09IDAgPyAxIDogMCkgOyAvKiB0b2dnbGUgMCBhbmQgMSAqLwotCi0gICAgICAgICAgICBvZmZzZXQgPSB3aWR0aCAqIChqIDw8IDQpICsgKHN0YXJ0X2kgPDwgNCk7Ci0KLSAgICAgICAgICAgIG1ibnVtID0gaiAqIG1id2lkdGggKyBzdGFydF9pOwotCi0gICAgICAgICAgICBmb3IgKGkgPSBzdGFydF9pOyBpIDwgbWJ3aWR0aDsgaSArPSBpbmNyX2kpCi0gICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgdmlkZW8tPm1ibnVtID0gbWJudW07Ci0gICAgICAgICAgICAgICAgbW90X21iID0gbW90W21ibnVtXTsKLSAgICAgICAgICAgICAgICBtb2RlX21iID0gTW9kZSArIG1ibnVtOwotCi0gICAgICAgICAgICAgICAgY3VyID0gY3VyckZyYW1lLT55Q2hhbiArIG9mZnNldDsKLQotCi0gICAgICAgICAgICAgICAgaWYgKCptb2RlX21iICE9IE1PREVfSU5UUkEpCi0gICAgICAgICAgICAgICAgewotI2lmIGRlZmluZWQoSFRGTSkKLSAgICAgICAgICAgICAgICAgICAgSFRGTVByZXBhcmVDdXJNQih2aWRlbywgJmh0Zm1fc3RhdCwgY3VyKTsKLSNlbHNlCi0gICAgICAgICAgICAgICAgICAgIFByZXBhcmVDdXJNQih2aWRlbywgY3VyKTsKLSNlbmRpZgotICAgICAgICAgICAgICAgICAgICAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotICAgICAgICAgICAgICAgICAgICAvKioqKioqKiogZnVsbC1wZWwgMU1WIGFuZCA0TVZzIHNlYXJjaCAqKioqKioqKioqKioqKioqKioqKioqLwotCi0jaWZkZWYgX1NBRF9TVEFUCi0gICAgICAgICAgICAgICAgICAgIG51bV9NQisrOwotI2VuZGlmCi0gICAgICAgICAgICAgICAgICAgIE1CTW90aW9uU2VhcmNoKHZpZGVvLCBjdXIsIGJlc3RfY2FuZCwgaSA8PCA0LCBqIDw8IDQsIHR5cGVfcHJlZCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgRlNfZW4sICZocF9ndWVzcyk7Ci0KLSNpZmRlZiBQUklOVF9NVgotICAgICAgICAgICAgICAgICAgICBmcF9kZWJ1ZyA9IGZvcGVuKCJjOlxcYml0c3RyZWFtXFxtdjFfZGVidWcudHh0IiwgImEiKTsKLSAgICAgICAgICAgICAgICAgICAgZnByaW50ZihmcF9kZWJ1ZywgIiMlZCAoJWQsJWQsJWQpIDogIiwgbWJudW0sIG1vdF9tYlswXS54LCBtb3RfbWJbMF0ueSwgbW90X21iWzBdLnNhZCk7Ci0gICAgICAgICAgICAgICAgICAgIGZwcmludGYoZnBfZGVidWcsICIoJWQsJWQsJWQpIDogKCVkLCVkLCVkKSA6ICglZCwlZCwlZCkgOiAoJWQsJWQsJWQpIDogPT0+XG4iLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1vdF9tYlsxXS54LCBtb3RfbWJbMV0ueSwgbW90X21iWzFdLnNhZCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBtb3RfbWJbMl0ueCwgbW90X21iWzJdLnksIG1vdF9tYlsyXS5zYWQsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgbW90X21iWzNdLngsIG1vdF9tYlszXS55LCBtb3RfbWJbM10uc2FkLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1vdF9tYls0XS54LCBtb3RfbWJbNF0ueSwgbW90X21iWzRdLnNhZCk7Ci0gICAgICAgICAgICAgICAgICAgIGZjbG9zZShmcF9kZWJ1Zyk7Ci0jZW5kaWYKLSAgICAgICAgICAgICAgICAgICAgc2FkMTYgPSBtb3RfbWJbMF0uc2FkOwotI2lmZGVmIE5PX0lOVEVSNFYKLSAgICAgICAgICAgICAgICAgICAgc2FkOCA9IHNhZDE2OwotI2Vsc2UKLSAgICAgICAgICAgICAgICAgICAgc2FkOCA9IG1vdF9tYlsxXS5zYWQgKyBtb3RfbWJbMl0uc2FkICsgbW90X21iWzNdLnNhZCArIG1vdF9tYls0XS5zYWQ7Ci0jZW5kaWYKLQotICAgICAgICAgICAgICAgICAgICAvKiBjaG9vc2UgYmV0d2VlbiBJTlRSQSBvciBJTlRFUiAqLwotICAgICAgICAgICAgICAgICAgICAoKkNob29zZU1vZGUpKG1vZGVfbWIsIGN1ciwgd2lkdGgsICgoc2FkOCA8IHNhZDE2KSA/IHNhZDggOiBzYWQxNikpOwotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICBlbHNlICAgIC8qIElOVFJBIHVwZGF0ZSwgdXNlIGZvciBwcmVkaWN0aW9uIDMvMjMvMDEgKi8KLSAgICAgICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgICAgIG1vdF9tYlswXS54ID0gbW90X21iWzBdLnkgPSAwOwotICAgICAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgICAgIGlmICgqbW9kZV9tYiA9PSBNT0RFX0lOVFJBKQotICAgICAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAgICAgbnVtSW50cmErKyA7Ci0KLSAgICAgICAgICAgICAgICAgICAgLyogY29tcHV0ZSBTQVYgZm9yIHJhdGUgY29udHJvbCBhbmQgZmFzdCBEQ1QsIDExLzI4LzAwICovCi0gICAgICAgICAgICAgICAgICAgICgqQ29tcHV0ZU1CU3VtKShjdXIsIHdpZHRoLCBtb3RfbWIpOwotCi0gICAgICAgICAgICAgICAgICAgIC8qIGxlYXZlIG1vdF9tYlswXSBhcyBpdCBpcyBmb3IgZmFzdCBtb3Rpb24gc2VhcmNoICovCi0gICAgICAgICAgICAgICAgICAgIC8qIHNldCB0aGUgNCBNVnMgdG8gemVyb3MgKi8KLSAgICAgICAgICAgICAgICAgICAgZm9yIChjb21wID0gMTsgY29tcCA8PSA0OyBjb21wKyspCi0gICAgICAgICAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAgICAgICAgIG1vdF9tYltjb21wXS54ID0gMDsKLSAgICAgICAgICAgICAgICAgICAgICAgIG1vdF9tYltjb21wXS55ID0gMDsKLSAgICAgICAgICAgICAgICAgICAgfQotI2lmZGVmIFBSSU5UX01WCi0gICAgICAgICAgICAgICAgICAgIGZwX2RlYnVnID0gZm9wZW4oImM6XFxiaXRzdHJlYW1cXG12MV9kZWJ1Zy50eHQiLCAiYSIpOwotICAgICAgICAgICAgICAgICAgICBmcHJpbnRmKGZwX2RlYnVnLCAiXG4iKTsKLSAgICAgICAgICAgICAgICAgICAgZmNsb3NlKGZwX2RlYnVnKTsKLSNlbmRpZgotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICBlbHNlIC8qICptb2RlX21iID0gTU9ERV9JTlRFUjsqLwotICAgICAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAgICAgaWYgKHZpZGVvLT5lbmNQYXJhbXMtPkhhbGZQZWxfRW5hYmxlZCkKLSAgICAgICAgICAgICAgICAgICAgewotI2lmZGVmIF9TQURfU1RBVAotICAgICAgICAgICAgICAgICAgICAgICAgbnVtX0hQX01CKys7Ci0jZW5kaWYKLSAgICAgICAgICAgICAgICAgICAgICAgIC8qIGZpbmQgaGFsZi1wZWwgcmVzb2x1dGlvbiBtb3Rpb24gdmVjdG9yICovCi0gICAgICAgICAgICAgICAgICAgICAgICBGaW5kSGFsZlBlbE1CKHZpZGVvLCBjdXIsIG1vdF9tYiwgYmVzdF9jYW5kWzBdLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpIDw8IDQsIGogPDwgNCwgeGgsIHloLCBocF9ndWVzcyk7Ci0jaWZkZWYgUFJJTlRfTVYKLSAgICAgICAgICAgICAgICAgICAgICAgIGZwX2RlYnVnID0gZm9wZW4oImM6XFxiaXRzdHJlYW1cXG12MV9kZWJ1Zy50eHQiLCAiYSIpOwotICAgICAgICAgICAgICAgICAgICAgICAgZnByaW50ZihmcF9kZWJ1ZywgIiglZCwlZCksICVkXG4iLCBtb3RfbWJbMF0ueCwgbW90X21iWzBdLnksIG1vdF9tYlswXS5zYWQpOwotICAgICAgICAgICAgICAgICAgICAgICAgZmNsb3NlKGZwX2RlYnVnKTsKLSNlbmRpZgotICAgICAgICAgICAgICAgICAgICAgICAgc2tpcF9oYWxmcGVsXzRtdiA9ICgoc2FkMTYgLSBtb3RfbWJbMF0uc2FkKSA8PSAoTUJfTmIgPj4gMSkgKyAxKTsKLSAgICAgICAgICAgICAgICAgICAgICAgIHNhZDE2ID0gbW90X21iWzBdLnNhZDsKLQotI2lmbmRlZiBOT19JTlRFUjRWCi0gICAgICAgICAgICAgICAgICAgICAgICBpZiAodXNlXzRtdiAmJiAhc2tpcF9oYWxmcGVsXzRtdikKLSAgICAgICAgICAgICAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAvKiBBbHNvIGRlY2lkZSAxTVYgb3IgNE1WICEhISEhISEhKi8KLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBzYWQ4ID0gRmluZEhhbGZQZWxCbGsodmlkZW8sIGN1ciwgbW90X21iLCBzYWQxNiwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYmVzdF9jYW5kLCBtb2RlX21iLCBpIDw8IDQsIGogPDwgNCwgeGgsIHloLCBocF9tZW00TVYpOwotCi0jaWZkZWYgUFJJTlRfTVYKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBmcF9kZWJ1ZyA9IGZvcGVuKCJjOlxcYml0c3RyZWFtXFxtdjFfZGVidWcudHh0IiwgImEiKTsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBmcHJpbnRmKGZwX2RlYnVnLCAiICglZCwlZCwlZCkgOiAoJWQsJWQsJWQpIDogKCVkLCVkLCVkKSA6ICglZCwlZCwlZCkgXG4iLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbW90X21iWzFdLngsIG1vdF9tYlsxXS55LCBtb3RfbWJbMV0uc2FkLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbW90X21iWzJdLngsIG1vdF9tYlsyXS55LCBtb3RfbWJbMl0uc2FkLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbW90X21iWzNdLngsIG1vdF9tYlszXS55LCBtb3RfbWJbM10uc2FkLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbW90X21iWzRdLngsIG1vdF9tYls0XS55LCBtb3RfbWJbNF0uc2FkKTsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBmY2xvc2UoZnBfZGVidWcpOwotI2VuZGlmCi0gICAgICAgICAgICAgICAgICAgICAgICB9Ci0jZW5kaWYgLyogTk9fSU5URVI0ViAqLwotICAgICAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgICAgIGVsc2UgICAgLyogSGFsZlBlbF9FbmFibGVkID09MCAgKi8KLSAgICAgICAgICAgICAgICAgICAgewotI2lmbmRlZiBOT19JTlRFUjRWCi0gICAgICAgICAgICAgICAgICAgICAgICAvL2lmKHNhZDE2IDwgc2FkOC1QUkVGXzE2X1ZFQykKLSAgICAgICAgICAgICAgICAgICAgICAgIGlmIChzYWQxNiAtIFBSRUZfMTZfVkVDID4gc2FkOCkKLSAgICAgICAgICAgICAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAqbW9kZV9tYiA9IE1PREVfSU5URVI0VjsKLSAgICAgICAgICAgICAgICAgICAgICAgIH0KLSNlbmRpZgotICAgICAgICAgICAgICAgICAgICB9Ci0jaWYgKFpFUk9fTVZfUFJFRj09MikgICAvKiB1c2UgbW90X21iWzddLnNhZCBhcyBkMCBjb21wdXRlZCBpbiBNQk1vdGlvblNlYXJjaCovCi0gICAgICAgICAgICAgICAgICAgIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0gICAgICAgICAgICAgICAgICAgIGlmIChtb3RfbWJbN10uc2FkIC0gUFJFRl9OVUxMX1ZFQyA8IHNhZDE2ICYmIG1vdF9tYls3XS5zYWQgLSBQUkVGX05VTExfVkVDIDwgc2FkOCkKLSAgICAgICAgICAgICAgICAgICAgewotICAgICAgICAgICAgICAgICAgICAgICAgbW90X21iWzBdLnNhZCA9IG1vdF9tYls3XS5zYWQgLSBQUkVGX05VTExfVkVDOwotICAgICAgICAgICAgICAgICAgICAgICAgbW90X21iWzBdLnggPSBtb3RfbWJbMF0ueSA9IDA7Ci0gICAgICAgICAgICAgICAgICAgICAgICAqbW9kZV9tYiA9IE1PREVfSU5URVI7Ci0gICAgICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICAgICAgLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLSNlbmRpZgotICAgICAgICAgICAgICAgICAgICBpZiAoKm1vZGVfbWIgPT0gTU9ERV9JTlRFUikKLSAgICAgICAgICAgICAgICAgICAgewotICAgICAgICAgICAgICAgICAgICAgICAgaWYgKG1vdF9tYlswXS54ID09IDAgJiYgbW90X21iWzBdLnkgPT0gMCkgICAvKiB1c2UgemVybyB2ZWN0b3IgKi8KLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBtb3RfbWJbMF0uc2FkICs9IFBSRUZfTlVMTF9WRUM7IC8qIGFkZCBiYWNrIHRoZSBiaWFzICovCi0KLSAgICAgICAgICAgICAgICAgICAgICAgIG1vdF9tYlsxXS5zYWQgPSBtb3RfbWJbMl0uc2FkID0gbW90X21iWzNdLnNhZCA9IG1vdF9tYls0XS5zYWQgPSAobW90X21iWzBdLnNhZCArIDIpID4+IDI7Ci0gICAgICAgICAgICAgICAgICAgICAgICBtb3RfbWJbMV0ueCA9IG1vdF9tYlsyXS54ID0gbW90X21iWzNdLnggPSBtb3RfbWJbNF0ueCA9IG1vdF9tYlswXS54OwotICAgICAgICAgICAgICAgICAgICAgICAgbW90X21iWzFdLnkgPSBtb3RfbWJbMl0ueSA9IG1vdF9tYlszXS55ID0gbW90X21iWzRdLnkgPSBtb3RfbWJbMF0ueTsKLQotICAgICAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgfQotCi0gICAgICAgICAgICAgICAgLyogZmluZCBtYXhpbXVtIG1hZ25pdHVkZSAqLwotICAgICAgICAgICAgICAgIC8qIGNvbXB1dGUgYXZlcmFnZSBTQUQgZm9yIHJhdGUgY29udHJvbCwgMTEvMjgvMDAgKi8KLSAgICAgICAgICAgICAgICBpZiAoKm1vZGVfbWIgPT0gTU9ERV9JTlRFUikKLSAgICAgICAgICAgICAgICB7Ci0jaWZkZWYgUFJJTlRfTVYKLSAgICAgICAgICAgICAgICAgICAgZnBfZGVidWcgPSBmb3BlbigiYzpcXGJpdHN0cmVhbVxcbXYxX2RlYnVnLnR4dCIsICJhIik7Ci0gICAgICAgICAgICAgICAgICAgIGZwcmludGYoZnBfZGVidWcsICIlZCBNT0RFX0lOVEVSXG4iLCBtYm51bSk7Ci0gICAgICAgICAgICAgICAgICAgIGZjbG9zZShmcF9kZWJ1Zyk7Ci0jZW5kaWYKLSAgICAgICAgICAgICAgICAgICAgdG90YWxTQUQgKz0gbW90X21iWzBdLnNhZDsKLSAgICAgICAgICAgICAgICAgICAgaWYgKG1vdF9tYlswXS54ID4gbWF4X21hZykKLSAgICAgICAgICAgICAgICAgICAgICAgIG1heF9tYWcgPSBtb3RfbWJbMF0ueDsKLSAgICAgICAgICAgICAgICAgICAgaWYgKG1vdF9tYlswXS55ID4gbWF4X21hZykKLSAgICAgICAgICAgICAgICAgICAgICAgIG1heF9tYWcgPSBtb3RfbWJbMF0ueTsKLSAgICAgICAgICAgICAgICAgICAgaWYgKG1vdF9tYlswXS54IDwgbWluX21hZykKLSAgICAgICAgICAgICAgICAgICAgICAgIG1pbl9tYWcgPSBtb3RfbWJbMF0ueDsKLSAgICAgICAgICAgICAgICAgICAgaWYgKG1vdF9tYlswXS55IDwgbWluX21hZykKLSAgICAgICAgICAgICAgICAgICAgICAgIG1pbl9tYWcgPSBtb3RfbWJbMF0ueTsKLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgZWxzZSBpZiAoKm1vZGVfbWIgPT0gTU9ERV9JTlRFUjRWKQotICAgICAgICAgICAgICAgIHsKLSNpZmRlZiBQUklOVF9NVgotICAgICAgICAgICAgICAgICAgICBmcF9kZWJ1ZyA9IGZvcGVuKCJjOlxcYml0c3RyZWFtXFxtdjFfZGVidWcudHh0IiwgImEiKTsKLSAgICAgICAgICAgICAgICAgICAgZnByaW50ZihmcF9kZWJ1ZywgIiVkIE1PREVfSU5URVI0VlxuIiwgbWJudW0pOwotICAgICAgICAgICAgICAgICAgICBmY2xvc2UoZnBfZGVidWcpOwotI2VuZGlmCi0gICAgICAgICAgICAgICAgICAgIHRvdGFsU0FEICs9IHNhZDg7Ci0gICAgICAgICAgICAgICAgICAgIGZvciAoY29tcCA9IDE7IGNvbXAgPD0gNDsgY29tcCsrKQotICAgICAgICAgICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgICAgICAgICBpZiAobW90X21iW2NvbXBdLnggPiBtYXhfbWFnKQotICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1heF9tYWcgPSBtb3RfbWJbY29tcF0ueDsKLSAgICAgICAgICAgICAgICAgICAgICAgIGlmIChtb3RfbWJbY29tcF0ueSA+IG1heF9tYWcpCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgbWF4X21hZyA9IG1vdF9tYltjb21wXS55OwotICAgICAgICAgICAgICAgICAgICAgICAgaWYgKG1vdF9tYltjb21wXS54IDwgbWluX21hZykKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBtaW5fbWFnID0gbW90X21iW2NvbXBdLng7Ci0gICAgICAgICAgICAgICAgICAgICAgICBpZiAobW90X21iW2NvbXBdLnkgPCBtaW5fbWFnKQotICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1pbl9tYWcgPSBtb3RfbWJbY29tcF0ueTsKLSAgICAgICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICBlbHNlICAgIC8qIE1PREVfSU5UUkEgKi8KLSAgICAgICAgICAgICAgICB7Ci0jaWZkZWYgUFJJTlRfTVYKLSAgICAgICAgICAgICAgICAgICAgZnBfZGVidWcgPSBmb3BlbigiYzpcXGJpdHN0cmVhbVxcbXYxX2RlYnVnLnR4dCIsICJhIik7Ci0gICAgICAgICAgICAgICAgICAgIGZwcmludGYoZnBfZGVidWcsICIlZCBNT0RFX0lOVFJBXG4iLCBtYm51bSk7Ci0gICAgICAgICAgICAgICAgICAgIGZjbG9zZShmcF9kZWJ1Zyk7Ci0jZW5kaWYKLSAgICAgICAgICAgICAgICAgICAgdG90YWxTQUQgKz0gbW90X21iWzBdLnNhZDsKLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgbWJudW0gKz0gaW5jcl9pOwotICAgICAgICAgICAgICAgIG9mZnNldCArPSAoaW5jcl9pIDw8IDQpOwotCi0gICAgICAgICAgICB9Ci0gICAgICAgIH0KLQotICAgICAgICBpZiAoaW5jcl9pID4gMSAmJiBudW1Mb29wKSAvKiBzY2VuZSBjaGFuZ2Ugb24gYW5kIGZpcnN0IGxvb3AgKi8KLSAgICAgICAgewotICAgICAgICAgICAgLy9pZihudW1JbnRyYSA+ICgodG90YWxNQj4+Myk8PDEpICsgKHRvdGFsTUI+PjMpKSAvKiA3NSUgb2YgNTAlTUJzICovCi0gICAgICAgICAgICBpZiAobnVtSW50cmEgPiAoMC4zMCoodG90YWxNQiAvIDIuMCkpKSAvKiAxNSUgb2YgNTAlTUJzICovCi0gICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgLyoqKioqKioqIHNjZW5lIGNoYW5nZSBkZXRlY3RlZCAqKioqKioqKioqKioqKioqKioqLwotICAgICAgICAgICAgICAgIGN1cnJWb3AtPnByZWRpY3Rpb25UeXBlID0gSV9WT1A7Ci0gICAgICAgICAgICAgICAgTTRWRU5DX01FTVNFVChNb2RlLCBNT0RFX0lOVFJBLCBzaXplb2YoVUNoYXIpKnRvdGFsTUIpOyAvKiBzZXQgdGhpcyBmb3IgTUIgbGV2ZWwgY29kaW5nKi8KLSAgICAgICAgICAgICAgICBjdXJyVm9wLT5xdWFudGl6ZXIgPSB2aWRlby0+ZW5jUGFyYW1zLT5Jbml0UXVhbnRJdm9wW3ZpZGVvLT5jdXJyTGF5ZXJdOwotCi0gICAgICAgICAgICAgICAgLyogY29tcHV0ZSB0aGUgU0FWIGZvciByYXRlIGNvbnRyb2wgJiBmYXN0IERDVCAqLwotICAgICAgICAgICAgICAgIHRvdGFsU0FEID0gMDsKLSAgICAgICAgICAgICAgICBvZmZzZXQgPSAwOwotICAgICAgICAgICAgICAgIG1ibnVtID0gMDsKLSAgICAgICAgICAgICAgICBjdXIgPSBjdXJyRnJhbWUtPnlDaGFuOwotCi0gICAgICAgICAgICAgICAgZm9yIChqID0gMDsgaiA8IG1iaGVpZ2h0OyBqKyspCi0gICAgICAgICAgICAgICAgewotICAgICAgICAgICAgICAgICAgICBmb3IgKGkgPSAwOyBpIDwgbWJ3aWR0aDsgaSsrKQotICAgICAgICAgICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgICAgICAgICB2aWRlby0+bWJudW0gPSBtYm51bTsKLSAgICAgICAgICAgICAgICAgICAgICAgIG1vdF9tYiA9IG1vdFttYm51bV07Ci0KLQotICAgICAgICAgICAgICAgICAgICAgICAgKCpDb21wdXRlTUJTdW0pKGN1ciArIChpIDw8IDQpLCB3aWR0aCwgbW90X21iKTsKLSAgICAgICAgICAgICAgICAgICAgICAgIHRvdGFsU0FEICs9IG1vdF9tYlswXS5zYWQ7Ci0KLSAgICAgICAgICAgICAgICAgICAgICAgIG1ibnVtKys7Ci0gICAgICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICAgICAgY3VyICs9ICh3aWR0aCA8PCA0KTsKLSAgICAgICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgICAgICB2aWRlby0+c3VtTUFEID0gKGZsb2F0KXRvdGFsU0FEIC8gKGZsb2F0KU51bVBpeGVsTUI7Ci0gICAgICAgICAgICAgICAgUmVzZXRJbnRyYVVwZGF0ZShpbnRyYUFycmF5LCB0b3RhbE1CKTsKLSAgICAgICAgICAgICAgICAvKiB2aWRlby0+bnVtVm9wc0luR09QPTA7IDMvMTMvMDEgbW92ZSBpdCB0byB2b3AuYyovCi0KLSAgICAgICAgICAgICAgICByZXR1cm4gOwotICAgICAgICAgICAgfQotICAgICAgICB9Ci0gICAgICAgIC8qKioqKioqKiBubyBzY2VuZSBjaGFuZ2UsIGNvbnRpbnVlIG1vdGlvbiBzZWFyY2ggKioqKioqKioqKioqKioqKioqKioqKi8KLSAgICAgICAgc3RhcnRfaSA9IDA7Ci0gICAgICAgIHR5cGVfcHJlZCsrOyAvKiBzZWNvbmQgcGFzcyAqLwotICAgIH0KLQotICAgIHZpZGVvLT5zdW1NQUQgPSAoZmxvYXQpdG90YWxTQUQgLyAoZmxvYXQpTnVtUGl4ZWxNQjsgICAgLyogYXZnIFNBRCAqLwotCi0gICAgLyogZmluZCBmX2NvZGUgLCAxMC8yNy8yMDAwICovCi0gICAgZl9jb2RlX3AgPSAxOwotICAgIHdoaWxlICgobWF4X21hZyA+PiAoNCArIGZfY29kZV9wKSkgPiAwKQotICAgICAgICBmX2NvZGVfcCsrOwotCi0gICAgZl9jb2RlX24gPSAxOwotICAgIG1pbl9tYWcgKj0gLTE7Ci0gICAgd2hpbGUgKChtaW5fbWFnIC0gMSkgPj4gKDQgKyBmX2NvZGVfbikgPiAwKQotICAgICAgICBmX2NvZGVfbisrOwotCi0gICAgY3VyclZvcC0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SBwdHJbMTJdOwotICAgICAgICB3b3JkIHw9IChieXRlIDw8IDI0KTsKLSAgICAgICAgKmh0Zm1NQisrID0gd29yZDsKLQotICAgICAgICB3b3JkID0gKihwdHIgKz0gKHdpZHRoIDw8IDIpKTsKLSAgICAgICAgYnl0ZSA9IHB0cls0XTsKLSAgICAgICAgd29yZCB8PSAoYnl0ZSA8PCA4KTsKLSAgICAgICAgYnl0ZSA9IHB0cls4XTsKLSAgICAgICAgd29yZCB8PSAoYnl0ZSA8PCAxNik7Ci0gICAgICAgIGJ5dGUgPSBwdHJbMTJdOwotICAgICAgICB3b3JkIHw9IChieXRlIDw8IDI0KTsKLSAgICAgICAgKmh0Zm1NQisrID0gd29yZDsKLSAgICB9Ci0KLSAgICByZXR1cm4gOwotfQotCi0KLSNlbmRpZgotCi12b2lkICAgIFByZXBhcmVDdXJNQihWaWRlb0VuY0RhdGEgKnZpZGVvLCBVQ2hhciAqY3VyKQotewotICAgIHZvaWQqIHRtcCA9ICh2b2lkKikodmlkZW8tPmN1cnJZTUIpOwotICAgIFVMb25nICpjdXJyWU1CID0gKFVMb25nKil0bXA7Ci0gICAgSW50IGk7Ci0gICAgSW50IHdpZHRoID0gdmlkZW8tPmN1cnJWb3AtPndpZHRoOwotCi0gICAgY3VyIC09IHdpZHRoOwotCi0gICAgZm9yIChpID0gMDsgaSA8IDE2OyBpKyspCi0gICAgewotICAgICAgICAqY3VycllNQisrID0gKigoVUxvbmcqKShjdXIgKz0gd2lkdGgpKTsKLSAgICAgICAgKmN1cnJZTUIrKyA9ICooKFVMb25nKikoY3VyICsgNCkpOwotICAgICAgICAqY3VycllNQisrID0gKigoVUxvbmcqKShjdXIgKyA4KSk7Ci0gICAgICAgICpjdXJyWU1CKysgPSAqKChVTG9uZyopKGN1ciArIDEyKSk7Ci0gICAgfQotCi0gICAgcmV0dXJuIDsKLX0KLQotCi0vKj09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT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mlkZW8tPmZvcndhcmRSZWZWb3AtPnlDaGFuOyAvKiBvcmlnaW4gb2YgYWN0dWFsIGZyYW1lICovCi0KLSAgICBjdXIgPSB2aWRlby0+Y3VycllNQjsgLyogdXNlIHNtYWxsZXIgbWVtb3J5IHNwYWNlIGZvciBjdXJyZW50IE1CICovCi0KLSAgICAvKiAgZmluZCBsaW1pdCBvZiB0aGUgc2VhcmNoIChhZGp1c3Rpbmcgc2VhcmNoIHJhbmdlKSovCi0KLSAgICBpZiAoIWgyNjNfbW9kZSkKLSAgICB7Ci0gICAgICAgIGlsb3cgPSBpMCAtIHJhbmdlOwotICAgICAgICBpZiAoaWxvdyA8IC0xNSkKLSAgICAgICAgICAgIGlsb3cgPSAtMTU7Ci0gICAgICAgIGloaWdoID0gaTAgKyByYW5nZSAtIDE7Ci0gICAgICAgIGlmIChpaGlnaCA+IHdpZHRoIC0gMSkKLSAgICAgICAgICAgIGloaWdoID0gd2lkdGggLSAxOwotICAgICAgICBqbG93ID0gajAgLSByYW5nZTsKLSAgICAgICAgaWYgKGpsb3cgPCAtMTUpCi0gICAgICAgICAgICBqbG93ID0gLTE1OwotICAgICAgICBqaGlnaCA9IGowICsgcmFuZ2UgLSAxOwotICAgICAgICBpZiAoamhpZ2ggPiBoZWlnaHQgLSAxKQotICAgICAgICAgICAgamhpZ2ggPSBoZWlnaHQgLSAxOwotICAgIH0KLSAgICBlbHNlCi0gICAgewotICAgICAgICBpbG93ID0gaTAgLSByYW5nZTsKLSAgICAgICAgaWYgKGlsb3cgPCAwKQotICAgICAgICAgICAgaWxvdyA9IDA7Ci0gICAgICAgIGloaWdoID0gaTAgKyByYW5nZSAtIDE7Ci0gICAgICAgIGlmIChpaGlnaCA+IHdpZHRoIC0gMTYpCi0gICAgICAgICAgICBpaGlnaCA9IHdpZHRoIC0gMTY7Ci0gICAgICAgIGpsb3cgPSBqMCAtIHJhbmdlOwotICAgICAgICBpZiAoamxvdyA8IDApCi0gICAgICAgICAgICBqbG93ID0gM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AoMCwzKSBNQiAqLwotICAgICAgICAvKiAgICAgICAgICAgIHVwdG8gMzAlIGNvbXBsZXhpdHkgc2F2aW5nIHdpdGggdGhlIHNhbWUgY29tcGxleGl0eSAqLwotICAgICAgICBpZiAodmlkZW8tPmZvcndhcmRSZWZWb3AtPnByZWRpY3Rpb25UeXBlID09IElfVk9QICYmIGowID09IDAgJiYgaTAgPD0gNjQgJiYgdHlwZV9wcmVkICE9IDEpCi0gICAgICAgIHsKLSAgICAgICAgICAgICpocF9ndWVzcyA9IDA7IC8qIG5vIGd1ZXNzIGZvciBmYXN0IGhhbGYtcGVsICovCi0gICAgICAgICAgICBkbWluID0gIGZ1bGxzZWFyY2godmlkZW8sIGN1cnJWb2wsIHJlZiwgY3VyLCAmaW1pbiwgJmptaW4sIGlsb3csIGloaWdoLCBqbG93LCBqaGlnaCk7Ci0gICAgICAgICAgICBuY2FuZCA9IHJlZiArIGltaW4gKyBqbWluICogbHg7Ci0gICAgICAgIH0KLSAgICAgICAgZWxzZQotICAgICAgICB7Ci0gICAgICAgICAgICAvKioqKioqKioqKioqKiogaW5pdGlhbGl6ZSBjYW5kaWRhdGUgKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0gICAgICAgICAgICAvKiBmaW5kIGluaXRpYWwgbW90aW9uIHZlY3RvciAqLwotICAgICAgICAgICAgQ2FuZGlkYXRlU2VsZWN0aW9uKG12eCwgbXZ5LCAmbnVtX2NhbiwgaTAgPj4gNCwgajAgPj4gNCwgdmlkZW8sIHR5cGVfcHJlZCk7Ci0KLSAgICAgICAgICAgIGRtaW4gPSA2NTUzNTsKLQotICAgICAgICAgICAgLyogY2hlY2sgaWYgYWxsIGFyZSBlcXVhbCAqLwotICAgICAgICAgICAgaWYgKG51bV9jYW4gPT0gQUxMX0NBTkRfRVFVQUwpCi0gICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgaSA9IGkwICsgbXZ4WzBdOwotICAgICAgICAgICAgICAgIGogPSBqMCArIG12eVswXTsKLQotICAgICAgICAgICAgICAgIGlmIChpID49IGlsb3cgJiYgaSA8PSBpaGlnaCAmJiBqID49IGpsb3cgJiYgaiA8PSBqaGlnaCkKLSAgICAgICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgICAgIGNhbmQgPSByZWYgKyBpICsgaiAqIGx4OwotCi0gICAgICAgICAgICAgICAgICAgIGQgPSAoKlNBRF9NYWNyb2Jsb2NrKShjYW5kLCBjdXIsIChkbWluIDw8IDE2KSB8IGx4LCBleHRyYV9pbmZvKTsKLQotICAgICAgICAgICAgICAgICAgICBpZiAoZCA8IGRtaW4pCi0gICAgICAgICAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAgICAgICAgIGRtaW4gPSBkOwotICAgICAgICAgICAgICAgICAgICAgICAgaW1pbiA9IGk7Ci0gICAgICAgICAgICAgICAgICAgICAgICBqbWluID0gajsKLSAgICAgICAgICAgICAgICAgICAgICAgIG5jYW5kID0gY2FuZDsKLSAgICAgICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgIH0KLSAgICAgICAgICAgIGVsc2UKLSAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAvKioqKioqKioqKioqKiogZXZhbHVhdGUgdW5pcXVlIGNhbmRpZGF0ZXMgKioqKioqKioqKioqKioqKioqKioqKi8KLSAgICAgICAgICAgICAgICBmb3IgKGsgPSAwOyBrIDwgbnVtX2NhbjsgaysrKQotICAgICAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAgICAgaSA9IGkwICsgbXZ4W2tdOwotICAgICAgICAgICAgICAgICAgICBqID0gajAgKyBtdnlba107Ci0KLSAgICAgICAgICAgICAgICAgICAgaWYgKGkgPj0gaWxvdyAmJiBpIDw9IGloaWdoICYmIGogPj0gamxvdyAmJiBqIDw9IGpoaWdoKQotICAgICAgICAgICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgICAgICAgICBjYW5kID0gcmVmICsgaSArIGogKiBseDsKLSAgICAgICAgICAgICAgICAgICAgICAgIGQgPSAoKlNBRF9NYWNyb2Jsb2NrKShjYW5kLCBjdXIsIChkbWluIDw8IDE2KSB8IGx4LCBleHRyYV9pbmZvKTsKLQotICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGQgPCBkbWluKQotICAgICAgICAgICAgICAgICAgICAgICAgewotICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRtaW4gPSBkOwotICAgICAgICAgICAgICAgICAgICAgICAgICAgIGltaW4gPSBpOwotICAgICAgICAgICAgICAgICAgICAgICAgICAgIGptaW4gPSBqOwotICAgICAgICAgICAgICAgICAgICAgICAgICAgIG5jYW5kID0gY2FuZDsKLSAgICAgICAgICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICAgICAgICAgIGVsc2UgaWYgKChkID09IGRtaW4pICYmIFBWX0FCUyhtdnhba10pICsgUFZfQUJTKG12eVtrXSkgPCBQVl9BQlMoaTAgLSBpbWluKSArIFBWX0FCUyhqMCAtIGptaW4pKQotICAgICAgICAgICAgICAgICAgICAgICAgewotICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRtaW4gPSBkOwotICAgICAgICAgICAgICAgICAgICAgICAgICAgIGltaW4gPSBpOwotICAgICAgICAgICAgICAgICAgICAgICAgICAgIGptaW4gPSBqOwotICAgICAgICAgICAgICAgICAgICAgICAgICAgIG5jYW5kID0gY2FuZDsKLSAgICAgICAgICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgIH0KLSAgICAgICAgICAgIGlmIChudW1fY2FuID09IDAgfHwgZG1pbiA9PSA2NTUzNSkgLyogbm8gY2FuZGlkYXRlIHNlbGVjdGVkICovCi0gICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgbmNhbmQgPSByZWYgKyBpMCArIGowICogbHg7IC8qIHVzZSAoMCwwKSBNViBhcyBpbml0aWFsIHZhbHVlICovCi0gICAgICAgICAgICAgICAgbW90W21ibnVtXVs3XS5zYWQgPSBkbWluID0gKCpTQURfTWFjcm9ibG9jaykobmNhbmQsIGN1ciwgKDY1NTM1IDw8IDE2KSB8IGx4LCBleHRyYV9pbmZvKTsKLSNpZiAoWkVST19NVl9QUkVGPT0xKSAgIC8qIGNvbXB1dGUgKDAsMCkgTVYgYXQgdGhlIGVuZCAqLwotICAgICAgICAgICAgICAgIGQwID0gZG1pbjsKLSNlbmRpZgotICAgICAgICAgICAgICAgIGltaW4gPSBpMDsKLSAgICAgICAgICAgICAgICBqbWluID0gajA7Ci0gICAgICAgICAgICB9Ci0KLSNpZiAoWkVST19NVl9QUkVGPT0wKSAgLyogIENPTVBVVEUgWkVSTyBWRUNUT1IgRklSU1QgISEhISEqLwotICAgICAgICAgICAgZG1pbiAtPSBQUkVGX05VTExfVkVDOwotI2VuZGlmCi0KLSAgICAgICAgICAgIC8qKioqKioqKioqKioqKioqKioqIGxvY2FsIHJlZmluZW1lbnQgKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotICAgICAgICAgICAgY2VudGVyX2FnYWluID0gMDsKLSAgICAgICAgICAgIGxhc3RfbG9jID0gbmV3X2xvYyA9IDA7Ci0gICAgICAgICAgICAvLyAgICAgICAgICBuY2FuZCA9IHJlZiArIGptaW4qbHggKyBpbWluOyAgLyogY2VudGVyIG9mIHRoZSBzZWFyY2ggKi8KLSAgICAgICAgICAgIHN0ZXAgPSAwOwotICAgICAgICAgICAgZG5bMF0gPSBkbWluOwotICAgICAgICAgICAgd2hpbGUgKCFjZW50ZXJfYWdhaW4gJiYgc3RlcCA8PSBtYXhfc3RlcCkKLSAgICAgICAgICAgIHsKLQotICAgICAgICAgICAgICAgIE1vdmVOZWlnaGJvclNBRChkbiwgbGFzdF9sb2MpOwotCi0gICAgICAgICAgICAgICAgY2VudGVyX2FnYWluID0gMTsKLSAgICAgICAgICAgICAgICBpID0gaW1pbjsKLSAgICAgICAgICAgICAgICBqID0gam1pbiAtIDE7Ci0gICAgICAgICAgICAgICAgY2FuZCA9IHJlZiArIGkgKyBqICogbHg7Ci0KLSAgICAgICAgICAgICAgICAvKiAgc3RhcnRpbmcgZnJvbSBbMCwtMV0gKi8KLSAgICAgICAgICAgICAgICAvKiBzcGlyYWwgY2hlY2sgb25lIHN0ZXAgYXQgYSB0aW1lKi8KLSAgICAgICAgICAgICAgICBmb3IgKGsgPSAyOyBrIDw9IDg7IGsgKz0gMikKLSAgICAgICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgICAgIGlmICghdGFiX2V4Y2x1ZGVbbGFzdF9sb2NdW2tdKSAvKiBleGNsdWRlIGxhc3Qgc3RlcCBjb21wdXRhdGlvbiAqLwotICAgICAgICAgICAgICAgICAgICB7ICAgICAgIC8qIG5vdCBhbHJlYWR5IGNvbXB1dGVkICovCi0gICAgICAgICAgICAgICAgICAgICAgICBpZiAoaSA+PSBpbG93ICYmIGkgPD0gaWhpZ2ggJiYgaiA+PSBqbG93ICYmIGogPD0gamhpZ2gpCi0gICAgICAgICAgICAgICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgZCA9ICgqU0FEX01hY3JvYmxvY2spKGNhbmQsIGN1ciwgKGRtaW4gPDwgMTYpIHwgbHgsIGV4dHJhX2luZm8pOwotICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRuW2tdID0gZDsgLyoga2VlcCBpdCBmb3IgaGFsZiBwZWwgdXNlICovCi0KLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoZCA8IGRtaW4pCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgewotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBuY2FuZCA9IGNhbmQ7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRtaW4gPSBkOwotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpbWluID0gaTsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgam1pbiA9IGo7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNlbnRlcl9hZ2FpbiA9IDA7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG5ld19sb2MgPSBrOwotICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBlbHNlIGlmICgoZCA9PSBkbWluKSAmJiBQVl9BQlMoaTAgLSBpKSArIFBWX0FCUyhqMCAtIGopIDwgUFZfQUJTKGkwIC0gaW1pbikgKyBQVl9BQlMoajAgLSBqbWluKSkKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG5jYW5kID0gY2FuZDsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaW1pbiA9IGk7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGptaW4gPSBqOwotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjZW50ZXJfYWdhaW4gPSAwOwotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBuZXdfbG9jID0gazsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICAgICAgaWYgKGsgPT0gOCkgIC8qIGVuZCBzaWRlIHNlYXJjaCovCi0gICAgICAgICAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAgICAgICAgIGlmICghY2VudGVyX2FnYWluKQotICAgICAgICAgICAgICAgICAgICAgICAgewotICAgICAgICAgICAgICAgICAgICAgICAgICAgIGsgPSAtMTsgLyogc3RhcnQgZGlhZ29uYWwgc2VhcmNoICovCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgY2FuZCAtPSBseDsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBqLS07Ci0gICAgICAgICAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICAgICAgZWxzZQotICAgICAgICAgICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgICAgICAgICBuZXh0ID0gcmVmaW5lX25leHRba11bMF07Ci0gICAgICAgICAgICAgICAgICAgICAgICBpICs9IG5leHQ7Ci0gICAgICAgICAgICAgICAgICAgICAgICBjYW5kICs9IG5leHQ7Ci0gICAgICAgICAgICAgICAgICAgICAgICBuZXh0ID0gcmVmaW5lX25leHRba11bMV07Ci0gICAgICAgICAgICAgICAgICAgICAgICBqICs9IG5leHQ7Ci0gICAgICAgICAgICAgICAgICAgICAgICBjYW5kICs9IGx4ICogbmV4dDsKLSAgICAgICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICBsYXN0X2xvYyA9IG5ld19sb2M7Ci0gICAgICAgICAgICAgICAgc3RlcCArKzsKLSAgICAgICAgICAgIH0KLSAgICAgICAgICAgIGlmICghY2VudGVyX2FnYWluKQotICAgICAgICAgICAgICAgIE1vdmVOZWlnaGJvclNBRChkbiwgbGFzdF9sb2MpOwotCi0gICAgICAgICAgICAqaHBfZ3Vlc3MgPSBGaW5kTWluKGRuKTsKLQotICAgICAgICB9Ci0KLSNpZiAoWkVST19NVl9QUkVGPT0xKSAgIC8qIGNvbXB1dGUgKDAsMCkgTVYgYXQgdGhlIGVuZCAqLwotICAgICAgICBpZiAoZDAgLSBQUkVGX05VTExfVkVDIDwgZG1pbikKLSAgICAgICAgewotICAgICAgICAgICAgbmNhbmQgPSByZWYgKyBpMCArIGowICogbHg7Ci0gICAgICAgICAgICBkbWluID0gZDA7Ci0gICAgICAgICAgICBpbWluID0gaTA7Ci0gICAgICAgICAgICBqbWluID0gajA7Ci0gICAgICAgIH0KLSNlbmRpZgotICAgICAgICBtb3RbbWJudW1dWzBdLnNhZCA9IGRtaW47Ci0gICAgICAgIG1vdFttYm51bV1bMF0ueCA9IChpbWluIC0gaTApIDw8IDE7Ci0gICAgICAgIG1vdFttYm51bV1bMF0ueSA9IChqbWluIC0gajApIDw8IDE7Ci0gICAgICAgIGltaW4wID0gaW1pbiA8PCAxOyAgLyogMTZ4MTYgTVYgaW4gaGFsZi1wZWwgcmVzb2x1dGlvbiAqLwotICAgICAgICBqbWluMCA9IGptaW4gPDwgMTsKLSAgICAgICAgYmVzdF9jYW5kWzBdID0gbmNhbmQ7Ci0gICAgfQotICAgIC8qIGltaW4gYW5kIGptaW4gaXMgdGhlIGJlc3QgMSBNViAqLwotI2lmbmRlZiBOT19JTlRFUjRWCi0gICAgLyoqKioqKioqKioqKioqKioqKiogIEZpbmQgNCBtb3Rpb24gdmVjdG9ycyAqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotICAgIGlmICh1c2VfNG12ICYmICFoMjYzX21vZGUpCi0gICAgewotI2lmZGVmIF9TQURfU1RBVAotICAgICAgICBudW1fQmxrICs9IDQ7Ci0jZW5kaWYKLSAgICAgICAgLyogc3RhcnRpbmcgZnJvbSB0aGUgYmVzdCAxTVYgKi8KLSAgICAgICAgLy9vZmZzZXQgPSBpbWluICsgam1pbipseDsKLSAgICAgICAgaW9yZyA9IGkwOwotICAgICAgICBqb3JnID0gajA7Ci0KLSAgICAgICAgZm9yIChjb21wID0gMDsgY29tcCA8IDQ7IGNvbXArKykKLSAgICAgICAgewotICAgICAgICAgICAgaTAgPSBpb3JnICsgKChjb21wICYgMSkgPDwgMyk7Ci0gICAgICAgICAgICBqMCA9IGpvcmcgKyAoKGNvbXAgJiAyKSA8PCAyKTsKLQotICAgICAgICAgICAgaW1pbiA9IChpbWluMCA+PiAxKSArICgoY29tcCAmIDEpIDw8IDMpOyAgICAvKiBzdGFydGluZyBwb2ludCBmcm9tIDE2eDE2IE1WICovCi0gICAgICAgICAgICBqbWluID0gKGptaW4wID4+IDEpICsgKChjb21wICYgMikgPDwgMik7Ci0gICAgICAgICAgICBuY2FuZCA9IHJlZiArIGltaW4gKyBqbWluICogbHg7Ci0KLSAgICAgICAgICAgIGN1cjggPSBjdXIgKyAoKGNvbXAgJiAxKSA8PCAzKSArICgoKGNvbXAgJiAyKSA8PCAyKSA8PCA0KSA7IC8qIDExLzMwLzA1LCBzbWFsbGVyIGNhY2hlICovCi0KLSAgICAgICAgICAgIC8qICBmaW5kIGxpbWl0IG9mIHRoZSBzZWFyY2ggKGFkanVzdGluZyBzZWFyY2ggcmFuZ2UpKi8KLSAgICAgICAgICAgIGlsb3cgPSBpMCAtIHJhbmdlOwotICAgICAgICAgICAgaWhpZ2ggPSBpMCArIHJhbmdlIC0gMSA7LyogNC85LzAxICovCi0gICAgICAgICAgICBpZiAoaWxvdyA8IC0xNSkKLSAgICAgICAgICAgICAgICBpbG93ID0gLTE1OwotICAgICAgICAgICAgaWYgKGloaWdoID4gd2lkdGggLSAxKQotICAgICAgICAgICAgICAgIGloaWdoID0gd2lkdGggLSAxOwotICAgICAgICAgICAgamxvdyA9IGowIC0gcmFuZ2U7Ci0gICAgICAgICAgICBqaGlnaCA9IGowICsgcmFuZ2UgLSAxIDsvKiA0LzkvMDEgKi8KLSAgICAgICAgICAgIGlmIChqbG93IDwgLTE1KQotICAgICAgICAgICAgICAgIGpsb3cgPSAtMTU7Ci0gICAgICAgICAgICBpZiAoamhpZ2ggPiBoZWlnaHQgLSAxKQotICAgICAgICAgICAgICAgIGpoaWdoID0gaGVpZ2h0IC0gMTsKLQotICAgICAgICAgICAgU0FEX0Jsb2NrID0gdmlkZW8tPmZ1bmN0aW9uUG9pbnRlci0+U0FEX0Jsb2NrOwotCi0gICAgICAgICAgICBpZiAoRlNfZW4pICAvKiBmdWxsc2VhcmNoIGVuYWJsZSwgY2VudGVyIGFyb3VuZCAxNngxNiBNViAqLwotICAgICAgICAgICAgewotICAgICAgICAgICAgICAgIGRtaW4gPSAgZnVsbHNlYXJjaEJsayh2aWRlbywgY3VyclZvbCwgbmNhbmQsIGN1cjgsICZpbWluLCAmam1pbiwgaWxvdywgaWhpZ2gsIGpsb3csIGpoaWdoLCByYW5nZSk7Ci0gICAgICAgICAgICAgICAgbmNhbmQgPSByZWYgKyBpbWluICsgam1pbiAqIGx4OwotCi0gICAgICAgICAgICAgICAgbW90W21ibnVtXVtjb21wKzFdLnNhZCA9IGRtaW47Ci0gICAgICAgICAgICAgICAgbW90W21ibnVtXVtjb21wKzFdLnggPSAoaW1pbiAtIGkwKSA8PCAxOwotICAgICAgICAgICAgICAgIG1vdFttYm51bV1bY29tcCsxXS55ID0gKGptaW4gLSBqMCkgPDwgMTsKLSAgICAgICAgICAgICAgICBiZXN0X2NhbmRbY29tcCsxXSA9IG5jYW5kOwotICAgICAgICAgICAgfQotICAgICAgICAgICAgZWxzZSAgICAvKiBubyBmdWxsc2VhcmNoLCBkbyBsb2NhbCBzZWFyY2ggKi8KLSAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAvKiBzdGFydGluZyBwb2ludCBmcm9tIDE2eDE2ICovCi0gICAgICAgICAgICAgICAgZG1pbiA9ICgqU0FEX0Jsb2NrKShuY2FuZCwgY3VyOCwgNjU1MzYsIGx4LCBleHRyYV9pbmZvKTsKLQotICAgICAgICAgICAgICAgIC8qKioqKioqKioqKioqKioqKioqIGxvY2FsIHJlZmluZW1lbnQgKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotICAgICAgICAgICAgICAgIGNlbnRlcl9hZ2FpbiA9IDA7Ci0gICAgICAgICAgICAgICAgbGFzdF9sb2MgPSAwOwotCi0gICAgICAgICAgICAgICAgd2hpbGUgKCFjZW50ZXJfYWdhaW4pCi0gICAgICAgICAgICAgICAgewotICAgICAgICAgICAgICAgICAgICBjZW50ZXJfYWdhaW4gPSAxOwotICAgICAgICAgICAgICAgICAgICBpID0gaW1pbjsKLSAgICAgICAgICAgICAgICAgICAgaiA9IGptaW4gLSAxOwotICAgICAgICAgICAgICAgICAgICBjYW5kID0gcmVmICsgaSArIGogKiBseDsKLQotICAgICAgICAgICAgICAgICAgICAvKiAgc3RhcnRpbmcgZnJvbSBbMCwtMV0gKi8KLSAgICAgICAgICAgICAgICAgICAgLyogc3BpcmFsIGNoZWNrIG9uZSBzdGVwIGF0IGEgdGltZSovCi0gICAgICAgICAgICAgICAgICAgIGZvciAoayA9IDI7IGsgPD0gODsgayArPSAyKQotICAgICAgICAgICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgICAgICAgICBpZiAoIXRhYl9leGNsdWRlW2xhc3RfbG9jXVtrXSkgLyogZXhjbHVkZSBsYXN0IHN0ZXAgY29tcHV0YXRpb24gKi8KLSAgICAgICAgICAgICAgICAgICAgICAgIHsgICAgICAgLyogbm90IGFscmVhZHkgY29tcHV0ZWQgKi8KLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoaSA+PSBpbG93ICYmIGkgPD0gaWhpZ2ggJiYgaiA+PSBqbG93ICYmIGogPD0gamhpZ2gpCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgewotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBkID0gKCpTQURfQmxvY2spKGNhbmQsIGN1cjgsIGRtaW4sIGx4LCBleHRyYV9pbmZvKTsKLQotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoZCA8IGRtaW4pCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG5jYW5kID0gY2FuZDsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRtaW4gPSBkOwotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaW1pbiA9IGk7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBqbWluID0gajsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNlbnRlcl9hZ2FpbiA9IDA7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBuZXdfbG9jID0gazsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBlbHNlIGlmICgoZCA9PSBkbWluKSAmJgotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBQVl9BQlMoaTAgLSBpKSArIFBWX0FCUyhqMCAtIGopIDwgUFZfQUJTKGkwIC0gaW1pbikgKyBQVl9BQlMoajAgLSBqbWluKSkKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgewotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbmNhbmQgPSBjYW5kOwotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaW1pbiA9IGk7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBqbWluID0gajsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNlbnRlcl9hZ2FpbiA9IDA7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBuZXdfbG9jID0gazsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICAgICAgICAgIGlmIChrID09IDgpICAvKiBlbmQgc2lkZSBzZWFyY2gqLwotICAgICAgICAgICAgICAgICAgICAgICAgewotICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICghY2VudGVyX2FnYWluKQotICAgICAgICAgICAgICAgICAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgayA9IC0xOyAvKiBzdGFydCBkaWFnb25hbCBzZWFyY2ggKi8KLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGogPD0gaGVpZ2h0IC0gMSAmJiBqID4gMCkgICBjYW5kIC09IGx4OwotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBqLS07Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgICAgICAgICAgZWxzZQotICAgICAgICAgICAgICAgICAgICAgICAgewotICAgICAgICAgICAgICAgICAgICAgICAgICAgIG5leHQgPSByZWZpbmVfbmV4dFtrXVswXTsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBjYW5kICs9IG5leHQ7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgaSArPSBuZXh0OwotICAgICAgICAgICAgICAgICAgICAgICAgICAgIG5leHQgPSByZWZpbmVfbmV4dFtrXVsxXTsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBjYW5kICs9IGx4ICogbmV4dDsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBqICs9IG5leHQ7Ci0gICAgICAgICAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICAgICAgbGFzdF9sb2MgPSBuZXdfbG9jOwotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICBtb3RbbWJudW1dW2NvbXArMV0uc2FkID0gZG1pbjsKLSAgICAgICAgICAgICAgICBtb3RbbWJudW1dW2NvbXArMV0ueCA9IChpbWluIC0gaTApIDw8IDE7Ci0gICAgICAgICAgICAgICAgbW90W21ibnVtXVtjb21wKzFdLnkgPSAoam1pbiAtIGowKSA8PCAxOwotICAgICAgICAgICAgICAgIGJlc3RfY2FuZFtjb21wKzFdID0gbmNhbmQ7Ci0gICAgICAgICAgICB9Ci0gICAgICAgICAgICAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0gICAgICAgIH0KLSAgICB9Ci0gICAgZWxzZQotI2VuZGlmICAvKiBOT19JTlRFUjRWICovCi0gICAgewotICAgICAgICBtb3RbbWJudW1dWzFdLnNhZCA9IG1vdFttYm51bV1bMl0uc2FkID0gbW90W21ibnVtXVszXS5zYWQgPSBtb3RbbWJudW1dWzRdLnNhZCA9IChkbWluICsgMikgPj4gMjsKLSAgICAgICAgbW90W21ibnVtXVsxXS54ID0gbW90W21ibnVtXVsyXS54ID0gbW90W21ibnVtXVszXS54ID0gbW90W21ibnVtXVs0XS54ID0gbW90W21ibnVtXVswXS54OwotICAgICAgICBtb3RbbWJudW1dWzFdLnkgPSBtb3RbbWJudW1dWzJdLnkgPSBtb3RbbWJudW1dWzNdLnkgPSBtb3RbbWJudW1dWzRdLnkgPSBtb3RbbWJudW1dWzBdLnk7Ci0gICAgICAgIGJlc3RfY2FuZFsxXSA9IGJlc3RfY2FuZFsyXSA9IGJlc3RfY2FuZFszXSA9IGJlc3RfY2FuZFs0XSA9IG5jYW5kOwotCi0gICAgfQotICAgIHJldHVybiA7Ci19Ci0KLQotLyo9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09Ci0gICAgRnVuY3Rpb246ICAgZnVsbHNlYXJjaAotICAgIERhdGU6ICAgICAgIDA5LzE2LzIwMDAKLSAgICBQdXJwb3NlOiAgICBQZXJmb3JtIGZ1bGwtc2VhcmNoIG1vdGlvbiBlc3RpbWF0aW9uIG92ZXIgdGhlIHJhbmdlIG9mIHNlYXJjaAotICAgICAgICAgICAgICAgIHJlZ2lvbiBpbiBhIHNwaXJhbC1vdXR3YXJkIG1hbm5lci4KLSAgICBJbnB1dC9PdXRwdXQ6ICAgVmlkZW9FbmNEYXRhLCBjdXJyZW50IFZvbCwgcHJldmlvdSBWb3AsIHBvaW50ZXIgdG8gdGhlIGxlZnQgY29ybmVyIG9mCi0gICAgICAgICAgICAgICAgY3VycmVudCBWT1AsIGN1cnJlbnQgY29vcmQgKGFsc28gb3V0cHV0KSwgYm91bmRhcmllcy4KLT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0qLwotCi1JbnQgZnVsbHNlYXJjaChWaWRlb0VuY0RhdGEgKnZpZGVvLCBWb2wgKmN1cnJWb2wsIFVDaGFyICp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LSAgICAgICAgaiA9IGowIC0gazsKLQotICAgICAgICBjYW5kID0gcHJldiArIGkgKyBqICogbHg7Ci0KLSAgICAgICAgZm9yIChsID0gMDsgbCA8IDgqazsgbCsrKQotICAgICAgICB7Ci0gICAgICAgICAgICAvKiBubyBuZWVkIGZvciBib3VuZGFyeSBjaGVja2luZyBhZ2FpbiAqLwotICAgICAgICAgICAgaWYgKGkgPj0gaWxvdyAmJiBpIDw9IGloaWdoICYmIGogPj0gamxvdyAmJiBqIDw9IGpoaWdoKQotICAgICAgICAgICAgewotICAgICAgICAgICAgICAgIGQgPSAoKlNBRF9NYWNyb2Jsb2NrKShjYW5kLCBjdXIsIChkbWluIDw8IDE2KSB8IGx4LCAodm9pZCopZXh0cmFfaW5mbyk7Ci0KLSAgICAgICAgICAgICAgICBpZiAoZCA8IGRtaW4pCi0gICAgICAgICAgICAgICAgewotICAgICAgICAgICAgICAgICAgICBkbWluID0gZDsKLSAgICAgICAgICAgICAgICAgICAgKmltaW4gPSBpOwotICAgICAgICAgICAgICAgICAgICAqam1pbiA9IGo7Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgIGVsc2UgaWYgKChkID09IGRtaW4pICYmIFBWX0FCUyhpMCAtIGkpICsgUFZfQUJTKGowIC0gaikgPCBQVl9BQlMoaTAgLSAqaW1pbikgKyBQVl9BQlMoajAgLSAqam1pbikpCi0gICAgICAgICAgICAgICAgewotICAgICAgICAgICAgICAgICAgICBkbWluID0gZDsKLSAgICAgICAgICAgICAgICAgICAgKmltaW4gPSBpOwotICAgICAgICAgICAgICAgICAgICAqam1pbiA9IGo7Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgfQotCi0gICAgICAgICAgICBpZiAobCA8IChrIDw8IDEpKQotICAgICAgICAgICAgewotICAgICAgICAgICAgICAgIGkrKzsKLSAgICAgICAgICAgICAgICBjYW5kKys7Ci0gICAgICAgICAgICB9Ci0gICAgICAgICAgICBlbHNlIGlmIChsIDwgKGsgPDwgMikpCi0gICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgaisrOwotICAgICAgICAgICAgICAgIGNhbmQgKz0gbHg7Ci0gICAgICAgICAgICB9Ci0gICAgICAgICAgICBlbHNlIGlmIChsIDwgKChrIDw8IDIpICsgKGsgPDwgMSkpKQotICAgICAgICAgICAgewotICAgICAgICAgICAgICAgIGktLTsKLSAgICAgICAgICAgICAgICBjYW5kLS07Ci0gICAgICAgICAgICB9Ci0gICAgICAgICAgICBlbHNlCi0gICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgai0tOwotICAgICAgICAgICAgICAgIGNhbmQgLT0gbHg7Ci0gICAgICAgICAgICB9Ci0gICAgICAgIH0KLSAgICB9Ci0KLSAgICByZXR1cm4gZG1pbjsKLX0KLQotI2lmbmRlZiBOT19JTlRFUjRWCi0vKj09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KLSAgICBGdW5jdGlvbjogICBmdWxsc2VhcmNoQmxrCi0gICAgRGF0ZTogICAgICAgMDEvOS8yMDAxCi0gICAgUHVycG9zZTogICAgUGVyZm9ybSBmdWxsLXNlYXJjaCBtb3Rpb24gZXN0aW1hdGlvbiBvZiBhbiA4eDggYmxvY2sgb3ZlciB0aGUgcmFuZ2UKLSAgICAgICAgICAgICAgICBvZiBzZWFyY2ggcmVnaW9uIGluIGEgc3BpcmFsLW91dHdhcmQgbWFubmVyIGNlbnRlcmVkIGF0IHRoZSAxNngxNiBNVi4KLSAgICBJbnB1dC9PdXRwdXQ6ICAgVmlkZW9FbmNEYXRhLCBNQiBjb29yZGluYXRlLCBwb2ludGVyIHRvIHRoZSBpbml0aWFsIE1WIG9uIHRoZQotICAgICAgICAgICAgICAgIHJlZmVyZW5jZSwgcG9pbnRlciB0byBjb29yIG9mIGN1cnJlbnQgYmxvY2ssIHNlYXJjaCByYW5nZS4KLT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0qLwotSW50IGZ1bGxzZWFyY2hCbGsoVmlkZW9FbmNEYXRhICp2aWRlbywgVm9sICpjdXJyVm9sLCBVQ2hhciAqY2VudCwgVUNoYXIgKmN1ciwKLSAgICAgICAgICAgICAgICAgIEludCAqaW1pbiwgSW50ICpqbWluLCBJbnQgaWxvdywgSW50IGloaWdoLCBJbnQgamxvdywgSW50IGpoaWdoLCBJbnQgcmFuZ2UpCi17Ci0gICAgVUNoYXIgKmNhbmQsICpyZWY7Ci0gICAgSW50IGksIGosIGssIGwsIGlzdGFydCwganN0YXJ0OwotICAgIEludCBkLCBkbWluOwotICAgIEludCBseCA9IHZpZGVvLT5jdXJyVm9wLT5waXRjaDsgLyogd2l0aCBwYWRkaW5nICovCi0gICAgSW50KCpTQURfQmxvY2spKFVDaGFyKiwgVUNoYXIqLCBJbnQsIEludCwgdm9pZCopID0gdmlkZW8tPmZ1bmN0aW9uUG9pbnRlci0+U0FEX0Jsb2NrOwotICAgIHZvaWQgKmV4dHJhX2luZm8gPSB2aWRlby0+c2FkX2V4dHJhX2luZm87Ci0KLSAgICBPU0NMX1VOVVNFRF9BUkcoY3VyclZvbCk7Ci0KLSAgICAvKiBzdGFydGluZyBwb2ludCBjZW50ZXJlZCBhdCAxNngxNiBNViAqLwotICAgIHJlZiA9IGNlbnQ7Ci0gICAgaXN0YXJ0ID0gKmltaW47Ci0gICAganN0YXJ0ID0gKmptaW47Ci0KLSAgICBkbWluID0gKCpTQURfQmxvY2spKHJlZiwgY3VyLCA2NTUzNiwgbHgsICh2b2lkKilleHRyYV9pbmZvKTsKLQotICAgIGNhbmQgPSByZWY7Ci0gICAgLyogcGVyZm9ybSBzcGlyYWwgc2VhcmNoICovCi0gICAgZm9yIChrID0gMTsgayA8PSByYW5nZTsgaysrKQotICAgIHsKLQotICAgICAgICBpID0gaXN0YXJ0IC0gazsKLSAgICAgICAgaiA9IGpzdGFydCAtIGs7Ci0gICAgICAgIGNhbmQgLT0gKGx4ICsgMSk7ICAvKiBjYW5kaWRhdGUgcmVnaW9uICovCi0KLSAgICAgICAgZm9yIChsID0gMDsgbCA8IDgqazsgbCsrKQotICAgICAgICB7Ci0gICAgICAgICAgICAvKiBubyBuZWVkIGZvciBib3VuZGFyeSBjaGVja2luZyBhZ2FpbiAqLwotICAgICAgICAgICAgaWYgKGkgPj0gaWxvdyAmJiBpIDw9IGloaWdoICYmIGogPj0gamxvdyAmJiBqIDw9IGpoaWdoKQotICAgICAgICAgICAgewotICAgICAgICAgICAgICAgIGQgPSAoKlNBRF9CbG9jaykoY2FuZCwgY3VyLCBkbWluLCBseCwgKHZvaWQqKWV4dHJhX2luZm8pOwotCi0gICAgICAgICAgICAgICAgaWYgKGQgPCBkbWluKQotICAgICAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAgICAgZG1pbiA9IGQ7Ci0gICAgICAgICAgICAgICAgICAgICppbWluID0gaTsKLSAgICAgICAgICAgICAgICAgICAgKmptaW4gPSBqOwotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICBlbHNlIGlmICgoZCA9PSBkbWluKSAmJgotICAgICAgICAgICAgICAgICAgICAgICAgIFBWX0FCUyhpc3RhcnQgLSBpKSArIFBWX0FCUyhqc3RhcnQgLSBqKSA8IFBWX0FCUyhpc3RhcnQgLSAqaW1pbikgKyBQVl9BQlMoanN0YXJ0IC0gKmptaW4pKQotICAgICAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAgICAgZG1pbiA9IGQ7Ci0gICAgICAgICAgICAgICAgICAgICppbWluID0gaTsKLSAgICAgICAgICAgICAgICAgICAgKmptaW4gPSBqOwotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgaWYgKGwgPCAoayA8PCAxKSkKLSAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICBpKys7Ci0gICAgICAgICAgICAgICAgY2FuZCsrOwotICAgICAgICAgICAgfQotICAgICAgICAgICAgZWxzZSBpZiAobCA8IChrIDw8IDIpKQotICAgICAgICAgICAgewotICAgICAgICAgICAgICAgIGorKzsKLSAgICAgICAgICAgICAgICBjYW5kICs9IGx4OwotICAgICAgICAgICAgfQotICAgICAgICAgICAgZWxzZSBpZiAobCA8ICgoayA8PCAyKSArIChrIDw8IDEpKSkKLSAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICBpLS07Ci0gICAgICAgICAgICAgICAgY2FuZC0tOwotICAgICAgICAgICAgfQotICAgICAgICAgICAgZWxzZQotICAgICAgICAgICAgewotICAgICAgICAgICAgICAgIGotLTsKLSAgICAgICAgICAgICAgICBjYW5kIC09IGx4OwotICAgICAgICAgICAgfQotICAgICAgICB9Ci0gICAgfQotCi0gICAgcmV0dXJuIGRtaW47Ci19Ci0jZW5kaWYgLyogTk9fSU5URVI0ViAqLwotCi0vKj09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KLSAgICBGdW5jdGlvbjogICBDYW5kaWRhdGVTZWxlY3Rpb24KLSAgICBEYXRlOiAgICAgICAwOS8xNi8yMDAwCi0gICAgUHVycG9zZTogICAgRmlsbCB1cCB0aGUgbGlzdCBvZiBjYW5kaWRhdGUgdXNpbmcgc3BhdGlvLXRlbXBvcmFsIGNvcnJlbGF0aW9uCi0gICAgICAgICAgICAgICAgYW1vbmcgbmVpZ2hib3JpbmcgYmxvY2tzLgotICAgIElucHV0L091dHB1dDogICB0eXBlX3ByZWQgPSAwOiBmaXJzdCBwYXNzLCAxOiBzZWNvbmQgcGFzcywgb3Igbm8gU0NECi0gICAgTW9kaWZpZWQ6ICAgIDA5LzIzLzAxLCBnZXQgcmlkIG9mIHJlZHVuZGFudCBjYW5kaWRhdGVzIGJlZm9yZSBwYXNzaW5nIGJhY2suCi09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09Ki8KLQotdm9pZCBDYW5kaWRhdGVTZWxlY3Rpb24oSW50ICptdngsIEludCAqbXZ5LCBJbnQgKm51bV9jYW4sIEludCBpbWIsIEludCBqbWIsCi0gICAgICAgICAgICAgICAgICAgICAgICBWaWRlb0VuY0RhdGEgKnZpZGVvLCBJbnQgdHlwZV9wcmVkKQotewotICAgIE1PVCAqKm1vdCA9IHZpZGVvLT5tb3Q7Ci0gICAgTU9UICpwbW90OwotICAgIEludCBtYm51bSA9IHZpZGVvLT5tYm51bTsKLSAgICBWb2wgKmN1cnJWb2wgPSB2aWRlby0+dm9sW3ZpZGVvLT5jdXJyTGF5ZXJdOwotICAgIEludCBtYndpZHRoID0gY3VyclZvbC0+bk1CUGVyUm93OwotICAgIEludCBtYmhlaWdodCA9IGN1cnJWb2wtPm5NQlBlckNvbDsKLSAgICBJbnQgaSwgaiwgc2FtZSwgbnVtMTsKLQotICAgICpudW1fY2FuID0gMDsKLQotICAgIGlmICh2aWRlby0+Zm9yd2FyZFJlZlZvcC0+cHJlZGljdGlvblR5cGUgPT0gUF9WT1ApCi0gICAgewotICAgICAgICAvKiBTcGF0aW8tVGVtcG9yYWwgQ2FuZGlkYXRlIChmaXZlIGNhbmRpZGF0ZXMpICovCi0gICAgICAgIGlmICh0eXBlX3ByZWQgPT0gMCkgLyogZmlyc3QgcGFzcyAqLwotICAgICAgICB7Ci0gICAgICAgICAgICBwbW90ID0gJm1vdFttYm51bV1bMF07IC8qIHNhbWUgY29vcmRpbmF0ZSBwcmV2aW91cyBmcmFtZSAqLwotICAgICAgICAgICAgbXZ4WygqbnVtX2NhbildID0gKHBtb3QtPngpID4+IDE7Ci0gICAgICAgICAgICBtdnlbKCpudW1fY2FuKSsrXSA9IChwbW90LT55KSA+PiAxOwotICAgICAgICAgICAgaWYgKGltYiA+PSAobWJ3aWR0aCA+PiAxKSAmJiBpbWIgPiAwKSAgLypsZWZ0IG5laWdoYm9yIHByZXZpb3VzIGZyYW1lICovCi0gICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgcG1vdCA9ICZtb3RbbWJudW0tMV1bMF07Ci0gICAgICAgICAgICAgICAgbXZ4WygqbnVtX2NhbildID0gKHBtb3QtPngpID4+IDE7Ci0gICAgICAgICAgICAgICAgbXZ5WygqbnVtX2NhbikrK10gPSAocG1vdC0+eSkgPj4gMTsKLSAgICAgICAgICAgIH0KLSAgICAgICAgICAgIGVsc2UgaWYgKGltYiArIDEgPCBtYndpZHRoKSAgIC8qcmlnaHQgbmVpZ2hib3IgcHJldmlvdXMgZnJhbWUgKi8KLSAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICBwbW90ID0gJm1vdFttYm51bSsxXVswXTsKLSAgICAgICAgICAgICAgICBtdnhbKCpudW1fY2FuKV0gPSAocG1vdC0+eCkgPj4gMTsKLSAgICAgICAgICAgICAgICBtdnlbKCpudW1fY2FuKSsrXSA9IChwbW90LT55KSA+PiAxOwotICAgICAgICAgICAgfQotCi0gICAgICAgICAgICBpZiAoam1iIDwgbWJoZWlnaHQgLSAxKSAgLypib3R0b20gbmVpZ2hib3IgcHJldmlvdXMgZnJhbWUgKi8KLSAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICBwbW90ID0gJm1vdFttYm51bSttYndpZHRoXVswXTsKLSAgICAgICAgICAgICAgICBtdnhbKCpudW1fY2FuKV0gPSAocG1vdC0+eCkgPj4gMTsKLSAgICAgICAgICAgICAgICBtdnlbKCpudW1fY2FuKSsrXSA9IChwbW90LT55KSA+PiAxOwotICAgICAgICAgICAgfQotICAgICAgICAgICAgZWxzZSBpZiAoam1iID4gMCkgICAvKnVwcGVyIG5laWdoYm9yIHByZXZpb3VzIGZyYW1lICovCi0gICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgcG1vdCA9ICZtb3RbbWJudW0tbWJ3aWR0aF1bMF07Ci0gICAgICAgICAgICAgICAgbXZ4WygqbnVtX2NhbildID0gKHBtb3QtPngpID4+IDE7Ci0gICAgICAgICAgICAgICAgbXZ5WygqbnVtX2NhbikrK10gPSAocG1vdC0+eSkgPj4gMTsKLSAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgaWYgKGltYiA+IDAgJiYgam1iID4gMCkgIC8qIHVwcGVyLWxlZnQgbmVpZ2hib3IgY3VycmVudCBmcmFtZSovCi0gICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgcG1vdCA9ICZtb3RbbWJudW0tbWJ3aWR0aC0xXVswXTsKLSAgICAgICAgICAgICAgICBtdnhbKCpudW1fY2FuKV0gPSAocG1vdC0+eCkgPj4gMTsKLSAgICAgICAgICAgICAgICBtdnlbKCpudW1fY2FuKSsrXSA9IChwbW90LT55KSA+PiAxOwotICAgICAgICAgICAgfQotICAgICAgICAgICAgaWYgKGptYiA+IDAgJiYgaW1iIDwgbWJoZWlnaHQgLSAxKSAgLyogdXBwZXIgcmlnaHQgbmVpZ2hib3IgY3VycmVudCBmcmFtZSovCi0gICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgcG1vdCA9ICZtb3RbbWJudW0tbWJ3aWR0aCsxXVswXTsKLSAgICAgICAgICAgICAgICBtdnhbKCpudW1fY2FuKV0gPSAocG1vdC0+eCkgPj4gMTsKLSAgICAgICAgICAgICAgICBtdnlbKCpudW1fY2FuKSsrXSA9IChwbW90LT55KSA+PiAxOwotICAgICAgICAgICAgfQotICAgICAgICB9Ci0gICAgICAgIGVsc2UgICAgLyogc2Vjb25kIHBhc3MgKi8KLSAgICAgICAgICAgIC8qIG9yaWdpbmFsIFNUMSBhbGdvcml0aG0gKi8KLSAgICAgICAgewotICAgICAgICAgICAgcG1vdCA9ICZtb3RbbWJudW1dWzBdOyAvKiBzYW1lIGNvb3JkaW5hdGUgcHJldmlvdXMgZnJhbWUgKi8KLSAgICAgICAgICAgIG12eFsoKm51bV9jYW4pXSA9IChwbW90LT54KSA+PiAxOwotICAgICAgICAgICAgbXZ5WygqbnVtX2NhbikrK10gPSAocG1vdC0+eSkgPj4gMTsKLQotICAgICAgICAgICAgaWYgKGltYiA+IDApICAvKmxlZnQgbmVpZ2hib3IgY3VycmVudCBmcmFtZSAqLwotICAgICAgICAgICAgewotICAgICAgICAgICAgICAgIHBtb3QgPSAmbW90W21ibnVtLTFdWzBdOwotICAgICAgICAgICAgICAgIG12eFsoKm51bV9jYW4pXSA9IChwbW90LT54KSA+PiAxOwotICAgICAgICAgICAgICAgIG12eVsoKm51bV9jYW4pKytdID0gKHBtb3QtPnkpID4+IDE7Ci0gICAgICAgICAgICB9Ci0gICAgICAgICAgICBpZiAoam1iID4gMCkgIC8qdXBwZXIgbmVpZ2hib3IgY3VycmVudCBmcmFtZSAqLwotICAgICAgICAgICAgewotICAgICAgICAgICAgICAgIHBtb3QgPSAmbW90W21ibnVtLW1id2lkdGhdWzBdOwotICAgICAgICAgICAgICAgIG12eFsoKm51bV9jYW4pXSA9IChwbW90LT54KSA+PiAxOwotICAgICAgICAgICAgICAgIG12eVsoKm51bV9jYW4pKytdID0gKHBtb3QtPnkpID4+IDE7Ci0gICAgICAgICAgICB9Ci0gICAgICAgICAgICBpZiAoaW1iIDwgbWJ3aWR0aCAtIDEpICAvKnJpZ2h0IG5laWdoYm9yIHByZXZpb3VzIGZyYW1lICovCi0gICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgcG1vdCA9ICZtb3RbbWJudW0rMV1bMF07Ci0gICAgICAgICAgICAgICAgbXZ4WygqbnVtX2NhbildID0gKHBtb3QtPngpID4+IDE7Ci0gICAgICAgICAgICAgICAgbXZ5WygqbnVtX2NhbikrK10gPSAocG1vdC0+eSkgPj4gMTsKLSAgICAgICAgICAgIH0KLSAgICAgICAgICAgIGlmIChqbWIgPCBtYmhlaWdodCAtIDEpICAvKmJvdHRvbSBuZWlnaGJvciBwcmV2aW91cyBmcmFtZSAqLwotICAgICAgICAgICAgewotICAgICAgICAgICAgICAgIHBtb3QgPSAmbW90W21ibnVtK21id2lkdGhdWzBdOwotICAgICAgICAgICAgICAgIG12eFsoKm51bV9jYW4pXSA9IChwbW90LT54KSA+PiAxOwotICAgICAgICAgICAgICAgIG12eVsoKm51bV9jYW4pKytdID0gKHBtb3QtPnkpID4+IDE7Ci0gICAgICAgICAgICB9Ci0gICAgICAgIH0KLSAgICB9Ci0gICAgZWxzZSAgLyogb25seSBTcGF0aWFsIENhbmRpZGF0ZSAoZm91ciBjYW5kaWRhdGVzKSovCi0gICAgewotICAgICAgICBpZiAodHlwZV9wcmVkID09IDApIC8qZmlyc3QgcGFzcyovCi0gICAgICAgIHsKLSAgICAgICAgICAgIGlmIChpbWIgPiAxKSAgLyogbmVpZ2hib3IgdHdvIGJsb2NrcyBhd2F5IHRvIHRoZSBsZWZ0ICovCi0gICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgcG1vdCA9ICZtb3RbbWJudW0tMl1bMF07Ci0gICAgICAgICAgICAgICAgbXZ4WygqbnVtX2NhbildID0gKHBtb3QtPngpID4+IDE7Ci0gICAgICAgICAgICAgICAgbXZ5WygqbnVtX2NhbikrK10gPSAocG1vdC0+eSkgPj4gMTsKLSAgICAgICAgICAgIH0KLSAgICAgICAgICAgIGlmIChpbWIgPiAwICYmIGptYiA+IDApICAvKiB1cHBlci1sZWZ0IG5laWdoYm9yICovCi0gICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgcG1vdCA9ICZtb3RbbWJudW0tbWJ3aWR0aC0xXVswXTsKLSAgICAgICAgICAgICAgICBtdnhbKCpudW1fY2FuKV0gPSAocG1vdC0+eCkgPj4gMTsKLSAgICAgICAgICAgICAgICBtdnlbKCpudW1fY2FuKSsrXSA9IChwbW90LT55KSA+PiAxOwotICAgICAgICAgICAgfQotICAgICAgICAgICAgaWYgKGptYiA+IDAgJiYgaW1iIDwgbWJoZWlnaHQgLSAxKSAgLyogdXBwZXIgcmlnaHQgbmVpZ2hib3IgKi8KLSAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICBwbW90ID0gJm1vdFttYm51bS1tYndpZHRoKzFdWzBdOwotICAgICAgICAgICAgICAgIG12eFsoKm51bV9jYW4pXSA9IChwbW90LT54KSA+PiAxOwotICAgICAgICAgICAgICAgIG12eVsoKm51bV9jYW4pKytdID0gKHBtb3QtPnkpID4+IDE7Ci0gICAgICAgICAgICB9Ci0gICAgICAgIH0KLS8vI2lmZGVmIFNDRU5FX0NIQU5HRV9ERVRFQ1RJT04KLSAgICAgICAgLyogc2Vjb25kIHBhc3MgKFNUMiBhbGdvcml0aG0pKi8KLSAgICAgICAgZWxzZSBpZiAodHlwZV9wcmVkID09IDEpIC8qIDQvNy8wMSAqLwotICAgICAgICB7Ci0gICAgICAgICAgICBpZiAoaW1iID4gMCkgIC8qbGVmdCBuZWlnaGJvciBjdXJyZW50IGZyYW1lICovCi0gICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgcG1vdCA9ICZtb3RbbWJudW0tMV1bMF07Ci0gICAgICAgICAgICAgICAgbXZ4WygqbnVtX2NhbildID0gKHBtb3QtPngpID4+IDE7Ci0gICAgICAgICAgICAgICAgbXZ5WygqbnVtX2NhbikrK10gPSAocG1vdC0+eSkgPj4gMTsKLSAgICAgICAgICAgIH0KLSAgICAgICAgICAgIGlmIChqbWIgPiAwKSAgLyp1cHBlciBuZWlnaGJvciBjdXJyZW50IGZyYW1lICovCi0gICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgcG1vdCA9ICZtb3RbbWJudW0tbWJ3aWR0aF1bMF07Ci0gICAgICAgICAgICAgICAgbXZ4WygqbnVtX2NhbildID0gKHBtb3QtPngpID4+IDE7Ci0gICAgICAgICAgICAgICAgbXZ5WygqbnVtX2NhbikrK10gPSAocG1vdC0+eSkgPj4gMTsKLSAgICAgICAgICAgIH0KLSAgICAgICAgICAgIGlmIChpbWIgPCBtYndpZHRoIC0gMSkgIC8qcmlnaHQgbmVpZ2hib3IgY3VycmVudCBmcmFtZSAqLwotICAgICAgICAgICAgewotICAgICAgICAgICAgICAgIHBtb3QgPSAmbW90W21ibnVtKzFdWzBdOwotICAgICAgICAgICAgICAgIG12eFsoKm51bV9jYW4pXSA9IChwbW90LT54KSA+PiAxOwotICAgICAgICAgICAgICAgIG12eVsoKm51bV9jYW4pKytdID0gKHBtb3QtPnkpID4+IDE7Ci0gICAgICAgICAgICB9Ci0gICAgICAgICAgICBpZiAoam1iIDwgbWJoZWlnaHQgLSAxKSAgLypib3R0b20gbmVpZ2hib3IgY3VycmVudCBmcmFtZSAqLwotICAgICAgICAgICAgewotICAgICAgICAgICAgICAgIHBtb3QgPSAmbW90W21ibnVtK21id2lkdGhdWzBdOwotICAgICAgICAgICAgICAgIG12eFsoKm51bV9jYW4pXSA9IChwbW90LT54KSA+PiAxOwotICAgICAgICAgICAgICAgIG12eVsoKm51bV9jYW4pKytdID0gKHBtb3QtPnkpID4+IDE7Ci0gICAgICAgICAgICB9Ci0gICAgICAgIH0KLS8vI2Vsc2UKLSAgICAgICAgZWxzZSAvKiBvcmlnaW5hbCBTVDEgYWxnb3JpdGhtICovCi0gICAgICAgIHsKLSAgICAgICAgICAgIGlmIChpbWIgPiAwKSAgLypsZWZ0IG5laWdoYm9yIGN1cnJlbnQgZnJhbWUgKi8KLSAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICBwbW90ID0gJm1vdFttYm51bS0xXVswXTsKLSAgICAgICAgICAgICAgICBtdnhbKCpudW1fY2FuKV0gPSAocG1vdC0+eCkgPj4gMTsKLSAgICAgICAgICAgICAgICBtdnlbKCpudW1fY2FuKSsrXSA9IChwbW90LT55KSA+PiAxOwotCi0gICAgICAgICAgICAgICAgaWYgKGptYiA+IDApICAvKnVwcGVyLWxlZnQgbmVpZ2hib3IgY3VycmVudCBmcmFtZSAqLwotICAgICAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAgICAgcG1vdCA9ICZtb3RbbWJudW0tbWJ3aWR0aC0xXVswXTsKLSAgICAgICAgICAgICAgICAgICAgbXZ4WygqbnVtX2NhbildID0gKHBtb3QtPngpID4+IDE7Ci0gICAgICAgICAgICAgICAgICAgIG12eVsoKm51bV9jYW4pKytdID0gKHBtb3QtPnkpID4+IDE7Ci0gICAgICAgICAgICAgICAgfQotCi0gICAgICAgICAgICB9Ci0gICAgICAgICAgICBpZiAoam1iID4gMCkgIC8qdXBwZXIgbmVpZ2hib3IgY3VycmVudCBmcmFtZSAqLwotICAgICAgICAgICAgewotICAgICAgICAgICAgICAgIHBtb3QgPSAmbW90W21ibnVtLW1id2lkdGhdWzBdOwotICAgICAgICAgICAgICAgIG12eFsoKm51bV9jYW4pXSA9IChwbW90LT54KSA+PiAxOwotICAgICAgICAgICAgICAgIG12eVsoKm51bV9jYW4pKytdID0gKHBtb3QtPnkpID4+IDE7Ci0KLSAgICAgICAgICAgICAgICBpZiAoaW1iIDwgbWJoZWlnaHQgLSAxKSAgLyp1cHBlci1yaWdodCBuZWlnaGJvciBjdXJyZW50IGZyYW1lICovCi0gICAgICAgICAgICAgICAgewotICAgICAgICAgICAgICAgICAgICBwbW90ID0gJm1vdFttYm51bS1tYndpZHRoKzFdWzBdOwotICAgICAgICAgICAgICAgICAgICBtdnhbKCpudW1fY2FuKV0gPSAocG1vdC0+eCkgPj4gMTsKLSAgICAgICAgICAgICAgICAgICAgbXZ5WygqbnVtX2NhbikrK10gPSAocG1vdC0+eSkgPj4gMTsKLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICB9Ci0gICAgICAgIH0KLS8vI2VuZGlmCi0gICAgfQotCi0gICAgLyogMy8yMy8wMSwgcmVtb3ZlIHJlZHVuZGFudCBjYW5kaWRhdGUgKHBvc3NpYmxlIGstbWVhbikgKi8KLSAgICBudW0xID0gKm51bV9jYW47Ci0gICAgKm51bV9jYW4gPSAxOwotICAgIGZvciAoaSA9IDE7IGkgPCBudW0xOyBpKyspCi0gICAgewotICAgICAgICBzYW1lID0gMDsKLSAgICAgICAgaiA9IDA7Ci0gICAgICAgIHdoaWxlICghc2FtZSAmJiBqIDwgKm51bV9jYW4pCi0gICAgICAgIHsKLSNpZiAoQ0FORElEQVRFX0RJU1RBTkNFPT0wKQotICAgICAgICAgICAgaWYgKG12eFtpXSA9PSBtdnhbal0gJiYgbXZ5W2ldID09IG12eVtqXSkKLSNlbHNlCi0gICAgICAgICAgICAvLyBtb2RpZmllZCBrLW1lYW4sIDMvMjQvMDEsIHNob3VsZG4ndCBiZSBncmVhdGVyIHRoYW4gMwotICAgICAgICAgICAgaWYgKFBWX0FCUyhtdnhbaV0gLSBtdnhbal0pICsgUFZfQUJTKG12eVtpXSAtIG12eVtqXSkgPCBDQU5ESURBVEVfRElTVEFOQ0UpCi0jZW5kaWYKLSAgICAgICAgICAgICAgICBzYW1lID0gMTsKLSAgICAgICAgICAgIGorKzsKLSAgICAgICAgfQotICAgICAgICBpZiAoIXNhbWUpCi0gICAgICAgIHsKLSAgICAgICAgICAgIG12eFsqbnVtX2Nhbl0gPSBtdnhbaV07Ci0gICAgICAgICAgICBtdnlbKm51bV9jYW5dID0gbXZ5W2ldOwotICAgICAgICAgICAgKCpudW1fY2FuKSsrOwotICAgICAgICB9Ci0gICAgfQotCi0jaWZkZWYgX1NBRF9TVEFUCi0gICAgbnVtX2NhbmQgKz0gKCpudW1fY2FuKTsKLSNlbmRpZgotCi0gICAgaWYgKG51bTEgPT0gNSAmJiAqbnVtX2NhbiA9PSAxKQotICAgICAgICAqbnVtX2NhbiA9IEFMTF9DQU5EX0VRVUFMOyAvKiBhbGwgYXJlIGVxdWFsICovCi0KLSAgICByZXR1cm4gOwotfQotCi0vKj09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQotICAgIEZ1bmN0aW9uOiAgIFJhc3RlckludHJhVXBkYXRlCi0gICAgRGF0ZTogICAgICAgMi8yNi8wMQotICAgIFB1cnBvc2U6ICAgIFRvIHJhc3Rlci1zY2FuIGFzc2lnbiBJTlRSQS11cGRhdGUgLgotICAgICAgICAgICAgICAgIE4gbWFjcm9ibG9ja3MgYXJlIHVwZGF0ZWQgKGFsc28gd2FzIHByb2dyYW1tYWJsZSkuCi09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0qLwotdm9pZCBSYXN0ZXJJbnRyYVVwZGF0ZShVQ2hhciAqaW50cmFBcnJheSwgVUNoYXIgKk1vZGUsIEludCB0b3RhbE1CLCBJbnQgbnVtUmVmcmVzaCkKLXsKLSAgICBJbnQgaW5keCwgaTsKLQotICAgIC8qIGZpbmQgdGhlIGxhc3QgcmVmcmVzaCBNQiAqLwotICAgIGluZHggPSAwOwotICAgIHdoaWxlIChpbnRyYUFycmF5W2luZHhdID09IDEgJiYgaW5keCA8IHRvdGFsTUIpCi0gICAgICAgIGluZHgrKzsKLQotICAgIC8qIGFkZCBtb3JlICAqLwotICAgIGZvciAoaSA9IDA7IGkgPCBudW1SZWZyZXNoICYmIGluZHggPCB0b3RhbE1COyBpKyspCi0gICAgewotICAgICAgICBNb2RlW2luZHhdID0gTU9ERV9JTlRSQTsKLSAgICAgICAgaW50cmFBcnJheVtpbmR4KytdID0gMTsKLSAgICB9Ci0KLSAgICAvKiBpZiByZWFkIHRoZSBlbmQgb2YgZnJhbWUsIHJlc2V0IGFuZCBsb29wIGFyb3VuZCAqLwotICAgIGlmIChpbmR4ID49IHRvdGFsTUIgLSAxKQotICAgIHsKLSAgICAgICAgUmVzZXRJbnRyYVVwZGF0ZShpbnRyYUFycmF5LCB0b3RhbE1CKTsKLSAgICAgICAgaW5keCA9IDA7Ci0gICAgICAgIHdoaWxlIChpIDwgbnVtUmVmcmVzaCAmJiBpbmR4IDwgdG90YWxNQikKLSAgICAgICAgewotICAgICAgICAgICAgaW50cmFBcnJheVtpbmR4XSA9IDE7Ci0gICAgICAgICAgICBNb2RlW2luZHgrK10gPSBNT0RFX0lOVFJBOwotICAgICAgICAgICAgaSsrOwotICAgICAgICB9Ci0gICAgfQotCi0gICAgcmV0dXJuIDsKLX0KLQotLyo9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KLSAgICBGdW5jdGlvbjogICBSZXNldEludHJhVXBkYXRlCi0gICAgRGF0ZTogICAgICAgMTEvMjgvMDAKLSAgICBQdXJwb3NlOiAgICBSZXNldCBhbHJlYWR5IGludHJhIHVwZGF0ZWQgZmxhZ3MgdG8gYWxsIHplcm8KLT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PSovCi0KLXZvaWQgUmVzZXRJbnRyYVVwZGF0ZShVQ2hhciAqaW50cmFBcnJheSwgSW50IHRvdGFsTUIpCi17Ci0gICAgTTRWRU5DX01FTVNFVChpbnRyYUFycmF5LCAwLCBzaXplb2YoVUNoYXIpKnRvdGFsTUIpOwotICAgIHJldHVybiA7Ci19Ci0KLS8qPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09Ci0gICAgRnVuY3Rpb246ICAgUmVzZXRJbnRyYVVwZGF0ZVJlZ2lvbgotICAgIERhdGU6ICAgICAgIDEyLzEvMDAKLSAgICBQdXJwb3NlOiAgICBSZXNldCBhbHJlYWR5IGludHJhIHVwZGF0ZWQgZmxhZ3MgaW4gb25lIHJlZ2lvbiB0byBhbGwgemVybwotPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09Ki8KLXZvaWQgUmVzZXRJbnRyYVVwZGF0ZVJlZ2lvbihVQ2hhciAqaW50cmFBcnJheSwgSW50IHN0YXJ0X2ksIEludCByd2lkdGgsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgSW50IHN0YXJ0X2osIEludCByaGVpZ2h0LCBJbnQgbWJ3aWR0aCwgSW50IG1iaGVpZ2h0KQotewotICAgIEludCBpbmR4LCBqOwotCi0gICAgaWYgKHN0YXJ0X2kgKyByd2lkdGggPj0gbWJ3aWR0aCkKLSAgICAgICAgcndpZHRoID0gbWJ3aWR0aCAtIHN0YXJ0X2k7Ci0gICAgaWYgKHN0YXJ0X2ogKyByaGVpZ2h0ID49IG1iaGVpZ2h0KQotICAgICAgICByaGVpZ2h0ID0gbWJoZWlnaHQgLSBzdGFydF9qOwotCi0gICAgZm9yIChqID0gc3RhcnRfajsgaiA8IHN0YXJ0X2ogKyByaGVpZ2h0OyBqKyspCi0gICAgewotICAgICAgICBpbmR4ID0gaiAqIG1id2lkdGg7Ci0gICAgICAgIE00VkVOQ19NRU1TRVQoaW50cmFBcnJheSArIGluZHggKyBzdGFydF9pLCAwLCBzaXplb2YoVUNoYXIpKnJ3aWR0aCk7Ci0gICAgfQotCi0gICAgcmV0dXJuIDsKLX0KLQotLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKLSAgICBGdW5jdGlvbjogICBNb3ZlTmVpZ2hib3JTQUQKLSAgICBEYXRlOiAgICAgICAzLzI3LzAxCi0gICAgUHVycG9zZTogICAgTW92ZSBuZWlnaGJvcmluZyBTQUQgYXJvdW5kIHdoZW4gY2VudGVyIGhhcyBzaGlmdGVkCi0qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotCi12b2lkIE1vdmVOZWlnaGJvclNBRChJbnQgZG5bXSwgSW50IG5ld19sb2MpCi17Ci0gICAgSW50IHRtcFs5XTsKLSAgICB0bXBbMF0gPSBkblswXTsKLSAgICB0bXBbMV0gPSBkblsxXTsKLSAgICB0bXBbMl0gPSBkblsyXTsKLSAgICB0bXBbM10gPSBkblszXTsKLSAgICB0bXBbNF0gPSBkbls0XTsKLSAgICB0bXBbNV0gPSBkbls1XTsKLSAgICB0bXBbNl0gPSBkbls2XTsKLSAgICB0bXBbN10gPSBkbls3XTsKLSAgICB0bXBbOF0gPSBkbls4XTsKLSAgICBkblswXSA9IGRuWzFdID0gZG5bMl0gPSBkblszXSA9IGRuWzRdID0gZG5bNV0gPSBkbls2XSA9IGRuWzddID0gZG5bOF0gPSA2NTUzNjsKLQotICAgIHN3aXRjaCAobmV3X2xvYykKLSAgICB7Ci0gICAgICAgIGNhc2UgMDoKLSAgICAgICAgICAgIGJyZWFrOwotICAgICAgICBjYXNlIDE6Ci0gICAgICAgICAgICBkbls0XSA9IHRtcFsyXTsKLSAgICAgICAgICAgIGRuWzVdID0gdG1wWzBdOwotICAgICAgICAgICAgZG5bNl0gPSB0bXBbOF07Ci0gICAgICAgICAgICBicmVhazsKLSAgICAgICAgY2FzZSAyOgotICAgICAgICAgICAgZG5bNF0gPSB0bXBbM107Ci0gICAgICAgICAgICBkbls1XSA9IHRtcFs0XTsKLSAgICAgICAgICAgIGRuWzZdID0gdG1wWzBdOwotICAgICAgICAgICAgZG5bN10gPSB0bXBbOF07Ci0gICAgICAgICAgICBkbls4XSA9IHRtcFsxXTsKLSAgICAgICAgICAgIGJyZWFrOwotICAgICAgICBjYXNlIDM6Ci0gICAgICAgICAgICBkbls2XSA9IHRtcFs0XTsKLSAgICAgICAgICAgIGRuWzddID0gdG1wWzBdOwotICAgICAgICAgICAgZG5bOF0gPSB0bXBbMl07Ci0gICAgICAgICAgICBicmVhazsKLSAgICAgICAgY2FzZSA0OgotICAgICAgICAgICAgZG5bMV0gPSB0bXBbMl07Ci0gICAgICAgICAgICBkblsyXSA9IHRtcFszXTsKLSAgICAgICAgICAgIGRuWzZdID0gdG1wWzVdOwotICAgICAgICAgICAgZG5bN10gPSB0bXBbNl07Ci0gICAgICAgICAgICBkbls4XSA9IHRtcFswXTsKLSAgICAgICAgICAgIGJyZWFrOwotICAgICAgICBjYXNlIDU6Ci0gICAgICAgICAgICBkblsxXSA9IHRtcFswXTsKLSAgICAgICAgICAgIGRuWzJdID0gdG1wWzRdOwotICAgICAgICAgICAgZG5bOF0gPSB0bXBbNl07Ci0gICAgICAgICAgICBicmVhazsKLSAgICAgICAgY2FzZSA2OgotICAgICAgICAgICAgZG5bMV0gPSB0bXBbOF07Ci0gICAgICAgICAgICBkblsyXSA9IHRtcFswXTsKLSAgICAgICAgICAgIGRuWzNdID0gdG1wWzRdOwotICAgICAgICAgICAgZG5bNF0gPSB0bXBbNV07Ci0gICAgICAgICAgICBkbls4XSA9IHRtcFs3XTsKLSAgICAgICAgICAgIGJyZWFrOwotICAgICAgICBjYXNlIDc6Ci0gICAgICAgICAgICBkblsyXSA9IHRtcFs4XTsKLSAgICAgICAgICAgIGRuWzNdID0gdG1wWzBdOwotICAgICAgICAgICAgZG5bNF0gPSB0bXBbNl07Ci0gICAgICAgICAgICBicmVhazsKLSAgICAgICAgY2FzZSA4OgotICAgICAgICAgICAgZG5bMl0gPSB0bXBbMV07Ci0gICAgICAgICAgICBkblszXSA9IHRtcFsyXTsKLSAgICAgICAgICAgIGRuWzRdID0gdG1wWzBdOwotICAgICAgICAgICAgZG5bNV0gPSB0bXBbNl07Ci0gICAgICAgICAgICBkbls2XSA9IHRtcFs3XTsKLSAgICAgICAgICAgIGJyZWFrOwotICAgIH0KLSAgICBkblswXSA9IHRtcFtuZXdfbG9jXTsKLQotICAgIHJldHVybiA7Ci19Ci0KLS8qIDMvMjgvMDEsIGZpbmQgbWluaW1hbCBvZiBkbls5XSAqLwotCi1JbnQgRmluZE1pbihJbnQgZG5bXSkKLXsKLSAgICBJbnQgbWluLCBpOwotICAgIEludCBkbWluOwotCi0gICAgZG1pbiA9IGRuWzFdOwotICAgIG1pbiA9IDE7Ci0gICAgZm9yIChpID0gMjsgaSA8IDk7IGkrKykKLSAgICB7Ci0gICAgICAgIGlmIChkbltpXSA8IGRtaW4pCi0gICAgICAgIHsKLSAgICAgICAgICAgIGRtaW4gPSBkbltpXTsKLSAgICAgICAgICAgIG1pbiA9IGk7Ci0gICAgICAgIH0KLSAgIC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c3RhdHVzKTsKLUJvb2wgU2V0UHJvZmlsZV9CdWZmZXJTaXplKFZpZGVvRW5jRGF0YSAqdmlkZW8sIGZsb2F0IGRlbGF5LCBJbnQgYkluaXRpYWxpemVkKTsKLQotI2lmZGVmIFBSSU5UX1JDX0lORk8KLWV4dGVybiBGSUxFICpmYWNjdDsKLWV4dGVybiBpbnQgdGlUb3RhbE51bUJpdHNHZW5lcmF0ZWQ7Ci1leHRlcm4gaW50IGlTdHVmZkJpdHM7Ci0jZW5kaWYKLQotI2lmZGVmIFBSSU5UX0VDCi1leHRlcm4gRklMRSAqZmVjOwotI2VuZGlmCi0KLQotLyogPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09ICovCi0vKiAgRnVuY3Rpb24gOiBQVkdldERlZmF1bHRFbmNPcHRpb24oKSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICBEYXRlICAgICA6IDEyLzEyLzIwMDUgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogIFB1cnBvc2UgIDogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgSW4vb3V0ICAgOiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICBSZXR1cm4gICA6IFBWX1RSVUUgaWYgc3VjY2Vzc2VkLCBQVl9GQUxTRSBpZiBmYWlsZWQuICAgICAgICAgICAgICAgICAgICAqLwotLyogIE1vZGlmaWVkIDogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qID09P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JldHVybiBQVl9GQUxTRTsKLSAgICB9Ci0KLSAgICBNNFZFTkNfTUVNQ1BZKGVuY09wdGlvbiwgJmRlZmF1bHRVc2VDYXNlLCBzaXplb2YoVmlkZW9FbmNPcHRpb25zKSk7Ci0KLSAgICByZXR1cm4gUFZfVFJVRTsKLX0KLQotLyogPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09ICovCi0vKiAgRnVuY3Rpb24gOiBQVkluaXRWaWRlb0VuY29kZXIoKSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICBEYXRlICAgICA6IDA4LzIyLzIwMDAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogIFB1cnBvc2UgIDogSW5pdGlhbGl6YXRpb24gb2YgTVA0IEVuY29kZXIgYW5kIFZPIGJpdHN0cmVhbSAgICAgICAgICAgICAgICovCi0vKiAgSW4vb3V0ICAgOiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICBSZXR1cm4gICA6IFBWX1RSVUUgaWYgc3VjY2Vzc2VkLCBQVl9GQUxTRSBpZiBmYWlsZWQuICAgICAgICAgICAgICAgICAgICAqLwotLyogIE1vZGlmaWVkIDogIDUvMjEvMDEsIGFsbG9jYXRlIG9ubHkgeUNoYW4gYW5kIGFzc2lnbiB1Q2hhbiAmIHZDaGFuICAgKi8KLS8qICAgICAgICAgICAgICAxMi8xMi8wNSwgYWRkIGVuY29kaW5nIG9wdGlvbiBhcyBpbnB1dCBhcmd1bWVudCAgICAgICAgICovCi0vKiA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0gKi8KLU9TQ0xfRVhQT1JUX1JFRiBCb29sICAgIFBWSW5pdFZpZGVvRW5jb2RlcihWaWRlb0VuY0NvbnRyb2xzICplbmNvZGVyQ29udHJvbCwgVmlkZW9FbmNPcHRpb25zICplbmNPcHRpb24pCi17Ci0KLSAgICBCb29sICAgICAgICBzdGF0dXMgPSBQVl9UUlVFOwotICAgIEludCAgICAgICAgIG5MYXllcnMsIGlkeCwgaSwgajsKLSAgICBJbnQgICAgICAgICBtYXggPSAwLCBtYXhfd2lkdGggPSAwLCBtYXhfaGVpZ2h0ID0gMCwgcGl0Y2gsIG9mZnNldDsKLSAgICBJbnQgICAgICAgICBzaXplID0gMCwgblRvdGFsTUIgPSAwOwotICAgIFZpZGVvRW5jRGF0YSAqdmlkZW87Ci0gICAgVm9sICAgICAgICAgKnBWb2w7Ci0gICAgVmlkZW9FbmNQYXJhbXMgICpwRW5jUGFyYW1zOwotICAgIEludCAgICAgICAgIHRlbXBfdywgdGVtcF9oLCBtYnNQZXJTZWM7Ci0KLSAgICAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotICAgIC8qICAgICAgdGhpcyBwYXJ0IHVzZSB0byBiZSBQVlNldEVuY29kZSgpICovCi0gICAgSW50IHByb2ZpbGVfdGFibGVfaW5kZXgsICpwcm9maWxlX2xldmVsX3RhYmxlOwotICAgIEludCBwcm9maWxlX2xldmVsID0gZW5jT3B0aW9uLT5wcm9maWxlX2xldmVsOwotICAgIEludCBQYWNrZXRTaXplID0gZW5jT3B0aW9uLT5wYWNrZXRTaXplIDw8IDM7Ci0gICAgSW50IHRpbWVJbmMsIHRpbWVJbmNSZXM7Ci0gICAgZmxvYXQgcHJvZmlsZV9tYXhfZnJhbWVyYXRlOwotICAgIFZpZGVvRW5jUGFyYW1zICplbmNQYXJhbXM7Ci0KLSAgICBpZiAoZW5jb2RlckNvbnRyb2wtPnZpZGVvRW5jb2RlckRhdGEpIC8qIHRoaXMgaGFzIGJlZW4gY2FsbGVkICovCi0gICAgewotICAgICAgICBpZiAoZW5jb2RlckNvbnRyb2wtPnZpZG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Y1BhcmFtcy0+R09WX0VuYWJsZWQgPSAwOwotICAgICAgICAgICAgZW5jUGFyYW1zLT5UaW1lSW5jcmVtZW50UmVzID0gMzAwMDA7ICAgICAgICAvKiB0aW1lSW5jcmVtZW50UmVzIGZvciBIMjYzICovCi0gICAgICAgICAgICBicmVhazsKLQotICAgICAgICBjYXNlIEgyNjNfTU9ERToKLSAgICAgICAgY2FzZSBIMjYzX01PREVfV0lUSF9FUlJfUkVTOgotCi0gICAgICAgICAgICAvKiBGcm9tIFRhYmxlIDYtMjYgKi8KLSAgICAgICAgICAgIGVuY1BhcmFtcy0+bkxheWVycyA9IDE7Ci0gICAgICAgICAgICBlbmNQYXJhbXMtPlF1YW50VHlwZVswXSA9IDA7ICAgIC8qSDI2MyAqLwotICAgICAgICAgICAgZW5jUGFyYW1zLT5SZXN5bmNNYXJrZXJEaXNhYmxlID0gMTsgLyogRGlzYWJsZSBSZXN5bmMgTWFya2VyICovCi0gICAgICAgICAgICBlbmNQYXJhbXMtPkRhdGFQYXJ0aXRpb25pbmcgPSAwOyAvKiBDb21iaW5lZCBNb2RlICovCi0gICAgICAgICAgICBlbmNQYXJhbXMtPlJldmVyc2libGVWTEMgPSAwOyAgIC8qIERpc2FibGUgUlZMQyAqLwotICAgICAgICAgICAgZW5jUGFyYW1zLT5Sb3VuZGluZ1R5cGUgPSAwOwotICAgICAgICAgICAgZW5jUGFyYW1zLT5JbnRyYURDVmxjVGhyID0gNzsgICAvKiB1c2VfaW50cmFfZGNfdmxjID0gMCAqLwotICAgICAgICAgICAgZW5jUGFyYW1zLT5NVjh4OF9FbmFibGVkID0gMDsKLQotICAgICAgICAgICAgZW5jUGFyYW1zLT5IMjYzX0VuYWJsZWQgPSAxOwotICAgICAgICAgICAgZW5jUGFyYW1zLT5HT1ZfRW5hYmxlZCA9IDA7Ci0gICAgICAgICAgICBlbmNQYXJhbXMtPlRpbWVJbmNyZW1lbnRSZXMgPSAzMDAwMDsgICAgICAgIC8qIHRpbWVJbmNyZW1lbnRSZXMgZm9yIEgyNjMgKi8KLQotICAgICAgICAgICAgYnJlYWs7Ci0jaWZuZGVmIEgyNjNfT05MWQotICAgICAgICBjYXNlIERBVEFfUEFSVElUSU9OSU5HX01PREU6Ci0KLSAgICAgICAgICAgIGVuY1BhcmFtcy0+RGF0YVBhcnRpdGlvbmluZyA9IDE7ICAgICAgICAvKiBCYXNlIExheWVyIERhdGEgUGFydGl0aW9uaW5nICovCi0gICAgICAgICAgICBlbmNQYXJhbXMtPlJlc3luY01hcmtlckRpc2FibGUgPSAwOyAvKiBSZXN5bmMgTWFya2VyICovCi0jaWZkZWYgTk9fUlZMQwotICAgICAgICAgICAgZW5jUGFyYW1zLT5SZXZlcnNpYmxlVkxDID0gMDsKLSNlbHNlCi0gICAgICAgICAgICBlbmNQYXJhbXMtPlJldmVyc2libGVWTEMgPSAoZW5jT3B0aW9uLT5ydmxjRW5hYmxlID09IFBWX09OKTsgLyogUlZMQyB3aGVuIERhdGEgUGFydGl0aW9uaW5nICovCi0jZW5kaWYKLSAgICAgICAgICAgIGVuY1BhcmFtcy0+UmVzeW5jUGFja2V0c2l6ZSA9IFBhY2tldFNpemU7Ci0gICAgICAgICAgICBicmVhazsKLQotICAgICAgICBjYXNlIENPTUJJTkVfTU9ERV9XSVRIX0VSUl9SRVM6Ci0KLSAgICAgICAgICAgIGVuY1BhcmFtcy0+RGF0YVBhcnRpdGlvbmluZyA9IDA7ICAgICAgICAvKiBDb21iaW5lZCBNb2RlICovCi0gICAgICAgICAgICBlbmNQYXJhbXMtPlJlc3luY01hcmtlckRpc2FibGUgPSAwOyAvKiBSZXN5bmMgTWFya2VyICovCi0gICAgICAgICAgICBlbmNQYXJhbXMtPlJldmVyc2libGVWTEMgPSAwOyAgICAgICAgICAgLyogTm8gUlZMQyAqLwotICAgICAgICAgICAgZW5jUGFyYW1zLT5SZXN5bmNQYWNrZXRzaXplID0gUGFja2V0U2l6ZTsKLSAgICAgICAgICAgIGJyZWFrOwotCi0gICAgICA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luY1JlcykgJiYgKHRpbWVJbmMgIT0gMCkpCi0gICAgewotICAgICAgICBpZiAoIWVuY1BhcmFtcy0+SDI2M19FbmFibGVkKQotICAgICAgICB7Ci0gICAgICAgICAgICBlbmNQYXJhbXMtPlRpbWVJbmNyZW1lbnRSZXMgPSB0aW1lSW5jUmVzOwotICAgICAgICB9Ci0gICAgICAgIGVsc2UKLSAgICAgICAgewotICAgICAgICAgICAgZW5jUGFyYW1zLT5UaW1lSW5jcmVtZW50UmVzID0gMzAwMDA7Ci0vLyAgICAgICAgICB2aWRlby0+RnJhbWVSYXRlID0gMzAwMDAvKGZsb2F0KTEwMDE7IC8qIGZpeCBpdCB0byAyOS45NyBmcHMgKi8KLSAgICAgICAgfQotICAgICAgICB2aWRlby0+RnJhbWVSYXRlID0gdGltZUluY1JlcyAvICgoZmxvYXQpdGltZUluYyk7Ci0gICAgfQotICAgIGVsc2UKLSAgICB7Ci0gICAgICAgIGdvdG8gQ0xFQU5fVVA7Ci0gICAgfQotCi0gICAgLyogY2hlY2sgZnJhbWUgZGltZW5zaW9uICovCi0gICAgaWYgKGVuY1BhcmFtcy0+SDI2M19FbmFibGVkKQotICAgIHsKLSAgICAgICAgc3dpdGNoIChlbmNPcHRpb24tPmVuY1dpZHRoWzBdKQotICAgICAgICB7Ci0gICAgICAgICAgICBjYXNlIDEyODoKLSAgICAgICAgICAgICAgICBpZiAoZW5jT3B0aW9uLT5lbmNIZWlnaHRbMF0gIT0gOTYpIC8qIHNvdXJjZV9mb3JtYXQgPSAxICovCi0gICAgICAgICAgICAgICAgICAgIGdvdG8gQ0xFQU5fVVA7Ci0gICAgICAgICAgICAgICAgYnJlYWs7Ci0gICAgICAgICAgICBjYXNlIDE3NjoKLSAgICAgICAgICAgICAgICBpZiAoZW5jT3B0aW9uLT5lbmNIZWlnaHRbMF0gIT0gMTQ0KSAvKiBzb3VyY2VfZm9ybWF0ID0gMiAqLwotICAgICAgICAgICAgICAgICAgICBnb3RvIENMRUFOX1VQOwotICAgICAgICAgICAgICAgIGJyZWFrOwotICAgICAgICAgICAgY2FzZSAzNTI6Ci0gICAgICAgICAgICAgICAgaWYgKGVuY09wdGlvbi0+ZW5jSGVpZ2h0WzBdICE9IDI4OCkgLyogc291cmNlX2Zvcm1hdCA9IDIgKi8KLSAgICAgICAgICAgICAgICAgICAgZ290byBDTEVBTl9VUDsKLSAgICAgICAgICAgICAgICBicmVhazsKLQotICAgICAgICAgICAgY2FzZSA3MDQ6Ci0gICAgICAgICAgICAgICAgaWYgKGVuY09wdGlvbi0+ZW5jSGVpZ2h0WzBdICE9IDU3NikgLyogc291cmNlX2Zvcm1hdCA9IDIgKi8KLSAgICAgICAgICAgICAgICAgICAgZ290byBDTEVBTl9VUDsKLSAgICAgICAgICAgICAgICBicmVhazsKLSAgICAgICAgICAgIGNhc2UgMTQwODoKLSAgICAgICAgICAgICAgICBpZiAoZW5jT3B0aW9uLT5lbmNIZWlnaHRbMF0gIT0gMTE1MikgLyogc291cmNlX2Zvcm1hdCA9IDIgKi8KLSAgICAgICAgICAgICAgICAgICAgZ290byBDTEVBTl9VUDsKLSAgICAgICAgICAgICAgICBicmVhazsKLQotICAgICAgICAgICAgZGVmYXVsdDoKLSAgICAgICAgICAgICAgICBnb3RvIENMRUFOX1VQOwotICAgICAgICB9Ci0gICAgfQotICAgIGZvciAoaSA9IDA7IGkgPCBlbmNQYXJhbXMtPm5MYXllcnM7IGkrKykKLSAgICB7Ci0gICAgICAgIGVuY1BhcmFtcy0+TGF5ZXJIZWlnaHRbaV0gPSBlbmNPcHRpb24tPmVuY0hlaWdodFtpXTsKLSAgICAgICAgZW5jUGFyYW1zLT5MYXllcldpZHRoW2ldID0gZW5jT3B0aW9uLT5lbmNXaWR0aFtpXTsKLSAgICB9Ci0KLSAgICAvKiBjaGVjayBmcmFtZSByYXRlICovCi0gICAgZm9yIChpID0gMDsgaSA8IGVuY1BhcmFtcy0+bkxheWVyczsgaSsrKQotICAgIHsKLSAgICAgICAgZW5jUGFyYW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W5jUGFyYW1zLT5WQlZfZGVsYXkgPSAoZmxvYXQpMi4wOyAvKiBkZWZhdWx0IDJzZWMgVkJWIGJ1ZmZlciBzaXplICovCi0gICAgICAgICAgICAgICAgYnJlYWs7Ci0KLSAgICAgICAgICAgIGNhc2UgQ0JSX0xPV0RFTEFZOgotICAgICAgICAgICAgICAgIGVuY1BhcmFtcy0+VkJWX2RlbGF5ID0gKGZsb2F0KTAuNTsgLyogZGVmYXVsdCAwLjVzZWMgVkJWIGJ1ZmZlciBzaXplICovCi0gICAgICAgICAgICAgICAgYnJlYWs7Ci0KLSAgICAgICAgICAgIGNhc2UgVkJSXzE6Ci0gICAgICAgICAgICBjYXNlIFZCUl8yOgotICAgICAgICAgICAgICAgIGVuY1BhcmFtcy0+VkJWX2RlbGF5ID0gKGZsb2F0KTEwLjA7IC8qIGRlZmF1bHQgMTBzZWMgVkJWIGJ1ZmZlciBzaXplICovCi0gICAgICAgICAgICAgICAgYnJlYWs7Ci0gICAgICAgICAgICBkZWZhdWx0OgotICAgICAgICAgICAgICAgIGJyZWFrOwotICAgICAgICB9Ci0gICAgfQotICAgIGVsc2UgLyogZm9yY2UgdGhpcyB2YWx1ZSAqLwotICAgIHsKLSAgICAgICAgZW5jUGFyYW1zLT5WQlZfZGVsYXkgPSBlbmNPcHRpb24tPnZidkRlbGF5OwotICAgIH0KLQotICAgIC8qIGNoZWNrIHNlYXJjaCByYW5nZSAqLwotICAgIGlmIChlbmNQYXJhbXMtPkgyNjNfRW5hYmxlZCAmJiBlbmNPcHRpb24tPnNlYXJjaFJhbmdlID4gMTYpCi0gICAgewotICAgICAgICBlbmNQYXJhbXMtPlNlYXJjaFJhbmdlID0gMTY7IC8qIDQvMTYvMjAwMSAqLwotICAgIH0KLQotICAgIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLSAgICAvKiBjaGVja2luZyBmb3IgY29uZmxpY3QgYmV0d2VlbiBvcHRpb25zICovCi0gICAgLyoqKioqK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UQgPSAwOwotCi0KLSAgICAvKiAwNC8wOS8wMSwgZm9yIFZvcHMgaW4gdGhlIHVzZSBtdWx0aXBhc3MgcHJvY2Vzc2luZyAqLwotICAgIGZvciAoaWR4ID0gMDsgaWR4IDwgbkxheWVyczsgaWR4KyspCi0gICAgewotICAgICAgICB2aWRlby0+cE1QW2lkeF0gPSAoTXVsdGlQYXNzICopTTRWRU5DX01BTExPQyhzaXplb2YoTXVsdGlQYXNzKSk7Ci0gICAgICAgIGlmICh2aWRlby0+cE1QW2lkeF0gPT0gTlVMTCkgICAgZ290byBDTEVBTl9VUDsKLSAgICAgICAgTTRWRU5DX01FTVNFVCh2aWRlby0+cE1QW2lkeF0sIDAsIHNpemVvZihNdWx0aVBhc3MpKTsKLQotICAgICAgICB2aWRlby0+cE1QW2lkeF0tPmVuY29kZWRfZnJhbWVzID0gLTE7IC8qIGZvcmdldCBhYm91dCB0aGUgdmVyeSBmaXJzdCBJIGZyYW1lICovCi0KLQotICAgICAgICAvKiBSREluZm8gKipwUkRTYW1wbGVzICovCi0gICAgICAgIHZpZGVvLT5wTVBbaWR4XS0+cFJEU2FtcGxlcyA9IChSREluZm8gKiopTTRWRU5DX01BTExPQygzMCAqIHNpemVvZihSREluZm8gKikpOwotICAgICAgICBpZiAodmlkZW8tPnBNUFtpZHhdLT5wUkRTYW1wbGVzID09IE5VTEwpICAgIGdvdG8gQ0xFQU5fVVA7Ci0gICAgICAgIGZvciAoaSA9IDA7IGkgPCAzMDsgaSsrKQotICAgICAgICB7Ci0gICAgICAgICAgICB2aWRlby0+cE1QW2lkeF0tPnBSRFNhbXBsZXNbaV0gPSAoUkRJbmZvICopTTRWRU5DX01BTExPQygzMiAqIHNpemVvZihSREluZm8pKTsKLSAgICAgICAgICAgIGlmICh2aWRlby0+cE1QW2lkeF0tPnBSRFNhbXBsZXNbaV0gPT0gTlVMTCkgZ290byBDTEVBTl9VUDsKLSAgICAgICAgICAgIGZvciAoaiA9IDA7IGogPCAzMjsgaisrKS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gICAgICBzd2l0Y2ggKHBWb2wtPndpZHRoKQotICAgICAgICAgICAgewotICAgICAgICAgICAgICAgIGNhc2UgMTI4OgotICAgICAgICAgICAgICAgICAgICBpZiAocFZvbC0+aGVpZ2h0ID09IDk2KSAgLyogc291cmNlX2Zvcm1hdCA9IDEgKi8KLSAgICAgICAgICAgICAgICAgICAgewotICAgICAgICAgICAgICAgICAgICAgICAgcFZvbC0+bkdPQmluVm9wID0gNjsKLSAgICAgICAgICAgICAgICAgICAgICAgIHBWb2wtPm5NQmluR09CID0gODsKLSAgICAgICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgICAgICBlbHNlCi0gICAgICAgICAgICAgICAgICAgICAgICBzdGF0dXMgPSBQVl9GQUxTRTsKLSAgICAgICAgICAgICAgICAgICAgYnJlYWs7Ci0KLSAgICAgICAgICAgICAgICBjYXNlIDE3NjoKLSAgICAgICAgICAgICAgICAgICAgaWYgKHBWb2wtPmhlaWdodCA9PSAxNDQpICAvKiBzb3VyY2VfZm9ybWF0ID0gMiAqLwotICAgICAgICAgICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgICAgICAgICBwVm9sLT5uR09CaW5Wb3AgPSA5OwotICAgICAgICAgICAgICAgICAgICAgICAgcFZvbC0+bk1CaW5HT0IgPSAxMTsKLSAgICAgICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgICAgICBlbHNlCi0gICAgICAgICAgICAgICAgICAgICAgICBzdGF0dXMgPSBQVl9GQUxTRTsKLSAgICAgICAgICAgICAgICAgICAgYnJlYWs7Ci0gICAgICAgICAgICAgICAgY2FzZSAzNTI6Ci0gICAgICAgICAgICAgICAgICAgIGlmIChwVm9sLT5oZWlnaHQgPT0gMjg4KSAgLyogc291cmNlX2Zvcm1hdCA9IDIgKi8KLSAgICAgICAgICAgICAgICAgICAgewotICAgICAgICAgICAgICAgICAgICAgICAgcFZvbC0+bkdPQmluVm9wID0gMTg7Ci0gICAgICAgICAgICAgICAgICAgICAgICBwVm9sLT5uTUJpbkdPQiA9IDIyOwotICAgICAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgICAgIGVsc2UKLSAgICAgICAgICAgICAgICAgICAgICAgIHN0YXR1cyA9IFBWX0ZBTFNFOwotICAgICAgICAgICAgICAgICAgICBicmVhazsKLQotICAgICAgICAgICAgICAgIGNhc2UgNzA0OgotICAgICAgICAgICAgICAgICAgICBpZiAocFZvbC0+aGVpZ2h0ID09IDU3NikgIC8qIHNvdXJjZV9mb3JtYXQgPSAyICovCi0gICAgICAgICAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAgICAgICAgIHBWb2wtPm5HT0JpblZvcCA9IDE4OwotICAgICAgICAgICAgICAgICAgICAgICAgcFZvbC0+bk1CaW5HT0IgPSA4ODsKLSAgICAgICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgICAgICBlbHNlCi0gICAgICAgICAgICAgICAgICAgICAgICBzdGF0dXMgPSBQVl9GQUxTRTsKLSAgICAgICAgICAgICAgICAgICAgYnJlYWs7Ci0gICAgICAgICAgICAgICAgY2FzZSAxNDA4OgotICAgICAgICAgICAgICAgICAgICBpZiAocFZvbC0+aGVpZ2h0ID09IDExNTIpICAvKiBzb3VyY2VfZm9ybWF0ID0gMiAqLwotICAgICAgICAgICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgICAgICAgICBwVm9sLT5uR09CaW5Wb3AgPSAxODsKLSAgICAgICAgICAgICAgICAgICAgICAgIHBWb2wtPm5NQmluR09CID0gMzUyOwotICAgICAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgICAgIGVsc2UKLSAgICAgICAgICAgICAgICAgICAgICAgIHN0YXR1cyA9IFBWX0ZBTFNFOwotICAgICAgICAgICAgICAgICAgICBicmVhazsKLQotICAgICAgICAgICAgICAgIGRlZmF1bHQ6Ci0gICAgICAgICAgICAgICAgICAgIHN0YXR1cyA9IFBWX0ZBTFNFOwotICAgICAgICAgICAgICAgICAgICBicmVhazsKLSAgICAgICAgICAgIH0KLSAgICAgICAgfQotICAgIH0KLQotICAgIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0gICAgLyogYWxsb2NhdGUgYW5kIGluaXRpYWxpemUgcmF0ZSBjb250cm9sIHBhcmFtZXRlcnMgKi8KLSAgICAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotCi0gICAgLyogQkVHSU4gSU5JVElBTElaQVRJT04gT0YgQU5ORVggTCBSQVRFIENPTlRST0wgKi8KLSAgICBpZiAodmlkZW8tPmVuY1BhcmFtcy0+UkNfVHlwZSAhPSBDT05TVEFOVF9RKQotICAgIHsKLSAgICAgICAgZm9yIChpZHggPSAwOyBpZHggPCBuTGF5ZXJzOyBpZHgrKykgLyogMTIvMjUvMDAgKi8KLSAgICAgICAgewotICAgICAgICAgICAgdmlkZW8tPnJjW2lkeF0gPQotICAgICAgICAgICAgICAgIChyYXRlQ29udHJvbCAqKU00VkVOQ19NQUxMT0Moc2l6ZW9mKHJhdGVDb250cm9sKSk7Ci0KLSAgICAgICAgICAgIGlmICh2aWRlby0+cmNbaWR4XSA9PSBOVUxMKSBnb3RvIENMRUFOX1VQOwotCi0gICAgICAgICAgICBNNFZFTkNfTUVNU0VUKHZpZGVvLT5yY1tpZHhdLCAwLCBzaXplb2YocmF0ZUNvbnRyb2wpKTsKLSAgICAgICAgfQotICAgICAgICBpZiAoUFZfU1VDQ0VTUyAhPSBSQ19Jbml0aWFsaXplKHZpZGVvKSkKLSAgICAgICAgewotICAgICAgICAgICAgZ290byBDTEVBTl9VUDsKLSAgICAgICAgfQotICAgICAgICAvKiBpbml0aWFsaXphdGlvbiBmb3IgMi1wYXNzIHJhdGUgY29udHJvbCAqLwotICAgIH0KLSAgICAvKiBFTkQgSU5JVElBTElaQVRJT04gT0YgQU5ORVggTCBSQVRFIENPTlRST0wgKi8KLQotICAgIC8qKioqKioqKioqIGF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b2NrX0M7Ci0gICAgdmlkZW8tPmZ1bmN0aW9uUG9pbnRlci0+Q2hvb3NlTW9kZSA9ICZDaG9vc2VNb2RlX0M7Ci0gICAgdmlkZW8tPmZ1bmN0aW9uUG9pbnRlci0+R2V0SGFsZlBlbE1CUmVnaW9uID0gJkdldEhhbGZQZWxNQlJlZ2lvbl9DOwotLy8gIHZpZGVvLT5mdW5jdGlvblBvaW50ZXItPlNBRF9NQl9QQURESU5HID0gJlNBRF9NQl9QQURESU5HOyAvKiA0LzIxLzAxICovCi0KLQotICAgIGVuY29kZXJDb250cm9sLT52aWRlb0VuY29kZXJJbml0ID0gMTsgIC8qIGluaXQgZG9uZSEgKi8KLQotICAgIHJldHVybiBQVl9UUlVFOwotCi1DTEVBTl9VUDoKLSAgICBQVkNsZWFuVXBWaWRlb0VuY29kZXIoZW5jb2RlckNvbnRyb2wpOwotCi0gICAgcmV0dXJuIFBWX0ZBTFNFOwotfQotCi0KLS8qID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PSAqLwotLyogIEZ1bmN0aW9uIDogUFZDbGVhblVwVmlkZW9FbmNvZGVyKCkgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgRGF0ZSAgICAgOiAwOC8yMi8yMDAwICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICBQdXJwb3NlICA6IERlYWxsb2NhdGVzIGFsbG9jYXRlZCBtZW1vcnkgZnJvbSBJbml0VmlkZW9FbmNvZGVyKCkgICAgICAgICAqLwotLyogIEluL291dCAgIDogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgUmV0dXJuICAgOiBQVl9UUlVFIGlmIHN1Y2Nlc3NlZCwgUFZfRkFMU0UgaWYgZmFpbGVkLiAgICAgICAgICAgICAgICAgICAgKi8KLS8qICBNb2RpZmllZCA6IDUvMjEvMDEsIGZyZWUgb25seSB5Q2hhbiBpbiBWb3AgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PSAqLwotCi1PU0NMX0VYUE9SVF9SRUYgQm9vbCAgICBQVkNsZWFuVXBWaWRlb0VuY29kZXIoVmlkZW9FbmNDb250cm9scyAqZW5jb2RlckNvbnRyb2wpCi17Ci0gICAgSW50IGlkeCwgaTsKLSAgICBWaWRlb0VuY0RhdGEgKnZpZGVvID0gKFZpZGVvRW5jRGF0YSAqKWVuY29kZXJDb250cm9sLT52aWRlb0VuY29kZXJEYXRhOwotICAgIGludCBuVG90YWxNQjsKLSAgICBpbnQgbWF4X3dpZHRoLCBvZmZzZXQ7Ci0KLSNpZmRlZiBQUklOVF9SQ19JTkZPCi0gICAgaWYgKGZhY2N0ICE9IE5VTEwpCi0gICAgewotICAgICAgICBmcHJpbnRmKGZhY2N0LCAiQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQFxuIik7Ci0gICAgICAgIGZwcmludGYoZmFjY3QsICJUT1RBTCBOVU0gQklUUyBHRU5FUkFURUQgJWRcbiIsIHRpVG90YWxOdW1CaXRzR2VuZXJhdGVkKTsKLSAgICAgICAgZnByaW50ZihmYWNjdCwgIkBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBcbiIpOwotICAgICAgICBmcHJpbnRmKGZhY2N0LCAiVE9UQUwgTlVNQkVSIE9GIEZSQU1FUyBDT0RFRCAlZFxuIiwKLSAgICAgICAgICAgICAgICB2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Rlby0+Yml0c3RyZWFtMik7Ci0gICAgICAgIGlmICh2aWRlby0+Yml0c3RyZWFtMylCaXRzdHJlYW1DbG9zZUVuYyh2aWRlby0+Yml0c3RyZWFtMyk7Ci0KLSAgICAgICAgaWYgKHZpZGVvLT5vdmVycnVuQnVmZmVyKSBNNFZFTkNfRlJFRSh2aWRlby0+b3ZlcnJ1bkJ1ZmZlcik7Ci0KLSAgICAgICAgbWF4X3dpZHRoID0gdmlkZW8tPmVuY1BhcmFtcy0+TGF5ZXJXaWR0aFswXTsKLSAgICAgICAgbWF4X3dpZHRoID0gKCgobWF4X3dpZHRoICsgMTUpID4+IDQpIDw8IDQpOyAvKiAwOS8xOS8wNSAqLwotICAgICAgICBpZiAodmlkZW8tPmVuY1BhcmFtcy0+SDI2M19FbmFibGVkKQotICAgICAgICB7Ci0gICAgICAgICAgICBvZmZzZXQgPSAwOwotICAgICAgICB9Ci0gICAgICAgIGVsc2UKLSAgICAgICAgewotICAgICAgICAgICAgb2Zmc2V0ID0gKChtYXhfd2lkdGggKyAzMikgPDwgNCkgKyAxNjsKLSAgICAgICAgfQotCi0gICAgICAgIGlmICh2aWRlby0+Y3VyclZvcCkKLSAgICAgICAgewotICAgICAgICAgICAgaWYgKHZpZGVvLT5jdXJyVm9wLT55Q2hhbikKLSAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICB2aWRlby0+Y3VyclZvcC0+eUNoYW4gLT0gb2Zmc2V0OwotICAgICAgICAgICAgICAgIE00VkVOQ19GUkVFKHZpZGVvLT5jdXJyVm9wLT55Q2hhbik7Ci0gICAgICAgICAgICB9Ci0gICAgICAgICAgICBNNFZFTkNfRlJFRSh2aWRlby0+Y3VyclZvcCk7Ci0gICAgICAgIH0KLQotICAgICAgICBpZiAodmlkZW8tPm5leHRCYXNlVm9wKQotICAgICAgICB7Ci0gICAgICAgICAgICBpZiAodmlkZW8tPm5leHRCYXNlVm9wLT55Q2hhbikKLSAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICB2aWRlby0+bmV4dEJhc2VWb3AtPnlDaGFuIC09IG9mZnNldDsKLSAgICAgICAgICAgICAgICBNNFZFTkNfRlJFRSh2aWRlby0+bmV4dEJhc2VWb3AtPnlDaGFuKTsKLSAgICAgICAgICAgIH0KLSAgICAgICAgICAgIE00VkVOQ19GUkVFKHZpZGVvLT5uZXh0QmFzZVZvcCk7Ci0gICAgICAgIH0KLQotICAgICAgICBpZiAodmlkZW8tPnByZXZCYXNlVm9wKQotICAgICAgICB7Ci0gICAgICAgICAgICBpZiAodmlkZW8tPnByZXZCYXNlVm9wLT55Q2hhbikKLSAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICB2aWRlby0+cHJldkJhc2VWb3AtPnlDaGFuIC09IG9mZnNldDsKLSAgICAgICAgICAgICAgICBNNFZFTkNfRlJFRSh2aWRlby0+cHJldkJhc2VWb3AtPnlDaGFuKTsKLSAgICAgICAgICAgIH0KLSAgICAgICAgICAgIE00VkVOQ19GUkVFKHZpZGVvLT5wcmV2QmFzZVZvcCk7Ci0gICAgICAgIH0KLSAgICAgICAgaWYgKHZpZGVvLT5wcmV2RW5oYW5jZVZvcCkKLSAgICAgICAgewotICAgICAgICAgICAgaWYgKHZpZGVvLT5wcmV2RW5oYW5jZVZvcC0+eUNoYW4pCi0gICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgdmlkZW8tPnByZXZFbmhhbmNlVm9wLT55Q2hhbiAtPSBvZmZzZXQ7Ci0gICAgICAgICAgICAgICAgTTRWRU5DX0ZSRUUodmlkZW8tPnByZXZFbmhhbmNlVm9wLT55Q2hhbik7Ci0gICAgICAgICAgICB9Ci0gICAgICAgICAgICBNNFZFTkNfRlJFRSh2aWRlby0+cHJldkVuaGFuY2VWb3ApOwotICAgICAgICB9Ci0KLSAgICAgICAgLyogMDQvMDkvMDEsIGZvciBWb3BzIGluIHRoZSB1c2UgbXVsdGlwYXNzIHByb2Nlc3NpbmcgKi8KLSAgICAgICAgZm9yIChpZHggPSAwOyBpZHggPCB2aWRlby0+ZW5jUGFyYW1zLT5uTGF5ZXJzOyBpZHgrKykKLSAgICAgICAgewotICAgICAgICAgICAgaWYgKHZpZGVvLT5wTVBbaWR4XSkKLSAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICBpZiAodmlkZW8tPnBNUFtpZHhdLT5wUkRTYW1wbGVzKQotICAgICAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAgICAgZm9yIChpID0gMDsgaSA8IDMwOyBpKyspCi0gICAgICAgICAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAgICAgICAgIGlmICh2aWRlby0+cE1QW2lkeF0tPnBSRFNhbXBsZXNbaV0pCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgTTRWRU5DX0ZSRUUodmlkZW8tPnBNUFtpZHhdLT5wUkRTYW1wbGVzW2ldKTsKLSAgICAgICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgICAgICBNNFZFTkNfRlJFRSh2aWRlby0+cE1QW2lkeF0tPnBSRFNhbXBsZXMpOwotICAgICAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgICAgIE00VkVOQ19NRU1TRVQodmlkZW8tPnBNUFtpZHhdLCAwLCBzaXplb2YoTXVsdGlQYXNzKSk7Ci0gICAgICAgICAgICAgICAgTTRWRU5DX0ZSRUUodmlkZW8tPnBNUFtpZHhdKTsKLSAgICAgICAgICAgIH0KLSAgICAgICAgfQotICAgICAgICAvKiAvLyAgRW5kIC8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLyAqLwotCi0gICAgICAgIGlmICh2aWRlby0+dm9sKQotICAgICAgICB7Ci0gICAgICAgICAgICBmb3IgKGlkeCA9IDA7IGlkeCA8IHZpZGVvLT5lbmNQYXJhbXMtPm5MYXllcnM7IGlkeCsrKQotICAgICAgICAgICAgewotICAgICAgICAgICAgICAgIGlmICh2aWRlby0+dm9sW2lkeF0pCi0gICAgICAgICAgICAgICAgewotICAgICAgICAgICAgICAgICAgICBpZiAodmlkZW8tPnZvbFtpZHhdLT5zdHJlYW0pCi0gICAgICAgICAgICAgICAgICAgICAgICBNNFZFTkNfRlJFRSh2aWRlby0+dm9sW2lkeF0tPnN0cmVhbSk7Ci0gICAgICAgICAgICAgICAgICAgIE00VkVOQ19GUkVFKHZpZGVvLT52b2xbaWR4XSk7Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgfQotICAgICAgICAgICAgTTRWRU5DX0ZSRUUodmlkZW8tPnZvbCk7Ci0gICAgICAgIH0KLQotICAgICAgICAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotICAgICAgICAvKiBzdG9wIHJhdGUgY29udHJvbCBwYXJhbWV0ZXJzICovCi0gICAgICAgIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0KLSAgICAgICAgLyogQU5ORVggTCBSQVRFIENPTlRST0wgKi8KLSAgICAgICAgaWYgKHZpZGVvLT5lbmNQYXJhbXMtPlJDX1R5cGUgIT0gQ09OU1RBTlRfUSkKLSAgICAgICAgewotICAgICAgICAgICAgUkNfQ2xlYW51cCh2aWRlby0+cmMsIHZpZGVvLT5lbmNQYXJhbXMtPm5MYXllcnMpOwotCi0gICAgICAgICAgICBmb3IgKGlkeCA9IDA7IGlkeCA8IHZpZGVvLT5lbmNQYXJhbXMtPm5MYXllcnM7IGlkeCsrKQotICAgICAgICAgICAgewotICAgICAgICAgICAgICAgIGlmICh2aWRlby0+cmNbaWR4XSkKLSAgICAgICAgICAgICAgICAgICAgTTRWRU5DX0ZSRUUodmlkZW8tPnJjW2lkeF0pOwotICAgICAgICAgICAgfQotICAgICAgICB9Ci0KLSAgICAgICAgaWYgKHZpZGVvLT5mdW5jdGlvblBvaW50ZXIpIE00VkVOQ19GUkVFKHZpZGVvLT5mdW5jdGlvblBvaW50ZXIpOwotCi0gICAgICAgIC8qIElmIGFwcGxpY2F0aW9uIGhhcyBjYWxsZWQgUFZDbGVhblVwVmlkZW9FbmNvZGVyIHRoZW4gd2UgZGVhbGxvY2F0ZSAqLwotICAgICAgICAvKiBJZiBQVkluaXRWaWRlb0VuY29kZXIgY2xhc3MgaXQsIHRoZW4gd2UgRE8gTk9UIGRlYWxsb2NhdGUgKi8KLSAgICAgICAgaWYgKHZpZGVvLT5lbmNQYXJhbXMpCi0gICAgICAgIHsKLSAgICAgICAgICAgIE00VkVOQ19GUkVFKHZpZGVvLT5lbmNQYXJhbXMpOwotICAgICAgICB9Ci0KLSAgICAgICAgTTRWRU5DX0ZSRUUodmlkZW8pOwotICAgICAgICBlbmNvZGVyQ29udHJvbC0+dmlkZW9FbmNvZGVyRGF0YSA9IE5VTEw7IC8qIHZpZGVvICovCi0gICAgfQotCi0gICAgZW5jb2RlckNvbnRyb2wtPnZpZGVvRW5jb2RlckluaXQgPSAwOwotCi0gICAgcmV0dXJuIFBWX1RSVUU7Ci19Ci0KLS8qID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PSAqLwotLyogIEZ1bmN0aW9uIDogUFZHZXRWb2xIZWFkZXIoKSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgRGF0ZSAgICAgOiA3LzE3LzIwMDEsICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICBQdXJwb3NlICA6ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogIEluL291dCAgIDogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgUmV0dXJuICAgOiBQVl9UUlVFIGlmIHN1Y2Nlc3NlZCwgUFZfRkFMU0UgaWYgZmFpbGVkLiAgICAgICAgICAgICAgICAgICAgKi8KLS8qICBNb2RpZmllZCA6ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0gKi8KLQotT1NDTF9FWFBPUlRfUkVGIEJvb2wgUFZHZXRWb2xIZWFkZXIoVmlkZW9FbmNDb250cm9scyAqZW5jQ3RybCwgVUNoYXIgKnZvbEhlYWRlciwgSW50ICpzaXplLCBJbnQgbGF5ZXIpCi17Ci0gICAgVmlkZW9FbmNEYXRhICAgICplbmNEYXRhOwotICAgIFBWX1NUQVRVUyAgIEVuY29kZVZPU19TdGFydChWaWRlb0VuY0NvbnRyb2xzICplbmNDdHJsKTsKLSAgICBlbmNEYXRhID0gKFZpZGVvRW5jRGF0YSAqKWVuY0N0cmwtPnZpZGVvRW5jb2RlckRhdGE7Ci0KLQotICAgIGlmIChlbmNEYXRhID09IE5VTEwpCi0gICAgICAgIHJldHVybiBQVl9GQUxTRTsKLSAgICBpZiAoZW5jRGF0YS0+ZW5jUGFyYW1zID09IE5VTEwpCi0gICAgICAgIHJldHVybiBQVl9GQUxTRTsKLQotCi0gICAgZW5jRGF0YS0+Y3VyckxheWVyID0gbGF5ZXI7IC8qIFNldCBMYXllciAqLwotICAgIC8qcHZfc3RhdHVzID0gKi8KLSAgICBFbmNvZGVWT1NfU3RhcnQoZW5jQ3RybCk7IC8qIEVuY29kZSBWT0wgSGVhZGVyICovCi0KLSAgICBlbmNEYXRhLT5lbmNQYXJhbXMtPkdldFZvbEhlYWRlcltsYXllcl0gPSAxOyAvKiBTZXQgdXNhZ2UgZmxhZzogTmVlZGVkIHRvIHN1cHBvcnQgb2xkIG1ldGhvZCovCi0KLSAgICAvKiBDb3B5IGJpdHN0cmVhbSB0byBidWZmZXIgYW5kIHNldCB0aGUgc2l6ZSAqLwotCi0gICAgaWYgKCpzaXplID4gZW5jRGF0YS0+Yml0c3RyZWFtMS0+Ynl0ZUNvdW50KQotICAgIHsKLSAgICAgICAgKnNpemUgPSBlbmNEYXRhLT5iaXRzdHJlYW0xLT5ieXRlQ291bnQ7Ci0gICAgICAgIE00VkVOQ19NRU1DUFkodm9sSGVhZGVyLCBlbmNEYXRhLT5iaXRzdHJlYW0xLT5iaXRzdHJlYW1CdWZmZXIsICpzaXplKTsKLSAgICB9Ci0gICAgZWxzZQotICAgICAgICByZXR1cm4gUFZfRkFMU0U7Ci0KLSAgICAvKiBSZXNldCBiaXRzdHJlYW0xIGJ1ZmZlciBwYXJhbWV0ZXJzICovCi0gICAgQml0c3RyZWFtRW5jUmVzZXQoZW5jRGF0YS0+Yml0c3RyZWFtMSk7Ci0KLSAgICByZXR1cm4gUFZfVFJVRTsKLX0KLQotLyogPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09ICovCi0vKiAgRnVuY3Rpb24gOiBQVkdldE92ZXJydW5CdWZmZXIoKSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICBQdXJwb3NlICA6IEdldCB0aGUgb3ZlcnJ1biBidWZmZXIgYCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogIEluL291dCAgIDogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgUmV0dXJuICAgOiBQb2ludGVyIHRvIG92ZXJydW4gYnVmZmVyLiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICBNb2RpZmllZCA6ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09ICovCi0KLU9TQ0xfRVhQT1JUX1JFRiBVQ2hhciogUFZHZXRPdmVycnVuQnVmZmVyKFZpZGVvRW5jQ29udHJvbHMgKmVuY0N0cmwpCi17Ci0gICAgVmlkZW9FbmNEYXRhICp2aWRlbyA9IChWaWRlb0VuY0RhdGEgKillbmNDdHJsLT52aWRlb0VuY29kZXJEYXRhOwotICAgIEludCBjdXJyTGF5ZXIgPSB2aWRlby0+Y3VyckxheWVyOwotICAgIFZvbCAqY3VyclZvbCA9IHZpZGVvLT52b2xbY3VyckxheWVyXTsKLQotICAgIGlmIChjdXJyVm9sLT5zdHJlYW0tPmJpdHN0cmVhbUJ1ZmZlciAhPSB2aWRlby0+b3ZlcnJ1bkJ1ZmZlcikgLy8gbm90IHVzZWQKLSAgICB7Ci0gICAgICAgIHJldHVybiBOVUxMOwotICAgIH0KLQotICAgIHJldHVybiB2aWRlby0+b3ZlcnJ1bkJ1ZmZlcjsKLX0KLQotCi0KLQotLyogPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09ICovCi0vKiAgRnVuY3Rpb24gOiBFbmNvZGVWaWRlb0ZyYW1lKCkgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICBEYXRlICAgICA6IDA4LzIyLzIwMDAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogIFB1cnBvc2UgIDogRW5jb2RlIHZpZGVvIGZyYW1lIGFuZCByZXR1cm4gYml0c3RyZWFtICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgSW4vb3V0ICAgOiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICBSZXR1cm4gICA6IFBWX1RSVUUgaWYgc3VjY2Vzc2VkLCBQVl9GQUxTRSBpZiBmYWlsZWQuICAgICAgICAgICAgICAgICAgICAqLwotLyogIE1vZGlmaWVkIDogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgMDIuMTQuMjAwMSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICAgICAgICAgICAgICBGaW5pc2hpbmcgbmV3IHRpbWVzdGFtcCAzMi1iaXQgaW5wdXQgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogICAgICAgICAgICAgIEFwcGxpY2F0aW9ucyBuZWVkIHRvIHRha2UgY2FyZSBvZiB3cmFwLWFyb3VuZCAgICAgICAgICAgICAgICovCi0vKiA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0gKi8KLU9TQ0xfRVhQT1JUX1JFRiBCb29sIFBWRW5jb2RlVmlkZW9GcmFtZShWaWRlb0VuY0NvbnRyb2xzICplbmNDdHJsLCBWaWRlb0VuY0ZyYW1lSU8gKnZpZF9pbiwgVmlkZW9FbmNGcmFtZUlPICp2aWRfb3V0LAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFVMb25nICpuZXh0TW9kVGltZSwgVUNoYXIgKmJzdHJlYW0sIEludCAqc2l6ZSwgSW50ICpuTGF5ZXIpCi17Ci0gICAgQm9vbCBzdGF0dXMgPSBQVl9UUlVFOwotICAgIFBWX1NUQVRVUyBwdl9zdGF0dXM7Ci0gICAgVmlkZW9FbmNEYXRhICp2aWRlbyA9IChWaWRlb0VuY0RhdGEgKillbmNDdHJsLT52aWRlb0VuY29kZXJEYXRhOwotICAgIFZpZGVvRW5jUGFyYW1zICplbmNQYXJhbXMgPSB2aWRlby0+ZW5jUGFyYW1zOwotICAgIFZvbCAqY3VyclZvbDsKL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pemVbMF0pIC8qIGZpcnN0IHZvbCB0byBjb2RlICovCi0gICAgewotICAgICAgICB2aWRlby0+bmV4dE1vZFRpbWUgPSB2aWRlby0+bW9kVGltZVJlZiA9ICgobW9kVGltZSkgLSAoKG1vZFRpbWUpICUgMTAwMCkpOwotICAgIH0KLQotICAgIGVuY29kZVZvcCA9IERldGVybWluZUNvZGluZ0xheWVyKHZpZGVvLCBuTGF5ZXIsIG1vZFRpbWUpOwotICAgIGN1cnJMYXllciA9ICpuTGF5ZXI7Ci0gICAgaWYgKChjdXJyTGF5ZXIgPCAwKSB8fCAoY3VyckxheWVyID4gZW5jUGFyYW1zLT5uTGF5ZXJzIC0gMSkpCi0gICAgICAgIHJldHVybiBQVl9GQUxTRTsKLQotICAgIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0gICAgLyogSWYgcG9zdC1za2lwcGluZyBzdGlsbCBlZmZlY3RpdmUgLS0tIHJldHVybiAqLwotICAgIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0KLSAgICBpZiAoIWVuY29kZVZvcCkgLyogc2tpcCBlbmggbGF5ZXIsIG5vIGJhc2UgbGF5ZXIgY29kZWQgLS0tIHJldHVybiAqLwotICAgIHsKLSNpZmRlZiBfUFJJTlRfU1RBVAotICAgICAgICBwcmludGYoIk5vIGZyYW1lIGNvZGVkLiBDb250aW51ZSB0byBuZXh0IGZyYW1lLiIpOwotI2VuZGlmCi0gICAgICAgIC8qIGV4cGVjdGVkIG5leHQgY29kZSB0aW1lLCBjb252ZXJ0IGJhY2sgdG8gbWlsbGlzZWMgKi8KLSAgICAgICAgKm5leHRNb2RUaW1lID0gdmlkZW8tPm5leHRNb2RUaW1lOwotCi0jaWZkZWYgQUxMT1dfVk9QX05PVF9DT0RFRAotICAgICAgICBpZiAodmlkZW8tPnZvbFswXS0+c2hvcnRWaWRlb0hlYWRlcikgLyogU2hvcnQgVmlkZW8gSGVhZGVyID0gMSAqLwotICAgICAgICB7Ci0gICAgICAgICAgICAqc2l6ZSA9IDA7Ci0gICAgICAgICAgICAqbkxheWVyID0gLTE7Ci0gICAgICAgIH0KLSAgICAgICAgZWxzZQotICAgICAgICB7Ci0gICAgICAgICAgICAqbkxheWVyID0gMDsKLSAgICAgICAgICAgIEVuY29kZVZvcE5vdENvZGVkKHZpZGVvLCBic3RyZWFtLCBzaXplLCBtb2RUaW1lKTsKLSAgICAgICAgICAgICpzaXplID0gdmlkZW8tPnZvbFswXS0+c3RyZWFtLT5ieXRlQ291bnQ7Ci0gICAgICAgIH0KLSNlbHNlCi0gICAgICAgICpzaXplID0gMDsKLSAgICAgICAgKm5MYXllciA9IC0xOwotI2VuZGlmCi0gICAgICAgIHJldHVybiBzdGF0dXM7Ci0gICAgfQotCi0KLS8vRU5DT0RFX1ZPUF9BR0FJTjogIC8qIDEyLzMwLzAwICovCi0KLSAgICAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0gICAgLyogSW5pdGlhbGl6ZSBWb2wgc3RyZWFtIHN0cnVjdHVyZSB3aXRoIGFwcGxpY2F0aW9uIGJpdHN0cmVhbSAqLwotICAgIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLQotICAgIGN1cnJWb2wgPSB2aWRlby0+dm9sW2N1cnJMYXllcl07Ci0gICAgY3VyclZvbC0+c3RyZWFtLT5iaXRzdHJlYW1CdWZmZXIgPSBic3RyZWFtOwotICAgIGN1cnJWb2wtPnN0cmVhbS0+YnVmZmVyU2l6ZSA9ICpzaXplOwotICAgIEJpdHN0cmVhbUVuY1Jlc2V0KGN1cnJWb2wtPnN0cmVhbSk7Ci0gICAgQml0c3RyZWFtU2V0T3ZlcnJ1bkJ1ZmZlcihjdXJyVm9sLT5zdHJlYW0sIHZpZGVvLT5vdmVycnVuQnVmZmVyLCB2aWRlby0+b0JTaXplLCB2aWRlbyk7Ci0KLSAgICAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0gICAgLyogRW5jb2RlIFZPUyBhbmQgVk9MIEhlYWRlcnMgb24gZmlyc3QgY2FsbCBmb3IgZWFjaCBsYXllciAqLwotICAgIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLQotICAgIGlmICh2aWRlby0+dm9sSW5pdGlhbGl6ZVtjdXJyTGF5ZXJdKQotICAgIHsKLSAgICAgICAgdmlkZW8tPmN1cnJWb3AtPnRpbWVJbmMgPSAwOwotICAgICAgICB2aWRlby0+cHJldkJhc2VWb3AtPnRpbWVJbmMgPSAwOwotICAgICAgICBpZiAoIXZpZGVvLT5lbmNQYXJhbXMtPkdldFZvbEhlYWRlcltjdXJyTGF5ZXJdKQotICAgICAgICAgICAgcHZfc3RhdHVzID0gRW5jb2RlVk9TX1N0YXJ0KGVuY0N0cmwpOwotICAgIH0KLQotICAgIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0gICAgLyogQ29weSBJbnB1dCBWaWRlbyBGcmFtZSB0byBJbnRlcm5hbCBWaWRlbyBCdWZmZXIgKi8KLSAgICAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotICAgIC8qIERldGVybWluZSBXaWR0aCBhbmQgSGVpZ2h0IG9mIFZvcCBMYXllciAqLwotCi0gICAgd2lkdGggPSBlbmNQYXJhbXMtPkxheWVyV2lkdGhbY3VyckxheWVyXTsgICAvKiBHZXQgaW5wdXQgd2lkdGggKi8KLSAgICBoZWlnaHQgPSBlbmNQYXJhbXMtPkxheWVySGVpZ2h0W2N1cnJMYXllcl07IC8qIEdldCBpbnB1dCBoZWlnaHQgKi8KLSAgICAvKiBSb3VuZCBVcCB0byBuZWFyZXN0IG11bHRpcGxlIG9mIDE2IDogTVBFRy00IFN0YW5kYXJkICovCi0KLSAgICB3aWR0aF8xNiA9ICgod2lkdGggKyAxNSkgLyAxNikgKiAxNjsgICAgICAgICAgICAvKiBSb3VuZCB1cCB0byBuZWFyZXN0IG11bHRpcGxlIG9mIDE2ICovCi0gICAgaGVpZ2h0XzE2ID0gKChoZWlnaHQgKyAxNSkgLyAxNikgKiAxNjsgICAgICAgICAgLyogUm91bmQgdXAgdG8gbmVhcmVzdCBtdWx0aXBsZSBvZiAxNiAqLwotCi0gICAgdmlkZW8tPmlucHV0ID0gdmlkX2luOyAgLyogcG9pbnQgdG8gdGhlIGZyYW1lIGlucHV0ICovCi0KLSAgICAvKi8vICBFbmQgLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vICovCi0KLQotICAgIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLSAgICAvKiBEZXRlcm1pbmUgVk9QIFR5cGUgICAgICAgICAgICAgICAgICovCi0gICAgLyogNi8yLzIwMDEsIHNlcGFyYXRlIGZ1bmN0aW9uICAgICAgKi8KLSAgICAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0gICAgRGV0ZXJtaW5lVm9wVHlwZSh2aWRlbywgY3VyckxheWVyKTsKLQotICAgIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotICAgIC8qICAgIEluaXRpYWxpemUgVk9QICAgICAgICAqLwotICAgIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotICAgIHZpZGVvLT5jdXJyVm9wLT52b2xJRCA9IGN1cnJWb2wtPnZvbElEOwotICAgIHZpZGVvLT5jdXJyVm9wLT53aWR0aCA9IHdpZHRoXzE2OwotICAgIHZpZGVvLT5jdXJyVm9wLT5oZWlnaHQgPSBoZWlnaHRfMTY7Ci0gICAgaWYgKHZpZGVvLT5lbmNQYXJhbXMtPkgyNjNfRW5hYmxlZCkgLyogIDExLzI4LzA1ICovCi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bY3VyckxheWVyXTsKLQotCi0gICAgLyoqKioqKioqKioqKioqKiovCi0gICAgLyogRW5jb2RlIFZvcCAqLwotICAgIC8qKioqKioqKioqKioqKioqLwotICAgIHZpZGVvLT5zbGljZV9jb2RpbmcgPSAwOwotCi0gICAgcHZfc3RhdHVzID0gRW5jb2RlVm9wKHZpZGVvKTsKLSNpZmRlZiBfUFJJTlRfU1RBVAotICAgIGlmICh2aWRlby0+Y3VyclZvcC0+cHJlZGljdGlvblR5cGUgPT0gSV9WT1ApCi0gICAgICAgIHByaW50ZigiIEktVk9QICIpOwotICAgIGVsc2UKLSAgICAgICAgcHJpbnRmKCIgUC1WT1AgKHJlZi4lZCkiLCB2aWRlby0+Zm9yd2FyZFJlZlZvcC0+cmVmU2VsZWN0Q29kZSk7Ci0jZW5kaWYKLQotICAgIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0gICAgLyogVXBkYXRlIFNraXAgTmV4dCBGcmFtZSAgICAgICAgICAgKi8KLSAgICAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotICAgICpuTGF5ZXIgPSBVcGRhdGVTa2lwTmV4dEZyYW1lKHZpZGVvLCBuZXh0TW9kVGltZSwgc2l6ZSwgcHZfc3RhdHVzKTsKLSAgICBpZiAoKm5MYXllciA9PSAtMSkgLyogc2tpcCBjdXJyZW50IGZyYW1lICovCi0gICAgewotICAgICAgICAvKiBtYWtlIHN1cmUgdGhhdCBwb2ludGVycyBhcmUgcmVzdG9yZWQgdG8gdGhlIHByZXZpb3VzIHN0YXRlICovCi0gICAgICAgIGlmIChjdXJyTGF5ZXIgPT0gMCkKLSAgICAgICAgewotICAgICAgICAgICAgdmlkZW8tPmZvcndhcmRSZWZWb3AgPSB0ZW1wRm9yd1JlZlZvcDsgLyogRm9yIFAtVm9wIGJhc2Ugb25seSAqLwotICAgICAgICAgICAgdmlkZW8tPmZvcndhcmRSZWZWb3AtPnJlZlNlbGVjdENvZGUgPSB0Z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yogMTIvMjcvMDAgYWx3YXlzIGdvIGJ5IHRoZSBoaWdoZXN0IGxheWVyKi8KLSAgICAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotCi0gICAgLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0gICAgLyogQ29weSBSZWNvbnN0cnVjdGVkIEJ1ZmZlciB0byBPdXRwdXQgVmlkZW8gRnJhbWUgQnVmZmVyICovCi0gICAgLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0gICAgdmlkX291dC0+eUNoYW4gPSB2aWRlby0+Y3VyclZvcC0+eUNoYW47Ci0gICAgdmlkX291dC0+dUNoYW4gPSB2aWRlby0+Y3VyclZvcC0+dUNoYW47Ci0gICAgdmlkX291dC0+dkNoYW4gPSB2aWRlby0+Y3VyclZvcC0+dkNoYW47Ci0gICAgaWYgKHZpZGVvLT5lbmNQYXJhbXMtPkgyNjNfRW5hYmxlZCkKLSAgICB7Ci0gICAgICAgIHZpZF9vdXQtPmhlaWdodCA9IHZpZGVvLT5jdXJyVm9wLT5oZWlnaHQ7IC8qIHBhZGRlZCBoZWlnaHQgKi8KLSAgICAgICAgdmlkX291dC0+cGl0Y2ggPSB2aWRlby0+Y3VyclZvcC0+d2lkdGg7IC8qIHBhZGRlZCB3aWR0aCAqLwotICAgIH0KLSAgICBlbHNlCi0gICAgewotICAgICAgICB2aWRfb3V0LT5oZWlnaHQgPSB2aWRlby0+Y3VyclZvcC0+aGVpZ2h0ICsgMzI7IC8qIHBhZGRlZCBoZWlnaHQgKi8KLSAgICAgICAgdmlkX291dC0+cGl0Y2ggPSB2aWRlby0+Y3VyclZvcC0+d2lkdGggKyAzMjsgLyogcGFkZGVkIHdpZHRoICovCi0gICAgfQotICAgIC8vdmlkZW9fb3V0LT50aW1lc3RhbXAgPSB2aWRlby0+bW9kVGltZTsKLSAgICB2aWRfb3V0LT50aW1lc3RhbXAgPSAoVUxvbmcpKCgodmlkZW8tPnByZXZGcmFtZU51bVtjdXJyTGF5ZXJdICogMTAwMCkgLyBlbmNQYXJhbXMtPkxheWVyRnJhbWVSYXRlW2N1cnJMYXllcl0pICsgdmlkZW8tPm1vZFRpbWVSZWYgKyAwLjUpOwotCi0gICAgLyovLyBFbmQgLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8gKi8KLQotICAgIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLSAgICAvKiBVcGRhdGUgT3VwdXQgYnN0cmVhbSBieXRlIGNvdW50ICovCi0gICAgLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotCi0gICAgKnNpemUgPSBjdXJyVm9sLT5zdHJlYW0tPmJ5dGVDb3VudDsKLQotICAgIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotICAgIC8qIFN3YXAgVm9wIFBvaW50ZXJzIGZvciBCYXNlIExheWVyICAgICAqLwotICAgIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotICAgIGlmIChjdXJyTGF5ZXIgPT0gMCkKLSAgICB7Ci0gICAgICAgIHRlbXAgPSB2aWRlby0+cHJldkJhc2VWb3A7Ci0gICAgICAgIHZpZGVvLT5wcmV2QmFzZVZvcCA9IHZpZGVvLT5jdXJyVm9wOwotICAgICAgICB2aWRlby0+cHJldkJhc2VWb3AtPnBhZGRlZCA9IDA7IC8qIG5vdCBwYWRkZWQgKi8KLSAgICAgICAgdmlkZW8tPmN1cnJWb3AgID0gdGVtcDsKLSAgICAgICAgdmlkZW8tPmZvcndhcmRSZWZWb3AgPSB2aWRlby0+cHJldkJhc2VWb3A7IC8qIEZvciBQLVZvcCBiYXNlIG9ubHkgKi8KLSAgICAgICAgdmlkZW8tPmZvcndhcmRSZWZWb3AtPnJlZlNlbGVjdENvZGUgPSAxOwotICAgIH0KLSAgICBlbHNlCi0gICAgewotICAgICAgICB0ZW1wID0gdmlkZW8tPnByZXZFbmhhbmNlVm9wOwotICAgICAgICB2aWRlby0+cHJldkVuaGFuY2VWb3AgPSB2aWRlby0+Y3VyclZvcDsKLSAgICAgICAgdmlkZW8tPnByZXZFbmhhbmNlVm9wLT5wYWRkZWQgPSAwOyAvKiBub3QgcGFkZGVkICovCi0gICAgICAgIHZpZGVvLT5jdXJyVm9wID0gdGVtcDsKLSAgICAgICAgdmlkZW8tPmZvcndhcmRSZWZWb3AgPSB2aWRlby0+cHJldkVuaGFuY2VWb3A7Ci0gICAgICAgIHZpZGVvLT5mb3J3YXJkUmVmVm9wLT5yZWZTZWxlY3RDb2RlID0gMDsKLSAgICB9Ci0KLSAgICAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLSAgICAvKiBNb2RpZnkgdGhlIGludGlhbGl6ZSBmbGFnIGF0IHRoZSBlbmQuKi8KLSAgICAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLSAgICBpZiAodmlkZW8tPnZvbEluaXRpYWxpemVbY3VyckxheWVyXSkKLSAgICAgICAgdmlkZW8tPnZvbEluaXRpYWxpemVbY3VyckxheWVyXSA9IDA7Ci0KLSAgICByZXR1cm4gc3RhdHVzOwotfQotCi0jaWZuZGVmIE5PX1NMSUNFX0VOQ09ERQotLyogPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09ICovCi0vKiAgRnVuY3Rpb24gOiBQVkVuY29kZUZyYW1lU2V0KCkgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICBEYXRlICAgICA6IDA0LzE4LzIwMDAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogIFB1cnBvc2UgIDogRW50ZXIgYSB2aWRlbyBmcmFtZSBhbmQgcGVyZm9ybSBmcm9udC1lbmQgdGltZSBjaGVjayBwbHVzIE1FICovCi0vKiAgSW4vb3V0ICAgOiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICBSZXR1cm4gICA6IFBWX1RSVUUgaWYgc3VjY2Vzc2VkLCBQVl9GQUxTRSBpZiBmYWlsZWQuICAgICAgICAgICAgICAgICAgICAqLwotLyogIE1vZGlmaWVkIDogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PSAqLwotT1NDTF9FWFBPUlRfUkVGIEJvb2wgUFZFbmNvZGVGcmFtZVNldChWaWRlb0VuY0NvbnRyb2xzICplbmNDdHJsLCBWaWRlb0VuY0ZyYW1lSU8gKnZpZF9pbiwgVUxvbmcgKm5leHRNb2RUaW1lLCBJbnQgKm5MYXllcikKLXsKLSAgICBCb29sIHN0YXR1cyA9IFBWX1RSVUU7Ci0gICAgVmlkZW9FbmNEYXRhICp2aWRlbyA9IChWaWRlb0VuY0RhdGEgKillbmNDdHJsLT52aWRlb0VuY29kZXJEYXRhOwotICAgIFZpZGVvRW5jUGFyYW1zICplbmNQYXJhbXMgPSB2aWRlby0+ZW5jUGFyYW1zOwotICAgIFZvbCAqY3VyclZvbDsKLSAgICBQVl9TVEFUVVMgICBFbmNvZGVWT1NfU3RhcnQoVmlkZW9FbmNDb250cm9scyAqZW5jQ3RybCk7Ci0gICAgSW50IHdpZHRoXzE2LCBoZWlnaHRfMTY7Ci0gICAgSW50IHdpZHRoLCBoZWlnaHQ7Ci0gICAgSW50IGVuY29kZVZvcCA9ID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RlbywgbkxheWVyLCBtb2RUaW1lKTsKLQotICAgIGN1cnJMYXllciA9ICpuTGF5ZXI7Ci0KLSAgICAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotICAgIC8qIElmIHBvc3Qtc2tpcHBpbmcgc3RpbGwgZWZmZWN0aXZlIC0tLSByZXR1cm4gKi8KLSAgICAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotCi0gICAgaWYgKCFlbmNvZGVWb3ApIC8qIHNraXAgZW5oIGxheWVyLCBubyBiYXNlIGxheWVyIGNvZGVkIC0tLSByZXR1cm4gKi8KLSAgICB7Ci0jaWZkZWYgX1BSSU5UX1NUQVQKLSAgICAgICAgcHJpbnRmKCJObyBmcmFtZSBjb2RlZC4gQ29udGludWUgdG8gbmV4dCBmcmFtZS4iKTsKLSNlbmRpZgotICAgICAgICAqbkxheWVyID0gLTE7Ci0KLSAgICAgICAgLyogZXhwZWN0ZWQgbmV4dCBjb2RlIHRpbWUsIGNvbnZlcnQgYmFjayB0byBtaWxsaXNlYyAqLwotICAgICAgICAqbmV4dE1vZFRpbWUgPSB2aWRlby0+bmV4dE1vZFRpbWU7OwotICAgICAgICByZXR1cm4gc3RhdHVzOwotICAgIH0KLQotICAgIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLSAgICAvKiBJbml0aWFsaXplIFZvbCBzdHJlYW0gc3RydWN0dXJlIHdpdGggYXBwbGljYXRpb24gYml0c3RyZWFtICovCi0gICAgLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotCi0gICAgY3VyclZvbCA9IHZpZGVvLT52b2xbY3VyckxheWVyXTsKLSAgICBjdXJyVm9sLT5zdHJlYW0tPmJ1ZmZlclNpemUgPSAwOwotICAgIEJpdHN0cmVhbUVuY1Jlc2V0KGN1cnJWb2wtPnN0cmVhbSk7Ci0KLSAgICAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0gICAgLyogRW5jb2RlIFZPUyBhbmQgVk9MIEhlYWRlcnMgb24gZmlyc3QgY2FsbCBmb3IgZWFjaCBsYXllciAqLwotICAgIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLQotICAgIGlmICh2aWRlby0+dm9sSW5pdGlhbGl6ZVtjdXJyTGF5ZXJdKQotICAgIHsKLSAgICAgICAgdmlkZW8tPmN1cnJWb3AtPnRpbWVJbmMgPSAwOwotICAgICAgICB2aWRlby0+cHJldkJhc2VWb3AtPnRpbWVJbmMgPSAwOwotICAgIH0KLQotICAgIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0gICAgLyogQ29weSBJbnB1dCBWaWRlbyBGcmFtZSB0byBJbnRlcm5hbCBWaWRlbyBCdWZmZXIgKi8KLSAgICAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotICAgIC8qIERldGVybWluZSBXaWR0aCBhbmQgSGVpZ2h0IG9mIFZvcCBMYXllciAqLwotCi0gICAgd2lkdGggPSBlbmNQYXJhbXMtPkxheWVyV2lkdGhbY3VyckxheWVyXTsgICAvKiBHZXQgaW5wdXQgd2lkdGggKi8KLSAgICBoZWlnaHQgPSBlbmNQYXJhbXMtPkxheWVySGVpZ2h0W2N1cnJMYXllcl07IC8qIEdldCBpbnB1dCBoZWlnaHQgKi8KLSAgICAvKiBSb3VuZCBVcCB0byBuZWFyZXN0IG11bHRpcGxlIG9mIDE2IDogTVBFRy00IFN0YW5kYXJkICovCi0KLSAgICB3aWR0aF8xNiA9ICgod2lkdGggKyAxNSkgLyAxNikgKiAxNjsgICAgICAgICAgICAvKiBSb3VuZCB1cCB0byBuZWFyZXN0IG11bHRpcGxlIG9mIDE2ICovCi0gICAgaGVpZ2h0XzE2ID0gKChoZWlnaHQgKyAxNSkgLyAxNikgKiAxNjsgICAgICAgICAgLyogUm91bmQgdXAgdG8gbmVhcmVzdCBtdWx0aXBsZSBvZiAxNiAqLwotCi0gICAgdmlkZW8tPmlucHV0ID0gdmlkX2luOyAgLyogcG9pbnQgdG8gdGhlIGZyYW1lIGlucHV0ICovCi0KLSAgICAvKi8vICBFbmQgLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vICovCi0KLQotICAgIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLSAgICAvKiBEZXRlcm1pbmUgVk9QIFR5cGUgICAgICAgICAgICAgICAgICovCi0gICAgLyogNi8yLzIwMDEsIHNlcGFyYXRlIGZ1bmN0aW9uICAgICAgKi8KLSAgICAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0gICAgRGV0ZXJtaW5lVm9wVHlwZSh2aWRlbywgY3VyckxheWVyKTsKLQotICAgIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotICAgIC8qICAgIEluaXRpYWxpemUgVk9QICAgICAgICAqLwotICAgIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotICAgIHZpZGVvLT5jdXJyVm9wLT52b2xJRCA9IGN1cnJWb2wtPnZvbElEOwotICAgIHZpZGVvLT5jdXJyVm9wLT53aWR0aCA9IHdpZHRoXzE2OwotICAgIHZpZGVvLT5jdXJyVm9wLT5oZWlnaHQgPSBoZWlnaHRfMTY7Ci0gICAgaWYgKHZpZGVvLT5lbmNQYXJhbXMtPkgyNjNfRW5hYmxlZCkgLyogIDExLzI4LzA1ICovCi0gICAgewotICAgICAgICB2aWRlby0+Y3VyclZvcC0+cGl0Y2ggPSB3aWR0aF8xNjsKLSAgICB9Ci0gICAgZWxzZQotICAgIHsKLSAgICAgICAgdmlkZW8tPmN1cnJWb3AtPnBpdGNoID0gd2lkdGhfMTY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vKiAgRnVuY3Rpb24gOiBQVkVuY29kZVBhY2tldCgpICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICBEYXRlICAgICA6IDA0LzE4LzIwMDIgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogIFB1cnBvc2UgIDogRW5jb2RlIG9uZSBwYWNrZXQgYW5kIHJldHVybiBiaXRzdHJlYW0gICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgSW4vb3V0ICAgOiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICBSZXR1cm4gICA6IFBWX1RSVUUgaWYgc3VjY2Vzc2VkLCBQVl9GQUxTRSBpZiBmYWlsZWQuICAgICAgICAgICAgICAgICAgICAqLwotLyogIE1vZGlmaWVkIDogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PSAqLwotT1NDTF9FWFBPUlRfUkVGIEJvb2wgUFZFbmNvZGVTbGljZShWaWRlb0VuY0NvbnRyb2xzICplbmNDdHJsLCBVQ2hhciAqYnN0cmVhbSwgSW50ICpzaXplLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBJbnQgKmVuZG9mRnJhbWUsIFZpZGVvRW5jRnJhbWVJTyAqdmlkX291dCwgVUxvbmcgKm5leHRNb2RUaW1lKQotewotICAgIFBWX1NUQVRVUyBwdl9zdGF0dXM7Ci0gICAgVmlkZW9FbmNEYXRhICp2aWRlbyA9IChWaWRlb0VuY0RhdGEgKillbmNDdHJsLT52aWRlb0VuY29kZXJEYXRhOwotICAgIFZpZGVvRW5jUGFyYW1zICplbmNQYXJhbXMgPSB2aWRlby0+ZW5jUGFyYW1zOwotICAgIFZvbCAqY3VyclZvbDsKLSAgICBQVl9TVEFUVVMgICBFbmNvZGVWT1NfU3RhcnQoVmlkZW9FbmNDb250cm9scyAqZW5jQ3RybCk7Ci0gICAgVm9wICp0ZW1wOwotICAgIHZvaWQgIFBhZGRpbmdFZGdlKFZvcCAqcGFkVm9wKTsKLSAgICBJbnQgY3VyckxheWVyID0gdmlkZW8tPmN1cnJMYXllcjsKLSAgICBJbnQgcHJlX3NraXA7Ci0gICAgSW50IHByZV9zaXplOwotICAgIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLSAgICAvKiBJbml0aWFsaXplIFZvbCBzdHJlYW0gc3RydWN0dXJlIHdpdGggYXBwbGljYXRpb24gYml0c3RyZWFtICovCi0gICAgLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotCi0gICAgY3VyclZvbCA9IHZpZGVvLT52b2xbY3VyckxheWVyXTsKLSAgICBjdXJyVm9sLT5zdHJlYW0tPmJpdHN0cmVhbUJ1ZmZlciA9IGJzdHJlYW07Ci0gICAgcHJlX3NpemUgPSBjdXJyVm9sLT5zdHJlYW0tPmJ5dGVDb3VudDsKLSAgICBjdXJyVm9sLT5zdHJlYW0tPmJ1ZmZlclNpemUgPSBwcmVfc2l6ZSArICgqc2l6ZSk7Ci0KLSAgICAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0gICAgLyogRW5jb2RlIFZPUyBhbmQgVk9MIEhlYWRlcnMgb24gZmlyc3QgY2FsbCBmb3IgZWFjaCBsYXllciAqLwotICAgIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLQotICAgIGlmICh2aWRlby0+dm9sSW5pdGlhbGl6ZVtjdXJyTGF5ZXJdKQotICAgIHsKLSAgICAgICAgaWYgKCF2aWRlby0+ZW5jUGFyYW1zLT5HZXRWb2xIZWFkZXJbY3VyckxheWVyXSkKLSAgICAgICAgICAgIHB2X3N0YXR1cyA9IEVuY29kZVZPU19TdGFydChlbmNDdHJsKTsKLSAgICB9Ci0KLSAgICAvKioqKioqKioqKioqKioqKi8KLSAgICAvKiBFbmNvZGUgU2xpY2UgKi8KLSAgICAvKioqKioqKioqKioqKioqKi8KLSAgICBwdl9zdGF0dXMgPSBFbmNvZGVTbGljZSh2aWRlbyk7Ci0KLSAgICAqZW5kb2ZGcmFtZSA9IDA7Ci0KLSAgICBpZiAodmlkZW8tPm1ibnVtID49IGN1cnJWb2wtPm5Ub3RhbE1CICYmICF2aWRlby0+ZW5kX29mX2J1ZikKLSAgICB7Ci0gICAgICAgICplbmRvZkZyYW1lID0gMTsKLQotICAgICAgICAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotICAgICAgICAvKiBVcGRhdGUgU2tpcCBOZXh0IEZyYW1lICAgICAgICAgICAqLwotICAgICAgICAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotICAgICAgICBwcmVfc2tpcCA9IFVwZGF0ZVNraXBOZXh0RnJhbWUodmlkZW8sIG5leHRNb2RUaW1lLCBzaXplLCBwdl9zdGF0dXMpOyAvKiBtb2RpZmllZCBzdWNoIHRoYXQgbm8gcHJlLXNraXBwZWQgKi8KLQotICAgICAgICBpZiAocHJlX3NraXAgPT0gLTEpIC8qIGVycm9yICovCi0gICAgICAgIHsKLSAgICAgICAgICAgICplbmRvZkZyYW1lID0gLTE7Ci0gICAgICAgICAgICAvKiBtYWtlIHN1cmUgdGhhdCBwb2ludGVycyBhcmUgcmVzdG9yZWQgdG8gdGhlIHByZXZpb3VzIHN0YXRlICovCi0gICAgICAgICAgICBpZiAoY3VyckxheWVyID09IDApCi0gICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgdmlkZW8tPmZvcndhcmRSZWZWb3AgPSB2aWRlby0+dGVtcEZvcndSZWZWb3A7IC8qIEZvciBQLVZvcCBiYXNlIG9ubHkgKi8KLSAgICAgICAgICAgICAgICB2aWRlby0+Zm9yd2FyZFJlZlZvcC0+cmVmU2VsZWN0Q29kZSA9IHZpZGVvLT50ZW1wUmVmU2VsQ29kZTsKLSAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgcmV0dXJuIHB2X3N0YXR1czsKLSAgICAgICAgfQotCi0gICAgICAgIC8qIElmIEktVk9QIHdhcyBlbmNvZGVkLCByZXNldCBJbnRyYVBlcmlvZCAqLwotICAgICAgICBpZiAoKGN1cnJMYXllciA9PSAwKSAmJiAoZW5jUGFyYW1zLT5JbnRyYVBlcmlvZCA+IDApICYmICh2aWRlby0+Y3VyclZvcC0+cHJlZGljdGlvblR5cGUgPT0gSV9WT1ApKQotICAgICAgICAgICAgdmlkZW8tPm5leHRFbmNJVm9wID0gZW5jUGFyYW1zLT5JbnRyYVBlcmlvZDsKLQotICAgICAgICAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLSAgICAgICAgLyogQ29weSBSZWNvbnN0cnVjdGVkIEJ1ZmZlciB0byBPdXRwdXQgVmlkZW8gRnJhbWUgQnVmZmVyICovCi0gICAgICAgIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotICAgICAgICB2aWRfb3V0LT55Q2hhbiA9IHZpZGVvLT5jdXJyVm9wLT55Q2hhbjsKLSAgICAgICAgdmlkX291dC0+dUNoYW4gPSB2aWRlby0+Y3VyclZvcC0+dUNoYW47Ci0gICAgICAgIHZpZF9vdXQtPnZDaGFuID0gdmlkZW8tPmN1cnJWb3AtPnZDaGFuOwotICAgICAgICBpZiAodmlkZW8tPmVuY1BhcmFtcy0+SDI2M19FbmFibGVkKQotICAgICAgICB7Ci0gICAgICAgICAgICB2aWRfb3V0LT5oZWlnaHQgPSB2aWRlby0+Y3VyclZvcC0+aGVpZ2h0OyAvKiBwYWRkZWQgaGVpZ2h0ICovCi0gICAgICAgICAgICB2aWRfb3V0LT5waXRjaCA9IHZpZGVvLT5jdXJyVm9wLT53aWR0aDsgLyogcGFkZGVkIHdpZHRoICovCi0gICAgICAgIH0KLSAgICAgICAgZWxzZQotICAgICAgICB7Ci0gICAgICAgICAgICB2aWRfb3V0LT5oZWlnaHQgPSB2aWRlby0+Y3VyclZvcC0+aGVpZ2h0ICsgMzI7IC8qIHBhZGRlZCBoZWlnaHQgKi8KLSAgICAgICAgICAgIHZpZF9vdXQtPnBpdGNoID0gdmlkZW8tPmN1cnJWb3AtPndpZHRoICsgMzI7IC8qIHBhZGRlZCB3aWR0aCAqLwotICAgICAgICB9Ci0gICAgICAgIC8vdmlkX291dC0+dGltZXN0YW1wID0gdmlkZW8tPm1vZFRpbWU7Ci0gICAgICAgIHZpZF9vdXQtPnRpbWVzdGFtcCA9IChVTG9uZykoKCh2aWRlby0+cHJldkZyYW1lTnVtW2N1cnJMYXllcl0gKiAxMDAwKSAvIGVuY1BhcmFtcy0+TGF5ZXJGcmFtZVJhdGVbY3VyckxheWVyXSkgKyB2aWRlby0+bW9kVGltZVJlZiArIDAuNSk7Ci0KLSAgICAgICAgLyovLyBFbmQgLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8gKi8KLQotICAgICAgICAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLSAgICAgICAgLyogU3dhcCBWb3AgUG9pbnRlcnMgZm9yIEJhc2UgTGF5ZXIgICAgICovCi0gICAgICAgIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotCi0gICAgICAgIGlmIChjdXJyTGF5ZXIgPT0gMCkKLSAgICAgICAgewotICAgICAgICAgICAgdGVt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AtIHByZV9zaXplOwotCi0gICAgLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0gICAgLyogTW9kaWZ5IHRoZSBpbnRpYWxpemUgZmxhZyBhdCB0aGUgZW5kLiovCi0gICAgLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0gICAgaWYgKHZpZGVvLT52b2xJbml0aWFsaXplW2N1cnJMYXllcl0pCi0gICAgICAgIHZpZGVvLT52b2xJbml0aWFsaXplW2N1cnJMYXllcl0gPSAwOwotCi0gICAgcmV0dXJuIHB2X3N0YXR1czsKLX0KLSNlbmRpZiAvKiBOT19TTElDRV9FTkNPREUgKi8KLQotCi0vKiA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0gKi8KLS8qICBGdW5jdGlvbiA6IFBWR2V0SDI2M1Byb2ZpbGVMZXZlbElEKCkgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogIERhdGUgICAgIDogMDIvMDUvMjAwMyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgUHVycG9zZSAgOiBHZXQgSC4yNjMgUHJvZmlsZSBJRCBhbmQgbGV2ZWwgSUQgZm9yIHByb2ZpbGUgMCAgICAgICAgICAgICAgKi8KLS8qICBJbi9vdXQgICA6IFByb2ZpbGUgSUQ9MCwgbGV2ZWxJRCBpcyB3aGF0IHdlIHdhbnQgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogIFJldHVybiAgIDogUFZfVFJVRSBpZiBzdWNjZXNzZWQsIFBWX0ZBTFNFIGlmIGZhaWxlZC4gICAgICAgICAgICAgICAgICAgICovCi0vKiAgTW9kaWZpZWQgOiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICBOb3RlICAgICA6IGgyNjNMZXZlbFs4XSwgckJSX2JvdW5kWzhdLCBtYXhfaDI2M19mcmFtZXJhdGVbMl0gICAgICAgICAgICAqLwotLyogICAgICAgICAgICAgbWF4X2gyNjNfd2lkdGhbMl0sIG1heF9oMjYzX2hlaWdodFsyXSBhcmUgZ2xvYmFsICAgICAgICAgICAgICovCi0vKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PSAqLwotT1NDTF9FWFBPUlRfUkVGIEJvb2wgUFZHZXRIMjYzUHJvZmlsZUxldmVsSUQoVmlkZW9FbmNDb250cm9scyAqZW5jQ3RybCwgSW50ICpwcm9maWxlSUQsIEludCAqbGV2ZWxJRCkKLXsKLSAgICBWaWRlb0VuY0RhdGEgKmVuY0RhdGE7Ci0gICAgSW50IHdpZHRoLCBoZWlnaHQ7Ci0gICAgZmxvYXQgYml0cmF0ZV9yLCBmcmFtZXJhdGU7Ci0KLQotICAgIC8qIEZvciB0aGlzIHZlcnNpb24sIHdlIG9ubHkgc3VwcG9ydCBILjI2MyBwcm9maWxlIDAgKi8KLSAgICAqcHJvZmlsZUlEID0gMDsKLQotICAgICpsZXZlbElEID0gMDsKLSAgICBlbmNEYXRhID0gKFZpZGVvRW5jRGF0YSAqKWVuY0N0cmwtPnZpZGVvRW5jb2RlckRhdGE7Ci0KLSAgICBpZiAoZW5jRGF0YSA9PSBOVUxMKQotICAgICAgICByZXR1cm4gUFZfRkFMU0U7Ci0gICAgaWYgKGVuY0RhdGEtPmVuY1BhcmFtcyA9PSBOVUxMKQotICAgICAgICByZXR1cm4gUFZfRkFMU0U7Ci0KLSAgICBpZiAoIWVuY0RhdGEtPmVuY1BhcmFtcy0+SDI2M19FbmFibGVkKSByZXR1cm4gUFZfRkFMU0U7Ci0KLQotICAgIC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PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09ICovCi0vKiAgRnVuY3Rpb24gOiBQVkdldE1QRUc0UHJvZmlsZUxldmVsSUQoKSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICBEYXRlICAgICA6IDI2LzA2LzIwMDggICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogIFB1cnBvc2UgIDogR2V0IE1QRUc0IExldmVsIGFmdGVyIGluaXRpYWxpemVkICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgSW4vb3V0ICAgOiBwcm9maWxlX2xldmVsIGFjY29yZGluZyB0byBpbnRlcmZhY2UgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICBSZXR1cm4gICA6IFBWX1RSVUUgaWYgc3VjY2Vzc2VkLCBQVl9GQUxTRSBpZiBmYWlsZWQuICAgICAgICAgICAgICAgICAgICAqLwotLyogIE1vZGlmaWVkIDogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PSAqLwotT1NDTF9FWFBPUlRfUkVGIEJvb2wgUFZHZXRNUEVHNFByb2ZpbGVMZXZlbElEKFZpZGVvRW5jQ29udHJvbHMgKmVuY0N0cmwsIEludCAqcHJvZmlsZV9sZXZlbCwgSW50IG5MYXllcikKLXsKLSAgICBWaWRlb0VuY0RhdGEqIHZpZGVvOwotICAgIEludCBpOwotCi0gICAgdmlkZW8gPSAoVmlkZW9FbmNEYXRhICopZW5jQ3RybC0+dmlkZW9FbmNvZGVyRGF0YTsKLQotICAgIGlmIChuTGF5ZXIgPT0gMCkKLSAgICB7Ci0gICAgICAgIGZvciAoaSA9IDA7IGkgPCA4OyBpKyspCi0gICAgICAgIHsKLSAgICAgICAgICAgIGlmICh2aWRlby0+ZW5jUGFyYW1zLT5Qcm9maWxlTGV2ZWxbMF0gPT0gcHJvZmlsZV9sZXZlbF9jb2RlW2ldKQotICAgICAgICAgICAgewotICAgICAgICAgICAgICAgIGJyZWFrOwotICAgICAgICAgICAgfQotICAgICAgICB9Ci0gICAgICAgICpwcm9maWxlX2xldmVsID0gaTsKLSAgICB9Ci0gICAgZWxzZQotICAgIHsKLSAgICAgICAgZm9yIChpID0gMDsgaSA8IDg7IGkrKykKLSAgICAgICAgewotICAgICAgICAgICAgaWYgKHZpZGVvLT5lbmNQYXJhbXMtPlByb2ZpbGVMZXZlbFswXSA9PSBzY2FsYWJsZV9wcm9maWxlX2xldmVsX2NvZGVbaV0pCi0gICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgYnJlYWs7Ci0gICAgICAgICAgICB9Ci0gICAgICAgIH0KLSAgICAgICAgKnByb2ZpbGVfbGV2ZWwgPSBpICsgU0lNUExFX1NDQUxBQkxFX1BST0ZJTEVfTEVWRUwwOwotICAgIH0KLQotICAgIHJldHVybiB0cnVlOwotfQotCi0jaWZuZGVmIExJTUlURURfQVBJCi0vKiA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0gKi8KLS8qICBGdW5jdGlvbiA6IFBWVXBkYXRlRW5jRnJhbWVSYXRlICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogIERhdGUgICAgIDogMDQvMDgvMjAwMiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgUHVycG9zZSAgOiBVcGRhdGUgdGFyZ2V0IGZyYW1lIHJhdGVzIG9mIHRoZSBlbmNvZGVkIGJhc2UgYW5kIGVuaGFuY2UgICAgKi8KLS8qICAgICAgICAgICAgIGxheWVyKGlmIGFueSkgd2hpbGUgZW5jb2Rpbmcgb3BlcmF0aW9uIGlzIG9uZ29pbmcgICAgICAgICAgICAqLwotLyogIEluL291dCAgIDogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgUmV0dXJuICAgOiBQVl9UUlVFIGlmIHN1Y2Nlc3NlZCwgUFZfRkFMU0UgaWYgZmFpbGVkLiAgICAgICAgICAgICAgICAgICAgKi8KLS8qICBNb2RpZmllZCA6ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0gKi8KLQotT1NDTF9FWFBPUlRfUkVGIEJvb2wgUFZVcGRhdGVFbmNGcmFtZVJhdGUoVmlkZW9FbmNDb250cm9scyAqZW5jQ3RybCwgZmxvYXQgKmZyYW1lUmF0ZSkKLXsKLSAgICBWaWRlb0VuY0RhdGEgICAgKmVuY0RhdGE7Ci0gICAgSW50IGk7Ly8gblRvdGFsTUIsIG1iUGVyU2VjOwotCi0gICAgZW5jRGF0YSA9IChWaWRlb0VuY0RhdGEgKillbmNDdHJsLT52aWRlb0VuY29kZXJEYXRhOwotCi0gICAgaWYgKGVuY0RhdGEgPT0gTlVMTCkKLSAgICAgICAgcmV0dXJuIFBWX0ZBTFNFOwotICAgIGlmIChlbmNEYXRhLT5lbmNQYXJhbXMgPT0gTlVMTCkKLSAgICAgICAgcmV0dXJuIFBWX0ZBTFNFOwotCi0gICAgLyogVXBkYXRlIHRoZSBmcmFtZXJhdGVzIGZvci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ogUFZVcGRhdGVCaXRSYXRlICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgRGF0ZSAgICAgOiAwNC8wOC8yMDAyICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICBQdXJwb3NlICA6IFVwZGF0ZSB0YXJnZXQgYml0IHJhdGVzIG9mIHRoZSBlbmNvZGVkIGJhc2UgYW5kIGVuaGFuY2UgICAgICAqLwotLyogICAgICAgICAgICAgbGF5ZXIoaWYgYW55KSB3aGlsZSBlbmNvZGluZyBvcGVyYXRpb24gaXMgb25nb2luZyAgICAgICAgICAgICovCi0vKiAgSW4vb3V0ICAgOiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICBSZXR1cm4gICA6IFBWX1RSVUUgaWYgc3VjY2Vzc2VkLCBQVl9GQUxTRSBpZiBmYWlsZWQuICAgICAgICAgICAgICAgICAgICAqLwotLyogIE1vZGlmaWVkIDogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PSAqLwotCi1PU0NMX0VYUE9SVF9SRUYgQm9vbCBQVlVwZGF0ZUJpdFJhdGUoVmlkZW9FbmNDb250cm9scyAqZW5jQ3RybCwgSW50ICpiaXRSYXRlKQotewotICAgIFZpZGVvRW5jRGF0YSAgICAqZW5jRGF0YTsKLSAgICBJbnQgaTsKLQotICAgIGVuY0RhdGEgPSAoVmlkZW9FbmNEYXRhICopZW5jQ3RybC0+dmlkZW9FbmNvZGVyRGF0YTsKLQotICAgIGlmIChlbmNEYXRhID09IE5VTEwpCi0gICAgICAgIHJldHVybiBQVl9GQUxTRTsKLSAgICBpZiAoZW5jRGF0YS0+ZW5jUGFyYW1zID09IE5VTEwpCi0gICAgICAgIHJldHVybiBQVl9GQUxTRTsKLQotICAgIC8qIFVwZGF0ZSB0aGUgYml0cmF0ZXMgZm9yIGFsbCB0aGUgbGF5ZXJzICovCi0gICAgZm9yIChpID0gMDsgaSA8IGVuY0RhdGEtPmVuY1BhcmFtcy0+bkxheWVyczsgaSsrKQotICAgIHsKLSAgICAgICAgaWYgKGJpdFJhdGVbaV0gPiBlbmNEYXRhLT5lbmNQYXJhbXMtPkxheWVyTWF4Qml0UmF0ZVtpXSkgLyogc2V0IGJ5IHVzZXJzIG9yIHByb2ZpbGUgKi8KLSAgICAgICAgewotICAgICAgICAgICAgcmV0dXJuIFBWX0ZBTFNFOwotICAgICAgICB9Ci0gICAgICAgIGVuY0RhdGEtPmVuY1BhcmFtcy0+TGF5ZXJCaXRSYXRlW2ldID0gYml0UmF0ZVtpXTsKLSAgICB9Ci0KLSAgICByZXR1cm4gUkNfVXBkYXRlQlhSQ1BhcmFtcygodm9pZCopIGVuY0RhdGEpOwotCi19Ci0jZW5kaWYKLSNpZm5kZWYgTElNSVRFRF9BUEkKLS8qID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0gKi8KLS8qICBGdW5jdGlvbiA6IFBWVXBkYXRlVkJWRGVsYXkoKSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgRGF0ZSAgICAgOiA0LzIzLzIwMDQgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgUHVycG9zZSAgOiBVcGRhdGUgVkJWIGJ1ZmZlciBzaXplKGluIGRlbGF5KSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgSW4vb3V0ICAgOiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgUmV0dXJuICAgOiBQVl9UUlVFIGlmIHN1Y2Nlc3NlZCwgUFZfRkFMU0UgaWYgZmFpbGVkLiAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgTW9kaWZpZWQgOiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09ICovCi0KLUJvb2wgUFZVcGRhdGVWQlZEZWxheShWaWRlb0VuY0NvbnRyb2xzICplbmNDdHJsLCBmbG9hdCBkZWxheSkKLXsKLQotICAgIFZpZGVvRW5jRGF0YSAgICAqZW5jRGF0YTsKLSAgICBJbnQgdG90YWxfYml0cmF0ZSwgbWF4X2J1ZmZlcl9zaXplOwotICAgIGludCBpbmRleDsKLQotICAgIGVuY0RhdGEgPSAoVmlkZW9FbmNEYXRhICopZW5jQ3RybC0+dmlkZW9FbmNvZGVyRGF0YTsKLQotICAgIGlmIChlbmNEYXRhID09IE5VTEwpCi0gICAgICAgIHJldHVybiBQVl9GQUxTRTsKLSAgICBpZiAoZW5jRGF0YS0+ZW5jUGFyYW1zID09IE5VTEwpCi0gICAgICAgIHJldHVybiBQVl9GQUxTRTsKLQotICAgIC8qIENoZWNrIHdoZXRoZXIgdGhlIGlucHV0IGRlbGF5IGlzIHZhbGlkIGJhc2VkIG9uIHRoZSBnaXZlbiBwcm9maWxlICovCi0gICAgdG90YWxfYml0cmF0ZSAgID0gKGVuY0RhdGEtPmVuY1BhcmFtcy0+bkxheWVycyA9PSAxID8gZW5jRGF0YS0+ZW5jUGFyYW1zLT5MYXllckJpdFJhdGVbMF0gOgotICAgICAgICAgICAgICAgICAgICAgICBlbmNEYXRhLT5lbmNQYXJhbXMtPkxheWVyQml0UmF0ZVsxXSk7Ci0gICAgaW5kZXggPSBlbmNEYXRhLT5lbmNQYXJhbXMtPnByb2ZpbGVfdGFibGVfaW5kZXg7Ci0gICAgbWF4X2J1ZmZlcl9zaXplID0gKGVuY0RhdGEtPmVuY1BhcmFtcy0+bkxheWVycyA9PSAxID8gcHJvZmlsZV9sZXZlbF9tYXhfVkJWX3NpemVbaW5kZXhdIDoKLSAgICAgICAgICAgICAgICAgICAgICAgc2NhbGFibGVfcHJvZmlsZV9sZXZlbF9tYXhfVkJWX3NpemVbaW5kZXhdKTsKLQotICAgIGlmICh0b3RhbF9iaXRyYXRlKmRlbGF5ID4gKGZsb2F0KW1heF9idWZmZXJfc2l6ZSkKLSAgICAgICAgcmV0dXJuIFBWX0ZBTFNFOwotCi0gICAgZW5jRGF0YS0+ZW5jUGFyYW1zLT5WQlZfZGVsYXkgPSBkZWxheTsKLSAgICByZXR1cm4gUFZfVFJVRTsKLQotfQotI2VuZGlmCi0jaWZuZGVmIExJTUlURURfQVBJCi0vKiA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0gKi8KLS8qICBGdW5jdGlvbiA6IFBWVXBkYXRlSUZyYW1lSW50ZXJ2YWwoKSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICBEYXRlICAgICA6IDA0LzEwLzIwMDIgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogIFB1cnBvc2UgIDogdXBkYXRlcyB0aGUgSU5UUkEgZnJhbWUgcmVmcmVzaCBpbnRlcnZhbCB3aGlsZSBlbmNvZGluZyAgICAgICovCi0vKiAgICAgICAgICAgICBpcyBvbmdvaW5nICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICBJbi9vdXQgICA6ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogIFJldHVybiAgIDogUFZfVFJVRSBpZiBzdWNjZXNzZWQsIFBWX0ZBTFNFIGlmIGZhaWxlZC4gICAgICAgICAgICAgICAgICAgICovCi0vKiAgTW9kaWZpZWQgOiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09ICovCi0KLU9TQ0xfRVhQT1JUX1JFRiBCb29sIFBWVXBkYXRlSUZyYW1lSW50ZXJ2YWwoVmlkZW9FbmNDb250cm9scyAqZW5jQ3RybCwgSW50IGFJRnJhbWVQZXJpb2QpCi17Ci0gICAgVmlkZW9FbmNEYXRhICAgICplbmNEYXRhOwotCi0gICAgZW5jRGF0YSA9IChWaWRlb0VuY0RhdGEgKillbmNDdHJsLT52aWRlb0VuY29kZXJEYXRhOwotCi0gICAgaWYgKGVuY0RhdGEgPT0gTlVMTCkKLSAgICAgICAgcmV0dXJuIFBWX0ZBTFNFOwotICAgIGlmIChlbmNEYXRhLT5lbmNQYXJhbXMgPT0gTlVMTCkKLSAgICAgICAgcmV0dXJuIFBWX0ZBTFNFOwotCi0gICAgZW5jRGF0YS0+ZW5jUGFyYW1zLT5JbnRyYVBlcmlvZCA9IGFJRnJhbWVQZXJpb2Q7Ci0gICAgcmV0dXJuIFBWX1RSVUU7Ci19Ci0jZW5kaWYKLSNpZm5kZWYgTElNSVRFRF9BUEkKLS8qID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PSAqLwotLyogIEZ1bmN0aW9uIDogUFZTZXROdW1JbnRyYU1CUmVmcmVzaCgpICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgRGF0ZSAgICAgOiAwOC8wNS8yMDAzICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICBQdXJwb3NlICA6ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogIEluL291dCAgIDogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgUmV0dXJuICAgOiBQVl9UUlVFIGlmIHN1Y2Nlc3NlZCwgUFZfRkFMU0UgaWYgZmFpbGVkLiAgICAgICAgICAgICAgICAgICAgKi8KLS8qICBNb2RpZmllZCA6ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0gKi8KLU9TQ0xfRVhQT1JUX1JFRiBCb29sICAgIFBWVXBkYXRlTnVtSW50cmFNQlJlZnJlc2goVmlkZW9FbmNDb250cm9scyAqZW5jQ3RybCwgSW50IG51bU1CKQotewotICAgIFZpZGVvRW5jRGF0YSAgICAqZW5jRGF0YTsKLQotICAgIGVuY0RhdGEgPSAoVmlkZW9FbmNEYXRhICopZW5jQ3RybC0+dmlkZW9FbmNvZGVyRGF0YTsKLQotICAgIGlmIChlbmNEYXRhID09IE5VTEwpCi0gICAgICAgIHJldHVybiBQVl9GQUxTRTsKLQotICAgIGVuY0RhdGEtPmVuY1BhcmFtcy0+UmVmcmVzaCA9IG51bU1COwotCi0gICAgcmV0dXJuIFBWX1RSVUU7Ci19Ci0jZW5kaWYKLSNpZm5kZWYgTElNSVRFRF9BUEkKLS8qID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PSAqLwotLyogIEZ1bmN0aW9uIDogUFZJRnJhbWVSZXF1ZXN0KCkgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgRGF0ZSAgICAgOiAwNC8xMC8yMDAyICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICBQdXJwb3NlICA6IGVuY29kZXMgdGhlIG5leHQgYmFzZSBmcmFtZSBhcyBhbiBJLVZvcCAgICAgICAgICAgICAgICAgICAgICAqLwotLyogIEluL291dCAgIDogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgUmV0dXJuICAgOiBQVl9UUlVFIGlmIHN1Y2Nlc3NlZCwgUFZfRkFMU0UgaWYgZmFpbGVkLiAgICAgICAgICAgICAgICAgICAgKi8KLS8qICBNb2RpZmllZCA6ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0gKi8KLQotT1NDTF9FWFBPUlRfUkVGIEJvb2wgUFZJRnJhbWVSZXF1ZXN0KFZpZGVvRW5jQ29udHJvbHMgKmVuY0N0cmwpCi17Ci0gICAgVmlkZW9FbmNEYXRhICAgICplbmNEYXRhOwotCi0gICAgZW5jRGF0YSA9IChWaWRlb0VuY0RhdGEgKillbmNDdHJsLT52aWRlb0VuY29kZXJEYXRhOwotCi0gICAgaWYgKGVuY0RhdGEgPT0gTlVMTCkKLSAgICAgICAgcmV0dXJuIFBWX0ZBTFNFOwotICAgIGlmIChlbmNEYXRhLT5lbmNQYXJhbXMgPT0gTlVMTCkKLSAgICAgICAgcmV0dXJuIFBWX0ZBTFNFOwotCi0gICAgZW5jRGF0YS0+bmV4dEVuY0lWb3AgPSAxOwotICAgIHJldHVybiBQVl9UUlVFOwotfQotI2VuZGlmCi0jaWZuZGVmIExJTUlURURfQVBJCi0vKiA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0gKi8KLS8qICBGdW5jdGlvbiA6IFBWR2V0RW5jTWVtb3J5VXNhZ2UoKSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogIERhdGUgICAgIDogMTAvMTcvMjAwMCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgUHVycG9zZSAgOiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICBJbi9vdXQgICA6ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogIFJldHVybiAgIDogUFZfVFJVRSBpZiBzdWNjZXNzZWQsIFBWX0ZBTFNFIGlmIGZhaWxlZC4gICAgICAgICAgICAgICAgICAgICovCi0vKiAgTW9kaWZpZWQgOiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09ICovCi0KLU9TQ0xfRVhQT1JUX1JFRiBJbnQgUFZHZXRFbmNNZW1vcnlVc2FnZShWaWRlb0VuY0NvbnRyb2xzICplbmNDdHJsKQotewotICAgIFZpZGVvRW5jRGF0YSAgICAqZW5jRGF0YTsKLQotICAgIGVuY0RhdGEgPSAoVmlkZW9FbmNEYXRhICopZW5jQ3RybC0+dmlkZW9FbmNvZGVyRGF0YTsKLQotICAgIGlmIChlbmNEYXRhID09IE5VTEwpCi0gICAgICAgIHJldHVybiBQVl9GQUxTRTsKLSAgICBpZiAoZW5jRGF0YS0+ZW5jUGFyYW1zID09IE5VTEwpCi0gICAgICAgIHJldHVybiBQVl9GQUxTRTsKLSAgICByZXR1cm4gZW5jRGF0YS0+ZW5jUGFyYW1zLT5NZW1vcnlVc2FnZTsKLX0KLSNlbmRpZgotCi0vKiA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0gKi8KLS8qICBGdW5jdGlvbiA6IFBWR2V0SGludFRyYWNrKCkgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogIERhdGUgICAgIDogMS8xNy8yMDAxLCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgUHVycG9zZSAgOiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICBJbi9vdXQgICA6ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogIFJldHVybiAgIDogUFZfVFJVRSBpZiBzdWNjZXNzZWQsIFBWX0ZBTFNFIGlmIGZhaWxlZC4gICAgICAgICAgICAgICAgICAgICovCi0vKiAgTW9kaWZpZWQgOiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09ICovCi0KLU9TQ0xfRVhQT1JUX1JFRiBCb29sIFBWR2V0SGludFRyYWNrKFZpZGVvRW5jQ29udHJvbHMgKmVuY0N0cmwsIE1QNEhpbnRUcmFjayAqaW5mbykKLXsKLSAgICBWaWRlb0VuY0RhdGEgICAgKmVuY0RhdGE7Ci0KLSAgICBlbmNEYXRhID0gKFZpZGVvRW5jRGF0YSAqKWVuY0N0cmwtPnZpZGVvRW5jb2RlckRhdGE7Ci0KLSAgICBpZiAoZW5jRGF0YSA9PSBOVUxMKQotICAgICAgICByZXR1cm4gUFZfRkFMU0U7Ci0gICAgaWYgKGVuY0RhdGEtPmVuY1BhcmFtcyA9PSBOVUxMKQotICAgICAgICByZXR1cm4gUFZfRkFMU0U7Ci0gICAgaW5mby0+TVRCID0gZW5jRGF0YS0+aGludFRyYWNrSW5mby5NVEI7Ci0gICAgaW5mby0+TGF5ZXJJRCA9IGVuY0RhdGEtPmhpbnRUcmFja0luZm8uTGF5ZXJJRDsKLSAgICBpbmZvLT5Db2RlVHlwZSA9IGVuY0RhdGEtPmhpbnRUcmFja0luZm8uQ29kZVR5cGU7Ci0gICAgaW5mby0+UmVmU2VsQ29kZSA9IGVuY0RhdGEtPmhpbnRUcmFja0luZm8uUmVmU2VsQ29kZTsKLQotICAgIHJldHVybiBQVl9UUlVFOwotfQotCi0vKiA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0gKi8KLS8qICBGdW5jdGlvbiA6IFBWR2V0TWF4VmlkZW9GcmFtZVNpemUoKSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogIERhdGUgICAgIDogNy8xNy8yMDAxLCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgUHVycG9zZSAgOiBGdW5jdGlvbiBtZXJlbHkgcmV0dXJucyB0aGUgbWF4aW11bSBidWZmZXIgc2l6ZSAgICAgICAgICAgICAgKi8KLS8qICBJbi9vdXQgICA6ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogIFJldHVybiAgIDogUFZfVFJVRSBpZiBzdWNjZXNzZWQsIFBWX0ZBTFNFIGlmIGZhaWxlZC4gICAgICAgICAgICAgICAgICAgICovCi0vKiAgTW9kaWZpZWQgOiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09ICovCi0KLU9TQ0xfRVhQT1JUX1JFRiBCb29sIFBWR2V0TWF4VmlkZW9GcmFtZVNpemUoVmlkZW9FbmNDb250cm9scyAqZW5jQ3RybCwgSW50ICptYXhWaWRlb0ZyYW1lU2l6ZSkKLXsKLSAgICBWaWRlb0VuY0RhdGEgICAgKmVuY0RhdGE7Ci0KLSAgICBlbmNEYXRhID0gKFZpZGVvRW5jRGF0YSAqKWVuY0N0cmwtPnZpZGVvRW5jb2RlckRhdGE7Ci0KLSAgICBpZiAoZW5jRGF0YSA9PSBOVUxMKQotICAgICAgICByZXR1cm4gUFZfRkFMU0U7Ci0gICAgaWYgKGVuY0RhdGEtPmVuY1BhcmFtcyA9PSBOVUxMKQotICAgICAgICByZXR1cm4gUFZfRkFMU0U7Ci0KLQotCi0gICAgKm1heFZpZGVvRnJhbWVTaXplID0gZW5jRGF0YS0+ZW5jUGFyYW1zLT5CdWZmZXJTaXplWzBdOwotCi0gICAgaWYgKGVuY0RhdGEtPmVuY1BhcmFtcy0+bkxheWVycyA9PSAyKQotICAgICAgICBpZiAoKm1heFZpZGVvRnJhbWVTaXplIDwgZW5jRGF0YS0+ZW5jUGFyYW1zLT5CdWZmZXJTaXplWzFdKQotICAgICAgICAgICAgKm1heFZpZGVvRnJhbWVTaXplID0gZW5jRGF0YS0+ZW5jUGFyYW1zLT5CdWZmZXJTaXplWzFdOwotICAgICptYXhWaWRlb0ZyYW1lU2l6ZSA+Pj0gMzsgICAvKiBDb252ZXJ0IHRvIEJ5dGVzICovCi0KLSAgICBpZiAoKm1heFZpZGVvRnJhbWVTaXplIDw9IDQwMDApCi0gICAgICAgICptYXhWaWRlb0ZyYW1lU2l6ZSA9IDQwMDA7Ci0KLSAgICByZXR1cm4gUFZfVFJVRTsKLX0KLSNpZm5kZWYgTElNSVRFRF9BUEkKLS8qID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PSAqLwotLyogIEZ1bmN0aW9uIDogUFZHZXRWQlZTaXplKCkgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgRGF0ZSAgICAgOiA0LzE1LzIwMDIgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICBQdXJwb3NlICA6IEZ1bmN0aW9uIG1lcmVseSByZXR1cm5zIHRoZSBtYXhpbXVtIGJ1ZmZlciBzaXplICAgICAgICAgICAgICAqLwotLyogIEluL291dCAgIDogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgUmV0dXJuICAgOiBQVl9UUlVFIGlmIHN1Y2Nlc3NlZCwgUFZfRkFMU0UgaWYgZmFpbGVkLiAgICAgICAgICAgICAgICAgICAgKi8KLS8qICBNb2RpZmllZCA6ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0gKi8KLQotT1NDTF9FWFBPUlRfUkVGIEJvb2wgUFZHZXRWQlZTaXplKFZpZGVvRW5jQ29udHJvbHMgKmVuY0N0cmwsIEludCAqVkJWU2l6ZSkKLXsKLSAgICBWaWRlb0VuY0RhdGEgICAgKmVuY0RhdGE7Ci0KLSAgICBlbmNEYXRhID0gKFZpZGVvRW5jRGF0YSAqKWVuY0N0cmwtPnZpZGVvRW5jb2RlckRhdGE7Ci0KLSAgICBpZiAoZW5jRGF0YSA9PSBOVUxMKQotICAgICAgICByZXR1cm4gUFZfRkFMU0U7Ci0gICAgaWYgKGVuY0RhdGEtPmVuY1BhcmFtcyA9PSBOVUxMKQotICAgICAgICByZXR1cm4gUFZfRkFMU0U7Ci0KLSAgICAqVkJWU2l6ZSA9IGVuY0RhdGEtPmVuY1BhcmFtcy0+QnVmZmVyU2l6ZVswXTsKLSAgICBpZiAoZW5jRGF0YS0+ZW5jUGFyYW1zLT5uTGF5ZXJzID09IDIpCi0gICAgICAgICpWQlZTaXplICs9IGVuY0RhdGEtPmVuY1BhcmFtcy0+QnVmZmVyU2l6ZVsxXTsKLQotICAgIHJldHVybiBQVl9UUlVFOwotCi19Ci0jZW5kaWYKLS8qID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PSAqLwotLyogIEZ1bmN0aW9uIDogRW5jb2RlVk9TX1N0YXJ0KCkgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgRGF0ZSAgICAgOiAwOC8yMi8yMDAwICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICBQdXJwb3NlICA6IEVuY29kZXMgdGhlIFZPUyxWTywgYW5kIFZPTCBvciBTaG9ydCBIZWFkZXJzICAgICAgICAgICAgICAgICAqLwotLyogIEluL291dCAgIDogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgUmV0dXJuICAgOiBQVl9UUlVFIGlmIHN1Y2Nlc3NlZCwgUFZfRkFMU0UgaWYgZmFpbGVkLiAgICAgICAgICAgICAgICAgICAgKi8KLS8qICBNb2RpZmllZCA6ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0gKi8KLVBWX1NUQVRVUyBFbmNvZGVWT1NfU3RhcnQoVmlkZW9FbmNDb250cm9scyAqZW5jb2RlckNvbnRyb2wpCi17Ci0KLSAgICBWaWRlb0VuY0RhdGEgKnZpZGVvID0gKFZpZGVvRW5jRGF0YSAqKWVuY29kZXJDb250cm9sLT52aWRlb0VuY29kZXJEYXRhOwotICAgIFZvbCAgICAgICAgICpjdXJyVm9sID0gdmlkZW8tPnZvbFt2aWRlby0+Y3VyckxheWVyXTsKLSAgICBQVl9TVEFUVVMgc3RhdHVzID0gUFZfU1VDQ0VTUzsKLSAgICAvL2ludCBwcm9maWxlX2xldmVsPTB4MDE7Ci0gICAgQml0c3RyZWFtRW5jVmlkZW8gKnN0cmVhbSA9IHZpZGVvLT5iaXRzdHJlYW0xOwotICAgIGludCBpLCBqOwotCi0gICAgLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotICAgIC8qIENoZWNrIGZvciBzaG9ydF92aWRlb19oZWFkZXIgKi8KLSAgICAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0gICAgaWYgKGN1cnJWb2wtPnNob3J0VmlkZW9IZWFkZXIgPT0gMSkKLSAgICAgICAgcmV0dXJuIHN0YXR1czsKLSAgICBlbHNlCi0gICAgewotICAgICAgICAvKiBTaG9ydCBWaWRlbyBIZWFkZXIgb3IgTTRWICovCi0KLSAgICAgICAgLyoqKioqKioqKioqKioqKioqKioqKioqKioqLwotICAgICAgICAvKiBWaXN1YWxPYmplY3RTZXF1ZW5jZSAoKSovCi0gICAgICAgIC8qKioqKioqKioqKioqKioqKioqKioqKioqKi8KLSAgICAgICAgc3RhdHVzID0gQml0c3RyZWFtUHV0R1QxNkJpdHMoc3RyZWFtLCAzMiwgU0VTU0lPTl9TVEFSVF9DT0RFKTsKLSAgICAgICAgLyogIERldGVybWluZSBwcm9maWxlX2xldmVsICovCi0gICAgICAgIHN0YXR1cyA9IEJpdHN0cmVhbVB1dEJpdHMoc3RyZWFtLCA4LCB2aWRlby0+ZW5jUGFyYW1zLT5Qcm9maWxlTGV2ZWxbdmlkZW8tPmN1cnJMYXllcl0pOwotCi0gICAgICAgIC8qKioqKioqKioqKioqKioqKiovCi0gICAgICAgIC8qIFZpc3VhbE9iamVjdCgpICovCi0gICAgICAgIC8qKioqKioqKioqKioqKioqKiovCi0KLSAgICAgICAgc3RhdHVzID0gQml0c3RyZWFtUHV0R1QxNkJpdHMoc3RyZWFtLCAz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JpdHMoc3RyZWFtLCAweDAxKTsvKm1hcmtlciBiaXQgKi8KLQotICAgICAgICAgICAgc3RhdHVzID0gQml0c3RyZWFtUHV0MUJpdHMoc3RyZWFtLCAweDAwKTsvKmludGVybGFjZWQgPSAwICovCi0gICAgICAgICAgICBzdGF0dXMgPSBCaXRzdHJlYW1QdXQxQml0cyhzdHJlYW0sIDB4MDEpOy8qIG9ibWNfZGlzYWJsZSA9IDEgKi8KLSAgICAgICAgICAgIHN0YXR1cyA9IEJpdHN0cmVhbVB1dDFCaXRzKHN0cmVhbSwgMHgwMCk7Lyogc3ByaXRlX2VuYWJsZSA9IDAgKi8KLSAgICAgICAgICAgIHN0YXR1cyA9IEJpdHN0cmVhbVB1dDFCaXRzKHN0cmVhbSwgMHgwMCk7Lyogbm90XzhfYml0ID0gMCAqLwotICAgICAgICAgICAgc3RhdHVzID0gQml0c3RyZWFtUHV0MUJpdHMoc3RyZWFtLCBjdXJyVm9sLT5xdWFudFR5cGUpOy8qICAgcXVhbnRfdHlwZSAqLwotCi0gICAgICAgICAgICBpZiAoY3VyclZvbC0+cXVhbnRUeXBlKQotICAgICAgICAgICAgewotICAgICAgICAgICAgICAgIHN0YXR1cyA9IEJpdHN0cmVhbVB1dDFCaXRzKHN0cmVhbSwgY3VyclZvbC0+bG9hZEludHJhUXVhbnRNYXQpOyAvKiBJbnRyYSBxdWFudCBtYXRyaXggKi8KLSAgICAgICAgICAgICAgICBpZiAoY3VyclZvbC0+bG9hZEludHJhUXVhbnRNYXQpCi0gICAgICAgICAgICAgICAgewotICAgICAgICAgICAgICAgICAgICBmb3IgKGogPSA2MzsgaiA+PSAxOyBqLS0pCi0gICAgICAgICAgICAgICAgICAgICAgICBpZiAoY3VyclZvbC0+aXFtYXRbKih6aWd6YWdfaStqKV0gIT0gY3VyclZvbC0+aXFtYXRbKih6aWd6YWdfaStqLTEpXSkKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKLSAgICAgICAgICAgICAgICAgICAgaWYgKChqID09IDEpICYmIChjdXJyVm9sLT5pcW1hdFsqKHppZ3phZ19pK2opXSA9PSBjdXJyVm9sLT5pcW1hdFsqKHppZ3phZ19pK2otMSldKSkKLSAgICAgICAgICAgICAgICAgICAgICAgIGogPSAwOwotICAgICAgICAgICAgICAgICAgICBmb3IgKGkgPSAwOyBpIDwgaiArIDE7IGkrKykKLSAgICAgICAgICAgICAgICAgICAgICAgIEJpdHN0cmVhbVB1dEJpdHMoc3RyZWFtLCA4LCBjdXJyVm9sLT5pcW1hdFsqKHppZ3phZ19pK2kpXSk7Ci0gICAgICAgICAgICAgICAgICAgIGlmIChqIDwgNjMpCi0gICAgICAgICAgICAgICAgICAgICAgICBCaXRzdHJlYW1QdXRCaXRzKHN0cmVhbSwgOCwgMCk7Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgIGVsc2UKLSAgICAgICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgICAgIGZvciAoaiA9IDA7IGogPCA2NDsgaisrKQotICAgICAgICAgICAgICAgICAgICAgICAgY3VyclZvbC0+aXFtYXRbal0gPSBtcGVnX2lxbWF0X2RlZltqXTsKLQotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICBzdGF0dXMgPSBCaXRzdHJlYW1QdXQxQml0cyhzdHJlYW0sIGN1cnJWb2wtPmxvYWROb25JbnRyYVF1YW50TWF0KTsgLyogTm9uLUludHJhIHF1YW50IG1hdHJpeCAqLwotICAgICAgICAgICAgICAgIGlmIChjdXJyVm9sLT5sb2FkTm9uSW50cmFRdWFudE1hdCkKLSAgICAgICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgICAgIGZvciAoaiA9IDYzOyBqID49IDE7IGotLSkKLSAgICAgICAgICAgICAgICAgICAgICAgIGlmIChjdXJyVm9sLT5uaXFtYXRbKih6aWd6YWdfaStqKV0gIT0gY3VyclZvbC0+bmlxbWF0WyooemlnemFnX2krai0xKV0pCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7Ci0gICAgICAgICAgICAgICAgICAgIGlmICgoaiA9PSAxKSAmJiAoY3VyclZvbC0+bmlxbWF0WyooemlnemFnX2kraildID09IGN1cnJWb2wtPm5pcW1hdFsqKHppZ3phZ19pK2otMSldKSkKLSAgICAgICAgICAgICAgICAgICAgICAgIGogPSAwOwotICAgICAgICAgICAgICAgICAgICBmb3IgKGkgPSAwOyBpIDwgaiArIDE7IGkrKykKLSAgICAgICAgICAgICAgICAgICAgICAgIEJpdHN0cmVhbVB1dEJpdHMoc3RyZWFtLCA4LCBjdXJyVm9sLT5uaXFtYXRbKih6aWd6YWdfaStpKV0pOwotICAgICAgICAgICAgICAgICAgICBpZiAoaiA8IDYzKQotICAgICAgICAgICAgICAgICAgICAgICAgQml0c3RyZWFtUHV0Qml0cyhzdHJlYW0sIDgsIDApOwotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICBlbHNlCi0gICAgICAgICAgICAgICAgewotICAgICAgICAgICAgICAgICAgICBmb3IgKGogPSAwOyBqIDwgNjQ7IGorKykKLSAgICAgICAgICAgICAgICAgICAgICAgIGN1cnJWb2wtPm5pcW1hdFtqXSA9IG1wZWdfbnFtYXRfZGVmW2pdOwotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgc3RhdHVzID0gQml0c3RyZWFtUHV0MUJpdHMoc3RyZWFtLCAweDAxKTsgICAvKiBjb21wbGV4aXR5X2VzdGltYXRpb25fZGlzYWJsZSA9IDEgKi8KLSAgICAgICAgICAgIHN0YXR1cyA9IEJpdHN0cmVhbVB1dDFCaXRzKHN0cmVhbSwgY3VyclZvbC0+UmVzeW5jTWFya2VyRGlzYWJsZSk7LyogUmVzeW5jX21hcmtlcl9kaXNhYmxlICovCi0gICAgICAgICAgICBzdGF0dXMgPSBCaXRzdHJlYW1QdXQxQml0cyhzdHJlYW0sIGN1cnJWb2wtPmRhdGFQYXJ0aXRpb25pbmcpOy8qIERhdG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AgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICBQdXJwb3NlICA6IFZpc3VhbCBPYmplY3QgU2VxdWVuY2UgRW5kICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogIEluL291dCAgIDogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgUmV0dXJuICAgOiBQVl9UUlVFIGlmIHN1Y2Nlc3NlZCwgUFZfRkFMU0UgaWYgZmFpbGVkLiAgICAgICAgICAgICAgICAgICAgKi8KLS8qICBNb2RpZmllZCA6ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0gKi8KLQotUFZfU1RBVFVTIFZPU19FbmQoVmlkZW9FbmNDb250cm9scyAqZW5jb2RlckNvbnRyb2wpCi17Ci0gICAgUFZfU1RBVFVTIHN0YXR1cyA9IFBWX1NVQ0NFU1M7Ci0gICAgVmlkZW9FbmNEYXRhICp2aWRlbyA9IChWaWRlb0VuY0RhdGEgKillbmNvZGVyQ29udHJvbC0+dmlkZW9FbmNvZGVyRGF0YTsKLSAgICBWb2wgICAgICAgICAqY3VyclZvbCA9IHZpZGVvLT52b2xbdmlkZW8tPmN1cnJMYXllcl07Ci0gICAgQml0c3RyZWFtRW5jVmlkZW8gKnN0cmVhbSA9IGN1cnJWb2wtPnN0cmVhbTsKLQotCi0gICAgc3RhdHVzID0gQml0c3RyZWFtUHV0Qml0cyhzdHJlYW0sIFNFU1NJT05fRU5EX0NPREUsIDMyKTsKLQotICAgIHJldHVybiBzdGF0dXM7Ci19Ci0KLS8qID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PSAqLwotLyogIEZ1bmN0aW9uIDogRGV0ZXJtaW5lQ29kaW5nTGF5ZXIgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgRGF0ZSAgICAgOiAwNi8wMi8yMDAxICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICBQdXJwb3NlICA6IEZpbmQgbGF5ZXIgdG8gY29kZSBiYXNlZCBvbiBjdXJyZW50IG1vZCB0aW1lLCBhc3N1bWluZyB0aGF0Ci0gICAgICAgICAgICAgICBpdCdzIHRpbWUgdG8gZW5jb2RlIGVuaGFuY2VkIGxheWVyLiAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICBJbi9vdXQgICA6ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogIFJldHVybiAgIDogTnVtYmVyIG9mIGxheWVyIHRvIGNvZGUuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgTW9kaWZpZWQgOiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09ICovCi0KLUludCBEZXRlcm1pbmVDb2RpbmdMYXllcihWaWRlb0VuY0RhdGEgKnZpZGVvLCBJbnQgKm5MYXllciwgVUxvbmcgbW9kVGltZSkKLXsKLSAgICBWb2wgKip2b2wgPSB2aWRlby0+dm9sOwotICAgIF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i0gICAgICAgICAgICAgICAgdmlkZW8tPnByZXZGcmFtZU51bVtpXSA9IGZyYW1lTnVtW2ldIC0gMTsKLQotICAgICAgICAgICAgZXh0cmFfc2tpcCA9IC0xOwotICAgICAgICAgICAgZnJhbWVJbmMgPSAoZnJhbWVOdW1baV0gLSB2aWRlby0+cHJldkZyYW1lTnVtW2ldKTsKLSAgICAgICAgICAgIGV4dHJhX3NraXAgKz0gZnJhbWVJbmM7Ci0KLSAgICAgICAgICAgIGlmIChleHRyYV9za2lwID4gMCkKLSAgICAgICAgICAgIHsgICAvKiB1cGRhdGUgcmMtPk5yLCByYy0+QiwgKHJjLT5ScikqLwotICAgICAgICAgICAgICAgIGlmIChlbmNQYXJhbXMtPlJDX1R5cGUgIT0gQ09OU1RBTlRfUSkKLSAgICAgICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgICAgIFJDX1VwZGF0ZUJ1ZmZlcih2aWRlbywgaSwgZXh0cmFfc2tpcCk7Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgfQotICAgICAgICAgICAgLyogdXBkYXRlIGZyYW1lIG5vLiAqLwotICAgICAgICAgICAgdmlkZW8tPnByZXZGcmFtZU51bVtpXSA9IGZyYW1lTnVtW2ldOwotICAgICAgICB9Ci0gICAgfQotCi0jaWZkZWYgX1BSSU5UX1NUQVQKLSAgICBpZiAoZW5jb2RlVm9wKQotICAgICAgICBwcmludGYoIiBUSTogJWQgIiwgdm9sWypuTGF5ZXJdLT50aW1lSW5jcmVtZW50KTsKLSNlbmRpZgotCi0gICAgcmV0dXJuIGVuY29kZVZvcDsKLX0KLQotLyogPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09ICovCi0vKiAgRnVuY3Rpb24gOiBEZXRlcm1pbmVWb3BUeXBlICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICBEYXRlICAgICA6IDA2LzAyLzIwMDEgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogIFB1cnBvc2UgIDogVGhlIG5hbWUgc2F5cyBpdCBhbGwuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgSW4vb3V0ICAgOiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICBSZXR1cm4gICA6IHZvaWQgLiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogIE1vZGlmaWVkIDogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PSAqLwotCi12b2lkIERldGVybWluZVZvcFR5cGUoVmlkZW9FbmNEYXRhICp2aWRlbywgSW50IGN1cnJMYXllcikKLXsKLSAgICBWaWRlb0VuY1BhcmFtcyAqZW5jUGFyYW1zID0gdmlkZW8tPmVuY1BhcmFtczsKLS8vICBWb2wgKmN1cnJWb2wgPSB2aWRlby0+dm9sW2N1cnJMYXllcl07Ci0KLSAgICBpZiAoZW5jUGFyYW1zLT5JbnRyYVBlcmlvZCA9PSAwKSAvKiBJLVZPUHMgb25seSAqLwotICAgIHsKLSAgICAgICAgaWYgKHZpZGVvLT5jdXJyTGF5ZXIgPiAwKQotICAgICAgICAgICAgdmlkZW8tPmN1cnJWb3AtPnByZWRpY3Rpb25UeXBlID0gUF9WT1A7Ci0gICAgICAgIGVsc2UKLSAgICAgICAgewotICAgICAgICAgICAgdmlkZW8tPmN1cnJWb3AtPnByZWR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wcmVkaWN0aW9uVHlwZSA9PSBJX1ZPUCkKLSAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICB2aWRlby0+bnVtVm9wc0luR09QID0gMDsKLSAgICAgICAgICAgICAgICB2aWRlby0+bmV4dEVuY0lWb3AgPSAxOwotICAgICAgICAgICAgfQotICAgICAgICB9Ci0gICAgfQotICAgIGVsc2UgICAvKiBJbnRyYVBlcmlvZD4wIDogSVBQUFBQSVBQUFBQSS4uLiAqLwotICAgIHsKLQotICAgICAgICAvKiBtYWludGFpbiBmcmFtZSB0eXBlIGlmIHByZXZpb3VzIGZyYW1lIGlzIHByZS1za2lwcGVkLCAwNi8wMi8yMDAxICovCi0gICAgICAgIGlmIChlbmNQYXJhbXMtPlJDX1R5cGUgPT0gQ09OU1RBTlRfUSB8fCB2aWRlby0+cmNbY3VyckxheWVyXS0+c2tpcF9uZXh0X2ZyYW1lICE9IC0xKQotICAgICAgICAgICAgdmlkZW8tPmN1cnJWb3AtPnByZWRpY3Rpb25UeXBlID0gUF9WT1A7Ci0KLSAgICAgICAgaWYgKGN1cnJMYXllciA9PSAwKQotICAgICAgICB7Ci0gICAgICAgICAgICBpZiAodmlkZW8tPm5leHRFbmNJVm9wIDw9IDAgfHwgdmlkZW8tPmN1cnJWb3AtPnByZWRpY3Rpb25UeXBlID09IElfVk9QKQotICAgICAgICAgICAgewotICAgICAgICAgICAgICAgIHZpZGVvLT5uZXh0RW5jSVZvcCA9IGVuY1BhcmFtcy0+SW50cmFQZXJpb2Q7Ci0gICAgICAgICAgICAgICAgdmlkZW8tPmN1cnJWb3AtPnByZWRpY3Rpb25UeXBlID0gSV9WT1A7Ci0gICAgICAgICAgICAgICAgdmlkZW8tPm51bVZvcHNJbkdPUCA9IDA7Ci0gICAgICAgICAgICB9Ci0gICAgICAgIH0KLSAgICB9Ci0KLSAgICByZXR1cm4gOwotfQotCi0vKiA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0gKi8KLS8qICBGdW5jdGlvbiA6IFVwZGF0ZVNraXBOZXh0RnJhbWUgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogIERhdGUgICAgIDogMDYvMDIvMjAwMSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgUHVycG9zZSAgOiBGcm9tIHJhdGUgY29udHJvbCBmcmFtZSBza2lwcGluZyBkZWNpc2lvbiwgdXBkYXRlIHRpbWluZwotICAgICAgICAgICAgICAgIHJlbGF0ZWQgcGFyYW1ldGVycy4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgSW4vb3V0ICAgOiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICBSZXR1cm4gICA6IEN1cnJlbnQgY29kZWQgbGF5ZXIuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogIE1vZGlmaWVkIDogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PSAqLwotCi1JbnQgVXBkYXRlU2tpcE5leHRGcmFtZShWaWRlb0VuY0RhdGEgKnZpZGVvLCBVTG9uZyAqbW9kVGltZSwgSW50ICpzaXplLCBQVl9TVEFUVVMgc3RhdHVzKQotewotICAgIEludCBjdXJyTGF5ZXIgPSB2aWRlby0+Y3VyckxheWVyOwotICAgIEludCBuTGF5ZXIgPSBjdXJyTGF5ZXI7Ci0gICAgVmlkZW9FbmNQYXJ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qKioqKioqKioqKioqKioqKi8KLSAgICAgICAgICAgICAgICAvKiBwcmVwYXJlIHRvIHJldHVybiAqLwotICAgICAgICAgICAgICAgIC8qKioqKioqKioqKioqKioqKioqKiovCi0gICAgICAgICAgICAgICAgKnNpemUgPSAwOyAgLyogU2V0IEJpdHN0cmVhbSBidWZmZXIgdG8gemVybyAqLwotCi0gICAgICAgICAgICAgICAgLyogRGV0ZXJtaW5lIG5MYXllciBhbmQgbW9kVGltZSBmb3IgbmV4dCBlbmNvZGUgKi8KLQotICAgICAgICAgICAgICAgICptb2RUaW1lID0gdmlkZW8tPm5leHRNb2RUaW1lOwotICAgICAgICAgICAgICAgIG5MYXllciA9IC0xOwotCi0gICAgICAgICAgICAgICAgcmV0dXJuIG5MYXllcjsgLyogcmV0dXJuIGltbWVkaWF0ZWx5IHdpdGhvdXQgdXBkYXRpbmcgUmVmVGljayAmIG1vZFRpbWVSZWYgKi8KLSAgICAgICAgICAgICAgICAvKiBJZiBJLVZPUCB3YXMgYXR0ZW1wdGVkLCB0aGVuIGVuc3VyZSBuZXh0IGJhc2UgaXMgSS1WT1AgKi8KLSAgICAgICAgICAgICAgICAvKmlmKChlbmNQYXJhbXMtPkludHJhUGVyaW9kPjApICYmICh2aWRlby0+Y3VyclZvcC0+cHJlZGljdGlvblR5cGUgPT0gSV9WT1ApKQotICAgICAgICAgICAgICAgIHZpZGVvLT5uZXh0RW5jSVZvcCA9IDA7IGNvbW1lbnRlZCBvdXQgYnkgMDYvMDUvMDEgKi8KLQotICAgICAgICAgICAgfQotICAgICAgICAgICAgZWxzZSBpZiAoKG51bV9za2lwID0gUkNfR2V0U2tpcE5leHRGcmFtZSh2aWRlbywgY3VyckxheWVyKSkgPiAwKQotICAgICAgICAgICAgewotCi0jaWZkZWYgX1BSSU5UX1NUQVQKLSAgICAgICAgICAgICAgICBwcmludGYoIlNraXAgbmV4dCAlZCBmcmFtZXMiLCBudW1fc2tpcCk7Ci0jZW5kaWYKLSAgICAgICAgICAgICAgICAvKiB0byBrZWVwIHRoZSBOciBvZiBlbmggbGF5ZXIgdGhlIHNhbWUgKi8KLSAgICAgICAgICAgICAgICAvKiBhZGp1c3QgcmVsTGF5ZXJDb2RlVGltZSBvbmx5LCBkbyBub3QgYWRqdXN0IGxheWVyQ29kZVRpbWVbbnVtTGF5ZXJzLTFdICovCi0gICAgICAgICAgICAgICAgZXh0cmFfc2tpcCA9IDA7Ci0gICAgICAgICAgICAgICAgZm9yIChpID0gMDsgaSA8IGN1cnJMYXllcjsgaSsrKQotICAgICAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAgICAgaWYgKHZpZGVvLT5yZWxMYXllckNvZGVUaW1lW2ldIDw9IDEwMDApCi0gICAgICAgICAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAgICAgICAgIGV4dHJhX3NraXAgPSAxOwotICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7Ci0gICAgICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgICAgICBmb3IgKGkgPSBjdXJyTGF5ZXI7IGkgPCBudW1MYXllcnM7IGkrKykKLSAgICAgICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgICAgIHZpZGVvLT5yZWxMYXllckNvZGVUaW1lW2ldICs9IChudW1fc2tpcCArIGV4dHJhX3NraXApICoKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKChJbnQpKCgxMDAwLjAgKiBlbmNQYXJhbXMtPkxheWVyRnJhbWVSYXRlW251bUxheWVycy0xXSkgLyBlbmNQYXJhbXMtPkxheWVyRnJhbWVSYXRlW2ldKSk7Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgfQotICAgICAgICB9LyogZmlyc3QgZnJhbWUgKi8KLSAgICB9Ci0gICAgLyoqKioqICBjdXJyZW50IGZyYW1lIGlzIGVuY29kZWQsIG5vdyB1cGRhdGUgcmVmVGljayAqKioqKiovCi0KL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Btb2RUaW1lUmVmICovCi0gICAgICAgICAgICBkZWx0YU1vZFRpbWUgPSAobmV3UmVmVGljayAvIHZvbFswXS0+dGltZUluY3JlbWVudFJlc29sdXRpb24pICogMTAwMDsKLQotICAgICAgICAgICAgZm9yIChpID0gbnVtTGF5ZXJzIC0gMTsgaSA+PSAwOyBpLS0pCi0gICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgdGVtcCA9IChVSW50KShkZWx0YU1vZFRpbWUgKiBlbmNQYXJhbXMtPkxheWVyRnJhbWVSYXRlW2ldKTsgLyogMTIvMTIvMDIgKi8KLSAgICAgICAgICAgICAgICBpZiAodGVtcCAlIDEwMDApCi0gICAgICAgICAgICAgICAgICAgIG5ld1JlZlRpY2sgPSAwOwotCi0gICAgICAgICAgICB9Ci0gICAgICAgICAgICBpZiAobmV3UmVmVGljayA+IDApCi0gICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgdmlkZW8tPm1vZFRpbWVSZWYgKz0gZGVsdGFNb2RUaW1lOwotICAgICAgICAgICAgICAgIGZvciAoaSA9IG51bUxheWVycyAtIDE7IGkgPj0gMDsgaS0tKQotICAgICAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAgICAgdmlkZW8tPnByZXZGcmFtZU51bVtpXSAtPSAoVUludCkoZGVsdGFNb2RUaW1lICogZW5jUGFyYW1zLT5MYXllckZyYW1lUmF0ZVtpXSkgLyAxMDAwOwotICAgICAgICAgICAgICAgICAgICB2aWRlby0+cmVmVGlja1tpXSAtPSBuZXdSZWZUaWNrOwotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgIH0KLSAgICAgICAgfQotICAgIH0KLQotICAgICptb2RUaW1lID0gIHZpZGVvLT5uZXh0TW9kVGltZTsKLQotICAgIHJldHVybiBuTGF5ZXI7Ci19Ci0KLQotI2lmbmRlZiBPUklHSU5BTF9WRVJTSU9OCi0KLS8qID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PSAqLwotLyogIEZ1bmN0aW9uIDogU2V0UHJvZmlsZV9CdWZmZXJTaXplICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgRGF0ZSAgICAgOiAwNC8wOC8yMDAyICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICBQdXJwb3NlICA6IFNldCBwcm9maWxlIGFuZCB2aWRlbyBidWZmZXIgc2l6ZSwgY29waWVkIGZyb20gSmltJ3MgY29kZSAgICAqLwotLyogICAgICAgICAgICAgaW4gUFZJbml0VmlkZW9FbmNvZGVyKC4pLCBzaW5jZSB3ZSBoYXZlIGRpZmZlcmVudCBwbGFjZXMgICAgICovCi0vKiAgICAgICAgICAgICB0byByZXNldCBwcm9maWxlIGFuZCB2aWRlbyBidWZmZXIgc2l6ZSAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICBJbi9vdXQgICA6ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogIFJldHVybiAgIDogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgTW9kaWZpZWQgOiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09ICovCi0KLUJvb2wgU2V0UHJvZmlsZV9CdWZmZXJTaXplKFZpZGVvRW5jRGF0YSAqdmlkZW8sIGZsb2F0IGRlbGF5LCBJbnQgYkluaXRpYWxpemVkKQotewotICAgIEludCBpL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vdyBTUEwwICovCi0gICAgICAgIH0KLSAgICAgICAgZWxzZQotICAgICAgICB7Ci0gICAgICAgICAgICBsb3dlc3RfbGV2ZWwgPSAwOyAvKiBTUEwwICovCi0gICAgICAgIH0KLQotICAgICAgICBmb3IgKGkgPSBsb3dlc3RfbGV2ZWw7IGkgPD0gaW5kZXg7IGkrKykKLSAgICAgICAgewotICAgICAgICAgICAgaWYgKGkgIT0gNCAmJiAvKiBza2lwIENvcmUgUHJvZmlsZUBMZXZlbDEgYmVjYXVzZSB0aGUgcGFyYW1ldGVycyBpbiBpdCBhcmUgc21hbGxlciB0aGFuIHRob3NlIGluIFNpbXBsZSBQcm9maWxlQExldmVsMyAqLwotICAgICAgICAgICAgICAgICAgICBiYXNlX2JpdHJhdGUgICAgIDw9IHByb2ZpbGVfbGV2ZWxfbWF4X2JpdHJhdGVbaV0gICAgICYmCi0gICAgICAgICAgICAgICAgICAgIGJhc2VfcGFja2V0X3NpemUgPD0gcHJvZmlsZV9sZXZlbF9tYXhfcGFja2V0X3NpemVbaV0gJiYKLSAgICAgICAgICAgICAgICAgICAgYmFzZV9NQnNQZXJTZWMgICA8PSBwcm9maWxlX2xldmVsX21heF9tYnNQZXJTZWNbaV0gICAmJgotICAgICAgICAgICAgICAgICAgICBiYXNlX1ZCVl9zaXplICAgIDw9ICh2aWRlby0+ZW5jUGFyYW1zLT5IMjYzX0VuYWJsZWQgPyAoSW50KShrKjE2Mzg0ICsgNCooZmxvYXQpcHJvZmlsZV9sZXZlbF9tYXhfYml0cmF0ZVtpXSoxMDAxLjAgLyAzMDAwMC4wKSA6Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHByb2ZpbGVfbGV2ZWxfbWF4X1ZCVl9zaXplW2ldKSkKLSAgICAgICAgICAgICAgICBicmVhazsKLSAgICAgICAgfQotICAgICAgICBpZiAoaSA+IGluZGV4KSByZXR1cm4gUFZfRkFMU0U7IC8qIE5vdGhpbmcgZm91bmQhISAqLwotC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9maWxlICovCi0gICAgICAgIGlmICh0b3RhbF9iaXRyYXRlICAgICAgIDw9IHNjYWxhYmxlX3Byb2ZpbGVfbGV2ZWxfbWF4X2JpdHJhdGVbMl0gICAgICAgICYmCi0gICAgICAgICAgICAgICAgdG90YWxfcGFja2V0X3NpemUgICA8PSBzY2FsYWJsZV9wcm9maWxlX2xldmVsX21heF9wYWNrZXRfc2l6ZVsyXSAgICAmJgotICAgICAgICAgICAgICAgIHRvdGFsX01Cc1BlclNlYyAgICAgPD0gc2NhbGFibGVfcHJvZmlsZV9sZXZlbF9tYXhfbWJzUGVyU2VjWzJdICAgICAgJiYKLSAgICAgICAgICAgICAgICB0b3RhbF9WQlZfc2l6ZSAgICAgIDw9IHNjYWxhYmxlX3Byb2ZpbGVfbGV2ZWxfbWF4X1ZCVl9zaXplWzJdKQotCi0gICAgICAgIHsKLSAgICAgICAgICAgIHN0YXJ0ID0gMDsKLSAgICAgICAgICAgIGVuZCA9IGluZGV4OwotICAgICAgICB9Ci0KLSAgICAgICAgZWxzZQotICAgICAgICB7Ci0gICAgICAgICAgICBzdGFydCA9IDQ7Ci0gICAgICAgICAgICBlbmQgPSBpbmRleDsKLSAgICAgICAgfQotCi0KLSAgICAgICAgLyogU2VhcmNoIHRoZSBzY2FsYWJsZSBwcm9maWxlICovCi0gICAgICAgIGZvciAoaSA9IHN0YXJ0OyBpIDw9IGVuZDsgaSsrKQotICAgICAgICB7Ci0gICAgICAgICAgICBpZiAodG90YWxfYml0cmF0ZSAgICAgICA8PSBzY2FsYWJsZV9wcm9maWxlX2xldmVsX21heF9iaXRyYXRlW2ldICAgICAmJgotICAgICAgICAgICAgICAgICAgICB0b3RhbF9wYWNrZXRfc2l6ZSAgIDw9IHNjYWxhYmxlX3Byb2ZpbGVfbGV2ZWxfbWF4X3BhY2tldF9zaXplW2ldICYmCi0gICAgICAgICAgICAgICAgICAgIHRvdGFsX01Cc1BlclNlYyAgICAgPD0gc2NhbGFibGVfcHJvZmlsZV9sZXZlbF9tYXhfbWJzUGVyU2VjW2ldICAgJiYKLSAgICAgICAgICAgICAgICAgICAgdG90YWxfVkJWX3NpemUgICAgICA8PSBzY2FsYWJsZV9wcm9maWxlX2xldmVsX21heF9WQlZfc2l6ZVtpXSkKLQotICAgICAgICAgICAgICAgIGJyZWFrOwotICAgICAgICB9Ci0gICAgICAgIGlmIChpID4gZW5kKSByZXR1cm4gUFZfRkFMU0U7Ci0KLSAgICAgICAgLyogU2VhcmNoIHRoZSBiYXNlIHByb2ZpbGUgKi8KLSAgICAgICAgaWYgKGkgPT0gMCkKLSAgICAgICAgewotICAgICAgICAgICAgaiA9IDA7Ci0gICAgICAgICAgICBiRm91bmQgPSAxOwotICAgICAgICB9Ci0gICAgICAgIGVsc2UgICAgICAgIGJGb3VuZCA9IDA7Ci0KLSAgICAgICAgZm9yIChqID0gc3RhcnQ7ICFiRm91bmQgJiYgaiA8PSBpOyBqKyspCi0gICAgICAgIHsKLSAgICAgICAgICAgIGlmIChiYXNlX2JpdHJhdGUgICAgICAgIDw9IHByb2ZpbGVfbGV2ZWxfbWF4X2JpdHJhdGVbal0gICAgICAmJgotICAgICAgICAgICAgICAgICAgICBiYXNlX3BhY2tldF9zaXplICAgIDw9IHByb2ZpbGVfbGV2ZWxfbWF4X3BhY2tldF9zaXplW2pdICAmJgotICAgICAgICAgICAgICAgICAgICBiYXNlX01Cc1BlclNlYyAgICAgIDw9IHByb2ZpbGVfbGV2ZWxfbWF4X21ic1BlclNlY1tqXSAgICAmJgotICAgICAgICAgICAgICAgICAgICBiYXNlX1ZCVl9zaXplICAgICAgIDw9IHByb2ZpbGVfbGV2ZWxfbWF4X1ZCVl9zaXplW2pdKQotCi0gICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgYkZvdW5kID0gMTsKLSAgICAgICAgICAgICAgICBicmVhazsKLSAgICAgICAgICAgIH0KLSAgICAgICAgfQotCi0gICAgICAgIGlmICghYkZvdW5kKSAvLyAmJiBzdGFydCA9PSA0KQotICAgIC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2hvcnQgKmJsb2NrRGF0YSwgU2hvcnQgKmJsb2NrQ29lZmYpOwotCi0gICAgLyotLS0tIEZhc3RRdWFudC5jIC0tLS0tKi8KLSAgICBJbnQgY2FsX2RjX3NjYWxlckVOQyhJbnQgUVAsIEludCB0eXBlKSA7Ci0gICAgSW50IEJsb2NrUXVhbnREZXF1YW50SDI2M0ludGVyKFNob3J0ICpyY29lZmYsIFNob3J0ICpxY29lZmYsIHN0cnVjdCBRUHN0cnVjdCAqUXVhbnRQYXJhbSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgVUNoYXIgYml0bWFwY29sWyBdLCBVQ2hhciAqYml0bWFwcm93LCBVSW50ICpiaXRtYXB6eiwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgSW50IGRjdE1vZGUsIEludCBjb21wLCBJbnQgZHVtbXksIFVDaGFyIHNob3J0SGVhZGVyKTsKLQotICAgIEludCBCbG9ja1F1YW50RGVxdWFudEgyNjNJbnRyYShTaG9ydCAqcmNvZWZmLCBTaG9ydCAqcWNvZWZmLCBzdHJ1Y3QgUVBzdHJ1Y3QgKlF1YW50UGFyYW0sCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFVDaGFyIGJpdG1hcGNvbFsgXSwgVUNoYXIgKmJpdG1hcHJvdywgVUludCAqYml0bWFwenosCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEludCBkY3RNb2RlLCBJbnQgY29tcCwgSW50IGRjX3NjYWxlciwgVUNoYXIgc2hvcnRIZWFkZXIpOwotCi0gICAgSW50IEJsb2NrUXVhbnREZXF1YW50SDI2M0RDSW50ZXIoU2hvcnQgKnJjb2VmZiwgU2hvcnQgKnFjb2VmZiwgc3RydWN0IFFQc3RydWN0ICpRdWFudFBhcmFtLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFVDaGFyICpiaXRtYXByb3csIFVJbnQgKmJpdG1hcHp6LCBJbnQgZHVtbXksIFVDaGFyIHNob3J0SGVhZGVyKTsKLQotICAgIEludCBCbG9ja1F1YW50RGVxdWFudEgyNjNEQ0ludHJhKFNob3J0ICpyY29lZmYsIFNob3J0ICpxY29lZmYsIHN0cnVjdCBRUHN0cnVjdCAqUXVhbnRQYXJhbSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBVQ2hhciAqYml0bWFwcm93LCBVSW50ICpiaXRtYXB6eiwgSW50IGRjX3NjYWxlciwgVUNoYXIgc2hvcnRIZWFkZXIpOwotCi0jaWZuZGVmIE5PX01QRUdfUVVBTlQKLSAgICBJbnQgQmxvY2tRdWFudERlcXVhbnRNUEVHSW50ZXIoU2hvcnQgKnJjb2VmZiwgU2hvcnQgKnFjb2VmZiwgSW50IFFQLCBJbnQgKnFtYXQsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFVDaGFyIGJpdG1hcGNvbFsgXSwgVUNoYXIgKmJpdG1hcHJvdywgVUludCAqYml0bWFwenosCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEludCBEY3RNb2RlLCBJbnQgY29tcCwgSW50IGRjX3NjYWxlcik7Ci0KLSAgICBJbnQgQmxvY2tRdWFudERlcXVhbnRNUEVHSW50cmEoU2hvcnQgKnJjb2VmZiwgU2hvcnQgKnFjb2VmZiwgSW50IFFQLCBJbnQgKnFtYXQsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFVDaGFyIGJpdG1hcGNvbFsgXSwgVUNoYXIgKmJpdG1hcHJvdywgVUludCAqYml0bWFwenosCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEludCBEY3RNb2RlLCBJbnQgY29tcCwgSW50IGRjX3NjYWxlcik7Ci0KLSAgICBJbnQgQmxvY2tRdWFudERlcXVhbnRNUEVHRENJbnRlcihTaG9ydCAqcmNvZWZmLCBTaG9ydCAqcWNvZWZmLCBJbnQgUVAsIEludCAqcW1hdCwKLSAgICA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Ci0gICAgLyogU3ludGF4IGVsZW1lbnRzIGNvcGllZCBmcm9tIFZPTCAoc3RhbmRhcmQpICovCi0gICAgSW50ICAgICB3aWR0aDsgICAgICAgICAgICAgIC8qIFdpZHRoIChtdWx0aXBsZSBvZiAxNikgKi8KLSAgICBJbnQgICAgIGhlaWdodDsgICAgICAgICAgICAgLyogSGVpZ2h0IChtdWx0aXBsZSBvZiAxNikgKi8KLSAgICBJbnQgICAgIHBpdGNoOyAgICAgICAgICAgICAgLyogUGl0Y2ggKGRpZmZlcnMgZnJvbSB3aWR0aCBmb3IgVU1WIGNhc2UpICovCi0gICAgSW50ICAgICBwYWRkZWQ7ICAgICAvKiBmbGFnIHdoZXRoZXIgdGhpcyBmcmFtZSBoYXMgYmVlbiBwYWRkZWQgKi8KLQotICAgIC8qIEFjdHVhbCBzeW50YXggZWxlbWVudHMgZm9yIFZPUCAoc3RhbmRhcmQpICovCi0gICAgSW50ICAgICBwcmVkaWN0aW9uVHlwZTsgICAgIC8qIFZPUCBwcmVkaWN0aW9uIHR5cGUgKi8KLSAgICBJbnQgICAgIHRpbWVJbmM7ICAgICAgICAgICAgLyogVk9QIHRpbWUgaW5jcmVtZW50IChyZWxhdGl2ZSB0byBsYXN0IG10YikgKi8KLSAgICBJbnQgICAgIHZvcENvZGVkOwotICAgIEludCAgICAgcm91bmRpbmdUeXBlOwotICAgIEludCAgICAgaW50cmFEQ1ZsY1RocjsKLSAgICBJbnQgICAgIHF1YW50aXplcjsgICAgICAgICAgLyogVk9QIHF1YW50aXplciAqLwotICAgIEludCAgICAgZmNvZGVGb3J3YXJkOyAgICAgICAvKiBWT1AgZHluYW1pYyByYW5nZSBvZiBtb3Rpb24gdmVjdG9ycyAqLwotICAgIEludCAgICAgZmNvZGVCYWNrd2FyZDsgICAgICAvKiBWT1AgZHluYW1pYyByYW5nZSBvZiBtb3Rpb24gdmVjdG9ycyAqLwotICAgIEludCAgICAgcmVmU2VsZWN0Q29kZTsgICAgICAvKiBlbmhhbm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9wUmF0ZTsKLSAgICBCaXRzdHJlYW1FbmNWaWRlbyAgKnN0cmVhbTsgLyogbGlicmFyeSBiaXRzdHJlYW0gYnVmZmVyIChpbnB1dCBidWZmZXIpICovCi0KLSAgICAvKiBWT0wgRGltZW5zaW9ucyAqLwotICAgIEludCAgICAgd2lkdGg7ICAgICAgICAgICAgICAvKiBXaWR0aCAqLwotICAgIEludCAgICAgaGVpZ2h0OyAgICAgICAgICAgICAvKiBIZWlnaHQgKi8KLQotICAgIC8qIEVycm9yIFJlc2lsaWVuY2UgRmxhZ3MgKi8KLSAgICBJbnQgICAgIFJlc3luY01hcmtlckRpc2FibGU7IC8qIFZPTCBEaXNhYmxlIFJlc3luY2ggTWFya2VycyAqLwotICAgIEludCAgICAgdXNlUmV2ZXJzZVZMQzsgICAgICAvKiBWT0wgcmV2ZXJzaWJsZSBWTENzICovCi0gICAgSW50ICAgICBkYXRhUGFydGl0aW9uaW5nOyAgIC8qIFZPTCBkYXRhIHBhcnRpdGlvbmluZyAqLwotCi0gICAgLyogUXVhbnRpemF0aW9uIHJlbGF0ZWQgcGFyYW1ldGVycyAqLwotICAgIEludCAgICAgcXVhbnRQcmVjaXNpb247ICAgICAvKiBRdWFudGl6ZXIgcHJlY2lzaW9uICovCi0gICAgSW50ICAgICBxdWFudFR5cGU7ICAgICAgICAgIC8qIE1QRUctNCBvciBILjI2MyBRdWFudGl6YXRpb24gVHlwZSAqLwotCi0gICAgLyogQWRkZWQgbG9hZGVkIHF1YW50IG1hdCwgMDUvMjIvMjAwMCAqLwotICAgIEludCAgICAgbG9hZEludHJhUXVhbnRNYXQ7ICAgICAgLyogTG9hZCBpbnRyYSBxdWFudGl6YXRpb24gbWF0cml4ICovCi0gICAgSW50ICAgICBsb2FkTm9uSW50cmFRdWFudE1hdDsgICAvKiBMb2FkIG5vbmludHJhIHF1YW50aXphdGlvbiBtYXRyaXggKi8KLSAgICBJbnQgICAgIGlxbWF0WzY0XTsgICAgICAgICAgLyogSW50cmEgcX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QgICAgIG5NQlBlclJvdywgbk1CUGVyQ29sOyAgIC8qIG51bWJlciBvZiBNQnMgaW4gZWFjaCByb3cgJiBjb2x1bW4gICAgKi8KLSAgICBJbnQgICAgIG5Ub3RhbE1COwotICAgIEludCAgICAgbkJpdHNGb3JNQklEOyAgICAgICAgICAgLyogaG93IG1hbnkgYml0cyByZXF1aXJlZCBmb3IgTUIgbnVtYmVyPyAqLwotCi0gICAgLyogZm9yIHNob3J0IHZpZGVvIGhlYWRlciAqLwotICAgIEludCAgICAgbk1CaW5HT0I7ICAgICAgICAgICAvKiBudW1iZXIgb2YgTUJzIGluIEdPQiwgMDUvMjIvMDAgKi8KLSAgICBJbnQgICAgIG5HT0JpblZvcDsgICAgICAgICAgLyogbnVtYmVyIG9mIEdPQiBpbiBWb3AgIDA1LzIyLzAwICovCi19IFZvbDsKLQotdHlwZWRlZiBzdHJ1Y3QgdGFnTWFjcm9CbG9jawotewotICAgIEludCAgICAgbWJfeDsgICAgICAgICAgICAgICAvKiBYIGNvb3JkaW5hdGUgKi8KLSAgICBJbnQgICAgIG1iX3k7ICAgICAgICAgICAgICAgLyogWSBjb29yZGluYXRlICovCi0gICAgU2hvcnQgICBibG9ja1s5XVs2NF07ICAgICAgIC8qIDQtWSwgVSBhbmQgViBibG9ja3MgLCBhbmQgQUFOIFNjYWxlKi8KLX0gTWFjcm9CbG9jazsKLQotdHlwZWRlZiBzdHJ1Y3QgdGFnUnVuTGV2ZWxCbG9jawotewotICAgIEludCBydW5bNjRdOyAgICAgICAgLyogUnVubGVuZ3RoICovCi0gICAgSW50IGxldmVsWzY0XTsgICAgICAvKiBBYnMobGV2ZWwpICovCi0gICAgSW50IHNbNjRdOyAgICAgICAgICAvKiBzaWduIGxldmVsICovCi19IFJ1bkxldmVsQmxvY2s7Ci0KLXR5cGVkZWYgc3RydWN0IHRhZ0hlYWRlckluZm9EZWNWaWRlbwotewotICAgIFVDaGFyICAgICAgICpNb2RlOyAgICAgICAgICAgICAgLyogTW9kZ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YWNoIExheWVyIHJlbGF0aXZlIHRvIGhpZ2hlc3QgbGF5ZXIgKi8KLQotICAgIFVMb25nICAgbW9kVGltZTsgICAgICAgICAgICAvKiBJbnB1dCBmcmFtZSBtb2RUaW1lICovCi0gICAgSW50ICAgICBjdXJyTGF5ZXI7ICAgICAgICAgIC8qIEN1cnJlbnQgZnJhbWUgbGF5ZXIgICovCi0gICAgSW50ICAgICBtYm51bTsgICAgICAgICAgICAgIC8qICBNYWNyb2Jsb2NrIG51bWJlciAqLwotCi0gICAgLyogc2xpY2UgY29kaW5nLCBzdGF0ZSB2YXJpYWJsZXMgKi8KLSAgICBWb3AgICAgICp0ZW1wRm9yd1JlZlZvcDsKLSAgICBJbnQgICAgIHRlbXBSZWZTZWxDb2RlOwotICAgIEludCAgICAgZW5kX29mX2J1ZjsgICAgICAgICAvKiBlbmQgb2YgYml0c3RyZWFtIGJ1ZmZlciBmbGFnICovCi0gICAgSW50ICAgICBzbGljZV9jb2Rpbmc7ICAgICAgIC8qIGZsYWcgZm9yIHNsaWNlIGJhc2VkIGNvZGluZyAqLwotICAgIEludCAgICAgdG90YWxTQUQ7ICAgICAgICAgICAvKiBTbyBmYXIgdG90YWwgU0FEIGZvciBhIGZyYW1lICovCi0gICAgSW50ICAgICBudW1JbnRyYTsgICAgICAgICAgIC8qIFNvIGZhciBudW1iZXIgb2YgSW50cmEgTUIgKi8KLSAgICBJbnQgICAgIG9mZnNldDsgICAgICAgICAgICAgLyogU28gZmFyIE1CIG9mZnNldCAqLwotICAgIEludCAgICAgaW5kX3gsIGluZF95OyAgICAgICAvKiBTbyBmYXIgTUIgY29vcmRpbmF0ZSAqLwotICAgIEludCAgICAgY29sbGVjdDsKLSAgICBJbnQgICAgIGhwX2d1ZXNzOwotICAgIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0KLSAgICBIaW50VHJhY2tJbmZvIGhpbnRUcmFja0luZm87ICAgIC8qIGhpbnRUcmFja0luZm8gKi8KLSAgICAvKiBJbnRyYVBlcmlvZCwgVGltZXN0YW1wLCBldGMuICovCi0gICAgZmxvYXQgICAgICAgbmV4dEVuY0lWb3A7ICAgIC8qIGNvdW50ZXIgdGlsIHRoZSBuZXh0IEktVm9wICovCi0gICAgZmxvYXQgICAgICAgbnVtVm9wc0luR09QOyAgIC8qIHZhbHVlIGF0IHRoZSBiZWdpbm5pbmcgb2YgbmV4dEVuY0lWb3AgKi8KLQotICAgIC8qIHBsYXRmb3JtIGRlcGVuZGVudCBmdW5jdGlvbnMgKi8KLSAgICBGdW5jUHRyICAgICAqZnVuY3Rpb25Qb2ludGVyOyAgIC8qIHN0cnVjdHVyZSBjb250YWluaW5nIHBsYXRmb3JtIGRlcGVuZGVudCBmdW5jdGlvbnMgKi8KLQotICAgIC8qIEFwcGxpY2F0aW9uIGNvbnRyb2xzICovCi0gICAgVmlkZW9FbmNDb250cm9scyAgICAqdmlkZW9FbmNDb250cm9sczsKLSAgICBWaWRlb0VuY1BhcmFtcyAgICAgICplbmNQYXJhbXM7Ci0KLSAgICBNdWx0aVBhc3MgKnBNUFs0XTsgLyogZm9yIG11bHRpcGFzcyBlbmNvZGluZywgNCByZXByZXNlbnRzIDQgbGF5ZXIgZW5jb2RpbmcgKi8KLQotfSBWaWRlb0VuY0RhdGE7Ci0KLS8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotLyogICAgICAgICAgICAgICAgICBWTEMgc3RydWN0dXJlcyAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLQotdHlwZWRlZiBzdHJ1Y3QgdGFnVkxDdGFibGUKLXsKLSAgICB1bnNpZ25lZCBpbnQgY29kZTsgLyogcmlnaHQganVzdGlmaWVkICovCi0gICAgaW50IGxlbjsKLX0gVkxDdGFibGUsICpMUFZMQ3RhYmxlOwotCi0KLS8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotLyogICAgICAgICAgICAgICAgICBBcHByb3ggRENUICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLXR5cGVkZWYgc3RydWN0IHN0cnVjdF9hcHByb3hEQ1QgIGFwcHJveERDVDsKLXN0cnVjdCBzdHJ1Y3RfYXBwcm94RENUCi17Ci0gICAgVm9pZCgqQmxvY2tEQ1Q4eDgpKEludCAqLCBJbnQgKiwgVUNoYXIgKiwgVUNoYXIgKiwgSW50LCBJbnQpOwotICAgIFZvaWQoKkJsb2NrRENUOHg4SW50cmEpKEludCAqLCBJbnQgKiwgVUNoYXIgKiwgVUNoYXIgKiwgSW50LCBJbnQpOwotICAgIFZvaWQoKkJsb2NrRENUOHg4d1N1YikoSW50ICosIEludCAqLCBVQ2hhciAqLCBVQ2hhciAqLCBJbnQsIEludCk7Ci19OwotCi0vKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLS8qICAgICAgICAgICAgICAgICAgUVAgc3RydWN0dXJlICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0KLXN0cnVjdCBRUHN0cnVjdAotewotICAgIEludCBRUHgyIDsKLSAgICBJbnQgUVA7Ci0gICAgSW50IFFQZGl2MjsKLSAgICBJbnQgUVB4MnBsdXM7Ci0gICAgSW50IEFkZGl0aW9uOwotfTsKLQotCi0jZW5kaWYgLyogX01QNExJQl9JTlRfSF8gKi8KLQpkaWZmIC0tZ2l0IGEvbWVkaWEvbGlic3RhZ2VmcmlnaHQvY29kZWNzL200dl9oMjYzL2VuYy9zcmMvcmF0ZV9jb250cm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BiaXRyYXRlIGFuZCBmcmFtZXJhdGUgKi8KLSAgICAgICAgcE1QW25dLT5iaXRyYXRlID0gcmNbbl0tPmJpdHJhdGU7Ci0gICAgICAgIHBNUFtuXS0+ZnJhbWVyYXRlID0gcmNbbl0tPmZyYW1lcmF0ZTsKLSAgICAgICAgcE1QW25dLT50YXJnZXRfYml0c19wZXJfZnJhbWUgPSBwTVBbbl0tPmJpdHJhdGUgLyBwTVBbbl0tPmZyYW1lcmF0ZTsKLQotICAgIH0KLQotICAgIHJldHVybiBQVl9TVUNDRVNTOwotfQotCi0KLS8qID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PSAqLwotLyogIEZ1bmN0aW9uIDogUkNfQ2xlYW51cCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgRGF0ZSAgICAgOiAxMi8yMC8yMDAwICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICBQdXJwb3NlICA6IGZyZWUgUmF0ZSBDb250cm9sIG1lbW9yeSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogIEluL291dCAgIDogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgUmV0dXJuICAgOiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICBNb2RpZmllZCA6ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09ICovCi0KLQotUFZfU1RBVFVTIFJDX0NsZWFudXAocmF0ZUNvbnRyb2wgKnJjW10sIEludCBudW1MYXllcnMpCi17Ci0gICAgT1NDTF9VTlVTRURfQVJHKHJjKTsKLSAgICBPU0NMX1VOVVNFRF9BUkcobnVtTGF5ZXJzKTsKLQotICAgIHJldHVybiBQVl9TVUNDRVNTOwotfQotCi0KLQotLyogPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09ICovCi0vKiAgRnVuY3Rpb24gOiBSQ19Wb3BRUFNldHRpbmcgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICBEYXRlICAgICA6IDQvMTEvMjAwMSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogIFB1cnBvc2UgIDogUmVzZXQgcmF0ZSBjb250cm9sIGJlZm9yZSBjb2RpbmcgVk9QLCBtb3ZlZCBmcm9tIHZvcC5jICAgICAgICovCi0vKiAgICAgICAgICAgICAgQ29tcHV0ZSBRUCBmb3IgdGhlIHdob2xlIFZPUCBhbmQgaW5pdGlhbGl6ZSBNQi1iYXNlZCBSQwotICAgICAgICAgICAgICAgIHJlc2V0IFFQTUJbXSwgY3VyclZvcC0+cXVhbnRpemVyLCByYy0+RWMsIHZpZGVvLT5oZWFkZXJfYml0cyAqLwotLyogdG8gICAgICAgICAgSW4gb3JkZXIgdG8gIHdvcmsgUkNfVm9wUVBTZXR0aW5nIGhhcyB0byBkbyB0aGUgZm9sbG93aW5ncwotICAgICAgICAgICAgICAgIDEuIFNldCB2aWRlby0+UVBNQiBvZiBhbGwgbWFjcm9ibG9ja3MuCi0gICAgICAgICAgICAgICAgMi4gU2V0IGN1cnJWb3AtPnF1YW50aXplcgotICAgICAgICAgICAgICAgIDMuIFJlc2V0IHZpZGVvLT5oZWFkZXJfYml0cyB0byB6ZXJvLgotICAgICAgICAgICAgICAgIDQuIEluaXRpYWxpemUgaW50ZXJuYWwgUkMgcGFyYW1ldGVycyBmb3IgVm9wIGNvb2RpbmcgICAgICAgICovCi0vKiAgSW4vb3V0ICAgOiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICBSZXR1cm4gICA6IFBWX1NUQVRVUyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogIE1vZGlmaWVkIDogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0gKi8KLS8qIFRvIGJlIG1vdmVkIHRvIHJhdGVfY29udHJvbC5jIGFuZCBzZXBhcmF0ZSBiZXR3ZWVuIEJYX1JDIGFuZCBBTk5FWF9MICAgICAqLwotCi1QVl9TVEFUVVMgUkNfVm9wUVBTZXR0aW5nKFZpZGVvRW5jRGF0YSAqdmlkZW8sIHJhdGVDb250cm9sICpwcmNbXSkKLXsKLSAgICBJbnQgY3VyckxheWVyID0gdmlkZW8tPmN1cnJMYXllcjsKLSAgICBWb2wgKmN1cnJWb2wgPSB2aWRlby0+dm9sW2N1cnJMYXllcl07Ci0gICAgVm9wICpjdXJyVm9wID0gdmlkZW8tPmN1cnJWb3A7Ci0jaWZkZWYgVEVTVF9NQkJBU0VEX1FQCi0gICAgaW50IGk7Ci0jZW5kaWYKLQotICAgIHJhdGVDb250cm9sICpyYyA9IHZpZGVvLT5yY1tjdXJyTGF5ZXJdOwotICAgIE11bHRpUGFzcyAqcE1QID0gdmlkZW8tPnBNUFtjdXJyTGF5ZXJdOwotCi0gICAgT1NDTF9VTlVTRURfQVJHKHByYyk7Ci0KLSAgICBpZiAodmlkZW8tPmVuY1BhcmFtcy0+UkNfVHlwZSA9PSBDT05TVEFOVF9RKQotICAgIHsKLSAgICAgICAgTTRWRU5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8qICBGdW5jdGlvbiA6IFNhdmVSRFNhbXBsZXMoKSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogIERhdGUgICAgIDogMDgvMjkvMjAwMSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgSGlzdG9yeSAgOiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICBQdXJwb3NlICA6IFNhdmUgUVAsIGFjdHVhbF9iaXRzLCBtYWQgYW5kIFJfRCBvZiB0aGUgY3VycmVudCBpdGVyYXRpb24gICAqLwotLyogIEluL291dCAgIDogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgUmV0dXJuICAgOiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICBNb2RpZmllZCA6ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0gKi8KLQotVm9pZCBTYXZlUkRTYW1wbGVzKE11bHRpUGFzcyAqcE1QLCBJbnQgY291bnRlcl9zYW1wbGVzKQotewotICAgIC8qIGZvciBwTVAtPnBSRFNhbXBsZXMgKi8KLSAgICBwTVAtPnBSRFNhbXBsZXNbcE1QLT5mcmFtZVBvc11bY291bnRlcl9zYW1wbGVzXS5RUCAgICA9IHBNUC0+UVA7Ci0gICAgcE1QLT5wUkRTYW1wbGVzW3BNUC0+ZnJhbWVQb3NdW2NvdW50ZXJfc2FtcGxlc10uYWN0dWFsX2JpdHMgPSBwTVAtPmFjdHVhbF9iaXRzOwotICAgIHBNUC0+cFJEU2FtcGxlc1twTVAtPmZyYW1lUG9zXVtjb3VudGVyX3NhbXBsZXNdLm1hZCAgID0gcE1QLT5tYWQ7Ci0gICAgcE1QLT5wUkRTYW1wbGVzW3BNUC0+ZnJhbWVQb3NdW2NvdW50ZXJfc2FtcGxlc10uUl9EID0gKGZsb2F0KShwTVAtPmFjdHVhbF9iaXRzIC8gKHBNUC0+bWFkICsgMC4wMDAxKSk7Ci0KLSAgICByZXR1cm4gOwotfQotLyogPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09ICovCi0vKiAgRnVuY3Rpb24gOiBSQ19Wb3BVcGRhdGVTdGF0ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICBEYXRlICAgICA6IDEyLzIwLzIwMDAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogIFB1cnBvc2UgIDogVXBkYXRlIHN0YXRpc3RpY3MgZm9yIHJhdGUgY29udHJvbCBhZnRlciBlbmNvZGluZyBlYWNoIFZPUC4gICovCi0vKiAgICAgICAgICAgICBObyBuZWVkIHRvIGNoYW5nZSBhbnl0aGluZyBpbiBWaWRlb0VuY0RhdGEgc3RydWN0dXJlLiAgICAgICAgKi8KLS8qICBJbi9vdXQgICA6ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogIFJldHVybiAgIDogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgTW9kaWZpZWQgOiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8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gKi8KLSAgICAgICAgICAgIHJjLT5IYyA9IHZpZGVvLT5oZWFkZXJfYml0czsgICAgLyogVG90YWwgQml0cyBpbiBIZWFkZXIgYW5kIE1vdGlvbiBWZWN0b3IgKi8KLQotICAgICAgICAgICAgLyogQlhfUkMgKi8KLSAgICAgICAgICAgIHVwZGF0ZVJhdGVDb250cm9sKHJjLCB2aWRlbyk7Ci0KLSAgICAgICAgICAgIGJyZWFrOwotCi0gICAgICAgIGRlZmF1bHQ6IC8qIGZvciBjYXNlIENCUl8xLzIsIFZCUl8xLzIgKi8KLQotICAgICAgICAgICAgcmV0dXJuIFBWX0ZBSUw7Ci0gICAgfQotCi0KLSAgICByZXR1cm4gUFZfU1VDQ0VTUzsKLX0KLQotLyogPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09ICovCi0vKiAgRnVuY3Rpb24gOiBSQ19HZXRTa2lwTmV4dEZyYW1lLCBSQ19HZXRSZW1haW5pbmdWb3BzICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICBEYXRlICAgICA6IDIvMjAvMjAwMSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogIFB1cnBvc2UgIDogVG8gYWNjZXNzIFJDIHBhcmFtZXRlcnMgZnJvbSBvdGhlciBwYXJ0cyBvZiB0aGUgY29kZS4gICAgICAgICovCi0vKiAgSW4vb3V0ICAgOiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICBSZXR1cm4gICA6ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogIE1vZGlmaWVkIDogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0gKi8KLQotSW50IFJDX0dldFNraXBOZXh0RnJhbWUoVmlkZW9FbmNEYXRhICp2aWRlbywgSW50IGN1cnJMYXllcikKLXsKLSAgICByZXR1cm4gdmlkZW8tPnJjW2N1cnJMYXllcl0tPnNraXBfbmV4dF9mcmFtZTsKLX0KLQotdm9pZCBSQ19SZXNldFNraXBOZXh0RnJhbWUoVmlkZW9FbmNEYXRhICp2aWRlbywgSW50IGN1cnJMYXllcikKLXsKLQotICAgIHZpZGVvLT5yY1tjdXJyTGF5ZXJdLT5za2lwX25leHRfZnJhbWUgPSAwOwotICAgIHJldHVybiA7Ci19Ci0KLS8qID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PSAqLwotLyogIEZ1bmN0aW9uIDogUkNfVXBkYXRlQnVmZmVyICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogIERhdGUgICAgIDogMi8yMC8yMDAxICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgUHVycG9zZSAgOiBVcGRhdGUgUkMgaW4gY2FzZSBvZiB0aGVyZSBhcmUgZnJhbWVzIHNraXBwZWQgKGNhbWVyYSBmcmVlemUpKi8KLS8qICAgICAgICAgICAgICBmcm9tIHRoZSBhcHBsaWNhdGlvbiBsZXZlbCBpbiBhZGRpdGlvbiB0byB3aGF0IFJDIHJlcXVlc3RlZCAqLwotLyogIEluL291dCAgIDogTnIsIEIsIFJyICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgUmV0dXJuICAgOiBWb2lkICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICBNb2RpZmllZCA6ICAgICAgICAgICAgICA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X2JpdHNfcGVyX2ZyYW1lIC8gMTApKTsKLSAgICB9Ci0KLSAgICByZXR1cm4gUFZfU1VDQ0VTUzsKLX0KLQotCi0vKiA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0gKi8KLS8qICBGdW5jdGlvbiA6IFJDX1VwZGF0ZUJYUkNQYXJhbXMgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogIERhdGUgICAgIDogNC8wOC8yMDAyICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgUHVycG9zZSAgOiBVcGRhdGUgUkMgcGFyYW1ldGVycyBzcGVjaWZpY2FsbHkgZm9yIHRhcmdldCBiaXRyYXRlIG9yICAgICAgKi8KLS8qICAgICAgICAgICAgIGZyYW1lcmF0ZSB1cGRhdGUgZHVyaW5nIGFuIGVuY29kaW5nIHNlc3Npb24gICAgICAgICAgICAgICAgICAqLwotLyogIEluL291dCAgIDogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgUmV0dXJuICAgOiBQVl9UUlVFIGlmIHN1Y2Nlc3NlZCwgUFZfRkFMU0UgaWYgZmFpbGVkLiAgICAgICAgICAgICAgICAgICAgKi8KLS8qICBNb2RpZmllZCA6ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09ICovCi0KLVBWX1NUQVRVUyBSQ19VcGRhdGVCWFJDUGFyYW1zKHZvaWQgKmlucHV0KQotewotICAgIFZpZGVvRW5jRGF0YSAqdmlkZW8gPSAoVmlkZW9FbmNEYXRhICopIGlucHV0OwotICAgIFZpZGVvRW5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1tuXS0+bWF4X0JpdFZhcmlhbmNlX251bSA9IChJbnQpKChmbG9hdCkocmNbbl0tPkJzIC0gcmNbbl0tPlZCVl9mdWxsbmVzcykvKChmbG9hdClMYXllckJpdFJhdGVbbl0vTGF5ZXJGcmFtZVJhdGVbbl0vMTAuMCkpLTU7Ci0gICAgICAgICAgICB9Ci0gICAgICAgICAgICBlbHNlICAgLy8gTVBFRy00IG5vcm1hbCBtb2RlcwotICAgICAgICAgICAgewotICAgICAgICAgICAgICAgIHJjW25dLT5tYXhfQml0VmFyaWFuY2VfbnVtID0gKEludCkoKGZsb2F0KShyY1tuXS0+QnMgLSBWQlZfZnVsbG5lc3MpICogMTAgLyAoKGZsb2F0KUxheWVyQml0UmF0ZVtuXSAvIExheWVyRnJhbWVSYXRlW25dKSkgLSA1OwotICAgICAgICAgICAgfQotICAgICAgICB9Ci0gICAgICAgIGVsc2UKLSAgICAgICAgewotICAgICAgICAgICAgaWYgKExheWVyRnJhbWVSYXRlW25dIC0gTGF5ZXJGcmFtZVJhdGVbbi0xXSA+IDApIC8qICA3LzMxLzAzICovCi0gICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgcmNbbl0tPlRNTl9USCA9IChJbnQpKChmbG9hdCkoTGF5ZXJCaXRSYXRlW25dIC0gTGF5ZXJCaXRSYXRlW24tMV0pIC8gKExheWVyRnJhbWVSYXRlW25dIC0gTGF5ZXJGcmFtZVJhdGVbbi0xXSkpOwotICAgICAgICAgICAgICAgIHJjW25dLT5tYXhfQml0VmFyaWFuY2VfbnVtID0gKEludCkoKGZsb2F0KShyY1tuXS0+QnMgLSBWQlZfZnVsbG5lc3MpICogMTAgLyAoKGZsb2F0KXJjW25dLT5UTU5fVEgpKSAtIDU7Ci0gICAgICAgICAgICAgICAgaWYgKHJjW25dLT5tYXhfQml0VmFyaWFuY2VfbnVtIDwgMCkgcmNbbl0tPm1heF9CaXRWYXJpYW5jZV9udW0gKz0gNTsKLSAgICAgICAgICAgIH0KLSAgICAgICA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BNUFtuXS0+c3VtX1FQID0gMDsKLSAgICAgICAgLy9wTVBbbl0tPmVuY29kZWRfZnJhbWVzX3ByZXYgPSBwTVBbbl0tPmVuY29kZWRfZnJhbWVzOwotICAgICAgICBwTVBbbl0tPmVuY29kZWRfZnJhbWVzID0gcE1QW25dLT5yZV9lbmNvZGVkX2ZyYW1lcyA9IHBNUFtuXS0+cmVfZW5jb2RlZF90aW1lcyA9IDA7Ci0KLSAgICB9IC8qIGVuZCBvZjogZm9yKG49MDsgbjxudW1MYXllcnM7IG4rKykgKi8KLQotICAgIHJldHVybiBQVl9TVUNDRVNTOwotCi19Ci0KLQotLyogPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0gKi8KLS8qICBGdW5jdGlvbiA6IHRhcmdldEJpdENhbGN1bGF0aW9uICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgRGF0ZSAgICAgOiAxMC8wMS8yMDAxICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogIFB1cnBvc2UgIDogcXVhZHJhdGljIGJpdCBhbGxvY2F0aW9uIG1vZGVsOiBUKG4pID0gQypzcXJ0KG1hZChuKS9hdmVyX21hZChuLTEpKSAgKi8KLS8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgSW4vb3V0ICAgOiByYy0+VCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogIFJldHVybiAgIDogVm9pZCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICBNb2RpZmllZCA6ICAgICAgICAgICA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VCA9IHJjLT5UTU5fVEggLSAoSW50KSgoZmxvYXQpcmMtPlRNTl9XL3JjLT5mcmFtZVJhdGUpOwotCi0gICAgaWYgKHZpZGVvLT5lbmNQYXJhbXMtPkgyNjNfRW5hYmxlZCAmJiByYy0+VCA+IHZpZGVvLT5lbmNQYXJhbXMtPm1heEZyYW1lU2l6ZSkKLSAgICB7Ci0gICAgICAgIHJjLT5UID0gdmlkZW8tPmVuY1BhcmFtcy0+bWF4RnJhbWVTaXplOyAgLy8gIGFkZGVkIHRoaXMgMTEvMDcvMDUKLSAgICB9Ci0KLX0KLQotLyogPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0gKi8KLS8qICBGdW5jdGlvbiA6IGNhbGN1bGF0ZVF1YW50aXplcl9NdWx0aXBhc3MgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgRGF0ZSAgICAgOiAxMC8wMS8yMDAxICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogIFB1cnBvc2UgIDogdmFyaWFibGUgcmF0ZSBiaXQgYWxsb2NhdGlvbiArIG5ldyBRUCBkZXRlcm1pbmF0aW9uIHNjaGVtZSAgICAgICAgICAgKi8KLS8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgSW4vb3V0ICAgOiByYy0+VCBhbmQgcmMtPlFjICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogIFJldHVybiAgIDogVm9pZCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICBNb2RpZmllZCA6ICAgICAgICAgICAgICAgICAgICAgICAg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VzsKLSAgICAgICAgcE1QLT5jb3VudGVyX0JUc3JjKys7Ci0gICAgICAgIHBNUC0+ZGlmZl9jb3VudGVyLS07Ci0gICAgfQotCi19Ci0KLQotLyogPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09ICovCi0vKiAgRnVuY3Rpb24gOiB1cGRhdGVSYXRlQ29udHJvbCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICBEYXRlICAgICA6IDExLzE3LzIwMDAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogIFB1cnBvc2UgIDpVcGRhdGUgdGhlIFJEIE1vZGFsIChBZnRlciBFbmNvZGluZyB0aGUgQ3VycmVudCBGcmFtZSkgICAgICAgICovCi0vKiAgSW4vb3V0ICAgOiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICBSZXR1cm4gICA6ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogIE1vZGlmaWVkIDogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0gKi8KLQotdm9pZCB1cGRhdGVSYXRlQ29udHJvbChyYXRlQ29udHJvbCAqcmMsIFZpZGVvRW5jRGF0YSAqdmlkZW8pCi17Ci0gICAgSW50ICBmcmFtZV9iaXRzOwotCi0KLSAgICAvKiByYXRlIGNvbnRyb1xsICovCi0gICAgZnJhbWVfYml0cyA9IChJbnQpKHJjLT5iaXRyYXRlIC8gcmMtPmZyYW1lcmF0ZSk7Ci0gICAgcmMtPlRNTl9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BmcmFtZSAqLwotICAgIHsKLSAgICAgICAgcmMtPlZCVl9mdWxsbmVzcyAtPSBmcmFtZV9iaXRzOyAvL3JjLT5ScDsKLSAgICAgICAgcmMtPnNraXBfbmV4dF9mcmFtZSA9IDE7Ci0gICAgICAgIC8qICBza2lwIG1vcmUgdGhhbiAxIGZyYW1lcyAgKi8KLSAgICAgICAgLy93aGlsZShyYy0+VkJWX2Z1bGxuZXNzID4gcmMtPkJzKjAuNDc1KQotICAgICAgICB3aGlsZSAoKHJjLT5WQlZfZnVsbG5lc3MgLSByYy0+VkJWX2Z1bGxuZXNzX29mZnNldCkgPiAocmMtPkJzIC8gMiAtIHJjLT5WQlZfZnVsbG5lc3Nfb2Zmc2V0KSowLjk1KQotICAgICAgICB7Ci0gICAgICAgICAgICByYy0+VkJWX2Z1bGxuZXNzIC09IGZyYW1lX2JpdHM7IC8vcmMtPlJwOwotICAgICAgICAgICAgcmMtPnNraXBfbmV4dF9mcmFtZSsrOwotICAgICAgICB9Ci0gICAgICAgIC8qIEVORCAgKi8KLSAgICB9Ci0KLX0KLQotLyogPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09ICovCi0vKiAgRnVuY3Rpb24gOiB1cGRhdGVSQ19Qb3N0UHJvYyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICBEYXRlICAgICA6IDA0LzA4LzIwMDIgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogIFB1cnBvc2UgIDogUmVtYWluZyBSQyB1cGRhdGUgc3R1ZmYgZm9yIGZyYW1lIHNraXAgYW5kIGJ1ZmZlciB1bmRlcmZsb3cgICovCi0vKiAgICAgICAgICAgICBjaGVjayAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICBJbi9vdXQgICA6ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogIFJldHVybiAgIDogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgTW9kaWZpZWQgOiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PSAqLwotdm9pZCB1cGRhdGVSQ19Qb3N0UHJvYyhyYXRlQ29udHJvbCAqcmMsIFZpZGVvRW5jRGF0YSAqdmlkZW8pCi17Ci0gICAgTXVsdGlQYXNzICpwTVAgPSB2aWRlby0+cE1QW3ZpZGVvLT5jdXJyTGF5ZXJdOwotCi0gICAgaWYgKHJjLT5za2lwX25leHRfZnJhbWUgPT0gMSAmJiAhcmMtPm5vX2ZyYW1lX3NraXApIC8qIHNraXAgbmV4dCBmcmFtZSAqLwotICAgIHsKLSAgICAgICAgcE1QLT5jb3VudGVyX0JUc3JjICs9IDEwICogcmMtPnNraXBfbmV4dF9mcmFtZTsKLQotICAgIH0KLSAgICBlbHNlIGlmIChyYy0+c2tpcF9uZXh0X2ZyYW1lID09IC0xICYmICFyYy0+bm9fcHJlX3NraXApIC8qIHNraXAgY3VycmVudCBmcmFtZSAqLwotICAgIHsKLSAgICAgICAgcE1QLT5jb3VudGVyX0JUZHN0IC09IHBNUC0+ZGlmZl9jb3VudGVyOwotICAgICAgICBwTVAtPmNvdW50ZXJfQlRzcmMgKz0gMTA7Ci0KLSAgICAgICAgcE1QLT5zdW1fbWFkIC09IHBNUC0+bWFkOwotICAgICAgICBwTVAtPmF2ZXJfbWFkID0gKHBNUC0+YXZlcl9tYWQgKiBwTVAtPmVuY29kZWRfZnJhbWVzIC0gcE1QLT5tYWQpIC8gKGZsb2F0KShw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kKLSNkZWZpbmUgTlVNX1NBRF9CTEsoKQotCi0jZW5kaWYKLQotCi0vKiBjb25zaXN0IG9mCi1JbnQgU0FEX01hY3JvYmxvY2tfQyhVQ2hhciAqcmVmLFVDaGFyICpibGssSW50IGRtaW4sSW50IGx4LHZvaWQgKmV4dHJhX2luZm8pCi1JbnQgU0FEX01CX0hURk1fQ29sbGVjdChVQ2hhciAqcmVmLFVDaGFyICpibGssSW50IGRtaW4sSW50IGx4LHZvaWQgKmV4dHJhX2luZm8pCi1JbnQgU0FEX01CX0hURk0oVUNoYXIgKnJlZixVQ2hhciAqYmxrLEludCBkbWluLEludCBseCx2b2lkICpleHRyYV9pbmZvKQotSW50IFNBRF9CbG9ja19DKFVDaGFyICpyZWYsVUNoYXIgKmJsayxJbnQgZG1pbixJbnQgbHgsdm9pZCAqZXh0cmFfaW5mbykKLUludCBTQURfQmxrX1BBRERJTkcoVUNoYXIgKnJlZixVQ2hhciAqY3VyLEludCBkbWluLEludCBseCx2b2lkICpleHRyYV9pbmZvKQotSW50IFNBRF9NQl9QQURESU5HKFVDaGFyICpyZWYsVUNoYXIgKmN1cixJbnQgZG1pbixJbnQgbHgsdm9pZCAqZXh0cmFfaW5mbykKLUludCBTQURfTUJfUEFEMShVQ2hhciAqcmVmLFVDaGFyICpjdXIsSW50IGRtaW4sSW50IGx4LEludCAqcmVwKTsKLUludCBTQURfTUJfUEFERElOR19IVEZNX0NvbGxlY3QoVUNoYXIgKnJlZixVQ2hhciAqY3VyLEludCBkbWluLEludCBseCx2b2lkICpleHRyYV9pbmZvKQotSW50IFNBRF9NQl9QQURESU5HX0hURk0oVUNoYXIgKnJlZixVQ2hhciAqY3VyLEludCBkbWluLEludCBseCx2b2lkICp2cHRyKQotKi8KLQotCi0jaWZkZWYgX19jcGx1c3BsdXMKLWV4dGVybiAiQyIKLXsKLSNlbmRpZgotCi0gICAgSW50IFNBRF9NQl9QQUQxKFVDaGFyICpyZWYsIFVDaGFyICpjdXIsIEludCBkbWluLCBJbnQgbHgsIEludCAqcmVwKTsKLQotCi0gICAgLyo9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KLSAgICAgICAgRnVuY3Rpb246ICAgU0FEX01hY3JvYmxvY2sKLSAgICAgICAgRGF0ZTogICAgICAgMDkvMDcvMjAwMAotICAgICAgICBQdXJwb3NlOiAgICBDb21wdXRlIFNBRCAxNngxNiBiZXR3ZWVuIGJsayBhbmQgcmVmLgotICAgICAgICBUbyBkbzogICAgICBVbmlmb3JtIHN1YnNhbXBsaW5nIHdpbGwgYmUgaW5zZXJ0ZWQgbGF0ZXIhCi0gICAgICAgICAgICAgICAgICAgIEh5cG90aGVzaXMgVGVzdGluZyBGYXN0IE1hdGNoaW5nIHRvIGJlIHVzZWQgbGF0ZXIhCi0gICAgICAgIENoYW5nZXM6Ci0gICAgMTEvNy8wMDogICAgIGltcGxlbWVudGVkIE1NWAotICAgIDEvMjQvMDE6ICAgICBpbXBsZW1lbnRlZCBTU0UKLSAgICA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0qLwotICAgIC8qKioqKioqKioqIEMgKioqKioqKioqKioqLwotICAgIEludCBTQURfTWFjcm9ibG9ja19DKFVDaGFyICpyZWYsIFVDaGFyICpibGssIEludCBkbWluX2x4LCB2b2lkICpleHRyYV9pbmZvKQotICAgIHsKLSAgICAgICAgaW50MzIgeDEwOwotICAgICAgICBJbnQgZG1pbiA9IChVTG9uZylkbWluX2x4ID4+IDE2OwotICAgICAgICBJbnQgbHggPSBkbWluX2x4ICYgMHhGRkZGOwotCi0gICAgICAgIE9TQ0xfVU5VU0VEX0FSRyhleHRyYV9pbmZvKTsKLQotICAgICAgICBOVU1fU0FEX01CX0NBTEwoKTsKLQotICAgICAgICB4MTAgPSBzaW1kX3NhZF9tYihyZWYsIGJsaywgZG1pbiwgbHgpOwotCi0gICAgICAgIHJldHVybiB4MTA7Ci0gICAgfQotCi0jaWZkZWYgSFRGTSAgIC8qIEhURk0gd2l0aCB1bmlmb3JtIHN1YnNhbXBsaW5nIGltcGxlbWVudGF0aW9uLCAyLzI4LzAxICovCi0gICAgLyo9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KLSAgICAgICAgRnVuY3Rpb246ICAgU0FEX01CX0hURk1fQ29sbGVjdCBhbmQgU0FEX01CX0hURk0KLSAgICAgICAgRGF0ZTogICAgICAgMy8yLzEKLSAgICAgICAgUHVycG9zZTogICAgQ29tcHV0ZSB0aGUgU0FEIG9uIGEgMTZ4MTYgYmxvY2sgdXNpbmcKLSAgICAgICAgICAgICAgICAgICAgdW5pZm9ybSBzdWJzYW1wbGluZyBhbmQgaHlwb3RoZXNpcyB0ZXN0aW5nIGZhc3QgbWF0Y2hpbmcKLSAgICAgICAgICAgICAgICAgICAgZm9yIGVhcmx5IGRyb3BvdXQuIFNBRF9NQl9IUF9IVEZNX0NvbGxlY3QgaXMgdG8gY29sbGVjdAotICAgICAgICAgICAgICAgICAgICB0aGUgc3RhdGlzdGljcyB0byBjb21wdXRlIHRoZSB0aHJlc2hvbGRzIHRvIGJlIHVzZWQgaW4KLSAgICAgICAgICAgICAgICAgICAgU0FEX01CX0hQX0hURk0uCi0gICAgICAgIElucHV0L091dHB1dDoKLSAgICAgICAgQ2hhbmdlczoKLSAgICAgID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PSovCi0KLSAgICBJbnQgU0FEX01CX0hURk1fQ29sbGVjdChVQ2hhciAqcmVmLCBVQ2hhciAqYmxrLCBJbnQgZG1pbl9seCwgdm9pZCAqZXh0cmFfaW5mbykKLSAgICB7Ci0gICAgICAgIEludCBpOwotICAgICAgICBJbnQgc2FkID0gMDsKLSAgICAgICAgVUNoYXIgKnAxOwotICAgICAgICBJbnQgbHg0ID0gKGRtaW5fbHggPDwgMikgJiAweDNGRkZDOwotICAgICAgICBVTG9uZyBjdXJfd29yZDsKLSAgICAgICAgSW50IHNhZGRhdGFbMTZdLCB0bXAsIHRtcDI7ICAgIC8qIHVzZWQgd2hlbiBjb2xsZWN0aW5nIGZsYWcgKGdsb2JhbCkgaXMgb24gKi8KLSAgICAgICAgSW50IGRpZm1hZDsKLSAgICAgICAgSFRGTV9TdGF0ICpodGZtX3N0YXQgPSAoSFRGTV9TdGF0KikgZXh0cmFfaW5mbzsKLSAgICAgICAgSW50ICphYnNfZGlmX21hZF9hdmcgPSAmKGh0Zm1fc3RhdC0+YWJzX2RpZl9tYWRfYXZnKTsKLSAgICAgICAgVUludCAqY291bnRicmVhayA9ICYoaHRmbV9zdGF0LT5jb3VudGJyZWFrKTsKLSAgICAgICAgSW50ICpvZmZzZXRSZWYgPSBodGZtX3N0YXQtPm9mZnNldFJlZjsKLQotICAgICAgICBOVU1fU0FEX01CX0NBTEwoKTsKLQotICAgICAgICBibGsgLT0gNDsKLSAgICAgICAgZm9yIChpID0gMDsgaSA8IDE2OyBpKyspCi0gICAgICAgIHsKLSAgICAgICAgICAgIHAxID0gcmVmICsgb2Zmc2V0UmVmW2ldOwotICAgICAgICAgICAgY3VyX3dvcmQgPSAqKChVTG9uZyopKGJsayArPSA0KSk7Ci0gICAgICAgICAgICB0bXAgPSBwMVsxMl07Ci0gICAgICAgICAgICB0bXAyID0gKGN1cl93b3JkID4+IDI0KSAmIDB4RkY7Ci0gICAgICAgICAgICBzYWQgPSBTVUJfU0FEKHNhZCwgdG1wLCB0bXAyKTsKLSAgICAgICAgICAgIHRtcCA9IHAxWzhdOwotICAgICAgICAgICAgdG1wMiA9IChjdXJfd29yZCA+PiAxNikgJiAweEZGOwotICAgICAgICAgICAgc2FkID0gU1VCX1NBRChzYWQsIHRtcCwgdG1wMik7Ci0gICAgICAgICAgICB0bXAgPSBwMVs0XTsKLSAgICAgICAgICAgIHRtcDIgPSAoY3VyX3dvcmQgPj4gOCkgJiAweEZGOwotICAgICAgICAgICAgc2FkID0gU1VCX1NBRChzYWQsIHRtcCwgdG1wMik7Ci0gICAgICAgICAgICB0bXAgPSBwMVswXTsKLSAgICAgICAgICAgIHAxICs9IGx4NDsKLSAgICAgICAgICAgIHRtcDIgPSAoY3VyX3dvcmQgJiAweEZGKTsKLSAgICAgICAgICAgIHNhZCA9IFNVQl9TQUQoc2FkLCB0bXAsIHRtcDIpOwotCi0gICAgICAgICAgICBjdXJfd29yZCA9ICooKFVMb25nKikoYmxrICs9IDQpKTsKLSAgICAgICAgICAgIHRtcCA9IHAxWzEyXTsKLSAgICAgICAgICAgIHRtcDIgPSAoY3VyX3dvcmQgPj4gMjQpICYgMHhGRjsKLSAgICAgICAgICAgIHNhZCA9IFNVQl9TQUQoc2FkLCB0bXAsIHRtcDIpOwotICAgICAgICAgICAgdG1wID0gcDFbOF07Ci0gICAgICAgICAgICB0bXAyID0gKGN1cl93b3JkID4+IDE2KSAmIDB4RkY7Ci0gICAgICAgICAgICBzYWQgPSBTVUJfU0FEKHNhZCwgdG1wLCB0bXAyKTsKLSAgICAgICAgICAgIHRtcCA9IHAxWzRdOwotICAgICAgICAgICAgdG1wMiA9IChjdXJfd29yZCA+PiA4KSAmIDB4RkY7Ci0gICAgICAgICAgICBzYWQgPSBTVUJfU0FEKHNhZCwgdG1wLCB0bXAyKTsKLSAgICAgICAgICAgIHRtcCA9IHAxWzBdOwotICAgICAgICAgICAgcDEgKz0gbHg0OwotICAgICAgICAgICAgdG1wMiA9IChjdXJfd29yZCAmIDB4RkYpOwotICAgICAgICAgICAgc2FkID0gU1VCX1NBRChzYWQsIHRtcCwgdG1wMik7Ci0KLSAgICAgICAgICAgIGN1cl93b3JkID0gKigoVUxvbmcqKShibGsgKz0gNCkpOwotICAgICAgICAgICAgdG1wID0gcDFbMTJdOwotICAgICAgICAgICAgdG1wMiA9IChjdXJfd29yZCA+PiAyNCkgJiAweEZGOwotICAgICAgICAgICAgc2FkID0gU1VCX1NBRChzYWQsIHRtcCwgdG1wMik7Ci0gICAgICAgICAgICB0bXAgPSBwMVs4XTsKLSAgICAgICAgICAgIHRtcDIgPSAoY3VyX3dvcmQgPj4gMTYpICYgMHhGRjsKLSAgICAgICAgICAgIHNhZCA9IFNVQl9TQUQoc2FkLCB0bXAsIHRtcDIpOwotICAgICAgICAgICAgdG1wID0gcDFbNF07Ci0gICAgICAgICAgICB0bXAyID0gKGN1cl93b3JkID4+IDgpICYgMHhGRjsKLSAgICAgICAgICAgIHNhZCA9IFNVQl9TQUQoc2FkLCB0bXAsIHRtcDIpOwotICAgICAgICAgICAgdG1wID0gcDFbMF07Ci0gICAgICAgICAgICBwMSArPSBseDQ7Ci0gICAgICAgICAgICB0bXAyID0gKGN1cl93b3JkICYgMHhGRik7Ci0gICAgICAgICAgICBzYWQgPSBTVUJfU0FEKHNhZCwgdG1wLCB0bXAyKTsKLQotICAgICAgICAgICAgY3VyX3dvcmQgPSAqKChVTG9uZyopKGJsayArPSA0KSk7Ci0gICAgICAgICAgICB0bXAgPSBwMVsxMl07Ci0gICAgICAgICAgICB0bXAyID0gKGN1cl93b3JkID4+IDI0KSAmIDB4RkY7Ci0gICAgICAgICAgICBzYWQgPSBTVUJfU0FEKHNhZCwgdG1wLCB0bXAyKTsKLSAgICAgICAgICAgIHRtcCA9IHAxWzhdOwotICAgICAgICAgICAgdG1wMiA9IChjdXJfd29yZCA+PiAxNikgJiAweEZGOwotICAgICAgICAgICAgc2FkID0gU1VCX1NBRChzYWQsIHRtcCwgdG1wMik7Ci0gICAgICAgICAgICB0bXAgPSBwMVs0XTsKLSAgICAgICAgICAgIHRtcDIgPSAoY3VyX3dvcmQgPj4gOCkgJiAweEZGOwotICAgICAgICAgICAgc2FkID0gU1VCX1NBRChzYWQsIHRtcCwgdG1wMik7Ci0gICAgICAgICAgICB0bXAgPSBwMVswXTsKLSAgICAgICAgICAgIHAxICs9IGx4NDsKLSAgICAgICAgICAgIHRtcDIgPSAoY3VyX3dvcmQgJiAweEZGKTsKLSAgICAgICAgICAgIHNhZCA9IFNVQl9TQUQoc2FkLCB0bXAsIHRtcDIpOwotCi0gICAgICAgICAgICBOVU1fU0FEX01CKCk7Ci0KLSAgICAgICAgICAgIHNhZGRhdGFbaV0gPSBzYWQ7Ci0KLSAgICAgICAgICAgIGlmIChpID4gMCkKLSAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICBpZiAoKFVMb25nKXNhZCA+ICgoVUxvbmcpZG1pbl9seCA+PiAxNikpCi0gICAgICAgICAgICAgICAgewotICAgICAgICAgICAgICAgICAgICBkaWZtYWQgPSBzYWRkYXRhWzBdIC0gKChzYWRkYXRhWzFdICsgMSkgPj4gMSk7Ci0gICAgICAgICAgICAgICAgICAgICgqYWJzX2RpZl9tYWRfYXZnKSArPSAoKGRpZm1hZCA+IDApID8gZGlmbWFkIDogLWRpZm1hZCk7Ci0gICAgICAgICAgICAgICAgICAgICgqY291bnRicmVhaykrKzsKLSAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHNhZDsKLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICB9Ci0gICAgICAgIH0KLQotICAgICAgICBkaWZtYWQgPSBzYWRkYXRhWzBdIC0gKChzYWRkYXRhWzFdICsgMSkgPj4gMSk7Ci0gICAgICAgICgqYWJzX2RpZl9tYWRfYXZnKSArPSAoKGRpZm1hZCA+IDApID8gZGlmbWFkIDogLWRpZm1hZCk7Ci0gICAgICAgICgqY291bnRicmVhaykrKzsKLSAgICAgICAgcmV0dXJuIHNhZDsKLSAgICB9Ci0KLSAgICBJbnQgU0FEX01CX0hURk0oVUNoYXIgKnJlZiwgVUNoYXIgKmJsaywgSW50IGRtaW5fbHgsIHZvaWQgKmV4dHJhX2luZm8pCi0gICAgewotICAgICAgICBJbnQgc2FkID0gMDsKLSAgICAgICAgVUNoYXIgKnAxOwotCi0gICAgICAgIEludCBpOwotICAgICAgICBJbnQgdG1wLCB0bXAyOwotICAgICAgICBJbnQgbHg0ID0gKGRtaW5fbHggPDwgMikgJiAweDNGRkZDOwotICAgICAgICBJbnQgc2Fkc3RhciA9IDAsIG1hZHN0YXI7Ci0gICAgICAgIEludCAqbnJtbHpfdGggPSAoSW50KikgZXh0cmFfaW5mbzsKLSAgICAgICAgSW50ICpvZmZzZXRSZWYgPSAoSW50KikgZXh0cmFfaW5mbyArIDMyOwotICAgICAgICBVTG9uZyBjdXJfd29yZDsKLQotICAgICAgICBtYWRzdGFyID0gKFVMb25nKWRtaW5fbHggPj4gMjA7Ci0KLSAgICAgICAgTlVNX1NBRF9NQl9DQUxMKCk7Ci0KLSAgICAgICAgYmxrIC09IDQ7Ci0gICAgICAgIGZvciAoaSA9IDA7IGkgPCAxNjsgaSsrKQotICAgICAgICB7Ci0gICAgICAgICAgICBwMSA9IHJlZiArIG9mZnNldFJlZltpXTsKLSAgICAgICAgICAgIGN1cl93b3JkID0gKigoVUxvbmcqKShibGsgKz0gNCkpOwotICAgICAgICAgICAgdG1wID0gcDFbMTJdOwotICAgICAgICAgICAgdG1wMiA9IChjdXJfd29yZCA+PiAyNCkgJiAweEZGOwotICAgICAgICAgICAgc2FkID0gU1VCX1NBRChzYWQsIHRtcCwgdG1wMik7Ci0gICAgICAgICAgICB0bXAgPSBwMVs4XTsKLSAgICAgICAgICAgIHRtcDIgPSAoY3VyX3dvcmQgPj4gMTYpICYgMHhGRjsKLSAgICAgICAgICAgIHNhZCA9IFNVQl9TQUQoc2FkLCB0bXAsIHRtcDIpOwotICAgICAgICAgICAgdG1wID0gcDFbNF07Ci0gICAgICAgICAgICB0bXAyID0gKGN1cl93b3JkID4+IDgpICYgMHhGRjsKLSAgICAgICAgICAgIHNhZCA9IFNVQl9TQUQoc2FkLCB0bXAsIHRtcDIpOwotICAgICAgICAgICAgdG1wID0gcDFbMF07Ci0gICAgICAgICAgICBwMSArPSBseDQ7Ci0gICAgICAgICAgICB0bXAyID0gKGN1cl93b3JkICYgMHhGRik7Ci0gICAgICAgICAgICBzYWQgPSBTVUJfU0FEKHNhZCwgdG1wLCB0bXAyKTsKLQotICAgICAgICAgICAgY3VyX3dvcmQgPSAqKChVTG9uZyopKGJsayArPSA0KSk7Ci0gICAgICAgICAgICB0bXAgPSBwMVsxMl07Ci0gICAgICAgICAgICB0bXAyID0gKGN1cl93b3JkID4+IDI0KSAmIDB4RkY7Ci0gICAgICAgICAgICBzYWQgPSBTVUJfU0FEKHNhZCwgdG1wLCB0bXAyKTsKLSAgICAgICAgICAgIHRtcCA9IHAxWzhdOwotICAgICAgICAgICAgdG1wMiA9IChjdXJfd29yZCA+PiAxNikgJiAweEZGOwotICAgICAgICAgICAgc2FkID0gU1VCX1NBRChzYWQsIHRtcCwgdG1wMik7Ci0gICAgICAgICAgICB0bXAgPSBwMVs0XTsKLSAgICAgICAgICAgIHRtcDIgPSAoY3VyX3dvcmQgPj4gOCkgJiAweEZGOwotICAgICAgICAgICAgc2FkID0gU1VCX1NBRChzYWQsIHRtcCwgdG1wMik7Ci0gICAgICAgICAgICB0bXAgPSBwMVswXTsKLSAgICAgICAgICAgIHAxICs9IGx4NDsKLSAgICAgICAgICAgIHRtcDIgPSAoY3VyX3dvcmQgJiAweEZGKTsKLSAgICAgICAgICAgIHNhZCA9IFNVQl9TQUQoc2FkLCB0bXAsIHRtcDIpOwotCi0gICAgICAgICAgICBjdXJfd29yZCA9ICooKFVMb25nKikoYmxrICs9IDQpKTsKLSAgICAgICAgICAgIHRtcCA9IHAxWzEyXTsKLSAgICAgICAgICAgIHRtcDIgPSAoY3VyX3dvcmQgPj4gMjQpICYgMHhGRjsKLSAgICAgICAgICAgIHNhZCA9IFNVQl9TQUQoc2FkLCB0bXAsIHRtcDIpOwotICAgICAgICAgICAgdG1wID0gcDFbOF07Ci0gICAgICAgICAgICB0bXAyID0gKGN1cl93b3JkID4+IDE2KSAmIDB4RkY7Ci0gICAgICAgICAgICBzYWQgPSBTVUJfU0FEKHNhZCwgdG1wLCB0bXAyKTsKLSAgICAgICAgICAgIHRtcCA9IHAxWzRdOwotICAgICAgICAgICAgdG1wMiA9IChjdXJfd29yZCA+PiA4KSAmIDB4RkY7Ci0gICAgICAgICAgICBzYWQgPSBTVUJfU0FEKHNhZCwgdG1wLCB0bXAyKTsKLSAgICAgICAgICAgIHRtcCA9IHAxWzBdOwotICAgICAgICAgICAgcDEgKz0gbHg0OwotICAgICAgICAgICAgdG1wMiA9IChjdXJfd29yZCAmIDB4RkYpOwotICAgICAgICAgICAgc2FkID0gU1VCX1NBRChzYWQsIHRtcCwgdG1wMik7Ci0KLSAgICAgICAgICAgIGN1cl93b3JkID0gKigoVUxvbmcqKShibGsgKz0gNCkpOwotICAgICAgICAgICAgdG1wID0gcDFbMTJdOwotICAgICAgICAgICAgdG1wMiA9IChjdXJfd29yZCA+PiAyNCkgJiAweEZGOwotICAgICAgICAgICAgc2FkID0gU1VCX1NBRChzYWQsIHRtcCwgdG1wMik7Ci0gICAgICAgICAgICB0bXAgPSBwMVs4XTsKLSAgICAgICAgICAgIHRtcDIgPSAoY3VyX3dvcmQgPj4gMTYpICYgMHhGRjsKLSAgICAgICAgICAgIHNhZCA9IFNVQl9TQUQoc2FkLCB0bXAsIHRtcDIpOwotICAgICAgICAgICAgdG1wID0gcDFbNF07Ci0gICAgICAgICAgICB0bXAyID0gKGN1cl93b3JkID4+IDgpICYgMHhGRjsKLSAgICAgICAgICAgIHNhZCA9IFNVQl9TQUQoc2FkLCB0bXAsIHRtcDIpOwotICAgICAgICAgICAgdG1wID0gcDFbMF07Ci0gICAgICAgICAgICBwMSArPSBseDQ7Ci0gICAgICAgICAgICB0bXAyID0gKGN1cl93b3JkICYgMHhGRik7Ci0gICAgICAgICAgICBzYWQgPSBTVUJfU0FEKHNhZCwgdG1wLCB0bXAyKTsKLQotICAgICAgICAgICAgTlVNX1NBRF9NQigpOwotCi0gICAgICAgICAgICBzYWRzdGFyICs9IG1hZHN0YXI7Ci0gICAgICAgICAgICBpZiAoKChVTG9uZylzYWQgPD0gKChVTG9uZylkbWluX2x4ID4+IDE2KSkgJiYgKHNhZCA8PSAoc2Fkc3RhciAtICpucm1sel90aCsrKSkpCi0gICAgICAgICAgICAgICAgOwotICAgICAgICAgICAgZWxzZQotICAgICAgICAgICAgICAgIHJldHVybiA2NTUzNjsKLSAgICAgICAgfQotCi0gICAgICAgIHJldHVybiBzYWQ7Ci0gICAgfQotI2VuZGlmIC8qIEhURk0gKi8KLQotI2lmbmRlZiBOT19JTlRFUjRWCi0gICAgLyo9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KLSAgICAgICAgRnVuY3Rpb246ICAgU0FEX0Jsb2NrCi0gICAgICAgIERhdGU6ICAgICAgIDA5LzA3LzIwMDAKLSAgICAgICAgUHVycG9zZTogICAgQ29tcHV0ZSBTQUQgMTZ4MTYgYmV0d2VlbiBibGsgYW5kIHJlZi4KLSAgICAgICAgVG8gZG86ICAgICAgVW5pZm9ybSBzdWJzYW1wbGluZyB3aWxsIGJlIGluc2VydGVkIGxhdGVyIQotICAgICAgICAgICAgICAgICAgICBIeXBvdGhlc2lzIFRlc3RpbmcgRmFzdCBNYXRjaGluZyB0byBiZSB1c2VkIGxhdGVyIQotICAgICAgICBDaGFuZ2VzOgotICAgIDExLzcvMDA6ICAgICBpbXBsZW1lbnRlZCBNTVgKLSAgICAxLzI0LzAxOiAgICAgaW1wbGVtZW50ZWQgU1NFCi0gICAgICA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0qLwotICAgIC8qKioqKioqKioqIEMgKioqKioqKioqKioqLwotICAgIEludCBTQURfQmxvY2tfQyhVQ2hhciAqcmVmLCBVQ2hhciAqYmxrLCBJbnQgZG1pbiwgSW50IGx4LCB2b2lkICopCi0gICAgewotICAgICAgICBJbnQgc2FkID0gMDsKLQotICAgICAgICBJbnQgaTsKLSAgICAgICAgVUNoYXIgKmlpOwotICAgICAgICBJbnQgKmtrOwotICAgICAgICBJbnQgdG1wLCB0bXAyLCB0bXAzLCBtYXNrID0gMHhGRjsKLSAgICAgICAgSW50IHdpZHRoID0gKGx4IC0gMzIpOwotCi0gICAgICAgIE5VTV9TQURfQkxLX0NBTEwoKTsKLQotICAgICAgICBpaSA9IHJlZjsKLSAgICAgICAga2sgID0gKEludCopYmxrOyAvKiBhc3N1bWluZyB3b3JkLWFsaWduIGZvciBibGsgKi8KLSAgICAgICAgZm9yIChpID0gMDsgaSA8IDg7IGkrKykKLSAgICAgICAgewotICAgICAgICAgICAgdG1wMyA9IGtrWzFdOwotICAgICAgICAgICAgdG1wID0gaWlbN107Ci0gICAgICAgICAgICB0bXAyID0gKFVJbnQpdG1wMyA+PiAyNDsKLSAgICAgICAgICAgIHNhZCA9IFNVQl9TQUQoc2FkLCB0bXAsIHRtcDIpOwotICAgICAgICAgICAgdG1wID0gaWlbNl07Ci0gICAgICAgICAgICB0bXAyID0gKHRtcDMgPj4gMTYpICYgbWFzazsKLSAgICAgICAgICAgIHNhZCA9IFNVQl9TQUQoc2FkLCB0bXAsIHRtcDIpOwotICAgICAgICAgICAgdG1wID0gaWlbNV07Ci0gICAgICAgICAgICB0bXAyID0gKHRtcDMgPj4gOCkgJiBtYXNrOwotICAgICAgICAgICAgc2FkID0gU1VCX1NBRChzYWQsIHRtcCwgdG1wMik7Ci0gICAgICAgICAgICB0bXAgPSBpaVs0XTsKLSAgICAgICAgICAgIHRtcDIgPSB0bXAzICYgbWFzazsKLSAgICAgICAgICAgIHNhZCA9IFNVQl9TQUQoc2FkLCB0bXAsIHRtcDIpOwotICAgICAgICAgICAgdG1wMyA9ICprazsKLSAgICAgICAgICAgIGtrICs9ICh3aWR0aCA+PiAyKTsKLSAgICAgICAgICAgIHRtcCA9IGlpWzNdOwotICAgICAgICAgICAgdG1wMiA9IChVSW50KXRtcDMgPj4gMjQ7Ci0gICAgICAgICAgICBzYWQgPSBTVUJfU0FEKHNhZCwgdG1wLCB0bXAyKTsKLSAgICA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DsKLVVMb25nIG51bV9zYWRfSFBfQmxrID0gMDsKLVVMb25nIG51bV9zYWRfSFBfTUJfY2FsbCA9IDA7Ci1VTG9uZyBudW1fc2FkX0hQX0Jsa19jYWxsID0gMDsKLSNkZWZpbmUgTlVNX1NBRF9IUF9NQl9DQUxMKCkgICAgbnVtX3NhZF9IUF9NQl9jYWxsKysKLSNkZWZpbmUgTlVNX1NBRF9IUF9NQigpICAgICAgICAgbnVtX3NhZF9IUF9NQisrCi0jZGVmaW5lIE5VTV9TQURfSFBfQkxLX0NBTEwoKSAgIG51bV9zYWRfSFBfQmxrX2NhbGwrKwotI2RlZmluZSBOVU1fU0FEX0hQX0JMSygpICAgICAgICBudW1fc2FkX0hQX0JsaysrCi0jZWxzZQotI2RlZmluZSBOVU1fU0FEX0hQX01CX0NBTEwoKQotI2RlZmluZSBOVU1fU0FEX0hQX01CKCkKLSNkZWZpbmUgTlVNX1NBRF9IUF9CTEtfQ0FMTCgpCi0jZGVmaW5lIE5VTV9TQURfSFBfQkxLKCkKLSNlbmRpZgotCi0KLSNpZmRlZiBfX2NwbHVzcGx1cwotZXh0ZXJuICJDIgotewotI2VuZGlmCi0gICAgLyo9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KLSAgICAgICAgRnVuY3Rpb246ICAgSGFsZlBlbDFfU0FEX01CCi0gICAgICAgIERhdGU6ICAgICAgIDAzLzI3LzIwMDEKLSAgICAgICAgUHVycG9zZTogICAgQ29tcHV0ZSBTQUQgMTZ4MTYgYmV0d2VlbiBibGsgYW5kIHJlZiBpbiBoYWxmcGVsCi0gICAgICAgICAgICAgICAgICAgIHJlc29sdXRpb24sCi0gICAgICAgIENoYW5nZXM6Ci0gICAgICA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0qLwotICAgIC8qIE9uZSBjb21wb25lbnQgaXMgaGFsZi1wZWwgKi8KLSAgICBJbnQgSGFsZlBlbDFfU0FEX01CKFVDaGFyICpyZWYsIFVDaGFyICpibGssIEludCBkbWluLCBJbnQgd2lkdGgsIEludCBpaCwgSW50IGpoKQotICAgIHsKLSAgICAgICAgSW50IGksIGo7Ci0gICAgICAgIEludCBzYWQgPSAwOwotICAgICAgICBVQ2hhciAqa2ssICpwMSwgKnAyOwotICAgICAgICBJbnQgdGVtcDsKLQotICAgICAgICBPU0NMX1VOVVNFRF9BUkcoamgpOwotCi0gICAgICAgIHAxID0gcmVmOwotICAgICAgICBpZiAoaWgpIHAyID0gcmVmICsgMTsKLSAgICAgICAgZWxzZSBwMiA9IHJlZiArIHdpZHRoOwotICAgICAgICBrayAgPSBibGs7Ci0KLSAgICAgICAgZm9yIChpID0gMDsgaSA8IDE2OyBpKyspCi0gICAgICAgIHsKLSAgICAgICAgICAgIGZvciAoaiA9IDA7IGogPCAxNjsgaisrKQotICAgICAgICAgICAgewotCi0gICAgICAgICAgICAgICAgdGVtcCA9ICgocDFbal0gKyBwMltqXSArIDEpID4+IDEpIC0gKmtrKys7Ci0gICAgICAgICAgICAgICAgc2FkICs9IFBWX0FCUyh0ZW1wKTsKLSAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgaWYgKHNhZCA+IGRtaW4pCi0gICAgICAgICAgICAgICAgcmV0dXJuIHNhZDsKLSAgICAgICAgICAgIHAxICs9IHdpZHRoOwotICAgICAgICAgICAgcDIgKz0gd2lkdGg7Ci0gICAgICAgIH0KLSAgICAgICAgcmV0dXJuIHNhZDsKLSAgICB9Ci0KLSAgICAvKiBUd28gY29tcG9uZW50cyBuZWVkIGhhbGYtcGVsICovCi0gICAgSW50IEhhbGZQZWwyX1NBRF9NQihVQ2hhciAqcmVmLCBVQ2hhciAqYmxrLCBJbnQgZG1pbiwgSW50IHdpZHRoKQotICAgIHsKLSAgICAgICAgSW50IGksIGo7Ci0gICAgICAgIEludCBzYWQgPSAwOwotICAgICAgICBVQ2hhciAqa2ssICpwMSwgKnAyLCAqcDMsICpwNDsKLSAgICAgICAgSW50IHRlbXA7Ci0KLSAgICAgICAgcDEgPSByZWY7Ci0gICAgICAgIHAyID0gcmVmICsgMTsKLSAgICAgICAgcDMgPSByZWYgKyB3aWR0aDsKLSAgICAgICAgcDQgPSByZWYgKyB3aWR0aCArIDE7Ci0gICAgICAgIGtrICA9IGJsazsKLQotICAgICAgICBmb3IgKGkgPSAwOyBpIDwgMTY7IGkrKykKLSAgICAgICAgewotICAgICAgICAgICAgZm9yIChqID0gMDsgaiA8IDE2OyBqKyspCi0gICAgICAgICAgICB7Ci0KLSAgICAgICAgICAgICAgICB0ZW1wID0gKChwMVtqXSArIHAyW2pdICsgcDNbal0gKyBwNFtqXSArIDIpID4+IDIpIC0gKmtrKys7Ci0gICAgICAgICAgICAgICAgc2FkICs9IFBWX0FCUyh0ZW1wKTsKLSAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgaWYgKHNhZCA+IGRtaW4pCi0gICAgICAgICAgICAgICAgcmV0dXJuIHNhZDsKLQotICAgICAgICAgICAgcDEgKz0gd2lkdGg7Ci0gICAgICAgICAgICBwMyArPSB3aWR0aDsKLSAgICAgICAgICAgIHAyICs9IHdpZHRoOwotICAgICAgICAgICAgcDQgKz0gd2lkdGg7Ci0gICAgICAgIH0KLSAgICAgICAgcmV0dXJuIHNhZDsKLSAgICB9Ci0KLSNpZm5kZWYgTk9fSU5URVI0VgotICAgIC8qPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09Ci0gICAgICAgIEZ1bmN0aW9uOiAgIEhhbGZQZWwxX1NBRF9CbGsKLSAgICAgICAgRGF0ZTogICAgICAgMDMvMjcvMjAwMQotICAgICAgICBQdXJwb3NlOiAgICBDb21wdXRlIFNBRCA4eDggYmV0d2VlbiBibGsgYW5kIHJlZiBpbiBoYWxmcGVsCi0gICAgICAgICAgICAgICAgICAgIHJlc29sdXRpb24uCi0gICAgICAgIENoYW5nZXM6Ci0gICAgICA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0qLwotICAgIC8qIE9uZSBjb21wb25lbnQgbmVlZHMgaGFsZi1wZWwgKi8KLSAgICBJbnQgSGFsZlBlbDFfU0FEX0JsayhVQ2hhciAqcmVmLCBVQ2hhciAqYmxrLCBJbnQgZG1pbiwgSW50IHdpZHRoLCBJbnQgaWgsIEludCBqaCkKLSAgICB7Ci0gICAgICAgIEludCBpLCBqOwotICAgICAgICBJbnQgc2FkID0gMDsKLSAgICAgICAgVUNoYXIgKmtrLCAqcDEsICpwMjsKLSAgICAgICAgSW50IHRlbXA7Ci0KLSAgICAgICAgT1NDTF9VTlVTRURfQVJHKGpoKTsKLQotICAgICAgICBwMSA9IHJlZjsKLSAgICAgICAgaWYgKGloKSBwMiA9IHJlZiArIDE7Ci0gICAgICAgIGVsc2UgcDIgPSByZWYgKyB3aWR0aDsKLSAgICAgICAga2sgID0gYmxrOwotCi0gICAgICAgIGZvciAoaSA9IDA7IGkgPCA4OyBpKyspCi0gICAgICAgIHsKLSAgICAgICAgICAgIGZvciAoaiA9IDA7IGogPCA4OyBqKyspCi0gICAgICAgICAgICB7Ci0KLSAgICAgICAgICAgICAgICB0ZW1wID0gKChwMVtqXSArIHAyW2pdICsgMSkgPj4gMSkgLSAqa2srKzsKLSAgICAgICAgICAgICAgICBzYWQgKz0gUFZfQUJTKHRlbXApOwotICAgICAgICAgICAgfQotCi0gICAgICAgICAgICBpZiAoc2FkID4gZG1pbikKLSAgICAgICAgICAgICAgICByZXR1cm4gc2FkOwotICAgICAgICAgICAgcDEgKz0gd2lkdGg7Ci0gICAgICAgICAgICBwMiArPSB3aWR0aDsKLSAgICAgICAgICAgIGtrICs9IDg7Ci0gICAgICAgIH0KLSAgICAgICAgcmV0dXJuIHNhZDsKLSAgICB9Ci0gICAgLyogVHdvIGNvbXBvbmVudHMgbmVlZCBoYWxmLXBlbCAqLwotICAgIEludCBIYWxmUGVsMl9TQURfQmxrKFVDaGFyICpyZWYsIFVDaGFyICpibGssIEludCBkbWluLCBJbnQgd2lkdGgpCi0gICAgewotICAgICAgICBJbnQgaSwgajsKLSAgICAgICAgSW50IHNhZCA9IDA7Ci0gICAgICAgIFVDaGFyICpraywgKnAxLCAqcDIsICpwMywgKnA0OwotICAgICAgICBJbnQgdGVtcDsKLQotICAgICAgICBwMSA9IHJlZjsKLSAgICAgICAgcDIgPSByZWYgKyAxOwotICAgICAgICBwMyA9IHJlZiArIHdpZHRoOwotICAgICAgICBwNCA9IHJlZiArIHdpZHRoICsgMTsKLSAgICAgICAga2sgID0gYmxrOwotCi0gICAgICAgIGZvciAoaSA9IDA7IGkgPCA4OyBpKyspCi0gICAgICAgIHsKLSAgICAgICAgICAgIGZvciAoaiA9IDA7IGogPCA4OyBqKyspCi0gICAgICAgICAgICB7Ci0KLSAgICAgICAgICAgICAgICB0ZW1wID0gKChwMVtqXSArIHAyW2pdICsgcDNbal0gKyBwNFtqXSArIDIpID4+IDIpIC0gKmtrKys7Ci0gICAgICAgICAgICAgICAgc2FkICs9IFBWX0FCUyh0ZW1wKTsKLSAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgaWYgKHNhZCA+IGRtaW4pCi0gICAgICAgICAgICAgICAgcmV0dXJuIHNhZDsKLQotICAgICAgICAgICAgcDEgKz0gd2lkdGg7Ci0gICAgICAgICAgICBwMyArPSB3aWR0aDsKLSAgICAgICAgICAgIHAyICs9IHdpZHRoOwotICAgICAgICAgICAgcDQgKz0gd2lkdGg7Ci0gICAgICAgICAgICBrayArPSA4OwotICAgICAgICB9Ci0gICAgICAgIHJldHVybiBzYWQ7Ci0gICAgfQotI2VuZGlmIC8vIE5PX0lOVEVSNFYKLSAgICAvKj09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQotICAgICAgICBGdW5jdGlvbjogICBTQURfTUJfSGFsZlBlbAotICAgICAgICBEYXRlOiAgICAgICAwOS8xNy8yMDAwCi0gICAgICAgIFB1cnBvc2U6ICAgIENvbXB1dGUgdGhlIFNBRCBvbiB0aGUgaGFsZi1wZWwgcmVzb2x1dGlvbgotICAgICAgICBJbnB1dC9PdXRwdXQ6ICAgaG1lbSBpcyBhc3N1bWVkIHRvIGJlIGEgcG9pbnRlciB0byB0aGUgc3RhcnRpbmcKLSAgICAgICAgICAgICAgICAgICAgcG9pbnQgb2YgdGhlIHNlYXJjaCBpbiB0aGUgMzN4MzMgbWF0cml4IHNlYXJjaCByZWdpb24KLSAgICAgICAgQ2hhbmdlczoKLSAgICAxMS83LzAwOiAgICAgaW1wbGVtZW50ZWQgTU1YCi0gICAgICA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0qLwotICAgIC8qPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09Ci0gICAgICAgIEZ1bmN0aW9uOiAgIFNBRF9NQl9IYWxmUGVsX0MKLSAgICAgICAgRGF0ZTogICAgICAgMDQvMzAvMjAwMQotICAgICAgICBQdXJwb3NlOiAgICBDb21wdXRlIFNBRCAxNngxNiBiZXR3ZWVuIGJsayBhbmQgcmVmIGluIGhhbGZwZWwKLSAgICAgICAgICAgICAgICAgICAgcmVzb2x1dGlvbiwKLSAgICAgICAgQ2hhbmdlczoKLSAgICAgID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PSovCi0gICAgLyogT25lIGNvbXBvbmVudCBpcyBoYWxmLXBlbCAqLwotICAgIEludCBTQURfTUJfSGFsZlBlbF9DeGh5aChVQ2hhciAqcmVmLCBVQ2hhciAqYmxrLCBJbnQgZG1pbl9yeCwgdm9pZCAqZXh0cmFfaW5mbykKLSAgICB7Ci0gICAgICAgIEludCBpLCBqOwotICAgICAgICBJbnQgc2FkID0gMDsKLSAgICAgICAgVUNoYXIgKmtrLCAqcDEsICpwMiwgKnAzLCAqcDQ7Ci0vLyAgSW50IHN1bXJlZj0wOwotICAgICAgICBJbnQgdGVtcDsKLSAgICAgICAgSW50IHJ4ID0gZG1pbl9yeCAmIDB4RkZGRjsKLQotICAgICAgICBPU0NMX1VOVVNFRF9BUkcoZXh0cmFfaW5mbyk7Ci0KLSAgICAgICAgTlVNX1NBRF9IUF9NQl9DQUxMKCk7Ci0KLSAgICAgICAgcDEgPSByZWY7Ci0gICAgICAgIHAyID0gcmVmICsgMTsKLSAgICAgICAgcDMgPSByZWYgKyByeDsKLSAgICAgICAgcDQgPSByZWYgKyByeCArIDE7Ci0gICAgICAgIGtrICA9IGJsazsKLQotICAgICAgICBmb3IgKGkgPSAwOyBpIDwgMTY7IGkrKykKLSAgICAgICAgewotICAgICAgICAgICAgZm9yIChqID0gMDsgaiA8IDE2OyBqKyspCi0gICAgICAgICAgICB7Ci0KLSAgICAgICAgICAgICAgICB0ZW1wID0gKChwMVtqXSArIHAyW2pdICsgcDNbal0gKyBwNFtqXSArIDIpID4+IDIpIC0gKmtrKys7Ci0gICAgICAgICAgICAgICAgc2FkICs9IFBWX0FCUyh0ZW1wKTsKLSAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgTlVNX1NBRF9IUF9NQigpOwotCi0gICAgICAgICAgICBpZiAoc2FkID4gKEludCkoKFVMb25nKWRtaW5fcnggPj4gMTYpKQotICAgICAgICAgICAgICAgIHJldHVybiBzYWQ7Ci0KLSAgICAgICAgICAgIHAxICs9IHJ4OwotICAgICAgICAgICAgcDMgKz0gcng7Ci0gICAgICAgICAgICBwMiArPSByeDsKLSAgICAgICAgICAgIHA0ICs9IHJ4OwotICAgICAgICB9Ci0gICAgICAgIHJldHVybiBzYWQ7Ci0gICAgfQotCi0gICAgSW50IFNBRF9NQl9IYWxmUGVsX0N5aChVQ2hhciAqcmVmLCBVQ2hhciAqYmxrLCBJbnQgZG1pbl9yeCwgdm9pZCAqZXh0cmFfaW5mbykKLSAgICB7Ci0gICAgICAgIEludCBpLCBqOwotICAgICAgICBJbnQgc2FkID0gMDsKLSAgICAgICAgVUNoYXIgKmtrLCAqcDEsICpwMjsKLS8vICBJbnQgc3VtcmVmPTA7Ci0gICAgICAgIEludCB0ZW1wOwotICAgICAgICBJbnQgcnggPSBkbWluX3J4ICYgMHhGRkZGOwotCi0gICAgICAgIE9TQ0xfVU5VU0VEX0FSRyhleHRyYV9pbmZvKTsKLQotICAgICAgICBOVU1fU0FEX0hQX01CX0NBTEwoKTsKLQotICAgICAgICBwMSA9IHJlZjsKLSAgICAgICAgcDIgPSByZWYgKyByeDsgLyogZWl0aGVyIGxlZnQvcmlnaHQgb3IgdG9wL2JvdHRvbSBwaXhlbCAqLwotICAgICAgICBrayAgPSBibGs7Ci0KLSAgICAgICAgZm9yIChpID0gMDsgaSA8IDE2OyBpKyspCi0gICAgICAgIHsKLSAgICAgICAgICAgIGZvciAoaiA9IDA7IGogPCAxNjsgaisrKQotICAgICAgICAgICAgewotCi0gICAgICAgICAgICAgICAgdGVtcCA9ICgocDFbal0gKyBwMltqXSArIDEpID4+IDEpIC0gKmtrKys7Ci0gICAgICAgICAgICAgICAgc2FkICs9IFBWX0FCUyh0ZW1wKTsKLSAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgTlVNX1NBRF9IUF9NQigpOwotCi0gICAgICAgICAgICBpZiAoc2FkID4gKEludCkoKFVMb25nKWRtaW5fcnggPj4gMTYpKQotICAgICAgICAgICAgICAgIHJldHVybiBzYWQ7Ci0gICAgICAgICAgICBwMSArPSByeDsKLSAgICAgICAgICAgIHAyICs9IHJ4OwotICAgICAgICB9Ci0gICAgICAgIHJldHVybiBzYWQ7Ci0gICAgfQotCi0gICAgSW50IFNBRF9NQl9IYWxmUGVsX0N4aChVQ2hhciAqcmVmLCBVQ2hhciAqYmxrLCBJbnQgZG1pbl9yeCwgdm9pZCAqZXh0cmFfaW5mbykKLSAgICB7Ci0gICAgICAgIEludCBpLCBqOwotICAgICAgICBJbnQgc2FkID0gMDsKLSAgICAgICAgVUNoYXIgKmtrLCAqcDE7Ci0vLyAgSW50IHN1bXJlZj0wOwotICAgICAgICBJbnQgdGVtcDsKLSAgICAgICAgSW50IHJ4ID0gZG1pbl9yeCAmIDB4RkZGRjsKLQotICAgICAgICBPU0NMX1VOVVNFRF9BUkcoZXh0cmFfaW5mbyk7Ci0KLSAgICAgICAgTlVNX1NBRF9IUF9NQl9DQUxMKCk7Ci0KLSAgICAgICAgcDEgPSByZWY7Ci0gICAgICAgIGtrICA9IGJsazsKLQotICAgICAgICBmb3IgKGkgPSAwOyBpIDwgMTY7IGkrKykKLSAgICAgICAgewotICAgICAgICAgICAgZm9yIChqID0gMDsgaiA8IDE2OyBqKyspCi0gICAgICAgICAgICB7Ci0KLSAgICAgICAgICAgICAgICB0ZW1wID0gKChwMVtqXSArIHAxW2orMV0gKyAxKSA+PiAxKSAtICpraysrOwotICAgICAgICAgICAgICAgIHNhZCArPSBQVl9BQlModGVtcCk7Ci0gICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgIE5VTV9TQURfSFBfTUIoKTsKLQotICAgICAgICAgICAgaWYgKHNhZCA+IChJbnQpKChVTG9uZylkbWluX3J4ID4+IDE2KSkKLSAgICAgICAgICAgICAgICByZXR1cm4gc2FkOwotICAgICAgICAgICAgcDEgKz0gcng7Ci0gICAgICAgIH0KLSAgICAgICAgcmV0dXJuIHNhZDsKLSAgICB9Ci0KLSNpZmRlZiBIVEZNICAvKiBIVEZNIHdpdGggdW5pZm9ybSBzdWJzYW1wbGluZyBpbXBsZW1lbnRhdGlvbiwgMi8yOC8wMSAqLwotCi0vL0NoZWNoZWNrIGhlcmUKLSAgICBJbnQgU0FEX01CX0hQX0hURk1fQ29sbGVjdHhoeWgoVUNoYXIgKnJlZiwgVUNoYXIgKmJsaywgSW50IGRtaW5fcngsIHZvaWQgKmV4dHJhX2luZm8pCi0gICAgewotICAgICAgICBJbnQgaSwgajsKLSAgICAgICAgSW50IHNhZCA9IDA7Ci0gICAgICAgIFVDaGFyICpwMSwgKnAyOwotICAgICAgICBJbnQgcnggPSBkbWluX3J4ICYgMHhGRkZGOwotICAgICAgICBJbnQgcmVmd3g0ID0gcnggPDwgMjsKLSAgICAgICAgSW50IHNhZGRhdGFbMTZdOyAgICAgIC8qIHVzZWQgd2hlbiBjb2xsZWN0aW5nIGZsYWcgKGdsb2JhbCkgaXMgb24gKi8KLSAgICAgICAgSW50IGRpZm1hZCwgdG1wLCB0bXAyOwotICAgICAgICBIVEZNX1N0YXQgKmh0Zm1fc3RhdCA9IChIVEZNX1N0YXQqKSBleHRyYV9pbmZvOwotICAgICAgICBJbnQgKmFic19kaWZfbWFkX2F2ZyA9ICYoaHRmbV9zdGF0LT5hYnNfZGlmX21hZF9hdmcpOwotICAgICAgICBVSW50ICpjb3VudGJyZWFrID0gJihodGZtX3N0YXQtPmNvdW50YnJlYWspOwotICAgICAgICBJbnQgKm9mZnNldFJlZiA9IGh0Zm1fc3RhdC0+b2Zmc2V0UmVmOwotICAgICAgICBVTG9uZyBjdXJfd29yZDsKLQotICAgICAgICBOVU1fU0FEX0hQX01CX0NBTEwoKTsKLQotICAgICAgICBibGsgLT0gNDsKLQotICAgICAgICBmb3IgKGkgPSAwOyBpIDwgMTY7IGkrKykgLyogMTYgc3RhZ2VzICovCi0gICAgICAgIHsKLSAgICAgICAgICAgIHAxID0gcmVmICsgb2Zmc2V0UmVmW2ldOwotICAgICAgICAgICAgcDIgPSBwMSArIHJ4OwotCi0gICAgICAgICAgICBqID0gNDsvKiA0IGxpbmVzICovCi0gICAgICAgICAgICBkbwotICAgICAgICAgICAgewotICAgICAgICAgICAgICAgIGN1cl93b3JkID0gKigoVUxvbmcqKShibGsgKz0gNCkpOwotICAgICAgICAgICAgICAgIHRtcCA9IHAxWzEyXSArIHAyWzEyXTsKLSAgICAgICAgICAgICAgICB0bXAyID0gcDFbMTNdICsgcDJbMTNdOwotICAgICAgICAgICAgICAgIHRtcCArPSB0bXAyOwotICAgICAgICAgICAgICAgIHRtcDIgPSAoY3VyX3dvcmQgPj4gMjQpICYgMHhGRjsKLSAgICAgICAgICAgICAgICB0bXAgKz0gMjsKLSAgICAgICAgICAgICAgICBzYWQgPSBJTlRFUlAyX1NVQl9TQUQoc2FkLCB0bXAsIHRtcDIpOzsKLSAgICAgICAgICAgICAgICB0bXAgPSBwMVs4XSArIHAyWzhdOwotICAgICAgICAgICAgICAgIHRtcDIgPSBwMVs5XSArIHAyWzldOwotICAgICAgICAgICAgICAgIHRtcCArPSB0bXAyOwotICAgICAgICAgICAgICAgIHRtcDIgPSAoY3VyX3dvcmQgPj4gMTYpICYgMHhGRjsKLSAgICAgICAgICAgICAgICB0bXAgKz0gMjsKLSAgICAgICAgICAgICAgICBzYWQgPSBJTlRFUlAyX1NVQl9TQUQoc2FkLCB0bXAsIHRtcDIpOzsKLSAgICAgICAgICAgICAgICB0bXAgPSBwMVs0XSArIHAyWzRdOwotICAgICAgICAgICAgICAgIHRtcDIgPSBwMVs1XSArIHAyWzVdOwotICAgICAgICAgICAgICAgIHRtcCArPSB0bXAyOwotICAgICAgICAgICAgICAgIHRtcDIgPSAoY3VyX3dvcmQgPj4gOCkgJiAweEZGOwotICAgICAgICAgICAgICAgIHRtcCArPSAyOwotICAgICAgICAgICAgICAgIHNhZCA9IElOVEVSUDJfU1VCX1NBRChzYWQsIHRtcCwgdG1wMik7OwotICAgICAgICAgICAgICAgIHRtcDIgPSBwMVsxXSArIHAyWzFdOwotICAgICAgICAgICAgICAgIHRtcCA9IHAxWzBdICsgcDJbMF07Ci0gICAgICAgICAgICAgICAgcDEgKz0gcmVmd3g0OwotICAgICAgICAgICAgICAgIHAyICs9IHJlZnd4NDsKLSAgICAgICAgICAgICAgICB0bXAgKz0gdG1wMjsKLSAgICAgICAgICAgICAgICB0bXAyID0gKGN1cl93b3JkICYgMHhGRik7Ci0gICAgICAgICAgICAgICAgdG1wICs9IDI7Ci0gICAgICAgICAgICAgICAgc2FkID0gSU5URVJQMl9TVUJfU0FEKHNhZCwgdG1wLCB0bXAyKTs7Ci0gICAgICAgICAgICB9Ci0gICAgICAgICAgICB3aGlsZSAoLS1qKTsKLQotICAgICAgICAgICAgTlVNX1NBRF9IUF9NQigpOwotCi0gICAgICAgICAgICBzYWRkYXRhW2ldID0gc2FkOwotCi0gICAgICAgICAgICBpZiAoaSA+IDApCi0gICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgaWYgKHNhZCA+IChJbnQpKChVTG9uZylkbWluX3J4ID4+IDE2KSkKLSAgICAgICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgICAgIGRpZm1hZCA9IHNhZGRhdGFbMF0gLSAoKHNhZGRhdGFbMV0gKyAxKSA+PiAxKTsKLSAgICAgICAgICAgICAgICAgICAgKCphYnNfZGlmX21hZF9hdmcpICs9ICgoZGlmbWFkID4gMCkgPyBkaWZtYWQgOiAtZGlmbWFkKTsKLSAgICAgICAgICAgICAgICAgICAgKCpjb3VudGJyZWFrKSsrOwotICAgICAgICAgICAgICAgICAgICByZXR1cm4gc2FkOwotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgIH0KLSAgICAgICAgfQotICAgICAgICBkaWZtYWQgPSBzYWRkYXRhWzBdIC0gKChzYWRkYXRhWzFdICsgMSkgPj4gMSk7Ci0gICAgICAgICgqYWJzX2RpZl9tYWRfYXZnKSArPSAoKGRpZm1hZCA+IDApID8gZGlmbWFkIDogLWRpZm1hZCk7Ci0gICAgICAgICgqY291bnRicmVhaykrKzsKLQotICAgICAgICByZXR1cm4gc2FkOwotICAgIH0KLQotICAgIEludCBTQURfTUJfSFBfSFRGTV9Db2xsZWN0eWgoVUNoYXIgKnJlZiwgVUNoYXIgKmJsaywgSW50IGRtaW5fcngsIHZvaWQgKmV4dHJhX2luZm8pCi0gICAgewotICAgICAgICBJbnQgaSwgajsKLSAgICAgICAgSW50IHNhZCA9IDA7Ci0gICAgICAgIFVDaGFyICpwMSwgKnAyOwotICAgICAgICBJbnQgcnggPSBkbWluX3J4ICYgMHhGRkZGOwotICAgICAgICBJbnQgcmVmd3g0ID0gcnggPDwgMjsKLSAgICAgICAgSW50IHNhZGRhdGFbMTZdOyAgICAgIC8qIHVzZWQgd2hlbiBjb2xsZWN0aW5nIGZsYWcgKGdsb2JhbCkgaXMgb24gKi8KLSAgICAgICAgSW50IGRpZm1hZCwgdG1wLCB0bXAyOwotICAgICAgICBIVEZNX1N0YXQgKmh0Zm1fc3RhdCA9IChIVEZNX1N0YXQqKSBleHRyYV9pbmZvOwotICAgICAgICBJbnQgKmFic19kaWZfbWFkX2F2ZyA9ICYoaHRmbV9zdGF0LT5hYnNfZGlmX21hZF9hdmcpOwotICAgICAgICBVSW50ICpjb3VudGJyZWFrID0gJihodGZtX3N0YXQtPmNvdW50YnJlYWspOwotICAgICAgICBJbnQgKm9mZnNldFJlZiA9IGh0Zm1fc3RhdC0+b2Zmc2V0UmVmOwotICAgICAgICBVTG9uZyBjdXJfd29yZDsKLQotICAgICAgICBOVU1fU0FEX0hQX01CX0NBTEwoKTsKLQotICAgICAgICBibGsgLT0gNDsKLQotICAgICAgICBmb3IgKGkgPSAwOyBpIDwgMTY7IGkrKykgLyogMTYgc3RhZ2VzICovCi0gICAgICAgIHsKLSAgICAgICAgICAgIHAxID0gcmVmICsgb2Zmc2V0UmVmW2ldOwotICAgICAgICAgICAgcDIgPSBwMSArIHJ4OwotICAgICAgICAgICAgaiA9IDQ7Ci0gICAgICAgICAgICBkbwotICAgICAgICAgICAgewotICAgICAgICAgICAgICAgIGN1cl93b3JkID0gKigoVUxvbmcqKShibGsgKz0gNCkpOwotICAgICAgICAgICAgICAgIHRtcCA9IHAxWzEyXTsKLSAgICAgICAgICAgICAgICB0bXAyID0gcDJbMTJdOwotICAgICAgICAgICAgICAgIHRtcCsrOwotICAgICAgICAgICAgICAgIHRtcDIgKz0gdG1wOwotICAgICAgICAgICAgICAgIHRtcCA9IChjdXJfd29yZCA+PiAyNCkgJiAweEZGOwotICAgICAgICAgICAgICAgIHNhZCA9IElOVEVSUDFfU1VCX1NBRChzYWQsIHRtcCwgdG1wMik7OwotICAgICAgICAgICAgICAgIHRtcCA9IHAxWzhdOwotICAgICAgICAgICAgICAgIHRtcDIgPSBwMls4XTsKLSAgICAgICAgICAgICAgICB0bXArKzsKLSAgICAgICAgICAgICAgICB0bXAyICs9IHRtcDsKLSAgICAgICAgICAgICAgICB0bXAgPSAoY3VyX3dvcmQgPj4gMTYpICYgMHhGRjsKLSAgICAgICAgICAgICAgICBzYWQgPSBJTlRFUlAxX1NVQl9TQUQoc2FkLCB0bXAsIHRtcDIpOzsKLSAgICAgICAgICAgICAgICB0bXAgPSBwMVs0XTsKLSAgICAgICAgICAgICAgICB0bXAyID0gcDJbNF07Ci0gICAgICAgICAgICAgICAgdG1wKys7Ci0gICAgICAgICAgICAgICAgdG1wMiArPSB0bXA7Ci0gICAgICAgICAgICAgICAgdG1wID0gKGN1cl93b3JkID4+IDgpICYgMHhGRjsKLSAgICAgICAgICAgICAgICBzYWQgPSBJTlRFUlAxX1NVQl9TQUQoc2FkLCB0bXAsIHRtcDIpOzsKLSAgICAgICAgICAgICAgICB0bXAgPSBwMVswXTsKLSAgICAgICAgICAgICAgICBwMSArPSByZWZ3eDQ7Ci0gICAgICAgICAgICAgICAgdG1wMiA9IHAyWzBdOwotICAgICAgICAgICAgICAgIHAyICs9IHJlZnd4NDsKLSAgICAgICAgICAgICAgICB0bXArKzsKLSAgICAgICAgICAgICAgICB0bXAyICs9IHRtcDsKLSAgICAgICAgICAgICAgICB0bXAgPSAoY3VyX3dvcmQgJiAweEZGKTsKLSAgICAgICAgICAgICAgICBzYWQgPSBJTlRFUlAxX1NVQl9TQUQoc2FkLCB0bXAsIHRtcDIpOzsKLSAgICAgICAgICAgIH0KLSAgICAgICAgICAgIHdoaWxlICgtLWopOwotCi0gICAgICAgICAgICBOVU1fU0FEX0hQX01CKCk7Ci0KLSAgICAgICAgICAgIHNhZGRhdGFbaV0gPSBzYWQ7Ci0KLSAgICAgICAgICAgIGlmIChpID4gMCkKLSAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICBpZiAoc2FkID4gKEludCkoKFVMb25nKWRtaW5fcnggPj4gMTYpKQotICAgICAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAgICAgZGlmbWFkID0gc2FkZGF0YVswXSAtICgoc2FkZGF0YVsxXSArIDEpID4+IDEpOwotICAgICAgICAgICAgICAgICAgICAoKmFic19kaWZfbWFkX2F2ZykgKz0gKChkaWZtYWQgPiAwKSA/IGRpZm1hZCA6IC1kaWZtYWQpOwotICAgICAgICAgICAgICAgICAgICAoKmNvdW50YnJlYWspKys7Ci0gICAgICAgICAgICAgICAgICAgIHJldHVybiBzYWQ7Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgfQotICAgICAgICB9Ci0gICAgICAgIGRpZm1hZCA9IHNhZGRhdGFbMF0gLSAoKHNhZGRhdGFbMV0gKyAxKSA+PiAxKTsKLSAgICAgICAgKCphYnNfZGlmX21hZF9hdmcpICs9ICgoZGlmbWFkID4gMCkgPyBkaWZtYWQgOiAtZGlmbWFkKTsKLSAgICAgICAgKCpjb3VudGJyZWFrKSsrOwotCi0gICAgICAgIHJldHVybiBzYWQ7Ci0gICAgfQotCi0gICAgSW50IFNBRF9NQl9IUF9IVEZNX0NvbGxlY3R4aChVQ2hhciAqcmVmLCBVQ2hhciAqYmxrLCBJbnQgZG1pbl9yeCwgdm9pZCAqZXh0cmFfaW5mbykKLSAgICB7Ci0gICAgICAgIEludCBpLCBqOwotICAgICAgICBJbnQgc2FkID0gMDsKLSAgICAgICAgVUNoYXIgKnAxOwotICAgICAgICBJbnQgcnggPSBkbWluX3J4ICYgMHhGRkZGOwotICAgICAgICBJbnQgcmVmd3g0ID0gcnggPDwgMjsKLSAgICAgICAgSW50IHNhZGRhdGFbMTZdOyAgICAgIC8qIHVzZWQgd2hlbiBjb2xsZWN0aW5nIGZsYWcgKGdsb2JhbCkgaXMgb24gKi8KLSAgICAgICAgSW50IGRpZm1hZCwgdG1wLCB0bXAyOwotICAgICAgICBIVEZNX1N0YXQgKmh0Zm1fc3RhdCA9IChIVEZNX1N0YXQqKSBleHRyYV9pbmZvOwotICAgICAgICBJbnQgKmFic19kaWZfbWFkX2F2ZyA9ICYoaHRmbV9zdGF0LT5hYnNfZGlmX21hZF9hdmcpOwotICAgICAgICBVSW50ICpjb3VudGJyZWFrID0gJihodGZtX3N0YXQtPmNvdW50YnJlYWspOwotICAgICAgICBJbnQgKm9mZnNldFJlZiA9IGh0Zm1fc3RhdC0+b2Zmc2V0UmVmOwotICAgICAgICBVTG9uZyBjdXJfd29yZDsKLQotICAgICAgICBOVU1fU0FEX0hQX01CX0NBTEwoKTsKLQotICAgICAgICBibGsgLT0gNDsKLQotICAgICAgICBmb3IgKGkgPSAwOyBpIDwgMTY7IGkrKykgLyogMTYgc3RhZ2VzICovCi0gICAgICAgIHsKLSAgICAgICAgICAgIHAxID0gcmVmICsgb2Zmc2V0UmVmW2ldOwotCi0gICAgICAgICAgICBqID0gNDsgLyogNCBsaW5lcyAqLwotICAgICAgICAgICAgZG8KLSAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICBjdXJfd29yZCA9ICooKFVMb25nKikoYmxrICs9IDQpKTsKLSAgICAgICAgICAgICAgICB0bXAgPSBwMVsxMl07Ci0gICAgICAgICAgICAgICAgdG1wMiA9IHAxWzEzXTsKLSAgICAgICAgICAgICAgICB0bXArKzsKLSAgICAgICAgICAgICAgICB0bXAyICs9IHRtcDsKLSAgICAgICAgICAgICAgICB0bXAgPSAoY3VyX3dvcmQgPj4gMjQpICYgMHhGRjsKLSAgICAgICAgICAgICAgICBzYWQgPSBJTlRFUlAxX1NVQl9TQUQoc2FkLCB0bXAsIHRtcDIpOzsKLSAgICAgICAgICAgICAgICB0bXAgPSBwMVs4XTsKLSAgICAgICAgICAgICAgICB0bXAyID0gcDFbOV07Ci0gICAgICAgICAgICAgICAgdG1wKys7Ci0gICAgICAgICAgICAgICAgdG1wMiArPSB0bXA7Ci0gICAgICAgICAgICAgICAgdG1wID0gKGN1cl93b3JkID4+IDE2KSAmIDB4RkY7Ci0gICAgICAgICAgICAgICAgc2FkID0gSU5URVJQMV9TVUJfU0FEKHNhZCwgdG1wLCB0bXAyKTs7Ci0gICAgICAgICAgICAgICAgdG1wID0gcDFbNF07Ci0gICAgICAgICAgICAgICAgdG1wMiA9IHAxWzVdOwotICAgICAgICAgICAgICAgIHRtcCsrOwotICAgICAgICAgICAgICAgIHRtcDIgKz0gdG1wOwotICAgICAgICAgICAgICAgIHRtcCA9IChjdXJfd29yZCA+PiA4KSAmIDB4RkY7Ci0gICAgICAgICAgICAgICAgc2FkID0gSU5URVJQMV9TVUJfU0FEKHNhZCwgdG1wLCB0bXAyKTs7Ci0gICAgICAgICAgICAgICAgdG1wID0gcDFbMF07Ci0gICAgICAgICAgICAgICAgdG1wMiA9IHAxWzFdOwotICAgICAgICAgICAgICAgIHAxICs9IHJlZnd4NDsKLSAgICAgICAgICAgICAgICB0bXArKzsKLSAgICAgICAgICAgICAgICB0bXAyICs9IHRtcDsKLSAgICAgICAgICAgICAgICB0bXAgPSAoY3VyX3dvcmQgJiAweEZGKTsKLSAgICAgICAgICAgICAgICBzYWQgPSBJTlRFUlAxX1NVQl9TQUQoc2FkLCB0bXAsIHRtcDIpOzsKLSAgICAgICAgICAgIH0KLSAgICAgICAgICAgIHdoaWxlICgtLWopOwotCi0gICAgICAgICAgICBOVU1fU0FEX0hQX01CKCk7Ci0KLSAgICAgICAgICAgIHNhZGRhdGFbaV0gPSBzYWQ7Ci0KLSAgICAgICAgICAgIGlmIChpID4gMCkKLSAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICBpZiAoc2FkID4gKEludCkoKFVMb25nKWRtaW5fcnggPj4gMTYpKQotICAgICAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAgICAgZGlmbWFkID0gc2FkZGF0YVswXSAtICgoc2FkZGF0YVsxXSArIDEpID4+IDEpOwotICAgICAgICAgICAgICAgICAgICAoKmFic19kaWZfbWFkX2F2ZykgKz0gKChkaWZtYWQgPiAwKSA/IGRpZm1hZCA6IC1kaWZtYWQpOwotICAgICAgICAgICAgICAgICAgICAoKmNvdW50YnJlYWspKys7Ci0gICAgICAgICAgICAgICAgICAgIHJldHVybiBzYWQ7Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgfQotICAgICAgICB9Ci0gICAgICAgIGRpZm1hZCA9IHNhZGRhdGFbMF0gLSAoKHNhZGRhdGFbMV0gKyAxKSA+PiAxKTsKLSAgICAgICAgKCphYnNfZGlmX21hZF9hdmcpICs9ICgoZGlmbWFkID4gMCkgPyBkaWZtYWQgOiAtZGlmbWFkKTsKLSAgICAgICAgKCpjb3VudGJyZWFrKSsrOwotCi0gICAgICAgIHJldHVybiBzYWQ7Ci0gICAgfQotCi0gICAgSW50IFNBRF9NQl9IUF9IVEZNeGh5aChVQ2hhciAqcmVmLCBVQ2hhciAqYmxrLCBJbnQgZG1pbl9yeCwgdm9pZCAqZXh0cmFfaW5mbykKLSAgICB7Ci0gICAgICAgIEludCBpLCBqOwotICAgICAgICBJbnQgc2FkID0gMCwgdG1wLCB0bXAyOwotICAgICAgICBVQ2hhciAqcDEsICpwMjsKLSAgICAgICAgSW50IHJ4ID0gZG1pbl9yeCAmIDB4RkZGRjsKLSAgICAgICAgSW50IHJlZnd4NCA9IHJ4IDw8IDI7Ci0gICAgICAgIEludCBzYWRzdGFyID0gMCwgbWFkc3RhcjsKLSAgICAgICAgSW50ICpucm1sel90aCA9IChJbnQqKSBleHRyYV9pbmZvOwotICAgICAgICBJbnQgKm9mZnNldFJlZiA9IG5ybWx6X3RoICsgMzI7Ci0gICAgICAgIFVMb25nIGN1cl93b3JkOwotCi0gICAgICAgIG1hZHN0YXIgPSAoVUxvbmcpZG1pbl9yeCA+PiAyMDsKLQotICAgICAgICBOVU1fU0FEX0hQX01CX0NBTEwoKTsKLQotICAgICAgICBibGsgLT0gNDsKLQotICAgICAgICBmb3IgKGkgPSAwOyBpIDwgMTY7IGkrKykgLyogMTYgc3RhZ2VzICovCi0gICAgICAgIHsKLSAgICAgICAgICAgIHAxID0gcmVmICsgb2Zmc2V0UmVmW2ldOwotICAgICAgICAgICAgcDIgPSBwMSArIHJ4OwotCi0gICAgICAgICAgICBqID0gNDsgLyogNCBsaW5lcyAqLwotICAgICAgICAgICAgZG8KLSAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICBjdXJfd29yZCA9ICooKFVMb25nKikoYmxrICs9IDQpKTsKLSAgICAgICAgICAgICAgICB0bXAgPSBwMVsxMl0gKyBwMlsxMl07Ci0gICAgICAgICAgICAgICAgdG1wMiA9IHAxWzEzXSArIHAyWzEzXTsKLSAgICAgICAgICAgICAgICB0bXAgKz0gdG1wMjsKLSAgICAgICAgICAgICAgICB0bXAyID0gKGN1cl93b3JkID4+IDI0KSAmIDB4RkY7Ci0gICAgICAgICAgICAgICAgdG1wICs9IDI7Ci0gICAgICAgICAgICAgICAgc2FkID0gSU5URVJQMl9TVUJfU0FEKHNhZCwgdG1wLCB0bXAyKTs7Ci0gICAgICAgICAgICAgICAgdG1wID0gcDFbOF0gKyBwMls4XTsKLSAgICAgICAgICAgICAgICB0bXAyID0gcDFbOV0gKyBwMls5XTsKLSAgICAgICAgICAgICAgICB0bXAgKz0gdG1wMjsKLSAgICAgICAgICAgICAgICB0bXAyID0gKGN1cl93b3JkID4+IDE2KSAmIDB4RkY7Ci0gICAgICAgICAgICAgICAgdG1wICs9IDI7Ci0gICAgICAgICAgICAgICAgc2FkID0gSU5URVJQMl9TVUJfU0FEKHNhZCwgdG1wLCB0bXAyKTs7Ci0gICAgICAgICAgICAgICAgdG1wID0gcDFbNF0gKyBwMls0XTsKLSAgICAgICAgICAgICAgICB0bXAyID0gcDFbNV0gKyBwMls1XTsKLSAgICAgICAgICAgICAgICB0bXAgKz0gdG1wMjsKLSAgICAgICAgICAgICAgICB0bXAyID0gKGN1cl93b3JkID4+IDgpICYgMHhGRjsKLSAgICAgICAgICAgICAgICB0bXAgKz0gMjsKLSAgICAgICAgICAgICAgICBzYWQgPSBJTlRFUlAyX1NVQl9TQUQoc2FkLCB0bXAsIHRtcDIpOzsKLSAgICAgICAgICAgICAgICB0bXAyID0gcDFbMV0gKyBwMlsxXTsKLSAgICAgICAgICAgICAgICB0bXAgPSBwMVswXSArIHAyWzBdOwotICAgICAgICAgICAgICAgIHAxICs9IHJlZnd4NDsKLSAgICAgICAgICAgICAgICBwMiArPSByZWZ3eDQ7Ci0gICAgICAgICAgICAgICAgdG1wICs9IHRtcDI7Ci0gICAgICAgICAgICAgICAgdG1wMiA9IChjdXJfd29yZCAmIDB4RkYpOwotICAgICAgICAgICAgICAgIHRtcCArPSAyOwotICAgICAgICAgICAgICAgIHNhZCA9IElOVEVSUDJfU1VCX1NBRChzYWQsIHRtcCwgdG1wMik7OwotICAgICAgICAgICAgfQotICAgICAgICAgICAgd2hpbGUgKC0taik7Ci0KLSAgICAgICAgICAgIE5VTV9TQURfSFBfTUIoKTsKLQotICAgICAgICAgICAgc2Fkc3RhciArPSBtYWRzdGFyOwotICAgICAgICAgICAgaWYgKHNhZCA+IHNhZHN0YXIgLSBucm1sel90aFtpXSB8fCBzYWQgPiAoSW50KSgoVUxvbmcpZG1pbl9yeCA+PiAxNikpCi0gICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgcmV0dXJuIDY1NTM2OwotICAgICAgICAgICAgfQotICAgICAgICB9Ci0KLSAgICAgICAgcmV0dXJuIHNhZDsKLSAgICB9Ci0KLSAgICBJbnQgU0FEX01CX0hQX0hURk15aChVQ2hhciAqcmVmLCBVQ2hhciAqYmxrLCBJbnQgZG1pbl9yeCwgdm9pZCAqZXh0cmFfaW5mbykKLSAgICB7Ci0gICAgICAgIEludCBpLCBqOwotICAgICAgICBJbnQgc2FkID0gMCwgdG1wLCB0bXAyOwotICAgICAgICBVQ2hhciAqcDEsICpwMjsKLSAgICAgICAgSW50IHJ4ID0gZG1pbl9yeCAmIDB4RkZGRjsKLSAgICAgICAgSW50IHJlZnd4NCA9IHJ4IDw8IDI7Ci0gICAgICAgIEludCBzYWRzdGFyID0gMCwgbWFkc3RhcjsKLSAgICAgICAgSW50ICpucm1sel90aCA9IChJbnQqKSBleHRyYV9pbmZvOwotICAgICAgICBJbnQgKm9mZnNldFJlZiA9IG5ybWx6X3RoICsgMzI7Ci0gICAgICAgIFVMb25nIGN1cl93b3JkOwotCi0gICAgICAgIG1hZHN0YXIgPSAoVUxvbmcpZG1pbl9yeCA+PiAyMDsKLQotICAgICAgICBOVU1fU0FEX0hQX01CX0NBTEwoKTsKLQotICAgICAgICBibGsgLT0gNDsKLQotICAgICAgICBmb3IgKGkgPSAwOyBpIDwgMTY7IGkrKykgLyogMTYgc3RhZ2VzICovCi0gICAgICAgIHsKLSAgICAgICAgICAgIHAxID0gcmVmICsgb2Zmc2V0UmVmW2ldOwotICAgICAgICAgICAgcDIgPSBwMSArIHJ4OwotICAgICAgICAgICAgaiA9IDQ7Ci0gICAgICAgICAgICBkbwotICAgICAgICAgICAgewotICAgICAgICAgICAgICAgIGN1cl93b3JkID0gKigoVUxvbmcqKShibGsgKz0gNCkpOwotICAgICAgICAgICAgICAgIHRtcCA9IHAxWzEyXTsKLSAgICAgICAgICAgICAgICB0bXAyID0gcDJbMTJdOwotICAgICAgICAgICAgICAgIHRtcCsrOwotICAgICAgICAgICAgICAgIHRtcDIgKz0gdG1wOwotICAgICAgICAgICAgICAgIHRtcCA9IChjdXJfd29yZCA+PiAyNCkgJiAweEZGOwotICAgICAgICAgICAgICAgIHNhZCA9IElOVEVSUDFfU1VCX1NBRChzYWQsIHRtcCwgdG1wMik7OwotICAgICAgICAgICAgICAgIHRtcCA9IHAxWzhdOwotICAgICAgICAgICAgICAgIHRtcDIgPSBwMls4XTsKLSAgICAgICAgICAgICAgICB0bXArKzsKLSAgICAgICAgICAgICAgICB0bXAyICs9IHRtcDsKLSAgICAgICAgICAgICAgICB0bXAgPSAoY3VyX3dvcmQgPj4gMTYpICYgMHhGRjsKLSAgICAgICAgICAgICAgICBzYWQgPSBJTlRFUlAxX1NVQl9TQUQoc2FkLCB0bXAsIHRtcDIpOzsKLSAgICAgICAgICAgICAgICB0bXAgPSBwMVs0XTsKLSAgICAgICAgICAgICAgICB0bXAyID0gcDJbNF07Ci0gICAgICAgICAgICAgICAgdG1wKys7Ci0gICAgICAgICAgICAgICAgdG1wMiArPSB0bXA7Ci0gICAgICAgICAgICAgICAgdG1wID0gKGN1cl93b3JkID4+IDgpICYgMHhGRjsKLSAgICAgICAgICAgICAgICBzYWQgPSBJTlRFUlAxX1NVQl9TQUQoc2FkLCB0bXAsIHRtcDIpOzsKLSAgICAgICAgICAgICAgICB0bXAgPSBwMVswXTsKLSAgICAgICAgICAgICAgICBwMSArPSByZWZ3eDQ7Ci0gICAgICAgICAgICAgICAgdG1wMiA9IHAyWzBdOwotICAgICAgICAgICAgICAgIHAyICs9IHJlZnd4NDsKLSAgICAgICAgICAgICAgICB0bXArKzsKLSAgICAgICAgICAgICAgICB0bXAyICs9IHRtcDsKLSAgICAgICAgICAgICAgICB0bXAgPSAoY3VyX3dvcmQgJiAweEZGKTsKLSAgICAgICAgICAgICAgICBzYWQgPSBJTlRFUlAxX1NVQl9TQUQoc2FkLCB0bXAsIHRtcDIpOzsKLSAgICAgICAgICAgIH0KLSAgICAgICAgICAgIHdoaWxlICgtLWopOwotCi0gICAgICAgICAgICBOVU1fU0FEX0hQX01CKCk7Ci0gICAgICAgICAgICBzYWRzdGFyICs9IG1hZHN0YXI7Ci0gICAgICAgICAgICBpZiAoc2FkID4gc2Fkc3RhciAtIG5ybWx6X3RoW2ldIHx8IHNhZCA+IChJbnQpKChVTG9uZylkbWluX3J4ID4+IDE2KSkKLSAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICByZXR1cm4gNjU1MzY7Ci0gICAgICAgICAgICB9Ci0gICAgICAgIH0KLQotICAgICAgICByZXR1cm4gc2FkOwotICAgIH0KLQotICAgIEludCBTQURfTUJfSFBfSFRGTXhoKFVDaGFyICpyZWYsIFVDaGFyICpibGssIEludCBkbWluX3J4LCB2b2lkICpleHRyYV9pbmZvKQotICAgIHsKLSAgICAgICAgSW50IGksIGo7Ci0gICAgICAgIEludCBzYWQgPSAwLCB0bXAsIHRtcDI7Ci0gICAgICAgIFVDaGFyICpwMTsKLSAgICAgICAgSW50IHJ4ID0gZG1pbl9yeCAmIDB4RkZGRjsKLSAgICAgICAgSW50IHJlZnd4NCA9IHJ4IDw8IDI7Ci0gICAgICAgIEludCBzYWRzdGFyID0gMCwgbWFkc3RhcjsKLSAgICAgICAgSW50ICpucm1sel90aCA9IChJbnQqKSBleHRyYV9pbmZvOwotICAgICAgICBJbnQgKm9mZnNldFJlZiA9IG5ybWx6X3RoICsgMzI7Ci0gICAgICAgIFVMb25nIGN1cl93b3JkOwotCi0gICAgICAgIG1hZHN0YXIgPSAoVUxvbmcpZG1pbl9yeCA+PiAyMDsKLQotICAgICAgICBOVU1fU0FEX0hQX01CX0NBTEwoKTsKLQotICAgICAgICBibGsgLT0gNDsKLQotICAgICAgICBmb3IgKGkgPSAwOyBpIDwgMTY7IGkrKykgLyogMTYgc3RhZ2VzICovCi0gICAgICAgIHsKLSAgICAgICAgICAgIHAxID0gcmVmICsgb2Zmc2V0UmVmW2ldOwotCi0gICAgICAgICAgICBqID0gNDsvKiA0IGxpbmVzICovCi0gICAgICAgICAgICBkbwotICAgICAgICAgICAgewotICAgICAgICAgICAgICAgIGN1cl93b3JkID0gKigoVUxvbmcqKShibGsgKz0gNCkpOwotICAgICAgICAgICAgICAgIHRtcCA9IHAxWzEyXTsKLSAgICAgICAgICAgICAgICB0bXAyID0gcDFbMTNdOwotICAgICAgICAgICAgICAgIHRtcCsrOwotICAgICAgICAgICAgICAgIHRtcDIgKz0gdG1wOwotICAgICAgICAgICAgICAgIHRtcCA9IChjdXJfd29yZCA+PiAyNCkgJiAweEZGOwotICAgICAgICAgICAgICAgIHNhZCA9IElOVEVSUDFfU1VCX1NBRChzYWQsIHRtcCwgdG1wMik7OwotICAgICAgICAgICAgICAgIHRtcCA9IHAxWzhdOwotICAgICAgICAgICAgICAgIHRtcDIgPSBwMVs5XTsKLSAgICAgICAgICAgICAgICB0bXArKzsKLSAgICAgICAgICAgICAgICB0bXAyICs9IHRtcDsKLSAgICAgICAgICAgICAgICB0bXAgPSAoY3VyX3dvcmQgPj4gMTYpICYgMHhGRjsKLSAgICAgICAgICAgICAgICBzYWQgPSBJTlRFUlAxX1NVQl9TQUQoc2FkLCB0bXAsIHRtcDIpOzsKLSAgICAgICAgICAgICAgICB0bXAgPSBwMVs0XTsKLSAgICAgICAgICAgICAgICB0bXAyID0gcDFbNV07Ci0gICAgICAgICAgICAgICAgdG1wKys7Ci0gICAgICAgICAgICAgICAgdG1wMiArPSB0bXA7Ci0gICAgICAgICAgICAgICAgdG1wID0gKGN1cl93b3JkID4+IDgpICYgMHhGRjsKLSAgICAgICAgICAgICAgICBzYWQgPSBJTlRFUlAxX1NVQl9TQUQoc2FkLCB0bXAsIHRtcDIpOzsKLSAgICAgICAgICAgICAgICB0bXAgPSBwMVswXTsKLSAgICAgICAgICAgICAgICB0bXAyID0gcDFbMV07Ci0gICAgICAgICAgICAgICAgcDEgKz0gcmVmd3g0OwotICAgICAgICAgICAgICAgIHRtcCsrOwotICAgICAgICAgICAgICAgIHRtcDIgKz0gdG1wOwotICAgICAgICAgICAgICAgIHRtcCA9IChjdXJfd29yZCAmIDB4RkYpOwotICAgICAgICAgICAgICAgIHNhZCA9IElOVEVSUDFfU1VCX1NBRChzYWQsIHRtcCwgdG1wMik7OwotICAgICAgICAgICAgfQotICAgICAgICAgICAgd2hpbGUgKC0taik7Ci0KLSAgICAgICAgICAgIE5VTV9TQURfSFBfTUIoKTsKLQotICAgICAgICAgICAgc2Fkc3RhciArPSBtYWRzdGFyOwotICAgICAgICAgICAgaWYgKHNhZCA+IHNhZHN0YXIgLSBucm1sel90aFtpXSB8fCBzYWQgPiAoSW50KSgoVUxvbmcpZG1pbl9yeCA+PiAxNikpCi0gICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgcmV0dXJuIDY1NTM2OwotICAgICAgICAgICAgfQotICAgICAgICB9Ci0KLSAgICAgICAgcmV0dXJuIHNhZDsKLSAgICB9Ci0KLSNlbmRpZiAvKiBIVEZNICovCi0KLSNpZm5kZWYgTk9fSU5URVI0VgotICAgIC8qPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09Ci0gICAgICAgIEZ1bmN0aW9uOiAgIFNBRF9CbGtfSGFsZlBlbF9DCi0gICAgICAgIERhdGU6ICAgICAgIDA0LzMwLzIwMDEKLSAgICAgICAgUHVycG9zZTogICAgQ29tcHV0ZSBTQUQgMTZ4MTYgYmV0d2VlbiBibGsgYW5kIHJlZiBpbiBoYWxmcGVsCi0gICAgICAgICAgICAgICAgICAgIHJlc29sdXRpb24sCi0gICAgICAgIENoYW5nZXM6Ci0gICAgICA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0qLwotICAgIC8qIE9uZSBjb21wb25lbnQgaXMgaGFsZi1wZWwgKi8KLSAgICBJbnQgU0FEX0Jsa19IYWxmUGVsX0MoVUNoYXIgKnJlZiwgVUNoYXIgKmJsaywgSW50IGRtaW4sIEludCB3aWR0aCwgSW50IHJ4LCBJbnQgeGgsIEludCB5aCwgdm9pZCAqZXh0cmFfaW5mbykKLSAgICB7Ci0gICAgICAgIEludCBpLCBqOwotICAgICAgICBJbnQgc2FkID0gMDsKLSAgICAgICAgVUNoYXIgKmtrLCAqcDEsICpwMiwgKnAzLCAqcDQ7Ci0gICAgICAgIEludCB0ZW1wOwotCi0gICAgICAgIE9TQ0xfVU5VU0VEX0FSRyhleHRyYV9pbmZvKTsKLQotICAgICAgICBOVU1fU0FEX0hQX0JMS19DQUxMKCk7Ci0KLSAgICAgICAgaWYgKHhoICYmIHloKQotICAgICAgICB7Ci0gICAgICAgICAgICBwMSA9IHJlZjsKLSAgICAgICAgICAgIHAyID0gcmVmICsgeGg7Ci0gICAgICAgICAgICBwMyA9IHJlZiArIHloICogcng7Ci0gICAgICAgICAgICBwNCA9IHJlZiArIHloICogcnggKyB4aDsKLSAgICAgICAgICAgIGtrICA9IGJsazsKLQotICAgICAgICAgICAgZm9yIChpID0gMDsgaSA8IDg7IGkrKykKLSAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICBmb3IgKGogPSAwOyBqIDwgODsgaisrKQotICAgICAgICAgICAgICAgIHsKLQotICAgICAgICAgICAgICAgICAgICB0ZW1wID0gKChwMVtqXSArIHAyW2pdICsgcDNbal0gKyBwNFtqXSArIDIpID4+IDIpIC0ga2tbal07Ci0gICAgICAgICAgICAgICAgICAgIHNhZCArPSBQVl9BQlModGVtcCk7Ci0gICAgICAgICAgICAgICAgfQotCi0gICAgICAgICAgICAgICAgTlVNX1NBRF9IUF9CTEsoKTsKLQotICAgICAgICAgICAgICAgIGlmIChzYWQgPiBkbWluKQotICAgICAgICAgICAgICAgICAgICByZXR1cm4gc2FkOwotCi0gICAgICAgICAgICAgICAgcDEgKz0gcng7Ci0gICAgICAgICAgICAgICAgcDMgKz0gcng7Ci0gICAgICAgICAgICAgICAgcDIgKz0gcng7Ci0gICAgICAgICAgICAgICAgcDQgKz0gcng7Ci0gICAgICAgICAgICAgICAga2sgKz0gd2lkdGg7Ci0gICAgICAgICAgICB9Ci0gICAgICAgICAgICByZXR1cm4gc2FkOwotICAgICAgICB9Ci0gICAgICAgIGVsc2UKLSAgICAgICAgewotICAgICAgICAgICAgcDEgPSByZWY7Ci0gICAgICAgICAgICBwMiA9IHJlZiArIHhoICsgeWggKiByeDsgLyogZWl0aGVyIGxlZnQvcmlnaHQgb3IgdG9wL2JvdHRvbSBwaXhlbCAqLwotCi0gICAgICAgICAgICBrayAgPSBibGs7Ci0KLSAgICAgICAgICAgIGZvciAoaSA9IDA7IGkgPCA4OyBpKyspCi0gICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgZm9yIChqID0gMDsgaiA8IDg7IGorKykKLSAgICAgICAgICAgICAgICB7Ci0KLSAgICAgICAgICAgICAgICAgICAgdGVtcCA9ICgocDFbal0gKyBwMltqXSArIDEpID4+IDEpIC0ga2tbal07Ci0gICAgICAgICAgICAgICAgICAgIHNhZCArPSBQVl9BQlModGVtcCk7Ci0gICAgICAgICAgICAgICAgfQotCi0gICAgICAgICAgICAgICAgTlVNX1NBRF9IUF9CTEsoKTsKLQotICAgICAgICAgICAgICAgIGlmIChzYWQgPiBkbWluKQotICAgICAgICAgICAgICAgICAgICByZXR1cm4gc2FkOwotICAgICAgICAgICAgICAgIHAxICs9IHJ4OwotICAgICAgICAgICAgICAgIHAyICs9IHJ4OwotICAgICAgICAgICAgICAgIGtrICs9IHdpZHRoOwotICAgICAgICAgICAgfQotICAgICAgICAgICAgcmV0dXJuIHNhZDsKLSAgICAgICAgfQotICAgIH0KLSNlbmRpZiAvKiBOT19JTlRFUjRWICovCi0KLSNpZmRlZiBfX2NwbHVzcGx1cwotfQotI2VuZGlmCi0KLQotCmRpZmYgLS1naXQgYS9tZWRpYS9saWJzdGFnZWZyaWdodC9jb2RlY3MvbTR2X2gyNjMvZW5jL3NyYy9zYWRfaGFsZnBlbF9pbmxpbmUuaCBiL21lZGlhL2xpYnN0YWdlZnJpZ2h0L2NvZGVjcy9tNHZfaDI2My9lbmMvc3JjL3NhZF9oYWxmcGVsX2lubGluZS5oCmRlbGV0ZWQgZmlsZSBtb2RlIDEwMDY0NAppbmRleCBkNTU3NzhmLi4wMDAwMDAwCi0tLSBhL21lZGlhL2xpYnN0YWdlZnJpZ2h0L2NvZGVjcy9tNHZfaDI2My9lbmMvc3JjL3NhZF9oYWxmcGVsX2lubGluZS5oCisrKyAvZGV2L251bGwKQEAgLTEsMTMw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ioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotLyogIEZpbGVuYW1lOiBzYWRfaGFsZnBlbF9pbmxpbmUuaCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgRGVzY3JpcHRpb246IEltcGxlbWVudGF0aW9uIGZvciBpbi1saW5lIGZ1bmN0aW9ucyB1c2VkIGluIGRjdC5jcHAgICAgICAgICAgICovCi0vKiAgTW9kaWZpZWQ6ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotCi0jaWZuZGVmIF9TQURfSEFMRlBFTF9JTkxJTkVfSF8KLSNkZWZpbmUgX1NBRF9IQUxGUEVMX0lOTElORV9IXwotCi0jaWZkZWYgX19jcGx1c3BsdXMKLWV4dGVybiAiQyIKLXsKLSNlbmRpZgotCi0jaWYgIWRlZmluZWQoUFZfQVJNX0dDQ19WNSkgJiYgIWRlZmluZWQoUFZfQVJNX0dDQ19WNCkgLyogQVJNIEdOVSBDT01QSUxFUiAgKi8KLQotICAgIF9faW5saW5lIGludDMyIElOVEVSUDFfU1VCX1NBRChpbnQzMiBzYWQsIGludDMyIHRtcCwgaW50MzIgdG1wMikKLSAgICB7Ci0gICAgICAgIHRtcCA9ICh0bXAyID4+IDEpIC0gdG1wOwotICAgICAgICBpZiAodG1wID4gMCkgc2FkICs9IHRtcDsKLSAgICAgICAgZWxzZSBzYWQgLT0gdG1wOwotCi0gICAgICAgIHJldHVybiBzYWQ7Ci0gICAgfQotCi0gICAgX19pbmxpbmUgaW50MzIgSU5URVJQMl9TVUJfU0FEKGludDMyIHNhZCwgaW50MzIgdG1wLCBpbnQzMiB0bXAyKQotICAgIHsKLSAgICAgICAgdG1wID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gaW50MzIgdG1wMikKLSAgICB7Ci0gICAgICAgIHJlZ2lzdGVyIGludDMyIG91dDsKLSAgICAgICAgcmVnaXN0ZXIgaW50MzIgdGVtcDE7Ci0gICAgICAgIHJlZ2lzdGVyIGludDMyIHNzID0gc2FkOwotICAgICAgICByZWdpc3RlciBpbnQzMiB0dCA9IHRtcDsKLSAgICAgICAgcmVnaXN0ZXIgaW50MzIgdXUgPSB0bXAyOwotCi0gICAgICAgIGFzbSB2b2xhdGlsZSgicnNicwklMSwgJTMsICU0LCBhc3IgIzFcblx0IgotICAgICAgICAgICAgICAgICAgICAgInJzYm1pICUxLCAlMSwgIzBcblx0IgotICAgICAgICAgICAgICAgICAgICAgImFkZCAgJTAsICUyLCAlMSIKLSAgICAgICAgICAgICA6ICI9JnIiKG91dCksCi0gICAgICAgICAgICAgICAgICAgICAiPSZyIih0ZW1wMSkKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOiAiciIoc3MpLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAiciIodHQpLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAiciIodXUpKTsKLSAgICAgICAgcmV0dXJuIG91dDsKLSAgICB9Ci0KLQotICAgIF9faW5saW5lIGludDMyIElOVEVSUDJfU1VCX1NBRChpbnQzMiBzYWQsIGludDMyIHRtcCwgaW50MzIgdG1wMikKLXsKLSAgICAgICAgcmVnaXN0ZXIgaW50MzIgb3V0OwotICAgICAgICByZWdpc3RlciBpbnQzMiB0ZW1wMTsKLSAgICAgICAgcmVnaXN0ZXIgaW50MzIgc3MgPSBzYWQ7Ci0gICAgICAgIHJlZ2lzdGVyIGludDMyIHR0ID0gdG1wOwotICAgICAgICByZWdpc3RlciBpbnQzMiB1dSA9IHRtcDI7Ci0KLSAgICAgICAgYXNtIHZvbGF0aWxlKCJyc2JzICAgICAgJTEsICU0LCAlMywgYXNyICMyXG5cdCIKLSAgICAgICAgICAgICAgICAgICAgICJyc2JtaSAlMSwgJTEsICMwXG5cd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ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotI2lmbmRlZiBfU0FEX0lOTElORV9IXwotI2RlZmluZSBfU0FEX0lOTElORV9IXwotCi0jaWZkZWYgX19jcGx1c3BsdXMKLWV4dGVybiAiQyIKLXsKLSNlbmRpZgotCi0jaWYgIWRlZmluZWQoUFZfQVJNX0dDQ19WNSkgJiYgIWRlZmluZWQoUFZfQVJNX0dDQ19WNCkgLyogQVJNIEdOVSBDT01QSUxFUiAgKi8KLQotICAgIF9faW5saW5lIGludDMyIFNVQl9TQUQoaW50MzIgc2FkLCBpbnQzMiB0bXAsIGludDMyIHRtcDIpCi0gICAgewotICAgICAgICB0bXAgPSB0bXAgLSB0bXAyOwotICAgICAgICBpZiAodG1wID4gMCkgc2FkICs9IHRtcDsKLSAgICAgICAgZWxzZSBzYWQgLT0gdG1wOwotCi0gICAgICAgIHJldHVybiBzYWQ7Ci0gICAgfQotCi0gICAgX19pbmxpbmUgaW50MzIgc2FkXzRwaXhlbChpbnQzMiBzcmMxLCBpbnQzMiBzcmMyLCBpbnQzMiBtYXNrKQotICAgIHsKLSAgICAgICAgaW50MzIgeDc7Ci0KLSAgICAgICAgeDcgPSBzcmMyIF4gc3JjMTsgICAgICAgLyogY2hlY2sgb2RkL2V2ZW4gY29tYmluYXRpb24gKi8KLSAgICAgICAgaWYgKCh1aW50MzIpc3JjMiA+PSAodWludDMyKXNyYzEpCi0gICAgICAgIHsKLSAgICAgICAgICAgIHNyYzEgPSBzcmMyIC0gc3JjMTsgICAgIC8qIHN1YnMgKi8KLSAgICAgICAgfQotICAgICAgICBlbHNlCi0gICAgICAgIHsKLSAgICAgICAgICAgIHNyYzEgPSBzcmMxIC0gc3JjMjsKLSAgICAgICAgfQotICAgICAgICB4NyA9IHg3IF4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290byBTYWRNQk9mZnNldDM7Ci0gICAgICAgIGlmICh4OCA9PSAyKQotICAgICAgICAgICAgZ290byBTYWRNQk9mZnNldDI7Ci0gICAgICAgIGlmICh4OCA9PSAxKQotICAgICAgICAgICAgZ290byBTYWRNQk9mZnNldDE7Ci0KLS8vICB4NSA9ICh4NDw8OCkteDQ7IC8qIHg1ID0geDQqMjU1OyAqLwotICAgICAgICB4NCA9IHg1ID0gMDsKLQotICAgICAgICB4NiA9IDB4RkZGRjAwRkY7Ci0KLSAgICAgICAgcmVmIC09IGx4OwotICAgICAgICBibGsgLT0gMTY7Ci0KLSAgICAgICAgeDggPSAxNjsKLQotTE9PUF9TQUQwOgotICAgICAgICAvKioqKioqIHByb2Nlc3MgOCBwaXhlbHMgKioqKioqLwotICAgICAgICB4MTAgPSAqKCh1aW50MzIqKShyZWYgKz0gbHgpKTsKLSAgICAgICAgeDExID0gKigodWludDMyKikocmVmICsgNCkpOwotICAgICAgICB4MTIgPSAqKCh1aW50MzIqKShibGsgKz0gMTYpKTsKLSAgICAgICAgeDE0ID0gKigodWludDMyKikoYmxrICsgNCkpOwotCi0gICAgICAgIC8qIHByb2Nlc3MgeDExICYgeDE0ICovCi0gICAgICAgIHgxMSA9IHNhZF80cGl4ZWwoeDExLCB4MTQsIHg5KTsKLQotICAgICAgICAvKiBwcm9jZXNzIHgxMiAmIHgxMCAqLwotICAgICAgICB4MTAgPSBzYWRfNHBpeGVsKHgxMCwgeDEyLCB4OSk7Ci0KLSAgICAgICAgeDUgPSB4NSArIHgxMDsgLyogYWNjdW11bGF0ZSBsb3cgYnl0ZXMgKi8KLSAgICAgICAgeDEwID0geDEwICYgKHg2IDw8IDgpOyAvKiB4MTAgJiAweEZGMDBGRjAwICovCi0gICAgICAgIHg0ID0geDQgKyAoKHVpbnQzMil4MTAgPj4gOCk7ICAvKiBhY2N1bXVsYXRlIGhpZ2ggYnl0ZXMgKi8KLSAgICAgICAgeDUgPSB4NSArIHgxMTsgIC8qIGFjY3V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8KLQotICAgICAgICAvKioqKioqKioqKioqKioqKi8KLSAgICAgICAgeDEwID0geDUgLSAoeDQgPDwgOCk7IC8qIGV4dHJhY3QgbG93IGJ5dGVzICovCi0gICAgICAgIHgxMCA9IHgxMCArIHg0OyAgICAgLyogYWRkIHdpdGggaGlnaCBieXRlcyAqLwotICAgICAgICB4MTAgPSB4MTAgKyAoeDEwIDw8IDE2KTsgLyogYWRkIHdpdGggbG93ZXIgaGFsZiB3b3JkICovCi0KLSAgICAgICAgaWYgKCgodWludDMyKXgxMCA+PiAxNikgPD0gKHVpbnQzMilkbWluKSAvKiBjb21wYXJlIHdpdGggZG1pbiAqLwotICAgICAgICB7Ci0gICAgICAgICAgICBpZiAoLS14OCkKLSAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICBnb3RvIExPT1BfU0FEMDsKLSAgICAgICAgICAgIH0KLQotICAgICAgICB9Ci0KLSAgICAgICAgcmV0dXJuICgodWludDMyKXgxMCA+PiAxNik7Ci0KLVNhZE1CT2Zmc2V0MzoKLQotICAgICAgICByZXR1cm4gc2FkX21iX29mZnNldDMocmVmLCBibGssIGx4LCBkbWluKTsKLQotU2FkTUJPZmZzZXQyOgotCi0gICAgICAgIHJldHVybiBzYWRfbWJfb2Zmc2V0MihyZWYsIGJsaywgbHgsIGRtaW4pOwotCi1TYWRNQk9mZnNldDE6Ci0KLSAgICAgICAgcmV0dXJuIHNhZF9tYl9vZmZzZXQxKHJlZiwgYmxrLCBseCwgZG1pbik7Ci0KLSAgICB9Ci0KLSNlbGlmIGRlZmluZWQoX19DQ19BUk0pICAvKiBvbmx5IHdvcmsgd2l0aCBhcm0gdjUgKi8KLQotICAgIF9faW5saW5lIGludDMyIFNVQl9TQUQoaW50MzIgc2FkLCBpbnQzMiB0bXAsIGludDMyIHRtcDIpCi0gICAgewotICAgICAgICBfX2FzbQotICAgICAgICB7Ci0gICAgICAgICAgICByc2JzICAgIHRtcCwgdG1wLCB0bXAyIDsKLSAgICAgICAgICAgIHJzYm1pICAgdG1wLCB0bXAsICMwIDsKLSAgICAgICAgICAgIGFkZCAgICAgc2FkLCBzYWQsIHRtcCA7Ci0gICAgICAgIH0KLQotICAgICAgICByZXR1cm4gc2FkOwotICAgIH0KLQotICAgIF9faW5saW5lIGludDMyIHNhZF80cGl4ZWwoaW50MzIgc3JjMSwgaW50MzIgc3JjMiwgaW50MzIgbWFzaykKLSAgICB7Ci0gICAgICAgIGludDMyIHg3OwotCi0gICAgICAgIF9fYXNtCi0gICAgICAgIHsKLSAgICAgICAgICAgIEVPUiAgICAgeDcsIHNyYzIsIHNyYzE7ICAgICAvKiBjaGVjayBvZGQvZXZlbiBjb21iaW5hdGlvbiAqLwotICAgICAgICAgICAgU1VCUyAgICBzcmMxLCBzcmMyLCBzcmMxOwotICAgICAgICAgICAgRU9SICAgICB4NywgeDcsIHNyYzE7Ci0gICAgICAgICAgICBBTkQgICAgIHg3LCBtYXNrLCB4NywgbHNyICMxOwotICAgICAgICAgICAgT1JSQ0MgICB4NywgeDcsICMweDgwMDAwMDAwOwotICAgICAgICAgICAgUlNCICAgICB4NywgeDcsIHg3LCBsc2wgIzg7Ci0gICAgICAgICAgICBBREQgICAgIHNyYzEsIHNyYzEsIHg3LCBhc3IgIzc7ICAgLyogYWRkIDB4RkYgdG8gdGhlIG5lZ2F0aXZlIGJ5dGUsIGFkZCBiYWNrIGNhcnJ5ICovCi0gICAgICAgICAgICBFT1IgICAgIHNyYzEsIHNyYzEsIHg3LCBhc3IgIzc7ICAgLyogdGFrZSBhYnNvbHV0ZSB2YWx1ZSBvZiBuZWdhdGl2ZSBieXRlICovCi0gICAgICAgIH0KLQotICAgICAgICByZXR1cm4gc3JjMTsKLSAgICB9Ci0KLSAgICBfX2lubGluZSBpbnQzMiBzYWRfNHBpeGVsTihpbnQzMiBzcmMxLCBpbnQzMiBzcmMyLCBpbnQzMiBtYXNrKQotICAgIHsKLSAgICAgICAgaW50MzIgeDc7Ci0KLSAgICAgICAgX19hc20KLSAgICAgIC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7Ci0KLSAgICAgICAgICAgIE1WTiAgICAgeDYsICMweEZGMDA7Ci0gICAgICAgIH0KLUxPT1BfU0FEMDoKLSAgICAgICAgLyoqKioqKiBwcm9jZXNzIDggcGl4ZWxzICoqKioqKi8KLSAgICAgICAgeDExID0gKigoaW50MzIqKShyZWYgKyAxMikpOwotICAgICAgICB4MTAgPSAqKChpbnQzMiopKHJlZiArIDgpKTsKLSAgICAgICAgeDE0ID0gKigoaW50MzIqKShibGsgKyAxMikpOwotICAgICAgICB4MTIgPSAqKChpbnQzMiopKGJsayArIDgpKTsKLQotICAgICAgICAvKiBwcm9jZXNzIHgxMSAmIHgxNCAqLwotICAgICAgICB4MTEgPSBzYWRfNHBpeGVsKHgxMSwgeDE0LCB4OSk7Ci0KLSAgICAgICAgLyogcHJvY2VzcyB4MTIgJiB4MTAgKi8KLSAgICAgICAgeDEwID0gc2FkXzRwaXhlbCh4MTAsIHgxMiwgeDkpOwotCi0gICAgICAgIHg1ID0geDUgKyB4MTA7ICAvKiBhY2N1bXVsYXRlIGxvdyBieXRlcyAqLwotICAgICAgICB4MTAgPSB4MTAgJiAoeDYgPDwgOCk7IC8qIHgxMCAmIDB4RkYwMEZGMDAgKi8KLSAgICAgICAgeDQgPSB4NCArICgodWludDMyKXgxMCA+PiA4KTsgLyogYWNjdW11bGF0ZSBoaWdoIGJ5dGVzICovCi0gICAgICAgIHg1ID0geDUgKyB4MTE7ICAvKiBhY2N1bXVsYXRlIGxvdyBieXRlcyAqLwotICAgICAgICB4MTEgPSB4MTEgJiAoeDYgPDwgOCk7IC8qIHgxMSAmIDB4RkYwMEZGMDAgKi8KLSAgICAgICAgeDQgPSB4NCArICgodWludDMyKXgxMSA+PiA4KTsgIC8qIGFjY3VtdWxhdGUgaGlnaCBieXRlcyAqLwotCi0gICAgICAgIF9fYXNtCi0gICAgICAgIHsKLSAgICAgICAgICAgIC8qKioqKiogcHJvY2VzcyA4IHBpeGVscyAqKioqKiovCi0gICAgICAgICAgICBMRFIgICAgIHgxMSwgW3JlZiwgIzRdOwotICAgICAgICAgICAgTERSICAgICB4MTAsIFtyZWZdLCBseCA7Ci0gICAgICAgICAgICBMRFIgICAgIHgxNCwgW2JsaywgIzRdOwotICAgICAgICAgICAgTERSICAgICB4MTIsIFtibGtdLCAjMTYgOwotICAgICAgICB9Ci0KLSAgICAgICAgLyogcHJvY2VzcyB4MTEgJiB4MTQgKi8KLSAgICAgICAgeDExID0gc2FkXzRwaXhlbCh4MTEsIHgxNCwgeDkpOwotCi0gICAgICAgIC8qIHByb2Nlc3MgeDEyICYgeDEwICovCi0gICAgICAgIHgxMCA9IHNhZF80cGl4ZWwoeDEwLCB4MTIsIHg5KTsKLQotICAgICAgICB4NSA9IHg1ICsgeDEwOyAgLyogYWNjdW11bGF0ZSBsb3cgYnl0ZXMgKi8KLSAgICAgICAgeDEwID0geDEwICYgKHg2IDw8IDgpOyAvKiB4MTAgJiAweEZGMDBGRjAwICovCi0gICAgICAgIHg0ID0geDQgKyAoKHVpbnQzMil4MTAgPj4gOCk7IC8qIGFjY3VtdWxhdGUgaGlnaCBieXRlcyAqLwotICAgICAgICB4NSA9IHg1ICsgeDExOyAgLyogYWNjdW11bGF0ZSBsb3cgYnl0ZXMgKi8KLSAgICAgICAgeDExID0geDExICYgKHg2IDw8IDgpOyAvKiB4MTEgJiAweEZGMDBGRjAwICovCi0gICAgICAgIHg0ID0geDQgKyAoKHVpbnQzMil4MTEgPj4gOCk7ICAvKiBhY2N1bXVsYXRlIGhpZ2ggYnl0ZXMgKi8KLQotICAgICAgICAvKioqKioqKioqKioqKioqKi8KLSAgICAgICAgeDEwID0geDUgLSAoeDQgPDwgOCk7IC8qIGV4dHJhY3QgbG93IGJ5dGVzICovCi0gICAgICAgIHgxMCA9IHgxMCArIHg0OyAgICAgLyogYWRkIHdpdGggaGlnaCBieXRlcyAqLwotICAgICAgICB4MTAgPSB4MTAgKyAoeDEwIDw8IDE2KTsgLyogYWRkIHdpdGggbG93ZXIgaGFsZiB3b3JkICovCi0KLSAgICAgICAgX19hc20KLSAgICAgICAgewotICAgICAgICAgICAgLyoqKioqKioqKioqKioqKiovCi0gICAgICAgICAgICBSU0JTICAgIHgxMSwgZG1pbiwgeDEwLCBsc3IgIzE2OwotICAgICAgICAgICAgQURETFNTICB4OCwgeDgsICMweDEwMDAwMDAxOwotICAgICAgICAgICAgQkxTICAgICBMT09QX1NBRDA7Ci0gICAgICAgIH0KLQotICAgICAgICByZXR1cm4gKCh1aW50MzIpeDEwID4+IDE2KTsKLQotU2FkTUJPZmZzZXQzOgotCi0gICAgICAgIHJldHVybiBzYWRfbWJfb2Zmc2V0MyhyZWYsIGJsaywgbHgsIGRtaW4sIHg4KTsKLQotU2FkTUJPZmZzZXQyOgotCi0gICAgICAgIHJldHVybiBzYWRfbWJfb2Zmc2V0MihyZWYsIGJsaywgbHgsIGRtaW4sIHg4KTsKLQotU2FkTUJPZmZzZXQxOgotCi0gICAgICAgIHJldHVybiBzYWRfbWJfb2Zmc2V0MShyZWYsIGJsaywgbHgsIGRtaW4sIHg4KTsKLSAgICB9Ci0KLQotI2VsaWYgKCBkZWZpbmVkKFBWX0FSTV9HQ0NfVjUpIHx8IGRlZmluZWQoUFZfQVJNX0dDQ19WNCkgKSAvKiBBUk0gR05VIENPTVBJTEVSICAqLwotCi0gICAgX19pbmxpbmUgaW50MzIgU1VCX1NBRChpbnQzMiBzYWQsIGludDMyIHRtcCwgaW50MzIgdG1wMikKLSAgICB7Ci0gICAgICAgIHJlZ2lzdGVyIGludDMyIG91dDsKLSAgICAgICAgcmVnaXN0ZXIgaW50MzIgdGVtcDE7Ci0gICAgICAgIHJlZ2lzdGVyIGludDMyIHNzID0gc2FkOwotICAgICAgICByZWdpc3RlciBpbnQzMiB0dCA9IHRtcDsKLSAgICAgICAgcmVnaXN0ZXIgaW50MzIgdXUgPSB0bXAyOwotCi0gICAgICAgIGFzbSB2b2xhdGlsZSgicnNicyAgJTEsICU0LCAlM1xuXHQiCi0gICAgICAgICAgICAgICAgICAgICAicnNibWkgJTEsICUxLCAjMFxuXHQiCi0gICAgICAgICAgICAgICAgICAgICAiYWRkICAgJTAsICUyLCAlMSIKLSAgICAgICAgICAgICA6ICI9JnIiKG91dCksCi0gICAgICAgICAgICAgICAgICAgICAiPSZyIih0ZW1wMSkKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOiAiciIoc3MpLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAiciIodHQpLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAiciIodXUpKTsKLSAgICAgICAgcmV0dXJuIG91dDsKLSAgICB9Ci0KLSAgICBfX2lubGluZSBpbnQzMiBzYWRfNHBpeGVsKGludDMyIHNyYzEsIGludDMyIHNyYzIsIGludDMyIG1hc2spCi17Ci0gICAgICAgIHJlZ2lzdGVyIGludDMyIG91dDsKLSAgICAgICAgcmVnaXN0ZXIgaW50MzIgdGVtcDE7Ci0gICAgICAgIHJlZ2lzdGVyIGludDMyIHMxID0gc3JjMTsKLSAgICAgICAgcmVnaXN0ZXIgaW50MzIgczIgPSBzcmMyOwotICAgICAgICByZWdpc3RlciBpbnQzMiBtbSA9IG1hc2s7Ci0KLSAgICAgICAgYXNtIHZvbGF0aWxlKCJlb3IgICAlMCwgJTMsICUyXG5cdCIKLSAgICAgICAgICAgICAgICAgICAgICJzdWJzICAlMSwgJTMsICUyXG5cdCIKLSAgICAgICAgICAgICAgICAgICAgICJlb3IgICAlMCwgJTAsICUxXG5cdCIKLSAgICAgICAgICAgICAgICAgICAgICJhbmQgICAlMCwgJTQsICUwLCBsc3IgIzFcblx0IgotICAgICAgICAgICAgICAgICAgICAgIm9ycmNjICUwLCAlMCwgIzB4ODAwMDAwMDBcblx0IgotICAgICAgICAgICAgICAgICAgICAgInJzYiAgICUwLCAlMCwgJTAsIGxzbCAjOFxuXHQiCi0gICAgICAgICAgICAgICAgICAgICAiYWRkICAgJTEsICUxLCAlMCwgYXNyICM3XG5cdCIKLSAgICAgICAgICAgICAgICAgICAgICJlb3IgICAlMSwgJTEsICUwLCBhc3IgIzciCi0gICAgICAgICAgICAgOiAiPSZyIihvdXQpLAotICAgICAgICAgICAgICAgICAgICAgIj0mciIodGVtcDEpCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgIDogInIiKHMxKSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgInIiKHMyKSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgInIiKG1tKSk7Ci0KLSAgICAgICAgcmV0dXJuIHRlbXAxOwotICAgIH0KLQotICAgIF9faW5saW5lIGludDMyIHNhZF80cGl4ZWxOKGludDMyIHNyYzEsIGludDMyIHNyYzIsIGludDMyIG1hc2spCi17Ci0gICAgICAgIHJlZ2lzdGVyIGludDMyIG91dDsKLSAgICAgICAgcmVnaXN0ZXIgaW50MzIgdGVtcDE7Ci0gICAgICAgIHJlZ2lzdGVyIGludDMyIHMxID0gc3JjMTsKLSAgICAgICAgcmVnaXN0ZXIgaW50MzIgczIgPSBzcmMyOwotICAgICAgICByZWdpc3RlciBpbnQzMiBtbSA9IG1hc2s7Ci0KLSAgICAgICAgYXNtIHZvbGF0aWxlKCJlb3IgICAgJTEsICUzLCAlMlxuXHQiCi0gICAgICAgICAgICAgICAgICAgICAiYWRkcyAgICUwLCAlMywgJTJcblx0IgotICAgICAgICAgICAgICAgICAgICAgImVvciAgICAlMSwgJTEsICUwXG5cdCIKLSAgICAgICAgICAgICAgICAgICAgICJhbmRzICAgJTEsICU0LCAlMSxycnhcblx0IgotICAgICAgICAgICAgICAgICAgICAgInJzYiAgICAlMSwgJTEsICUxLCBsc2wgIzhcblx0IgotICAgICAgICAgICAgICAgICAgICAgInN1YiAgICAlMCwgJTAsICUxLCBhc3IgIzdcblx0IgotICAgICAgICAgICAgICAgICAgICAgImVvciAgICAlMCwgJTAsICUxLCBhc3IgIzciCi0gICAgICAgICAgICAgOiAiPSZyIihvdXQpLAotICAgICAgICAgICAgICAgICAgICAgIj0mciIodGVtcDEpCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgIDogInIiKHMxKSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgInIiKHMyKSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgInIiKG1tKSk7Ci0KLSAgICAgICAgcmV0dXJuIChvdXQpOwotICAgIH0KLQotI2RlZmluZSBzdW1fYWNjdW11bGF0ZSBhc20gdm9sYXRpbGUoInNiYyAgJTAsICUwLCAlMVxuXHQiIFwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgImJpYyAgJTEsICU0LCAlMVxuXHQiIFwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgImFkZCAgJTIsICUyLCAlMSwgbHNyICM4XG5cdCIgXAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAic2JjICAlMCwgJTAsICUzXG5cdCIgXAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAiYmljICAlMywgJTQsICUzXG5cdCIgXAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAiYWRkICAlMiwgJTIsICUzLCBsc3IgIzgiIFwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOiIrciIoeDUpLCAiK3IiKHgxMCksICIrciIoeDQpLCAiK3IiKHgxMSkgXAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA6InIiKHg2KSk7Ci0KLSNkZWZpbmUgTlVNQkVSIDMKLSNkZWZpbmUgU0hJRlQgMjQKLSNkZWZpbmUgSU5DX1g4IDB4MDgwMDAwMDEKLQotI2luY2x1ZGUgInNhZF9tYl9vZmZzZXQuaCIKLQotI3VuZGVmIE5VTUJFUgotI2RlZmluZSBOVU1CRVIgMgotI3VuZGVmIFNISUZUCi0jZGVmaW5lIFNISUZUIDE2Ci0jdW5kZWYgSU5DX1g4Ci0jZGVmaW5lIElOQ19YOCAweDEwMDAwMDAxCi0jaW5jbHVkZSAic2FkX21iX29mZnNldC5oIgotCi0jdW5kZWYgTlVNQkVSC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B4OSk7Ci0KLSAgICAgICAgLyogcHJvY2VzcyB4MTIgJiB4MTAgKi8KLSAgICAgICAgeDEwID0gc2FkXzRwaXhlbCh4MTAsIHgxMiwgeDkpOwotCi0gICAgICAgIHg1ID0geDUgKyB4MTA7ICAvKiBhY2N1bXVsYXRlIGxvdyBieXRlcyAqLwotICAgICAgICB4MTAgPSB4MTAgJiAoeDYgPDwgOCk7IC8qIHgxMCAmIDB4RkYwMEZGMDAgKi8KLSAgICAgICAgeDQgPSB4NCArICgodWludDMyKXgxMCA+PiA4KTsgLyogYWNjdW11bGF0ZSBoaWdoIGJ5dGVzICovCi0gICAgICAgIHg1ID0geDUgKyB4MTE7ICAvKiBhY2N1bXVsYXRlIGxvdyBieXRlcyAqLwotICAgICAgICB4MTEgPSB4MTEgJiAoeDYgPDwgOCk7IC8qIHgxMSAmIDB4RkYwMEZGMDAgKi8KLSAgICAgICAgeDQgPSB4NCArICgodWludDMyKXgxMSA+PiA4KTsgIC8qIGFjY3VtdWxhdGUgaGlnaCBieXRlcyAqLwotCi0gICAgICAgIGFzbSB2b2xhdGlsZSgibGRyICAlMCwgWyU0LCAjNF1cblx0IgotICAgICAgICAgICAgICAgICAgICAgImxkciAgJTEsIFslNF0sICU2XG5cdCIKLSAgICAgICAgICAgICAgICAgICAgICJsZHIgICUyLCBbJTUsICM0XVxuXHQiCi0gICAgICAgICAgICAgICAgICAgICAibGRyICAlMywgWyU1XSwgIzE2IgotICAgICAgICAgICAgIDogIj1yIih4MTEpLCAiPXIiKHgxMCksICI9ciIoeDE0KSwgIj1yIih4MTIpLCAiK3IiKHJlZiksICIrciIoYmxrKQotICAgICAgICAgICAgICAgICAgICAgICAgICAgICA6ICJyIihseCkpOwotCi0gICAgICAgIC8qIHByb2Nlc3MgeDExICYgeDE0ICovCi0gICAgICAgIHgxMSA9IHNhZF80cGl4ZWwoeDExLCB4MTQsIHg5KTsKLQotICAgICAgICAvKiBwcm9jZXNzIHgxMiAmIHgxMCAqLwotICAgICAg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zZS4KLSAqIFlvdSBtYXkgb2J0YWluIGEgY29weSBvZiB0aGUgTGljZW5zZSBhdAotICoKLSAqICAgICAgaHR0cDovL3d3dy5hcGFjaGUub3JnL2xpY2Vuc2VzL0xJQ0VOU0UtMi4wCi0gKgotICogVW5sZXNzIHJlcXVpcmVkIGJ5IGFwcGxpY2FibGUgbGF3IG9yIGFncmVlZCB0byBpbiB3cml0aW5nLCBzb2Z0d2FyZQotICogZGlzdHJpYnV0ZWQgdW5kZXIgdGhlIExpY2Vuc2UgaXMgZGlzdHJpYnV0ZWQgb24gYW4gIkFTIElTIiBCQVNJUywKLSAqIFdJVEhPVVQgV0FSUkFOVElFUyBPUiBDT05ESVRJT05TIE9GIEFOWSBLSU5ELCBlaXRoZXIKLSAqIGV4cHJlc3Mgb3IgaW1wbGllZC4KLSAqIFNlZSB0aGUgTGljZW5zZSBmb3IgdGhlIHNwZWNpZmljIGxhbmd1YWdlIGdvdmVybmluZyBwZXJtaXNzaW9ucwotICogYW5kIGxpbWl0YXRpb25zIHVuZGVyIHRoZSBMaWNlbnNlLgotICogLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLQotICovCi0vKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotLyogIEZpbGVuYW1lOiBzYWRfbWJfb2Zmc2V0LmggICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICBEZXNjcmlwdGlvbjogSW1wbGVtZW50YXRpb24gZm9yIGluLWxpbmUgZnVuY3Rpb25zIHVzZWQgaW4gZGN0LmNwcCAgICAgICAgICAgKi8KLS8qICBNb2RpZmllZDogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgK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gICB4MTAgPSB4MTAgJiAoeDYgPDwgOCk7IC8qIHgxMCAmIDB4RkYwMEZGMDAgKi8KLSAgICB4NCA9IHg0ICsgKCh1aW50MzIpeDEwID4+IDgpOyAgLyogYWNjdW11bGF0ZSBoaWdoIGJ5dGVzICovCi0gICAgeDUgPSB4NSArIHgxMTsgIC8qIGFjY3VtdWxhdGUgbG93IGJ5dGVzICovCi0gICAgeDExID0geDExICYgKHg2IDw8IDgpOyAvKiB4MTEgJiAweEZGMDBGRjAwICovCi0gICAgeDQgPSB4NCArICgodWludDMyKXgxMSA+PiA4KTsgIC8qIGFjY3VtdWxhdGUgaGlnaCBieXRlcyAqLwotCi0gICAgLyoqKioqKioqKioqKioqKiovCi0gICAgeDEwID0geDUgLSAoeDQgPDwgOCk7IC8qIGV4dHJhY3QgbG93IGJ5dGVzICovCi0gICAgeDEwID0geDEwICsgeDQ7ICAgICAvKiBhZGQgd2l0aCBoaWdoIGJ5dGVzICovCi0gICAgeDEwID0geDEwICsgKHgxMCA8PCAxNik7IC8qIGFkZCB3aXRoIGxvd2VyIGhhbGYgd29yZCAqLwotCi0gICAgaWYgKCgodWludDMyKXgxMCA+PiAxNikgPD0gKHVpbnQzMilkbWluKSAvKiBjb21wYXJlIHdpdGggZG1pbiAqLwotICAgIHsKLSAgICAgICAgaWYgKC0teDgpCi0gICAgICAgIHsKLSNpZiAoTlVNQkVSPT0zKQotICAgICAgICAgICAgZ290byAgICAgICAgIExPT1BfU0FEMzsKLSNlbGlmIChOVU1CRVI9PTIpCi0gICAgICAgICAgICBnb3RvICAgICAgICAgTE9PUF9TQUQyOwotI2VsaWYgKE5VTUJFUj09MSkKLSAgICAgICAgICAgIGdvdG8gICAgICAgICBMT09QX1NBRDE7Ci0jZW5kaWYKLSAgICAgICAgfQotCi0gICAgfQotCi0gICAgcmV0dXJuICgodWludDMyKXgxMCA+PiAxNik7Ci19Ci0KLSNlbGlmIGRlZmluZWQoX19DQ19BUk0pICAvKiBvbmx5IHdvcmsg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HgxMCwgeDEwLCBsc3IgI1NISUZUOwotICAgICAgICBCSUMgICAgICB4MTAsIHgxMCwgeDExLCBsc2wgIygzMi1TSElGVCk7Ci0gICAgICAgIE1WTiAgICAgIHgxMSwgeDExLCBsc3IgI1NISUZUOwotICAgICAgICBCSUMgICAgICB4MTEsIHgxMSwgeDEyLCBsc2wgIygzMi1TSElGVCk7Ci0KLSAgICAgICAgTERSICAgICAgeDEyLCBbYmxrLCAjOF07Ci0gICAgfQotCi0gICAgLyogcHJvY2VzcyB4MTEgJiB4MTQgKi8KLSAgICB4MTEgPSBzYWRfNHBpeGVsTih4MTEsIHgxNCwgeDkpOwotCi0gICAgLyogcHJvY2VzcyB4MTIgJiB4MTAgKi8KLSAgICB4MTAgPSBzYWRfNHBpeGVsTih4MTAsIHgxMiwgeDkpOwotCi0gICAgc3VtX2FjY3VtdWxhdGU7Ci0KLSAgICBfX2FzbXsKLSAgICAgICAgLyoqKioqKiBwcm9jZXNzIDggcGl4ZWxzICoqKioqKi8KLSAgICAgICAgTERSICAgICAgeDExLCBbcmVmLCAjNF07Ci0gICAgICAgIExEUiAgICAgIHgxMiwgW3JlZiwgIzhdOwotICAgICAgICBMRFIgIHgxMCwgW3JlZl0sIGx4IDsKLSAgICAgICAgTERSICB4MTQsIFtibGssICM0XTsKLQotICAgICAgICBNVk4gICAgICB4MTAsIHgxMCwgbHNyICNTSElGVDsKLSAgICAgICAgQklDICAgICAgeDEwLCB4MTAsIHgxMSwgbHNsICMoMzItU0hJRlQpOwotICAgICAgICBNVk4gICAgICB4MTEsIHgxMSwgbHNyICNTSElGVDsKLSAgICAgICAgQklDICAgICAgeDExLCB4MTEsIHgxMiwgbHNsICMoMzItU0hJRlQpOwotCi0gICAgICAgIExEUiAgICAgIHgxMiwgW2Jsa10sICMxNjsKLSAgICB9Ci0KLSAgICAvKiBwcm9jZXNzIHgxMSAmIHgxNCAqLwotICAgIHgxMSA9IHNhZF80cGl4ZWxOKHgxMSwgeDE0LCB4OSk7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FUj09MSkKLV9faW5saW5lIGludDMyIHNhZF9tYl9vZmZzZXQxKFVDaGFyICpyZWYsIFVDaGFyICpibGssIEludCBseCwgSW50IGRtaW4pCi0jZW5kaWYKLXsKLSAgICBpbnQzMiB4NCwgeDUsIHg2LCB4OCwgeDksIHgxMCwgeDExLCB4MTIsIHgxNDsKLQotICAgIC8vICB4NSA9ICh4NDw8OCkgLSB4NDsKLSAgICB4NCA9IHg1ID0gMDsKLSAgICB4NiA9IDB4RkZGRjAwRkY7Ci0gICAgeDkgPSAweDgwODA4MDgwOyAvKiBjb25zdC4gKi8KLSAgICByZWYgLT0gTlVNQkVSOyAvKiBiaWMgcmVmLCByZWYsICMzICovCi0gICAgcmVmIC09IGx4OwotICAgIHg4ID0gMTY7Ci0KLSNpZiAoTlVNQkVSPT0zKQotTE9PUF9TQUQzOgotI2VsaWYgKE5VTUJFUj09MikKLUxPT1BfU0FEMjoKLSNlbGlmIChOVU1CRVI9PTEpCi1MT09QX1NBRDE6Ci0jZW5kaWYKLSAgICAvKioqKioqIHByb2Nlc3MgOCBwaXhlbHMgKioqKioqLwotICAgIHgxMCA9ICooKHVpbnQzMiopKHJlZiArPSBseCkpOyAvKiBEIEMgQiBBICovCi0gICAgeDExID0gKigodWludDMyKikocmVmICsgNCkpOyAgICAvKiBIIEcgRiBFICovCi0gICAgeDEyID0gKigodWludDMyKikocmVmICsgOCkpOyAgICAvKiBMIEsgSiBJICovCi0KLSAgICBpbnQzMiBzaGlmdCA9IFNISUZUOwotICAgIGludDMyIHNoaWZ0MiA9IDMyIC0gU0hJRlQ7Ci0gICAgYXNtIHZvbGF0aWxlKCJsZHIgICUzLCBbJTQsICM0XVxuXHQiCi0gICAgICAgICAgICAgICAgICJtdm4gICUwLCAlMCwgbHNyICU1XG5cdCIKLSAgICAgICAgICAgICAgICAgImJpYyAgJTAsICUwLCAlMSwgbHNsICU2XG5cdCIKLSAgICAgICAgICAgICAgICAgIm12biAgJTEsICUxLCBsc3IgJTVcblx0IgotICAgICAgICAgICAgICAgICAiYmljICAlMSwgJTEsICUyLCBsc2wgJTZcblx0IgotICAgICAgICAgICAgICAgICAibGRyICAlMiwgWyU0LCAjOF0iCi0gICAgICAgICAgICAgOiAiK3IiKHgxMCksICIrciIoeDExKSwgIityIih4MTIpLCAiPXIiKHgxNCkKLSAgICAgICAgICAgICAgICAgICAgICAgICA6ICJyIihibGspLCAiciIoc2hpZnQpLCAiciIoc2hpZnQyKSk7Ci0KLSAgICAvKiBwcm9jZXNzIHgxMSAmIHgxNCAqLwotICAgIHgxMSA9IHNhZF80cGl4ZWwoeDExLCB4MTQsIHg5KTsKLQotICAgIC8qIHByb2Nlc3MgeDEyICYgeDEwICovCi0gICAgeDEwID0gc2FkXzRwaXhlbCh4MTAsIHgxMiwgeDkpOwotCi0gICAgc3VtX2FjY3VtdWxhdGU7Ci0KLSAgICAvKioqKioqIHByb2Nlc3MgOCBwaXhlbHMgKioqKioqLwotICAgIHgxMCA9ICooKHVpbnQzMiopKHJlZiArIDgpKTsgLyogRCBDIEIgQSAqLwotICAgIHgxMSA9ICooKHVpbnQzMiopKHJlZiArIDEyKSk7ICAgLyogSCBHIEYgRSAqLwotICAgIHgxMiA9ICooKHVpbnQzMiopKHJlZiArIDE2KSk7ICAgLyogTCBLIEogSSAqLwotCi0gICAgYXNtIHZvbGF0aWxlKCJsZHIgICUzLCBbJTQsICM0XVxuXHQiCi0gICAgICAgICAgICAgICAgICJtdm4gICUwLCAlMCwgbHNyICU1XG5cdCIKLSAgICAgICAgICAgICAgICAgImJpYyAgJTAsICUwLCAlMSwgbHNsICU2XG5cdCIKLSAgICAgICAgICAgICAgICAgIm12biAgJTEsICUxLCBsc3IgJTVcblx0IgotICAgICAgICAgICAgICAgICAiYmljICAlMSwgJTEsICUyLCBsc2wgJTZcblx0IgotICAgICAgICAgICAgICAgICAibGRyICAlMiwgWyU0LCAjOF0iCi0gICAgICAgICAgICAgOiAiK3IiKHgxMCksICIrciIoeDExKSwgIityIih4MTIpL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0aGlyZAotICogcGFydGllcyBmcm9tIHVzaW5nIHRoZSBjb2RlIGZvciBub24gTVBFRy00IFZpZGVvIChJU08vSUVDIDE0NDk2LTIpIHN0YW5kYXJkCi0gKiBjb25mb3JtaW5nIHByb2R1Y3RzLiBUaGlzIGNvcHlyaWdodCBub3RpY2UgbXVzdCBiZSBpbmNsdWRlZCBpbiBhbGwgY29waWVzIG9yCi0gKiBkZXJpdmF0aXZlIHdvcmtzLgotICoKLSAqIENvcHlyaWdodCAoYykgMTk5NwotICoKLSAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLQotCi0vKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKipIZWFkZXJCZWdpbioqKioqKioKLSAqCi0gKiBGaWxlOiAgICB2bGMuaAotICoKLSAqIEF1dGhvcjogIFJvYmVydCBEYW5pZWxzZW4KLSAqIENyZWF0ZWQ6IDA3LjA2Ljk2Ci0gKgotICogRGVzY3JpcHRpb246IHZsYyB0YWJsZXMgZm9yIGVuY29kZXIKLSAqCi0gKiBOb3RlczogICBJZGVhIHRha2VuIGZyb20gTVBFRy0yIHNvZnR3YXJlIHNpbXVsYXRpb24gZ3JvdXAKLSAqCi0gKiBNb2RpZmllZDoKLSAqICAyOC4xMC45NiBSb2JlcnQgRGFuaWVsc2VuOiBBZGRlZCB0YWJsZXMgZm9yIEludHJhIGx1bWluYW5jZQotICogICAgICAgICAgY29lZmZpY2llbnRzCi0gKiAgICAgIDAxLjA1Ljk3IEx1aXMgRHVjbGEtU29hcmVzOiBhZGRlZCBWTTcuMCBSZXZlcnNpYmxlIFZMQyB0YWJsZXMgKFJWTEMpLgotICogICAgICAxMy4wNS45NyBNaW5odWEgWmhvdTogYWRkZWQgY2JweV90YWIzLGNicHlfdGFiMgotICoKLSAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKkhlYWRlckVuZCoqKioqKioqKi8KLQotLyoqKioqKioqKioqKioqKioqKioqKioqKiAgICBJTkNMVURFIEZJTEVTICAgICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotCi0jaWZuZGVmIF9WTENfRU5DX1RBQl9IXwotI2RlZmluZSBfVkxDX0VOQ19UQUJfSF8KLQotCi0jaW5jbHVkZSAibXA0ZGVmLmgiCi0vKiB0eXBlIGRlZmluaXRpb25zIGZvciB2YXJpYWJsZSBsZW5ndGggY29kZSB0YWJsZSBlbnRyaWVzICovCi0KLQotCi1zdGF0aWMgY29uc3QgSW50IGludHJhX21heF9sZXZlbFsyXVs2NF0gPQotewotICAgIHsyNywgMTAsICA1LCAgNCwgIDMsICAzLCAgMywgIDMsCi0gICAgICAgIDIsICAyLCAgMSwgIDEsICAxLCAgMSwgIDEsICAwLAotICAgICAgICAwLCAgMCwgIDAsICAwLCAgMCwgIDAsICAwLCAgMCwKLSAgICAgICAgMCwgIDAsICAwLCAgMCwgIDAsICAwLCAgMCwgIDAsCi0gICAgICAgIDAsICAwLCAgMCwgIDAsICAwLCAgMCwgIDAsICAwLAotICAgICAgICAwLCAgMCwgIDAsICAwLCAgMCwgIDAsICAwLCAgMCwKLSAgICAgICAgMCwgIDAsICAwLCAgMCwgIDAsICAwLCAgMCwgIDAsCi0gICAgICAgIDAsICAwLCAgMCwgIDAsICAwLCAgMCwgIDAsICAwLAotICAgIH0sCi0KLSAgICB7OCwgIDMsICAyLCAgMiwgIDIsICAyLCAgMiwgIDEsCi0gICAgIDEsICAxLCAgMSwgIDEsICAxLCAgMSwgIDEsICAxLAotICAgICAxLCAgMSwgIDEsICAxLCAgMSwgIDAsICAwLCAgMCwKLSAgICAgMCwgIDAsICAwLCAgMCwgIDAsICAwLCAgMCwgIDAsCi0gICAgIDAsICAwLCAgMCwgIDAsICAwLCAgMCwgIDAsICAwLAotICAgICAwLCAgMCwgIDAsICAwLCAgMCwgIDA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gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMSwgIDEsICAxLCAgMSwgIDAsICAwLCAgMCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAwLCAgMCwgIDAsICAwLCAgMCwgIDAsICAwLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDAsICAwLCAgMCwgIDAsICAwLCAgMCwgIDAKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfTsKLQotCi1zdGF0aWMgY29uc3QgSW50IGludHJhX21heF9ydW4xWzldID0geyA5OTksIDIwLCAgNiwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDEsICAwLCAgMCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDAsICAwLCAgMAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH07Ci0KLXN0YXRpYyBjb25zdCBJbnQgaW50ZXJfbWF4X3J1bjBbMTNdID0geyA5OTksCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMjYsIDEwLCAgNiwgIDIsICAxLCAgMSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAwLCAgMCwgIDAsICAwLCAgMCwgIDAKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfTsKLQotCi1zdGF0aWMgY29uc3QgSW50IGludGVyX21heF9ydW4xWzRdID0geyA5OTksIDQwLCAgMSwgIDAgfTsKLQotCi0KLS8qIERDIHByZWRpY3Rpb24gc2l6ZXMgKi8KLQotc3RhdGljIGNvbnN0IFZMQ3RhYmxlIERDdGFiX2x1bVsxM10gPQotewotICAgIHszLCAzfSwgezMsIDJ9LCB7MiwgMn0sIHsyLCAzfSwgezEsIDN9LCB7MSwgNH0sIHsxLCA1fSwgezEsIDZ9LCB7MSwgN30sCi0gICAgezEsIDh9LCB7MSwgOX0sIHsxLC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SwgezB4MDAsIDB9Ci0gICAgfSwKLSAgICB7Ci0gICAgICAgIHsweDE0LCA3fSwgezB4MDAsIDB9LCB7MHgwMCwgMH0sIHsweDAwLCAwfQotICAgIH0sCi0gICAgewotICAgICAgICB7MHgxYywgOH0sIHsweDAwLCAwfSwgezB4MDAsIDB9LCB7MHgwMCwgMH0KLSAgICB9LAotICAgIHsKLSAgICAgICAgezB4MWIsIDh9LCB7MHgwMCwgMH0sIHsweDAwLCAwfSwgezB4MDAsIDB9Ci0gICAgfSwKLSAgICB7Ci0gICAgICAgIHsweDIxLCA5fSwgezB4MDAsIDB9LCB7MHgwMCwgMH0sIHsweDAwLCAwfQotICAgIH0sCi0gICAgewotICAgICAgICB7MHgyMCwgOX0sIHsweDAwLCAwfSwgezB4MDAsIDB9LCB7MHgwMCwgMH0KLSAgICB9LAotICAgIHsKLSAgICAgICAgezB4MWYsIDl9LCB7MHgwMCwgMH0sIHsweDAwLCAwfSwgezB4MDAsIDB9Ci0gICAgfSwKLSAgICB7Ci0gICAgICAgIHsweDFlLCA5fSwgezB4MDAsIDB9LCB7MHgwMCwgMH0sIHsweDAwLCAwfQotICAgIH0sCi0gICAgewotICAgICAgICB7MHgxZCwgOX0sIHsweDAwLCAwfSwgezB4MDAsIDB9LCB7MHgwMCwgMH0KLSAgICB9LAotICAgIHsKLSAgICAgICAgezB4MWMsIDl9LCB7MHgwMCwgMH0sIHsweDAwLCAwfSwgezB4MDAsIDB9Ci0gICAgfSwKLSAgICB7Ci0gICAgICAgIHsweDFiLCA5fSwgezB4MDAsIDB9LCB7MHgwMCwgMH0sIHsweDAwLCAwfQotICAgIH0sCi0gICAgewotICAgICAgICB7MHgxYSwgOX0sIHsweDAwLCAwfSwgezB4MDAsIDB9LCB7MHgwMCwgMH0KLSAgICB9LAotICAgIHsKLSAgICAgICAgezB4MjIsIDExfSwgezB4MDAsIDB9LCB7MHgwMCwgMH0sIHsweDAwLCAwfQotICAgIH0sCi0gICAgewotICAgICAgICB7MHgy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xZmZjLCAxNX0KLX07Ci0KLQotLyogSW5kZXhlZCBieSBbbGV2ZWwtMV0gKi8KLQotc3RhdGljIGNvbnN0IFZMQ3RhYmxlIGNvZWZmX1JWTEN0YWIyWzEzXSA9Ci17Ci0gICAgLyogcnVuID0gMSAqLwotICAgIHsgICAgIDB4MSwgIDR9LAotICAgIHsgICAgIDB4OCwgIDV9LAotICAgIHsgICAgMHgyZCwgIDd9LAotICAgIHsgICAgMHg2YywgIDh9LAotICAgIHsgICAgMHg2ZCwgIDh9LAotICAgIHsgICAgMHhkYywgIDl9LAotICAgIHsgICAweDFkZCwgMTB9LAotICAgIHsgICAweDNkYywgMTF9LAotICAgIHsgICAweDNkZCwgMTF9LAotICAgIHsgICAweDc3YywgMTJ9LAotICAgIHsgICAweGZiYywgMTN9LAotICAgIHsgIDB4MWY3ZCwgMTR9LAotICAgIHsgIDB4MWZiYywgMTR9Ci19OwotCi0KLS8qIEluZGV4ZWQgYnkgW2xldmVsLTFdICovCi0KLXN0YXRpYyBjb25zdCBWTEN0YWJsZSBjb2VmZl9SVkxDdGFiM1sxMV0gPQotewotICAgIC8qIHJ1biA9IDIgKi8KLQotICAgIHsgICAgIDB4NCwgIDV9LAotICAgIHsgICAgMHgyYywgIDd9LAotICAgIHsgICAgMHhiYywgIDl9LAotICAgIHsgICAweDFkYywgMTB9LAotICAgIHsgICAweDNiYywgMTF9LAotICAgIHsgICAweDNiZCwgMTF9LAotICAgIHsgICAweGVmZCwgMTN9LAotICAgIHsgICAweGY3YywgMTN9LAotICAgIHsgICAweGY3ZCwgMTN9LAotICAgIHsgIDB4MWVmZCwgMTR9LAotICAgIHsgIDB4MWY3YywgMTR9Ci19OwotCi0KLS8qIEluZGV4ZWQgYnkgW2xldmVsLTFdICovCi0KLXN0YXRpYyBjb25zdCBWTEN0YWJsZSBjb2VmZl9SVkxDdGFiNFs5XSA9Ci17Ci0gICAgLyogcnVuID0gMyAqLwotICAgIHsgICAgIDB4NSwgIDV9LAotICAgIHsgICAgMHg1YywgIDh9LAotICAgIHsgICAgMHhiZCwgIDl9LAotICAgIHsgICAweDM3ZCwgMTF9LAotICAgIHsgICAweDZmYywgMTJ9LAotICAgIHsgICAweGVmYywgMTN9LAotICAgIHsgIDB4MWRmZCwgMTR9LAotICAgIHsgIDB4MWVmYywgMTR9LAotICAgIHsgIDB4MWZmZCwgMTV9Ci19OwotCi0KLS8qIEluZGV4ZWQgYnkgW3J1bi00XVtsZXZlbC0xXSAqLwotCi1zdGF0aWMgY29uc3QgVkxDdGFibGUgY29lZmZfUlZMQ3RhYjVbMl1bNl0gPQotewotICAgIC8qIHJ1biA9IDQgKi8KLSAgICB7Ci0gICAgICAgIHsgICAgIDB4YywgIDZ9LAotICAgICAgICB7ICAgIDB4NWQsICA4fSwKLSAgICAgICAgeyAgIDB4MWJkLCAxMH0sCi0gICAgICAgIHsgICAweDNmZCwgMTJ9LAotICAgICAgICB7ICAgMHg2ZmQsIDEyfSwKLSAgICAgICAgeyAgMHgxYmZkLCAxNH0KLSAgICB9LAotICAgIC8qIHJ1biA9IDUgKi8KLSAgICB7Ci0gICAgICAgIHsgICAgIDB4ZCwgIDZ9LAotICAgICAgICB7ICAgIDB4N2QsICA5fSwKLSAgICAgICAgeyAgIDB4MmZjLCAxMX0sCi0gICAgICAgIHsgICAweDVmYywgMTJ9LAotICAgICAgICB7ICAweDFiZmMsIDE0fSwKLSAgICAgICAgeyAgMHgxZGZjLCAxNH0KLSAgICB9Ci19OwotCi0KLS8qIEluZGV4ZWQgYnkgW3J1bi02XVtsZXZlbC0xXSAgICAgICAqLwotCi1zdGF0aWMgY29uc3QgVkxDdGFibGUgY29lZmZfUlZMQ3RhYjZbMl1bNV0gPQotewotCi0gICAgLyogcnVuID0gNiAqLwotICAgIHsKLSAgICAgICAgeyAgICAweDFjLCAgN30sCi0gICAgICAgIHsgICAweDE3YywgMTB9LAotICAgICAgICB7ICAgMHgyZmQsIDExfSwKLSAgICAgICAgeyAgIDB4NWZkLCAxMn0sCi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LCAgNX0sCi0gICAgeyAgIDB4M2Y4LCAxMX0sCi0gICAgeyAgMHgzZGZjLCAxNX0KLQotfTsKLQotc3RhdGljIGNvbnN0IFZMQ3RhYmxlIGNvZWZmX1JWTEN0YWIxMlsxMV1bMl0gPQotewotICAgIC8qIHJ1biA9IDMgKi8KLSAgICB7Ci0gICAgICAgIHsgICAgMHgxOCwgIDZ9LAotICAgICAgICB7ICAgMHg3ZGQsIDEyfQotICAgIH0sCi0gICAgLyogcnVuID0gNCAqLwotICAgIHsKLSAgICAgICAgeyAgICAweDE5LCAgNn0sCi0gICAgICAgIHsgICAweDdlYywgMTJ9Ci0gICAgfSwKLSAgICAvKiBydW4gPSA1ICovCi0gICAgewotICAgICAgICB7ICAgIDB4MjIsICA2fSwKLSAgICAgICAgeyAgIDB4ZmVkLCAxM30KLSAgICB9LAotICAgIC8qIHJ1biA9IDYgKi8KLSAgICB7Ci0gICAgICAgIHsgICAgMHgyMywgIDZ9LAotICAgICAgICB7ICAgMHhmZjQsIDEzfQotICAgIH0sCi0gICAgLyogcnVuID0gNyAqLwotICAgIHsKLSAgICAgICAgeyAgICAweDM1LCAgN30sCi0gICAgICAgIHsgICAweGZmNSwgMTN9Ci0gICAgfSwKLSAgICAvKiBydW4gPSA4ICovCi0gICAgewotICAgICAgICB7ICAgIDB4MzgsICA3fSwKLSAgICAgICAgeyAgIDB4ZmY4LCAxM30KLSAgICB9LAotICAgIC8qIHJ1biA9IDkgKi8KLSAgICB7Ci0gICAgICAgIHsgICAgMHgzOSwgIDd9LAotICAgICAgICB7ICAgMHhmZjksIDEzfQotICAgIH0sCi0gICAgLyogcnVuID0gMTAgKi8KLSAgICB7Ci0gICAgICAgIHsgICAgMHg0MiwgIDd9LAotICAgICAgICB7ICAweDFmZjQsIDE0fQotICAgIH0sCi0gICAgLyogcnVuID0gMTEgKi8KLSAgICB7Ci0gICAgICAgIHsgICAgMHg0MywgIDd9LAotICAgICAgICB7ICAweDFmZjUsIDE0fQotICAgIH0sC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ICAgeyAgMHgzZWZjLCAxNX0sCi0gICAgeyAgMHgzZWZkLCAxNX0sCi0gICAgeyAgMHgzZjdjLCAxNX0sCi0gICAgeyAgMHgzZjdkLCAxNX0KLX07Ci0KLQotCi0vKiBDb2VmZnMgZm9yIGxhc3QgPSAwLCBydW4gPSAwLiBJbmRleGVkIGJ5IFtsZXZlbC0xXSAqLwotCi1zdGF0aWMgY29uc3QgVkxDdGFibGUgY29lZmZfUlZMQ3RhYjE0WzE5XSA9Ci17Ci0gICAgLyogcnVuID0gMCAqLwotICAgIHsgICAgIDB4NiwgIDN9LAotICAgIHsgICAgIDB4MSwgIDR9LAotICAgIHsgICAgIDB4NCwgIDV9LAotICAgIHsgICAgMHgxYywgIDd9LAotICAgIHsgICAgMHgzYywgIDh9LAotICAgIHsgICAgMHgzZCwgIDh9LAotICAgIHsgICAgMHg3YywgIDl9LAotICAgIHsgICAgMHhmYywgMTB9LAotICAgIHsgICAgMHhmZCwgMTB9LAotICAgIHsgICAweDFmYywgMTF9LAotICAgIHsgICAweDFmZCwgMTF9LAotICAgIHsgICAweDNmYywgMTJ9LAotICAgIHsgICAweDdmYywgMTN9LAotICAgIHsgICAweDdmZCwgMTN9LAotICAgIHsgICAweGJmYywgMTN9LAotICAgIHsgICAweGJmZCwgMTN9LAotICAgIHsgICAweGZmYywgMTR9LAotICAgIHsgICAweGZmZCwgMTR9LAotICAgIHsgIDB4MWZmYywgMTV9Ci19OwotCi1zdGF0aWMgY29uc3QgVkxDdGFibGUgY29lZmZfUlZMQ3RhYjE1WzEwXSA9Ci17Ci0gICAgLyogcnVuID0gMSAqLwotICAgIHsgICAgIDB4NywgIDN9LAotICAgIHsgICAgIDB4YywgIDZ9LAotICAgIHsgICAgMHg1YywgIDh9LAotICAgIHsgICAgMHg3ZCwgIDl9LAotICAgIHsgICAweDE3YywgMTB9LAotICAgIHsgICAweDJmYywgMTF9LAotICAgIHsgICAweDNmZCwgMTJ9LAotICAgIHsgICAweGRmYywgMTN9LAotICAgIHsgIDB4MTdmYywgMTR9LAotICAgIHsgIDB4MTdmZCwgMTR9Ci19OwotCi1zdGF0aWMgY29uc3QgVkxDdGFibGUgY29lZmZfUlZMQ3RhYjE2WzJdWzddID0KLXsKLSAgICAvKiBydW4gPSAyICovCi0gICAgewotICAgICAgICB7ICAgICAweGEsICA0fSwKLSAgICAgICAgeyAgICAweDFkLCAgN30sCi0gICAgICAgIHsgICAgMHhiYywgIDl9LAotICAgICAgICB7ICAgMHgyZmQsIDExfSwKLSAgICAgICAgeyAgIDB4NWZjLCAxMn0sCi0gICAgICAgIHsgIDB4MWJmYywgMTR9LAotICAgICAgICB7ICAweDFiZmQsIDE0fQotICAgIH0sCi0gICAgLyogcnVuID0gMyAqLwotICAgIHsKLSAgICAgICAgeyAgICAgMHg1LCAgNX0sCi0gICAgICAgIHsgICAgMHg1ZCwgIDh9LAotICAgICAgICB7ICAgMHgxN2QsIDEwfSwKLSAgICAgICAgeyAgIDB4NWZkLCAxMn0sCi0gICAgICAgIHsgICAweGRmZCwgMTN9LAotICAgICAgICB7ICAweDFkZmMsIDE0fSwKLSAgICAgICAgeyAgMHgxZmZkLCAxNX0KLSAgICB9Ci19OwotCi1zdGF0aWMgY29uc3QgVkxDdGFibGUgY29lZmZfUlZMQ3RhYjE3WzVdID0KLXsKLSAgICAvKiBydW4gPSA0ICovCi0gICAgeyAgICAgMHg4LCAgNX0sCi0gICAgeyAgICAweDZjLCAgOH0sCi0gICAgeyAgIDB4MzdjLCAxMX0sCi0gICAgeyAgIDB4ZWZjLCAxM30sCi0gICAgeyAgMHgyZmZjLCAxNX0KLX07Ci0KLXN0YXRpYyBjb25zdCBWTEN0YWJsZSBjb2VmZl9SVkxDdGFiMThbM11bNF0gPQotewotICAgIC8qIHJ1biA9IDUgKi8KLSAgICB7Ci0gICAgICAgIHsgICAgIDB4OSwgIDV9LAotICAgICAgICB7ICAgIDB4YmQsICA5fSwKLSAgICAgICAgeyAgIDB4MzdkLCAxMX0sCi0gICAgICAgIHsgICAweGVmZCwgMTN9Ci0gICAgfSwKLSAgICAvKiBydW4gPSA2ICovCi0gICAgewotICAgICAgICB7ICAgICAweGQsICA2fSwKLSAgICAgICAgeyAgIDB4MWJjLCAxMH0sCi0gICAgICAgIHsgICAweDZmYywgMTJ9LAotICAgICAgICB7ICAweDFkZmQsIDE0fQotICAgIH0sCi0gICAgLyogcnVuID0gNyAqLwotICAgIHsKLSAgICAgICAgeyAgICAweDE0LCAgNn0sCi0gICAgICAgIHsgICAweDFiZCwgMTB9LAotICAgICAgICB7ICAgMHg2ZmQsIDEyfSwKLSAgICAgICAgeyAgMHgyZmZkLCAxNX0KLSAgICB9Ci19OwotCi1zdGF0aWMgY29uc3QgVkxDdGFibGUgY29lZmZfUlZMQ3RhYjE5WzJdWzNdID0KLXsKLSAgICAvKiBydW4gPSA4ICovCi0gICAgewotICAgICAgICB7ICAgIDB4MTUsICA2fSwKLSAgICAgICAgeyAgIDB4MWRjLCAxMH0sCi0gICAgICAgIHsgICAweGY3YywgMTN9Ci0gICAgfSwKLSAgICAvKiBydW4gPSA5ICovCi0gICAgewotICAgICAgICB7ICAgIDB4MmMsICA3fSwKLSAgICAgICAgeyAgIDB4MWRkLCAxMH0sCi0gICAgICAgIHsgIDB4MWVmYywgMTR9Ci0gICAgfQotfTsKLQotc3RhdGljIGNvbnN0IFZMQ3RhYmxlIGNvZWZmX1JWTEN0YWIyMFs4XVsyXSA9Ci17Ci0gICAgLyogcnVuID0gMTAgKi8KLSAgICB7Ci0gICAgICAgIHsgICAgMHgyZCwgIDd9LAotICAgICAgICB7ICAgMHgzYmMsIDExfQotICAgIH0sCi0gICAgLyogcnVuID0gMTEgKi8KLSAgICB7Ci0gICAgICAgIHsgICAgMHgzNCwgIDd9LAotICAgICAgICB7ICAgMHg3N2MsIDEyfQotICAgIH0sCi0gICAgLyogcnVuID0gMTIgKi8KLSAgICB7Ci0gICAgICAgIHsgICAgMHg2ZCwgIDh9LAotICAgICAgICB7ICAgMHhmN2QsIDEzfQotICAgIH0sCi0gICAgLyogcnVuID0gMTMgKi8KLSAgICB7Ci0gICAgICAgIHsgICAgMHg3NCwgIDh9LAotICAgICAgICB7ICAweDFlZmQsIDE0fQotICAgIH0sCi0gICAgLyogcnVuID0gMTQgKi8KLSAgICB7Ci0gICAgICAgIHsgICAgMHg3NSwgIDh9LAotICAgICAgICB7ICAweDFmN2MsIDE0fQotICAgIH0sCi0gICAgLyogcnVuID0gMTUgKi8KLSAgICB7Ci0gICAgICAgIHsgICAgMHhkYywgIDl9LAotICAgICAgICB7ICAweDFmN2QsIDE0fQotICAgIH0sCi0gICAgLyogcnVuID0gMTYgKi8KLSAgICB7Ci0gICAgICAgIHsgICAgMHhkZCwgIDl9LAotICAgICAgICB7ICAweDFmYmMsIDE0fQotICAgIH0sCi0gICAgLyogcnVuID0gMTcgKi8KLSAgICB7Ci0gICAgICAgIHsgICAgMHhlYywgIDl9LAotICAgICAgICB7ICAweDM3ZmMsIDE1fQotICAgIH0KLX07Ci0KLXN0YXRpYyBjb25zdCBWTEN0YWJsZSBjb2VmZl9SVkxDdGFiMjFbMjFdID0KLXsKLSAgICAvKiBydW4gPSAxOCAtPiAzOCAqLwotICAgIHsgICAweDFlYywgMTB9LAotICAgIHsgICAweDFlZCwgMTB9LAotICAgIHsgICAweDFmNCwgMTB9LAotICAgIHsgICAweDNiZCwgMTF9LAotICAgIHsgICAweDNkYywgMTF9LAotICAgIHsgICAweDNkZCwgMTF9LAotICAgIHsgICAweDNlYywgMTF9LAotICAgIHsgICAweDNlZCwgMTF9LAotICAgIHsgICAweDNmNCwgMTF9LAotICAgIHsgICAweDc3ZCwgMTJ9LAotICAgIHsgICAweDdiYywgMTJ9LAotICAgIHsgICAweDdiZCwgMTJ9LAotICAgIHsgICAweGZiYywgMTN9LAotICAgIHsgICAweGZiZCwgMTN9LAotICAgIHsgICAweGZkYywgMTN9LAotICAgIHsgICAweGZkZCwgMTN9LAotICAgIHsgIDB4MWZiZCwgMTR9LAotICAgIHs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wKLSAgICAgICAgeyAgIDB4N2VjLCAxMn0KLSAgICB9LAotICAgIC8qIHJ1biA9IDUgKi8KLSAgICB7Ci0gICAgICAgIHsgICAgMHgyMiwgIDZ9LAotICAgICAgICB7ICAgMHhmZWQsIDEzfQotICAgIH0sCi0gICAgLyogcnVuID0gNiAqLwotICAgIHsKLSAgICAgICAgeyAgICAweDIzLCAgNn0sCi0gICAgICAgIHsgICAweGZmNCwgMTN9Ci0gICAgfSwKLSAgICAvKiBydW4gPSA3ICovCi0gICAgewotICAgICAgICB7ICAgIDB4MzUsICA3fSwKLSAgICAgICAgeyAgIDB4ZmY1LCAxM30KLSAgICB9LAotICAgIC8qIHJ1biA9IDggKi8KLSAgICB7Ci0gICAgICAgIHsgICAgMHgzOCwgIDd9LAotICAgICAgICB7ICAgMHhmZjgsIDEzfQotICAgIH0sCi0gICAgLyogcnVuID0gOSAqLwotICAgIHsKLSAgICAgICAgeyAgICAweDM5LCAgN30sCi0gICAgICAgIHsgICAweGZmOSwgMTN9Ci0gICAgfSwKLSAgICAvKiBydW4gPSAxMCAqLwotICAgIHsKLSAgICAgICAgeyAgICAweDQyLCAgN30sCi0gICAgICAgIHsgIDB4MWZmNCwgMTR9Ci0gICAgfSwKLSAgICAvKiBydW4gPSAxMSAqLwotICAgIHsKLSAgICAgICAgeyAgICAweDQzLCAgN30sCi0gICAgICAgIHsgIDB4MWZmNSwgMTR9Ci0gICAgfSwKLSAgICAvKiBydW4gPSAxMiAqLwotICAgIHsKLSAgICAgICAgeyAgICAweDc5LCAgOH0sCi0gICAgICAgIHsgIDB4MWZmOCwgMTR9Ci0gICAgfSwKLSAgICAvKiBydW4gPSAxMyAqLwotICAgIHsKLSAgICAgICAgeyAgICAweDgyLCAgOH0sCi0gICAgICAgIHsgIDB4M2RmZCwgMTV9Ci0gICAgfQotCi19OwotCi1zdGF0aWMgY29uc3QgVkxDdGFibGUgY29lZmZfUlZMQ3RhYjI1WzMyXSA9Ci17Ci0gICAgLyogcnVuID0g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SogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgUHV0Q29lZmZfSW50ZXJfUlZMQygpLgotKgotKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKipIZWFkZXJFbmQqKioqKioqKiovCi0KLS8qKioqKioqKioqKioqKioqKioqKioqKiogICAgSU5DTFVERSBGSUxFUyAgICAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLQotCi0jaW5jbHVkZSAibXA0bGliX2ludC5oIgotI2luY2x1ZGUgIm1wNGVuY19saWIuaCIKLSNpbmNsdWRlICJ2bGNfZW5jX3RhYi5oIgotI2luY2x1ZGUgImJpdHN0cmVhbV9pby5oIgotI2luY2x1ZGUgIm00dmVuY19vc2NsLmgiCi0jaW5jbHVkZSAidmxjX2VuY29kZV9pbmxpbmUuaCIKLQotdHlwZWRlZiB2b2lkICgqQmxvY2tDb2RlQ29lZmZQdHIpKFJ1bkxldmVsQmxvY2sqLCBCaXRzdHJlYW1FbmNWaWRlbyosIEludCwgSW50LCBVQ2hhcikgOwotCi1jb25zdCBzdGF0aWMgSW50IG1vZGVfTUJ0eXBlW10gPQotewotICAgIDMsCi0gICAgMCwKLSAgICA0LAotICAgIDEsCi0gICAgMiwKLX07Ci0KLWNvbnN0IHN0YXRpYyBJbnQgemlnemFnX2ludltOQ09FRkZfQkxPQ0tdID0KLXsKLSAgICAwLCAgMSwgIDgsIDE2LCAgOSwgIDIsICAzLCAxMCwKLSAgICAxNywgMjQsIDMyLCAyNSwgMTgsIDExLCAgNCwgIDUsCi0gICAgMTIsIDE5LCAyNiwgMzMsIDQwLCA0OCwgNDEsIDM0LAotICAgIDI3LCAyMCwgMTMsICA2LCAgNywgMTQsIDIxLCAyOCwKLSAgICAzNSwgNDIsIDQ5LCA1NiwgNTcsIDUwLCA0MywgMzYsCi0gICAgMjksIDIyLCAxNSwgMjMsIDMwLCAzNywgNDQsIDUxLAotICAgIDU4LCA1OSwgNTIsI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JpdHN0cmVhbSwgNyArIDEsIDYvKjMqLyk7Ci0gICAgICAgICAgICBCaXRzdHJlYW1QdXRCaXRzKGJpdHN0cmVhbSwgbGVuZ3RoLCAoVUludCljb2VmZl90YWI4W2xldmVsLTFdLmNvZGUpOwotICAgICAgICAgICAgbGVuZ3RoICs9IDg7Ci0gICAgICAgIH0KLSAgICB9Ci0gICAgZWxzZSBpZiAocnVuID4gMCAmJiBydW4gPCA3ICYmIGxldmVsIDwgNCkKLSAgICB7Ci0gICAgICAgIGxlbmd0aCA9IGNvZWZmX3RhYjlbcnVuLTFdW2xldmVsLTFdLmxlbjsKLSAgICAgICAgaWYgKGxlbmd0aCkKLSAgICAgICAgewotICAgICAgICAgICAgQml0c3RyZWFtUHV0Qml0cyhiaXRzdHJlYW0sIDcgKyAxLCA2LyozKi8pOwotICAgICAgICAgICAgQml0c3RyZWFtUHV0Qml0cyhiaXRzdHJlYW0sIGxlbmd0aCwgKFVJbnQpY29lZmZfdGFiOVtydW4tMV1bbGV2ZWwtMV0uY29kZSk7Ci0gICAgICAgICAgICBsZW5ndGggKz0gODsKLSAgICAgICAgfQotICAgIH0KLSAgICBlbHNlIGlmIChydW4gPiA2ICYmIHJ1biA8IDIxICYmIGxldmVsID09IDEpCi0gICAgewotICAgICAgICBsZW5ndGggPSBjb2VmZl90YWIxMFtydW4tN10ubGVuOwotICAgICAgICBpZiAobGVuZ3RoKQotICAgICAgICB7Ci0gICAgICAgICAgICBCaXRzdHJlYW1QdXRCaXRzKGJpdHN0cmVhbSwgNyArIDEsIDYvKjMqLyk7Ci0gICAgICAgICAgICBCaXRzdHJlYW1QdXRCaXRzKGJpdHN0cmVhbSwgbGVuZ3RoLCAoVUludCljb2VmZl90YWIxMFtydW4tN10uY29kZSk7Ci0gICAgICAgICAgICBsZW5ndGggKz0gODsKLSAgICAgICAgfQotICAgIH0KLSAgICByZXR1cm4gbGVuZ3RoOwotfQotCi0KLQotLyogPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09ICovCi0vKiAgRnVuY3Rpb24gOiBNQlZsY0VuY29kZSgpICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICBEYXRlICAgICA6IDA5LzEwLzIwMDAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogIFB1cnBvc2UgIDogRW5jb2RlIEdPViBIZWFkZXIgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgSW4vb3V0ICAgOiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICBSZXR1cm4gICA6ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogIE1vZGlmaWVkIDogNS8yMS8wMSwgYnJlYWsgdXAgaW50byBzbWFsbGVyIGZ1bmN0aW9ucyAgICAgICAgICAgICAgICAgICAgICovCi0vKiA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0gKi8KLSNpZm5kZWYgSDI2M19PTkxZCi0vKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0vKiBEYXRhIFBhcnRpdGlvbmluZyBJLVZPUCBFbmNvZGluZyAgICovCi0vKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0KLXZvaWQgTUJWbGNFbmNvZGVEYXRhUGFyX0lfVk9QKAotICAgIFZpZGVvRW5jRGF0YSAqdmlkZW8sCi0gICAgSW50IG5jb2VmYmxja1tdLAotICAgIHZvaWQgKmJsa0NvZGVQdHIpCi17Ci0KLSAgICBCaXRzdHJlYW1FbmNWaWRlbyAqYnMxID0gdmlkZW8tPmJpdHN0cmVhbTE7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1vZGUgPT0gTU9ERV9JTlRFUikgJiYgKHZpZGVvLT5tb3RbbWJudW1dWzBdLnggPT0gMCkgJiYgKHZpZGVvLT5tb3RbbWJudW1dWzBdLnkgPT0gMCkpCi0gICAgICAgICAgICBNb2RlID0gdmlkZW8tPmhlYWRlckluZm8uTW9kZVt2aWRlby0+bWJudW1dID0gTU9ERV9TS0lQUEVEOwotICAgICAgICBlbHNlIGlmICgoTW9kZSA9PSBNT0RFX0lOVEVSNFYpICYmICh2aWRlby0+bW90W21ibnVtXVsxXS54ID09IDApICYmICh2aWRlby0+bW90W21ibnVtXVsxXS55ID09IDApCi0gICAgICAgICAgICAgICAgICYmICh2aWRlby0+bW90W21ibnVtXVsyXS54ID09IDApICYmICh2aWRlby0+bW90W21ibnVtXVsyXS55ID09IDApCi0gICAgICAgICAgICAgICAgICYmICh2aWRlby0+bW90W21ibnVtXVszXS54ID09IDApICYmICh2aWRlby0+bW90W21ibnVtXVszXS55ID09IDApCi0gICAgICAgICAgICAgICAgICYmICh2aWRlby0+bW90W21ibnVtXVs0XS54ID09IDApICYmICh2aWRlby0+bW90W21ibnVtXVs0XS55ID09IDApKQotICAgICAgICAgICAgTW9kZSA9IHZpZGVvLT5oZWFkZXJJbmZvLk1vZGVbdmlkZW8tPm1ibnVtXSA9IE1PREVfU0tJUFBFRDsKLSAgICB9Ci0KLQotICAgIGlmIChNb2RlID09IE1PREVfU0tJUFBFRCkKLSAgICB7Ci0gICAgICAgIEJpdHN0cmVhbVB1dDFCaXRzKGJzMSwgMSk7IC8qIG5vdF9jb2RlZCA9IDEgKi8KLSAgICAgICAgcmV0dXJuOwotICAgIH0KLSAgICBlbHNlCi0gICAgICAgIEJpdHN0cmVhbVB1dDFCaXRzKGJzMSwgMCk7IC8qIG5vdF9jb2RlZCA9MCAqLwotCi0gICAgdmlkZW8tPlFQX3ByZXYgPSB2aWRlby0+UVBNQlttYm51bV07Ci0gICAgdmlkZW8tPnVzZVByZXZRUCA9IDE7Ci0KLSAgIC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5LCBiczEpOwotICAgICAgICB9Ci0gICAgfQotICAgIHZpZGVvLT5oZWFkZXJfYml0cyArPSBCaXRzdHJlYW1HZXRQb3MoYnMxKTsgLyogSGVhZGVyIEJpdHMgKi8KLQotICAgIC8qIFNFQ09ORCBQQVJUOiBBTEwgVE8gQlMyICovCi0KLQotICAgIGlmIChpbnRyYSkKLSAgICB7Ci0gICAgICAgIEJpdHN0cmVhbVB1dDFCaXRzKGJzMiwgdmlkZW8tPmFjUHJlZEZsYWdbdmlkZW8tPm1ibnVtXSk7ICAgIC8qIGFjX3ByZWRfZmxhZyAqLwotICAgICAgICAvKnRlbXA9Ki8KLSAgICAgICAgUHV0Q0JQWShDQlAgPj4gMiwgKENoYXIpKE1vZGUgPT0gTU9ERV9JTlRSQSB8fCBNb2RlID09IE1PREVfSU5UUkFfUSksIGJzMik7IC8qIGNicHkgKi8KLQotICAgICAgICBpZiAoTW9kZSA9PSBNT0RFX0lOVFJBX1EpCi0gICAgICAgICAgICBCaXRzdHJlYW1QdXRCaXRzKGJzMiwgMiwgZHF1YW50KTsgIC8qIGRxdWFudCwgMy8xNS8wMSovCi0KLSAgICAgICAgaWYgKGludHJhRENfZGVjaXNpb24gPT0gMCkKLSAgICAgICAgewotICAgICAgICAgICAgZm9yIChpID0gMDsgaSA8IDY7IGkrKykKLSAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICBEQyA9IHZpZGVvLT5STEJbaV0ubGV2ZWxbMF07Ci0gICAgICAgICAgICAgICAgaWYgKHZpZGVvLT5STEJbaV0uc1swXSkKLSAgICAgICAgICAgICAgICAgICAgREMgPSAtREM7Ci0gICAgICAgICAgICAgICAgaWYgKGkgPCA0KQotICAgICAgICAgICAgICAgICAgICAvKnRlbXAgPSovIEludHJhRENfZHBjbShEQywgMSwgYnMyKTsgICAgICAgIC8qIGRjdF9kY19zaXplX2x1bWluYW5jZSwgKi8KLSAgICAgICAgICAgICAgICBlbHNlICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLyogZGN0X2RjX2RpZmZlcmVudGlhbCwgYW5kICovCi0gICAgICAgICAgICAgICAgICAgIC8qdGVtcCA9Ki8gSW50cmFEQ19kcGNtKERDLCAwLCBiczIpOyAgICAgICAgLyogbWFya2VyIGJpdCAqLwotICAgICAgICAgICAgfQotICAgICAgICB9Ci0KLSAgICAgICAgLyoqKioqKioqKioqKioqKioqKioqKioqKioqKiovICAvKiBUSElSRCBQQVJUOiBBTEwgVE8gQlMzICovCi0gICAgICAgIGZvciAoaSA9IDA7IGkgPCA2OyBpKyspCi0gICAgICAgIHsKLSAgICAgICAgICAgIGlmIChDQlAmKDEgPDwgKDUgLSBpKSkpCi0gICAgICAgICAgICAgICAgKCpCbG9ja0NvZGVDb2VmZikoJihSTEJbaV0pLCBiczMsIDEgLSBpbnRyYURDX2RlY2lzaW9uLCBuY29lZmJsY2tbaV0sIE1vZGUpOy8qIENvZGUgSW50cmEgQUMqLwotICAgICAgICB9Ci0gICAgfQotICAgIGVsc2UKLSAgICB7Ci0gICAgICAgIC8qdGVtcD0qLwotICAgICAgICBQdXRDQlBZKENCUCA+PiAyLCAoQ2hhcikoTW9kZSA9PSBNT0RFX0lOVFJBIHx8IE1vZGUgPT0gTU9ERV9JTlRSQV9RKSwgYnMyKTsgLyogY2JweSAqLwotICAgICAgICBpZiAoTW9kZSA9PSBNT0RFX0lOVEVSX1EpCi0gICAgICAgICAgICAvKiAgTUFZIE5FRUQgVE8gQ0hBTkdFIERRVUFOVCBIRVJFICAqLwotICAgICAgICAgICAgQml0c3RyZWFtUHV0Qml0cyhiczIsIDIsIGRxdWFudCk7ICAvKiBkcXVhbnQsIDMvMTUvMDEqLwotCi0gICAgICAgIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqLyAgLyogVEhJUkQgUEFSVDogQUxMIFRPIEJTMyAqLwotICAgICAgICBmb3IgKGkgPSAwOyBpIDwgNjsgaSsrKQotICAgICAgICB7Ci0gICAgICAgICAgICBpZiAoQ0JQJigxIDw8ICg1IC0gaSkpKQotICAgICAgICAgICAgICAgICgqQmxvY2tDb2RlQ29lZmYpKCYoUkxCW2ldKSwgYnMzLCAwLCBuY29lZmJsY2tbaV0sIE1vZGUpOy8qIENvZGUgSW50cmEgQUMqLwotICAgICAgICB9Ci0gICAgfQotCi0gICAgcmV0dXJuIDsKLX0KLSNlbmRpZiAvKiBIMjYzX09OTFkgKi8KLS8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotLyogU2hvcnQgSGVhZGVyL0NvbWJpbmVkIE1vZGUgd2l0aCBvciB3aXRob3V0IEVycm9yIFJlc2lsaWVuY2UgSS1WT1AgYW5kIFAtVk9QIEVuY29kaW5nICovCi0vKiA1LzIxLzAxLCBCLVZPUCBpcyBub3QgaW1wbGVtZW50ZWQgeWV0ISEhISAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotCi12b2lkIE1CVmxjRW5jb2RlQ29tYmluZWRfSV9WT1AoCi0gICAgVmlkZW9FbmNEYXRhICp2aWRlbywKLSAgICBJbnQgbmNvZWZibGNrW10sCi0gICAgdm9pZCAqYmxrQ29kZVB0cikKLXsKLQotICAgIEJpdHN0cmVhbUVuY1ZpZGVvICpiczEgPSB2aWRlby0+Yml0c3RyZWFtMTsKLS8vICBCaXRzdHJlYW1FbmNWaWRlbyAqYnMyID0gdmlkZW8tPmJpdHN0cmVhbTI7Ci0vLyAgQml0c3RyZWFtRW5jVmlkZW8gKmJzMyA9IHZpZGVvLT5iaXRzdHJlYW0zOwotICAgIGludCBpOwotICAgIFVDaGFyIE1vZGUgPSB2aWRlby0+aGVhZGVySW5mby5Nb2RlW3ZpZGVvLT5tYm51bV07Ci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OyA1LzIxLzAxLCByZXBsYWNlZCBieSBiZWxvdyAqLwotICAgIC8qKioqKioqKioqKioqKioqKioqLwotI2lmbmRlZiBIMjYzX09OTFkKLSAgICBpZiAoc2hvcnRWaWRlb0hlYWRlcikgLyogU2hvcnQgSGVhZGVyIERDIGNvZWZmaWNpZW50cyAqLwotICAgIHsKLSNlbmRpZgotICAgICAgICBmb3IgKGkgPSAwOyBpIDwgNjsgaSsrKQotICAgICAgICB7Ci0gICAgICAgICAgICBEQyA9IFJMQltpXS5sZXZlbFswXTsKLSAgICAgICAgICAgIGlmIChSTEJbaV0uc1swXSkKLSAgICAgICAgICAgICAgICBEQyA9IC1EQzsKLSAgICAgICAgICAgIGlmIChEQyAhPSAxMjgpCi0gICAgICAgICAgICAgICAgQml0c3RyZWFtUHV0Qml0cyhiczEsIDgsIERDKTsgICAvKiBpbnRyYV9kY19zaXplX2x1bWluYW5jZSAqLwotICAgICAgICAgICAgZWxzZQotICAgICAgICAgICAgICAgIEJpdHN0cmVhbVB1dEJpdHMoYnMxLCA4LCAyNTUpOyAgICAgICAgICAvKiBpbnRyYV9kY19zaXplX2x1bWluYW5jZSAqLwotICAgICAgICAgICAgaWYgKENCUCYoMSA8PCAoNSAtIGkpKSkKLSAgICAgICAgICAgICAgICAoKkJsb2NrQ29kZUNvZWZmKSgmKFJMQltpXSksIGJzMSwgMSwgbmNvZWZibGNrW2ldLCBNb2RlKTsgLyogQ29kZSBzaG9ydCBoZWFkZXIgSW50cmEgQUMqLwotICAgICAgICB9Ci0jaWZuZGVmIEgyNjNfT05MWQotICAgIH0KLSAgICBlbHNlIGlmIChpbnRyYURDX2RlY2lzaW9uID09IDApICAgLyogQ29tYmluZWQgSW50cmEgTW9kZSBEQyBhbmQgQUMgY29lZmZpY2llbnRzICovCi0gICAgewotICAgICAgICBmb3IgKGkgPSAwOyBpIDwgNjsgaSsrKQotICAgICAgICB7Ci0gICAgICAgICAgICBEQyA9IFJMQltpXS5sZXZlbFswXTsKLSAgICAgICAgICAgIGlmIChSTEJbaV0uc1swXSkKLSAgICAgICAgICAgICAgICBEQyA9IC1EQzsKLQotICAgICAgICAgICAgaWYgKGkgPCA0KQotICAgICAgICAgICAgICAgIC8qdGVtcCA9Ki8gSW50cmFEQ19kcGNtKERDLCAxLCBiczEpOyAgICAgICAgLyogZGN0X2RjX3NpemVfbHVtaW5hbmNlLCAqLwotICAgICAgICAgICAgZWxzZSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8qIGRjdF9kY19kaWZmZXJlbnRpYWwsIGFuZCAqLwotICAgICAgICAgICAgICAgIC8qdGVtcCA9Ki8gSW50cmFEQ19kcGNtKERDLCAwLCBiczEpOyAgICAgICAgLyogbWFya2VyIGJpdCAqLwotICAgICAgICAgICAgaWYgKENCUCYoMSA8PCAoNSAtIGkpKSkKLSAgICAgICAgICAgICAgICAoKkJsb2NrQ29kZUNvZWZmKSgmKFJMQltpXSksIGJzMSwgMSwgbmNvZWZibGNrW2ldLCBNb2RlKTsvKiBDb2RlIEludHJhIEFDICovCi0gICAgICAgIH0KLSAgICB9Ci0gICAgZWxzZSAgIC8qIENvbWJpbmVkIE1vZGUgSW50cmEgREMvQUMgY29lZmZpY2llbnRzICovCi0gICAgewotICAgICAgICBmb3IgKGkgPSAwOyBpIDwgNjsgaSsrKQotICAgICAgICB7Ci0gICAgICAgICAgICBpZiAoQ0JQJigxIDw8ICg1IC0gaSkpKQotICAgICAgICAgICAgICAgICgqQmxvY2tDb2RlQ29lZmYpKCYoUkxCW2ldKSwgYnMxLCAwLCBuY29lZmJsY2tbaV0sIE1vZGUpOy8qIENvZGUgSW50cmEgQUMgKi8KLSAgICAgICAgfQotICAgIH0KLSNlbmRpZgotICAgIC8qKioqKioqKioqKioqKioqKioqLwotICAgIHJldHVybiA7Ci19Ci0KLXZvaWQgTUJWbGNFbmNvZGVDb21iaW5lZF9QX1ZPUCgKLSAgICBWaWRlb0VuY0RhdGEgKnZpZGVvLAotICA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JhID09IDApICAvKiBEZXRlcm1pbmUgaWYgU2tpcHBlZCBNQiAqLwotICAgIHsKLSAgICAgICAgaWYgKChNb2RlID09IE1PREVfSU5URVIpICYmICh2aWRlby0+bW90W21ibnVtXVswXS54ID09IDApICYmICh2aWRlby0+bW90W21ibnVtXVswXS55ID09IDApKQotICAgICAgICAgICAgTW9kZSA9IHZpZGVvLT5oZWFkZXJJbmZvLk1vZGVbdmlkZW8tPm1ibnVtXSA9IE1PREVfU0tJUFBFRDsKLSAgICAgICAgZWxzZSBpZiAoKE1vZGUgPT0gTU9ERV9JTlRFUjRWKSAmJiAodmlkZW8tPm1vdFttYm51bV1bMV0ueCA9PSAwKSAmJiAodmlkZW8tPm1vdFttYm51bV1bMV0ueSA9PSAwKQotICAgICAgICAgICAgICAgICAmJiAodmlkZW8tPm1vdFttYm51bV1bMl0ueCA9PSAwKSAmJiAodmlkZW8tPm1vdFttYm51bV1bMl0ueSA9PSAwKQotICAgICAgICAgICAgICAgICAmJiAodmlkZW8tPm1vdFttYm51bV1bM10ueCA9PSAwKSAmJiAodmlkZW8tPm1vdFttYm51bV1bM10ueSA9PSAwKQotICAgICAgICAgICAgICAgICAmJiAodmlkZW8tPm1vdFttYm51bV1bNF0ueCA9PSAwKSAmJiAodmlkZW8tPm1vdFttYm51bV1bNF0ueSA9PSAwKSkKLSAgICAgICAgICAgIE1vZGUgPSB2aWRlby0+aGVhZGVySW5mby5Nb2RlW3ZpZGVvLT5tYm51bV0gPSBNT0RFX1NLSVBQRUQ7Ci0gICAgfQotCi0gICAgaWYgKE1vZGUgPT0gTU9ERV9TS0lQUEVEKQotICAgIHsKLSAgICAgICAgQml0c3RyZWFtUHV0MUJpdHMoYnMxLCAxKTsgLyogbm90X2NvZGVkID0gMSAqLwotICAgICAgICByZXR1cm47Ci0gICAgfQotICAgIGVsc2UKLSAgICAgICAgQml0c3RyZWFtUHV0MUJpdHMoYnMxLCAwKTsgLyogbm90X2NvZGVkID0wICovCi0KLSAgICB2aWR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ioqKioqKioqKioqKioqLwotICAgIGlmIChpbnRyYSkKLSAgICB7Ci0jaWZuZGVmIEgyNjNfT05MWQotICAgICAgICBpZiAoc2hvcnRWaWRlb0hlYWRlcikgLyogU2hvcnQgSGVhZGVyIERDIGNvZWZmaWNpZW50cyAqLwotICAgICAgICB7Ci0jZW5kaWYKLSAgICAgICAgICAgIGZvciAoaSA9IDA7IGkgPCA2OyBpKyspCi0gICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgREMgPSBSTEJbaV0ubGV2ZWxbMF07Ci0gICAgICAgICAgICAgICAgaWYgKFJMQltpXS5zWzBdKQotICAgICAgICAgICAgICAgICAgICBEQyA9IC1EQzsKLSAgICAgICAgICAgICAgICBpZiAoREMgIT0gMTI4KQotICAgICAgICAgICAgICAgICAgICBCaXRzdHJlYW1QdXRCaXRzKGJzMSwgOCwgREMpOyAgIC8qIGludHJhX2RjX3NpemVfbHVtaW5hbmNlICovCi0gICAgICAgICAgICAgICAgZWxzZQotICAgICAgICAgICAgICAgICAgICBCaXRzdHJlYW1QdXRCaXRzKGJzMSwgOCwgMjU1KTsgICAgICAgICAgLyogaW50cmFfZGNfc2l6ZV9sdW1pbmFuY2UgKi8KLSAgICAgICAgICAgICAgICBpZiAoQ0JQJigxIDw8ICg1IC0gaSkpKQotICAgICAgICAgICAgICAgICAgICAoKkJsb2NrQ29kZUNvZWZmKSgmKFJMQltpXSksIGJzMSwgMSwgbmNvZWZibGNrW2ldLCBNb2RlKTsgLyogQ29kZSBzaG9ydCBoZWFkZXIgSW50cmEgQUMqLwotICAgICAgICAgICAgfQotI2lmbmRlZiBIMjYzX09OTFkKLSAgICAgICAgfQotICAgICAgICBlbHNlIGlmIChpbnRyYURDX2RlY2lzaW9uID09IDApICAgLyogQ29tYmluZWQgSW50cmEgTW9kZSBEQyBhbmQgQUMgY29lZmZpY2llbnRzICovCi0gICAgICAgIHsKLSAgICAgICAgICAgIGZvciAoaSA9IDA7IGkgPCA2OyBpKyspCi0gICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgREMgPSBSTEJbaV0ubGV2ZWxbMF07Ci0gICAgICAgICAgICAgICAgaWYgKFJMQltpXS5zWzBdKQotICAgICAgICAgICAgICAgICAgICBEQyA9IC1EQzsKLQotICAgICAgICAgICAgICAgIGlmIChpIDwgNCkKLSAgICAgICAgICAgICAgICAgICAgLyp0ZW1wID0qLyBJbnRyYURDX2RwY20oREMsIDEsIGJzMSk7ICAgICAgICAvKiBkY3RfZGNfc2l6ZV9sdW1pbmFuY2UsICovCi0gICAgICAgICAgICAgICAgZWxzZSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8qIGRjdF9kY19kaWZmZXJlbnRpYWwsIGFuZCAqLwotICAgICAgICAgICAgICAgICAgICAvKnRlbXAgPSovIEludHJhRENfZHBjbShEQywgMCwgYnMxKTsgICAgICAgIC8qIG1hcmtlciBiaXQgKi8KLSAgICAgICAgICAgICAgICBpZiAoQ0JQJigxIDw8ICg1IC0gaSkpKQotICAgICAgICAgICAgICAgICAgICAoKkJsb2NrQ29kZUNvZWZmKSgmKFJMQltpXSksIGJzMSwgMSwgbmNvZWZibGNrW2ldLCBNb2RlKTsvKiBDb2RlIEludHJhIEFDICovCi0gICAgICAgICAgICB9Ci0gICAgICAgIH0KLSAgICAgICAgZWxzZSAgIC8qIENvbWJpbmVkIE1vZGUgSW50cmEgREMvQUMgY29lZmZpY2llbnRzICovCi0gICAgICAgIHsKLSAgICAgICAgICAgIGZvciAoaSA9IDA7IGkgPCA2OyBpKyspCi0gICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgaWYgKENCUCYoMSA8PCAoNSAtIGkpKSkKLSAgICAgICAgICAgICAgICAgICAgKCpCbG9ja0NvZGVDb2VmZikoJihSTEJbaV0pLCBiczEsIDAsIG5jb2VmYmxja1tpXSwgTW9kZSk7LyogQ29kZSBJbnRyYSBBQyAqLwotICAgICAgICAgICAgfQotICAgICAgICB9Ci0jZW5kaWYKLSAgICB9Ci0gICAgZWxzZSAgIC8qIFNob3J0aGVhZGVyIG9yIENvbWJpbmVkIElOVEVSIE1vZGUgQUMgY29lZmZpY2llbnRzICovCi0gICAgewotICAgICAgICBmb3IgKGkgPSAwOyBpIDwgNjsgaSsrKQotICAgICAgICB7Ci0gICAgICAgICAgICBpZiAoQ0JQJigxIDw8ICg1IC0gaSkpKQotICAgICAgICAgICAgICAgICgqQmxvY2tDb2RlQ29lZmYpKCYoUkxCW2ldKSwgYnMxLCAwLCBuY29lZmJsY2tbaV0sIE1vZGUpOy8qIENvZGUgSW50ZXIgQUMqLwotICAgICAgICB9Ci0gICAgfQotICAgIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotCi0gICAgcmV0dXJuIDsKLX0KLQotLyogPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09ICovCi0vKiAgRnVuY3Rpb24gOiBCbG9ja0NvZGVDb2VmZigpICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogIERhdGUgICAgIDogMDkvMTgvMjAwMCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgUHVycG9zZSAgOiBWTEMgRW5jb2RlICBBQy9EQyBjb2VmZnMgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICBJbi9vdXQgICA6ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogIFJldHVybiAgIDogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgTW9kaWZpZWQgOiAgNS8xNi8wMSAgZ3JvdXBpbmcgQml0c3RyZWFtUHV0Qml0cyBjYWxscyAgICAgICAgICAgICAgICAgICAgKi8KLS8qICAgICAgICAgICAgICA1LzIyLzAxICBicmVhayB1cCBmdW5jdGlvbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0gKi8KLSNpZm5kZWYgTk9fUlZMQwotLyoqKioqKioqKioqKioqKioqLwotLyogUlZMQyBFTkNPRElORyAqLwotLyoqKioqKioqKioqKioqKioqLwotVm9pZCBCbG9ja0NvZGVDb2VmZl9SVkxDKFJ1bkxldmVsQmxvY2sgKlJMQiwgQml0c3RyZWFtRW5jVmlkZW8gKmJzLCBJbnQgal9zdGFydCwgSW50IGpfc3RvcCwgVUNoYXIgTW9kZSkKLXsKLSAgICBpbnQgbGVuZ3RoID0gMDsKLSAgICBpbnQgaTsKLSAgICBJbnQgbGV2ZWw7Ci0gICAgSW50IHJ1bjsKLSAgICBJbnQgaW50cmEgPSAoTW9kZSA9PSBNT0RFX0lOVFJBIHx8IE1vZGUgPT0gTU9ERV9JTlRSQV9RKTsKLQotICAgIC8qIE5vdCBMYXN0IENvZWZmaWNpZW50ICovCi0gICAgZm9yIChpID0gal9zdGFydDsgaSA8IGpfc3RvcCAtIDE7IGkrKykKLSAgICB7Ci0gICAgICAgIHJ1biA9IFJMQi0+cnVuW2ldOwotICAgICAgICBsZXZlbCA9IFJMQi0+bGV2ZWxbaV07Ci0gICAgICAgIC8vaWYoaT09NjN8fFJMQi0+cnVuW2krMV0gPT0gLTEpICAgIC8qIERvbid0IENvZGUgTGFzdCBDb2VmZmljaWVudCBIZXJlICovCi0gICAgICAgIC8vICBicmVhazsKLSAgICAgICAgLypFTkNPREUgUlVOIExFTkdUSCAqLwotICAgICAgICBpZiAobGV2ZWwgPCAyOCAmJiBydW4gPCAzOSkKLSAgICAgICAgewotICAgICAgICAgICAgaWYgKGludHJhKQotICAgICAgICAgICAgICAgIGxlbmd0aCA9IFB1dENvZWZmX0ludHJhX1JWTEMocnVuLCBsZXZ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iBCSVQgKi8KLQotICAgIHJldHVybiA7Ci19Ci0jZW5kaWYKLS8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotLyogU0hPUlQgVklERU8gSEVBREVSIEVOQ09ESU5HICovCi0vKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLQotVm9pZCBCbG9ja0NvZGVDb2VmZl9TaG9ydEhlYWRlcihSdW5MZXZlbEJsb2NrICpSTEIsIEJpdHN0cmVhbUVuY1ZpZGVvICpicywgSW50IGpfc3RhcnQsIEludCBqX3N0b3AsIFVDaGFyIE1vZGUpCi17Ci0gICAgaW50IGxlbmd0aCA9IDA7Ci0gICAgaW50IGk7Ci0vLyAgaW50IHRlbXA7Ci0gICAgSW50IGxldmVsOwotICAgIEludCBydW47Ci0KLSAgICBPU0NMX1VOVVNFRF9BUkcoTW9kZSk7Ci0KLSAgICAvKiBOb3QgTGFzdCBDb2VmZmljaWVudCAqLwotICAgIGZvciAoaSA9IGpfc3RhcnQ7IGkgPCBqX3N0b3AgLSAxOyBpKyspCi0gICAgewotICAgICAgICBydW4gPSBSTEItPnJ1bltpXTsKLSAgICAgICAgbGV2ZWwgPSBSTEItPmxldmVsW2ldOwotLy8gICAgICBpZihpPT02MyB8fFJMQi0+cnVuW2krMV0gPT0gLTEpIC8qIERvbid0IENvZGUgTGFzdCBDb2VmZmljaWVudCBIZXJlICovCi0vLyAgICAgICAgICBicmVhazsKLSAgICAgICAgLypFTkNPREUgUlVOIExFTkdUSCAqLwotICAgICAgICBpZiAobGV2ZWwgPCAxMykKLSAgICAgICAgewotICAgICAgICAgICAgbGVuZ3RoID0gUHV0Q29lZmZfSW50ZXIocnVuLCBsZXZlbCwgYnMpOwotICAgICAgICAgICAgaWYgKGxlbmd0aCAhPSAwKQotICAgICAgICAgICAgICAgIC8qdGVtcCA9Ki8gQml0c3RyZWFtUHV0MUJpdHMoYnMsIFJMQi0+c1tpXSk7IC8qIFNpZ24gQml0ICovCi0gICAgICAgIH0KLSAgICAgICAgZWxzZQotICAgICAgICAgICAgbGVuZ3RoID0gMDsKLSAgICAgICAgLyogRVNDQVBFIENPRElORyAqLwotICAgICAgICBpZiAobGVuZ3RoID09IDApCi0gICAgICAgIHsKLSAgICAgICAgICAgIGlmIChSTEItPnNbaV0pCi0gICAgICAgICAgICAgICAgbGV2ZWwgPSAtbGV2ZWw7Ci0gICAgICAgICAgICBCaXRzdHJlYW1QdXRCaXRzKGJzLCA3ICsgMSwgNik7IC8qIEVTQ0FQRSBDT0RFICsgTm90IExhc3QgQ29lZmZpY2llbnQgKi8KLSAgICAgICAgICAgIC8vQml0c3RyZWFtUHV0Qml0cyhicywxLDApOyAvKiBOb3QgTGFzdCBDb2VmZmljaWVudCAqLwotICAgICAgICAgICAgQml0c3RyZWFtUHV0Qml0cyhicywgNiwgcnVuKTsgLyogUlVOICovCi0gICAgICAgICAgICBCaXRzdHJlYW1QdXRCaXRzKGJzLCA4LCBsZXZlbCYweEZGKTsgLyogTEVWRUwsIG1hc2sgdG8gbWFrZSBzdXJlIGxlbmd0aCA4ICovCi0gICAgICAgIH0KLSAgICB9Ci0gICAgLyogTGFzdCBDb2VmZmljaWVudCEhISAqLwotICAgIHJ1biA9IFJMQi0+cnVuW2ldOwotICAgIGxldmVsID0gUkxCLT5sZXZlbFtpXTsKLQotICAgIC8qRU5DT0RFIFJVTiBMRU5HVEggKi8KLSAgICBpZiAobGV2ZWwgPCAxMykKLSAgICB7Ci0gICAgICAgIGxlbmd0aCA9IFB1dENvZWZmX0ludGVyX0xhc3QocnVuLCBsZXZlbCwgYnMpOwotICAgICAgICBpZiAobGVuZ3RoICE9IDApCi0gICAgICAgICAgICAvKnRlbXAgPSovIEJpdHN0cmVhbVB1dDFCaXRzKGJzLCBSTEItPnNbaV0pOyAvKiBTaWduIEJpdCAqLwotICAgIH0KLSAgICBlbHNlCi0gICAgICAgIGxlbmd0aCA9IDA7Ci0gICAgLyogRVNDQVBFIENPRElORyAqLwotICAgIGlmIChsZW5ndGggPT0gMCkKLSAgICB7Ci0gICAgICAgIGlmIChSTEItPnNbaV0pCi0gICAgICAgICAgICBsZXZlbCA9IC1sZXZlbDsKLSAgICAgICAgQml0c3RyZWFtUHV0Qml0cyhicywgNyArIDEsIDcpOyAvKiBFU0NBUEUgQ09ERSArIExhc3QgQ29lZmZpY2llbnQgKi8KLSAgICAgICAgLy9CaXRzdHJlYW1QdXRCaXRzKGJzLDEsMSk7IC8qIExhc3QgQ29lZmZpY2llbnQgISEhKi8KLSAgICAgICAgQml0c3RyZWFtUHV0Qml0cyhicywgNiwgcnVuKTsgLyogUlVOICovCi0gICAgICAgIEJpdHN0cmVhbVB1dEJpdHMoYnMsIDgsIGxldmVsJjB4RkYpOyAvKiBMRVZFTCwgbWFzayB0byBtYWtlIHN1cmUgbGVuZ3RoIDggICovCi0gICAgfQotCi0gICAgcmV0dXJuIDsKLQotfQotCi0jaWZuZGVmIEgyNjNfT05MWQotLyoqKioqKioqKioqKioqKiovCi0vKiBWTEMgRU5DT0RJTkcgKi8KLS8qKioqKioqKioqKioqKioqLwotVm9pZCBCbG9ja0NvZGVDb2VmZl9Ob3JtYWwoUnVuTGV2ZWxCbG9jayAqUkxCLCBCaXRzdHJlYW1FbmNWaWRlbyAqYnMsIEludCBqX3N0YXJ0LCBJbnQgal9zdG9wLCBVQ2hhciBNb2RlKQotewotICAgIGludCBsZW5ndGggPSAwOwotICAgIGludCBpOwotICAgIC8vaW50IHRlbXA7Ci0gICAgSW50IGxldmVsOwotICAgIEludCBydW47Ci0gICAgSW50IGludHJhID0gKE1vZGUgPT0gTU9ERV9JTlRSQSB8fCBNb2RlID09IE1PREVfSU5UUkFfUSk7Ci0gICAgSW50IGxldmVsX21pbnVzX21heDsKLSAgICBJbnQgcnVuX21pbnVzX21heDsKLSAgICBJbnQoKlB1dENvZWZmKShJbnQsIEludCwgQml0c3RyZWFtRW5jVmlkZW8gKik7IC8qIHBvaW50ZXIgdG8gZnVuY3Rpb25zLCA1LzI4LzAxICovCi0KLSAgICAvKiBOb3QgTGFzdCBDb2VmZmljaWVudCEhISAqLwotCi0gICAgaWYgKGludHJhKQotICAgICAgICBQdXRDb2VmZiA9ICZQdXRDb2VmZl9JbnRyYTsKLSAgICBlbHNlCi0gICAgICAgIFB1dENvZWZmID0gJlB1dENvZWZmX0ludGVyOwotCi0gICAgZm9yIChpID0gal9zdGFydDsgaSA8IGpfc3RvcCAtIDE7IGkrKykKLSAgICB7Ci0gICAgICAgIHJ1biA9IFJMQi0+cnVuW2ldOwotICAgICAgICBsZXZlbCA9IFJMQi0+bGV2ZWxbaV07Ci0KLSAgICAgICAgLyogRW5jb2RlIFJ1biBMZW5ndGggKi8KLSAgICAgICAgaWYgKGxldmVsIDwgMjgpCi0gICAgICAgIHsKLSAgICAgICAgICAgIGxlbmd0aCA9ICgqUHV0Q29lZmYpKHJ1biwgbGV2ZWwsIGJzKTsgLyogNS8yOC8wMSByZXBsYWNlcyBhYm92ZSAqLwotICAgICAgICB9Ci0gICAgICAgIGVsc2UKLSAgICAgICAgewotICAgICAgICAgICAgbGVuZ3RoID0gMDsKLSAgICAgICAgfQotCi0gICAgICAgIC8qIEZpcnN0IGVzY2FwZSBtb2RlOiBMRVZFTCBPRkZTRVQgKi8KLSAgICAgICAgaWYgKGxlbmd0aCA9PSAwKQotICAgICAgICB7Ci0gICAgICAgICAgICBpZiAoaW50cmEpCi0gICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgbGV2ZWxfbWludXNfbWF4ID0gbGV2ZWwgLSBpbnRyYV9tYXhfbGV2ZWxbMF1bcnVuXTsKLSAgICAgICAgICAgICAgICBpZiAobGV2ZWxfbWludXNfbWF4IDwgMjgpCi0gICAgICAgICAgICAgICAgICAgIGxlbmd0aCA9IFB1dExldmVsQ29lZmZfSW50cmEocnVuLCBsZXZlbF9taW51c19tYXgsIGJzKTsKLSAgICAgICAgICAgICAgICBlbHNlCi0gICAgICAgICAgICAgICAgICAgIGxlbmd0aCA9IDA7Ci0gICAgICAgICAgICB9Ci0gICAgICAgICAgICBlbHNlCi0gICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgbGV2ZWxfbWludXNfbWF4ID0gbGV2ZWwgLSBpbnRlcl9tYXhfbGV2ZWxbMF1bcnVuXTsKLSAgICAgICAgICAgICAgICBpZiAobGV2ZWxfbWludXNfbWF4IDwgMTMpCi0gICAgICAgICAgICAgICAgICAgIGxlbmd0aCA9IFB1dExldmVsQ29lZmZfSW50ZXIocnVuLCBsZXZlbF9taW51c19tYXgsIGJzKTsKLSAgICAgICAgICAgICAgICBlbHNlCi0gICAgICAgICAgICAgICAgICAgIGxlbmd0aCA9IDA7Ci0gICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgIC8qIFNlY29uZCBlc2NhcGUgbW9kZTogUlVOIE9GRlNFVCAqLwotICAgICAgICAgICAgaWYgKGxlbmd0aCA9PSAwKQotICAgICAgICAgICAgewotICAgICAgICAgICAgICAgIGlmIChsZXZlbCA8IDI4KQotICAgICAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAgICAgaWYgKGludHJhKQotICAgICAgICAgICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgICAgICAgICBydW5fbWludXNfbWF4ID0gcnVuIC0gKGludHJhX21heF9ydW4wW2xldmVsXSArIDEpOwotICAgICAgICAgICAgICAgICAgICAgICAgbGVuZ3RoID0gUHV0UnVuQ29lZmZfSW50cmEocnVuX21pbnVzX21heCwgbGV2ZWwsIGJzKTsKLSAgICAgICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgICAgICBlbHNlIGlmIChsZXZlbCA8IDEzKQotICAgICAgICAgICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgICAgICAgICBydW5fbWludXNfbWF4ID0gcnVuIC0gKGludGVyX21heF9ydW4wW2xldmVsXSArIDEpOwotICAgICAgICAgICAgICAgICAgICAgICAgbGVuZ3RoID0gUHV0UnVuQ29lZmZfSW50ZXIocnVuX21pbnVzX21heCwgbGV2ZWwsIGJzKTsKLSAgICAgICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgICAgICBlbHNlCi0gICAgICAgICAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAgICAgICAgIGxlbmd0aCA9IDA7Ci0gICAgICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgZWxzZQotICAgICAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAgICAgbGVuZ3RoID0gMDsKLSAgICAgICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgICAgICAvKiBUaGlyZCBlc2NhcGUgbW9kZTogRklYRUQgTEVOR1RIIENPREUgKi8KLSAgICAgICAgICAgICAgICBpZiAobGVuZ3RoID09IDApCi0gICAgICAgICAgICAgICAgewotICAgICAgICAgICAgICAgICAgICBpZiAoUkxCLT5zW2ldKQotICAgICAgICAgICAgICAgICAgICAgICAgbGV2ZWwgPSAtbGV2ZWw7Ci0gICAgICAgICAgICAgICAgICAgIC8qdGVtcCA9Ki8KLSAgICAgICAgICAgICAgICAgICAgQml0c3RyZWFtUHV0Qml0cyhicywgNyArIDIgKyAxLCAzMCk7IC8qIEVTQ0FQRSBDT0RFICsgRm9sbG93ZWQgYnkgMTEgKyBOb3QgTGFzdCBDb2VmZmljaWVudCovCi0gICAgICAgICAgICAgICAgICAgIC8vdGVtcCA9IEJpdHN0cmVhbVB1dEJpdHMoYnMsMiwzKTsgLyogRm9sbG93ZWQgYnkgMTEgKi8KLSAgICAgICAgICAgICAgICAgICAgLy90ZW1wID0gQml0c3RyZWFtUHV0Qml0cyhicywgMSwgMCk7IC8qIE5vdCBMYXN0IENvZWZmaWNpZW50Ki8KLSAgICAgICAgICAgICAgICAgICAgLyp0ZW1wID0qLwotICAgICAgICAgICAgICAgICAgICBCaXRzdHJlYW1QdXRCaXRzKGJzLCA2ICsgMSwgKHJ1biA8PCAxKSB8IDEpOyAvKiBFbmNvZGUgUnVuICsgTWFya2VyIEJpdCAqLwotICAgICAgICAgICAgICAgICAgICAvL3RlbXAgPSBCaXRzdHJlYW1QdXRCaXRzKGJzLDEsMSk7IC8qIE1hcmtlciBCaXQgKi8KLSAgICAgICAgICAgICAgICAgICAgLyp0ZW1wID0qLwotICAgICAgICAgICAgICAgICAgICBCaXRzdHJlYW1QdXRHVDhCaXRzKGJzLCAxMiArIDEsICgobGV2ZWwgPDwgMSkgfCAxKSYweDFGRkYpOyAvKiBFbmNvZGUgTGV2ZWwsIG1hc2sgdG8gbWFrZSBzdXJlIGxlbmd0aCAxMiAgKi8KLSAgICAgICAgICAgICAgICAgICAgLy90ZW1wID0gQml0c3RyZWFtUHV0Qml0cyhicywxLDEpOyAvKiBNYXJrZXIgQml0ICovCi0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgfQotICAgICAgICB9Ci0KLSAgICAgICAgLyogRW5jb2RlIFNpZ24gQml0ICovCi0gICAgICAgIGlmIChsZW5ndGggIT0gMCkKLSAgICAgICAgICAgIC8qdGVtcCA9Ki8gQml0c3RyZWFtUHV0MUJpdHMoYnMsIFJMQi0+c1tpXSk7IC8qIFNpZ24gQml0ICovCi0KLSAgICB9Ci0gICAgLyogTGFzdCBDb2VmZmljaWVudCAqLwotICAgIHJ1biA9IFJMQi0+cnVuW2ldOwotICAgIGxldmVsID0gUkxCLT5sZXZlbFtpXTsKLQotICAgIC8qIEVuY29kZSBSdW4gTGVuZ3RoICovCi0gICAgaWYgKGxldmVsIDwgOSkKLSAgICB7Ci0gICAgICAgIGlmIChpbnRyYSkKLSAgICAgICAgewotICAgICAgICAgICAgbGVuZ3RoID0gUHV0Q29lZmZfSW50cmFfTGFzdChydW4sIGxldmVsLCBicyk7Ci0gICAgICAgIH0KLSAgICAgICAgZWxzZSBpZiAobGV2ZWwgPCA0KQotICAgICAgICB7Ci0gICAgICAgICAgICBsZW5ndGggPSBQdXRDb2VmZl9JbnRlcl9MYXN0KHJ1biwgbGV2ZWwsIGJzKTsKLSAgICAgICAgfQotICAgICAgICBlbHNlCi0gICAgICAgIHsKLSAgICAgICAgICAgIGxlbmd0aCA9IDA7Ci0gICAgICAgIH0KLSAgICB9Ci0gICAgZWxzZQotICAgIHsKLSAgICAgICAgbGVuZ3RoID0gMDsKLSAgICB9Ci0KLSAgICAvKiBGaXJzdCBlc2NhcGUgbW9kZTogTEVWRUwgT0ZGU0VUICovCi0gICAgaWYgKGxlbmd0aCA9PSAwKQotICAgIHsKLSAgICAgICAgaWYgKGludHJhKQotICAgICAgICB7Ci0gICAgICAgICAgICBsZXZlbF9taW51c19tYXggPSBsZXZlbCAtIGludHJhX21heF9sZXZlbFsxXVtydW5dOwotICAgICAgICAgICAgaWYgKGxldmVsX21pbnVzX21heCA8IDkpCi0gICAgICAgICAgICAgICAgbGVuZ3RoID0gUHV0TGV2ZWxDb2VmZl9JbnRyYV9MYXN0KHJ1biwgbGV2ZWxfbWludXNfbWF4LCBicyk7Ci0gICAgICAgICAgICBlbHNlCi0gICAgICAgICAgICAgICAgbGVuZ3RoID0gMDsKLSAgICAgICAgfQotICAgICAgICBlbHNlCi0gICAgICAgIHsKLSAgICAgICAgICAgIGxldmVsX21pbnVzX21heCA9IGxldmVsIC0gaW50ZXJfbWF4X2xldmVsWzFdW3J1bl07Ci0gICAgICAgICAgICBpZiAobGV2ZWxfbWludXNfbWF4IDwgNCkKLSAgICAgICAgICAgICAgICBsZW5ndGggPSBQdXRMZXZlbENvZWZmX0ludGVyX0xhc3QocnVuLCBsZXZlbF9taW51c19tYXgsIGJzKTsKLSAgICAgICAgICAgIGVsc2UKLSAgICAgICAgICAgICAgICBsZW5ndGggPSAwOwotICAgICAgICB9Ci0gICAgICAgIC8qIFNlY29uZCBlc2NhcGUgbW9kZTogUlVOIE9GRlNFVCAqLwotICAgICAgICBpZiAobGVuZ3RoID09IDApCi0gICAgICAgIHsKLSAgICAgICAgICAgIGlmIChsZXZlbCA8IDkpCi0gICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgaWYgKGludHJhKQotICAgICAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAgICAgcnVuX21pbnVzX21heCA9IHJ1biAtIChpbnRyYV9tYXhfcnVuMVtsZXZlbF0gKyAxKTsKLSAgICAgICAgICAgICAgICAgICAgbGVuZ3RoID0gUHV0UnVuQ29lZmZfSW50cmFfTGFzdChydW5fbWludXNfbWF4LCBsZXZlbCwgYnMpOwotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICBlbHNlIGlmIChsZXZlbCA8IDQpCi0gICAgICAgICAgICAgICAgewotICAgICAgICAgICAgICAgICAgICBydW5fbWludXNfbWF4ID0gcnVuIC0gKGludGVyX21heF9ydW4xW2xldmVsXSArIDEpOwotICAgICAgICAgICAgICAgICAgICBsZW5ndGggPSBQdXRSdW5Db2VmZl9JbnRlcl9MYXN0KHJ1bl9taW51c19tYXgsIGxldmVsLCBicyk7Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgIGVsc2UKLSAgICAgICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgICAgIGxlbmd0aCA9IDA7Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgfQotICAgICAgICAgICAgZWxzZQotICAgICAgICAgICAgewotICAgICAgICAgICAgICAgIGxlbmd0aCA9IDA7Ci0gICAgICAgICAgICB9Ci0gICAgICAgICAgICAvKiBUaGlyZCBlc2NhcGUgbW9kZTogRklYRUQgTEVOR1RIIENPREUgKi8KLSAgICAgICAgICAgIGlmIChsZW5ndGggPT0gMCkKLSAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICBpZiAoUkxCLT5zW2ldKQotICAgICAgICAgICAgICAgICAgICBsZXZlbCA9IC1sZXZlbDsKLSAgICAgICAgICAgICAgICAvKnRlbXAgPSovCi0gICAgICAgICAgICAgICAgQml0c3RyZWFtUHV0R1Q4Qml0cyhicywgNyArIDIgKyAxLCAzMSk7IC8qIEVTQ0FQRSBDT0RFICsgRm9sbG93ZWQgYnkgMTEgKyBMYXN0IENvZWZmaWNpZW50Ki8KLSAgICAgICAgICAgICAgICAvL3RlbXAgPSBCaXRzdHJlYW1QdXRCaXRzKGJzLDIsMyk7IC8qIEZvbGxvd2VkIGJ5IDExICovCi0gICAgICAgICAgICAgICAgLy90ZW1wID0gQml0c3RyZWFtUHV0Qml0cyhicywgMSwgMSk7IC8qIExhc3QgQ29lZmZpY2llbnQhISEqLwotICAgICAgICAgICAgICAgIC8qdGVtcCA9Ki8KLSAgICAgICAgICAgICAgICBCaXRzdHJlYW1QdXRCaXRzKGJzLCA2ICsgMSwgKHJ1biA8PCAxKSB8IDEpOyAvKiBFbmNvZGUgUnVuICsgTWFya2VyIEJpdCAqLwotICAgICAgICAgICAgICAgIC8vdGVtcCA9IEJpdHN0cmVhbVB1dEJpdHMoYnMsMSwxKTsgLyogTWFya2VyIEJpdCAqLwotICAgICAgICAgICAgICAgIC8qdGVtcCA9Ki8KLSAgICAgICAgICAgICAgICBCaXRzdHJlYW1QdXRHVDhCaXRzKGJzLCAxMiArIDEsICgobGV2ZWwgPDwgMSkgfCAxKSYweDFGRkYpOyAvKiBFbmNvZGUgTGV2ZWwsIG1hc2sgdG8gbWFrZSBzdXJlIGxlbmd0aCA4ICovCi0gICAgICAgICAgICAgICAgLy90ZW1wID0gQml0c3RyZWFtUHV0Qml0cyhicywxLDEpOyAvKiBNYXJrZXIgQml0ICovCi0gICAgICAgICAgICB9Ci0gICAgICAgIH0KLSAgICB9Ci0KLSAgICAvKiBFbmNvZGUgU2lnbiBCaXQgKi8KLSAgICBpZiAobGVuZ3RoICE9IDApCi0gICAgICAgIC8qdGVtcCA9Ki8gQml0c3RyZWFtUHV0MUJpdHMoYnMsIFJMQi0+c1tpXSk7Ci0KLQotICAgIHJldHVybiA7Ci19Ci0KLSNlbmRpZiAvKiBIMjYzX09OTFkgKi8KLS8qID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PSAqLwotLyogIEZ1bmN0aW9uIDogUlVOTGV2ZWwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgRGF0ZSAgICAgOiAwOS8yMC8yMDAwICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICBQdXJwb3NlICA6IEdldCB0aGUgQ29kZWQgQmxvY2sgUGF0dGVybiBmb3IgZWFjaCBibG9jayAgICAgICAgICAgICAgICAgICAqLwotLyogIEluL291dCAgIDogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgICAgIEludCogcWNvZWZmICAgICBRdWFudGl6ZWQgRENUIGNvZWZmaWNpZW50cwotICAgICAgICBJbnQgTW9kZSAgICAgICAgQ29kaW5nIE1vZGUKLSAgICAgICAgSW50IG5jb2VmZnMgICAgIE51bWJlciBvZiBjb2VmZmljaWVudHMgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogIFJldHVybiAgIDogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgICAgIEludCBDQlAgICAgICAgICBDb2RlZCBCbG9jayBQYXR0ZXJuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICBNb2RpZmllZCA6ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09ICovCi0KLXZvaWQgUnVuTGV2ZWwoVmlkZW9FbmNEYXRhICp2aWRlbywgSW50IGludHJhLCBJbnQgaW50cmFEQ19kZWNpc2lvbiwgSW50IG5jb2VmYmxja1tdKQotewotICAgIEludCBpLCBqOwotICAgIEludCBDQlAgPSB2aWRlby0+aGVhZGVySW5mby5DQlBbdmlkZW8tPm1ibnVtXTsKLSAgICBJbnQgU2hvcnROYWNOaW50cmEgPSAoISh2aWRlby0+dm9sW3ZpZGVvLT5jdXJyTGF5ZXJdLT5zaG9ydFZpZGVvSGVhZGVyKSAmJiB2aWRlby0+YWNQcmVkRmxhZ1t2aWRlby0+bWJudW1dICYmIGludHJhKTsKLSAgICBNYWNyb0Jsb2NrICpNQiA9IHZpZGVvLT5vdXRwdXRNQjsKLSAgICBTaG9ydCAqZGF0YUJsb2NrOwotICAgIEludCBsZXZlbDsKLSAgICBSdW5MZXZlbEJsb2NrICpSTEI7Ci0gICAgSW50IHJ1biwgaWR4OwotICAgIEludCAqenosIG5jLCB6em9yZGVyOwotICAgIFVDaGFyIGltYXNrWzZdID0gezB4MUYsIDB4MkYsIDB4MzcsIDB4M0IsIDB4M0QsIDB4M0V9OwotICAgIFVJbnQgKmJpdG1hcHp6OwotCi0gICAgLyogU2V0IFJ1biwgTGV2ZWwgYW5kIENCUCBmb3IgdGhpcyBNYWNyb2Jsb2NrICovCi0gICAgLyogWlogc2NhbiBpcyBkb25lIGhlcmUuICAqLwotCi0gICAgaWYgKGludHJhKQotICAgIHsKLQotICAgICAgICBpZiAoaW50cmFEQ19kZWNpc2lvbiAhPSAwKQotICAgICAgICAgICAgaW50cmEgPSAwOyAgICAgICAgICAgICAgLyogREMvQUMgaW4gUnVuL0xldmVsICovCi0KLSAgICAgICAgZm9yIChpID0gMDsgaSA8IDYgOyBpKyspCi0gICAgICAgIHsKLQotICAgICAgICAgICAgenogPSAoSW50ICopIHppZ3phZ19pbnY7Ci0KLSAgICAgICAgICAgIFJMQiA9IHZpZGVvLT5STEIgKyBpOwotCi0gICAgICAgICAgICBkYXRhQmxvY2sgPSBNQi0+YmxvY2tbaV07Ci0KLSAgICAgICAgICAgIGlmIChpbnRyYSkKLSAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICBSTEItPnJ1blswXSA9IDA7Ci0gICAgICAgICAgICAgICAgbGV2ZWwgPSBkYXRhQmxvY2tbMF07Ci0gICAgICAgICAgICAgICAgZGF0YUJsb2NrWzBdID0gMDsgLyogcmVzZXQgdG8gemVybyAqLwotICAgICAgICAgICAgICAgIGlmIChsZXZlbCA8IDApCi0gICAgICAgICAgICAgICAgewotICAgICAgICAgICAgICAgICAgICBSTEItPmxldmVsWzBdID0gLWxldmVsOwotICAgICAgICAgICAgICAgICAgICBSTEItPnNbMF0gPSAxOwotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICBlbHNlCi0gICAgICAgICAgICAgICAgewotICAgICAgICAgICAgICAgICAgICBSTEItPmxldmVsWzBdID0gbGV2ZWw7Ci0gICAgICAgICAgICAgICAgICAgIFJMQi0+c1swXSA9IDA7Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgfQotCi0gICAgICAgICAgICBpZHggPSBpbnRyYTsKLQotICAgICAgICAgICAgaWYgKChDQlAgPj4gKDUgLSBpKSkgJiAxKQotICAgICAgICAgICAgewotICAgICAgICAgICAgICAgIGlmIChTaG9ydE5hY05pbnRyYSkKLSAgICAgICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgICAgIHN3aXRjaCAoKHZpZGVvLT56el9kaXJlY3Rpb24gPj4gKDUgLSBpKSkmMSkKLSAgICAgICAgICAgICAgICAgICAgewotICAgICAgICAgICAgICAgICAgICAgICAgY2FzZSAwOgotICAgICAgICAgICAgICAgICAgICAgICAgICAgIHp6ID0gKEludCAqKXppZ3phZ192X2ludjsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKLSAgICAgICAgICAgICAgICAgICAgICAgIGNhc2UgMToKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICB6eiA9IChJbnQgKil6aWd6YWdfaF9pbnY7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7Ci0gICAgICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgcnVuID0gMDsKLSAgICAgICAgICAgICAgICBuYyA9IG5jb2VmYmxja1tpXTsKLSAgICAgICAgICAgICAgICBmb3IgKGogPSBpbnRyYSwgenogKz0gaW50cmE7IGogPCBuYzsgaisrLCB6eisrKQotICAgICAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAgICAgenpvcmRlciA9ICp6ejsKLSAgICAgICAgICAgICAgICAgICAgbGV2ZWwgPSBkYXRhQmxvY2tbenpvcmRlcl07Ci0gICAgICAgICAgICAgICAgICAgIGlmIChsZXZlbCA9PSAwKQotICAgICAgICAgICAgICAgICAgICAgICAgcnVuKys7Ci0gICAgICAgICAgICAgICAgICAgIGVsc2UKLSAgICAgICAgICAgICAgICAgICAgewotICAgICAgICAgICAgICAgICAgICAgICAgZGF0YUJsb2NrW3p6b3JkZXJdID0gMDsgLyogcmVzZXQgb3V0cHV0ICovCi0gICAgICAgICAgICAgICAgICAgICAgICBpZiAobGV2ZWwgPCAwKQotICAgICAgICAgICAgICAgICAgICAgICAgewotICAgICAgICAgICAgICAgICAgICAgICAgICAgIFJMQi0+bGV2ZWxbaWR4XSA9IC1sZXZlbDsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBSTEItPnNbaWR4XSA9IDE7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgUkxCLT5ydW5baWR4XSA9IHJ1bjsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBydW4gPSAwOwotICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlkeCsrOwotICAgICAgICAgICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgICAgICAgICAgZWxzZQotICAgICAgICAgICAgICAgICAgICAgICAgewotICAgICAgICAgICAgICAgICAgICAgICAgICAgIFJMQi0+bGV2ZWxbaWR4XSA9IGxldmVsOwotICAgICAgICAgICAgICAgICAgICAgICAgICAgIFJMQi0+c1tpZHhdID0gMDsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBSTEItPnJ1bltpZHhdID0gcnVuOwotICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJ1biA9IDA7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgaWR4Kys7Ci0gICAgICAgICAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgIG5jb2VmYmxja1tpXSA9IGlkeDsgLyogNS8yMi8wMSwgcmV1c2UgbmNvZWZibGNrICovCi0KLSAgICAgICAgICAgIGlmIChpZHggPT0gaW50cmEpIC8qIHJlc2V0IENCUCwgbm90aGluZyB0byBiZSBjb2RlZCAqLwotICAgICAgICAgICAgICAgIENCUCAmPSBpbWFza1tpXTsKLSAgICAgICAgfQotCi0gICAgICAgIHZpZGVvLT5oZWFkZXJJbmZvLkNCUFt2aWRlby0+bWJudW1dID0gQ0JQOwotCi0gICAgICAgIHJldHVybiA7Ci0gICAgfQotICAgIGVsc2UKLSAgICB7Ci0vLyAgICAgIHp6ID0gKEludCAqKSB6aWd6YWdfaW52OyAgbm8gbmVlZCB0byB1c2UgaXQsIGRlZmF1bHQKLQotICAgICAgICBpZiAoQ0JQKQotICAgICAgICB7Ci0gICAgICAgICAgICBmb3IgKGkgPSAwOyBpIDwgNiA7IGkrKykKLSAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICBSTEIgPSB2aWRlby0+UkxCICsgaTsKLSAgICAgICAgICAgICAgICBpZHggPSAwOwotCi0gICAgICAgICAgICAgICAgaWYgKChDQlAgPj4gKDUgLSBpKSkgJiAxKQotICAgICAgICAgICAgICAgIHsgICAvKiA3LzMwLzAxICovCi0gICAgICAgICAgICAgICAgICAgIC8qIFVzZSBiaXRtYXB6eiB0byBmaW5kIHRoZSBSdW4sTGV2ZWwsU2lnbiBzeW1ib2xzICovCi0gICAgICAgICAgICAgICAgICAgIGJpdG1hcHp6ID0gdmlkZW8tPmJpdG1hcHp6W2ldOwotICAgICAgICAgICAgICAgICAgICBkYXRhQmxvY2sgPSBNQi0+YmxvY2tbaV07Ci0gICAgICAgICAgICAgICAgICAgIG5jICA9IG5jb2VmYmxja1tpXTsKLQotICAgICAgICAgICAgICAgICAgICBpZHggPSB6ZXJvX3J1bl9zZWFyY2goYml0bWFwenosIGRhdGFCbG9jaywgUkxCLCBuYyk7Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgIG5jb2VmYmxja1tpXSA9IGlkeDsgLyogNS8yMi8wMSwgcmV1c2UgbmNvZWZibGNrICovCi0gICAgICAgICAgICAgICAgaWYgKGlkeCA9PSAwKSAvKiByZXNldCBDQlAsIG5vdGhpbmcgdG8gYmUgY29kZWQgKi8KLSAgICAgICAgICAgICAgICAgICAgQ0JQICY9IGltYXNrW2ldOwotICAgICAgICAgICAgfQotICAgICAgICAgICAgdmlkZW8tPmhlYWRlckluZm8uQ0JQW3ZpZGVvLT5tYm51bV0gPSBDQlA7Ci0gICAgICAgIH0KLSAgICAgICAgcmV0dXJuIDsKLSAgICB9Ci19Ci0KLSNpZm5kZWYgSDI2M19PTkxZCi0jaWZkZWYgX19jcGx1c3BsdXMKLWV4dGVybiAiQyIKLXsKLSNlbmRpZgotICAgIHN0YXRpYyBCb29sIEludHJhRENTd2l0Y2hfRGVjaXNpb24oSW50IE1vZGUsIEludCBpbnRyYV9kY192bGNfdGhyLCBJbnQgaW50cmFEQ1ZsY1FQKQotICAgIHsKLSAgICAgICAgQm9vbCBzd2l0Y2hlZCA9IEZBTFNFOwotCi0gICAgICAgIGlmIChNb2RlID09IE1PREVfSU5UUkEgfHwgTW9kZSA9PSBNT0RFX0lOVFJBX1EpCi0gICAgICAgIHsKLSAgICAgICAgICAgIGlmIChpbnRyYV9kY192bGNfdGhyICE9IDApCi0gICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgc3dpdGNoZWQgPSAoaW50cmFfZGNfdmxjX3RociA9PSA3IHx8IGludHJhRENWbGNRUCA+PSBpbnRyYV9kY192bGNfdGhyICogMiArIDExKTsKLSAgICAgICAgICAgIH0KLSAgICAgICAgfQotCi0gICAgICAgIHJldHVybiBzd2l0Y2hlZDsKLSAgICB9Ci0jaWZkZWYgX19jcGx1c3BsdXMKLX0KLSNlbmRpZgotCi1JbnQgSW50cmFEQ19kcGNtKEludCB2YWwsIEludCBsdW0sIEJpdHN0cmVhbUVuY1ZpZGVvICpiaXRzdHJlYW0pCi17Ci0gICAgSW50IG5fYml0czsKLSAgICBJbnQgYWJzdmFsLCBzaXplID0gMDsKLQotICAgIGFic3ZhbCA9ICh2YWwgPCAwKSA/IC12YWwgOiB2YWw7ICAgIC8qIGFicyh2YWwpICovCi0KLQotICAgIC8qIGNvbXB1dGUgZGN0X2RjX3NpemUgKi8KLQotICAgIHNpemUgPSAwOwotICAgIHdoaWxlIChhYnN2YWwpCi0gICAgewotICAgICAgICBhYnN2YWwgPj49IDE7Ci0gICAgICAgIHNpemUrKzsKLSAgICB9Ci0KLSAgICBpZiAobHVtKQotICAgIHsgICAvKiBsdW1pbmFuY2UgKi8KLSAgICAgICAgbl9iaXRzID0gUHV0RENzaXplX2x1bShzaXplLCBiaXRzdHJlYW0pOwotICAgIH0KLSAgICBlbHNlCi0gICAgeyAgIC8qIGNocm9taW5hbmNlICovCi0gICAgICAgIG5fYml0cyA9IFB1dERDc2l6ZV9jaHJvbShzaXplLCBiaXRzdHJlYW0pOwotICAgIH0KLQotICAgIGlmIChzaXplICE9IDApCi0gICAgewotICAgICAgICBpZiAodmFsID49IDApCi0gICAgICAgIHsKLSAgICAgICAgICAgIDsKLSAgICAgICAgfQotICAgICAgICBlbHNlCi0gICAgICAgIHsKLSAgICAgICAgICAgIGFic3ZhbCA9IC12YWw7IC8qIHNldCB0byAiLXZhbCIgTVcgMTQtTk9WLTE5OTYgKi8KLSAgICAgICAgICAgIHZhbCA9IGFic3ZhbCBeKCgxIDw8IHNpemUpIC0gMSk7Ci0gICAgICAgIH0KLSAgICAgICAgQml0c3RyZWFtUHV0Qml0cyhiaXRzdHJlYW0sIChzaXplKSwgKFVJbnQpKHZhbCkpOwotICAgICAgICBuX2JpdHMgKz0gc2l6ZTsKLQotICAgICAgICBpZiAoc2l6ZSA+IDgpCi0gICAgICAgICAgICBCaXRzdHJlYW1QdXQxQml0cyhiaXRzdHJlYW0sIDEpOwotICAgIH0KLQotICAgIHJldHVybiBuX2JpdHM7ICAvKiAjIGJpdHMgZm9yIGludHJhX2RjIGRwY20gKi8KLQotfQotCi0vKiA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0gKi8KLS8qICBGdW5jdGlvbiA6IERDX0FDX1BSRUQgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogIERhdGUgICAgIDogMDkvMjQvMjAwMCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgUHVycG9zZSAgOiBEQyBhbmQgQUMgZW5jb2Rpbmcgb2YgSW50cmEgQmxvY2tzICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICBJbi9vdXQgICA6ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogICAgICBWaWRlb0VuY0RhdGEgICAgKnZpZGVvCi0gICAgICAgIFVDaGFyICAgICAgICAgICBNb2RlICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICBSZXR1cm4gICA6ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09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lmICghKE1vZGVfdG9wID09IE1PREVfSU5UUkEgfHwgTW9kZV90b3AgPT0gTU9ERV9JTlRSQV9RKSkKLSAgICAgICAgewotICAgICAgICAgICAgRENBQyA9IERDX3N0b3JlWy1uTUJQZXJSb3ddOwotICAgICAgICAgICAgKkRDQUMrKyA9IG1pZF9ncmV5OwotICAgICAgICAgICAgKkRDQUMrKyA9IG1pZF9ncmV5OwotICAgICAgICAgICAgKkRDQUMrKyA9IG1pZF9ncmV5OwotICAgICAgICAgICAgKkRDQUMrKyA9IG1pZF9ncmV5OwotICAgICAgICAgICAgKkRDQUMrKyA9IG1pZF9ncmV5OwotICAgICAgICAgICAgKkRDQUMrKyA9IG1pZF9ncmV5OwotICAgICAgICAgICAgLyogc2V0IHRvIDAgRENBQ19yb3dbeF9wb3NdWzAuLjNdICovCi0gICAgICAgICAgICBpZiAoYkFDUHJlZEVuYWJsZSA9PSBUUlVFKQotICAgICAgICAgICAgewotICAgICAgICAgICAgICAgIE00VkVOQ19NRU1TRVQoRENBQ19yb3dbeF9wb3NdWzBdLCAwLCBzaXplb2YoU2hvcnQpIDw8IDUpOwotICAgICAgICAgICAgfQotICAgICAgICB9Ci0gICAgfQotICAgIGlmICh4X3BvcyA+IDApCi0gICAgewotICAgICAgICBNb2RlX2xlZnQgPSB2aWRlby0+aGVhZGVySW5mby5Nb2RlW21ibnVtLTFdOwotICAgICAgICBpZiAoIShNb2RlX2xlZnQgPT0gTU9ERV9JTlRSQSB8fCBNb2RlX2xlZnQgPT0gTU9ERV9JTlRSQV9RKSkKLSAgICAgICAgewotICAgICAgICAgICAgRENBQyA9IERDX3N0b3JlWy0xXTsKLSAgICAgICAgICAgICpEQ0FDKysgPSBtaWRfZ3JleTsKLSAgICAgICAgICAgICpEQ0FDKysgPSBtaWRfZ3JleTsKLSAgICAgICAgICAgICpEQ0FDKysgPSBtaWRfZ3JleTsKLSAgICAgICAgICAgICpEQ0FDKysgPSBtaWRfZ3JleTsKLSAgICAgICAgICAgICpEQ0FDKysgPSBtaWRfZ3JleTsKLSAgICAgICAgICAgICpEQ0FDKysgPSBtaWRfZ3JleTsKLSAgICAgICAgICAgIC8qIHNldCB0byAwIERDQUNfY29sW3hfcG9zXVswLi4zXSAqLwotICAgICAgICAgICAgaWYgKGJBQ1ByZWRFbmFibGUgPT0gVFJVRSkKLSAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICBNNFZFTkNfTUVNU0VUKERDQUNfY29sWzBdWzBdLCAwLCBzaXplb2YoU2hvcnQpIDw8IDUpOwotICAgICAgICAgICAgfQotICAgICAgICB9Ci0gICAgfQotCi0gICAgUzEgPSAwOwotICAgIFMyID0gMDsKLQotICAgIGZvciAoY29tcCA9IDA7IGNvbXAgPCA2OyBjb21wKyspCi0gICAgewotCi0gICAgICAgIGlmIChZcG9zW2NvbXBdICE9IDApICAgICAgICB5X29mZnNldCA9IC1uTUJQZXJSb3c7Ci0gICAgICAgIGVsc2UgICAgICAgICAgICAgICAgICAgIHlfb2Zmc2V0ID0gMDsKLSAgICAgICAgeF9vZmZzZXQgPSBYcG9zW2NvbXBdOwotICAgICAgICB4X3RhYiA9IFh0YWJbY29tcF07Ci0gICAgICAgIHlfdGFiID0gWXRhYltjb21wXTsKLSAgICAgICAgel90YWIgPSBadGFiW2NvbXBdOwotCi0gICAgICAgIGJfeHRhYiA9IEJfWHRhYltjb21wXTsKLSAgICAgICAgYl95dGFiID0gQl9ZdGFiW2NvbXBdOwotCi0gICAgICAgIHFjb2VmZiA9IE1CLT5ibG9ja1tjb21wXTsKLQotICAgICAgICAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLSAgICAgICAgLyogIFN0b3JlIERDIGNvZWZmaWNpZW50cyAqLwotICAgICAgICAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLSAgICAgICAgLyogU3RvcmUgY29lZmYgdmFsdWVzIGZvciBJbnRyYSBNQiAqLwotICAgICAgICBpZiAoY29tcCA9PSAwKSBkY19zY2FsZSA9IGNhbF9kY19zY2FsZXJFTkMoUVAsIDEpIDsKLSAgICAgICAgaWYgKGNvbXAgPT0gNCkgZGNfc2NhbGUgPSBjYWxfZGNfc2NhbGVyRU5DKFFQLCAyKSA7Ci0KLSAgICAgICAgUVB0bXAgPSBxY29lZmZbMF0gKiBkY19zY2FsZTsgLyogREMgdmFsdWUgKi8KLQotICAgICAgICBpZiAoUVB0bXAgPiAyMDQ3KSAgIC8qIDEwLzEwLzAxLCBhZGQgY2xpcHBpbmcgKGJ1ZyBmaXhlZCkgKi8KLSAgICAgICAgICAgIERDX3N0b3JlWzBdW2NvbXBdID0gMjA0NzsKLSAgICAgICAgZWxzZSBpZiAoUVB0bXAgPCAtMjA0OCkKLSAgICAgICAgICAgIERDX3N0b3JlWzBdW2NvbXBdID0gLTIwNDg7Ci0gICAgICAgIGVsc2UKLSAgICAgICAgICAgIERDX3N0b3JlWzBdW2NvbXBdID0gUVB0bXA7Ci0KLSAgICAgICAgLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotICAgICAgICAvKiBGaW5kIHRoZSBkaXJlY3Rpb24gb2YgdGhlIHByZWRpY3Rpb24gYW5kIHRoZSBEQyBwcmVkaWN0aW9uICovCi0gICAgICAgIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLQotICAgICAgICBpZiAoKHhfcG9zID09IDApICYmIHlfcG9zID09IDApCi0gICAgICAgIHsgICAvKiB0b3AgbGVmdCBjb3JuZXIgKi8KLSAgICAgICAgICAgIGJsb2NrX0EgPSAoY29tcCA9PSAxIHx8IGNvbXAgPT0gMykgPyBEQ19zdG9yZVswXVt4X3RhYl0gOiBtaWRfZ3JleTsKLSAgICAgICAgICAgIGJsb2NrX0IgPSAoY29tcCA9PSAzKSA/IERDX3N0b3JlW3hfb2Zmc2V0XVt6X3RhYl0gOiBtaWRfZ3JleTsKLSAgICAgICAgICAgIGJsb2NrX0MgPSAoY29tcCA9PSAyIHx8IGNvbXAgPT0gMykgPyBEQ19zdG9yZVswXVt5X3RhYl0gOiBtaWRfZ3JleTsKLSAgICAgICAgfQotICAgICAgICBlbHNlIGlmICh4X3BvcyA9PSAwKQotICAgICAgICB7ICAgLyogbGVmdCBlZGdlICovCi0gICAgICAgICAgICBibG9ja19BID0gKGNvbXAgPT0gMSB8fCBjb21wID09IDMpID8gRENfc3RvcmVbMF1beF90YWJdIDogbWlkX2dyZXk7Ci0gICAgICAgICAgICBibG9ja19CID0gKChjb21wID09IDEgJiYgKHNsaWNlX25iW21ibnVtXSA9PSBzbGljZV9uYlttYm51bS1uTUJQZXJSb3ddKSkgfHwgY29tcCA9PSAzKSA/Ci0gICAgICAgICAgICAgICAgICAgICAgRENfc3RvcmVbeV9vZmZzZXQreF9vZmZzZXRdW3pfdGFiXSA6IG1pZF9ncmV5OwotICAgICAgICAgICAgYmxvY2tfQyA9IChjb21wID09IDIgfHwgY29tcCA9PSAzIHx8Ci0gICAgICAgICAgICAgICAgICAgICAgIChQb3MwW2NvbXBdICYmIChzbGljZV9uYlttYm51bV0gPT0gc2xpY2VfbmJbbWJudW0tbk1CUGVyUm93XSkpKSA/Ci0gICAgICAgICAgICAgICAgICAgICAgRENfc3RvcmVbeV9vZmZzZXRdW3lfdGFiXSA6IG1pZF9ncmV5OwotICAgICAgICB9Ci0gICAgICAgIGVsc2UgaWYgKHlfcG9zID09IDApCi0gICAgICAgIHsgLyogdG9wIHJvdyAqLwotICAgICAgICAgICAgYmxvY2tfQSA9IChjb21wID09IDEgfHwgY29tcCA9PSAzIHx8IChQb3MxW2NvbXBdICYmIChzbGljZV9uYlttYm51bV0gPT0gc2xpY2VfbmJbbWJudW0tMV0pKSkgPwotICAgICAgICAgICAgICAgICAgICAgIERDX3N0b3JlW3hfb2Zmc2V0XVt4X3RhYl0gOiBtaWRfZ3JleTsKLSAgICAgICAgICAgIGJsb2NrX0IgPSAoKGNvbXAgPT0gMiAmJiAoc2xpY2VfbmJbbWJudW1dID09IHNsaWNlX25iW21ibnVtLTFdKSkgfHwgY29tcCA9PSAzKSA/Ci0gICAgICAgICAgICAgICAgICAgICAgRENfc3RvcmVbeV9vZmZzZXQgKyB4X29mZnNldF1bel90YWJdIDogbWlkX2dyZXk7Ci0gICAgICAgICAgICBibG9ja19DID0gKGNvbXAgPT0gMiB8fCBjb21wID09IDMpID8KLSAgICAgICAgICAgICAgICAgICAgICBEQ19zdG9yZVt5X29mZnNldF1beV90YWJdIDogbWlkX2dyZXk7Ci0gICAgICAgIH0KLSAgICAgICAgZWxzZQotICAgICAgICB7Ci0gICAgICAgICAgICBibG9ja19BID0gKGNvbXAgPT0gMSB8fCBjb21wID09IDMgfHwgKFBvczFbY29tcF0gJiYgKHNsaWNlX25iW21ibnVtXSA9PSBzbGljZV9uYlttYm51bS0xXSkpKSA/Ci0gICAgICAgICAgICAgICAgICAgICAgRENfc3RvcmVbeF9vZmZzZXRdW3hfdGFiXSA6IG1pZF9ncmV5OwotICAgICAgICAgICAgYmxvY2tfQiA9ICgoKGNvbXAgPT0gMCB8fCBjb21wID09IDQgfHwgY29tcCA9PSA1KSAmJgotICAgICAgICAgICAgICAgICAgICAgICAgKHNsaWNlX25iW21ibnVtXSA9PSBzbGljZV9uYlttYm51bS0xLW5NQlBlclJvd10pKSB8fAotICAgICAgICAgICAgICAgICAgICAgICAoY29tcCA9PSAxICYmIChzbGljZV9uYlttYm51bV0gPT0gc2xpY2VfbmJbbWJudW0tbk1CUGVyUm93XSkpIHx8Ci0gICAgICAgICAgICAgICAgICAgICAgIChjb21wID09IDIgJiYgKHNsaWNlX25iW21ibnVtXSA9PSBzbGljZV9uYlttYm51bS0xXSkpIHx8IChjb21wID09IDMpKSA/Ci0gICAgICAgICAgICAgICAgICAgICAgKERDX3N0b3JlW3lfb2Zmc2V0ICsgeF9vZmZzZXRdW3pfdGFiXSkgOiBtaWRfZ3JleTsKLSAgICAgICAgICAgIGJsb2NrX0MgPSAoY29tcCA9PSAyIHx8IGNvbXAgPT0gMyB8fCAoUG9zMFtjb21wXSAmJiAoc2xpY2VfbmJbbWJudW1dID09IHNsaWNlX25iW21ibnVtLW5NQlBlclJvd10pKSkgPwotICAgICAgICAgICAgICAgICAgICAgIERDX3N0b3JlW3lfb2Zmc2V0XVt5X3RhYl0gOiBtaWRfZ3JleTsKLSAgICAgICAgfQotICAgICAgICBncmFkX2hvciA9IGJsb2NrX0IgLSBibG9ja19DOwotICAgICAgICBncmFkX3ZlciA9IGJsb2NrX0EgLSBibG9ja19COwotCi0gICAgICAgIGlmICgoUFZfQUJTKGdyYWRfdmVyKSkgPCAoUFZfQUJTKGdyYWRfaG9yKSkpCi0gICAgICAgIHsKLSAgICAgICAgICAgIERDX3ByZWQgPSBibG9ja19DOwotICAgICAgICAgICAgZGlyZWN0aW9uW2NvbXBdID0gMTsKLSAgICAgICAgICAgIHZpZGVvLT56el9kaXJlY3Rpb24gPSAodmlkZW8tPnp6X2RpcmVjdGlvbikgfCBtYXNrMVtjb21wXTsKLQotICAgICAgICB9Ci0gICAgICAgIGVsc2UKLSAgICAgICAgewotICAgICAgICAgICAgRENfcHJlZCA9IGJsb2NrX0E7Ci0gICAgICAgICAgICBkaXJlY3Rpb25bY29tcF0gPSAwOwotICAgICAgICAgICAgLy92aWRlby0+enpfZGlyZWN0aW9uPXZpZGVvLT56el9kaXJlY3Rpb248PDE7Ci0gICAgICAgIH0KLQotICAgICAgICAvKiBEQyBwcmVkaWN0aW9uICovCi0gICAgICAgIFFQdG1wID0gZGNfc2NhbGU7IC8qIDUvMjgvMDEgKi8KLSAgICAgICAgcWNvZWZmWzBdIC09IChEQ19wcmVkICsgUVB0bXAgLyAyKSAvIFFQdG1wOwotCi0KLSAgICAgICAgaWYgKGJBQ1ByZWRFbmFibGUpCi0gICAgICAgIHsKLSAgICAgICAgICAgIC8qKioqKioqKioqKioqKioqKioqKioqKi8KLSAgICAgICAgICAgIC8qIEZpbmQgQUMgcHJlZGljdGlvbiAgKi8KLSAgICAgICAgICAgIC8qKioqKioqKioqKioqKioqKioqKioqKi8KLQotICAgICAgICAgICAgaWYgKCh4X3BvcyA9PSAwKSAmJiB5X3BvcyA9PSAwKSAgICAgLyogdG9wIGxlZnQgY29ybmVyICovCi0gICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgaWYgKGRpcmVjdGlvbltjb21wXSA9PSAwKQotICAgICAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAgICAgaWYgKGNvbXAgPT0gMSB8fCBjb21wID09IDMpCi0gICAgICAgICAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAgICAgICAgIFFQdG1wID0gUVBNQlttYm51bSt4X29mZnNldF07Ci0gICAgICAgICAgICAgICAgICAgICAgICBEQ0FDID0gRENBQ19jb2xbMF1bYl95dGFiXTsKLSAgICAgICAgICAgICAgICAgICAgICAgIGlmIChRUHRtcCAhPSBRUCkKLSAgICAgICAgICAgICAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBwcmVkcHRyID0gcHJlZDsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBQUkVESUNUX0FDCi0gICAgICAgICAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgICAgICAgICBlbHNlCi0gICAgICAgICAgICAgICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgcHJlZHB0ciA9IERDQUM7Ci0gICAgICAgICAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICAgICAgZWxzZQotICAgICAgICAgICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgICAgICAgICBwcmVkcHRyID0gcHJlZDsKLSAgICAgICAgICAgICAgICAgICAgICAgIHByZWRbMF0gPSBwcmVkWzFdID0gcHJlZFsyXSA9IHByZWRbM10gPSBwcmVkWzRdID0gcHJlZFs1XSA9IHByZWRbNl0gPSAwOwotICAgICAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgIGVsc2UKLSAgICAgICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgICAgIGlmIChjb21wID09IDIgfHwgY29tcCA9PSAzKQotICAgICAgICAgICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgICAgICAgICBRUHRtcCA9IFFQTUJbbWJudW0rIHlfb2Zmc2V0XTsKLSAgICAgICAgICAgICAgICAgICAgICAgIERDQUMgPSBEQ0FDX3Jvd1t4X3Bvc11bYl94dGFiXTsKLSAgICAgICAgICAgICAgICAgICAgICAgIGlmIChRUHRtcCAhPSBRUCkKLSAgICAgICAgICAgICAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBwcmVkcHRyID0gcHJlZDsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBQUkVESUNUX0FDCi0gICAgICAgICAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgICAgICAgICBlbHNlCi0gICAgICAgICAgICAgICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgcHJlZHB0ciA9IERDQUM7Ci0gICAgICAgICAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICAgICAgZWxzZQotICAgICAgICAgICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgICAgICAgICBwcmVkcHRyID0gcHJlZDsKLSAgICAgICAgICAgICAgICAgICAgICAgIHByZWRbMF0gPSBwcmVkWzFdID0gcHJlZFsyXSA9IHByZWRbM10gPSBwcmVkWzRdID0gcHJlZFs1XSA9IHByZWRbNl0gPSAwOwotICAgICAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgfQotICAgICAgICAgICAgZWxzZSBpZiAoeF9wb3MgPT0gMCkgICAgLyogbGVmdCBlZGdlICovCi0gICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgaWYgKGRpcmVjdGlvbltjb21wXSA9PSAwKQotICAgICAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAgICAgaWYgKGNvbXAgPT0gMSB8fCBjb21wID09IDMpCi0gICAgICAgICAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAgICAgICAgIFFQdG1wID0gUVBNQlttYm51bSt4X29mZnNldF07Ci0gICAgICAgICAgICAgICAgICAgICAgICBEQ0FDID0gRENBQ19jb2xbMF1bYl95dGFiXTsKLSAgICAgICAgICAgICAgICAgICAgICAgIGlmIChRUHRtcCAhPSBRUCkKLSAgICAgICAgICAgICAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBwcmVkcHRyID0gcHJlZDsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBQUkVESUNUX0FDCi0gICAgICAgICAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgICAgICAgICBlbHNlCi0gICAgICAgICAgICAgICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgcHJlZHB0ciA9IERDQUM7Ci0gICAgICAgICAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICAgICAgZWxzZQotICAgICAgICAgICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgICAgICAgICBwcmVkcHRyID0gcHJlZDsKLSAgICAgICAgICAgICAgICAgICAgICAgIHByZWRbMF0gPSBwcmVkWzFdID0gcHJlZFsyXSA9IHByZWRbM10gPSBwcmVkWzRdID0gcHJlZFs1XSA9IHByZWRbNl0gPSAwOwotICAgICAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgIGVsc2UKLSAgICAgICAgICAgICAgICB7Ci0KLSAgICAgICAgICAgICAgICAgICAgaWYgKChQb3MwW2NvbXBdICYmIChzbGljZV9uYlttYm51bV0gPT0gc2xpY2VfbmJbbWJudW0tbk1CUGVyUm93XSkpCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgfHwgY29tcCA9PSAyIHx8IGNvbXAgPT0gMykKLSAgICAgICAgICAgICAgICAgICAgewotICAgICAgICAgICAgICAgICAgICAgICAgUVB0bXAgPSBRUE1CW21ibnVtK3lfb2Zmc2V0XTsKLSAgICAgICAgICAgICAgICAgICAgICAgIERDQUMgPSBEQ0FDX3Jvd1t4X3Bvc11bYl94dGFiXTsKLSAgICAgICAgICAgICAgICAgICAgICAgIGlmIChRUHRtcCAhPSBRUCkKLSAgICAgICAgICAgICAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBwcmVkcHRyID0gcHJlZDsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBQUkVESUNUX0FDCi0gICAgICAgICAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgICAgICAgICBlbHNlCi0gICAgICAgICAgICAgICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgcHJlZHB0ciA9IERDQUM7Ci0gICAgICAgICAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICAgICAgZWxzZQotICAgICAgICAgICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgICAgICAgICBwcmVkcHRyID0gcHJlZDsKLSAgICAgICAgICAgICAgICAgICAgICAgIHByZWRbMF0gPSBwcmVkWzFdID0gcHJlZFsyXSA9IHByZWRbM10gPSBwcmVkWzRdID0gcHJlZFs1XSA9IHByZWRbNl0gPSAwOwotICAgICAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgfQotICAgICAgICAgICAgZWxzZSBpZiAoeV9wb3MgPT0gMCkgIC8qIHRvcCByb3cgKi8KLSAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICBpZiAoZGlyZWN0aW9uW2NvbXBdID09IDApCi0gICAgICAgICAgICAgICAgewotICAgICAgICAgICAgICAgICAgICBpZiAoKFBvczFbY29tcF0gJiYgKHNsaWNlX25iW21ibnVtXSA9PSBzbGljZV9uYlttYm51bS0xXSkpCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgfHwgY29tcCA9PSAxIHx8IGNvbXAgPT0gMykKLSAgICAgICAgICAgICAgICAgICAgewotICAgICAgICAgICAgICAgICAgICAgICAgUVB0bXAgPSBRUE1CW21ibnVtK3hfb2Zmc2V0XTsKLSAgICAgICAgICAgICAgICAgICAgICAgIERDQUMgPSBEQ0FDX2NvbFswXVtiX3l0YWJdOwotICAgICAgICAgICAgICAgICAgICAgICAgaWYgKFFQdG1wICE9IFFQKQotICAgICAgICAgICAgICAgICAgICAgICAgewotICAgICAgICAgICAgICAgICAgICAgICAgICAgIHByZWRwdHIgPSBwcmVkOwotICAgICAgICAgICAgICAgICAgICAgICAgICAgIFBSRURJQ1RfQUMKLSAgICAgICAgICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICAgICAgICAgIGVsc2UKLSAgICAgICAgICAgICAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBwcmVkcHRyID0gRENBQzsKLSAgICAgICAgICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgICAgICBlbHNlCi0gICAgICAgICAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAgICAgICAgIHByZWRwdHIgPSBwcmVkOwotICAgICAgICAgICAgICAgICAgICAgICAgcHJlZFswXSA9IHByZWRbMV0gPSBwcmVkWzJdID0gcHJlZFszXSA9IHByZWRbNF0gPSBwcmVkWzVdID0gcHJlZFs2XSA9IDA7Ci0gICAgICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgZWxzZQotICAgICAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAgICAgaWYgKGNvbXAgPT0gMiB8fCBjb21wID09IDMpCi0gICAgICAgICAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAgICAgICAgIFFQdG1wID0gUVBNQlttYm51bSt5X29mZnNldF07Ci0gICAgICAgICAgICAgICAgICAgICAgICBEQ0FDID0gRENBQ19yb3dbeF9wb3NdW2JfeHRhYl07Ci0gICAgICAgICAgICAgICAgICAgICAgICBpZiAoUVB0bXAgIT0gUVApCi0gICAgICAgICAgICAgICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgcHJlZHB0ciA9IHByZWQ7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgUFJFRElDVF9BQwotICAgICAgICAgICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgICAgICAgICAgZWxzZQotICAgICAgICAgICAgICAgICAgICAgICAgewotICAgICAgICAgICAgICAgICAgICAgICAgICAgIHByZWRwdHIgPSBEQ0FDOwotICAgICAgICAgICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgICAgIGVsc2UKLSAgICAgICAgICAgICAgICAgICAgewotICAgICAgICAgICAgICAgICAgICAgICAgcHJlZHB0ciA9IHByZWQ7Ci0gICAgICAgICAgICAgICAgICAgICAgICBwcmVkWzBdID0gcHJlZFsxXSA9IHByZWRbMl0gPSBwcmVkWzNdID0gcHJlZFs0XSA9IHByZWRbNV0gPSBwcmVkWzZdID0gMDsKLSAgICAgICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgIH0KLSAgICAgICAgICAgIGVsc2UKLSAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICBpZiAoZGlyZWN0aW9uW2NvbXBdID09IDApCi0gICAgICAgICAgICAgICAgewotICAgICAgICAgICAgICAgICAgICBpZiAoKFBvczFbY29tcF0gJiYgKHNsaWNlX25iW21ibnVtXSA9PSBzbGljZV9uYlttYm51bS0xXSkpCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgfHwgY29tcCA9PSAxIHx8IGNvbXAgPT0gMykKLSAgICAgICAgICAgICAgICAgICAgewotICAgICAgICAgICAgICAgICAgICAgICAgUVB0bXAgPSBRUE1CW21ibnVtK3hfb2Zmc2V0XTsKLSAgICAgICAgICAgICAgICAgICAgICAgIERDQUMgPSBEQ0FDX2NvbFswXVtiX3l0YWJdOwotICAgICAgICAgICAgICAgICAgICAgICAgaWYgKFFQdG1wICE9IFFQKQotICAgICAgICAgICAgICAgICAgICAgICAgewotICAgICAgICAgICAgICAgICAgICAgICAgICAgIHByZWRwdHIgPSBwcmVkOwotICAgICAgICAgICAgICAgICAgICAgICAgICAgIFBSRURJQ1RfQUMKLSAgICAgICAgICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICAgICAgICAgIGVsc2UKLSAgICAgICAgICAgICAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBwcmVkcHRyID0gRENBQzsKLSAgICAgICAgICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgICAgICBlbHNlCi0gICAgICAgICAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAgICAgICAgIHByZWRwdHIgPSBwcmVkOwotICAgICAgICAgICAgICAgICAgICAgICAgcHJlZFswXSA9IHByZWRbMV0gPSBwcmVkWzJdID0gcHJlZFszXSA9IHByZWRbNF0gPSBwcmVkWzVdID0gcHJlZFs2XSA9IDA7Ci0gICAgICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgZWxzZQotICAgICAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAgICAgaWYgKChQb3MwW2NvbXBdICYmIChzbGljZV9uYlttYm51bV0gPT0gc2xpY2VfbmJbbWJudW0tbk1CUGVyUm93XSkpCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgfHwgY29tcCAgPT0gMiB8fCBjb21wID09IDMpCi0gICAgICAgICAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAgICAgICAgIFFQdG1wID0gUVBNQlttYm51bSt5X29mZnNldF07Ci0gICAgICAgICAgICAgICAgICAgICAgICBEQ0FDID0gRENBQ19yb3dbeF9wb3NdW2JfeHRhYl07Ci0gICAgICAgICAgICAgICAgICAgICAgICBpZiAoUVB0bXAgIT0gUVApCi0gICAgICAgICAgICAgICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgcHJlZHB0ciA9IHByZWQ7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgUFJFRElDVF9BQwotICAgICAgICAgICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgICAgICAgICAgZWxzZQotICAgICAgICAgICAgICAgICAgICAgICAgewotICAgICAgICAgICAgICAgICAgICAgICAgICAgIHByZWRwdHIgPSBEQ0FDOwotICAgICAgICAgICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgICAgIGVsc2UKLSAgICAgICAgICAgICAgICAgICAgewotICAgICAgICAgICAgICAgICAgICAgICAgcHJlZHB0ciA9IHByZWQ7Ci0gICAgICAgICAgICAgICAgICAgICAgICBwcmVkWzBdID0gcHJlZFsxXSA9IHByZWRbMl0gPSBwcmVkWzNdID0gcHJlZFs0XSA9IHByZWRbNV0gPSBwcmVkWzZdID0gMDsKLSAgICAgICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLSAgICAgICAgICAgIC8qIERlY2lkZSBhbmQgUGVyZm9ybSBBQyBwcmVkaWN0aW9uICovCi0gICAgICAgICAgICAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotICAgICAgICAgICAgbmV3Q0JQW2NvbXBdID0gMDsKLQotICAgICAgICAgICAgaWYgKGRpcmVjdGlvbltjb21wXSA9PSAwKSAgIC8qIEhvcml6b250YWwsIGxlZnQgQ09MVU1OIG9mIGJsb2NrIEEgKi8KLSAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICBEQ0FDID0gcGNvZWZmICsgY29tcCAqIDc7IC8qIHJlLXVzZSBEQ0FDIGFzIGxvY2FsIHZhciAqLwotICAgICAgICAgICAgICAgIHFjb2VmZiArPSA4OwotICAgICAgICAgICAgICAgIGZvciAobSA9IDA7IG0gPCA3OyBtKyspCi0gICAgICAgICAgICAgICAgewotICAgICAgICAgICAgICAgICAgICBRUHRtcCA9IHFjb2VmZlttPDwzXTsKLSAgICAgICAgICAgICAgICAgICAgaWYgKFFQdG1wID4gMCkgIFMxICs9IFFQdG1wOwotICAgICAgICAgICAgICAgICAgICBlbHNlICAgICAgICBTMSAtPSBRUHRtcDsKLSAgICAgICAgICAgICAgICAgICAgUVB0bXAgLT0gcHJlZHB0clttXTsKLSAgICAgICAgICAgICAgICAgICAgRENBQ1ttXSA9IFFQdG1wOyAvKiBzYXZlIHByZWRpY3Rpb24gcmVzaWR1ZSB0byBwY29lZmYqLwotICAgICAgICAgICAgICAgICAgICBpZiAoUVB0bXApICBuZXdDQlBbY29tcF0gPSAxOwotICAgICAgICAgICAgICAgICAgICBkaWZmID0gUFZfQUJTKFFQdG1wKTsKLSAgICAgICAgICAgICAgICAgICAgUzIgKz0gZGlmZjsKLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICB9Ci0gICAgICAgICAgICBlbHNlICAgICAgICAgICAgLyogVmVydGljYWwsIHRvcCBST1cgb2YgYmxvY2sgQyAqLwotICAgICAgICAgICAgewotICAgICAgICAgICAgICAgIHFjb2VmZisrOwotICAgICAgICAgICAgICAgIERDQUMgPSBwY29lZmYgKyBjb21wICogNzsgLyogcmUtdXNlIERDQUMgYXMgbG9jYWwgdmFyICovCi0gICAgICAgICAgICAgICAgZm9yIChtID0gMDsgbSA8IDc7IG0rKykKLSAgICAgICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgICAgIFFQdG1wID0gcWNvZWZmW21dOwotICAgICAgICAgICAgICAgICAgICBpZiAoUVB0bXAgPiAwKSAgUzEgKz0gUVB0bXA7Ci0gICAgICAgICAgICAgICAgICAgIGVsc2UgICAgICAgIFMxIC09IFFQdG1wOwotICAgICAgICAgICAgICAgICAgICBRUHRtcCAtPSBwcmVkcHRyW21dOwotICAgICAgICAgICAgICAgICAgICBEQ0FDW21dID0gUVB0bXA7IC8qIHNhdmUgcHJlZGljdGlvbiByZXNpZHVlIHRvIHBjb2VmZiovCi0gICAgICAgICAgICAgICAgICAgIGlmIChRUHRtcCkgIG5ld0NCUFtjb21wXSA9IDE7Ci0gICAgICAgICAgICAgICAgICAgIGRpZmYgPSBQVl9BQlMoUVB0bXApOwotICAgICAgICAgICAgICAgICAgICBTMiArPSBkaWZmOwotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgLyoqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0gICAgICAgICAgICAvKiAgU3RvcmUgRENBQyBjb2VmZmljaWVudHMgKi8KLSAgICAgICAgICAgIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotICAgICAgICAgICAgLyogU3RvcmUgY29lZmYgdmFsdWVzIGZvciBJbnRyYSBNQiAqLwotICAgICAgICAgICAgcWNvZWZmID0gTUItPmJsb2NrW2NvbXBdOwotICAgICAgICAgICAgRENBQyA9IERDQUNfcm93W3hfcG9zXVtiX3h0YWJdOwotICAgICAgICAgICAgRENBQ1swXSA9IHFjb2VmZlsxXTsKLSAgICAgICAgICAgIERDQUNbMV0gPSBxY29lZmZbMl07Ci0gICAgICAgICAgICBEQ0FDWzJdID0gcWNvZWZmWzNdOwotICAgICAgICAgICAgRENBQ1szXSA9IHFjb2VmZls0XTsKLSAgICAgICAgICAgIERDQUNbNF0gPSBxY29lZmZbNV07Ci0gICAgICAgICAgICBEQ0FDWzVdID0gcWNvZWZmWzZdOwotICAgICAgICAgICAgRENBQ1s2XSA9IHFjb2VmZls3XTsKLQotICAgICAgICAgICAgRENBQyA9IERDQUNfY29sWzBdW2JfeXRhYl07Ci0gICAgICAgICAgICBEQ0FDWzBdID0gcWNvZWZmWzhdOwotICAgICAgICAgICAgRENBQ1sxXSA9IHFjb2VmZlsxNl07Ci0gICAgICAgICAgICBEQ0FDWzJdID0gcWNvZWZmWzI0XTsKLSAgICAgICAgICAgIERDQUNbM10gPSBxY29lZmZbMzJdOwotICAgICAgICAgICAgRENBQ1s0XSA9IHFjb2VmZls0MF07Ci0gICAgICAgICAgICBEQ0FDWzVdID0gcWNvZWZmWzQ4XTsKLSAgICAgICAgICAgIERDQUNbNl0gPSBxY29lZmZbNTZdOwotCi0KLSAgICAgICAgfSAvKiBiQUNQcmVkRW5hYmxlICovCi0KLSAgICB9IC8qIEVORCBDT01QIEZPUiBMT09QICovCi0KLSAgICAvL2lmIChkaWZmID4gMjA0NykKLSAgICAvLyAgICBicmVhazsKLSAgICBTICs9IChTMSAtIFMyKTsKLQotCi0gICAgaWYgKFMgPj0gMCAmJiBiQUNQcmVkRW5hYmxlID09IFRSVUUpCi0gICAgewotICAgICAgICBBQ3ByZWRfZmxhZ1ttYm51bV0gPSAxOwotICAgICAgICBEQ0FDID0gcGNvZWZmOyAvKiBwcmVkaWN0aW9uIHJlc2lkdWUgKi8KLSAgICAgICAgcWNvZWZmID0gTUItPmJsb2NrWzBdOwotCi0gICAgICAgIGZvciAoY29tcCA9IDA7IGNvbXAgPCA2OyBjb21wKyspCi0gICAgICAgIHsKLSAgICAgICAgICAgIGlmIChkaXJlY3Rpb25bY29tcF0gPT0gMCkKLSAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICBxY29lZmZbOF0gPSBEQ0FDWzBdOwotICAgICAgICAgICAgICAgIHFjb2VmZlsxNl0gPSBEQ0FDWzFdOwotICAgICAgICAgICAgICAgIHFjb2VmZlsyNF0gPSBEQ0FDWzJdOwotICAgICAgICAgICAgICAgIHFjb2VmZlszMl0gPSBEQ0FDWzNdOwotICAgICAgICAgICAgICAgIHFjb2VmZls0MF0gPSBEQ0FDWzRdOwotICAgICAgICAgICAgICAgIHFjb2VmZls0OF0gPSBEQ0FDWzVdOwotICAgICAgICAgICAgICAgIHFjb2VmZls1Nl0gPSBEQ0FDWzZdOwotCi0gICAgICAgICAgICB9Ci0gICAgICAgICAgICBlbHNlCi0gICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgcWNvZWZmWzFdID0gRENBQ1swXTsKLSAgICAgICAgICAgICAgICBxY29lZmZbMl0gPSBEQ0FDWzFdOwotICAgICAgICAgICAgICAgIHFjb2VmZlszXSA9IERDQUNbMl07Ci0gICAgICAgICAgICAgICAgcWNvZWZmWzRdID0gRENBQ1szXTsKLSAgICAgICAgICAgICAgICBxY29lZmZbNV0gPSBEQ0FDWzRdOwotICAgICAgICAgICAgICAgIHFjb2VmZls2XSA9IERDQUNbNV07Ci0gICAgICAgICAgICAgICAgcWNvZWZmWzddID0gRENBQ1s2XTsKLSAgICAgICAgICAgIH0KLSAgICAgICAgICAgIGlmIChuZXdDQlBbY29tcF0pIC8qIDUvMjgvMDEsIHVwZGF0ZSBDQlAgKi8KLSAgICAgICAgICAgICAgICB2aWRlby0+aGVhZGVySW5mby5DQlBbbWJudW1dIHw9IG1hc2sxW2NvbXBdOwotICAgICAgICAgICAgRENBQyArPSA3OwotICAgICAgICAgICAgcWNvZWZmICs9IDY0OwotICAgICAgICB9Ci0gICAgfQotICAgIGVsc2UgIC8qIE9ubHkgREMgUHJlZGljdGlvbiAqLwotICAgIHsKLSAgICAgICAgQUNwcmVkX2ZsYWdbbWJudW1dID0gMDsKLSAgICB9Ci0KLSAgICAqaW50cmFEQ19kZWNpc2lvbiA9IEludHJhRENTd2l0Y2hfRGVjaXNpb24oTW9kZSwgdmlkZW8tPmN1cnJWb3AtPmludHJhRENWbGNUaHIsIGludHJhRENWbGNRUCk7Ci0gICAgaWYgKCppbnRyYURDX2RlY2lzaW9uKSAvKiBjb2RlIERDIHdpd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0gMyA7Ci0gICAgICAgICAgICB5aW4zID0geSAtIDE7Ci0gICAgICAgICAgICB4aW4zID0geCArIDE7Ci0gICAgICAgICAgICBicmVhazsKLQotICAgICAgICBjYXNlIDE6Ci0gICAgICAgICAgICB2ZWMxID0gMiA7Ci0gICAgICAgICAgICB5aW4xID0geSAgOwotICAgICAgICAgICAgeGluMSA9IHggLSAxOwotICAgICAgICAgICAgdmVjMiA9IDMgOwotICAgICAgICAgICAgeWluMiA9IHkgLSAxOwotICAgICAgICAgICAgeGluMiA9IHg7Ci0gICAgICAgICAgICB2ZWMzID0gMyA7Ci0gICAgICAgICAgICB5aW4zID0geSAtIDE7Ci0gICAgICAgICAgICB4aW4zID0geCArIDE7Ci0gICAgICAgICAgICBicmVhazsKLQotICAgICAgICBjYXNlIDI6Ci0gICAgICAgICAgICB2ZWMxID0gMSA7Ci0gICAgICAgICAgICB5aW4xID0geSAgOwotICAgICAgICAgICAgeGluMSA9IHg7Ci0gICAgICAgICAgICB2ZWMyID0gNCA7Ci0gICAgICAgICAgICB5aW4yID0geSAtIDE7Ci0gICAgICAgICAgICB4aW4yID0geDsKLSAgICAgICAgICAgIHZlYzMgPSAzIDsKLSAgICAgICAgICAgIHlpbjMgPSB5IC0gMTsKLSAgICAgICAgICAgIHhpbjMgPSB4ICsgMTsKLSAgICAgICAgICAgIGJyZWFrOwotCi0gICAgICAgIGNhc2UgMzoKLSAgICAgICAgICAgIHZlYzEgPSA0IDsKLSAgICAgICAgICAgIHlpbjEgPSB5ICA7Ci0gICAgICAgICAgICB4aW4xID0geCAtIDE7Ci0gICAgICAgICAgICB2ZWMyID0gMSA7Ci0gICAgICAgICAgICB5aW4yID0geSAgOwotICAgICAgICAgICAgeGluMiA9IHg7Ci0gICAgICAgICAgICB2ZWMzID0gMiA7Ci0gICAgICAgICAgICB5aW4zID0geSAgOwotICAgICAgICAgICAgeGluMyA9IHg7Ci0gICAgICAgICAgICBicmVhazsKLQotICAgICAgICBkZWZhdWx0OiAvKiBjYXNlIDQgKi8KLSAgICAgICAgICAgIHZlYzEgPSAzIDsKLSAgICAgICAgICAgIHlpbjEgPSB5ICA7Ci0gICAgICAgICAgICB4aW4xID0geDsKLSAgICAgICAgICAgIHZlYzIgPSAxIDsKLSAgICAgICAgICAgIHlpbjIgPSB5ICA7Ci0gICAgICAgICAgICB4aW4yID0geDsKLSAgICAgICAgICAgIHZlYzMgPSAyIDsKLSAgICAgICAgICAgIHlpbjMgPSB5ICA7Ci0gICAgICAgICAgICB4aW4zID0geDsKLSAgICAgICAgICAgIGJyZWFrOwotICAgIH0KLQotICAgIGlmIChibG9jayA9PSAwKQotICAgIHsKLSAgICAgICAgLyogYWNjb3JkaW5nIHRvIHRoZSBtb3Rpb24gZW5jb2RpbmcsIHdlIG11c3QgY2hvb3NlIGEgZmlyc3Qgbm9uLXRyYW5zcGFyZW50Ci0gICAgICAgIGJsb2NrIGluIHRoZSBzdXJyb3VuZGluZyBNQnMgKDE2LW1vZGUpCi0gICAgICAgICAgICAqLwotCi0gICAgICAgIGlmICh4ID4gMCAmJiBzbGljZV9uYlttYm51bV0gPT0gc2xpY2VfbmJbbWJudW0tMV0pCi0gICAgICAgICAgICBydWxlMSA9IDA7Ci0gICAgICAgIGVsc2UKLSAgICAgICAgICAgIHJ1bGUxID0gMTsKLQotICAgICAgICBpZiAoeSA+IDAgJiYgc2xpY2VfbmJbbWJudW1dID09IHNsaWNlX25iW21ibnVtLW5NQlBlclJvd10pCi0gICAgICAgICAgICBydWxlMiA9IDA7Ci0gICAgICAgIGVsc2UKLSAgICAgICAgICAgIHJ1bGUyID0gMTsKLQotICAgICAgICBpZiAoKHggIT0gbk1CUGVyUm93IC0gMSkgJiYgKHkgPiAwKSAmJiBzbGljZV9uYlttYm51bV0gPT0gc2xpY2VfbmJbbWJudW0rMS1uTUJQZXJSb3ddKQotICAgICAgICAgICAgcnVsZTMgPSAwOwotICAgICAgICBlbHNlCi0gICAgICAgICAgICBydWxlMyA9IDE7Ci0gICAgfQotICAgIGVsc2UKLSAgICB7Ci0gICAgICAgIC8qIGNoZWNrIGJvcmRlcnMgZm9yIHNpbmdsZSBibG9ja3MgKGFkdmFuY2VkIG1vZGUpICovCi0gICAgICAgIC8qIHJ1bGUgMSAqLwotICAgICAgICBpZiAoKChibG9jayA9PSAxIHx8IGJsb2NrID09IDMpICYmCi0gICAgICAgICAgICAgICAgKHggPT0gMCB8fCBzbGljZV9uYlttYm51bV0gIT0gc2xpY2VfbmJbbWJudW0tMV0pKSkKLSAgICAgICAgICAgIHJ1bGUxID0gMTsKLSAgICAgICAgZWxzZQotICAgICAgICAgICAgcnVsZTEgPSAwOwotCi0gICAgICAgIC8qIHJ1bGUgMiAqLwotICAgICAgICBpZiAoKChibG9jayA9PSAxIHx8IGJsb2NrID09IDIpICYmCi0gICAgICAgICAgICAgICAgKHkgPT0gMCB8fCBzbGljZV9uYlttYm51bV0gIT0gc2xpY2VfbmJbbWJudW0tbk1CUGVyUm93XSkpKQotICAgICAgICAgICAgcnVsZTIgPSAxOwotICAgICAgICBlbHNlCi0gICAgICAgICAgICBydWxlMiA9IDA7Ci0KLSAgICAgICAgLyogcnVsZSAzICovCi0gICAgICAgIGlmICgoKGJsb2NrID09IDEgfHwgYmxvY2sgPT0gMikgJiYKLSAgICAgICAgICAgICAgICAoeCA9PSBuTUJQZXJSb3cgLSAxIHx8IHkgPT0gMCB8fCBzbGljZV9uYlttYm51bV0gIT0gc2xpY2VfbmJbbWJudW0rMS1uTUJQZXJSb3ddKSkpCi0gICAgICAgICAgICBydWxlMyA9IDE7Ci0gICAgICAgIGVsc2UKLSAgICAgICAgICAgIHJ1bGUzID0gMDsKLSAgICB9Ci0KLSAgICBpZiAocnVsZTEpCi0gICAgewotICAgICAgICBwMXggPSBwMXkgPSAwOwotICAgIH0KLSAgICBlbHNlCi0gICAgewotCi0gICAgICAgIHAxeCA9IG1vdGRhdGFbeWluMSpuTUJQZXJSb3creGluMV1bdmVjMV0ueDsKLSAgICAgICAgcDF5ID0gb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BQdXRNVihlbnRyeSwgYnMpOwotCi0gICAgaWYgKChmX2NvZGUgIT0gMSkgJiYgKHZsY19jb2RlX21hZyAhPSAwKSkKLSAgICB7Ci0gICAgICAgIEJpdHN0cmVhbVB1dEJpdHMoYnMsIGZfY29kZSAtIDEsIHJlc2lkdWFsKTsKLSAgICAgICAgYml0cyArPSBmX2NvZGUgLSAxOwotICAgIH0KLSAgICByZXR1cm47Ci19Ci0KLQotVm9pZAotU2NhbGVNVkQoCi0gICAgSW50ICBmX2NvZGUsICAgICAgIC8qIDwtLSBNViByYW5nZSBpbiAxLzIgdW5pdHM6IDE9MzIsMj02NCwuLi4sNz0yMDQ4ICAgICAqLwotICAgIEludCAgZGlmZl92ZWN0b3IsICAvKiA8LS0gTVYgRGlmZmVyZW5jZSBjb21tcG9uZW50IGluIDEvMiB1bml0cyAgICAgICAgICAgKi8KLSAgICBJbnQgICpyZXNpZHVhbCwgICAgLyogLS0+IHZhbHVlIHRvIGJlIEZMQyBjb2RlZCAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0gICAgSW50ICAqdmxjX2NvZGVfbWFnIC8qIC0tPiB2YWx1ZSB0byBiZSBWTEMgY29kZWQgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotKQotewotICAgIEludCAgIHJhbmdlOwotICAgIEludCAgIHNjYWxlX2ZhY3RvcjsKLSAgICBJbnQgICByX3NpemU7Ci0gICAgSW50ICAgbG93OwotICAgIEludCAgIGhpZ2g7Ci0gICAgSW50ICAgYXV4OwotCi0gICAgcl9zaXplID0gZl9jb2RlIC0gMTsKLSAgICBzY2FsZV9mYWN0b3IgPSAxIDw8IHJfc2l6ZTsKLSAgICByYW5nZSA9IDMyICogc2NhbGVfZmFjdG9yOwotICAgIGxvdyAgID0gLXJhbmdlOwotICAgIGhpZ2ggID0gIHJhbmdlIC0gMTsKLQotICAgIGlmIChkaWZmX3ZlY3RvciA8IGxvdykKLSAgICAgICAgZGlmZl92ZWN0b3IgKz0gMiAqIHJhb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7Ci0gICAgICAgICAgICAgICAgUkxCLT5zW2lkeF0gPSAxOwotICAgICAgICAgICAgICAgIFJMQi0+cnVuW2lkeF0gPSBydW47Ci0gICAgICAgICAgICAgICAgcnVuID0gMDsKLSAgICAgICAgICAgICAgICBpZHgrKzsKLSAgICAgICAgICAgIH0KLSAgICAgICAgICAgIGVsc2UKLSAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICBSTEItPmxldmVsW2lkeF0gPSBsZXZlbDsKLSAgICAgICAgICAgICAgICBSTEItPnNbaWR4XSA9IDA7Ci0gICAgICAgICAgICAgICAgUkxCLT5ydW5baWR4XSA9IHJ1bjsKLSAgICAgICAgICAgICAgICBydW4gPSAwOwotICAgICAgICAgICAgICAgIGlkeCsrOwotICAgICAgICAgICAgfQotICAgICAgICB9Ci0gICAgfQotICAgIG5jIC09IDMyOwotICAgIGlmIChuYyA+IDApCi0gICAgewotICAgICAgICBtYXRjaCA9IDEgPDwgMzE7Ci0gICAgICAgIGVuZCA9IDEgPDwgKDMyIC0gbmMpOwotICAgICAgICB3aGlsZSAobWF0Y2ggPj0gZW5kKQotICAgICAgICB7Ci0gICAgICAgICAgICBpZiAoKG1hdGNoJmJpdG1hcHp6WzFdKSA9PSAwKQotICAgICAgICAgICAgewotICAgICAgICAgICAgICAgIHJ1bisrOwotICAgICAgICAgICAgICAgIGorKzsKLSAgICAgICAgICAgICAgICBtYXRjaCA+Pj0gMTsKLSAgICAgICAgICAgIH0KLSAgICAgICAgICAgIGVsc2UKLSAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICBtYXRjaCA+Pj0gMTsKLSAgICAgICAgICAgICAgICBsZXZlbCA9IGRhdGFCbG9ja1tqXTsKLSAgICAgICAgICAgICAgICBkYXRhQmxvY2tbal0gPSAwOyAvKiByZXNldCBvdXRwdXQgKi8KLSAgICAgICAgICAgICAgICBqKys7Ci0gICAgICAgICAgICAgICAgaWYgKGxldmVsIDwgMCkKLSAgICAgICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgICAgIFJMQi0+bGV2ZWxbaWR4XSA9IC1sZXZlbDsKLSAgICAgICAgICAgICAgICAgICAgUkxCLT5zW2lkeF0gPSAxOwotICAgICAgICAgICAgICAgICAgICBSTEItPnJ1bltpZHhdID0gcnVuOwotICAgICAgICAgICAgICAgICAgICBydW4gPSAwOwotICAgICAgICAgICAgICAgICAgICBpZHgrKzsKLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgZWxzZQotICAgICAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAgICAgUkxCLT5sZXZlbFtpZHhdID0gbGV2ZWw7Ci0gICAgICAgICAgICAgICAgICAgIFJMQi0+c1tpZHhdID0gMDsKLSAgICAgICAgICAgICAgICAgICAgUkxCLT5ydW5baWR4XSA9IHJ1bjsKLSAgICAgICAgICAgICAgICAgICAgcnVuID0gMDsKLSAgICAgICAgICAgICAgICAgICAgaWR4Kys7Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgfQotICAgICAgICB9Ci0gICAgfQotCi0gICAgcmV0dXJuIGlkeDsKLX0KLQotI2VsaWYgZGVmaW5lZChfX0NDX0FSTSkgIC8qIG9ubHkgd29yayB3aXRoIGFybSB2NSAqLwotCi1fX2lubGluZSAgSW50IHplcm9fcnVuX3NlYXJjaChVSW50ICpiaXRtYXB6eiwgU2hvcnQgKmRhdGFCbG9jaywgUnVuTGV2ZWxCbG9jayAqUkxCLCBJbnQgbmMpCi17Ci0gICAgT1NDTF9VTlVTRURfQVJHKG5jKTsKLSAgICBJbnQgaWR4LCBydW4sIGxldmVsLCBqOwotICAgIFVJbnQgZW5kLCBtYXRjaDsKLSAgICBJbnQgIHp6b3JkZXI7Ci0KLSAgICBpZHggPSAwOwotICAgIHJ1biA9IDA7Ci0gICAgaiAgID0gLTE7Ci0gICAgX19hc20KLSAgICB7Ci0gICAgICAgIGxkciBtYXRjaCwgW2JpdG1hcHp6XQotICAgICAgICBjbHogcnVuLCBtYXRjaAotICAgIH0KLQotICAgIHp6b3JkZXIgPSAwOwotCi0gICAgd2hpbGUgKHJ1biA8IDMyKQotICAgIHsKLSAgICAgICAgX19hc20KLSAgICAgICAgewotICAgICAgICAgICAgbW92IGVuZCwgIzB4ODAwMDAwMDAKLSAgICAgICAgICAgIG1vdiBlbmQsIGVuZCwgbHNyIHJ1biAgIC8qIG1hc2sqLwotICAgICAgICAgICAgYmljIG1hdGNoLCBtYXRjaCwgZW5kICAgICAgIC8qIHJlbW92ZSBpdCBmcm9tIGJpdG1hcCAqLwotICAgICAgICAgICAgbW92IHJ1biwgcnVuLCBsc2wgIzEgIC8qIDA1LzA5LzAyICovCi0gICAgICAgICAgICBsZHJzaCBsZXZlbCwgW2RhdGFCbG9jaywgcnVuXSAvKiAgbG9hZCBkYXRhICovCi0gICAgICAgICAgICBzdHJoIHp6b3JkZXIsIFtkYXRhQmxvY2ssIHJ1bl0gLyogcmVzZXQgb3V0cHV0ICovCi0gICAgICAgICAgICBhZGQgaiwgaiwgIzEKLSAgICAgICAgICAgIHJzYiBydW4sIGosIHJ1biwgbHNyICMxIC8qIGRlbHRhIHJ1biAqLwotICAgICAgICAgICAgYWRkIGosIGosIHJ1biAgICAgICAgICAgLyogY3VycmVudCBwb3NpdGlvbiAqLwotICAgICAgICB9Ci0gICAgICAgIGlmIChsZXZlbCA8IDApCi0gICAgICAgIHsKLSAgICAgICAgICAgIFJMQi0+bGV2ZWxbaWR4XSA9IC1sZXZlbDsKLSAgICAgICAgICAgIFJMQi0+c1tpZHhdID0gMTsKLSAgICAgICAgICAgIFJMQi0+cnVuW2lkeF0gPSBydW47Ci0gICAgICAgICAgICBydW4gPSAwOwotICAgICAgICAgICAgaWR4Kys7Ci0gICAgICAgIH0KLSAgICAgICAgZWxzZQotICAgICAgICB7Ci0gICAgICAgICAgICBSTEItPmxldmVsW2lkeF0gPSBsZXZlbDsKLSAgICAgICAgICAgIFJMQi0+c1tpZHhdID0gMDsKLSAgICAgICAgICAgIFJMQi0+cnVuW2lkeF0gPSBydW47Ci0gICAgICAgICAgICBydW4gPSAwOwotICAgICAgICAgICAgaWR4Kys7Ci0gICAgICAgIH0KLSAgICAgICAgX19hc20KLSAgICAgICAgewotICAgICAgICAgICAgY2x6IHJ1biwgbWF0Y2gKLSAgICAgICAgfQotICAgIH0KLSAgICBfX2FzbQotICAgIHsKLSAgICAgICAgbGRyIG1hdGNoLCBbYml0bWFwenosICM0XQotICAgICAgICBjbHogcnVuLCBtYXRjaAotICAgIH0KLQotICAgIHdoaWxlIChydW4gPCAzMikKLSAgICB7Ci0gICAgICAgIF9fYXNtCi0gICAgICAgIHsKLSAgICAgICAgICAgIG1vdiBlbmQsICMweDgwMDAwMDAwCi0gICAgICAgICAgICBtb3YgZW5kLCBlbmQsIGxzciBydW4gICAvKiBtYXNrKi8KLSAgICAgICAgICAgIGJpYyBtYXRjaCwgbWF0Y2gsIGVuZCAgICAgICAvKiByZW1vdmUgaXQgZnJvbSBiaXRtYXAgKi8KLSAgICAgICAgICAgIGFkZCBydW4sIHJ1biwgIzMyICAgICAgIC8qIGN1cnJlbnQgcG9zaXRpb24gKi8KLSAgICAgICAgICAgIG1vdiBydW4sIHJ1biwgbHNsICMxICAgIC8qIDA5LzAyLzA1ICovCi0gICAgICAgICAgICBsZHJzaCBsZXZlbCwgW2RhdGFCbG9jaywgcnVuXSAvKiAgbG9hZCBkYXRhICovCi0gICAgICAgICAgICBzdHJoICB6em9yZGVyLCBbZGF0YUJsb2NrLCBydW5dIC8qIHJlc2V0IG91dHB1dCAqLwotICAgICAgICAgICAgYWRkIGosIGosICMxCi0gICAgICAgICAgICByc2IgcnVuLCBqLCBydW4sIGxzciAjMSAgICAgLyogZGVsdGEgcnVuICovCi0gICAgICAgICAgICBhZGQgaiwgaiwgcnVuICAgICAgICAgICAvKiBjdXJyZW50IHBvc2l0aW9uICovCi0gICAgICAgIH0KLSAgICAgICAgaWYgKGxldmVsIDwgMCkKLSAgICAgICAgewotICAgICAgICAgICAgUkxCLT5sZXZlbFtpZHhdID0gLWxldmVsOwotICAgICAgICAgICAgUkxCLT5zW2lkeF0gPSAxOwotICAgICAgICAgICAgUkxCLT5ydW5baWR4XSA9IHJ1bjsKLSAgICAgICAgICAgIHJ1biA9IDA7Ci0gICAgICAgICAgICBpZHgrKzsKLSAgICAgICAgfQotICAgICAgICBlbHNlCi0gICAgICAgIHsKLSAgICAgICAgICAgIFJMQi0+bGV2ZWxbaWR4XSA9IGxldmVsOwotICAgICAgICAgICAgUkxCLT5zW2lkeF0gPSAwOwotICAgICAgICAgICAgUkxCLT5ydW5baWR4XSA9IHJ1bjsKLSAgICAgICAgICAgIHJ1biA9IDA7Ci0gICAgICAgICAgICBpZHgrKzsKLSAgICAgICAgfQotICAgICAgICBfX2FzbQotICAgICAgICB7Ci0gICAgICAgICAgICBjbHogcnVuLCBtYXRjaAotICAgICAgICB9Ci0gICAgfQotCi0gICAgcmV0dXJuIGlkeDsKLX0KLQotI2VsaWYgKCBkZWZpbmVkKFBWX0FSTV9HQ0NfVjQpIHx8IGRlZmluZWQoUFZfQVJNX0dDQ19WNSkgKSAvKiBBUk0gR05VIENPTVBJTEVSICAqLwotCi1fX2lubGluZSBJbnQgbTR2X2VuY19jbHooVUludCB0ZW1wKQotewotICAgIHJlZ2lzdGVyIEludCByYjsKLSAgICByZWdpc3RlciBVSW50IHJhID0gKFVJbnQpdGVtcDsKLQotICAgIGFzbSB2b2xhdGlsZSgiY2x6ICAgJTAsICUxIgotICAgICAgICAgICAgIDogIj0mciIocmIpCi0gICAgICAgICAgICAgICAgICAgICAgICAgOiAiciIocmEpCi0gICAgICAgICAgICAgICAgICAgICAgICApOwotCi0gICAgcmV0dXJuIChyYik7Ci19Ci0KLV9faW5saW5lICBJbnQgemVyb19ydW5fc2VhcmNoKFVJbnQgKmJpdG1hcHp6LCBTaG9ydCAqZGF0YUJsb2NrLCBSdW5MZXZlbEJsb2NrICpSTEIsIEludCBuYykKLXsKLSAgICBPU0NMX1VOVVNFRF9BUkcobmMpOwotICAgIEludCBpZHgsIHJ1biwgbGV2ZWwgPSAwLCBqOwotICAgIFVJbnQgZW5kID0gMCwgbWF0Y2g7Ci0gICAgSW50ICB6em9yZGVyOwotCi0gICAgaWR4ID0gMDsKLSAgICBydW4gPSAwOwotICAgIGogICA9IC0xOwotICAgIG1hdGNoID0gKmJpdG1hcHp6OwotICAgIHJ1biA9IG00dl9lbmNfY2x6KG1hdGNoKTsKLQotICAgIHp6b3JkZXIgPSAwOwotCi0gICAgd2hpbGUgKHJ1biA8IDMyKQotICAgIHsKLSAgICAgICAgYXNtIHZvbGF0aWxlKCJtb3YgICAlMCwgIzB4ODAwMDAwMDBcblx0IgotICAgICAgICAgICAgICAgICAgICAgIm1vdiAgICUwLCAlMCwgbHNyICUxXG5cdCIKLSAgICAgICAgICAgICAgICAgICAgICJiaWMgICAlMiwgJTIsICUwXG5cdCIKLSAgICAgICAgICAgICAgICAgICAgICJtb3YgICAlMSwgJTEsIGxzbCAjMVxuXHQiCi0gICAgICAgICAgICAgICAgICAgICAibGRyc2ggJTMsIFslNiwgJTFdXG5cdCIKLSAgICAgICAgICAgICAgICAgICAgICJzdHJoICAlNSwgWyU2LCAlMV1cblx0IgotICAgICAgICAgICAgICAgICAgICAgImFkZCAgICU0LCAlNCwgIzFcblx0IgotICAgICAgICAgICAgICAgICAgICAgInJzYiAgICUxLCAlNCwgJTEsIGxzciAjMVxuXHQiCi0gICAgICAgICAgICAgICAgICAgICAiYWRkICAgJTQsICU0LCAlMSIKLSAgICAgICAgICAgICA6ICIrciIoZW5kKSwgIityIihydW4pLCAiK3IiKG1hdGNoKSwgIj1yIihsZXZlbCksICIrciIoaikKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOiAiciIoenpvcmRlciksICJyIihkYXRhQmxvY2spKTsKLSAgICAgICAgaWYgKGxldmVsIDwgMCkKLSAgICAgICAgewotICAgICAgICAgICAgUkxCLT5sZXZlbFtpZHhdID0gLWxldmVsOwotICAgICAgICAgICAgUkxCLT5zW2lkeF0gPSAxOwotICAgICAgICAgICAgUkxCLT5ydW5baWR4XSA9IHJ1bjsKLSAgICAgICAgICAgIHJ1biA9IDA7Ci0gICAgICAgICAgICBpZHgrKzsKLSAgICAgICAgfQotICAgICAgICBlbHNlCi0gICAgICAgIHsKLSAgICAgICAgICAgIFJMQi0+bGV2ZWxbaWR4XSA9IGxldmVsOwotICAgICAgICAgICAgUkxCLT5zW2lkeF0gPSAwOwotICAgICAgICAgICAgUkxCLT5ydW5baWR4XSA9IHJ1bjsKLSAgICAgICAgICAgIHJ1biA9IDA7Ci0gICAgICAgICAgICBpZHgrKzsKLSAgICAgICAgfQotICAgICAgICBydW4gPSBtNHZfZW5jX2NseihtYXRjaCk7Ci0gICAgfQotICAgIG1hdGNoID0gYml0bWFwenpbMV07Ci0gICAgcnVuID0gbTR2X2VuY19jbHoobWF0Y2gpOwotCi0gICAgd2hpbGUgKHJ1biA8IDMyKQotICAgIHsKLSAgICAgICAgYXNtIHZvbGF0aWxlKCJtb3YgICAlMCwgIzB4ODAwMDAwMDBcblx0IgotICAgICAgICAgICAgICAgICAgICAgIm1vdiAgICUwLCAlMCwgbHNyICUxXG5cdCIKLSAgICAgICAgICAgICAgICAgICAgICJiaWMgICAlMiwgJTIsICUwXG5cdCIKLSAgICAgICAgICAgICAgICAgICAgICJhZGQgICAlMSwgJTEsICMzMlxuXHQiCi0gICAgICAgICAgICAgICAgICAgICAibW92ICAgJTEsICUxLCBsc2wgIzFcblx0IgotICAgICAgICAgICAgICAgICAgICAgImxkcnNoICUzLCBbJTYsICUxXVxuXHQiCi0gICAgICAgICAgICAgICAgICAgICAic3RyaCAgJTUsIFslNiwgJTFdXG5cdCIKLSAgICAgICAgICAgICAgICAgICAgICJhZGQgICAlNCwgJTQsICMxXG5cdCIKLSAgICAgICAgICAgICAgICAgICAgICJyc2IgICAlMSwgJTQsICUxLCBsc3IgIzFcblx0IgotICAgICAgICAgICAgICAgICAgICAgImFkZCAgICU0LCAlNCwgJTE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S0tLS0KLSAqLwotI2luY2x1ZGUgIm1wNGRlZi5oIgotI2luY2x1ZGUgIm1wNGxpYl9pbnQuaCIKLSNpbmNsdWRlICJtcDRlbmNfbGliLmgiCi0jaW5jbHVkZSAiYml0c3RyZWFtX2lvLmgiCi0jaW5jbHVkZSAibTR2ZW5jX29zY2wuaCIKLQotUFZfU1RBVFVTIEVuY29kZVNob3J0SGVhZGVyKEJpdHN0cmVhbUVuY1ZpZGVvICpzdHJlYW0sIFZvcCAqY3VyclZvcCk7Ci1QVl9TVEFUVVMgRW5jb2RlVk9QSGVhZGVyKEJpdHN0cmVhbUVuY1ZpZGVvICpzdHJlYW0sIFZvbCAqY3VyclZvbCwgVm9wICpjdXJyVm9wKTsKLVBWX1NUQVRVUyBFbmNvZGVHT1ZIZWFkZXIoQml0c3RyZWFtRW5jVmlkZW8gKnN0cmVhbSwgVUludCBzZWNvbmRzKTsKLQotUFZfU1RBVFVTIEVuY29kZVZvcF9CWFJDKFZpZGVvRW5jRGF0YSAqdmlkZW8pOwotUFZfU1RBVFVTIEVuY29kZVZvcF9Ob01FKFZpZGVvRW5jRGF0YSAqdmlkZW8pOwotCi0vKiA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0gKi8KLS8qICBGdW5jdGlvbiA6IERlY29kZVZvcCgpICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogIERhdGUgICAgIDogMDgvMjMvMjAwMCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgUHVycG9zZSAgOiBFbmNvZGUgVk9QIEhlYWRlciAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICBJbi9vdXQgICA6ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogIFJldHVybiAgIDogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgTW9kaWZpZWQgOiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PSAqLwotUFZfU1RBVFVTIEVuY29kZVZvcChWaWRlb0VuY0RhdGEgKnZpZGVvKQotewotCi0gICAgUFZfU1RBVFVTIHN0YXR1czsKLSAgICBJbnQgY3VyckxheWVyID0gdmlkZW8tPmN1cnJMYXllcjsKLSAgICBWb2wgKmN1cnJWb2wgPSB2aWRlby0+dm9sW2N1cnJMYXllcl07Ci0gICAgVm9wICpjdXJyVm9wID0gdmlkZW8tPmN1cnJWb3A7Ci0vLyAgQml0c3RyZWFtRW5jVmlkZW8gKnN0cmVhbT12aWRlby0+Yml0c3RyZWFtMTsKLSAgICBVQ2hhciAqTW9kZSA9IHZpZGVvLT5oZWFkZXJJbmZvLk1vZGU7Ci0gICAgcmF0ZUNvbnRyb2wgKipyYyA9IHZpZGVvLT5yYzsKLS8vICBVSW50IHRpbWU9MDsKLQotICAgIC8qKioqKioqKioqKioqKioqKioqLwotICAgIC8qIEluaXRpYWxpemUgbW9kZSAqLwotICAgIC8qKioqKioqKioqKioqKioqKioqLwotCi0gICAgc3dpdGNoIChjdXJyVm9wLT5wcmVkaWN0aW9uVHlwZSkKLSAgICB7Ci0gICAgICAgIGNhc2UgSV9WT1A6Ci0gICAgICAgICAgICBNNFZFTkNfTUVNU0VUKE1vZGUsIE1PREVfSU5UUkEsIHNpemVvZihVQ2hhcikqY3VyclZvbC0+blRvdGFsTUIpOwotICAgICAgICAgICAgYnJlYWs7Ci0gICAgICAgIGNhc2UgUF9WT1A6Ci0gICAgICAgICAgICBNNFZFTkNfTUVNU0VUKE1vZGUsIE1PREVfSU5URVIsIHNpemVvZihVQ2hhcikqY3VyclZvbC0+blRvdGFsTUIpOwotICAgICAgICAgICAgYnJlYWs7Ci0gICAgICAgIGNhc2UgQl9WT1A6Ci0gICAgICAgICAgICAvKk00VkVOQ19NRU1TRVQoTW9kZSwgTU9ERV9JTlRFUl9CLHNpemVvZihVQ2hhcikqblRvdGFsTUIpOyovCi0gICAgICAgICAgICByZXR1cm4gUFZfRkFJTDsKLSAgICAgICAgZGVmYXVsdDoKLSAgICAgICAgICAgIHJldHVybiBQVl9GQUlMOwotICAgIH0KLQotICAgIC8qKioqKioqKioqKioqKioqKioqKiovCi0gICAgLyogTW90aW9uIEVzdGltYXRpb24gKi8KLSAgICAvKiBjb21wdXRlIE1Wcywgc2NlbmUgY2hhbmdlIGRldGVjdGlvbiwgZWRnZSBwYWRkaW5nLCAqLwotICAgIC8qIGludHJhIHJlZnJlc2gsIGNvbXB1dGUgYmxvY2sgYWN0aXZpdHkgKi8KLSAgICAvKioqKioqKioqKioqKioqKioqKioqLwotICAgIE1vdGlvbkVzdGltYXRpb24odmlkZW8pOyAgICAvKiBkbyBNRSBmb3IgdGhlIHdob2xlIGZyYW1lICovCi0KLSAgICAvKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotICAgIC8qIHJhdGUgQ29udHJvbCAoYXNzaWduIFFQKSAqLwotICAgIC8qIDQvMTEvMDEsIGNsZWFuLXVwLCBhbmQgcHV0IGludG8gYSBzZXBhcmF0ZSBmdW5jdGlvbiAqLwotICAgIC8qKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0gICAgc3RhdHVzID0gUkNfVm9wUVBTZXR0aW5nKHZpZGVvLCByYyk7Ci0gICAgaWYgKHN0YXR1cyA9PSBQVl9GQUlMKQotICAgICAgICByZXR1cm4gUFZfRkFJTDsKLQotICAgIC8qKioqKioqKioqKioqKioqKioqKioqLwotICAgIC8qICAgICBFbmNvZGUgVk9QICAgICAqLwotICAgIC8qKioqKioqKioqKioqKioqKioqKioqLwotICAgIGlmICh2aWRlby0+c2xpY2VfY29kaW5nKSAvKiBlbmQgaGVyZSAqLwotICAgIHsKLSAgICAgICAgLyogaW5pdGlhbGl6ZSBzdGF0ZSB2YXJpYWJsZSBmb3Igc2xpY2UtYmFzZWQgQVBJcyAqLwotICAgICAgICB2aWRlby0+dG90YWxTQUQgPSAwOwotICAgICAgICB2aWRlby0+bWJudW0gPSAwOwotICAgICAgICB2aWRlby0+c2xpY2VOb1swXSA9IDA7Ci0gICAgICAgIHZpZGVvLT5udW1JbnRyYSA9IDA7Ci0gICAgICAgIHZpZGVvLT5vZmZzZXQgPSAwOwotICAgICAgICB2aWRlby0+ZW5kX29mX2J1ZiA9IDA7Ci0gICAgICAgIHZpZGVvLT5ocF9ndWVzcyA9IC0xOwotICAgICAgICByZXR1cm4gc3RhdHVzOwotICAgIH0KLQotICAgIHN0YXR1cyA9IEVuY29kZVZvcF9Ob01FKHZpZGVvKTsKLQotICAgIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0gICAgLyogcmF0ZSBjb250cm9sICh1cGRhdGUgc3RhdCkgKi8KLSAgICAvKiA2LzIvMDEgc2VwYXJhdGUgZnVuY3Rpb24gKi8KLSAgICAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotCi0gICAgUkNfVm9wVXBkYXRlU3RhdCh2aWRlbywgcmNbY3VyckxheWVyXSk7Ci0KLSAgICByZXR1cm4gc3RhdHVzOwotfQotCi0vKiA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0gKi8KLS8qICBGdW5jdGlvbiA6IEVuY29kZVZvcF9Ob01FKCkgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogIERhdGUgICAgIDogMDgvMjgvMjAwMSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgSGlzdG9yeSAgOiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICBQdXJwb3NlICA6IEVuY29kZVZvcCB3aXRob3V0IG1vdGlvbiBlc3QuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogIEluL291dCAgIDogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgUmV0dXJuICAgOiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICBNb2RpZmllZCA6ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0gKi8KLQotUFZfU1RBVFVTIEVuY29kZVZvcF9Ob01FKFZpZGVvRW5jRGF0YSAqdmlkZW8pCi17Ci0gICAgVm9wICpjdXJyVm9wID0gdmlkZW8tPmN1cnJWb3A7Ci0gICAgVm9sICpjdXJyVm9sID0gdmlkZW8tPnZvbFt2aWRlby0+Y3VyckxheWVyXTsKLSAgICBCaXRzdHJlYW1FbmNWaWRlbyAqc3RyZWFtID0gdmlkZW8tPmJpdHN0cmVhbTE7Ci0gICAgSW50IHRpbWUgPSAwOyAgIC8qIGZvbGxvd3MgRW5jb2RlVm9wIHZhbHVlICovCi0gICAgUFZfU1RBVFVTIHN0YXR1cyA9IFBWX1NVQ0NFU1M7Ci0KLSAgICBpZiAoY3VyclZvbC0+c2hvcnRWaWRlb0hlYWRlcikgLyogU2hvcnQgVmlkZW8gSGVhZGVyID0gMSAqLwotICAgI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lIERhdGEgUGFydGl0aW9uaW5nIE1vZGUgVk9QICovCi0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgIGVsc2UKLSAgICAgICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgICAgIHN0YXR1cyA9IEVuY29kZUZyYW1lQ29tYmluZWRNb2RlKHZpZGVvKTsgLyogRW5jb2RlIENvbWJpbmVkIE1vZGUgVk9QICovCi0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgfQotICAgICAgICAgICAgZWxzZQotICAgICAgICAgICAgICAgIHN0YXR1cyA9IEVuY29kZUZyYW1lQ29tYmluZWRNb2RlKHZpZGVvKTsgLyogRW5jb2RlIENvbWJpbmVkIE1vZGUgVk9QICovCi0gICAgICAgIH0KLSAgICAgICAgZWxzZSAgLyogVm9wIE5vdCBjb2RlZCAqLwotICAgICAgICB7Ci0KLSAgICAgICAgICAgIHJldHVybiBzdGF0dXM7Ci0gICAgICAgIH0KLSAgICB9Ci0jZW5kaWYgLyogSDI2M19PTkxZICovCi0gICAgcmV0dXJuIHN0YXR1czsKLQotfQotCi0jaWZuZGVmIE5PX1NMSUNFX0VOQ09ERQotLyogPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09ICovCi0vKiAgRnVuY3Rpb24gOiBFbmNvZGVTbGljZSgpICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICBEYXRlICAgICA6IDA0LzE5LzIwMDIgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogIEhpc3RvcnkgIDogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgUHVycG9zZSAgOiBFbmNvZGUgb25lIHNsaWNlLiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICBJbi9vdXQgICA6ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogIFJldHVybiAgIDogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgTW9kaWZpZWQgOiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09ICovCi0KLVBWX1NUQVRVUyBFbmNvZGVTbGljZShWaWRlb0VuY0RhdGEgKnZpZGVvKQotewotICAgIFZvcCAqY3VyclZvcCA9IHZpZGVvLT5jdXJyVm9wOwotICAgIEludCBjdXJyTGF5ZXIgPSB2aWRlby0+Y3VyckxheWVyOwotICAgIFZvbCAqY3VyclZvbCA9IHZpZGVvLT52b2xbY3VyckxheWVyXTsKLSAgICBCaXRzdHJlYW1FbmNWaWRlbyAqc3RyZWFtID0gdmlkZW8tPmJpdHN0cmVhbTE7IC8qIGRpZmZlcmVudCBmcm9tIGZyYW1lLWJhc2VkICovCi0gICAgSW50IHRpbWUgPSAwOyAgIC8qIGZvbGxvd3MgRW5jb2RlVm9wIHZhbHVlICovCi0gICAgUFZfU1RBVFVTIHN0YXR1cyA9IFBWX1NVQ0NFU1M7Ci0gICAgcmF0ZUNvbnRyb2wgKipyYyA9IHZpZGVvLT5yYzsKLQotICAgIGlmIChjdXJyVm9sLT5zaG9ydFZpZGVvSGVhZGVyKSAvKiBTaG9ydCBWaWRlbyBIZWFkZXIgPSAxICovCi0gICAgewotCi0gICAgICAgIGlmICh2aWRlby0+bWJudW0gPT0gMCkKLSAgICAgICAgewotICAgICAgICAgICAgc3RhdHVzID0gRW5jb2RlU2hvcnRIZWFkZXIoc3RyZWFtLCBjdXJyVm9wKTsgLyogRW5jb2RlIFNob3J0IEhlYWRlciAqLwotCi0gICAgICAgICAgICB2aWRlby0+aGVhZGVyX2JpdHMgPSBCaXRzdHJlYW1HZXRQb3Moc3RyZWFtKTsgLyogSGVhZGVyIEJpdHMgKi8KLSAgICAgICAgfQotCi0gICAgICAgIHN0YXR1cyA9IEVuY29kZVNsaWNlQ29tYmluZWRNb2RlKHZpZGVvKTsKLQotICAgIH0KLSNpZm5kZWYgSDI2M19PTkxZCi0gICAgZWxzZSAgICAvKiBTaG9ydCBWaWRlbyBIZWFkZXIgPSAwICovCi0gICAgewotCi0gICAgICAgIGlmICh2aWRlby0+bWJudW0gPT0gMCkKLSAgICAgICAgewotICAgICAgICAgICAgaWYgKGN1cnJWb2wtPkdPVlN0YXJ0KQotICAgICAgICAgICAgICAgIHN0YXR1cyA9IEVuY29kZUdPVkhlYWRlcihzdHJlYW0sIHRpbWUpOyAvKiBFbmNvZGUgR09WIEhlYWRlciAqLwotCi0gICAgICAgICAgICBzdGF0dXMgPSBFbmNvZGVWT1BIZWFkZXIoc3RyZWFtLCBjdXJyVm9sLCBjdXJyVm9wKTsgIC8qIEVuY29kZSBWT1AgSGVhZGVyICovCi0KLSAgICAgICAgICAgIHZpZGVvLT5oZWFkZXJfYml0cyA9IEJpdHN0cmVhbUdldFBvcyhzdHJlYW0pOyAvKiBIZWFkZXIgQml0cyAqLwotICAgICAgICB9Ci0KLSAgICAgICAgaWYgKGN1cnJWb3AtPnZvcENvZGVkKQotICAgICAgICB7Ci0gICAgICAgICAgICBpZiAoIWN1cnJWb2wtPnNjYWxhYmlsaXR5KQotICAgICAgICAgICAgewotICAgICAgICAgICAgICAgIGlmIChjdXJyVm9sLT5kYXRhUGFydGl0aW9uaW5nKQotICAgICAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAgICAgc3RhdHVzID0gRW5jb2RlU2xpY2VEYXRhUGFydE1vZGUodmlkZW8pOyAvKiBFbmNvZGUgRGF0YSBQYXJ0aXRpb25pbmcgTW9kZSBWT1AgKi8KLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgZWxzZQotICAgICAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAgICAgc3RhdHVzID0gRW5jb2RlU2xpY2VDb21iaW5lZE1vZGUodmlkZW8pOyAvKiBFbmNvZGUgQ29tYmluZWQgTW9kZSBWT1AgKi8KLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICB9Ci0gICAgICAgICAgICBlbHNlCi0gICAgICAgICAgICAgICAgc3RhdHVzID0gRW5jb2RlU2xpY2VDb21iaW5lZE1vZGUodmlkZW8pOyAvKiBFbmNvZGUgQ29tYmluZWQgTW9kZSBWT1AgKi8KLSAgICAgICAgfQotICAgICAgICBlbHNlICAvKiBWb3AgTm90IGNvZGVkICovCi0gICAgICAgIHsKLQotICAgICAgICAgICAgcmV0dXJuIHN0YXR1czsKLSAgICAgICAgfQotICAgIH0KLSNlbmRpZiAvKiBIMjYzX09OTFkgKi8KLSAgICBpZiAodmlkZW8tPm1ibnVtID49IGN1cnJWb2wtPm5Ub3RhbE1CICYmIHN0YXR1cyAhPSBQVl9FTkRfT0ZfQlVGKSAvKiBlbmQgb2YgVm9wICovCi0gICAgewotICAgICAgICAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotICAgICAgICAvKiByYXRlIGNvbnRyb2wgKHVwZGF0ZSBzdGF0KSAqLwotICAgICAgICAvKiA2LzIvMDEgc2VwYXJhdGUgZnVuY3Rpb24gKi8KLSAgICAgICAgLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLQotICAgICAgICBzdGF0dXMgPSBSQ19Wb3BVcGRhdGVTdGF0KHZpZGVvLCByY1tjdXJyTGF5ZXJdKTsKLSAgICB9Ci0KLSAgICByZXR1cm4gc3RhdHVzOwotCi19Ci0jZW5kaWYgLyogTk9fU0xJQ0VfRU5DT0RFICovCi0KLSNpZm5kZWYgSDI2M19PTkxZCi0vKiA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0gKi8KLS8qICBGdW5jdGlvbiA6IEVuY29kZUdPVkhlYWRlcigpICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogIERhdGUgICAgIDogMDgvMjMvMjAwMCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgUHVycG9zZSAgOiBFbmNvZGUgR09WIEhlYWRlciAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICBJbi9vdXQgICA6ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogIFJldHVybiAgIDogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgTW9kaWZpZWQgOiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PSAqLwotUFZfU1RBVFVTIEVuY29kZUdPVkhlYWRlcihCaXRzdHJlYW1FbmNWaWRlbyAqc3RyZWFtLCBVSW50IHNlY29uZHMpCi17Ci0gICAgUFZfU1RBVFVTIHN0YXR1czsKLS8vICBpbnQgdGVtcDsKLSAgICBVSW50IHRtcHZhcjsKLQotICAgIC8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLSAgICAvKiBHcm91cF9vZl9WaWRlb09iamVjdFBsYW5lKCkgICovCi0gICAgLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLw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Btb2RUaW1lUmVmIHlldCwgZG8gaXQgYWZ0ZXIgZW5jb2RpbmchISAqLwotICAgIH0KLSAgICBzdGF0dXMgPSBCaXRzdHJlYW1QdXQxQml0cyhzdHJlYW0sIDApOwotICAgIHN0YXR1cyA9IEJpdHN0cmVhbVB1dDFCaXRzKHN0cmVhbSwgMSk7IC8qIG1hcmtlciBiaXQgKi8KLSAgICBzdGF0dXMgPSBCaXRzdHJlYW1QdXRCaXRzKHN0cmVhbSwgY3VyclZvbC0+bmJpdHNUaW1lSW5jUmVzLCB0aW1lSW5jKTsgLyogdm9wX3RpbWVfaW5jcmVtZW50ICovCi0gICAgc3RhdHVzID0gQml0c3RyZWFtUHV0MUJpdHMoc3RyZWFtLCAxKTsgLyogbWFya2VyIGJpdCAqLwotICAgIHN0YXR1cyA9IEJpdHN0cmVhbVB1dDFCaXRzKHN0cmVhbSwgMCk7IC8qIHZvcF9jb2RlZCBiaXQgKi8KLSAgICBCaXRzdHJlYW1NcGVnNEJ5dGVBbGlnblN0dWZmaW5nKHN0cmVhbSk7Ci0KLSAgICByZXR1cm4gc3RhdHVzOwotfQotI2VuZGlmCi0KLS8qID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PSAqLwotLyogIEZ1bmN0aW9uIDogRW5jb2RlVk9QSGVhZGVyKCkgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgRGF0ZSAgICAgOiAwOC8yMy8yMDAwICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICBQdXJwb3NlICA6IEVuY29kZSBWT1AgSGVhZGVyICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogIEluL291dCAgIDogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgUmV0dXJuICAgOiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICBNb2RpZmllZCA6ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09ICovCi0KLVBWX1NUQVRVUyBFbmNvZGVWT1BIZWFkZXIoQml0c3RyZWFtRW5jVmlkZW8gKnN0cmVhbSwgVm9sICpjdXJyVm9sLCBWb3AgKmN1cnJWb3ApCi17Ci0gICAgUFZfU1RBVFVTIHN0YXR1czsKLSAgICAvL2ludCB0ZW1wOwotCi0gICAgaW50IE1UQiA9IGN1cnJWb2wtPm1vZHVsb1RpbWVCYXNlOwotICAgIC8qKioqKioqKioqKioqKioqKioqKioqKiovCi0gICAgLyogVmlkZW9PYmplY3RQbGFuZSgpICAgKi8KLSAgICAvKioqKioqKioqKioqKioqKioqKioqKioqLwotCi0gICAgc3RhdHVzID0gQml0c3RyZWFtUHV0R1QxNkJpdHMoc3RyZWFtLCAzMiwgVk9QX1NUQVJUX0NPREUpOyAvKlN0YXJ0IENvZGUgZm9yIFZPUCovCi0gICAgc3RhdHVzID0gQml0c3RyZWFtUHV0Qml0cyhzdHJlYW0sIDIsIGN1cnJWb3AtPnByZWRpY3Rpb25UeXBlKTsvKiBWT1AgQ29kaW5nIFR5cGUqLwotCi0gICAgY3VyclZvbC0+cHJldk1vZHVsb1RpbWVCYXNlID0gY3VyclZvbC0+bW9kdWxvVGltZUJhc2U7Ci0KLSAgICB3aGlsZSAoTVRCKQotICAgIHsKLSAgICAgICAgc3RhdHVzID0gQml0c3RyZWFtUHV0MUJpdHMoc3RyZWFtLCAxKTsKLSAgICAgICAgTVRCLS07Ci0gICAgfQotICAgIHN0YXR1cyA9IEJpdHN0cmVhbVB1dDFCaX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KGN1cnJWb3AtPnByZWRpY3Rpb25UeXBlICE9IElfVk9QKQotICAgICAgICBzdGF0dXMgPSBCaXRzdHJlYW1QdXRCaXRzKHN0cmVhbSwgMywgY3VyclZvcC0+ZmNvZGVGb3J3YXJkKTsgLyogdm9wX2Zjb2RlX2ZvcndhcmQgKi8KLSAgICBpZiAoY3VyclZvcC0+cHJlZGljdGlvblR5cGUgPT0gQl9WT1ApCi0gICAgICAgIHN0YXR1cyA9IEJpdHN0cmVhbVB1dEJpdHMoc3RyZWFtLCAzLCBjdXJyVm9wLT5mY29kZUJhY2t3YXJkKTsvKiB2b3BfZmNvZGVfYmFja3dhcmQgKi8KLQotICAgIGlmIChjdXJyVm9sLT5zY2FsYWJpbGl0eSkKLSAgICAgICAgLyogZW5oYW5jZW1lbnRfdHlwZSA9IDAgKi8KLSAgICAgICAgc3RhdHVzID0gQml0c3RyZWFtUHV0Qml0cyhzdHJlYW0sIDIsIGN1cnJWb3AtPnJlZlNlbGVjdENvZGUpOyAvKiByZWZfc2VsZWN0X2NvZGUgKi8KLQotICAgIHJldHVybiBzdGF0dXM7Ci19Ci0jZW5kaWYgLyogSDI2M19PTkxZICovCi0vKiA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0gKi8KLS8qICBGdW5jdGlvbiA6IEVuY29kZVNob3J0SGVhZGVyKCkgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogIERhdGUgICAgIDogMDgvMjMvMjAwMCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgUHVycG9zZSAgOiBFbmNvZGUgVk9QIEhlYWRlciAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICBJbi9vdXQgICA6ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogIFJldHVybiAgIDogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgTW9kaWZpZWQgOiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PSAqLwotCi1QVl9TVEFUVVMgRW5jb2RlU2hvcnRIZWFkZXIoQml0c3RyZWFtRW5jVmlkZW8gKnN0cmVhbSwgVm9wICpjdXJyVm9wKQotewotCi0gICAgUFZfU1RBVFVTIHN0YXR1czsKLQotICAgIHN0YXR1cyA9IEJpdHN0cmVhbVB1dEdUMTZCaXRzKHN0cmVhbSwgMjIsIFNIT1JUX1ZJREVPX1NUQVJUX01BUktFUik7IC8qIFNob3J0X3ZpZGVvX3N0YXJ0X21hcmtlciAqLwotICAgIHN0YXR1cyA9IEJpdHN0cmVhbVB1dEJpdHMoc3RyZWFtLCA4LCBjdXJyVm9wLT50ZW1wb3JhbFJlZik7IC8qIHRlbXBvcmFsX3JlZmVyZW5jZSAqLwotICAgIHN0YXR1cyA9IEJpdHN0cmVhbVB1dDFCaXRzKHN0cmVhbSwgMSk7IC8qIG1hcmtlciBiaXQgKi8KLSAgICBzdGF0dXMgPSBCaXRzdHJlYW1QdXQxQml0cyhzdHJlYW0sIDApOyAvKiB6ZXJvIGJpdCAqLwotICAgIHN0YXR1cyA9IEJpdHN0cmVhbVB1dDFCaXRzKHN0cmVhbSwgMCk7IC8qIHNwbGl0X3NjcmVlbl9pbmRpY2F0b3I9MCovCi0gICAgc3RhdHVzID0gQml0c3RyZWFtUHV0MUJpdHMoc3RyZWFtLCAwKTsgLyogZG9jdW1lbnRfY2FtZXJhX2luZGljYXRvcj0wKi8KLSAgICBzdGF0dXMgPSBCaXRzdHJlYW1QdXQxQml0cyhzdHJlYW0sIDApOyAvKiBmdWxsX3BpY3R1cmVfZnJlZXplX3JlbGVhc2U9MCovCi0KLSAgICBzd2l0Y2ggKGN1cnJWb3AtPndpZHRoKQotICAgIHsKLSAgICAgICAgY2FzZSAxMjg6Ci0gICAgICAgICAgICBpZiAoY3VyclZvcC0+aGVpZ2h0ID09IDk2KQotICAgICAgICAgICAgICAgIHN0YXR1cyA9IEJpdHN0cmVhbVB1dEJpdHMoc3RyZWFtLCAzLCAxKTsgLyogc291cmNlX2Zvcm1hdCA9IDEgKi8KLSAgICAgICAgICAgIGVsc2UKLSAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICBzdGF0dXMgPSBQVl9GQUlMOwotICAgICAgICAgICAgICAgIHJldHVybiBzdGF0dXM7Ci0gICAgICAgICAgICB9Ci0gICAgICAgICAgICBicmVhazsKLQotICAgICAgICBjYXNlIDE3NjoKLSAgICAgICAgICAgIGlmIChjdXJyVm9wLT5oZWlnaHQgPT0gMTQ0KQotICAgICAgICAgICAgICAgIHN0YXR1cyA9IEJpdHN0cmVhbVB1dEJpdHMoc3RyZWFtLCAzLCAyKTsgLyogc291cmNlX2Zvcm1hdCA9IDIgKi8KLSAgICAgICAgICAgIGVsc2UKLSAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICBzdGF0dXMgPSBQVl9GQUlMOwotICAgICAgICAgICAgICAgIHJldHVybiBzdGF0dXM7Ci0gICAgICAgICAgICB9Ci0gICAgICAgICAgICBicmVhazsKLQotICAgICAgICBjYXNlIDM1MjoKLSAgICAgICAgICAgIGlmIChjdXJyVm9wLT5oZWlnaHQgPT0gMjg4KQotICAgICAgICAgICAgICAgIHN0YXR1cyA9IEJpdHN0cmVhbVB1dEJpdHMoc3RyZWFtLCAzLCAzKTsgLyogc291cmNlX2Zvcm1hdCA9IDMgKi8KLSAgICAgICAgICAgIGVsc2UKLSAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICBzdGF0dXMgPSBQVl9GQUlMOwotICAgICAgICAgICAgICAgIHJldHVybiBzdGF0dXM7Ci0gICAgICAgICAgICB9Ci0gICAgICAgICAgICBicmVhazsKLQotICAgICAgICBjYXNlIDcwNDoKLSAgICAgICAgICAgIGlmIChjdXJyVm9wLT5oZWlnaHQgPT0gNTc2KQotICAgICAgICAgICAgICAgIHN0YXR1cyA9IEJpdHN0cmVhbVB1dEJpdHMoc3RyZWFtLCAzLCA0KTsgLyogc291cmNlX2Zvcm1hdCA9IDQgKi8KLSAgICAgICAgICAgIGVsc2UKLSAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICBzdGF0dXMgPSBQVl9GQUlMOwotICAgICAgICAgICAgICAgIHJldHVybiBzdGF0dXM7Ci0gICAgICAgICAgICB9Ci0gICAgICAgICAgICBicmVhazsKLQotICAgICAgICBjYXNlIDE0MDg6Ci0gICAgICAgICAgICBpZiAoY3VyclZvcC0+aGVpZ2h0ID09IDExNTIpCi0gICAgICAgICAgICAgICAgc3RhdHVzID0gQml0c3RyZWFtUHV0Qml0cyhzdHJlYW0sIDMsIDUpOyAvKiBzb3VyY2VfZm9ybWF0ID0gNSAqLwotICAgICAgICAgICAgZWxzZQotICAgICAgICAgICAgewotICAgICAgICAgICAgICAgIHN0YXR1cyA9IFBWX0ZBSUw7Ci0gICAgICAgICAgICAgICAgcmV0dXJuIHN0YXR1czsKLSAgICAgICAgICAgIH0KLSAgICAgICAgICAgIGJyZWFrOwotCi0gICAgICAgIGRlZmF1bHQ6Ci0gICAgICAgICAgICBzdGF0dXMgPSBQVl9GQUlMOwotICAgICAgICAgICAgcmV0dXJuIHN0YXR1czsKLSAgICB9Ci0KLQotICAgIHN0YXR1cyA9IEJpdHN0cmVhbVB1dDFCaXRzKHN0cmVhbSwgY3VyclZvcC0+cHJlZGljdGlvblR5cGUpOyAvKiBwaWN0dXJlX2NvZGluZyB0eXBlICovCi0gICAgc3RhdHVzID0gQml0c3RyZWFtUHV0Qml0cyhzdHJlYW0sIDQsIDApOyAvKiBmb3VyX3Jlc2VydmVkX3plcm9fYml0cyAqLwotICAgIHN0YXR1cyA9IEJpdHN0cmVhbVB1dEJpdHMoc3RyZWFtLCA1LCBjdXJyVm9wLT5xdWFudGl6ZXIpOyAvKiB2b3BfcXVhbnQqLwotICAgIHN0YXR1cyA9IEJpdHN0cmVhbVB1dDFCaXRzKHN0cmVhbSwgMCk7IC8qIHplcm9fYml0Ki8KLSAgICBzdGF0dXMgPSBCaXRzdHJlYW1QdXQxQml0cyhzdHJlYW0sIDApOyAvKiBwZWk9MCAqLwotCi0gICAgcmV0dXJuIHN0YXR1czsKLX0KLQotI2lmbmRlZiBIMjYzX09OTFkKLS8qID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PSAqLwotLyogIEZ1bmN0aW9uIDogRW5jb2RlVmlkZW9QYWNrZXRIZWFkZXIoKSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0vKiAgRGF0ZSAgICAgOiAwOS8wNS8yMDAwICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICBIaXN0b3J5ICA6ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogIFB1cnBvc2UgIDogRW5jb2RlIGEgZnJhbWUgb2YgTVBFRzQgYml0c3RyZWFtIGluIENvbWJpbmVkIG1vZGUuICAgICAgICAgICovCi0vKiAgSW4vb3V0ICAgOiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qICBSZXR1cm4gICA6ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogIE1vZGlmaWVkIDogMDQvMjUvMjAwMiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotLyogICAgICAgICAgICAgQWRkIGJpdHN0cmVhbSBzdHJ1Y3R1cmUgYXMgaW5wdXQgYXJndW1lbnQgICAgICAgICAgICAgICAgICAgICovCi0vKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLS8qID09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PSAqLwotUFZfU1RBVFVTIEVuY29kZVZpZGVvUGFja2V0SGVhZGVyKFZpZGVvRW5jRGF0YSAqdmlkZW8sIGludCBNQl9udW1iZXIsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaW50IHF1YW50X3NjYWxlLCBJbnQgaW5zZXJ0KQotewotLy8gIFBWX1NUQVRVUyBzdGF0dXM9UFZfU1VDQ0VTUzsKLSAgICBpbnQgZmNvZGU7Ci0gICAgVm9wICpjdXJyVm9wID0gdmlkZW8tPmN1cnJWb3A7Ci0gICAgVm9sICpjdXJyVm9sID0gdmlkZW8tPnZvbFt2aWRlby0+Y3VyckxheWVyXTsKLSAgICBCaXRzdHJlYW1FbmNWaWRlbyAqYnMsIHRtcDsKLSAgICBVQ2hhciBidWZmZXJbMzBdOwotCi0gICAgaWYgKGluc2VydCkgLyogaW5zZXJ0IHBhY2tldCBoZWFkZXIgdG8gdGhlIGJlZ2lubmluZyBvZiBiczEgKi8KLSAgICB7Ci0gICAgICAgIHRtcC5iaXRzdHJlYW1CdWZmZXIgPSBidWZmZXI7IC8qIHVzZSB0ZW1wb3JhcnkgYnVmZmVyICovCi0gICAgICAgIHRtcC5idWZmZXJTaXplID0gMzA7Ci0gICAgICAgIEJpdHN0cmVhbUVuY1Jlc2V0KCZ0bXApOwotICAgICAgICBicyA9ICZ0bXA7Ci0gICAgfQotICAgIGVsc2UKLSAgICAgICAgYnMgPSB2aWRlby0+Yml0c3RyZWFtMTsKLQotCi0gICAgaWYgKGN1cnJW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i0gICAgICAgIE9NWF9JTkRFWFRZUEUgaW5kZXgsIGNvbnN0IE9NWF9QVFIgcGFyYW1zKSB7Ci0gICAgc3dpdGNoIChpbmRleCkgewotICAgICAgICBjYXNlIE9NWF9JbmRleFBhcmFtU3RhbmRhcmRDb21wb25lbnRSb2xlOgotICAgICAgICB7Ci0gICAgICAgICAgICBjb25zdCBPTVhfUEFSQU1fQ09NUE9ORU5UUk9MRVRZUEUgKnJvbGVQYXJhbXMgPQotICAgICAgICAgICAgICAgIChjb25zdCBPTVhfUEFSQU1fQ09NUE9ORU5UUk9MRVRZUEUgKilwYXJhbXM7Ci0KLSAgICAgICAgICAgIGlmIChzdHJuY21wKChjb25zdCBjaGFyICopcm9sZVBhcmFtcy0+Y1JvbGUsCi0gICAgICAgICAgICAgICAgICAgICAgICAiYXVkaW9fZGVjb2Rlci5tcDMiLAotICAgICAgICAgICAgICAgICAgICAgICAgT01YX01BWF9TVFJJTkdOQU1FX1NJWkUgLSAxKSkgewotICAgICAgICAgICAgICAgIHJldHVybiBPTVhfRXJyb3JVbmRlZmluZWQ7Ci0gICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgIHJldHVybiBPTVhfRXJyb3JOb25lOwotICAgICAgICB9Ci0KLSAgICAgICAgZGVmYXVsdDoKLSAgICAgICAgICAgIHJldHVybiBTaW1wbGVTb2Z0T01YQ29tcG9uZW50OjppbnRlcm5hbFNldFBhcmFtZXRlcihpbmRleCwgcGFyYW1zKTsKLSAgICB9Ci19Ci0KLXZvaWQgU29mdE1QMzo6b25RdWV1ZUZpbGxlZChPTVhfVTMyIHBvcnRJbmRleCkgewotICAgIGlmIChtU2lnbmFsbGVkRXJyb3IgfHwgbU91dHB1dFBvcnRTZXR0aW5nc0NoYW5nZSAhPSBOT05FKSB7Ci0gICAgICAgIHJldHVybjsKLSAgICB9Ci0KLSAgICBMaXN0PEJ1ZmZlckluZm8gKj4gJmluUXVldWUgPSBnZXRQb3J0UXVldWUoMCk7Ci0gICAgTGlz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ZtcDNfZnJhbWVkZWNvZGVyKG1Db25maWcsIG1EZWNvZGVyQnVmKSkKLSAgICAgICAgICAgICAgICAhPSBOT19ERUNPRElOR19FUlJPUikgewotICAgICAgICAgICAgQUxPR1YoIm1wMyBkZWNvZGVyIHJldHVybmVkIGVycm9yICVkIiwgZGVjb2RlckVycik7Ci0KLSAgICAgICAgICAgIGlmIChkZWNvZGVyRXJyICE9IE5PX0VOT1VHSF9NQUlOX0RBVEFfRVJST1IgfHwKLSAgICAgICAgICAgICAgICAgICAgbUNvbmZpZy0+b3V0cHV0RnJhbWVTaXplID09IDApIHsKLSAgICAgICAgICAgICAgICBBTE9HRSgibXAzIGRlY29kZXIgcmV0dXJuZWQgZXJyb3IgJWQiLCBkZWNvZGVyRXJyKTsKLQotICAgICAgICAgICAgICAgIGlmIChtQ29uZmlnLT5vdXRwdXRGcmFtZVNpemUgPT0gMCkgewotICAgICAgICAgICAgICAgICAgICBBTE9HRSgiT3V0cHV0IGZyYW1lIHNpemUgaXMgMCIpOwotICAgICAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgICAgIG5vdGlmeShPTVhfRXZlbnRFcnJvciwgT01YX0Vycm9yVW5kZWZpbmVkLCBkZWNvZGVyRXJyLCBOVUxMKTsKLSAgICAgICAgICAgICAgICBtU2lnbmFsbGVkRXJyb3IgPSB0cnVlOwotICAgICAgICAgICAgICAgIHJldHVybjsKLSAgICAgICAgICAgIH0KLQot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25maWctPmlucHV0QnVmZmVyVXNlZExlbmd0aDsKLQotICAgICAgICBtTnVtRnJhbWVzT3V0cHV0ICs9IG1Db25maWctPm91dHB1dEZyYW1lU2l6ZSAvIG1OdW1DaGFubmVsczsKLQotICAgICAgICBpZiAoaW5IZWFkZXItPm5GaWxsZWRMZW4gPT0gMCkgewotICAgICAgICAgICAgaW5JbmZvLT5tT3duZWRCeVVzID0gZmFsc2U7Ci0gICAgICAgICAgICBpblF1ZXVlLmVyYXNlKGluUXVldWUuYmVnaW4oKSk7Ci0gICAgICAgICAgICBpbkluZm8gPSBOVUxMOwotICAgICAgICAgICAgbm90aWZ5RW1wdHlCdWZmZXJEb25lKGluSGVhZGVyKTsKLSAgICAgICAgICAgIGluSGVhZGVyID0gTlVMTDsKLSAgICAgICAgfQotCi0gICAgICAgIG91dEluZm8tPm1Pd25lZEJ5VXMgPSBmYWxzZTsKLSAgICAgICAgb3V0UXVldWUuZXJhc2Uob3V0UXVldWUuYmVnaW4oKSk7Ci0gICAgICAgIG91dEluZm8gPSBOVUxMOwotICAgICAgICBub3RpZnlGaWxsQnVmZmVyRG9uZShvdXRIZWFkZXIpOwotICAgICAgICBvdXRIZWFkZXIgPSBOVUxMOwotICAgIH0KLX0KLQotdm9pZCBTb2Z0TVAzOjpvblBvcnRGbHVzaENvbXBsZXRlZChPTVhfVTMyIHBvcnRJbmRleCkgewotICAgIGlmIChwb3J0SW5kZXggPT0gMCkgewotICAgICAgICAvLyBNYWtlIHN1cmUgdGhhdCB0aGUgbmV4dCBidWZmZXIgb3V0cHV0IGRvZXMgbm90IHN0aWxsCi0gICAgICAgIC8vIGRlcGVuZCBvbiBmcmFnbWVudHMgZnJvbSB0aGUgbGFzdCBvbmUgZGVjb2RlZC4KLSAgICAgICAgcHZtcDNfSW5pdERlY29kZXIobUNvbmZpZywgbURlY29kZXJCdWYpOwotICAgICAgICBtSXNGaXJzdCA9IHRydWU7Ci0gICAgfQotfQotCi12b2lkIFNvZnRNUDM6Om9uU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AgICA9IDEsCi0gICAgICAgIFVOU1VQUE9SVEVEX0ZSRUVfQklUUkFURSAgPSAyLAotICAgICAgICBGSUxFX09QRU5fRVJST1IgICAgICAgICAgID0gMywgICAgICAgICAgLyogZXJyb3Igb3BlbmluZyBmaWxlICovCi0gICAgICAgIENIQU5ORUxfQ09ORklHX0VSUk9SICAgICAgPSA0LCAgICAgLyogZXJyb3IgaW4gY2hhbm5lbCBjb25maWd1cmF0aW9uICovCi0gICAgICAgIFNZTlRIRVNJU19XSU5ET1dfRVJST1IgICAgPSA1LCAgIC8qIGVycm9yIGluIHN5bnRoZXNpcyB3aW5kb3cgdGFibGUgKi8KLSAgICAgICAgUkVBRF9GSUxFX0VSUk9SICAgICAgICAgICA9IDYsICAgICAgICAgIC8qIGVycm9yIHJlYWRpbmcgaW5wdXQgZmlsZSAqLwotICAgICAgICBTSURFX0lORk9fRVJST1IgICAgICAgICAgID0gNywgICAgICAgICAgLyogZXJyb3IgaW4gc2lkZSBpbmZvICovCi0gICAgICAgIEhVRkZNQU5fVEFCTEVfRVJST1IgICAgICAgPSA4LCAgICAgIC8qIGVycm9yIGluIEh1ZmZtYW4gdGFibGUgKi8KLSAgICAgICAgQ09NTUFORF9MSU5FX0VSUk9SICAgICAgICA9IDksICAgICAgIC8qIGVycm9yIGluIGNvbW1hbmQgbGluZSAqLwotICAgICAgICBNRU1PUllfQUxMT0NBVElPTl9FUlJPUiAgID0gMTAsICAgLyogZXJyb3IgYWxsb2NhdGluZyBtZW1vcnkgKi8KLSAgICAgICAgTk9fRU5PVUdIX01BSU5fREFUQV9FUlJPUiA9IDExLAotICAgICAgICBTWU5DSF9MT1NUX0VSUk9SICAgICAgICAgID0gMTIsCi0gICAgICAgIE9VVFBVVF9CVUZGRVJfVE9PX1NNQUxMICAgPSAxMyAgICAgLyogb3V0cHV0IGJ1ZmZlciBjYW4ndCBob2xkIG91dHB1dCAqLwotICAgIH0gRVJST1JfQ09ERTsKLQotICAgIC8qLS0tLS0tLS0tLS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IG51bWJlciBvZiBjaGFubmVscyBkZWNvZGVkIGZyb20gdGhlIGJpdHN0cmVhbS4KLSAgICAgICAgICovCi0gICAgICAgIGludDE2ICAgICAgIG51bV9jaGFubmVsczsKLQotICAgICAgICAvKgotICAgICAgICAgKiBPVVRQVVQ6Ci0gICAgICAgICAqIFRoZSBudW1iZXIgb2YgY2hhbm5lbHMgZGVjb2RlZCBmcm9tIHRoZSBiaXRzdHJlYW0uCi0gICAgICAgICAqLwotICAgICAgICBpbnQxNiAgICAgICB2ZXJzaW9uOwotCi0gICAgICAgIC8qCi0gICAgICAgICAqIE9VVFBVVDoKLSAgICAgICAgICogVGhlIHNhbXBsaW5nIHJhdGUgZGVjb2RlZCBmcm9tIHRoZSBiaXRzdHJlYW0sIGluIHVuaXRzIG9mCi0gICAgICAgICAqIHNhbXBsZXMvc2Vjb25kLgotICAgICAgICAgKi8KLSAgICAgICAgaW50MzIgICAgICAgc2FtcGxpbmdSYXRlOwotCi0gICAgICAgIC8qCi0gICAgICAgICAqIE9VVFBVVDoKLSAgICAgICAgICogVGhpcyB2YWx1ZSBpcyB0aGUgYml0cmF0ZSBpbiB1bml0cyBvZiBiaXRzL3NlY29uZC4gSVQKLSAgICAgICAgICogaXMgY2FsY3VsYXRlZCB1c2luZyB0aGUgbnVtYmVyIG9mIGJpdHMgY29uc3VtZWQgZm9yIHRoZSBjdXJyZW50IGZyYW1lLAotICAgICAgICAgKiBhbmQgdGhlbiBtdWx0aXBseWluZyBieSB0aGUgc2FtcGxpbmdfcmF0ZSwgZGl2aWRlZCBieSBwb2ludHMgaW4gYSBmcmFtZS4KLSAgICAgICAgICogVGhpcyB2YWx1ZSBjYW4gY2hhbmdlcyBmcmFtZSB0byBmcmFtZS4KLSAgICAgICAgICovCi0gICAgICAgIGludDMyICAgICAgIGJpdFJhdGU7Ci0KLSAgICAgICAgLyoKLSAgICAgICAgICogSU5QVVQvT1VUUFVUOgotICAgICAgICAgKiBJbjogSW5mb3JtIGRlY29kZXIga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gICBhZGQgICAgICByMSxyMSxyMwotICAgICAgICBzdWIgICAgICByMyxyMixyMTIKLSAgICAgICAgbGRyICAgICAgbHIsY29uc3RhbnQyCi0gICAgICAgIG1vdiAgICAgIHIzLHIzLGxzbCAjMwotICAgICAgICBzbXVsbCAgICByNCxyMyxscixyMwotICAgICAgICBsZHIgICAgICByNixjb25zdGFudDUKLSAgICAgICAgc3RyICAgICAgcjMsW3NwXQotICAgICAgICBhZGQgICAgICByMyxyMixyMTIKLSAgICAgICAgc3ViICAgICAgcjIscjEscjMKLSAgICAgICAgbGRyICAgICAgcjEyLGNvbnN0YW50MwotICAgICAgICBhZGQgICAgICByMyxyMSxyMwotICAgICAgICBzbXVsbCAgICBscixyMixyMTIscjIKLSAgICAgICAgbGRyICAgICAgcjEyLFtyMCwjMHgzOF0KLSAgICAgICAgbGRyICAgICAgcjEsW3IwLCM0XQotICAgICAgICBsZHIgICAgICBscixjb25zdGFudDQKLSAgICAgICAgc3ViICAgICAgcjQscjEscjEyCi0gICAgICAgIGFkZCAgICAgIHIxLHIxLHIxMgotICAgICAgICBsZHIgICAgICByMTIsW3IwLCMweDE4XQotICAgICAgICBzbXVsbCAgICByNCxyNSxscixyNAotICAgICAgICBsZHIgICAgICBscixbcjAsIzB4MjRdCi0gICAgICAgIGxkciAgICAgIHIxMCxjb25zdGFudDEwCi0gICAgICAgIHN1YiAgICAgIHI0LHIxMixscgotICAgICAgICBtb3YgICAgICByNCxyNCxsc2wgIzEKLSAgICAgICAgc211bGwgICAgcjcscjQscjYscjQKLSAgICAgICAgYWRkICAgICAgcjEyLHIxMixscgotICAgICAgICBhZGQgICAgICByNyxyMSxyMTIKLSAgICAgICAgc3ViICAgICAgcjEyLHIxLHIxMgotICAgICAgICBsZHIgICAgICByMSxjb25zdGFudDYKLSAgICAgICAgc3RyICAgICAgcjQsW3NwLCM0XQotICAgICAgICBzbXVsbCAgICByMTIscjQscjEscjEyCi0gICAgICAgIGxkciAgICAgIHIxLFtyMCwjOF0KLSAgICAgICAgbGRyICAgICAgcjEyLFtyMCwjMHgzNF0KLSAgICAgICAgbGRyICAgICAgcjYsY29uc3RhbnQ3Ci0gICAgICAgIHN1YiAgICAgIGxyLHIxLHIxMgotICAgICAgICBzbXVsbCAgICByOCxscixyNixscgotICAgICAgICBhZGQgICAgICByMSxyMSxyMTIKLSAgICAgICAgc3RyICAgICAgbHIsW3NwLCMweDEwXQotICAgICAgICBsZHIgICAgICByMTIsW3IwLCMweDE0XQotICAgICAgICBsZHIgICAgICBscixbcjAsIzB4MjhdCi0gICAgICAgIGxkciAgICAgIHI4LGNvbnN0YW50OAotICAgICAgICBzdWIgICAgICByNixyMTIsbHIKLSAgICAgICAgbW92ICAgICAgcjYscjYsbHNsICMxCi0gICAgICAgIHNtdWxsICAgIHI5LHI2LHI4LHI2Ci0gICAgICAgIGFkZCAgICAgIHIxMixyMTIsbHIKLSAgICAgICAgbGRyICAgICAgcjksY29uc3RhbnQ5Ci0gICAgICAgIGFkZCAgICAgIHI4LHIxLHIxMgotICAgICAgICBzdWIgICAgICByMTIscjEscjEyCi0gICAgICAgIHNtdWxsICAgIHIxMixscixyOSxyMTIKLSAgICAgICAgbGRyICAgICAgcjEyLFtyMCwjMHgzMF0KLSAgICAgICAgbGRyICAgICAgcjEsW3IwLCMweGNdCi0gICAgICAgIHN1YiAgICAgIHI5LHIxLHIxMgotICAgICAgICBzbXVsbCAgICByMTEscjkscjEwLHI5Ci0gICAgICAgIGFkZCAgICAgIHIxMixyMSxyMTIKLSAgICAgICAgc3RyICAgICAgcjksW3NwLCMweGNdCi0gICAgICAgIGxkciAgICAgIHI5LFtyMCwjMHgxMF0KLSAgICAgICAgbGRyICAgICAgcjEwLGNvbnN0YW50MTEKLSAgICAgICAgc3RyICAgICAgcjksW3NwLCMweDE4XQotICAgICAgICBsZHIgICAgICByMSxbcjAsIzB4MmNdCi0gICAgICAgIHN1YiAgICAgIHI5LHI5LHIxCi0gICAgICAgIHNtdWxsICAgIHIxMSxyOSxyMTAscjkKLSAgICAgICAgbGRyICAgICAgcjEwLGNvbnN0YW50MTIKLSAgICAgICAgc3RyICAgICAgcjksW3NwLCM4XQotICAgICAgICBsZHIgICAgICByOSxbc3AsIzB4MThdCi0gICAgICAgIGxkciAgICAgIHIxMSxjb25zdGFudDE0Ci0gICAgICAgIGFkZCAgICAgIHI5LHI5LHIxCi0gICAgICAgIGFkZCAgICAgIHIxLHIxMixyOQotICAgICAgICBzdWIgICAgICByMTIscjEyLHI5Ci0gICAgICAgIG1vdiAgICAgIHIxMixyMTIsbHNsICMyCi0gICAgICAgIHNtdWxsICAgIHI5LHIxMixyMTAscjEyCi0gICAgICAgIGxkciAgICAgIHIxMCxjb25zdGFudDEzCi0gICAgICAgIGFkZCAgICAgIHI5LHIzLHIxCi0gICAgICAgIHN1YiAgICAgIHIxLHIzLHIxCi0gICAgICAgIHNtdWxsICAgIHIxLHIzLHIxMCxyMQotICAgICAgICBzdWIgICAgICByMSxyNyxyOAotICAgICAgICBtb3YgICAgICByMSxyMSxsc2wgIzEKLSAgICAgICAgc211bGwgICAgcjEscjEwLHIxMSxyMQotICAgICAgICBhZGQgICAgICByMSxyNyxyOAotICAgICAgICBhZGQgICAgICByOCxyOSxyMQotICAgICAgICBzdWIgICAgICByNyxyOSxyMQotICAgICAgICBtb3YgICAgICByOCxyOCxhc3IgIzEKLSAgICAgICAgbGRyICAgICAgcjEsY29uc3RhbnQxNQotICAgICAgICBzdHIgICAgICByOCxbcjBdCi0gICAgICAgIHNtdWxsICAgIHI3LHI4LHIxLHI3Ci0gICAgICAgIHN1YiAgICAgIHI3LHIzLHIxMAotICAgICAgICBzdHIgICAgICByOCxbcjAsIzB4MjBdCi0gICAgICAgIG1vdiAgICAgIHI3LHI3LGxzbCAjMQotICAgICAgICBzbXVsbCAgICByOCxyNyxyMSxyNwotICAgICAgICBhZGQgICAgICByMyxyMyxyMTAKLSAgICAgICAgYWRkICAgICAgcjMscjMscjcKLSAgICAgICAgc3RyICAgICAgcjMsW3IwLCMweDEwXQotICAgICAgICBzdWIgICAgICByMyxyMixyMTIKLSAgICAgICAgc3RyICAgICAgcjcsW3IwLCMweDMwXQotICAgICAgICBhZGQgICAgICByMixyMixyMTIKLSAgICAgICAgbGRyICAgICAgcjcsY29uc3RhbnQxMwotICAgICAgICBzdWIgICAgICByMTIscjQsbHIKLSAgICAgICAgbW92ICAgICAgcjMscjMsbHNsICMxCi0gICAgICAgIHNtdWxsICAgIHI4LHIzLHI3LHIzCi0gICAgICAgIGFkZCAgICAgIGxyLHI0LGxyCi0gICAgICAgIHN1YiAgICAgIHI0LHIyLGxyCi0gICAgICAgIG1vdiAgICAgIHIxMixyMTIsbHNsICMyCi0gICAgICAgIHNtdWxsICAgIHI3LHIxMixyMTEscjEyCi0gICAgICAgIGFkZCAgICAgIGxyLGxyLHIyCi0gICAgICAgIHN1YiAgICAgIHIyLHIzLHIxMgotICAgICAgICBtb3YgICAgICByMixyMixsc2wgIzEKLSAgICAgICAgc211bGwgICAgcjcscjIscjEscjIKLSAgICAgICAgbW92ICAgICAgcjQscjQsbHNsICMxCi0gICAgICAgIGFkZCAgICAgIHIxMixyMTIscjIKLSAgICAgICAgYWRkICAgICAgcjMscjEyLHIzCi0gICAgICAgIHNtdWxsICAgIHI3LHI0LHIxLHI0Ci0gICAgICAgIGFkZCAgICAgIHIxMixyMyxscgotICAgICAgICBhZGQgICAgICByMyxyMyxyNAotICAgICAgICBzdHIgICAgICByMyxbcjAsIzB4MThdCi0gICAgICAgIGFkZCAgICAgIHIzLHIyLHI0Ci0gICAgICAgIHN0ciAgICAgIHIyLFtyMCwjMHgzOF0KLSAgICAgICAgc3RyICAgICAgcjMsW3IwLCMweDI4XQotICAgICAgICBzdHIgICAgICByMTIsW3IwLCM4XQotICAgICAgICBsZHIgICAgICByMixbc3AsIzB4MTRdCi0gICAgICAgIGxkciAgICAgIHIzLFtzcCwjMF0KLSAgICAgICAgbGRyICAgICAgbHIsW3NwLCM0XQotICAgICAgICBzdWIgICAgICByMixyMixyMwotICAgICAgICBsZHIgICAgICByMyxjb25zdGFudDMKLSAgICAgICAgbW92ICAgICAgcjIscjIsbHNsICMxCi0gICAgICAgIHNtdWxsICAgIHIxMixyMixyMyxyMgotICAgICAgICBsZHIgICAgICByMyxbc3AsIzB4MTRdCi0gICAgICAgIGxkciAgICAgIHIxMixbc3AsIzBdCi0gICAgICAgIGxkciAgICAgIHI0LGNvbnN0YW50NgotICAgICAgICBhZGQgICAgICByMTIscjMscjEyCi0gICAgICAgIGxkciAgICAgIHIzLFtzcCwjNF0KLSAgICAgICAgc3ViICAgICAgbHIscjUsbHIKLSAgICAgICAgbW92ICAgICAgbHIsbHIsbHNsICMxCi0gICAgICAgIGFkZCAgICAgIHIzLHI1LHIzCi0gICAgICAgIHNtdWxsICAgIHI1LGxyLHI0LGxyCi0gICAgICAgIGxkciAgICAgIHI0LFtzcCwjMHgxMF0KLSAgICAgICAgbGRyICAgICAgcjUsW3NwLCMweDEwXQotICAgICAgICBhZGQgICAgICByNCxyNCxyNgotICAgICAgICBzdWIgICAgICByNSxyNSxyNgotICAgICAgICBsZHIgICAgICByNixjb25zdGFudDkKLSAgICAgICAgbW92ICAgICAgcjUscjUsbHNsICMxCi0gICAgICAgIHNtdWxsICAgIHI3LHI1LHI2LHI1Ci0gICAgICAgIGxkciAgICAgIHI2LFtzcCwjOF0KLSAgICAgICAgbGRyICAgICAgcjksW3NwLCMweGNdCi0gICAgICAgIGxkciAgICAgIHIxMCxjb25zdGFudDEyCi0gICAgICAgIHN1YiAgICAgIHI2LHI5LHI2Ci0gICAgICAgIG1vdiAgICAgIHI2LHI2LGxzbCAjMwotICAgICAgICBzbXVsbCAgICByNyxyNixyMTAscjYKLSAgICAgICAgbGRyICAgICAgcjgsW3NwLCMweDIwXQotICAgICAgICBsZHIgICAgICByNyxbc3AsIzhdCi0gICAgICAgIGNtcCAgICAgIHI4LCMwCi0gICAgICAgIGFkZCAgICAgIHI3LHI5LHI3Ci0KLSAgICAgICAgYm5lICAgICAgbm9fZmxhZ19wcm9jCi0gICAgICAgIHJzYiAgICAgIHIxMixyMTIsIzAKLSAgICAgICAgcnNiICAgICAgcjIscjIsIzAKLSAgICAgICAgcnNiICAgICAgcjMscjMsIzAKLSAgICAgICAgcnNiICAgICAgbHIsbHIsIzAKLSAgICAgICAgcnNiICAgICAgcjQscjQsIzAKLSAgICAgICAgcnNiICAgICAgcjUscjUsIzAKLSAgICAgICAgcnNiICAgICAgcjcscjcsIzAKLSAgICAgICAgcnNiICAgICAgcjYscjYsIzAKLW5vX2ZsYWdfcHJvYzoKLQotICAgICAgICBzdWIgICAgICByOCxyMixyNgotICAgICAgICBhZGQgICAgICByMixyNixyMgotICAgICAgICBzdWIgICAgICByNixyMTIscjcKLSAgICAgICAgbGRyICAgICAgcjksY29uc3RhbnQxMwotICAgICAgICBhZGQgICAgICByMTIscjEyLHI3Ci0gICAgICAgIHN1YiAgICAgIHI3LHIzLHI0Ci0gICAgICAgIG1vdiAgICAgIHI2LHI2LGxzbCAjMQotICAgICAgICBtb3YgICAgICByOCxyOCxsc2wgIzEKLSAgICAgICAgc211bGwgICAgcjEwLHI4LHI5LHI4Ci0gICAgICAgIGFkZCAgICAgIHIzLHIzLHI0Ci0gICAgICAgIHNtdWxsICAgIHIxMCxyNixyOSxyNgotICAgICAgICBzdWIgICAgICByNCxscixyNQotICAgICAgICBtb3YgICAgICByNyxyNyxsc2wgIzIKLSAgICAgICAgc211bGwgICAgcjkscjcscjExLHI3Ci0gICAgICAgIGFkZCAgICAgIGxyLGxyLHI1Ci0gICAgICAgIHN1YiAgICAgIHI1LHI2LHI3Ci0gICAgICAgIGFkZCAgICAgIHI2LHI2LHI3Ci0gICAgICAgIHN1YiAgICAgIHI3LHIxMixyMwotICAgICAgICBhZGQgICAgICByMyxyMTIscjMKLSAgICAgICAgc3ViICAgICAgcjEyLHIyLGxyCi0gICAgICAgIG1vdiAgICAgIHI0LHI0LGxzbCAjMgotICAgICAgICBzbXVsbCAgICByOSxyNCxyMTEscjQKLSAgICAgICAgYWRkICAgICAgbHIscjIsbHIKLSAgICAgICAgc3ViICAgICAgcjIscjgscjQKLSAgICAgICAgbW92ICAgICAgcjIscjIsbHNsICMxCi0gICAgICAgIG1vdiAgICAgIHI1LHI1LGxzbCAjMQotICAgICAgICBtb3YgICAgICByMTIscjEyLGxzbCAjMQotICAgICAgICBtb3YgICAgICByNyxyNyxsc2wgIzEKLSAgICAgICAgc211bGwgICAgcjkscjUscjEscjUKLSAgICAgICAgc211bGwgICAgcjkscjIscjEscjIKLSAgICAgICAgYWRkICAgICAgcjYscjYscjUKLSAgICAgICAgc211bGwgICAgcjkscjcscjEscjcKLSAgICAgICAgc211bGwgICAgcjkscjEyLHIxLHIxMgotICAgICAgICBhZGQgICAgICByMSxyNCxyMgotICAgICAgICBhZGQgICAgICByMSxyMSxyOAotICAgICAgICBhZGQgICAgICBscixscixyMQotICAgICAgICBhZGQgICAgICByMyxyMyxscgotICAgICAgICBzdHIgICAgICByMyxbcjAsIzRdCi0gICAgICAgIGFkZCAgICAgIHIzLHI2LGxyCi0gICAgICAgIHN0ciAgICAgIHIzLFtyMCwjMHhjXQotICAgICAgICBhZGQgICAgICByMSxyMSxyMTIKLSAgICAgICAgYWRkICAgICAgcjMscjYscjEKLSAgICAgICAgYWRkICAgICAgcjEscjcscjEKLSAgICAgICAgc3RyICAgICAgcjEsW3IwLCMweDFjXQotICAgICAgICBzdHIgICAgICByMyxbcjAsIzB4MTRdCi0gICAgICAgIGFkZCAgICAgIHIxLHIxMixyMgotICAgICAgICBhZGQgICAgICByMyxyNyxyMQotICAgICAgICBhZGQgICAgICByMSxyNSxyMQotICAgICAgICBzdHIgICAgICByMSxbcjAsIzB4MmNdCi0gICAgICAgIHN0ciAgICAgIHIzLFtyMCwjMHgyNF0hCi0gICAgICAgIGFkZCAgICAgIHIxLHI1LHIyCi0gICAgICAgIHN0ciAgICAgIHIxLFtyMCwjMHgxMF0KLSAgICAgICAgc3RyICAgICAgcjIsW3IwLCMweDE4XQotICAgICAgICBhZGQgICAgICBzcCxzcCwjMHgyNAotICAgICAgICBsZG1mZCAgICBzcCEse3I0LXIxMSxwY30KLQotCi0KLUAtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0KLQotLmdsb2JhbCBwdm1wM19tZXJnZV9pbl9wbGFjZV9OMzIKLQotCi0KLXB2bXAzX21lcmdlX2luX3BsYWNlX04zMjoKLSAgICAgICAgc3RtZmQgICAgc3AhLHtyNCxscn0KLSAgICAgICAgbGRyICAgICAgcjEsW3IwLCMweDFjXQotICAgICAgICBsZHIgICAgICByMixbcjAsIzB4MzhdCi0gICAgICAgIHN0ciAgICAgIHIxLFtyMCwjMHgzOF0KLSAgICAgICAgbGRyICAgICAgcjEsW3IwLCMweDE4XQotICAgICAgICBsZHIgICAgICByMyxbcjAsIzB4MzBdCi0gICAgICAgIHN0ciAgICAgIHIxLFtyMCwjMHgzMF0KLSAgICAgICAgbGRyICAgICAgcjEyLFtyMCwjMHgxNF0KLSAgICAgICAgbGRyICAgICAgcjEsW3IwLCMweDI4XQotICAgICAgICBzdHIgICAgICByMTIsW3IwLCMweDI4XQotICAgICAgICBsZHIgICAgICByMTIsW3IwLCMweDEwXQotICAgICAgICBsZHIgICAgICBscixbcjAsIzB4MjBdCi0gICAgICAgIHN0ciAgICAgIHIxMixbcjAsIzB4MjBdCi0gICAgICAgIGxkciAgICAgIHIxMixbcjAsIzB4Y10KLSAgICAgICAgc3RyICAgICAgcjEyLFtyMCwjMHgxOF0KLSAgICAgICAgbGRyICAgICAgcjEyLFtyMCwjOF0KLSAgICAgICAgc3RyICAgICAgcjEyLFtyMCwjMHgxMF0KLSAgICAgICAgbGRyICAgICAgcjEyLFtyMCwjNF0KLSAgICAgICAgc3RyICAgICAgcjEyLFtyMCwjOF0KLSAgICAgICAgbGRyICAgICAgcjQsW3IwLCMweDQwXQotICAgICAgICBsZHIgICAgICByMTIsW3IwLCMweDQ0XQotICAgICAgICBhZGQgICAgICByNCxyNCxyMTIKLSAgICAgICAgc3RyICAgICAgcjQsW3IwLCM0XQotICAgICAgICBzdHIgICAgICBscixbcjAsIzB4NDBdCi0gICAgICAgIGxkciAgICAgIGxyLFtyMCwjMHg0OF0KLSAgICAgICAgYWRkICAgICAgcjEyLGxyLHIxMgotICAgICAgICBzdHIgICAgICByMTIsW3IwLCMweGNdCi0gICAgICAgIGxkciAgICAgIHIxMixbcjAsIzB4NGNdCi0gICAgICAgIGFkZCAgICAgIGxyLHIxMixscgotICAgICAgICBzdHIgICAgICBscixbcjAsIzB4MTRdCi0gICAgICAgIGxkciAgICAgIGxyLFtyMCwjMHgyNF0KLSAgICAgICAgc3RyICAgICAgbHIsW3IwLCMweDQ4XQotICAgICAgICBsZHIgICAgICBscixbcjAsIzB4NTBdCi0gICAgICAgIGFkZCAgICAgIHIxMixscixyMTIKLSAgICAgICAgc3RyICAgICAgcjEyLFtyMCwjMHgxY10KLSAgICAgICAgbGRyICAgICAgcjEyLFtyMCwjMHg1NF0KLSAgICAgICAgc3RyICAgICAgcjEsW3IwLCMweDUwXQotICAgICAgICBhZGQgICAgICBscixyMTIsbHIKLSAgICAgICAgc3RyICAgICAgbHIsW3IwLCMweDI0XQotICAgICAgICBsZHIgICAgICByMSxbcjAsIzB4NThdCi0gICAgICAgIGxkciAgICAgIHI0LFtyMCwjMHgyY10KLSAgICAgICAgbGRyICAgICAgbHIsW3IwLCMweDM0XQotICAgICAgICBhZGQgICAgICByMTIscjEscjEyCi0gICAgICAgIHN0ciAgICAgIHIxMixbcjAsIzB4MmNdCi0gICAgICAgIGxkciAgICAgIHIxMixbcjAsIzB4NWNdCi0gICAgICAgIGFkZCAgICAgIHIxLHIxMixyMQotICAgICAgICBzdHIgICAgICByMSxbcjAsIzB4MzRdCi0gICAgICAgIHN0ciAgICAgIHI0LFtyMCwjMHg1OF0KLSAgICAgICAgbGRyICAgICAgcjEsW3IwLCMweDYwXQotICAgICAgICBsZHIgICAgICByNCxbcjAsIzB4M2NdCi0gICAgICAgIGFkZCAgICAgIHIxMixyMSxyMTIKLSAgICAgICAgc3RyICAgICAgcjEyLFtyMCwjMHgzY10KLSAgICAgICAgbGRyICAgICAgcjEyLFtyMCwjMHg2NF0KLSAgICAgICAgYWRkICAgICAgcjEscjEyLHIxCi0gICAgICAgIHN0ciAgICAgIHIxLFtyMCwjMHg0NF0KLSAgICAgICAgbGRyICAgICAgcjEsW3IwLCMweDY4XQotICAgICAgICBhZGQgICAgICByMTIscjEscjEyCi0gICAgICAgIHN0ciAgICAgIHIxMixbcjAsIzB4NGNdCi0gICAgICAgIGxkciAgICAgIHIxMixbcjAsIzB4NmNdCi0gICAgICAgIGFkZCAgICAgIHIxLHIxMixyMQotICAgICAgICBzdHIgICAgICByMSxbcjAsIzB4NTRdCi0gICAgICAgIGxkciAgICAgIHIxLFtyMCwjMHg3MF0KLSAgICAgICAgc3RyICAgICAgcjMsW3IwLCMweDYwXQotICAgICAgICBhZGQgICAgICByMTIscjEscjEyCi0gICAgICAgIHN0ciAgICAgIHIxMixbcjAsIzB4NWNdCi0gICAgICAgIGxkciAgICAgIHIzLFtyMCwjMHg3NF0KLSAgICAgICAgYWRkICAgICAgcjEscjMscjEKLSAgICAgICAgc3RyICAgICAgcjEsW3IwLCMweDY0XQotICAgICAgICBzdHIgICAgICBscixbcjAsIzB4NjhdCi0gICAgICAgIGxkciAgICAgIHIxLFtyMCwjMHg3OF0KLSAgICAgICAgc3RyICAgICAgcjIsW3IwLCMweDcwXQotICAgICAgICBhZGQgICAgICByMyxyMSxyMwotICAgICAgICBzdHIgICAgICByMyxbcjAsIzB4NmNdCi0gICAgICAgIGxkciAgICAgIHIyLFtyMCwjMHg3Y10KLSAgICAgICAgYWRkICAgICAgcjEscjEscjIKLSAgICAgICAgc3RyICAgICAgcjEsW3IwLCMweDc0XQotICAgICAgICBzdHIgICAgICByNCxbcjAsIzB4NzhdCi0gICAgICAgIGxkbWZkICAgIHNwISx7cjQscGN9Ci0KLQotQC0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLQotCi0uZ2xvYmFsIHB2bXAzX3NwbGl0Ci0KLQotcHZtcDNfc3BsaXQ6Ci0gICAgICAgIHN0bWZkICAgIHNwISx7cjQscjUsbHJ9Ci0gICAgICAgIGxkciAgICAgIHIyLGNvbnN0YW50MTYKLSAgICAgICAgc3ViICAgICAgcjEscjAsIzQKLSAgICAgICAgbW92ICAgICAgcjMsIzMKLWxvb3AxOgotICAgICAgICBsZHIgICAgICByMTIsW3IwXQotICAgICAgICBsZHIgICAgICBscixbcjFdCi0gICAgICAgIGxkciAgICAgIHI0LFtyMl0sIy00Ci0gICAgICAgIGFkZCAgICAgIHI1LGxyLHIxMgotICAgICAgICBzdWIgICAgICByMTIsbHIscjEyCi0gICAgICAgIHNtdWxsICAgIHIxMixscixyNCxyMTIKLSAgICAgICAgc3RyICAgICAgcjUsW3IxXSwjLTQKLSAgICAgICAgbW92ICAgICAgcjEyLHIxMixsc3IgIzI3Ci0gICAgICAgIGFkZCAgICAgIHIxMixyMTIsbHIsbHNsICM1Ci0gICAgICAgIHN0ciAgICAgIHIxMixbcjBdLCM0Ci0gICAgICAgIGxkciAgICAgIHIxMixbcjBdCi0gICAgICAgIGxkciAgICAgIGxyLFtyMV0KLSAgICAgICAgbGRyICAgICAgcjQsW3IyXSwjLTQKLSAgICAgICAgYWRkICAgICAgcjUsbHIscjEyCi0gICAgICAgIHN1YiAgICAgIHIxMixscixyMTIKLSAgICAgICAgc211bGwgICAgcjEyLGxyLHI0LHIxMgotICAgICAgICBzdHIgICAgICByNSxbcjFdLCMtNAotICAgICAgICBtb3YgICAgICByMTIscjEyLGxzciAjMjcKLSAgICAgICAgYWRkICAgICAgcjEyLHIxMixscixsc2wgIzUKLSAgICAgICAgc3RyICAgICAgcjEyLFtyMF0sIzQKLSAgICAgICAgc3VicyAgICAgcjMscjMsIzEKLSAgICAgICAgYm5lICAgICAgbG9vcDEKLSAgICAgICAgbW92ICAgICAgcjMsIzUKLWxvb3AyOgotICAgICAgICBsZHIgICAgICByMTIsW3IwXQotICAgICAgICBsZHIgICAgICBscixbcjFdCi0gICAgICAgIGxkciAgICAgIHI0LFtyMl0sIy00Ci0gICAgICAgIGFkZCAgICAgIHI1LGxyLHIxMgotICAgICAgICBzdWIgICAgICByMTIsbHIscjEyCi0gICAgICAgIG1vdiAgICAgIHIxMixyMTIsbHNsICMxCi0gICAgICAgIHNtdWxsICAgIGxyLHIxMixyNCxyMTIKLSAgICAgICAgc3RyICAgICAgcjUsW3IxXSwjLTQKLSAgICAgICAgc3RyICAgICAgcjEyLFtyMF0sIzQKLSAgICAgICAgbGRyICAgICAgcjEyLFtyMF0KLSAgICAgICAgbGRyICAgICAgbHIsW3IxXQotICAgICAgICBsZHIgICAgICByNCxbcjJdLCMtNAotICAgICAgICBhZGQgICAgICByNSxscixyMTIKLSAgICAgICAgc3ViICAgICAgcjEyLGxyLHIxMgotICAgICAgICBtb3YgICAgICByMTIscjEyLGxzbCAjMQotICAgICAgICBzbXVsbCAgICBscixyMTIscjQscjEyCi0gICAgICAgIHN0ciAgICAgIHI1LFtyMV0sIy00Ci0gICAgICAgIHN0ciAgICAgIHIxMixbcjBdLCM0Ci0gICAgICAgIHN1YnMgICAgIHIzLHIzLCMxCi0gICAgICAgIGJuZSAgICAgIGxvb3AyCi0gICAgICAgIGxkbWZkICAgIHNwISx7cjQscjUscGN9Ci1jb25zdGFudDE6Ci0gICAgICAgIC53b3JkICAgICAgMHg0MDRmNDY4MAotY29uc3RhbnQyOgotICAgICAgICAud29yZCAgICAgIDB4NTE5ZTRlMDAKLWNvbnN0YW50MzoKLSAgICAgICAgLndvcmQgICAgICAweDQxNDBmYjgwCi1jb25zdGFudDQ6Ci0gICAgICAgIC53b3JkICAgICAgMHg0MmUxM2MwMAotY29uc3RhbnQ1OgotICAgICAgICAud29yZCAgICAgIDB4NmUzYzkzMDAKLWNvbnN0YW50NjoKLSAgICAgICAgLndvcmQgICAgICAweDRjZjhkZTgwCi1jb25zdGFudDc6Ci0gICAgICAgIC53b3JkICAgICAgMHg0ODkxOWY4MAotY29uc3RhbnQ4OgotICAgICAgICAud29yZCAgICAgIDB4NDNlMjI0ODAKLWNvbnN0YW50OToKLSAgICAgICAgLndvcmQgICAgICAweDczMzI2YjgwCi1jb25zdGFudDEwOgotICAgICAgICAud29yZCAgICAgIDB4NTJjYjBlODAKLWNvbnN0YW50MTE6Ci0gICAgICAgIC53b3JkICAgICAgMHg2NGUyNDAwMAotY29uc3RhbnQxMjoKLSAgICAgICAgLndvcmQgICAgICAweDUyMDM2NzgwCi1jb25zdGFudDEzOgotICAgICAgICAud29yZCAgICAgIDB4NDU0NWVhMDAKLWNvbnN0YW50MTQ6Ci0gICAgICAgIC53b3JkICAgICAgMHg1MzllYmE4MAotY29uc3RhbnQxNToKLSAgICAgICAgLndvcmQgICAgICAweDVhODI3OTgwCi1jb25zdGFudDE2OgotICAgICAgICAud29yZCAgICAgIENvc1RhYmxlX2RjdDMyICsgNjAKLQotCi0KLUNvc1RhYmxlX2RjdDMyOgotICAgICAgICAud29yZCAgICAgIDB4NDAxM2MyODAKLSAgICAgICAgLndvcmQgICAgICAweDQwYjM0NTgwCi0gICAgICAgIC53b3JkICAgICAgMHg0MWZhMmQ4MAotICAgICAgICAud29yZCAgICAgIDB4NDNmOTM0MDAKLSAgICAgICAgLndvcmQgICAgICAweDQ2Y2MxYzAwCi0gICAgICAgIC53b3JkICAgICAgMHg0YTlkOWQwMAotICAgICAgICAud29yZCAgICAgIDB4NGZhZTM3MDAKLSAgICAgICAgLndvcmQgICAgICAweDU2NjAxZTgwCi0gICAgICAgIC53b3JkICAgICAgMHg1ZjRjZjcwMAotICAgICAgICAud29yZCAgICAgIDB4NmI2ZmNmMDAK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UsW3IwLCAjMHgxNF0KLSAgICAgICAgbGRyICAgICAgcjcsW3IwLCAjMHhjXQotICAgICAgICBsZHIgICAgICByOSxbcjAsICMweDEwXQotICAgICAgICBhZGQgICAgICByNixyNSxyNwotICAgICAgICBzdWIgICAgICByNSxyNSxyNwotICAgICAgICBhZGQgICAgICByNyxyMSxyMTIKLSAgICAgICAgYWRkICAgICAgcjgscjkscjIKLSAgICAgICAgYWRkICAgICAgcjcscjcscjYKLSAgICAgICAgYWRkICAgICAgcjEwLHI3LHI4Ci0gICAgICAgIHJzYiAgICAgIHI3LHI4LHI3LGFzciAjMQotICAgICAgICBzdHIgICAgICByNyxbcjAsICMweDE4XQotICAgICAgICByc2IgICAgICByMixyOSxyMixhc3IgIzEKLSAgICAgICAgc3RyICAgICAgcjEwLFtyMF0KLSAgICAgICAgbGRyICAgICAgcjExLHxjb3NfMnBpXzl8Ci0gICAgICAgIHJzYiAgICAgIHI3LHIyLCMwCi0KLSAgICAgICAgbW92ICAgICAgcjkscjEsbHNsICMxCi0JCW1vdiAgICAgIHIxLHI5CQkJOzs7Ozs7ICAhISEhISEKLSAgICAgICAgbW92ICAgICAgcjgscjcKLQotOyAgICB2ZWNbNF0gID0gZnhwX21hYzMyX1EzMiggdmVjWzRdLCB0bXAwPDwxLCBjb3NfMnBpXzkpOyAKLQotICAgICAgICBzbWxhbCAgICByMSxyOCxyMTEscjkKLSAgICAgICAgbGRyICAgICAgcjEwLHxjb3NfNHBpXzl8Ci0gICAgICAgIGxkciAgICAgIHIxMSx8Y29zX3BpXzl8Ci0KLTsgICAgdmVjWzhdICA9IGZ4cF9tYWMzMl9RMzIoIHZlY1s4XSwgdG1wMDw8MSwgY29zXzRwaV85KTsKLQotICAgICAgICBzbWxhbCAgICByMSxyNyxyMTAscjkKLQotCi0KLTsgICAgdmVjWzJdICA9IGZ4cF9tYWMzMl9RMzIoIHZlY1syXSwgdG1wMDw8MSwgY29zX3BpXzkpOwotCi0gICAgICAgIHNtbGFsICAgIHI5LHIyLHIxMSxyOQotICAgICAgICBtb3YgICAgICByMSxyMTIsbHNsICMxCi0gICAgICAgIHJzYiAgICAgIHI5LHIxMCwjMAotICAgICAgICBsZHIgICAgICByMTEsfGNvc181cGlfOXwKLQotICAgICAgICBzbWxhbCAgICByMTIscjIscjkscjEKLQotCi0KLTsgICAgdmVjWzJdICA9IGZ4cF9tYWMzMl9RMzIoIHZlY1syXSwgdG1wMjw8MSwgY29zXzVwaV85KTsKLQotICAgICAgICBsZHIgICAgICByOSx8Y29zXzJwaV85fAotICAgICAgICBtb3YgICAgICByMTIscjEJCQk7Ozs7OzsgICEhISEhIQotICAgICAgICBzbWxhbCAgICByMTIscjgscjExLHIxCi0KLQotOyAgICB2ZWNbOF0gID0gZnhwX21hYzMyX1EzMiggdmVjWzhdLCB0bXAyPDwxLCBjb3NfMnBpXzkpOwotCi0gICAgICAgIHNtbGFsICAgIHIxLHI3LHI5LHIxCi0gICAgICAgIG1vdiAgICAgIHIxLHI2LGxzbCAjMQotICAgICAgICBzbWxhbCAgICByMTIscjcscjExLHIxCi0gICAgICAgIGFuZCAgICAgIHI2LHIxMCxyMTEsYXNyICMxNAotICAgICAgICBzbWxhbCAgICByMTIscjgscjYscjEKLSAgICAgICAgbGRyICAgICAgcjEwLHxjb3NfMTFwaV8xOHwKLSAgICAgICAgYWRkICAgICAgcjEyLHIxMSxyNgotICAgICAgICBzbWxhbCAgICByMSxyMixyMTIscjEKLSAgICAgICAgbGRyICAgICAgcjksfGNvc184cGlfOXwKLSAgICAgICAgc3RyICAgICAgcjIsW3IwLCM4XQotICAgICAgICBtb3YgICAgICByMSxyNSxsc2wgIzEKLQotOyAgICB2ZWNbOF0gID0gZnhwX21hYzMyX1EzMiggdmVjWzhdLCB0bXAzPDwxLCBjb3NfOHBpXzkpOwotCi0gICAgICAgIHNtdWxsICAgIHIyLHI2LHI5LHIxCi0gICAgICAgIHN0ciAgICAgIHI3LFtyMCwjMHgyMF0KLSAgICAgICAgbW92ICAgICAgcjIscjQsbHNsICMxCi0gICAgICAgIGxkciAgICAgIHI3LHxjb3NfMTNwaV8xOHwKLSAgICAgICAgc21sYWwgICAgcjEyLHI2LHIxMCxyMgotCi0gICAgICAgIG1vdiAgICAgIHIzLHIzLGxzbCAjMQotCi07ICAgIHZlY1s1XSAgPSBmeHBfbWFjMzJfUTMyKCB2ZWNbNV0sIHRtcDg8PDEsIGNvc18xM3BpXzE4KTsKLQotICAgICAgICBzbWxhbCAgICByMTIscjYscjcscjMKLSAgICAgICAgYWRkICAgICAgcjQscjUscjQKLSAgICAgICAgbW92ICAgICAgcjEyLGxyLGxzbCAjMQotICAgICAgICBzdWIgICAgICBscixyNCxscgotICAgICAgICBsZHIgICAgICByNyx8Y29zXzE3cGlfMTh8Ci0gICAgICAgIHN0ciAgICAgIHI4LFtyMCwgIzB4MTBdCi0gICAgICAgIGxkciAgICAgIHI0LHxjb3NfcGlfNnwKLQotICAgICAgICBtb3YgICAgICBscixscixsc2wgIzEKLQotOyAgICB2ZWNbMV0gID0gZnhwX21hYzMyX1EzMiggdmVjWzFdLCB0bXA4PDwxLCBjb3NfMTdwaV8xOCk7Ci0KLSAgICAgICAgc21sYWwgICAgcjgscjYscjcscjEyCi0KLTsgICAgdmVjWzNdICA9IGZ4cF9tdWwzMl9RMzIoKHRtcDUgKyB0bXA2ICAtIHRtcDgpPDwxLCBjb3NfcGlfNik7Ci0KLSAgICAgICAgc211bGwgICAgcjUsbHIscjQsbHIKLSAgICAgICAgc3RyICAgICAgcjYsW3IwLCAjNF0KLSAgICAgICAgc3RyICAgICAgbHIsW3IwLCAjMHhjXQotCi0KLTsgICAgdmVjWzVdICA9IGZ4cF9tdWwzMl9RMzIodG1wNTw8MSwgY29zXzE3cGlfMTgpOwotICAgICAgICBzbXVsbCAgICByNSxscixyNyxyMQotICAgICAgICByc2IgICAgICByNixyOSwjMAotOyAgICB2ZWNbNV0gID0gZnhwX21hYzMyX1EzMiggdmVjWzVdLCB0bXA2PDwxLCAgY29zXzdwaV8xOCk7Ci0gICAgICAgIHNtbGFsICAgIHI1LGxyLHI2LHIyCi07ICAgIHZlY1s1XSAgPSBmeHBfbWFjMzJfUTMyKCB2ZWNbNV0sIHRtcDc8PDEsICAgIGNvc19waV82KTsKLSAgICAgICAgc21sYWwgICAgcjUsbHIscjQscjMKLTsgICAgdmVjWzVdICA9IGZ4cF9tYWMzMl9RMzIoIHZlY1s1XSwgdG1wODw8MSwgY29zXzEzcGlfMTgpOwotICAgICAgICBzbWxhbCAgICByNSxscixyMTAscjEyCi0gICAgICAgIHN0ciAgICAgIGxyLFtyMCwgIzB4MTRdCi0gICAgICAgIHJzYiAgICAgIGxyLHIxMCwjMAotCi07ICAgIHZlY1s3XSAgPSBmeHBfbXVsMzJfUTMyKHRtcDU8PDEsIGNvc181cGlfMTgpOwotICAgICAgICBzbXVsbCAgICByNSxyMSxscixyMQotOyAgICB2ZWNbN10gID0gZnhwX21hYzMyX1EzMiggdmVjWzddLCB0bXA2PDwxLCBjb3NfMTdwaV8xOCk7Ci0gICAgICAgIHNtbGFsICAgIHIyLHIxLHI3LHIyCi07ICAgIHZlY1s3XSAgPSBmeHBfbWFjMzJfUTMyKCB2ZWNbN10sIHRtcDc8PDEsICAgIGNvc19waV82KTsKLSAgICAgICAgc21sYWwgICAgcjMscjEscjQscjMKLTsgICAgdmVjWzddICA9IGZ4cF9tYWMzMl9RMzIoIHZlY1s3XSwgdG1wODw8MSwgY29zXzExcGlfMTgpOwotICAgICAgICBzbWxhbCAgICByMTIscjEscjkscjEyCi0gICAgICAgIHN0ciAgICAgIHIxLFtyMCwgIzB4MWNdCi0gICAgICAgIGxkbWZkICAgIHNwISx7cjQtcjEwLHBjfQotfGNvc18ycGlfOXwKLSAgICAgICAgRENEICAgICAgMHg2MjBkYmU4MAotfGNvc180cGlfOXwKLSAgICAgICAgRENEICAgICAgMHgxNjNhMWE4MAotfGNvc19waV85fAotICAgICAgICBEQ0QgICAgICAweDc4NDdkOTAwCi18Y29zXzVwaV85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LS0tLS0tLS0KLQotLmFybQotCi0uYWxpZ24gNAotCi0udGV4dAotCi0KLUAtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0KLQotLmdsb2JhbCBwdm1wM19kY3RfOQotCi1wdm1wM19kY3RfOToKLSAgICAgICAgc3RtZmQgICAgc3AhLHtyNC1yMTEsbHJ9Ci0gICAgICAgIGxkciAgICAgIHIyLCBbcjAsICMweDIwXQotICAgICAgICBsZHIgICAgICByMywgW3IwLCAjMF0KLSAgICAgICAgbGRyICAgICAgcjEyLFtyMCwgIzRdCi0gICAgICAgIGFkZCAgICAgIHIxLHIyLHIzCi0gICAgICAgIHN1YiAgICAgIGxyLHIyLHIzCi0gICAgICAgIGxkciAgICAgIHIzLFtyMCwgIzB4MWNdCi0gICAgICAgIGxkciAgICAgIHI0LFtyMCwgIzB4MThdCi0gICAgICAgIGFkZCAgICAgIHIyLHIzLHIxMgotICAgICAgICBsZHIgICAgICByNSxbcjAsIzhdCi0gICAgICAgIHN1YiAgICAgIHIzLHIzLHIxMgotICAgICAgICBhZGQgICAgICByMTIscjQscjUKLSAgICAgICAgc3ViICAgICAgcjQscjQscjUKLSAgICAgICAgbGRyICAgICAgcjUsW3IwLCAjMHgxNF0KLSAgICAgICAgbGRyICAgICAgcjcsW3IwLCAjMHhjXQotICAgICAgICBsZHIgICAgICByOSxbcjAsICMweDEwXQotICAgICAgICBhZGQgICAgICByNixyNSxyNwotICAgICAgICBzdWIgICAgICByNSxyNSxyNwotICAgICAgICBhZGQgICAgICByNyxyMSxyMTIKLSAgICAgICAgYWRkICAgICAgcjgscjkscjIKLSAgICAgICAgYWRkICAgICAgcjcscjcscjYKLSAgICAgICAgYWRkICAgICAgcjEwLHI3LHI4Ci0gICAgICAgIHJzYiAgICAgIHI3LHI4LHI3LGFzciAjMQotICAgICAgICBzdHIgICAgICByNyxbcjAsICMweDE4XQotICAgICAgICByc2IgICAgICByMixyOSxyMixhc3IgIzEKLSAgICAgICAgc3RyICAgICAgcjEwLFtyMCwjMF0KLSAgICAgICAgbGRyICAgICAgcjExLGNvc18ycGlfOQotICAgICAgICByc2IgICAgICByNyxyMiwjMAotCi0gICAgICAgIGxkciAgICAgIHIxMCxjb3NfNHBpXzkKLSAgICAgICAgbW92ICAgICAgcjkscjEsbHNsICMxCi0gICAgICAgIG1vdiAgICAgIHI4LHI3Ci0KLUAgICAgdmVjWzRdICA9IGZ4cF9tYWMzMl9RMzIoIHZlY1s0XSwgdG1wMDw8MSwgY29zXzJwaV85KUAgCi0KLSAgICAgICAgc21sYWwgICAgcjEscjgscjExLHI5Ci0gICAgICAgIGxkciAgICAgIHIxMSxjb3NfcGlfOQotCQltb3YgICAgICByMSxyOQkJCUBAQEBAQCAgISEhISEhCi0KLUAgICAgdmVjWzhdICA9IGZ4cF9tYWMzMl9RMzIoIHZlY1s4XSwgdG1wMDw8MSwgY29zXzRwaV85KUAKLQotICAgICAgICBzbWxhbCAgICByMSxyNyxyMTAscjkKLQotICAgICAgICBtb3YgICAgICByMSxyMTIsbHNsICMxCi0KLQotQCAgICB2ZWNbMl0gID0gZnhwX21hYzMyX1EzMiggdmVjWzJdLCB0bXAwPDwxLCBjb3NfcGlfOSlACi0KLSAgICAgICAgc21sYWwgICAgcjkscjIscjExLHI5Ci0gICAgICAgIHJzYiAgICAgIHI5LHIxMCwjMAotICAgICAgICBsZHIgICAgICByMTEsY29zXzVwaV85Ci0KLSAgICAgICAgc21sYWwgICAgcjEyLHIyLHI5LHIxCi0KLQotCi1AICAgIHZlY1syXSAgPSBmeHBfbWFjMzJfUTMyKCB2ZWNbMl0sIHRtcDI8PDEsIGNvc181cGlfOSlACi0KLSAgICAgICAgbGRyICAgICAgcjksY29zXzJwaV85Ci0gICAgICAgIG1vdiAgICAgIHIxMixyMQkJCUBAQEBAQCAgISEhISEhCi0gICAgICAgIHNtbGFsICAgIHIxMixyOCxyMTEscjEKLQotCi1AICAgIHZlY1s4XSAgPSBmeHBfbWFjMzJfUTMyKCB2ZWNbOF0sIHRtcDI8PDEsIGNvc18ycGlfOSlACi0KLSAgICAgICAgc21sYWwgICAgcjEscjcscjkscjEKLSAgICAgICAgbW92ICAgICAgcjEscjYsbHNsICMxCi0gICAgICAgIHNtbGFsICAgIHIxMixyNyxyMTEscjEKLSAgICAgICAgYW5kICAgICAgcjYscjEwLHIxMSxhc3IgIzE0Ci0gICAgICAgIHNtbGFsICAgIHIxMixyOCxyNixyMQotICAgICAgICBsZHIgICAgICByMTAsY29zXzExcGlfMTgKLSAgICAgICAgYWRkICAgICAgcjEyLHIxMSxyNgotICAgICAgICBzbWxhbCAgICByMSxyMixyMTIscjEKLSAgICAgICAgbGRyICAgICAgcjksY29zXzhwaV85Ci0gICAgICAgIHN0ciAgICAgIHIyLFtyMCwjOF0KLSAgICAgICAgbW92ICAgICAgcjEscjUsbHNsICMxCi0KLUAgICAgdmVjWzhdICA9IGZ4cF9tYWMzMl9RMzIoIHZlY1s4XSwgdG1wMzw8MSwgY29zXzhwaV85KUAKLQotICAgICAgICBzbXVsbCAgICByMixyNixyOSxyMQotICAgICAgICBzdHIgICAgICByNyxbcjAsIzB4MjBdCi0gICAgICAgIG1vdiAgICAgIHIyLHI0LGxzbCAjMQotICAgICAgICBsZHIgICAgICByNyxjb3NfMTNwaV8xOAotICAgICAgICBzbWxhbCAgICByMTIscjYscjEwLHIyCi0KLSAgICAgICAgbW92ICAgICAgcjMscjMsbHNsICMxCi0KLUAgICAgdmVjWzVdICA9IGZ4cF9tYWMzMl9RMzIoIHZlY1s1XSwgdG1wODw8MSwgY29zXzEzcGlfMTgpQAotCi0gICAgICAgIHNtbGFsICAgIHIxMixyNixyNyxyMwotICAgICAgICBhZGQgICAgICByNCxyNSxyNAotICAgICAgICBtb3YgICAgICByMTIsbHIsbHNsICMxCi0gICAgICAgIHN1YiAgICAgIGxyLHI0LGxyCi0gICAgICAgIGxk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10gID0gZnhwX211bDMyX1EzMih0bXA1PDwxLCBjb3NfNXBpXzE4KUAKLSAgICAgICAgc211bGwgICAgcjUscjEsbHIscjEKLUAgICAgdmVjWzddICA9IGZ4cF9tYWMzMl9RMzIoIHZlY1s3XSwgdG1wNjw8MSwgY29zXzE3cGlfMTgpQAotICAgICAgICBzbWxhbCAgICByMixyMSxyNyxyMgotQCAgICB2ZWNbN10gID0gZnhwX21hYzMyX1EzMiggdmVjWzddLCB0bXA3PDwxLCAgICBjb3NfcGlfNilACi0gICAgICAgIHNtbGFsICAgIHIzLHIxLHI0LHIzCi1AICAgIHZlY1s3XSAgPSBmeHBfbWFjMzJfUTMyKCB2ZWNbN10sIHRtcDg8PDEsIGNvc18xMXBpXzE4KUAKLSAgICAgICAgc21sYWwgICAgcjEyLHIxLHI5LHIxMgotICAgICAgICBzdHIgICAgICByMSxbcjAsICMweDFjXQotICAgICAgICBsZG1mZCAgICBzcCEse3I0LXIxMSxwY30KLWNvc18ycGlfOToKLSAgICAgICAgLndvcmQgICAgICAweDYyMGRiZTgwCi1jb3NfNHBpXzk6Ci0gICAgICAgIC53b3JkICAgICAgMHgxNjNhMWE4MAotY29zX3BpXzk6Ci0gICAgICAgIC53b3JkICAgICAgMHg3ODQ3ZDkwMAotY29zXzVwaV85OgotICAgICAgICAud29yZCAgICAgIDB4ODdiODI3MDAKLWNvc184cGlfOToKLSAgICAgICAgLndvcmQgICAgICAweGQ0MzhhZjAwCi1jb3NfMTFwaV8xODoKLSAgICAgICAgLndvcmQgICAgICAweGFkYjkyMjgwCi1jb3NfMTNwaV8xODoKLSAgICAgICAgLndvcmQgICAgICAweDkxMjYxNDgwCi1jb3NfMTdwaV8xODoKLSAgICAgICAgLndvcmQgICAgICAweDgxZjFkMjAwCi1jb3NfcGlfNjoKLSAgICAgICAgLndvcmQgICAgICAweDZlZDllYjgwCi0KZGlmZiAtLWdpdCBhL21lZGlhL2xpYnN0YWdlZnJpZ2h0L2NvZGVjcy9tcDNkZWMv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0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0KLQotfHB2bXAzX21kY3RfMTh8IFBST0MKLSAgICAgICAgc3RtZmQgICAgc3AhLHtyNC1yMTAsbHJ9Ci0gICAgICAgIG1vdiAgICAgIHI3LHIyCi0gICAgICAgIGxkciAgICAgIHIyLHRhYmxlCi0gICAgICAgIG1vdiAgICAgIHI2LHIxCi0gICAgICAgIGFkZCAgICAgIHIzLHIyLCMweDI0Ci0gICAgICAgIGFkZCAgICAgIHIxMixyMywjMHg0NAotICAgICAgICBhZGQgICAgICByMSxyMCwjMHg0NAotICAgICAgICBtb3YgICAgICByNSxyMAotCi07ICAgIGZvciAoIGk9OTsgaSE9MDsgaS0tKQotOyAgICB7Ci0KLSAgICAgICAgbW92ICAgICAgcjQsIzkKLUxvb3BfMQotCi07ICAgICAgIHRtcCAgPSAqKHB0X3ZlYyk7Ci07CQl0bXAxID0gKihwdF92ZWNfbyk7Ci0KLSAgICAgICAgbGRyICAgICAgbHIsW3IwXQkJOzsgdG1wICA9PSBscgotICAgICAgICBsZHIgICAgICByOCxbcjNdLCM0CQk7OyB0bXAxID09IHI4Ci0KLTsgICAgICAgIHRtcCAgPSBmeHBfbXVsMzJfUTMyKCB0bXA8PDEsICAqKHB0X2NvcysrICApKTsKLTsgICAgICAgIHRtcDEgPSBmeHBfbXVsMzJfUTI3KCB0bXAxLCAqKHB0X2Nvc194LS0pKTsKLQotICAgICAgICBtb3YgICAgICBscixscixsc2wgIzEKLSAgICAgICAgc211bGwgICAgcjEwLGxyLHI4LGxyCi0gICAgICAgIGxkciAgICAgIHI4LFtyMTJdLCMtNAotICAgICAgICBsZHIgICAgICByOSxbcjFdCi0gICAgICAgIHN1YnMgICAgIHI0LHI0LCMxCi0gICAgICAgIHNtdWxsICAgIHI5LHIxMCxyOCxyOQotICAgICAgICBtb3YgICAgICByOCxyOSxsc3IgIzI3Ci0gICAgICAgIGFkZCAgICAgIHI4LHI4LHIxMCxsc2wgIzUKLQotOyAgICAgICAgKihwdF92ZWMrKykgICA9ICAgdG1wICsgdG1wMSA7Ci07ICAgICAgICAqKHB0X3ZlY19vLS0pID0gZnhwX211bDMyX1EyOCggKHRtcCAtIHRtcDEpLCAqKHB0X2Nvc19zcGxpdCsrKSk7Ci0KLSAgICAgICAgYWRkICAgICAgcjksbHIscjgKLSAgICAgICAgc3ViICAgICAgcjgsbHIscjgKLSAgICAgICAgbGRyICAgICAgbHIsW3IyXSwjNAotICAgICAgICBzdHIgICAgICByOSxbcjBdLCM0Ci0gICAgICAgIHNtdWxsICAgIHI4LHI5LGxyLHI4Ci0gICAgICAgIG1vdiAgICAgIGxyLHI4LGxzciAjMjgKLSAgICAgICAgYWRkICAgICAgbHIsbHIscjksbHNsICM0Ci0gICAgICAgIHN0ciAgICAgIGxyLFtyMV0sIy00Ci0gICAgICAgIGJuZSAgICAgIExvb3BfMQotCi07CQl9Ci0KLSAgICAgICAgbW92ICAgICAgcjAscjUJCQk7OyByMCA9IHZlYwotICAgICAgICBibCAgICAgICBwdm1wM19kY3RfOQotICAgICAgICBhZGQgICAgICByMCxyNSwjMHgyNAk7OyByMCA9ICZ2ZWNbOV0KLSAgICAgICAgYmwgICAgICAgcHZtcDNfZGN0XzkKLQotICAgICAgICBsZHIgICAgICByMCxbcjUsIzB4MjBdCi0gICAgICAgIGxkciAgICAgIHIyLFtyNSwjMHg0MF0KLSAgICAgICAgc3RyICAgICAgcjAsW3I1LCMweDQwXQotICAgICAgICBsZHIgICAgICByMCxbcjUsIzB4MWNdCi0gICAgICAgIGxkciAgICAgIHIzLFtyNSwjMHgzOF0KLSAgICAgICAgc3RyICAgICAgcjAsW3I1LCMweDM4XQotICAgICAgICBsZHIgICAgICByMSxbcjUsIzB4MThdCi0gICAgICAgIGxkciAgICAgIHIwLFtyNSwjMHgzMF0KLSAgICAgICAgc3RyICAgICAgcjEsW3I1LCMweDMwXQotICAgICAgICBsZHIgICAgICByMTIsW3I1LCMweDE0XQotICAgICAgICBsZHIgICAgICByMSxbcjUsIzB4MjhdCi0gICAgICAgIHN0ciAgICAgIHIxMixbcjUsIzB4MjhdCi0gICAgICAgIGxkciAgICAgIHIxMixbcjUsIzB4MTBdCi0gICAgICAgIHN0ciAgICAgIHIxMixbcjUsIzB4MjBdCi0gICAgICAgIGxkciAgICAgIHIxMixbcjUsIzB4Y10KLSAgICAgICAgc3RyICAgICAgcjEyLFtyNSwjMHgxOF0KLSAgICAgICAgbGRyICAgICAgcjEyLFtyNSwjOF0KLSAgICAgICAgc3RyICAgICAgcjEyLFtyNSwjMHgxMF0KLSAgICAgICAgbGRyICAgICAgcjEyLFtyNSwjNF0KLSAgICAgICAgc3RyICAgICAgcjEyLFtyNSwjOF0KLSAgICAgICAgbGRyICAgICAgcjEyLFtyNSwjMHgyNF0KLSAgICAgICAgc3ViICAgICAgcjEyLHIxMixyMQotICAgICAgICBzdHIgICAgICByMTIsW3I1LCM0XQotICAgICAgICBsZHIgICAgICByMTIsW3I1LCMweDJjXQotICAgICAgICBzdWIgICAgICByMSxyMTIscjEKLSAgICAgICAgc3RyICAgICAgcjEsW3I1LCMweGNdCi0gICAgICAgIHN1YiAgICAgIHIxLHIxMixyMAotICAgICAgICBzdHIgICAgICByMSxbcjUsIzB4MTRdCi0gICAgICAgIGxkciAgICAgIHIxLFtyNSwjMHgzNF0KLSAgICAgICAgc3ViICAgICAgcjAscjEscjAKLSAgICAgICAgc3RyICAgICAgcjAsW3I1LCMweDFjXQotICAgICAgICBzdWIgICAgICByMCxyMSxyMwotICAgICAgICBzdHIgICAgICByMCxbcjUsIzB4MjRdCi0gICAgICAgIGxkciAgICAgIHIxLFtyNSwjMHgzY10KLSAgICAgICAgc3ViICAgICAgcjMscjEscjMKLSAgICAgICAgc3ViICAgICAgcjEscjEscjIKLSAgICAgICAgc3RyICAgICAgcjEsW3I1LCMweDM0XQotICAgICAgICBzdHIgICAgICByMyxbcjUsIzB4MmNdCi0gICAgICAgIGxkciAgICAgIHIxLFtyNSwjMHg0NF0KLSAgICAgICAgc3ViICAgICAgcjEscjEscjIKLSAgICAgICAgc3RyICAgICAgcjEsW3I1LCMweDNjXQotICAgICAgICBsZHIgICAgICByMTIsW3I1LCMwXQotCi1Mb29wXzIKLSAgICAgICAgYWRkICAgICAgcjEscjUscjQsbHNsICMyCi0gICAgICAgIGxkciAgICAgIHIyLFtyMSwjMHgyOF0KLSAgICAgICAgbGRyICAgICAgcjMsW3I2LHI0LGxzbCAjMl0KLSAgICAgICAgYWRkICAgICAgcjAscjAscjIKLSAgICAgICAgc3RyICAgICAgcjAsW3IxLCMweDI4XQotICAgICAgICBsZHIgICAgICBscixbcjcscjQsbHNsICMyXQotICAgICAgICBsZHIgICAgICByMSxbcjEsIzRdCi0gICAgICAgIHNtbGFsICAgIHIwLHIzLGxyLHIwCi0gICAgICAgIG1vdiAgICAgIHIwLHIyCi0gICAgICAgIGFkZCAgICAgIHIyLHIxMixyMQotICAgICAgICByc2IgICAgICByMixyMiwjMAotICAgICAgICBzdHIgICAgICByMyxbcjUscjQsbHNsICMyXQotICAgICAgICBzdHIgICAgICByMixbcjYscjQsbHNsICMyXQotICAgICAgICBhZGQgICAgICByNCxyNCwjMQotICAgICAgICBjbXAgICAgICByNCwjNgotICAgICAgICBtb3YgICAgICByMTIscjEKLQotICAgICAgICBibHQgICAgICBMb29wXzIKLQotICAgICAgICBsZHIgICAgICByMSxbcjUsIzB4NDBdCi0gICAgICAgIGxkciAgICAgIHIyLFtyNiwjMHgxOF0KLSAgICAgICAgYWRkICAgICAgcjMscjAscjEKLSAgICAgICAgc3RyICAgICAgcjMsW3I1LCMweDQwXQotICAgICAgICBsZHIgICAgICBscixbcjcscjQsbHNsICMyXQotICAgICAgICBtb3YgICAgICByMyxyMyxsc2wgIzEKLSAgICAgICAgbGRyICAgICAgcjAsW3I1LCMweDFjXQotICAgICAgICBzbWxhbCAgICByMyxyMixscixyMwotICAgICAgICBhZGQgICAgICByMyxyMTIscjAKLSAgICAgICAgc3RyICAgICAgcjIsW3I1LCMweDE4XQotICAgICAgICBsZHIgICAgICByMixbcjYsIzB4MWNdCi0gICAgICAgIHJzYiAgICAgIHIzLHIzLCMwCi0gICAgICAgIHN0ciAgICAgIHIzLFtyNiwjMHgxOF0KLSAgICAgICAgbGRyICAgICAgcjMsW3I1LCMweDIwXQotICAgICAgICBhZGQgICAgICByMCxyMyxyMAotICAgICAgICByc2IgICAgICByMCxyMCwjMAotICAgICAgICBzdHIgICAgICByMCxbcjYsIzB4MWNdCi0gICAgICAgIGxkciAgICAgIHIzLFtyNSwjMHg0NF0KLSAgICAgICAgbGRyICAgICAgcjAsW3I2LCMweDIwXQotICAgICAgICBhZGQgICAgICByMyxyMyxyMQotICAgICAgICBtb3YgICAgICByMSxyMgotICAgICAgICBsZHIgICAgICByMTAsW3I3LCMweDFjXQotICAgICAgICBtb3YgICAgICByMixyMyxsc2wgIzEKLSAgICAgICAgc21sYWwgICAgcjEyLHIxLHIxMCxyMgotICAgICAgICBzdHIgICAgICByMSxbcjUsIzB4MWNdCi0gICAgICAgIGxkciAgICAgIHIxLFtyNSwjMHgyMF0KLSAgICAgICAgbGRyICAgICAgcjMsW3I1LCMweDI0XQotICAgICAgICBhZGQgICAgICByMSxyMSxyMwotICAgICAgICByc2IgICAgICByMSxyMSwjMAotICAgICAgICBzdHIgICAgICByMSxbcjYsIzB4MjBdCi0gICAgICAgIGxkciAgICAgIHIxLFtyNSwjMHg0NF0KLSAgICAgICAgbGRyICAgICAgcjMsW3I3LCMweDIwXQotICAgICAgICBtb3YgICAgICByMSxyMSxsc2wgIzEKLSAgICAgICAgc21sYWwgICAgcjEyLHIwLHIzLHIxCi0gICAgICAgIGxkciAgICAgIGxyLFtyNywjMHgyNF0KLSAgICAgICAgbGRyICAgICAgcjMsW3I2LCMweDI0XQotICAgICAgICBzdHIgICAgICByMCxbcjUsIzB4MjBdCi0gICAgICAgIHNtbGFsICAgIHIxLHIzLGxyLHIxCi0gICAgICAgIGxkciAgICAgIHIwLFtyNiwjMHg0MF0KLSAgICAgICAgbGRyICAgICAgcjEyLFtyNiwjMHg0NF0KLSAgICAgICAgc3RyICAgICAgcjMsW3I1LCMweDI0XQotICAgICAgICBsZHIgICAgICByMSxbcjUsIzB4MjhdCi0gICAgICAgIGxkciAgICAgIHIzLFtyNywjMHg0NF0KLSAgICAgICAgbW92ICAgICAgcjEscjEsbHNsICMxCi0gICAgICAgIHNtbGFsICAgIHIxLHIxMixyMyxyMQotICAgICAgICBsZHIgICAgICByMSxbcjUsIzB4NDBdCi0gICAgICAgIHN0ciAgICAgIHIxMixbcjUsIzB4NDRdCi0gICAgICAgIHJzYiAgICAgIHI4LHIxLCMwCi0gICAgICAgIHN0ciAgICAgIHI4LFtyNSwjMHgyOF0KLSAgICAgICAgbGRyICAgICAgcjEsW3I1LCMweDJjXQotICAgICAgICBsZHIgICAgICByMyxbcjcsIzB4NDBdCi0gICAgICAgIG1vdiAgICAgIHIxLHIxLGxzbCAjMQotICAgICAgICBzbWxhbCAgICByMSxyMCxyMyxyMQotICAgICAgICBzdHIgICAgICByMCxbcjUsIzB4NDBdCi0gICAgICAgIGxkciAgICAgIHIwLFtyNSwjMHgzY10KLSAgICAgICAgbGRyICAgICAgcjEsW3I2LCMweDM4XQotICAgICAgICBsZHIgICAgICByMyxbcjYsIzB4M2NdCi0gICAgICAgIHJzYiAgICAgIHI5LHIwLCMwCi0gICAgICAgIHN0ciAgICAgIHI5LFtyNSwjMHgyY10KLSAgICAgICAgbGRyICAgICAgcjAsW3I1LCMweDMwXQotICAgICAgICBsZHIgICAgICByMTIsW3I3LCMweDNjXQotICAgICAgICBtb3YgICAgICByMCxyMCxsc2wgIzEKLSAgICAgICAgc21sYWwgICAgcjAscjMscjEyLHIwCi0gICAgICAgIHN0ciAgICAgIHIzLFtyNSwjMHgzY10KLSAgICAgICAgbGRyICAgICAgcjAsW3I1LCMweDM4XQotICAgICAgICByc2IgICAgICByMCxyMCwjMAotICAgICAgICBzdHIgICAgICByMCxbcjUsIzB4MzBdCi0gICAgICAgIGxkciAgICAgIHIzLFtyNSwjMHgzNF0KLSAgICAgICAgbGRyICAgICAgcjEyLFtyNywjMHgzOF0KLSAgICAgICAgbW92ICAgICAgcjMscjMsbHNsICMxCi0gICAgICAgIHNtbGFsICAgIHIzLHIxLHIxMixyMwotICAgICAgICBtb3YgICAgICByMCxyMCxsc2wgIzEKLSAgICAgICAgc3RyICAgICAgcjEsW3I1LCMweDM4XQotICAgICAgICBsZHIgICAgICByNCxbcjcsIzB4MzRdCi0gICAgICAgIGxkciAgICAgIHIxLFtyNiwjMHgzNF0KLSAgICAgICAgbGRyICAgICAgcjMsW3I2LCMweDMwXQotICAgICAgICBzbWxhbCAgICByMCxyMSxyNCxyMAotICAgICAgICBsZHIgICAgICByMTIsW3I2LCMweDJjXQotICAgICAgICBsZHIgICAgICBscixbcjYsIzB4MjhdCi0gICAgICAgIHN0ciAgICAgIHIxLFtyNSwjMHgzNF0KLSAgICAgICAgbGRyICAgICAgcjEsW3I3LCMweDMwXQotICAgICAgICBtb3YgICAgICByMCxyOSxsc2wgIzEKLSAgICAgICAgc21sYWwgICAgcjAscjMscjEscjAKLSAgICAgICAgbW92ICAgICAgcjAscjgsbHNsICMxCi0gICAgICAgIGxkciAgICAgIHIxLFtyNywjMHgyY10KLSAgICAgICAgc3RyICAgICAgcjMsW3I1LCMweDMwXQotICAgICAgICBzbWxhbCAgICByMCxyMTIscjEscjAKLSAgICAgICAgbGRyICAgICAgcjAsW3I3LCMweDI4XQotICAgICAgICBzdHIgICAgICByMTIsW3I1LCMweDJjXQotICAgICAgICBzbWxhbCAgICByMixscixyMCxyMgotICAgICAgICBzdHIgICAgICBscixbcjUsIzB4MjhdCi0gICAgICAgIGxkciAgICAgIHIxLFtyNiwjNF0KLSAgICAgICAgbGRyICAgICAgcjEyLFtyNywjMHg0OF0KLSAgICAgICAgbW92ICAgICAgcjIscjEsbHNsICMxCi0gICAgICAgIGxkciAgICAgIHIxLFtyNiwjMHgyMF0KLSAgICAgICAgbGRyICAgICAgcjAsW3I2XQotICAgICAgICBtb3YgICAgICByMSxyMSxsc2wgIzEKLSAgICAgICAgc211bGwgICAgcjQsbHIscjEyLHIxCi0gICAgICAgIGxkciAgICAgIHIzLFtyNiwjMHgxY10KLSAgICAgICAgc3RyICAgICAgbHIsW3I2XQotICAgICAgICBsZHIgICAgICByMTIsW3I3LCMweDRjXQotICAgICAgICBtb3YgICAgICByMyxyMyxsc2wgIzEKLSAgICAgICAgc211bGwgICAgcjQsbHIscjEyLHIzCi0gICAgICAgIG1vdiAgICAgIHIwLHIwLGxzbCAjMQotICAgICAgICBsZHIgICAgICByMTIsW3I3LCMweDY0XQotICAgICAgICBzdHIgICAgICBscixbcjYsIzRdCi0gICAgICAgIHNtdWxsICAgIHI0LGxyLHIxMixyMgotICAgICAgICBsZHIgICAgICByMTIsW3I3LCMweDY4XQotICAgICAgICBzdHIgICAgICBscixbcjYsIzB4MWNdCi0gICAgICAgIHNtdWxsICAgIHI0LGxyLHIxMixyMAotICAgICAgICBsZHIgICAgICByMTIsW3I3LCMweDZjXQotICAgICAgICBzdHIgICAgICBscixbcjYsIzB4MjBdCi0gICAgICAgIHNtdWxsICAgIGxyLHIwLHIxMixyMAotICAgICAgICBsZHIgICAgICByMTIsW3I3LCMweDcwXQotICAgICAgICBzdHIgICAgICByMCxbcjYsIzB4MjRdCi0gICAgICAgIHNtdWxsICAgIHIwLHIyLHIxMixyMgotICAgICAgICBsZHIgICAgICByMCxbcjcsIzB4ODhdCi0gICAgICAgIHN0ciAgICAgIHIyLFtyNiwjMHgyOF0KLSAgICAgICAgc211bGwgICAgcjMscjIscjAscjMKLSAgICAgICAgbGRyICAgICAgcjAsW3I3LCMweDhjXQotICAgICAgICBzdHIgICAgICByMixbcjYsIzB4NDBdCi0gICAgICAgIHNtdWxsICAgIHIyLHIxLHIwLHIxCi0gICAgICAgIHN0ciAgICAgIHIxLFtyNiwjMHg0NF0KLSAgICAgICAgbGRyICAgICAgcjAsW3I2LCMweDE4XQotICAgICAgICBsZHIgICAgICBscixbcjcsIzB4NTBdCi0gICAgICAgIG1vdiAgICAgIHIxLHIwLGxzbCAjMQotICAgICAgICBsZHIgICAgICByMCxbcjYsIzB4MTRdCi0gICAgICAgIHNtdWxsICAgIHI1LHI0LGxyLHIxCi0gICAgICAgIGxkciAgICAgIHIxMixbcjYsIzB4MTBdCi0gICAgICAgIG1vdiAgICAgIHIzLHIwLGxzbCAjMQotICAgICAgICBsZHIgICAgICByMCxbcjYsIzB4Y10KLSAgICAgICAgbW92ICAgICAgcjEyLHIxMixsc2wgIzEKLSAgICAgICAgbW92ICAgICAgcjIscjAsbHNsICMxCi0gICAgICAgIGxkciAgICAgIHIwLFtyNiwjOF0KLSAgICAgICAgc3RyICAgICAgcjQsW3I2LCM4XQotICAgICAgICBsZHIgICAgICBscixbcjcsIzB4NTRdCi0gICAgICAgIG1vdiAgICAgIHIwLHIwLGxzbCAjMQotICAgICAgICBzbXVsbCAgICByNSxyNCxscixyMwotICAgICAgICBsZHIgICAgICBscixbcjcsIzB4NThdCi0gICAgICAgIHN0ciAgICAgIHI0LFtyNiwjMHhjXQotICAgICAgICBzbXVsbCAgICByNSxyNCxscixyMTIKLSAgICAgICAgbGRyICAgICAgbHIsW3I3LCMweDVjXQotICAgICAgICBzdHIgICAgICByNCxbcjYsIzB4MTBdCi0gICAgICAgIHNtdWxsICAgIHI1LHI0LGxyLHIyCi0gICAgICAgIGxkciAgICAgIGxyLFtyNywjMHg2MF0KLSAgICAgICAgc3RyICAgICAgcjQsW3I2LCMweDE0XQotICAgICAgICBzbXVsbCAgICByNSxyNCxscixyMAotICAgICAgICBsZHIgICAgICBscixbcjcsIzB4NzRdCi0gICAgICAgIHN0ciAgICAgIHI0LFtyNiwjMHgxOF0KLSAgICAgICAgc211bGwgICAgcjQscjAsbHIscjAKLSAgICAgICAgbGRyICAgICAgbHIsW3I3LCMweDc4XQotICAgICAgICBzdHIgICAgICByMCxbcjYsIzB4MmNdCi0gICAgICAgIHNtdWxsICAgIHIwLHIyLGxyLHIyCi0gICAgICAgIGxkciAgICAgIHIwLFtyNywjMHg3Y10KLSAgICAgICAgc3RyICAgICAgcjIsW3I2LCMweDMwXQotICAgICAgICBzbXVsbCAgICByMTIscjIscjAscjEyCi0gICAgICAgIGxkciAgICAgIHIwLFtyNywjMHg4MF0KLSAgICAgICAgc3RyICAgICAgcjIsW3I2LCMweDM0XQotICAgICAgICBzbXVsbCAgICByMyxyMixyMCxyMwotICAgICAgICBsZHIgICAgICByMCxbcjcsIzB4ODRdCi0gICAgICAgIHN0ciAgICAgIHIyLFtyNiwjMHgzOF0KLSAgICAgICAgc211bGwgICAgcjIscjEscjAscjEKLSAgICAgICAgc3RyICAgICAgcjEsW3I2LCMweDNjXQotICAgICAgICBsZG1mZCAgICBzcCEse3I0LXIxMCxwY30KLXRhYmxlCi0gICAgICAgIERDRCAgICAgIHx8LmNvbnN0ZGF0YSQxfHwKLSAgICAgICAgRU5EUAotCi07LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tCi0KLSBBUkVBIHwuY29uc3RkYXRhfCwgREFUQSwgUkVBRE9OTFksIEFMSUdOPTIKLQotOy0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLQotCi18fC5jb25zdGRhdGEkMXx8Ci1jb3NUZXJtc19kY3QxOAotICAgICAgICBEQ0QgICAgICAweDA4MDdkMmIwCi0gICAgICAgIERDRCAgICAgIDB4MDg0ODNlZTAKLSAgICAgICAgRENEICAgICAgMHgwOGQzYjdkMAotICAgICAgICBEQ0QgICAgICAweDA5YzQyNTcwCi0gICAgICAgIERDRCAgICAgIDB4MGI1MDRmMzAKLSAgICAgICAgRENEICAgICAgMHgwZGYyOTQ0MAotICAgICAgICBEQ0QgICAgICAweDEyZWRmYjIwCi0gICAgICAgIERDRCAgICAgIDB4MWVlOGRkNDAKLSAgICAgICAgRENEICAgICAgMHg1YmNhMmEwMAotY29zVGVybXNfMV9vdl9jb3NfcGhpCi0gICAgICAgIERDRCAgICAgIDB4NDAwZjljMDAKLSAgICAgICAgRENEICAgICAgMHg0MDhkNjA4MAotICAgICAgICBEQ0QgICAgICAweDQxOGRjYjgwCi0gICAgICAgIERDRCAgICAgIDB4NDMxYjFhMDAKLSAgICAgICAgRENEICAgICAgMHg0NTQ1ZWEwMAotICAgICAgICBEQ0QgICAgICAweDQ4MjcwNjgwCi0gICAgICAgIERDRCAgICAgIDB4NGJlMjU0ODAKLSAgICAgICAgRENEICAgICAgMHg1MGFiOTQ4MAotICAgICAgICBEQ0QgICAgICAweDU2Y2U0ZDgwCi0gICAgICAgIERDRCAgICAgIDB4MDVlYmI2MzAKLSAgICAgICAgRENEICAgICAgMHgwNjkyMWE5OAotICAgICAgICBEQ0QgICAgICAweDA3NzFkM2E4Ci0gICAgICAgIERDRCAgICAgIDB4MDhhOWE4MzAKLSAgICAgICAgRENEICAgICAgMHgwYTczZDc1MAotICAgICAgICBEQ0QgICAgICAweDBkNGQ1MjYwCi0gICAgICAgIERDRCAgICAgIDB4MTI3YjFjYTAKLSAgICAgICAgRENEICAgICAgMHgxZWE1MmI0MAotICAgICAgICBEQ0QgICAgICAweDViYjNjYzgwCi0KLQotCi0gICAgICAgIEVORApkaWZmIC0tZ2l0IGEvbWVkaWEvbGlic3RhZ2VmcmlnaHQvY29kZWNzL21wM2RlYy9zcmMvYXNtL3B2bXAzX21kY3RfMThfZ2NjLnMgYi9tZWRpYS9saWJzdGFnZWZyaWdodC9jb2RlY3MvbXAzZGVjL3NyYy9hc20vcHZtcDNfbWRjdF8xOF9nY2MucwpkZWxldGVkIGZpbGUgbW9kZSAxMDA2NDQKaW5kZXggOTYyMzBjNS4uMDA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wXzE6Ci0KLUAgICAgICAgdG1wICA9ICoocHRfdmVjKQotQAkJdG1wMSA9ICoocHRfdmVjX28pCi0KLSAgICAgICAgbGRyICAgICAgbHIsW3IwXQkJQEAgdG1wICA9PSBscgotICAgICAgICBsZHIgICAgICByOCxbcjNdLCM0CQlAQCB0bXAxID09IHI4Ci0KLUAgICAgICAgIHRtcCAgPSBmeHBfbXVsMzJfUTMyKCB0bXA8PDEsICAqKHB0X2NvcysrICApKQotQCAgICAgICAgdG1wMSA9IGZ4cF9tdWwzMl9RMjcoIHRtcDEsICoocHRfY29zX3gtLSkpCi0KLSAgICAgICAgbW92ICAgICAgbHIsbHIsbHNsICMxCi0gICAgICAgIHNtdWxsICAgIHIxMCxscixyOCxscgotICAgICAgICBsZHIgICAgICByOCxbcjEyXSwjLTQKLSAgICAgICAgbGRyICAgICAgcjksW3IxXQotICAgICAgICBzdWJzICAgICByNCxyNCwjMQotICAgICAgICBzbXVsbCAgICByOSxyMTAscjgscjkKLSAgICAgICAgbW92ICAgICAgcjgscjksbHNyICMyNwotICAgICAgICBhZGQgICAgICByOCxyOCxyMTAsbHNsICM1Ci0KLUAgICAgICAgICoocHRfdmVjKyspICAgPSAgIHRtcCArIHRtcDEgCi1AICAgICAgICAqKHB0X3ZlY19vLS0pID0gZnhwX211bDMyX1EyOCggKHRtcCAtIHRtcDEpLCAqKHB0X2Nvc19zcGxpdCsrKSkKLQotICAgICAgICBhZGQgICAgICByOSxscixyOAotICAgICAgICBzdWIgICAgICByOCxscixyOAotICAgICAgICBsZHIgICAgICBscixbcjJdLCM0Ci0gICAgICAgIHN0ciAgICAgIHI5LFtyMF0sIzQKLSAgICAgICAgc211bGwgICAgcjgscjksbHIscjgKLSAgICAgICAgbW92ICAgICAgbHIscjgsbHNyICMyOAotICAgICAgICBhZGQgICAgICBscixscixyOSxsc2wgIzQKLSAgICAgICAgc3RyICAgICAgbHIsW3IxXSwjLTQKLSAgICAgICAgYm5lICAgICAgTG9vcF8xCi0KLUAJCX0KLQotICAgICAgICBtb3YgICAgICByMCxyNQkJCUBAIHIwID0gdmVjCi0gICAgICAgIGJsICAgICAgIHB2bXAzX2RjdF85Ci0gICAgICAgIGFkZCAgICAgIHIwLHI1LCMweDI0CUBAIHIwID0gJnZlY1s5XQotICAgICAgICBibCAgICAgICBwdm1wM19kY3RfOQotCi0gICAgICAgIGxkciAgICAgIHIwLFtyNSwjMHgyMF0KLSAgICAgICAgbGRyICAgICAgcjIsW3I1LCMweDQwXQotICAgICAgICBzdHIgICAgICByMCxbcjUsIzB4NDBdCi0gICAgICAgIGxkciAgICAgIHIwLFtyNSwjMHgxY10KLSAgICAgICAgbGRyICAgICAgcjMsW3I1LCMweDM4XQotICAgICAgICBzdHIgICAgICByMCxbcjUsIzB4MzhdCi0gICAgICAgIGxkciAgICAgIHIxLFtyNSwjMHgxOF0KLSAgICAgICAgbGRyICAgICAgcjAsW3I1LCMweDMwXQotICAgICAgICBzdHIgICAgICByMSxbcjUsIzB4MzBdCi0gICAgICAgIGxkciAgICAgIHIxMixbcjUsIzB4MTRdCi0gICAgICAgIGxkciAgICAgIHIxLFtyNSwjMHgyOF0KLSAgICAgICAgc3RyICAgICAgcjEyLFtyNSwjMHgyOF0KLSAgICAgICAgbGRyICAgICAgcjEyLFtyNSwjMHgxMF0KLSAgICAgICAgc3RyICAgICAgcjEyLFtyNSwjMHgyMF0KLSAgICAgICAgbGRyICAgICAgcjEyLFtyNSwjMHhjXQotICAgICAgICBzdHIgICAgICByMTIsW3I1LCMweDE4XQotICAgICAgICBsZHIgICAgICByMTIsW3I1LCM4XQotICAgICAgICBzdHIgICAgICByMTIsW3I1LCMweDEwXQotICAgICAgICBsZHIgICAgICByMTIsW3I1LCM0XQotICAgICAgICBzdHIgICAgICByMTIsW3I1LCM4XQotICAgICAgICBsZHIgICAgICByMTIsW3I1LCMweDI0XQotICAgICAgICBzdWIgICAgICByMTIscjEyLHIxCi0gICAgICAgIHN0ciAgICAgIHIxMixbcjUsIzRdCi0gICAgICAgIGxkciAgICAgIHIxMixbcjUsIzB4MmNdCi0gICAgICAgIHN1YiAgICAgIHIxLHIxMixyMQotICAgICAgICBzdHIgICAgICByMSxbcjUsIzB4Y10KLSAgICAgICAgc3ViICAgICAgcjEscjEyLHIwCi0gICAgICAgIHN0ciAgICAgIHIxLFtyNSwjMHgxNF0KLSAgICAgICAgbGRyICAgICAgcjEsW3I1LCMweDM0XQotICAgICAgICBzdWIgICAgICByMCxyMSxyMAotICAgICAgICBzdHIgICAgICByMCxbcjUsIzB4MWNdCi0gICAgICAgIHN1YiAgICAgIHIwLHIxLHIzCi0gICAgICAgIHN0ciAgICAgIHIwLFtyNSwjMHgyNF0KLSAgICAgICAgbGRyICAgICAgcjEsW3I1LCMweDNjXQotICAgICAgICBzdWIgICAgICByMyxyMSxyMwotICAgICAgICBzdWIgICAgICByMSxyMSxyMgotICAgICAgICBzdHIgICAgICByMSxbcjUsIzB4MzRdCi0gICAgICAgIHN0ciAgICAgIHIzLFtyNSwjMHgyY10KLSAgICAgICAgbGRyICAgICAgcjEsW3I1LCMweDQ0XQotICAgICAgICBzdWIgICAgICByMSxyMSxyMgotICAgICAgICBzdHIgICAgICByMSxbcjUsIzB4M2NdCi0gICAgICAgIGxkciAgICAgIHIxMixbcjUsIzBdCi0KLUxvb3BfMjoKLSAgICAgICAgYWRkICAgICAgcjEscjUscjQsbHNsICMyCi0gICAgICAgIGxkciAgICAgIHIyLFtyMSwjMHgyOF0KLSAgICAgICAgbGRyICAgICAgcjMsW3I2LHI0LGxzbCAjMl0KLSAgICAgICAgYWRkICAgICAgcjAscjAscjIKLSAgICAgICAgc3RyICAgICAgcjAsW3IxLCMweDI4XQotICAgICAgICBsZHIgICAgICBscixbcjcscjQsbHNsICMyXQotICAgICAgICBsZHIgICAgICByMSxbcjEsIzRdCi0gICAgICAgIHNtbGFsICAgIHIwLHIzLGxyLHIwCi0gICAgICAgIG1vdiAgICAgIHIwLHIyCi0gICAgICAgIGFkZCAgICAgIHIyLHIxMixyMQotICAgICAgICByc2IgICAgICByMixyMiwjMAotICAgICAgICBzdHIgICAgICByMyxbcjUscjQsbHNsICMyXQotICAgICAgICBzdHIgICAgICByMixbcjYscjQsbHNsICMyXQotICAgICAgICBhZGQgICAgICByNCxyNCwjMQotICAgICAgICBjbXAgICAgICByNCwjNgotICAgICAgICBtb3YgICAgICByMTIscjEKLQotICAgICAgICBibHQgICAgICBMb29wXzIKLQotICAgICAgICBsZHIgICAgICByMSxbcjUsIzB4NDBdCi0gICAgICAgIGxkciAgICAgIHIyLFtyNiwjMHgxOF0KLSAgICAgICAgYWRkICAgICAgcjMscjAscjEKLSAgICAgICAgc3RyICAgICAgcjMsW3I1LCMweDQwXQotICAgICAgICBsZHIgICAgICBscixbcjcscjQsbHNsICMyXQotICAgICAgICBtb3YgICAgICByMyxyMyxsc2wgIzEKLSAgICAgICAgbGRyICAgICAgcjAsW3I1LCMweDFjXQotICAgICAgICBzbWxhbCAgICByMyxyMixscixyMwotICAgICAgICBhZGQgICAgICByMyxyMTIscjAKLSAgICAgICAgc3RyICAgICAgcjIsW3I1LCMweDE4XQotICAgICAgICBsZHIgICAgICByMixbcjYsIzB4MWNdCi0gICAgICAgIHJzYiAgICAgIHIzLHIzLCMwCi0gICAgICAgIHN0ciAgICAgIHIzLFtyNiwjMHgxOF0KLSAgICAgICAgbGRyICAgICAgcjMsW3I1LCMweDIwXQotICAgICAgICBhZGQgICAgICByMCxyMyxyMAotICAgICAgICByc2IgICAgICByMCxyMCwjMAotICAgICAgICBzdHIgICAgICByMCxbcjYsIzB4MWNdCi0gICAgICAgIGxkciAgICAgIHIzLFtyNSwjMHg0NF0KLSAgICAgICAgbGRyICAgICAgcjAsW3I2LCMweDIwXQotICAgICAgICBhZGQgICAgICByMyxyMyxyMQotICAgICAgICBtb3YgICAgICByMSxyMgotICAgICAgICBsZHIgICAgICByMTAsW3I3LCMweDFjXQotICAgICAgICBtb3YgICAgICByMixyMyxsc2wgIzEKLSAgICAgICAgc21sYWwgICAgcjEyLHIxLHIxMCxyMgotICAgICAgICBzdHIgICAgICByMSxbcjUsIzB4MWNdCi0gICAgICAgIGxkciAgICAgIHIxLFtyNSwjMHgyMF0KLSAgICAgICAgbGRyICAgICAgcjMsW3I1LCMweDI0XQotICAgICAgICBhZGQgICAgICByMSxyMSxyMwotICAgICAgICByc2IgICAgICByMSxyMSwjMAotICAgICAgICBzdHIgICAgICByMSxbcjYsIzB4MjBdCi0gICAgICAgIGxkciAgICAgIHIxLFtyNSwjMHg0NF0KLSAgICAgICAgbGRyICAgICAgcjMsW3I3LCMweDIwXQotICAgICAgICBtb3YgICAgICByMSxyMSxsc2wgIzEKLSAgICAgICAgc21sYWwgICAgcjEyLHIwLHIzLHIxCi0gICAgICAgIGxkciAgICAgIGxyLFtyNywjMHgyNF0KLSAgICAgICAgbGRyICAgICAgcjMsW3I2LCMweDI0XQotICAgICAgICBzdHIgICAgICByMCxbcjUsIzB4MjBdCi0gICAgICAgIHNtbGFsICAgIHIxLHIzLGxyLHIxCi0gICAgICAgIGxkciAgICAgIHIwLFtyNiwjMHg0MF0KLSAgICAgICAgbGRyICAgICAgcjEyLFtyNiwjMHg0NF0KLSAgICAgICAgc3RyICAgICAgcjMsW3I1LCMweDI0XQotICAgICAgICBsZHIgICAgICByMSxbcjUsIzB4MjhdCi0gICAgICAgIGxkciAgICAgIHIzLFtyNywjMHg0NF0KLSAgICAgICAgbW92ICAgICAgcjEscjEsbHNsICMxCi0gICAgICAgIHNtbGFsICAgIHIxLHIxMixyMyxyMQotICAgICAgICBsZHIgICAgICByMSxbcjUsIzB4NDBdCi0gICAgICAgIHN0ciAgICAgIHIxMixbcjUsIzB4NDRdCi0gICAgICAgIHJzYiAgICAgIHI4LHIxLCMwCi0gICAgICAgIHN0ciAgICAgIHI4LFtyNSwjMHgyOF0KLSAgICAgICAgbGRyICAgICAgcjEsW3I1LCMweDJjXQotICAgICAgICBsZHIgICAgICByMyxbcjcsIzB4NDBdCi0gICAgICAgIG1vdiAgICAgIHIxLHIxLGxzbCAjMQotICAgICAgICBzbWxhbCAgICByMSxyMCxyMyxyMQotICAgICAgICBzdHIgICAgICByMCxbcjUsIzB4NDBdCi0gICAgICAgIGxkciAgICAgIHIwLFtyNSwjMHgzY10KLSAgICAgICAgbGRyICAgICAgcjEsW3I2LCMweDM4XQotICAgICAgICBsZHIgICAgICByMyxbcjYsIzB4M2NdCi0gICAgICAgIHJzYiAgICAgIHI5LHIwLCMwCi0gICAgICAgIHN0ciAgICAgIHI5LFtyNSwjMHgyY10KLSAgICAgICAgbGRyICAgICAgcjAsW3I1LCMweDMwXQotICAgICAgICBsZHIgICAgICByMTIsW3I3LCMweDNjXQotICAgICAgICBtb3YgICAgICByMCxyMCxsc2wgIzEKLSAgICAgICAgc21sYWwgICAgcjAscjMscjEyLHIwCi0gICAgICAgIHN0ciAgICAgIHIzLFtyNSwjMHgzY10KLSAgICAgICAgbGRyICAgICAgcjAsW3I1LCMweDM4XQotICAgICAgICByc2IgICAgICByMCxyMCwjMAotICAgICAgICBzdHIgICAgICByMCxbcjUsIzB4MzBdCi0gICAgICAgIGxkciAgICAgIHIzLFtyNSwjMHgzNF0KLSAgICAgICAgbGRyICAgICAgcjEyLFtyNywjMHgzOF0KLSAgICAgICAgbW92ICAgICAgcjMscjMsbHNsICMxCi0gICAgICAgIHNtbGFsICAgIHIzLHIxLHIxMixyMwotICAgICAgICBtb3YgICAgICByMCxyMCxsc2wgIzEKLSAgICAgICAgc3RyICAgICAgcjEsW3I1LCMweDM4XQotICAgICAgICBsZHIgICAgICByNCxbcjcsIzB4MzRdCi0gICAgICAgIGxkciAgICAgIHIxLFtyNiwjMHgzNF0KLSAgICAgICAgbGRyICAgICAgcjMsW3I2LCMweDMwXQotICAgICAgICBzbWxhbCAgICByMCxyMSxyNCxyMAotICAgICAgICBsZHIgICAgICByMTIsW3I2LCMweDJjXQotICAgICAgICBsZHIgICAgICBscixbcjYsIzB4MjhdCi0gICAgICAgIHN0ciAgICAgIHIxLFtyNSwjMHgzNF0KLSAgICAgICAgbGRyICAgICAgcjEsW3I3LCMweDMwXQotICAgICAgICBtb3YgICAgICByMCxyOSxsc2wgIzEKLSAgICAgICAgc21sYWwgICAgcjAscjMscjEscjAKLSAgICAgICAgbW92ICAgICAgcjAscjgsbHNsICMxCi0gICAgICAgIGxkciAgICAgIHIxLFtyNywjMHgyY10KLSAgICAgICAgc3RyICAgICAgcjMsW3I1LCMweDMwXQotICAgICAgICBzbWxhbCAgICByMCxyMTIscjEscjAKLSAgICAgICAgbGRyICAgICAgcjAsW3I3LCMweDI4XQotICAgICAgICBzdHIgICAgICByMTIsW3I1LCMweDJjXQotICAgICAgICBzbWxhbCAgICByMixscixyMCxyMgotICAgICAgICBzdHIgICAgICBscixbcjUsIzB4MjhdCi0gICAgICAgIGxkciAgICAgIHIxLFtyNiwjNF0KLSAgICAgICAgbGRyICAgICAgcjEyLFtyNywjMHg0OF0KLSAgICAgICAgbW92ICAgICAgcjIscjEsbHNsICMxCi0gICAgICAgIGxkciAgICAgIHIxLFtyNiwjMHgyMF0KLSAgICAgICAgbGRyICAgICAgcjAsW3I2LCMwXQotICAgICAgICBtb3YgICAgICByMSxyMSxsc2wgIzEKLSAgICAgICAgc211bGwgICAgcjQsbHIscjEyLHIxCi0gICAgICAgIGxkciAgICAgIHIzLFtyNiwjMHgxY10KLSAgICAgICAgc3RyICAgICAgbHIsW3I2LCMwXQotICAgICAgICBsZHIgICAgICByMTIsW3I3LCMweDRjXQotICAgICAgICBtb3YgICAgICByMyxyMyxsc2wgIzEKLSAgICAgICAgc211bGwgICAgcjQsbHIscjEyLHIzCi0gICAgICAgIG1vdiAgICAgIHIwLHIwLGxzbCAjMQotICAgICAgICBsZHIgICAgICByMTIsW3I3LCMweDY0XQotICAgICAgICBzdHIgICAgICBscixbcjYsIzRdCi0gICAgICAgIHNtdWxsICAgIHI0LGxyLHIxMixyMgotICAgICAgICBsZHIgICAgICByMTIsW3I3LCMweDY4XQotICAgICAgICBzdHIgICAgICBscixbcjYsIzB4MWNdCi0gICAgICAgIHNtdWxsICAgIHI0LGxyLHIxMixyMAotICAgICAgICBsZHIgICAgICByMTIsW3I3LCMweDZjXQotICAgICAgICBzdHIgICAgICBscixbcjYsIzB4MjBdCi0gICAgICAgIHNtdWxsICAgIGxyLHIwLHIxMixyMAotICAgICAgICBsZHIgICAgICByMTIsW3I3LCMweDcwXQotICAgICAgICBzdHIgICAgICByMCxbcjYsIzB4MjRdCi0gICAgICAgIHNtdWxsICAgIHIwLHIyLHIxMixyMgotICAgICAgICBsZHIgICAgICByMCxbcjcsIzB4ODhdCi0gICAgICAgIHN0ciAgICAgIHIyLFtyNiwjMHgyOF0KLSAgICAgICAgc211bGwgICAgcjMscjIscjAscjMKLSAgICAgICAgbGRyICAgICAgcjAsW3I3LCMweDhjXQotICAgICAgICBzdHIgICAgICByMixbcjYsIzB4NDBdCi0gICAgICAgIHNtdWxsICAgIHIyLHIxLHIwLHIxCi0gICAgICAgIHN0ciAgICAgIHIxLFtyNiwjMHg0NF0KLSAgICAgICAgbGRyICAgICAgcjAsW3I2LCMweDE4XQotICAgICAgICBsZHIgICAgICBscixbcjcsIzB4NTBdCi0gICAgICAgIG1vdiAgICAgIHIxLHIwLGxzbCAjMQotICAgICAgICBsZHIgICAgICByMCxbcjYsIzB4MTRdCi0gICAgICAgIHNtdWxsICAgIHI1LHI0LGxyLHIxCi0gICAgICAgIG1vdiAgICAgIHIzLHIwLGxzbCAjMQotICAgICAgICBsZHIgICAgICByMCxbcjYsIzB4MTBdCi0gICAgICAgIG1vdiAgICAgIHIxMixyMCxsc2wgIzEKLSAgICAgICAgbGRyICAgICAgcjAsW3I2LCMweGNdCi0gICAgICAgIG1vdiAgICAgIHIyLHIwLGxzbCAjMQotICAgICAgICBsZHIgICAgICByMCxbcjYsIzhdCi0gICAgICAgIHN0ciAgICAgIHI0LFtyNiwjOF0KLSAgICAgICAgbGRyICAgICAgbHIsW3I3LCMweDU0XQotICAgICAgICBtb3YgICAgICByMCxyMCxsc2wgIzEKLSAgICAgICAgc211bGwgICAgcjUscjQsbHIscjMKLSAgICAgICAgbGRyICAgICAgbHIsW3I3LCMweDU4XQotICAgICAgICBzdHIgICAgICByNCxbcjYsIzB4Y10KLSAgICAgICAgc211bGwgICAgcjUscjQsbHIscjEyCi0gICAgICAgIGxkciAgICAgIGxyLFtyNywjMHg1Y10KLSAgICAgICAgc3RyICAgICAgcjQsW3I2LCMweDEwXQotICAgICAgICBzbXVsbCAgICByNSxyNCxscixyMgotICAgICAgICBsZHIgICAgICBscixbcjcsIzB4NjBdCi0gICAgICAgIHN0ciAgICAgIHI0LFtyNiwjMHgxNF0KLSAgICAgICAgc211bGwgICAgcjUscjQsbHIscjAKLSAgICAgICAgbGRyICAgICAgbHIsW3I3LCMweDc0XQotICAgICAgICBzdHIgICAgICByNCxbcjYsIzB4MThdCi0gICAgICAgIHNtdWxsICAgIHI0LHIwLGxyLHIwCi0gICAgICAgIGxkciAgICAgIGxyLFtyNywjMHg3OF0KLSAgICAgICAgc3RyICAgICAgcjAsW3I2LCMweDJjXQotICAgICAgICBzbXVsbCAgICByMCxyMixscixyMgotICAgICAgICBsZHIgICAgICByMCxbcjcsIzB4N2NdCi0gICAgICAgIHN0ciAgICAgIHIyLFtyNiwjMHgzMF0KLSAgICAgICAgc211bGwgICAgcjEyLHIyLHIwLHIxMgotICAgICAgICBsZHIgICAgICByMCxbcjcsIzB4ODBdCi0gICAgICAgIHN0ciAgICAgIHIyLFtyNiwjMHgzNF0KLSAgICAgICAgc211bGwgICAgcjMscjIscjAscjMKLSAgICAgICAgbGRyICAgICAgcjAsW3I3LCMweDg0XQotICAgICAgICBzdHIgICAgICByMixbcjYsIzB4MzhdCi0gICAgICAgIHNtdWxsICAgIHIyLHIxLHIwLHIxCi0gICAgICAgIHN0ciAgICAgIHIxLFtyNiwjMHgzY10KLSAgICAgICAgbGRtZmQgICAgc3AhLHtyNC1yMTEscGN9Ci10YWJsZToKLSAgICAgICAgLndvcmQgICAgICBjb25zdGRhdGEkMQotCi1ALS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tCi0KLWNvbnN0ZGF0YSQxOgotY29zVGVybXNfZGN0MTg6Ci0gICAgICAgIC53b3JkICAgICAgMHgwODA3ZDJiMAotICAgICAgICAud29yZCAgICAgIDB4MDg0ODNlZTAKLSAgICAgICAgLndvcmQgICAgICAweDA4ZDNiN2QwCi0gICAgICAgIC53b3JkICAgICAgMHgwOWM0MjU3MAotICAgICAgICAud29yZCAgICAgIDB4MGI1MDRmMzAKLSAgICAgICAgLndvcmQgICAgICAweDBkZjI5NDQwCi0gICAgICAgIC53b3JkICAgICAgMHgxMmVkZmIyMAotICAgICAgICAud29yZCAgICAgIDB4MWVlOGRkNDAKLSAgICAgICAgLndvcmQgICAgICAweDViY2EyYTAwCi1jb3NUZXJtc18xX292X2Nvc19waGk6Ci0gICAgICAgIC53b3JkICAgICAgMHg0MDBmOWMwMAotICAgICAgICAud29yZCAgICAgIDB4NDA4ZDYwODAKLSAgICAgICAgLndvcmQgICAgICAweDQxOGRjYjgwCi0gICAgICAgIC53b3JkICAgICAgMHg0MzFiMWEwMAotICAgICAgICAud29yZCAgICAgIDB4NDU0NWVhMDAKLSAgICAgICAgLndvcmQgICAgICAweDQ4MjcwNjgwCi0gICAgICAgIC53b3JkICAgICAgMHg0YmUyNTQ4MAotICAgICAgICAud29yZCAgICAgIDB4NTBhYjk0ODAKLSAgICAgICAgLndvcmQgICAgICAweDU2Y2U0ZDgwCi0gICAgICAgIC53b3JkICAgICAgMHgwNWViYjYzMAotICAgICAgICAud29yZCAgICAgIDB4MDY5MjFhOTgKLSAgICAgICAgLndvcmQgICAgICAweDA3NzFkM2E4Ci0gICAgICAgIC53b3JkICAgICAgMHgwOGE5YTgzMAotICAgICAgICAud29yZCAgICAgIDB4MGE3M2Q3NTAKLSAgICAgIC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UkVBIHwudGV4dHwsIENPREUsIFJFQURPTkxZLCBBTElHTj0yCi0KLQotOy0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLQotCi18cHZtcDNfbWRjdF8xOHwgUFJPQwotICAgICAgICBzdG1mZCAgICBzcCEse3I0LXIxMCxscn0KLSAgICAgICAgbW92ICAgICAgcjcscjIKLSAgICAgICAgbGRyICAgICAgcjIsdGFibGUKLSAgICAgICAgbW92ICAgICAgcjYscjEKLSAgICAgICAgYWRkICAgICAgcjMscjIsIzB4MjQKLSAgICAgICAgYWRkICAgICAgcjEyLHIzLCMweDQ0Ci0gICAgICAgIGFkZCAgICAgIHIxLHIwLCMweDQ0Ci0gICAgICAgIG1vdiAgICAgIHI1LHIwCi0KLTsgICAgZm9yICggaT05OyBpIT0wOyBpLS0pCi07ICAgIHsKLQotICAgICAgICBtb3YgICAgICByNCwjOQotTG9vcF8xCi0KLTsgICAgICAgdG1wICA9ICoocHRfdmVjKTsKLTsJCXRtcDEgPSAqKHB0X3ZlY19vKTsKLQotICAgICAgICBsZHIgICAgICBscixbcjBdCQk7OyB0bXAgID09IGxyCi0gICAgICAgIGxkciAgICAgIHI4LFtyM10sIzQJCTs7IHRtcDEgPT0gcjgKLQotOyAgICAgICAgdG1wICA9IGZ4cF9tdWwzMl9RMzIoIHRtcDw8MSwgICoocHRfY29zKysgICkpOwotOyAgICAgICAgdG1wMSA9IGZ4cF9tdWwzMl9RMjcoIHRtcDEsICoocHRfY29zX3gtLSkpOwotCi0gICAgICAgIG1vdiAgICAgIGxyLGxyLGxzbCAjMQotICAgICAgICBzbXVsbCAgICByMTAsbHIscjgsbHIKLSAgICAgICAgbGRyICAgICAgcjgsW3IxMl0sIy00Ci0gICAgICAgIGxkciAgICAgIHI5LFtyMV0KLSAgICAgICAgc3VicyAgICAgcjQscjQsIzEKLSAgICAgICAgc211bGwgICAgcjkscjEwLHI4LHI5Ci0gICAgICAgIG1vdiAgICAgIHI4LHI5LGxzciAjMjcKLSAgICAgICAgYWRkICAgICAgcjgscjgscjEwLGxzbCAjNQotCi07ICAgICAgICAqKHB0X3ZlYysrKSAgID0gICB0bXAgKyB0bXAxIDsKLTsgICAgICAgICoocHRfdmVjX28tLSkgPSBmeHBfbXVsMzJfUTI4KCAodG1wIC0gdG1wMSksICoocHRfY29zX3NwbGl0KyspKTsKLQotICAgICAgICBhZGQgICAgICByOSxscixyOAotICAgICAgICBzdWIgICAgICByOCxscixyOAotICAgICAgICBsZHIgICAgICBscixbcjJdLCM0Ci0gICAgICAgIHN0ciAgICAgIHI5LFtyMF0sIzQKLSAgICAgICAgc211bGwgICAgcjgscjksbHIscjgKLSAgICAgICAgbW92ICAgICAgbHIscjgsbHNyICMyOAotICAgICAgICBhZGQgICAgICBscixscixyOSxsc2wgIzQKLSAgICAgICAgc3RyICAgICAgbHIsW3IxXSwjLTQKLSAgICAgICAgYm5lICAgICAgTG9vcF8xCi0KLTsJCX0KLQotICAgICAgICBtb3YgICAgICByMCxyNQkJCTs7IHIwID0gdmVjCi0gICAgICAgIGJsICAgICAgIHB2bXAzX2RjdF85Ci0gICAgICAgIGFkZCAgICAgIHIwLHI1LCMweDI0CTs7IHIwID0gJnZlY1s5XQotICAgICAgICBibCAgICAgICBwdm1wM19kY3RfOQotCi0gICAgICAgIGxkciAgICAgIHIwLFtyNSwjMHgyMF0KLSAgICAgICAgbGRyICAgICAgcjIsW3I1LCMweDQwXQotICAgICAgICBzdHIgICAgICByMCxbcjUsIzB4NDBdCi0gICAgICAgIGxkciAgICAgIHIwLFtyNSwjMHgxY10KLSAgICAgICAgbGRyICAgICAgcjMsW3I1LCMweDM4XQotICAgICAgICBzdHIgICAgICByMCxbcjUsIzB4MzhdCi0gICAgICAgIGxkciAgICAgIHIxLFtyNSwjMHgxOF0KLSAgICAgICAgbGRyICAgICAgcjAsW3I1LCMweDMwXQotICAgICAgICBzdHIgICAgICByMSxbcjUsIzB4MzBdCi0gICAgICAgIGxkciAgICAgIHIxMixbcjUsIzB4MTRdCi0gICAgICAgIGxkciAgICAgIHIxLFtyNSwjMHgyOF0KLSAgICAgICAgc3RyICAgICAgcjEyLFtyNSwjMHgyOF0KLSAgICAgICAgbGRyICAgICAgcjEyLFtyNSwjMHgxMF0KLSAgICAgICAgc3RyICAgICAgcjEyLFtyNSwjMHgyMF0KLSAgICAgICAgbGRyICAgICAgcjEyLFtyNSwjMHhjXQotICAgICAgICBzdHIgICAgICByMTIsW3I1LCMweDE4XQotICAgICAgICBsZHIgICAgICByMTIsW3I1LCM4XQotICAgICAgICBzdHIgICAgICByMTIsW3I1LCMweDEwXQotICAgICAgICBsZHIgICAgICByMTIsW3I1LCM0XQotICAgICAgICBzdHIgICAgICByMTIsW3I1LCM4XQotICAgICAgICBsZHIgICAgICByMTIsW3I1LCMweDI0XQotICAgICAgICBzdWIgICAgICByMTIscjEyLHIxCi0gICAgICAgIHN0ciAgICAgIHIxMixbcjUsIzRdCi0gICAgICAgIGxkciAgICAgIHIxMixbcjUsIzB4MmNdCi0gICAgICAgIHN1YiAgICAgIHIxLHIxMixyMQotICAgICAgICBzdHIgICAgICByMSxbcjUsIzB4Y10KLSAgICAgICAgc3ViICAgICAgcjEscjEyLHIwCi0gICAgICAgIHN0ciAgICAgIHIxLFtyNSwjMHgxNF0KLSAgICAgICAgbGRyICAgICAgcjEsW3I1LCMweDM0XQotICAgICAgICBzdWIgICAgICByMCxyMSxyMAotICAgICAgICBzdHIgICAgICByMCxbcjUsIzB4MWNdCi0gICAgICAgIHN1YiAgICAgIHIwLHIxLHIzCi0gICAgICAgIHN0ciAgICAgIHIwLFtyNSwjMHgyNF0KLSAgICAgICAgbGRyICAgICAgcjEsW3I1LCMweDNjXQotICAgICAgICBzdWIgICAgICByMyxyMSxyMwotICAgICAgICBzdWIgICAgICByMSxyMSxyMgotICAgICAgICBzdHIgICAgICByMSxbcjUsIzB4MzRdCi0gICAgICAgIHN0ciAgICAgIHIzLFtyNSwjMHgyY10KLSAgICAgICAgbGRyICAgICAgcjEsW3I1LCMweDQ0XQotICAgICAgICBzdWIgICAgICByMSxyMSxyMgotICAgICAgICBzdHIgICAgICByMSxbcjUsIzB4M2NdCi0gICAgICAgIGxkciAgICAgIHIxMixbcjUsIzBdCi0KLUxvb3BfMgotICAgICAgICBhZGQgICAgICByMSxyNSxyNCxsc2wgIzIKLSAgICAgICAgbGRyICAgICAgcjIsW3IxLCMweDI4XQotICAgICAgICBsZHIgICAgICByMyxbcjYscjQsbHNsICMyXQotICAgICAgICBhZGQgICAgICByMCxyMCxyMgotICAgICAgICBzdHIgICAgICByMCxbcjEsIzB4MjhdCi0gICAgICAgIGxkciAgICAgIGxyLFtyNyxyNCxsc2wgIzJdCi0gICAgICAgIGxkciAgICAgIHIxLFtyMSwjNF0KLSAgICAgICAgc21sYWwgICAgcjAscjMsbHIscjAKLSAgICAgICAgbW92ICAgICAgcjAscjIKLSAgICAgICAgYWRkICAgICAgcjIscjEyLHIxCi0gICAgICAgIHJzYiAgICAgIHIyLHIyLCMwCi0gICAgICAgIHN0ciAgICAgIHIzLFtyNSxyNCxsc2wgIzJdCi0gICAgICAgIHN0ciAgICAgIHIyLFtyNixyNCxsc2wgIzJdCi0gICAgICAgIGFkZCAgICAgIHI0LHI0LCMxCi0gICAgICAgIGNtcCAgICAgIHI0LCM2Ci0gICAgICAgIG1vdiAgICAgIHIxMixyMQotCi0gICAgICAgIGJsdCAgICAgIExvb3BfMgotCi0gICAgICAgIGxkciAgICAgIHIxLFtyNSwjMHg0MF0KLSAgICAgICAgbGRyICAgICAgcjIsW3I2LCMweDE4XQotICAgICAgICBhZGQgICAgICByMyxyMCxyMQotICAgICAgICBzdHIgICAgICByMyxbcjUsIzB4NDBdCi0gICAgICAgIGxkciAgICAgIGxyLFtyNyxyNCxsc2wgIzJdCi0gICAgICAgIG1vdiAgICAgIHIzLHIzLGxzbCAjMQotICAgICAgICBsZHIgICAgICByMCxbcjUsIzB4MWNdCi0gICAgICAgIHNtbGFsICAgIHIzLHIyLGxyLHIzCi0gICAgICAgIGFkZCAgICAgIHIzLHIxMixyMAotICAgICAgICBzdHIgICAgICByMixbcjUsIzB4MThdCi0gICAgICAgIGxkciAgICAgIHIyLFtyNiwjMHgxY10KLSAgICAgICAgcnNiICAgICAgcjMscjMsIzAKLSAgICAgICAgc3RyICAgICAgcjMsW3I2LCMweDE4XQotICAgICAgICBsZHIgICAgICByMyxbcjUsIzB4MjBdCi0gICAgICAgIGFkZCAgICAgIHIwLHIzLHIwCi0gICAgICAgIHJzYiAgICAgIHIwLHIwLCMwCi0gICAgICAgIHN0ciAgICAgIHIwLFtyNiwjMHgxY10KLSAgICAgICAgbGRyICAgICAgcjMsW3I1LCMweDQ0XQotICAgICAgICBsZHIgICAgICByMCxbcjYsIzB4MjBdCi0gICAgICAgIGFkZCAgICAgIHIzLHIzLHIxCi0gICAgICAgIG1vdiAgICAgIHIxLHIyCi0gICAgICAgIGxkciAgICAgIHIxMCxbcjcsIzB4MWNdCi0gICAgICAgIG1vdiAgICAgIHIyLHIzLGxzbCAjMQotICAgICAgICBzbWxhbCAgICByMTIscjEscjEwLHIyCi0gICAgICAgIHN0ciAgICAgIHIxLFtyNSwjMHgxY10KLSAgICAgICAgbGRyICAgICAgcjEsW3I1LCMweDIwXQotICAgICAgICBsZHIgICAgICByMyxbcjUsIzB4MjRdCi0gICAgICAgIGFkZCAgICAgIHIxLHIxLHIzCi0gICAgICAgIHJzYiAgICAgIHIxLHIxLCMwCi0gICAgICAgIHN0ciAgICAgIHIxLFtyNiwjMHgyMF0KLSAgICAgICAgbGRyICAgICAgcjEsW3I1LCMweDQ0XQotICAgICAgICBsZHIgICAgICByMyxbcjcsIzB4MjBdCi0gICAgICAgIG1vdiAgICAgIHIxLHIxLGxzbCAjMQotICAgICAgICBzbWxhbCAgICByMTIscjAscjMscjEKLSAgICAgICAgbGRyICAgICAgbHIsW3I3LCMweDI0XQotICAgICAgICBsZHIgICAgICByMyxbcjYsIzB4MjRdCi0gICAgICAgIHN0ciAgICAgIHIwLFtyNSwjMHgyMF0KLSAgICAgICAgc21sYWwgICAgcjEscjMsbHIscjEKLSAgICAgICAgbGRyICAgICAgcjAsW3I2LCMweDQwXQotICAgICAgICBsZHIgICAgICByMTIsW3I2LCMweDQ0XQotICAgICAgICBzdHIgICAgICByMyxbcjUsIzB4MjRdCi0gICAgICAgIGxkciAgICAgIHIxLFtyNSwjMHgyOF0KLSAgICAgICAgbGRyICAgICAgcjMsW3I3LCMweDQ0XQotICAgICAgICBtb3YgICAgICByMSxyMSxsc2wgIzEKLSAgICAgICAgc21sYWwgICAgcjEscjEyLHIzLHIxCi0gICAgICAgIGxkciAgICAgIHIxLFtyNSwjMHg0MF0KLSAgICAgICAgc3RyICAgICAgcjEyLFtyNSwjMHg0NF0KLSAgICAgICAgcnNiICAgICAgcjgscjEsIzAKLSAgICAgICAgc3RyICAgICAgcjgsW3I1LCMweDI4XQotICAgICAgICBsZHIgICAgICByMSxbcjUsIzB4MmNdCi0gICAgICAgIGxkciAgICAgIHIzLFtyNywjMHg0MF0KLSAgICAgICAgbW92ICAgICAgcjEscjEsbHNsICMxCi0gICAgICAgIHNtbGFsICAgIHIxLHIwLHIzLHIxCi0gICAgICAgIHN0ciAgICAgIHIwLFtyNSwjMHg0MF0KLSAgICAgICAgbGRyICAgICAgcjAsW3I1LCMweDNjXQotICAgICAgICBsZHIgICAgICByMSxbcjYsIzB4MzhdCi0gICAgICAgIGxkciAgICAgIHIzLFtyNiwjMHgzY10KLSAgICAgICAgcnNiICAgICAgcjkscjAsIzAKLSAgICAgICAgc3RyICAgICAgcjksW3I1LCMweDJjXQotICAgICAgICBsZHIgICAgICByMCxbcjUsIzB4MzBdCi0gICAgICAgIGxkciAgICAgIHIxMixbcjcsIzB4M2NdCi0gICAgICAgIG1vdiAgICAgIHIwLHIwLGxzbCAjMQotICAgICAgICBzbWxhbCAgICByMCxyMyxyMTIscjAKLSAgICAgICAgc3RyICAgICAgcjMsW3I1LCMweDNjXQotICAgICAgICBsZHIgICAgICByMCxbcjUsIzB4MzhdCi0gICAgICAgIHJzYiAgICAgIHIwLHIwLCMwCi0gICAgICAgIHN0ciAgICAgIHIwLFtyNSwjMHgzMF0KLSAgICAgICAgbGRyICAgICAgcjMsW3I1LCMweDM0XQotICAgICAgICBsZHIgICAgICByMTIsW3I3LCMweDM4XQotICAgICAgICBtb3YgICAgICByMyxyMyxsc2wgIzEKLSAgICAgICAgc21sYWwgICAgcjMscjEscjEyLHIzCi0gICAgICAgIG1vdiAgICAgIHIwLHIwLGxzbCAjMQotICAgICAgICBzdHIgICAgICByMSxbcjUsIzB4MzhdCi0gICAgICAgIGxkciAgICAgIHI0LFtyNywjMHgzNF0KLSAgICAgICAgbGRyICAgICAgcjEsW3I2LCMweDM0XQotICAgICAgICBsZHIgICAgICByMyxbcjYsIzB4MzBdCi0gICAgICAgIHNtbGFsICAgIHIwLHIxLHI0LHIwCi0gICAgICAgIGxkciAgICAgIHIxMixbcjYsIzB4MmNdCi0gICAgICAgIGxkciAgICAgIGxyLFtyNiwjMHgyOF0KLSAgICAgICAgc3RyICAgICAgcjEsW3I1LCMweDM0XQotICAgICAgICBsZHIgICAgICByMSxbcjcsIzB4MzBdCi0gICAgICAgIG1vdiAgICAgIHIwLHI5LGxzbCAjMQotICAgICAgICBzbWxhbCAgICByMCxyMyxyMSxyMAotICAgICAgICBtb3YgICAgICByMCxyOCxsc2wgIzEKLSAgICAgICAgbGRyICAgICAgcjEsW3I3LCMweDJjXQotICAgICAgICBzdHIgICAgICByMyxbcjUsIzB4MzBdCi0gICAgICAgIHNtbGFsICAgIHIwLHIxMixyMSxyMAotICAgICAgICBsZHIgICAgICByMCxbcjcsIzB4MjhdCi0gICAgICAgIHN0ciAgICAgIHIxMixbcjUsIzB4MmNdCi0gICAgICAgIHNtbGFsICAgIHIyLGxyLHIwLHIyCi0gICAgICAgIHN0ciAgICAgIGxyLFtyNSwjMHgyOF0KLSAgICAgICAgbGRyICAgICAgcjEsW3I2LCM0XQotICAgICAgICBsZHIgICAgICByMTIsW3I3LCMweDQ4XQotICAgICAgICBtb3YgICAgICByMixyMSxsc2wgIzEKLSAgICAgICAgbGRyICAgICAgcjEsW3I2LCMweDIwXQotICAgICAgICBsZHIgICAgICByMCxbcjZdCi0gICAgICAgIG1vdiAgICAgIHIxLHIxLGxzbCAjMQotICAgICAgICBzbXVsbCAgICByNCxscixyMTIscjEKLSAgICAgICAgbGRyICAgICAgcjMsW3I2LCMweDFjXQotICAgICAgICBzdHIgICAgICBscixbcjZdCi0gICAgICAgIGxkciAgICAgIHIxMixbcjcsIzB4NGNdCi0gICAgICAgIG1vdiAgICAgIHIzLHIzLGxzbCAjMQotICAgICAgICBzbXVsbCAgICByNCxscixyMTIscjMKLSAgICAgICAgbW92ICAgICAgcjAscjAsbHNsICMxCi0gICAgICAgIGxkciAgICAgIHIxMixbcjcsIzB4NjRdCi0gICAgICAgIHN0ciAgICAgIGxyLFtyNiwjNF0KLSAgICAgICAgc211bGwgICAgcjQsbHIscjEyLHIyCi0gICAgICAgIGxkciAgICAgIHIxMixbcjcsIzB4NjhdCi0gICAgICAgIHN0ciAgICAgIGxyLFtyNiwjMHgxY10KLSAgICAgICAgc211bGwgICAgcjQsbHIscjEyLHIwCi0gICAgICAgIGxkciAgICAgIHIxMixbcjcsIzB4NmNdCi0gICAgICAgIHN0ciAgICAgIGxyLFtyNiwjMHgyMF0KLSAgICAgICAgc211bGwgICAgbHIscjAscjEyLHIwCi0gICAgICAgIGxkciAgICAgIHIxMixbcjcsIzB4NzBdCi0gICAgICAgIHN0ciAgICAgIHIwLFtyNiwjMHgyNF0KLSAgICAgICAgc211bGwgICAgcjAscjIscjEyLHIyCi0gICAgICAgIGxkciAgICAgIHIwLFtyNywjMHg4OF0KLSAgICAgICAgc3RyICAgICAgcjIsW3I2LCMweDI4XQotICAgICAgICBzbXVsbCAgICByMyxyMixyMCxyMwotICAgICAgICBsZHIgICAgICByMCxbcjcsIzB4OGNdCi0gICAgICAgIHN0ciAgICAgIHIyLFtyNiwjMHg0MF0KLSAgICAgICAgc211bGwgICAgcjIscjEscjAscjEKLSAgICAgICAgc3RyICAgICAgcjEsW3I2LCMweDQ0XQotICAgICAgICBsZHIgICAgICByMCxbcjYsIzB4MThdCi0gICAgICAgIGxkciAgICAgIGxyLFtyNywjMHg1MF0KLSAgICAgICAgbW92ICAgICAgcjEscjAsbHNsICMxCi0gICAgICAgIGxkciAgICAgIHIwLFtyNiwjMHgxNF0KLSAgICAgICAgc211bGwgICAgcjUscjQsbHIscjEKLSAgICAgICAgbGRyICAgICAgcjEyLFtyNiwjMHgxMF0KLSAgICAgICAgbW92ICAgICAgcjMscjAsbHNsICMxCi0gICAgICAgIGxkciAgICAgIHIwLFtyNiwjMHhjXQotICAgICAgICBtb3YgICAgICByMTIscjEyLGxzbCAjMQotICAgICAgICBtb3YgICAgICByMixyMCxsc2wgIzEKLSAgICAgICAgbGRyICAgICAgcjAsW3I2LCM4XQotICAgICAgICBzdHIgICAgICByNCxbcjYsIzhdCi0gICAgICAgIGxkciAgICAgIGxyLFtyNywjMHg1NF0KLSAgICAgICAgbW92ICAgICAgcjAscjAsbHNsICMxCi0gICAgICAgIHNtdWxsICAgIHI1LHI0LGxyLHIzCi0gICAgICAgIGxkciAgICAgIGxyLFtyNywjMHg1OF0KLSAgICAgICAgc3RyICAgICAgcjQsW3I2LCMweGNdCi0gICAgICAgIHNtdWxsICAgIHI1LHI0LGxyLHIxMgotICAgICAgICBsZHIgICAgICBscixbcjcsIzB4NWNdCi0gICAgICAgIHN0ciAgICAgIHI0LFtyNiwjMHgxMF0KLSAgICAgICAgc211bGwgICAgcjUscjQsbHIscjIKLSAgICAgICAgbGRyICAgICAgbHIsW3I3LCMweDYwXQotICAgICAgICBzdHIgICAgICByNCxbcjYsIzB4MTRdCi0gICAgICAgIHNtdWxsICAgIHI1LHI0LGxyLHIwCi0gICAgICAgIGxkciAgICAgIGxyLFtyNywjMHg3NF0KLSAgICAgICAgc3RyICAgICAgcjQsW3I2LCMweDE4XQotICAgICAgICBzbXVsbCAgICByNCxyMCxscixyMAotICAgICAgICBsZHIgICAgICBscixbcjcsIzB4NzhdCi0gICAgICAgIHN0ciAgICAgIHIwLFtyNiwjMHgyY10KLSAgICAgICAgc211bGwgICAgcjAscjIsbHIscjIKLSAgICAgICAgbGRyICAgICAgcjAsW3I3LCMweDdjXQotICAgICAgICBzdHIgICAgICByMixbcjYsIzB4MzBdCi0gICAgICAgIHNtdWxsICAgIHIxMixyMixyMCxyMTIKLSAgICAgICAgbGRyICAgICAgcjAsW3I3LCMweDgwXQotICAgICAgICBzdHIgICAgICByMixbcjYsIzB4MzRdCi0gICAgICAgIHNtdWxsICAgIHIzLHIyLHIwLHIzCi0gICAgICAgIGxkciAgICAgIHIwLFtyNywjMHg4NF0KLSAgICAgICAgc3RyICAgICAgcjIsW3I2LCMweDM4XQotICAgICAgICBzbXVsbCAgICByMixyMSxyMCxyMQotICAgICAgICBzdHIgICAgICByMSxbcjYsIzB4M2NdCi0gICAgICAgIGxkbWZkICAgIHNwISx7cjQtcjEwLHBjfQotdGFibGUKLSAgICAgICAgRENEICAgICAgY29zVGVybXNfZGN0MTgKLSAgICAgICAgRU5EUAotCi07LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tCi0KLSBBUkVBIHwuY29uc3RkYXRhfCwgREFUQSwgUkVBRE9OTFksIEFMSUdOPTIKLQotOy0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLQotCi1jb3NUZXJtc19kY3QxOAotICAgICAgICBEQ0QgICAgICAweDA4MDdkMmIwCi0gICAgICAgIERDRCAgICAgIDB4MDg0ODNlZTAKLSAgICAgICAgRENEICAgICAgMHgwOGQzYjdkMAotICAgICAgICBEQ0QgICAgICAweDA5YzQyNTcwCi0gICAgICAgIERDRCAgICAgIDB4MGI1MDRmMzAKLSAgICAgICAgRENEICAgICAgMHgwZGYyOTQ0MAotICAgICAgICBEQ0QgICAgICAweDEyZWRmYjIwCi0gICAgICAgIERDRCAgICAgIDB4MWVlOGRkNDAKLSAgICAgICAgRENEICAgICAgMHg1YmNhMmEwMAotY29zVGVybXNfMV9vdl9jb3NfcGhpCi0gICAgICAgIERDRCAgICAgIDB4NDAwZjljMDAKLSAgICAgICAgRENEICAgICAgMHg0MDhkNjA4MAotICAgICAgICBEQ0QgICAgICAweDQxOGRjYjgwCi0gICAgICAgIERDRCAgICAgIDB4NDMxYjFhMDAKLSAgICAgICAgRENEICAgICAgMHg0NTQ1ZWEwMAotICAgICAgICBEQ0QgICAgICAweDQ4MjcwNjgwCi0gICAgICAgIERDRCAgICAgIDB4NGJlMjU0ODAKLSAgICAgICAgRENEICAgICAgMHg1MGFiOTQ4MAotICAgICAgICBEQ0QgICAgICAweDU2Y2U0ZDgwCi0gICAgICAgIERDRCAgICAgIDB4MDVlYmI2MzAKLSAgICAgICAgRENEICAgICAgMHgwNjkyMWE5OAotICAgICAgICBEQ0QgICAgICAweDA3NzFkM2E4Ci0gICAgICAgIERDRCAgICAgIDB4MDhhOWE4MzAKLSAgICAgICAgRENEICAgICAgMHgwYTczZDc1MAotICAgICAgICBEQ0QgICAgICAweDBkNGQ1MjYwCi0gICAgICAgIERDRCAgICAgIDB4MTI3YjFjYTAKLSAgICAgICAgRENEICAgICAgMHgxZWE1MmI0MAotICAgICAgICBEQ0QgICAgICAweDViYjNjYzgwCi0KLQotCi0gICAgICAgIEVORApkaWZmIC0tZ2l0IGEvbWVkaWEvbGlic3RhZ2VmcmlnaHQvY29kZWNzL21wM2RlYy9zcmMvYXNtL3B2bXAzX3BvbHlwaGFzZV9maWx0ZXJfd2luZG93X2FybS5zIGI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BBTElHTj0yCi0KLQotOy0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLQotCi18cHZtcDNfcG9seXBoYXNlX2ZpbHRlcl93aW5kb3d8IFBST0MKLQotICAgICAgICBzdG1mZCAgICBzcCEse3IwLXIyLHI0LXIxMSxscn0KLQotICAgICAgICBzdWIgICAgICBzcCxzcCwjNAotICAgICAgICBsZHIgICAgICByMixbc3AsIzB4Y10KLSAgICAgICAgbGRyICAgICAgcjEsUG9seVBoX2ZpbHRlcl9jb2VmZgotCQkKLSAgICAgICAgc3ViICAgICAgcjIscjIsIzEKLSAgICAgICAgbW92ICAgICAgcjEwLCMxCi0gICAgICAgIHN0ciAgICAgIHIyLFtzcF0KLQotOyBBY2N1bXVsYXRvcnMgcjksIHIxMTo6PiBJbml0aWFsaXphdGlvbgotCi1Mb29wX2oKLSAgICAgICAgbW92ICAgICAgcjksICAjMHgyMAotICAgICAgICBtb3YgICAgICByMTEsICMweDIwCi0gICAgICAgIG1vdiAgICAgIHI0LCAgIzB4MTAKLUxvb3BfaQotICAgICAgICBhZGQgICAgICByMixyNCxyMTAKLSAgICAgICAgYWRkICAgICAgcjMscjAscjIsbHNsICMyCi0gICAgICAgIHN1YiAgICAgIHIyLHI0LHIxMAotICAgICAgICBsZHIgICAgICByNSxbcjNdCi0gICAgICAgIGxkciAgICAgIGxyLFtyMV0KLSAgICAgICAgYWRkICAgICAgcjEyLHIwLHIyLGxzbCAjMgotICAgICAgICBsZHIgICAgICByNixbcjEyLCMweDc4MF0KLSAgICAgICAgc21sYWwgICAgcjIscjksbHIscjUKLSAgICAgICAgc21sYWwgICAgcjIscjExLGxyLHI2Ci0gICAgICAgIGxkciAgICAgIHIyLFtyMSwjNF0KLSAgICAgICAgbGRyICAgICAgcjcsW3IxMiwjMHg4MF0KLSAgICAgICAgc21sYWwgICAgcjUscjExLHIyLHI1Ci0gICAgICAgIHNtdWxsICAgIHI2LHI1LHIyLHI2Ci0gICAgICAgIHN1YiAgICAgIHI5LHI5LHI1Ci0gICAgICAgIGxkciAgICAgIHI1LFtyMSwjOF0KLSAgICAgICAgbGRyICAgICAgcjgsW3IzLCMweDcwMF0KLSAgICAgICAgYWRkICAgICAgcjQscjQsIzB4MjAwCi0gICAgICAgIHNtbGFsICAgIHI2LHI5LHI1LHI3Ci0gICAgICAgIHNtdWxsICAgIHI2LHIyLHI1LHI4Ci0gICAgICAgIGxkciAgICAgIHI1LFtyMSwjMHhjXQotICAgICAgICBzdWIgICAgICByMTEscjExLHIyCi0gICAgICAgIHNtbGFsICAgIHI4LHI5LHI1LHI4Ci0gICAgICAgIHNtbGFsICAgIHI3LHIxMSxyNSxyNwotICAgICAgICBsZHIgICAgICByNSxbcjMsIzB4MTAwXQotICAgICAgICBsZHIgICAgICByMixbcjEsIzB4MTBdCi0gICAgICAgIGxkciAgICAgIHI2LFtyMTIsIzB4NjgwXQotICAgICAgICBzbWxhbCAgICBscixyOSxyMixyNQotICAgICAgICBzbWxhbCAgICBscixyMTEscjIscjYKLSAgICAgICAgbGRyICAgICAgcjIsW3IxLCMweDE0XQotICAgICAgICBsZHIgICAgICByNyxbcjEyLCMweDE4MF0KLSAgICAgICAgc21sYWwgICAgcjUscjExLHIyLHI1Ci0gICAgICAgIHNtdWxsICAgIHI2LHI1LHIyLHI2Ci0gICAgICAgIGxkciAgICAgIHI2LFtyMSwjMHgxOF0KLSAgICAgICAgbGRyICAgICAgcjgsW3IzLCMweDYwMF0KLSAgICAgICAgc3ViICAgICAgcjkscjkscjUKLSAgICAgICAgc21sYWwgICAgcjUscjkscjYscjcKLSAgICAgICAgc211bGwgICAgcjIscjUscjYscjgKLSAgICAgICAgbGRyICAgICAgcjYsW3IxLCMweDFjXQotICAgICAgICBzdWIgICAgICByMTEscjExLHI1Ci0gICAgICAgIHNtbGFsICAgIHI4LHI5LHI2LHI4Ci0gICAgICAgIGxkciAgICAgIHIyLFtyMSwjMHgyMF0KLSAgICAgICAgbGRyICAgICAgcjUsW3IzLCMweDIwMF0KLSAgICAgICAgc21sYWwgICAgcjcscjExLHI2LHI3Ci0gICAgICAgIGxkciAgICAgIHI2LFtyMTIsIzB4NTgwXQotICAgICAgICBzbWxhbCAgICBscixyOSxyMixyNQotICAgICAgICBzbWxhbCAgICBscixyMTEscjIscjYKLSAgICAgICAgbGRyICAgICAgcjIsW3IxLCMweDI0XQotICAgICAgICBsZHIgICAgICByNyxbcjEyLCMweDI4MF0KLSAgICAgICAgc21sYWwgICAgcjUscjExLHIyLHI1Ci0gICAgICAgIHNtdWxsICAgIHI2LHI1LHIyLHI2Ci0gICAgICAgIGxkciAgICAgIHI2LFtyMSwjMHgyOF0KLSAgICAgICAgbGRyICAgICAgcjgsW3IzLCMweDUwMF0KLSAgICAgICAgc3ViICAgICAgcjkscjkscjUKLSAgICAgICAgc21sYWwgICAgcjUscjkscjYscjcKLSAgICAgICAgc211bGwgICAgcjIscjUscjYscjgKLSAgICAgICAgbGRyICAgICAgcjYsW3IxLCMweDJjXQotICAgICAgICBzdWIgICAgICByMTEscjExLHI1Ci0KLSAgICAgICAgc21sYWwgICAgcjgscjkscjYscjgKLSAgICAgICAgc21sYWwgICAgcjcscjExLHI2LHI3Ci0gICAgICAgIGxkciAgICAgIHI1LFtyMywjMHgzMDBdCi0gICAgICAgIGxkciAgICAgIHI4LFtyMSwjMHgzMF0KLSAgICAgICAgbGRyICAgICAgcjYsW3IxMiwjMHg0ODBdCi0gICAgICAgIHNtbGFsICAgIHI3LHI5LHI4LHI1Ci0gICAgICAgIHNtbGFsICAgIHI3LHIxMSxyOCxyNgotICAgICAgICBsZHIgICAgICByOCxbcjEsIzB4MzRdCi0gICAgICAgIGxkciAgICAgIHIxMixbcjEyLCMweDM4MF0KLSAgICAgICAgc21sYWwgICAgcjUscjExLHI4LHI1Ci0gICAgICAgIHNtdWxsICAgIHI2LHI1LHI4LHI2Ci0gICAgICAgIGxkciAgICAgIHI2LFtyMSwjMHgzOF0KLQotCi0gICAgICAgIGxkciAgICAgIHIzLFtyMywjMHg0MDBdCi0gICAgICAgIHN1YiAgICAgIHI5LHI5LHI1Ci0gICAgICAgIHNtbGFsICAgIHI3LHI5LHI2LHIxMgotICAgICAgICBzbXVsbCAgICByOCxyNyxyNixyMwotICAgICAgICBjbXAgICAgICByNCwjMHgyMTAKLSAgICAgICAgc3ViICAgICAgcjExLHIxMSxyNwotCi0gICAgICAgIGxkciAgICAgIHIyLFtyMSwjMHgzY10KLSAgICAgICAgYWRkICAgICAgcjEscjEsIzB4NDAKLSAgICAgICAgc21sYWwgICAgcjMscjkscjIscjMKLSAgICAgICAgc21sYWwgICAgcjEyLHIxMSxyMixyMTIKLQotICAgICAgICBibHQgICAgICBMb29wX2kKLQotICAgICAgICBtb3YgICAgICByMyxyOSwgYXNyICM2Ci0gICAgICAgIG1vdiAgICAgIHI0LHIzLCBhc3IgIzE1Ci0gICAgICAgIHRlcSAgICAgIHI0LHIzLCBhc3IgIzMxCi0gICAgICAgIGxkciAgICAgIHIxMixMT1dfMTZCSVRTCi0gICAgICAgIGxkciAgICAgIHIyLFtzcF0KLSAgICAgICAgZW9ybmUgICAgcjMscjEyLHIzLGFzciAjMzEKLSAgICAgICAgbGRyICAgICAgcjQsW3NwLCM4XQotICAgICAgICBtb3YgICAgICByMixyMTAsbHNsIHIyCi0gICAgICAgIGFkZCAgICAgIHI0LHI0LHIyLGxzbCAjMQotICAgICAgICBzdHJoICAgICByMyxbcjRdCi0KLSAgICAgICAgbW92ICAgICAgcjMscjExLGFzciAjNgotICAgICAgICBtb3YgICAgICByNCxyMyxhc3IgIzE1Ci0gICAgICAgIHRlcSAgICAgIHI0LHIzLGFzciAjMzEKLSAgICAgICAgZW9ybmUgICAgcjMscjEyLHIzLGFzciAjMzEKLSAgICAgICAgbGRyICAgICAgcjEyLFtzcCwjMHhjXQotICAgICAgICBsZHIgICAgICByMTEsW3NwLCM4XQotICAgICAgICByc2IgICAgICByMixyMixyMTIsbHNsICM1Ci0gICAgICAgIGFkZCAgICAgIHIyLHIxMSxyMixsc2wgIzEKLSAgICAgICAgc3RyaCAgICAgcjMsW3IyXQotCi0gICAgICAgIGFkZCAgICAgIHIxMCxyMTAsIzEKLSAgICAgICAgY21wICAgICAgcjEwLCMweDEwCi0gICAgICAgIGJsdCAgICAgIExvb3BfagotCi07IEFjY3VtdWxhdG9ycyByNCwgcjUgSW5pdGlhbGl6YXRpb24KLQotICAgICAgICBtb3YgICAgICByNCwjMHgyMAotICAgICAgICBtb3YgICAgICByNSwjMHgyMAotICAgICAgICBtb3YgICAgICByMywjMHgxMAotUG9seVBoX2ZpbHRlcl9sb29wMgotICAgICAgICBhZGQgICAgICByMixyMCxyMyxsc2wgIzIKLSAgICAgICAgbGRyICAgICAgcjEyLFtyMl0KLSAgICAgICAgbGRyICAgICAgcjgsW3IxXQotICAgICAgICBsZHIgICAgICByNixbcjIsIzB4ODBdCi0gICAgICAgIHNtbGFsICAgIHIxMixyNCxyOCxyMTIKLSAgICAgICAgbGRyICAgICAgcjEyLFtyMSwjNF0KLSAgICAgICAgbGRyICAgICAgcjcsW3IyLCMweDQwXQotICAgICAgICBzbWxhbCAgICByNixyNCxyMTIscjYKLQotICAgICAgICBsZHIgICAgICByMTIsW3IxLCM4XQotICAgICAgICBsZHIgICAgICByNixbcjIsIzB4MTgwXQotICAgICAgICBzbWxhbCAgICByNyxyNSxyMTIscjcKLSAgICAgICAgbGRyICAgICAgcjEyLFtyMiwjMHgxMDBdCi0gICAgICAgIGxkciAgICAgIHI3LFtyMSwjMHhjXQotICAgICAgICBsZHIgICAgICByMixbcjIsIzB4MTQwXQotICAgICAgICBzbWxhbCAgICByMTIscjQscjcscjEyCi0gICAgICAgIGxkciAgICAgIHIxMixbcjEsIzB4MTBdCi0gICAgICAgIGFkZCAgICAgIHIzLHIzLCMweDgwCi0gICAgICAgIHNtbGFsICAgIHI2LHI0LHIxMixyNgotICAgICAgICBsZHIgICAgICByNixbcjEsIzB4MTRdCi0gICAgICAgIGNtcCAgICAgIHIzLCMweDIxMAotICAgICAgICBzbWxhbCAgICByMixyNSxyNixyMgotICAgICAgICBhZGQgICAgICByMSxyMSwjMHgxOAotCi0gICAgICAgIGJsdCAgICAgIFBvbHlQaF9maWx0ZXJfbG9vcDIKLSAgICAgICAgbW92ICAgICAgcjAscjQsYXNyICM2Ci0gICAgICAgIG1vdiAgICAgIHIyLHIwLGFzciAjMTUKLSAgICAgICAgdGVxICAgICAgcjIscjAsYXNyICMzMQotICAgICAgICBsZHJuZSAgICByMTIsTE9XXzE2QklUUwotICAgICAgICBsZHIgICAgICByMSxbc3AsIzhdCi0gICAgICAgIGVvcm5lICAgIHIwLHIxMixyMCxhc3IgIzMxCi0gICAgICAgIHN0cmggICAgIHIwLFtyMSwjMF0KLSAgICAgICAgbW92ICAgICAgcjAscjUsYXNyICM2Ci0gICAgICAgIG1vdiAgICAgIHIyLHIwLGFzciAjMTUKLSAgICAgICAgdGVxICAgICAgcjIscjAsYXNyICMzMQotICAgICAgICBsZHJuZSAgICByMTIsTE9XXzE2QklUUwotICAgICAgICBsZHIgICAgICByMixbc3BdCi0gICAgICAgIG1vdiAgICAgIHIxLCMweDEwCi0gICAgICAgIGVvcm5lICAgIHIwLHIxMixyMCxhc3IgIzMxCi0gICAgICAgIGxkciAgICAgIHIxMixbc3AsIzhdCi0gICAgICAgIG1vdiAgICAgIHIxLHIxLGxzbCByMgotICAgICAgICBhZGQgICAgICByMSxyMTIscjEsbHNsICMxCi0gICAgICAgIHN0cmggICAgIHIwLFtyMV0KLSAgICAgICAgYWRkICAgICAgc3Asc3AsIzB4MTAKLSAgICAgICAgbGRtZmQgICAgc3AhLHtyNC1yMTEscGN9Ci0KLQotUG9seVBoX2ZpbHRlcl9jb2VmZgotICAgICAgICBEQ0QgICAgICBwcW1mU3ludGhXaW4KLUxPV18xNkJJVFMKLSAgICAgICAgRENEICAgICAgMHgwMDAwN2ZmZgotCi0g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zZV9maWx0ZXJfd2luZG93Ci0KLXB2bXAzX3BvbHlwaGFzZV9maWx0ZXJfd2luZG93OgotICAgICAgICBzdG1mZCAgICBzcCEse3IwLXIyLHI0LXIxMSxscn0KLQotICAgICAgICBzdWIgICAgICBzcCxzcCwjNAotICAgICAgICBsZHIgICAgICByMixbc3AsIzB4Y10KLSAgICAgICAgbGRyICAgICAgcjEsUG9seVBoX2ZpbHRlcl9jb2VmZgotCQkKLSAgICAgICAgc3ViICAgICAgcjIscjIsIzEKLSAgICAgICAgbW92ICAgICAgcjEwLCMxCi0gICAgICAgIHN0ciAgICAgIHIyLFtzcF0KLQotQCBBY2N1bXVsYXRvcnMgcjksIHIxMTo6PiBJbml0aWFsaXphdGlvbgotCi1Mb29wX2o6Ci0gICAgICAgIG1vdiAgICAgIHI5LCAgIzB4MjAKLSAgICAgICAgbW92ICAgICAgcjExLCAjMHgyMAotICAgICAgICBtb3YgICAgICByNCwgICMweDEwCi1Mb29wX2k6Ci0gICAgICAgIGFkZCAgICAgIHIyLHI0LHIxMAotICAgICAgICBhZGQgICAgICByMyxyMCxyMixsc2wgIzIKLSAgICAgICAgc3ViICAgICAgcjIscjQscjEwCi0gICAgICAgIGxkciAgICAgIHI1LFtyM10KLSAgICAgICAgbGRyICAgICAgbHIsW3IxXQotICAgICAgICBhZGQgICAgICByMTIscjAscjIsbHNsICMyCi0gICAgICAgIGxkciAgICAgIHI2LFtyMTIsIzB4NzgwXQotICAgICAgICBzbWxhbCAgICByMixyOSxscixyNQotICAgICAgICBzbWxhbCAgICByMixyMTEsbHIscjYKLSAgICAgICAgbGRyICAgICAgcjIsW3IxLCM0XQotICAgICAgICBsZHIgICAgICByNyxbcjEyLCMweDgwXQotICAgICAgICBzbWxhbCAgICByNSxyMTEscjIscjUKLSAgICAgICAgc211bGwgICAgcjYscjUscjIscjYKLSAgICAgICAgc3ViICAgICAgcjkscjkscjUKLSAgICAgICAgbGRyICAgICAgcjUsW3IxLCM4XQotICAgICAgICBsZHIgICAgICByOCxbcjMsIzB4NzAwXQotICAgICAgICBhZGQgICAgICByNCxyNCwjMHgyMDAKLSAgICAgICAgc21sYWwgICAgcjYscjkscjUscjcKLSAgICAgICAgc211bGwgICAgcjYscjIscjUscjgKLSAgICAgICAgbGRyICAgICAgcjUsW3IxLCMweGNdCi0gICAgICAgIHN1YiAgICAgIHIxMSxyMTEscjIKLSAgICAgICAgc21sYWwgICAgcjgscjkscjUscjgKLSAgICAgICAgc21sYWwgICAgcjcscjExLHI1LHI3Ci0gICAgICAgIGxkciAgICAgIHI1LFtyMywjMHgxMDBdCi0gICAgICAgIGxkciAgICAgIHIyLFtyMSwjMHgxMF0KLSAgICAgICAgbGRyICAgICAgcjYsW3IxMiwjMHg2ODBdCi0gICAgICAgIHNtbGFsICAgIGxyLHI5LHIyLHI1Ci0gICAgICAgIHNtbGFsICAgIGxyLHIxMSxyMixyNgotICAgICAgICBsZHIgICAgICByMixbcjEsIzB4MTRdCi0gICAgICAgIGxkciAgICAgIHI3LFtyMTIsIzB4MTgwXQotICAgICAgICBzbWxhbCAgICByNSxyMTEscjIscjUKLSAgICAgICAgc211bGwgICAgcjYscjUscjIscjYKLSAgICAgICAgbGRyICAgICAgcjYsW3IxLCMweDE4XQotICAgICAgICBsZHIgICAgICByOCxbcjMsIzB4NjAwXQotICAgICAgICBzdWIgICAgICByOSxyOSxyNQotICAgICAgICBzbWxhbCAgICByNSxyOSxyNixyNwotICAgICAgICBzbXVsbCAgICByMixyNSxyNixyOAotICAgICAgICBsZHIgICAgICByNixbcjEsIzB4MWNdCi0gICAgICAgIHN1YiAgICAgIHIxMSxyMTEscjUKLSAgICAgICAgc21sYWwgICAgcjgscjkscjYscjgKLSAgICAgICAgbGRyICAgICAgcjIsW3IxLCMweDIwXQotICAgICAgICBsZHIgICAgICByNSxbcjMsIzB4MjAwXQotICAgICAgICBzbWxhbCAgICByNyxyMTEscjYscjcKLSAgICAgICAgbGRyICAgICAgcjYsW3IxMiwjMHg1ODBdCi0gICAgICAgIHNtbGFsICAgIGxyLHI5LHIyLHI1Ci0gICAgICAgIHNtbGFsICAgIGxyLHIxMSxyMixyNgotICAgICAgICBsZHIgICAgICByMixbcjEsIzB4MjRdCi0gICAgICAgIGxkciAgICAgIHI3LFtyMTIsIzB4MjgwXQotICAgICAgICBzbWxhbCAgICByNSxyMTEscjIscjUKLSAgICAgICAgc211bGwgICAgcjYscjUscjIscjYKLSAgICAgICAgbGRyICAgICAgcjYsW3IxLCMweDI4XQotICAgICAgICBsZHIgICAgICByOCxbcjMsIzB4NTAwXQotICAgICAgICBzdWIgICAgICByOSxyOSxyNQotICAgICAgICBzbWxhbCAgICByNSxyOSxyNixyNwotICAgICAgICBzbXVsbCAgICByMixyNSxyNixyOAotICAgICAgICBsZHIgICAgICByNixbcjEsIzB4MmNdCi0gICAgICAgIHN1YiAgICAgIHIxMSxyMTEscjUKLQotICAgICAgICBzbWxhbCAgICByOCxyOSxyNixyOAotICAgICAgICBzbWxhbCAgICByNyxyMTEscjYscjcKLSAgICAgICAgbGRyICAgICAgcjUsW3IzLCMweDMwMF0KLSAgICAgICAgbGRyICAgICAgcjgsW3IxLCMweDMwXQotICAgICAgICBsZHIgICAgICByNixbcjEyLCMweDQ4MF0KLSAgICAgICAgc21sYWwgICAgcjcscjkscjgscjUKLSAgICAgICAgc21sYWwgICAgcjcscjExLHI4LHI2Ci0gICAgICAgIGxkciAgICAgIHI4LFtyMSwjMHgzNF0KLSAgICAgICAgbGRyICAgICAgcjEyLFtyMTIsIzB4MzgwXQotICAgICAgICBzbWxhbCAgICByNSxyMTEscjgscjUKLSAgICAgICAgc211bGwgICAgcjYscjUscjgscjYKLSAgICAgICAgbGRyICAgICAgcjYsW3IxLCMweDM4XQotCi0KLSAgICAgICAgbGRyICAgICAgcjMsW3IzLCMweDQwMF0KLSAgICAgICAgc3ViICAgICAgcjkscjkscjUKLSAgICAgICAgc21sYWwgICAgcjcscjkscjYscjEyCi0gICAgICAgIHNtdWxsICAgIHI4LHI3LHI2LHIzCi0gICAgICAgIGNtcCAgICAgIHI0LCMweDIxMAotICAgICAgICBzdWIgICAgICByMTEscjExLHI3Ci0KLSAgICAgICAgbGRyICAgICAgcjIsW3IxLCMweDNjXQotICAgICAgICBhZGQgICAgICByMSxyMSwjMHg0MAotICAgICAgICBzbWxhbCAgICByMyxyOSxyMixyMwotICAgICAgICBzbWxhbCAgICByMTIscjExLHIyLHIxMgotCi0gICAgICAgIGJsdCAgICAgIExvb3BfaQotCi0gICAgICAgIG1vdiAgICAgIHIzLHI5LCBhc3IgIzYKLSAgICAgICAgbW92ICAgICAgcjQscjMsIGFzciAjMTUKLSAgICAgICAgdGVxICAgICAgcjQscjMsIGFzciAjMzEKLSAgICAgICAgbGRyICAgICAgcjEyLExPV18xNkJJVFMKLSAgICAgICAgbGRyICAgICAgcjIsW3NwXQotICAgICAgICBlb3JuZSAgICByMyxyMTIscjMsYXNyICMzMQotICAgICAgICBsZHIgICAgICByNCxbc3AsIzhdCi0gICAgICAgIG1vdiAgICAgIHIyLHIxMCxsc2wgcjIKLSAgICAgICAgYWRkICAgICAgcjQscjQscjIsbHNsICMxCi0gICAgICAgIHN0cmggICAgIHIzLFtyNF0KLQotICAgICAgICBtb3YgICAgICByMyxyMTEsYXNyICM2Ci0gICAgICAgIG1vdiAgICAgIHI0LHIzLGFzciAjMTUKLSAgICAgICAgdGVxICAgICAgcjQscjMsYXNyICMzMQotICAgICAgICBlb3JuZSAgICByMyxyMTIscjMsYXNyICMzMQotICAgICAgICBsZHIgICAgICByMTIsW3NwLCMweGNdCi0gICAgICAgIGxkciAgICAgIHIxMSxbc3AsIzhdCi0gICAgICAgIHJzYiAgICAgIHIyLHIyLHIxMixsc2wgIzUKLSAgICAgICAgYWRkICAgICAgcjIscjExLHIyLGxzbCAjMQotICAgICAgICBzdHJoICAgICByMyxbcjJdCi0KLSAgICAgICAgYWRkICAgICAgcjEwLHIxMCwjMQotICAgICAgICBjbXAgICAgICByMTAsIzB4MTAKLSAgICAgICAgYmx0ICAgICAgTG9vcF9qCi0KLUAgQWNjdW11bGF0b3JzIHI0LCByNSBJbml0aWFsaXphdGlvbgotCi0gICAgICAgIG1vdiAgICAgIHI0LCMweDIwCi0gICAgICAgIG1vdiAgICAgIHI1LCMweDIwCi0gICAgICAgIG1vdiAgICAgIHIzLCMweDEwCi1Qb2x5UGhfZmlsdGVyX2xvb3AyOgotICAgICAgICBhZGQgICAgICByMixyMCxyMyxsc2wgIzIKLSAgICAgICAgbGRyICAgICAgcjEyLFtyMl0KLSAgICAgICAgbGRyICAgICAgcjgsW3IxXQotICAgICAgICBsZHIgICAgICByNixbcjIsIzB4ODBdCi0gICAgICAgIHNtbGFsICAgIHIxMixyNCxyOCxyMTIKLSAgICAgICAgbGRyICAgICAgcjEyLFtyMSwjNF0KLSAgICAgICAgbGRyICAgICAgcjcsW3IyLCMweDQwXQotICAgICAgICBzbWxhbCAgICByNixyNCxyMTIscjYKLQotICAgICAgICBsZHIgICAgICByMTIsW3IxLCM4XQotICAgICAgICBsZHIgICAgICByNixbcjIsIzB4MTgwXQotICAgICAgICBzbWxhbCAgICByNyxyNSxyMTIscjcKLSAgICAgICAgbGRyICAgICAgcjEyLFtyMiwjMHgxMDBdCi0gICAgICAgIGxkciAgICAgIHI3LFtyMSwjMHhjXQotICAgICAgICBsZHIgICAgICByMixbcjIsIzB4MTQwXQotICAgICAgICBzbWxhbCAgICByMTIscjQscjcscjEyCi0gICAgICAgIGxkciAgICAgIHIxMixbcjEsIzB4MTBdCi0gICAgICAgIGFkZCAgICAgIHIzLHIzLCMweDgwCi0gICAgICAgIHNtbGFsICAgIHI2LHI0LHIxMixyNgotICAgICAgICBsZHIgICAgICByNixbcjEsIzB4MTRdCi0gICAgICAgIGNtcCAgICAgIHIzLCMweDIxMAotICAgICAgICBzbWxhbCAgICByMixyNSxyNixyMgotICAgICAgICBhZGQgICAgICByMSxyMSwjMHgxOAotCi0gICAgICAgIGJsdCAgICAgIFBvbHlQaF9maWx0ZXJfbG9vcDIKLSAgICAgICAgbW92ICAgICAgcjAscjQsYXNyICM2Ci0gICAgICAgIG1vdiAgICAgIHIyLHIwLGFzciAjMTUKLSAgICAgICAgdGVxICAgICAgcjIscjAsYXNyICMzMQotICAgICAgICBsZHJuZSAgICByMTIsTE9XXzE2QklUUwotICAgICAgICBsZHIgICAgICByMSxbc3AsIzhdCi0gICAgICAgIGVvcm5lICAgIHIwLHIxMixyMCxhc3IgIzMxCi0gICAgICAgIHN0cmggICAgIHIwLFtyMSwjMF0KLSAgICAgICAgbW92ICAgICAgcjAscjUsYXNyICM2Ci0gICAgICAgIG1vdiAgICAgIHIyLHIwLGFzciAjMTUKLSAgICAgICAgdGVxICAgICAgcjIscjAsYXNyICMzMQotICAgICAgICBsZHJuZSAgICByMTIsTE9XXzE2QklUUwotICAgICAgICBsZHIgICAgICByMixbc3BdCi0gICAgICAgIG1vdiAgICAgIHIxLCMweDEwCi0gICAgICAgIGVvcm5lICAgIHIwLHIxMixyMCxhc3IgIzMxCi0gICAgICAgIGxkciAgICAgIHIxMixbc3AsIzhdCi0gICAgICAgIG1vdiAgICAgIHIxLHIxLGxzbCByMgotICAgICAgICBhZGQgICAgICByMSxyMTIscjEsbHNsICMxCi0gICAgICAgIHN0cmggICAgIHIwLFtyMV0KLSAgICAgICAgYWRkICAgICAgc3Asc3AsIzB4MTAKLSAgICAgICAgbGRtZmQgICAgc3AhLHtyNC1yMTEscGN9Ci0KLVBvbHlQaF9maWx0ZXJfY29lZmY6Ci0gICAgICAgIC53b3JkICAgICAgcHFtZlN5bnRoV2luCi1MT1dfMTZCSVRTOgotICAgICAgICAud29yZCAgICAgIDB4MDAwMDdmZmYKLQpkaWZmIC0tZ2l0IGEvbWVkaWEvbGlic3RhZ2VmcmlnaHQvY29kZWNzL21wM2RlYy9zcmMvYXNtL3B2bXAzX3BvbHlwaGFzZV9maWx0ZXJfd2luZG93X3dtLmFzbSBiL21lZGlhL2xpYnN0YWdlZnJpZ2h0L2NvZGVjcy9tcDNk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l9jb2VmZgotCQkKLSAgICAgICAgc3ViICAgICAgcjIscjIsIzEKLSAgICAgICAgbW92ICAgICAgcjEwLCMxCi0gICAgICAgIHN0ciAgICAgIHIyLFtzcF0KLQotOyBBY2N1bXVsYXRvcnMgcjksIHIxMTo6PiBJbml0aWFsaXphdGlvbgotCi1Mb29wX2oKLSAgICAgICAgbW92ICAgICAgcjksICAjMHgyMAotICAgICAgICBtb3YgICAgICByMTEsICMweDIwCi0gICAgICAgIG1vdiAgICAgIHI0LCAgIzB4MTAKLUxvb3BfaQotICAgICAgICBhZGQgICAgICByMixyNCxyMTAKLSAgICAgICAgYWRkICAgICAgcjMscjAscjIsbHNsICMyCi0gICAgICAgIHN1YiAgICAgIHIyLHI0LHIxMAotICAgICAgICBsZHIgICAgICByNSxbcjNdCi0gICAgICAgIGxkciAgICAgIGxyLFtyMV0KLSAgICAgICAgYWRkICAgICAgcjEyLHIwLHIyLGxzbCAjMgotICAgICAgICBsZHIgICAgICByNixbcjEyLCMweDc4MF0KLSAgICAgICAgc21sYWwgICAgcjIscjksbHIscjUKLSAgICAgICAgc21sYWwgICAgcjIscjExLGxyLHI2Ci0gICAgICAgIGxkciAgICAgIHIyLFtyMSwjNF0KLSAgICAgICAgbGRyICAgICAgcjcsW3IxMiwjMHg4MF0KLSAgICAgICAgc21sYWwgICAgcjUscjExLHIyLHI1Ci0gICAgICAgIHNtdWxsICAgIHI2LHI1LHIyLHI2Ci0gICAgICAgIHN1YiAgICAgIHI5LHI5LHI1Ci0gICAgICAgIGxkciAgICAgIHI1LFtyMSwjOF0KLSAgICAgICAgbGRyICAgICAgcjgsW3IzLCMweDcwMF0KLSAgICAgICAgYWRkICAgICAgcjQscjQsIzB4MjAwCi0gICAgICAgIHNtbGFsICAgIHI2LHI5LHI1LHI3Ci0gICAgICAgIHNtdWxsICAgIHI2LHIyLHI1LHI4Ci0gICAgICAgIGxkciAgICAgIHI1LFtyMSwjMHhjXQotICAgICAgICBzdWIgICAgICByMTEscjExLHIyCi0gICAgICAgIHNtbGFsICAgIHI4LHI5LHI1LHI4Ci0gICAgICAgIHNtbGFsICAgIHI3LHIxMSxyNSxyNwotICAgICAgICBsZHIgICAgICByNSxbcjMsIzB4MTAwXQotICAgICAgICBsZHIgICAgICByMixbcjEsIzB4MTBdCi0gICAgICAgIGxkciAgICAgIHI2LFtyMTIsIzB4NjgwXQotICAgICAgICBzbWxhbCAgICBscixyOSxyMixyNQotICAgICAgICBzbWxhbCAgICBscixyMTEscjIscjYKLSAgICAgICAgbGRyICAgICAgcjIsW3IxLCMweDE0XQotICAgICAgICBsZHIgICAgICByNyxbcjEyLCMweDE4MF0KLSAgICAgICAgc21sYWwgICAgcjUscjExLHIyLHI1Ci0gICAgICAgIHNtdWxsICAgIHI2LHI1LHIyLHI2Ci0gICAgICAgIGxkciAgICAgIHI2LFtyMSwjMHgxOF0KLSAgICAgICAgbGRyICAgICAgcjgsW3IzLCMweDYwMF0KLSAgICAgICAgc3ViICAgICAgcjkscjkscjUKLSAgICAgICAgc21sYWwgICAgcjUscjkscjYscjcKLSAgICAgICAgc211bGwgICAgcjIscjUscjYscjgKLSAgICAgICAgbGRyICAgICAgcjYsW3IxLCMweDFjXQotICAgICAgICBzdWIgICAgICByMTEscjExLHI1Ci0gICAgICAgIHNtbGFsICAgIHI4LHI5LHI2LHI4Ci0gICAgICAgIGxkciAgICAgIHIyLFtyMSwjMHgyMF0KLSAgICAgICAgbGRyICAgICAgcjUsW3IzLCMweDIwMF0KLSAgICAgICAgc21sYWwgICAgcjcscjExLHI2LHI3Ci0gICAgICAgIGxkciAgICAgIHI2LFtyMTIsIzB4NTgwXQotICAgICAgICBzbWxhbCAgICBscixyOSxyMixyNQotICAgICAgICBzbWxhbCAgICBscixyMTEscjIscjYKLSAgICAgICAgbGRyICAgICAgcjIsW3IxLCMweDI0XQotICAgICAgICBsZHIgICAgICByNyxbcjEyLCMweDI4MF0KLSAgICAgICAgc21sYWwgICAgcjUscjExLHIyLHI1Ci0gICAgICAgIHNtdWxsICAgIHI2LHI1LHIyLHI2Ci0gICAgICAgIGxkciAgICAgIHI2LFtyMSwjMHgyOF0KLSAgICAgICAgbGRyICAgICAgcjgsW3IzLCMweDUwMF0KLSAgICAgICAgc3ViICAgICAgcjkscjkscjUKLSAgICAgICAgc21sYWwgICAgcjUscjkscjYscjcKLSAgICAgICAgc211bGwgICAgcjIscjUscjYscjgKLSAgICAgICAgbGRyICAgICAgcjYsW3IxLCMweDJjXQotICAgICAgICBzdWIgICAgICByMTEscjExLHI1Ci0KLSAgICAgICAgc21sYWwgICAgcjgscjkscjYscjgKLSAgICAgICAgc21sYWwgICAgcjcscjExLHI2LHI3Ci0gICAgICAgIGxkciAgICAgIHI1LFtyMywjMHgzMDBdCi0gICAgICAgIGxkciAgICAgIHI4LFtyMSwjMHgzMF0KLSAgICAgICAgbGRyICAgICAgcjYsW3IxMiwjMHg0ODBdCi0gICAgICAgIHNtbGFsICAgIHI3LHI5LHI4LHI1Ci0gICAgICAgIHNtbGFsICAgIHI3LHIxMSxyOCxyNgotICAgICAgICBsZHIgICAgICByOCxbcjEsIzB4MzRdCi0gICAgICAgIGxkciAgICAgIHIxMixbcjEyLCMweDM4MF0KLSAgICAgICAgc21sYWwgICAgcjUscjExLHI4LHI1Ci0gICAgICAgIHNtdWxsICAgIHI2LHI1LHI4LHI2Ci0gICAgICAgIGxkciAgICAgIHI2LFtyMSwjMHgzOF0KLQotCi0gICAgICAgIGxkciAgICAgIHIzLFtyMywjMHg0MDBdCi0gICAgICAgIHN1YiAgICAgIHI5LHI5LHI1Ci0gICAgICAgIHNtbGFsICAgIHI3LHI5LHI2LHIxMgotICAgICAgICBzbXVsbCAgICByOCxyNyxyNixyMwotICAgICAgICBjbXAgICAgICByNCwjMHgyMTAKLSAgICAgICAgc3ViICAgICAgcjExLHIxMSxyNwotCi0gICAgICAgIGxkciAgICAgIHIyLFtyMSwjMHgzY10KLSAgICAgICAgYWRkICAgICAgcjEscjEsIzB4NDAKLSAgICAgICAgc21sYWwgICAgcjMscjkscjIscjMKLSAgICAgICAgc21sYWwgICAgcjEyLHIxMSxyMixyMTIKLQotICAgICAgICBibHQgICAgICBMb29wX2kKLQotICAgICAgICBtb3YgICAgICByMyxyOSwgYXNyICM2Ci0gICAgICAgIG1vdiAgICAgIHI0LHIzLCBhc3IgIzE1Ci0gICAgICAgIHRlcSAgICAgIHI0LHIzLCBhc3IgIzMxCi0gICAgICAgIGxkciAgICAgIHIxMixMT1dfMTZCSVRTCi0gICAgICAgIGxkciAgICAgIHIyLFtzcF0KLSAgICAgICAgZW9ybmUgICAgcjMscjEyLHIzLGFzciAjMzEKLSAgICAgICAgbGRyICAgICAgcjQsW3NwLCM4XQotICAgICAgICBtb3YgICAgICByMixyMTAsbHNsIHIyCi0gICAgICAgIGFkZCAgICAgIHI0LHI0LHIyLGxzbCAjMQotICAgICAgICBzdHJoICAgICByMyxbcjRdCi0KLSAgICAgICAgbW92ICAgICAgcjMscjExLGFzciAjNgotICAgICAgICBtb3YgICAgICByNCxyMyxhc3IgIzE1Ci0gICAgICAgIHRlcSAgICAgIHI0LHIzLGFzciAjMzEKLSAgICAgICAgZW9ybmUgICAgcjMscjEyLHIzLGFzciAjMzEKLSAgICAgICAgbGRyICAgICAgcjEyLFtzcCwjMHhjXQotICAgICAgICBsZHIgICAgICByMTEsW3NwLCM4XQotICAgICAgICByc2IgICAgICByMixyMixyMTIsbHNsICM1Ci0gICAgICAgIGFkZCAgICAgIHIyLHIxMSxyMixsc2wgIzEKLSAgICAgICAgc3RyaCAgICAgcjMsW3IyXQotCi0gICAgICAgIGFkZCAgICAgIHIxMCxyMTAsIzEKLSAgICAgICAgY21wICAgICAgcjEwLCMweDEwCi0gICAgICAgIGJsdCAgICAgIExvb3BfagotCi07IEFjY3VtdWxhdG9ycyByNCwgcjUgSW5pdGlhbGl6YXRpb24KLQotICAgICAgICBtb3YgICAgICByNCwjMHgyMAotICAgICAgICBtb3YgICAgICByNSwjMHgyMAotICAgICAgICBtb3YgICAgICByMywjMHgxMAotUG9seVBoX2ZpbHRlcl9sb29wMgotICAgICAgICBhZGQgICAgICByMixyMCxyMyxsc2wgIzIKLSAgICAgICAgbGRyICAgICAgcjEyLFtyMl0KLSAgICAgICAgbGRyICAgICAgcjgsW3IxXQotICAgICAgICBsZHIgICAgICByNixbcjIsIzB4ODBdCi0gICAgICAgIHNtbGFsICAgIHIxMixyNCxyOCxyMTIKLSAgICAgICAgbGRyICAgICAgcjEyLFtyMSwjNF0KLSAgICAgICAgbGRyICAgICAgcjcsW3IyLCMweDQwXQotICAgICAgICBzbWxhbCAgICByNixyNCxyMTIscjYKLQotICAgICAgICBsZHIgICAgICByMTIsW3IxLCM4XQotICAgICAgICBsZHIgICAgICByNixbcjIsIzB4MTgwXQotICAgICAgICBzbWxhbCAgICByNyxyNSxyMTIscjcKLSAgICAgICAgbGRyICAgICAgcjEyLFtyMiwjMHgxMDBdCi0gICAgICAgIGxkciAgICAgIHI3LFtyMSwjMHhjXQotICAgICAgICBsZHIgICAgICByMixbcjIsIzB4MTQwXQotICAgICAgICBzbWxhbCAgICByMTIscjQscjcscjEyCi0gICAgICAgIGxkciAgICAgIHIxMixbcjEsIzB4MTBdCi0gICAgICAgIGFkZCAgICAgIHIzLHIzLCMweDgwCi0gICAgICAgIHNtbGFsICAgIHI2LHI0LHIxMixyNgotICAgICAgICBsZHIgICAgICByNixbcjEsIzB4MTRdCi0gICAgICAgIGNtcCAgICAgIHIzLCMweDIxMAotICAgICAgICBzbWxhbCAgICByMixyNSxyNixyMgotICAgICAgICBhZGQgICAgICByMSxyMSwjMHgxOAotCi0gICAgICAgIGJsdCAgICAgIFBvbHlQaF9maWx0ZXJfbG9vcDIKLSAgICAgICAgbW92ICAgICAgcjAscjQsYXNyICM2Ci0gICAgICAgIG1vdiAgICAgIHIyLHIwLGFzciAjMTUKLSAgICAgICAgdGVxICAgICAgcjIscjAsYXNyICMzMQotICAgICAgICBsZHJuZSAgICByMTIsTE9XXzE2QklUUwotICAgICAgICBsZHIgICAgICByMSxbc3AsIzhdCi0gICAgICAgIGVvcm5lICAgIHIwLHIxMixyMCxhc3IgIzMxCi0gICAgICAgIHN0cmggICAgIHIwLFtyMSwjMF0KLSAgICAgICAgbW92ICAgICAgcjAscjUsYXNyICM2Ci0gICAgICAgIG1vdiAgICAgIHIyLHIwLGFzciAjMTUKLSAgICAgICAgdGVxICAgICAgcjIscjAsYXNyICMzMQotICAgICAgICBsZHJuZSAgICByMTIsTE9XXzE2QklUUwotICAgICAgICBsZHIgICAgICByMixbc3BdCi0gICAgICAgIG1vdiAgICAgIHIxLCMweDEwCi0gICAgICAgIGVvcm5lICAgIHIwLHIxMixyMCxhc3IgIzMxCi0gICAgICAgIGxkciAgICAgIHIxMixbc3AsIzhdCi0gICAgICAgIG1vdiAgICAgIHIxLHIxLGxzbCByMgotICAgICAgICBhZGQgICAgICByMSxyMTIscjEsbHNsICMxCi0gICAgICAgIHN0cmggICAgIHIwLFtyMV0KLSAgICAgICAgYWRkICAgICAgc3Asc3AsIzB4MTAKLSAgICAgICAgbGRtZmQgICAgc3AhLHtyNC1yMTEscGN9Ci0KLQotUG9seVBoX2ZpbHRlcl9jb2VmZgotICAgICAgICBEQ0QgICAgICBwcW1mU3ludGhXaW4KLUxPV18xNkJJVFMKLSAgICAgICAgRENEICAgICAgMHgwMDAwN2ZmZgotCQotCQlFTkRQICA7IHxwdm1wM19wb2x5cGhhc2VfZmlsdGVyX3dpbmRvd3wKLQkJRU5ECi0KZGlmZiAtLWdpdCBhL21lZGlhL2xpYnN0YWdlZnJpZ2h0L2NvZGVjcy9tcDNkZWMvc3JjL21wM19tZW1fZnVuY3MuaCBiL21lZGlhL2xpYnN0YWdlZnJpZ2h0L2NvZGVjcy9tcDNkZWMvc3JjL21wM19tZW1fZnVuY3MuaApkZWxldGVkIGZpbGUgbW9kZSAxMDA2NDQKaW5kZXggNDZlODAyMjMuLjAwMDAwMDAKLS0tIGEvbWVkaWEvbGlic3RhZ2VmcmlnaHQvY29k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F9oaTsKLSAgICAgICAgSW50MzIgcmVzdWx0NjRfbG87Ci0gICAgICAgIF9fYXNtCi0gICAgICAgIHsKLSAgICAgICAgICAgIHNtdWxsIHJlc3VsdDY0X2xvLCByZXN1bHQ2NF9oaSwgTF92YXIyLCBMX3ZhcjEKLSAgICAgICAgICAgIG1vdiAgIHJlc3VsdDY0X2xvLCByZXN1bHQ2NF9sbywgbHNyICMzMAotICAgICAgICAgICAgYWRkICAgcmVzdWx0NjRfaGksIHJlc3VsdDY0X2xvLCByZXN1bHQ2NF9oaSwgYXNsICAjMgotICAgICAgICB9Ci0gICAgICAgIHJldHVybiAocmVzdWx0NjRfaGkpOwotICAgIH0KLQotICAgIF9faW5saW5lICBJbnQzMiBmeHBfbWFjMzJfUTMwKGNvbnN0IEludDMyIExfdmFyMSwgY29uc3QgSW50MzIgTF92YXIyLCBJbnQzMiBMX2FkZCkKLSAgICB7Ci0gICAgICAgIEludDMyIHJlc3VsdDY0X2hpOwotICAgICAgICBJbnQzMiByZXN1bHQ2NF9sbzsKLSAgICAgICAgX19hc20KLSAgICAgICAgewotICAgICAgICAgICAgc211bGwgcmVzdWx0NjRfbG8sIHJlc3VsdDY0X2hpLCBMX3ZhcjIsIExfdmFyMQotICAgICAgICAgICAgYWRkIExfYWRkLCBMX2FkZCwgcmVzdWx0NjRfaGksIGFzbCAgIzIKLSAgICAgICAgICAgIGFkZCBMX2FkZCwgTF9hZGQsIHJlc3VsdDY0X2xvLCBsc3IgICMzMAotICAgICAgICB9Ci0gICAgICAgIHJldHVybiAoTF9hZGQpOwotICAgIH0KLQotCi0KLSNkZWZpbmUgUWZtdF8zMShhKSAgIChJbnQzMikoYSoweDdGRkZGRkZGICsgKGE+PTA/MC41RjotMC41RikpCi0KLQotCi0gICAgX19pbmxpbmUgIEludDMyIGZ4cF9tdWwzMl9RMzIoSW50MzIgTF92YXIxLCBjb25zdCBJbnQzMiBMX3ZhcjIpCi0gICAgewotICAgICAgICBJbnQzMiByZXN1bHQ2NF9oaTsKLSAgICAgICAgX19hc20KLSAgICAgICAgewotICAgICAgICAgICAgc211bGwgTF92YXIxLCByZXN1bHQ2NF9oaSwgTF92YXIyLCBMX3ZhcjEKLSAgICAgICAgfQotICAgICAgICByZXR1cm4gKHJlc3VsdDY0X2hpKTsKLSAgICB9Ci0KLSAgICBfX2lubGluZSAgSW50MzIgZnhwX211bDMyX1EyOChjb25zdCBJbnQzMiBMX3ZhcjEsIGNvbnN0IEludDMyIExfdmFyMikKLSAgICB7Ci0KLSAgICAgICAgSW50MzIgcmVzdWx0NjRfaGk7Ci0gICAgICAgIEludDMyIHJlc3VsdDY0X2xvOwotICAgICAgICBfX2FzbQotICAgICAgICB7Ci0gICAgICAgICAgICBzbXVsbCByZXN1bHQ2NF9sbywgcmVzdWx0NjRfaGksIExfdmFyMiwgTF92YXIxCi0gICAgICAgICAgICBtb3YgICByZXN1bHQ2NF9sbywgcmVzdWx0NjRfbG8sIGxzciAjMjgKLSAgICAgICAgICAgIGFkZCAgIHJlc3VsdDY0X2hpLCByZXN1bHQ2NF9sbywgcmVzdWx0NjRfaGksIGFzbCAgIzQKLSAgICAgICAgfQotICAgICAgICByZXR1cm4gKHJlc3VsdDY0X2hpKTsKLSAgICB9Ci0KLQotICAgIF9faW5saW5lICBJbnQzMiBmeHBfbXVsMzJfUTI3KGNvbnN0IEludDMyIExfdmFyMSwgY29uc3QgSW50MzIgTF92YXIyKQotICAgIHsKLQotICAgICAgICBJbnQzMiByZXN1bHQ2NF9oaTsKLSAgICAgICAgSW50MzIgcmVzdWx0NjRfbG87Ci0gICAgICAgIF9fYXNtCi0gICAgICAgIHsKLSAgICAgICAgICAgIHNtdWxsIHJlc3VsdDY0X2xvLCByZXN1bHQ2NF9oaSwgTF92YXIyLCBMX3ZhcjEKLSAgICAgICAgICAgIG1vdiAgIHJlc3VsdDY0X2xvLCByZXN1bHQ2NF9sbywgbHNyICMyNwotICAgICAgICAgICAgYWRkICAgcmVzdWx0NjRfaGksIHJlc3VsdDY0X2xvLCByZXN1bHQ2NF9oaSwgYXNsICAjNQotICAgICAgICB9Ci0gICAgICAgIHJldHVybiAocmVzdWx0NjRfaGkpOwotICAgIH0KLQotCi0gICAgX19pbmxpbmUgIEludDMyIGZ4cF9tdWwzMl9RMjYoSW50MzIgTF92YXIxLCAgSW50MzIgTF92YXIyKQotICAgIHsKLQotICAgICAgICBJbnQzMiByZXN1bHQ2NF9oaTsKLSAgICAgICAgSW50MzIgcmVzdWx0NjRfbG87Ci0gICAgICAgIF9fYXNtCi0gICAgICAgIHsKLSAgICAgICAgICAgIHNtdWxsIHJlc3VsdDY0X2xvLCByZXN1bHQ2NF9oaSwgTF92YXIyLCBMX3ZhcjEKLSAgICAgICAgICAgIG1vdiAgIHJlc3VsdDY0X2xvLCByZXN1bHQ2NF9sbywgbHNyICMyNgotICAgICAgICAgICAgYWRkICAgcmVzdWx0NjRfaGksIHJlc3VsdDY0X2xvLCByZXN1bHQ2NF9oaSwgYXNsICAjNgotICAgICAgICB9Ci0gICAgICAgIHJldHVybiAocmVzdWx0NjRfaGkpOwotICAgIH0KLQotCi0KLSAgICBfX2lubGluZSAgSW50MzIgZnhwX21hYzMyX1EzMihJbnQzMiBMX2FkZCwgIEludDMyIExfdmFyMSwgY29uc3QgSW50MzIgTF92YXIyKQotICAgIHsKLSAgICAgICAgX19hc20KLSAgICAgICAgewotICAgICAgICAgICAgc21sYWwgTF92YXIxLCBMX2FkZCwgTF92YXIyLCBMX3ZhcjEKLSAgICAgICAgfQotICAgICAgICByZXR1cm4gTF9hZGQ7Ci0gICAgfQotCi0KLSAgICBfX2lubGluZSAgSW50MzIgZnhwX21zYjMyX1EzMihJbnQzMiBMX3N1YiwgIEludDMyIExfdmFyMSwgSW50MzIgTF92YXIyKQotICAgIHsKLQotICAgICAgICBfX2FzbQotICAgICAgICB7Ci0gICAgICAgICAgICBzbXVsbCAgTF92YXIyLCBMX3ZhcjEsIExfdmFyMiwgTF92YXIxCi0gICAgICAgICAgICBzdWIgIExfc3ViLCBMX3N1YiwgTF92YXIxCi0gICAgICAgIH0KLSAgICAgICAgcmV0dXJuIExfc3ViOwotICAgIH0KLQotCi0gICAgX19pbmxpbmUgIEludDMyIGZ4cF9tdWwzMl9RMjkoY29uc3QgSW50MzIgTF92YXIxLCAgY29uc3QgSW50MzIgTF92YXIyKQotICAgIHsKLSAgICAgICAgSW50MzIgcmVzdWx0NjRfaGk7Ci0gICAgICAgIEludDMyIHJlc3VsdDY0X2xvOwotICAgICAgICBfX2FzbQotICAgICAgICB7Ci0gICAgICAgICAgICBzbXVsbCByZXN1bHQ2NF9sbywgcmVzdWx0NjRfaGksIExfdmFyMiwgTF92YXIxCi0gICAgICAgICAgICBtb3YgICByZXN1bHQ2NF9sbywgcmVzdWx0NjRfbG8sIGxzciAjMjkKLSAgICAgICAgICAgIGFkZCAgIHJlc3VsdDY0X2hpLCByZXN1bHQ2NF9sbywgcmVzdWx0NjRfaGksIGFzbCAgIzMKLSAgICAgICAgfQotICAgICAgICByZXR1cm4gKHJlc3VsdDY0X2hpKTsKLSAgICB9Ci0KLQotICAgIF9faW5saW5lIGludDMyIHB2X2FicyhpbnQzMiBhKQotICAgIHsKLSAgICAgICAgSW50MzIgYjsKLSAgICAgICAgLyoKLSAgICAgICAgICAgIGIgPSBhIC0gKGE8MCk7Ci0gICAgICAgICAgICBhID0gYiBeIHNpZ24oYikKLSAgICAgICAgICovCi0gICAgICAgIF9fYXNtCi0gICAgICAgIHsKLSAgICAgICAgICAgIHN1YiAgYiwgYSwgYSwgbHNyICMzMQotICAgICAgICAgICAgZW9yICBhLCBiLCBiLCBhc3IgIzMxCi0gICAgICAgIH0KLSAgICAgICAgcmV0dXJuIChhKTsKLSAgICB9Ci0KLSNlbmRpZgotCi0jaWZkZWYgX19jcGx1c3BsdXMKLX0KLSNlbmRpZgotCi0KLSNlbmRpZiAgIC8qICBQVl9NUDNERUNfRlhEX09QX0FSTSAgKi8KLQpkaWZmIC0tZ2l0IGEvbWVkaWEvbGlic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c3VsdDY0X2xvKQotICAgICAgICAgICAgICAgICAgICAgICAgICAgICA6ICJyIihyYSksCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICJyIihyYikpOwotICAgICAgICByZXR1cm4gKHJlc3VsdDY0X2hpKTsKLSAgICB9Ci0KLQotICAgIHN0YXRpYyBpbmxpbmUgaW50MzIgZnhwX21hYzMyX1EzMChjb25zdCBpbnQzMiBhLCBjb25zdCBpbnQzMiBiLCBpbnQzMiBMX2FkZCkKLXsKLSAgICAgICAgaW50MzIgcmVzdWx0NjRfaGk7Ci0gICAgICAgIGludDMyIHJlc3VsdDY0X2xvOwotICAgICAgICByZWdpc3RlciBpbnQzMiByYSA9IChpbnQzMilhOwotICAgICAgICByZWdpc3RlciBpbnQzMiByYiA9IChpbnQzMiliOwotICAgICAgICByZWdpc3RlciBpbnQzMiByYyA9IChpbnQzMilMX2FkZDsKLQotICAgICAgICBhc20gdm9sYXRpbGUoInNtdWxsICUxLCAlMCwgJTIsICUzXG5cdCIKLSAgICAgICAgICAgICAgICAgICAgICJhZGQgJTQsICU0LCAlMCwgYXNsICMyXG5cdCIKLSAgICAgICAgICAgICAgICAgICAgICJhZGQgJTAsICU0LCAlMSwgbHNyICMzMCIKLSAgICAgICAgICAgICA6ICI9JnIqaSIocmVzdWx0NjRfaGkpLAotICAgICAgICAgICAgICAgICAgICAgIj0mcippIihyZXN1bHQ2NF9sbykKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOiAiciIocmEpLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAiciIocmIpLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAiciIocmMpKTsKLQotICAgICAgICByZXR1cm4gKHJlc3VsdDY0X2hpKTsKLSAgICB9Ci0KLQotCi0gICAgc3RhdGljIGlubGluZSBpbnQzMiBmeHBfbXVsMzJfUTMyKGNvbnN0IGludDMyIGEsIGNvbnN0IGludDMyIGIpCi17Ci0gICAgICAgIGludDMyIHJlc3VsdDY0X2hpOwotICAgICAgICBpbnQzMiByZXN1bHQ2NF9sbzsKLSAgICAgICAgcmVnaXN0ZXIgaW50MzIgcmEgPSAoaW50MzIpYTsKLSAgICAgICAgcmVnaXN0ZXIgaW50MzIgcmIgPSAoaW50MzIpYjsKLSAgICAgICAgYXNtIHZvbGF0aWxlKAotICAgICAgICAgICAgInNtdWxsICUxLCAlMCwgJTIsICUzIgotICAgIDogIj0mcippIihyZXN1bHQ2NF9oaSksCi0gICAgICAgICAgICAiPSZyKmkiKHJlc3VsdDY0X2xvKQotICAgICAgICAgICAgICAgICAgICA6ICJyIihyYSksCi0gICAgICAgICAgICAgICAgICAgICJyIihyYikpOwotCi0gICAgICAgIHJldHVybiAocmVzdWx0NjRfaGkpOwotICAgIH0KLQotCi0gICAgc3RhdGljIGlubGluZSBpbnQzMiBmeHBfbXVsMzJfUTI5KGNvbnN0IGludDMyIGEsIGNvbnN0IGludDMyIGIpCi17Ci0gICAgICAgIGludDMyIHJlc3VsdDY0X2hpOwotICAgICAgICBpbnQzMiByZXN1bHQ2NF9sbzsKLSAgICAgICAgcmVnaXN0ZXIgaW50MzIgcmEgPSAoaW50MzIpYTsKLSAgICAgICAgcmVnaXN0ZXIgaW50MzIgcmIgPSAoaW50MzIpYjsKLSAgICAgICAgYXNtIHZvbGF0aWxlKCJzbXVsbCAlMSwgJTAsICUyLCAlM1xuXHQiCi0gICAgICAgICAgICAgICAgICAgICAibW92ICAgJTEsICUxLCBsc3IgIzI5XG5cdCIKLSAgICAgICAgICAgICAgICAgICAgICJhZGQgICAlMCwgJTEsICUwLCBhc2wgIzMiCi0gICAgICAgICAgICAgOiAiPSZyKmkiKHJlc3VsdDY0X2hpKSwKLSAgICAgICAgICAgICAgICAgICAgICI9JnIqaSIocmVzdWx0NjRfbG8pCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgIDogInIiKHJhKSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgInIiKHJiKSk7Ci0gICAgICAgIHJldHVybiAocmVzdWx0NjRfaGkpOwotCi0gICAgfQotCi0gICAgc3RhdGljIGlubGluZSBpbnQzMiBmeHBfbXVsMzJfUTI4KGNvbnN0IGludDMyIGEsIGNvbnN0IGludDMyIGIpCi17Ci0KLSAgICAgICAgaW50MzIgcmVzdWx0NjRfaGk7Ci0gICAgICAgIGludDMyIHJlc3VsdDY0X2xvOwotICAgICAgICByZWdpc3RlciBpbnQzMiByYSA9IChpbnQzMilhOwotICAgICAgICByZWdpc3RlciBpbnQzMiByYiA9IChpbnQzMiliOwotICAgICAgICBhc20gdm9sYXRpbGUoInNtdWxsICUxLCAlMCwgJTIsICUzXG5cdCIKLSAgICAgICAgICAgICAgICAgICAgICJtb3YgICAlMSwgJTEsIGxzciAjMjhcblx0IgotICAgICAgICAgICAgICAgICAgICAgImFkZCAgICUwLCAlMSwgJTAsIGFzbCAjNCIKLSAgICAgICAgICAgICA6ICI9JnIqaSIocmVzdWx0NjRfaGkpLAotICAgICAgICAgICAgICAgICAgICAgIj0mcippIihyZXN1bHQ2NF9sbykKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOiAiciIocmEpLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAiciIocmIpKTsKLSAgICAgICAgcmV0dXJuIChyZXN1bHQ2NF9oaSk7Ci0KLSAgICB9Ci0KLQotICAgIHN0YXRpYyBpbmxpbmUgaW50MzIgZnhwX211bDMyX1EyNyhjb25zdCBpbnQzMiBhLCBjb25zdCBpbnQzMiBiKQotewotICAgICAgICBpbnQzMiByZXN1bHQ2NF9oaTsKLSAgICAgICAgaW50MzIgcmVzdWx0NjRfbG87Ci0gICAgICAgIHJlZ2lzdGVyIGludDMyIHJhID0gKGludDMyKWE7Ci0gICAgICAgIHJlZ2lzdGVyIGludDMyIHJiID0gKGludDMyKWI7Ci0gICAgICAgIGFzbSB2b2xhdGlsZSgic211bGwgJTEsICUwLCAlMiwgJTNcblx0IgotICAgICAgICAgICAgICAgICAgICAgIm1vdiAgICUxLCAlMSwgbHNyICMyN1xuXHQiCi0gICAgICAgICAgICAgICAgICAgICAiYWRkICAgJTAsICUxLCAlMCwgYXNsICM1IgotICAgICAgICAgICAgIDogIj0mcippIihyZXN1bHQ2NF9oaSksCi0gICAgICAgICAgICAgICAgICAgICAiPSZyKmkiKHJlc3VsdDY0X2xvKQotICAgICAgICAgICAgICAgICAgICAgICAgICAgICA6ICJyIihyYSksCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICJyIihyYikpOwotICAgICAgICByZXR1cm4gKHJlc3VsdDY0X2hpKTsKLQotICAgIH0KLQotCi0gICAgc3RhdGljIGlubGluZSBpbnQzMiBmeHBfbXVsMzJfUTI2KGNvbnN0IGludDMyIGEsIGNvbnN0IGludDMyIGIpCi17Ci0gICAgICAgIGludDMyIHJlc3VsdDY0X2hpOwotICAgICAgICBpbnQzMiByZXN1bHQ2NF9sbzsKLSAgICAgICAgcmVnaXN0ZXIgaW50MzIgcmEgPSAoaW50MzIpYTsKLSAgICAgICAgcmVnaXN0ZXIgaW50MzIgcmIgPSAoaW50MzIpYjsKLSAgICAgICAgYXNtIHZvbGF0aWxlKCJzbXVsbCAlMSwgJTAsICUyLCAlM1xuXHQiCi0gICAgICAgICAgICAgICAgICAgICAibW92ICAgJTEsICUxLCBsc3IgIzI2XG5cdCIKLSAgICAgICAgICAgICAgICAgICAgICJhZGQgICAlMCwgJTEsICUwLCBhc2wgIzYiCi0gICAgICAgICAgICAgOiAiPSZyKmkiKHJlc3VsdDY0X2hpKSwKLSAgICAgICAgICAgICAgICAgICAgICI9JnIqaSIocmVzdWx0NjRfbG8pCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgIDogInIiKHJhKSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgInIiKHJiKSk7Ci0gICAgICAgIHJldHVybiAocmVzdWx0NjRfaGkpOwotCi0gICAgfQotCi0KLQotICAgIHN0YXRpYyBpbmxpbmUgaW50MzIgZnhwX21hYzMyX1EzMihpbnQzMiBMX2FkZCwgY29uc3QgaW50MzIgYSwgY29uc3QgaW50MzIgYikKLXsKLQotICAgICAgICBpbnQzMiByZXN1bHQ2NF9oaTsKLSAgICAgICAgaW50MzIgcmVzdWx0NjRfbG87Ci0gICAgICAgIHJlZ2lzdGVyIGludDMyIHJhID0gKGludDMyKWE7Ci0gICAgICAgIHJlZ2lzdGVyIGludDMyIHJiID0gKGludDMyKWI7Ci0gICAgICAgIHJlZ2lzdGVyIGludDMyIHJjID0gKGludDMyKUxfYWRkOwotCi0gICAgICAgIGFzbSB2b2xhdGlsZSgic211bGwgJTEsICUwLCAlMiwgJTNcblx0IgotICAgICAgICAgICAgICAgICAgICAgImFkZCAlMCwgJTAsICU0IgotICAgICAgICAgICAgIDogIj0mcippIihyZXN1bHQ2NF9oaSksCi0gICAgICAgICAgICAgICAgICAgICAiPSZyKmkiKHJlc3VsdDY0X2xvKQotICAgICAgICAgICAgICAgICAgICAgICAgICAgICA6ICJyIihyYSksCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICJyIihyYiksCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICJyIihyYykpOwotCi0gICAgICAgIHJldHVybiAocmVzdWx0NjRfaGkpOwotICAgIH0KLQotICAgIHN0YXRpYyBpbmxpbmUgaW50MzIgZnhwX21zYjMyX1EzMihpbnQzMiBMX3N1YiwgY29uc3QgaW50MzIgYSwgY29uc3QgaW50MzIgYikKLXsKLSAgICAgICAgaW50MzIgcmVzdWx0NjRfaGk7Ci0gICAgICAgIGludDMyIHJlc3VsdDY0X2xvOwotICAgICAgICByZWdpc3RlciBpbnQzMiByYSA9IChpbnQzMilhOwotICAgICAgICByZWdpc3RlciBpbnQzMiByYiA9IChpbnQzMiliOwotICAgICAgICByZWdpc3RlciBpbnQzMiByYyA9IChpbnQzMilMX3N1YjsKLQotICAgICAgICBhc20gdm9sYXRpbGUoInNtdWxsICUxLCAlMCwgJTIsICUzXG5cdCIKLSAgICAgICAgICAgICAgICAgICAgICJzdWIgJTAsICU0LCAlMCIKLSAgICAgICAgICAgICA6ICI9JnIqaSIocmVzdWx0NjRfaGkpLAotICAgICAgICAgICAgICAgICAgICAgIj0mcippIihyZXN1bHQ2NF9sbykKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOiAiciIocmEpLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAiciIocmIpLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAiciIocmMpKTsKLQotCi0gICAgICAgIHJldHVybiAocmVzdWx0NjRfaGkpOwotICAgIH0KLQotCi0gICAgX19pbmxpbmUgaW50MzIgcHZfYWJzKGludDMyIHgpCi17Ci0gICAgICAgIHJlZ2lzdGVyIGludDMyIHo7Ci0gICAgICAgIHJlZ2lzdGVyIGludDMyIHk7Ci0gICAgICAgIHJlZ2lzdGVyIGludDMyIHJhID0geDsKLSAgICAgICAgYXNtIHZvbGF0aWxlKAotICAgICAgICAgICAgInN1YiAgJTAsICUyLCAlMiwgbHNyICMzMVxuXHQiCi0gICAgICAgICAgICAiZW9yICAlMSwgJTAsICUwLCBhc3IgIzMxIgotICAgIDogIj0mcippIih6KSwKLSAgICAgICAgICAgICI9JnIqaSIoeSkKLSAgICAgICAgICAgICAgICAgICAgOiAiciIocmEpKTsKLQotICAgICAgICByZXR1cm4gKHkpOwotICAgIH0KLQotCi0jZW5kaWYKLQotI2lmZGVmIF9fY3BsdXNwbHVzCi19Ci0jZW5kaWYKLQotCi0jZW5kaWYgICAvKiAgUFZfTVAzREVDX0ZYRF9PUF9BUk1fR0NDX0ggICovCi0KZGlmZiAtLWdpdCBhL21lZGlhL2xpYnN0YWdlZnJpZ2h0L2NvZGVjcy9tcDNkZWMvc3JjL3B2X21wM2RlY19meGRfb3BfY19lcXVpdmFsZW50LmggYi9tZWRpYS9saWJzdGFnZWZyaWdodC9jb2RlY3MvbXAzZGVjL3NyYy9wdl9tcDNkZWNfZnhkX29wX2NfZXF1aXZhbGVudC5oCmRlbGV0ZWQgZmlsZSBtb2RlIDEwMDY0NApp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fMzEoYSkgICAoSW50MzIpKChmbG9hdClhKjB4N0ZGRkZGRkYpCi0KLSNkZWZpbmUgUWZtdDE1KHgpICAgKEludDE2KSh4KigoSW50MzIpMTw8MTUpICsgKHg+PTA/MC41RjotMC41RikpCi0KLQotCi0gICAgX19pbmxpbmUgaW50MzIgcHZfYWJzKGludDMyIGEpCi0gICAgewotICAgICAgICBpbnQzMiBiID0gKGEgPCAwKSA/IC1hIDogYTsKLSAgICAgICAgcmV0dXJuIGI7Ci0gICAgfQotCi0KLQotCi0gICAgX19pbmxpbmUgSW50MzIgZnhwX211bDMyX1EzMChjb25zdCBJbnQzMiBhLCBjb25zdCBJbnQzMiBiKQotICAgIHsKLSAgICAgICAgcmV0dXJuIChJbnQzMikoKChpbnQ2NCkoYSkgKiBiKSA+PiAzMCk7Ci0gICAgfQotCi0gICAgX19pbmxpbmUgSW50MzIgZnhwX21hYzMyX1EzMChjb25zdCBJbnQzMiBhLCBjb25zdCBJbnQzMiBiLCBJbnQzMiBMX2FkZCkKLSAgICB7Ci0gICAgICAgIHJldHVybiAoTF9hZGQgKyAoSW50MzIpKCgoaW50NjQpKGEpICogYikgPj4gMzApKTsKLSAgICB9Ci0KLSAgICBfX2lubGluZSBJbnQzMiBmeHBfbXVsMzJfUTMyKGNvbnN0IEludDMyIGEsIGNvbnN0IEludDMyIGIpCi0gICAgewotICAgICAgICByZXR1cm4gKEludDMyKSgoKGludDY0KShhKSAqIGIpID4+IDMyKTsKLSAgICB9Ci0KLQotICAgIF9faW5saW5lIEludDMyIGZ4cF9tdWwzMl9RMjgoY29uc3QgSW50MzIgYSwgY29uc3QgSW50MzIgYikKLSAgICB7Ci0gICAgICAgIHJldHVybiAoSW50MzIpKCgoaW50NjQpKGEpICogYikgPj4gMjgpOwotICAgIH0KLQotICAgIF9faW5saW5lIEludDMyIGZ4cF9tdWwzMl9RMjcoY29uc3QgSW50MzIgYSwgY29uc3QgSW50MzIgYikKLSAgICB7Ci0gICAgICAgIHJldHVybiAoS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gaW50MzIgZnhwX211bDMyX1EyNyhjb25zdCBpbnQzMiBhLCBjb25zdCBpbnQzMiBiKQotICAgIHsKLSAgICAgICAgcmV0dXJuIChpbnQzMikoKChpbnQ2NCkoYSkgKiBiKSA+PiAyNyk7Ci0gICAgfQotCi0KLQotICAgIF9faW5saW5lIGludDMyIGZ4cF9tdWwzMl9RMjYoY29uc3QgaW50MzIgYSwgY29uc3QgaW50MzIgYikKLSAgICB7Ci0gICAgICAgIHJldHVybiAoaW50MzIpKCgoaW50NjQpKGEpICogYikgPj4gMjYpOwotICAgIH0KLQotCi0gICAgX19pbmxpbmUgaW50MzIgZnhwX21hYzMyX1EzMihpbnQzMiBMX2FkZCwgY29uc3QgaW50MzIgYSwgY29uc3QgaW50MzIgYikKLSAgICB7Ci0gICAgICAgIHJldHVybiAoTF9hZGQgKyBfTXVsSGlnaChiLCBhKSk7Ci0gICAgfQotCi0KLSAgICBfX2lubGluZSBpbnQzMiBmeHBfbXNiMzJfUTMyKGludDMyIExfc3ViLCBjb25zdCBpbnQzMiBhLCBjb25zdCBpbnQzMiBiKQotICAgIHsKLSAgICAgICAgcmV0dXJuIChMX3N1YiAtIF9NdWxIaWdoKGIsIGEpKTsKLSAgICB9Ci0KLQotCi0gICAgX19pbmxpbmUgaW50MzIgZnhwX211bDMyX1EyOShjb25zdCBpbnQzMiBhLCBjb25zdCBpbnQzMiBiKQotICAgIHsKLSAgICAgICAgcmV0dXJuIChpbnQzMikoKChpbnQ2NCkoYSkgKiBiKSA+PiAyOSk7Ci0gICAgfQotCi0KLQotICAgIF9faW5saW5lIGludDMyIHB2X2FicyhpbnQzMiBhKQotICAgIHsKLSAgICAgICAgaW50MzIgYiA9IChhIDwgMCkgPyAtYSA6IGE7Ci0gICAgICAgIHJldHVybiBiOwotICAgIH0KLQotCi0KLSNlbmRpZgotCi0jaWZkZWYgX19jcGx1c3BsdXMKLX0KLSNlbmRpZgotCi0KLSNlbmRpZiAgIC8qICBQVl9NUDNERUNfRlhEX09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W5uZWwKLSAgICBzdHJ1Y3QgZ3JfaW5mb19zICpncl9pbmZvLCAgICBzdHJ1Y3R1cmUgd2l0aCBncmFudWtlIGluZm9ybWF0aW9uIGZvciB0aGUKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpbnB1dAotICAgIG1wM0hlYWRlciAqaW5mbyAgICAgICAgICAgICAgIG1wMyBoZWFkZXIgaW5mb3JtYXRpb24KLQotLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tCi0gRlVOQ1RJT04gREVTQ1JJUFRJT04KLQotICAgIEFsaWFzIFJlZHVjdGlvbgotCi0KLQotICAgIEFsaWFzIHJlZHVjdGlvbiBiZWZvcmUgcHJvY2Vzc2luZyBieSB0aGUgSU1EQ1QKLQotICAgICAgICAgICAgICAgICAgIENzaSAgKwotICAgICA+LS0tLS0tLS0tMC0tLS0tLS0tLTAtLS0tLS0tLT4KLSAgICAgICAgICAgICAgICBcICAgICAgIC8gLQotICAgICAgICAgICAgIENhaSBcICAgICAvCi0gICAgICAgICAgICAgICAgICBcICAgLwotICAgICAgICAgICAgICAgICAgIFwgLwotICAgICAgICAgICAgICAgICAgICBcCi0gICAgICAgICAgICAgICAgICAvICBcCi0gICAgICAgICAgICAgQ2FpIC8gICAgXAotICAgICAgICAgICAgICAgLyAgICAgICBcICArCi0gICAgID4tLS0tLS0tLTAtLS0tLS0tLS0wLS0tLS0tLS0tLT4KLSAgICAgICAgICAgICAgICAgIENzaSAgKwotCi0gICAgICBBbGlhc2luZyBCdXR0ZXJmbHkKLSAgICAgIEFsaWFzIHJlZHVjdGlvbiBpcyBub3QgYXBwbGllZCB0byBzaG9ydCBibG9ja3MKLQotLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tL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SAgICAgICAgICAgIHNibGltID0gKChpbmZvLT52ZXJzaW9uX3ggPT0gTVBFR18yXzUpICYmIChpbmZvLT5zYW1wbGluZ19mcmVxdWVuY3kgPT0gMikpID8gMyA6IDE7Ci0gICAgICAgIH0KLSAgICAgICAgZWxzZQotICAgICAgICB7Ci0gICAgICAgICAgICByZXR1cm47ICAvKiBpbGxlZ2FsIHBhcmFtZXRlciAqLwotICAgICAgICB9Ci0gICAgfQotICAgIGVsc2UKLSAgICB7Ci0gICAgICAgIHNibGltID0gKnVzZWRfZnJlcV9saW5lcyArIDE7Ci0KLSAgICAgICAgaWYgKHNibGltID4gU1VCQkFORFNfTlVNQkVSIC0gMSkKLSAgICAgICAgewotICAgICAgICAgICAgc2JsaW0gPSBTVUJCQU5EU19OVU1CRVIgLSAxOyAgLyogZGVmYXVsdCAqLwotICAgICAgICB9Ci0KLSAgICB9Ci0KLQotICAgIHB0cjMgPSAmaW5wdXRfYnVmZmVyWzE3XTsKLSAgICBwdHI0ID0gJmlucHV0X2J1ZmZlclsxOF07Ci0gICAgcHRyX2NzaSA9IGNfc2lnbmFsOwotICAgIHB0cl9jc2EgPSBjX2FsaWFzOwotCi0gICAgLyogICBOVU1fQlVUVEVSRkxJRVMgKD04KSBidXR0ZXJmbGllcyBiZXR3ZWVuIGVhY2ggcGFpciBvZiBzdWItYmFuZHMqLwotCi0gICAgZm9yIChpID0gTlVNX0JVVFRFUkZMSUVTID4+IDE7IGkgIT0gMDsgaS0tKQotICAgIHsKLSAgICAgICAgaW50MzIgY3NpMSAgPSAqcHRyX2NzaSsrOwotICAgICAgICBpbnQzMiBjc2kyICA9ICpwdHJfY3NpKys7Ci0gICAgICAgIGludDMyIGNzYTEgID0gKnB0cl9jc2ErKzsKLSAgICAgICAgaW50MzIgY3NhMiAgPSAqcHRyX2NzYSsrOwotCi0gICAgICAgIHB0cjEgPSBwdHIzOwotICAgICAgICBwdHIzIC09IDI7Ci0gICAgICAgIHB0cjIgPSBwdHI0OwotICAgIC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B0bXAgPSBnZXRVcFRvMTdiaXRzKHBNYWluRGF0YSwgMTIpOyAgICAvKiAgaHVmZlRhYmxlXzI0ICAqLwotICAgIGlmICgodG1wID4+IDYpID49IDQxKQotICAgIHsKLSAgICAgICAgdG1wID0gKHRtcCA+PiA2KSAtIDQxOwotICAgIH0KLSAgICBlbHNlIGlmICgodG1wID4+IDMpID49IDIxOCkKLSAgICB7Ci0gICAgICAgIHRtcCA9ICh0bXAgPj4gMykgLSAyMTggKyAyMzsKLSAgICB9Ci0gICAgZWxzZSBpZiAoKHRtcCA+PiAyKSA+PSAzMzYpCi0gICAgewotICAgICAgICB0bXAgPSAodG1wID4+IDIpIC0gMzM2ICsgMTMzOwotICAgIH0KLSAgICBlbHNlIGlmICgodG1wID4+IDEpID49IDUyMCkKLSAgICB7Ci0gICAgICAgIHRtcCA9ICh0bXAgPj4gMSkgLSA1MjAgKyAyMzM7Ci0gICAgfQotICAgIGVsc2UgaWYgKCh0bXApID49IDEwMjQpCi0gICAgewotICAgICAgICB0bXAgPSAodG1wKSAtIDEwMjQgKyAzODU7Ci0gICAgfQotICAgIGVsc2UgaWYgKCh0bXAgPj4gMSkgPj0gMzUyKQotICAgIHsKLSAgICAgICAgaWYgKCh0bXAgPj4gOCkgPT0gMykKLSAgICAgICAgewotICAgICAgICAgICAgdG1wID0gKHRtcCA+PiA4KSAtIDMgKyA0MzM7Ci0gICAgICAgIH0KLSAgICAgICAgZWxzZQotICAgICAgICB7Ci0gICAgICAgICAgICB0bXAgPSAodG1wID4+IDEpIC0gMzUyICsgNDAxOwotICAgICAgICB9Ci0gICAgfQotICAgIGVsc2UKLSAgICB7Ci0gICAgICAgIHRtcCA9ICgodG1wID4+IDQpICYgMHgzZikgKyA0MzQ7Ci0gICAgfQotCi0gICAgY3cgPSAqKGh1ZmZUYWJsZV8yNCArIHRtcCk7Ci0gICAgcE1haW5EYXRhLT51c2VkQml0cyAtPSAoMTIgLSAoY3cgJiAweEZGKSk7Ci0KLSAgICByZXR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mdyX2luZm8sCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgIGludDMyICB1c2VkX2ZyZXFfbGluZXMsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1wM0hlYWRlciAqaW5mbykKLXsKLSAgICBpbnQzMiBzczsKLSAgICBpbnQzMiBjYiA9IDA7Ci0gICAgaW50MzIgZ2xvYmFsX2dhaW47Ci0gICAgaW50MzIgc2ZyZXEgPSBpbmZvLT5zYW1wbGluZ19mcmVxdWVuY3kgKyBpbmZvLT52ZXJzaW9uX3ggKyAoaW5mby0+dmVyc2lvbl94IDw8IDEpOwotCi0gICAgLyogYXBwbHkgZm9ybXVsYSBwZXIgYmxvY2sgdHlwZSAqLwotCi0gICAgaWYgKGdyX2luZm8tPndpbmRvd19zd2l0Y2hpbmdfZmxhZyAmJiAoZ3JfaW5mby0+YmxvY2tfdHlwZSA9PSAyKSkKLSAgICB7Ci0gICAgICAgIGludDMyIG5leHRfY2JfYm91bmRhcnk7Ci0gICAgICAgIGludDMyIGNiX2JlZ2luID0gMDsKLSAgICAgICAgaW50MzIgY2Jfd2lkdGggPSAwOwotICAgICAgICBpbnQzMiBtaXhzdGFydCA9IDg7ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLyogYWRkZWQgMjAwMy8wOC8yMSAgZWZzICovCi0KLSAgICAgICAgaWYgKGluZm8tPnZlcnNpb25feCAhPSBNUEVHXzEpCi0gICAgICAgIHsKLSAgICAgICAgICAgIG1peHN0YXJ0ID0gNjsgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8qIGRpZmZlcmVudCB2YWx1ZSBpbiBNUEVHMiBMU0YgKi8KLSAgICAgICAgfQotCi0gICAgICAgIGlmIChncl9pbmZvLT5taXhlZF9ibG9ja19mbGFnKQotICAgICAgICB7Ci0gICAgICAgICAgICBuZXh0X2NiX2JvdW5kYXJ5ID0gbXAzX3NmQmFuZEluZGV4W3NmcmVxXS5sWzFdOyAgLyogTE9ORyBibG9ja3M6IDAsMSwzICovCi0gICAgICAgIH0KLSAgICAgICAgZWxzZQotICAgICAgICB7Ci0gICAgICAgICAgICBuZXh0X2NiX2JvdW5kYXJ5ID0gbXAzX3NmQmFuZEluZGV4W3NmcmVxXS5zWzFdICogMzsgLyogcHVyZSBTSE9SVCBibG9jayAqLwotICAgICAgICAgICAgY2Jfd2lkdGggPSAwOwotICAgICAgICB9Ci0KLSAgICAgICAgZ2xvYmFsX2dhaW4gPSAgZ3JfaW5mby0+Z2xvYmFsX2dhaW47Ci0gICAgICAgIGludDMyIHR3b19yYWlzZV9vbmVfZm91cnRoID0gcG93XzJfMV9mb3VydGhbZ2xvYmFsX2dhaW4mMHgzXTsKLSAgICAgICAgZ2xvYmFsX2dhaW4gPSAxMiArIChnbG9iYWxfZ2FpbiA+PiAyKTsKLQotICAgICAgICBmb3IgKHNzID0gMCA7IHNzIDwgdXNlZF9mcmVxX2xpbmVzIDsgc3MrKykKLSAgICAgICAgewotICAgICAgICAgICAgaWYgKHNzID09IG5leHRfY2JfYm91bmRhcnkpCi0gICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgY2IrKzsgICAgICAgLyogIGNyaXRpY2FsIGJhbmQgY291bnRlciAqLwotICAgICAgICAgICAgICAgIGlmIChncl9pbmZvLT5taXhlZF9ibG9ja19mbGFnKQotICAgICAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAgICAgaWYgKG5leHRfY2JfYm91bmRhcnkgPT0gbXAzX3NmQmFuZEluZGV4W3NmcmVxXS5sW21peHN0YXJ0XSkKLSAgICAgICAgICAgICAgICAgICAgewotICAgICAgICAgICAgICAgICAgICAgICAgbmV4dF9jYl9ib3VuZGFyeSA9IG1wM19zZkJhbmRJbmRleFtzZnJlcV0uc1s0XSAqIDM7Ci0KLSAgICAgICAgICAgICAgICAgICAgICAgIGNiX2JlZ2luID0gbXAzX3NmQmFuZEluZGV4W3NmcmVxXS5zWzNdICogMzsKLSAgICAgICAgICAgICAgICAgICAgICAgIGNiX3dpZHRoID0gMzsKLSAgICAgICAgICAgICAgICAgICAgICAgIGNiID0gMzsKLSAgICAgICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgICAgICBlbHNlIGlmIChzcyA8IG1wM19zZkJhbmRJbmRleFtzZnJlcV0ubFttaXhzdGFydF0pCi0gICAgICAgICAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAgICAgICAgIG5leHRfY2JfYm91bmRhcnkgPSBtcDNfc2ZCYW5kSW5kZXhbc2ZyZXFdLmxbY2IrMV07Ci0gICAgICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICAgICAgZWxzZQotICAgICAgICAgICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgICAgICAgICBuZXh0X2NiX2JvdW5kYXJ5ID0gbXAzX3NmQmFuZEluZGV4W3NmcmVxXS5zW2NiKzFdICogMzsKLQotICAgICAgICAgICAgICAgICAgICAgICAgY2Jfd2lkdGggPSBjYjsKLSAgICAgICAgICAgICAgICAgICAgICAgIGNiX2JlZ2luID0gbXAzX3NmQmFuZEluZGV4W3NmcmVxXS5zW2NiXSAqIDM7Ci0gICAgICAgICAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgICAgICAgICBpZiAoc3MgPCAyKkZJTFRFUkJBTktfQkFORFMpCi0gICAgICAgICAgICAgICAgICAgIHsgICAvKiAgMXN0IDIgc3ViYmFuZHMgb2Ygc3dpdGNoZWQgYmxvY2tzICovCi0gICAgICAgICAgICAgICAgICAgICAgICBnbG9iYWxfZ2FpbiAgPSAoZ3JfaW5mby0+Z2xvYmFsX2dhaW4pOwotICAgICAgICAgICAgICAgICAgICAgICAgZ2xvYmFsX2dhaW4gLT0gKDEgKyBncl9pbmZvLT5zY2FsZWZhY19zY2FsZSkgKgotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKHNjYWxlZmFjLT5sW2NiXSArIGdyX2luZm8tPnByZWZsYWcgKiBwcmV0YWJbY2JdKSA8PCAxOwotCi0gICAgICAgICAgICAgICAgICAgICAgICB0d29fcmFpc2Vfb25lX2ZvdXJ0aCA9IHBvd18yXzFfZm91cnRoW2dsb2JhbF9nYWluJjB4M107Ci0gICAgICAgICAgICAgICAgICAgICAgICBnbG9iYWxfZ2FpbiA9IDEyICsgKGdsb2JhbF9nYWluID4+IDIpOwotICAgICAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgIGVsc2UKLSAgICAgICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgICAgIG5leHRfY2JfYm91bmRhcnkgPSBtcDNfc2ZCYW5kSW5kZXhbc2ZyZXFdLnNbY2IrMV0gKiAzOwotICAgICAgICAgICAgICAgICAgICBjYl93aWR0aCA9IGNiOwotICAgICAgICAgICAgICAgICAgICBjYl9iZWdpbiA9IG1wM19zZkJhbmRJbmRleFtzZnJlcV0uc1tjYl0gKiAzOwotICAgICAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgfSAgIC8qICBlbmQtaWYgKCBzcyA9PSBuZXh0X2NiX2JvdW5kYXJ5KSAqLwotCi0gICAgICAgICAgICAvKiBEbyBsb25nL3Nob3J0IGRlcGVuZGVudCBzY2FsaW5nIG9wZXJhdGlvbnMuICovCi0gICAgICAgICAgICBpZiAoKGdyX2luZm8tPm1peGVkX2Jsb2NrX2ZsYWcgPT0gMCkgfHwgKGdyX2luZm8tPm1peGVkX2Jsb2NrX2ZsYWcgJiYgKHNzID49IDIqRklMVEVSQkFOS19CQU5EUykpKQotICAgICAgICAgICAgewotICAgICAgICAgICAgICAgIGludDMyIHRlbXAyID0gZnhwX211bDMyX1EzMigoc3MgLSBjYl9iZWdpbikgPDwgMTYsIG1wM19zaG9ydHdpbmRCYW5kV2lkdGhzW3NmcmVxXVtjYl93aWR0aF0pOwotICAgICAgICAgICAgICAgIHRlbXAyID0gKHRlbXAyICsgMSkgPj4gMTU7Ci0KLSAgICAgICAgICAgICAgICBnbG9iYWxfZ2FpbiAgPSAoZ3JfaW5mby0+Z2xvYmFsX2dhaW4pOwotICAgICAgICAgICAgICAgIGdsb2JhbF9nYWluIC09ICBncl9pbmZvLT5zdWJibG9ja19nYWluW3RlbXAyXSA8PCAzOwotICAgICAgICAgICAgICAgIGdsb2JhbF9nYWluIC09ICgxICsgZ3JfaW5mby0+c2NhbGVmYWNfc2NhbGUpICogKHNjYWxlZmFjLT5zW3RlbXAyXVtjYl0gPDwgMSk7Ci0KLSAgICAgICAgICAgICAgICB0d29fcmFpc2Vfb25lX2ZvdXJ0aCA9IHBvd18yXzFfZm91cnRoW2dsb2JhbF9nYWluJjB4M107Ci0gICAgICAgICAgICAgICAgZ2xvYmFsX2dhaW4gPSAxMiArIChnbG9iYWxfZ2FpbiA+PiAyKTsKLQotICAgICAgICAgICAgfQotCi0KLSAgICAgICAgICAgIC8qCi0gICAgICAgICAgICAgKiAgICAgICB4cltzYl1bc3NdID0gMl4oZ2xvYmFsX2dhaW4vNCkKLSAgICAgICAgICAgICAqLwotCi0gICAgICAgICAgICAvKiBTY2FsZSBxdWFudGl6ZWQgdmFsdWUuICovCi0KLSAgICAgICAgICAgIC8qIDAgPCBhYnMoaXNbc3NdKSA8IDgxOTIgKi8KLQotICAgICAgICAgICAgaW50MzIgdG1wID0gZnhwX211bDMyX1EzMCgoaXNbc3NdIDw8IDE2KSwgcG93ZXJfMV90aGlyZChwdl9hYnMoaXNbIHNzXSkpKTsKLQotICAgICAgICAgICAgdG1wID0gZnhwX211bDMyX1EzMCh0bXAsIHR3b19yYWlzZV9vbmVfZm91cnRoKTsKLQotICAgICAgICAgICAgaWYgKGdsb2JhbF9nYWluIDwgMCkKLSAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICBpbnQzMiB0ZW1wID0gLSBnbG9iYWxfZ2FpbjsKLSAgICAgICAgICAgICAgICBpZiAodGVtcCA8IDMyKQotICAgICAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAgICAgaXNbc3NdID0gKHRtcCA+PiB0ZW1wKTsKLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgZWxzZQotICAgICAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAgICAgaXNbc3NdID0gMDsKLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICB9Ci0gICAgICAgICAgICBlbHNlCi0gICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgaXNbc3NdID0gKHRtcCA8PCBnbG9iYWxfZ2Fpbik7Ci0gICAgICAgICAgICB9Ci0KLSAgICAgICAgfSAgLyogICBmb3IgKHNzPTAgOyBzcyA8IHVzZWRfZnJlcV9saW5lcyA7IHNzKyspICAgKi8KLQotICAgIH0KLSAgICBlbHNlCi0gICAgewotCi0gICAgICAgIGZvciAoY2IgPSAwIDsgY2IgPCAyMiA7IGNiKyspCi0gICAgICAgIHsKLQotICAgICAgICAgICAgLyogQ29tcHV0ZSBvdmVyYWxsIChnbG9iYWwpIHNjYWxpbmcuICovCi0KLSAgICAgICAgICAgIGdsb2JhbF9nYWluICA9IChncl9pbmZvLT5nbG9iYWxfZ2Fpbik7Ci0KLSAgICAgICAgICAgIGdsb2JhbF9nYWluIC09ICgxICsgZ3JfaW5mby0+c2NhbGVmYWNfc2NhbGUpICoKLSAgICAgICAgICAgICAgICAgICAgICAgICAgIChzY2FsZWZhYy0+bFtjYl0gKyBncl9pbmZvLT5wcmVmbGFnICogcHJldGFiW2NiXSkgPDwgMTsKLQotCi0gICAgICAgICAgICBpbnQzMiB0d29fcmFpc2Vfb25lX2ZvdXJ0aCA9IHBvd18yXzFfZm91cnRoW2dsb2JhbF9nYWluJjB4M107Ci0gICAgICAgICAgICBnbG9iYWxfZ2FpbiA9IDEyICsgKGdsb2JhbF9nYWluID4+IDIpOwotCi0gICAgICAgICAgICAvKgotICAgICAgICAgICAgICogICAgICAgeHJbc2JdW3NzXSA9IDJeKGdsb2JhbF9nYWluLzQpCi0gICAgICAgICAgICAgKi8KLQotICAgICAgICAgICAgLyogU2NhbGUgcXVhbnRpemVkIHZhbHVlLiAqLwotCi0gICAgICAgICAgICBpZiAodXNlZF9mcmVxX2xpbmVzID49IG1wM19zZkJhbmRJbmRleFtzZnJlcV0ubFtjYisxXSkKLSAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICBpZiAoZ2xvYmFsX2dhaW4gPD0gMCkKLSAgICAgICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgICAgIGdsb2JhbF9nYWluID0gLSBnbG9iYWxfZ2FpbjsKLSAgICAgICAgICAgICAgICAgICAgaWYgKGdsb2JhbF9nYWluIDwgMzIpCi0gICAgICAgICAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAgICAgICAgIGZvciAoc3MgPSBtcDNfc2ZCYW5kSW5kZXhbc2ZyZXFdLmxbY2JdOyBzcyA8IG1wM19zZkJhbmRJbmRleFtzZnJlcV0ubFtjYisxXTsgc3MgKz0gMikKLSAgICAgICAgICAgICAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBpbnQzMiB0bXAgPSAgaXNbc3NdOwotICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICh0bXApCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgewotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0bXAgPSBmeHBfbXVsMzJfUTMwKCh0bXAgPDwgMTYpLCBwb3dlcl8xX3RoaXJkKHB2X2Ficyh0bXApKSk7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlzW3NzXSA9IGZ4cF9tdWwzMl9RMzAodG1wLCB0d29fcmFpc2Vfb25lX2ZvdXJ0aCkgPj4gZ2xvYmFsX2dhaW47Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRtcCA9ICBpc1tzcysxXTsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAodG1wKQotICAgICAgICAgICAgICAgICAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdG1wID0gZnhwX211bDMyX1EzMCgodG1wIDw8IDE2KSwgcG93ZXJfMV90aGlyZChwdl9hYnModG1wKSkpOwotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpc1tzcysxXSA9IGZ4cF9tdWwzMl9RMzAodG1wLCB0d29fcmFpc2Vfb25lX2ZvdXJ0aCkgPj4gZ2xvYmFsX2dhaW47Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgICAgIGVsc2UKLSAgICAgICAgICAgICAgICAgICAgewotICAgICAgICAgICAgICAgICAgICAgICAgcHZfbWVtc2V0KCZpc1sgbXAzX3NmQmFuZEluZGV4W3NmcmVxXS5sW2NiXV0sCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAobXAzX3NmQmFuZEluZGV4W3NmcmVxXS5sW2NiKzFdIC0gbXAzX3NmQmFuZEluZGV4W3NmcmVxXS5sW2NiXSkqc2l6ZW9mKCppcykpOwotICAgICAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgIGVsc2UKLSAgICAgICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgICAgIGZvciAoc3MgPSBtcDNfc2ZCYW5kSW5kZXhbc2ZyZXFdLmxbY2JdOyBzcyA8IG1wM19zZkJhbmRJbmRleFtzZnJlcV0ubFtjYisxXTsgc3MgKz0gMikKLSAgICAgICAgICAgICAgICAgICAgewotICAgICAgICAgICAgICAgICAgICAgICAgaW50MzIgdG1wID0gIGlzW3NzXTsKLSAgICAgICAgICAgICAgICAgICAgICAgIGlmICh0bXApCi0gICAgICAgICAgICAgICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgdG1wID0gZnhwX211bDMyX1EzMCgodG1wIDw8IDE2KSwgcG93ZXJfMV90aGlyZChwdl9hYnModG1wKSkpOwotICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlzW3NzXSA9IGZ4cF9tdWwzMl9RMzAodG1wLCB0d29fcmFpc2Vfb25lX2ZvdXJ0aCkgPDwgZ2xvYmFsX2dhaW47Ci0gICAgICAgICAgICAgICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgICAgICAgICAgICAgIHRtcCA9ICBpc1tzcysxXTsKLSAgICAgICAgICAgICAgICAgICAgICAgIGlmICh0bXApCi0gICAgICAgICAgICAgICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgdG1wID0gZnhwX211bDMyX1EzMCgodG1wIDw8IDE2KSwgcG93ZXJfMV90aGlyZChwdl9hYnModG1wKSkpOwotICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlzW3NzKzFdID0gZnhwX211bDMyX1EzMCh0bXAsIHR3b19yYWlzZV9vbmVfZm91cnRoKSA8PCBnbG9iYWxfZ2FpbjsKLSAgICAgICAgICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgIH0KLSAgICAgICAgICAgIGVsc2UKLSAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICBpZiAoZ2xvYmFsX2dhaW4gPD0gMCkKLSAgICAgICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgICAgIGdsb2JhbF9nYWluID0gLSBnbG9iYWxfZ2FpbjsKLSAgICAgICAgICAgICAgICAgICAgaWYgKGdsb2JhbF9nYWluIDwgMzIpCi0gICAgICAgICAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAgICAgICAgIGZvciAoc3MgPSBtcDNfc2ZCYW5kSW5kZXhbc2ZyZXFdLmxbY2JdOyBzcyA8IHVzZWRfZnJlcV9saW5lczsgc3MgKz0gMikKLSAgICAgICAgICAgICAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBpbnQzMiB0bXAgPSAgaXNbc3NdOwotICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICh0bXApCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgewotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0bXAgPSBmeHBfbXVsMzJfUTMwKCh0bXAgPDwgMTYpLCBwb3dlcl8xX3RoaXJkKHB2X2Ficyh0bXApKSk7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlzW3NzXSA9IGZ4cF9tdWwzMl9RMzAodG1wLCB0d29fcmFpc2Vfb25lX2ZvdXJ0aCkgPj4gZ2xvYmFsX2dhaW47Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRtcCA9ICBpc1tzcysxXTsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAodG1wKQotICAgICAgICAgICAgICAgICAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdG1wID0gZnhwX211bDMyX1EzMCgodG1wIDw8IDE2KSwgcG93ZXJfMV90aGlyZChwdl9hYnModG1wKSkpOwotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpc1tzcysxXSA9IGZ4cF9tdWwzMl9RMzAodG1wLCB0d29fcmFpc2Vfb25lX2ZvdXJ0aCkgPj4gZ2xvYmFsX2dhaW47Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgICAgICAgICAgfQotCi0gICAgICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICAgICAgZWxzZQotICAgICAgICAgICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgICAgICAgICBwdl9tZW1zZXQoJmlzWyBtcDNfc2ZCYW5kSW5kZXhbc2ZyZXFdLmxbY2JdXSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAwLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChtcDNfc2ZCYW5kSW5kZXhbc2ZyZXFdLmxbY2IrMV0gLSBtcDNfc2ZCYW5kSW5kZXhbc2ZyZXFdLmxbY2JdKSpzaXplb2YoKmlzKSk7Ci0gICAgICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgZWxzZQotICAgICAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAgICAgZm9yIChzcyA9IG1wM19zZkJhbmRJbmRleFtzZnJlcV0ubFtjYl07IHNzIDwgdXNlZF9mcmVxX2xpbmVzOyBzcysrKQotICAgICAgICAgICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgICAgICAgICBpbnQzMiB0bXAgPSAgaXNbc3NdOwotCi0gICAgICAgICAgICAgICAgICAgICAgICBpZiAodG1wKQotICAgICAgICAgICAgICAgICAgICAgICAgewotICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRtcCA9IGZ4cF9tdWwzMl9RMzAoKHRtcCA8PCAxNiksIHBvd2VyXzFfdGhpcmQocHZfYWJzKHRtcCkpKTsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBpc1tzc10gPSBmeHBfbXVsMzJfUTMwKHRtcCwgdHdvX3JhaXNlX29uZV9mb3VydGgpIDw8IGdsb2JhbF9nYWluOwotICAgICAgICAgICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgfQotCi0gICAgICAgICAgICAgICAgY2IgPSAyMjsgIC8vIGZvcmNlIGJyZWFraW5nIG91dCBvZiB0aGUgbG9vcAotCi0gICAgICAgICAgICB9IC8qICBpZiAoIHVzZWRfZnJlcV9saW5lcyA+PSBtcDNfc2ZCYW5kSW5kZXhbc2ZyZXFdLmxbY2IrMV0pICovCi0KLSAgICAgICAgfSAgIC8qIGZvciAoY2I9MCA7IGNiIDwgMjIgOyBjYisrKSAgKi8KLQotICA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gewotICAgICAgICBRbWYzMShMRVZFTF9fMF9fZEIpLAotCi0gICAgICAgIFFtZjMxKExFVkVMX185X19kQiksIFFtZjMxKExFVkVMX185X19kQiksCi0KLSAgICAgICAgUW1mMzEoTEVWRUxfXzlfX2RCKSwgUW1mMzEoTEVWRUxfXzlfX2RCKSwKLSAgICAgICAgUW1mMzEoTEVWRUxfXzlfX2RCKSwgUW1mMzEoTEVWRUxfXzlfX2RCKSwKLQotICAgICAgICBRbWYzMShMRVZFTF9fM19fZEIpLCBRbWYzMShMRVZFTF9fM19fZEIpLAotICAgICAgICBRbWYzMShMRVZFTF9fM19fZEIpLCBRbWYzMShMRVZFTF9fM19fZEIpLAotICAgICAgICBRbWYzMShMRVZFTF9fM19fZEIpLCBRbWYzMShMRVZFTF9fM19fZEIpLAotICAgICAgICBRbWYzMShMRVZFTF9fM19fZEIpLCBRbWYzMShMRVZFTF9fMV81ZEIpLAotCi0gICAgICAgIFFtZjMxKExFVkVMX18wX19kQiksIFFtZjMxKExFVkVMX18wX19kQiksCi0gICAgICAgIFFtZjMxKExFVkVMX18wX19kQiksIFFtZjMxKExFVkVMX18wX19kQiksCi0gICAgICAgIFFtZjMxKExFVkVMX18wX19kQiksIFFtZjMxKExFVkVMX18wX19kQiksCi0gICAgICAgIFFtZjMxKExFVkVMX18wX19kQiksIFFtZjMxKExFVkVMX18wX19kQiksCi0gICAgICAgIFFtZjMxKExFVkVMX18wX19kQiksIFFtZjMxKExFVkVMX18wX19kQiksCi0gICAgICAgIFFtZjMxKExFVkVMX18wX19kQiksIFFtZjMxKExFVkVMX18wX19kQiksCi0gICAgICAgIFFtZjMxKExFVkVMX18wX19kQiksIFFtZjMxKExFVkVMX18wX19kQiksCi0gICAgICAgIFFtZjMxKExFVkVMX18wX19kQiksIFFtZjMxKExFVkVMX18wX19kQiksCi0gICAgICAgIFFtZjMxKExFVkVMX18wX19kQikKLSAgICB9LAotICAgIC8qICBUQUxLICovCi0gICAgewotICAgICAgICBRbWYzMShMRVZFTF9fOV9fZEIpLAotCi0gICAgICAgIFFtZjMxKExFVkVMX182X19kQiksIFFtZjMxKExFVkVMX182X19kQiksCi0KLSAgICAgICAgUW1mMzEoTEVWRUxfXzBfX2RCKSwgUW1mMzEoTEVWRUxfXzBfX2RCKSwKLSAgICAgICAgUW1mMzEoTEVWRUxfXzBfX2RCKSwgUW1mMzEoTEVWRUxfXzBfX2RCKSwKLQotICAgICAgICBRbWYzMShMRVZFTF9fMF9fZEIpLCBRbWYzMShMRVZFTF9fMF9fZEIpLAotICAgICAgICBRbWYzMShMRVZFTF9fMF9fZEIpLCBRbWYzMShMRVZFTF9fMF9fZEIpLAotICAgICAgICBRbWYzMShMRVZFTF9fMF9fZEIpLCBRbWYzMShMRVZFTF9fMF9fZEIpLAotICAgICAgICBRbWYzMShMRVZFTF9fMF9fZEIpLCBRbWYzMShMRVZFTF9fMV81ZEIpLAotCi0gICAgICAgIFFtZjMxKExFVkVMX18zX19kQiksIFFtZjMxKExFVkVMX18zX19kQiksCi0gICAgICAgIFFtZjMxKExFVkVMX18zX19kQiksIFFtZjMxKExFVkVMX18zX19kQiksCi0gICAgICAgIFFtZjMxKExFVkVMX18zX19kQiksIFFtZjMxKExFVkVMX18zX19kQiksCi0gICAgICAgIFFtZjMxKExFVkVMX18zX19kQiksIFFtZjMxKExFVkVMX18zX19kQiksCi0gICAgICAgIFFtZjMxKExFVkVMX18zX19kQiksIFFtZjMxKExFVkVMX18zX19kQiksCi0gICAgICAgIFFtZjMxKExFVkVMX18zX19kQiksIFFtZjMxKExFVkVMX18zX19kQiksCi0gICAgICAgIFFtZjMxKExFVkVMX18zX19kQiksIFFtZjMxKExFVkVMX18zX19kQiksCi0gICAgICAgIFFtZjMxKExFVkVMX18zX19kQiksIFFtZjMxKExFVkVMX18zX19kQiksCi0gICAgICAgIFFtZjMxKExFVkVMX18zX19kQikKLSAgICB9LAotICAgIC8qICBGTEFUICovCi0gICAgewotICAgICAgICBRbWYzMShMRVZFTF9fMF9fZEIpLAotCi0gICAgICAgIFFtZjMxKExFVkVMX18wX19kQiksIFFtZjMxKExFVkVMX18wX19kQiksCi0KLSAgICAgICAgUW1mMzEoTEVWRUxfXzBfX2RCKSwgUW1mMzEoTEVWRUxfXzBfX2RCKSwKLSAgICAgICAgUW1mMzEoTEVWRUxfXzBfX2RCKSwgUW1mMzEoTEVWRUxfXzBfX2RCKSwKLQotICAgICAgICBRbWYzMShMRVZFTF9fMF9fZEIpLCBRbWYzMShMRVZFTF9fMF9fZEIpLAotICAgICAgICBRbWYzMShMRVZFTF9fMF9fZEIpLCBRbWYzMShMRVZFTF9fMF9fZEIpLAotICAgICAgICBRbWYzMShMRVZFTF9fMF9fZEIpLCBRbWYzMShMRVZFTF9fMF9fZEIpLAotICAgICAgICBRbWYzMShMRVZFTF9fMF9fZEIpLCBRbWYzMShMRVZFTF9fMF9fZEIpLAotCi0gICAgICAgIFFtZjMxKExFVkVMX18wX19kQiksIFFtZjMxKExFVkVMX18wX19kQiksCi0gICAgICAgIFFtZjMxKExFVkVMX18wX19kQiksIFFtZjMxKExFVkVMX18wX19kQiksCi0gICAgICAgIFFtZjMxKExFVkVMX18wX19kQiksIFFtZjMxKExFVkVMX18wX19kQiksCi0gICAgICAgIFFtZjMxKExFVkVMX18wX19kQiksIFFtZjMxKExFVkVMX18wX19kQiksCi0gICAgICAgIFFtZjMxKExFVkVMX18wX19kQiksIFFtZjMxKExFVkVMX18wX19kQiksCi0gICAgICAgIFFtZjMxKExFVkVMX18wX19kQiksIFFtZjMxKExFVkVMX18wX19kQiksCi0gICAgICAgIFFtZjMxKExFVkVMX18wX19kQiksIFFtZjMxKExFVkVMX18wX19kQiksCi0gICAgICAgIFFtZjMxKExFVkVMX18wX19kQiksIFFtZjMxKExFVkVMX18wX19kQiksCi0gICAgICAgIFFtZjMxKExFVkVMX18wX19kQikKLSAgICB9Ci19OwotCi0vKi0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS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zIgKndvcmtfYnVmZikKLXsKLQotICAgIGlmIChlcXVhbGl6ZXJUeXBlID09IGZsYXQpCi0gICAgewotICAgICAgICBmb3IgKGludDMyIGJhbmQgPSAwOyBiYW5kIDwgRklMVEVSQkFOS19CQU5EUzsgYmFuZCArPSAyKQotICAgICAgICB7Ci0KLSAgICAgICAgICAgIGludDMyICpwdF93b3JrX2J1ZmYgPSAmd29ya19idWZmW2JhbmRdOwotICAgICAgICAgICAgaW50MzIgKmluRGF0YSA9ICZjaXJjX2J1ZmZlcls1NDQgLSAoYmFuZDw8NSldOwotCi0gICAgICAgICAgICBpbnQzMiBpOwotICAgICAgICAgICAgZm9yIChpID0gMDsgaSA8IFNVQkJBTkRTX05VTUJFUipGSUxURVJCQU5LX0JBTkRTOyBpICs9IEZJTFRFUkJBTktfQkFORFMgPDwgMikKLSAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICBpbnQzMiB0ZW1wMSA9IChwdF93b3JrX2J1ZmZbIGkgXSk7Ci0gICAgICAgICAgICAgICAgaW50MzIgdGVtcDIgPSAocHRfd29ya19idWZmWyBpICsgICBGSUxURVJCQU5LX0JBTkRTIF0pOwotICAgICAgICAgICAgICAgIGludDMyIHRlbXAzID0gKHB0X3dvcmtfYnVmZlsgaSArIDIqRklMVEVSQkFOS19CQU5EUyBdKTsKLSAgICAgICAgICAgICAgICBpbnQzMiB0ZW1wNCA9IChwdF93b3JrX2J1ZmZbIGkgKyAzKkZJTFRFUkJBTktfQkFORFMgXSk7Ci0gICAgICAgICAgICAgICAgKihpbkRhdGErKykgPSB0ZW1wMTsKLSAgICAgICAgICAgICAgICAqKGluRGF0YSsrKSA9IHRlbXAyOwotICAgICAgICAgICAgICAgICooaW5EYXRhKyspID0gdGVtcDM7Ci0gICAgICAgICAgICAgICAgKihpbkRhdGErKykgPSB0ZW1wNDsKLSAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgaW5EYXRhIC09IFNVQkJBTkRTX05VTUJFUiA8PCAxOwotICAgICAgICAgICAgcHRfd29ya19idWZmKys7Ci0KLSAgICAgICAgICAgIGZvciAoaSA9IDA7IGkgPCBTVUJCQU5EU19OVU1CRVIqRklMVEVSQkFOS19CQU5EUzsgaSArPSBGSUxURVJCQU5LX0JBTkRTIDw8IDIpCi0gICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgaW50MzIgdGVtcDEgPSAocHRfd29ya19idWZmWyBpIF0pOwotICAgICAgICAgICAgICAgIGludDMyIHRlbXAyID0gKHB0X3dvcmtfYnVmZlsgaSArICAgRklMVEVSQkFOS19CQU5EUyBdKTsKLSAgICAgICAgICAgICAgICBpbnQzMiB0ZW1wMyA9IChwdF93b3JrX2J1ZmZbIGkgKyAyKkZJTFRFUkJBTktfQkFORFMgXSk7Ci0gICAgICAgICAgICAgICAgaW50MzIgdGVtcDQgPSAocHRfd29ya19idWZmWyBpICsgMypGSUxURVJCQU5LX0JBTkRTIF0pOwotICAgICAgICAgICAgICAgICooaW5EYXRhKyspID0gdGVtcDE7Ci0gICAgICAgICAgICAgICAgKihpbkRhdGErKykgPSB0ZW1wMjsKLSAgICAgICAgICAgICAgICAqKGluRGF0YSsrKSA9IHRlbXAzOwotICAgICAgICAgICAgICAgICooaW5EYXRhKyspID0gdGVtcDQ7Ci0gICAgICAgICAgICB9Ci0gICAgICAgIH0KLSAgICB9Ci0gICAgZWxzZQotICAgIHsKLSAgICAgICAgY29uc3QgaW50MzIgKnB0X2VxdWFsaXplciA9IGVxdWFsaXplclRibFtlcXVhbGl6ZXJUeXBlJjddOwotCi0KLSAgICAgICAgZm9yIChpbnQzMiBiYW5kID0gMDsgYmFuZCA8IEZJTFRFUkJBTktfQkFORFM7IGJhbmQgKz0gMykKLSAgICAgICAgewotICAgICAgICAgICAgaW50MzIgKmluRGF0YSA9ICZjaXJjX2J1ZmZlcls1NDQgLSAoYmFuZDw8NSldOwotCi0gICAgICAgICAgICBpbnQzMiAqcHRfd29ya19idWZmID0gJndvcmtfYnVmZltiYW5kXTsKLSAgICAgICAgICAgIGludDMyIGk7Ci0KLSAgICAgICAgICAgIGZvciAoaSA9IDA7IGkgPCBTVUJCQU5EU19OVU1CRVIqRklMVEVSQkFOS19CQU5EUzsgaSArPSBGSUxURVJCQU5LX0JBTkRTIDw8IDIpCi0gICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgaW50MzIgdGVtcDEgPSAocHRfd29ya19idWZmWyBpIF0pOwotICAgICAgICAgICAgICAgIGludDMyIHRlbXAyID0gKHB0X3dvcmtfYnVmZlsgaSArICAgRklMVEVSQkFOS19CQU5EUyBdKTsKLSAgICAgICAgICAgICAgICBpbnQzMiB0ZW1wMyA9IChwdF93b3JrX2J1ZmZbIGkgKyAyKkZJTFRFUkJBTktfQkFORFMgXSk7Ci0gICAgICAgICAgICAgICAgaW50MzIgdGVtcDQgPSAocHRfd29ya19idWZmWyBpICsgMypGSUxURVJCQU5LX0JBTkRTIF0pOwotICAgICAgICAgICAgICAgICooaW5EYXRhKyspID0gZnhwX211bDMyX1EzMih0ZW1wMSA8PCAxLCAqKHB0X2VxdWFsaXplcisrKSk7Ci0gICAgICAgICAgICAgICAgKihpbkRhdGErKykgPSBmeHBfbXVsMzJfUTMyKHRlbXAyIDw8IDEsICoocHRfZXF1YWxpemVyKyspKTsKLSAgICAgICAgICAgICAgICAqKGluRGF0YSsrKSA9IGZ4cF9tdWwzMl9RMzIodGVtcDMgPDwgMSwgKihwdF9lcXVhbGl6ZXIrKykpOwotICAgICAgICAgICAgICAgICooaW5EYXRhKyspID0gZnhwX211bDMyX1EzMih0ZW1wNCA8PCAxLCAqKHB0X2VxdWFsaXplcisrKSk7Ci0gICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgIHB0X2VxdWFsaXplciAtPSBTVUJCQU5EU19OVU1CRVI7Ci0KLSAgICAgICAgICAgIGluRGF0YSAtPSBTVUJCQU5EU19OVU1CRVIgPDwgMTsKLSAgICAgICAgICAgIHB0X3dvcmtfYnVmZisrOwotCi0gICAgICAgICAgICBmb3IgKGkgPSAwOyBpIDwgU1VCQkFORFNfTlVNQkVSKkZJTFRFUkJBTktfQkFORFM7IGkgKz0gRklMVEVSQkFOS19CQU5EUyA8PCAyKQotICAgICAgICAgICAgewotICAgICAgICAgICAgICAgIGludDMyIHRlbXAxID0gKHB0X3dvcmtfYnVmZlsgaSBdKTsKLSAgICAgICAgICAgICAgICBpbnQzMiB0ZW1wMiA9IChwdF93b3JrX2J1ZmZbIGkgKyAgIEZJTFRFUkJBTktfQkFORFMgXSk7Ci0gICAgICAgICAgICAgICAgaW50MzIgdGVtcDMgPSAocHRfd29ya19idWZmWyBpICsgMipGSUxURVJCQU5LX0JBTkRTIF0pOwotICAgICAgICAgICAgICAgIGludDMyIHRlbXA0ID0gKHB0X3dvcmtfYnVmZlsgaSArIDMqRklMVEVSQkFOS19CQU5EUyBdKTsKLSAgICAgICAgICAgICAgICAqKGluRGF0YSsrKSA9IGZ4cF9tdWwzMl9RMzIodGVtcDEgPDwgMSwgKihwdF9lcXVhbGl6ZXIrKykpOwotICAgICAgICAgICAgICAgICooaW5EYXRhKyspID0gZnhwX211bDMyX1EzMih0ZW1wMiA8PCAxLCAqKHB0X2VxdWFsaXplcisrKSk7Ci0gICAgICAgICAgICAgICAgKihpbkRhdGErKykgPSBmeHBfbXVsMzJfUTMyKHRlbXAzIDw8IDEsICoocHRfZXF1YWxpemVyKyspKTsKLSAgICAgICAgICAgICAgICAqKGluRGF0YSsrKSA9IGZ4cF9tdWwzMl9RMzIodGVtcDQgPDwgMSwgKihwdF9lcXVhbGl6ZXIrKykpOwotICAgICAgICAgICAgfQotICAgICAgICAgICAgcHRfZXF1YWxpemVyIC09IFNVQkJBTkRTX05VTUJFUjsKLQotICAgICAgICB9Ci0gICAgfQotfQotCi0KLQotCmRpZmYgLS1naXQgYS9tZWRpYS9saWJzdGFnZWZyaWdodC9jb2RlY3MvbXAzZGVjL3NyYy9wdm1wM19lcXVhbGl6ZXIuaCBiL21lZGlhL2xpYnN0YWdlZnJ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gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJnBWYXJzLT5zaWRlSW5mbywKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpbmZvLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICZjb21wdXRlZF9jcmMpOwotCi0gICAgICAgIGlmIChlcnJvckNvZGUgIT0gTk9fREVDT0RJTkdfRVJST1IpCi0gICAgICAgIHsKLSAgICAgICAgICAgIHBFeHQtPm91dHB1dEZyYW1lU2l6ZSA9IDA7Ci0gICAgICAgICAgICByZXR1cm4gZXJyb3JDb2RlOwotICAgICAgICB9Ci0KLSAgICAgICAgLyoKLSAgICAgICAgICogIElmIENSQyB3YXMgc2VudCwgY2hlY2sgdGhhdCBtYXRjaGVzIHRoZSBvbmUgZ290IHdoaWxlIHBhcnNpbmcgZGF0YQotICAgICAgICAgKiAgZGlzYWJsZSBjcmMgaWYgdGhpcyBpcyB0aGUgZGVzaXJlZCBtb2RlCi0gICAgICAgICAqLwotICAgICAgICBpZiAoaW5mby0+ZXJyb3JfcHJvdGVjdGlvbikKLSAgICAgICAgewotICAgICAgICAgICAgaWYgKChjb21wdXRlZF9jcmMgIT0gc2VudF9jcmMpICYmIHBFeHQtPmNyY0VuYWJsZWQpCi0gICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgY3JjX2Vycm9yX2NvdW50Kys7Ci0gICAgICAgICAgICB9Ci0gICAgICAgIH0KLQotICAgICAgICAvKgotICAgICAgICAgKiBtYWluIGRhdGEgKHNjYWxlZmFjdG9ycywgSHVmZm1hbiBjb2RlZCwgZXRjLCkgYXJlIG5vdCBuZWNlc3NhcmlseSBsb2NhdGVkCi0gICAgICAgICAqIGFkamFjZW50IHRvIHRoZSBzaWRlLWluZm8uIEJlZ2lubmluZyBvZiBtYWluIGRhdGEgaXMgbG9jYXRlZCB1c2luZwotICAgICAgICAgKiBmaWVsZCAibWFpbl9kYXRhX2JlZ2luIiBvZ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0gICAgICAgICAgICAgKiAgTWFpbiBkYXRhIGNvdWxkIGJlIGxvY2F0ZWQgaW4gdGhlIHByZXZpb3VzIGZyYW1lLCBzbyBhbiB1bmFjY291bnRlZAotICAgICAgICAgICAgICogIGZyYW1lIGNhbiBjYXVzZSBpbmNvcnJlY3QgcHJvY2Vzc2luZwotICAgICAgICAgICAgICogIEp1c3QgcnVuIHRoZSBwb2x5cGhhc2UgZmlsdGVyIHRvICJjbGVhbiIgdGhlIGhpc3RvcnkgYnVmZmVyCi0gICAgICAgICAgICAgKi8KLSAgICAgICAgICAgIGVycm9yQ29kZSA9IE5PX0VOT1VHSF9NQUlOX0RBVEFfRVJST1I7Ci0KLSAgICAgICAgICAgIC8qCi0gICAgICAgICAgICAgKiAgQ2xlYXIgdGhlIGlucHV0IHRvIHRoZXNlIGZpbHRlcnMKLSAgICAgICAgICAgICAqLwotCi0gICAgICAgICAgICBwdl9tZW1zZXQoKHZvaWQqKXBDaFZhcnNbUklHSFRdLT53b3JrX2J1Zl9pbnQzMiwKLSAgICAgICAgICAgICAgICAgICAgICAwLAotICAgICAgICAgICAgICAgICAgICAgIFNVQkJBTkRTX05VTUJFUipGSUxURVJCQU5LX0JBTkRTKnNpemVvZihwQ2hWYXJzW1JJR0hUXS0+d29ya19idWZfaW50MzJbMF0pKTsKLQotICAgICAgICAgICAgcHZfbWVtc2V0KCh2b2lkKilwQ2hWYXJzW0xFRlRdLT53b3JrX2J1Zl9pbnQzMiwKLSAgICAgICAgICAgICAgICAgICAgICAwLAotICAgICAgICAgICAgICAgICAgICAgIFNVQkJBTkRTX05VTUJFUipGSUxURVJCQU5LX0JBTkRTKnNpemVvZihwQ2hWYXJzW0xFRlRdLT53b3JrX2J1Zl9pbnQzMlswXSkpOwotCi0gICAgICAgICAgICAvKiAgY2xlYXIgY2lyY3VsYXIgYnVmZmVycywgdG8gYXZvaWQgYW55IGdsaXRjaCAqLwotICAgICAgICAgICAgcHZfbWVtc2V0KCh2b2lkKikmcENoVmFyc1sgTEVGVF0tPmNpcmNfYnVmZmVyWzU3Nl0sCi0gICAgICAgICAgICAgICAgICAgICAgMCwKLSAgICAgICAgICAgICAgICAgICAgICA0ODAqc2l6ZW9mKHBDaFZhcnNbIExFRlRdLT5jaXJjX2J1ZmZlclswXSkpOwotICAgICAgICAgICAgcHZfbWVtc2V0KCh2b2lkKikmcENoVmFyc1tSSUdIVF0tPmNpcmNfYnVmZmVyWzU3Nl0sCi0gICAgICAgICAgICAgICAgICAgICAgMCwKLSAgICAgICAgICAgICAgICAgICAgICA0ODAqc2l6ZW9mKHBDaFZhcnNbUklHSFRdLT5jaXJjX2J1ZmZlclswXSkpOwotCi0gICAgICAgICAgICBwQ2hWYXJzWyBMRUZUXS0+dXNlZF9mcmVxX2xpbmVzID0gNTc1OwotICAgICAgICAgICAgcENoVmFyc1tSSUdIVF0tPnVzZWRfZnJlcV9saW5lcyA9IDU3NTsKLQotICAgICAgICB9Ci0gICAgICAgIGVsc2UKLSAgICAgICAgewotICAgICAgICAgICAgcFZhcnMtPm1haW5EYXRhU3RyZWFtLnVzZWRCaXRzICs9IChieXRlc190b19kaXNjYXJkIDw8IDMpOwotICAgICAgICB9Ci0KLSAgICAgICAgLyoKLSAgICAgICAgICogIGlmIChmcl9wcy0+aGVhZGVyLT52ZXJzaW9uX3ggPT0gTVBFR18xKSwgdXNlIDIgZ3JhbnVsZXMsIG90aGVyd2lzZSBqdXN0IDEKLSAgICAgICAgICovCi0gICAgICAgIGZvciAoZ3IgPSAwOyBnciA8ICgxICsgIShpbmZvLT52ZXJzaW9uX3gpKTsgZ3IrKykKLSAgICAgICAgewotICAgICAgICAgICAgaWYgKGVycm9yQ29kZSAhPSBOT19FTk9VR0hfTUFJTl9EQVRBX0VSUk9SKQotICAgICAgICAgICAgewotICAgICAgICAgICAgICAgIGZvciAoY2ggPSAwOyBjaCA8IHBWYXJzLT5udW1fY2hhbm5lbHM7IGNoKyspCi0gICAgICAgICAgICAgICAgewotICAgICAgICAgICAgICAgICAgICBpbnQzMiBwYXJ0Ml9zdGFydCA9IHBWYXJzLT5tYWluRGF0YVN0cmVhbS51c2VkQml0czsKLQotICAgICAgICAgICAgICAgICAgICBpZiAoaW5mby0+dmVyc2lvbl94ID09IE1QRUdfMSkKLSAgICAgICAgICAgICAgICAgICAgewotCi0gICAgICAgICAgICAgICAgICAgICAgICBwdm1wM19nZXRfc2NhbGVfZmFjdG9ycygmcFZhcnMtPnNjYWxlRmFjdG9yc1tjaF0sCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmcFZhcnMtPnNpZGVJbmZvLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZ3IsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjaCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICZwVmFycy0+bWFpbkRhdGFTdHJlYW0pOwotICAgICAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgICAgIGVsc2UKLSAgICAgICAgICAgICAgICAgICAgewotICAgICAgICAgICAgICAgICAgICAgICAgaW50MzIgKiB0bXAgPSBwVmFycy0+U2NyYXRjaF9tZW07Ci0gICAgICAgICAgICAgICAgICAgICAgICBwdm1wM19tcGVnMl9nZXRfc2NhbGVfZmFjdG9ycygmcFZhcnMtPnNjYWxlRmFjdG9yc1tjaF0sCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmcFZhcnMtPnNpZGVJbmZvLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZ3IsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjaCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGluZm8sCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAodWludDMyICopdG1wLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJnBWYXJzLT5tYWluRGF0YVN0cmVhbSk7Ci0gICAgICAgICAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgICAgICAgICBwQ2hWYXJzW2NoXS0+dXNlZF9mcmVxX2xpbmVzID0gcHZtcDNfaHVmZm1hbl9wYXJzaW5nKHBDaFZhcnNbY2hdLT53b3JrX2J1Zl9pbnQzMiwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICZwVmFycy0+c2lkZUluZm8uY2hbY2hdLmdyYW5bZ3JdLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcFZhcnMsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwYXJ0Ml9zdGFydCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGluZm8pOwotCi0KLSAgICAgICAgICAgICAgICAgICAgcHZtcDNfZGVxdWFudGl6ZV9zYW1wbGUocENoVmFyc1tjaF0tPndvcmtfYnVmX2ludDMyLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmcFZhcnMtPnNjYWxlRmFjdG9yc1tjaF0sCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICZwVmFycy0+c2lkZUluZm8uY2hbY2hdLmdyYW5bZ3JdLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwQ2hWYXJzW2NoXS0+dXNlZF9mcmVxX2xpbmVzLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpbmZvKTsKLQotCi0KLQotICAgICAgICAgICAgICAgIH0gICAvKiBmb3IgKGNoPTA7IGNoPHN0ZXJlbzsgY2grKykgICovCi0KLSAgICAgICAgICAgICAgICBpZiAocFZhcnMtPm51bV9jaGFubmVscyA9PSAyKQotICAgICAgICAgICAgICAgIHsKLQotICAgICAgICAgICAgICAgICAgICBpbnQzMiB1c2VkX2ZyZXFfbGluZXMgPSAocENoVmFyc1sgTEVGVF0tPnVzZWRfZnJlcV9saW5lcyAgPgotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcENoVmFyc1tSSUdIVF0tPnVzZWRfZnJlcV9saW5lcykgPwotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwQ2hWYXJzWyBMRUZUXS0+dXNlZF9mcmVxX2xpbmVzICA6Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBDaFZhcnNbUklHSFRdLT51c2VkX2ZyZXFfbGluZXM7Ci0KLSAgICAgICAgICAgICAgICAgICAgcENoVmFyc1sgTEVGVF0tPnVzZWRfZnJlcV9saW5lcyA9IHVzZWRfZnJlcV9saW5lczsKLSAgICAgICAgICAgICAgICAgICAgcENoVmFyc1tSSUdIVF0tPnVzZWRfZnJlcV9saW5lcyA9IHVzZWRfZnJlcV9saW5lczsKLQotICAgICAgICAgICAgICAgICAgICBpZiAoaW5mby0+dmVyc2lvbl94ID09IE1QRUdfMSkKLSAgICAgICAgICAgICAgICAgICAgewotICAgICAgICAgICAgICAgICAgICAgICAgcHZtcDNfc3RlcmVvX3Byb2MocENoVmFyc1sgTEVGVF0tPndvcmtfYnVmX2ludDMyLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcENoVmFyc1tSSUdIVF0tPndvcmtfYnVmX2ludDMyLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJnBWYXJzLT5zY2FsZUZhY3RvcnNbUklHSFRdLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJnBWYXJzLT5zaWRlSW5mby5jaFtMRUZUXS5ncmFuW2dyXSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHVzZWRfZnJlcV9saW5lcywKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGluZm8pOwotICAgICAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgICAgIGVsc2UKLSAgICAgICAgICAgICAgICAgICAgewotICAgICAgICAgICAgICAgICAgICAgICAgaW50MzIgKiB0bXAgPSBwVmFycy0+U2NyYXRjaF9tZW07Ci0gICAgICAgICAgICAgICAgICAgICAgICBwdm1wM19tcGVnMl9zdGVyZW9fcHJvYyhwQ2hWYXJzWyBMRUZUXS0+d29ya19idWZfaW50MzIsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwQ2hWYXJzW1JJR0hUXS0+d29ya19idWZfaW50MzIsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmcFZhcnMtPnNjYWxlRmFjdG9yc1tSSUdIVF0sCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmcFZhcnMtPnNpZGVJbmZvLmNoWyBMRUZUXS5ncmFuW2dyXSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICZwVmFycy0+c2lkZUluZm8uY2hbUklHSFRdLmdyYW5bZ3JdLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKHVpbnQzMiAqKXRtcCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHVzZWRfZnJlcV9saW5lcywKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGluZm8pOwotICAgICAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgfQotCi0gICAgICAgICAgICB9IC8qIGlmICggZXJyb3JDb2RlICE9IE5PX0VOT1VHSF9NQUlOX0RBVEFfRVJST1IpICovCi0KLSAgICAgICAgICAgIGZvciAoY2ggPSAwOyBjaCA8IHBWYXJzLT5udW1fY2hhbm5lbHM7IGNoKyspCi0gICAgICAgICAgICB7Ci0KLSAgICAgICAgICAgICAgICBwdm1wM19yZW9yZGVyKHBDaFZhcnNbY2hdLT53b3JrX2J1Zl9pbnQzMiwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICZwVmFycy0+c2lkZUluZm8uY2hbY2hdLmdyYW5bZ3JdLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJnBDaFZhcnNbIGNoXS0+dXNlZF9mcmVxX2xpbmVzLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaW5mbywKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBWYXJzLT5TY3JhdGNoX21lbSk7Ci0KLSAgICAgICAgICAgICAgICBwdm1wM19hbGlhc19yZWR1Y3Rpb24ocENoVmFyc1tjaF0tPndvcmtfYnVmX2ludDMyLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmcFZhcnMtPnNpZGVJbmZvLmNoW2NoXS5ncmFuW2dyXSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJnBDaFZhcnNbIGNoXS0+dXNlZF9mcmVxX2xpbmVzLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpbmZvKTsKLQotCi0gICAgICAgICAgICAgICAgLyoKLSAgICAgICAgICAgICAgICAgKiAgIElNRENUCi0gICAgICAgICAgICAgICAgICovCi0gICAgICAgICAgICAgICAgLyogc2V0IG14cG9zaXRpb24KLSAgICAgICAgICAgICAgICAgKiBJbiBjYXNlIG9mIG1peGVkIGJsb2NrcywgIyBvZiBiYW5kcyB3aXRoIGxvbmcKLSAgICAgICAgICAgICAgICAgKiBibG9ja3MgKDIgb3IgNCkgZWxzZSAwCi0gICAgICAgICAgICAgICAgICovCi0gICAgICAgICAgICAgICAgdWludDE2IG1peGVkQmxvY2tzTG9uZ0Jsb2NrcyA9IDA7IC8qICAwID0gbG9uZyBvciBzaG9ydCwgMj1taXhlZCwgND1taXhlZCAyLjVAODAwMCAqLwotICAgICAgICAgICAgICAgIGlmIChwVmFycy0+c2lkZUluZm8uY2hbY2hdLmdyYW5bZ3JdLm1peGVkX2Jsb2NrX2ZsYWcgJiYKLSAgICAgICAgICAgICAgICAgICAgICAgIHBWYXJzLT5zaWRlSW5mby5jaFtjaF0uZ3Jhbltncl0ud2luZG93X3N3aXRjaGluZ19mbGFnKQotICAgICAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAgICAgaWYgKChpbmZvLT52ZXJzaW9uX3ggPT0gTVBFR18yXzUpICYmIChpbmZvLT5zYW1wbGluZ19mcmVxdWVuY3kgPT0gMikpCi0gICAgICAgICAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAgICAgICAgIG1peGVkQmxvY2tzTG9uZ0Jsb2NrcyA9IDQ7IC8qIG1wZWcyLjUgQCA4IEtIeiAqLwotICAgICAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgICAgIGVsc2UKLSAgICAgICAgICAgICAgICAgICAgewotICAgICAgICAgICAgICAgICAgICAgICAgbWl4ZWRCbG9ja3NMb25nQmxvY2tzID0gMjsKLSAgICAgICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgICAgIHB2bXAzX2ltZGN0X3N5bnRoKHBDaFZhcnNbY2hdLT53b3JrX2J1Zl9pbnQzMiwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwQ2hWYXJzW2NoXS0+b3ZlcmxhcCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwVmFycy0+c2lkZUluZm8uY2hbY2hdLmdyYW5bZ3JdLmJsb2NrX3R5cGUsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbWl4ZWRCbG9ja3NMb25nQmxvY2tzLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBDaFZhcnNbIGNoXS0+dXNlZF9mcmVxX2xpbmVzLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBWYXJzLT5TY3JhdGNoX21lbSk7Ci0KLQotICAgICAgICAgICAgICAgIC8qCi0gICAgICAgICAgICAgICAgICogICBQb2x5cGhhc2Ugc3ludGhlc2lzCi0gICAgICAgICAgICAgICAgICovCi0KLSAgICAgICAgICAgICAgICBwdm1wM19wb2x5X3BoYXNlX3N5bnRoZXNpcyhwQ2hWYXJzW2NoXSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwVmFycy0+bnVtX2NoYW5uZWxzLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBFeHQtPmVxdWFsaXplclR5cGUsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJnB0ck91dEJ1ZmZlcltjaF0pOwotCi0KLSAgICAgICAgICAgIH0vKiBlbmQgY2ggbG9vcCAqLwotCi0gICAgICAgICAgICBwdHJPdXRCdWZmZXIgKz0gcFZhcnMtPm51bV9jaGFubmVscyAqIFNVQkJBTkRTX05VTUJFUiAqIEZJTFRFUkJBTktfQkFORFM7Ci0gICAgICAgIH0gIC8qICAgZm9yIChncj0wO2dyPE1heF9ncjtncisrKSAgKi8KLQotICAgICAgICAvKiBza2lwIGFuY2lsbGFyeSBkYXRhICovCi0gICAgICAgIGlmIChpbmZvLT5iaXRyYXRlX2luZGV4ID4gMCkKLSAgICAgICAgeyAvKiBpZiBub3QgZnJlZS1mb3JtYXQgKi8KLQotICAgICAgICAgICAgaW50MzIgYW5jaWxsYXJ5X2RhdGFfbGVuZ2h0ID0gcFZhcnMtPnByZWRpY3RlZF9mcmFtZV9zaXpl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LS0tLS0tLS0tLS0tKi8KLQotaW50MzIgcHZtcDNfZ2V0X21haW5fZGF0YV9zaXplKG1wM0hlYWRlciAqaW5mbywKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0bXAzZGVjX2ZpbGUgICpwVmFycykKLXsKLQotCi0gICAgaW50MzIgbnVtQnl0ZXMgPSBmeHBfbXVsMzJfUTI4KG1wM19iaXRyYXRlW2luZm8tPnZlcnNpb25feF1baW5mby0+Yml0cmF0ZV9pbmRleF0gPDwgMjAsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGludl9zZnJlcVtpbmZvLT5zYW1wbGluZ19mcmVxdWVuY3ldKTsKLQotCi0gICAgbnVtQnl0ZXMgPj49ICgyMCAtIGluZm8tPnZlcnNpb25feCk7Ci0KLSAgICAvKgotICAgICAqICBSZW1vdmUgdGhlIHNpemUgb2YgdGhlIHNpZGUgaW5mb3JtYXRpb24gZnJvbSB0aGUgbWFpbiBkYXRhIHRvdGFsCi0gICAgICovCi0gICAgaWYgKGluZm8tPnZlcnNpb25feCA9PSBNUEVHXzEpCi0gICAgewotICAgICAgICBwVmFycy0+cHJlZGljdGVkX2ZyYW1lX3NpemUgPSBudW1CeXRlczsKLSAgICAgICAgaWYgKGluZm8tPm1vZGUgPT0gTVBHX01EX01PTk8pCi0gICAgICAgIHsKLSAgICAgICAgICAgIG51bUJ5dGVzIC09IDE3OwotICAgICAgICB9Ci0gICAgICAgIGVsc2UKLSAgICAgICAgewotICAgICAgICAgICAgbnVtQnl0ZXMgLT0gMzI7Ci0gICAgICAgIH0KLSAgICB9Ci0gICAgZWxzZQotICAgIHsKLSAgICAgICAgbnVtQnl0ZXMgPj49IDE7Ci0gICAgICAgIHBWYXJzLT5wcmVkaWN0ZWRfZnJhbWVfc2l6ZSA9IG51bUJ5dGVzOwotCi0gICAgICAgIGlmIChpbmZvLT5tb2RlID09IE1QR19NRF9NT05PKQotICAgICAgICB7Ci0gICAgICAgICAgICBudW1CeXRl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l9pbmZvLT5taXhlZF9ibG9ja19mbGFnKQotICAgICAgICB7IC8qIE1JWEVEICovCi0gICAgICAgICAgICBmb3IgKHNmYiA9IDA7IHNmYiA8IDg7IHNmYisrKQotICAgICAgICAgICAgewotICAgICAgICAgICAgICAgIHNjYWxlZmFjLT5sW3NmYl0gPSBnZXROYml0cyhwTWFpbkRhdGEsIHNsZW5bMF1bZ3JfaW5mby0+c2NhbGVmYWNfY29tcHJlc3NdKTsKLSAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgZm9yIChzZmIgPSAzOyBzZmIgPCA2OyBzZmIrKykKLSAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICBmb3IgKHdpbmRvdyA9IDA7IHdpbmRvdyA8IDM7IHdpbmRvdysrKQotICAgICAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAgICAgc2NhbGVmYWMtPnNbd2luZG93XVtzZmJdID0gZ2V0TmJpdHMocE1haW5EYXRhLCBzbGVuWzBdW2dyX2luZm8tPnNjYWxlZmFjX2NvbXByZXNzXSk7Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgfQotICAgICAgICAgICAgZm9yIChzZmIgPSA2OyBzZmIgPCAxMjsgc2ZiKyspCi0gICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgZm9yICh3aW5kb3cgPSAwOyB3aW5kb3cgPCAzOyB3aW5kb3crKykKLSAgICAgICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgICAgIHNjYWxlZmFjLT5zW3dpbmRvd11bc2ZiXSA9IGdldE5iaXRzKHBNYWluRGF0YSwgc2xlblsxXVtncl9pbmZvLT5zY2FsZWZhY19jb21wcmVzc10pOwotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgIH0KLSAgICAgICAgfQotICAgICAgICBlbHNlCi0gICAgICAgIHsgIC8qIFNIT1JUKi8KLSAgICAgICAgICAgIGZvciAoaSA9IDA7IGkgPCAyOyBpKyspCi0gICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgZm9yIChzZmIgPSBzZmJ0YWJsZS5zW2ldOyBzZmIgPCBzZmJ0YWJsZS5zW2krMV07IHNmYisrKQotICAgICAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAgICAgZm9yICh3aW5kb3cgPSAwOyB3aW5kb3cgPCAzOyB3aW5kb3crKykKLSAgICAgICAgICAgICAgICAgICAgewotICAgICAgICAgICAgICAgICAgICAgICAgc2NhbGVmYWMtPnNbd2luZG93XVtzZmJdID0gZ2V0TmJpdHMocE1haW5EYXRhLCBzbGVuW2ldW2dyX2luZm8tPnNjYWxlZmFjX2NvbXByZXNzXSk7Ci0gICAgICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICB9Ci0gICAgICAgIH0KLQotICAgICAgICBzY2FsZWZhYy0+c1swXVsxMl0gPSAwOyAgICAvKiBzZmIgPSAxMiB3aW49IDAgKi8KLSAgICAgICAgc2NhbGVmYWMtPnNbMV1bMTJdID0gMDsgICAgLyogc2ZiID0gMTIgd2luPSAxICovCi0gICAgICAgIHNjYWxlZmFjLT5zWzJdWzEyXSA9IDA7ICAgIC8qIHNmYiA9IDEyIHdpbj0gMiAqLwotICAgIH0KLSAgICBlbHNlCi0gICAgeyAgIC8qIExPTkcgdHlwZXMgMCwxLDMgKi8KLQotICAgICAgICBpbnQzMiAqcHRyID0gJnNjYWxlZmFjLT5sWzBdOwotCi0gICAgICAgIGZvciAoaSA9IDA7IGkgPCA0OyBpKyspCi0gICAgICAgIHsKLSAgICAgICAgICAgIGludDMyIHRtcDQgPSBsb25nX3NmYnRhYmxlW2ldOwotCi0gICAgICAgICAgICBpZiAoKHNpLT5jaFtjaF0uc2Nmc2lbaV0gPT0gMCkgfHwgKGdyID09IDApKQotICAgICAgICAgICAgewotICAgICAgICAgICAgICAgIGludDMyIHRtcDEgPSBzbGVuWyhpPj4xKV1bZ3JfaW5mby0+c2NhbGVmYWNfY29tcHJlc3NdOwotCi0gICAgICAgICAgICAgICAgaWYgKHRtcDEpCi0gICAgICAgICAgICAgICAgewotICAgICAgICAgICAgICAgICAgICBpbnQzMiB0bXAyID0gdG1wMSAqIHRtcDQ7Ci0gICAgICAgICAgICAgICAgICAgIHVpbnQzMiB0bXAzID0gZ2V0TmJpdHMocE1haW5EYXRhLCB0bXAyKTsKLSAgICAgICAgICAgICAgICAgICAgdG1wNCA9IDMyIC0gdG1wMTsKLSAgICAgICAgICAgICAgICAgICAgZm9yICg7IHRtcDIgPiAwOyB0bXAyIC09IHRtcDEpCi0gICAgICAgICAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAgICAgICAgICoocHRyKyspID0gKHRtcDMgPDwgKDMyIC0gdG1wMikpID4+IHRtcDQ7Ci0gICAgICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgZWxzZQotICAgICAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAgICAgZm9yIChzZmIgPSB0bXA0OyBzZmIgIT0gMDsgc2ZiLS0pCi0gICAgICAgICAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAgICAgICAgICoocHRyKyspID0gMDsKLSAgICAgICAgICAgICAgICAgICAgfQotCi0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgfQotICAgICAgICAgICAgZWxzZQotICAgICAgICAgICAgewotICAgICAgICAgICAgICAgIHB0ciArPSB0bXA0OwotICAgICAgICAgICAgfQotICAgICAgICB9Ci0gICAgICAgIHNjYWxlZmFjLT5sWzIxXSA9IDA7Ci0gICAgICAgIHNjYWxlZmFjLT5sWzIyXSA9IDA7Ci0gICAgfQotfQotCmRpZmYgLS1naXQgYS9tZWRpYS9saWJzdGFnZWZyaWdodC9jb2RlY3MvbXAzZGVjL3NyYy9wdm1wM19nZXRfc2NhbGVfZmFjdG9ycy5oIGIvbWVkaWEvbGlic3RhZ2VmcmlnaHQvY29kZWNzL21wM2RlYy9zcmMvcHZtcDNfZ2V0X3NjY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ICAgLyogMSAqLzsKLQotICAgICAgICAgICAgICAgICAgICBzaS0+Y2hbY2hdLmdyYW5bZ3JdLnRhYmxlX3NlbGVjdFswXSAgPSAodG1wIDw8IDEzKSA+PiAyNzsgICAvKiA1ICovOwotICAgICAgICAgICAgICAgICAgICBzaS0+Y2hbY2hdLmdyYW5bZ3JdLnRhYmxlX3NlbGVjdFsxXSAgPSAodG1wIDw8IDE4KSA+PiAyNzsgICAvKiA1ICovOwotCi0gICAgICAgICAgICAgICAgICAgIHNpLT5jaFtjaF0uZ3Jhbltncl0uc3ViYmxvY2tfZ2FpblswXSA9ICh0bXAgPDwgMjMpID4+IDI5OyAgIC8qIDMgKi87Ci0gICAgICAgICAgICAgICAgICAgIHNpLT5jaFtjaF0uZ3Jhbltncl0uc3ViYmxvY2tfZ2FpblsxXSA9ICh0bXAgPDwgMjYpID4+IDI5OyAgIC8qIDMgKi87Ci0gICAgICAgICAgICAgICAgICAgIHNpLT5jaFtjaF0uZ3Jhbltncl0uc3ViYmxvY2tfZ2FpblsyXSA9ICh0bXAgPDwgMjkpID4+IDI5OyAgIC8qIDMgKi87Ci0KLSAgICAgICAgICAgICAgICAgICAgLyogU2V0IHJlZ2lvbl9jb3VudCBwYXJhbWV0ZXJzIHNpbmNlIHRoZXkgYXJlIGltcGxpY2l0IGluIHRoaXMgY2FzZS4gKi8KLQotICAgICAgICAgICAgICAgICAgICBpZiAoc2ktPmNoW2NoXS5ncmFuW2dyXS5ibG9ja190eXBlID09IDApCi0gICAgICAgICAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybihTSURFX0lORk9fRVJST1IpOwotICAgICAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgICAgIGVsc2UgaWYgKChzaS0+Y2hbY2hdLmdyYW5bZ3JdLmJsb2NrX3R5cGUgICAgICAgPT0gMikKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgKHNpLT5jaFtjaF0uZ3Jhbltncl0ubWl4ZWRfYmxvY2tfZmxhZyA9PSAwKSkKLSAgICAgICAgICAgICAgICAgICAgewotICAgICAgICAgICAgICAgICAgICAgICAgc2ktPmNoW2NoXS5ncmFuW2dyXS5yZWdpb24wX2NvdW50ID0gODsgLyogTUkgOTsgKi8KLSAgICAgICAgICAgICAgICAgICAgICAgIHNpLT5jaFtjaF0uZ3Jhbltncl0ucmVnaW9uMV9jb3VudCA9IDEyOwotICAgICAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgICAgIGVsc2UKLSAgICAgICAgICAgICAgICAgICAgewotICAgICAgICAgICAgICAgICAgICAgICAgc2ktPmNoW2NoXS5ncmFuW2dyXS5yZWdpb24wX2NvdW50ID0gNzsgLyogTUkgODsgKi8KLSAgICAgICAgICAgICAgICAgICAgICAgIHNpLT5jaFtjaF0uZ3Jhbltncl0ucmVnaW9uMV9jb3VudCA9IDEzOwotICAgICAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgIGVsc2UKLSAgICAgICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgICAgIHRtcCA9IGdldGJpdHNfY3JjKGlucHV0U3RyZWFtLCAyMiwgY3JjLCBpbmZvLT5lcnJvcl9wcm90ZWN0aW9uKTsKLQotICAgICAgICAgICAgICAgICAgICBzaS0+Y2hbY2hdLmdyYW5bZ3JdLnRhYmxlX3NlbGVjdFswXSA9ICh0bXAgPDwgMTApID4+IDI3OyAgIC8qIDUgKi87Ci0gICAgICAgICAgICAgICAgICAgIHNpLT5jaFtjaF0uZ3Jhbltncl0udGFibGVfc2VsZWN0WzFdID0gKHRtcCA8PCAxNSkgPj4gMjc7ICAgLyogNSAqLzsKLSAgICAgICAgICAgICAgICAgICAgc2ktPmNoW2NoXS5ncmFuW2dyXS50YWJsZV9zZWxlY3RbMl0gPSAodG1wIDw8IDIwKSA+PiAyNzsgICAvKiA1ICovOwotCi0gICAgICAgICAgICAgICAgICAgIHNpLT5jaF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mxvY2tfdHlwZSAgICAgICA9PSAyKQotICAgICAgICAgICAgICAgICAgICAgICAgICYmIChzaS0+Y2hbY2hdLmdyYW5bMF0ubWl4ZWRfYmxvY2tfZmxhZyA9PSAwKSkKLSAgICAgICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgICAgIHNpLT5jaFtjaF0uZ3JhblswXS5yZWdpb24wX2NvdW50ID0gODsgLyogTUkgOTsgKi8KLSAgICAgICAgICAgICAgICAgICAgc2ktPmNoW2NoXS5ncmFuWzBdLnJlZ2lvbjFfY291bnQgPSAxMjsKLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgZWxzZQotICAgICAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAgICAgc2ktPmNoW2NoXS5ncmFuWzBdLnJlZ2lvbjBfY291bnQgPSA3OyAvKiBNSSA4OyAqLwotICAgICAgICAgICAgICAgICAgICBzaS0+Y2hbY2hdLmdyYW5bMF0ucmVnaW9uMV9jb3VudCA9IDEzOwotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgIH0KLSAgICAgICAgICAgIGVsc2UKLSAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICB0bXAgPSBnZXRiaXRzX2NyYyhpbnB1dFN0cmVhbSwgMjIsIGNyYywgaW5mby0+ZXJyb3JfcHJvdGVjdGlvbik7Ci0KLSAgICAgICAgICAgICAgICBzaS0+Y2hbY2hdLmdyYW5bMF0udGFibGVfc2VsZWN0WzBdID0gKHRtcCA8PCAxMCkgPj4gMjc7ICAgLyogNSAqLzsKLSAgICAgICAgICAgICAgICBzaS0+Y2hbY2hdLmdyYW5bMF0udGFibGVfc2VsZWN0WzFdID0gKHRtcCA8PCAxNSkgPj4gMjc7ICAgLyogNSAqLzsKLSAgICAgICAgICAgICAgICBzaS0+Y2hbY2hdLmdyYW5bMF0udGFibGVfc2VsZWN0WzJdID0gKHRtcCA8PCAyMCkgPj4gMjc7ICAgLyogNSAqLzsKLQotICAgICAgICAgIC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ICBpbnQzMiB2OwotICAgIGludDMyIHc7Ci0KLSAgICB5ID0gKCpoLT5wZGVjX2h1ZmZfdGFiKShwTWFpbkRhdGEpOwotCi0KLSAgICBpZiAoeSkKLSAgICB7Ci0gICAgICAgIHYgPSAoeSA+PiAzKTsKLQotICAgICAgICBpZiAodikKLSAgICAgICAgewotICAgICAgICAgICAgaWYgKGdldDFiaXQocE1haW5EYXRhKSkKLSAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICB2ID0gLXY7Ci0gICAgICAgICAgICB9Ci0gICAgICAgIH0KLSAgICAgICAgdyA9ICh5ID4+IDIpICYgMTsKLSAgICAgICAgaWYgKHcpCi0gICAgICAgIHsKLSAgICAgICAgICAgIGlmIChnZXQxYml0KHBNYWluRGF0YSkpCi0gICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgdyA9IC13OwotICAgICAgICAgICAgfQotICAgICAgICB9Ci0gICAgICAgIHggPSAoeSA+PiAxKSAmIDE7Ci0gICAgICAgIGlmICh4KQotICAgICAgICB7Ci0gICAgICAgICAgICBpZiAoZ2V0MWJpdChwTWFpbkRhdGEpKQotICAgICAgICAgICAgewotICAgICAgICAgICAgICAgIHggPSAteDsKLSAgICAgICAgICAgIH0KLSAgICAgICAgfQotICAgICAgICB5ID0gIHkgJiAxOwotICAgICAgICBpZiAoeSkKLSAgICAgICAgewotICAgICAgICAgICAgaWYgKGdldDFiaXQocE1haW5EYXRhKSkKLSAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICB5ID0gLXk7Ci0gICAgICAgICAgICB9Ci0gICAgICAgIH0KLQotICAgIH0KLSAgICBlbHNlCi0gICAgewotICAgICAgICB2ID0gMDsKLSAgICAgICAgdyA9IDA7Ci0gICAgICAgIHggPSAwOwotCi0gICAgfQotCi0gICAgKmlzICAgICA9IHY7Ci0gICAgKihpcyArIDEpID0gdzsKLSAgICAqKGlzICsgMikgPSB4OwotICAgICooaXMgKyAzKSA9IHk7Ci0KLX0KLQotCi0KLXZvaWQgcHZtcDNfaHVmZm1hbl9wYWlyX2RlY29kaW5nKHN0cnVjdCBodWZmY29kZXRhYiAqaCwgICAgIC8qIHBvaW50ZXIgdG8gaHVmZm1hbiBjb2RlIHJlY29yZCAgICovCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpbnQzMiAqaXMsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0bXAzQml0cyAqcE1haW5EYXRhKQotewotICAgIC8qIExvb2t1cCBpbiBIdWZmbWFuIHRhYmxlLiAqLwotICAgIGludDMyIHg7Ci0gICAgaW50MzIgeTsKLQotICAgIHVpbnQxNiBjdyA9ICgqaC0+cGRlY19odWZmX3RhYikocE1haW5EYXRhKTsKLQotICAgIC8qIFByb2Nlc3Mgc2lnbiBhbmQgZXNjYXBlIGVuY29kaW5ncyBmb3IgZHVhbCB0YWJsZXMuICovCi0KLQotICAgIGlmIChjdykKLSAgICB7Ci0gICAgICAgIHggPSBjdyA+PiA0OwotCi0gICAgICAgIGlmICh4KQotICAgICAgICB7Ci0gICAgICAgICAgICBpZiAoZ2V0MWJpdChwTWFpbkRhdGEpKQotICAgICAgICAgICAgewotICAgICAgICAgICAgICAgIHggPSAteDsKLSAgICAgICAgICAgIH0KLSAgICAgICAgICAgIHkgPSBjdyAmIDB4ZjsKLSAgICAgICAgICAgIGlmICh5ICYmIGdldDFiaXQocE1haW5EYXRhKSkKLSAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICB5ID0gLXk7Ci0gICAgICAgICAgICB9Ci0KLSAgICAgICAgfQotICAgICAgICBlbHNlCi0gICAgICAgIHsKLSAgICAgICAgICAgIHkgPSBjdyAmIDB4ZjsKLSAgICAgICAgICAgIGlmIChnZXQxYml0KHBNYWluRGF0YSkpCi0gICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgeSA9IC15OwotICAgICAgICAgICAgfQotICAgICAgICB9Ci0KLSAgICAgICAgKmlzICAgICA9IHg7Ci0gICAgICAgICooaXMgKyAxKSA9IHk7Ci0gICAgfQotICAgIGVsc2UKLSAgICB7Ci0gICAgICAgICppcyAgICAgPSAwOwotICAgICAgICAqKGlzICsgMSkgPSAwOwotICAgIH0KLQotCi0KLX0KLQotCi0KLQotdm9pZCBwdm1wM19odWZmbWFuX3BhaXJfZGVjb2RpbmdfbGluYml0cyhzdHJ1Y3QgaHVmZmNvZGV0YWIgKmgsICAgICAvKiBwb2ludGVyIHRvIGh1ZmZtYW4gY29kZSByZWNvcmQgICAqLwotICAgICAgICBpbnQzMiAqaXMsCi0gICAgICAgIHRtcDNCaXRzICpwTWFpbkRhdGEpCi17Ci0gICAgaW50MzIgeDsKLSAgICBpbnQzMiB5OwotCi0gICAgdWludDE2IGN3OwotICAgIC8qIExvb2t1cCBpbiBIdWZmbWFuIHRhYmxlLiAqLwotCi0KLSAgICBjdyA9ICgqaC0+cGRlY19odWZmX3RhYikocE1haW5EYXRhKTsKLSAgICB4ID0gY3cgPj4gNDsKLQotICAgIC8qIFByb2Nlc3Mgc2lnbiBhbmQgZXNjYXBlIGVuY29kaW5ncyBmb3IgZHVhbCB0YWJsZXMuICovCi0KLQotICAgIGlmICgxNSA9PSAodWludDMyKXgpCi0gICAgewotICAgICAgICBpbnQzMiB0bXAgPSBnZXRVcFRvMTdiaXRzKHBNYWluRGF0YSwgKGgtPmxpbmJpdHMgKyAxKSk7Ci0gICAgICAgIHggKz0gdG1wID4+IDE7Ci0gICAgICAgIGlmICh0bXAmMSkKLSAgICAgICAgewotICAgICAgICAgICAgeCA9IC14OwotICAgICAgICB9Ci0gICAgfQotICAgIGVsc2UgaWYgKHgpCi0gICAgewotICAgICAgICBpZiAoZ2V0MWJpdChwTWFpbkRhdGEpKQotICAgICAgICB7Ci0gICAgICAgICAgICB4ID0gLXg7Ci0gICAgICAgIH0KLSAgICB9Ci0KLSAgICB5ID0gY3cgJiAweGY7Ci0gICAgaWYgKDE1ID09ICh1aW50MzIpeSkKLSAgICB7Ci0gICAgICAgIGludDMyIHRtc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X3BhaXJfZGVjb2RpbmdfbGluYml0czsKLSAgICAgICAgfQotICAgICAgICBlbHNlCi0gICAgICAgIHsKLSAgICAgICAgICAgIHB0X2h1ZmYgPSBwdm1wM19odWZmbWFuX3BhaXJfZGVjb2Rpbmc7Ci0gICAgICAgIH0KLQotICAgICAgICBmb3IgKDsgaSA8IHJlZ2lvbjJTdGFydDsgaSArPSAyKQotICAgICAgICB7Ci0gICAgICAgICAgICAoKnB0X2h1ZmYpKGgsICZpc1tpXSwgcE1haW5EYXRhKTsKLSAgICAgICAgfQotCi0gICAgICAgIGggPSAmKHBWYXJzLT5odFtnckluZm8tPnRhYmxlX3NlbGVjdFsyXV0pOwotICAgICAgICBpZiAoaC0+bGluYml0cykKLSAgICAgICAgewotICAgICAgICAgICAgcHRfaHVmZiA9IHB2bXAzX2h1ZmZtYW5fcGFpcl9kZWNvZGluZ19saW5iaXRzOwotICAgICAgICB9Ci0gICAgICAgIGVsc2UKLSAgICAgICAgewotICAgICAgICAgICAgcHRfaHVmZiA9IHB2bXAzX2h1ZmZtYW5fcGFpcl9kZWNvZGluZzsKLSAgICAgICAgfQotCi0gICAgICAgIGZvciAoOyAodWludDMyKWkgPCAoZ3JJbmZvLT5iaWdfdmFsdWVzIDw8IDEpOyBpICs9IDIpCi0gICAgICAgIHsKLSAgICAgICAgICAgICgqcHRfaHVmZikoaCwgJmlzW2ldLCBwTWFpbkRhdGEpOwotICAgICAgICB9Ci0gICAgfQotICAgIGVsc2UgaWYgKChnckluZm8tPmJpZ192YWx1ZXMgPDwgMSkgPiAodWludDMyKXJlZ2lvbjFTdGFydCkKLSAgICB7Ci0gICAgICAgIGggPSAmKHBWYXJzLT5odFtnckluZm8tPnRhYmxlX3NlbGVjdFswXV0pOwotICAgICAgICBpZiAoaC0+bGluYml0cykKLSAgICAgICAgewotICAgICAgICAgICAgcHRfaHVmZiA9IHB2bXAzX2h1ZmZtYW5fcGFpcl9kZWNvZGluZ19saW5iaXRzOwotICAgICAgICB9Ci0gICAgICAgIGVsc2UKLSAgICAgICAgewotICAgICAgICAgICAgcHRfaHVmZiA9IHB2bXAzX2h1ZmZtYW5fcGFpcl9kZWNvZGluZzsKLSAgICAgICAgfQotICAgICAgICBmb3IgKGkgPSAwOyBpIDwgcmVnaW9uMVN0YXJ0OyBpICs9IDIpCi0gICAgICAgIHsKLSAgICAgICAgICAgICgqcHRfaHVmZikoaCwgJmlzW2ldLCBwTWFpbkRhdGEpOwotICAgICAgICB9Ci0KLSAgICAgICAgaCA9ICYocFZhcnMtPmh0W2dySW5mby0+dGFibGVfc2VsZWN0WzFdXSk7Ci0gICAgICAgIGlmIChoLT5saW5iaXRzKQotICAgICAgICB7Ci0gICAgICAgICAgICBwdF9odWZmID0gcHZtcDNfaHVmZm1hbl9wYWlyX2RlY29kaW5nX2xpbmJpdHM7Ci0gICAgICAgIH0KLSAgICAgICAgZWxzZQotICAgICAgICB7Ci0gICAgICAgICAgICBwdF9odWZmID0gcHZtcDNfaHVmZm1hbl9wYWlyX2RlY29kaW5nOwotICAgICAgICB9Ci0gICAgICAgIGZvciAoOyAodWludDMyKWkgPCAoZ3JJbmZvLT5iaWdfdmFsdWVzIDw8IDEpOyBpICs9IDIpCi0gICAgICAgIHsKLSAgICAgICAgICAgICgqcHRfaHVmZikoaCwgJmlzW2ldLCBwTWFpbkRhdGEpOwotICAgICAgICB9Ci0gICAgfQotICAgIGVsc2UKLSAgICB7Ci0gICAgICAgIGggPSAmKHBWYXJzLT5odFtnckluZm8tPnRhYmxlX3NlbGVjdFswXV0pOwotICAgICAgICBpZiAoaC0+bGluYml0cykKLSAgICAgICAgewotICAgICAgICAgICAgcHRfaHVmZiA9IHB2bXAzX2h1ZmZtYW5fcGFpcl9kZWNvZGluZ19saW5iaXRzOwotICAgICAgICB9Ci0gICAgICAgIGVsc2UKLSAgICAgICAgewotICAgICAgICAgICAgcHRfaHVmZiA9IHB2bXAzX2h1ZmZtYW5fcGFpcl9kZWNvZGluZzsKLSAgICAgICAgfQotCi0gICAgICAgIGZvciAoaSA9IDA7ICh1aW50MzIpaSA8IChnckluZm8tPmJpZ192YWx1ZXMgPDwgMSk7IGkgKz0gMikKLSAgICAgICAgewotICAgICAgICAgICAgKCpwdF9odWZmKShoLCAmaXNbaV0sIHBNYWluRGF0YSk7Ci0gICAgICAgIH0KLSAgICB9Ci0KLQotCi0gICAgLyogUmVhZCBjb3VudDEgYXJlYS4gKi8KLSAgICBoID0gJihwVmFycy0+aHRbZ3JJbmZvLT5jb3VudDF0YWJsZV9zZWxlY3QrMzJdKTsKLQotICAgIGdyQml0cyAgICAgPSBwYXJ0Ml9zdGFydCArIGdySW5mby0+cGFydDJfM19sZW5ndGg7Ci0KLSAgICB3aGlsZSAoKHBNYWluRGF0YS0+dXNlZEJpdHMgPCBnckJpdHMpICYmCi0gICAgICAgICAgICAoaSA8IEZJTFRFUkJBTktfQkFORFMqU1VCQkFORFNfTlVNQkVSIC0gNCkpCi0gICAgewotICAgICAgICBwdm1wM19odWZmbWFuX3F1YWRfZGVjb2RpbmcoaCwgJmlzW2ldLCBwTWFpbkRhdGEpOwotICAgICAgICBpICs9IDQ7Ci0gICAgfQotCi0gICAgaWYgKChwTWFpbkRhdGEtPnVzZWRCaXRzIDwgZ3JCaXRzKSAmJgotICAgICAgICAgICAgKGkgPCBGSUxURVJCQU5LX0JBTkRTKlNVQkJBTkRTX05VTUJFUikpCi0gICAgewotICAgICAgICBwdm1wM19odWZmbWFuX3F1YWRfZGVjb2RpbmcoaCwgJmlzW2ldLCBwTWFpbkRhdGEpOwotICAgICAgICBpICs9IDQ7Ci0KLSAgICAgICAgaWYgKChpIC0gMikgPj0gRklMVEVSQkFOS19CQU5EUypTVUJCQU5EU19OVU1CRVIpCi0gICAgICAgIHsKLSAgICAgICAgICAgIGkgLT0gMjsKLSAgICAgICAgICAgIGlzW2ldID0gMDsKLSAgICAgICAgICAgIGlzWyhpKzEpXSA9IDA7Ci0gICAgICAgIH0KLSAgICB9Ci0KLSAgICBpZiAocE1haW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vdmVybGFwW1NVQkJBTkRTX05VTUJFUipGSUxURVJCQU5LX0JBTkRTXSwKLSAgICAgICAgICAgICAgICAgICAgICAgdWludDMyIGJsa190eXBlLAotICAgICAgICAgICAgICAgICAgICAgICBpbnQxNiAgbXhfYmFuZCwKLSAgICAgICAgICAgICAgICAgICAgICAgaW50MzIgIHVzZWRfZnJlcV9saW5lcywKLSAgICAgICAgICAgICAgICAgICAgICAgaW50MzIgICpTY3JhdGNoX21lbSkKLXsKLQotICAgIGludDMyIGJhbmQ7Ci0gICAgaW50MzIgYmFuZHMycHJvY2VzcyA9IHVzZWRfZnJlcV9saW5lcyArIDI7Ci0KLSAgICBpZiAoYmFuZHMycHJvY2VzcyA+IFNVQkJBTkRTX05VTUJFUikKLSAgICB7Ci0gICAgICAgIGJhbmRzMnByb2Nlc3MgPSBTVUJCQU5EU19OVU1CRVI7ICAvKiBkZWZhdWx0ICovCi0gICAgfQotCi0KLSAgICAvKgotICAgICAqICBpbiBjYXNlIG9mIG14X3BvbHlfYmFuZD4gMCwgZG8KLSAgICAgKiAgbG9uZyB0cmFuc2Zvcm1zCi0gICAgICovCi0KLQotICAgIGZvciAoYmFuZCA9IDA7IGJhbmQgPCBiYW5kczJwcm9jZXNzOyBiYW5kKyspCi0gICAgewotICAgICAgICB1aW50MzIgY3VycmVudF9ibGtfdHlwZSA9IChiYW5kIDwgbXhfYmFuZCkgPyBMT05HIDogYmxrX3R5cGU7Ci0KLSAgICAgICAgaW50MzIgKiBvdXQgICAgID0gaW4gICAgICArIChiYW5kICogRklMVEVSQkFOS19CQU5EUyk7Ci0gICAgICAgIGludDMyICogaGlzdG9yeSA9IG92ZXJsYXAgKyAoYmFuZCAqIEZJTFRFUkJBTktfQkFORFMpOwotCi0gICAgICAgIHN3aXRjaCAoY3VycmVudF9ibGtfdHlwZSkKLSAgICAgICAgewotICAgICAgICAgICAgY2FzZSBMT05HOgotCi0gICAgICAgICAgICAgICAgcHZtcDNfbWRjdF8xOChvdXQsIGhpc3RvcnksIG5vcm1hbF93aW4pOwotCi0gICAgICAgICAgICAgICAgYnJlYWs7Ci0KLSAgICAgICAgICAgIGNhc2UgU1RBUlQ6Ci0KLSAgICAgICAgICAgICAgICBwdm1wM19tZGN0XzE4KG91dCwgaGlzdG9yeSwgc3RhcnRfd2luKTsKLQotICAgICAgICAgICAgICAgIGJyZWFrOwotCi0gICAgICAgICAgICBjYXNlIFNUT1A6Ci0KLSAgICAgICAgICAgICAgICBwdm1wM19tZGN0XzE4KG91dCwgaGlzdG9yeSwgc3RvcF93aW4pOwotCi0gICAgICAgICAgICAgICAgYnJlYWs7Ci0KLSAgICAgICAgICAgIGNhc2UgU0hPUlQ6Ci0gICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgaW50MzIgKnRtcF9wcmV2X292ciA9ICZTY3JhdGNoX21lbVtGSUxURVJCQU5LX0JBTkRTXTsKLSAgICAgICAgICAgICAgICBpbnQzMiBpOwotCi0gICAgICAgICAgICAgICAgZm9yIChpID0gMDsgaSA8IDY7IGkrKykKLSAgICAgICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgICAgIFNjcmF0Y2hfbWVtW2kgICAgXSA9IG91dFsoaSozKV07Ci0gICAgICAgICAgICAgICAgICAgIFNjcmF0Y2hfbWVtWzYgICtpXSA9IG91dFsoaSozKSArIDFdOwotICAgICAgICAgICAgICAgICAgICBTY3JhdGNoX21lbVsxMiAraV0gPSBvdXRbKGkqMykgKyAyXTsKLSAgICAgICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgICAgICBwdm1wM19tZGN0XzYoJlNjcmF0Y2hfbWVtWyAwXSwgJnRtcF9wcmV2X292clsgMF0pOwotICAgICAgICAgICAgICAgIHB2bXAzX21kY3RfNigmU2NyYXRjaF9tZW1bIDZdLCAmdG1wX3ByZXZfb3ZyWyA2XSk7Ci0gICAgICAgICAgICAgICAgcHZtcDNfbWRjdF82KCZTY3JhdGNoX21lbVsxMl0sICZ0bXBfcHJldl9vdnJbMTJdKTsKLQotICAgICAgICAgICAgICAgIGZvciAoaSA9IDA7IGkgPCA2OyBpKyspCi0gICAgICAgICAgICAgICAgewotICAgICAgICAgICAgICAgICAgICBpbnQzMiB0ZW1wICA9ICBoaXN0b3J5W2ldOwotICAgICAgICAgICAgICAgICAgICAvKiBuZXh0IGl0ZXJhdGlvbiBvdmVybGFwICovCi0gICAgICAgICAgICAgICAgICAgIGhpc3RvcnlbaV0gID0gIGZ4cF9tdWwzMl9RMzIodG1wX3ByZXZfb3ZyWyA2K2ldIDw8IDEsIHNob3J0X3dpbls2K2ldKTsKLSAgICAgICAgICAgICAgICAgICAgaGlzdG9yeVtpXSArPSAgZnhwX211bDMyX1EzMihTY3JhdGNoX21lbVsxMitpXSA8PCAxLCBzaG9ydF93aW5bICBpXSk7Ci0gICAgICAgICAgICAgICAgICAgIG91dFtpXSAgPSAgdGVtcDsKLSAgICAgICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgICAgICBmb3IgKGkgPSAwOyBpIDwgNjsgaSsrKQotICAgICAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAgICAgb3V0W2krNl0gICA9ICBmeHBfbXVsMzJfUTMyKFNjcmF0Y2hfbWVtW2ldIDw8IDEsIHNob3J0X3dpbltpXSk7Ci0gICAgICAgICAgICAgICAgICAgIG91dFtpKzZdICArPSAgaGlzdG9yeVtpKzZdOwotICAgICAgICAgICAgICAgICAgICAvKiBuZXh0IGl0ZXJhdGlvbiBvdmVybGFwICovCi0gICAgICAgICAgICAgICAgICAgIGhpc3RvcnlbaSs2XSAgPSAgZnhwX211bDMyX1EzMih0bXBfcHJldl9vdnJbMTIraV0gPDwgMSwgc2hvcnRfd2luWzYraV0pOwotCi0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgIGZvciAoaSA9IDA7IGkgPCA2OyBpKyspCi0gICAgICAgICAgICAgICAgewotICAgICAgICAgICAgICAgICAgICBvdXRbaSsxMl0gID0gIGZ4cF9tdWwzMl9RMzIodG1wX3ByZXZfb3ZyWyAgaV0gPDwgMSwgc2hvcnRfd2luWzYraV0pOwotICAgICAgICAgICAgICAgICAgICBvdXRbaSsxMl0gKz0gIGZ4cF9tdWwzMl9RMzIoU2NyYXRjaF9tZW1bNitpXSA8PCAxLCBzaG9ydF93aW5bICBpXSk7Ci0gICAgICAgICAgICAgICAgICAgIG91dFtpKzEyXSArPSAgaGlzdG9yeVtpKzEyXTsKLSAgICAgICAgICAgICAgICAgICAgaGlzdG9yeVsxMitpXSAgPSAgMDsKLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgIGJyZWFrOwotICAgICAgICB9Ci0KLSAgICAgICAgLyoKLSAgICAgICAgICogICAgIENvbXBlbnNhdGlvbiBmb3IgZnJlcXVlbmN5IGludmVyc2lvbiBvZiBwb2x5cGhhc2UgZmlsdGVyYmFuawotICAgICAgICAgKiAgICAgZXZlcnkgb2RkIHRpbWUgc2FtcGxlIG9mIGV2ZXJ5IG9kZCBvZGQgc3ViYmFuZCBpcyBtdWxpdHBsaWVkIGJ5IC0xICBiZWZvcmUKLSAgICAgICAgICogICAgIHByb2Nlc3NpbmcgYnkgdGhlIHBvbHlwaGFzZSBmaWx0ZXIKLSAgICAgICAgICovCi0KLSAgICAgICAgaWYgKGJhbmQgJiAxKQotICAgICAgICB7Ci0gICAgICAgICAgICBmb3IgKGludDMyIHNsb3QgPSAxOyBzbG90IDwgRklMVEVSQkFOS19CQU5EUzsgc2xvdCArPSA2KQotICAgICAgICAgICAgewotICAgICAgICAgICAgICAgIGludDMyIHRlbXAxID0gb3V0W3Nsb3QgIF07Ci0gICAgICAgICAgICAgICAgaW50MzIgdGVtcDIgPSBvdXRbc2xvdCsyXTsKLSAgICAgICAgICAgICAgICBpbnQzMiB0ZW1wMyA9IG91dFtzbG90KzRdOwotICAgICAgICAgICAgICAgIG91dFtzbG90ICBdID0gLXRlbXAxOwotICAgICAgICAgICAgICAgIG91dFtzbG90KzJdID0gLXRlbXAyOwotICAgICAgICAgICAgICAgIG91dFtzbG90KzRdID0gLXRlbXAzOwotICAgICAgICAgICAgfQotICAgICAgICB9Ci0gICAgfQotCi0KLSAgICBmb3IgKGJhbmQgPSBiYW5kczJwcm9jZXNzOyBiYW5kIDwgU1VCQkFORFNfTlVNQkVSOyBiYW5kKyspCi0gICAgewotICAgICAgICBpbnQzMiAqIG91dCAgICAgPSBpbiAgICAgICsgKGJhbmQgKiBGSUxURVJCQU5LX0JBTkRTKTsKLSAgICAgICAgaW50MzIgKiBoaXN0b3J5ID0gb3ZlcmxhcCArIChiYW5kICogRklMVEVSQkFOS19CQU5EUyk7Ci0gICAgICAgIGludDMyIHNsb3Q7Ci0KLSAgICAgICAgaWYgKGJhbmQgJiAxKQotICAgICAgICB7Ci0gICAgICAgICAgICBmb3IgKHNsb3QgPSAwOyBzbG90IDwgRklMVEVSQkFOS19CQU5EUzsgc2xvdCArPSA2KQotICAgICAgICAgICAgewotICAgICAgICAgICAgICAgIGludDMyIHRlbXAxID0gIGhpc3Rvcnlbc2xvdCAgXTsKLSAgICAgICAgICAgICAgICBpbnQzMiB0ZW1wMiA9ICBoaXN0b3J5W3Nsb3QrMV07Ci0gICAgICAgICAgICAgICAgaW50MzIgdGVtcDMgPSAgaGlzdG9yeVtzbG90KzJdOwotICAgICAgICAgICAgICAgIG91dFtzbG90ICBdID0gIHRlbXAxOwotICAgICAgICAgICAgICAgIG91dFtzbG90KzFdID0gLXRlbXAyOwotICAgICAgICAgICAgICAgIG91dFtzbG90KzJdID0gIHRlbXAzOwotCi0gICAgICAgICAgICAgICAgdGVtcDEgPSAgaGlzdG9yeVtzbG90KzNdOwotICAgICAgICAgICAgICAgIHRlbXAyID0gIGhpc3Rvcnlbc2xvdCs0XTsKLSAgICAgICAgICAgICAgICB0ZW1wMyA9ICBoaXN0b3J5W3Nsb3QrNV07Ci0gICAgICAgICAgICAgICAgb3V0W3Nsb3QrM10gPSAtdGVtcDE7Ci0gICAgICAgICAgICAgICAgb3V0W3Nsb3QrNF0gPSAgdGVtcDI7Ci0gICAgICAgICAgICAgICAgb3V0W3Nsb3QrNV0gPSAtdGVtcDM7Ci0gICAgICAgICAgICB9Ci0gICAgICAgIH0KLSAgICAgICAgZWxzZQotICAgICAgICB7Ci0gICAgICAgICAgICBmb3IgKHNsb3QgPSAwOyBzbG90IDwgRklMVEVSQkFOS19CQU5EUzsgc2xvdCArPSAzKQotICAgICAgICAgICAgewotICAgICAgICAgICAgICAgIGludDMyIHRlbXAxID0gIGhpc3Rvcnlbc2xvdCAgXTsKLSAgICAgICAgICAgICAgICBpbnQzMiB0ZW1wMiA9ICBoaXN0b3J5W3Nsb3QrMV07Ci0gICAgICAgICAgICAgICAgaW50MzIgdGVtcDMgPSAgaGlzdG9yeVtzbG90KzJdOwotICAgICAgICAgICAgICAgIG91dFtzbG90ICBdID0gIHRlbXAxOwotICAgICAgICAgICAgICAgIG91dFtzbG90KzFdID0gIHRlbXAyOwotICAgICAgICAgICAgICAgIG91dFtzbG90KzJdID0gIHRlbXAzOwotICAgICAgICAgICAgfQotICAgICAgICB9Ci0KLSAgICAgICAgcHZfbWVtc2V0KGhpc3RvcnksIDAsIEZJTFRFUkJBTktfQkFORFMqc2l6ZW9mKCpvdmVybGFwKSk7Ci0gICAgfQotfQotCi0KLQotCmRpZmYgLS1naXQgYS9tZWRpYS9saWJzdGFnZWZyaWdodC9jb2RlY3MvbXAzZGVjL3NyYy9wdm1wM19pbWRjdF9zeW50aC5oIGIvbWVkaWEvbGlic3RhZ2VmcmlnaHQvY29kZWNzL21wM2RlYy9zcmMvcHZtcDNfaW1kY3Rfc3ludGguaApkZWxldGVkIGZpbGUgbW9kZSAxMDA2NDQKaW5kZXggZWE0MmU0OS4uMDAwMDAwMAotLS0gYS9tZWRpYS9saWJzdGFnZWZyaWdodC9jb2RlY3MvbXAzZGVjL3NyYy9wdm1wM19pbWRjdF9zeW50aC5oCisrKyAvZGV2L251bGwKQEAgLTEsMTAyICswLDAgQEAKLS8q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LS0tLS0tLS0tLS0tLS0tLS0tLS0tLQotOyBGVU5DVElPTiBDT0RFCi0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tKi8KLQotdm9pZCBwdm1wM19tcGVnMl9nZXRfc2NhbGVfZGF0YShtcDNTaWRlSW5mbyAqc2ksCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGludDMyICAgICAgICBnciwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaW50MzIgICAgICAgIGNoLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBtcDNIZWFkZXIgICAqaW5mbywKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdWludDMyICAgICAgKnNjYWxlZmFjX2J1ZmZlciwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdWludDMyICAgICAgKnNjYWxlZmFjX0lJUF9idWZmZXIsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRtcDNCaXRzICAgICpwTWFpbkRhdGEpCi17Ci0gICAgaW50MTYgaTsKLSAgICBpbnQxNiBqOwotICAgIGludDE2IGs7Ci0gICAgaW50MTYgYmxvY2t0eXBlbnVtYmVyID0gMDsKLSAgICBpbnQxNiBibG9ja251bWJlciA9IDA7Ci0KLSAgICBncmFudWxlSW5mbyAqZ3JfaW5mbyA9ICYoc2ktPmNoW2NoXS5ncmFuW2dyXSk7Ci0gICAgdWludDMyIHNjYWxlZmFjX2NvbXAsIGludF9zY2FsZWZhY19jb21wLCBuZXdfc2xlbls0XTsKLQotICAgIHNjYWxlZmFjX2NvbXAgPSAgZ3JfaW5mby0+c2NhbGVmYWNfY29tcHJlc3M7Ci0KLQotCi0gICAgaWYgKCgoKGluZm8tPm1vZGVfZXh0ICYxKSkgJiYgKGNoID09IDEpKSkKLSAgICB7Ci0gICAgICAgIC8qICAgaW50ZW5zaXR5X3NjYWxlID0gc2NhbGVmYWNfY29tcCAlMjsgKi8KLSAgICAgICAgaW50X3NjYWxlZmFjX2NvbXAgPSBzY2FsZWZhY19jb21wID4+IDE7Ci0KLSAgICAgICAgaWYgKGludF9zY2FsZWZhY19jb21wICA8IDE4MCkKLSAgICAgICAgewotICAgICAgICAgICAgbmV3X3NsZW5bMF0gPSBpbnRfc2NhbGVmYWNfY29tcCAgLyAzNjsKLSAgICAgICAgICAgIG5ld19zbGVuWzFdID0gKGludF9zY2FsZWZhY19jb21wICUgMzYpIC8gNjsKLSAgICAgICAgICAgIG5ld19zbGVuWzJdID0gaW50X3NjYWxlZmFjX2NvbXAgJSA2OwotICAgICAgICAgICAgYmxvY2tudW1iZXIgPSAzOwotICAgICAgICB9Ci0gICAgICAgIGVsc2UgaWYgKGludF9zY2FsZWZhY19jb21wICA8IDI0NCkKLSAgICAgICAgewotICAgICAgICAgICAgaW50X3NjYWxlZmFjX2NvbXAgLT0gMTgwOwotICAgICAgICAgICAgbmV3X3NsZW5bMF0gPSAoaW50X3NjYWxlZmFjX2NvbXAgJiA2MykgPj4gNDsKLSAgICAgICAgICAgIG5ld19zbGVuWzFdID0gKGludF9zY2FsZWZhY19jb21wICYgMTUpID4+IDI7Ci0gICAgICAgICAgICBuZXdfc2xlblsyXSA9ICBpbnRfc2NhbGVmYWNfY29tcCAmICAzOwotICAgICAgICAgICAgYmxvY2tudW1iZXIgPSA0OwotICAgICAgICB9Ci0gICAgICAgIGVsc2UgaWYgKGludF9zY2FsZWZhY19jb21wICA8PSAyNTUpCi0gICAgICAgIHsKLSAgICAgICAgICAgIGludF9zY2FsZWZhY19jb21wIC09IDI0NDsKLSAgICAgICAgICAgIG5ld19zbGVuWzBdID0gKGludF9zY2FsZWZhY19jb21wKSAvIDM7Ci0gICAgICAgICAgICBuZXdfc2xlblsxXSA9IChpbnRfc2NhbGVmYWNfY29tcCkgJSAzOwotICAgICAgICAgICAgbmV3X3NsZW5bMl0gPSAwOwotICAgICAgICAgICAgYmxvY2tudW1iZXIgPSA1OwotICAgICAgICB9Ci0gICAgICAgIG5ld19zbGVuWzNdID0gMDsKLSAgICAgICAgc2ktPmNoW2NoXS5ncmFuW2dyXS5wcmVmbGFnID0gMDsKLSAgICB9Ci0gICAgZWxzZQotICAgIHsKLSAgICAgICAgaWYgKHNjYWxlZmFjX2NvbXAgPCA0MDApCi0gICAgICAgIHsKLSAgICAgICAgICAgIG5ld19zbGVuWzBdID0gKHNjYWxlZmFjX2NvbXAgPj4gNCkgLyA1OwotICAgICAgICAgICAgbmV3X3NsZW5bMV0gPSAoc2NhbGVmYWNfY29tcCA+PiA0KSAlIDU7Ci0gICAgICAgICAgICBuZXdfc2xlblsyXSA9IChzY2FsZWZhY19jb21wICYgMTUpID4+IDIgOwotICAgICAgICAgICAgbmV3X3NsZW5bM10gPSAoc2NhbGVmYWNfY29tcCAmIDMpOwotICAgICAgICAgICAgc2ktPmNoW2NoXS5ncmFuW2dyXS5wcmVmbGFnID0gMDsKLQotICAgICAgICAgICAgYmxvY2tudW1iZXIgPSAwOwotICAgICAgICB9Ci0gICAgICAgIGVsc2UgaWYgKHNjYWxlZmFjX2NvbXAgIDwgNTAwKQotICAgICAgICB7Ci0gICAgICAgICAgICBzY2FsZWZhY19jb21wIC09IDQwMDsKLSAgICAgICAgICAgIG5ld19zbGVuWzBdID0gKHNjYWxlZmFjX2NvbXAgPj4gMikgLyA1OwotICAgICAgICAgICAgbmV3X3NsZW5bMV0gPSAoc2NhbGVmYWNfY29tcCA+PiAyKSAlIDU7Ci0gICAgICAgICAgICBuZXdfc2xlblsyXSA9IHNjYWxlZmFjX2NvbXAgICYgMzsKLSAgICAgICAgICAgIG5ld19zbGVuWzNdID0gMDsKLSAgICAgICAgICAgIHNpLT5jaFtjaF0uZ3Jhbltncl0ucHJlZmxhZyA9IDA7Ci0gICAgICAgICAgICBibG9ja251bWJlciA9IDE7Ci0gICAgICAgIH0KLSAgICAgICAgZWxzZSBpZiAoc2NhbGVmYWNfY29tcCAgPCA1MTIpCi0gICAgICAgIHsKLSAgICAgICAgICAgIHNjYWxlZmFjX2NvbXAgLT0gNTAwOwotICAgICAgICAgICAgbmV3X3NsZW5bMF0gPSBzY2FsZWZhY19jb21wIC8gMzsKLSAgICAgICAgICAgIG5ld19zbGVuWzFdID0gc2NhbGVmYWNfY29tcCAlIDM7Ci0gICAgICAgICAgICBuZXdfc2xlblsyXSA9IDAgOwotICAgICAgICAgICAgbmV3X3NsZW5bM10gPSAwOwotICAgICAgICAgICAgc2ktPmNoW2NoXS5ncmFuW2dyXS5wcmVmbGFnID0gMTsKLSAgICAgICAgICAgIGJsb2NrbnVtYmVyID0gMjsKLSAgICAgICAgfQotICAgIH0KLQotICAgIGlmIChncl9pbmZvLT5ibG9ja190eXBlID09IDIpCi0gICAgewotICAgICAgICBpZiAoZ3JfaW5mby0+bWl4ZWRfYmxvY2tfZmxhZykKLSAgICAgICAgewotICAgICAgICAgICAgYmxvY2t0eXBlbnVtYmVyID0gMjsKLSAgICAgICAgfQotICAgICAgICBlbHNlCi0gICAgICAgIHsKLSAgICAgICAgICAgIGJsb2NrdHlwZW51bWJlciA9IDE7Ci0gICAgICAgIH0KLSAgICB9Ci0KLSAgICBrID0gMDsKLSAgICBmb3IgKGkgPSAwOyBpIDwgNDsgaSsrKQotICAgIHsKLSAgICAgICAgaWYgKG5ld19zbGVuW2ldKQotICAgICAgICB7Ci0gICAgICAgICAgICBmb3IgKGogPSAwOyBqIDwgKGludDE2KW5yX29mX3NmYl9ibG9ja1tibG9ja251bWJlcl1bYmxvY2t0eXBlbnVtYmVyXVtpXTsgaisrKQotICAgICAgICAgICAgewotICAgICAgICAgICAgICAgIHNjYWxlZmFjX2J1ZmZlcltrXSA9ICBnZXROYml0cyhwTWFpbkRhdGEsIG5ld19zbGVuW2ldKTsKLSAgICAgICAgICAgICAgICBzY2FsZWZhY19JSVBfYnVmZmVyW2tdID0gKDFMIDw8IG5ld19zbGVuW2ldKSAtIDE7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oZXJlCi0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tKi8KLQotLyotLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tCi07IEZVTkNUSU9OIENPREUKLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0qLwotCi12b2lkIHB2bXAzX21wZWcyX2dldF9zY2FsZV9mYWN0b3JzKG1wM1NjYWxlRmFjdG9ycyAqc2NhbGVmYWMsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1wM1NpZGVJbmZvICAgICAqc2ksCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGludDMyICAgICAgICAgICBnciwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaW50MzIgICAgICAgICAgIGNoLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBtcDNIZWFkZXIgICAgICAgKmluZm8sCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHVpbnQzMiAgICAgICAgICAqc2NhbGVmYWNfSUlQX2J1ZmZlciwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdG1wM0JpdHMgICAgICAgICpwTWFpbkRhdGEpCi17Ci0KLSAgICBpbnQzMiBzZmI7Ci0gICAgaW50MzIgayA9IDA7Ci0gICAgaW50MzIgd2luZG93OwotICAgIHVpbnQzMiAqc2NhbGVmYWNfYnVmZmVyICAgICA9ICZzY2FsZWZhY19JSVBfYnVmZmVyWzU2XTsKLQotICAgIGdyYW51bGVJbmZvICpncl9pbmZvID0gJihzaS0+Y2hbY2hdLmdyYW5bZ3JdKTsKLQotICAgIHB2bXAzX21wZWcyX2dldF9zY2FsZV9kYXRhKHNpLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGdyLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNoLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGluZm8sCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKHVpbnQzMiAqKXNjYWxlZmFjX2J1ZmZlciwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAodWludDMyICopc2NhbGVmYWNfSUlQX2J1ZmZlciwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwTWFpbkRhdGEpOwotCi0KLSAgICBpZiAoZ3JfaW5mby0+d2luZG93X3N3aXRjaGluZ19mbGFnICYmIChncl9pbmZvLT5ibG9ja190eXBlID09IDIpKQotICAgIHsKLSAgICAgICAgaWYgKGdyX2luZm8tPm1peGVkX2Jsb2NrX2ZsYWcpCi0gICAgICAgIHsKLSAgICAgICAgICAgIGZvciAoc2ZiID0gMDsgc2ZiIDwgNjsgc2ZiKyspCi0gICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgc2NhbGVmYWMtPmxbc2ZiXSA9IHNjYWxlZmFjX2J1ZmZlcltzZmJdOwotICAgICAgICAgICAgfQotCi0KLSAgICAgICAgICAgIGsgPSA2OwotICAgICAgICAgICAgZm9yIChzZmIgPSAzOyBzZmIgPCAxMjsgc2ZiKyspCi0gICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgZm9yICh3aW5kb3cgPSAwOyB3aW5kb3cgPCAzOyB3aW5kb3crKykKLSAgICAgICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgICAgIHNjYWxlZmFjLT5zW3dpbmRvd11bc2ZiXSA9IHNjYWxlZmFjX2J1ZmZlcltrXTsKLSAgICAgICAgICAgICAgICAgICAgaysrOwotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgIH0KLQotCi0gICAgICAgICAgICAvKiBhZGp1c3QgcG9zaXRpb24gb2YgImlsbGVnYWwgcG9zaXRpb24iIGluZm9ybWF0aW9uIGluIHNjYWxlZmFjX0lJUF9idWZmZXJbXSAqLwotICAgICAgICAgICAgLyogaW4gbWl4ZWQgYmxvY2tzIG1vZGUgZm9yIHNob3J0IHNmYiwgbW92ZSB0aGVtIDMgcGxhY2VzIHVwLiBlZnMgMzAwMi0wNy0wNCAgKi8KLSAgICAgICAgICAgIGZvciAoc2ZiID0gMTE7IHNmYiA+PSAzOyBzZmItLSkKLSAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICBzY2FsZWZhY19JSVBfYnVmZmVyWzMqc2ZiICsgMl0gPSBzY2FsZWZhY19JSVBfYnVmZmVyWzMqc2ZiIC0gMV07Ci0gICAgICAgICAgICAgICAgc2NhbGVmYWNfSUlQX2J1ZmZlclszKnNmYiArIDFdID0gc2NhbGVmYWNfSUlQX2J1ZmZlclszKnNmYiAtIDJdOwotICAgICAgICAgICAgICAgIHNjYWxlZmFjX0lJUF9idWZmZXJbMypzZmIgICAgXSA9IHNjYWxlZmFjX0lJUF9idWZmZXJbMypzZmIgLSAzXTsKLQotICAgICAgICAgICAgfQotICAgICAgICB9Ci0gICAgICAgIGVsc2UKLSAgICAgICAgeyAgLyogU0hPUlQqLwotICAgICAgICAgICAgZm9yIChzZmIgPSAwOyBzZmIgPCAxMjsgc2ZiKyspCi0gICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgZm9yICh3aW5kb3cgPSAwOyB3aW5kb3cgPCAzOyB3aW5kb3crKykKLSAgICAgICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgICAgIHNjYWxlZmFjLT5zW3dpbmRvd11bc2ZiXSA9IHNjYWxlZmFjX2J1ZmZlcltrXTsKLSAgICAgICAgICAgICAgICAgICAgaysrOwotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgIH0KLSAgICAgICAgfQotCi0gICAgICAgIHNjYWxlZmFjLT5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gICAgICAgICAgICAgaW50MzIgaXNfcG9zLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpbnQzMiBTdGFydCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaW50MzIgTnVtYmVyKQotewotICAgIGludDMyIGtbMl07Ci0KLSAgICAvKiBwb3coaW8sICgoaXNfcG9zICsgMSk+PjEpKTsgaW8gPSAyKDEvNCkgKG09MCksIGlvID0gMigxLzgpIChtPTEpICovCi0gICAga1swXSA9IGlzX3Bvc19wb3dfZWl0Z2hfcm9vdF9vZl8yWygoaXNfcG9zKzEpJigzKyhtPDwyKSkpPDwoMS1tKV0gPj4gKChpc19wb3MgKyAxKSA+PiAoMiArIG0pKTsKLSAgICAvKiBwb3coaW8sIChpc19wb3M+PjEpKTsgaW8gPSAyKDEvNCkgKG09MCksIGlvID0gMigxLzgpIChtPTEpICAqLwotICAgIGtbMV0gPSBpc19wb3NfcG93X2VpdGdoX3Jvb3Rfb2ZfMlsoaXNfcG9zJigzKyhtPDwyKSkpPDwoMS1tKV0gPj4gKGlzX3BvcyA+PiAoMiArIG0pKTsKLQotCi0gICAgaW50MzIgKnB0X3hyICA9ICZ4cltTdGFydF07Ci0gICAgaW50MzIgKnB0X3hsICA9ICZ4bFtTdGFydF07Ci0KLSAgICBpZiAoaXNfcG9zID09IDApICAgIC8qIDAgPCBpc19wb3MgPCAzMSAqLwotICAgIHsKLSAgICAgICAgcHZfbWVtY3B5KHB0X3hsLCBwdF94ciwgTnVtYmVyKnNpemVvZigqcHRfeHIpKTsKLSAgICB9Ci0gICAgZWxzZSBpZiAoaXNfcG9zICYgMSkKLSAgICB7Ci0gICAgICAgIGZvciAoaW50MzIgaSA9IE51bWJlciA+PiAxOyBpICE9IDA7IGktLSkKLSAgICAgICAgewotICAgICAgICAgICAgKihwdF94bCsrKSA9ICgqcHRfeHIpOwotICAgICAgICAgICAgKihwdF94cikgPSBmeHBfbXVsMzJfUTMyKCgqcHRfeHIpIDw8IDEsIGtbMF0pOwotICAgICAgICAgICAgcHRfeHIrKzsKLSAgICAgICAgICAgICoocHRfeGwrKykgPSAoKnB0X3hyKTsKLSAgICAgICAgICAgICoocHRfeHIpID0gZnhwX211bDMyX1EzMigoKnB0X3hyKSA8PCAxLCBrWzBdKTsKLSAgICAgICAgICAgIHB0X3hyKys7Ci0gICAgICAgIH0KLSAgICAgICAgaWYgKE51bWJlciYxKQotICAgICAgICB7Ci0gICAgICAgICAgICAqKHB0X3hsKSA9ICgqcHRfeHIpOwotICAgICAgICAgICAgKihwdF94cikgPSBmeHBfbXVsMzJfUTMyKCgqcHRfeHIpIDw8IDEsIGtbMF0pOwotICAgICAgICB9Ci0gICAgfQotICAgIGVsc2UKLSAgICB7Ci0gICAgICAgIGZvciAoaW50MzIgaSA9IE51bWJlciA+PiAxOyBpICE9IDA7IGktLSkKLSAgICAgICAgewotICAgICAgICAgICAgKihwdF94bCsrKSA9IGZ4cF9tdWwzMl9RMzIoKCoocHRfeHIrKykpIDw8IDEsIGtbMV0pOwotICAgICAgICAgICAgKihwdF94bCsrKSA9IGZ4cF9tdWwzMl9RMzIoKCoocHRfeHIrKykpIDw8IDEsIGtbMV0pOwotICAgICAgICB9Ci0gICAgICAgIGlmIChOdW1iZXImMSkKLSAgICAgICAgewotICAgICAgICAgICAgKihwdF94bCkgPSBmeHBfbXVsMzJfUTMyKCgqcHRfeHIpIDw8IDEsIGtbMV0pOwotICAgICAgICB9Ci0gICAgfQotCi19Ci0KLQotCi0vKi0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0KLTsgRlVOQ1RJT04gQ09ERQotLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSovCi12b2lkIHB2bXAzX21wZWcyX3N0ZXJlb19wcm9jKGludDMyIHhyW1NVQkJBTkRTX05VTUJFUipGSUxURVJCQU5LX0JBTkRTXSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaW50MzIgeGxbU1VCQkFORFNfTlVNQkVSKkZJTFRFUkJBTktfQkFORFNdLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICBtcDNTY2FsZUZhY3RvcnMgKnNjYWxlZmFjX1IsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgIGdyYW51bGVJbmZvICpncl9pbmZvX2wsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgIGdyYW51bGVJbmZvICpncl9pbmZvX3IsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgIHVpbnQzMiAqc2NhbGVmYWNfSUlQX2J1ZmZlciwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaW50MzIgdXNlZF9mcmVxX2xpbmVzLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICBtcDNIZWFkZXIgKmluZm8pCi17Ci0KLSAgICBpbnQzMiBzZnJlcTsKLSAgICBpbnQzMiBzYjsKLSAgICBpbnQzMiBzczsKLSAgICBpbnQzMiBzZmJObzsKLSAgICBpbnQzMiBzZmJTdGFydDsKLSAgICBpbnQzMiBzZmI7Ci0gICAgaW50MzIgc2ZiVGVtcDsKLSAgICBpbnQzMiBpOwotICAgIGludDMyIGo7Ci0gICAgaW50MzIgaW87Ci0KLQotICAgIGludDMyIGlfc3RlcmVvICA9IChpbmZvLT5tb2RlID09IE1QR19NRF9KT0lOVF9TVEVSRU8pICYmCi0gICAgICAgICAgICAgICAgICAgICAgKGluZm8tPm1vZGVfZXh0ICYgMHgxKTsKLQotICAgIGludDMyIG1zX3N0ZXJlbyA9IChpbmZvLT5tb2RlID09IE1QR19NRF9KT0lOVF9TVEVSRU8pICYmCi0gICAgICAgICAgICAgICAgICAgICAgKGluZm8tPm1vZGVfZXh0ICYgMHgyKTsKLQotCi0gICAgaWYgKGlfc3RlcmVvKQotICAgIHsKLSAgICAgICAgaWYgKGdyX2luZm9fci0+c2NhbGVmYWNfY29tcHJlc3MgJiAxKQotICAgICAgICB7Ci0gICAgICAgICAgICBpbyA9IDA7ICAvKiAyXigtMS80KSAqLwotICAgICAgICB9Ci0gICAgICAgIGVsc2UKLSAgICAgICAgewotICAgICAgICAgICAgaW8gPSAxOyAgLyogMl4oLTEvOCkgKi8KLSAgICAgICAgfQotCi0gICAgICAgIHNmcmVxID0gIGluZm8tPnZlcnNpb25feCArIChpbmZvLT52ZXJzaW9uX3ggPDwgMSk7Ci0gICAgICAgIHNmcmVxICs9IGluZm8tPnNhbXBsaW5nX2ZyZXF1ZW5jeTsKLQotICAgICAgICBpZiAoZ3JfaW5mb19sLT53aW5kb3dfc3dpdGNoaW5nX2ZsYWcgJiYgKGdyX2luZm9fbC0+YmxvY2tfdHlwZSA9PSAyKSkKLSAgICAgICAgewotICAgICAgICAgICAgaWYgKGdyX2luZm9fbC0+bWl4ZWRfYmxvY2tfZmxhZykKLSAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAvKgotICAgICAgICAgICAgICAgICAqIG1peGVkIGJsb2NrcyBwcm9jZXNzaW5nCi0gICAgICAgICAgICAgICAgICovCi0gICAgICAgICAgICAgICAgaSA9IDMxOwotICAgICAgICAgICAgICAgIHNzID0gMTc7Ci0gICAgICAgICAgICAgICAgc2IgPSAtMTsKLQotICAgICAgICAgICAgICAgIHdoaWxlIChpID49IDApCi0gICAgICAgICAgICAgICAgewotICAgICAgICAgICAgICAgICAgICBpZiAoeGxbKGkqRklMVEVSQkFOS19CQU5EUykgKyBzc10pCi0gICAgICAgICAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAgICAgICAgIHNiID0gKGkgPDwgNCkgKyAoaSA8PCAxKSArIHNzOwotICAgICAgICAgICAgICAgICAgICAgICAgaSA9IC0xOwotICAgICAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgICAgIGVsc2UKLSAgICAgICAgICAgICAgICAgICAgewotICAgICAgICAgICAgICAgICAgICAgICAgc3MtLTsKLSAgICAgICAgICAgICAgICAgICAgICAgIGlmIChzcyA8IDApCi0gICAgICAgICAgICAgICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgaS0tOwotICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNzID0gMTc7Ci0gICAgICAgICAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICB9ICAgLyogbm93IHNiIGlzIHRoZSBudW1iZXIgb2YgaGlnaGVzdCBsaW5lIHdpdGggdmFsdWUgIT0gMCAgICAgICovCi0gICAgICAgICAgICAgICAgLyogY2FuIGJlIGJldHdlZW4gLTEgKGFsbCBsaW5lcyB6ZXJvKSBhbmQgNTc1IChubyBsaW5lIHplcm8pICovCi0KLSAgICAgICAgICAgICAgICBpZiAoc2IgPCAzNikgICAgLyogIHdhcyAoc2IgPD0gMzYpICAqLwotICAgICAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAgICAgLyoKLSAgICAgICAgICAgICAgICAgICAgICogIG1peGVkIGJsb2NrcyBwcm9jZXNzaW5nOiBpbnRlbnNpdHkgYm91bmQgaW5zaWRlIGxvbmcgYmxvY2tzCi0gICAgICAgICAgICAgICAgICAgICAqLwotICAgICAgICAgICAgICAgICAgICAvKiAxLiBsb25nIGJsb2NrcyB1cCB0byBpbnRlbnNpdHkgYm9yZGVyOiBTdGVyZW8gb3IgTS9TICovCi0gICAgICAgICAgICAgICAgICAgIGlmIChtcDNfc2ZCYW5kSW5kZXhbc2ZyZXFdLmxbNF0gPD0gc2IpCi0gICAgICAgICAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAgICAgICAgIGkgPSA0OwotICAgICAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgICAgIGVsc2UKLSAgICAgICAgICAgICAgICAgICAgewotICAgICAgICAgICAgICAgICAgICAgICAgaSA9IDA7Ci0gICAgICAgICAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgICAgICAgICB3aGlsZSAobXAzX3NmQmFuZEluZGV4W3NmcmVxXS5sW2ldIDw9IHNiKQotICAgICAgICAgICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgICAgICAgICBpKys7Ci0gICAgICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICAgICAgc2ZiVGVtcCA9IGk7ICAvKiBmcm9tIHRoYXQgKGxvbmcpIHNmYiBvbiB3ZSBoYXZlIGludGVuc2l0eSBzdGVyZW8gKi8KLQotICAgICAgICAgICAgICAgICAgICBzZmJObyA9IG1wM19zZkJhbmRJbmRleFtzZnJlcV0ubFtzZmJUZW1wXTsgLyogbnVtYmVyIG9mIGxpbmVzIHRvIHByb2Nlc3MgKi8KLQotICAgICAgICAgICAgICAgICAgICAvKiBmcm9tIHNmYlN0YXJ0IHVwIHNmYk5vIGxpbmVzIGRvIG1zX3N0ZXJlbyBvciBub3JtYWwgc3RlcmVvICovCi0gICAgICAgICAgICAgICAgICAgIGlmIChtc19zdGVyZW8pCi0gICAgICAgICAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAgICAgICAgIHB2bXAzX3N0X21pZF9zaWRlKHhyLCB4bCwgMCwgc2ZiTm8pOwotICAgICAgICAgICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgICAgICAgICAgLyogMi4gbG9uZyBibG9ja3MgZnJvbSBpbnRlbnNpdHkgYm9yZGVyIHVwIHRvIHNmYiBiYW5kIDY6IGludGVuc2l0eSAqLwotICAgICAgICAgICAgICAgICAgICAvKiBjYWxjLiBNUEVHXzFfMl9GYWN0b3JbMF0sIE1QRUdfMV8yX0ZhY3RvclsxXSAqLwotCi0gICAgICAgICAgICAgICAgICAgIGZvciAoc2ZiID0gc2ZiVGVtcDsgc2ZiIDwgNjsgc2ZiKyspCi0gICAgICAgICAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAgICAgICAgIHNmYlN0YXJ0ID0gbXAzX3NmQmFuZEluZGV4W3NmcmVxXS5sW3NmYl07ICAvKiA9IFN0YXJ0IGluIDAgLi4uIDU3NSAqLwotICAgICAgICAgICAgICAgICAgICAgICAgc2ZiTm8gPSBtcDNfc2ZCYW5kSW5kZXhbc2ZyZXFdLmxbc2ZiKzFdIC0gbXAzX3NmQmFuZEluZGV4W3NmcmVxXS5sW3NmYl07IC8qIE5vIG9mIGxpbmVzIHRvIHByb2Nlc3MgKi8KLQotICAgICAgICAgICAgICAgICAgICAgICAgaWYgKCh1aW50MzIpKHNjYWxlZmFjX1ItPmxbc2ZiXSkgIT0gc2NhbGVmYWNfSUlQX2J1ZmZlcltzZmJdKQotICAgICAgICAgICAgICAgICAgICAgICAgewotICAgICAgICAgICAgICAgICAgICAgICAgICAgIHB2bXAzX3N0X2ludGVuc2l0eV92ZXIyKHhyLCB4bCwgaW8sIHNjYWxlZmFjX1ItPmxbc2ZiXSwgc2ZiU3RhcnQsIHNmYk5vKTsKLSAgICAgICAgICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICAgICAgICAgIGVsc2UgaWYgKG1zX3N0ZXJlbykKLSAgICAgICAgICAgICAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBwdm1wM19zdF9taWRfc2lkZSh4ciwgeGwsIHNmYlN0YXJ0LCBzZmJObyk7Ci0gICAgICAgICAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgICAgICAgICAvKiAzLiBub3cgcHJvY2VzcyBhbGwgc2ZiIHdpdGggc2hvcnQgYmxvY2tzICgzLi4uMTIpLCBhbGwgaW4gaW50ZW5zaXR5IG1vZGUgKi8KLQotICAgICAgICAgICAgICAgICAgICBmb3IgKGogPSAwOyBqIDwgMzsgaisrKQotICAgICAgICAgICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgICAgICAgICAvKiAgIGZpcnN0IGNhbGN1bGF0ZSBkaXJlY3Rpb25hbCBmYWN0b3JzIGZvciBpbnRlbnNpdHkgc3RlcmVvLAotICAgICAgICAgICAgICAgICAgICAgICAgICogICBmb3IgYWxsIHNmYiBpbiBpbnRlbnNpdHkgbW9kZSwgYnV0IG9ubHkKLSAgICAgICAgICAgICAgICAgICAgICAgICAqICAgaWYgdGhleSBkbyBub3QgaGF2ZSAiaWxsZWdhbCIgcG9zaXRpb246Ci0gICAgICAgICAgICAgICAgICAgICAgICAgKi8KLSAgICAgICAgICAgICAgICAgICAgICAgIC8qIHRvIGRvIHRoaXMgZm9yIGFsbCBzZmIgd2UgaGF2ZSB0byBnZXQgaW5mb3JtYXRpb24gZm9yIGxhc3Qgc2NhbGUgZmFjdG9yIGJhbmQ6Ci0gICAgICAgICAgICAgICAgICAgICAgICAgKiBoZXJlIHdlIGNsZWFybHkgaGF2ZSBtb3JlIHRoYW4gb25lIHNmYiBpbiBpbnRlbnNpdHkgbW9kZSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAqICBzbyBjb3B5IGZhY3RvcnMgYW5kIGxlZ2FsL2lsbGVnYWwgaW5mb3JtYXRpb24gZnJvbSBzZmIxMSB0byBzZmIxMgotICAgICAgICAgICAgICAgICAgICAgICAgICovCi0gICAgICAgICAgICAgICAgICAgICAgICAoc2NhbGVmYWNfUi0+c1tqXVsxMl0pID0gKHNjYWxlZmFjX1ItPnNbal1bMTFdKTsKLSAgICAgICAgICAgICAgICAgICAgICAgIHNjYWxlZmFjX0lJUF9idWZmZXJbMzYgKyBqXSA9IHNjYWxlZmFjX0lJUF9idWZmZXJbMzMgKyBqXTsgIC8qIGxlZ2FsL2lsbGVnYWwgaW4gc2ZiIDEyIHNhbWUgYXMgaW4gc2ZiIDExICovCi0KLSAgICAgICAgICAgICAgICAgICAgICAgIGZvciAoc2ZiID0gMzsgc2ZiIDwgMTM7IHNmYisrKQotICAgICAgICAgICAgICAgICAgICAgICAgewotICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNmYk5vID0gbXAzX3NmQmFuZEluZGV4W3NmcmVxXS5zW3NmYisxXSAtIG1wM19zZkJhbmRJbmRleFtzZnJlcV0uc1tzZmJdOyAvKiBObyBvZiBsaW5lcyB0byBwcm9jZXNzICovCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgc2ZiU3RhcnQgPSAzICogbXAzX3NmQmFuZEluZGV4W3NmcmVxXS5zW3NmYl0gKyBqICogc2ZiTm87Ci0KLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoKHVpbnQzMikoc2NhbGVmYWNfUi0+c1tqXVtzZmJdKSAhPSBzY2FsZWZhY19JSVBfYnVmZmVyWzMqc2ZiICsgal0pCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgewotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwdm1wM19zdF9pbnRlbnNpdHlfdmVyMih4ciwgeGwsIGlvLCBzY2FsZWZhY19SLT5zW2pdW3NmYl0sIHNmYlN0YXJ0LCBzZmJObyk7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgICAgICAgICAgICAgIGVsc2UgaWYgKG1zX3N0ZXJlbykKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHB2bXAzX3N0X21pZF9zaWRlKHhyLCB4bCwgc2ZiU3RhcnQsIHNmYk5vKTsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgICAgIH0gLyogZm9yIChqID0gMDsgaiA8IDM7IGorKykgKi8KLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgZWxzZSAgLyogIGVsc2UgdGhlbiAoc2IgPj0gMzYpICAqLwotICAgICAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAgICAgLyoKLSAgICAgICAgICAgICAgICAgICAgICogICBtaXhlZCBibG9ja3MgcHJvY2Vzc2luZzogaW50ZW5zaXR5IGJvdW5kIG91dHNpZGUgbG9uZyBibG9ja3MKLSAgICAgICAgICAgICAgICAgICAgICovCi0KLSAgICAgICAgICAgICAgICAgICAgLyogMi4gc2hvcnQgYmxvY2tzLCBkbyBmb3IgYWxsIDMgICovCi0gICAgICAgICAgICAgICAgICAgIC8qIC0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSAqLwotICAgICAgICAgICAgICAgICAgICBmb3IgKGogPSAwOyBqIDwgMzsgaisrKQotICAgICAgICAgICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgICAgICAgICBpbnQzMiBzZmJjbnQgPSAtMTsKLQotICAgICAgICAgICAgICAgICAgICAgICAgZm9yIChzZmIgPSAxMjsgc2ZiID49IDM7IHNmYi0tKQotICAgICAgICAgICAgICAgICAgICAgICAgewotICAgICAgICAgICAgICAgICAgICAgICAgICAgIGludDMyIGxpbmVzID0gbXAzX3NmQmFuZEluZGV4W3NmcmVxXS5zW3NmYisxXSAtIG1wM19zZkJhbmRJbmRleFtzZnJlcV0uc1tzZmJdOwotCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgaSA9IDMgKiBtcDNfc2ZCYW5kSW5kZXhbc2ZyZXFdLnNbc2ZiXSArIChqICsgMSkgKiBsaW5lcyAtIDE7Ci0KLSAgICAgICAgICAgICAgICAgICAgICAgICAgICB3aGlsZSAobGluZXMgPiAwKQotICAgICAgICAgICAgICAgICAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHhsW2ldKQotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzZmJjbnQgPSBzZmI7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzZmIgPSAtMTA7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBsaW5lcyA9IC0xMDsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBsaW5lcy0tOwotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpLS07Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgICAgICAgICAgfQotCi0gICAgICAgICAgICAgICAgICAgICAgICBzZmJjbnQgKz0gMTsKLSAgICAgICAgICAgICAgICAgICAgICAgIGlmIChzZmJjbnQgPCAzKQotICAgICAgICAgICAgICAgICAgICAgICAgewotICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNmYmNudCA9IDM7ICAgLyogc2hvdWxkIG5vdCBiZSBuZWNlc3NhcnkgKi8KLSAgICAgICAgICAgICAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgICAgICAgICAgICAgc2ZiVGVtcCA9IHNmYmNudDsgLyogZnJvbSB0aGlzIChzaG9ydCkgc2ZiIG9uIHdlIGhhdmUgaW50ZW5zaXR5IG1vZGUgICAgICAgICovCi0gICAgICAgICAgICAgICAgICAgICAgICAvKiBjYW4gaGF2ZSB2YWx1ZXMgYmV0d2VlbiAzIChhbGwgc2hvcnQgc2ZiIGluIGludGVuc2l0eSkgKi8KLSAgICAgICAgICAgICAgICAgICAgICAgIC8qIGFuZCAxMyAobm8gc2hvcnQgc2ZiIGluIGludGVuc2l0eSBtb2RlKSAgICAgICAgICAgICAgICAqLwotCi0gICAgICAgICAgICAgICAgICAgICAgICAvKiAzLiBmcm9tIHNmYlRlbXAgdG8gbGFzdCBzZmIgY2FsY3VsYXRlIGlzX3JhdGlvIHZhbHVlczogICAgKi8KLSAgICAgICAgICAgICAgICAgICAgICAgIC8qIGZpcnN0IGNhbGN1bGF0ZSBkaXJlY3Rpb25hbCBmYWN0b3JzIGZvciBpbnRlbnNpdHkgc3RlcmVvLCAqLwotICAgICAgICAgICAgICAgICAgICAgICAgLyogZm9yIGFsbCBzZmIgaW4gaW50ZW5zaXR5IG1vZGUsIGJ1dCBvbmx5ICAgICAgICAgICAgICAgICAgICovCi0gICAgICAgICAgICAgICAgICAgICAgICAvKiBpZiB0aGV5IGRvIG5vdCBoYXZlICJpbGxlZ2FsIiBwb3NpdGlvbjogICAgICAgICAgICAgICAgICAgKi8KLQotICAgICAgICAgICAgICAgICAgICAgICAgLyogdG8gZG8gdGhpcyBmb3IgYWxsIHNmYiB3ZSBoYXZlIHRvIGdldCBpbmZvcm1hdGlvbiBmb3IgbGFzdCBzY2FsZSBmYWN0b3IgYmFuZDogKi8KLSAgICAgICAgICAgICAgICAgICAgICAgIC8qICBnZXQgZmFjdG9ycyBmb3IgbGFzdCBzY2FsZSBmYWN0b3IgYmFuZDogKi8KLSAgICAgICAgICAgICAgICAgICAgICAgIC8qIG1vcmUgdGhhbiBvbmUgc2ZiIGluIGludGVuc2l0eSBtb2RlLAotICAgICAgICAgICAgICAgICAgICAgICAgY29weSBmYWN0b3JzIGFuZCBsZWdhbC9pbGxlZ2FsIGluZm9ybWF0aW9uIGZyb20gc2ZiMTEgdG8gc2ZiMTIgKi8KLSAgICAgICAgICAgICAgICAgICAgICAgIGlmIChzZmJUZW1wIDwgMTIpCi0gICAgICAgICAgICAgICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgKHNjYWxlZmFjX1ItPnNbal1bMTJdKSA9IChzY2FsZWZhY19SLT5zW2pdWzExXSk7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgc2NhbGVmYWNfSUlQX2J1ZmZlclszNiArIGpdID0gc2NhbGVmYWNfSUlQX2J1ZmZlclszMyArIGpdOyAgIC8qIGxlZ2FsL2lsbGVnYWwgaW4gc2ZiIDEyIHNhbWUgYXMgaW4gc2ZiIDExICovCi0gICAgICAgICAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgICAgICAgICBlbHNlIGlmIChzZmJUZW1wID09IHNmYikKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAvKiBvbmx5IHNmYiAxMiBpbiBpbnRlbnNpdHkgbW9kZSwgdXNlIGZhY3RvcnMgY29ycmVzcG9uZGluZyB0byBpc19wb3NbMTJdID09IDAgKi8KLSAgICAgICAgICAgICAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAoc2NhbGVmYWNfUi0+c1tqXVsxMl0pID0gMDsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBzY2FsZWZhY19JSVBfYnVmZmVyWzM2ICsgal0gPSAxOyAgICAvKiB0aGUgc2NmIHZhbHVlIDAgaW4gc2ZiMTIgaXMgImxlZ2FsIiAqLwotICAgICAgICAgICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgICAgICAgICAgLyogaWYgc2ZiVGVtcCA+IHNmYiAobm8gc2ZiIGluIGludGVuc2l0eSBtb2RlKTogZG8gbm90aGluZyAqLwotCi0KLSAgICAgICAgICAgICAgICAgICAgICAgIC8qIDQuIGRvIG5vcm1hbCBzdGVyZW8gb3IgTVMgc3RlcmVvIGZyb20gc2ZiIDMgdG8gPCBzZmJUZW1wOiAqLwotICAgICAgICAgICAgICAgICAgICAgICAgZm9yIChzZmIgPSAzOyBzZmIgPCBzZmJUZW1wOyBzZmIrKykKLSAgICAgICAgICAgICAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBzZmJObyA9IG1wM19zZkJhbmRJbmRleFtzZnJlcV0uc1tzZmIrMV0gLSBtcDNfc2ZCYW5kSW5kZXhbc2ZyZXFdLnNbc2ZiXTsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBzZmJTdGFydCA9IDMgKiBtcDNfc2ZCYW5kSW5kZXhbc2ZyZXFdLnNbc2ZiXSArIGogKiBzZmJObzsKLQotICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChtc19zdGVyZW8pCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgewotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwdm1wM19zdF9taWRfc2lkZSh4ciwgeGwsIHNmYlN0YXJ0LCBzZmJObyk7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgICAgICAgICAgfQotCi0gICAgICAgICAgICAgICAgICAgICAgICAvKiA1LiBub3cgaW50ZW5zaXR5IHN0ZXJlbyBwcm9jZXNzaW5nIG9mIHRoZSByZW1haW5pbmcgc2ZiJ3M6ICovCi0KLSAgICAgICAgICAgICAgICAgICAgICAgIGZvciAoc2ZiID0gc2ZiVGVtcDsgc2ZiIDwgMTM7IHNmYisrKQotICAgICAgICAgICAgICAgICAgICAgICAgewotICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNmYk5vID0gbXAzX3NmQmFuZEluZGV4W3NmcmVxXS5zW3NmYisxXSAtIG1wM19zZkJhbmRJbmRleFtzZnJlcV0uc1tzZmJdOyAvKiBObyBvZiBsaW5lcyB0byBwcm9jZXNzICovCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgc2ZiU3RhcnQgPSAzICogbXAzX3NmQmFuZEluZGV4W3NmcmVxXS5zW3NmYl0gKyBqICogc2ZiTm87Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKCh1aW50MzIpKHNjYWxlZmFjX1ItPnNbal1bc2ZiXSkgIT0gc2NhbGVmYWNfSUlQX2J1ZmZlclszKnNmYiArIGpdKQotICAgICAgICAgICAgICAgICAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcHZtcDNfc3RfaW50ZW5zaXR5X3ZlcjIoeHIsIHhsLCBpbywgc2NhbGVmYWNfUi0+c1tqXVtzZmJdLCBzZmJTdGFydCwgc2ZiTm8pOwotICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBlbHNlIGlmIChtc19zdGVyZW8pCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgewotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwdm1wM19zdF9taWRfc2lkZSh4ciwgeGwsIHNmYlN0YXJ0LCBzZmJObyk7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgICAgICAgICAgLyogIGVuZCBvZiBjb3JyZWN0aW9uIGJ5IGVmcyAyMDAzLTA3LTA0ICovCi0gICAgICAgICAgICAgICAgICAgIH0gLyogZm9yIChqID0gMDsgaiA8IDM7IGorKykgKi8KLQotCi0gICAgICAgICAgICAgICAgICAgIC8qIGxvbmcgYmxvY2tzIDAgdXAgdG8gc2ZiIGJhbmQgNjogbm8gaW50ZW5zaXR5ICovCi0KLSAgICAgICAgICAgICAgICAgICAgc2ZiTm8gPSBtcDNfc2ZCYW5kSW5kZXhbc2ZyZXFdLmxbNl07ICAgICAgICAvKiBudW1iZXIgb2YgbGluZXMgdG8gcHJvY2VzcyAqLwotICAgICAgICAgICAgICAgICAgICBpZiAobXNfc3RlcmVvKQotICAgICAgICAgICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgICAgICAgICBwdm1wM19zdF9taWRfc2lkZSh4ciwgeGwsIDAsIHNmYk5vKTsKLSAgICAgICAgICAgICAgICAgICAgfQotCi0gICAgICAgICAgICAgICAgfSAgLyogaWYgaW50ZW5zaXR5IGJvdW5kIGluc2lkZSBvciBvdXRzaWRlIGxvbmcgYmxvY2tzICovCi0gICAgICAgICAgICB9ICAvKiBpZiAoZ3JfaW5mby0+bWl4ZWRfYmxvY2tfZmxhZykgKi8KLSAgICAgICAgICAgIGVsc2UKLSAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAvKgotICAgICAgICAgICAgICAgICAqICBzaG9ydCBibG9jayBwcm9jZXNzaW5nCi0gICAgICAgICAgICAgICAgICovCi0gICAgICAgICAgICAgICAgZm9yIChqID0gMDsgaiA8IDM7IGorKykKLSAgICAgICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgICAgIGludDMyIHNmYmNudCA9IC0xOwotCi0gICAgICAgICAgICAgICAgICAgIGZvciAoc2ZiID0gMTI7IHNmYiA+PSAwOyBzZmItLSkKLSAgICAgICAgICAgICAgICAgICAgewotICAgICAgICAgICAgICAgICAgICAgICAgaW50MzIgbGluZXMgPSBtcDNfc2ZCYW5kSW5kZXhbc2ZyZXFdLnNbc2ZiKzFdIC0gbXAzX3NmQmFuZEluZGV4W3NmcmVxXS5zW3NmYl07Ci0gICAgICAgICAgICAgICAgICAgICAgICBpID0gMyAqIG1wM19zZkJhbmRJbmRleFtzZnJlcV0uc1tzZmJdICsgKGogKyAxKSAqIGxpbmVzIC0gMTsKLQotICAgICAgICAgICAgICAgICAgICAgICAgd2hpbGUgKGxpbmVzID4gMCkKLSAgICAgICAgICAgICAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoeGxbaV0pCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgewotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzZmJjbnQgPSBzZmI7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNmYiA9IC0xMDsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbGluZXMgPSAtMTA7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxpbmVzLS07Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgaS0tOwotICAgICAgICAgICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgICAgICAgICAgc2ZiY250ICs9IDE7Ci0KLSAgICAgICAgICAgICAgICAgICAgLyogIHN0YXJ0IG9mIGNvcnJlY3RlZCB2ZXJzaW9uIGJ5IGVmcyAyMDAzLTA3LTA0ICAqLwotICAgICAgICAgICAgICAgICAgICBzZmJUZW1wID0gc2ZiY250OyAvKiBmcm9tIHRoaXMgKHNob3J0KSBzZmIgb24gd2UgaGF2ZSBpbnRlbnNpdHkgbW9kZSAgICAgICAgKi8KLSAgICAgICAgICAgICAgICAgICAgLyogY2FuIGhhdmUgdmFsdWVzIGJldHdlZW4gMyAoYWxsIHNob3J0IHNmYiBpbiBpbnRlbnNpdHkpICovCi0gICAgICAgICAgICAgICAgICAgIC8qIGFuZCAxMyAobm8gc2hvcnQgc2ZiIGluIGludGVuc2l0eSBtb2RlKSAgICAgICAgICAgICAgICAqLwotCi0gICAgICAgICAgICAgICAgICAgIC8qIGZpcnN0IGNhbGN1bGF0ZSBkaXJlY3Rpb25hbCBmYWN0b3JzIGZvciBpbnRlbnNpdHkgc3RlcmVvLAotICAgICAgICAgICAgICAgICAgICBmb3IgYWxsIHNmYiBpbiBpbnRlbnNpdHkgbW9kZSwgYnV0IG9ubHkKLSAgICAgICAgICAgICAgICAgICAgaWYgdGhleSBkbyBub3QgaGF2ZSAiaWxsZWdhbCIgcG9zaXRpb246ICovCi0KLSAgICAgICAgICAgICAgICAgICAgLyogdG8gZG8gdGhpcyBmb3IgYWxsIHNmYiB3ZSBoYXZlIHRvIGdldCBpbmZvcm1hdGlvbiBmb3IgbGFzdCBzY2FsZSBmYWN0b3IgYmFuZDogKi8KLSAgICAgICAgICAgICAgICAgICAgLyogZ2V0IGZhY3RvcnMgZm9yIGxhc3Qgc2NhbGUgZmFjdG9yIGJhbmQ6ICovCi0gICAgICAgICAgICAgICAgICAgIC8qIG1vcmUgdGhhbiBvbmUgc2ZiIGluIGludGVuc2l0eSBtb2RlLAotICAgICAgICAgICAgICAgICAgICBjb3B5IGZhY3RvcnMgYW5kIGxlZ2FsL2lsbGVnYWwgaW5mb3JtYXRpb24gZnJvbSBzZmIxMSB0byBzZmIxMiAqLwotICAgICAgICAgICAgICAgICAgICBpZiAoc2ZiVGVtcCA8IDEyKQotICAgICAgICAgICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgICAgICAgICAoc2NhbGVmYWNfUi0+c1tqXVsxMl0pID0gKHNjYWxlZmFjX1ItPnNbal1bMTFdKTsKLSAgICAgICAgICAgICAgICAgICAgICAgIHNjYWxlZmFjX0lJUF9idWZmZXJbMzYgKyBqXSA9IHNjYWxlZmFjX0lJUF9idWZmZXJbMzMgKyBqXTsgIC8qIGxlZ2FsL2lsbGVnYWwgaW4gc2ZiIDEyIHNhbWUgYXMgaW4gc2ZiIDExICovCi0gICAgICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICAgICAgZWxzZSBpZiAoc2ZiVGVtcCA9PSAxMikKLSAgICAgICAgICAgICAgICAgICAgICAgIC8qIG9ubHkgc2ZiIDEyIGluIGludGVuc2l0eSBtb2RlLCB1c2UgZmFjdG9ycyBjb3JyZXNwb25kaW5nIHRvIGlzX3Bvc1sxMl0gPT0gMCAqLwotICAgICAgICAgICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgICAgICAgICAoc2NhbGVmYWNfUi0+c1tqXVsxMl0pID0gMDsKLSAgICAgICAgICAgICAgICAgICAgICAgIHNjYWxlZmFjX0lJUF9idWZmZXJbMzYgKyBqXSA9IDE7ICAgIC8qIHRoZSBzY2YgdmFsdWUgMCBpbiBzZmIxMiBpcyAibGVnYWwiICovCi0gICAgICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICAgICAgLyogaWYgc2ZiVGVtcCA+IHNmYiAobm8gc2ZiIGluIGludGVuc2l0eSBtb2RlKTogZG8gbm90aGluZyAqLwotCi0KLSAgICAgICAgICAgICAgICAgICAgLyogTm93IHByb2Nlc3MgYXVkaW8gc2FtcGxlcyAqLwotICAgICAgICAgICAgICAgICAgICAvKiBmaXJzdCBwcm9jZXNzIGxvd2VyIHNmYidzIG5vdCBpbiBpbnRlbnNpdHkgbW9kZSAqLwotICAgICAgICAgICAgICAgICAgICBmb3IgKHNmYiA9IDA7IHNmYiA8IHNmYlRlbXA7IHNmYisrKQotICAgICAgICAgICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgICAgICAgICBzZmJObyA9IG1wM19zZkJhbmRJbmRleFtzZnJlcV0uc1tzZmIrMV0gLSBtcDNfc2ZCYW5kSW5kZXhbc2ZyZXFdLnNbc2ZiXTsKLSAgICAgICAgICAgICAgICAgICAgICAgIHNmYlN0YXJ0ID0gMyAqIG1wM19zZkJhbmRJbmRleFtzZnJlcV0uc1tzZmJdICsgaiAqIHNmYk5vOwotCi0gICAgICAgICAgICAgICAgICAgICAgICBpZiAobXNfc3RlcmVvKQotICAgICAgICAgICAgICAgICAgICAgICAgewotICAgICAgICAgICAgICAgICAgICAgICAgICAgIHB2bXAzX3N0X21pZF9zaWRlKHhyLCB4bCwgc2ZiU3RhcnQsIHNmYk5vKTsKLSAgICAgICAgICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICAgICAgfQotCi0gICAgICAgICAgICAgICAgICAgIC8qIG5vdyBpbnRlbnNpdHkgc3RlcmVvIHByb2Nlc3Npbmcgb2YgdGhlIHJlbWFpbmluZyBzZmInczogKi8KLSAgICAgICAgICAgICAgICAgICAgZm9yIChzZmIgPSBzZmJUZW1wOyBzZmIgPCAxMzsgc2ZiKyspCi0gICAgICAgICAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAgICAgICAgIHNmYk5vID0gbXAzX3NmQmFuZEluZGV4W3NmcmVxXS5zW3NmYisxXSAtIG1wM19zZkJhbmRJbmRleFtzZnJlcV0uc1tzZmJdOyAvKiBObyBvZiBsaW5lcyB0byBwcm9jZXNzICovCi0gICAgICAgICAgICAgICAgICAgICAgICBzZmJTdGFydCA9IDMgKiBtcDNfc2ZCYW5kSW5kZXhbc2ZyZXFdLnNbc2ZiXSArIGogKiBzZmJObzsKLQotICAgICAgICAgICAgICAgICAgICAgICAgaWYgKCh1aW50MzIpKHNjYWxlZmFjX1ItPnNbal1bc2ZiXSkgIT0gc2NhbGVmYWNfSUlQX2J1ZmZlclszKnNmYiArIGpdKQotICAgICAgICAgICAgICAgICAgICAgICAgewotICAgICAgICAgICAgICAgICAgICAgICAgICAgIHB2bXAzX3N0X2ludGVuc2l0eV92ZXIyKHhyLCB4bCwgaW8sIHNjYWxlZmFjX1ItPnNbal1bc2ZiXSwgc2ZiU3RhcnQsIHNmYk5vKTsKLSAgICAgICAgICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICAgICAgICAgIGVsc2UgaWYgKG1zX3N0ZXJlbykKLSAgICAgICAgICAgICAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBwdm1wM19zdF9taWRfc2lkZSh4ciwgeGwsIHNmYlN0YXJ0LCBzZmJObyk7Ci0gICAgICAgICAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgICAgIH0gLyogZm9yIChqID0gMDsgaiA8IDM7IGorKykgKi8KLQotICAgICAgICAgICAgfSAvKiBlbmQgb2YgZWxzZSAoIGdyX2luZm8tPm1peGVkX2Jsb2NrX2ZsYWcpICovCi0KLSAgICAgICAgfSAgLyogaWYgKGdyX2luZm8tPndpbmRvd19zd2l0Y2hpbmdfZmxhZyAmJiAoZ3JfaW5mby0+YmxvY2tfdHlwZSA9PSAyKSkgKi8KLSAgICAgICAgZWxzZQotICAgICAgICB7Ci0gICAgICAgICAgICAvKgotICAgICAgICAgICAgICogIGxvbmcgYmxvY2sgcHJvY2Vzc2luZwotICAgICAgICAgICAgICovCi0gICAgICAgICAgICBpID0gMzE7Ci0gICAgICAgICAgICBzcyA9IDE3OwotICAgICAgICAgICAgc2IgPSAwOwotCi0gICAgICAgICAgICB3aGlsZSAoaSA+PSAwKQotICAgICAgICAgICAgewotICAgICAgICAgICAgICAgIGlmICh4bFsoaSpGSUxURVJCQU5LX0JBTkRTKSArIHNzXSkKLSAgICAgICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgICAgIHNiID0gKGkgPDwgNCkgKyAoaSA8PCAxKSArIHNzOwotICAgICAgICAgICAgICAgICAgICAvKiAgaSA9IC0xICAgICBwYXRjaGVkIFJGICAgIDI0LTA5LTIwMDIgICAqLwotICAgICAgICAgICAgICAgICAgICBpID0gLTI7Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgIGVsc2UKLSAgICAgICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgICAgIHNzLS07Ci0gICAgICAgICAgICAgICAgICAgIGlmIChzcyA8IDApCi0gICAgICAgICAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAgICAgICAgIGktLTsKLSAgICAgICAgICAgICAgICAgICAgICAgIHNzID0gMTc7Ci0gICAgICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgIC8qICBwYXRjaGVkIFJGICAgIDI0LTA5LTIwMDIgICAqLwotICAgICAgICAgICAgaWYgKHNiKQotICAgICAgICAgICAgewotICAgICAgICAgICAgICAgIGlmIChtcDNfc2ZCYW5kSW5kZXhbc2ZyZXFdLmxbMTRdIDw9IHNiKQotICAgICAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAgICAgaSA9IDE0OwotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICBlbHNlIGlmIChtcDNfc2ZCYW5kSW5kZXhbc2ZyZXFdLmxbN10gPD0gc2IpCi0gICAgICAgICAgICAgICAgewotICAgICAgICAgICAgICAgICAgICBpID0gNzsKLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgZWxzZQotICAgICAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAgICAgaSA9IDA7Ci0gICAgICAgICAgICAgICAgfQotCi0gICAgICAgICAgICAgICAgd2hpbGUgKG1wM19zZkJhbmRJbmRleFtzZnJlcV0ubFtpXSA8PSBzYikKLSAgICAgICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgICAgIGkrKzsKLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgIGVsc2UKLSAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICBpZiAoaSA9PSAtMSkKLSAgICAgICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgICAgIC8qICBhbGwgeHJbMV1bXVtdIGFyZSAwOiBzZXQgSVMgYm91bmQgc2ZiIHRvIDAgICovCi0gICAgICAgICAgICAgICAgICAgIGkgPSAwOwotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICBlbHNlCi0gICAgICAgICAgICAgICAgewotICAgICAgICAgICAgICAgICAgICAvKiAgeHJbMV1bMF1bMF0gaXMgdW5lcXVhbCAwIGFuZCBhbGwgb3RoZXJzIGFyZSAwOiBzZXQgSVMgYm91bmQgc2ZiIHRvIDEgKi8KLSAgICAgICAgICAgICAgICAgICAgaSA9IDE7Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgfQotICAgICAgICAgICAgLyogIGNvcnJlY3RlZCB2ZXJzaW9uIGJ5IGVmcyAyMDAzLTA3LTA0ICAqLwotICAgICAgICAgICAgc2ZiVGVtcCA9IGk7ICAvKiBmcm9tIHRoaXMgKGxvbmcpIHNmYiBvbiB3ZSBoYXZlIGludGVuc2l0eSBtb2RlICAgICAgICAqLwotICAgICAgICAgICAgLyogY2FuIGhhdmUgdmFsdWVzIGJldHdlZW4gMCAoYWxsIGxvbmcgc2ZiIGluIGludGVuc2l0eSkgKi8KLSAgICAgICAgICAgIC8qIGFuZCAyMiAobm8gbG9uZyBzZmIgaW4gaW50ZW5zaXR5IG1vZGUpICAgICAgICAgICAgICAgICovCi0KLSAgICAgICAgICAgIC8qIGZpcnN0IGNhbGN1bGF0ZSBkaXJlY3Rpb25hbCBmYWN0b3JzIGZvciBpbnRlbnNpdHkgc3RlcmVvLAotICAgICAgICAgICAgZm9yIGFsbCBzZmIgaW4gaW50ZW5zaXR5IG1vZGUsIGJ1dCBvbmx5IGlmIHRoZXkKLSAgICAgICAgICAgIGRvIG5vdCBoYXZlICJpbGxlZ2FsIiBwb3NpdGlvbjogKi8KLQotICAgICAgICAgICAgLyogdG8gZG8gdGhpcyBmb3IgYWxsI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cyAqLwotICAgICAgICAgICAgLyogZmlyc3QgcHJvY2VzcyBsb3dlciBzZmIncyBub3QgaW4gaW50ZW5zaXR5IG1vZGUgKi8KLQotICAgICAgICAgICAgc2ZiTm8gPSBtcDNfc2ZCYW5kSW5kZXhbc2ZyZXFdLmxbc2ZiVGVtcF0gLSBtcDNfc2ZCYW5kSW5kZXhbc2ZyZXFdLmxbMF07Ci0gICAgICAgICAgICBzZmJTdGFydCA9IG1wM19zZkJhbmRJbmRleFtzZnJlcV0ubFswXTsKLQotICAgICAgICAgICAgaWYgKG1zX3N0ZXJlbykKLSAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICBwdm1wM19zdF9taWRfc2lkZSh4ciwgeGwsIHNmYlN0YXJ0LCBzZmJObyk7Ci0gICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgIC8qIG5vdyBpbnRlbnNpdHkgc3RlcmVvIHByb2Nlc3Npbmcgb2YgdGhlIHJlbWFpbmluZyBzZmInczogKi8KLSAgICAgICAgICAgIGZvciAoc2ZiID0gc2ZiVGVtcDsgc2ZiIDwgMjI7IHNmYisrKQotICAgICAgICAgICAgewotICAgICAgICAgICAgICAgIHNmYk5vID0gbXAzX3NmQmFuZEluZGV4W3NmcmVxXS5sW3NmYisxXSAtIG1wM19zZkJhbmRJbmRleFtzZnJlcV0ubFtzZmJdOyAvKiBudW1iZXIgb2YgbGluZXMgdG8gcHJvY2VzcyAqLwotICAgICAgICAgICAgICAgIHNmYlN0YXJ0ID0gbXAzX3NmQmFuZEluZGV4W3NmcmVxXS5sW3NmYl07ICAgICAgICAgICAgICAgICAgICAgICAgICAvKiBzdGFydCBvZiBzZmIgKi8KLQotICAgICAgICAgICAgICAgIGlmICgodWludDMyKShzY2FsZWZhY19SLT5sW3NmYl0pICE9IHNjYWxlZmFjX0lJUF9idWZmZXJbc2ZiXSkgLyogImxlZ2FsIiBwb3NpdGlvbiA/ICovCi0gICAgICAgICAgICAgICAgewotICAgICAgICAgICAgICAgICAgICB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gwRkZGRkZGRikKLSAgICB7Ci0gICAgICAgIGkgPSAwOyAgLyogbW9zdCBsaWtlbHkgY2FzZSAqLwotICAgIH0KLSAgICBlbHNlIGlmICh4ID4gMHgwMEZGRkZGRikKLSAgICB7Ci0gICAgICAgIGkgPSAzOyAgLyogc2Vjb25kIG1vc3QgbGlrZWx5IGNhc2UgKi8KLSAgICB9Ci0gICAgZWxzZSBpZiAoeCA+IDB4MDAwMEZGRkYpCi0gICAgewotICAgICAgICBpICA9IHggPiAweDAwMEZGRkZGID8gIDcgOiAgMTE7Ci0gICAgfQotICAgIGVsc2UKLSAgICB7Ci0gICAgICAgIGlmICh4ID4gMHgwMDAwMDBGRikKLSAgICAgICAgewotICAgICAgICAgICAgaSAgPSB4ID4gMHgwMDAwMEZGRiA/ICAxNSA6ICAxOTsKLSAgICAgICAgfQotICAgICAgICBlbHNlCi0gICAgICAgIHsKLSAgICAgICAgICAgIGkgID0geCA+IDB4MDAwMDAwMEYgPyAgMjMgOiAgMjc7Ci0gICAgICAgIH0KLSAgICB9Ci0KLQotICAgIHggPDw9IGk7Ci0KLSAgICBzd2l0Y2ggKHggJiAweDc4MDAwMDAwKQotICAgIHsKLSAgICAgICAgY2FzZSAweDA4MDAwMDAwOgotICAgICAgICAgICAgaSArPSAzOwotICAgICAgICAgICAgYnJlYWs7Ci0KLSAgICAgICAgY2FzZSAweDE4MDAwMDAwOgotICAgICAgICBjYXNlIDB4MTAwMDAwMDA6Ci0gICAgICAgICAgICBpICs9IDI7Ci0gICAgICAgICAgICBicmVhazsKLSAgICAgICAgY2FzZSAweDI4MDAwMDAwOgotICAgICAgICBjYXNlIDB4MjAwMDAwMDA6Ci0gICAgICAgIGNhc2UgMHgzODAwMDAwMDoKLSAgICAgICAgY2FzZSAweDMwMDAwMDAwOgotICAgICAgICAgICAgaSsrOwotCi0gICAgICAgIGRlZmF1bHQ6Ci0gICAgICAgICAgICA7Ci0gICAgfQotCi0gICAgcmV0dXJuIGk7Ci0KLX0KLQot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ICAgKnBDaFZhcnMsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGludDMyICAgICAgICAgIG51bUNoYW5uZWxzLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBlX2VxdWFsaXphdGlvbiBlcXVhbGl6ZXJUeXBlLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpbnQxNiAgICAgICAgICAqb3V0UGNtKQotewotICAgIC8qCi0gICAgICogIEVxdWFsaXplcgotICAgICAqLwotICAgIHB2bXAzX2VxdWFsaXplcihwQ2hWYXJzLT5jaXJjX2J1ZmZlciwKLSAgICAgICAgICAgICAgICAgICAgZXF1YWxpemVyVHlwZSwKLSAgICAgICAgICAgICAgICAgICAgcENoVmFycy0+d29ya19idWZfaW50MzIpOwotCi0KLSAgICBpbnQxNiAqIHB0cl9vdXQgPSBvdXRQY207Ci0KLQotICAgIGZvciAoaW50MzIgIGJhbmQgPSAwOyBiYW5kIDwgRklMVEVSQkFOS19CQU5EUzsgYmFuZCArPSAyKQotICAgIHsKLSAgICAgICAgaW50MzIgKmluRGF0YSAgPSAmcENoVmFycy0+Y2lyY19idWZmZXJbNTQ0IC0gKGJhbmQ8PDUpXTsKLQotICAgICAgICAvKgotICAgICAgICAgKiAgIERDVCAzMgotICAgICAgICAgKi8KLQotICAgICAgICBwdm1wM19zcGxpdCgmaW5EYXRhWzE2XSk7Ci0KLSAgICAgICAgcHZtcDNfZGN0XzE2KCZpbkRhdGFbMTZdLCAwKTsKLSAgICAgICAgcHZtcDNfZGN0XzE2KGluRGF0YSwgMSk7ICAgICAvLyBFdmVuIHRlcm1zCi0KLSAgICAgICAgcHZtcDNfbWVyZ2VfaW5fcGxhY2VfTjMyKGluRGF0YSk7Ci0KLSAgICAgICAgcHZtcDNfcG9seXBoYXNlX2ZpbHRlcl93aW5kb3coaW5EYXRhLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwdHJfb3V0LAotICAgICAgICAgICAgICAgICAgICAg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HNhbXBsZSkKLSAgICB7Ci0gICAgICAgIGludDMyIGE7Ci0gICAgICAgIGludDMyIGIgPSAzMTsKLSAgICAgICAgX19hc20KLSAgICAgICAgewotICAgICAgICAgICAgbW92ICAgYSwgc2FtcGxlLCBhc3IjMTUKLSAgICAgICAgICAgIHRlcSBhLCBzYW1wbGUsIGFzciBiCi0gICAgICAgICAgICBlb3JuZSBzYW1wbGUsIE1BWF8xNkJJVFNfSU5ULCBzYW1wbGUsIGFzciMzMQotICAgICAgICB9Ci0gICAgICAgIHJldHVybiBzYW1wbGUgOwotICAgIH0KLQotI2Vsc2UKLQotICAgIGlubGluZSBpbnQxNiBzYXR1cmF0ZTE2KGludDMyIHNhbXBsZSkKLSAgICB7Ci0KLSAgICAgICAgaWYgKChzYW1wbGUgPj4gMTUpIF4oc2FtcGxlID4+IDMxKSkKLSAgICAgICAgewotICAgICAgICAgICAgc2FtcGxlID0gTUFYXzE2QklUU19JTlQgXihzYW1wbGUgPj4gMzEpOwotICAgICAgICB9Ci0gICAgICAgIHJldHVybiBzYW1wbGU7Ci0KLSAgICB9Ci0jZW5kaWYKLQotCi0gICAgdm9pZCBwdm1wM19wb2x5cGhhc2VfZmlsdGVyX3dpbmRvdyhpbnQzMiAqc3ludGhfYnVmZmVyLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaW50MTYgKm91dFBjbSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGludDMyIG51bUNoYW5uZWxzKTsKLQotCi0jaWZkZWYgX19jcGx1c3BsdXMKLX0KLSNlbmRpZgotCi0vKi0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0KLTsgRU5ECi0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t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ZF9mcmVxX2xpbmVzLAotICAgICAgICAgICAgICAgICAgIG1wM0hlYWRlciAqaW5mbywKLSAgICAgICAgICAgICAgICAgICBpbnQzMiAgU2NyYXRjaF9tZW1bMTk4XSkKLXsKLSAgICBpbnQzMiBzZnJlcSA9ICBpbmZvLT52ZXJzaW9uX3ggKyAoaW5mby0+dmVyc2lvbl94IDw8IDEpOwotICAgIHNmcmVxICs9IGluZm8tPnNhbXBsaW5nX2ZyZXF1ZW5jeTsKLQotICAgIGlmIChncl9pbmZvLT53aW5kb3dfc3dpdGNoaW5nX2ZsYWcgJiYgKGdyX2luZm8tPmJsb2NrX3R5cGUgPT0gMikpCi0gICAgewotICAgICAgICBpbnQzMiAgIHNmYl9saW5lczsKLSAgICAgICAgaW50MzIgICBmcmVxOwotICAgICAgICBpbnQzMiAgIHNyY19saW5lOwotICAgICAgICBpbnQzMiAgIHNmYjsKLSAgICAgICAgaWYgKGdyX2luZm8tPm1peGVkX2Jsb2NrX2ZsYWcpCi0gICAgICAgIHsKLSAgICAgICAgICAgIC8qIFJFT1JERVJJTkcgRk9SIFJFU1QgU1dJVENIRUQgU0hPUlQgKi8KLSAgICAgICAgICAgIHNmYiA9IDM7ICAvKiBubyByZW9yZGVyIGZvciBsb3cgMiBzdWJiYW5kcyAqLwotICAgICAgICAgICAgc3JjX2xpbmUgPSAzNjsKLSAgICAgICAgfQotICAgICAgICBlbHNlCi0gICAgICAgIHsgIC8qIHB1cmUgc2hvcnQgKi8KLSAgICAgICAgICAgIHNmYiA9IDA7Ci0gICAgICAgICAgICBzcmNfbGluZSA9IDA7Ci0gICAgICAgIH0KLSAgICAgICAgaW50MTYgY3QgPSBzcmNfbGluZTsKLQotICAgICAgICBmb3IgKDsgc2ZiIDwgMTM7IHNmYisrKQotICAgICAgICB7Ci0gICAgICAgICAgICBpZiAoKnVzZWRfZnJlcV9saW5lcyA+IDMqbXAzX3NmQmFuZEluZGV4W3NmcmVxXS5zW3NmYisxXSkKLSAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICBzZmJfbGluZXMgPSBtcDNfc2ZCYW5kSW5kZXhbc2ZyZXFdLnNbc2ZiKzFdICAtIG1wM19zZkJhbmRJbmRleFtzZnJlcV0uc1tzZmJdOwotCi0gICAgICAgICAgICAgICAgZm9yIChmcmVxID0gMDsgZnJlcSA8IDMqc2ZiX2xpbmVzOyBmcmVxICs9IDMpCi0gICAgICAgICAgICAgICAgewotICAgICAgICAgICAgICAgICAgICBpbnQzMiB0bXAxID0geHJbc3JjX2xpbmVdOwotICAgICAgICAgICAgICAgICAgICBpbnQzMiB0bXAyID0geHJbc3JjX2xpbmUrKHNmYl9saW5lcyldOwotICAgICAgICAgICAgICAgICAgICBpbnQzMiB0bXAzID0geHJbc3JjX2xpbmUrKHNmYl9saW5lczw8MSldOwotICAgICAgICAgICAgICAgICAgICBzcmNfbGluZSsrOwotICAgICAgICAgICAgICAgICAgICBTY3JhdGNoX21lbVtmcmVxICBdID0gdG1wMTsKLSAgICAgICAgICAgICAgICAgICAgU2NyYXRjaF9tZW1bZnJlcSsxXSA9IHRtcDI7Ci0gICAgICAgICAgICAgICAgICAgIFNjcmF0Y2hfbWVtW2ZyZXErMl0gPSB0bXAzOwotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICBzcmNfbGluZSArPSAoc2ZiX2xpbmVzIDw8IDEpOwotCi0gICAgICAgICAgICAgICAgcHZfbWVtY3B5KCZ4cltjdF0sIFNjcmF0Y2hfbWVtLCBzZmJfbGluZXMqMypzaXplb2YoaW50MzIpKTsKLSAgICAgICAgICAgICAgICBjdCArPSBzZmJfbGluZXMgKyAoc2ZiX2xpbmVzIDw8IDEpOwotCi0gICAgICAgICAgICB9Ci0gICAgICAgICAgICBlbHNlCi0gICAgICAgICAgICB7Ci0KLSAgICAgICAgICAgICAgICBzZmJfbGluZXMgPSBtcDNfc2ZCYW5kSW5kZXhbc2ZyZXFdLnNbc2ZiKzFdICAtIG1wM19zZkJhbmRJbmRleFtzZnJlcV0uc1tzZmJdOwotCi0gICAgICAgICAgICAgICAgZm9yIChmcmVxID0gMDsgZnJlcSA8IDMqc2ZiX2xpbmVzOyBmcmVxICs9IDMpCi0gICAgICAgICAgICAgICAgewotICAgICAgICAgICAgICAgICAgICBpbnQzMiB0bXAxID0geHJbc3JjX2xpbmVdOwotICAgICAgICAgICAgICAgICAgICBpbnQzMiB0bXAyID0geHJbc3JjX2xpbmUrKHNmYl9saW5lcyldOwotICAgICAgICAgICAgICAgICAgICBpbnQzMiB0bXAzID0geHJbc3JjX2xpbmUrKHNmYl9saW5lczw8MSldOwotICAgICAgICAgICAgICAgICAgICBzcmNfbGluZSsrOwotICAgICAgICAgICAgICAgICAgICBTY3JhdGNoX21lbVtmcmVxICBdID0gdG1wMTsKLSAgICAgICAgICAgICAgICAgICAgU2NyYXRjaF9tZW1bZnJlcSsxXSA9IHRtcDI7Ci0gICAgICAgICAgICAgICAgICAgIFNjcmF0Y2hfbWVtW2ZyZXErMl0gPSB0bXAzOwotICAgICAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgICAgIHB2X21lbWNweSgmeHJbY3RdLCBTY3JhdGNoX21lbSwgc2ZiX2xpbmVzKjMqc2l6ZW9mKGludDMyKSk7Ci0KLSAgICAgICAgICAgICAgICAqdXNlZF9mcmVxX2xpbmVzID0gbXAzX3NmQmFuZEluZGV4W3NmcmVxXS5zW3NmYisxXSAqIDM7Ci0KLSAgICAgICAgICAgICAgICBzZmIgPSAxMzsgICAvKiBmb3JjZSBvdXQgb2YgdGhlIGZvci1sb29wICovCi0gICAgICAgICAgICB9Ci0gICAgICAgIH0KLSAgICB9Ci19Ci0KLQotCi0KZGlmZiAtLWdpdCBhL21lZGlhL2xpYnN0YWdlZnJpZ2h0L2NvZGVjcy9tcDNkZWMvc3JjL3B2bXAzX3Jlb3JkZXIuaCBiL21lZGlhL2xpYnN0YWdlZnJpZ2h0L2NvZGVjcy9tcDNkZWMvc3JjL3B2bXAzX3Jlb3JkZXIuaApkZ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SBhY2Nlc3NlcwotICAgICAgICB1aW50MzIgdGVtcCA9IGdldE5iaXRzKCZwVmFycy0+aW5wdXRTdHJlYW0sIDIxKTsKLSAgICAgICAgLy8gcHV0IGJhY2sgd2hvbGUgaGVhZGVyCi0gICAgICAgIHBWYXJzLT5pbnB1dFN0cmVhbS51c2VkQml0cyAtPSAyMSArIFNZTkNfV09SRF9MTkdUSDsKLQotICAgICAgICBpbnQzMiAgdmVyc2lvbjsKLQotICAgICAgICBzd2l0Y2ggKHRlbXAgPj4gMTkpICAvKiAyICovCi0gICAgICAgIHsKLSAgICAgICAgICAgIGNhc2UgMDoKLSAgICAgICAgICAgICAgICB2ZXJzaW9uID0gTVBFR18yXzU7Ci0gICAgICAgICAgICAgICAgYnJlYWs7Ci0gICAgICAgICAgICBjYXNlIDI6Ci0gICAgICAgICAgICAgICAgdmVyc2lvbiA9IE1QRUdfMjsKLSAgICAgICAgICAgICAgICBicmVhazsKLSAgICAgICAgICAgIGNhc2UgMzoKLSAgICAgICAgICAgICAgICB2ZXJzaW9uID0gTVBFR18xOwotICAgICAgICAgICAgICAgIGJyZWFrOwotICAgICAgICAgICAgZGVmYXVsdDoKLSAgICAgICAgICAgICAgICB2ZXJzaW9uID0gSU5WQUxJRF9WRVJTSU9OOwotICAgICAgICAgICAgICAgIGJyZWFrOwotICAgICAgICB9Ci0KLSAgICAgICAgaW50MzIgZnJlcV9pbmRleCA9ICh0ZW1wIDw8IDIwKSA+PiAzMDsKLQotICAgICAgICBpZiAodmVyc2lvbiAhPSBJTlZBTElEX1ZFUlNJT04gJiYgKGZyZXFfaW5kZXggIT0gMykpCi0gICAgICAgIHsKLSAgICAgICAgICAgIGludDMyIG51bUJ5dGVzID0gZnhwX211bDMyX1EyOChtcDNfYml0cmF0ZVt2ZXJzaW9uXVsodGVtcDw8MTYpPj4yOF0gPDwgMjAsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaW52X3NmcmVxW2ZyZXFfaW5kZXhdKTsKLQotICAgICAgICAgICAgbnVtQnl0ZXMgPj49ICgyMCAtIHZlcnNpb24pOwotCi0gICAgICAgICAgICBpZiAodmVyc2lvbiAhPSBNUEVHXzEpCi0gICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgbnVtQnl0ZXMgPj49IDE7Ci0gICAgICAgICAgICB9Ci0gICAgICAgICAgICBpZiAoKHRlbXAgPDwgMjIpID4+IDMxKQotICAgICAgICAgICAgewotICAgICAgICAgICAgICAgIG51bUJ5dGVzKys7Ci0gICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgIGlmIChudW1CeXRlcyA+IChpbnQzMilwVmFycy0+aW5wdXRTdHJlYW0uaW5wdXRCdWZmZXJDdXJyZW50TGVuZ3RoKQotICAgICAgICAgICAgewotICAgICAgICAgICAgICAgIC8qIGZyYW1lIHNob3VsZCBhY2NvdW50IGZvciBwYWRkaW5nIGFuZCAyIGJ5dGVzIHRvIGNoZWNrIHN5bmMgKi8KLSAgICAgICAgICAgICAgICBwRXh0LT5DdXJyZW50RnJhbWVMZW5ndGggPSBudW1CeXRlcyArIDM7Ci0gICAgICAgICAgICAgICAgcmV0dXJuIChTWU5DSF9MT1NUX0VSUk9SKTsKLSAgICAgICAgICAgIH0KLSAgICAgICAgICAgIGVsc2UgaWYgKG51bUJ5dGVzID09IChpbnQzMilwVmFycy0+aW5wdXRTdHJlYW0uaW5wdXRCdWZmZXJDdXJyZW50TGVuZ3RoKQotICAgICAgICAgICAgewotICAgICAgICAgICAgICAgIC8qIE5vIGVub3VnaCBkYXRhIHRvIHZhbGlkYXRlLCBidXQgY3VycmVudCBmcmFtZSBhcHBlYXJzIHRvIGJlIGNvcnJlY3QgKCBFT0YgY2FzZSkgKi8KLSAgICAgICAgICAgICAgICBwRXh0LT5pbnB1dEJ1ZmZlclVzZWRMZW5ndGggPSBwVmFycy0+aW5wdXRTdHJlYW0udXNlZEJpdHMgPj4gMzsKLSAgICAgICAgICAgICAgICByZXR1cm4gKE5PX0RFQ09ESU5HX0VSUk9SKTsKLSAgICAgICAgICAgIH0KLSAgICAgICAgICAgIGVsc2UKLSAgICAgICAgICAgIHsKLQotICAgICAgICAgICAgICAgIGludDMyIG9mZnNldCA9IHBWYXJzLT5pbnB1dFN0cmVhbS51c2VkQml0cyArICgobnVtQnl0ZXMpIDw8IDMpOwotCi0gICAgICAgICAgICAgICAgb2Zmc2V0ID4+PSBJTkJVRl9BUlJBWV9JTkRFWF9TSElGVDsKLSAgICAgICAgICAgICAgICB1aW50OCAgICAqcEVsZW0gID0gcFZhcnMtPmlucHV0U3RyZWFtLnBCdWZmZXIgKyBvZmZzZXQ7Ci0gICAgICAgICAgICAgICAgdWludDE2IHRtcDEgPSAqKHBFbGVtKyspOwotICAgICAgICAgICAgICAgIHVpbnQxNiB0bXAyID0gKihwRWxlbSk7Ci0KLSAgICAgICAgICAgICAgICB2YWwgPSAodG1wMSA8PCAzKTsKLSAgICAgICAgICAgICAgICB2YWwgfD0gKHRtcDIgPj4gNSk7Ci0gICAgICAgICAgICB9Ci0gICAgICAgIH0KLSAgICAgICAgZWxzZQotICAgICAgICB7Ci0gICAgICAgICAgICB2YWwgPSAwOyAvLyBmb3JjZSBtaXNtYXRjaAotICAgICAgICB9Ci0KLSAgICAgICAgaWYgKHZhbCA9PSBTWU5DX1dPUkQpCi0gICAgICAgIHsKLSAgICAgICAgICAgIHBFeHQtPmlucHV0QnVmZmVyVXNlZExlbmd0aCA9IHBWYXJzLT5pbnB1dFN0cmVhbS51c2VkQml0cyA+PiAzOyAvLy8gICEhISEhCi0gICAgICAgICAgICBlcnIgPSBOT19ERUNPRElOR19FUlJPUjsKLSAgICAgICAgfQotICAgICAgICBlbHNlCi0gICAgICAgIHsKLSAgICAgICAgICAgIHBFeHQtPmlucHV0QnVmZmVyQ3VycmVudExlbmd0aCA9IDA7Ci0gICAgICAgICAgICBlcnIgPSBTWU5DSF9MT1NUX0VSUk9SOwotICAgICAgICB9Ci0gICAgfQotICAgIGVsc2UKLS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wKLSAgICAgICAgICAgICAgICAgICAgICAgIGludDMyIHhsW1NVQkJBTkRTX05VTUJFUipGSUxURVJCQU5LX0JBTkRTXSwKLSAgICAgICAgICAgICAgICAgICAgICAgIGludDMyIGlzX3BvcywKLSAgICAgICAgICAgICAgICAgICAgICAgIGludDMyIFN0YXJ0LAotICAgICAgICAgICAgICAgICAgICAgICAgaW50MzIgTnVtYmVyKQotewotCi0gICAgaW50MzIgVG1wRmFjID0gaXNfcmF0aW9fZmFjdG9yWyBpc19wb3MgJiA3XTsKLQotICAgIGludDMyICpwdF94ciAgPSAmeHJbU3RhcnRdOwotICAgIGludDMyICpwdF94bCAgPSAmeGxbU3RhcnRdOwotCi0gICAgZm9yIChpbnQzMiBpID0gTnVtYmVyID4+IDE7IGkgIT0gMDsgaS0tKQotICAgIHsKLSAgICAgICAgaW50MzIgdG1wID0gZnhwX211bDMyX1EzMigoKnB0X3hyKSA8PCAxLCBUbXBGYWMpOwotICAgICAgICAqKHB0X3hsKyspID0gKCpwdF94cikgLSB0bXA7Ci0gICAgICAgICoocHRfeHIrKykgPSB0bXA7Ci0gICAgICAgIHRtcCA9IGZ4cF9tdWwzMl9RMzIoKCpwdF94cikgPDwgMSwgVG1wRmFjKTsKLSAgICAgICAgKihwdF94bCsrKSA9ICgqcHRfeHIpIC0gdG1wOwotICAgICAgICAqKHB0X3hyKyspID0gdG1wOwotICAgIH0KLQotICAgIGlmIChOdW1iZXImMSkKLSAgICB7Ci0gICAgICAgIGludDMyIHRtcCA9IGZ4cF9tdWwzMl9RMzIoKCpwdF94cikgPDwgMSwgVG1wRmFjKTsKLSAgICAgICAgKihwdF94bCkgPSAoKnB0X3hyKSAtIHRtcDsKLSAgICAgICAgKihwdF94cikgPSB0bXA7Ci0gICAgfQotCi19Ci0KLS8qLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLQotOyBGVU5DVElPTiBDT0RFCi0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tKi8KLXZvaWQgcHZtcDNfc3RlcmVvX3Byb2MoaW50MzIgeHJbU1VCQkFORFNfTlVNQkVSKkZJTFRFUkJBTktfQkFORFNdLAotICAgICAgICAgICAgICAgICAgICAgICBpbnQzMiB4bFtTVUJCQU5EU19OVU1CRVIqRklMVEVSQkFOS19CQU5EU10sCi0gICAgICAgICAgICAgICAgICAgICAgIG1wM1NjYWxlRmFjdG9ycyAqc2NhbGVmYWMsCi0gICAgICAgICAgICAgICAgICAgICAgIGdyYW51bGVJbmZvICpncl9pbmZvLAotICAgICAgICAgICAgICAgICAgICAgICBpbnQzMiB1c2VkX2ZyZXFfbGluZXMsCi0gICAgICAgICAgICAgICAgICAgICAgIG1wM0hlYWRlciAqaW5mbykKLXsKLQotCi0gICAgaW50MzIgc2I7Ci0gICAgaW50MzIgc3M7Ci0gICAgaW50MzIgc2ZiTm87Ci0gICAgaW50MzIgc2ZiU3RhcnQ7Ci0KLSAgICBpbnQzMiBzZmI7Ci0gICAgaW50MzIgc2ZiVGVtcDsKLSAgICBpbnQzMiBpOwotICAgIGludDMyIGo7Ci0KLQotICAgIGludDMyIGlfc3RlcmVvICA9IChpbmZvLT5tb2RlID09IE1QR19NRF9KT0lOVF9TVEVSRU8pICYmCi0gICAgICAgICAgICAgICAgICAgICAgKGluZm8tPm1vZGVfZXh0ICYgMHgxKTsKLQotICAgIGludDMyIG1zX3N0ZXJlbyA9IChpbmZvLT5tb2RlID09IE1QR19NRF9KT0lOVF9TVEVSRU8pICYmCi0gICAgICAgICAgICAgICAgICAgICAgKGluZm8tPm1vZGVfZXh0ICYgMHgyKTsKLQotICAgIGludDMyIHNmcmVxICA9IGluZm8tPnZlcnNpb25feCArIChpbmZvLT52ZXJzaW9uX3ggPDwgMSk7Ci0gICAgc2ZyZXEgKz0gaW5mby0+c2FtcGxpbmdfZnJlcXVlbmN5OwotCi0KLQotCi0gICAgaWYgKGlfc3RlcmVvKQotICAgIHsKLSAgICAgICAgaWYgKGdyX2luZm8tPndpbmRvd19zd2l0Y2hpbmdfZmxhZyAmJiAoZ3JfaW5mby0+YmxvY2tfdHlwZSA9PSAyKSkKLSAgICAgICAgewotICAgICAgICAgICAgaWYgKGdyX2luZm8tPm1peGVkX2Jsb2NrX2ZsYWcpCi0gICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgLyoKLSAgICAgICAgICAgICAgICAgKiBtaXhlZCBibG9ja3MgcHJvY2Vzc2luZwotICAgICAgICAgICAgICAgICAqLwotICAgICAgICAgICAgICAgIGkgPSAzMTsKLSAgICAgICAgICAgICAgICBzcyA9IDE3OwotICAgICAgICAgICAgICAgIHNiID0gMDsKLSAgICAgICAgICAgICAgICB3aGlsZSAoaSA+PSAwKQotICAgICAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAgICAgaWYgKHhsWyhpKkZJTFRFUkJBTktfQkFORFMpICsgc3NdKQotICAgICAgICAgICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgICAgICAgICBzYiA9IChpIDw8IDQpICsgKGkgPDwgMSkgKyBzczsKLSAgICAgICAgICAgICAgICAgICAgICAgIGkgPSAtMTsKLSAgICAgICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgICAgICBlbHNlCi0gICAgICAgICAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAgICAgICAgIHNzLS07Ci0gICAgICAgICAgICAgICAgICAgICAgICBpZiAoc3MgPCAwKQotICAgICAgICAgICAgICAgICAgICAgICAgewotICAgICAgICAgICAgICAgICAgICAgICAgICAgIGktLTsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBzcyA9IDE3OwotICAgICAgICAgICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgfQotCi0gICAgICAgICAgICAgICAgaWYgKHNiIDwgMzYpCi0gICAgICAgICAgICAgICAgewotICAgICAgICAgICAgICAgICAgICAvKgotICAgICAgICAgICAgICAgICAgICAgKiBtaXhlZCBibG9ja3MgcHJvY2Vzc2luZzogaW50ZW5zaXR5IGJvdW5kIGluc2lkZSBsb25nIGJsb2NrcwotICAgICAgICAgICAgICAgICAgICAgKi8KLSAgICAgICAgICAgICAgICAgICAgLyogMS4gbG9uZyBibG9ja3MgdXAgdG8gaW50ZW5zaXR5IGJvcmRlcjogbm90IGludGVuc2l0eSAqLwotCi0gICAgICAgICAgICAgICAgICAgIGlmIChtcDNfc2ZCYW5kSW5kZXhbc2ZyZXFdLmxbNF0gPD0gc2IpCi0gICAgICAgICAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAgICAgICAgIHNmYiA9IDQ7Ci0gICAgICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICAgICAgZWxzZQotICAgICAgICAgICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgICAgICAgICBzZmIgPSAwOwotICAgICAgICAgICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgICAgICAgICAgd2hpbGUgKG1wM19zZkJhbmRJbmRleFtzZnJlcV0ubFtzZmJdIDwgc2IpCi0gICAgICAgICAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAgICAgICAgIHNmYisrOwotICAgICAgICAgICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgICAgICAgICAgLyogZnJvbSB0aGF0IHNmYiBvbiBpbnRlbnNpdHkgc3RlcmVvICovCi0gICAgICAgICAgICAgICAgICAgIHNmYlRlbXAgPSBzZmI7ICAvKiBzYXZlIGZvciBsYXRlciB1c2UgKi8KLQotICAgICAgICAgICAgICAgICAgICBzZmJTdGFydCA9IG1wM19zZkJhbmRJbmRleFtzZnJlcV0ubFtzZmJdOwotCi0gICAgICAgICAgICAgICAgICAgIC8qIGZyb20gMCB1cCB0byBzZmJTdGFydCBkbyBtc19zdGVyZW8gb3Igbm9ybWFsIHN0ZXJlbyAqLwotCi0gICAgICAgICAgICAgICAgICAgIGlmIChtc19zdGVyZW8pCi0gICAgICAgICAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAgICAgICAgIHB2bXAzX3N0X21pZF9zaWRlKHhyLCB4bCwgMCwgc2ZiU3RhcnQpOwotICAgICAgICAgICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgICAgICAgICAgLyogMi4gbG9uZyBibG9ja3MgZnJvbSBpbnRlbnNpdHkgYm9yZGVyIHVwIHRvIHNmYiBiYW5kIDg6IGludGVuc2l0eSAqLwotICAgICAgICAgICAgICAgICAgICAvKiBjYWxjLiBpc19yYXRpbyAqLwotCi0KLSAgICAgICAgICAgICAgICAgICAgLyogU3RhcnQgb2YgaW50ZW5zaXR5IHN0ZXJlbyBvZiByZW1haW5pbmcgc2ZjIGJhbmRzOiAqLwotICAgICAgICAgICAgICAgICAgICBmb3IgKDsgc2ZiVGVtcCA8IDg7IHNmYlRlbXArKykKLSAgICAgICAgICAgICAgICAgICAgewotICAgICAgICAgICAgICAgICAgICAgICAgc2ZiU3RhcnQgPSBtcDNfc2ZCYW5kSW5kZXhbc2ZyZXFdLmxbc2ZiVGVtcF07ICAvKiA9IFN0YXJ0IGluIDAgLi4uIDU3NSAqLwotICAgICAgICAgICAgICAgICAgICAgICAgc2ZiTm8gPSBtcDNfc2ZCYW5kSW5kZXhbc2ZyZXFdLmxbc2ZiVGVtcCsxXSAtIG1wM19zZkJhbmRJbmRleFtzZnJlcV0ubFtzZmJUZW1wXTsgLyogTm8gb2YgbGluZXMgdG8gcHJvY2VzcyAqLwotCi0gICAgICAgICAgICAgICAgICAgICAgICBpZiAoc2NhbGVmYWMtPmxbc2ZiVGVtcF0gIT0gNykKLSAgICAgICAgICAgICAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBwdm1wM19zdF9pbnRlbnNpdHkoeHIsIHhsLCBzY2FsZWZhYy0+bFtzZmJUZW1wXSwgc2ZiU3RhcnQsIHNmYk5vKTsKLSAgICAgICAgICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICAgICAgICAgIGVsc2UgaWYgKG1zX3N0ZXJlbykKLSAgICAgICAgICAgICAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBwdm1wM19zdF9taWRfc2lkZSh4ciwgeGwsIHNmYlN0YXJ0LCBzZmJObyk7Ci0gICAgICAgICAgICAgICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgICAgICAgICAgfSAgLyogZm9yICg7IHNmYlRlbXAgPCA4OyBzZmJUZW1wKyspICovCi0KLSAgICAgICAgICAgICAgICAgICAgZm9yIChqID0gMDsgaiA8IDM7IGorKykKLSAgICAgICAgICAgICAgICAgICAgewotICAgICAgICAgICAgICAgICAgICAgICAgLyogMy4gc2hvcnQgYmxvY2tzIGZyb20gc2ZiY250IHRvIGxhc3Qgc2ZiIGRvIGludGVuc2l0eSBzdGVyZW8gKi8KLSAgICAgICAgICAgICAgICAgICAgICAgIGZvciAoc2ZiVGVtcCA9IDM7IHNmYlRlbXAgPCAxMzsgc2ZiVGVtcCsrKQotICAgICAgICAgICAgICAgICAgICAgICAgewotICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNmYk5vID0gbXAzX3NmQmFuZEluZGV4W3NmcmVxXS5zW3NmYlRlbXArMV0gLSBtcDNfc2ZCYW5kSW5kZXhbc2ZyZXFdLnNbc2ZiVGVtcF07IC8qIE5vIG9mIGxpbmVzIHRvIHByb2Nlc3MgKi8KLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBzZmJTdGFydCA9IDMgKiBtcDNfc2ZCYW5kSW5kZXhbc2ZyZXFdLnNbc2ZiVGVtcF0gKyBqICogc2ZiTm87Ci0KLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoc2NhbGVmYWMtPnNbal1bc2ZiVGVtcF0gIT0gNykKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHB2bXAzX3N0X2ludGVuc2l0eSh4ciwgeGwsIHNjYWxlZmFjLT5zW2pdW3NmYlRlbXBdLCBzZmJTdGFydCwgc2ZiTm8pOwotICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBlbHNlIGlmIChtc19zdGVyZW8pCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgewotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwdm1wM19zdF9taWRfc2lkZSh4ciwgeGwsIHNmYlN0YXJ0LCBzZmJObyk7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgfQotCi0gICAgICAgICAgICAgICAgICAgICAgICB9ICAvKiBmb3IgKDsgc2ZiVGVtcCA8IDIyOyBzZmJUZW1wKyspICovCi0gICAgICAgICAgICAgICAgICAgIH0gLyogZm9yIChqID0gMDsgaiA8IDM7IGorKykgKi8KLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgZWxzZSAgIC8qIGVsc2UgZm9yIChzYiA+PSAzNikgKi8KLSAgICAgICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgICAgIC8qCi0gICAgICAgICAgICAgICAgICAgICAqIG1peGVkIGJsb2NrcyBwcm9jZXNzaW5nOiBpbnRlbnNpdHkgYm91bmQgb3V0c2lkZSBsb25nIGJsb2NrcwotICAgICAgICAgICAgICAgICAgICAgKi8KLQotCi0gICAgICAgICAgICAgICAgICAgIC8qCi0gICAgICAgICAgICAgICAgICAgICAqIDIuIHNob3J0IGJsb2NrcyBmcm9tIHNmYiBiYW5kIDMgdXAgdG8gaW50ZW5zaXR5IGJvcmRlcjogbm9ybWFsIHN0ZXJlbywgbXMgc3RlcmVvIGFuZCBpbnRlbnNpdHkKLSAgICAgICAgICAgICAgICAgICAgICovCi0gICAgICAgICAgICAgICAgICAgIGZvciAoaiA9IDA7IGogPCAzOyBqKyspCi0gICAgICAgICAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAgICAgICAgIGludDMyIHNmYmNudDsKLSAgICAgICAgICAgICAgICAgICAgICAgIHNmYmNudCA9IC0xOwotCi0gICAgICAgICAgICAgICAgICAgICAgICBmb3IgKHNmYiA9IDEyOyBzZmIgPj0gMzsgc2ZiLS0pCi0gICAgICAgICAgICAgICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgaW50MzIgbGluZXM7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgbGluZXMgPSBtcDNfc2ZCYW5kSW5kZXhbc2ZyZXFdLnNbc2ZiKzFdIC0gbXAzX3NmQmFuZEluZGV4W3NmcmVxXS5zW3NmYl07Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgaSA9IDMgKiBtcDNfc2ZCYW5kSW5kZXhbc2ZyZXFdLnNbc2ZiXSArIChqICsgMSkgKiBsaW5lcyAtIDE7Ci0KLSAgICAgICAgICAgICAgICAgICAgICAgICAgICB3aGlsZSAobGluZXMgPiAwKQotICAgICAgICAgICAgICAgICAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHhsW2ldKQotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzZmJjbnQgPSBzZmI7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzZmIgPSAtMTA7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBsaW5lcyA9IC0xMDsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBsaW5lcy0tOwotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpLS07Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgICAgICAgICAgfQotCi0gICAgICAgICAgICAgICAgICAgICAgICBzZmJjbnQgKz0gMTsKLSAgICAgICAgICAgICAgICAgICAgICAgIGlmIChzZmJjbnQgPCAzKQotICAgICAgICAgICAgICAgICAgICAgICAgewotICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNmYmNudCA9IDM7Ci0gICAgICAgICAgICAgICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgICAgICAgICAgICAgIHNmYlRlbXAgPSBzZmJjbnQ7ICAgICAgICAvKiBmb3IgbGF0ZXIgdXNlICovCi0KLQotICAgICAgICAgICAgICAgICAgICAgICAgLyoKLSAgICAgICAgICAgICAgICAgICAgICAgICAqICAgZG8gbm9ybWFsIHN0ZXJlbyBvciBNUyBzdGVyZW8gZnJvbSBzZmIgMyB0byA8IHNmYmNudDoKLSAgICAgICAgICAgICAgICAgICAgICAgICAqLwotICAgICAgICAgICAgICAgICAgICAgICAgZm9yIChzYiA9IDM7IHNiIDwgc2ZiY250OyBzYisrKQotICAgICAgICAgICAgICAgICAgICAgICAgewotICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNmYk5vID0gbXAzX3NmQmFuZEluZGV4W3NmcmVxXS5zW3NiKzFdIC0gbXAzX3NmQmFuZEluZGV4W3NmcmVxXS5zW3NiXTsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBzZmJTdGFydCA9IDMgKiBtcDNfc2ZCYW5kSW5kZXhbc2ZyZXFdLnNbc2JdICsgaiAqIHNmYk5vOwotCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKG1zX3N0ZXJlbykKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHB2bXAzX3N0X21pZF9zaWRlKHhyLCB4bCwgc2ZiU3RhcnQsIHNmYk5vKTsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgICAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgICAgICAgICAgICAgLyogZnJvbSBzZmJjbnQgdG8gbGFzdCBzZmIgZG8gaW50ZW5zaXR5IHN0ZXJlbyAqLwotICAgICAgICAgICAgICAgICAgICAgICAgZm9yICg7IHNmYlRlbXAgPCAxMzsgc2ZiVGVtcCsrKQotICAgICAgICAgICAgICAgICAgICAgICAgewotICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNmYk5vID0gbXAzX3NmQmFuZEluZGV4W3NmcmVxXS5zW3NmYlRlbXArMV0gLSBtcDNfc2ZCYW5kSW5kZXhbc2ZyZXFdLnNbc2ZiVGVtcF07IC8qIE5vIG9mIGxpbmVzIHRvIHByb2Nlc3MgKi8KLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBzZmJTdGFydCA9IDMgKiBtcDNfc2ZCYW5kSW5kZXhbc2ZyZXFdLnNbc2ZiVGVtcF0gKyBqICogc2ZiTm87Ci0KLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoc2NhbGVmYWMtPnNbal1bc2ZiVGVtcF0gIT0gNykKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHB2bXAzX3N0X2ludGVuc2l0eSh4ciwgeGwsIHNjYWxlZmFjLT5zW2pdW3NmYlRlbXBdLCBzZmJTdGFydCwgc2ZiTm8pOwotICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBlbHNlIGlmIChtc19zdGVyZW8pCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgewotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwdm1wM19zdF9taWRfc2lkZSh4ciwgeGwsIHNmYlN0YXJ0LCBzZmJObyk7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgfQotCi0gICAgICAgICAgICAgICAgICAgICAgICB9ICAvKiBmb3IgKDsgc2ZiVGVtcCA8IDIyOyBzZmJUZW1wKyspICovCi0KLSAgICAgICAgICAgICAgICAgICAgfSAvKiBmb3IgKGogPSAwOyBqIDwgMzsgaisrKSAqLwotCi0gICAgICAgICAgICAgICAgICAgIC8qIDEuIGxvbmcgYmxvY2tzIHVwIHRvIHNmYiBiYW5kIDg6IG5vdCBpbnRlbnNpdHkgKi8KLSAgICAgICAgICAgICAgICAgICAgLyogZnJvbSAwIHRvIHNmYiA4IG1zX3N0ZXJlbyBvciBub3JtYWwgc3RlcmVvICovCi0KLSAgICAgICAgICAgICAgICAgICAgc2ZiU3RhcnQgPSBtcDNfc2ZCYW5kSW5kZXhbc2ZyZXFdLmxbOF07Ci0KLSAgICAgICAgICAgICAgICAgICAgaWYgKG1zX3N0ZXJlbykKLSAgICAgICAgICAgICAgICAgICAgewotICAgICAgICAgICAgICAgICAgICAgICAgcHZtcDNfc3RfbWlkX3NpZGUoeHIsIHhsLCAwLCBzZmJTdGFydCk7Ci0gICAgICAgICAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgIH0gIC8qIGlmIChncl9pbmZvLT5taXhlZF9ibG9ja19mbGFnKSAqLwotICAgICAgICAgICAgZWxzZQotICAgICAgICAgICAgewotICAgICAgICAgICAgICAgIC8qCi0gICAgICAgICAgICAgICAgICogc2hvcnQgYmxvY2sgcHJvY2Vzc2luZwotICAgICAgICAgICAgICAgICAqLwotICAgICAgICAgICAgICAgIGZvciAoaiA9IDA7IGogPCAzOyBqKyspCi0gICAgICAgICAgICAgICAgewotICAgICAgICAgICAgICAgICAgICBpbnQzMiBzZmJjbnQgPSAtMTsKLQotICAgICAgICAgICAgICAgICAgICBmb3IgKHNmYiA9IDEyOyBzZmIgPj0gMDsgc2ZiLS0pCi0gICAgICAgICAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAgICAgICAgIGludDMyIGxpbmVzID0gbXAzX3NmQmFuZEluZGV4W3NmcmVxXS5zW3NmYisxXSAtIG1wM19zZkJhbmRJbmRleFtzZnJlcV0uc1tzZmJdOwotICAgICAgICAgICAgICAgICAgICAgICAgaSA9IDMgKiBtcDNfc2ZCYW5kSW5kZXhbc2ZyZXFdLnNbc2ZiXSArIChqICsgMSkgKiBsaW5lcyAtIDE7Ci0KLSAgICAgICAgICAgICAgICAgICAgICAgIHdoaWxlIChsaW5lcyA+IDApCi0gICAgICAgICAgICAgICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHhsW2ldKQotICAgICAgICAgICAgICAgICAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2ZiY250ID0gc2ZiOwotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzZmIgPSAtMTA7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxpbmVzID0gLTEwOwotICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBsaW5lcy0tOwotICAgICAgICAgICAgICAgICAgICAgICAgICAgIGktLTsKLSAgICAgICAgICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICAgICAgfQotCi0gICAgICAgICAgICAgICAgICAgIHNmYmNudCArPSAxOwotICAgICAgICAgICAgICAgICAgICBzZmJUZW1wID0gc2ZiY250OyAgICAgICAgLyogZm9yIGxhdGVyIHVzZSAqLwotCi0gICAgICAgICAgICAgICAgICAgIC8qIGRvIG5vcm1hbCBzdGVyZW8gb3IgTVMgc3RlcmVvIGZyb20gMCB0byBzZmJjbnQgKi8KLSAgICAgICAgICAgICAgICAgICAgZm9yIChzYiA9IDA7IHNiIDwgc2ZiY250OyBzYisrKQotICAgICAgICAgICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgICAgICAgICBzZmJObyA9IG1wM19zZkJhbmRJbmRleFtzZnJlcV0uc1tzYisxXSAtIG1wM19zZkJhbmRJbmRleFtzZnJlcV0uc1tzYl07Ci0gICAgICAgICAgICAgICAgICAgICAgICBzZmJTdGFydCA9IDMgKiBtcDNfc2ZCYW5kSW5kZXhbc2ZyZXFdLnNbc2JdICsgaiAqIHNmYk5vOwotCi0gICAgICAgICAgICAgICAgICAgICAgICBpZiAobXNfc3RlcmVvKQotICAgICAgICAgICAgICAgICAgICAgICAgewotICAgICAgICAgICAgICAgICAgICAgICAgICAgIHB2bXAzX3N0X21pZF9zaWRlKHhyLCB4bCwgc2ZiU3RhcnQsIHNmYk5vKTsKLSAgICAgICAgICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICAgICAgfQotCi0KLSAgICAgICAgICAgICAgICAgICAgLyogZnJvbSBzZmJjbnQgdG8gbGFzdCBzZmIgZG8gaW50ZW5zaXR5IHN0ZXJlbyAqLwotICAgICAgICAgICAgICAgICAgICBmb3IgKDsgc2ZiVGVtcCA8IDEzOyBzZmJUZW1wKyspCi0gICAgICAgICAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAgICAgICAgIHNmYk5vID0gbXAzX3NmQmFuZEluZGV4W3NmcmVxXS5zW3NmYlRlbXArMV0gLSBtcDNfc2ZCYW5kSW5kZXhbc2ZyZXFdLnNbc2ZiVGVtcF07IC8qIE5vIG9mIGxpbmVzIHRvIHByb2Nlc3MgKi8KLSAgICAgICAgICAgICAgICAgICAgICAgIHNmYlN0YXJ0ID0gMyAqIG1wM19zZkJhbmRJbmRleFtzZnJlcV0uc1tzZmJUZW1wXSArIGogKiBzZmJObzsKLQotICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHNjYWxlZmFjLT5zW2pdW3NmYlRlbXBdICE9IDcpCi0gICAgICAgICAgICAgICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgcHZtcDNfc3RfaW50ZW5zaXR5KHhyLCB4bCwgc2NhbGVmYWMtPnNbal1bc2ZiVGVtcF0sIHNmYlN0YXJ0LCBzZmJObyk7Ci0gICAgICAgICAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgICAgICAgICBlbHNlIGlmIChtc19zdGVyZW8pCi0gICAgICAgICAgICAgICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgcHZtcDNfc3RfbWlkX3NpZGUoeHIsIHhsLCBzZmJTdGFydCwgc2ZiTm8pOwotICAgICAgICAgICAgICAgICAgICAgICAgfQotCi0gICAgICAgICAgICAgICAgICAgIH0gIC8qIGZvciAoOyBzZmJUZW1wIDwgMjI7IHNmYlRlbXArKykgKi8KLQotICAgICAgICAgICAgICAgIH0gLyogZm9yIChqID0gMDsgaiA8IDM7IGorKykgKi8KLQotICAgICAgICAgICAgfSAvKiBpZiggZ3JfaW5mby0+bWl4ZWRfYmxvY2tfZmxhZykgKi8KLQotCi0KLSAgICAgICAgfSAgLyogaWYgKGdyX2luZm8tPndpbmRvd19zd2l0Y2hpbmdfZmxhZyAmJiAoZ3JfaW5mby0+YmxvY2tfdHlwZSA9PSAyKSkgKi8KLSAgICAgICAgZWxzZQotICAgICAgICB7Ci0gICAgICAgICAgICAvKgotICAgICAgICAgICAgICogICBsb25nIGJsb2NrIHByb2Nlc3NpbmcKLSAgICAgICAgICAgICAqLwotICAgICAgICAgICAgaSA9IDMxOwotICAgICAgICAgICAgc3MgPSAxNzsKLSAgICAgICAgICAgIHNiID0gMDsKLQotICAgICAgICAgICAgd2hpbGUgKGkgPj0gMCkKLSAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICBpZiAoeGxbKGkqRklMVEVSQkFOS19CQU5EUykgKyBzc10gIT0gMCkKLSAgICAgICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgICAgIHNiID0gKGkgPDwgNCkgKyAoaSA8PCAxKSArIHNzOwotICAgICAgICAgICAgICAgICAgICBpID0gLTI7Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgIGVsc2UKLSAgICAgICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgICAgIHNzLS07Ci0gICAgICAgICAgICAgICAgICAgIGlmIChzcyA8IDApCi0gICAgICAgICAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAgICAgICAgIGktLTsKLSAgICAgICAgICAgICAgICAgICAgICAgIHNzID0gMTc7Ci0gICAgICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgIGlmIChzYikKLSAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICBpZiAobXAzX3NmQmFuZEluZGV4W3NmcmVxXS5sWzE0XSA8PSBzYikKLSAgICAgICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgICAgIHNmYiA9IDE0OwotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICBlbHNlIGlmIChtcDNfc2ZCYW5kSW5kZXhbc2ZyZXFdLmxbN10gPD0gc2IpCi0gICAgICAgICAgICAgICAgewotICAgICAgICAgICAgICAgICAgICBzZmIgPSA3OwotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICBlbHNlCi0gICAgICAgICAgICAgICAgewotICAgICAgICAgICAgICAgICAgICBzZmIgPSAwOwotICAgICAgICAgICAgICAgIH0KLQotCi0gICAgICAgICAgICAgICAgd2hpbGUgKG1wM19zZkJhbmRJbmRleFtzZnJlcV0ubFtzZmJdIDw9IHNiKQotICAgICAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAgICAgc2ZiKys7Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgfQotICAgICAgICAgICAgZWxzZQotICAgICAgICAgICAgewotICAgICAgICAgICAgICAgIGlmIChpID09IC0xKQotICAgICAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAgICAgLyogIGFsbCB4clsxXVtdW10gYXJlIDA6IHNldCBJUyBib3VuZCBzZmIgdG8gMCAgKi8KLSAgICAgICAgICAgICAgICAgICAgc2ZiID0gMDsKLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgZWxzZQotICAgICAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAgICAgLyogIHhyWzFdWzBdWzBdIGlzIHVuZXF1YWwgMCBhbmQgYWxsIG90aGVycyBhcmUgMDogc2V0IElTIGJvdW5kIHNmYiB0byAxICovCi0gICAgICAgICAgICAgICAgICAgIHNmYiA9IDE7Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgfQotCi0gICAgICAgICAgICBzZmJUZW1wID0gc2ZiOyAgLyogc2F2ZSBmb3IgbGF0ZXIgdXNlICovCi0KLQotICAgICAgICAgICAgc2ZiU3RhcnQgPSBtcDNfc2ZCYW5kSW5kZXhbc2ZyZXFdLmxbc2ZiXTsKLQotICAgICAgICAgICAgLyogZnJvbSAwIHRvIHNmYlN0YXJ0IG1zX3N0ZXJlbyBvciBub3JtYWwgc3RlcmVvICovCi0gICAgICAgICAgICBpZiAobXNfc3RlcmVvKQotICAgICAgICAgICAgewotICAgICAgICAgICAgICAgIHB2bXAzX3N0X21pZF9zaWRlKHhyLCB4bCwgMCwgc2ZiU3RhcnQpOwotICAgICAgICAgICAgfQotCi0gICAgICAgICAgICAvKiBub3cgaW50ZW5zaXR5IHN0ZXJlbyBvZiB0aGUgcmVtYWluaW5nIHNmYidzOiAqLwotICAgICAgICAgICAgZm9yICg7IHNmYiA8IDIxOyBzZmIrKykKLSAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICBzZmJTdGFydCA9IG1wM19zZkJhbmRJbmRleFtzZnJlcV0ubFtzZmJdOwotICAgICAgICAgICAgICAgIHNmYk5vID0gbXAzX3NmQmFuZEluZGV4W3NmcmVxXS5sW3NmYisxXSAtIG1wM19zZkJhbmRJbmRleFtzZnJlcV0ubFtzZmJdOyAvKiBObyBvZiBsaW5lcyB0byBwcm9jZXNzICovCi0KLSAgICAgICAgICAgICAgICBpZiAoc2NhbGVmYWMtPmxbc2ZiXSAhPSA3KQotICAgICAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAgICAgcHZtcDNfc3RfaW50ZW5zaXR5KHhyLCB4bCwgc2NhbGVmYWMtPmxbc2ZiXSwgc2ZiU3RhcnQsIHNmYk5vKTsKLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgZWxzZSBpZiAobXNfc3RlcmVvKQotICAgICAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAgICAgcHZtcDNfc3RfbWlkX3NpZGUoeHIsIHhsLCBzZmJTdGFydCwgc2ZiTm8pOwotICAgICAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgfSAgLyogZm9yICg7IHNmYlRlbXAgPCAyMjsgc2ZiVGVtcCsrKSAqLwotCi0KLQotICAgICAgICAgICAgc2ZiU3RhcnQgPSBtcDNfc2ZCYW5kSW5kZXhbc2ZyZXFdLmxbMjFdOwotICAgICAgICAgICAgc2ZiTm8gPSBtcDNfc2ZCYW5kSW5kZXhbc2ZyZXFdLmxbMjJdIC0gbXAzX3NmQmFuZEluZGV4W3NmcmVxXS5sWzIxXTsgLyogTm8gb2YgbGluZXMgdG8gcHJvY2VzcyAqLwotCi0gICAgICAgICAgICBpZiAoc2NhbGVmYWMtPmxbMjFdICE9IDcpCi0gICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgaWYgKHNmYlRlbXAgPCAyMSkKLSAgICAgICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgICAgIHNmYlRlbXAgPSBzY2FsZWZhYy0+bFsyMF07Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgIGVsc2UKLSAgICAgICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgICAgIHNmYlRlbXAgPSAwOyAgLyogaWYgc2NhbGVmYWNbMjBdIGlzIG5vdCBhbiBpbnRlbnNpdHkgcG9zaXRpb24sIGlzX3BvcyA9IDAgKi8KLSAgICAgICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgICAgICBwdm1wM19zdF9pbnRlbnNpdHkoeHIsIHhsLCBzZmJUZW1wLCBzZmJTdGFydCwgc2ZiTm8pOwotICAgICAgICAgICAgfQotICAgICAgICAgICAgZWxzZSBpZiAobXNf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3BsdXMKLWV4dGVybiAiQyIKLXsKLSNlbmRpZgotCi0KLSAgICB2b2lkIHB2bXAzX3N0ZXJlb19wcm9jKGludDMyIHhyW1NVQkJBTkRTX05VTUJFUipGSUxURVJCQU5LX0JBTkRTXSwKLSAgICBpbnQzMiB4bFtTVUJCQU5EU19OVU1CRVIqRklMVEVSQkFOS19CQU5EU10sCi0gICAgbXAzU2NhbGVGYWN0b3JzICpzY2FsZWZhYywKLSAgICBncmFudWxlSW5mbyAqZ3JfaW5mbywKLSAgICBpbnQzMiB1c2VkX2ZyZXFfbGluZXMsCi0gICAgbXAzSGVhZGVyICppbmZvKTsKLQotICAgIHZvaWQgcHZtcDNfc3RfaW50ZW5zaXR5KGludDMyIHhyW1NVQkJBTkRTX05VTUJFUipGSUxURVJCQU5LX0JBTkRTXSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBpbnQzMiB4bFtTVUJCQU5EU19OVU1CRVIqRklMVEVSQkFOS19CQU5EU10sCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgaW50MzIgaXNfcG9zLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgIGludDMyIFN0YXJ0LAotICAgICAgICAgICAgICAgICAgICAgICAgICAgIGludDMyIE51bWJlcik7Ci0KLSAgICB2b2lkIHB2bXAzX3N0X21pZF9zaWRlKGludDMyIHhyW1NVQkJBTkRTX05VTUJFUipGSUxURVJCQU5LX0JBTkRTXSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgIGludDMyIHhsW1NVQkJBTkRTX05VTUJFUipGSUxURVJCQU5LX0JBTkRTXSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgIGludDMyIFN0YXJ0LAotICAgICAgICAgICAgICAgICAgICAgICAgICAgaW50MzIgTnVtYmVyKTsKLSNpZmRlZiBfX2NwbHVzcGx1cwotfQotI2VuZGlmCi0KLS8qLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t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17Ci0KLSAgICAweDExMDMsICAgIDB4MDEwMywgICAgMHgxMDAzLCAgICAweDAwMDEsCi0gICAgMHgwMDAxLCAgICAweDAwMDEsICAgIDB4MDAwMSwgICAgMHgzMTA2LAotICAgIDB4MzEwNiwgICAgMHgxMzA3LCAgICAweDAzMDcsICAgIDB4MzAwNywKLSAgICAweDIyMDcsICAgIDB4MTIwNiwgICAgMHgxMjA2LCAgICAweDIxMDYsCi0gICAgMHgyMTA2LCAgICAweDAyMDYsICAgIDB4MDIwNiwgICAgMHgyMDA2LAotICAgIDB4MjAwNiwgICAgMHgzMzA4LCAgICAweDIzMDgsICAgIDB4MzIwNywKLSAgICAweDMyMDcKLX07Ci0KLQotY29uc3QgdWludDE2IGh1ZmZUYWJsZV82WzI2XSA9Ci17Ci0KLSAgICAweDEyMDQsICAgIDB4MjEwNCwgICAgMHgyMDA0LCAgICAweDAxMDMsCi0gICAgMHgwMTAzLCAgICAweDExMDIsICAgIDB4MTEwMiwgICAgMHgxMTAyLAotICAgIDB4MTEwMiwgICAgMHgxMDAzLCAgICAweDEwMDMsICAgIDB4MDAwMywKLSAgICAweDAwMDMsICAgIDB4MjMwNiwgICAgMHgzMjA2LCAgICAweDMwMDYsCi0gICAgMHgxMzA1LCAgICAweDEzMDUsICAgIDB4MzEwNSwgICAgMHgzMTA1LAotICAgIDB4MjIwNSwgICAgMHgyMjA1LCAgICAweDAyMDUsICAgIDB4MDIwNSwKLSAgICAweDMzMDcsICAgIDB4MDMwNwotfTsKLQotCi0KLWNvbnN0IHVpbnQxNiBodWZmVGFibGVfN1s3M10gPQotewotICAgIDB4MDEwMywKLSAgICAweDEwMDMsCi0gICAgMHgwMDAxLAotICAgIDB4MDAwMSwKLSAgICAweDAwMDEsCi0gICAgMHgwMDAxLAotICAgIDB4MTIwNiwKLSAgICAweDIxMDUsCi0gICAgMHgyMTA1LAotICAgIDB4MDIwNiwKLSAgICAweDIwMDYsCi0gICAgMHgxMTA0LAotICAgIDB4MTEwNCwKLSAgICAweDExMDQsCi0gICAgMHgxMTA0LAotICAgIDB4MzUwOSwKLSAgICAweDQ0MDksCi0gICAgMHgyNTA5LAotICAgIDB4NTIwOSwKLSAgICAweDE1MDgsCi0gICAgMHgxNTA4LAotICAgIDB4NTEwOCwKLSAgICAweDUxMDgsCi0gICAgMHgwNTA5LAotICAgIDB4MzQwOSwKLSAgICAweDUwMDgsCi0gICAgMHg1MDA4LAotICAgIDB4NDMwOSwKLSAgICAweDMzMDksCi0gICAgMHgyNDA4LAotICAgIDB4MjQwOCwKLSAgICAweDQyMDgsCi0gICAgMHg0MjA4LAotICAgIDB4MTQwNywKLSAgICAweDE0MDcsCi0gICAgMHgxNDA3LAotICAgIDB4MTQwNywKLSAgICAweDQxMDcsCi0gICAgMHg0MTA3LAotICAgIDB4NDEwNywKLSAgICAweDQxMDcsCi0gICAgMHg0MDA3LAotICAgIDB4NDAwNywKLSAgICAweDQwMDcsCi0gICAgMHg0MDA3LAotICAgIDB4MDQwOCwKLSAgICAweDA0MDgsCi0gICAgMHgyMzA4LAotICAgIDB4MjMwOCwKLSAgICAweDMyMDgsCi0gICAgMHgzMjA4LAotICAgIDB4MDMwOCwKLSAgICAweDAzMDgsCi0gICAgMHgxMzA3LAotICAgIDB4MTMwNywKLSAgICAweDEzMDcsCi0gICAgMHgxMzA3LAotICAgIDB4MzEwNywKLSAgICAweDMxMDcsCi0gICAgMHgzMTA3LAotICAgIDB4MzEwNywKLSAgICAweDMwMDcsCi0gICAgMHgzMDA3LAotICAgIDB4MzAwNywKLSAgICAweDMwMDcsCi0gICAgMHgyMjA3LAotICAgIDB4MjIwNywKLSAgICAweDIyMDcsCi0gICAgMHgyMjA3LAotICAgIDB4NTUwYSwKLSAgICAweDQ1MGEsCi0gICAgMHg1NDBhLAotICAgIDB4NTMwYQotfTsKLQotY29uc3QgdWludDE2IGh1ZmZUYWJsZV84WzY2XSA9Ci17Ci0gICAgMHgxMjA0LAotICAgIDB4MjEwNCwKLSAgICAweDExMDIsCi0gICAgMHgxMTAyLAotICAgIDB4MTEwMiwKLSAgICAweDExMDIsCi0gICAgMHgwMTAzLAotICAgIDB4MDEwMywKLSAgICAweDEwMDMsCi0gICAgMHgxMDAzLAotICAgIDB4MDAwMiwKLSAgICAweDAwMDIsCi0gICAgMHgwMDAyLAotICAgIDB4MDAwMiwKLSAgICAweDIyMDYsCi0gICAgMHgwMjA2LAotICAgIDB4MjAwNiwKLSAgICAweDI1MDksCi0gICAgMHg1MjA5LAotICAgIDB4MDUwOSwKLSAgICAweDE1MDgsCi0gICAgMHgxNTA4LAotICAgIDB4NTEwOCwKLSAgICAweDUxMDgsCi0gICAgMHgzNDA5LAotICAgIDB4NDMwOSwKLSAgICAweDUwMDksCi0gICAgMHgzMzA5LAotICAgIDB4MjQwOCwKLSAgICAweDI0MDgsCi0gICAgMHg0MjA4LAotICAgIDB4NDIwOCwKLSAgICAweDE0MDgsCi0gICAgMHgxNDA4LAotICAgIDB4NDEwNywKLSAgICAweDQxMDcsCi0gICAgMHg0MTA3LAotICAgIDB4NDEwNywKLSAgICAweDA0MDgsCi0gICAgMHgwNDA4LAotICAgIDB4NDAwOCwKLSAgICAweDQwMDgsCi0gICAgMHgyMzA4LAotICAgIDB4MjMwOCwKLSAgICAweDMyMDgsCi0gICAgMHgzMjA4LAotICAgIDB4MTMwOCwKLSAgICAweDEzMDgsCi0gICAgMHgzMTA4LAotICAgIDB4MzEwOCwKLSAgICAweDAzMDgsCi0gICAgMHgwMzA4LAotICAgIDB4MzAwOCwKLSAgICAweDMwMDgsCi0gICAgMHg1NTBiLAotICAgIDB4NTQwYiwKLSAgICAweDQ1MGEsCi0gICAgMHg0NTBhLAotICAgIDB4NTMwOSwKLSAgICAweDUzMDksCi0gICAgMHg1MzA5LAotICAgIDB4NTMwOSwKLSAgICAweDM1MGEsCi0gICAgMHgzNTBhLAotICAgIDB4NDQwYSwKLSAgICAweDQ0MGEKLQotfTsKLQotCi1jb25zdCB1aW50MTYgaHVmZlRhYmxlXzlbNTNdID0KLXsKLSAgICAweDEyMDQsCi0gICAgMHgyMTA0LAotICAgIDB4MjAwNCwKLSAgICAweDExMDMsCi0gICAgMHgxMTAzLAotICAgIDB4MDEwMywKLSAgICAweDAxMDMsCi0gICAgMHgxMDAzLAotICAgIDB4MTAwMywKLSAgICAweDAwMDMsCi0gICAgMHgwMDAzLAotICAgIDB4MTQwNiwKLSAgICAweDQxMDYsCi0gICAgMHgyMzA2LAotICAgIDB4MzIwNiwKLSAgICAweDEzMDUsCi0gICAgMHgxMzA1LAotICAgIDB4MzEwNSwKLSAgICAweDMxMDUsCi0gICAgMHgwMzA2LAotICAgIDB4MzAwNiwKLSAgICAweDIyMDUsCi0gICAgMHgyMjA1LAotICAgIDB4MDIwNSwKLSAgICAweDAyMDUsCi0gICAgMHg0NDA4LAotICAgIDB4MjUwOCwKLSAgICAweDUyMDgsCi0gICAgMHgxNTA4LAotICAgIDB4NTEwNywKLSAgICAweDUxMDcsCi0gICAgMHgzNDA3LAotICAgIDB4MzQwNywKLSAgICAweDQzMDcsCi0gICAgMHg0MzA3LAotICAgIDB4NTAwOCwKLSAgICAweDA0MDgsCi0gICAgMHgyNDA3LAotICAgIDB4MjQwNywKLSAgICAweDQyMDcsCi0gICAgMHg0MjA3LAotICAgIDB4MzMwNywKLSAgICAweDMzMDcsCi0gICAgMHg0MDA3LAotICAgIDB4NDAwNywKLSAgICAweDU1MDksCi0gICAgMHg0NTA5LAotICAgIDB4MzUwOCwKLSAgICAweDM1MDgsCi0gICAgMHg1MzA4LAotICAgIDB4NTMwOCwKLSAgICAweDU0MDksCi0gICAgMHgwNTA5Ci0KLX07Ci0KLQotY29uc3QgdWludDE2IGh1ZmZUYWJsZV8xMFs5Nl0gPQotewotICAgIDB4MDAwMSwKLSAgICAweDExMDQsCi0gICAgMHgwMTAzLAotICAgIDB4MDEwMywKLSAgICAweDEwMDMsCi0gICAgMHgxMDAzLAotICAgIDB4MTIwNiwKLSAgICAweDIxMDYsCi0gICAgMHgwMjA2LAotICAgIDB4MjAwNiwKLSAgICAweDE0MDgsCi0gICAgMHg0MTA4LAotICAgIDB4NDAwOCwKLSAgICAweDIzMDgsCi0gICAgMHgzMjA4LAotICAgIDB4MDMwOCwKLSAgICAweDEzMDcsCi0gICAgMHgxMzA3LAotICAgIDB4MzEwNywKLSAgICAweDMxMDcsCi0gICAgMHgzMDA3LAotICAgIDB4MzAwNywKLSAgICAweDIyMDcsCi0gICAgMHgyMjA3LAotICAgIDB4MTYwOCwKLSAgICAweDE2MDgsCi0gICAgMHg2MTA4LAotICAgIDB4NjEwOCwKLSAgICAweDYwMDgsCi0gICAgMHg2MDA4LAotICAgIDB4MDUwOSwKLSAgICAweDUwMDksCi0gICAgMHgyNDA5LAotICAgIDB4NDIwOSwKLSAgICAweDMzMDksCi0gICAgMHgwNDA5LAotICAgIDB4MjcwOSwKLSAgICAweDI3MDksCi0gICAgMHg3MjA5LAotICAgIDB4NzIwOSwKLSAgICAweDY0MGEsCi0gICAgMHgwNzBhLAotICAgIDB4NzAwOSwKLSAgICAweDcwMDksCi0gICAgMHg2MjA5LAotICAgIDB4NjIwOSwKLSAgICAweDQ1MGEsCi0gICAgMHgzNTBhLAotICAgIDB4MDYwOSwKLSAgICAweDA2MDksCi0gICAgMHg1MzBhLAotICAgIDB4NDQwYSwKLSAgICAweDE3MDgsCi0gICAgMHgxNzA4LAotICAgIDB4MTcwOCwKLSAgICAweDE3MDgsCi0gICAgMHg3MTA4LAotICAgIDB4NzEwOCwKLSAgICAweDcxMDgsCi0gICAgMHg3MTA4LAotICAgIDB4MzYwOSwKLSAgICAweDM2MDksCi0gICAgMHgyNjA5LAotICAgIDB4MjYwOSwKLSAgICAweDI1MGEsCi0gICAgMHg1MjBhLAotICAgIDB4MTUwOSwKLSAgICAweDE1MDksCi0gICAgMHg1MTA5LAotICAgIDB4NTEwOSwKLSAgICAweDM0MGEsCi0gICAgMHg0MzBhLAotICAgIDB4NzcwYiwKLSAgICAweDY3MGIsCi0gICAgMHg3NjBiLAotICAgIDB4NTcwYiwKLSAgICAweDc1MGIsCi0gICAgMHg2NjBiLAotICAgIDB4NDcwYSwKLSAgICAweDQ3MGEsCi0gICAgMHg3NDBhLAotICAgIDB4NzQwYSwKLSAgICAweDU2MGEsCi0gICAgMHg1NjBhLAotICAgIDB4NjUwYSwKLSAgICAweDY1MGEsCi0gICAgMHgzNzBhLAotICAgIDB4MzcwYSwKLSAgICAweDczMGEsCi0gICAgMHg3MzBhLAotICAgIDB4NDYwYSwKLSAgICAweDQ2MGEsCi0gICAgMHg1NTBiLAotICAgIDB4NTQwYiwKLSAgICAweDYzMGEsCi0gICAgMHg2MzBhCi19OwotCi0KLWNvbnN0IHVpbnQxNiBodWZmVGFibGVfMTFbMTE2XSA9Ci17Ci0gICAgMHgxMTAzLAotICAgIDB4MDEwMywKLSAgICAweDEwMDMsCi0gICAgMHgwMDAyLAotICAgIDB4MDAwMiwKLSAgICAweDIxMDUsCi0gICAgMHgxMjA0LCAgICAgLyogIDAxMDAgICAgICAgICAqLwotICAgIDB4MTIwNCwgICAgIC8qICAwMTAgICAgICAgICAqLwotICAgIDB4MDIwNSwgICAgIC8qICAwMTAxMCAgICAgICAgKi8KLSAgICAweDIwMDUsICAgICAvKiAgMDEwMTEgICAgICAgICovCi0gICAgMHgxNDA4LCAgICAgLyogICAgICAxMCAqLwotICAgIDB4NDEwOCwgICAgIC8qICAgMDAgICAgICAqLwotICAgIDB4MDQwOCwgICAgIC8qICAgMCAwICAgICAqLwotICAgIDB4NDAwOCwgICAgIC8qICAgMCAxICAgICAqLwotICAgIDB4MjMwNywgICAgIC8qICAgIDAgICAgICAqLwotICAgIDB4MjMwNywgICAgIC8qICAgICAgICAgICovCi0gICAgMHgzMjA3LCAgICAgLyogICAgMSAgICAgICovCi0gICAgMHgzMjA3LCAgICAgLyogICAgICAgICAgKi8KLSAgICAweDEzMDYsICAgICAvKiAgIDAxMCAgICAgICAqLwotICAgIDB4MTMwNiwgICAgIC8qICAgMDEgICAgICAgKi8KLSAgICAweDEzMDYsICAgICAvKiAgIDAxICAgICAgICovCi0gICAgMHgxMzA2LCAgICAgLyogICAwMSAgICAgICAqLwotICAgIDB4MzEwNiwgICAgIC8qICAgMDExICAgICAgICovCi0gICAgMHgzMTA2LCAgICAgLyogICAwMSAgICAgICovCi0gICAgMHgzMTA2LCAgICAgLyogICAwMSAgICAgICovCi0gICAgMHgzMTA2LCAgICAgLyogICAwMSAgICAgICovCi0gICAgMHgwMzA3LCAgICAgLyogICAxMDAwICAgICAgKi8KLSAgICAweDAzMDcsICAgICAvKiAgIDEwMCAgICAgICovCi0gICAgMHgzMDA3LCAgICAgLyogICAxICAgICAgICovCi0gICAgMHgzMDA3LCAgICAgLyogICAxMDAgICAgICAqLwotICAgIDB4MjIwNiwgICAgIC8qICAgMTAxICAgICAgICovCi0gICAgMHgyMjA2LCAgICAgLyogICAxMCAgICAgICovCi0gICAgMHgyMjA2LCAgICAgLyogICAxMCAgICAgICovCi0gICAgMHgyMjA2LCAgICAgLyogICAxMCAgICAgICovCi0gICAgMHgyNzA4LAotICAgIDB4MjcwOCwgICAgIC8qICAwMDAgMCAgICAgKi8KLSAgICAweDcyMDgsICAgICAvKiAgMDAwIDEwICAgICAqLwotICAgIDB4NzIwOCwgICAgIC8qICAwMDAgMSAgICAgKi8KLSAgICAweDY0MDksICAgICAvKiAgMDAwIDExMCAgICAqLwotICAgIDB4MDcwOSwKLSAgICAweDcxMDcsCi0gICAgMHg3MTA3LAotICAgIDB4NzEwNywgICAgIC8qICAwMCAwICAgICAgKi8KLSAgICAweDcxMDcsICAgICAvKiAgMDAgMCAgICAgICovCi0gICAgMHgxNzA4LAotICAgIDB4MTcwOCwgICAgIC8qICAwMCAwMSAgICAgKi8KLSAgICAweDcwMDgsCi0gICAgMHg3MDA4LAotICAgIDB4MzYwOCwKLSAgICAweDM2MDgsICAgICAvKiAgMDAgMTAgICAgICovCi0gICAgMHg2MzA4LCAgICAgLyogIDAwIDEwMSAgICAgKi8KLSAgICAweDYzMDgsICAgICAvKiAgMDAgMTAgICAgICovCi0gICAgMHg2MDA4LAotICAgIDB4NjAwOCwgICAgIC8qICAwMCAxMSAgICAgKi8KLSAgICAweDQ0MDksCi0gICAgMHgyNTA5LAotICAgIDB4NTIwOSwgICAgIC8qICAwICAgICAgKi8KLSAgICAweDA1MDksICAgICAvKiAgMCAwMCAgICAgKi8KLSAgICAweDE1MDgsICAgICAvKiAgMCAwICAgICAgKi8KLSAgICAweDE1MDgsICAgICAvKiAgMCAwMDAgICAgICovCi0gICAgMHg2MjA3LCAgICAgLyogIDAgICAgICAgICovCi0gICAgMHg2MjA3LCAgICAgLyogIDAgMDAgICAgICovCi0gICAgMHg2MjA3LCAgICAgLyogIDAgMDAgICAgICovCi0gICAgMHg2MjA3LCAgICAgLyogIDAgMDAgICAgICovCi0gICAgMHgyNjA4LAotICAgIDB4MjYwOCwgICAgIC8qICAwIDAxMCAgICAgKi8KLSAgICAweDA2MDgsCi0gICAgMHgwNjA4LAotICAgIDB4MTYwNywKLSAgICAweDE2MDcsCi0gICAgMHgxNjA3LAotICAgIDB4MTYwNywKLSAgICAweDYxMDcsCi0gICAgMHg2MTA3LAotICAgIDB4NjEwNywKLSAgICAweDYxMDcsCi0gICAgMHg1MTA4LAotICAgIDB4NTEwOCwKLSAgICAweDM0MDgsCi0gICAgMHgzNDA4LAotICAgIDB4NTAwOCwKLSAgICAweDUwMDgsCi0gICAgMHg0MzA5LAotICAgIDB4MzMwOSwKLSAgICAweDI0MDgsCi0gICAgMHgyNDA4LCAgICAgLyogIDAgMTExICAgICAqLwotICAgIDB4NDIwOCwgICAgIC8qICAwIDExMTEgICAgICovCi0gICAgMHg0MjA4LCAgICAgLyogIDAgMTExICAgICAqLwotICAgIDB4NTYwYSwKLSAgICAweDY1MGEsCi0gICAgMHgzNzA5LAotICAgIDB4MzcwOSwKLSAgICAweDczMDksCi0gICAgMHg3MzA5LAotICAgIDB4NDYwOSwKLSAgICAweDQ2MDksCi0gICAgMHg0NTBhLAotICAgIDB4NTQwYSwgICAgIC8qICAwMDAgMCAgICAqLwotICAgIDB4MzUwYSwgICAgIC8qICAwMDAgIDAgICAqLwotICAgIDB4NTMwYSwgICAgIC8qICAwMDAgIDEgICAqLwotICAgIDB4NzcwYSwKLSAgICAweDc3MGEsCi0gICAgMHg2NzBhLAotICAgIDB4NjcwYSwKLSAgICAweDc2MGEsICAgICAvKiAgICAwICAgKi8KLSAgICAweDc2MGEsICAgICAvKiAgICAgICAqLwotICAgIDB4NzUwYSwgICAgIC8qICAgIDEgICAqLwotICAgIDB4NzUwYSwgICAgIC8qICAgICAgICovCi0gICAgMHg2NjBhLCAgICAgLyogICAgMDAgICAqLwotICAgIDB4NjYwYSwgICAgIC8qICAgIDAgICAqLwotICAgIDB4NDcwYSwgICAgIC8qICAgIDAxICAgKi8KLSAgICAweDQ3MGEsICAgICAvKiAgICAwICAgKi8KLSAgICAweDc0MGEsICAgICAvKiAgICAxMCAgICovCi0gICAgMHg3NDBhLCAgICAgLyogICAgMSAgICovCi0gICAgMHg1NzBiLCAgICAgLyogICAgMTEwICAqLwotICAgIDB4NTUwYiAgLyogICAgMTExICAqLwotCi19OwotCi1jb25zdCB1aW50MTYgaHVmZlRhYmxlXzEyWzEzNF0gPQotewotCi0gICAgMHgxMTAzLCAgICAgLyogIDEwMSAgICAgICAgICAqLwotICAgIDB4MDEwMywgICAgIC8qICAxMTAgICAgICAgICAgKi8KLSAgICAweDEwMDMsICAgICAvKiAgMTExICAgICAgICAgICovCi0gICAgMHgxMjA0LAotICAgIDB4MTIwNCwgICAgIC8qICAwMTEgICAgICAgICAqLwotICAgIDB4MjEwNCwgICAgIC8qICAwMTExICAgICAgICAgKi8KLSAgICAweDIxMDQsICAgICAvKiAgMDExICAgICAgICAgKi8KLSAgICAweDAyMDUsICAgICAvKiAgMTAwMDAgICAgICAgICovCi0gICAgMHgyMDA1LCAgICAgLyogIDEwICAgICAgICAgKi8KLSAgICAweDAwMDQsICAgICAvKiAgMSAgICAgICAgICAqLwotICAgIDB4MDAwNCwgICAgIC8qICAxMDAgICAgICAgICAqLwotICAgIDB4MzAwNiwKLSAgICAweDEzMDUsICAgICAvKiAgMDEgICAgICAgICAqLwotICAgIDB4MTMwNSwgICAgIC8qICAwMTAwICAgICAgICAqLwotICAgIDB4MzEwNSwKLSAgICAweDMxMDUsCi0gICAgMHgyMjA1LAotICAgIDB4MjIwNSwgICAgIC8qICAwMTAxICAgICAgICAqLwotICAgIDB4MTUwNywKLSAgICAweDE1MDcsICAgICAvKiAgIDAwMCAgICAgICovCi0gICAgMHg1MTA3LCAgICAgLyogICAwICAgICAgICovCi0gICAgMHg1MTA3LCAgICAgLyogICAwMDAgICAgICAqLwotICAgIDB4MzQwNywgICAgIC8qICAgIDAgICAgICAqLwotICAgIDB4MzQwNywgICAgIC8qICAgICAgICAgICovCi0gICAgMHg0MzA3LCAgICAgLyogICAgMSAgICAgICovCi0gICAgMHg0MzA3LCAgICAgLyogICAgICAgICAgKi8KLSAgICAweDUwMDgsCi0gICAgMHgwNDA4LAotICAgIDB4MjQwNywKLSAgICAweDI0MDcsICAgICAvKiAgIDAxMCAgICAgICovCi0gICAgMHg0MjA3LAotICAgIDB4NDIwNywKLSAgICAweDE0MDcsICAgICAvKiAgIDAxMTEgICAgICAqLwotICAgIDB4MTQwNywgICAgIC8qICAgMDExICAgICAgKi8KLSAgICAweDMzMDYsCi0gICAgMHgzMzA2LAotICAgIDB4MzMwNiwKLSAgICAweDMzMDYsCi0gICAgMHg0MTA2LAotICAgIDB4NDEwNiwKLSAgICAweDQxMDYsCi0gICAgMHg0MTA2LAotICAgIDB4MjMwNiwKLSAgICAweDIzMDYsCi0gICAgMHgyMzA2LAotICAgIDB4MjMwNiwKLSAgICAweDMyMDYsCi0gICAgMHgzMjA2LAotICAgIDB4MzIwNiwKLSAgICAweDMyMDYsCi0gICAgMHg0MDA3LAotICAgIDB4NDAwNywKLSAgICAweDAzMDcsCi0gICAgMHgwMzA3LCAgICAgLyogIDAxMDAwMCAgICAgICovCi0gICAgMHg3MjA4LAotICAgIDB4NzIwOCwgICAgIC8qICAwMCAwMCAgICAgKi8KLSAgICAweDQ2MDgsICAgICAvKiAgMDAgICAgICAgKi8KLSAgICAweDQ2MDgsICAgICAvKiAgMDAgMDAgICAgICovCi0gICAgMHg2NDA4LAotICAgIDB4NjQwOCwgICAgIC8qICAwMCAwMSAgICAgKi8KLSAgICAweDE3MDgsICAgICAvKiAgMDAgMDExICAgICAqLwotICAgIDB4MTcwOCwKLSAgICAweDcxMDgsICAgICAvKiAgMDAgMTAwICAgICAqLwotICAgIDB4NzEwOCwKLSAgICAweDA3MDksCi0gICAgMHg3MDA5LAotICAgIDB4MzYwOCwKLSAgICAweDM2MDgsICAgICAvKiAgMDAgMTEgICAgICovCi0gICAgMHg2MzA4LAotICAgIDB4NjMwOCwKLSAgICAweDQ1MDgsCi0gICAgMHg0NTA4LAotICAgIDB4NTQwOCwgICAgIC8qICAwIDAgICAgICAqLwotICAgIDB4NTQwOCwgICAgIC8qICAwIDAwMCAgICAgKi8KLSAgICAweDQ0MDgsICAgICAvKiAgMCAgMCAgICAgKi8KLSAgICAweDQ0MDgsICAgICAvKiAgMCAgICAgICAqLwotICAgIDB4MDYwOSwgICAgIC8qICAwICAxMCAgICAqLwotICAgIDB4MDUwOSwgICAgIC8qICAwICAxMSAgICAqLwotICAgIDB4MjYwNywKLSAgICAweDI2MDcsCi0gICAgMHgyNjA3LAotICAgIDB4MjYwNywKLSAgICAweDYyMDcsCi0gICAgMHg2MjA3LAotICAgIDB4NjIwNywKLSAgICAweDYyMDcsCi0gICAgMHg2MTA3LAotICAgIDB4NjEwNywKLSAgICAweDYxMDcsCi0gICAgMHg2MTA3LAotICAgIDB4MTYwOCwgICAgIC8qICAwIDEwMTAgICAgICovCi0gICAgMHgxNjA4LCAgICAgLyogIDAgMTAxICAgICAqLwotICAgIDB4NjAwOCwgICAgIC8qICAwIDEwMTEgICAgICovCi0gICAgMHg2MDA4LCAgICAgLyogIDAgMTAxICAgICAqLwotICAgIDB4MzUwOCwKLSAgICAweDM1MDgsICAgICAvKiAgMCAxMTAgICAgICovCi0gICAgMHg1MzA4LCAgICAgLyogIDAgMTEwMSAgICAgKi8KLSAgICAweDUzMDgsICAgICAvKiAgMCAxMTAgICAgICovCi0gICAgMHgyNTA4LAotICAgIDB4MjUwOCwgICAgIC8qICAwIDExMSAgICAgKi8KLSAgICAweDUyMDgsICAgICAvKiAgMCAxMTExICAgICAqLwotICAgIDB4NTIwOCwgICAgIC8qICAwIDExMSAgICAgKi8KLSAgICAweDc3MGEsCi0gICAgMHg2NzBhLAotICAgIDB4NzYwOSwgICAgIC8qICAgICAgICAqLwotICAgIDB4NzYwOSwKLSAgICAweDU3MDksICAgICAvKiAgICAwICAgICovCi0gICAgMHg1NzA5LCAgICAgLyogICAgICAgICovCi0gICAgMHg3NTA5LCAgICAgLyogICAgMSAgICAqLwotICAgIDB4NzUwOSwgICAgIC8qICAgICAgICAqLwotICAgIDB4NjYwOSwKLSAgICAweDY2MDksCi0gICAgMHg0NzA5LCAgICAgLyogIDAwMDAgMDEgICAgKi8KLSAgICAweDQ3MDksICAgICAvKiAgMDAwMCAwICAgICovCi0gICAgMHg3NDA5LAotICAgIDB4NzQwOSwgICAgIC8qICAwMDAwIDEgICAgKi8KLSAgICAweDY1MDksCi0gICAgMHg2NTA5LCAgICAgLyogIDAwMDAgMSAgICAqLwotICAgIDB4NTYwOCwKLSAgICAweDU2MDgsCi0gICAgMHg1NjA4LAotICAgIDB4NTYwOCwKLSAgICAweDM3MDgsCi0gICAgMHgzNzA4LAotICAgIDB4MzcwOCwKLSAgICAweDM3MDgsCi0gICAgMHg3MzA5LCAgICAgLyogIDAwMCAxMDAgICAgKi8KLSAgICAweDczMDksICAgICAvKiAgMDAwIDEwICAgICovCi0gICAgMHg1NTA5LAotICAgIDB4NTUwOSwgICAgIC8qICAwMDAgMTAgICAgKi8KLSAgICAweDI3MDgsCi0gICAgMHgyNzA4LAotICAgIDB4MjcwOCwKLSAgICAweDI3MDgsCi19OwotCi0KLQotY29uc3QgdWludDE2IGh1ZmZUYWJsZV8xM1s0OTFdID0KLXsKLSAgICAweDAwMDEsCi0gICAgMHgxMTA0LAotICAgIDB4MDEwNCwKLSAgICAweDEwMDMsCi0gICAgMHgxMDAzLAotICAgIDB4NDEwNywKLSAgICAweDQxMDcsCi0gICAgMHgwNDA4LAotICAgIDB4NDAwOCwKLSAgICAweDIzMDgsCi0gICAgMHgzMjA4LAotICAgIDB4MTMwNywKLSAgICAweDEzMDcsCi0gICAgMHgzMTA3LAotICAgIDB4MzEwNywKLSAgICAweDAzMDcsCi0gICAgMHgwMzA3LAotICAgIDB4MzAwNywKLSAgICAweDMwMDcsCi0gICAgMHgyMjA3LAotICAgIDB4MjIwNywKLSAgICAweDEyMDYsCi0gICAgMHgxMjA2LAotICAgIDB4MTIwNiwKLSAgICAweDEyMDYsCi0gICAgMHgyMTA2LAotICAgIDB4MjEwNiwKLSAgICAweDIxMDYsCi0gICAgMHgyMTA2LAotICAgIDB4MDIwNiwKLSAgICAweDAyMDYsCi0gICAgMHgwMjA2LAotICAgIDB4MDIwNiwKLSAgICAweDIwMDYsCi0gICAgMHgyMDA2LAotICAgIDB4MjAwNiwKLSAgICAweDIwMDYsCi0gICAgMHgzNzBhLAotICAgIDB4MjcwYSwgICAgIC8qICAwIDAwMCAgICAgICAgICAgKi8KLSAgICAweDE3MDksICAgICAvKiAgMCAwMCAgICAgICAgICAgICovCi0gICAgMHgxNzA5LAotICAgIDB4NzEwOSwKLSAgICAweDcxMDksICAgICAvKiAgMCAwICAgICAgICAgICAgKi8KLSAgICAweDU1MGEsCi0gICAgMHgwNzBhLCAgICAgLyogIDAgMCAxMSAgICAgICAgICAqLwotICAgIDB4NzAwYSwKLSAgICAweDM2MGEsICAgICAvKiAgMCAgICAgICAgICAgICAqLwotICAgIDB4NjMwYSwKLSAgICAweDQ1MGEsICAgICAvKiAgMCAgMDExICAgICAgICAgICovCi0gICAgMHg1NDBhLAotICAgIDB4MjYwYSwgICAgIC8qICAwICAxMDEgICAgICAgICAgKi8KLSAgICAweDYyMGEsCi0gICAgMHgzNTBhLCAgICAgLyogIDAgIDExMSAgICAgICAgICAqLwotICAgIDB4ODEwOCwKLSAgICAweDgxMDgsICAgICAvKiAgMCAwMTAgICAgICAgICAgICAqLwotICAgIDB4ODEwOCwKLSAgICAweDgxMDgsICAgICAvKiAgMCAwMTAgICAgICAgICAgICAqLwotICAgIDB4MDgwOSwKLSAgICAweDA4MDksICAgICAvKiAgMCAwMTAxICAgICAgICAgICAqLwotICAgIDB4ODAwOSwKLSAgICAweDgwMDksICAgICAvKiAgMCAwMTAxICAgICAgICAgICAqLwotICAgIDB4MTYwOSwKLSAgICAweDE2MDksICAgICAvKiAgMCAwMTEwICAgICAgICAgICAqLwotICAgIDB4NjEwOSwKLSAgICAweDYxMDksICAgICAvKiAgMCAwMTEwICAgICAgICAgICAqLwotICAgIDB4MDYwOSwKLSAgICAweDA2MDksICAgICAvKiAgMCAwMTExICAgICAgICAgICAqLwotICAgIDB4NjAwOSwKLSAgICAweDYwMDksICAgICAvKiAgMCAwMTExICAgICAgICAgICAqLwotICAgIDB4NTMwYSwKLSAgICAweDQ0MGEsICAgICAvKiAgMCAxMDAgICAgICAgICAgICovCi0gICAgMHgyNTA5LAotICAgIDB4MjUwOSwgICAgIC8qICAwIDEwMDAgICAgICAgICAgICovCi0gICAgMHg1MjA5LAotICAgIDB4NTIwOSwgICAgIC8qICAwIDEgICAgICAgICAgICAqLwotICAgIDB4MDUwOSwKLSAgICAweDA1MDksICAgICAvKiAgMCAxICAgICAgICAgICAgKi8KLSAgICAweDE1MDgsCi0gICAgMHgxNTA4LCAgICAgLyogIDAgMTAxICAgICAgICAgICAgKi8KLSAgICAweDE1MDgsCi0gICAgMHgxNTA4LCAgICAgLyogIDAgMTAxICAgICAgICAgICAgKi8KLSAgICAweDUxMDgsCi0gICAgMHg1MTA4LCAgICAgLyogIDAgMTAxICAgICAgICAgICAqLwotICAgIDB4NTEwOCwKLSAgICAweDUxMDgsICAgICAvKiAgMCAxMDEgICAgICAgICAgICovCi0gICAgMHgzNDA5LAotICAgIDB4MzQwOSwgICAgIC8qICAwIDExMDAgICAgICAgICAgICovCi0gICAgMHg0MzA5LAotICAgIDB4NDMwOSwgICAgIC8qICAwIDExMDAgICAgICAgICAgICovCi0gICAgMHg1MDA5LAotICAgIDB4NTAwOSwgICAgIC8qICAwIDExMDEgICAgICAgICAgICovCi0gICAgMHgyNDA5LAotICAgIDB4MjQwOSwgICAgIC8qICAwIDExMDEgICAgICAgICAgICovCi0gICAgMHg0MjA5LAotICAgIDB4NDIwOSwgICAgIC8qICAwIDExMTAgICAgICAgICAgICovCi0gICAgMHgzMzA5LAotICAgIDB4MzMwOSwgICAgIC8qICAwIDExMTAgICAgICAgICAgICovCi0gICAgMHgxNDA4LAotICAgIDB4MTQwOCwgICAgIC8qICAwIDExMSAgICAgICAgICAgKi8KLSAgICAweDE0MDgsCi0gICAgMHgxNDA4LCAgICAgLyogIDAgMTExICAgICAgICAgICAqLwotICAgIDB4MWEwYSwKLSAgICAweDFhMGEsCi0gICAgMHhhMTBhLCAgICAgLyogIDAwIDAwICAgICAgICAgICAqLwotICAgIDB4YTEwYSwKLSAgICAweDBhMGIsCi0gICAgMHg2ODBiLAotICAgIDB4YTAwYSwKLSAgICAweGEwMGEsCi0gICAgMHg4NjBiLAotICAgIDB4NDkwYiwKLSAgICAweDkzMGEsCi0gICAgMHg5MzBhLAotICAgIDB4MzkwYiwKLSAgICAweDU4MGIsCi0gICAgMHg4NTBiLAotICAgIDB4NjcwYiwKLSAgICAweDI5MGEsCi0gICAgMHgyOTBhLAotICAgIDB4OTIwYSwKLSAgICAweDkyMGEsCi0gICAgMHg1NzBiLAotICAgIDB4NzUwYiwKLSAgICAweDM4MGEsCi0gICAgMHgzODBhLAotICAgIDB4ODMwYSwKLSAgICAweDgzMGEsCi0gICAgMHg2NjBiLAotICAgIDB4NDcwYiwKLSAgICAweDc0MGIsCi0gICAgMHg1NjBiLAotICAgIDB4NjUwYiwKLSAgICAweDczMGIsCi0gICAgMHgxOTA5LAotICAgIDB4MTkwOSwKLSAgICAweDE5MDksCi0gICAgMHgxOTA5LAotICAgIDB4OTEwOSwKLSAgICAweDkxMDksCi0gICAgMHg5MTA5LAotICAgIDB4OTEwOSwKLSAgICAweDA5MGEsICAgICAvKiAgMDAgMTAxMDAgICAgICAgICAgKi8KLSAgICAweDA5MGEsCi0gICAgMHg5MDBhLCAgICAgLyogIDAwIDEwMTAxICAgICAgICAgICovCi0gICAgMHg5MDBhLAotICAgIDB4NDgwYSwgICAgIC8qICAwMCAxMDExMCAgICAgICAgICAqLwotICAgIDB4NDgwYSwKLSAgICAweDg0MGEsICAgICAvKiAgMDAgMTAxMTEgICAgICAgICAgKi8KLSAgICAweDg0MGEsCi0gICAgMHg3MjBhLCAgICAgLyogIDAwIDExMDAwICAgICAgICAgICovCi0gICAgMHg3MjBhLAotICAgIDB4NDYwYiwgICAgIC8qICAwMCAxMSAwICAgICAgICAgKi8KLSAgICAweDY0MGIsCi0gICAgMHgyODA5LAotICAgIDB4MjgwOSwKLSAgICAweDI4MDksCi0gICAgMHgyODA5LAotICAgIDB4ODIwOSwKLSAgICAweDgyMDksCi0gICAgMHg4MjA5LAotICAgIDB4ODIwOSwKLSAgICAweDE4MDksCi0gICAgMHgxODA5LAotICAgIDB4MTgwOSwKLSAgICAweDE4MDksCi0gICAgMHhjMTBiLAotICAgIDB4YzEwYiwgICAgIC8qICAwMDAgMDAwMCAgICAgICAgICovCi0gICAgMHg5ODBjLAotICAgIDB4MGMwYywgICAgIC8qICAwMDAgMDAgMSAgICAgICAgKi8KLSAgICAweGMwMGIsCi0gICAgMHhjMDBiLCAgICAgLyogIDAwMCAwICAgICAgICAgICovCi0gICAgMHhiNDBjLAotICAgIDB4NmEwYywgICAgIC8qICAwMDAgMCAxMSAgICAgICAgKi8KLSAgICAweGE2MGMsCi0gICAgMHg3OTBjLCAgICAgLyogIDAwMCAgICAgICAgICAgKi8KLSAgICAweDNiMGIsCi0gICAgMHgzYjBiLCAgICAgLyogIDAwMCAgMCAgICAgICAgICovCi0gICAgMHhiMzBiLAotICAgIDB4YjMwYiwgICAgIC8qICAwMDAgIDEgICAgICAgICAqLwotICAgIDB4ODgwYywKLSAgICAweDVhMGMsICAgICAvKiAgMDAwICAxMTEgICAgICAgICovCi0gICAgMHgyYjBiLAotICAgIDB4MmIwYiwgICAgIC8qICAwMDAgMDEwMCAgICAgICAgICovCi0gICAgMHhhNTBjLAotICAgIDB4NjkwYywgICAgIC8qICAwMDAgMDEgMSAgICAgICAgKi8KLSAgICAweGE0MGIsCi0gICAgMHhhNDBiLCAgICAgLyogIDAwMCAwMTAxICAgICAgICAgKi8KLSAgICAweDc4MGMsCi0gICAgMHg4NzBjLAotICAgIDB4OTQwYiwKLSAgICAweDk0MGIsICAgICAvKiAgMDAwIDAxMTAgICAgICAgICAqLwotICAgIDB4NzcwYywKLSAgICAweDc2MGMsICAgICAvKiAgMDAwIDAxMTAxMSAgICAgICAgKi8KLSAgICAweGIyMGEsCi0gICAgMHhiMjBhLCAgICAgLyogIDAwMCAwMTEgICAgICAgICAqLwotICAgIDB4YjIwYSwKLSAgICAweGIyMGEsICAgICAvKiAgMDAwIDAxMSAgICAgICAgICovCi0gICAgMHgxYjBhLAotICAgIDB4MWIwYSwgICAgIC8qICAwMDAgMTAwICAgICAgICAgICovCi0gICAgMHgxYjBhLAotICAgIDB4MWIwYSwgICAgIC8qICAwMDAgMTAwICAgICAgICAgICovCi0gICAgMHhiMTBhLAotICAgIDB4YjEwYSwKLSAgICAweGIxMGEsICAgICAvKiAgMDAwIDEwMCAgICAgICAgICovCi0gICAgMHhiMTBhLCAgICAgLyogIDAwMCAxMDAgICAgICAgICAqLwotICAgIDB4MGIwYiwgICAgIC8qICAwMDAgMTAxMDAgICAgICAgICAqLwotICAgIDB4MGIwYiwgICAgIC8qICAwMDAgMTAxMCAgICAgICAgICovCi0gICAgMHhiMDBiLAotICAgIDB4YjAwYiwgICAgIC8qICAwMDAgMTAxMCAgICAgICAgICovCi0gICAgMHg5NjBiLCAgICAgLyogIDAwMCAxMDExMCAgICAgICAgICovCi0gICAgMHg5NjBiLCAgICAgLyogIDAwMCAxMDExICAgICAgICAgKi8KLSAgICAweDRhMGIsCi0gICAgMHg0YTBiLCAgICAgLyogIDAwMCAxMDExICAgICAgICAgKi8KLSAgICAweDNhMGIsICAgICAvKiAgMDAwIDExMDAwICAgICAgICAgKi8KLSAgICAweDNhMGIsICAgICAvKiAgMDAwIDExMDAgICAgICAgICAqLwotICAgIDB4YTMwYiwgICAgIC8qICAwMDAgMTEgICAgICAgICAgKi8KLSAgICAweGEzMGIsICAgICAvKiAgMDAwIDExMDAgICAgICAgICAqLwotICAgIDB4NTkwYiwKLSAgICAweDU5MGIsICAgICAvKiAgMDAwIDExMDEgICAgICAgICAqLwotICAgIDB4OTUwYiwgICAgIC8qICAwMDAgMTEwMTEgICAgICAgICAqLwotICAgIDB4OTUwYiwgICAgIC8qICAwMDAgMTEwMSAgICAgICAgICovCi0gICAgMHgyYTBhLAotICAgIDB4MmEwYSwKLSAgICAweDJhMGEsCi0gICAgMHgyYTBhLAotICAgIDB4YTIwYSwKLSAgICAweGEyMGEsCi0gICAgMHhhMjBhLAotICAgIDB4YTIwYSwKLSAgICAweGYwMGMsCi0gICAgMHhmMDBjLCAgICAgLyogICAgMDAwICAgICAgICAqLwotICAgIDB4YmEwZCwKLSAgICAweGU1MGQsICAgICAvKiAgICAwIDEgICAgICAgKi8KLSAgICAweGU0MGQsCi0gICAgMHg4YzBkLCAgICAgLyogICAgIDAxICAgICAgICovCi0gICAgMHg2ZDBkLAotICAgIDB4ZTMwZCwgICAgIC8qICAgICAxMSAgICAgICAqLwotICAgIDB4ZTIwYywgICAgIC8qICAgIDAxMDAgICAgICAgICovCi0gICAgMHhlMjBjLAotICAgIDB4MmUwZCwgICAgIC8qICAgIDAxMDEwICAgICAgICovCi0gICAgMHgwZTBkLAotICAgIDB4MWUwYywgICAgIC8qICAgIDAxMTAgICAgICAgICovCi0gICAgMHgxZTBjLAotICAgIDB4ZTEwYywgICAgIC8qICAgIDAxMTEgICAgICAgICovCi0gICAgMHhlMTBjLAotICAgIDB4ZTAwZCwgICAgIC8qICAgIDEwMDAwICAgICAgICovCi0gICAgMHg1ZDBkLAotICAgIDB4ZDUwZCwgICAgIC8qICAgIDEgMCAgICAgICAqLwotICAgIDB4N2MwZCwKLSAgICAweGM3MGQsCi0gICAgMHg0ZDBkLAotICAgIDB4OGIwZCwKLSAgICAweGI4MGQsCi0gICAgMHhkNDBkLAotICAgIDB4OWEwZCwKLSAgICAweGE5MGQsCi0gICAgMHg2YzBkLAotICAgIDB4YzYwYywKLSAgICAweGM2MGMsCi0gICAgMHgzZDBjLAotICAgIDB4M2QwYywgICAgIC8qICAgIDExMSAgICAgICAgKi8KLSAgICAweGQzMGQsICAgICAvKiAgMDAwMCAgICAgICAgICovCi0gICAgMHg3YjBkLAotICAgIDB4MmQwYywKLSAgICAweDJkMGMsCi0gICAgMHhkMjBjLAotICAgIDB4ZDIwYywKLSAgICAweDFkMGMsCi0gICAgMHgxZDBjLAotICAgIDB4YjcwYywKLSAgICAweGI3MGMsICAgICAvKiAgMDAwMCAgMCAgICAgICAgKi8KLSAgICAweDVjMGQsCi0gICAgMHhjNTBkLCAgICAgLyogIDAwMDAgIDAxMSAgICAgICAqLwotICAgIDB4OTkwZCwKLSAgICAweDdhMGQsCi0gICAgMHhjMzBjLAotICAgIDB4YzMwYywgICAgIC8qICAwMDAwICAxICAgICAgICAqLwotICAgIDB4YTcwZCwKLSAgICAweDk3MGQsCi0gICAgMHg0YjBjLAotICAgIDB4NGIwYywKLSAgICAweGQxMGIsCi0gICAgMHhkMTBiLAotICAgIDB4ZDEwYiwgICAgIC8qICAwMDAwIDAxMCAgICAgICAgKi8KLSAgICAweGQxMGIsCi0gICAgMHgwZDBjLAotICAgIDB4MGQwYywKLSAgICAweGQwMGMsCi0gICAgMHhkMDBjLAotICAgIDB4OGEwYywKLSAgICAweDhhMGMsCi0gICAgMHhhODBjLAotICAgIDB4YTgwYywKLSAgICAweDRjMGMsCi0gICAgMHg0YzBjLAotICAgIDB4YzQwYywKLSAgICAweGM0MGMsCi0gICAgMHg2YjBjLAotICAgIDB4NmIwYywgICAgIC8qICAwMDAwIDEgICAgICAgICAqLwotICAgIDB4YjYwYywgICAgIC8qICAwMDAwIDEgMSAgICAgICAgKi8KLSAgICAweGI2MGMsICAgICAvKiAgMDAwMCAxICAgICAgICAgKi8KLSAgICAweDNjMGIsCi0gICAgMHgzYzBiLAotICAgIDB4M2MwYiwKLSAgICAweDNjMGIsCi0gICAgMHgyYzBiLCAgICAgLyogIDAwMDAgMTAxMSAgICAgICAgICovCi0gICAgMHgyYzBiLCAgICAgLyogIDAwMDAgMTAxICAgICAgICAqLwotICAgIDB4MmMwYiwgICAgIC8qICAwMDAwIDEwMSAgICAgICAgKi8KLSAgICAweDJjMGIsICAgICAvKiAgMDAwMCAxMDEgICAgICAgICovCi0gICAgMHhjMjBiLAotICAgIDB4YzIwYiwKLSAgICAweGMyMGIsCi0gICAgMHhjMjBiLAotICAgIDB4NWIwYiwgICAgIC8qICAwMDAwIDExMDEgICAgICAgICAqLwotICAgIDB4NWIwYiwKLSAgICAweDViMGIsICAgICAvKiAgMDAwMCAxMTAgICAgICAgICovCi0gICAgMHg1YjBiLCAgICAgLyogIDAwMDAgMTEwICAgICAgICAqLwotICAgIDB4YjUwYywKLSAgICAweGI1MGMsCi0gICAgMHg4OTBjLAotICAgIDB4ODkwYywgICAgIC8qICAwMDAwIDExMTAgICAgICAgICovCi0gICAgMHgxYzBiLAotICAgIDB4MWMwYiwKLSAgICAweDFjMGIsCi0gICAgMHgxYzBiLAotICAgIDB4MmYwZCwKLSAgICAweDJmMGQsICAgICAvKiAgICAwMDAgICAgICAgKi8KLSAgICAweGYyMGQsICAgICAvKiAgICAwICAgICAgICAqLwotICAgIDB4ZjIwZCwgICAgIC8qICAgIDAwMCAgICAgICAqLwotICAgIDB4NmUwZSwgICAgIC8qICAgICAwMCAgICAgICovCi0gICAgMHg5YzBlLCAgICAgLyogICAgIDAxICAgICAgKi8KLSAgICAweDBmMGQsICAgICAvKiAgICAgMSAgICAgICAqLwotICAgIDB4MGYwZCwgICAgIC8qICAgICAgICAgICAgKi8KLSAgICAweGM5MGUsCi0gICAgMHg1ZTBlLCAgICAgLyogICAgMDEgICAgICAgKi8KLSAgICAweGFiMGQsICAgICAvKiAgICAwMTAxICAgICAgICovCi0gICAgMHhhYjBkLAotICAgIDB4N2QwZSwgICAgIC8qICAgIDAxMTAwICAgICAgKi8KLSAgICAweGQ3MGUsCi0gICAgMHg0ZTBkLCAgICAgLyogICAgMDExMSAgICAgICAqLwotICAgIDB4NGUwZCwKLSAgICAweGM4MGUsCi0gICAgMHhkNjBlLCAgICAgLyogICAgMTAgICAgICAgKi8KLSAgICAweDNlMGQsCi0gICAgMHgzZTBkLCAgICAgLyogICAgMTAwICAgICAgICovCi0gICAgMHhiOTBkLAotICAgIDB4YjkwZCwgICAgIC8qICAgIDEwMSAgICAgICAqLwotICAgIDB4OWIwZSwKLSAgICAweGFhMGUsICAgICAvKiAgICAxMDExMSAgICAgICovCi0gICAgMHgxZjBjLAotICAgIDB4MWYwYywgICAgIC8qICAgIDExICAgICAgICAqLwotICAgIDB4MWYwYywgICAgIC8qICAgIDExICAgICAgICAqLwotICAgIDB4MWYwYywKLSAgICAweGYxMGMsICAgICAvKiAgICAxMTEgICAgICAgICovCi0gICAgMHhmMTBjLCAgICAgLyogICAgMTEgICAgICAgKi8KLSAgICAweGYxMGMsICAgICAvKiAgICAxMSAgICAgICAqLwotICAgIDB4ZjEwYywgICAgIC8qICAgIDExICAgICAgICovCi0gICAgMHhlODBlLAotICAgIDB4ZTgwZSwKLSAgICAweDVmMGUsCi0gICAgMHg1ZjBlLAotICAgIDB4OWQwZSwKLSAgICAweDlkMGUsCi0gICAgMHhkOTBlLAotICAgIDB4ZDkwZSwgICAgIC8qICAwMDAwMDAwICAgICAgICAqLwotICAgIDB4ZjUwZSwKLSAgICAweGY1MGUsCi0gICAgMHhlNzBlLAotICAgIDB4ZTcwZSwKLSAgICAweGFjMGUsCi0gICAgMHhhYzBlLAotICAgIDB4YmIwZSwKLSAgICAweGJiMGUsCi0gICAgMHg0ZjBlLAotICAgIDB4NGYwZSwKLSAgICAweGY0MGUsICAgICAvKiAgMDAwMDAwMCAxICAgICAgICovCi0gICAgMHhmNDBlLAotICAgIDB4Y2EwZiwKLSAgICAweGU2MGYsCi0gICAgMHhmMzBlLAotICAgIDB4ZjMwZSwgICAgIC8qICAwMDAwMDAwIDEwMSAgICAgICovCi0gICAgMHgzZjBkLAotICAgIDB4M2YwZCwgICAgIC8qICAwMDAwMDAwIDExICAgICAgICovCi0gICAgMHgzZjBkLAotICAgIDB4M2YwZCwgICAgIC8qICAwMDAwMDAwIDExICAgICAgICovCi0gICAgMHg4ZDBlLAotICAgIDB4OGQwZSwKLSAgICAweGQ4MGUsICAgICAvKiAgMDAwMDAwMCAxMTExICAgICAgKi8KLSAgICAweGQ4MGUsCi0gICAgMHg4ZjBmLAotICAgIDB4OGYwZiwgICAgIC8qICAwMDAwMDAwMCAwMDAgICAgICovCi0gICAgMHhmODBmLCAgICAgLyogIDAwMDAwMDAwIDAgICAgICAqLwotICAgIDB4ZjgwZiwKLSAgICAweGNjMGYsICAgICAvKiAgMDAwMDAwMDAgIDAgICAgICovCi0gICAgMHhjYzBmLAotICAgIDB4YWUxMCwKLSAgICAweDllMTAsICAgICAvKiAgMDAwMDAwMDAgIDExICAgICovCi0gICAgMHg4ZTBmLAotICAgIDB4OGUwZiwKLSAgICAweDdmMTAsCi0gICAgMHg3ZTEwLAotICAgIDB4ZjcwZSwgICAgIC8qICAwMDAwMDAwMCAwMTEgICAgICAqLwotICAgIDB4ZjcwZSwKLSAgICAweGY3MGUsCi0gICAgMHhmNzBlLCAgICAgLyogIDAwMDAwMDAwIDAxICAgICAqLwotICAgIDB4ZGEwZSwKLSAgICAweGRhMGUsICAgICAvKiAgMDAwMDAwMDAgMTAgICAgICAqLwotICAgIDB4ZGEwZSwKLSAgICAweGRhMGUsICAgICAvKiAgMDAwMDAwMDAgMTAgICAgICAqLwotICAgIDB4YWQwZiwKLSAgICAweGFkMGYsICAgICAvKiAgMDAwMDAwMDAgMTAxICAgICAqLwotICAgIDB4YmMwZiwKLSAgICAweGJjMGYsICAgICAvKiAgMDAwMDAwMDAgMTAxICAgICAqLwotICAgIDB4Y2IwZiwKLSAgICAweGNiMGYsICAgICAvKiAgMDAwMDAwMDAgMTEwICAgICAqLwotICAgIDB4ZjYwZiwKLSAgICAweGY2MGYsICAgICAvKiAgMDAwMDAwMDAgMTEwICAgICAqLwotICAgIDB4NmYwZSwKLSAgICAweDZmMGUsICAgICAvKiAgMDAwMDAwMDAgMTEgICAgICovCi0gICAgMHg2ZjBlLCAgICAgLyogIDAwMDAwMDAwIDExICAgICAqLwotICAgIDB4NmYwZSwgICAgIC8qICAwMDAwMDAwMCAxMSAgICAgKi8KLSAgICAweGZmMTAsCi0gICAgMHhmZjEwLAotICAgIDB4ZWYxMCwKLSAgICAweGVmMTAsICAgICAvKiAgMDAwMDAwMDAwMDAwICAgICAqLwotICAgIDB4ZGYxMCwgICAgIC8qICAwMDAwMDAwMDAwMDAgMSAgICAqLwotICAgIDB4ZGYxMCwgICAgIC8qICAwMDAwMDAwMDAwMDAgICAgICovCi0gICAgMHhlZTEwLCAgICAgLyogIDAwMDAwMDAwMDAwIDAwICAgICovCi0gICAgMHhlZTEwLCAgICAgLyogIDAwMDAwMDAwMDAwIDAgICAgKi8KLSAgICAweGNmMTAsICAgICAvKiAgMDAwMDAwMDAwMDAgMDEgICAgKi8KLSAgICAweGNmMTAsCi0gICAgMHhkZTEwLCAgICAgLyogIDAwMDAwMDAwMDAwIDEwICAgICovCi0gICAgMHhkZTEwLAotICAgIDB4YmYxMCwgICAgIC8qICAwMDAwMDAwMDAwMCAxMSAgICAqLwotICAgIDB4YmYxMCwgICAgIC8qICAwMDAwMDAwMDAwMCAxICAgICovCi0gICAgMHhmYjEwLAotICAgIDB4ZmIxMCwKLSAgICAweGNlMTAsCi0gICAgMHhjZTEwLCAgICAgLyogIDAwMDAwMDAwMDAgMDAgICAgKi8KLSAgICAweGRjMTAsICAgICAvKiAgMDAwMDAwMDAwMCAwMTAgICAgKi8KLSAgICAweGRjMTAsCi0gICAgMHhhZjExLAotICAgIDB4ZTkxMSwKLSAgICAweGVjMGYsICAgICAvKiAgMDAwMDAwMDAwMCAxMCAgICAgKi8KLSAgICAweGVjMGYsICAgICAvKiAgMDAwMDAwMDAwMCAxICAgICAqLwotICAgIDB4ZWMwZiwgICAgIC8qICAwMDAwMDAwMDAwIDEgICAgICovCi0gICAgMHhlYzBmLCAgICAgLyogIDAwMDAwMDAwMDAgMSAgICAgKi8KLSAgICAweGRkMGYsICAgICAvKiAgMDAwMDAwMDAwMCAxMSAgICAgKi8KLSAgICAweGRkMGYsICAgICAvKiAgMDAwMDAwMDAwMCAxICAgICovCi0gICAgMHhkZDBmLCAgICAgLyogIDAwMDAwMDAwMDAgMSAgICAqLwotICAgIDB4ZGQwZiwgICAgIC8qICAwMDAwMDAwMDAwIDEgICAgKi8KLSAgICAweGZhMTAsICAgICAvKiAgMDAwMDAwMDAwIDAwMDAgICAgKi8KLSAgICAweGZhMTAsICAgICAvKiAgMDAwMDAwMDAwIDAwMCAgICAqLwotICAgIDB4Y2QxMCwgICAgIC8qICAwMDAwMDAwMDAgMCAgICAgKi8KLSAgICAweGNkMTAsICAgICAvKiAgMDAwMDAwMDAwIDAwMCAgICAqLwotICAgIDB4YmUwZiwgICAgIC8qICAwMDAwMDAwMDAgICAgICAgKi8KLSAgICAweGJlMGYsCi0gICAgMHhiZTBmLAotICAgIDB4YmUwZiwKLSAgICAweGViMGYsCi0gICAgMHhlYjBmLAotICAgIDB4ZWIwZiwKLSAgICAweGViMGYsICAgICAvKiAgMDAwMDAwMDAwIDAxICAgICAqLwotICAgIDB4OWYwZiwgICAgIC8qICAwMDAwMDAwMDAgMDExICAgICAqLwotICAgIDB4OWYwZiwgICAgIC8qICAwMDAwMDAwMDAgMDEgICAgKi8KLSAgICAweDlmMGYsCi0gICAgMHg5ZjBmLAotICAgIDB4ZjkwZiwgICAgIC8qICAwMDAwMDAwMDAgMTAwICAgICAqLwotICAgIDB4ZjkwZiwgICAgIC8qICAwMDAwMDAwMDAgMTAgICAgICovCi0gICAgMHhmOTBmLCAgICAgLyogIDAwMDAwMDAwMCAxMCAgICAgKi8KLSAgICAweGY5MGYsICAgICAvKiAgMDAwMDAwMDAwIDEwICAgICAqLwotICAgIDB4ZWEwZiwgICAgIC8qICAwMDAwMDAwMDAgMTAxICAgICAqLwotICAgIDB4ZWEwZiwgICAgIC8qICAwMDAwMDAwMDAgMTAgICAgKi8KLSAgICAweGVhMGYsICAgICAvKiAgMDAwMDAwMDAwIDEwICAgICovCi0gICAgMHhlYTBmLCAgICAgLyogIDAwMDAwMDAwMCAxMCAgICAqLwotICAgIDB4YmQwZiwgICAgIC8qICAwMDAwMDAwMDAgMTEwICAgICAqLwotICAgIDB4YmQwZiwgICAgIC8qICAwMDAwMDAwMDAgMTEgICAgICovCi0gICAgMHhiZDBmLCAgICAgLyogIDAwMDAwMDAwMCAxMSAgICAgKi8KLSAgICAweGJkMGYsICAgICAvKiAgMDAwMDAwMDAwIDExICAgICAqLwotICAgIDB4ZGIwZiwgICAgIC8qICAwMDAwMDAwMDAgMTExICAgICAqLwotICAgIDB4ZGIwZiwgICAgIC8qICAwMDAwMDAwMDAgMTEgICAgKi8KLSAgICAweGRiMGYsICAgICAvKiAgMDAwMDAwMDAwIDExICAgICovCi0gICAgMHhkYjBmLCAgICAgLyogIDAwMDAwMDAwMCAxMSAgICAqLwotICAgIDB4ZmUxMywKLSAgICAweGZjMTMsCi0gICAgMHhmZDEyLAotICAgIDB4ZmQxMiwKLSAgICAweGVkMTEsCi0gICAgMHhlZDExLAotICAgIDB4ZWQxMSwKLSAgICAweGVkMTEKLQotfTsKLQotCi0KLWNvbnN0IHVpbnQxNiBodWZmVGFibGVfMTVbNDIxXSA9Ci17Ci0gICAgMHgxMTAzLAotICAgIDB4MTEwMywKLSAgICAweDAxMDQsCi0gICAgMHgxMDA0LAotICAgIDB4MDAwMywgICAgIC8qICAxMTEgICAgICAgICAgICAgICAgICovCi0gICAgMHgwMDAzLCAvKiAgMTEgICAgICAgICAgICAgICAgICovCi0gICAgMHgzNDA3LAotICAgIDB4NDMwNywKLSAgICAweDI0MDcsICAgICAvKiAgMDEwMSAgICAgICAgICAgICAgKi8KLSAgICAweDQyMDcsICAgICAvKiAgMDEwMTAxMCAgICAgICAgICAgICAqLwotICAgIDB4MzMwNywKLSAgICAweDQxMDYsICAgICAvKiAgMDEwMTEwICAgICAgICAgICAgICAqLwotICAgIDB4NDEwNiwKLSAgICAweDE0MDcsICAgICAvKiAgMDEwMTExMCAgICAgICAgICAgICAqLwotICAgIDB4MDQwNywKLSAgICAweDIzMDYsICAgICAvKiAgMDExMDAwICAgICAgICAgICAgICAqLwotICAgIDB4MjMwNiwKLSAgICAweDMyMDYsICAgICAvKiAgMDExICAgICAgICAgICAgICAgKi8KLSAgICAweDMyMDYsCi0gICAgMHg0MDA3LAotICAgIDB4MDMwNywKLSAgICAweDEzMDYsICAgICAvKiAgMDExMDExICAgICAgICAgICAgICAqLwotICAgIDB4MTMwNiwgICAgIC8qICAwMTEwMSAgICAgICAgICAgICAgKi8KLSAgICAweDMxMDYsICAgICAvKiAgMDExMTAwICAgICAgICAgICAgICAqLwotICAgIDB4MzEwNiwgICAgIC8qICAwMTExMCAgICAgICAgICAgICAgKi8KLSAgICAweDMwMDYsICAgICAvKiAgMDExMTAxICAgICAgICAgICAgICAqLwotICAgIDB4MzAwNiwgICAgIC8qICAwMTExMCAgICAgICAgICAgICAgKi8KLSAgICAweDIyMDUsICAgICAvKiAgMDExMTEgICAgICAgICAgICAgICAqLwotICAgIDB4MjIwNSwgICAgIC8qICAwMTExICAgICAgICAgICAgICAqLwotICAgIDB4MjIwNSwgICAgIC8qICAwMTExICAgICAgICAgICAgICAqLwotICAgIDB4MjIwNSwgICAgIC8qICAwMTExICAgICAgICAgICAgICAqLwotICAgIDB4MTIwNSwgICAgIC8qICAxMDAwMCAgICAgICAgICAgICAgICovCi0gICAgMHgxMjA1LCAgICAgLyogIDEwMDAgICAgICAgICAgICAgICAqLwotICAgIDB4MTIwNSwgICAgIC8qICAxMDAwICAgICAgICAgICAgICAgKi8KLSAgICAweDEyMDUsICAgICAvKiAgMTAwMCAgICAgICAgICAgICAgICovCi0gICAgMHgyMTA1LCAgICAgLyogIDEwICAgICAgICAgICAgICAgICovCi0gICAgMHgyMTA1LCAgICAgLyogIDEwMDAgICAgICAgICAgICAgICovCi0gICAgMHgyMTA1LCAgICAgLyogIDEwMDAgICAgICAgICAgICAgICovCi0gICAgMHgyMTA1LCAgICAgLyogIDEwMDAgICAgICAgICAgICAgICovCi0gICAgMHgwMjA1LAotICAgIDB4MDIwNSwgICAgIC8qICAxICAgICAgICAgICAgICAgICovCi0gICAgMHgwMjA1LCAgICAgLyogIDEgICAgICAgICAgICAgICAgKi8KLSAgICAweDAyMDUsICAgICAvKiAgMSAgICAgICAgICAgICAgICAqLwotICAgIDB4MjAwNSwgICAgIC8qICAxIDEgICAgICAgICAgICAgICAqLwotICAgIDB4MjAwNSwgICAgIC8qICAxICAgICAgICAgICAgICAgKi8KLSAgICAweDIwMDUsICAgICAvKiAgMSAgICAgICAgICAgICAgICovCi0gICAgMHgyMDA1LCAgICAgLyogIDEgICAgICAgICAgICAgICAqLwotICAgIDB4NTgwOSwKLSAgICAweDg1MDksCi0gICAgMHgyOTA5LCAgICAgLyogICAgICAgICAgICAgICAqLwotICAgIDB4NjcwOSwgICAgIC8qICAgMDAwICAgICAgICAgICAgKi8KLSAgICAweDc2MDksICAgICAvKiAgIDAwIDAgICAgICAgICAgICovCi0gICAgMHg5MjA5LCAgICAgLyogICAwMCAxICAgICAgICAgICAqLwotICAgIDB4OTEwOCwgICAgIC8qICAgMCAwICAgICAgICAgICAgKi8KLSAgICAweDkxMDgsICAgICAvKiAgIDAgICAgICAgICAgICAgKi8KLSAgICAweDE5MDksICAgICAvKiAgIDAgMTAgICAgICAgICAgICovCi0gICAgMHg5MDA5LCAgICAgLyogICAwIDExICAgICAgICAgICAqLwotICAgIDB4NDgwOSwgICAgIC8qICAgIDAwMCAgICAgICAgICAgKi8KLSAgICAweDg0MDksICAgICAvKiAgICAgICAgICAgICAgICAqLwotICAgIDB4NTcwOSwgICAgIC8qICAgIDAxMCAgICAgICAgICAgKi8KLSAgICAweDc1MDksICAgICAvKiAgICAwMTEgICAgICAgICAgICovCi0gICAgMHgzODA5LCAgICAgLyogICAgMTAwICAgICAgICAgICAqLwotICAgIDB4ODMwOSwgICAgIC8qICAgIDEwMSAgICAgICAgICAgKi8KLSAgICAweDY2MDksICAgICAvKiAgICAxMTAgICAgICAgICAgICovCi0gICAgMHg0NzA5LCAgICAgLyogICAgMTExICAgICAgICAgICAqLwotICAgIDB4MjgwOCwKLSAgICAweDI4MDgsICAgICAvKiAgIDAxMDAgICAgICAgICAgICAqLwotICAgIDB4ODIwOCwgICAgIC8qICAgMDEgICAgICAgICAgICAgKi8KLSAgICAweDgyMDgsICAgICAvKiAgIDAxMDAgICAgICAgICAgICAqLwotICAgIDB4MTgwOCwgICAgIC8qICAgMDEwMTAgICAgICAgICAgICAqLwotICAgIDB4MTgwOCwgICAgIC8qICAgMDEwMSAgICAgICAgICAgICovCi0gICAgMHg4MTA4LCAgICAgLyogICAwMTAxMSAgICAgICAgICAgICovCi0gICAgMHg4MTA4LCAgICAgLyogICAwMTAxICAgICAgICAgICAgKi8KLSAgICAweDc0MDksCi0gICAgMHgwODA5LCAgICAgLyogICAwMTEgICAgICAgICAgICAqLwotICAgIDB4ODAwOSwgICAgIC8qICAgMDExMDEwICAgICAgICAgICAqLwotICAgIDB4NTYwOSwKLSAgICAweDY1MDksICAgICAvKiAgIDAxMTEwMCAgICAgICAgICAgKi8KLSAgICAweDM3MDksCi0gICAgMHg3MzA5LCAgICAgLyogICAwMTExMTAgICAgICAgICAgICovCi0gICAgMHg0NjA5LAotICAgIDB4MjcwOCwgICAgIC8qICAgMTAwMDAgICAgICAgICAgICAqLwotICAgIDB4MjcwOCwgICAgIC8qICAgMTAwMCAgICAgICAgICAgICovCi0gICAgMHg3MjA4LCAgICAgLyogICAxMCAgICAgICAgICAgICAqLwotICAgIDB4NzIwOCwgICAgIC8qICAgMTAwMCAgICAgICAgICAgICovCi0gICAgMHg2NDA4LCAgICAgLyogICAxIDAgICAgICAgICAgICAqLwotICAgIDB4NjQwOCwgICAgIC8qICAgMSAgICAgICAgICAgICAqLwotICAgIDB4MTcwOCwgICAgIC8qICAgMSAxICAgICAgICAgICAgKi8KLSAgICAweDE3MDgsICAgICAvKiAgIDEgICAgICAgICAgICAgKi8KLSAgICAweDU1MDgsICAgICAvKiAgIDEwMTAwICAgICAgICAgICAgKi8KLSAgICAweDU1MDgsCi0gICAgMHg3MTA4LCAgICAgLyogICAxMDEwMSAgICAgICAgICAgICovCi0gICAgMHg3MTA4LAotICAgIDB4MDcwOSwgICAgIC8qICAgMTAxMTAwICAgICAgICAgICAqLwotICAgIDB4NzAwOSwgICAgIC8qICAgMTAxMTAxICAgICAgICAgICAqLwotICAgIDB4MzYwOCwgICAgIC8qICAgMTAxMTEgICAgICAgICAgICAqLwotICAgIDB4MzYwOCwgICAgIC8qICAgMTAxMSAgICAgICAgICAgICovCi0gICAgMHg2MzA4LCAgICAgLyogICAxMTAwMCAgICAgICAgICAgICovCi0gICAgMHg2MzA4LCAgICAgLyogICAxMTAwICAgICAgICAgICAgKi8KLSAgICAweDQ1MDgsICAgICAvKiAgIDExICAgICAgICAgICAgICovCi0gICAgMHg0NTA4LCAgICAgLyogICAxMTAwICAgICAgICAgICAgKi8KLSAgICAweDU0MDgsICAgICAvKiAgIDExMDEwICAgICAgICAgICAgKi8KLSAgICAweDU0MDgsICAgICAvKiAgIDExMDEgICAgICAgICAgICAqLwotICAgIDB4MjYwOCwgICAgIC8qICAgMTEwMTEgICAgICAgICAgICAqLwotICAgIDB4MjYwOCwgICAgIC8qICAgMTEwMSAgICAgICAgICAgICovCi0gICAgMHg2MjA4LCAgICAgLyogICAxMTEwMCAgICAgICAgICAgICovCi0gICAgMHg2MjA4LCAgICAgLyogICAxMTEwICAgICAgICAgICAgKi8KLSAgICAweDE2MDgsICAgICAvKiAgIDExMTAxICAgICAgICAgICAgKi8KLSAgICAweDE2MDgsICAgICAvKiAgIDExMTAgICAgICAgICAgICAqLwotICAgIDB4MDYwOSwgICAgIC8qICAgMTExMTAwICAgICAgICAgICAqLwotICAgIDB4NjAwOSwgICAgIC8qICAgMTExMTAxICAgICAgICAgICAqLwotICAgIDB4MzUwOCwgICAgIC8qICAgMTExMTEgICAgICAgICAgICAqLwotICAgIDB4MzUwOCwgICAgIC8qICAgMTExMSAgICAgICAgICAgICovCi0gICAgMHg2MTA3LAotICAgIDB4NjEwNywKLSAgICAweDYxMDcsCi0gICAgMHg2MTA3LAotICAgIDB4NTMwOCwgICAgIC8qICAwMTAwIDAgICAgICAgICAgICAqLwotICAgIDB4NTMwOCwgICAgIC8qICAwMTAwICAgICAgICAgICAgICovCi0gICAgMHg0NDA4LCAgICAgLyogIDAxMDAgMSAgICAgICAgICAgICovCi0gICAgMHg0NDA4LCAgICAgLyogIDAxMDAgICAgICAgICAgICAgKi8KLSAgICAweDI1MDcsICAgICAvKiAgMDEwIDAgICAgICAgICAgICAgKi8KLSAgICAweDI1MDcsICAgICAvKiAgMDEwICAgICAgICAgICAgICAqLwotICAgIDB4MjUwNywgICAgIC8qICAwMTAgICAgICAgICAgICAgICovCi0gICAgMHgyNTA3LCAgICAgLyogIDAxMCAgICAgICAgICAgICAgKi8KLSAgICAweDUyMDcsICAgICAvKiAgMDEwIDEgICAgICAgICAgICAgKi8KLSAgICAweDUyMDcsICAgICAvKiAgMDEwICAgICAgICAgICAgICovCi0gICAgMHg1MjA3LCAgICAgLyogIDAxMCAgICAgICAgICAgICAqLwotICAgIDB4NTIwNywgICAgIC8qICAwMTAgICAgICAgICAgICAgKi8KLSAgICAweDE1MDcsICAgICAvKiAgMDEgMDAgICAgICAgICAgICAgKi8KLSAgICAweDE1MDcsICAgICAvKiAgMDEgMCAgICAgICAgICAgICAqLwotICAgIDB4MTUwNywgICAgIC8qICAwMSAwICAgICAgICAgICAgICovCi0gICAgMHgxNTA3LCAgICAgLyogIDAxIDAgICAgICAgICAgICAgKi8KLSAgICAweDUxMDcsICAgICAvKiAgMDEgMDEgICAgICAgICAgICAgKi8KLSAgICAweDUxMDcsICAgICAvKiAgMDEgMCAgICAgICAgICAgICovCi0gICAgMHg1MTA3LCAgICAgLyogIDAxIDAgICAgICAgICAgICAqLwotICAgIDB4NTEwNywgICAgIC8qICAwMSAwICAgICAgICAgICAgKi8KLSAgICAweDA1MDgsICAgICAvKiAgMDEgMTAwICAgICAgICAgICAgKi8KLSAgICAweDA1MDgsICAgICAvKiAgMDEgMTAgICAgICAgICAgICAqLwotICAgIDB4NTAwOCwgICAgIC8qICAwMSAxMDEgICAgICAgICAgICAqLwotICAgIDB4NTAwOCwgICAgIC8qICAwMSAxMCAgICAgICAgICAgICovCi0gICAgMHhjMjA5LAotICAgIDB4YzIwOSwKLSAgICAweDJjMGEsICAgICAvKiAgMDAgMTExMTAgICAgICAgICAgKi8KLSAgICAweDViMGEsCi0gICAgMHhiNTBhLCAgICAgLyogIDAgICAgICAgICAgICAqLwotICAgIDB4MWMwYSwgICAgIC8qICAwIDAwMCAgICAgICAgICAgKi8KLSAgICAweDg5MGEsICAgICAvKiAgMCAwMCAwICAgICAgICAgICovCi0gICAgMHg5ODBhLAotICAgIDB4YzEwYSwgICAgIC8qICAwIDAgMDAgICAgICAgICAgKi8KLSAgICAweDRiMGEsICAgICAvKiAgMCAwIDAxICAgICAgICAgICovCi0gICAgMHhiNDBhLCAgICAgLyogIDAgMCAxMCAgICAgICAgICAqLwotICAgIDB4NmEwYSwgICAgIC8qICAwIDAgMTEgICAgICAgICAgKi8KLSAgICAweDNiMGEsICAgICAvKiAgMCAgMDAwICAgICAgICAgICovCi0gICAgMHg3OTBhLCAgICAgLyogIDAgICAgICAgICAgICAgKi8KLSAgICAweGIzMDksICAgICAvKiAgMCAgMDEgICAgICAgICAgICovCi0gICAgMHhiMzA5LCAgICAgLyogIDAgIDAgICAgICAgICAgICovCi0gICAgMHg5NzBhLCAgICAgLyogIDAgIDEwMCAgICAgICAgICAqLwotICAgIDB4ODgwYSwgICAgIC8qICAwICAxMDEgICAgICAgICAgKi8KLSAgICAweDJiMGEsICAgICAvKiAgMCAgMTEwICAgICAgICAgICovCi0gICAgMHg1YTBhLCAgICAgLyogIDAgIDExMSAgICAgICAgICAqLwotICAgIDB4YjIwOSwgICAgIC8qICAwIDAxMDAwICAgICAgICAgICAqLwotICAgIDB4YjIwOSwgICAgIC8qICAwIDAxMDAgICAgICAgICAgICovCi0gICAgMHhhNTBhLCAgICAgLyogIDAgMDEgMCAgICAgICAgICAqLwotICAgIDB4MWIwYSwgICAgIC8qICAwIDAxIDEgICAgICAgICAgKi8KLSAgICAweGIxMDksICAgICAvKiAgMCAwMTAxMCAgICAgICAgICAgKi8KLSAgICAweGIxMDksICAgICAvKiAgMCAwMTAxICAgICAgICAgICAqLwotICAgIDB4YjAwYSwgICAgIC8qICAwIDAxMDExMCAgICAgICAgICAqLwotICAgIDB4NjkwYSwgICAgIC8qICAwIDAxMDExMSAgICAgICAgICAqLwotICAgIDB4OTYwYSwgICAgIC8qICAwIDAxMTAwMCAgICAgICAgICAqLwotICAgIDB4NGEwYSwgICAgIC8qICAwIDAxMSAgICAgICAgICAgKi8KLSAgICAweGE0MGEsICAgICAvKiAgMCAwMTEwMTAgICAgICAgICAgKi8KLSAgICAweDc4MGEsICAgICAvKiAgMCAwMTEwMTEgICAgICAgICAgKi8KLSAgICAweDg3MGEsICAgICAvKiAgMCAwMTExMDAgICAgICAgICAgKi8KLSAgICAweDNhMGEsICAgICAvKiAgMCAwMTExMDEgICAgICAgICAgKi8KLSAgICAweGEzMDksICAgICAvKiAgMCAwMTExMSAgICAgICAgICAgKi8KLSAgICAweGEzMDksICAgICAvKiAgMCAwMTExICAgICAgICAgICAqLwotICAgIDB4NTkwOSwgICAgIC8qICAwIDEwMDAwICAgICAgICAgICAqLwotICAgIDB4NTkwOSwgICAgIC8qICAwIDEwMDAgICAgICAgICAgICovCi0gICAgMHg5NTA5LCAgICAgLyogIDAgMTAgICAgICAgICAgICAqLwotICAgIDB4OTUwOSwgICAgIC8qICAwIDEwMDAgICAgICAgICAgICovCi0gICAgMHgyYTA5LCAgICAgLyogIDAgMSAwICAgICAgICAgICAqLwotICAgIDB4MmEwOSwgICAgIC8qICAwIDEgICAgICAgICAgICAqLwotICAgIDB4YTIwOSwgICAgIC8qICAwIDEgMSAgICAgICAgICAgKi8KLSAgICAweGEyMDksICAgICAvKiAgMCAxICAgICAgICAgICAgKi8KLSAgICAweDFhMDksICAgICAvKiAgMCAxMDEwMCAgICAgICAgICAgKi8KLSAgICAweDFhMDksICAgICAvKiAgMCAxMDEwICAgICAgICAgICAqLwotICAgIDB4YTEwOSwgICAgIC8qICAwIDEwMTAxICAgICAgICAgICAqLwotICAgIDB4YTEwOSwgICAgIC8qICAwIDEwMTAgICAgICAgICAgICovCi0gICAgMHgwYTBhLCAgICAgLyogIDAgMTAxMTAwICAgICAgICAgICovCi0gICAgMHhhMDBhLCAgICAgLyogIDAgMTAxMTAxICAgICAgICAgICovCi0gICAgMHg2ODA5LCAgICAgLyogIDAgMTAxMTEgICAgICAgICAgICovCi0gICAgMHg2ODA5LCAgICAgLyogIDAgMTAxMSAgICAgICAgICAgKi8KLSAgICAweDg2MDksICAgICAvKiAgMCAxMTAwMCAgICAgICAgICAgKi8KLSAgICAweDg2MDksICAgICAvKiAgMCAxMTAwICAgICAgICAgICAqLwotICAgIDB4NDkwOSwgICAgIC8qICAwIDExICAgICAgICAgICAgKi8KLSAgICAweDQ5MDksICAgICAvKiAgMCAxMTAwICAgICAgICAgICAqLwotICAgIDB4OTQwOSwgICAgIC8qICAwIDExMDEwICAgICAgICAgICAqLwotICAgIDB4OTQwOSwgICAgIC8qICAwIDExMDEgICAgICAgICAgICovCi0gICAgMHgzOTA5LCAgICAgLyogIDAgMTEwMTEgICAgICAgICAgICovCi0gICAgMHgzOTA5LCAgICAgLyogIDAgMTEwMSAgICAgICAgICAgKi8KLSAgICAweDkzMDksICAgICAvKiAgMCAxMTEwMCAgICAgICAgICAgKi8KLSAgICAweDkzMDksICAgICAvKiAgMCAxMTEwICAgICAgICAgICAqLwotICAgIDB4NzcwYSwgICAgIC8qICAwIDExMTAxMCAgICAgICAgICAqLwotICAgIDB4MDkwYSwgICAgIC8qICAwIDExMTAxMSAgICAgICAgICAqLwotICAgIDB4N2MwYiwKLSAgICAweGM3MGIsICAgICAvKiAgMDAgMDAwICAgICAgICAgICovCi0gICAgMHg0ZDBiLCAgICAgLyogIDAwIDAwIDAgICAgICAgICAqLwotICAgIDB4OGIwYiwgICAgIC8qICAwMCAwMCAxICAgICAgICAgKi8KLSAgICAweGQ0MGEsICAgICAvKiAgMDAgMCAwICAgICAgICAgICovCi0gICAgMHhkNDBhLCAgICAgLyogIDAwIDAgICAgICAgICAgICovCi0gICAgMHhiODBiLCAgICAgLyogIDAwIDAgMTAgICAgICAgICAqLwotICAgIDB4OWEwYiwgICAgIC8qICAwMCAwIDExICAgICAgICAgKi8KLSAgICAweGE5MGIsICAgICAvKiAgMDAgIDAwMCAgICAgICAgICovCi0gICAgMHg2YzBiLCAgICAgLyogIDAwICAgICAgICAgICAgKi8KLSAgICAweGM2MGIsICAgICAvKiAgMDAgIDAxMCAgICAgICAgICovCi0gICAgMHgzZDBiLCAgICAgLyogIDAwICAwMTEgICAgICAgICAqLwotICAgIDB4ZDMwYSwgICAgIC8qICAwMCAgMTAgICAgICAgICAgKi8KLSAgICAweGQzMGEsICAgICAvKiAgMDAgIDEgICAgICAgICAgKi8KLSAgICAweGQyMGEsICAgICAvKiAgMDAgIDExICAgICAgICAgICovCi0gICAgMHhkMjBhLCAgICAgLyogIDAwICAxICAgICAgICAgICovCi0gICAgMHgyZDBiLCAgICAgLyogIDAwIDAxMDAwMCAgICAgICAgICovCi0gICAgMHgwZDBiLCAgICAgLyogIDAwIDAxMCAgICAgICAgICAqLwotICAgIDB4MWQwYSwgICAgIC8qICAwMCAwMSAgICAgICAgICAgKi8KLSAgICAweDFkMGEsICAgICAvKiAgMDAgMDEwMCAgICAgICAgICAqLwotICAgIDB4N2IwYSwgICAgIC8qICAwMCAwMTAxMCAgICAgICAgICAqLwotICAgIDB4N2IwYSwgICAgIC8qICAwMCAwMTAxICAgICAgICAgICovCi0gICAgMHhiNzBhLCAgICAgLyogIDAwIDAxMDExICAgICAgICAgICovCi0gICAgMHhiNzBhLCAgICAgLyogIDAwIDAxMDEgICAgICAgICAgKi8KLSAgICAweGQxMGEsICAgICAvKiAgMDAgMDExMDAgICAgICAgICAgKi8KLSAgICAweGQxMGEsICAgICAvKiAgMDAgMDExMCAgICAgICAgICAqLwotICAgIDB4NWMwYiwgICAgIC8qICAwMCAwMTEwMTAgICAgICAgICAqLwotICAgIDB4ZDAwYiwgICAgIC8qICAwMCAwMTEwMTEgICAgICAgICAqLwotICAgIDB4YzUwYSwgICAgIC8qICAwMCAwMTExMCAgICAgICAgICAqLwotICAgIDB4YzUwYSwgICAgIC8qICAwMCAwMTExICAgICAgICAgICovCi0gICAgMHg4YTBhLCAgICAgLyogIDAwIDAxMTExICAgICAgICAgICovCi0gICAgMHg4YTBhLCAgICAgLyogIDAwIDAxMTEgICAgICAgICAgKi8KLSAgICAweGE4MGEsICAgICAvKiAgMDAgMTAwMDAgICAgICAgICAgKi8KLSAgICAweGE4MGEsICAgICAvKiAgMDAgMTAwMCAgICAgICAgICAqLwotICAgIDB4NGMwYSwgICAgIC8qICAwMCAxMCAgICAgICAgICAgKi8KLSAgICAweDRjMGEsICAgICAvKiAgMDAgMTAwMCAgICAgICAgICAqLwotICAgIDB4YzQwYSwgICAgIC8qICAwMCAxIDAgICAgICAgICAgKi8KLSAgICAweGM0MGEsICAgICAvKiAgMDAgMSAgICAgICAgICAgKi8KLSAgICAweDZiMGEsICAgICAvKiAgMDAgMSAxICAgICAgICAgICovCi0gICAgMHg2YjBhLCAgICAgLyogIDAwIDEgICAgICAgICAgICovCi0gICAgMHhiNjBhLCAgICAgLyogIDAwIDEwMTAwICAgICAgICAgICovCi0gICAgMHhiNjBhLCAgICAgLyogIDAwIDEwMTAgICAgICAgICAgKi8KLSAgICAweDk5MGIsICAgICAvKiAgMDAgMTAxMDEwICAgICAgICAgKi8KLSAgICAweDBjMGIsICAgICAvKiAgMDAgMTAxMDExICAgICAgICAgKi8KLSAgICAweDNjMGEsICAgICAvKiAgMDAgMTAxMTAgICAgICAgICAgKi8KLSAgICAweDNjMGEsICAgICAvKiAgMDAgMTAxMSAgICAgICAgICAqLwotICAgIDB4YzMwYSwgICAgIC8qICAwMCAxMDExMSAgICAgICAgICAqLwotICAgIDB4YzMwYSwgICAgIC8qICAwMCAxMDExICAgICAgICAgICovCi0gICAgMHg3YTBhLCAgICAgLyogIDAwIDExMDAwICAgICAgICAgICovCi0gICAgMHg3YTBhLCAgICAgLyogIDAwIDExMDAgICAgICAgICAgKi8KLSAgICAweGE3MGEsICAgICAvKiAgMDAgMTEgICAgICAgICAgICovCi0gICAgMHhhNzBhLCAgICAgLyogIDAwIDExMDAgICAgICAgICAgKi8KLSAgICAweGE2MGEsICAgICAvKiAgMDAgMTEwMTAgICAgICAgICAgKi8KLSAgICAweGE2MGEsICAgICAvKiAgMDAgMTEwMSAgICAgICAgICAqLwotICAgIDB4YzAwYiwgICAgIC8qICAwMCAxMTAxMTAgICAgICAgICAqLwotICAgIDB4MGIwYiwgICAgIC8qICAwMCAxMTAxMTEgICAgICAgICAqLwotICAgIDB4Y2IwYiwKLSAgICAweGNiMGIsICAgICAvKiAgMDAwMCAwMDAgICAgICAgICAqLwotICAgIDB4ZjYwYiwgICAgIC8qICAwMDAwIDAgICAgICAgICAgKi8KLSAgICAweGY2MGIsICAgICAvKiAgMDAwMCAwMDAgICAgICAgICAqLwotICAgIDB4OGUwYywgICAgIC8qICAwMDAwICAwMCAgICAgICAgKi8KLSAgICAweGU4MGMsICAgICAvKiAgMDAwMCAgMDEgICAgICAgICovCi0gICAgMHg1ZjBjLCAgICAgLyogIDAwMDAgIDEwICAgICAgICAqLwotICAgIDB4OWQwYywgICAgIC8qICAwMDAwICAxMSAgICAgICAgKi8KLSAgICAweGY1MGIsICAgICAvKiAgMDAwMCAwMTAwICAgICAgICAgKi8KLSAgICAweGY1MGIsICAgICAvKiAgMDAwMCAwMTAgICAgICAgICAqLwotICAgIDB4N2UwYiwgICAgIC8qICAwMDAwIDAxMDEgICAgICAgICAqLwotICAgIDB4N2UwYiwgICAgIC8qICAwMDAwIDAxMCAgICAgICAgICovCi0gICAgMHhlNzBiLCAgICAgLyogIDAwMDAgMDExMCAgICAgICAgICovCi0gICAgMHhlNzBiLCAgICAgLyogIDAwMDAgMDExICAgICAgICAgKi8KLSAgICAweGFjMGIsICAgICAvKiAgMDAwMCAwMTExICAgICAgICAgKi8KLSAgICAweGFjMGIsICAgICAvKiAgMDAwMCAwMTEgICAgICAgICAqLwotICAgIDB4Y2EwYiwgICAgIC8qICAwMDAwIDEwMDAgICAgICAgICAqLwotICAgIDB4Y2EwYiwgICAgIC8qICAwMDAwIDEwMCAgICAgICAgICovCi0gICAgMHhiYjBiLCAgICAgLyogIDAwMDAgMSAgICAgICAgICAqLwotICAgIDB4YmIwYiwgICAgIC8qICAwMDAwIDEwMCAgICAgICAgICovCi0gICAgMHhkOTBjLCAgICAgLyogIDAwMDAgMTAxMDAgICAgICAgICovCi0gICAgMHg4ZDBjLCAgICAgLyogIDAwMDAgMTAxMDEgICAgICAgICovCi0gICAgMHg0ZjBiLCAgICAgLyogIDAwMDAgMTAxMSAgICAgICAgICovCi0gICAgMHg0ZjBiLCAgICAgLyogIDAwMDAgMTAxICAgICAgICAgKi8KLSAgICAweGY0MGIsICAgICAvKiAgMDAwMCAxMTAwICAgICAgICAgKi8KLSAgICAweGY0MGIsICAgICAvKiAgMDAwMCAxMTAgICAgICAgICAqLwotICAgIDB4M2YwYiwgICAgIC8qICAwMDAwIDExMDEgICAgICAgICAqLwotICAgIDB4M2YwYiwgICAgIC8qICAwMDAwIDExMCAgICAgICAgICovCi0gICAgMHhmMzBiLCAgICAgLyogIDAwMDAgMTExMCAgICAgICAgICovCi0gICAgMHhmMzBiLCAgICAgLyogIDAwMDAgMTExICAgICAgICAgKi8KLSAgICAweGQ4MGIsICAgICAvKiAgMDAwMCAxMTExICAgICAgICAgKi8KLSAgICAweGQ4MGIsICAgICAvKiAgMDAwMCAxMTEgICAgICAgICAqLwotICAgIDB4ZTYwYiwgICAgIC8qICAwMDAgICAgICAgICAgICovCi0gICAgMHhlNjBiLCAgICAgLyogIDAwMCAwMDAwICAgICAgICAgKi8KLSAgICAweDJmMGIsICAgICAvKiAgMDAwIDAwICAgICAgICAgICovCi0gICAgMHgyZjBiLCAgICAgLyogIDAwMCAwMDAwICAgICAgICAgKi8KLSAgICAweGYyMGIsICAgICAvKiAgMDAwIDAgMCAgICAgICAgICovCi0gICAgMHhmMjBiLCAgICAgLyogIDAwMCAwICAgICAgICAgICovCi0gICAgMHg2ZTBjLCAgICAgLyogIDAwMCAwIDEwICAgICAgICAqLwotICAgIDB4ZjAwYywgICAgIC8qICAwMDAgMCAxMSAgICAgICAgKi8KLSAgICAweDFmMGIsICAgICAvKiAgMDAwICAwMCAgICAgICAgICovCi0gICAgMHgxZjBiLCAgICAgLyogIDAwMCAgMCAgICAgICAgICovCi0gICAgMHhmMTBiLCAgICAgLyogIDAwMCAgMDEgICAgICAgICAqLwotICAgIDB4ZjEwYiwgICAgIC8qICAwMDAgIDAgICAgICAgICAqLwotICAgIDB4OWMwYiwgICAgIC8qICAwMDAgIDEwICAgICAgICAgKi8KLSAgICAweDljMGIsICAgICAvKiAgMDAwICAxICAgICAgICAgKi8KLSAgICAweGM5MGIsICAgICAvKiAgMDAwICAxMSAgICAgICAgICovCi0gICAgMHhjOTBiLCAgICAgLyogIDAwMCAgMSAgICAgICAgICovCi0gICAgMHg1ZTBiLCAgICAgLyogIDAwMCAwMTAwMCAgICAgICAgICovCi0gICAgMHg1ZTBiLCAgICAgLyogIDAwMCAwMTAwICAgICAgICAgKi8KLSAgICAweGFiMGIsICAgICAvKiAgMDAwIDAxICAgICAgICAgICovCi0gICAgMHhhYjBiLCAgICAgLyogIDAwMCAwMTAwICAgICAgICAgKi8KLSAgICAweGJhMGIsICAgICAvKiAgMDAwIDAxMDEwICAgICAgICAgKi8KLSAgICAweGJhMGIsICAgICAvKiAgMDAwIDAxMDEgICAgICAgICAqLwotICAgIDB4ZTUwYiwgICAgIC8qICAwMDAgMDEwMTEgICAgICAgICAqLwotICAgIDB4ZTUwYiwgICAgIC8qICAwMDAgMDEwMSAgICAgICAgICovCi0gICAgMHg3ZDBiLCAgICAgLyogIDAwMCAwMTEwMCAgICAgICAgICovCi0gICAgMHg3ZDBiLCAgICAgLyogIDAwMCAwMTEwICAgICAgICAgKi8KLSAgICAweGQ3MGIsICAgICAvKiAgMDAwIDAxMTAxICAgICAgICAgKi8KLSAgICAweGQ3MGIsCi0gICAgMHg0ZTBiLCAgICAgLyogIDAwMCAwMTExMCAgICAgICAgICovCi0gICAgMHg0ZTBiLAotICAgIDB4ZTQwYiwgICAgIC8qICAwMDAgMDExMTEgICAgICAgICAqLwotICAgIDB4ZTQwYiwgICAgIC8qICAwMDAgMDExMSAgICAgICAgICovCi0gICAgMHg4YzBiLAotICAgIDB4OGMwYiwgICAgIC8qICAwMDAgMTAwMCAgICAgICAgICovCi0gICAgMHhjODBiLCAgICAgLyogIDAwMCAxMCAgICAgICAgICAqLwotICAgIDB4YzgwYiwKLSAgICAweDNlMGIsICAgICAvKiAgMDAwIDEgMCAgICAgICAgICovCi0gICAgMHgzZTBiLCAgICAgLyogIDAwMCAxICAgICAgICAgICovCi0gICAgMHg2ZDBiLAotICAgIDB4NmQwYiwgICAgIC8qICAwMDAgMSAgICAgICAgICAqLwotICAgIDB4ZDYwYiwgICAgIC8qICAwMDAgMTAxMDAgICAgICAgICAqLwotICAgIDB4ZDYwYiwgICAgIC8qICAwMDAgMTAxMCAgICAgICAgICovCi0gICAgMHhlMzBiLAotICAgIDB4ZTMwYiwgICAgIC8qICAwMDAgMTAxMCAgICAgICAgICovCi0gICAgMHg5YjBiLCAgICAgLyogIDAwMCAxMDExMCAgICAgICAgICovCi0gICAgMHg5YjBiLCAgICAgLyogIDAwMCAxMDExICAgICAgICAgKi8KLSAgICAweGI5MGIsCi0gICAgMHhiOTBiLCAgICAgLyogIDAwMCAxMDExICAgICAgICAgKi8KLSAgICAweDJlMGIsICAgICAvKiAgMDAwIDExMDAwICAgICAgICAgKi8KLSAgICAweDJlMGIsICAgICAvKiAgMDAwIDExMDAgICAgICAgICAqLwotICAgIDB4YWEwYiwKLSAgICAweGFhMGIsICAgICAvKiAgMDAwIDExMDAgICAgICAgICAqLwotICAgIDB4ZTIwYiwKLSAgICAweGUyMGIsICAgICAvKiAgMDAwIDExMDEgICAgICAgICAqLwotICAgIDB4MWUwYiwKLSAgICAweDFlMGIsICAgICAvKiAgMDAwIDExMDEgICAgICAgICAqLwotICAgIDB4ZTEwYiwKLSAgICAweGUxMGIsICAgICAvKiAgMDAwIDExMTAgICAgICAgICAqLwotICAgIDB4MGUwYywKLSAgICAweGUwMGMsICAgICAvKiAgMDAwIDExMTAxMSAgICAgICAgKi8KLSAgICAweDVkMGIsCi0gICAgMHg1ZDBiLCAgICAgLyogIDAwMCAxMTExICAgICAgICAgKi8KLSAgICAweGQ1MGIsCi0gICAgMHhkNTBiLCAgICAgLyogIDAwMCAxMTExICAgICAgICAgKi8KLSAgICAweGZmMGQsCi0gICAgMHhlZjBkLAotICAgIDB4ZmUwZCwKLSAgICAweGRmMGQsCi0gICAgMHhlZTBjLAotICAgIDB4ZWUwYywKLSAgICAweGZkMGQsCi0gICAgMHhjZjBkLAotICAgIDB4ZmMwZCwKLSAgICAweGRlMGQsCi0gICAgMHhlZDBkLAotICAgIDB4YmYwZCwKLSAgICAweGZiMGMsCi0gICAgMHhmYjBjLAotICAgIDB4Y2UwZCwKLSAgICAweGVjMGQsCi0gICAgMHhkZDBjLCAgICAgLyogICAgMDAwICAgICAgICAqLwotICAgIDB4ZGQwYywgICAgIC8qICAgIDAwICAgICAgICAqLwotICAgIDB4YWYwYywgICAgIC8qICAgICAgICAgICAgICovCi0gICAgMHhhZjBjLCAgICAgLyogICAgMDAgICAgICAgICovCi0gICAgMHhmYTBjLCAgICAgLyogICAgMDEwICAgICAgICAqLwotICAgIDB4ZmEwYywgICAgIC8qICAgIDAxICAgICAgICAqLwotICAgIDB4YmUwYywgICAgIC8qICAgIDAxMSAgICAgICAgKi8KLSAgICAweGJlMGMsICAgICAvKiAgICAwMSAgICAgICAgKi8KLSAgICAweGViMGMsICAgICAvKiAgICAxMDAgICAgICAgICovCi0gICAgMHhlYjBjLCAgICAgLyogICAgMTAgICAgICAgICovCi0gICAgMHhjZDBjLCAgICAgLyogICAgMTAxICAgICAgICAqLwotICAgIDB4Y2QwYywgICAgIC8qICAgIDEwICAgICAgICAqLwotICAgIDB4ZGMwYywgICAgIC8qICAgIDExMCAgICAgICAgKi8KLSAgICAweGRjMGMsICAgICAvKiAgICAxMSAgICAgICAgKi8KLSAgICAweDlmMGMsICAgICAvKiAgICAxMTEgICAgICAgICovCi0gICAgMHg5ZjBjLCAgICAgLyogICAgMTEgICAgICAgICovCi0gICAgMHhmOTBjLCAgICAgLyogICAgMDAwMCAgICAgICAgKi8KLSAgICAweGY5MGMsICAgICAvKiAgICAwMDAgICAgICAgICovCi0gICAgMHhlYTBjLCAgICAgLyogICAgMCAgICAgICAgICovCi0gICAgMHhlYTBjLCAgICAgLyogICAgMDAwICAgICAgICAqLwotICAgIDB4YmQwYywgICAgIC8qICAgICAwICAgICAgICAqLwotICAgIDB4YmQwYywgICAgIC8qICAgICAgICAgICAgICovCi0gICAgMHhkYjBjLCAgICAgLyogICAgIDEgICAgICAgICovCi0gICAgMHhkYjBjLCAgICAgLyogICAgICAgICAgICAgKi8KLSAgICAweDhmMGMsICAgICAvKiAgICAwMTAwICAgICAgICAqLwotICAgIDB4OGYwYywgICAgIC8qICAgIDAxMCAgICAgICAgKi8KLSAgICAweGY4MGMsICAgICAvKiAgICAwMTAxICAgICAgICAqLwotICAgIDB4ZjgwYywgICAgIC8qICAgIDAxMCAgICAgICAgKi8KLSAgICAweGNjMGMsCi0gICAgMHhjYzBjLCAgICAgLyogICAgMDExICAgICAgICAqLwotICAgIDB4OWUwYywgICAgIC8qICAgIDAxMTEgICAgICAgICovCi0gICAgMHg5ZTBjLCAgICAgLyogICAgMDExICAgICAgICAqLwotICAgIDB4ZTkwYywgICAgIC8qICAgIDEwMDAgICAgICAgICovCi0gICAgMHhlOTBjLCAgICAgLyogICAgMTAwICAgICAgICAqLwotICAgIDB4N2YwYywgICAgIC8qICAgIDEgICAgICAgICAqLwotICAgIDB4N2YwYywKLSAgICAweGY3MGMsICAgICAvKiAgICAxMDEwICAgICAgICAqLwotICAgIDB4ZjcwYywgICAgIC8qICAgIDEwMSAgICAgICAgKi8KLSAgICAweGFkMGMsICAgICAvKiAgICAxMDExICAgICAgICAqLwotICAgIDB4YWQwYywgICAgIC8qICAgIDEwMSAgICAgICAgKi8KLSAgICAweGRhMGMsICAgICAvKiAgICAxMTAwICAgICAgICAqLwotICAgIDB4ZGEwYywgICAgIC8qICAgIDExMCAgICAgICAgKi8KLSAgICAweGJjMGMsCi0gICAgMHhiYzBjLCAgICAgLyogICAgMTEwICAgICAgICAqLwotICAgIDB4NmYwYywgICAgIC8qICAgIDExMTAgICAgICAgICovCi0gICAgMHg2ZjBjLCAgICAgLyogICAgMTExICAgICAgICAqLwotICAgIDB4YWUwZCwgICAgIC8qICAgIDExMTEwICAgICAgICovCi0gICAgMHgwZjBkCi19OwotCi1jb25zdCB1aW50MTYgaHVmZlRhYmxlXzE2WzQ2NV0gPQotewotICAgIDB4MDAwMSwKLSAgICAweDExMDQsCi0gICAgMHgwMTA0LAotICAgIDB4MTAwMywKLSAgICAweDEwMDMsCi0gICAgMHgyMzA4LAotICAgIDB4MzIwOCwgICAgIC8qICAgIDExICAgICAgICAgICAgKi8KLSAgICAweDEzMDcsICAgICAvKiAgIDAxMDAgICAgICAgICAgICAgKi8KLSAgICAweDEzMDcsICAgICAvKiAgIDAxMCAgICAgICAgICAgICAqLwotICAgIDB4MzEwNywKLSAgICAweDMxMDcsCi0gICAgMHgwMzA4LAotICAgIDB4MzAwOCwKLSAgICAweDIyMDcsICAgICAvKiAgIDAxMTEgICAgICAgICAgICAgKi8KLSAgICAweDIyMDcsICAgICAvKiAgIDAxMSAgICAgICAgICAgICAqLwotICAgIDB4MTIwNiwgICAgIC8qICAgMTAwICAgICAgICAgICAgICAqLwotICAgIDB4MTIwNiwgICAgIC8qICAgMTAgICAgICAgICAgICAgICovCi0gICAgMHgxMjA2LCAgICAgLyogICAxMCAgICAgICAgICAgICAgKi8KLSAgICAweDEyMDYsICAgICAvKiAgIDEwICAgICAgICAgICAgICAqLwotICAgIDB4MjEwNiwgICAgIC8qICAgMTAxICAgICAgICAgICAgICAqLwotICAgIDB4MjEwNiwgICAgIC8qICAgMTAgICAgICAgICAgICAgKi8KLSAgICAweDIxMDYsICAgICAvKiAgIDEwICAgICAgICAgICAgICovCi0gICAgMHgyMTA2LCAgICAgLyogICAxMCAgICAgICAgICAgICAqLwotICAgIDB4MDIwNiwKLSAgICAweDAyMDYsCi0gICAgMHgwMjA2LAotICAgIDB4MDIwNiwKLSAgICAweDIwMDYsCi0gICAgMHgyMDA2LAotICAgIDB4MjAwNiwKLSAgICAweDIwMDYsCi0gICAgMHgxNzA5LAotICAgIDB4MTcwOSwgICAgIC8qICAwIDAxMTEgICAgICAgICAgICovCi0gICAgMHg3MTA5LCAgICAgLyogIDAgMTAwMDAgICAgICAgICAgICovCi0gICAgMHg3MTA5LCAgICAgLyogIDAgMTAwMCAgICAgICAgICAgKi8KLSAgICAweDcwMGEsICAgICAvKiAgMCAxMCAwICAgICAgICAgICovCi0gICAgMHgzNjBhLCAgICAgLyogIDAgMTAgMSAgICAgICAgICAqLwotICAgIDB4NjMwYSwgICAgIC8qICAwIDEgMDAgICAgICAgICAgKi8KLSAgICAweDQ1MGEsICAgICAvKiAgMCAxIDAxICAgICAgICAgICovCi0gICAgMHg1NDBhLCAgICAgLyogIDAgMSAxMCAgICAgICAgICAqLwotICAgIDB4MjYwYSwgICAgIC8qICAwIDEgMTEgICAgICAgICAgKi8KLSAgICAweDYyMDksICAgICAvKiAgMCAxMDEwMCAgICAgICAgICAgKi8KLSAgICAweDYyMDksICAgICAvKiAgMCAxMDEwICAgICAgICAgICAqLwotICAgIDB4MTYwOSwKLSAgICAweDE2MDksCi0gICAgMHg2MTA5LCAgICAgLyogIDAgMTAxMTAgICAgICAgICAgICovCi0gICAgMHg2MTA5LCAgICAgLyogIDAgMTAxMSAgICAgICAgICAgKi8KLSAgICAweDA2MGEsICAgICAvKiAgMCAxMDExMTAgICAgICAgICAgKi8KLSAgICAweDYwMGEsCi0gICAgMHg1MzA5LAotICAgIDB4NTMwOSwgICAgIC8qICAwIDExMDAgICAgICAgICAgICovCi0gICAgMHgzNTBhLCAgICAgLyogIDAgMTEgMCAgICAgICAgICAqLwotICAgIDB4NDQwYSwgICAgIC8qICAwIDExIDEgICAgICAgICAgKi8KLSAgICAweDI1MDksICAgICAvKiAgMCAxMTAxMCAgICAgICAgICAgKi8KLSAgICAweDI1MDksICAgICAvKiAgMCAxMTAxICAgICAgICAgICAqLwotICAgIDB4NTIwOSwgICAgIC8qICAwIDExMDExICAgICAgICAgICAqLwotICAgIDB4NTIwOSwgICAgIC8qICAwIDExMDEgICAgICAgICAgICovCi0gICAgMHg1MTA4LAotICAgIDB4NTEwOCwKLSAgICAweDUxMDgsCi0gICAgMHg1MTA4LAotICAgIDB4MTUwOSwKLSAgICAweDE1MDksICAgICAvKiAgMCAxMTExICAgICAgICAgICAqLwotICAgIDB4MDUwOSwgICAgIC8qICAwIDExMTExICAgICAgICAgICAqLwotICAgIDB4MDUwOSwgICAgIC8qICAwIDExMTEgICAgICAgICAgICovCi0gICAgMHgzNDA5LCAgICAgLyogICAgICAgICAgICAgICAqLwotICAgIDB4MzQwOSwgICAgIC8qICAgICAgICAgICAgICAgKi8KLSAgICAweDQzMDksICAgICAvKiAgIDAwMCAgICAgICAgICAgICovCi0gICAgMHg0MzA5LCAgICAgLyogICAgICAgICAgICAgICAqLwotICAgIDB4NTAwOSwgICAgIC8qICAgMDAgMCAgICAgICAgICAgKi8KLSAgICAweDUwMDksICAgICAvKiAgIDAwICAgICAgICAgICAgKi8KLSAgICAweDI0MDksICAgICAvKiAgIDAwIDEgICAgICAgICAgICovCi0gICAgMHgyNDA5LCAgICAgLyogICAwMCAgICAgICAgICAgICovCi0gICAgMHg0MjA5LCAgICAgLyogICAwIDAwICAgICAgICAgICAqLwotICAgIDB4NDIwOSwgICAgIC8qICAgMCAwICAgICAgICAgICAqLwotICAgIDB4MzMwOSwgICAgIC8qICAgMCAwMSAgICAgICAgICAgKi8KLSAgICAweDMzMDksICAgICAvKiAgIDAgMCAgICAgICAgICAgKi8KLSAgICAweDE0MDgsICAgICAvKiAgIDAgMSAgICAgICAgICAgICovCi0gICAgMHgxNDA4LCAgICAgLyogICAwICAgICAgICAgICAgKi8KLSAgICAweDE0MDgsICAgICAvKiAgIDAgICAgICAgICAgICAqLwotICAgIDB4MTQwOCwgICAgIC8qICAgMCAgICAgICAgICAgICovCi0gICAgMHg0MTA4LCAgICAgLyogICAgMDAgICAgICAgICAgICAqLwotICAgIDB4NDEwOCwgICAgIC8qICAgIDAgICAgICAgICAgICAqLwotICAgIDB4NDEwOCwgICAgIC8qICAgIDAgICAgICAgICAgICAqLwotICAgIDB4NDEwOCwgICAgIC8qICAgIDAgICAgICAgICAgICAqLwotICAgIDB4MDQwOSwgICAgIC8qICAgIDAxMCAgICAgICAgICAgKi8KLSAgICAweDA0MDksICAgICAvKiAgICAwMSAgICAgICAgICAgKi8KLSAgICAweDQwMDksICAgICAvKiAgICAwMTEgICAgICAgICAgICovCi0gICAgMHg0MDA5LCAgICAgLyogICAgMDEgICAgICAgICAgICovCi0gICAgMHgxZDBiLAotICAgIDB4MWQwYiwgICAgIC8qICAwMCAxMDEwMSAgICAgICAgICovCi0gICAgMHhjNDBjLCAgICAgLyogIDAwIDEwMTEwMDAgICAgICAgICovCi0gICAgMHg2YjBjLCAgICAgLyogIDAwIDEwMTEgICAgICAgICAqLwotICAgIDB4YzMwYywgICAgIC8qICAwMCAxMDExMDEwICAgICAgICAqLwotICAgIDB4YTcwYywgICAgIC8qICAwMCAxMDExMDExICAgICAgICAqLwotICAgIDB4MmMwYiwgICAgIC8qICAwMCAxMDExMTAgICAgICAgICAqLwotICAgIDB4MmMwYiwgICAgIC8qICAwMCAxMDExMSAgICAgICAgICovCi0gICAgMHhjMjBjLCAgICAgLyogIDAwIDEwMTExMTAgICAgICAgICovCi0gICAgMHhiNTBjLCAgICAgLyogIDAwIDEwMTExMTEgICAgICAgICovCi0gICAgMHhjMTBjLCAgICAgLyogIDAwIDExMDAwMDAgICAgICAgICovCi0gICAgMHgwYzBjLCAgICAgLyogIDAwIDExMDAgICAgICAgICAqLwotICAgIDB4NGIwYywgICAgIC8qICAwMCAxMTAgMCAgICAgICAgKi8KLSAgICAweGI0MGMsICAgICAvKiAgMDAgMTEwIDEgICAgICAgICovCi0gICAgMHg2YTBjLCAgICAgLyogIDAwIDExIDAwICAgICAgICAqLwotICAgIDB4YTYwYywgICAgIC8qICAwMCAxMSAwMSAgICAgICAgKi8KLSAgICAweGIzMGIsICAgICAvKiAgMDAgMTEgMSAgICAgICAgICovCi0gICAgMHhiMzBiLCAgICAgLyogIDAwIDExICAgICAgICAgICovCi0gICAgMHg1YTBjLCAgICAgLyogIDAwIDExMDEwMDAgICAgICAgICovCi0gICAgMHhhNTBjLCAgICAgLyogIDAwIDExMDEgICAgICAgICAqLwotICAgIDB4MmIwYiwgICAgIC8qICAwMCAxMTAxMDEgICAgICAgICAqLwotICAgIDB4MmIwYiwgICAgIC8qICAwMCAxMTAxMCAgICAgICAgICovCi0gICAgMHhiMjBiLCAgICAgLyogIDAwIDExMDExMCAgICAgICAgICovCi0gICAgMHhiMjBiLCAgICAgLyogIDAwIDExMDExICAgICAgICAgKi8KLSAgICAweDFiMGIsICAgICAvKiAgMDAgMTEwMTExICAgICAgICAgKi8KLSAgICAweDFiMGIsICAgICAvKiAgMDAgMTEwMTEgICAgICAgICAqLwotICAgIDB4YjEwYiwgICAgIC8qICAwMCAxMTEwMDAgICAgICAgICAqLwotICAgIDB4YjEwYiwgICAgIC8qICAwMCAxMTEwMCAgICAgICAgICovCi0gICAgMHgwYjBjLCAgICAgLyogIDAwIDExMSAwICAgICAgICAqLwotICAgIDB4YjAwYywgICAgIC8qICAwMCAxMTEgMSAgICAgICAgKi8KLSAgICAweDY5MGMsICAgICAvKiAgMDAgMTExMDEwMCAgICAgICAgKi8KLSAgICAweDk2MGMsICAgICAvKiAgMDAgMTExMDEwMSAgICAgICAgKi8KLSAgICAweDRhMGMsICAgICAvKiAgMDAgMTExMDExMCAgICAgICAgKi8KLSAgICAweGE0MGMsICAgICAvKiAgMDAgMTExMDExMSAgICAgICAgKi8KLSAgICAweDc4MGMsICAgICAvKiAgMDAgMTExMTAwMCAgICAgICAgKi8KLSAgICAweDg3MGMsICAgICAvKiAgMDAgMTExMSAgICAgICAgICovCi0gICAgMHhhMzBiLCAgICAgLyogIDAwIDExMTEwMSAgICAgICAgICovCi0gICAgMHhhMzBiLCAgICAgLyogIDAwIDExMTEwICAgICAgICAgKi8KLSAgICAweDNhMGMsICAgICAvKiAgMDAgMTExMTEwMCAgICAgICAgKi8KLSAgICAweDU5MGMsICAgICAvKiAgMDAgMTExMTEwMSAgICAgICAgKi8KLSAgICAweDJhMGIsICAgICAvKiAgMDAgMTExMTExICAgICAgICAgKi8KLSAgICAweDJhMGIsICAgICAvKiAgMDAgMTExMTEgICAgICAgICAqLwotICAgIDB4OTUwYywgICAgIC8qICAwIDAwMDAwMDAwICAgICAgICAqLwotICAgIDB4NjgwYywgICAgIC8qICAwICAgICAgICAgICAqLwotICAgIDB4YTEwYiwgICAgIC8qICAwIDAwMDAgICAgICAgICAgKi8KLSAgICAweGExMGIsICAgICAvKiAgMCAgICAgICAgICAgKi8KLSAgICAweDg2MGMsICAgICAvKiAgMCAwMDAgMDAgICAgICAgICovCi0gICAgMHg3NzBjLCAgICAgLyogIDAgMDAwIDAxICAgICAgICAqLwotICAgIDB4OTQwYiwgICAgIC8qICAwIDAwMCAxICAgICAgICAgKi8KLSAgICAweDk0MGIsICAgICAvKiAgMCAwMDAgICAgICAgICAgKi8KLSAgICAweDQ5MGMsICAgICAvKiAgMCAwMCAwMDAgICAgICAgICovCi0gICAgMHg1NzBjLCAgICAgLyogIDAgMDAgICAgICAgICAgKi8KLSAgICAweDY3MGIsICAgICAvKiAgMCAwMCAwMSAgICAgICAgICovCi0gICAgMHg2NzBiLCAgICAgLyogIDAgMDAgMCAgICAgICAgICovCi0gICAgMHhhMjBhLCAgICAgLyogIDAgMDAgMSAgICAgICAgICAqLwotICAgIDB4YTIwYSwgICAgIC8qICAwIDAwICAgICAgICAgICovCi0gICAgMHhhMjBhLCAgICAgLyogIDAgMDAgICAgICAgICAgKi8KLSAgICAweGEyMGEsICAgICAvKiAgMCAwMCAgICAgICAgICAqLwotICAgIDB4MWEwYSwgICAgIC8qICAwIDAgMDAgICAgICAgICAgKi8KLSAgICAweDFhMGEsICAgICAvKiAgMCAwIDAgICAgICAgICAgKi8KLSAgICAweDFhMGEsICAgICAvKiAgMCAwIDAgICAgICAgICAgKi8KLSAgICAweDFhMGEsICAgICAvKiAgMCAwIDAgICAgICAgICAgKi8KLSAgICAweDBhMGIsICAgICAvKiAgMCAwIDAxMCAgICAgICAgICovCi0gICAgMHgwYTBiLCAgICAgLyogIDAgMCAwMSAgICAgICAgICovCi0gICAgMHhhMDBiLCAgICAgLyogIDAgMCAwMTEgICAgICAgICAqLwotICAgIDB4YTAwYiwgICAgIC8qICAwIDAgMDEgICAgICAgICAqLwotICAgIDB4MzkwYiwgICAgIC8qICAwIDAgMTAwICAgICAgICAgKi8KLSAgICAweDM5MGIsICAgICAvKiAgMCAwIDEwICAgICAgICAgKi8KLSAgICAweDkzMGIsICAgICAvKiAgMCAwIDEwMSAgICAgICAgICovCi0gICAgMHg5MzBiLCAgICAgLyogIDAgMCAxMCAgICAgICAgICovCi0gICAgMHg1ODBiLCAgICAgLyogIDAgMCAxMTAgICAgICAgICAqLwotICAgIDB4NTgwYiwgICAgIC8qICAwIDAgMTEgICAgICAgICAqLwotICAgIDB4ODUwYiwgICAgIC8qICAwIDAgMTExICAgICAgICAgKi8KLSAgICAweDg1MGIsICAgICAvKiAgMCAwIDExICAgICAgICAgKi8KLSAgICAweDI5MGEsICAgICAvKiAgMCAgMDAwICAgICAgICAgICovCi0gICAgMHgyOTBhLCAgICAgLyogIDAgIDAwICAgICAgICAgICovCi0gICAgMHgyOTBhLCAgICAgLyogIDAgIDAwICAgICAgICAgICovCi0gICAgMHgyOTBhLCAgICAgLyogIDAgIDAwICAgICAgICAgICovCi0gICAgMHg5MjBhLCAgICAgLyogIDAgICAgICAgICAgICAgKi8KLSAgICAweDkyMGEsICAgICAvKiAgMCAgMDAgICAgICAgICAqLwotICAgIDB4OTIwYSwgICAgIC8qICAwICAwMCAgICAgICAgICovCi0gICAgMHg5MjBhLCAgICAgLyogIDAgIDAwICAgICAgICAgKi8KLSAgICAweDc2MGIsICAgICAvKiAgMCAgMDEwMCAgICAgICAgICovCi0gICAgMHg3NjBiLCAgICAgLyogIDAgIDAxMCAgICAgICAgICovCi0gICAgMHgwOTBiLCAgICAgLyogIDAgIDAxMDEgICAgICAgICAqLwotICAgIDB4MDkwYiwgICAgIC8qICAwICAwMTAgICAgICAgICAqLwotICAgIDB4MTkwYSwgICAgIC8qICAwICAwMTEgICAgICAgICAgKi8KLSAgICAweDE5MGEsICAgICAvKiAgMCAgMDEgICAgICAgICAqLwotICAgIDB4MTkwYSwgICAgIC8qICAwICAwMSAgICAgICAgICovCi0gICAgMHgxOTBhLCAgICAgLyogIDAgIDAxICAgICAgICAgKi8KLSAgICAweDkxMGEsICAgICAvKiAgMCAgMTAwICAgICAgICAgICovCi0gICAgMHg5MTBhLCAgICAgLyogIDAgIDEwICAgICAgICAgICovCi0gICAgMHg5MTBhLCAgICAgLyogIDAgIDEwICAgICAgICAgICovCi0gICAgMHg5MTBhLCAgICAgLyogIDAgIDEwICAgICAgICAgICovCi0gICAgMHg5MDBiLCAgICAgLyogIDAgIDEwMTAgICAgICAgICAqLwotICAgIDB4OTAwYiwgICAgIC8qICAwICAxMDEgICAgICAgICAqLwotICAgIDB4NDgwYiwgICAgIC8qICAwICAxMDExICAgICAgICAgKi8KLSAgICAweDQ4MGIsICAgICAvKiAgMCAgMTAxICAgICAgICAgKi8KLSAgICAweDg0MGIsICAgICAvKiAgMCAgMTEwMCAgICAgICAgICovCi0gICAgMHg4NDBiLCAgICAgLyogIDAgIDExMCAgICAgICAgICovCi0gICAgMHg3NTBiLCAgICAgLyogIDAgIDExMDEgICAgICAgICAqLwotICAgIDB4NzUwYiwgICAgIC8qICAwICAxMTAgICAgICAgICAqLwotICAgIDB4MzgwYiwgICAgIC8qICAwICAxMTEwICAgICAgICAgKi8KLSAgICAweDM4MGIsICAgICAvKiAgMCAgMTExICAgICAgICAgKi8KLSAgICAweDgzMGIsICAgICAvKiAgMCAgMTExMSAgICAgICAgICovCi0gICAgMHg4MzBiLCAgICAgLyogIDAgIDExMSAgICAgICAgICovCi0gICAgMHg2NjBiLCAgICAgLyogIDAgMDEwMDAwMCAgICAgICAgICovCi0gICAgMHg2NjBiLCAgICAgLyogIDAgMDEwMDAwICAgICAgICAgKi8KLSAgICAweDI4MGIsICAgICAvKiAgMCAwMTAwICAgICAgICAgICovCi0gICAgMHgyODBiLCAgICAgLyogIDAgMDEwMDAwICAgICAgICAgKi8KLSAgICAweDgyMGEsICAgICAvKiAgMCAwMTAgICAgICAgICAgICovCi0gICAgMHg4MjBhLCAgICAgLyogIDAgMDEwMDAgICAgICAgICAqLwotICAgIDB4ODIwYSwgICAgIC8qICAwIDAxMDAwICAgICAgICAgKi8KLSAgICAweDgyMGEsICAgICAvKiAgMCAwMTAwMCAgICAgICAgICovCi0gICAgMHg0NzBiLCAgICAgLyogIDAgMDEgMDAgICAgICAgICAqLwotICAgIDB4NDcwYiwgICAgIC8qICAwIDAxIDAgICAgICAgICAqLwotICAgIDB4NzQwYiwgICAgIC8qICAwIDAxIDAxICAgICAgICAgKi8KLSAgICAweDc0MGIsICAgICAvKiAgMCAwMSAwICAgICAgICAgKi8KLSAgICAweDE4MGEsICAgICAvKiAgMCAwMSAxICAgICAgICAgICovCi0gICAgMHgxODBhLCAgICAgLyogIDAgMDEgICAgICAgICAgKi8KLSAgICAweDE4MGEsICAgICAvKiAgMCAwMSAgICAgICAgICAqLwotICAgIDB4MTgwYSwgICAgIC8qICAwIDAxICAgICAgICAgICovCi0gICAgMHg4MTBhLCAgICAgLyogIDAgMDEwMTAwICAgICAgICAgICovCi0gICAgMHg4MTBhLCAgICAgLyogIDAgMDEwMTAgICAgICAgICAgKi8KLSAgICAweDgxMGEsICAgICAvKiAgMCAwMTAxMCAgICAgICAgICAqLwotICAgIDB4ODEwYSwgICAgIC8qICAwIDAxMDEwICAgICAgICAgICovCi0gICAgMHg4MDBhLCAgICAgLyogIDAgMDEwMTAxICAgICAgICAgICovCi0gICAgMHg4MDBhLCAgICAgLyogIDAgMDEwMTAgICAgICAgICAqLwotICAgIDB4ODAwYSwgICAgIC8qICAwIDAxMDEwICAgICAgICAgKi8KLSAgICAweDgwMGEsICAgICAvKiAgMCAwMTAxMCAgICAgICAgICovCi0gICAgMHgwODBiLCAgICAgLyogIDAgMDEwMTEwMCAgICAgICAgICovCi0gICAgMHgwODBiLCAgICAgLyogIDAgMDEwMTEwICAgICAgICAgKi8KLSAgICAweDU2MGIsICAgICAvKiAgMCAwMTAxMTAxICAgICAgICAgKi8KLSAgICAweDU2MGIsICAgICAvKiAgMCAwMTAxMTAgICAgICAgICAqLwotICAgIDB4MzcwYSwgICAgIC8qICAwIDAxMDExMSAgICAgICAgICAqLwotICAgIDB4MzcwYSwgICAgIC8qICAwIDAxMDExICAgICAgICAgKi8KLSAgICAweDM3MGEsICAgICAvKiAgMCAwMTAxMSAgICAgICAgICovCi0gICAgMHgzNzBhLCAgICAgLyogIDAgMDEwMTEgICAgICAgICAqLwotICAgIDB4NzMwYSwgICAgIC8qICAwIDAxMTAwMCAgICAgICAgICAqLwotICAgIDB4NzMwYSwgICAgIC8qICAwIDAxMTAwICAgICAgICAgICovCi0gICAgMHg3MzBhLCAgICAgLyogIDAgMDExMDAgICAgICAgICAgKi8KLSAgICAweDczMGEsICAgICAvKiAgMCAwMTEwMCAgICAgICAgICAqLwotICAgIDB4NjUwYiwgICAgIC8qICAwIDAxMSAwICAgICAgICAgKi8KLSAgICAweDY1MGIsICAgICAvKiAgMCAwMTEgICAgICAgICAgKi8KLSAgICAweDQ2MGIsICAgICAvKiAgMCAwMTEgMSAgICAgICAgICovCi0gICAgMHg0NjBiLCAgICAgLyogIDAgMDExICAgICAgICAgICovCi0gICAgMHgyNzBhLCAgICAgLyogIDAgMDExMDEwICAgICAgICAgICovCi0gICAgMHgyNzBhLCAgICAgLyogIDAgMDExMDEgICAgICAgICAgKi8KLSAgICAweDI3MGEsICAgICAvKiAgMCAwMTEwMSAgICAgICAgICAqLwotICAgIDB4MjcwYSwgICAgIC8qICAwIDAxMTAxICAgICAgICAgICovCi0gICAgMHg3MjBhLCAgICAgLyogIDAgMDExMDExICAgICAgICAgICovCi0gICAgMHg3MjBhLCAgICAgLyogIDAgMDExMDEgICAgICAgICAqLwotICAgIDB4NzIwYSwgICAgIC8qICAwIDAxMTAxICAgICAgICAgKi8KLSAgICAweDcyMGEsICAgICAvKiAgMCAwMTEwMSAgICAgICAgICovCi0gICAgMHg2NDBiLCAgICAgLyogIDAgMDExMTAwMCAgICAgICAgICovCi0gICAgMHg2NDBiLCAgICAgLyogIDAgMDExMTAwICAgICAgICAgKi8KLSAgICAweDU1MGIsICAgICAvKiAgMCAwMTExICAgICAgICAgICovCi0gICAgMHg1NTBiLCAgICAgLyogIDAgMDExMTAwICAgICAgICAgKi8KLSAgICAweDA3MGEsICAgICAvKiAgMCAwMTExMDEgICAgICAgICAgKi8KLSAgICAweDA3MGEsICAgICAvKiAgMCAwMTExMCAgICAgICAgICovCi0gICAgMHgwNzBhLCAgICAgLyogIDAgMDExMTAgICAgICAgICAqLwotICAgIDB4MDcwYSwgICAgIC8qICAwIDAxMTEwICAgICAgICAgKi8KLSAgICAweDllMGQsCi0gICAgMHg5ZTBkLCAgICAgLyogIDAwIDAxMTAwMDAgICAgICAgKi8KLSAgICAweGJjMGUsICAgICAvKiAgMDAgMDExMDAgMCAgICAgICovCi0gICAgMHhjYjBlLCAgICAgLyogIDAwIDAxMTAwIDEgICAgICAqLwotICAgIDB4OGUwZSwgICAgIC8qICAwMCAwMTEwIDAwICAgICAgKi8KLSAgICAweGU4MGUsICAgICAvKiAgMDAgMDExMCAwMSAgICAgICovCi0gICAgMHg5ZDBlLCAgICAgLyogIDAwIDAxMTAgMTAgICAgICAqLwotICAgIDB4ZTcwZSwgICAgIC8qICAwMCAwMTEwIDExICAgICAgKi8KLSAgICAweGJiMGUsICAgICAvKiAgMDAgMDExIDAwMCAgICAgICovCi0gICAgMHg4ZDBlLCAgICAgLyogIDAwIDAxMSAgICAgICAgKi8KLSAgICAweGQ4MGUsICAgICAvKiAgMDAgMDExIDAxMCAgICAgICovCi0gICAgMHg2ZTBlLCAgICAgLyogIDAwIDAxMSAwMTEgICAgICAqLwotICAgIDB4ZTYwZCwgICAgIC8qICAwMCAwMTEgMTAgICAgICAgKi8KLSAgICAweGU2MGQsICAgICAvKiAgMDAgMDExIDEgICAgICAgKi8KLSAgICAweDljMGQsICAgICAvKiAgMDAgMDExIDExICAgICAgICovCi0gICAgMHg5YzBkLCAgICAgLyogIDAwIDAxMSAxICAgICAgICovCi0gICAgMHhhYjBlLCAgICAgLyogIDAwIDAxMTAxMDAwMCAgICAgICovCi0gICAgMHhiYTBlLCAgICAgLyogIDAwIDAxMTAxMCAgICAgICAqLwotICAgIDB4ZTUwZSwgICAgIC8qICAwMCAwMTEwMSAwICAgICAgKi8KLSAgICAweGQ3MGUsICAgICAvKiAgMDAgMDExMDEgMSAgICAgICovCi0gICAgMHg0ZTBkLCAgICAgLyogIDAwIDAxMTAxMDEwICAgICAgICovCi0gICAgMHg0ZTBkLCAgICAgLyogIDAwIDAxMTAxMDEgICAgICAgKi8KLSAgICAweGU0MGUsICAgICAvKiAgMDAgMDExMDEwMTEwICAgICAgKi8KLSAgICAweDhjMGUsICAgICAvKiAgMDAgMDExMDEwMTExICAgICAgKi8KLSAgICAweGM4MGQsICAgICAvKiAgMDAgMDExMDExMDAgICAgICAgKi8KLSAgICAweGM4MGQsICAgICAvKiAgMDAgMDExMDExMCAgICAgICAqLwotICAgIDB4M2UwZCwgICAgIC8qICAwMCAwMTEwMTEwMSAgICAgICAqLwotICAgIDB4M2UwZCwgICAgIC8qICAwMCAwMTEwMTEwICAgICAgICovCi0gICAgMHg2ZDBkLCAgICAgLyogIDAwIDAxMTAxMTEwICAgICAgICovCi0gICAgMHg2ZDBkLCAgICAgLyogIDAwIDAxMTAxMTEgICAgICAgKi8KLSAgICAweGQ2MGUsICAgICAvKiAgMDAgMDExMDExMTEwICAgICAgKi8KLSAgICAweDliMGUsICAgICAvKiAgMDAgMDExMDExMTExICAgICAgKi8KLSAgICAweGI5MGUsICAgICAvKiAgMDAgMDExMTAwMDAwICAgICAgKi8KLSAgICAweGFhMGUsICAgICAvKiAgMDAgMDExMTAwICAgICAgICovCi0gICAgMHhlMTBkLCAgICAgLyogIDAwIDAxMTEwICAgICAgICAqLwotICAgIDB4ZTEwZCwgICAgIC8qICAwMCAwMTExMDAwICAgICAgICovCi0gICAgMHhkNDBkLCAgICAgLyogIDAwIDAxMTEgMCAgICAgICAqLwotICAgIDB4ZDQwZCwgICAgIC8qICAwMCAwMTExICAgICAgICAqLwotICAgIDB4YjgwZSwgICAgIC8qICAwMCAwMTExIDEwICAgICAgKi8KLSAgICAweGE5MGUsICAgICAvKiAgMDAgMDExMSAxMSAgICAgICovCi0gICAgMHg3YjBkLCAgICAgLyogIDAwIDAxMTEwMTAwICAgICAgICovCi0gICAgMHg3YjBkLCAgICAgLyogIDAwIDAxMTEwMTAgICAgICAgKi8KLSAgICAweGI3MGUsICAgICAvKiAgMDAgMDExMTAxMDEwICAgICAgKi8KLSAgICAweGQwMGUsICAgICAvKiAgMDAgMDExMTAxMDExICAgICAgKi8KLSAgICAweGUzMGMsICAgICAvKiAgMDAgMDExMTAxMSAgICAgICAgKi8KLSAgICAweGUzMGMsICAgICAvKiAgMDAgMDExMTAxICAgICAgICovCi0gICAgMHhlMzBjLCAgICAgLyogIDAwIDAxMTEwMSAgICAgICAqLwotICAgIDB4ZTMwYywgICAgIC8qICAwMCAwMTExMDEgICAgICAgKi8KLSAgICAweDBlMGQsICAgICAvKiAgMDAgMDExMTEwMDAgICAgICAgKi8KLSAgICAweDBlMGQsICAgICAvKiAgMDAgMDExMTEwMCAgICAgICAqLwotICAgIDB4ZTAwZCwgICAgIC8qICAwMCAwMTExMSAgICAgICAgKi8KLSAgICAweGUwMGQsICAgICAvKiAgMDAgMDExMTEwMCAgICAgICAqLwotICAgIDB4NWQwZCwgICAgIC8qICAwMCAwMTExMTAxMCAgICAgICAqLwotICAgIDB4NWQwZCwgICAgIC8qICAwMCAwMTExMTAxICAgICAgICovCi0gICAgMHhkNTBkLCAgICAgLyogIDAwIDAxMTExMDExICAgICAgICovCi0gICAgMHhkNTBkLCAgICAgLyogIDAwIDAxMTExMDEgICAgICAgKi8KLSAgICAweDdjMGQsICAgICAvKiAgMDAgMDExMTExMDAgICAgICAgKi8KLSAgICAweDdjMGQsICAgICAvKiAgMDAgMDExMTExMCAgICAgICAqLwotICAgIDB4YzcwZCwgICAgIC8qICAwMCAwMTExMTEwMSAgICAgICAqLwotICAgIDB4YzcwZCwgICAgIC8qICAwMCAwMTExMTEwICAgICAgICovCi0gICAgMHg0ZDBkLCAgICAgLyogIDAwIDAxMTExMTEwICAgICAgICovCi0gICAgMHg0ZDBkLCAgICAgLyogIDAwIDAxMTExMTEgICAgICAgKi8KLSAgICAweDhiMGQsICAgICAvKiAgMDAgMDExMTExMTEgICAgICAgKi8KLSAgICAweDhiMGQsICAgICAvKiAgMDAgMDExMTExMSAgICAgICAqLwotICAgIDB4OWEwZCwKLSAgICAweDZjMGQsICAgICAvKiAgMDAgMTAwMDAgICAgICAgICovCi0gICAgMHhjNjBkLCAgICAgLyogIDAwIDEwMDAgMCAgICAgICAqLwotICAgIDB4M2QwZCwgICAgIC8qICAwMCAxMDAwIDEgICAgICAgKi8KLSAgICAweDVjMGQsICAgICAvKiAgMDAgMTAwIDAwICAgICAgICovCi0gICAgMHhjNTBkLCAgICAgLyogIDAwIDEwMCAwMSAgICAgICAqLwotICAgIDB4MGQwYywgICAgIC8qICAwMCAxMDAgMSAgICAgICAgKi8KLSAgICAweDBkMGMsICAgICAvKiAgMDAgMTAwICAgICAgICAgKi8KLSAgICAweDhhMGQsICAgICAvKiAgMDAgMTAgMDAwICAgICAgICovCi0gICAgMHhhODBkLCAgICAgLyogIDAwIDEwICAgICAgICAgKi8KLSAgICAweDk5MGQsICAgICAvKiAgMDAgMTAgMDEwICAgICAgICovCi0gICAgMHg0YzBkLCAgICAgLyogIDAwIDEwIDAxMSAgICAgICAqLwotICAgIDB4YjYwZCwgICAgIC8qICAwMCAxMCAxMDAgICAgICAgKi8KLSAgICAweDdhMGQsICAgICAvKiAgMDAgMTAgMTAxICAgICAgICovCi0gICAgMHgzYzBjLCAgICAgLyogIDAwIDEwIDExICAgICAgICAqLwotICAgIDB4M2MwYywgICAgIC8qICAwMCAxMCAxICAgICAgICAqLwotICAgIDB4NWIwZCwgICAgIC8qICAwMCAxIDAwMDAgICAgICAgKi8KLSAgICAweDg5MGQsICAgICAvKiAgMDAgMSAwICAgICAgICAqLwotICAgIDB4MWMwYywgICAgIC8qICAwMCAxICAgICAgICAgICovCi0gICAgMHgxYzBjLCAgICAgLyogIDAwIDEgMDAgICAgICAgICovCi0gICAgMHhjMDBjLCAgICAgLyogIDAwIDEgMDEwICAgICAgICAqLwotICAgIDB4YzAwYywgICAgIC8qICAwMCAxIDAxICAgICAgICAqLwotICAgIDB4OTgwZCwgICAgIC8qICAwMCAxIDAxMTAgICAgICAgKi8KLSAgICAweDc5MGQsICAgICAvKiAgMDAgMSAwMTExICAgICAgICovCi0gICAgMHhlMjBiLCAgICAgLyogIDAwIDEgMTAgICAgICAgICAqLwotICAgIDB4ZTIwYiwgICAgIC8qICAwMCAxIDEgICAgICAgICAqLwotICAgIDB4ZTIwYiwgICAgIC8qICAwMCAxIDEgICAgICAgICAqLwotICAgIDB4ZTIwYiwgICAgIC8qICAwMCAxIDEgICAgICAgICAqLwotICAgIDB4MmUwYywgICAgIC8qICAwMCAxIDExMCAgICAgICAgKi8KLSAgICAweDJlMGMsICAgICAvKiAgMDAgMSAxMSAgICAgICAgKi8KLSAgICAweDFlMGMsICAgICAvKiAgMDAgMSAxMTEgICAgICAgICovCi0gICAgMHgxZTBjLCAgICAgLyogIDAwIDEgMTEgICAgICAgICovCi0gICAgMHhkMzBjLCAgICAgLyogIDAwIDEwMTAwMDAgICAgICAgICovCi0gICAgMHhkMzBjLCAgICAgLyogIDAwIDEwMTAwMCAgICAgICAgKi8KLSAgICAweDJkMGMsICAgICAvKiAgMDAgMTAxMCAgICAgICAgICovCi0gICAgMHgyZDBjLCAgICAgLyogIDAwIDEwMTAwMCAgICAgICAgKi8KLSAgICAweGQyMGMsICAgICAvKiAgMDAgMTAxIDAgICAgICAgICovCi0gICAgMHhkMjBjLCAgICAgLyogIDAwIDEwMSAgICAgICAgICovCi0gICAgMHhkMTBjLCAgICAgLyogIDAwIDEwMSAxICAgICAgICAqLwotICAgIDB4ZDEwYywgICAgIC8qICAwMCAxMDEgICAgICAgICAqLwotICAgIDB4M2IwYywgICAgIC8qICAwMCAxMDEwMTAwICAgICAgICAqLwotICAgIDB4M2IwYywgICAgIC8qICAwMCAxMDEwMTAgICAgICAgICovCi0gICAgMHg5NzBkLCAgICAgLyogIDAwIDEwMTAxMDEwICAgICAgICovCi0gICAgMHg4ODBkLCAgICAgLyogIDAwIDEwMTAxMDExICAgICAgICovCi0gICAgMHhmMjA4LAotICAgIDB4ZjIwOCwgICAgIC8qICAwMDAgMSAgICAgICAgICAgICovCi0gICAgMHgyZjA5LCAgICAgLyogIDAwIDAwMDAgICAgICAgICAgICovCi0gICAgMHgwZjA5LCAgICAgLyogIDAwIDAgICAgICAgICAgICAqLwotICAgIDB4MWYwOCwgICAgIC8qICAwMCAgICAgICAgICAgICAgKi8KLSAgICAweDFmMDgsICAgICAvKiAgMDAgMDAgICAgICAgICAgICAqLwotICAgIDB4ZjEwOCwgICAgIC8qICAwMCAwMTAgICAgICAgICAgICAqLwotICAgIDB4ZjEwOCwgICAgIC8qICAwMCAwMSAgICAgICAgICAgICovCi0gICAgMHhjZTEwLAotICAgIDB4Y2UxMCwgICAgIC8qICAwMDAgMTAxMTAwMDAwICAgICovCi0gICAgMHhlYzExLCAgICAgLyogIDAwMCAxMDExMDAwIDAgICAqLwotICAgIDB4ZGQxMSwgICAgIC8qICAwMDAgMTAxMTAwMCAxICAgKi8KLSAgICAweGRlMGYsICAgICAvKiAgMDAwIDEwMTEwMCAgICAgICovCi0gICAgMHhkZTBmLCAgICAgLyogIDAwMCAxMDExMDAwMCAgICAqLwotICAgIDB4ZGUwZiwgICAgIC8qICAwMDAgMTAxMTAwMDAgICAgKi8KLSAgICAweGRlMGYsICAgICAvKiAgMDAwIDEwMTEwMDAwICAgICovCi0gICAgMHhlOTBmLCAgICAgLyogIDAwMCAxMDExMCAwICAgICAqLwotICAgIDB4ZTkwZiwgICAgIC8qICAwMDAgMTAxMTAgICAgICAqLwotICAgIDB4ZTkwZiwgICAgIC8qICAwMDAgMTAxMTAgICAgICAqLwotICAgIDB4ZTkwZiwgICAgIC8qICAwMDAgMTAxMTAgICAgICAqLwotICAgIDB4ZWExMCwgICAgIC8qICAwMDAgMTAxMTAgMTAgICAgKi8KLSAgICAweGVhMTAsICAgICAvKiAgMDAwIDEwMTEwIDEgICAgKi8KLSAgICAweGQ5MTAsICAgICAvKiAgMDAwIDEwMTEwIDExICAgICovCi0gICAgMHhkOTEwLCAgICAgLyogIDAwMCAxMDExMCAxICAgICovCi0gICAgMHhlZTBlLAotICAgIDB4ZWUwZSwgICAgIC8qICAwMDAgMTAxMSAgICAgICAqLwotICAgIDB4ZWQwZiwgICAgIC8qICAwMDAgMTAxMSAxMCAgICAgKi8KLSAgICAweGViMGYsICAgICAvKiAgMDAwIDEwMTEgMTEgICAgICovCi0gICAgMHhiZTBlLCAgICAgLyogIDAwMCAxMDExMDEwMCAgICAgICovCi0gICAgMHhiZTBlLCAgICAgLyogIDAwMCAxMDExMDEwICAgICAgKi8KLSAgICAweGNkMGUsICAgICAvKiAgMDAwIDEwMTEwMTAxICAgICAgKi8KLSAgICAweGNkMGUsICAgICAvKiAgMDAwIDEwMTEwMTAgICAgICAqLwotICAgIDB4ZGMwZiwgICAgIC8qICAwMDAgMTAxMTAxMTAwICAgICAqLwotICAgIDB4ZGIwZiwgICAgIC8qICAwMDAgMTAxMTAxMTAxICAgICAqLwotICAgIDB4YWUwZSwgICAgIC8qICAwMDAgMTAxMTAxMTEgICAgICAqLwotICAgIDB4YWUwZSwgICAgIC8qICAwMDAgMTAxMTAxMSAgICAgICovCi0gICAgMHhjYzBlLCAgICAgLyogIDAwMCAxMDExMTAwMCAgICAgICovCi0gICAgMHhjYzBlLCAgICAgLyogIDAwMCAxMDExMTAwICAgICAgKi8KLSAgICAweGFkMGYsICAgICAvKiAgMDAwIDEwMTExIDAgICAgICovCi0gICAgMHhkYTBmLCAgICAgLyogIDAwMCAxMDExMSAxICAgICAqLwotICAgIDB4N2UwZiwgICAgIC8qICAwMDAgMTAxMTEwMTAwICAgICAqLwotICAgIDB4YWMwZiwgICAgIC8qICAwMDAgMTAxMTEwMTAxICAgICAqLwotICAgIDB4Y2EwZSwgICAgIC8qICAwMDAgMTAxMTEwMTEgICAgICAqLwotICAgIDB4Y2EwZSwgICAgIC8qICAwMDAgMTAxMTEwMSAgICAgICovCi0gICAgMHhjOTBmLCAgICAgLyogIDAwMCAxMDExMTEwMDAgICAgICovCi0gICAgMHg3ZDBmLCAgICAgLyogIDAwMCAxMDExMTEgICAgICAqLwotICAgIDB4NWUwZSwgICAgIC8qICAwMDAgMTAxMTExMDEgICAgICAqLwotICAgIDB4NWUwZSwgICAgIC8qICAwMDAgMTAxMTExMCAgICAgICovCi0gICAgMHhiZDBkLCAgICAgLyogIDAwMCAxMDExMTExICAgICAgICovCi0gICAgMHhiZDBkLCAgICAgLyogIDAwMCAxMDExMTEgICAgICAqLwotICAgIDB4YmQwZCwgICAgIC8qICAwMDAgMTAxMTExICAgICAgKi8KLSAgICAweGJkMGQsICAgICAvKiAgMDAwIDEwMTExMSAgICAgICovCi0gICAgMHhlZjBiLAotICAgIDB4ZmUwYiwgICAgIC8qICAwMDAwMDAwMCAgICAgICAgICAqLwotICAgIDB4ZGYwYiwgICAgIC8qICAwMDAwMDAwIDAgICAgICAgICAqLwotICAgIDB4ZmQwYiwgICAgIC8qICAwMDAwMDAwIDEgICAgICAgICAqLwotICAgIDB4Y2YwYiwgICAgIC8qICAgIDAwICAgICAgICAgKi8KLSAgICAweGZjMGIsICAgICAvKiAgICAwMSAgICAgICAgICovCi0gICAgMHhiZjBiLCAgICAgLyogICAgMTAgICAgICAgICAqLwotICAgIDB4ZmIwYiwgICAgIC8qICAgIDExICAgICAgICAgKi8KLSAgICAweGFmMGEsICAgICAvKiAgICAwMCAgICAgICAgICAqLwotICAgIDB4YWYwYSwgICAgIC8qICAgIDAgICAgICAgICAgKi8KLSAgICAweGZhMGIsICAgICAvKiAgICAwMTAgICAgICAgICAqLwotICAgIDB4OWYwYiwgICAgIC8qICAgIDAxMSAgICAgICAgICovCi0gICAgMHhmOTBiLCAgICAgLyogICAgMTAwICAgICAgICAgKi8KLSAgICAweGY4MGIsICAgICAvKiAgICAxMDEgICAgICAgICAqLwotICAgIDB4OGYwYSwgICAgIC8qICAgIDExICAgICAgICAgICovCi0gICAgMHg4ZjBhLCAgICAgLyogICAgMSAgICAgICAgICAqLwotICAgIDB4N2YwYSwgICAgIC8qICAwMDAwIDAwMCAgICAgICAgICAqLwotICAgIDB4N2YwYSwgICAgIC8qICAwMDAwIDAwICAgICAgICAgICovCi0gICAgMHhmNzBhLCAgICAgLyogIDAwMDAgICAgICAgICAgICAqLwotICAgIDB4ZjcwYSwgICAgIC8qICAwMDAwIDAwICAgICAgICAgICovCi0gICAgMHg2ZjBhLCAgICAgLyogIDAwMDAgMDEwICAgICAgICAgICovCi0gICAgMHg2ZjBhLCAgICAgLyogIDAwMDAgMDEgICAgICAgICAgKi8KLSAgICAweGY2MGEsICAgICAvKiAgMDAwMCAwMTEgICAgICAgICAgKi8KLSAgICAweGY2MGEsICAgICAvKiAgMDAwMCAwMSAgICAgICAgICAqLwotICAgIDB4ZmYwOCwgICAgIC8qICAwMDAwIDEgICAgICAgICAgICAqLwotICAgIDB4ZmYwOCwgICAgIC8qICAwMDAwICAgICAgICAgICAgKi8KLSAgICAweGZmMDgsICAgICAvKiAgMDAwMCAgICAgICAgICAgICovCi0gICAgMHhmZjA4LCAgICAgLyogIDAwMDAgICAgICAgICAgICAqLwotICAgIDB4ZmYwOCwgICAgIC8qICAwMDAwICAgICAgICAgICAgKi8KLSAgICAweGZmMDgsICAgICAvKiAgMDAwMCAgICAgICAgICAgICovCi0gICAgMHhmZjA4LCAgICAgLyogIDAwMDAgICAgICAgICAgICAqLwotICAgIDB4ZmYwOCwgICAgIC8qICAwMDAwICAgICAgICAgICAgKi8KLSAgICAweDVmMGEsICAgICAvKiAgMDAwIDAwMDAgICAgICAgICAgKi8KLSAgICAweDVmMGEsICAgICAvKiAgMDAwIDAwMCAgICAgICAgICAqLwotICAgIDB4ZjUwYSwgICAgIC8qICAwMDAgMCAgICAgICAgICAgKi8KLSAgICAweGY1MGEsICAgICAvKiAgMDAwIDAwMCAgICAgICAgICAqLwotICAgIDB4NGYwOSwgICAgIC8qICAwMDAgICAgICAgICAgICAgKi8KLSAgICAweDRmMDksICAgICAvKiAgMDAwIDAwICAgICAgICAgICovCi0gICAgMHg0ZjA5LCAgICAgLyogIDAwMCAwMCAgICAgICAgICAqLwotICAgIDB4NGYwOSwgICAgIC8qICAwMDAgMDAgICAgICAgICAgKi8KLSAgICAweGY0MDksICAgICAvKiAgMDAwIDAxMCAgICAgICAgICAgKi8KLSAgICAweGY0MDksICAgICAvKiAgMDAwIDAxICAgICAgICAgICAqLwotICAgIDB4ZjQwOSwgICAgIC8qICAwMDAgMDEgICAgICAgICAgICovCi0gICAgMHhmNDA5LCAgICAgLyogIDAwMCAwMSAgICAgICAgICAgKi8KLSAgICAweGYzMDksICAgICAvKiAgMDAwIDAxMSAgICAgICAgICAgKi8KLSAgICAweGYzMDksICAgICAvKiAgMDAwIDAxICAgICAgICAgICovCi0gICAgMHhmMzA5LCAgICAgLyogIDAwMCAwMSAgICAgICAgICAqLwotICAgIDB4ZjMwOSwgICAgIC8qICAwMDAgMDEgICAgICAgICAgKi8KLSAgICAweGYwMDksICAgICAvKiAgMDAwIDEwMCAgICAgICAgICAgKi8KLSAgICAweGYwMDksICAgICAvKiAgMDAwIDEwICAgICAgICAgICAqLwotICAgIDB4ZjAwOSwgICAgIC8qICAwMDAgMTAgICAgICAgICAgICovCi0gICAgMHhmMDA5LCAgICAgLyogIDAwMCAxMCAgICAgICAgICAgKi8KLSAgICAweDNmMGEsCi0gICAgMHgzZjBhCi19OwotCi0KLQotY29uc3QgdWludDE2IGh1ZmZUYWJsZV8yNFs0NzhdID0KLXsKLQotICAgIDB4MjIwNiwgICAgIC8qICAxMDEgICAgICAgICAgICAgICAqLwotICAgIDB4MTIwNSwgICAgIC8qICAxMDEwMSAgICAgICAgICAgICAgICovCi0gICAgMHgxMjA1LCAgICAgLyogIDEwMTAgICAgICAgICAgICAgICAqLwotICAgIDB4MjEwNSwgICAgIC8qICAxMDExMCAgICAgICAgICAgICAgICovCi0gICAgMHgyMTA1LCAgICAgLyogIDEwMTEgICAgICAgICAgICAgICAqLwotICAgIDB4MDIwNiwgICAgIC8qICAxMDExMTAgICAgICAgICAgICAgICovCi0gICAgMHgyMDA2LCAgICAgLyogIDEwMTExMSAgICAgICAgICAgICAgKi8KLSAgICAweDExMDQsCi0gICAgMHgxMTA0LAotICAgIDB4MTEwNCwKLSAgICAweDExMDQsCi0gICAgMHgwMTA0LAotICAgIDB4MDEwNCwKLSAgICAweDAxMDQsCi0gICAgMHgwMTA0LAotICAgIDB4MTAwNCwKLSAgICAweDEwMDQsCi0gICAgMHgxMDA0LAotICAgIDB4MTAwNCwKLSAgICAweDAwMDQsCi0gICAgMHgwMDA0LAotICAgIDB4MDAwNCwKLSAgICAweDAwMDQsCi0gICAgMHg3MzA4LAotICAgIDB4NzMwOCwKLSAgICAweDM3MDksCi0gICAgMHgyNzA5LAotICAgIDB4NzIwOCwKLSAgICAweDcyMDgsCi0gICAgMHg0NjA4LCAgICAgLyogIDAxMTEwMDAwICAgICAgICAgICAgKi8KLSAgICAweDQ2MDgsICAgICAvKiAgMDExMTAwMCAgICAgICAgICAgICovCi0gICAgMHg2NDA4LCAgICAgLyogIDAxMTEwICAgICAgICAgICAgICovCi0gICAgMHg2NDA4LCAgICAgLyogIDAxMTEwMDAgICAgICAgICAgICAqLwotICAgIDB4NTUwOCwgICAgIC8qICAwMTExIDAgICAgICAgICAgICAqLwotICAgIDB4NTUwOCwgICAgIC8qICAwMTExICAgICAgICAgICAgICovCi0gICAgMHg3MTA4LCAgICAgLyogIDAxMTEgMSAgICAgICAgICAgICovCi0gICAgMHg3MTA4LCAgICAgLyogIDAxMTEgICAgICAgICAgICAgKi8KLSAgICAweDM2MDgsICAgICAvKiAgMDExMTAxMDAgICAgICAgICAgICAqLwotICAgIDB4MzYwOCwgICAgIC8qICAwMTExMDEwICAgICAgICAgICAgKi8KLSAgICAweDYzMDgsICAgICAvKiAgMDExMTAxMDEgICAgICAgICAgICAqLwotICAgIDB4NjMwOCwgICAgIC8qICAwMTExMDEwICAgICAgICAgICAgKi8KLSAgICAweDQ1MDgsICAgICAvKiAgMDExMTAxMTAgICAgICAgICAgICAqLwotICAgIDB4NDUwOCwgICAgIC8qICAwMTExMDExICAgICAgICAgICAgKi8KLSAgICAweDU0MDgsICAgICAvKiAgMDExMTAxMTEgICAgICAgICAgICAqLwotICAgIDB4NTQwOCwgICAgIC8qICAwMTExMDExICAgICAgICAgICAgKi8KLSAgICAweDI2MDgsICAgICAvKiAgMDExMTEwMDAgICAgICAgICAgICAqLwotICAgIDB4MjYwOCwgICAgIC8qICAwMTExMTAwICAgICAgICAgICAgKi8KLSAgICAweDYyMDgsICAgICAvKiAgMDExMTEgICAgICAgICAgICAgKi8KLSAgICAweDYyMDgsICAgICAvKiAgMDExMTEwMCAgICAgICAgICAgICovCi0gICAgMHgxNjA4LCAgICAgLyogIDAxMTExMDEwICAgICAgICAgICAgKi8KLSAgICAweDE2MDgsICAgICAvKiAgMDExMTEwMSAgICAgICAgICAgICovCi0gICAgMHg2MTA4LCAgICAgLyogIDAxMTExMDExICAgICAgICAgICAgKi8KLSAgICAweDYxMDgsICAgICAvKiAgMDExMTEwMSAgICAgICAgICAgICovCi0gICAgMHgwNjA5LCAgICAgLyogIDAxMTExMTAwMCAgICAgICAgICAgKi8KLSAgICAweDYwMDksICAgICAvKiAgMDExMTExICAgICAgICAgICAgKi8KLSAgICAweDM1MDgsICAgICAvKiAgMDExMTExMDEgICAgICAgICAgICAqLwotICAgIDB4MzUwOCwgICAgIC8qICAwMTExMTEwICAgICAgICAgICAgKi8KLSAgICAweDUzMDgsICAgICAvKiAgMDExMTExMTAgICAgICAgICAgICAqLwotICAgIDB4NTMwOCwgICAgIC8qICAwMTExMTExICAgICAgICAgICAgKi8KLSAgICAweDQ0MDgsICAgICAvKiAgMDExMTExMTEgICAgICAgICAgICAqLwotICAgIDB4NDQwOCwgICAgIC8qICAwMTExMTExICAgICAgICAgICAgKi8KLSAgICAweDI1MDgsICAgICAvKiAgMTAwMDAwMDAgICAgICAgICAgICAqLwotICAgIDB4MjUwOCwgICAgIC8qICAxMDAwMDAwICAgICAgICAgICAgKi8KLSAgICAweDUyMDgsICAgICAvKiAgMTAwMDAgICAgICAgICAgICAgKi8KLSAgICAweDUyMDgsICAgICAvKiAgMTAwMDAwMCAgICAgICAgICAgICovCi0gICAgMHgxNTA4LCAgICAgLyogIDEwMDAgMCAgICAgICAgICAgICovCi0gICAgMHgxNTA4LCAgICAgLyogIDEwMDAgICAgICAgICAgICAgKi8KLSAgICAweDA1MDksICAgICAvKiAgMTAwMCAxMCAgICAgICAgICAgKi8KLSAgICAweDUwMDksICAgICAvKiAgMTAwMCAxMSAgICAgICAgICAgKi8KLSAgICAweDUxMDcsICAgICAvKiAgMTAwIDAgICAgICAgICAgICAgKi8KLSAgICAweDUxMDcsICAgICAvKiAgMTAwICAgICAgICAgICAgICAqLwotICAgIDB4NTEwNywgICAgIC8qICAxMDAgICAgICAgICAgICAgICovCi0gICAgMHg1MTA3LCAgICAgLyogIDEwMCAgICAgICAgICAgICAgKi8KLSAgICAweDM0MDgsICAgICAvKiAgMTAwIDEwICAgICAgICAgICAgKi8KLSAgICAweDM0MDgsICAgICAvKiAgMTAwIDEgICAgICAgICAgICAqLwotICAgIDB4NDMwOCwgICAgIC8qICAxMDAgMTEgICAgICAgICAgICAqLwotICAgIDB4NDMwOCwgICAgIC8qICAxMDAgMSAgICAgICAgICAgICovCi0gICAgMHgyNDA3LCAgICAgLyogIDEwIDAwICAgICAgICAgICAgICovCi0gICAgMHgyNDA3LCAgICAgLyogIDEwIDAgICAgICAgICAgICAgKi8KLSAgICAweDI0MDcsICAgICAvKiAgMTAgMCAgICAgICAgICAgICAqLwotICAgIDB4MjQwNywgICAgIC8qICAxMCAwICAgICAgICAgICAgICovCi0gICAgMHg0MjA3LCAgICAgLyogIDEwIDAxICAgICAgICAgICAgICovCi0gICAgMHg0MjA3LCAgICAgLyogIDEwIDAgICAgICAgICAgICAqLwotICAgIDB4NDIwNywgICAgIC8qICAxMCAwICAgICAgICAgICAgKi8KLSAgICAweDQyMDcsICAgICAvKiAgMTAgMCAgICAgICAgICAgICovCi0gICAgMHgzMzA3LCAgICAgLyogIDEwIDEwICAgICAgICAgICAgICovCi0gICAgMHgzMzA3LCAgICAgLyogIDEwIDEgICAgICAgICAgICAgKi8KLSAgICAweDMzMDcsICAgICAvKiAgMTAgMSAgICAgICAgICAgICAqLwotICAgIDB4MzMwNywgICAgIC8qICAxMCAxICAgICAgICAgICAgICovCi0gICAgMHgxNDA3LCAgICAgLyogIDEwIDExICAgICAgICAgICAgICovCi0gICAgMHgxNDA3LCAgICAgLyogIDEwIDEgICAgICAgICAgICAqLwotICAgIDB4MTQwNywgICAgIC8qICAxMCAxICAgICAgICAgICAgKi8KLSAgICAweDE0MDcsICAgICAvKiAgMTAgMSAgICAgICAgICAgICovCi0gICAgMHg0MTA3LCAgICAgLyogIDEgMDAwICAgICAgICAgICAgICovCi0gICAgMHg0MTA3LCAgICAgLyogIDEgMDAgICAgICAgICAgICAgKi8KLSAgICAweDQxMDcsICAgICAvKiAgMSAwMCAgICAgICAgICAgICAqLwotICAgIDB4NDEwNywgICAgIC8qICAxIDAwICAgICAgICAgICAgICovCi0gICAgMHgwNDA4LCAgICAgLyogIDEgIDAgICAgICAgICAgICAqLwotICAgIDB4MDQwOCwgICAgIC8qICAxICAgICAgICAgICAgICAqLwotICAgIDB4NDAwOCwgICAgIC8qICAxICAxICAgICAgICAgICAgKi8KLSAgICAweDQwMDgsICAgICAvKiAgMSAgICAgICAgICAgICAgKi8KLSAgICAweDIzMDcsICAgICAvKiAgMSAwMTAgICAgICAgICAgICAgKi8KLSAgICAweDIzMDcsICAgICAvKiAgMSAwMSAgICAgICAgICAgICAqLwotICAgIDB4MjMwNywgICAgIC8qICAxIDAxICAgICAgICAgICAgICovCi0gICAgMHgyMzA3LCAgICAgLyogIDEgMDEgICAgICAgICAgICAgKi8KLSAgICAweDMyMDcsICAgICAvKiAgMSAwMTEgICAgICAgICAgICAgKi8KLSAgICAweDMyMDcsICAgICAvKiAgMSAwMSAgICAgICAgICAgICovCi0gICAgMHgzMjA3LCAgICAgLyogIDEgMDEgICAgICAgICAgICAqLwotICAgIDB4MzIwNywgICAgIC8qICAxIDAxICAgICAgICAgICAgKi8KLSAgICAweDEzMDYsICAgICAvKiAgMSAxMCAgICAgICAgICAgICAgKi8KLSAgICAweDEzMDYsICAgICAvKiAgMSAxICAgICAgICAgICAgICAqLwotICAgIDB4MTMwNiwgICAgIC8qICAxIDEgICAgICAgICAgICAgICovCi0gICAgMHgxMzA2LCAgICAgLyogIDEgMSAgICAgICAgICAgICAgKi8KLSAgICAweDEzMDYsICAgICAvKiAgMSAxICAgICAgICAgICAgICAqLwotICAgIDB4MTMwNiwgICAgIC8qICAxIDEgICAgICAgICAgICAgICovCi0gICAgMHgxMzA2LCAgICAgLyogIDEgMSAgICAgICAgICAgICAgKi8KLSAgICAweDEzMDYsICAgICAvKiAgMSAxICAgICAgICAgICAgICAqLwotICAgIDB4MzEwNiwgICAgIC8qICAxIDExICAgICAgICAgICAgICAqLwotICAgIDB4MzEwNiwgICAgIC8qICAxIDEgICAgICAgICAgICAgKi8KLSAgICAweDMxMDYsICAgICAvKiAgMSAxICAgICAgICAgICAgICovCi0gICAgMHgzMTA2LCAgICAgLyogIDEgMSAgICAgICAgICAgICAqLwotICAgIDB4MzEwNiwgICAgIC8qICAxIDEgICAgICAgICAgICAgKi8KLSAgICAweDMxMDYsICAgICAvKiAgMSAxICAgICAgICAgICAgICovCi0gICAgMHgzMTA2LCAgICAgLyogIDEgMSAgICAgICAgICAgICAqLwotICAgIDB4MzEwNiwgICAgIC8qICAxIDEgICAgICAgICAgICAgKi8KLSAgICAweDAzMDcsICAgICAvKiAgMTAxMDAwMCAgICAgICAgICAgICAqLwotICAgIDB4MDMwNywgICAgIC8qICAxMDEwMDAgICAgICAgICAgICAgKi8KLSAgICAweDAzMDcsICAgICAvKiAgMTAxMDAwICAgICAgICAgICAgICovCi0gICAgMHgwMzA3LCAgICAgLyogIDEwMTAwMCAgICAgICAgICAgICAqLwotICAgIDB4MzAwNywgICAgIC8qICAxMDEwICAgICAgICAgICAgICAqLwotICAgIDB4MzAwNywgICAgIC8qICAxMDEwMDAgICAgICAgICAgICAqLwotICAgIDB4MzAwNywgICAgIC8qICAxMDEwMDAgICAgICAgICAgICAqLwotICAgIDB4MzAwNywgICAgIC8qICAxMDEwMDAgICAgICAgICAgICAqLwotICAgIDB4YjMwOSwKLSAgICAweGIzMDksCi0gICAgMHg4ODA5LCAgICAgLyogIDAxMDEwMSAgICAgICAgICAgICovCi0gICAgMHg4ODA5LCAgICAgLyogIDAxMDEwMTAwICAgICAgICAgICAqLwotICAgIDB4MmIwYSwgICAgIC8qICAwMTAxMDEwMTAwICAgICAgICAgICovCi0gICAgMHg1YTBhLCAgICAgLyogIDAxMDEwMTAxMDEgICAgICAgICAgKi8KLSAgICAweGIyMDksICAgICAvKiAgMDEwMTAxMDExICAgICAgICAgICAqLwotICAgIDB4YjIwOSwgICAgIC8qICAwMTAxMDEwMSAgICAgICAgICAgKi8KLSAgICAweGE1MGEsICAgICAvKiAgMDEwMTAxMTAwMCAgICAgICAgICAqLwotICAgIDB4MWIwYSwgICAgIC8qICAwMTAxMDExICAgICAgICAgICAqLwotICAgIDB4YjEwYSwgICAgIC8qICAwMTAxMDExMDEwICAgICAgICAgICovCi0gICAgMHg2OTBhLCAgICAgLyogIDAxMDEwMTEwMTEgICAgICAgICAgKi8KLSAgICAweDk2MDksICAgICAvKiAgMDEwMTAxMTEwICAgICAgICAgICAqLwotICAgIDB4OTYwOSwgICAgIC8qICAwMTAxMDExMSAgICAgICAgICAgKi8KLSAgICAweGE0MDksICAgICAvKiAgMDEwMTAxMTExICAgICAgICAgICAqLwotICAgIDB4YTQwOSwgICAgIC8qICAwMTAxMDExMSAgICAgICAgICAgKi8KLSAgICAweDRhMGEsICAgICAvKiAgMDEwMTEwMDAwMCAgICAgICAgICAqLwotICAgIDB4NzgwYSwgICAgIC8qICAwMTAxMTAwICAgICAgICAgICAqLwotICAgIDB4ODcwOSwgICAgIC8qICAwMTAxMTAgICAgICAgICAgICAqLwotICAgIDB4ODcwOSwgICAgIC8qICAwMTAxMTAwMCAgICAgICAgICAgKi8KLSAgICAweDNhMDksICAgICAvKiAgMDEwMTEgMCAgICAgICAgICAgKi8KLSAgICAweDNhMDksICAgICAvKiAgMDEwMTEgICAgICAgICAgICAqLwotICAgIDB4YTMwOSwgICAgIC8qICAwMTAxMSAxICAgICAgICAgICAqLwotICAgIDB4YTMwOSwgICAgIC8qICAwMTAxMSAgICAgICAgICAgICovCi0gICAgMHg1OTA5LCAgICAgLyogIDAxMDExMDEwMCAgICAgICAgICAgKi8KLSAgICAweDU5MDksICAgICAvKiAgMDEwMTEwMTAgICAgICAgICAgICovCi0gICAgMHg5NTA5LCAgICAgLyogIDAxMDExMDEwMSAgICAgICAgICAgKi8KLSAgICAweDk1MDksICAgICAvKiAgMDEwMTEwMTAgICAgICAgICAgICovCi0gICAgMHgyYTA5LCAgICAgLyogIDAxMDExMDExMCAgICAgICAgICAgKi8KLSAgICAweDJhMDksICAgICAvKiAgMDEwMTEwMTEgICAgICAgICAgICovCi0gICAgMHhhMjA5LCAgICAgLyogIDAxMDExMDExMSAgICAgICAgICAgKi8KLSAgICAweGEyMDksICAgICAvKiAgMDEwMTEwMTEgICAgICAgICAgICovCi0gICAgMHhhMTA5LCAgICAgLyogIDAxMDExMTAwMCAgICAgICAgICAgKi8KLSAgICAweGExMDksICAgICAvKiAgMDEwMTExMDAgICAgICAgICAgICovCi0gICAgMHg2ODA5LCAgICAgLyogIDAxMDExMSAgICAgICAgICAgICovCi0gICAgMHg2ODA5LCAgICAgLyogIDAxMDExMTAwICAgICAgICAgICAqLwotICAgIDB4ODYwOSwgICAgIC8qICAwMTAxMTEwMTAgICAgICAgICAgICovCi0gICAgMHg4NjA5LCAgICAgLyogIDAxMDExMTAxICAgICAgICAgICAqLwotICAgIDB4NzcwOSwgICAgIC8qICAwMTAxMTEwMTEgICAgICAgICAgICovCi0gICAgMHg3NzA5LCAgICAgLyogIDAxMDExMTAxICAgICAgICAgICAqLwotICAgIDB4NDkwOSwgICAgIC8qICAwMTAxMTExMDAgICAgICAgICAgICovCi0gICAgMHg0OTA5LCAgICAgLyogIDAxMDExMTEwICAgICAgICAgICAqLwotICAgIDB4OTQwOSwgICAgIC8qICAwMTAxMTExMDEgICAgICAgICAgICovCi0gICAgMHg5NDA5LCAgICAgLyogIDAxMDExMTEwICAgICAgICAgICAqLwotICAgIDB4MzkwOSwgICAgIC8qICAwMTAxMTExMTAgICAgICAgICAgICovCi0gICAgMHgzOTA5LCAgICAgLyogIDAxMDExMTExICAgICAgICAgICAqLwotICAgIDB4OTMwOSwgICAgIC8qICAwMTAxMTExMTEgICAgICAgICAgICovCi0gICAgMHg5MzA5LCAgICAgLyogIDAxMDExMTExICAgICAgICAgICAqLwotICAgIDB4NTgwOSwgICAgIC8qICAwMTEwMDAwMDAgICAgICAgICAgICovCi0gICAgMHg1ODA5LCAgICAgLyogIDAxMTAwMDAwICAgICAgICAgICAqLwotICAgIDB4ODUwOSwgICAgIC8qICAwMTEwMDAgICAgICAgICAgICAqLwotICAgIDB4ODUwOSwgICAgIC8qICAwMTEwMDAwMCAgICAgICAgICAgKi8KLSAgICAweDI5MDksICAgICAvKiAgMDExMDAgMCAgICAgICAgICAgKi8KLSAgICAweDI5MDksICAgICAvKiAgMDExMDAgICAgICAgICAgICAqLwotICAgIDB4NjcwOSwgICAgIC8qICAwMTEwMCAxICAgICAgICAgICAqLwotICAgIDB4NjcwOSwgICAgIC8qICAwMTEwMCAgICAgICAgICAgICovCi0gICAgMHg3NjA5LCAgICAgLyogIDAxMTAgMDAgICAgICAgICAgICovCi0gICAgMHg3NjA5LCAgICAgLyogIDAxMTAgMCAgICAgICAgICAgKi8KLSAgICAweDkyMDksICAgICAvKiAgMDExMCAwMSAgICAgICAgICAgKi8KLSAgICAweDkyMDksICAgICAvKiAgMDExMCAwICAgICAgICAgICAqLwotICAgIDB4MTkwOSwgICAgIC8qICAwMTEwIDEwICAgICAgICAgICAqLwotICAgIDB4MTkwOSwgICAgIC8qICAwMTEwIDEgICAgICAgICAgICovCi0gICAgMHg5MTA5LCAgICAgLyogIDAxMTAgMTEgICAgICAgICAgICovCi0gICAgMHg5MTA5LCAgICAgLyogIDAxMTAgMSAgICAgICAgICAgKi8KLSAgICAweDQ4MDksICAgICAvKiAgMDExIDAwMCAgICAgICAgICAgKi8KLSAgICAweDQ4MDksICAgICAvKiAgMDExIDAwICAgICAgICAgICAqLwotICAgIDB4ODQwOSwgICAgIC8qICAwMTEgICAgICAgICAgICAgKi8KLSAgICAweDg0MDksICAgICAvKiAgMDExIDAwICAgICAgICAgICAqLwotICAgIDB4NTcwOSwgICAgIC8qICAwMTEgMDEwICAgICAgICAgICAqLwotICAgIDB4NTcwOSwgICAgIC8qICAwMTEgMDEgICAgICAgICAgICovCi0gICAgMHg3NTA5LCAgICAgLyogIDAxMSAwMTEgICAgICAgICAgICovCi0gICAgMHg3NTA5LCAgICAgLyogIDAxMSAwMSAgICAgICAgICAgKi8KLSAgICAweDM4MDksICAgICAvKiAgMDExIDEwMCAgICAgICAgICAgKi8KLSAgICAweDM4MDksICAgICAvKiAgMDExIDEwICAgICAgICAgICAqLwotICAgIDB4ODMwOSwgICAgIC8qICAwMTEgMTAxICAgICAgICAgICAqLwotICAgIDB4ODMwOSwgICAgIC8qICAwMTEgMTAgICAgICAgICAgICovCi0gICAgMHg2NjA5LCAgICAgLyogIDAxMSAxMTAgICAgICAgICAgICovCi0gICAgMHg2NjA5LCAgICAgLyogIDAxMSAxMSAgICAgICAgICAgKi8KLSAgICAweDI4MDksICAgICAvKiAgMDExIDExMSAgICAgICAgICAgKi8KLSAgICAweDI4MDksICAgICAvKiAgMDExIDExICAgICAgICAgICAqLwotICAgIDB4ODIwOSwgICAgIC8qICAwMTEwMTAwMDAgICAgICAgICAgICovCi0gICAgMHg4MjA5LCAgICAgLyogIDAxMTAxMDAwICAgICAgICAgICAqLwotICAgIDB4MTgwOSwgICAgIC8qICAwMTEwMTAgICAgICAgICAgICAqLwotICAgIDB4MTgwOSwgICAgIC8qICAwMTEwMTAwMCAgICAgICAgICAgKi8KLSAgICAweDQ3MDksICAgICAvKiAgMDExMDEgMCAgICAgICAgICAgKi8KLSAgICAweDQ3MDksICAgICAvKiAgMDExMDEgICAgICAgICAgICAqLwotICAgIDB4NzQwOSwgICAgIC8qICAwMTEwMSAxICAgICAgICAgICAqLwotICAgIDB4NzQwOSwgICAgIC8qICAwMTEwMSAgICAgICAgICAgICovCi0gICAgMHg4MTA5LCAgICAgLyogIDAxMTAxMDEwMCAgICAgICAgICAgKi8KLSAgICAweDgxMDksICAgICAvKiAgMDExMDEwMTAgICAgICAgICAgICovCi0gICAgMHgwODBhLCAgICAgLyogIDAxMTAxMDEwMTAgICAgICAgICAgKi8KLSAgICAweDgwMGEsICAgICAvKiAgMDExMDEwMTAxMSAgICAgICAgICAqLwotICAgIDB4NTYwOSwgICAgIC8qICAwMTEwMTAxMTAgICAgICAgICAgICovCi0gICAgMHg1NjA5LCAgICAgLyogIDAxMTAxMDExICAgICAgICAgICAqLwotICAgIDB4NjUwOSwgICAgIC8qICAwMTEwMTAxMTEgICAgICAgICAgICovCi0gICAgMHg2NTA5LCAgICAgLyogIDAxMTAxMDExICAgICAgICAgICAqLwotICAgIDB4MTcwOSwgICAgIC8qICAwMTEwMTEwMDAgICAgICAgICAgICovCi0gICAgMHgxNzA5LCAgICAgLyogIDAxMTAxMTAwICAgICAgICAgICAqLwotICAgIDB4MDcwYSwgICAgIC8qICAwMTEwMTEgMCAgICAgICAgICAqLwotICAgIDB4NzAwYSwgICAgIC8qICAwMTEwMTEgMSAgICAgICAgICAqLwotICAgIDB4NmUwYiwKLSAgICAweDljMGIsCi0gICAgMHhjOTBhLCAgICAgLyogIDAxMDAwIDAxICAgICAgICAgICovCi0gICAgMHhjOTBhLCAgICAgLyogIDAxMDAwIDAgICAgICAgICAgKi8KLSAgICAweDVlMGEsICAgICAvKiAgMDEwMDAgMTAgICAgICAgICAgKi8KLSAgICAweDVlMGEsICAgICAvKiAgMDEwMDAgMSAgICAgICAgICAqLwotICAgIDB4YmEwYSwgICAgIC8qICAwMTAwMCAxMSAgICAgICAgICAqLwotICAgIDB4YmEwYSwgICAgIC8qICAwMTAwMCAxICAgICAgICAgICovCi0gICAgMHhlNTBhLCAgICAgLyogIDAxMDAgMDAwICAgICAgICAgICovCi0gICAgMHhlNTBhLCAgICAgLyogIDAxMDAgMDAgICAgICAgICAgKi8KLSAgICAweGFiMGIsICAgICAvKiAgMDEwMCAgMCAgICAgICAgICovCi0gICAgMHg3ZDBiLCAgICAgLyogIDAxMDAgIDEgICAgICAgICAqLwotICAgIDB4ZDcwYSwgICAgIC8qICAwMTAwIDAxMCAgICAgICAgICAqLwotICAgIDB4ZDcwYSwgICAgIC8qICAwMTAwIDAxICAgICAgICAgICovCi0gICAgMHhlNDBhLCAgICAgLyogIDAxMDAgMDExICAgICAgICAgICovCi0gICAgMHhlNDBhLCAgICAgLyogIDAxMDAgMDEgICAgICAgICAgKi8KLSAgICAweDhjMGEsICAgICAvKiAgMDEwMCAxMDAgICAgICAgICAgKi8KLSAgICAweDhjMGEsCi0gICAgMHhjODBhLAotICAgIDB4YzgwYSwKLSAgICAweDRlMGIsICAgICAvKiAgMDEwMCAxMTAwICAgICAgICAgKi8KLSAgICAweDJlMGIsICAgICAvKiAgMDEwMCAxMTAxICAgICAgICAgKi8KLSAgICAweDNlMGEsICAgICAvKiAgMDEwMCAxMTEgICAgICAgICAgKi8KLSAgICAweDNlMGEsICAgICAvKiAgMDEwMCAxMSAgICAgICAgICAqLwotICAgIDB4NmQwYSwgICAgIC8qICAwMTAgMDAwMCAgICAgICAgICAqLwotICAgIDB4NmQwYSwgICAgIC8qICAwMTAgMDAwICAgICAgICAgICovCi0gICAgMHhkNjBhLCAgICAgLyogIDAxMCAwICAgICAgICAgICAqLwotICAgIDB4ZDYwYSwgICAgIC8qICAwMTAgMDAwICAgICAgICAgICovCi0gICAgMHhlMzBhLCAgICAgLyogIDAxMCAgMCAgICAgICAgICAqLwotICAgIDB4ZTMwYSwgICAgIC8qICAwMTAgICAgICAgICAgICAqLwotICAgIDB4OWIwYSwgICAgIC8qICAwMTAgIDEgICAgICAgICAgKi8KLSAgICAweDliMGEsICAgICAvKiAgMDEwICAgICAgICAgICAgKi8KLSAgICAweGI5MGEsICAgICAvKiAgMDEwIDAxMDAgICAgICAgICAgKi8KLSAgICAweGI5MGEsICAgICAvKiAgMDEwIDAxMCAgICAgICAgICAqLwotICAgIDB4YWEwYSwgICAgIC8qICAwMTAgMDEwMSAgICAgICAgICAqLwotICAgIDB4YWEwYSwKLSAgICAweGUyMGEsCi0gICAgMHhlMjBhLAotICAgIDB4MWUwYSwKLSAgICAweDFlMGEsCi0gICAgMHhlMTBhLAotICAgIDB4ZTEwYSwKLSAgICAweDVkMGEsCi0gICAgMHg1ZDBhLAotICAgIDB4ZDUwYSwKLSAgICAweGQ1MGEsCi0gICAgMHg3YzBhLAotICAgIDB4N2MwYSwKLSAgICAweGM3MGEsCi0gICAgMHhjNzBhLAotICAgIDB4NGQwYSwKLSAgICAweDRkMGEsCi0gICAgMHg4YjBhLAotICAgIDB4OGIwYSwKLSAgICAweGI4MGEsCi0gICAgMHhiODBhLAotICAgIDB4ZDQwYSwKLSAgICAweGQ0MGEsCi0gICAgMHg5YTBhLAotICAgIDB4OWEwYSwKLSAgICAweGE5MGEsICAgICAvKiAgMDEgMCAwICAgICAgICAgICovCi0gICAgMHhhOTBhLCAgICAgLyogIDAxIDAgICAgICAgICAgICovCi0gICAgMHg2YzBhLCAgICAgLyogIDAxIDAgMSAgICAgICAgICAqLwotICAgIDB4NmMwYSwgICAgIC8qICAwMSAwICAgICAgICAgICAqLwotICAgIDB4YzYwYSwgICAgIC8qICAwMSAgMDAgICAgICAgICAgKi8KLSAgICAweGM2MGEsICAgICAvKiAgMDEgIDAgICAgICAgICAgKi8KLSAgICAweDNkMGEsICAgICAvKiAgMDEgIDAxICAgICAgICAgICovCi0gICAgMHgzZDBhLCAgICAgLyogIDAxICAwICAgICAgICAgICovCi0gICAgMHhkMzBhLCAgICAgLyogIDAxICAxMCAgICAgICAgICAqLwotICAgIDB4ZDMwYSwgICAgIC8qICAwMSAgMSAgICAgICAgICAqLwotICAgIDB4MmQwYSwgICAgIC8qICAwMSAgMTEgICAgICAgICAgKi8KLSAgICAweDJkMGEsICAgICAvKiAgMDEgIDEgICAgICAgICAgKi8KLSAgICAweGQyMGEsCi0gICAgMHhkMjBhLAotICAgIDB4MWQwYSwgICAgIC8qICAwMSAwMSAgICAgICAgICAgKi8KLSAgICAweDFkMGEsICAgICAvKiAgMDEgMDEwMCAgICAgICAgICAqLwotICAgIDB4N2IwYSwgICAgIC8qICAwMSAwMTAxMCAgICAgICAgICAqLwotICAgIDB4N2IwYSwgICAgIC8qICAwMSAwMTAxICAgICAgICAgICovCi0gICAgMHhiNzBhLCAgICAgLyogIDAxIDAxMDExICAgICAgICAgICovCi0gICAgMHhiNzBhLAotICAgIDB4ZDEwYSwKLSAgICAweGQxMGEsICAgICAvKiAgMDEgMDExMCAgICAgICAgICAqLwotICAgIDB4NWMwYSwgICAgIC8qICAwMSAwMTEwMSAgICAgICAgICAqLwotICAgIDB4NWMwYSwgICAgIC8qICAwMSAwMTEwICAgICAgICAgICovCi0gICAgMHhjNTBhLCAgICAgLyogIDAxIDAxMTEwICAgICAgICAgICovCi0gICAgMHhjNTBhLCAgICAgLyogIDAxIDAxMTEgICAgICAgICAgKi8KLSAgICAweDhhMGEsICAgICAvKiAgMDEgMDExMTEgICAgICAgICAgKi8KLSAgICAweDhhMGEsICAgICAvKiAgMDEgMDExMSAgICAgICAgICAqLwotICAgIDB4YTgwYSwgICAgIC8qICAwMSAxMDAwMCAgICAgICAgICAqLwotICAgIDB4YTgwYSwgICAgIC8qICAwMSAxMDAwICAgICAgICAgICovCi0gICAgMHg5OTBhLCAgICAgLyogIDAxIDEwICAgICAgICAgICAqLwotICAgIDB4OTkwYSwgICAgIC8qICAwMSAxMDAwICAgICAgICAgICovCi0gICAgMHg0YzBhLCAgICAgLyogIDAxIDEgMCAgICAgICAgICAqLwotICAgIDB4NGMwYSwgICAgIC8qICAwMSAxICAgICAgICAgICAqLwotICAgIDB4YzQwYSwgICAgIC8qICAwMSAxIDEgICAgICAgICAgKi8KLSAgICAweGM0MGEsICAgICAvKiAgMDEgMSAgICAgICAgICAgKi8KLSAgICAweDZiMGEsICAgICAvKiAgMDEgMTAxMDAgICAgICAgICAgKi8KLSAgICAweDZiMGEsICAgICAvKiAgMDEgMTAxMCAgICAgICAgICAqLwotICAgIDB4YjYwYSwgICAgIC8qICAwMSAxMDEwMSAgICAgICAgICAqLwotICAgIDB4YjYwYSwgICAgIC8qICAwMSAxMDEwICAgICAgICAgICovCi0gICAgMHhkMDBiLCAgICAgLyogIDAxIDEwMTEwMCAgICAgICAgICovCi0gICAgMHgwYzBiLCAgICAgLyogIDAxIDEwMTEwMSAgICAgICAgICovCi0gICAgMHgzYzBhLCAgICAgLyogIDAxIDEwMTExICAgICAgICAgICovCi0gICAgMHgzYzBhLCAgICAgLyogIDAxIDEwMTEgICAgICAgICAgKi8KLSAgICAweGMzMGEsICAgICAvKiAgMDEgMTEwMDAgICAgICAgICAgKi8KLSAgICAweGMzMGEsICAgICAvKiAgMDEgMTEwMCAgICAgICAgICAqLwotICAgIDB4N2EwYSwgICAgIC8qICAwMSAxMSAgICAgICAgICAgKi8KLSAgICAweDdhMGEsICAgICAvKiAgMDEgMTEwMCAgICAgICAgICAqLwotICAgIDB4YTcwYSwgICAgIC8qICAwMSAxMTAxMCAgICAgICAgICAqLwotICAgIDB4YTcwYSwgICAgIC8qICAwMSAxMTAxICAgICAgICAgICovCi0gICAgMHgyYzBhLCAgICAgLyogIDAxIDExMDExICAgICAgICAgICovCi0gICAgMHgyYzBhLCAgICAgLyogIDAxIDExMDEgICAgICAgICAgKi8KLSAgICAweGMyMGEsICAgICAvKiAgMDEgMTExMDAgICAgICAgICAgKi8KLSAgICAweGMyMGEsICAgICAvKiAgMDEgMTExMCAgICAgICAgICAqLwotICAgIDB4NWIwYSwgICAgIC8qICAwMSAxMTEwMSAgICAgICAgICAqLwotICAgIDB4NWIwYSwgICAgIC8qICAwMSAxMTEwICAgICAgICAgICovCi0gICAgMHhiNTBhLCAgICAgLyogIDAxIDExMTEwICAgICAgICAgICovCi0gICAgMHhiNTBhLCAgICAgLyogIDAxIDExMTEgICAgICAgICAgKi8KLSAgICAweDFjMGEsCi0gICAgMHgxYzBhLAotICAgIDB4ODkwYSwKLSAgICAweDg5MGEsCi0gICAgMHg5ODBhLAotICAgIDB4OTgwYSwKLSAgICAweGMxMGEsICAgICAvKiAgMDEwMTAwIDAgICAgICAgICAgKi8KLSAgICAweGMxMGEsICAgICAvKiAgMDEwMTAwICAgICAgICAgICAqLwotICAgIDB4NGIwYSwgICAgIC8qICAwMTAxMDAgMSAgICAgICAgICAqLwotICAgIDB4NGIwYSwgICAgIC8qICAwMTAxMDAgICAgICAgICAgICovCi0gICAgMHhjMDBiLCAgICAgLyogIDAxMDEwIDAwMCAgICAgICAgICovCi0gICAgMHgwYjBiLCAgICAgLyogIDAxMDEwICAgICAgICAgICAqLwotICAgIDB4M2IwYSwgICAgIC8qICAwMTAxMCAwMSAgICAgICAgICAqLwotICAgIDB4M2IwYSwgICAgIC8qICAwMTAxMCAwICAgICAgICAgICovCi0gICAgMHhiMDBiLCAgICAgLyogIDAxMDEwIDEwMCAgICAgICAgICovCi0gICAgMHgwYTBiLCAgICAgLyogIDAxMDEwIDEwMSAgICAgICAgICovCi0gICAgMHgxYTBhLCAgICAgLyogIDAxMDEwIDExICAgICAgICAgICovCi0gICAgMHgxYTBhLCAgICAgLyogIDAxMDEwIDEgICAgICAgICAgKi8KLSAgICAweGI0MDksICAgICAvKiAgMDEwMSAwMCAgICAgICAgICAgKi8KLSAgICAweGI0MDksICAgICAvKiAgMDEwMSAwICAgICAgICAgICAqLwotICAgIDB4YjQwOSwgICAgIC8qICAwMTAxIDAgICAgICAgICAgICovCi0gICAgMHhiNDA5LCAgICAgLyogIDAxMDEgMCAgICAgICAgICAgKi8KLSAgICAweDZhMGEsICAgICAvKiAgMDEwMSAwMTAgICAgICAgICAgKi8KLSAgICAweDZhMGEsICAgICAvKiAgMDEwMSAwMSAgICAgICAgICAqLwotICAgIDB4YTYwYSwgICAgIC8qICAwMTAxIDAxMSAgICAgICAgICAqLwotICAgIDB4YTYwYSwgICAgIC8qICAwMTAxIDAxICAgICAgICAgICovCi0gICAgMHg3OTBhLCAgICAgLyogIDAxMDEgMTAwICAgICAgICAgICovCi0gICAgMHg3OTBhLCAgICAgLyogIDAxMDEgMTAgICAgICAgICAgKi8KLSAgICAweDk3MGEsICAgICAvKiAgMDEwMSAxMDEgICAgICAgICAgKi8KLSAgICAweDk3MGEsICAgICAvKiAgMDEwMSAxMCAgICAgICAgICAqLwotICAgIDB4YTAwYiwgICAgIC8qICAwMTAxIDExMDAgICAgICAgICAqLwotICAgIDB4MDkwYiwgICAgIC8qICAwMTAxIDExMDEgICAgICAgICAqLwotICAgIDB4OTAwYSwgICAgIC8qICAwMTAxIDExMSAgICAgICAgICAqLwotICAgIDB4OTAwYSwgICAgIC8qICAwMTAxIDExICAgICAgICAgICovCi0gICAgMHhjYTBiLAotICAgIDB4Y2EwYiwKLSAgICAweGJiMGIsCi0gICAgMHhiYjBiLAotICAgIDB4OGQwYiwKLSAgICAweDhkMGIsICAgICAvKiAgMDEwMDAwMCAgICAgICAgICAqLwotICAgIDB4ZDgwYiwgICAgIC8qICAwMTAwMDAwIDEgICAgICAgICAqLwotICAgIDB4ZDgwYiwgICAgIC8qICAwMTAwMDAwICAgICAgICAgICovCi0gICAgMHgwZTBjLCAgICAgLyogIDAxMDAwMCAwMDAgICAgICAgICovCi0gICAgMHhlMDBjLCAgICAgLyogIDAxMDAwMCAgICAgICAgICAqLwotICAgIDB4MGQwYiwgICAgIC8qICAwMTAwMDAgMDEgICAgICAgICAqLwotICAgIDB4MGQwYiwgICAgIC8qICAwMTAwMDAgMCAgICAgICAgICovCi0gICAgMHhlNjBhLCAgICAgLyogIDAxMDAwMCAxICAgICAgICAgICovCi0gICAgMHhlNjBhLCAgICAgLyogIDAxMDAwMCAgICAgICAgICAqLwotICAgIDB4ZTYwYSwgICAgIC8qICAwMTAwMDAgICAgICAgICAgKi8KLSAgICAweGU2MGEsICAgICAvKiAgMDEwMDAwICAgICAgICAgICovCi0gICAgMHgwZjA5LCAgICAgLyogICAwMTEwMDAgICAgICA0MDEgICovCi0gICAgMHgwZjA5LCAgICAgLyogICAwMTEwMCAgICAgICAgICAgKi8KLSAgICAweDBmMDksICAgICAvKiAgIDAxMTAwICAgICAgICAgICAqLwotICAgIDB4MGYwOSwgICAgIC8qICAgMDExMDAgICAgICAgICAgICovCi0gICAgMHhlZTBiLCAgICAgLyogICAwMTEgMDAgICAgICAgICAqLwotICAgIDB4ZGUwYiwgICAgIC8qICAgMDExIDAxICAgICAgICAgKi8KLSAgICAweGVkMGIsICAgICAvKiAgIDAxMSAxMCAgICAgICAgICovCi0gICAgMHhjZTBiLCAgICAgLyogICAwMTEgMTEgICAgICAgICAqLwotICAgIDB4ZWMwYiwgICAgIC8qICAgMDExMDEwMDAgICAgICAgICAqLwotICAgIDB4ZGQwYiwgICAgIC8qICAgMDExMDEgICAgICAgICAgKi8KLSAgICAweGJlMGIsICAgICAvKiAgIDAxMTAxMDEwICAgICAgICAgKi8KLSAgICAweGViMGIsICAgICAvKiAgIDAxMTAxMDExICAgICAgICAgKi8KLSAgICAweGNkMGIsICAgICAvKiAgIDAxMTAxMTAwICAgICAgICAgKi8KLSAgICAweGRjMGIsICAgICAvKiAgIDAxMTAxMTAxICAgICAgICAgKi8KLSAgICAweGFlMGIsICAgICAvKiAgIDAxMTAxMTEwICAgICAgICAgKi8KLSAgICAweGVhMGIsICAgICAvKiAgIDAxMTAxMTExICAgICAgICAgKi8KLSAgICAweGJkMGIsICAgICAvKiAgIDAxMTEwMDAwICAgICAgICAgKi8KLSAgICAweGRiMGIsICAgICAvKiAgIDAxMTEwICAgICAgICAgICovCi0gICAgMHhjYzBiLCAgICAgLyogICAwMTExIDAgICAgICAgICAqLwotICAgIDB4OWUwYiwgICAgIC8qICAgMDExMSAxICAgICAgICAgKi8KLSAgICAweGU5MGIsICAgICAvKiAgIDAxMTEwMTAwICAgICAgICAgKi8KLSAgICAweGFkMGIsICAgICAvKiAgIDAxMTEwMTAxICAgICAgICAgKi8KLSAgICAweGRhMGIsICAgICAvKiAgIDAxMTEwMTEwICAgICAgICAgKi8KLSAgICAweGJjMGIsICAgICAvKiAgIDAxMTEwMTExICAgICAgICAgKi8KLSAgICAweGNiMGIsICAgICAvKiAgIDAxMTExMDAwICAgICAgICAgKi8KLSAgICAweDhlMGIsCi0gICAgMHhlODBiLAotICAgIDB4OWQwYiwKLSAgICAweGQ5MGIsCi0gICAgMHg3ZTBiLAotICAgIDB4ZTcwYiwKLSAgICAweGFjMGIsCi0gICAgMHhmZjA0LAotICAgIDB4ZWYwOCwKLSAgICAweGZlMDgsCi0gICAgMHhkZjA4LCAgICAgLyogIDAwMDAgMCAgICAgICAgICAgICovCi0gICAgMHhmZDA4LCAgICAgLyogIDAwMDAgMSAgICAgICAgICAgICovCi0gICAgMHhjZjA4LCAgICAgLyogIDAwMCAwMCAgICAgICAgICAgICovCi0gICAgMHhmYzA4LCAgICAgLyogIDAwMCAwMSAgICAgICAgICAgICovCi0gICAgMHhiZjA4LCAgICAgLyogIDAwMCAxMCAgICAgICAgICAgICovCi0gICAgMHhmYjA4LCAgICAgLyogIDAwMCAxMSAgICAgICAgICAgICovCi0gICAgMHhmYTA3LCAgICAgLyogIDAwIDAwICAgICAgICAgICAgICovCi0gICAgMHhmYTA3LCAgICAgLyogIDAwIDAgICAgICAgICAgICAgKi8KLSAgICAweGFmMDgsICAgICAvKiAgMDAgMDEwICAgICAgICAgICAgKi8KLSAgICAweDlmMDgsICAgICAvKiAgMDAgMDExICAgICAgICAgICAgKi8KLSAgICAweGY5MDcsICAgICAvKiAgMDAgMTAgICAgICAgICAgICAgKi8KLSAgICAweGY5MDcsICAgICAvKiAgMDAgMSAgICAgICAgICAgICAqLwotICAgIDB4ZjgwNywgICAgIC8qICAwMCAxMSAgICAgICAgICAgICAqLwotICAgIDB4ZjgwNywgICAgIC8qICAwMCAxICAgICAgICAgICAgICovCi0gICAgMHg4ZjA4LAotICAgIDB4N2YwOCwgICAgIC8qICAwIDAgICAgICAgICAgICAgKi8KLSAgICAweGY3MDcsICAgICAvKiAgMCAgICAgICAgICAgICAgICovCi0gICAgMHhmNzA3LCAgICAgLyogIDAgMDAgICAgICAgICAgICAgKi8KLSAgICAweDZmMDcsICAgICAvKiAgMCAwMTAgICAgICAgICAgICAgKi8KLSAgICAweDZmMDcsICAgICAvKiAgMCAwMSAgICAgICAgICAgICAqLwotICAgIDB4ZjYwNywgICAgIC8qICAwIDAxMSAgICAgICAgICAgICAqLwotICAgIDB4ZjYwNywgICAgIC8qICAwIDAxICAgICAgICAgICAgICovCi0gICAgMHg1ZjA3LAotICAgIDB4NWYwNywgICAgIC8qICAwIDEwICAgICAgICAgICAgICovCi0gICAgMHhmNTA3LCAgICAgLyogIDAgMTAxICAgICAgICAgICAgICovCi0gICAgMHhmNTA3LCAgICAgLyogIDAgMTAgICAgICAgICAgICAgKi8KLSAgICAweDRmMDcsICAgICAvKiAgMCAxMTAgICAgICAgICAgICAgKi8KLSAgICAweDRmMDcsICAgICAvKiAgMCAxMSAgICAgICAgICAgICAqLwotICAgIDB4ZjQwNywgICAgIC8qICAwIDExMSAgICAgICAgICAgICAqLwotICAgIDB4ZjQwNywgICAgIC8qICAwIDExICAgICAgICAgICAgICovCi0gICAgMHgzZjA3LAotICAgIDB4M2YwNywKLSAgICAweGYzMDcsICAgICAvKiAgIDAgICAgICAgICAgICAgICovCi0gICAgMHhmMzA3LAotICAgIDB4MmYwNywgICAgIC8qICAgIDAgICAgICAgICAgICAgKi8KLSAgICAweDJmMDcsICAgICAvKiAgICAgICAgICAgICAgICAgKi8KLSAgICAweGYyMDcsICAgICAvKiAgICAxICAgICAgICAgICAgICovCi0gICAgMHhmMjA3LCAgICAgLyogICAgICAgICAgICAgICAgICovCi0gICAgMHhmMTA3LAotICAgIDB4ZjEwNywKLSAgICAweDFmMDgsCi0gICAgMHhmMDA4Ci0KLX07Ci0KLQotY29uc3QgdWludDE2IGh1ZmZUYWJsZV8zMlszM10gPQotewotCi0gICAgMHgwYjA2LAotICAgIDB4MGYwNiwKLSAgICAweDBkMDYsCi0gICAgMHgwZTA2LAotICAgIDB4MDcwNiwKLSAgICAweDA1MDYsCi0gICAgMHgwOTA1LAotICAgIDB4MDkwNSwKLSAgICAweDA2MDUsCi0gICAgMHgwNjA1LAotICAgIDB4MDMwNSwKLSAgICAweDAzMDUsCi0gICAgMHgwYTA1LAotICAgIDB4MGEwNSwKLSAgICAweDBjMDUsCi0gICAgMHgwYzA1LAotICAgIDB4MDIwNCwKLSAgICAweDAyMDQsCi0gICAgMHgwMjA0LAotICAgIDB4MDIwNCwKLSAgICAweDAxMDQsCi0gICAgMHgwMTA0LAotICAgIDB4MDEwNCwKLSAgICAweDAxMDQsCi0gICAgMHgwNDA0LAotICAgIDB4MDQwNCwKLSAgICAweDA0MDQsCi0gICAgMHgwNDA0LAotIC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ldGVyKGluZGV4LCBwYXJhbXMpOwotICAgIH0KLX0KLQotT01YX0VSUk9SVFlQRSBTb2Z0VlBYOjppbnRlcm5hbFNldFBhcmFtZXRlcigKLSAgICAgICAgT01YX0lOREVYVFlQRSBpbmRleCwgY29uc3QgT01YX1BUUiBwYXJhbXMpIHsKLSAgICBzd2l0Y2ggKGluZGV4KSB7Ci0gICAgICAgIGNhc2UgT01YX0luZGV4UGFyYW1TdGFuZGFyZENvbXBvbmVudFJvbGU6Ci0gICAgICAgIHsKLSAgICAgICAgICAgIGNvbnN0IE9NWF9QQVJBTV9DT01QT05FTlRST0xFVFlQRSAqcm9sZVBhcmFtcyA9Ci0gICAgICAgICAgICAgICAgKGNvbnN0IE9NWF9QQVJBTV9DT01QT05FTlRST0xFVFlQRSAqKXBhcmFtczsKLQotICAgICAgICAgICAgaWYgKHN0cm5jbXAoKGNvbnN0IGNoYXIgKilyb2xlUGFyYW1zLT5jUm9sZSwKLSAgICAgICAgICAgICAgICAgICAgICAgICJ2aWRlb19kZWNvZGVyLnZweCIsCi0gICAgICAgICAgICAgICAgICAgICAgICBPTVhfTUFYX1NUUklOR05BTUVfU0laRSAtIDEpKSB7Ci0gICAgICAgICAgICAgICAgcmV0dXJuIE9NWF9FcnJvclVuZGVmaW5lZDsKLSAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgcmV0dXJuIE9NWF9FcnJvck5vbmU7Ci0gICAgICAgIH0KLQotICAgICAgICBjYXNlIE9NWF9JbmRleFBhcmFtVmlkZW9Qb3J0Rm9ybWF0OgotICAgICAgICB7Ci0gICAgICAgICAgICBPTVhfVklERU9fUEFSQU1fUE9SVEZPUk1BVFRZUEUgKmZvcm1hdFBhcmFtcyA9Ci0gICAgICAgICAgICAgICAgKE9NWF9WSURFT19QQVJBTV9QT1JURk9STUFUVFlQRSAqKXBhcmFtczsKLQotICAgICAgICAgICAgaWYgKGZvcm1hdFBhcmFtcy0+blBvcnRJbmRleCA+IDEpIHsKLSAgICAgICAgIC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VyLT5uRmxhZ3MgJiBPTVhfQlVGRkVSRkxBR19FT1MpIHsKLSAgICAgICAgICAgIGluUXVldWUuZXJhc2UoaW5RdWV1ZS5iZWdpbigpKTsKLSAgICAgICAgICAgIGluSW5mby0+bU93bmVkQnlVcyA9IGZhbHNlOwotICAgICAgICAgICAgbm90aWZ5RW1wdHlCdWZmZXJEb25lKGluSGVhZGVyKTsKLQotICAgICAgICAgICAgb3V0SGVhZGVyLT5uRmlsbGVkTGVuID0gMDsKLSAgICAgICAgICAgIG91dEhlYWRlci0+bkZsYWdzID0gT01YX0JVRkZFUkZMQUdfRU9TOwotCi0gICAgICAgICAgICBvdXRRdWV1ZS5lcmFzZShvdXRRdWV1ZS5iZWdpbigpKTsKLSAgICAgICAgICAgIG91dEluZm8tPm1Pd25lZEJ5VXMgPSBmYWxzZTsKLSAgICAgICAgICAgIG5vdGlmeUZpbGxCdWZmZXJEb25lKG91dEhlYWRlcik7Ci0gICAgICAgICAgICByZXR1cm47Ci0gICAgICAgIH0KLQotICAgICAgICBpZiAodnB4X2NvZGVjX2RlY29kZSgKLSAgICAgICAgICAgICAgICAgICAgKHZweF9jb2RlY19jdHhfdCAqKW1DdHgsCi0gICAgICAgICAgICAgICAgICAgIGluSGVhZGVyLT5wQnVmZmVyICsgaW5IZWFkZXItPm5PZmZzZXQsCi0gICAgICAgICAgICAgICAgICAgIGluSGVhZGVyLT5uRmlsbGVkTGVuLAotICAgICAgICAgICAgICAgICAgICBOVUxMLAotICAgICAgICAgICAgICAgICAgICAwKSkgewotICAgICAgICAgICAgQUxPR0UoIm9uMiBkZWNvZGVyIGZhaWxlZCB0byBkZWNvZGUgZnJhbWUuIik7Ci0KLSAgICAgICAgICAgIG5vdGlmeShPTVhfRXZlbnRFcnJvciwgT01YX0Vycm9yVW5kZWZpbmVkLCAwLCBOVUxMKTsKLSAgICAgICAgICAgIHJldHVybjsKLSAgICAgICAgfQotCi0gICAgICAgIHZweF9jb2RlY19pdGVyX3QgaXRlciA9IE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Zy0+cGxhbmVzW1BMQU5FX1ldOwotICAgICAgICAgICAgdWludDhfdCAqZHN0ID0gb3V0SGVhZGVyLT5wQnVmZmVyOwotICAgICAgICAgICAgZm9yIChzaXplX3QgaSA9IDA7IGkgPCBpbWctPmRfaDsgKytpKSB7Ci0gICAgICAgICAgICAgICAgbWVtY3B5KGRzdCwgc3JjTGluZSwgaW1nLT5kX3cpOwotCi0gICAgICAgICAgICAgICAgc3JjTGluZSArPSBpbWctPnN0cmlkZVtQTEFORV9ZXTsKLSAgICAgICAgICAgICAgICBkc3QgKz0gaW1nLT5kX3c7Ci0gICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgIHNyY0xpbmUgPSAoY29uc3QgdWludDhfdCAqKWltZy0+cGxhbmVzW1BMQU5FX1VdOwotICAgICAgICAgICAgZm9yIChzaXplX3QgaSA9IDA7IGkgPCBpbWctPmRfaCAvIDI7ICsraSkgewotICAgICAgICAgICAgICAgIG1lbWNweShkc3QsIHNyY0xpbmUsIGltZy0+ZF93IC8gMik7Ci0KLSAgICAgICAgICAgICAgICBzcmNMaW5lICs9IGltZy0+c3RyaWRlW1BMQU5FX1VdOwotICAgICAgICAgICAgICAgIGRzdCArPSBpbWctPmRfdyAvIDI7Ci0gICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgIHNyY0xpbmUgPSAoY29uc3QgdWludDhfdCAqKWltZy0+cGxhbmVzW1BMQU5FX1ZdOwotICAgICAgICAgICAgZm9yIChzaXplX3QgaSA9IDA7IGkgPCBpbWctPmRfaCAvIDI7ICsraSkgewotICAgICAgICAgICAgICAgIG1lbWNweShkc3QsIHNyY0xpbmUsIGltZy0+ZF93IC8gMik7Ci0KLSAgICAgICAgICAgICAgICBzcmNMaW5lICs9IGltZy0+c3RyaWRlW1BMQU5FX1ZdOwotICAgICAgICAgICAgICAgIGRzdCArPSBpbWctPmRfdyAvIDI7Ci0gICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgIG91dEluZm8tPm1Pd25lZEJ5V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fQotCi1PTVhfRVJST1JUWVBFIFNvZnRBVkM6OmludGVybmFsU2V0UGFyYW1ldGVyKAotICAgICAgICBPTVhfSU5ERVhUWVBFIGluZGV4LCBjb25zdCBPTVhfUFRSIHBhcmFtcykgewotICAgIHN3aXRjaCAoaW5kZXgpIHsKLSAgICAgICAgY2FzZSBPTVhfSW5kZXhQYXJhbVN0YW5kYXJkQ29tcG9uZW50Um9sZToKLSAgICAgICAgewotICAgICAgICAgICAgY29uc3QgT01YX1BBUkFNX0NPTVBPTkVOVFJPTEVUWVBFICpyb2xlUGFyYW1zID0KLSAgICAgICAgICAgICAgICAoY29uc3QgT01YX1BBUkFNX0NPTVBPTkVOVFJPTEVUWVBFICopcGFyYW1zOwotCi0gICAgICAgICAgICBpZiAoc3RybmNtcCgoY29uc3QgY2hhciAqKXJvbGVQYXJhbXMtPmNSb2xlLAotICAgICAgICAgICAgICAgICAgICAgICAgInZpZGVvX2RlY29kZXIuYXZjIiwKLSAgICAgICAgICAgICAgICAgICAgICAgIE9NWF9NQVhfU1RSSU5HTkFNRV9TSVpFIC0gMSkpIHsKLSAgICAgICAgICAgICAgICByZXR1cm4gT01YX0Vycm9yVW5kZWZpbmVkOwotICAgICAgICAgICAgfQotCi0gICAgICAgICAgICByZXR1cm4gT01YX0Vycm9yTm9uZTsKLSAgICAgICAgfQotCi0gICAgICAgIGNhc2UgT01YX0luZGV4UGFyYW1WaWRlb1BvcnRGb3JtYXQ6Ci0gICAgICAgIHsKLSAgICAgICAgICAgIE9NWF9WSURFT19QQVJBTV9QT1JURk9STUFUVFlQRSAqZm9ybWF0UGFyYW1zID0KLSAgICAgICAgICAgICAgICAoT01YX1ZJREVPX1BBUkFNX1BPUlRGT1JNQVRUWVBFICopcGFyYW1zOwotCi0gICAgICAgICAgICBpZiAoZm9ybWF0UGFyYW1zLT5uUG9ydEluZGV4ID4ga091dHB1dFBvcnRJbmRleCkgewotICAgICAgICAgICAgICAgIHJldHVybiBPTVhfRXJyb3JVbmRlZm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ydFNldHRpbmdDaGFuZ2VFdmVudCgmZGVjb2RlckluZm8pKSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICBwb3J0U2V0dGluZ3NDaGFuZ2VkID0gdHJ1ZTsKLSAgICAgICAgICAgICAgICAgICAgfQotCi0gICAgICAgICAgICAgICAgICAgIGlmIChkZWNvZGVySW5mby5jcm9wcGluZ0ZsYWcgJiYKLSAgICAgICAgICAgICAgICAgICAgICAgIGhhbmRsZUNyb3BSZWN0RXZlbnQoJmRlY29kZXJJbmZvLmNyb3BQYXJhbXMpKSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICBwb3J0U2V0dGluZ3NDaGFuZ2VkID0gdHJ1ZTsKLSAgICAgICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgIH0gZWxzZSB7Ci0gICAgICAgICAgICAgICAgaWYgKHBvcnRTZXR0aW5nc0NoYW5nZWQpIHsKLSAgICAgICAgICAgICAgICAgICAgaWYgKEgyNjRTd0RlY05leHRQaWN0dXJlKG1IYW5kbGUsICZkZWNvZGVkUGljdHVyZSwgMCkKLSAgICAgICAgICAgICAgICAgICAgICAgID09IEgyNjRTV0RFQ19QSUNfUkRZKSB7Ci0KLSAgICAgICAgICAgICAgICAgICAgICAgIC8vIFNhdmUgdGhpcyBvdXRwdXQgYnVmZmVyOyBvdGhlcndpc2UsIGl0IHdpbGwgYmUKLSAgICAgICAgICAgICAgICAgICAgICAgIC8vIGxvc3QgZHVyaW5nIGR5bmFtaWMgcG9ydCByZWNvbmZpZ3VyYXRpb24gYmVjYXVzZQotICAgICAgICAgICAgICAgICAgICAgICAgLy8gT3Blbk1BWCBjbGllbnQgd2lsbCBkZWxldGUgX2FsbF8gb3V0cHV0IGJ1ZmZlcnMKLSAgICAgICAgICAgICAgICAgICAgICAgIC8vIGluIHRoZSBwcm9jZXNzLgotICAgICAgICAgICAgICAgICAgICAgICAgc2F2ZUZpcnN0T3V0cHV0QnVmZmVyKAotICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRlY29kZWRQaWN0dXJlLnBpY0lkLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICh1aW50OF90ICopZGVjb2RlZFBpY3R1cmUucE91dHB1dFBpY3R1cmUpOwotICAgICAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgIGluUGljdHVyZS5kYXRhTGVuID0gMDsKLSAgICAgICAgICAgICAgICBpZiAocmV0IDwgMCkgewotICAgICAgICAgICAgICAgICAgICBBTE9HRSgiRGVjb2RlciBmYWlsZWQ6ICVkIiwgcmV0KTsKLQotICAgICAgICAgICAgICAgICAgICBub3RpZnkoT01YX0V2ZW50RXJyb3IsIE9NWF9FcnJvclVuZGVmaW5lZCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgIEVSUk9SX01BTEZPUk1FRCwgTlVMTCk7Ci0KLSAgICAgICAgICAgICAgICAgICAgbVNpZ25hbGxlZEVycm9yID0gdHJ1ZTsKLSAgICAgICAgICAgICAgICAgICAgcmV0dXJuOwotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgIH0KLSAgICAgICAgfQotICAgICAgICBpbkluZm8tPm1Pd25lZEJ5VXMgPSBmYWxzZTsKLSAgICAgICAgbm90aWZ5RW1wdHlCdWZmZXJEb25lKGluSGVhZGVyKTsKLQotICAgICAgICBpZiAocG9ydFNldHRpbmdzQ2hhbmdlZCkgewotICAgICAgICAgICAgcG9ydFNldHRpbmdzQ2hhbmdlZCA9IGZhbHNlOwotICAgICAgICAgICAgcmV0dXJuOwotICAgICAgICB9Ci0KLSAgICAgICAgaWYgKG1GaXJzdFBpY3R1cmUgJiYgIW91dFF1ZXVlLmVtcHR5KCkpIHsKLSAgICAgICAgICAgIGRyYWluT25lT3V0cHV0QnVmZmVyKG1GaXJzdFBpY3R1cmVJZCwgbUZpcnN0UGljdHVyZSk7Ci0gICAgICAgICAgICBkZWxldGVbXSBtRmlyc3RQaWN0dXJlOwotICAgICAgICAgICAgbUZpcnN0UGljdHVyZSA9IE5VTEw7Ci0gICAgICAgICAgICBtRmlyc3RQaWN0dXJlSWQgPSAtMTsKLSAgICAgICAgfQotCi0gICAgICAgIHdoaWxlICghb3V0UXVldWUuZW1wdHkoKSAmJgotICAgICAgICAgICAgICAgIG1IZWFkZXJzRGVjb2RlZCAmJgotICAgICAgICAgICAgICAgIEgyNjRTd0RlY05leHRQaWN0dXJlKG1IYW5kbGUsICZkZWNvZGVkUGljdHVyZSwgMCkKLSAgICAgICAgICAgICAgICAgICAgPT0gSDI2NFNXREVDX1BJQ19SRFkpIHsKLQotICAgICAgICAgICAgaW50MzJfdCBwaWNJZCA9IGRlY29kZWRQaWN0dXJlLnBpY0lkOwotICAgICAgICAgICAgdWludDhfdCAqZGF0YSA9ICh1aW50OF90ICopIGRlY29kZWRQaWN0dXJlLnBPdXRwdXRQaWN0dXJlOwotICAgICAgICAgICAgZHJhaW5PbmVPdXRwdXRCdWZmZXIocGljSWQsIGRhdGEpOwotICAgICAgICB9Ci0gICAgfQotfQotCi1ib29sIFNvZnRBVkM6OmhhbmRsZVBvcnRTZXR0aW5nQ2hhbmdlRXZlbnQoY29uc3QgSDI2NFN3RGVjSW5mbyAqaW5mbykgewotICAgIGlmIChtV2lkdGggIT0gaW5mby0+cGljV2lkdGggfHwgbUhlaWdodCAhPSBpbmZvLT5waWNIZWlnaHQpIHsKLSAgICAgICAgbVdpZHRoICA9IGluZm8tPnBpY1dpZHRoOwotICAgICAgICBtSGVpZ2h0ID0gaW5mby0+cGljSGVpZ2h0OwotICAgICAgICBtUGljdHVyZVNpemUgPSBtV2lkdGggKiBtSGVpZ2h0ICogMyAvIDI7Ci0gICAgICAgIG1Dcm9wV2lkdGggPSBtV2lkdGg7Ci0gICAgICAgIG1Dcm9wSGVpZ2h0ID0gbUhlaWdodDsKLSAgICAgICAgdXBkYXRlUG9ydERlZmluaXRpb25zKCk7Ci0gICAgICAgIG5vdGlmeShPTVhfRXZlbnRQb3J0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LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tKi8KLQotICAgIEgyNjRTd0RlY1JldCBIMjY0U3dEZWNEZWNvZGUoSDI2NFN3RGVjSW5zdCAgICAgIGRlY0luc3QsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBIMjY0U3dEZWNJbnB1dCAgICAgKnBJbnB1dCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEgyNjRTd0RlY091dHB1dCAgICAqcE91dHB1dCk7Ci0KLSAgICBIMjY0U3dEZWNSZXQgSDI2NFN3RGVjSW5pdChIMjY0U3dEZWNJbnN0ICpkZWNJbnN0LAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHUzMiAgICAgICAgICAgIG5vT3V0cHV0UmVvcmRlcmluZyk7Ci0KLSAgICBIMjY0U3dEZWNSZXQgSDI2NFN3RGVjTmV4dFBpY3R1cmUoSDI2NFN3RGVjSW5zdCAgICAgZGVjSW5zdCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgSDI2NFN3RGVjUGljdHVyZSAqcE91dHB1dCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdTMyICAgICAgICAgICAgICAgZW5kT2ZTdHJlYW0pOwotCi0gICAgSDI2NFN3RGVjUmV0IEgyNjRTd0RlY0dldEluZm8oSDI2NFN3RGVjSW5zdCBkZWNJbnN0LAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEgyNjRTd0RlY0luZm8gKnBEZWNJbmZvKTsKLQotICAgIHZvaWQgIEgyNjRTd0RlY1JlbGVhc2UoSDI2NFN3RGVjSW5zdCBkZWNJbnN0KTsKLQotICAgIEgyNjRTd0RlY0FwaVZlcnNpb24gSDI2NFN3RGVjR2V0QVBJVmVyc2lvbih2b2lkKTsKLQotICAgIC8qIGZ1bmN0aW9uIHByb3RvdHlwZSBmb3IgQVBJIHRyYWNlICovCi0gIC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VmFsdWUsCi0gICAgICAgICAgICAgICAgICAgICAgICBPTVhfSU5UIHNoaWZ0Ci0gICAgICAgICAgICAgICAgICAgICAgICApOwotCi0vKioKLSAqIEZ1bmN0aW9uIDphcm1TYXRNdWxTMTZTMzJfUzMyKCkKLSAqCi0gKiBEZXNjcmlwdGlvbiA6Ci0gKiAgICAgUmV0dXJucyB0aGUgcmVzdWx0IG9mIGEgUzE2IGRhdGEgdHlwZSBtdWx0aXBsaWVkIHdpdGggYW4gUzMyIGRhdGEgdHlwZQotICogICAgIGluIGEgUzMyIGNvbnRhaW5lcgotICoKLSAqIFBhcmFtZXRyczoKLSAqIFtpbl0gaW5wdXQxICAgICAgIE9wZXJhbmQgMQotICogW2luXSBpbnB1dDIgICAgICAgT3BlcmFuZCAyCi0gKgotICogUmV0dXJuOgotICogW291dF0gICAgICAgICAgICAgUmVzdWx0IG9mIG9wZXJhdGlvbgotICogICAgCi0gKiovCi0KLQotT01YX1MzMiBhcm1TYXRNdWxTMTZTMzJfUzMyKAotICAgICAgICAgICAgICAgICAgICBPTVhfUzE2IGlucHV0MSwKLSAgICAgICAgICAgICAgICAgICAgT01YX1MzMiBpbnB1dDIpOwotCi0vKioKLSAqIEZ1bmN0aW9uIDphcm1TYXRNdWxTMzJTMzJfUzMyKCkKLSAqCi0gKiBEZXNjcmlwdGlvbiA6Ci0gKiAgICAgUmV0dXJucyB0aGUgcmVzdWx0IG9mIGEgUzMyIGRhdGEgdHlwZSBtdWx0aXBsaWVkIHdpdGggYW4gUzMyIGRhdGEgdHlwZQotICogICAgIGluIGEgUzMyIGNvbnRhaW5lcgotICoKLSAqIFBhcmFtZXRyczoKLSAqIFtpbl0gaW5wdXQxICAgICAgIE9wZXJhbmQgMQotICogW2luXSBpbnB1dDIgICAgICAgT3BlcmFuZCAyCi0gKgotICogUmV0dXJuOgotICogW291dF0gICAgICAgICAgICAgUmVzdWx0IG9mIG9wZXJhdGlvbgotICogICAgCi0gKiovCi0KLU9NWF9TMzIgYXJ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UgREVCVUdfU1RSRUFNIHN0ZG91dAotCi0vKgotICogRGVidWcgcHJpbnRmIG1hY3Jvcywgb25lIGZvciBlYWNoIGFyZ3VtZW50IGNvdW50LgotICogQWRkIG1vcmUgaWYgbmVlZGVkLgotICovCi0jaWZkZWYgREVCVUdfT04KLSNpbmNsdWRlIDxzdGRpby5oPgotCi0jZGVmaW5lIERFQlVHX1BSSU5URl8wKGEpICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBmcHJpbnRmKERFQlVHX1NUUkVBTSwgYSkKLSNkZWZpbmUgREVCVUdfUFJJTlRGXzEoYSwgYikgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZwcmludGYoREVCVUdfU1RSRUFNLCBhLCBiKQotI2RlZmluZSBERUJVR19QUklOVEZfMihhLCBiLCBjKSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZnByaW50ZihERUJVR19TVFJFQU0sIGEsIGIsIGMpCi0jZGVmaW5lIERFQlVHX1BSSU5URl8zKGEsIGIsIGMsIGQpICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBmcHJpbnRmKERFQlVHX1NUUkVBTSwgYSwgYiwgYywgZCkKLSNkZWZpbmUgREVCVUdfUFJJTlRGXzQoYSwgYiwgYywgZCwgZSkgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZwcmludGYoREVCVUdfU1RSRUFNLCBhLCBiLCBjLCBkLCBlKQotI2RlZmluZSBERUJVR19QUklOVEZfNShhLCBiLCBjLCBkLCBlLCBmKSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZnByaW50ZihERUJVR19TVFJFQU0sIGEsIGIsIGMsIGQsIGUsIGYpCi0jZGVmaW5lIERFQlVHX1BSSU5URl82KGEsIGIsIGMsIGQsIGUsIGYsIGcpICAgICAgICAgICAgICAgICAgICAgICAgICAgICBmcHJpbnRmKERFQlVHX1NUUkVBTSwgY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sIG0sIG4pICAgICAgIGZwcmludGYoREVCVUdfU1RSRUFNLCBhLCBiLCBjLCBkLCBlLCBmLCBnLCBoLCBpLCBqLCBrLCBsLCBtLCBuKQotI2RlZmluZSBERUJVR19QUklOVEZfMTQoYSwgYiwgYywgZCwgZSwgZiwgZywgaCwgaSwgaiwgaywgbCwgbSwgbiwgbykgICAgZnByaW50ZihERUJVR19TVFJFQU0sIGEsIGIsIGMsIGQsIGUsIGYsIGcsIGgsIGksIGosIGssIGwsIG0sIG4sIG8pCi0jZWxzZSAvKiBERUJVR19PTiAqLwotI2RlZmluZSBERUJVR19QUklOVEZfMChhKSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKLSNkZWZpbmUgREVCVUdfUFJJTlRGXzEoYSwgYikgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCi0jZGVmaW5lIERFQlVHX1BSSU5URl8yKGEsIGIsIGMpICAgICAgICAgICAgICAgICAgICAgICAgICAgIAotI2RlZmluZSBERUJVR19QUklOVEZfMyhhLCBiLCBjLCBkKSAgICAgICAgICAgICAgICAgICAgICAgICAKLSNkZWZpbmUgREVCVUdfUFJJTlRGXzQoYSwgYiwgYywgZCwgZSkgICAgICAgICAgICAgICAgICAgICAgCi0jZGVmaW5lIERFQlVHX1BSSU5URl81KGEsIGIsIGMsIGQsIGUsIGYpICAgICAgICAgICAgICAgICAgIAotI2RlZmluZSBERUJVR19QUklOVEZfNihhLCBiLCBjLCBkLCBlLCBmLCBnKSAgICAgICAgICAgICAgICAKLSNkZWZpbmUgREVCVUdfUFJJTlRGXzcoYSwgYiwgYywgZCwgZSwgZiwgZywgaCkgICAgICAgICAgICAgCi0jZGVmaW5lIERFQlVHX1BSSU5URl84KGEsIGIsIGMsIGQsIGUsIGYsIGcsIGgsIGkpICAgICAgICAgIAotI2RlZmluZSBERUJVR19QUklOVEZfOShhLCBiLCBjLCBkLCBlLCBmLCBnLCBoLCBpLCBqKSAgICAgICAKLSNkZWZpbmUgREVCVUd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nM6Ci0gICAgICAgIDsvLwotICAgICAgICA7Ly8gJFQxLCRUMiwkVDMgICAgIC0gcmVnaXN0ZXJzIHRoYXQgbXVzdCBiZSBwcmVzZXJ2ZWQgYmV0d2VlbiBjYWxscyB0bwotICAgICAgICA7Ly8gICAgICAgICAgICAgICAgICAgTV9CRF9JTklUMSBhbmQgTV9CRF9JTklUMgotICAgICAgICA7Ly8gJHBCaXRTdHJlYW0gICAgIFwgCi0gICAgICAgIDsvLyAkQml0QnVmZmVyICAgICAgIH0gU2VlIGRlc2NyaXB0aW9uIGFib3ZlLgotICAgICAgICA7Ly8gJEJpdENvdW50ICAgICAgIC8gCi0gICAgICAgIDsvLwotICAgICAgICBNQUNSTwotICAgICAgICBNX0JEX0lOSVQwICAkcHBCaXRTdHJlYW0sICRwQml0T2Zmc2V0LCAkUkJpdFN0cmVhbSwgJFJCaXRCdWZmZXIsICRSQml0Q291bnQKLQotcEJpdFN0cmVhbSAgU0VUUyAiJFJCaXRTdHJlYW0iCi1CaXRCdWZmZXIgICBTRVRTICIkUkJpdEJ1ZmZlciIKLUJpdENvdW50ICAgIFNFVFMgIiRSQml0Q291bnQiICAgICAgICAKLSAgICAgICAgCi0gICAgICAgIDsvLyBsb2FkIGlucHV0cwotICAgICAgICBMRFIgICAgICRwQml0U3RyZWFtLCBbJHBwQml0U3RyZWFtXQotICAgICAgICBMRFIgICAgICRCaXRDb3VudCwgWyRwQml0T2Zmc2V0XQotICAgICAgICBNRU5ECi0gICAgICAgIAotICAgICAgICBNQUNSTwotICAgICAgICBNX0JEX0lOSVQxICAkVDEsICRUMiwgJFQzCi0gICAgICAgIExEUkIgICAgJFQyLCBbJHBCaXRTdHJlYW0sICMyXQotICAgICAgICBMRFJCICAgICRUMSwgWyRwQml0U3RyZWFtLCAjMV0KLSAgICAgICAgTERSQiAgICAkQml0QnVmZmVyLCAgWyRwQml0U3RyZWFtXSwgIzMKLSAgICAgICAgQUREICAgICAkQml0Q291bnQsICRCaXRDb3VudCwgIzgKLSAgICAgICAgTUVORAotICAgICAgICAKLSAgICAgICAgTUFDUk8KLSAgICAgICAgTV9CRF9JTklUMiAgJFQxLCAkVDIsICRUMwotICAgICAgICBPUlIgICAgICRUMiwgJFQyLCAkVDEsIExTTCAjOAotICAgICAgICBPUlIgICAgICRCaXRCdWZmZXIsICRUMiwgJEJpdEJ1ZmZlciwgTFNMICMxNgotICAgICAgICBNRU5EICAgIAotICAgICAgICAKLSAgICAgICAgOy8vCi0gICAgICAgIDsvLyBMb29rIGFoZWFkIGZpeGVkIDE8PU48PTggYml0cyB3aXRob3V0IGNvbnN1bWluZyBhbnkgYml0cwotICAgICAgICA7Ly8gVGhlIG5leHQgYml0cyB3aWxsIGJlIHBsYWNlZCBhdCBiaXQgMzEuLjI0IG9mIGRlc3RpbmF0aW9uIHJlZ2lzdGVyCi0gICAgICAgIDsvLwotICAgICAgICA7Ly8gSW5wdXQgUmVnaXN0ZXJzOgotICAgICAgICA7Ly8KLSAgICAgICAgOy8vICROICAgICAgICAgICAgICAtIG51bWJlciBvZiBiaXRzIHRvIGxvb2sKLSAgICAgICAgOy8vICRwQml0U3RyZWFtICAgICBcIAotICAgICAgICA7Ly8gJEJpdEJ1ZmZlciAgICAgICB9IFNlZSBkZXNjcmlwdGlvbiBhYm92ZS4KLSAgICAgICAgOy8vICRCaXRDb3VudCAgICAgICAvIAotICAgICAgICA7Ly8gCi0gICAgICAgIDsvLyBPdXRwdXQgUmVnaXN0ZXJzOgotICAgICAgICA7Ly8KLSAgICAgICAgOy8vICRTeW1ib2wgICAgICAgICAtIHRoZSBuZXh0IE4gYml0cyBvZiB0aGUgYml0c3RyZWFtCi0gICAgICAgIDsvLyAkVDEgICAgICAgICAgICAgLSBjb3JydXB0ZWQgdGVtcC9zY3JhdGNoIHJlZ2lzdGVyCi0gICAgICAgIDsvLyAkcEJpdFN0cmVhbSAgICAgXCAKLSAgICAgICAgOy8vICRCaXRCdWZmZXIgICAgICAgfSBTZWUgZGVzY3JpcHRpb24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gJEJpdEJ1ZmZlciAgICAgICB9IFNlZSBkZXNjcmlwdGlvbiBhYm92ZS4KLSAgICAgICAgOy8vICRCaXRDb3VudCAgICAgICAvIAotICAgICAgICA7Ly8KLSAgICAgICAgTUFDUk8KLSAgICAgICAgTV9CRF9MT09LMTYgICRTeW1ib2wsICROLCAkVDEKLSAgICAgICAgQVNTRVJUICAoJE4gPj0gMSk6TEFORDooJE4gPD0gMTYpCi0gICAgICAgIE1PViAgICAgJFN5bWJvbCwgJEJpdEJ1ZmZlciwgTFNMICRCaXRDb3VudAotICAgICAgICBNRU5ECi0gICAgICAgIAotICAgICAgICA7Ly8KLSAgICAgICAgOy8vIFNraXBzIGZpeGVkIDE8PU48PTggYml0cyBmcm9tIHRoZSBiaXRzdHJlYW0sIGFkdmFuY2luZyB0aGUgYml0c3RyZWFtIHBvaW50ZXIKLSAgICAgICAgOy8vCi0gICAgICAgIDsvLyBJbnB1dCBSZWdpc3RlcnM6Ci0gICAgICAgIDsvLwotICAgICAgICA7Ly8gJE4gICAgICAgICAgICAgIC0gbnVtYmVyIG9mIGJpdHMKLSAgICAgICAgOy8vICRwQml0U3RyZWFtICAgICBcIAotICAgICAgICA7Ly8gJEJpdEJ1ZmZlciAgICAgICB9IFNlZSBkZXNjcmlwdGlvbiBhYm92ZS4KLSAgICAgICAgOy8vICRCaXRDb3VudCAgICAgICAvIAotICAgICAgICA7Ly8gCi0gICAgICAgIDsvLyBPdXRwdXQgUmVnaXN0ZXJzOgotICAgICAgICA7Ly8KLSAgICAgICAgOy8vICRUMSAgICAgICAgICAgICAtIGNvcnJ1cHRlZCB0ZW1wL3NjcmF0Y2ggcmVnaXN0ZXIKLSAgICAgICAgOy8vICRwQml0U3RyZWFtICAgICBcIAotICAgICAgICA7Ly8gJEJpdEJ1ZmZlciAgICAgICB9IFNlZSBkZXNjcmlwdGlvbiBhYm92ZS4KLSAgICAgICAgOy8vICRCaXRDb3VudCAgICAgICAvIAotICAgICAgICA7Ly8KLSAgICAgICAgTUFDUk8KLSAgICAgICAgTV9CRF9TS0lQOCAkTiwgJFQxCi0gICAgICAgIEFTU0VSVCAgKCROPj0xKTpMQU5EOigkTjw9OCkgICAgICAgIAotICAgICAgICBTVUJTICAgICRCaXRDb3VudCwgJEJpdENvdW50LCAjKDgtJE4pCi0gICAgICAgIExEUkNTQiAgJFQxLCBbJHBCaXRTdHJlYW1dLCAjMSAgIAotICAgICAgICBBRERDQyAgICRCaXRDb3VudCwgJEJpdENvdW50LCAjOAotICAgICAgICBPUlJDUyAgICRCaXRCdWZmZXIsICRUMSwgJEJpdEJ1ZmZlciwgTFNMICM4Ci0gICAgICAgIE1FTkQKLSAgICAgICAgCi0gICAgICAgIAotICAgICAgICA7Ly8KLSAgICAgICAgOy8vIFJlYWQgZml4ZWQgMTw9Tjw9OCBiaXRzIGZyb20gdGhlIGJpdHN0cmVhbSwgYWR2YW5jaW5nIHRoZSBiaXRzdHJlYW0gcG9pbnRlcgotICAgICAgICA7Ly8KLSAgICAgICAgOy8vIElucHV0IFJlZ2lzdGVyczoKLSAgICAgICAgOy8vCi0gICAgICAgIDsvLyAkTiAgICAgICAgICAgICAgLSBudW1iZXIgb2YgYml0cyB0byByZWFkCi0gICAgICAgIDsvLyAkcEJpdFN0cmVhbSAgICAgXCAKLSAgICAgICAgOy8vICRCaXRCdWZmZXIgICAgICAgfSBTZWUgZGVzY3JpcHRpb24gYWJvdmUuCi0gICAgICAgIDsvLyAkQml0Q291bnQgICAgICAgLyAKLSAgICAgICAgOy8vIAotICAgICAgICA7Ly8gT3V0cHV0IFJlZ2lzdGVyczoKLSAgICAgICAgOy8vCi0gICAgICAgIDsvLyAkU3ltYm9sICAgICAgICAgLSB0aGUgbmV4dCBOIGJpdHMgb2YgdGhlIGJpdHN0cmVhbQotICAgICAgICA7Ly8gJFQxICAgICAgICAgICAgIC0gY29ycnVwdGVkIHRlbXAvc2NyYXRjaCByZWdpc3RlcgotICAgICAgICA7Ly8gJHBCaXRTdHJlYW0gICAgIFwgCi0gICAgICAgIDsvLyAkQml0QnVmZmVyICAgICAgIH0gU2VlIGRlc2NyaXB0aW9uIGFib3ZlLgotICAgICAgICA7Ly8gJEJpdENvdW50ICAgICAgIC8gCi0gICAgICAgIDsvLwotICAgICAgICBNQUNSTwotICAgICAgICBNX0JEX1JFQUQ4ICRTeW1ib2wsICROLCAkVDEKLSAgICAgICAgQVNTRVJUICAoJE4+PTEpOkxBTkQ6KCROPD04KSAgICAgICAgICAgICAgICAKLSAgICAgICAgTU9WUyAgICAkU3ltYm9sLCAkQml0QnVmZmVyLCBMU0wgJEJpdENvdW50ICAgICAgICAKLSAgICAgICAgU1VCUyAgICAkQml0Q291bnQsICRCaXRDb3VudCwgIyg4LSROKQotICAgICAgICBMRFJDU0IgICRUMSwgWyRwQml0U3RyZWFtXSwgIzEgICAKLSAgICAgICAgQUREQ0MgICAkQml0Q291bnQsICRCaXRDb3VudCwgIzgKLSAgICAgICAgTU9WICAgICAkU3ltYm9sLCAkU3ltYm9sLCBMU1IgIygzMi0kTikKLSAgICAgICAgT1JSQ1MgICAkQml0QnVmZmVyLCAkVDEsICRCaXRCdWZmZXIsIExTTCAjOAotICAgICAgICBNRU5ECi0KLSAgICAgICAgOy8vCi0gICAgICAgIDsvLyBSZWFkIGZpeGVkIDE8PU48PTE2IGJpdHMgZnJvbSB0aGUgYml0c3RyZWFtLCBhZHZhbmNpbmcgdGhlIGJpdHN0cmVhbSBwb2ludGVyCi0gICAgICAgIDsvLwotICAgICAgICA7Ly8gSW5wdXQgUmVnaXN0ZXJzOgotICAgICAgICA7Ly8KLSAgICAgICAgOy8vICROICAgICAgICAgICAgICAtIG51bWJlciBvZiBiaXRzIHRvIHJlYWQKLSAgICAgICAgOy8vICRwQml0U3RyZWFtICAgICBcIAotICAgICAgICA7Ly8gJEJpdEJ1ZmZlciAgICAgICB9IFNlZSBkZXNjcmlwdGlvbiBhYm92ZS4KLSAgICAgICAgOy8vICRCaXRDb3VudCAgICAgICAvIAotICAgICAgICA7Ly8gCi0gICAgICAgIDsvLyBPdXRwdXQgUmVnaXN0ZXJzOgotICAgICAgICA7Ly8KLSAgICAgICAgOy8vICRTeW1ib2wgICAgICAgICAtIHRoZSBuZXh0IE4gYml0cyBvZiB0aGUgYml0c3RyZWFtCi0gICAgICAgIDsvLyAkVDEgICAgICAgICAgICAgLSBjb3JydXB0ZWQgdGVtcC9zY3JhdGNoIHJlZ2lzdGVyCi0gICAgICAgIDsvLyAkVDIgICAgICAgICAgICAgLSBjb3JydXB0ZWQgdGVtcC9zY3JhdGNoIHJlZ2lzdGVyCi0gICAgICAgIDsvLyAkcEJpdFN0cmVhbSAgICAgXCAKLSAgICAgICAgOy8vICRCaXRCdWZmZXIgICAgICAgfSBTZWUgZGVzY3JpcHRpb24gYWJvdmUuCi0gICAgICAgIDsvLyAkQml0Q291bnQgICAgICAgLyAKLSAgICAgICAgOy8vCi0gICAgICAgIE1BQ1JPCi0gICAgICAgIE1fQkRfUkVBRDE2ICRTeW1ib2wsICROLCAkVDEsICRUMgotICAgICAgICBBU1NFUlQgICgkTj49MSk6TEFORDooJE48PTE2KQotICAgICAgICBBU1NFUlQgICRTeW1ib2w8PiRUMQotICAgICAgICBJRiAoJE48PTgpCi0gICAgICAgICAgICBNX0JEX1JFQUQ4ICAkU3ltYm9sLCAkTiwgJFQxCi0gICAgICAgIEVMU0UgICAgICAgIAotICAgICAgICAgICAgOy8vIE4+OCBzbyB3ZSB3aWxsIGJlIGFibGUgdG8gcmVmaWxsIGF0IGxlYXN0IG9uZSBieXRlICAgICAgICAgICAgCi0gICAgICAgICAgICBMRFJCICAgICRUMSwgWyRwQml0U3RyZWFtXSwgIzEgICAgICAgICAgICAKLSAgICAgICAgICAgIE1PVlMgICAgJFN5bWJvbCwgJEJpdEJ1ZmZlciwgTFNMICRCaXRDb3VudAotICAgICAgICAgICAgT1JSICAgICAkQml0QnVmZmVyLCAkVDEsICRCaXRCdWZmZXIsIExTTCAjOCAgICAgICAgICAgICAgICAgICAgICAgCi0gICAgICAgICAgICBTVUJTICAgICRCaXRDb3VudCwgJEJpdENvdW50LCAjKDE2LSROKQotICAgICAgICAgICAgTERSQ1NCICAkVDEsIFskcEJpdFN0cmVhbV0sICMxICAgICAgICAgICAgCi0gICAgICAgICAgICBNT1YgICAgICRTeW1ib2wsICRTeW1ib2wsIExTUiAjKDMyLSROKQotICAgICAgICAgICAgQUREQ0MgICAkQml0Q291bnQsICRCaXRDb3VudCwgIzgKLSAgICAgICAgICAgIE9SUkNTICAgJEJpdEJ1ZmZlciwgJFQxLCAkQml0QnVmZmVyLCBMU0wgIzgKLSAgICAgICAgRU5ESUYKLSAgICAgICAgTUVORAotICAgICAgICAKLSAgICAgICAgOy8vCi0gICAgICAgIDsvLyBTa2lwIHZhcmlhYmxlIDE8PU48PTggYml0cyBmcm9tIHRoZSBiaXRzdHJlYW0sIGFkdmFuY2luZyB0aGUgYml0c3RyZWFtIHBvaW50ZXIuCi0gICAgICAgIDsvLwotICAgICAgICA7Ly8gSW5wdXQgUmVnaXN0ZXJzOgotICAgICAgICA7Ly8KLSAgICAgICAgOy8vICROICAgICAgICAgICAgICAtIG51bWJlciBvZiBiaXRzLiAxPD1OPD04Ci0gICAgICAgIDsvLyAkcEJpdFN0cmVhbSAgICAgXCAKLSAgICAgICAgOy8vICRCaXRCdWZmZXIgICAgICAgfSBTZWUgZGVzY3JpcHRpb24gYWJvdmUuCi0gICAgICAgIDsvLyAkQml0Q291bnQgICAgICAgLyAKLSAgICAgICAgOy8vIAotICAgICAgICA7Ly8gT3V0cHV0IFJlZ2lzdGVyczoKLSAgICAgICAgOy8vCi0gICAgICAgIDsvLyAkVDEgICAgICAgICAgICAgLSBjb3JydXB0ZWQgdGVtcC9zY3JhdGNoIHJlZ2lzdGVyCi0gICAgICAgIDsvLyAkVDIgICAgICAgICAgICAgLSBjb3JydXB0ZWQgdGVtcC9zY3JhdGNoIHJlZ2lzdGVyCi0gICAgICAgIDsvLyAkcEJpdFN0cmVhbSAgICAgXCAKLSAgICAgICAgOy8vICRCaXRCdWZmZXIgICAgICAgfSBTZWUgZGVzY3JpcHRpb24gYWJvdmUuCi0gICAgICAgIDsvLyAkQml0Q291bnQgICAgICAgLyAKLSAgICAgICAgOy8vCi0gICAgICAgIE1BQ1JPCi0gICAgICAgIE1fQkRfVlNLSVA4ICROLCAkVDEKLSAgICAgICAgQUREICAgICAkQml0Q291bnQsICRCaXRDb3VudCwgJE4KLSAgICAgICAgU1VCUyAgICAkQml0Q291bnQsICRCaXRDb3VudCwgIzgKLSAgICAgICAgTERSQ1NCICAkVDEsIFskcEJpdFN0cmVhbV0sICMxICAgICAgICAKLSAgICAgICAgQUREQ0MgICAkQml0Q291bnQsICRCaXRDb3VudCwgIzgKLSAgICAgICAgT1JSQ1MgICAkQml0QnVmZmVyLCAkVDEsICRCaXRCdWZmZXIsIExTTCAjOAotICAgICAgICBNRU5EICAgICAgICAKLSAgICAgICAgCi0gICAgICAgIDsvLwotICAgICAgICA7Ly8gU2tpcCB2YXJpYWJsZSAxPD1OPD0xNiBiaXRzIGZyb20gdGhlIGJpdHN0cmVhbSwgYWR2YW5jaW5nIHRoZSBiaXRzdHJlYW0gcG9pbnRlci4KLSAgICAgICAgOy8vCi0gICAgICAgIDsvLyBJbnB1dCBSZWdpc3RlcnM6Ci0gICAgICAgIDsvLwotICAgICAgICA7Ly8gJE4gICAgICAgICAgICAgIC0gbnVtYmVyIG9mIGJpdHMuIDE8PU48PTE2Ci0gICAgICAgIDsvLyAkcEJpdFN0cmVhbSAgICAgXCAKLSAgICAgICAgOy8vICRCaXRCdWZmZXIgICAgICAgfSBTZWUgZGVzY3JpcHRpb24gYWJvdmUuCi0gICAgICAgIDsvLyAkQml0Q291bnQgICAgICAgLyAKLSAgICAgICAgOy8vIAotICAgICAgICA7Ly8gT3V0cHV0IFJlZ2lzdGVyczoKLSAgICAgICAgOy8vCi0gICAgICAgIDsvLyAkVDEgICAgICAgICAgICAgLSBjb3JydXB0ZWQgdGVtcC9zY3JhdGNoIHJlZ2lzdGVyCi0gICAgICAgIDsvLyAkVDIgICAgICAgICAgICAgLSBjb3JydXB0ZWQgdGVtcC9zY3JhdGNoIHJlZ2lzdGVyCi0gICAgICAgIDsvLyAkcEJpdFN0cmVhbSAgICAgXCAKLSAgICAgICAgOy8vICRCaXRCdWZmZXIgICAgICAgfSBTZWUgZGVzY3JpcHRpb24gYWJvdmUuCi0gICAgICAgIDsvLyAkQml0Q291bnQgICAgICAgLyAKLSAgICAgICAgOy8vCi0gICAgICAgIE1BQ1JPCi0gICAgICAgIE1fQkRfVlNLSVAxNiAkTiwgJFQxLCAkVDIKLSAgICAgICAgQUREICAgICAkQml0Q291bnQsICRCaXRDb3VudCwgJE4KLSAgICAgICAgU1VCUyAgICAkQml0Q291bnQsICRCaXRDb3VudCwgIzgKLSAgICAgICAgTERSQ1NCICAkVDEsIFskcEJpdFN0cmVhbV0sICMxICAgICAgICAKLSAgICAgICAgT1JSQ1MgICAkQml0QnVmZmVyLCAkVDEsICRCaXRCdWZmZXIsIExTTCAjOAotICAgICAgICBTVUJDU1MgICRCaXRDb3VudCwgJEJpdENvdW50LCAjOCAgICAgICAgCi0gICAgICAgIExEUkNTQiAgJFQxLCBbJHBCaXRTdHJlYW1dLCAjMQotICAgICAgICBBRERDQyAgICRCaXRDb3VudCwgJEJpdENvdW50LCAjOAotICAgICAgICBPUlJDUyAgICRCaXRCdWZmZXIsICRUMSwgJEJpdEJ1ZmZlciwgTFNMICM4Ci0gICAgICAgIE1FTkQgICAgICAgIAotCi0gICAgICAgIDsvLwotICAgICAgICA7Ly8gUmVhZCB2YXJpYWJsZSAxPD1OPD04IGJpdHMgZnJvbSB0aGUgYml0c3RyZWFtLCBhZHZhbmNpbmcgdGhlIGJpdHN0cmVhbSBwb2ludGVyLgotICAgICAgICA7Ly8KLSAgICAgICAgOy8vIElucHV0IFJlZ2lzdGVyczoKLSAgICAgICAgOy8vCi0gICAgICAgIDsvLyAkTiAgICAgICAgICAgICAgLSBudW1iZXIgb2YgYml0cyB0byByZWFkLiAxPD1OPD04Ci0gICAgICAgIDsvLyAkcEJpdFN0cmVhbSAgICAgXCAKLSAgICAgICAgOy8vICRCaXRCdWZmZXIgICAgICAgfSBTZWUgZGVzY3JpcHRpb24gYWJvdmUuCi0gICAgICAgIDsvLyAkQml0Q291bnQgICAgICAgLyAKLSAgICAgICAgOy8vIAotICAgICAgICA7Ly8gT3V0cHV0IFJlZ2lzdGVyczoKLSAgICAgICAgOy8vCi0gICAgICAgIDsvLyAkU3ltYm9sICAgICAgICAgLSB0aGUgbmV4dCBOIGJpdHMgb2YgdGhlIGJpdHN0cmVhbQotICAgICAgICA7Ly8gJFQxICAgICAgICAgICAgIC0gY29ycnVwdGVkIHRlbXAvc2NyYXRjaCByZWdpc3RlcgotICAgICAgICA7Ly8gJFQyICAgICAgICAgICAgIC0gY29ycnVwdGVkIHRlbXAvc2NyYXRjaCByZWdpc3RlcgotICAgICAgICA7Ly8gJHBCaXRTdHJlYW0gICAgIFwgCi0gICAgICAgIDsvLyAkQml0QnVmZmVyICAgICAgIH0gU2VlIGRlc2NyaXB0aW9uIGFib3ZlLgotICAgICAgICA7Ly8gJEJpdENvdW50ICAgICAgIC8gCi0gICAgICAgIDsvLwotICAgICAgICBNQUNSTwotICAgICAgICBNX0JEX1ZSRUFEOCAkU3ltYm9sLCAkTiwgJFQxLCAkVDIKLSAgICAgICAgTU9WICAgICAkU3ltYm9sLCAkQml0QnVmZmVyLCBMU0wgJEJpdENvdW50ICAgICAgICAKLSAgICAgICAgQUREICAgICAkQml0Q291bnQsICRCaXRDb3VudCwgJE4KLSAgICAgICAgU1VCUyAgICAkQml0Q291bnQsICRCaXRDb3VudCwgIzgKLSAgICAgICAgTERSQ1NCICAkVDEsIFskcEJpdFN0cmVhbV0sICMxICAgICAgICAKLSAgICAgICAgUlNCICAgICAkVDIsICROLCAjMzIgICAgICAgIAotICAgICAgICBBRERDQyAgICRCaXRDb3VudCwgJEJpdENvdW50LCAjOAotICAgICAgICBNT1YgICAgICRTeW1ib2wsICRTeW1ib2wsIExTUiAkVDIKLSAgICAgICAgT1JSQ1MgICAkQml0QnVmZmVyLCAkVDEsICRCaXRCdWZmZXIsIExTTCAjOAotICAgICAgICBNRU5ECi0KLQotICAgICAgICA7Ly8KLSAgICAgICAgOy8vIFJlYWQgdmFyaWFibGUgMTw9Tjw9MTYgYml0cyBmcm9tIHRoZSBiaXRzdHJlYW0sIGFkdmFuY2luZyB0aGUgYml0c3RyZWFtIHBvaW50ZXIuCi0gICAgICAgIDsvLwotICAgICAgICA7Ly8gSW5wdXQgUmVnaXN0ZXJzOgotICAgICAgICA7Ly8KLSAgICAgICAgOy8vICROICAgICAgICAgICAgICAtIG51bWJlciBvZiBiaXRzIHRvIHJlYWQuIDE8PU48PTE2Ci0gICAgICAgIDsvLyAkcEJpdFN0cmVhbSAgICAgXCAKLSAgICAgICAgOy8vICRCaXRCdWZmZXIgICAgICAgfSBTZWUgZGVzY3JpcHRpb24gYWJvdmUuCi0gICAgICAgIDsvLyAkQml0Q291bnQgICAgICAgLyAKLSAgICAgICAgOy8vIAotICAgICAgICA7Ly8gT3V0cHV0IFJlZ2lzdGVyczoKLSAgICAgICAgOy8vCi0gICAgICAgIDsvLyAkU3ltYm9sICAgICAgICAgLSB0aGUgbmV4dCBOIGJpdHMgb2YgdGhlIGJpdHN0cmVhbQotICAgICAgICA7Ly8gJFQxICAgICAgICAgICAgIC0gY29ycnVwdGVkIHRlbXAvc2NyYXRjaCByZWdpc3RlcgotICAgICAgICA7Ly8gJFQyICAgICAgICAgICAgIC0gY29ycnVwdGVkIHRlbXAvc2NyYXRjaCByZWdpc3RlcgotICAgICAgICA7Ly8gJHBCaXRTdHJlYW0gICAgIFwgCi0gICAgICAgIDsvLyAkQml0QnVmZmVyICAgICAgIH0gU2VlIGRlc2NyaXB0aW9uIGFib3ZlLgotICAgICAgICA7Ly8gJEJpdENvdW50ICAgICAgIC8gCi0gICAgICAgIDsvLwotICAgICAgICBNQUNSTwotICAgICAgICBNX0JEX1ZSRUFEMTYgJFN5bWJvbCwgJE4sICRUMSwgJFQyCi0gICAgICAgIE1PViAgICAgJFN5bWJvbCwgJEJpdEJ1ZmZlciwgTFNMICRCaXRDb3VudCAgICAgICAgCi0gICAgICAgIEFERCAgICAgJEJpdENvdW50LCAkQml0Q291bnQsICROCi0gICAgICAgIFNVQlMgICAgJEJpdENvdW50LCAkQml0Q291bnQsICM4Ci0gICAgICAgIExEUkNTQiAgJFQxLCBbJHBCaXRTdHJlYW1dLCAjMSAgICAgICAgCi0gICAgICAgIFJTQiAgICAgJFQyLCAkTiwgIzMyICAgICAgICAKLSAgICAgICAgT1JSQ1MgICAkQml0QnVmZmVyLCAkVDEsICRCaXRCdWZmZXIsIExTTCAjOAotICAgICAgICBTVUJDU1MgICRCaXRDb3VudCwgJEJpdENvdW50LCAjOCAgICAgICAgCi0gICAgICAgIExEUkNTQiAgJFQxLCBbJHBCaXRTdHJlYW1dLCAjMQotICAgICAgICBBRERDQyAgICRCaXRDb3VudCwgJEJpdENvdW50LCAjOAotICAgICAgICBNT1YgICAgICRTeW1ib2wsICRTeW1ib2wsIExTUiAkVDIKLSAgICAgICAgT1JSQ1MgICAkQml0QnVmZmVyLCAkVDEsICRCaXRCdWZmZXIsIExTTCAjOAotICAgICAgICBNRU5ECi0KLQotICAgICAgICA7Ly8KLSAgICAgICAgOy8vIERlY29kZSBhIGNvZGUgb2YgdGhlIGZvcm0gMDAwMC4uLjAwMSB3aGVyZSB0aGVyZQotICAgICAgICA7Ly8gYXJlIE4gemVyb3MgYmVmb3JlIHRoZSAxIGFuZCBOPD0xNSAoY29kZSBsZW5ndGg8PTE2KQotICAgICAgICA7Ly8KLSAgICAgICAgOy8vIElucHV0IFJlZ2lzdGVyczoKLSAgICAgICAgOy8vCi0gICAgICAgIDsvLyAkcEJpdFN0cmVhbSAgICAgXCAKLSAgICAgICAgOy8vICRCaXRCdWZmZXIgICAgICAgfSBTZWUgZGVzY3JpcHRpb24gYWJvdmUuCi0gICAgICAgIDsvLyAkQml0Q291bnQgICAgICAgLyAKLSAgICAgICAgOy8vIAotICAgICAgICA7Ly8gT3V0cHV0IFJlZ2lzdGVyczoKLSAgICAgICAgOy8vCi0gICAgICAgIDsvLyAkU3ltYm9sICAgICAgICAgLSB0aGUgbnVtYmVyIG9mIHplcm9zIGJlZm9yZSB0aGUgbmV4dCAxCi0gICAgICAgIDsvLyAgICAgICAgICAgICAgICAgICA+PTE2IGlzIGFuIGlsbGVnYWwgY29kZQotICAgICAgICA7Ly8gJFQxICAgICAgICAgICAgIC0gY29ycnVwdGVkIHRlbXAvc2NyYXRjaCByZWdpc3RlcgotICAgICAgICA7Ly8gJFQyICAgICAgICAgICAgIC0gY29ycnVwdGVkIHRlbXAvc2NyYXRjaCByZWdpc3RlcgotICAgICAgICA7Ly8gJHBCaXRTdHJlYW0gICAgIFwgCi0gICAgICAgIDsvLyAkQml0QnVmZmVyICAgICAgIH0gU2VlIGRlc2NyaXB0aW9uIGFib3ZlLgotICAgICAgICA7Ly8gJEJpdENvdW50ICAgICAgIC8gCi0gICAgICAgIDsvLyAgICAgICAgCi0gICAgICAgIE1BQ1JPCi0gICAgICAgIE1fQkRfQ0xaMTYgJFN5bWJvbCwgJFQxLCAkVDIKLSAgICAgICAgTU9WUyAgICAkU3ltYm9sLCAkQml0QnVmZmVyLCBMU0wgJEJpdENvdW50Ci0gICAgICAgIENMWiAgICAgJFN5bWJvbCwgJFN5bWJvbCAgICAgICAgICAgICAgICAKLSAgICAgICAgQUREICAgICAkQml0Q291bnQsICRCaXRDb3VudCwgJFN5bWJvbAotICAgICAgICBTVUJTICAgICRCaXRDb3VudCwgJEJpdENvdW50LCAjNyAgICAgICAgOy8vIGxlbmd0aCBpcyBTeW1ib2wrMQotICAgICAgICBMRFJDU0IgICRUMSwgWyRwQml0U3RyZWFtXSwgIzEKLSAgICAgICAgT1JSQ1MgICAkQml0QnVmZmVyLCAkVDEsICRCaXRCdWZmZXIsIExTTCAjOAotIC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Oy8vICRwQml0U3RyZWFtICAgICBcIAotICAgICAgICA7Ly8gJEJpdEJ1ZmZlciAgICAgICB9IFNlZSBkZXNjcmlwdGlvbiBhYm92ZS4KLSAgICAgICAgOy8vICRCaXRDb3VudCAgICAgICAvIAotICAgICAgICA7Ly8gICAgICAgIAotICAgICAgICBNQUNSTwotICAgICAgICBNX0JEX0NMTzE2ICRTeW1ib2wsICRUMSwgJFQyCi0gICAgICAgIE1PViAgICAgJFN5bWJvbCwgJEJpdEJ1ZmZlciwgTFNMICRCaXRDb3VudAotICAgICAgICBNVk4gICAgICRTeW1ib2wsICRTeW1ib2wKLSAgICAgICAgQ0xaICAgICAkU3ltYm9sLCAkU3ltYm9sICAgICAgICAgICAgICAgIAotICAgICAgICBBREQgICAgICRCaXRDb3VudCwgJEJpdENvdW50LCAkU3ltYm9sCi0gICAgICAgIFNVQlMgICAgJEJpdENvdW50LCAkQml0Q291bnQsICM3ICAgICAgICA7Ly8gbGVuZ3RoIGlzIFN5bWJvbCsxCi0gICAgICAgIExEUkNTQiAgJFQxLCBbJHBCaXRTdHJlYW1dLCAjMQotICAgICAgICBPUlJDUyAgICRCaXRCdWZmZXIsICRUMSwgJEJpdEJ1ZmZlciwgTFNMICM4Ci0gICAgICAgIFNVQkNTUyAgJEJpdENvdW50LCAkQml0Q291bnQsICM4ICAgICAgICAKLSAgICAgICAgTERSQ1NCICAkVDEsIFskcEJpdFN0cmVhbV0sICMxCi0gICAgICAgIEFERENDICAgJEJpdENvdW50LCAkQml0Q291bnQsICM4Ci0gICAgICAgIE9SUkNTICAgJEJpdEJ1ZmZlciwgJFQxLCAkQml0QnVmZmVyLCBMU0wgIzgKLSAgICAgICAgTUVORCAgCi0KLQotICAgICAgICA7Ly8KLSAgICAgICAgOy8vIFZhcmlhYmxlIExlbmd0aCBEZWNvZGUgbW9kdWxlCi0gICAgICAgIDsvLwotICAgICAgICA7Ly8gRGVjb2RlcyBvbmUgVkxEIFN5bWJvbCBmcm9tIGEgYml0c3RyZWFtIGFuZCByZWZpbGwgdGhlIGJpdHN0cmVhbQotICAgICAgICA7Ly8gYnVmZmVyLgotICAgICAgICA7Ly8KLSAgICAgICAgOy8vIElucHV0IFJlZ2lzdGVyczoKLSAgICAgICAgOy8vCi0gICAgICAgIDsvLyAkcFZMRFRhYmxlICAgICAgLSBwb2ludGVyIHRvIFZMRCBkZWNvZGUgdGFibGUgb2YgMTYtYml0IGVudHJpZXMuCi0gICAgICAgIDsvLyAgICAgICAgICAgICAgICAgICBUaGUgZm9ybWF0IGlzIGRlc2NyaWJlZCBhYm92ZSBhdCB0aGUgc3RhcnQgb2YKLSAgICAgICAgOy8vICAgICAgICAgICAgICAgICAgIHRoaXMgZmlsZS4KLSAgICAgICAgOy8vICRTMCAgICAgICAgICAgICAtIFRoZSBudW1iZXIgb2YgYml0cyB0byBsb29rIHVwIGZvciB0aGUgZmlyc3Qgc3RlcAotICAgICAgICA7Ly8gICAgICAgICAgICAgICAgICAgMTw9JFMwPD04Ci0gICAgICAgIDsvLyAkUzEgICAgICAgICAgICAgLSBUaGUgbnVtYmVyIG9mIGJpdHMgdG8gbG9vayB1cCBmb3IgZWFjaCBzdWJzZXF1ZW50Ci0gICAgICAgIDsvLyAgICAgICAgICAgICAgICAgICBzdGVwIDE8PSRTMTw9JFMwLgotICAgICAgICA7Ly8KLSAgICAgICAgOy8vICRwQml0U3RyZWFtICAgICBcIAotICAgICAgICA7Ly8gJEJpdEJ1ZmZlciAgICAgICB9IFNlZSBkZXNjcmlwdGlvbiBhYm92ZS4KLSAgICAgICAgOy8vICRCaXRDb3VudCAgICAgICAvIAotICAgICAgICA7Ly8gCi0gICAgICAgIDsvLyBPdXRwdXQgUmVnaXN0ZXJzOgotICAgICAgICA7Ly8KLSAgICAgICAgOy8vICRTeW1ib2wgICAgICAgICAtIGRlY29kZWQgVkxEIHN5bWJvbCB2YWx1ZQotICAgICAgICA7Ly8gJFQxICAgICAgICAgICAgIC0gY29ycnVwdGVkIHRlbXAvc2NyYX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FN5bWJvbCwgWyRwVkxEVGFibGUsICRTeW1ib2xdICAgICAgIDsvLyBsb2FkIHRhYmxlIGVudHJ5Ci0gICAgICAgIEFERENDICAgJEJpdENvdW50LCAkQml0Q291bnQsICM4ICAgICAgICAgICAgIDsvLyByZWZpbGwgbm90IHBvc3NpYmxlCi0gICAgICAgIEFERCAgICAgJEJpdENvdW50LCAkQml0Q291bnQsICMkUzAgICAgICAgICAgIDsvLyBhc3N1bWUgJFMwIGJpdHMgdXNlZAotICAgICAgICBPUlJDUyAgICRCaXRCdWZmZXIsICRUMSwgJEJpdEJ1ZmZlciwgTFNMICM4ICA7Ly8gbWVyZ2UgaW4gcmVmaWxsIGJ5dGUKLSAgICAgICAgTU9WUyAgICAkVDEsICRTeW1ib2wsIExTUiAjMSAgICAgICAgICAgICAgICAgOy8vIENTPWxlYWYgZW50cnkKLSAgICAgICAgQkNTICAgICAlRlQwMgotICAgICAgICAKLSAgICAgICAgTU9WUyAgICAkVDEsICRCaXRCdWZmZXIsIExTTCAkQml0Q291bnQgICAgICAgOy8vIGxlZnQgYWxpZ24gbmV4dCBiaXQKLSAgICAgICAgSUYgKDIqJFMwLSRTMTw9OCkKLSAgICAgICAgICAgIDsvLyBDYW4gY29tYmluZSByZWZpbGwgY2hlY2sgYW5kIC1TMCtTMSBhbmQga2VlcCAkQml0Q291bnQ8PTE1Ci0gICAgICAgICAgICBTVUJTICAgICRCaXRDb3VudCwgJEJpdENvdW50LCAjOCsoJFMwLSRTMSkKLSAgICAgICAgRUxTRQotICAgICAgICAgICAgOy8vIFNlcGFyYXRlIHJlZmlsbCBjaGVjayBhbmQgLVMwK1MxIG9mZnNldAotICAgICAgICAgICAgU1VCUyAgJEJpdENvdW50LCAkQml0Q291bnQsICM4Ci0gICAgICAgICAgICBTVUIgICAkQml0Q291bnQsICRCaXRDb3VudCwgIygkUzAtJFMxKQotICAgICAgICBFTkRJRgotICAgICAgICBBREQgICAgICRTeW1ib2wsICRTeW1ib2wsICRUMSwgTF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MgZGVzY3JpYmVkIGluIE1fQkRfQUREKQotICAgICAgICA7Ly8gJEJpdEluZGV4ICAgICAgIC0gRGVzdGluYXRpb24gQml0Q291bnQKLSAgICAgICAgOy8vICRwQml0U3RyZWFtICAgICBcIAotICAgICAgICA7Ly8gJEJpdEJ1ZmZlciAgICAgICB9IFNlZSBkZXNjcmlwdGlvbiBhYm92ZS4KLSAgICAgICAgOy8vICRCaXRDb3VudCAgICAgICAvIAotICAgICAgICA7Ly8KLSAgICAgICAgOy8vIE91dHB1dCBSZWdpc3RlcnM6Ci0gICAgICAgIDsvLwotICAgICAgICA7Ly8gRkxBR1MgICAgICAgICAgIC0gR0UgaWYgZGVzdGluYXRpb24gaXMgcmVhY2hlZCwgTFQgPSBpcyBkZXN0aW5hdGlvbiBpcyBhaGVhZAotICAgICAgICA7Ly8gJFQxICAgICAgICAgICAgIC0gY29ycnVwdGVkIHRlbXAvc2NyYXRjaCByZWdpc3RlcgotICAgICAgICA7Ly8KLSAgICAgICAgTUFDUk8KLSAgICAgICAgTV9CRF9DTVAgICRCeXRlSW5kZXgsICRCaXRJbmRleCwgJFQxCi0gICAgICAgIAotICAgICAgICA7Ly8gUmV0dXJuIGZsYWdzIHNldCBieSAoY3VycmVudCBwb3NpdG9uKS0oJEJ5dGVJbmRleCwkQml0SW5kZXgpCi0gICAgICAgIDsvLyBzbyBHRSBtZWFucyB0aGF0IHdlIGhhdmUgcmVhY2hlZCB0aGUgaW5kaWNhdGVkIHBvc2l0aW9uCi0KLSAgICAgICAgQUREICAgICAgICAgJFQxLCAkcEJpdFN0cmVhbSwgJEJpdENvdW50LCBMU1IgIzMKLSAgICAgICAgQ01QICAgICAgICAgJFQxLCAkQnl0ZUluZGV4Ci0gICAgICAgIEFORCAgICAgICAgICRUMSwgJEJpdENvdW50LCAjNwotICAgICAgICBDTVBFUSAgICAgICAkVDEsICRCaXRJbmRleCAgICAgICAgCi0gICAgICAgIE1FTkQKLQotICAgICAgICAKLSAgICAgICAgOy8vIE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gICBjb25zdCBPTVhfVTggKipwcEJpdFN0cmVhbSwKLSAgICBPTVhfSU5UICpwT2Zmc2V0LAotICAgIGNvbnN0IEFSTV9WTEMzMiAqcENvZGVCb29rCi0pOwotCi0vKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCi0gKiBGaXhlZCBiaXQgbGVuZ3RoIEVuY29kZQotICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLQotLyoqCi0gKiBGdW5jdGlvbjogYXJtUGFja0JpdHMKLSAqCi0gKiBEZXNjcmlwdGlvbjoKLSAqIFBhY2sgYSBWTEMgY29kZSB3b3JkIGludG8gdGhlIGJpdHN0cmVhbQotICoKLSAqIFJlbWFya3M6Ci0gKgotICogUGFyYW1ldGVyczoKLSAqIFtpbl0JcHBCaXRTdHJlYW0JCXBvaW50ZXIgdG8gdGhlIHBvaW50ZXIgdG8gdGhlIGN1cnJlbnQgYnl0ZSAKLSAqICAgICAgICAgICAgICAgICAgICAgIGluIHRoZSBiaXQgc3RyZWFtLgotICogW2luXQlwT2Zmc2V0CSAgICAgICAgcG9pbnRlciB0byB0aGUgYml0IHBvc2l0aW9uIGluIHRoZSBieXRlIAotICogICAgICAgICAgICAgICAgICAgICAgcG9pbnRlZCBieSAqcHBCaXRTdHJlYW0uIFZhbGlkIHdpdGhpbiAwCi0gKiAgICAgICAgICAgICAgICAgICAgICB0byA3LgotICogW2luXQljb2RlV29yZAkJQ29kZSB3b3JkIHRoYXQgbmVlZCB0byBiZSBpbnNlcnRlZCBpbiB0byB0aGUKLSAqICAgICAgICAgICAgICAgICAgICAgICAgICBiaXRzdHJlYW0KLSAqIFtpbl0JY29kZUxlbmd0aAkJTGVuZ3RoIG9mIHRoZSBjb2RlIHdvcmQgdmFsaWQgcmFuZ2UgMS4uLjMyCi0gKgotICogW291dF0gcHBCaXRTdHJlYW0JKnBwQml0U3RyZWFtIGlzIHVwZGF0ZWQgYWZ0ZXIgdGhlIGJsb2NrIGl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HdpdGggdGhlCi07Ly8gZm9yd2FyZCBEQ1QuIERpcmVjdCBpbnZlcnNpb24gb2YgdGhlIGZvcndhcmQgZm9ybXVsYWUKLTsvLyBpbiBmaWxlIEZEQ1Rfcy5zIGdpdmVzOgotOy8vCi07Ly8gSVN0YWdlIDU6ICAgaih1KSA9IFQodSkqQSh1KSAgWyBBKHUpPTQqQyh1KSpjKHUsMCkgXQotOy8vICAgICAgICAgICAgIFsgQSgwKSA9IDIqc3FydCgyKQotOy8vICAgICAgICAgICAgICAgQSh1KSA9IDQqY29zKHUqcGkvMTYpICBmb3IgKHUhPTApIF0KLTsvLwotOy8vIElTdGFnZSA0OiAgIGkwID0gajAgICAgICAgICAgICAgaTEgPSBqNAotOy8vICAgICAgICAgICAgIGkzID0gKGoyK2o2KS8yICAgICAgaTIgPSAoajItajYpLzIKLTsvLyAgICAgICAgICAgICBpNyA9IChqNStqMykvMiAgICAgIGk0ID0gKGo1LWozKS8yCi07Ly8gICAgICAgICAgICAgaTUgPSAoajErajcpLzIgICAgICBpNiA9IChqMS1qNykvMgotOy8vCi07Ly8gSVN0YWdlIDM6ICAgaDAgPSAoaTAraTEpLzIgICAgICBoMSA9IChpMC1pMSkvMgotOy8vICAgICAgICAgICAgIGgyID0gKGkyKnNxcnQyKS1pMyAgaDMgPSBpMwotOy8vICAgICAgICAgICAgIGg0ID0gIGNvcyhwaS84KSppNCArIHNpbihwaS84KSppNgotOy8vICAgICAgICAgICAgIGg2ID0gLXNpbihwaS84KSppNCArIGNvcyhwaS84KSppNgotOy8vICAgICAgICAgICAgIFsgVGhlIGFib3ZlIHR3byBsaW5lcyByb3RhdGUgYnkgLShwaS84KSBdCi07Ly8gICAgICAgICAgICAgaDUgPSAoaTUtaTcpL3NxcnQyICBoNyA9IChpNStpNykvMiAKLTsvLyAgICAgICAgICAgICAKLTsvLyBJU3RhZ2UgMjogICBnMCA9IChoMCtoMykvMiAgICAgIGczID0gKGgwLWgzKS8yCi07Ly8gICAgICAgICAgICA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IE1fU1RSICAgU3RyaWRlLCBwU3RyaWRlCi0gICAgICAgIEVORElGCi0gICAgICAgIE1fQURSICAgcERlc3QsICBwQmxrCi0gICAgICAgIExEUiAgICAgY3NQaUJ5OCwgPTB4MzBmYzc2NDIKLSAgICAgICAgTERSICAgICBMb29wUlIyLCA9MHgwMDAwNWE4MgotICAKLXY2X2lkY3RfY29sJF9GCi0gICAgICAgIDsvLyBMb2FkIGV2ZW4gdmFsdWVzCi0gICAgICAgIExEUiAgICAgeGk0LCBbcFNyY10sICM0ICA7Ly8gajAKLSAgICAgICAgTERSICAgICB4aTUsIFtwU3JjLCAjNCoxNi00XSAgOy8vIGo0Ci0gICAgICAgIExEUiAgICAgeGk2LCBbcFNyYywgIzIqMTYtNF0gIDsvLyBqMgotICAgICAgICBMRFIgICAgIHhpNywgW3BTcmMsICM2KjE2LTRdICA7Ly8gajYKLSAgICAgICAgCi0gICAgICAgIDsvLyBTY2FsZSBFdmVuIFZhbHVlcwotICAgICAgICBJRiAiJGluc2NhbGUiPSJzMTYiIDsvLyAxNngxNiBtdWwKLVNISUZUICAgICAgIFNFVEEgICAgMTIKLSAgICAgICAgICAgIExEUiAgICAgeGkwLCBbcFNjYWxlXSwgIzQKLSAgICAgICAgICAgIExEUiAgICAgeGkxLCBbcFNjYWxlLCAjNCoxNi00XSAgICAgICAgCi0gICAgICAgICAgICBMRFIgICAgIHhpMiwgW3BTY2FsZSwgIzIqMTYtNF0KLSAgICAgICAgICAgIE1PViAgICAgeGl0LCAjMTw8KFNISUZULTEpCi0gICAgICAgICAgICBTTUxBQkIgIHhpMywgeGkwLCB4aTQsIHhpdAotICAgICAgICAgICAgU01MQVRUICB4aTQsIHhpMCwgeGk0LCB4aXQKLSAgICAgICAgICAgIFNNTEFCQiAgeGkwLCB4aTEsIHhpNSwgeGl0Ci0gICAgICAgICAgICBTTUxBVFQgIHhpNSwgeGkxLCB4aTUsIHhpdAotICAgICAgICAgICAgTU9WICAgICB4aTMsIHhpMywgQVNSICNTSElGVAotICAgICAgICAgICAgUEtIQlQgICB4aTQsIHhpMywgeGk0LCBMU0wgIygxNi1TSElGVCkKLSAgICAgICAgICAgIExEUiAgICAgeGkzLCBbcFNjYWxlLCAjNioxNi00XQotICAgICAgICAgICAgU01MQUJCICB4aTEsIHhpMiwgeGk2LCB4aXQKLSAgICAgICAgICAgIFNNTEFUVCAgeGk2LCB4aTIsIHhpNiwgeGl0Ci0gICAgICAgICAgICBNT1YgICAgIHhpMCwgeGkwLCBBU1IgI1NISUZUCi0gICAgICAgICAgICBQS0hCVCAgIHhpNSwgeGkwLCB4aTUsIExTTCAjKDE2LVNISUZUKQotICAgICAgICAgICAgU01MQUJCICB4aTIsIHhpMywgeGk3LCB4aXQKLSAgICAgICAgICAgIFNNTEFUVCAgeGk3LCB4aTMsIHhpNywgeGl0Ci0gICAgICAgICAgICBNT1YgICAgIHhpMSwgeGkxLCBBU1IgI1NISUZUCi0gICAgICAgICAgICBQS0hCVCAgIHhpNiwgeGkxLCB4aTYsIExTTCAjKDE2LVNISUZUKQotICAgICAgICAgICAgTU9WICAgICB4aTIsIHhpMiwgQVNSICNTSElGVAotICAgICAgICAgICAgUEtIQlQgICB4aTcsIHhpMiwgeGk3LCBMU0wgIygxNi1TSElGVCkKLSAgICAgICAgRU5ESUYKLSAgICAgICAgSUYgIiRpbnNjYWxlIj0iczMyIiA7Ly8gMzJ4MTYgbXVsCi1TSElGVCAgICAgICBTRVRBICAgICgxMis4LTE2KQotICAgICAgICAgICAgTU9WICAgICB4aXQsICMxPDwoU0hJRlQtMSkKLSAgICAgICAgICAgIExEUiAgICAgeGkwLCBbcFNjYWxlXSwgIzgKLSAgICAgICAgICAgIExEUiAgICAgeGkxLCBbcFNjYWxlLCAjMCozMis0LThdCi0gICAgICAgICAgICBMRFIgICAgIHhpMiwgW3BTY2FsZSwgIzQqMzItOF0KLSAgICAgICAgICAgIExEUiAgICAgeGkzLCBbcFNjYWxlLCAjNCozMis0LThdICAgICAgICAgICAgCi0gICAgICAgICAgICBTTUxBV0IgIHhpMCwgeGkwLCB4aTQsIHhpdAotICAgICAgICAgICAgU01MQVdUICB4aTEsIHhpMSwgeGk0LCB4aXQKLSAgICAgICAgICAgIFNNTEFXQiAgeGkyLCB4aTIsIHhpNSwgeGl0Ci0gICAgICAgICAgICBTTUxBV1QgIHhpMywgeGkzLCB4aTUsIHhpdCAgICAgICAgICAgIAotICAgICAgICAgICAgTU9WICAgICB4aTAsIHhpMCwgQVNSICNTSElGVAotICAgICAgICAgICAgUEtIQlQgICB4aTQsIHhpMCwgeGkxLCBMU0wgIygxNi1TSElGVCkKLSAgICAgICAgICAgIE1PViAgICAgeGkyLCB4aTIsIEFTUiAjU0hJRlQgICAgICAgICAgICAKLSAgICAgICAgICAgIFBLSEJUICAgeGk1LCB4aTIsIHhpMywgTFNMICMoMTYtU0hJRlQpCi0gICAgICAgICAgICBMRFIgICAgIHhpMCwgW3BTY2FsZSwgIzIqMzItOF0KLSAgICAgICAgICAgIExEUiAgICAgeGkxLCBbcFNjYWxlLCAjMiozMis0LThdCi0gICAgICAgICAgICBMRFIgICAgIHhpMiwgW3BTY2FsZSwgIzYqMzItOF0KLSAgICAgICAgICAgIExEUiAgICAgeGkzLCBbcFNjYWxlLCAjNiozMis0LThdICAgICAgICAgICAgCi0gICAgICAgICAgICBTTUxBV0IgIHhpMCwgeGkwLCB4aTYsIHhpdAotICAgICAgICAgICAgU01MQVdUICB4aTEsIHhpMSwgeGk2LCB4aXQKLSAgICAgICAgICAgIFNNTEFXQiAgeGkyLCB4aTIsIHhpNywgeGl0Ci0gICAgICAgICAgICBTTUxBV1QgIHhpMywgeGkzLCB4aTcsIHhpdCAgICAgICAgICAgIAotICAgICAgICAgICAgTU9WICAgICB4aTAsIHhpMCwgQVNSICNTSElGVAotICAgICAgICAgICAgUEtIQlQgICB4aTYsIHhpMCwgeGkxLCBMU0wgIygxNi1TSElGVCkKLSAgICAgICAgICAgIE1PViAgICAgeGkyLCB4aTIsIEFTUiAjU0hJRlQgICAgICAgICAgICAKLSAgICAgICAgICAgIFBLSEJUICAgeGk3LCB4aTIsIHhpMywgTFNMICMoMTYtU0hJRlQpCi0gICAgICAgIEVORElGCi0gICAgICAgICAgICAgICAgCi0gICAgICAgIDsvLyBMb2FkIG9kZCB2YWx1ZXMKLSAgICAgICAgTERSICAgICB4aTAsIFtwU3JjLCAjMSoxNi00XSAgICAgIDsvLyBqMQotICAgICAgICBMRFIgICAgIHhpMSwgW3BTcmMsICM3KjE2LTRdICAgICAgOy8vIGo3Ci0gICAgICAgIExEUiAgICAgeGkyLCBbcFNyYywgIzUqMTYtNF0gICAgICA7Ly8gajUKLSAgICAgICAgTERSICAgICB4aTMsIFtwU3JjLCAjMyoxNi00XSAgICAgIDsvLyBqMwotICAgICAgICAKLSAgICAgICAgSUYgIHtUUlVFfQotICAgICAgICAgICAgOy8vIHNob3J0Y3V0IGlmIG9kZCB2YWx1ZXMgMAotICAgICAgICAgICAgVEVRICAgICB4aTAsICMwCi0gICAgICAgICAgICBURVFFUSAgIHhpMSwgIzAKLSAgICAgICAgICAgIFRFUUVRICAgeGkyLCAjMAotICAgICAgICAgICAgVEVRRVEgICB4aTMsICMwCi0gICAgICAgICAgICBCRVEgICAgIHY2T2RkWmVybyRfRgotICAgICAgICBFTkRJRgotICAgICAgICAKLSAgICAgICAgOy8vIFN0b3JlIHNjYWxlZCBldmVuIHZhbHVlcwotICAgICAgICBTVE1JQSAgIHBEZXN0LCB7eGk0LCB4aTUsIHhpNiwgeGk3fQotICAgICAgICAKLSAgICAgICAgOy8vIFNjYWxlIG9kZCB2YWx1ZXMKLSAgICAgICAgSUYgIiRpbnNjYWxlIj0iczE2IgotICAgICAgICAgICAgOy8vIFBlcmZvcm0gQUFOIFNjYWxlCi0gICAgICAgICAgICBMRFIgICAgIHhpNCwgW3BTY2FsZSwgIzEqMTYtNF0KLSAgICAgICAgICAgIExEUiAgICAgeGk1LCBbcFNjYWxlLCAjNyoxNi00XSAgICAgICAgCi0gICAgICAgICAgICBMRFIgICAgIHhpNiwgW3BTY2FsZSwgIzUqMTYtNF0KLSAgICAgICAgICAgIFNNTEFCQiAgeGk3LCB4aTAsIHhpNCwgeGl0Ci0gICAgICAgICAgICBTTUxBVFQgIHhpMCwgeGkwLCB4aTQsIHhpdAotICAgICAgICAgICAgU01MQUJCICB4aTQsIHhpMSwgeGk1LCB4aXQKLSAgICAgICAgICAgIFNNTEFUVCAgeGkxLCB4aTEsIHhpNSwgeGl0Ci0gICAgICAgICAgICBNT1YgICAgIHhpNywgeGk3LCBBU1IgI1NISUZUCi0gICAgICAgICAgICBQS0hCVCAgIHhpMCwgeGk3LCB4aTAsIExTTCAjKDE2LVNISUZUKQotICAgICAgICAgICAgTERSICAgICB4aTcsIFtwU2NhbGUsICMzKjE2LTRdCi0gICAgICAgICAgICBTTUxBQkIgIHhpNSwgeGkyLCB4aTYsIHhpdAotICAgICAgICAgICAgU01MQVRUICB4aTIsIHhpMiwgeGk2LCB4aXQKLSAgICAgICAgICAgIE1PViAgICAgeGk0LCB4aTQsIEFTUiAjU0hJRlQKLSAgICAgICAgICAgIFBLSEJUICAgeGkxLCB4aTQsIHhpMSwgTFNMICMoMTYtU0hJRlQpCi0gICAgICAgICAgICBTTUxBQkIgIHhpNiwgeGkzLCB4aTcsIHhpdAotICAgICAgICAgICAgU01MQVRUICB4aTMsIHhpMywgeGk3LCB4aXQKLSAgICAgICAgICAgIE1PViAgICAgeGk1LCB4aTUsIEFTUiAjU0hJRlQKLSAgICAgICAgICAgIFBLSEJUICAgeGkyLCB4aTUsIHhpMiwgTFNMICMoMTYtU0hJRlQpCi0gICAgICAgICAgICBNT1YgICAgIHhpNiwgeGk2LCBBU1IgI1NISUZUCi0gICAgICAgICAgICBQS0hCVCAgIHhpMywgeGk2LCB4aTMsIExTTCAjKDE2LVNISUZUKQotICAgICAgICBFTkRJRgotICAgICAgICBJRiAiJGluc2NhbGUiPSJzMzIiIDsvLyAzMngxNiBtdWwKLSAgICAgICAgICAgIExEUiAgICAgeGk0LCBbcFNjYWxlLCAjMSozMi04XQotICAgICAgICAgICAgTERSICAgICB4aTUsIFtwU2NhbGUsICMxKjMyKzQtOF0KLSAgICAgICAgICAgIExEUiAgICAgeGk2LCBbcFNjYWxlLCAjNyozMi04XQotICAgICAgICAgICAgTERSICAgICB4aTcsIFtwU2NhbGUsICM3KjMyKzQtOF0gICAgICAgICAgICAKLSAgICAgICAgICAgIFNNTEFXQiAgeGk0LCB4aTQsIHhpMCwgeGl0Ci0gICAgICAgICAgICBTTUxBV1QgIHhpNSwgeGk1LCB4aTAsIHhpdAotICAgICAgICAgICAgU01MQVdCICB4aTYsIHhpNiwgeGkxLCB4aXQKLSAgICAgICAgICAgIFNNTEFXVCAgeGk3LCB4aTcsIHhpMSwgeGl0ICAgICAgICAgICAgCi0gICAgICAgICAgICBNT1YgICAgIHhpNCwgeGk0LCBBU1IgI1NISUZUCi0gICAgICAgICAgICBQS0hCVCAgIHhpMCwgeGk0LCB4aTUsIExTTCAjKDE2LVNISUZUKQotICAgICAgICAgICAgTU9WICAgICB4aTYsIHhpNiwgQVNSICNTSElGVCAgICAgICAgICAgIAotICAgICAgICAgICAgUEtIQlQgICB4aTEsIHhpNiwgeGk3LCBMU0wgIygxNi1TSElGVCkKLSAgICAgICAgICAgIExEUiAgICAgeGk0LCBbcFNjYWxlLCAjNSozMi04XQotICAgICAgICAgICAgTERSICAgICB4aTUsIFtwU2NhbGUsICM1KjMyKzQtOF0KLSAgICAgICAgICAgIExEUiAgICAgeGk2LCBbcFNjYWxlLCAjMyozMi04XQotICAgICAgICAgICAgTERSICAgICB4aTcsIFtwU2NhbGUsICMzKjMyKzQtOF0gICAgICAgICAgICAKLSAgICAgICAgICAgIFNNTEFXQiAgeGk0LCB4aTQsIHhpMiwgeGl0Ci0gICAgICAgICAgICBTTUxBV1QgIHhpNSwgeGk1LCB4aTIsIHhpdAotICAgICAgICAgICAgU01MQVdCICB4aTYsIHhpNiwgeGkzLCB4aXQKLSAgICAgICAgICAgIFNNTEFXVCAgeGk3LCB4aTcsIHhpMywgeGl0ICAgICAgICAgICAgCi0gICAgICAgICAgICBNT1YgICAgIHhpNCwgeGk0LCBBU1IgI1NISUZUCi0gICAgICAgICAgICBQS0hCVCAgIHhpMiwgeGk0LCB4aTUsIExTTCAjKDE2LVNISUZUKQotICAgICAgICAgICAgTU9WICAgICB4aTYsIHhpNiwgQVNSICNTSElGVCAgICAgICAgICAgIAotICAgICAgICAgICAgUEtIQlQgICB4aTMsIHhpNiwgeGk3LCBMU0wgIygxNi1TSElGVCkKLSAgICAgICAgRU5ESUYKLSAgICAgICAgCi0gICAgICAgIFNIQUREMTYgeGk1LCB4aTAsIHhpMSAgICAgICAgICAgOy8vIChqMStqNykvMgotICAgICAgICBTU1VCMTYgIHhpNiwgeGkwLCB4aTEgICAgICAgICAgIDsvLyBqMS1qNwotICAgICAgICBTSEFERDE2IHhpNywgeGkyLCB4aTMgICAgICAgICAgIDsvLyAoajUrajMpLzIKLSAgICAgICAgU1NVQjE2ICB4aTQsIHhpMiwgeGkzICAgICAgICAgICA7Ly8gajUtajMKLSAgICAgICAgCi0gICAgICAgIFNTVUIxNiAgeGkzLCB4aTUsIHhpNyAgICAgICAgICAgOy8vIChpNS1pNykvMgotICAgICAgICAKLSAgICAgICAgUEtIQlQgICB4aTAsIHhpNiwgeGk0LCBMU0wjMTYgICA7Ly8gW2k0LGk2XSByb3cgYQotICAgICAgICBQS0hUQiAgIHhpMSwgeGk0LCB4aTYsIEFTUiMxNiAgIDsvLyBbaTQsaTZdIHJvdyBiCi0gICAgICAgIAotICAgICAgICBTTVVBRFggIHhpMiwgeGkwLCBjc1BpQnk4ICAgICAgIDsvLyByb3dhIGJ5IFtjLHNdCi0gICAgICAgIFNNVUFEWCAgeGk0LCB4aTEsIGNzUGlCeTggICAgICAgOy8vIHJvd2IgYnkgW2Msc10KLSAgICAgICAgU01VU0QgICB4aTAsIHhpMCwgY3NQaUJ5OCAgICAgICA7Ly8gcm93YSBieSBbLXMsY10gICAKLSAgICAgICAgU01VU0QgICB4aTYsIHhpMSwgY3NQaUJ5OCAgICAgICA7Ly8gcm93YiBieSBbLXMsY10KLSAgICAgICAgICAgICAgICAKLSAgICAgICAgU01VTEJCICB4aTEsIHhpMywgTG9vcFJSMgotICAgICAgICBTTVVMVEIgIHhpMywgeGkzLCBMb29wUlIyCi0gICAgICAgICAgICAgICAgCi0gICAgICAgIFBLSFRCICAgeGg0LCB4aTQsIHhpMiwgQVNSIzE2ICAgOy8vIGg0LzQKLSAgICAgICAgUEtIVEIgICB4aDYsIHhpNiwgeGkwLCBBU1IjMTYgICA7Ly8gaDYvNAotICAgICAgICBTSEFERDE2IHhoNywgeGk1LCB4aTcgICAgICAgICAgIDsvLyAoaTUraTcpLzQKLSAgICAgICAgICAgICAgICAKLSAgICAgICAgOy8vIHhpMCx4aTEseGkyLHhpMyBub3cgZnJlZQotICAgICAgICA7Ly8gSVN0YWdlIDQsMywgcm93cyAydG8zIHgxLzIKLSAgICAgICAgCi0gICAgICAgIE1PViAgICAgeGkzLCB4aTMsIExTTCAjMQotICAgICAgICBQS0hUQiAgIHhoNSwgeGkzLCB4aTEsIEFTUiMxNSAgIDsvLyBoNS80Ci0gICAgICAgIExEUkQgICAgeGkwLCBbcERlc3QsICM4XSAgICAgICAgOy8vIGoyLGo2IHNjYWxlZAotICAgICAgICAgICAgICAgIAotICAgICAgICA7Ly8gSVN0YWdlIDIsIHJvd3M0dG83Ci0gICAgICAgIFNTVUIxNiAgeGc2LCB4aDYsIHhoNwotICAgICAgICBTU1VCMTYgIHhnNSwgeGg1LCB4ZzYgICAgICAgIAotICAgICAgICBTU1VCMTYgIHhnNCwgeGg0LCB4ZzUKLSAgICAgICAgICAgICAgICAKLSAgICAgICAgU1NVQjE2ICB4aTIsIHhpMCwgeGkxICAgICAgICAgICA7Ly8gKGoyLWo2KQotICAgICAgICBTSEFERDE2IHhpMywgeGkwLCB4aTEgICAgICAgICAgIDsvLyAoajIrajYpLzIK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N0cmlkZSAKLSAgICAgICAgRU5ESUYKLSAgICAgICAgQiAgICAgICB2Nl9pZGN0X3JvdyRfRgotICAgICAgICAKLXY2T2RkWmVybyRfRgotICAgICAgICBTU1VCMTYgIHhpMiwgeGk2LCB4aTcgICAgICAgICAgIDsvLyAoajItajYpCi0gICAgICAgIFNIQUREMTYgeGkzLCB4aTYsIHhpNyAgICAgICAgICAgOy8vIChqMitqNikvMgotICAgICAgICAKLSAgICAgICAgU01VTEJCICB4aTAsIHhpMiwgTG9vcFJSMgotICAgICAgICBTTVVMVEIgIHhpMiwgeGkyLCBMb29wUlIyCi0gICAgICAgIAotICAgICAgICBNT1YgICAgIHhpMiwgeGkyLCBMU0wgIzEKLSAgICAgICAgUEtIVEIgICB4aDIsIHhpMiwgeGkwLCBBU1IjMTUgICA7Ly8gaTIqc3FydCgyKS80Ci0gICAgICAgIFNTVUIxNiAgeGgyLCB4aDIsIHhpMwotICAgICAgICAKLSAgICAgICAgOy8vIHhpMCwgeGkxIG5vdyBmcmVlCi0gICAgICAgIDsvLyBJU3RhZ2UgNCwzIHJvd3MgMHRvMSB4IDEvMgotICAgICAgICAKLSAgICAgICAgU0hBREQxNiB4aDAsIHhpNCwgeGk1Ci0gICAgICAgIFNIU1VCMTYgeGgxLCB4aTQsIHhpNSAgICAgICAgICAgICAgICAKLSAgICAgICAgCi0gICAgICAgIDsvLyBJU3RhZ2UgMiByb3dzIDB0bzMgeCAxLzIKLSAgICAgICAgU0hTVUIxNiB4ZzIsIHhoMSwgeGgyCi0gICAgICAgIFNIQUREMTYgeGcxLCB4aDEsIHhoMgotICAgICAgICBTSFNVQjE2IHhnMywgeGgwLCB4aDMKLSAgICAgICAgU0hBREQxNiB4ZzAsIHhoMCwgeGgzCi0gICAgICAgICAgICAgICAKLSAgICAgICAgOy8vIElTdGFnZSAxIGFsbCByb3dzCi0gICAgICAgIE1PViAgeGYzLCB4ZzMKLSAgICAgICAgTU9WICB4ZjQsIHhnMwotICAgICAgICBNT1YgI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yIKLSAgICAgICAgICAgIE1fTERSICAgcFNjYWxlLCBwU3RyaWRlIAotICAgICAgICBFTkRJRgotICAgICAgICAgICAgICAgCi0gICAgICAgIAotdjZfaWRjdF9yb3ckX0YKLSAgICAgICAgOy8vIElTdGFnZSA0LDMsIHJvd3M0dG83IHgxLzQKLSAgICAgICAgTERSICAgICB4aXQsID0weDAwMDEwMDAxICAgICAgICA7Ly8gcm91bmRpbmcgY29uc3RhbnQKLSAgICAgICAgTERSICAgICB4aTAsIFtwU3JjLCAjMSoxNl0gICAgICA7Ly8gajEKLSAgICAgICAgTERSICAgICB4aTEsIFtwU3JjLCAjNyoxNl0gICAgICA7Ly8gNCpqNwotICAgICAgICBMRFIgICAgIHhpMiwgW3BTcmMsICM1KjE2XSAgICAgIDsvLyBqNQotICAgICAgICBMRFIgICAgIHhpMywgW3BTcmMsICMzKjE2XSAgICAgIDsvLyBqMwotICAgICAgICAKLSAgICAgICAgU0hBREQxNiB4aTEsIHhpMSwgeGl0ICAgICAgICAgICA7Ly8gMipqNwotICAgICAgICBTSEFERDE2IHhpMSwgeGkxLCB4aXQgICAgICAgICAgIDsvLyBqNyAgICAgICAgICAgICAgICAKLSAgICAgICAgCi0gICAgICAgIFNIQUREMTYgeGk1LCB4aTAsIHhpMSAgICAgICAgICAgOy8vIChqMStqNykvMgotICAgICAgICBTU1VCMTYgIHhpNiwgeGkwLCB4aTEgICAgICAgICAgIDsvLyBqMS1qNwotICAgICAgICBTSEFERDE2IHhpNywgeGkyLCB4aTMgICAgICAgICAgIDsvLyAoajUrajMpLzIKLSAgICAgICAgU1NVQjE2ICB4aTQsIHhpMiwgeGkzICAgICAgICAgICA7Ly8gajUtajMKLSAgICAgICAgCi0gICAgICAgIFNTVUIxNiAgeGkzLCB4aTUsIHhpNyAgICAgICAgICAgOy8vIChpNS1pNykvMgotICAgICAgICAKLSAgICAgICAgUEtIQlQgICB4aTAsIHhpNiwgeGk0LCBMU0wjMTYgICA7Ly8gW2k0LGk2XSByb3cgYQotICAgICAgICBQS0hUQiAgIHhpMSwgeGk0LCB4aTYsIEFTUiMxNiAgIDsvLyBbaTQsaTZdIHJvdyBiCi0gICAgICAgIAotICAgICAgICBTTVVBRFggIHhpMiwgeGkwLCBjc1BpQnk4ICAgICAgIDsvLyByb3dhIGJ5IFtjLHNdCi0gICAgICAgIFNNVUFEWCAgeGk0LCB4aTEsIGNzUGlCeTggICAgICAgOy8vIHJvd2IgYnkgW2Msc10KLSAgICAgICAgU01VU0QgICB4aTAsIHhpMCwgY3NQaUJ5OCAgICAgICA7Ly8gcm93YSBieSBbLXMsY10gICAKLSAgICAgICAgU01VU0QgICB4aTYsIHhpMSwgY3NQaUJ5OCAgICAgICA7Ly8gcm93YiBieSBbLXMsY10KLSAgICAgICAgICAgICAgICAKLSAgICAgICAgU01VTEJCICB4aTEsIHhpMywgTG9vcFJSMgotICAgICAgICBTTVVMVEIgIHhpMywgeGkzLCBMb29wUlIyCi0gICAgICAgICAgICAgICAgCi0gICAgICAgIFBLSFRCICAgeGg0LCB4aTQsIHhpMiwgQVNSIzE2ICAgOy8vIGg0LzQKLSAgICAgICAgUEtIVEIgICB4aDYsIHhpNiwgeGkwLCBBU1IjMTYgICA7Ly8gaDYvNAotICAgICAgICBTSEFERDE2IHhoNywgeGk1LCB4aTcgICAgICAgICAgIDsvLyAoaTUraTcpLzQKLSAgICAgICAgCi0gICAgICAgIE1PViAgICAgeGkzLCB4aTMsIExTTCAjMQotICAgICAgICBQS0hUQiAgIHhoNSwgeGkzLCB4aTEsIEFTUiMxNSAgIDsvLyBoNS80Ci0gICAgICAgICAgICAgICAKLSAgICAgICAgOy8vIHhpMCx4aTEseGkyLHhpMyBub3cgZnJlZQotICAgICAgICA7Ly8gSVN0YWdlIDQsMywgcm93cyAydG8zIHgxLzIKLSAgICAgICAgCi0gICAgICAgIExEUiAgICAgeGkwLCBbcFNyYywgIzIqMTZdICAgICAgOy8vIGoyCi0gICAgICAgIExEUiAgICAgeGkxLCBbcFNyYywgIzYqMTZdICAgICAgOy8vIDIqajYKLSAgICAgICAgCi0gICAgICAgIDsvLyBJU3RhZ2UgMiwgcm93czR0bzcKLSAgICAgICAgU1NVQjE2ICB4ZzYsIHhoNiwgeGg3Ci0gICAgICAgIFNTVUIxNiAgeGc1LCB4aDUsIHhnNgotICAgICAgICBTU1VCMTYgIHhnNCwgeGg0LCB4ZzUKLSAgICAgICAgCi0gICAgICAgIFNIQUREMTYgeGkxLCB4aTEsIHhpdCAgICAgICAgICAgOy8vIGo2Ci0gICAgICAgIFNTVUIxNiAgeGkyLCB4aTAsIHhpMSAgICAgICAgICAgOy8vIChqMi1qNikgICAgICAgIAotICAgICAgICBTSEFERDE2IHhpMywgeGkwLCB4aTEgICAgICAgICAgIDsvLyAoajIrajYpLzIKLSAgICAgICAgCi0gICAgICAgIFNNVUxCQiAgeGkwLCB4aTIsIExvb3BSUjIKLSAgICAgICAgU01VTFRCICB4aTIsIHhpMiwgTG9vcFJSMgotICAgICAgICAKLSAgICAgICAgTU9WICAgICB4aTIsIHhpMiwgTFNMICMxCi0gICAgICAgIAotICAgICAgICBQS0hUQiAgIHhoMiwgeGkyLCB4aTAsIEFTUiMxNSAgIDsvLyBpMipzcXJ0KDIpLzQKLSAgICAgICAgCi0gICAgICAgIDsvLyB4aTAsIHhpMSBub3cgZnJlZQotICAgICAgICA7Ly8gSVN0YWdlIDQsMyByb3dzIDB0bzEgeCAxLzIKLSAgICAgICAgTERSICAgICB4aTEsIFtwU3JjLCAjNCoxNl0gICAgICA7Ly8gajQKLSAgICAgICAgTERSICAgICB4aTAsIFtwU3JjXSwgIzQgICAgICAgICA7Ly8gajAKLQotICAgICAgICBTU1VCMTYgIHhoMiwgeGgyLCB4aTMKLSAgICAgICAgQUREUyAgICBMb29wUlIyLCBMb29wUlIyLCAjMjw8MjkgICAgOy8vIGRvbmUgdHdvIHJvd3MKLSAgICAgICAgCi0gICAgICAgIEFERCAgICAgeGkwLCB4aTAsIHhpdCwgTFNMICMyICAgOy8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EsIHhmMiwgeGYwLCBBU1IgIzE2Ci0gICAgICAgICAgICBQS0hCVCAgIHJhMjMsIHhmNCwgeGY2LCBMU0wgIzE2Ci0gICAgICAgICAgICBQS0hUQiAgIHJiMjMsIHhmNiwgeGY0LCBBU1IgIzE2Ci0gICAgICAgICAgICBTVE1JQSAgIHBEZXN0LCB7cmEwMSwgcmEyM30KLSAgICAgICAgICAgIElGICIkc3RyaWRlIj0icyIKLSAgICAgICAgICAgICAgICBBREQgICAgIHBEZXN0LCBwRGVzdCwgcFNjYWxlCi0gICAgICAgICAgICAgICAgU1RNSUEgICBwRGVzdCwge3JiMDEsIHJiMjN9Ci0gICAgICAgICAgICAgICAgQUREICAgICBwRGVzdCwgcERlc3QsIHBTY2FsZQotICAgICAgICAgICAgRUxTRSAgICAgICAgICAgICAgICAKLSAgICAgICAgICAgICAgICBBREQgICAgIHBEZXN0LCBwRGVzdCwgIygkc3RyaWRlKQotICAgICAgICAgICAgICAgIFNUTUlBICAgcERlc3QsIHtyYjAxLCByYjIzfQotICAgICAgICAgICAgICAgIEFERCAgICAgcERlc3QsIHBEZXN0LCAjKCRzdHJpZGUpCi0gICAgICAgICAgICBFTkRJRgotICAgICAgICBFTkRJRgotICAgICAgICBJRiAoIiRvdXRzaXplIj0iczkiKTpMT1I6KCIkb3V0c2l6ZSI9InMxNiIpICAgICAgICAKLSAgICAgICAgICAgIFBLSEJUICAgcmEwMSwgeGYwLCB4ZjEsIExTTCAjMTYKLSAgICAgICAgICAgIFBLSFRCICAgcmIwMSwgeGYxLCB4ZjAsIEFTUiAjMTYKLSAgICAgICAgCi0gICAgICAgICAgICBQS0hCVCAgIHJhMjMsIHhmMiwgeGYzLCBMU0wgIzE2Ci0gICAgICAgICAgICBQS0hUQiAgIHJiMjMsIHhmMywgeGYyLCBBU1IgIzE2Ci0gICAgICAgICAgICAKLSAgICAgICAgICAgIFBLSEJUICAgcmE0NSwgeGY0LCB4ZjUsIExTTCAjMTYKLSAgICAgICAgICAgIFBLSFRCICAgcmI0NSwgeGY1LCB4ZjQsIEFTUiAjMTYKLSAgICAgICAgICAgIAotICAgICAgICAgICAgUEtIQlQgICByYTY3LCB4ZjYsIHhmNywgTFNMICMxNgotICAgICAgICAgICAgUEtIVEIgICByYjY3LCB4ZjcsIHhmNiwgQVNSICMxNgotICAgICAgICAgICAgCi0gICAgICAgICAgICBTVE1JQSAgIHBEZXN0LCB7cmEwMSwgcmEyMywgcmE0NSwgcmE2N30gICAgICAKLSAgICAgICAgICAgIElGICIkc3RyaWRlIj0icyIKLSAgICAgICAgICAgICAgICBBREQgICAgIHBEZXN0LCBwRGVzdCwgcFNjYWxlCi0gICAgICAgICAgICAgICAgU1RNSUEgICBwRGVzdCwge3JiMDEsIHJiMjMsIHJiNDUsIHJiNjd9ICAgICAgCi0gICAgICAgICAgICAgICAgQUREICAgICBwRGVzdCwgcERlc3QsIHBTY2FsZQotICAgICAgICAgICAgRUxTRSAgICAgICAgICAgICAgICAKLSAgICAgICAgICAgICAgICBBREQgICAgIHBEZXN0LCBwRGVzdCwgIygkc3RyaWRlKQotICAgICAgICAgICAgICAgIFNUTUlBICAgcERlc3QsIHtyYjAxLCByYjIzLCByYjQ1LCByYjY3fSAgICAgIAotICAgICAgICAgICAgICAgIEFERCAgICAgcERlc3QsIHBEZXN0LCAjKCRzdHJpZGUpCi0gICAgICAgICAgICBFTkRJRgotICAgICAgICBFTkRJRgotICAgICAgICAKLSAgICAgICAgQkNDICAgICB2Nl9pZGN0X3JvdyRfRgotICAgICAgICBFTkRJRiA7Ly8gQVJNMTEzNkpTCi0KLQotICAgICAgICBJRiBDb3J0ZXhBOAotICAgICAgICAKLVNyYzAgICAgICAgICAgICBFUVUgIDcgICAgICAgICAgICAgIAotU3JjMSAgICAgICAgICAgIEVRVSAgOCAgICAgICAgICAgICAgCi1TcmMyICAgICAgICAgICAgRVFVICA5ICAgICAgICAgICAgICAKLVNyYzMgICAgICAgICAgICBFUVUgIDEwICAgICAgICAgICAgICAKLVNyYzQgICAgICAgICAgICBFUVUgIDExICAgICAgICAgICAgICAKLVNyYzUgICAgICAgICAgICBFUVUgIDEyICAgICAgICAgICAgICAKLVNyYzYgICAgICAgICAgICBFUVUgIDEzCi1TcmM3ICAgICAgICAgICAgRVFVICAxNAotVG1wICAgICAgICAgICAgIEVRVSAgMTUKLQotcVhqMCAgICAgICAgICAgIFFOIFNyYzAuUzE2IAotcVhqMSAgICAgICAgICAgIFFOIFNyYzEuUzE2Ci1xWGoyICAgICAgICAgICAgUU4gU3JjMi5TMTYKLXFYajMgICAgICAgICAgICBRTiBTcmMzLlMxNgotcVhqNCAgICAgICAgICAgIFFOIFNyYzQuUzE2Ci1xWGo1ICAgICAgICAgICAgUU4gU3JjNS5TMTYKLXFYajYgICAgICAgICAgICBRTiBTcmM2LlMxNgotcVhqNyAgICAgICAgICAgIFFOIFNyYzcuUzE2Ci1xWGp0ICAgICAgICAgICAgUU4gVG1wLlMxNgotCi1kWGowbG8gICAgICAgICAgRE4gKFNyYzAqMikuUzE2Ci1kWGowaGkgICAgICAgICAgRE4gKFNyYzAqMisxKS5TMTYKLWRYajFsbyAgICAgICAgICBETiAoU3JjMSoyKS5TMTYKLWRYajFoaSAgICAgICAgICBETiAoU3JjMSoyKzEpLlMxNgotZFhqMmxvICAgICAgICAgIEROIChTcmMyKjIpLlMxNgotZFhqMmhpICAgICAgICAgIEROIChTcmMyKjIrMSkuUzE2Ci1kWGozbG8gICAgICAgICAgRE4gKFNyYzMqMikuUzE2Ci1kWGozaGkgICAgICAgICAgRE4gKFNyYzMqMisxKS5TMTYKLWRYajRsbyAgICAgICAgICBETiAoU3JjNCoyKS5TMTYKLWRYajRoaSAgICAgICAgICBETiAoU3JjNCoyKzEpLlMxNgotZFhqNWxvICAgICAgICAgIEROIChTcmM1KjIpLlMxNgotZFhqNWhpICAgICAgICAgIEROIChTcmM1KjIrMSkuUzE2Ci1kWGo2bG8gICAgICAgICAgRE4gKFNyYzYqMikuUzE2Ci1kWGo2aGkgICAgICAgICAgRE4gKFNyYzYqMisxKS5TMTYKLWRYajdsbyAgICAgICAgICBETiAoU3JjNyoyKS5TMTYKLWRYajdoaSAgICAgICAgICBETiAoU3JjNyoyKzEpLlMxNgotZFhqdGxvICAgICAgICAgIEROIChUbXAqMikuUzE2Ci1kWGp0aGkgICAgICAgICAgRE4gKFRtcCoyKzEpLlMxNgotCi1xWGkwICAgICAgICAgICAgUU4gcVhqMAotcVhpMSAgICAgICAgICAgIFFOIHFYajQKLXFYaTIgICAgICAgICAgICBRTiBxWGoyCi1xWGkzICAgICAgICAgICAgUU4gcVhqNwotcVhpNCAgICAgICAgICAgIFFOIHFYajUKLXFYaTUgICAgICAgICAgICBRTiBxWGp0Ci1xWGk2ICAgICAgICAgICAgUU4gcVhqMQotcVhpNyAgICAgICAgICAgIFFOIHFYajYKLXFYaXQgICAgICAgICAgICBRTiBxWGozCi0KLWRYaTBsbyAgICAgICAgICBETiBkWGowbG8KLWRYaTBoaSAgICAgICAgICBETiBkWGowaGkKLWRYaTFsbyAgICAgICAgICBETiBkWGo0bG8KLWRYaTFoaSAgICAgICAgICBETiBkWGo0aGkKLWRYaTJsbyAgICAgICAgICBETiBkWGoybG8KLWRYaTJoaSAgICAgICAgICBETiBkWGoyaGkKLWRYaTNsbyAgICAgICAgICBETiBkWGo3bG8KLWRYaTNoaSAgICAgICAgICBETiBkWGo3aGkKLWRYaTRsbyAgICAgICAgICBETiBkWGo1bG8KLWRYaTRoaSAgICAgICAgICBETiBkWGo1aGkKLWRYaTVsbyAgICAgICAgICBETiBkWGp0bG8KLWRYaTVoaSAgICAgICAgICBETiBkWGp0aGkKLWRYaTZsbyAgICAgICAgICBETiBkWGoxbG8KLWRYaTZoaSAgICAgICAgICBETiBkWGoxaGkKLWRYaTdsbyAgICAgICAgICBETiBkWGo2bG8KLWRYaTdoaSAgICAgICAgICBETiBkWGo2aGkKLWRYaXRsbyAgICAgICAgICBETiBkWGozbG8KLWRYaXRoaSAgICAgICAgICBETiBkWGozaGkKLQotcVhoMCAgICAgICAgICAgIFFOIHFYaXQKLXFYaDEgICAgICAgICAgICBRTiBxWGkwCi1xWGgyICAgICAgICAgICAgUU4gcVhpMgotcVhoMyAgICAgICAgICAgIFFOIHFYaTMKLXFYaDQgICAgICAgICAgICBRTiBxWGk3Ci1xWGg1ICAgICAgICAgICAgUU4gcVhpNQotcVhoNiAgICAgICAgICAgIFFOIHFYaTQKLXFYaDcgICAgICAgICAgICBRTiBxWGkxCi1xWGh0ICAgICAgICAgICAgUU4gcVhpNgotCi1kWGgwbG8gICAgICAgICAgRE4gZFhpdGxvCi1kWGgwaGkgICAgICAgICAgRE4gZFhpdGhpCi1kWGgxbG8gICAgICAgICAgRE4gZFhpMGxvCi1kWGgxaGkgICAgICAgICAgRE4gZFhpMGhpCi1kWGgybG8gICAgICAgICAgRE4gZFhpMmxvCi1kWGgyaGkgICAgICAgICAgRE4gZFhpMmhpCi1kWGgzbG8gICAgICAgICAgRE4gZFhpM2xvCi1kWGgzaGkgICAgICAgICAgRE4gZFhpM2hpCi1kWGg0bG8gICAgICAgICAgRE4gZFhpN2xvCi1kWGg0aGkgICAgICAgICAgRE4gZFhpN2hpCi1kWGg1bG8gICAgICAgICAgRE4gZFhpNWxvCi1kWGg1aGkgICAgICAgICAgRE4gZFhpNWhpCi1kWGg2bG8gICAgICAgICAgRE4gZFhpNGxvCi1kWGg2aGkgICAgICAgICAgRE4gZFhpNGhpCi1kWGg3bG8gICAgICAgICAgRE4gZFhpMWxvCi1kWGg3aGkgICAgICAgICAgRE4gZFhpMWhpCi1kWGh0bG8gICAgICAgICAgRE4gZFhpNmxvCi1kWGh0aGkgICAgICAgICAgRE4gZFhpNmhpCi0KLXFYZzAgICAgICAgICAgICBRTiBxWGgyCi1xWGcxICAgICAgICAgICAgUU4gcVhodAotcVhnMiAgICAgICAgICAgIFFOIHFYaDEKLXFYZzMgICAgICAgICAgICBRTiBxWGgwCi1xWGc0ICAgICAgICAgICAgUU4gcVhoNAotcVhnNSAgICAgICAgICAgIFFOIHFYaDUKLXFYZzYgICAgICAgICAgICBRTiBxWGg2Ci1xWGc3ICAgICAgICAgICAgUU4gcVhoNwotcVhndCAgICAgICAgICAgIFFOIHFYaDMKLQotcVhmMCAgICAgICAgICAgIFFOIHFYZzYKLXFYZjEgICAgICAgICAgICBRTiBxWGc1Ci1xWGYyICAgICAgICAgICAgUU4gcVhnNAotcVhmMyAgICAgICAgICAgIFFOIHFYZ3QKLXFYZjQgICAgICAgICAgICBRTiBxWGczCi1xWGY1ICAgICAgICAgICAgUU4gcVhnMgotcVhmNiAgICAgICAgICAgIFFOIHFYZzEKLXFYZjcgICAgICAgICAgICBRTiBxWGcwCi1xWGZ0ICAgICAgICAgICAgUU4gcVhnNwotCi0KLXFYdDAgICAgICAgICAgICBRTiAxLlMzMgotcVh0MSAgICAgICAgICAgIFFOIDIuUzMyCi1xVDBsbyAgICAgICAgICAgUU4gMS5TMzIgICAgICAgICAKLXFUMGhpICAgICAgICAgICBRTiAyLlMzMiAgICAgICAgIAotcVQxbG8gICAgICAgICAgIFFOIDMuUzMyICAgICAgICAgCi1xVDFoaSAgICAgICAgICAgUU4gNC5TMzIgICAgICAgICAKLXFTY2FsZWxvICAgICAgICBRTiA1LlMzMiAgICAgICAgOy8vIHVzZWQgdG8gcmVhZCBwb3N0IHNjYWxlIHZhbHVlcwotcVNjYWxlaGkgICAgICAgIFFOIDYuUzMyCi1xVGVtcDAgICAgICAgICAgUU4gNS5TMzIgICAgICAgICAKLXFUZW1wMSAgICAgICAgICBRTiA2LlMzMiAgICAKLQotCi1TY2FsZTEgICAgICAgICAgRVFVIDYKLVNjYWxlMiAgICAgICAgICBFUVUgMTUKLXFTY2FsZTEgICAgICAgICBRTiBTY2FsZTEuUzE2ICAgICAKLXFTY2FsZTIgICAgICAgICBRTiBTY2FsZTIuUzE2ICAgICAKLWRTY2FsZTFsbyAgICAgICBETiAoU2NhbGUxKjIpLlMxNiAgICAgCi1kU2NhbGUxaGkgICAgICAgRE4gKFNjYWxlMSoyKzEpLlMxNgotZFNjYWxlMmxvICAgICAgIEROIChTY2FsZTIqMikuUzE2ICAgICAKLWRTY2FsZTJoaSAgICAgICBETiAoU2NhbGUyKjIrMSkuUzE2Ci0KLWRDb2VmcyAgICAgICAgICBETiAwLlMxNiAgICAgICAgOy8vIFNjYWxlIGNvZWZmaWNpZW50cyBpbiBmb3JtYXQge1swXSBbQ10gW1NdIFtJbnZTcXJ0Ml19Ci1JbnZTcXJ0MiAgICAgICAgRE4gZENvZWZzWzBdICAgIDsvLyAxL3NxcnQoMikgaW4gUTE1Ci1TICAgICAgICAgICAgICAgRE4gZENvZWZzWzFdICAgIDsvLyBTaW4oUEkvOCkgaW4gUTE1Ci1DICAgICAgICAgICAgICAgRE4gZENvZWZzWzJdICAgIDsvLyBDb3MoUEkvOCkgaW4gUTE1Ci0KLXBUZW1wICAgICAgICAgICBSTiAxMgotCi0gICAgICAgICAgICAgICAgCi0gICAgICAgIElNUE9SVCAgYXJtQ09NTV9JRENUQ29lZgotICAgICAgICAgICAgICAgICAgICAKLSAgICAgICAgVkxEMSAgICAgICAge3FYajAscVhqMX0sIFtwU3JjIEA2NF0hCi0gICAgICAgIFZMRDEgICAgICAgIHtxWGoyLHFYajN9LCBbcFNyYyBANjRdIQotICAgICAgICBWTEQxICAgICAgICB7cVhqNCxxWGo1fSwgW3BTcmMgQDY0XSEKLSAgICAgICAgVkxEMSAgICAgICAge3FYajYscVhqN30sIFtwU3JjIEA2NF0hCi0gICAgICAgIAotICAgICAgICA7Ly8gTG9hZCBQcmVTY2FsZSBhbmQgbXVsdGlwbHkgd2l0aCBTcmMKLSAgICAgICAgOy8vIElTdGFnZSA0Ci0gICAgICAgIAotICAgICAgICBJRiAiJGluc2NhbGUiPSJzMTYiICAgICAgICAgICAgICAgICAgICAgICAgIDsvLyAxNlgxNiBNdWwKLSAgICAgICAgICAgIE1fSURDVF9QUkVTQ0FMRTE2Ci0gICAgICAgIEVORElGCi0gICAgICAgIAotICAgICAgICBJRiAiJGluc2NhbGUiPSJzMzIiICAgICAgICAgICAgICAgICAgICAgICAgIDsvLyAzMlgzMiAsdWwKLSAgICAgICAgICAgIE1fSURDVF9QUkVTQ0FMRTMyCi0gICAgICAgIEVORElGCi0KLSAgICAgICAgOy8vIElTdGFnZSAzCi0gICAgICAgIFZRUkRNVUxIICAgICBxWGkyLCBxWGkyLCBJbnZTcXJ0MiAgICAgICAgICAgIDsvLyBpMi9zcXJ0KDIpCi0gICAgICAgIFZIQUREICAgICAgIHFYaDAsIHFYaTAsIHFYaTEgICAgICAgICAgICAgICAgOy8vIChpMCtpMSkvMgotICAgICAgICBWSFNVQiAgICAgICBxWGgxLCBxWGkwLCBxWGkxICAgICAgICAgICAgICAgIDsvLyAoaTAtaTEpLzIKLSAgICAgICAgVkhBREQgICAgICAgcVhoNywgcVhpNSwgcVhpNyAgICAgICAgICAgICAgICA7Ly8gKGk1K2k3KS80Ci0gICAgICAgIFZTVUIgICAgICAgIHFYaDUsIHFYaTUsIHFYaTcgICAgICAgICAgICAgICAgOy8vIChpNS1pNykvMgotICAgICAgICBWUVJETVVMSCAgICAgcVhoNSwgcVhoNSwgSW52U3FydDIgICAgICAgICAgICA7Ly8gaDUvc3FydCgyKQotICAgICAgICBWU1VCICAgICAgICBxWGgyLCBxWGkyLCBxWGkzICAgICAgICAgICAgICAgIDsvLyBoMiwgaDMKLQotICAgICAgICBWTVVMTCAgICAgICBxWHQwLCBkWGk0bG8sIEMgICAgICAgICAgICAgICAgIDsvLyBjKmk0Ci0gICAgICAgIFZNTEFMICAgICAgIHFYdDAsIGRYaTZsbywgUyAgICAgICAgICAgICAgICAgOy8vIGMqaTQrcyppNgotICAgICAgICBWTVVMTCAgICAgICBxWHQxLCBkWGk0aGksIEMKLSAgICAgICAgVk1MQUwgICAgICAgcVh0MSwgZFhpNmhpLCBTCi0gICAgICAgIFZTSFJOICAgICAgIGRYaDRsbywgcVh0MCwgIzE2ICAgICAgICAgICAgICAgOy8vIGg0Ci0gICAgICAgIFZTSFJOICAgICAgIGRYaDRoaSwgcVh0MSwgIzE2Ci0gICAgICAgIAotICAgICAgICBWTVVMTCAgICAgICBxWHQwLCBkWGk2bG8sIEMgICAgICAgICAgICAgICAgIDsvLyBjKmk2Ci0gICAgICAgIFZNTFNMICAgICAgIHFYdDAsIGRYaTRsbywgUyAgICAgICAgICAgICAgICAgOy8vIC1zKmk0ICsgYypoNgotICAgICAgICBWTVVMTCAgICAgICBxWHQxLCBkWGk2aGksIEMKLSAgICAgICAgVk1MU0wgICAgICAgcVh0MSwgZFhpNGhpLCBTCi0gICAgICAgIFZTSFJOICAgICAgIGRYaDZsbywgcVh0MCwgIzE2ICAgICAgICAgICAgICAgOy8vIGg2Ci0gICAgICAgIFZTSFJOICAgICAgIGRYaDZoaSwgcVh0MSwgIzE2Ci0gICAgICAgIAotICAgICAgICA7Ly8gSVN0YWdlIDIKLSAgICAgICAgVlNVQiAgICAgICAgcVhnNiwgcVhoNiwgcVhoNwotICAgICAgICBWU1VCICAgICAgICBxWGc1LCBxWGg1LCBxWGc2Ci0gICAgICAgIFZTVUIgICAgICAgIHFYZzQsIHFYaDQsIHFYZzUKLSAgICAgICAgVkhBREQgICAgICAgcVhnMSwgcVhoMSwgcVhoMiAgICAgICAgOy8vIChoMStoMikvMgotICAgICAgICBWSFNVQiAgICAgICBxWGcyLCBxWGgxLCBxWGgyICAgICAgICA7Ly8gKGgxLWgyKS8yCi0gICAgICAgIFZIQUREICAgICAgIHFYZzAsIHFYaDAsIHFYaDMgICAgICAgIDsvLyAoaDAraDMpLzIKLSAgICAgICAgVkhTVUIgICAgICAgcVhnMywgcVhoMCwgcVhoMyAgICAgICAgOy8vIChoMC1oMykvMgotCi0gICAgICAgIDsvLyBJU3RhZ2UgMSBhbGwgcm93cwotICAgICAgICBWQUREICAgICAgICBxWGYzLCBxWGczLCBxWGc0ICAgICAgICAKLSAgICAgICAgVlNVQiAgICAgICAgcVhmNCwgcVhnMywgcVhnNCAgICAgICAgCi0gICAgICAgIFZBREQgICAgICAgIHFYZjIsIHFYZzIsIHFYZzUgICAgICAgIAotICAgICAgICBWU1VCICAgICAgICBxWGY1LCBxWGcyLCBxWGc1ICAgICAgICAKLSAgICAgICAgVkFERCAgICAgICAgcVhmMSwgcVhnMSwgcVhnNgotICAgICAgICBWU1VCICAgICAgICBxWGY2LCBxWGcxLCBxWGc2ICAgICAgICAKLSAgICAgICAgVkFERCAgICAgICAgcVhmMCwgcVhnMCwgcVhnNwotICAgICAgICBWU1VCICAgICAgICBxWGY3LCBxWGcwLCBxWGc3ICAgICAgCi0KLSAgICAgICAgOy8vIFRyYW5zcG9zZSwgc3RvcmUgYW5kIGxvb3AKLVhUUjAgICAgICAgICAgICBFUVUgU3JjNQotWFRSMSAgICAgICAgICAgIEVRVSBUbXAKLVhUUjIgICAgICAgICAgICBFUVUgU3JjNgotWFRSMyAgICAgICAgICAgIEVRVSBTcmM3Ci1YVFI0ICAgICAgICAgICAgRVFVIFNyYzMKLVhUUjUgICAgICAgICAgICBFUVUgU3JjMAotWFRSNiAgICAgICAgICAgIEVRVSBTcmMxCi1YVFI3ICAgICAgICAgICAgRVFVIFNyYzIKLVhUUnQgICAgICAgICAgICBFUVUgU3JjNAotICAgICAgICAgICAgICAgIAotcUEwICAgICAgICAgICAgIFFOICBYVFIwLlMzMiAgOy8vIGZvciBYVFJwb3NlCi1xQTEgICAgICAgICAgICAgUU4gIFhUUjEuUzMyCi1xQTIgICAgICAgICAgICAgUU4gIFhUUjIuUzMyCi1xQTMgICAgICAgICAgICAgUU4gIFhUUjMuUzMyCi1xQTQgICAgICAgICAgICAgUU4gIFhUUjQuUzMyCi1xQTUgICAgICAgICAgICAgUU4gIFhUUjUuUzMyCi1xQTYgICAgICAgICAgICAgUU4gIFhUUjYuUzMyCi1xQTcgICAgICAgICAgICAgUU4gIFhUUjcuUzMyCi0KLWRCMCAgICAgICAgICAgICBETiAgWFRSMCoyKzEgICAgICA7Ly8gZm9yIHVzaW5nIFZTV1AKLWRCMSAgICAgICAgICAgICBETiAgWFRSMSoyKzEKLWRCMiAgICAgICAgICAgICBETiAgWFRSMioyKzEKLWRCMyAgICAgICAgICAgICBETiAgWFRSMyoyKzEKLWRCNCAgICAgICAgICAgICBETiAgWFRSNCoyCi1kQjUgICAgICAgICAgICAgRE4gIFhUUjUqMgotZEI2ICAgICAgICAgICAgIEROICBYVFI2KjIKLWRCNyAgICAgICAgICAgICBETiAgWFRSNyoyCi0KLSAgICAgICAgICAKLSAgICAgICAgVlRSTiAgICAgICAgcVhmMCwgcVhmMQotICAgICAgICBWVFJOICAgICAgICBxWGYyLCBxWGYzCi0gICAgICAgIFZUUk4gICAgICAgIHFYZjQsIHFYZjUKLSAgICAgICAgVlRSTiAgICAgICAgcVhmNiwgcVhmNwotICAgICAgICBWVFJOICAgICAgICBxQTAsIHFBMgotICAgICAgICBWVFJOICAgICAgICBxQTEsIHFBMwotICAgICAgICBWVFJOICAgICAgICBxQTQsIHFBNgotICAgICAgICBWVFJOICAgICAgICBxQTUsIHFBNyAgICAgICAgCi0gICAgICAgIFZTV1AgICAgICAgIGRCMCwgZEI0Ci0gICAgICAgIFZTV1AgICAgICAgIGRCMSwgZEI1Ci0gICAgICAgIFZTV1AgICAgICAgIGRCMiwgZEI2Ci0gICAgICAgIFZTV1AgICAgICAgIGRCMywgZEI3Ci0gICAgICAgIAotCi1xWWowICAgICAgICAgICAgUU4gcVhmMAotcVlqMSAgICAgICAgICAgIFFOIHFYZjEKLXFZajIgICAgICAgICAgICBRTiBxWGYyCi1xWWozICAgICAgICAgICAgUU4gcVhmMwotcVlqNCAgICAgICAgICAgIFFOIHFYZjQKLXFZajUgICAgICAgICAgICBRTiBxWGY1Ci1xWWo2ICAgICAgICAgICAgUU4gcVhmNgotcVlqNyAgICAgICAgICAgIFFOIHFYZjcKLXFZanQgICAgICAgICAgICBRTiBxWGZ0Ci0KLWRZajBsbyAgICAgICAgICBETiAoWFRSMCoyKS5TMTYKLWRZajBoaSAgICAgICAgICBETiAoWFRSMCoyKzEpLlMxNgotZFlqMWxvICAgICAgICAgIEROIChYVFIxKjIpLlMxNgotZFlqMWhpICAgICAgICAgIEROIChYVFIxKjIrMSkuUzE2Ci1kWWoybG8gICAgICAgICAgRE4gKFhUUjIqMikuUzE2Ci1kWWoyaGkgICAgICAgICAgRE4gKFhUUjIqMisxKS5TMTYKLWRZajNsbyAgICAgICAgICBETiAoWFRSMyoyKS5TMTYKLWRZajNoaSAgICAgICAgICBETiAoWFRSMyoyKzEpLlMxNgotZFlqNGxvICAgICAgICAgIEROIChYVFI0KjIpLlMxNgotZFlqNGhpICAgICAgICAgIEROIChYVFI0KjIrMSkuUzE2Ci1kWWo1bG8gICAgICAgICAgRE4gKFhUUjUqMikuUzE2Ci1kWWo1aGkgICAgICAgICAgRE4gKFhUUjUqMisxKS5TMTYKLWRZajZsbyAgICAgICAgICBETiAoWFRSNioyKS5TMTYKLWRZajZoaSAgICAgICAgICBETiAoWFRSNioyKzEpLlMxNgotZFlqN2xvICAgICAgICAgIEROIChYVFI3KjIpLlMxNgotZFlqN2hpICAgICAgICAgIEROIChYVFI3KjIrMSkuUzE2Ci1kWWp0bG8gICAgICAgICAgRE4gKFhUUnQqMikuUzE2Ci1kWWp0aGkgICAgICAgICAgRE4gKFhUUnQqMisxKS5TMTYKLQotcVlpMCAgICAgICAgICAgIFFOIHFZajAKLXFZaTEgICAgICAgICAgICBRTiBxWWo0Ci1xWWkyICAgICAgICAgICAgUU4gcVlqMgotcVlpMyAgICAgICAgICAgIFFOIHFZajcKLXFZaTQgICAgICAgICAgICBRTiBxWWo1Ci1xWWk1ICAgICAgICAgICAgUU4gcVlqdAotcVlpNiAgICAgICAgICAgIFFOIHFZajEKLXFZaTcgICAgICAgICAgICBRTiBxWWo2Ci1xWWl0ICAgICAgICAgICAgUU4gcVlqMwotCi1kWWkwbG8gICAgICAgICAgRE4gZFlqMGxvCi1kWWkwaGkgICAgICAgICAgRE4gZFlqMGhpCi1kWWkxbG8gICAgICAgICAgRE4gZFlqNGxvCi1kWWkxaGkgICAgICAgICAgRE4gZFlqNGhpCi1kWWkybG8gICAgICAgICAgRE4gZFlqMmxvCi1kWWkyaGkgICAgICAgICAgRE4gZFlqMmhpCi1kWWkzbG8gICAgICAgICAgRE4gZFlqN2xvCi1kWWkzaGkgICAgICAgICAgRE4gZFlqN2hpCi1kWWk0bG8gICAgICAgICAgRE4gZFlqNWxvCi1kWWk0aGkgICAgICAgICAgRE4gZFlqNWhpCi1kWWk1bG8gICAgICAgICAgRE4gZFlqdGxvCi1kWWk1aGkgICAgICAgICAgRE4gZFlqdGhpCi1kWWk2bG8gICAgICAgICAgRE4gZFlqMWxvCi1kWWk2aGkgICAgICAgICAgRE4gZFlqMWhpCi1kWWk3bG8gICAgICAgICAgRE4gZFlqNmxvCi1kWWk3aGkgICAgICAgICAgRE4gZFlqNmhpCi1kWWl0bG8gICAgICAgICAgRE4gZFlqM2xvCi1kWWl0aGkgICAgICAgICAgRE4gZFlqM2hpCi0KLXFZaDAgICAgICAgICAgICBRTiBxWWl0Ci1xWWgxICAgICAgICAgICAgUU4gcVlpMAotcVloMiAgICAgICAgICAgIFFOIHFZaTIKLXFZaDMgICAgICAgICAgICBRTiBxWWkzCi1xWWg0ICAgICAgICAgICAgUU4gcVlpNwotcVloNSAgICAgICAgICAgIFFOIHFZaTUKLXFZaDYgICAgICAgICAgICBRTiBxWWk0Ci1xWWg3ICAgICAgICAgICAgUU4gcVlpMQotcVlodCAgICAgICAgICAgIFFOIHFZaTYKLQotZFloMGxvICAgICAgICAgIEROIGRZaXRsbwotZFloMGhpICAgICAgICAgIEROIGRZaXRoaQotZFloMWxvICAgICAgICAgIEROIGRZaTBsbwotZFloMWhpICAgICAgICAgIEROIGRZaTBoaQotZFloMmxvICAgICAgICAgIEROIGRZaTJsbwotZFloMmhpICAgICAgICAgIEROIGRZaTJoaQotZFloM2xvICAgICAgICAgIEROIGRZaTNsbwotZFloM2hpICAgICAgICAgIEROIGRZaTNoaQotZFloNGxvICAgICAgICAgIEROIGRZaTdsbwotZFloNGhpICAgICAgICAgIEROIGRZaTdoaQotZFloNWxvICAgICAgICAgIEROIGRZaTVsbwotZFloNWhpICAgICAgICAgIEROIGRZaTVoaQotZFloNmxvICAgICAgICAgIEROIGRZaTRsbwotZFloNmhpICAgICAgICAgIEROIGRZaTRoaQotZFloN2xvICAgICAgICAgIEROIGRZaTFsbwotZFloN2hpICAgICAgICAgIEROIGRZaTFoaQotZFlodGxvICAgICAgICAgIEROIGRZaTZsbwotZFlodGhpICAgICAgICAgIEROIGRZaTZoaQotCi1xWWcwICAgICAgICAgICAgUU4gcVloMgotcVlnMSAgICAgICAgICAgIFFOIHFZaHQKLXFZZzIgICAgICAgICAgICBRTiBxWWgxCi1xWWczICAgICAgICAgICAgUU4gcVloMAotcVlnNCAgICAgICAgICAgIFFOIHFZaDQKLXFZZzUgICAgICAgICAgICBRTiBxWWg1Ci1xWWc2ICAgICAgICAgICAgUU4gcVloNgotcVlnNyAgICAgICAgICAgIFFOIHFZaDcKLXFZZ3QgICAgICAgICAgICBRTiBxWWgzCi0KLXFZZjAgICAgICAgICAgICBRTiBxWWc2Ci1xWWYxICAgICAgICAgICAgUU4gcVlnNQotcVlmMiAgICAgICAgICAgIFFOIHFZZzQKLXFZZjMgICAgICAgICAgICBRTiBxWWd0Ci1xWWY0ICAgICAgICAgICAgUU4gcVlnMwotcVlmNSAgICAgICAgICAgIFFOIHFZZzIKLXFZZjYgICAgICAgICAgICBRTiBxWWcxCi1xWWY3ICAgICAgICAgICAgUU4gcVlnMAotcVlmdCAgICAgICAgICAgIFFOIHFZZzcKLQotICAgICAgICBWUlNIUiAgICAgICBxWWo3LCBxWWo3LCAjMgotICAgICAgICBWUlNIUiAgICAgICBxWWo2LCBxWWo2LCAjMQotICAgICAgICAKLSAgICAgICAgVkhBREQgICAgICAgcVlpNSwgcVlqMSwgcVlqNyAgICAgICAgOy8vIGk1ID0gKGoxK2o3KS8yCi0gICAgICAgIFZTVUIgICAgICAgIHFZaTYsIHFZajEsIHFZajcgICAgICAgIDsvLyBpNiA9IGoxLWo3Ci0gICAgICAgIFZIQUREICAgICAgIHFZaTMsIHFZajIsIHFZajYgICAgICAgIDsvLyBpMyA9IChqMitqNikvMgotICAgICAgICBWU1VCICAgICAgICBxWWkyLCBxWWoyLCBxWWo2ICAgICAgICA7Ly8gaTIgPSBqMi1qNgotICAgICAgICBWSEFERCAgICAgICBxWWk3LCBxWWo1LCBxWWozICAgICAgICA7Ly8gaTcgPSAoajUrajMpLzIKLSAgICAgICAgVlNVQiAgICAgICAgcVlpNCwgcVlqNSwgcVlqMyAgICAgICAgOy8vIGk0ID0gajUtajMKLQotICAgICAgICBWUVJETVVMSCAgICAgcVlpMiwgcVlpMiwgSW52U3FydDIgICAgOy8vIGkyL3NxcnQoMikKLSAgICAgICAgOy8vIElTdGFnZSA0LDMgcm93cyAwdG8xIHggMS8yCi0gICAgICAgIAotICAgICAgICBNT1YgICAgICAgICBwVGVtcCwgIzB4NCAgICAgICAgICAgICA7Ly8gZW5zdXJlIGNvcnJlY3Qgcm91bmQKLSAgICAgICAgVkRVUCAgICAgICAgcVNjYWxlMSwgcFRlbXAgICAgICAgICAgIDsvLyBvZiBEQyByZXN1bHQKLSAgICAgICAgVkFERCAgICAgICAgcVlpMCwgcVlpMCwgcVNjYWxlMQotICAgICAgICAKLSAgICAgICAgVkhBREQgICAgICAgcVloMCwgcVlpMCwgcVlpMSAgICAgICAgOy8vIChpMCtpMSkvMgotICAgICAgICBWSFNVQiAgICAgICBxWWgxLCBxWWkwLCBxWWkxICAgICAgICA7Ly8gKGkwLWkxKS8yCi0KLSAgICAgICAgVkhBREQgICAgICAgcVloNywgcVlpNSwgcVlpNyAgICAgICAgOy8vIChpNStpNykvNAotICAgICAgICBWU1VCICAgICAgICBxWWg1LCBxWWk1LCBxWWk3ICAgICAgICA7Ly8gKGk1LWk3KS8yCi0gICAgICAgIFZTVUIgICAgICAgIHFZaDIsIHFZaTIsIHFZaTMgICAgICAgIDsvLyBoMiwgaDMKLSAgICAgICAgVlFSRE1VTEggICAgIHFZaDUsIHFZaDUsIEludlNxcnQyICAgIDsvLyBoNS9zcXJ0KDIpCi0KLSAgICAgICAgVk1VTEwgICAgICAgcVh0MCwgZFlpNGxvLCBDICAgICAgICAgOy8vIGMqaTQKLSAgICAgICAgVk1MQUwgICAgICAgcVh0MCwgZFlpNmxvLCBTICAgICAgICAgOy8vIGMqaTQrcyppNgotICAgICAgICBWTVVMTCAgICAgICBxWHQxLCBkWWk0aGksIEMKLSAgICAgICAgVk1MQUwgICAgICAgcVh0MSwgZFlpNmhpLCBTCi0gICAgICAgIFZTSFJOICAgICAgIGRZaDRsbywgcVh0MCwgIzE2ICAgICAgIDsvLyBoNAotICAgICAgICBWU0hSTiAgICAgICBkWWg0aGksIHFYdDEsICMxNgotICAgICAgICAKLSAgICAgICAgVk1VTEwgICAgICAgcVh0MCwgZFlpNmxvLCBDICAgICAgICAgOy8vIGMqaTYKLSAgICAgICAgVk1MU0wgICAgICAgcVh0MCwgZFlpNGxvLCBTICAgICAgICAgOy8vIC1zKmk0ICsgYypoNgotICAgICAgICBWTVVMTCAgICAgICBxWHQxLCBkWWk2aGksIEMKLSAgICAgICAgVk1MU0wgICAgICAgcVh0MSwgZFlpNGhpLCBTCi0gICAgICAgIFZTSFJOICAgICAgIGRZaDZsbywgcVh0MCwgIzE2ICAgICAgIDsvLyBoNgotICAgICAgICBWU0hSTiAgICAgICBkWWg2aGksIHFYdDEsICMxNgotICAgICAgICAKLSAgICAgICAgVlNVQiAgICAgICAgcVlnNiwgcVloNiwgcVloNwotICAgICAgICBWU1VCICAgICAgICBxWWc1LCBxWWg1LCBxWWc2Ci0gICAgICAgIFZTVUIgICAgICAgIHFZZzQsIHFZaDQsIHFZZzUKLSAgICAgICAgCi0gICAgICAgIDsvLyBJU3RhZ2UgMiByb3dzIDB0bzMgeCAxLzIKLSAgICAgICAgVkhBREQgICAgICAgcVlnMSwgcVloMSwgcVloMiAgICAgICAgOy8vIChoMStoMikvMgotICAgICAgICBWSFNVQiAgICAgICBxWWcyLCBxWWgxLCBxWWgyICAgICAgICA7Ly8gKGgxLWgyKS8yCi0gICAgICAgIFZIQUREICAgICAgIHFZZzAsIHFZaDAsIHFZaDMgICAgICAgIDsvLyAoaDAraDMpLzIKLSAgICAgICAgVkhTVUIgICAgICAgcVlnMywgcVloMCwgcVloMyAgICAgICAgOy8vIChoMC1oMykvMgotICAgICAgICAKLQotICAgICAgICA7Ly8gSVN0YWdlIDEgYWxsIHJvd3MKLSAgICAgICAgVkhBREQgICAgICAgIHFZZjMsIHFZZzMsIHFZZzQgICAgICAgIAotICAgICAgICBWSFNVQiAgICAgICAgcVlmNCwgcVlnMywgcVlnNCAgICAgICAgCi0gICAgICAgIFZIQUREICAgICAgICBxWWYyLCBxWWcyLCBxWWc1ICAgICAgICAKLSAgICAgICAgVkhTVUIgICAgICAgIHFZZjUsIHFZZzIsIHFZZzUgICAgICAgIAotICAgICAgICBWSEFERCAgICAgICAgcVlmMSwgcVlnMSwgcVlnNgotICAgICAgICBWSFNVQiAgICAgICAgcVlmNiwgcVlnMSwgcVlnNiAgICAgICAgCi0gICAgICAgIFZIQUREICAgICAgICBxWWYwLCBxWWcwLCBxWWc3Ci0gICAgICAgIFZIU1VCICAgICAgICBxWWY3LCBxWWcwLCBxWWc3ICAgICAgCi0KLVlUUjAgICAgICAgICAgICBFUVUgU3JjMAotWVRSMSAgICAgICAgICAgIEVRVSBTcmM0Ci1ZVFIyICAgICAgICAgICAgRVFVIFNyYzEKLVlUUjMgICAgICAgICAgICBFUVUgU3JjMgotWVRSNCAgICAgICAgICAgIEVRVSBTcmM3Ci1ZVFI1ICAgICAgICAgICAgRVFVIFNyYzUKLVlUUjYgICAgICAgICAgICBFUVUgVG1wCi1ZVFI3ICAgICAgICAgICAgRVFVIFNyYzYKLVlUUnQgICAgICAgICAgICBFUVUgU3JjMwotCi1xQzAgICAgICAgICAgICAgUU4gIFlUUjAuUzMyICAgICAgICAgICAgICAgIDsvLyBmb3IgWVRScG9zZQotcUMxICAgICAgICAgICAgIFFOICBZVFIxLlMzMgotcUMyICAgICAgICAgICAgIFFOICBZVFIyLlMzMgotcUMzICAgICAgICAgICAgIFFOICBZVFIzLlMzMgotcUM0ICAgICAgICAgICAgIFFOICBZVFI0LlMzMgotcUM1ICAgICAgICAgICAgIFFOICBZVFI1LlMzMgotcUM2ICAgICAgICAgICAgIFFOICBZVFI2LlMzMgotcUM3ICAgICAgICAgICAgIFFOICBZVFI3LlMzMgotCi1kRDAgICAgICAgICAgICAgRE4gIFlUUjAqMisxICAgICAgICAgICAgICAgIDsvLyBmb3IgdXNpbmcgVlNXUAotZEQxICAgICAgICAgICAgIEROICBZVFIxKjIrMQotZEQyICAgICAgICAgICAgIEROICBZVFIyKjIrMQotZEQzICAgICAgICAgICAgIEROICBZVFIzKjIrMQotZEQ0ICAgICAgICAgICAgIEROICBZVFI0KjIKLWRENSAgICAgICAgICAgICBETiAgWVRSNSoyCi1kRDYgICAgICAgICAgICAgRE4gIFlUUjYqMgotZEQ3ICAgICAgICAgICAgIEROICBZVFI3KjIKLSAgICAgICAgICAKLSAgICAgICAgVlRSTiAgICAgICAgcVlmMCwgcVlmMQotICAgICAgICBWVFJOICAgICAgICBxWWYyLCBxWWYzCi0gICAgICAgIFZUUk4gICAgICAgIHFZZjQsIHFZZjUKLSAgICAgICAgVlRSTiAgICAgICAgcVlmNiwgcVlmNwotICAgICAgICBWVFJOICAgICAgICBxQzAsIHFDMgotICAgICAgICBWVFJOICAgICAgICBxQzEsIHFDMwotICAgICAgICBWVFJOICAgICAgICBxQzQsIHFDNgotICAgICAgICBWVFJOICAgICAgICBxQzUsIHFDNyAgICAgICAgCi0gICAgICAgIFZTV1AgICAgICAgIGREMCwgZEQ0Ci0gICAgICAgIFZTV1AgICAgICAgIGREMSwgZEQ1Ci0gICAgICAgIFZTV1AgICAgICAgIGREMiwgZEQ2Ci0gICAgICAgIFZTV1AgICAgICAgIGREMywgZEQ3Ci0KLSAgICAgICAgCi1kWWYwVTggICAgICAgICAgRE4gWVRSMCoyLlU4Ci1kWWYxVTggICAgICAgICAgRE4gWVRSMSoyLlU4Ci1kWWYyVTggICAgICAgICAgRE4gWVRSMioyLlU4Ci1kWWYzVTggICAgICAgICAgRE4gWVRSMyoyLlU4Ci1kWWY0VTggICAgICAgICAgRE4gWVRSNCoyLlU4Ci1kWWY1VTggICAgICAgICAgRE4gWVRSNSoyLlU4Ci1kWWY2VTggICAgICAgICAgRE4gWVRSNioyLlU4Ci1kWWY3VTggICAgICAgICAgRE4gWVRSNyoyLlU4Ci0gICAgICAgIAotICAgICAgICA7Ly8KLSAgICAgICAgOy8vIERvIHNhdHVyYXRpb24gaWYgb3V0c2l6ZSBpcyBvdGhlciB0aGFuIFMxNgotICAgICAgICA7Ly8KLSAgICAgICAgCi0gICAgICAgIElGICgiJG91dHNpemUiPSJ1OCIpCi0gICAgICAgICAgICA7Ly8gT3V0cHV0IHJhbmdlIFswLTI1NV0KLSAgICAgICAgICAgIFZRTU9WTiAgICAgICAgICAgIGRZZjBVOCwgcVlmMAotICAgICAgICAgICAgVlFNT1ZOICAgICAgICAgICAgZFlmMVU4LCBxWWYxCi0gICAgICAgICAgICBWUU1PVk4gICAgICAgICAgICBkWWYyVTgsIHFZZjIKLSAgICAgICAgICAgIFZRTU9WTiAgICAgICAgICAgIGRZZjNVOCwgcVlmMwotICAgICAgICAgICAgVlFNT1ZOICAgICAgICAgICAgZFlmNFU4LCBxWWY0Ci0gICAgICAgICAgICBWUU1PVk4gICAgICAgICAgICBkWWY1VTgsIHFZZjUKLSAgICAgICAgICAgIFZRTU9WTiAgICAgICAgICAgIGRZZjZVOCwgcVlmNgotICAgICAgICAgICAgVlFNT1ZOICAgICAgICAgICAgZFlmN1U4LCBxWWY3Ci0gICAgICAgIEVORElGCi0gICAgICAgIAotICAgICAgICBJRiAoIiRvdXRzaXplIj0iczkiKQotICAgICAgICAgICAgOy8vIE91dHB1dCByYW5nZSBbLTI1NiB0byArMjU1XQotICAgICAgICAgICAgVlFTSEwgICAgICAgICAgICBxWWYwLCBxWWYwLCAjMTYtOQotICAgICAgICAgICAgVlFTSEwgICAgICAgICAgICBxWWYxLCBxWWYxLCAjMTYtOQotICAgICAgICAgICAgVlFTSEwgICAgICAgICAgICBxWWYyLCBxWWYyLCAjMTYtOQotICAgICAgICAgICAgVlFTSEwgICAgICAgICAgICBxWWYzLCBxWWYzLCAjMTYtOQotICAgICAgICAgICAgVlFTSEwgICAgICAgICAgICBxWWY0LCBxWWY0LCAjMTYtOQotICAgICAgICAgICAgVlFTSEwgICAgICAgICAgICBxWWY1LCBxWWY1LCAjMTYtOQotICAgICAgICAgICAgVlFTSEwgICAgICAgICAgICBxWWY2LCBxWWY2LCAjMTYtOQotICAgICAgICAgICAgVlFTSEwgICAgICAgICAgICBxWWY3LCBxWWY3LCAjMTYtOQotICAgICAgICAgICAgCi0gICAgICAgICAgICBWU0hSICAgICAgICAgICAgIHFZZjAsIHFZZjAsICMxNi05Ci0gICAgICAgICAgICBWU0hSICAgICAgICAgICAgIHFZZjEsIHFZZjEsICMxNi05Ci0gICAgICAgICAgICBWU0hSICAgICAgICAgICAgIHFZZjIsIHFZZjIsICMxNi05Ci0gICAgICAgICAgICBWU0hSICAgICAgICAgICAgIHFZZjMsIHFZZjMsICMxNi05Ci0gICAgICAgICAgICBWU0hSICAgICAgICAgICAgIHFZZjQsIHFZZjQsICMxNi05Ci0gICAgICAgICAgICBWU0hSICAgICAgICAgICAgIHFZZjUsIHFZZjUsICMxNi05Ci0gICAgICAgICAgICBWU0hSICAgICAgICAgICAgIHFZZjYsIHFZZjYsICMxNi05Ci0gICAgICAgICAgICBWU0hSICAgICAgICAgICAgIHFZZjcsIHFZZjcsICMxNi05Ci0gICAgICAgIEVORElGCi0KLSAgICAgICAgOy8vIFN0b3JlIG91dHB1dCBkZXBlbmRpbmcgb24gdGhlIFN0cmlkZSBzaXplCi0gICAgICAgIElGICIkc3RyaWRlIj0icyIKLSAgICAgICAgICAgIFZTVDEgICAgICAgIHFZZjAsIFtwRGVzdCBANjRdLCBTdHJpZGUKLSAgICAgICAgICAgIFZTVDEgICAgICAgIHFZZjEsIFtwRGVzdCBANjRdLCBTdHJpZGUKLSAgICAgICAgICAgIFZTVDEgICAgICAgIHFZZjIsIFtwRGVzdCBANjRdLCBTdHJpZGUKLSAgICAgICAgICAgIFZTVDEgICAgICAgIHFZZjMsIFtwRGVzdCBANjRdLCBTdHJpZGUKLSAgICAgICAgICAgIFZTVDEgICAgICAgIHFZZjQsIFtwRGVzdCBANjRdLCBTdHJpZGUKLSAgICAgICAgICAgIFZTVDEgICAgICAgIHFZZjUsIFtwRGVzdCBANjRdLCBTdHJpZGUKLSAgICAgICAgICAgIFZTVDEgICAgICAgIHFZZjYsIFtwRGVzdCBANjRdLCBTdHJpZGUKLSAgICAgICAgICAgIFZTVDEgICAgICAgIHFZZjcsIFtwRGVzdCBANjRdICAgICAgICAgICAgCi0gICAgICAgIEVMU0UKLSAgICAgICAgICAgIElGICgiJG91dHNpemUiPSJ1OCIpCi0gICAgICAgICAgICAgICAgVlNUMSAgICAgICAgZFlmMFU4LCBbcERlc3QgQDY0XSwgIzgKLSAgICAgICAgICAgICAgICBWU1QxICAgICAgICBkWWYxVTgsIFtwRGVzdCBANjRdLCAjOAotICAgICAgICAgICAgICAgIFZTVDEgICAgICAgIGRZZjJVOCwgW3BEZXN0IEA2NF0sICM4Ci0gICAgICAgICAgICAgICAgVlNUMSAgICAgICAgZFlmM1U4LCBbcERlc3QgQDY0XSwgIzgKLSAgICAgICAgICAgICAgICBWU1QxICAgICAgICBkWWY0VTgsIFtwRGVzdCBANjRdLCAjOAotICAgICAgICAgICAgICAgIFZTVDEgICAgICAgIGRZZjVVOCwgW3BEZXN0IEA2NF0sICM4Ci0gICAgICAgICAgICAgICAgVlNUMSAgICAgICAgZFlmNlU4LCBbcERlc3QgQDY0XSwgIzgKLSAgICAgICAgICAgICAgICBWU1QxICAgICAgICBkWWY3VTgsIFtwRGVzdCBANjRdCi0gICAgICAgICAgICBFTFNFCi0gICAgICAgICAgICAgICAgOy8vICgiJG91dHNpemUiPSJzOSIpIG9yICgiJG91dHNpemUiPSJzMTYiKQotICAgICAgICAgICAgICAgIFZTVDEgICAgICAgIHFZZjAsIFtwRGVzdCBANjRdLCAjMTYKLSAgICAgICAgICAgICAgICBWU1QxICAgICAgICBxWWYxLCBbcERlc3QgQDY0XSwgIzE2Ci0gICAgICAgICAgICAgICAgVlNUMSAgICAgICAgcVlmMiwgW3BEZXN0IEA2NF0sICMxNgotICAgICAgICAgICAgICAgIFZTVDEgICAgICAgIHFZZjMsIFtwRGVzdCBANjRdLCAjMTYKLSAgICAgICAgICAgICAgICBWU1QxICAgICAgICBxWWY0LCBbcERlc3QgQDY0XSwgIzE2Ci0gICAgICAgICAgICAgICAgVlNUMSAgICAgICAgcVlmNSwgW3BEZXN0IEA2NF0sICMxNgotICAgICAgICAgICAgICAgIFZTVDEgICAgICAgIHFZZjYsIFtwRGVzdCBANjRdLCAjMTYKLSAgICAgICAgICAgICAgICBWU1QxICAgICAgICBxWWY3LCBbcERlc3QgQDY0XQotICAgICAgICAgICAgRU5ESUYKLSAgICAgICAgCi0gICAgICAgIEVORElGCi0KLQotCi0gICAgICAgIEVORElGIDsvLyBDb3J0ZXhBOAotCi0KLQotICAgICAgICBNRU5EICAgICAgICAKLQotICAgICAgICA7Ly8gU2NhbGUgVFdPIGlucHV0IHJvd3Mgd2l0aCBUV08gcm93cyBvZiAxNiBiaXQgc2NhbGUgdmFsdWVzCi0gICAgICAgIDsvLwotICAgICAgICA7Ly8gVGhpcyBtYWNybyBpcyB1c2VkIGJ5IE1fSURDVF9QUkVTQ0FMRTE2IHRvIHByZS1zY2FsZSBvbmUgcm93Ci0gICAgICAgIDsvLyBpbnB1dCAoRWlnaHQgaW5wdXQgdmFsdWVzKSB3aXRoIG9uZSByb3cgb2Ygc2NhbGUgdmFsdWVzLiBBb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gUHJlIHNjYWxlIHJvdyAwICYgMQotICAgICAgICBNX0lEQ1RfU0NBTEUxNiBkWGoybG8sIGRYajJoaSwgZFhqM2xvLCBkWGozaGksIDAgICAgICAgIAotICAgICAgICBNX0lEQ1RfU0NBTEUxNiBkWGo0bG8sIGRYajRoaSwgZFhqNWxvLCBkWGo1aGksIDAgICAgICAgIAotICAgICAgICBNX0lEQ1RfU0NBTEUxNiBkWGo2bG8sIGRYajZoaSwgZFhqN2xvLCBkWGo3aGksIDEgICAgICAgIAotICAgICAgICBWSEFERCAgICAgICBxWGk1LCBxWGoxLCBxWGo3ICAgICAgICAgICAgOy8vIChqMStqNykvMgotICAgICAgICBWU1VCICAgICAgICBxWGk2LCBxWGoxLCBxWGo3ICAgICAgICAgICAgOy8vIGoxLWo3Ci0gICAgICAgIExEUiAgICAgICAgIHBTcmMsID1hcm1DT01NX0lEQ1RDb2VmIDsvLyBBZGRyZXNzIG9mIERDVCBpbnZlcnNlIEFBTiBjb25zdGFudHMKLSAgICAgICAgVkhBREQgICAgICAgcVhpMywgcVhqMiwgcVhqNiAgICAgICAgICAgIDsvLyAoajIrajYpLzIKLSAgICAgICAgVlNVQiAgICAgICAgcVhpMiwgcVhqMiwgcVhqNiAgICAgICAgICAgIDsvLyBqMi1qNgotICAgICAgICBWTERSICAgICAgICBkQ29lZnMsIFtwU3JjXSAgICAgICAgICAgICAgOy8vIExvYWQgRENUIGludmVyc2UgQUFOIGNvbnN0YW50cwotICAgICAgICBWSEFERCAgICAgICBxWGk3LCBxWGo1LCBxWGozICAgICAgICAgICAgOy8vIChqNStqMykvMgotICAgICAgICBWU1VCICAgICAgICBxWGk0LCBxWGo1LCBxWGozICAgICAgICAgICAgOy8vIGo1LWozCi0gICAgICAgIE1FTkQgICAgCi0gICAgICAgIAotICAgICAgICAKLSAgICAgICAgOy8vIFNjYWxlIDh4OCBibG9jayBpbnB1dCB2YWx1ZXMgd2l0aCAzMiBiaXQgc2NhbGUgdmFsdWVzCi0gICAgICA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TiBxU3JjMWhpCi1xU3JjN2xvICAgICAgICAgUU4gcVNyYzBsbwotcVNyYzdoaSAgICAgICAgIFFOIHFTcmMwaGkKLQotcVJlczE3bG8gICAgICAgIFFOIHFTY2FsZTBsbwotcVJlczE3aGkgICAgICAgIFFOIHFTY2FsZTBoaQotcVJlczI2bG8gICAgICAgIFFOIHFTY2FsZTBsbwotcVJlczI2aGkgICAgICAgIFFOIHFTY2FsZTBoaQotcVJlczUzbG8gICAgICAgIFFOIHFTY2FsZTBsbwotcVJlczUzaGkgICAgICAgIFFOIHFTY2FsZTBoaQotCi0gICAgICAgICAgICBBREQgICAgICAgICBwVGVtcCwgcFNjYWxlLCAjNCo4KjcgICAgICAgICAgIDsvLyBBZGRyZXNzIG9mICBwU2NhbGVbN10KLSAgICAgICAgICAgIAotICAgICAgICAgICAgOy8vIFJvdyAwCi0gICAgICAgICAgICBWTEQxICAgICAgICB7cVNjYWxlMGxvLCBxU2NhbGUwaGl9LCBbcFNjYWxlXSEKLSAgICAgICAgICAgIFZTSExMICAgICAgIHFTcmMwbG8sIGRYajBsbywgIygxMi0xKQotICAgICAgICAgICAgVlNITEwgICAgICAgcVNyYzBoaSwgZFhqMGhpLCAjKDEyLTEpICAgICAgICAgICAgCi0gICAgICAgICAgICBWTEQxICAgICAgICB7cVNjYWxlMWxvLCBxU2NhbGUxaGl9LCBbcFNjYWxlXSEKLSAgICAgICAgICAgIFZRUkRNVUxIICAgIHFTcmMwbG8sIHFTY2FsZTBsbywgcVNyYzBsbwotICAgICAgICAgICAgVlFSRE1VTEggICAgcVNyYzBoaSwgcVNjYWxlMGhpLCBxU3JjMGhpCi0gICAgICAgICAgICBWTEQxICAgICAgICB7cVNjYWxlN2xvLCBxU2NhbGU3aGl9LCBbcFRlbXBdIQotICAgICAgICAgICAgVlNITEwgICAgICAgcVNyYzFsbywgZFhqMWxvLCAjKDEyLTEpCi0gICAgICAgICAgICBWU0hMTCAgICAgICBxU3JjMWhpLCBkWGoxaGksICMoMTItMSkgICAgICAgICAgICAKLSAgICAgICAgICAgIFZNT1ZOICAgICAgIGRYaTBsbywgcVNyYzBsbyAgICAgICAgICAgICAgICAgOy8vIE91dHB1dCBpMAotICAgICAgICAgICAgVk1PVk4gICAgICAgZFhpMGhpLCBxU3JjMGhpCi0gICAgICAgICAgICBWU0hMTCAgICAgICBxU3JjN2xvLCBkWGo3bG8sICMoMTItMSkKLSAgICAgICAgICAgIFZTSExMICAgICAgIHFTcmM3aGksIGRYajdoaSwgIygxMi0xKQotICAgICAgICAgICAgU1VCICAgICAgICAgcFRlbXAsIHBUZW1wLCAjKCgxNioyKSsoNCo4KjEpKQotICAgICAgICAgICAgVlFSRE1VTEggICAgcVNyYzFsbywgcVNjYWxlMWxvLCBxU3JjMWxvCi0gICAgICAgICAgICBWUVJETVVMSCAgICBxU3JjMWhpLCBxU2NhbGUxaGksIHFTcmMxaGkKLSAgICAgICAgICAgIFZRUkRNVUxIICAgIHFTcmM3bG8sIHFTY2FsZTdsbywgcVNyYzdsbwotICAgICAgICAgICAgVlFSRE1VTEggICAgcVNyYzdoaSwgcVNjYWxlN2hpLCBxU3JjN2hpCi0gICAgICAgICAgICBWTEQxICAgICAgICB7cVNjYWxlMmxvLCBxU2NhbGUyaGl9LCBbcFNjYWxlXSEKLQotICAgICAgICAgICAgOy8vIFJvdyAxICYgNwotICAgICAgICAgICAgVkhBREQgICAgICAgcVJlczE3bG8sIHFTcmMxbG8sIHFTcmM3bG8gICAgICA7Ly8gKGoxK2o3KS8yCi0gICAgICAgICAgICBWSEFERCAgICAgICBxUmVzMTdoaSwgcVNyYzFoaSwgcVNyYzdoaSAgICAgIDsvLyAoajErajcpLzIKLSAgICAgICAgICAgIFZNT1ZOICAgICAgIGRYaTVsbywgcVJlczE3bG8gICAgICAgICAgICAgICAgOy8vIE91dHB1dCBpNQotICAgICAgICAgICAgVk1PVk4gICAgICAgZFhpNWhpLCBxUmVzMTdoaSAgICAgICAgICAgICAgCi0gICAgICAgICAgICBWU1VCICAgICAgICBxUmVzMTdsbywgcVNyYzFsbywgcVNyYzdsbyAgICAgIDsvLyBqMS1qNwotICAgICAgICAgICAgVlNVQiAgICAgICAgcVJlczE3aGksIHFTcmMxaGksIHFTcmM3aGkgICAgICA7Ly8gajEtajcKLSAgICAgICAgICAgIFZNT1ZOICAgICAgIGRYaTZsbywgcVJlczE3bG8gICAgICAgICAgICAgICAgOy8vIE91dHB1dCBpNgotICAgICAgICAgICAgVk1PVk4gICAgICAgZFhpNmhpLCBxUmVzMTdoaSAgICAgIAotICAgICAgICAgICAgVlNITEwgICAgICAgcVNyYzJsbywgZFhqMmxvLCAjKDEyLTEpCi0gICAgICAgICAgICBWU0hMTCAgICAgICBxU3JjMmhpLCBkWGoyaGksICMoMTItMSkKLSAgICAgICAgICAgIFZMRDEgICAgICAgIHtxU2NhbGU2bG8sIHFTY2FsZTZoaX0sIFtwVGVtcF0hCi0gICAgICAgICAgICBWU0hMTCAgICAgICBxU3JjNmxvLCBkWGo2bG8sICMoMTItMSkKLSAgICAgICAgICAgIFZTSExMICAgICAgIHFTcmM2aGksIGRYajZoaSwgIygxMi0xKQotICAgICAgICAgICAgU1VCICAgICAgICAgcFRlbXAsIHBUZW1wLCAjKCgxNioyKSsoNCo4KjEpKQotICAgICAgICAgICAgVlFSRE1VTEggICAgcVNyYzJsbywgcVNjYWxlMmxvLCBxU3JjMmxvCi0gICAgICAgICAgICBWUVJETVVMSCAgICBxU3JjMmhpLCBxU2NhbGUyaGksIHFTcmMyaGkKLSAgICAgICAgICAgIFZRUkRNVUxIICAgIHFTcmM2bG8sIHFTY2FsZTZsbywgcVNyYzZsbwotICAgICAgICAgICAgVlFSRE1VTEggICAgcVNyYzZoaSwgcVNjYWxlNmhpLCBxU3JjNmhpCi0gICAgICAgICAgICBWTEQxICAgICAgICB7cVNjYWxlM2xvLCBxU2NhbGUzaGl9LCBbcFNjYWxlXSEKLQotICAgICAgICAgICAgOy8vIFJvdyAyICYgNgotICAgICAgICAgICAgVkhBREQgICAgICAgcVJlczI2bG8sIHFTcmMybG8sIHFTcmM2bG8gICAgICA7Ly8gKGoyK2o2KS8yCi0gICAgICAgICAgICBWSEFERCAgICAgICBxUmVzMjZoaSwgcVNyYzJoaSwgcVNyYzZoaSAgICAgIDsvLyAoajIrajYpLzIKLSAgICAgICAgICAgIFZNT1ZOICAgICAgIGRYaTNsbywgcVJlczI2bG8gICAgICAgICAgICAgICAgOy8vIE91dHB1dCBpMwotICAgICAgICAgICAgVk1PVk4gICAgICAgZFhpM2hpLCBxUmVzMjZoaSAgICAgICAgICAgICAgCi0gICAgICAgICAgICBWU1VCICAgICAgICBxUmVzMjZsbywgcVNyYzJsbywgcVNyYzZsbyAgICAgIDsvLyBqMi1qNgotICAgICAgICAgICAgVlNVQiAgICAgICAgcVJlczI2aGksIHFTcmMyaGksIHFTcmM2aGkgICAgICA7Ly8gajItajYKLSAgICAgICAgICAgIFZNT1ZOICAgICAgIGRYaTJsbywgcVJlczI2bG8gICAgICAgICAgICAgICAgOy8vIE91dHB1dCBpMgotICAgICAgICAgICAgVk1PVk4gICAgICAgZFhpMmhpLCBxUmVzMjZoaSAgICAgIAotICAgICAgICAgICAgVlNITEwgICAgICAgcVNyYzNsbywgZFhqM2xvLCAjKDEyLTEpCi0gICAgICAgICAgICBWU0hMTCAgICAgICBxU3JjM2hpLCBkWGozaGksICMoMTItMSkKLSAgICAgICAgICAgIFZMRDEgICAgICAgIHtxU2NhbGU1bG8sIHFTY2FsZTVoaX0sIFtwVGVtcF0hCi0gICAgICAgICAgICBWU0hMTCAgICAgICBxU3JjNWxvLCBkWGo1bG8sICMoMTItMSkKLSAgICAgICAgICAgIFZTSExMICAgICAgIHFTcmM1aGksIGRYajVoaSwgIygxMi0xKQotICAgICAgICAgICAgVlFSRE1VTEggICAgcVNyYzNsbywgcVNjYWxlM2xvLCBxU3JjM2xvCi0gICAgICAgICAgICBWUVJETVVMSCAgICBxU3JjM2hpLCBxU2NhbGUzaGksIHFTcmMzaGkKLSAgICAgICAgICAgIFZRUkRNVUxIICAgIHFTcmM1bG8sIHFTY2FsZTVsbywgcVNyYzVsbwotICAgICAgICAgICAgVlFSRE1VTEggICAgcVNyYzVoaSwgcVNjYWxlNWhpLCBxU3JjNWhpCi0gICAgICAgICAgICAKLSAgICAgICAgICAgIDsvLyBSb3cgMyAmIDUKLSAgICAgICAgICAgIFZIQUREICAgICAgIHFSZXM1M2xvLCBxU3JjNWxvLCBxU3JjM2xvICAgICAgOy8vIChqNStqMykvMgotICAgICAgICAgICAgVkhBREQgICAgICAgcVJlczUzaGksIHFTcmM1aGksIHFTcmMzaGkgICAgICA7Ly8gKGo1K2ozKS8yCi0gICAgICAgICAgICBTVUIgICAgICAgICBwU3JjLCBwU3JjLCAjMTYqMioyCi0gICAgICAgICAgICBWTU9WTiAgICAgICBkWGk3bG8sIHFSZXM1M2xvICAgICAgICAgICAgICAgIDsvLyBPdXRwdXQgaTcKLSAgICAgICAgICAgIFZNT1ZOICAgICAgIGRYaTdoaSwgcVJlczUzaGkgICAgICAgICAgICAgIAotICAgICAgICAgICAgVlNVQiAgICAgICAgcVJlczUzbG8sIHFTcmM1bG8sIHFTcmMzbG8gICAgICA7Ly8gajUtajMKLSAgICAgICAgICAgIFZTVUIgICAgICAgIHFSZXM1M2hpLCBxU3JjNWhpLCBxU3JjM2hpICAgICAgOy8vIGo1LWozCi0gICAgICAgICAgICBWTEQxICAgICAgICBxWGo0LCBbcFNyYyBANjRdCi0gICAgICAgICAgICBWTU9WTiAgICAgICBkWGk0bG8sIHFSZXM1M2xvICAgICAgICAgICAgICAgIDsvLyBPdXRwdXQgaTQKLSAgICAgICAgICAgIFZNT1ZOICAgICAgIGRYaTRoaSwgcVJlczUzaGkgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKLSAgICAgICAgICAgIFZTSExMICAgICAgIHFTcmM0bG8sIGRYajRsbywgIygxMi0xKQotICAgICAgICAgICAgVlNITEwgICAgICAgcVNyYzRoaSwgZFhqNGhpLCAjKDEyLTEpCi0gICAgICAgICAgICBWTEQxICAgICAgICB7cVNjYWxlNGxvLCBxU2NhbGU0aGl9LCBbcFNjYWxlXSAgICAgICAgICAgIAotICAgICAgICAgICAgTERSICAgICAgICAgcFNyYywgPWFybUNPTU1fSURDVENvZWYgICAgIDsvLyBBZGRyZXNzIG9mIERDVCBpbnZlcnNlIEFBTiBjb25zdGFudHMKLSAgICAgICAgICAgIFZRUkRNVUxIICAgIHFTcmM0bG8sIHFTY2FsZTRsbywgcVNyYzRsbwotICAgICAgICAgICAgVlFSRE1VTEggICAgcVNyYzRoaSwgcVNjYWxlNGhpLCBxU3JjNGhpCi0gICAgICAgICAgICBWTERSICAgICAgICBkQ29lZnMsIFtwU3JjXSAgICAgICAgICAgICAgICAgIDsvLyBMb2FkIERDVCBpbnZlcnNlIEFBTiBjb25zdGFudHMKLSAgICAgICAgICAgIDsvLyBSb3cgNAotICAgICAgICAgICAgVk1PVk4gICAgICAgZFhpMWxvLCBxU3JjNGxvICAgICAgICAgICAgICAgICA7Ly8gT3V0cHV0IGkxCi0gICAgICAgICAgICBWTU9WTiAgICAgICBkWGkxaGksIHFTcmM0aGkgICAgICAgICAgICAgIAotICAgICAgICAKLSAgICAgICAgTUVORAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCi0gICAgICAgIEVORApkaWZmIC0tZ2l0IGEvbWVkaWEvbGlic3RhZ2VmcmlnaHQvY29kZWNzL29uMi9oMjY0ZGVjL29teGRsL2FybTExL2FwaS9hcm1DT01NX01hc2tUYWJsZS5oIGIvbWVkaWEvbGlic3RhZ2VmcmlnaHQvY29kZWNzL29uMi9oMjY0ZGVjL29teGRsL2FybTExL2FwaS9hcm1DT01NX01hc2tUYWJsZS5oCmRlbGV0ZWQgZmlsZSBtb2RlIDEwMDY0NAppbmRleCBiNWRhOWRjZS4uMDAwMDAwMAotLS0gYS9tZWRpYS9saWJzdGFnZWZyaWdodC9jb2RlY3Mvb24yL2gyNjRkZW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ICAgICA7Ly8gVGh1bWIKLSAgICAgICAgICAgIElGIF9Td0xvbmcKLSAgICAgICAgICAgICAgICBUQkggW3BjLCAkdiwgTFNMIzFdCi0gICAgICAgICAgICBFTFNFCi0gICAgICAgICAgICAgICAgVEJCIFtwYywgJHZdCi0gICAgICAgICAgICBFTkRJRgotX1N3aXRjaCRfU3dOdW0KLSAgICAgICAgRUxTRQotICAgICAgICAgICAgOy8vIEFSTQotICAgICAgICAgICAgQUREIHBjLCBwYywgJHYsIExTTCAjMgotICAgICAgICAgICAgTk9QCi0gICAgICAgIEVORElGCi0gICAgICAgIE1FTkQKLSAgICAgICAgCi0gICAgICAgIDsvLyBBZGQgYSBjYXNlIHRvIHRoZSBzd2l0Y2ggc3RhdGVtZW50Ci0gICAgICAgIE1BQ1JPCi0gICAgICAgIE1fQ0FTRSAgJGxhYmVsCi0gICAgICAgIElGIHtDT05GSUd9PTE2Ci0gICAgICAgICAgICA7Ly8gVGh1bWIKLSAgICAgICAgICAgIElGIF9Td0xvbmcKLSAgICAgICAgICAgICAgICBEQ1cgKCRsYWJlbCAtIF9Td2l0Y2gkX1N3TnVtKS8yCi0gICAgICAgICAgICBFTFNFCi0gICAgICAgICAgICAgICAgRENCICgkbGFiZWwgLSBfU3dpdGNoJF9Td051bSkvMgotICAgICAgICAgICAgRU5ESUYKLSAgICAgICAgRUxTRQotICAgICAgICAgICAgOy8vIEFSTQotICAgICAgICAgICAgQiAgICRsYWJlbAotICAgICAgICBFTkRJRgotICAgICAgICBNRU5ECi0gICAgICAgIAotICAgICAgICA7Ly8gRW5kIG9mIHN3aXRjaCBzdGF0ZW1lbnQKLSAgICAgICAgTUFDUk8KLSAgICAgICAgTV9FTkRTV0lUQ0gKLSAgICAgICAgQUxJR04gMgotICAgICAgICBNRU5EICAgICAgIAotCi0KLTsvLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLwotOy8vIERhdGEgYXJl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JsZWQgZm9yIChlZyBUaHVtYikgdGhlbiBhIHN1aXRhYmxlCi0gICAgICAgIDsvLyAgICBhZGRyZXNzaW5nIG1vZGUgaXMgc3Vic3RpdHV0ZWQuCi0gICAgICAgIDsvLwotICAgICAgICA7Ly8gT24gRW50cnk6Ci0gICAgICAgIDsvLyAkaSA9IEluc3RydWN0aW9uIHRvIHBlcmZvcm0gKGVnICJMRFJCIikKLSAgICAgICAgOy8vICRhID0gUmVxdWlyZWQgYnl0ZSBhbGlnbm1lbnQKLSAgICAgICAgOy8vICRyID0gUmVnaXN0ZXIocykgdG8gdHJhbnNmZXIgKGVnICJyMSIpCi0gICAgICAgIDsvLyAkYTAsJGExLCRhMi4gQWRkcmVzc2luZyBtb2RlIGFuZCBjb25kaXRpb24uIE9uZSBvZjoKLSAgICAgICAgOy8vICAgICBsYWJlbCB7LGNjfQotICAgICAgICA7Ly8gICAgIFtiYXNlXSAgICAgICAgICAgICAgICAgICAgeywsLGNjfQotICAgICAgICA7Ly8gICAgIFtiYXNlLCBvZmZzZXRdeyF9ICAgICAgICAgeywsY2N9Ci0gICAgICAgIDsvLyAgICAgW2Jhc2UsIG9mZnNldCwgc2hpZnRdeyF9ICB7LGNjfQotICAgICAgICA7Ly8gICAgIFtiYXNlXSwgb2Zmc2V0ICAgICAgICAgICAgeywsY2N9Ci0gICAgICAgIDsvLyAgICAgW2Jhc2VdLCBvZmZzZXQsIHNoaWZ0ICAgICB7LGNjfQotICAgICAgICBNQUNSTwotICAgICAgICBfTV9EQVRBICRpLCRhLCRyLCRhMCwkYTEsJGEyLCRhMwotICAgICAgICBJRiAiJGEwIjpMRUZUOjE9IlsiCi0gICAgICAgICAgICBJRiAiJGExIj0iIgotICAgICAgICAgICAgICAgICRpJGEzICAgJHIsICRhMAotICAgICAgICAgICAgRUxTRQotICAgICAgICAgICAgICAgIElGICIkYTAiOlJJR0hUOjE9Il0iCi0gICAgICAgICAgICAgICAgICAgIElGICIkYTIiPSIiCi0gICAgICAgICAgICAgICAgICAgICAgICBfTV9QT1NUSU5EICRpJGEzLCAiJHIiLCAkYTAsICRhMQotICAgICAgICAgICAgICAgICAgICBFTFNFCi0gICAgICAgICAgICAgICAgICAgICAgICBfTV9QT1NUSU5EICRpJGEzLCAiJHIiLCAkYTAsICIkYTEsJGEyIgotICAgICAgICAgICAgICAgICAgICBFTkRJRgotICAgICAgICAgICAgICAgIEVMU0UKLSAgICAgICAgICAgICAgICAgICAgSUYgIiRhMiI9IiIKLSAgICAgICAgICAgICAgICAgICAgICAgIF9NX1BSRUlORCAgJGkkYTMsICIkciIsICRhMCwgJGExCi0gICAgICAgICAgICAgICAgICAgIEVMU0UKLSAgICAgICAgICAgICAgICAgICAgICAgIF9NX1BSRUlORCAgJGkkYTMsICIkciIsICRhMCwgIiRhMSwkYTIiCi0gICAgICAgICAgICAgICAgICAgIEVORElGCi0gICAgICAgICAgICAgICAgRU5ESUYKLSAgICAgICAgICAgIEVORElGCi0gICAgICAgIEVMU0UKLSAgICAgICAgICAgIExDTEEgICAgX09mZnNldAotX09mZnNldCAgICAgU0VUQSAgICBfV29ya3NwYWNlICsgJGEwJF9GCi0gICAgICAgICAgICBBU1NFUlQgIChfT2Zmc2V0OkFORDooJGEtMSkpPTAKLSAgICAgICAgICAgICRpJGExICAgJHIsIFtzcCwgI19PZmZzZXRdCi0gICAgICAgIEVORElGCi0gICAgICAgIE1FTkQKLSAgICAgICAgCi0gICAgICAgIDsvLyBIYW5kbGUgcG9zdCBpbmRleGVkIGxvYWQvc3RvcmVzCi0gICAgICAgIDsvLyBvcCAgcmVnLCBbYmFzZV0sIG9mZnNldAotICAgICAgICBNQUNSTwotICAgICAgICBfTV9QT1NUSU5EICRpLCRyLCRhMCwkYTEKLSAgICAgICAgTENMUyBfYmFzZQotICAgICAgICBMQ0xTIF9vZmZzZXQKLSAgICAgICAgSUYge0NPTkZJR309MTYgOy8vIFRodW1iCi1fYmFzZSAgICAgICBTRVRTICgiJGEwIjpMRUZUOig6TEVOOiIkYTAiLTEpKTpSSUdIVDooOkxFTjoiJGEwIi0yKSAgIDsvLyByZW1vdmUgW10KLV9vZmZzZXQgICAgIFNFVFMgIiRhMSIKLSAgICAgICAgICAgIElGIF9vZmZzZXQ6TEVGVDoxPSIrIgotX29mZnNldCAgICAgICAgIFNFVFMgX29mZnNldDpSSUdIVDooOkxFTjpfb2Zmc2V0LTEpCi0gICAgICAgICAgICBFTkRJRgotICAgICAgICAgICAgJGkgICRyLCAkYTAKLSAgICAgICAgICAgIElGIF9vZmZzZXQ6TEVGVDoxPSItIgotX29mZnNldCAgICAgICAgIFNFVFMgX29mZnNldDpSSUdIVDooOkxFTjpfb2Zmc2V0LTEpCi0gICAgICAgICAgICAgICAgU1VCICRfYmFzZSwgJF9iYXNlLCAkX29mZnNldAotICAgICAgICAgICAgRUxTRSAgICAgICAgICAgICAgICAKLSAgICAgICAgICAgICAgICBBREQgJF9iYXNlLCAkX2Jhc2UsICRfb2Zmc2V0Ci0gICAgICAgICAgICBFTkRJRgotICAgICAgICBFTFNFIDsvLyBBUk0KLSAgICAgICAgICAgICRpICAkciwgJGEwLCAkYTEKLSAgICAgICAgRU5ESUYKLSAgICAgICAgTUVORAotICAgICAgICAKLSAgICAgICAgOy8vIEhhbmRsZSBwcmUgaW5kZXhlZCBsb2FkL3N0b3JlCi0gICAgICAgIDsvLyBvcCAgcmVnLCBbYmFzZSwgb2Zmc2V0XXshfQotICAgICAgICBNQUNSTwotICAgICAgICBfTV9QUkVJTkQgJGksJHIsJGEwLCRhMQotICAgICAgICBMQ0xTIF9iYXNlCi0gICAgICAgIExDTFMgX29mZnNldAotICAgICAgICBJRiAoe0NPTkZJR309MTYpOkxBTkQ6KCgiJGExIjpSSUdIVDoyKT0iXSEiKQotX2Jhc2UgICAgICAgU0VUUyAiJGEwIjpSSUdIVDooOkxFTjooIiRhMCIpLTEpCi1fb2Zmc2V0ICAgICBTRVRTICIkYTEiOkxFRlQ6KDpMRU46KCIkYTEiKS0yKQotICAgICAgICAgICAgJGkgJHIsIFskX2Jhc2UsICRfb2Zmc2V0XQotICAgICAgICAgICAgQUREICRfYmFzZSwgJF9iYXNlLCAkX29mZnNldAotICAgICAgICBFTFNFCi0gICAgICAgICAgICAkaSAgJHIsICRhMCwgJGExCi0gICAgICAgIEVORElGCi0gICAgICAgIE1FTkQKLQotICAgICAgICA7Ly8gTG9hZCB1bnNpZ25lZCBieXRlIGZyb20gc3RhY2sKLSAgICAgICAgTUFDUk8KLSAgICAgICAgTV9MRFJCICAkciwkYTAsJGExLCRhMiwkYTMKLSAgICAgICAgX01fREFUQSAiTERSQiIsMSwkciwkYTAsJGExLCRhMiwkYTMKLSAgICAgICAgTUVORAotICAgICAgICAKLSAgICAgICAgOy8vIExvYWQgc2lnbmVkIGJ5dGUgZnJvbSBzdGFjawotICAgICAgICBNQUNSTwotICAgICAgICBNX0xEUlNCICRyLCRhMCwkYTEsJGEyLCRhMwotICAgICAgICBfTV9EQVRBICJMRFJTQiIsMSwkciwkYTAsJGExLCRhMiwkYTMKLSAgICAgICAgTUVORAotICAgICAgICAKLSAgICAgICAgOy8vIFN0b3JlIGJ5dGUgdG8gc3RhY2sKLSAgICAgICAgTUFDUk8KLSAgICAgICAgTV9TVFJCICAkciwkYTAsJGExLCRhMiwkYTMKLSAgICAgICAgX01fREFUQSAiU1RSQiIsMSwkciwkYTAsJGExLCRhMiwkYTMKLSAgICAgICAgTUVORAotICAgICAgICAKLSAgICAgICAgOy8vIExvYWQgdW5zaWduZWQgaGFsZiB3b3JkIGZyb20gc3RhY2sKLSAgICAgICAgTUFDUk8KLSAgICAgICAgTV9MRFJIICAkciwkYTAsJGExLCRhMiwkYTMKLSAgICAgICAgX01fREFUQSAiTERSSCIsMiwkciwkYTAsJGExLCRhMiwkYTMKLSAgICAgICAgTUVORAotICAgICAgICAKLSAgICAgICAgOy8vIExvYWQgc2lnbmVkIGhhbGYgd29yZCBmcm9tIHN0YWNrCi0gICAgICAgIE1BQ1JPCi0gICAgICAgIE1fTERSU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BBQVBDUwotICAgICAgICA7Ly8gc3RhdGVzIHRoYXQgcjQtcjExLCBzcCwgZDgtZDE1IG11c3QgYmUgcHJlc2VydmVkIGJ5Ci0gICAgICAgIDsvLyBhIGNvbXBsaWFudCBmdW5jdGlvbi4KLSAgICAgICAgTUFDUk8KLSAgICAgICAgTV9TVEFSVCAkbmFtZSwgJHJyZWcsICRkcmVnCi0gICAgICAgIEFTU0VSVCA6TE5PVDpfSW5GdW5jCi0gICAgICAgIEFTU0VSVCAiJG5hbWUiIT0iIgotX0luRnVuYyBTRVRMIHtUUlVFfQotX1JCeXRlcyBTRVRBIDAKLV9Xb3Jrc3BhY2UgU0VUQSAwCi0KLSAgICAgICAgOy8vIENyZWF0ZSBhbiBhcmVhIGZvciB0aGUgZnVuY3Rpb24gICAgICAgIAotICAgICAgICBBUkVBICAgIHwudGV4dHwsIENPREUKLSAgICAgICAgRVhQT1JUICAkbmFtZQotJG5hbWUgICBGVU5DVElPTgotICAgICAgICAKLSAgICAgICAgOy8vIFNhdmUgUiByZWdpc3RlcnMKLSAgICAgICAgX01fR0VUUlJFR0xJU1QgJHJyZWcKLSAgICAgICAgSUYgX1JSZWdMaXN0PD4iIgotICAgICAgICAgICAgU1RNRkQgICBzcCEsIHskX1JSZWdMaXN0LCBscn0KLSAgICAgICAgRU5ESUYKLSAgICAgICAgICAgICAgICAKLSAgICAgICAgOy8vIFNhdmUgRCByZWdpc3RlcnMKLSAgICAgICAgX01fR0VURFJFR0xJU1QgICRkcmVnICAgICAgICAKLSAgICAgICAgSUYgX0RSZWdMaXN0PD4iIgotICAgICAgICAgICAgVlNUTUZEICBzcCEsIHskX0RSZWdMaXN0fQotICAgICAgICBFTkRJRiAgICAgICAgICAgIAotICAgICAgICAgICAgCi0gICAgICAgICAgICAgICAgICAgIAotICAgICAgICA7Ly8gRW5zdXJlIHNpemUgY2xhaW1lZCBvbiBzdGFjayBpcyA4LWJ5dGUgYWxpZ25lZAotICAgICAgICBJRiAoKF9TQnl0ZXM6QU5EOjcpIT0wKQotX1NCeXRlcyAgICAgU0VUQSBfU0J5dGVzICsgKDggLSAoX1NCeXRlczpBTkQ6NykpCi0gICAgICAgIEVORElGCi0gICAgICAgIAotICAgICAgICBJRiAoX1NCeXRlcyE9MCkKLSAgICAgICAgICAgIF9NX09QQyBTVUIsIHNwLCBzcCwgX1NCeXRlcwotICAgICAgICBFTkRJRgotICAgICAgICAKLSAgICAgICAgCi1fQUJ5dGVzIFNFVEEgX1NCeXRlcyArIF9SQnl0ZXMgLSBfV29ya3NwYWNlCi0KLSAgICAgICAgICAgICAgICAgICAgICAgIAotICAgICAgICA7Ly8gUHJpbnQgZnVuY3Rpb24gbmFtZSBpZiBkZWJ1ZyBlbmFibGVkCi0gICAgICAgIE1fUFJJTlRGICIkbmFtZVxuIiwKLSAgICAgICAgTUVORAotICAgICAgICAKLSAgICAgICAgOy8vIFdvcmsgb3V0IGEgbGlzdCBvZiBSIHNhdmVkIHJlZ2lzdGVycwotICAgICAgICBNQUNSTwotICAgICAgICBfTV9HRVRSUkVHTElTVCAkcnJlZwotICAgICAgICBJRiAiJHJyZWciPSIiCi1fUlJlZ0xpc3QgICBTRVRTICIiCi0gICAgICAgICAgICBNRVhJVAotICAgICAgICBFTkRJRiAgICAgICAgCi0gICAgICAgIElGICIkcnJlZyI9ImxyIjpMT1I6IiRycmVnIj0icjQiCi1fUlJlZ0xpc3QgICBTRVRTICJyNCIKLV9SQnl0ZXMgICAgIFNFVEEgX1JCeXRlcys4Ci0gICAgICAgICAgICBNRVhJVAotICAgICAgICBFTkRJRgotICAgICAgICBJRiAiJHJyZWciPSJyNSI6TE9SOiIkcnJlZyI9InI2IgotX1JSZWdMaXN0ICAgU0VUUyAicjQtcjYiCi1fUkJ5dGVzICAgICBTRVRBIF9SQnl0ZXMrMTYKLSAgICAgICAgICAgIE1FWElUCi0gICAgICAgIEVORElGCi0gICAgICAgIElGICIkcnJlZyI9InI3IjpMT1I6IiRycmVnIj0icjgiCi1fUlJlZ0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gICAgICAgOy8vIFJlc3RvcmUgdGhlIHN0YWNrIHBvaW50ZXIgdG8gaXRzIG9yaWdpbmFsIHZhbHVlIG9uIGZ1bmN0aW9uIGVudHJ5Ci0gICAgICAgIElGIF9TQnl0ZXMhPTAKLSAgICAgICAgICAgIF9NX09QQyBBREQsIHNwLCBzcCwgX1NCeXRlcwotICAgICAgICBFTkRJRgotICAgICAgICBfTV9SRVQKLSAgICAgICAgRU5ERlVOQwotCi0gICAgICAgIDsvLyBSZXNldCB0aGUgZ2xvYmFsIHN0YWNrIHRyYWNraW5nIHZhcmlhYmxlcyBiYWNrIHRvIHRoZWlyIAotICAgICAgICA7Ly8gaW5pdGlhbCB2YWx1ZXMsIGFuZCBpbmNyZW1lbnQgdGhlIGZ1bmN0aW9uIGNvdW50Ci1fU0J5dGVzICAgICAgICBTRVRBIDAKLV9GICAgICAgICAgICAgIFNFVEEgX0YrMQotICAgICAgICBNRU5ECi0KLSAgICAgICAgICAgICAgICAKLTsvLz09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09Ci07Ly8gRGVidWcgTWFjcm9zCi07Ly89PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQotCi0gICAgICAgIEdCTEwgICAgREVCVUdfT04KLURFQlVHX09OIFNFVEwgICB7RkFMU0V9Ci0gICAgICAgIEdCTEwgICAgREVCVUdfU1RBTExTX09OCi1ERUJVR19TVEFMTFNfT04gU0VUTCB7RkFMU0V9Ci0gICAgICAgIAotICAgICAgICA7Ly89PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQotICAgICAgICA7Ly8gRGVidWcgY2FsbCB0byBwcmludGYKLSAgICAgICAgOy8vICBNX1BSSU5URiAkZm9ybWF0LCAkdmFsMCwgJHZhbDEsICR2YWwyCi0gICAgICAgIDsvLwotICAgICAgICA7Ly8gRXhhbXBsZXM6Ci0gICAgICAgIDsvLyAgTV9QUklOVEYgIng9JTA4eFxuIiwgcjAKLSAgICAgICAgOy8vCi0gICAgICAgIDsvLyBUaGlzIG1hY3JvIHByZXNlcnZlcyB0aGUgdmFsdWUgb2YgYWxsIHJlZ2lzdGVycyBpbmNsdWRpbmcgdGhlCi0gICAgICAgIDsvLyBmbGFncy4KLSAgICAgICAgOy8vPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KLQotICAgICAgICBNQUNSTwotICAgICAgICBNX1BSSU5URiAgJGZvcm1hdCwgJHZhbDAsICR2YWwxLCAkdmFsMgotICAgICAgICBJRiBERUJVR19PTgotICAgICAgICAKLSAgICAgICAgSU1QT1JUICBwcmludGYKLSAgICAgICAgTENMQSAgICBuQXJncwotbkFyZ3MJU0VUQSAgICAwCi0gICAgICAgIAotICAgICAgICA7Ly8gc2F2ZSByZWdpc3RlcnMgc28gd2UgZG9uJ3QgY29ycnVwdCB0aGVtCi0gICAgICAgIFNUTUZEICAgc3AhLCB7cjAtcjEyLCBscn0KLSAgICAgICAgCi0gICAgICAgIDsvLyBEcm9wIHN0YWNrIHRvIGdpdmUgdXMgc29tZSB3b3Jrc3BhY2UKLSAgICAgICAgU1VCICAgICBzcCwgc3AsICMxNgotICAgICAgICAKLSAgICAgICAgOy8vIFNhdmUgcmVnaXN0ZXJzIHdlIG5lZWQgdG8gcHJpbnQgdG8gdGhlIHN0YWNrCi0gICAgICAgIElGICIkdmFsMiIgPD4gIiIKLSAgICAgICAgICAgIEFTU0VSVCAiJHZhbDEiIDw+ICIiCi0gICAgICAgICAgICBTVFIgICAgJHZhbDIsIFtzcCwgIzhdCi1uQXJncyAgICAgICBTRVRBICAgbkFyZ3MrMQotICAgICAgICBFTkRJRgotICAgICAgICBJRiAiJHZhbDEiIDw+ICIiCi0gICAgICAgICAgICBBU1NFUlQgIiR2YWwwIiA8PiAiIgotICAgICAgICAgICAgU1RSICAgICR2YWwxLCBbc3AsICM0XQotbkFyZ3MJICAgIFNFVEEgICBuQXJncysxCi0gICAgICAgIEVORElGCi0gICAgICAgIElGICIkdmFsMCI8PiIiCi0gICAgICAgICAgICBTVFIgICAgJHZhbDAsIFtzcF0KLW5BcmdzCSAgICBTRVRBICAgbkFyZ3MrMQotICAgICAgICBFTkRJRgotICAgICAgICAKLSAgICAgICAgOy8vIE5vdyB3ZSBhcmUgc2FmZSB0byBjb3JydXB0IHJlZ2lzdGVycwotICAgICAgICBBRFIgICAgIHIwLCAlRlQwMAotICAgICAgICBJRiBuQXJncz0xCi0gICAgICAgICAgTERSICAgcjEsIFtzcF0KLSAgICAgICAgRU5ESUYKLSAgICAgICAgSUYgbkFyZ3M9MgotICAgICAgICAgIExETUlBIHNwLCB7cjEscjJ9Ci0gICAgICAgIEVORElGCi0gICAgICAgIElGIG5BcmdzPTMKLSAgICAgICAgICBMRE1JQSBzcCwge3IxLHIyLHIzfQotICAgICAgICBFTkRJRgotICAgICAgICAKLSAgICAgICAgOy8vIHByaW50IHRoZSB2YWx1ZXMKLSAgICAgICAgTVJTICAgICByNCwgY3BzciAgICAgICAgOy8vIHByZXNlcnZlIGZsYWdzCi0gICAgICAgIEJMICAgICAgcHJpbnRmCi0gICAgICAgIE1TUiAgICAgY3Bzcl9mLCByNCAgICAgIDsvLyByZXN0b3JlIGZsYWdzCi0gICAgICAgIEIgICAgICAgJUZUMDEKLTAwICAgICAgOy8vIHN0cmluZyB0byBwcmludAotICAgICAgICBEQ0IgICAgICIkZm9ybWF0IiwgMAotICAgICAgICBBTElHTgotMDEgICAgICA7Ly8gRmluaXNoZWQKLSAgICAgICAgQUREICAgICBzcCwgc3AsICMxNgotICAgICAgICA7Ly8gUmVzdG9yZSByZWdpc3RlcnMKLSAgICAgICAgTERNRkQJc3AhLCB7cjAtcjEyLGxyfQotCi0gICAgICAgIEVORElGIC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IElGIDpERUY6JF9wbAotICAgICAgICAgICAgICAgIElGICRfcGwKLSAgICAgICAgICAgICAgICAgICAgTENMUyBfc3QKLSAgICAgICAgICAgICAgICAgICAgTENMQSBfc3RudW0KLV9zdCAgICAgICAgICAgICAgICAgU0VUUyAiJHBsYXRzdGFsbCI6UklHSFQ6MSAgICAgICAgCi1fc3RudW0gICAgICAgICAgICAgIFNFVEEgJF9zdAotICAgICAgICAgICAgICAgICAgICBXSElMRSBfc3RudW0+MAotCQkJTU9WIHNwLCBzcAotX3N0bnVtICAgICAgICAgICAgICAgICAgU0VUQSBfc3RudW0gLSAxCi0gICAgICAgICAgICAgICAgICAgIFdFTkQKLSAgICAgICAgICAgICAgICBFTkRJRgotICAgICAgICAgICAgRU5ESUYKLSAgICAgICAgRU5ESUYKLSAgICAgICAgTUVORAotICAgICAgICAKLSAgICAgICAgCi0gICAgICAgIAotOy8vPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KLTsvLyBFbmRpYW4gSW52YXJpZW5jZSBNYWNyb3MKLTsvLyAKLTsvLyBUaGUgaWRlYSBiZWhpbmQgdGhlc2UgbWFjcm9zIGlzIHRoYXQgaWYgYW4gYXJyYXkgaXMKLTsvLyBsb2FkZWQgYXMgd29yZHMgdGhlbiB0aGUgU01VTDAwIG1hY3JvIHdpbGwgbXVsdGlwbHkKLTsvLyBhcnJheSBlbGVtZW50cyAwIHJlZ2FyZGxlc3Mgb2YgdGhlIGVuZGlhbmVzcyBvZiB0aGUKLTsvLyBzeXN0ZW0uIEZvciBsaXR0bGUgZW5kaWFuIFNNVUwwMD1TTVVMQkIsIGZvciBiaWcKLTsvLyBlbmRpYW4gU01VTDAwPVNNVUxUVCBhbmQgc2ltaWxhcmx5IGZvciBvdGhlciBwYWNrZWQgb3BlcmF0aW9ucy4KLTsvLwotOy8vPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KLQotICAgICAgICBNQUNSTwotICAgICAgICBMSUJJNCAgICRjb21saSwgJGNvbWJpLCAkYSwgJGIsICRjLCAkZCwgJGNjCi0gICAgICAgIElGIHtFTkRJQU59PSJiaWciCi0gICAgICAgICRjb21iaS4kY2MgJGEsICRiLCAkYywgJGQKLSAgICAgICAgRUxTRQotICAgICAgICAkY29tbGkuJGNjICRhLCAkYiwgJGMsICRkCi0gICAgICAgIEVORElGCi0gICAgICAgIE1FTkQKLSAgICAgICAgCi0gICAgICAgIE1BQ1JPCi0gICAgICAgIExJQkkzICAgJGNvbWxpLCAkY29tYmksICRhLCAkYiwgJGMsICRjYwotICAgICAgICBJRiB7RU5ESUFOfT0iYmlnIgotICAgICAgICAkY29tYmkuJGNjICRhLCAkYiwgJGMKLSAgICAgICAgRUxTRQotICAgICAgICAkY29tbGkuJGNjICRhLCAkYiwgJGMKLSAgICAgICAgRU5ESUYKLSAgICAgICAgTUVORAotICAgICAgICAKLSAgICAgICAgOy8vIFNNTEF4eSBtYWNyb3MKLSAgICAgICAgCi0gICAgICAgIE1BQ1JPCi0gICAgICAgIFNNTEEwMCAgJGEsICRiLCAkYywgJGQsICRjYwotICAgICAgICBMSUJJNCBTTUxBQkIsIFNNTEFUVCwgJGEsICRiLCAkYywgJGQsICRjYwotICAgICAgICBNRU5ECi0gICAgICAgIAotICAgICAgICBNQUNSTwotICAgICAgICBTTUxBMDEgICRhLCAkYiwgJGMsICRkLCAkY2MKLSAgICAgICAgTElCSTQgU01MQUJULCBTTUxBVEIsICRhLCAkYiwgJGMsICRkLCAkY2MKLSAgICAgICAgTUVORAotICAgICAgICAKLSAgICAgICAgTUFDUk8KLSAgICAgICAgU01MQTBCICAkYSwgJGIsICRjLCAkZCwgJGNjCi0gICAgICAgIExJQkk0IFNNTEFCQiwgU01MQVRCLCAkYSwgJGIsICRjLCAkZCwgJGNjCi0gICAgICAgIE1FTkQKLSAgICAgICAgCi0gICAgICAgIE1BQ1JPCi0gICAgICAgIFNNTEEwVCAgJGEsICRiLCAkYywgJGQsICRjYwotICAgICAgICBMSUJJNCBTTUxBQlQsIFNNTEFUVCwgJGEsICRiLCAkYywgJGQsICRjYwotICAgICAgICBNRU5ECi0gICAgICAgIAotICAgICAgICBNQUNSTwotICAgICAgICBTTUxBMTAgICRhLCAkYiwgJGMsICRkLCAkY2MKLSAgICAgICAgTElCSTQgU01MQVRCLCBTTUxBQlQsICRhLCAkYiwgJGMsICRkLCAkY2MKLSAgICAgICAgTUVORAotICAgICAgICAKLSAgICAgICAgTUFDUk8KLSAgICAgICAgU01MQTExICAkYSwgJGIsICRjLCAkZCwgJGNjCi0gICAgICAgIExJQkk0IFNNTEFUVCwgU01MQUJCLCAkYSwgJGIsICRjLCAkZCwgJGNjCi0gICAgICAgIE1FTkQKLSAgICAgICAgCi0gICAgICAgIE1BQ1JPCi0gICAgICAgIFNNTEExQiAgJGEsICRiLCAkYywgJGQsICRjYwotICAgICAgICBMSUJJNCBTTUxBVEIsIFNNTEFCQiwgJGEsICRiLCAkYywgJGQsICRjYwotICAgICAgICBNRU5ECi0gICAgICAgIAotICAgICAgICBNQUNSTwotICAgICAgICBTTUxBMVQgICRhLCAkYiwgJGMsICRkLCAkY2MKLSAgICAgICAgTElCSTQgU01MQVRULCBTTUxBQlQsICRhLCAkYiwgJGMsICRkLCAkY2MKLSAgICAgICAgTUVORAotICAgICAgICAKLSAgICAgICAgTUFDUk8KLSAgICAgICAgU01MQUIwICAkYSwgJGIsICRjLCAkZCwgJGNjCi0gICAgICAgIExJQkk0IFNNTEFCQiwgU01MQUJULCAkYSwgJGIsICRjLCAkZCwgJGNjCi0gICAgICAgIE1FTkQKLSAgICAgICAgCi0gICAgICAgIE1BQ1JPCi0gICAgICAgIFNNTEFCMSAgJGEsICRiLCAkYywgJGQsICRjYwotICAgICAgICBMSUJJNCBTTUxBQlQsIFNNTEFCQiwgJGEsICRiLCAkYywgJGQsICRjYwotICAgICAgICBNRU5ECi0gICAgICAgIAotICAgICAgICBNQUNSTwotICAgICAgICBTTUxBVDAgICRhLCAkYiwgJGMsICRkLCAkY2MKLSAgICAgICAgTElCSTQgU01MQVRCLCBTTUxBVFQsICRhLCAkYiwgJGMsICRkLCAkY2MKLSAgICAgICAgTUVORAotICAgICAgICAKLSAgICAgICAgTUFDUk8KLSAgICAgICAgU01MQVQxICAkYSwgJGIsICRjLCAkZCwgJGNjCi0gICAgICAgIExJQkk0IFNNTEFUVCwgU01MQVRCLCAkYSwgJGIsICRjLCAkZCwgJGNjCi0gICAgICAgIE1FTkQKLSAgICAgICAgCi0gICAgICAgIDsvLyBTTVVMeHkgbWFjcm9zCi0gICAgICAgIAotICAgICAgICBNQUNSTwotICAgICAgICBTTVVMMDAgICRhLCAkYiwgJGMsICRjYwotICAgICAgICBMSUJJMyBTTVVMQkIsIFNNVUxUVCwgJGEsICRiLCAkYywgJGNjCi0gICAgICAgIE1FTkQKLSAgICAgICAgCi0gICAgICAgIE1BQ1JPCi0gICAgICAgIFNNVUwwMSAgJGEsICRiLCAkYywgJGNjCi0gICAgICAgIExJQkkzIFNNVUxCVCwgU01VTFRCLCAkYSwgJGIsICRjLCAkY2MKLSAgICAgICAgTUVORAotICAgICAgICAKLSAgICAgICAgTUFDUk8KLSAgICAgICAgU01VTDBCICAkYSwgJGIsICRjLCAkY2MKLSAgICAgICAgTElCSTMgU01VTEJCLCBTTVVMVEIsICRhLCAkYiwgJGMsICRjYwotICAgICAgICBNRU5ECi0gICAgICAgIAotICAgICAgICBNQUNSTwotICAgICAgICBTTVVMMFQgICRhLCAkYiwgJGMsICRjYwotICAgICAgICBMSUJJMyBTTVVMQlQsIFNNVUxUVCwgJGEsICRiLCAkYywgJGNjCi0gICAgICAgIE1FTkQKLSAgICAgICAgCi0gICAgICAgIE1BQ1JPCi0gICAgICAgIFNNVUwxMCAgJGEsICRiLCAkYywgJGNjCi0gICAgICAgIExJQkkzIFNNVUxUQiwgU01VTEJULCAkYSwgJGIsICRjLCAkY2MKLSAgICAgICAgTUVORAotICAgICAgICAKLSAgICAgICAgTUFDUk8KLSAgICAgICAgU01VTDExICAkYSwgJGIsICRjLCAkY2MKLSAgICAgICAgTElCSTMgU01VTFRULCBTTVVMQkIsICRhLCAkYiwgJGMsICRjYwotICAgICAgICBNRU5ECi0gICAgICAgIAotICAgICAgICBNQUNSTwotICAgICAgICBTTVVMMUIgICRhLCAkYiwgJGMsICRjYwotICAgICAgICBMSUJJMyBTTVVMVEIsIFNNVUxCQiwgJGEsICRiLCAkYywgJGNjCi0gICAgICAgIE1FTkQKLSAgICAgICAgCi0gICAgICAgIE1BQ1JPCi0gICAgICAgIFNNVUwxVCAgJGEsICRiLCAkYywgJGNjCi0gICAgICAgIExJQkkzIFNNVUxUVCwgU01VTEJULCAkYSwgJGIsICRjLCAkY2MKLSAgICAgICAgTUVORAotICAgICAgICAKLSAgICAgICAgTUFDUk8KLSAgICAgICAgU01VTEIwICAkYSwgJGIsICRjLCAkY2MKLSAgICAgICAgTElCSTMgU01VTEJCLCBTTVVMQlQsICRhLCAkYiwgJGMsICRjYwotICAgICAgICBNRU5ECi0gICAgICAgIAotICAgICAgICBNQUNSTwotICAgICAgICBTTVVMQjEgICRhLCAkYiwgJGMsICRjYwotICAgICAgICBMSUJJMyBTTVVMQlQsIFNNVUxCQiwgJGEsICRiLCAkYywgJGNjCi0gICAgICAgIE1FTkQKLSAgICAgICAgCi0gICAgICAgIE1BQ1JPCi0gICAgICAgIFNNVUxUMCAgJGEsICRiLCAkYywgJGNjCi0gICAgICAgIExJQkkzIFNNVUxUQiwgU01VTFRULCAkYSwgJGIsICRjLCAkY2MKLSAgICAgICAgTUVORAotICAgICAgICAKLSAgICAgICAgTUFDUk8KLSAgICAgICAgU01VTFQxICAkYSwgJGIsICRjLCAkY2MKLSAgICAgICAgTElCSTMgU01VTFRULCBTTVVMVEIsICRhLCAkYiwgJGMsICRjYwotICAgICAgICBNRU5ECi0gICAgICAgIAotICAgICAgICA7Ly8gU01MQVd4LCBTTVVMV3ggbWFjcm9zCi0gICAgICAgIAotICAgICAgICBNQUNSTwotICAgICAgICBTTUxBVzAgICRhLCAkYiwgJGMsICRkLCAkY2MKLSAgICAgICAgTElCSTQgU01MQVdCLCBTTUxBV1QsICRhLCAkYiwgJGMsICRkLCAkY2MKLSAgICAgICAgTUVORAotICAgICAgICAKLSAgICAgICAgTUFDUk8KLSAgICAgICAgU01MQVcxICAkYSwgJGIsICRjLCAkZCwgJGNjCi0gICAgICAgIExJQkk0IFNNTEFXVCwgU01MQVdCLCAkYSwgJGIsICRjLCAkZCwgJGNjCi0gICAgICAgIE1FTkQKLSAgICAgICAgCi0gICAgICAgIE1BQ1JPCi0gICAgICAgIFNNVUxXMCAgJGEsICRiLCAkYywgJGNjCi0gICAgICAgIExJQkkzIFNNVUxXQiwgU01VTFdULCAkYSwgJGIsICRjLCAkY2MKLSAgICAgICAgTUVORAotICAgICAgICAKLSAgICAgICAgTUFDUk8KLSAgICAgICAgU01VTFcxICAkYSwgJGIsICRjLCAkY2MKLSAgICAgICAgTElCSTMgU01VTFdULCBTTVVMV0IsICRhLCAkYiwgJGMsICRjYwotICAgICAgICBNRU5ECi0KLSAgICAgICAgOy8vIFNNTEFMeHkgbWFjcm9zCi0KLQotICAgICAgICBNQUNSTwotICAgICAgICBTTUxBTDAwICAkYSwgJGIsICRjLCAkZCwgJGNjCi0gICAgICAgIExJQkk0IFNNTEFMQkIsIFNNTEFMVFQsICRhLCAkYiwgJGMsICRkLCAkY2MKLSAgICAgICAgTUVORAotICAgICAgICAKLSAgICAgICAgTUFDUk8KLSAgICAgICAgU01MQUwwMSAgJGEsICRiLCAkYywgJGQsICRjYwotICAgICAgICBMSUJJNCBTTUxBTEJULCBTTUxBTFRCLCAkYSwgJGIsICRjLCAkZCwgJGNjCi0gICAgICAgIE1FTkQKLSAgICAgICAgCi0gICAgICAgIE1BQ1JPCi0gICAgICAgIFNNTEFMMEIgICRhLCAkYiwgJGMsICRkLCAkY2MKLSAgICAgICAgTElCSTQgU01MQUxCQiwgU01MQUxUQiwgJGEsICRiLCAkYywgJGQsICRjYwotICAgICAgICBNRU5ECi0gICAgICAgIAotICAgICAgICBNQUNSTwotICAgICAgICBTTUxBTDBUICAkYSwgJGIsICRjLCAkZCwgJGNjCi0gICAgICAgIExJQkk0IFNNTEFMQlQsIFNNTEFMVFQsICRhLCAkYiwgJGMsICRkLCAkY2MKLSAgICAgICAgTUVORAotICAgICAgICAKLSAgICAgICAgTUFDUk8KLSAgICAgICAgU01MQUwxMCAgJGEsICRiLCAkYywgJGQsICRjYwotICAgICAgICBMSUJJNCBTTUxBTFRCLCBTTUxBTEJULCAkYSwgJGIsICRjLCAkZCwgJGNjCi0gICAgICAgIE1FTkQKLQotICAgICAgICBNQUNSTwotICAgICAgICBTTUxBTDExICAkYSwgJGIsICRjLCAkZCwgJGNjCi0gICAgICAgIExJQkk0IFNNTEFMVFQsIFNNTEFMQkIsICRhLCAkYiwgJGMsICRkLCAkY2MKLSAgICAgICAgTUVORAotICAgICAgICAKLSAgICAgICAgTUFDUk8KLSAgICAgICAgU01MQUwxQiAgJGEsICRiLCAkYywgJGQsICRjYwotICAgICAgICBMSUJJNCBTTUxBTFRCLCBTTUxBTEJCLCAkYSwgJGIsICRjLCAkZCwgJGNjCi0gICAgICAgIE1FTkQKLSAgICAgICAgCi0gICAgICAgIE1BQ1JPCi0gICAgICAgIFNNTEFMMVQgICRhLCAkYiwgJGMsICRkLCAkY2MKLSAgICAgICAgTElCSTQgU01MQUxUVCwgU01MQUxCVCwgJGEsICRiLCAkYywgJGQsICRjYwotICAgICAgICBNRU5ECi0gICAgICAgIAotICAgICAgICBNQUNSTwotICAgICAgICBTTUxBTEIwICAkYSwgJGIsICRjLCAkZCwgJGNjCi0gICAgICAgIExJQkk0IFNNTEFMQkIsIFNNTEFMQlQsICRhLCAkYiwgJGMsICRkLCAkY2MKLSAgICAgICAgTUVORAotICAgICAgICAKLSAgICAgICAgTUFDUk8KLSAg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BQ01QM19NRENUSW52X1MzMiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIE9NWENBVEJBUihBQ01QM19NRENUSW52X1MzMiwgT01YQUNNUDNfU1VGRklYKQotI2RlZmluZSBvbXhBQ01QM19SZVF1YW50aXplX1MzMl9JICAgICAgICAgICAgICAgICAgICAgICAgIE9NWENBVEJBUihBQ01QM19SZVF1YW50aXplX1MzMl9JLCBPTVhBQ01QM19TVUZGSVgpCi0jZGVmaW5lIG9teEFDTVAzX1JlUXVhbnRpemVTZmJfUzMyX0kgICAgICAgICAgICAgICAgICAgICAgT01YQ0FUQkFSKEFDTVAzX1JlUXVhbnRpemVTZmJfUzMyX0ksIE9NWEFDTVAzX1NVRkZJWCkKLSNkZWZpbmUgb214QUNNUDNfU3ludGhQUU1GX1MzMl9TMTYgICAgICAgICAgICAgICAgICAgICAgICBPTVhDQVRCQVIoQUNNUDNfU3ludGhQUU1GX1MzMl9TMTYsIE9NWEFDTVAzX1NVRkZJWCkKLSNkZWZpbmUgb214QUNNUDNfVW5wYWNrRnJhbWVIZWFkZXIgICAgICAgICAgICAgICAgICAgICAgICBPTVhDQVRCQVIoQUNNUDNfVW5wYWNrRnJhbWVIZWFkZXIsIE9NWEFDTVAzX1NVRkZJWCkKLSNkZWZpbmUgb214QUNNUDNfVW5wYWNrU2NhbGVGYWN0b3JzX1M4ICAgICAgICAgICAgICAgICAgICBPTVhDQVRCQVIoQUNNUDNfVW5wYWNrU2NhbGVGYWN0b3JzX1M4LCBPTVhBQ01QM19TVUZGSVgpCi0jZGVmaW5lIG9teEFDTVAzX1VucGFja1NpZGVJbmZvICAgICAgICAgICAgICAgICAgICAgICAgICAgT01YQ0FUQkFSKEFDTVAzX1VucGFja1NpZGVJbmZvLCBPTVhBQ01QM19TVUZGSVgpCi0KLSNkZWZpbmUgb214SUNKUF9Db3B5RXhwYW5kX1U4X0MzICAgICAgICAgICAgICAgICAgICAgICAgICBPTVhDQVRCQVIoSUNKUF9Db3B5RXhwYW5k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YKQotI2RlZmluZSBvbXhJUFBQX01vbWVudEluaXQgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIE9NWENBVEJBUihJUFBQX01vbWVudEluaXQsIE9NWElQUFBfU1VGRklYKQotI2RlZmluZSBvbXhJUFBQX01vbWVudHNfVThfQzFSICAgICAgICAgICAgICAgICAgICAgICAgICAgIE9NWENBVEJBUihJUFBQX01vbWVudHNfVThfQzFSLCBPTVhJUFBQX1NVRkZJWCkKLSNkZWZpbmUgb214SVBQUF9Nb21lbnRzX1U4X0MzUiAgICAgICAgICAgICAgICAgICAgICAgICAgICBPTVhDQVRCQVIoSVBQUF9Nb21lbnRzX1U4X0MzUiwgT01YSVBQUF9TVUZGSVgpCi0KLSNkZWZpbmUgb214U1BfQmxvY2tFeHBfUzE2ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBPTVhDQVRCQVIoU1BfQmxvY2tFeHBfUzE2LCBPTVhTUF9TVUZGSVgpCi0jZGVmaW5lIG9teFNQX0Jsb2NrRXhwX1MzMiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgT01YQ0FUQkFSKFNQX0Jsb2NrRXhwX1MzMiwgT01YU1BfU1VGRklYKQotI2RlZmluZSBvbXhTUF9Db3B5X1MxNiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIE9NWENBVEJBUihTUF9Db3B5X1MxNiwgT01YU1BfU1VGRklYKQotI2RlZmluZSBvbXhTUF9Eb3RQcm9kX1MxNiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIE9NWENBVEJBUihTUF9Eb3RQcm9kX1MxNiwgT01YU1BfU1VGRklYKQotI2RlZmluZSBvbXhTUF9Eb3RQcm9kX1MxNl9TZnMgICAgICAgICAgICAgICAgICAgICAgICAgICAgIE9NWENBVEJBUihTUF9Eb3RQcm9kX1MxNl9TZnMsIE9NWFNQX1NVRkZJWCkKLSNkZWZpbmUgb214U1BfRkZURndkX0NUb0NfU0MxNl9TZnMgICAgICAgICAg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cHk4eDggICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBPTVhDQVRCQVIoVkNDT01NX0NvcHk4eDgsIE9NWFZDQ09NTV9TVUZGSVgpCi0jZGVmaW5lIG9teFZDQ09NTV9FeHBhbmRGcmFtZV9JICAgICAgICAgICAgICAgICAgICAgICAgICAgT01YQ0FUQkFSKFZDQ09NTV9FeHBhbmRGcmFtZV9JLCBPTVhWQ0NPTU1fU1VGRklYKQotI2RlZmluZSBvbXhWQ0NPTU1fTGltaXRNVlRvUmVjdCAgICAgICAgICAgICAgICAgICAgICAgICAgIE9NWENBVEJBUihWQ0NPTU1fTGltaXRNVlRvUmVjdCwgT01YVkNDT01NX1NVRkZJWCkKLSNkZWZpbmUgb214VkNDT01NX1NBRF8xNnggICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBPTVhDQVRCQVIoVkNDT01NX1NBRF8xNngsIE9NWFZDQ09NTV9TVUZGSVgpCi0jZGVmaW5lIG9teFZDQ09NTV9TQURfOHggICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgT01YQ0FUQkFSKFZDQ09NTV9TQURfOHgsIE9NWFZDQ09NTV9TVUZGSVgpCi0KLSNkZWZpbmUgb214VkNNNFAxMF9BdmVyYWdlXzR4ICAgICAgICAgICAgICAgICAgICAgICAgICAgICBPTVhDQVRCQVIoVkNNNFAxMF9BdmVyYWdlXzR4LCBPTVhWQ000UDEwX1NVRkZJWCkKLSNkZWZpbmUgb214VkNNNFAxMF9CbG9ja01hdGNoX0hhbGYgICAgICAgICAgICAgICAgICAgICAgICBPTVhDQVRCQVIoVkNNNFAxMF9CbG9ja01hdGNoX0hhbGYsIE9NWFZDTTRQMTBfU1VGRklYKQotI2RlZmluZSBvbXhWQ000UDEwX0Jsb2NrTWF0Y2hfSW50ZWdlciAgICAgICAgICAgICAgICAgICAgIE9NWENBVEJBUihWQ000UDEwX0Jsb2NrTWF0Y2hfSW50ZWdlciwgT01YVkNNNFAxMF9TVUZGSVgpCi0jZ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gICBPTVhDQVRCQVIoVkNNNFAxMF9Nb3Rpb25Fc3RpbWF0aW9uTUIsIE9NWFZDTTRQMTBfU1VGRklYKQotI2RlZmluZSBvbXhWQ000UDEwX1ByZWRpY3RJbnRyYV8xNngxNiAgICAgICAgICAgICAgICAgICAgIE9NWENBVEJBUihWQ000UDEwX1ByZWRpY3RJbnRyYV8xNngxNiwgT01YVkNNNFAxMF9TVUZGSVgpCi0jZGVmaW5lIG9teFZDTTRQMTBfUHJlZGljdEludHJhXzR4NCAgICAgICAgICAgICAgICAgICAgICAgT01YQ0FUQkFSKFZDTTRQMTBfUHJlZGljdEludHJhXzR4NCwgT01YVkNNNFAxMF9TVUZGSVgpCi0jZGVmaW5lIG9teFZDTTRQMTBfUHJlZGljdEludHJhQ2hyb21hXzh4OCAgICAgICAgICAgICAgICAgIE9NWENBVEJBUihWQ000UDEwX1ByZWRpY3RJbnRyYUNocm9tYV84eDgsIE9NWFZDTTRQMTBfU1VGRklYKQotI2RlZmluZSBvbXhWQ000UDEwX1NBRF80eCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIE9NWENBVEJBUihWQ000UDEwX1NBRF80eCwgT01YVkNNNFAxMF9TVUZGSVgpCi0jZGVmaW5lIG9teFZDTTRQMTBfU0FEUXVhcl8xNnggICAgICAgICAgICAgICAgICAgICAgICAgICAgT01YQ0FUQkFSKFZDTTRQMTBfU0FEUXVhcl8xNngsIE9NWFZDTTRQMTBfU1VGRklYKQotI2RlZmluZSBvbXhWQ000UDEwX1NBRFF1YXJfNHggICAgICAgICAgICAgICAgICAgICAgICAgICAgIE9NWENBVEJBUihWQ000UDEwX1NBRFF1YXJfNHgsIE9NWFZDTTRQMTBfU1VGRklYKQotI2RlZmluZSBvbXhWQ000UDEwX1NBRFF1YXJfOHggICAgICAgICAgICAgICAgICAgICAgICAgICAgIE9NWENBVEJBUihWQ000UDEwX1NBRFF1YXJfOHgsIE9NWFZDTTRQMTBfU1VGRklYKQotI2RlZmluZSBvbXhW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gICAgICAgICAgICAgICAgICAgICAgT01YQ0FUQkFSKFZDTTRQMl9GaW5kTVZwcmVkLCBPTVhWQ000UDJfU1VGRklYKQotI2RlZmluZSBvbXhWQ000UDJfSURDVDh4OGJsayAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIE9NWENBVEJBUihWQ000UDJfSURDVDh4OGJsaywgT01YVkNNNFAyX1NVRkZJWCkKLSNkZWZpbmUgb214VkNNNFAyX01DUmVjb25CbG9jayAgICAgICAgICAgICAgICAgICAgICAgICAgICBPTVhDQVRCQVIoVkNNNFAyX01DUmVjb25CbG9jaywgT01YVkNNNFAyX1NVRkZJWCkKLSNkZWZpbmUgb214VkNNNFAyX01FR2V0QnVmU2l6ZSAgICAgICAgICAgICAgICAgICAgICAgICAgICBPTVhDQVRCQVIoVkNNNFAyX01FR2V0QnVmU2l6ZSwgT01YVkNNNFAyX1NVRkZJWCkKLSNkZWZpbmUgb214VkNNNFAyX01FSW5pdCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBPTVhDQVRCQVIoVkNNNFAyX01FSW5pdCwgT01YVkNNNFAyX1NVRkZJWCkKLSNkZWZpbmUgb214VkNNNFAyX01vdGlvbkVzdGltYXRpb25NQiAgICAgICAgICAgICAgICAgICAgICBPTVhDQVRCQVIoVkNNNFAyX01vdGlvbkVzdGltYXRpb25NQiwgT01YVkNNNFAyX1NVRkZJWCkKLSNkZWZpbmUgb214VkNNNFAyX1ByZWRpY3RSZWNvbkNvZWZJbnRyYSAgICAgICAgICAgICAgICAgICBPTVhDQVRCQVIoVkNNNFAyX1ByZWRpY3RSZWNvbkNvZWZJbnRyYSwgT01YVkNNNFAyX1NVRkZJWCkKLSNkZWZpbmUgb214VkNNNFAyX1F1YW50SW50ZXJfSSAgICAgICAgICAgICAgICAgICAgICAgICAgICBPTVhDQVRCQVIoVkNNNFAyX1F1YW50SW50ZXJfSSwgT01YVkNNNFAyX1NVRkZJWCkKLSNkZWZpbmUgb214VkNNNFAyX1F1YW50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NWF9TdHNBQ0FBQ19UbnNEaXJlY3RFcnIgICAgICAgID0gLTE1MiwgIC8qIEFBQzogSW52YWxpZCBUTlMgZmlsdGVyIGRpcmVjdGlvbiAgKi8gIAotCi0gICAgT01YX1N0c0lDSlBfSlBFR01hcmtlckVyciAgICAgICAgPSAtMTgzLCAgLyogSlBFRyBtYXJrZXIgZW5jb3VudGVyZWQgd2l0aGluIGFuIGVudHJvcHktY29kZWQgYmxvY2s7ICovCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLyogSHVmZm1hbiBkZWNvZGluZyBvcGVyYXRpb24gdGVybWluYXRlZCBlYXJseS4gICAgICAgICAgICovCi0gICAgT01YX1N0c0lDSlBfSlBFR01hcmtlciAgICAgICAgICAgPSAtMTgxLCAgLyogSlBFRyBtYXJrZXIgZW5jb3VudGVyZWQ7IEh1ZmZtYW4gZGVjb2RpbmcgKi8KLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvKiBvcGVyYXRpb24gdGVybWluYXRlZCBlYXJseS4gICAgICAgICAgICAgICAgICAgICAgICAgKi8KLSAgICBPTVhfU3RzSVBQUF9Db250ZXh0TWF0Y2hFcnIgICAgICA9IC0xNywgICAvKiBDb250ZXh0IHBhcmFtZXRlciBkb2Vzbid0IG1hdGNoIHRvIHRoZSBvcGVyYXRpb24gKi8KLQotICAgIE9NWF9TdHNTUF9FdmVuTWVkaWFuTWFza1NpemVFcnIgID0gLTE4MCwgIC8qIEV2ZW4gc2l6ZSBvZiB0aGUgTWVkaWFuIEZpbHRlciBtYXNrIHdhcyByZXBsYWNlZCBieSB0aGUgb2RkIG9uZSAqLwotCi0gICAgT01YX1N0c19NYXhpbXVtRW51bWVyYXRpb24gICAgICAgPSBJTlRfTUFYICAvKlBsYWNlaG9sZGVyLCBmb3JjZXMgZW51bSBvZiBzaXplIE9NWF9JTlQqLwotICAgIAotIH0gT01YUmVzdWx0OyAgICAgICAgICAvKi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kCi0gKgotICogUmV0dXJuIFZhbHVlOgotICogW291dF0gY29udmVydGVkIHZhbHVlIGluIE9NWF9TMTYgZm9ybWF0Ci0gKgotICovCi0KLU9NWF9TMTYgYXJtU2F0Um91bmRGbG9hdFRvUzE2IChPTVhfRjY0IFZhbHVlKQotewotICAgIGlmIChWYWx1ZSA+IDApCi0gICAgewotICAgICAgICBWYWx1ZSArPSAwLjU7Ci0gICAgICAgIAotICAgICAgICBpZihWYWx1ZSA+IChPTVhfUzE2KU9NWF9NQVhfUzE2ICkKLSAgICAgICAgewotICAgICAgICAgICAgcmV0dXJuIChPTVhfUzE2KU9NWF9NQVhfUzE2OwotICAgICAgICB9Ci0gICAgICAgIGVsc2UKLSAgICAgICAgewotICAgICAgICAgICAgcmV0dXJuIChPTVhfUzE2KVZhbHVlOwotICAgICAgICB9Ci0gICAgfQotICAgIGVsc2UKLSAgICB7Ci0gICAgICAgIFZhbHVlIC09IDAuNTsKLQotICAgICAgICBpZihWYWx1ZSA8IChPTVhfUzE2KU9NWF9NSU5fUzE2ICkKLSAgICAgICAgewotICAgICAgICAgICAgcmV0dXJuIChPTVhfUzE2KU9NWF9NSU5fUzE2OwotICAgICAgICB9Ci0gICAgICAgIGVsc2UKLSAgICAgICAgewotICAgICAgICAgICAgcmV0dXJuIChPTVhfUzE2KVZhbHVlOwotICAgICAgICB9Ci0gICAgfQotfQotCi0vKioKLSAqIEZ1bmN0aW9uOiBhcm1TYXRSb3VuZEZsb2F0VG9TMzIKLSAqCi0gKiBEZXNjcmlwdGlvbjoKLSAqIENvbnZlcnRzIGEgZG91YmxlIHByZWNpc2lvbiB2YWx1ZSBpbnRvIGEgaW50IGFmdGVyIHJvdW5kaW5nIGFuZCBzYXR1cmF0aW9uCi0gKgotICogUGFyYW1ldGVyczoKLSAqIFtpbl0gIFZhbHVlICAgICAgICAgICAgICAgICBGbG9hdCB2YWx1ZSB0byBiZSBjb252ZXJ0ZWQKLSAqCi0gKiBSZXR1cm4gVmFsdWU6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3IgKCBpID0gMDsgdmFsdWUgPiAwOyB2YWx1ZSA9IHZhbHVlID4+IDEpIAotICAgIHsKLSAgICAgICAgaSsrOwotICAgIH0KLSAgICByZXR1cm4gaTsKLX0KLQotLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotICAgICAgICAgICAgICAgIC8qIFNhdHVyYXRpbmcgQXJpdGhtZXRpYyBvcGVyYXRpb25zICovCi0KLS8qKgotICogRnVuY3Rpb24gOmFybVNhdEFkZF9TMzIoKQotICoKLSAqIERlc2NyaXB0aW9uIDoKLSAqICAgUmV0dXJucyB0aGUgcmVzdWx0IG9mIHNhdHVyYXRlZCBhZGRpdGlvbiBvZiB0aGUgdHdvIGlucHV0cyBWYWx1ZTEsIFZhbHVlMgotICoKLSAqIFBhcmFtZXRyczoKLSAqIFtpbl0gVmFsdWUxICAgICAgIEZpcnN0IE9wZXJhbmQKLSAqIFtpbl0gVmFsdWUyICAgICAgIFNlY29uZCBPcGVyYW5kCi0gKgotICogUmV0dXJuOgotICogW291dF0gICAgICAgICAgICAgUmVzdWx0IG9mIG9wZXJhdGlvbgotICogCi0gKiAgICAKLSAqKi8KLSAKLU9NWF9TMzIgYXJtU2F0QWRkX1MzMihPTVhfUzMyIFZhbHVlMSxPTVhfUzMyIFZhbHVlMikKLXsKLSAgICBPTVhfUzMyIFJlc3VsdDsKLSAgICAKLSAgICBSZXN1bHQgPSBWYWx1ZTEgKyBWYWx1ZTI7Ci0KLSAgICBpZiggKFZhbHVlMV5WYWx1ZTIpID49IDApCi0gICAgewotICAgICAgICAvKlNhbWUgc2lnbiovCi0gICAgICAgIGlmKCAoUmVzdWx0XlZhbHVlMSkgPj0gMCkKLSAgICAgICAgewotICAgICAgICAgICAgLypSZXN1bHQgaGFzIG5vdCBzYXR1cmF0ZWQqLwotICAgICAgICAgICAgcmV0dXJuIFJlc3VsdDsKLSAgICAgICAgfQotICAgICAgICBlbH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AgIFNlY29uZCBPcGVyYW5kCi0gKgotICogUmV0dXJuOgotICogW291dF0gICAgICAgICAgICAgUmVzdWx0IG9mIG9wZXJhdGlvbgotICogCi0gKiovCi0KLU9NWF9TMzIgYXJtU2F0U3ViX1MzMihPTVhfUzMyIFZhbHVlMSxPTVhfUzMyIFZhbHVlMikKLXsKLSAgICBPTVhfUzMyIFJlc3VsdDsKLSAgICAKLSAgICBSZXN1bHQgPSBWYWx1ZTEgLSBWYWx1ZTI7Ci0KLSAgICBpZiggKFZhbHVlMV5WYWx1ZTIpIDwgMCkKLSAgICB7Ci0gICAgICAgIC8qT3Bwb3NpdGUgc2lnbiovCi0gICAgICAgIGlmKCAoUmVzdWx0XlZhbHVlMSkgPj0gMCkKLSAgICAgICAgewotICAgICAgICAgICAgLypSZXN1bHQgaGFzIG5vdCBzYXR1cmF0ZWQqLwotICAgICAgICAgICAgcmV0dXJuIFJlc3VsdDsKLSAgICAgICAgfQotICAgICAgICBlbHNlCi0gICAgICAgIHsKLSAgICAgICAgICAgIGlmKFZhbHVlMSA+PSAwKQotICAgICAgICAgICAgewotICAgICAgICAgICAgICAgIC8qUmVzdWx0IGhhcyBzYXR1cmF0ZWQgaW4gcG9zaXRpdmUgc2lkZSovCi0gICAgICAgICAgICAgICAgcmV0dXJuIE9NWF9NQVhfUzMyOwotICAgICAgICAgICAgfQotICAgICAgICAgICAgZWxzZQotICAgICAgICAgICAgewotICAgICAgICAgICAgICAgIC8qUmVzdWx0IGhhcyBzYXR1cmF0ZWQgaW4gbmVnYXRpdmUgc2lkZSovCi0gICAgICAgICAgICAgICAgcmV0dXJuIE9NWF9NSU5fUzMyOwotICAgICAgICAgICAgfQotICAgICAgICAKLSAgICAgICAgfQotICAgCi0gICAgfQotICAgIGVsc2UKLSAgICB7Ci0gICAgICAgIHJldHVybiBSZXN1bHQ7Ci0gICAgfQotICAgIAotfQotCi0vKioKLSAqIEZ1bmN0aW9uIDphcm1TYXRNYWNfUzMyKCkKLSAqCi0gKi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dWUgPSAocEJpdFN0cmVhbVswXSA8PCAyNCApIHwgKCBwQml0U3RyZWFtWzFdIDw8IDE2KSAgfCAocEJpdFN0cmVhbVsyXSA8PCA4ICkgfCAocEJpdFN0cmVhbVszXSkgOwotICAgIFZhbHVlID0gKFZhbHVlIDw8IE9mZnNldCApIHwgKHBCaXRTdHJlYW1bNF0gPj4gKDgtT2Zmc2V0KSk7Ci0KLSAgICAvKiBTZWFyY2ggdGhyb3VnaCB0aGUgY29kZWJvb2sgKi8gICAgCi0gICAgZm9yIChJbmRleD0wOyBwQ29kZUJvb2stPmNvZGVMZW4gIT0gMDsgSW5kZXgrKykKLSAgICB7Ci0gICAgICAgIGlmIChwQ29kZUJvb2stPmNvZGVXb3JkID09IChWYWx1ZSA+PiAoMzIgLSBwQ29kZUJvb2stPmNvZGVMZW4pKSkKLSAgICAgICAgewotICAgICAgICAgICAgT2Zmc2V0ICAgICAgID0gT2Zmc2V0ICsgcENvZGVCb29rLT5jb2RlTGVuOwotICAgICAgICAgICAgKnBwQml0U3RyZWFtID0gcEJpdFN0cmVhbSArIChPZmZzZXQgPj4gMykgOwotICAgICAgICAgICAgKnBPZmZzZXQgICAgID0gT2Zmc2V0ICYgNzsKLSAgICAgICAgICAgIAotICAgICAgICAgICAgcmV0dXJuIEluZGV4OwotICAgICAgICB9ICAgICAgICAKLSAgICAgICAgcENvZGVCb29rKys7Ci0gICAgfQotCi0gICAgLyogTm8gY29kZSBtYXRjaCBmb3VuZCAqLwotICAgIHJldHVybiBBUk1fTk9fQ09ERUJPT0tfSU5ERVg7Ci19Ci0KLSNlbmRpZgotCi0vKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCi0gKiBGaXhlZCBiaXQgbGVuZ3RoIEVuY29kZQotICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLQotLyoqCi0gKiBGdW5jdGlvbjogYXJtUGFja0JpdHMKLSAqCi0gKiBEZXNjcmlwdGlvbjoKLSAqIFBhY2sgYSBWTEMgY29kZSB3b3JkIGludG8gdGhlIGJpdHN0cmVhbQotICoKLSAqIFJlbWFya3M6Ci0gKgotICogUGFyYW1ldGVyczoKLSAqIFtpbl0gcHBCaXRTdHJlYW0gICAgIHBvaW50ZXIgdG8gdGhlIHBvaW50ZXIgdG8gdGhlIGN1cnJlbnQgYnl0ZSAKLSAqICAgICAgICAgICAgICAgICAgICAgIGluIHRoZSBiaXQgc3RyZWFtLgotICogW2luXSBwT2Zmc2V0ICAgICAgICAgcG9pbnRlciB0byB0aGUgYml0IHBvc2l0aW9uIGluIHRoZSBieXRlIAotICogICAgICAgICAgICAgICAgICAgICAgcG9pbnRlZCBieSAqcHBCaXRTdHJlYW0uIFZhbGlkIHdpdGhpbiAwCi0gKiAgICAgICAgICAgICAgICAgICAgICB0byA3LgotICogW2luXSBjb2RlV29yZCAgICAgICAgQ29kZSB3b3JkIHRoYXQgbmVlZCB0byBiZSBpbnNlcnRlZCBpbiB0byB0aGUKLSAqICAgICAgICAgICAgICAgICAgICAgICAgICBiaXRzdHJlYW0KLSAqIFtpbl0gY29kZUxlbmd0aCAgICAgIExlbmd0aCBvZiB0aGUgY29kZSB3b3JkIHZhbGlkIHJhbmdlIDEuLi4zMgotICoKLSAqIFtvdXRdIHBwQml0U3RyZWFtICAgICpwcEJpdFN0cmVhbSBpcyB1cGRhdGVkIGFmdGVyIHRoZSBibG9jayBpcyBlbmNvZGVkLAotICogICAgICAgICAgICAgICAgICAgICAgICAgIHNvIHRoYXQgaXQgcG9pbnRzIHRvIHRoZSBjdXJyZW50IGJ5dGUgaW4gdGhlIGJpdAotICogICAgICAgICAgICAgICAgICAgICAgICAgIHN0cmVhbSBidWZmZXIuCi0gKiBbb3V0XSBwQml0T2Zmc2V0ICAgICAqcEJpdE9mZnNldCBpcyB1cGRhdGVkIHNvIHRoYXQgaXQgcG9pbnRzIHRvIHRoZQotICogICAgICAgICAgICAgICAgICAgICAgICAgIGN1cnJlbnQgYml0IHBvc2l0a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ZXIgdG8gdGhlIHByZWRpY3RlZCBjb2VmZmljaWVudHMgYnVmZmVyLgotICogICAgICAgICAgICAgICAgICAgICAgICAgIEZpbGxlZCBPTkxZIGlmIGl0IGlzIG5vdCBOVUxMCi0gKiBbb3V0XSAgICBwU3JjRHN0ICAgICBwb2ludGVyIHRvIHRoZSBjb2VmZmljaWVudCBidWZmZXIgd2hpY2ggY29udGFpbnMKLSAqICAgICAgICAgICAgICAgICAgICAgICAgICB0aGUgcXVhbnRpemVkIGNvZWZmaWNpZW50cyAoUUYpIG9mIHRoZSBjdXJyZW50Ci0gKiAgICAgICAgICAgICAgICAgICAgICAgICAgYmxvY2sKLSAqIFtvdXRdICAgIHBQcmVkQnVmUm93IHBvaW50ZXIgdG8gdGhlIHVwZGF0ZWQgY29lZmZpY2llbnQgcm93IGJ1ZmZlcgotICogW291dF0gICAgcFByZWRCdWZDb2wgcG9pbnRlciB0byB0aGUgdXBkYXRlZCBjb2VmZmljaWVudCBjb2x1bW4gYnVmZmVyCi0gKiBbb3V0XSAgICBwU3VtRXJyICAgICBwb2ludGVyIHRvIHRoZSB1cGRhdGVkIHN1bSBvZiB0aGUgZGlmZmVyZW5jZQotICogICAgICAgICAgICAgICAgICAgICAgYmV0d2VlbiBwcmVkaWN0ZWQgYW5kIHVucHJlZGljdGVkIGNvZWZmaWNpZW50cwotICogICAgICAgICAgICAgICAgICAgICAgSWYgdGhpcyBpcyBOVUxMLCBkbyBub3QgdXBkYXRlCi0gKgotICogUmV0dXJuIFZhbHVlOgotICogU3RhbmRhcmQgT01YUmVzdWx0IHJlc3VsdC4gU2VlIGVudW1lcmF0aW9uIGZvciBwb3NzaWJsZSByZXN1bHQgY29kZXMuCi0gKgotICovCi0KLU9NWFJlc3VsdCBhcm1WQ000UDJfQUNEQ1ByZWRpY3QoCi0gICAgIE9NWF9TMTYgKiBwU3JjRHN0LAotICAgICBPTVhfUzE2ICogcFByZUFDUHJlZGljdCwKLSAgICAgT01YX1MxNiAqIHBQcmVkQnVmUm93LAotICAgICBPTVhfUzE2ICogcFByZWRCdWZDb2wsCi0gICAgIE9NWF9JTlQgY3VyUVAsCi0gICAgIE9NWF9JTlQgcHJlZFFQLAotICAgICBPTVhfSU5UIHByZWREaXIsCi0gICAgIE9NWF9JTlQgQUNQcmVkRmxhZywKLSAgICAgT01YVkNNNFAyVmlkZW9Db21wb25lbnQgIHZpZGVvQ29tcCwKLSAgICAgT01YX1U4IGZsYWcsCi0gICAgIE9NWF9JTlQgKnBTdW1FcnIKLSk7Ci0KLS8qKgotICogRnVuY3Rpb246IGFybVZDTTRQMl9TZXRQcmVkRGlyCi0gKgotICogRGVzY3JpcHRpb246Ci0gKiBQZXJmb3JtcyBkZXRlY3RpbmcgdGhlIHByZWRpY3Rpb24gZGlyZWN0aW9uCi0gKgotICogUmVtYXJrczoKLSAqCi0gKiBQYXJhbWV0ZXJzOgotICogW2luXSBibG9ja0luZGV4ICBibG9jayBpbmRleCBpbmRpY2F0aW5nIHRoZSBjb21wb25lbnQgdHlwZSBhbmQKLSAqICAgICAgICAgICAgICAgICAgICAgICAgICBwb3NpdGlvbiBhcyBkZWZpbmVkIGluIHN1YmNsYXVzZSA2LjEuMy44LCBvZiBJU08vSUVDCi0gKiAgICAgICAgICAgICAgICAgICAgICAgICAgMTQ0OTYtMi4gRnVydGhlcm1vcmUsIGluZGV4ZXMgNiB0byA5IGluZGljYXRlIHRoZQotICogICAgICAgICAgICAgICAgICAgICAgICAgIGFscGhhIGJsb2NrcyBzcGF0aWFsbHkgY29ycmVzcG9uZGluZyB0byBsdW1pbmFuY2UKLSAqICAgICAgICAgICAgICAgICAgICAgICAgICBibG9ja3MgMCB0byAzIGluIHRoZSBzYW1lIG1hY3JvYmxvY2suCi0gKiBbaW5dIHBDb2VmQnVmUm93IHBvaW50ZXIgdG8gdGhlIGNvZWZmaWNpZW50IHJvdyBidWZmZXIKLSAqIFtpbl0gcFFwQnVmICAgICAgcG9pbnRlciB0byB0aGUgcXVhbnRpemF0aW9uIHBhcmFtZXRlciBidWZmZXIKLSAqIFtvdXRdICAgIHByZWRRUCAgICAgIHF1YW50aXphdGlvbiBwYXJhbWV0ZXIgb2YgdGhlIHByZWRpY3RvciBibG9jawotICogW291dF0gICAgcHJlZERpciAgICAgaW5kaWNhdGVzIHRoZSBwcmVkaWN0aW9uIGRpcmVjdGlvbiB3aGljaCB0YWtlcyBvbmUKLSAqICAgICAgICAgICAgICAgICAgICAgICAgICBvZiB0aGUgZm9sbG93aW5nIHZhbHVlczoKLSAqICAgICAgICAgICAgICAgICAgICAgICAgICBPTVhfVklERU9fSE9SSVpPTlRBTCAgICBwcmVkaWN0IGhvcml6b250YWxseQotICogICAgICAgICAgICAgICAgICAgICAgICAgIE9NWF9WSURFT19WRVJUSUNBTCAgICAgIHByZWRpY3QgdmVydGljYWxseQotICoKLSAqIFJldHVybiBWYWx1ZToKLSAqIFN0YW5kYXJkIE9NWFJlc3VsdCByZXN1bHQuIFNlZSBlbnVtZXJhdGlvbiBmb3IgcG9zc2libGUgcmVzdWx0IGNvZGVzLgotICoKLSAqLwotCi1PTVhSZXN1bHQgYXJtVkNNNFAyX1NldFByZWREaXIoCi0gICAgIE9NWF9JTlQgYmxvY2tJbmRleCwKLSAgICAgT01YX1MxNiAqcENvZWZCdWZSb3csCi0gICAgIE9NWF9TMTYgKnBDb2VmQnVmQ29sLAotICAgICBPTVhfSU5UICpwcmVkRGlyLAotICAgICBPTVhfSU5UICpwcmVkUVAsCi0gICAgIGNvbnN0IE9NWF9VOCAqcFFwQnVmCi0pOwotCi0vKioKLSAqIEZ1bmN0aW9uOiBhcm1WQ000UDJfRW5jb2RlVkxDWmlnemFnX0ludHJhCi0gKgotICogRGVzY3JpcHRpb246Ci0gKiBQZXJmb3JtcyB6aWd6YWcgc2Nhbm5pbmcgYW5kIFZMQyBlbmNvZGluZyBmb3Igb25lIGludHJhIGJsb2NrLgotICoKLSAqIFJlbWFya3M6Ci0gKgotICogUGFyYW1ldGVyczoKLSAqIFtpbl0gcHBCaXRTdHJlYW0gICAgIHBvaW50ZXIgdG8gdGhlIHBvaW50ZXIgdG8gdGhlIGN1cnJlbnQgYnl0ZSBpbgotICogICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0aGUgYml0IHN0cmVhbQotICogW2luXSBwQml0T2Zmc2V0ICAgICAgcG9pbnRlciB0byB0aGUgYml0IHBvc2l0aW9uIGluIHRoZSBieXRlIHBvaW50ZWQKLSAqICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnkgKnBwQml0U3RyZWFtLiBWYWxpZCB3aXRoaW4gMCB0byA3LgotICogW2luXSBwUURjdEJsa0NvZWYgICAgcG9pbnRlciB0byB0aGUgcXVhbnRpemVkIERDVCBjb2VmZmljaWVudAotICogW2luXSBwcmVkRGlyICAgICAgICAgQUMgcHJlZGljdGlvbiBkaXJlY3Rpb24sIHdoaWNoIGlzIHVzZWQgdG8gZGVjaWRlCi0gKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRoZSB6aWd6YWcgc2NhbiBwYXR0ZXJuLiBUaGlzIHRha2VzIG9uZSBvZiB0aGUKLSAqICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZm9sbG93aW5nIHZhbHVlczoKLSAqICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgT01YX1ZJREVPX05PTkUgICAgICAgICAgQUMgcHJlZGljdGlvbiBub3QgdXNlZC4KLSAqICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgUGVyZm9ybXMgY2xhc3NpY2FsIHppZ3phZwotICogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzY2FuLgotICogICAgICAgICAgICAgICAgICAgICAgICAgICAgICBPTVhfVklERU9fSE9SSVpPTlRBTCAgICBIb3Jpem9udGFsIHByZWRpY3Rpb24uCi0gKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFBlcmZvcm1zIGFsdGVybmF0ZS12ZXJ0aWNhbAotICogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB6aWd6YWcgc2Nhbi4KLSAqICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgT01YX1ZJREVPX1ZFUlRJQ0FMICAgICAgVmVydGljYWwgcHJlZGljdGlvbi4KLSAqICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgUGVyZm9ybXMgYWx0ZXJuYXRlLWhvcml6b250YWwKLSAqICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgemlnemFnIHNjYW4uCi0gKiBbaW5dIHBhdHRlcm4gICAgICAgICBibG9jayBwYXR0ZXJuIHdoaWNoIGlzIHVzZWQgdG8gZGVjaWRlIHdoZXRoZXIKLSAqICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdGhpcyBibG9jayBpcyBlbmNvZGVkCi0gKiBbaW5dIHN0YXJ0ICAgICAgICAgICBzdGFydCBpbmRpY2F0ZXMgd2hldGhlciB0aGUgZW5jb2RpbmcgYmVnaW5zIHdpdGggMHRoIGVsZW1lbnQKLSAqICAgICAgICAgICAgICAgICAgICAgIG9yIDFzdC4KLSAqIFtvdXRdICAgIHBwQml0U3RyZWFtICAgICAqcHBCaXRTdHJlYW0gaXMgdXBkYXRlZCBhZnRlciB0aGUgYmxvY2sgaXMgZW5jb2RlZCwKLSAqICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc28gdGhhdCBpdCBwb2ludHMgdG8gdGhlIGN1cnJlbnQgYnl0ZSBpbiB0aGUgYml0Ci0gKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHN0cmVhbSBidWZmZXIuCi0gKiBbb3V0XSAgICBwQml0T2Zmc2V0ICAgICAgKnBCaXRPZmZzZXQgaXMgdXBkYXRlZCBzbyB0aGF0IGl0IHBvaW50cyB0byB0aGUKLSAqICA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ludGVkCi0gKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRvIGJ5ICpwcEJpdFN0cmVhbS4gKnBCaXRPZmZzZXQgaXMgdmFsaWQgd2l0aGluCi0gKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFswLTddLgotICogW2luXSBwcmVkRGlyICAgICAgICAgQUMgcHJlZGljdGlvbiBkaXJlY3Rpb24gd2hpY2ggaXMgdXNlZCB0byBkZWNpZGUKLSAqICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdGhlIHppZ3phZyBzY2FuIHBhdHRlcm4uIEl0IHRha2VzIG9uZSBvZiB0aGUKLSAqICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZm9sbG93aW5nIHZhbHVlczoKLSAqICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgT01YX1ZJREVPX05PTkUgIEFDIHByZWRpY3Rpb24gbm90IHVzZWQ7Ci0gKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwZXJmb3JtIGNsYXNzaWNhbCB6aWd6YWcgc2NhbjsKLSAqICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgT01YX1ZJREVPX0hPUklaT05UQUwgICAgSG9yaXpvbnRhbCBwcmVkaWN0aW9uOwotICogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwZXJmb3JtIGFsdGVybmF0ZS12ZXJ0aWNhbAotICogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB6aWd6YWcgc2NhbjsKLSAqICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgT01YX1ZJREVPX1ZFUlRJQ0FMICAgICAgVmVydGljYWwgcHJlZGljdGlvbjsKLSAqICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdGh1cyBwZXJmb3JtCi0gKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGFsdGVybmF0ZS1ob3Jpem9udGFsCi0gKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHppZ3phZyBzY2FuLgotICogW2luXSB2aWRlb0NvbXAgICAgICAgdmlkZW8gY29tcG9uZW50IHR5cGUgKGx1bWluYW5jZSwgY2hyb21pbmFuY2Ugb3IKLSAqICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYWxwaGEpIG9mIHRoZSBjdXJyZW50IGJsb2NrCi0gKiBbaW5dIHNob3J0VmlkZW9IZWFkZXIgYmluYXJ5IGZsYWcgaW5kaWNhdGluZyBwcmVzZW5jZSBvZiBzaG9ydF92aWRlb19oZWFkZXI7IGVzY2FwZSBtb2RlcyAwLTMgYXJlIHVzZWQgaWYgc2hvcnRWaWRlb0hlYWRlcj09MCwKLSAqICAgICAgICAgICAgICAgICAgICAgICAgICAgYW5kIGVzY2FwZSBtb2RlIDQgaXMgdXNlZCB3aGVuIHNob3J0VmlkZW9IZWFkZXI9PTEuCi0gKiBbaW5dIHN0YXJ0ICAgICAgICAgICBzdGFydCBpbmRpY2F0ZXMgd2hldGhlciB0aGUgZW5jb2RpbmcgYmVnaW5zIHdpdGggMHRoIGVsZW1lbnQKLSAqICAgICAgICAgICAgICAgICAgICAgIG9yIDFzdC4KLSAqIFtvdXRdICAgIHBwQml0U3RyZWFtICAgICAqcHBCaXRTdHJlYW0gaXMgdXBkYXRlZCBhZnRlciB0aGUgYmxvY2sgaXMKLSAqICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZGVjb2RlZCwgc28gdGhhdCBpdCBwb2ludHMgdG8gdGhlIGN1cnJlbnQgYnl0ZQotICogICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpbiB0aGUgYml0IHN0cmVhbSBidWZmZXIKLSAqIFtvdXRdICAgIHBCaXRPZmZzZXQgICAgICAqcEJpdE9mZnNldCBpcyB1cGRhdGVkIHNvIHRoYXQgaXQg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mVkIFJ1biB2YWx1ZSAoY291bnQgb2YgemVyb3MpICAgCi0gKiBbaW5dICBzdG9yZUxldmVsICAgICAgU3RvcmVkIExldmVsIHZhbHVlIChub24temVybyB2YWx1ZSkKLSAqIFtpbl0gIHNpZ24gICAgICAgICAgICBGbGFnIGluZGljYXRpbmcgdGhlIHNpZ24gb2YgbGV2ZWwKLSAqIFtpbl0gIGxhc3QgICAgICAgICAgICBzdGF0dXMgb2YgdGhlIGxhc3QgZmxhZwotICogW2luXSAgcEluZGV4ICAgICAgICAgIHBvaW50ZXIgdG8gY29lZmZpY2llbnQgaW5kZXggaW4gOHg4IG1hdHJpeAotICogW291dF0gcEluZGV4ICAgICAgICAgIHBvaW50ZXIgdG8gdXBkYXRlZCBjb2VmZmljaWVudCBpbmRleCBpbiA4eDggCi0gKiAgICAgICAgICAgICAgICAgICAgICAgbWF0cml4Ci0gKiBbaW5dICBwWmlnemFnVGFibGUgICAgcG9pbnRlciB0byB0aGUgemlnemFnIHRhYmxlcwotICogW291dF0gcERzdCAgICAgICAgICAgIHBvaW50ZXIgdG8gdGhlIGNvZWZmaWNpZW50IGJ1ZmZlciBvZiBjdXJyZW50Ci0gKiAgICAgICAgICAgICAgICAgICAgICAgYmxvY2suIFNob3VsZCBiZSAzMi1iaXQgYWxpZ25lZAotICogUmV0dXJuIFZhbHVlOgotICogU3RhbmRhcmQgT01YUmVzdWx0IHJlc3VsdC4gU2VlIGVudW1lcmF0aW9uIGZvciBwb3NzaWJsZSByZXN1bHQgY29kZXMuCi0gKgotICovCi0KLU9NWFJlc3VsdCBhcm1WQ000UDJfRmlsbFZMREJ1ZmZlcigKLSAgICBPTVhfVTMyIHN0b3JlUnVuLAotICAgIE9NWF9TMTYgKiBwRHN0LAotICAgIE9NWF9TMTYgc3RvcmVMZXZlbCwKLSAgICBPTVhfVTggIHNpZ24sCi0gICAgT01YX1U4ICBsYXN0LAotICAgIE9NWF9VOCAgKiBpbmRleCwKLSAgICBjb25zdCBPTVhfVTggK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zIGZsYWcKLSAqIFtpbl0gcnVuQmVnaW5TaW5nbGVMZXZlbEVudHJpZXNMMCAgICAgIFRoZSBydW4gdmFsdWUgZnJvbSB3aGljaCBsZXZlbCAKLSAqICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHdpbGwgYmUgZXF1YWwgdG8gMTogbGFzdCA9PSAwCi0gKiBbaW5dIEluZGV4QmVnaW5TaW5nbGVMZXZlbEVudHJpZXNMMCAgICBBcnJheSBpbmRleCBpbiB0aGUgVkxDIHRhYmxlIAotICogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcG9pbnRpbmcgdG8gdGhlICAKLSAqICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJ1bkJlZ2luU2luZ2xlTGV2ZWxFbnRyaWVzTDAgCi0gKiBbaW5dIHJ1bkJlZ2luU2luZ2xlTGV2ZWxFbnRyaWVzTDEgICAgICBUaGUgcnVuIHZhbHVlIGZyb20gd2hpY2ggbGV2ZWwgCi0gKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB3aWxsIGJlIGVxdWFsIHRvIDE6IGxhc3QgPT0gMQotICogW2luXSBJbmRleEJlZ2luU2luZ2xlTGV2ZWxFbnRyaWVzTDEgICAgQXJyYXkgaW5kZXggaW4gdGhlIFZMQyB0YWJsZSAKLSAqICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBvaW50aW5nIHRvIHRoZSAgCi0gKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBydW5CZWdpblNpbmdsZUxldmVsRW50cmllc0wwIAotICogW2luXSBwUnVuSW5kZXhUYWJsZUwwICAgIFJ1biBJbmRleCB0YWJsZSBkZWZpbmVkIGluIAotICogICAgICAgICAgICAgICAgICAgICAgICAgIGFybVZDTTRQMl9IdWZmX1RhYmxlc19WTEMuYyBmb3IgbGFzdCA9PSAwCi0gKiBbaW5dIHBWbGNUY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CBvciAxc3QuCi0gKiBbaW5dICBtYXhTdG9yZVJ1bkwwICAgIE1heCBzdG9yZSBwb3NzaWJsZSAoY29uc2lkZXJpbmcgbGFzdCBhbmQgaW50ZXIvaW50cmEpCi0gKiAgICAgICAgICAgICAgICAgICAgICAgIGZvciBsYXN0ID0gMAotICogW2luXSAgbWF4U3RvcmVSdW5MMSAgICBNYXggc3RvcmUgcG9zc2libGUgKGNvbnNpZGVyaW5nIGxhc3QgYW5kIGludGVyL2ludHJhKQotICogICAgICAgICAgICAgICAgICAgICAgICBmb3IgbGFzdCA9IDEKLSAqIFtpbl0gIG1heFJ1bkZvck11bHRpcGxlRW50cmllc0wwIAotICogICAgICAgICAgICAgICAgICAgICAgICBUaGUgcnVuIHZhbHVlIGFmdGVyIHdoaWNoIGxldmVsIAotICogICAgICAgICAgICAgICAgICAgICAgICB3aWxsIGJlIGVxdWFsIHRvIDE6IAotICogICAgICAgICAgICAgICAgICAgICAgICAoY29uc2lkZXJpbmcgbGFzdCBhbmQgaW50ZXIvaW50cmEgc3RhdHVzKSBmb3IgbGFzdCA9IDAKLSAqIFtpbl0gIG1heFJ1bkZvck11bHRpcGxlRW50cmllc0wxIAotICogICAgICAgICAgICAgICAgICAgICAgICBUaGUgcnVuIHZhbHVlIGFmdGVyIHdoaWNoIGxldmVsIAotICogICAgICAgICAgICAgICAgICAgICAgICB3aWxsIGJlIGVxdWFsIHRvIDE6IAotICogICAgICAgICAgICAgICAgICAgICAgICAoY29uc2lkZXJpbmcgbGFzdCBhbmQgaW50ZXIvaW50cmEgc3RhdHVzKSBmb3IgbGFzdCA9IDEKLSAqIFtpbl0gIHBSdW5JbmRleFRhYmxlTDAgUnVuIEluZGV4IHRhYmxlIGRlZmluZWQgaW4gCi0gKiAgICAgICAgICAgICAgICAgICAgICAgIGFybVZDTTRQMl9IdWZmX1RhYmxlc19WTEMuYyBmb3IgbGFzdCA9PSAwCi0gKiBbaW5dICBwVmxjVGFibGVMMCAgICAgIFZMQyB0YWJ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leFRhYmxlTDAsCi0gICAgICAgICAgICAgIGNvbnN0IEFSTV9WTEMzMiAqcFZsY1RhYmxlTDAsCi0JCQkgIGNvbnN0IE9NWF9VOCAgKiBwUnVuSW5kZXhUYWJsZUwxLAotICAgICAgICAgICAgICBjb25zdCBBUk1fVkxDMzIgKnBWbGNUYWJsZUwxLAotICAgICAgICAgICAgICBjb25zdCBPTVhfVTggICogcExNQVhUYWJsZUwwLAotICAgICAgICAgICAgICBjb25zdCBPTVhfVTggICogcExNQVhUYWJsZUwxLAotICAgICAgICAgICAgICBjb25zdCBPTVhfVTggICogcFJNQVhUYWJsZUwwLAotICAgICAgICAgICAgICBjb25zdCBPTVhfVTggICogcFJNQVhUYWJsZUwxLAotICAgICAgICAgICAgICBjb25zdCBPTVhfVTggICogcFppZ3phZ1RhYmxlCi0pOwotLyoqCi0gKiBGdW5jdGlvbjogYXJtVkNNNFAyX0ZpbGxWTENCdWZmZXIKLSAqCi0gKiBEZXNjcmlwdGlvbjoKLSAqIFBlcmZvcm1zIGNhbGN1bGF0aW5nIHRoZSBWTEMgYml0cyBkZXBlbmRpbmcgb24gdGhlIGVzY2FwZSB0eXBlIGFuZCBpbnNlcnQgCi0gKiB0aGUgc2FtZSBpbiB0aGUgYml0c3RyZWFtCi0gKgotICogUmVtYXJrczoKLSAqCi0gKiBQYXJhbWV0ZXJzOgotICogW2luXQkgcHBCaXRTdHJlYW0JCXBvaW50ZXIgdG8gdGhlIHBvaW50ZXIgdG8gdGhlIGN1cnJlbnQgYnl0ZSBpbgotICoJICAgICAgICAgICAgICAgICAgICAgICAgdGhlIGJpdCBzdHJlYW0KLSAqIFtpbl0JIHBCaXRPZmZzZXQgICAgICAgICBwb2ludGVyIHRvIHRoZSBiaXQgcG9zaXRpb24gaW4gdGhlIGJ5dGUgcG9pbnRlZAotICogICAgICAgICAgICAgICAgICAgICAgICAgIGJ5ICpwcEJpdFN0cmVhbS4gVmFsaWQgd2l0aGluIDAgdG8gNwotICogW2luXSAgcnVuICAgICAgICAgICAgICAgIFJ1biB2YWx1ZSAoY291bnQgb2YgemVyb3MpIHRvIGJlIGVuY29kZWQgIAotICogW2luXSAgbGV2ZWwgICAgICAgICAgICAgIExldmVsIHZhbHVlIChub24temVybyB2YWx1ZSkgdG8gYmUgZW5jb2RlZAotICogW2luXSAgcnVuUGx1cyAgICAgICAgICAgIENhbGN1bGF0ZWQgYXMgcnVuUGx1cyA9IHJ1biAtIChSTUFYICsgMSkgIAotICogW2luXSAgbGV2ZWxQbHVzICAgICAgICAgIENhbGN1bGF0ZWQgYXMgCi0gKiAgICAgICAgICAgICAgICAgICAgICAgICAgbGV2ZWxQbHVzID0gc2lnbihsZXZlbCkqW2FicyhsZXZlbCkgLSBMTUFYXQotICogW2luXSAgZk1vZGUgICAgICAgICAgICAgIEZsYWcgaW5kaWNhdGluZyB0aGUgZXNjYXBlIG1vZGVzCi0gKiBbaW5dICBsYXN0ICAgICAgICAgICAgICAgc3RhdHVzIG9mIHRoZSBsYXN0IGZsYWcKLSAqIFtpbl0gIG1heFJ1bkZvck11bHRpcGxlRW50cmllcyAKLSAqICAgICAgICAgICAgICAgICAgICAgICAgICBUaGUgcnVuIHZhbHVlIGFmdGVyIHdoaWNoIGxldmVsIHdpbGwgYmUgZXF1YWwgdG8gMTogCi0gKiAgICAgICAgICAgICAgICAgICAgICAgICAgKGNvbnNpZGVyaW5nIGxhc3QgYW5kIGludGVyL2ludHJhIHN0YXR1cykKLSAqIFtpbl0gIHBSdW5JbmRleFRhYmxlICAgICBSdW4gSW5kZXggdGFibGUgZGVmaW5lZCBpbgotICogICAgICAgICAgICAgICAgICAgICAgICAgIGFybVZDTTRQMl9IdWZmX3RhYmxlc19WTEMuaAotICogW2luXSAgcFZsY1RhYmxlICAgICAgICAgIFZMQyB0YWJsZSBkZWZpbmVkIGluIGFybVZDTTRQMl9IdWZmX3RhYmxlc19WTEMuaAotICogW291dF0gcHBCaXRTdHJlYW0JCSpwcEJpdFN0cmVhbSBpcyB1cGRhdGVkIGFmdGVyIHRoZSBibG9jayBpcyBlbmNvZGVkCi0gKiAgICAgICAgICAgICAgICAgICAgICAgICAgc28gdGhhdCBpdCBwb2ludHMgdG8gdGhlIGN1cnJlbnQgYnl0ZSBpbiB0aGUgYml0Ci0gKiAgICAgICAgICAgICAgICAgICAgICAgICAgc3RyZWFtIGJ1ZmZlci4KLSAqIFtvdXRdIHBCaXRPZmZzZXQgICAgICAgICAqcEJpdE9mZnNldCBpcyB1cGRhdGVkIHNvIHRoYXQgaXQgcG9pbnRzIHRvIHRoZQotICogICAgICAgICAgICAgICAgICAgICAgICAgIGN1cnJlbnQgYml0IHBvc2l0aW9uIGluIHRoZSBieXRlIHBvaW50ZWQgYnkKLSAqICAgICAgICAgICAgICAgICAgICAgICAgICAqcHBCaXRTdHJlYW0uCi0gKgotICogUmV0dXJuIFZhbHVlOgotICogU3RhbmRhcmQgT01YUmVzdWx0IHJlc3VsdC4gU2VlIGVudW1lcmF0aW9uIGZvciBwb3NzaWJsZSByZXN1bHQgY29kZXMuCi0gKgotICovCi0KLU9NWFJlc3VsdCBhcm1WQ000UDJfRmlsbFZMQ0J1ZmZlciAoCi0gICAgICAgICAgICAgIE9NWF9VOCAqKnBwQml0U3RyZWFtLAotICAgICAgICAgICAgICBPTVhfSU5UICogcEJpdE9mZnNldCwKLSAgICAgICAgICAgICAgT01YX1UzMiBydW4sCi0gICAgICAgICAgICAgIE9NWF9TMTYgbGV2ZWwsIAotCQkJICBPTVhfVTMyIHJ1blBsdXMsCi0gICAgICAgICAgICAgIE9NWF9TMTYgbGV2ZWxQbHVzLCAKLSAgICAgICAgICAgICAgT01YX1U4ICBmTW9kZSwKLQkJCSAgT01YX1U4ICBsYXN0LAotICAgICAgICAgICAgICBPTVhfVTggIG1heFJ1bkZvck11bHRpcGxlRW50cmllcywgCi0gICAgICAgICAgICAgIGNvbnN0IE9NWF9VOCAgKnBSdW5JbmRleFRhYmxlLAotICAgICAgICAgICAgICBjb25zdCBBUk1fVkxDM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IE9NWF9VMzIJCWlSZWZTdGVwMCwKLSAgICBPTVhfVTMyCQlpUmVmU3RlcDEsCi0gICAgT01YX1UzMioJcERzdFNBRCwKLSAgICBPTVhfVTMyICAgICBpSGVpZ2h0LAotICAgIE9NWF9VMzIgICAgIGlXaWR0aAotKTsKLQotLyoqCi0gKiBGdW5jdGlvbjogYXJtVkNNNFAxMF9JbnRlcnBvbGF0ZV9DaHJvbWEKLSAqCi0gKiBEZXNjcmlwdGlvbjoKLSAqIFRoaXMgZnVuY3Rpb24gcGVyZm9ybXMgaW50ZXJwb2xhdGlvbiBmb3IgY2hyb21hIGNvbXBvbmVudHMuCi0gKgotICogUmVtYXJrczoKLSAqCi0gKiAgW2luXSAgICBwU3JjICAgICAgICAgICAgUG9pbnRlciB0byB0b3AtbGVmdCBjb3JuZXIgb2YgYmxvY2sgdXNlZCB0byAKLSAqICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGludGVycG9sYXRlIGluIHRoZSByZWNvbnN0cnVjdGVkIGZyYW1lIHBsYW5lCi0gKiAgW2luXSAgICBpU3JjU3RlcCAgICBTdGVwIG9mIHRoZSBzb3VyY2UgYnVmZmVyLgotICogIFtpbl0gICAgaURzdFN0ZXAgICAgU3RlcCBvZiB0aGUgZGVzdGluYXRpb24oaW50ZXJwb2xhdGlvbikgYnVmZmVyLgotICogIFtpbl0gICAgaVdpZHRoICAgICAgV2lkdGggb2YgdGhlIGN1cnJlbnQgYmxvY2sKLSAqICBbaW5dICAgIGlIZWlnaHQgICAgIEhlaWdodCBvZiB0aGUgY3VycmVudCBibG9jawotICogIFtpbl0gICAgZHggICAgICAgICAgICAgIEZyYWN0aW9uYWwgcGFydCBvZiBob3Jpem9udGFsIG1vdGlvbiB2ZWN0b3IgCi0gKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb21wb25lbnQgaW4gMS84IHBpeGVsIHVuaXQgKDB+NykgCi0gKiAgW2luXSAgICBkeSAgICAgICAgICAgICAgRnJhY3Rpb25hbCBwYXJ0IG9mIHZlcnRpY2FsIG1vdGlvbiB2ZWN0b3IgCi0gKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb21wb25lbnQgaW4gMS84IHBpeGVsIHVuaXQgKDB+NykKLSAqICBbb3V0XSAgIHBEc3QgICAgICAgICAgICBQb2ludGVyIHRvIHRoZSBpbnRlcnBvbGF0aW9uIGJ1ZmZlcgotICoKLSAqIFJldHVybiBWYWx1ZToKLSAqIFN0YW5kYXJkIE9NWFJlc3VsdCB2YWx1ZS4KLSAqCi0gKi8KLSBPTVhSZXN1bHQgYXJtVkNNNFAxMF9JbnRlcnBvbGF0ZV9DaHJvbWEoCi0gICAgICAgIE9NWF9VOCAgICAgICpwU3JjLAotICAgICAgICBPTVhfVTMyICAgICBpU3JjU3RlcCwKLSAgICAgICAgT01YX1U4ICAgICAgKnBEc3QsCi0gICAgICAgIE9NWF9VMzIgICAgIGlEc3RTdGVwLAotICAgICAgICBPTVhfVTMyICAgICBpV2lkdGgsCi0gICAgICAgIE9NWF9VMzIgICAgIGlIZWlnaHQsCi0gICAgICAgIE9NWF9VMzIgICAgIGR4LAotICAgICAgICBPTVhfVTMyICAgICBkeQotKTsKLQotLyoqCi0gKiBGdW5jdGlvbjogYXJtVkNNNFAxMF9JbnRlcnBvbGF0ZV9MdW1hCi0gKgotICogRGVzY3JpcHRpb246Ci0gKiBUaGlzIGZ1bmN0aW9uIHBlcmZvcm1zIGludGVycG9sYXRpb24gZm9yIGx1bWEgY29tcG9uZW50cy4KLSAqCi0gKiBSZW1hcmtzOgotICoKLSAqICBbaW5dICAgIHBTcmMgICAgICAgICAgICBQb2ludGVyIHRvIHRvcC1sZWZ0IGNvcm5lciBvZiBibG9jayB1c2VkIHRvIAotICogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaW50ZXJwb2xhdGUgaW4gdGhlIHJlY29uc3Ryd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BPdXRwdXQgQXJndW1lbnRzOgotICogICAKLSAqICAgcERzdFNBRCAtUG9pbnRlciBvZiByZXN1bHQgU0FEIAotICoKLSAqIFJldHVybiBWYWx1ZToKLSAqICAgIAotICogICAgT01YX1N0c19Ob0VyciAtIG5vIGVycm9yIAotICogICAgT01YX1N0c19CYWRBcmdFcnIgLSBiYWQgYXJndW1lbnRzLiAgUmV0dXJuZWQgaWYgb25lIG9yIG1vcmUgb2YgdGhlIAotICogICAgICAgICAgICAgIGZvbGxvd2luZyBjb25kaXRpb25zIGlzIHRydWU6IAotICogICAgLSAgICBhdCBsZWFzdCBvbmUgb2YgdGhlIGZvbGxvd2luZyBwb2ludGVycyBpcyBOVUxMOiAKLSAqICAgICAgICAgcFNyY09yZywgcERzdFNBRCwgb3IgcFNyY1JlZiAKLSAqICAgIC0gICAgcFNyY09yZyBpcyBub3QgOC1ieXRlIGFsaWduZWQuIAotICogICAgLSAgICBpU3RlcE9yZyAgPD0gMCBvciBpU3RlcE9yZyBpcyBub3QgYSBtdWx0aXBsZSBvZiA4IAotICogICAgLSAgICBpU3RlcFJlZiA8PSAwIG9yIGlTdGVwUmVmIGlzIG5vdCBhIG11bHRpcGxlIG9mIDggCi0gKiAgICAtICAgIGlIZWlnaHQgaXMgbm90IDQsIDggb3IgMTYgCi0gKgotICovCi1PTVhSZXN1bHQgb214VkNDT01NX1NBRF84eCAoCi0gICAgY29uc3QgT01YX1U4ICpwU3JjT3JnLAotICAgIE9NWF9VMzIgaVN0ZXBPcmcsCi0gICAgY29uc3QgT01YX1U4ICpwU3JjUmVmLAotICAgIE9NWF9VMzIgaVN0ZXBSZWYsCi0gICAgT01YX1MzMipwRHN0U0FELAotICAgIE9NWF9VMzIgaUhlaWdodAotKTsKLQotCi0KLS8qIDYuMi4xLjEgRGlyZWN0aW9uICAqLwotLyogVGhlIGRpcmVjdGlvbiBlbnVtZXJhdG9yIGlzIHVzZWQgd2l0aCBmdW5jdGlvbnMgdGhhdCBwZXJmb3JtIE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T01YX1UzMiBjYnBjOyAgICAgICAgICAgICAgICAgICAgLyogQ0JQIENocm9tYSAqLwotICAgIE9NWFZDTW90aW9uVmVjdG9yIHBNVjBbMl1bMl07ICAgIC8qIG1vdGlvbiB2ZWN0b3IsIHJlcHJlc2VudGVkIHVzaW5nIDEvMi1wZWwgdW5pdHMsIAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqIHBNVjBbYmxvY2t5XVtibG9ja3hdIChibG9ja3kgPSAwfjEsIGJsb2NreCA9MH4xKSAKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLSAgICBPTVhWQ01vdGlvblZlY3RvciBwTVZQcmVkWzJdWzJdOyAvKiBtb3Rpb24gdmVjdG9yIHByZWRpY3Rpb24sIHJlcHJlc2VudGVkIHVzaW5nIDEvMi1wZWwgdW5pdHMsIAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqIHBNVlByZWRbYmxvY2t5XVtibG9ja3hdIChibG9ja3kgPSAwfjEsIGJsb2NreCA9IDB+MSkgCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0gICAgT01YX1U4IHBQcmVkRGlyWzJdWzJdOyAgICAgICAgICAgLyogQUMgcHJlZGljdGlvbiBkaXJlY3Rpb246IAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqICAgT01YX1ZDX05PTkUsIE9NWF9WQ19WRVJUSUNBTCwgT01YX1ZDX0hPUklaT05UQUwgCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi19IE9NWFZDTTRQMk1CSW5mbywgKk9NWFZDTTRQMk1CSW5mb1B0cjsKLQotCi0KLS8qKgotICogRnVuY3Rpb246ICBvbXhWQ000UDJfRmluZE1WcHJlZCAgICg2LjIuMy4xLjEpCi0gKgotICogRGVzY3JpcHRpb246Ci0gKiBQcmVkaWN0cyBhIG1vdGlvbiB2ZWN0b3IgZm9yIH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sxLCAyNTRdLiAgV2hlbiBzaG9ydFZpZGVvSGVhZGVyPT0wLCBBQyBjb2VmZmljaWVudHMgCi0gKiAgICAgICAgICAgIGFyZSBzYXR1cmF0ZWQgb24gdGhlIGludGVydmFsIFstMjA0NywgMjA0N10uIAotICoKLSAqIFJldHVybiBWYWx1ZToKLSAqICAgIAotICogICAgT01YX1N0c19Ob0VyciAtIG5vIGVycm9yIAotICogICAgT01YX1N0c19CYWRBcmdFcnIgLSBiYWQgYXJndW1lbnRzOgotICogICAgLSAgICBwU3JjRHN0IGlzIE5VTEwuIAotICogICAgLSAgICBibG9ja0luZGV4IDwgMCBvciBibG9ja0luZGV4ID49IDEwIAotICogICAgLSAgICBRUCA8PSAwIG9yIFFQID49IDMyLiAKLSAqCi0gKi8KLU9NWFJlc3VsdCBvbXhWQ000UDJfUXVhbnRJbnRyYV9JICgKLSAgICBPTVhfUzE2ICpwU3JjRHN0LAotICAgIE9NWF9VOCBRUCwKLSAgICBPTVhfSU5UIGJsb2NrSW5kZXgsCi0gICAgT01YX0lOVCBzaG9ydFZpZGVvSGVhZGVyCi0pOwotCi0KLQotLyoqCi0gKiBGdW5jdGlvbjogIG9teFZDTTRQMl9RdWFudEludGVyX0kgICAoNi4yLjQuNC4zKQotICoKLSAqIERlc2NyaXB0aW9uOgotICogUGVyZm9ybXMgcXVhbnRpemF0aW9uIG9uIGFuIGludGVyIGNvZWZmaWNpZW50IGJsb2NrOyBzdXBwb3J0cyAKLSAqIGJpdHNfcGVyX3BpeGVsID09IDguIAotICoKLSAqIElucHV0IEFyZ3VtZW50czoKLSAqICAgCi0gKiAgIHBTcmNEc3QgLSBwb2ludGVyIHRvIHRoZSBpbnB1dCBpbnRlciBibG9jayBjb2VmZmljaWVudHM7IG11c3QgYmUgYWxpZ25lZCAKLSAqICAgICAgICAgICAgb24gYSAxNi1ieXRlIGJvdW5kYXJ5LiAKLSAqICAgUVAgLSBxdWFudGl6YXRpb24gcGFyYW1ldGVyIChxdWFudGl6Z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ZXJlbmNlZCAKLSAqICAgICAgICAgICAgYnkgKnBwQml0U3RyZWFtLiAgVGhlIHBhcmFtZXRlciAqcEJpdE9mZnNldCBpcyB2YWxpZCBpbiB0aGUgCi0gKiAgICAgICAgICAgIHJhbmdlIFswLTddLiAKLSAqICAgICAgICAgICAgQml0IFBvc2l0aW9uIGluIG9uZSBieXRlOiAgfE1vc3QgICAgICBMZWFzdHwgCi0gKiAgICAgICAgICAgICAgICAgICAgKnBCaXRPZmZzZXQgICAgICAgIHwwIDEgMiAzIDQgNSA2IDd8IAotICogICBwcmVkRGlyIC0gQUMgcHJlZGljdGlvbiBkaXJlY3Rpb247IHVzZWQgdG8gc2VsZWN0IHRoZSB6aWd6YWcgc2NhbiAKLSAqICAgICAgICAgICAgcGF0dGVybjsgdGFrZXMgb25lIG9mIHRoZSBmb2xsb3dpbmcgdmFsdWVzOiAKLSAqICAgICAgICAgICAgLSAgT01YX1ZDX05PTkUgLSBBQyBwcmVkaWN0aW9uIG5vdCB1c2VkOyAKLSAqICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwZXJmb3JtcyBjbGFzc2ljYWwgemlnemFnIHNjYW4uIAotICogICAgICAgICAgICAtICBPTVhfVkNfSE9SSVpPTlRBTCAtIEhvcml6b250YWwgcHJlZGljdGlvbjsgCi0gKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcGVyZm9ybXMgYWx0ZXJuYXRlLXZlcnRpY2FsIHppZ3phZyBzY2FuOyAKLSAqICAgICAgICAgICAgLSAgT01YX1ZDX1ZFUlRJQ0FMIC0gVmVydGljYWwgcHJlZGljdGlvbjsgCi0gKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcGVyZm9ybXMgYWx0ZXJuYXRlLWhvcml6b250YWwgemlnemFnIHNjYW4uIAotICogICBzaG9ydFZpZGVvSGVhZGVyIC0gYmluYXJ5IGZsYWcgaW5kaWNhdGluZyBwcmVzZW5jZSBvZiAKLSAqICAgICAgICAgICAgc2hvcnRfdmlkZW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sIAotICogICAgICAgICAgICAgIHBCZXRhLCBwVGhyZXNob2xkcyBvciBwQlMuIAotICogICAgLSAgICBwU3JjRHN0IGlzIG5vdCAxNi1ieXRlIGFsaWduZWQuIAotICogICAgLSAgICBlaXRoZXIgcFRocmVzaG9sZHMgb3IgcEJTIGlzIG5vdCBhbGlnbmVkIG9uIGEgNC1ieXRlIGJvdW5kYXJ5LiAKLSAqICAgIC0gICAgb25lIG9yIG1vcmUgZW50cmllcyBpbiB0aGUgdGFibGUgcEFscGhhWzAuLjNdIGlzIG91dHNpZGUgdGhlIHJhbmdlIAotICogICAgICAgICAgICAgIFswLDI1NV0uIAotICogICAgLSAgICBvbmUgb3IgbW9yZSBlbnRyaWVzIGluIHRoZSB0YWJsZSBwQmV0YVswLi4zXSBpcyBvdXRzaWRlIHRoZSByYW5nZSAKLSAqICAgICAgICAgICAgICBbMCwxOF0uIAotICogICAgLSAgICBvbmUgb3IgbW9yZSBlbnRyaWVzIGluIHRoZSB0YWJsZSBwVGhyZXNob2xkc1swLi4zMV1pcyBvdXRzaWRlIG9mIAotICogICAgICAgICAgICAgIHRoZSByYW5nZSBbMCwyNV0uIAotICogICAgLSAgICBwQlMgaXMgb3V0IG9mIHJhbmdlLCBpLmUuLCBvbmUgb2YgdGhlIGZvbGxvd2luZyBjb25kaXRpb25zIGlzIHRydWU6IAotICogICAgICAgICAgICAgIHBCU1tpXTwwLCBwQlNbaV0+NCwgcEJTW2ldPT00IGZvciBpPj00LCBvciAKLSAqICAgICAgICAgICAgIChwQlNbaV09PTQgJiYgcEJTW2leM10hPTQpIGZvciAwPD1pPD0zLiAKLSAqICAgIC0gICAgc3JjZHN0U3RlcCBpcyBub3QgYSBtdWx0aXBsZSBvZiAxNi4gCi0gKgotICovCi1PTVhSZXN1bHQgb214VkNNNFAxMF9EZWJsb2NrTHVtYV9JICgKLSAgICBPTVhfVTggKnBTcmNEc3QsCi0gICAgT01YX1MzMiBzcmNkc3RTdGVwLAotICAgIGNvbnN0IE9N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ICAgICAgICAgICAgICAgICAtIHN0ZXAgPDE2IG9yIHN0ZXAgaXMgbm90IGEgbXVsdGlwbGUgb2YgMTYuICAKLSA7ICovCi0KLSAgIElOQ0xVREUgb214dHlwZXNfcy5oCi0gICAKLSAgICAgCi0gICAgIE1fVkFSSUFOVFMgQVJNMTEzNkpTCi0gICAgIAotCi0KLQotICAgICBJRiBBUk0xMTM2SlMKLQotOy8vSW5wdXQgQXJndW1lbnRzCi1wU3JjICAgIFJOIDAgICAgICAgIAotcERzdCAgICBSTiAxICAgICAgICAKLXN0ZXAgICAgUk4gMgotCi07Ly9Mb2NhbCBWYXJpYWJsZXMKLUNvdW50ICAgUk4gMTQKLVgwICAgICAgUk4gMgotWDEgICAgICBSTiA0Ci0KLVJldHVybiAgUk4gMAotICAgICAKLSAgICAgTV9TVEFSVCBvbXhWQ0NPTU1fQ29weTE2eDE2LHI1Ci0gICAgICAgIAotICAgICAgICAKLSAgICAgICAgCi0gICAgICAgIFNVQiAgIENvdW50LHN0ZXAsIzggICAgICAgICAgICAgICAgIDsvL0NvdW50PXN0ZXAtOAotICAgICAgICBMRFJEICBYMCxbcFNyY10sIzggICAgICAgICAgICAgICAgICA7Ly9wU3JjIGFmdGVyIGxvYWRpbmcgcFNyYz1wU3JjKzgKLSAgICAgICAgTERSRCAgWDEsW3BTcmNdLENvdW50ICAgICAgICAgICAgICAgOy8vcFNyYyBhZnRlciBsb2FkaW5nIHBTcmM9cFNyYytzdGVwCi0gICAgICAgIAotICAgICAgICA7Ly8gbG9hZGluZyAxNiBieXRlcyBhbmQgc3RvcmluZwotICAgICAgICBTVFJEICBYMCxbcERzdF0sIzggICAgICAgICAgICAgICAKLSAgICAgICAgTERSRCAgWDAsW3BTcmNdLCM4IAotICAgICAgICBTVFJEICBYMSxbcERzdF0sIzggICAgICAgICAgICAgICAKLSAgICAgICAgTERSRCAgWDEsW3BTcmNdLENvdW50Ci0gICAgICAgIAotICAgICAgICA7Ly8gbG9hZGluZyAxNiBieXRlcyBhbmQgc3RvcmluZwotICAgICAgICBTVFJEICBYMCxbcERzdF0sIzggICAgICAgICAgICAgICAKLSAgICAgICAgTERSRCAgWDAsW3BTcmNdLCM4Ci0gICAgICAgIFNUUkQgIFgxLFtwRHN0XSwjOCAgICAgICAgICAgICAgIAotICAgICAgICBMRFJEICBYMSxbcFNyY10sQ291bnQKLSAgICAgICAgCi0gICAgICAgIDsvLyBsb2FkaW5nIDE2IGJ5dGVzIGFuZCBzdG9yaW5nCi0gICAgICAgIFNUUkQgIFgwLFtwRHN0XSwjOCAgICAgICAgICAgICAgIAotICAgICAgICBMRFJEICBYMCxbcFNyY10sIzgKLSAgICAgICAgU1RSRCAgWDEsW3BEc3RdLCM4ICAgICAgICAgICAgICAgCi0gICAgICAgIExEUkQgIFgxLFtwU3JjXSxDb3VudAotICAgICAgICAKLSAgICAgICAgOy8vIGxvYWRpbmcgMTYgYnl0ZXMgYW5kIHN0b3JpbmcKLSAgICAgICAgU1RSRCAgWDAsW3BEc3RdLCM4ICAgICAgICAgICAgICAgCi0gICAgICAgIExEUkQgIFgwLFtwU3JjXSwjOAotICAgICAgICBTVFJEICBYMSxbcERzdF0sIzggICAgICAgICAgICAgICAKLSAgICAgICAgTERSRCAgWDEsW3BTcmNdLENvdW50Ci0gICAgICAgIAotICAgICAgICA7Ly8gbG9hZGluZyAxNiBieXRlcyBhbmQgc3RvcmluZwotICAgICAgICBTVFJEICBYMCxbcERzdF0sIzggICAgICAgICAgICAgICAKLSAgICAgICAgTERSRCAgWDAsW3BTcmNdLCM4Ci0gICAgICAgIFNUUkQgIFgxLFtwRHN0XSwjOCAgICAgICAgICAgICAgIAotICAgICAgICBMRFJEICBYMSxbcFNyY10sQ291bnQKLSAgICAgICAKLSAgICAgICAgOy8vIGxvYWRpbmcgMTYgYnl0ZXMgYW5kIHN0b3JpbmcKLSAgICAgICAgU1RSRCAgWDAsW3BEc3RdLCM4ICAgICAgICAgICAgICAgCi0gICAgICAgIExEUkQgIFgwLFtwU3JjXSwjOAotICAgICAgICBTVFJEICBYMSxbcERzdF0sIzggICAgICAgICAgICAgICAKLSAgICAgICAgTERSRCAgWDEsW3BTcmNdLENvdW50Ci0KLSAgICAgICAgOy8vIGxvYWRpbmcgMTYgYnl0ZXMgYW5kIHN0b3JpbmcKLSAgICAgICAgU1RSRCAgWDAsW3BEc3RdLCM4ICAgICAgICAgICAgICAgCi0gICAgICAgIExEUkQgIFgwLFtwU3JjXSwjOAotICAgICAgICBTVFJEICBYMSxbcERzdF0sIzggICAgICAgICAgICAgICAKLSAgICAgICAgTERSRCAgWDEsW3BTcmNdLENvdW50Ci0gICAgICAgIAotICAgICAgICA7Ly8gbG9hZGluZyAxNiBieXRlcyBhbmQgc3RvcmluZwotICAgICAgICBTVFJEICBYMCxbcERzdF0sIzggICAgICAgICAgICAgIAotICAgICAgICBMRFJEICBYMCxbcFNyY10sIzggCi0gICAgICAgIFNUUkQgIFgxLFtwRHN0XSwjOCAgICAgICAgICAgICAgIAotICAgICAgICBMRFJEICBYMSxbcFNyY10sQ291bnQKLSAgICAgICAgCi0gICAgICAgIDsvLyBsb2FkaW5nIDE2IGJ5dGVzIGFuZCBzdG9yaW5nCi0gICAgICAgIFNUUkQgIFgwLFtwRHN0XSwjOCAgICAgICAgICAgICAgIAotICAgICAgICBMRFJEICBYMCxbcFNyY10sIzggCi0gICAgICAgIFNUUkQgIFgxLFtwRHN0XSwjOCAgICAgICAgICAgICAgIAotICAgICAgICBMRFJEICBYMSxbcFNyY10sQ291bnQKLQotICAgICAgICA7Ly8gbG9hZGluZyAxNiBieXRlcyBhbmQgc3RvcmluZwotICAgICAgICBTVFJEICBYMCxbcERzdF0sIzggICAgICAgICAgICAgICAKLSAgICAgICAgTERSRCAgWDAsW3BTcmNdLCM4IAotICAgICAgICBTVFJEICBYMSxbcERzdF0sIzggICAgICAgICAgICAgICAKLSAgICAgICAgTERSRCAgWDEsW3BTcmNdLENvdW50Ci0KLSAgICAgICAgOy8vIGxvYWRpbmcgMTYgYnl0ZXMgYW5kIHN0b3JpbmcKLSAgICAgICAgU1RSRCAgWDAsW3BEc3RdLCM4ICAgICAgICAgICAgICAgCi0gICAgICAgIExEUkQgIFgwLFtwU3JjXSwjOCAKLSAgICAgICAgU1RSRCAgWDEsW3BEc3RdLCM4ICAgICAgICAgICAgICAgCi0gICAgICAgIExEUkQgIFgxLFtwU3JjXSxDb3VudAotCi0gICAgICAgIDsvLyBsb2FkaW5nIDE2IGJ5dGVzIGFuZCBzdG9yaW5nCi0gICAgICAgIFNUUkQgIFgwLFtwRHN0XSwjOCAgICAgICAgICAgICAgIAotICAgICAgICBMRFJEICBYMCxbcFNyY10sIzggCi0gICAgICAgIFNUUkQgIFgxLFtwRHN0XSwjOCAgICAgICAgICAgICAgIAotICAgICAgICBMRFJEICBYMSxbcFNyY10sQ291bnQKLQotICAgICAgICA7Ly8gbG9hZGluZyAxNiBieXRlcyBhbmQgc3RvcmluZwotICAgICAgICBTVFJEICBYMCxbcERzdF0sIzggICAgICAgICAgICAgICAKLSAgICAgICAgTERSRCAgWDAsW3BTcmNdLCM4IAotICAgICAgICBTVFJEICBYMSxbcERzdF0sIzggICAgICAgICAgICAgICAKLSAgICAgICAgTERSRCAgWDEsW3BTcmNdLENvdW50Ci0KLSAgICAgICAgOy8vIGxvYWRpbmcgMTYgYnl0ZXMgYW5kIHN0b3JpbmcKLSAgICAgICAgU1RSRCAgWDAsW3BEc3RdLCM4ICAgICAgICAgICAgICAgCi0gICAgICAgIExEUkQgIFgwLFtwU3JjXSwjOCAKLSAgICAgICAgU1RSRCAgWDEsW3BEc3RdLCM4ICAgICAgICAgICAgICAgCi0gICAgICAgIExEUkQgIFgxLFtwU3JjXSxDb3VudAotICAgICAgIAotICAgICAgICA7Ly8gbG9hZGluZyAxNiBieXRlcyBhbmQgc3RvcmluZwotICAgICAgICBTVFJEICBYMCxbcERzdF0sIzggICAgICAgICAgICAgICAKLSAgICAgICAgTERSRCAgWDAsW3BTcmNdLCM4IAotICAgICAgICB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gKLSAgIAotICAgICAKLSAgICAgTV9WQVJJQU5UUyBBUk0xMTM2SlMKLSAgICAgCi0KLQotCi0gICAgIElGIEFSTTExMzZKUwotCi07Ly9JbnB1dCBBcmd1bWVudHMKLXBTcmMgICAgUk4gMCAgICAgICAgCi1wRHN0ICAgIFJOIDEgICAgICAgIAotc3RlcCAgICBSTiAyCi0KLTsvL0xvY2FsIFZhcmlhYmxlcwotQ291bnQgICBSTiAxNAotWDAgICAgICBSTiAyCi1YMSAgICAgIFJOIDQKLVJldHVybiAgUk4gMAotICAgICBNX1NUQVJUIG9teFZDQ09NTV9Db3B5OHg4LHI1Ci0gICAgICAgIAotICAgICAgICAKLSAgICAgICAgCi0gICAgICAgIE1PViAgIENvdW50LHN0ZXAgICAgICAgICAgICAgICAgIDsvL0NvdW50PXN0ZXAgCi0gICAgICAgIAotICAgICAgICBMRFJEICBYMCxbcFNyY10sQ291bnQgICAgICAgICAgICA7Ly9wU3JjIGFmdGVyIGxvYWRpbmcgOiBwU3JjPXBTcmMrc3RlcAotICAgICAgICBMRFJEICBYMSxbcFNyY10sQ291bnQKLSAgICAgICAgCi0gICAgICAgIFNUUkQgIFgwLFtwRHN0XSwjOCAgICAgICAgICAgICAgIAotICAgICAgICBMRFJEICBYMCxbcFNyY10sQ291bnQgCi0gICAgICAgIFNUUkQgIFgxLFtwRHN0XSwjOCAgICAgICAgICAgICAgIAotICAgICAgICBMRFJEICBYMSxbcFNyY10sQ291bnQKLSAgICAgICAgCi0gICAgICAgIFNUUkQgIFgwLFtwRHN0XSwjOCAgICAgICAgICAgICAgIAotICAgICAgICBMRFJEICBYMCxbcFNyY10sQ291bnQKLSAgICAgICAgU1RSRCAgWDEsW3BEc3RdLCM4ICAgICAgICAgICAgICAgCi0gICAgICAgIExEUkQgIFgxLFtwU3JjXSxDb3VudAotICAgICAgICAKLSAgICAgICAgU1RSRCAgWDAsW3BEc3RdLCM4ICAgICAgICAgICAgICAKLSAgICAgICAgTERSRCAgWDAsW3BTcm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SAgICAgICAgIFJOICA2Ci1wQm90dG9tSW5kZXggICAgUk4gIDcKLXggICAgICAgICAgICAgICBSTiAgOAoteSAgICAgICAgICAgICAgIFJOICA5Ci10ZW1wVG9wICAgICAgICAgUk4gIDEwCi10ZW1wQm90ICAgICAgICAgUk4gIDExCi1Db2xTdGVwICAgICAgICAgUk4gIDEyCi1wTGVmdCAgICAgICAgICAgUk4gIDUKLXBSaWdodCAgICAgICAgICBSTiAgNgotcFJpZ2h0SW5kZXggICAgIFJOICA3Ci10ZW1wTGVmdDEgICAgICAgUk4gIDEwCi10ZW1wUmlnaHQxICAgICAgUk4gIDExCi10ZW1wTGVmdDIgICAgICAgUk4gIDE0Ci10ZW1wUmlnaHQyICAgICAgUk4gIDIKLWluZGV4WSAgICAgICAgICBSTiAgMTQKLVJvd1N0ZXAgICAgICAgICBSTiAgMTIKLWV4cGFuZFRvNGJ5dGVzICBSTiAgMSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA7Ly8gY29weSBhIGJ5dGUgdG8gNCBieXRlcyBvZiBhIHdvcmQKLSAgICAKLSAgICAgICAgOy8vIEFsbG9jYXRlIHN0YWNrIG1lbW9yeSByZXF1aXJlZCBieSB0aGUgZnVuY3Rpb24KLSAgICAgICAgCi0gICAgICAgIAotICAgICAgICA7Ly8gV3JpdGUgZnVuY3Rpb24gaGVhZGVyCi0gICAgICAgIE1fU1RBUlQgb214VkNDT01NX0V4cGFuZEZyYW1lX0kscjExCi0gICAgICAgIAotICAgICAgICA7Ly8gRGVmaW5lIHN0YWNrIGFyZ3VtZW50cwotICAgICAgICBNX0FSRyAgIGlQbGFuZVN0ZXBPblN0YWNrLCA0Ci0gICAgICAgIAotICAgICAgICA7Ly8gTG9hZCBhcmd1bWVudCBmcm9tIHRoZSBzdGFjawotICAgICAgICBNX0xEUiAgIGlQbGFuZVN0ZXAsIGlQbGFuZVN0ZXBPblN0YWNrCi0gICAgICAgIAotICAgICAgICBNVUwgICAgIHBUb3AsaUV4cGFuZ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QsaVBsYW5lU3RlcF0gICAgICAgICAgICAgICAgICAgICA7Ly8gU3RvcmUgdGhlIDQgYnl0ZXMgYXQgb25lIGdvCi0gICAgICAgIFNUUiAgICAgdGVtcFJpZ2h0MixbcFJpZ2h0LGlQbGFuZVN0ZXBdCi0gICAgICAgIFNUUiAgICAgdGVtcExlZnQxLFtwTGVmdF0sIzQgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDsvLyBTdG9yZSB0aGUgNCBieXRlcyBhdCBvbmUgZ28KLSAgICAgICAgU1RSICAgICB0ZW1wUmlnaHQxLFtwUmlnaHRdLCM0Ci0gICAgICAgIEJHRSAgICAgRXhwYW5kRnJhbWVMZWZ0UmlnaHRYbG9vcAotICAgICAgICAKLSAgICAgICAgU1VCUyAgICB5LHksIzIKLSAgICAgICAgQUREICAgICBwTGVmdCxwTGVmdCxSb3dTdGVwCi0gICAgICAgIEFERCAgICAgcFJpZ2h0LHBSaWdodCxSb3dTdGVwCi0gICAgICAgIEJHVCAgICAgRXhwYW5kRnJhbWVMZWZ0UmlnaHRZbG9vcAotICAgICAgICAKLSAgICAgICAgICAgICAgICAgICAgICAgIAotICAgICAgICA7Ly8gU2V0IHJldHVybiB2YWx1ZQotICAgICAgICAgIAotICAgICAgICBNT1YgICAgICAgICByZXN1bHQsI09NWF9TdHNfTm9FcnIgIAotRW5kICAgICAgICAgICAgIAotICAgICAgCi0gICAgICAgIDsvLyBXcml0ZSBmdW5jdGlvbiB0YWlsCi0gICAgICAgIAotICAgICAgICBNX0VORAotICAgICAgICAKLSAgICBFTkRJRiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA7Ly9BUk0xMTM2SlMgICAgICAgIAotIAotICAgICAgICAgICAgCi0gICAgRU5EClwgTm8gbmV3bGluZSBhdCBlbmQgb2YgZmlsZQpkaWZmIC0tZ2l0IGEvbWVkaWEvbGlic3RhZ2VmcmlnaHQvY29kZWNzL29uMi9oMjY0ZGVjL29teGRsL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HRCLCBpUHJlZEExLCBpUHJlZEIxCi0gICAgICAgIEVPUiAgICAgICAgIFJlc3VsdEEsIFJlc3VsdEEsIHIweDgwODA4MDgwCi0gICAgICAgIE1fU1RSICAgICAgIFJlc3VsdEEsIFtwRHN0UHJlZF0sIGlEc3RTdGVwICAgICAgICAKLSAgICAgICAgRU9SICAgICAgICAgUmVzdWx0QiwgUmVzdWx0QiwgcjB4ODA4MDgwODAKLSAgICAgICAgTV9TVFIgICAgICAgUmVzdWx0QiwgW3BEc3RQcmVkXSwgaURzdFN0ZXAgICAgICAgIAotICAgICAgICAKLSAgICAgICAgOy8vIDJuZCBsb2FkCi0gICAgICAgIE1fTERSICAgICAgIGlQcmVkQTAsIFtwUHJlZDBdLCBpUHJlZFN0ZXAwICAgICAgICAKLSAgICAgICAgTV9MRFIgICAgICAgaVByZWRCMCwgW3BQcmVkMV0KLSAgICAgICAgTV9MRFIgICAgICAgaVByZWRBMSwgW3BQcmVkMF0sIGlQcmVkU3RlcDAKLSAgICAgICAgTV9MRFIgICAgICAgaVByZWRCMSwgW3BQcmVkMSwgaVByZWRTdGVwMV0KLQotICAgICAgICBNVk4gICAgICAgICBpUHJlZEIwLCBpUHJlZEIwCi0gICAgICAgIFVIU1VCOCAgICAgIFJlc3VsdEEsIGlQcmVkQTAsIGlQcmVkQjAKLSAgICAgICAgTVZOICAgICAgICAgaVByZWRCMSwgaVByZWRCMQotICAgICAgICBVSFNVQjggICAgICBSZXN1bHRCLCBpUHJlZEExLCBpUHJlZEIxCi0gICAgICAgIEVPUiAgICAgICAgIFJlc3VsdEEsIFJlc3VsdEEsIHIweDgwODA4MDgwICAgICAgICAKLSAgICAgICAgTV9TVFIgICAgICAgUmVzdWx0QSwgW3BEc3RQcmVkXSwgaURzdFN0ZXAgICAgICAgIAotICAgICAgICBFT1IgICAgICAgICBSZXN1bHRCLCBSZXN1bHRCLCByMHg4MDgwODA4MAotICAgICAgICBNX1NUUiAgICAgICBSZXN1bHRCLCBbcERzdFByZ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ICAgICAgICAKLSAgICAgICAgTU9WICAgICAgICAgaVByZWRBMSwgaVByZWRBMSwgTFNSICMxNgotICAgICAgICBPUlIgICAgICAgICBpUHJlZEExLCBpUHJlZEExLCBUZW1wMiwgTFNMICMxNgotCi0gICAgICAgIDsvLyAoYStiKzEpLzIgPSAoYSsyNTYtKDI1NS1iKSkvMiA9IChhLSgyNTUtYikpLzIgKyAxMjgKLSAgICAgICAgVUhTVUI4ICAgICAgUmVzdWx0QSwgaVByZWRBMCwgaVByZWRCMAotICAgICAgICBVSFNVQjggICAgICBSZXN1bHRCLCBpUHJlZEExLCBpUHJlZEIxCi0gICAgICAgIEVPUiAgICAgICAgIFJlc3VsdEEsIFJlc3VsdEEsIHIweDgwODA4MDgwCi0gICAgICAgIE1fU1RSICAgICAgIFJlc3VsdEEsIFtwRHN0UHJlZF0sIGlEc3RTdGVwICAgICAgICAKLSAgICAgICAgRU9SICAgICAgICAgUmVzdWx0QiwgUmVzdWx0QiwgcjB4ODA4MDgwODAKLSAgICAgICAgTV9TVFIgICAgICAgUmVzdWx0QiwgW3BEc3RQcmVkXSwgaURzdFN0ZXAgICAgICAgIAotICAgICAgICAKLSAgICAgICAgOy8vIDJuZCBsb2FkCi0gICAgICAgIExEUiAgICAgICAgIFRlbXAxLCBbcFByZWQwLCAjNF0KLSAgICAgICAgTV9MRFIgICAgICAgICBpUHJlZEEwLCBbcFByZWQwXSwgaVByZWRTdGVwMCAgICAgICAgCi0gICAgICAgIExEUiAgICAgICAgIGlQcmVkQjAsIFtwUHJlZDFdCi0gICAgICAgIExEUiAgICAgICAgIGlQcmVkQjEsIFtwUHJlZDEsIGlQcmVkU3RlcDFdCi0gICAgICAgIExEUiAgICAgICAgIFRlbXAyLCBbcFByZWQwLCAjNF0KLSAgICAgICAgTV9MRFIgICAgICAgICBpUHJlZEExLCBbcFByZWQwXSwgaVByZWRTdGVwMAotICAgICAgICBNVk4gICAgICAgICBpUHJlZEIwLCBpUHJlZEIwCi0gICAgICAgIE1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AgICAgIAotICAgICAgICBMRFIgICAgICAgICByMHg4MDgwODA4MCwgPTB4ODA4MDgwODAKLQotICAgICAgICA7Ly8gMXN0IGxvYWQKLSAgICAgICAgTERSICAgICAgICAgVGVtcDEsIFtwUHJlZDAsICM0XQotICAgICAgICBNX0xEUiAgICAgICBpUHJlZEEwLCBbcFByZWQwXSwgaVByZWRTdGVwMCAgICAgICAgCi0gICAgICAgIExEUiAgICAgICAgIGlQcmVkQjAsIFtwUHJlZDFdCi0gICAgICAgIExEUiAgICAgICAgIGlQcmVkQjEsIFtwUHJlZDEsIGlQcmVkU3RlcDFdCi0gICAgICAgIExEUiAgICAgICAgIFRlbXAyLCBbcFByZWQwLCAjNF0KLSAgICAgICAgTV9MRFIgICAgICAgaVByZWRBMSwgW3BQcmVkMF0sIGlQcmVkU3RlcDAKLQotICAgICAgICBNVk4gICAgICAgICBpUHJlZEIwLCBpUHJlZEIwCi0gICAgICAgIE1WTiAgICAgICAgIGlQcmVkQjEsIGlQcmVkQjEKLSAgICAgICAgTU9WICAgICAgICAgaVByZWRBMCwgaVByZWRBMCwgTFNSICMyNAotICAgICAgICBPUlIgICAgICAgICBpUHJlZEEwLCBpUHJlZEEwLCBUZW1wMSwgTFNMICM4ICAgICAgICAgICAgICAgIAotICAgICAgICBNT1YgICAgICAgICBpUHJlZEExLCBpUHJlZEExLCBMU1IgIzI0Ci0gICAgICAgIE9SUiAgICAgICAgIGlQcmVkQTEsIGlQcmVkQTEsIFRlbXAyLCBMU0wgIzgKLSAgICAgICAgVUhTVUI4ICAgICAgUmVzdWx0QSwgaVByZWRBMCwgaVByZWRCMAotICAgICAgICBVSFNVQjggICAgICBSZXN1bHRCLCBpUHJlZEExLCBpUHJlZEIxCi0gICAgICAgIEVPUiAgICAgICAgIFJlc3VsdEEsIFJlc3VsdEEsIHIweDgwODA4MDgwCi0gICAgICAgIE1fU1RSICAgICAgIFJlc3VsdEEsIFtwRHN0UHJlZF0sIGlEc3RTdGVwICAgICAgICAKLSAgICAgICAgRU9SICAgICAgICAgUmVzdWx0QiwgUmVzdWx0QiwgcjB4ODA4MDgwODAKLSAgICAgICAgTV9TVFIgICAgICAgUmVzdWx0QiwgW3BEc3RQcmVkXSwgaURzdFN0ZXAgICAgICAgIAotICAgICAgICAKLSAgICAgICAgOy8vIDJuZCBsb2FkCi0gICAgICAgIExEUiAgICAgICAgIFRlbXAxLCBbcFByZWQwLCAjNF0KLSAgICAgICAgTV9MRFIgICAgICAgaVByZWRBMCwgW3BQcmVkMF0sIGlQcmVkU3RlcDAgICAgICAgIAotICAgICAgICBMRFIgICAgICAgICBpUHJlZEIwLCBbcFByZWQxXQotICAgICAgICBMRFIgICAgICAgICBpUHJlZEIxLCBbcFByZWQxLCBpUHJlZFN0ZXAxXQotICAgICAgICBMRFIgICAgICAgICBUZW1wMiwgW3BQcmVkMCwgIzRdCi0gICAgICAgIE1fTERSICAgICAgIGlQcmVkQTEsIFtwUHJlZDBdLCBpUHJlZFN0ZXAwCi0KLSAgICAgICAgTVZOICAgICAgICAgaVByZWRCMCwgaVByZWRCMAotICAgICAgICBNVk4gICAgICAgICBpUHJlZEIxLCBpUHJlZEIxCi0gICAgICAgIE1PViAgICAgICAgIGlQcmVkQTAsIGlQcmVkQTAsIExTUiAjMjQKLSAgICAgICAgT1JSICAgICAgICAgaVByZWRBMCwgaVByZWRBMCwgVGVtcDEsIExTTCAjOCAgICAgICAgCi0gICAgICAgIE1PViAgICAgICAgIGlQcmVkQTEsIGlQcmVkQTEsIExTUiAjMjQKLSAgICAgICAgT1JSICAgICAgICAgaVByZWRBMSwgaVByZWRBMSwgVGVtcDIsIExTTCAjOAotCi0gICAgICAgIFVIU1VCOCAgICAgIFJlc3VsdEEsIGlQcmVkQTAsIGlQcmVkQjAKLSAgICAgICAgVUhTVUI4ICAgICAgUmVzdWx0QiwgaVByZWRBMSwgaVByZWRCMQotICAgICAgICBFT1IgICAgICAgICBSZXN1bHRBLCBSZXN1bHRBLCByMHg4MDgwODA4MCAgICA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NMVDRfdW5zYWZlLCBscgotCi0gICAgICAgIDsvLyBTaW5jZSBiZXRhIDw9IDE4IGFuZCBhbHBoYSA8PSAyNTUgd2Uga25vdwotICAgICAgICA7Ly8gLTI1NCA8PSBwMC1xMCA8PSAyNTQKLSAgICAgICAgOy8vICAtMTcgPD0gcTEtcTAgPD0gMTcKLSAgICAgICAgOy8vICAtMTcgPD0gcDEtcDAgPD0gMTcKLQotICAgICAgICA7Ly8gZGVsdGEgPSBDbGlwMyggLXRDLCB0QywgKCgoKHEwLXAwKTw8MikgKyAocDEtcTEpICsgNCk+PjMpKQotICAgICAgICA7Ly8gCi0gICAgICAgIDsvLyAgICBDYWxjdWxhdGUgQSA9ICgoKHEwLXAwKTw8MikgKyAocDEtcTEpICsgNCk+PjMKLSAgICAgICAgOy8vICAgICAgICAgICAgICAgID0gKDQqcTAgLSA0KnAwICsgcDEgLSBxMSArIDQpPj4zCi0gICAgICAgIDsvLyAgICAgICAgICAgICAgICA9ICgocDEtcDApIC0gKHExLXEwKSAtIDMqKHAwLXEwKSArIDQpPj4zCi0gICAgICAgIAotICAgICAgICBVU1VCOCAgIHQxLCBwXzEsIHBfMAotICAgICAgICBNVUwgICAgIHRDMCwgdDIsIG0wMQotICAgICAgICAKLSAgICAgICAgVVNVQjggICB0MiwgcV8xLCBxXzAKLSAgICAgICAgU1NVQjggICB0MSwgdDEsIHQyCi0KLSAgICAgICAgVVNVQjggICB0MiwgcF8wLCBxXzAKLSAgICAgICAgQU5EICAgICB0MiwgdDIsIG0wMQotICAgICAgICBTSFNVQjggIHQxLCB0MSwgdDIKLSAgICAgICAgVUhTVUI4ICB0NSwgcF8wLCBxXzAKLSAgICAgICAgU1NVQjggICB0MSwgdDEsIHQyCi0gICAgICAgIFNIU1VCOCAgdDEsIHQxLCB0NQotICAgICAgICBNT1YgICAgIG0wMCwgIzAKLSAgICAgICAgU0FERDggICB0MSwgdDEsIG0wMQotICAgICAgICBTSFNVQjggIHQxLCB0MSwgdDUKLSAgIC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ICAgICAgICBTRUwgICAgIFEwYSwgUTBhLCBxXzAKLSAgICAKLSAgICAgICAgOy8vIGRlbHRhID0gKHAyICsgKChwMCtxMCsxKT4+MSkgLSAocDE8PDEpKT4+MTsKLSAgICAgICAgOy8vIHUxID0gKHAwICsgcTAgKyAxKT4+MQotICAgICAgICA7Ly8gdTEgPSAoIChxXzAgLSBwXzAnKT4+MSApIF4gMHg4MAotICAgICAgICBNVk4gICAgIHBfMCwgcF8wCi0gICAgICAgIFVIU1VCOCAgdTEsIHFfMCwgcF8wIAotICAgICAgICBVUUFERDggIG1heCwgcF8xLCB0QzAKLSAgICAgICAgRU9SICAgICB1MSwgdTEsIG0wMSAsTFNMICM3Ci0gICAgCi0gICAgICAgIDsvLyBDYWxjdWxhdGUgQSA9IChwMit1MSk+PjEgCi0gICAgICAgIDsvLyBUaGVuIGRlbHRhID0gQ2xpcDMoIC10QzAsIHRDMCwgQSAtIHAxKQotCi0gICAgICAgIDsvLyBDbGlwIFAxCi0gICAgICAgIFVIQUREOCAgUDFhLCBwXzIsIHUxCi0gICAgICAgIFVRU1VCOCAgbWluLCBwXzEsIHRDMAotICAgICAgICBVU1VCOCAgIHQ0LCBQMWEsIG1heAotICAgICAgICBTRUwgICAgIFAxYSwgbWF4LCBQMWEKLSAgICAgICAgVVNVQjggICB0NCwgUDFhLCBtaW4KLSAgICAgICAgU0VMICAgICBQMWEsIFAxYSwgbWluCi0KLSAgICAgICAgOy8vIENsaXAgUTEKLSAgICAgICAgVUhBREQ4ICBRMWEsIHFfMiwgdTEKLSAgICAgICAgVVFBREQ4ICBtYXgsIHFfMSwgdEMwCi0gICAgICAgIFVRU1VCOCAgbWluLCBxXzEsIHRDMAotICAgICAgICBVU1VCOCAgIHQwLCBRMWEsIG1heAotICAgICAgICBTRUwgICAgIFExYSwgbWF4LCBRMWEKLSAgICAgICAgVVNVQjggICB0MCwgUTFhLCBtaW4KLSAgICAgICAgU0VMICAgICBRMWEsIFExYSwgbWluCi0gICAgICAgIA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FfMyw0Ci0gICAgICAgIE1fQVJHICAgcFBfMyw0Ci0gICAgICAgIAotICAgICAgICBVSEFERDggIGFscGhhLCBhbHBoYSwgbTAwCi0gICAgICAgIFVTVUI4ICAgdDksIHBfMiwgcF8wICAgIDsvL3Q5ID0gZHAycDAKLSAgICAgICAgVUhBREQ4ICBhbHBoYSwgYWxwaGEsIG0wMAotICAgICAgICBBREQgICAgIGFscGhhLCBhbHBoYSwgbTAxLCBMU0wgIzEgICAgICAgIAotICAgICAgICBVU1VCOCAgIGFwMHEwLCBhcDBxMCwgYWxwaGEKLSAgICAgICAgU0VMICAgICBhcHFmbGcsIG0wMCwgYXBmbGcKLQotICAgICAgICA7Ly8gUDAgPSAocDIgKyAyKnAxICsgMipwMCArIDIqcTAgKyBxMSArIDQpPj4zIAotICAgICAgICA7Ly8gICAgPSAoKHAyLXAwKSArIDIqKHAxLXAwKSArIChxMS1xMCkgKyAzKihxMC1wMCkgKyA4KnAwICsgNCk+PjMKLSAgICAgICAgOy8vICAgID0gcDAgKyAoKChwMi1wMCkgKyAyKihwMS1wMCkgKyAocTEtcTApIC0gMyoocDAtcTApICsgNCk+PjMpCi0KLSAgICAgICAgOy8vIFAxID0gKHAyICsgcDEgKyBxMCArIHAwICsgMik+PjIKLSAgICAgICAgOy8vICAgID0gcDAgKyAoKChwMi1wMCkgKyAocDEtcDApIC0gKHAwLXEwKSArIDIpPj4yKQotICAgICAgICAKLSAgICAgICAgOy8vIFAyID0gKDIqcDMgKyAzKnAyICsgcDEgKyBwMCArIHEwICsgNCk+PjMKLSAgICAgICAgOy8vICAgID0gKDIqKHAzLXAwKSArIDMqKHAyLXAwKSArIChwMS1wMCkgLSAocDAtcTApICsgOCpwMCArIDQpPj4zCi0gICAgICAgIDsvLyAgICA9IHAwICsgKCgocDMtcDApICsgKHAyLXAwKSArIHQyICsgMik+PjIpCi0KLSAgICAgICAgOy8vIENvbXB1dGUgUDBiCi0gICAgICAgIFVTVUI4ICAgdDIsIHBfMCwgcV8wICAgICAgICAgCi0gICAgICAgIFNTVUI4ICAgdDUsIHQ5LCB0MiAgICAgICAgICAgCi0KLSAgICAgICAgVVNVQjggICB0OCwgcV8xLCBxXzAgICAgICAgICAKLSAgICAgICAgU0hBREQ4ICB0OCwgdDUsIHQ4Ci0KLSAgICAgICAgVVNVQjggICB0OSwgcF8xLCBwXzAgICAgICAgICAKLSAgICAgICAgU0FERDggICB0OCwgdDgsIHQ5Ci0gICAgICAgIFNIU1VCOCAgdDgsIHQ4LCB0MgotICAgICAgICBTSEFERDggIHQ1LCB0NSwgdDkKLSAgICAgICAgU0hBREQ4ICB0OCwgdDgsIG0wMQotICAgICAgICBTSEFERDggIHQ5LCB0NSwgbTAxCi0gICAgICAgIFNBREQ4ICAgUDBiLCBwXzAsIHQ4ICAgICAgICAgCi0gICAgICAgIDsvLyBQMGIgcmVhZHkKLSAgICAgICAgCi0gICAgICAgIDsvLyBDb21wdXRlIFAxYgotICAgICAgICBNX0xEUiAgIHBfM2IsIHBQXzMKLSAgICAgICAgU0FERDggICBQMWIsIHBfMCwgdDkgICAgICAgICAKLSAgICAgICAgOy8vIFAxYiByZWFkeQotICAgICAgICAKLSAgICAgICAgOy8vIENvbXB1dGUgUDJiCi0gICAgICAgIFVTVUI4ICAgdDksIHBfMiwgcF8wICAgICAgICAgCi0gICAgICAgIFNBREQ4ICAgdDUsIHQ1LCB0OQotICAgICAgICBVSFNVQjggIHQ5LCBwXzNiLCBwXzAgICAgICAgIAotICAgICAgICBFT1IgICAgIGEsIHBfM2IsIHBfMCAgICAgICAgIAotICAgICAgICBBTkQgICAgIGEsIGEsIG0wMQotICAgICAgICBTSEFERDggIHQ1LCB0NSwgYQotICAgICAgICBVSEFERDggIGEsIHBfMCwgcV8xCi0gICAgICAgIFNBREQ4ICAgdDUsIHQ1LCBtMDEKLSAgICAgICAgU0hBREQ4ICB0NSwgdDUsIHQ5Ci0gICAgICAgIE1WTiAgICAgdDksIHBfMQotICAgICAgICBTQUREOCAgIFAyYiwgcF8wLCB0NSAgICAgICAgIAotICAgICAgICA7Ly8gUDJiIHJlYWR5Ci0gICAgICAgIAotICAgICAgICBVSFNVQjggIGEsIGEsIHQ5Ci0gICAgICAgIE9SUiAgICAgdDksIGFwcWZsZywgbTAxCi0gICAgICAgIFVTVUI4ICAgdDksIGFwcWZsZywgdDkKLQotICAgICAgICBFT1IgICAgIGEsIGEsIG0wMSwgTFNMICM3Ci0gICAgICAgIFNFTCAgICAgUDBiLCBQMGIsIGEKLSAgICAgICAgU0VMICAgICBQMWIsIFAxYiwgcF8xCi0gICAgICAgIFNFTCAgICAgUDJiLCBQMmIsIHBfMgotCi0gICAgICAgIFVTVUI4ICAgdDQsIGZpbHQsIG0wMQotICAgICAgICBTRUwgICAgIFAwYiwgUDBiLCBwXzAKLQotICAgICAgICAKLSAgICAgICAgOy8vIFEwID0gKHEyICsgMipxMSArIDIqcTAgKyAyKnAwICsgcDEgKyA0KT4+MyAKLSAgICAgICAgOy8vICAgID0gKChxMi1xMCkgKyAyKihxMS1xMCkgKyAocDEtcDApICsgMyoocDAtcTApICsgOCpxMCArIDQpPj4zCi0gICAgICAgIDsvLyAgICA9IHEwICsgKCgocTItcTApICsgMioocTEtcTApICsgKHAxLXAwKSArIDMqKHAwLXEwKSArIDQpPj4zKQotCi0gICAgICAgIDsvLyBRMSA9IChxMiArIHExICsgcDAgKyBxMCArIDIpPj4yCi0gICAgICAgIDsvLyAgICA9IHEwICsgKCgocTItcTApICsgKHExLXEwKSArIChwMC1xMCkgKyAyKT4+MikKLQotICAgICAgICA7Ly8gUTIgPSAoMipxMyArIDMqcTIgKyBxMSArIHEwICsgcDAgKyA0KT4+MwotICAgICAgICA7Ly8gICAgPSAoMioocTMtcTApICsgMyoocTItcTApICsgKHExLXEwKSArIChwMC1xMCkgKyA4KnEwICsgNCk+PjMKLSAgICAgICAgOy8vICAgID0gcTAgKyAoKChxMy1xMCkgKyAocTItcTApICsgdDIgKyAyKT4+MikKLQotCi0gICAgICAgIDsvLyBDb21wdXRlIFEwYiBRMWIKLSAgICAgICAgVVNVQjggICB0NCwgcV8yLCBxXzAgICAgICAgICAgIAotICAgICAgICBVU1VCOCAgIGEsIHBfMCwgcV8wCi0gICAgICAgIFVTVUI4ICAgdDksIHBfMSwgcF8wCi0gICAgICAgIFNBREQ4ICAgdDAsIHQ0LCBhCi0gICAgICAgIFNIQUREOCAgdDksIHQwLCB0OQotICAgICAgICBVSEFERDggIHQxMCwgcV8wLCBwXzEKLSAgICAgICAgU0FERDggICB0OSwgdDksIGEKLSAgICAgICAgVVNVQjggICBhLCBxXzEsIHFfMAotICAgICAgICBTSEFERDggIHQ5LCB0OSwgYQotICAgICAgICBTSEFERDggIHQwLCB0MCwgYQotICAgICAgICBTSEFERDggIHQ5LCB0OSwgbTAxCi0gICAgICAgIFNIQUREOCAgYSwgdDAsIG0wMQotICAgICAgICBTQUREOCAgIHQ5LCBxXzAsIHQ5ICAgICAgICAgICAgCi0gICAgICAgIDsvLyBRMGIgcmVhZHkgLSB0OQotICAgICAgICAKLSAgICAgICAgTU9WICAgICB0NCwgIzAKLSAgICAgICAgVUhBREQ4ICBhcHFmbGcsIGFwcWZsZywgdDQKLSAgICAgICAgCi0gICAgICAgIFNBREQ4ICAgUTFiLCBxXzAsIGEgCi0gICAgICAgIDsvLyBRMWIgcmVhZHkKLSAgICAgICAKLSAgICAgICAgVVNVQjggICB0NCwgYXBxZmxnLCBtMDEKLSAgICAgICAgU0VMICAgICBRMWIsIFExYiwgcV8xCi0gICAgICAgIE1WTiAgICAgdDExLCBxXzEKLSAgICAgICAgVUhTVUI4ICB0MTAsIHQxMCwgdDExCi0gICAgICAgIE1fTERSICAgcV8zYiwgcFFfMwotICAgICAgICBFT1IgICAgIHQxMCwgdDEwLCBtMDEsIExTTCAjNwotICAgICAgICBTRUwgICAgIHQ5LCB0OSwgdDEwICAgICAgICAgICAgCi0gICAgICAgIAotICAgICAgICA7Ly8gQ29tcHV0ZSBRMmIKLSAgICAgICAgVVNVQj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UX0NPRUZGICAgICAgICAgICAgICAgRVFVIDB4MjAgICAgICAgIDsvLyBFbmQgb2YgYmxvY2sgZmxhZwotVFdPX0JZVEVfQ09FRkYgICAgICAgICAgIEVRVSAweDEwCi0KLTsvLyBEZWNsYXJlIGlucHV0IHJlZ2lzdGVycwotCi1wcEJpdFN0cmVhbSAgICAgUk4gMAotcE9mZnNldCAgICAgICAgIFJOIDEKLXBOdW1Db2VmZiAgICAgICBSTiAyCi1wcFBvc0NvZWZidWYgICAgUk4gMwotbkMgICAgICAgICAgICAgIFJOIDQgOy8vIG51bWJlciBvZiBjb2VmZnMgb3IgMTcgZm9yIGNocm9tYQotc01heE51bUNvZWZmICAgIFJOIDUKLQotOy8vIERlY2xhcmUgaW5uZXIgbG9vcCByZWdpc3RlcnMKLQotOy8vIExldmVsIGxvb3AKLUNvdW50ICAgICAgICAgICBSTiAwCi1UcmFpbGluZ09uZXMgICAgUk4gMQotcExldmVsICAgICAgICAgIFJOIDIKLUxldmVsU3VmZml4ICAgICBSTiAzCi1TdWZmaXhMZW5ndGggICAgUk4gNAotVG90YWxDb2VmZiAgICAgIFJOIDUKLQotcFZMRFRhYmxlICAgICAgIFJOIDYKLVN5bWJvbCAgICAgICAgICBSTiA3Ci1UMSAgICAgICAgICAgICAgUk4gOAotVDIgICAgICAgICAgICAgIFJOIDkKLVJCaXRTdHJlYW0gICAgICBSTiAxMAotUkJpdEJ1ZmZlciAgICAgIFJOIDExCi1SQml0Q291bnQgICAgICAgUk4gMTIKLWxyICAgICAgICAgICAgICBSTiAxNAotCi07Ly8gUnVuIGxvb3AKLUNvdW50ICAgICAgICAgICBSTiAwCi1aZXJvc0xlZnQgICAgICAgUk4gMQotcExldmVsICAgICAgICAgIFJOIDIKLXBwUnVuVGFibGUgICAgICBSTiAzCi1wUnVuICAgICAgICAgICAgUk4gNAotVG90YWxDb2VmZiAgICAgIFJOIDUKLQotcFZMRFRhYmxlICAgICAgIFJOIDYKLVN5bWJvbCAgICAgICAgICBST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ZlbD0lZFxuIiwgVDEKLSAgICAgICAgU1RSSCAgICBUMSwgW3BMZXZlbF0sICMyICAgICAgICAgICAgOy8vIFN0b3JlIGxldmVsLgotICAgICAgICAKLSAgICAgICAgTERSICAgICBUMiwgPWFybVZDTTRQMTBfU3VmZml4VG9MZXZlbAotICAgICAgICBMRFJTQiAgIFQxLCBbVDIsIFN1ZmZpeExlbmd0aF0gICAgICA7Ly8gRmluZCBpbmNyZW1lbnQgbGV2ZWwgICAgICAgIAotICAgICAgICBURVEgICAgIFN1ZmZpeExlbmd0aCwgIzAKLSAgICAgICAgTU9WRVEgICBTdWZmaXhMZW5ndGgsICMxCi0gICAgICAgIENNUCAgICAgU3ltYm9sLCBUMQotICAgICAgICBBRERDUyAgIFN1ZmZpeExlbmd0aCwgU3VmZml4TGVuZ3RoLCAjMSAgICAgICAgCi0gICAgICAgIFNVQlMgICAgQ291bnQsIENvdW50LCAjMSAgICAgICAgCi0gICAgICAgIEJHVCAgICAgTGV2ZWxMb29wCi0gICAgICAgIAotRGVjb2RlUnVucyAgICAgICAgCi0gICAgICAgIDsvLyBGaW5kIG51bWJlciBvZiB6ZXJvcwotICAgICAgICBNX0xEUiAgIFQxLCBwU01heE51bUNvZWZmICAgICAgICAgICA7Ly8gc01heE51bUNvZWZmCi0gICAgICAgIFNVQiAgICAgQ291bnQsIFRvdGFsQ29lZmYsICMxICAgICAgIDsvLyBOdW1iZXIgb2YgcnVucyBleGNsdWRpbmcgbGFzdAotICAgICAgICBTVUJTICAgIFplcm9zTGVmdCwgVDEsIFRvdGFsQ29lZmYgICA7Ly8gTWF4aW11bSBudW1iZXIgb2YgemVyb3MgdGhlcmUgY291bGQgYmUKLSAgICAgICAgTV9BRFIgICBwUnVuLCBwcFJ1bgotICAgICAgICBNT1YgICAgIENvZWZmTnVtLFRvdGFsQ29lZmYKLSAgICAgICAgU1VCICAgICBDb2VmZk51bSxDb2VmZk51bSwjMQotICAgICAgICBCRVEgICAgIE5vWmVyb3NMZWZ0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l0KLSAgICAgICAgQkxUICAgICBMYXN0UnVuCi0gICAgICAgIE1fQkRfVkxEICBTeW1ib2wsIFQxLCBUMiwgcFZMRFRhYmxlLCAzLCAyIDsvLyBTeW1ib2wgPSBSdW4KLSAgICAgICAgQ01QICAgICBTeW1ib2wsIzE1ICAgICAgICAgCi0gICAgICAgIEJHRSAgICAgRW5kQmFkU3ltYm9sICAgICAgICAKLQotICAgICAgICBTVUJTICAgIFplcm9zTGVmdCwgWmVyb3NMZWZ0LCBTeW1ib2wKLSAgICAgICAgTV9QUklOVEYgIlJ1bj0lZFxuIiwgU3ltYm9sCi0gICAgICAgIFNUUkIgICAgU3ltYm9sLCBbcFJ1bl0sICMxCi0gICAgICAgIEJHVCAgICAgUnVuTG9vcAotICAgICAgICAKLSAgICAgICAgOy8vIERlY29kZSBydW5zIHdoaWxlIG5vIHplcm9zIGFyZSBsZWZ0Ci1Ob1plcm9zTGVmdCAKLSAgICAgICAgU1VCUyAgICBDb3VudCwgQ291bnQsICMxCi0gICAgICAgIE1fUFJJTlRGICJSdW49JWRcbiIsIFplcm9zTGVmdAotICAgICAgICBTVFJHRUIgIFplcm9zTGVmdCwgW3BSdW5dLCAjMQotICAgICAgICBCR1QgICAgIE5vWmVyb3NMZWZ0Ci0KLUxhc3RSdW4gICAgICAgIAotICAgICAgICA7Ly8gRmluYWwgcnVuIGxlbmd0aCBpcyByZW1haW5pbmcgemVyb3MKLSAgICAgICAgTV9QUklOVEYgIkxhc3RSdW49JWRcbiIsIFplcm9zTGVmdAotICAgICAgICBTVFJCICAgIFplcm9zTGVmdCwgW3BSdW5dLCAjMSAgICAgICAgCi0gICAgICAgIAotICAgICAgICA7Ly8gV3JpdGUgY29lZmZpY2llbnRzIHRvIG91dHB1dCBhcnJheQotICAgICAgICBNX0xEUiAgIFQxLCBwU01heE51bUNvZWZmICAgICAgICAgICAgICAgICAgICA7Ly8gc01heE51bUNvZWZmCi0gICAgICAgIFRFUSAgICAgVDEsICMxNQotICAgICAgICBBRERFUSAgIENvZWZmTnVtLENvZWZmTnVtLCMxCi0gICAgICAgIAotCi0gICAgICAgIFNVQiAgICAgcFJ1bixwUnVuLFRvdGFsQ29lZmYKLSAgICAgICAgU1VCICAgICBwTGV2ZWwscExldmVsLFRvdGFsQ29lZmYgIAotICAgICAgICBTVUIgICAgIHBMZXZlbCxwTGV2ZWwsVG90YWxDb2VmZiAgIAotCi0gICAgICAgIE1fTERSICAgcHBQb3NDb2VmYnVmLCBwcHBQb3NDb2VmYnVmCi0gICAgICAgIExEUiAgICAgcFBvc0NvZWZidWYsIFtwcFBvc0NvZWZidWZdCi0gICAgICAgIFRFUSAgICAgVDEsICM0Ci0gICAgICAgIExEUkVRICAgcFppZ1phZywgPWFybVZDTTRQMTBfWmlnWmFnXzJ4MgotICAgICAgICBMRFJORSAgIHBaaWdaYWcsID1hcm1WQ000UDEwX1ppZ1phZ180eDQKLQotICAgICAgICAKLSAgICAgICAgCi1PdXRwdXRMb29wCi0gICAgICAgIAotICAgICAgICBMRFJCICAgIFQyLCBbcFJ1bl0sIzEKLSAgICAgICAgTERSQiAgICBUMSwgW3BaaWdaYWcsIENvZWZmTnVtXQotICAgICAgICBTVUIgICAgIENvZWZmTnVtLCBDb2VmZk51bSwgIzEgICAgICA7Ly8gU2tpcCBOb24gemVybwotICAgICAgICBTVUIgICAgIENvZWZmTnVtLCBDb2VmZk51bSwgVDIgICAgICA7Ly8gU2tpcCBaZXJvIHJ1bgotICAgICAgICAKLSAgICAgICAgTERSU0ggICBUMiwgW3BMZXZlbF0sIzIKLSAgICAgICAgCi0gICAgICAgIFNVQlMgICAgVG90YWxDb2VmZiwgVG90YWxDb2VmZiwgIzEgICAgICAgCi0gICAgICAgIE9SUkVRICAgVDEsIFQxLCAjTEFTVF9DT0VGRgotICAgICAgICAKLSAgICAgICAgQUREICAgICB0ZW1wLCBUMiwgIzEyOAotICAgICAgICBDTVAgICAgIHRlbXAsICMyNTYKLSAgICAgICAgT1JSQ1MgICBUMSwgVDEsICNUV09fQllURV9DT0VGRgotCi0gICAgICAgIAotICAgICAgICBURVEgICAgIFRvdGFsQ29lZmYsICMwICAgICAgICAgICAgICA7Ly8gUHJlc2VydmVzIGNhcnJ5ICAgICAgICAKLSAgICAgICAgCi0gICAgICAgIE1fUFJJTlRGICJPdXRwdXQ9JTAyeCAlMDR4XG4iLCBUMSwgVDIKLSAgICAgICAgU1RSQiAgICBUMSwgW3BQb3NDb2VmYnVmXSwgIzEKLSAgICAgICAgU1RSQiAgICBUMiwgW3BQb3NDb2VmYnVmXSwgIzEKLSAgICAgICAgTU9WICAgICBUMiwgVDIsIExTUiAjOAotICAgICAgICBTVFJDU0IgIFQyLCBbcFBvc0NvZWZidWZdLCAjMSAgICAgICAgICAgICAgICAKLSAgICAgICAgQk5FICAgICBPdXRwdXRMb29wCi0gICAgICAgIAotICAgICAgICA7Ly8gRmluaXNoZWQKLSAgICAgICAgU1RSICAgICBwUG9zQ29lZmJ1ZiwgW3BwUG9zQ29lZmJ1Zl0KLSAgICAgICAgTV9MRFIgICBwcEJpdFN0cmVhbSwgcHBwQml0U3RyZWFtCi0gICAgICAgIE1fTERSICAgcE9mZnNldCwgcHBPZmZzZXQKLSAgICAgICAgQiAgICAgICBFbmROb0Vycm9yCi0gICAgICAgICAgICAKLUVuZEJhZFN5bWJvbAotICAgICAgICBNT1YgICAgIHIwLCAjT01YX1N0c19FcnIKLSAgICAgICAgQiAgICAgICBFbmQgICAgCi0gICAgICAgIAotRW5kTm9FcnJvcgotICAgICAgICA7Ly8gRmluaXNoZWQgcmVhZGluZyBmcm9tIHRoZSBiaXRzdHJlYW0gICAgICAgICAgICAgICAgCi0gICAgICAgIE1fQkRfRklOSSBwcEJpdFN0cmVhbSwgcE9mZnNldAotICAgICAgICAKLSAgICAgICAgOy8vIFNldCByZXR1cm4gdmFsdWUKLSAgICAgICAgTU9WICAgICByMCwgI09NWF9TdHNfTm9FcnIgICAgCi1FbmQKLSAgICAgICAgTV9FTkQKLSAgICAKLSAg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4Mn0KLSAgICAgICAgU1VCUyAgICBpSGVpZ2h0LCBpSGVpZ2h0LCAjMQotICAgICAgICBBREQgICAgIHBTcmMsIHBTcmMsIHNyY1N0ZXAKLSAgICAgICAgCi0gICAgICAgIDsvLyBPbmUgY3ljbGUgc3RhbGwKLQotICAgICAgICBTVE0gICAgIHBEc3QhLCB7eDAsIHgxLCB4Mn0gICAgICAgICAgICAgICAgICAgICA7Ly8gU3RvcmUgYWxpZ25lZCBvdXRwdXQgcm93Ci0gICAgICAgIEJHVCAgICAgQ29weTB0b0FsaWduZWQKLSAgICAgICAgQiAgICAgICBDb3B5RW5kICAKLSAgICAgIAotQ29weTF0b0FsaWduZWQgICAgICAgIAotICAgICAgICBMRE0gICAgIHBTcmMsIHt4MCwgeDEsIHgyfQotICAgICAgICBTVUJTICAgIGlIZWlnaHQsIGlIZWlnaHQsICMxCi0gICAgICAgIEFERCAgICAgcFNyYywgcFNyYywgc3JjU3RlcAotICAgICAgICAKLSAgICAgICAgOy8vIE9uZSBjeWNsZSBzdGFsbAotCi0gICAgICAgIE1PViAgICAgeDAsIHgwLCBMU1IgIzgKLSAgICAgICAgT1JSICAgICB4MCwgeDAsIHgxLCBMU0wgIzI0Ci0gICAgICAgIE1PViAgICAgeDEsIHgxLCBMU1IgIzgKLSAgICAgICAgT1JSICAgICB4MSwgeDEsIHgyLCBMU0wgIzI0Ci0gICAgICAgIE1PViAgICAgeDIsIHgyLCBMU1IgIzgKLSAgICAgICAgU1RNICAgICBwRHN0ISwge3gwLCB4MSwgeDJ9ICAgICAgICAgICAgICAgICAgICAgOy8vIFN0b3JlIGFsaWduZWQgb3V0cHV0IHJvdwotICAgICAgICBCR1QgICAgIENvcHkxdG9BbGlnbmVkCi0gICAgICAgIEIgICAgICAgQ29weUVuZCAgCi0KLUNvcHkydG9BbGlnbmVkICAgICAgICAKLSAgICAgICAgTERNICAgICBwU3JjLCB7eDAsIHgxLCB4Mn0KLSAgICAgICAgU1VCUyAgICBpSGVpZ2h0LCBpSGVpZ2h0LCAjMQotICAgICAgICBBREQgICAgIHBTcmMsIHBTcmMsIHNyY1N0ZXAKLSAgICAgICAgCi0gICAgICAgIDsvLyBPbmUgY3ljbGUgc3RhbGwKLQotICAgICAgICBNT1YgICAgIHgwLCB4MCwgTFNSICMxNgotICAgICAgICBPUlIgICAgIHgwLCB4MCwgeDEsIExTTCAjMTYKLSAgICAgICAgTU9WICAgICB4MSwgeDEsIExTUiAjMTYKLSAgICAgICAgT1JSICAgICB4MSwgeDEsIHgyLCBMU0wgIzE2Ci0gICAgICAgIE1PViAgICAgeDIsIHgyLCBMU1IgIzE2Ci0gICAgICAgIFNUTSAgICAgcERzdCEsIHt4MCwgeDEsIHgyfSAgICAgICAgICAgICAgICAgICAgIDsvLyBTdG9yZSBhbGlnbmVkIG91dHB1dCByb3cKLSAgICAgICAgQkdUICAgICBDb3B5MnRvQWxpZ25lZAotICAgICAgICBCICAgICAgIENvcHlFbmQgIAotCi1Db3B5M3RvQWxpZ25lZCAgICAgICAgCi0gICAgICAgIExETSAgICAgcFNyYywge3gwLCB4MSwgeDJ9Ci0gICAgICAgIFNVQlMgICAgaUhlaWdodCwgaUhlaWdodCwgIzEKLSAgICAgICAgQUREICAgICBwU3JjLCBwU3JjLCBzcmNTdGVwCi0gICAgICAgIAotICAgICAgICA7Ly8gT25lIGN5Y2xlIHN0YWxsCi0KLSAgICAgICAgTU9WICAgICB4MCwgeDAsIExTUiAjMjQKLSAgICAgICAgT1JSICAgICB4MCwgeDAsIHgxLCBMU0wgIzgKLSAgICAgICAgTU9WICAgICB4MSwgeDEsIExTUiAjMjQKLSAgICAgICAgT1JSICAgICB4MSwgeDEsIHgyLCBMU0wgIzgKLSAgICAgICAgTU9WICAgICB4MiwgeDIsIExTUiAjMjQKLSAgICAgICAgU1RNICAgICBwRHN0ISwge3gwLCB4MSwgeDJ9ICAgICAgICAgICAgICAgICAgICAgOy8vIFN0b3JlIGFsaWduZWQgb3V0cHV0IHJvdwotICAgICAgICB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U3JjCi07Ly8gcjEgLSBzdGVwIHNpemUgdG8gdGhpcyBhbGlnbmVkIGxvY2F0aW9uCi0KLSAgICAgICAgOy8vIEZ1bmN0aW9uIGhlYWRlcgotICAgICAgICBNX1NUQVJUIGFybVZDTTRQMTBfSW50ZXJwb2xhdGVMdW1hX1ZlckFsaWduNHhfdW5zYWZlICAgICAKLSAgICAgICAgCi0gICAgICAgIDsvLyBDb3B5IHBTcmMgdG8gc3RhY2sKLVN0YXJ0VkFsaWduZWRTdGFja0NvcHkKLSAgICAgICAgQU5EICAgICB4LCBwU3JjLCAjMwotICAgICAgICBCSUMgICAgIHBTcmMsIHBTcmMsICMzICAgICAgICAgICAgICAgICAgICAgICAgCi0gICAgICAgIAotICAgICAgICAKLSAgICAgICAgTV9TV0lUQ0ggeAotICAgICAgICBNX0NBU0UgICBDb3B5MHRvVkFsaWduZWQKLSAgICAgICAgTV9DQVNFICAgQ29weTF0b1ZBbGlnbmVkCi0gICAgICAgIE1fQ0FTRSAgIENvcHkydG9WQWxpZ25lZAotICAgICAgICBNX0NBU0UgICBDb3B5M3RvVkFsaWduZWQKLSAgICAgICAgTV9FTkRTV0lUQ0gKLSAgICAgICAgCi1Db3B5MHRvVkFsaWduZWQgIAotICAgICAgICBNX0xEUiAgIHgwLCBbcFNyY10sIHNyY1N0ZXAKLSAgICAgICAgU1VCUyAgICBpSGVpZ2h0LCBpSGVpZ2h0LCAjMQotICAgICAgICAKLSAgICAgICAgOy8vIE9uZSBjeWNsZSBzdGFsbAotCi0gICAgICAgIFNUUiAgICAgeDAsIFtwRHN0XSwgIzQgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA7Ly8gU3RvcmUgYWxpZ25lZCBvdXRwdXQgcm93Ci0gICAgICAgIEJHVCAgICAgQ29weTB0b1ZBbGlnbmVkCi0gICAgICAgIEIgICAgICAgQ29weVZFbmQgIAotICAgICAgCi1Db3B5MXRvVkFsaWduZWQgICAgICAgIAotICAgICAgICBMRFIgICAgIHgxLCBbcFNyYywgIzRdCi0gICAgICAgIE1fTERSICAgeDAsIFtwU3JjXSwgc3JjU3RlcAotICAgICAgICBTVUJTICAgIGlIZWlnaHQsIGlIZWlnaHQsICMxICAgICAgICAKLSAgICAgICAgCi0gICAgICAgIDsvLyBPbmUgY3ljbGUgc3RhbGwKLQotICAgICAgICBNT1YgICAgIHgxLCB4MSwgTFNMICMyNAotICAgICAgICBPUlIgICAgIHgwLCB4MSwgeDAsIExTUiAjOAotICAgICAgICBTVFIgICAgIHgwLCBbcERzdF0sICM0ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOy8vIFN0b3JlIGFsaWduZWQgb3V0cHV0IHJvdwotICAgICAgICBCR1QgICAgIENvcHkxdG9WQWxpZ25lZAotICAgICAgICBCICAgICAgIENvcHlWRW5kICAKLQotQ29weTJ0b1ZBbGlnbmVkICAgICAgICAKLSAgICAgICAgTERSICAgICB4MSwgW3BTcmMsICM0XQotICAgICAgICBNX0xEUiAgIHgwLCBbcFNyY10sIHNyY1N0ZXAKLSAgICAgICAgU1VCUyAgICBpSGVpZ2h0LCBpSGVpZ2h0LCAjMSAgICAgICAgCi0gICAgICAgIAotICAgICAgICA7Ly8gT25lIGN5Y2xlIHN0YWxsCi0KLSAgICAgICAgTU9WICAgICB4MSwgeDEsIExTTCAjMTYKLSAgICAgICAgT1JSICAgICB4MCwgeDEsIHgwLCBMU1IgIzE2Ci0gICAgICAgIFNUUiAgICAgeDAsIFtwRHN0XSwgIzQgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA7Ly8gU3RvcmUgYWxpZ25lZCBvdXRwdXQgcm93Ci0gICAgICAgIEJHVCAgICAgQ29weTJ0b1ZBbGlnbmVkCi0gICAgICAgIEIgICAgICAgQ29weVZFbmQgIAotCi1Db3B5M3RvVkFsaWduZWQgICAgICAgIAotICAgICAgICBMRFIgICAgIHgxLCBbcFNyYywgIzRdCi0gICAgICAgIE1fTERSICAgeDAsIFtwU3JjXSwgc3JjU3RlcAotICAgICAgICBT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N0U3RlcAotICAgICAgICBCICAgICAgIENvcHk0eDRFbmQgIAotICAgICAgCi1Db3B5NHg0QWxpZ24yCi0gICAgICAgIExEUiAgICAgeDEsIFtwU3JjLCAjNF0KLSAgICAgICAgTV9MRFIgICB4MCwgW3BTcmNdLCBzcmNTdGVwCi0gICAgICAgIExEUiAgICAgeDMsIFtwU3JjLCAjNF0KLSAgICAgICAgTV9MRFIgICB4MiwgW3BTcmNdLCBzcmNTdGVwCi0gICAgICAgIE1PViAgICAgeDAsIHgwLCBMU1IgIzE2Ci0gICAgICAgIE9SUiAgICAgeDAsIHgwLCB4MSwgTFNMICMxNgotICAgICAgICBNX1NUUiAgIHgwLCBbcERzdF0sIGRzdFN0ZXAKLSAgICAgICAgTU9WICAgICB4MiwgeDIsIExTUiAjMTYKLSAgICAgICAgT1JSICAgICB4MiwgeDIsIHgzLCBMU0wgIzE2Ci0gICAgICAgIE1fU1RSICAgeDIsIFtwRHN0XSwgZHN0U3RlcCAgICAgICAgCi0KLSAgICAgICAgTERSICAgICB4MSwgW3BTcmMsICM0XQotICAgICAgICBNX0xEUiAgIHgwLCBbcFNyY10sIHNyY1N0ZXAKLSAgICAgICAgTERSICAgICB4MywgW3BTcmMsICM0XQotICAgICAgICBNX0xEUiAgIHgyLCBbcFNyY10sIHNyY1N0ZXAKLSAgICAgICAgTU9WICAgICB4MCwgeDAsIExTUiAjMTYKLSAgICAgICAgT1JSICAgICB4MCwgeDAsIHgxLCBMU0wgIzE2Ci0gICAgICAgIE1fU1RSICAgeDAsIFtwRHN0XSwgZHN0U3RlcAotICAgICAgICBNT1YgICAgIHgyLCB4MiwgTFNSICMxNgotICAgICAgICBPUlIgICAgIHgyLCB4MiwgeDMsIExTTCAjMTYKLSAgICAgICAgTV9TVFIgICB4MiwgW3BEc3RdLCBkc3RTdGVwICAgICAgICAKLSAgICAgICAgQiAgICAgICBDb3B5NHg0RW5kICAKLQotQ29weTR4NEFsaWduMyAKLSAgICAgICAgTERSICAgICB4MSwgW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RlcCBzaXplIHRvIHRoaXMgZGVzdGluYXRpb24gbG9jYXRpb24KLQotCi1ERUJVR19PTiAgICBTRVRMIHtGQUxTRX0KLSAgICAgICAgCi1NQVNLICAgICAgICAgICAgRVFVIDB4ODA4MDgwODAgIDsvLyBNYXNrIGlzIHVzZWQgdG8gaW1wbGVtZW50IChhK2IrMSkvMgotCi07Ly8gRGVjbGFyZSBpbnB1dCByZWdpc3RlcnMKLQotcFNyYzAgICAgICAgICAgIFJOIDAKLXNyY1N0ZXAwICAgICAgICBSTiAxCi0KLTsvLyBEZWNsYXJlIG90aGVyIGludGVybWVkaWF0ZSByZWdpc3RlcnMKLVRlbXAxICAgICAgICAgICBSTiA0Ci1UZW1wMiAgICAgICAgICAgUk4gNQotVGVtcDMgICAgICAgICAgIFJOIDEwCi1UZW1wNCAgICAgICAgICAgUk4gMTEKLXBCdWYgICAgICAgICAgICBSTiA3Ci1yMHgwZmUwMGZlMCAgICAgUk4gNgotcjB4MDBmZjAwZmYgICAgIFJOIDEyCi1Db3VudCAgICAgICAgICAgUk4gMTQKLVZhbHVlQTAgICAgICAgICBSTiAxMAotVmFsdWVBMSAgICAgICAgIFJOIDExCi0KLSAgICBJRiBBUk0xMTM2SlMKLQotCi0gICAgICAgIDsvLyBGdW5jdGlvbiBoZWFkZXIKLSAgICAgICAgTV9TVEFSVCBhcm1WQ000UDEwX0ludGVycG9sYXRlTHVtYV9Ib3JEaWFnQ29weV91bnNhZmUsIHI2Ci0KLSAgICAgICAgOy8vIENvZGUgc3RhcnQgICAgIAotICAgICAgICBNT1YgICAgICAgICBDb3VudCwgIzQgICAKLSAgICAgICAgTERSICAgICAgICAgcjB4MGZlMDBmZTAsID0weDBmZTAwZmUwCi0gICAgICAgIExEUiAgICAgICAgIHIweDAwZmYwMGZmLCA9MHgwMGZmMDBmZiAgICAgICAgCi1Mb29wU3RhcnQxCi0gICAgICAgIExEUiAgICAgICAgIFRlbXA0LCBbcFNyYzAsICMxMl0KLSAgICAgICAgTERSICAgICAgICAgVGVtcDMsIFtwU3JjMCwgIzhdICAgICAgICAKLSAgICAgICAgTERSICAgICAgICAgVGVtcDIsIFtwU3JjMCwgIzRdCi0gICAgICAgIE1fTERSICAgICAgIFRlbXAxLCBbcFNyYzBdLCBzcmNTdGVwMCAgICAgICAgICAgICAgCi0gICAgICAgIFVRU1VCMTYgICAgIFRlbXA0LCBUZW1wNCwgcjB4MGZlMDBmZTAgICAgICAgIAotICAgICAgICBVUVNVQjE2ICAgICBUZW1wMywgVGVtcDMsIHIweDBmZTAwZmUwICAgICAgICAgICAgICAgICAKLSAgICAgICAgVVFTVUIxNiAgICAgVGVtcDIsIFRlbXAyLCByMHgwZmUwMGZlMCAgICAgICAgCi0gICAgICAgIFVRU1VCMTYgICAgIFRlbXAxLCBUZW1wMSwgcjB4MGZlMDBmZTAgICAgICAgICAgICAgICAgIAotICAgICAgICBVU0FUMTYgICAgICBUZW1wNCwgIzEzLCBUZW1wNAotICAgICAgICBVU0FUMTYgICAgICBUZW1wMywgIzEzLCBUZW1wMyAgICAgICAgICAgICAgICAgICAgICAgICAgCi0gICAgICAgIFVTQVQxNiAgICAgIFRlbXAyLCAjMTMsIFRlbXAyCi0gICAgICAgIFVTQVQxNiAgICAgIFRlbXAxLCAjMTMsIFRlbXAxICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAotICAgICAgICBBTkQgICAgICAgICBUZW1wNCwgcjB4MDBmZjAwZmYsIFRlbXA0LCBMU1IgIzUgICAgICAgICAKLSAgICAgICAgQU5EICAgICAgICAgVGVtcDMsIHIweDAwZmYwMGZmLCBUZW1wMywgTFNSICM1ICAgICAgICAgCi0gICAgICAgIEFORCAgICAgICAgIFRlbXAyLCByMHgwMGZmMDBmZiwgVGVtcDIsIExTUiAjNSAgICAgICAgIAotICAgICAgICBBTkQgICAgICAgICBUZW1wMSwgcjB4MDBmZjAwZmYsIFRlbXAxLCBMU1IgIzUgICAgICAgICAKLSAgICAgICAgT1JSICAgICAgICAgVmFsdWVBMSwgVGVtcDMsIFRlbXA0LCBMU0wgIzggICAgICAgICAgICAgCi0gICAgICAgIE9SUiAgICAgICAgIFZhbHVlQTAsIFRlbXAxLCBUZW1wMiwgTFNMICM4ICAgICAgICAgICAgIAotICAgICAgICBTVUJTICAgICAgICBDb3VudCwgQ291bnQsICMxICAgICAgICAgICAgICAgICAgIAotICAgICAgICBTVFJEICAgICAgICBWYWx1ZUEwLCBbcEJ1Zl0sICM4IAotICAgICAgICBCR1QgICAgICAgICBMb29wU3RhcnQxCi1FbmQxCi0gICAgICAgIFNVQiAgICAgICAgcFNyYzAsIHBCdWYsICMzMgotICAgICAgICBNT1YgICAgICAgIHNyY1N0ZXAwLCAjOAotCi0gICAgICAgIE1fRU5ECi0KLQotICAgICAgICA7Ly8gRnVuY3Rpb24gaGVhZGVyCi0gICAgICAgIE1fU1RBUlQgYXJtVkNNNFAxMF9JbnRlcnBvbGF0ZUx1bWFfVmVyRGlhZ0NvcHlfdW5zYWZlLCByNgotICAgICAgICAKLSAgICAgICAgOy8vIENvZGUgc3RhcnQgICAgICAgIAotICAgICAgICBMRFIgICAgICAgICByMHgwZmUwMGZlMCwgPTB4MGZlMDBmZTAKLSAgICAgICAgTERSICAgICAgICAgcjB4MDBmZjAwZmYsID0weDAwZmYwMGZmCi0gICAgICAgIE1PViAgICAgICAgIENvdW50LCAjMgotCi1Mb29wU3RhcnQgICAgCi0gICAgICAgIExEUiAgICAgICAgIFRlbXA0LCBbcFNyYzAsICMxMl0KLSAgICAgICAgTERSICAgICAgICAgVGVtcDMsIFtwU3JjMCwgIzhdICAgICAgICAKLSAgICAgICAgTERSICAgICAgICAgVGVtcDIsIFtwU3JjMCwgIzRdCi0gICAgICAgIE1fTERSICAgICAgIFRlbXAxLCBbcFNyYzBdLCBzcmNTdGVwMAotICAgICAgICAKLSAgICAgICAgVVFTVUIxNiAgICAgVGVtcDQsIFRlbXA0LCByMHgwZmUwMGZlMCAgICAgICAgCi0gICAgICAgIFVRU1VCMTYgICAgIFRlbXAzLCBUZW1wMywgcjB4MGZlMDBmZTAgICAgICAgICAgICAgICAgIAotICAgICAgICBVUVNVQjE2ICAgICBUZW1wMiwgVGVtcDIsIHIweDBmZTAwZmUwICAgICAgICAKLSAgICAgICAgVVFTVUIxNiAgICAgVGVtcDEsIFRlbXAxLCByMHgwZmUwMGZlMCAgICAgICAgICAgICAgICAgCi0gICAgICAgIAotICAgICAgICBVU0FUMTYgICAgICBUZW1wNCwgIzEzLCBUZW1wNAotICAgICAgICBVU0FUMTYgICAgICBUZW1wMywgIzEzLCBUZW1wMyAgICAgICAgICAgICAgICAgICAgICAgICAgCi0gICAgICAgIFVTQVQxNiAgICAgIFRlbXAyLCAjMTMsIFRlbXAyCi0gICAgICAgIFVTQVQxNiAgICAgIFRlbXAxLCAjMTMsIFRlbXAxCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCi0gICAgICAgIEFORCAgICAgICAgIFRlbXA0LCByMHgwMGZmMDBmZiwgVGVtcDQsIExTUiAjNSAgICAgICAgIAotICAgICAgICBBTkQgICAgICAgICBUZW1wMywgcjB4MDBmZjAwZmYsIFRlbXAzLCBMU1IgIzUgICAgICAgICAKLSAgICAgICAgQU5EICAgICAgICAgVGVtcDIsIHIweDAwZmYwMGZmLCBUZW1wMiwgTFNSICM1ICAgICAgICAgCi0gICAgICAgIEFORCAgICAgICAgIFRlbXAxLCByMHgwMGZmMDBmZiwgVGVtcDEsIExTUiAjNSAgICAgICAgIAotICAgICAgICBPUlIgICAgICAgICBWYWx1ZUExLCBUZW1wMywgVGVtcDQsIExTTCAjOCAgICAgICAgOy8vIFtkMiBjMiBkMCBjMF0gICAgICAgICAgICAgCi0gICAgICAgIE9SUiAgICAgICAgIFZhbHVlQTAsIFRlbXAxLCBUZW1wMiwgTFNMICM4ICAgICAgICA7Ly8gW2IyIGEyIGIwIGEwXSAgICAgICAgIAotICAgICAgICAgICAgICAgICAgICAKLSAgICAgICAgUEtIQlQgICAgICAgVGVtcDEsIFZhbHVlQTAsIFZhbHVlQTEsIExTTCAjMTYgICAgIDsvLyBbZDAgYzAgYjAgYTBdCi0KLSAgICAgICAgU1RSICAgICAgICAgVGVtcDEsIFtwQnVmXSwgIzggCi0gICAgICAgIFBLSFRCICAgICAgIFRlbXAyLCBWYWx1ZUExLCBWYWx1ZUEwLCBBU1IgIzE2ICAgICA7Ly8gW2QyIGMyIGIyIGEyXQotICAgICAgICBTVFIgICAgICAgICBUZW1wMiwgW3BCdWZdLCAjLTQgIAotCi0gICAgICAgIExEUiAgICAgICAgIFRlbXA0LCBbcFNyYzAsICMxMl0KLSAgICAgICAgTERSICAgICAgICAgVGVtcDMsIFtwU3JjMCwgIzhdICAgICAgICAKLSAgICAgICAgTERSICAgICAgICAgVGVtcDIsIFtwU3JjMCwgIzRdCi0gICAgICAgIE1fTERSICAgICAgIFRlbXAxLCBbcFNyYzBdLCBzcmNTdGVwMAotICAgICAgICAKLSAgICAgICAgVVFTVUIxNiAgICAgVGVtcDQsIFRlbXA0LCByMHgwZmUwMGZlMCAgICAgICAgCi0gICAgICAgIFVRU1VCMTYgICAgIFRlbXAzLCBUZW1wMywgcjB4MGZlMDBmZTAgICAgICAgICAgICAgICAgIAotICAgICAgICBVUVNVQjE2ICAgICBUZW1wMiwgVGVtcDIsIHIweDBmZTAwZmUwICAgICAgICAKLSAgICAgICAgVVFTVUIxNiAgICAgVGVtcDEsIFRlbXAxLCByMHgwZmUwMGZlMCAgICAgICAgICAgICAgICAgCi0gICAgICAgIAotICAgICAgICBVU0FUMTYgICAgICBUZW1wNCwgIzEzLCBUZW1wNAotICAgICAgICBVU0FUMTYgICAgICBUZW1wMywgIzEzLCBUZW1wMyAgICAgICAgICAgICAgICAgICAgICAgICAgCi0gICAgICAgIFVTQVQxNiAgICAgIFRlbXAyLCAjMTMsIFRlbXAyCi0gICAgICAgIFVTQVQxNiAgICAgIFRlbXAxLCAjMTMsIFRlbXAxCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCi0gICAgICAgIEFORCAgICAgICAgIFRlbXA0LCByMHgwMGZmMDBmZiwgVGVtcDQsIExTUiAjNSAgICAgICAgIAotICAgICAgICBBTkQgICAgICAgICBUZW1wMywgcjB4MDBmZjAwZmYsIFRlbXAzLCBMU1IgIzUgICAgICAgICAKLSAgICAgICAgQU5EICAgICAgICAgVGVtcDIsIHIweDAwZmYwMGZmLCBUZW1wMiwgTFNSICM1ICAgICAgICAgCi0gICAgICAgIEFORCAgICAgICAgIFRlbXAxLCByMHgwMGZmMDBmZiwgVGVtcDEsIExTUiAjNSAgICAgICAgIAotICAgICAgICBPUlIgICAgICAgICBWYWx1ZUExLCBUZW1wMywgVGVtcDQsIExTTCAjOCAgICAgICAgOy8vIFtkMiBjMiBkMCBjMF0gICAgICAgICAgICAgCi0gICAgICAgIE9SUiAgICAgICAgIFZhbHVlQTAsIFRlbXAxLCBUZW1wMiwgTFNMICM4ICAgICAgICA7Ly8gW2IyIGEyIGIwIGEwXSAgICAgICAgIAotICAgICAgICAgICAgICAgICAgICAKLSAgICAgICAgUEtIQlQgICAgICAgVGVtcDEsIFZhbHVlQTAsIFZhbHVlQTEsIExTTCAjMTYgICAgIDsvLyBbZDAgYzAgYjAgYTBdCi0gICAgICAgIFNVQlMgICAgICAgIENvdW50LCBDb3VudCwgIzEKLSAgICAgICAgU1RSICAgICAgICAgVGVtcDEsIFtwQnVmXSwgIzggCi0gICAgICAgIFBLSFRCICAgICAgIFRlbXAyLCBWYWx1ZUExLCBWYWx1ZUEwLCBBU1IgIzE2ICAgICA7Ly8gW2QyIGMyIGIyIGEyXQotICAgICAgICBTVFIgICAgICAgICBUZW1wMiwgW3BCdWZdLCAjNCAgCi0gICAgICAgIAotICAgICAgICBCR1QgICAgICAgICBMb29wU3RhcnQKLUVuZDIKLSAgICAgICAgU1VCICAgICAgICAgcFNyYzAsIHBCdWYsICMzMi04Ci0gICAgICAgIE1PViAgICAgICAgIHNyY1N0ZXAwLCAjNAotCi0gICAgIC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ICAgICBSTiAxNAotVmFsSSAgICAgICAgICAgIFJOIDEKLQotVGVtcDEgICAgICAgICAgIFJOIDMKLVRlbXAyICAgICAgICAgICBSTiAxCi1UZW1wMyAgICAgICAgICAgUk4gMTIKLVRlbXA0ICAgICAgICAgICBSTiA3Ci1UZW1wNSAgICAgICAgICAgUk4gNQotcjB4MGZlMDBmZTAgICAgIFJOIDMgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA7Ly8gWzAgKDE2KjI1NSAtIDE2KSAwICgxNioyNTUgLSAxNildCi1yMHgwMGZmMDBmZiAgICAgUk4gMTAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDsvLyBbMCAyNTUgMCAyNTVdIHdoZXJlIDI1NSBpcyBvZmZzZXQKLUNvdW50ZXIgICAgICAgICBSTiAxMQotcEludGVyQnVmICAgICAgIFJOIDgKLQotVmFsQ0EgICAgICAgICAgIFJOIDgKLVZhbERCICAgICAgICAgICBSTiA5Ci1WYWxHRSAgICAgICAgICAgUk4gMTAKLVZhbEhGICAgICAgICAgICBSTiAxMQotcjB4MDAxNDAwMDEgICAgIFJOIDEyCi1yMHgwMDE0ZmZmYiAgICAgUk4gMTQKLQotcjB4MDAwMWZjMDAgICAgIFJOIDExCi0KLUFjY3ggICAgICAgICAgICBSTiA4Ci1BY2N5ICAgICAgICAgICAgUk4gOQotVGVtcDYgICAgICAgICAgIFJOIDE0Ci0KLSAgICAgICAgTV9TVFJEICAgICAgcERzdCwgZHN0U3RlcCwgcHBEc3RBcmdzCi0KLSAgICAgICAgTU9WICAgICAgICAgcERzdCwgcEludGVyQnVmICAgICAgICAgICAgICAgIAotICAgICAgICBNT1YgICAgICAgICBkc3RTdGVwLCAjMTYKLQotICAgICAgICA7Ly8gU2V0IHVwIGNvdW50ZXIgb2YgZm9ybWF0LCBbMF0gIFswXSAgWzEgKGhlaWdodCldICBbOCAod2lkdGgpXSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAotICAgICAgICBNT1YgICAgICAgICBDb3VudGVyLCAjNAotICAgICAgICBNX1NUUiAgICAgICBkc3RTdGVwLCBwRHN0U3RlcCAgICAgICAgCi0gICAgICAgIE1fU1RSICAgICAgIHNyY1N0ZXAsIHBTcmNTdGVwICAgICAgICAKLSAgICAgICAgTERSICAgICAgICAgcjB4MDBmZjAwZmYsID0weDAwZmYwMGZmICAgICAgICAgICAgICAgOy8vIFswIDI1NSAwIDI1NV0gMjU1IGlzIG9mZnNldCB0byBhdm9pZCBuZWdhdGl2ZSByZXN1bHRzIAotCi1IZWlnaHRMb29wCi1OZXh0VHdvUm93c0xvb3AKLSAgICAgICAgTERSICAgICBWYWxELCBbcFNyYywgc3JjU3RlcF0gICAgICAgICAgICAgICAgICAgOy8vIExvYWQgcm93IDEgW2QxIGMxIGIxIGExXQotICAgICAgICBMRFIgICAgIFZhbEEsIFtwU3JjXSwgIzQgICAgICAgICAgICAgICAgICAgICAgICA7Ly8gTG9hZCByb3cgMCBbZDAgYzAgYjAgYTBdCi0gICAgICAgIExEUiAgICAgVmFsSCwgW3BTcmMsIHNyY1N0ZXBdICAgICAgICAgICAgICAgICAgIDsvLyBMb2FkICBbaDEgZzEgZjEgZTFdICAgICAgICAKLSAgICAgICAgTERSICAgICBWYWxFLCBbcFNyY10sICM0ICAgICAgICAgICAgICAgICAgICAgICAgOy8vIExvYWQgIFtoMCBnMCBmMCBlMF0KLSAgICAgICAgTERSQiAgICBUZW1wMiwgW3BTcmMsIHNyY1N0ZXBdICAgICAgICAgICAgICAgICAgOy8vIExvYWQgcm93IDEgW2wxIGsxIGoxIGkxXQotICAgICAgICBMRFJCICAgIFRlbXAxLCBbcFNyY10sICMtOCAgICAgICAgICAgICAgICAgICAgICA7Ly8gTG9hZCByb3cgMCBbbDAgazAgajAgaTBdCi0gICAgICAgIAotICAgICAgICBQS0hCVCAgIFZhbEIsIFZhbEEsIFZhbE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TCAjMiAgICAgICAgICAgICAgICAKLSAgICAgICAgVVhUQUIxNiBBY2MwLCBWYWxBLCBWYWxGLCBST1IgIzgKLSAgICAgICAgQUREICAgICBUZW1wMSwgVGVtcDEsIFRlbXAxLCBMU0wgIzIgICAgICAgIAotICAgICAgICBBREQgICAgIEFjYzAsIEFjYzAsIFRlbXAxICAgICAgIAotCi0gICAgICAgIDsvLyBDYWxjdWxhdGUgQWNjMQotICAgICAgICA7Ly8gQWNjMSA9IGIgLSA1KmMgKyAyMCpkICsgMjAqZSAtIDUqZiArIGcKLSAgICAgICAgVVhUQUIxNiBUZW1wMSwgVmFsRSwgVmFsRCwgUk9SICM4Ci0gICAgICAgIFVYVEFCMTYgVGVtcDMsIFZhbEMsIFZhbEYsIFJPUiAjOAotICAgICAgICBSU0IgICAgIFRlbXAxLCBUZW1wMywgVGVtcDEsIExTTCAjMiAgICAgICAgICAgICAgICAgICAgICAgIAotICAgICAgICBVWFRBQjE2IFZhbEcsIHIweDAwZmYwMGZmLCBWYWxIICAgICAgICAgICAgICAgICA7Ly8gWzAwIGcxIDAwIGcwXSArIFswIDI1NSAwIDI1NV0KLSAgICAgICAgQUREICAgICBUZW1wMSwgVGVtcDEsIFRlbXAxLCBMU0wgIzIgICAgICAgIAotICAgICAgICBVWFRBQjE2IEFjYzEsIFZhbEcsIFZhbEIsIFJPUiAjOAotICAgICAgICBBREQgICAgIEFjYzEsIEFjYzEsIFRlbXAxICAgICAgICAKLQotICAgICAgICBVWFRBQjE2IEFjYzIsIFZhbEMsIFZhbEgsIFJPUiAjOCAgICAgICAgCi0gICAgICAgIEFERCAgICAgVmFsSSwgcjB4MDBmZjAwZmYsIFZhbEkgICAgICAgICAgICAgICAgIDsvLyBbMDAgaTEgMDAgaTBdICsgWzAgMjU1IDAgMjU1XSAgICAgICAgCi0gICAgICAgIAotICAgICAgICA7Ly8gQ2FsY3VsYXRlIEFjYzIKLSAgICAgICAgOy8vIEFjYzIgPSBjIC0gNSpkICsgMjAqZS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MgaW4gYSBpbnRlcm1lZGlhdGUgYnVmIAotICAgICAgICBBTkRTICAgICAgICBUZW1wMywgQ291bnRlciwgIzEKLSAgICAgICAgQkVRICAgICAgICAgTm9Qcm9jZXNzaW5nICAgICAgICAKLSAgICAgICAgCi0gICAgICAgIDsvLyBQYWNraW5nIHByZXZpb3VzIGFuZCBjdXJyZW50IEFjYzAtQWNjMyB2YWx1ZXMKLSAgICAgICAgTV9MRFJEICAgICAgQWNjeCwgQWNjeSwgcFRlbXBSZXN1bHQxCi0gICAgICAgIFBLSEJUICAgICAgIFRlbXA2LCBBY2N4LCBBY2MwLCBMU0wgIzE2ICAgICAgICAgIDsvL1swIGEyIDAgYTBdID0gWzAgYTMgMCBhMl0gWzAgYTEgMCBhMF0KLSAgICAgICAgUEtIVEIgICAgICAgQWNjMCwgQWNjMCwgQWNjeCwgQVNSICMxNiAgICAgICAgICAgOy8vWzAgYTMgMCBhMV0gPSBbMCBhMSAwIGEwXSBbMCBhMyAwIGEyXSAKLSAgICAgICAgU1RSICAgICAgICAgQWNjMCwgW3BEc3QsIGRzdFN0ZXBdICAgICAgICAgICAgICAgICAgICAgICAgCi0gICAgICAgIFNUUiAgICAgICAgIFRlbXA2LCBbcERzdF0sICM0ICAgICAgICAgICAgICAgICAgIAotICAgICAgICBQS0hCVCAgICAgICBUZW1wNiwgQWNjeSwgQWNjMSwgTFNMICMxNiAgICAgICAgICA7Ly9bMCBiMiAwIGIwXSA9IFswIGIzIDAgYjJdIFswIGIxIDAgYjBdCi0gICAgICAgIFBLSFRCICAgICAgIEFjYzEsIEFjYzEsIEFjY3ksIEFTUiAjMTYgICAgICAgICAgICA7Ly9bMCBiMyAwIGIxXSA9IFswIGIxIDAgYjBdIFswIGIzIDAgYjJdCi0gICAgICAgIE1fTERSRCAgICAgIEFjY3gsIEFjY3ksIHBUZW1wUmVzdWx0MgotICAgICAgICBTVFIgICAgICAgICBBY2MxLCBbcERzdCwgZHN0U3RlcF0gICAgICAgICAgICAgICAgICAgICAgICAKLSAgICAgICAgU1RSICAgICAgICAgVGVtcDYsIFtwRHN0XSwgIzQgICAgICAgICAgICAgICAgICAgCi0gICAgICAgIAotICAgICAgICBQS0hCVCAgICAgICBUZW1wNiwgQWNjeCwgQWNjMiwgTFNMICMxNiAgICAgICAgICA7Ly9bMCBjMiAwIGMwXSA9IFswIGMzIDAgYzJdIFswIGMxIDAgYzBdCi0gICAgICAgIFBLSFRCICAgICAgIEFjYzIsIEFjYzIsIEFjY3gsIEFTUiAjMTYgICAgICAgICAgICA7Ly9bMCBjMyAwIGMxXSA9IFswIGMxIDAgYzBdIFswIGMzIDAgYzJdCi0gICAgICAgIFNUUiAgICAgICAgIEFjYzIsIFtwRHN0LCBkc3RTdGVwXSAgICAgICAgICAgICAgICAgICAgICAgIAotICAgICAgICBTVFIgICAgICAgICBUZW1wNiwgW3BEc3RdLCAjNCAgICAgICAgICAgICAgICAgICAKLSAgICAgICAgUEtIQlQgICAgICAgVGVtcDYsIEFjY3ksIEFjYzMsIExTTCAjMTYgICAgICAgICAgOy8vWzAgZDIgMCBkMF0gPSBbMCBkMyAwIGQyXSBbMCBkMSAwIGQwXQotICAgICAgICBQS0hUQiAgICAgICBBY2MzLCBBY2MzLCBBY2N5LCBBU1IgIzE2ICAgICAgICAgICAgOy8vWzAgZDMgMCBkMV0gPSBbMCBkMSAwIGQwXSBbMCBkMyAwIGQyXQotICAgICAgICBTVFIgICAgICAgICBBY2MzLCBbcERzdCwgZHN0U3RlcF0gICAgICAgICAgICAgICAgICAgICAgICAKLSAgICAgICAgU1RSICAgICAgICAgVGVtcDYsIFtwRHN0XSwgIy0xMgotICAgICAgICBBREQgICAgICAgICBwRHN0LCBwRHN0LCBkc3RTdGVwLCBMU0wgIzEgICAgICAgICAgICAgICAgICAgCi0gICAgICAgIEIgICAgICAgICAgIEFmdGVyU3RvcmUKLQotTm9Qcm9jZXNzaW5nCi0gICAgICAgIE1fU1RSRCAgICAgIEFjYzAsIEFjYzEsIHBUZW1wUmVzdWx0MQotICAgICAgICBNX1NUUkQgICAgICBBY2MyLCBBY2MzLCBwVGVtcFJlc3VsdDIKLUFmdGVyU3RvcmUKLSAgICAgICAgU1VCUyAgICAgICAgQ291bnRlciwgQ291bnRlciwgIzEgICAgICAgICAgICAgICAgOy8vIExvb3AgdGlsbCBoZWlnaHQgaXMgMTAKLSAgICAgICAgQUREICAgICAgICAgcFNyYywgcFNyYywgc3JjU3RlcCwgTFNMICMxCi0gICAgICAgIEJQTCAgICAgICAgIEhlaWdodExvb3AKLQotICAgICAgICBTVFIgICAgICAgICBBY2MwLCBbcERzdF0sICM0ICAgICAgICAgICAgICAgICAgICA7Ly9bMCBhMSAwIGEwXQotICAgICAgICBTVFIgICAgICAgICBBY2MxLCBbcERzdF0sICM0Ci0gICAgICAgIFNUUiAgICAgICAgIEFjYzIsIFtwRHN0XSwgIzQKLSAgICAgICAgU1RSICAgICAgICAgQWNjMywgW3BEc3RdLCAjLTEyCi0gICAgICAgIAotICAgICAgICA7Ly8KLSAgICAgICAgOy8vIEhvcml6b250YWwgaW50ZXJwb2xhdGlvbiB1c2luZyBtdWx0aXBsaWNhdGlvbgotICAgICAgICA7Ly8KLSAgICAKLSAgICAgICAgU1VCICAgICAgICAgcFNyYywgcERzdCwgZHN0U3RlcCwgTFNMICMyCi0gICAgICAgIE1PViAgICAgICAgIHNyY1N0ZXAsICMxNgotICAgICAgICBNX0xEUkQgICAgICBwRHN0LCBkc3RTdGVwLCBwcERzdEFyZ3MKLQotICAgICAgICBNT1YgICAgICAgICBDb3VudGVyLCAjNAotICAgICAgICBMRFIgICAgICAgICByMHgwMDE0ZmZmYiwgPTB4MDAxNGZmZmIKLSAgICAgICAgTERSICAgICAgICAgcjB4MDAxNDAwMDEsID0weDAwMTQwMDAxCi0KLUhlaWdodExvb3AxCi0gICAgICAgIE1fU1RSICAgICAgIENvdW50ZXIsIHBDb3VudGVyCi0KLSAgICAgICAgTV9MRFIgICAgICAgVmFsQ0EsIFtwU3JjXSwg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gICBBY2MwLCAjMTgsIEFjYzAKLSAgICAgICAgVVNBVCAgICAgICAgQWNjMSwgIzE4LCBBY2MxCi0gICAgICAgIFVTQVQgICAgICAgIEFjYzIsICMxOCwgQWNjMgotICAgICAgICBVU0FUICAgICAgICBBY2MzLCAjMTgsIEFjYzMKLSAgICAgICAgCi0gICAgICAgIE1PViAgICAgICAgIEFjYzAsIEFjYzAsIExTUiAjMTAKLSAgICAgICAgTV9TVFJCICAgICAgQWNjMCwgW3BEc3RdLCBkc3RTdGVwCi0gICAgICAgIE1PViAgICAgICAgIEFjYzEsIEFjYzEsIExTUiAjMTAKLSAgICAgICAgTV9TVFJCICAgICAgQWNjMSwgW3BEc3RdLCBkc3RTdGVwCi0gICAgICAgIE1PViAgICAgICAgIEFjYzIsIEFjYzIsIExTUiAjMTAKLSAgICAgICAgTV9TVFJCICAgICAgQWNjMiwgW3BEc3RdLCBkc3RTdGVwCi0gICAgICAgIE1PViAgICAgICAgIEFjYzMsIEFjYzMsIExTUiAjMTAKLSAgICAgICAgTV9TVFJCICAgICAgQWNjMywgW3BEc3RdLCBkc3RTdGVwCi0KLQotICAgICAgICBNX0xEUiAgICAgICBDb3VudGVyLCBwQ291bnRlcgotICAgICAgICBTVUIgICAgICAgICBwRHN0LCBwRHN0LCBkc3RTdGVwLCBMU0wgIzIKLSAgICAgICAgU1VCICAgICAgICAgcFNyYywgcFNyYywgc3JjU3RlcCwgTFNMICMyCi0gICAgICAgIEFERCAgICAgICAgIHBEc3QsIHBEc3QsICMxCi0gICAgICAgIFNVQlMgICAgICAgIENvdW50ZXIsIENvdW50ZXIsICMxCi0gICAgICAgIEJHVCAgICAgICAgIEhlaWdodExvb3AxCi1FbmQKLSAgICAgICAgU1VCICAgICAgICAgcERzdCwgcERzdCwgIzQKLSAgICAgICAgU1VCICAgICAgICAgcFNyYywgcFNyYywgIzE2Ci0KLSAgICAgICAgTV9FTkQKLSAgICAKLSAgICBFTkRJRgotICAgIAotICAgIEVORAotICAgIApkaW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oZSBmdW5jdGlvbgotICAgICAgICA7Ly8gcjcscjgscjkscjEwLHIxMSxyMTIKLSAgICAgICAgOy8vCi0gICAgICAgIDsvLyBPdXRwdXQgcmVnaXN0ZXJzCi0gICAgICAgIDsvLyBOb25lLiBGdW5jdGlvbiB3aWxsIHByZXNlcnZlIHIwLXIzCi0KLSAgICAgICAgTV9TVEFSVCBhcm1WQ000UDEwX0ludGVycG9sYXRlTHVtYV9IYWxmRGlhZ1ZlckhvcjR4NF91bnNhZmUsIHI2Ci0KLTsvLyBEZWNsYXJlIGlucHV0IHJlZ2lzdGVycwotcFNyYyAgICAgICAgICAgIFJOIDAKLXNyY1N0ZXAgICAgICAgICBSTiAxCi1wRHN0ICAgICAgICAgICAgUk4gMgotZHN0U3RlcCAgICAgICAgIFJOIDMKLQotOy8vIERlY2xhcmUgaW5uZXIgbG9vcCByZWdpc3RlcnMKLVZhbEEgICAgICAgICAgICBSTiA1Ci1WYWxBMCAgICAgICAgICAgUk4gNAotVmFsQTEgICAgICAgICAgIFJOIDUKLVZhbEFGMCAgICAgICAgICBSTiA0Ci1WYWxBRjEgICAgICAgICAgUk4gNQotCi1WYWxCICAgICAgICAgICAgUk4gMTEKLQotVmFsQyAgICAgICAgICAgIFJOIDUKLVZhbEMwICAgICAgICAgICBSTiA0Ci1WYWxDMSAgICAgICAgICAgUk4gNQotVmFsQ0QwICAgICAgICAgIFJOIDEyCi1WYWxDRDEgICAgICAgICAgUk4gMTQKLVZhbENGMCAgICAgICAgICBSTiA0Ci1WYWxDRjEgICAgICAgICAgUk4gNQotCi1WYWxEICAgICAgICAgICAgUk4gMTAKLQotVmFsRSAgICAgICAgICAgIFJOIDcKLVZhbEUwICAgICAgICAgICBSTiA2Ci1WYWxFMSAgICAgICAgICAgUk4gNwotVmFsRUIwICAgICAgICAgIFJOIDEwCi1WYWxFQjEgICAgICAgICAgUk4gMTEKLVZhbEVEMCAgICAgICAgICBSTiA2Ci1WYWxFRDEgICAgICAgICAgUk4gNwotCi1WYWxGICAgICAgICAgICAgUk4gMTAKLQotVmFsRyAgICAgICAgICAgIFJOIDE0Ci1WYWxHMCAgICAgICAgICAgUk4gMTIKLVZhbEcxICAgICAgICAgICBSTiAxNAotVmFsR0IwICAgICAgICAgIFJOIDEyCi1WYWxHQjEgICAgICAgICAgUk4gMTQKLQotQWNjMCAgICAgICAgICAgIFJOIDQKLUFjYzEgICAgICAgICAgICBSTiA1Ci1BY2MyICAgICAgICAgICAgUk4gNgotQWNjMyAgICAgICAgICAgIFJOIDcKLQotVGVtcCAgICAgICAgICAgIFJOIDcKLVN0ZXAgICAgICAgICAgICBSTiA2Ci0KLXBJbnRlckJ1ZiAgICAgICBSTiA4Ci1Db3VudGVyICAgICAgICAgUk4gOAotcjB4MDBmZjAwZmYgICAgIFJOIDkgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOy8vIFswIDI1NSAwIDI1NV0gd2hlcmUgMjU1IGlzIG9mZnNldAotcjB4MDAwMWZjMDAgICAgIFJOIDEwICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOy8vIFswICgxNioyNTUgLSAxNikgMCAoMTYqMjU1IC0gMTYpXQotCi0gICAgCi07Ly8gRGVjbGFyZSBpbm5lciBsb29wIHJlZ2lzdGVycwotVmFsQ0EgICAgICAgICAgIFJOIDgKLVZhbERCICAgICAgICAgICBSTiA5Ci1WYWxHRSAgICAgICAgICAgUk4gMTAKLVZhbEhGICAgICAgICAgICBSTiAxMQotcjB4MDAxNDAwMDEgICAgIFJOIDEyCi1yMHgwMDE0ZmZmYiAgICAgUk4gMTQKLQotcjB4MDAwMDAyMDAgICAgIFJOIDEyCi1yMHgwMDAwMDBmZiAgICAgUk4gMTIKLSAgICAgICAgCi0gICAgICAgIE1fU1RSRCAgICAgIHBEc3QsIGRzdFN0ZXAsIHBwRHN0QXJncwotICAgICAgICBNT1YgICAgICAgICBwRHN0LCBwSW50ZXJCdWYgICAgICAgICAgICAgICAgCi0gICAgICAgIE1PViAgICAgICAgIGRzdFN0ZXAsICMyNAotCi0gICAgICAgIDsvLyBTZXQgdXAgY291bnRlciBvZiBmb3JtYXQsIFswXSAgWzBdICBbMSAoaGVpZ2h0KV0gIFs4ICh3aWR0aCldICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCi0gICAgICAgIE1PViAgICAgICAgIENvdW50ZXIsICMxCi0gICAgICAgIE1PViAgICAgICAgIFRlbXAsICM4ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKLSAgICAgICAgQUREICAgICAgICAgQ291bnRlciwgVGVtcCwgQ291bnRlciwgTFNMICM4ICAgICAgICA7Ly8gWzAgMCBIIFddICAgICAgICAgICAgICAgICAgICAgICAgCi0gICAgICAgIAotICAgICAgICBMRFIgICAgICAgICByMHgwMGZmMDBmZiwgPTB4MDBmZjAwZmYgICAgICAgICAgICAgICAgOy8vIFswIDI1NSAwIDI1NV0gMjU1IGlzIG9mZnNldCB0byBhdm9pZCBuZWdhdGl2ZSByZXN1bHRzIAotV2lkdGhMb29wCi0gICAgICAgIE1fU1RSICAgICAgIHBTcmMsIHBwU3JjCi0gICAgICAgIE1fU1RSICAgICAgIHBEc3QsIHBwRHN0Ci1IZWlnaHRMb29wCi1Ud29Sb3dzTG9vcAotICAgICAgICBNX0xEUiAgICAgICBWYWxDLCBbcFNyY10sIHNyY1N0ZXAgICAgICAgICAgICAgICAgICAgOy8vIExvYWQgIFtjMyBjMiBjMSBjMF0KLSAgICAgICAgTV9MRFIgICAgICAgVmFsRCwgW3BTcmNdLCBzcmNTdGVwICAgICAgICAgICAgICAgICAgIDsvLyBMb2FkICBbZDMgZDIgZDEgZDBdCi0gICAgICAgIE1fTERSICAgICAgIFZhbEUsIFtwU3JjXSwgc3JjU3RlcCAgICAgICAgICAgICAgICAgICA7Ly8gTG9hZCAgW2UzIGUyIGUxIGUwXSAgICAgICAgCi0gICAgICAgIFNVQiAgICAgICAgIHBTcmMsIHBTcmMsIHNyY1N0ZXAsIExTTCAjMiAgICAgICAgICAgICAgICAKLSAgICAgICAgVVhUQUIxNiAgICAgVmFsQzAsIHIweDAwZmYwMGZmLCBWYWxDICAgICAgICAgICAgICAgIDsvLyBbMCBjMiAwIGMwXSArIFswIDI1NSAwIDI1NV0KLSAgICAgICAgVVhUQUIxNiAgICAgVmFsQzEsIHIweDAwZmYwMGZmLCBWYWxDLCBST1IgIzggICAgICAgIDsvLyBbMCBjMyAwIGMxXSArIFswIDI1NSAwIDI1NV0gICAgICAgIAotICAgICAgICBMRFIgICAgICAgICBWYWxCLCBbcFNyY10gICAgICAgICAgICAgICAgICAgICAgICAgICAgOy8vIExvYWQgIFtiMyBiMiBiMSBiMF0gICAgICAgIAotICAgICAgICBVWFRBQjE2ICAgICBWYWxFMCwgcjB4MDBmZjAwZmYsIFZhbEUgICAgICAgICAgICAgICAgOy8vIFswIGUyIDAgZTBdICsgWzAgMjU1IDAgMjU1XQotICAgICAgICBVWFRBQjE2ICAgICBWYWxFMSwgcjB4MDBmZjAwZmYsIFZhbEUsIFJPUiAjOCAgICAgICAgOy8vIFswIGUzIDAgZTFdICsgWzAgMjU1IDAgMjU1XSAgICAgICAgCi0gICAgICAgIFVYVEFCMTYgICAgIFZhbENEMCwgVmFsQzAsIFZhbEQgICAgICAgICAgICAgICAgICAgICA7Ly8gWzAgYzIgMCBjMF0gKyBbMCAyNTUgMCAyNTVdICsgWzAgZDIgMCBkMF0KLSAgICAgICAgVVhUQUIxNiAgICAgVmFsQ0QxLCBWYWxDMSwgVmFsRCwgUk9SICM4ICAgICAgICAgICAgIDsvLyBbMCBjMyAwIGMxXSArIFswIDI1NSAwIDI1NV0gKyBbMCBkMyAwIGQxXSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCi0gICAgICAgIFVYVEFCMTYgICAgIFZhbEVCMCwgVmFsRTAsIFZhbEIgICAgICAgICAgICAgICAgICAgICA7Ly8gWzAgZTIgMCBlMF0gKyBbMCAyNTUgMCAyNTVdICsgWzAgYjIgMCBiMF0KLSAgICAgICAgUlNCICAgICAgICAgVmFsQ0QwLCBWYWxFQjAsIFZhbENEMCwgTFNMICMyICAgICAgICAgIDsvLyA0KihPZmYrQytEKSAtIChPZmYrQitFKQotICAgICAgICAKLSAgICAgICAgTERSICAgICAgICAgVmFsRCwgW3BTcmMsIHNyY1N0ZXAsIExTTCAjMV0gICAgICAgICAgICAgICAgICAgICAgIDsvLyBMb2FkICBbZDMgZDIgZDEgZDBdCi0gICAgICAgIFVYVEFCMTYgICAgIFZhbEVCMSwgVmFsRTEsIFZhbEIsIFJPUiAjOCAgICAgICAgICAgICA7Ly8gWzAgZTMgMCBlMV0gKyBbMCAyNTUgMCAyNTVdICsgWzAgYjMgMCBiMV0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAotICAgICAgICBSU0IgICAgICAgICBWYWxDRDEsIFZhbEVCMSwgVmFsQ0QxLCBMU0wgIzIgICAgICAgICAgICAgICAgCi0gICAgICAgIAotICAgICAgICBVWFRBQjE2ICAgICBWYWxFRDAsIFZhbEUwLCBWYWxEICAgICAgICAgICAgICAgICAgICAgOy8vIFswIGUyIDAgZTBdICsgWzAgMjU1IDAgMjU1XSArIFswIGQyIDAgZDBdCi0gICAgICAgIFVYVEFCMTYgICAgIFZhbEVEMSwgVmFsRTEsIFZhbEQsIFJPUiAjOCAgICAgICAgICAgICA7Ly8gWzAgZTMgMCBlMV0gKyBbMCAyNTUgMCAyNTVdICsgWzAgZDMgMCBkMV0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCi0gICAgICAgIExEUiAgICAgICAgIFZhbEYsIFtwU3JjLCBzcmNTdGVwLCBMU0wgIzJdICAgICAgICAgICA7Ly8gTG9hZCAgW2YzIGYyIGYxIGYwXQotICAgICAgICBNX0xEUiAgICAgICBWYWxCLCBbcFNyY10sIHNyY1N0ZXAgICAgICAgICAgICAgICAgICAgOy8vIExvYWQgIFtiMyBiMiBiMSBiMF0gICAgICAgICAgICAgICAgCi0gICAgICAgIEFERCAgICAgICAgIFZhbENEMCwgVmFsQ0QwLCBWYWxDRDAsIExTTCAjMiAgICAgICAgICA7Ly8gNSAqIFs0KihPZmYrQytEKSAtIChPZmYrQitFKV0KLSAgICAgICAgQUREICAgICAgICAgVmFsQ0QxLCBWYWxDRDEsIFZhbENEMSwgTFNMICMyICAgICAgICAgICAgICAgICAgICAgICAgICAKLSAgICAgICAgVVhUQUIxNiAgICAgVmFsQ0YxLCBWYWxDMSwgVmFsRiwgUk9SICM4ICAgICAgICAgICAgIDsvLyBbMCBjMyAwIGMxXSArIFswIDI1NSAwIDI1NV0gKyBbMCBmMyAwIGYxXSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCi0gICAgICAgIFVYVEFCMTYgICAgIFZhbENGMCwgVmFsQzAsIFZhbEYgICAgICAgICAgICAgICAgICAgICA7Ly8gWzAgYzIgMCBjMF0gKyBbMCAyNTUgMCAyNTVdICsgWzAgZjIgMCBmMF0gICAgICAgIAotICAgICAgICBSU0IgICAgICAgICBWYWxFRDEsIFZhbENGMSwgVmFsRUQxLCBMU0wgIzIgICAgICAgIAotICAgICAgICAKLSAgICAgICAgU1VCICAgICAgICAgVmFsQSwgcFNyYywgc3JjU3RlcCwgTFNMICMxCi0gICAgICAgIExEUiAgICAgICAgIFZhbEEsIFtWYWxBXSAgICAgICAgICAgICAgICAgICAgICAgICAgICA7Ly8gTG9hZCAgW2EzIGEyIGExIGEwXQotICAgICAgICBSU0IgICAgICAgICBWYWxFRDAsIFZhbENGMCwgVmFsRUQwLCBMU0wgIzIgICAgICAgICAgOy8vIDQqKE9mZitFK0QpIC0gKE9mZitDK0YpICAgICAgICAKLSAgICAgICAgQUREICAgICAgICAgVmFsRUQxLCBWYWxFRDEsIFZhbEVEMSwgTFNMICMyICAgICAgICAgIAotICAgICAgICBBREQgICAgICAgICBWYWxFRDAsIFZhbEVEMCwgVmFsRUQwLCBMU0wgIzIgICAgICAgICAgOy8vIDUgKiBbNCooT2ZmK0UrRCkgLSAoT2ZmK0MrRildCi0gICAgICAgIFVYVEFCMTYgICAgIFZhbEEwLCByMHgwMGZmMDBmZiwgVmFsQSAgICAgICAgICAgICAgICA7Ly8gWzAgYTIgMCBhMF0gKyBbMCAyNTUgMCAyNTVdCi0gICAgICAgIFVYVEFCMTYgICAgIFZhbEExLCByMHgwMGZmMDBmZiwgVmFsQSwgUk9SICM4ICAgICAgICA7Ly8gWzAgYTMgMCBhMV0gKyBbMCAyNTUgMCAyNTVdCi0gICAgICAgIFVYVEFCMTYgICAgIFZhbEFGMCwgVmFsQTAsIFZhbEYgICAgICAgICAgICAgICAgICAgICA7Ly8gWzAgYTIgMCBhMF0gKyBbMCAyNTUgMCAyNTVdICsgWzAgZjIgMCBmMF0KLSAgICAgICAgVVhUQUIxNiAgICAgVmFsQUYxLCBWYWxBMSwgVmFsRiwgUk9SICM4ICAgICAgICAgICAgIDsvLyBbMCBhMyAwIGExXSArIFswIDI1NSAwIDI1NV0gKyBbMCBmMyAwIGYxXSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKLSAgICAgICAgQUREICAgICAgICAgQWNjMSwgVmFsQ0QxLCBWYWxBRjEgICAgICAgIAotICAgICAgICAKLSAgICAgICAgTERSICAgICAgICAgVmFsRywgW3BTcmMsIHNyY1N0ZXAsIExTTCAjMl0gICAgICAgICAgIDsvLyBMb2FkICBbZzMgZzIgZzEgZzBdCi0gICAgICAgIEFERCAgICAgICAgIEFjYzAsIFZhbENEMCwgVmFsQUYwICAgICAgICAgICAgICAgICAgICA7Ly8gQWNjMCA9IDE2Kk9mZiArIChBK0YpICsgMjAqKEMrRCkgLSA1KihCK0UpICAgICAgICAKLSAgICAgICAgU1RSICAgICAgICAgQWNjMSwgW3BEc3QsICM0XSAgICAgICAgICAgICAgICAgICAgICAgIDsvLyBTdG9yZSByZXN1bHQgJiBhZGp1c3QgcG9pbnRlcgotICAgICAgICBNX1NUUiAgICAgICBBY2MwLCBbcERzdF0sIGRzdFN0ZXAgICAgICAgICAgICAgICAgICAgOy8vIFN0b3JlIHJlc3VsdCAmIGFkanVzdCBwb2ludGVyCi0gICAgICAgIFVYVEFCMTYgICAgIFZhbEcwLCByMHgwMGZmMDBmZiwgVmFsRyAgICAgICAgICAgICAgICA7Ly8gWzAgZzIgMCBnMF0gKyBbMCAyNTUgMCAyNTVdCi0gICAgICAgIFVYVEFCMTYgICAgIFZhbEcxLCByMHgwMGZmMDBmZiwgVmFsRywgUk9SICM4ICAgICAgICA7Ly8gWzAgZzMgMCBnMV0gKyBbMCAyNTUgMCAyNTVdCi0gICAgICAgIFVYVEFCMTYgICAgIFZhbEdCMCwgVmFsRzAsIFZhbEIgICAgICAgICAgICAgICAgICAgICA7Ly8gWzAgZzIgMCBnMF0gKyBbMCAyNTUgMCAyNTVdICsgWzAgYjIgMCBiMF0KLSAgICAgICAgVVhUQUIxNiAgICAgVmFsR0IxLCBWYWxHMSwgVmFsQiwgUk9SICM4ICAgICAgICAgICAgIDsvLyBbMCBnMyAwIGcxXSArIFswIDI1NSAwIDI1NV0gKyBbMCBiMyAwIGIxXSAgICAgICAgICAgICAgICAgICAgICAgIAotICAgICAgICBBREQgICAgICAgICBBY2MyLCBWYWxFRDAsIFZhbEdCMCAgICAgICAgICAgICAgICAgICAgOy8vIEFjYzIgPSAxNipPZmYgKyAoQitHKSArIDIwKihEK0UpIC0gNSooQytGKQotICAgICAgICBBREQgICAgICAgICBBY2MzLCBWYWxFRDEsIFZhbEdCMSAgICAgICAgCi0gICAgICAgIAotICAgICAgICBTVFIgICAgICAgICBBY2MzLCBbcERzdCwgIzRdICAgICAgICAgICAgICAgICAgICAgICAgOy8vIFN0b3JlIHJlc3VsdCAmIGFkanVzdCBwb2ludGVyICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCi0gICAgICAgIE1fU1RSICAgICAgIEFjYzIsIFtwRHN0XSwgZHN0U3RlcCAgICAgICAgICAgICAgICAgICA7Ly8gU3RvcmUgcmVzdWx0ICYgYWRqdXN0IHBvaW50ZXIgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAotICAgICAgICAKLSAgICAgICAgU1VCUyAgICAgICAgQ291bnRlciwgQ291bnRlciwgIzEgPDwgOCAgICAgICAgICAgICAgIDsvLyBMb29wIHRpbGwgaGVpZ2h0IGlzIDEwCi0gICAgICAgIEFERCAgICAgICAgIHBTcmMsIHBTcmMsIHNyY1N0ZXAsIExTTCAjMQotICAgICAgICBCUEwgICAgICAgICBIZWlnaHRMb29wCi0gICAgICAgIAotICAgICAgICBNX0xEUiAgICAgICBwU3JjLCBwcFNyYwotICAgICAgICBNX0xEUiAgICAgICBwRHN0LCBwcERzdAotICAgICAgICBBRERTICAgICAgICBDb3VudGVyLCBDb3VudGVyLCAjKDEgPDwgOCktNCAgICAgICAgICAgOy8vIExvb3AgdGlsbCB3aWR0aCBpcyAxMgotICAgICAgICBBREQgICAgICAgICBwU3JjLCBwU3JjLCAjNAotICAgICAgICBBREQgICAgICAgICBwRHN0LCBwRHN0LCAjOAotICAgICAgICBBREQgICAgICAgICBDb3VudGVyLCBDb3VudGVyLCAjMTw8OAotICAgICAgICBCUEwgICAgICAgICBXaWR0aExvb3AKLSAgICAKLSAgICAgICAgOy8vCi0gICAgICAgIDsvLyBIb3Jpem9udGFsIGludGVycG9sYXRpb24gdXNpbmcgbXVsdGlwbGljYXRpb24KLSAgICAgICAgOy8vCi0gICAgCi0gICAgICAgIFNVQiAgICAgICAgIHBTcmMsIHBEc3QsICMyNAotICAgICAgICBNT1YgICAgICAgICBzcmNTdGVwLCAjMjQKLSAgICAgICAgTV9MRFJEICAgICAgcERzdCwgZHN0U3RlcCwgcHBEc3RBcmdzCi0KLSAgICAgICAgTU9WICAgICAgICAgQ291bnRlciwgIzQKLSAgICAgICAgTERSICAgICAgICAgcjB4MDAxNGZmZmIsID0weDAwMTRmZmZiCi0gICAgICAgIExEUiAgICAgICAgIHIweDAwMTQwMDAxLCA9MHgwMDE0MDAwMQotCi1IZWlnaHRMb29wMQotICAgICAgICBNX1NUUiAgICAgICBDb3VudGVyLCBwQ291bnRlcgotCi0KLSAgICAgICAgTERSICAgICAgICAgVmFsQ0EsIFtwU3JjXSwgIzQgICAgICAgICAgICAgICAgICAgOy8vIExvYWQgIFswIGMgMCBhXQotICAgICAgICBMRFIgICAgICAgICBWYWxEQiwgW3BTcmNdLCAjNCAgICAgICAgICAgICAgICAgICA7Ly8gTG9hZCAgWzAgZCAwIGJdCi0gICAgICAgIExEUiAgICAgICAgIFZhbEdFLCBbcFNyY10sICM0ICAgICAgICAgICAgICAgICAgIDsvLyBMb2FkICBbMCBnIDAgZV0KLSAgICAgICAgTERSICAgICAgICAgVmFsSEYsIFtwU3JjXSwgIzQgICAgICAgICAgICAgICAgICAgOy8vIExvYWQgIFswIGggMCBmXQotCi0gICAgICAgIDsvLyBBY2MwID0gc211YWQgKFswIDIwIDAgMV0sIGFkZChbMCBjIDAgYV0gKyBbMCBkIDAgZl0pKSAtICg1ICogKGIgKyBlKSkgCi0gICAgICAgIDsvLyBBY2MxID0gc211YWQgKFswIDIwIDAgMV0sIGFkZChbMCBlIDAgZ10gKyBbMCBkIDAgYl0pKSAtICg1ICogKGMgKyBmKSkgCi0gICAgICAgIDsvLyBBY2MyID0gc211YWQgKFswIDEgMCAyMF0sIGFkZChbMCBjIDAgZV0gKyBbMCBoIDAgZl0pKSAtICg1ICogKGQgKyBnKSkgCi0gICAgICAgIDsvLyBBY2MzID0gc211YWQgKFswIDIwIDAgMV0sIGFkZChbMCBkIDAgZl0gKyBbMCBpIDAgZ10pKSAtICg1ICogKGUgKyBoKSkgCi0gICAgICAgIFNNVUFEICAgICAgIEFjYzAsIFZhbENBLCByMHgwMDE0MDAwMSAgICAgICAgICAgIDs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vIEFjYzEgKz0gWzAgZCAwIGJdICogWzAgMCAwIC01XQotICAgICAgICBTTUxBVEIgICAgICBBY2MyLCBWYWxDQSwgcjB4MDAxNDAwMDEsIEFjYzIgICAgICA7Ly8gQWNjMiArPSBbMCBjIDAgYV0gKiBbMCAwIDAgMV0KLSAgICAgICAgU01MQVRCICAgICAgQWNjMywgVmFsREIsIHIweDAwMTQwMDAxLCBBY2MzICAgICAgOy8vIEFjYzMgKz0gWzAgYyAwIGFdICogWzAgMCAwIDFdCi0KLSAgICAgICAgTERSSCAgICAgICAgVmFsQ0EsIFtwU3JjXSwgIzggICAgICAgICAgICAgICAgICAgOy8vIDggPSBzcmNTdGVwIC0gMTYKLSAgICAgICAgU01MQUJCICAgICAgQWNjMCwgVmFsSEYsIHIweDAwMTQwMDAxLCBBY2MwICAgICAgOy8vIEFjYzAgKz0gWzAgaCAwIGZdICogWzAgMCAwIDFdICAgICAgICAKLSAgICAgICAgU01MQUJCICAgICAgQWNjMSwgVmFsSEYsIHIweDAwMTRmZmZiLCBBY2MxICAgICAgOy8vIEFjYzEgKz0gWzAgaCAwIGZdICogWzAgMCAwIC01XQotICAgICAgICBTTUxBVEIgICAgICBBY2MyLCBWYWxEQiwgcjB4MDAxNGZmZmIsIEFjYzIgICAgICA7Ly8gQWNjMiArPSBbMCBkIDAgYl0gKiBbMCAwIDAgLTVdICAgICAgICAKLSAgICAgICAgU01MQUJCICAgICAgQWNjMywgVmFsQ0EsIHIweDAwMTQwMDAxLCBBY2MzICAgICAgOy8vIEFjYzMgKz0gWzAgZCAwIGJdICogWzAgMCAwIDFdCi0gICAgICAgIAotICAgICAgICBMRFIgICAgICAgICByMHgwMDAxZmMwMCwgPTB4MDAwMWZjMDAgICAgICAgICAgICA7Ly8gKDB4ZmYgKiAxNiAqIDMyKSAtIDUxMgotICAgICAgICBTVUIgICAgICAgICBBY2MwLCBBY2MwLCByMHgwMDAxZmMwMCAgICAgICAgCi0gICAgICAgIFNVQiAgICAgICAgIEFjYzEsIEFjYzEsIHIweDAwMDFmYzAwICAgICAgICAKLSAgICAgICAgU1VCICAgICAgICAgQWNjMiwgQWNjMiwgcjB4MDAwMWZjMDAgICAgICAgIAotICAgICAgICBTVUIgICAgICAgICBBY2MzLCBBY2MzLCByMHgwMDAxZmMwMCAgICAgICAgCi0KLSAgICAgICAgVVNBVCAgICAgICAgQWNjMCwgIzE4LCBBY2MwCi0gICAgICAgIFVTQVQgICAgICAgIEFjYzEsICMxOCwgQWNjMQotICAgICAgICBVU0FUICAgICAgICBBY2MyLCAjMTgsIEFjYzIKLSAgICAgICAgVVNBVCAgICAgICAgQWNjMywgIzE4LCBBY2MzCi0gICAgICAgIAotICAgICAgICBNT1YgICAgICAgICBBY2MwLCBBY2MwLCBMU1IgIzEwCi0gICAgICAgIE1PViAgICAgICAgIEFjYzEsIEFjYzEsIExTUiAjMTAKLSAgICAgICAgTU9WICAgICAgICAgQWNjMiwgQWNjMiwgTFNSICMxMAotICAgICAgICBNT1YgICAgICAgICBBY2MzLCBBY2MzLCBMU1IgIzEwCi0KLSAgICAgICAgTV9MRFIgICAgICAgQ291bnRlciwgcENvdW50ZXIgICAgICAgIAotICAgICAgICBPUlIgICAgICAgICBBY2MwLCBBY2MwLCBBY2MxLCBMU0wgIzgKLSAgICAgICAgT1JSICAgICAgICAgQWNjMiwgQWNjMiwgQWNjMywgTFNMICM4Ci0gICAgICAgIFNVQlMgICAgICAgIENvdW50ZXIsIENvdW50ZXIsICMxCi0gICAgICAgIE9SUiAgICAgICAgIEFjYzAsIEFjYzAsIEFjYzIsIExTTCAjMTYKLSAgICAgICAgTV9TVFIgICAgICAgQWNjMCwgW3BEc3RdLCBkc3RTdGVwCi0gICAgICAgIEJHVCAgICAgICAgIEhlaWdodExvb3AxCi1FbmQKLSAgICAgICAgU1VCICAgICAgICAgcERzdCwgcERzdCwgZHN0U3RlcCwgTFNMICMyCi0gICAgICAgIFNVQiAgICAgICAgIHBTcmMsIHBTcmMsIHNyY1N0ZXAsIEx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GVwICAgICAgICAgUk4gMwotCi07Ly8gRGVjbGFyZSBpbm5lciBsb29wIHJlZ2lzdGVycwotQWNjMCAgICAgICAgICAgIFJOIDQKLUFjYzEgICAgICAgICAgICBSTiA1Ci1BY2MyICAgICAgICAgICAgUk4gNgotQWNjMyAgICAgICAgICAgIFJOIDcKLQotVmFsQSAgICAgICAgICAgIFJOIDQKLVZhbEIgICAgICAgICAgICBSTiA1Ci1WYWxDICAgICAgICAgICAgUk4gNgotVmFsRCAgICAgICAgICAgIFJOIDcKLVZhbEUgICAgICAgICAgICBSTiA4Ci1WYWxGICAgICAgICAgICAgUk4gOQotVmFsRyAgICAgICAgICAgIFJOIDEyCi1WYWxIICAgICAgICAgICAgUk4gMTQKLVZhbEkgICAgICAgICAgICBSTiAxCi0KLVRlbXAxICAgICAgICAgICBSTiAzCi1UZW1wMiAgICAgICAgICAgUk4gMQotVGVtcDMgICAgICAgICAgIFJOIDEyCi1UZW1wNCAgICAgICAgICAgUk4gNwotVGVtcDUgICAgICAgICAgIFJOIDUKLXIweDBmZTAwZmUwICAgICBSTiAzICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOy8vIFswICgxNioyNTUgLSAxNikgMCAoMTYqMjU1IC0gMTYpXQotcjB4MDBmZjAwZmYgICAgIFJOIDEwICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA7Ly8gWzAgMjU1IDAgMjU1XSB3aGVyZSAyNTUgaXMgb2Zmc2V0Ci1Db3VudGVyICAgICAgICAgUk4gMTEKLQotSGVpZ2h0ICAgICAgICAgIFJOIDMKLQotICAgICAgICBNX0FMTE9DNCBwRHN0U3RlcCwgNAotICAgICAgICBNX0FMTE9DNCBwU3JjU3RlcCwgNAotCi0gICAgICAgIDsvLyBGdW5jdGlvbiBoZWFkZXIKLSAgICAgICAgTV9TVEFSVCBhcm1WQ000UDEwX0ludGVycG9sYXRlTHVtYV9IYWxmSG9yNHg0X3Vuc2FmZSwgcjYKLSAgICAgICAgCi0gICAgICAgIE1PViAgICAgQ291bnRlciwgIzIKLSAgICAgICAgTV9TVFIgICBkc3RTdGVwLCBwRHN0U3RlcCAgICAgICAgCi0gICAgICAgIE1fU1RSICAgc3JjU3RlcCwgcFNyY1N0ZXAgICAgICAgIAotICAgICAgICBMRFIgICAgIHIweDAwZmYwMGZmLCA9MHgwMGZmMDBmZiAgICAgICAgICAgICAgIDsvLyBbMCAyNTUgMCAyNTVdIDI1NSBpcyBvZmZzZXQgdG8gYXZvaWQgbmVnYXRpdmUgcmVzdWx0cyAKLQotTmV4dFR3b1Jvd3NMb29wCi0gICAgICAgIExEUiAgICAgVmFsRCwgW3BTcmMsIHNyY1N0ZXBdICAgICAgICAgICAgICAgICAgIDsvLyBMb2FkIHJvdyAxIFtkMSBjMSBiMSBhMV0KLSAgICAgICAgTERSICAgICBWYWxBLCBbcFNyY10sICM0ICAgICAgICAgICAgICAgICAgICAgICAgOy8vIExvYWQgcm93IDAgW2QwIGMwIGIwIGEwXQotICAgICAgICBMRFIgICAgIFZhbEgsIFtwU3JjLCBzcmNTdGVwXSAgICAgICAgICAgICAgICAgICA7Ly8gTG9hZCAgW2gxIGcxIGYxIGUxXSAgICAgICAgCi0gICAgICAgIExEUiAgICAgVmFsRSwgW3BTcmNdLCAjNCAgICAgICAgICAgICAgICAgICAgICAgIDsvLyBMb2FkICBbaDAgZzAgZjAgZTBdCi0gICAgICAgIExEUkIgICAgVGVtcDIsIFtwU3JjLCBzcmNTdGVwXSAgICAgICAgICAgICAgICAgIDsvLyBMb2FkIHJvdyAxIFtsMSBrMSBqMSBpMV0KLSAgICAgICAgTERSQiAgICBUZW1wMSwgW3BTcmNdLCAjLTggICAgICAgICAgICAgICAgICAgICAgOy8vIExvYWQgcm93IDAgW2wwIGswIGowIGkwXQotICAgICAgICAKLSAgICAgICAgUEtIQlQgICBWYWxCLCBWYWxBLCBWYWxELCBMU0wgIzE2ICAgICAgICAgICAgICAgOy8vIFtiMSBhMSBiMCBhMF0KLSAgICAg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A0Ci1WYWxDRjEgICAgICAgICAgUk4gNQotCi1WYWxEICAgICAgICAgICAgUk4gMTAKLQotVmFsRSAgICAgICAgICAgIFJOIDcKLVZhbEUwICAgICAgICAgICBSTiA2Ci1WYWxFMSAgICAgICAgICAgUk4gNwotVmFsRUIwICAgICAgICAgIFJOIDEwCi1WYWxFQjEgICAgICAgICAgUk4gMTEKLVZhbEVEMCAgICAgICAgICBSTiA2Ci1WYWxFRDEgICAgICAgICAgUk4gNwotCi1WYWxGICAgICAgICAgICAgUk4gMTAKLQotVmFsRyAgICAgICAgICAgIFJOIDE0Ci1WYWxHMCAgICAgICAgICAgUk4gMTIKLVZhbEcxICAgICAgICAgICBSTiAxNAotVmFsR0IwICAgICAgICAgIFJOIDEyCi1WYWxHQjEgICAgICAgICAgUk4gMTQKLQotQWNjMCAgICAgICAgICAgIFJOIDQKLUFjYzEgICAgICAgICAgICBSTiA1Ci1BY2MyICAgICAgICAgICAgUk4gNgotQWNjMyAgICAgICAgICAgIFJOIDcKLQotVGVtcCAgICAgICAgICAgIFJOIDcKLUhlaWdodCAgICAgICAgICBSTiAzCi1TdGVwICAgICAgICAgICAgUk4gNgotCi1Db3VudGVyICAgICAgICAgUk4gOAotcjB4MDBmZjAwZmYgICAgIFJOIDkgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOy8vIFswIDI1NSAwIDI1NV0gd2hlcmUgMjU1IGlzIG9mZnNldAotcjB4MGZlMDBmZTAgICAgIFJOIDEwICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOy8vIFswICgxNioyNTUgLSAxNikgMCAoMTYqMjU1IC0gMTYpXQotCi0gICAgICAgIAotICAgICAgICBMRFIgICAgICAgICByMHgwMGZmMDBmZiwgPTB4MDBmZjAwZmYgICAgICAgICAgICAgICAgOy8vIFswIDI1NSAwIDI1NV0gMjU1IGlzIG9mZnNldCB0byBhdm9pZCBuZWdhdGl2ZSByZXN1bHRzIAotICAgICAgICBNT1YgICAgICAgICBDb3VudGVyLCAjMgotICAgICAgICAKLVR3b1Jvd3NMb29wCi0gICAgICAgIE1fTERSICAgICAgIFZhbEMsIFtwU3JjXSwgc3JjU3RlcCAgICAgICAgICAgICAgICAgICA7Ly8gTG9hZCAgW2MzIGMyIGMxIGMwXQotICAgICAgICBNX0xEUiAgICAgICBWYWxELCBbcFNyY10sIHNyY1N0ZXAgICAgICAgICAgICAgICAgICAgOy8vIExvYWQgIFtkMyBkMiBkMSBkMF0KLSAgICAgICAgTV9MRFIgICAgICAgVmFsRSwgW3BTcmNdLCBzcmNTdGVwICAgICAgICAgICAgICAgICAgIDsvLyBMb2FkICBbZTMgZTIgZTEgZTBdICAgICAgICAKLSAgICAgICAgU1VCICAgICAgICAgcFNyYywgcFNyYywgc3JjU3RlcCwgTFNMICMyICAgICAgICAgICAgICAgIAotICAgICAgICBMRFIgICAgICAgICBWYWxCLCBbcFNyY10gICAgICAgICAgICAgICAgICAgICAgICAgICAgOy8vIExvYWQgIFtiMyBiMiBiMSBiMF0gICAgICAgIAotICAgICAgICBVWFRBQjE2ICAgICBWYWxDMCwgcjB4MDBmZjAwZmYsIFZhbEMgICAgICAgICAgICAgICAgOy8vIFswIGMyIDAgYzBdICsgWzAgMjU1IDAgMjU1XQotICAgICAgICBVWFRBQjE2ICAgICBWYWxDMSwgcjB4MDBmZjAwZmYsIFZhbEMsIFJPUiAjOCAgICAgICAgOy8vIFswIGMzIDAgYzFdICsgWzAgMjU1IDAgMjU1XSAgICAgICAgCi0gICAgICAgIAotICAgICAgICBVWFRBQjE2ICAgICBWYWxFMCwgcjB4MDBmZjAwZmYsIFZhbEUgICAgICAgICAgICAgICAgOy8vIFswIGUyIDAgZTBdICsgWzAgMjU1IDAgMjU1XQotICAgICAgICBVWFRBQjE2ICAgICBWYWxFMSwgcjB4MDBmZjAwZmYsIFZhbEUsIFJPUiAjOCAgICAgICAgOy8vIFswIGUzIDAgZTFdICsgWzAgMjU1IDAgMjU1XSAgICAgICAgCi0gICAgICAgIFVYVEFCMTYgICAgIFZhbENEMCwgVmFsQzAsIFZhbEQgICAgICAgICAgICAgICAgICAgICA7Ly8gWzAgYzIgMCBjMF0gKyBbMCAyNTUgMCAyNTVdICsgWzAgZDIgMCBkMF0KLSAgICAgICAgVVhUQUIxNiAgICAgVmFsQ0QxLCBWYWxDMSwgVmFsRCwgUk9SICM4ICAgICAgICAgICAgIDsvLyBbMCBjMyAwIGMxXSArIFswIDI1NSAwIDI1NV0gKyBbMCBkMyAwIGQxXSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCi0gICAgICAgIFVYVEFCMTYgICAgIFZhbEVCMCwgVmFsRTAsIFZhbEIgICAgICAgICAgICAgICAgICAgICA7Ly8gWzAgZTIgMCBlMF0gKyBbMCAyNTUgMCAyNTVdICsgWzAgYjIgMCBiMF0KLSAgICAgICAgUlNCICAgICAgICAgVmFsQ0QwLCBWYWxFQjAsIFZhbENEMCwgTFNMICMyICAgICAgICAgIDsvLyA0KihPZmYrQytEKSAtIChPZmYrQitFKQotICAgICAgICAKLSAgICAgICAgTERSICAgICAgICAgVmFsRCwgW3BTcmMsIHNyY1N0ZXAsIExTTCAjMV0gICAgICAgICAgICAgICAgICAgICAgIDsvLyBMb2FkICBbZDMgZDIgZDEgZDBdCi0gICAgICAgIFVYVEFCMTYgICAgIFZhbEVCMSwgVmFsRTEsIFZhbEIsIFJPUiAjOCAgICAgICAgICAgICA7Ly8gWzAgZTMgMCBlMV0gKyBbMCAyNTUgMCAyNTVdICsgWzAgYjMgMCBiMV0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAotICAgICAgICBSU0IgICAgICAgICBWYWxDRDEsIFZhbEVCMSwgVmFsQ0QxLCBMU0wgIzIgICAgICAgICAgICAgICAgCi0gICAgICAgIDsvLyBPbmUgY3ljbGUgc3RhbGwKLSAgICAgICAgVVhUQUIxNiAgICAgVmFsRUQwLCBWYWxFMCwgVmFsRCAgICAgICAgICAgICAgICAgICAgIDsvLyBbMCBlMiAwIGUwXSArIFswIDI1NSAwIDI1NV0gKyBbMCBkMiAwIGQwXQotICAgICAgICBVWFRBQjE2ICAgICBWYWxFRDEsIFZhbEUxLCBWYWxELCBST1IgIzggICAgICAgICAgICAgOy8vIFswIGUzIDAgZTFdICsgWzAgMjU1IDAgMjU1XSArIFswIGQzIDAgZDFdICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKLSAgICAgICAgCi0gICAgICAgIExEUiAgICAgICAgIFZhbEYsIFtwU3JjLCBzcmNTdGVwLCBMU0wgIzJdICAgICAgICAgICA7Ly8gTG9hZCAgW2YzIGYyIGYxIGYwXQotICAgICAgICBNX0xEUiAgICAgICBWYWxCLCBbcFNyY10sIHNyY1N0ZXAgICAgICAgICAgICAgICAgICAgOy8vIExvYWQgIFtiMyBiMiBiMSBiMF0gICAgICAgICAgICAgICAgCi0gICAgICAgIEFERCAgICAgICAgIFZhbENEMCwgVmFsQ0QwLCBWYWxDRDAsIExTTCAjMiAgICAgICAgICA7Ly8gNSAqIFs0KihPZmYrQytEKSAtIChPZmYrQitFKV0KLSAgICAgICAgQUREICAgICAgICAgVmFsQ0QxLCBWYWxDRDEsIFZhbENEMSwgTFNMICMyICAgICAgICAgICAgICAgICAgICAgICAgICAKLSAgICAgICAgVVhUQUIxNiAgICAgVmFsQ0YxLCBWYWxDMSwgVmFsRiwgUk9SICM4ICAgICAgICAgICAgIDsvLyBbMCBjMyAwIGMxXSArIFswIDI1NSAwIDI1NV0gKyBbMCBmMyAwIGYxXSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCi0gICAgICAgIFVYVEFCMTYgICAgIFZhbENGMCwgVmFsQzAsIFZhbEYgICAgICAgICAgICAgICAgICAgICA7Ly8gWzAgYzIgMCBjMF0gKyBbMCAyNTUgMCAyNTVdICsgWzAgZjIgMCBmMF0KLSAgICAgICAgUlNCICAgICAgICAgVmFsRUQxLCBWYWxDRjEsIFZhbEVEMSwgTFNMICMyICAgICAgICAKLSAgICAgICAgCi0gICAgICAgIFNVQiAgICAgICAgIFZhbEEsIHBTcmMsIHNyY1N0ZXAsIExTTCAjMQotICAgICAgICBMRFIgICAgICAgICBWYWxBLCBbVmFsQV0gICAgICAgICAgICAgICAgICAgICAgICAgICAgOy8vIExvYWQgIFthMyBhMiBhMSBhMF0KLSAgICAgICAgUlNCICAgICAgICAgVmFsRUQwLCBWYWxDRjAsIFZhbEVEMCwgTFNMICMyICAgICAgICAgIDsvLyA0KihPZmYrRStEKSAtIChPZmYrQytGKSAgICAgICAgCi0gICAgICAgIEFERCAgICAgICAgIFZhbEVEMSwgVmFsRUQxLCBWYWxFRDEsIExTTCAjMiAgICAgICAgICAKLSAgICAgICAgQUREICAgICAgICAgVmFsRUQwLCBWYWxFRDAsIFZhbEVEMCwgTFNMICMyICAgICAgICAgIDsvLyA1ICogWzQqKE9mZitFK0QpIC0gKE9mZitDK0YpXQotICAgICAgICBVWFRBQjE2ICAgICBWYWxBMCwgcjB4MDBmZjAwZmYsIFZhbEEgICAgICAgICAgICAgICAgOy8vIFswIGEyIDAgYTBdICsgWzAgMjU1IDAgMjU1XQotICAgICAgICBVWFRBQjE2ICAgICBWYWxBMSwgcjB4MDBmZjAwZmYsIFZhbEEsIFJPUiAjOCAgICAgICAgOy8vIFswIGEzIDAgYTFdICsgWzAgMjU1IDAgMjU1XQotICAgICAgICBVWFRBQjE2ICAgICBWYWxBRjAsIFZhbEEwLCBWYWxGICAgICAgICAgICAgICAgICAgICAgOy8vIFswIGEyIDAgYTBdICsgWzAgMjU1IDAgMjU1XSArIFswIGYyIDAgZjBdCi0gICAgICAgIFVYVEFCMTYgICAgIFZhbEFGMSwgVmFsQTEsIFZhbEYsIFJPUiAjOCAgICAgICAgICAgICA7Ly8gWzAgYTMgMCBhMV0gKyBbMCAyNTUgMCAyNTVdICsgWzAgZjMgMCBmMV0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAotICAgICAgICAKLSAgICAgICAgTERSICAgICAgICAgcjB4MGZlMDBmZTAsID0weDBmZTAwZmUwICAgICAgICAgICAgICAgIDsvLyBbMCAyNTUgMCAyNTVdIDI1NSBpcyBvZmZzZXQgdG8gYXZvaWQgbmVnYXRpdmUgcmVzdWx0cyAKLSAgICAgICAgQUREICAgICAgICAgQWNjMSwgVmFsQ0QxLCBWYWxBRjEgICAgICAgIAotICAgICAgICAKLSAgICAgICAgTERSICAgICAgICAgVmFsRywgW3BTcmMsIHNyY1N0ZXAsIExTTCAjMl0gICAgICAgICAgIDsvLyBMb2FkICBbZzMgZzIgZzEgZzBdCi0gICAgICAgIEFERCAgICAgICAgIEFjYzAsIFZhbENEMCwgVmFsQUYwICAgICAgICAgICAgICAgICAgICA7Ly8gQWNjMCA9IDE2Kk9mZiArIChBK0YpICsgMjAqKEMrRCkgLSA1KihCK0UpICAgICAgICAKLSAgICAgICAgVVFTVUIxNiAgICAgQWNjMSwgQWNjMSwgcjB4MGZlMDBmZTAgICAgICAgICAgICAgICAgIDsvLyBBY2MxIC09ICgxNipPZmYgLSAxNikKLSAgICAgICAgVVFTVUIxNiAgICAgQWNjMCwgQWNjMCwgcjB4MGZlMDBmZTAgICAgICAgIAotICAgICAgICBVWFRBQjE2ICAgICBWYWxHMCwgcjB4MDBmZjAwZmYsIFZhbEcgICAgICAgICAgICAgICAgOy8vIFswIGcyIDAgZzBdICsgWzAgMjU1IDAgMjU1XQotICAgICAgICBVWFRBQjE2ICAgICBWYWxHMSwgcjB4MDBmZjAwZmYsIFZhbEcsIFJPUiAjOCAgICAgICAgOy8vIFswIGczIDAgZzFdICsgWzAgMjU1IDAgMjU1XQotICAgICAgICBVWFRBQjE2ICAgICBWYWxHQjAsIFZhbEcwLCBWYWxCICAgICAgICAgICAgICAgICAgICAgOy8vIFswIGcyIDAgZzBdICsgWzAgMjU1IDAgMjU1XSArIFswIGIyIDAgYjBdCi0gICAgICAgIFVYVEFCMTYgICAgIFZhbEdCMSwgVmFsRzEsIFZhbEIsIFJPUiAjOCAgICAgICAgICAgICA7Ly8gWzAgZzMgMCBnMV0gKyBbMCAyNTUgMCAyNTVdICsgWzAgYjMgMCBiMV0gICAgICAgICAgICAgICAgICAgICAgICAKLSAgICAgICAgQUREICAgICAgICAgQWNjMiwgVmFsRUQwLCBWYWxHQjAgICAgICAgICAgICAgICAgICAgIDsvLyBBY2MyID0gMTYqT2ZmICsgKEIrRykgKyAyMCooRCtFKSAtIDUqKEMrRikKLSAgICAgICAgQUREICAgICAgICAgQWNjMywgVmFsRUQxLCBWYWxHQjEgICAgICAgIAotICAgICAgICBVUVNVQjE2ICAgICBBY2MzLCBBY2MzLCByMHgwZmUwMGZlMCAgICAgICAgICAgICAgICAgOy8vIEFjYzMgLT0gKDE2Kk9mZiAtIDE2KQotICAgICAgICBVUVNVQjE2ICAgICBBY2MyLCBBY2MyLCByMHgwZmUwMGZlMCAgICAgICAgCi0gICAgICAgIFVTQVQxNiAgICAgIEFjYzEsICMxMywgQWNjMSAgICAgICAgICAgICAgICAgICAgICAgICA7Ly8gU2F0dXJhdGUgdG8gOCs1ID0gMTMgYml0cwotICAgICAgICBVU0FUMTYgICAgICBBY2MwLCAjMTMsIEFjYzAKLSAgICAgICAgVVNBVDE2ICAgICAgQWNjMywgIzEzLCBBY2MzICAgICAgICAKLSAgICAgICAgVVNBVDE2ICAgICAgQWNjMiwgIzEzLCBBY2MyCi0gICAgICAgIEFORCAgICAgICAgIEFjYzEsIHIweDAwZmYwMGZmLCBBY2MxLCBMU1IgIzUgICAgICAgICA7Ly8gWzAgYTMgMCBhMV0KLSAgICAgICAgQU5EICAgICAgICAgQWNjMCwgcjB4MDBmZjAwZmYsIEFjYzAsIExTUiAjNSAgICAgICAgIDsvLyBbMCBhMiAwIGEwXQotICAgICAgICBPUlIgICAgICAgICBBY2MwLCBBY2MwLCBBY2MxLCBMU0wgIzggICAgICAgICAgICAgICAgOy8vIFthMyBhMiBhMSBhMF0KLSAgICAgICAgQU5EICAgICAgICAgQWNjMywgcjB4MDBmZjAwZmYsIEFjYzMsIExTUiAjNSAgICAgICAgIDsvLyBbMCBiMyAwIGIxXQotICAgICAgICBBTkQgICAgICAgICBBY2MyLCByMHgwMGZmMDBmZiwgQWNjMiwgTFNSICM1ICAgICAgICAgOy8vIFswIGIyIDAgYjBdCi0gICAgICAgIAotICAgICAgICBNX1NUUiAgICAgICBBY2MwLCBbcERzdF0sIGRzdFN0ZXAgICAgICAgICAgICAgICAgICAgOy8vIFN0b3JlIHJlc3VsdCAmIGFkanVzdCBwb2ludGVyCi0gICAgICAgIE9SUiAgICAgICAgIEFjYzIsIEFjYzIsIEFjYzMsIExTTCAjOCAgICAgICAgICAgICAgICA7Ly8gW2IzIGIyIGIxIGIwXSAgICAgICAgCi0gICAgICAgIE1fU1RSICAgICAgIEFjYzIsIFtwRHN0XSwgZHN0U3RlcCAgICAgICAgICAgICAgICAgICA7Ly8gU3RvcmUgcmVzdWx0ICYgYWRqdXN0IHBvaW50ZXIgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKLSAgICAgICAgQUREICAgICAgICAgcFNyYywgcFNyYywgc3JjU3RlcCwgTFNMICMxCi0gICAgICAgIAotICAgICAgICBTVUJTICAgICAgICBDb3VudGVyLCBDb3VudGVyLCAjMQotICAgICAgICBCR1QgICAgICAgICBUd29Sb3dzTG9vcAotRW5kCi0gICAgICAgIFNVQiAgICAgcERzdCwgcERzdCwgZHN0U3RlcCwgTFNMICMyCi0gICAgICAgIFNVQiAgICAgcFNyYywgcFNyYywgc3JjU3RlcCwgTFNMICMyCi0KLSAgICAgICAgTV9FTkQKLSAgICAKLSAgICBFTkRJRgotICAgIAotICAgIEVORAotICAgIApcIE5vIG5ld2xpbmUgYXQgZW5kIG9mIGZpbGUKZGlmZiAtLWdpdCBhL21lZGlhL2xpYnN0YWdlZnJpZ2h0L2NvZGVjcy9vbjIvaDI2NGRlYy9vbXhkbC9hcm0xMS92Yy9tNHAxMC9zcmMvYXJtVkNNNF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aWR0aCAgICAgICAgICAgICAgIFJOIDQKLWlIZWlnaHQgICAgICAgICAgICAgIFJOIDUKLWR4ICAgICAgICAgICAgICAgICAgIFJOIDYKLWR5ICAgICAgICAgICAgICAgICAgIFJOIDcKLQotCi07Ly8gbG9jYWwgdmFyaWFibGUgcmVnaXN0ZXJzCi10ZW1wICAgICAgICAgICAgICAgICBSTiAxMQotcjB4MjAgICAgICAgICAgICAgICAgUk4gMTIKLXRtcDB4MjAgICAgICAgICAgICAgIFJOIDE0Ci1yZXR1cm4gICAgICAgICAgICAgICBSTiAwCi1keFBsdXNkeSAgICAgICAgICAgICBSTiAxMAotRWlnaHRNaW51c2R4ICAgICAgICAgUk4gOCAKLUVpZ2h0TWludXNkeSAgICAgICAgIFJOIDkKLWR4RWlnaHRNaW51c2R4ICAgICAgIFJOIDgKLUJBQ29lZmYgICAgICAgICAgICAgIFJOIDYKLURDQ29lZmYgICAgICAgICAgICAgIFJOIDcKLSAgICAgICAgICAgICAgICAgICAgIAotaURzdFN0ZXB4Mk1pbnVzV2lkdGggUk4gOAotaVNyY1N0ZXB4Mk1pbnVzV2lkdGggUk4gOQotaVNyY1N0ZXAxICAgICAgICAgICAgUk4gMTAKLQotcFNyYzEgICAgICAgICAgICAgICAgUk4gMQotcFNyYzIgICAgICAgICAgICAgICAgUk4gOAotcERzdDEgICAgICAgICAgICAgICAgUk4gOAotcERzdDIgICAgICAgICAgICAgICAgUk4gMTIKLSAgICAgICAgICAgICAgICAgICAgIAotcGl4MDAgICAgICAgICAgICAgICAgUk4gOAotcGl4MDEgICAgICAgICAgICAgICAgUk4gOQotcGl4MTAgICAgICAgICAgICAgICAgUk4gMTAKLXBpeDExICAgICAgICAgICAgICAgIFJOIDExCi0KLU91dDAxMDAgICAgICAgICAgICAgIFJOIDggIAotT3V0MTExMCAgICAgICAgICAgICAgUk4gMTAgCi0KLXgwMCAgICAgICAgICAgICAgICAgIFJOIDgKLXgwMSAgICAgICAgICAgICAgICAgIFJOIDEwCi14MDIgICAgICAgICAgICAgICAgICBSTiAxMgoteDEwICAgICAgICAgICAgICAgICAgUk4gOQoteDExICAgICAgICAgICAgICAgICAgUk4gMTEKLXgxMiAgICAgICAgICAgICAgICAgIFJOIDE0Ci14MjAgICAgICAgICAgICAgICAgICBSTiAxMAoteDIxICAgICAgICAgICAgICAgICAgUk4gMTIKLXgyMiAgICAgICAgICAgICAgICAgIFJOIDE0Ci0gICAgICAgICAgICAgICAgICAgICAKLXgwMXgwMCAgICAgICAgICAgICAgIFJOIDggIAoteDAyeDAxICAgICAgICAgICAgICAgUk4gMTAgCi14MTF4MTAgICAgICAgICAgICAgICBSTiA5ICAKLXgxMngxMSAgICAgICAgICAgICAgIFJOIDExIAoteDIxeDIwICAgICAgICAgICAgICAgUk4gMTAgCi14MjJ4MjEgICAgICAgICAgICAgICBSTiAxMiAKLSAgICAgICAgICAgICAgICAgICAgIAotT3V0Um93MDAgICAgICAgICAgICAgUk4gMTIKLU91dFJvdzAxICAgICAgICAgICAgIFJOIDE0Ci1PdXRSb3cxMCAgICAgICAgICAgICBSTiAxMAotT3V0Um93MTEgICAgICAgICAgICAgUk4gMTIKLSAgICAgICAgICAgICAgICAgICAgIAotT3V0Um93MDEwMCAgICAgICAgICAgUk4gMTIKLU91dFJvdzExMTAgICAgICAgICAgIFJOIDEyCi0gICAgICAgICAgICAgICAgICAgICAKLTsvLy0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tCi07Ly8gYXJtVkNNNFAxMF9JbnRlcnBvbGF0ZV9DaHJvbWFfYXNtIHN0YXJ0cwotOy8vLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0KLSAgICAgICAgCi0gICAgICAgIDsvLyBXcml0ZSBmdW5jdGlvbiBoZWFkZXIKLSAgICAgICAgTV9TVEFSVCBhcm1WQ000UDEwX0ludGVycG9sYXRlX0Nocm9tYSwgcjExCi0gICAgICAgIAotICAgICAgICA7Ly8gRGVmaW5lIHN0YWNrIGFyZ3VtZW50cwotICAgICAgICBNX0FSRyAgIFdpZHRoLCAgICAgIDQKLSAgICAgICAgTV9BUkcgICBIZWlnaHQsICAgICA0Ci0gICAgICAgIE1fQVJHICAgRHgsICAgICAgICAgNAotICAgICAgICBNX0FSRyAgIER5LCAgICAgICAgIDQKLSAgICAgICAgCi0gICAgICAgIDsvLyBMb2FkIGFyZ3VtZW50IGZyb20gdGhlIHN0YWNrCi0gICAgICAgIDsvLyBNX1NUQUxMIEFSTTExMzZKUz00Ci0gICAgICAgIAotICAgICAgICBNX0xEUiAgIGlXaWR0aCwgIFdpZHRoICAKLSAgICAgICAgTV9MRFIgICBpSGVpZ2h0LCBIZWlnaHQgIAotICAgICAgICBNX0xEUiAgIGR4LCAgICAgIER4IAotICAgICAgICBNX0xEUiAgIGR5LCAgICAgIER5Ci0gICAgICAgIAotICAgICAgICA7Ly8gRWlnaHRNaW51c2R4ID0gOCAtIGR4Ci0gICAgICAgIDsvLyBFaWdodE1pbnVzZHkgPSA4IC0gZHkKLSAgICAgICAgCi0gICAgICAgIDsvLyBBQ29lZmYgPSBFaWdodE1pbnVzZHggKiBFaWdodE1pbnVzZHkKLSAgICAgICAgOy8vIEJDb2VmZiA9IGR4ICogRWlnaHRNaW51c2R5Ci0gICAgICAgIDsvLyBDQ29lZmYgPSBFaWdodE1pbnVzZHggKiBkeQotICAgICAgICA7Ly8gRENvZWZmID0gZHggKiBkeQotICAgICAgICAKLSAgICAgICAgQUREICAgICBwU3JjMSwgcFNyYywgaVNyY1N0ZXAKLSAgICAgICAgU1VCICAgICB0ZW1wLCBpV2lkdGgsICMxCi0gICAgICAgIFJTQiAgICAgRWlnaHRNaW51c2R4LCBkeCwgIzggCi0gICAgICAgIFJTQiAgICAgRWlnaHRNaW51c2R5LCBkeSwgIzgKLSAgICAgICAgQ01OICAgICBkeCxkeQotICAgICAgICBBREQgICAgIGR4RWlnaHRNaW51c2R4LCBFaWdodE1pbnVzZHgsIGR4LCBMU0wgIzE2Ci0gICAgICAgIE9SUiAgICAgaVdpZHRoLCBpV2lkdGgsIHRlbXAsIExTTCAjMTYKLSAgICAgICAgCi0gICAgICAgIDsvLyBQYWNrZWQgQ29lZmZzLgotICAgICAgICAKLSAgICAgICAgTVVMICAgICBCQUNvZWZmLCBkeEVpZ2h0TWludXNkeCwgRWlnaHRNaW51c2R5Ci0gICAgICAgIE1VTCAgICAgRENDb2VmZiwgZHhFaWdodE1pbnVzZHgsIGR5ICAgICAgICAKLSAgICAgICAgCi0gICAgICAgIAotICAgICAgICA7Ly8gQ2hlY2tpbmcgZWl0aGVyIG9mIGR4IGFuZCBkeSBiZWluZyBub24temVybwotICAgICAgICAKLSAgICAgICAgQkVRICAgICBNVklzWmVybwotICAgICAgICAKLTsvLyBQaXhlbCBsYXlvdXQ6Ci07Ly8KLTsvLyAgIHgwMCB4MDEgeDAyCi07Ly8gICB4MTAgeDExIHgxMgotOy8vICAgeDIwIHgyMSB4MjIKLQotOy8vIElmIGZyYWN0aW9ubCBtdiBpcyBub3QgKDAsIDApCi0gICAgICAgIAotT3V0ZXJMb29wTVZJc05vdFplcm8KLQotSW5uZXJMb29wTVZJc05vdFplcm8KLSAgICAgICAgICAgIAotICAgICAgICAgICAgICAgIExEUkIgICAgeDAwLCBbcFNyYywgICMrMF0gICAgICAgICAgICAgICAgICAgCi0gICAgICAgICAgICAgICAgTERSQiAgICB4MTAsIFtwU3JjMSwgIyswXSAgICAgICAgICAgICAgICAgICAKLSAgICAgICAgICAgICAgICBMRFJCICAgIHgwMSwgW3BTcmMsICAjKzFdICAgICAgICAgICAgICAgICAgCi0gICAgICAgICAgICAgICAgTERSQiAgICB4MTEsIFtwU3JjMSwgIysxXSAgICAgICAgICAgICAgICAgIAotICAgICAgICAgICAgICAgIExEUkIgICAgeDAyLCBbcFNyYywgICMrMl0hICAgICAgICAgICAgICAgICAgIAotICAgICAgICAgICAgICAgIExEUkIgICAgeDEyLCBbcFNyYzEsICMrMl0hICAgICAgICAgICAgICAgICAgIAotICAgICAgICAgICAgICAgIAotICAgICAgICAgICAgICAgIE9SUiAgICAgeDAxeDAwLCB4MDAsIHgwMSwgTFNMICMxNiAgICAgICAgCi0gICAgICAgICAgICAgICAgOy8vIE1fU1RBTEwgQVJNMTEzNkpTPTEKLSAgICAgICAgICAgICAgICBPUlIgICAgIHgwMngwMSwgeDAxLCB4MDIsIExTTCAjMTYgICAgICAgIAotICAgICAgICAgICAgICAgIE1PViAgICAgcjB4MjAsICAjMzIKLSAgICAgICAgICAgICAgICBPUlIgICAgIHgxMXgxMCwgeDEwLCB4MTEsIExTTCAjMTYgICAgCi0gICAgICAgICAgICAgICAgT1JSICAgICB4MTJ4MTEsIHgxMSwgeDEyLCBMU0wgIzE2ICAgICAgICAKLSAgICAgICAgICAgICAgICAKLSAgICAgICAgICAgICAgICBTTUxBRCAgIHgwMXgwMCwgeDAxeDAwLCBCQUNvZWZmLCByMHgyMAotICAgICAgICAgICAgICAgIFNNTEFEICAgeDAyeDAxLCB4MDJ4MDEsIEJBQ29lZmYsIHIweDIwICAgICAgICAgICAgICAgIAotICAgICAgICAgICAgICAgIAotICAgICAgICAgICAgICAgIDsvLyBpV2lkdGggcGFja2VkIHdpdGggTVNCICh0b3AgMTYgYml0cykgCi0gICAgICAgICAgICAgICAgOy8vIGFzIGlubmVyIGxvb3AgY291bnRlciB2YWx1ZSBpLmUgCi0gICAgICAgICAgICAgICAgOy8vIChpV2lkdGggLTEpIGFuZCBMU0IgKGxvd2VyIDE2IGJpdHMpCi0gICAgICAgICAgICAgICAgOy8vIGFzIG9yaWdpbmFsIHdpZHRoCi0gICAgICAgICAgICAgICAgCi0gICAgICAgICAgICAgICAgU1VCUyAgICBpV2lkdGgsIGlXaWR0aCwgIzE8PDE3Ci0gICAgICAgICAgICAgICAgCi0gICAgICAgICAgICAgICAgU01MQUQgICBPdXRSb3cwMCwgeDExeDEwLCBEQ0NvZWZmLCB4MDF4MDAgICAgICAgICAgICAKLSAgICAgICAgICAgICAgICBTTUxBRCAgIE91dFJvdzAxLCB4MTJ4MTEsIERDQ29lZmYsIHgwMngwMSAgICAgICAgICAgIAotICAgICAgICAgICAgICAgIAotICAgICAgICAgICAgICAgIFJTQiAgICAgcFNyYzIsIHBTcmMsIHBTcmMxLCBMU0wgIzEKLSAgICAgICAgICAgICAgICAKLSAgICAgICAgICAgICAgICBNT1YgICAgIE91dFJvdzAwLCBPdXRSb3cwMCwgTFNSICM2Ci0gICAgICAgICAgICAgICAgTU9WICAgICBPdXRSb3cwMSwgT3V0Um93MDEsIExTUiAjNgotICAgICAgICAgICAgICAgIAotICAgICAgICAgICAgICAgIExEUkIgICAgeDIwLFtwU3JjMiwgIy0yXQotICAgICAgICAgICAgICAgIAotICAgICAgICAgICAgICAgIE9SUiAgICAgT3V0Um93MDEwMCwgT3V0Um93MDAsIE91dFJvdzAxLCBMU0wgIzgKLSAgICAgICAgICAgICAgICBTVFJIICAgIE91dFJvdzAxMDAsIFtwRHN0XSwgIzIKLSAgICAgICAgICAgICAgICAKLSAgICAgICAgICAgICAgICBMRFJCICAgIHgyMSxbcFNyYzIsICMtMV0KLSAgICAgICAgICAgICAgICBMRFJCICAgIHgyMixbcFNyYzIsICMrMF0KLSAgICAgICAgICAgICAgICAKLSAgICAgICAgICAgICAgICBBREQgICAgIHBEc3QxLCBwRHN0LCBpRHN0U3RlcAotICAgICAgICAgICAgICAgIAotICAgICAgICAgICAgICAgIDsvLyBNX1NUQUxMIEFSTTExMzZKUz0xCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAotICAgICAgICAgICAgICAgIE9SUiAgICAgeDIxeDIwLCB4MjAsIHgyMSwgTFNMICMxNgotICAgICAgICAgICAgICAgIE9SUiAgICAgeDIyeDIxLCB4MjEsIHgyMiwgTFNMICMxNiAgICAgCi0gICAgICAgICAgICAgICAgCi0gICAgICAgICAgICAgICAgTU9WICAgICB0bXAweDIwLCAjMzIKLSAgICAgICAgICAgICAgICAKLSAgICAgICAgICAgICAgICA7Ly8gUmV1c2luZyB0aGUgcGFja2VkIGRhdGEgeDExeDEwIGFuZCB4MTJ4MTEKLSAgICAgICAgICAgICAgICAKLSAgICAgICAgICAgICAgICBTTUxBRCAgIHgxMXgxMCwgIHgxMXgxMCwgIEJBQ29lZmYsIHRtcDB4MjAKLSAgICAgICAgICAgICAgICBTTUxBRCAgIHgxMngxMSwgIHgxMngxMSwgIEJBQ29lZmYsIHRtcDB4MjAKLSAgICAgICAgICAgICAgICBTTUxBRCAgIE91dFJvdzEwLCB4MjF4MjAsIERDQ29lZmYsIHgxMXgxMCAgICAgICAgICAgIAotICAgICAgICAgICAgICAgIFNNTEFEICAgT3V0Um93MTEsIHgyMngyMSwgRENDb2VmZiwgeDEyeDExCi0gICAgICAgICAgICAgICAgCi0gICAgICAgICAgICAgICAgTU9WICAgICBPdXRSb3cxMCwgT3V0Um93MTAsIExTUiAjNgotICAgICAgICAgICAgICAgIE1PViAgICAgT3V0Um93MTEsIE91dFJvdzExLCBMU1IgIzYKLSAgICAgICAgICAgICAgICAKLSAgICAgICAgICAgICAgICA7Ly8gTV9TVEFMTCBBUk0xMTM2SlM9MQotICAgICAgICAgICAgICAgCi0gICAgICAgICAgICAgICAgT1JSICAgICBPdXRSb3cxMTEwLCBPdXRSb3cxMCwgT3V0Um93MTEsIExTTCAjOAotICAgICAgICAgICAgICAgIAotICAgICAgICAgICAgICAgIFNUUkggICAgT3V0Um93MTExMCwgW3BEc3QxLCAjLTJdCi0gICAgICAgICAgICAgICAgCi0gICAgICAgICAgICAgICAgQkdUICAgICBJbm5lckxvb3BNVklzTm90WmVybwotICAgICAgICAgICAgICAgIAotICAgICAgICAgICAgICAgIFNVQlMgICAgaUhlaWdodCwgaUhlaWdodCwgIzIKLSAgICAgICAgICAgICAgICBBREQgICAgIGlXaWR0aCwgaVdpZHRoLCAjMTw8MTYKLSAgICAgICAgICAgICAgICBSU0IgICAgIGlEc3RTdGVweDJNaW51c1dpZHRoLCBpV2lkdGgsIGlEc3RTdGVwLCBMU0wgIzEKLSAgICAgICAgICAgICAgICBTVUIgICAgIGlTcmNTdGVwMSwgcFNyYzEsIHBTcmMKLSAgICAgICAgICAgICAgICBTVUIgICAgIHRlbXAsIGlXaWR0aCwgIzEKLSAgICAgICAgICAgICAgICBSU0IgICAgIGlTcmNTdGVweDJNaW51c1dpZHRoLCBpV2lkdGgsIGlTcmNTdGVwMSwgTFNMICMxCi0gICAgICAgICAgICAgICAgQUREICAgICBwRHN0LCBwRHN0LCBpRHN0U3RlcHgyTWludXNXaWR0aAotICAgICAgICAgICAgICAgIEFERCAgICAgcFNyYzEsIHBTcmMxLCBpU3JjU3RlcHgyTWludXNXaWR0aAotICAgICAgICAgICAgICAgIEFERCAgICAgcFNyYywgcFNyYywgaVNyY1N0ZXB4Mk1pbnVzV2lkdGgKLSAgICAgICAgICAgICAgICBPUlIgICAgIGlXaWR0aCwgaVdpZHRoLCB0ZW1wLCBMU0wgIzE2Ci0gICAgICAgICAgICAgICAgQkdUICAgICBPdXRlckxvb3BNVklzTm90WmVybwotICAgICAgICAgICAgICAgIE1PViAgICAgcmV0dXJuLCAgI09NWF9TdHNfTm9FcnIKLSAgICAgICAgICAgICAgICBNX0VYSVQKLQotOy8vIElmIGZyYWN0aW9ubCBtdiBpcyAoMCwgMCkKLQotTVZJc1plcm8KLSAgICAgICAgICAgICAgICA7Ly8gTV9TVEFMTCBBUk0xMTM2SlM9NAotT3V0ZXJMb29wTVZJc1plcm8KLQotSW5uZXJMb29wTVZJc1plcm8KLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCi0gICAgICAgICAgICAgICAgTERSQiAgICBwaXgwMCwgW3BTcmNdLCAgIysxCi0gICAgICAgICAgICAgICAgTERSQiAgICBwaXgwMSwgW3BTcmNdLCAgIysxCi0gICAgICAgICAgICAgICAgTERSQiAgICBwaXgxMCwgW3BTcmMxXSwgIysxCi0gICAgICAgICAgICAgICAgTERSQiAgICBwaXgxMSwgW3BTcmMxXSwgIysxCi0gICAgICAgICAgICAgICAgCi0gICAgICAgICAgICAgICAgQUREICAgICBwRHN0MiwgIHBEc3QsIGlEc3RTdGVwCi0gICAgICAgICAgICAgICAgU1VCUyAgICBpV2lkdGgsIGlXaWR0aCwgIzE8PDE3ICAgICAgICAgICAgICAgIAotICAgICAgICAgICAgICAgIAotICAgICAgICAgICAgICAgIE9SUiAgICAgT3V0MDEwMCwgcGl4MDAsIHBpeDAxLCBMU0wgIzggCi0gICAgICAgICAgICAgICAgT1JSICAgICBPdXQxMTEwLCBwaXgxMCwgcGl4MTEsIExTTCAjOAotICAgICAgICAgICAgICAgIAotICAgICAgICAgICAgICAgIFNUUkggICAgT3V0MDEwMCwgW3BEc3RdLCAgIzIKLSAgICAgICAgICAgICAgICBTVFJIICAgIE91dDExMTAsIFtwRHN0Ml0sICMyCi0gICAgICAgICAgICAgICAgCi0gICAgICAgICAgICAgICAgQkdUICAgICBJbm5lckxvb3BNVklzWmVybwotICAgICAgICAgICAgICAgIAotICAgICAgICAgICAgICAgIFNVQlMgICAgaUhlaWdodCwgaUhlaWdodCwgIzIKLSAgICAgICAgICAgICAgICBBREQgICAgIGlXaWR0aCwgaVdpZHRoLCAjMTw8MTYKLSAgICAgICAgICAgICAgICBSU0IgICAgIGlEc3RTdGVweDJNaW51c1dpZHRoLCBpV2lkdGgsIGlEc3RTdGVwLCBMU0wgIzEKLSAgICAgICAgICAgICAgICBTVUIgICAgIGlTcmNTdGVwMSwgcFNyYzEsIHBTcmMKLSAgICAgICAgICAgICAgICBTVUIgICAgIHRlbXAsIGlXaWR0aCwgIzEKLSAgICAgICAgICAgICAgICBSU0IgICAgIGlTcmNTdGVweDJNaW51c1dpZH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WxlcwotOy8vIChGb3IgZXhhbXBsZSB0YWJsZXMpCi0gICAgCi0gICAgICAgIAotICAgICAgICAKLSAgICAgICAgCi07Ly8gU2V0IGRlYnVnZ2luZyBsZXZlbCAgICAgICAgCi07Ly9ERUJVR19PTiAgICBTRVRMIHtUUlVFfQotCi0KLQotOy8vIEd1YXJkaW5nIGltcGxlbWVudGF0aW9uIGJ5IHRoZSBwcm9jZXNzb3IgbmFtZQotICAgIAotICAgIElGICBBUk0xMTM2SlMgCi0gICAgCi07Ly9JbnB1dCBSZWdpc3RlcnMKLXBEc3QgICAgICAgICAgICAgICAgUk4gIDAKLXBTcmMgICAgICAgICAgICAgICAgUk4gIDEKLQotOy8vT3V0cHV0IFJlZ2lzdGVycwotCi0KLTsvL0xvY2FsIFNjcmF0Y2ggUmVnaXN0ZXJzCi0KLTsvLyBQYWNrZWQgSW5wdXQgcGl4ZWxzCi1pbjAwICAgICAgICAgICAgICAgIFJOICAyICAgICAgICAgICAgICAgICAgIDsvLyBTcmNbMF0gJiBTcmNbMV0gCi1pbjAyICAgICAgICAgICAgICAgIFJOICAzICAgICAgICAgICAgICAgICAgIDsvLyBTcmNbMl0gJiBTcmNbM10KLWluMTAgICAgICAgICAgICAgICAgUk4gIDQgICAgICAgICAgICAgICAgICAgOy8vIFNyY1s0XSAmIFNyY1s1XQotaW4xMiAgICAgICAgICAgICAgICBSTiAgNSAgICAgICAgICAgICAgICAgICA7Ly8gU3JjWzZdICYgU3JjWzddCi1pbjIwICAgICAgICAgICAgICAgIFJOICA2ICAgICAgICAgICAgICAgICAgIDsvLyBTcmNbOF0gJiBTcmNbOV0KLWluMjIgICAgICAgICAgICAgICAgUk4gIDcgICAgICAgICAgICAgICAgICAgOy8vIFNyY1sxMF0gJiBTcmNbMTFdCi1pbjMwICAgICAgICAgICAgICAgIFJOICA4ICAgICAgICAgICAgICAgICAgIDsvLyBTcmNbMTJdICYgU3JjWzEzXQotaW4zMiAgICAgICAgICAgICAgICBSTiAgOSAgICAgICAgICAgICAgICAgICA7Ly8gU3JjWzE0XSAmIFNyY1sxNV0KLQotOy8vIFRyYW5zcG9zZSBmb3IgUm93IG9wZXJhdGlvbnMgKFJvd3MgdG8gY29scykKLXRyUm93MDAgICAgICAgICAgICAgUk4gIDIKLXRyUm93MTAgICAgICAgICAgICAgUk4gIDEwCi10clJvdzAyICAgICAgICAgICAgIFJOICAzCi10clJvdzEyICAgICAgICAgICAgIFJOICA1Ci10clJvdzIwICAgICAgICAgICAgIFJOICAxMQotdHJSb3czMCAgICAgICAgICAgICBSTiAgMTIKLXRyUm93MzIgICAgICAgICAgICAgUk4gIDE0Ci10clJvdzIyICAgICAgICAgICAgIFJOICA3Ci0KLTsvLyBJbnRlcm1lZGlhdGUgY2FsY3VsYXRpb25zCi1lMCAgICAgICAgICAgICAgICAgIFJOICA0ICAgICAgICAgICAgICAgICAgIAotZTEgICAgICAgICAgICAgICAgICBSTiAgNgotZTIgICAgICAgICAgICAgICAgICBSTiAgOAotZTMgICAgICAgICAgICAgICAgICBSTiAgOQotY29uc3RaZXJvICAgICAgICAgICBSTiAgMQotCi07Ly8gUm93IG9wZXJhdGVkIHBpeGVscwotcm93T3AwMCAgICAgICAgICAgICBSTiAgMgotcm93T3AxMCAgICAgICAgICAgICBSTiAgMTAKLXJvd09wMjAgICAgICAgICAgICAgUk4gIDExCi1yb3dPcDMwICAgICAgICAgICAgIFJOICAxMgotcm93T3AwMiAgICAgICAgICAgICBSTiAgMwotcm93T3AxMiAgICAgICAgICAgICBSTiAgNQotcm93T3AyMiAgICAgICAgICAgICBSTiAgNwotcm93T3AzMiAgICAgICAgICAgICBSTiAgMTQKLQotOy8vIFRyYW5zcG9zZSBmb3IgY29sdWxtbiBvcGVyYXRpb25zCi10ckNvbDAwICAgICAgICAgICAgIFJOICAyICAgICAgICAgICAgICAgICAgIAotdHJDb2wwMiAgICAgICAgICAgICBSTiAgMyAgICAgICAgICAgICAgICAgICAKLXRyQ29sMTAgICAgICAgICAgICAgUk4gIDQgICAgICAgICAgICAgICAgICAgCi10ckNvbDEyICAgICAgICAgICAgIFJOICA1ICAgICAgICAgICAgICAgICAgIAotdHJDb2wyMCAgICAgICAgICAgICBSTiAgNiAgICAgICAgICAgICAgICAgICAKLXRyQ29sMjIgICAgICAgICAgICAgUk4gIDcgICAgICAgICAgICAgICAgICAgCi10ckNvbDMwICAgICAgICAgICAgIFJOICA4ICAgICAgICAgICAgICAgICAgIAotdHJDb2wzMiAgICAgICAgICAgICBSTiAgOSAgCi0KLTsvLyBJbnRlcm1lZGlhdGUgY2FsY3VsYXRpb25zCi1nMCAgICAgICAgICAgICAgICAgIFJOICAxMAotZzEgICAgICAgICAgICAgICAgICBSTiAgMTEKLWcyICAgICAgICAgICAgICAgICAgUk4gIDEyCi1nMyAgICAgICAgICAgICAgICAgIFJOICAxNCAgIAotCi07Ly8gQ29sb3VtbiBvcGVyYXRlZCBwaXhlbHMKLWNvbE9wMDAgICAgICAgICAgICAgUk4gIDIgICAgICAgICAgICAgICAgICAgCi1jb2xPcDAyICAgICAgICAgICAgIFJOICAzICAgICAgICAgICAgICAgICAgIAotY29sT3AxMCAgICAgICAgICAgICBSTiAgNCAgICAgICAgICAgICAgICAgICAKLWNvbE9wMTIgICAgICAgICAgICAgUk4gIDUgICAgICAgICAgICAgICAgICAgCi1jb2xPcDIwICAgICAgICAgICAgIFJOICA2ICAgICAgICAgICAgICAgICAgIAotY29sT3AyMiAgICAgICAgICAgICBSTiAgNyAgICAgICAgICAgICAgICAgICAKLWNvbE9wMzAgICAgICAgICAgICAgUk4gIDggICAgICAgICAgICAgICAgICAgCi1jb2xPcDMyICAgICAgICAgICAgIFJOICA5ICAKLQotCi10ZW1wMSAgICAgICAgICAgICAgIFJOICAxMCAgICAgICAgICAgICAgICAgIDsvLyBUZW1wb3Jhcnkgc2NyYXRjaCB2YXJhaWJsZXMKLWNvbnN0MSAgICAgICAgICAgICAgUk4gIDExICAgICAgCi1jb25zdDIgICAgICAgICAgICAgIFJOICAxMgotbWFzayAgICAgICAgICAgICAgICBSTiAgMTQKLQotOy8vIE91dHB1dCBwaXhlbHMKLW91dDAwICAgICAgICAgICAgICAgUk4gIDIgICAgICAgICAgICAgICAgICAgCi1vdXQwMiAgICAgICAgICAgICAgIFJOICAzICAgICAgICAgICAgICAgICAgIAotb3V0MTAgICAgICAgICAgICAgICBSTiAgNCAgICAgICAgICAgICAgICAgICAKLW91dDEyICAgICAgICAgICAgICAgUk4gIDUgICAgICAgICAgICAgICAgICAgCi1vdXQyMCAgICAgICAgICAgICAgIFJOICA2ICAgICAgICAgICAgICAgICAgIAotb3V0MjIgICAgICAgICAgICAgICBSTiAgNyAgICAgICAgICAgICAgICAgICAKLW91dDMwICAgICAgICAgICAgICAgUk4gIDggICAgICAgICAgICAgICAgICAgCi1vdXQzMiAgICAgICAgICAgICAgIFJOICA5ICAKLSAgICAgIAotICAgICAgIAotICAgICAgIAotICAgIDsvLyBBbGxvY2F0ZSBzdGFjayBtZW1vcnkgcmVxdWlyZWQgYnkgdGhlIGZ1bmN0aW9uCi0gICAgICAgIAotCi0gICAgOy8vIFdyaXRlIGZ1bmN0aW9uIGhlYWRlcgotICAgICAgICBNX1NUQVJUIGFybVZDTTRQMTBfVHJhbnNmb3JtUmVzaWR1YWw0eDQscjExCi0gICAgICAgIAotICAgICAgICA7KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCi0gICAgICAgIDsvLyBUaGUgc3RyYXRlZ3kgdXNlZCBpbiBpbXBsZW1lbnRpbmcgdGhlIHRyYW5zZm9ybSBpcyBhcyBmb2xsb3dzOioKLSAgICAgICAgOy8vIExvYWQgdGhlIDR4NCBibG9jayBpbnRvIDggcmVnaXN0ZXJzICAgICAgICAgICAgICAgICAgICAgICAgICAgKiAgCi0gICAgICAgIDsvLyBUcmFuc3Bvc2UgdGhlIDR4NCBtYXRyaXggICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICogIAotICAgICAgICA7Ly8gUGVyZm9ybSB0aGUgcm93IG9wZXJhdGlvbnMgKG9uIGNvbHVtbnMpIHVzaW5nIFNJTUQgICAgICAgICAgICAqICAKLSAgICAgICAgOy8vIFRyYW5zcG9zZSB0aGUgNHg0IHJlc3VsdCBtYXRyaXggICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKiAgCi0gICAgICAgIDsvLyBQZXJmb3JtIHRoZSBjb2xvdW1uIG9wZXJhdGlvbnMgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICoKLSAgICAgICAgOy8vIFN0b3JlIHRoZSA0eDQgYmxvY2sgYXQgb25lIGdvICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKiAgCi0gICAgICAgIDsqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKLQotICAgICAgICA7Ly8gTG9hZCBhbGwgdGhlIDR4NCBwaXhlbHMKLSAgICAgICAgCi0gICAgICAgIExETUlBICAgcFNyYyx7aW4wMCxpbjAyLGluMTAsaW4xMixpbjIwLGluMjIsaW4zMCxpbjMyfQotICAgICAgICAKLSAgICAgICAgTU9WICAgICAgIGNvbnN0WmVybywjMCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA7Ly8gVXNlZCB0byByaWdodCBzaGlmdCBieSAxIAotICAgICAgICA7TERSICAgICAgIGNvbnN0WmVybyw9MHgwMDAwMDAwMCAgCi0gICAgICAgIAotICAgICAgICA7KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKLSAgICAgICAgOy8vCi0gICAgICAgIDsvLyBUcmFuc3Bvc2UgdGhlIG1hdHJpeCBpbm9yZGVyIHRvIHBlcmZvcm0gcm93IG9wcyBhcyBjb2xvdW1uIG9wcwotICAgICAgICA7Ly8gSW5wdXQ6ICAgaW5bXVtdID0gb3JpZ2luYWwgbWF0cml4Ci0gICAgICAgIDsvLyBPdXRwdXQ6ICB0clJvd1tdW109IHRyYW5zcG9zZWQgbWF0cml4Ci0gICAgICAgIDsvLyBTdGVwMTogT2J0YWluIHRoZSBMTCBwYXJ0IG9mIHRoZSB0cmFuc3Bvc2VkIG1hdHJpeAotICAgICAgICA7Ly8gU3RlcDI6IE9idGFpbiB0aGUgSEwgcGFydAotICAgICAgICA7Ly8gc3RlcDM6IE9idGFpbiB0aGUgTEggcGFydAotICAgICAgICA7Ly8gU3RlcDQ6IE9idGFpbiB0aGUgSEggcGFydAotICAgICAgICA7Ly8KLSAgICAgICAgOyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCi0gICAgICAgIAotICAgICAgICA7Ly8gTEwgMngyIHRyYW5zcG9zZWQgbWF0cml4IAotICAgICAgICA7Ly8gICBkMCBkMSAtIC0KLSAgICAgICAgOy8vICAgZDQgZDUgLSAtCi0gICAgICAgIDsvLyAgIC0gIC0gIC0gLQotICAgICAgICA7Ly8gICAtICAtICAtIC0KLSAgICAgICAgCi0gICAgICAgIFBLSFRCICAgdHJSb3cxMCxpbjEwLGluMDAsQVNSICMxNiAgICAgICAgICAgICAgIDsvLyBbNSA0XSA9IFtmNTpmMV0gICAgCi0gICAgICAgIFBLSEJUICAgdHJSb3cwMCxpbjAwLGluMTAsTFNMICMxNiAgICAgICAgICAgICAgIDsvLyBbMSAwXSA9IFtmNDpmMF0gIAotICAgICAgICAKLSAgICAgICAgOy8vIEhMIDJ4MiB0cmFuc3Bvc2VkIG1hdHJpeCAgCi0gICAgICAgIDsvLyAgICAtICAgLSAgIC0gLQotICAgICAgICA7Ly8gICAgLSAgIC0gICAtIC0KLSAgICAgICAgOy8vICAgIGQ4ICBkOSAgLSAtCi0gICAgICAgIDsvLyAgIGQxMiBkMTMgIC0gLQotICAgICAgICAKLSAgICAgICAgIAotICAgICAgICAgUEtIVEIgICB0clJvdzMwLGluMTIsaW4wMixBU1IgIzE2ICAgICAgICAgICAgICA7Ly8gWzEzIDEyXSA9IFs3IDNdCi0gICAgICAgICBQS0hCVCAgIHRyUm93MjAsaW4wMixpbjEyLExTTCAjMTYgICAgICAgICAgICAgIDsvLyBbOSA4XSA9IFs2IDJdIAotICAgICAgICAKLSAgICAgICAgOy8vIExIIDJ4MiB0cmFuc3Bvc2VkIG1hdHJpeCAKLSAgICAgICAgOy8vICAgLSAtIGQyIGQzIAotICAgICAgICA7Ly8gICAtIC0gZDYgZDcgCi0gICAgICAgIDsvLyAgIC0gLSAtICAtCi0gICAgICAgIDsvLyAgIC0gLSAtICAtCi0gICAgICAgIAotICAgICAgICBQS0hCVCAgIHRyUm93MDIsaW4yMCxpbjMwLExTTCAjMTYgICAgICAgICAgICAgICA7Ly8gWzMgMl0gPSBbZjEyOmY4XSAgCi0gICAgICAgIFBLSFRCICAgdHJSb3cxMixpbjMwLGluMjAsQVNSICMxNiAgICAgICAgICAgICAgIDsvLyBbNyA2XSA9IFtmMTM6ZjldIAotICAgICAgICAKLSAgICAgICAgCi0gICAgICAgIAotICAgICAgICAgCi0gICAgICAgIDsvLyBISCAyeDIgdHJhbnNwb3NlZCBtYXRyaXggIAotICAgICAgICA7Ly8gICAgLSAtICAgLSAgIC0KLSAgICAgICAgOy8vICAgIC0gLSAgIC0gICAtCi0gICAgICAgIDsvLyAgICAtIC0gIGQxMCBkMTEKLSAgICAgICAgOy8vICAgIC0gLSAgZDE0IGQxNQotICAgICAgICAKLSAgICAgICAgUEtIVEIgICB0clJvdzMyLGluMzIsaW4yMixBU1IgIzE2ICAgICAgICAgICAgICAgOy8vIFsxNSAxNF0gPSBbMTUgMTFdCi0gICAgICAgIFBLSEJUICAgdHJSb3cyMixpbjIyLGluMzIsTFNMICMxNiAgICAgICAgICAgICAgIDsvLyBbMTEgMTBdID0gWzE0IDEwXQotICAgICAgIAotICAgICAgICAKLSAgICAgICAgOyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogCi0gICAgICAgIDsvLyBSb3cgT3BlcmF0aW9ucyAoUGVyZm9ybWVkIG9uIGNvbHVtbnMpCi0gICAgICAgIDsqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqIAotICAgICAgICAKLSAgICAgICAgCi0gICAgICAgIDsvLyBTSU1EIG9wZXJhdGlvbnMgb24gZmlyc3QgdHdvIGNvbHVtbnModHdvIHJvd3Mgb2YgdGhlIG9yaWdpbmFsIG1hdHJpeCkKLSAgICAgICAgCi0gICAgICAgIAotICAgICAgICBTQUREMTYgICAgICBlMCwgdHJSb3cwMCx0clJvdzIwICAgICAgICAgICAgICAgICAgIDsvLyAgZTAgPSBkMCArIGQyIAotICAgICAgICBTU1VCMTYgICAgZTEsIHRyUm93MDAsdHJSb3cyMCAgICAgICAgICAgICAgICAgICA7Ly8gIGUxID0gZDAgLSBkMiAgCi0gICAgICAgIFNIQUREMTYgICBlMiwgdHJSb3cxMCxjb25zdFplcm8gICAgICAgICAgICAgICAgIDsvLyAoZjE+PjEpIGNvbnN0WmVybyBpcyBhIHJlZ2lzdGVyIGhvbGRpbmcgMAotICAgICAgICBTSEFERDE2ICAgZTMsIHRyUm93MzAsY29uc3RaZXJvICAgICAgICAgICAgICAgICA7Ly8gIGF2b2lkIHBpcGVsaW5lIHN0YWxscyBmb3IgZTIgYW5kIGUzCi0gICAgICAgIFNTVUIxNiAgICBlMiwgZTIsIHRyUm93MzAgICAgICAgICAgICAgICAgICAgICAgIDsvLyAgZTIgPSAoZDE+PjEpIC0gZDMgIAotICAgICAgICBTQUREMTYgICAgZTMsIGUzLCB0clJvdzEwICAgICAgICAgICAgICAgICAgICAgICA7Ly8gIGUzID0gZDEgKyAoZDM+PjEpICAKLSAgICAgICAgU0FERDE2ICAgIHJvd09wMDAsIGUwLCBlMyAgICAgICAgICAgICAgICAgICAgICAgOy8vICBmMCA9IGUwICsgZTMgIAotICAgICAgICBTQUREMTYgICAgcm93T3AxMCwgZTEsIGUyICAgICAgICAgICAgICAgICAgICAgICA7Ly8gIGYxID0gZTEgKyBlMiAgCi0gICAgICAgIFNTVUIxNiAgICByb3dPcDIwLCBlMSwgZTIgICAgICAgICAgICAgICAgICAgICAgIDsvLyAgZjIgPSBlMSAtIGUyICAKLSAgICAgICAgU1NVQjE2ICAgIHJvd09wMzAsIGUwLCBlMyAgICAgICAgICAgICAgICAgICAgICAgOy8vICBmMyA9IGUwIC0gZTMKLSAgICAgICAgCi0gICAgICAgIDsvLyBTSU1EIG9wZXJhdGlvbnMgb24gbmV4dCB0d28gY29sdW1ucyhuZXh0IHR3byByb3dzIG9mIHRoZSBvcmlnaW5hbCBtYXRyaXgpCi0gICAgICAgIAotICAgICAgICBTQUREMTYgICAgICBlMCwgdHJSb3cwMix0clJvdzIyCi0gICAgICAgIFNTVUIxNiAgICBlMSwgdHJSb3cwMix0clJvdzIyCi0gICAgICAgIFNIQUREMTYgICBlMiwgdHJSb3cxMixjb25zdFplcm8gICAgICAgICAgICAgICAgIDsvLyhmMT4+MSkgY29uc3RaZXJvIGlzIGEgcmVnaXN0ZXIgaG9sZGluZyAwCi0gICAgICAgIFNIQUREMTYgICBlMywgdHJSb3czMixjb25zdFplcm8KLSAgICAgICAgU1NVQjE2ICAgIGUyLCBlMiwgdHJSb3czMgotICAgICAgICBTQUREMTYgICAgZTMsIGUzLCB0clJvdzEyCi0gICAgICAgIFNBREQxNiAgICByb3dPcDAyLCBlMCwgZTMKLSAgICAgICAgU0FERDE2ICAgIHJvd09wMTIsIGUxLCBlMgotICAgICAgICBTU1VCMTYgICAgcm93T3AyMiwgZTEsIGUyCi0gICAgICAgIFNTVUIxNiAgICByb3dPcDMyLCBlMCwgZTMKLSAgICAgICAgCi0gICAgICAgIAotICAgICAgICA7KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKLSAgICAgICAgOy8vIFRyYW5zcG9zZSB0aGUgcmVzdWx0YW50IG1hdHJpeAotICAgICAgICA7Ly8gSW5wdXQ6ICByb3dPcFtdW10KLSAgICAgICAgOy8vIE91dHB1dDogdHJDb2xbXVtdIAotICAgICAgICA7KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKLSAgICAgICAgCi0gICAgICAgIDsvLyBMTCAyeDIgdHJhbnNwb3NlZCBtYXRyaXggCi0gICAgICAgIDsvLyAgIGQwIGQxIC0gLQotICAgICAgICA7Ly8gICBkNCBkNSAtIC0KLSAgICAgICAgOy8vICAgLSAgLSAgLSAtCi0gICAgICAgIDsvLyAgIC0gIC0gIC0gLQotICAgICAgICAKLSAgICAgICAgUEtIVEIgICB0ckNvbDEwLHJvd09wMTAscm93T3AwMCxBU1IgIzE2ICAgICAgICAgICA7Ly8gWzUgNF0gPSBbZjU6ZjFdCi0gICAgICAgIFBLSEJUICAgdHJDb2wwMCxyb3dPcDAwLHJvd09wMTAsTFNMICMxNiAgICAgICAgICAgOy8vIFsxIDBdID0gW2Y0OmYwXSAgCi0gICAgICAgIAotICAgICAgICA7Ly8gSEwgMngyIHRyYW5zcG9zZWQgbWF0cml4ICAKLSAgICAgICAgOy8vICAgIC0gICAtICAgLSAtCi0gICAgICAgIDsvLyAgICAtICAgLSAgIC0gLQotICAgICAgICA7Ly8gICAgZDggIGQ5ICAtIC0KLSAgICAgICAgOy8vICAgZDEyIGQxMyAgLSAtCi0gICAgICAgIAotICAgICAgICAgCi0gICAgICAgICBQS0hUQiAgIHRyQ29sMzAscm93T3AxMixyb3dPcDAyLEFTUiAjMTYgICAgICAgICAgOy8vIFsxMyAxMl0gPSBbNyAzXQotICAgICAgICAgUEtIQlQgICB0ckNvbDIwLHJvd09wMDIscm93T3AxMixMU0wgIzE2ICAgICAgICAgIDsvLyBbOSA4XSA9IFs2IDJdIAotICAgICAgICAKLSAgICAgICAgOy8vIExIIDJ4MiB0cmFuc3Bvc2VkIG1hdHJpeCAKLSAgICAgICAgOy8vICAgLSAtIGQyIGQzIAotICAgICAgICA7Ly8gICAtIC0gZDYgZDcgCi0gICAgICAgIDsvLyAgIC0gLSAtICAtCi0gICAgICAgIDsvLyAgIC0gLSAtICAtCi0gICAgICAgIAotICAgICAgICBQS0hCVCAgIHRyQ29sMDIscm93T3AyMCxyb3dPcDMwLExTTCAjMTYgICAgICAgICAgIDsvLyBbMyAyXSA9IFtmMTI6ZjhdICAKLSAgICAgICAgUEtIVEIgICB0ckNvbDEyLHJvd09wMzAscm93T3AyMCxBU1IgIzE2ICAgICAgICAgICA7Ly8gWzcgNl0gPSBbZjEzOmY5XSAKLSAgICAgICAgCi0gICAgICAgIAotICAgICAgICAKLSAgICAgICAgIAotICAgICAgICA7Ly8gSEggMngyIHRyYW5zcG9zZWQgbWF0cml4ICAKLSAgICAgICAgOy8vICAgIC0gLSAgIC0gICAtCi0gICAgICAgIDsvLyAgICAtIC0gICAtICAgLQotICAgICAgICA7Ly8gICAgLSAtICBkMTAgZDExCi0gICAgICAgIDsvLyAgICAtIC0gIGQxNCBkMTUKLSAgICAgICAgCi0gICAgICAgIFBLSFRCICAgdHJDb2wzMixyb3dPcDMyLHJvd09wMjIsQVNSICMxNiAgICAgICAgICAgIDsvLyBbMTUgMTRdID0gWzE1IDExXQotICAgICAgICBQS0hCVCAgIHRyQ29sMjIscm93T3AyMixyb3dPcDMyLExTTCAjMTYgICAgICAgICAgICA7Ly8gWzExIDEwXSA9IFsxNCAxMF0KLSAgICAgICAKLSAgICAgICAgCi0gICAgICAgIDsqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqIAotICAgICAgICA7Ly8gQ29sb3VtbiBPcGVyYXRpb25zIAotICAgICAgICA7KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAKLSAgICAgICAgCi0gICAgICAgIAotICAgICAgICA7Ly8gU0lNRCBvcGVyYXRpb25zIG9uIGZpcnN0IHR3byBjb2x1bW5zCi0gICAgICAgIAotICAgICAgICAgIAotICAgICAgICBTQUREMTYgICAgICBnMCwgdHJDb2wwMCx0ckNvbDIwCi0gICAgICAgIFNTVUIxNiAgICBnMSwgdHJDb2wwMCx0ckNvbDIwCi0gICAgICAgIFNIQUREMTYgICBnMiwgdHJDb2wxMCxjb25zdFplcm8gICAgICAgICAgICAgICAgICAgICA7Ly8gKGYxPj4xKSBjb25zdFplcm8gaXMgYSByZWdpc3RlciBob2xkaW5nIDAKLSAgICAgICAgU0hBREQxNiAgIGczLCB0ckNvbDMwLGNvbnN0WmVybwotICAgICAgICBTU1VCMTYgICAgZzIsIGcyLCB0ckNvbDMwCi0gICAgICAgIFNBREQxNiAgICBnMywgZzMsIHRyQ29sMTAKLSAgICAgICAgU0FERDE2ICAgIGNvbE9wMDAsIGcwLCBnMwotICAgICAgICBTQUREMTYgICAgY29sT3AxMCwgZzEsIGcyCi0gICAgICAgIFNTVUIxNiAgICBjb2xPcDIwLCBnMSwgZzIKLSAgICAgICAgU1NVQjE2ICAgIGNvbE9wMzAsIGcwLCBnMwotICAgICAgICAKLSAgICAgICAgOy8vIFNJTUQgb3BlcmF0aW9ucyBvbiBuZXh0IHR3byBjb2x1bW5zCi0gICAgICAgIAotICAgICAgICBTQUREMTYgICAgICBnMCwgdHJDb2wwMix0ckNvbDIyCi0gICAgICAgIFNTVUIxNiAgICBnMSwgdHJDb2wwMix0ckNvbDIyCi0gICAgICAgIFNIQUREMTYgICBnMiwgdHJDb2wxMixjb25zdFplcm8gICAgICAgICAgICAgICAgICAgICA7Ly8gKGYxPj4xKSBjb25zdFplcm8gaXMgYSByZWdpc3RlciBob2xkaW5nIDAKLSAgICAgICAgU0hBREQxNiAgIGczLCB0ckNvbDMyLGNvbnN0WmVybwotICAgICAgICBTU1VCMTYgICAgZzIsIGcyLCB0ckNvbDMyCi0gICAgICAgIFNBREQxNiAgICBnMywgZzMsIHRyQ29sMTIKLSAgICAgICAgU0FERDE2ICAgIGNvbE9wMDIsIGcwLCBnMwotICAgICAgICBTQUREMTYgICAgY29sT3AxMiwgZzEsIGcyCi0gICAgICAgIFNTVUIxNiAgICBjb2xPcDIyLCBnMSwgZzIKLSAgICAgICAgU1NVQjE2ICAgIGNvbE9wMzIsIGcwLCBnMwotICAgICAgICAKLSAgICAgICAgCi0gICAgICAgICAgICAgCi0gICAgICAgICAgICAgICAgICAKLSAgICAgICAgICAgICAKLSAgICAgICAgOyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgotICAgICAgICA7Ly8gQ2FsY3VsYXRlIGZpbmFsIHZhbHVlIChjb2xPcFtpXVtqXSArIDMyKT4+NgotICAgICAgICA7KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCi0gICAgICAgIAotICAgICAgICA7Ly8gY29uc3QxOiBTZXJ2ZXMgZHVhbCBwdXJwb3NlIAotICAgICAgICA7Ly8gKDEpIEFkZCAjMzIgdG8gYm90aCB0aGUgbG93ZXIgYW5kIGhpZ2hlciAxNmJpdHMgb2YgdGhlIFNJTUQgcmVzdWx0IAotICAgICAgICA7Ly8gKDIpIENvbnZlcnQgdGhlIGxvd2VyIDE2IGJpdCB2YWx1ZSB0byBhbiB1bnNpZ25lZCBudW1iZXIgKEFkZCAzMjc2OCkKLSAgICAgICAgCi0gICAgICAgIExEUiAgICAgY29uc3QxLCA9MHgwMDIwODAyMCAgICAgICAgICAgICAKLSAgICAgICAgCi0gICAgICAgIExEUiAgICAgbWFzaywgPTB4ZmZmZjAzZmYgICAgICAgICAgICAgICAgICAgICAgIDsvLyBVc2VkIHRvIG1hc2sgdGhlIGRvd24gc2hpZnRlZCA2IGJpdHMgIAotICAgICAgICAKLSAgICAgICAgOy8vIGNvbnN0MigjNTEyKTogdXNlZCB0byBjb252ZXJ0IHRoZSBsb3dlciAxNmJpdCBudW1iZXIgYmFjayB0byBzaWduZWQgdmFsdWUgCi0gICAgICAKLSAgICAgICAgTU9WICAgICBjb25zdDIsIzB4MjAwICAgICAgICAgICAgICAgICAgICAgICAgICAgOy8vIGNvbnN0MiA9IDJeOQotICAgICAgICAKLSAgICAgICAgOy8vIEZpcnN0IFJvdyAKLSAgICAgICAgCi0gICAgICAgIFNBREQxNiAgICBjb2xPcDAwLCBjb2xPcDAwLCBjb25zdDEKLSAgICAgICAgU0FERDE2ICAgIGNvbE9wMDIsIGNvbE9wMDIsIGNvbnN0MQotICAgICAgICBBTkQgICAgIGNvbE9wMDAsIG1hc2ssIGNvbE9wMDAsIEFTUiAjNgotICAgICAgICBBTkQgICAgIGNvbE9wMDIsIG1hc2ssIGNvbE9wMDIsIEFTUiAjNgotICAgICAgICBTU1VCMTYgIG91dDAwLGNvbE9wMDAsY29uc3QyCi0gICAgICAgIFNTVUIxNiAgb3V0MDIsY29sT3AwMixjb25zdDIgICAgCi0gICAgICAgIAotCi0gICAgICAgIDsvLyBTZWNvbmQgUm93Ci0gICAgICAgIAotICAgICAgICBTQUREMTYgICAgY29sT3AxMCwgY29sT3AxMCwgY29uc3QxCi0gICAgICAgIFNBREQxNiAgICBjb2xPcDEyLCBjb2xPcDEyLCBjb25zdDEKLSAgICAgICAgQU5EICAgICBjb2xPcDEwLCBtYXNrLCBjb2xPcDEwLCBBU1IgIzYKLSAgICAgICAgQU5EICAgICBjb2xPcDEyLCBtYXNrLCBjb2xPcDEyLCBBU1IgIzYKLSAgICAgICAgU1NVQjE2ICBvdXQxMCxjb2xPcDEwLGNvbnN0MgotICAgICAgICBTU1VCMTYgIG91dDEyLGNvbE9wMTIsY29uc3QyICAgIAotICAgICAgICAKLSAgICAgICAgCi0gICAgICAgIDsvLyBUaGlyZCBSb3cKLSAgICAgICAgCi0gICAgICAgIFNBREQxNiAgICBjb2xPcDIwLCBjb2xPcDIwLCBjb25zdDEKLSAgICAgICAgU0FERDE2ICAgIGNvbE9wMjIsIGNvbE9wMjIsIGNvbnN0MQotICAgICAgICBBTkQgICAgIGNvbE9wMjAsIG1hc2ssIGNvbE9wMjAsIEFTUiAjNgotICAgICAgICBBTkQgICAgIGNvbE9wMjIsIG1hc2ssIGNvbE9wMjIsIEFTUiAjNgotICAgICAgICBTU1VCMTYgIG91dDIwLGNvbE9wMjAsY29uc3QyCi0gICAgICAgIFNTVUIxNiAgb3V0MjIsY29sT3AyMixjb25zdDIKLSAgICAgICAgCi0gICAgICAgIAotICAgICAgICA7Ly8gRm91cnRoIFJvdyAgIAotICAgICAgICAKLSAgICAgICAgU0FERDE2ICAgIGNvbE9wMzAsIGNvbE9wMzAsIGNvbnN0MQotICAgICAgICBTQUREMTYgICAgY29sT3AzMiwgY29sT3AzMiwgY29uc3QxCi0gICAgICAgIEFORCAgICAgY29sT3AzMCwgbWFzaywgY29sT3AzMCwgQVNSICM2Ci0gICAgICAgIEFORCAgICAgY29sT3AzMiwgbWFzaywgY29sT3AzMiwgQVNSICM2Ci0gICAgICAgIFNTVUIxNiAgb3V0MzAsY29sT3AzMCxjb25zdDIKLSAgICAgICAgU1NVQjE2ICBvdXQzMixjb2xPcDMyLGNvbnN0MgotICAgICAgICAKLSAgICAgICAgCi0gICAgICAgIAotICAgICAgICAgICAgICAgIAotICAgICAgICA7KioqKioqKioqKioqKioqKioqKioqKioqKioqCi0gICAgICAgIDsvLyBTdG9yZSBhbGwgdGhlIDR4NCBwaXhlbHMKLSAgICAgICAgOyoqKioqKioqKioqKioqKioqKioqKioqKioqKgotICAgICAgICAKLSAgICAgICAgU1RNSUEgICBwRHN0LHtvdXQwMCxvdXQwMixvdXQxMCxvdXQxMixvdXQyMCxvdXQyMixvdXQzMCxvdXQzMn0KLSAgICAgICAgCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCi0gICAgICAgCi0gICAgICAgIDsvLyBTZXQgcmV0dXJuIHZhbHVlCi0gICAgICAgIAotRW5kICAgICAgICAgICAgICAgIAotCi0gICAgICAgIAotICAgICAgICA7Ly8gV3JpdGUgZnVuY3Rpb24gdGFpbAotICAgICAgICBNX0VORAotICAgICAgICAKLSAgICBFTkRJRiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA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gICAgICAgICAgICAgICAgICAgIHZlcnRpY2FsIGVkZ2UsIGludGVybmFsIHZlcnRpY2FsIGVkZ2UsIGV4dGVybmFsIGhvcml6b250YWwKLSAqICAgICAgICAgICAgICAgICAgICAgICAgICAgICBlZGdlLCBpbnRlcm5hbCBob3Jpem9udGFsIGVkZ2UgfQotICogW2luXQlwQmV0YQkJCXBvaW50ZXIgdG8gYSAyeDIgdGFibGUgb2YgYmV0YSB0aHJlc2hvbGRzLCBvcmdhbml6ZWQgYXMgZm9sbG93czogeyBleHRlcm5hbAotICogICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2ZXJ0aWNhbCBlZGdlLCBpbnRlcm5hbCB2ZXJ0aWNhbCBlZGdlLCBleHRlcm5hbCAgaG9yaXpvbnRhbCBlZGdlLAotICogICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpbnRlcm5hbCAgaG9yaXpvbnRhbCBlZGdlIH0KLSAqIFtpbl0JcFRocmVzaG9sZHMJCXBvaW50ZXIgdG8gYSAxNngyIHRhYmxlIG9mIHRocmVzaG9sZCAoVEMwKSwgb3JnYW5pemVkIGFzIGZvbGxvd3M6IHsgdmFsdWVzIGZvcgotICogICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0aGUgIGxlZnQgb3IgYWJvdmUgZWRnZSBvZiBlYWNoIDR4NCBibG9jaywgYXJyYW5nZWQgaW4gIHZlcnRpY2FsIGJsb2NrIG9yZGVyCi0gKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGFuZCB0aGVuIGluIGhvcml6b250YWwgYmxvY2sgb3JkZXIpCi0gKiBbaW5dCXBCUwkJCQkgcG9pbnRlciB0byBhIDE2eDIgdGFibGUgb2YgQlMgcGFyYW1ldGVycyBhcnJhbmdlZCBpbiBzY2FuIGJsb2NrIG9yZGVyIGZvciB2ZXJ0aWNhbCBlZGdlcyBhbmQgdGhlbiBob3Jpem9udGFsIGVkZ2VzOwotICogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdm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RpdiAgICAgICAgICBSTiAgNAotcFFQbW9kICAgICAgICAgIFJOICA1Ci1wVlJvdyAgICAgICAgICAgUk4gIDIKLVFQbW9kICAgICAgICAgICBSTiAgNgotc2hpZnQgICAgICAgICAgIFJOICAzCi1yb3dMdW1hMDEgICAgICAgUk4gIDEKLXJvd0x1bWEyMyAgICAgICBSTiAgNAotCi1TcmNEc3QwMCAgICAgICAgUk4gIDUKLVNyY0RzdDAyICAgICAgICBSTiAgNgotU3JjRHN0MTAgICAgICAgIFJOICA3Ci1TcmNEc3QxMiAgICAgICAgUk4gIDgKLVNyY0RzdDIwICAgICAgICBSTiAgOQotU3JjRHN0MjIgICAgICAgIFJOICAxMAotU3JjRHN0MzAgICAgICAgIFJOICAxMQotU3JjRHN0MzIgICAgICAgIFJOICAxMgotCi10ZW1wMSAgICAgICAgICAgUk4gIDIKLXRlbXAyICAgICAgICAgICBSTiAgMwotdGVtcDMgICAgICAgICAgIFJOICAxNAotICAgIAotICAgIAotICAgICAgICA7Ly8gQWxsb2NhdGUgc3RhY2sgbWVtb3J5IHJlcXVpcmVkIGJ5IHRoZSBmdW5jdGlvbgotICAgICAgICAKLSAgICAgICAgOy8vIFdyaXRlIGZ1bmN0aW9uIGhlYWRlcgotICAgICAgICBNX1NUQVJUIGFybVZDTTRQMTBfRGVxdWFudEx1bWFBQzR4NCxyMTEKLSAgICAgICAgIAotICAgICAgICBMRFIgICAgcFFQbW9kLD1hcm1WQ000UDEwX1FQTW9kdWxvVGFibGUKLSAgICAgICAgTERSICAgIHBRUGRpdiw9YXJtVkNNNFAxMF9RUERpdlRhYmxlICAgICAgICAKLSAgICAgICAgTERSICAgIHBWUm93LD1hcm1WQ000UDEwX1ZNYXRyaXhVMTYKLSAgICAgICAgIAotICAgICAgICBMRFJTQiAgUVBtb2QsW3BRUG1vZCxRUF0gICAgICAgICAgICAgICAgICAgIDsvLyAoUVAlNikgKiA2Ci0gICAgICAgIExEUlNCICBzaGlmdCxbcFFQZGl2LFFQXSAgICAgICAgICAgICAgICAgICAgOy8vIFNoaWZ0ID0gUVAgLyA2Ci0gICAgICAgICAgICAgICAgCi0gICAgICAgIExEUkggICAgcm93THVtYTAxLFtwVlJvdyxRUG1vZF0hICAgICAgICAgICAgIDsvLyByb3dMdW1hMDEgPSBbMDB8MGFdCi0gICAgICAgIExEUkggICAgdGVtcDMsW3BWUm93LCMyXSAgICAgICAgICAgICAgICAgICAgIDsvLyB0ZW1wMyAgICAgPSBbMDB8MGJdICAgCi0gICAgICAgIExEUkggICAgcm93THVtYTIzLFtwVlJvdywjNF0gICAgICAgICAgICAgICAgIDsvLyByb3dMdW1hMjMgPSBbMDB8MGNdIAotICAgICAgICBPUlIgICAgIHJvd0x1bWEwMSxyb3dMdW1hMDEsdGVtcDMsTFNMICMxNiAgICA7Ly8gcm93THVtYTAxID0gWzBifDBhXSAgIAotICAgICAgICAKLSAgICAgICAgOy8vIExvYWQgYWxsIHRoZSAxNiAnc3JjJyB2YWx1ZXMKLSAgICAgICAgTERNSUEgICBwU3JjRHN0LHtTcmNEc3QwMCxTcmNEc3QwMixTcmNEc3QxMCxTcmNEc3QxMixTcmNEc3QyMCxTcmNEc3QyMixTcmNEc3QzMCxTcmNEc3QzMn0KLSAgICAgICAgCi0gICAgICAgIAotICAgICAgICA7Ly8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKLSAgICAgICAgOy8vCi0gICAgICAgIDsvLyAnU2hpZnQnIHJhbmdlcyBiZXR3ZWVuIFswLDhdIAotICAgICAgICA7Ly8gU28gd2UgY2FuIHNoaWZ0IHRoZSBwYWNrZWQgcm93THVtYSB2YWx1ZXMgWzBifDBhXSB3aXRoIGEgc2luZ2xlIExTTCBvcGVyYXRpb24KLSAgICAgICAgOy8vCi0gICAgICAgIDsvLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKio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GlmdCkgaXMgY2FsY3VsYXRlZAotICAgICAgICA7Ly8gSGVyZSB3ZSBpbnRlcmxlYXZlIHRoZSBQS0hCVCBvcGVyYXRpb25zIGZvciB2YXJpb3VzIHJvd3MgIHRvIGF2b2lkZSBwaXBlbGluZSBzdGFsbHMKLSAgICAgICAgOy8vIAotICAgICAgICA7Ly8gV2UgdGhlbiBwYWNrIHRoZSB0d28gMTYgYml0IG11bHRpcGxpY2F0aW9uIHJlc3VsdCBpbnRvIGEgd29yZCBhbmQgc3RvcmUgYXQgb25lIGdvCi0gICAgICAgIDsvLwotICAgICAgICA7Ly8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCi0gICAgICAgIAotICAgICAgICAKLSAgICAgICAgOy8vIFJvdyAxCi0gICAgICAgIAotICAgICAgICAKLSAgICAgICAgU01VTFRCICB0ZW1wMSxTcmNEc3QwMCxyb3dMdW1hMjMgICAgICAgICAgICAgICAgICAgIDsvLyBwU3JjRHN0WzFdICogKHBWUm93WzJdPDxTaGlmdCkgCi0gICAgICAgIFNNVUxCQiAgU3JjRHN0MDAsU3JjRHN0MDAscm93THVtYTAxICAgICAgICAgICAgICAgICA7Ly8gcFNyY0RzdFswXSAqIChwVlJvd1swXTw8U2hpZnQpICAKLSAgICAgICAgCi0gICAgICAgIFNNVUxUQiAgdGVtcDIsU3JjRHN0MDIscm93THVtYTIzICAgICAgICAgICAgICAgICAgICA7Ly8gcFNyY0RzdFszXSAqIChwVlJvd1syXTw8U2hpZnQpIAotICAgICAgICBTTVVMQkIgIFNyY0RzdDAyLFNyY0RzdDAyLHJvd0x1bWEwMSAgICAgICAgICAgICAgICAgOy8vIHBTcmNEc3RbMl0gKiAocFZSb3dbMF08PFNoaWZ0KQotICAgICAgICAKLSAgICAgICAgUEtIQlQgICBTcmNEc3QwMCxTcmNEc3QwMCx0ZW1wMSxMU0wgIzE2ICAgICAgICAgICAgIDsvLyBQYWNrIHRoZSBmaXJzdCB0d28gcHJvZHVjdCB2YWx1ZXMKLSAgICAgICAgCi0gICAgICAgICAgICAgICAgCi0gICAgICAgIDsvLyBSb3cgMgotICAgICAgICBTTVVMVFQgIHRlbXAxLFNyY0RzdDEwLHJvd0x1bWEwMSAgICAgICAgICAgICAgICAgICAgOy8vIHBTcmNEc3RbNV0gKiAocFZSb3dbMV08PFNoaWZ0KQotICAgICAgICBTTVVMQkIgIFNyY0RzdDEwLFNyY0RzdDEwLHJvd0x1bWEyMyAgICAgICAgICAgICAgICAgOy8vIHBTcmNEc3RbNF0gKiAocFZSb3dbMl08PFNoaWZ0KQotICAgICAgICAKLSAgICAgICAgUEtIQlQgICBTcmNEc3QwMixTcmNEc3QwMix0ZW1wMixMU0wgIzE2ICAgICAgICAgICAgIDsvLyBQYWNrIHRoZSBuZXh0IHR3byBwcm9kdWN0IHZhbHVlcwotICAgICAgICBTTVVMVFQgIHRlbXAyLFNyY0RzdDEyLHJvd0x1bWEwMSAgICAgICAgICAgICAgICAgICAgOy8vIHBTcmNEc3RbN10gKiAocFZSb3dbMV08PFNoaWZ0KQotICAgICAgICBTTVVMQkIgIFNyY0RzdDEyLFNyY0RzdDEyLHJvd0x1bWEyMyAgICAgICAgICAgICAgICAgICAgOy8vIHBTcmNEc3RbNl0gKiAocFZSb3dbMl08PFNoaWZ0KQotICAgICAgICAKLSAgICAgICAgUEtIQlQgICBTcmNEc3QxMCxTcmNEc3QxMCx0ZW1wMSxMU0wgIzE2ICAgICAgICAgICAgIDsvLyBQYWNrIHRoZSBuZXh0IHR3byBwcm9kdWN0IHZhbHVlcwotICAgICAgICAKLSAgICAgICAgICAgICAgIAotICAgICAgICA7Ly8gUm93IDMgICAgCi0gICAgICAgIAotICAgICAgICBTTVVMVEIgIHRlbXAxLFNyY0RzdDIwLHJvd0x1bWEyMyAgICAgICAgICAgICAgICAgICAgOy8vIHBTcmNEc3RbOV0gKiAocFZSb3dbMl08PFNoaWZ0KSAgICAgICAgIAotICAgICAgICBTTVVMQkIgIFNyY0RzdDIwLFNyY0RzdDIwLHJvd0x1bWEwMSAgICAgICAgICAgICAgICAgICAgOy8vIHBTcmNEc3RbOF0gKiAocFZSb3dbMF08PFNoaWZ0KSAgCi0gICAgICAgCi0gICAgICAgIFBLSEJUICAgU3JjRHN0MTIsU3JjRHN0MTIsdGVtcDIsTFNMICMxNiAgICAgICAgICAgICAgIDsvLyBQYWNrIHRoZSBuZXh0IHR3byBwcm9kdWN0IHZhbHVlcwotICAgICAgICBTTVVMVEIgIHRlbXAyLFNyY0RzdDIyLHJvd0x1bWEyMyAgICAgICAgICAgICAgICAgICAgOy8vIHBTcmNEc3RbMTFdICogKHBWUm93WzJdPDxTaGlmdCkgCi0gICAgICAgIFNNVUxCQiAgU3JjRHN0MjIsU3JjRHN0MjIscm93THVtYTAxICAgICAgICAgICAgICAgICAgICA7Ly8gcFNyY0RzdFsxMF0gKiAocFZSb3dbMF08PFNoaWZ0KQotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCi0gICAgICAgIFBLSEJUICAgU3JjRHN0MjAsU3JjRHN0MjAsdGVtcDEsTFNMICMxNiAgICAgICAgICAgICA7Ly8gUGFjayB0aGUgbmV4dCB0d28gcHJvZHVjdCB2YWx1ZXMKLSAgICAgICAgCi0gICAgICAgIAotICAgICAgICAgICAgICAgICAgICAgICAgCi0gICAgICAgIDsvLyBSb3cgNCAgIAotICAgICAgICAKLSAgICAgICAgU01VTFRUICB0ZW1wMSxTcmNEc3QzMCxyb3dMdW1hMDEgICAgICAgICAgICAgICAgICAgIDsvLyBwU3JjRHN0WzEzXSAqIChwVlJvd1sxXTw8U2hpZnQpCi0gICAgICAgIFNNVUxCQiAgU3JjRHN0MzAsU3JjRHN0MzAscm93THVtYTIzICAgICAgICAgICAgICAgICAgICA7Ly8gcFNyY0RzdFsxMl0gKiAocFZSb3dbMl08PFNoaWZ0KQotICAgICAgICAKLSAgICAgICAgU01VTFRUICB0ZW1wMyxTcmNEc3QzMixyb3dMdW1hMDEgICAgICAgICAgICAgICAgICAgIDsvLyBwU3JjRHN0WzE1XSAqIChwVlJvd1sxXTw8U2hpZnQpCi0gICAgICAgIFNNVUxCQiAgU3JjRHN0MzIsU3JjRHN0MzIscm93THVtYTIzICAgICAgICAgICAgICAgICAgICA7Ly8gcFNyY0RzdFsxNF0gKiAocFZSb3dbMl08PFNoaWZ0KQotICAgICAgIAotICAgICAgICBQS0hCVCAgIFNyY0RzdDIyLFNyY0RzdDIyLHRlbXAyLExTTCAjMTYgICAgICAgICAgICAgOy8vIFBhY2sgdGhlIHJlbWFpbmluZyBwcm9kdWN0IHZhbHVlcwotICAgICAgICBQS0hCVCAgIFNyY0RzdDMwLFNyY0RzdDMwLHRlbXAxLExTTCAjMTYKLSAgICAgICAgUEtIQlQgICBTcmNEc3QzMixTcmNEc3QzMix0ZW1wMyxMU0wgIzE2Ci0gICAgICAgIAotICAgICAgICAKLSAgICAgICAgU1RNSUEgICBwU3JjRHN0LHtTcmNEc3QwMCxTcmNEc3QwMixTcmNEc3QxMCxTcmNEc3QxMixTcmNEc3QyMCxTcmNEc3QyMixTcmNEc3QzMCxTcmNEc3QzMn0KLSAgICAgICAgCi0gICAgICAgIAotICAgICAgICA7Ly8gU2V0IHJldHVybiB2YWx1ZQotICAgICAgICAgIAotICAgICAgICAgICAKLSAgICAgIAotICAgICAgICA7Ly8gV3JpdGUgZnVuY3Rpb24gdGFpbAotICAgICAgICBNX0VORAotICAgICAgICAKLSAgICBFTkRJRiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA7Ly9BUk0xMTM2SlMgICAgICAgIAotIAotCi07Ly8gR3VhcmRpbmcgaW1wbGVtZW50YXRpb24gYnkgdGhlIHByb2Nlc3NvciBuYW1lCi0gICAgCi0gICAgSUYgIEFSTTExMzZKU19VCi0gICAgCi07Ly9JbnB1dCBSZWdpc3RlcnMKLXBTcmNEc3QgICAgICAgUk4gIDAKLVFQICAgICAgICAgICAgUk4gIDEKLQotCi07Ly9PdXRwdXQgUmVnaXN0ZXJzCi0KLQotOy8vTG9jYWwgU2NyYXRjaCBSZWdpc3RlcnMKLXBRUGRpdiAgICAgICAgICBSTiAgNAotcFFQbW9kICAgICAgICAgIFJOICA1Ci1wVlJvdyAgICAgICAgICAgUk4gIDIKLVFQbW9kICAgICAgICAgICBSTiAgNgotc2hpZnQgICAgICAgICAgIFJOICAzCi1yb3dMdW1hMDEgICAgICAgUk4gIDEKLXJvd0x1bWEyMyAgICAgICBSTiAgNAotCi1TcmNEc3QwMCAgICAgICAgUk4gIDUKLVNyY0RzdDAyICAgICAgICBSTiAgNgotU3JjRHN0MTAgICAgICAgIFJOICA3Ci1TcmNEc3QxMiAgICAgICAgUk4gIDgKLVNyY0RzdDIwICAgICAgICBSTiAgOQotU3JjRHN0MjIgICAgICAgIFJOICAxMAotU3JjRHN0MzAgICAgICAgIFJOICAxMQotU3JjRHN0MzIgICAgICAgIFJOICAxMgotCi10ZW1wMSAgICAgICAgICAgUk4gIDIKLXRlbXAyICAgICAgICAgICBSTiAgMwotdGVtcDMgICAgICAgICAgIFJOICAxNAotICAgIAotICAgIAotICAgICAgICA7Ly8gQWxsb2NhdGUgc3RhY2sgbWVtb3J5IHJlcXVpcmVkIGJ5IHRoZSBmdW5jdGlvbgotICAgICAgICAKLSAgICAgICAgOy8vIFdyaXRlIGZ1bmN0aW9uIGhlYWRlcgotICAgICAgICBNX1NUQVJUIGFybVZDTTRQMTBfRGVxdWFudEx1bWFBQzR4NCxyMTEKLSAgICAgICAgIAotICAgICAgICBMRFIgICAgcFFQbW9kLD1hcm1WQ000UDEwX1FQTW9kdWxvVGFibGUKLSAgICAgICAgTERSICAgIHBRUGRpdiw9YXJtVkNNNFAxMF9RUERpdlRhYmxlICAgICAgICAKLSAgICAgICAgTERSICAgIHBWUm93LD1hcm1WQ000UDEwX1ZNYXRyaXhVMTYKLSAgICAgICAgIAotICAgICAgICBMRFJTQiAgUVBtb2QsW3BRUG1vZCxRUF0gICAgICAgICAgICAgICAgICAgIDsvLyAoUVAlNikgKiA2Ci0gICAgICAgIExEUlNCICBzaGlmdCxbcFFQZGl2LFFQXSAgICAgICAgICAgICAgICAgICAgOy8vIFNoaWZ0ID0gUVAgLyA2Ci0gICAgICAgICAgICAgICAgCi0gICAgICAgIExEUiAgICByb3dMdW1hMDEsW3BWUm93LFFQbW9kXSEgICAgICAgICAgICAgOy8vIHJvd0x1bWEwMSA9IFswYnwwYV0KLSAgICAgICAgTERSICAgIHJvd0x1bWEyMyxbcFZSb3csIzRdICAgICAgICAgICAgICAgICA7Ly8gcm93THVtYTIzID0gWzBkfDBjXSAgICAKLQotICAgICAgICA7Ly8gTG9hZCBhbGwgdGhlIDE2ICdzcmMnIHZhbHVlcwotICAgICAgICBMRE1JQSAgIHBTcmNEc3Qse1NyY0RzdDAwLFNyY0RzdDAyLFNyY0RzdDEwLFNyY0RzdDEyLFNyY0RzdDIwLFNyY0RzdDIyLFNyY0RzdDMwLFNyY0RzdDMyfQotICAgICAgICAKLSAgICAgICAgCi0gICAgICAgIDsvLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgotICAgICAgICA7Ly8KLSAgICAgICAgOy8vICdTaGlmdCcgcmFuZ2VzIGJldHdlZW4gWzAsOF0gCi0gICAgICAgIDsvLyBTbyB3ZSBjYW4gc2hpZnQgdGhlIHBhY2tlZCByb3dMdW1hIHZhbHVlcyBbMGJ8MGFdIHdpdGggYSBzaW5nbGUgTFNMIG9wZXJhdGlvbgotICAgICAgICA7Ly8KLSAgICAgICAgOy8vKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCi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dlIGludGVybGVhdmUgdGhlIFBLSEJUIG9wZXJhdGlvbnMgZm9yIHZhcmlvdXMgcm93cyAgdG8gYXZvaWRlIHBpcGVsaW5lIHN0YWxscwotICAgICAgICA7Ly8gCi0gICAgICAgIDsvLyBXZSB0aGVuIHBhY2sgdGhlIHR3byAxNiBiaXQgbXVsdGlwbGljYXRpb24gcmVzdWx0IGludG8gYSB3b3JkIGFuZCBzdG9yZSBhdCBvbmUgZ28KLSAgICAgICAgOy8vCi0gICAgICAgIDsvLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKLSAgICAgICAgCi0gICAgICAgIAotICAgICAgICA7Ly8gUm93IDEKLSAgICAgICAgCi0gICAgICAgIAotICAgICAgICBTTVVMVEIgIHRlbXAxLFNyY0RzdDAwLHJvd0x1bWEyMyAgICAgICAgICAgICAgICAgICAgOy8vIHBTcmNEc3RbMV0gKiAocFZSb3dbMl08PFNoaWZ0KSAKLSAgICAgICAgU01VTEJCICBTcmNEc3QwMCxTcmNEc3QwMCxyb3dMdW1hMDEgICAgICAgICAgICAgICAgIDsvLyBwU3JjRHN0WzBdICogKHBWUm93WzBdPDxTaGlmdCkgIAotICAgICAgICAKLSAgICAgICAgU01VTFRCICB0ZW1wMixTcmNEc3QwMixyb3dMdW1hMjMgICAgICAgICAgICAgICAgICAgIDsvLyBwU3JjRHN0WzNdICogKHBWUm93WzJdPDxTaGlmdCkgCi0gICAgICAgIFNNVUxCQiAgU3JjRHN0MDIsU3JjRHN0MDIscm93THVtYTAxICAgICAgICAgICAgICAgICA7Ly8gcFNyY0RzdFsyXSAqIChwVlJvd1swXTw8U2hpZnQpCi0gICAgICAgIAotICAgICAgICBQS0hCVCAgIFNyY0RzdDAwLFNyY0RzdDAwLHRlbXAxLExTTCAjMTYgICAgICAgICAgICAgOy8vIFBhY2sgdGhlIGZpcnN0IHR3byBwcm9kdWN0IHZhbHVlcwotICAgICAgICAKLSAgICAgICAgICAgICAgICAKLSAgICAgICAgOy8vIFJvdyAyCi0gICAgICAgIFNNVUxUVCAgdGVtcDEsU3JjRHN0MTAscm93THVtYTAxICAgICAgICAgICAgICAgICAgICA7Ly8gcFNyY0RzdFs1XSAqIChwVlJvd1sxXTw8U2hpZnQpCi0gICAgICAgIFNNVUxCQiAgU3JjRHN0MTAsU3JjRHN0MTAscm93THVtYTIzICAgICAgICAgICAgICAgICA7Ly8gcFNyY0RzdFs0XSAqIChwVlJvd1syXTw8U2hpZnQpCi0gICAgICAgIAotICAgICAgICBQS0hCVCAgIFNyY0RzdDAyLFNyY0RzdDAyLHRlbXAyLExTTCAjMTYgICAgICAgICAgICAgOy8vIFBhY2sgdGhlIG5leHQgdHdvIHByb2R1Y3QgdmFsdWVzCi0gICAgICAgIFNNVUxUVCAgdGVtcDIsU3JjRHN0MTIscm93THVtYTAxICAgICAgICAgICAgICAgICAgICA7Ly8gcFNyY0RzdFs3XSAqIChwVlJvd1sxXTw8U2hpZnQpCi0gICAgICAgIFNNVUxCQiAgU3JjRHN0MTIsU3JjRHN0MTIscm93THVtYTIzICAgICAgICAgICAgICAgICAgICA7Ly8gcFNyY0RzdFs2XSAqIChwVlJvd1syXTw8U2hpZnQpCi0gICAgICAgIAotICAgICAgICBQS0hCVCAgIFNyY0RzdDEwLFNyY0RzdDEwLHRlbXAxLExTTCAjMTYgICAgICAgICAgICAgOy8vIFBhY2sgdGhlIG5leHQgdHdvIHByb2R1Y3QgdmFsdWVzCi0gICAgICAgIAotICAgICAgICAgICAgICAgCi0gICAgICAgIDsvLyBSb3cgMyAgICAKLSAgICAgICAgCi0gICAgICAgIFNNVUxUQiAgdGVtcDEsU3JjRHN0MjAscm93THVtYTIzICAgICAgICAgICAgICAgICAgICA7Ly8gcFNyY0RzdFs5XSAqIChwVlJvd1syXTw8U2hpZnQpICAgICAgICAgCi0gICAgICAgIFNNVUxCQiAgU3JjRHN0MjAsU3JjRHN0MjAscm93THVtYTAxICAgICAgICAgICAgICAgICAgICA7Ly8gcFNyY0RzdFs4XSAqIChwVlJvd1swXTw8U2hpZnQpICAKLSAgICAgICAKLSAgICAgICAgUEtIQlQgICBTcmNEc3QxMixTcmNEc3QxMix0ZW1wMixMU0wgIzE2ICAgICAgICAgICAgICAgOy8vIFBhY2sgdGhlIG5leHQgdHdvIHByb2R1Y3QgdmFsdWVzCi0gICAgICAgIFNNVUxUQiAgdGVtcDIsU3JjRHN0MjIscm93THVtYTIzICAgICAgICAgICAgICAgICAgICA7Ly8gcFNyY0RzdFsxMV0gKiAocFZSb3dbMl08PFNoaWZ0KSAKLSAgICAgICAgU01VTEJCICBTcmNEc3QyMixTcmNEc3QyMixyb3dMdW1hMDEgICAgICAgICAgICAgICAgICAgIDsvLyBwU3JjRHN0WzEwXSAqIChwVlJvd1swXTw8U2hpZnQpCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKLSAgICAgICAgUEtIQlQgICBTcmNEc3QyMCxTcmNEc3QyMCx0ZW1wMSxMU0wgIzE2ICAgICAgICAgICAgIDsvLyBQYWNrIHRoZSBuZXh0IHR3byBwcm9kdWN0IHZhbHVlcwotICAgICAgICAKLSAgICAgICAgCi0gICAgICAgICAgICAgICAgICAgICAgICAKLSAgICAgICAgOy8vIFJvdyA0ICAgCi0gICAgICAgIAotICAgICAgICBTTVVMVFQgIHRlbXAxLFNyY0RzdDMwLHJvd0x1bWEwMSAgICAgICAgICAgICAgICAgICAgOy8vIHBTcmNEc3RbMTNdICogKHBWUm93WzFdPDxTaGlmdCkKLSAgICAgICAgU01VTEJCICBTcmNEc3QzMCxTcmNEc3QzMCxyb3dMdW1hMjMgICAgICAgICAgICAgICAgICAgIDsvLyBwU3JjRHN0WzEyXSAqIChwVlJvd1syXTw8U2hpZnQpCi0gICAgICAgIAotICAgICAgICBTTVVMVFQgIHRlbXAzLFNyY0RzdDMyLHJvd0x1bWEwMSAgICAgICAgICAgICAgICAgICAgOy8vIHBTcmNEc3RbMTVdICogKHBWUm93WzFdPDxTaGlmdCkKLSAgICAgICAgU01VTEJCICBTcmNEc3QzMixTcmNEc3QzMixyb3dMdW1hMjMgICAgICAgICAgICAgICAgICAgIDsvLyBwU3JjRHN0WzE0XSAqIChwVlJvd1syXTw8U2hpZnQpCi0gICAgICAgCi0gICAgICAgIFBLSEJUICAgU3JjRHN0MjIsU3JjRHN0MjIsdGVtcDIsTFNMICMxNiAgICAgICAgICAgICA7Ly8gUGFjayB0aGUgcmVtYWluaW5nIHByb2R1Y3QgdmFsdWVzCi0gICAgICAgIFBLSEJUICAgU3JjRHN0MzAsU3JjRHN0MzAsdGVtcDEsTFNMICMxNgotICAgICAgICBQS0hCVCAgIFNyY0RzdDMyLFNyY0RzdDMyLHRlbXAzLExTTCAjMTYKLSAgICAgICAgCi0gICAgICAgIAotICAgICAgICBTVE1JQSAgIHBTcmNEc3Qse1NyY0RzdDAwLFNyY0RzdDAyLFNyY0RzdDEwLFNyY0RzdDEyLFNyY0RzdDIwLFNyY0RzdDIyLFNyY0RzdDMwLFNyY0RzdDMyfQotICAgICAgICAKLSAgICAgICAgCi0gICAgICAgIDsvLyBTZXQgcmV0dXJuIHZhbHVlCi0gICAgICAgICAgCi0gICAgICAgICAgIAotICAgICAgCi0gICAgICAgIDsvLyBXcml0ZSBmdW5jdGlvbiB0YWlsCi0gICAgICAgIE1fRU5ECi0gICAgICAgIAotICAgIEVORElGICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDsvL0FSTTExMzZKU19VICAgICAgICAKLQotCi0KLQotCi07Ly8gRnVuY3Rpb246IG9teFZDTTRQMTBfRGVxdWFudFRyYW5zZm9ybVJlc2lkdWFsRnJvbVBhaXJBbmRBZGQgICAgICAgICAgICAKLSAgICAKLTsvLyBHdWFyZGluZyBpbXBsZW1lbnRhdGlvbiBieSB0aGUgcHJvY2Vzc29yIG5hb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ly8gV3JpdGUgZnVuY3Rpb24gaGVhZGVyCi0gICAgICAgIE1fU1RBUlQgb214VkNNNFAxMF9EZXF1YW50VHJhbnNmb3JtUmVzaWR1YWxGcm9tUGFpckFuZEFkZCxyMTEKLSAgICAgICAgCi0gICAgICAgIDsvLyBEZWZpbmUgc3RhY2sgYXJndW1lbnRzCi0gICAgICAgIE1fQVJHICAgcHJlZFN0ZXBPblN0YWNrLCA0Ci0gICAgICAgIE1fQVJHICAgZHN0U3RlcE9uU3RhY2ssNAotICAgICAgICBNX0FSRyAgIFFQT25TdGFjaywgNAotICAgICAgICBNX0FSRyAgIEFDT25TdGFjayw0Ci0gIAotICAgICAgICAKLSAgICAgICAgTV9BRFIgICBwRGVsdGEscEJ1ZmZlciAKLSAgICAgICAgTV9MRFIgICBBQyxBQ09uU3RhY2sgCi0gICAgICAgIAotICAgICAgICAgCi0gICAgICAgIDsvLyBTYXZlIHJlZ2lzdGVycyByMSxyMixyMyBiZWZvcmUgZnVuY3Rpb24gY2FsbCAgICAKLSAgICAgICAgTU9WICAgICBwUHJlZFRlbXAscFByZWQKLSAgICAgICAgTU9WICAgICBwRENUZW1wLHBEQwotICAgICAgICBNT1YgICAgIHBEc3RUZW1wLHBEc3QKLSAgICAgICAgCi0gICAgICAgIENNUCAgICAgQUMsIzAKLSAgICAgICAgQkVRICAgICBEQ2Nhc2UKLSAgICAgICAgTU9WICAgICBwRGVsdGFBcmcxLHBEZWx0YSAgICAgICAgICAgICAgICAgICAgICAgICAgIDsvLyBTZXQgdXAgcjEgZm9yIGFybVZDTTRQMTBfVW5wYWNrQmxvY2s0eDQKLSAgICAKLSAgICAgICAgQkwgICAgICBhcm1WQ000UDEwX1VucGFja0Jsb2NrNHg0Ci0gICAgCi0gICAgICAgIE1fTERSICAgUVAsUVBPblN0YWNrICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA7Ly8gU2V0IHVwIHIxIGZvciBEZXF1YW50THVtYUFDNHg0Ci0gICAgICAgIE1PViAgICAgcERlbHRhQXJnMCxwRGVsdGEgICAgICAgICAgICAgICAgICAgICAgICAgICA7Ly8gU2V0IHVwIHIwIGZvciBEZXF1YW50THVtYUFDNHg0Ci0KLSAgICAgICAgQkwgICAgICBhcm1WQ000UDEwX0RlcXVhbnRMdW1hQUM0eDQKLSAgICAgICAgCi0gICAgICAgIAotICAgICAgICBDTVAgICAgIHBEQ1RlbXAsIzAKLSAgICAgICAgTERSU0hORSBEQ3ZhbCxbcERDVGVtcF0KLSAgICAgICAgTU9WICAgICBwRGVsdGFBcmcwLHBEZWx0YSAgICAgICAgICAgICAgICAgICAgICAgICAgIDsvLyBTZXQgdXAgcjAgZm9yIGFybVZDTTRQMTBfVHJhbnNmb3JtUmVzaWR1YWw0eDQKLSAgICAgICAgTU9WICAgICBwRGVsdGFBcmcxLHBEZWx0YSAgICAgICAgICAgICAgICAgICAgICAgICAgIDsvLyBTZXQgdXAgcjEgZm9yIGFybVZDTTRQMTBfVHJhbnNmb3JtUmVzaWR1YWw0eDQKLSAgICAgICAgU1RSSE5FICBEQ3ZhbCxbcERlbHRhXQotICAgICAgICAKLSAgICAgICAgQkwgICAgICBhcm1WQ000UDEwX1RyYW5zZm9ybVJlc2lkdWFsNHg0Ci0gICAgICAgIEIgICAgICAgT3V0RENjYXNlIAotICAgICAgICAKLQotRENjYXNlCi0gICAgICAgIExEUlNIICAgREN2YWwsW3BEQ1RlbXBdIAotICAgICAgICBBREQgICAgIERDdmFsLERDdmFsLCMzMiAKLSAgICAgICAgQVNSICAgICBEQ3ZhbCxEQ3ZhbCwjNgotICAgICAgICBQS0hCVCAgIERDdmFsLERDdmFsLERDdmFsLExTTCAjMTYgICAgICAgICAgICAgICAgICA7Ly8gRHVwbGljYXRpbmcgdGhlIExvd2VyIGhhbGZ3b3JkCi0gICAgICAgIE1PViAgICAgREN2YWxDb3B5LCBEQ3ZhbCAgICAgICAgICAgICAgICAgICAgICAgICAgIDsvLyBOZWVkZWQgZm9yIFNUUkQKLSAgICAgICAgU1RSRCAgICBEQ3ZhbCwgW3BEZWx0YSwgIzBdICAgICAgICAgICAgICAgICAgICAgICAgOy8vIHBEZWx0YVswXSAgPSBwRGVsdGFbMV0gID0gcERlbHRhWzJdICA9IHBEZWx0YVszXSA9IERDdmFsCi0gICAgICAgIFNUUkQgICAgREN2YWwsIFtwRGVsdGEsICM4XSAgICAgICAgICAgICAgICAgICAgICAgIDsvLyBwRGVsdGFbNF0gID0gcERlbHRhWzVdICA9IHBEZWx0YVs2XSAgPSBwRGVsdGFbN10gPSBEQ3ZhbAotICAgICAgICBTVFJEICAgIERDdmFsLCBbcERlbHRhLCAjMTZdICAgICAgICAgICAgICAgICAgICAgICA7Ly8gcERlbHRhWzhdICA9IHBEZWx0YVs5XSAgPSBwRGVsdGFbMTBdID0gcERlbHRhWzExXSA9IERDdmFsCi0gICAgICAgIFNUUkQgICAgREN2YWwsIFtwRGVsdGEsICMyNF0gICAKLSAgICAgICAgCi0gICAgICAgICAgICAgICAKLU91dERDY2FzZSAgICAgIAotICAgICAgICBNX0xEUiAgIHByZWRzdGVwLHByZWRTdGVwT25TdGFjawotICAgICAgICBNX0xEUiAgIGRzdFN0ZXAsZHN0U3RlcE9uU3RhY2sKLSAgICAgICAgCi0gICAgICAgIExETUlBICAgcERlbHRhISx7dG1wRGVsdGFWYWwsRGVsdGFWYWwyfSAgICAgICAgICAgICA7Ly8gUHJlIGxvYWQKLSAgICAgICAgTU9WICAgICB5Y291bnRlciwjNCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDsvLyBDb3VudGVyIGZvciB0aGUgUHJlZFBsdXNEZWx0YUxvb3AKLSAgICAgICAgTERSICAgICBQcmVkVmFsLFtwUHJlZFRlbXBdICAgICAgICAgICAgICAgICAgICAgICAgIDsvLyBQcmUgbG9hZAotCi1QcmVkUGx1c0RlbHRhTG9vcAotICAgICAgICAKLSAgICAgICAKLSAgICAgICAgU1VCUyAgICB5Y291bnRlcix5Y291bnRlciwjMQotICAgICAgICBBREQgICAgIHBQcmVkVGVtcCxwUHJlZFRlbXAscHJlZHN0ZXAgICAgICAgICAgICAgICAgOy8vIEluY3JlbWVudCBwUHJlZCBwdHIKLSAgICAgICAgCi0gICAgICAgIFBLSEJUICAgRGVsdGFWYWwxLHRtcERlbHRhVmFsLERlbHRhVmFsMixMU0wgIzE2ICAgICA7Ly8gRGVsdGF2YWwxID0gW0MgQV0gICAKLSAgICAgICAgUEtIVEIgICBEZWx0YVZhbDIsRGVsdGFWYWwyLHRtcERlbHRhVmFsLEFTUiAjMTYgICAgIDsvLyBEZWx0YVZhbDIgPSBbRCBCXQotICAgICAgICAKLSAgICAgICAgVVhUQjE2ICBQcmVkVmFsMSxQcmVkVmFsICAgICAgICAgICAgICAgICAgICAgICAgICAgIDsvLyBQcmVkVmFsMSA9IFswYzBhXQotICAgICAgICBVWFRCMTYgIFByZWRWYWwyLFByZWRWYWwsUk9SICM4ICAgICAgICAgICAgICAgICAgICAgOy8vIFByZWRWYWwyID0gWzBkMGJdCi0gICAgICAgIAotICAgICAgICBMRFJHVCAgIFByZWRWYWwsW3BQcmVkVGVtcF0gICAgICAgICAgICAgICAgICAgICAgICAgOy8vIFByZSBsb2FkCi0gICAgICAgIAotICAgICAgICBRQUREMTYgIHN1bTIsRGVsdGFWYWwyLFByZWRWYWwyICAgICAgICAgICAgICAgICAgICAgOy8vIEFkZCBhbmQgc2F0dXJhdGUgdG8gMTYgYml0cwotICAgICAgICBRQUREMTYgIHN1bTEsRGVsdGFWYWwxLFByZWRWYWwxCi0gICAgICAgIAotICAgICAgICBVU0FUMTYgIHN1bTIsIzgsc3VtMiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOy8vIGFybUNsaXAoMCwyNTUsc3VtMikKLSAgICAgICAgVVNBVDE2ICBzdW0xLCM4LHN1bTEKLSAgICAgICAgCi0gICAgICAgIExETUdUSUEgICBwRGVsdGEhLHt0bXBEZWx0YVZhbCxEZWx0YVZhbDJ9ICAgICAgICAgICA7Ly8gUHJlIGxvYWQKLSAgICAgICAgICAKLSAgICAgICAgT1JSICAgICBzdW0xLHN1bTEsc3VtMixMU0wgIzggICAgICAgICAgICAgICAgICAgICAgIDsvLyBzdW0xID0gW2RjYmFdCi0gICAgICAgIFNUUiAgICAgc3VtMSxbcERzdFRlbXBdCi0gICAgICAgIAotICAgICAgICBBREQgICAgIHBEc3RUZW1wLHBEc3RUZW1wLGRzdFN0ZXAgICAgICAgICAgICAgICAgICAgOy8vIEluY3JlbWVudCBwRHN0IHB0cgotICAgICAgICBCR1QgICAgIFByZWRQbHVzRGVsdGFMb29wICAKLSAgICAgICAgCi0gICAgICAgIAotICAgICAgICA7Ly8gU2V0IHJldHVybiB2YWx1ZQotICAgICAgICBNT1YgICAgIHJlc3VsdCwjT01YX1N0c19Ob0VycgotICAgICAgICAKLUVuZCAgICAgICAgICAgICAgICAKLQotICAgICAgICAKLSAgICAgICAgOy8vIFdyaXRlIGZ1bmN0aW9uIHRhaWwKLSAgICAgICAgCi0gICAgICAgIE1fRU5ECi0gICAgICAgIAotICAgIEVORElGICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDsvL0FSTTExMzZKUyAgIAotICAgIAotICAgIAotOy8vIEZ1bmN0aW9uOiBvbXhWQ000UDEwX0RlcXVhbnRUcmFuc2Zvcm1SZXNpZHVhbEZyb21QYWlyQW5kQWRkICAgICAgICAgICAgCi0gICAgCi07Ly8gR3VhcmRpbmcgaW1wbGVtZW50YXRpb24gYnkgdGhlIHByb2Nlc3NvciBuYW1lCi0gICAgCi0gICAgCi0gICAgICAgICAKLSAgICAgICAgICAgIAotICAgIEVORApkaWZmIC0tZ2l0IGEvbWVkaWEvbGlic3RhZ2VmcmlnaHQvY29kZWNzL29uMi9oMjY0ZGVjL29teGRsL2FybTExL3ZjL200cDEwL3NyYy9vbXhWQ000UDEwX0ZpbHRlckRlYmxvY2tpbmdDaHJvbWFfSG9yRWRnZV9JX3MucyBiL21lZGlhL2xp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Y0RzdCAgICAgUk4gMAotc3JjZHN0U3RlcCAgUk4gMQotcEFscGhhQXJnICAgUk4gMgotcEJldGFBcmcgICAgUk4gMwotCi1wVGhyZXNob2xkcyBSTiA2Ci1wQlMgICAgICAgICBSTiA5Ci1wUTAgICAgICAgICBSTiAwCi1iUyAgICAgICAgICBSTiAxMAotCi1hbHBoYSAgICAgICBSTiA2Ci1hbHBoYTAgICAgICBSTiA2Ci1hbHBoYTEgICAgICBSTiA4Ci0KLWJldGEgICAgICAgIFJOIDcKLWJldGEwICAgICAgIFJOIDcKLWJldGExICAgICAgIFJOIDkKLQotOy8vIERlY2xhcmUgTG9jYWwvVGVtcG9yYXJ5IHZhcmlhYmxlcwotCi07Ly8gUGl4ZWxzCi1wXzAgICAgICAgICBSTiAzICAKLXBfMSAgICAgICAgIFJOIDUgIAotcV8wICAgICAgICAgUk4gOCAgCi1xXzEgICAgICAgICBSTiA5ICAKLQotOy8vIEZpbHRlcmluZwotCi1kcDBxMCAgICAgICBSTiAxMgotZHAxcDAgICAgICAgUk4gMTIKLWRxMXEwICAgICAgIFJOIDEyCi0KLWFwMHEwICAgICAgIFJOIDQgIAotZmlsdCAgICAgICAgUk4gMgotICAgICAgICAKLW0wMCAgICAgICAgIFJOIDE0Ci1tMDEgICAgICAgICBSTiAxMQotICAgICAgICAgICAgCi1wUTAgICAgICAgICBSTiAwCi1TdGVwICAgICAgICBSTiAxCi0gICAgICAgICAgICAKLTsvLyBPdXRwdXQKLSAgICAgICAgICAgIAotUF8wICAgICAgICAgUk4gNgotUV8wICAgICAgICAgUk4gNyAKLQotOy8vRGVjbGFyYXRpb25zIGZvciBiU0xUNCBrZXJuZWwKLQotdEMgICAgICAgICAgUk4gMTIKLXRDMCAgICAgICAgIFJOIDUKLXRDMSAgICAgICAgIFJOIDEyCi1wb3MgICAgICAgICBSTiA1Ci1uZWcgICAgICAgICBSTiA5Ci0KLTsvL0RlY2xhcmF0aW9ucyBmb3IgYlNHRTQga2VybmVsCi0KLQotOy8vIE1pc2NlbGxhbm91cwotWFkgICAgICAgICAgUk4gOAotCi1hICAgICAgICAgICBSTiAxMAotdDEgICAgICAgICAgUk4gMTAKLXQyICAgICAgICAgIFJOIDEyCi10MyAgICAgICAgICBSTiAxNAotdDQgICAgICAgICAgUk4gNgotdDUgICAgICAgICAgUk4gNQotCi0gICAgICAgIAotICAgICAgICA7Ly8gQWxsb2NhdGUgc3RhY2sgbWVtb3J5IAotICAgICAgICBNX0FMTE9DNCBwcFRocmVzaG9sZHMsNAotICAgICAgICBNX0FMTE9DOCBwQWxwaGFCZXRhMCw4Ci0gICAgICAgIE1fQUxMT0M4IHBBbHBoYUJldGExLDgKLSAgICAgICAgTV9BTExPQzggcFhZQlMsNAotICAgICAgICBNX0FMTE9DNCBwcEJTLDQKLSAgICAgICAgCi0gICAgICAgIDsvLyBGdW5jdGlvbiBoZWFkZXIKLSAgICAgICAgTV9TVEFSVCBvbXhWQ000UDEwX0ZpbHRlckRlYmxvY2tpbmdDaHJvbWFfSG9yRWRnZV9JLCByMTEKLSAgICAgICAgCi0gICAgICAgIDsvL0lucHV0IGFyZ3VtZW50cyBvbiB0aGUgc3RhY2sKLSAgICAgICAgTV9BUkcgICBwcFRocmVzaG9sZHNBcmcsIDQKLSAgICAgICAgTV9BUkcgICBwcEJTQXJnLCA0Ci0gICAgICAgIAotICAgICAgICBMRFJCICAgIGFscGhhMSwgW3BBbHBoYUFyZywjMV0KLSAgICAgICAgTERSQiAgICBiZXRhMSwgIFtwQmV0YUFyZywjMV0KLSAgICAgICAgTV9MRFIgICBwVGhyZXNob2xkcywgcHBUaHJlc2hvbGRzQXJnCi0gICAgICAgIExEUiAgICAgYSw9TUFTS18xCi0gICAgICAgIExEUkIgICAgYmV0YTAsICBbcEJldGFBcmddCi0gICAgICAgIE1fU1RSICAgcFRocmVzaG9sZHMsIHBwVGhyZXNob2xkcwotICAgICAgICBMRFJCICAgIGFscGhhMCwgW3BBbHBoYUFyZ10KLQotICAgICAgICBNVUwg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nAxIHIxcDEgcjBwMV0KLSAgICAgICAgOy8vIHFfMCA9IFtyM3EwIHIycTAgcjFxMCByMHEwXQotICAgICAgICA7Ly8gcV8xID0gW3IzcTEgcjJxMSByMXExIHIwcTFdCi0KLTsvLy0tLS0tLS0tLS0tLS0tRmlsdGVyaW5nIERlY2lzaW9uIC0tLS0tLS0tLS0tLS0tLS0tLS0KLSAgICAgICAgTU9WICAgICBtMDAsICNNQVNLXzAgICAgICAgICAgICAgICAgOy8vICAwMDAwMDAwMCBtYXNrIAotCi0gICAgICAgIE1PViAgICAgZmlsdCwgbTAxCi0gICAgICAgIFRTVCAgICAgYlMsICMweGZmMDAKLSAgICAgICAgTU9WRVEgICBmaWx0LCBmaWx0LCBMU1IgIzE2Ci0gICAgICAgIFRTVCAgICAgYlMsICMweGZmCi0gICAgICAgIE1PVkVRICAgZmlsdCwgZmlsdCwgTFNMICMxNgotICAgICAgICBUU1QgICAgIGJTLCAjNAotCi0gICAgICAgIAotICAgICAgICA7Ly8gQ2hlY2sgfHAwLXEwfDxBbHBoYSAKLSAgICAgICAgVVNVQjggICBkcDBxMCwgcF8wLCBxXzAgCi0gICAgICAgIFVTVUI4ICAgYSwgcV8wLCBwXzAKLSAgICAgICAgU0VMICAgICBhcDBxMCwgYSwgZHAwcTAKLSAgICAgICAgVVNVQjggICBhLCBhcDBxMCwgYWxwaGEKLSAgICAgICAgU0VMICAgICBmaWx0LCBtMDAsIGZpbHQKLSAgICAgICAgICAgICAgICAKLSAgICAgICAgOy8vIENoZWNrIHxwMS1wMHw8QmV0YSAKLSAgICAgICAgVVNVQjggICBkcDFwMCwgcF8xLCBwXzAKLSAgICAgICAgVVNVQjggICBhLCBwXzAsIHBfMQotICAgICAgICBTRUwgICAgIGEsIGEsIGRwMXAwCi0gICAgICAgIFVTVUI4ICAgYSwgYSwgYmV0YQotICAgICAgICBTRUwgICAgIGZpbHQsIG0wMCwgZmlsdAotCi0gICAgICAgIDsvLyBDaGVjayB8cTEtcTB8PEJldGEgCi0gICAgICAgIFVTVUI4ICAgZHExcTAsIHFfMSwgcV8wCi0gICAgICAgIFVTVUI4ICAgYSwgcV8wLCBxXzEKLSAgICAgICAgU0VMICAgICBhLCBhLCBkcTFxMAotICAgICAgICBVU1VCOCAgIGEsIGEsIGJldGEKLSAgICAgICAgU0VMICAgICBmaWx0LCBtMDAsIGZpbHQKLQotICAgICAgICBCRVEgICAgIGJTTFQ0ICAgICAgICAKLTsvLy0tLS0tLS0tLS0tLS0tLS0tLS1GaWx0ZXItLS0tLS0tLS0tLS0tLS0tLS0tLQotYlNHRTQgICAgICAgIAotICAgICAgICA7Ly8tLS0tLS0tLS1iU0dFNCBFeGVjdXRpb24tLS0tLS0tLS0tLS0tLS0KLSAgICAgICAgQ01QICAgICBmaWx0LCAjMAotCi0gICAgICAgIE1fTERSICAgcFRocmVzaG9sZHMsIHBwVGhyZXNob2xkcwotCi0gICAgICAgIDsvLyBDb21wdXRlIFAwYgotICAgICAgICBVSEFERDggIHQxLCBwXzAsIHFfMQotICAgICAgICBCRVEgICAgIE5vRmlsdGVyRmlsdDAKLSAgICAgICAgTVZOICAgICB0MiwgcF8xCi0gICAgICAgIFVIU1VCOCAgdDEsIHQxLCB0MgotICAgICAgICBVU1VCOCAgIHQyLCBmaWx0LCBtMDEKLSAgICAgICAgRU9SICAgICB0MSwgdDEsIG0wMSwgTFNMICM3Ci0KLSAgICAgICAgQUREICAgICBwVGhyZXNob2xkcyxwVGhyZXNob2xkcywgIzIKLSAgICAgICAgCi0gICAgICAgIDsvLyBDb21wdXRlIFEwYiAKLSAgICAgICAgVUhBREQ4ICB0MiwgcV8wLCBwXzEKLSAgICAgICAgTVZOICAgICB0MywgcV8xCi0gICAgICAgIFVIU1VCOCAgdDIsIHQyLCB0MwotICAgICAgICBNX1NUUiAgIHBUaHJlc2hvbGRzLCBwcFRocmVzaG9sZHMKLSAgICAgICAgU0VMICAgICBQXzAsIHQxLCBwXzAKLSAgICAgICAgRU9SICAgICB0MiwgdDI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IHBUaHJlc2hvbGRzLCBwcFRocmVzaG9sZHMKLSAgICAgICAgQ01QICAgICBmaWx0LCAjMAotICAgICAgICAKLSAgICAgICAgOy8vIFNpbmNlIGJldGEgPD0gMTggYW5kIGFscGhhIDw9IDI1NSB3ZSBrbm93Ci0gICAgICAgIDsvLyAtMjU0IDw9IHAwLXEwIDw9IDI1NAotICAgICAgICA7Ly8gIC0xNyA8PSBxMS1xMCA8PSAxNwotICAgICAgICA7Ly8gIC0xNyA8PSBwMS1wMCA8PSAxNwotCi0gICAgICAgIDsvLyBkZWx0YSA9IENsaXAzKCAtdEMsIHRDLCAoKCgocTAtcDApPDwyKSArIChwMS1xMSkgKyA0KT4+MykpCi0gICAgICAgIDsvLyAKLSAgICAgICAgOy8vICAgIENhbGN1bGF0ZSBBID0gKCgocTAtcDApPDwyKSArIChwMS1xMSkgKyA0KT4+MwotICAgICAgICA7Ly8gICAgICAgICAgICAgICAgPSAoNCpxMCAtIDQqcDAgKyBwMSAtIHExICsgNCk+PjMKLSAgICAgICAgOy8vICAgICAgICAgICAgICAgID0gKChwMS1wMCkgLSAocTEtcTApIC0gMyoocDAtcTApICsgNCk+PjMKLQotICAgICAgICBVU1VCOCAgIHQxLCBwXzEsIHBfMAotICAgICAgICBVU1VCOCAgIHQyLCBxXzEsIHFfMAotICAgICAgICBCRVEgICAgIE5vRmlsdGVyRmlsdDAKLSAgICAgICAgCi0gICAgICAgIExEUkIgICAgdEMwLCBbcFRocmVzaG9sZHNdLCMxCi0gICAgICAgIFNTVUI4ICAgdDEsIHQxLCB0MgotICAgICAgICBMRFJCICAgIHRDMSwgW3BUaHJlc2hvbGRzXSwjMQotICAgICAgICBNX1NUUiAgIHBUaHJlc2hvbGRzLCBwcFRocmVzaG9sZHMKLSAgICAgICAgVUhTVUI4ICB0NCwgcF8wLCBxXzAKLSAgICAgICAgT1JSICAgICB0QywgdEMwLCB0QzEsIExTTCAjMTYKLSAgICAgICAgVVNVQjggICB0NSwgcF8wLCBxXzAKLSAgICAgICAgQU5EICAgICB0NSwgdDUsIG0wMQotICAgICAgICBTSFNVQjggIHQxLCB0MSwgdDUKLSAgICAgICAgT1JSICAgICB0QywgdEMsIExTTCAjOCAgICAgICAgCi0gICAgICAgIFNTVUI4ICAgdDEsIHQxLCB0NQotICAgICAgICBTSFNVQjggIHQxLCB0MSwgdDQKLSAgICAgICAgVVFBREQ4ICB0QywgdEMsIG0wMQotICAgICAgICBTQUREOCAgIHQxLCB0MSwgbTAxCi0gICAgICAgIFVTVUI4ICAgdDUsIGZpbHQsIG0wMSAgIAotICAgICAgICBTSFNVQjggIHQxLCB0MSwgdDQKLSAgICAgICAgU0VMICAgICB0QywgdEMsIG0wMAotCi0gICAgICAgIDsvLyBTcGxpdCBpbnRvIHBvc2l0aXZlIGFuZCBuZWdhdGl2ZSBwYXJ0IGFuZCBjbGlwIAotCi0gICAgICAgIFNTVUI4ICAgdDEsIHQxLCBtMDAKLSAgICAgICAgU0VMICAgICBwb3MsIHQxLCBtMDAKLSAgICAgICAgVVNVQjggICBuZWcsIHBvcywgdDEKLSAgICAgICAgVVNVQjggICB0MywgcG9zLCB0QwotICAgICAgICBTRUwgICAgIHBvcywgdEMsIHBvcwotICAgICAgICBVU1VCOCAgIHQzLCBuZWcsIHRDCi0gICAgICAgIFNFTCAgICAgbmVnLCB0QywgbmVnCi0gICAgICAgIFVRQUREOCAgUF8wLCBwXzAsIHBvcwotICAgICAgICBVUVNVQjggIFFfMCwgcV8wLCBwb3MKLSAgICAgICAgVVFTVUI4ICBQXzAsIFBfMCwgbmVnCi0gICAgICAgIFVRQUREOCAgUV8wLCBRXzAsIG5lZwotICAgICAgICAKLSAgICAgICAgU1VCICAgICBwUTAsIHBRMCwgc3JjZHN0U3RlcCwgTFNMICMxCi0KLSAgICAgICAgOy8vIENob29zZSB0byBzdG9yZSB0aGUgZmlsdGVyZWQKLSAgICAgICAgOy8vIHZhbHVlIG9yIHRoZSBvcmlnaW5hbCBwaXhlbAotICAgICAgICBVU1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gICAgICAgUk4gNQotcm93MyAgICAgICAgUk4gMwotCi1yb3c0ICAgICAgICBSTiA4Ci1yb3c1ICAgICAgICBSTiA5Ci1yb3c2ICAgICAgICBSTiAxMAotcm93NyAgICAgICAgUk4gMTIKLQotdHVucGswICAgICAgUk4gMgotdHVucGsyICAgICAgUk4gMTAKLXR1bnBrMyAgICAgIFJOIDEyCi0KLXR1bnBrNCAgICAgIFJOIDQKLXR1bnBrNSAgICAgIFJOIDUKLXR1bnBrNiAgICAgIFJOIDE0Ci10dW5wazcgICAgICBSTiAyIAotCi07Ly8gRmlsdGVyaW5nCi0KLWRwMHEwICAgICAgIFJOIDEyCi1kcDFwMCAgICAgICBSTiAxMgotZHExcTAgICAgICAgUk4gMTIKLQotYXAwcTAgICAgICAgUk4gNCAgCi1maWx0ICAgICAgICBSTiAyCi0gICAgICAgIAotbTAwICAgICAgICAgUk4gMTQKLW0wMSAgICAgICAgIFJOIDExCi0gICAgICAgICAgICAKLXBRMCAgICAgICAgIFJOIDAKLVN0ZXAgICAgICAgIFJOIDEKLSAgICAgICAgICAgIAotOy8vIE91dHB1dAotICAgICAgICAgICAgCi1QXzAgICAgICAgICBSTiA2Ci1RXzAgICAgICAgICBSTiA3IAotCi07Ly9EZWNsYXJhdGlvbnMgZm9yIGJTTFQ0IGtlcm5lbAotCi10QyAgICAgICAgICBSTiAxMgotdEMwICAgICAgICAgUk4gNQotdEMxICAgICAgICAgUk4gMTIKLXBvcyAgICAgICAgIFJOIDUKLW5lZyAgICAgICAgIFJOIDkKLQotOy8vRGVjbGFyYXRpb25zIGZvciBiU0dFNCBrZXJuZWwKLQotCi07Ly8gTWlzY2VsbGFub3VzCi1YWSAgICAgICAgICBSTiA4Ci0KLWEgICAgICAgICAgIFJOIDEwCi10MSAgICAgICAgICBSTiAxMAotdDIgICAgICAgICAgUk4gMTIKLXQzICAgICAgICAgIFJOIDE0Ci10NCAgICAgICAgICBSTiA2Ci10NSAgICAgICAgICBSTiA1Ci0KLQotICAgICAgICA7Ly8gQWxsb2NhdGUgc3RhY2sgbWVtb3J5IAotICAgICAgICBNX0FMTE9DNCBwcFRocmVzaG9sZHMsNAotICAgICAgICBNX0FMTE9DOCBwQWxwaGFCZXRhMCw4Ci0gICAgICAgIE1fQUxMT0M4IHBBbHBoYUJldGExLDgKLSAgICAgICAgTV9BTExPQzggcFhZQlMsNAotICAgICAgICBNX0FMTE9DNCBwcEJTLDQKLSAgICAgICAgCi0gICAgICAgIDsvLyBGdW5jdGlvbiBoZWFkZXIKLSAgICAgICAgTV9TVEFSVCBvbXhWQ000UDEwX0ZpbHRlckRlYmxvY2tpbmdDaHJvbWFfVmVyRWRnZV9JLCByMTEKLSAgICAgICAgCi0gICAgICAgIDsvL0lucHV0IGFyZ3VtZW50cyBvbiB0aGUgc3RhY2sKLSAgICAgICAgTV9BUkcgICBwcFRocmVzaG9sZHNBcmcsIDQKLSAgICAgICAgTV9BUkcgICBwcEJTQXJnLCA0Ci0gICAgICAgIAotICAgICAgICBMRFJCICAgIGFscGhhMSwgW3BBbHBoYUFyZywjMV0KLSAgICAgICAgTERSQiAgICBiZXRhMSwgIFtwQmV0YUFyZywjMV0KLSAgICAgICAgTV9MRFIgICBwVGhyZXNob2xkcywgcHBUaHJlc2hvbGRzQXJnCi0gICAgICAgIExEUiAgICAgYSw9TUFTS18xCi0gICAgICAgIExEUkIgICAgYmV0YTAsICBbcEJldGFBcmddCi0gICAgICAgIE1fU1RSICAgcFRocmVzaG9sZHMsIHBwVGhyZXNob2xkcwotICAgICAgICBMRFJCICAgIGFscGhhMCwgW3BBbHBoYUFyZ10KLQotICAgICAgICBNVUwgICAgIGFscGhhMSwgYWxwaGExLCBhCi0gICAgICAgIE1VTCAgICAgYmV0YTEsIGJldGExLCBhCi0gICAgICAgIE1VTCAgICAgYWxwaGEwLCBhbHBoYTAsIGEKLSAgICAgICAgTVVMICAgICBiZXRhMCwgYmV0YTAsIGEKLQotICAgICAgICBNX1NUUkQgIGFscGhhMSwgYmV0YTE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wazQsIHR1bnBrNCwgcm93NSwgUk9SIzgKLSAgICAgICAgVVhUQUIgICB0dW5wazUsIHR1bnBrNSwgcm93NQotICAgICAgICBBTkQgICAgIHR1bnBrNiwgbWFzaywgcm93NgotICAgICAgICBBTkQgICAgIHR1bnBrNywgbWFzaywgcm93NiwgTFNMIzgKLSAgICAgICAgVVhUQUIgICB0dW5wazYsIHR1bnBrNiwgcm93NywgUk9SIzgKLSAgICAgICAgVVhUQUIgICB0dW5wazcsIHR1bnBrNywgcm93NwotCi0gICAgICAgIDsvLyB0dW5wazQgPSBbMCAwIHIwcTAgcjFxMF0KLSAgICAgICAgOy8vIHR1bnBrNSA9IFswIDAgcjBxMSByMXExXQotICAgICAgICA7Ly8gdHVucGs2ID0gWzAgMCByMnEwIHIzcTBdCi0gICAgICAgIDsvLyB0dW5wazcgPSBbMCAwIHIycTEgcjNxMV0KLQotICAgICAgICBTVUIgICAgIHBRMCwgcFEwLCBzcmNkc3RTdGVwLCBMU0wgIzEKLSAgICAgICAgU1VCICAgICBwUTAsIHBRMCwgIzIKLQotICAgICAgICBQS0hCVCAgIHFfMSwgdHVucGs2LCB0dW5wazQsIExTTCMxNgotICAgICAgICBQS0hCVCAgIHFfMCwgdHVucGs3LCB0dW5wazUsIExTTCMxNgotCi0gICAgICAgIDsvLyBxXzAgPSBbcjBxMCByMXEwIHIycTAgcjNxMF0KLSAgICAgICAgOy8vIHFfMSA9IFtyMHExIHIxcTEgcjJxMSByM3ExXQotCi0KLTsvLy0tLS0tLS0tLS0tLS0tLS1QYWNrIHAwLXAxLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0KLQotICAgICAgICBNX0xEUkggIHJvdzAsIFtwUTBdLCBzcmNkc3RTdGVwICAgICAgICAgIAotICAgICAgICBNX0xEUkggIHJvdzEsIFtwUTBdLCBzcmNkc3RTdGVwICAgICAgICAgIAotICAgICAgICBMRFJIICAgIHJvdzIsIFtwUTBdCi0gICAgICAgIExEUkggICAgcm93MywgW3BRMCwgc3JjZHN0U3RlcF0KLSAgICAgICAgCi0gICAgICAgIDsvLyByb3cwID0gWzAgMCByMHAwIHIwcDFdCi0gICAgICAgIDsvLyByb3cxID0gWzAgMCByMXAwIHIxcDFdCi0gICAgICAgIDsvLyByb3cyID0gWzAgMCByMnAwIHIycDFdCi0gICAgICAgIDsvLyByb3czID0gWzAgMCByM3AwIHIzcDFdCi0KLSAgICAgICAgQU5EICAgICB0dW5wazIsIG1hc2ssIHJvdzAKLSAgICAgICAgQU5EICAgICB0dW5wazYsIG1hc2ssIHJvdzAsIExTTCM4Ci0gICAgICAgIFVYVEFCICAgdHVucGsyLCB0dW5wazIsIHJvdzEsIFJPUiM4Ci0gICAgICAgIFVYVEFCICAgdHVucGs2LCB0dW5wazYsIHJvdzEKLQotICAgICAgICBBTkQgICAgIHR1bnBrMCwgbWFzaywgcm93MgotICAgICAgICBBTkQgICAgIHR1bnBrMywgbWFzaywgcm93MiwgTFNMIzgKLSAgICAgICAgVVhUQUIgICB0dW5wazAsIHR1bnBrMCwgcm93MywgUk9SIzgKLSAgICAgICAgVVhUQUIgICB0dW5wazMsIHR1bnBrMywgcm93MwotCi0gICAgICAgIDsvLyB0dW5wazIgPSBbMCAwIHIwcDAgcjFwMF0KLSAgICAgICAgOy8vIHR1bnBrNiA9IFswIDAgcjBwMSByMXAxXQotICAgICAgICA7Ly8gdHVucGswID0gWzAgMCByMnAwIHIzcDBdCi0gICAgICAgIDsvLyB0dW5wazMgPSBbMCAwIHIycDEgcjNwMV0KLQotICAgICAgICBQS0hCVCAgIHBfMCwgdHVucGswLCB0dW5wazIsIExTTCMxNgotICAgICAgICBNX0xEUiAgIGJTVGVtcCwgcHBCUwotICAgICAgICBQS0hCVCAgIHBfMSwgdHVucGszLCB0dW5wazYsIExTTCMxNgotCi0gICAgICAgIDsvLyBwXzAgPSBbcjBwMCByMXAwIHIycDAgcjNwMF0KLSAgICAgICAgOy8vIHBfMSA9IFtyMHAxIHIxcDEgcjJwMSByM3AxXQotCi07Ly8tLS0tLS0tLS0tLS0tLUZpbHRlcmluZyBEZWNpc2lvbiAtLS0tLS0tLS0tLS0tLS0tLS0tCi0gICAgICAgIFVTVUI4ICAgZHAwcTAsIHBfMCwgcV8wIAotICAgICAgICBMRFIgICAgIG0wMSwgPU1BU0tfMQotICAgICAgICBMRFJIICAgIGJTVGVtcCwgW2JTVGVtcCAsIy04XQotICAgICAgICBNT1YgICAgIG0wMCwgI01BU0tfMCAgICAgICAgICAgICAgICA7Ly8gIDAwMDAwMDAwIG1hc2sgCi0gICAgICAgIAotICAgICAgICBNT1YgICAgIGZpbHQsIG0wMQotICAgICAgICBUU1QgICAgIGJTVGVtcCwgIzB4ZmYwMAotICAgICAgICBNT1ZFUSAgIGZpbHQsIGZpbHQsIExTTCAjMTYKLSAgICAgICAgVFNUICAgICBiU1RlbXAsICMweGZmCi0gICAgICAgIE1PVkVRICAgZmlsdCwgZmlsdCwgTFNSICMxNgotICAgICAgICBUU1QgICAgIGJTVGVtcCwgIzQKLQotICAgICAgICA7Ly8gQ2hlY2sgfHAwLXEwfDxBbHBoYSAKLSAgICAgICAgVVNVQjggICBhLCBxXzAsIHBfMAotICAgICAgICBTRUwgICAgIGFwMHEwLCBhLCBkcDBxMAotICAgICAgICBVU1VCOCAgIGEsIGFwMHEwLCBhbHBoYQotICAgICAgICBTRUwgICAgIGZpbHQsIG0wMCwgZmlsdAotICAgICAgICAKLSAgICAgICAgOy8vIENoZWNrIHxwMS1wMHw8QmV0YSAKLSAgICAgICAgVVNVQjggICBkcDFwMCwgcF8xLCBwXzAKLSAgICAgICAgVVNVQjggICBhLCBwXzAsIHBfMQotICAgICAgICBTRUwgICAgIGEsIGEsIGRwMXAwCi0gICAgICAgIFVTVUI4ICAgYSwgYSwgYmV0YQotICAgICAgICBTRUwgICAgIGZpbHQsIG0wMCwgZmlsdAotCi0gICAgICAgIDsvLyBDaGVjayB8cTEtcTB8PEJldGEgCi0gICAgICAgIFVTVUI4ICAgZHExcTAsIHFfMSwgcV8wCi0gICAgICAgIFVTVUI4ICAgYSwgcV8wLCBxXzEKLSAgICAgICAgU0VMICAgICBhLCBhLCBkcTFxMAotICAgICAgICBVU1VCOCAgIGEsIGEsIGJldGEKLSAgICAgICAgU0VMICAgICBmaWx0LCBtMDAsIGZpbHQKLQotICAgICAgICBCRVEgICAgIGJTTFQ0ICAgICAgICAKLTsvLy0tLS0tLS0tLS0tLS0tLS0tLS1GaWx0ZXItLS0tLS0tLS0tLS0tLS0tLS0tLQotYlNHRTQgICAgICAgIAotICAgICAgICA7Ly8tLS0tLS0tLS1iU0dFNCBFeGVjdXRpb24tLS0tLS0tLS0tLS0tLS0KLSAgICAgICAgQ01QICAgICBmaWx0LCAjMAotCi0gICAgICAgIE1fTERSICAgcFRocmVzaG9sZHMsIHBwVGhyZXNob2xkcwotCi0gICAgICAgIDsvLyBDb21wdXRlIFAwYgotICAgICAgICBVSEFERDggIHQxLCBwXzAsIHFfMQotICAgICAgICBCRVEgICAgIE5vRmlsdGVyRmlsdDAKLSAgICAgICAgTVZOICAgICB0MiwgcF8xCi0gICAgICAgIFVIU1VCOCAgdDEsIHQxLCB0MgotICAgICAgICBVU1VCOCAgIHQyLCBmaWx0LCBtMDEKLSAgICAgICAgRU9SICAgICB0MSwgdDEsIG0wMSwgTFNMICM3Ci0KLSAgICAgICAgQUREICAgICBwVGhyZXNob2xkcyxwVGhyZXNob2xkcywgIzQKLSAgICAgICAgCi0gICAgICAgIDsvLyBDb21wdXRlIFEwYiAKLSAgICAgICAgVUhBREQ4ICB0MiwgcV8wLCBwXzEKLSAgICAgICAgTVZOICAgICB0MywgcV8xCi0gICAgICAgIFVIU1VCOCAgdDIsIHQyLCB0MwotICAgICAgICBNX1NUUiAgIHBUaHJlc2hvbGRzLCBwcFRocmVzaG9sZHMKLSAgICAgICAgU0VMICAgICBQXzAsIHQxLCBwXzAKLSAgICAgICAgRU9SICAgICB0MiwgdDIsIG0wMSwgTFNMICM3Ci0gICAgICAgIFNFTCAgICAgU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wgIzEKLSAgICAgICAgQUREICAgICBwUTAsIHBRMCwgIzQKLQotICAgICAgICBBRERTICAgIFhZLCBYWSwgWFkKLSAgICAgICAgTV9TVFIgICBYWSwgcFhZQlMKLSAgICAgICAgQkNDICAgICBMb29wWAotCi07Ly8tLS0tLS0tLSBDb21tb24gRXhpdCBvZiBMb29wWSAtLS0tLS0tLS0tLS0tLS0tLQotICAgICAgICA7Ly8gQWxpZ24gdGhlIHBvaW50ZXJzIAotCi1FeGl0TG9vcFkKLQotICAgICAgICBNX0xEUiAgIHBUaHJlc2hvbGRzLCBwcFRocmVzaG9sZHMKLSAgICAgICAgU1VCICAgICBwUTAsIHBRMCwgIzgKLSAgICAgICAgQUREICAgICBwUTAsIHBRMCwgc3JjZHN0U3RlcCwgTFNMICMyCi0gICAgICAgIFNVQiAgICAgcEJTLCBwQlMsICMxNCAKLSAgICAgICAgU1VCICAgICBwVGhyZXNob2xkcywgcFRocmVzaG9sZHMsICM2Ci0gICAgICAgIE1fU1RSICAgcFRocmVzaG9sZHMsIHBwVGhyZXNob2xkcwotCi0gICAgICAgIE1fTERSRCAgYWxwaGEsIGJldGEsIHBBbHBoYUJldGEwCi0KLSAgICAgICAgQk5FICAgICBMb29wWQotICAgICAgICBNT1YgICAgIHIwLCAjT01YX1N0c19Ob0VycgotOy8vLS0tLS0tLS0tLS0tLS0tLS1FbmQgRmlsdGVyLS0tLS0tLS0tLS0tLS0tLS0tLS0KLQotICAgICAgICBNX0VORAotCi0gICAgICAgIEVORElGICAgICAgICAKLQotICAgICAgICBFTkQKLSAgICAgICAgCi0gICAgICAgIApkaWZmIC0tZ2l0IGEvbWVkaWEvbGlic3RhZ2VmcmlnaHQvY29kZWNzL29uMi9oMjY0ZGVjL29teGRsL2FybTExL3ZjL200cDEwL3NyYy9vbXhWQ000UDEwX0ZpbHRlckRlYmxvY2tpbmdMdW1hX0hvckVkZ2VfSV9zLnMgYi9tZWRpYS9saWJzdGFnZWZyaWdodC9jb2RlY3Mvb24yL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gICAgICBSTiAwCi0gICAgICAgICAgICAKLQotOy8vRGVjbGFyYXRpb25zIGZvciBiU0xUNCBrZXJuZWwKLQotdEMwICAgICAgICAgUk4gNwotcHRDMCAgICAgICAgUk4gMQotCi1wUTBhICAgICAgICBSTiAwICAgIAotU3RlcGEgICAgICAgUk4gMSAgICAKLW1hc2thICAgICAgIFJOIDE0Ci0gICAgICAgICAgICAKLVAwYSAgICAgICAgIFJOIDEKLVAxYSAgICAgICAgIFJOIDgKLVEwYSAgICAgICAgIFJOIDcKLVExYSAgICAgICAgIFJOIDExCi0gICAgICAgICAgICAKLTsvL0RlY2xhcmF0aW9ucyBmb3IgYlNHRTQga2VybmVsCi0KLXBRMGIgICAgICAgIFJOIDAKLVN0ZXBiICAgICAgIFJOIDEKLW1hc2tiICAgICAgIFJOIDE0Ci0gICAgICAgICAgICAKLVAwYiAgICAgICAgIFJOIDYKLVAxYiAgICAgICAgIFJOIDcKLVAyYiAgICAgICAgIFJOIDEKLVAzYiAgICAgICAgIFJOIDMKLSAgICAgICAgICAgIAotUTBiICAgICAgICAgUk4gOSAKLVExYiAgICAgICAgIFJOIDAgICAKLVEyYiAgICAgICAgIFJOIDIgCi1RM2IgICAgICAgICBSTiAzIAotCi07Ly8gTWlzY2VsbGFub3VzCi1YWSAgICAgICAgICBSTiA4Ci10MCAgICAgICAgICBSTiAzIAotdDEgICAgICAgICAgUk4gMTIKLXQyICAgICAgICAgIFJOIDE0Ci10NyAgICAgICAgICBSTiA3Ci10NCAgICAgICAgICBSTiA0Ci10NSAgICAgICAgICBSTiAxICAKLXQ4ICAgICAgICAgIFJOIDYgIAotYSAgICAgICAgICAgUk4gMAotCi0gICAgICAgICAgICAKLQotICAgICAgICAKLSAgICAgICAgOy8vIEFsbG9jYXRlIHN0YWNrIG1lbW9yeSAKLSAgICAgICAgTV9BTExPQzQgcHBUaHJlc2hvbGRzLDQKLSAgICAgICAgTV9BTExPQzQgcFFfMyw0Ci0gICAgICAgIE1fQUxMT0M0IH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cFFfMwotCi07Ly8tLS0tLS0tLS0tLS0tLUZpbHRlcmluZyBEZWNpc2lvbiAtLS0tLS0tLS0tLS0tLS0tLS0tCi0gICAgICAgIExEUiAgICAgbTAxLCA9TUFTS18xICAgICAgICAgICAgICAgIDsvLyAgMDEwMTAxMDEgbWFzayAKLSAgICAgICAgTU9WICAgICBtMDAsICNNQVNLXzAgICAgICAgICAgICAgICAgOy8vICAwMDAwMDAwMCBtYXNrIAotCi0gICAgICAgIDsvLyBDaGVjayB8cDAtcTB8PEFscGhhIAotICAgICAgICBVU1VCOCAgIGRwMHEwLCBwXzAsIHFfMCAKLSAgICAgICAgVVNVQjggICBhLCBxXzAsIHBfMAotICAgICAgICBTRUwgICAgIGFwMHEwLCBhLCBkcDBxMAotICAgICAgICBVU1VCOCAgIGEsIGFwMHEwLCBhbHBoYQotICAgICAgICBTRUwgICAgIGZpbHQsIG0wMCwgbTAxCi0gICAgICAgIAotICAgICAgICA7Ly8gQ2hlY2sgfHAxLXAwfDxCZXRhIAotICAgICAgICBVU1VCOCAgIGRwMXAwLCBwXzEsIHBfMAotICAgICAgICBVU1VCOCAgIGEsIHBfMCwgcF8xCi0gICAgICAgIFNFTCAgICAgYSwgYSwgZHAxcDAKLSAgICAgICAgVVNVQjggICBhLCBhLCBiZXRhCi0gICAgICAgIFNFTCAgICAgZmlsdCwgbTAwLCBmaWx0Ci0KLSAgICAgICAgOy8vIENoZWNrIHxxMS1xMHw8QmV0YSAKLSAgICAgICAgVVNVQjggICBkcTFxMCwgcV8xLCBxXzAKLSAgICAgICAgVVNVQjggICBhLCBxXzAsIHFfMQotICAgICAgICBTRUwgICAgIGEsIGEsIGRxMXEwCi0gICAgICAgIFVTVUI4ICAgYSwgYSwgYmV0YQotICAgICAgICBTRUwgICAgIGZpbHQsIG0wMCwgZmlsdAotCi0gICAgICAgIDsvLyBDaGVjayBhcDxCZXRhIAotICAgICAgICBVU1VCOCAgIGRwMnAwLCBwXzIsIHBfMAotICAgICAgICBVU1V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LSAgICAgICAgOy8vLS0tLS0tLS0tU3RvcmUgcmVzdWx0LS0tLS0tLS0tLS0tLS0tCi0gICAgICAgIE1PViAgICAgcF8yLCBQMGEKLSAgICAgICAgTV9MRFJEICBwUTBhLCBTdGVwYSwgcHBRMFN0ZXAKLSAgICAgICAgTV9TVFIgICBQMWEsIFtwUTBhLCBTdGVwYSwgTFNMICMxXSEKLSAgICAgICAgTV9TVFIgICBwXzIsIFtwUTBhLCBTdGVwYV0hCi0gICAgICAgIE1fU1RSICAgUTBhLCBbcFEwYSwgU3RlcGFdIQotICAgICAgICBTVFIgICAgIFExYSwgW3BRMGEsIFN0ZXBhXQotICAgICAgIAotICAgICAgICA7Ly8gTG9hZCBjb3VudGVyCi0gICAgICAgIE1fTERSRCAgWFksIHBCUywgcFhZQlMKLSAgICAgICAgTV9MRFJEICBhbHBoYSwgYmV0YSwgcEFscGhhQmV0YTAKLQotICAgICAgICBTVUIgICAgIHBRMCwgcFEwYSwgU3RlcGEsIExTTCAjMgotICAgICAgICBBREQgICAgIHBRMCwgcFEwLCAjNAotCi0gICAgICAgIEFERFMgICAgWFksIFhZLCBYWQotICAgICAgICBNX1NUUiAgIFhZLCBwWFlCUwotICAgICAgICBCQ0MgICAgIExvb3BYCi0gICAgICAgIAotOy8vLS0tLS0tLS0gQ29tbW9uIEV4aXQgb2YgTG9vcFkgLS0tLS0tLS0tLS0tLS0tLS0KLSAgICAgICAgOy8vIEFsaWduIHRoZSBwb2ludGVycyAKLUV4aXRMb29wWQotICAgICAgICBNX0xEUkQgIGFscGhhLCBiZXRhLCBwQWxwaGFCZXRhMQotICAgICAgICBTVUIgICAgIHBRMCwgcFEwLCAjMTYKLSAgICAgICAgQUREICAgICBwUTAsIHBRMCwgc3JjZHN0U3RlcCwgTFNMICMyCi0gICAgICAgIE1fU1RSRCAgYWxwaGEsIGJldGEsIHBBbHBoYUJldGEwCi0KLSAgICAgICAgQk5FICAgICBMb29wWQotICAgICAgICBNT1YgICAgIHIwLCAjT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1xXzAgICAgICAgICBSTiA4ICAKLXFfMSAgICAgICAgIFJOIDkgIAotcV8yICAgICAgICAgUk4gMTAgCi1xXzMgICAgICAgICBSTiAxMiAKLQotOy8vIFVucGFja2luZwotbWFzayAgICAgICAgUk4gMTEgCi0KLXJvdzAgICAgICAgIFJOIDIKLXJvdzEgICAgICAgIFJOIDQKLXJvdzIgICAgICAgIFJOIDUKLXJvdzMgICAgICAgIFJOIDMKLQotcm93NCAgICAgICAgUk4gOAotcm93NSAgICAgICAgUk4gOQotcm93NiAgICAgICAgUk4gMTAKLXJvdzcgICAgICAgIFJOIDEyCi1yb3c4ICAgICAgICBSTiAxNAotcm93OSAgICAgICAgUk4gNwotICAgICAgICAgICAgCi10dW5wazAgICAgICBSTiA4Ci10dW5wazEgICAgICBSTiA5Ci10dW5wazIgICAgICBSTiAxMAotdHVucGszICAgICAgUk4gMTIKLXR1bnBrNCAgICAgIFJOIDAKLQotdHVucGs1ICAgICAgUk4gMQotdHVucGs2ICAgICAgUk4gMTQKLXR1bnBrNyAgICAgIFJOIDIgCi10dW5wazggICAgICBSTiA1IAotdHVucGs5ICAgICAgUk4gNiAKLSAKLQotOy8vIEZpbHRlcmluZwotCi1kcDBxMCAgICAgICBSTiAxMgotZHAxcDAgICAgICAgUk4gMTIKLWRxMXEwICAgICAgIFJOIDEyCi1kcDJwMCAgICAgICBSTiAxMgotZHEycTAgICAgICAgUk4gMTIKLSAgICAgICAgICAgIAotYXAwcTAgICAgICAgUk4gMSAgCi1maWx0ICAgICAgICBSTiAyCi0gICAgICAgIAotbTAwICAgICAgICAgUk4gMTQKLW0wMSAgICAgICAgIFJOIDExCi0gICAgICAgICAgICAKLWFwZmxnICAgICAgIFJOIDAgCi1hcWZsZyAgICAgICBSTiA2Ci1hcHFmbGcgICAgICBSTiAwCi0gICAgICAgICAgICAKLQotOy8vRGVjbGFyYXRpb25zIGZvciBiU0xUNCBrZXJuZWwKLQotdEMwICAgICAgICAgUk4gNwotcHRDMCAgICAgICAgUk4gMQotCi1wUTBhICAgICAgICBSTiAwICAgIAotU3RlcGEgICAgICAgUk4gMSAgICAKLW1hc2thICAgICAgIFJOIDE0Ci0gICAgICAgICAgICAKLVAwYSAgICAgICAgIFJOIDEKLVAxYSAgICAgICAgIFJOIDgKLVEwYSAgICAgICAgIFJOIDcKLVExYSAgICAgICAgIFJOIDExCi0gICAgICAgICAgICAKLTsvL0RlY2xhcmF0aW9ucyBmb3IgYlNHRTQga2VybmVsCi0KLXBRMGIgICAgICAgIFJOIDAKLVN0ZXBiICAgICAgIFJOIDEKLW1hc2tiICAgICAgIFJOIDE0Ci0gICAgICAgICAgICAKLVAwYiAgICAgICAgIFJOIDYKLVAxYiAgICAgICAgIFJOIDcKLVAyYiAgICAgICAgIFJOIDEKLVAzYiAgICAgICAgIFJOIDMKLSAgICAgICAgICAgIAotUTBiICAgICAgICAgUk4gOSAKLVExYiAgICAgICAgIFJOIDAgICAKLVEyYiAgICAgICAgIFJOIDIgCi1RM2IgICAgICAgICBSTiAzIAotCi07Ly8gTWlzY2VsbGFub3VzCi1YWSAgICAgICAgICBSTiA4Ci10MCAgICAgICAgICBSTiAzIAotdDEgICAgICAgICAgUk4gMTIKLXQyICAgICAgICAgIFJOIDE0Ci10NyAgICAgICAgICBSTiA3Ci10NCAgICAgICAgICBSTiA0Ci10NSAgICAgICAgICBSTiAxICAKLXQ4ICAgICAgICAgIFJOIDYgIAotYSAgICAgICAgICAgUk4gMAotCi0gICAgICAgICAgICAKLQotICAgICAgICA7Ly8gQWxsb2NhdGUgc3RhY2sgbWVtb3J5IAotICAgICAgICBNX0FMTE9DNCBwcFRocmVzaG9sZHMsNAotICAgICAgICBNX0FMTE9DNCBwUV8zLDQKLSAgICAgICAgTV9BTExPQzQgcFBfMyw0Ci0gICAgICAgIE1fQUxMT0M4IHBBbHBoYUJldGEwLDgKLSAgICAgICAgTV9BTExPQzggcEFscGhhQmV0YTEsOAotICAgICAgICBNX0FMTE9DOCBwWFlCUyw0Ci0gICAgICAgIE1fQUxMT0M0IHBwQlMsNAotICAgICAgICBNX0FMTE9DOCBwcFEwU3RlcCw0Ci0gICAgICAgIE1fQUxMT0M0IHBTdGVwLDQKLSAgICAgICAgCi0gICAgICAgIDsvLyBGdW5jdGlvbiBoZWFkZXIKLSAgICAgICAgTV9TVEFSVCBvbXhWQ000UDEwX0ZpbHRlckRlYmxvY2tpbmdMdW1hX1ZlckVkZ2VfSSwgcjExCi0gICAgICAgIAotICAgICAgICA7Ly9JbnB1dCBhcmd1bWVudHMgb24gdGhlIHN0YWNrCi0gICAgICAgIE1fQVJHICAgcHBUaHJlc2hvbGRzQXJnLCA0Ci0gICAgICAgIE1fQVJHICAgcHBCU0FyZywgNAotICAgICAgICAKLSAgICAgICAgTERSICAgICB0NCw9TUFTS18xCi0KLSAgICAgICAgTERSQiAgICBhbHBoYTAsIFtwQWxwaGFBcmddCi0gICAgICAgIExEUkIgICAgYmV0YTAsICBbcEJldGFBcmddCi0gICAgICAgIExEUkIgICAgYWxwaGExLCBbcEFscGhhQXJnLCMxXQotICAgICAgICBMRFJCICAgIGJldGExLCAgW3BCZXRhQXJnLCMxXQotCi0gICAgICAgIE1VTCAgICAgYWxwaGEwLCBhbHBoYTAsIHQ0Ci0gICAgICAgIE1VTCAgICAgYmV0YTAsIGJldGEwLCB0NAotICAgICAgICBNVUwgICAgIGFscGhhMSwgYWxwaGExLCB0NAotICAgICAgICBNVUwgICAgIGJldGExLCBiZXRhMSwgdDQKLQotICAgICAgICBNX1NUUkQgIGFscGhhMCwgYmV0YTAsIHBBbHBoYUJldGEwCi0gICAgICAgIE1fU1RSRCAgYWxwaGExLCBiZXRhMSwgcEFscGhhQmV0YTEKLQotICAgICAgICBMRFIgICAgIFhZLD1MT09QX0NPVU5UCi0gICAgICAgIE1fTERSICAgcEJTLCBwcEJTQXJnCi0gICAgICAgIE1fTERSICAgcFRocmVzaG9sZHMsIHBwVGhyZXNob2xkc0FyZwotICAgICAgICBNX1NUUiAgIHNyY2RzdF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LSAgICAgICAgTERSICAgICBtYXNrLCA9TUFTS18yCi0gICAgICAgIENNUCAgICAgYlMsICMwCi0gICAgICAgIE1fU1RSICAgcEJTLCBwcEJTCi0KLSAgICAgICAgTERSICAgICByb3c0LCBbcFEwLCAjNF0hCi0gICAgICAgIEJFUS5XICAgTm9GaWx0ZXJCUzAKLSAgICAgICAgTV9MRFIgICByb3c1LCBbcFEwLCBzcmNkc3RTdGVwXSEKLSAgICAgICAgTV9MRFIgICByb3c2LCBbcFEwLCBzcmNkc3RTdGVwXSEKLSAgICAgICAgTV9MRFIgICByb3c3LCBbcFEwLCBzcmNkc3RTdGVwXQotCi0gICAgICAgIDsvLyByb3c0ID0gW3IwcTMgcjBxMiByMHExIHIwcTBdCi0gICAgICAgIDsvLyByb3c1ID0gW3IxcTMgcjFxMiByMXExIHIxcTBdCi0gICAgICAgIDsvLyByb3c2ID0gW3IycTMgcjJxMiByMnExIHIycTBdCi0gICAgICAgIDsvLyByb3c3ID0gW3IzcTMgcjNxMiByM3ExIHIzcTBdCi0gICAgCi0gICAgICAgIEFORCAgICAgdHVucGs0LCBtYXNrLCByb3c0Ci0gICAgICAgIENNUCAgICAgYlMsICM0Ci0gICAgICAgIEFORCAgICAgdHVucGs1LCBtYXNrLCByb3c0LCBMU0wjOAotICAgICAgICBVWFRBQjE2IHR1bnBrNCwgdHVucGs0LCByb3c1LCBST1IjOAotICAgICAgICBVWFRBQjE2IHR1bnBrNSwgdHVucGs1LCByb3c1Ci0gICAgICAgIEFORCAgICAgdHVucGs2LCBtYXNrLCByb3c2Ci0gICAgICAgIEFORCAgICAgdHVucGs3LCBtYXNrLCByb3c2LCBMU0wjOAotICAgICAgICBVWFRBQjE2IHR1bnBrNiwgdHVucGs2LCByb3c3LCBST1IjOAotICAgICAgICBVWFRBQjE2IHR1bnBrNywgdHVucGs3LCByb3c3Ci0KLSAgICAgICAgOy8vIHR1bnBrNCA9IFtyMHEwIHIxcTAgcjBxMiByMXEyXQotICAgICAgICA7Ly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gVVNVQjggICBhLCBhcDBxMCwgYWxwaGEKLSAgICAgICAgU0VMICAgICBmaWx0LCBtMDAsIG0wMQotICAgICAgICAKLSAgICAgICAgOy8vIENoZWNrIHxwMS1wMHw8QmV0YSAKLSAgICAgICAgVVNVQjggICBkcDFwMCwgcF8xLCBwXzAKLSAgICAgICAgVVNVQjggICBhLCBwXzAsIHBfMQotICAgICAgICBTRUwgICAgIGEsIGEsIGRwMXAwCi0gICAgICAgIFVTVUI4ICAgYSwgYSwgYmV0YQotICAgICAgICBTRUwgICAgIGZpbHQsIG0wMCwgZmlsdAotCi0gICAgICAgIDsvLyBDaGVjayB8cTEtcTB8PEJldGEgCi0gICAgICAgIFVTVUI4ICAgZHExcTAsIHFfMSwgcV8wCi0gICAgICAgIFVTVUI4ICAgYSwgcV8wLCBxXzEKLSAgICAgICAgU0VMICAgICBhLCBhLCBkcTFxMAotICAgICAgICBVU1VCOCAgIGEsIGEsIGJldGEKLSAgICAgICAgU0VMICAgICBmaWx0LCBtMDAsIGZpbHQKLQotICAgICAgICA7Ly8gQ2hlY2sgYXA8QmV0YSAKLSAgICAgICAgVVNVQjggICBkcDJwMCwgcF8yLCBwXzAKLSAgICAgICAgVVNVQjggICBhLCBwXzAsIHBfMgotICAgICAgICBTRUwgICAgIGEsIGEsIGRwMnAwCi0gICAgICAgIFVTVUI4ICAgYSwgYSwgYmV0YQotICAgICAgICBTRUwgICAgIGFwZmxnLCBtMDAsIGZpbHQgICAgICAgICAgICA7Ly8gYXBmbGcgPSBmaWx0ICYmIChhcDxiZXRhKQotCi0gICAgICAgIDsvLyBDaGVjayBhcTxCZXRhIAotICAgICAgICBVU1VCOCAgIGRxMnEwLCBxXzIsIHFfMAotICAgICAgICBVU1VCOCAgIHQyLCBxXzAsIHFfMgotICAgICAgICBTRUwgICAgIHQyLCB0MiwgZHEycTAKLSAgICAgICAgVVNVQjggICB0MiwgdDIsIGJldGEKLSAgICAgICAgTU9WICAgICB0NywjMAotICAgICAgICAKLQotICA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A9IFtyM3AwIHIzcDEgcjNwMiByM3AzXQotCi0gICAgICAgIE1fU1RSICAgcm93OSwgW3BRMGJdLCBTdGVwYgotICAgICAgICBTVFIgICAgIHJvdzcsIFtwUTBiLCBTdGVwYl0KLSAgICAgICAgU1RSICAgICByb3c2LCBbcFEwYiwgU3RlcGIsIExTTCAjMV0KLSAgICAgICAgU1RSICAgICByb3czLCBbcFEwYl0sICM0Ci0gICAgICAgIAotICAgICAgICBNX0xEUiAgIFEzYiwgcFFfMwotCi0gICAgICAgIDsvLyBRMGIgPSBbcjBxMCByMXEwIHIycTAgcjNxMF0KLSAgICAgICAgOy8vIFExYiA9IFtyMHExIHIxcTEgcjJxMSByM3ExXQotICAgICAgICA7Ly8gUTJiID0gW3IwcTIgcjFxMiByMnEyIHIzcTJdCi0gICAgICAgIDsvLyBRM2IgPSBbcjBxMyByMXEzIHIycTMgcjNxM10KLQotICAgICAgICA7Ly8tLS0tLS1QYWNrIHEwLXEzLS0tLS0tCi0gICAgICAgIEFORCAgICAgdHVucGswLCBtYXNrYiwgcF8yCi0gICAgICAgIEFORCAgICAgdHVucGsyLCBtYXNrYiwgcF8yLCBMU0wjOAotICAgICAgICBVWFRBQjE2IHR1bnBrMCwgdHVucGswLCBRMGIsIFJPUiM4Ci0gICAgICAgIFVYVEFCMTYgdHVucGsyLCB0dW5wazIsIFEwYgotCi0gICAgICAgIEFORCAgICAgdHVucGszLCBtYXNrYiwgUTNiCi0gICAgICAgIEFORCAgICAgdHVucGs4LCBtYXNrYiwgUTNiLCBMU0wjOAotICAgICAgICBVWFRBQjE2IHR1bnBrMywgdHVucGszLCBRMmIsIFJPUiM4Ci0gICAgICAgIFVYVEFCMTYgdHVucGs4LCB0dW5wazgsIFEyYgotCi0gICAgICAgIDsvLyB0dW5wazAgPSBbcjBxMSByMHEwIHIycTEgcjJxMF0KLSAgICAgICAgOy8vIHR1bnBrMiA9IFtyMXExIHIxcTAgcjNxMSByM3EwXQotICAgICAgICA7Ly8gdHVucGszID0gW3IwcTMgcjBxMiByMnEzIHIycTJdCi0gICAgICAgIDsvLyB0dW5wazggPSBbcjFxMyByMXEyIHIzcTMgcjNxMl0KLQotICAgICAgICBQS0hUQiAgIHJvdzgsIHR1bnBrMywgdHVucGswLCBBU1IjMTYKLSAgICAgICAgUEtIQlQgICByb3c3LCB0dW5wazAsIHR1bnBrMywgTFNMIzE2Ci0gICAgICAgIFBLSFRCICAgcm93NCwgdHVucGs4LCB0dW5wazIsIEFTUiMxNgotICAgICAgICBQS0hCVCAgIHJvdzYsIHR1bnBrMiwgdHVucGs4LCBMU0wjMTYKLQotICAgICAgICA7Ly8gcm93OCA9IFtyMHEwIHIwcTEgcjBxMiByMHEzXQotICAgICAgICA7Ly8gcm93NCA9IFtyMXEwIHIxcTEgcjFxMiByMXEzXQotICAgICAgICA7Ly8gcm93NyA9IFtyMnEwIHIycTEgcjJxMiByMnEzXQotICAgICAgICA7Ly8gcm93NiA9IFtyM3EwIHIzcTEgcjNxMiByM3EzXQotCi0gICAgICAgIFNUUiAgICAgcm93NCwgW3BRMGJdCi0gICAgICAgIFNUUiAgICAgcm93NywgW3BRMGIsIFN0ZXBiXQotICAgICAgICBTVFIgICAgIHJvdzYsIFtwUTBiLCBTdGVwYiwgTFNMICMxXQotCi0gICAgICAgIFNVQiAgICAgcFEwLCBwUTBiLCBTdGVwYgotICAgICAgICBNT1YgICAgIHBfMSwgUTJiCi0KLSAgICAgICAgU1RSICAgICByb3c4LCBbcFEwXQotCi0gICAgICAgIE1fTERSRCAgWFksIHBCUywgcFhZQlMKLSAgICAgICAgTV9MRFIgICBwVGhyZXNob2xkcywgcHBUaHJlc2hvbGRzCi0gICAgICAgIE1fTERSRCAgYWxwaGEsIGJldGEsIHBBbHBoYUJldGExCi0KLSAgICAgICAgQUREUyAgICBYWSwgWFksIFhZCi0gICAgICAgIEFERCAgICAgcFRocmVzaG9sZHMsICM0Ci0gICAgICAgIE1fU1RSICAgcFRocmVzaG9sZHMsIHBwVGhyZXN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YnV0IHBEc3QgaXMgbm90IDQtYnl0ZSBhbGlnbmVkLgotICoJcm9pLndpZHRoIGlzIGVxdWFsIHRvIDgsIGJ1dCBwRHN0IGlzIG5vdCA4IGJ5dGUgYWxpZ25lZC4KLSAqCXNyY1N0ZXAgb3IgZHN0U3RlcCBpcyBub3QgYSBtdWx0aXBsZSBvZiA4LgotICoKLSAqLwotCi1PTVhSZXN1bHQgb214VkNNNFAxMF9JbnRlcnBvbGF0ZUNocm9tYSAoCi0gICAgIGNvbnN0IE9NWF9VOCogcFNyYywKLSAgICAgT01YX1MzMiBzcmNTdGVwLAotICAgICBPTVhfVTgqIHBEc3QsCi0gICAgIE9NWF9TMzIgZHN0U3RlcCwKLSAgICAgT01YX1MzMiBkeCwKLSAgICAgT01YX1MzMiBkeSwKLSAgICAgT01YU2l6ZSByb2kKLSApCi17Ci0gICAgcmV0dXJuIGFybVZDTTRQMTBfSW50ZXJwb2xhdGVfQ2hyb21hIAotICAgICAgICAoKE9NWF9VOCopcFNyYywgc3JjU3RlcCwgcERzdCwgZHN0U3RlcCwgcm9pLndpZHRoLCByb2kuaGVpZ2h0LCBkeCwgZHkpOwotfQotCi0KLS8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgotICogICAgICAgICAgICAgICAgICAgICAgICAgICAgICBFTkQgT0YgRklMRQotICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotCmRpZmYgLS1naXQgYS9tZWRpYS9saWJzdGFnZWZyaWdodC9jb2RlY3Mvb24yL2gyNjRkZWMvb214ZGwvYXJtMTEvdmMvbTRwMTAvc3JjL29teFZDTTRQMTBfSW50ZXJwb2xhdGVMdW1hX3MucyBiL21lZGlhL2xpYnN0YWdlZnJpZ2h0L2NvZGVjcy9vbjIvaDI2NGRlYy9vbXhkbC9hcm0xMS92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V9BUkcgICBwdHJpZHgsIDQKLSAgICAgICAgTV9BUkcgICBwdHJpZHksIDQgICAgICAgIAotICAgICAgICBNX0FSRyAgIHB0cldpZHRoLCA0Ci0gICAgICAgIE1fQVJHICAgcHRySGVpZ2h0LCA0ICAgICAgICAKLQotICAgICAgICA7Ly8gTG9hZCBzdHJ1Y3R1cmUgZWxlbWVudHMgb2Ygcm9pIAotICAgICAgICBNX0xEUiAgIGlkeCwgcHRyaWR4Ci0gICAgICAgIE1fTERSICAgaWR5LCBwdHJpZHkKLSAgICAgICAgTV9MRFIgICBpV2lkdGgsIHB0cldpZHRoCi0gICAgICAgIE1fTERSICAgaUhlaWdodCwgcHRySGVpZ2h0Ci0gICAgICAgIAotICAgICAgICBNX1BSSU5URiAicm9pLndpZHRoICVkXG4iLCBpV2lkdGgKLSAgICAgICAgTV9QUklOVEYgInJvaS5oZWlnaHQgJWRcbiIsIGlIZWlnaHQKLQotICAgICAgICBBREQgICAgIGluZGV4LCBpZHgsIGlkeSwgTFNMICMyICAgICAgICAgICAgICAgICA7Ly8gIFtpbmRleF0gPSBbaWR5XVtpZHhdCi0gICAgICAgIE1fQURSICAgcEFyZ3MsIHBwQXJncwotCi1JbnRlcnBvbGF0ZUx1bWEKLUJsb2NrNHg0V2lkdGhMb29wCi1CbG9jazR4NEhlaWdodExvb3AKLQotICAgICAgICBTVE0gICAgIHBBcmdzLCB7cFNyYyxzcmNTdGVwLHBEc3QsZHN0U3RlcH0gCi0gICAgICAgIE1fQURSICAgcEJ1ZiwgcEJ1ZmZlciAgICAgICAgICAgICAgICAgICAgICAgICAgIAotCi0gICAgICAgIDsvLyBzd2l0Y2ggdGFibGUgdXNpbmcgbW90aW9uIHZlY3RvciBhcyBpbmRleAotICAgICAgICBNX1NXSVRDSCBpbmRleCwgTAotICAgICAgICBNX0NBU0UgIENhc2VfMAotICAgICAgICBNX0NBU0UgIENhc2VfMQotICAgICAgICBNX0NBU0UgIENhc2VfMgotICAgICAgICBNX0NBU0UgIENhc2VfMwotICAgICAgICBNX0NBU0UgIENhc2VfNAotICAgICAgICBNX0NBU0UgIENhc2VfNQotICAgICAgICBNX0NBU0UgIENhc2VfNgotICAgICAgICBNX0NBU0UgIENhc2VfNwotICAgICAgICBNX0NBU0UgIENhc2VfOAotICAgICAgICBNX0NBU0UgIENhc2VfOQotICAgICAgICBNX0NBU0UgIENhc2VfYQotICAgICAgICBNX0NBU0UgIENhc2VfYgotICAgICAgICBNX0NBU0UgIENhc2VfYwotICAgICAgICBNX0NBU0UgIENhc2VfZAotICAgICAgICBNX0NBU0UgIENhc2VfZQotICAgICAgICBNX0NBU0UgIENhc2VfZgotICAgICAgICBNX0VORFNXSVRDSAotCi1DYXNlXzAKLSAgICAgICAgOy8vIENhc2UgRwotICAgICAgICBNX1BSSU5URiAiQ2FzZSAwIFxuIgotCi0gICAgICAgIEJMICAgICAgYXJtVkNNNFAxMF9JbnRlcnBvbGF0ZUx1bWFfQ29weTR4NF91bnNhZmUKLSAgICAgICAgQiAgICAgICBCbG9jazR4NExvb3BFbmQKLQotQ2FzZV8xCi0gICAgICAgIDsvLyBDYXNlIGEKLSAgICAgICAgTV9QUklOVEYgIkNhc2UgMSBcbiIKLQotICAgICAgICBTVUIgICAgIHBTcmMsIHBTcmMsICMyCi0gICAgICAgIE1PViAgICAgSGVpZ2h0LCAjNAotICAgICAgICBCTCAgICAgIGFybVZDTTRQMTBfSW50ZXJwb2xhdGVMdW1hX0hvckFsaWduOXhfdW5zYWZlCi0gICAgICAgIEJMICAgICAgYXJtVkNNNFAxMF9JbnRlcnBvbGF0ZUx1bWFfSGFsZkhvcjR4NF91bnNhZmUKLSAgICAgICAgQkwgICAgICBhcm1WQ000UDEwX0F2ZXJhZ2VfNHg0X0FsaWduMl91bnNhZmUKLSAgICAgICAgQiAgICAgICBCbG9jazR4NExvb3BFbmQKLUNhc2VfMgotICAgICAgICA7Ly8gQ2FzZSBiCi0gICAgICAgIE1fUFJJTlRGICJDYXNlIDIgXG4iCi0gIC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2xhdGVMdW1hX1ZlckFsaWduNHhfdW5zYWZlCi0gICAgICAgIEJMICAgICAgYXJtVkNNNFAxMF9JbnRlcnBvbGF0ZUx1bWFfSGFsZlZlcjR4NF91bnNhZmUKLSAgICAgICAgQUREICAgICBwU3JjLCBwU3JjLCBzcmNTdGVwICAgICAgICAgICAgICAgICAgICAgOy8vIFVwZGF0ZSBwU3JjIHRvIG9uZSByb3cgZG93bgotICAgICAgICBCTCAgICAgIGFybVZDTTRQMTBfQXZlcmFnZV80eDRfQWxpZ24wX3Vuc2FmZQotICAgICAgICBCICAgICAgIEJsb2NrNHg0TG9vcEVuZAotQ2FzZV9kCi0gICAgICAgIDsvLyBDYXNlIHAKLSAgICAgICAgTV9QUklOVEYgIkNhc2UgZCBcbiIKLSAgICAgICAgU1VCICAgICBwU3JjLCBwU3JjLCAjMgotICAgICAgICBBREQgICAgIHBTcmMsIHBTcmMsIHNyY1N0ZXAKLSAgICAgICAgTU9WICAgICBIZWlnaHQsICM0Ci0gICAgICAgIE1fQURSICAgcERzdCwgcFRlbXBCdWYKLSAgICAgICAgTU9WICAgICBkc3RTdGVwLCAjNAotICAgICAgICBCTCAgICAgIGFybVZDTTRQMTBfSW50ZXJwb2xhdGVMdW1hX0hvckFsaWduOXhfdW5zYWZlCi0gICAgICAgIEJMICAgICAgYXJtVkNNNFAxMF9JbnRlcnBvbGF0ZUx1bWFfSGFsZkhvcjR4NF91bnNhZmUKLSAgICAgICAgTV9BRFIgICBwQXJncywgcHBBcmdzCi0gICAgICAgIExETSAgICAgcEFyZ3MsIHtwU3JjLCBzcmNTdGVwLCBwRHN0LCBkc3RTdGVwfQotICAgICAgICBTVUIgICAgIHBTcmMsIHBTcmMsIHNyY1N0ZXAsIExTTCAjMQotICAgICAgICBNX0FEUiAgIHBCdWYsIHBCdWZmZXIgICAgICAgICAgICAgICAgICAgICAgICAgICAKLSAgICAgICAgTU9WICAgICBIZWlnaHQsICM5Ci0gICAgICAgIEJMICAgICAgYXJtVkNNN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S0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0KLXkgICAgICAgICAgICAgICBSTiAxMiAgIAotcGMgICAgICAgICAgICAgIFJOIDE1ICAgCi1yZXR1cm4gICAgICAgICAgUk4gMCAgICAKLXBTcmNMZWZ0MiAgICAgICBSTiAxICAgIAotcERzdDIgICAgICAgICAgIFJOIDIgICAgCi1zdW0xICAgICAgICAgICAgUk4gNiAgICAKLXN1bTIgICAgICAgICAgICBSTiA3ICAgIAotcFRhYmxlICAgICAgICAgIFJOIDkgICAgCi1kc3RTdGVweDIgICAgICAgUk4gMTEgICAKLWxlZnRTdGVweDIgICAgICBSTiAxNCAgIAotb3V0ZXJDb3VudCAgICAgIFJOIDE0ICAgCi1yMHgwMTAxMDEwMSAgICAgUk4gMTAgICAKLXIweDAwRkYwMEZGICAgICBSTiAxMSAgIAotCi10VmFsMCAgICAgICAgICAgUk4gMCAgICAKLXRWYWwxICAgICAgICAgICBSTiAxICAgIAotdFZhbDIgICAgICAgICAgIFJOIDIgICAgCi10VmFsMyAgICAgICAgICAgUk4gMyAgICAKLXRWYWw0ICAgICAgICAgICBSTiA0ICAgIAotdFZhbDUgICAgICAgICAgIFJOIDUgICAgCi10VmFsNiAgICAgICAgICAgUk4gNiAgICAKLXRWYWw3ICAgICAgICAgICBSTiA3ICAgIAotdFZhbDggICAgICAgICAgIFJOIDggICAgCi10VmFsOSAgICAgICAgICAgUk4gOSAgICAKLXRWYWwxMCAgICAgICAgICBSTiAxMCAgIAotdFZhbDExICAgICAgICAgIFJOIDExICAgCi10VmFsMTIgICAgICAgICAgUk4gMTIgICAKLXRWYWwxNCAgICAgICAgICBSTiAxNCAgIAotCi1iICAgICAgICAgICAgICAgUk4gMTQgICAKLWMgICAgICAgICAgICAgICBSTiAxMiAgIAotCi1wMnAwICAgICAgICAgICAgUk4gMCAgICAKLXAzcDEgICAgICAgICAgICBSTiAxICAgIAotcDZwNCAgICAgICAgICAgIFJOIDIgIC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IHRWYWw0LCBbcFNyY0xlZnRdICAgICAgICAgICAgICAgICAgIDsvLyB0VmFsNCA9IHBTcmNMZWZ0WzZdCi0gICAgICAgIExEUkIgICAgIHRWYWwxMixbcFNyY0xlZnQyXSAgICAgICAgICAgICAgICAgIDsvLyB0VmFsMTI9IHBTcmNMZWZ0WzddCi0gICAgICAgIEFERCAgICAgIHRWYWw4LCB0VmFsOCwgdFZhbDkgICAgICAgICAgICAgICAgIDsvLyB0VmFsOCA9IHRWYWw4ICsgdFZhbDkKLSAgICAgICAgQUREICAgICAgdFZhbDIsIHRWYWwyLCB0VmFsMTQgICAgICAgICAgICAgICAgOy8vIGxlZnRzdW0xICA9IHN1bShwU3JjTGVmdFswXSB0byBwU3JjTGVmdFszXSkKLSAgICAgICAgQUREICAgICAgdFZhbDQsIHRWYWw0LCB0VmFsMTIgICAgICAgICAgICAgICAgOy8vIHRWYWw0ID0gdFZhbDQgKyB0VmFsMTIKLSAgICAgICAgQUREICAgICAgdFZhbDE0LCB0VmFsOCwgdFZhbDQgICAgICAgICAgICAgICAgOy8vIGxlZnRzdW0yICA9IHN1bShwU3JjTGVmdFs0XSB0byBwU3JjTGVmdFs3XSkKLSAgICAgICAgQUREICAgICAgdFZhbDgsIHRWYWwxNCwgIzIgICAgICAgICAgICAgICAgICAgOy8vIHRWYWw4ID0gbGVmdHN1bTIgKyAyCi0gICAgICAgIEFERCAgICAgIHRWYWw5LCBzdW0yLCAgICMyICAgICAgICAgICAgICAgICAgIDsvLyB0VmFsOCA9IHVwc3VtMiArIDIKLSAgICAgICAgQUREICAgICAgc3VtMSwgIHN1bTEsIHRWYWwyICAgICAgICAgICAgICAgICAgOy8vIHN1bTEgPSB1cHN1bTEgKyBsZWZ0c3VtMQotICAgICAgICBBREQgICAgICBzdW0yLCAgc3VtMiwgdFZhbDE0ICAgICAgICAgICAgICAgICA7Ly8gc3VtMiA9IHVwc3VtMiArIGxlZnRzdW0yCi0gICAgICAgIEFERCAgICAgIHN1bTEsIHN1bTEsICM0ICAgICAgICAgICAgICAgICAgICAgIDsvLyAoc3VtMSArIDQpCi0gICAgICAgIEFERCAgICAgIHN1bTIsIHN1bTIsICM0ICAgICAgICAgICAgICAgICAgICAgIDsvLyAoc3VtMiArIDQpCi0gICAgICAgIE1PViAgICAgIHN1bTEsICBzdW0xLCAgTFNSICMzICAgICAgICAgICAgICAgIDsvLyAoc3VtMSArIDQpPj4zCi0gICAgICAgIE1PViAgICAgIHRWYWw5LCB0VmFsOSwgTFNSICMyICAgICAgICAgICAgICAgIDsvLyAodFZhbDkgKyAyKT4+MgotICAgICAgICBNT1YgICAgICB0VmFsOCwgdFZhbDgsIExTUiAjMiAgICAgICAgICAgICAgICA7Ly8gKHRWYWw4ICsgMik+PjIKLSAgICAgICAgTU9WICAgICAgc3VtMiwgIHN1bTIsICBMU1IgIzMgICAgICAgICAgICAgICAgOy8vIChzdW0yICsgNCk+PjMKLSAgICAgICAgCi0gICAgICAgIE1VTCAgICAgIHRWYWwwLCBzdW0xLCByMHgwMTAxMDEwMSAgICAgICAgICAgIDsvLyByZXBsaWNhdGUgdGhlIHZhbCBpbiBhbGwgdGhlIGJ5dGVzCi0gICAgICAgIE1VTCAgICAgIHRWYWwxLCB0VmFsOSxyMHgwMTAxMDEwMSAgICAgICAgICAgIDsvLyByZXBsaWNhdGUgdGhlIHZhbCBpbiBhbGwgdGhlIGJ5dGVzCi0gICAgICAgIE1VTCAgICAgIHRWYWw4LCB0VmFsOCxyMHgwMTAxMDEwMSAgICAgICAgICAgIDsvLyByZXBsaWNhdGUgdGhlIHZhbCBpbiBhbGwgdGhlIGJ5dGVzCi0gICAgICAgIE1VTCAgICAgIHRWYWw5LCBzdW0yLCByMHgwMTAxMDEwMSAgICAgICAgICAgIDsvLyByZXBsaWNhdGUgdGhlIHZhbCBpbiBhbGwgdGhlIGJ5dGVzCi0gICAgICAgIAotICAgICAgICBNX1NUUkQgICB0VmFsMCwgdFZhbDEsIFtwRHN0XSwgZHN0U3RlcCAgIC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01QICAgICAgYXZhaWxhYmlsaXR5LCAjT01YX1ZDX1VQUEVSICAgICAgICAgOy8vIGlmKGF2YWlsYWJpbGl0eSAmICNPTVhfVkNfVVBQRVIpCi0gICAgICAgIAotICAgICAgICBCTkUgICAgICBUU1RfTEVGVCAgICAgICAgICAgICAgICAgICAgICAgICAgICA7Ly8gSnVtcCB0byBMZWZ0IGlmIG5vdCB1cHBlcgotICAgICAgICBMRE0gICAgICBwU3JjQWJvdmUse3RWYWw4LHRWYWw5fSAgICAgICAgICAgICA7Ly8gdFZhbCA4IHRvIDkgPSBwU3JjQWJvdmVbMCB0byA3XQotICAgICAgICAKLSAgICAgICAgOy8vIE1fU1RBTEwgQVJNMTEzNkpTPTMKLSAgICAgICAgCi0gICAgICAgIFVYVEIxNiAgIHRWYWw3LCB0VmFsOCAgICAgICAgICAgICAgICAgICAgICAgIDsvLyBwU3JjQWJvdmVbMCwgMl0KLSAgICAgICAgVVhUQjE2ICAgdFZhbDgsIHRWYWw4LCBST1IgIzggICAgICAgICAgICAgICAgOy8vIHBTcmNBYm92ZVsxLCAzXQotICAgICAgICBVQUREMTYgICBzdW0xLCAgdFZhbDcsIHRWYWw4ICAgICAgICAgICAgICAgICA7Ly8gcFNyY0Fib3ZlWzAsIDJdICsgcFNyY0Fib3ZlWzEsIDNdCi0gICAgICAgIAotICAgICAgICBVWFRCMTYgICB0VmFsNywgdFZhbDkgICAgICAgICAgICAgICAgICAgICAgICA7Ly8gcFNyY0Fib3ZlWzQsIDZdCi0gICAgICAgIFVYVEIxNiAgIHRWYWw5LCB0VmFsOSwgUk9SICM4ICAgICAgICAgICAgICAgIDsvLyBwU3JjQWJvdmVbNSwgN10KLSAgICAgICAgVUFERDE2ICAgc3VtMiwgIHRWYWw3LCB0VmFsOSAgICAgICAgICAgICAgICAgOy8vIHBTcmNBYm92ZVswLCAyXSArIHBTcmNBYm92ZVs0LCA2XQotICAgICAgICAKLSAgICAgICAgQUREICAgICAgc3VtMSwgc3VtMSwgc3VtMSwgTFNSICMxNiAgICAgICAgICAgOy8vIHN1bShwU3JjQWJvdmVbMF0gdG8gcFNyY0Fib3ZlWzNdKQotICAgICAgICBBREQgICAgICBzdW0yLCBzdW0yLCBzdW0yLCBMU1IgIzE2ICAgICAgICAgICA7Ly8gc3VtKHBTcmNBYm92ZVs0XSB0byBwU3JjQWJvdmVbN10pCi0gICAgICAgIAotICAgICAgICBVWFRIICAgICBzdW0xLCBzdW0xICAgICAgICAgICAgICAgICAgICAgICAgICA7Ly8gdXBzdW0xIChDbGVhciB0aGUgdG9wIGp1bmsgYml0cykKLSAgICAgICAgVVhUSCAgICAgc3VtMiwgc3VtMiAgICAgICAgICAgICAgICAgICAgICAgICAgOy8vIHVwc3VtMiAoQ2xlYXIgdGhlIHRvcCBqdW5rIGJpdHMpCi0gICAgICAgIAotICAgICAgICBBREQgICAgICBzdW0xLCBzdW0xLCAjMiAgICAgICAgICAgICAgICAgICAgICA7Ly8gc3VtMSArIDIKLSAgICAgICAgQUREICAgICAgc3VtMiwgc3VtMiwgIzIgICAgICAgICAgICAgICAgICAgICAgOy8vIHN1bTIgKyAyCi0gICAgICAgIAotICAgICAgICBNT1YgICAgICBzdW0xLCBzdW0xLCBMU1IgIzIgICAgICAgICAgICAgICAgICA7Ly8gKHN1bTEgKyAyKT4+MgotICAgICAgICBNT1YgICAgICBzdW0yLCBzdW0yLCBMU1IgIzIgICAgICAgICAgICAgICAgICA7Ly8gKHN1bTIgKyAyKT4+MgotICAgICAgICAKLSAgICAgICAgTVVMICAgICAgc3VtMSwgc3VtMSxyMHgwMTAxMDEwMSAgICAgICAgICAgICAgOy8vIHJlcGxpY2F0ZSB0aGUgdmFsIGluIGFsbCB0aGUgYnl0ZXMKLSAgICAgICAgTVVMICAgICAgc3VtMiwgc3VtMixyMHgwMTAxMDEwMSAgICAgICAgICAgICAgOy8vIHJlcGxpY2F0ZSB0aGUgdmFsIGluIGFsbCB0aGUgYnl0ZXMKLSAgICAgICAgCi0gICAgICAgIE1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ICsgdFZhbDEyCi0gICAgICAgIE1fTERSQiAgIHRWYWw5LCBbcFNyY0xlZnQyXSwgK2xlZnRTdGVweDIgICAgIDsvLyB0VmFsOSA9IHBTcmNMZWZ0WzVdCi0gICAgICAgIE1fTERSQiAgIHRWYWw0LCBbcFNyY0xlZnRdLCAgK2xlZnRTdGVweDIgICAgIDsvLyB0VmFsNCA9IHBTcmNMZWZ0WzZdCi0gICAgICAgIE1fTERSQiAgIHRWYWwxMixbcFNyY0xlZnQyXSwgK2xlZnRTdGVweDIgICAgIDsvLyB0VmFsMTI9IHBTcmNMZWZ0WzddCi0gICAgICAgIAotICAgICAgICBBREQgICAgICB0VmFsOCwgdFZhbDgsIHRWYWw5ICAgICAgICAgICAgICAgICA7Ly8gdFZhbDggPSB0VmFsOCArIHRWYWw5Ci0gICAgICAgIEFERCAgICAgIHN1bTEsICB0VmFsNiwgdFZhbDcgICAgICAgICAgICAgICAgIDsvLyBzdW0xICA9IHN1bShwU3JjTGVmdFswXSB0byBwU3JjTGVmdFszXSkKLSAgICAgICAgQUREICAgICAgdFZhbDQsIHRWYWw0LCB0VmFsMTIgICAgICAgICAgICAgICAgOy8vIHRWYWw0ID0gdFZhbDQgKyB0VmFsMTIKLSAgICAgICAgQUREICAgICAgc3VtMiwgIHRWYWw4LCB0VmFsNCAgICAgICAgICAgICAgICAgOy8vIHN1bTIgID0gc3VtKHBTcmNMZWZ0WzRdIHRvIHBTcmNMZWZ0WzddKQotICAgICAgICAKLSAgICAgICAgQUREICAgICAgc3VtMSwgc3VtMSwgIzIgICAgICAgICAgICAgICAgICAgICAgOy8vIHN1bTEgKyAyCi0gICAgICAgIEFERCAgICAgIHN1bTIsIHN1bTIsICMyICAgICAgICAgICAgICAgICAgICAgIDsvLyBzdW0yICsgMgotICAgICAgICAKLSAgICAgICAgTU9WICAgICAgc3VtMSwgc3VtMSwgTFNSICMyICAgICAgICAgICAgICAgICAgOy8vIChzdW0xICsgMik+PjIKLSAgICAgICAgTU9WICAgIC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FtwRHN0XSwgZHN0U3RlcCAgICAgICA7Ly8gcERzdFszMiB0byAzOV0gPSB0VmFsIDggdG8gOQotICAgICAgICBNX1NUUkQgICB0VmFsOCwgdFZhbDksIFtwRHN0XSwgZHN0U3RlcCAgICAgICA7Ly8gcERzdFs0MCB0byA0N10gPSB0VmFsIDggdG8gOQotICAgICAgICBNX1NUUkQgICB0VmFsOCwgdFZhbDksIFtwRHN0XSwgZHN0U3RlcCAgICAgICA7Ly8gcERzdFs0OCB0byA1NV0gPSB0VmFsIDggdG8gOQotICAgICAgICBNX1NUUkQgICB0VmFsOCwgdFZhbDksIFtwRHN0XSwgZHN0U3RlcCAgICAgICA7Ly8gcERzdFs1NiB0byA2M10gPSB0VmFsIDggdG8gOQotICAgICAgICAKLSAgICAgICAgTU9WICAgICAgcmV0dXJuLCAjT01YX1N0c19Ob0VycgotICAgICAgICBNX0VYSVQgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA7Ly8gTWFjcm8gdG8gZXhpdCBtaWR3YXktYnJlYWsgZnJtIGNhc2UKLQotVFNUX0NPVU5UMAotICAgICAgICBMRFIgICAgICBzdW0xLCA9TVVMX0NPTlNUMSAgICAgICAgICAgICAgICAgIDsvLyBzdW0xID0gMHg4MDgwODA4MCBpZihjb3VudCA9PSAwKQotICAgICAgICAKLSAgICAgICAgOy8vIE1fU1RBTEwgQVJNMTEzNkpTPTIKLSAgICAgICAgCi0gICAgICAgIE1PViAgICAgIHRWYWw3LCBzdW0xICAgICAgICAgICAgICAgICAgICAgICAgIDsvLyB0VmFsNyA9IHN1bTEKLSAgICAgICAgCi0gICAgICAgIE1fU1RSRCAgIHRWYWw2LCB0VmFsNywgW3BEc3RdLCBkc3RTdGVwICAgICAgIDsvLyBwRHN0WzAgdG8gN10gICA9IHRWYWwgNiB0byA3Ci0gICAgICAgIE1fU1RSRCAgIHRWYWw2LCB0VmFsNywgW3BEc3RdLCBkc3RTdGVwICAgICAgIDsvLyBwRHN0WzggdG8g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ZHN0U3RlcCAgICAgICA7Ly8gcERzdFs1NiB0byA2M10gPSB0VmFsIDYgdG8gNwotCi0gICAgICAgIE1fRVhJVCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDsvLyBNYWNybyB0byBleGl0IG1pZHdheS1icmVhayBmcm0gY2FzZQotICAgICAgICAKLU9NWF9WQ19DSFJPTUFfUExBTkUKLSAgICAgICAgCi0gICAgICAgIDsvLyBNX1NUQUxMIEFSTTExMzZKUz0zCi0gICAgICAgIAotICAgICAgICBSU0IgICAgICB0VmFsMTQsIGxlZnRTdGVwLCBsZWZ0U3RlcCwgTFNMICMzICA7Ly8gNypsZWZ0U3RlcAotICAgICAgICBMRFJCICAgICB0VmFsNywgW3BTcmNBYm92ZSwgIys3XSAgICAgICAgICAgICA7Ly8gcFNyY0Fib3ZlWzddCi0gICAgICAgIExEUkIgICAgIHRWYWw2LCBbcFNyY0xlZnQsICt0VmFsMTRdICAgICAgICAgIDsvLyBwU3JjTGVmdFs3KmxlZnRTdGVwXQotICAgICAgICBMRFJCICAgICB0VmFsOCwgW3BTcmNBYm92ZUxlZnRdICAgICAgICAgICAgICA7Ly8gcFNyY0Fib3ZlTGVmdFswXQotICAgICAgICBMRFJCICAgICB0VmFsOSwgW3BTcmNBYm92ZSwgIys2IF0gICAgICAgICAgICA7Ly8gcFNyY0Fib3ZlWzZdCi0gICAgICAgIExEUkIgICAgIHRWYWwxMCxbcFNyY0Fib3ZlXSAgICAgICAgICAgICAgICAgIDsvLyBwU3JjQWJvdmVbMF0KLSAgICAgICAgQUREICAgICAgdFZhbDIsIHRWYWw3LCB0VmFsNiAgICAgICAgICAgICAgICAgOy8vIHBTcmNBYm92ZVs3XSArIHBTcmNMZWZ0WzcqbGVmdFN0ZXBdCi0gICAgICAgIFNVQiAgICAgIHRWYWw2LCB0VmFsNiwgdFZhbDggICAgICAgICAgICAgICAgIDsvLyBWMCA9IHBTcmNMZWZ0WzcqbGVmdFN0ZXBdIC0gcFNyY0Fib3ZlTGVmdFswXQotICAgICAgICBTVUIgICAgICB0VmFsNywgdFZhbDcsIHRWYWw4ICAgICAgICAgICAgICAgICA7Ly8gSDAgPSBwU3JjQWJvdmVbN10gLSBwU3JjQWJvdmVMZWZ0WzBdICAgICAgICAKLSAgICAgICAgTFNMICAgICAgdFZhbDIsIHRWYWwyLCAjNCAgICAgICAgICAgICAgICAgICAgOy8vIGEgPSAxNiAqIChwU3JjQWJvdmVbMTVdICsgcFNyY0xlZnRbMTUqbFNdKQotICAgICAgICBBREQgICAgICB0VmFsMiwgdFZhbDIsICMxNiAgICAgICAgICAgICAgICAgICA7Ly8gYSArIDE2Ci0gICAgICAgIFNVQiAgICAgIHRWYWw5LCB0VmFsOSx0VmFsMTAgICAgICAgICAgICAgICAgIDsvLyBwU3JjQWJvdmVbNl0gLSBwU3JjQWJvdmVbMF0KLSAgICAgICAgTERSQiAgICAgdFZhbDgsIFtwU3JjQWJvdmUsIys1XSAgICAgICAgICAgICAgOy8vIHBTcmNBYm92ZVs1XQotICAgICAgICBMRFJCICAgICB0VmFsMTAsW3BTcmNBYm92ZSwjKzFdICAgICAgICAgICAgICA7Ly8gcFNyY0Fib3ZlWzFdCi0gICAgICAgIEFERCAgICAgIHRWYWw5LCB0VmFsOSwgdFZhbDksIExTTCAjMSAgICAgICAgIDsvLyBIMSA9IDMgKiAocFNyY0Fib3ZlWzZdIC0gcFNyY0Fib3ZlWzBdKQotICAgICAgICBBREQgICAgICB0VmFsNywgdFZhbDksIHRWYWw3LCBMU0wgIzIgICAgICAgICA7Ly8gSCA9IEgxICsgSDAKLSAgICAgICAgU1VCICAgICAgdFZhbDgsIHRWYWw4LCB0VmFsMTAgICAgICAgICAgICAgICAgOy8vIHBTcmNBYm92ZVs1XSAtIHBTcmNBYm92ZVsxXQotICAgICAgICBMRFJCICAgICB0VmFsOSwgW3BTcmNBYm92ZSwjKzRdICAgICAgICAgICAgICA7Ly8gcFNyY0Fib3ZlWzRdCi0gICAgICAgIExEUkIgICAgIHRWYWwxMCxbcFNyY0Fib3ZlLCMrMl0gICAgICAgICAgICAgIDsvLyBwU3JjQWJvdmVbMl0KLSAgICAgICAgQUREICAgICAgdFZhbDcsIHRWYWw3LCB0VmFsOCwgTFNMICMxICAgICAgICAgOy8vIEggPSBIICsgSDIKLSAgICAgICAgU1VCICAgICAgdFZhbDExLCB0VmFsMTQsbGVmdFN0ZXAgICAgICAgICAgICAgOy8vIDYqbGVmdFN0ZXAKLSAgICAgICAgQUREICAgICAgdFZhbDExLCBwU3JjTGVmdCwgdFZhbDExICAgICAgICAgICAgOy8vIHBTcmNMZWZ0ICsgNipsZWZ0U3RlcAotICAgICAgICBNT1YgICAgICB0VmFsMTIsIHBTcmNMZWZ0ICAgICAgICAgICAgICAgICAgICA7Ly8gcFNyY0xlZnQKLSAgICAgICAgU1VCICAgICAgdFZhbDksIHRWYWw5LCB0VmFsMTAgICAgICAgICAgICAgICAgOy8vIHBTcmNBYm92ZVs0XSAtIHBTcmNBYm92ZVsyXQotICAgICAgICBBREQgICAgICB0VmFsNywgdFZhbDcsIHRWYWw5ICAgICAgICAgICAgICAgICA7Ly8gSCA9IEggKyBIMwotICAgICAgICBNX0xEUkIgICB0VmFsOCwgW3RWYWwxMV0sLWxlZnRTdGVwICAgICAgICAgICA7Ly8gcFNyY0xlZnRbNipsZWZ0U3RlcF0KLSAgICAgICAgTV9MRFJCICAgdFZhbDEwLFt0VmFsMTJdLCtsZWZ0U3RlcCAgICAgICAgICAgOy8vIHBTcmNMZWZ0WzBdCi0gICAgICAgIEFERCAgICAgIHRWYWw3LCB0VmFsNywgdFZhbDcsIExTTCAjNCAgICAgICAgIDsvLyAxNyAqIEgKLSAgICAgICAgQUREICAgICAgdFZhbDcsIHRWYWw3LCAjMTYgICAgICAgICAgICAgICAgICAgOy8vIDE3ICogSCArIDE2Ci0gICAgICAgIFNVQiAgICAgIHRWYWw4LCB0VmFsOCwgdFZhbDEwICAgICAgICAgICAgICAgIDsvLyBwU3JjTGV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ZXBdICAgICAgICAKLSAgICAgICAgQUREICAgICAgdFZhbDYsIHRWYWw2LCB0VmFsNywgTFNMICMxICAgICAgICAgOy8vIFYgPSBWICsgVjIKLSAgICAgICAgTERSICAgICAgcjB4MDBGRjAwRkYsID1NQVNLX0NPTlNUICAgICAgICAgICAgOy8vIHIweDAwRkYwMEZGID0gMHgwMEZGMDBGRgotICAgICAgICBTVUIgICAgICB0VmFsNywgdFZhbDgsIHRWYWwxMCAgICAgICAgICAgICAgICA7Ly8gcFNyY0xlZnRbNCpsZWZ0U3RlcF0gLSBwU3JjTGVmdFsyKmxlZnRTdGVwXQotICAgICAgICBBREQgICAgICB0VmFsNiwgdFZhbDYsIHRWYWw3ICAgICAgICAgICAgICAgICA7Ly8gViA9IFYgKyBWNwotICAgICAgICBTVUIgICAgICBkc3RTdGVwLCBkc3RTdGVwLCAjNCAgICAgICAgICAgICAgICA7Ly8gZHN0U3RlcCAtIDQKLSAgICAgICAgQUREICAgICAgdFZhbDYsIHRWYWw2LCB0VmFsNiwgTFNMICM0ICAgICAgICAgOy8vIDE3KlYKLSAgICAgICAgQUREICAgICAgdFZhbDYsIHRWYWw2LCAjMTYgICAgICAgICAgICAgICAgICAgOy8vIDE3KlYgKyAxNgotICAgICAgICAKLSAgICAgICAgOy8vIE1fU1RBTEwgQVJNMTEzNkpTPTEKLSAgICAgICAgCi0gICAgICAgIEFTUiAgICAgIGMsIHRWYWw2LCAjNSAgICAgICAgICAgICAgICAgICAgICAgIDsvLyBjID0gKDE3KlYgKyAxNik+PjUKLSAgICAgICAgCi0gICAgICAgIDsvLyBNX1NUQUxMIEFSTTExMzZKUz0xCi0gICAgICAgIAotICAgICAgICBBREQgICAgICB0VmFsNiwgYywgYywgTFNMICMxICAgICAgICAgICAgICAgICA7Ly8gMypjCi0gICAgICAgIFVYVEggICAgIGMsIGMgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDsvLyBvbmx5IGluIGhhbGYgd29yZAotICAgICAgICBTVUIgICAgICB0VmFsNiwgdFZhbDIsIHRWYWw2ICAgICAgICAgICAgICAgICA7Ly8gYSAtIDMqYiAtIDMqYyArIDE2Ci0gICAgICAgIE9SUiAgICAgIGMsIGMsIGMsIExTTCAjMTYgICAgICAgICAgICAgICAgICAgIDsvLyBjIGMKLSAgICAgICAgQUREICAgICAgdFZhbDcsIGIsIGIgICAgICAgICAgICAgICAgICAgICAgICAgOy8vIDJiCi0gICAgICAgIEFERCAgICAgIHRWYWwyLCB0VmFsNiwgdFZhbDcgICAgICAgICAgICAgICAgIDsvLyBwcDIgPSBkICsgMipiCi0gICAgICAgIEFERCAgICAgIHRWYWw3LCB0VmFsNywgYiAgICAgICAgICAgICAgICAgICAgIDsvLyAzYgotICAgICAgICBPUlIgICAgICBwMnAwLCAgIHRWYWw2LCAgdFZhbDIsICBMU0wgIzE2ICAgICA7Ly8gcDJwMCAgID0gcGFjayB7cDIsIHAwfQotICAgICAgICBVWFRIICAgICBiLCBiCi0gICAgICAgIFVYVEggICAgIHRWYWw3LCB0VmFsNwotICAgICAgICBPUlIgICAgICBiLCBiLCBiLCBMU0wgIzE2ICAgICAgICAgICAgICAgICAgICA7Ly8ge2IsYn0KLSAgICAgICAgT1JSICAgICAgdFZhbDcsIHRWYWw3LCB0VmFsNywgTFNMICMxNiAgICAgICAgOy8vIHszYiwzYn0KLSAgICAgICAgU0FERDE2ICAgcDNwMSwgICBwMnAwLCBiICAgICAgICAgICAgICAgICAgICAgOy8vIHAzcDEgICA9IHAycDAgKyB7YixifQotICAgICAgICBTQUREMTYgICBwNnA0LCAgIHAzcDEsIHRWYWw3ICAgICAgICAgICAgICAgICA7Ly8gcDZwNCAgID0gcDNwMSArIHszYiwzYn0KLSAgICAgICAgU0FERDE2ICAgcDdwNSwgICBwNnA0LCBiICAgICAgICAgICAgICAgICAgICAgOy8vIHA3cDUgICA9IHA2cDQgKyB7YixifQotICAgICAgICBNT1YgICAgICBvdXRlckNvdW50LCAjQkxLX1NJWkUgICAgICAgICAgICAg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IExTTCAjOCAgICAgICAgOy8vIHBhY2sge3AzLHAyLCBwMSwgcDB9Ci0gICAgICAgIFNUUiAgICAgIHAzMjEwLCBbcERzdF0sICM0ICAgICAgICAgICAgICAgICAgICA7Ly8gc3RvcmUge3BEc3RbMF0gdG8gcERzdFszXX0gIAotICAgICAgICAKLSAgICAgICAgT1JSICAgICAgcDc2NTQsIHBwNnBwNCwgcHA3cHA1LCBMU0wgIzggICAgICAgIDsvLyBwYWNrIHtwNyxwNiwgcDUsIHA0fQotICAgICAgICBNX1NUUiAgICBwNzY1NCwgW3BEc3RdLCBkc3RTdGVwICAgICAgICAgICAgICAgOy8vIHN0b3JlIHtwRHN0WzRdIHRvIHBEc3RbN119Ci0KLSAgICAgICAgU0FERDE2ICAgcDdwNSwgICBwN3A1LCAgIGMgICAgICAgICAgICAgICAgICAgIDsvLyB7cDcgKyBjfSwge3A1ICsgY30KLSAgICAgICAgU0FERDE2ICAgcDZwNCwgICBwNnA0LCAgIGMgICAgICAgICAgICAgICAgICAgIDsvLyB7cDYgKyBjfSwge3A0ICsgY30KLSAgICAgICAgU0FERDE2ICAgcDNwMSwgICBwM3AxLCAgIGMgICAgICAgICAgICAgICAgICAgIDsvLyB7cDMgKyBjfSwge3AxICsgY30KLSAgICAgICAgU0FERDE2ICAgcDJwMCwgICBwMnAwLCAgIGMgICAgICAgICAgICAgICAgICAgIDsvLyB7cDIgKyBjfSwge3AwICsgY30KLSAgICAgIAotICAgICAgICBCTkUgICAgICBMT09QX1BMQU5FICAgICAgICAgICAgICAgICAgICAgICAgICAgOy8vIExvb3AgZm9yIDggdGltZXMKLSAgICAgICAgTU9WICAgICAgcmV0dXJuLCAjT01YX1N0c19Ob0VycgotICAgICAgICBNX0VORAotICAgICAgICAKLSAgICAgICAgRU5ESUYgOy8vIEFSTTExMzZKUwotICAgICAgICAKLSAgICAgICAgCi0gICAgICAgIAotICAgICAgICBFTkQKLTsvLy0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS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DAwMQotTUFTS19DT05TVCAgICAgIEVRVSAweDAwRkYwMEZGCi0KLTsvLy0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tCi07Ly8gU2NyYXRjaCB2YXJpYWJsZQotOy8vLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0KLXkgICAgICAgICAgICAgICBSTiAxMiAgIAotcGMgICAgICAgICAgICAgIFJOIDE1ICAgCi0KLXJldHVybiAgICAgICAgICBSTiAwICAgIAotaW5uZXJDb3VudCAgICAgIFJOIDAgICAgCi1vdXRlckNvdW50ICAgICAgUk4gMSAgICAKLXBTcmNMZWZ0MiAgICAgICBSTiAxICAgIAotcERzdDIgICAgICAgICAgIFJOIDIgICAgCi1zdW0gICAgICAgICAgICAgUk4gNiAgICAKLXBUYWJsZSAgICAgICAgICBSTiA5ICAgIAotdGVtcDEgICAgICAgICAgIFJOIDEwICAgCi10ZW1wMiAgICAgICAgICAgUk4gMTIgICAKLWNNdWwxICAgICAgICAgICBSTiAxMSAgIAotY011bDIgICAgICAgICAgIFJOIDEyICAgCi1jb3VudCAgICAgICAgICAgUk4gMTIgICAKLWRzdFN0ZXB4MiAgICAgICBSTiAxMSAgIAotbGVmdFN0ZXB4MiAgICAgIFJOIDE0ICAgCi1yMHgwMTAxMDEwMSAgICAgUk4gMTAgICAKLXIweDAwRkYwMEZGICAgICBSTiAxMQotCi10VmFsMCAgICAgICAgICAgUk4gMCAgICAKLXRWYWwxICAgICAgICAgICBSTiAxICAgIAotdFZhbDIgICAgICAgICAgIFJOIDIgICAgCi10VmFsMyAgICAgICAgICAgUk4gMyAgICAKLXRWYWw0ICAgICAgICAgICBSTiA0ICAgIAotdFZhbDUgICAgICAgICAgIFJOIDUgICAgCi10VmFsNiAgICAgICAgICAgUk4gNiAgICAKLXRWYWw3ICAgICAgICAgICBSTiA3ICAgIAotdFZhbDggICAgICAgICAgIFJOIDggICAgCi10VmFsOSAgICAgICAgICAgUk4gOSAgICAKLXRWYWwxMCAgICAgICAgICBSTiAxMCAgIAotdFZhbDExICAgICAgICAgIFJOIDExICAgCi10VmFsMTIgICAgICAgICAgUk4gMTIgICAKLXRWYWwxNCAgICAgICAgICBSTiAxNCAgIAotCi1iICAgICAgICAgICAgICAgUk4gMTIgICAKLWMgICAgICAgICAgICAgICBSTiAxNCAgIAotCi1wMnAwICAgICAgICAgICAgUk4gMCAgICAKLXAzcDEgICAgICAgICAgICBSTiAxICAgIAotcDZwNCAgICAgICAgICAgIFJOIDIgICAgCi1wN3A1ICAgICAgICAgICAgUk4gNCAgICAKLXAxMHA4ICAgICAgICAgICBSTiA2ICAgIAotcDExcDkgICAgICAgICAgIFJOIDcgICAgCi1wMTRwMTIgICAgICAgICAgUk4gOCAgICAKLXAxNXAxMyAgICAgICAgICBSTiA5ICAgIAotCi1wMzIxMCAgICAgICAgICAgUk4gMTAgICAKLXA3NjU0ICAgICAgICAgICBSTiAxMCAgIAotcDExMTA5OCAgICAgICAgIFJOIDEwICAgCi1wMTUxNDEzMTIgICAgICAgUk4gMTAgICAKLQotOy8vLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0KLTsvLyBEZWNsYXJlIGlucHV0IHJlZ2lzdGVycwotOy8vLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0KLXBTcmNMZWZ0ICAgICAgICBSTiAwICAgIDsvLyBpbnB1dCBwb2ludGVyCi1wU3JjQWJvdmUgICAgICAgUk4gMSAgICA7Ly8gaW5wdXQgcG9pbnRlcgotcFNyY0Fib3ZlTGVmdCAgIFJOIDIgICAgOy8vIGlucHV0IHBvaW50ZXIKLXBEc3QgICAgICAgICAgICBSTiAzICAgIDsvLyBvdXRwdXQgcG9pbnRlcgotbGVmdFN0ZXAgICAgICAgIFJOIDQgICAgOy8vIGlucHV0IHZhcmlhYmxlC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3RlcCAgICAgICAgICAgICAgICA7Ly8gcERzdDItIHBEc3QgYWR2YW5jZWQgYnkgZHN0U3RlcAotICAgICAgICAKLSAgICAgICAgOy8vIE1fU1RBTEwgQVJNMTEzNkpTPTIgICAgICAgICAgICAgICAgICAgICAgIDsvLyBTdGFsbCBvdXRzaWRlIHRoZSBsb29wCi0KLUxPT1BfVkVSVAotICAgICAgICBTVE0gICAgICBwRHN0LCB7dFZhbDYsdFZhbDcsdFZhbDgsdFZhbDl9ICAgICA7Ly8gcERzdFswIHRvIDE1XSA9IHRWYWwgNiB0byA5Ci0gICAgICAgIFNVQlMgICAgIHksIHksICMyICAgICAgICAgICAgICAgICAgICAgICAgICAgIDsvLyB5LS0KLSAgICAgICAgQUREICAgICAgcERzdCwgcERzdCwgZHN0U3RlcHgyICAgICAgICAgICAgICAgOy8vIHBEc3QgYWR2YW5jZWQgYnkgZHN0U3RlcAotICAgICAgICBTVE0gICAgICBwRHN0Miwge3RWYWw2LHRWYWw3LHRWYWw4LHRWYWw5fSAgICA7Ly8gcERzdDJbMTYgdG8gMzFdID0gdFZhbCA2IHRvIDkKLSAgICAgICAgQUREICAgICAgcERzdDIsIHBEc3QyLCBkc3RTdGVweDIgICAgICAgICAgICAgOy8vIHBEc3QgYWR2YW5jZWQgYnkgZHN0U3RlcAotICAgICAgICBCTkUgICAgICBMT09QX1ZFUlQgICAgICAgICAgICAgICAgICAgICAgICAgICA7Ly8gTG9vcCBmb3IgOCB0aW1lcwotICAgICAgICBNT1YgICAgICByZXR1cm4sICNPTVhfU3RzX05vRXJyCi0gICAgICAgIE1fRVhJVAotCi0gICAgICAgIAotT01YX1ZDXzE2WDE2X0hPUgotICAgICAgICAKLSAgICAgICAgOy8vIE1fU1RBTEwgQVJNMTEzNkpTPTYgCi0gICAgICAgICAgICAgICAKLSAgICAgICAgTERSICAgICAgcjB4MDEwMTAxMDEsID1NVUxfQ09OU1QwICAgICAgICAgICAgOy8vIENvbnN0IHRvIHJlcGVhdCB0aGU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AxMDEgICAgICAgICAgIDsvLyByZXBsaWNhdGUgdGhlIHZhbCBpbiBhbGwgdGhlIGJ5dGVzCi0gICAgICAgIFNVQlMgICAgIHksIHksICMxICAgICAgICAgICAgICAgICAgICAgICAgICAgIDsvLyB5LS0KLSAgICAgICAgU1RSICAgICAgdFZhbDYsIFtwRHN0XSwgICMrNCAgICAgICAgICAgICAgICAgOy8vIHN0b3JlIHt0VmFsNn0gYXQgcERzdFswIHRvIDNdIAotICAgICAgICBTVFIgICAgICB0VmFsNywgW3BEc3QyXSwgIys0ICAgICAgICAgICAgICAgICA7Ly8gc3RvcmUge3RWYWw3fSBhdCBwRHN0MlswIHRvIDNdCi0gICAgICAgIFNUUiAgICAgIHRWYWw2LCBbcERzdF0sICAjKzQgICAgICAgICAgICAgICAgIDsvLyBzdG9yZSB7dFZhbDZ9IGF0IHBEc3RbNCB0byA3XQotICAgICAgICBTVFIgICAgICB0VmFsNywgW3BEc3QyXSwgIys0ICAgICAgICAgICAgICAgICA7Ly8gc3RvcmUge3RWYWw3fSBhdCBwRHN0Mls0IHRvIDddCi0gICAgICAgIE1VTCAgICAgIHRWYWw4LCB0VmFsOCwgcjB4MDEwMTAxMDEgICAgICAgICAgIDsvLyByZXBsaWNhdGUgdGhlIHZhbCBpbiBhbGwgdGhlIGJ5dGVzCi0gICAgICAgIFNUUiAgICAgIHRWYWw2LCBbcERzdF0sICAjKzQgICAgICAgICAgICAgICAgIDsvLyBzdG9yZSB7dFZhbDZ9IGF0IHBEc3RbOCB0byAxMV0KLSAgICAgICAgU1RSICAgICAgdFZhbDcsIFtwRHN0Ml0sICMrNCAgICAgICAgICAgICAgICAgOy8vIHN0b3JlIHt0VmFsN30gYXQgcERzdDJbOCB0byAxMV0KLSAgICAgICAgTVVMICAgICAgdFZhbDksIHRWYWw5LCByMHgwMTAxMDEwMSAgICAgICAgICAgOy8vIHJlcGxpY2F0ZSB0aGUgdmFsIGluIGFsbCB0aGUgYnl0ZXMKLSAgICAgICAgTV9T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XAgICAgICAgIDsvLyB0VmFsNiA9IHBTcmNMZWZ0WzAgdG8gM10KLSAgICAgICAgTV9TVFIgICAgdFZhbDksIFtwRHN0Ml0sIGRzdFN0ZXB4MiAgICAgICAgICAgOy8vIHN0b3JlIHt0VmFsN30gYXQgcERzdDJbMTIgdG8gMTVdCi0gICAgICAgIE1fTERSQiAgIHRWYWw3LCBbcFNyY0xlZnRdLCArbGVmdFN0ZXAgICAgICAgIDsvLyB0VmFsNyA9IHBTcmNMZWZ0WzQgdG8gN10KLSAgICAgICAgQk5FICAgICAgTE9PUF9IT1IgICAgICAgICAgICAgICAgICAgICAgICAgICAgOy8vIExvb3AgZm9yIDMgdGltZXMKLSAgICAgICAgTU9WICAgICAgcmV0dXJuLCAjT01YX1N0c19Ob0VycgotICAgICAgICBNX0VYSVQKLSAgICAgICAgCi1PTVhfVkNfMTZYMTZfREMKLSAgICAgICAgCi0gICAgICAgIDsvLyBNX1NUQUxMIEFSTTExMzZKUz0yCi0gICAgICAgIAotICAgICAgICBNT1YgICAgICBjb3VudCwgIzAgICAgICAgICAgICAgICAgICAgICAgICAgICA7Ly8gY291bnQgPSAwCi0gICAgICAgIFRTVCAgICAgIGF2YWlsYWJpbGl0eSwgI09NWF9WQ19VUFBFUiAgICAgICAgIDsvLyBpZihhdmFpbGFiaWxpdHkgJiAjT01YX1ZDX1VQUEVSKQotICAgICAgICBCRVEgICAgICBUU1RfTEVGVCAgICAgICAgICAgICAgICAgICAgICAgICAgICA7Ly8gSnVtcCB0byBMZWZ0IGlmIG5vdCB1cHBlcgotICAgICAgICBMRE0gICAgICBwU3JjQWJvdmUse3RWYWw4LHRWYWw5LHRWYWwxMCx0VmFsMTF9Oy8vIHRWYWwgOCB0byAxMSA9IHBTcmNBYm92ZVswIHRvIDE1XQotICAgICAgICBBREQgICAgICBjb3VudCwgY291bnQsICMxICAgICAgICAgICAgICAgICAgICA7Ly8gaWYgdXBwZXIgaW5jIGNvdW50IGJ5IDEKLSAgICAgICAgCi0gICAgICAgIDsvLyBNX1NUQUxMIEFSTTExMzZKUz0yCi0gICAgICAgIAotICAgICAgICBVWFRCMTYgICB0VmFsMiwgdFZhbDggICAgICAgICAgICAgICAgICAgICAgICA7Ly8gcFNyY0Fib3ZlWzAsIDJdCi0gICAgICAgIFVYVEIxNiAgIHRWYWw2LCB0VmFsOSAgICAgICAgICAgICAgICAgICAgICAgIDsvLyBwU3JjQWJvdmVbNCwgNl0KLSAgICAgICAgVUFERDE2ICAgdFZhbDIsIHRWYWwyLCB0VmFsNiAgICAgICAgICAgICAgICAgOy8vIHBTcmNBYm92ZVswLCAyXSArIHBTcmNBYm92ZVs0LCA2XQotICAgICAgICBVWFRCMTYgICB0VmFsOCwgdFZhbDgsIFJPUiAjOCAgICAgICAgICAgICAgICA7Ly8gcFNyY0Fib3ZlWzEsIDNdCi0gICAgICAgIFVYVEIxNiAgIHRWYWw5LCB0VmFsOSwgUk9SICM4ICAgICAgICAgICAgICAgIDsvLyBwU3JjQWJvdmVbNSwgN10KLSAgICAgICAgVUFERDE2ICAgdFZhbDgsIHRWYWw4LCB0VmFsOSAgICAgICAgICAgICAgICAgOy8vIHBTcmNBYm92ZVsxLCAzXSArIHBTcmNBYm92ZVs1LCA3XQotICAgICAgICBVQUREMTYgICB0VmFsMiwgdFZhbDIsIHRWYWw4ICAgICAgICAgICAgICAgICA7Ly8gc3VtKHBTcmNBYm92ZVswXSB0byBwU3JjQWJvdmVbN10pCi0gICAgICAgIAotICAgICAgICBVWFRCMTYgICB0VmFsOCwgdFZhbDEwICAgICAgICAgICAgICAgICAgICAgICA7Ly8gcFNyY0Fib3ZlWzgsIDEwXQotICAgICAgICBVWFRCMTYgICB0VmFsOSwgdFZhbDExICAgICAgICAgICAgICAgICAgICAgICA7Ly8gcFNyY0Fib3ZlWzEyLCAxNF0KLSAgICAgICAgVUFERDE2ICAgdFZhbDgsIHRWYWw4LCB0VmFsOSAgICAgICAgICAgICAgICAgOy8vIHBTcmNBYm92ZVs4LCAxMF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AgICBNX0xEUkIgICB0VmFsMTEsIFtwU3JjTGVmdDJdLCtsZWZ0U3RlcHgyICAgICA7Ly8gdFZhbDExPSBwU3JjTGVmdFszXQotICAgICAgICBBREQgICAgICBzdW0sIHN1bSwgdFZhbDcgICAgICAgICAgICAgICAgICAgICA7Ly8gc3VtID0gc3VtICsgdFZhbDcKLSAgICAgICAgQUREICAgICAgdFZhbDgsIHRWYWw4LCB0VmFsOSAgICAgICAgICAgICAgICAgOy8vIHRWYWw4ID0gdFZhbDggKyB0VmFsOQotICAgICAgICBBREQgICAgICB0VmFsMTAsIHRWYWwxMCwgdFZhbDExICAgICAgICAgICAgICA7Ly8gdFZhbDEwPSB0VmFsMTAgKyB0VmFsMTEKLSAgICAgICAgQUREICAgICAgdFZhbDcsIHRWYWw4LCB0VmFsMTAgICAgICAgICAgICAgICAgOy8vIHRWYWw3ID0gdFZhbDggKyB0VmFsMTAKLSAgICAgICAgCi0gICAgICAgIAotICAgICAgICBNX0xEUkIgICB0VmFsOCwgW3BTcmNMZWZ0XSwgICtsZWZ0U3RlcHgyICAgICA7Ly8gdFZhbDggPSBwU3JjTGVmdFswXQotICAgICAgICBNX0xEUkIgICB0VmFsOSwgW3BTcmNMZWZ0Ml0sICtsZWZ0U3RlcHgyICAgICA7Ly8gdFZhbDkgPSBwU3JjTGVmdFsxXQotICAgICAgICBNX0xEUkIgICB0VmFsMTAsIFtwU3JjTGVmdF0sICtsZWZ0U3RlcHgyICAgICA7Ly8gdFZhbDEwPSBwU3JjTGVmdFsyXQotICAgICAgICBNX0xEUkIgICB0VmFsMTEsIFtwU3JjTGVmdDJdLCtsZWZ0U3RlcHgyICAgICA7Ly8gdFZhbDExPSBwU3JjTGVmdFszXQotICAgICAgICBBREQgICAgICBzdW0sIHN1bSwgdFZhbDcgICAgICAgICAgICAgICAgICAgICA7Ly8gc3VtID0gc3VtICsgdFZhbDcKLSAgICAgICAgQUREICAgICAgdFZhbDgsIHRWYWw4LCB0VmFsOSAgICAgICAgICAgICAgICAgOy8vIHRWYWw4ID0gdFZhbDggKyB0VmFsOQotICAgICAgICBBREQgICAgICB0VmFsMTAsIHRWYWwxMCwgdFZhbDExICAgICAgICAgICAgICA7Ly8gdFZhbDEwPSB0VmFsMTAgKyB0VmFsMTEKLSAgICAgICAgQUREICAgICAgdFZhbDcsIHRWYWw4LCB0VmFsMTAgICAgICAgICAgICAgICAgOy8vIHRWYWw3ID0gdFZhbDggKyB0VmFsMTAKLSAgICAgICAgQUREICAgICAgc3VtLCBzdW0sIHRWYWw3ICAgICAgICAgICAgICAgICAgICAgOy8vIHN1bSA9IHN1bSArIHRWYWw3Ci0KLVRTVF9DT1VOVCAgICAgICAgCi0gICAgICAgIENNUCAgICAgIGNvdW50LCAjMCAgICAgICAgICAgICAgICAgICAgICAgICAgIDsvLyBpZihjb3VudCA9PSAwKQotICAgICAgICBNT1ZFUSAgICBzdW0sICMxMjggICAgICAgICAgICAgICAgICAgICAgICAgICA7Ly8gc3VtID0gMTI4IGlmKGNvdW50ID09IDApCi0gICAgICAgIEJFUSAgICAgIFRTVF9DT1VOVDAgICAgICAgICAgICAgICAgICAgICAgICAgIDsvLyBpZihjb3VudCA9PSAwKQotICAgICAgICBDTVAgICAgICBjb3VudCwgIzEgICAgICAgICAgICAgICAgICAgICAgICAgICA7Ly8gaWYoY291bnQgPT0gMSkKLSAgICAgICAgQURERVEgICAgc3VtLCBzdW0sICM4ICAgICAgICAgICAgICAgICAgICAgICAgOy8vIHN1bSArPSA4IGlmKGNvdW50ID09IDEpCi0gICAgICAgIEFERE5FICAgIHN1bSwgc3VtLCB0VmFsMiAgICAgICAgICAgICAgICAgICAgIDsvLyBzdW0gPSBzdW1sZWZ0ICsgc3VtdXBwZXIKLSAgICAgICAgQURETkUgICAgc3VtLCBzdW0sICMxNiAgICAgICAgICAgICAgICAgICAgICAgOy8vIHN1bSArPSAxNiBpZihjb3VudCA9PSAyKQotICAgICAgICAKLSAgICAgICAgOy8vIE1fU1RBTEwgQVJNMTEzNkpTPTEKLSAgICAgICAgCi0gICAgICAgIFVYVEggICAgIHN1bSwgc3VtICAgICAgICAgICAgICAgICAgICAgICAgICAgIDsvLyBzdW0gb25seSBieXRlIHJlc3QgY2xlYXJlZAotICAgICAgICAKLSAgICAgICAgOy8vIE1fU1RBTEwgQVJNMTEzNkpTPTEKLSAgICAgICAgCi0gICAgICAgIExTUkVRICAgIHN1bSwgc3VtLCAjNCAgICAgICAgICAgICAgICAgICAgICAgIDsvLyBzdW0gPj4gNCBpZihjb3VudCA9PSAxKQotICAgICAgICAKLSAgICAgICAgOy8vIE1fU1RBTEwgQVJNMTEzNkpTPTEKLSAgICAgICAgCi0gICAgICAgIExTUk5FICAgIHN1bSwgc3VtLCAjNSAgICAgICAgICAgICAgICAgICAgICAgIDsvLyBzdW0gPj4gNSBpZihjb3VudCA9PSAyKQotCi1UU1RfQ09VTlQwCi0gICAgICAgIAotICAgICAgICA7Ly8gTV9TVEFMTCBBUk0xMTM2SlM9MQotICAgICAgICAKLSAgICAgICAgT1JSICAgICAgc3VtLCBzdW0sIHN1bSwgTFNMICM4ICAgICAgICAgICAgICAgOy8vIHN1bSByZXBsaWNhdGVkIGluIHR3byBoYWxmd29yZAotICAgICAgICAKLSAgICAgICAgOy8vIE1fU1RBTEwgQVJNMTEzNkpTPTEKLSAgICAgICAgCi0gICAgICAgIE9SUiAgICAgIHRWYWw2LCBzdW0sIHN1bSwgTFNMICMxNiAgICAgICAgICAgIDsvLyBzdW0gIHJlcGxpY2F0ZWQgaW4gYWxsIGJ5dGVzCi0gICAgICAgIENQWSAgICAgIHRWYWw3LCB0VmFsNiAgICAgICAgICAgICAgICAgICAgICAgIDsvLyB0VmFsMSA9IHRWYWwwCi0gICAgICAgIENQWSAgICAgIHRWYWw4LCB0VmFsNiAgICAgICAgICAgICAgICAgICAgICAgIDsvLyB0VmFsMiA9IHRWYWwwCi0gICAgICAgIENQWSAgICAgIHRWYWw5LCB0VmFsNiAgICAgICAgICAgICAgICAgICAgICAgIDsvLyB0VmFsMyA9IHRWYWwwCi0gICAgICAgIEFERCAgICAgIGRzdFN0ZXB4MiwgZHN0U3RlcCwgZHN0U3RlcCAgICAgICAgIDsvLyBkb3VibGUgZHN0U3RlcAotICAgICAgICBBREQgICAgICBwRHN0MiwgcERzdCwgZHN0U3RlcCAgICAgICAgICAgICAgICA7Ly8gcERzdDItIHBEc3QgYWR2YW5jZWQgYnkgZHN0U3RlcAotICAgICAgICBNT1YgICAgICB5LCAjQkxLX1NJWkUgICAgICAgICAgICAgICAgICAgICAgICA7Ly8gT3V0ZXIgTG9vcCBDb3VudAotICAgICAgICAKLUxPT1BfREMgICAgICAgIAotICAgICAgICBTVE0gICAgICBwRHN0LCB7dFZhbDYsdFZhbDcsdFZhbDgsdFZhbDl9ICAgICA7Ly8gcERzdFswIHRvIDE1XSA9IHRWYWwgNiB0byA5Ci0gICAgICAgIFNVQlMgICAgIHksIHksICMyICAgICAgICAgICAgICAgICAgICAgICAgICAgIDsvLyB5LS0KLSAgICAgICAgQUREICAgICAgcERzdCwgcERzdCwgZHN0U3RlcHgyICAgICAgICAgICAgICAgOy8vIHBEc3QgYWR2YW5jZWQgYnkgZHN0U3RlcAotICAgICAgICBTVE0gICAgICBwRHN0Miwge3RWYWw2LHRWYWw3LHRWYWw4LHRWYWw5fSAgICA7Ly8gcERzdDJbMTYgdG8gMzFdID0gdFZhbCA2IHRvIDkKLSAgICAgICAgQUREICAgICAgcERzdDIsIHBEc3QyLCBkc3RTdGVweDIgICAgICAgICAgICAgOy8vIHBEc3QgYWR2YW5jZWQgYnkgZHN0U3RlcAotICAgICAgICBCTkUgICAgICBMT09QX0RDICAgICAgICAgICAgICAgICAgICAgICAgICAgICA7Ly8gTG9vcCBmb3IgOCB0aW1lcwotICAgICAgICAKLSAgICAgICAgTU9WICAgICAgcmV0dXJuLCAjT01YX1N0c19Ob0VycgotICAgICAgICBNX0VYSVQKLQotT01YX1ZDXzE2WDE2X1BMQU5FCi0gICAgICAgIAotICAgICA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3ZlLCAjMTFdCi0gICAgICAgIFNVQiAgICAgdFZhbDgsIHRWYWw3LCB0VmFsNgotICAgICAgICBBREQgICAgIHRWYWwxMSwgdFZhbDExLCB0VmFsOCwgTFNMICMyICAgICAgIDsvLyArIDQqWzExXS1bM10KLSAgICAgICAgTERSQiAgICB0VmFsNiwgW3BTcmNBYm92ZSwgIzRdCi0gICAgICAgIExEUkIgICAgdFZhbDcsIFtwU3JjQWJvdmUsICMxMF0KLSAgICAgICAgU1VCICAgICB0VmFsOCwgdFZhbDcsIHRWYWw2Ci0gICAgICAgIEFERCAgICAgdFZhbDgsIHRWYWw4LCB0VmFsOCwgTFNMICMxICAgICAgICAgOy8vIDMqWzEwXS1bNF0KLSAgICAgICAgQUREICAgICB0VmFsMTEsIHRWYWwxMSwgdFZhbDgKLSAgICAgICAgTERSQiAgICB0VmFsNiwgW3BTcmNBYm92ZSwgIzVdCi0gICAgICAgIExEUkIgICAgdFZhbDcsIFtwU3JjQWJvdmUsICM5XQotICAgICAgICBTVUIgICAgIHRWYWw4LCB0VmFsNywgdFZhbDYKLSAgICAgICAgQUREICAgICB0VmFsMTEsIHRWYWwxMSwgdFZhbDgsIExTTCAjMSAgICAgICA7Ly8gKyAyKls5XS1bNV0KLSAgICAgICAgTERSQiAgICB0VmFsNiwgW3BTcmNBYm92ZSwgIzZdCi0gICAgICAgIExEUkIgICAgdFZhbDcsIFtwU3JjQWJvdmUsICM4XQotICAgICAgICBTVUIgICAgIHRWYWw4LCB0VmFsNywgdFZhbDYgICAgICAgICAgICAgICAgIDsvLyAxKls4XS1bNl0KLSAgICAgICAgQUREICAgICB0VmFsNywgdFZhbDExLCB0VmFsOAotCi0gICAgICAgIEFERCAgICAgIHRWYWwyLCAgdFZhbDIsICAgIzE2ICAgICAgICAgICAgICAgIDsvLyB0VmFsMiAgPSBhICsgMTYKLSAgICAgICAgTU9WICAgICAgdFZhbDEsICBwU3JjTGVmdCAgICAgICAgICAgICAgICAgICAgOy8vIHRWYWw0IC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NHAxMiArIHtiLGJ9Ci0gICAgICAgIExEUiAgICAgIHIweDAwRkYwMEZGLCAgICAgPU1BU0tfQ09OU1QgICAgICAgIDsvLyByMHgwMEZGMDBGRiA9IDB4MDBGRjAwRkYKLSAgICAgICAgCi1MT09QX1BMQU5FICAgICAgICAKLQotICAgICAgICBVU0FUMTYgICB0ZW1wMiwgIzEzLCBwM3AxCi0gICAgICAgIFVTQVQxNiAgIHRlbXAxLCAjMTMsIHAycDAKLSAgICAgICAgU0FERDE2ICAgcDNwMSwgICBwM3AxLCAgIGMgICAgICAgICAgICAgICAgICAgIAotICAgICAgICBTQUREMTYgICBwMnAwLCAgIHAycDAsICAgYyAgICAgICAgICAgICAgICAgICAgCi0gICAgICAgIEFORCAgICAgIHRlbXAyLCByMHgwMEZGMDBGRiwgdGVtcDIsIEFTUiAjNQotICAgICAgICBBTkQgICAgICB0ZW1wMSwgcjB4MDBGRjAwRkYsIHRlbXAxLCBBU1IgIzUKLSAgICAgICAgT1JSICAgICAgdGVtcDEsIHRlbXAxLCB0ZW1wMiwgTFNMICM4Ci0gICAgICAgIFNUUiAgICAgIHRlbXAxLCBbcERzdF0sICM0Ci0gICAgICAgIAotICAgICAgICBVU0FUMTYgICB0ZW1wMiwgIzEzLCBwN3A1Ci0gICAgICAgIFVTQVQxNiAgIHRlbXAxLCAjMTMsIHA2cDQKLSAgICAgICAgU0FERDE2ICAgcDdwNSwgICBwN3A1LCAgIGMgICAgICAgICAgICAgICAgICAgIAotICAgICAgICBTQUREMTYgICBwNnA0LCAgIHA2cDQsICAgYyAgICAgICAgICAgICAgICAgICAgCi0gICAgICAgIEFORCAgICAgIHRlbXAyLCByMHgwMEZGMDBGRiwgdGVtcDIsIEFTUiAjNQotICAgICAgICBBTkQgICAgICB0ZW1wMSwgcjB4MDBGRjAwRkYsIHRlbXAxLCBBU1IgIzUKLSAgICAgICAgT1JSICAgICAgdGVtcDEsIHRlbXAxLCB0ZW1wMiwgTFNMICM4Ci0gICAgICAgIFNUUiAgICAgIHRlbXAxLCBbcERzdF0sICM0Ci0gICAgICAgIAotICAgICAgICBVU0FUMTYgICB0ZW1wMiwgIzEzLCBwMTFwOQotICAgICAgICBVU0FUMTYgICB0ZW1wMSwgIzEzLCBwMTBwOAotICAgICAgICBTQUREMTYgICBwMTFwOSwgIHAxMXA5LCAgYyAgICAgICAgICAgICAgICAgICAgCi0gICAgICAgIFNBREQxNiAgIHAxMHA4LCAgcDEwcDgsICBjICAgICAgICAgICAgICAgICAgICAKLSAgICAgICAgQU5EICAgICAgdGVtcDIsIHIweDAwRkYwMEZGLCB0ZW1wMiwgQVNSICM1Ci0gICAgICAgIEFORCAgICAgIHRlbXAxLCByMHgwMEZGMDBGRiwgdGVtcDEsIEFTUiAjNQotICAgICAgICBPUlIgICAgICB0ZW1wMSwgdGVtcDEsIHRlbXAyLCBMU0wgIzgKLSAgICAgICAgU1RSICAgICAgdGVtcDEsIFtwRHN0XSwgIzQKLSAgICAgICAgCi0gICAgICAgIFVTQVQxNiAgIHRlbXAyLCAjMTMsIHAxNXAxMwotICAgICAgICBVU0FUMTYgICB0ZW1wMSwgIzEzLCBwMTRwMTIKLSAgICAgICAgU0FERDE2ICAgcDE1cDEzLCBwMTVwMTMsIGMgICAgICAgICAgICAgICAgICAgIAotICAgICAgICBTQUREMTYgICBwMTRwMTIsIHAxNHAxMiwgYyAgICAgICAgICAgICAgICAgICAgCi0gICAgICAgIEFORCAgICAgIHRlbXAyLCByMHgwMEZGMDBGRiwgdGVtcDIsIEFTUiAjNQotICAgICAgICBBTkQgICAgICB0ZW1wMSwgcjB4MDBGRjAwRkYsIHRlbXAxLCBBU1IgIzUKLSAgICAgICAgT1JSICAgICAgdGVtcDEsIHRlbXAxLCB0ZW1wMiwgTFNMICM4Ci0gICAgICAgIFNUUiAgICAgIHRlbXAxLCBbcERzdF0sICM0Ci0gICAgICAgIAotICAgICAgICBBRERTICAgICByMHgwMEZGMDBGRiwgcjB4MDBGRjAwRkYsICMxPDwyOCAgIC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hlIHZhbCBpbiBhbGwgdGhlIGJ5dGVzCi0gICAgICAgIE1VTCAgICAgIE91dDIsICAgTGVmdDIsICAgcjB4MDEwMTAxMDEgICAgICAgIDsvLyByZXBsaWNhdGUgdGhlIHZhbCBpbiBhbGwgdGhlIGJ5dGVzCi0gICAgICAgIE1VTCAgICAgIE91dDMsICAgTGVmdDMsICAgcjB4MDEwMTAxMDEgICAgICAgIDsvLyByZXBsaWNhdGUgdGhlIHZhbCBpbiBhbGwgdGhlIGJ5dGVzCi0gICAgICAgIE1fU1RSICAgIE91dDAsICAgW3BEc3RdLCAgZHN0U3RlcCAgICAgICAgICAgIDsvLyBzdG9yZSB7T3V0MH0gYXQgcERzdCBbMCAgdG8gMyBdIAotICAgICAgICBNX1NUUiAgICBPdXQxLCAgIFtwRHN0XSwgIGRzdFN0ZXAgICAgICAgICAgICA7Ly8gc3RvcmUge091dDF9IGF0IHBEc3QgWzQgIHRvIDcgXQotICAgICAgICBNX1NUUiAgICBPdXQyLCAgIFtwRHN0XSwgIGRzdFN0ZXAgICAgICAgICAgICA7Ly8gc3RvcmUge091dDJ9IGF0IHBEc3QgWzggIHRvIDExXQotICAgICAgICBTVFIgICAgICBPdXQzLCAgIFtwRHN0XSAgICAgICAgICAgICAgICAgICAgICA7Ly8gc3RvcmUge091dDN9IGF0IHBEc3QgWzEyIHRvIDE1XQotICAgICAgICBNT1YgICAgICByZXR1cm4sICNPTVhfU3RzX05vRXJyCi0gICAgICAgIE1fRVhJVCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDsvLyBNYWNybyB0byBleGl0IG1pZHdheS1icmVhayBmcm0gY2FzZQotICAgICAgICAKLU9NWF9WQ180eDRfREMKLSAgICAgICAgCi0gICAgICAgIDsvLyBNX1NUQUxMIEFSTTExMzZKUz02Ci0gICAgICAgIAotICAgICAgICBBTkQgICAgICBhdmFpbGFiaWxpdHksICBhdmFpbGFiaWxpdHksICAjKE9NWF9WQ19VUFBFUiArIE9NWF9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ly8gTGVmdDIgPSBwU3JjTGVmdFsyXQotICAgICAgICBMRFJCICAgICBMZWZ0MywgIFtwU3JjTGVmdF0gICAgICAgICAgICAgICAgICA7Ly8gTGVmdDMgPSBwU3JjTGVmdFszXQotICAgICAgICBVWFRIICAgICB0VmFsMTEsIHRWYWwxMSAgICAgICAgICAgICAgICAgICAgICA7Ly8gdXBzdW0xIChDbGVhciB0aGUgdG9wIGp1bmsgYml0cykKLSAgICAgICAgQUREICAgICAgdFZhbDYsICBMZWZ0MCwgIExlZnQxICAgICAgICAgICAgICAgOy8vIHRWYWw2ID0gTGVmdDAgKyBMZWZ0MQotICAgICAgICBBREQgICAgICB0VmFsNywgIExlZnQyLCAgTGVmdDMgICAgICAgICAgICAgICA7Ly8gdFZhbDcgPSBMZWZ0MiArIExlZnQzCi0gICAgICAgIEFERCAgICAgIHRWYWw2LCAgdFZhbDYsICB0VmFsNyAgICAgICAgICAgICAgIDsvLyB0VmFsNiA9IHRWYWw2ICsgdFZhbDcKLSAgICAgICAgQUREICAgICAgT3V0MCwgICB0VmFsNiwgIHRWYWwxMSAgICAgICAgICAgICAgOy8vIE91dDAgID0gdFZhbDYgKyB0VmFsMTEgICAKLSAgICAgICAgQUREICAgICAgT3V0MCwgICBPdXQwLCAgICM0ICAgICAgICAgICAgICAgICAgOy8vIE91dDAgID0gT3V0MCArIDQKLSAgICAgICAgTERSICAgICAgcjB4MDEwMTAxMDEsICAgPU1VTF9DT05TVDAgICAgICAgICAgOy8vIDB4MDEwMTAxMDEKLSAgICAgICAgTU9WICAgICAgT3V0MCwgICBPdXQwLCAgTFNSICMzICAgICAgICAgICAgICAgOy8vIE91dDAgPSAoT3V0MCArIDQpPj4zCi0gICAgICAgIAotICAgICAgICA7Ly8gTV9TVEFMTCBBUk0xMTM2SlM9MQotICAgICAgICAKLSAgICAgICAgTVVMICAgICAgT3V0MCwgICBPdXQwLCAgcjB4MDEwMTAxMDEgICAgICAgICAgOy8vIHJlcGxpY2F0ZSB0aGUgdmFsIGluIGFsbCB0aGUgYnl0ZXMKLSAgICAgICAgCi0gICAgICAgIDsvLyBNX1NUQUxMIEFSTTExMzZKUz0xCi0gICAgICAgIAotICAgICAgICBNT1YgICAgICByZXR1cm4sICAjT01YX1N0c19Ob0VycgotICAgICAgICBNX1NUUiAgICBPdXQwLCAgIFtwRHN0XSwgIGRzdFN0ZXAgICAgICAgICAgICA7Ly8gc3RvcmUge091dDB9IGF0IHBEc3QgWzAgIHRvIDMgXQotICAgICAgICBNX1NUUiAgICBPdXQwLCAgIFtwRHN0XSwgIGRzdFN0ZXAgICAgICAgICAgICA7Ly8gc3RvcmUge091dDB9IGF0IHBEc3QgWzQgIHRvIDcgXQotICAgICAgICBNX1NUUiAgICBPdXQwLCAgIFtwRHN0XSwgIGRzdFN0ZXAgICAgICAgICAgICA7Ly8gc3RvcmUge091dDB9IGF0IHBEc3QgWzggIHRvIDExXQotICAgICAgICBTVFIgICAgICBPdXQwLCAgIFtwRHN0XSAgICAgICAgICAgICAgICAgICAgICA7Ly8gc3RvcmUge091dDB9IGF0IHBEc3QgWzEyIHRvIDE1XQotICAgICAgICBNX0VYSVQgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA7Ly8gTWFjcm8gdG8gZXhpdCBtaWR3YXktYnJlYWsgZnJtIGNhc2UKLSAgICAgICAgCi1VcHBlck9yTGVmdE9yTm9uZUF2YWlsYWJsZQotICAgICAgICA7Ly8gTV9TVEFMTCBBUk0xMTM2SlM9MwotICAgICAgICAKLSAgICAgICAgQ01QICAgICAgYXZhaWxhYmlsaXR5LCAgI09NWF9WQ19VUFBFUiAgICAgICAgOy8vIGlmKGF2YWlsYWJpbGl0eSAmICNPTVhfVkNfVVBQRVIpCi0gICAgICAgIEJORSAgICAgIExlZnRPck5vbmVBdmFpbGFibGUgICAgICAgICAgICAgICAgIDsvLyBKdW1wIHRvIExlZnQgaWYgbm90IHVwcGVyCi0gICAgICAgIExEUiAgICAgIEFib3ZlMDEyMywgIFtwU3JjQWJvdmVdICAgICAgICAgICAgIDsvLyBBYm92ZTAxMjMgID0gcFNyY0Fib3ZlWzAgdG8gM10KLSAgICAgICAgCi0gICAgICAgIDsvLyBNX1NUQUxMIEFSTTExMzZKUz0zCi0gICAgICAgIAotICAgICAgICBVWFRCMTYgICB0VmFsNywgIEFib3ZlMDEyMyAgICAgICAgICAgICAgICAgICA7Ly8gcFNyY0Fib3ZlWzAsIDJdCi0gICAgICAgIFVYVEIxNiAgIHRWYWw2LCAgQWJvdmUwMTIzLCAgUk9SICM4ICAgICAgICAgIDsvLyBwU3JjQWJvdmVbMSwgM10KLSAgICAgICAgVUFERDE2ICAgT3V0MCwgICB0VmFsNiwgIHRWYWw3ICAgICAgICAgICAgICAgOy8vIHBTcmNBYm92ZVswLCAyXSArIHBTcmNBYm92ZVsxLCAzXQotICAgICAgICBMRFIgICAgICByMHgwMTAxMDEwMSwgICA9TVVMX0NPTlNUMCAgICAgICAgICA7Ly8gMHgwMTAxMDEwMQotICAgICAgICBBREQgICAgICBPdXQwLCAgIE91dDAsICAgTFNSICMxNiAgICAgICAgICAgICA7Ly8gc3VtKHBTcmNBYm92ZVswXSB0byBwU3JjQWJvdmVbM10pCi0gICAgICAgIAotICAgICAgICA7Ly8gTV9TVEFMTCBBUk0xMTM2SlM9MQotICAgICAgICAKLSAgICAgICAgVVhUSCAgICAgT3V0MCwgICBPdXQwICAgICAgICAgICAgICAgICAgICAgICAgOy8vIHVwc3VtMSAoQ2xlYXIgdGhlIHRvcCBqdW5rIGJpdHMpCi0gICAgICAgIEFERCAgICAgIE91dDAsICAgT3V0MCwgICAjMiAgICAgICAgICAgICAgICAgIDsvLyBPdXQwICA9IE91dDAgKyAyCi0gICAgICAgIAotICAgICAgICA7Ly8gTV9TVEFMTCBBUk0xMTM2SlM9MQotICAgICAgICAKLSAgICAgICAgTU9WICAgICAgT3V0MCwgICBPdXQwLCAgIExTUiAjMiAgICAgICAgICAgICAgOy8vIE91dDAgID0gKE91dDAgKyAyKT4+MgotICAgICAgICAKLSAgICAgICAgOy8vIE1fU1RBTEwgQVJNMTEzNkpTPTEKLSAgICAgICAgCi0gICAgICAgIE1VTCAgICAgIE91dDAsICAgT3V0MCwgICByMHgwMTAxMDEwMSAgICAgICAgIDsvLyByZXBsaWNhdGUgdGhlIHZhbCBpbiBhbGwgdGhlIGJ5dGVzCi0gICAgICAgIAotICAgICAgICA7Ly8gTV9TVEFMTCBBUk0xMTM2SlM9MQotICAgICAgICAKLSAgICAgICAgTU9WICAgICAgcmV0dXJuLCAjT01YX1N0c19Ob0VycgotICAgICAgICBNX1NUUiAgICBPdXQwLCAgIFtwRHN0XSwgIGRzdFN0ZXAgICAgICAgICAgICA7Ly8gc3RvcmUge3RWYWw2fSBhdCBwRHN0IFswICB0byAzIF0KLSAgICAgICAgTV9TVFIgICAgT3V0MCwgICBbcERzdF0sICBkc3RTdGVwICAgICAgICAgICAgOy8vIHN0b3JlIHt0VmFsNn0gYXQgcERzdCBbNCAgdG8gNyBdIAotICAgICAgICBNX1NUUiAgICBPdXQwLCAgIFtwRHN0XSwgIGRzdFN0ZXAgICAgICAgICAgICA7Ly8gc3RvcmUge3RWYWw2fSBhdCBwRHN0IFs4ICB0byAxMV0KLSAgICAgICAgU1RSICAgICAgT3V0MCwgICBbcERzdF0gICAgICAgICAgICAgICAgICAgICAgOy8vIHN0b3JlIHt0VmFsNn0gYXQgcERzdCBbMTIgdG8gMTVdCi0gICAgICAgIAotICAgICAgICBNX0VYSVQgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA7Ly8gTWFjcm8gdG8gZXhpdCBtaWR3YXktYnJlYWsgZnJtIGNhc2UKLSAgICAgICAgCi1MZWZ0T3JOb25lQXZhaWxhYmxlICAgICAgICAKLSAgICAgICAgOy8vIE1fU1RBTEwgQVJNMTEzNkpTPTMKLSAgICAgICAgCi0gICAgICAgIExEUiAgICAgIHIweDAxMDEwMTAxLCAgID1NVUxfQ09OU1QwICAgICAgICAgIDsvLyAweDAxMDEwMTAxCi0gICAgICAgIENNUCAgICAgIGF2YWlsYWJpbGl0eSwgI09NWF9WQ19MRUZUCi0gICAgICAgIEJORSAgICAgIE5vbmVBdmFpbGFibGUKLSAgICAgICAgTV9MRFJCICAgTGVmdDAsICBbcFNyY0xlZnRdLCAgbGVmdFN0ZXAgICAgICAgOy8vIExlZnQwID0gcFNyY0xlZnRbMF0KLSAgICAgICAgTV9MRFJCICAgTGVmdDEsICBbcFNyY0xlZnRdLCAgbGVmdFN0ZXAgICAgICAgOy8vIExlZnQxID0gcFNyY0xlZnRbMV0KLSAgICAgICAgTV9MRFJCICAgTGVmdDIsICBbcFNyY0xlZnRdLCAgbGVmdFN0ZXAgICAgICAgOy8vIExlZnQyID0gcFNyY0xlZnRbMl0KLSAgICAgICAgTERSQiAgICAgTGVmdDMsICBbcFNyY0xlZnRdICAgICAgICAgICAgICAgICAgOy8vIExlZnQzID0gcFNyY0xlZnRbM10KLSAgICAgICAgQUREICAgICAgT3V0MCwgICBMZWZ0MCwgIExlZnQxICAgICAgICAgICAgICAgOy8vIE91dDAgID0gTGVmdDAgKyBMZWZ0MQotICAgICAgICAKLSAgICAgICAgOy8vIE1fU1RBTEwgQVJNMTEzNkpTPTEKLSAgICAgICAgCi0gICAgICAgIEFERCAgICAgIE91dDEsICAgTGVmdDIsICBMZWZ0MyAgICAgICAgICAgICAgIDsvLyBPdXQxICA9IExlZnQyICsgTGVmdDMKLSAgICAgICAgQUREICAgICAgT3V0MCwgICBPdXQwLCAgIE91dDEgICAgICAgICAgICAgICAgOy8vIE91dDAgID0gT3V0MCAgKyBPdXQxCi0gICAgICAgIEFERCAgICAgIE91dDAsICAgT3V0MCwgICAjMiAgICAgICAgICAgICAgICAgIDsvLyBPdXQwICA9IE91dDAgKyAyCi0gICAgICAgIAotICAgICAgICA7Ly8gTV9TVEFMTCBBUk0xMTM2SlM9MQotICAgICAgICAKLSAgICAgICAgTU9WICAgICAgT3V0MCwgICBPdXQwLCAgIExTUiAjMiAgICAgICAgICAgICAgOy8vIE91dDAgID0gKE91dDAgKyAyKT4+MgotICAgICAgICAKLSAgICAgICAgOy8vIE1fU1RBTEwgQVJNMTEzNkpTPTEKLSAgICAgICAgCi0gICAgICAgIE1VTCAgICAgIE91dDAsICAgT3V0MCwgICByMHgwMTAxMDEwMSAgICAgICAgIDsvLyByZXBsaWNhdGUgdGhlIHZhbCBpbiBhbGwgdGhlIGJ5dGVzCi0gICAgICAgIAotICAgICAgICA7Ly8gTV9TVEFMTCBBUk0xMTM2SlM9MQotICAgICAgICAKLSAgICAgICAgTU9WICAgICAgcmV0dXJuLCAjT01YX1N0c19Ob0VycgotICAgICAgICBNX1NUUiAgICBPdXQwLCAgIFtwRHN0XSwgIGRzdFN0ZXAgICAgICAgICAgICA7Ly8gc3RvcmUge091dDB9IGF0IHBEc3QgWzAgIHRvIDMgXQotICAgICAgICBNX1NUUiAgICBPdXQwLCAgIFtwRHN0XSwgIGRzdFN0ZXAgICAgICAgICAgICA7Ly8gc3RvcmUge091dDB9IGF0IHBEc3QgWzQgIHRvIDcgXSAKLSAgICAgICAgTV9TVFIgICAgT3V0MCwgICBbcERzdF0sICBkc3RTdGVwICAgICAgICAgICAgOy8vIHN0b3JlIHtPdXQwfSBhdCBwRHN0IFs4ICB0byAxMV0KLSAgICAgICAgU1RSICAgICAgT3V0MCwgICBbcERzdF0gICAgICAgICAgICAgICAgICAgICAgOy8vIHN0b3JlIHtPdXQwfSBhdCBwRHN0IFsxMiB0byAxNV0KLSAgICAgICAgTV9FWElUICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOy8vIE1hY3JvIHRvIGV4aXQgbWlkd2F5LWJyZWFrIGZybSBjYXNlCi0KLU5vbmVBdmFpbGFibGUKLSAgICAgICAgTU9WICAgICAgT3V0MCwgICAjMTI4ICAgICAgICAgICAgICAgICAgICAgICAgOy8vIE91dDAgPSAxMjggaWYoY291bnQgPT0gMCkKLSAgICAgICAgCi0gICAgICAgIDsvLyBNX1NUQUxMIEFSTTExMzZKUz01Ci0gICAgICAgIAotICAgICAgICBNVUwgICAgICBPdXQwLCAgIE91dDAsICByMHgwMTAxMDEwMSAgICAgICAgICA7Ly8gcmVwbGljYXRlIHRoZSB2YWwgaW4gYWxsIHRoZSBieXRlcwotICAgICAgICAKLSAgICAgICAgOy8vIE1fU1RBTEwgQVJNMTEzNkpTPTEKLSAgICAgICAgCi0gICAgICAgIE1PViAgICAgIHJldHVybiwgI09NWF9TdHNfTm9FcnIKLSAgICAgICAgTV9TVFIgICAgT3V0MCwgICBbcERzdF0sICBkc3RTdGVwICAgICAgICAgICAgOy8vIHN0b3JlIHtPdXQwfSBhdCBwRHN0IFswICB0byAzIF0KLSAgICAgICAgTV9TVFIgICAgT3V0MCwgICBbcERzdF0sICBkc3RTdGVwICAgICAgICAgICAgOy8vIHN0b3JlIHtPdXQwfSBhdCBwRHN0IFs0ICB0byA3IF0gCi0gICAgICAgIE1fU1RSICAgIE91dDAsICAgW3BEc3RdLCAgZHN0U3RlcCAgICAgICAgICAgIDsvLyBzdG9yZSB7T3V0MH0gYXQgcERzdCBbOCAgdG8gMTFdCi0gICAgICAgIFNUUiAgICAgIE91dDAsICAgW3BEc3RdICAgICAgICAgICAgICAgICAgICAgIDsvLyBzdG9yZSB7T3V0MH0gYXQgcERzdCBbMTIgdG8gMTVdCi0gICAgICAgIE1fRVhJVCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDsvLyBNYWNybyB0byBleGl0IG1pZHdheS1icmVhayBmcm0gY2FzZQotICAgICAgICAKLU9NWF9WQ180eDRfRElBR19ETAotICAgICAgICAKLSAgICAgICAgOy8vLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tCi0gICAgICAgIDsvLyBmID0gKGErMipiK2MrMik+PjIKLSAgICAgICAgOy8vIENhbGN1bGF0ZSBhczoKLSAgICAgICAgOy8vIGQgPSAoYSArIGMgKT4+MQotICAgICAgICA7Ly8gZSA9IChkIC0gYicpPj4xCi0gICAgICAgIDsvLyBmID0gZSArIDEyOAotICAgICAgICA7Ly8tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0KLSAgICAgICAgCi0gICAgICAgIDsvLyBNX1NUQUxMIEFSTTExMzZKUz0zCi0gICAgICAgIAotICAgICAgICBUU1QgICAgICBhdmFpbGFiaWxpdHksICNPTVhfVkNfVVBQRVJfUklHSFQgICAgICAgICAgICAgICAgICAKLSAgICAgICAgTERNSUEgICAgcFNyY0Fib3ZlLCAge0Fib3ZlMDEyMywgQWJvdmU0NTY3fSAgOy8vIEFib3ZlMDEyMywgQWJvdmU0NTY3ID0gcFNyY0Fib3ZlWzAgdG8gN10KLSAgICAgICAgTERSICAgICAgcjB4ODA4MDgwODAsICA9QUREX0NPTlNUMSAgICAgICAgICAgOy8vIDB4ODA4MDgwODAKLSAgICAgICAgQk5FICAgICAgRExVcHBlclJpZ2h0QXZhaWxhYmxlCi0gICAgICAgIExEUiAgICAgIHIweDAxMDEwMTAxLCAgPU1VTF9DT05TVDAgICAgICAgICAgIDsvLyAweDAxMDEwMTAxCi0gICAgICAgIE1PViAgICAgIHRWYWw3LCAgQWJvdmUwMTIzLCAgTFNSICMyNCAgICAgICAgIDsvLyB7MDAsICAwMCwgIDAwLCAgVTMgfQotICAgICAgICBNT1YgICAgICB0VmFsMTEsIHRWYWw3LCAgTFNMICMyNCAgICAgICAgICAgICA7Ly8ge1UzLCAgMDAsICAwMCwgIDAwIH0KLSAgICAgICAgTVVMICAgICAgT3V0MywgICB0VmFsNywgIHIweDAxMDEwMTAxICAgICAgICAgOy8vIHtVMywgIFUzLCAgVTMsICBVMyB9IAotICAgICAgICBNT1YgICAgICB0VmFsOCwgIEFib3ZlMDEyMywgIExTUiAjMTYgICAgICAgICA7Ly8gezAwLCAgMDAsICBVMywgIFUyIH0KLSAgICAgICAgTU9WICAgICAgdFZhbDEwLCBBYm92ZTAxMjMsICBMU1IgIzggICAgICAgICAgOy8vIHswMCwgIFUzLCAgVTIsICBVMSB9Ci0gICAgICAgIE1WTiAgICAgIHRWYWwxMCwgdFZhbDEwICAgICAgICAgICAgICAgICAgICAgIDsvLyB7MDAnLCBVMycsIFUyJywgVTEnfQotICAgICAgICBVSEFERDggICB0VmFsOCwgIHRWYWw4LCAgQWJvdmUwMTIzICAgICAgICAgICA7Ly8ge3h4LCAgeHgsICBkMSwgIGQwIH0KLSAgICAgICAgVUhBREQ4ICAgdFZhbDYsICBBYm92ZTAxMjMsICB0VmFsOSAgICAgICAgICAgOy8vIHt4eCwgIGQyLCAgeHgsICB4eCB9Ci0gICAgICAgIFVIU1VCOCAgIHRWYWw4LCAgdFZhbDgsICB0VmFsMTAgICAgICAgICAgICAgIDsvLyB7eHgsICB4eCwgIGUxLCAgZTAgfQotICAgICAgICBVSFNVQjggICB0VmFsNiwgIHRWYWw2LCAgdFZhbDEwICAgICAgICAgICAgICA7Ly8ge3h4LCAgZTIsICB4eCwgIHh4IH0KLSAgICAgICAgVUFERDggICAgdFZhbDgsICB0VmFsOCwgIHIweDgwODA4MDgwICAgICAgICAgOy8vIHt4eCwgIHh4LCAgZjEsICBmMCB9Ci0gICAgICAgIFVBREQ4ICAgIHRWYWw2LCAgdFZhbDYsICByMHg4MDgwODA4MCAgICAgICAgIDsvLyB7eHgsICBmMiwgIHh4LCAgeHggfQotICAgICAgICAKLSAgICAgICAgOy8vIE1fU1RBTEwgQVJNMTEzNkpTPTEKLSAgICAgICAgCi0gICAgICAgIFBLSEJUICAgIHRWYWw2LCAgdFZhbDgsICB0VmFsNiAgICAgICAgICAgICAgIDsvLyB7eHgsICBmMiwgIGYxLCAgZjAgfQotICAgICAgICBCSUMgICAgICB0VmFsNiwgIHRWYWw2LCAgIzB4RkYwMDAwMDAgICAgICAgICA7Ly8gezAwLCAgZjIsICBmMSwgIGYwIH0KLSAgICAgICAgT1JSICAgICAgT3V0MCwgICB0VmFsNiwgIHRWYWwxMSAgICAgICAgICAgICAgOy8vIHtVMywgIGYyLCAgZjEsICBmMCB9Ci0gICAgICAgIAotICAgICAgICA7Ly8gTV9TVEFMTCBBUk0xMTM2SlM9MQotICAgICAgICAKLSAgICAgICAgUEtIVEIgICAgT3V0MSwgICBPdXQzLCAgIE91dDAsICBBU1IgIzggICAgICAgOy8vIHtVMywgIFUzLCAgZjIsICBmMSB9Ci0gICAgICAgIE1PViAgICAgIHJldHVybiwgI09NWF9TdHNfTm9FcnIKLSAgICAgICAgUEtIVEIgICAgT3V0MiwgICBPdXQzLCAgIE91dDEsICBBU1IgIzggICAgICAgOy8vIHtVMywgIFUzLCAgVTMsICBmMiB9Ci0gICAgICAgIAotICAgICAgICBNX1NUUiAgICBPdXQwLCAgIFtwRHN0XSwgZHN0U3RlcCAgICAgICAgICAgICA7Ly8gc3RvcmUge2YzIHRvIGYwfSBhdCBwRHN0WzMgIHRvIDAgXQotICAgICAgICBNX1NUUiAgICBPdXQxLCAgIFtwRHN0XSwgZHN0U3RlcCAgICAgICAgICAgICA7Ly8gc3RvcmUge2Y0IHRvIGYxfSBhdCBwRHN0WzcgIHRvIDQgXQotICAgICAgICBNX1NUUiAgICBPdXQyLCAgIFtwRHN0XSwgZHN0U3RlcCAgICAgICAgICAgICA7Ly8gc3RvcmUge2Y1IHRvIGYyfSBhdCBwRHN0WzExIHRvIDggXQotICAgICAgICBTVFIgICAgICBPdXQzLCAgIFtwRHN0XSAgICAgICAgICAgICAgICAgICAgICA7Ly8gc3RvcmUge2Y2IHRvIGYzfSBhdCBwRFN0WzE1IHRvIDEyXQotICAgICAgICBNX0VYSVQgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA7Ly8gTWFjcm8gdG8gZXhpdCBtaWR3YXktYnJlYWsgZnJtIGNhc2UKLQotRExVcHBlclJpZ2h0QXZhaWxhYmxlICAgICAgICAKLSAgICAgICAgCi0gICAgICAgIE1PViAgICAgIHRWYWw4LCAgQWJvdmUwMTIzLCAgTFNSICMyNCAgICAgICAgIDsvLyB7MDAsICAwMCwgIDAwLCAgVTMgfQotICAgICAgICBNT1YgICAgICB0VmFsOSwgIEFib3ZlMDEyMywgIExTUiAjMTYgICAgICAgICA7Ly8gezAwLCAgMDAsICBVMywgIFUyIH0KLSAgICAgICAgTU9WICAgICAgdFZhbDEwLCBBYm92ZTAxMjMsICBMU1IgIzggICAgICAgICAgOy8vIHswMCwgIFUzLCAgVTIsICBVMSB9Ci0gICAgICAgIE9SUiAgICAgIHRWYWw4LCAgdFZhbDgsICBBYm92ZTQ1NjcsIExTTCAjOCAgIDsvLyB7VTYsICBVNSwgIFU0LCAgVTMgfQotICAgICAgICBPUlIgICAgICB0VmFsMTAsIHRWYWwxMCwgQWJvdmU0NTY3LCBMU0wgIzI0ICA7Ly8ge1U0LCAgVTMsICBVMiwgIFUxIH0KLSAgICAgICAgUEtIQlQgICAgdFZhbDksICB0VmFsOSwgIEFib3ZlNDU2NywgTFNMICMxNiAgOy8vIHtVNSwgIFU0LCAgVTMsICBVMiB9Ci0gICAgICAgIE1WTiAgICAgIHRWYWwxLCAgdFZhbDggICAgICAgICAgICAgICAgICAgICAgIDsvLyB7VTYnLCBVNScsIFU0JywgVTMnfQotICAgICAgICBNVk4gICAgICB0VmFsMTAsIHRWYWwxMCAgICAgICAgICAgICAgICAgICAgICA7Ly8ge1U0JywgVTMnLCBVMicsIFUxJ30KLSAgICAgICAgTVZOICAgICAgdFZhbDIsICBBYm92ZTQ1NjcgICAgICAgICAgICAgICAgICAgOy8vIHtVNycsIFU2JywgVTUnLCBVNCd9Ci0gICAgICAgIFVIQUREOCAgIHRWYWw2LCAgQWJvdmUwMTIzLCAgdFZhbDkgICAgICAgICAgIDsvLyB7ZDMsICBkMiwgIGQxLCAgZDAgfQotICAgICAgICBVSEFERDggICB0VmFsOSwgIHRWYWw5LCAgQWJvdm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SUiAgICAgIE91dDMsICAgdFZhbDksICBPdXQyLCAgTFNSICM4ICAgICAgIDsvLyB7ZjYsICBmNSwgIGY0LCAgZjMgfQotICAgICAgICBNX1NUUiAgICBPdXQwLCAgIFtwRHN0XSwgZHN0U3RlcCAgICAgICAgICAgICA7Ly8gc3RvcmUge2YzIHRvIGYwfSBhdCBwRHN0WzMgIHRvIDAgXQotICAgICAgICBNX1NUUiAgICBPdXQxLCAgIFtwRHN0XSwgZHN0U3RlcCAgICAgICAgICAgICA7Ly8gc3RvcmUge2Y0IHRvIGYxfSBhdCBwRHN0WzcgIHRvIDQgXQotICAgICAgICBNX1NUUiAgICBPdXQyLCAgIFtwRHN0XSwgZHN0U3RlcCAgICAgICAgICAgICA7Ly8gc3RvcmUge2Y1IHRvIGYyfSBhdCBwRHN0WzExIHRvIDggXQotICAgICAgICBTVFIgICAgICBPdXQzLCAgIFtwRHN0XSAgICAgICAgICAgICAgICAgICAgICA7Ly8gc3RvcmUge2Y2IHRvIGYzfSBhdCBwRFN0WzE1IHRvIDEyXQotICAgICAgICBNT1YgICAgICByZXR1cm4sICNPTVhfU3RzX05vRXJyCi0gICAgICAgIE1fRVhJVCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDsvLyBNYWNybyB0byBleGl0IG1pZHdheS1icmVhayBmcm0gY2FzZQotICAgICAgICAKLQotT01YX1ZDXzR4NF9ESUFHX0RSCi0gICAgICAgIAotICAgICAgICA7Ly8gTV9TVEFMTCBBUk0xMTM2SlM9NAotICAgICAgICAKLSAgICAgICAgTV9MRFJCICAgTGVmdDAsICBbcFNyY0xlZnRdLCAgbGVmdFN0ZXAgICAgICAgOy8vIExlZnQwID0gcFNyY0xlZnRbMF0KLSAgICAgICAgTV9MRFJCICAgTGVmdDEsICBbcFNyY0xlZnRdLCAgbGVmdFN0ZXAgICAgICAgOy8vIExlZnQxID0gcFNyY0xlZnRbMV0KLSAgICAgICAgTV9MRFJCICAgTGVmdDIsICBbcFNyY0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ICAgICAgOy8vIHRWYWwxMD0gaDAgaDEgaDIgaDMKLSAgICAgICAgVUFERDggICAgT3V0MywgICB0VmFsMTAsIHIweDgwODA4MDgwICAgICAgICAgOy8vIE91dDMgID0gaTAgaTEgaTIgaTMKLSAgICAgICAgVUFERDggICAgT3V0MCwgICB0VmFsMTEsIHIweDgwODA4MDgwICAgICAgICAgOy8vIE91dDAgID0gZjEgZjAgZkwgaTAKLSAgICAgICAgVVhUSCAgICAgdFZhbDExLCBPdXQzLCAgIFJPUiAjOCAgICAgICAgICAgICAgOy8vIHRWYWwxMT0gMDAgMDAgaTEgaTIKLSAgICAgICAgTU9WICAgICAgdFZhbDcsICBPdXQwLCAgIExTTCAjOCAgICAgICAgICAgICAgOy8vIHRWYWw3ID0gZjAgZkwgaTAgMDAKLSAgICAgICAgT1JSICAgICAgT3V0MSwgICB0VmFsNywgIHRWYWwxMSwgIExTUiAjOCAgICAgOy8vIE91dDEgID0gZjAgZkwgaTAgaTEKLSAgICAgICAgUEtIQlQgICAgT3V0MiwgICB0VmFsMTEsIE91dDAsICAgIExTTCAjMTYgICAgOy8vIE91dDIgID0gZkwgaTAgaTEgaTIKLSAgICAgICAgTV9TVFIgICAgT3V0MCwgICBbcERzdF0sIGRzdFN0ZXAgICAgICAgICAgICAgOy8vIHN0b3JlIHtmMSB0byBpMH0gYXQgcERzdFszICB0byAwIF0KLSAgICAgICAgTV9TVFIgICAgT3V0MSwgICBbcERzdF0sIGRzdFN0ZXAgICAgICAgICAgICAgOy8vIHN0b3JlIHtmMCB0byBpMX0gYXQgcERzdFs3ICB0byA0IF0KLSAgICAgICAgTV9TVFIgICAgT3V0MiwgICBbcERzdF0sIGRzdFN0ZXAgICAgICAgICAgICAgOy8vIHN0b3JlIHtmTCB0byBpMn0gYXQgcERzdFsxMSB0byA4IF0KLSAgICAgICAgU1RSICAgICAgT3V0MywgICBbcERzdF0gICAgICAgICAgICAgICAgICAgICAgOy8vIHN0b3JlIHtpMCB0byBpM30gYXQgcERzdFsxNSB0byAxMl0gCi0gICAgICAgIE1PViAgICAgIHJldHVybiwgICNPTVhfU3RzX05vRXJyCi0gICAgICAgIE1fRVhJVCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDsvLyBNYWNybyB0byBleGl0IG1pZHdheS1icmVhayBmcm0gY2FzZQotCi1PTVhfVkNfNHg0X1ZSCi0KLSAgICAgICAgOy8vIE1fU1RBTEwgQVJNMTEzNkpTPTQKLSAgICAgICAgCi0gICAgICAgIExEUiAgICAgIEFib3ZlMDEyMywgIFtwU3JjQWJvdmVdICAgICAgICAgICAgIDsvLyBBYm92ZTAxMjMgPSBVMyBVMiBVMSBVMAotICAgICAgICBMRFJCICAgICBBYm92ZUxlZnQsICBbcFNyY0Fib3ZlTGVmdF0gICAgICAgICA7Ly8gQWJvdmVMZWZ0ID0gMDAgMDAgMDAgVUwKLSAgICAgICAgTV9MRFJCICAgTGVmdDAsICBbcFNyY0xlZnRdLCAgbGVmdFN0ZXAgICAgICAgOy8vIExlZnQwICAgICA9IDAwIDAwIDAwIEwwCi0gICAgICAgIE1fTERSQiAgIExlZnQxLCAgW3BTcmNMZWZ0XSwgIGxlZnRTdGVwICAgICAgIDsvLyBMZWZ0MSAgICAgPSAwMCAwMCAwMCBMMQotICAgICAgICBMRFJCICAgICBMZWZ0MiwgIFtwU3JjTGVmdF0gICAgICAgICAgICAgICAgICA7Ly8gTGVmdDIgICAgID0gMDAgMDAgMDAgTDIKLSAgICAgICAgTU9WICAgICAgdFZhbDAsICBBYm92ZTAxMjMsICBMU0wgIzggICAgICAgICAgOy8vIHRWYWwwICAgICA9IFUyIFUxIFUwIDAwCi0gICAgICAgIE1PViAgICAgIHRWYWw5LCAgQWJvdmUwMTIzICAgICAgICAgICAgICAgICAgIDsvLyB0VmFsOSAgICAgPSBVMyBVMiBVMSBVMCAKLSAgICAgICAgT1JSICAgICAgdFZhbDE0LCB0VmFsMCwgICBBYm92ZUxlZnQgICAgICAgICAgOy8vIHRWYWwxNCAgICA9IFUyIFUxIFUwIFVMCi0gICAgICAgIE1WTiAgICAgIHRWYWwxMSwgdFZhbDE0ICAgICAgICAgICAgICAgICAgICAgIDsvLyB0VmFsMTEgICAgPSBVMidVMSdVMCdVTCcKLSAgICAgICAgTU9WICAgICAgdFZhbDIsICB0VmFsMTQsICBMU0wgIzggICAgICAgICAgICAgOy8vIHRWYWwyICAgICA9IFUxIFUwIFVMIDAwCi0gICAgICAgIFVIU1VCOCAgIHRWYWwxLCAgQWJvdmUwMTIzLCAgdFZhbDExICAgICAgICAgIDsvLyB0VmFsMSAgICAgPSBkMiBkMSBkMCBkTAotICAgICAgICBVSEFERDggICB0VmFsMTAsIEFib3ZlTGVmdCwgTGVmdDEgICAgICAgICAgICA7Ly8gdFZhbDEwICAgID0gMDAgMDAgMDAgajEgICAgICAgCi0gICAgICAgIE1WTiAgICAgIHRWYWw0LCAgTGVmdDAgICAgICAgICAgICAgICAgICAgICAgIDsvLyB0VmFsNCAgICAgPSAwMCAwMCAwMCBMMCcKLSAgICAgICAgVUhTVUI4ICAgdFZhbDQsICB0VmFsMTAsICB0VmFsNCAgICAgICAgICAgICAgOy8vIHRWYWw0ICAgICA9IDAwIDAwIDAwIGsxCi0gICAgICAgIE9SUiAgICAgIHRWYWwxMiwgdFZhbDAsICAgTGVmdDAgICAgICAgICAgICAgIDsvLyB0VmFsMTIgICAgPSBVMiBVMSBVMCBMMAotICAgICAgICBPUlIgICAgICB0VmFsMTQsIHRWYWwyLCAgIExlZnQwICAgICAgICAgICAgICA7Ly8gdFZhbDE0ICAgID0gVTEgVTAgVUwgTDAKLSAgICAgICAgTERSICAgICAgcjB4ODA4MDgwODAsICA9QUREX0NPTlNUMSAgICAgICAgICAgOy8vIDB4ODA4MDgwODAKLSAgICAgICAgVUhBREQ4ICAgdFZhbDEwLCB0VmFsOSwgICB0VmFsMTQgICAgICAgICAgICAgOy8vIHRWYWwxMCAgICA9IGczIGcyIGcxIGcwCi0gICAgICAgIFVBREQ4ICAgIE91dDAsICAgdFZhbDEsICAgcjB4ODA4MDgwODAgICAgICAgIDsvLyBPdXQwICAgICAgPSBlMiBlMSBlMCBlTAotICAgICAgICBVSFNVQjggICB0VmFsMTAsIHRWYWwxMCwgIHRWYWwxMSAgICAgICAgICAgICA7Ly8gdFZhbDEwICAgID0gaDMgaDIgaDEgaDAKLSAgICAgICAgTV9TVFIgICAgT3V0MCwgICBbcERzdF0sICBkc3RTdGVwICAgICAgICAgICAgOy8vIHN0b3JlIHtlMiB0byBlTH0gYXQgcERzdFszICB0byAwIF0KLSAgICAgICAgTU9WICAgICAgdFZhbDEsICB0VmFsMTQsICBMU0wgIzggICAgICAgICAgICAgOy8vIHRWYWwxICAgICA9IFUwIFVMIEwwIDAwCi0gICAgICAgIE1PViAgICAgIHRWYWw2LCAgT3V0MCwgICAgTFNMICM4ICAgICAgICAgICAgIDsvLyB0VmFsNiAgICAgPSBlMSBlMCBlTCAwMAotICAgICAgICBPUlIgICAgICB0VmFsMiwgIHRWYWwyLCAgIExlZnQxICAgICAgICAgICAgICA7Ly8gdFZhbDIgICAgID0gVTEgVTAgVUwgTDEKLSAgICAgICAgVUFERDggICAgdFZhbDQsICB0VmFsNCwgICByMHg4MDgwODA4MCAgICAgICAgOy8vIHRWYWw0ICAgICA9IDAwIDAwIDAwIGwxICAgICAgICAKLSAgICAgICAgVUFERDggICAgT3V0MSwgICB0VmFsMTAsICByMHg4MDgwODA4MCAgICAgICAgOy8vIE91dDEgICAgICA9IGkzIGkyIGkxIGkwCi0gICAgICAgIE1WTiAgICAgIHRWYWwyLCAgdFZhbDIgICAgICAgICAgICAgICAgICAgICAgIDsvLyB0VmFsMTQgICAgPSBVMSdVMCdVTCdMMScKLSAgICAgICAgT1JSICAgICAgdFZhbDEsICB0VmFsMSwgICBMZWZ0MiAgICAgICAgICAgICAgOy8vIHRWYWwxICAgICA9IFUwIFVMIEwwIEwyCi0gICAgICAgIE9SUiAgICAgIE91dDIsICAgdFZhbDYsICAgdFZhbDQgICAgICAgICAgICAgIDsvLyBPdXQyICAgICAgPSBlMSBlMCBlTCBsMQotICAgICAgICBVSEFERDggICB0VmFsMSwgIHRWYWwxLCAgIHRWYWwxMiAgICAgICAgICAgICA7Ly8gdFZhbDEgICAgID0gZzIgZzEgZzAgajIKLSAgICAgICAgTV9TVFIgICAgT3V0MSwgICBbcERzdF0sICBkc3RTdGVwICAgICAgICAgICAgOy8vIHN0b3JlIHtpMyB0byBpMH0gYXQgcERzdFs3ICB0byA0IF0KLSAgICAgICAgTV9TVFIgICAgT3V0MiwgICBbcERzdF0sICBkc3RTdGVwICAgICAgICAgICAgOy8vIHN0b3JlIHtlMSB0byBsMX0gYXQgcERzdFsxMSB0byA4IF0KLSAgICAgICAgVUhTVUI4ICAgdFZhbDksICB0VmFsMSwgICB0VmFsMiAgICAgICAgICAgICAgOy8vIHRWYWw5ICAgICA9IGgyIGgxIGgwIGsyCi0gICAgICAgIFVBREQ4ICAgIE91dDMsICAgdFZhbDksICAgcjB4ODA4MDgwODAgICAgICAgIDsvLyBPdXQzICAgICAgPSBpMiBpMSBpMCBsMgotICAgICAgICBTVFIgICAgICBPdXQzLCAgIFtwRHN0XSAgICAgICAgICAgICAgICAgICAgICA7Ly8gc3RvcmUge2kyIHRvIGwyfSBhdCBwRHN0WzE1IHRvIDEyXSAKLSAgICAgICAgTU9WICAgICAgcmV0dXJuLCAgI09NWF9TdHNfTm9FcnIKLSAgICAgICAgTV9FWElUICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOy8vIE1hY3JvIHRvIGV4aXQgbWlkd2F5LWJyZWFrIGZybSBjYXNlCi0gICAgICAgIAotT01YX1ZDXzR4NF9IRAotICAgICAgICAKLSAgICAgICAgOy8vIE1fU1RBTEwgQVJNMTEzNkpTPTQKLSAgICAgICAgCi0gICAgICAgIExEUiAgICAgIEFib3ZlMDEyMywgIFtwU3JjQWJvdmVdICAgICAgICAgICAgIDsvLyBBYm92ZTAxMjMgPSBVMyBV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HN0U3RlcCAgICAgICAgICAgICA7Ly8gc3RvcmUge091dDB9ICBhdCBwRHN0IFswICB0byAzIF0gCi0gICAgICAgIE1PViAgICAgIHRWYWw0LCAgT3V0MCwgICBMU0wgIzE2ICAgICAgICAgICAgIDsvLyB0VmFsNCA9IGkxIGkwIDAwIDAwCi0gICAgICAgIFVIQUREOCAgIHRWYWwyLCAgdFZhbDIsICB0VmFsNyAgICAgICAgICAgICAgIDsvLyB0VmFsMiA9IDAwIGoxIDAwIGoyCi0gICAgICAgIFVIQUREOCAgIHRWYWw2LCAgdFZhbDExLCB0VmFsMTAgICAgICAgICAgICAgIDsvLyB0VmFsMTE9IDAwIGoyIDAwIGozCi0gICAgICAgIE1WTiAgICAgIHRWYWwxMiwgdFZhbDExICAgICAgICAgICAgICAgICAgICAgIDsvLyB0VmFsMTI9IDAwIEwwJzAwIEwxJwotICAgICAgICBNVk4gICAgICB0VmFsMTQsIHRWYWw3ICAgICAgICAgICAgICAgICAgICAgICA7Ly8gdFZhbDE0PSAwMCBMMScwMCBMMicKLSAgICAgICAgVUhTVUI4ICAgdFZhbDIsICB0VmFsMiwgIHRWYWwxMiAgICAgICAgICAgICAgOy8vIHRWYWwyID0gMDAgazEgMDAgazIKLSAgICAgICAgVUhTVUI4ICAgdFZhbDgsICB0VmFsNywgIHRWYWwxMiAgICAgICAgICAgICAgOy8vIHRWYWw4ID0gMDAgZDEgMDAgZDIKLSAgICAgICAgVUhTVUI4ICAgdFZhbDExLCB0VmFsNiwgIHRWYWwxNCAgICAgICAgICAgICAgOy8vIHRWYWwxMT0gMDAgazIgMDAgazMKLSAgICAgICAgVUhTVUI4ICAgdFZhbDksICB0VmFsMTAsIHRWYWwxNCAgICAgICAgICAgICAgOy8vIHRWYWw5ID0gMDAgZDIgMDAgZDMKLSAgICAgICAgVUFERDggICAgdFZhbDIsICB0VmFsMiwgIHIweDgwODA4MDgwICAgICAgICAgOy8vIHRWYWwyID0gMDAgbDEgMDAgbDIKLSAgICAgICAgVUFERDggICAgdFZhbDgsICB0VmFsOCwgIHIweDgwODA4MDgwICAgICAgICAgOy8vIHRWYWw4ID0gMDAgZTEgMDAgZTIKLSAgICAgICAgVUFERDggICAgdFZhbDExLCB0VmFsMTEsIHIweDgwODA4MDgwICAgICAgICAgOy8vIHRWYWwxMT0gMDAgbDIgMDAgbDMKLSAgICAgICAgVUFERDggICAgdFZhbDksICB0VmFsOSwgIHIweDgwODA4MDgwICAgICAgICAgOy8vIHRWYWw5ID0gMDAgZTIgMDAgZTMKLSAgICAgICAgT1JSICAgICAgT3V0MiwgICB0VmFsOCwgIHRWYWwyLCAgTFNMICM4ICAgICAgOy8vIE91dDIgID0gbDEgZTEgbDIgZTIKLSAgICAgICAgT1JSICAgICAgT3V0MywgICB0VmFsOSwgIHRWYWwxMSwgTFNMICM4ICAgICAgOy8vIE91dDMgID0gbDIgZTIgbDMgZTMKLSAgICAgICAgUEtIVEIgICAgT3V0MSwgICB0VmFsNCwgIE91dDIsICAgQVNSICMxNiAgICAgOy8vIE91dDEgID0gaTEgaTAgbDEgZTEKLSAgICAgICAgTV9TVFIgICAgT3V0MSwgICBbcERzdF0sIGRzdFN0ZXAgICAgICAgICAgICAgOy8vIHN0b3JlIHtPdXQxfSAgYXQgcERzdCBbNCAgdG8gNyBdCi0gICAgICAgIE1fU1RSICAgIE91dDIsICAgW3BEc3RdLCBkc3RTdGVwICAgICAgICAgICAgIDsvLyBzdG9yZSB7T3V0Mn0gIGF0IHBEc3QgWzggIHRvIDExXQotICAgICAgICBTVFIgICAgICBPdXQzLCAgIFtwRHN0XSAgICAgICAgICAgICAgICAgICAgICA7Ly8gc3RvcmUge091dDN9ICBhdCBwRHN0IFsxMiB0byAxNV0KLSAgICAgICAgTU9WICAgICAgcmV0dXJuLCAgI09NWF9TdHNfTm9FcnIKLSAgICAgICAgTV9FWElUICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOy8vIE1hY3JvIHRvIGV4aXQgbWlkd2F5LWJyZW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gIHRWYWw4ICAgICAgICAgICAgICAgOy8vIHRWYWwxMj0gZDUgZDQgZDMgZDIKLSAgICAgICAgVUhTVUI4ICAgdFZhbDExLCB0VmFsMTEsIHRWYWw4ICAgICAgICAgICAgICAgOy8vIHRWYWwxMT0gaDUgaDQgaDMgaDIKLSAgICAgICAgVUhTVUI4ICAgdFZhbDIsICB0VmFsMTQsIHRWYWw3ICAgICAgICAgICAgICAgOy8vIHRWYWwyID0gaDYgaDUgaDQgaDMKLSAgICAgICAgVUFERDggICAgT3V0MSwgICB0VmFsMTEsIHIweDgwODA4MDgwICAgICAgICAgOy8vIE91dDEgID0gaTUgaTQgaTMgaTIKLSAgICAgICAgVUFERDggICAgT3V0MiwgICB0VmFsMTIsIHIweDgwODA4MDgwICAgICAgICAgOy8vIE91dDIgID0gZTUgZTQgZTMgZTIKLSAgICAgICAgVUFERDggICAgT3V0MywgICB0VmFsMiwgIHIweDgwODA4MDgwICAgICAgICAgOy8vIE91dDMgID0gaTYgaTUgaTQgaTMKLSAgICAgICAgTV9TVFIgICAgT3V0MSwgICBbcERzdF0sIGRzdFN0ZXAgICAgICAgICAgICAgOy8vIHN0b3JlIHtPdXQxfSBhdCBwRHN0IFs0ICB0byA3IF0KLSAgICAgICAgTV9TVFIgICAgT3V0MiwgICBbcERzdF0sIGRzdFN0ZXAgICAgICAgICAgICAgOy8vIHN0b3JlIHtPdXQyfSBhdCBwRHN0IFs4ICB0byAxMV0KLSAgICAgICAgTV9TVFIgICAgT3V0MywgICBbcERzdF0sIGRzdFN0ZXAgICAgICAgICAgICAgOy8vIHN0b3JlIHtPdXQzfSBhdCBwRHN0IFsxMiB0byAxNV0KLSAgICAgICAgTU9WICAgICAgcmV0dXJuLCAjT01YX1N0c19Ob0VycgotICAgICAgICBNX0VYSVQgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA7Ly8gTWFjcm8gdG8gZXhpdCBtaWR3YXktYnJlYWsgZnJtIGNhc2UKLSAgICAgICAgCi1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ICAgICAgdFZhbDgsICB0VmFsNyAgICAgICAgICAgICAgICAgICAgICAgOy8vIHRWYWw4ID0gMDAgTDInMDAgTDEnCi0gICAgICAgIE1WTiAgICAgIHRWYWwxMCwgdFZhbDExICAgICAgICAgICAgICAgICAgICAgIDsvLyB0VmFsMTA9IDAwIEwzJzAwIEwyJwotICAgICAgICBVSEFERDggICB0VmFsNCwgIHRWYWw2LCAgdFZhbDExICAgICAgICAgICAgICA7Ly8gdFZhbDQgPSAwMCBnMyAwMCBnMgotICAgICAgICBVWFRCMTYgICB0VmFsMTIsIE91dDMgICAgICAgICAgICAgICAgICAgICAgICA7Ly8gdFZhbDEyPSAwMCBMMyAwMCBMMwotICAgICAgICBVSFNVQjggICB0VmFsNCwgIHRWYWw0LCAgdFZhbDggICAgICAgICAgICAgICA7Ly8gdFZhbDQgPSAwMCBoMyAwMCBoMgotICAgICAgICBVSFNVQjggICB0VmFsNiwgIHRWYWw2LCAgdFZhbDggICAgICAgICAgICAgICA7Ly8gdFZhbDYgPSAwMCBkMiAwMCBkMQotICAgICAgICBVSFNVQjggICB0VmFsMTEsIHRWYWwxMSwgdFZhbDggICAgICAgICAgICAgICA7Ly8gdFZhbDExPSAwMCBkMyAwMCBkMgotICAgICAgICBVSEFERDggICB0VmFsMTIsIHRWYWwxMiwgdFZhbDcgICAgICAgICAgICAgICA7Ly8gdFZhbDEyPSAwMCBnNCAwMCBnMwotICAgICAgICBVQUREOCAgICB0VmFsNCwgIHRWYWw0LCAgcjB4ODA4MDgwODAgICAgICAgICA7Ly8gdFZhbDQgPSAwMCBpMyAwMCBpMgotICAgICAgICBVSFNVQjggICB0VmFsMTIsIHRWYWwxMiwgdFZhbDEwICAgICAgICAgICAgICA7Ly8gdFZhbDEyPSAwMCBoNCAwMCBoMwotICAgICAgICBVQUREOCAgICB0VmFsOCwgIHRWYWw2LCAgcjB4ODA4MDgwODAgICAgICAgICA7Ly8gdFZhbDggPSAwMCBlMiAwMCBlMQotICAgICAgICBVQUREOCAgICB0VmFsMTEsIHRWYWwxMSwgcjB4ODA4MDgwODAgICAgICAgICA7Ly8gdFZhbDExPSAwMCBlMyAwMCBlMgotICAgICAgICBVQUREOCAgICB0VmFsMTIsIHRWYWwxMiwgcjB4ODA4MDgwODAgICAgICAgICA7Ly8gdFZhbDEyPSAwMCBpNCAwMCBpMwotICAgICAgICBPUlIgICAgICBPdXQwLCAgIHRWYWw4LCAgdFZhbDQsICBMU0wgIzggICAgICA7Ly8gT3V0MCAgPSBpMyBlMiBpMiBlMQotICAgICAgICBPUlIgICAgICBPdXQxLCAgIHRWYWwxMSwgdFZhbDEyLCBMU0wgIzggICAgICA7Ly8gT3V0MSAgPSBpNCBlMyBpMyBlMgotICAgICAgICBNX1NUUiAgICBPdXQwLCAgIFtwRHN0XSwgZHN0U3RlcCAgICAgICAgICAgICA7Ly8gc3RvcmUge091dDB9ICBhdCBwRHN0IFswICB0byAzIF0KLSAgICAgICAgUEtIVEIgICAgT3V0MiwgICBPdXQzLCAgIE91dDEsICAgQVNSICMxNiAgICAgOy8vIE91dDIgID0gTDMgTDMgaTQgZTMKLSAgICAgICAgTV9TVFIgICAgT3V0MSwgICBbcERzdF0sIGRzdFN0ZXAgICAgICAgICAgICAgOy8vIHN0b3JlIHtPdXQxfSAgYXQgcERzdCBbNCAgdG8gNyBdCi0gICAgICAgIE1fU1RSICAgIE91dDIsICAgW3BEc3RdLCBkc3RTdGVwICAgICAgICAgICAgIDsvLyBzdG9yZSB7T3V0Mn0gIGF0IHBEc3QgWzggIHRvIDExXQotICAgICAgICBTVFIgICAgICBPdXQzLCAgIFtwRHN0XSAgICAgICAgICAgICAgICAgICAgICA7Ly8gc3RvcmUge091dDN9ICBhdCBwRHN0IFsxMiB0byAxNV0KLSAgICAgICAgTU9WICAgICAgcmV0dXJuLCAgI09NWF9TdHNfTm9FcnIKLSAgICAgICAgTV9FTkQKLQotICAgICAgICBFTkRJRiA7Ly8gQVJNMTEzNkpTCi0gICAgICAgIAotICAgICAgICAK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LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tCi0gICAgICAgIAotICAgICAgICBNT1YgICAgICBWYWx1ZSwgICMwICAgICAgICAgICAgICAgICAgICAgICAgICA7Ly8gSW5pdGlhbGl6ZSB0aGUgemVybyB2YWx1ZQotICAgICAgICBNT1YgICAgICBWYWx1ZTIsICAjMCAgICAgICAgICAgICAgICAgICAgICAgICA7Ly8gSW5pdGlhbGl6ZSB0aGUgemVybyB2YWx1ZQotICAgICAgICBMRFJCICAgICBGbGFnLCAgW3BTcmNdLCAjMSAgICAgICAgICAgICAgICAgICA7Ly8gUHJlbG9hZCA8RmxhZz4gYmVmb3JlIDx1bnBhY2tMb29wPgotICAgICAgICBTVFJEICAgICBWYWx1ZSwgW3BEc3QsICMwXSAgICAgICAgICAgICAgICAgICA7Ly8gcERzdFswXSAgPSBwRHN0WzFdICA9IHBEc3RbMl0gID0gcERzdFszXSAgPSAwCi0gICAgICAgIAotCi11bnBhY2tMb29wCi0gICAgICAgIFRTVCAgICAgIEZsYWcsICAjMHgxMCAgICAgICAgICAgICAgICAgICAgICAgIDsvLyBDb21wdXRpbmcgKEZsYWcgJiAweDEwKQotICAgICAgICBMRFJTQk5FICBWYWx1ZTIsW3BTcmMsIzFdICAgICAgICAgICAgICAgICAgCi0gICAgICAgIExEUkJORSAgIFZhbHVlLCBbcFNyY10sICMyICAgICAgICAgICAgICAgICAgIDsvLyBMb2FkIGJ5dGUgd2lzZSB0byBhdm9pZCB1bmFsaWduZWQgYWNjZXNzCi0gICAgICAgIEFORCAgICAgIHN0ck9mZnNldCwgY3N0T2Zmc2V0LCBGbGFnLCBMU0wgIzEgIDsvLyBzdHJPZmZzZXQgPSAoRmxhZyAmIDE1KSA8IDE7Ci0gICAgICAgIExEUlNCRVEgIFZhbHVlLCBbcFNyY10sICMxICAgICAgICAgICAgICAgICAgIDsvLyBWYWx1ZSA9IChPTVhfVTgpICAqcFNyYysrCi0gICAgICAgIE9SUk5FICAgIFZhbHVlLFZhbHVlLFZhbHVlMiwgTFNMICM4ICAgICAgICAgIDsvLyBWYWx1ZSA9IChPTVhfVTE2KSAqcFNyYysrCi0gICAgICAgIAotICAgICAgICBUU1QgICAgICBGbGFnLCAgIzB4MjAgICAgICAgICAgICAgICAgICAgICAgICA7Ly8gQ29tcHV0aW5nIChGbGFnICYgMHgyMCkgdG8gY2hlY2ssIGlmIHdlJ3JlIGRvbmUKLSAgICAgICAgTERSQkVRICAgRmxhZywgIFtwU3JjXSwgIzEgICAgICAgICAgICAgICAgICAgOy8vIEZsYWcgID0gKE9NWF9VOCkgKnBTcmMrKywgZm9yIG5leHQgaXRlcmF0aW9uCi0gICAgICAgIFNUUkggICAgIFZhbHVlLCBbcERzdCwgc3RyT2Zmc2V0XSAgICAgICAgICAgIDsvLyBTdG9yZSA8VmFsdWU+IGF0IG9mZnNldCA8c3RyT2Zmc2V0PgotICAgICAgICBCRVEgICAgICB1bnBhY2tMb29wICAgICAgICAgICAgICAgICAgICAgICAgICA7Ly8gQnJhbmNoIHRvIHRoZSBsb29wIGJlZ2lubmluZwotICAgICAgICAKLSAgICAgICAgTERNSUEgICAgcERzdCwge3IwdzAsIHIwdzF9ICAgICAgICAgICAgICAgICAgOy8vIHIwdzAgPSB8YzF8YzB8ICYgcjB3MSA9IHxjM3xjMnwKLQotCi0gICAgICAgIFNUUiAgICAgIHBTcmMsIFtwcFNyY10gICAgICAgICAgICAgICAgICAgICAgIDsvLyBVcGRhdGUgdGhlIGJpdHN0cmVhbSBwb2ludGVyCi0gICAgICAgIAotICAgICAgICBMRFIgICAgICBwUVBEaXZUYWJsZSwgPWFybVZDTTRQMTBfUVBEaXZUYWJsZSA7Ly8gUVAgRGl2aXNpb24gbG9vay11cC10YWJsZSBiYXNlIHBvaW50ZXIKLSAgICAgICAgTERSICAgICAgcFFQTW9kVGFibGUsID1hcm1WQ000UDEwX1ZNYXRyaXhRUE1vZFRhYmxlIDsvLyBRUCBNb2R1bG8gbG9vay11cC10YWJsZSBiYXNlIHBvaW50ZXIKLSAgICAgICAgCi0gICAgICAgIFNBRERTVUJYIHIwdzAsIHIwdzAsICByMHcwICAgICAgICAgICAgICAgICAgIDsvLyBbIGMwMCtjMDEsIGMwMC1jMDEgXQotICAgICAgICBTQUREU1VCWCByMHcxLCByMHcxLCAgcjB3MSAgICAgICAgICAgICAgICAgICA7Ly8gWyBjMTArYzExLCBjMTAtYzExIF0KLSAgICAgICAgCi0gICAgICAgIExEUlNCICAgIFNoaWZ0LCBbcFFQRGl2VGFibGUsIFFQXSAgICAgICAgICAgIDsvLyBTaGlmdCA9IHBRUERpdlRhYmxlW1FQXQotICAgICAgICBMRFJTQiAgICBTY2FsZSwgW3BRUE1vZFRhYmxlLCBRUF0gICAgICAgICAgICA7Ly8gU2NhbGUgPSBwUVBNb2RUYWJsZVtRUF0KLSAgICAgICAgCi0gICAgICAgIFNBREQxNiAgIGMwdzAsIHIwdzAsIHIwdzEgICAgICAgICAgICAgICAgICAgIDsvLyBbIGQwMCtkMTAsIGQwMStkMTEgXQotICAgICAgICBTU1VCMTYgICBjMXcwLCByMHcwLCByMHcxICAgICAgICAgICAgICAgICAgICA7Ly8gWyBkMDAtZDEwLCBkMDEtZDExIF0KLSAgICAgICAgCi0gICAgICAgIExTTCAgICAgIFNjYWxlLCBTY2FsZSwgU2hpZnQgICAgICAgICAgICAgICAgIDsvLyBTY2FsZSA9IFNjYWxlIDw8IFNoaWZ0Ci0gICAgICAgIAotICAgICAgICBTTVVMVEIgICBUZW1wMiwgYzB3MCwgIFNjYWxlICAgICAgICAgICAgICAgICA7Ly8gVGVtcDIgPSBUKGMwdzApICogU2NhbGUKLSAgICAgICAgU01VTFRCICAgVGVtcDQsIGMxdzAsICBTY2FsZSAgICAgICAgICAgICAgICAgOy8vIFRlbXA0ID0gVChjMXcwKSAqIFNjYWxlCi0gICAgICAgIFNNVUxCQiAgIFRlbXAxLCBjMHcwLCAgU2NhbGUgICAgICAgICAgICAgICAgIDsvLyBU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gdGFibGVzKQotICAgICAgICAKLSAgICAgICAgSU1QT1JUIGFybVZDTTRQMTBfVW5wYWNrQmxvY2s0eDQgCi0gICAgICAgIElNUE9SVCBhcm1WQ000UDEwX1FQRGl2VGFibGUKLSAgICAgICAgSU1QT1JUIGFybVZDTTRQMTBfVk1hdHJpeFFQTW9kVGFibGUKLSAgICAgICAgCi0gICAgICAgIE1fVkFSSUFOVFMgQVJNMTEzNkpTCi0KLTsvLyBTZXQgZGVidWdnaW5nIGxldmVsICAgICAgICAKLTsvL0RFQlVHX09OICAgIFNFVEwge1RSVUV9Ci0KLQotOy8vIFN0YXRpYyBGdW5jdGlvbjogYXJtVkNNNFAxMF9JbnZUcmFuc2Zvcm1EZXF1YW50THVtYURDNHg0Ci0gICAgCi0KLTsvLyBHdWFyZGluZyBpbXBsZW1lbnRhdGlvbiBieSB0aGUgcHJvY2Vzc29yIG5hbWUKLSAgICAKLSAgICBJRiAgQVJNMTEzNkpTIAotCi0KLTsvL0lucHV0IFJlZ2lzdGVycwotcERhdGEgICAgICAgICAgICAgICBSTiAgMAotUVAgICAgICAgICAgICAgICAgICBSTiAgMQotCi07Ly9PdXRwdXQgUmVnaXN0ZXJzCi0KLQotOy8vTG9jYWwgU2NyYXRjaCBSZWdpc3RlcnMKLQotOy8vIFBhY2tlZCBJbnB1dCBwaXhlbHMKLWluMDAgICAgICAgICAgICAgICAgUk4gIDIgICAgICAgICAgICAgICAgICAgOy8vIFNyY1swXSAmIFNyY1sxXSAKLWluMDIgICAgICAgICAgICAgICAgUk4gIDMgICAgICAgICAgICAgICAgICAgOy8vIFNyY1syXSAmIFNyY1szXQotaW4xMCAgICAgICAgICAgICAgICBSTiAgNCAgICAgICAgICAgICAgICAgICA7Ly8gU3JjWzRdICYgU3JjWzVdCi1pbjEyICAgICAgICAgICAgICAgIFJOICA1ICAgICAgICAgICAgICAgICAgIDsvLyBTcmNbNl0gJiBTcmNbN10KLWluMjAgICAgICAgICAgICAgICAgUk4gIDYgICAgICAgICAgICAgICAgICAgOy8vIFNyY1s4XSAmIFNyY1s5XQotaW4yMiAgICAgICAgICAgICAgICBSTiAgNyAgICAgICAgICAgICAgICAgICA7Ly8gU3JjWzEwXSAmIFNyY1sxMV0KLWluMzAgICAgICAgICAgICAgICAgUk4gIDggICAgICAgICAgICAgICAgICAgOy8vIFNyY1sxMl0gJiBTcmNbMTNdCi1pbjMyICAgICAgICAgICAgICAgIFJOICA5ICAgICAgICAgICAgICAgICAgIDsvLyBTcmNbMTRdICYgU3JjWzE1XQotCi07Ly8gVHJhbnNwb3NlIGZvciBSb3cgb3BlcmF0aW9ucyAoUm93cyB0byBjb2xzKQotdHJSb3cwMCAgICAgICAgICAgICBSTiAgMgotdHJSb3cxMCAgICAgICAgICAgICBSTiAgMTAKLXRyUm93MDIgICAgICAgICAgICAgUk4gIDMKLXRyUm93MTIgICAgICAgICAgICAgUk4gIDUKLXRyUm93MjAgICAgICAgICAgICAgUk4gIDExCi10clJvdzMwICAgICAgICAgICAgIFJOICAxMgotdHJSb3czMiAgICAgICAgICAgICBSTiAgMTQKLXRyUm93MjIgICAgICAgICAgICAgUk4gIDcKLQotOy8vIEludGVybWVkaWF0ZSBjYWxjdWxhdGlvbnMKLXJvd1N1bTEgICAgICAgICAgICAgUk4gIDQKLXJvd1N1bTIgICAgICAgICAgICAgUk4gIDYKLXJvd0RpZmYxICAgICAgICAgICAgUk4gIDgKLXJvd0RpZmYyICAgICAgICAgICAgUk4gIDkKLQotCi07Ly8gUm93IG9wZXJhdGVkIHBpeGVscwotcm93T3AwMCAgICAgICAgICAgICBSTiAgMgotcm93T3AxMCAgICAgICAgICAgICBSTiAgMTAKLXJvd09wMjAgICAgICAgICAgICAgUk4gIDExCi1yb3dPcDMwICAgICAgICAgICAgIFJOICAxMgotcm93T3AwMiAgICAgICAgICAgICBSTiAgMwotcm93T3AxMiAgICAgICAgICAgICBSTiAgNQotcm93T3AyMiAgICAgICAgICAgICBSTiAgNwotcm93T3AzMiAgICAgICAgICAgICBSTiAgMTQKLQotOy8vIFRyYW5zcG9zZSBmb3IgY29sdWxtbiBvcGVyYXRpb25zCi10ckNvbDAwICAgICAgICAgICAgIFJOICAyICAgICAgICAgICAgICAgICAgIAotdHJDb2wwMiAgICAgICAgICAgICBSTiAgMyAgICAgICAgICAgICAgICAgICAKLXRyQ29sMTAgICAgICAgICAgICAgUk4gIDQgICAgICAgICAgICAgICAgICAgCi10ckNvbDEyICAgICAgICAgICAgIFJOICA1ICAgICAgICAgICAgICAgICAgIAotdHJDb2wyMCAgICAgICAgICAgICBSTiAgNiAgICAgICAgICAgICAgICAgICAKLXRyQ29sMjIgICAgICAgICAgICAgUk4gIDcgICAgICAgICAgICAgICAgICAgCi10ckNvbDMwICAgICAgICAgICAgIFJOICA4ICAgICAgICAgICAgICAgICAgIAotdHJDb2wzMiAgICAgICAgICAgICBSTiAgOSAgCi0KLTsvLyBJbnRlcm1lZGlhdGUgY2FsY3VsYXRpb25zCi1jb2xTdW0xICAgICAgICAgICAgIFJOICAxMAotY29sU3VtMiAgICAgICAgICAgICBSTiAgMTEKLWNvbERpZmYxICAgICAgICAgICAgUk4gIDEyCi1jb2xEaWZmMiAgICAgICAgICAgIFJOICAxNAotCi0KLTsvLyBDb2xvdW1uIG9wZXJhdGVkIHBpeGVscwotY29sT3AwMCAgICAgICAgICAgICBSTiAgMiAgICAgICAgICAgICAgICAgICAKLWNvbE9wMDIgICAgICAgICAgICAgUk4gIDMgICAgICAgICAgICAgICAgICAgCi1jb2xPcDEwICAgICAgICAgICAgIFJOICA0ICAgICAgICAgICAgICAgICAgIAotY29sT3AxMiAgICAgICAgICAgICBSTiAgNSAgICAgICAgICAgICAgICAgICAKLWNvbE9wMjAgICAgICAgICAgICAgUk4gIDYgICAgICAgICAgICAgICAgICAgCi1jb2xPcDIyICAgICAgICAgICAgIFJOICA3ICAgICAgICAgICAgICAgICAgIAotY29sT3AzMCAgICAgICAgICAgICBSTiAgOCAgICAgICAgICAgICAgICAgICAKLWNvbE9wMzIgICAgICAgICAgICAgUk4gIDkgIAotCi07Ly8gVGVtcG9yYXJ5IHNjcmF0Y2ggdmFyYWlibGVzCi1wUVBEaXZUYWJsZSAgICAgICAgIFJOICAwCi1wUVBNb2RUYWJsZSAgICAgICAgIFJOICAxMQotU2hpZnQgICAgICAgICAgICAgICBSTiAgMTAKLVNjYWxlICAgICAgICAgICAgICAgUk4gIDE0Ci1Sb3VuZCAgICAgICAgICAgICAgIFJOICAwCi0KLXRlbXAxICAgICAgICAgICAgICAgUk4gIDEwCi10ZW1wMiAgICAgICAgICAgICAgICBSTiAgMTEKLXRlbXAzICAgICAgICAgICAgICAgUk4gIDEyCi10ZW1wNCAgICAgICAgICAgICAgIFJOICAxCi0KLQotCi07Ly8gSW52VHJhbnNmb3JtZWQgYW5kIERlcXVhbnRpemVkIHBpeGVscwotb3V0MDAgICAgICAgICAgICAgICBSTiAgMiAgICAgICAgICAgICAgICAgICAKLW91dDAyICAgICAgICAgICAgICAgUk4gIDMgICAgICAgICAgICAgICAgICAgCi1vdXQxMCAgICAgICAgICAgICAgIFJOICA0ICAgICAgICAgICAgICAgICAgIAotb3V0MTIgICAgICAgICAgICAgICBSTiAgNSAgICAgICAgICAgICAgICAgICAKLW91dDIwICAgICAgICAgICAgICAgUk4gIDYgICAgICAgICAgICAgICAgICAgCi1vdXQyMiAgICAgICAgICAgICAgIFJOICA3ICAgICAgICAgICAgICAgICAgIAotb3V0MzAgICAgICAgICAgICAgICBSTiAgOCAgICAgICAgICAgICAgICAgICAKLW91dDMyICAgICAgICAgICAgICAgUk4gIDkgIAotICAgICAgCi0gICAgICAgIAotCi0gICAgICAgCi0gICAgOy8vIEFsbG9jYXRlIHN0YWNrIG1lbW9yeSByZXF1aXJlZCBieSB0aGUgZnVuY3Rpb24KLSAgICAgICAgTV9BTExPQzQgICAgcERhdGFPblN0YWNrLCA0Ci0KLSAgICA7Ly8gV3JpdGUgZnVuY3Rpb24gaGVhZGVyCi0gICAgICAgIE1fU1RBUlQgYXJtVkNNNFAxMF9JbnZUcmFuc2Zvcm1EZXF1YW50THVtYURDNHg0LHIxMQotICAgICAgICAKLSAgICAgICAgOyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgotICAgICAgICA7Ly8gVGhlIHN0cmF0ZWd5IHVzZWQgaW4gaW1wbGVtZW50aW5nIHRoZSB0cmFuc2Zvcm0gaXMgYXMgZm9sbG93czoqCi0gICAgICAgIDsvLyBMb2FkIHRoZSA0eDQgYmxvY2sgaW50byA4IHJlZ2lzdGVycyAgICAgICAgICAgICAgICAgICAgICAgICAgICogIAotICAgICAgICA7Ly8gVHJhbnNwb3NlIHRoZSA0eDQgbWF0cml4ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqICAKLSAgICAgICAgOy8vIFBlcmZvcm0gdGhlIHJvdyBvcGVyYXRpb25zIChvbiBjb2x1bW5zKSB1c2luZyBTSU1EICAgICAgICAgICAgKiAgCi0gICAgICAgIDsvLyBUcmFuc3Bvc2UgdGhlIDR4NCByZXN1bHQgbWF0cml4ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICogIAotICAgICAgICA7Ly8gUGVyZm9ybSB0aGUgY29sb3VtbiBvcGVyYXRpb25zICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqCi0gICAgICAgIDsvLyBTdG9yZSB0aGUgNHg0IGJsb2NrIGF0IG9uZSBnbyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICogIAotICAgICAgICA7KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCi0KLSAgICAgICAgOy8vIExvYWQgYWxsIHRoZSA0eDQgcGl4ZWxzCi0gICAgICAgIAotICAgICAgICBMRE1JQSAgIHBEYXRhLHtpbjAwLGluMDIsaW4xMCxpbjEyLGluMjAsaW4yMixpbjMwLGluMzJ9Ci0gICAgICAgIAotICAgICAgICA7Ly8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgotICAgICAgICA7Ly8KLSAgICAgICAgOy8vIFRyYW5zcG9zZSB0aGUgbWF0cml4IGlub3JkZXIgdG8gcGVyZm9ybSByb3cgb3BzIGFzIGNvbG91bW4gb3BzCi0gICAgICAgIDsvLyBJbnB1dDogICBpbltdW10gPSBvcmlnaW5hbCBtYXRyaXgKLSAgICAgICAgOy8vIE91dHB1dDogIHRyUm93W11bXT0gdHJhbnNwb3NlZCBtYXRyaXgKLSAgICAgICAgOy8vIFN0ZXAxOiBPYnRhaW4gdGhlIExMIHBhcnQgb2YgdGhlIHRyYW5zcG9zZWQgbWF0cml4Ci0gICAgICAgIDsvLyBTdGVwMjogT2J0YWluIHRoZSBITCBwYXJ0Ci0gICAgICAgIDsvLyBzdGVwMzogT2J0YWluIHRoZSBMSCBwYXJ0Ci0gICAgICAgIDsvLyBTdGVwNDogT2J0YWluIHRoZSBISCBwYXJ0Ci0gICAgICAgIDsvLwotICAgICAgICA7Ly8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgotICAgICAgICAKLSAgICAgICAgOy8vIExMIDJ4MiB0cmFuc3Bvc2VkIG1hdHJpeCAKLSAgICAgICAgOy8vICAgZDAgZDEgLSAtCi0gICAgICAgIDsvLyAgIGQ0IGQ1IC0gLQotICAgICAgICA7Ly8gICAtICAtICAtIC0KLSAgICAgICAgOy8vICAgLSAgLSAgLSAtCi0gICAgICAgIAotICAgICAgICBQS0hUQiAgIHRyUm93MTAsaW4xMCxpbjAwLEFTUiAjMTYgICAgICAgICAgICAgICA7Ly8gWzUgNF0gPSBbZjU6ZjFdICAgIAotICAgICAgICBQS0hCVCAgIHRyUm93MDAsaW4wMCxpbjEwLExTTCAjMTYgICAgICAgICAgICAgICA7Ly8gWzEgMF0gPSBbZjQ6ZjBdICAKLSAgICAgICAgCi0gICAgICAgIDsvLyBITCAyeDIgdHJhbnNwb3NlZCBtYXRyaXggIAotICAgICAgICA7Ly8gICAgLSAgIC0gICAtIC0KLSAgICAgICAgOy8vICAgIC0gICAtICAgLSAtCi0gICAgICAgIDsvLyAgICBkOCAgZDkgIC0gLQotICAgICAgICA7Ly8gICBkMTIgZDEzICAtIC0KLSAgICAgICAgCi0gICAgICAgICAKLSAgICAgICAgIFBLSFRCICAgdHJSb3czMCxpbjEyLGluMDIsQVNSICMxNiAgICAgICAgICAgICAgOy8vIFsxMyAxMl0gPSBbNyAzXQotICAgICAgICAgUEtIQlQgICB0clJvdzIwLGluMDIsaW4xMixMU0wgIzE2ICAgICAgICAgICAgICA7Ly8gWzkgOF0gPSBbNiAyXSAKLSAgICAgICAgCi0gICAgICAgIDsvLyBMSCAyeDIgdHJhbnNwb3NlZCBtYXRyaXggCi0gICAgICAgIDsvLyAgIC0gLSBkMiBkMyAKLSAgICAgICAgOy8vICAgLSAtIGQ2IGQ3IAotICAgICAgICA7Ly8gICAtIC0gLSAgLQotICAgICAgICA7Ly8gICAtIC0gLSAgLQotICAgICAgICAKLSAgICAgICAgUEtIQlQgICB0clJvdzAyLGluMjAsaW4zMCxMU0wgIzE2ICAgICAgICAgICAgICAgOy8vIFszIDJdID0gW2YxMjpmOF0gIAotICAgICAgICBQS0hUQiAgIHRyUm93MTIsaW4zMCxpbjIwLEFTUiAjMTYgICAgICAgICAgICAgICA7Ly8gWzcgNl0gPSBbZjEzOmY5XSAKLSAgICAgICAgCi0gICAgICAgIAotICAgICAgICAKLSAgICAgICAgIAotICAgICAgICA7Ly8gSEggMngyIHRyYW5zcG9zZWQgbWF0cml4ICAKLSAgICAgICAgOy8vICAgIC0gLSAgIC0gICAtCi0gICAgICAgIDsvLyAgICAtIC0gICAtICAgLQotICAgICAgICA7Ly8gICAgLSAtICBkMTAgZDExCi0gICAgICAgIDsvLyAgICAtIC0gIGQxNCBkMTUKLSAgICAgICAgCi0gICAgICAgIFBLSFRCICAgdHJSb3czMixpbjMyLGluMjIsQVNSICMxNiAgICAgICAgICAgICAgIDsvLyBbMTUgMTRdID0gWzE1IDExXQotICAgICAgICBQS0hCVCAgIHRyUm93MjIsaW4yMixpbjMyLExTTCAjMTYgICAgICAgICAgICAgICA7Ly8gWzExIDEwXSA9IFsxNCAxMF0KLSAgICAgICAKLSAgICAgICAgCi0gICAgICAgIDsqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqIAotICAgICAgICA7Ly8gUm93IE9wZXJhdGlvbnMgKFBlcmZvcm1lZCBvbiBjb2x1bW5zKQotICAgICAgICA7KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAKLSAgICAgICAgCi0gICAgICAgIAotICAgICAgICA7Ly8gU0lNRCBvcGVyYXRpb25zIG9uIGZpcnN0IHR3byBjb2x1bW5zKHR3byByb3dzIG9mIHRoZSBvcmlnaW5hbCBtYXRyaXgpCi0gICAgICAgIAotICAgICAgICBTQUREMTYgICAgICByb3dTdW0xLHRyUm93MDAsdHJSb3cxMCAgICAgICAgICAgICAgICA7Ly8gKGMwK2MxKQotICAgICAgICBTQUREMTYgICAgICByb3dTdW0yLHRyUm93MjAsdHJSb3czMCAgICAgICAgICAgICAgICA7Ly8gKGMyK2MzKQotICAgICAgICBTU1VCMTYgICAgICByb3dEaWZmMSx0clJvdzAwLHRyUm93MTAgICAgICAgICAgICAgICA7Ly8gKGMwLWMxKQotICAgICAgICBTU1VCMTYgICAgICByb3dEaWZmMix0clJvdzIwLHRyUm93MzAgICAgICAgICAgICAgICA7Ly8gKGMyLWMzKQotICAgICAgICBTQUREMTYgICAgICByb3dPcDAwLHJvd1N1bTEscm93U3VtMiAgICAgICAgICAgICAgICA7Ly8gKGMwK2MxK2MyK2MzKQotICAgICAgICBTU1VCMTYgICAgICByb3dPcDEwLHJvd1N1bTEscm93U3VtMiAgICAgICAgICAgICAgICA7Ly8gKGMwK2MxLWMyLWMzKQotICAgICAgICBTU1VCMTYgICAgICByb3dPcDIwLHJvd0RpZmYxLHJvd0RpZmYyICAgICAgICAgICAgICA7Ly8gKGMwLWMxLWMyK2MzKQotICAgICAgICBTQUREMTYgICAgICByb3dPcDMwLHJvd0RpZmYxLHJvd0RpZmYyICAgICAgICAgICAgICA7Ly8gKGMwLWMxK2MyLWMzKQotICAgICAgICAKLSAgICAgICAgICAgICAgICAKLSAgICAgICAgOy8vIFNJTUQgb3BlcmF0aW9ucyBvbiBuZXh0IHR3byBjb2x1bW5zKG5leHQgdHdvIHJvd3Mgb2YgdGhlIG9yaWdpbmFsIG1hdHJpeCkKLSAgICAgICAgCi0gICAgICAgIFNBREQxNiAgICAgIHJvd1N1bTEsdHJSb3cwMix0clJvdzEyICAgICAgICAgICAgICAgIDsvLyAoYzArYzEpCi0gICAgICAgIFNBREQxNiAgICAgIHJvd1N1bTIsdHJSb3cyMix0clJvdzMyICAgICAgICAgICAgICAgIDsvLyAoYzIrYzMpCi0gICAgICAgIFNTVUIxNiAgICAgIHJvd0RpZmYxLHRyUm93MDIsdHJSb3cxMiAgICAgICAgICAgICAgIDsvLyAoYzAtYzEpCi0gICAgICAgIFNTVUIxNiAgICAgIHJvd0RpZmYyLHRyUm93MjIsdHJSb3czMiAgICAgICAgICAgICAgIDsvLyAoYzItYzMpCi0gICAgICAgIFNBREQxNiAgICAgIHJvd09wMDIscm93U3VtMSxyb3dTdW0yICAgICAgICAgICAgICAgIDsvLyAoYzArYzErYzIrYzMpCi0gICAgICAgIFNTVUIxNiAgICAgIHJvd09wMTIscm93U3VtMSxyb3dTdW0yICAgICAgICAgICAgICAgIDsvLyAoYzArYzEtYzItYzMpCi0gICAgICAgIFNTVUIxNiAgICAgIHJvd09wMjIscm93RGlmZjEscm93RGlmZjIgICAgICAgICAgICAgIDsvLyAoYzAtYzEtYzIrYzMpCi0gICAgICAgIFNBREQxNiAgICAgIHJvd09wMzIscm93RGlmZjEscm93RGlmZjIgICAgICAgICAgICAgIDsvLyAoYzAtYzErYzItYzMpCi0gICAgICAgIAotICAgICAgICAKLSAgICAgICAgCi0gICAgICAgIDsqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgotICAgICAgICA7Ly8gVHJhbnNwb3NlIHRoZSByZXN1bHRhbnQgbWF0cml4Ci0gICAgICAgIDsvLyBJbnB1dDogIHJvd09wW11bXQotICAgICAgICA7Ly8gT3V0cHV0OiB0ckNvbFtdW10gCi0gICAgICAgIDsqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgotICAgICAgICAKLSAgICAgICAgOy8vIExMIDJ4MiB0cmFuc3Bvc2VkIG1hdHJpeCAKLSAgICAgICAgOy8vICAgZDAgZDEgLSAtCi0gICAgICAgIDsvLyAgIGQ0IGQ1IC0gLQotICAgICAgICA7Ly8gICAtICAtICAtIC0KLSAgICAgICAgOy8vICAgLSAgLSAgLSAtCi0gICAgICAgIAotICAgICAgICBQS0hUQiAgIHRyQ29sMTAscm93T3AxMCxyb3dPcDAwLEFTUiAjMTYgICAgICAgICAgIDsvLyBbNSA0XSA9IFtmNTpmMV0KLSAgICAgICAgUEtIQlQgICB0ckNvbDAwLHJvd09wMDAscm93T3AxMCxMU0wgIzE2ICAgICAgICAgICA7Ly8gWzEgMF0gPSBbZjQ6ZjBdICAKLSAgICAgICAgCi0gICAgICAgIDsvLyBITCAyeDIgdHJhbnNwb3NlZCBtYXRyaXggIAotICAgICAgICA7Ly8gICAgLSAgIC0gICAtIC0KLSAgICAgICAgOy8vICAgIC0gICAtICAgLSAtCi0gICAgICAgIDsvLyAgICBkOCAgZDkgIC0gLQotICAgICAgICA7Ly8gICBkMTIgZDEzICAtIC0KLSAgICAgICAgCi0gICAgICAgICAKLSAgICAgICAgIFBLSFRCICAgdHJDb2wzMCxyb3dPcDEyLHJvd09wMDIsQVNSICMxNiAgICAgICAgICA7Ly8gWzEzIDEyXSA9IFs3IDNdCi0gICAgICAgICBQS0hCVCAgIHRyQ29sMjAscm93T3AwMixyb3dPcDEyLExTTCAjMTYgICAgICAgICAgOy8vIFs5IDhdID0gWzYgMl0gCi0gICAgICAgIAotICAgICAgICA7Ly8gTEggMngyIHRyYW5zcG9zZWQgbWF0cml4IAotICAgICAgICA7Ly8gICAtIC0gZDIgZDMgCi0gICAgICAgIDsvLyAgIC0gLSBkNiBkNyAKLSAgICAgICAgOy8vICAgLSAtIC0gIC0KLSAgICAgICAgOy8vICAgLSAtIC0gIC0KLSAgICAgICAgCi0gICAgICAgIFBLSEJUICAgdHJDb2wwMixyb3dPcDIwLHJvd09wMzAsTFNMICMxNiAgICAgICAgICAgOy8vIFszIDJdID0gW2YxMjpmOF0gIAotICAgICAgICBQS0hUQiAgIHRyQ29sMTIscm93T3AzMCxyb3dPcDIwLEFTUiAjMTYgICAgICAgICAgIDsvLyBbNyA2XSA9IFtmMTM6ZjldIAotICAgICAgICAKLSAgICAgICAgCi0gICAgICAgIAotICAgICAgICAgCi0gICAgICAgIDsvLyBISCAyeDIgdHJhbnNwb3NlZCBtYXRyaXggIAotICAgICAgICA7Ly8gICAgLSAtICAgLSAgIC0KLSAgICAgICAgOy8vICAgIC0gLSAgIC0gICAtCi0gICAgICAgIDsvLyAgICAtIC0gIGQxMCBkMTEKLSAgICAgICAgOy8vICAgIC0gLSAgZDE0IGQxNQotICAgICAgICAKLSAgICAgICAgUEtIVEIgICB0ckNvbDMyLHJvd09wMzIscm93T3AyMixBU1IgIzE2ICAgICAgICAgICAgOy8vIFsxNSAxNF0gPSBbMTUgMTFdCi0gICAgICAgIFBLSEJUICAgdHJDb2wyMixyb3dPcDIyLHJvd09wMzIsTFNMICMxNiAgICAgICAgICAgIDsvLyBbMTEgMTBdID0gWzE0IDEwXQotICAgICAgIAotICAgICAgICAKLSAgICAgICAgOyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogCi0gICAgICAgIDsvLyBDb2xvdW1uIE9wZXJhdG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gICAgIGNvbERpZmYyLHRyQ29sMjAsdHJDb2wzMCAgICAgICAgICAgICAgIDsvLyAoYzItYzMpCi0gICAgICAgIFNBREQxNiAgICAgIGNvbE9wMDAsY29sU3VtMSxjb2xTdW0yICAgICAgICAgICAgICAgIDsvLyAoYzArYzErYzIrYzMpCi0gICAgICAgIFNTVUIxNiAgICAgIGNvbE9wMTAsY29sU3VtMSxjb2xTdW0yICAgICAgICAgICAgICAgIDsvLyAoYzArYzEtYzItYzMpCi0gICAgICAgIFNTVUIxNiAgICAgIGNvbE9wMjAsY29sRGlmZjEsY29sRGlmZjIgICAgICAgICAgICAgIDsvLyAoYzAtYzEtYzIrYzMpCi0gICAgICAgIFNBREQxNiAgICAgIGNvbE9wMzAsY29sRGlmZjEsY29sRGlmZjIgICAgICAgICAgICAgIDsvLyAoYzAtYzErYzItYzMpCi0gICAgICAgIAotICAgICAgICAgICAgICAgIAotICAgICAgICA7Ly8gU0lNRCBvcGVyYXRpb25zIG9uIG5leHQgdHdvIGNvbHVtbnMobmV4dCB0d28gcm93cyBvZiB0aGUgb3JpZ2luYWwgbWF0cml4KQotICAgICAgICAKLSAgICAgICAgTERSICAgICAgICAgcFFQRGl2VGFibGUsID1hcm1WQ000UDEwX1FQRGl2VGFibGUgICAgOy8vIFFQIERpdmlzaW9uIGxvb2stdXAtdGFibGUgYmFzZSBwb2ludGVyCi0gICAgICAgIFNBREQxNiAgICAgIGNvbFN1bTEsdHJDb2wwMix0ckNvbDEyICAgICAgICAgICAgICAgIDsvLyAoYzArYzEpCi0gICAgICAgIFNBREQxNiAgICAgIGNvbFN1bTIsdHJDb2wyMix0ckNvbDMyICAgICAgICAgICAgICAgIDsvLyAoYzIrYzMpCi0gICAgICAgIFNTVUIxNiAgICAgIGNvbERpZmYxLHRyQ29sMDIsdHJDb2wxMiAgICAgICAgICAgICAgIDsvLyAoYzAtYzEpCi0gICAgICAgIFNTVUIxNiAgICAgIGNvbERpZmYyLHRyQ29sMjIsdHJDb2wzMiAgICAgICAgICAgICAgIDsvLyAoYzItYzMpCi0gICAgICAgIFNBREQxNiAgICAgIGNvbE9wMDIsY29sU3VtMSxjb2xTdW0yICAgICAgICAgICAgICAgIDsvLyAoYzArYzErYzIrYzMpCi0gICAgICAgIFNTVUIxNiAgICAgIGNvbE9wMTIsY29sU3VtMSxjb2xTdW0yICAgICAgICAgICAgICAgIDsvLyAoYzArYzEtYzItYzMpCi0gICAgICAgIExEUiAgICAgICAgIHBRUE1vZFRhYmxlLCA9YXJtVkNNNFAxMF9WTWF0cml4UVBNb2RUYWJsZSA7Ly8gUVAgTW9kdWxvIGxvb2stdXAtdGFibGUgYmFzZSBwb2ludGVyCi0gICAgICAgIExEUlNCICAgICAgIFNoaWZ0LCBbcFFQRGl2VGFibGUsIFFQXSAgICAgICAgICAgICAgIDsvLyBTaGlmdCA9IHBRUERpdlRhYmxlW1FQXQotICAgICAgICBTU1VCMTYgICAgICBjb2xPcDIyLGNvbERpZmYxLGNvbERpZmYyICAgICAgICAgICAgICA7Ly8gKGMwLWMxLWMyK2MzKQotICAgICAgICBTQUREMTYgICAgICBjb2xPcDMyLGNvbERpZmYxLGNvbERpZmYyICAgICAgICAgICAgICA7Ly8gKGMwLWMxK2MyLWMzKQotICAgICAgICAKLSAgICAgICAgICAgICAgIAotICAgICAgICBMRFJTQiAgICAgICBTY2FsZSwgW3BRUE1vZFRhYmxlLCBRUF0gICAgICAgICAgICAgICA7Ly8gU2NhbGUgPSBwUVBNb2RUYWJsZVtRUF0gCi0gICAgICAgIAotICAgICAgICA7Ly8tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tCi0gICAgICAgIDsvLwotICAgICAgICA7Ly8gPERlcXVhbnRpemU+IGltcHJvdmVzIG9uIHRoZSBjLXJlZmVyZW5jZSBjb2RlCi0gICAgICAgIDsvLyBCb3RoIHRoZSAgY2FzZXMgaS5lLiw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2FsZSArIFJvdW5kCi0gICAgICAgIFNNTEFCQiAgdGVtcDMsIGNvbE9wMDIsIFNjYWxlLCBSb3VuZCAgICAgICAgICAgICAgICA7Ly8gVGVtcDMgPSBCKGMxdzApICogU2NhbGUgKyBSb3VuZAotICAgICAgICBTTUxBVEIgIHRlbXAyLCBjb2xPcDAwLCBTY2FsZSwgUm91bmQgICAgICAgICAgICAgICAgOy8vIFRlbXAyID0gVChjMHcwKSAqIFNjYWxlICsgUm91bmQKLSAgICAgICAgU01MQVRCICB0ZW1wNCwgY29sT3AwMiwgU2NhbGUsIFJvdW5kICAgICAgICAgICAgICAgIDsvLyBUZW1wNCA9IFQoYzF3MCkgKiBTY2FsZSArIFJvdW5kCi0gICAgICAgIAotICAgICAgICBBU1IgICAgIHRlbXAxLCB0ZW1wMSwgIzIgICAgICAgICAgICAgICAgICAgICAgICAgICAgOy8vIFRlbXAxID0gVGVtcDEgPj4gMgotICAgICAgICBBU1IgICAgIHRlbXAzLCB0ZW1wMywgIzIgICAgICAgICAgICAgICAgICAgICAgICAgICAgOy8vIFRlbXAzID0gVGVtcDMgPj4gMgotICAgICAgICBQS0hCVCAgIG91dDAwLCAgdGVtcDEsIHRlbXAyLCBMU0wgIzE0ICAgICAgICAgICAgICAgOy8vIGMwdzAgID0gfCBUZW1wMiB8IFRlbXAxIHwKLSAgICAgICAgUEtIQlQgICBvdXQwMiwgIHRlbXAzLCB0ZW1wNCwgTFNMICMxNCAgICAgICAgICAgICAgIDsvLyBjMXcwICA9IHwgVGVtcDIgfCBUZW1wMSB8Ci0gICAgICAgIAotICAgICAgICAKLSAgICAgICAgOy8vIFJvdyAyCi0gICAgICAgIFNNTEFCQiAgdGVtcDEsIGNvbE9wMTAsIFNjYWxlLCBSb3VuZCAgICAgICAgICAgICAgICA7Ly8gVGVtcDEgPSBCKGMwdzApICogU2NhbGUgKyBSb3VuZAotICAgICAgICBTTUxBQkIgIHRlbXAzLCBjb2xPcDEyLCBTY2FsZSwgUm91bmQgICAgICAgICAgICAgICAgOy8vIFRlbXAzID0gQihjMXcwKSAqIFNjYWxlICsgUm91bmQKLSAgICAgICAgU01MQVRCICB0ZW1wMiwgY29sT3AxMCwgU2NhbGUsIFJvdW5kICAgICAgICAgICAgICAgIDsvLyBUZW1wMiA9IFQoYzB3MCkgKiBTY2FsZSArIFJvdW5kCi0gICAgICAgIFNNTEFUQiAgdGVtcDQsIGNvbE9wMTIsIFNjYWxlLCBSb3VuZCAgICAgICAgICAgICAgICA7Ly8gVGVtcDQgPSBUKGMxdzApICogU2NhbGUgKyBSb3VuZAotICAgICAgICAKLSAgICAgICAgQVNSICAgICB0ZW1wMSwgdGVtcDEsICMyICAgICAgICAgICAgICAgICAgICAgICAgICAgIDsvLyBUZW1wMSA9IFRlbXAxID4+IDIKLSAgICAgICAgQVNSICAgICB0ZW1wMywgdGVtcDMsICMyICAgICAgICAgICAgICAgICAgICAgICAgICAgIDsvLyBUZW1wMyA9IFRlbXAzID4+IDIKLSAgICAgICAgUEtIQlQgICBvdXQxMCwgIHRlbXAxLCB0ZW1wMiwgTFNMICMxNCAgICAgICAgICAgICAgIDsvLyBjMHcwICA9IHwgVGVtcDIgfCBUZW1wMSB8Ci0gICAgICAgIFBLSEJUICAgb3V0MTIsICB0ZW1wMywgdGVtcDQsIExTTCAjMTQgICAgICAgICAgICAgICA7Ly8gYzF3MCAgPSB8IFRlbXAyIHwgVGVtcDEgfAotICAgICAgICAKLSAgICAgICAgOy8vIFJvdyAzCi0gICAgICAgIFNNTEFCQiAgdGVtcDEsIGNvbE9wMjAsIFNjYWxlLCBSb3VuZCAgICAgICAgICAgICAgICA7Ly8gVGVtcDEgPSBCKGMwdzApICogU2NhbGUgKyBSb3VuZAotICAgICAgICBTTUxBQkIgIHRlbXAzLCBjb2xPcDIyLCBTY2FsZSwgUm91bmQgICAgICAgICAgICAgICAgOy8vIFRlbXAzID0gQihjMXcwKSAqIFNjYWxlICsgUm91bmQKLSAgICAgICAgU01MQVRCICB0ZW1wMi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gKyBSb3VuZAotICAgICAgICBTTUxBVEIgIHRlbXA0LCBjb2xPcDMyLCBTY2FsZSwgUm91bmQgICAgICAgICAgICAgICAgOy8vIFRlbXA0ID0gVChjMXcwKSAqIFNjYWxlICsgUm91bmQKLSAgICAgICAgCi0gICAgICAgIE1fTERSICAgcERhdGEscERhdGFPblN0YWNrICAgICAgICAgICAgICAgICAgICAgICAgICA7Ly8gUmVzdG9yZSBwRGF0YSBwb2ludGVyIGZyb20gc3RhY2sKLSAgICAgICAgQVNSICAgICB0ZW1wMSwgdGVtcDEsICMyICAgICAgICAgICAgICAgICAgICAgICAgICAgIDsvLyBUZW1wMSA9IFRlbXAxID4+IDIKLSAgICAgICAgQVNSICAgICB0ZW1wMywgdGVtcDMsICMyICAgICAgICAgICAgICAgICAgICAgICAgICAgIDsvLyBUZW1wMyA9IFRlbXAzID4+IDIKLSAgICAgICAgUEtIQlQgICBvdXQzMCwgIHRlbXAxLCB0ZW1wMiwgTFNMICMxNCAgICAgICAgICAgICAgIDsvLyBjMHcwICA9IHwgVGVtcDIgfCBUZW1wMSB8Ci0gICAgICAgIFBLSEJUICAgb3V0MzIsICB0ZW1wMywgdGVtcDQsIExTTCAjMTQgICAgICAgICAgICAgICA7Ly8gYzF3MCAgPSB8IFRlbXAyIHwgVGVtcDEgfAotICAgICAgICAKLSAgICAgICAgCi0gICAgICAgIAotICAgICAgICA7KioqKioqKioqKioqKioqKioqKioqKioqKioqCi0gICAgICAgIDsvLyBTdG9yZSBhbGwgdGhlIDR4NCBwaXhlbHMKLSAgICAgICAgOyoqKioqKioqKioqKioqKioqKioqKioqKioqKgotCi1zdG9yZV9jb2VmZgotICAgICAgICAKLSAgICAgICAgU1RNSUEgICBwRGF0YSx7b3V0MDAsb3V0MDIsb3V0MTAsb3V0MTIsb3V0MjAsb3V0MjIsb3V0MzAsb3V0MzJ9Ci0gICAgICAgIAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAotICAgICAgIAotICAgICAgICA7Ly8gU2V0IHJldHVybiB2YWx1ZQotICAgICAgICAKLSAgICAgICAKLSAgICAgICAgOy8vIFdyaXRlIGZ1bmN0aW9uIHRhaWwKLSAgICAgICAgTV9FTkQgICAgICAgIAotICAgICAgICAKLSAgICBFTkRJRiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOy8vQVJNMTEzNkpTICAgICAgICAKLSAgICAKLQotOy8vIFN0YXRpYyBGdW5jdGlvbjogYXJtVkNNNFAxMF9JbnZUcmFuc2Zvcm1EZXF1YW50THVtYURDNHg0Ci0KLTsvLyBHdWFyZGluZyBpbXBsZW1lbnRhdGlvbiBieSB0aGUgcHJvY2Vzc29yIG5hbWUKLSAgICAKLSAgICAgICAgCi0KLQotOy8vIEZ1bmN0aW9uOiBvbXhWQ000UDEwX1RyYW5zZm9ybURlcXVhbnRMdW1hRENGcm9tUGFpcgotICAgIAotOy8vSW5wdXQgUmVnaXN0ZXJzCi1wcFNyYyAgICAgICAgICAgICAgIFJOICAwCi1wRHN0ICAgICAgICAgICAgICAgIFJOICAxCi1RUFIyICAgICAgICAgICAgICAgIFJOICAyCi0KLTsvL091dHB1dCBSZWdpc3RlcnMKLXJlc3VsdCAgICAgICAgICAgICAgUk4gIDAKLQotOy8vTG9jYWwgU2NyYXRjaCBSZWdpc3RlcnMKLXBEc3RSNCAgICAgICAgICAgICAgUk4gIDQKLXBEc3RSMCAgICAgICAgICAgICAgUk4gIDAKLVFQUjEgICAgICAgICAgICAgICAgUk4gIDEKLVFQUjUgICAgICAgICAgICAgICAgUk4gIDUKLQotOy8vIEd1YXJkaW5nIGltcGxlbWVudGF0aW9uIGJ5IHRoZSBwcm9jZXNzb3IgbmFtZQotICAgIAotICAgIElGIEFSTTExMzZKUwotICAgICAgIAotICAgIDsvLyBBbGxvY2F0ZSBzdGFjayBtZW1vcnkgcmVxdWlyZWQgYnkgdGhlIGZ1bmN0aW9uCi0gICAgICAgIAotCi0gICAgOy8vIFdyaXRlIGZ1bmN0aW9uIGhlYWRlcgotICAgICAgICBNX1NUQVJUIG9teFZDTTRQMTBfVHJhbnNmb3JtRGVxdWFudEx1bWFEQ0Zyb21QYWlyLHI1Ci0gICAgICAgIAotICAgICAgICBNT1YgICAgIHBEc3RSNCxwRHN0ICAgICAgICAgICAgICAgICAgICAgICAgIDsvLyBTYXZpbmcgcmVnaXN0ZXIgcjEKLSAgICAgICAgTU9WICAgICBRUFI1LFFQUjIgICAgICAgICAgICAgICAgICAgICAgICAgICA7Ly8gU2F2aW5nIHJlZ2lzdGVyIHIyCi0gICAgICAgIEJMICAgICAgYXJtVkNNNFAxMF9VbnBhY2tCbG9jazR4NAotICAgICAgICAKLSAgICAgICAgTU9WICAgICBwRHN0UjAscERzdFI0ICAgICAgICAgICAgICAgICAgICAgICA7Ly8gU2V0dGluZyB1cCByZWdpc3RlciByMAotICAgICAgICBNT1YgICAgIFFQUjEsUVBSNSAgICAgICAgICAgICAgICAgICAgICAgICAgIDsvLyBTZXR0aW5nIHVwIHJlZ2lzdGVyIHIxCi0gICAgICAgIEJMICAgICAgYXJtVkNNNFAxMF9JbnZUcmFuc2Zvcm1EZXF1YW50THVtYURDNHg0Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCi0gICAgICAgCi0gICAgICAgIDsvLyBTZXQgcmV0dXJuIHZhbHVlCi0gICAgICAgIE1PViAgICAgcmVzdWx0LCNPTVhfU3RzX05vRXJyICAgICAgICAKLSAgICAgICAKLSAgICAgICAgOy8vIFdyaXRlIGZ1bmN0aW9uIHRhaWwKLSAgICAgICAgTV9FTkQKLSAgICAgICAgCi0gICAgICAgICAgICAKLSAgICBFTkRJRiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOy8vQVJNMTEzNkpTICAKLSAgICAKLQotICAgIEVORApcIE5vIG5ld2xpbmUgYXQgZW5kIG9mIGZpbGUKZGlmZiAtLWdpdCBhL21lZGlhL2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gICAgICAgICAgICAgIFJOIDMKLXgxICAgICAgICAgICAgICAgICAgIFJOIDQKLXgyICAgICAgICAgICAgICAgICAgIFJOIDUKLXgzICAgICAgICAgICAgICAgICAgIFJOIDYKLQotQ291bnQgICAgICAgICAgICAgICAgUk4gMTQKLSAgICAgCi0gICAgICAgIAotICAgICAgICBNX1NUQVJUIGFybVZDTTRQMl9DbGlwOCxyNgotICAgICAgIAotCi0gICAgICAgIE1PViAgICAgICAgICBDb3VudCwjOAotbG9vcAotCi0gICAgICAgIExETUlBICAgICAgICBwU3JjISx7eDAsIHgxfQotICAgICAgICBTVUJTICAgICAgICAgQ291bnQsQ291bnQsICMxICAgICAgICAgIDsvLyBjb3VudCBkb3duCi0gICAgICAgIExETUlBICAgICAgICBwU3JjISx7eDIsIHgzfQotICAgICAgICBVU0FUMTYgICAgICAgeDAsICM4LCB4MCAgICAgICAgICAgICAgICAgOy8vIGNsaXAgdHdvIHNhbXBsZXMgdG8gWzAsMjU1XQotICAgICAgICBVU0FUMTYgICAgICAgeDEsICM4LCB4MSAgICAgICAgICAgICAgICAgOy8vIGNsaXAgdHdvIHNhbXBsZXMgdG8gWzAsMjU1XQotICAgICAgICBTVFJCICAgICAgICAgeDAsIFtwRHN0XQotICAgICAgICBNT1YgICAgICAgICAgeDAsIHgwLCBMU1IgIzE2Ci0gICAgICAgIFNUUkIgICAgICAgICB4MCwgW3BEc3QsIzFdCi0gICAgICAgIFNUUkIgICAgICAgICB4MSwgW3BEc3QsIzJdCi0gICAgICAgIE1PViAgICAgICAgICB4MSwgeDEsIExTUiAjMTYKLSAgICAgICAgU1RSQiAgICAgICAgIHgxLCBbcERzdCwjM10KLSAgICAgICAgICAgICAgICAKLSAgICAgICAgVVNBVDE2ICAgICAgIHgyLCAjOCwgeDIgICAgICAgICAgICAgICAgIDsvLyBjbGlwIHR3byBzYW1wbGVzIHRvIFswLDI1NV0KLSAgICAgICAgVVNBVDE2ICAgICAgIHgzLCAjOCwgeDMgICAgICAgICAgIC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c2V0ICAgICAgICAgICBSTiAxCi1wRHN0ICAgICAgICAgICAgICAgICBSTiAyCi1zaG9ydFZpZGVvSGVhZGVyICAgICBSTiAzCi0KLQotOy8vTG9jYWwgVmFyaWFibGVzCi0KLVJldHVybiAgICAgICAgICAgICAgIFJOIDAKLQotcFZsY1RhYmxlTDBMMSAgICAgICAgUk4gNAotcExNQVhUYWJsZUwwTDEgICAgICAgUk4gNAotcFJNQVhUYWJsZUwwTDEgICAgICAgUk4gNAotcFppZ3phZ1RhYmxlICAgICAgICAgUk4gNAotCi1mdHlwZSAgICAgICAgICAgICAgICBSTiAwCi10ZW1wMyAgICAgICAgICAgICAgICBSTiA0Ci10ZW1wICAgICAgICAgICAgICAgICBSTiA1Ci1Db3VudCAgICAgICAgICAgICAgICBSTiA2Ci1Fc2NhcGUgICAgICAgICAgICAgICBSTiA1Ci0KLTsvLyBhcm1WQ000UDJfRmlsbFZMREJ1ZmZlcgotemlnemFnICAgICAgICAgICAgICAgUk4gMAotc3RvcmVMZXZlbCAgICAgICAgICAgUk4gMQotdGVtcDIgICAgICAgICAgICAgICAgUk4gNAotdGVtcDEgICAgICAgICAgICAgICAgUk4gNQotc2lnbiAgICAgICAgICAgICAgICAgUk4gNQotTGFzdCAgICAgICAgICAgICAgICAgUk4gNwotc3RvcmVSdW4gICAgICAgICAgICAgUk4gMTQKLQotCi1wYWNrUmV0SW5kZXggICAgICAgICBSTiA1Ci0KLQotbWFya2VyYml0ICAgICAgICAgICAgUk4gNQotCi07Ly8gU2NyYXRjaCBSZWdpc3RlcnMKLQotUkJpdFN0cmVhbSAgICAgICAgICAgUk4gOAotUkJpdEJ1ZmZlciAgICAgICAgICAgUk4gOQotUkJpdENvdW50ICAgICAgICAgICAgUk4gMTAKLQotVDEgICAgICAgICAgICAgICAgICAgUk4gMTEKLVQyICAgICAgICAgICAgICAgICAgIFJOIDEyCi1MUiAgICAgICAgICAgICAgICAgICBSTiAxNCAgICAgICAgCi0gICAgICAgIAotCi0KLSAgICAgICAgTV9BTExPQzQgICAgICAgIHBwcEJpdFN0cmVhbSw0Ci0gICAgICAgIE1fQUxMT0M0ICAgICAgICBwcE9mZnNldCw0Ci0gICAgICAgIE1fQUxMT0M0ICAgICAgICBwTGlua1JlZ2lzdGVyLDQgICAgICAgCi0gICAgICAgIAotICAgICAgICBNX1NUQVJUIGFybVZDTTRQMl9EZWNvZGVWTENaaWd6YWdfQUNfdW5zYWZlCi0KLSAgICAgICAgOy8vIGdldCB0aGUgdGFibGUgYWRkcmVzc2VzIGZyb20gc3RhY2sgICAgICAgCi0gICAgICAgIE1fQVJHICAgICAgICAgICBwcFZsY1RhYmxlTDBMMSw0Ci0gICAgICAgIE1fQVJHICAgICAgICAgICBwcExNQVhUYWJsZUwwTDEsNAotICAgICAgICBNX0FSRyAgICAgICAgICAgcHBSTUFYVGFibGVMMEwxLDQKLSAgICAgICAgTV9BUkcgICAgICAgICAgIHBwWmlnemFnVGFibGUsNAotICAgICAgICAKLSAgICAgICAgOy8vIFN0b3JlIEFMTCB6ZXJvcyBhdCBwRHN0Ci0gICAgICAgIAotICAgICAgICBNT1YgICAgICAgICAgICAgdGVtcDEsIzAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOy8vIEluaXRpYWxpemUgQ291bnQgdG8gemVybyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCi0gICAgICAgIE1PViAgICAgICAgICAgICBMYXN0LCMwCi0gICAgICAgIE1fU1RSICAgICAgICAgICBMUixwTGlua1JlZ2lzdGVyICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA7Ly8gU3RvcmUgTGluayBSZWdpc3RlciBvbiBTdGFjawotICAgICAgICBNT1YgICAgICAgICAgICAgdGVtcDIsIzAKLSAgICAgICAgTU9WICAgICAgICAgICAgIExSLCMwICAgICAgICAgIAotICAgICAgICAKLSAgICAgICAgOy8vIEluaXRpYWxpemUgdGhlIE1hY3JvIGFuZCBTdG9yZSBhbGwgemVyb3MgdG8gcERzdCAKLSAgCi0gICAgICAgIFNUTSAgICAgICAgICAgICBwRHN0ISx7dGVtcDIsdGVtcDEsTGFzdCxMUn0gICAgICAgICAgICAgICAgICAgCi0gICAgICAgIE1fQkRfSU5JVDAgICAgICBwcEJpdFN0cmVhbSwgcEJpdE9mZnNldCwgUkJpdFN0cmVhbSwgUkJpdEJ1ZmZlciwgUkJpdENvdW50ICAKLSAgICAgICAgU1RNICAgICAgICAgICAgIHBEc3QhLHt0ZW1wMix0ZW1wMSxMYXN0LExSfQotICAgICAgICBNX0JEX0lOSVQxICAgICAgVDEsIFQyLCBUMgotICAgICAgICBTVE0gICAgICAgICAgICAgcERzdCEse3RlbXAyLHRlbXAxLExhc3QsTFJ9Ci0gICAgICAgIE1fQkRfSU5JVDIgICAgICBUMSwgVDIsIFQyCi0gICAgICAgIFNUTSAgICAgICAgICAgICBwRHN0ISx7dGVtcDIsdGVtcDEsTGFzdCxMUn0KLSAgICAgICAgTV9TVFIgICAgICAgICAgIHBwQml0U3RyZWFtLHBwcEJpdFN0cmVhbSAgICAgICAgICAgICAgICAgICAgICAgIDsvLyBTdG9yZSBwcEJpdHN0cmVhbSBvbiBzdGFjayAgICAgICAgICAgICAgICAgICAgICAgICAKLSAgICAgICAgU1RNICAgICAgICAgICAgIHBEc3QhLHt0ZW1wMix0ZW1wMSxMYXN0LExSfQotICAgICAgICBNX1NUUiAgICAgICAgICAgcEJpdE9mZnNldCxwcE9mZnNldCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOy8vIFN0b3JlIHBCaXRPZmZzZXQgb24gc3RhY2sKLSAgICAgICAgU1RNICAgICAgICAgICAgIHBEc3QhLHt0ZW1wMix0ZW1wMSxMYXN0LExSfQotICAgICAgICAKLSAgICAgICAgU1RNICAgICAgICAgICAgIHBEc3QhLHt0ZW1wMix0ZW1wMSxMYXN0LExSfQotICAgICAgICBTVE0gICAgICAgICAgICAgcERzdCEse3RlbXAyLHRlbXAxLExhc3QsTFJ9Ci0gCi0gICAgICAgIAotICAgICAgICBTVUIgICAgICAgICAgICAgcERzdCxwRHN0LCMxMjggICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOy8vIFJlc3RvcmUgcERzdAotCi0gICAgICAgIDsvLyBUaGUgYXJtVkNNNFAyX0dldFZMQ0JpdHMgYmVnaW5zCi0KLWdldFZMQ2JpdHMKLSAgICAgICAgCi0gICAgICAgIE1fQkRfTE9PSzggICAgICBFc2NhcGUsNyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA7Ly8gTG9hZCBFc2NhcGUgVmFsdWUKLSAgICAgICAgTFNSICAgICAgICAgICAgIEVzY2FwZSxFc2NhcGUsIzI1ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKLSAgICAgICAgQ01QICAgICAgICAgICAgIEVzY2FwZSwjMyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDsvLyBjaGVjayBmb3IgZXNjYXBlIG1vZGUKLSAgICAgICAgTU9WTkUgICAgICAgICAgIGZ0eXBlLCMwCi0gICAgICAgIEJORSAgICAgICAgICAgICBub3RFc2NhcGVtb2RlICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA7Ly8gQnJhbmNoIGlmIG5vdCBpbiBFc2NhcGUgbW9kZSAzCi0KLSAgICAgICAgTV9CRF9WU0tJUDggICAgICM3LFQxCi0gICAgICAgIENNUCAgICAgICAgICAgICBzaG9ydFZpZGVvSGVhZGVyLCMwICAgICAgICAgICAgICAgICAgICAgICAgICAgICA7Ly8gQ2hlY2sgc2hvcnRWaWRlb0hlYWRlciBmbGFnIHRvIGtub3cgdGhlIHR5cGUgb2YgRXNjYXBlIG1vZGUKLSAgICAgICAgQkVRICAgICAgICAgICAgIGVuZEZpbGxWTEQgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKLSAgICAgICAgCi0gICAgICAgIDsvLyBFc2NhcGUgTW9kZSA0Ci0KLSAgICAgICAgTV9CRF9SRUFEOCAgICAgIExhc3QsMSxUMQotICAgICAgICBNX0JEX1JFQUQ4ICAgICAgc3RvcmVSdW4sNixUMQotICAgICAgICBNX0JEX1JFQUQ4ICAgICAgc3RvcmVMZXZlbCw4LFQxCi0KLSAgICAgICAgICAgCi0gICAgICAgIDsvLyBDaGVjayB3aGV0aGVyIHRoZSBSZXNlcnZlZCB2YWx1ZXMgZm9yIExldmVsIGFyZSB1c2VkIGFuZCBFeGl0IHdpdGggYW4gRXJyb3IgTWVzc2FnZSBpZiBpdCBpcyBzbwotCi0gICAgICAgIFRFUSAgICAgICAgICAgICBzdG9yZUxldmVsLCMwCi0gICAgICAgIFRFUU5FICAgICAgICAgICBzdG9yZUxldmVsLCMxMjggICAgICAgICAgICAgICAgICAgIAotICAgICAgICBCRVEgICAgICAgICAgICAgRXhpdEVycm9yCi0KLSAgICAgICAgQUREICAgICAgICAgICAgIHRlbXAyLHN0b3JlUnVuLENvdW50Ci0gICAgICAgIENNUCAgICAgICAgICAgICB0ZW1wMiwjNjQKLSAgICAgICAgQkdFICAgICAgICAgICAgIEV4aXRFcnJvciAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDsvLyBlcnJvciBpZiBDb3VudCtzdG9yZVJ1biA+PSA2NAotICAgICAgICAKLSAgICAgICAgCi0gICAgICAgIDsvLyBMb2FkIGFkZHJlc3Mgb2YgemlnemFnVGFibGUKLSAgICAgICAgCi0gICAgICAgIE1fTERSICAgICAgICAgICBwWmlnemFnVGFibGUscHBaaWd6YWdUYWJsZSAgICAgICAgICAgICAgICAgICAgICA7Ly8gTG9hZGluZyB0aGUgQWRkcmVzcyBvZiBaaWd6YWcgdGFibGUKLSAgICAgICAgICAgICAgIAotICAgICAgICAgICAgICAgIAotICAgICAgICA7Ly8gYXJtVkNNNFAyX0ZpbGxWTERCdWZmZXIKLSAgICAgICAgICAgICAgICAKLSAgICAgICAgU1hUQiAgICAgICAgICAgIHN0b3JlTGV2ZWwsc3RvcmVMZXZlbCAgICAgICAgICAgICAgICAgICAgICAgICAgIDsvLyBTaWduIEV4dGVuZCBzdG9yZUxldmVsIHRvIDMyIGJpdHMKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAotICAgICAgICAKLSAgICAgICAgOy8vIFRvIFJlZmxlY3QgUnVubGVuZ3RoCi0KLSAgICAgICAgQUREICAgICAgICAgICAgIENvdW50LENvdW50LHN0b3JlUnVuCi0gICAgICAgIExEUkIgICAgICAgICAgICB6aWd6YWcsW3BaaWd6YWdUYWJsZSxDb3VudF0KLSAgICAgICAgQUREICAgICAgICAgICAgIENvdW50LENvdW50LCMxCi0gICAgICAgIFNUUkggICAgICAgICAgICBzdG9yZUxldmVsLFtwRHN0LHppZ3phZ10gICAgICAgICAgICAgICAgICAgICAgICA7Ly8gc3RvcmUgTGV2ZWwKLSAgICAgICAgICAgICAgCi0gICAgICAgIEIgICAgICAgICAgICAgICBFeGl0T2sKLSAgICAgICAKLSAgICAgICAgCi0KLWVuZEZpbGxWTEQKLSAgICAgICAgCi0gICAgICAgICAgICAgICAKLSAgICAgICAgOy8vIExvYWQgRnR5cGUoIEVzY2FwZSBNb2RlKSB2YWx1ZSBiYXNlZCBvbiB0aGUgdHdvIHN1Y2Nlc3NpdmUgYml0cyBpbiB0aGUgYml0c3RyZWFtCi0gICAgIAotICAgICAgICBNX0JEX1JFQUQ4ICAgICAgdGVtcDEsMSxUMSAgICAgICAgICAgCi0gICAgICAgIENNUCAgICAgICAgICAgICB0ZW1wMSwjMCAgICAKLSAgICAgICAgTU9WRVEgICAgICAgICAgIGZ0eXBlLCMxCi0gICAgICAgIEJFUSAgICAgICAgICAgICBub3RFc2NhcGVtb2RlCi0gICAgICAgIE1fQkRfUkVBRDggICAgICB0ZW1wMSwxLFQxCi0gICAgICAgIENNUCAgICAgICAgICAgICB0ZW1wMSwjMQotICAgICAgICBNT1ZFUSAgICAgICAgICAgZnR5cGUsIzMKLSAgICAgICAgTU9WTkUgICAgICAgICAgIGZ0eXBlLCMyCi0gICAgICAgIAotCi1ub3RFc2NhcGVtb2RlCi0KLSAgICAgICAgOy8vIExvYWQgb3B0aW1pemVkIHBhY2tlZCBWTEMgdGFibGUgd2l0aCBsYXN0PTAgYW5kIExhc3Q9MQotICAgICAgICAKLSAgICAgICAgTV9MRFIgICAgICAgICAgIHBWbGNUYWJsZUwwTDEscHBWbGNUYWJsZUwwTDEgICAgICAgICAgICAgICAgICAgIDsvLyBMb2FkIENvbWJpbmVkIFZMQyBUYWJsZQotICAgICAgICAgICAgICAgIAotICAgICAgIAotICAgICAgICBDTVAgICAgICAgICAgICAgZnR5cGUsIzMgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOy8vIElmIGZ0eXBlID49MyBnZXQgcGVyZm9ybSBGaXhlZCBMZW5ndGggRGVjb2RpbmcgKEVzY2FwZSBNb2RlIDMpCi0gICAgICAgIEJHRSAgICAgICAgICAgICBFc2NhcGVNb2RlMyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA7Ly8gRWxzZSBjb250aW51ZSBub3JtYWwgVkxDIERlY29kaW5nCi0gICAgICAgIAotICAgICAgICA7Ly8gVmFyaWFibGUgbGVuZ2ggZGVjb2RpbmcsICJhcm1VblBhY2tWTEMzMiIgCi0gICAgICAgIAotICAgICAgICAKLSAgICAgICAgTV9CRF9WTEQgICAgICAgIHBhY2tSZXRJbmRleCxUMSxUMixwVmxjVGFibGVMMEwxLDQsMgotICAgICAgICAKLSAgICAgICAgCi0gICAgICAgIExEUiAgICAgICAgICAgICB0ZW1wMyw9MHhGRkYKLSAgICAgICAgCi0gICAgICAgIENNUCAgICAgICAgICAgICBwYWNrUmV0SW5kZXgsdGVtcDMgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA7Ly8gQ2hlY2sgZm9yIGludmFsaWQgc3ltYm9sCi0gICAgICAgIEJFUSAgICAgICAgICAgICBFeGl0RXJyb3IgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA7Ly8gaWYgaW52YWxpZCBzeW1ib2wgb2NjdXJzIGV4aXQgd2l0aCBhbiBlcnJvciBtZXNzYWdlCi0gICAgICAgIAotICAgICAgICBBTkQgICAgICAgICAgICAgTGFzdCxwYWNrUmV0SW5kZXgsIzIgICAgICAgICAgICAgICAgICAgICAgICAgICAgOy8vIEdldCBMYXN0IGZyb20gcGFja2VkIEluZGV4Ci0gICAgICAgICAgICAgIAotICAgICAgICAgCi0gICAgICAgIAotCi0gICAgICAgIExTUiAgICAgICAgICAgICBzdG9yZVJ1bixwYWNrUmV0SW5kZXgsIzcgICAgICAgICAgICAgICAgICAgICAgICA7Ly8gR2V0IFJ1biBWYWx1ZSBmcm9tIFBhY2tlZCBpbmRleAotICAgICAgICBBTkQgICAgICAgICAgICAgc3RvcmVMZXZlbCxwYWNrUmV0SW5kZXgsIzB4N2MgICAgICAgICAgICAgICAgICAgOy8vIHN0b3JlTGV2ZWw9cGFja1JldEluZGV4WzItNl0sc3RvcmVMZXZlbFswLTFdPTAgCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKLSAgICAgCi0gICAgICAgIE1fTERSICAgICAgICAgICBwTE1BWFRhYmxlTDBMMSxwcExNQVhUYWJsZUwwTDEgICAgICAgICAgICAgICAgICA7Ly8gTG9hZCBMTUFYIHRhYmxlCi0gICAgICAgICAgICAgIAotICAgICAgIAotICAgICAgICBMU1IgICAgICAgICAgICAgc3RvcmVMZXZlbCxzdG9yZUxldmVsLCMyICAgICAgICAgICAgICAgICAgICAgICAgOy8vIExldmVsIHZhbHVlCi0KLSAgICAgICAgQ01QICAgICAgICAgICAgIGZ0eXBlLCMxICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCi0gICAgICAgIEJORSAgICAgICAgICAgICBmdHlwZTIKLSAgICAgICAgCi0gICAgICAgIDsvLyBmdHlwZT09MTsgRXNjYXBlIG1vZGUgPTEKLSAgICAgICAgICAKLSAgICAgICAgCi0gICAgICAgIEFERCAgICAgICAgICAgIHRlbXAxLCBwTE1BWFRhYmxlTDBMMSwgTGFzdCwgTFNMIzQgICAgICAgICAgICAgIDsvLyBJZiB0aGUgTGFzdD0xIGFkZCAzMiB0byB0YWJsZSBhZGRyZXNzCi0gICAgICAgIExEUkIgICAgICAgICAgICB0ZW1wMSxbdGVtcDEsc3RvcmVSdW5dCi0KLSAgICAgICAKLSAgICAgICAgQUREICAgICAgICAgICAgIHN0b3JlTGV2ZWwsdGVtcDEsc3RvcmVMZXZlbCAgICAgICAgICAgICAgICAgICAgIAotCi1mdHlwZTIKLQotICAgICAgICA7Ly8gZnR5cGUgPTI7IEVzY2FwZSBtb2RlID0yCi0gICAgICAgIAotICAgICAgICBNX0xEUiAgICAgICAgICAgcFJNQVhUYWJsZUwwTDEscHBSTUFYVGFibGVMMEwxICAgICAgICAgICAgICAgICAgOy8vIExvYWQgUk1BWCBUYWJsZSAKLSAgICAgICAgICAgICAgICAKLSAgICAgICAgQ01QICAgICAgICAgICAgIGZ0eXBlLCMyCi0gICAgICAgIEJORSAgICAgICAgICAgICBGaWxsVkxETDEKLSAgICAgICAgICAgICAgICAgIAotICAgICAgICBBREQgICAgICAgICAgICB0ZW1wMSwgcFJNQVhUYWJsZUwwTDEsIExhc3QsIExTTCM0ICAgICAgICAgICAgICAgOy8vIElmIExhc3Q9MSBhZGQgMzIgdG8gdGFibGUgYWRkcmVzcwotICAgICAgICBTVUIgICAgICAgICAgICAgdGVtcDIsc3RvcmVMZXZlbCwjMQotICAgICAgICBMRFJCICAgICAgICAgICAgdGVtcDEsW3RlbXAxLHRlbXAyXQotCi0gICAgICAgCi0gICAgICAgIEFERCAgICAgICAgICAgICBzdG9yZVJ1bixzdG9yZVJ1biwjMQotICAgICAgICBBREQgICAgICAgICAgICAgc3RvcmVSdW4sdGVtcDEKLSAgICAgICAgCi1GaWxsVkxETDEgICAgICAgIAotICAgICAgICAgICAgCi0gICAgICAgICAgICAgICAgCi0gICAgICAgIDsvLyBhcm1WQ000UDJfRmlsbFZMREJ1ZmZlcgotCi0gICAgICAgIE1fTERSICAgICAgICAgICBwWmlnemFnVGFibGUscHBaaWd6YWdUYWJsZSAgICAgICAgICAgICAgICAgICAgIDsvLyBMb2FkIGFkZHJlc3Mgb2YgemlnemFnVGFibGUgCi0gICAgICAgICAgICAgICAgCi0gICAgICAgIE1fQkRfUkVBRDggICAgICBzaWduLDEsVDEKLQotICAgICAgICBDTVAgICAgICAgICAgICAgc2lnbiwjMQotICAgICAgICBSU0JFUSAgICAgICAgICAgc3RvcmVMZXZlbCxzdG9yZUxldmVsLCMwCi0gCi0gICAgICAgIEFERCAgICAgICAgICAgICB0ZW1wMSxzdG9yZVJ1bixDb3VudCAgICAgICAgICAgICAgICAgICAgICAgICAgIDsvLyBFeGl0IHdpdGggYW4gZXJyb3IgbWVzc2FnZSBpZiBSdW4gKyBDb3VudCBleGNlZWRzIDYzCi0gICAgICAgIENNUCAgICAgICAgICAgICB0ZW1wMSwjNjQKLSAgICAgICAgQkdFICAgICAgICAgICAgIEV4aXRFcnJvcgotCi0gICAgICAKLSAgICAgICAgCi0gICAgICAgIAotICAgICAgICAgICAgICAKLSAgICAgICAgCi0gICAgICAgIDsvLyBUbyBSZWZsZWN0IFJ1bmxlbmdodAotCi0gICAgICAgIEFERCAgICAgICAgICAgICBDb3VudCxDb3VudCxzdG9yZVJ1bgotIAotc3RvcmVMZXZlbEwxCi0gICAgICAgIAotICAgICAgICBMRFJCICAgICAgICAgICAgemlnemFnLFtwWmlnemFnVGFibGUsQ291bnRdCi0gICAgICAgIENNUCAgICAgICAgICAgICBMYXN0LCMyICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA7Ly8gQ2hlY2sgaWYgdGhlIExldmVsIHZhbCBpcyBMYXN0IG5vbiB6ZXJvIHZhbAotICAgICAgICBBREQgICAgICAgICAgICAgQ291bnQsQ291bnQsIzEKLSAgICAgICAgTFNSICAgICAgICAgICAgIExhc3QsTGFzdCwjMQotICAgICAgICBTVFJIICAgICAgICAgICAgc3RvcmVMZXZlbCxbcERzdCx6aWd6YWddICAgICAgICAgICAgICAgICAgCi0gICAgICAgICAgIAotICAgICAgICBCTkUgICAgICAgICAgICAgZW5kCi0gICAgICAgIAotICAgICAgICBCICAgICAgICAgICAgICAgRXhpdE9rCi0gCi0KLQotICAgICAgICA7Ly8gRml4ZWQgTGVuZ2ggRGVjb2RpbmcgRXNjYXBlIE1vZGUgMwotCi1Fc2NhcGVNb2RlMwotCi0gICAgICAgIE1fQkRfUkVBRDggICAgICBMYXN0LDEsVDEKLSAgICAgICAgTV9CRF9SRUFEOCAgICAgIHN0b3JlUnVuLDYsVDEKLSAgICAgICAgCi0gICAgICAgIEFERCAgICAgICAgICAgICB0ZW1wMixzdG9yZVJ1bixDb3VudCAgICAgICAgICAgICAgICAgICAgICAgICAgICA7Ly8gRXhpdCB3aXRoIGFuIGVycm9yIG1lc3NhZ2UgaWYgUnVuICsgQ291bnQgZXhjZWVkcyA2MwotICAgICAgICBDTVAgICAgICAgICAgICAgdGVtcDIsIzY0Ci0gICAgICAgIEJHRSAgICAgICAgICAgICBFeGl0RXJyb3IKLQotICAgICAgICBNX0JEX1JFQUQ4ICAgICAgbWFya2VyYml0LDEsVDEKLSAgICAgICAgVEVRICAgICAgICAgICAgIG1hcmtlcmJpdCwjMCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDsvLyBFeGl0IHdpdGggYW4gZXJyb3IgbWVzc2FnZSBpZiBtYXJrZXIgYml0IGlzIHplcm8KLSAgICAgICAgQkVRICAgICAgICAgICAgIEV4aXRFcnJvcgotICAgICAgICAKLSAgICAgICAgTV9CRF9SRUFEMTYgICAgIHN0b3JlTGV2ZWwsMTIsVDEKLQotICAgICAgICBUU1QgICAgICAgICAgICAgc3RvcmVMZXZlbCwjMHg4MDAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOy8vIHRlc3QgaWYgdGhlIGxldmVsIGlzIG5lZ2F0aXZlCi0gICAgICAgIFNVQk5FICAgICAgICAgICBzdG9yZUxldmVsLHN0b3JlTGV2ZWwsIzQwOTYKLSAgICAgICAgQ01QICAgICAgICAgICAgIHN0b3JlTGV2ZWwsIzAKLSAgICAgICAgQ01QTkUgICAgICAgICAgIHN0b3JlTGV2ZWwsIy0yMDQ4Ci0gICAgICAgIEJFUSAgICAgICAgICAgICBFeGl0RXJyb3IgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA7Ly8gRXhpdCB3aXRoIGFuIGVycm9yIG1lc3NhZ2UgaWYgTGV2ZWw9PTAgb3IgIC0yMDQ4IAotCi0gICAgICAgIE1fTERSICAgICAgICAgICBwWmlnemFnVGFibGUscHBaaWd6YWdUYWJsZSAgICAgICAgICAgICAgICAgICAgICA7Ly8gTG9hZCBhZGRyZXNzIG9mIHppZ3phZ1RhYmxlCi0gICAgICAgICAgICAgIAotICAgICAgICBNX0JEX1JFQUQ4ICAgICAgbWFya2VyYml0LDEsVDEKLSAgICAgICAgICAgCi0KLSAgICAgICAgOy8vIGFybVZDTTRQMl9GaWxsVkxEQnVmZmVyICggU2lnbiBub3QgdXNlZCBhcyBzdG9yZUxldmVsIGlzIHByZXByb2Nlc3NlZCkKLSAgICAgICAgICAgIAotICAgICAgICAgICAgICAgCi0KLSAgICAgICAgOy8vIFRvIFJlZmxlY3QgUnVuIExlbmd0aAotCi0gICAgICAgIEFERCAgICAgICAgICAgICBDb3VudCxDb3VudCxzdG9yZVJ1bgotCi0KLSAKLXN0b3JlTGV2ZWxMYXN0Ci0gICAgICAgIAotICAgICAgICBMRFJCICAgICAgICAgICAgemlnemFnLFtwWmlnemFnVGFibGUsQ291bnRdCi0gICAgICAgIENNUCAgICAgICAgICAgICBMYXN0LCMxCi0gICAgICAgIEFERCAgICAgICAgICAgICBDb3VudCxDb3VudCwjMQotICAgICAgICBTVFJIICAgICAgICAgICAgc3RvcmVMZXZlbCxbcERzdCx6aWd6YWddICAgICAgICAgICAgICAgICAgICAgICAgICAKLSAgICAgICAgICAgICAgICAKLSAgICAgICAgQk5FICAgICAgICAgICAgIGVuZCAKLSAgICAgIAotICAgICAgICBCICAgICAgICAgICAgICAgRXhpdE9rCi0gICAgICAgIAotZW5kCi0KLSAgICAgICAgQ01QICAgICAgICAgICAgIENvdW50LCM2NCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDsvL1J1biB0aGUgTG9vcCB1bnRpbGwgQ291bnQgcmVhY2hlcyA2NAotCi0gICAgICAgIEJMVCAgICAgICAgICAgICBnZXRWTENiaXRzCi0KLSAgICAgICAgCi1FeGl0T2sKLSAgICAgICAgOy8vIEV4aXQgV2hlbiBWTEMgRGVjb2RpbmcgaXMgZG9uZSBTdWNjZXNzZnVsbHkgCi0gICAKLSAgICAgICAgOy8vIExvYWRpbmcgcHBCaXRTdHJlYW0gYW5kIHBCaXRPZmZzZXQgZnJvbSBzdGFjawotICAgICAgICAKLSAgICAgICAgQ01QICAgICAgICAgICAgIExhc3QsIzEKLSAgICAgICAgTV9MRFIgICAgICAgICAgIHBwQml0U3RyZWFtLHBwcEJpdFN0cmVhbQotICAgICAgICBNX0xEUiAgICAgICAgICAgcEJpdE9mZnNldCxwcE9mZnNldAotCi0gICAgICAgIDsvL0VuZGluZyB0aGUgbWFjcm8KLQotICAgICAgICBNX0JEX0ZJTkkgICAgICAgcHBCaXRTdHJlYW0scEJpdE9mZnNldAotICAgICAgICAgICAgIAotICAgICAgICBNT1ZFUSAgICAgICAgICAgUmV0dXJuLCNPTVhfU3RzX05vRXJyCi0gICAgICAgIE1PVk5FICAgICAgICAgICBSZXR1cm4sI09NWF9TdHNfRXJyCi0gICAgICAgIE1fTERSICAgICAgICAgICBMUixwTGlua1JlZ2lzdGVyICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDsvLyBMb2FkIHRoZSBMaW5rIFJlZ2lzdGVyIEJhY2sKLSAgICAgICAgQ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ICAgPSAyKmkgICAgICAgICBmb3IgaT01ICB0byAgOAotICAgICAgICogICAgICAgICAgICAgICAgICAgICAgPSBpKzggICAgICAgICBmb3IgaT05ICB0byAgMjUKLSAgICAgICAqICAgICAgICAgICAgICAgICAgICAgID0gMippLTE2ICAgICAgZm9yIGk9MjYgdG8gIDMxCi0gICAgICAgKiAgICAgICAgICAgICAgICAgICAgICA9IChpLTMyKzEzKS8yIGZvciBpPTM3IHRvICA1OQotICAgICAgICogICAgICAgICAgICAgICAgICAgICAgPSBpLTYtMzIgICAgICBmb3IgaT02MCB0byAgNjMKLSAgICAgICAqICAgICAgICAgICAgICAgICAgICAgID0gMjU1ICAgICAgICAgZm9yIGk9MCBhbmQgaT0zMgotICAgICAgICovCi0gICAgICAgCi1jb25zdCBPTVhfVTggYXJtVkNNNFAyX0RDU2NhbGVyWzY0XT17Ci0JMHhmZiwgMHg4LCAgMHg4LCAgMHg4LCAgMHg4LCAgMHhhLCAgMHhjLCAgMHhlLCAgCi0gICAgMHgxMCwgMHgxMSwgMHgxMiwgMHgxMywgMHgxNCwgMHgxNSwgMHgxNiwgMHgxNywgCi0gICAgMHgxOCwgMHgxOSwgMHgxYSwgMHgxYiwgMHgxYywgMHgxZCwgMHgxZSwgMHgxZiwKLSAgICAweDIwLCAweDIyLCAweDI0LCAweDI2LCAweDI4LCAweDJhLCAweDJjLCAweDJlLAotICAgIDB4ZmYsIDB4OCwgIDB4OCwgIDB4OCwgIDB4OCwgIDB4OSwgIDB4OSwgIDB4YSwgIAotICAgIDB4YSwgIDB4YiwgIDB4YiwgIDB4YywgIDB4YywgIDB4ZCwgIDB4ZCwgIDB4ZSwgIAotICAgIDB4ZSwgIDB4ZiwgIDB4ZiwgIDB4MTAsIDB4MTAsIDB4MTEsIDB4MTEsIDB4MTIsIAotICAgIDB4MTIsIDB4MTMsIDB4MTQsIDB4MTUsIDB4MTYsIDB4MTcsIDB4MTgsIDB4MTksCi0KLX07Ci0KLSAgICAgICAgICAgICAgCi0g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XQotICAgICAgIAotICAgICAgIFRFUSAgICAgICAgIEJsb2NrSW5kZXgsIzMKLSAgICAgICBMRFJFUUggICAgICBibG9ja0RDVG9wLFtwQ29lZkJ1ZkNvbCwjLTE2XQotICAgICAgIExEUk5FSCAgICAgIGJsb2NrRENUb3AsW3BDb2VmQnVmUm93XQotICAgICAgICAgICAgIAotICAgICAgIFNVQlMgICAgICAgIHRlbXAxLGJsb2NrRENMZWZ0LGJsb2NrRENUb3BMZWZ0Ci0gICAgICAgUlNCTFQgICAgICAgdGVtcDEsdGVtcDEsIzAKLSAgICAgICBTVUJTICAgICAgICB0ZW1wMixibG9ja0RDVG9wTGVmdCxibG9ja0RDVG9wCi0gICAgICAgUlNCTFQgICAgICAgdGVtcDIsdGVtcDIsIzAKLSAgICAgIAotICAgICAgIE1fTERSICAgICAgIHBRcEJ1ZixwcFFwQnVmCi0gICAgICAgTV9MRFIgICAgICAgcHJlZFFQLHBwcmVkUVAKLSAgICAgICBDTVAgICAgICAgICB0ZW1wMSx0ZW1wMgotICAgICAgIE1PViAgICAgICAgIHRlbXAyLCNPTVhfVkNfVkVSVElDQUwKLSAgICAgICBMRFJMVEIgICAgICB0ZW1wMSxbcFFwQnVmLCMxXQotICAgICAgIFNUUkxUICAgICAgIHRlbXAyLFtwcmVkRGlyXQotICAgICAgIFNUUkxUICAgICAgIHRlbXAxLFtwcmVkUVBdCi0gICAgICAgTU9WICAgICAgICAgdGVtcDIsI09NWF9WQ19IT1JJWk9OVEFMICAgICAgICAgICAKLSAgICAgICBMRFJHRUIgICAgICB0ZW1wMSxbcFFwQnVmXQotICAgICAgIFNUUkdFICAgICAgIHRlbXAyLFtwcmVkRGlyXQotICAgICAgIE1PViAgICAgICAgIFJldHVybiwjT01YX1N0c19Ob0VycgotICAgICAgIFNUUkdFICAgICAgIHRlbXAxLFtwcmVkUVBdIAotCi0gICAgICAgICAKLSAgICAKLSAgICAgICBNX0VORAotIAotICAgICAgIEVORElGCi0KLSAgICAgICBFTkQgIC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SU5BTkNFOwotICAgIH0KLSAgICAKLQotICAgIC8qIFZMRCBhbmQgemlnemFnICovCi0gICAgaWYgKGludHJhRENWTEMgPT0gMSkKLSAgICB7Ci0gICAgICAgIGVycm9yQ29kZSA9IG9teFZDTTRQMl9EZWNvZGVWTENaaWd6YWdfSW50cmFEQ1ZMQygKLSAgICAgICAgICAgIHBwQml0U3RyZWFtLAotICAgICAgICAgICAgcEJpdE9mZnNldCwKLSAgICAgICAgICAgIHBUZW1wQnVmMSwKLSAgICAgICAgICAgIHByZWRBQ0RpciwKLSAgICAgICAgICAgIHNob3J0VmlkZW9IZWFkZXIsCi0gICAgICAgICAgICB2aWRlb0NvbXApOwotICAgICAgICBhcm1SZXREYXRhRXJySWYoKGVycm9yQ29kZSAhPSBPTVhfU3RzX05vRXJyKSwgZXJyb3JDb2RlKTsKLSAgICB9Ci0gICAgZWxzZQotICAgIHsKLSAgICAgICAgZXJyb3JDb2RlID0gb214VkNNNFAyX0RlY29kZVZMQ1ppZ3phZ19JbnRyYUFDVkxDKAotICAgICAgICAgICAgcHBCaXRTdHJlYW0sCi0gICAgICAgICAgICBwQml0T2Zmc2V0LAotICAgICAgICAgICAgcFRlbXBCdWYxLAotICAgICAgICAgICAgcHJlZEFDRGlyLAotICAgICAgICAgICAgc2hvcnRWaWRlb0hlYWRlcik7Ci0gICAgICAgIGFybVJldERhdGFFcnJJZigoZXJyb3JDb2RlICE9IE9NWF9TdHNfTm9FcnIpLCBlcnJvckNvZGUpOwotICAgIH0KLQotICAgIC8qIEFDIERDIHByZWRpY3Rpb24gKi8KLSAgICBlcnJvckNvZGUgPSBvbXhWQ000UDJfUHJlZGljdFJlY29uQ29lZkludHJhKAotICAgICAgICBwVGVtcEJ1ZjEsCi0gICAgICAgIHBDb2VmQnVmUm93LAotICAgICAgICBwQ29lZkJ1ZkNvbCwKLSAgICAgICAgY3VyUVAsCi0gICAgICAgIHByZWRRUCwKLSAgICAgICAgcHJlZERpciwKLSAgICAgICAgQUNQcmV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ludGVyIHRvIHRoZSBjdXJyZW50IGJ5dGUgaW4KLTsgKiAgICAgICAgICAgICAgICAgICAgICAgICAgICB0aGUgYml0IHN0cmVhbSBidWZmZXIKLTsgKiBbaW5dICAgIHBCaXRPZmZzZXQgICAgICAgICBwb2ludGVyIHRvIHRoZSBiaXQgcG9zaXRpb24gaW4gdGhlIGJ5dGUgcG9pbnRlZAotOyAqICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRvIGJ5ICpwcEJpdFN0cmVhbS4gKnBCaXRPZmZzZXQgaXMgdmFsaWQgd2l0aGluCi07ICogICAgICAgICAgICAgICAgICAgICAgICAgICAgWzAtN10uCi07ICogW2luXSAgICBwU3JjTVZMZWZ0TUIgICAgICAgcG9pbnRlcnMgdG8gdGhlIG1vdGlvbiB2ZWN0b3IgYnVmZmVycyBvZiB0aGUKLTsgKiAgICAgICAgICAgICAgICAgICAgICAgICAgIG1hY3JvYmxvY2tzIHNwZWNpYWxseSBhdCB0aGUgbGVmdCBzaWRlIG9mIHRoZSBjdXJyZW50IG1hY3JvYmxvY2sKLTsgKiAgICAgICAgICAgICAgICAgICAgIHJlc3BlY3RpdmVseS4KLTsgKiBbaW5dICAgIHBTcmNNVlVwcGVyTUIgICAgICBwb2ludGVycyB0byB0aGUgbW90aW9uIHZlY3RvciBidWZmZXJzIG9mIHRoZQotOyAqICAgICAgICAgICAgICAgICAgICAgbWFjcm9ibG9ja3Mgc3BlY2lhbGx5IGF0IHRoZSB1cHBlciBzaWRlIG9mIHRoZSBjdXJyZW50IG1hY3JvYmxvY2sKLTsgKiAgICAgICAgICAgICAgICAgICAgIHJlc3BlY3RpdmVseS4KLTsgKiBbaW5dICAgIHBTcmNNVlVwcGVyUmlnaHRNQiBwb2ludGVycyB0byB0aGUgbW90aW9uIHZlY3RvciBidWZmZXJzIG9mIHRoZQotOyAqICAgICAgICAgICAgICAgICAgICAgbWFjcm9ibG9ja3Mgc3BlY2lhbGx5IGF0IHRoZSB1cHBlci1yaWdodCBza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3V0XSAgIHBEc3RNVkN1ck1CICAgICAgICAgcG9pbnRlciB0byB0aGUgbW90aW9uIHZlY3RvciBidWZmZXIgb2YgdGhlIGN1cnJlbnQKLTsgKiAgICAgICAgICAgICAgICAgICAgIG1hY3JvYmxvY2sgd2hpY2ggY29udGFpbnMgZm91ciBkZWNvZGVkIG1vdGlvbiB2ZWN0b3JzCi07ICoKLTsgKiBSZXR1cm4gVmFsdWU6Ci07ICogT01YX1N0c19Ob0VyciAtbm8gZXJyb3IKLTsgKiAKLTsgKiAgICAgICAgICAgICAgICAgICAgIAotOyAqIE9NWF9TdHNfRXJyIC0gc3RhdHVzIGVycm9yCi07ICoKLTsgKgotICAgICAKLSAgICAgICAgSU5DTFVERSBvbXh0eXBlc19zLmgKLSAgICAgICAgSU5DTFVERSBhcm1DT01NX3MuaAotICAgICAgICBJTkNMVURFIGFybUNPTU1fQml0RGVjX3MuaAotICAgICAgICBJTkNMVURFIG9teFZDX3MuaAotICAgICAgICAKLSAgICAgICBNX1ZBUklBTlRTIEFSTTExMzZKUwotICAgICAgIAotICAgICAgICAgICAgICAgIAotCi0KLSAgICAgICAgSUYgQVJNMTEzNkpTCi0KLTsvL0lucHV0IEFyZ3VtZW50cwotCi1wcEJpdFN0cmVhbSAgICAgICAgICAgUk4gMAotcEJpdE9mZnNldCAgICAgICAgICAgIFJOIDEKLXBTcmNNVkxlZnRNQiAgICAgICAgICBSTiAyCi1wU3JjTVZVcHBlck1CICAgICAgICAgUk4gMwotcFNyY01WVXBwZXJSaWdodE1CICAgIFJOIDQKLXBEc3RNVkN1ck1CICAgICAgICAgICBSTiA1Ci1mY29kZUZvcndhcmQgICAgICAgICAgUk4gNgotTUJUeXBlICAgICAgICAgICAgICAgIFJOIDcKLQotOy8vTG9jYWwgVmFyaWFibGVzCi0KLXplcm8gICAgICAgICAgICAgICAgICBSTiA0Ci1vbmUgICAgICAgICAgICAgICAgICAgUk4gNAotc2NhbGVGYWN0b3IgICAgICAgICAgIFJOIDEKLQotCi1SZXR1cm4gICAgICAgICAgICAgICAgUk4gMAotCi1WbGNNVkQgICAgICAgICAgICAgICAgUk4gMAotaW5kZXggICAgICAgICAgICAgICAgIFJOIDQKLUNvdW50ICAgICAgICAgICAgICAgICBSTiA3Ci0KLW12SG9yRGF0YSAgICAgICAgICAgICBSTiA0Ci1tdkhvclJlc2lkdWFsICAgICAgICAgUk4gMAotCi1tdlZlckRhdGEgICAgICAgICAgICAgUk4gNCAgICAgICAgICAgICAKLW12VmVyUmVzaWR1YWwgICAgICAgICBSTiAwCi0KLXRlbXAgICAgICAgICAgICAgICAgICBSTiAxCi0KLXRlbXAxICAgICAgICAgICAgICAgICBSTiAzCi1IaWdoICAgICAgICAgICAgICAgICAgUk4gNAotTG93ICAgICAgICAgICAgICAgICAgIFJOIDIKLVJhbmdlICAgICAgICAgICAgICAgICBSTiAxCi0KLUJsa0NvdW50ICAgICAgICAgICAgICBSTiAxNAotCi1kaWZmTVZkeCAgICAgICAgICAgICAgUk4gMAotZGlmZk1WZHkgICAgICAgICAgICAgIFJOIDEKLQotOy8vIFNjcmF0Y2ggUmVnaXN0ZXJzCi0KLVJCaXRTdHJlYW0gICAgICAgICAgICBSTiA4Ci1SQml0Q291bnQgICAgICAgICAgICAgUk4gOQotUkJpdEJ1ZmZlciAgICAgICAgICAgIFJOIDEwCi0KLVQxICAgICAgICAgICAgICAgICAgICBSTiAxMQotVDIgICAgICAgICAgICAgICAgICAgIFJOIDEyCi1MUiAgICAgICAgICAgICAgICAgICAgUk4gMTQKLQotICAgICAgIElNUE9SVCAgICAgICAgICBhcm1WQ000UDJfYVZsY01WRAotICAgICAgIElNUE9SVCAgICAgICAgICBvbXhWQ000UDJfRmluZE1WcHJlZAotCi0gICAgICAgOy8vIEFsbG9jYXRlIHN0YWNrIG1lbW9yeSAgICAgICAgCi0gICAgICAgCi0gICAgICAgTV9BTExPQzQgICAgICAgIHBwRHN0TVZDdXJNQiw0Ci0gICAgICAgTV9BTExPQzQgICAgICAgIHBEc3RNVlByZWRNRSw0Ci0gICAgICAgTV9BTExPQzQgICAgICAgIHBCbGtDb3VudCw0Ci0gICAgICAgCi0gICAgICAgTV9BTExPQzQgICAgICAgIHBwcEJpdFN0cmVhbSw0Ci0gICAgICAgTV9BTExPQzQgICAgICAgIHBwQml0T2Zmc2V0LDQKLSAgICAgICBNX0FMTE9DNCAgICAgICAgcHBTcmNNVkxlZnRNQiw0Ci0gICAgICAgTV9BTExPQzQgICAgICAgIHBwU3JjTVZVcHBlck1CLDQKLSAgICAgICAKLSAgICAgICBNX0FMTE9DNCAgICAgICAgcGRpZmZNVmR4LDQKLSAgICAgICBNX0FMTE9DNCAgICAgICAgcGRpZmZNVmR5LDQKLSAgICAgICBNX0FMTE9DNCAgICAgICAgcEhpZ2gsNAotICAgICAgIAotICAgICAgICAgICAgICAKLQotCi0gICAgICAgTV9TVEFSVCAgIG9teFZDTTRQMl9EZWNvZGVQYWRNVl9QVk9QLHIxMQotICAgICAgIAotICAgICAgIE1fQVJHICAgICAgICAgICBwU3JjTVZVcHBlclJpZ2h0TUJvblN0YWNrLDQgICAgICAgICAgIDsvLyBwb2ludGVyIHRvICBwU3JjTVZVcHBlclJpZ2h0TUIgb24gc3RhY2sKLSAgICAgICBNX0FSRyAgICAgICAgICAgcERzdE1WQ3VyTUJvblN0YWNrLDQgICAgICAgICAgICAgICAgICA7Ly8gcG9pbnRlciB0byBwRHN0TVZDdXJNQiBvbiBzdGFjawotICAgICAgIE1fQVJHICAgICAgICAgICBmY29kZUZvcndhcmRvblN0YWNrLDQgICAgICAgICAgICAgICAgIDsvLyBwb2ludGVyIHRvIGZjb2RlRm9yd2FyZCBvbiBzdGFjayAKLSAgICAgICBNX0FSRyAgICAgICAgICAgTUJUeXBlb25TdGFjayw0ICAgICAgICAgICAgICAgICAgICAgICA7Ly8gcG9pbnRlciB0byBNQlR5cGUgb24gc3RhY2sKLQotICAgICAgCi0gICAgICAgCi0gICAgICAgCi0gICAgICAgCi0gICAgICAgOy8vIEluaXRpYWxpemluZyB0aGUgQml0U3RyZWFtIE1hY3JvCi0KLSAgICAgICBNX0JEX0lOSVQwICAgICAgcHBCaXRTdHJlYW0sIHBCaXRPZmZzZXQsIFJCaXRTdHJlYW0sIFJCaXRCdWZmZXIsIFJCaXRDb3VudAotICAgICAgIE1fTERSICAgICAgICAgICBNQlR5cGUsTUJUeXBlb25TdGFjayAgICAgICAgICAgICAgICAgIDsvLyBMb2FkIE1CVHlwZSBmcm9tIHN0YWNrCi0gICAgICAgTV9MRFIgICAgICAgICAgIHBEc3RNVkN1ck1CLHBEc3RNVkN1ck1Cb25TdGFjayAgICAgICAgOy8vIExvYWQgcERzdE1WQ3VyTUIgZnJvbSBzdGFjawotICAgICAgIE1PViAgICAgICAgICAgICB6ZXJvLCMwCi0KLSAgICAgICBURVEgICAgICAgICAgICAgTUJUeXBlLCNPTVhfVkNfSU5UUkEgICAgICAgICAgICAgICAgICA7Ly8gQ2hlY2sgaWYgTUJUeXBlPU9NWF9WQ19JTlRSQQotICAgICAgIFRFUU5FICAgICAgICAgICBNQlR5cGUsI09NWF9WQ19JTlRSQV9RICAgICAgICAgICAgICAgIDsvLyBjaGVjayBpZiBNQlR5cGU9T01YX1ZDX0lOVFJBX1EKLSAgICAgICBTVFJFUSAgICAgICAgICAgemVybyxbcERzdE1WQ3VyTUJdCi0gICAgICAgTV9CRF9JTklUMSAgICAgIFQxLCBUMiwgVDIKLSAgICAgICBTVFJFUSAgICAgICAgICAgemVybyxbcERzdE1WQ3VyTUIsIzRdCi0gICAgICAgTV9CRF9JTklUMiAgICAgIFQxLCBUMiwgVDIKLSAgICAgICBTVFJFUSAgICAgICAgICAgemVybyxbcERzdE1WQ3VyTUIsIzRdCi0gICAgICAgTU9WRVEgICAgICAgICAgIFJldHVybiwjT01YX1N0c19Ob0VycgotICAgICAgIE1PViAgICAgICAgICAgICBCbGtDb3VudCwjMAotICAgICAgIFNUUkVRICAgICAgICAgICB6ZXJvLFtwRHN0TVZDdXJNQiwjNF0KLSAgICAgICAKLSAgICAgICBCRVEgICAgICAgICAgICAgRXhpdE9LCi0KLSAgICAgICBURVEgICAgICAgICAgICAgTUJUeXBlLCNPTVhfVkNfSU5URVI0ViAgICAgICAgICAgICAgICA7Ly8gQ2hlY2sgaWYgTUJUeXBlPU9NWF9WQ19JTlRFUjRWCi0gICAgICAgVEVRTkUgICAgICAgICAgIE1CVHlwZSwjT01YX1ZDX0lOVEVSNFZfUSAgICAgICAgICAgICAgOy8vIENoZWNrIGlmIE1CVHlwZT1PTVhfVkNfSU5URVI0Vl9RCi0gICAgICAgTU9WRVEgICAgICAgICAgIENvdW50LCM0Ci0KLSAgICAgICBURVEgICAgICAgICAgICAgTUJUeXBlLCNPTVhfVkNfSU5URVIgICAgICAgICAgICAgICAgICA7Ly8gQ2hlY2sgaWYgTUJUeXBlPU9NWF9WQ19JTlRFUgotICAgICAgIFRFUU5FICAgICAgICAgICBNQlR5cGUsI09NWF9WQ19JTlRFUl9RICAgICAgICAgICAgICAgIDsvLyBDaGVjayBpZiBNQlR5cGU9T01YX1ZDX0lOVEVSX1EKLSAgICAgICBNT1ZFUSAgICAgICAgICAgQ291bnQsIzEKLSAgICAgICAKLSAgICAgICBNX0xEUiAgICAgICAgICAgZmNvZGVGb3J3YXJkLGZjb2RlRm9yd2FyZG9uU3RhY2sgICAgICA7Ly8gTG9hZCBmY29kZUZvcndhcmQgIGZyb20gc3RhY2sKLQotICAgICAgIDsvLyBTdG9yaW5nIHRoZSB2YWx1ZXMgdGVtcG9yYXJpbHkgb24gc3RhY2sKLQotICAgICAgIE1fU1RSICAgICAgICAgICBwcEJpdFN0cmVhbSxwcHBCaXRTdHJlYW0gICAgICAgICAgICAgIAotICAgICAgIE1fU1RSICAgICAgICAgICBwQml0T2Zmc2V0LHBwQml0T2Zmc2V0Ci0gICAgICAgICAgICAKLQotICAgICAgIFNVQiAgICAgICAgICAgICB0ZW1wLGZjb2RlRm9yd2FyZCwjMSAgICAgICAgICAgICAgICAgIDsvLyB0ZW1wPWZjb2RlRm9yd2FyZC0xCi0gICAgICAgTU9WICAgICAgICAgICAgIG9uZSwjMQotICAgICAgIE1fU1RSICAgICAgICAgICBwU3JjTVZMZWZ0TUIscHBTcmNNVkxlZnRNQgotICAgICAgIExTTCAgICAgICAgICAgICBzY2FsZUZhY3RvcixvbmUsdGVtcCAgICAgICAgICAgICAgICAgIDsvLyBzY2FsZUZhY3Rvcj0xPDwoZmNvZGVGb3J3YXJkLTEpCi0gICAgICAgTV9TVFIgICAgICAgICAgIHBTcmNNVlVwcGVyTUIscHBTcmNNVlVwcGVyTUIKLSAgICAgICBMU0wgICAgICAgICAgICAgc2NhbGVGYWN0b3Isc2NhbGVGYWN0b3IsIzUgICAgICAgICAgICAKLSAgICAgICBNX1NUUiAgICAgICAgICAgc2NhbGVGYWN0b3IscEhpZ2ggICAgICAgICAgICAgICAgICAgICA7Ly8gW3BIaWdoXT0zMipzY2FsZUZhY3RvcgotICAgICAgICAgICAgICAKLSAgICAgICA7Ly8gVkxEIERlY29kaW5nCi0KLQotTG9vcAotCi0gICAgICAgTERSICAgICAgICAgICAgIFZsY01WRCwgPWFybVZDTTRQMl9hVmxjTVZEICAgICAgICA7Ly8gTG9hZCB0aGUgb3B0aW1pemVkIE1WRCBWTEMgdGFibGUKLQotICAgICAgIDsvLyBIb3Jpem9udGFsIERhdGEgYW5kIFJlc2lkdWFsIGNhbGN1bGF0aW9uCi0KLSAgICAgICBMRFIgICAgICAgICAgICAgdGVtcCw9MHhGRkYgICAgICAgICAgICAgICAgICAgICAgICAgICAKLSAgICAgICBNX0JEX1ZMRCAgICAgICAgaW5kZXgsVDEsVDIsVmxjTVZELDMsMiAgICAgICAgICAgICAgICA7Ly8gdmFyaWFibGUgbGVuZ2h0IGRlY29kaW5nIHVzaW5nIHRoZSBtYWNybwotICAgICAgCi0gICAgICAgVEVRICAgICAgICAgICAgIGluZGV4LHRlbXAKLSAgICAgICBCRVEgICAgICAgICAgICAgRXhpdEVycm9yICAgICAgICAgICAgICAgICAgICAgICAgICAgICA7Ly8gRXhpdCB3aXRoIGFuIEVycm9yIE1lc3NhZ2UgaWYgdGhlIGRlY29kZWQgc3ltYm9sIGlzIGFuIGludmFsaWVkIHN5bWJvbCAKLSAgICAgICAKLSAgICAgICBTVUIgICAgICAgICAgICAgbXZIb3JEYXRhLGluZGV4LCMzMiAgICAgICAgICAgICAgICAgICA7Ly8gbXZIb3JEYXRhPWluZGV4LTMyICAgICAgICAgICAgIAotICAgICAgIE1PViAgICAgICAgICAgICBtdkhvclJlc2lkdWFsLCMxICAgICAgICAgICAgICAgICAgICAgIDsvLyBtdkhvclJlc2lkdWFsPTEKLSAgICAgICBDTVAgICAgICAgICAgICAgZmNvZGVGb3J3YXJkLCMxCi0gICAgICAgVEVRTkUgICAgICAgICAgIG12SG9yRGF0YSwjMAotICAgICAgIE1PVkVRICAgICAgICAgICBkaWZmTVZkeCxtdkhvckRhdGEgICAgICAgICAgICAgICAgICAgIDsvLyBpZiBzY2FsZUZhY3Rvcj0xKGZjb2RlRm9yd2FyZD0xKSBvciBtdkhvckRhdGE9MCBkaWZmTVZkeD1tdkhvckRhdGEgICAgICAgICAKLSAgICAgICBCRVEgICAgICAgICAgICAgVmVydGljYWxEYXRhCi0gICAgICAgCi0gICAgICAgU1VCICAgICAgICAgICAgIHRlbXAsZmNvZGVGb3J3YXJkLCMxCi0gICAgICAgTV9CRF9WUkVBRDggICAgIG12SG9yUmVzaWR1YWwsdGVtcCxUMSxUMiAgICAgICAgICAgICAgOy8vIGdldCBtdkhvclJlc2lkdWFsIGZyb20gYml0c3RyZWFtIGlmIGZjb2RlRm9yd2FyZD4xIGFuZCBtdkhvckRhdGEhPTAgICAgICAgICAgICAgIAotICAgICAgIAotICAgICAgIENNUCAgICAgICAgICAgICBtdkhvckRhdGEsIzAKLSAgICAgICBSU0JMVCAgICAgICAgICAgbXZIb3JEYXRhLG12SG9yRGF0YSwjMCAgICAgICAgICAgICAgICA7Ly8gbXZIb3JEYXRhPWFicyhtdkhvckRhdGEpCi0gICAgICAgU1VCICAgICAgICAgICAgIG12SG9yUmVzaWR1YWwsbXZIb3JSZXNpZHVhbCxmY29kZUZvcndhcmQKLSAgICAgICBTTUxBQkIgICAgICAgICAgZGlmZk1WZHgsbXZIb3JEYXRhLGZjb2RlRm9yd2FyZCxtdkhvclJlc2lkdWFsIDsvLyBkaWZmTVZkeD1hYnMobXZIb3JEYXRhKSpmY29kZUZvcndhcmQrbXZIb3JSZXNpZHVhbC1mY29kZUZvcndhcmQKLSAgICAgICBBREQgICAgICAgICAgICAgZGlmZk1WZHgsZGlmZk1WZHgsIzEKLSAgICAgICBSU0JMVCAgICAgICAgICAgZGlmZk1WZHgsZGlmZk1WZHgsIzAKLSAgICAgICAKLSAgICAgICA7Ly8gVmVydGljYWwgRGF0YSBhbmQgUmVzaWR1YWwgY2FsY3VsYXRpb24KLQotVmVydGljYWxEYXRhCi0KLSAgICAgICBNX1NUUiAgICAgICAgICAgZGlmZk1WZHgscGRpZmZNVmR4ICAgICAgICAgICAgICAgICAgICA7Ly8gU3RvcmUgdGhlIGRpZmZNVmR4IG9uIHN0YWNrCi0gICAgICAgTERSICAgICAgICAgICAgIFZsY01WRCwgPWFybVZDTTRQMl9hVmxjTVZEICAgICAgICA7Ly8gTG9hZGluZyB0aGUgYWRkcmVzcyBvZiBvcHRpbWl6ZWQgVkxDIHRhYmxlcwotCi0gICAgICAgTERSICAgICAgICAgICAgIHRlbXAsPTB4RkZGCi0gICAgICAgTV9CRF9WTEQgICAgICAgIGluZGV4LFQxLFQyLFZsY01WRCwzLDIgICAgICAgICAgICAgICAgOy8vIFZMQyBkZWNvZGluZyB1c2luZyB0aGUgbWFjcm8KLSAgICAgICAKLSAgICAgICBURVEgICAgICAgICAgICAgaW5kZXgsdGVtcAotICAgICAgIEJFUSAgICAgICAgICAgICBFeGl0RXJyb3IgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDsvLyBFeGl0IHdpdGggYW4gRXJyb3IgTWVzc2FnZSBpZiBhbiBJbnZhbGllZCBTeW1ib2wgb2NjdXJzCi0gICAgICAgCi0gICAgICAgU1VCICAgICAgICAgICAgIG12VmVyRGF0YSxpbmRleCwjMzIgICAgICAgICAgICAgICAgICAgOy8vIG12VmVyRGF0YT1pbmRleC0zMiAgICAgICAgICAgICAKLSAgICAgICBNT1YgICAgICAgICAgICAgbXZWZXJSZXNpZHVhbCwjMSAgICAgCi0gICAgICAgQ01QICAgICAgICAgICAgIGZjb2RlRm9yd2FyZCwjMQotICAgICAgIFRFUU5FICAgICAgICAgICBtdlZlckRhdGEsIzAKLSAgICAgICBNT1ZFUSAgICAgICAgICAgZGlmZk1WZHksbXZWZXJEYXRhICAgICAgICAgICAgICAgICAgICA7Ly8gZGlmZk1WZHkgPSBtdlZlckRhdGEgaWYgc2NhbGVGYWN0b3I9MShmY29kZUZvcndhcmQ9MSkgb3IgbXZWZXJEYXRhPTAKLSAgICAgICBCRVEgICAgICAgICAgICAgRmluZE1WUHJlZAotCi0gICAgICAgU1VCICAgICAgICAgICAgIHRlbXAsZmNvZGVGb3J3YXJkLCMxCi0gICAgICAgTV9CRF9WUkVBRDggICAgIG12VmVyUmVzaWR1YWwsdGVtcCxUMSxUMiAgICAgICAgICAgICAgOy8vIEdldCBtdlZlclJlc2lkdWFsIGZyb20gYml0IHN0cmVhbSBpZiBmY29kZUZvcndhcmQ+MSBhbmQgbW5WZXJEYXRhIT0wCi0gICAgICAgICAgICAgCi0KLSAgICAgICBDTVAgICAgICAgICAgICAgbXZWZXJEYXRhLCMwCi0gICAgICAgUlNCTFQgICAgICAgICAgIG12VmVyRGF0YSxtdlZlckRhdGEsIzAKLSAgICAgICBTVUIgICAgICAgICAgICAgbXZWZXJSZXNpZHVhbCxtdlZlclJlc2lkdWFsLGZjb2RlRm9yd2FyZAotICAgICAgIFNNTEFCQiAgICAgICAgICBkaWZmTVZkeSxtdlZlckRhdGEsZmNvZGVGb3J3YXJkLG12VmVyUmVzaWR1YWwgOy8vIGRpZmZNVmR5PWFicyhtdlZlckRhdGEpKmZjb2RlRm9yd2FyZCttdlZlclJlc2lkdWFsLWZjb2RlRm9yd2FyZAotICAgICAgIEFERCAgICAgICAgICAgICBkaWZmTVZkeSxkaWZmTVZkeSwjMQotICAgICAgIFJTQkxUICAgICAgICAgICBkaWZmTVZkeSxkaWZmTVZkeSwjMAotCi0gICAgICAgOy8vQ2FsbGluZyB0aGUgRnVuY3Rpb24gb214VkNNNFAyX0ZpbmRNVnByZWQKLSAgICAgICAgCi1GaW5kTVZQcmVkCi0KLSAgICAgICBNX1NUUiAgICAgICAgICAgZGlmZk1WZHkscGRpZmZNVmR5Ci0gICAgICAgQUREICAgICAgICAgICAgIHRlbXAscERzdE1WQ3VyTUIsQmxrQ291bnQsTFNMICMyICAgICAgOy8vIHRlbXA9cERzdE1WQ3VyTUJbQmxrQ291bnRdCi0gICAgICAgTV9TVFIgICAgICAgICAgIHRlbXAscHBEc3RNVkN1ck1CICAgICAgICAgICAgICAgICAgICAgOy8vIHN0b3JlIHRlbXAgb24gc3RhY2sgZm9yIHBhc3NpbmcgYXMgYW4gYXJndW1lbnQgdG8gRmluZE1WUHJlZAotICAgICAgIAotICAgICAgIE1PViAgICAgICAgICAgICB0ZW1wLCMwCi0gICAgICAgTV9TVFIgICAgICAgICAgIHRlbXAscERzdE1WUHJlZE1FICAgICAgICAgICAgICAgICAgICAgOy8vIFBhc3MgcERzdE1WUHJlZE1FPU5VTEwgYXMgYW4gYXJndW1lbnQgICAgICAgICAKLSAgICAgICBNX1NUUiAgICAgICAgICAgQmxrQ291bnQscEJsa0NvdW50ICAgICAgICAgICAgICAgICAgICA7Ly8gUGFzc3MgQmxrQ291bnQgYXMgQXJndW1lbnQgdGhyb3VnaCBzdGFjawotCi0gICAgICAgTU9WICAgICAgICAgICAgIHRlbXAscFNyY01WTGVmdE1CICAgICAgICAgICAgICAgICAgICAgOy8vIHRlbXAgKFJOIDEpPXBTcmNNVkxlZnRNQgotICAgICAgIE1fTERSICAgICAgICAgICBwU3JjTVZVcHBlclJpZ2h0TUIscFNyY01WVXBwZXJSaWdodE1Cb25TdGFjawotICAgICAgIE1PViAgICAgICAgICAgICBwU3JjTVZMZWZ0TUIscFNyY01WVXBwZXJNQiAgICAgICAgICAgIDsvLyBwU3JjTVZMZWZ0TUIgKCBSTiAyKSA9IHBTcmNNVlVwcGVyTUIKLSAgICAgICBNT1YgICAgICAgICAgICAgcHBCaXRTdHJlYW0scERzdE1WQ3VyTUIgICAgICAgICAgICAgICA7Ly8gcHBCaXRTdHJlYW0gICggUk4gMCkgPSBwRHN0TVZDdXJNQgotICAgICAgIE1PViAgICAgICAgICAgICBwU3JjTVZVcHBlck1CLHBTcmNNVlVwcGVyUmlnaHRNQiAgICAgIDsvLyBwU3JjTVZVcHBlck1CKCBSTiAzKSA9IHBTcmNNVlVwcGVyUmlnaHRNQiAgICAgIAotICAgICAgIEJMICAgICAgICAgICAgICBvbXhWQ000UDJfRmluZE1WcHJlZCAgICAgICAgICAgICAgOy8vIEJyYW5jaCB0byBzdWJyb3V0aW5lIG9teFZDTTRQMl9GaW5kTVZwcmVkCi0KLSAgICAgICA7Ly8gU3RvcmUgSG9yaXpvbnRhbCBNb3Rpb24gVmVjdG9yCi0gICAgIAotICAgICAgIE1fTERSICAgICAgICAgICBCbGtDb3VudCxwQmxrQ291bnQgICAgICAgICAgICAgICAgICAgIDsvLyBMb2FkIEJsa0NvdW50IGZyb20gc3RhY2sKLSAgICAgICBNX0xEUiAgICAgICAgICAgSGlnaCxwSGlnaCAgICAgICAgICAgICAgICAgICAgICAgICAgICA7Ly8gSGlnaD0zMipzY2FsZUZhY3RvcgotICAgICAgIExTTCAgICAgICAgICAgICB0ZW1wMSxCbGtDb3VudCwjMiAgICAgICAgICAgICAgICAgICAgIDsvLyB0ZW1wPUJsa0NvdW50KjQKLSAgICAgICBNX0xEUiAgICAgICAgICAgZGlmZk1WZHgscGRpZmZNVmR4ICAgICAgICAgICAgICAgICAgICA7Ly8gTGFhZCBkaWZmTVZkeAotICAgICAgIAotICAgICAgIExEUlNIICAgICAgICAgICB0ZW1wLFtwRHN0TVZDdXJNQix0ZW1wMV0gICAgICAgICAgICAgIDsvLyB0ZW1wPXBEc3RNVkN1ck1CW0Jsa0NvdW50XQotICAgICAgIAotICAgICAgIAotICAgICAgIFJTQiAgICAgICAgICAgICBMb3csSGlnaCwjMCAgICAgICAgICAgICAgICAgICAgICAgICAgIDsvLyBMb3cgPSAtMzIqc2NhbGVGYWN0b3IKLSAgICAgICBBREQgICAgICAgICAgICAgZGlmZk1WZHgsdGVtcCxkaWZmTVZkeCAgICAgICAgICAgICAgICA7Ly8gZGlmZk1WZHg9cERzdE1WQ3VyTUJbQmxrQ291bnRdK2RpZmZNVmR4Ci0gICAgICAgQUREICAgICAgICAgICAgIFJhbmdlLEhpZ2gsSGlnaCAgICAgICAgICAgICAgICAgICAgICAgOy8vIFJhbmdlPTY0KlNjYWxlRmFjdG9yCi0gICAgICAgU1VCICAgICAgICAgICAgIEhpZ2gsSGlnaCwjMSAgICAgICAgICAgICAgICAgICAgICAgICAgOy8vIEhpZ2g9IDMyKnNjYWxlRmFjdG9yLTEKLQotICAgICAgIENNUCAgICAgICAgICAgICBkaWZmTVZkeCxMb3cgICAgICAgICAgICAgICAgICAgICAgICAgIDsvLyBJZiBkaWZmTVZkeDxMb3cgICAgICAgICAgCi0gICAgICAgQURETFQgICAgICAgICAgIGRpZmZNVmR4LGRpZmZNVmR4LFJhbmdlICAgICAgICAgICAgICAgOy8vIGRpZmZNVmR4Kz1SYW5nZQotICAgICAgICAKLSAgICAgICBDTVAgICAgICAgICAgICAgZGlmZk1WZHgsSGlnaCAgICAgICAgICAgICAgICAgICAgICAgICAKLSAgICAgICBTVUJHVCAgICAgICAgICAgZGlmZk1WZHgsZGlmZk1WZHgsUmFuZ2UgICAgICAgICAgICAgICA7Ly8gSWYgZGlmZk1WZHggPiBIaWdoIGRpZmZNVmR4LT1SYW5nZQotICAgICAgIFNUUkggICAgICAgICAgICBkaWZmTVZkeCxbcERzdE1WQ3VyTUIsdGVtcDFdCi0KLSAgICAgICA7Ly8gU3RvcmUgVmVydGljYWwKLQotICAgICAgIEFERCAgICAgICAgICAgICB0ZW1wMSx0ZW1wMSwjMiAgICAgICAgICAgICAgICAgICAgICAgIDsvLyB0ZW1wMT00KkJsa0NvdW50KzIKLSAgICAgICBNX0xEUiAgICAgICAgICAgZGlmZk1WZHgscGRpZmZNVmR5ICAgICAgICAgICAgICAgICAgICA7Ly8gTGFhZCBkaWZmTVZkeQotICAgICAgIExEUlNIICAgICAgICAgICB0ZW1wLFtwRHN0TVZDdXJNQix0ZW1wMV0gICAgICAgICAgICAgIDsvLyB0ZW1wPXBEc3RNVkN1ck1CW0Jsa0NvdW50XS5kaWZmTVZkeQotICAgICAgIEFERCAgICAgICAgICAgICBCbGtDb3VudCxCbGtDb3VudCwjMSAgICAgICAgICAgICAgICAgIDsvLyBCbGtDb3VudD1CbGtDb3VudCsxCi0gICAgICAgQUREICAgICAgICAgICAgIGRpZmZNVmR4LHRlbXAsZGlmZk1WZHggICAgICAgICAgICAgICAgCi0gICAgICAgQ01QICAgICAgICAgICAgIGRpZmZNVmR4LExvdwotICAgICAgIEFERExUICAgICAgICAgICBkaWZmTVZkeCxkaWZmTVZkeCxSYW5nZSAgICAgICAgICAgICAgIDsvLyBJZiBkaWZmTVZkeTxMb3cgIGRpZmZNVmR5Kz1SYW5nZSAgICAgICAgICAgICAgICAKLSAgICAgICBDTVAgICAgICAgICAgICAgZGlmZk1WZHgsSGlnaAotICAgICAgIFNVQkdUICAgICAgICAgICBkaWZmTVZkeCxkaWZmTVZkeCxSYW5nZSAgICAgICAgICAgICAgIDsvLyBJZiBkaWZmTVZkeSA+IEhpZ2ggZGlmZk1WZHktPVJhbmdlCi0gICAgICAgU1RSSCAgICAgICAgICAgIGRpZmZNVmR4LFtwRHN0TVZDdXJNQix0ZW1wMV0gICAgCi0gICAgICAgCi0gICAgICAgQ01QICAgICAgICAgICAgIEJsa0NvdW50LENvdW50Ci0gICAgICAgTV9MRFIgICAgICAgICAgIHBTcmNNVkxlZnRNQixwcFNyY01WTGVmdE1CCi0gICAgICAgTV9MRFIgICAgICAgICAgIHBTcmNNVlVwcGVyTUIscHBTcmNNVlVwcGVyTUIKLQotICAgICAgIEJMVCAgICAgICAgICAgICBMb29wICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDsvLyBJZiBCbGtDb3VudDxDb3VudCBDb250aW51ZSB0aGUgTG9vcAotCi0KLSAgICAgICA7Ly8gSWYgTUJUeXBlPU9NWF9WQ19JTlRFUiBvciBNQnR5cGU9T01YX1ZDX0lOVEVSX1EgY29weSBwRHN0TVZDdXJNQlswXSB0bwotICAgICAgIDsvLyBwRHN0TVZDdXJNQlsxXSwgcERzdE1WQ3VyTUJbMl0sIHBEc3RNVkN1ck1CWzNdIAotCi0gICAgICAgTV9MRFIgICAgICAgICAgIE1CVHlwZSxNQlR5cGVvblN0YWNrCi0KLSAgICAgICBURVEgICAgICAgICAgICAgTUJUeXBlLCNPTVhfVkNfSU5URVIgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKLSAgICAgICBURVFORSAgICAgICAgICAgTUJUeXBlLCNPTVhfVkNfSU5URVJfUSAgICAgICAgICAgICAgICAgICAgICAgICAgICAKLSAgICAgICBMRFJFUSAgICAgICAgICAgdGVtcCxbcERzdE1WQ3VyTUJdCi0gICAgICAgTV9MRFIgICAgICAgICAgIHBwQml0U3RyZWFtLHBwcEJpdFN0cmVhbQotICAgICAgIFNUUkVRICAgICAgICAgICB0ZW1wLFtwRHN0TVZDdXJNQiwjNF0KLSAgICAgICAKLSAgICAgICBTVFJFUSAgICAgICAgICAgdGVtcCxbcERzdE1WQ3VyTUIsIzhdCi0gICAgICAgU1RSRVEgICAgICAgICAgIHRlbXAsW3BEc3RNVkN1ck1CLCMxMl0KLSAgICAgICAKLSAgICAgICAKLSAgICAgICBNX0xEUiAgICAgICAgICAgcE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bnRlclZsY0wwTDEgICAgICAgICAgICAgOy8vIENvbnRhaW5zIG9wdGltaXplZCBhbmQgcGFja2VkIFZMQyBUYWJsZXMgZm9yIGJvdGggTGFzdCA9MSBhbmQgbGFzdD0wCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA7Ly8gUGFja2VkIGluIFJ1bjpMZXZlbDpMYXN0IGZvcm1hdAotICAgICAgICBJTVBPUlQgICAgICAgICAgYXJtVkNNNFAyX0ludGVyTDBMMUxNQVggICAgICAgICAgICA7Ly8gQ29udGFpbnMgTE1BWCB0YWJsZSBlbnRyaWVzIHdpdGggYm90aCBMYXN0PTAgYW5kIExhc3Q9MQotICAgICAgICBJTVBPUlQgICAgICAgICAgYXJtVkNNNFAyX0ludGVyTDBMMVJNQVggICAgICAgICAgICA7Ly8gQ29udGFpbnMgUk1BWCB0YWJsZSBlbnRyaWVzIHdpdGggYm90aCBMYXN0PTAgYW5kIExhc3Q9MQotICAgICAgICBJTVBPUlQgICAgICAgICAgYXJtVkNNNFAyX2FDbGFzc2ljYWxaaWd6YWdTY2FuICAgICA7Ly8gY29udGFpbnMgY2xhc3NpY2FsIFppZ3phZyB0YWJsZSBlbnRyaWVzIHdpdGggZG91YmxlIHRoZSBvcmlnaW5hbCB2YWx1ZXMKLSAgICAgICAgSU1QT1JUICAgICAgICAgIGFybVZDTTRQMl9EZWNvZGVWTENaaWd6YWdfQUNfdW5zYWZlCi0KLQotCi07Ly9JbnB1dCBBcmd1bWVudHMKLQotcHBCaXRTdHJlYW0gICAgICAgICAgUk4gMAotcEJpdE9mZnNldCAgICAgICAgICAgUk4gMQotcERzdCAgICAgICAgICAgICAgICAgUk4gMgotc2hvcnRWaWRlb0hlYWRlciAgICAgUk4gMwotCi07Ly9Mb2NhbCBWYXJpYWJsZXMKLQotUmV0dXJuICAgICAgICAgICAgICAgUk4gMAotCi1wVmxjVGFibGVMMEwxICAgICAgICBSTiA0Ci1wTE1BWFRhYmxlTDBMMSAgICAgICBSTiA0Ci1wUk1BWFRhYmxlTDBMMSAgICAgICBSTiA0Ci1wWmlnemFnVGFibGUgICAgICAgICBSTiA0Ci1Db3VudCAgICAgICAgICAgICAgICBSTiA2Ci0KLQotICAgICAgICAKLSAgICAgICAgOy8vIEFsbG9jYXRlIHN0YWNrIG1lbW9yeSB0byBzdG9yZSB0aGUgVkxDLFppZ3phZyxMTUFYIGFuZCBSTUFYIHRhYmxlcwotICAgICAKLSAgICAgICAgCi0gICAgICAgIE1fQUxMT0M0ICAgICAgICBwcFZsY1RhYmxlTDBMMSw0Ci0gICAgICAgIE1fQUxMT0M0ICAgICAgICBwcExNQVhUYWJsZUwwTDEsNAotICAgICAgICBNX0FMTE9DNCAgICAgICAgcHBSTUFYVGFibGVMMEwxLDQKLSAgICAgICAgTV9BTExPQzQgICAgICAgIHBwWmlnemFnVGFibGUsNAotICAgICAgICAKLSAgICAgICAgCi0gICAgICAgIE1fU1RBUlQgb214VkNNNFAyX0RlY29kZVZMQ1ppZ3phZ19JbnRlcixyMTIKLQotICAgICAgICAKLQotICAgICAgICAKLSAgICAgICAgTERSICAgICAgICAgICAgIHBaaWd6YWdUYWJsZSwgPWFybVZDTTRQMl9hQ2xhc3NpY2FsWmlnemFnU2NhbiAgICAgICA7Ly8gTG9hZCB6aWd6YWcgdGFibGUKLSAgICAgICAgTV9TVFIgICAgICAgICAgIHBaaWd6YWdUYWJsZSxwcFppZ3phZ1RhYmxlICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOy8vIFN0b3JlIHppZ3phZyB0YWJsZSBvbiBzdGFjayB0byBwYXNzIGFzIGFyZ3VtZW50IHRvIHVuc2FmZSBmdW5jdGlvbgotICAgICAgICBMRFIgICAgICAgICAgICAgcFZsY1RhYmxlTDBMMSwgPWFybVZDTTRQMl9JbnRlclZsY0wwTDEgICAgICAgICAgICAgIDsvLyBMb2FkIG9wdGltaXplZCBWTEMgdGFibGUgd2l0aCBib3RoIEw9MCBhbmQgTD0xIGVudHJpZXMKLSAgICAgICAgTV9TVFIgICAgICAgICAgIHBWbGNUYWJsZUwwTDEscHBWbGNUYWJsZUwwTDEgICAgICAgICAgICAgICAgICAgICAgICAgICAgOy8vIFN0b3JlIG9wdGltaXplZCBWTEMgdGFibGUgYWRkcmVzcyBvbiBzdGFjawotICAgICAgICBMRFIgICAgICAgICAgICAgcExNQVhUYWJsZUwwTDEsID1hcm1WQ000UDJfSW50ZXJMMEwxTE1BWCAgICAgICAgICAgIDsvLyBMb2FkIEludGVybGVhdmVkIEw9MCBhbmQgTD0xIExNQVggVGFibGVzCi0gICAgICAgIE1fU1RSICAgICAgICAgICBwTE1BWFRhYmxlTDBMMSxwcExNQVhUYWJsZUwwTDEgICAgICAgICAgICAgICAgICAgICAgICAgIDsvLyBTdG9yZSBMTUFYIHRhYmxlIGFkZHJlc3Mgb24gc3RhY2sKLSAgICAgICAgTERSICAgICAgICAgICAgIHBSTUFYVGFibGVMMEwxLCA9YXJtVkNNNFAyX0ludGVyTDBMMVJNQVggICAgICAgICAgICA7Ly8gTG9hZCBJbnRlcmxlYXZlZCBMPTAgYW5kIEw9MSBSTUFYIFRhYmxlcwotICAgICAgICBNT1YgICAgICAgICAgICAgQ291bnQsIzAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA7Ly8gc2V0IHN0YXJ0PTAKLSAgICAgICAgTV9TVFIgICAgICAgICAgIHBSTUFYVGFibGVMMEwxLHBwUk1BWFRhYmxlTDBMMSAgICAgICAgICAgICAgICAgICAgICAgICAgOy8vIHN0b3JlIFJNQVggdGFibGUgYWRkcmVzcyBvbiBzdGFjawotICAgICAgICAgICAgICAgIAotCi0gICAgICAgIEJMICAgICAgICAgICAgICBhcm1WQ000UDJfRGVjb2RlVkxDWmlnemFnX0FDX3Vuc2FmZSAgICAgICAgICAgICAgICAgOy8vIGNhbGwgVW5zYWZlIEZ1bmN0aW9uIGZvciBWTEMgWmlnemFnIERl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AqICAgLUVuY291bnRlcmVkIGFuZCBpbGxlZ2FsIGNvZGUgaW4gdGhlIFZMQyBGTEMgdGFibGUKLTsgKiAgIC1UaGUgbnVtYmVyIG9mIGNvZWZmaWNpZW50cyBpcyBncmVhdGVyIHRoYW4gNjQKLTsgKgotOyAqLwotCi0KLSAgICAgIElOQ0xVREUgb214dHlwZXNfcy5oCi0gICAgICBJTkNMVURFIGFybUNPTU1fcy5oCi0gICAgICBJTkNMVURFIGFybUNPTU1fQml0RGVjX3MuaAotCi0KLSAgICAgIE1fVkFSSUFOVFMgQVJNMTEzNkpTCi0KLSAgICAgCi0KLQotCi0gICAgIElGIEFSTTExMzZKUwotICAgICAKLSAgICAgICAgOy8vIEltcG9ydCB2YXJpb3VzIHRhYmxlcyBuZWVkZWQgZm9yIHRoZSBmdW5jdGlvbgotCi0gICAgICAgIAotICAgICAgICBJTVBPUlQgICAgICAgICAgYXJtVkNNNFAyX0ludHJhVmxjTDBMMSAgICAgICAgICAgICA7Ly8gQ29udGFpbnMgb3B0aW1pemVkIGFuZCBwYWNrZWQgVkxDIFRhYmxlcyBmb3IgYm90aCBMYXN0ID0xIGFuZCBsYXN0PTAKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDsvLyBQYWNrZWQgaW4gUnVuOkxldmVsOkxhc3QgZm9ybWF0Ci0gICAgICAgIElNUE9SVCAgICAgICAgICBhcm1WQ000UDJfSW50cmFMMEwxTE1BWCAgICAgICAgICAgIDsvLyBDb250YWlucyBMTUFYIHRhYmxlIGVudHJpZXMgd2l0aCBib3RoIExhc3Q9MCBhbmQgTGFzdD0xCi0gICAgICAgIElNUE9SVCAgICAgICAgICBhcm1WQ000UDJfSW50cmFMMEwxUk1BWCAgICAgICAgICAgIDsvLyBDb250YWlucyBSTUFYIHRhYmxlIGVudHJpZXMgd2l0aCBib3RoIExhc3Q9MCBhbmQgTGFzdD0xCi0gICAgICAgIElNUE9SVCAgICAgICAgICBhcm1WQ000UDJfYUNsYXNzaWNhbFppZ3phZ1NjYW4gICAgIDsvLyBjb250YWlucyBjbGFzc2ljYWwgWmlnemFnIHRhYmxlIGVudHJpZXMgd2l0aCBkb3VibGUgdGhlIG9yaWdpbmFsIHZhbHVlcwotICAgICAgICBJTVBPUlQgICAgICAgICAgYXJtVkNNNFAyX0RlY29kZVZMQ1ppZ3phZ19BQ191bnNhZmUKLQotOy8vSW5wdXQgQXJndW1lbnRzCi0KLXBwQml0U3RyZWFtICAgICAgICAgIFJOIDAKLXBCaXRPZmZzZXQgICAgICAgICAgIFJOIDEKLXBEc3QgICAgICAgICAgICAgICAgIFJOIDIKLVByZWREaXIgICAgICAgICAgICAgIFJOIDMKLXNob3J0VmlkZW9IZWFkZXIgICAgIFJOIDMKLQotOy8vTG9jYWwgVmFyaWFibGVzCi0KLVJldHVybiAgICAgICAgICAgICAgIFJOIDAKLQotcFZsY1RhYmxlTDBMMSAgICAgICAgUk4gNAotcExNQVhUYWJsZUwwTDEgICAgICAgUk4gNAotcFJNQVhUYWJsZUwwTDEgICAgICAgUk4gNAotcFppZ3phZ1RhYmxlICAgICAgICAgUk4gNAotQ291bnQgICAgICAgICAgICAgICAgUk4gNgotCi0KLSAgICAgICAgCi0gICAgICAgIDsvLyBBbGxvY2F0ZSBzdGFjayBtZW1vcnkgdG8gc3RvcmUgb3B0aW1pemVkIFZMQyxaaWd6YWcsIFJNQVgsIExNQVggVGFibGUgQWRkcmVzc2VzIAotICAgICAKLSAgICAgICAgTV9BTExPQzQgICAgICAgIHBwVmxjVGFibGVMMEwxLDQKLSAgICAgICAgTV9BTExPQzQgICAgICAgIHBwTE1BWFRhYmxlTDBMMSw0Ci0gICAgICAgIE1fQUxMT0M0ICAgICAgICBwcFJNQVhUYWJsZUwwTDEsNAotICAgICAgICBNX0FMTE9DNCAgICAgICAgcHBaaWd6YWdUYWJsZSw0Ci0KLSAgICAgICAgCi0gICAgICAgIE1fU1RBUlQgb214VkNNNFAyX0RlY29kZVZMQ1ppZ3phZ19JbnRyYUFDVkxDLHIxMgotCi0gICAgICAgIE1fQVJHICAgICAgICAgICBzaG9ydFZpZGVvSGVhZGVyb25TdGFjayw0ICAgICAgICAgICAgICAgICAgICAgICAgICAgICA7Ly8gcG9pbnRlciB0byBJbnB1dCBBcmd1bWVudCBvbiBzdGFjayAgICAgICAgICAgCi0KLSAgICAgICAgTERSICAgICAgICAgICAgIHBaaWd6YWdUYWJsZSwgPWFybVZDTTRQMl9hQ2xhc3NpY2FsWmlnemFnU2NhbiAgICAgOy8vIExvYWQgQWRkcmVzcyBvZiB0aGUgWmlnemFnIHRhYmxlICAgIAotICAgICAgICBBREQgICAgICAgICAgICAgcFppZ3phZ1RhYmxlLCBwWmlnemFnVGFibGUsIFByZWREaXIsIExTTCAjNiAgICAgICAgICAgOy8vIExvYWRpbmcgRGlmZmVyZW50IHR5cGUgb2YgemlnemFnIHRhYmxlcyBiYXNlZCBvbiBQcmVkRGlyCi0gICAgICAgCi0gICAgICAgIE1fU1RSICAgICAgICAgICBwWmlnemFnVGFibGUscHBaaWd6YWdUYWJsZSAgICAgICAgICAgICAgICAgICAgICAgICAgICA7Ly8gU3RvcmUgWmlnemFnIHRhYmxlIGFkZHJlc3Mgb24gc3RhY2sKLSAgICAgICAgTERSICAgICAgICAgICAgIHBWbGNUYWJsZUwwTDEsID1hcm1WQ000UDJfSW50cmFWbGNMMEwxICAgICAgICAgICAgOy8vIExvYWQgb3B0aW1pemVkIHBhY2tlZCBWTEMgVGFibGUgd2l0aCBib3RoIEw9MCBhbmQgTD0xIGVudHJpZXMKLSAgICAgICAgTV9TVFIgICAgICAgICAgIHBWbGNUYWJsZUwwTDEscHBWbGNUYWJsZUwwTDEgICAgICAgICAgICAgICAgICAgICAgICAgIDsvLyBTdG9yZSBWTEMgVGFibGUgYWRkcmVzcyBvbiBzdGFjawotICAgICAgICBMRFIgICAgICAgICAgICAgcExNQVhUYWJsZUwwTDEsID1hcm1WQ000UDJfSW50cmFMMEwxTE1BWCAgICAgICAgICA7Ly8gTG9hZCBMTUFYIFRhYmxlCi0gICAgICAgIE1fU1RSICAgICAgICAgICBwTE1BWFRhYmxlTDBMMSxwcExNQVhUYWJsZUwwTDEgICAgICAgICAgICAgICAgICAgICAgICA7Ly8gU3RvcmUgTE1BWCBUYWJsZSBhZGRyZXNzIG9uIFN0YWNrCi0gICAgICAgIExEUiAgICAgICAgICAgICBwUk1BWFRhYmxlTDBMMSwgPWFybVZDTTRQMl9JbnRyYUwwTDFSTUFYICAgICAgICAgIDsvLyBMb2FkIFJNQVggVGFibGUKLSAgICAgICAgTU9WICAgICAgICAgICAgIENvdW50LCMwICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDsvLyBTZXQgU3RhcnQ9MCAgICAgICAgCi0gICAgICAgIAotICAgICAgICBNX1NUUiAgICAgICAgICAgcFJNQVhUYWJsZUwwTDEscHBSTUFYVGFibGVMMEwxICAgICAgICAgICAgICAgICAgICAgICAgOy8vIFN0b3JlIFJNQVggVGFibGUgYWRkcmVzcyBvbiBzdGFjawotICAgICAgICAgICAgICAKLQotICAgICAgIAotICAgICAgICBNX0xEUiAgICAgICAgICAgc2hvcnRWaWRlb0hlYWRlcixzaG9ydFZpZGVvSGVhZGVyb25TdGFjayAgICAgICAgICAgICAgOy8vIGdldCB0aGUgSW5wdXQgQXJndW1lbnQgZnJvbSBzdGFjawotCi0gICAgICAgIEJMICAgICAgICAgICAgICBhcm1WQ000UDJfRGVjb2RlVkxDWmlnemFnX0FDX3Vuc2FmZSAgICAgICAgICAgICAgIDsvLyBDYWxsIFVuc2FmZSBGdW5jdGlvbgotCi0KLQotICAgICAgICAKLSAgICAgICAgTV9FTkQKLSAgICAgICAgRU5ESUYKLSAgICAgICAgCi0gICAgICAgIEVORApkaWZmIC0tZ2l0IGEvbWVkaWEvbGlic3RhZ2VmcmlnaHQvY29kZWNzL29uMi9oMjY0ZGVjL29teGRsL2FybTExL3ZjL200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JTkNMVURFIG9teHR5cGVzX3MuaAotICAgICAgSU5DTFVERSBhcm1DT01NX3MuaAotICAgICAgSU5DTFVERSBhcm1DT01NX0JpdERlY19zLmgKLQotCi0gICAgICBNX1ZBUklBTlRTIEFSTTExMzZKUwotCi0gICAgIAotICAgICAgCi0KLQotICAgICAgSUYgQVJNMTEzNkpTIDpMT1I6IENvcnRleEE4Ci0KLSAgICAgCi0gICAgICAgIDsvLyBJbXBvcnQgdmFyaW91cyB0YWJsZXMgbmVlZGVkIGZvciB0aGUgZnVuY3Rpb24KLQotICAgICAgICAKLSAgICAgICAgSU1QT1JUICAgICAgICAgIGFybVZDTTRQMl9JbnRyYVZsY0wwTDEgICAgICAgICAgICAgOy8vIENvbnRhaW5zIG9wdGltaXplZCBhbmQgcGFja2VkIFZMQyBUYWJsZXMgZm9yIGJvdGggTGFzdCA9MSBhbmQgbGFzdD0wCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA7Ly8gUGFja2VkIGluIFJ1bjpMZXZlbDpMYXN0IGZvcm1hdAotICAgICAgICBJTVBPUlQgICAgICAgICAgYXJtVkNNNFAyX0ludHJhTDBMMUxNQVggICAgICAgICAgICA7Ly8gQ29udGFpbnMgTE1BWCB0YWJsZSBlbnRyaWVzIHdpdGggYm90aCBMYXN0PTAgYW5kIExhc3Q9MQotICAgICAgICBJTVBPUlQgICAgICAgICAgYXJtVkNNNFAyX0ludHJhTDBMMVJNQVggICAgICAgICAgICA7Ly8gQ29udGFpbnMgUk1BWCB0YWJsZSBlbnRyaWVzIHdpdGggYm90aCBMYXN0PTAgYW5kIExhc3Q9MQotICAgICAgICBJTVBPUlQgICAgICAgICAgYXJtVkNNNFAyX2FDbGFzc2ljYWxaaWd6YWdTY2FuICAgICA7Ly8gY29udGFpbnMgQ0xhc3NpY2FsLCBIb3Jpem9udGFsLCBWZXJ0aWNhbCBaaWd6YWcgdGFibGUgZW50cmllcyB3aXRoIGRvdWJsZSB0aGUgb3JpZ2luYWwgdmFsdWVzCi0gICAgICAgIElNUE9SVCAgICAgICAgICBhcm1WQ000UDJfYUludHJhRENMdW1hQ2hyb21hSW5kZXggIDsvLyBDb250YWlucyBPcHRpbWl6ZWQgRENMdW1hIGFuZCBEQ0Nocm9tYSBJbmRleCB0YWJsZSBFbnRyaWVzCi0gICAgICAgIAotCi0gICAgICAgIElNUE9SVCAgICAgICAgICBhcm1WQ000UDJfRGVjb2RlVkxDWmlnemFnX0FDX3Vuc2FmZQotCi07Ly9JbnB1dCBBcmd1bWVudHMKLQotcHBCaXRTdHJlYW0gICAgICAgICAgUk4gMAotcEJpdE9mZnNldCAgICAgICAgICAgUk4gMQotcERzdCAgICAgICAgICAgICAgICAgUk4gMgotUHJlZERpciAgICAgICAgICAgICAgUk4gMwotc2hvcnRWaWRlb0hlYWRlciAgICAgUk4gMwotdmlkZW9Db21wICAgICAgICAgICAgUk4gNQotOy8vTG9jYWwgVmFyaWFibGVzCi0KLVJldHVybiAgICAgICAgICAgICAgIFJOIDAKLQotcERDTHVtYUNocm9tYUluZGV4ICAgUk4gNAotcERDQ2hyb21hSW5kZXggICAgICAgUk4gNwotcFZsY1RhYmxlTDBMMSAgICAgICAgUk4gNAotcExNQVhUYWJsZUwwTDEgICAgICAgUk4gNAotcFJNQVhUYWJsZUwwTDEgICAgICAgUk4gNAotcFppZ3phZ1RhYmxlICAgICAgICAgUk4gNAotQ291bnQgICAgICAgICAgICAgICAgUk4gNgotRENWYWx1ZVNpemUgICAgICAgICAgUk4gNgotcG93T2ZTaXplICAgICAgICAgICAgUk4gNwotdGVtcDEgICAgICAgICAgICAgICAgUk4gNQotCi0KLTsvLyBTY3JhdGNoIFJlZ2lzdGVycwotCi1SQml0U3RyZWFtICAgICAgICAgICBSTiA4Ci1SQml0QnVmZmVyICAgICAgICAgICBSTiA5Ci1SQml0Q291bnQgICAgICAgICAgICBSTiAxMAotCi1UMSAgICAgICAgICAgICAgICAgICBSTiAxMQotVDIgICAgICAgICAgICAgICAgICAgUk4gMTIKLURDVmFsICAgICAgICAgICAgICAgIFJOIDE0Ci0KLSAgICAgICAgCi0gICAgICAgIDsvLyBBbGxvY2F0ZSBzdGFjayBtZW1vcnkgdG8gc3RvcmUgb3B0aW1pemVkIFZMQyxaaWd6YWcsIFJNQVgsIExNQVggVGFibGUgQWRkcmVzc2VzIAotICAgICAKLSAgICAgICAgTV9BTExPQzQgICAgICAgIHBwVmxjVGFibGVMMEwxLDQKLSAgICAgICAgTV9BTExPQzQgICAgICAgIHBwTE1BWFRhYmxlTDBMMSw0Ci0gICAgICAgIE1fQUxMT0M0ICAgICAgICBwcFJNQVhUYWJsZUwwTDEsNAotICAgICAgICBNX0FMTE9DNCAgICAgICAgcHBaaWd6YWdUYWJsZSw0Ci0gICAgICAgIE1fQUxMT0M0ICAgICAgICBwRENDb2VmZiw0Ci0gICAgICAgIAotCi0gICAgICAgIAotICAgICAgICBNX1NUQVJUIG9teFZDTTRQMl9EZWNvZGVWTENaaWd6YWdfSW50cmFEQ1ZMQyxyMTIKLQotICAgICAgICBNX0FSRyAgICAgICAgICAgc2hvcnRWaWRlb0hlYWRlcm9uU3RhY2ssNCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA7Ly8gUG9pbnRlciB0byBhcmd1bWVudCBvbiBzdGFjayAgCi0gICAgICAgIE1fQVJHICAgICAgICAgICB2aWRlb0NvbXBvbnN0YWNrLDQgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDsvLyBQb2ludGVyIHRvIGFyZ3VtZW50IG9uIHN0YWNrCi0KLSAgICAgICAgCi0gICAgICAgIDsvLyBEZWNvZGUgREMgQ29lZmZpY2llbnQKLQotICAgICAgICAKLSAgICAgICAgTERSICAgICAgICAgICAgIHBEQ0x1bWFDaHJvbWFJbmRleCwgPWFybVZDTTRQMl9hSW50cmFEQ0x1bWFDaHJvbWFJbmRleCA7Ly8gTG9hZCBPcHRpbWl6ZWQgVkxDIFRhYmxlIGZvciBMdW1pbmFuY2UgYW5kIENocm9taW5hbmNlCi0KLSAgICAgICAgOy8vIEluaXRpYWxpemluZyB0aGUgQml0c3RyZWFtIE1hY3JvCi0KLSAgICAgICAgTV9CRF9JTklUMCAgICAgIHBwQml0U3RyZWFtLCBwQml0T2Zmc2V0LCBSQml0U3RyZWFtLCBSQml0QnVmZmVyLCBSQml0Q291bnQKLSAgICAgICAgTV9MRFIgICAgICAgICAgIHZpZGVvQ29tcCx2aWRlb0NvbXBvbnN0YWNrICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCi0gICAgICAgIE1fQkRfSU5JVDEgICAgICBUMSwgVDIsIFQyCi0gICAgICAgIEFERCAgICAgICAgICAgICBwRENMdW1hQ2hyb21hSW5kZXgscERDTHVtYUNocm9tYUluZGV4LHZpZGVvQ29tcCwgTFNMICM2ICAgICAgICAgICAgIAotICAgICAgICBNX0JEX0lOSVQyICAgICAgVDEsIFQyLCBUMgotICAgIAotICAgICAgICAKLSAgICAgICAgTV9CRF9WTEQgICAgICAgIERDVmFsdWVTaXplLFQxLFQyLHBEQ0x1bWFDaHJvbWFJbmRleCw0LDIgICAgICAgICAgICAgICAgICAgIDsvLyBWTEMgRGVjb2RlIHVzaW5nIG9wdGltaXplZCBMdW1pbmFuY2UgYW5kIENocm9taW5hbmNlIFZMQyBUYWJsZQotCi0gICAgCi0gICAgICAgCi0KLURlY29kZURDCi0gICAgICAgICAgICAgICAgICAgICAgICAgCi0gICAgICAgIENNUCAgICAgICAgICAgICBEQ1ZhbHVlU2l6ZSwjMTIgICAgIAotICAgICAgICBCR1QgICAgICAgICAgICAgRXhpdEVycm9yCi0gICAgICAgIAotICAgICAgICBDTVAgICAgICAgICAgICAgRENWYWx1ZVNpemUsIzAKLSAgICAgICAgTU9WRVEgICAgICAgICAgIERDVmFsLCMwICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDsvLyBJZiBEQ1ZhbHVlU2l6ZSBpcyB6ZXJvIHRoZW4gREMgY29lZmYgPTAKLSAgICAgICAgQkVRICAgICAgICAgICAgIEFDRGVjb2RlICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDsvLyBCcmFuY2ggdG8gcGVyZm9ybSBBQyBDb2VmZiBEZWNvZGluZwotICAgICAgICAKLSAgICAgICAgTV9CRF9WUkVBRDE2ICAgIERDVmFsLERDVmFsdWVTaXplLFQxLFQyICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDsvLyBHZXQgREMgVmFsdWUgRnJvbSBCaXQgc3RyZWFtCi0gICAgICAgICAKLQotICAgICAgICBNT1YgICAgICAgICAgICAgcG93T2ZTaXplLCMxICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCi0gICAgICAgIExTTCAgICAgICAgICAgICBwb3dPZlNpemUsRENWYWx1ZVNpemUgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA7Ly8gcG93T2ZTaXplPXBvdygyLERDVmFsdWVTaXplKQotICAgICAgICBDTVAgICAgICAgICAgICAgRENWYWwscG93T2ZTaXplLExTUiAjMSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOy8vIENvbXBhcmUgRENWYWwgd2l0aCBwb3dPZlNpemUvMiAKLSAgICAgICAgQURETFQgICAgICAgICAgIERDVmFsLERDVmFsLCMxCi0gICAgICAgIFNVQkxUICAgICAgICAgICBEQ1ZhbCxEQ1ZhbCxwb3dPZlNpemUgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA7Ly8gSWYgTGVzc3RoYW4gcG93T2ZTaXplLzIgRENWYWw9RENWYWwtcG93T2ZTaXplKzEKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDsvLyBFbHNlIERDVmFsPSBmZXRjaGJpdHMgZnJvbSBiaXQgc3RyZWFtCi0KLUNoZWNrRENWYWx1ZVNpemUKLSAgICAgICAgCi0gICAgICAgIENNUCAgICAgICAgICAgICBEQ1ZhbHVlU2l6ZSwjOCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA7Ly8gSWYgRENWYWx1ZVNpemUgZ3JlYXRlciB0aGFuIDggY2hlY2sgbWFya2VyIGJpdAotCi0gICAgICAgIEJMRSAgICAgICAgICAgICBBQ0RlY29kZQotCi0gICAgICAgIE1fQkRfUkVBRDggICAgICB0ZW1wMSwxLFQxCi0gICAgICAgIFRFUSAgICAgICAgICAgICB0ZW1wMSwjMCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA7Ly8gSWYgTWFya2VyIGJpdCBpcyB6ZXJvIEV4aXQgd2l0aCBhbiBFcnJvciBNZXNzYWdlCi0gICAgICAgIEJFUSAgICAgICAgICAgICBFeGl0RXJyb3IKLQotICAgICAgICAKLQotICAgICAgICA7Ly8gRGVjb2RlIEFDIENvZWZmaWNpZW50Ci0KLUFDRGVjb2RlCi0KLSAgICAgICAgTV9TVFIgICAgICAgICAgIERDVmFsLHBEQ0NvZWZmICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOy8vIFN0b3JlIERlY29kZWQgREMgQ29lZmYgb24gU3RhY2sKLSAgICAgICAgTV9CRF9GSU5JICAgICAgIHBwQml0U3RyZWFtLHBCaXRPZmZzZXQgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOy8vIFRlcm1pbmF0aW5nIHRoZSBCaXQgc3RyZWFtIE1hY3JvCi0gICAgICAgICAKLSAgICAgICAgTERSICAgICAgICAgICAgIHBaaWd6YWdUYWJsZSwgPWFybVZDTTRQMl9hQ2xhc3NpY2FsWmlnemFnU2NhbiAgICAgICAgICA7Ly8gTG9hZCBaaWd6YWcgdGFsYmUgYWRkcmVzcyAgIAotICAgICAgICBBREQgICAgICAgICAgICAgcFppZ3phZ1RhYmxlLCBwWmlnemFnVGFibGUsIFByZWREaXIsIExTTCAjNiAgICAgICAgICAgICAgICA7Ly8gTW9kaWZ5IHRoZSBaaWd6YWcgdGFibGUgYWRyZXNzIGJhc2VkIG9uIFByZWREaXIgICAgICAgICAgICAgICAgCi0gICAgICAgCi0gICAgICAgIE1fU1RSICAgICAgICAgICBwWmlnemFnVGFibGUscHBaaWd6YWdUYWJsZSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDsvLyBTdG9yZSB6aWd6YWcgdGFibGUgb24gc3RhY2sKLSAgICAgICAgTERSICAgICAgICAgICAgIHBWbGNUYWJsZUwwTDEsID1hcm1WQ000UDJfSW50cmFWbGNMMEwxICAgICAgICAgICAgICAgICA7Ly8gTG9hZCBPcHRpbWl6ZWQgVkxDIFRhYmxlIFdpdGggYm90aCBMYXN0PTAgYW5kIExhc3Q9MSBFbnRyaWVzCi0gICAgICAgIE1fU1RSICAgICAgICAgICBwVmxjVGFibGVMMEwxLHBwVmxjVGFibGVMMEwxICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDsvLyBTdG9yZSBPcHRpbWl6ZWQgVkxDIFRhYmxlIG9uIHN0YWNrCi0gICAgICAgIExEUiAgICAgICAgICAgICBwTE1BWFRhYmxlTDBMMSwgPWFybVZDTTRQMl9JbnRyYUwwTDFMTUFYICAgICAgICAgICAgICAgOy8vIExvYWQgTE1BWCBUYWJsZQotICAgICAgICBNX1NUUiAgICAgICAgICAgcExNQVhUYWJsZUwwTDEscHBMTUFYVGFibGVMMEwxICAgICAgICAgICAgICAgICAgICAgICAgICAgICA7Ly8gU3RvcmUgTE1BWCB0YWJsZSBvbiBzdGFjawotICAgICAgICBMRFIgICAgICAgICAgICAgcFJNQVhUYWJsZUwwTDEsID1hcm1WQ000UDJfSW50cmFMMEwxUk1BWCAgICAgICAgICAgICAgIDsvLyBMb2FkIFJNQVggVGFibGUKLSAgICAgICAgTU9WICAgICAgICAgICAgIENvdW50LCMxICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOy8vIFNldCBTdGFydCA9MSAgICAgICAgCi0gICAgICAgIAotICAgICAgICBNX1NUUiAgICAgICAgICAgcFJNQVhUYWJsZUwwTDEscHBSTUFYVGFibGVMMEwxICAgICAgICAgICAgICAgICAgICAgICAgICAgICA7Ly8gU3RvcmUgUk1BWCBUYWJsZSBvbiBTdGFjawotICAgICAgICAKLSAgICAgICAKLSAgICAgICAgTV9MRFIgICAgICAgICAgIHNob3J0VmlkZW9IZWFkZXIsc2hvcnRWaWRlb0hlYWRlcm9uU3RhY2sgICAgICAgICAgICAgICAgICAgOy8vIExvYWQgdGhlIElucHV0IEFyZ3VtZW50IEZyb20gU3RhY2sKLSAgICAgICAgCi0gICAgICAgIEJMICAgICAgICAgICAgICBhcm1WQ000UDJfRGVjb2RlVkxDWmlnemFnX0FDX3Vuc2FmZSAgICAgICAgICAgICAgICAgICAgOy8vIENhbGwgdGhlIFVuc2FmZSBGdW5jdGlvbgotCi0gICAgICAgIE1fTERSICAgICAgICAgICBEQ1ZhbCxwRENDb2VmZiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDsvLyBHZXQgdGhlIERlY29kZWQgREMgVmFsdWUgRnJvbSBTdGFjawotICAgICAgICBTVFJIICAgICAgICAgICAgRENWYWwsW3BEc3RdICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA7Ly8gU3RvcmUgdGhlIERDIFZhbHVlIAotICAgICAgICBCICAgICAgICAgICAgICAgRXhpdE9LCi0gICAgICAgIAotICAgICAgICAgICAgICAKLQotRXhpdEVycm9yCi0gCi0gICAgICAgIE1fQkRfRklOSSAgICAgICBwcEJpdFN0cmVhbSxwQml0T2Zmc2V0ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDsvLyBUZXJtaW5hdGluZyB0aGUgQml0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LQotOy8vIEZ1bmN0aW9uOgotOy8vICAgICBvbXhWQ000UDJfRmluZE1WcHJlZAotOy8vCi0gICAgICAgIDsvLyBJbmNsdWRlIGhlYWRlcnMKLSAgICAgICAgSU5DTFVERSBvbXh0eXBlc19zLmgKLSAgICAgICAgSU5DTFVERSBhcm1DT01NX3MuaAotICAgICAgICBJTkNMVURFIGFybVZDQ09NTV9zLmgKLQotICAgICAgICA7Ly8gRGVmaW5lIGNwdSB2YXJpYW50cwotICAgICAgICBNX1ZBUklBTlRTIEFSTTExMzZKUwotICAgICAgICAKLSAgICAgICAgCi0gICAgICAgIElGIEFSTTExMzZKUwotICAgICAgICAKLSAgICAgICAgTV9UQUJMRSBhcm1WQ000UDJfcEJsa0luZGV4VGFibGUKLSAgICAgICAgRENEICBPTVhWQ0JsazAsIE9NWFZDQmxrMQotICAgICAgICBEQ0QgIE9NWFZDQmxrMiwgT01YVkNCbGszCi0KLTsvLy0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tCi07Ly8gRGVjbGFyZSBpbnB1dCByZWdpc3RlcnMKLTsvLy0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tCi0gICAgICAgIAotcFNyY01WQ3VyTUIgICAgICAgICAgICBSTiAwCi1wU3JjQ2FuZE1WMSAgICAgICAgICAgIFJOIDEKLXBTcmNDYW5kTVYyICAgICAgICAgICAgUk4gMgotcFNyY0NhbmRNVjMgICAgICAgICAgICBSTiAzCi1wRHN0TVZQcmVkICAgICAgICAgICAgIFJOIDQKLXBEc3RNVlByZWRNRSAgICAgICAgICAgUk4gNQotaUJsayAgICAgICAgICAgICAgICAgICBSTiA2Ci0KLXBUYWJsZSAgICAgICAgICAgICAgICAgUk4gNAotQ2FuZE1WICAgICAgICAgICAgICAgICBSTiAxMgotCi1wQ2FuZE1WMSAgICAgICAgICAgICAgIFJOIDcKLXBDYW5kTVYyICAgICAgICAgICAgICAgUk4gOAotcENhbmRNVjMgICAgICAgICAgICAgICBSTiA5Ci0KLUNhbmRNVjFkeCAgICAgICAgICAgICAgUk4gMCAKLUNhbmRNVjFkeSAgICAgICAgICAgICAgUk4gMSAKLUNhbmRNVjJkeCAgICAgICAgICAgICAgUk4gMgotQ2FuZE1WMmR5ICAgICAgICAgICAgICBSTiAzCi1DYW5kTVYzZHggICAgICAgICAgICAgIFJOIDEwCi1DYW5kTVYzZHkgICAgICAgICAgICAgIFJOIDExCi0KLXRlbXAgICAgICAgICAgICAgICAgICAgUk4gMTQKLQotemVybyAgICAgICAgICAgICAgICAgICBSTiAxNAotcmV0dXJuICAgICAgICAgICAgICAgICBSTiAwCi0gICAgICAgIAotOyAtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tCi07IE1haW4gcm91dGluZQotOyAtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tICAgICAgICAKLQotICAgICAgICBNX0FMTE9DNCBNViwgNAotICAgICAgICAKLSAgICAgICAgOy8vIEZ1bmN0aW9uIGhlYWRlciAKLSAgICAgICAgTV9TVEFSVCBvbXhWQ000UDJfRmluZE1WcHJlZCwgcjExCi0gICAgICAgIAotICAgICAgICA7Ly8gRGVmaW5lIHN0YWNrIGFyZ3VtZW50cwotICAgICAgICBNX0FSRyAgIHBwRHN0TVZQcmVkLCAgNAotICAgICAgICBNX0FSRyAgIHBwRHN0TVZQcmVkTUUsIDQKLSAgICAgICAgTV9BUkcgICBCbGssIDQKLSAgICAgICAgCi0gICAgICAgIE1fQURSIENhbmRNViwgTVYKLSAgICAgICAgTU9WICAgemVybywgIzAKLSAgICAgICAgTV9MRFIgaUJsaywgQmxrCi0gICAgICAgIAotICAgICAgICA7Ly8gU2V0IHRoZSBkZWZhdWx0IHZhbHVlIGZvciB0aGVzZQotICAgICAgICA7Ly8gdG8gYmUgdXNlZCBpZiBw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01QRVEgcFNyY0NhbmRNVjIsICMwCi0gICAgCi0gICAgICAgIE1PVkVRIHBDYW5kTVYxLCBwQ2FuZE1WMwotICAgICAgICBNT1ZFUSBwQ2FuZE1WMiwgcENhbmRNVjMKLSAgICAgICAgCi0gICAgICAgIENNUCAgIHBTcmNDYW5kTVYyLCAjMAotICAgICAgICBDTVBFUSBwU3JjQ2FuZE1WMywgIzAKLSAgICAKLSAgICAgICAgTU9WRVEgcENhbmRNVjIsIHBDYW5kTVYxCi0gICAgICAgIE1PVkVRIHBDYW5kTVYzLCBwQ2FuZE1WMQotICAgICAgICAKLSAgICAgICAgQiAgICAgQmxrRW5kCi0gICAgCi1PTVhWQ0JsazEKLSAgICAgICAgTU9WICAgcENhbmRNVjEsIHBTcmNNVkN1ck1CCi0gICAgICAgIENNUCAgIHBTcmNDYW5kTVYzLCAjMAotICAgICAgICBBRERORSBwQ2FuZE1WMywgcFNyY0NhbmRNVjMsICM4Ci0gICAgICAgIAotICAgICAgICBDTVAgICBwU3JjQ2FuZE1WMiwgIzAKLSAgICAgICAgQURETkUgcENhbmRNVjIsIHBTcmNDYW5kTVYyLCAjMTIKLSAgICAKLSAgICAgICAgQ01QRVEgcFNyY0NhbmRNVjMsICMwCi0gICAgCi0gICAgICAgIE1PVkVRIHBDYW5kTVYyLCBwQ2FuZE1WMQotICAgICAgICBNT1ZFUSBwQ2FuZE1WMywgcENhbmRNVjEKLSAgICAgICAgICAgIAotICAgICAgICBCICAgICBCbGtFbmQKLQotT01YVkNCbGsyCi0gICAgICAgIENNUCAgIHBTcmNDYW5kTVYxLCAjMAotICAgICAgICBNT1YgICBwQ2FuZE1WMiwgcFNyY01WQ3VyTUIKLSAgICAgICAgQUREICAgcENhbmRNVjMsIHBTcmNNVkN1ck1CLCAjNAotICAgICAgICBBRERORSBwQ2FuZE1WMSwgcFNyY0NhbmRNVjEsICMxMgotICAgICAgICBCICAgICBCbGtFbmQKLQotT01YVkNCbGszCi0gICAgICAgIEFERCAgIHBDY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otOy8vIAotOy8vIChjKSBDb3B5cmlnaHQgMjAwNy0yMDA4IEFSTSBMaW1pdGVkLiBBbGwgUmlnaHRzIFJlc2VydmVkLgotOy8vIAotOy8vIAotOy8vCi07Ly8gRGVzY3JpcHRpb246Ci07Ly8KLTsvLwotCi07Ly8gSW5jbHVkZSBzdGFuZGFyZCBoZWFkZXJzCi0gICAgSU5DTFVERSBvbXh0eXBlc19zLmgKLSAgICBJTkNMVURFIGFybUNPTU1fcy5oCi0KLTsvLyBJbXBvcnQgc3ltYm9scyByZXF1aXJlZCBmcm9tIG90aGVyIGZpbGVzCi0KLSAgICBNX1ZBUklBTlRTIEFSTTExMzZKUwotCi07Ly8gKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCi07Ly8gQVJNMTEzNkpTIGltcGxlbWVudGF0aW9uCi07Ly8gKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCi0gICAgSUYgIEFSTTExMzZKUwotICAgIAotOy8vICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgotOy8vIE1BQ1JPIERFRklOSVRJT05TCi07Ly8gKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCi0gICAgOy8vIERlc2NyaXB0aW9uOgotICAgIDsvLwotICAgIDsvLyAgIGRlc3Rbal0gPSAoeFtqXSArIHlbal0gKyByb3VuZCkgPj4gMSwgICBqPTAuLjMKLSAgICA7Ly8KLSAgICA7Ly8gU2ltaWxhciB0byBVSEFERDggaW5zdHJ1Y3Rpb24sIGJ1dCB3aXRoIGEgcm91bmRpbmcgdmFsdWUgb2YgMSBhZGRlZCB0bwotICAgIDsvLyBlYWNoIHN1bSBiZWZvcmUgZGl2aWRpbmcgYnkgdHdvLCBpZiByb3VuZCBpcyAxCi0gICAgOy8vCi0gICAgOy8vIFN5bnRheDoKLSAgICA7Ly8gTV9VSEFERDhSICAgJGRlc3QsICR4LCAkeSwgJHJvdW5kLCAkbWFzawotICAgIDsvLwotICAgIDsvLyBJbnB1dHM6Ci0gICAgOy8vICR4ICAgICAgICBmb3VyIHBhY2tlZCBieXRlcywgICB4WzNdIDogIHhbMl0gIDogIHhbMV0gIDogIHhbMF0KLSAgICA7Ly8gJHkgICAgICAgIGZvdXIgcGFja2VkIGJ5dGVzLCAgIHlbM10gOiAgeVsyXSAgOiAgeVsxXSAgOiAgeVswXQotICAgIDsvLyAkcm91bmQgICAgMCBpZiBubyByb3VuZGluZyB0byBiZSBhZGRlZCwgMSBpZiByb3VuZGluZyB0byBiZSBkb25lCi0gICAgOy8vICRtYXNrICAgICBzb21lIHJlZ2lzdGVyIHNldCB0byAweDgwODA4MDgwCi0gICAgOy8vCi0gICAgOy8vIE91dHB1dHM6Ci0gICAgOy8vICRkZXN0ICAgICBmb3VyIHBhY2tlZCBieXRlcywgICB6WzNdIDogIHpbMl0gIDogIHpbMV0gIDogIHpbMF0KLQotICAgIE1BQ1JPCi0gICAgTV9VSEFERDhSICAgJGRlc3QsICR4LCAkeSwgJHJvdW5kLCAkbWFzawotICAgIElGICRyb3VuZCA9IDEKLSAgICAgICAgSUYgICRkZXN0IC89ICR5Ci0gICAgICAgICAgICBNVk4gICAgICAgICAkZGVzdCwgJHgKLSAgICAgICAgICAgIFVIU1VCOCAgICAgICRkZXN0LCAkeSwgJGRlc3QKLSAgICAgICAgICAgIEVPUiAgICAgICAgICRkZXN0LCAkZGVzdCwgJG1hc2sKLSAgICAgICAgRUxTRQotICAgICAgICAgICAgTVZOICAgICAgICAgJGRlc3QsICR5Ci0gICAgICAgICAgICBVSFNVQjggICAgICAkZGVzdCwgJHgsICRkZXN0Ci0gICAgICAgICAgICBFT1IgICAgICAgICAkZGVzdCwgJG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jcm8gYWNjZXB0cyBzdHJpZGUsIGl0IGluY3JlbWVudHMgdGhlIHBTcmMgYnkgCi0gICAgOy8vICAgICAgICAgICAgIHRoYXQgdmFsdWUsIGVsc2UgdW5jaGFuZ2VkCi0gICAgOy8vICRvdXQwICAgICAgIGZvdXIgcGFja2VkIGJ5dGVzLCAgIHpbM10gOiAgelsyXSAgOiAgelsxXSAgOiAgelswXQotICAgIDsvLyAkb3V0MSAgICAgICBmb3VyIHBhY2tlZCBieXRlcywgICB6WzddIDogIHpbNl0gIDogIHpbNV0gIDogIHpbNF0KLSAgICA7Ly8KLSAgICA7Ly8gTm90ZTogeyRvdXQwLCAkb3V0MSwgJHNjcmF0Y2h9IHNob3VsZCBiZSByZWdpc3RlcnMgd2l0aCBhc2NlbmRpbmcKLSAgICA7Ly8gcmVnaXN0ZXIgbnVtYmVyaW5nLiBJbiBjYXNlIG9mZnNldCBpcyAwLCAkc2NyYXRjaCBpcyBub3QgbW9kaWZpZWQuCi0KLSAgICBNQUNSTwotICAgIE1fTE9BRF9YICAgICRwU3JjLCAkc3JjU3RlcCwgJG91dDAsICRvdXQxLCAkc2NyYXRjaCwgJG9mZnNldAotICAgICAgICBJRiAkb2Zmc2V0ID0gMAotICAgICAgICAgICAgTERNICAgICAgICAgJHBTcmMsIHskb3V0MCwgJG91dDF9Ci0gICAgICAgICAgICBBREQgICAgICAgICAkcFNyYywgJHBTcmMsICRzcmNTdGVwCi0gICAgICAgIEVMU0UKLSAgICAgICAgICAgIExETSAgICAgICAgICRwU3JjLCB7JG91dDAsICRvdXQxLCAkc2NyYXRjaH0gCi0gICAgICAgICAgICBBREQgICAgICAgICAkcFNyYywgJHBTcmMsICRzcmNTdGVwCi0gICAgICAgICAgICAKLSAgICAgICAgICAgIE1PViAgICAgICAgICRvdXQwLCAkb3V0MCwgTFNSICM4ICogJG9mZnNldAotICAgICAgICAgICAgT1JSICAgICAgICAgJG91dDAsICRvdXQwLCAkb3V0MSwgTFNMICMoMzIgLSA4ICogKCRvZmZzZXQpKQotICAgICAgICAgICAgTU9WICAgICAgICAgJG91dDEsICRvdXQxLCBMU1IgIzggKiAkb2Zmc2V0Ci0gICAgICAgICAgICBPUlIgICAgICAgICAkb3V0MSwgJG91dDEsICRzY3JhdGNoLCBMU0wgIygzMiAtIDggKiAoJG9mZnNldCkpCi0gICAgICAgIEVORElGCi0gICAgTUVORAotCi07Ly8gKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCi0gICAgOy8vIERlc2NyaXB0aW9uOgotICAgIDsvLyBMb2FkcyB0aHJlZSB3b3JkcyBmb3IgWCBpbnRlcnBvbGF0aW9uLCB1cGRhdGUgcG9pbnRlciB0byBuZXh0IHJvdy4gRm9yIAotICAgIDsvLyBYIGludGVycG9sYXRpb24sIGdpdmVuIGEgdHJ1bmNhdGVkLTRieXRlQWxpZ25lZCBzb3VyY2UgcG9pbnRlciwgCi0gICAgOy8vIGludmFyaWFibHkgdGhyZWUgY29udGlub3VzIHdvcmRzIGFyZSByZXF1aXJlZCBmcm9tIHRoZXJlIHRvIGdldCB0aGUKLSAgICA7Ly8gbmluZSBieXRlcyBmcm9tIHRoZSBzb3VyY2UgcG9pbnRlciBmb3IgZmlsdGVyaW5nLiAKLSAgICA7Ly8KLSAgICA7Ly8gU3ludGF4OgotICAgIDsvLyBNX0xPQURfWElOVCAkcFNyYywgJHNyY1N0ZXAsICRvZmZzZXQsICR3b3JkMCwgJHdvcmQxLCAkd29yZDIsICR3b3JkMwotICAgIDsvLyAKLSAgICA7Ly8gSW5wdXRzOgotICAgIDsvLyAkcFNyYyAgICAgICA0IGJ5dGUgYWxpZ25lZCBzb3VyY2UgcG9pbnRlciB0byBhbiBhZGRyZXNzIGp1c3QgbGVzcyB0aGFuIAotICAgIDsvLyAgICAgICAgICAgICBvciBlcXVhbCB0byB0aGUgZGF0YSBsb2NhdGlvbgotICAgIDsvLwotICAgIDsvLyAkc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ICA7Ly8gICAgICAgICAgICAgZW5kaWFuIGVudmlyb25zCi0gICAgOy8vIAotICAgIDsvLyBOb3RlOiB7JHdvcmQwLCAkd29yZDEsICR3b3JkMiwgJHdvcmQzfSBzaG91bGQgYmUgcmVnaXN0ZXJzIHdpdGggYXNjZW5kaW5nCi0gICAgOy8vIHJlZ2lzdGVyIG51bWJlcmluZwotCi0gICAgTUFDUk8KLSAgICBNX0xPQURfWElOVCAkcFNyYywgJHNyY1N0ZXAsICRvZmZzZXQsICR3b3JkMCwgJHdvcmQxLCAkd29yZDIsICR3b3JkMwotICAgICAgICBJRiAkb2Zmc2V0IC89IDMKLSAgICAgICAgICAgIExETSAgICAgICAgICRwU3JjLCB7JHdvcmQwLCAkd29yZDEsICR3b3JkMn0KLSAgICAgICAgRUxTRQotICAgICAgICAgICAgTERNICAgICAgICAgJHBTcmMsIHskd29yZDAsICR3b3JkMiwgJHdvcmQzfQotICAgICAgICBFTkRJRgotICAgICAgICBBREQgICAgICAgICAkcFNyYywgJHBTcmMsICRzcmNTdGVwCi0gICAgTUVORAotCi07Ly8gKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCi0gICAgOy8vIERlc2NyaXB0aW9uOgotICAgIDsvLyBFeHRyYWN0IGZvdXIgcmVnaXN0ZXJzIG9mIGZvdXIgcGl4ZWxzIGZvciBYIGludGVycG9sYXRpb24gCi0gICAgOy8vIAotICAgIDsvLyBTeW50YXg6Ci0gICAgOy8vIE1fRVhUX1hJTlQgJG9mZnNldCwgJHdvcmQwLCAkd29yZDEsICR3b3JkMiwgJHdvcmQzCi0gICAgOy8vIAotICAgIDsvLyBJbnB1dHM6Ci0gICAgOy8vICRvZmZzZXQgICAgIERpZmZlcmVuY2Ugb2Ygc291cmNlIGRhdGEgbG9jYXRpb24gdG8gdGhlIHNvdXJjZSBwb2ludGVyCi0gICAgOy8vICAgICAgICAgICAgIFVzZSB3aGVu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ICAgICAgOyAkd29yZDIsICR3b3JkMyBhcmUganVzdCA4IHNoaWZ0ZWQgdmVyc2lvbnMKLSAgICAgICAgICAgIE1PViAgICAgICAgICR3b3JkMywgJHdvcmQxLCBMU1IgIzgKLSAgICAgICAgICAgIE9SUiAgICAgICAgICR3b3JkMywgJHdvcmQzLCAkd29yZDIsIExTTCAjMjQKLSAgICAgICAgICAgIE1PViAgICAgICAgICR3b3JkMiwgJHdvcmQwLCBMU1IgIzgKLSAgICAgICAgICAgIE9SUiAgICAgICAgICR3b3JkMiwgJHdvcmQyLCAkd29yZDEsIExTTCAjMjQKLSAgICAgICAgRUxJRiAkb2Zmc2V0ID0gMwotICAgICAgICAgICAgOyAkd29yZDIgYW5kICR3b3JkMyBhcmUgb2sgKHRha2VuIGNhcmUgd2hpbGUgbG9hZGluZyBpdHNlbGYpCi0gICAgICAgICAgICA7IHNldCAkd29yZDAgJiAkd29yZDEKLSAgICAgICAgICAgIE1PViAgICAgICAgICR3b3JkMCwgJHdvcmQwLCBMU1IgIzI0Ci0gICAgICAgICAgICBPUlIgICAgICAgICAkd29yZDAsICR3b3JkMCwgJHdvcmQyLCBMU0wgIzgKLSAgICAgICAgICAgIE1PViAgICAgICAgICR3b3JkMSwgJHdvcmQyLCBMU1IgIzI0Ci0gICAgICAgICAgICBPUlIgICAgICAgICAkd29yZDEsICR3b3JkMSwgJHdvcmQzLCBMU0wgIzgKLSAgICAgICAgRUxTRQotICAgICAgICAgICAgTU9WICAgICAgICAgJHdvcmQwLCAkd29yZDAsIExTUiAjOCAqICRvZmZzZXQKLSAgICAgICAgICAgIE9SUiAgICAgICAgICR3b3JkMCwgJHdvcmQwLCAkd29yZDEsIExTTCAjKDMyIC0gOCAqICgkb2Zmc2V0KSkKLSAgICAgICAgICAgIE1PViAgICAgICAgICR3b3JkMSwgJHdvcmQxLCBMU1IgIzggKiAkb2Zmc2V0Ci0gICAgICAgICAgICBPUlIgICAgICAgICAkd29yZDEsICR3b3JkMSwgJHdvcmQyLCBMU0wgIygzMiAtIDggKiAoJG9mZnNldCkpCi0KLSAgICAgICAgICAgIE1PViAgICAgICAgICR3b3JkMywgJHdvcmQxLCBMU1IgIzgKLSAgICAgICAgICAgIE9SUiAgICAgICAgICR3b3JkMywgJHdvcmQzLCAkd29yZDIsIExTTCAjKDMyIC0gOCAqICgoJG9mZnNldCkrMSkpCi0gICAgICAgICAgICBNT1YgICAgICAgICAkd29yZDIsICR3b3JkMCwgTFNSICM4Ci0gICAgICAgICAgICBPUlIgICAgICAgICAkd29yZDIsICR3b3JkMiwgJHdvcmQxLCBMU0wgIzI0Ci0gICAgICAgIEVORElGCi0gICAgTUVORAotCi07Ly8gKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCi0gICAgOy8vIERlc2NyaXB0aW9uOgotICAgIDsvLyBDb21wdXRlcyBoYWxmLXN1bSBhbmQgeG9yIG9mIHR3byBpbnB1dHMgYW5kIHB1dHMgdGhlbSBpbiB0aGUgaW5wdXQgCi0gICAgOy8vIHJlZ2lzdGVycyBpbiB0aGF0IG9yZGVyCi0gICAgOy8vCi0gICAgOy8vIFN5bnRheDoKLSAgICA7Ly8gTV9IU1VNX1hPUiAgICAgICR2MCwgJHYxLCAkdG1wCi0gICAgOy8vIAotICAgIDsvLyBJbnB1dHM6Ci0gICAgOy8vICR2MCAgICAgICAgIGEsIGZpcnN0IGlucHV0Ci0gICAgOy8vICR2MSAgICAgICAgIGIsIHNlY29uZCBpbnB1dAotICAgIDsvLyAkdG1wICAgICAgICBzY3JhdGNoIHJlZ2lzdGVyCi0gICAgOy8vIAotICAgIDsvLyBPdXRwdXRzOgotICAgIDsvLyAkdjAgICAgICAgICAoYSArIGIpLzIKLSAgICA7Ly8gJHYxICAgICAgICAgYSBeIGIKLQotICAgIE1BQ1JPCi0gICAgTV9IU1VNX1hPUiAgICAgICR2MCwgJHYxLCAkdG1wCi0gICAgICAgIFVIQURE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cgY2FzZQotT1AxIFNFVFMgIk9SUiIKLU9QMiBTRVRTICJBTkQiCi0gICAgICAgIEVORElGCi0gICAgICAgIAotICAgICAgICBMQ0xTIGxzYjIKLSAgICAgICAgTENMUyBzdW0yCi0gICAgICAgIExDTFMgZGVzdAotICAgIAotbHNiMiAgU0VUUyAidG1wIgotc3VtMiAgU0VUUyAiJGxzYjAiCi1kZXN0ICBTRVRTICIkc3VtMCIKLQotICAgICAgICAkT1AxICAgICAgICAkbHNiMCwgJGxzYjAsICRsc2IxICAgICAgICAgIDsvLyBlMCA9IGUwICYgZTEKLSAgICAgICAgRU9SICAgICAgICAgJGxzYjIsICRzdW0wLCAkc3VtMSAgICAgICAgICA7Ly8gZTIgPSBzMCBeIHMxCi0gICAgICAgICRPUDIgICAgICAgICRsc2IyLCAkbHNiMiwgJGxzYjAgICAgICAgICAgOy8vIGUyID0gZTIgfCBlMAotICAgICAgICBBTkQgICAgICAgICAkbHNiMiwgJGxzYjIsIHlNYXNrLCBMU1IgIyA0IDsvLyBlMiA9IGUyICYgbWFzawotICAgICAgICBVSEFERDggICAgICAkc3VtMiwgJHN1bTAsICRzdW0xICAgICAgICAgIDsvLyBzMiA9IChzMCArIHMxKS8yCi0gICAgICAgIFVBREQ4ICAgICAgICRkZXN0LCAkc3VtMiwgJGxzYjIgICAgICAgICAgOy8vIGRlc3QgPSAgczIgKyBlMgotICAgIE1FTkQKLTsvLyAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKLTsvLyBNb3Rpb24gY29tcGVuc2F0aW9uIGhhbmRsZXIgbWFjcm9zCi07Ly8gKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCi0gICAgOy8vIERlc2NyaXB0aW9uOgotICAgIDsvLyBJbXBsZW1lbnQgbW90aW9uIGNvbXBlbnNhdGlvbiByb3V0a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svLyBJbnB1dC9PdXRwdXQgUmVnaXN0ZXJzCi1wU3JjICAgICAgICAgICAgICAgICAgUk4gMAotc3JjU3RlcCAgICAgICAgICAgICAgIFJOIDEKLWFyZ19wU3JjUmVzaWR1ZSAgICAgICBSTiAyCi1wU3JjUmVzaWR1ZSAgICAgICAgICAgUk4gMTIKLXBEc3QgICAgICAgICAgICAgICAgICBSTiAzCi1kc3RTdGVwICAgICAgICAgICAgICAgUk4gMgotcHJlZGljdFR5cGUgICAgICAgICAgIFJOIDEwCi1ybmRWYWwgICAgICAgICAgICAgICAgUk4gMTEKLW1hc2sgICAgICAgICAgICAgICAgICBSTiAxMQotCi07Ly8gTG9jYWwgU2NyYXRjaCBSZWdpc3RlcnMKLXplcm8gICAgICAgICAgICAgICAgICBSTiAxMgoteSAgICAgICAgICAgICAgICAgICAgIFJOIDE0Ci0KLXRtcDEgICAgICAgICAgICAgICAgICBSTiA0Ci10bXAyICAgICAgICAgICAgICAgICAgUk4gNQotdG1wMyAgICAgICAgICAgICAgICAgIFJOIDYKLXRtcDQgICAgICAgICAgICAgICAgICBSTiA3Ci10bXA1ICAgICAgICAgICAgICAgICAgUk4gOAotdG1wNiAgICAgICAgICAgICAgICAgIFJOIDkKLXRtcDcgICAgICAgICAgICAgICAgICBSTiAxMAotdG1wOCAgICAgICAgICAgICAgICAgIFJOIDExCi10bXA5ICAgICAgICAgICAgICAgICAgUk4gMTIKLQotdDAwICAgICAgICAgICAgICAgICAgIFJOIDQKLXQwMSAgICAgICAgICAgICAgICAgICBSTiA1Ci10MTAgICAgICAgICAgICAgICAgICAgUk4gNgotdDExICAgICAgICAgICAgICAgICAgIFJOIDcKLXQyMCAgICAgICAgICAgICAgICAgICBSTiA4Ci10MjEgICAgICAgICAgICAgICAgICAgUk4gOQotdDMwICAgICAgICAgICAgICAgICAgIFJOIDEwCi10MzEgICAgICAgICAgICAgICAgICAgUk4gMTEKLXRtcCAgICAgICAgICAgICAgICAgICBSTiAxMgotCi15TWFzayAg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RtcDIsIExTTCAjOCAgIDsvLyB0bXAxID0gW2RjYmFdCi0gICAgU1RSICAgICAgICAgdG1wMSwgW3BEc3RdLCAjNAotICAgIAotICAgIExEUiAgICAgICAgIGRzdCwgW3BEc3RdCi0gICAgTERNSUEgICAgICAgcFNyY1Jlc2lkdWUhLCB7dG1wMSwgdG1wMn0KLSAgICBQS0hCVCAgICAgICB0bXAzLCB0bXAxLCB0bXAyLCBMU0wgIzE2Ci0gICAgUEtIVEIgICAgICAgdG1wNCwgdG1wMiwgdG1wMSwgQVNSICMxNgotICAgIFVYVEIxNiAgICAgIHRtcDEsIGRzdAotICAgIFVYVEIxNiAgICAgIHRtcDIsIGRzdCwgUk9SICM4Ci0gICAgUUFERDE2ICAgICAgdG1wMSwgdG1wMSwgdG1wMwotICAgIFFBREQxNiAgICAgIHRtcDIsIHRtcDIsIHRtcDQKLSAgICBVU0FUMTYgICAgICB0bXAxLCAjOCwgdG1wMQotICAgIFVTQVQxNiAgICAgIHRtcDIsICM4LCB0bXAyCi0gICAgT1JSICAgICAgICAgdG1wMSwgdG1wMSwgdG1wMiwgTFNMICM4Ci0gICAgU1RSICAgICAgICAgdG1wMSwgW3BEc3RdLCBkc3RTdGVwCi0gICAgCi0gICAgQkdUICAgICAgICAgWWxvb3BfcFNyY1Jlc2lkdWVOb3ROdWxsCi1wU3JjUmVzaWR1ZUNvbmRpdGlvbkVuZAotCi0gICAgTU9WICAgICAgICAgcmV0dXJuLCAjT01YX1N0c19Ob0VycgotCi0gICAgTV9FTkQKLSAgICBFTkRJRiA7Ly8gQVJNMTEzNkpTCi0KLTsvLyAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKLTsvLyBDb3J0ZXhBOCBpbXBsZW1lbnRhdGlvbgotOy8vICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgotICAgIEVORAotOy8vICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgotOy8vIG9teFZDTTRQMl9NQ1JlY29uQmxvY2sgZW5kcwotOy8vICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgpkaWZmIC0tZ2l0IGEvbWVkaWEvbGlic3RhZ2VmcmlnaHQvY29kZWNzL29uMi9oMjY0ZGVjL29teGRsL2FybTExL3ZjL200cDIvc3JjL29teFZDTTRQMl9QcmVkaWN0UmVjb25Db2VmSW50cmFfcy5zIGIvbWVkaWEvbGlic3RhZ2VmcmlnaHQvY29kZWNzL29uMi9oMjY0ZGVjL29teGRsL2FybTExL3ZjL200cDIvc3JjL29teFZDTTRQMl9QcmVkaWN0UmVjb25Db2VmSW50cmFfcy5zCmRlbGV0ZWQgZmlsZSBtb2RlIDEwMDY0NAppbmRleCAyMTM0NDRhLi4wMDAwMDAwCi0tLSBhL21lZGlhL2xpYnN0YWdlZnJpZ2h0L2NvZGVjcy9vbjIvaDI2NGRlYy9vbXhkbC9hcm0xMS92Yy9tNHAyL3NyYy9vbXhWQ000UDJfUHJlZGljdFJlY29uQ29lZkludHJhX3MucworKysgL2Rldi9udWxsCkBAIC0xLDI4MyArMCwwIEBACi07ICoqKioqKioqKioKLTsgKiAKLTsgKiBGaWxlIE5hbWU6ICBvbXhWQ000UDJfUHJlZGljdFJlY29uQ29lZkludHJhX3MucwotOyAqIE9wZW5NQVggREw6IHYxLjAuMgotOyAqIFJldmlzaW9uOiAgIDk2NDEKLTsgKiBEYXRlOiAgICAgICBUaHVyc2RheSwgRmVicnVhcnkgNywgMjAwOAotOyAqIAotOyAqIChjKSBDb3B5cmlnaHQgMjAwNy0yMDA4IEFSTSBMaW1pdGVkLiBBbGwgUmlnaHRzIFJlc2VydmVkLgotOyAqIAotOyAqIAotOyAqIA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ICAgICAgICAgICAgICBvbiBhIDQtYnl0ZSBib3VuZGFyeS4KLTsgKiBbaW5dICBwUHJlZEJ1ZkNvbCAgcG9pbnRlciB0byB0aGUgY29lZmZpY2llbnQgY29sdW1uIGJ1ZmZlcjsgbXVzdCBiZSAKLTsgKiAgICAgICAgICAgICAgICAgICAgYWxpZ25lZCBvbiBhIDQtYnl0ZSBib3VuZGFyeS4KLTsgKiBbaW5dICBjdXJRUCAgICAgICAgcXVhbnRpemF0aW9uIHBhcmFtZXRlciBvZiB0aGUgY3VycmVudCBibG9jay4gY3VyUVAgbWF5IAotOyAqICAgICAgICAgICAgICAgICAgICBlcXVhbCB0byBwcmVkUVAgZXNwZWNpYWxseSB3aGVuIHRoZSBjdXJyZW50IGJsb2NrIGFuZCAKLTsgKiAgICAgICAgICAgICAgICAgICAgdGhlIHByZWRpY3RvciBibG9jayBhcmUgaW4gdGhlIHNhbWUgbWFjcm9ibG9jay4KLTsgKiBbaW5dICBwcmVkUVAgICAgICAgcXVhbnRpemF0aW9uIHBhcmFtZXRlciBvZiB0aGUgcHJlZGljdG9yIGJsb2NrCi07ICogW2luXSAgcHJlZERpciAgICAgIGluZGljYXRlcyB0aGUgcHJlZGljdGlvbiBkaXJlY3Rpb24gd2hpY2ggdGFrZXMgb25lCi07ICogICAgICAgICAgICAgICAgICAgIG9mIHRoZSBmb2xsb3dpbmcgdmFsdWVzOgotOyAqICAgICAgICAgICAgICAgICAgICBPTVhfVklERU9fSE9SSVpPTlRBTCAgICBwcmVkaWN0IGhvcml6b250YWxseQotOyAqICAgICAgICAgICAgICAgICAgICBPTVhfVklERU9fVkVSVElDQUwgICAgICAgIHByZWRpY3QgdmVydGljYWxseQotOyAqIFtpbl0gIEFDUHJlZEZsYWcgICBhIGZsYWcgaW5kaWNhdGluZyBpZiBBQyBwcmVkaWN0aW9uIHNob3VsZCBiZQotOyAqICAgICAgICAgICAgICAgICAgICBwZXJmb3JtZWQuIEl0IGlzIGVxdWFsIHRvIGFjX3By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wU3JjRHN0LCBwUHJlZEJ1ZlJvdywgb3IgcFByZWRCdWZDb2wgaXMgbm90IAotOyAqICAgNC1ieXRlIGFsaWduZWQuCi07ICoKLTsgKioqKioqKioqCi0gICAgIAotICAgICAgICBJTkNMVURFIG9teHR5cGVzX3MuaAotICAgICAgICBJTkNMVURFIGFybUNPTU1fcy5oCi0gICAgICAgIAotICAgICAgIE1fVkFSSUFOVFMgQVJNMTEzNkpTCi0gICAgICAgCi0gICAgICAgICAgICAgCi0KLSAgICAgICBJTVBPUlQgICAgICAgIGFybVZDTTRQMl9SZWNpcHJvY2FsX1FQX1MzMgotICAgICAgIElNUE9SVCAgICAgICAgYXJtVkNNNFAyX1JlY2lwcm9jYWxfUVBfUzE2Ci0gICAgICAgSU1QT1JUICAgICAgICBhcm1WQ000UDJfRENTY2FsZXIKLSAgICAgICAKLQotCi0gICAgICAgIElGIEFSTTExMzZKUwotCi0KLTsvLyBJbnB1dCBBcmd1bWVudHMKLQotcFNyY0RzdCAgICAgICAgICBSTiAwCi1wUHJlZEJ1ZlJvdyAgICAgIFJOIDEKLXBQcmVkQnVmQ29sICAgICAgUk4gMgotY3VyUVAgICAgICAgICAgICBSTiAzCi1RUCAgICAgICAgICAgICAgIFJOIDMKLXByZWRRUCAgICAgICAgICAgUk4gNAotcHJlZERpciAgICAgICAgICBSTiA1Ci1BQ1ByZWRGbGFnICAgICAgIFJOIDYKLXZpZGVvQ29tcCAgICAgICAgUk4gNyAgCi0KLTsvLyBMb2NhbCBWYXJpYWJsZXMKLQotdGVtcDIgICAgICAgICAgICBSTiA1Ci1uZWdDdXJRUCAgICAgICAgIFJOIDcKLW5lZ2RjU2NhbGVyICAgICAgUk4gNwotdGVtcFByZWQgICAgICAgICBSTiA4Ci0KLWRjU2NhbGVyICAgICAgICAgUk4gNAotQ29lZmZUYWJsZSAgICAgICBSTiA5Ci1hYnNDb2VmZkRDICAgICAgIFJOIDkKLXRlbXAzICAgICAgICAgICAgUk4gNgotYWJzQ29lZmZBQyAgICAgICBSTiA2Ci0KLXNob3J0VmlkZW9IZWFkZXIgUk4gOQotcHJlZENvZWZmVGFibGUgICBSTiAxMAotQ291bnQgICAgICAgICAgICBSTiAxMAotdGVtcDEgICAgICAgICAgICBSTiAxMgotaW5kZXggICAgICAgICAgICBSTiAxMgotUmVtICAgICAgICAgICAgICBSTiAxNAotdGVtcCAgICAgICAgICAgICBSTiAxMQotUmV0dXJuICAgICAgICAgICBSTiAwCi0KLSAgICAgICAKLQotICAgICAgIE1fU1RBUlQgICBvbXhWQ000UDJfUHJlZGljdFJlY29uQ29lZkludHJhLHIxMgotICAgICAgIAotICAgICAgIDsvLyBBc3NpZ25pbmcgcG9pbnRlcnMgdG8gSW5wdXQgYXJndW1lbnRzIG9uIFN0YWNrCi0gICAgCi0gICAgICAgTV9BUkcgICAgICAgICAgIHByZWRRUG9uU3RhY2ssNCAgCi0gICAgICAgTV9BUkcgICAgICAgICAgIHByZWREaXJvblN0YWNrLDQKLSAgICAgICBNX0FSRyAgICAgICAgICAgQUNQcmVkRmxhZ29uU3RhY2ssNAotICAgICAgIE1fQVJHICAgICAgICAgICB2aWRlb0NvbXBvblN0YWNrLDQKLSAgICAgICAKLSAgICAgICA7Ly8gREMgUHJlZGljdGlvbgotCi0gICAgICAgTV9MRFIgICAgICAgICAgIHZpZGVvQ29tcCx2aWRlb0NvbXBvblN0YWNrICAgICAgICAgICAgICAgICAgICAgOy8vIExvYWQgdmlkZW9Db21wIEZyb20gU3RhY2sgICAgICAgICAgICAgICAKLSAgICAgICAKLSAgICAgICBNX0xEUiAgICAgICAgICAgcHJlZERpcixwcmVkRGlyb25TdGFjayAgICAgICAgICAgICAgICAgICAgICAgICA7Ly8gTG9hZCBQcmVkaWN0aW9uIGRpcmVjdGlvbgotICAgICAgIAotICAgICAgIDsvLyBkY1NjYWxlciBDYWxjdWxhdGlvbgotCi0gICAgICAgTERSICAgICAgICAgICAgIGluZGV4LCA9YXJtVkNNNFAyX0RDU2NhbGVyCi0gICAgICAgQUREICAgICAgICAgICAgIGluZGV4LGluZGV4LHZpZGVvQ29tcCxMU0wgIzUKLSAgICAgICBMRFJCICAgICAgICAgICAgZGNTY2FsZXIsW2luZGV4LFFQXQotICAgICAgICAgICAKLSAgICAKLWNhbERDVmFsCi0gICAgICAKLSAgICAgICAKLSAgICAgICBMRFIgICAgICAgICAgICAgcHJlZENvZWZmVGFibGUsID1hcm1WQ000UDJfUmVjaXByb2NhbF9RUF9TMTYgICA7Ly8gTG9hZGluZyB0aGUgdGFibGUgd2l0aCBlbnRyaWVzIDMyNzY3LygxIHRvIDYzKSAKLSAgICAgIAotICAgICAgIENNUCAgICAgICAgICAgICBwcmVkRGlyLCMyICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDsvLyBDaGVjayBpZiB0aGUgUHJlZGljdGlvbiBkaXJlY3Rpb24gaXMgdmVydGljYWwKLQotICAgICAgIDsvLyBDYXVsdWNhdGUgdGVtcCBwcmVkIGJ5IHBlcmZvcm1pbmcgRGl2aXNpb24KLSAgICAgICAgICAgIAotICAgICAgIExEUkVRU0ggICAgICAgICBhYnNDb2VmZkRDLFtwUHJlZEJ1ZlJvd10gICAgICAgICAgICAgICAgICAgICAgIDsvLyBJZiB2ZXRpY2FsIGxvYWQgdGhlIGNvZWZmIGZyb20gUm93IFByZWRpY3Rpb24gQnVmZmVyCi0gICAgICAgTERSTkVTSCAgICAgICAgIGFic0NvZWZmREMsW3BQcmVkQnVmQ29sXSAgICAgICAgICAgICAgICAgICAgICAgOy8vIElmIGhvcml6b250YWwgbG9hZCB0aGUgY29lZmYgZnJvbSBjb2x1bW4gUHJlZGljdGlvbiBCdWZmZXIKLSAgICAgICAKLSAgICAgICBSU0IgICAgICAgICAgICAgbmVnZGNTY2FsZXIsZGNTY2FsZXIsIzAgICAgICAgICAgICAgICAgICAgICAgICA7Ly8gbmVnZGNTY2FsZXI9LWRjU2NhbGVyICAKLSAgICAgICAKLSAgICAgICBNT1YgICAgICAgICAgICAgdGVtcDEsYWJzQ29lZmZEQyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA7Ly8gdGVtcDE9cHJlZGljdGlvbiBjb2VmZgotICAgICAgIENNUCAgICAgICAgICAgICB0ZW1wMSwjMAotICAgICAgIFJTQkxUICAgICAgICAgICBhYnNDb2VmZkRDLHRlbXAxLCMwICAgICAgICAgICAgICAgICAgICAgICAgICAgIDsvL2Fic0NvZWZmREM9YWJzKHRlbXAxKQotICAgICAgIAotICAgICAgIEFERCAgICAgICAgICAgICB0ZW1wLGRjU2NhbGVyLGRjU2NhbGVyCi0gICAgICAgTERSSCAgICAgICAgICAgIHRlbXAsW3ByZWRDb2VmZlRhYmxlLHRlbXBdICAgICAgICAgICAgICAgICAgICAgOy8vIExvYWQgdmFsdWUgZnJvbSBjb2VmZiB0YWJsZSBmb3IgcGVyZm9ybWluZyBkaXZpc2lvbiB1c2luZyBtdWx0aXBsaWNhdGlvbgotICAgICAgIAotICAgICAgIFNNVUxCQiAgICAgICAgICB0ZW1wUHJlZCx0ZW1wLGFic0NvZWZmREMgICAgICAgICAgICAgICAgICAgICAgIDsvLyB0ZW1wUHJlZD1wUHJlZEJ1ZlJvdyhDb2wpWzBdKjMyNzY3L2RjU2NhbGVyCi0gICAgICAgQUREICAgICAgICAgICAgIHRlbXAzLGRjU2NhbGVyLCMxCi0gICAgICAgTFNSICAgICAgICAgICAgIHRlbXBQcmVkLHRlbXBQcmVkLCMxNSAgICAgICAgICAgICAgICAgICAgICAgICAgOy8vIHRlbXBQcmVkPXBQcmVkQnVmUm93KENvbClbMF0vZGNTY2FsZXIgICAgICAgICAgCi0gICAgICAgTFNSICAgICAgICAgICAgIHRlbXAzLHRlbXAzLCMxICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOy8vIHRlbXAzPXJvdW5kKGRjU2NhbGVyLzIpCi0gICAgICAgCi0gICAgICAgTUxBICAgICAgICAgICAgIFJlbSxuZWdkY1NjYWxlcix0ZW1wUHJlZCxhYnNDb2VmZkRDICAgICAgICAgICAgOy8vIFJlbSA9IHBQcmVkQnVmUm93KENvbClbMF0tdGVtcFByZWQqZGNTY2FsZXIgICAgICAKLSAgICAgICAKLSAgICAgICAKLSAgICAgICBMRFJIICAgICAgICAgICAgdGVtcCxbcFByZWRCdWZDb2xdCi0gICAgICAgQ01QICAgICAgICAgICAgIFJlbSx0ZW1wMyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCi0gICAgICAgQURER0UgICAgICAgICAgIHRlbXBQcmVkLCMxICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOy8vIElmIFJlbT49cm91bmQoZGNTY2FsZXIvMik7dGVtcFByZWQ9dGVtcFByZWQrMQotICAgICAgIENNUCAgICAgICAgICAgICB0ZW1wMSwjMAotICAgICAgIFJTQkxUICAgICAgICAgICB0ZW1wUHJlZCx0ZW1wUHJlZCwjMCAgICAgICAgICAgICAgICAgICAgICAgICAgICA7LyBpZiBwUHJlZEJ1ZlJvdyhDb2wpWzBdPDA7IHRlbXBQcmVkPS10ZW1wUHJlZAotICAgICAgICAgICAgIAotICAgICAgIAotICAgICAgIFNUUkggICAgICAgICAgICB0ZW1wLFtwUHJlZEJ1ZlJvdywjLTE2XSAgICAgIAotCi0gICAgICAgTERSSCAgICAgICAgICAgIHRlbXAsW3BTcmNEc3RdICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOy8vIHRlbXA9cFNyY0RzdFswXQotICAgICAgIE1fTERSICAgICAgICAgICBBQ1ByZWRGbGFnLEFDUHJlZEZsYWdvblN0YWNrCi0gICAgICAgQUREICAgICAgICAgICAgIHRlbXAsdGVtcCx0ZW1wUHJlZCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOy8vIHRlbXA9cFNyY0RzdFswXSt0ZW1wUHJlZAotICAgICAgIFNTQVQxNiAgICAgICAgICB0ZW1wLCMxMix0ZW1wICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDsvLyBjbGlwIHRlbXAgdG8gWy0yMDQ4LDIwNDddCi0gICAgICAgCi0gICAgICAgU01VTEJCICAgICAgICAgIHRlbXAxLHRlbXAsZGNTY2FsZXIgICAgICAgICAgICAgICAgICAgICAgICAgICAgOy8vIHRlbXAxPWNsaXBwZWQocFNyY0RzdFswXSkqZGNTY2FsZXIgICAgICAgICAgIAotICAgICAgIE1fTERSICAgICAgICAgICBwcmVkUVAscHJlZFFQb25TdGFjawotICAgICAgIFNUUkggICAgICAgICAgICB0ZW1wLFtwU3JjRHN0XSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAotICAgICAgIENNUCAgICAgICAgICAgICBBQ1ByZWRGbGFnLCMxICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDsvLyBDaGVjayBpZiB0aGUgQUMgcHJlZGljdGlvbiBmbGFnIGlzIHNldCBvciBub3QKLSAgICAgICBTVFJIICAgICAgICAgICAgdGVtcDEsW3BQcmVkQnVmQ29sXSAgICAgICAgICAgICAgICAgICAgICAgICAgICA7Ly8gc3RvcmUgdGVtcDEgdG8gcFByZWRCdWZDb2wKLSAKLSAgICAgICA7Ly8gQUMgUHJlZGljdGlvbgotCi0gICAgICAgICAgICAgIAotICAgICAgIEJORSAgICAgICAgICAgICBFeGl0ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDsvLyBJZiBub3Qgc2V0IEV4aXQKLSAgICAgICAKLSAgICAgICBMRFIgICAgICAgICAgICAgcHJlZENvZWZmVGFibGUsID1hcm1WQ000UDJfUmVjaXByb2NhbF9RUF9TMzIgICA7Ly8gTG9hZGluZyB0aGUgdGFibGUgd2l0aCBlbnRyaWVzIDB4MWZmZmYvKDEgdG8gNjMpCi0gICAgICAgTU9WICAgICAgICAgICAgIHRlbXAxLCM0Ci0gICAgICAgTVVMICAgICAgICAgICAgIHRlbXAxLGN1clFQLHRlbXAxCi0gICAgICAgQ01QICAgICAgICAgICAgIHByZWREaXIsIzIgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOy8vIENoZWNrIHRoZSBQcmVkaWN0aW9uIGRpcmVjdGlvbgotICAgICAgIFJTQiAgICAgICAgICAgICBuZWdDdXJRUCxjdXJRUCwjMCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKLSAgICAgICBMRFIgICAgICAgICAgICAgQ29lZmZUYWJsZSxbcHJlZENvZWZmVGFibGUsdGVtcDFdICAgICAgICAgICAgICA7Ly8gQ29lZmZUYWJsZT0weDFmZmZmL2N1clFQCi0gICAgICAgQUREICAgICAgICAgICAgIGN1clFQLGN1clFQLCMxICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOy8vIGN1clFQPWN1clFQKzEKLSAgICAgICBMU1IgICAgICAgICAgICAgY3VyUVAsY3VyUVAsIzEgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA7Ly8gY3VyUVA9cm91bmQoY3VyUVAvMikgICAgICAgICAgICAgICAgCi0gICAgICAgTU9WICAgICAgICAgICAgIENvdW50LCMyICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOy8vIEluaXRpYWxpemluZyB0aGUgTG9vcCBDb3VudAotICAgICAgIEJORSAgICAgICAgICAgICBIb3Jpem9udGFsICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDsvLyBJZiB0aGUgUHJlZGljdGlvbiBkaXJlY3Rpb24gaXMgaG9yaXpvbnRhbCBicmFuY2ggdG8gSG9yaXpvbnRhbAotCi0gICAgICAgCi0KLWxvb3AxICAgICAgIAotICAgICAgIDsvLyBDYWxjdWxhdGUgdGVtcFByZWQKLSAgICAgICAKLSAgICAgICBMRFJTSCAgICAgICAgICAgYWJzQ29lZmZBQyxbcFByZWRCdWZSb3csQ291bnRdICAgICAgICAgICAgICAgICA7Ly8gYWJzQ29lZmZBQz1wUHJlZEJ1ZlJvd1tpXSwgMT08aTw9NwotICAgICAgIE1PViAgICAgICAgICAgICB0ZW1wMSxhYnNDb2VmZkFDCi0gICAgICAgQ01QICAgICAgICAgICAgIHRlbXAxLCMwICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOy8vIGNvbXBhcmUgcFByZWRCdWZSb3dbaV0gd2l0aCB6ZXJvLCAxPTxpPD03Ci0gICAgICAgUlNCTFQgICAgICAgICAgIGFic0NvZWZmQUMsdGVtcDEsIzAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOy8vIGFic0NvZWZmQUM9IGFicyhwUHJlZEJ1ZlJvd1tpXSkKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCi0gICAgICAgU01VTEJCICAgICAgICAgIGFic0NvZWZmQUMsYWJzQ29lZmZBQyxwcmVkUVAgICAgICAgICAgICAgICAgICAgOy8vIHRlbXAxPXBQcmVkQnVmUm93W2ldKnByZWRRUAotICAgICAgIE1VTCAgICAgICAgICAgICB0ZW1wUHJlZCxhYnNDb2VmZkFDLENvZWZmVGFibGUgICAgICAgICAgICAgICAgIDsvLyB0ZW1wUHJlZD1wUHJlZEJ1ZlJvd1tpXSpwcmVkUVAqMHgxZmZmZi9jdXJRUAotICAgICAgIExTUiAgICAgICAgICAgICB0ZW1wUHJlZCx0ZW1wUHJlZCwjMTcgICAgICAgICAgCi0gICAgICAgICAgICAgCi0gICAgICAgTUxBICAgICAgICAgICAgIFJlbSxuZWdDdXJRUCx0ZW1wUHJlZCxhYnNDb2VmZkFDICAgICAgICAgICAgICAgOy8vIFJlbT1hYnMocFByZWRCdWZSb3dbaV0pLXRlbXBQcmVkKmN1clFQCi0gICAgICAgTERSSCAgICAgICAgICAgIHRlbXAsW3BTcmNEc3QsQ291bnRdICAgICAgICAgICAgICAgICAgICAgICAgICAgOy8vIHRlbXA9cFNyY0RzdFtpXSwxPD1pPDgKLSAgICAgICAKLSAgICAgICBDTVAgICAgICAgICAgICAgUmVtLGN1clFQCi0gICAgICAgQURER0UgICAgICAgICAgIHRlbXBQcmVkLCMxICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOy8vIGlmIFJlbT49cm91bmQoY3VyUVAvMik7IHRlbXBQcmVkPXRlbXBQcmVkKzEKLSAgICAgICBDTVAgICAgICAgICAgICAgdGVtcDEsIzAKLSAgICAgICBSU0JMVCAgICAgICAgICAgdGVtcFByZWQsdGVtcFByZWQsIzAgICAgICAgICAgICAgICAgICAgICAgICAgICA7Ly8gaWYgcFByZWRCdWZSb3dbaV08MCA7IHRlbXBQcmVkPS10ZW1wUHJlZAotICAgICAgICAgICAgICAKLSAgICAgICA7Ly8gVXBkYXRlIHNvdXJjZSBhbmQgUm93IFByZWRpY3Rpb24gYnVmZmVycwotICAgICAgIAotICAgICAgIEFERCAgICAgICAgICAgICB0ZW1wLHRlbXAsdGVtcFByZWQgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDsvLyB0ZW1wPXRlbXBQcmVkK3BTcmNEc3RbaV0KLSAgICAgICBTU0FUMTYgICAgICAgICAgdGVtcCwjMTIsdGVtcCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA7Ly8gQ2xpcCB0ZW1wIHRvIFstMjA0OCwyMDQ3XQotICAgICAgIFNUUkggICAgICAgICAgICB0ZW1wLFtwU3JjRHN0LENvdW50XQotICAgICAgIFNUUkggICAgICAgICAgICB0ZW1wLFtwUHJlZEJ1ZlJvdyxDb3VudF0gICAgICAgICAgICAgICAgICAgICAgIDsvLyBwUHJlZEJ1ZlJvd1tpXT10ZW1wCi0gICAgICAgQUREICAgICAgICAgICAgIENvdW50LENvdW50LCMyICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOy8vIGk9aSsxCi0gICAgICAgQ01QICAgICAgICAgICAgIENvdW50LCMxNiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOy8vIGNvbXBhcmUgaWYgaT04Ci0gICAgICAgQkxUICAgICAgICAgICAgIGxvb3AxCi0gICAgICAgQiAgICAgICAgICAgICAgIEV4aXQgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOy8vIEJyYW5jaCB0byBleGl0Ci0KLUhvcml6b250YWwKLQotICAgICAgIE1PViAgICAgICAgICAgICBDb3VudCwjMTYgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDsvLyBJbml0aWFsaXppbmcgaT04Ci0KLWxvb3AyICAKLSAgICAgCi0gICAgICAgTFNSICAgICAgICAgICAgIHRlbXAyLENvdW50LCMzICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOy8vIHRlbXAyPWk+PjMKLSAgICAgICAKLSAgICAgICA7Ly8gQ2FsY3VsYXRlIHRlbXBQcmVkCi0gICAgICAgCi0gICAgICAgTERSSCAgICAgICAgICAgIGFic0NvZWZmQUMsW3BQcmVkQnVmQ29sLHRlbXAyXSAgICAgICAgICAgICAgICAgOy8vIGFic0NvZWZBQz1wUHJlZEJ1ZkNvbFtpPj4zXSAgICAgICAgICAgICAgICAgICAgICAgCi0gICAgICAgTU9WICAgICAgICAgICAgIHRlbXAxLGFic0NvZWZmQUMKLSAgICAgICBDTVAgICAgICAgICAgICAgdGVtcDEsIzAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA7Ly8gY29tcGFyZSBwUHJlZEJ1ZlJvd1tpXSB3aXRoIHplcm8sIDE9PGk8PTcKLSAgICAgICBSU0JMVCAgICAgICAgICAgYWJzQ29lZmZBQyx0ZW1wMSwjMCAgICAgICAgICAgICAgICAgICAgICAgICAgICA7Ly8gYWJzQ29lZmZBQz1hYnMocFByZWRCdWZDb2xbaT4+M10pCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAotICAgICAgIFNNVUxCQiAgICAgICAgICBhYnNDb2VmZkFDLGFic0NvZWZmQUMscHJlZFFQICAgICAgICAgICAgICAgICAgIDsvLyB0ZW1wMT1wUHJlZEJ1ZkNvbFtpPj4zXSpwcmVkUVAKLSAgICAgICBNVUwgICAgICAgICAgICAgdGVtcFByZWQsYWJzQ29lZmZBQyxDb2VmZlRhYmxlICAgICAgICAgICAgICAgICA7Ly8gdGVtcFByZWQ9cFByZWRCdWZDb2xbaT4+M10qcHJlZFFQKjB4MWZmZmYvY3VyUVAKLSAgICAgICBMU1IgICAgICAgICAgICAgdGVtcFByZWQsdGVtcFByZWQsIzE3ICAgICAgICAgICAgICAgICAgICAgICAgICA7Ly8gdGVtcFByZWQ9cFByZWRCdWZDb2xbaT4+M10qcHJlZFFQL2N1clFQCi0gICAgICAgCi0gICAgICAgTUxBICAgICAgICAgICAgIFJlbSxuZWdDdXJRUCx0ZW1wUHJlZCxhYnNDb2VmZkFDCi0gICAgICAgTERSSCAgICAgICAgICAgIHRlbXAsW3BTcmNEc3QsQ291bnRdICAgICAgICAgICAgICAgICAgICAgICAgICAgOy8vIHRlbXA9cFNyY0RzdFtpXQotICAgICAgIAotICAgICAgIENNUCAgICAgICAgICAgICBSZW0sY3VyUVAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDsvLyBDb21wYXJlIFJlbSB3aXRoIHJvdW5kKGN1clFQLzIpCi0gICAgICAgQURER0UgICAgICAgICAgIHRlbXBQcmVkLCMxICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOy8vIHRlbXBQcmVkPXRlbXBQcmVkKzEgaWYgUmVtPj1yb3VuZChjdXJRUC8yKQotICAgICAgIENNUCAgICAgICAgICAgICB0ZW1wMSwjMAotICAgICAgIFJTQkxUICAgICAgICAgICB0ZW1wUHJlZCx0ZW1wUHJlZCwjMCAgICAgICAgICAgICAgICAgICAgICAgICAgIDsvLyBpZiBwUHJlZEJ1ZkNvbFtpPj4zIDwwIHRlbXBQcmVkPS10ZW1wUHJlZAotICAgICAgIAotICAgICAgIDsvLyBVcGRhdGUgc291cmNlIGFuZCBSb3cgUHJlZGljdGlvbiBidWZmZXJzCi0gICAgICAgCi0gICAgICAgQUREICAgICAgICAgICAgIHRlbXAsdGVtcCx0ZW1wUHJlZCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOy8vIHRlbXA9cFNyY0RzdFtpXSt0ZW1wUHJlZAotICAgICAgIFNTQVQxNiAgICAgICAgICB0ZW1wLCMxMix0ZW1wICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDsvLyBDbGlwIHRlbXAgdG8gWy0yMDQ4LDIwNDddCi0gICAgICAgU1RSSCAgICAgICAgICAgIHRlbXAsW3BTcmNEc3QsQ291bnRdICAgICAgICAgICAgICAgICAgICAgICAgICAgOy8vIHBTcmNEc3RbMF09IGNsaXBwZWQgdmFsdWUKLSAgICAgICBTVFJIICAgICAgICAgICAgdGVtcCxbcFByZWRCdWZDb2wsdGVtcDJdICAgICAgICAgICAgICAgICAgICAgICA7Ly8gcFByZWRCdWZDb2xbaT4+M109dGVtcAotICAgICAgIEFERCAgICAgICAgICAgICBDb3VudCxDb3VudCwjMTYgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDsvLyBpPWkrOAotICAgICAgIENNUCAgICAgICAgICAgICBDb3VudCwjMTI4ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDsvLyBjb21wYXJlIGkgd2l0aCA2NAotICAgICAgIEJMVCAgICAgICAgICAgICBsb29wMgotCi0gICAgICAgICAgICAgCi1FeGl0Ci0gIAotICAgICAgIE1PViAgICAgICAgICAgICBSZXR1cm4sI09NWF9TdHNfTm9FcnIgCi0KLSAgICAgICBNX0VORAotICAgICAgIEVORElGCi0gICAgICAgRU5ECi0KLQotICAgCmRpZmYgLS1naXQgYS9tZWRpYS9saWJzdGFnZWZyaWdodC9jb2RlY3Mvb24yL2gyNjRkZWMvb214ZGwvYXJtMTEvdmMvbTRwMi9zcmMvb214VkNNNFAyX1F1YW50SW52SW50ZXJfSV9zLnMgYi9tZWRpYS9saWJzdGFnZWZyaWdodC9jb2RlY3Mvb24yL2gyNjRkZWMvb214ZGwvYXJtMTEvdmMvbTRwMi9zcmMvb214VkNNNFAyX1F1YW50SW52SW50ZXJ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GRlcXVhbnRpemVkKSBpbnRyYS9pbnRlciBibG9jay4gIE11c3QgYmUgMTYtYnl0ZSBhbGlnbmVkLgotOyAqCi07ICogUmV0dXJuIFZhbHVlOgotOyAqIE9NWF9TdHNfTm9FcnIgLSBubyBlcnJvcgotOyAqIE9NWF9TdHNfQmFkQXJnRXJyIC0gYmFkIGFyZ3VtZW50cwotOyAqICAgIC0gSWYgcFNyY0RzdCBpcyBOVUxMIG9yIGlzIG5vdCAxNi1ieXRlIGFsaWduZWQuCi07ICogICAgICBvcgotOyAqICAgIC0gSWYgUVAgPD0gMC4KLTsgKiAgICAgIG9yCi07ICogICAgLSB2aWRlb0NvbXAgaXMgbm9uZSBvZiBPTVhfVkNfTFVNSU5BTkNFLCBPTVhfVkNfQ0hST01JTkFOQ0UgYW5kIE9NWF9WQ19BTFBIQS4KLTsgKgotOyAqLwotCi0gICBJTkNMVURFIG9teHR5cGVzX3MuaAotICAgSU5DTFVERSBhcm1DT01NX3MuaAotCi0gICBNX1ZBUklBTlRTIEFSTTExMzZKUwotCi0gICAgICAgICAKLQotICAgICBJRiBBUk0xMTM2SlMKLQotOy8vSW5wdXQgQXJndW1lbnRzCi1wU3JjRHN0ICAgICAgICAgICAgUk4gMAotUVAgICAgICAgICAgICAgICAgIFJOIDEKLQotOy8vTG9jYWwgVmFyaWFibGVzCi1SZXR1cm4gICAgICAgICAgICAgUk4gMAotQ291bnQgICAgICAgICAgICAgIFJOIDQgICAgICAKLXRlbXBWYWwyMSAgICAgICAgICBSTiAyCi10ZW1wVmFsNDMgICAgICAgICAgUk4gMwotUVAxICAgICAgICAgICAgICAgIFJOIDUKLVgyICAgICAgICAgICAgICAgICBSTiA2Ci1YMyAgICAgICAgICAgICAgICAgUk4gMTQKLVJlc3VsdDEgICAgICAgICAgICBSTiA4Ci1SZXN1bHQyICAgICAgICAgICAgUk4gOQotdHdvICAgICAgICAgICAgICAgIFJOIDcKLQotICAgIE1fU1RBUlQgb214VkNNNFAyX1F1YW50SW52SW50ZXJfSSxyOQotICAgICAgIAotICAgICAgICBNT1YgICAgICBDb3VudCwjNjQKLSAgICAgICAgVFNUICAgICAgUVAsIzEKLSAgICAgICAgTERSRCAgICAgdGVtcFZhbDIxLFtwU3JjRHN0XSAgICAgIDsvLyBMb2FkcyBmaXJzdCB0d28gdmFsdWVzIG9mIHBTcmNEc3QgdG8gdGVtcFZhbDIxLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOy8vIG5leHQgdHdvIHZhbHVlcyB0byB0ZW1wVmFsNDMKLSAgICAgICAgU1VCRVEgICAgUVAxLFFQLCMxICAgICAgICAgICAgICAgIDsvLyBRUDE9UVAgaWYgUVAgaXMgb2RkICwgUVAxPVFQLTEgaWYgUVAgaXMgZXZlbgotICAgICAgICBNT1ZORSAgICBRUDEsUVAKLSAgICAgICAgTU9WICAgICAgdHdvLCMyCi0gICAgICAgIAotICAgICAgICAKLQotTG9vcAotICAgICAgICAKLSAgICAgICAgCi0gICAgICAgIFNNVUxCQiAgIFgyLHRlbXBWYWwyMSx0d28gICAgICAgICA7Ly8gWDI9IGZpcnN0IHZhbChsb3dlciAxNiBiaXRzIG9mIHRhbXBWYWwyMSkqMgotICAgICAgICBDTVAgICAgICBYMiwjMAotICAgICAgICAKLSAgICAgICAgUlNCTFQgICAgWDIsWDIsIzAgICAgICAgICAgICAgICAgIDsvLyBYMj1hYnNvbHV0ZXZhbChmaXJzdCB2YWwpCi0gICAgICAgIFNNTEFCQk5FIFgyLFFQLFgyLFFQMSAgICAgICAgICAgICA7Ly8gWDI9MiphYnN2YWwoZmlyc3QgdmFsKSpRUCtRUCBpZiBRUCBpcyBvZGQgCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA7Ly8gWDI9MiphYnN2YWwoZmlyc3QgdmFsKSpRUCtRUC0xIGlmIFFQIGlzIGV2ZW4gCi0gICAgICAgIFNNVUxUQiAgIFgzLHRlbXBWYWwyMSx0d28gICAgICAgICA7Ly8gWDM9IHNlY29uZCB2YWwodG9wIDE2IGJpdHMgb2YgdGFtcFZhbDIxKSoyCi0gICAgICAgIFJTQkxUICAgIFgyLFgyLCMwCi0gICAgICAgIAotICAgICAgICBDTVAgICAgICBYMywjMAotICAgICAgICAgICAgICAgCi0gICAgICAgIFJTQkxUICAgIFgzLFgzLCMwCi0gICAgICAgIFNNTEFCQk5FIFgzLFFQLFgzLFFQMQotICAgICAgICAKLSAgICAgICAgUlNCTFQgICAgWDMsWDMsIzAKLSAgICAgICAgUEtIQlQgICAgUmVzdWx0MSxYMixYMyxMU0wgIzE2ICAgIDsvLyBSZXN1bHQxWzAtMTVdPVgyWzAtMTVdLFJlc3VsdDFbMTYtMzFdPVgzWzE2LTMxXQotICAgICAgICBTTVVMQkIgICBYMix0ZW1wVmFsNDMsdHdvICAgICAgICAgOy8vIFgyPSBmaXJzdCB2YWwobG93ZXIgMTYgYml0cyBvZiB0YW1wVmFsNDMpKjIKLSAgICAgICAgU1NBVDE2ICAgUmVzdWx0MSwjMTIsUmVzdWx0MSAgICAgIDsvLyBjbGlwIHRvIHJhbmdlIFstMjA0OCwyMDQ3XQotICAgICAgICBDTVAgICAgICBYMiwjMAotICAgICAgIAotICAgICAgICAKLSAgICAgICAgICAgICAgIAotICAgICAgICBSU0JMRSAgICBYMixYMiwjMAotICAgICAgICBTTUxBQkJORSBYMixRUCxYMixRUDEKLSAgICAgICAgU01VTFRCICAgWDMsdGVtcFZhbDQzLHR3byAgICAgICAgIDsvLyBYMj0gZmlyc3QgdmFsKHRvcCAxNiBiaXRzIG9mIHRhbXBWYWwyMSkqMgotICAgICAgICBSU0JMVCAgICBYMixYMiwjMAotICAgICAgICBDTVAgICAgICBYMywjMAotICAgICAgICAKLSAgICAgICAgTERSRCAgICAgdGVtcFZhbDIxLFtwU3JjRHN0LCM4XSAgIDsvLyBMb2FkIG5leHQgZm91ciBWYWx1ZXMgdG8gdGVtcFZhbDIxLHRlbXBWYWw0MwotICAgICAgICAgIC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gICAgICAgICAgUk4gNAotdGVtcFZhbDQzICAgICAgICAgIFJOIDUKLVFQMSAgICAgICAgICAgICAgICBSTiA2Ci1YMiAgICAgICAgICAgICAgICAgUk4gNwotWDMgICAgICAgICAgICAgICAgIFJOIDE0Ci1SZXN1bHQxICAgICAgICAgICAgUk4gOAotUmVzdWx0MiAgICAgICAgICAgIFJOIDkKLXR3byAgICAgICAgICAgICAgICBSTiAxMAotQ291bnQgICAgICAgICAgICAgIFJOIDExCi0KLQotCi0gICAKLSAgICBNX1NUQVJUIG9teFZDTTRQMl9RdWFudEludkludHJhX0kscjExCi0KLQotICAgICAgICAKLSAgICAgICAgOy8vIFBlcmZvcm0gSW52ZXJzZSBRdWFudGl6YXRpb24gZm9yIERDIGNvZWZmaWNpZW50Ci0KLSAgICAgICAgVEVRICAgICAgIHNob3J0VmlkZW9IZWFkZXIsIzAgICAgICA7Ly8gVGVzdCBpZiBzaG9ydCBWaWRlbyBIZWFkZXIgZmxhZyA9MCAgICAgICAgICAgICAKLSAgICAgICAgTU9WTkUgICAgIGRjU2NhbGVyLCM4ICAgICAgICAgICAgICA7Ly8gaWYgc2hvcnRWaWRlb0hlYWRlciBpcyBub24gemVybyBkY1NjYWxlcj04Ci0gICAgICAgIEJORSAgICAgICBjYWxEQ1ZhbAotICAgICAgICBMRFIgICAgICAgaW5kZXgsID1hcm1WQ000UDJfRENTY2FsZXIKLSAgICAgIEFERCAgICAgICBpbmRleCxpbmRleCx2aWRlb0NvbXAsTFNMICM1Ci0gICAgICBMRFJCICAgICAgZGNTY2FsZXIsW2luZGV4LFFQXQotCi0KLSAgICAgICAgOy8vTV9DYWxEQ1NjYWxhciAgc2hvcnRWaWRlb0hlYWRlcix2aWRlb0NvbXAsIFFQCi0KLWNhbERDVmFsCi0KLSAgICAgICAgTERSSCAgICAgdGVtcCxbcFNyY0RzdF0KLSAgICAgICAgU01VTEJCICAgdGVtcCx0ZW1wLGRjU2NhbGVyICAgICAgIDsvLyBkY0NvZWZmID0gZGNTY2FsZXIgKiBRdWFudGl6ZWQgREMgY29lZmZpY2llbnQoZnJvbSBtZW1vcnkpCi0gICAgICAgIFNTQVQgICAgIHRlbXAsIzEyLHRlbXAgICAgICAgICAgICA7Ly8gU2F0dXJhdGluZyB0byAxMiBiaXRzCi0gICAgICAgIAotCi0gICAgICAgIE1PViAgICAgIENvdW50LCM2NAotICAgICAgICBUU1QgICAgICBRUCwjMQotICAgICAgICBMRFJEICAgICB0ZW1wVmFsMjEsW3BTcmNEc3RdICAgICAgOy8vIExvYWRzIGZpcnN0IHR3byB2YWx1ZXMgb2YgcFNyY0RzdCB0byB0ZW1wVmFsMjEsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA7Ly8gbmV4dCB0d28gdmFsdWVzIHRvIHRlbXBWYWw0MwotICAgICAgICBTVUJFUSAgICBRUDEsUVAsIzEgICAgICAgICAgICAgICAgOy8vIFFQMT1RUCBpZiBRUCBpcyBvZGQgLCBRUDE9UVAtMSBpZiBRUCBpcyBldmVuCi0gICAgICAgIE1PVk5FICAgIFFQMSxRUAotICAgICAgICBNT1YgICAgICB0d28sIzIKLQotCi0gICAgICAgICAgICAgICAgCi0gICAgICAgIAotCi1Mb29wCi0gICAgICAgIAotICAgICAgICAKLSAgICAgICAgU01VTEJCICAgWDIsdGVtcFZhbDIxLHR3byAgICAgICAgIDsvLyBYMj0gZmlyc3QgdmFsKGxvd2VyIDE2IGJpdHMgb2YgdGFtcFZhbDIxKSoyCi0gICAgICAgIENNUCAgICAgIFgyLCMwCi0gICAgICAgIAotICAgICAgICBSU0JMVCAgICBYMixYMiwjMCAgICAgICAgICAgICAgICAgOy8vIFgyPWFic29sdXRldmFsKGZpcnN0IHZhbCkKLSAgICAgICAgU01MQUJCTkUgWDIsUVAsWDIsUVAxICAgICAgICAgICAgIDsvLyBYMj0yKmFic3ZhbChmaXJzdCB2YWwpKlFQK1FQIGlmIFFQIGlzIG9kZCAKLSAgICAgICAgICAgICAgICAg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ZAotICoKLSAqIFJldHVybjoKLSAqIFtvdXRdICAgICAgICAgICAgIFJlc3VsdCBvZiBvcGVyYXRpb24KLSAqIAotICogICAgCi0gKiovCi0KLU9NWF9TMzIgYXJtU2F0QWRkX1MzMigKLSAgICAgICAgICAgICAgICBPTVhfUzMyIFZhbHVlMSwKLSAgICAgICAgICAgICAgICBPTVhfUzMyIFZhbHVlMgotICAgICAgICAgICAgICAgICk7Ci0KLS8qKgotICogRnVuY3Rpb24gOmFybVNhdEFkZF9TNjQoKQotICoKLSAqIERlc2NyaXB0aW9uIDoKLSAqICAgUmV0dXJucyB0aGUgcmVzdWx0IG9mIHNhdHVyYXRlZCBhZGRpdGlvbiBvZiB0aGUgdHdvIGlucHV0cyBWYWx1ZTEsIFZhbHVlMgotICoKLSAqIFBhcmFtZXRyczoKLSAqIFtpbl0gVmFsdWUxICAgICAgIEZpcnN0IE9wZXJhbmQKLSAqIFtpbl0gVmFsdWUyICAgICAgIFNlY29uZCBPcGVyYW5kCi0gKgotICogUmV0dXJuOgotICogW291dF0gICAgICAgICAgICAgUmVzdWx0IG9mIG9wZXJhdGlvbgotICogCi0gKiAgICAKLSAqKi8KLQotT01YX1M2NCBhcm1TYXRBZGRfUzY0KAotICAgICAgICAgICAgICAgIE9NWF9TNjQgVmFsdWUxLAotICAgICAgICAgICAgICAgIE9NWF9TNjQgVmFsdWUyCi0gICAgICAgICAgICAgICAgKTsKLQotLyoqIEZ1bmN0aW9uIDphcm1TYXRTdWJfUzMyKCkKLSAqIAotICogRGVzY3JpcHRpb24gOgotICogICAgIFJldHVybnMgdGhlIHJlc3VsdCBvZiBzYXR1cmF0ZWQgc3Vic3RyYWN0aW9uIG9mIHRoZSB0d28gaW5wdXRzIFZhbHVlMSwgVmFsdWUyCi0gKgotICogUGFyYW1ldHJzOgotICogW2luXSBWYWx1ZTEgICAgICAgRmlyc3QgT3BlcmFuZAotICogW2luXSBWYWx1ZTIgICAgICAgU2Vjb25kIE9wZXJhbmQKLSAqCi0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ZiBzYXR1cmF0aW5nIGxlZnQtc2hpZnQgb3BlcmF0aW9uIG9uIGlucHV0Ci0gKiAgICAgT3Igcm91bmRlZCBSaWdodCBzaGlmdCBpZiB0aGUgaW5wdXQgU2hpZnQgaXMgbmVnYXRpdmUuCi0gKgotICogUGFyYW1ldHJzOgotICogW2luXSBWYWx1ZSAgICAgICAgT3BlcmFuZAotICogW2luXSBzaGlmdCAgICAgICAgT3BlcmFuZCBmb3Igc2hpZnQgb3BlcmF0aW9uCi0gKgotICogUmV0dXJuOgotICogW291dF0gICAgICAgICAgICAgUmVzdWx0IG9mIG9wZXJhdGlvbgotICogICAgCi0gKiovCi0gCi1PTVhfUzY0IGFybVNhdFJvdW5kTGVmdFNoaWZ0X1M2NCgKLSAgICAgICAgICAgICAgICAgICAgICAgIE9NWF9TNjQgVmFsdWUsCi0gICAgICAgICAgICAgICAgICAgICAgICBPTVhfSU5UIHNoaWZ0Ci0gICAgICAgICAgICAgICAgICAgICAgICApOwotCi0vKioKLSAqIEZ1bmN0aW9uIDphcm1TYXRNdWxTMTZTMzJfUzMyKCkKLSAqCi0gKiBEZXNjcmlwdGlvbiA6Ci0gKiAgICAgUmV0dXJucyB0aGUgcmVzdWx0IG9mIGEgUzE2IGRhdGEgdHlwZSBtdWx0aXBsaWVkIHdpdGggYW4gUzMyIGRhdGEgdHlwZQotICogICAgIGluIGEgUzMyIGNvbnRhaW5lcgotICoKLSAqIFBhcmFtZXRyczoKLSAqIFtpbl0gaW5wdXQxICAgICAgIE9wZXJhbmQgMQotICogW2luXSBpbnB1dDIgICAgICAgT3BlcmFuZCAyCi0gKgotICogUmV0dXJuOgotICogW291dF0gICAgICAgICAgICAgUmVzdWx0IG9mIG9wZXJhdGlvbgotICogICAgCi0gKiovCi0KLQotT01YX1MzMiBhcm1TYXRNdWxTMTZTMzJfUzMyKAotICAgICAgICAgICAgICAgICAgICBPTVhfUzE2IGlucHV0MSwKLSAgICAgICAgICAgICAgICAgICAgT01YX1MzMiBpbnB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AqCi0gKiBSZXR1cm46Ci0gKiBbb3V0XSAgICAgICAgICAgICBSZXN1bHQgb2Ygb3BlcmF0aW9uIGlucHV0MS8vaW5wdXQyCi0gKiAgICAKLSAqKi8KLQotT01YX1MzMiBhcm1JbnREaXZBd2F5RnJvbVplcm8gKE9NWF9TMzIgTnVtLCBPTVhfUzMyIERlbm8pOwotCi0KLS8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLS8qCi0gKiBEZWJ1Z2dpbmcgbWFjcm9zCi0gKgotICovCi0KLQotLyoKLSAqIERlZmluaXRpb24gb2Ygb3V0cHV0IHN0cmVhbSAtIGNoYW5nZSB0byBzdGRlcnIgaWYgbmVjZXNzYXJ5Ci0gKi8KLSNkZWZpbmUgREVCVUdfU1RSRUFNIHN0ZG91dAotCi0vKgotICogRGVidWcgcHJpbnRmIG1hY3Jvcywgb25lIGZvciBlYWNoIGFyZ3VtZW50IGNvdW50LgotICogQWRkIG1vcmUgaWYgbmVlZGVkLgotICovCi0jaWZkZWYgREVCVUdfT04KLSNpbmNsdWRlIDxzdGRpby5oPgotCi0jZGVmaW5lIERFQlVHX1BSSU5URl8wKGEpICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBmcHJpbnRmKERFQlVHX1NUUkVBTSwgYSkKLSNkZWZpbmUgREVCVUdfUFJJTlRGXzEoYSwgYikgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZwcmludGYoREVCVUdfU1RSRUFNLCBhLCBiKQotI2RlZmluZSBERUJVR19QUklOVEZfMihhLCBiLCBjKSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZnByaW50ZihERUJVR19TVFJFQU0sIGEsIGIsIGMpCi0jZGVmaW5lIERFQlVHX1BSSU5URl8zKGEsIGIsIGMsIGQpICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBmcHJpbnRmKERFQlVHX1NUUkVBTSwgYSwgYiwgYywgZCkKLSNkZWZpbmUgREVCVUdfUFJJTlRGXzQoYSwgYiwgYywgZCwgZSkgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZwcmludGYoREVCVUdfU1RSRUFNLCBhLCBiLCBjLCBkLCBlKQotI2RlZmluZSBERUJVR19QUklOVEZfNShhLCBiLCBjLCBkLCBlLCBmKSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZnByaW50ZihERUJVR19TVFJFQU0sIGEsIGIsIGMsIGQsIGUsIGYpCi0jZGVmaW5lIERFQlVHX1BSSU5URl82KGEsIGIsIGMsIGQsIGUsIGYsIGcpICAgICAgICAgICAgICAgICAgICAgICAgICAgICBmcHJpbnRmKERFQlVHX1NUUkVBTSwgYSwgYiwgYywgZCwgZSwgZiwgZykKLSNkZWZpbmUgREVCVUdfUFJJTlRGXzcoYSwgYiwgYywgZCwgZSwgZiwgZywgaCkgICAgICAgICAgICAgICAgICAgICAgICAgIGZwcmludGYoREVCVUdfU1RSRUFNLCBhLCBiLCBjLCBkLCBlLCBmLCBnLCBoKQotI2RlZmluZSBERUJVR19QUklOVEZfOChhLCBiLCBjLCBkLCBlLCBmLCBnLCBoLCBpKSAgICAgICAgICAgICAgICAgICAgICAgZnByaW50ZihERUJVR19TVFJFQU0sIGEsIGIsIGMsIGQsIGUsIGYsIGcsIGgsIGkpCi0jZGVmaW5lIERFQlVHX1BSSU5URl85KGEsIGIsIGMsIGQsIGUsIGYsIGcsIGgsIGksIGopICAgICAgICAgICAgICAgICAgICBmcHJpbnRmKERFQlVHX1NUUkVBTSwgYSwgYiwgYywgZCwgZSwgZiwgZywgaCwgaSwgaikKLSNkZWZpbmUgREVCVUdfUFJJTlRGXzEwKGEsIGIsIGMsIGQsIGUsIGYsIGcsIGgsIGksIGosIGspICAgICAgICAgICAgICAgIGZwcmludGYoREVCVUdfU1RSRUFNLCBhLCBiLCBjLCBkLCBlLCBmLCBnLCBoLCBpLCBqLCBrKQotI2RlZmluZSBERUJVR19QUklOVEZfMTEoYSwgYiwgYywgZCwgZSwgZiwgZywgaCwgaSwgaiwgaywgbCkgICAgICAgICAgICAgZnByaW50ZihERUJVR19TVFJFQU0sIGEsIGIsIGMsIGQsIGUsIGYsIGcsIGgsIGksIGosIGssIGwpCi0jZGVmaW5lIERFQlVHX1BSSU5URl8xMihhLCBiLCBjLCBkLCBlLCBmLCBnLCBoLCBpLCBqLCBrLCBsLCBtKSAgICAgICAgICBmcHJpbnRmKERFQlVHX1NUUkVBTSwgYSwgYiwgYywgZCwgZSwgZiwgZywgaCwgaSwgaiwgaywgbCwgbSkKLSNkZWZpbmUgREVCVUdfUFJJTlRGXzEzKGEsIGIsIGMsIGQsIGUsIGYsIGcsIGgsIGksIGosIGssIGwsIG0sIG4pICAgICAgIGZwcmludGYoREVCVUdfU1RSRUFNLCBhLCBiLCBjLCBkLCBlLCBmLCBnLCBoLCBpLCBqLCBrLCBsLCBtLCBuKQotI2RlZmluZSBERUJVR19QUklOVEZfMTQoYSwgYiwgYywgZCwgZSwgZiwgZywgaCwgaSwgaiwgaywgbCwgbSwgbiwgbykgICAgZnByaW50ZihERUJVR19TVFJFQU0sIGEsIGIsIGMsIGQsIGUsIGYsIGcsIGgsIGksIGosIGssIGwsIG0sIG4sIG8pCi0jZWxzZSAvKiBERUJVR19PTiAqLwotI2RlZmluZSBERUJVR19QUklOVEZfMChhKSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKLSNkZWZpbmUgREVCVUdfUFJJTlRGXzEoYSwgYikgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCi0jZGVmaW5lIERFQlVHX1BSSU5URl8yKGEsIGIsIGMpICAgICAgICAgICAgICAgICAgICAgICAgICAgIAotI2RlZmluZSBERUJVR19QUklOVEZfMyhhLCBiLCBjLCBkKSAgICAgICAgICAgICAgICAgICAgICAgICAKLSNkZWZpbmUgREVCVUdfUFJJTlRGXzQoYS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ICAgICAgIAotICAgICAgICAKLSAgICAgICAgOy8vIGxvYWQgaW5wdXRzCi0gICAgICAgIExEUiAgICAgJHBCaXRTdHJlYW0sIFskcHBCaXRTdHJlYW1dCi0gICAgICAgIExEUiAgICAgJEJpdENvdW50LCBbJHBCaXRPZmZzZXRdCi0gICAgICAgIE1FTkQKLSAgICAgICAgCi0gICAgICAgIE1BQ1JPCi0gICAgICAgIE1fQkRfSU5JVDEgICRUMSwgJFQyLCAkVDMKLSAgICAgICAgTERSQiAgICAkVDIsIFskcEJpdFN0cmVhbSwgIzJdCi0gICAgICAgIExEUkIgICAgJFQxLCBbJHBCaXRTdHJlYW0sICMxXQotICAgICAgICBMRFJCICAgICRCaXRCdWZmZXIsICBbJHBCaXRTdHJlYW1dLCAjMwotICAgICAgICBBREQgICAgICRCaXRDb3VudCwgJEJpdENvdW50LCAjOAotICAgICAgICBNRU5ECi0gICAgICAgIAotICAgICAgICBNQUNSTwotICAgICAgICBNX0JEX0lOSVQyICAkVDEsICRUMiwgJFQzCi0gICAgICAgIE9SUiAgICAgJFQyLCAkVDIsICRUMSwgTFNMICM4Ci0gICAgICAgIE9SUiAgICAgJEJpdEJ1ZmZlciwgJFQyLCAkQml0QnVmZmVyLCBMU0wgIzE2Ci0gICAgICAgIE1FTkQgICAgCi0gICAgICAgIAotICAgICAgICA7Ly8KLSAgICAgICAgOy8vIExvb2sgYWhlYWQgZml4ZWQgMTw9Tjw9OCBiaXRzIHdpdGhvdXQgY29uc3VtaW5nIGFueSBiaXRzCi0gICAgICAgIDsvLyBUaGUgbmV4dCBiaXRzIHdpbGwgYmUgcGxhY2VkIGF0IGJpdCAzMS4uMjQgb2YgZGVzdGluYXRpb24gcmVnaXN0ZXIKLSAgICAgICAgOy8vCi0gICAgICAgIDsvLyBJbnB1dCBSZWdpc3RlcnM6Ci0gICAgICAgIDsvLwotICAgICAgICA7Ly8gJE4gICAgICAgICAgICAgIC0gbnVtYmVyIG9mIGJpdHMgdG8gbG9vawotICAgICA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udW1iZXIgb2YgYml0cyB0byBsb29rCi0gICAgICAgIDsvLyAkcEJpdFN0cmVhbSAgICAgXCAKLSAgICAgICAgOy8vICRCaXRCdWZmZXIgICAgICAgfSBTZWUgZGVzY3JpcHRpb24gYWJvdmUuCi0gICAgICAgIDsvLyAkQml0Q291bnQgICAgICAgLyAKLSAgICAgICAgOy8vIAotICAgICAgICA7Ly8gT3V0cHV0IFJlZ2lzdGVyczoKLSAgICAgICAgOy8vCi0gICAgICAgIDsvLyAkU3ltYm9sICAgICAgICAgLSB0aGUgbmV4dCBOIGJpdHMgb2YgdGhlIGJpdHN0cmVhbQotICAgICAgICA7Ly8gJFQxICAgICAgICAgICAgIC0gY29ycnVwdGVkIHRlbXAvc2NyYXRjaCByZWdpc3RlcgotICAgICAgICA7Ly8gJHBCaXRTdHJlYW0gICAgIFwgCi0gICAgICAgIDsvLyAkQml0QnVmZmVyICAgICAgIH0gU2VlIGRlc2NyaXB0aW9uIGFib3ZlLgotICAgICAgICA7Ly8gJEJpdENvdW50ICAgICAgIC8gCi0gICAgICAgIDsvLwotICAgICAgICBNQUNSTwotICAgICAgICBNX0JEX0xPT0sxNiAgJFN5bWJvbCwgJE4sICRUMQotICAgICAgICBBU1NFUlQgICgkTiA+PSAxKTpMQU5EOigkTiA8PSAxNikKLSAgICAgICAgTU9WICAgICAkU3ltYm9sLCAkQml0QnVmZmVyLCBMU0wgJEJpdENvdW50Ci0gICAgICAgIE1FTkQKLSAgICAgICAgCi0gICAgICAgIDsvLwotICAgICAgICA7Ly8gU2tpcHMgZml4ZWQgMTw9Tjw9OCBiaXRzIGZyb20gdGhlIGJpdHN0cmVhbSwgYWR2YW5jaW5nIHRoZSBiaXRzdHJlYW0gcG9pbnRlcgotICAgICAgICA7Ly8KLSAgICAgICAgOy8vIElucHV0IFJlZ2lzdGVyczoKLSAgICAgICAgOy8vCi0gICAgICAgIDsvLyAkTiAgICAgICAgICAgICAgLSBudW1iZXIgb2YgYml0cwotICAgICAgICA7Ly8gJHBCaXRTdHJlYW0gICAgIFwgCi0gICAgICAgIDsvLyAkQml0QnVmZmVyICAgICAgIH0gU2VlIGRlc2NyaXB0aW9uIGFib3ZlLgotICAgICAgICA7Ly8gJEJpdENvdW50ICAgICAgIC8gCi0gICAgICAgIDsvLyAKLSAgICAgICAgOy8vIE91dHB1dCBSZWdpc3RlcnM6Ci0gICAgICAgIDsvLwotICAgICAgICA7Ly8gJFQxICAgICAgICAgICAgIC0gY29ycnVwdGVkIHRlbXAvc2NyYXRjaCByZWdpc3RlcgotICAgICAgICA7Ly8gJHBCaXRTdHJlYW0gICAgIFwgCi0gICAgICAgIDsvLyAkQml0QnVmZmVyICAgICAgIH0gU2VlIGRlc2NyaXB0aW9uIGFib3ZlLgotICAgICAgICA7Ly8gJEJpdENvdW50ICAgICAgIC8gCi0gICAgICAgIDsvLwotICAgICAgICBNQUNSTwotICAgICAgICBNX0JEX1NLSVA4ICROLCAkVDEKLSAgICAgICAgQVNTRVJUICAoJE4+PTEpOkxBTkQ6KCROPD04KSAgICAgICAgCi0gICAgICAgIFNVQlMgICAgJEJpdENvdW50LCAkQml0Q291bnQsICMoOC0kTikKLSAgICAgICAgTERSQ1NCICAkVDEsIFskcEJpdFN0cmVhbV0sICMxICAgCi0gICAgICAgIEFERENDICAgJEJpdENvdW50LCAkQml0Q291bnQsICM4Ci0gICAgICAgIE9SUkNTICAgJEJpdEJ1ZmZlciwgJFQxLCAkQml0QnVmZmVyLCBMU0wgIzgKLSAgICAgICAgTUVORAotICAgICAgICAKLSAgICAgICAgCi0gICAgICAgIDsvLwotICAgICAgICA7Ly8gUmVhZCBmaXhlZCAxPD1OPD04IGJpdHMgZnJvbSB0aGUgYml0c3RyZWFtLCBhZHZhbmNpbmcgdGhlIGJpdHN0cmVhbSBwb2ludGVyCi0gICAgICAgIDsvLwotICAgICAgICA7Ly8gSW5wdXQgUmVnaXN0ZXJzOgotICAgICAgICA7Ly8KLSAgICAgICAgOy8vICROICAgICAgICAgICAgICAtIG51bWJlciBvZiBiaXRzIHRvIHJlYWQKLSAgICAgICAgOy8vICRwQml0U3RyZWFtICAgICBcIAotICAgICAgICA7Ly8gJEJpdEJ1ZmZlciAgICAgICB9IFNlZSBkZXNjcmlwdGlvbiBhYm92ZS4KLSAgICAgICAgOy8vICRCaXRDb3VudCAgICAgICAvIAotICAgICAgICA7Ly8gCi0gICAgICAgIDsvLyBPdXRwdXQgUmVnaXN0ZXJzOgotICAgICAgICA7Ly8KLSAgICAgICAgOy8vICRTeW1ib2wgICAgICAgICAtIHRoZSBuZXh0IE4gYml0cyBvZiB0aGUgYml0c3RyZWFtCi0gICAgICAgIDsvLyAkVDEgICAgICAgICAgICAgLSBjb3JydXB0ZWQgdGVtcC9zY3JhdGNoIHJlZ2lzdGVyCi0gICAgICAgIDsvLyAkcEJpdFN0cmVhbSAgICAgXCAKLSAgICAgICAgOy8vICRCaXRCdWZmZXIgICAgICAgfSBTZWUgZGVzY3JpcHRpb24gYWJvdmUuCi0gICAgICAgIDsvLyAkQml0Q291bnQgICAgICAgLyAKLSAgICAgICAgOy8vCi0gICAgICAgIE1BQ1JPCi0gICAgICAgIE1fQkRfUkVBRDggJFN5bWJvbCwgJE4sICRUMQotICAgICAgICBBU1NFUlQgICgkTj49MSk6TEFORDooJE48PTgpICAgICAgICAgICAgICAgIAotICAgICAgICBNT1ZTICAgICRTeW1ib2wsICRCaXRCdWZmZXIsIExTTCAkQml0Q291bnQgICAgICAgIAotICAgICAgICBTVUJTICAgICRCaXRDb3VudCwgJEJpdENvdW50LCAjKDgtJE4pCi0gICAgICAgIExEUkNTQiAgJFQxLCBbJHBCaXRTdHJlYW1dLCAjMSAgIAotICAgICAgICBBRERDQyAgICRCaXRDb3VudCwgJEJpdENvdW50LCAjOAotICAgICAgICBNT1YgICAgICRTeW1ib2wsICRTeW1ib2wsIExTUiAjKDMyLSROKQotICAgICAgICBPUlJDUyAgICRCaXRCdWZmZXIsICRUMSwgJEJpdEJ1ZmZlciwgTFNMICM4Ci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AgIEFTU0VSVCAgJFN5bWJvbDw+JFQxCi0gICAgICAgIElGICgkTjw9OCkKLSAgICAgICAgICAgIE1fQkRfUkVBRDggICRTeW1ib2wsICROLCAkVDEKLSAgICAgICAgRUxTRSAgICAgICAgCi0gICAgICAgICAgICA7Ly8gTj44IHNvIHdlIHdpbGwgYmUgYWJsZSB0byByZWZpbGwgYXQgbGVhc3Qgb25lIGJ5dGUgICAgICAgICAgICAKLSAgICAgICAgICAgIExEUkIgICAgJFQxLCBbJHBCaXRTdHJlYW1dLCAjMSAgICAgICAgICAgIAotICAgICAgICAgICAgTU9WUyAgICAkU3ltYm9sLCAkQml0QnVmZmVyLCBMU0wgJEJpdENvdW50Ci0gICAgICAgICAgICBPUlIgICAgICRCaXRCdWZmZXIsICRUMSwgJEJpdEJ1ZmZlciwgTFNMICM4ICAgICAgICAgICAgICAgICAgICAgICAKLSAgICAgICAgICAgIFNVQlMgICAgJEJpdENvdW50LCAkQml0Q291bnQsICMoMTYtJE4pCi0gICAgICAgICAgICBMRFJDU0IgICRUMSwgWyRwQml0U3RyZWFtXSwgIzEgICAgICAgICAgICAKLSAgICAgICAgICAgIE1PViAgICAgJFN5bWJvbCwgJFN5bWJvbCwgTFNSICMoMzItJE4pCi0gICAgICAgICAgICBBRERDQyAgICRCaXRDb3VudCwgJEJpdENvdW50LCAjOAotICAgICAgICAgICAgT1JSQ1MgICAkQml0QnVmZmVyLCAkVDEsICRCaXRCdWZmZXIsIExTTCAjOAotICAgICAgICBFTkRJRgotICAgICAgICBNRU5ECi0gICAgICAgIAotICAgICAgICA7Ly8KLSAgICAgICAgOy8vIFNraXAgdmFyaWFibGUgMTw9Tjw9OCBiaXRzIGZyb20gdGhlIGJpdHN0cmVhbSwgYWR2YW5jaW5nIHRoZSBiaXRzdHJlYW0gcG9pbnRlci4KLSAgICAgICAgOy8vCi0gICAgICAgIDsvLyBJbnB1dCBSZWdpc3RlcnM6Ci0gICAgICAgIDsvLwotICAgICAgICA7Ly8gJE4gICAgICAgICAgICAgIC0gbnVtYmVyIG9mIGJpdHMuIDE8PU48PTgKLSAgICAgICAgOy8vICRwQml0U3RyZWFtICAgICBcIAotICAgICAgICA7Ly8gJEJpdEJ1ZmZlciAgICAgICB9IFNlZSBkZXNjcmlwdGlvbiBhYm92ZS4KLSAgICAgICAgOy8vICRCaXRDb3VudCAgICAgICAvIAotICAgICAgICA7Ly8gCi0gICAgICAgIDsvLyBPdXRwdXQgUmVnaXN0ZXJzOgotICAgICAgICA7Ly8KLSAgICAgICAgOy8vICRUMSAgICAgICAgICAgICAtIGNvcnJ1cHRlZCB0ZW1wL3NjcmF0Y2ggcmVnaXN0ZXIKLSAgICAgICAgOy8vICRUMiAgICAgICAgICAgICAtIGNvcnJ1cHRlZCB0ZW1wL3NjcmF0Y2ggcmVnaXN0ZXIKLSAgICAgICAgOy8vICRwQml0U3RyZWFtICAgICBcIAotICAgICAgICA7Ly8gJEJpdEJ1ZmZlciAgICAgICB9IFNlZSBkZXNjcmlwdGlvbiBhYm92ZS4KLSAgICAgICAgOy8vICRCaXRDb3VudCAgICAgICAvIAotICAgICAgICA7Ly8KLSAgICAgICAgTUFDUk8KLSAgICAgICAgTV9CRF9WU0tJUDggJE4sICRUMQotICAgICAgICBBREQgICAgICRCaXRDb3VudCwgJEJpdENvdW50LCAkTgotICAgICAgICBTVUJTICAgICRCaXRDb3VudCwgJEJpdENvdW50LCAjOAotICAgICAgICBMRFJDU0IgICRUMSwgWyRwQml0U3RyZWFtXSwgIzEgICAgICAgIAotICAgICAgICBBRERDQyAgICRCaXRDb3VudCwgJEJpdENvdW50LCAjOAotICAgICAgICBPUlJDUyAgICRCaXRCdWZmZXIsICRUMSwgJEJpdEJ1ZmZlciwgTFNMICM4Ci0gICAgICAgIE1FTkQgICAgICAgIAotICAgICAgICAKLSAgICAgICAgOy8vCi0gICAgICAgIDsvLyBTa2lwIHZhcmlhYmxlIDE8PU48PTE2IGJpdHMgZnJvbSB0aGUgYml0c3RyZWFtLCBhZHZhbmNpbmcgdGhlIGJpdHN0cmVhbSBwb2ludGVyLgotICAgICAgICA7Ly8KLSAgICAgICAgOy8vIElucHV0IFJlZ2lzdGVyczoKLSAgICAgICAgOy8vCi0gICAgICAgIDsvLyAkTiAgICAgICAgICAgICAgLSBudW1iZXIgb2YgYml0cy4gMTw9Tjw9MTYKLSAgICAgICAgOy8vICRwQml0U3RyZWFtICAgICBcIAotICAgICAgICA7Ly8gJEJpdEJ1ZmZlciAgICAgICB9IFNlZSBkZXNjcmlwdGlvbiBhYm92ZS4KLSAgICAgICAgOy8vICRCaXRDb3VudCAgICAgICAvIAotICAgICAgICA7Ly8gCi0gICAgICAgIDsvLyBPdXRwdXQgUmVnaXN0ZXJzOgotICAgICAgICA7Ly8KLSAgICAgICAgOy8vICRUMSAgICAgICAgICAgICAtIGNvcnJ1cHRlZCB0ZW1wL3NjcmF0Y2ggcmVnaXN0ZXIKLSAgICAgICAgOy8vICRUMiAgICAgICAgICAgICAtIGNvcnJ1cHRlZCB0ZW1wL3NjcmF0Y2ggcmVnaXN0ZXIKLSAgICAgICAgOy8vICRwQml0U3RyZWFtICAgICBcIAotICAgICAgICA7Ly8gJEJpdEJ1ZmZlciAgICAgICB9IFNlZSBkZXNjcmlwdGlvbiBhYm92ZS4KLSAgICAgICAgOy8vICRCaXRDb3VudCAgICAgICAvIAotICAgICAgICA7Ly8KLSAgICAgICAgTUFDUk8KLSAgICAgICAgTV9CRF9WU0tJUDE2ICROLCAkVDEsICRUMgotICAgICAgICBBREQgICAgICRCaXRDb3VudCwgJEJpdENvdW50LCAkTgotICAgICAgICBTVUJTICAgICRCaXRDb3VudCwgJEJpdENvdW50LCAjOAotICAgICAgICBMRFJDU0IgICRUMSwgWyRwQml0U3RyZWFtXSwgIzEgICAgICAgIAotICAgICAgICBPUlJDUyAgICRCaXRCdWZmZXIsICRUMSwgJEJpdEJ1ZmZlciwgTFNMICM4Ci0gICAgICAgIFNVQkNTUyAgJEJpdENvdW50LCAkQml0Q291bnQsICM4ICAgICAgICAKLSAgICAgICAgTERSQ1NCICAkVDEsIFskcEJpdFN0cmVhbV0sICMxCi0gICAgICAgIEFERENDICAgJEJpdENvdW50LCAkQml0Q291bnQsICM4Ci0gICAgICAgIE9SUkNTICAgJEJpdEJ1ZmZlciwgJFQxLCAkQml0QnVmZmVyLCBMU0wgIzgKLSAgICAgICAgTUVORCAgICAgICAgCi0KLSAgICAgICAgOy8vCi0gICAgICAgIDsvLyBSZWFkIHZhcmlhYmxlIDE8PU48PTggYml0cyBmcm9tIHRoZSBiaXRzdHJlYW0sIGFkdmFuY2luZyB0aGUgYml0c3RyZWFtIHBvaW50ZXIuCi0gICAgICAgIDsvLwotICAgICAgICA7Ly8gSW5wdXQgUmVnaXN0ZXJzOgotICAgICAgICA7Ly8KLSAgICAgICAgOy8vICROICAgICAgICAgICAgICAtIG51bWJlciBvZiBiaXRzIHRvIHJlYWQuIDE8PU48PTgKLSAgICAgICAgOy8vICRwQml0U3RyZWFtICAgICBcIAotICAgICAgICA7Ly8gJEJpdEJ1ZmZlciAgICAgICB9IFNlZSBkZXNjcmlwdGlvbiBhYm92ZS4KLSAgICAgICAgOy8vICRCaXRDb3VudCAgICAgICAvIAotICAgICAgICA7Ly8gCi0gICAgICAgIDsvLyBPdXRwdXQgUmVnaXN0ZXJzOgotICAgICAgICA7Ly8KLSAgICAgICAgOy8vICRTeW1ib2wgICAgICAgICAtIHRoZSBuZXh0IE4gYml0cyBvZiB0aGUgYml0c3RyZWFtCi0gICAgICAgIDsvLyAkVDEgICAgICAgICAgICAgLSBjb3JydXB0ZWQgdGVtcC9zY3JhdGNoIHJlZ2lzdGVyCi0gICAgICAgIDsvLyAkVDIgICAgICAgICAgICAgLSBjb3JydXB0ZWQgdGVtcC9zY3JhdGNoIHJlZ2lzdGVyCi0gICAgICAgIDsvLyAkcEJpdFN0cmVhbSAgICAgXCAKLSAgICAgICAgOy8vICRCaXRCdWZmZXIgICAgICAgfSBTZWUgZGVzY3JpcHRpb24gYWJvdmUuCi0gICAgICAgIDsvLyAkQml0Q291bnQgICAgICAgLyAKLSAgICAgICAgOy8vCi0gICAgICAgIE1BQ1JPCi0gICAgICAgIE1fQkRfVlJFQUQ4ICRTeW1ib2wsICROLCAkVDEsICRUMgotICAgICAgICBNT1YgICAgICRTeW1ib2wsICRCaXRCdWZmZXIsIExTTCAkQml0Q291bnQgICAgICAgIAotICAgICAgICBBREQgICAgICRCaXRDb3VudCwgJEJpdENvdW50LCAkTgotICAgICAgICBTVUJTICAgICRCaXRDb3VudCwgJEJpdENvdW50LCAjOAotICAgICAgICBMRFJDU0IgICRUMSwgWyRwQml0U3RyZWFtXSwgIzEgICAgICAgIAotICAgICAgICBSU0IgICAgICRUMiwgJE4sICMzMiAgICAgICAgCi0gICAgICAgIEFERENDICAgJEJpdENvdW50LCAkQml0Q291bnQsICM4Ci0gICAgICAgIE1PViAgICAgJFN5bWJvbCwgJFN5bWJvbCwgTFNSICRUMgotICAgICAgICBPUlJDUyAgICRCaXRCdWZmZXIsICRUMSwgJEJpdEJ1ZmZlciwgTFNMICM4Ci0gICAgICAgIE1FTkQKLQotCi0gICAgICAgIDsvLwotICAgICAgICA7Ly8gUmVhZCB2YXJpYWJsZSAxPD1OPD0xNiBiaXRzIGZyb20gdGhlIGJpdHN0cmVhbSwgYWR2YW5jaW5nIHRoZSBiaXRzdHJlYW0gcG9pbnRlci4KLSAgICAgICAgOy8vCi0gICAgICAgIDsvLyBJbnB1dCBSZWdpc3RlcnM6Ci0gICAgICAgIDsvLwotICAgICAgICA7Ly8gJE4gICAgICAgICAgICAgIC0gbnVtYmVyIG9mIGJpdHMgdG8gcmVhZC4gMTw9Tjw9MTYKLSAgICAgICAgOy8vICRwQml0U3RyZWFtICAgICBcIAotICAgICAgICA7Ly8gJEJpdEJ1ZmZlciAgICAgICB9IFNlZSBkZXNjcmlwdGlvbiBhYm92ZS4KLSAgICAgICAgOy8vICRCaXRDb3VudCAgICAgICAvIAotICAgICAgICA7Ly8gCi0gICAgICAgIDsvLyBPdXRwdXQgUmVnaXN0ZXJzOgotICAgICAgICA7Ly8KLSAgICAgICAgOy8vICRTeW1ib2wgICAgICAgICAtIHRoZSBuZXh0IE4gYml0cyBvZiB0aGUgYml0c3RyZWFtCi0gICAgICAgIDsvLyAkVDEgICAgICAgICAgICAgLSBjb3JydXB0ZWQgdGVtcC9zY3JhdGNoIHJlZ2lzdGVyCi0gICAgICAgIDsvLyAkVDIgICAgICAgICAgICAgLSBjb3JydXB0ZWQgdGVtcC9zY3JhdGNoIHJlZ2lzdGVyCi0gICAgICAgIDsvLyAkcEJpdFN0cmVhbSAgICAgXCAKLSAgICAgICAgOy8vICRCaXRCdWZmZXIgICAgICAgfSBTZWUgZGVzY3JpcHRpb24gYWJvdmUuCi0gICAgICAgIDsvLyAkQml0Q291bnQgICAgICAgLyAKLSAgICAgICAgOy8vCi0gICAgICAgIE1BQ1JPCi0gICAgICAgIE1fQkRfVlJFQUQxNiAkU3ltYm9sLCAkTiwgJFQxLCAkVDIKLSAgICAgICAgTU9WICAgICAkU3ltYm9sLCAkQml0QnVmZmVyLCBMU0wgJEJpdENvdW50ICAgICAgICAKLSAgICAgICAgQUREICAgICAkQml0Q291bnQsICRCaXRDb3VudCwgJE4KLSAgICAgICAgU1VCUyAgICAkQml0Q291bnQsICRCaXRDb3VudCwgIzgKLSAgICAgICAgTERSQ1NCICAkVDEsIFskcEJpdFN0cmVhbV0sICMxICAgICAgICAKLSAgICAgICAgUlNCICAgICAkVDIsICROLCAjMzIgICAgICAgIAotICAgICAgICBPUlJDUyAgICRCaXRCdWZmZXIsICRUMSwgJEJpdEJ1ZmZlciwgTFNMICM4Ci0gICAgICAgIFNVQkNTUyAgJEJpdENvdW50LCAkQml0Q291bnQsICM4ICAgICAgICAKLSAgICAgICAgTERSQ1NCICAkVDEsIFskcEJpdFN0cmVhbV0sICMxCi0gICAgICAgIEFERENDICAgJEJpdENvdW50LCAkQml0Q291bnQsICM4Ci0gICAgICAgIE1PViAgICAgJF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yAKLSAgICAgICAgOy8vICAgICAgICAKLSAgICAgICAgTUFDUk8KLSAgICAgICAgTV9CRF9DTFoxNiAkU3ltYm9sLCAkVDEsICRUMgotICAgICAgICBNT1ZTICAgICRTeW1ib2wsICRCaXRCdWZmZXIsIExTTCAkQml0Q291bnQKLSAgICAgICAgQ0xaICAgICAkU3ltYm9sLCAkU3ltYm9sICAgICAgICAgICAgICAgIAotICAgICAgICBBREQgICAgICRCaXRDb3VudCwgJEJpdENvdW50LCAkU3ltYm9sCi0gICAgICAgIFNVQlMgICAgJEJpdENvdW50LCAkQml0Q291bnQsICM3ICAgICAgICA7Ly8gbGVuZ3RoIGlzIFN5bWJvbCsxCi0gICAgICAgIExEUkNTQiAgJFQxLCBbJHBCaXRTdHJlYW1dLCAjMQotICAgICAgICBPUlJDUyAgICRCaXRCdWZmZXIsICRUMSwgJEJpdEJ1ZmZlciwgTFNMICM4Ci0gICAgICAgIFNVQkNTUyAgJEJpdENvdW50LCAkQml0Q291bnQsICM4ICAgICAgICAKLSAgICAgICAgTERSQ1NCICAkVDEsIFskcEJpdFN0cmVhbV0sICMxCi0gICAgICAgIEFERENDICAgJEJpdENvdW50LCAkQml0Q291bnQsICM4Ci0gICAgICAgIE9SUkNTICAgJEJpdEJ1ZmZlciwgJFQxLCAkQml0QnVmZmVyLCBMU0wgIzgKLSAgICAgICAgTUVORCAgCi0KLSAgICAgICAgOy8vCi0gICAgICAgIDsvLyBEZWNvZGUgYSBjb2RlIG9mIHRoZSBmb3JtIDExMTEuLi4xMTAgd2hlcmUgdGhlcmUKLSAgICAgICAgOy8vIGFyZSBOIG9uZXMgYmVmb3JlIHRoZSAwIGFuZCBOPD0xNSAoY29kZSBsZW5ndGg8PTE2KQotICAgICAgICA7Ly8KLSAgICAgICAgOy8vIElucHV0IFJlZ2lzdGVyczoKLSAgICAgICAgOy8vCi0gICAgICAgIDsvLyAkcEJpdFN0cmVhbSAgICAgXCAKLSAgICAgICAgOy8vICRCaXRCdWZmZXIgICAgICAgfSBTZWUgZGVzY3JpcHRpb24gYWJvdmUuCi0gICAgICAgIDsvLyAkQml0Q291bnQgICAgICAgLyAKLSAgICAgICAgOy8vIAotICAgICAgICA7Ly8gT3V0cHV0IFJlZ2lzdGVyczoKLSAgICAgICAgOy8vCi0gICAgICAgIDsvLyAkU3ltYm9sICAgICAgICAgLSB0aGUgbnVtYmVyIG9mIHplcm9zIGJlZm9yZSB0aGUgbmV4dCAxCi0gICAgICAgIDsvLyAgICAgICAgICAgICAgICAgICA+PTE2IGlzIGFuIGlsbGVnYWwgY29kZQotICAgICAgICA7Ly8gJFQxICAgICAgICAgICAgIC0gY29ycnVwdGVkIHRlbXAvc2NyYXRjaCByZWdpc3RlcgotICAgICAgICA7Ly8gJFQyICAgICAgICAgICAgIC0gY29ycnVwdGVkIHRlbXAvc2NyYXRjaCByZWdpc3RlcgotICAgICAgICA7Ly8gJHBCaXRTdHJlYW0gICAgIFwgCi0gICAgICAgIDsvLyAkQml0QnVmZmVyICAgICAgIH0gU2VlIGRlc2NyaXB0aW9uIGFib3ZlLgotICAgICAgICA7Ly8gJEJpdENvdW50ICAgICAgIC8gCi0gICAgICAgIDsvLyAgICAgICAgCi0gICAgICAgIE1BQ1JPCi0gICAgICAgIE1fQkRfQ0xPMTYgJFN5bWJvbCwgJFQxLCAkVDIKLSAgICAgICAgTU9WICAgICAkU3ltYm9sLCAkQml0QnVmZmVyLCBMU0wgJEJpdENvdW50Ci0gICAgICAgIE1WTiAgICAgJFN5bWJvbCwgJFN5bWJvbAotICAgICAgICBDTFogICAgICRTeW1ib2wsICRTeW1ib2wgICAgICAgICAgICAgICAgCi0gICAgICAgIEFERCAgICAgJEJpdENvdW50LCAkQml0Q291bnQsICRTeW1ib2wKLSAgICAgICAgU1VCUyAgICAkQml0Q291bnQsICRCaXRDb3VudCwgIzcgICAgICAgIDsvLyBsZW5ndGggaXMgU3ltYm9sKzEKLSAgICAgICAgTERSQ1NCICAkVDEsIFskcEJpdFN0cmVhbV0sICMxCi0gICAgICAgIE9SUkNTICAgJEJpdEJ1ZmZlciwgJFQxLCAkQml0QnVmZmVyLCBMU0wgIzgKLSAgICAgICAgU1VCQ1NTICAkQml0Q291bnQsICRCaXRDb3VudCwgIzggICAgICAgIAotICAgICAgICBMRFJDU0IgICRUMSwgWyRwQml0U3RyZWFtXSwgIzEKLSAgICAgICAgQUREQ0MgICAkQml0Q291bnQsICRCaXRDb3VudCwgIzgKLSAgICAgICAgT1JSQ1MgICAkQml0QnVmZmVyLCAkVDEsICRCaXRCdWZmZXIsIExTTCAjOAotICAgICAgICBNRU5EICAKLQotCi0gICAgICAgIDsvLwotICAgICAgICA7Ly8gVmFyaWFibGUgTGVuZ3RoIERlY29kZSBtb2R1bGUKLSAgICAgICAgOy8vCi0gICAgICAgIDsvLyBEZWNvZGVzIG9uZSBWTEQgU3ltYm9sIGZyb20gYSBiaXRzdHJlYW0gYW5kIHJlZmlsbCB0aGUgYml0c3RyZWFtCi0gICAgICAgIDsvLyBidWZmZXIuCi0gICAgICAgIDsvLwotICAgICAgICA7Ly8gSW5wdXQgUmVnaXN0ZXJzOgotICAgICAgICA7Ly8KLSAgICAgICAgOy8vICRwVkxEVGFibGUgICAgICAtIHBvaW50ZXIgdG8gVkxEIGRlY29kZSB0YWJsZSBvZiAxNi1iaXQgZW50cmllcy4KLSAgICAgICAgOy8vICAgICAgICAgICAgICAgICAgIFRoZSBmb3JtYXQgaXMgZGVzY3JpYmVkIGFib3ZlIGF0IHRoZSBzdGFydCBvZgotICAgICAgICA7Ly8gICAgICAgICAgICAgICAgICAgdGhpcyBmaWxlLgotICAgICAgICA7Ly8gJFMwICAgICAgICAgICAgIC0gVGhlIG51bWJlciBvZiBiaXRzIHRvIGxvb2sgdXAgZm9yIHRoZSBmaXJzdCBzdGVwCi0gICAgICAgIDsvLyAgICAgICAgICAgICAgICAgICAxPD0kUzA8PTgKLSAgICAgICAgOy8vICRTMSAgICAgICAgICAgICAtIFRoZSBudW1iZXIgb2YgYml0cy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CBMU0wgJEJpdENvdW50ICAgICAgIDsvLyBsZWZ0IGFsaWduIG5leHQgYml0cwotICAgICAgICBNT1ZTICAgICRTeW1ib2wsICMoMjw8JFMwKS0yICAgICAgICAgICAgICAgICA7Ly8gY3JlYXRlIG1hc2sKLSAgICAgICAgQU5EICAgICAkU3ltYm9sLCAkU3ltYm9sLCAkVDEsIExTUiAjKDMxLSRTMCkgOy8vIDIqKG5leHQgJFMwIGJpdHMpCi0gICAgICAgIFNVQlMgICAgJEJpdENvdW50LCAkQml0Q291bnQsICM4ICAgICAgICAgICAgIDsvLyBDUyBpZiBidWZmZXIgY2FuIGJlIGZpbGxlZAotMDEKLSAgICAgICAgTERSQ1NCICAkVDEsIFskcEJpdFN0cmVhbV0sICMxICAgICAgICAgICAgICAgOy8vIGxvYWQgcmVmaWxsIGJ5dGUKLSAgICAgICAgTERSSCAgICAkU3ltYm9sLCBbJHBWTERUYWJsZSwgJFN5bWJvbF0gICAgICAgOy8vIGxvYWQgdGFibGUgZW50cnkKLSAgICAgICAgQUREQ0MgICAkQml0Q291bnQsICRCaXRDb3VudCwgIzggICAgICAgICAgICAgOy8vIHJlZmlsbCBub3QgcG9zc2libGUKLSAgICAgICAgQUREICAgICAkQml0Q291bnQsICRCaXRDb3VudCwgIyRTMCAgICAgICAgICAgOy8vIGFzc3VtZSAkUzAgYml0cyB1c2VkCi0gICAgICAgIE9SUkNTICAgJEJpdEJ1ZmZlciwgJFQxLCAkQml0QnVmZmVyLCBMU0wgIzggIDsvLyBtZXJnZSBpbiByZWZpbGwgYnl0ZQotICAgICAgICBNT1ZTICAgICRUMSwgJFN5bWJvbCwgTFNSICMxICAgICAgICAgICAgICAgICA7Ly8gQ1M9bGVhZiBlbnRyeQotICAgICAgICBCQ1MgICAgICVGVDAyCi0gICAgICAgIAotICAgICAgICBNT1ZTICAgICRUMSwgJEJpdEJ1ZmZlciwgTFNMICRCaXRDb3VudCAgICAgICA7Ly8gbGVmdCBhbGlnbiBuZXh0IGJpdAotICAgICAgICBJRiAoMiokUzAtJFMxPD04KQotICAgICAgICAgICAgOy8vIENhbiBjb21iaW5lIHJlZmlsbCBjaGVjayBhbmQgLVMwK1MxIGFuZCBrZWVwICRCaXRDb3VudDw9MTUKLSAgICAgICAgICAgIFNVQlMgICAgJEJpdENvdW50LCAkQml0Q291bnQsICM4KygkUzAtJFMxKQotICAgICAgICBFTFNFCi0gICAgICAgICAgICA7Ly8gU2VwYXJhdGUgcmVmaWxsIGNoZWNrIGFuZCAtUzArUzEgb2Zmc2V0Ci0gICAgICAgICAgICBTVUJTICAkQml0Q291bnQsICRCaXRDb3VudCwgIzgKLSAgICAgICAgICAgIFNVQiAgICRCaXRDb3VudCwgJEJpdENvdW50LCAjKCRTMC0kUzEpCi0gICAgICAgIEVORElGCi0gICAgICAgIEFERCAgICAgJFN5bWJvbCwgJFN5bWJvbCwgJFQxLCBMU1IgIygzMS0kUzEpIDsvLyBhZGQgMioobmV4dCAkUzEgYml0cykgdG8KLSAgICAgICAgQklDICAgICAkU3ltYm9sLCAkU3ltYm9sLCAjMSAgICAgICAgICAgICAgICAgOy8vICAgdGFibGUgb2Zmc2V0Ci0gICAgICAgIEIgICAgICAgJUJUMDEgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDsvLyBsb2FkIG5leHQgdGFibGUgZW50cnkKLTAyCi0gICAgICAgIDsvLyBCaXRDb3VudCByYW5nZSBub3cgZGVwZW5kIG9uIHRoZSByb3V0ZSBoZXJlCi0gICAgICAgIDsvLyBpZiAoZmlyc3Qgc3RlcCkgICAgICAgUzAgPD0gQml0Q291bnQgPD0gNytTMCAgICAgICAgPD0xNQotICAgICAgICA7Ly8gZWxzZSBpZiAoMipTMC1TMTw9OCkgIFMwIDw9IEJpdENvdW50IDw9IDcrKDIqUzAtUzEpIDw9MTUKLSAgICAgICAgOy8vIGVsc2UgICAgICAgICAgICAgICAgICBTMSA8PSBCaXRDb3VudCA8PSA3K1MxICAgICAgICA8PTE1Ci0gICAgICAgIA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GVXb3JkLCAKLSAgICBPTVhfSU5UIGNvZGVMZW5ndGggCi0pOwotIAotLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgotICogVmFyaWFibGUgYml0IGxlbmd0aCBFbmNvZGUKLSAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0KLS8qKgotICogRnVuY3Rpb246IGFybVBhY2tWTEMzMgotICoKLSAqIERlc2NyaXB0aW9uOgotICogUGFjayBhIFZMQyBjb2RlIHdvcmQgaW50byB0aGUgYml0c3RyZWFtCi0gKgotICogUmVtYXJrczoKLSAqCi0gKiBQYXJhbWV0ZXJzOgotICogW2luXQlwcEJpdFN0cmVhbQkJcG9pbnRlciB0byB0aGUgcG9pbnRlciB0byB0aGUgY3VycmVudCBieXRlIAotICogICAgICAgICAgICAgICAgICAgICAgaW4gdGhlIGJpdCBzdHJlYW0uCi0gKiBbaW5dCXBCaXRPZmZzZXQJICAgIHBvaW50ZXIgdG8gdGhlIGJpdCBwb3NpdGlvbiBpbiB0aGUgYnl0ZSAKLSAqICAgICAgICAgICAgICAgICAgICAgIHBvaW50ZWQgYnkgKnBwQml0U3RyZWFtLiBWYWxpZCB3aXRoaW4gMAotICogICAgICAgICAgICAgICAgICAgICAgdG8gNy4KLSAqIFtpbl0JIGNvZGUgICAgIAkJVkxDIGNvZGUgd29yZCB0aGF0IG5lZWQgdG8gYmUgaW5zZXJ0ZWQgaW4gdG8gdGhlCi0gKiAgICAgICAgICAgICAgICAgICAgICBiaXRzdHJlYW0KLSAqCi0gKiBbb3V0XSBwcEJpdFN0cmVhbQkqcHBCaXRTdHJlYW0gaXMgdXBkYXRlZCBhZnRlciB0aGUgYmxvY2sgaXMgZW5jb2RlZCwKLSAqCSAgICAgICAgICAgICAgICAgICAgc28gdGhhdCBpdCBwb2ludHMgdG8gdGhlIGN1cnJlbnQgYnl0ZSBpbiB0aGUgYml0Ci0gKgkJCQkJCXN0cmVhbSBidWZmZXIuCi0gKiBb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i07Ly8gSVN0YWdlIDM6ICAgaDAgPSAoaTAraTEpLzIgICAgICBoMSA9IChpMC1pMSkvMgotOy8vICAgICAgICAgICAgIGgyID0gKGkyKnNxcnQyKS1pMyAgaDMgPSBpMwotOy8vICAgICAgICAgICAgIGg0ID0gIGNvcyhwaS84KSppNCArIHNpbihwaS84KSppNgotOy8vICAgICAgICAgICAgIGg2ID0gLXNpbihwaS84KSppNCArIGNvcyhwaS84KSppNgotOy8vICAgICAgICAgICAgIFsgVGhlIGFib3ZlIHR3byBsaW5lcyByb3RhdGUgYnkgLShwaS84KSBdCi07Ly8gICAgICAgICAgICAgaDUgPSAoaTUtaTcpL3NxcnQyICBoNyA9IChpNStpNykvMiAKLTsvLyAgICAgICAgICAgICAKLTsvLyBJU3RhZ2UgMjogICBnMCA9IChoMCtoMykvMiAgICAgIGczID0gKGgwLWgzKS8yCi07Ly8gICAgICAgICAgICAgZzEgPSAoaDEraDIpLzIgICAgICBnMiA9IChoMS1oMikvMgotOy8vICAgICAgICAgICAgIGc3ID0gaDcgICAgICAgICAgICAgZzYgPSBoNiAtIGg3Ci07Ly8gICAgICAgICAgICAgZzUgPSBoNSAtIGc2ICAgICAgICBnNCA9IGg0IC0gZzUKLTsvLwotOy8vIElTdGFnZSAxOiAgIGYwID0gKGcwK2c3KS8yICAgICAgZjcgPSAoZzAtZzcpLzIKLTsvLyAgICAgICAgICAgICBmMSA9IChnMStnNikvMiAgICAgIGY2ID0gKGcxLWc2KS8yCi07Ly8gICAgICAgICAgICAgZjIgPSAoZzIrZzUpLzIgICAgICBmNSA9IChnMi1nNSkvMgotOy8vICAgICAgICAgICAgIGYzID0gKGczK2c0KS8yICAgICAgZjQgPSAoZzMtZzQpLzIKLTsvLwotOy8vIE5vdGUgdGhhdCBtb3N0IGNvZWZmaWNpZW50cyBhcmUgaGFsdmVkIDMgdGltZXMgZHVyaW5nIHRoZQotOy8vIGFib3ZlIGNhbGN1bGF0aW9uLiBXZSBjYW4gcmVzY2FsZSB0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ISUZUICAgICAgIFNFVEEgICAgMTIKLSAgICAgICAgICAgIExEUiAgICAgeGkwLCBbcFNjYWxlXSwgIzQKLSAgICAgICAgICAgIExEUiAgICAgeGkxLCBbcFNjYWxlLCAjNCoxNi00XSAgICAgICAgCi0gICAgICAgICAgICBMRFIgICAgIHhpMiwgW3BTY2FsZSwgIzIqMTYtNF0KLSAgICAgICAgICAgIE1PViAgICAgeGl0LCAjMTw8KFNISUZULTEpCi0gICAgICAgICAgICBTTUxBQkIgIHhpMywgeGkwLCB4aTQsIHhpdAotICAgICAgICAgICAgU01MQVRUICB4aTQsIHhpMCwgeGk0LCB4aXQKLSAgICAgICAgICAgIFNNTEFCQiAgeGkwLCB4aTEsIHhpNSwgeGl0Ci0gICAgICAgICAgICBTTUxBVFQgIHhpNSwgeGkxLCB4aTUsIHhpdAotICAgICAgICAgICAgTU9WICAgICB4aTMsIHhpMywgQVNSICNTSElGVAotICAgICAgICAgICAgUEtIQlQgICB4aTQsIHhpMywgeGk0LCBMU0wgIygxNi1TSElGVCkKLSAgICAgICAgICAgIExEUiAgICAgeGkzLCBbcFNjYWxlLCAjNioxNi00XQotICAgICAgICAgICAgU01MQUJCICB4aTEsIHhpMiwgeGk2LCB4aXQKLSAgICAgICAgICAgIFNNTEFUVCAgeGk2LCB4aTIsIHhpNiwgeGl0Ci0gICAgICAgICAgICBNT1YgICAgIHhpMCwgeGkwLCBBU1IgI1NISUZUCi0gICAgICAgICAgICBQS0hCVCAgIHhpNSwgeGkwLCB4aTUsIExTTCAjKDE2LVNISUZUKQotICAgICAgICAgICAgU01MQUJCICB4aTIsIHhpMywgeGk3LCB4aXQKLSAgICAgICAgICAgIFNNTEFUVCAgeGk3LCB4aTMsIHhpNywgeGl0Ci0gICAgICAgICAgICBNT1YgICAgIHhpMSwgeGkxLCBBU1IgI1NISUZUCi0gICAgICAgICAgICBQS0hCVCAgIHhpNiwgeGkxLCB4aTYsIExTTCAjKDE2LVNISUZUKQotICAgICAgICAgICAgTU9WICAgICB4aTIsIHhpMiwgQVNSICNTSElGVAotICAgICAgICAgICAgUEtIQlQgICB4aTcsIHhpMiwgeGk3LCBMU0wgIygxNi1TSElGVCkKLSAgICAgICAgRU5ESUYKLSAgICAgICAgSUYgIiRpbnNjYWxlIj0iczMyIiA7Ly8gMzJ4MTYgbXVsCi1TSElGVCAgICAgICBTRVRBICAgICgxMis4LTE2KQotICAgICAgICAgICAgTU9WICAgICB4aXQsICMxPDwoU0hJRlQtMSkKLSAgICAgICAgICAgIExEUiAgICAgeGkwLCBbcFNjYWxlXSwgIzgKLSAgICAgICAgICAgIExEUiAgICAgeGkxLCBbcFNjYWxlLCAjMCozMis0LThdCi0gICAgICAgICAgICBMRFIgICAgIHhpMiwgW3BTY2FsZSwgIzQqMzItOF0KLSAgICAgICAgICAgIExEUiAgICAgeGkzLCBbcFNjYWxlLCAjNCozMis0LThdICAgICAgICAgICAgCi0gICAgICAgICAgICBTTUxBV0IgIHhpMCwgeGkwLCB4aTQsIHhpdAotICAgICAgICAgICAgU01MQVdUICB4aTEsIHhpMSwgeGk0LCB4aXQKLSAgICAgICAgICAgIFNNTEFXQiAgeGkyLCB4aTIsIHhpNSwgeGl0Ci0gICAgICAgICAgICBTTUxBV1QgIHhpMywgeGkzLCB4aTUsIHhpdCAgICAgICAgICAgIAotICAgICAgICAgICAgTU9WICAgICB4aTAsIHhpMCwgQVNSICNTSElGVAotICAgICAgICAgICAgUEtIQlQgICB4aTQsIHhpMCwgeGkxLCBMU0wgIygxNi1TSElGVCkKLSAgICAgICAgICAgIE1PViAgICAgeGkyLCB4aTIsIEFTUiAjU0hJRlQgICAgICAgICAgICAKLSAgICAgICAgICAgIFBLSEJUICAgeGk1LCB4aTIsIHhpMywgTFNMICMoMTYtU0hJRlQpCi0gICAgICAgICAgICBMRFIgICAgIHhpMCwgW3BTY2FsZSwgIzIqMzItOF0KLSAgICAgICAgICAgIExEUiAgICAgeGkxLCBbcFNjYWxlLCAjMiozMis0LThdCi0gICAgICAgICAgICBMRFIgICAgIHhpMiwgW3BTY2FsZSwgIzYqMzItOF0KLSAgICAgICAgICAgIExEUiAgICAgeGkzLCBbcFNjYWxlLCAjNiozMis0LThdICAgICAgICAgICAgCi0gICAgICAgICAgICBTTUxBV0IgIHhpMCwgeGkwLCB4aTYsIHhpdAotICAgICAgICAgICAgU01MQVdUICB4aTEsIHhpMSwgeGk2LCB4aXQKLSAgICAgICAgICAgIFNNTEFXQiAgeGkyLCB4aTIsIHhpNywgeGl0Ci0gICAgICAgICAgICBTTUxBV1QgIHhpMywgeGkzLCB4aTcsIHhpdCAgICAgICAgICAgIAotICAgICAgICAgICAgTU9WICAgICB4aTAsIHhpMCwgQVNSICNTSElGVAotICAgICAgICAgICAgUEtIQlQgICB4aTYsIHhpMCwgeGkxLCBMU0wgIygxNi1TSElGVCkKLSAgICAgICAgICAgIE1PViAgICAgeGkyLCB4aTIsIEFTUiAjU0hJRlQgICAgICAgICAgICAKLSAgICAgICAgICAgIFBLSEJUICAgeGk3LCB4aTIsIHhpMywgTFNMICMoMTYtU0hJRlQpCi0gICAgICAgIEVORElGCi0gICAgICAgICAgICAgICAgCi0gICAgICAgIDsvLyBMb2FkIG9kZCB2YWx1ZXMKLSAgICAgICAgTERSICAgICB4aTAsIFtwU3JjLCAjMSoxNi00XSAgICAgIDsvLyBqMQotICAgICAgICBMRFIgICAgIHhpMSwgW3BTcmMsICM3KjE2LTRdICAgICAgOy8vIGo3Ci0gICAgICAgIExEUiAgICAgeGkyLCBbcFNyYywgIzUqMTYtNF0gICAgICA7Ly8gajUKLSAgICAgICAgTERSICAgICB4aTMsIFtwU3JjLCAjMyoxNi00XSAgICAgIDsvLyBqMwotICAgICAgICAKLSAgICAgICAgSUYgIHtUUlVFfQotICAgICAgICAgICAgOy8vIHNob3J0Y3V0IGlmIG9kZCB2YWx1ZXMgMAotICAgICAgICAgICAgVEVRICAgICB4aTAsICMwCi0gICAgICAgICAgICBURVFFUSAgIHhpMSwgIzAKLSAgICAgICAgICAgIFRFUUVRICAgeGkyLCAjMAotICAgICAgICAgICAgVEVRRVEgICB4aTMsICMwCi0gICAgICAgICAgICBCRVEgICAgIHY2T2RkWmVybyRfRgotICAgICAgICBFTkRJRgotICAgICAgICAKLSAgICAgICAgOy8vIFN0b3JlIHNjYWxlZCBldmVuIHZhbHVlcwotICAgICAgICBTVE1JQSAgIHBEZXN0LCB7eGk0LCB4aTUsIHhpNiwgeGk3fQotICAgICAgICAKLSAgICAgICAgOy8vIFNjYWxlIG9kZCB2YWx1ZXMKLSAgICAgICAgSUYgIiRpbnNjYWxlIj0iczE2IgotICAgICAgICAgICAgOy8vIFBlcmZvcm0gQUFOIFNjYWxlCi0gICAgICAgICAgICBMRFIgICAgIHhpNCwgW3BTY2FsZSwgIzEqMTYtNF0KLSAgICAgICAgICAgIExEUiAgICAgeGk1LCBbcFNjYWxlLCAjNyoxNi00XSAgICAgICAgCi0gICAgICAgICAgICBMRFIgICAgIHhpNiwgW3BTY2FsZSwgIzUqMTYtNF0KLSAgICAgICAgICAgIFNNTEFCQiAgeGk3LCB4aTAsIHhpNCwgeGl0Ci0gICAgICAgICAgICBTTUxBVFQgIHhpMCwgeGkwLCB4aTQsIHhpdAotICAgICAgICAgICAgU01MQUJCICB4aTQsIHhpMSwgeGk1LCB4aXQKLSAgICAgICAgICAgIFNNTEFUVCAgeGkxLCB4aTEsIHhpNSwgeGl0Ci0gICAgICAgICAgICBNT1YgICAgIHhpNywgeGk3LCBBU1IgI1NISUZUCi0gICAgICAgICAgICBQS0hCVCAgIHhpMCwgeGk3LCB4aTAsIExTTCAjKDE2LVNISUZUKQotICAgICAgICAgICAgTERSICAgICB4aTcsIFtwU2NhbGUsICMzKjE2LTRdCi0gICAgICAgICAgICBTTUxBQkIgIHhpNSwgeGkyLCB4aTYsIHhpdAotICAgICAgICAgICAgU01MQVRUICB4aTIsIHhpMiwgeGk2LCB4aXQKLSAgICAgICAgICAgIE1PViAgICAgeGk0LCB4aTQsIEFTUiAjU0hJRlQKLSAgICAgICAgICAgIFBLSEJUICAgeGkxLCB4aTQsIHhpMSwgTFNMICMoMTYtU0hJRlQpCi0gICAgICAgICAgICBTTUxBQkIgIHhpNiwgeGkzLCB4aTcsIHhpdAotICAgICAgICAgICAgU01MQVRUICB4aTMsIHhpMywgeGk3LCB4aXQKLSAgICAgICAgICAgIE1PViAgICAgeGk1LCB4aTUsIEFTUiAjU0hJRlQKLSAgICAgICAgICAgIFBLSEJUICAgeGkyLCB4aTUsIHhpMiwgTFNMICMoMTYtU0hJRlQpCi0gICAgICAgICAgICBNT1YgICAgIHhpNiwgeGk2LCBBU1IgI1NISUZUCi0gICAgICAgICAgICBQS0hCVCAgIHhpMywgeGk2LCB4aTMsIExTTCAjKDE2LVNISUZUKQotICAgICAgICBFTkRJRgotICAgICAgICBJRiAiJGluc2NhbGUiPSJzMzIiIDsvLyAzMngxNiBtdWwKLSAgICAgICAgICAgIExEUiAgICAgeGk0LCBbcFNjYWxlLCAjMSozMi04XQotICAgICAgICAgICAgTERSICAgICB4aTUsIFtwU2NhbGUsICMxKjMyKzQtOF0KLSAgICAgICAgICAgIExEUiAgICAgeGk2LCBbcFNjYWxlLCAjNyozMi04XQotICAgICAgICAgICAgTERSICAgICB4aTcsIFtwU2NhbGUsICM3KjMyKzQtOF0gICAgICAgICAgICAKLSAgICAgICAgICAgIFNNTEFXQiAgeGk0LCB4aTQsIHhpMCwgeGl0Ci0gICAgICAgICAgICBTTUxBV1QgIHhpNSwgeGk1LCB4aTAsIHhpdAotICAgICAgICAgICAgU01MQVdCICB4aTYsIHhpNiwgeGkxLCB4aXQKLSAgICAgICAgICAgIFNNTEFXVCAgeGk3LCB4aTcsIHhpMSwgeGl0ICAgICAgICAgICAgCi0gICAgICAgICAgICBNT1YgICAgIHhpNCwgeGk0LCBBU1IgI1NISUZUCi0gICAgICAgICAgICBQS0hCVCAgIHhpMCwgeGk0LCB4aTUsIExTTCAjKDE2LVNISUZUKQotICAgICAgICAgICAgTU9WICAgICB4aTYsIHhpNiwgQVNSICNTSElGVCAgICAgICAgICAgIAotICAgICAgICAgICAgUEtIQlQgICB4aTEsIHhpNiwgeGk3LCBMU0wgIygxNi1TSElGVCkKLSAgICAgICAgICAgIExEUiAgICAgeGk0LCBbcFNjYWxlLCAjNSozMi04XQotICAgICAgICAgICAgTERSICAgICB4aTUsIFtwU2NhbGUsICM1KjMyKzQtOF0KLSAgICAgICAgICAgIExEUiAgICAgeGk2LCBbcFNjYWxlLCAjMyozMi04XQotICAgICAgICAgICAgTERSICAgICB4aTcsIFtwU2NhbGUsICMzKjMyKzQtOF0gICAgICAgICAgICAKLSAgICAgICAgICAgIFNNTEFXQiAgeGk0LCB4aTQsIHhpMiwgeGl0Ci0gICAgICAgICAgICBTTUxBV1QgIHhpNSwgeGk1LCB4aTIsIHhpdAotICAgICAgICAgICAgU01MQVdCICB4aTYsIHhpNiwgeGkzLCB4aXQKLSAgICAgICAgICAgIFNNTEFXVCAgeGk3LCB4aTcsIHhpMywgeGl0ICAgICAgICAgICAgCi0gICAgICAgICAgICBNT1YgICAgIHhpNCwgeGk0LCBBU1IgI1NISUZUCi0gICAgICAgICAgICBQS0hCVCAgIHhpMiwgeGk0LCB4aTUsIExTTCAjKDE2LVNISUZUKQotICAgICAgICAgICAgTU9WICAgICB4aTYsIHhpNiwgQVNSICNTSElGVCAgICAgICAgICAgIAotICAgICAgICAgICAgUEtIQlQgICB4aTMsIHhpNiwgeGk3LCBMU0wgIygxNi1TSElGVCkKLSAgICAgICAgRU5ESUYKLSAgICAgICAgCi0gICAgICAgIExEUiAgICAgeGl0LCA9MHgwMDAxMDAwMSAgICAgICAgOy8vIHJvdW5kaW5nIGNvbnN0YW50Ci0gICAgICAgIFNBREQxNiB4aTUsIHhpMCwgeGkxICAgICAgICAgICA7Ly8gKGoxK2o3KS8yCi0gICAgICAgIFNIQUREMTYgeGk1LCB4aTUsIHhpdAotICAgICAgICAKLSAgICAgICAgU1NVQjE2ICB4aTYsIHhpMCwgeGkxICAgICAgIC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AgICAgICAgOy8vIChpNStpNykvNAotICAgICAgICAgICAgICAgIAotICAgICAgICA7Ly8geGkwLHhpMSx4aTIseGkzIG5vdyBmcmVlCi0gICAgICAgIDsvLyBJU3RhZ2UgNCwzLCByb3dzIDJ0bzMgeDEvMgotICAgICAgICAKLSAgICAgICAgTU9WICAgICB4aTMsIHhpMywgTFNMICMxCi0gICAgICAgIFBLSFRCICAgeGg1LCB4aTMsIHhpMSwgQVNSIzE1ICAgOy8vIGg1LzQKLSAgICAgICAgTERSRCAgICB4aTAsIFtwRGVzdCwgIzhdICAgICAgICA7Ly8gajIsajYgc2NhbGVkCi0gICAgICAgICAgICAgICAgCi0gICAgICAgIDsvLyBJU3RhZ2UgMiwgcm93czR0bzcKLSAgICAgICAgU1NVQjE2ICB4ZzYsIHhoNiwgeGg3Ci0gICAgICAgIFNTVUIxNiAgeGc1LCB4aDUsIHhnNiAgICAgICAgCi0gICAgICAgIFNTVUIxNiAgeGc0LCB4aDQsIHhnNQotICAgICAgICAgICAgICAgIAotICAgICAgICBTU1VCMTYgIHhpMiwgeGkwLCB4aTEgICAgICAgICAgIDsvLyAoajItajYpCi0gICAgICAgIAotICAgICAgICBTSEFERDE2IHhpMywgeGkwLCB4aTEgICAgICAgICAgIDsvLyAoajIrajYpLzIKLSAgICAgICAgCi0gICAgICAgIFNNVUxCQiAgeGkwLCB4aTIsIExvb3BSUjIKLSAgICAgICAgU01VTFRCICB4aTIsIHhpMiwgTG9vcFJSMgotICAgICAgICAKLSAgICAgICAgTU9WICAgICB4aTIsIHhpMiwgTFNMICMxCi0gICAgICAgIFBLSFRCICAgeGgyLCB4aTIsIHhpMCwgQVNSIzE1ICAgOy8vIGkyKnNxcnQoMikvNAotICAgICAgICAKLSAgICAgICAgOy8vIHhpMCwgeGkxIG5vdyBmcmVlCi0gICAgICAgIDsvLyBJU3RhZ2UgNCwzIHJvd3MgMHRvMSB4IDEvMgotICAgICAgICBMRFJEICAgIHhpMCwgW3BEZXN0XSAgICAgICA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HhmMiwgeGYzLCBMU0wgIzE2Ci0gICAgICAgIFBLSFRCICAgcmIyMywgeGYzLCB4ZjIsIEFTUiAjMTYKLSAgICAgICAgCi0gICAgICAgIFBLSEJUICAgcmE0NSwgeGY0LCB4ZjUsIExTTCAjMTYKLSAgICAgICAgUEtIVEIgICByYjQ1LCB4ZjUsIHhmNCwgQVNSICMxNgotICAgICAgICAKLSAgICAgICAgUEtIQlQgICByYTY3LCB4ZjYsIHhmNywgTFNMICMxNgotICAgICAgICBTVE1JQSAgIHBEZXN0ISwge3JhMDEsIHJhMjMsIHJhNDUsIHJhNjd9ICAgICAgCi0gICAgICAgIFBLSFRCICAgcmI2NywgeGY3LCB4ZjYsIEFTUiAjMTYKLSAgICAgICAgU1RNSUEgICBwRGVzdCEsIHtyYjAxLCByYjIzLCByYjQ1LCByYjY3fSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAotICAgICAgICBCQ0MgICAgIHY2X2lkY3RfY29sJF9GCi0gICAgICAgIAotICAgICAgICBTVUIgICAgIHBTcmMsIHBEZXN0LCAjKDY0KjIpCi0gICAgICAgIE1fTERSICAgcERlc3QsIHBwRGVzdAotICAgICAgICBJRiAiJHN0cmlkZSI9InMiCi0gICAgICAgICAgICBNX0xEUiAgIHBTY2FsZSwgcFN0cmlkZSAKLSAgICAgICAgRU5ESUYKLSAgICAgICAgQiAgICAgICB2Nl9pZGN0X3JvdyRfRgotICAgICAgICAKLXY2T2RkWmVybyRfRgotICAgICAgICBTU1VCMTYgIHhpMiwgeGk2LCB4aTcgICAgICAgICAgIDsvLyAoajItajYpCi0gICAgICAgIFNIQUREMTYgeGkzLCB4aTYsIHhpNyAgICAgICAgICAgOy8vIChqMitqNikvMgotICAgICAgICAKLSAgICAgICAgU01VTEJCICB4aTAsIHhpMiwgTG9vcFJSMgotICAgICAgICBTTVVMVEIgIHhpMiwgeGkyLCBMb29wUlIyCi0gICAgICAgIAotICAgICAgICBNT1YgICAgIHhpMiwgeGkyLCBMU0wgIz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AgICAgUEtIVEIgICByYjIzLCB4ZjMsIHhmMiwgQVNSICMxNgotICAgICAgICAKLSAgICAgICAgUEtIQlQgICByYTQ1LCB4ZjQsIHhmNSwgTFNMICMxNgotICAgICAgICBQS0hUQiAgIHJiNDUsIHhmNSwgeGY0LCBBU1IgIzE2Ci0gICAgICAgIAotICAgICAgICBQS0hCVCAgIHJhNjcsIHhmNiwgeGY3LCBMU0wgIzE2Ci0gICAgICAgIFBLSFRCICAgcmI2NywgeGY3LCB4ZjYsIEFTUiAjMTYKLSAgICAgICAgICAgICAgICAKLSAgICAgICAgU1RNSUEgICBwRGVzdCEsIHtyYTAxLCByYTIzLCByYTQ1LCByYTY3fSAgICAgIAotICAgICAgICBBRERTICAgIExvb3BSUjIsIExvb3BSUjIsICMyPDwyOSAgICA7Ly8gZG9uZSB0d28gcm93cwotICAgICAgICBTVE1JQSAgIHBEZXN0ISwge3JiMDEsIHJiMjMsIHJiNDUsIHJiNjd9ICAgICAgCi0gICAgICAgIAotICAgICAgICBCQ0MgICAgIHY2X2lkY3RfY29sJF9GCi0gICAgICAgIFNVQiAgICAgcFNyYywgcERlc3QsICMoNjQqMikKLSAgICAgICAgTV9MRFIgICBwRGVzdCwgcHBEZXN0Ci0gICAgICAgIElGICIkc3RyaWRlIj0icyIKLSAgICAgICAgICAgIE1fTERSICAgcFNjYWxlLCBwU3RyaWRlIAotICAgICAgICBFTkRJRgotICAgICAgICAgICAgICAgCi0gICAgICAgIAotdjZfaWRjdF9yb3ckX0YKLSAgICAgICAgOy8vIElTdGFnZSA0LDMsIHJvd3M0dG83IHgxLzQKLSAgICAgICAgTERSICAgICB4aXQsID0weDAwMDEwMDAxICAgICAgICA7Ly8gcm91bmRpbmcgY29uc3RhbnQKLSAgICAgICAgTERSICAgICB4aTAsIFtwU3JjLCAjMSoxNl0gICAgICA7Ly8gajEKLSAgICAgICAgTERSICAgICB4aTEsIFtwU3JjLCAjNyoxNl0gICAgICA7Ly8gNCpqNwotICAgICAgICBMRFIgICAgIHhpMiwgW3BTcmMsICM1KjE2XSAgICAgIDsvLyBqNQotICAgICAgICBMRFIgICAgIHhpMywgW3BTcmMsICMzKjE2XSAgICAgIDsvLyBqMwotICAgICAgICAKLSAgICAgICAgU0hBREQxNiB4aTEsIHhpMSwgeGl0ICAgICAgICAgICA7Ly8gMipqNwotICAgICAgICBTSEFERDE2IHhpMSwgeGkxLCB4aXQgICAgICAgICAgIDsvLyBqNyAgICAgICAgICAgICAgICAKLSAgICAgICAgCi0gICAgICAgIFNIQUREMTYgeGk1LCB4aTAsIHhpMSAgICAgICAgICAgOy8vIChqMStqNykvMgotICAgICAgICBTU1VCMTYgIHhpNiwgeGkwLCB4aTEgICAgICAgICAgIDsvLyBqMS1qNwotICAgICAgICBTSEFERDE2IHhpNywgeGkyLCB4aTMgICAgICAgICAgIDsvLyAoajUrajMpLzIKLSAgICAgICAgU1NVQjE2ICB4aTQsIHhpMiwgeGkzICAgICAgICAgICA7Ly8gajUtajMKLSAgICAgICAgCi0gICAgICAgIFNTVUIxNiAgeGkzLCB4aTUsIHhpNyAgICAgICAgICAgOy8vIChpNS1pNykvMgotICAgICAgICAKLSAgICAgICAgUEtIQlQgICB4aTAsIHhpNiwgeGk0LCBMU0wjMTYgICA7Ly8gW2k0LGk2XSByb3cgYQotICAgICAgICBQS0hUQiAgIHhpMSwgeGk0LCB4aTYsIEFTUiMxNiAgIDsvLyBbaTQsaTZdIHJvdyBiCi0gICAgICAgIAotICAgICAgICBTTVVBRFggIHhpMiwgeGkwLCBjc1BpQnk4ICAgICAgIDsvLyByb3dhIGJ5IFtjLHNdCi0gICAgICAgIFNNVUFEWCAgeGk0LCB4aTEsIGNzUGlCeTggICAgICAgOy8vIHJvd2IgYnkgW2Msc10KLSAgICAgICAgU01VU0QgICB4aTAsIHhpMCwgY3NQaUJ5OCAgICAgICA7Ly8gcm93YSBieSBbLXMsY10gICAKLSAgICAgICAgU01VU0QgICB4aTYsIHhpMSwgY3NQaUJ5OCAgICAgICA7Ly8gcm93YiBieSBbLXMsY10KLSAgICAgICAgICAgICAgICAKLSAgICAgICAgU01VTEJCICB4aTEsIHhpMywgTG9vcFJSMgotICAgICAgICBTTVVMVEIgIHhpMywgeGkzLCBMb29wUlIyCi0gICAgICAgICAgICAgICAgCi0gICAgICAgIFBLSFRCICAgeGg0LCB4aTQsIHhpMiwgQVNSIzE2ICAgOy8vIGg0LzQKLSAgICAgICAgUEtIVEIgICB4aDYsIHhpNiwgeGkwLCBBU1IjMTYgICA7Ly8gaDYvNAotICAgICAgICBTSEFERDE2IHhoNywgeGk1LCB4aTcgICAgICAgICAgIDsvLyAoaTUraTcpLzQKLSAgICAgICAgCi0gICAgICAgIE1PViAgICAgeGkzLCB4aTMsIExTTCAjMQotICAgICAgICBQS0hUQiAgIHhoNSwgeGkzLCB4aTEsIEFTUiMxNSAgIDsvLyBoNS80Ci0gICAgICAgICAgICAgICAKLSAgICAgICAgOy8vIHhpMCx4aTEseGkyLHhpMyBub3cgZnJlZQotICAgICAgICA7Ly8gSVN0YWdlIDQsMywgcm93cyAydG8zIHgxLzIKLSAgICAgICAgCi0gICAgICAgIExEUiAgICAgeGkwLCBbcFNyYywgIzIqMTZdICAgICAgOy8vIGoyCi0gICAgICAgIExEUiAgICAgeGkxLCBbcFNyYywgIzYqMTZdICAgICAgOy8vIDIqajYKLSAgICAgICAgCi0gICAgICAgIDsvLyBJU3RhZ2UgMiwgcm93czR0bzcKLSAgICAgICAgU1NVQjE2ICB4ZzYsIHhoNiwgeGg3Ci0gICAgICAgIFNTVUIxNiAgeGc1LCB4aDUsIHhnNgotICAgICAgICBTU1VCMTYgIHhnNCwgeGg0LCB4ZzUKLSAgICAgICAgCi0gICAgICAgIFNIQUREMTYgeGkxLCB4aTEsIHhpdCAgICAgICAgICAgOy8vIGo2Ci0gICAgICAgIFNTVUIxNiAgeGkyLCB4aTAsIHhpMSAgICAgICAgICAgOy8vIChqMi1qNikgICAgICAgIAotICAgICAgICBTSEFERDE2IHhpMywgeGkwLCB4aTEgICAgICAgICAgIDsvLyAoajIrajYpLzIKLSAgICAgICAgCi0gICAgICAgIFNNVUxCQiAgeGkwLCB4aTIsIExvb3BSUjIKLSAgICAgICAgU01VTFRCICB4aTIsIHhpMiwgTG9vcFJSMgotICAgICAgICAKLSAgICAgICAgTU9WICAgICB4aTIsIHhpMiwgTFNMICMxCi0gICAgICAgIAotICAgICAgICBQS0hUQiAgIHhoMiwgeGkyLCB4aTAsIEFTUiMxNSAgIDsvLyBpMipzcXJ0KDIpLzQKLSAgICAgICAgCi0gICAgICAgIDsvLyB4aTAsIHhpMSBub3cgZnJlZQotICAgICAgICA7Ly8gSVN0YWdlIDQsMyByb3dzIDB0bzEgeCAxLzIKLSAgICAgICAgTERSICAgICB4aTEsIFtwU3JjLCAjNCoxNl0gICAgICA7Ly8gajQKLSAgICAgICAgTERSICAgICB4aTAsIFtwU3JjXSwgIzQgICAgICAgICA7Ly8gajAKLQotICAgICAgICBTU1VCMTYgIHhoMiwgeGgyLCB4aTMKLSAgICAgICAgQUREUyAgICBMb29wUlIyLCBMb29wUlIyLCAjMjw8MjkgICAgOy8vIGRvbmUgdHdvIHJvd3MKLSAgICAgICAgCi0gICAgICAgIEFERCAgICAgeGkwLCB4aTAsIHhpdCwgTFNMICMyICAgOy8vIGVuc3VyZSBjb3JyZWN0IHJvdW5kCi0gICAgICAgIFNIQUREMTYgeGgwLCB4aTAsIHhpMSAgICAgICAgICAgOy8vIG9mIERDIHJlc3VsdAotICAgICAgICBTSFNVQjE2IHhoMSwgeGkwLCB4aTEKLSAgICAgICAgICAgICAgICAKLSAgICAgICAgOy8vIElTdGFnZSAyIHJvd3MgMHRvMyB4IDEvMgotICAgICAgICBTSFNVQjE2IHhnMiwgeGgxLCB4aDIKLSAgICAgICAgU0hBREQxNiB4ZzEsIHhoMSwgeGgyCi0gICAgICAgIFNIU1VCMTYgeGczLCB4aDAsIHhoMwotICAgICAgICBTSEFERDE2IHhnMCwgeGgwLCB4aDMKLSAgICAg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VzdCwgcERlc3QsIHBTY2FsZQotICAgICAgICAgICAgRUxTRSAgICAgICAgICAgICAgICAKLSAgICAgICAgICAgICAgICBBREQgICAgIHBEZXN0LCBwRGVzdCwgIygkc3RyaWRlKQotICAgICAgICAgICAgICAgIFNUTUlBICAgcERlc3QsIHtyYjAxLCByYjIzfQotICAgICAgICAgICAgICAgIEFERCAgICAgcERlc3QsIHBEZXN0LCAjKCRzdHJpZGUpCi0gICAgICAgICAgICBFTkRJRgotICAgICAgICBFTkRJRgotICAgICAgICBJRiAoIiRvdXRzaXplIj0iczkiKTpMT1I6KCIkb3V0c2l6ZSI9InMxNiIpICAgICAgICAKLSAgICAgICAgICAgIFBLSEJUICAgcmEwMSwgeGYwLCB4ZjEsIExTTCAjMTYKLSAgICAgICAgICAgIFBLSFRCICAgcmIwMSwgeGYxLCB4ZjAsIEFTUiAjMTYKLSAgICAgICAgCi0gICAgICAgICAgICBQS0hCVCAgIHJhMjMsIHhmMiwgeGYzLCBMU0wgIzE2Ci0gICAgICAgICAgICBQS0hUQiAgIHJiMjMsIHhmMywgeGYyLCBBU1IgIzE2Ci0gICAgICAgICAgICAKLSAgICAgICAgICAgIFBLSEJUICAgcmE0NSwgeGY0LCB4ZjUsIExTTCAjMTYKLSAgICAgICAgICAgIFBLSFRCICAgcmI0NSwgeGY1LCB4ZjQsIEFTUiAjMTYKLSAgICAgICAgICAgIAotICAgICAgICAgICAgUEtIQlQgICByYTY3LCB4ZjYsIHhmNywgTFNMICMxNgotICAgICAgICAgICAgUEtIVEIgICByYjY3LCB4ZjcsIHhmNiwgQVNSICMxNgotICAgICAgICAgICAgCi0gICAgICAgICAgICBTVE1JQSAgIHBEZXN0LCB7cmEwMSwgcmEyMywgcmE0NSwgcmE2N30gICAgICAKLSAgICAgICAgICAgIElGICIkc3RyaWRlIj0icyIKLSAgICAgICAgICAgICAgICBBREQgICAgIHBEZXN0LCBwRGVzdCwgcFNjYWxlCi0gICAgICAgICAgICAgICAgU1RNSUEgICBwRGVzdCwge3JiMDEsIHJiMjMsIHJiNDUsIHJiNjd9ICAgICAgCi0gICAgICAgICAgICAgICAgQUREICAgICBwRGVzdCwgcERlc3QsIHBTY2FsZQotICAgICAgICAgICAgRUxTRSAgICAgICAgICAgICAgICAKLSAgICAgICAgICAgICAgICBBREQgICAgIHBEZXN0LCBwRGVzdCwgIygkc3RyaWRlKQotICAgICAgICAgICAgICAgIFNUTUlBICAgcERlc3QsIHtyYjAxLCByYjIzLCByYjQ1LCByYjY3fSAgICAgIAotICAgICAgICAgICAgICAgIEFERCAgICAgcERlc3QsIHBEZXN0LCAjKCRzdHJpZGUpCi0gICAgICAgICAgICBFTkRJRgotICAgICAgICBFTkRJRgotICAgICAgICAKLSAgICAgICAgQkNDICAgICB2Nl9pZGN0X3JvdyRfRgotICAgICAgICBFTkRJRiA7Ly8gQVJNMTEzNkpTCi0KLQotICAgICAgICBJRiBDb3J0ZXhBOAotICAgICAgICAKLVNyYzAgICAgICAgICAgICBFUVUgIDcgICAgICAgICAgICAgIAotU3JjMSAgICAgICAgICAgIEVRVSAgOCAgICAgICAgICAgICAgCi1TcmMyICAgICAgICAgICAgRVFVICA5ICAgICAgICAgICAgICAKLVNyYzMgICAgICAgICAgICBFUVUgIDEwICAgICAgICAgICAgICAKLVNyYzQgICAgICAgICAgICBFUVUgIDExICAgICAgICAgICAgICAKLVNyYzUgICAgICAgICAgICBFUVUgIDEyICAgICAgICAgICAgICAKLVNyYzYgICAgICAgICAgICBFUVUgIDEzCi1TcmM3ICAgICAgICAgICAgRVFVICAxNAotVG1wICAgICAgICAgICAgIEVRVSAgMTUKLQotcVhqMCAgICAgICAgICAgIFFOIFNyYzAuUzE2IAotcVhqMSAgICAgICAgICAgIFFOIFNyYzEuUzE2Ci1xWGoyICAgICAgICAgICAgUU4gU3JjMi5TMTYKLXFYajMgICAgICAgICAgICBRTiBTcmMzLlMxNgotcVhqNCAgICAgICAgICAgIFFOIFNyYzQuUzE2Ci1xWGo1ICAgICAgICAgICAgUU4gU3JjNS5TMTYKLXFYajYgICAgICAgICAgICBRTiBTcmM2LlMxNgotcVhqNyAgICAgICAgICAgIFFOIFNyYzcuUzE2Ci1xWGp0ICAgICAgICAgICAgUU4gVG1wLlMxNgotCi1kWGowbG8gICAgICAgICAgRE4gKFNyYzAqMikuUzE2Ci1kWGowaGkgICAgICAgICAgRE4gKFNyYzAqMisxKS5TMTYKLWRYajFsbyAgICAgICAgICBETiAoU3JjMSoyKS5TMTYKLWRYajFoaSAgICAgICAgICBETiAoU3JjMSoyKzEpLlMxNgotZFhqMmxvICAgICAgICAgIEROIChTcmMyKjIpLlMxNgotZFhqMmhpICAgICAgICAgIEROIChTcmMyKjIrMSkuUzE2Ci1kWGozbG8gICAgICAgICAgRE4gKFNyYzMqMikuUzE2Ci1kWGozaGkgICAgICAgICAgRE4gKFNyYzMqMisxKS5TMTYKLWRYajRsbyAgICAgICAgICBETiAoU3JjNCoyKS5TMTYKLWRYajRoaSAgICAgICAgICBETiAoU3JjNCoyKzEpLlMxNgotZFhqNWxvICAgICAgICAgIEROIChTcmM1KjIpLlMxNgotZFhqNWhpICAgICAgICAgIEROIChTcmM1KjIrMSkuUzE2Ci1kWGo2bG8gICAgICAgICAgRE4gKFNyYzYqMikuUzE2Ci1kWGo2aGkgICAgICAgICAgRE4gKFNyYzYqMisxKS5TMTYKLWRYajdsbyAgICAgICAgICBETiAoU3JjNyoyKS5TMTYKLWRYajdoaSAgICAgICAgICBETiAoU3JjNyoyKzEpLlMxNgotZFhqdGxvICAgICAgICAgIEROIChUbXAqMikuUzE2Ci1kWGp0aGkgICAgICAgICAgRE4gKFRtcCoyKzEpLlMxNgotCi1xWGkwICAgICAgICAgICAgUU4gcVhqMAotcVhpMSAgICAgICAgICAgIFFOIHFYajQKLXFYaTIgICAgICAgICAgICBRTiBxWGoyCi1xWGkzICAgICAgICAgICAgUU4gcVhqNwotcVhpNCAgICAgICAgICAgIFFOIHFYajUKLXFYaTUgICAgICAgICAgICBRTiBxWGp0Ci1xWGk2ICAgICAgICAgICAgUU4gcVhqMQotcVhpNyAgICAgICAgICAgIFFOIHFYajYKLXFYaXQgICAgICAgICAgICBRTiBxWGozCi0KLWRYaTBsbyAgICAgICAgICBETiBkWGowbG8KLWRYaTBoaSAgICAgICAgICBETiBkWGowaGkKLWRYaTFsbyAgICAgICAgICBETiBkWGo0bG8KLWRYaTFoaSAgICAgICAgICBETiBkWGo0aGkKLWRYaTJsbyAgICAgICAgICBETiBkWGoybG8KLWRYaTJoaSAgICAgICAgICBETiBkWGoyaGkKLWRYaTNsbyAgICAgICAgICBETiBkWGo3bG8KLWRYaTNoaSAgICAgICAgICBETiBkWGo3aGkKLWRYaTRsbyAgICAgICAgICBETiBkWGo1bG8KLWRYaTRoaSAgICAgICAgICBETiBkWGo1aGkKLWRYaTVsbyAgICAgICAgICBETiBkWGp0bG8KLWRYaTVoaSAgICAgICAgICBETiBkWGp0aGkKLWRYaTZsbyAgICAgICAgICBETiBkWGoxbG8KLWRYaTZoaSAgICAgICAgICBETiBkWGoxaGkKLWRYaTdsbyAgICAgICAgICBETiBkWGo2bG8KLWRYaTdoaSAgICAgICAgICBETiBkWGo2aGkKLWRYaXRsbyAgICAgICAgICBETiBkWGozbG8KLWRYaXRoaSAgICAgICAgICBETiBkWGozaGkKLQotcVhoMCAgICAgICAgICAgIFFOIHFYaXQKLXFYaDEgICAgICAgICAgICBRTiBxWGkwCi1xWGgyICAgICAgICAgICAgUU4gcVhpMgotcVhoMyAgICAgICAgICAgIFFOIHFYaTMKLXFYaDQgICAgICAgICAgICBRTiBxWGk3Ci1xWGg1ICAgICAgICAgICAgUU4gcVhpNQotcVhoNiAgICAgICAgICAgIFFOIHFYaTQKLXFYaDcgICAgICAgICAgICBRTiBxWGkxCi1xWGh0ICAgICAgICAgICAgUU4gcVhpNgotCi1kWGgwbG8gICAgICAgICAgRE4gZFhpdGxvCi1kWGgwaGkgICAgICAgICAgRE4gZFhpdGhpCi1kWGgxbG8gICAgICAgICAgRE4gZFhpMGxvCi1kWGgxaGkgICAgICAgICAgRE4gZFhpMGhpCi1kWGgybG8gICAgICAgICAgRE4gZFhpMmxvCi1kWGgyaGkgICAgICAgICAgRE4gZFhpMmhpCi1kWGgzbG8gICAgICAgICAgRE4gZFhpM2xvCi1kWGgzaGkgICAgICAgICAgRE4gZFhpM2hpCi1kWGg0bG8gICAgICAgICAgRE4gZFhpN2xvCi1kWGg0aGkgICAgICAgICAgRE4gZFhpN2hpCi1kWGg1bG8gICAgICAgICAgRE4gZFhpNWxvCi1kWGg1aGkgICAgICAgICAgRE4gZFhpNWhpCi1kWGg2bG8gICAgICAgICAgRE4gZFhpNGxvCi1kWGg2aGkgICAgICAgICAgRE4gZFhpNGhpCi1kWGg3bG8gICAgICAgICAgRE4gZFhpMWxvCi1kWGg3aGkgICAgICAgICAgRE4gZFhpMWhpCi1kWGh0bG8gICAgICAgICAgRE4gZFhpNmxvCi1kWGh0aGkgICAgICAgICAgRE4gZFhpNmhpCi0KLXFYZzAgICAgICAgICAgICBRTiBxWGgyCi1xWGcxICAgICAgICAgICAgUU4gcVhodAotcVhnMiAgICAgICAgICAgIFFOIHFYaDEKLXFYZzMgICAgICAgICAgICBRTiBxWGgwCi1xWGc0ICAgICAgICAgICAgUU4gcVhoNAotcVhnNSAgICAgICAgICAgIFFOIHFYaDUKLXFYZzYgICAgICAgICAgICBRTiBxWGg2Ci1xWGc3ICAgICAgICAgICAgUU4gcVhoNwotcVhndCAgICAgICAgICAgIFFOIHFYaDMKLQotcVhmMCAgICAgICAgICAgIFFOIHFYZzYKLXFYZjEgICAgICAgICAgICBRTiBxWGc1Ci1xWGYyICAgICAgICAgICAgUU4gcVhnNAotcVhmMyAgICAgICAgICAgIFFOIHFYZ3QKLXFYZjQgICAgICAgICAgICBRTiBxWGczCi1xWGY1ICAgICAgICAgICAgUU4gcVhnMgotcVhmNiAgICAgICAgICAgIFFOIHFYZzEKLXFYZjcgICAgICAgICAgICBRTiBxWGcwCi1xWGZ0ICAgICA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UTE1Ci1DICAgICAgICAgICAgICAgRE4gZENvZWZzWzJdICAgIDsvLyBDb3MoUEkvOCkgaW4gUTE1Ci0KLXBUZW1wICAgICAgICAgICBSTiAxMgotCi0gICAgICAgICAgICAgICAgCi0gICAgICAgIElNUE9SVCAgYXJtQ09NTV9JRENUQ29lZgotICAgICAgICAgICAgICAgICAgICAKLSAgICAgICAgVkxEMSAgICAgICAge3FYajAscVhqMX0sIFtwU3JjIEA2NF0hCi0gICAgICAgIFZMRDEgICAgICAgIHtxWGoyLHFYajN9LCBbcFNyYyBANjRdIQotICAgICAgICBWTEQxICAgICAgICB7cVhqNCxxWGo1fSwgW3BTcmMgQDY0XSEKLSAgICAgICAgVkxEMSAgICAgICAge3FYajYscVhqN30sIFtwU3JjIEA2NF0hCi0gICAgICAgIAotICAgICAgICA7Ly8gTG9hZCBQcmVTY2FsZSBhbmQgbXVsdGlwbHkgd2l0aCBTcmMKLSAgICAgICAgOy8vIElTdGFnZSA0Ci0gICAgICAgIAotICAgICAgICBJRiAiJGluc2NhbGUiPSJzMTYiICAgICAgICAgICAgICAgICAgICAgICAgIDsvLyAxNlgxNiBNdWwKLSAgICAgICAgICAgIE1fSURDVF9QUkVTQ0FMRTE2Ci0gICAgICAgIEVORElGCi0gICAgICAgIAotICAgICAgICBJRiAiJGluc2NhbGUiPSJzMzIiICAgICAgICAgICAgICAgICAgICAgICAgIDsvLyAzMlgzMiAsdWwKLSAgICAgICAgICAgIE1fSURDVF9QUkVTQ0FMRTMyCi0gICAgICAgIEVORElGCi0KLSAgICAgICAgOy8vIElTdGFnZSAzCi0gICAgICAgIFZRRE1VTEggICAgIHFYaTIsIHFYaTIsIEludlNxcnQyICAgICAgICAgICAgOy8vIGkyL3NxcnQoMikKLSAgICAgICAgVkhBREQgICAgICAgcVhoMCwgcVhpMCwgcVhpMSAgICAgICAgICAgICAgICA7Ly8gKGkwK2kxKS8yCi0gICAgICAgIFZIU1VCICAgICAgIHFYaDEsIHFYaTAsIHFYaTEgICAgICAgICAgICAgICAgOy8vIChpMC1pMSkvMgotICAgICAgICBWSEFERCAgICAgICBxWGg3LCBxWGk1LCBxWGk3ICAgICAgICAgICAgICAgIDsvLyAoaTUraTcpLzQKLSAgICAgICAgVlNVQiAgICAgICAgcVhoNSwgcVhpNSwgcVhpNyAgICAgICAgICAgICAgICA7Ly8gKGk1LWk3KS8yCi0gICAgICAgIFZRRE1VTEggICAgIHFYaDUsIHFYaDUsIEludlNxcnQyICAgICAgICAgICAgOy8vIGg1L3NxcnQoMikKLSAgICAgICAgVlNVQiAgICAgICAgcVhoMiwgcVhpMiwgcVhpMyAgICAgICAgICAgICAgICA7Ly8gaDIsIGgzCi0KLSAgICAgICAgVk1VTEwgICAgICAgcVh0MCwgZFhpNGxvLCBDICAgICAgICAgICAgICAgICA7Ly8gYyppNAotICAgICAgICBWTUxBTCAgICAgICBxWHQwLCBkWGk2bG8sIFMgICAgICAgICAgICAgICAgIDsvLyBjKmk0K3MqaTYKLSAgICAgICAgVk1VTEwgICAgICAgcVh0MSwgZFhpNGhpLCBDCi0gICAgICAgIFZNTEFMICAgICAgIHFYdDEsIGRYaTZoaSwgUwotICAgICAgICBWU0hSTiAgICAgICBkWGg0bG8sIHFYdDAsICMxNiAgICAgICAgICAgICAgIDsvLyBoNAotICAgICAgICBWU0hSTiAgICAgICBkWGg0aGksIHFYdDEsICMxNgotICAgICAgICAKLSAgICAgICAgVk1VTEwgICAgICAgcVh0MCwgZFhpNmxvLCBDICAgICAgICAgICAgICAgICA7Ly8gYyppNgotICAgICAgICBWTUxTTCAgICAgICBxWHQwLCBkWGk0bG8sIFMgICAgICAgICAgICAgICAgIDsvLyAtcyppNCArIGMqaDYKLSAgICAgICAgVk1VTEwgICAgICAgcVh0MSwgZFhpNmhpLCBDCi0gICAgICAgIFZNTFNMICAgICAgIHFYdDEsIGRYaTRoaSwgUwotICAgICAgICBWU0hSTiAgICAgICBkWGg2bG8sIHFYdDAsICMxNiAgICAgICAgICAgICAgIDsvLyBoNgotICAgICAgICBWU0hSTiAgICAgICBkWGg2aGksIHFYdDEsICMxNgotICAgICAgICAKLSAgICAgICAgOy8vIElTdGFnZSAyCi0gICAgICAgIFZTVUIgICAgICAgIHFYZzYsIHFYaDYsIHFYaDcKLSAgICAgICAgVlNVQiAgICAgICAgcVhnNSwgcVhoNSwgcVhnNgotICAgICAgICBWU1VCICAgICAgICBxWGc0LCBxWGg0LCBxWGc1Ci0gICAgICAgIFZIQUREICAgICAgIHFYZzEsIHFYaDEsIHFYaDIgICAgICAgIDsvLyAoaDEraDIpLzIKLSAgICAgICAgVkhTVUIgICAgICAgcVhnMiwgcVhoMSwgcVhoMiAgICAgICAgOy8vIChoMS1oMikvMgotICAgICAgICBWSEFERCAgICAgICBxWGcwLCBxWGgwLCBxWGgzICAgICAgICA7Ly8gKGgwK2gzKS8yCi0gICAgICAgIFZIU1VCICAgICAgIHFYZzMsIHFYaDAsIHFYaDMgICAgICAgIDsvLyAoaDAtaDMpLzIKLQotICAgICAgICA7Ly8gSVN0YWdlIDEgYWxsIHJvd3MKLSAgICAgICAgVkFERCAgICAgICAgcVhmMywgcVhnMywgcVhnNCAgICAgICAgCi0gICAgICAgIFZTVUIgICAgICAgIHFYZjQsIHFYZzMsIHFYZzQgICAgICAgIAotICAgICAgICBWQUREICAgICAgICBxWGYyLCBxWGcyLCBxWGc1ICAgICAgICAKLSAgICAgICAgVlNVQiAgICAgICAgcVhmNSwgcVhnMiwgcVhnNSAgICAgICAgCi0gICAgICAgIFZBREQgICAgICAgIHFYZjEsIHFYZzEsIHFYZzYKLSAgICAgICAgVlNVQiAgICAgICAgcVhmNiwgcVhnMSwgcVhnNiAgICAgICAgCi0gICAgICAgIFZBREQgICAgICAgIHFYZjAsIHFYZzAsIHFYZzcKLSAgICAgICAgVlNVQiAgICAgICAgcVhmNywgcVhnMCwgcVhnNyAgICAgIAotCi0gICAgICAgIDsvLyBUcmFuc3Bvc2UsIHN0b3JlIGFuZCBsb29wCi1YVFIwICAgICAgICAgICAgRVFVIFNyYzUKLVhUUjEgICAgICAgICAgICBFUVUgVG1wCi1YVFIyICAgICAgICAgICAgRVFVIFNyYzYKLVhUUjMgICAgICAgICAgICBFUVUgU3JjNwotWFRSNCAgICAgICAgICAgIEVRVSBTcmMzCi1YVFI1ICAgICAgICAgICAgRVFVIFNyYzAKLVhUUjYgICAgICAgICAgICBFUVUgU3JjMQotWFRSNyAgICAgICAgICAgIEVRVSBTcmMyCi1YVFJ0ICAgICAgICAgICAgRVFVIFNyYzQKLSAgICAgICAgICAgICAgICAKLXFBMCAgICAgICAgICAgICBRTiAgWFRSMC5TMzIgIDsvLyBmb3IgWFRScG9zZQotcUExICAgICAgICAgICAgIFFOICBYVFIxLlMzMgotcUEyICAgICAgICAgICAgIFFOICBYVFIyLlMzMgotcUEzICAgICAgICAgICAgIFFOICBYVFIzLlMzMgotcUE0ICAgICAgICAgICAgIFFOICBYVFI0LlMzMgotcUE1ICAgICAgICAgICAgIFFOICBYVFI1LlMzMgotcUE2ICAgICAgICAgICAgIFFOICBYVFI2LlMzMgotcUE3ICAgICAgICAgICAgIFFOICBYVFI3LlMzMgotCi1kQjAgICAgICAgICAgICAgRE4gIFhUUjAqMisxICAgICAgOy8vIGZvciB1c2luZyBWU1dQCi1kQjEgICAgICAgICAgICAgRE4gIFhUUjEqMisxCi1kQjIgICAgICAgICAgICAgRE4gIFhUUjIqMisxCi1kQjMgICAgICAgICAgICAgRE4gIFhUUjMqMisxCi1kQjQgICAgICAgICAgICAgRE4gIFhUUjQqMgotZEI1ICAgICAgICAgICAgIEROICBYVFI1KjIKLWRCNiAgICAgICAgICAgICBETiAgWFRSNioyCi1kQjcgICAgICAgICAgICAgRE4gIFhUUjcqMgotCi0gICAgICAgICAgCi0gICAgICAgIFZUUk4gICAgICAgIHFYZjAsIHFYZjEKLSAgICAgICAgVlRSTiAgICAgICAgcVhmMiwgcVhmMwotICAgICAgICBWVFJOICAgICAgICBxWGY0LCBxWGY1Ci0gICAgICAgIFZUUk4gICAgICAgIHFYZjYsIHFYZjcKLSAgICAgICAgVlRSTiAgICAgICAgcUEwLCBxQTIKLSAgICAgICAgVlRSTiAgICAgICAgcUExLCBxQTMKLSAgICAgICAgVlRSTiAgICAgICAgcUE0LCBxQTYKLSAgICAgICAgVlRSTiAgICAgICAgcUE1LCBxQTcgICAgICAgIAotICAgICAgICBWU1dQICAgICAgICBkQjAsIGRCNAotICAgICAgICBWU1dQICAgICAgICBkQjEsIGRCNQotICAgICAgICBWU1dQICAgICAgICBkQjIsIGRCNgotICAgICAgICBWU1dQICAgICAgICBkQjMsIGRCNwotICAgICAgICAKLQotcVlqMCAgICAgICAgICAgIFFOIHFYZjAKLXFZajEgICAgICAgICAgICBRTiBxWGYxCi1xWWoyICAgICAgICAgICAgUU4gcVhmMgotcVlqMyAgICAgICAgICAgIFFOIHFYZjMKLXFZajQgICAgICAgICAgICBRTiBxWGY0Ci1xWWo1ICAgICAgICAgICAgUU4gcVhmNQotcVlqNiAgICAgICAgICAgIFFOIHFYZjYKLXFZajcgICAgICAgICAgICBRTiBxWGY3Ci1xWWp0ICAgICAgICAgICAgUU4gcVhmdAotCi1kWWowbG8gICAgICAgICAgRE4gKFhUUjAqMikuUzE2Ci1kWWowaGkgICAgICAgICAgRE4gKFhUUjAqMisxKS5TMTYKLWRZajFsbyAgICAgICAgICBETiAoWFRSMSoyKS5TMTYKLWRZajFoaSAgICAgICAgICBETiAoWFRSMSoyKzEpLlMxNgotZFlqMmxvICAgICAgICAgIEROIChYVFIyKjIpLlMxNgotZFlqMmhpICAgICAgICAgIEROIChYVFIyKjIrMSkuUzE2Ci1kWWozbG8gICAgICAgICAgRE4gKFhUUjMqMikuUzE2Ci1kWWozaGkgICAgICAgICAgRE4gKFhUUjMqMisxKS5TMTYKLWRZajRsbyAgICAgICAgICBETiAoWFRSNCoyKS5TMTYKLWRZajRoaSAgICAgICAgICBETiAoWFRSNCoyKzEpLlMxNgotZFlqNWxvICAgICAgICAgIEROIChYVFI1KjIpLlMxNgotZFlqNWhpICAgICAgICAgIEROIChYVFI1KjIrMSkuUzE2Ci1kWWo2bG8gICAgICAgICAgRE4gKFhUUjYqMikuUzE2Ci1kWWo2aGkgICAgICAgICAgRE4gKFhUUjYqMisxKS5TMTYKLWRZajdsbyAgICAgICAgICBETiAoWFRSNyoyKS5TMTYKLWRZajdoaSAgICAgICAgICBETiAoWFRSNyoyKzEpLlMxNgotZFlqdGxvICAgICAgICAgIEROIChYVFJ0KjIpLlMxNgotZFlqdGhpICAgICAgICAgIEROIChYVFJ0KjIrMSkuUzE2Ci0KLXFZaTAgICAgICAgICAgICBRTiBxWWowCi1xWWkxICAgICAgICAgICAgUU4gcVlqNAotcVlpMiAgICAgICAgICAgIFFOIHFZajIKLXFZaTMgICAgICAgICAgICBRTiBxWWo3Ci1xWWk0ICAgICAgICAgICAgUU4gcVlqNQotcVlpNSAgICAgICAgICAgIFFOIHFZanQKLXFZaTYgICAgICAgICAgICBRTiBxWWoxCi1xWWk3ICAgICAgICAgICAgUU4gcVlqNgotcVlpdCAgICAgICAgICAgIFFOIHFZajMKLQotZFlpMGxvICAgICAgICAgIEROIGRZajBsbwotZFlpMGhpICAgICAgICAgIEROIGRZajBoaQotZFlpMWxvICAgICAgICAgIEROIGRZajRsbwotZFlpMWhpICAgICAgICAgIEROIGRZajRoaQotZFlpMmxvICAgICAgICAgIEROIGRZajJsbwotZFlpMmhpICAgICAgICAgIEROIGRZajJoaQotZFlpM2xvICAgICAgICAgIEROIGRZajdsbwotZFlpM2hpICAgICAgICAgIEROIGRZajdoaQotZFlpNGxvICAgICAgICAgIEROIGRZajVsbwotZFlpNGhpICAgICAgICAgIEROIGRZajVoaQotZFlpNWxvICAgICAgICAgIEROIGRZanRsbwotZFlpNWhpICAgICAgICAgIEROIGRZanRoaQotZFlpNmxvICAgICAgICAgIEROIGRZajFsbwotZFlpNmhpICAgICAgICAgIEROIGRZajFoaQotZFlpN2xvICAgICAgICAgIEROIGRZajZsbwotZFlpN2hpICAgICAgICAgIEROIGRZajZoaQotZFlpdGxvICAgICAgICAgIEROIGRZajNsbwotZFlpdGhpICAgICAgICAgIEROIGRZajNoaQotCi1xWWgwICAgICAgICAgICAgUU4gcVlpdAotcVloMSAgICAgICAgICAgIFFOIHFZaTAKLXFZaDIgICAgICAgICAgICBRTiBxWWkyCi1xWWgzICAgICAgICAgICAgUU4gcVlpMwotcVloNCAgICAgICAgICAgIFFOIHFZaTcKLXFZaDUgICAgICAgICAgICBRTiBxWWk1Ci1xWWg2ICAgICAgICAgICAgUU4gcVlpNAotcVloNyAgICAgICAgICAgIFFOIHFZaTEKLXFZaHQgICAgICAgICAgICBRTiBxWWk2Ci0KLWRZaDBsbyAgICAgICAgICBETiBkWWl0bG8KLWRZaDBoaSAgICAgICAgICBETiBkWWl0aGkKLWRZaDFsbyAgICAgICAgICBETiBkWWkwbG8KLWRZaDFoaSAgICAgICAgICBETiBkWWkwaGkKLWRZaDJsbyAgICAgICAgICBETiBkWWkybG8KLWRZaDJoaSAgICAgICAgICBETiBkWWkyaGkKLWRZaDNsbyAgICAgICAgICBETiBkWWkzbG8KLWRZaDNoaSAgICAgICAgICBETiBkWWkzaGkKLWRZaDRsbyAgICAgICAgICBETiBkWWk3bG8KLWRZaDRoaSAgICAgICAgICBETiBkWWk3aGkKLWRZaDVsbyAgICAgICAgICBETiBkWWk1bG8KLWRZaDVoaSAgICAgICAgICBETiBkWWk1aGkKLWRZaDZsbyAgICAgICAgICBETiBkWWk0bG8KLWRZaDZoaSAgICAgICAgICBETiBkWWk0aGkKLWRZaDdsbyAgICAgICAgICBETiBkWWkxbG8KLWRZaDdoaSAgICAgICAgICBETiBkWWkxaGkKLWRZaHRsbyAgICAgICAgICBETiBkWWk2bG8KLWRZaHRoaSAgICAgICAgICBETiBkWWk2aGkKLQotcVlnMCAgICAgICAgICAgIFFOIHFZaDIKLXFZZzEgICAgICAgICAgICBRTiBxWWh0Ci1xWWcyICAgICAgICAgICAgUU4gcVloMQotcVlnMyAgICAgICAgICAgIFFOIHFZaDAKLXFZZzQgICAgICAgICAgICBRTiBxWWg0Ci1xWWc1ICAgICAgICAgICAgUU4gcVloNQotcVlnNiAgICAgICAgICAgIFFOIHFZaDYKLXFZZzcgICAgICAgICAgICBRTiBxWWg3Ci1xWWd0ICAgICAgICAgICAgUU4gcVloMwotCi1xWWYwICAgICAgICAgICAgUU4gcVlnNgotcVlmMSAgICAgICAgICAgIFFOIHFZZzUKLXFZZjIgICAgICAgICAgICBRTiBxWWc0Ci1xWWYzICAgICAgICAgICAgUU4gcVlndAotcVlmNCAgICAgICAgICAgIFFOIHFZZzMKLXFZZjUgICAgICAgICAgICBRTiBxWWcyCi1xWWY2ICAgICAgICAgICAgUU4gcVlnMQotcVlmNyAgICAgICAgICAgIFFOIHFZZzAKLXFZZnQgICAgICAgICAgICBRTiBxWWc3Ci0KLSAgICAgICAgVlJTSFIgICAgICAgcVlqNywgcVlqNywgIzIKLSAgICAgICAgVlJTSFIgICAgICAgcVlqNiwgcVlqNiwgIzEKLSAgICAgICAgCi0gICAgICAgIFZIQUREICAgICAgIHFZaTUsIHFZajEsIHFZajcgICAgICAgIDsvLyBpNSA9IChqMStqNykvMgotICAgICAgICBWU1VCICAgICAgICBxWWk2LCBxWWoxLCBxWWo3ICAgICAgICA7Ly8gaTYgPSBqMS1qNwotICAgICAgICBWSEFERCAgICAgICBxWWkzLCBxWWoyLCBxWWo2ICAgICAgICA7Ly8gaTMgPSAoajIrajYpLzIKLSAgICAgICAgVlNVQiAgICAgICAgcVlpMiwgcVlqMiwgcVlqNiAgICAgICAgOy8vIGkyID0gajItajYKLSAgICAgICAgVkhBREQgICAgICAgcVlpNywgcVlqNSwgcVlqMyAgICAgICAgOy8vIGk3ID0gKGo1K2ozKS8yCi0gICAgICAgIFZTVUIgICAgICAgIHFZaTQsIHFZajUsIHFZajMgICAgICAgIDsvLyBpNCA9IGo1LWozCi0KLSAgICAgICAgVlFETVVMSCAgICAgcVlpMiwgcVlpMiwgSW52U3FydDIgICAgOy8vIGkyL3NxcnQoMikKLSAgICAgICAgOy8vIElTdGFnZSA0LDMgcm93cyAwdG8xIHggMS8yCi0gICAgICAgIAotICAgICAgICBNT1YgICAgICAgICBwVGVtcCwgIzB4NCAgICAgICAgICAgICA7Ly8gZW5zdXJlIGNvcnJlY3Qgcm91bmQKLSAgICAgICAgVkRVUCAgICAgICAgcVNjYWxlMSwgcFRlbXAgICAgICAgICAgIDsvLyBvZiBEQyByZXN1bHQKLSAgICAgICAgVkFERCAgICAgICAgcVlpMCwgcVlpMCwgcVNjYWxlMQotICAgICAgICAKLSAgICAgICAgVkhBREQgICAgICAgcVloMCwgcVlpMCwgcVlpMSAgICAgICAgOy8vIChpMCtpMSkvMgotICAgICAgICBWSFNVQiAgICAgICBxWWgxLCBxWWkwLCBxWWkxICAgICAgICA7Ly8gKGkwLWkxKS8yCi0KLSAgICAgICAgVkhBREQgICAgICAgcVloNywgcVlpNSwgcVlpNyAgICAgICAgOy8vIChpNStpNykvNAotICAgICAgICBWU1VCICAgICAgICBxWWg1LCBxWWk1LCBxWWk3ICAgICAgICA7Ly8gKGk1LWk3KS8yCi0gICAgICAgIFZTVUIgICAgICAgIHFZaDIsIHFZaTIsIHFZaTMgICAgICAgIDsvLyBoMiwgaDMKLSAgICAgICAgVlFETVVMSCAgICAgcVloNSwgcVloNSwgSW52U3FydDIgICAgOy8vIGg1L3NxcnQoMikKLQotICAgICAgICBWTVVMTCAgICAgICBxWHQwLCBkWWk0bG8sIEMgICAgICAgICA7Ly8gYyppNAotICAgICAgICBWTUxBTCAgICAgICBxWHQwLCBkWWk2bG8sIFMgICAgICAgICA7Ly8gYyppNCtzKmk2Ci0gICAgICAgIFZNVUxMICAgICAgIHFYdDEsIGRZaTRoaSwgQwotICAgICAgICBWTUxBTCAgICAgICBxWHQxLCBkWWk2aGksIFMKLSAgICAgICAgVlNIUk4gICAgICAgZFloNGxvLCBxWHQwLCAjMTYgICAgICAgOy8vIGg0Ci0gICAgICAgIFZTSFJOICAgICAgIGRZaDRoaSwgcVh0MSwgIzE2Ci0gICAgICAgIAotICAgICAgICBWTVVMTCAgICAgICBxWHQwLCBkWWk2bG8sIEMgICAgICAgICA7Ly8gYyppNgotICAgICAgICBWTUxTTCAgICAgICBxWHQwLCBkWWk0bG8sIFMgICAgICAgICA7Ly8gLXMqaTQgKyBjKmg2Ci0gICAgICAgIFZNVUxMICAgICAgIHFYdDEsIGRZaTZoaSwgQwotICAgICAgICBWTUxTTCAgICAgICBxWHQxLCBkWWk0aGksIFMKLSAgICAgICAgVlNIUk4gICAgICAgZFloNmxvLCBxWHQwLCAjMTYgICAgICAgOy8vIGg2Ci0gICAgICAgIFZTSFJOICAgICAgIGRZaDZoaSwgcVh0MSwgIzE2Ci0gICAgICAgIAotICAgICAgICBWU1VCICAgICAgICBxWWc2LCBxWWg2LCBxWWg3Ci0gICAgICAgIFZTVUIgICAgICAgIHFZZzUsIHFZaDUsIHFZZzYKLSAgICAgICAgVlNVQiAgICAgICAgcVlnNCwgcVloNCwgcVlnNQotICAgICAgICAKLSAgICAgICAgOy8vIElTdGFnZSAyIHJvd3MgMHRvMyB4IDEvMgotICAgICAgICBWSEFERCAgICAgICBxWWcxLCBxWWgxLCBxWWgyICAgICAgICA7Ly8gKGgxK2gyKS8yCi0gICAgICAgIFZIU1VCICAgICAgIHFZZzIsIHFZaDEsIHFZaDIgICAgICAgIDsvLyAoaDEtaDIpLzIKLSAgICAgICAgVkhBREQgICAgICAgcVlnMCwgcVloMCwgcVloMyAgICAgICAgOy8vIChoMCtoMykvMgotICAgICAgICBWSFNVQiAgICAgICBxWWczLCBxWWgwLCBxWWgzICAgICAgICA7Ly8gKGgwLWgzKS8yCi0gICAgICAgIAotCi0gICAgICAgIDsvLyBJU3RhZ2UgMSBhbGwgcm93cwotICAgICAgICBWSEFERCAgICAgICAgcVlmMywgcVlnMywgcVlnNCAgICAgICAgCi0gICAgICAgIFZIU1VCICAgICAgICBxWWY0LCBxWWczLCBxWWc0ICAgICAgICAKLSAgICAgICAgVkhBREQgICAgICAgIHFZZjIsIHFZZzIsIHFZZzUgICAgICAgIAotICAgICAgICBWSFNVQiAgICAgICAgcVlmNSwgcVlnMiwgcVlnNSAgICAgICAgCi0gICAgICAgIFZIQUREICAgICAgICBxWWYxLCBxWWcxLCBxWWc2Ci0gICAgICAgIFZIU1VCICAgICAgICBxWWY2LCBxWWcxLCBxWWc2ICAgICAgICAKLSAgICAgICAgVkhBREQgICAgICAgIHFZZjAsIHFZZzAsIHFZZzcKLSAgICAgICAgVkhTVUIgICAgICAgIHFZZjcsIHFZZzAsIHFZZzcgICAgICAKLQotWVRSMCAgICAgICAgICAgIEVRVSBTcmMwCi1ZVFIxICAgICAgICAgICAgRVFVIFNyYzQKLVlUUjIgICAgICAgICAgICBFUVUgU3JjMQotWVRSMyAgICAgICAgICAgIEVRVSBTcmMyCi1ZVFI0ICAgICAgICAgICAgRVFVIFNyYzcKLVlUUjUgICAgICAgICAgICBFUVUgU3JjNQotWVRSNiAgICAgICAgICAgIEVRVSBUbXAKLVlUUjcgICAgICAgICAgICBFUVUgU3JjNgotWVRSdCAgICAgICAgICAgIEVRVSBTcmMzCi0KLXFDMCAgICAgICAgICAgICBRTiAgWVRSMC5TMzIgICAgICAgICAgICAgICAgOy8vIGZvciBZVFJwb3NlCi1xQzEgICAgICAgICAgICAgUU4gIFlUUjEuUzMyCi1xQzIgICAgICAgICAgICAgUU4gIFlUUjIuUzMyCi1xQzMgICAgICAgICAgICAgUU4gIFlUUjMuUzMyCi1xQzQgICAgICAgICAgICAgUU4gIFlUUjQuUzMyCi1xQzUgICAgICAgICAgICAgUU4gIFlUUjUuUzMyCi1xQzYgICAgICAgICAgICAgUU4gIFlUUjYuUzMyCi1xQzcgICAgICAgICAgICAgUU4gIFlUUjcuUzMyCi0KLWREMCAgICAgICAgICAgICBETiAgWVRSMCoyKzEgICAgICAgICAgICAgICAgOy8vIGZvciB1c2luZyBWU1dQCi1kRDEgICAgICAgICAgICAgRE4gIFlUUjEqMisxCi1kRDIgICAgICAgICAgICAgRE4gIFlUUjIqMisxCi1kRDMgICAgICAgICAgICAgRE4gIFlUUjMqMisxCi1kRDQgICAgICAgICAgICAgRE4gIFlUUjQqMgotZEQ1ICAgICAgICAgICAgIEROICBZVFI1KjIKLWRENiAgICAgICAgICAgICBETiAgWVRSNioyCi1kRDcgICAgICAgICAgICAgRE4gIFlUUjcqMgotICAgICAgICAgIAotICAgICAgICBWVFJOICAgICAgICBxWWYwLCBxWWYxCi0gICAgICAgIFZUUk4gICAgICAgIHFZZjIsIHFZZjMKLSAgICAgICAgVlRSTiAgICAgICAgcVlmNCwgcVlmNQotICAgICAgICBWVFJOICAgICAgICBxWWY2LCBxWWY3Ci0gICAgICAgIFZUUk4gICAgICAgIHFDMCwgcUMyCi0gICAgICAgIFZUUk4gICAgICAgIHFDMSwgcUMzCi0gICAgICAgIFZUUk4gICAgICAgIHFDNCwgcUM2Ci0gICAgICAgIFZUUk4gICAgICAgIHFDNSwgcUM3ICAgICAgICAKLSAgICAgICAgVlNXUCAgICAgICAgZEQwLCBkRDQKLSAgICAgICAgVlNXUCAgICAgICAgZEQxLCBkRDUKLSAgICAgICAgVlNXUCAgICAgICAgZEQyLCBkRDYKLSAgICAgICAgVlNXUCAgICAgICAgZEQzLCBkRDcKLQotICAgICAgICAKLWRZZjBVOCAgICAgICAgICBETiBZVFIwKjIuVTgKLWRZZjFVOCAgICAgICAgICBETiBZVFIxKjIuVTgKLWRZZjJVOCAgICAgICAgICBETiBZVFIyKjIuVTgKLWRZZjNVOCAgICAgICAgICBETiBZVFIzKjIuVTgKLWRZZjRVOCAgICAgICAgICBETiBZVFI0KjIuVTgKLWRZZjVVOCAgICAgICAgICBETiBZVFI1KjIuVTgKLWRZZjZVOCAgICAgICAgICBETiBZVFI2KjIuVTgKLWRZZjdVOCAgICAgICAgICBETiBZVFI3KjIuVTgKLSAgICAgICAgCi0gICAgICAgIDsvLwotICAgICAgICA7Ly8gRG8gc2F0dXJhdGlvbiBpZiBvdXRzaXplIGlzIG90aGVyIHRoYW4gUzE2Ci0gICAgICAgIDsvLwotICAgICAgICAKLSAgICAgICAgSUYgKCIkb3V0c2l6ZSI9InU4IikKLSAgICAgICAgICAgIDsvLyBPdXRwdXQgcmFuZ2UgWzAtMjU1XQotICAgICAgICAgICAgVlFNT1ZOICAgICAgICAgICAgZFlmMFU4LCBxWWYwCi0gICAgICAgICAgICBWUU1PVk4gICAgICAgICAgICBkWWYxVTgsIHFZZjEKLSAgICAgICAgICAgIFZRTU9WTiAgICAgICAgICAgIGRZZjJVOCwgcVlmMgotICAgICAgICAgICAgVlFNT1ZOICAgICAgICAgICAgZFlmM1U4LCBxWWYzCi0gICAgICAgICAgICBWUU1PVk4gICAgICAgICAgICBkWWY0VTgsIHFZZjQKLSAgICAgICAgICAgIFZRTU9WTiAgICAgICAgICAgIGRZZjVVOCwgcVlmNQotICAgICAgICAgICAgVlFNT1ZOICAgICAgICAgICAgZFlmNlU4LCBxWWY2Ci0gICAgICAgICAgICBWUU1PVk4gICAgICAgICAgICBkWWY3VTgsIHFZZjcKLSAgICAgICAgRU5ESUYKLSAgICAgICAgCi0gICAgICAgIElGICgiJG91dHNpemUiPSJzOSIpCi0gICAgICAgICAgICA7Ly8gT3V0cHV0IHJhbmdlIFstMjU2IHRvICsyNTVdCi0gICAgICAgICAgICBWUVNITCAgICAgICAgICAgIHFZZjAsIHFZZjAsICMxNi05Ci0gICAgICAgICAgICBWUVNITCAgICAgICAgICAgIHFZZjEsIHFZZjEsICMxNi05Ci0gICAgICAgICAgICBWUVNITCAgICAgICAgICAgIHFZZjIsIHFZZjIsICMxNi05Ci0gICAgICAgICAgICBWUVNITCAgICAgICAgICAgIHFZZjMsIHFZZjMsICMxNi05Ci0gICAgICAgICAgICBWUVNITCAgICAgICAgICAgIHFZZjQsIHFZZjQsICMxNi05Ci0gICAgICAgICAgICBWUVNITCAgICAgICAgICAgIHFZZjUsIHFZZjUsICMxNi05Ci0gICAgICAgICAgICBWUVNITCAgICAgICAgICAgIHFZZjYsIHFZZjYsICMxNi05Ci0gICAgICAgICAgICBWUVNITCAgICAgICAgICAgIHFZZjcsIHFZZjcsICMxNi05Ci0gICAgICAgICAgICAKLSAgICAgICAgICAgIFZTSFIgICAgICAgICAgICAgcVlmMCwgcVlmMCwgIzE2LTkKLSAgICAgICAgICAgIFZTSFIgICAgICAgICAgICAgcVlmMSwgcVlmMSwgIzE2LTkKLSAgICAgICAgICAgIFZTSFIgICAgICAgICAgICAgcVlmMiwgcVlmMiwgIzE2LTkKLSAgICAgICAgICAgIFZTSFIgICAgICAgICAgICAgcVlmMywgcVlmMywgIzE2LTkKLSAgICAgICAgICAgIFZTSFIgICAgICAgICAgICAgcVlmNCwgcVlmNCwgIzE2LTkKLSAgICAgICAgICAgIFZTSFIgICAgICAgICAgICAgcVlmNSwgcVlmNSwgIzE2LTkKLSAgICAgICAgICAgIFZTSFIgICAgICAgICAgICAgcVlmNiwgcVlmNiwgIzE2LTkKLSAgICAgICAgICAgIFZTSFIgICAgICAgICAgICAgcVlmNywgcVlmNywgIzE2LTkKLSAgICAgICAgRU5ESUYKLQotICAgICAgICA7Ly8gU3RvcmUgb3V0cHV0IGRlcGVuZGluZyBvbiB0aGUgU3RyaWRlIHNpemUKLSAgICAgICAgSUYgIiRzdHJpZGUiPSJzIgotICAgICAgICAgICAgVlNUMSAgICAgICAgcVlmMCwgW3BEZXN0IEA2NF0sIFN0cmlkZQotICAgICAgICAgICAgVlNUMSAgICAgICAgcVlmMSwgW3BEZXN0IEA2NF0sIFN0cmlkZQotICAgICAgICAgICAgVlNUMSAgICAgICAgcVlmMiwgW3BEZXN0IEA2NF0sIFN0cmlkZQotICAgICAgICAgICAgVlNUMSAgICAgICAgcVlmMywgW3BEZXN0IEA2NF0sIFN0cmlkZQotICAgICAgICAgICAgVlNUMSAgICAgICAgcVlmNCwgW3BEZXN0IEA2NF0sIFN0cmlkZQotICAgICAgICAgICAgVlNUMSAgICAgICAgcVlmNSwgW3BEZXN0IEA2NF0sIFN0cmlkZQotICAgICAgICAgICAgVlNUMSAgICAgICAgcVlmNiwgW3BEZXN0IEA2NF0sIFN0cmlkZQotICAgICAgICAgICAgVlNUMSAgICAgICAgcVlmNywgW3BEZXN0IEA2NF0gICAgICAgICAgICAKLSAgICAgICAgRUxTRQotICAgICAgICAgICAgSUYgKCIkb3V0c2l6ZSI9InU4IikKLSAgICAgICAgICAgICAgICBWU1QxICAgICAgICBkWWYwVTgsIFtwRGVzdCBANjRdLCAjOAotICAgICAgICAgICAgICAgIFZTVDEgICAgICAgIGRZZjFVOCwgW3BEZXN0IEA2NF0sICM4Ci0gICAgICAgICAgICAgICAgVlNUMSAgICAgICAgZFlmMlU4LCBbcERlc3QgQDY0XSwgIzgKLSAgICAgICAgICAgICAgICBWU1QxICAgICAgICBkWWYzVTgsIFtwRGVzdCBANjRdLCAjOAotICAgICAgICAgICAgICAgIFZTVDEgICAgICAgIGRZZjRVOCwgW3BEZXN0IEA2NF0sICM4Ci0gICAgICAgICAgICAgICAgVlNUMSAgICAgICAgZFlmNVU4LCBbcERlc3QgQDY0XSwgIzgKLSAgICAgICAgICAgICAgICBWU1QxICAgICAgICBkWWY2VTgsIFtwRGVzdCBANjRdLCAjOAotICAgICAgICAgICAgICAgIFZTVDEgICAgICAgIGRZZjdVOCwgW3BEZXN0IEA2NF0KLSAgICAgICAgICAgIEVMU0UKLSAgICAgICAgICAgICAgICA7Ly8gKCIkb3V0c2l6ZSI9InM5Iikgb3IgKCIkb3V0c2l6ZSI9InMxNiIpCi0gICAgICAgICAgICAgICAgVlNUMSAgICAgICAgcVlmMCwgW3BEZXN0IEA2NF0sICMxNgotICAgICAgICAgICAgICAgIFZTVDEgICAgICAgIHFZZjEsIFtwRGVzdCBANjRdLCAjMTYKLSAgICAgICAgICAgICAgICBWU1QxICAgICAgICBxWWYyLCBbcERlc3QgQDY0XSwgIzE2Ci0gICAgICAgICAgICAgICAgVlNUMSAgICAgICAgcVlmMywgW3BEZXN0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IgICAgICAgIHFYaTYsIHFYajEsIHFYajcgICAgICAgICAgICA7Ly8gajEtajcKLSAgICAgICAgTERSICAgICAgICAgcFNyYywgPWFybUNPTU1fSURDVENvZWYgOy8vIEFkZHJlc3Mgb2YgRENUIGludmVyc2UgQUFOIGNvbnN0YW50cwotICAgICAgICBWSEFERCAgICAgICBxWGkzLCBxWGoyLCBxWGo2ICAgICAgICAgICAgOy8vIChqMitqNikvMgotICAgICAgICBWU1VCICAgICAgICBxWGkyLCBxWGoyLCBxWGo2ICAgICAgICAgICAgOy8vIGoyLWo2Ci0gICAgICAgIFZMRFIgICAgICAgIGRDb2VmcywgW3BTcmNdICAgICAgICAgICAgICA7Ly8gTG9hZCBEQ1QgaW52ZXJzZSBBQU4gY29uc3RhbnRzCi0gICAgICAgIFZIQUREICAgICAgIHFYaTcsIHFYajUsIHFYajMgICAgICAgICAgICA7Ly8gKGo1K2ozKS8yCi0gICAgICAgIFZTVUIgICAgICAgIHFYaTQsIHFYajUsIHFYajMgICAgICAgICAgICA7Ly8gajUtajMKLSAgICAgICAgTUVORCAgICAKLSAgICAgICAgCi0gICAgICAgIAotICAgICAgICA7Ly8gU2NhbGUgOHg4IGJsb2NrIGlucHV0IHZhbHVlcyB3aXRoIDMyIGJpdCBzY2FsZSB2YWx1ZXMKLSAgICAgICAgOy8vCi0gICAgICAgIDsvLyBUaGlzIG1hY3JvIGlzIHVzZWQgdG8gcHJlLXNjYWxlIGJsb2NrIG9mIDh4OCBpbnB1dC4KLSAgICAgICAgOy8vIFRoaXMgYWxzbyBkbyB0aGUgSXN0IHN0YWdlIHRyYW5zZm9ybWF0aW9ucyBvZiBJRENULgotICAgICAgICA7Ly8KLSAgICAgICAgOy8vIElucHV0IFJlZ2lzdGVyczoKLSAgICAgICAgOy8vCi0gICAgICAgIDsvLyBkWGpubG8gICAgICAgICAgLSBuIHRoIGlucHV0IEQgcmVnaXN0ZXIgd2l0aCBmaXJzdCBmb3VyIFMxNiB2YWx1ZXMKLSAgIC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ICAgICAgIHBUZW1wLCBwU2NhbGUsICM0KjgqNyAgICAgICAgICAgOy8vIEFkZHJlc3Mgb2YgIHBTY2FsZVs3XQotICAgICAgICAgICAgCi0gICAgICAgICAgICA7Ly8gUm93IDAKLSAgICAgICAgICAgIFZMRDEgICAgICAgIHtxU2NhbGUwbG8sIHFTY2FsZTBoaX0sIFtwU2NhbGVdIQotICAgICAgICAgICAgVlNITEwgICAgICAgcVNyYzBsbywgZFhqMGxvLCAjKDEyLTEpCi0gICAgICAgICAgICBWU0hMTCAgICAgICBxU3JjMGhpLCBkWGowaGksICMoMTItMSkgICAgICAgICAgICAKLSAgICAgICAgICAgIFZMRDEgICAgICAgIHtxU2NhbGUxbG8sIHFTY2FsZTFoaX0sIFtwU2NhbGVdIQotICAgICAgICAgICAgVlFSRE1VTEggICAgcVNyYzBsbywgcVNjYWxlMGxvLCBxU3JjMGxvCi0gICAgICAgICAgICBWUVJETVVMSCAgICBxU3JjMGhpLCBxU2NhbGUwaGksIHFTcmMwaGkKLSAgICAgICAgICAgIFZMRDEgICAgICAgIHtxU2NhbGU3bG8sIHFTY2FsZTdoaX0sIFtwVGVtcF0hCi0gICAgICAgICAgICBWU0hMTCAgICAgICBxU3JjMWxvLCBkWGoxbG8sICMoMTItMSkKLSAgICAgICAgICAgIFZTSExMICAgICAgIHFTcmMxaGksIGRYajFoaSwgIygxMi0xKSAgICAgICAgICAgIAotICAgICAgICAgICAgVk1PVk4gICAgICAgZFhpMGxvLCBxU3JjMGxvICAgICAgICAgICAgICAgICA7Ly8gT3V0cHV0IGkwCi0gICAgICAgICAgICBWTU9WTiAgICAgICBkWGkwaGksIHFTcmMwaGkKLSAgICAgICAgICAgIFZTSExMICAgICAgIHFTcmM3bG8sIGRYajdsbywgIygxMi0xKQotICAgICAgICAgICAgVlNITEwgICAgICAgcVNyYzdoaSwgZFhqN2hpLCAjKDEyLTEpCi0gICAgICAgICAgICBTVUIgICAgICAgICBwVGVtcCwgcFRlbXAsICMoKDE2KjIpKyg0KjgqMSkpCi0gICAgICAgICAgICBWUVJETVVMSCAgICBxU3JjMWxvLCBxU2NhbGUxbG8sIHFTcmMxbG8KLSAgICAgICAgICAgIFZRUkRNVUxIICAgIHFTcmMxaGksIHFTY2FsZTFoaSwgcVNyYzFoaQotICAgICAgICAgICAgVlFSRE1VTEggICAgcVNyYzdsbywgcVNjYWxlN2xvLCBxU3JjN2xvCi0gICAgICAgICAgICBWUVJETVVMSCAgICBxU3JjN2hpLCBxU2NhbGU3aGksIHFTcmM3aGkKLSAgICAgICAgICAgIFZMRDEgICAgICAgIHtxU2NhbGUybG8sIHFTY2FsZTJoaX0sIFtwU2NhbGVdIQotCi0gICAgICAgICAgICA7Ly8gUm93IDEgJiA3Ci0gICAgICAgICAgICBWSEFERCAgICAgICBxUmVzMTdsbywgcVNyYzFsbywgcVNyYzdsbyAgICAgIDsvLyAoajErajcpLzIKLSAgICAgICAgICAgIFZIQUREICAgICAgIHFSZXMxN2hpLCBxU3JjMWhpLCBxU3JjN2hpICAgICAgOy8vIChqMStqNykvMgotICAgICAgICAgICAgVk1PVk4gICAgICAgZFhpNWxvLCBxUmVzMTdsbyAgICAgICAgICAgICAgICA7Ly8gT3V0cHV0IGk1Ci0gICAgICAgICAgICBWTU9WTiAgICAgICBkWGk1aGksIHFSZXMxN2hpICAgICAgICAgICAgICAKLSAgICAgICAgICAgIFZTVUIgICAgICAgIHFSZXMxN2xvLCBxU3JjMWxvLCBxU3JjN2xvICAgICAgOy8vIGoxLWo3Ci0gICAgICAgICAgICBWU1VCICAgICAgICBxUmVzMTdoaSwgcVNyYzFoaSwgcVNyYzdoaSAgICAgIDsvLyBqMS1qNwotICAgICAgICAgICAgVk1PVk4gICAgICAgZFhpNmxvLCBxUmVzMTdsbyAgICAgICAgICAgICAgICA7Ly8gT3V0cHV0IGk2Ci0gICAgICAgICAgICBWTU9WTiAgICAgICBkWGk2aGksIHFSZXMxN2hpICAgICAgCi0gICAgICAgICAgICBWU0hMTCAgICAgICBxU3JjMmxvLCBkWGoybG8sICMoMTItMSkKLSAgICAgICAgICAgIFZTSExMICAgICAgIHFTcmMyaGksIGRYajJoaSwgIygxMi0xKQotICAgICAgICAgICAgVkxEMSAgICAgICAge3FTY2FsZTZsbywgcVNjYWxlNmhpfSwgW3BUZW1wXSEKLSAgICAgICAgICAgIFZTSExMICAgICAgIHFTcmM2bG8sIGRYajZsbywgIygxMi0xKQotICAgICAgICAgICAgVlNITEwgICAgICAgcVNyYzZoaSwgZFhqNmhpLCAjKDEyLTEpCi0gICAgICAgICAgICBTVUIgICAgICAgICBwVGVtcCwgcFRlbXAsICMoKDE2KjIpKyg0KjgqMSkpCi0gICAgICAgICAgICBWUVJETVVMSCAgICBxU3JjMmxvLCBxU2NhbGUybG8sIHFTcmMybG8KLSAgICAgICAgICAgIFZRUkRNVUxIICAgIHFTcmMyaGksIHFTY2FsZTJoaSwgcVNyYzJoaQotICAgICAgICAgICAgVlFSRE1VTEggICAgcVNyYzZsbywgcVNjYWxlNmxvLCBxU3JjNmxvCi0gICAgICAgICAgICBWUVJETVVMSCAgICBxU3JjNmhpLCBxU2NhbGU2aGksIHFTcmM2aGkKLSAgICAgICAgICAgIFZMRDEgICAgICAgIHtxU2NhbGUzbG8sIHFTY2FsZTNoaX0sIFtwU2NhbGVdIQotCi0gICAgICAgICAgICA7Ly8gUm93IDIgJiA2Ci0gICAgICAgICAgICBWSEFERCAgICAgICBxUmVzMjZsbywgcVNyYzJsbywgcVNyYzZsbyAgICAgIDsvLyAoajIrajYpLzIKLSAgICAgICAgICAgIFZIQUREICAgICAgIHFSZXMyNmhpLCBxU3JjMmhpLCBxU3JjNmhpICAgICAgOy8vIChqMitqNikvMgotICAgICAgICAgICAgVk1PVk4gICAgICAgZFhpM2xvLCBxUmVzMjZsbyAgICAgICAgICAgICAgICA7Ly8gT3V0cHV0IGkzCi0gICAgICAgICAgICBWTU9WTiAgICAgICBkWGkzaGksIHFSZXMyNmhpICAgICAgICAgICAgICAKLSAgICAgICAgICAgIFZTVUIgICAgICAgIHFSZXMyNmxvLCBxU3JjMmxvLCBxU3JjNmxvICAgICAgOy8vIGoyLWo2Ci0gICAgICAgICAgICBWU1VCICAgICAgICBxUmVzMjZoaSwgcVNyYzJoaSwgcVNyYzZoaSAgICAgIDsvLyBqMi1qNgotICAgICAgICAgICAgVk1PVk4gICAgICAgZFhpMmxvLCBxUmVzMjZsbyAgICAgICAgICAgICAgICA7Ly8gT3V0cHV0IGkyCi0gICAgICAgICAgICBWTU9WTiAgICAgICBkWGkyaGksIHFSZXMyNmhpICAgICAgCi0gICAgICAgICAgICBWU0hMTCAgICAgICBxU3JjM2xvLCBkWGozbG8sICMoMTItMSkKLSAgICAgICAgICAgIFZTSExMICAgICAgIHFTcmMzaGksIGRYajNoaSwgIygxMi0xKQotICAgICAgICAgICAgVkxEMSAgICAgICAge3FTY2FsZTVsbywgcVNjYWxlNWhpfSwgW3BUZW1wXSEKLSAgICAgICAgICAgIFZTSExMICAgICAgIHFTcmM1bG8sIGRYajVsbywgIygxMi0xKQotICAgICAgICAgICAgVlNITEwgICAgICAgcVNyYzVoaSwgZFhqNWhpLCAjKDEyLTEpCi0gICAgICAgICAgICBWUVJETVVMSCAgICBxU3JjM2xvLCBxU2NhbGUzbG8sIHFTcmMzbG8KLSAgICAgICAgICAgIFZRUkRNVUxIICAgIHFTcmMzaGksIHFTY2FsZTNoaSwgcVNyYzNoaQotICAgICAgICAgICAgVlFSRE1VTEggICAgcVNyYzVsbywgcVNjYWxlNWxvLCBxU3JjNWxvCi0gICAgICAgICAgICBWUVJETVVMSCAgICBxU3JjNWhpLCBxU2NhbGU1aGksIHFTcmM1aGkKLSAgICAgICAgICAgIAotICAgICAgICAgICAgOy8vIFJvdyAzICYgNQotICAgICAgICAgICAgVkhBREQgICAgICAgcVJlczUzbG8sIHFTcmM1bG8sIHFTcmMzbG8gICAgICA7Ly8gKGo1K2ozKS8yCi0gICAgICAgICAgICBWSEFERCAgICAgICBxUmVzNTNoaSwgcVNyYzVoaSwgcVNyYzNoaSAgICAgIDsvLyAoajUrajMpLzIKLSAgICAgICAgICAgIFNVQiAgICAgICAgIHBTcmMsIHBTcmMsICMxNioyKjIKLSAgICAgICAgICAgIFZNT1ZOICAgICAgIGRYaTdsbywgcVJlczUzbG8gICAgICAgICAgICAgICAgOy8vIE91dHB1dCBpNwotICAgICAgICAgICAgVk1PVk4gICAgICAgZFhpN2hpLCBxUmVzNTNoaSAgICAgICAgICAgICAgCi0gICAgICAgICAgICBWU1VCICAgICAgICBxUmVzNTNsbywgcVNyYzVsbywgcVNyYzNsbyAgICAgIDsvLyBqNS1qMwotICAgICAgICAgICAgVlNVQiAgICAgICAgcVJlczUzaGksIHFTcmM1aGksIHFTcmMzaGkgICAgICA7Ly8gajUtajMKLSAgICAgICAgICAgIFZMRDEgICAgICAgIHFYajQsIFtwU3JjIEA2NF0KLSAgICAgICAgICAgIFZNT1ZOICAgICAgIGRYaTRsbywgcVJlczUzbG8gICAgICAgICAgICAgICAgOy8vIE91dHB1dCBpNAotICAgICAgICAgICAgVk1PVk4gICAgICAgZFhpNGhpLCBxUmVzNTNoaSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAotICAgICAgICAgICAgVlNITEwgICAgICAgcVNyYzRsbywgZFhqNGxvLCAjKDEyLTEpCi0gICAgICAgICAgICBWU0hMTCAgICAgICBxU3JjNGhpLCBkWGo0aGksICMoMTItMSkKLSAgICAgICAgICAgIFZMRDEgICAgICAgIHtxU2NhbGU0bG8sIHFTY2FsZTRoaX0sIFtwU2NhbGVdICAgICAgICAgICAgCi0gICAgICAgICAgICBMRFIgICAgICAgICBwU3JjLCA9YXJtQ09NTV9JRENUQ29lZiAgICAgOy8vIEFkZHJlc3Mgb2YgRENUIGludmVyc2UgQUFOIGNvbnN0YW50cwotICAgICAgICAgICAgVlFSRE1VTEggICAgcVNyYzRsbywgcVNjYWxlNGxvLCBxU3JjNGxvCi0gICAgICAgICAgICBWUVJETVVMSCAgICBxU3JjNGhpLCBxU2NhbGU0aGksIHFTcmM0aGkKLSAgICAgICAgICAgIFZMRFIgICAgICAgIGRDb2VmcywgW3BTcmNdICAgICAgICAgICAgICAgICAgOy8vIExvYWQgRENUIGludmVyc2UgQUFOIGNvbnN0YW50cwotICAgICAgICAgICAgOy8vIFJvdyA0Ci0gICAgICAgICAgICBWTU9WTiAgICAgICBkWGkxbG8sIHFTcmM0bG8gICAgICAgICAgICAgICAgIDsvLyBPdXRwdXQgaTEKLSAgICAgICAgICAgIFZNT1ZOICAgICAgIGRYaTFoaSwgcVNyYzRoaSAgICAgICAgICAgICAgCi0gICAgICAgIAotICAgICAgICBNRU5ECi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKLSAgICAgICAgRU5ECmRpZmYgLS1naXQgYS9tZWRpYS9saWJzdGFnZWZyaWdodC9jb2RlY3Mvb24yL2gyNjRkZWMvb214ZGwvYXJtX25lb24vYXBpL2FybUNPTU1fTWFza1RhYmxlLmggYi9tZWRpYS9saWJzdGFnZWZyaWdodC9jb2RlY3Mvb24yL2gyNjRkZWMvb214ZGwvYXJtX25lb24vYXBpL2FybUNPTU1fTWFza1RhYmxlLmgKZGVsZXRlZCBmaWxlIG1vZGUgMTAwNzU1CmluZGV4IDUxMTE4ZmQuLjAwMDAwMDAKLS0tIGEvbWVkaWEvbGlic3RhZ2VmcmlnaHQvY29kZWNzL29uMi9oMjY0ZGVjL29teGRsL2FybV9uZW9uL2FwaS9hcm1DT01NX01hc2tUYWJsZS5oCisrKyAvZGV2L251bGwKQEAgLTEsMjcgKzAsMCBAQAotLyoqCi0gKiAKLSAqIEZpbGUgTmFtZTogIGFybUNPTU1fTWFza1RhYmxlLmgKLSAqIE9wZW5NQVggREw6IHYxLjAuMgotICogUmV2aXNpb246ICAgMTIyOTAKLSAqIERhdGU6ICAgICAgIFdlZG5lc2RheSwgQXByaWwgOSwgMjAwOAotICogCi0gKiAoYykgQ29weXJpZ2h0IDIwMDctMjAwOCBB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2SlMKLSAgICAgICAgX01fVFJZIEFSTTExMzZKRi1TLCAgQVJNMTEzNkpTCi0gICAgICAgIF9NX1RSWSBNUENvcmUsICAgICAgIEFSTTExMzZKUwotICAgICAgICBfTV9UUlkgZmFsY29uLXZmcCwgQVJNMTEzNkpTCi0gICAgICAgIF9NX1RSWSBmYWxjb24tZnVsbC1uZW9uLCBDb3J0ZXhBOAotICAgICAgICBfTV9UUlkgQ29ydGV4LUE4Tm9OZW9uLCBBUk0xMTM2SlMKLSAgICAgICAgX01fVFJZIENvcnRleC1BOCwgICAgQ29ydGV4QTgsIEFSTTExMzZKUwotICAgICAgICBfTV9UUlkgQ29ydGV4LVI0LCAgICBBUk0xMTM2SlMKLSAgICAgICAgX01fVFJZIEFSTTdURE1JCi0gICAgICAgIAotICAgICAgICA7Ly8gU2VsZWN0IHRoZSBjb3JyZWN0IHZhcmlhbnQKLSAgICAgICAgX01fREVGX1ZBUklBTlRTCi0gICAgICAgIElGIF9WYXJpYW50PSIiCi0gICAgICAgICAgICBJTkZPIDEsICJObyBtYXRjaCBmb3VuZCBmb3IgQ1BVICckX0NQVSciCi0gICAgICAgIEVMU0UKLSRfVmFyaWFudCAgIFNFVEwge1RSVUV9Ci0gICAgICAgIEVORElGCi0gICAgICAgIE1FTkQKLSAgICAgICAgCi0gICAgICAgIDsvLyBSZWdpc3RlciBhIHZhcmlhbnQgYXMgYXZhaWxhYmxlCi0gICAgICAgIE1BQ1JPCi0gICAgICAgIF9NX1ZBUklBTlQgJHZhcgotICAgICAgICBJRiAiJHZhciI9IiIKLSAgICAgICAgICAgIE1FWElUCi0gICAgICAgIEVORElGCi0gICAgICAgIElGIDpMTk9UOjpERUY6X29rJHZhcgotICAgICAgICAgICAgSU5GTyAxLCAiVW5yZWNvZ25pemVkIHZhcmlhbnQgJyR2YXInIgotICAgICAgICBFTkRJRgotJHZhciAgICBTRVRMIHtUUlVFfQotICAgICAgICBNRU5ECi0gICAgICAgIAotICAgICAgICA7Ly8gRm9yIG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otICAgICAgICAgICAgICAgIFRCQiBbcGMsICR2XQotICAgICAgICAgICAgRU5ESUYKLV9Td2l0Y2gkX1N3TnVtCi0gICAgICAgIEVMU0UKLSAgICAgICAgICAgIDsvLyBBUk0KLSAgICAgICAgICAgIEFERCBwYywgcGMsICR2LCBMU0wgIzIKLSAgICAgICAgICAgIE5PUAotICAgICAgICBFTkRJRgotICAgICAgICBNRU5ECi0gICAgICAgIAotICAgICAgICA7Ly8gQWRkIGEgY2FzZSB0byB0aGUgc3dpdGNoIHN0YXRlbWVudAotICAgICAgICBNQUNSTwotICAgICAgICBNX0NBU0UgICRsYWJlbAotICAgICAgICBJRiB7Q09ORklHfT0xNgotICAgICAgICAgICAgOy8vIFRodW1iCi0gICAgICAgICAgICBJRiBfU3dMb25nCi0gICAgICAgICAgICAgICAgRENXICgkbGFiZWwgLSBfU3dpdGNoJF9Td051bSkvMgotICAgICAgICAgICAgRUxTRQotICAgICAgICAgICAgICAgIERDQiAoJGxhYmVsIC0gX1N3aXRjaCRfU3dOdW0pLzIKLSAgICAgICAgICAgIEVORElGCi0gICAgICAgIEVMU0UKLSAgICAgICAgICAgIDsvLyBBUk0KLSAgICAgICAgICAgIEIgICAkbGFiZWwKLSAgICAgICAgRU5ESUYKLSAgICAgICAgTUVORAotICAgICAgICAKLSAgICAgICAgOy8vIEVuZCBvZiBzd2l0Y2ggc3RhdGVtZW50Ci0gICAgICAgIE1BQ1JPCi0gICAgICAgIE1fRU5EU1dJVENICi0gICAgICAgIEFMSUdOIDIKLSAgICAgICAgTUVORCAgICAgICAKLQotCi07Ly8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8KLTsvLyBEYXRhIGFyZWEgYWxsb2NhdGlvbgotOy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vCi0KLSAgICAgICAgOy8vIENvbnN0Y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ICAgOy8vIE9uIEVudHJ5OgotICAgICAgICA7Ly8gJGkgPSBJbnN0cnVjdGlvbiB0byBwZXJmb3JtIChlZyAiTERSQiIpCi0gICAgICAgIDsvLyAkYSA9IFJlcXVpcmVkIGJ5dGUgYWxpZ25tZW50Ci0gICAgICAgIDsvLyAkciA9IFJlZ2lzdGVyKHMpIHRvIHRyYW5zZmVyIChlZyAicjEiKQotICAgICAgICA7Ly8gJGEwLCRhMSwkYTIuIEFkZHJlc3NpbmcgbW9kZSBhbmQgY29uZGl0aW9uLiBPbmUgb2Y6Ci0gICAgICAgIDsvLyAgICAgbGFiZWwgeyxjY30KLSAgICAgICAgOy8vICAgICBbYmFzZV0gICAgICAgICAgICAgICAgICAgIHssLCxjY30KLSAgICAgICAgOy8vICAgICBbYmFzZSwgb2Zmc2V0XXshfSAgICAgICAgIHssLGNjfQotICAgICAgICA7Ly8gICAgIFtiYXNlLCBvZmZzZXQsIHNoaWZ0XXshfSAgeyxjY30KLSAgICAgICAgOy8vICAgICBbYmFzZV0sIG9mZnNldCAgICAgICAgICAgIHssLGNjfQotICAgICAgICA7Ly8gICAgIFtiYXNlXSwgb2Zmc2V0LCBzaGlmdCAgICAgeyxjY30KLSAgICAgICAgTUFDUk8KLSAgICAgICAgX01fREFUQSAkaSwkYSwkciwkYTAsJGExLCRhMiwkYTMKLSAgICAgICAgSUYgIiRhMCI6TEVGVDoxPSJbIgotICAgICAgICAgICAgSUYgIiRhMSI9IiIKLSAgICAgICAgICAgICAgICAkaSRhMyAgICRyLCAkYTAKLSAgICAgICAgICAgIEVMU0UKLSAgICAgICAgICAgICAgICBJRiAiJGEwIjpSSUdIVDoxPSJdIgotICAgICAgICAgICAgICAgICAgICBJRiAiJGEyIj0iIgotICAgICAgICAgICAgICAgICAgICAgICAgX01fUE9TVElORCAkaSRhMywgIiRyIiwgJGEwLCAkYTEKLSAgICAgICAgICAgICAgICAgICAgRUxTRQotICAgICAgICAgICAgICAgICAgICAgICAgX01fUE9TVElORCAkaSRhMywgIiRyIiwgJGEwLCAiJGExLCRhMiIKLSAgICAgICAgICAgICAgICAgICAgRU5ESUYKLSAgICAgICAgICAgICAgICBFTFNFCi0gICAgICAgICAgICAgICAgICAgIElGICIkYTIiPSIiCi0gICAgICAgICAgICAgICAgICAgICAgICBfTV9QUkVJTkQgICRpJGEzLCAiJHIiLCAkYTAsICRhMQotICAgICAgICAgICAgICAgICAgICBFTFNFCi0gICAgICAgICAgICAgICAgICAgICAgICBfTV9QUkVJTkQgICRpJGEzLCAiJHIiLCAkYTAsICIkYTEsJGEyIgotICAgICAgICAgICAgICAgICAgICBFTkRJRgotICAgICAgICAgICAgICAgIEVORElGCi0gICAgICAgICAgICBFTkRJRgotICAgICAgICBFTFNFCi0gICAgICAgICAgICBMQ0xBICAgIF9PZmZzZXQKLV9PZmZzZXQgICAgIFNFVEEgICAgX1dvcmtzcGFjZSArICRhMCRfRgotICAgICAgICAgICAgQVNTRVJUICAoX09mZnNldDpBTkQ6KCRhLTEpKT0wCi0gICAgICAgICAgICAkaSRhMSAgICRyLCBbc3AsICNfT2Zmc2V0XQotICAgICAgICBFTkRJRgotICAgICAgICBNRU5ECi0gICAgICAgIAotICAgICAgICA7Ly8gSGFuZGxlIHBvc3QgaW5kZXhlZCBsb2FkL3N0b3JlcwotICAgICAgICA7Ly8gb3AgIHJlZywgW2Jhc2VdLCBvZmZzZXQKLSAgICAgICAgTUFDUk8KLSAgICAgICAgX01fUE9TVElORCAkaSwkciwkYTAsJGExCi0gICAgICAgIExDTFMgX2Jhc2UKLSAgICAgICAgTENMUyBfb2Zmc2V0Ci0gICAgICAgIElGIHtDT05GSUd9PTE2IDsvLyBUaHVtYgotX2Jhc2UgICAgICAgU0VUUyAoIiRhMCI6TEVGVDooOkxFTjoiJGEwIi0xKSk6UklHSFQ6KDpMRU46IiRhMCItMikgICA7Ly8gcmVtb3ZlIFtdCi1fb2Zmc2V0ICAgICBTRVRTICIkYTEiCi0gICAgICAgICAgICBJRiBfb2Zmc2V0OkxFRlQ6MT0iKyIKLV9vZmZzZXQgICAgICAgICBTRVRTIF9vZmZzZXQ6UklHSFQ6KDpMRU46X29mZnNldC0xKQotICAgICAgICAgICAgRU5ESUYKLSAgICAgICAgICAgICRpICAkciwgJGEwCi0gICAgICAgICAgICBJRiBfb2Zmc2V0OkxFRlQ6MT0iLSIKLV9vZmZzZXQgICAgICAgICBTRVRTIF9vZmZzZXQ6UklHSFQ6KDpMRU46X29mZnNldC0xKQotICAgICAgICAgICAgICAgIFNVQiAkX2Jhc2UsICRfYmFzZSwgJF9vZmZzZXQKLSAgICAgICAgICAgIEVMU0UgICAgICAgICAgICAgICAgCi0gICAgICAgICAgICAgICAgQUREICRfYmFzZSwgJF9iYXNlLCAkX29mZnNldAotICAgICAgICAgICAgRU5ESUYKLSAgICAgICAgRUxTRSA7Ly8gQVJNCi0gICAgICAgICAgICAkaSAgJHIsICRhMCwgJGExCi0gICAgICAgIEVORElGCi0gICAgICAgIE1FTkQKLSAgICAgICAgCi0gICAgICAgIDsvLyBIYW5kbGUgcHJlIGluZGV4ZWQgbG9hZC9zdG9yZQotICAgICAgICA7Ly8gb3AgIHJlZywgW2Jhc2UsIG9mZnNldF17IX0KLSAgICAgICAgTUFDUk8KLSAgICAgICAgX01fUFJFSU5EICRpLCRyLCRhMCwkYTEKLSAgICAgICAgTENMUyBfYmFzZQotICAgICAgICBMQ0xTIF9vZmZzZXQKLSAgICAgICAgSUYgKHtDT05GSUd9PTE2KTpMQU5EOigoIiRhMSI6UklHSFQ6Mik9Il0hIikKLV9iYXNlICAgICAgIFNFVFMgIiRhMCI6UklHSFQ6KDpMRU46KCIkYTAiKS0xKQotX29mZnNldCAgICAgU0VUUyAiJGExIjpMRUZUOig6TEVOOigiJGExIiktMikKLSAgICAgICAgICAgICRpICRyLCBbJF9iYXNlLCAkX29mZnNldF0KLSAgICAgICAgICAgIEFERCAkX2Jhc2UsICRfYmFzZSwgJF9vZmZzZXQKLSAgICAgICAgRUxTRQotICAgICAg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LCRhMiwkYTMKLSAgICAgICAgTUVORAotICAgICAgICAKLSAgICAgICAgOy8vIFN0b3JlIGhhbGYgd29yZCB0byBzdGFjawotICAgICAgICBNQUNSTwotICAgICAgICBNX1NUUkggICRyLCRhMCwkYTEsJGEyLCRhMwotICAgICAgICBfTV9EQVRBICJTVFJIIiwyLCRyLCRhMCwkYTEsJGEyLCRhMwotICAgICAgICBNRU5ECi0KLSAgICAgICAgOy8vIExvYWQgd29yZCBmcm9tIHN0YWNrCi0gICAgICAgIE1BQ1JPCi0gICAgICAgIE1fTERSICAgJHIsJGEwLCRhMSwkYTIsJGEzCi0gICAgICAgIF9NX0RBVEEgIkxEUiIsNCwkciwkYTAsJGExLCRhMiwkYTMKLSAgICAgICAgTUVORAotICAgICAgICAKLSAgICAgICAgOy8vIFN0b3JlIHdvcmQgdG8gc3RhY2sKLSAgICAgICAgTUFDUk8KLSAgICAgICAgTV9TVFIgICAkciwkYTAsJGExLCRhMiwkYTMKLSAgICAgICAgX01fREFUQSAiU1RSIiw0LCRyLCRhMCwkYTEsJGEyLCRhMwotICAgICAgICBNRU5ECi0KLSAgICAgICAgOy8vIExvYWQgZG91YmxlIHdvcmQgZnJvbSBzdGFjawotICAgICAgICBNQUNSTwotICAgICAgICBNX0xEUkQgICRyMCwkcjEsJGEwLCRhMSwkYTIsJGEzCi0gICAgICAgIF9NX0RBVEEgIkxEUkQiLDgsIiRyMCwkcjEiLCRhMCwkYTEsJGEyLCRhMwotICAgICAgICBNRU5ECi0gICAgICAgICAgICAgICAgCi0gICAgICAgIDsvLyBTdG9yZSBkb3VibGUgd29yZCB0byBzdGFjawotICAgICAgICBNQUNSTwotICAgICAgICBNX1NUUkQgICRyMCwkcjEsJGEwLCRhMSwkYTIsJGEzCi0gICAgICAgIF9NX0RBVEEgIlNUUkQiLDgsIiRyMCwkcjEiLCRhMCwkYTEsJGEyLCRhMwotICAgICAgICBNRU5ECi0gICAgICAgIAotICAgICAgICA7Ly8gR2V0IGFic29sdXRlI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QKLSAgICAgICAgICAgIE1FWElUCi0gICAgICAgIEVORElGCi0gICAgICAgIElGICIkcnJlZyI9InI5IjpMT1I6IiRycmVnIj0icjEwIgotX1JSZWdMaXN0ICAgU0VUUyAicjQtcjEwIgotX1JCeXRlcyAgICAgU0VUQSBfUkJ5dGVzKzMyCi0gICAgICAgICAgICBNRVhJVAotICAgICAgICBFTkRJRgotICAgICAgICBJRiAiJHJyZWciPSJyMTEiOkxPUjoiJHJyZWciPSJyMTIiCi1fUlJlZ0xpc3QgICBTRVRTICJyNC1yMTIiCi1fUkJ5dGVzICAgICBTRVRBIF9SQnl0ZXMrNDAKLSAgICAgICAgICAgIE1FWElUCi0gICAgICAgIEVORElGCi0gICAgICAgIElORk8gMSwgIlVucmVjb2duaXplZCBzYXZlZCByIHJlZ2lzdGVyIGxpbWl0ICckcnJlZyciCi0gICAgICAgIE1FTkQgICAgICAgIAotICAgICAgICAKLSAgICAgICAgOy8vIFdvcmsgb3V0IGEgbGlzdCBvZiBEIHNhdmVkIHJlZ2lzdGVycwotICAgICAgICBNQUNSTwotICAgICAgICBfTV9HRVREUkVHTElTVCAkZHJlZwotICAgICAgICBJRiAiJGRyZWciPSIiCi1fRFJlZ0xpc3QgICBTRVRTICIiCi0gICAgICAgICAgICBNRVhJVAotICAgICAgICBFTkRJRiAgICAgICAgCi0gICAgICAgIElGICIkZHJlZyI9ImQ4IgotX0RSZWdMaXN0ICAgU0VUUyAiZDgiCi1fUkJ5dGVzICAgICBTRVRBIF9SQnl0ZXMrOAotICAgICAgICAgICAgTUVYSVQKLSAgICAgICAgRU5ESUYKLSAgICAgICAgSUYgIiRkcmVnIj0iZDkiCi1fRFJlZ0xpc3QgICBTRVRTICJkOC1kOSIKLV9SQnl0ZXMgICAgIFNFVEEgX1JCeXRlcysxNgotICAgICAgICAgICAgTUVYSVQKLSAgICAgICAgRU5ESUYKLSAgICAgICAgSUYgIiRkcmVnIj0iZDEwIgotX0RSZWdMaXN0ICAgU0VUUyAiZDgtZ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dW5jdGlvbiBlbnRyeQotICAgICAgICBJRiBfU0J5dGVzIT0wCi0gICAgICAgICAgICBfTV9PUEMgQURELCBzcCwgc3AsIF9TQnl0ZXMKLSAgICAgICAgRU5ESUYKLSAgICAgICAgX01fUkVUCi0gICAgICAgIEVOREZVTkMKLQotICAgICAgICA7Ly8gUmVzZXQgdGhlIGdsb2JhbCBzdGFjayB0cmFja2luZyB2YXJpYWJsZXMgYmFjayB0byB0aGVpciAKLSAgICAgICAgOy8vIGluaXRpYWwgdmFsdWVzLCBhbmQgaW5jcmVtZW50IHRoZSBmdW5jdGlvbiBjb3VudAotX1NCeXRlcyAgICAgICAgU0VUQSAwCi1fRiAgICAgICAgICAgICBTRVRBIF9GKzEKLSAgICAgICAgTUVORAotCi0gICAgICAgICAgICAgICAgCi07Ly89PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQotOy8vIERlYnVnIE1hY3JvcwotOy8vPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KLQotICAgICAgICBHQkxMICAgIERFQlVHX09OCi1ERUJVR19PTiBTRVRMICAge0ZBTFNFfQotICAgICAgICBHQkxMICAgIERFQlVHX1NUQUxMU19PTgotREVCVUdfU1RBTExTX09OIFNFVEwge0ZBTFNFfQotICAgICAgICAKLSAgICAgICAgOy8vPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KLSAgICAgICAgOy8vIERlYnVnIGNhbGwgdG8gcHJpbnRmCi0gICAgICAgIDsvLyAgTV9QUklOVEYgJGZvcm1hdCwgJHZhbDAsICR2YWwxLCAkdmFsMgotICAgICAgICA7Ly8KLSAgICAgICAgOy8vIEV4YW1wbGVzOgotICAgICAgICA7Ly8gIE1fUFJJTlRGICJ4PSUwOHhcbiIsIHIwCi0gICAgICAgIDsvLwotICAgICAgICA7Ly8gVGhpcyBtYWNybyBwcmVzZXJ2ZXMgdGhlIHZhbHVlIG9mIGFsbCByZWdpc3RlcnMgaW5jbHVkaW5nIHRoZQotICAgICAgICA7Ly8gZmxhZ3MuCi0gICAgICAgIDsvLz09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09Ci0KLSAgICAgICAgTUFDUk8KLSAgICAgICAgTV9QUklOVEYgICRmb3JtYXQsICR2YWwwLCAkdmFsMSwgJHZhbDIKLSAgICAgICAgSUYgREVCVUdfT04KLSAgICAgICAgCi0gICAgICAgIElNUE9SVCAgcHJpbnRmCi0gICAgICAgIExDTEEgICAgbkFyZ3MKLW5BcmdzCVNFVEEgICAgMAotICAgICAgICAKLSAgICAgICAgOy8vIHNhdmUgcmVnaXN0ZXJzIHNvIHdlIGRvbid0IGNvcnJ1cHQgdGhlbQotICAgICAgICBTVE1GRCAgIHNwISwge3IwLXIxMiwgbHJ9Ci0gICAgICAgIAotICAgICAgICA7Ly8gRHJvcCBzdGFjayB0byBnaXZlIHVzIHNvbWUgd29ya3NwYWNlCi0gICAgICAgIFNVQiAgICAgc3AsIHNwLCAjMTYKLSAgICAgICAgCi0gICAgICAgIDsvLyBTYXZlIHJlZ2lzdGVycyB3ZSBuZWVkIHRvIHByaW50IHRvIHRoZSBzdGFjawotICAgICAgICBJRiAiJHZhbDIiIDw+ICIiCi0gICAgICAgICAgICBBU1NFUlQgIiR2YWwxIiA8PiAiIgotICAgICAgICAgICAgU1RSICAgICR2YWwyLCBbc3AsICM4XQotbkFyZ3MgICAgICAgU0VUQSAgIG5BcmdzKzEKLSAgICAgICAgRU5ESUYKLSAgICAgICAgSUYgIiR2YWwxIiA8PiAiIgotICAgICAgICAgICAgQVNTRVJUICIkdmFsMCIgPD4gIiIKLSAgICAgICAgICAgIFNUUiAgICAkdmFsMSwgW3NwLCAjNF0KLW5BcmdzCSAgICBTRVRBICAgbkFyZ3MrMQotICAgICAgICBFTkRJRgotICAgICAgICBJRiAiJHZhbDAiPD4iIgotICAgICAgICAgICAgU1RSICAgICR2YWwwLCBbc3BdCi1uQXJncwkgICAgU0VUQSAgIG5BcmdzKzEKLSAgICAgICAgRU5ESUYKLSAgICAgICAgCi0gICAgICAgIDsvLyBOb3cgd2UgYXJlIHNhZmUgdG8gY29ycnVwdCByZWdpc3RlcnMKLSAgICAgICAgQURSICAgICByMCwgJUZUMDAKLSAgICAgICAgSUYgbkFyZ3M9MQotICAgICAgICAgIExEUiAgIHIxLCBbc3BdCi0gICAgICAgIEVORElGCi0gICAgICAgIElGIG5BcmdzPTIKLSAgICAgICAgICBMRE1JQSBzcCwge3IxLHIyfQotICAgICAgICBFTkRJRgotICAgICAgICBJRiBuQXJncz0zCi0gICAgICAgICAgTERNSUEgc3AsIHtyMSxyMixyM30KLSAgICAgICAgRU5ESUYKLSAgICAgICAgCi0gICAgICAgIDsvLyBwcmludCB0aGUgdmFsdWVzCi0gICAgICAgIE1SUyAgICAgcjQsIGNwc3IgICAgICAgIDsvLyBwcmVzZXJ2ZSBmbGFncwotICAgICAgICBCTCAgICAgIHByaW50ZgotICAgICAgICBNU1IgICAgIGNwc3JfZiwgcjQgICAgICA7Ly8gcmVzdG9yZSBmbGFncwotICAgICAgICBCICAgICAgICVGVDAxCi0wMCAgICAgIDsvLyBzdHJpbmcgdG8gcHJpbnQKLSAgICAgICAgRENCICAgICAiJGZvcm1hdCIsIDAKLSAgICAgICAgQUxJR04KLTAxICAgICAgOy8vIEZpbmlzaGVkCi0gICAgICAgIEFERCAgICAgc3AsIHNwLCAjMTYKLSAgICAgICAgOy8vIFJlc3RvcmUgcmVnaXN0ZXJzCi0gICAgICAgIExETUZECXNwISwge3IwLXIxMixscn0KLQotICAgICAgICBFTkRJRiAgIDsvLyBERUJVR19PTgotICAgICAgICBNRU5ECi0KLQotICAgICAgICA7Ly8gU3RhbGwgU2ltdWxhdGlvb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3N0Ci0gICAgICAgICAgICAgICAgICAgIExDTEEgX3N0bnVtCi1fc3QgICAgICAgICAgICAgICAgIFNFVFMgIiRwbGF0c3RhbGwiOlJJR0hUOjEgICAgICAgIAotX3N0bnVtICAgICAgICAgICAgICBTRVRBICRfc3QKLSAgICAgICAgICAgICAgICAgICAgV0hJTEUgX3N0bnVtPjAKLQkJCU1PViBzcCwgc3AKLV9zdG51bSAgICAgICAgICAgICAgICAgIFNFVEEgX3N0bnVtIC0gMQotICAgICAgICAgICAgICAgICAgICBXRU5ECi0gICAgICAgICAgICAgICAgRU5ESUYKLSAgICAgICAgICAgIEVORElGCi0gICAgICAgIEVORElGCi0gICAgICAgIE1FTkQKLSAgICAgICAgCi0gICAgICAgIAotICAgICAgICAKLTsvLz09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09Ci07Ly8gRW5kaWFuIEludmFyaWVuY2UgTWFjcm9zCi07Ly8gCi07Ly8gVGhlIGlkZWEgYmVoaW5kIHRoZXNlIG1hY3JvcyBpcyB0aGF0IGlmIGFuIGFycmF5IGlzCi07Ly8gbG9hZGVkIGFzIHdvcmRzIHRoZW4gdGhlIFNNVUwwMCBtYWNybyB3aWxsIG11bHRpcGx5Ci07Ly8gYXJyYXkgZWxlbWVudHMgMCByZWdhcmRsZXNzIG9mIHRoZSBlbmRpYW5lc3Mgb2YgdGhlCi07Ly8gc3lzdGVtLiBGb3IgbGl0dGxlIGVuZGlhbiBTTVVMMDA9U01VTEJCLCBmb3IgYmlnCi07Ly8gZW5kaWFuIFNNVUwwMD1TTVVMVFQgYW5kIHNpbWlsYXJseSBmb3Igb3RoZXIgcGFja2VkIG9wZXJhdGlvbnMuCi07Ly8KLTsvLz09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09Ci0KLSAgICAgICAgTUFDUk8KLSAgICAgICAgTElCSTQgICAkY29tbGksICRjb21iaSwgJGEsICRiLCAkYywgJGQsICRjYwotICAgICAgICBJRiB7RU5ESUFOfT0iYmlnIgotICAgICAgICAkY29tYmkuJGNjICRhLCAkYiwgJGMsICRkCi0gICAgICAgIEVMU0UKLSAgICAgICAgJGNvbWxpLiRjYyAkYSwgJGIsICRjLCAkZAotICAgICAgICBFTkRJRgotICAgICAgICBNRU5ECi0gICAgICAgIAotICAgICAgICBNQUNSTwotICAgICAgICBMSUJJMyAgICRjb21saSwgJGNvbWJpLCAkYSwgJGIsICRjLCAkY2MKLSAgICAgICAgSUYge0VORElBTn09ImJpZyIKLSAgICAgICAgJGNvbWJpLiRjYyAkYSwgJGIsICRjCi0gICAgICAgIEVMU0UKLSAgICAgICAgJGNvbWxpLiRjYyAkYSwgJGIsICRjCi0gICAgICAgIEVORElGCi0gICAgICAgIE1FTkQKLSAgICAgICAgCi0gICAgICAgIDsvLyBTTUxBeHkgbWFjcm9zCi0gICAgICAgIAotICAgICAgICBNQUNSTwotICAgICAgICBTTUxBMDAgICRhLCAkYiwgJGMsICRkLCAkY2MKLSAgICAgICAgTElCSTQgU01MQUJCLCBTTUxBVFQsICRhLCAkYiwgJGMsICRkLCAkY2MKLSAgICAgICAgTUVORAotICAgICAgICAKLSAgICAgICAgTUFDUk8KLSAgICAgICAgU01MQTAxICAkYSwgJGIsICRjLCAkZCwgJGNjCi0gICAgICAgIExJQkk0IFNNTEFCVCwgU01MQVRCLCAkYSwgJGIsICRjLCAkZCwgJGNjCi0gICAgICAgIE1FTkQKLSAgICAgICAgCi0gICAgICAgIE1BQ1JPCi0gICAgICAgIFNNTEEwQiAgJGEsICRiLCAkYywgJGQsICRjYwotICAgICAgICBMSUJJNCBTTUxBQkIsIFNNTEFUQiwgJGEsICRiLCAkYywgJGQsICRjYwotICAgICAgICBNRU5ECi0gICAgICAgIAotICAgICAgICBNQUNSTwotICAgICAgICBTTUxBMFQgICRhLCAkYiwgJGMsICRkLCAkY2MKLSAgICAgICAgTElCSTQgU01MQUJULCBTTUxBVFQsICRhLCAkYiwgJGMsICRkLCAkY2MKLSAgICAgICAgTUVORAotICAgICAgICAKLSAgICAgICAgTUFDUk8KLSAgICAgICAgU01MQTEwICAkYSwgJGIsICRjLCAkZCwgJGNjCi0gICAgICAgIExJQkk0IFNNTEFUQiwgU01MQUJULCAkYSwgJGIsICRjLCAkZCwgJGNjCi0gICAgICAgIE1FTkQKLSAgICAgICAgCi0gICAgICAgIE1BQ1JPCi0gICAgICAgIFNNTEExMSAgJGEsICRiLCAkYywgJGQsICRjYwotICAgICAgICBMSUJJNCBTTUxBVFQsIFNNTEFCQiwgJGEsICRiLCAkYywgJGQsICRjYwotICAgICAgICBNRU5ECi0gICAgICAgIAotICAgICAgICBNQUNSTwotICAgICAgICBTTUxBMUIgICRhLCAkYiwgJGMsICRkLCAkY2MKLSAgICAgICAgTElCSTQgU01MQVRCLCBTTUxBQkIsICRhLCAkYiwgJGMsICRkLCAkY2MKLSAgICAgICAgTUVORAotICAgICAgICAKLSAgICAgICAgTUFDUk8KLSAgICAgICAgU01MQTFUICAkYSwgJGIsICRjLCAkZCwgJGNjCi0gICAgICAgIExJQkk0IFNNTEFUVCwgU01MQUJULCAkYSwgJGIsICRjLCAkZCwgJGNjCi0gICAgICAgIE1FTkQKLSAgICAgICAgCi0gICAgICAgIE1BQ1JPCi0gICAgICAgIFNNTEFCMCAgJGEsICRiLCAkYywgJGQsICRjYwotICAgICAgICBMSUJJNCBTTUxBQkIsIFNNTEFCVCwgJGEsICRiLCAkYywgJGQsICRjYwotICAgICAgICBNRU5ECi0gICAgICAgIAotICAgICAgICBNQUNSTwotICAgICAgICBTTUxBQjEgICRhLCAkYiwgJGMsICRkLCAkY2MKLSAgICAgICAgTElCSTQgU01MQUJULCBTTUxBQkIsICRhLCAkYiwgJGMsICRkLCAkY2MKLSAgICAgICAgTUVORAotICAgICAgICAKLSAgICAgICAgTUFDUk8KLSAgICAgICAgU01MQVQwICAkYSwgJGIsICRjLCAkZCwgJGNjCi0gICAgICAgIExJQkk0IFNNTEFUQiwgU01MQVRULCAkYSwgJGIsICRjLCAkZCwgJGNjCi0gICAgICAgIE1FTkQKLSAgICAgICAgCi0gICAgICAgIE1BQ1JPCi0gICAgICAgIFNNTEFUMSAgJGEsICRiLCAkYywgJGQsICRjYwotICAgICAgICBMSUJJNCBTTUxBVFQsIFNNTEFUQiwgJGEsICRiLCAkYywgJGQsICRjYwotICAgICAgICBNRU5ECi0gICAgICAgIAotICAgICAgICA7Ly8gU01VTHh5IG1hY3JvcwotICAgICAgICAKLSAgICAgICAgTUFDUk8KLSAgICAgICAgU01VTDAwICAkYSwgJGIsICRjLCAkY2MKLSAgICAgICAgTElCSTMgU01VTEJCLCBTTVVMVFQsICRhLCAkYiwgJGMsICRjYwotICAgICAgICBNRU5ECi0gICAgICAgIAotICAgICAgICBNQUNSTwotICAgICAgICBTTVVMMDEgICRhLCAkYiwgJGMsICRjYwotICAgICAgICBMSUJJMyBTTVVMQlQsIFNNVUxUQiwgJGEsICRiLCAkYywgJGNjCi0gICAgICAgIE1FTkQKLSAgICAgICAgCi0gICAgICAgIE1BQ1JPCi0gICAgICAgIFNNVUwwQiAgJGEsICRiLCAkYywgJGNjCi0gICAgICAgIExJQkkzIFNNVUxCQiwgU01VTFRCLCAkYSwgJGIsICRjLCAkY2MKLSAgICAgICAgTUVORAotICAgICAgICAKLSAgICAgICAgTUFDUk8KLSAgICAgICAgU01VTDBUICAkYSwgJGIsICRjLCAkY2MKLSAgICAgICAgTElCSTMgU01VTEJULCBTTVVMVFQsICRhLCAkYiwgJGMsICRjYwotICAgICAgICBNRU5ECi0gICAgICAgIAotICAgICAgICBNQUNSTwotICAgICAgICBTTVVMMTAgICRhLCAkYiwgJGMsICRjYwotICAgICAgICBMSUJJMyBTTVVMVEIsIFNNVUxCVCwgJGEsICRiLCAkYywgJGNjCi0gICAgICAgIE1FTkQKLSAgICAgICAgCi0gICAgICAgIE1BQ1JPCi0gICAgICAgIFNNVUwxMSAgJGEsICRiLCAkYywgJGNjCi0gICAgICAgIExJQkkzIFNNVUxUVCwgU01VTEJCLCAkYSwgJGIsICRjLCAkY2MKLSAgICAgICAgTUVORAotICAgICAgICAKLSAgICAgICAgTUFDUk8KLSAgICAgICAgU01VTDFCICAkYSwgJGIsICRjLCAkY2MKLSAgICAgICAgTElCSTMgU01VTFRCLCBTTVVMQkIsICRhLCAkYiwgJGMsICRjYwotICAgICAgICBNRU5ECi0gICAgICAgIAotICAgICAgICBNQUNSTwotICAgICAgICBTTVVMMVQgICRhLCAkYiwgJGMsICRjYwotICAgICAgICBMSUJJMyBTTVVMVFQsIFNNVUxCVCwgJGEsICRiLCAkYywgJGNjCi0gICAgICAgIE1FTkQKLSAgICAgICAgCi0gICAgICAgIE1BQ1JPCi0gICAgICAgIFNNVUxCMCAgJGEsICRiLCAkYywgJGNjCi0gICAgICAgIExJQkkzIFNNVUxCQiwgU01VTEJULCAkYSwgJGIsICRjLCAkY2MKLSAgICAgICAgTUVORAotICAgICAgICAKLSAgICAgICAgTUFDUk8KLSAgICAgICAgU01VTEIxICAkYSwgJGIsICRjLCAkY2MKLSAgICAgICAgTElCSTMgU01VTEJULCBTTVVMQkIsICRhLCAkYiwgJGMsICRjYwotICAgICAgICBNRU5ECi0gICAgICAgIAotICAgICAgICBNQUNSTwotICAgICAgICBTTVVMVDAgICRhLCAkYiwgJGMsICRjYwotICAgICAgICBMSUJJMyBTTVVMVEIsIFNNVUxUVCwgJGEsICRiLCAkYywgJGNjCi0gICAgICAgIE1FTkQKLSAgICAgICAgCi0gICAgICAgIE1BQ1JPCi0gICAgICAgIFNNVUxUMSAgJGEsICRiLCAkYywgJGNjCi0gICAgICAgIExJQkkzIFNNVUxUVCwgU01VTFRCLCAkYSwgJGIsICRjLCAkY2MKLSAgICAgICAgTUVORAotICAgICAgICAKLSAgICAgICAgOy8vIFNNTEFXeCwgU01VTFd4IG1hY3JvcwotICAgICAgICAKLSAgICAgICAgTUFDUk8KLSAgICAgICAgU01MQVcwICAkYSwgJGIsICRjLCAkZCwgJGNjCi0gICAgICAgIExJQkk0IFNNTEFXQiwgU01MQVdULCAkYSwgJGIsICRjLCAkZCwgJGNjCi0gICAgICAgIE1FTkQKLSAgICAgICAgCi0gICAgICAgIE1BQ1JPCi0gICAgICAgIFNNTEFXMSAgJGEsICRiLCAkYywgJGQsICRjYwotICAgICAgICBMSUJJNCBTTUxBV1QsIFNNTEFXQiwgJGEsICRiLCAkYywgJGQsICRjYwotICAgICAgICBNRU5ECi0gICAgICAgIAotICAgICAgICBNQUNSTwotICAgICAgICBTTVVMVzAgICRhLCAkYiwgJGMsICRjYwotICAgICAgICBMSUJJMyBTTVVMV0IsIFNNVUxXVCwgJGEsICRiLCAkYywgJGNjCi0gICAgICAgIE1FTkQKLSAgICAgICAgCi0gICAgICAgIE1BQ1JPCi0gICAgICAgIFNNVUxXMSAgJGEsICRiLCAkYywgJGNjCi0gICAgICAgIExJQkkzIFNNVUxXVCwgU01VTFdCLCAkYSwgJGIsICRjLCAkY2MKLSAgICAgICAgTUVORAotCi0gICAgICAgIDsvLyBTTUxBTHh5IG1hY3JvcwotCi0KLSAgICAgICAgTUFDUk8KLSAgICAgICAgU01MQUwwMCAgJGEsICRiLCAkYywgJGQsICRjYwotICAgICAgICBMSUJJNCBTTUxBTEJCLCBTTUxBTFRULCAkYSwgJGIsICRjLCAkZCwgJGNjCi0gICAgICAgIE1FTkQKLSAgICAgICAgCi0gICAgICAgIE1BQ1JPCi0gICAgICAgIFNNTEFMMDEgICRhLCAkYiwgJGMsICRkLCAkY2MKLSAgICAgICAgTElCSTQgU01MQUxCVCwgU01MQUxUQiwgJGEsICRiLCAkYywgJGQsICRjYwotICAgICAgICBNRU5ECi0gICAgICAgIAotICAgICAgICBNQUNSTwotICAgICAgICBTTUxBTDBCICAkYSwgJGIsICRjLCAkZCwgJGNjCi0gICAgICAgIExJQkk0IFNNTEFMQkIsIFNNTEFMVEIsICRhLCAkYiwgJGMsICRkLCAkY2MKLSAgICAgICAgTUVORAotICAgICAgICAKLSAgICAgICAgTUFDUk8KLSAgICAgICAgU01MQUwwVCAgJGEsICRiLCAkYywgJGQsICRjYwotICAgICAgICBMSUJJNCBTTUxBTEJULCBTTUxBTFRULCAkYSwgJGIsICRjLCAkZCwgJGNjCi0gICAgICAgIE1FTkQKLSAgICAgICAgCi0gICAgICAgIE1BQ1JPCi0gICAgICAgIFNNTEFMMTAgICRhLCAkYiwgJGMsICRkLCAkY2MKLSAgICAgICAgTElCSTQgU01MQUxUQiwgU01MQUxCVCwgJGEsICRiLCAkYywgJGQsICRjYwotICAgICAgICBNRU5ECi0KLSAgICAgICAgTUFDUk8KLSAgICAgICAgU01MQUwxMSAgJGEsICRiLCAkYywgJGQsICRjYwotICAgICAgICBMSUJJNCBTTUxBTFRULCBTTUxBTEJCLCAkYSwgJGIsICRjLCAkZCwgJGNjCi0gICAgICAgIE1FTkQKLSAgICAgICAgCi0gICAgICAgIE1BQ1JPCi0gICAgICAgIFNNTEFMMUIgICRhLCAkYiwgJGMsICRkLCAkY2MKLSAgICAgICAgTElCSTQgU01MQUxUQiwgU01MQUxCQiwgJGEsICRiLCAkYywgJGQsICRjYwotICAgICAgICBNRU5ECi0gICAgICAgIAotICAgICAgICBNQUNSTwotICAgICAgICBTTUxBTDFUICAkYSwgJGIsICRjLCAkZCwgJGNjCi0gICAgICAgIExJQkk0IFNNTEFMVFQsIFNNTEFMQlQsICRhLCAkYiwgJGMsICRkLCAkY2MKLSAgICAgICAgTUVORAotICAgICAgICAKLSAgICAgICAgTUFDUk8KLSAgICAgICAgU01MQUxCMCAgJGEsICRiLCAkYywgJGQsICRjYwotICAgICAgICBMSUJJNCBTTUxBTEJCLCBTTUxBTEJULCAkYSwgJGIsICRjLCAkZCwgJGNjCi0gICAgICAgIE1FTkQKLSAgICAgICAgCi0gICAgICAgIE1BQ1JPCi0gICAgICAgIFNNTEFMQjEgICRhLCAkYiwgJGMsICRkLCAkY2MKLSAgICAgICAgTElC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gICAgICAgICAgICAgICAgICAgICAgIE9NWENBVEJBUihJUFBQX01vbWVudEluaXQsIE9NWElQUFBfU1VGRklYKQotI2RlZmluZSBvbXhJUFBQX01vbWVudHNfVThfQzFSICAgICAgICAgICAgICAgICAgICAgICAgICAgIE9NWENBVEJBUihJUFBQX01vbWVudHNfVThfQzFSLCBPTVhJUFBQX1NVRkZJWCkKLSNkZWZpbmUgb214SVBQUF9Nb21lbnRzX1U4X0MzUiAgICAgICAgICAgICAgICAgICAgICAgICAgICBPTVhDQVRCQVIoSVBQUF9Nb21lbnRzX1U4X0MzUiwgT01YSVBQUF9TVUZGSVgpCi0KLSNkZWZpbmUgb214U1BfQmxvY2tFeHBfUzE2ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBPTVhDQVRCQVIoU1BfQmxvY2tFeHBfUzE2LCBPTVhTUF9TVUZGSVgpCi0jZGVmaW5lIG9teFNQX0Jsb2NrRXhwX1MzMiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgT01YQ0FUQkFSKFNQX0Jsb2NrRXhwX1MzMiwgT01YU1BfU1VGRklYKQotI2RlZmluZSBvbXhTUF9Db3B5X1MxNiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIE9NWENBVEJBUihTUF9Db3B5X1MxNiwgT01YU1BfU1VGRklYKQotI2RlZmluZSBvbXhTUF9Eb3RQcm9kX1MxNiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIE9NWENBVEJBUihTUF9Eb3RQcm9kX1MxNiwgT01YU1BfU1VGRklYKQotI2RlZmluZSBvbXhTUF9Eb3RQcm9kX1MxNl9TZnMgICAgICAgICAgICAgICAgICAgICAgICAgICAgIE9NWENBVEJBUihTUF9Eb3RQcm9kX1MxNl9TZnMsIE9NWFNQX1NVRkZJWCkKLSNkZWZpbmUgb214U1BfRkZURndkX0NUb0NfU0MxNl9TZnMgICAgICAgICAgICAgICAgICAgICAgICBPTVhDQVRCQVIoU1BfRkZURndkX0NUb0N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F0aW9uTUIsIE9NWFZDTTRQMTBfU1VGRklYKQotI2RlZmluZSBvbXhWQ000UDEwX1ByZWRpY3RJbnRyYV8xNngxNiAgICAgICAgICAgICAgICAgICAgIE9NWENBVEJBUihWQ000UDEwX1ByZWRpY3RJbnRyYV8xNngxNiwgT01YVkNNNFAxMF9TVUZGSVgpCi0jZGVmaW5lIG9teFZDTTRQMTBfUHJlZGljdEludHJhXzR4NCAgICAgICAgICAgICAgICAgICAgICAgT01YQ0FUQkFSKFZDTTRQMTBfUHJlZGljdEludHJhXzR4NCwgT01YVkNNNFAxMF9TVUZGSVgpCi0jZGVmaW5lIG9teFZDTTRQMTBfUHJlZGljdEludHJhQ2hyb21hXzh4OCAgICAgICAgICAgICAgICAgIE9NWENBVEJBUihWQ000UDEwX1ByZWRpY3RJbnRyYUNocm9tYV84eDgsIE9NWFZDTTRQMTBfU1VGRklYKQotI2RlZmluZSBvbXhWQ000UDEwX1NBRF80eCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIE9NWENBVEJBUihWQ000UDEwX1NBRF80eCwgT01YVkNNNFAxMF9TVUZGSVgpCi0jZGVmaW5lIG9teFZDTTRQMTBfU0FEUXVhcl8xNnggICAgICAgICAgICAgICAgICAgICAgICAgICAgT01YQ0FUQkFSKFZDTTRQMTBfU0FEUXVhcl8xNngsIE9NWFZDTTRQMTBfU1VGRklYKQotI2RlZmluZSBvbXhWQ000UDEwX1NBRFF1YXJfNHggICAgICAgICAgICAgICAgICAgICAgICAgICAgIE9NWENBVEJBUihWQ000UDEwX1NBRFF1YXJfNHgsIE9NWFZDTTRQMTBfU1VGRklYKQotI2RlZmluZSBvbXhWQ000UDEwX1NBRFF1YXJfOHggICAgICAgICAgICAgICAgICAgICAgICAgICAgIE9NWENBVEJBUihWQ000UDEwX1NBRFF1YXJfOHgsIE9NWFZDTTRQMTBfU1VGRklYKQotI2RlZmluZSBvbXhWQ000UDEwX1NBVERfNHg0ICAgICAgICAgICAgICAgICAgICAgICAgIC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9GaW5kTVZwcmVkLCBPTVhWQ000UDJfU1VGRklYKQotI2RlZmluZSBvbXhWQ000UDJfSURDVDh4OGJsayAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIE9NWENBVEJBUihWQ000UDJfSURDVDh4OGJsaywgT01YVkNNNFAyX1NVRkZJWCkKLSNkZWZpbmUgb214VkNNNFAyX01DUmVjb25CbG9jayAgICAgICAgICAgICAgICAgICAgICAgICAgICBPTVhDQVRCQVIoVkNNNFAyX01DUmVjb25CbG9jaywgT01YVkNNNFAyX1NVRkZJWCkKLSNkZWZpbmUgb214VkNNNFAyX01FR2V0QnVmU2l6ZSAgICAgICAgICAgICAgICAgICAgICAgICAgICBPTVhDQVRCQVIoVkNNNFAyX01FR2V0QnVmU2l6ZSwgT01YVkNNNFAyX1NVRkZJWCkKLSNkZWZpbmUgb214VkNNNFAyX01FSW5pdCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBPTVhDQVRCQVIoVkNNNFAyX01FSW5pdCwgT01YVkNNNFAyX1NVRkZJWCkKLSNkZWZpbmUgb214VkNNNFAyX01vdGlvbkVzdGltYXRpb25NQiAgICAgICAgICAgICAgICAgICAgICBPTVhDQVRCQVIoVkNNNFAyX01vdGlvbkVzdGltYXRpb25NQiwgT01YVkNNNFAyX1NVRkZJWCkKLSNkZWZpbmUgb214VkNNNFAyX1ByZWRpY3RSZWNvbkNvZWZJbnRyYSAgICAgICAgICAgICAgICAgICBPTVhDQVRCQVIoVkNNNFAyX1ByZWRpY3RSZWNvbkNvZWZJbnRyYSwgT01YVkNNNFAyX1NVRkZJWCkKLSNkZWZpbmUgb214VkNNNFAyX1F1YW50SW50ZXJfSSAgICAgICAgICAgICAgICAgICAgICAgICAgICBPTVhDQVRCQVIoVkNNNFAyX1F1YW50SW50ZXJfSSwgT01YVkNNNFAyX1NVRkZJWCkKLSNkZWZpbmUgb214VkNNNFAyX1F1YW50SW50cmFfSSAgICAgICAgICAgICAgICAgICAgICAgICAgICBPTVhDQV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ICAgICAgID0gLTE1MiwgIC8qIEFBQzogSW52YWxpZCBUTlMgZmlsdGVyIGRpcmVjdGlvbiAgKi8gIAotCi0gICAgT01YX1N0c0lDSlBfSlBFR01hcmtlckVyciAgICAgICAgPSAtMTgzLCAgLyogSlBFRyBtYXJrZXIgZW5jb3VudGVyZWQgd2l0aGluIGFuIGVudHJvcHktY29kZWQgYmxvY2s7ICovCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLyogSHVmZm1hbiBkZWNvZGluZyBvcGVyYXRpb24gdGVybWluYXRlZCBlYXJseS4gICAgICAgICAgICovCi0gICAgT01YX1N0c0lDSlBfSlBFR01hcmtlciAgICAgICAgICAgPSAtMTgxLCAgLyogSlBFRyBtYXJrZXIgZW5jb3VudGVyZWQ7IEh1ZmZtYW4gZGVjb2RpbmcgKi8KLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvKiBvcGVyYXRpb24gdGVybWluYXRlZCBlYXJseS4gICAgICAgICAgICAgICAgICAgICAgICAgKi8KLSAgICBPTVhfU3RzSVBQUF9Db250ZXh0TWF0Y2hFcnIgICAgICA9IC0xNywgICAvKiBDb250ZXh0IHBhcmFtZXRlciBkb2Vzbid0IG1hdGNoIHRvIHRoZSBvcGVyYXRpb24gKi8KLQotICAgIE9NWF9TdHNTUF9FdmVuTWVkaWFuTWFza1NpemVFcnIgID0gLTE4MCwgIC8qIEV2ZW4gc2l6ZSBvZiB0aGUgTWVkaWFuIEZpbHRlciBtYXNrIHdhcyByZXBsYWNlZCBieSB0aGUgb2RkIG9uZSAqLwotCi0gICAgT01YX1N0c19NYXhpbXVtRW51bWVyYXRpb24gICAgICAgPSBJTlRfTUFYICAvKlBsYWNlaG9sZGVyLCBmb3JjZXMgZW51bSBvZiBzaXplIE9NWF9JTlQqLwotICAgIAotIH0gT01YUmVzdWx0OyAgICAgICAgICAvKiogUmV0dXJuIHZhbHVlIG9yIGVycm9yIHZhbH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YXRpb24KLSAqCi0gKiBQYXJhbWV0ZXJzOgotICogW2luXSAgVmFsdWUgICAgICAgICAgICAgICAgIEZsb2F0IHZhbHVlIHRvIGJlIGNvbnZlcnRlZAotICoKLSAqIFJldHVybiBWYWx1ZToKLSAqIFtvdXRdIGNvbnZlcnRlZCB2YWx1ZSBpbiBPTVhfUzMyIGZvcm1hdAotICoKLSAqLwotCi1PTVhfUzMyIGFybVNhdFJvdW5kRmxvYXRUb1MzMiAoT01YX0Y2NCBWYWx1ZSkKLXsKLSAgICBpZiAoVmFsdWUgPiAwKQotICAgIHsKLSAgICAgICAgVmFsdWUgKz0gMC41OwotICAgICAgICAKLSAgICAgICAgaWYoVmFsdWUgPiAoT01YX1MzMilPTVhfTUFYX1MzMiApCi0gICAgICAgIHsKLSAgICAgICAgICAgIHJldHVybiAoT01YX1MzMilPTVhfTUFYX1MzMjsKLSAgICAgICAgfQotICAgICAgICBlbHNlCi0gICAgICAgIHsKLSAgICAgICAgICAgIHJldHVybiAoT01YX1MzMilWYWx1ZTsKLSAgICAgICAgfQotICAgIH0KLSAgICBlbHNlCi0gICAgewotICAgICAgICBWYWx1ZSAtPSAwLjU7Ci0KLSAgICAgICAgaWYoVmFsdWUgPCAoT01YX1MzMilPTVhfTUlOX1MzMiApCi0gICAgICAgIHsKLSAgICAgICAgICAgIHJldHVybiAoT01YX1MzMilPTVhfTUlOX1MzMjsKLSAgICAgICAgfQotICAgICAgICBlbHNlCi0gICAgICAgIHsKLSAgICAgICAgICAgIHJldHVybiAoT01YX1MzMilWYWx1ZTsKLSAgICAgICAgfQotICAgIH0KLX0KLQotLyoqCi0gKiBGdW5jdGlvbjogYXJtU2F0Um91bmRGbG9hdFRvVTE2Ci0gKgotICogRGVzY3JpcHRpb246Ci0gKiBDb252ZXJ0cyBhIGRvdWJsZSBwcmVjaXNpb24gdmFsdWUgaW50byBhIHVuc2lnbmVkIHNob3J0IGludCBhZnRlciByb3VuZGluZyBhbmQgc2F0dXJhdGlvbgotICo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ICAgIE9NWF9VMTYgdmFsdWUgCi0pCi17Ci0gICAgT01YX1U4IGk7ICAgIAotICAgIGZvciAoIGkgPSAwOyB2YWx1ZSA+IDA7IHZhbHVlID0gdmFsdWUgPj4gMSkgCi0gICAgewotICAgICAgICBpKys7Ci0gICAgfQotICAgIHJldHVybiBpOwotfQotCi0vKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0gICAgICAgICAgICAgICAgLyogU2F0dXJhdGluZyBBcml0aG1ldGljIG9wZXJhdGlvbnMgKi8KLQotLyoqCi0gKiBGdW5jdGlvbiA6YXJtU2F0QWRkX1MzMigpCi0gKgotICogRGVzY3JpcHRpb24gOgotICogICBSZXR1cm5zIHRoZSByZXN1bHQgb2Ygc2F0dXJhdGVkIGFkZGl0aW9uIG9mIHRoZSB0d28gaW5wdXRzIFZhbHVlMSwgVmFsdWUyCi0gKgotICogUGFyYW1ldHJzOgotICogW2luXSBWYWx1ZTEgICAgICAgRmlyc3QgT3BlcmFuZAotICogW2luXSBWYWx1ZTIgICAgICAgU2Vjb25kIE9wZXJhbmQKLSAqCi0gKiBSZXR1cm46Ci0gKiBbb3V0XSAgICAgICAgICAgICBSZXN1bHQgb2Ygb3BlcmF0aW9uCi0gKiAKLSAqICAgIAotICoqLwotIAotT01YX1MzMiBhcm1TYXRBZGRfUzMyKE9NWF9TMzIgVmFsdWUxLE9NWF9TMzIgVmFsdWUyKQotewotICAgIE9NWF9TMzIgUmVzdWx0OwotICAgIAotICAgIFJlc3VsdCA9IFZhbHVlMSArIFZhbHVlMjsKLQotICAgIGlmKCAoVmFsdWUxXlZhbHVlMikgPj0gMCkKLSAgICB7Ci0gICAgICAgIC8qU2FtZSBzaWduKi8KLSAgICAgICAgaWYoIChSZXN1bHReVmFsdWUxKSA+PSAwKQotICAgICAgICB7Ci0gICAgICAgICAgICAvKlJlc3VsdCBoYXMgbm90IHNhdHVyYXRlZCovCi0gICAgICAgICAgICByZXR1cm4gUmVzdWx0OwotICAgICAgICB9Ci0gICAgICAgIGVsc2UKLSAgICAgICAgewotICAgICAgICAgICAgaWYoVmFsdWUxID49IDApCi0gICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgLypSZXN1bHQgaGFzIHNhdHVyYXRlZCBpbiBwb3NpdGl2ZSBzaWRlKi8KLSAgICAgICAgICAgICAgICByZXR1cm4gT01YX01BWF9TMzI7Ci0gICAgICAgICAgICB9Ci0gICAgICAgICAgICBlbHNlCi0gICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgLypSZXN1bHQgaGFzIHNhdHVyYXRlZCBpbiBuZWdhdGl2ZSBzaWRlKi8KLSAgICAgICAgICAgICAgICByZXR1cm4gT01YX01JTl9TMzI7Ci0gICAgICAgICAgICB9Ci0gICAgICAgIAotICAgICAgICB9Ci0gICAKLSAgICB9Ci0gICAgZWxzZQotICAgIHsKLSAgICAgICAgcmV0dXJuIFJlc3VsdDsKLSAgICB9Ci0gICAgCi19Ci0KLS8qKgotICogRnVuY3Rpb24gOmFybVNhdEFkZF9TNjQoKQotICoKLSAqIERlc2NyaXB0aW9uIDoKLSAqICAgUmV0dXJucyB0aGUgcmVzdWx0IG9mIHNhdHVyYXRlZCBhZGRpdGlvbiBvZiB0aGUgdHdvIGlucHV0cyBWYWx1ZTEsIFZhbHVlMgotICoKLSAqIFBhcmFtZXRyczoKLSAqIFtpbl0gVmFsdWUxICAgICAgIEZpcnN0IE9wZXJhbmQKLSAqIFtpbl0gVmFsdWUyICAgICAgIFNlY29uZCBPcGVyYW5kCi0gKgotICogUmV0dXJuOgotICogW291dF0gICAgICAgICAgICAgUmVzdWx0IG9mIG9wZXJhdGlvbgotICogCi0gKiAgICAKLSAqKi8KLSAKLU9NWF9TNjQgYXJtU2F0QWRkX1M2NChPTVhfUzY0IFZhbHVlMSxPTVhfUzY0IFZhbHVlMikKLXsKLSAgICBPTVhfUzY0IFJlc3VsdDsKLSAgICAKLSAgICBSZXN1bHQgPSBWYWx1ZTEgKyBWYWx1ZTI7Ci0KLSAgICBpZiggKFZhbHVlMV5WYWx1ZTIpID49IDApCi0gICAgewotICAgICAgICAvKlNhbWUgc2lnbiovCi0gICAgICAgIGlmKCAoUmVzdWx0XlZhbHVlMSkgPj0gMCkKLSAgICAgICAgewotICAgICAgICAgICAgLypSZXN1bHQgaGFzIG5vdCBzYXR1cmF0ZWQqLwotICAgICAgICAgICAgcmV0dXJuIFJlc3VsdDsKLSAgICAgICAgfQotICAgICAgICBlbHNlCi0gICAgICAgIHsKLSAgICAgICAgICAgIGlmKFZhbHVlMSA+PSAwKQotICAgICAgICAgICAgewotICAgICAgICAgICAgICAgIC8qUmVzdWx0IGhhcyBzYXR1cmF0ZWQgaW4gcG9zaXRpdmUgc2lkZSovCi0gICAgICAgICAgICAgICAgUmVzdWx0ID0gT01YX01BWF9TNjQ7Ci0gICAgICAgICAgICAgICAgcmV0dXJuIFJlc3VsdDsKLSAgICAgICAgICAgIH0KLSAgICAgICAgICAgIGVsc2UKLSAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAvKlJlc3VsdCBoYXMgc2F0dXJhdGVkIGluIG5lZ2F0aXZlIHNpZGUqLwotICAgICAgICAgICAgICAgIHJldHVybiBPTVhfTUlOX1M2NDsKLSAgICAgICAgICAgIH0KLSAgICAgICAgCi0gICAgICAgIH0KLSAgIAotICAgIH0KLSAgICBlbHNlCi0gICAgewotICAgICAgICByZXR1cm4gUmVzdWx0OwotICAgIH0KLSAgICAKLX0KLQotLyoqIEZ1bmN0aW9uIDphcm1TYXRTdWJfUzMyKCkKLSAqIAotICogRGVzY3JpcHRpb24gOgotICogICAgIFJldHVybnMgdGhlIHJlc3VsdCBvZiBzYXR1cmF0ZWQgc3Vic3RyYWN0aW9uIG9mIHRoZSB0d28gaW5wdXRzIFZhbHVlMSwgVmFsdWUyCi0gKgotICogUGFyYW1ldHJzOgotICogW2luXSBWYWx1ZTEgICAgICAgRmlyc3QgT3BlcmFuZAotICogW2luXSBWYWx1ZTIgICAgICAgU2Vjb25kIE9wZXJhbmQKLSAqCi0gKiBSZXR1cm46Ci0gKiBbb3V0XSAgICAgICAgICAgICBSZXN1bHQgb2Ygb3BlcmF0aW9uCi0gKiAKLSAqKi8KLQotT01YX1MzMiBhcm1TYXRTdWJfUzMyKE9NWF9TMzIgVmFsdWUxLE9NWF9TMzIgVmFsdWUyKQotewotICAgIE9NWF9TMzIgUmVzdWx0OwotICAgIAotICAgIFJlc3VsdCA9IFZhbHVlMSAtIFZhbHVlMjsKLQotICAgIGlmKCAoVmFsdWUxXlZhbHVlMikgPCAwKQotICAgIHsKLSAgICAgICAgLypPcHBvc2l0ZSBzaWduKi8KLSAgICAgICAgaWYoIChSZXN1bHReVmFsdWUxKSA+PSAwKQotICAgICAgICB7Ci0gICAgICAgICAgICAvKlJlc3VsdCBoYXMgbm90IHNhdHVyYXRlZCovCi0gICAgICAgICAgICByZXR1cm4gUmVzdWx0OwotICAgICAgICB9Ci0gICAgICAgIGVsc2UKLSAgICAgICAgewotICAgICAgICAgICAgaWYoVmFsdWUxID49IDApCi0gICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgLypSZXN1bHQgaGFzIHNhdHVyYXRlZCBpbiBwb3NpdGl2ZSBzaWRlKi8KLSAgICAgICAgICAgICAgICByZXR1cm4gT01YX01BWF9TMzI7Ci0gICAgICAgICAgICB9Ci0gICAgICAgICAgICBlbHNlCi0gICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgLypSZXN1bHQgaGFzIHNhdHVyYXRlZCBpbiBuZWdhdGl2ZSBzaWRlKi8KLSAgICAgICAgICAgICAgICByZXR1cm4gT01YX01JTl9TMzI7Ci0gICAgICAgICAgICB9Ci0gICAgICAgIAotICAgICAgICB9Ci0gICAKLSAgICB9Ci0gICAgZWxzZQotICAgIHsKLSAgICAgICAgcmV0dXJuIFJlc3VsdDsKLSAgICB9Ci0gICAgCi19Ci0KLS8qKgotICogRnVuY3Rpb24g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zdHJlYW0gKi8KLSAgICBWYWx1ZSA9IChwQml0U3RyZWFtWzBdIDw8IDI0ICkgfCAoIHBCaXRTdHJlYW1bMV0gPDwgMTYpICB8IChwQml0U3RyZWFtWzJdIDw8IDggKSB8IChwQml0U3RyZWFtWzNdKSA7Ci0gICAgVmFsdWUgPSAoVmFsdWUgPDwgT2Zmc2V0ICkgfCAocEJpdFN0cmVhbVs0XSA+PiAoOC1PZmZzZXQpKTsKLQotICAgIC8qIFNlYXJjaCB0aHJvdWdoIHRoZSBjb2RlYm9vayAqLyAgICAKLSAgICBmb3IgKEluZGV4PTA7IHBDb2RlQm9vay0+Y29kZUxlbiAhPSAwOyBJbmRleCsrKQotICAgIHsKLSAgICAgICAgaWYgKHBDb2RlQm9vay0+Y29kZVdvcmQgPT0gKFZhbHVlID4+ICgzMiAtIHBDb2RlQm9vay0+Y29kZUxlbikpKQotICAgICAgICB7Ci0gICAgICAgICAgICBPZmZzZXQgICAgICAgPSBPZmZzZXQgKyBwQ29kZUJvb2stPmNvZGVMZW47Ci0gICAgICAgICAgICAqcHBCaXRTdHJlYW0gPSBwQml0U3RyZWFtICsgKE9mZnNldCA+PiAzKSA7Ci0gICAgICAgICAgICAqcE9mZnNldCAgICAgPSBPZmZzZXQgJiA3OwotICAgICAgICAgICAgCi0gICAgICAgICAgICByZXR1cm4gSW5kZXg7Ci0gICAgICAgIH0gICAgICAgIAotICAgICAgICBwQ29kZUJvb2srKzsKLSAgICB9Ci0KLSAgICAvKiBObyBjb2RlIG1hdGNoIGZvdW5kICovCi0gICAgcmV0dXJuIEFSTV9OT19DT0RFQk9PS19JTkRFWDsKLX0KLQotI2VuZGlmCi0KLS8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKLSAqIEZpeGVkIGJpdCBsZW5ndGggRW5jb2RlCi0gKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotCi0vKioKLSAqIEZ1bmN0aW9uOiBhcm1QYWNrQml0cwotIC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mVkaWN0b3IgYmxvY2sgYXJlIGluIHRoZSBzYW1lCi0gKiAgICAgICAgICAgICAgICAgICAgICAgICAgbWFjcm9ibG9jay4KLSAqIFtpbl0gcHJlZFFQICAgICAgcXVhbnRpemF0aW9uIHBhcmFtZXRlciBvZiB0aGUgcHJlZGljdG9yIGJsb2NrCi0gKiBbaW5dIHByZWREaXIgICAgIGluZGljYXRlcyB0aGUgcHJlZGljdGlvbiBkaXJlY3Rpb24gd2hpY2ggdGFrZXMgb25lCi0gKiAgICAgICAgICAgICAgICAgICAgICAgICAgb2YgdGhlIGZvbGxvd2luZyB2YWx1ZXM6Ci0gKiAgICAgICAgICAgICAgICAgICAgICAgICAgT01YX1ZJREVPX0hPUklaT05UQUwgICAgcHJlZGljdCBob3Jpem9udGFsbHkKLSAqICAgICAgICAgICAgICAgICAgICAgICAgICBPTVhfVklERU9fVkVSVElDQUwgICAgICBwcmVkaWN0IHZlcnRpY2FsbHkKLSAqIFtpbl0gQUNQcmVkRmxhZyAgYSBmbGFnIGluZGljYXRpbmcgaWYgQUMgcHJlZGljdGlvbiBzaG91bGQgYmUKLSAqICAgICAgICAgICAgICAgICAgICAgICAgICBwZXJmb3JtZWQuIEl0IGlzIGVxdWFsIHRvIGFjX3ByZWRfZmxhZyBpbiB0aGUgYml0Ci0gKiAgICAgICAgICAgICAgICAgICAgICAgICAgc3RyZWFtIHN5bnRheCBvZiBNUEVHLTQKLSAqIFtpbl0gdmlkZW9Db21wICAgdmlkZW8gY29tcG9uZW50IHR5cGUgKGx1bWluYW5jZSwgY2hyb21pbmFuY2Ugb3IKLSAqICAgICAgICAgICAgICAgICAgICAgICAgICBhbHBoYSkgb2YgdGhlIGN1cnJlbnQgYmxvY2sKLSAqIFtpbl0gZmxhZyAgICAgICAgVGhpcyBmbGFnIGRlZmluZXMgdGhlIGlmIG9uZSB3YW50cyB0byB1c2UgdGhpcyBmdW5jdGlvbnMgdG8KLSAqICAgICAgICAgICAgICAgICAgY2FsY3VsYXRlIF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iBEZXNjcmlwdGlvbjoKLSAqIFBlcmZvcm1zIHppZ3phZyBzY2FubmluZyBhbmQgVkxDIGVuY29kaW5nIGZvciBvbmUgaW50cmEgYmxvY2suCi0gKgotICogUmVtYXJrczoKLSAqCi0gKiBQYXJhbWV0ZXJzOgotICogW2luXSBwcEJpdFN0cmVhbSAgICAgcG9pbnRlciB0byB0aGUgcG9pbnRlciB0byB0aGUgY3VycmVudCBieXRlIGluCi0gKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRoZSBiaXQgc3RyZWFtCi0gKiBbaW5dIHBCaXRPZmZzZXQgICAgICBwb2ludGVyIHRvIHRoZSBiaXQgcG9zaXRpb24gaW4gdGhlIGJ5dGUgcG9pbnRlZAotICogICAgICAgICAgICAgICAgICAgICAgICAgICAgICBieSAqcHBCaXRTdHJlYW0uIFZhbGlkIHdpdGhpbiAwIHRvIDcuCi0gKiBbaW5dIHBRRGN0QmxrQ29lZiAgICBwb2ludGVyIHRvIHRoZSBxdWFudGl6ZWQgRENUIGNvZWZmaWNpZW50Ci0gKiBbaW5dIHByZWREaXIgICAgICAgICBBQyBwcmVkaWN0aW9uIGRpcmVjdGlvbiwgd2hpY2ggaXMgdXNlZCB0byBkZWNpZGUKLSAqICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdGhlIHppZ3phZyBzY2FuIHBhdHRlcm4uIFRoaXMgdGFrZXMgb25lIG9mIHRoZQotICogICAgICAgICAgICAgICAgICAgICAgICAgICAgICBmb2xsb3dpbmcgdmFsdWVzOgotICogICAgICAgICAgICAgICAgICAgICAgICAgICAgICBPTVhfVklERU9fTk9ORSAgICAgICAgICBBQyBwcmVkaWN0aW9uIG5vdCB1c2VkLgotICogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBQZXJmb3JtcyBjbGFzc2ljYWwgemlnemFnCi0gKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNjYW4uCi0gKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIE9NWF9WSURFT19IT1JJWk9OVEFMICAgIEhvcml6b250YWwgcHJlZGljdGlvbi4KLSAqICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgUGVyZm9ybXMgYWx0ZXJuYXRlLXZlcnRpY2FsCi0gKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHppZ3phZyBzY2FuLgotICogICAgICAgICAgICAgICAgICAgICAgICAgICAgICBPTVhfVklERU9fVkVSVElDQUwgICAgICBWZXJ0aWNhbCBwcmVkaWN0aW9uLgotICogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBQZXJmb3JtcyBhbHRlcm5hdGUtaG9yaXpvbnRhbAotICogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB6aWd6YWcgc2Nhbi4KLSAqIFtpbl0gcGF0dGVybiAgICAgICAgIGJsb2NrIHBhdHRlcm4gd2hpY2ggaXMgdXNlZCB0byBkZWNpZGUgd2hldGhlcgotICogICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0aGlzIGJsb2NrIGlzIGVuY29kZWQKLSAqIFtpbl0gc3RhcnQgICAgICAgICAgIHN0YXJ0IGluZGljYXRlcyB3aGV0aGVyIHRoZSBlbmNvZGluZyBiZWdpbnMgd2l0aCAwdGggZWxlbWVudAotICogICAgICAgICAgICAgICAgICAgICAgb3IgMXN0LgotICogW291dF0gICAgcHBCaXRTdHJlYW0gICAgICpwcEJpdFN0cmVhbSBpcyB1cGRhdGVkIGFmdGVyIHRoZSBibG9jayBpcyBlbmNvZGVkLAotICogICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzbyB0aGF0IGl0IHBvaW50cyB0byB0aGUgY3VycmVudCBieXRlIGluIHRoZSBiaXQKLSAqICAgICAgICAgICAgICAgIC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ZSBpbgotICogICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0aGUgYml0c3RyZWFtIGJ1ZmZlcgotICogW2luXSBwQml0T2Zmc2V0ICAgICAgcG9pbnRlciB0byB0aGUgYml0IHBvc2l0aW9uIGluIHRoZSBieXRlIHBvaW50ZWQKLSAqICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdG8gYnkgKnBwQml0U3RyZWFtLiAqcEJpdE9mZnNldCBpcyB2YWxpZCB3aXRoaW4KLSAqICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgWzAtN10uCi0gKiBbaW5dIHByZWREaXIgICAgICAgICBBQyBwcmVkaWN0aW9uIGRpcmVjdGlvbiB3aGljaCBpcyB1c2VkIHRvIGRlY2lkZQotICogICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0aGUgemlnemFnIHNjYW4gcGF0dGVybi4gSXQgdGFrZXMgb25lIG9mIHRoZQotICogICAgICAgICAgICAgICAgICAgICAgICAgICAgICBmb2xsb3dpbmcgdmFsdWVzOgotICogICAgICAgICAgICAgICAgICAgICAgICAgICAgICBPTVhfVklERU9fTk9ORSAgQUMgcHJlZGljdGlvbiBub3QgdXNlZDsKLSAqICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBlcmZvcm0gY2xhc3NpY2FsIHppZ3phZyBzY2FuOwotICogICAgICAgICAgICAgICAgICAgICAgICAgICAgICBPTVhfVklERU9fSE9SSVpPTlRBTCAgICBIb3Jpem9udGFsIHByZWRpY3Rpb247Ci0gKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBlcmZvcm0gYWx0ZXJuYXRlLXZlcnRpY2FsCi0gKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHppZ3phZyBzY2FuOwotICogICAgICAgICAgICAgICAgICAgICAgICAgICAgICBPTVhfVklERU9fVkVSVElDQUwgICAgICBWZXJ0aWNhbCBwcmVkaWN0aW9uOwotICogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0aHVzIHBlcmZvcm0KLSAqICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYWx0ZXJuYXRlLWhvcml6b250YWwKLSAqICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgemlnemFnIHNjYW4uCi0gKiBbaW5dIHZpZGVvQ29tcCAgICAgICB2aWRlbyBjb21wb25lbnQgdHlwZSAobHVtaW5hbmNlLCBjaHJvbWluYW5jZSBvcgotICogICAgICAgICAgICAgICAgICAgICAgICAgICAgICBhbHBoYSkgb2YgdGhlIGN1cnJlbnQgYmxvY2sKLSAqIFtpbl0gc2hvcnRWaWRlb0hlYWRlciBiaW5hcnkgZmxhZyBpbmRpY2F0aW5nIHByZXNlbmNlIG9mIHNob3J0X3ZpZGVvX2hlYWRlcjsgZXNjYXBlIG1vZGVzIDAtMyBhcmUgdXNlZCBpZiBzaG9ydFZpZGVvSGVhZGVyPT0wLAotICogICAgICAgICAgICAgICAgICAgICAgICAgICBhbmQgZXNjYXBlIG1vZGUgNCBpcyB1c2VkIHdoZW4gc2hvcnRWaWRlb0hlYWRlcj09MS4KLSAqIFtpbl0gc3RhcnQgICAgICAgICAgIHN0YXJ0IGluZGljYXRlcyB3aGV0aGVyIHRoZSBlbmNvZGluZyBiZWdpbnMgd2l0aCAwdGggZWxlbWVudAotICogICAgICAgICAgICAgICAgICAgICAgb3IgMXN0LgotICogW291dF0gICAgcHBCaXRTdHJlYW0gICAgICpwcEJpdFN0cmVhbSBpcyB1cGRhdGVkIGFmdGVyIHRoZSBibG9jayBpcwotICogICAgICAgICAgICAgICAgICAgICAgICAgICAgICBkZWNvZGVkLCBzbyB0aGF0IGl0IHBvaW50cyB0byB0aGUgY3VycmVudCBieXRlCi0gKiAgICAgICAgICAgICAgICAgICAgICAgIC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gICAgICAgICAgICAgICAgIDB0aCBlbGVtZW50IG9yIDFzdC4KLSAqIFtpbi9vdXRdIHBMYXN0ICAgICAgIHBvaW50ZXIgdG8gbGFzdCBzdGF0dXMgZmxhZwotICogW2luXSBydW5CZWdpblNpbmdsZUxldmVsRW50cmllc0wwICAgICAgVGhlIHJ1biB2YWx1ZSBmcm9tIHdoaWNoIGxldmVsIAotICogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgd2lsbCBiZSBlcXVhbCB0byAxOiBsYXN0ID09IDAKLSAqIFtpbl0gSW5kZXhCZWdpblNpbmdsZUxldmVsRW50cmllc0wwICAgIEFycmF5IGluZGV4IGluIHRoZSBWTEMgdGFibGUgCi0gKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwb2ludGluZyB0byB0aGUgIAotICogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcnVuQmVnaW5TaW5nbGVMZXZlbEVudHJpZXNMMCAKLSAqIFtpbl0gcnVuQmVnaW5TaW5nbGVMZXZlbEVudHJpZXNMMSAgICAgIFRoZSBydW4gdmFsdWUgZnJvbSB3aGljaCBsZXZlbCAKLSAqICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHdpbGwgYmUgZXF1YWwgdG8gMTogbGFzdCA9PSAxCi0gKiBbaW5dIEluZGV4QmVnaW5TaW5nbGVMZXZlbEVudHJpZXNMMSAgICBBcnJheSBpbmRleCBpbiB0aGUgVkxDIHRhYmxlIAotICogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcG9pbnRpbmcgdG8gdGhlICAKLSAqICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJ1bkJlZ2luU2luZ2xlTGV2ZWxFbnRyaWVzTDAgCi0gKiBbaW5dIHBSdW5JbmRleFRhYmxlTDAgICAgUnVuIEluZGV4IHRhYmxlIGRlZmluZWQgaW4gCi0gKiAgICAgICAgICAgICAgICAgICAgICAgICAgYXJtVkNNNFAyX0h1ZmZfVGFibGVzX1ZMQy5jIGZvciBsYXN0ID09IDAKLSAqIFtpbl0gcFZsY1RhYmxlTDAgICAgICAgICBWTEMgdGFibGUgZm9yIGxhc3QgPT0gMAotICogW2luXSBwUnVuSW5kZXhUYWJsZUwxICAgIFJ1biBJbmRleCB0YWJsZSBkZWZpbmVkIGluIAotICogICAgICAgICAgICAgICAgICAgICAgICAgIGFybVZDTTRQMl9IdWZmX1RhYmxlc19WTEMuYyBmb3IgbGFzdCA9PSAxCi0gKiBbaW5dIHBWbGNUYWJsZUwxICAgICAgICAgVkxDIHRhYmxlIGZvciBsYXN0ID09IDEKLSAqIFtpbl0gcExNQVhUYWJsZUwwICAgICAgICBMZXZlbCBNQVggdGFibGUgZGVmaW5lZCBpbiAKLSAqICAgICAgICAgICAgICAgICAgICAgICAgICBhcm1WQ000UDJfSHVmZl9UYWJsZXNfVkxDLmMgZm9yIGxhc3QgPT0gMAotICogW2luXSBwTE1BWFRhYmxlTDEgICAgICAgIExldmVsIE1BWCB0YWJsZSBkZWZpbmVkIGluIAotICogICAgICAgICAgICAgICAgICAgICAgICAgIGFybVZDTTRQMl9IdWZmX1RhYmxlc19WTEMuYyBmb3IgbGFzdCA9PSAxCi0gKiBbaW5dIHBSTUFYVGFibGVMMCAgICAgICAgUnVuIE1BWCB0YWJsZSBkZWZpbmVkIGluIAotICogICAgICAgICAgICAgICAgICAgICAgICAgIGFybVZDTTRQMl9IdWZmX1RhYmxlc19WTEMuYyBmb3IgbGFzdCA9PSAwCi0gKiBbaW5dIHBSTUFYVGFibGVMMSAgICAgICAgUnVuIE1BWCB0YWJsZSBkZWZpbmVkIGluIAotICogICAgICAgICAgICAgICAgICAgICAgICAgIGFybVZDTTRQMl9IdWZmX1RhYmxlc19WTEMuYyBmb3IgbGFzdCA9PSAxCi0gKiBbb3V0XXBEc3QJCQkgICAgcG9pbnRlciB0byB0aGUgY29lZmZpY2llbnQgYnVmZmV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ICBzdGFydCBpbmRpY2F0ZXMgd2hldGhlciB0aGUgZW5jb2RpbmcgYmVnaW5zIHdpdGggCi0gKiAgICAgICAgICAgICAgICAgICAgICAgIDB0aCBlbGVtZW50IG9yIDFzdC4KLSAqIFtpbl0gIG1heFN0b3JlUnVuTDAgICAgTWF4IHN0b3JlIHBvc3NpYmxlIChjb25zaWRlcmluZyBsYXN0IGFuZCBpbnRlci9pbnRyYSkKLSAqICAgICAgICAgICAgICAgICAgICAgICAgZm9yIGxhc3QgPSAwCi0gKiBbaW5dICBtYXhTdG9yZVJ1bkwxICAgIE1heCBzdG9yZSBwb3NzaWJsZSAoY29uc2lkZXJpbmcgbGFzdCBhbmQgaW50ZXIvaW50cmEpCi0gKiAgICAgICAgICAgICAgICAgICAgICAgIGZvciBsYXN0ID0gMQotICogW2luXSAgbWF4UnVuRm9yTXVsdGlwbGVFbnRyaWVzTDAgCi0gKiAgICAgICAgICAgICAgICAgICAgICAgIFRoZSBydW4gdmFsdWUgYWZ0ZXIgd2hpY2ggbGV2ZWwgCi0gKiAgICAgICAgICAgICAgICAgICAgICAgIHdpbGwgYmUgZXF1YWwgdG8gMTogCi0gKiAgICAgICAgICAgICAgICAgICAgICAgIChjb25zaWRlcmluZyBsYXN0IGFuZCBpbnRlci9pbnRyYSBzdGF0dXMpIGZvciBsYXN0ID0gMAotICogW2luXSAgbWF4UnVuRm9yTXVsdGlwbGVFbnRyaWVzTDEgCi0gKiAgICAgICAgICAgICAgICAgICAgICAgIFRoZSBydW4gdmFsdWUgYWZ0ZXIgd2hpY2ggbGV2ZWwgCi0gKiAgICAgICAgICAgICAgICAgICAgICAgIHdpbGwgYmUgZXF1YWwgdG8gMTogCi0gKiAgICAgICAgICAgICAgICAgICAgICAgIChjb25zaWRlcmluZyBsYXN0IGFuZCBpbnRlci9pbnRyYSBzdGF0dXMpIGZvciBsYXN0ID0gMQotICogW2luXSAgcFJ1bkluZGV4VGFibGVMMCBSdW4gSW5kZXggdGFibGUgZGVmaW5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aXplZCBEQ1QgY29lZmZpY2llbnQKLSAqIFtvdXRdIHBwQml0U3RyZWFtICAgICAgKnBwQml0U3RyZWFtIGlzIHVwZGF0ZWQgYWZ0ZXIgdGhlIGJsb2NrIGlzIGVuY29kZWQKLSAqICAgICAgICAgICAgICAgICAgICAgICAgc28gdGhhdCBpdCBwb2ludHMgdG8gdGhlIGN1cnJlbnQgYnl0ZSBpbiB0aGUgYml0Ci0gKiAgICAgICAgICAgICAgICAgICAgICAgIHN0cmVhbSBidWZmZXIuCi0gKiBbb3V0XSBwQml0T2Zmc2V0ICAgICAgICpwQml0T2Zmc2V0IGlzIHVwZGF0ZWQgc28gdGhhdCBpdCBwb2ludHMgdG8gdGhlCi0gKiAgICAgICAgICAgICAgICAgICAgICAgIGN1cnJlbnQgYml0IHBvc2l0aW9uIGluIHRoZSBieXRlIHBvaW50ZWQgYnkKLSAqICAgICAgICAgICAgICAgICAgICAgICAgKnBwQml0U3RyZWFtLgotICoKLSAqIFJldHVybiBWYWx1ZToKLSAqIFN0YW5kYXJkIE9NWFJlc3VsdCByZXN1bHQuIFNlZSBlbnVtZXJhdGlvbiBmb3IgcG9zc2libGUgcmVzdWx0IGNvZGVzLgotICoKLSAqLwotCi0KLU9NWFJlc3VsdCBhcm1WQ000UDJfUHV0VkxDQml0cyAoCi0gICAgICAgICAgICAgIE9NWF9VOCAqKnBwQml0U3RyZWFtLAotICAgICAgICAgICAgICBPTVhfSU5UICogcEJpdE9mZnNldCwKLSAgICAgICAgICAgICAgY29uc3QgT01YX1MxNiAqcFFEY3RCbGtDb2VmLAotICAgICAgICAgICAgICBPTVhfSU5UIHNob3J0VmlkZW9IZWFkZXIsCi0gICAgICAgICAgICAgIE9NWF9VOCBzdGFydCwKLSAgICAgICAgICAgICAgT01YX1U4IG1heFN0b3JlUnVuTDAsCi0gICAgICAgICAgICAgIE9NWF9VOCBtYXhTdG9yZVJ1bkwxLAotICAgICAgICAgICAgICBPTVhfVTggIG1heFJ1bkZvck11bHRpc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90aW9uIHZlY3RvciAKLSAqICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbXBvbmVudCBpbiAxLzggcGl4ZWwgdW5pdCAoMH43KSAKLSAqICBbaW5dICAgIGR5ICAgICAgICAgICAgICBGcmFjdGlvbmFsIHBhcnQgb2YgdmVydGljYWwgbW90aW9uIHZlY3RvciAKLSAqICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbXBvbmVudCBpbiAxLzggcGl4ZWwgdW5pdCAoMH43KQotICogIFtvdXRdICAgcERzdCAgICAgICAgICAgIFBvaW50ZXIgdG8gdGhlIGludGVycG9sYXRpb24gYnVmZmVyCi0gKgotICogUmV0dXJuIFZhbHVlOgotICogU3RhbmRhcmQgT01YUmVzdWx0IHZhbHVlLgotICoKLSAqLwotIE9NWFJlc3VsdCBhcm1WQ000UDEwX0ludGVycG9sYXRlX0Nocm9tYSgKLSAgICAgICAgT01YX1U4ICAgICAgKnBTcmMsCi0gICAgICAgIE9NWF9VMzIgICAgIGlTcmNTdGVwLAotICAgICAgICBPTVhfVTggICAgICAqcERzdCwKLSAgICAgICAgT01YX1UzMiAgICAgaURzdFN0ZXAsCi0gICAgICAgIE9NWF9VMzIgICAgIGlXaWR0aCwKLSAgICAgICAgT01YX1UzMiAgICAgaUhlaWdodCwKLSAgICAgICAgT01YX1UzMiAgICAgZHgsCi0gICAgICAgIE9NWF9VMzIgICAgIGR5Ci0pOwotCi0vKioKLSAqIEZ1bmN0aW9uOiBhcm1WQ000UDEwX0ludGVycG9sYXRlX0x1bWEKLSAqCi0gKiBEZXNjcmlwdGlvbjoKLSAqIFRoaXMgZnVuY3Rpb24gcGVyZm9ybXMgaW50ZXJwb2xhdGlvbiBmb3IgbHVtYSBjb21wb25lbnRzLgotICoKLSAqIFJlbWFya3M6Ci0gKgotICogIFtpbl0gICAgcFNyYyAgICAgICAgICAgIFBvaW50ZXIgdG8gdG9wLWxlZnQgY29ybmVyIG9mIGJsb2NrIHVzZWQgdG8gCi0gKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpbnRlcnBvbGF0ZSBpbiB0aGUgcmVjb25zdHJ1Y3RlZCBmcmFtZSBwbGFuZQotICogIFtpbl0gICAgaVNyY1N0ZXAgICAgU3RlcCBvZiB0aGUgc291cmNlIGJ1ZmZlci4KLSAqICBbaW5dICAgIGlEc3RTdGVwICAgIFN0ZXAgb2YgdGhlIGRlc3RpbmF0aW9uKGludGVycG9sYXRpb24pIGJ1ZmZlci4KLSAqICBbaW5dICAgIGlXaWR0aCAgICAgIFdpZHRoIG9mIHRoZSBjdXJyZW50IGJsb2NrCi0gKiAgW2luXSAgICBpSGVpZ2h0ICAgICBIZWlnaHQgb2YgdGhlIGN1cnJlbnQgYmxvY2sKLSAqICBbaW5dICAgIGR4ICAgICAgICAgICAgICBGcmFjdGlvbmFsIHBhcnQgb2YgaG9yaXpvbnRhbCBtb3Rpb24gdmVjdG9yIAotICogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY29tcG9uZW50IGluIDEvNCBwaXhlbCB1bml0ICgwfjMpIAotICogIFtpbl0gICAgZHkgICAgICAgICAgICAgIEZyYWN0aW9uYWwgcGFydCBvZiB2ZXJ0aWNhbCBtb3Rpb24gdmVjdG9yIAotICogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY29tcG9uZW50IGluIDEvNCBwaXhlbCB1bml0ICgwfjMpIAotICogIFtvdXRdICAgcERzdCAgICAgICAgICAgIFBvaW50ZXIgdG8gdGhlIGludGVycG9sYXRpb24gYnVmZmVyCi0gKgotICogUmV0dXJuIFZhbHVlOgotICogU3RhbmRhcmQgT01YUmVzdWx0IHZhbHVlLgotICoKLSAqLwotCi0gT01YUmVzdWx0IGFybVZDTTRQMTBfSW50ZXJwb2xhdGVfTHVtYSgKLSAgICAgY29uc3QgT01YX1U4ICAgICAqcFNy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VycmVudCBibG9jayBvciBtYWNyb2Jsb2NrIAotICogICBzaXplIC0gc2l6ZSBvZiB0aGUgY3VycmVudCBibG9jayBvciBtYWNyb2Jsb2NrOyBtdXN0IGJlIGVxdWFsIHRvIDggb3IgCi0gKiAgICAgICAgICAgIDE2LiAKLSAqCi0gKiBPdXRwdXQgQXJndW1lbnRzOgotICogICAKLSAqICAgcERzdE1WIC0gcG9pbnRlciB0byB0aGUgbGltaXRlZCBtb3Rpb24gdmVjdG9yIAotICoKLSAqIFJldHVybiBWYWx1ZToKLSAqICAgIAotICogICAgT01YX1N0c19Ob0VyciAtIG5vIGVycm9yIAotICogICAgT01YX1N0c19CYWRBcmdFcnIgLSBiYWQgYXJndW1lbnRzLiAgUmV0dXJuZWQgaWYgb25lIG9yIG1vcmUgb2YgdGhlIAotICogICAgICAgICAgICAgIGZvbGxvd2luZyBjb25kaXRpb25zIGlzIHRydWU6IAotICogICAgLSAgICBhdCBsZWFzdCBvbmUgb2YgdGhlIGZvbGxvd2luZyBwb2ludGVycyBpcyBOVUxMOiAKLSAqICAgICAgICAgcFNyY01WLCBwRHN0TVYsIG9yIHBSZWN0Vk9QUmVmLiAKLSAqICAgIC0gICAgc2l6ZSBpcyBub3QgZXF1YWwgdG8gZWl0aGVyIDggb3IgMTYuIAotICogICAgLSAgICB0aGUgd2lkdGggb3IgaGVpZ2h0IG9mIHRoZSBib3VuZGluZyByZWN0YW5nbGUgaXMgbGVzcyB0aGFuIAotICogICAgICAgICB0d2ljZSB0aGUgYmxvY2sgc2l6ZS4KLSAqLwotT01YUmVzdWx0IG9teFZDQ09NTV9MaW1pdE1WVG9SZWN0ICgKLSAgICBjb25zdCBPTVhWQ01vdGlvblZlY3RvciAqcFNyY01WLAotICAgIE9NWFZDTW90aW9uVmVjdG9yICpwRHN0TVYsCi0gICAgY29uc3QgT01YUmVjdCAqcFJlY3RWT1BSZWYsCi0gICAgT01YX0lOVCBYY29vcmQsCi0gICAgT01YX0lOVCBZY29vcmQsCi0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QgKi8KLSAgICBPTVhfUzMyIHFwOyAgICAgICAgICAgICAgICAgICAgICAvKiBxdWFudGl6YXRpb24gcGFyYW1ldGVyKi8KLSAgICBPTVhfVTMyIGNicHk7ICAgICAgICAgICAgICAgICAgICAvKiBDQlAgTHVtYSAqLwotICAgIE9NWF9VMzIgY2JwYzsgICAgICAgICAgICAgICAgICAgIC8qIENCUCBDaHJvbWEgKi8KLSAgICBPTVhWQ01vdGlvblZlY3RvciBwTVYwWzJdWzJdOyAgICAvKiBtb3Rpb24gdmVjdG9yLCByZXByZXNlbnRlZCB1c2luZyAxLzItcGVsIHVuaXRzLCAKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKiBwTVYwW2Jsb2NreV1bYmxvY2t4XSAoYmxvY2t5ID0gMH4xLCBibG9ja3ggPTB+MSkgCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0gICAgT01YVkNNb3Rpb25WZWN0b3IgcE1WUHJlZFsyXVsyXTsgLyogbW90aW9uIHZlY3RvciBwcmVkaWN0aW9uLCByZXByZXNlbnRlZCB1c2luZyAxLzItcGVsIHVuaXRzLCAKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKiBwTVZQcmVkW2Jsb2NreV1bYmxvY2t4XSAoYmxvY2t5ID0gMH4xLCBibG9ja3ggPSAwfjEpIAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotICAgIE9NWF9VOCBwUHJlZERpclsyXVsyXTsgICAgICAgICAgIC8qIEFDIHByZWRpY3Rpb24gZGlyZWN0aW9uOiAKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKiAgIE9NWF9WQ19OT05FLCBPTVhfVkNfVkVSVElDQUwsIE9NWF9WQ19IT1JJWk9OVEFMIAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqLwotfSBPTVhWQ000UDJNQkluZm8sICpPTVhWQ000UDJNQ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sgICAgICAgICAgIC8qIFJ1bnMgZm9yIGxldmVscyBhbmQgdHJhaWxpbmcgb25lcywgaW4gcmV2ZXJzZSB6aWctemFnIG9yZGVyICovCi19IE9NWFZDTTRQMTBWTENJbmZvOwotCi0KLQotLyogNi4zLjEuOCBNYWNyb2Jsb2NrIEluZm9ybWF0aW9uICAqLwotCi10eXBlZGVmIHN0cnVjdCB7Ci0gICAgT01YX1MzMiBzbGljZUlkOyAgICAgICAgICAgICAgICAgICAgICAgICAgLyogc2xpY2UgbnVtYmVyICovCi0gICAgT01YVkNNNFAxME1hY3JvYmxvY2tUeXBlIG1iVHlwZTsgICAgICAgICAgLyogTUIgdHlwZSAqLwotICAgIE9NWFZDTTRQMTBTdWJNYWNyb2Jsb2NrVHlwZSBzdWJNQlR5cGVbNF07IC8qIHN1Yi1ibG9jayB0eXBlICovCi0gICAgT01YX1MzMiBxcHk7ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLyogcXAgZm9yIGx1bWEgKi8KLSAgICBPTVhfUzMyIHFwYzsgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvKiBxcCBmb3IgY2hyb21hICovCi0gICAgT01YX1UzMiBjYnB5OyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLyogQ0JQIEx1bWEgKi8KLSAgICBPTVhfVTMyIGNicGM7ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvKiBDQlAgQ2hyb21hICovCi0gICAgT01YVkNNb3Rpb25WZWN0b3IgcE1WMFs0XVs0XTsgLyogbW90aW9uIHZlY3RvciwgcmVwcmVzZW50ZWQgdXNpbmcgMS80LXBlbCB1bml0cywgcE1WMFtibG9ja3ldW2Jsb2NreF0gKGJsb2NreSA9IDB+MywgYmxvY2t4ID0wfjMpICovCi0gICAgT01YVkNNb3Rpb25WZWN0b3IgcE1WUHJlZFs0XVs0XTsgLyogbW90aW9uIHZlY3RvciBwcmVkaWN0aW9uLCBSZXByZXNlbnRlZCB1c2luZyAxLzQtcGVsIHVua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Bjb25zdCBPTVhfUzE2ICpwU3JjQ29lZmYsCi0gICAgY29uc3QgT01YX1U4ICpwU2Nhbk1hdHJpeCwKLSAgICBPTVhfVTggYkFDLAotICAgIE9NWF9VMzIgTWF4TnVtQ29lZiwKLSAgICBPTVhWQ000UDEwVkxDSW5mbypwRHN0VkxDSW5mbwotKTsKLQotCi0KLSNpZmRlZiBfX2NwbHVzcGx1cwotfQotI2VuZGlmCi0KLSNlbmRpZiAvKiogZW5kIG9mICNkZWZpbmUgX09NWFZDX0hfICovCi0KLS8qKiBFT0YgKi8KLQpkaWZmIC0tZ2l0IGEvbWVkaWEvbGlic3RhZ2VmcmlnaHQvY29kZWNzL29uMi9oMjY0ZGVjL29teGRsL2FybV9uZW9uL3ZjL2FwaS9vbXhWQ19zLmggYi9tZWRpYS9saWJzdGFnZWZyaWdodC9jb2RlY3Mvb24yL2gyNjRkZWMvb214ZGwvYXJtX25lb24vdmMvYXBpL29teFZDX3MuaApkZWxldGVkIGZpbGUgbW9kZSAxMDA3NTUKaW5kZXggODlmMzA0MC4uMDAwMDAwMAotLS0gYS9tZWRpYS9saWJzdGFnZWZyaWdodC9jb2RlY3Mvb24yL2gyNjRkZWMvb214ZGwvYXJtX25lb24vdmMvYXBpL29teFZDX3MuaAorKysgL2Rldi9udWxsCkBAIC0xLDEyOSArMCwwIEBACi07LyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgotOy8vIENvcHlyaWdodCAoYykgMTk5OS0yMDA1IFRoZSBLaHJvbm9zIEdyb3VwIEluYy4gQWxsIFJpZ2h0cyBSZXNlcnZlZAotOy8vCi07Ly8KLTsvLwotOy8vCi07Ly8KLTsvLwotOy8vCi07Ly8KLTsqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0KLTsvKiogPT09PT09PT09PT09PT09I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VybiBWYWx1ZToKLSA7ICogT01YX1N0c19Ob0VyciAgICAgLSBubyBlcnJvcgotIDsgKiBPTVhfU3RzX0JhZEFyZ0VyciAtIGJhZCBhcmd1bWVudHM7IHJldHVybmVkIHVuZGVyIGFueSBvZiB0aGUgZm9sbG93aW5nIGNvbmRpdGlvbnM6Ci0gOyAqICAgICAgICAgICAgICAgICAgIC0gb25lIG9yIG1vcmUgb2YgdGhlIGZvbGxvd2luZyBwb2ludGVycyBpcyBOVUxMOiAgcFNyYywgcERzdAotIDsgKiAgICAgICAgICAgICAgICAgICAtIG9uZSBvciBtb3JlIG9mIHRoZSBmb2xsb3dpbmcgcG9pbnRlcnMgaXMgbm90IGFsaWduZWQgb24gYW4gMTYtYnl0ZSBib3VuZGFyeTogIHBTcmMsIHBEc3QKLSA7ICogICAgICAgICAgICAgICAgICAgLSBzdGVwIDwxNiBvciBzdGVwIGlzIG5vdCBhIG11bHRpcGxlIG9mIDE2LiAgCi0gOyAqLwotCi0gICBJTkNMVURFIG9teHR5cGVzX3MuaAotICAgCi0gICAgIAotICAgICBNX1ZBUklBTlRTIENvcnRleEE4Ci0gICAgIAotICAgICBJRiBDb3J0ZXhBOAotICAgICAKLSAgICAgCi0gOy8vSW5wdXQgQXJndW1lbnRzCi1wU3JjICAgIFJOIDAgICAgICAgIAotcERzdCAgICBSTiAxICAgICAgICAKLXN0ZXAgICAgUk4gMgotCi07Ly9Mb2NhbCBWYXJpYWJsZXMKLVJldHVybiAgUk4gMAotOy8vIE5lb24gUmVnaXN0ZXJzCi0KLVgwICAgICAgRE4gRDAuUzggCi1YMSAgICAgIEROIEQxLlM4IAotWDIgICAgICBETiBEMi5TOAotWDMgICAgICBETiBEMy5TOAotWDQgICAgICBETiBENC5TOAotWDUgICAgICBETiBENS5TOAotWDYgICAgICBETiBENi5TOAotWDcgICAgICBETiBENy5TOCAKLSAKLSAgICAgTV9TVEFSVCBvbXhWQ0NPTU1fQ29weTE2eDE2Ci0gICAgICAgICAKLSAgIC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jRHN0UGxhbmUgICAgUk4gIDAKLWlGcmFtZVdpZHRoICAgICBSTiAgMQotaUZyYW1lSGVpZ2h0ICAgIFJOICAyICAgIAotaUV4cGFuZFBlbHMgICAgIFJOICAzCi1pUGxhbmVTdGVwICAgICAgUk4gIDQKLXBUb3AgICAgICAgICAgICBSTiAgNQotcEJvdCAgICAgICAgICAgIFJOICA2Ci1wRHN0VG9wICAgICAgICAgUk4gIDcKLXBEc3RCb3QgICAgICAgICBSTiAgOAotcExlZnQgICAgICAgICAgIFJOICA1Ci1wUmlnaHQgICAgICAgICAgUk4gIDYKLXBEc3RMZWZ0ICAgICAgICBSTiAgOQotcERzdFJpZ2h0ICAgICAgIFJOICAxMAotT2Zmc2V0ICAgICAgICAgIFJOICAxMQotVGVtcCAgICAgICAgICAgIFJOICAxNAotQ291bnRlciAgICAgICAgIFJOICAxMgotVG1wICAgICAgICAgICAgIFJOICA3Ci07Ly9PdXRwdXQgcmVnaXN0ZXJzCi0KLXJlc3VsdCAgICAgICAgICBSTiAgMAotOy8vIE5lb24gcmVnaXN0ZXJzCi1xRGF0YTAgICAgICAgICAgUU4gIDAuVTgKLXFEYXRhMSAgICAgICAgICBRTiAgMS5VOAotZERhdGEwICAgICAgICAgIEROICAwLlU4Ci1kRGF0YTEgICAgICAgICAgRE4gIDEuVTgKLWREYXRhMiAgICAgICAgICBETiAgMi5VOAotZERhdGEzICAgICAgICAgIEROICAzLlU4Ci0KLSAgICAgICAgOy8vIERlZmluZSBzdGFjayBhcmd1bWVudHMKLSAgICAgICAgTV9BUkcgICAgICAgcFBsYW5lU3RlcCwgNAotICAgICAgICAKLSAgICAgICAgOy8vIExvYWQgYXJndW1lbnQgZnJvbSB0aGUgc3RhY2sKLSAgICAgICAgTV9MRFIgICAgICAgaVBsYW5lU3RlcCwgcFBsYW5lU3RlcAotICAgICAgICAKLSAgICAgICAgU1VCICAgICAgICAgcFRvcCwgcFNyY0RzdFBsYW5lLCAjMCAgICAgICAgICAgICAgOy8vIF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3RlcAotICAgICAgICBWU1QxICAgICAgICBxRGF0YTEsIFtwRHN0Qm90IEAxMjhdLCBpUGxhbmVTdGVwCi0gICAgICAgIFZTVDEgICAgICAgIHFEYXRhMSwgW3BEc3RCb3QgQDEyOF0sIGlQbGFuZVN0ZXAKLSAgICAgICAgVlNUMSAgICAgICAgcURhdGExLCBbcERzdEJvdCBAMTI4XSwgaVBsYW5lU3RlcAotICAgICAgICBWU1QxICAgICAgICBxRGF0YTEsIFtwRHN0Qm90IEAxMjhdLCBpUGxhbmVTdGVwCi0gICAgICAgIFZTVDEgICAgICAgIHFEYXRhMSwgW3BEc3RCb3QgQDEyOF0sIGlQbGFuZVN0ZXAKLSAgICAgICAgVlNUMSAgICAgICAgcURhdGExLCBbcERzdEJvdCBAMTI4XSwgaVBsYW5lU3RlcAotICAgICAgICBWU1QxICAgICAgICBxRGF0YTEsIFtwRHN0Qm90IEAxMjhdLCBpUGxhbmVTdGVwICAgICAgICAKLSAgICAgICAgQkdUICAgICAgICAgVmVyMTZMb29wMAotCi0gICAgICAgIFNVQlMgICAgICAgIFRlbXAsIFRlbXAsICMxNgotICAgICAgICBCR1QgICAgICAgICBIb3IxNkxvb3AwMAotICAgICAgICBCICAgICAgICAgICBFbmRBbGlnbmVkTG9vcAotICAgICAgICAKLSAgICAgICAgOy8vIENhc2UgZm9yIDggYnl0ZSBhbGlnbm1lbnQKLUhvcjhMb29wMDAKLSAgICAgICAgU1VCICAgICAgICAgcERzdFRvcCwgcFRvcCwgT2Zmc2V0Ci0gICAgICAgIFZMRDEgICAgICAgIHFEYXRhMCwgW3BUb3AgQDY0XSEKLSAgICAgICAgTU9WICAgICAgICAgQ291bnRlciwgaUV4cGFuZFBlbHMgICAgICAgICAgICAgICAgOy8vIElubmVyIGxvb3AgY291bnRlcgotICAgICAgICBBREQgICAgICAgICBwRHN0Qm90LCBwQm90LCBpUGxhbmVTdGVwCi0gICAgICAgIFZMRDEgICAgICAgIHFEYXRhMSwgW3BCb3QgQDY0X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RhcnQgcGl4ZWwgZnJvbSB0aGUgZnJhbWUKLSAgICAgICAgOy8vIFJpZ2h0IHJlZ2lvbiA9IGNvcHkgdGhlIHJvdyB3aXRoIHJpZ2h0IGVuZCBwaXhlbCBmcm9tIHRoZSBmcmFtZQotICAgICAgICA7Ly8KLUhvckxvb3AyMgotICAgICAgICBWTEQxICAgICAgICB7ZERhdGEwIFtdfSwgW3BMZWZ0XSwgaVBsYW5lU3RlcAotICAgICAgICBNT1YgICAgICAgICBDb3VudGVyLCBpRXhwYW5kUGVscwotICAgICAgICBWTEQxICAgICAgICB7ZERhdGExIFtdfSwgW3BSaWdodF0sIGlQbGFuZVN0ZXAKLVZlckxvb3AyCi0gICAgICAgIFZTVDEgICAgICAgIGREYXRhMCwgW3BEc3RMZWZ0XSwgIzgKLSAgICAgICAgU1VCUyAgICAgICAgQ291bnRlciwgQ291bnRlciwgIzgKLSAgICAgICAgVlNUMSAgICAgICAgZERhdGExLCBbcERzdFJpZ2h0XSwgIzggICAgICAgIAotICAgICAgICBCR1QgICAgICAgICBWZXJMb29wMgotCi0gICAgICAgIFNVQlMgICAgICAgIGlGcmFtZUhlaWdodCwgaUZyYW1lSGVpZ2h0LCAjMQotICAgICAgICBBREQgICAgICAgICBwRHN0TGVmdCwgcERzdExlZnQsIE9mZnNldAotICAgICAgICBBREQgICAgICAgICBwRHN0UmlnaHQsIHBEc3RSaWdodCwgT2Zmc2V0Ci0gICAgICAgIEJHVCAgICAgICAgIEhvckxvb3AyMgotICAgICAgICAgICAgICAgIAotICAgICAgICBNT1YgICAgICAgICBUZW1wLCBpRXhwYW5kUGVscwotICAgICAgICA7Ly8KLSAgICAgICAgOy8vIENvcHkgYm90dG9tLWxlZnQgYW5kIGJvdHRvbS1yaWdodCByZWdpb24gb2YgdGhlIHBsYW5lIGFzIGZvbGxvd3MKLSAgICAgICAgOy8vIGJvdHRvbS1sZWZ0IHJlZ2lvbiA9IGJvdHRvbS1sZWZ0IGNvcm5lciBwaXhlbCBmc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gICAgRU9SICAgICAgICAgUmVzdWx0QSwgUmVzdWx0QSwgcjB4ODA4MDgwODAKLSAgICAgICAgTV9TVFIgICAgICAgUmVzdWx0QSwgW3BEc3RQcmVkXSwgaURzdFN0ZXAgICAgICAgIAotICAgICAgICBFT1IgICAgICAgICBSZXN1bHRCLCBSZXN1bHRCLCByMHg4MDgwODA4MAotICAgICAgICBNX1NUUiAgICAgICBSZXN1bHRCLCBbcERzdFByZWRdLCBpRHN0U3RlcCAgICAgICAgCi0gICAgICAgIAotICAgICAgICA7Ly8gMm5kIGxvYWQKLSAgICAgICAgTV9MRFIgICAgICAgaVByZWRBMCwgW3BQcmVkMF0sIGlQcmVkU3RlcDAgICAgICAgIAotICAgICAgICBNX0xEUiAgICAgICBpUHJlZEIwLCBbcFByZWQxXQotICAgICAgICBNX0xEUiAgICAgICBpUHJlZEExLCBbcFByZWQwXSwgaVByZWRTdGVwMAotICAgICAgICBNX0xEUiAgICAgICBpUHJlZEIxLCBbcFByZWQxLCBpUHJlZFN0ZXAxXQotCi0gICAgICAgIE1WTiAgICAgICAgIGlQcmVkQjAsIGlQcmVkQjAKLSAgICAgICAgVUhTVUI4ICAgICAgUmVzdWx0QSwgaVByZWRBMCwgaVByZWRCMAotICAgICAgICBNVk4gICAgICAgICBpUHJlZEIxLCBpUHJlZEIxCi0gICAgICAgIFVIU1VCOCAgICAgIFJlc3VsdEIsIGlQcmVkQTEsIGlQcmVkQjEKLSAgICAgICAgRU9SICAgICAgICAgUmVzdWx0QSwgUmVzdWx0QSwgcjB4ODA4MDgwODAgICAgICAgIAotICAgICAgICBNX1NUUiAgICAgICBSZXN1bHRBLCBbcERzdFByZWRdLCBpRHN0U3RlcCAgICAgICAgCi0gICAgICAgIEVPUiAgICAgICAgIFJlc3VsdEIsIFJlc3VsdEIsIHIweDgwODA4MDgwCi0gICAgICAgIE1fU1RSICAgICAgIFJlc3VsdEIsIFtwRHN0UHJlZF0sIGlEc3RTdGVwICAgICAgICAgICAgICAgIAotRW5kMAotICAgICAgICBNX0VORAotCi0gICAgICAgIDsvLyBUaGlzIGZ1bmN0aW9uIGNhbGN1bGF0ZXMgYXZlcmFnZSBvZiA0eDQgYmxvY2sgCi0gICAgICAgIDsvLyBwUHJlZDAgaXMgYXQgYWxpZ25tZW50IG9mZnNldCAyIGFuZCBwUHJlZDEgaXMgYWxpZ25tZW50IDQKLQotICAgICAgICA7Ly8gRnVuY3Rpb24gaGVhZGVyCi0gICAgICAgIE1fU1RBUlQgYXJtVkNNNFAxMF9BdmVyYWdlXzR4NF9BbGlnbjJfdW5zYWZlLCByNgotCi0gICAgICAgIDsvLyBDb2RlIHN0YXJ0ICAgICAgICAKLSAgICAgICAgTERSICAgICAgICAgcjB4ODA4MDgwODAsID0weDgwODA4MDgwCi0KLSAgICAgICAgOy8vIDFzdCBsb2FkCi0gICAgICAgIExEUiAgICAgICAgIFRlbXAxLCBbcFByZWQwLCAjNF0KLSAgICAgICAgTV9MRFIgICAgICAgaVByZWRBMCwgW3BQcmVkMF0sIGlQcmVkU3RlcDAgICAgICAgIAotICAgICAgICBNX0xEUiAgICAgICBpUHJlZEIwLCBbcFByZWQxXQotICAgICAgICBNX0xEUiAgICAgICBpUHJlZEIxLCBbcFByZWQxLCBpUHJlZFN0ZXAxXQotICAgICAgICBNX0xEUiAgICAgICBUZW1wMiwgW3BQcmVkMCwgIzRdCi0gICAgICAgIE1fTERSICAgICAgIGlQcmVkQTEsIFtwUHJlZDBdLCBpUHJlZFN0ZXAwCi0gICAgICAgIE1WTiAgICAgICAgIGlQcmVkQjAsIGlQcmVkQjAKLSAgICAgICAgTVZOICAgICAgICAgaVByZWRCMSwgaVByZWRCMSAgICAgICAgCi0gICAgICAgIE1PViAgICAgICAgIGlQcmVkQTAsIGlQcmVkQTAsIExTUiAjMTYKLSAgICAgICAgT1JSICAgICAgICAgaVByZWRBMCwgaVByZWRBMCwgVGVtcDEsIExTTCAjMTYgICAgICAgIAotICAgICAgICBNT1YgICAgICAgICBpUHJlZEExLCBpUHJlZEExLCBMU1IgIzE2Ci0gICAgICAgIE9SUiAgICAgICAgIGlQcmVkQTEsIGlQcmVkQTEsIFRlbXAyLCBMU0wgIzE2Ci0KLSAgICAgICAgOy8vIChhK2IrMSkvMiA9IChhKzI1Ni0oMjU1LWIpKS8yID0gKGEtKDI1NS1iKSkvMiArIDEyOAotICAgICAgICBVSFNVQjggICAgICBSZXN1bHRBLCBpUHJlZEEwLCBpUHJlZEIwCi0gICAgICAgIFVIU1VCOCAgICAgIFJlc3VsdEIsIGlQcmVkQTEsIGlQcmVkQjEKLSAgICAgICAgRU9SICAgICAgICAgUmVzdWx0QSwgUmVzdWx0QSwgcjB4ODA4MDgwODAKLSAgICAgICAgTV9TVFIgICAgICAgUmVzdWx0QSwgW3BEc3RQcmVkXSwgaURzdFN0ZXAgICAgICAgIAotICAgICAgICBFT1IgICAgICAgICBSZXN1bHRCLCBSZXN1bHRCLCByMHg4MDgwODA4MAotICAgICAgICBNX1NUUiAgICAgICBSZXN1bHRCLCBbcERzdFByZWRdLCBpRHN0U3RlcCAgICAgICAgCi0gICAgICAgIAotICAgICAgICA7Ly8gMm5kIGxvYWQKLSAgICAgICAgTERSICAgICAgICAgVGVtcDEsIFtwUHJlZDAsICM0XQotICAgICAgICBNX0xEUiAgICAgICAgIGlQcmVkQTAsIFtwUHJlZDBdLCBpUHJlZFN0ZXAwICAgICAgICAKLSAgICAgICAgTERSICAgICAgICAgaVByZWRCMCwgW3BQcmVkMV0KLSAgICAgICAgTERSICAgICAgICAgaVByZWRCMSwgW3BQcmVkMSwgaVByZWRTdGVwMV0KLSAgICAgICAgTERSICAgICAgICAgVGVtcDIsIFtwUHJlZDAsICM0XQotICAgICAgICBNX0xEUiAgICAgICAgIGlQcmVkQTEsIFtwUHJlZDBdLCBpUHJlZFN0ZXAwCi0gICAgICAgIE1WTiAgICAgICAgIGlQcmVkQjAsIGlQcmVkQjAKLSAgICAgICAgTVZOICAgICAgICAgaVByZWRCMSwgaVByZWRCMQ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HIweDgwODA4MDgwLCA9MHg4MDgwODA4MAotCi0gICAgICAgIDsvLyAxc3QgbG9hZAotICAgICAgICBMRFIgICAgICAgICBUZW1wMSwgW3BQcmVkMCwgIzRdCi0gICAgICAgIE1fTERSICAgICAgIGlQcmVkQTAsIFtwUHJlZDBdLCBpUHJlZFN0ZXAwICAgICAgICAKLSAgICAgICAgTERSICAgICAgICAgaVByZWRCMCwgW3BQcmVkMV0KLSAgICAgICAgTERSICAgICAgICAgaVByZWRCMSwgW3BQcmVkMSwgaVByZWRTdGVwMV0KLSAgICAgICAgTERSICAgICAgICAgVGVtcDIsIFtwUHJlZDAsICM0XQotICAgICAgICBNX0xEUiAgICAgICBpUHJlZEExLCBbcFByZWQwXSwgaVByZWRTdGVwMAotCi0gICAgICAgIE1WTiAgICAgICAgIGlQcmVkQjAsIGlQcmVkQjAKLSAgICAgICAgTVZOICAgICAgICAgaVByZWRCMSwgaVByZWRCMQotICAgICAgICBNT1YgICAgICAgICBpUHJlZEEwLCBpUHJlZEEwLCBMU1IgIzI0Ci0gICAgICAgIE9SUiAgICAgICAgIGlQcmVkQTAsIGlQcmVkQTAsIFRlbXAxLCBMU0wgIzggICAgICAgICAgICAgICAgCi0gICAgICAgIE1PViAgICAgICAgIGlQcmVkQTEsIGlQcmVkQTEsIExTUiAjMjQKLSAgICAgICAgT1JSICAgICAgICAgaVByZWRBMSwgaVByZWRBMSwgVGVtcDIsIExTTCAjOAotICAgICAgICBVSFNVQjggICAgICBSZXN1bHRBLCBpUHJlZEEwLCBpUHJlZEIwCi0gICAgICAgIFVIU1VCOCAgICAgIFJlc3VsdEIsIGlQcmVkQTEsIGlQcmVkQjEKLSAgICAgICAgRU9SICAgICAgICAgUmVzdWx0QSwgUmVzdWx0QSwgcjB4ODA4MDgwODAKLSAgICAgICAgTV9TVFIgICAgICAgUmVzdWx0QSwgW3BEc3RQcmVkXSwgaURzdFN0ZXAgICAgICAgIAotICAgICAgICBFT1IgICAgICAgICBSZXN1bHRCLCBSZXN1bHRCLCByMHg4MDgwODA4MAotICAgICAgICBNX1NUUiAgICAgICBSZXN1bHRCLCBbcERzdFByZWRdLCBpRHN0U3RlcCAgICAgICAgCi0gICAgICAgIAotICAgICAgICA7Ly8gMm5kIGxvYWQKLSAgICAgICAgTERSICAgICAgICAgVGVtcDEsIFtwUHJlZDAsICM0XQotICAgICAgICBNX0xEUiAgICAgICBpUHJlZEEwLCBbcFByZWQwXSwgaVByZWRTdGVwMCAgICAgICAgCi0gICAgICAgIExEUiAgICAgICAgIGlQcmVkQjAsIFtwUHJlZDFdCi0gICAgICAgIExEUiAgICAgICAgIGlQcmVkQjEsIFtwUHJlZDEsIGlQcmVkU3RlcDFdCi0gICAgICAgIExEUiAgICAgICAgIFRlbXAyLCBbcFByZWQwLCAjNF0KLSAgICAgICAgTV9MRFIgICAgICAgaVByZWRBMSwgW3BQcmVkMF0sIGlQcmVkU3RlcDAKLQotICAgICAgICBNVk4gICAgICAgICBpUHJlZEIwLCBpUHJlZEIwCi0gICAgICAgIE1WTiAgICAgICAgIGlQcmVkQjEsIGlQcmVkQjEKLSAgICAgICAgTU9WICAgICAgICAgaVByZWRBMCwgaVByZWRBMCwgTFNSICMyNAotICAgICAgICBPUlIgICAgICAgICBpUHJlZEEwLCBpUHJlZEEwLCBUZW1wMSwgTFNMICM4ICAgICAgICAKLSAgICAgICAgTU9WICAgICAgICAgaVByZWRBMSwgaVByZWRBMSwgTFNSICMyNAotICAgICAgICBPUlIgICAgICAgICBpUHJlZEExLCBpUHJlZEExLCBUZW1wMiwgTFNMICM4Ci0KLSAgICAgICAgVUhTVUI4ICAgICAgUmVzdWx0QSwgaVByZWRBMCwgaVByZWRCMAotICAgICAgICBVSFNVQjggICAgICBSZXN1bHRCLCBpUHJlZEExLCBpUHJlZEIxCi0gICAgICAgIEVPUiAgICAgICAgIFJlc3VsdEEsIFJlc3VsdEEsIHIweDgwODA4MDgwICAgICAgICAKLSAgICAgICAgTV9TVFIgICAgICAgUmVzdWx0QS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wotCi0gICAgICAgIElOQ0xVREUgb214dHlwZXNfcy5oCi0gICAgICAgIElOQ0xVREUgYXJtQ09NTV9zLmgKLSAgICAgICAgCi0gICAgICAgIE1fVkFSSUFOVFMgQ29ydGV4QTgKLQotCi0gICAgSUYgIENvcnRleEE4Ci0gICAgICAgIAotcEFscGhhICAgICAgUk4gMgotcEJldGEgICAgICAgUk4gMwotCi1wVGhyZXNob2xkcyBSTiA1Ci1wQlMgICAgICAgICBSTiA0Ci1iUzMyMTAgICAgICBSTiA2Ci0KLTsvLyBQaXhlbHMKLWRQXzAgICAgICAgIEROIEQ0LlU4Ci1kUF8xICAgICAgICBETiBENS5VOCAgCi1kUF8yICAgICAgICBETiBENi5VOCAgCi1kUF8zICAgICAgICBETiBENy5VOCAgCi1kUV8wICAgICAgICBETiBEOC5VOCAgCi1kUV8xICAgICAgICBETiBEOS5VOCAgCi1kUV8yICAgICAgICBETiBEMTAuVTggCi1kUV8zICAgICAgICBETiBEMTEuVTggCi0KLQotOy8vIEZpbHRlcmluZyBEZWNpc2lvbgotZEFscGhhICAgICAgRE4gRDAuVTgKLWRCZXRhICAgICAgIEROIEQyLlU4Ci0KLWRGaWx0ICAgICAgIEROIEQxNi5VOAotZEFxZmxnICAgICAgRE4gRDEyLlU4Ci1kQXBmbGcgICAgICBETiBEMTcuVTggCi0KLWRBcDBxMCAgICAgIEROIEQxMy5VOAotCi07Ly8gYlNMVDQKLWRUQzMyMTAgICAgIEROIEQxOC5VOCAgIAotZFRDcyAgICAgICAgRE4gRDMxLlM4Ci1kVEMgICAgICAgICBETiBEMzEuVTgKLQotZE1hc2tfMCAgICAgRE4gRDE0LlU4Ci1kTWFza18xICAgICBETiBEMTUuVTggICAgCi1kTWFza180ICAgICBETiBEMjYuVTE2Ci0KLWRUZW1wICAgICAgIEROIEQyOC5VOAotZER1bW15ICAgICAgRE4gRDE3LlU4Ci0KLTsvLyBDb21wdXRpbmcgUDAsUTAKLXFEcTBwMCAgICAgIFFOIFExMC5TM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KLWRNYXNrXzAgICAgIEROIEQxNC5VOAotZE1hc2tfMSAgICAgRE4gRDE1LlU4ICAgIAotCi1kVGVtcCAgICAgICBETiBEMTkuVTgKLQotOy8vIENvbXB1dGluZyBQMCxRMAotcURxMHAwICAgICAgUU4gUTEwLlMxNgotcURwMXExICAgICAgUU4gUTExLlMxNgotcURlbHRhICAgICAgUU4gUTEwLlMxNiAgOyByZXVzZSBxRHEwcDAKLWREZWx0YSAgICAgIEROIEQyMC5TOAotCi0KLTsvLyBDb21wdXRpbmcgUDEsUTEKLWRScDBxMCAgICAgIEROIEQyNC5VOAotCi1kTWF4UCAgICAgICBETiBEMjMuVTgKLWRNaW5QICAgICAgIEROIEQyMi5VOAotCi1kTWF4USAgICAgICBETiBEMTkuVTgKLWRNaW5RICAgICAgIEROIEQyMS5VOAotCi1kRGVsdGFQICAgICBETiBEMjYuVTgKLWREZWx0YVEgICAgIEROIEQyNy5VOAotCi1xUF8wbiAgICAgICBRTiBRMTQuUzE2Ci1xUV8wbiAgICAgICBRTiBRMTIuUzE2Ci0KLWRRXzBuICAgICAgIEROIEQyNC5VOAotZFFfMW4gICAgICAgRE4gRDI1LlU4Ci1kUF8wbiAgICAgICBETiBEMjkuVTgKLWRQXzFuICAgICAgIEROIEQzMC5VOAotCi07Ly8gYlNHRTQKLQotcVNwMHEwICAgICAgUU4gUTEwLlUxNgotCi1xU3AycTEgICAgICBRTiBRMTEuVTE2Ci1xU3AwcTBwMSAgICBRTiBRMTIuVTE2Ci1xU3AzcDIgICAgICBRTiBRMTMuVTE2Ci1kSFNwMHExICAgICBETiBEMjguVTgKLQotcVNxMnAxICAgICAgUU4gUTExLlUxNgotcVNwMHEwcTEgICAgUU4gUTEyLlUxNgotcVNxM3EyICAgICAgUU4gUTEzLlUxNiAgOyEhCi1kSFNxMHAxICAgICBETiBEMjguVTggICA7ISEKLQotcVRlbXAxICAgICAgUU4gUTExLlUxNiAgOyEhO3FTcDJxMSAKLXFUZW1wMiAgICAgIFFOIF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A7Ly8gcURxMHAwLTEwCi0gICAgICAgIFZTVUJMICAgICAgIHFEcDFxMSwgZFBfMSwgZFFfMSAgICAgIAotICAgICAgICBWTEQxICAgICAgICB7ZFRDMFtdfSwgW3BUaHJlc2hvbGRzXSEKLSAgICAgICAgOy8vIHFEcDFxMS0xMQotICAgICAgICBWU1VCTCAgICAgICBxRHEwcDAsIGRRXzAsIGRQXzAgICAgICAKLSAgICAgICAgVkxEMSAgICAgICAge2RUQzFbXX0sIFtwVGhyZXNob2xkc10hCi0KLSAgICAgICAgOy8vIGRScDBxMC0yNAotICAgICAgICBWU0hSICAgICAgICBxRHAxcTEsIHFEcDFxMSwgIzIgICAgICAKLSAgICAKLSAgICAgICAgOy8vIGRUQzAxID0gKGRUQzEgPDwgNCkgfCBkVEMwCi0gICAgICAgIDsvLyBkVEMwMS0xOAotICAgICAgICBWRVhUICAgICAgICBkVEMwMSwgZFRDMCwgZFRDMSwgIzQKLSAgICAgICAgOy8vIGRUZW1wLTE5Ci0gICAgICAgIFZBTkQgICAgICAgIGRUZW1wLCBkQXBmbGcsIGRNYXNrXzEKLSAgICAgICAgCi0gICAgICAgIFZCSUYgICAgICAgIGRUQzAxLCBkTWFza18wLCBkRmlsdAotICAgIAotCi0gICAgICAgIDsvLyBkZWx0YSA9ICgoKHEwLXAwKTw8MikgKyAocDEtcTEpICsgNCkgPj4gMzsKLSAgICAgICAgOy8vIGREZWx0YSA9IChxRHAxcTEgPj4gMiArIHFEcTBwMCArIDEpPj4gMQotCi0gICAgICAgIDsvLyBxRGVsdGEtcURxMHAwLTEwCi0gICAgICAgIFZSSEFERCAgICAgIHFEZWx0YSwgcURwMXExLCBxRHEwcDAgIAotICAgICAgICBWUkhBREQgICAgICBkUnAwcTAsIGRQXzAsIGRRXzAgICAgICAKLSAgICAgICAgVkFERCAgICAgICAgZFRDLCBkVEMwMSwgZFRlbXAKLQotICAgICAgICA7Ly8gZFRDID0gZFRDMDEgKyAoZEFwbGcgJiAxKSArIChkQXFmbGcgJiAxKQotICAgICAgICAKLSAgICAgICAgVkFORCAgICAgICAgZFRlbXAsIGRBcWZsZywgZE1hc2tfMQotICAgICAgICBWUUFERCAgICAgICBkTWF4UCwgZFBfMSwgZFRDMDEgICAgICAKLSAgICAgICAgVlFNT1ZOICAgICAgZERlbHRhLCBxRGVsdGEKLSAgICAgICAgVkFERCAgICAgICAgZFRDLCBkVEMsIGRUZW1wCi0KLSAgICAgICAgOy8vIGRNYXhQID0gUUFERChkUF8xLCBkVEMwMSkKLSAgICAgICAgOy8vIGRNaW5QID0gUVNVQihkUF8xLCBkVEMwMSkKLSAKLSAgICAgICAgOy8vIGRNYXhQLWQyMwotICAgICAgICA7Ly8gZE1pblAtZDIyCi0gICAgICAgIFZRU1VCICAgICAgIGRNaW5QLCBkUF8xLCBkVEMwMSAgICAgIAotCi0gICAgICAgIDsvLyBkRGVsdGEtZDIwCi0KLSAgICAgICAgOy8vIGRNYXhRID0gUUFERChkUV8xLCBkVEMwMSkKLSAgICAgICAgOy8vIGRNaW5RID0gUVNVQihkUV8xLCBkVEMwMSkKLSAKLSAgICAgICAgOy8vIGRNYXhRLTE5Ci0gICAgICAgIDsvLyBkTWluUS0yMQotICAgICAgICBWUUFERCAgICAgICBkTWF4USwgZFFfMSwgZFRDMDEKLSAgICAgICAgVkhBREQgICAgICAgZERlbHRhUCwgZFJwMHEwLCBkUF8yICAgCi0gICAgICAgIFZNSU4gICAgICAgIGREZWx0YSwgZERlbHRhLCBkVENzCi0KLSAgICAgICAgOy8vIGREZWx0YSA9IChPTVhfVTgpYXJtQ2xpcCgwLCAyNTUsIHEwIC0gZGVsdGEpOwotICAgICAgICBWTkVHICAgICAgICBkVENzLCBkVENzCi0gICAgICAgIAotICAgICAgICBWUVNVQiAgICAgICBkTWluUSwgZFFfMSwgZFRDMDEKLQotICAgICAgICA7Ly8gZGVsdGEgPSAocDIgKyAoKHAwK3EwKzEpPj4xKSAtIChwMTw8MSkpPj4xOwotICAgICAgICA7Ly8gZGV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wKzEpPj4xKSAtIChxMTw8MSkpPj4xOwotICAgICAgICA7Ly8gZERlbHRhUSA9IChkUV8yICsgZFJwMHEwKT4+MTsKLQotICAgICAgICBWTUFYICAgICAgICBkUF8xbiwgZERlbHRhUCwgZE1pblAgICAKLSAgICAgICAgVk1BWCAgICAgICAgZERlbHRhLCBkRGVsdGEsIGRUQ3MKLQotICAgICAgICA7Ly8gcFEwWy0xKlN0ZXBdID0gKE9NWF9VOClhcm1DbGlwKDAsIDI1NSwgZFBfMCAtIGRlbHRhKTsKLSAgICAgICAgOy8vIHBRMFswKlN0ZXBdID0gKE9NWF9VOClhcm1DbGlwKDAsIDI1NSwgZFFfMCAtIGRlbHRhKTsKLQotICAgICAgICA7Ly8gZFBfMG4gPSAoT01YX1U4KWFybUNsaXAoMCwgMjU1LCBkUF8wIC0gZERlbHRhKTsKLSAgICAgICAgOy8vIGRRXzBuID0gKE9NWF9VOClhcm1DbGlwKDAsIDI1NSwgZFBfMCAtIGREZWx0YSk7Ci0gICAgICAgIAotICAgICAgICA7Ly8gcVBfMG4gLSAxNAotICAgICAgICA7Ly8gcVFfMG4gLSAxMgotICAgICAgICAKLSAgICAgICAgVk1PVkwgICAgICAgcVBfMG4sIGRQXzAKLSAgICAgICAgVk1PVkwgICAgICAgcVFfMG4sIGRRXzAKLQotICAgICAgICBWQUREVyAgICAgICBxUF8wbiwgcVBfMG4sIGREZWx0YQotICAgICAgICBWU1VCVyAgICAgICBxUV8wbiwgcVFfMG4sIGREZWx0YQotICAgICAgICAKLSAgICAgICAgVlFNT1ZVTiAgICAgZFBfMG4sIHFQXzBuCi0gICAgICAgIFZRTU9WVU4gICAgIGRRXzBuLCBxUV8wbgotICAgICAgICAKLSAgICAgICAgVk1BWCAgICAgICAgZFFfMW4sIGREZWx0YVEsIGRNaW5RCi0KLSAgICAgICAgVk1JTiAgICAgICAgZFBfMW4sIGRQXzFuLCBkTWF4UAotICAgICAgICBWTUlOICAgICAgICBkUV8xbiwgZFFfMW4sIG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ICkKLSAgICAgICAgOy8vICggZEFxZmxnICYgZEFwMHEwIDwgKGRBbHBoYSA+PiAyICsgMikgKQotCi0gICAgICAgIDsvLyAoIGRBcGZsZyA9IGRBcGZsZyAmIGRBcDBxMCA8IChkVGVtcCArIGRNYXNrXzEgKyBkTWFza18xKSApCi0gICAgICAgIDsvLyAoIGRBcWZsZyA9IGRBcWZsZyAmIGRBcDBxMCA8IChkVGVtcCArIGRNYXNrXzEgKyBkTWFza18xKSApCi0KLSAgICAgICAgOy8vIFAgRmlsdGVyCi0KLSAgICAgICAgVlNIUiAgICAgICAgZFRlbXAsIGRBbHBoYSwgIzIKLSAgICAgICAgVkFERCAgICAgICAgZFRlbXAsIGRUZW1wLCBkTWFza18xCi0KLSAgICAgICAgOy8vIHFTcDBxMC0xMAotICAgICAgICBWQURETCAgICAgICBxU3AwcTAsIGRRXzAsIGRQXzAgICAgICAKLSAgICAgICAgVkFERCAgICAgICAgZFRlbXAsIGRUZW1wLCBkTWFza18xCi0KLSAgICAgICAgOy8vIHFTcDJxMS0xMQotICAgICAgICA7Ly8gcVNwMHEwcDEtMTIKLSAgICAgICAgVkFEREwgICAgICAgcVNwMnExLCBkUF8yLCBkUV8xICAgICAgCi0gICAgICAgIFZBRERXICAgICAgIHFTcDBxMHAxLCBxU3AwcTAsIGRQXzEgIAotCi0gICAgICAgIFZDR1QgICAgICAgIGRUZW1wLCBkVGVtcCwgZEFwMHEwCi0gICAgICAgIFZTSFIgICAgICAgIHFTcDJxMSwgIzEgICAgICAgICAgICAgIAotCi0gICAgICAgIDsvLyBwUTBbLTEqU3RlcF0gPSAoT01YX1U4KSgocDIgKyAyKnAxICsgMipwMCArIDIqcTAgKyBxMSArIDQpPj4zKTsKLSAgICAgICAgOy8vIHBRMFstMSpTdGVwXSA9ICggKCAocDAgKyBxMCArIHAxKSArIChwMiArIHExKT4+MSApID4+IDEgKyAxICkgPj4gMQotCi0gICAgICAgIDsvLyBkUF8wbiA9ICggKCAocVNwMHEwICsgZFBfMSkgKyBxU3AycTE+PjEgKSA+PiAxICsgMSApID4+IDEKLSAgICAgICAgOy8vIGRQXzBuID0gKCAoIHFTcDBxMHAxICsgcVNwMnExPj4xICkgPj4gMSArIDEgKSA+PiAxCi0gICAgICAgIDsvLyBkUF8wbiA9ICggcVRlbXAxICsgMSApID4+IDEKLSAgICAgICAgCi0gICAgICAgIDsvLyBwUTBbLTIqU3RlcF0gPSAoT01YX1U4KSgocDIgKyBwMSArIHAwICsgcTAgKyAyKT4+Mik7Ci0gICAgICAgIAotICAgICAgICA7Ly8gZFBfMW4gPSAoT01YX1U4KSgoZFBfMiArIHFTcDBxMHAxICsgMik+PjIpOwotICAgICAgICA7Ly8gZFBfMW4gPSAoT01YX1U4KSgocVRlbXAyICsgMik+PjIpOwotICAgICAgICAKLSAgICAgICAgOy8vIHBRMFstMypTdGVwXSA9IChPTVhfVTgpKCgyKnAzICsgMypwMiArIHAxICsgcDAgKyBxMCArIDQpPj4zKTsKLSAgICAgICAgOy8vIHBRMFstMypTdGVwXSA9IChPTVhfVTgpKCggKHAzICsgcDIpICsgKHAxICsgcDAgKyBxMCArIHAyKSA+PiAxICsgMik+PjIpOwotCi0gICAgICAgIDsvLyBkUF8ybiA9IChPTVhfVTgpKCggcVNwM3AyICsgKGRQXzIgKyBxU3AwcTBwMSkgPj4gMSArIDIpID4+IDIpOwotICAgICAgICA7Ly8gZFBfMm4gPSAoT01YX1U4KSgoIHFTcDNwMiArIHFUZW1wMiA+PiAxICsgMikgPj4gMik7Ci0KLSAgICAgICAgOy8vIHFUZW1wMS1xU3AycTEtMTEKLSAgICAgICAgOy8vIHFUZW1wMi1xU3AwcTBwMS0xMgotICAgICAgICBWSEFERCAgICAgICBxVGVtcDEsIHFTcDBxMHAxLCBxU3AycTEKLSAgICAgICAgVkFERFcgICAgICAgcVRlbXAyLCBxU3AwcTBwMSwgZFBfMiAgCi0gICAgICAgIAotICAgICAgICA7Ly8gcVNwM3AyLTEzCi0gICAgICAgIFZBRERMICAgICAgIHFTcDNwMiwgZFBfMywgZFBfMiAgICAgIAotCi0gICAgICAgIFZBTkQgICAgICAgIGRBcGZsZywgZEFwZmxnLCBkVGVtcAotICAgICAgICBWSEFERCAgICAgICBkSFNwMHExLCBkUF8wLCBkUV8xICAgICAKLSAgICAgICAgVlNSQSAgICAgICAgcVNwM3AyLCBxVGVtcDIsICMxICAgICAgCi0gICAgICAgIDsvLyBkSFNwMHExLTI4Ci0gICAgICAgIFZBTkQgICAgICAgIGRBcWZsZywgZEFxZmxnLCBkVGVtcAotCi0gICAgICAgIDsvLyBkUF8wbi0yOQotICAgICAgICA7Ly8gZFBfMHQtZEhTcDBxMS0yOAotICAgICAgICBWUVJTSFJOICAgICBkUF8wbiwgcVRlbXAxLCAjMQotICAgICAgICBWUkhBREQgICAgICBkUF8wdCwgZEhTcDBxMSwgZFBfMSAgICAKLQotICAgICAgICA7Ly8gZFBfMW4tMzAKLSAgICAgICAgVlFSU0hSTiAgICAgZFBfMW4sIHFUZW1wMiwgIzIKLSAgICAgICAgCi0gICAgICAgIFZBRERMICAgICAgIHFTcTJwMSwgZFFfMiwgZFBfMSAgICAgICAgICAKLSAgICAgICAgVkFERFcgICAgICAgcVNwMHEwcTEsIHFTcDBxMCwgZFFfMSAgICAgIAotICAgICAgICAKLSAgICAgICAgVkJJRiAgICAgICAgZFBfMG4sIGRQXzB0LCBkQXBmbGcgICAgCi0KLSAgICAgICAgOy8vIFEgRmlsdGVyCi0KLSAgICAgICAgOy8vIHBRMFswKlN0ZXBdID0gKE9NWF9VOCkoKHEyICsgMipxMSArIDIqcTAgKyAyKnAwICsgcDEgKyA0KT4+Myk7Ci0gICAgICAgIDsvLyBwUTBbMCpTdGVwXSA9ICggKCAocDAgKyBxMCArIHExKSArIChxMiArIHAxKT4+MSApID4+IDEgKyAxICkgPj4gMQotCi0gICAgICAgIDsvLyBkUV8wbiA9ICggKCAocVNwMHEwICsgZFFfMSkgKyBxU3EycDE+PjEgKSA+PiAxICsgMSApID4+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ICAgICAKLSAgICAgICAgVlFSU0hSTiAgICAgZFBfMm4sIHFTcDNwMiwgIzIKLSAgICAgICAgVkFEREwgICAgICAgcVNxM3EyLCBkUV8zLCBkUV8yICAgICAgICAgIAotCi0gICAgICAgIFZTSFIgICAgICAgIHFTcTJwMSwgIzEgICAgICAgICAgICAgICAgICAKLQotICAgICAgICBWSEFERCAgICAgICBxVGVtcDEsIHFTcDBxMHExLCBxU3EycDEKLSAgICAgICAgVkFERFcgICAgICAgcVRlbXAyLCBxU3AwcTBxMSwgZFFfMiAgICAgIAotCi0gICAgICAgIDsvLyBkSFNxMHAxLTI4Ci0gICAgICAgIFZIQUREICAgICAgIGRIU3EwcDEsIGRRXzAsIGRQXzEgICAgICAgICAKLQotICAgICAgICBWQklGICAgICAgICBkUF8wbiwgZFBfMCwgZEZpbHQKLSAgICAgICAgVkJJRiAgICAgICAgZFBfMW4sIGRQXzEsIGRBcGZsZwotCi0gICAgICAgIFZTUkEgICAgICAgIHFTcTNxMiwgcVRlbXAyLCAjMSAgICAgICAgICAKLQotICAgICAgICA7Ly8gZFFfMS1UZW1wMi0yNQotICAgICAgICA7Ly8gZFFfMC1UZW1wMi0yNAotICAgICAgICBWUVJTSFJOICAgICBkUV8xbiwgcVRlbXAyLCAjMgotICAgICAgICBWUVJTSFJOICAgICBkUV8wbiwgcVRlbXAxLCAjMQotCi0gICAgICAgIDsvLyBkUV8wdC1UZW1wMS0yMgotICAgICAgICBWUkhBREQgICAgICBkUV8wdCwgZEhTcTBwMSwgZFFfMQotICAgICAgICBWQklGICAgICAgICBkUV8xbiwgZFFfMSwgZEFxZmxnICAgICAgICAgCi0KLSAgICAgICAgVkJJRiAgICAgICAgZFBfMm4sIGRQXzIsIGRBcGZsZyAgICAgICAgCi0gICAgICAgIFZCSUYgICAgICAgIGRRXzBuLCBkUV8wdCwgZEFxZmxnICAgICAgICAKLSAgICAgICAgVlFSU0hSTiAgICAgZFFfMm4sIHFTcTNxMiwgIzIKLSAgICAgICAgVk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bCBsb29wCi1Db3VudCAgICAgICAgICAgUk4gMAotVHJhaWxpbmdPbmVzICAgIFJOIDEKLXBMZXZlbCAgICAgICAgICBSTiAyCi1MZXZlbFN1ZmZpeCAgICAgUk4gMwotU3VmZml4TGVuZ3RoICAgIFJOIDQKLVRvdGFsQ29lZmYgICAgICBSTiA1Ci0KLXBWTERUYWJsZSAgICAgICBSTiA2Ci1TeW1ib2wgICAgICAgICAgUk4gNwotVDEgICAgICAgICAgICAgIFJOIDgKLVQyICAgICAgICAgICAgICBSTiA5Ci1SQml0U3RyZWFtICAgICAgUk4gMTAKLVJCaXRCdWZmZXIgICAgICBSTiAxMQotUkJpdENvdW50ICAgICAgIFJOIDEyCi1sciAgICAgICAgICAgICAgUk4gMTQKLQotOy8vIFJ1biBsb29wCi1Db3VudCAgICAgICAgICAgUk4gMAotWmVyb3NMZWZ0ICAgICAgIFJOIDEKLXBMZXZlbCAgICAgICAgICBSTiAyCi1wcFJ1blRhYmxlICAgICAgUk4gMwotcFJ1biAgICAgICAgICAgIFJOIDQKLVRvdGFsQ29lZmYgICAgICBSTiA1Ci0KLXBWTERUYWJsZSAgICAgICBSTiA2Ci1TeW1ib2wgICAgICAgICAgUk4gNwotVDEgICAgICAgICAgICAgIFJOIDgKLVQyICAgICAgICAgICAgICBSTiA5Ci1SQml0U3RyZWFtICAgICAgUk4gMTAKLVJCaXRCdWZmZXIgICAgICBSTiAxMQotUkJpdENvdW50ICAgICAgIFJOIDEyCi1sciAgICAgICAgICAgICAgUk4gMTQKLQotOy8vIEZpbGwgaW4gY29lZmZpY2llbnRzIGxvb3AKLXBQb3NDb2VmYnVmICAgICBSTiAwCi10ZW1wICAgICAgICAgICAgUk4gMQotcExldmVsICAgICAgICAgIFJOIDIKLXBwUG9zQ29lZmJ1ZiAgICBSTiAzCi1wUnVuICAgICAgICAgICAgUk4gNAotVG90YWxDb2VmZiAgICAgIFJOIDUKLXBaaWdaYWcgICAgICAgICBSTiA2Ci0KLVQxICAgICAgICAg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VsLCBwcExldmVsICAgICAgICAgICAgCi0gICAgICAgIE1fUFJJTlRGICJUcmFpbGluZ09uZXM9JWRcbiIsIFRyYWlsaW5nT25lcwotICAgICAgICBCRVEgICAgIFRyYWlsaW5nT25lc0RvbmUgICAgCi0gICAgICAgIE1PViAgICAgQ291bnQsIFRyYWlsaW5nT25lcwotVHJhaWxpbmdPbmVzTG9vcCAgICAKLSAgICAgICAgTV9CRF9SRUFEOCBTeW1ib2wsIDEsIFQxCi0gICAgICAgIFNVQlMgICAgQ291bnQsIENvdW50LCAjMQotICAgICAgICBNT1YgICAgIFQxLCAjMQotICAgICAgICBTVUIgICAgIFQxLCBUMSwgU3ltYm9sLCBMU0wgIzEKLSAgICAgICAgTV9QUklOVEYgIkxldmVsPSVkXG4iLCBUMQotICAgICAgICBTVFJIICAgIFQxLCBbcExldmVsXSwgIzIKLSAgICAgICAgQkdUICAgICBUcmFpbGluZ09uZXNMb29wCi1UcmFpbGluZ09uZXNEb25lICAgIAotICAgIAotICAgICAgICA7Ly8gRGVjb2RlIGxldmVsIHZhbHVlcyAgICAKLSAgICAgICAgU1VCUyAgICBDb3VudCwgVG90YWxDb2VmZiwgVHJhaWxpbmdPbmVzICAgICA7Ly8gTnVtYmVyIG9mIGxldmVscyB0byByZWFkCi0gICAgICAgIEJFUSAgICAgRGVjb2RlUnVucyAgICAgICAgICAgICAgICAgICAgICAgICAgOy8vIE5vbmUgbGVmdAotICAgICAgICAKLSAgICAgICAgTU9WICAgICBTdWZmaXhMZW5ndGgsICMxCi0gICAgICAgIENNUCAgICAgVG90YWxDb2VmZiwgIzEwCi0gICAgICAgIE1PVkxFICAgU3VmZml4TGVuZ3RoLCAjMAotICAgICAgICBDTVAgICAgIFRyYWlsaW5nT25lcywgIzMgICAgOy8vIGlmIChUcmFpbGluZ09uZXM8MykKLSAgICAgICAgTU9WTFQgICBUcmFpbGluZ09uZXMsICM0ICAgIDsvLyB0aGVuIFRyYWlsaW5nT25lcyA9ICs0Ci0gICAgICAgIE1PVkdFICAgVHJhaWxpbmdPbmVzLCAjMiAgICA7Ly8gZWxzZSBUcmFpbGluZ09uZXMgPSArMgotICAgICAgICBNT1ZHRSAgIFN1ZmZpeExlbmd0aCwgIzAgICAgOy8vICAgICAgU3VmZml4TGVuZ3RoID0gMAotICAgICAgICAKLUxldmVsTG9vcAotICAgICAgICBNX0JEX0NMWjE2IFN5bWJvbCwgVDEsIFQyICAgOy8vIFN5bWJvbD1MZXZlbFByZWZpeAotICAgICAgICBDTVAgICAgIFN5bWJvbCwjMTYKLSAgICAgICAgQkdFICAgICBFbmRCYWRTeW1ib2wKLSAgICAgICAgCi0gICAgICAgIE1PVlMgICAgbHIsIFN1ZmZpeExlbmd0aCAgICA7Ly8gaWYgTGV2ZWxTdWZmaXhTaXplPT0wCi0gICAgICAgIFRFUUVRICAgU3ltYm9sLCAjMTQgICAgICAgICA7Ly8gICBhbmQgIExldmVsUHJlZml4PT0xNAotICAgICAgICBNT1ZFUSAgIGxyLCAjNCAgICAgICAgICAgICAgOy8vICAgdGhlbiBMZXZlbFN1ZmZpeFNpemU9NAotICAgICAgICBURVEgICAgIFN5bWJvbCwgIzE1ICAgICAgICAgOy8vIGlmIExldmVsU3VmZml4U2l6ZT09MTUKLSAgICAgICAgTU9WRVEgICBsciwgIzEyICAgICAgICAgICAgIDsvLyAgIHRoZW4gTGV2ZWxTdWZmaXhTaXplPTEyCi0gICAgICAgIAotICAgICAgICBURVFFUSAgIFN1ZmZpeExlbmd0aCwjMAotICAgICAgICBBRERFUSAgIFN5bWJvbCxTeW1ib2wsIzE1Ci0gICAgICAgIAotICAgICAgICBURVEgICAgIGxyLCAjMCAgICAgICAgICAgICAgOy8vIGlmIExldmVsU3VmZml4U2l6ZT09MAotICAgICAgICBCRVEgICAgIExldmVsQ29kZVJlYWQgICAgICAgOy8vIExldmVsQ29kZSA9IExldmVsUHJlZml4Ci0gICAgICAgIAotICAgICAgICBNX0JEX1ZSRUFEMTYgTGV2ZWxTdWZmaXgs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ENvdW50LCBDb3VudCwgIzEgICAgICAgIAotICAgICAgICBCR1QgICAgIExldmVsTG9vcAotICAgICAgICAKLURlY29kZVJ1bnMgICAgICAgIAotICAgICAgICA7Ly8gRmluZCBudW1iZXIgb2YgemVyb3MKLSAgICAgICAgTV9MRFIgICBUMSwgcFNNYXhOdW1Db2VmZiAgICAgICAgICAgOy8vIHNNYXhOdW1Db2VmZgotICAgICAgICBTVUIgICAgIENvdW50LCBUb3RhbENvZWZmLCAjMSAgICAgICA7Ly8gTnVtYmVyIG9mIHJ1bnMgZXhjbHVkaW5nIGxhc3QKLSAgICAgICAgU1VCUyAgICBaZXJvc0xlZnQsIFQxLCBUb3RhbENvZWZmICAgOy8vIE1heGltdW0gbnVtYmVyIG9mIHplcm9zIHRoZXJlIGNvdWxkIGJlCi0gICAgICAgIE1fQURSICAgcFJ1biwgcHBSdW4KLSAgICAgICAgTU9WICAgICBDb2VmZk51bSxUb3RhbENvZWZmCi0gICAgICAgIFNVQiAgICAgQ29lZmZOdW0sQ29lZmZOdW0sIzEKLSAgICAgICAgQkVRICAgICBOb1plcm9zTGVmdAotICAgICAgICAKLSAgICAgICAgOy8vIFVucGFjayBudW1iZXIgb2YgemVyb3MgZnJvbSBiaXRzdHJlYW0KLSAgICAgICAgVEVRICAgICBUMSwgIzQgICAgICAgIAotICAgICAgICBMRFJFUSAgIHBWTERUYWJsZSwgPShhcm1WQ000UDEwX0NBVkxDVG90YWxaZXJvczJ4MlRhYmxlcy00KQotICAgICAgICBMRFJORSAgIHBWTERUYWJsZSwgPShhcm1WQ000UDEwX0NBVkxDVG90YWxaZXJvVGFibGVzLTQpCi0gICAgICAgIExEUiAgICAgcFZMRFRhYmxlLCBbcFZMRFRhYmxlLCBUb3RhbENvZWZmLCBMU0wgIzJdCi0gICAgICAgIAotICAgICAgICBNX0JEX1ZMRCAgU3ltYm9sLCBUMSwgVDIsIHBWTERUYWJsZSwgNCwgMiA7Ly8gU3ltYm9sID0gWmVyb3NMZWZ0Ci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9aZXJvc0xlZnQgCi0gICAgICAgIFNVQlMgICAgQ291bnQsIENvdW50LCAjMQotICAgICAgICBNX1BSSU5URiAiUnVuPSVkXG4iLCBaZXJvc0xlZnQKLSAgICAgICAgU1RSR0VCICBaZXJvc0xlZnQsIFtwUnVuXSwgIzEKLSAgICAgICAgQkdUICAgICBOb1plcm9zTGVmdAotCi1MYXN0UnVuICAgICAgICAKLSAgICAgICAgOy8vIEZpbmFsIHJ1biBsZW5ndGggaXMgcmVtYWluaW5nIHplcm9zCi0gICAgICAgIE1fUFJJTlRGICJMYXN0UnVuPSVkXG4iLCBaZXJvc0xlZnQKLSAgICAgICAgU1RSQiAgICBaZXJvc0xlZnQsIFtwUnVuXSwgIzEgICAgICAgIAotICAgICAgICAKLSAgICAgICAgOy8vIFdyaXRlIGNvZWZmaWNpZW50cyB0byBvdXRwdXQgYXJyYXkKLSAgICAgICAgTV9MRFIgICBUMSwgcFNNYXhOdW1Db2VmZiAgICAgICAgICAgICAgICAgICAgOy8vIHNNYXhOdW1Db2VmZgotICAgICAgICBURVEgICAgIFQxLCAjMTUKLSAgICAgICAgQURERVEgICBDb2VmZk51bSxDb2VmZk51bSwjMQotICAgICAgICAKLQotICAgICAgICBTVUIgICAgIHBSdW4scFJ1bixUb3RhbENvZWZmCi0gICAgICAgIFNVQiAgICAgcExldmVsLHBMZXZlbCxUb3RhbENvZWZmICAKLSAgICAgICAgU1VCICAgICBwTGV2ZWwscExldmVsLFRvdGFsQ29lZmYgICAKLQotICAgICAgICBNX0xEUiAgIHBwUG9zQ29lZmJ1ZiwgcHBwUG9zQ29lZmJ1ZgotICAgICAgICBMRFIgICAgIHBQb3NDb2VmYnVmLCBbcHBQb3NDb2VmYnVmXQotICAgICAgICBURVEgICAgIFQxLCAjNAotICAgICAgICBMRFJFUSAgIHBaaWdaYWcsID1hcm1WQ000UDEwX1ppZ1phZ18yeDIKLSAgICAgICAgTERSTkUgICBwWmlnWmFnLCA9YXJtVkNNNFAxMF9aaWdaYWdfNHg0Ci0KLSAgICAgICAgCi0gICAgICAgIAotT3V0cHV0TG9vcAotICAgICAgICAKLSAgICAgICAgTERSQiAgICBUMiwgW3BSdW5dLCMxCi0gICAgICAgIExEUkIgICAgVDEsIFtwWmlnWmFnLCBDb2VmZk51bV0KLSAgICAgICAgU1VCICAgICBDb2VmZk51bSwgQ29lZmZOdW0sICMxICAgICAgOy8vIFNraXAgTm9uIHplcm8KLSAgICAgICAgU1VCICAgICBDb2VmZk51bSwgQ29lZmZOdW0sIFQyICAgICAgOy8vIFNraXAgWmVybyBydW4KLSAgICAgICAgCi0gICAgICAgIExEUlNIICAgVDIsIFtwTGV2ZWxdLCMyCi0gICAgICAgIAotICAgICAgICBTVUJTICAgIFRvdGFsQ29lZmYsIFRvdGFsQ29lZmYsICMxICAgICAgIAotICAgICAgICBPUlJFUSAgIFQxLCBUMSwgI0xBU1RfQ09FRkYKLSAgICAgICAgCi0gICAgICAgIEFERCAgICAgdGVtcCwgVDIsICMxMjgKLSAgICAgICAgQ01QICAgICB0ZW1wLCAjMjU2Ci0gICAgICAgIE9SUkNTICAgVDEsIFQxLCAjVFdPX0JZVEVfQ09FRkYKLQotICAgICAgICAKLSAgICAgICAgVEVRICAgICBUb3RhbENvZWZmLCAjMCAgICAgICAgICAgICAgOy8vIFByZXNlcnZlcyBjYXJyeSAgICAgICAgCi0gICAgICAgIAotICAgICAgICBNX1BSSU5URiAiT3V0cHV0PSUwMnggJTA0eFxuIiwgVDEsIFQyCi0gICAgICAgIFNUUkIgICAgVDEsIFtwUG9zQ29lZmJ1Zl0sICMxCi0gICAgICAgIFNUUkIgICAgVDIsIFtwUG9zQ29lZmJ1Zl0sICMxCi0gICAgICAgIE1PViAgICAgVDIsIFQyLCBMU1IgIzgKLSAgICAgICAgU1RSQ1NCICBUMiwgW3BQb3NDb2VmYnVmXSwgIzEgICAgICAgICAgICAgICAgCi0gICAgICAgIEJORSAgICAgT3V0cHV0TG9vcAotICAgICAgICAKLSAgICAgICAgOy8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b24gaGVhZGVyCi0gICAgICAgIE1fU1RBUlQgYXJtVkNNNFAxMF9JbnRlcnBvbGF0ZUx1bWFfSG9yQWxpZ245eF91bnNhZmUgICAgIAotICAgICAgICAKLSAgICAgICAgOy8vIENvcHkgcERzdCB0byBzY3JhdGNoCi0gICAgICAgIE1PViAgICAgU2NyYXRjaCwgcERzdAotCi1TdGFydEFsaWduZWRTdGFja0NvcHkKLSAgICAgICAgQU5EICAgICB4LCBwU3JjLCAjMwotICAgICAgICBCSUMgICAgIHBTcmMsIHBTcmMsICMzCi0gICAgICAgIAotICAgICAgICBNX1NXSVRDSCB4Ci0gICAgICAgIE1fQ0FTRSAgIENvcHkwdG9BbGlnbmVkCi0gICAgICAgIE1fQ0FTRSAgIENvcHkxdG9BbGlnbmVkCi0gICAgICAgIE1fQ0FTRSAgIENvcHkydG9BbGlnbmVkCi0gICAgICAgIE1fQ0FTRSAgIENvcHkzdG9BbGlnbmVkCi0gICAgICAgIE1fRU5EU1dJVENICi0KLUNvcHkwdG9BbGlnbmVkICAKLSAgICAgICAgTERNICAgICBwU3JjLCB7eDAsIHgxLCB4Mn0KLSAgICAgICAgU1VCUyAgICBpSGVpZ2h0LCBpSGVpZ2h0LCAjMQotICAgICAgICBBREQgICAgIHBTcmMsIHBTcmMsIHNyY1N0ZXAKLSAgICAgICAgCi0gICAgICAgIDsvLyBPbmUgY3ljbGUgc3RhbGwKLQotICAgICAgICBTVE0gICAgIHBEc3QhLCB7eDAsIHgxLCB4Mn0gICAgICAgICAgICAgICAgICAgICA7Ly8gU3RvcmUgYWxpZ25lZCBvdXRwdXQgcm93Ci0gICAgICAgIEJHVCAgICAgQ29weTB0b0FsaWduZWQKLSAgICAgICAgQiAgICAgICBDb3B5RW5kICAKLSAgICAgIAotQ29weTF0b0FsaWduZWQgICAgICAgIAotICAgICAgICBMRE0gICAgIHBTcmMsIHt4MCwgeDEsIHgyfQotICAgICAgICBTVUJTICAgIGlIZWlnaHQsIGlIZWlnaHQsICMxCi0gICAgICAgIEFERCAgICAgcFNyYywgcFNyYywgc3JjU3RlcAotICAgICAgICAKLSAgICAgICAgOy8vIE9uZSBjeWNsZSBzdGFsbAotCi0gICAgICAgIE1PViAgICAgeDAsIHgwLCBMU1IgIzgKLSAgICAgICAgT1JSICAgICB4MCwgeDAsIHgxLCBMU0wgIzI0Ci0gICAgICAgIE1PViAgICAgeDEsIHgxLCBMU1IgIzgKLSAgICAgICAgT1JSICAgICB4MSwgeDEsIHgyLCBMU0wgIzI0Ci0gICAgICAgIE1PViAgICAgeDIsIHgyLCBMU1IgIzgKLSAgICAgICAgU1RNICAgICBwRHN0ISwge3gwLCB4MSwgeDJ9ICAgICAgICAgICAgICAgICAgICAgOy8vIFN0b3JlIGFsaWduZWQgb3V0cHV0IHJvdwotICAgICAgICBCR1QgICAgIENvcHkxdG9BbGlnbmVkCi0gICAgICAgIEIgICAgICAgQ29weUVuZCAgCi0KLUNvcHkydG9BbGlnbmVkICAgICAgICAKLSAgICAgICAgTERNICAgICBwU3JjLCB7eDAsIHgxLCB4Mn0KLSAgICAgICAgU1VCUyAgICBpSGVpZ2h0LCBpSGVpZ2h0LCAjMQotICAgICAgICBBREQgICAgIHBTcmMsIHBTcmMsIHNyY1N0ZXAKLSAgICAgICAgCi0gICAgICAgIDsvLyBPbmUgY3ljbGUgc3RhbGwKLQotICAgICAgICBNT1YgICAgIHgwLCB4MCwgTFNSICMxNgotICAgICAgICBPUlIgICAgIHgwLCB4MCwgeDEsIExTTCAjMTYKLSAgICAgICAgTU9WICAgICB4MSwgeDEsIExTUiAjMTYKLSAgICAgICAgT1JSICAgICB4MSwgeDEsIHgyLCBMU0wgIzE2Ci0gICAgICAgIE1PViAgICAgeDIsIHgyLCBMU1IgIzE2Ci0gICAgICAgIFNUTSAgICAgcERzdCEsIHt4MCwgeDEsIHgyfSAgICAgICAgICAgICAgICAgICAgIDsvLyBTdG9yZSBhbGlnbmVkIG91dHB1dCByb3cKLSAgICAgICAgQkdUICAgICBDb3B5M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LSAgICAgICAgTV9DQVNFICAgQ29weTF0b1ZBbGlnbmVkCi0gICAgICAgIE1fQ0FTRSAgIENvcHkydG9WQWxpZ25lZAotICAgICAgICBNX0NBU0UgICBDb3B5M3RvVkFsaWduZWQKLSAgICAgICAgTV9FTkRTV0lUQ0gKLSAgICAgICAgCi1Db3B5MHRvVkFsaWduZWQgIAotICAgICAgICBNX0xEUiAgIHgwLCBbcFNyY10sIHNyY1N0ZXAKLSAgICAgICAgU1VCUyAgICBpSGVpZ2h0LCBpSGVpZ2h0LCAjMQotICAgICAgICAKLSAgICAgICAgOy8vIE9uZSBjeWNsZSBzdGFsbAotCi0gICAgICAgIFNUUiAgICAgeDAsIFtwRHN0XSwgIzQgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA7Ly8gU3RvcmUgYWxpZ25lZCBvdXRwdXQgcm93Ci0gICAgICAgIEJHVCAgICAgQ29weTB0b1ZBbGlnbmVkCi0gICAgICAgIEIgICAgICAgQ29weVZFbmQgIAotICAgICAgCi1Db3B5MXRvVkFsaWduZWQgICAgICAgIAotICAgICAgICBMRFIgICAgIHgxLCBbcFNyYywgIzRdCi0gICAgICAgIE1fTERSICAgeDAsIFtwU3JjXSwgc3JjU3RlcAotICAgICAgICBTVUJTICAgIGlIZWlnaHQsIGlIZWlnaHQsICMxICAgICAgICAKLSAgICAgICAgCi0gICAgICAgIDsvLyBPbmUgY3ljbGUgc3RhbGwKLQotICAgICAgICBNT1YgICAgIHgxLCB4MSwgTFNMICMyNAotICAgICAgICBPUlIgICAgIHgwLCB4MSwgeDAsIExTUiAjOAotICAgICAgICBTVFIgICAgIHgwLCBbcERzdF0sICM0ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOy8vIFN0b3JlIGFsaWduZWQgb3V0cHV0IHJvdwotICAgICAgICBCR1QgICAgIENvcHkxdG9WQWxpZ25lZAotICAgICAgICBCICAgICAgIENvcHlWRW5kICAKLQotQ29weTJ0b1ZBbGlnbmVkICAgICAgICAKLSAgICAgICAgTERSICAgICB4MSwgW3BTcmMsICM0XQotICAgICAgICBNX0xEUiAgIHgwLCBbcFNyY10sIHNyY1N0ZXAKLSAgICAgICAgU1VCUyAgICBpSGVpZ2h0LCBpSGVpZ2h0LCAjMSAgICAgICAgCi0gICAgICAgIAotICAgICAgICA7Ly8gT25lIGN5Y2xlIHN0YWxsCi0KLSAgICAgICAgTU9WICAgICB4MSwgeDEsIExTTCAjMTYKLSAgICAgICAgT1JSICAgICB4MCwgeDEsIHgwLCBMU1IgIzE2Ci0gICAgICAgIFNUUiAgICAgeDAsIFtwRHN0XSwgIzQgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA7Ly8gU3RvcmUgYWxpZ25lZCBvdXRwdXQgcm93Ci0gICAgICAgIEJHVCAgICAgQ29weTJ0b1ZBbGlnbmVkCi0gICAgICAgIEIgICAgICAgQ29weVZFbmQgIAotCi1Db3B5M3RvVkFsaWduZWQgICAgICAgIAotICAgICAgICBMRFIgICAgIHgxLCBbcFNyYywgIzRdCi0gICAgICAgIE1fTERSICAgeDAsIFtwU3JjXSwgc3JjU3RlcAotICAgICAgICBTVUJTICAgIGlIZWlnaHQsIGlIZWlnaHQsICMxICAgICAgICAKLSAgICAgICAgCi0gICAgICAgIDsvLyBPbmUgY3ljbGUgc3RhbGwKLQotICAgICAgICBNT1YgICAgIHgxLCB4MSwgTFNMICM4Ci0gICAgICAgIE9SUiAgICAgeDAsIHgxLCB4MCwgTFNSICMyNAotICAgICAgICBTVFIgICAgIHgwLCBbcERzdF0sICM0ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOy8vIFN0b3JlIGFsaWduZWQgb3V0cHV0IHJvdwotICAgICAgICBCR1QgICAgIENvcHkzdG9WQWxpZ25lZAotCi1Db3B5VkVuZCAgCi0KLSAgICAgICAgU1VCICAgICBwU3JjLCBwRHN0LCAjMjgKLSAgICAgICAgTU9WICAgICBzcmNTdGVwLCAjNAotCi0gICAgICAgIE1fRU5ECi0KLQotICAgIEVORElGCi0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0Ci0gICAgICAgIE1fU1RSICAgeDAsIFtwRHN0XSwgZHN0U3RlcAotICAgICAgICBNT1YgICAgIHgyLCB4MiwgTFNSICM4Ci0gICAgICAgIE9SUiAgICAgeDIsIHgyLCB4MywgTFNMICMyNAotICAgICAgICBMRFIgICAgIHgxLCBbcFNyYywgIzRdCi0gICAgICAgIE1fTERSICAgeDAsIFtwU3JjXSwgc3JjU3RlcAotICAgICAgICBNX1NUUiAgIHgyLCBbcERzdF0sIGRzdFN0ZXAKLSAgICAgICAgTERSICAgICB4MywgW3BTcmMsICM0XQotICAgICAgICBNX0xEUiAgIHgyLCBbcFNyY10sIHNyY1N0ZXAKLSAgICAgICAgTU9WICAgICB4MCwgeDAsIExTUiAjOAotICAgICAgICBPUlIgICAgIHgwLCB4MCwgeDEsIExTTCAjMjQKLSAgICAgICAgTV9TVFIgICB4MCwgW3BEc3RdLCBkc3RTdGVwCi0gICAgICAgIE1PViAgICAgeDIsIHgyLCBMU1IgIzgKLSAgICAgICAgT1JSICAgICB4MiwgeDIsIHgzLCBMU0wgIzI0Ci0gICAgICAgIE1fU1RSICAgeDIsIFtwRHN0XSwgZHN0U3RlcAotICAgICAgICBCICAgICAgIENvcHk0eDRFbmQgIAotICAgICAgCi1Db3B5NHg0QWxpZ24yCi0gICAgICAgIExEUiAgICAgeDEsIFtwU3JjLCAjNF0KLSAgICAgICAgTV9MRFIgICB4MCwgW3BTcmNdLCBzcmNTdGVwCi0gICAgICAgIExEUiAgICAgeDMsIFtwU3JjLCAjNF0KLSAgICAgICAgTV9MRFIgICB4MiwgW3BTcmNdLCBzcmNTdGVwCi0gICAgICAgIE1PViAgICAgeDAsIHgwLCBMU1IgIzE2Ci0gICAgICAgIE9SUiAgICAgeDAsIHgwLCB4MSwgTFNMICMxNgotICAgICAgICBNX1NUUiAgIHgwLCBbcERzdF0sIGRzdFN0ZXAKLSAgICAgICAgTU9WICAgICB4MiwgeDIsIExTUiAjMTYKLSAgICAgICAgT1JSICAgICB4MiwgeDIsIHgzLCBMU0wgIzE2Ci0gICAgICAgIE1fU1RSICAgeDIsIFtwRHN0XSwgZHN0U3RlcCAgICAgICAgCi0KLSAgICAgICAgTERSICAgICB4MSwgW3BTcmMsICM0XQotICAgICAgICBNX0xEUiAgIHgwLCBbcFNyY10sIHNyY1N0ZXAKLSAgICAgICAgTERSICAgICB4MywgW3BTcmMsICM0XQotICAgICAgICBNX0xEUiAgIHgyLCBbcFNyY10sIHNyY1N0ZXAKLSAgICAgICAgTU9WICAgICB4MCwgeDAsIExTUiAjMTYKLSAgICAgICAgT1JSICAgICB4MCwgeDAsIHgxLCBMU0wgIzE2Ci0gICAgICAgIE1fU1RSICAgeDAsIFtwRHN0XSwgZHN0U3RlcAotICAgICAgICBNT1YgICAgIHgyLCB4MiwgTFNSICMxNgotICAgICAgICBPUlIgICAgIHgyLCB4MiwgeDMsIExTTCAjMTYKLSAgICAgICAgTV9TVFIgICB4MiwgW3BEc3RdLCBkc3RTdGVwICAgICAgICAKLSAgICAgICAgQiAgICAgICBDb3B5NHg0RW5kICAKLQotQ29weTR4NEFsaWduMyAKLSAgICAgICAgTERSICAgICB4MSwgW3BTcmMsICM0XQotICAgICAgICBNX0xEUiAgIHgwLCBbcFNyY10sIHNyY1N0ZXAKLSAgICAgICAgTERSICAgICB4MywgW3BTcmMsICM0XQotICAgICAgICBNX0xEUiAgIHgyLCBbcFNyY10sIHNyY1N0ZXAKLSAgICAgICAgTU9WICAgICB4MCwgeDAsIExTUiAjMjQKLSAgICAgICAgT1JSICAgICB4MCwgeDAsIHgxLCBMU0wgIzgKLSAgICAgICAgTV9TVFIgICB4MCwgW3BEc3RdLCBkc3RTdGVwCi0gICAgICAgIE1PViAgICAgeDIsIHgyLCBMU1IgIzI0Ci0gICAgICAgIE9SUiAgICAgeDIsIHgyLCB4MywgTFNMICM4Ci0gICAgICAgIE1fU1RSICAgeDIsIFtwRHN0XSwgZHN0U3RlcAotCi0gICAgICAgIExEUiAgICAgeDEsIFtwU3JjLC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BSTiAxMQotcEJ1ZiAgICAgICAgICAgIFJOIDcKLXIweDBmZTAwZmUwICAgICBSTiA2Ci1yMHgwMGZmMDBmZiAgICAgUk4gMTIKLUNvdW50ICAgICAgICAgICBSTiAxNAotVmFsdWVBMCAgICAgICAgIFJOIDEwCi1WYWx1ZUExICAgICAgICAgUk4gMTEKLQotICAgIElGIEFSTTExMzZKUwotCi0KLSAgICAgICAgOy8vIEZ1bmN0aW9uIGhlYWRlcgotICAgICAgICBNX1NUQVJUIGFybVZDTTRQMTBfSW50ZXJwb2xhdGVMdW1hX0hvckRpYWdDb3B5X3Vuc2FmZSwgcjYKLQotICAgICAgICA7Ly8gQ29kZSBzdGFydCAgICAgCi0gICAgICAgIE1PViAgICAgICAgIENvdW50LCAjNCAgIAotICAgICAgICBMRFIgICAgICAgICByMHgwZmUwMGZlMCwgPTB4MGZlMDBmZTAKLSAgICAgICAgTERSICAgICAgICAgcjB4MDBmZjAwZmYsID0weDAwZmYwMGZmICAgICAgICAKLUxvb3BTdGFydDEKLSAgICAgICAgTERSICAgICAgICAgVGVtcDQsIFtwU3JjMCwgIzEyXQotICAgICAgICBMRFIgICAgICAgICBUZW1wMywgW3BTcmMwLCAjOF0gICAgICAgIAotICAgICAgICBMRFIgICAgICAgICBUZW1wMiwgW3BTcmMwLCAjNF0KLSAgICAgICAgTV9MRFIgICAgICAgVGVtcDEsIFtwU3JjMF0sIHNyY1N0ZXAwICAgICAgICAgICAgICAKLSAgICAgICAgVVFTVUIxNiAgICAgVGVtcDQsIFRlbXA0LCByMHgwZmUwMGZlMCAgICAgICAgCi0gICAgICAgIFVRU1VCMTYgICAgIFRlbXAzLCBUZW1wMywgcjB4MGZlMDBmZTAgICAgICAgICAgICAgICAgIAotICAgICAgICBVUVNVQjE2ICAgICBUZW1wMiwgVGVtcDIsIHIweDBmZTAwZmUwICAgICAgICAKLSAgICAgICAgVVFTVUIxNiAgICAgVGVtcDEsIFRlbXAxLCByMHgwZmUwMGZlMCAgICAgICAgICAgICAgICAgCi0gICAgICAgIFVTQVQxNiAgICAgIFRlbXA0LCAjMTMsIFRlbXA0Ci0gICAgICAgIFVTQVQxNiAgICAgIFRlbXAzLCAjMTMsIFRlbXAzICAgICAgICAgICAgICAgICAgICAgICAgICAKLSAgICAgICAgVVNBVDE2ICAgICAgVGVtcDIsICMxMywgVGVtcDIKLSAgICAgICAgVVNBVDE2ICAgICAgVGVtcDEsICMxMywgVGVtcDEgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCi0gICAgICAgIEFORCAgICAgICAgIFRlbXA0LCByMHgwMGZmMDBmZiwgVGVtcDQsIExTUiAjNSAgICAgICAgIAotICAgICAgICBBTkQgICAgICAgICBUZW1wMywgcjB4MDBmZjAwZmYsIFRlbXAzLCBMU1IgIzUgICAgICAgICAKLSAgICAgICAgQU5EICAgICAgICAgVGVtcDIsIHIweDAwZmYwMGZmLCBUZW1wMiwgTFNSICM1ICAgICAgICAgCi0gICAgICAgIEFORCAgICAgICAgIFRlbXAxLCByMHgwMGZmMDBmZiwgVGVtcDEsIExTUiAjNSAgICAgICAgIAotICAgICAgICBPUlIgICAgICAgICBWYWx1ZUExLCBUZW1wMywgVGVtcDQsIExTTCAjOCAgICAgICAgICAgICAKLSAgICAgICAgT1JSICAgICAgICAgVmFsdWVBMCwgVGVtcDEsIFRlbXAyLCBMU0wgIzggICAgICAgICAgICAgCi0gICAgICAgIFNVQlMgICAgICAgIENvdW50LCBDb3VudCwgIzEgICAgICAgICAgICAgICAgICAgCi0gICAgICAgIFNUUkQgICAgICAgIFZhbHVlQTAsIFtwQnVmXSwgIzggCi0gICAgICAgIEJHVCAgICAgICAgIExvb3BTdGFydDEKLUVuZDEKLSAgICAgICAgU1VCICAgICAgICBwU3JjMCwgcEJ1ZiwgIzMyCi0gICAgICAgIE1PViAgICAgICAgc3JjU3RlcDAsICM4Ci0KLSAgICAgICAgTV9FTkQKLQotCi0gICAgICAgIDsvLyBGdW5jdGlvbiBoZWFkZXIKLSAgICAgICAgTV9TVEFSVCBhcm1WQ000UDEwX0ludGVycG9sYXRlTHVtYV9WZXJEaWFnQ29weV91bnNhZmUsIHI2Ci0gICAgICAgIAotICAgICAgICA7Ly8gQ29kZSBzdGFydCAgICAgICAgCi0gICAgICAgIExEUiAgICAgICAgIHIweDBmZTAwZmUwLCA9MHgwZmUwMGZlMAotICAgICAgICBMRFIgICAgICAgICByMHgwMGZmMDBmZiwgPTB4MDBmZjAwZmYKLSAgICAgICAgTU9WICAgICAgICAgQ291bnQsICMyCi0KLUxvb3BTdGFydCAgICAKLSAgICAgICAgTERSICAgICAgICAgVGVtcDQsIFtwU3JjMCwgIzEyXQotICAgICAgICBMRFIgICAgICAgICBUZW1wMywgW3BTcmMwLCAjOF0gICAgICAgIAotICAgICAgICBMRFIgICAgICAgICBUZW1wMiwgW3BTcmMwLCAjNF0KLSAgICAgICAgTV9MRFIgICAgICAgVGVtcDEsIFtwU3JjMF0sIHNyY1N0ZXAwCi0gICAgICAgIAotICAgICAgICBVUVNVQjE2ICAgICBUZW1wNCwgVGVtcDQsIHIweDBmZTAwZmUwICAgICAgICAKLSAgICAgICAgVVFTVUIxNiAgICAgVGVtcDMsIFRlbXAzLCByMHgwZmUwMGZlMCAgICAgICAgICAgICAgICAgCi0gICAgICAgIFVRU1VCMTYgICAgIFRlbXAyLCBUZW1wMiwgcjB4MGZlMDBmZTAgICAgICAgIAotICAgICAgICBVUVNVQjE2ICAgICBUZW1wMSwgVGVtcDEsIHIweDBmZTAwZmUwICAgICAgICAgICAgICAgICAKLSAgICAgICAgCi0gICAgICAgIFVTQVQxNiAgICAgIFRlbXA0LCAjMTMsIFRlbXA0Ci0gICAgICAgIFVTQVQxNiAgICAgIFRlbXAzLCAjMTMsIFRlbXAzICAgICAgICAgICAgICAgICAgICAgICAgICAKLSAgICAgICAgVVNBVDE2ICAgICAgVGVtcDIsICMxMywgVGVtcDIKLSAgICAgICAgVVNBVDE2ICAgICAgVGVtcDEsICMxMywgVGVtcDEKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKLSAgICAgICAgQU5EICAgICAgICAgVGVtcDQsIHIweDAwZmYwMGZmLCBUZW1wNCwgTFNSICM1ICAgICAgICAgCi0gICAgICAgIEFORCAgICAgICAgIFRlbXAzLCByMHgwMGZmMDBmZiwgVGVtcDMsIExTUiAjNSAgICAgICAgIAotICAgICAgICBBTkQgICAgICAgICBUZW1wMiwgcjB4MDBmZjAwZmYsIFRlbXAyLCBMU1IgIzUgICAgICAgICAKLSAgICAgICAgQU5EICAgICAgICAgVGVtcDEsIHIweDAwZmYwMGZmLCBUZW1wMSwgTFNSICM1ICAgICAgICAgCi0gICAgICAgIE9SUiAgICAgICAgIFZhbHVlQTEsIFRlbXAzLCBUZW1wNCwgTFNMICM4ICAgICAgICA7Ly8gW2QyIGMyIGQwIGMwXSAgICAgICAgICAgICAKLSAgICAgICAgT1JSICAgICAgICAgVmFsdWVBMCwgVGVtcDEsIFRlbXAyLCBMU0wgIzggICAgICAgIDsvLyBbYjIgYTIgYjAgYTBdICAgICAgICAgCi0gICAgICAgICAgICAgICAgICAgIAotICAgICAgICBQS0hCVCAgICAgICBUZW1wMSwgVmFsdWVBMCwgVmFsdWVBMSwgTFNMICMxNiAgICAgOy8vIFtkMCBjMCBiMCBhMF0KLQotICAgICAgICBTVFIgICAgICAgICBUZW1wMSwgW3BCdWZdLCAjOCAKLSAgICAgICAgUEtIVEIgICAgICAgVGVtcDIsIFZhbHVlQTEsIFZhbHVlQTAsIEFTUiAjMTYgICAgIDsvLyBbZDIgYzIgYjIgYTJdCi0gICAgICAgIFNUUiAgICAgICAgIFRlbXAyLCBbcEJ1Zl0sICMtNCAgCi0KLSAgICAgICAgTERSICAgICAgICAgVGVtcDQsIFtwU3JjMCwgIzEyXQotICAgICAgICBMRFIgICAgICAgICBUZW1wMywgW3BTcmMwLCAjOF0gICAgICAgIAotICAgICAgICBMRFIgICAgICAgICBUZW1wMiwgW3BTcmMwLCAjNF0KLSAgICAgICAgTV9MRFIgICAgICAgVGVtcDEsIFtwU3JjMF0sIHNyY1N0ZXAwCi0gICAgICAgIAotICAgICAgICBVUVNVQjE2ICAgICBUZW1wNCwgVGVtcDQsIHIweDBmZTAwZmUwICAgICAgICAKLSAgICAgICAgVVFTVUIxNiAgICAgVGVtcDMsIFRlbXAzLCByMHgwZmUwMGZlMCAgICAgICAgICAgICAgICAgCi0gICAgICAgIFVRU1VCMTYgICAgIFRlbXAyLCBUZW1wMiwgcjB4MGZlMDBmZTAgICAgICAgIAotICAgICAgICBVUVNVQjE2ICAgICBUZW1wMSwgVGVtcDEsIHIweDBmZTAwZmUwICAgICAgICAgICAgICAgICAKLSAgICAgICAgCi0gICAgICAgIFVTQVQxNiAgICAgIFRlbXA0LCAjMTMsIFRlbXA0Ci0gICAgICAgIFVTQVQxNiAgICAgIFRlbXAzLCAjMTMsIFRlbXAzICAgICAgICAgICAgICAgICAgICAgICAgICAKLSAgICAgICAgVVNBVDE2ICAgICAgVGVtcDIsICMxMywgVGVtcDIKLSAgICAgICAgVVNBVDE2ICAgICAgVGVtcDEsICMxMywgVGVtcDEKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKLSAgICAgICAgQU5EICAgICAgICAgVGVtcDQsIHIweDAwZmYwMGZmLCBUZW1wNCwgTFNSICM1ICAgICAgICAgCi0gICAgICAgIEFORCAgICAgICAgIFRlbXAzLCByMHgwMGZmMDBmZiwgVGVtcDMsIExTUiAjNSAgICAgICAgIAotICAgICAgICBBTkQgICAgICAgICBUZW1wMiwgcjB4MDBmZjAwZmYsIFRlbXAyLCBMU1IgIzUgICAgICAgICAKLSAgICAgICAgQU5EICAgICAgICAgVGVtcDEsIHIweDAwZmYwMGZmLCBUZW1wMSwgTFNSICM1ICAgICAgICAgCi0gICAgICAgIE9SUiAgICAgICAgIFZhbHVlQTEsIFRlbXAzLCBUZW1wNCwgTFNMICM4ICAgICAgICA7Ly8gW2QyIGMyIGQwIGMwXSAgICAgICAgICAgICAK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IDEKLXBEc3QgICAgICAgICAgICBSTiAyCi1kc3RTdGVwICAgICAgICAgUk4gMwotCi07Ly8gRGVjbGFyZSBOZW9uIHJlZ2lzdGVycwotZENvZWZmNSAgICAgICAgIEROIDMwLlMxNgotZENvZWZmMjAgICAgICAgIEROIDMxLlMxNgotcUNvZWZmNSAgICAgICAgIFFOIDE0LlMzMgotcUNvZWZmMjAgICAgICAgIFFOIDE1LlMzMgotICAgICAgICAKLXFTcmMwMSAgICAgICAgICBRTiAwLlU4Ci1kU3JjMCAgICAgICAgICAgRE4gMC5VOAotZFNyYzEgICAgICAgICAgIEROIDEuVTggICAgICAgICAgICAgICAgCi0gICAgICAgICAgICAgICAgCi1kU3JjYiAgICAgICAgICAgRE4gNC5VOAotZFNyY2MgICAgICAgICAgIEROIDIuVTgKLWRTcmNkICAgICAgICAgICBETiAzLlU4Ci1kU3JjZSAgICAgICAgICAgRE4gNS5VOAotZFNyY2YgICAgICAgICAgIEROIDEuVTgKLQotcVNyY2IgICAgICAgICAgIFFOIDIuUzE2Ci1xU3JjYyAgICAgICAgICAgUU4gMS5TMTYKLWRTcmNCICAgICAgICAgICBETiA0LlMxNgotZFNyY0MgICAgICAgICAgIEROIDIuUzE2Ci0KLXFSZXMwICAgICAgICAgICBRTiA1LlMxNgotcVJlczEgICAgICAgICAgIFFOIDYuUzE2Ci1xUmVzMiAgICAgICAgICAgUU4gNy5TMTYKLXFSZXMzICAgICAgICAgICBRTiA4LlMxNgotcVJlczQgICAgICAgICAgIFFOIDkuUzE2Ci1xUmVzNSAgICAgICAgICAgUU4gMTAuUzE2Ci1xUmVzNiAgICAgICAgICAgUU4gMTEuUzE2Ci1xUmVzNyAgICAgICAgICAgUU4gMTIuUzE2Ci1xUmVzOCAgICAgICAgICAgUU4gMTMuUzE2Ci0gICAgCi1kUmVzMCAgICAgICAgICAgRE4gMTAuUzE2Ci1kUmVzMSAgICAgICAgICAgRE4gMTIuUzE2Ci1kUmVzMiAgICAgICAgICAgRE4gMTQ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gICAgICAgIGRDb2VmZjUsICM1Ci0KLSAgICAgICAgOy8vIFJvdzAKLSAgICAgICAgVkVYVCAgICAgICAgZFNyY2IsIGRTcmMwLCBkU3JjMSwgIzEgICAgIDsvLyBbYjAgYjEgYjIgYjMgLi5dCi0gICAgICAgIFZFWFQgICAgICAgIGRTcmNjLCBkU3JjMCwgZFNyYzEsICMyCi0gICAgICAgIFZFWFQgICAgICAgIGRTcmNkLCBkU3JjMCwgZFNyYzEsICMzCi0gICAgICAgIFZFWFQgICAgICAgIGRTcmNlLCBkU3JjMCwgZFNyYzEsICM0Ci0gICAgICAgIFZFWFQgICAgICAgIGRTcmNmLCBkU3JjMCwgZFNyYzEsICM1ICAgICA7Ly8gW2YwIGYxIGYyIGYzIC4uXQotICAgICAgICBWQURETCAgICAgICBxU3JjYywgZFNyY2MsIGRTcmNkICAgICAgICAgOy8vIGMrZCAgICAgICAgICAgICAgICAKLSAgICAgICAgVkFEREwgICAgICAgcVNyY2IsIGRTcmNiLCBkU3JjZSAgICAgICAgIDsvLyBiK2UgICAgICAgIAotICAgICAgICBWQURETCAgICAgICBxUmVzMCwgZFNyYzAsIGRTcmNmICAgICAgICAgOy8vIEFjYz1hK2YKLSAgICAgICAgVkxEMSAgICAgICAgcVNyYzAxLCBbcFNyY10sIHNyY1N0ZXAgICAgIDsvLyBbYTAgYTEgYTIgYTMgLi5dCi0gICAgICAgIFZNTEEgICAgICAgIGRSZXMwLCBkU3JjQywgZENvZWZmMjAgICAgICA7Ly8gQWNjICs9IDIwKihjK2QpCi07ICAgICAgICBWTUxTICAgICAgICBkUmVzMCwgZFNyY0IsIGRDb2VmZjUgICAgICAgOy8vIEFjYyAtPSA1KihiK2UpCi0gICAgICAgIFZNVUwgICAgICAgIGRUbXAwLCBkU3JjQiwgZENvZWZmNSAgICAgICA7Ly8gQWNjIC09IDUqKGIrZSkKLSAgICAgICAgCi0gICAgICAgIDsvLyBSb3cxCi0gICAgICAgIFZFWFQgICAgICAgIGRTcmNiLCBkU3JjMCwgZFNyYzEsICMxICAgICA7Ly8gW2IwIGIxIGIyIGIzIC4uXQotICAgICAgICBWRVhUICAgICAgICBkU3JjYywgZFNyYzAsIGRTcmMxLCAjMgotICAgICAgICBWRVhUICAgICAgICBkU3JjZCwgZFNyYzAsIGRTcmMxLCAjMwotICAgICAgICBWRVhUICAgICAgICBkU3JjZSwgZFNyYzAsIGRTcmMxLCAjNAotICAgICAgICBWRVhUICAgICAgICBkU3JjZiwgZFNyYzAsIGRTcmMxLCAjNSAgICAgOy8vIFtmMCBmMSBmMiBmMyAuLl0KLSAgICAgICAgVkFEREwgICAgICAgcVNyY2MsIGRTcmNjLCBkU3JjZCAgICAgICAgIDsvLyBjK2QgICAgICAgICAgICAgICAgCi0gICAgICAgIFZBRERMICAgICAgIHFTcmNiLCBkU3JjYiwgZFNyY2UgICAgICAgICA7Ly8gYitlICAgICAgICAKLSAgICAgICAgVkFEREwgICAgICAgcVJlczEsIGRTcmMwLCBkU3JjZiAgICAgICAgIDsvLyBBY2M9YStmCi0gICAgICAgIFZMRDEgICAgICAgIHFTcmMwMSwgW3BTcmNdLCBzcmNTdGVwICAgICA7Ly8gW2EwIGExIGEyIGEzIC4uXQotICAgICAgICAKLSAgICAgICAgVlNVQiAgICAgICAgZFJlczAsIGRSZXMwLCBkVG1wMCA7Ly8gVGVSaQotICAgICAgICAKLSAgICAgICAgVk1MQSAgICAgICAgZFJlczEsIGRTcmNDLCBkQ29lZmYyMCAgICAgIDsvLyBBY2MgKz0gMjAqKGMrZCkKLTsgICAgICAgIFZNTFMgICAgICAgIGRSZXMxLCBkU3JjQiwgZENvZWZmNSAgICAgICA7Ly8gQWNjIC09IDUqKGIrZSkKLSAgICAgICAgVk1VTCAgICAgICAgZFRtcDAsIGRTcmNCLCBkQ29lZmY1ICAgICAgIDsvLyBBY2MgLT0gNSooYitlKQotCi0gICAgICAgIDsvLyBSb3cyCi0gICAgICAgIFZFWFQgICAgICAgIGRTcmNiLCBkU3JjMCwgZFNyYzEsICMxICAgICA7Ly8gW2IwIGIxIGIyIGIzIC4uXQotICAgICAgICBWRVhUICAgICAgICBkU3JjYywgZFNyYzAsIGRTcmMxLCAjMgotICAgICAgICBWRVhUICAgICAgICBkU3JjZCwgZFNyYzAsIGRTcmMxLCAjMwotICAgICAgICBWRVhUICAgICAgICBkU3JjZSwgZFNyYzAsIGRTcmMxLCAjNAotICAgICAgICBWRVhUICAgICAgICBkU3JjZiwgZFNyYzAsIGRTcmMxLCAjNSAgICAgOy8vIFtmMCBmMSBmMiBmMyAuLl0KLSAgICAgICAgVkFEREwgICAgICAgcVNyY2MsIGRTcmNjLCBkU3JjZCAgICAgICAgIDsvLyBjK2QgICAgICAgICAgICAgICAgCi0gICAgICAgIFZBRERMICAgICAgIHFTcmNiLCBkU3JjYiwgZFNyY2UgICAgICAgICA7Ly8gYitlICAgICAgICAKLSAgICAgICAgVkFEREwgICAgICAgcVJlczIsIGRTcmMwLCBkU3JjZiAgICAgICAgIDsvLyBBY2M9YStmCi0gICAgICAgIFZMRDEgICAgICAgIHFTcmMwMSwgW3BTcmNdLCBzcmNTdGVwICAgICA7Ly8gW2EwIGExIGEyIGEzIC4uXQotICAgICAgICAKLSAgICAgICAgVlNVQiAgICAgICAgZFJlczEsIGRSZXMxLCBkVG1wMAotCi0gICAgICAgIFZNTEEgICAgICAgIGRSZXMyLCBkU3JjQywgZENvZWZmMjAgICAgICA7Ly8gQWNjICs9IDIwKihjK2QpCi07ICAgICAgICBWTUxTICAgICAgICBkUmVzMiwgZFNyY0IsIGRDb2VmZjUgICAgICAgOy8vIEFjYyAtPSA1KihiK2UpCi0gICAgICAgIFZNVUwgICAgICAgIGRUbXAwLCBkU3JjQiwgZENvZWZmNSAgICAgICA7Ly8gQWNjIC09IDUqKGIrZSkKLQotICAgICAgICA7Ly8gUm93MwotICAgICAgICBWRVhUICAgICAgICBkU3JjYiwgZFNyYzAsIGRTcmMxLCAjMSAgICAgOy8vIFtiMCBiMSBiMiBiMyAuLl0KLSAgICAgICAgVkVYVCAgICAgICAgZFNyY2MsIGRTcmMwLCBkU3JjMSwgIzIKLSAgICAgICAgVkVYVCAgICAgICAgZFNyY2QsIGRTcmMwLCBkU3JjMSwgIzMKLSAgICAgICAgVkVYVCAgICAgICAgZFNyY2UsIGRTcmMwLCBkU3JjMSwgIzQKLSAgICAgICAgVkVYVCAgICAgICAgZFNyY2YsIGRTcmMwLCBkU3JjMSwgIzUgICAgIDsvLyBbZjAgZjEgZjIgZjMgLi5dCi0gICAgICAgIFZBRERMICAgICAgIHFTcmNjLCBkU3JjYywgZFNyY2QgICAgICAgICA7Ly8gYytkICAgICAgICAgICAgICAgIAotICAgICAgICBWQURETCAgICAgICBxU3JjYiwgZFNyY2IsIGRTcmNlICAgICAgICAgOy8vIGIrZSAgICAgICAgCi0gICAgICAgIFZBRERMICAgICAgIHFSZXMzLCBkU3JjMCwgZFNyY2YgICAgICAgICA7Ly8gQWNjPWErZgotICAgICAgICBWTEQxICAgICAgICBxU3JjMDEsIFtwU3JjXSwgc3JjU3RlcCAgICAgOy8vIFthMCBhMSBhMiBhMyAuLl0KLQotICAgICAgICBWU1VCICAgICAgICBkUmVzMiwgZFJlczIsIGRUbXAwCi0KLSAgICAgICAgVk1MQSAgICAgICAgZFJlczMsIGRTcmNDLCBkQ29lZmYyMCAgICAgIDsvLyBBY2MgKz0gMjAqKGMrZCkKLTsgICAgICAgIFZNTFMgICAgICAgIGRSZXMzLCBkU3JjQiwgZENvZWZmNSAgICAgICA7Ly8gQWNjIC09IDUqKGIrZSkKLSAgICAgICAgVk1VTCAgICAgICAgZFRtcDAsIGRTcmNCLCBkQ29lZmY1ICAgICAgIDsvLyBBY2MgLT0gNSooYitlKQotCi0gICAgICAgIDsvLyBSb3c0Ci0gICAgICAgIFZFWFQgICAgICAgIGRTcmNiLCBkU3JjMCwgZFNyYzEsICMxICAgICA7Ly8gW2IwIGIxIGIyIGIzIC4uXQotICAgICAgICBWRVhUICAgICAgICBkU3JjYywgZFNyYzAsIGRTcmMxLCAjMgotICAgICAgICBWRVhUICAgICAgICBkU3JjZCwgZFNyYzAsIGRTcmMxLCAjMwotICAgICAgICBWRVhUICAgICAgICBkU3JjZSwgZFNyYzAsIGRTcmMxLCAjNAotICAgICAgICBWRVhUICAgICAgICBkU3JjZiwgZFNyYzAsIGRTcmMxLCAjNSAgICAgOy8vIFtmMCBmMSBmMiBmMyAuLl0KLSAgICAgICAgVkFEREwgICAgICAgcVNyY2MsIGRTcmNjLCBkU3JjZCAgICAgICAgIDsvLyBjK2QgICAgICAgICAgICAgICAgCi0gICAgICAgIFZBRERMICAgICAgIHFTcmNiLCBkU3JjYiwgZFNyY2UgICAgICAgICA7Ly8gYitlICAgICAgICAKLSAgICAgICAgVkFEREwgICAgICAgcVJlczQsIGRTcmMwLCBkU3JjZiAgICAgICAgIDsvLyBBY2M9YStmCi0gICAgICAgIFZMRDEgICAgICAgIHFTcmMwMSwgW3BTcmNdLCBzcmNTdGVwICAgICA7Ly8gW2EwIGExIGEyIGEzIC4uXQotCi0gICAgICAgIFZTVUIgICAgICAgIGRSZXMzLCBkUmVzMywgZFRtcDAKLQotICAgICAgICBWTUxBICAgICAgICBkUmVzNCwgZFNyY0MsIGRDb2VmZjIwICAgICAgOy8vIEFjYyArPSAyMCooYytkKQotOyAgICAgICAgVk1MUyAgICAgICAgZFJlczQsIGRTcmNCLCBkQ29lZmY1ICAgICAgIDsvLyBBY2MgLT0gNSooYitlKQotICAgICAgICBWTVVMICAgICAgICBkVG1wMCwgZFNyY0IsIGRDb2VmZjUgICAgICAgOy8vIEFjYyAtPSA1KihiK2UpCi0KLSAgICAgICAgOy8vIFJvdzUKLSAgICAgICAgVkVYVCAgICAgICAgZFNyY2IsIGRTcmMwLCBkU3JjMSwgIzEgICAgIDsvLyBbYjAgYjEgYjIgYjMgLi5dCi0gICAgICAgIFZFWFQgICAgICAgIGRTcmNjLCBkU3JjMCwgZFNyYzEsICMyCi0gICAgICAgIFZFWFQgICAgICAgIGRTcmNkLCBkU3JjMCwgZFNyYzEsICMzCi0gICAgICAgIFZFWFQgICAgICAgIGRTcmNlLCBkU3JjMCwgZFNyYzEsICM0Ci0gICAgICAgIFZFWFQgICAgICAgIGRTcmNmLCBkU3JjMCwgZFNyYzEsICM1ICAgICA7Ly8gW2YwIGYxIGYyIGYzIC4uXQotICAgICAgICBWQURETCAgICAgICBxU3JjYywgZFNyY2MsIGRTcmNkICAgICAgICAgOy8vIGMrZCAgICAgICAgICAgICAgICAKLSAgICAgICAgVkFEREwgICAgICAgcVNyY2IsIGRTcmNiLCBkU3JjZSAgICAgICAgIDsvLyBiK2UgICAgICAgIAotICAgICAgICBWQURETCAgICAgICBxUmVzNSwgZFNyYzAsIGRTcmNmICAgICAgICAgOy8vIEFjYz1hK2YKLSAgICAgICAgVkxEMSAgICAgICAgcVNyYzAxLCBbcFNyY10sIHNyY1N0ZXAgICAgIDsvLyBbYTAgYTEgYTIgYTMgLi5dCi0KLSAgICAgICAgVlNVQiAgICAgICAgZFJlczQsIGRSZXM0LCBkVG1wMAotCi0gICAgICAgIFZNTEEgICAgICAgIGRSZXM1LCBkU3JjQywgZENvZWZmMjAgICAgICA7Ly8gQWNjICs9IDIwKihjK2QpCi07ICAgICAgICBWTUxTICAgICAgICBkUmVzNSwgZFNyY0IsIGRDb2VmZjUgICAgICAgOy8vIEFjYyAtPSA1KihiK2UpCi0gICAgICAgIFZNVUwgICAgICAgIGRUbXAwLCBkU3JjQiwgZENvZWZmNSAgICAgICA7Ly8gQWNjIC09IDUqKGIrZSkKLQotICAgICAgICA7Ly8gUm93NgotICAgICAgICBWRVhUICAgICAgICBkU3JjYiwgZFNyYzAsIGRTcmMxLCAjMSAgICAgOy8vIFtiMCBiMSBiMiBiMyAuLl0KLSAgICAgICAgVkVYVCAgICAgICAgZFNyY2MsIGRTcmMwLCBkU3JjMSwgIzIKLSAgICAgICAgVkVYVCAgICAgICAgZFNyY2QsIGRTcmMwLCBkU3JjMSwgIzMKLSAgICAgICAgVkVYVCAgICAgICAgZFNyY2UsIGRTcmMwLCBkU3JjMSwgIzQKLSAgICAgICAgVkVYVCAgICAgICAgZFNyY2YsIGRTcmMwLCBkU3JjMSwgIzUgICAgIDsvLyBbZjAgZjEgZjIgZjMgLi5dCi0gICAgICAgIFZBRERMICAgICAgIHFTcmNjLCBkU3JjYywgZFNyY2QgICAgICAgICA7Ly8gYytkICAgICAgICAgICAgICAgIAotICAgICAgICBWQURETCAgICAgICBxU3JjYiwgZFNyY2IsIGRTcmNlICAgICAgICAgOy8vIGIrZSAgICAgICAgCi0gICAgICAgIFZBRERMICAgICAgIHFSZXM2LCBkU3JjMCwgZFNyY2YgICAgICAgICA7Ly8gQWNjPWErZgotICAgICAgICBWTEQxICAgICAgICBxU3JjMDEsIFtwU3JjXSwgc3JjU3RlcCAgICAgOy8vIFthMCBhMSBhMiBhMyAuLl0KLQotICAgICAgICBWU1VCICAgICAgICBkUmVzNSwgZFJlczUsIGRUbXAwCi0KLSAgICAgICAgVk1MQSAgICAgICAgZFJlczYsIGRTcmNDLCBkQ29lZmYyMCAgICAgIDsvLyBBY2MgKz0gMjAqKGMrZCkKLTsgICAgICAgIFZNTFMgICAgICAgIGRSZXM2LCBkU3JjQiwgZENvZWZmNSAgICAgICA7Ly8gQWNjIC09IDUqKGIrZSkKLSAgICAgICAgVk1VTCAgICAgICAgZFRtcDAsIGRTcmNCLCBkQ29lZmY1ICAgICAgIDsvLyBBY2MgLT0gNSooYitlKQotCi0gICAgICAgIDsvLyBSb3c3Ci0gICAgICAgIFZFWFQgICAgICAgIGRTcmNiLCBkU3JjMCwgZFNyYzEsICMxICAgICA7Ly8gW2IwIGIxIGIyIGIzIC4uXQotICAgICAgICBWRVhUICAgICAgICBkU3JjYywgZFNyYzAsIGRTcmMxLCAjMgotICAgICAgICBWRVhUICAgICAgICBkU3JjZCwgZFNyYzAsIGRTcmMxLCAjMwotICAgICAgICBWRVhUICAgICAgICBkU3JjZSwgZFNyYzAsIGRTcmMxLCAjNAotICAgICAgICBWRVhUICAgICAgICBkU3JjZiwgZFNyYzAsIGRTcmMxLCAjNSAgICAgOy8vIFtmMCBmMSBmMiBmMyAuLl0KLSAgICAgICAgVkFEREwgICAgICAgcVNyY2MsIGRTcmNjLCBkU3JjZCAgICAgICAgIDsvLyBjK2QgICAgICAgICAgICAgICAgCi0gICAgICAgIFZBRERMICAgICAgIHFTcmNiLCBkU3JjYiwgZFNyY2UgICAgICAgICA7Ly8gYitlICAgICAgICAKLSAgICAgICAgVkFEREwgICAgICAgcVJlczcsIGRTcmMwLCBkU3JjZiAgICAgICAgIDsvLyBBY2M9YStmCi0gICAgICAgIFZMRDEgICAgICAgIHFTcmMwMSwgW3BTcmNdLCBzcmNTdGVwICAgICA7Ly8gW2EwIGExIGEyIGEzIC4uXQotCi0gICAgICAgIFZTVUIgICAgICAgIGRSZXM2LCBkUmVzNiwgZFRtcDAKLQotICAgICAgICBWTUxBICAgICAgICBkUmVzNywgZFNyY0MsIGRDb2VmZjIwICAgICAgOy8vIEFjYyArPSAyMCooYytkKQotOyAgICAgICAgVk1MUyAgICAgICAgZFJlczcsIGRTcmNCLCBkQ29lZmY1ICAgICAgIDsvLyBBY2MgLT0gNSooYitlKQotICAgICAgICBWTVVMICAgICAgICBkVG1wMCwgZFNyY0IsIGRDb2VmZjUgICAgICAgOy8vIEFjYyAtPSA1KihiK2UpCi0KLSAgICAgICAgOy8vIFJvdzgKLSAgICAgICAgVkVYVCAgICAgICAgZFNyY2IsIGRTcmMwLCBkU3JjMSwgIzEgICAgIDsvLyBbYjAgYjEgYjIgYjMgLi5dCi0gICAgICAgIFZFWFQgICAgICAgIGRTcmNjLCBkU3JjMCwgZFNyYzEsICMyCi0gICAgICAgIFZFWFQgICAgICAgIGRTcmNkLCBkU3JjMCwgZFNyYzEsICMzCi0gICAgICAgIFZFWFQgICAgICAgIGRTcmNlLCBkU3JjMCwgZFNyYzEsICM0Ci0gICAgICAgIFZFWFQgICAgICAgIGRTcmNmLCBkU3JjMCwgZFNyYzEsICM1ICAgICA7Ly8gW2YwIGYxIGYyIGYzIC4uXQotICAgICAgICBWQURETCAgICAgICBxU3JjYywgZFNyY2MsIGRTcmNkICAgICAgICAgOy8vIGMrZCAgICAgICAgICAgICAgICAKLSAgICAgICAgVkFEREwgICAgICAgcVNyY2IsIGRTcmNiLCBkU3JjZSAgICAgICAgIDsvLyBiK2UgICAgICAgIAotICAgICAgICBWQURETCAgICAgICBxUmVzOCwgZFNyYzAsIGRTcmNmICAgICAgICAgOy8vIEFjYz1hK2YKLQotICAgICAgICBWU1VCICAgICAgICBkUmVzNywgZFJlczcsIGRUbXAwCi0KLSAgICAgICAgVk1MQSAgICAgICAgZFJlczgsIGRTcmNDLCBkQ29lZmYyMCAgICAgIDsvLyBBY2MgKz0gMjAqKGMrZCkKLTsgICAgICAgIFZNTFMgICAgICAgIGRSZXM4LCBkU3JjQiwgZENvZWZmNSAgICAgICA7Ly8gQWNjIC09IDUqKGIrZSkKLSAgICAgICAgVk1VTCAgICAgICAgZFRtcDAsIGRTcmNCLCBkQ29lZmY1ICAgICAgIDsvLyBBY2MgLT0gNSooYitlKQotCi0gICAgICAgIFZNT1YgICAgICAgIHFDb2VmZjIwLCAjMjAKLSAgICAgICAgVk1PViAgICAgICAgcUNvZWZmNSwgIzUKLQotICAgICAgICA7Ly8gQ29sMAotICAgICAgICBWQURETCAgICAgICBxQWNjMDEsIGRSZXMwLCBkUmVzNSAgICAgICAgOy8vIEFjYyA9IGErZgotICAgICAgICBWQURETCAgICAgICBxU3VtQ0QsIGRSZXMyLCBkUmVzMyAgICAgICAgOy8vIGMrZAotICAgICAgICBWQURETCAgICAgICBxU3VtQkUsIGRSZXMxLCBkUmVzNCAgICAgICAgOy8vIGIrZQotCi0gICAgICAgIFZTVUIgICAgICAgIGRSZXM4LCBkUmVzOCwgZFRtcDAKLQotICAgICAgICBWTUxBICAgICAgICBxQWNjMDEsIHFTdW1DRCwgcUNvZWZmMjAgICAgOy8vIEFjYyArPSAyMCooYytkKQotOyAgICAgICAgVk1MUyAgICAgICAgcUFjYzAxLCBxU3VtQkUsIHFDb2VmZjUgICAgIDsvLyBBY2MgLT0gMjAqKGIrZSkgICAgICAgIAotICAgICAgICBWTVVMICAgICAgICBxVG1wMCwgcVN1bUJFLCBxQ29lZmY1ICAgICA7Ly8gQWNjIC09IDIwKihiK2UpICAgICAgICAKLQotICAgICAgICA7Ly8gQ29sMQotICAgICAgICBWQURETCAgICAgICBxQWNjMjMsIGRSZXMxLCBkUmVzNiAgICAgICAgOy8vIEFjYyA9IGErZgotICAgICAgICBWQURETCAgICAgICBxU3VtQ0QsIGRSZXMzLCBkUmVzNCAgICAgICAgOy8vIGMrZAotICAgICAgICBWQURETCAgICAgICBxU3VtQkUsIGRSZXMyLCBkUmVzNSAgICAgICAgOy8vIGIrZQotICAgICAgICBWTUxBICAgICAgICBxQWNjMjMsIHFTdW1DRCwgcUNvZWZmMjAgICAgOy8vIEFjYyArPSAyMCooYytkKQotCi0gICAgICAgIFZTVUIgICAgICAgIHFBY2MwMSwgcUFjYzAxLCBxVG1wMAotCi07ICAgICAgICBWTUxTICAgICAgICBxQWNjMjMsIHFTdW1CRSwgcUNvZWZmNSAgICAgOy8vIEFjYyAtPSAyMCooYitlKSAgICAgICAgCi0gICAgICAgIFZNVUwgICAgICAgIHFUbXAwLCBxU3VtQkUsIHFDb2VmZjUgICAgIDsvLyBBY2MgLT0gMjAqKGIrZSkgICAgICAgIAotCi0gICAgICAgIDsvLyBDb2wyCi0gICAgICAgIFZBRERMICAgICAgIHFBY2M0NSwgZFJlczIsIGRSZXM3ICAgICAgICA7Ly8gQWNjID0gYStmCi0gICAgICAgIFZBRERMICAgICAgIHFTdW1DRCwgZFJlczQsIGRSZXM1ICAgICAgICA7Ly8gYytkCi0gICAgICAgIFZBRERMICAgICAgIHFTdW1CRSwgZFJlczMsIGRSZXM2ICAgICAgICA7Ly8gYitlCi0gICAgICAgIFZNTEEgICAgICAgIHFBY2M0NSwgcVN1bUNELCBxQ29lZmYyMCAgICA7Ly8gQWNjICs9IDIwKihjK2QpCi0KLSAgICAgICAgVlNVQiAgICAgICAgcUFjYzIzLCBxQWNjMjMsIHFUbXAwCi0KLTsgICAgICAgIFZNTFMgICAgICAgIHFBY2M0NSwgcVN1bUJFLCBxQ29lZmY1ICAgICA7Ly8gQWNjIC09IDIwKihiK2UpICAgICAgICAKLSAgICAgICAgVk1VTCAgICAgICAgcVRtcDAsIHFTdW1CRSwgcUNvZWZmNSAgICAgOy8vIEFjYyAtPSAyMCooYitlKSAgICAgICAgCi0gICAgICAgIAotICAgICAgICA7Ly8gQ29sMwotICAgICAgICBWQURETCAgICAgICBxQWNjNjcsIGRSZXMzLCBkUmVzOCAgICAgICAgOy8vIEFjYyA9IGErZgotICAgICAgICBWQURETCAgICAgICBxU3VtQ0QsIGRSZXM1LCBkUmVzNiAgICAgICAgOy8vIGMrZAotICAgICAgICBWQURETCAgICAgICBxU3VtQkUsIGRSZXM0LCBkUmVzNyAgICAgICAgOy8vIGIrZQotICAgICAgICBWTUxBICAgICAgICBxQWNjNjcsIHFTdW1DRCwgcUNvZWZmMjAgICAgOy8vIEFjYyArPSAyMCooYytkKQotCi0gICAgICAgIFZTVUIgICAgICAgIHFBY2M0NSwgcUFjYzQ1LCBxVG1wMAotCi0gICAgICAgIFZNTFMgICAgICAgIHFBY2M2NywgcVN1bUJFLCBxQ29lZmY1ICAgICA7Ly8gQWNjIC09IDIwKihiK2UpICAgICAgICAKLQotICAgICAgICBWUVJTSFJVTiAgICBkVGVtcEFjYzAsIHFBY2MwMSwgIzEwCi0gICAgICAgIFZRUlNIUlVOICAgIGRUZW1wQWNjMSwgcUFjYzIzLCAjMTAKLSAgICAgICAgVlFSU0hSVU4gICAgZFRlbXBBY2MyLCBxQWNjNDUsICMxMAotICAgICAgICBWUVJTSFJVTiAgICBkVGVtcEFjYzMsIHFBY2M2NywgIzEwCi0gICAgICAgIAotICAgICAgICBWUU1PVk4gICAgICBkQWNjMCwgcVRBY2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gIEROIDIuUzE2Ci0KLWRUZW1wUjAgICAgICAgICBETiAyMi5TMTYKLWRUZW1wUjEgICAgICAgICBETiAyMy5TMTYKLWRUZW1wUjIgICAgICAgICBETiA0LlMxNgotCi1kVGVtcFMwICAgICAgICAgRE4gMjQuUzE2Ci1kVGVtcFMxICAgICAgICAgRE4gMjUuUzE2Ci1kVGVtcFMyICAgICAgICAgRE4gNi5TMTYKLSAKLWRUZW1wQjAgICAgICAgICBETiAyNi5TMTYKLWRUZW1wQzAgICAgICAgICBETiAyNy5TMTYKLWRUZW1wRDAgICAgICAgICBETiAyOC5TMTYKLWRUZW1wRjAgICAgICAgICBETiAyOS5TMTYKLQotZFRlbXBBY2MwICAgICAgIEROIDAuVTE2Ci1kVGVtcEFjYzEgICAgICAgRE4gMi5VMTYKLWRUZW1wQWNjMiAgICAgICBETiA0LlUxNgotZFRlbXBBY2MzICAgICAgIEROIDYuVTE2Ci0KLWRBY2MwICAgICAgICAgICBETiAwLlU4Ci1kQWNjMSAgICAgICAgICAgRE4gMi5VOAotZEFjYzIgICAgICAgICAgIEROIDQuVTgKLWRBY2MzICAgICAgICAgICBETiA2LlU4Ci0KLXFBY2MwICAgICAgICAgICBRTiAwLlMzMgotcUFjYzEgICAgICAgICAgIFFOIDEuUzMyCi1xQWNjMiAgICAgICAgICAgUU4gMi5TMzIKLXFBY2MzICAgICAgICAgICBRTiAzLlMzMgotCi1xVEFjYzAgICAgICAgICAgUU4gMC5VMTYKLXFUQWNjMSAgICAgICAgICBRTiAxLlUxNgotcVRBY2MyICAgICAgICAgIFFOIDIuVTE2Ci1xVEFjYzMgICAgICAgICAgUU4gMy5VMTYgICAgICAgICAgICAgICAgCi0KLXFUbXAgICAgICAgICAgICBRTiA0LlMxNgotZFRtcCAgICAgICAgICAgIEROIDguUzE2Ci0KLSAgICAgICAgVkxEMSAgICAgICAgcVNyY0EwMSwgW3BTcmNdLCBzcmNTdGVwICAgICAgICAgICAgICAgICA7Ly8gW2EwIGExIGEyIGEzIC4uIGExNV0gICAKLSAgICAgICAgQUREICAgICAgICAgcjEyLCBwU3JjLCBzcmNTdGVwLCBMU0wgIzIKLSAgICAgICAgVk1PViAgICAgICAgZFRDb2VmZjUsICM1Ci0gICAgICAgIFZNT1YgICAgICAgIGRUQ29lZmYyMCwgIzIwCi0gICAgICAgIFZMRDEgICAgICAgIHFTcmNGMTAxMSwgW3IxMl0sIHNyY1N0ZXAKLSAgICAgICAgVkxEMSAgICAgICAgcVNyY0IyMywgW3BTcmNdLCBzcmNTdGVwICAgICAgICAgICAgICAgICA7Ly8gW2IwIGIxIGIyIGIzIC4uIGIxNV0KLSAgICAgICAgCi0gICAgICAgIFZMRDEgICAgICAgIHFTcmNHMTIxMywgW3IxMl0sIHNyY1N0ZXAKLSAgICAgICAgVkFEREwgICAgICAgcVRlbXBQMDEsIGRTcmNBMCwgZFNyY0YxMCAgICAgICAgICAgCi0gICAgICAgIFZMRDEgICAgICAgIHFTcmNDNDUsIFtwU3JjXSwgc3JjU3RlcCAgICAgICAgICAgICAgICAgOy8vIFtjMCBjMSBjMiBjMyAuLiBjMTVdCi0gICAgICAgIFZBRERMICAgICAgIHFUZW1wUDIzLCBkU3JjQTEsIGRTcmNGMTEgICAKLSAgICAgICAgVkxEMSAgICAgICAgcVNyY0Q2NywgW3BTcmNdLCBzcmNTdGVwCi0gICAgICAgIFZBRERMICAgICAgIHFUZW1wUTAxLCBkU3JjQjIsIGRTcmNHMTIgICAgICAgICAgICAgICAgICAgCi0gICAgICAgIFZMRDEgICAgICAgIHFTcmNFODksIFtwU3JjXSwgc3JjU3RlcAotICAgICAgICAKLSAgICAgICAgOy8vdDAKLSAgICAgICAgVk1MQUwgICAgICAgcVRlbXBQMDEsIGRTcmNDNCwgZFRDb2VmZjIwCi0gICAgICAgIAotICAgICAgICBWTEQxICAgICAgICBxU3JjSDE0MTUsIFtyMTJdLCBzcmNTdGVwCi0KLSAgICAgICAgVk1MQUwgICAgICAgcVRlbXBQMjMsIGRTcmNDN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AgICAgIHFUZW1wUjIzLCBkU3JjRjExLCBkVENvZWZmMjAKLQotCi0gICAgICAgIDsvL3QzCi0gICAgICAgIFZNTEFMICAgICAgIHFUZW1wUzIzLCBkU3JjRzEzLCBkVENvZWZmMjAKLSAgICAgICAgVk1MU0wgICAgICAgcVRlbXBTMDEsIGRTcmNFOCwgZFRDb2VmZjUKLSAgICAgICAgVkVYVCAgICAgICAgZFRlbXBDMCwgZFRlbXBQMCwgZFRlbXBQMSwgIzIKLSAgICAgICAgVk1PViAgICAgICAgZENvZWZmMjAsICMyMAotICAgICAgICBWTUxTTCAgICAgICBxVGVtcFMyMywgZFNyY0U5LCBkVENvZWZmNQotICAgICAgICBWTUxTTCAgICAgICBxVGVtcFMwMSwgZFNyY0gxNCwgZFRDb2VmZjUKLSAgICAgICAgVkVYVCAgICAgICAgZFRlbXBGMCwgZFRlbXBQMSwgZFRlbXBQMiwgIzEKLSAgICAgICAgVkVYVCAgICAgICAgZFRlbXBEMCwgZFRlbXBQMCwgZFRlbXBQMSwgIzMKLSAgICAgICAgVk1MU0wgICAgICAgcVRlbXBTMjMsIGRTcmNIMTUsIGRUQ29lZmY1Ci0gICAgICAgIAotICAgICAgICBWQURETCAgICAgICBxQWNjMCwgZFRlbXBQMCwgZFRlbXBGMAotICAgICAgICBWQUREICAgICAgICBkVGVtcEMwLCBkVGVtcEMwLCBkVGVtcEQwCi0gICAgICAgIDsvL2ggCi0gICAgICAgIFZNT1YgICAgICAgIGRDb2VmZjUsICM1Ci0gICAgICAgIAotICAgICAgICA7Ly8gcmVzMAotICAgICAgICBWQUREICAgICAgICBkVGVtcEIwLCBkVGVtcEIwLCBkVGVtcFAxCi0gICAgICAgIFZNTEFMICAgICAgIHFBY2MwLCBkVGVtcEMwLCBkQ29lZmYyMAotICAgICAgICBWRVhUICAgICAgICBkVGVtcEMwLCBkVGVtcFEwLCBkVGVtcFExLCAjMgotICAgICAgICBWRVhUICAgICAgICBkVGVtcEQwLCBkVGVtcFEwLCBkV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aHRzIFJlc2VydmVkLgotOy8vIAotOy8vIAotOy8vCi0KLSAgICAgICAgSU5DTFVERSBvbXh0eXBlc19zLmgKLSAgICAgICAgSU5DTFVERSBhcm1DT01NX3MuaAotCi0gICAgICAgIE1fVkFSSUFOVFMgQ29ydGV4QTgKLSAgICAgICAgCi0gICAgICAgIEVYUE9SVCBhcm1WQ000UDEwX0ludGVycG9sYXRlTHVtYV9IYWxmSG9yNHg0X3Vuc2FmZQotCi1ERUJVR19PTiAgICBTRVRMIHtGQUxTRX0KLQotICAgIElGIENvcnRleEE4Ci0gICAgICAgIAotICAgICAgICBNX1NUQVJUIGFybVZDTTRQMTBfSW50ZXJwb2xhdGVMdW1hX0hhbGZIb3I0eDRfdW5zYWZlLCByMTEKLQotOy8vIERlY2xhcmUgaW5wdXQgcmVnaXN0ZXJzCi1wU3JjICAgICAgICAgICAgUk4gMAotc3JjU3RlcCAgICAgICAgIFJOIDEKLXBEc3QgICAgICAgICAgICBSTiAyCi1kc3RTdGVwICAgICAgICAgUk4gMwotCi07Ly8gRGVjbGFyZSBOZW9uIHJlZ2lzdGVycwotZENvZWZmNSAgICAgICAgIEROIDMwLlMxNgotZENvZWZmMjAgICAgICAgIEROIDMxLlMxNgotCi1xU3JjQTAxICAgICAgICAgUU4gMTEuVTgKLXFTcmNCMDEgICAgICAgICBRTiAxMi5VOAotcVNyY0MwMSAgICAgICAgIFFOIDEzLlU4Ci1xU3JjRDAxICAgICAgICAgUU4gMTQuVTgKLQotZFNyY0EwICAgICAgICAgIEROIDIyLlU4Ci1kU3JjQTEgICAgICAgICAgRE4gMjMuVTgKLWRTcmNCMCAgICAgICAgICBETiAyNC5VOAotZFNyY0IxICAgICAgICAgIEROIDI1LlU4Ci1kU3JjQzAgICAgICAgICAgRE4gMjYuVTgKLWRTcmNDMSAgICAgICAgICBETiAyNy5VOAotZFNyY0QwICAgICAgICAgIEROIDI4LlU4Ci1kU3JjRDEgICAgICAgICAgRE4gMjkuVTgKLQotZFNyY2IgICAgICAgICAgIEROIDEyLlU4Ci1kU3JjZSAgICAgICAgICAgRE4gMTMuVTgKLWRTcmNmICAgICAgICAgICBETiAxMC5VOAotCi1kU3JjMGMgICAgICAgICAgRE4gMTQuVTgKLWRTcmMxYyAgICAgICAgICBETiAxNi5VOAotZFNyYzJjICAgICAgICAgIEROIDE4LlU4Ci1kU3JjM2MgICAgICAgICAgRE4gMjAuVTgKLSAgICAgICAgICAgICAgICAgICAKLWRTcmMwZCAgICAgICAgICBETiAxNS5VOAotZFNyYzFkICAgICAgICAgIEROIDE3LlU4Ci1kU3JjMmQgICAgICAgICAgRE4gMTkuVTgKLWRTcmMzZCAgICAgICAgICBETiAyMS5VOAotCi1xVGVtcDAxICAgICAgICAgUU4gNC5TMTYKLXFUZW1wMjMgICAgICAgICBRTiA2LlMxNgotZFRlbXAwICAgICAgICAgIEROIDguUzE2Ci1kVGVtcDIgICAgICAgICAgRE4gMTIuUzE2Ci0KLXFSZXMwMSAgICAgICAgICBRTiAxMS5TMTYKLXFSZXMyMyAgICAgICAgICBRTiAxMi5TMTYKLXFSZXM0NSAgICAgICAgICBRTiAxMy5TMTYKLXFSZXM2NyAgICAgICAgICBRTiAxNC5TMTYKLQotZFJlczAgICAgICAgICAgIEROIDIyLlMxNgotZFJlczIgICAgICAgICAgIEROIDI0LlMxNgotZFJlczQgICAgICAgICAgIEROIDI2LlMxNgotZFJlczYgICAgICAgICAgIEROIDI4LlMxNgotCi1kQWNjMCAgICAgICAgICAgRE4gMjIuVTgKLWRBY2MyICAgICAgICAgICBETiAyNC5VOAotZEFjYzQgICAgICAgICAgIEROIDI2LlU4Ci1kQWNjNiAgICAgICAgICAgRE4gMjguVTgKLQotZFJlc3VsdDAgICAgICAgIEROIDIyLlUzMgotZFJlc3VsdDIgICAgICAgIEROIDI0LlUzMgotZFJlc3VsdDQgICAgICAgIEROIDI2LlUzMgotZFJlc3VsdDYgICAgICAgIEROIDI4LlUzMgotCi0gICAgICAgIFZMRDEgICAgICAgIHF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IGlucHV0IHJlZ2lzdGVycwotcFNyYyAgICAgICAgICAgIFJOIDAKLXNyY1N0ZXAgICAgICAgICBSTiAxCi1wRHN0ICAgICAgICAgICAgUk4gMgotZHN0U3RlcCAgICAgICAgIFJOIDMKLQotVGVtcCAgICAgICAgICAgIFJOIDEyCi0KLTsvLyBEZWNsYXJlIE5lb24gcmVnaXN0ZXJzCi1kQ29lZmY1ICAgICAgICAgRE4gMzAuUzE2Ci1kQ29lZmYyMCAgICAgICAgRE4gMzEuUzE2Ci0KLWRTcmMwICAgICAgICAgICBETiA3LlU4Ci1kU3JjMSAgICAgICAgICAgRE4gOC5VOAotZFNyYzIgICAgICAgICAgIEROIDkuVTgKLWRTcmMzICAgICAgICAgICBETiAxMC5VOAotZFNyYzQgICAgICAgICAgIEROIDExLlU4Ci1kU3JjNSAgICAgICAgICAgRE4gMTIuVTgKLWRTcmM2ICAgICAgICAgICBETiAxMy5VOAotZFNyYzcgICAgICAgICAgIEROIDE0LlU4Ci1kU3JjOCAgICAgICAgICAgRE4gMTUuVTgKLQotcVN1bUJFMDEgICAgICAgIFFOIDguUzE2Ci1xU3VtQ0QwMSAgICAgICAgUU4gOS5TMTYKLWRTdW1CRTAgICAgICAgICBETiAxNi5TMTYKLWRTdW1DRDAgICAgICAgICBETiAxOC5TMTYKLQotcUFjYzAxICAgICAgICAgIFFOIDAuUzE2Ci1xQWNjMjMgICAgICAgICAgUU4gMS5TMTYKLXFBY2M0NSAgICAgICAgICBRTiAyLlMxNgotcUFjYzY3ICAgICAgICAgIFFOIDMuUzE2Ci0KLWRSZXMwICAgICAgICAgICBETiAwLlMxNgotZFJlczEgICAgICAgICAgIEROIDIuUzE2Ci1kUmVzMiAgICAgICAgICAgRE4gNC5TMTYKLWRSZXMzICAgICAgICAgICBETiA2LlMxNgotCi1kQWNjMCAgICAgICAgICAgRE4gMC5VOAotZEFjYzEgICAgICAgICAgIEROIDIuVTgKLWRBY2MyICAgICAgICAgICBETiA0LlU4Ci1kQWNjM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TdGVwCi0gICAgICAgIFZBRERMICAgICAgIHFTdW1CRTAxLCBkU3JjMywgZFNyYzYgICAgIDsvLyBiK2UKLSAgICAgICAgVkFEREwgICAgICAgcVN1bUNEMDEsIGRTcmM0LCBkU3JjNSAgICAgOy8vIGMrZAotICAgICAgICBWQURETCAgICAgICBxQWNjNDUsIGRTcmMyLCBkU3JjNyAgICAgICA7Ly8gQWNjID0gYStmCi0gICAgICAgIFZNTFMgICAgICAgIGRSZXMyLCBkU3VtQkUwLCBkQ29lZmY1ICAgIDsvLyBBY2MgLT0gMjAqKGIrZSkgICAgICAgIAotOyAgICAgICAgVk1MQSAgICAgICAgZFJlczIsIGRTdW1DRDAsIGRDb2VmZjIwICAgOy8vIEFjYyArPSAyMCooYytkKQotICAgICAgICBWTVVMICAgICAgICBkVG1wMiwgZFN1bUNEMCwgZENvZWZmMjAgICA7Ly8gQWNjICs9IDIwKihjK2QpCi0KLTsgICAgICAgIFZMRDEgICAgICAgIGRTcmM4LCBbVGVtcF0sIHNyY1N0ZXAgICAgIDsvLyBbaTAgaTEgaTIgaTMgLi4gXSAgICAgICAgCi0gICAgICAgIFZBRERMICAgICAgIHFTdW1CRTAxLCBkU3JjNCwgZFNyYzcgICAgIDsvLyBiK2UKLSAgICAgICAgVkFEREwgICAgICAgcUFjYzY3LCBkU3JjMywgZFNyYzggICAgICAgOy8vIEFjYyA9IGErZgotICAgICAgICBWQURETCAgICAgICBxU3VtQ0QwMSwgZFNyYzUsIGRTcmM2ICAgICA7Ly8gYytkCi0gICAgICAgIFZNTFMgICAgICAgIGRSZXMzLCBkU3VtQkUwLCBkQ29lZmY1ICAgIDsvLyBBY2MgLT0gMjAqKGIrZSkgICAgICAgIAotICAgICAgICBWQUREICAgICAgICBkUmVzMCwgZFJlczAsIGRUbXAwCi0gICAgICAgIFZBREQgICAgICAgIGRSZXMxLCBkUmVzMSwgZFRtcDEKLSAgICAgICAgVkFERCAgICAgICAgZFJlczIsIGRSZXMyLCBkVG1wMgotICA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i1wRHN0ICAgICAgICAgICAgICAgICBSTiAyCi1pRHN0U3RlcCAgICAgICAgICAgICBSTiAzCi1pV2lkdGggICAgICAgICAgICAgICBSTiA0Ci1pSGVpZ2h0ICAgICAgICAgICAgICBSTiA1Ci1keCAgICAgICAgICAgICAgICAgICBSTiA2Ci1keSAgICAgICAgICAgICAgICAgICBSTiA3Ci0KLTsvLyBsb2NhbCB2YXJpYWJsZSByZWdpc3RlcnMKLXBjICAgICAgICAgICAgICAgICAgIFJOIDE1Ci1yZXR1cm4gICAgICAgICAgICAgICBSTiAwCi1FaWdodE1pbnVzZHggICAgICAgICBSTiA4IAotRWlnaHRNaW51c2R5ICAgICAgICAgUk4gOQotCi1BQ29lZmYgICAgICAgICAgICAgICBSTiAxMgotQkNvZWZmICAgICAgICAgICAgICAgUk4gOQotQ0NvZWZmICAgICAgICAgICAgICAgUk4gOAotRENvZWZmICAgICAgICAgICAgICAgUk4gNgotCi1wVGFibGUgICAgICAgICAgICAgICBSTiAxMQotCi1TdGVwMSAgICAgICAgICAgICAgICBSTiAxMAotU3JjU3RlcE1pbnVzMSAgICAgICAgUk4gMTQKLQotZEFDb2VmZiAgICAgICAgICAgICAgRE4gRDEyLlU4Ci1kQkNvZWZmICAgICAgICAgICAgICBETiBEMTMuVTgKLWRDQ29lZmYgICAgICAgICAgICAgIEROIEQxNC5VOAotZERDb2VmZiAgICAgICAgICAgICAgRE4gRDE1LlU4Ci0KLWRSb3cwYSAgICAgICAgICAgICAgIEROIEQwLlU4Ci1kUm93MGIgICAgICAgICAgICAgICBETiBEMS5VOAotZFJvdzFhICAgICAgICAgICAgICAgRE4gRDIuVTgKLWRSb3cxYiAgICAgICAgICAgICAgIEROIEQzLlU4Ci0KLXFSb3cwYSAgICAgICAgICAgICAgIFFOIFEyLlMxNgotcVJvdzBiICAgICAgICAgICAgICAgUU4gUTMuUzE2Ci0KLTsvL2RJbmRleCAgICAgICAgICAgICAgIEROICAgIEQxNi5VOCAgICAgICAgICAgICAgICAgCi1xUm93MWEgICAgICAgICAgICAgICBRTiBRMTEuUzE2Ci1xUm93MWIgICAgICAgICAgICAgICBRTiBRMTIuUzE2Ci0KLWRSb3cyYSAgICAgICAgICAgICAgIEROIEQxNi5VOAotZFJvdzJiICAgICAgICAgICAgICAgRE4gRDE3LlU4Ci1kUm93M2EgICAgICAgICAgICAgICBETiBEMTguVTgKLWRSb3czYiAgICAgICAgICAgICAgIEROIEQxOS5VOAotCi1xT3V0Um93MiAgICAgICAgICAgICBRTiBRMTEuVTE2Ci1xT3V0Um93MyAgICAgICAgICAgICBRTiBRMTIuVTE2Ci1kT3V0Um93MiAgICAgICAgICAgICBETiBEMjAuVTgKLWRPdXRSb3czICAgICAgICAgICAgIEROIEQyMS5VOAotZE91dFJvdzJVNjQgICAgICAgICAgRE4gRDIwLlU2NAotZE91dFJvdzNVNjQgICAgICAgICAgRE4gRDIxLlU2NAotCi1xT3V0Um93MCAgICAgICAgICAgICBRTiBRMi5VMTYKLXFPdXRSb3cxICAgICAgICAgICAgIFFOIFEzLlUxNgotZE91dFJvdzAgICAgICAgICAgICAgRE4gRDguVTgKLWRPdXRSb3cxICAgICAgICAgICAgIEROIEQ5LlU4Ci0KLWRPdXRSb3cwVTY0ICAgICAgICAgIEROIEQ4LlU2NAotZE91dFJvdzFVNjQgICAgICAgICAgRE4gRDkuVTY0Ci0KLWRPdXRSb3cwVTMyICAgICAgICAgIEROIEQ4LlUzMgotZE91dFJvdzFVMzIgICAgICAgICAgRE4gRDkuVTMyCi0KLWRPdXRSb3cwVTE2ICAgICAgICAgIEROIEQ4LlUxNgotZE91dFJvdzFVMTYgICAgICAgICAgRE4gRDkuVTE2Ci0KLQotZE91dDBVNjQgICAgICAgICAgICAgRE4gRDAuVTY0Ci1kT3V0MVU2NCAgICAgICAgICAgICBETiBEMS5VNjQKLQotZE91dDAwVTMyICAgICAgICAgICAgRE4gRDAuVTMyCi1kT3V0MDFVMzIgICAgICAgICAgICBETiBEMS5VMzIKLWRPdXQxM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kIgIERDb2VmZiwgZHgsIGR5Ci0gICAgICAgIAotICAgICAgICBWRFVQICAgIGRBQ29lZmYsIEFDb2VmZgotICAgICAgICBWRFVQICAgIGRCQ29lZmYsIEJDb2VmZgotICAgICAgICBWRFVQICAgIGRDQ29lZmYsIENDb2VmZgotICAgICAgICBWRFVQICAgIGREQ29lZmYsIERDb2VmZgotICAgICAgICAKLSAgICAgICAgTERSICAgICBwYywgW3BUYWJsZSwgaVdpZHRoLCBMU0wgIzFdICAgICAgOy8vIEJyYW5jaCB0byB0aGUgY2FzZSBiYXNlZCBvbiBpV2lkdGgKLSAgICAgICAgCi07Ly8gUGl4ZWwgbGF5b3V0OgotOy8vCi07Ly8gICB4MDAgeDAxIHgwMgotOy8vICAgeDEwIHgxMSB4MTIKLTsvLyAgIHgyMCB4MjEgeDIyCi0KLTsvLyBJZiBmcmFjdGlvbmwgbXYgaXMgbm90ICgwLCAwKQotV2lkdGhJczhNVklzTm90WmVybwotCi0gICAgICAgICAgICAgICAgVkxEMSAgIGRSb3cxYSwgW3BTcmNdLCBTdGVwMSAgICAgICAgICAgIDsvLyAxYQotICAgICAgICAgICAgICAgIFZNVUxMICBxUm93MGEsIGRSb3cwYSwgZEFDb2VmZgotICAgICAgICAgICAgICAgIFZMRDEgICBkUm93MWIsIFtwU3JjXSwgU3JjU3RlcE1pbnVzMSAgICA7Ly8gMWIKLSAgICAgICAgICAgICAgICBWTVVMTCAgcVJvdzBiLCBkUm93MWEsIGRBQ29lZmYKLSAgICAgICAgICAgICAgICBWTEQxICAgZFJvdzJhLCBbcFNyY10sIFN0ZXAxICAgICAgICAgICAgOy8vIDJhCi0gICAgICAgICAgICAgICAgVk1MQUwgIHFSb3cwYSwgZFJvdzBiLCBkQkNvZWZmCi0gICAgICAgICAgICAgICAgVkxEMSAgIGRSb3cyYiwgW3BTcmNdLCBTcmNTdGVwTWludXMxICAgIDsvLyAyYgotICAgICAgICAgICAgICAgIFZNVUxMICBxUm93MWEsIGRSb3cyYSwgZEFDb2VmZgotICAgICAgICAgICAgICAgIFZNTEFMICBxUm93MGIsIGRSb3cxYiwgZEJDb2VmZgotICAgICAgICAgICAgICAgIFZMRDEgICBkUm93M2EsIFtwU3JjXSwgU3RlcDEgICAgICAgICAgICA7Ly8gM2EKLSAgICAgICAgICAgICAgICBWTUxBTCAgcVJvdzBhLCBkUm93MWEsIGRDQ29lZmYKLSAgICAgICAgICAgICAgICBWTUxBTCAgcVJvdzFhLCBkUm93MmIsIGRCQ29lZmYKLSAgICAgICAgICAgICAgICBWTVVMTCAgcVJvdzFiLCBkUm93M2EsIGRBQ29lZmYKLSAgICAgICAgICAgICAgICBWTEQxICAgZFJvdzNiLCBbcFNyY10sIFNyY1N0ZXBNaW51czEgICAgOy8vIDNiCi0gICAgICAgICAgICAgICAgVk1MQUwgIHFSb3cwYiwgZFJvdzJhLCBkQ0NvZWZmCi0gICAgICAgICAgICAgICAgVkxEMSAgIGRSb3cwYSwgW3BTcmNdLCBTdGVwMSAgICAgICAgICAgIDsvLyAwYQotICAgICAgICAgICAgICAgIFZNTEFMICBxUm93MWIsIGRSb3czYiwgZEJDb2VmZgotICAgICAgICAgICAgICAgIFZNTEFMICBxUm93MWEsIGRSb3czYSwgZENDb2VmZgotICAgICAgICAgICAgICAgIFZNTEFMICBxUm93MGEsIGRSb3cxYiwgZERDb2VmZgotICAgICAgICAgICAgICAgIFZMRDEgICBkUm93MGIsIFtwU3JjXSwgU3JjU3RlcE1pbnVzMSAgICA7Ly8gMGIKLSAgICAgICAgICAgICAgICBWTUxBTCAgcVJvdzFiLCBkUm93MGEsIGRDQ29lZmYKLSAgICAgICAgICAgICAgICBWTUxBTCAgcVJvdzBiLCBkUm93MmIsIGREQ29lZmYKLSAgICAgICAgICAgICAgICBWTUxBTCAgcVJvdzFhLCBkUm93M2IsIGREQ29lZmYKLSAgICAgICAgICAgICAgICAKLSAgICAgICAgICAgICAgICAKLSAgICAgICAgICAgICAgICBTVUJTICAgaUhlaWdodCwgaUhlaWdodCwgIzQKLSAgICAgICAgICAgICAgICBWTUxBTCAgcVJvdzFiLCBkUm93MGIsIGREQ29lZmYKLQotICAgICAgICAgICAgICAgIFZRUlNIUk4gZE91dFJvdzAsIHFPdXRSb3cwLCAjNgotICAgICAgICAgICAgICAgIFZRUlNIUk4gZE91dFJvdzEsIHFPdXRSb3cxLCAjNgotICAgICAgICAgICAgICAgIFZRUlNIUk4gZE91dFJvdzIsIHFPdXRSb3cyLCAjNgotICAgICAgICAgICAgICAgIFZTVDEgICBkT3V0Um93MFU2NCwgW3BEc3RdLCBpRHN0U3RlcAotICAgICAgICAgICAgICAgIFZRUlNIUk4gZE91dFJvdzMsIHFPdXRSb3czLCAjNgotICAgICAgICAgICAgICAgIAotICAgICAgICAgICAgICAgIFZTVDEgICBkT3V0Um93MVU2NCwgW3BEc3RdLCBpRHN0U3RlcCAgCi0gICAgICAgICAgICAgICAgVlNUMSAgIGRPdXRSb3cyVTY0LCBbcERzdF0sIGlEc3RTdGVwCi0gICAgICAgICAgICAgICAgVlNUMSAgIGRPdXRSb3czVTY0LCBbcERzdF0sIGlEc3RTdGVwICAKLSAgICAgICAgICAgICAgICAKLQotICAgICAgICAgICAgICAgIEJHVCAgICAgV2lkdGhJczhNVklzTm90WmVybwotICAgICAgICAgICAgICAgIE1PViAgICAgcmV0dXJuLCAgI09NWF9TdHNfTm9FcnIKLSAgICAgICAgICAgICAgICBNX0VYSVQKLQotV2lkdGhJczRNVklzTm90WmVybwotCi0gICAgICAgICAgICAgICAgVkxEMSAgIGRSb3cxYSwgW3BTcmNdLCBTdGVwMQotICAgICAgICAgICAgICAgIFZNVUxMICBxUm93MGEsIGRSb3cwYSwgZEFDb2VmZgotICAgICAgICAgICAgICAgIFZNVUxMICBxUm93MGIsIGRSb3cxYSwgZEFDb2VmZgotICAgICAgICAgICAgICAgIFZMRDEgICBkUm93MWIsIFtwU3JjXSwgU3JjU3RlcE1pbnVzMQotICAgICAgICAgICAgICAgIFZNTEFMICBxUm93MGEsIGRSb3cwYiwgZEJDb2VmZgotICAgICAgICAgICAgICAgIFZNTEFMICBxUm93MGIsIGRSb3cxYiwgZEJDb2VmZgotICAgICAgICAgICAgICAgIFZMRDEgICBkUm93MGEsIFtwU3JjXSwgU3RlcDEKLSAgICAgICAgICAgICAgICBWTUxBTCAgcVJvdzBhLCBkUm93MWEsIGRDQ29lZmYKLSAgICAgICAgICAgICAgICBWTUxBTCAgcVJvdzBiLCBkUm93MGEsIGRDQ29lZmYKLSAgICAgICAgICAgICAgICBWTEQxICAgZFJvdzBiLCBbcFNyY10sIFNyY1N0ZXBNaW51czEKLSAgICAgICAgICAgICAgICBTVUJTICAgaUhlaWdodCwgaUhlaWdodCwgIzIKLSAgICAgICAgICAgICAgICBWTUxBTCAgcVJvdzBiLCBkUm93MGIsIGREQ29lZmYKLSAgICAgICAgICAgICAgICBWTUxBTCAgcVJvdzBhLCBkUm93MWIsIGREQ29lZmYKLSAgICAgICAgICAgICAgICAKLSAgICAgICAgICAgICAgICBWUVJTSFJOIGRPdXRSb3cxLCBxT3V0Um93MSwgIzYKLSAgICAgICAgICAgICAgICBWUVJTSFJOIGRPdXRSb3cwLCBxT3V0Um93MCwgIzYKLSAgICAgICAgICAgICAgICAKLSAgICAgICAgICAgICAgICBWU1QxICAgZE91dFJvdzBVMzJbMF0sIFtwRHN0XSwgaURzdFN0ZXAKLSAgICAgICAgICAgICAgICBWU1QxICAgZE91dFJvdzFVMzJbMF0sIFtwRHN0XSwgaURzdFN0ZXAgIAotICAgICAgICAgICAgICAgIAotICAgICAgICAgICAgICAgIEJHVCAgICAgV2lkdGhJczRNVklzTm90WmVybwotICAgICAgICAgICAgICAgIE1PViAgICAgcmV0dXJuLCAgI09NWF9TdHNfTm9FcnIKLSAgICAgICAgICAgICAgICBNX0VYSVQKLQotV2lkdGhJczJNVklzTm90WmVybwotCi0gICAgICAgICAgICAgICAgVkxEMSAgIGRSb3cxYSwgW3BTcmNdLCBTdGVwMQotICAgICAgICAgICAgICAgIFZNVUxMICBxUm93MGEsIGRSb3cwYSwgZEFDb2VmZgotICAgICAgICAgICAgICAgIFZNVUxMICBxUm93MGIsIGRSb3cxYSwgZEFDb2VmZgotICAgICAgICAgICAgICAgIFZMRDEgICBkUm93MWIsIFtwU3JjXSwgU3JjU3RlcE1pbnVzMQotICAgICAgICAgICAgICAgIFZNTEFMICBxUm93MGEsIGRSb3cwYiwgZEJDb2VmZgotICAgICAgICAgICAgICAgIFZNTEFMICBxUm93MGIsIGRSb3cxYiwgZEJDb2VmZgotICAgICAgICAgICAgICAgIFZMRDEgICBkUm93MGEsIFtwU3JjXSwgU3RlcDEKLSAgICAgICAgICAgICAgICBWTUxBTCAgcVJvdzBhLCBkUm93MWEsIGRDQ29lZmYKLSAgICAgICAgICAgICAgICBWTUxBTCAgcVJvdzBiLCBkUm93MGEsIGRDQ29lZmYKLSAgICAgICAgICAgICAgICBWTEQxICAgZFJvdzBiLCBbcFNyY10sIFNyY1N0ZXBNaW51czEKLSAgICAgICAgICAgICAgICBTVUJTICAgaUhlaWdodCwgaUhlaWdodCwgIzIKLSAgICAgICAgICAgICAgICBWTUxBTCAgcVJvdzBiLCBkUm93MGIsIGREQ29lZmYKLSAgICAgICAgICAgICAgICBWTUxBTCAgcVJvdzBhLCBkUm93MWIsIGREQ29lZmYKLSAgICAgICAgICAgICAgICAKLSAgICAgICAgICAgICAgICBWUVJTSFJOIGRPdXRSb3cxLCBxT3V0Um93MSwgIzYKLSAgICAgICAgICAgICAgICBWUVJTSFJOIGRPdXRSb3cwLCBxT3V0Um93MCwgIzYKLSAgICAgICAgICAgICAgICAKLSAgICAgICAgICAgICAgICBWU1QxICAgZE91dFJvdzBVMTZbMF0sIFtwRHN0XSwgaURzdFN0ZXAKLSAgICAgICAgICAgICAgICBWU1QxICAgZE91dFJvdzFVMTZbMF0sIFtwRHN0XSwgaURzdFN0ZXAgIAotCi0gICAgICAgICAgICAgICAgQkdUICAgICBXaWR0aElzMk1WSXNOb3RaZXJvIAotICAgICAgICAgICAgICAgIE1PViAgICAgcmV0dXJuLCAgI09NWF9TdHNfTm9FcnIKLSAgICAgICAgICAgICAgICBNX0VYSVQgICAgICAgICAgICAgICAgCi0gICAgICAgICAgICAgICAgCi07Ly8gSWYgZnJhY3Rpb25sIG12IGlzICgwLCAwKQotV2lkdGhJczhNVklzWmVybwotICAgICAgICAgICAgICAgIFNVQiAgICAgcFNyYywgcFNyYywgaVNyY1N0ZXAKLQotV2lkdGhJczhMb29wTVZJc1plcm8KLSAgICAgICAgICAgICAgICBWTEQxICAgIGRSb3cwYSwgW3BTcmNdLCBpU3JjU3RlcAotICAgICAgICAgICAgICAgIFNVQlMgICAgaUhlaWdodCwgaUhlaWdodCwgIzIKLSAgICAgICAgICAgICAgICBWTEQxICAgIGRSb3cwYiwgW3BTcmNdLCBpU3JjU3RlcAotICAgICAgICAgICAgICAgIFZTVDEgICAgZE91dDBVNjQsIFtwRHN0XSwgaURzdFN0ZXAKLSAgICAgICAgICAgICAgICBWU1QxICAgIGRPdXQxVTY0LCBbcERzdF0sIGlEc3RTdGVwCi0gICAgICAgICAgICAgICAgQkdUICAgICBXaWR0aElzOExvb3BNVklzWmVybwotCi0gICAgICAgICAgICAgICAgTU9WICAgICByZXR1cm4sICAjT01YX1N0c19Ob0VycgotICAgICAgICAgICAgICAgIE1fRVhJVAotCi1XaWR0aElzNE1WSXNaZXJvICAgICAgICAgICAgICAgIAotICAgICAgICAgICAgICAgIFZMRDEgICAgZFJvdzBiLCBbcFNyY10sIGlTcmNTdGVwCi0gICAgICAgICAgICAgICAgCi0gICAgICAgICAgICAgICAgU1VCUyAgICBpSGVpZ2h0LCBpSGVpZ2h0LCAjMgotICAgICAgICAgICAgICAgIAotICAgICAgICAgICAgICAgIFZTVDEgICAgZE91dDAwVTMyWzBdLCBbcERzdF0sIGlEc3RTdGVwCi0gICAgICAgICAgICAgICAgVkxEMSAgICBkUm93MGEsIFtwU3JjXSwgaVNyY1N0ZXAKLSAgICAgICAgICAgICAgICBWU1QxICAgIGRPdXQwMVUzMlswXSwgW3BEc3RdLCBpRHN0U3RlcAotICAgICAgICAgICAgICAgIAotICAgICAgICAgICAgICAgIEJHVCAgICAgV2lkdGhJczRNVklzWmVybyAKLSAgICAgICAgICAgICAgICBNT1YgICAgIHJldHVybiwgICNPTVhfU3RzX05vRXJyCi0gICAgICAgICAgICAgICAgTV9FWElUCi0gICAgICAgICAgICAgICAgCi1XaWR0aElzMk1WSXNaZXJvICAgICAgICAgICAgICAgIAotICAgICAgICAgICAgICAgIFZMRDEgICAgZFJvdzBiLCBbcFNyY10sIGlTcmNTdGVwCi0gICAgICAgICAgICAgICAgU1VCUyAgICBpSGVpZ2h0LCBpSGVpZ2h0LCAjMgotICAgICAgICAgICAgICAgIAotICAgICAgICAgICAgICAgIFZTVDEgICAgZE91dDBVMTZbMF0sIFtwRHN0XSwgaURzdFN0ZXAKLSAgICAgICAgICAgICAgICBWTEQxICAgIGRSb3cwYSwgW3BTcmNdLCBpU3JjU3RlcAotICAgICAgICAgICAgICAgIFZTVDEgICAgZE91dDFVMTZbMF0sIFtwRHN0XSwgaURzdFN0ZXAKLSAgICAgICAgICAgICAgICAKLSAgICAgICAgICAgICAgICBCR1QgICAgIFdpZHRoSXMyTVZJc1plcm8gCi0gICAgICAgICAgICAgICAgTU9WICAgICByZXR1cm4sICAjT01YX1N0c19Ob0VyciAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCi0gICAgICAgICAgICAgICAgTV9FTkQKLSAgICAgICAgICAgICAgICAgICAgCi0gICAgICAgIEVORElGIDsvLyBDb3J0ZXhBOAotICAgICAgICAKLSAgICAgICAgRU5ECi0KLTsvLy0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tCi07Ly8gYXJtVkNNNFAxMF9JbnRlcnBvbGF0ZV9DaHJvbW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i07Ly8gCi07Ly8gCi07Ly8KLTsvLyBEZXNjcmlwdGlvbjoKLTsvLyBUcmFuc2Zvcm0gUmVzaWR1YWwgNHg0IENvZWZmaWNpZW50cwotOy8vIAotOy8vIAotCi0gICAgICAgIAotOy8vIEluY2x1ZGUgc3RhbmRhcmQgaGVhZGVycwotCi0gICAgICAgIElOQ0xVREUgb214dHlwZXNfcy5oCi0gICAgICAgIElOQ0xVREUgYXJtQ09NTV9zLmgKLSAgICAgICAgCi0gICAgICAgIE1fVkFSSUFOVFMgQ29ydGV4QTgKLSAgICAgICAgCi07Ly8gSW1wb3J0IHN5bWJvbHMgcmVxdWlyZWQgZnJvbSBvdGhlciBmaWxlcwotOy8vIChGb3IgZXhhbXBsZSB0YWJsZXMpCi0gICAgCi0gICAgICAgIAotICAgICAgICAKLSAgICAgICAgCi07Ly8gU2V0IGRlYnVnZ2luZyBsZXZlbCAgICAgICAgCi07Ly9ERUJVR19PTiAgICBTRVRMIHtUUlVFfQotCi0KLQotOy8vIEd1YXJkaW5nIGltcGxlbWVudGF0aW9uIGJ5IHRoZSBwcm9jZXNzb3IgbmFtZQotICAgIAotICAgIAotICAgIAotCi0KLQotCi0KLTsvLyBHdWFyZGluZyBpbXBsZW1lbnRhdGlvbiBieSB0aGUgcHJvY2Vzc29yIG5hbWUKLSAgICAKLSAgICBJRiAgQ29ydGV4QTgKLQotOy8vIEFSTSBSZWdpc3RlcnMKLSAgICAKLTsvL0lucHV0IFJlZ2lzdGVycwotcERzdCAgICAgICAgICAgICAgICBSTiAgMAotcFNyYyAgICAgICAgICAgICAgICBSTiAgMQotCi0KLTsvLyBOZW9uIFJlZ2lzdGVycwotICAgICAgCi07Ly8gUGFja2VkIElucHV0IHBpeGVscwotZEluMCAgICAgICAgICAgICAgICBETiAgRDAuUzE2ICAgICAgIAotZEluMSAgICAgICAgICAgICAgICBETiAgRDEuUzE2ICAgICAgIAotZEluMiAgICAgICAgICAgICAgICBETiAgRDIuUzE2ICAgICAgIAotZEluMyAgICAgICAgICAgICAgICBETiAgRDMuUzE2Ci0KLTsvLyBJbnRlcm1lZGlhdGUgY2FsY3VsYXRpb25zICAgICAgIAotZFplcm8gICAgICAgICAgICAgICBETiAgRDQuUzE2Ci1kZTAgICAgICAgICAgICAgICAgIEROICBENS5TMTYKLWRlMSAgICAgICAgICAgICAgICAgRE4gIEQ2LlMxNgotZGUyICAgICAgICAgICAgICAgICBETiAgRDcuUzE2Ci1kZTMgICAgICAgICAgICAgICAgIEROICBEOC5TMTYKLWRJbjFSUyAgICAgICAgICAgICAgRE4gIEQ3LlMxNgotZEluM1JTICAgICAgICAgICAgICBETiAgRDguUzE2Ci1kZjAgICAgICAgICAgICAgICAgIEROICBEMC5TMTYKLWRmMSAgICAgICAgICAgICAgICAgRE4gIEQxLlMxNgotZGYyICAgICAgICAgICAgICAgICBETiAgRDIuUzE2Ci1kZjMgICAgICAgICAgICAgICAgIEROICBEMy5TMTYKLXFmMDEgICAgICAgICAgICAgICAgUU4gIFEwLjMyCi1xZjIzICAgICAgICAgICAgICAgIFFOICBRMS4zMgotZGcwICAgICAgICAgICAgICAgICBETiAgRDUuUzE2Ci1kZzEgICAgICAgICAgICAgICAgIEROICBENi5TMTYKLWRnMiAgICAgICAgICAgICAgICAgRE4gIEQ3LlMxNgotZGczICAgICAgICAgICAgICAgICBETiAgRDguUzE2Ci1kZjFSUyAgICAgICAgICAgICAgIEROICBENy5TMTYKLWRmM1JTICAgICAgICAgICAgICAgRE4gIEQ4LlMxNgotCi07Ly8gT3V0cHV0IHBpeGVscwotZGgwICAgICAgICAgICAgICAgICBETiAgRDAuUzE2Ci1kaDEgICAgICAgICAgICAgICAgIEROICBEMS5TMTYKLWRoMiAgICAgICAgICAgICAgICAgRE4gIEQyLlMxNgotZGgzICAgICAgICAgICAgICAgICBETiAgRDMuUzE2Ci0KLSAgICAgICAKLSAgICA7Ly8gQWxsb2NhdGUgc3RhY2sgbWVtb3J5IHJlcXVpcmVkIGJ5IHRoZSBmdW5jdGlvbgotICAgICAgICAKLQotICAgIDsvLyBXcml0ZSBmdW5jdGlvbiBoZWFkZXIKLSAgICAgICAgTV9TVEFSVCBhcm1WQ000UDEwX1RyYW5zZm9ybVJlc2lkdWFsNHg0LCAsZDgKLSAgICAgICAgCi0gICAgICAgIDsqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKLSAgICAgICAgOy8vIFRoZSBzdHJhdGVneSB1c2VkIGluIGltcGxlbWVudGluZyB0aGUgdHJhbnNmb3JtIGlzIGFzIGZvbGxvd3M6KgotICAgICAgICA7Ly8gTG9hZCB0aGUgNHg0IGJsb2NrIGludG8gOCByZWdpc3RlcnMgICAgICAgICAgICAgICAgICAgICAgICAgICAqICAKLSAgICAgICAgOy8vIFRyYW5zcG9zZSB0aGUgNHg0IG1hdHJpeCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKiAgCi0gICAgICAgIDsvLyBQZXJmb3JtIHRoZSByb3cgb3BlcmF0aW9ucyAob24gY29sdW1ucykgdXNpbmcgU0lNRCAgICAgICAgICAgICogIAotICAgICAgICA7Ly8gVHJhbnNwb3NlIHRoZSA0eDQgcmVzdWx0IG1hdHJpeCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqICAKLSAgICAgICAgOy8vIFBlcmZvcm0gdGhlIGNvbG91bW4gb3BlcmF0aW9ucyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKgotICAgICAgICA7Ly8gU3RvcmUgdGhlIDR4NCBibG9jayBhdCBvbmUgZ28gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqICAKLSAgICAgICAgOyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgotCi0gICAgICAgIDsvLyBMb2FkIGFsbCB0aGUgNHg0IHBpeGVscyBpbiB0cmFuc3Bvc2VkIGZvcm0KLSAgICAgICAgCi0gICAgICAgIFZMRDQgICAge2RJbjAsZEluMSxkSW4yLGRJbjN9LFtwU3JjXQotICAgICAgICAKLSAgICAgICAgVk1PViAgICBkWmVybywjMCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDsvLyBVc2VkIHRvIHJpZ2h0IHNoaWZ0IGJ5IDEgCi0gICAgICAgIAotICAgICAgICAKLSAgICAgICAgOyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogCi0gICAgICAgIDsvLyBSb3cgT3BlcmF0aW9ucyAoUGVyZm9ybWVkIG9uIGNvbHVtbnMpCi0gICAgICAgIDsqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqIAotICAgICAgICAKLSAgICAgICAgCi0gICAgICAgIFZBREQgICAgICAgIGRlMCxkSW4wLGRJbjIgICAgICAgICAgICAgICAgICAgICAgIDsvLyAgZTAgPSBkMCArIGQyIAotICAgICAgICBWU1VCICAgICAgICBkZTEsZEluMCxkSW4yICAgICAgICAgICAgICAgICAgICAgICAgOy8vICBlMSA9IGQwIC0gZDIgCi0gICAgICAgIFZIQUREICAgICAgIGRJbjFSUyxkSW4xLGRaZXJvICAgICAgICAgICAgICAgICAgIDsvLyAoZjE+PjEpIGNvbnN0WmVybyBpcyBhIHJlZ2lzdGVyIGhvbGRpbmcgMAotICAgICAgICBWSEFERCAgICAgICBkSW4zUlMsZEluMyxkWmVybwotICAgICAgICBWU1VCICAgICAgICBkZTIsZEluMVJTLGRJbjMgICAgICAgICAgICAgICAgICAgICA7Ly8gIGUyID0gKGQxPj4xKSAtIGQzIAotICAgICAgICBWQUREICAgICAgICBkZTMsZEluMSxkSW4zUlMgICAgICAgICAgICAgICAgICAgICAgICA7Ly8gIGUzID0gZDEgKyAoZDM+PjEpIAotICAgICAgICBWQUREICAgICAgICBkZjAsZGUwLGRlMyAgICAgICAgICAgICAgICAgICAgICAgICA7Ly8gIGYwID0gZTAgKyBlMwotICAgICAgICBWQUREICAgICAgICBkZjEsZGUxLGRlMiAgICAgICAgICAgICAgICAgICAgICAgICAgICA7Ly8gIGYxID0gZTEgKyBlMgotICAgICAgICBWU1VCICAgICAgICBkZjIsZGUxLGRlMiAgICAgICAgICAgICAgICAgICAgICAgICAgICA7Ly8gIGYyID0gZTEgLSBlMgotICAgICAgICBWU1VCICAgICAgICBkZjMsZGUwLGRlMyAgICAgICAgICAgICAgICAgICAgICAgICAgICA7Ly8gIGYzID0gZTAgLSBlMwotICAgICAgICAKLSAgICAgICAgCi0gICAgICAgIAotICAgICAgICA7KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKLSAgICAgICAgOy8vIFRyYW5zcG9zZSB0aGUgcmVzdWx0YW50IG1hdHJpeAotICAgICAgICA7KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKLSAgICAgICAgCi0gICAgICAgIFZUUk4gICAgZGYwLGRmMQotICAgICAgICBWVFJOICAgIGRmMixkZjMKLSAgICAgICAgVlRSTiAgICBxZjAxLHFmMjMgCi0gICAgICAgIAotICAgICAgICAKLSAgICAgICAgOyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogCi0gICAgICAgIDsvLyBDb2xvdW1uIE9wZXJhdGlvbnMgCi0gICAgICAgIDsqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqIAotICAgICAgICAKLSAgICAgICAgCi0gICAgICAgIFZBREQgICAgICAgIGRnMCxkZjAsZGYyICAgICAgICAgICAgICAgICAgICAgICAgIDsvLyAgZTAgPSBkMCArIGQyIAotICAgICAgICBWU1VCICAgICAgICBkZzEsZGYwLGRmMiAgICAgICAgICAgICAgICAgICAgICAgICAgICA7Ly8gIGUxID0gZDAgLSBkMiAKLSAgICAgICAgVkhBREQgICAgICAgZGYxUlMsZGYxLGRaZXJvICAgICAgICAgICAgICAgICAgICAgOy8vIChmMT4+MSkgY29uc3RaZXJvIGlzIGEgcmVnaXN0ZXIgaG9sZGluZyAwCi0gICAgICAgIFZIQUREICAgICAgIGRmM1JTLGRmMyxkWmVybwotICAgICAgICBWU1VCICAgICAgICBkZzIsZGYxUlMsZGYzICAgICAgICAgICAgICAgICAgICAgICA7Ly8gIGUyID0gKGQxPj4xKSAtIGQzIAotICAgICAgICBWQUREICAgICAgICBkZzMsZGYxLGRmM1JTICAgICAgICAgICAgICAgICAgICAgICAgOy8vICBlMyA9IGQxICsgKGQzPj4xKSAKLSAgICAgICAgVkFERCAgICAgICAgZGgwLGRnMCxkZzMgICAgICAgICAgICAgICAgICAgICAgICAgOy8vICBmMCA9IGUwICsgZTMKLSAgICAgICAgVkFERCAgICAgICAgZGgxLGRnMSxkZzIgICAgICAgICAgICAgICAgICAgICAgICAgICAgOy8vICBmMSA9IGUxICsgZTIKLSAgICAgICAgVlNVQiAgICAgICAgZGgyLGRnMSxkZzIgICAgICAgICAgICAgICAgICAgICAgICAgICAgOy8vICBmMiA9IGUxIC0gZTIKLSAgICAgICAgVlNVQiAgICAgICAgZGgzLGRnMCxkZzMgICAgICAgICAgICAgICAgICAgICAgICAgICAgOy8vICBmMyA9IGUwIC0gZTMKLSAgICAgICAgCi0gICAgICAgICAgICAgCi0gICAgICAgIDsqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKLSAgICAgICAgOy8vIENhbGN1bGF0ZSBmaW5hbCB2YWx1ZSAoY29sT3BbaV1bal0gKyAzMik+PjYKLSAgICAgICAgOyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgotICAgICAgICAKLSAgICAgICAgVlJTSFIgICAgICAgZGgwLCM2Ci0gICAgICAgIFZSU0hSICAgICAgIGRoMSwjNgotICAgICAgICBWUlNIUiAgICAgICBkaDIsIzYKLSAgICAgICAgVlJTSFIgICAgICAgZGgzLCM2Ci0gICAgICAgIAotICAgICAgICAgICAgICAgIAotICAgICAgICA7KioqKioqKioqKioqKioqKioqKioqKioqKioqCi0gICAgICAgIDsvLyBTdG9yZSBhbGwgdGhlIDR4NCBwaXhlbHMKLSAgICAgICAgOyoqKioqKioqKioqKioqKioqKioqKioqKioqKgotICAgICAgICAKLSAgICAgICAgVlNUMSAgIHtkaDAsZGgxLGRoMixkaDN9LFtwRHN0XQotICAgICAgICAgICAgCi0gICAgICAgIAotICAgICAgICA7Ly8gU2V0IHJldHVybiB2YWx1ZQotICAgICAgICAKLUVuZCAgICAgICAgICAgICAgICAKLQotICAgICAgICAKLSAgICAgICAgOy8vIFdyaXRlIGZ1bmN0aW9uIHRhaWwKLSAgICAgICAgTV9FTkQKLSAgICAgICAgCi0gICAgRU5ESUYgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDsvL0NvcnRleEE4ICAgICAgICAgICAgCi0gICAgICAgICAgICAKLSAgICBFTkQKXCBObyBuZXdsaW5lIGF0IGVuZCBvZiBmaWxlCmRpZmYgLS1naXQgYS9tZWRpYS9saWJzdGFnZWZyaWdodC9jb2RlY3Mvb24yL2gyNjRkZWMvb214ZGwvYXJtX25lb24vdmMvbTRwMTAvc3JjL2FybVZDTTRQMTBfVW5wYWNrQmxvY2s0eDRfcy5zIGIvbWVkaWEvbGlic3RhZ2VmcmlnaHQvY29kZWNzL29uMi9oMjY0ZGVjL29teGRsL2FybV9uZW9uL3ZjL200cDEwL3NyYy9hcm1WQ000UDEwX1VucGFja0Jsb2NrNHg0X3MucwpkZWxldGVkIGZpbGUgbW9kZSAxMDA3NTUKaW5kZXggNGM1MmUyMi4uMDAwMDAwMAotLS0gYS9tZWRpYS9saWJzdGFnZWZyaWdodC9jb2RlY3Mvb24yL2gyNjRkZWMvb214ZGwvYXJtX25lb24vdmMvbTRwMTAvc3JjL2FybVZDTTRQMTBfVW5wYWNrQmxvY2s0eDRfcy5zCisrKyAvZGV2L251bGwKQEAgLTEsOTIgKzAsMCBAQAotOy8vCi07Ly8gCi07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ICAgIDsvLyBQZXJzaXN0ZW50IHZhcmlhYmxlcwotRmxhZyAgICAgICAgICAgIFJOIDMgICAgCi1WYWx1ZSAgICAgICAgICAgUk4gNCAgICAKLVZhbHVlMiAgICAgICAgICBSTiA1ICAgIAotc3RyT2Zmc2V0ICAgICAgIFJOIDYgICAgCi1jc3RPZmZzZXQgICAgICAgUk4gNyAgICAKLQotICAgICAgICAKLSAgICAgICAgTV9TVEFSVCBhcm1WQ000UDEwX1VucGFja0Jsb2NrNHg0LCByNwotICAgICAgICAKLSAgICAgICAgTERSICAgICBwU3JjLCBbcHBTcmNdICAgICAgICAgICAgICAgICAgICAgICA7Ly8gTG9hZCBwU3JjCi0gICAgICAgIE1PViAgICAgY3N0T2Zmc2V0LCAjMzEgICAgICAgICAgICAgICAgICAgICAgOy8vIFRvIGJlIHVzZWQgaW4gdGhlIGxvb3AsIHRvIGNvbXB1dGUgb2Zmc2V0Ci0gICAgICAgIAotICAgICAgICA7Ly8tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLQotICAgICAgICA7IEZpcnN0bHksIGZpbGwgYWxsIHRoZSBjb2VmZmljaWVudCB2YWx1ZXMgb24gdGhlIDxwRHN0PiBidWZmZXIgYnkgemVybwotICAgICAgICA7Ly8tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLQotICAgICAgICAKLSAgICAgICAgTU9WICAgICAgVmFsdWUsICAjMCAgICAgICAgICAgICAgICAgICAgICAgICA7Ly8gSW5pdGlhbGl6ZSB0aGUgemVybyB2YWx1ZQotICAgICAgICBNT1YgICAgICBWYWx1ZTIsICMwICAgICAgICAgICAgICAgICAgICAgICAgIDsvLyBJbml0aWFsaXplIHRoZSB6ZXJvIHZhbHVlCi0gICAgICAgIExEUkIgICA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ci0gICAgICAgIExEUlNCRVEgIFZhbHVlLCBbcFNyY10sICMxICAgICAgICAgICAgICAgICAgIDsvLyBWYWx1ZSA9IChPTVhfVTgpICAqcFNyYysrCi0gICAgICAgIE9SUk5FICAgIFZhbHVlLFZhbHVlLFZhbHVlMiwgTFNMICM4ICAgICAgICAgIDsvLyBWYWx1ZSA9IChPTVhfVTE2KSAqcFNyYysrCi0gICAgICAgIAotICAgICAgICBUU1QgICAgICBGbGFnLCAgIzB4MjAgICAgICAgICAgICAgICAgICAgICAgICA7Ly8gQ29tcHV0aW5nIChGbGFnICYgMHgyMCkgdG8gY2hlY2ssIGlmIHdlJ3JlIGRvbmUKLSAgICAgICAgTERSQkVRICAgRmxhZywgIFtwU3JjXSwgIzEgICAgICAgICAgICAgICAgICAgOy8vIEZsYWcgID0gKE9NWF9VOCkgKnBTcmMrKywgZm9yIG5leHQgaXRlcmF0aW9uCi0gICAgICAgIFNUUkggICAgIFZhbHVlLCBbcERzdCwgc3RyT2Zmc2V0XSAgICAgICAgICAgIDsvLyBTdG9yZSA8VmFsdWU+IGF0IG9mZnNldCA8c3RyT2Zmc2V0PgotICAgICAgICBCRVEgICAgICB1bnBhY2tMb29wICAgICAgICAgICAgICAgICAgICAgICAgICA7Ly8gQnJhbmNoIHRvIHRoZSBsb29wIGJlZ2lubmluZwotICAgICAgICAKLSAgICAgICAgU1RSICAgICAgcFNyYywgW3BwU3JjXSAgICAgICAgICAgICAgICAgICAgICAgOy8vIFVwZGF0ZSB0aGUgYml0c3RyZWFtIHBvaW50ZXIKLSAgICAgICAgTV9FTkQKLSAgICAKLSAgICBFTkRJRgotICAgIAotICAgIAotICAgIAotICAgIEVORAotICAgIApcIE5vIG5ld2xpbmUgYXQgZW5kIG9mIGZpbGUKZGlmZiAtLWdpdCBhL21lZGlhL2xpYnN0YWdlZnJpZ2h0L2NvZGVjcy9vbjIvaDI2NGRlYy9vbXhkbC9hcm1fbmVvbi92Yy9tNHAxMC9zcmMvb214VkNNNFAxM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ICBETiAgRDcuMzIgCi1kaW5kZXhSb3cxICAgICAgICAgIEROICBEOS4zMiAKLWRCeXRlSW5kZXhSb3cwICAgICAgRE4gIEQ3LjgKLWRCeXRlSW5kZXhSb3cxICAgICAgRE4gIEQ5LjgKLWRWUm93MCAgICAgICAgICAgICAgRE4gIEQ4LjggIAotZFZSb3cxICAgICAgICAgICAgICBETiAgRDQuOAotZFZSb3cwVTE2ICAgICAgICAgICBETiAgRDguVTE2Ci1kVlJvdzFVMTYgICAgICAgICAgIEROICBENC5VMTYKLWRWUm93MlUxNiAgICAgICAgICAgRE4gIEQ4LlUxNgotZFZSb3czVTE2ICAgICAgICAgICBETiAgRDQuVTE2Ci0KLWRTaGlmdCAgICAgICAgICAgICAgRE4gIEQ1LlUxNgotZFNyY1JvdzAgICAgICAgICAgICBETiAgRDAuSTE2Ci1kU3JjUm93MSAgICAgICAgICAgIEROICBEMS5JMTYKLWRTcmNSb3cyICAgICAgICAgICAgRE4gIEQyLkkxNiAgICAKLWRTcmNSb3czICAgICAgICAgICAgRE4gIEQzLkkxNgotZERxbnRSb3cwICAgICAgICAgICBETiAgRDAuSTE2ICAKLWREcW50Um93MSAgICAgICAgICAgRE4gIEQxLkkxNiAKLWREcW50Um93MiAgICAgICAgICAgRE4gIEQyLkkxNiAKLWREcW50Um93MyAgICAgICAgICAgRE4gIEQzLkkxNiAgCi0KLTsvLyBSZWdpc3RlcnMgdXNlZCBpbiBUcmFuc2Zvcm1SZXNpZHVhbDR4NAotCi07Ly8gUGFja2VkIElucHV0IHBpeGVscwotZEluMCAgICAgICAgICAgICAgICBETiAgRDAuUzE2ICAgICAgIAotZEluMSAgICAgICAgICAgICAgICBETiAgRDEuUzE2ICAgICAgIAotZEluMiAgICAgICAgICAgICAgICBETiAgRDIuUzE2ICAgICAgIAotZEluMyAgICAgICAgICAgICAgICBETiAgRDMuUzE2Ci1xSW4wMSAgICAgICAgICAgICAgIFFOICBRMC4zMgotcUluMjMgICAgICAgICAgICAgICBRTiAgUTEuMzIKLQotOy8vIEludGVybWVkaWF0ZSBjYWxjdWxhdGlvbnMgICAgICAgCi1kWmVybyAgICAgICAgICAgICAgIEROICBENC5TMTYKLWRlMCAgICAgICAgICAgICAgICAgRE4gIEQ1LlMxNgotZGUxICAgICAgICAgICAgICAgICBETiAgRDYuUzE2Ci1kZTIgICAgICAgICAgICAgICAgIEROICBENy5TMTYKLWRlMyAgICAgICAgICAgICAgICAgRE4gIEQ4LlMxNgotZEluMVJTICAgICAgICAgICAgICBETiAgRDcuUzE2Ci1kSW4zUlMgICAgICAgICAgICAgIEROICBEOC5TMTYKLWRmMCAgICAgICAgICAgICAgICAgRE4gIEQwLlMxNgotZGYxICAgICAgICAgICAgICAgICBETiAgRDEuUzE2Ci1kZjIgICAgICAgICAgICAgICAgIEROICBEMi5TMTYKLWRmMyAgICAgICAgICAgICAgICAgRE4gIEQzLlMxNgotcWYwMSAgICAgICAgICAgICAgICBRTiAgUTAuMzIKLXFmMjMgICAgICAgICAgICAgICAgUU4gIFExLjMyCi1kZzAgICAgICAgICAgICAgICAgIEROICBENS5TMTYKLWRnMSAgICAgICAgICAgICAgICAgRE4gIEQ2LlMxNgotZGcyICAgICAgICAgICAgICAgICBETiAgRDcuUzE2Ci1kZzMgICAgICAgICAgICAgICAgIEROICBEOC5TMTYKLWRmMVJTICAgICAgICAgICAgICAgRE4gIEQ3LlMxNgotZGYzUlMgICAgICAgICAgICAgICBETiAgRDguUzE2Ci0KLTsvLyBPdXRwdXQgcGl4ZWxzCi1kaDAgICAgICAgICAgICAgICAgIEROICBEMC5TMTYKLWRoMSAgICAgICAgICAgICAgICAgRE4gIEQxLlMxNgotZGgyICAgICAgICAgICAgICAgICBETiAgRDIuUzE2Ci1kaDMgICAgICAgICAgICAgICAgIEROICBEMy5TMTYgCi0KLTsvLyBSZWdpc3RlcnMgdXNlZCBpbiBEZXF1YW50VHJhbnNmb3JtUmVzaWR1YWxGcm9tUGFpckFuZEFkZAotCi1kRGVsdGFSb3cwICAgICAgICAgIEROICBEMC5TMTYKLWREZWx0YVJvdzEgICAgICAgICAgRE4gIEQxLlMxNgotZERlbHRhUm93MiAgICAgICAgICBETiAgRDIuUzE2Ci1kRGVsdGFSb3czICAgICAgICAgIEROICBEMy5TMTYKLXFEZWx0YVJvdzAxICAgICAgICAgUU4gIFEwLlMxNgotcURlbHRhUm93MjMgICAgICAgICBRTiAgUTEuUzE2Ci0KLWRQcmVkVmFsUm93MDEgICAgICAgRE4gIEQ0LlU4Ci1kUHJlZFZhbFJvdzIzICAgICAgIEROICBENS5VOAotCi1xU3VtUm93MDEgICAgICAgICAgIFFOICBRMy5TMTYKLXFTdW1Sb3cyMyAgICAgICAgICAgUU4gIFE0LlMxNgotZERzdFJvdzAxICAgICAgICAgICBETiAgRDAuVTgKLWREc3RSb3cyMyAgICAgICAgICAgRE4gIEQxLlU4Ci1kRHN0Um93MCAgICAgICAgICAgIEROICBEMC4zMlswXQotZERzdFJvdzEgICAgICAgICAgICBETiAgRDAuMzJbMV0KLWREc3RSb3cyICAgICAgICAgICAgRE4gIEQxLjMyWzBdCi1kRHN0Um93MyAgICAgICAgICAgIEROICBEMS4zMlsxXQotICAgIAotICAgICAgICAgICAKLSAgICA7Ly8gQWxsb2NhdGUgc3RhY2sgbWVtb3J5IHJlcXVpcmVkIGJ5IHRoZSBmdW5jdGlvbgotICAgICAgICBNX0FMTE9DOCBwQnVmZmVyLCAzMgotICAgICAgICAgICAgICAgCi0KLSAgICA7Ly8gV3JpdGUgZnVuY3Rpb24gaGVhZGVyCi0gICAgICAgIE1fU1RBUlQgb214VkNNNFAxMF9EZXF1YW50VHJhbnNmb3JtUmVzaWR1YWxGcm9tUGFpckFuZEFkZCxyMTEsZDkKLSAgICAgICAgCi0gICAgICAgIDsvLyBEZWZpbmUgc3RhY2sgYXJndW1lbnRzCi0gICAgICAgIE1fQVJHICAgcHJlZFN0ZXBPblN0YWNrLCA0Ci0gICAgICAgIE1fQVJHICAgZHN0U3RlcE9uU3RhY2ssNAotICAgICAgICBNX0FSRyAgIFFQT25TdGFjaywgNAotICAgICAgICBNX0FSRyAgIEFDT25TdGFjayw0Ci0gIAotICAgICAgICAKLSAgICAgICAgTV9BRFIgICBwRGVsdGEscEJ1ZmZlciAKLSAgICAgICAgTV9MRFIgICBBQyxBQ09uU3RhY2sgCi0gICAgICAgIAotICAgICAgICAgCi0gICAgICAgIDsvLyBTYXZlIHJlZ2lzdGVycyByMSxyMixyMyBiZWZvcmUgZnVuY3Rpb24gY2FsbCAgICAKLSAgICAgICAgTU9WICAgICBwUHJlZFRlbXAscFByZWQKLSAgICAgICAgTU9WICAgICBwRENUZW1wLHBEQwotICAgICAgICBNT1YgICAgIHBEc3RUZW1wLHBEc3QKLSAgICAgICAgCi0gICAgICAgIENNUCAgICAgQUMsIzAKLSAgICAgICAgQkVRICAgICBEQ2Nhc2UKLSAgICAgICAgTU9WICAgICBwRGVsdGFBcmcxLHBEZWx0YSAgICAgICAgICAgICAgICAgICAgICAgICAgIDsvLyBTZXQgdXAgcjEgZm9yIGFybVZDTTRQMTBfVW5wYWNrQmxvY2s0eDQKLSAgICAKLSAgICAgICAgQkwgICAgICBhcm1WQ000UDEwX1VucGFja0Jsb2NrNHg0Ci0gICAgCi0gICAgICAgIDsvLy0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tCi0gICAgICAgIDsvLyBhcm1WQ000UDEwX0RlcXVhbnRMdW1hQUM0eDQgOiBzdGF0aWMgZnVuY3Rpb24gaW5saW5lZAotICAgICAgICA7Ly8tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLQotICAgICAgICAKLSAgICAgICAgOy8vQkwgICAgICBhcm1WQ000UDEwX0RlcXVhbnRMdW1hQUM0eDQKLSAgICAgICAgTV9MRFIgICBRUCxRUE9uU3RhY2sgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDsvLyBTZXQgdXAgcjEgZm9yIGFybVZDTTRQMTBfRGVxdWFudEx1bWFBQzR4NAotICAgICAgICAgICAgICAgIAotICAgICAgICBMRFIgICAgcFFQbW9kLD1hcm1WQ000UDEwX1FQTW9kdWxvVGFibGUKLSAgICAgICAgTERSICAgIHBRUGRpdiw9YXJtVkNNNFAxMF9RUERpdlRhYmxlICAgICAgICAKLSAgICAgICAgTERSICAgIHBWUm93LD1hcm1WQ000UDEwX1ZNYXRyaXhVMTYKLSAgICAgICAgCi0gICAgICAgIAotICAgICAgICBMRFJTQiAgUVBtb2QsW3BRUG1vZCxRUF0gICAgICAgICAgICAgICAgICAgIDsvLyAoUVAlNikgKiA2Ci0gICAgICAgIExEUlNCICBzaGlmdCxbcFFQZGl2LFFQXSAgICAgICAgICAgICAgICAgICAgOy8vIFNoaWZ0ID0gUVAgLyA2Ci0gICAgICAgICAgICAgICAgCi0gICAgICAgIExEUiAgICBpbmRleDEsPTB4MDMwMjA1MDQgCi0gICAgICAgIExEUiAgICBpbmRleDAsPTB4MDUwNDAxMDAgICAgICAgICAgICAgICAgICAgOy8vIEluZGV4ZXMgaW50byBkVm1hdHJpeAotICAgICAgICBBREQgICAgcFZSb3cscFZSb3csUVBtb2QKLSAgICAgICAgVkRVUCAgIGRpbmRleFJvdzAsaW5kZXgwIAotICAgICAgICBWRFVQICAgZGluZGV4Um93MSxpbmRleDEKLSAgICAgICAgVkRVUCAgIGRTaGlmdCxzaGlmdCAKLSAgICAgICAgCi0gICAgICAgIDsvLyBMb2FkIGFsbCA0eDQgcFZSb3dbXSB2YWx1ZXMKLSAgICAgICAgVkxEMSAgIGRWbWF0cml4LFtwVlJvd10gICAgICAgICAgICAgICAgICAgICA7Ly8gZFZtYXRyaXggPSBbMGR8MGN8MGJ8MGFdCi0gICAgICAgIAotICAgICAgICAKLSAgICAgICAgVlRCTCAgIGRWUm93MCxkVm1hdHJpeCxkQnl0ZUluZGV4Um93MCAgICAgICA7Ly8g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lZCB0byBhdm9pZCBMb2FkL1N0b3JlcwotICAgICAgICA7Ly8tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tCi0gICAgICAgIAotICAgICAgICAKLSAgICAgICAgOy8vQkwgICAgICBhcm1WQ000UDEwX1RyYW5zZm9ybVJlc2lkdWFsNHg0Ci0gICAgICAgIDsvL1NUUkhORSAgREN2YWwsW3BEZWx0YV0KLSAgICAgICAgVk1PVk5FICAgIGRJbjBbMF0sREN2YWwKLSAgICAgICAgCi0gICAgICAgIAotICAgICAgICAKLSAgICAgICAgOy8vKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKLSAgICAgICAgOy8vIFRyYW5zcG9zZSB0aGUgaW5wdXQgcGl4ZWxzIDogcGVyZm9ybSBSb3cgb3BzIGFzIENvbCBvcHMKLSAgICAgICAgOy8vKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKLSAgICAgICAgCi0gICAgICAgIFZUUk4gICAgZEluMCxkSW4xCi0gICAgICAgIFZUUk4gICAgZEluMixkSW4zCi0gICAgICAgIFZUUk4gICAgcUluMDEscUluMjMgCi0gICAgICAgICAKLSAgICAgICAgCi0gICAgICAgIFZNT1YgICAgZFplcm8sIzAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA7Ly8gVXNlZCB0byByaWdodCBzaGlmdCBieSAxIAotICAgICAgICAKLSAgICAgICAgCi0gICAgICAgIDsvLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogCi0gICAgICAgIDsvLyBSb3cgT3BlcmF0aW9ucyAoUGVyZm9ybWVkIG9uIGNvbHVtbnMpCi0gICAgICAgIDsvLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogCi0gICAgICAgIAotICAgICAgICAKLSAgICAgICAgVkFERCAgICAgICAgZGUwLGRJbjAsZEluMiAgICAgICAgICAgICAgICAgICAgICAgOy8vICBlMCA9IGQwICsgZDIgCi0gICAgICAgIFZTVUIgICAgICAgIGRlMSxkSW4wLGRJbjIgICAgICAgICAgICAgICAgICAgICAgICA7Ly8gIGUxID0gZDAgLSBkMiAKLSAgICAgICAgVkhBREQgICAgICAgZEluMVJTLGRJbjEsZFplcm8gICAgICAgICAgICAgICAgICAgOy8vIChmMT4+MSkgY29uc3RaZXJvIGlzIGEgcmVnaXN0ZXIgaG9sZGluZyAwCi0gICAgICAgIFZIQUREICAgICAgIGRJbjNSUyxkSW4zLGRaZXJvCi0gICAgICAgIFZTVUIgICAgICAgIGRlMixkSW4xUlMsZEluMyAgICAgICAgICAgICAgICAgICAgIDsvLyAgZTIgPSAoZDE+PjEpIC0gZDMgCi0gICAgICAgIFZBREQgICAgICAgIGRlMyxkSW4xLGRJbjNSUyAgICAgICAgICAgICAgICAgICAgICAgIDsvLyAgZTMgPSBkMSArIChkMz4+MSkgCi0gICAgICAgIFZBREQgICAgICAgIGRmMCxkZTAsZGUzICAgICAgICAgICAgICAgICAgICAgICAgIDsvLyAgZjAgPSBlMCArIGUzCi0gICAgICAgIFZBREQgICAgICAgIGRmMSxkZTEsZGUyICAgICAgICAgICAgICAgICAgICAgICAgICAgIDsvLyAgZjEgPSBlMSArIGUyCi0gICAgICAgIFZTVUIgICAgICAgIGRmMixkZTEsZGUyICAgICAgICAgICAgICAgICAgICAgICAgICAgIDsvLyAgZjIgPSBlMSAtIGUyCi0gICAgICAgIFZTVUIgICAgICAgIGRmMyxkZTAsZGUzICAgICAgICAgICAgICAgICAgICAgICAgICAgIDsvLyAgZjMgPSBlMCAtIGUzCi0gICAgICAgIAotICAgICAgICAKLSAgICAgICAgCi0gICAgICAgIDsvLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCi0gICAgICAgIDsvLyBUcmFuc3Bvc2UgdGhlIHJlc3VsdGFudCBtYXRyaXgKLSAgICAgICAgOy8vKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKLSAgICAgICAgCi0gICAgICAgIFZUUk4gICAgZGYwLGRmMQotICAgICAgICBWVFJOICAgIGRmMixkZjMKLSAgICAgICAgVlRSTiAgICBxZjAxLHFmMjMgCi0gICAgICAgIAotICAgICAgICAKLSAgICAgICAgOy8vKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAKLSAgICAgICAgOy8vIENvbG91bW4gT3BlcmF0aW9ucyAKLSAgICAgICAgOy8vKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAKLSAgICAgICAgCi0gICAgICAgIAotICAgICAgICBWQUREICAgICAgICBkZzAsZGYwLGRmMiAgICAgICAgICAgICAgICAgICAgICAgICA7Ly8gIGUwID0gZDAgKyBkMiAKLSAgICAgICAgVlNVQiAgICAgICAgZGcxLGRmMCxkZjIgICAgICAgICAgICAgICAgICAgICAgICAgICAgOy8vICBlMSA9IGQwIC0gZDIgCi0gICAgICAgIFZIQUREICAgICAgIGRmMVJTLGRmMSxkWmVybyAgICAgICAgICAgICAgICAgICAgIDsvLyAoZjE+PjEpIGNvbnN0WmVybyBpcyBhIHJlZ2lzdGVyIGhvbGRpbmcgMAotICAgICAgICBWSEFERCAgICAgICBkZjNSUyxkZjMsZFplcm8KLSAgICAgICAgVlNVQiAgICAgICAgZGcyLGRmMVJTLGRmMyAgICAgICAgICAgICAgICAgICAgICAgOy8vICBlMiA9IChkMT4+MSkgLSBkMyAKLSAgICAgICAgVkFERCAgICAgICAgZGczLGRmMSxkZjNSUyAgICAgICAgICAgICAgICAgICAgICAgIDsvLyAgZTMgPSBkMSArIChkMz4+MSkgCi0gICAgICAgIFZBREQgICAgICAgIGRoMCxkZzAsZGczICAgICAgICAgICAgICAgICAgICAgICAgIDsvLyAgZjAgPSBlMCArIGUzCi0gICAgICAgIFZBREQgICAgICAgIGRoMSxkZzEsZGcyICAgICAgICAgICAgICAgICAgICAgICAgICAgIDsvLyAgZjEgPSBlMSArIGUyCi0gICAgICAgIFZTVUIgICAgICAgIGRoMixkZzEsZGcyICAgICAgICAgICAgICAgICAgICAgICAgICAgIDsvLyAgZjIgPSBlMSAtIGUyCi0gICAgICAgIFZTVUIgICAgICAgIGRoMyxkZzAsZGczICAgICAgICAgICAgICAgICAgICAgICAgICAgIDsvLyAgZjMgPSBlMCAtIGUzCi0gICAgICAgIAotICAgICAgICAgICAgIAotICAgICAgICA7Ly8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKLSAgICAgICAgOy8vIENhbGN1bGF0ZSBmaW5hbCB2YWx1ZSAoY29sT3BbaV1bal0gKyAzMik+PjYKLSAgICAgICAgOy8vKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCi0gICAgICAgIAotICAgICAgICBWUlNIUiAgICAgICBkaDAsIzYKLSAgICAgICAgVlJTSFIgICAgICAgZGgxLCM2Ci0gICAgICAgIFZSU0hSICAgICAgIGRoMiwjNgotICAgICAgICBWUlNIUiAgICAgICBkaDMsIzYKLSAgICAgICAgCi0gICAgICAgICAgICAgICAKLSAgICAgICAgQiAgICAgICBPdXREQ2Nhc2UgCi0gICAgICAgIAotCi1EQ2Nhc2UKLSAgICAgICAgOy8vIENhbGN1bGF0ZSB0aGUgVHJhbnNmb3JtZWQgREN2YWx1ZSA6IChEQ3ZhbCszMik+PjYKLSAgICAgICAgTERSU0ggICBEQ3ZhbCxbcERDVGVtcF0gCi0gICAgICAgIEFERCAgICAgREN2YWwsREN2YWwsIzMyIAotICAgICAgICBBU1IgICAgIERDdmFsLERDdmFsLCM2Ci0gICAgICAgIAotICAgICAgICBWRFVQICAgIGREZWx0YVJvdzAsIERDdmFsICAgICAgICAgICAgICAgICAgICAgICA7Ly8gcERlbHRhWzBdICA9IHBEZWx0YVsxXSAgPSBwRGVsdGFbMl0gID0gcERlbHRhWzNdID0gREN2YWwKLSAgICAgICAgVkRVUCAgICBkRGVsdGFSb3cxLCBEQ3ZhbCAgICAgICAgICAgICAgICAgICAgICAgIDsvLyBwRGVsdGFbNF0gID0gcERlbHRhWzVdICA9IHBEZWx0YVs2XSAgPSBwRGVsdGFbN10gPSBEQ3ZhbAotICAgICAgICBWRFVQICAgIGREZWx0YVJvdzIsIERDdmFsICAgICAgICAgICAgICAgICAgICAgICAgOy8vIHBEZWx0YVs4XSAgPSBwRGVsdGFbOV0gID0gcERlbHRhWzEwXSA9IHBEZWx0YVsxMV0gPSBEQ3ZhbAotICAgICAgICBWRFVQICAgIGREZWx0YVJvdzMsIERDdmFsCi0gICAgICAgICAgICAKLSAgICAgICAgICAgICAgICAKLU91dERDY2FzZSAgICAgIAotICAgICAgICBNX0xEUiAgIHByZWRzdGVwLHByZWRTdGVwT25TdGFjawotICAgICAgICBNX0xEUiAgIGRzdFN0ZXAsZHN0U3RlcE9uU3RhY2sKLSAgICAgICAgCi0gICAgICAgIExEUiAgICAgUHJlZFZhbDEsW3BQcmVkVGVtcF0scHJlZHN0ZXAKLSAgICAgICAgTERSICAgICBQcmVkVmFsMixbcFByZWRUZW1wXSxwcmVkc3RlcAotICAgICAgICBWTU9WICAgIGRQcmVkVmFsUm93MDEsUHJlZFZhbDEsUHJlZFZhbDIKLSAgICAgICAgCi0gICAgICAgIExEUiAgICAgUHJlZFZhbDEsW3BQcmVkVGVtcF0scHJlZHN0ZXAKLSAgICAgICAgTERSICAgICBQcmVkVmFsMixbcFByZWRUZW1wXQotICAgICAgICBWTU9WICAgIGRQcmVkVmFsUm93MjMsUHJlZFZhbDEsUHJlZFZhbDIKLSAKLSAgICAgICAgCi0gICAgICAgIFZBRERXICAgcVN1bVJvdzAxLHFEZWx0YVJvdzAxLGRQcmVkVmFsUm93MDEKLSAgICAgICAgVkFERFcgICBxU3VtUm93MjMscURlbHRhUm93MjMsZFByZWRWYWxSb3cyMwotICAgICAgICBWUU1PVlVOIGREc3RSb3cwMSxxU3VtUm93MDEKLSAgICAgICAgVlFNT1ZVTiBkRHN0Um93MjMscVN1bVJvdzIzCi0gICAgICAgIAotIAotICAgICAgICBWU1QxICAgIGREc3RSb3cwLFtwRHN0VGVtcF0sZHN0U3RlcAotICAgICAgICBWU1QxICAgIGREc3RSb3cxLFtwRHN0VGVtcF0sZHN0U3RlcAotICAgICAgICBWU1QxICAgIGREc3RSb3cyLFtwRHN0VGVtcF0sZHN0U3RlcAotICAgICAgICBWU1QxICAgIGREc3RSb3czLFtwRHN0VGVtcF0KLSAgICAgICAgCi0gICAgICAgIDsvLyBTZXQgcmV0dXJuIHZhbHVlCi0gICAgICAgIE1PViAgICAgcmVzdWx0LCNPTVhfU3RzX05vRXJyCi0gICAgICAgIAotRW5kICAgICAgICAgICAgICAgIAotCi0gICAgICAgIAotICAgICAgICA7Ly8gV3JpdGUgZnVuY3Rpb24gdGFpbAotICAgICAgICAKLSAgICAgICAgTV9FTkQKLSAgICAgICAgCi0gICAgRU5ESUYgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOy8vQ09SVEVYQTggICAKLSAgICAKLSAgICAgICAgIAotICAgICAgICAgICAgCi0gICAgRU5ECmRpZmYgLS1naXQgYS9tZWRpYS9saWJzdGFnZWZyaWdodC9jb2RlY3Mvb24yL2gyNjRkZWMvb214ZGwvYXJtX25lb24vdmMvbTRwMTAvc3JjL29teFZDTTRQMTBfRmlsdGVyRGVibG9ja2luZ0Nocm9tYV9Ib3JFZGdlX0lfcy5zIGIvbWVkaWEvbGlic3RhZ2VmcmlnaHQvY29kZWNzL29uMi9oMjY0ZGVjL29teGRsL2FybV9uZW9uL3ZjL200cDEwL3NyYy9vbXhWQ000UDEwX0ZpbHRlckRlYmxvY2tpbmdDaHJvbWFfSG9yRWRnZV9JX3MucwpkZWxldGVkIGZpbGUgbW9kZSAxMDA2NDQKaW5kZ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DEKLXBBbHBoYSAgICAgIFJOIDIKLXBCZXRhICAgICAgIFJOIDMKLQotcFRocmVzaG9sZHMgUk4gNQotcEJTICAgICAgICAgUk4gNAotYlMzMjEwICAgICAgUk4gNgotCi07Ly8gTG9vcCAKLQotWFkgICAgICAgICAgUk4gNwotCi07Ly8gUGl4ZWxzCi1kUF8wICAgICAgICBETiBENC5VOAotZFBfMSAgICAgICAgRE4gRDUuVTggIAotZFBfMiAgICAgICAgRE4gRDYuVTggIAotZFFfMCAgICAgICAgRE4gRDguVTggIAotZFFfMSAgICAgICAgRE4gRDkuVTggIAotZFFfMiAgICAgICAgRE4gRDEwLlU4IAotCi07Ly8gRmlsdGVyaW5nIERlY2lzaW9uCi1kQWxwaGEgICAgICBETiBEMC5VOAotZEJldGEgICAgICAgRE4gRDIuVTgKLQotZEZpbHQgICAgICAgRE4gRDE2LlU4Ci1kQXFmbGcgICAgICBETiBEMTIuVTgKLWRBcGZsZyAgICAgIEROIEQxNy5VOCAKLQotZEFwMHEwICAgICAgRE4gRDEzLlU4Ci1kQXAxcDAgICAgICBETiBEMTIuVTgKLWRBcTFxMCAgICAgIEROIEQxOC5VOAotZEFwMnAwICAgICAgRE4gRDE5LlU4Ci1kQXEycTAgICAgICBETiBEMTcuVTgKLQotcUJTMzIxMCAgICAgUU4gUTEzLlUxNgotZEJTMzIxMCAgICAgRE4gRDI2Ci1kTWFza19icyAgICBETiBEMjcKLWRGaWx0X2JzICAgIEROIEQyNi5VMTYKLQotOy8vIGJTTFQ0Ci1kTWFza18wICAgICBETiBEMTQuVTgKLWRNYXNrXzEgICAgIEROIEQxNS5VOCAgICAKLWRNYXNrXzQgICAgIEROIEQxLlUxNgotCi1NYXNrXzQgICAgICBSTiA4Ci1NYXNrXzMgICAgICBSTiA5Ci0KLWRUZW1wICAgICAgIEROIEQxOS5VOAotCi07Ly8gUmVzdWx0Ci1kUF8wdCAgICAgICBETiBEMTMuVTggICAKLWRRXzB0ICAgICAgIEROIEQzMS5VOCAgIAotCi1kUF8wbiAgICAgICBETiBEMjkuVTgKLWRRXzBuICAgICAgIEROIEQyNC5VOAotCi0gICAgICAgIAotICAgICAgICA7Ly8gRnVuY3Rpb24gaGVhZGVyCi0gICAgICAgIE1fU1RBUlQgb214VkNNNFAxMF9GaWx0ZXJEZWJsb2NraW5nQ2hyb21hX0hvckVkZ2VfSSwgcjksIGQxNQotICAgICAgICAKLSAgICAgICAgOy8vQXJndW1lbnRzIG9uIHRoZSBzdGFjawotICAgICAgICBNX0FSRyAgIHBwVGhyZXNob2xkcywgNAotICAgICAgICBNX0FSRyAgIHBwQlMsIDQKLSAgICAgICAgCi0gICAgICAgIDsvLyBkMC1kQWxwaGFfMAotICAgICAgICA7Ly8gZDItZEJldGFfMAotCi0gICAgICAgIDtsb2FkIGFscGhhMSxiZXRhMSBzb21ld2hlcmUgdG8gYXZvaWQgbW9yZSBsb2FkcwotICAgICAgICBWTEQxICAgICAgICB7ZEFscGhhW119LCBbcEFscGhhXSEKLSAgICAgICAgU1VCICAgICAgICAgcFNyY0RzdCwgcFNyY0RzdCwgc3JjZHN0U3RlcCwgTFNMICMxIDs/Ci0gICAgICAgIFNVQiAgICAgICAgIHBTcmNEc3QsIHBTcmNEc3QsIHNyY2RzdFN0ZXAKLSAgICAgICAgVkxEMSAgICAgICAge2RCZXRhW119LCBbcEJldGFdISAKLSAgICAgICAgCi0gICAgICAgIE1fTERSICAgICAgIHBCUywgcHBCUwotICAgICAgICBNX0xEUiAgICAgICBwVGhyZXNob2xkcywgcHBUaHJlc2hvbGRzIAotCi0gICAgICAgIExEUiAgICAgICAgIE1hc2tfMywgPU1BU0tfMwotICAgICAgICBMRFIgICAgICAgICBNYXNrXzQsID1NQVNLXzQKLQotICAgICAgICBWTU9WICAgICAgICBkTWFza18wLCAjMCAgICAgCi0gICAgICAgIFZNT1YgICAgICAgIGRNYXNrXzEsICMxICAgICAKLSAgICAgICAgVk1PViAgICAgICAgZE1hc2tfNCwgIzQgICAgIAotICAgICAgICAKLSAgICAgICAgTERSICAgICAgICAgWFksID1MT09QX0NPVU5UCi0KLSAgICAgICAgOy8vIHAwLXAzIC0gZDQtZDcKLSAgICAgICAgOy8vIHEwLXEzIC0gZDgtZDExCi1Mb29wWSAgICAgICAgCi0gICAgICAgIExEUiAgICAgICAgIGJTMzIxMCwgW3BCU10sICM4Ci0gICAgICAgIAotICAgICAgICBWTEQxICAgICAgICBkUF8yLCBbcFNyY0RzdF0sIHNyY2RzdFN0ZXAKLSAgICAgICAgOzEKLSAgICAgICAgVkxEMSAgICAgICAgZFBfMSwgW3BTcmNEc3RdLCBzcmNkc3RTdGVwCi0gICAgICAgIENNUCAgICAgICAgIGJTMzIxMCwgIzAKLSAgICAgICAgVkxEMSAgICAgICAgZFBfMCwgW3BTcmNEc3RdLCBzcmNkc3RTdGVwCi0gICAgICAgIDsxCi0gICAgICAgIFZMRDEgICAgICAgIGRRXzAsIFtwU3JjRHN0XSwgc3JjZHN0U3RlcAotICAgICAgICBWQUJEICAgICAgICBkQXAycDAsIGRQXzIsIGRQXzAKLSAgICAgICAgVkxEMSAgICAgICAgZFFfMSwgW3BTcmNEc3RdLCBzcmNkc3RTdGVwCi0gICAgICAgIFZBQkQgICAgICAgIGRBcDBxMCwgZFBfMCwgZFFfMAotICAgICAgICBWTEQxICAgICAgICBkUV8yLCBbcFNyY0RzdF0sIHNyY2RzdFN0ZXAKLSAgICAgICAgQkVRICAgICAgICAgTm9GaWx0ZXJCUzAKLQotICAgICAgICBWQUJEICAgICAgICBkQXAxcDAsIGRQXzEsIGRQXzAKLSAgICAgICAgVkFCRCAgICAgICAgZEFxMXEwLCBkUV8xLCBkUV8wCi0KLSAgICAgICAgVkNHVCAgICAgICAgZEZpbHQsIGRBbHBoYSwgZEFwMHEwCi0gICAgICAgIFZNT1YuVTMyICAgIGRCUzMyMTBbMF0sIGJTMzIxMAotICAgICAgICBWTUFYICAgICAgICBkQXAxcDAsIGRBcTFxMCwgZEFwMXAwCi0gICAgICAgIFZNT1ZMICAgICAgIHFCUzMyMTAsIGRCUzMyMTAuVTgKLSAgICAgICAgVkFCRCAgICAgICAgZEFxMnEwLCBkUV8yLCBkUV8wCi0gICAgICAgIFZDR1QgICAgICAgIGRNYXNrX2JzLlMxNiwgZEJTMzIxMC5TMTYsICMwCi0KLSAgICAgICAgVkNHVCAgICAgICAgZEFwMXAwLCBkQmV0YSwgZEFwMXAwIAotICAgICAgICBWQ0dUICAgICAgICBkQXAycDAsIGRCZXRhLCBkQXAycDAKLSAgICAgICAgCi0gICAgICAgIFZBTkQgICAgICAgIGRGaWx0LCBkTWFza19icy5VOAotCi0gICAgICAgIFRTVCAgICAgICAgIGJTMzIxMCwgTWFza18zCi0KLSAgICAgICAgVkNHVCAgICAgICAgZEFxMnEwLCBkQmV0YSwgZEFxMnEwCi0gICAgICAgIFZBTkQgICAgICAgIGRGaWx0LCBkRmlsdCwgZEFwMXAwCi0KLSAgICAgICAgVkFORCAgICAgICAgZEFxZmxnLCBkRmlsdCwgZEFxMnEwCi0gICAgICAgIFZBTkQgICAgICAgIGRBcGZsZywgZEZpbHQsIGRBcDJwMAotICAgICAgICAKLSAgICAgICAgOy8vIGJTIDwgNCBGaWx0ZXJpbmcKLSAgICAgICAgQkxORSAgICAgICAgYXJtVkNNNFAxMF9EZWJsb2NraW5nQ2hyb21hYlNMVDRfdW5zYWZlCi0KLSAgICAgICAgVFNUICAgICAgICAgYlMzMjEwLCBNYXNrXzQgICAgICAgIAotCi0gICAgICAgIFNVQiAgICAgICAgIHBTcmNEc3QsIHBTcmNEc3QsIHNyY2RzdFN0ZXAsIExTTCAjMgotICAgICAgICBWVFNUICAgICAgICBkRmlsdF9icywgZEZpbHRfYnMsIGRNYXNrXzQKLQotICAgICAgICA7Ly8gYlMgPT0gNCBGaWx0ZXJpbmcKLSAgICAgICAgQkxORSAgICAgICAgYXJtVkNNNFAxMF9EZWJsb2NraW5nQ2hyb21hYlNHRTRfdW5zYWZlCi0gICAgICAgICAgICAgICAgICAgIAotICAgICAgICBWQklUICAgICAgICBkUF8wbiwgZFBfMHQsIGRGaWx0X2JzCi0gICAgICAgIFZCSVQgICAgICAgIGRRXzBuLCBkUV8wdCwgZEZpbHRfYnMKLSAgICAgICAgCi0gICAgICAgIFZCSUYgICAgICAgIGRQXzBuLCBkUF8wLCBkRmlsdCAgICAgIAotICAgICAgICBWQklGICAgICAgICBkUV8wbiwgZFFfMCwgZEZpbHQgIAotCi0gICAgICAgIDsvLyBSZXN1bHQgU3RvcmFnZQotICAgICAgICBWU1QxICAgICAgICBkUF8wbiwgW3BTcmNEc3RdLCBzcmNkc3RTdGVwCi0gICAgICAgIEFERFMgICAgICAgIFhZLCBYWSwgWFkKLSAgICAgICAgVlNUMSAgICAgICAgZFFfMG4sIFtwU3JjRHN0XSwgc3JjZHN0U3RlcAotCi0gICAgICAgIEJORSAgICAgICAgIExvb3BZICAgICAgICAKLSAgICAgICAgCi0gICAgICAgIE1PViAgICAgICAgIHIwLCAjT01YX1N0c19Ob0VycgotCi0gICAgICAgIE1fRVhJVAotICAgICAgICAKLU5vRmlsdGVyQlMwCi0KLSAgICAgICAgVkxEMSAgICAgICAge2RBbHBoYVtdfSwgW3BBbHBoYV0KLSAgICAgICAgU1VCICAgICAgICAgcFNyY0RzdCwgcFNyY0RzdCwgc3JjZHN0U3RlcCwgTFNMICMxCi0gICAgICAgIEFERFMgICAgICAgIFhZLCBYWSwgWFkKLSAgICAgICAgVkxEMSAgICAgICAge2RCZXRhW119LCBbcEJldGFdCi0gICAgICAgIEFERCAgICAgICAgIHBUaHJlc2hvbGRzLCBwVGhyZXNob2xkcywgIzQKLSAgICAgICAgQk5FICAgICAgICAgTG9vcFkgICAgICAgIAotCi0gICAgICAgIE1PViAgICAgICAgIHIwLCAjT01YX1N0c19Ob0VycgotICAgICAgICBNX0VORAotICAgICAgICAKLSAgICAgICAgRU5ESUYKLSAgICAgICAgCi0KLSAgICAgICAgRU5ECi0gICAgICAgIAotICAgICAgICAKZGlmZiAtLWdpdCBh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HICAgcHBCUywgNAotICAgICAgICAKLSAgICAgICAgOy8vIGQwLWRBbHBoYV8wCi0gICAgICAgIDsvLyBkMi1kQmV0YV8wCi0KLSAgICAgICAgO2xvYWQgYWxwaGExLGJldGExIHNvbWV3aGVyZSB0byBhdm9pZCBtb3JlIGxvYWRzCi0gICAgICAgIFZMRDEgICAgICAgIHtkQWxwaGFbXX0sIFtwQWxwaGFdIQotICAgICAgICBTVUIgICAgICAgICBwU3JjRHN0LCBwU3JjRHN0LCAjNAotICAgICAgICBWTEQxICAgICAgICB7ZEJldGFbXX0sIFtwQmV0YV0hIAotICAgICAgICAKLSAgICAgICAgTV9MRFIgICAgICAgcEJTLCBwcEJTCi0gICAgICAgIE1fTERSICAgICAgIHBUaHJlc2hvbGRzLCBwcFRocmVzaG9sZHMgCi0KLSAgICAgICAgTERSICAgICAgICAgTWFza180LCA9TUFTS180Ci0gICAgICAgIExEUiAgICAgICAgIE1hc2tfMywgPU1BU0tfMwotCi0gICAgICAgIDtkTWFza18wLTE0Ci0gICAgICAgIDtkTWFza18xLTE1Ci0gICAgICAgIDtkTWFza180LTE5Ci0KLSAgICAgICAgVk1PViAgICAgICAgZE1hc2tfMCwgIzAgICAgIAotICAgICAgICBWTU9WICAgICAgICBkTWFza18xLCAjMSAgICAgCi0gICAgICAgIFZNT1YgICAgICAgIGRNYXNrXzQsICM0ICAgICAKLSAgICAgICAgCi0gICAgICAgIExEUiAgICAgICAgIFhZLCA9TE9PUF9DT1VOVAotCi0gICAgICAgIDsvLyBwMC1wMyAtIGQ0LWQ3Ci0gICAgICAgIDsvLyBxMC1xMyAtIGQ4LWQxMQotCi0KLUxvb3BZICAgICAgICAKLSAgICAgICAgTERSICAgICAgICAgYlMzMjEwLCBbcEJTXSwgIzgKLSAgICAgICAgQUREICAgICAgICAgcFRtcCwgcFNyY0RzdCwgc3JjZHN0U3RlcAotICAgICAgICBBREQgICAgICAgICBzdGVwLCBzcmNkc3RTdGVwLCBzcmNkc3RTdGVwCi0g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gICAgICA7Ly8gZFJvdzcgPSBbcTNyNyBxMnI3IHExcjcgcTByNyBwMHI3IHAxcjcgcDJyNyBwM3I3XQotCi0gICAgICAgIDsvLyA4eDggVHJhbnNwb3NlCi0gICAgICAgIFZaSVAuOCAgICAgIGRSb3cwLCBkUm93MQotICAgICAgICBWWklQLjggICAgICBkUm93MiwgZFJvdzMKLSAgICAgICAgVlpJUC44ICAgICAgZFJvdzQsIGRSb3c1Ci0gICAgICAgIFZaSVAuOCAgICAgIGRSb3c2LCBkUm93NwotCi0gICAgICAgIFZaSVAuMTYgICAgIGRSb3cwLCBkUm93MgotICAgICAgICBWWklQLjE2ICAgICBkUm93MSwgZFJvdzMKLSAgICAgICAgVlpJUC4xNiAgICAgZFJvdzQsIGRSb3c2Ci0gICAgICAgIFZaSVAuMTYgICAgIGRSb3c1LCBkUm93NwotCi0gICAgICAgIFZaSVAuMzIgICAgIGRSb3cwLCBkUm93NAotICAgICAgICBWWklQLjMyICAgICBkUm93MiwgZFJvdzYKLSAgICAgICAgVlpJUC4zMiAgICAgZFJvdzMsIGRSb3c3Ci0gICAgICAgIFZaSVAuMzIgICAgIGRSb3cxLCBkUm93NQotCi0KLSAgICAgICAgO1JlYWxpZ24gdGhlIHBvaW50ZXJzCi0KLSAgICAgICAgQ01QICAgICAgICAgYlMzMjEwLCAjMAotICAgICAgICBWQUJEICAgICAgICBkQXAycDAsIGRQXzIsIGRQXzAKLSAgICAgICAgVkFCRCAgICAgICAgZEFwMHEwLCBkUF8wLCBkUV8wCi0gICAgICAgIEJFUSAgICAgICAgIE5vRmlsdGVyQlMwCi0KLSAgICAgICAgVkFCRCAgICAgICAgZEFwMXAwLCBkUF8xLCBkUF8wCi0gICAgICAgIFZBQkQgICAgICAgIGRBcTFxMCwgZFFfMSwgZFFfMAotCi0gICAgICAgIFZNT1YuVTMyICAgIGRCUzMyMTBbMF0sIGJTMzIxMAotICAgICAgICBWQ0dUICAgICAgICBkRmlsdCwgZEFscGhhLCBkQXAwcTAKLSAgICAgICAgVk1BWCAgICAgICAgZEFwMXAwLCBkQXExcTAsIGRBcDFwMAotICAgICAgICBWTU9WTCAgICAgICBxQlMzMjEwLCBkQlMzMjEwLlU4Ci0gICAgICAgIFZBQkQgICAgICAgIGRBcTJxMCwgZFFfMiwgZFFfMAotICAgICAgICBWQ0dUICAgICAgICBkTWFza19icy5TMTYsIGRCUzMyMTAuUzE2LCAjMAotCi0gICAgICAgIFZDR1QgICAgICAgIGRBcDFwMCwgZEJldGEsIGRBcDFwMAotICAgICAgICBWQ0dUICAgICAgICBkQXAycDAsIGRCZXRhLCBkQXAycDAKLSAgICAgICAgVkFORCAgICAgICAgZEZpbHQsIGRNYXNrX2JzLlU4Ci0KLSAgICAgICAgVFNUICAgICAgICAgYlMzMjEwLCBNYXNrXzMKLQotICAgICAgICBWQ0dUICAgICAgICBkQXEycTAsIGRCZXRhLCBkQXEycTAKLSAgICAgICAgVkFORCAgICAgICAgZEZpbHQsIGRGaWx0LCBkQXAxcDAKLQotICAgICAgICBWQU5EICAgICAgICBkQXFmbGcsIGRGaWx0LCBkQXEycTAKLSAgICAgICAgVkFORCAgICAgICAgZEFwZmxnLCBkRmlsdCwgZEFwMnAwCi0KLSAgICAgICAgOy8vIGJTIDwgNCBGaWx0ZXJpbmcKLSAgICAgICAgQkxORSAgICAgICAgYXJtVkNNNFAxMF9EZWJsb2NraW5nQ2hyb21hYlNMVDRfdW5zYWZlCi0KLSAgICAgICAgVFNUICAgICAgICAgYlMzMjEwLCBNYXNrXzQgICAgICAgIAotCi0gICAgICAgIFNVQiAgICAgICAgIHBTcmNEc3QsIHBTcmNEc3QsIHNyY2RzdFN0ZXAsIExTTCAjMwotICAgICAgICBWVFNUICAgICAgICBkRmlsdF9icywgZEZpbHRfYnMsIGRNYXNrXzQKLQotICAgICAgICA7Ly8gYlMgPT0gNCBGaWx0ZXJpbmcKLSAgICAgICAgQkxORSAgICAgICAgYXJtVkNNNFAxMF9EZWJsb2NraW5nQ2hyb21hYlNHRTRfdW5zYWZlCi0KLSAgICAgICAgVkJJVCAgICAgICAgZFBfMG4sIGRQXzB0LCBkRmlsdF9icwotICAgICAgICBWQklUICAgICAgICBkUV8wbiwgZFFfMHQsIGRGaWx0X2JzCi0KLSAgICAgICAgOy8vIFJlc3VsdCBTdG9yYWdlCi0gICAgICAgIEFERCAgICAgICAgIHBTcmNEc3RfUCwgcFNyY0RzdCwgIzMKLSAgICAgICAgVkJJRiAgICAgICAgZFBfMG4sIGRQXzAsIGRGaWx0ICAgICAgCi0gICAgICAgIAotICAgICAgICBBREQgICAgICAgICBwVG1wMiwgcFNyY0RzdF9QLCBzcmNkc3RTdGVwCi0gICAgICAgIEFERCAgICAgICAgIHN0ZXAsIHNyY2RzdFN0ZXAsIHNyY2RzdFN0ZXAKLSAgICAgICAgVkJJRiAgICAgICAgZFFfMG4sIGRRXzAsIGRGaWx0ICAKLQotICAgICAgICBBRERTICAgICAgICBYWSwgWFksIFhZCi0gICAgICAgIAotICAgICAgICBWU1QxICAgICAgICB7ZFBfMG5bMF19LCBbcFNyY0RzdF9QXSwgc3RlcAotICAgICAgICBWU1QxICAgICAgICB7ZFBfMG5bMV19LCBbcFRtcDJdLCBzdGVwCi0gICAgICAgIFZTVDEgICAgICAgIHtkUF8wblsyXX0sIFtwU3JjRHN0X1BdLCBzdGVwCi0gICAgICAgIFZTVDEgICAgICAgIHtkUF8wblszXX0sIFtwVG1wMl0sIHN0ZXAKLSAgICAgICAgVlNUMSAgICAgICAge2RQXzBuWzRdfSwgW3BTcmNEc3RfUF0sIHN0ZXAKLSAgICAgICAgVlNUMSAgICAgICAge2RQXzBuWzVdfSwgW3BUbXAyXSwgc3RlcAotICAgICAgICBWU1QxICAgICAgICB7ZFBfMG5bNl19LCBbcFNyY0RzdF9QXSwgc3RlcAotICAgICAgICBWU1QxICAgICAgICB7ZFBfMG5bN119LCBbcFRtcDJdLCBzdGVwCi0gICAgICAgIAotICAgICAgICBBREQgICAgICAgICBwU3JjRHN0X1EsIHBTcmNEc3QsICM0Ci0gICAgICAgIEFERCAgICAgICAgIHBUbXAsIHBTcmNEc3RfUSwgc3JjZHN0U3RlcAotICAgICAgICAKLSAgICAgICAgVlNUMSAgICAgICAge2RRXzBuWzBdfSwgW3BTcmNEc3RfUV0sIHN0ZXAKLSAgICAgICAgVlNUMSAgICAgICAge2RRXzBuWzFdfSwgW3BUbXBdLCBzdGVwCi0gICAgICAgIFZTVDEgICAgICAgIHtkUV8wblsyXX0sIFtwU3JjRHN0X1FdLCBzdGVwCi0gICAgICAgIFZTVDEgICAgICAgIHtkUV8wblszXX0sIFtwVG1wXSwgc3RlcAotICAgICAgICBWU1QxICAgICAgICB7ZFFfMG5bNF19LCBbcFNyY0RzdF9RXSwgc3RlcAotICAgICAgICBWU1QxICAgICAgICB7ZFFfMG5bNV19LCBbcFRtcF0sIHN0ZXAKLSAgICAgICAgVlNUMSAgICAgICAge2RRXzBuWzZdfSwgW3BTcmNEc3RfUV0sIHN0ZXAKLSAgICAgICAgVlNUMSAgICAgICAge2RRXzBuWzddfSwgW3BUbXBdLCBzdGVwCi0gICAgICAgIAotICAgICAgICBBREQgICAgICAgICBwU3JjRHN0LCBwU3JjRHN0LCAjNAotCi0gICAgICAgIEJORSAgICAgICAgIExvb3BZICAgICAgICAKLSAgICAgICAgCi0gICAgICAgIE1PViAgICAgICAgIHIwLCAjT01YX1N0c19Ob0VycgotICAgICAgICAKLSAgICAgICAgTV9FWElUCi0gICAgICAgIAotTm9GaWx0ZXJCUzAKLSAgICAgICAgVkxEMSAgICAgICAge2RBbHBoYVtdfSwgW3BBbHBoYV0KLSAgICAgICAgQUREICAgICAgICAgcFNyY0RzdCwgcFNyY0RzdCwgIzQKLSAgICAgICAgU1VCICAgICAgICAgcFNyY0RzdCwgcFNyY0RzdCwgc3JjZHN0U3RlcCwgTFNMICMzCi0gICAgICAgIEFERFMgICAgICAgIFhZLCBYWSwgWFkKLSAgICAgICAgVkxEMSAgICAgICAge2RCZXRhW119LCBbcEJ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MC5VOCAKLWRRXzMgICAgICAgIEROIEQxMS5VOCAKLQotCi07Ly8gRmlsdGVyaW5nIERlY2lzaW9uCi1kQWxwaGEgICAgICBETiBEMC5VOAotZEJldGEgICAgICAgRE4gRDIuVTgKLQotZEZpbHQgICAgICAgRE4gRDE2LlU4Ci1kQXFmbGcgICAgICBETiBEMTIuVTgKLWRBcGZsZyAgICAgIEROIEQxNy5VOCAKLQotZEFwMHEwICAgICAgRE4gRDEzLlU4Ci1kQXAxcDAgICAgICBETiBEMTIuVTgKLWRBcTFxMCAgICAgIEROIEQxOC5VOAotZEFwMnAwICAgICAgRE4gRDE5LlU4Ci1kQXEycTAgICAgICBETiBEMTcuVTgKLQotOy8vIGJTTFQ0Ci1kVEMwICAgICAgICBETiBEMTguVTggICAKLWRUQzEgICAgICAgIEROIEQxOS5VOCAgIAotZFRDMDEgICAgICAgRE4gRDE4LlU4ICAgCi0KLWRUQ3MgICAgICAgIEROIEQzMS5TOAotZFRDICAgICAgICAgRE4gRDMxLlU4Ci0KLWRNYXNrXzAgICAgIEROIEQxNC5VOAotZE1hc2tfMSAgICAgRE4gRDE1LlU4ICAgIAotCi1NYXNrXzAgICAgICBSTiAxMQotCi1kVGVtcCAgICAgICBETiBEMTkuVTgKLQotOy8vIENvbXB1dGluZyBQMCxRMAotcURxMHAwICAgICAgUU4gUTEwLlMxNgotcURwMXExICAgICAgUU4gUTExLlMxNgotcURlbHRhICAgICAgUU4gUTEwLlMxNiAgOyByZXVzZSBxRHEwcDAKLWREZWx0YSAgICAgIEROIEQyMC5TOAotCi0KLTsvLyBDb21wdXRpbmcgUDEsUTEKLWRScDBxMCAgICAgIEROIEQyNC5VOAotCi1kTWF4UCAgICAgICBETiBEMjMuVTgKLWRNaW5QICAgICAgIEROIEQyMi5VOAotCi1kTWF4USAgICAgICBETiBEMTkuVTgKLWRNaW5RICAgICAgIEROIEQyMS5VOAotCi1kRGVsdGFQICAgICBETiBEMjYuVTgKLWREZWx0YVEgICAgIEROIEQyNy5VOAotCi1xUF8wbiAgICAgICBRTiBRMTQuUzE2Ci1xUV8wbiAgICAgICBRTiBRMTIuUzE2Ci0KLWRRXzBuICAgICAgIEROIEQyNC5VOAotZFFfMW4gICAgICAgRE4gRDI1LlU4Ci1kUF8wbiAgICAgICBETiBEMjkuVTgKLWRQXzFuICAgICAgIEROIEQzMC5VOAotCi07Ly8gYlNHRTQKLQotcVNwMHEwICAgICAgUU4gUTEwLlUxNgotCi1xU3AycTEgICAgICBRTiBRMTEuVTE2Ci1xU3AwcTBwMSAgICBRTiBRMTIuVTE2Ci1xU3AzcDIgICAgICBRTiBRMTMuVTE2Ci1kSFNwMHExICAgICBETiBEMjguVTgKLQotcVNxMnAxICAgICAgUU4gUTExLlUxNgotcVNwMHEwcTEgICAgUU4gUTEyLlUxNgotcVNxM3EyICAgICAgUU4gUTEzLlUxNiAgOyEhCi1kSFNxMHAxICAgICBETiBEMjguVTggICA7ISEKLQotcVRlbXAxICAgICAgUU4gUTExLlUxNiAgOyEhO3FTcDJxMSAKLXFUZW1wMiAgICAgIFFOIFExMi5VMTYgIDshITtxU3AwcTBwMSAgICAgICAgCi0KLWRQXzB0ICAgICAgIEROIEQyOC5VOCAgIDshITtkSFNwMHExICAgICAgICAKLWRRXzB0ICAgICAgIEROIEQyMi5VOCAgIDshITtUZW1wMSAgICAgICAgCi0KLWRQXzBuICAgICAgIEROIEQyOS5VOAotZFBfMW4gICAgICAgRE4gRDMwLlU4Ci1kUF8ybiAgICAgICBETiBEMzEuVTgKLQotZFFfMG4gICAgICAgRE4gRDI0LlU4ICAgOyEhO1RlbXAyICAgICAgICAKLWRRXzFuICAgICAgIEROIEQyNS5VOCAgIDshITtUZW1wMiAgICAgICAgCi1kUV8ybiAgICAgICBETiBEMjguVTggICA7ISE7ZFFfMHQgICAgICAgIAotCi0gICAgICAgIAotICAgICAgICA7Ly8gRnVuY3Rpb24gaGVhZGVyCi0gICAgICAgIE1fU1RBUlQgb214VkNNNFAxMF9GaWx0ZXJEZWJsb2NraW5nTHVtYV9Ib3JFZGdlX0ksIHIxMSwgZDE1Ci0gICAgICAgIAotICAgICAgICA7Ly9Bcmd1bWVudHMgb24gdGhlIHN0YWNrCi0gICAgICAgIE1fQVJHICAgcHBUaHJlc2hvbGRzLCA0Ci0gICAgICAgIE1fQVJHICAgcHBCUywgNAotICAgICAgICAKLSAgICAgICAgOy8vIGQwLWRBbHBoYV8wCi0gICAgICAgIDsvLyBkMi1kQmV0YV8wCi0KLSAgICAgICAgQUREICAgICAgICAgcEFscGhhXzEsIHBBbHBoYV8wLCAjMQotICAgICAgICBBREQgICAgICAgICBwQmV0YV8xLCBwQmV0YV8wLCAjMQotICAgICAgICAKLSAgICAgICAgVkxEMSAgICAgICAge2RBbHBoYVtdfSwgW3BBbHBoYV8wXQotICAgICAgICBTVUIgICAgICAgICBwU3JjRHN0LCBwU3JjRHN0LCBzcmNkc3RTdGVwLCBMU0wgIzIKLSAgICAgICAgVkxEMSAgICAgICAge2RCZXRhW119LCBbcEJldGFfMF0gCi0gICAgICAgIAotICAgICAgICBNX0xEUiAgICAgICBwQlMsIHBwQlMKLSAgICAgICAgTV9MRFIgICAgICAgcFRocmVzaG9sZHMsIHBwVGhyZXNob2xkcyAKLQotICAgICAgICBNT1YgICAgICAgICBNYXNrXzAsIzAKLQotICAgICAgICA7ZE1hc2tfMC0xNAotICAgICAgICA7ZE1hc2tfMS0xNQotCi0gICAgICAgIFZNT1YgICAgICAgIGRNYXNrXzAsICMwICAgICAKLSAgICAgICAgVk1PViAgICAgICAgZE1hc2tfMSwgIzEgICAgIAotICAgICAgICAKLSAgICAgICAgQUREICAgICAgICAgc3RlcCwgc3JjZHN0U3RlcCwgc3JjZHN0U3RlcAotCi0gICAgICAgIExEUiAgICAgICAgIFhZLD1MT09QX0NPVU5UCi0KLSAgICAgICAgOy8vIHAwLXAzIC0gZDQtZDcKLSAgICAgICAgOy8vIHEwLXEzIC0gZDgtZDExCi1Mb29wWSAgICAgICAgCi1Mb29wWCAgICAgICAgCi0gICAgICAgIExEUkggICAgICAgIGJTMTAsIFtwQlNdLCAjMgotICAgICAgICBBREQgICAgICAgICBwVG1wLCBwU3JjRHN0LCBzcmNkc3RTdGVwCi0gICAgICAgIENNUCAgICAgICAgIGJTMTAsICMwCi0gICAgICAgIEJFUSAgICAgICAgIE5vRmlsdGVyQlMwCi0KLSAgICAgICAgVkxEMSAgICAgICAgZFBfMywgW3BTcmNEc3RdLCBzdGVwCi0gICAgICAgIFZMRDEgICAgICAgIGRQXzIsIFtwVG1wXSwgc3RlcAotICAgICAgICBWTEQxICAgICAgICBkUF8xLCBbcFNyY0RzdF0sIHN0ZXAKLSAgICAgICAgVkxEMSAgICAgICAgZFBfMCwgW3BUbXBdLCBzdGVwCi0gICAgICAgIFZMRDEgICAgICAgIGRRXzAsIFtwU3JjRHN0XSwgc3RlcAotICAgICAgICBWQUJEICAgICAgICBkQXAxcDAsIGRQXzAsIGRQXzEKLSAgICAgICAgVkxEMSAgICAgICAgZFFfMSwgW3BUbXBdCi0gICAgICAgIFZBQkQgICAgICAgIGRBcDBxMCwgZFFfMCwgZFBfMAotICAgICAgICBWTEQxICAgICAgICBkUV8yLCBbcFNyY0RzdF0sIHNyY2RzdFN0ZXAKLSAgICAgICAgCi0gICAgICAgIFZBQkQgICAgICAgIGRBcTFxMCwgZFFfMSwgZFFfMAotICAgICAgICBWQUJEICAgICAgICBkQXAycDAsIGRQXzIsIGRQXzAKLSAgICAgICAgVkNHVCAgICAgICAgZEZpbHQsIGRBbHBoYSwgZEFwMHEwCi0KLSAgICAgICAgVFNUICAgICAgICAgYlMxMCwgIzB4ZmYKLSAgICAgICAgVk1BWCAgICAgICAgZEFwMXAwLCBkQXExcTAsIGRBcDFwMAotICAgICAgICBWQUJEICAgICAgICBkQXEycTAsIGRRXzIsIGRRXzAKLQotICAgICAgICBWTU9WRVEuVTMyICBkRmlsdFswXSwgTWFza18wCi0gICAgICAgIFRTVCAgICAgICAgIGJTMTAsICMweGZmMDAKLQotICAgICAgICBWQ0dUICAgICAgICBkQXAycDAsIGRCZXRhLCBkQXAycDAKLSAgICAgICAgVkNHVCAgICAgICAgZEFwMXAwLCBkQmV0YSwgZEFwMXAwCi0KLSAgICAgICAgVk1PVkVRLlUzMiAgZEZpbHRbMV0sIE1hc2tfMAotCi0gICAgICAgIFZDR1QgICAgICAgIGRBcTJxMCwgZEJldGEsIGRBcTJxMAotICAgICAgICBWTEQxICAgICAgICBkUV8zLCBbcFNyY0RzdF0KLSAgICAgICAgVkFORCAgICAgICAgZEZpbHQsIGRGaWx0LCBkQXAxcDAKLSAgICAgICAgVFNUICAgICAgICAgYlMxMCwgIzQgCi0KLSAgICAgICAgVkFORCAgICAgICAgZEFxZmxnLCBkRmlsdCwgZEFxMnEwCi0gICAgICAgIFZBTkQgICAgICAgIGRBcGZsZywgZEZpbHQsIGRBcDJwMAotICAgIAotICAgICAgICBCTkUgICAgICAgICBiU0dFNCAgICAgICAgCi1iU0xUNAotICAgICAgICA7Ly8gYlMgPCA0IEZpbHRlcmluZwotICAgICAgICBTVUIgICAgICAgICBwU3JjRHN0LCBwU3JjRHN0LCBzcmNkc3RTdGVwLCBMU0wgIzIKLSAgICAgICAgU1VCICAgICAgICAgcFNyY0RzdCwgcFNyY0RzdCwgc3JjZHN0U3RlcAotCi0gICAgICAgIEJMICAgICAgICAgIGFybVZDTTRQMTBfRGVibG9ja2luZ0x1bWFiU0xUNF91bnNhZmUKLQotICAgICAgICA7Ly8gUmVzdWx0IFN0b3JhZ2UKLSAgICAgICAgVlNUMSAgICAgICAgZFBfMW4sIFtwU3JjRHN0XSwgc3JjZHN0U3RlcAotICAgICAgICBWU1QxICAgICAgICBkUF8wbiwgW3BTcmNEc3RdLCBzcmNkc3RTdGVwCi0gICAgICAgIFNVQiAgICAgICAgIHBUbXAsIHBTcmNEc3QsIHNyY2RzdFN0ZXAsIExTTCAjMgotICAgICAgICBWU1QxICAgICAgICBkUV8wbiwgW3BTcmNEc3RdLCBzcmNkc3RTdGVwCi0gICAgICAgIEFERFMgICAgICAgIFhZLCBYWSwgWFkKLSAgICAgICAgVlNUMSAgICAgICAgZFFfMW4sIFtwU3JjRHN0XQotICAgICAgICBBREQgICAgICAgICBwU3JjRHN0LCBwVG1wLCAjOAotCi0gICAgICAgIEJDQyAgICAgICAgIExvb3BYCi0gICAgICAgIEIgICAgICAgICAgIEV4aXRMb29wWSAgICAgICAgCi0KLU5vRmlsdGVyQlMwCi0gICAgICAgIEFERCAgICAgICAgIHBTcmNEc3QsIHBTcmNEc3QsICM4Ci0gICAgICAgIEFERFMgICAgICAgIFhZLCBYWSwgWFkKLSAgICAgICAgQUREICAgICAgICAgcFRocmVzaG9sZHMsIHBUaHJlc2hvbGRzLCAjMgotICAgICAgICBCQ0MgICAgICAgICBMb29wWAotICAgICAgICBCICAgICAgICAgICBFeGl0TG9vcFkgICAgICAgIAotYlNHRTQgICAgICAgIAotICAgICAgICA7Ly8gYlMgPj0gNCBGaWx0ZXJpbmcKLSAgICAgICAgU1VCICAgICAgICAgcFNyY0RzdCwgcFNyY0RzdCwgc3JjZHN0U3RlcCwgTFNMICMyCi0gICAgICAgIFNVQiAgICAgICAgIHBTcmNEc3QsIHBTcmNEc3QsIHNyY2RzdFN0ZXAsIExTTCAjMQotICAgICAgICBCTCAgICAgICAgICBhcm1WQ000UDEwX0RlYmxvY2tpbmdMdW1hYlNHRTRfdW5zYWZlCi0KLSAgICAgICAgOy8vIFJlc3VsdCBTdG9yYWdlCi0gICAgICAgIFZTVDEgICAgICAgIGRQXzJuLCBbcFNyY0RzdF0sIHNyY2RzdFN0ZXAKLSAgICAgICAgVlNUMSAgICAgICAgZFBfMW4sIFtwU3JjRHN0XSwgc3JjZHN0U3RlcAotICAgICAgICBWU1QxICAgICAgICBkUF8wbiwgW3BTcmNEc3RdLCBzcmNkc3RTdGVwCi0gICAgICAgIFNVQiAgICAgICAgIHBUbXAsIHBTcmNEc3QsIHNyY2RzdFN0ZXAsIExTTCAjMgotICAgICAgICBWU1QxICAgICAgICBkUV8wbiwgW3BTcmNEc3RdLCBzcmNkc3RTdGVwCi0gICAgICAgIEFERFMgICAgICAgIFhZLFhZLFhZCi0gICAgICAgIFZTVDEgICAgICAgIGRRXzFuLCBbcFNyY0RzdF0sIHNyY2RzdFN0ZXAKLSAgICAgICAgQUREICAgICAgICAgcFRocmVzaG9sZHMsIHBUaHJlc2hvbGRzLCAjMgotICAgICAgICBWU1QxICAgICAgICBkUV8ybiwgW3BTcmNEc3RdCi0gICAgICAgIAotICAgICAgICBBREQgICAgICAgICBwU3JjRHN0LCBwVG1wLCAjOAotICAgICAgICBCQ0MgICAgICAgICBMb29wWAotCi1FeGl0TG9vcFkgICAgICAgIAotCi0gICAgICAgIFNVQiAgICAgICAgIHBTcmNEc3QsIHBTcmNEc3QsICMxNgotICAgICAgICBWTEQxICAgICAgICB7ZEFscGhhW119LCBbcEFscGhhXzFdCi0gICAgICAgIEFERCAgICAgICAgIHBTcmNEc3QsIHBTcmNEc3QsIHNyY2RzdFN0ZXAsIExTTCAjMiAKLSAgICAgICAgVkxEMSAgICAgICAge2RCZXRhW119LCBbcEJldGFfMV0KLSAgICAgICAgQk5FICAgICAgICAgTG9vcFkKLQotICAgICAgICBNT1YgICAgICAgICByMCwgI09NWF9TdHNfTm9FcnIKLQotICAgICAgICBNX0VORAotICAgICAgICAKLSAgICBFTkRJRgotICAgIAotCi0gICAgICAgIAotCi0gICAgICAgIEVORAotICAgICAgICAKLSAgICAgICAgCmRpZmYgLS1naXQgYS9tZWRpYS9saWJzdGFnZWZyaWdodC9jb2RlY3Mvb24yL2gyNjRkZWMvb214ZGwvYXJtX25lb24vdmMvbTRwMTAvc3JjL29teFZDTTRQMTBfRmlsdGVyRGVibG9ja2luZ0x1bWFfVmVyRWRnZV9JX3MucyBiL21lZGlhL2xpYnN0YWdlZnJpZ2h0L2NvZGVjcy9vbjIvaDI2NGRlYy9vbXhkbC9hcm1fbmVvbi92Yy9tNHAxMC9zcmMvb214VkNNNFAxM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XzJuICAgICAgIEROIEQzMS5VOAotOy8vIAotOy8vIGRRXzBuICAgICAgIEROIEQyNC5VOCAgIDshITtUZW1wMiAgICAgICAgCi07Ly8gZFFfMW4gICAgICAgRE4gRDI1LlU4ICAgOyEhO1RlbXAyICAgICAgICAKLTsvLyBkUV8ybiAgICAgICBETiBEMjguVTggICA7ISE7ZFFfMHQgICAgICAgIAotOy8vIAotOy8vIGRSb3duMCAtIGRQXzMsICBkUm93bjEgLSBkUV8wbgotOy8vIGRSb3duMiAtIGRQXzFuLCBkUm93bjMgLSBkUV8yCi07Ly8gZFJvd240IC0gZFBfMiwgIGRSb3duNSAtIGRRXzFuCi07Ly8gZFJvd242IC0gZFBfMG4sIGRSb3duNyAtIGRRXzMKLQotZFJvdzBuICAgICAgRE4gRDcuVTgKLWRSb3cxbiAgICAgIEROIEQyNC5VOAotZFJvdzJuICAgICAgRE4gRDMwLlU4Ci1kUm93M24gICAgICBETiBEMjguVTgKLWRSb3c0biAgICAgIEROIEQzMS5VOAotZFJvdzVuICAgICAgRE4gRDI1LlU4Ci1kUm93Nm4gICAgICBETiBEMjkuVTgKLWRSb3c3biAgICAgIEROIEQxMS5VOAotCi07Ly8gZFJvdzBuIC0gZFBfMywgZFJvdzFuIC0gZFFfMG4sIGRSb3cybiAtIGRQXzFuLCBkUm93M24gLSBkUV8ybgotOy8vIGRSb3c0biAtIGRQXzIsIGRSb3c1biAtIGRRXzFuLCBkUm93Nm4gLSBkUF8wbiwgZFJvdzduIC0gZFFfMwotCi07Ly8gUGl4ZWxzCi1kUF8wICAgICAgICBETiBENC5VOAotZFBfMSAgICAgICAgRE4gRDUuVTggIAotZFBfMiAgICAgICAgRE4gRDYuVTggIAotZFBfMyAgICAgICAgRE4gRDcuVTggIAotZFFfMCAgICAgICAgRE4gRDguVTggIAotZFFfMSAgICAgICAgRE4gRDkuVTggIAotZFFfMiAgICAgICAgRE4gRDEwLlU4IAotZFFfMyAgICAgICAgRE4gRDExLlU4IAotCi0KLTsvL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EsIGQxNQotICAgICAgICAKLSAgICAgICAgOy8vQXJndW1lbnRzIG9uIHRoZSBzdGFjawotICAgICAgICBNX0FSRyAgIHBwVGhyZXNob2xkcywgNAotICAgICAgICBNX0FSRyAgIHBwQlMsIDQKLSAgICAgICAgCi0gICAgICAgIDsvLyBkMC1kQWxwaGFfMAotICAgICAgICA7Ly8gZDItZEJldGFfMAotCi0gICAgICAgIEFERCAgICAgICAgIHBBbHBoYV8xLCBwQWxwaGFfMCwgIzEKLSAgICAgICAgQUREICAgICAgICAgcEJldGFfMSwgcEJldGFfMCwgIzEKLSAgICAgICAgCi0gICAgICAgIFZMRDEgICAgICAgIHtkQWxwaGFbXX0sIFtwQWxwaGFfMF0KLSAgICAgICAgU1VCICAgICAgICAgcFNyY0RzdCwgcFNyY0RzdCwgIzQKLSAgICAgICAgVkxEMSAgICAgICAge2RCZXRhW119LCBbcEJldGFfMF0gCi0gICAgICAgIAotICAgICAgICBNX0xEUiAgICAgICBwQlMsIHBwQlMKLSAgICAgICAgTV9MRFIgICAgICAgcFRocmVzaG9sZHMsIHBwVGhyZXNob2xkcyAKLQotICAgICAgICBNT1YgICAgICAgICBNYXNrXzAsIzAKLQotICAgICAgICA7ZE1hc2tfMC0xNAotICAgICAgICA7ZE1hc2tfMS0xNQotCi0gICAgICAgIFZNT1YgICAgICAgIGRNYXNrXzAsICMwICAgICAKLSAgICAgICAgVk1PViAgICAgICAgZE1hc2tfMSwgIzEgICAgIAotCi0gICAgICAgIExEUiAgICAgICAgIFhZLD1MT09QX0NPVU5UCi0gICAgCi0gICAgICAgIEFERCAgICAgICAgIHBUbXBTdGVwLCBzcmNkc3RTdGVwLCBzcmNkc3RTdGVwCi0KLSAgICAgICAgOy8vIHAwLXAzIC0gZDQtZDcKLSAgICAgICAgOy8vIHEwLXEzIC0gZDgtZDExCi1Mb29wWSAgICAgICAgCi1Mb29wWCAgICAgICAgCi0gICAgICAgIExEUkggICAgICAgIGJTMTAsIFtwQlNdLCAjNAotCi0gICAgICAgIENNUCAgICAgICAgIGJTMTAsICMwCi0gICAgICAgIEJFUSAgICAgICAgIE5vRmlsdGVyQlMwCi0KLSAgICAgICAgOy8vIExvYWQgOCByb3dzIG9mIGRhdGEKLSAgICAgICAgQUREICAgICAgICAgcFRtcCwgcFNyY0RzdCwgc3JjZHN0U3RlcAotICAgICAgICBWTEQxICAgICAgICBkUm93MCwgW3BTcmNEc3RdLCBwVG1wU3RlcAotICAgICAgICBWTEQxICAgICAgICBkUm93MSwgW3BUbXBdLCBwVG1wU3RlcAotICAgICAgICBWTEQxICAgICAgICBkUm93MiwgW3BTcmNEc3RdLCBwVG1wU3RlcAotICAgICAgICBWWklQLjggICAgICBkUm93MCwgZFJvdzEKLSAgICAgICAgVkxEMSAgICAgICAgZFJvdzMsIFtwVG1wXSwgcFRtcFN0ZXAKLSAgICAgICAgVkxEMSAgICAgICAgZFJvdzQsIFtwU3JjRHN0XSwgcFRtcFN0ZXAKLSAgICAgICAgVlpJUC44ICAgICAgZFJvdzIsIGRSb3czCi0gICAgICAgIFZMRDEgICAgICAgIGRSb3c1LCBbcFRtcF0sIHBUbXBTdGVwCi0gICAgICAgIFZMRDEgICAgICAgIGRSb3c2LCBbcFNyY0RzdF0sIHBUbXBTdGVwCi0gICAgICAgIFZMRDEgICAgICAgIGRSb3c3LCBbcFRtcF0sIHBUbXBTdGVwCi0gICAgICAgIFZaSVAuOCAgICAgIGRSb3c0LCBkUm93NQotICAgICAgICBWWklQLjE2ICAgICBkUm93MSwgZFJvdzMKLSAgICAKLQotICAgICAgICA7Ly8gZFJvdzAgPSBbcTNyMCBxMnIwIHExcjAgcTByMCBwMHIwIHAxcjAgcDJyMCBwM3IwXQotICAgICAgICA7Ly8gZFJvdzEgPSBbcTNyMSBxMnIxIHExcjEgcTByMSBwMHIxIHAxcjEgcDJyMSBwM3IxXQotICAgICAgICA7Ly8gZFJvdzIgPSBbcTNyMiBxMnIyIHExcjIgcTByMiBwMHIyIHAxcjIgcDJyMiBwM3I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JxMCwgZFFfMiwgZFFfMAotCi0gICAgICAgIFZNT1ZFUS5VMzIgIGRGaWx0WzBdLCBNYXNrXzAKLSAgICAgICAgVFNUICAgICAgICAgYlMxMCwgIzB4ZmYwMAotCi0gICAgICAgIFZDR1QgICAgICAgIGRBcDJwMCwgZEJldGEsIGRBcDJwMAotICAgICAgICBWQ0dUICAgICAgICBkQXAxcDAsIGRCZXRhLCBkQXAxcDAKLQotICAgICAgICBWTU9WRVEuVTMyICBkRmlsdFsxXSwgTWFza18wCi0KLSAgICAgICAgVkNHVCAgICAgICAgZEFxMnEwLCBkQmV0YSwgZEFxMnEwCi0gICAgICAgIFZBTkQgICAgICAgIGRGaWx0LCBkRmlsdCwgZEFwMXAwCi0gICAgICAgIFRTVCAgICAgICAgIGJTMTAsICM0IAotCi0gICAgICAgIFZBTkQgICAgICAgIGRBcWZsZywgZEZpbHQsIGRBcTJxMAotICAgICAgICBWQU5EICAgICAgICBkQXBmbGcsIGRGaWx0LCBkQXAycDAKLSAgICAKLSAgICAgICAgQk5FICAgICAgICAgYlNHRTQgICAgICAgIAotYlNMVDQKLSAgICAgICAgOy8vIGJTIDwgNCBGaWx0ZXJpbmcKLQotICAgICAgICBCTCAgICAgICAgICBhcm1WQ000UDEwX0RlYmxvY2tpbmdMdW1hYlNMVDRfdW5zYWZlCi0KLSAgICAgICAgOy8vIFRyYW5zcG9zZQotCi0gICAgICAgIFZaSVAuOCAgICAgIGRQXzMsICBkUF8yICAKLSAgICAgICAgVlpJUC44ICAgICAgZFBfMW4sIGRQXzBuCi0gICAgICAgIFZaSVAuOCAgICAgIGRRXzBuLCBkUV8xbgotICAgICAgICBWWklQLjggICAgICBkUV8yLCAgZFFfMwotCi0gICAgICAgIAotICAgICAgICBWWklQLjE2ICAgICBkUF8zLCAgZFBfMW4KLSAgICAgICAgQUREICAgICAgICAgcFRtcCwgcFNyY0RzdCwgc3JjZHN0U3RlcAotICAgICAgICBWWklQLjE2ICAgICBkUV8wbiwgZFFfMgotICAgICAgICBWWklQLjE2ICAgICBkUV8xbiwgZFFfMwotICAgICAgICBWWklQLjE2ICAgICBkUF8yLCAgZFBfMG4KLQotICAgICAgICBWWklQLjMyICAgICBkUF8zLCAgZFFfMG4KLSAgICAgICAgVlpJUC4zMiAgICAgZFBfMW4sIGRRXzIKLSAgICAgICAgVlpJUC4zMiAgICAgZFBfMiwgIGRRXzFuCi0gICAgICAgIFZaSVAuMzIgICAgIGRQXzBuLCBkUV8zCi0KLSAgICAgICAgOy8vIGRSb3duMCAtIGRQXzMsICBkUm93bjEgLSBkUV8wbgotICAgICAgICA7Ly8gZFJvd24yIC0gZFBfMW4sIGRSb3duMyAtIGRRXzIKLSAgICAgICAgOy8vIGRSb3duNCAtIGRQXzIsICBkUm93bjUgLSBkUV8xbgotICAgICAgICA7Ly8gZFJvd242IC0gZFBfMG4sIGRSb3duNyAtIGRRXzMKLQotICAgICAgICBWU1QxICAgICAgICBkUm93bjAsIFtwU3JjRHN0XSwgcFRtcFN0ZXAKLSAgICAgICAgVlNUMSAgICAgICAgZFJvd24xLCBbcFRtcF0sIHBUbXBTdGVwCi0gICAgICAgIFZTVDEgICAgICAgIGRSb3duMiwgW3BTcmNEc3RdLCBwVG1wU3RlcAotICAgICAgICBWU1QxICAgICAgICBkUm93bjMsIFtwVG1wXSwgcFRtcFN0ZXAKLSAgICAgICAgOzEKLSAgICAgICAgVlNUMSAgICAgICAgZFJvd240LCBbcFNyY0RzdF0sIHBUbXBTdGVwCi0gICAgICAgIFZTVDEgICAgICAgIGRSb3duNSwgW3BUbXBdLCBwVG1wU3RlcAotICAgICAgICBBRERTICAgICAgICBYWSwgWFksIFhZCi0gICAgICAgIFZTVDEgICAgICAgIGRSb3duNiwgW3BTcmNEc3RdLCBwVG1wU3RlcAotICAgICAgICBBREQgICAgICAgICBwVGhyZXNob2xkcywgcFRocmVzaG9sZHMsICMyCi0gICAgICAgIFZTVDEgICAgICAgIGRSb3duNywgW3BUbXBdLCBzcmNkc3RTdGVwCi0KLSAgICAgICAgU1VCICAgICAgICAgcFNyY0RzdCwgcFNyY0RzdCwgc3JjZHN0U3RlcCwgTFNMICMzCi0gICAgICAgIFZMRDEgICAgICAgIHtkQWxwaGFbXX0sIFtwQWxwaGFfMV0KLSAgICAgICAgQUREICAgICAgICAgcFNyY0RzdCwgcFNyY0RzdCwgIzQKLSAgICAgICAgVkxEMSAgICAgICAge2RCZXRhW119LCBbcEJldGFfMV0KLQotICAgICAgICBCQ0MgICAgICAgICBMb29wWAotICAgICAgICBCICAgICAgICAgICBFeGl0TG9vcFkgICAgICAgIAotCi1Ob0ZpbHRlckJTMAotICAgICAgICBBREQgICAgICAgICBwU3JjRHN0LCBwU3JjRHN0LCAjNAotICAgICAgICBBRERTICAgICAgICBYWSwgWFksIFhZCi0gICAgICAgIFZMRDEgICAgICAgIHtkQWxwaGFbXX0sIFtwQWxwaGFfMV0KLSAgICAgICAgQUREICAgICAgICAgcFRocmVzaG9sZHMsIHBUaHJlc2hvbGRzLCAjNAotICAgICAgICBWTEQxICAgICAgICB7ZEJldGFbXX0sIFtwQmV0YV8xXQotICAgICAgICBCQ0MgICAgICAgICBMb29wWAotICAgICAgICBCICAgICAgICAgICBFeGl0TG9vcFkgICAgICAgIAotYlNHRTQgICAgICAgIAotICAgICAgICA7Ly8gYlMgPj0gNCBGaWx0ZXJpbmcKLSAgICAgICAgCi0gICAgICAgIEJMICAgICAgICAgIGFybVZDTTRQMTBfRGVibG9ja2luZ0x1bWFiU0dFNF91bnNhZmUKLQotICAgICAgICA7Ly8gVHJhbnNwb3NlCi0KLSAgICAgICAgVlpJUC44ICAgICAgZFBfMywgIGRQXzJuICAgCi0gICAgICAgIFZaSVAuOCAgICAgIGRQXzFuLCBkUF8wbgotICAgICAgICBWWklQLjggICAgICBkUV8wbiwgZFFfMW4KLSAgICAgICAgVlpJUC44ICAgICAgZFFfMm4sIGRRXzMKLQotICAgICAgICBWWklQLjE2ICAgICBkUF8zLCAgZFBfMW4KLSAgICAgICAgQU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LCAjNAotICAgICAgICBWU1QxICAgICAgICBkUm93N24sIFtwVG1wXSwgcFRtcFN0ZXAKLQotICAgICAgICBTVUIgICAgICAgICBwU3JjRHN0LCBwU3JjRHN0LCBzcmNkc3RTdGVwLCBMU0wgIzMKLSAgICAgICAgVkxEMSAgICAgICAge2RBbHBoYVtdfSwgW3BBbHBoYV8xXQotICAgICAgICBBREQgICAgICAgICBwU3JjRHN0LCBwU3JjRHN0LCAjNAotICAgICAgICBWTEQxICAgICAgICB7ZEJldGFbXX0sIFtwQmV0YV8xXQotCi0gICAgICAgIEJDQyAgICAgICAgIExvb3BYCi0KLUV4aXRMb29wWSAgICAgICAgCi0gICAgICAgIFNVQiAgICAgICAgIHBCUywgcEJTLCAjMTQKLSAgICAgICAgU1VCICAgICAgICAgcFRocmVzaG9sZHMsIHBUaHJlc2hvbGRzLCAjMTQKLSAgICAgICAgU1VCICAgICAgICAgcFNyY0RzdCwgcFNyY0RzdCwgIzE2Ci0gICAgICAgIFZMRDEgICAgICAgIHtkQWxwaGFbXX0sIFtwQWxwaGFfMF0KLSAgICAgICAgQUREICAgICAgICAgcFNyY0RzdCwgcFNyY0RzdCwgc3JjZHN0U3RlcCwgTFNMICMzIAotICAgICAgICBWTEQxICAgICAgICB7ZEJldGFbXX0sIFtwQmV0YV8wXQotICAgICAgICBCTkUgICAgICAgICBMb29wWQotCi0gICAgICAgIE1PViAgICAgICAgIHIwLCAjT01YX1N0c19Ob0VycgotCi0gICAgICAgIE1fRU5ECi0gICAgICAgIAotICAgIEVORElGCi0gICAgCi0gICAgICAgIAotICAgICAgICBFTkQKLSAgICAgICAgCi0gICAgICAgIApkaWZmIC0tZ2l0IGEvbWVkaWEvbGlic3RhZ2VmcmlnaHQvY29kZWNzL29uMi9oMjY0ZGVjL29teGRsL2FybV9uZW9uL3ZjL200cDEwL3NyYy9vbXhWQ000UDEwX0ludGVycG9sYXRlQ2hyb21hLmMgYi9tZWRpYS9saWJzdGFnZWZyaWdodC9jb2RlY3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Q000UDEwX0ludGVycG9sYXRlX0Nocm9tYSAKLSAgICAgICAgKChPTVhfVTgqKXBTcmMsIHNyY1N0ZXAsIHBEc3QsIGRzdFN0ZXAsIHJvaS53aWR0aCwgcm9pLmhlaWdodCwgZHgsIGR5KTsKLX0KLQotCi0vKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKLSAqICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgRU5EIE9GIEZJTEUKLSAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLQpkaWZmIC0tZ2l0IGEvbWVkaWEvbGlic3RhZ2VmcmlnaHQvY29kZWNzL29uMi9oMjY0ZGVjL29teGRsL2FybV9uZW9uL3ZjL200cDEwL3NyYy9vbXhWQ000UDEwX0ludGVycG9sYXRlTHVtYV9zLnMgYi9tZWRpYS9saWJzdGFnZWZyaWdodC9jb2RlY3Mvb24yL2gyNjRkZWMvb214ZGwvYXJtX25lb24vdmMvbTRwMTAvc3JjL29teFZDTTRQMTBfSW50ZXJwb2xhdGVMdW1hX3MucwpkZWxldGVkIGZpbGUgbW9kZSAxMDA3NTUKaW5kZXggOTQyZWJjNi4uMDAwMDAwMAotLS0gYS9tZWRpYS9saWJzdGFnZWZyaWdodC9jb2RlY3Mvb24yL2gyNjRkZWMvb214ZGwvYXJtX25lb24vdmMvbTRwMTAvc3JjL29teFZDTTRQMTBfSW50ZXJwb2xhdGVMdW1hX3MucworKysgL2Rldi9udWxsCkBAIC0xLDU1MyArMCwwIEBACi07Ly8KLTsvLyAKLTsvLyBGaWxlIE5hbWU6ICBvbXhWQ000UDEwX0ludGVycG9sYXRlTHVtYV9zLnMKLTsvLyBPcGVuTUFYIERMOiB2MS4wLjIKLTsvLyBSZXZpc2lvbjogICAxMjI5MAotOy8vIERhdGU6ICAgICAgIFdlZG5lc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Ec3QgICAgICAgICAgICBSTiAyCi1kc3RTdGVwICAgICAgICAgUk4gMwotaUhlaWdodCAgICAgICAgIFJOIDQKLWlXaWR0aCAgICAgICAgICBSTiA1Ci0KLTsvLyBEZWNsYXJlIG90aGVyIGludGVybWVkaWF0ZSByZWdpc3RlcnMKLWlkeCAgICAgICAgICAgICBSTiA2Ci1pZHkgICAgICAgICAgICAgUk4gNwotaW5kZXggICAgICAgICAgIFJOIDYKLVRlbXAgICAgICAgICAgICBSTiAxMgotcEFyZ3MgICAgICAgICAgIFJOIDExCi0KLQotICAgIElGIENvcnRleEE4Ci0KLSAgICAgICAgOy8vCi0gICAgICAgIDsvLyBJbnRlcnBvbGF0aW9uIG9mIGx1bWEgaXMgaW1wbGVtZW50ZWQgYnkgcHJvY2Vzc2luZyBibG9jayBvZiBwaXhlbHMsIHNpemUgNHg0IGF0IGEgdGltZS4KLSAgICAgICAgOy8vCi0gICAgICAgIE1fQUxMT0M0ICAgIHBwQXJncywgMTYKLSAgICAgICAgCi0gICAgICAgIDsvLyBGdW5jdGlvbiBoZWFkZXIKLSAgICAgICAgTV9TVEFSVCBvbXhWQ000UDEwX0ludGVycG9sYXRlTHVtYSwgcjExLCBkMTUKLQotcFNyY0JLICAgICAgICAgIFJOIDgKLQotOy8vIERlY2xhcmUgTmVvbiByZWdpc3RlcnMKLWRDb2VmZjUgICAgICAgICBETiAzMC5TMTYKLWRDb2VmZjIwICAgICAgICBETiAzMS5TMTYKLQotOy8vIFJlZ2lzdGVycyB1c2VkIGZvciBpbXBsZW1lbnRpbmcgSG9yaXpvbnRhbCBpbnRlcnBvbGF0aW9uCi1kU3JjMGMgICAgICAgICAgRE4gMTQuVTgKLWRTcmMxYyAgICAgICAgICBETiAxNi5VOAotZFNyYzJjICAgICAgICAgIEROIDE4LlU4Ci1kU3JjM2MgICAgICAgICAgRE4gMjAuVTggICAgICAgICAgICAgICAgICAgCi1kU3JjMGQgICAgICAgICAgRE4gMTUuVTgKLWRTcmMxZCAgICAgICAgICBETiAxNy5VOAotZFNyYzJkICAgICAgICAgIEROIDE5LlU4Ci1kU3JjM2QgICAgICAgICAgRE4gMjEuVTgKLWRBY2NIMCAgICAgICAgICBETiAyMi5VOAotZEFjY0gxICAgICAgICAgIEROIDI0LlU4Ci1kQWNjSDIgICAgICAgICAgRE4gMjYuVTgKLWRBY2NIMyAgICAgICAgICBETiAyOC5VOAotZFJlc3VsdEgwICAgICAgIEROIDIyLlUzMgotZFJlc3VsdEgxICAgICAgIEROIDI0LlUzMgotZFJlc3VsdEgyICAgICAgIEROIDI2LlUzMgotZFJlc3VsdEgzICAgICAgIEROIDI4LlUzMgotCi07Ly8gUmVnaXN0ZXJzIHVzZWQgZm9yIGltcGxlbWVudGluZyBWZXJ0aWNhbCBpbnRlcnBvbGF0aW9uCi1kU3JjMCAgICAgICAgICAgRE4gOS5VOAotZFNyYzEgICAgICAgICAgIEROIDEwLlU4Ci1kU3JjMiAgICAgICAgICAgRE4gMTEuVTgKLWRTcmMzICAgICAgICAgICBETiAxMi5VOAotZFNyYzQgICAgICAgICAgIEROIDEzLlU4Ci1kQWNjVjAgICAgICAgICAgRE4gMC5VOAotZEFjY1YxICAgICAgICAgIEROIDIuVTgKLWRBY2NWMiAgICAgICAgICBETiA0LlU4Ci1kQWNjVjMgICAgICAgICAgRE4gNi5VOAotZFJlc3VsdFYwICAgICAgIEROIDAuVTMyCi1kUmVzdWx0VjEgICAgICAgRE4gMi5VMzIKLWRSZXN1bHRWMiAgICAgICBETiA0LlUzMgotZFJlc3VsdFYzICAgICAgIEROIDYuVTMyCi0gICAgICAgIAotOy8vIFJlZ2lzdGVycyB1c2VkIGZvciBpbXBsZW1lbnRpbmcgRGlhZ29uYWwgaW50ZXJwb2xhdGlvbgotZFRBY2MwICAgICAgICAgIEROIDAuVTgKLWRUQWNjMSAgICAgICAgICBETiAyLlU4Ci1kVEFjYzIgICAgICAgICAgRE4gNC5VOAotZFRBY2MzICAgICAgICAgIEROIDYuVTgKLWRUUmVzMCAgICAgICAgICBETiAwLjMyCi1kVFJlczEgICAgICAgICAgRE4gMi4zMgotZFRSZXMyICAgICAgICAgIEROIDQuMzIKLWRUUmVzMyAgICAgICAgICBETiA2LjMyCi1kVFJlc3VsdDAgICAgICAgRE4gMTQuVTgKLWRUUmVzdWx0MSAgICAgICBETiAxNi5VOAotZFRSZXN1bHQyICAgICAgIEROIDE4LlU4Ci1kVFJlc3VsdDMgICAgICAgRE4gMjAuVTgKLWRUZW1wUDAgICAgICAgICBETiAxOC5TMTYKLWRUZW1wUDEgICAgICAgICBETiAxOS5TMTYKLWRUZW1wUTAgICAgICAgICBETiAyMC5TMTYKLWRUZW1wUTEgICAgICAgICBETiAyMS5TMTYKLWRUZW1wUjAgICAgICAgICBETiAyMi5TMTYKLWRUZW1wUjEgICAgICAgICBETiAyMy5TMTYKLWRUZW1wUzAgICAgICAgICBETiAyNC5TMTYKLWRUZW1wUzEgICAgICAgICBETiAyNS5TMTYKLXFUZW1wUDAxICAgICAgICBRTiA5LlMxNgotcVRlbXBRMDEgICAgICAgIFFOIDEwLlMxNgotcVRlbXBSMDEgICAgICAgIFFOIDExLlMxNgotcVRlbXBTMDEgICAgICAgIFFOIDEyLlMxNgotCi07Ly8gSW50ZXJtZWRpYXRlIHZhbHVlcyBmb3IgYXZlcmFnaW5nCi1xUmVzMiAgICAgICAgICAgUU4gNy5TMTYKLXFSZXMzICAgICAgICAgICBRTiA4LlMxNgotcVJlczQgICAgICAgICAgIFFOIDkuUzE2Ci1xUmVzNSAgICAgICAgICAgUU4gMTAuUzE2Ci1xUmVzNiAgICAgICAgICAgUU4gMTEuUzE2Ci0gICAgICAgCi07Ly8gRm9yIGltcGxlbWVudGluZyBjb3B5Ci1kRHN0MCAgICAgICAgICAgIEROIDkuMzIKLWREc3QxICAgICAgICAgICAgRE4gMTAuMzIKLWREc3QyICAgICAgICAgICAgRE4gMTEuMzIKLWREc3QzICAgICAgICAgICAgRE4gMTIuMzIKLQotICAgICAgICA7Ly8gRGVmaW5lIHN0YWNrIGFyZ3VtZW50cwotICAgICAgICBNX0FSRyAgICAgICBwdHJpZHgsIDQKLSAgICAgICAgTV9BUkcgICAgICAgcHRyaWR5LCA0ICAgICAgICAKLSAgICAgICAgTV9BUkcgICAgICAgcHRyV2lkdGgsIDQKLSAgICAgICAgTV9BUkcgICAgICAgcHRySGVpZ2h0LCA0ICAgICAgICAKLQotICAgICAgICA7Ly8gTG9hZCBzdHJ1Y3R1cmUgZWxlbWVudHMgb2Ygcm9pIAotICAgICAgICBNX0xEUiAgICAgICBpZHgsIHB0cmlkeAotICAgICAgICBNX0xEUiAgICAgICBpZHksIHB0cmlkeQotICAgICAgICBNX0xEUiAgICAgICBpV2lkdGgsIHB0cldpZHRoCi0gICAgICAgIE1fTERSICAgICAgIGlIZWlnaHQsIHB0ckhlaWdodAotICAgICAgICAKLSAgICAgICAgQUREICAgICAgICAgaW5kZXgsIGlkeCwgaWR5LCBMU0wgIzIgICAgICAgICAgICAgICAgIDsvLyAgW2luZGV4XSA9IFtpZHldW2lkeF0KLSAgICAgICAgTV9BRFIgICAgICAgcEFyZ3MsIHBwQXJncwotICAgICAgICAgICAgICAgICAgICAKLSAgICAgICAgOy8vIE1vdmUgY29lZmZpY2llbnRzIE5lb24gcmVnaXN0ZXJzCi0gICAgICAgIFZNT1YgICAgICAgIGRDb2VmZjIwLCAjMjAKLSAgICAgICAgVk1PViAgICAgICAgZENvZWZmNSwgIzUKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKLUJsb2NrNHg0V2lkdGhMb29wCi1CbG9jazR4NEhlaWdodExvb3AKLQotICAgICAgICBTVE0gICAgICAgICBwQXJncywge3BTcmMsc3JjU3RlcCxwRHN0LGRzdFN0ZXB9IAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCi0gICAgICAgIDsvLyBzd2l0Y2ggdGFibGUgdXNpbmcgbW90aW9uIHZlY3RvciBhcyBpbmRleAotICAgICAgICBBREQgICAgICAgICBwYywgcGMsIGluZGV4LCBMU0wgIzIKLSAgICAgICAgQiAgICAgICAgICAgQ2FzZV9mCi0gICAgICAgIEIgICAgICAgICAgIENhc2VfMCAgICAgICAgCi0gICAgICAgIEIgICAgICAgICAgIENhc2VfMSAgICAgICAgCi0gICAgICAgIEIgICAgICAgICAgIENhc2VfMiAgICAgICAgCi0gICAgICAgIEIgICAgICAgICAgIENhc2VfMyAgICAgICAgCi0gICAgICAgIEIgICAgICAgICAgIENhc2VfNCAgICAgICAgCi0gICAgICAgIEIgICAgICAgICAgIENhc2VfNSAgICAgICAgCi0gICAgICAgIEIgICAgICAgICAgIENhc2VfNiAgICAgICAgCi0gICAgICAgIEIgICAgICAgICAgIENhc2VfNyAgICAgICAgCi0gICAgICAgIEIgICAgICAgICAgIENhc2VfOCAgICAgICAgCi0gICAgICAgIEIgICAgICAgICAgIENhc2VfOSAgICAgICAgCi0gICAgICAgIEIgICAgICAgICAgIENhc2VfYSAgICAgICAgCi0gICAgICAgIEIgICAgICAgICAgIENhc2VfYiAgICAgICAgCi0gICAgICAgIEIgICAgICAgICAgIENhc2VfYyAgICAgICAgCi0gICAgICAgIEIgICAgICAgICAgIENhc2VfZAotICAgICAgICBCICAgICAgICAgICBDYXNlX2UgICAgICAgIAotICAgICAgICBCICAgICAgICAgICBDYXNlX2YKLSAgICAgICAgICAgICAgICAgICAgCi1DYXNlXzAgICAgICAgICAgICAgICAgCi0gICAgICAgIDsvLyBDYXNlIEcKLSAgICAgICAgTV9QUklOVEYgIkNhc2UgMCBcbiIKLSAgICAgICAgCi0gICAgICAgIDsvLyBMb2FkcyBhIDR4NCBibG9jayBvZiAuOCBhbmQgc3RvcmVzIGFzIC4zMgotICAgICAgICBBREQgICAgICAgICBUZW1wLCBwU3JjLCBzcmNTdGVwLCBMU0wgIzEgCi0gICAgICAgIFZMRDEgICAgICAgIGRTcmMwLCBbcFNyY10sIHNyY1N0ZXAKLSAgICAgICAgVkxEMSAgICAgICAgZFNyYzIsIFtUZW1wXSwgc3JjU3RlcAotICAgICAgICBWTEQxICAgICAgICBkU3JjMSwgW3BTcmNdCi0gICAgICAgIFZMRDEgICAgICAgIGRTcmMzLCBbVGVtcF0KLSAgICAgICAgCi0gICAgICAgIEFERCAgICAgICAgIFRlbXAsIHBEc3QsIGRzdFN0ZXAsIExTTCAjMSAKLSAgICAgICAgVlNUMSAgICAgICAgZERzdDBbMF0sIFtwRHN0XSwgZHN0U3RlcAotICAgICAgICBWU1QxICAgICAgICBkRHN0MlswXSwgW1RlbXBdLCBkc3RTdGVwCi0gICAgICAgIFZTVDEgICAgICAgIGREc3QxWzBdLCBbcERzdF0KLSAgICAgICAgVlNUMSAgICAgICAgZERzdDNbMF0sIFtUZW1wXQotICAgICAgICBNX0FEUiAgICAgICBwQXJncywgcHBBcmdzCi0gICAgICAgIEIgICAgICAgICAgIEJsb2NrNHg0TG9vcEVuZAotQ2FzZV8xCi0gICAgICAgIDsvLyBDYXNlIGEKLSAgICAgICAgTV9QUklOVEYgIkNhc2UgMSBcbiIKLQotICAgICAgICBTVUIgICAgICAgICBwU3JjLCBwU3JjLCAjMgotICAgICAgICBCTCAgICAgICAgICBhcm1WQ000UDEwX0ludGVycG9sYXRlTHVtYV9IYWxmSG9yNHg0X3Vuc2FmZSAgICAgICAgCi0gICAgICAgIFZSSEFERCAgICAgIGRBY2NIMCwgZEFjY0gwLCBkU3JjMGMKLSAgICAgICAgVlJIQUREICAgICAgZEFjY0gyLCBkQWNjSDIsIGRTcmMyYwotICAgICAgICBWUkhBREQgICAgICBkQWNjSDEsIGRBY2NIMSwgZFNyYzFjCi0gICAgICAgIFZSSEFERCAgICAgIGRBY2NIMywgZEFjY0gzLCBkU3JjM2MKLSAgICAgICAgQUREICAgICAgICAgVGVtcCwgcERzdCwgZHN0U3RlcCwgTFNMICMxIAotICAgICAgICBWU1QxICAgICAgICBkUmVzdWx0SDBbMF0sIFtwRHN0XSwgZHN0U3RlcAotICAgICAgICBWU1QxICAgICAgICBkUmVzdWx0SDJbMF0sIFtUZW1wXSwgZHN0U3RlcAotICAgICAgICBWU1QxICAgICAgICBkUmVzdWx0SDFbMF0sIFtwRHN0XQotICAgICAgICBWU1QxICAgICAgICBkUmVzdWx0SDNbMF0sIFtUZW1wXQotICAgICAgICBNX0FEUiAgICAgICBwQXJncywgcHBBcmdzCi0gICAgICAgIEIgICAgICAgICAgIEJsb2NrNHg0TG9vcEVuZCAgICAgICAgCi1DYXNlXzIKLSAgICAgICAgOy8vIENhc2UgYgotICAgICAgICBNX1BSSU5URiAiQ2FzZSAyIFxuIgotCi0gICAgICAgIFNVQiAgICAgICAgIHBTcmMsIHBTcmMsICMyICAgICAgICAKLSAgICAgICAgQkwgICAgICAgICAgYXJtVkNNNFAxMF9JbnRlcnBvbGF0ZUx1bWFfSGFsZkhvcjR4NF91bnNhZmUKLSAgICAgICAgQUREICAgICAgICAgVGVtcCwgcERzdCwgZHN0U3RlcCwgTFNMICMxIAotICAgICAgICBWU1QxICAgICAgICBkUmVzdWx0SDBbMF0sIFtwRHN0XSwgZHN0U3RlcAotICAgICAgICBWU1QxICAgICAgICBkUmVzdWx0SDJbMF0sIFtUZW1wXSwgZHN0U3RlcAotICAgICAgICBWU1QxICAgICAgICBkUmVzdWx0SDFbMF0sIFtwRHN0XQotICAgICAgICBWU1QxICAgICAgICBkUmVzdWx0SDNbMF0sIFtUZW1wXQotICAgICAgICBNX0FEUiAgICAgICBwQXJncywgcHBBcmdzCi0gICAgICAgIEIgICAgICAgICAgIEJsb2NrNHg0TG9vcEVuZCAgICAgICAgCi1DYXNlXzMKLSAgICAgICAgOy8vIENhc2UgYwotICAgICAgICBNX1BSSU5URiAiQ2FzZSAzIFxuIgotCi0gICAgICAgIFNVQiAgICAgICAgIHBTcmMsIHBTcmMsICMyCi0gICAgICAgIEJMICAgICAgICAgIGFybVZDTTRQMTBfSW50ZXJwb2xhdGVMdW1hX0hhbGZIb3I0eDRfdW5zYWZlICAgICAgICAKLSAgICAgICAgVlJIQUREICAgICAgZEFjY0gwLCBkQWNjSDAsIGRTcmMwZAotICAgICAgICBWUkhBREQgICAgICBkQWNjSDIsIGRBY2NIMiwgZFNyYzJkCi0gICAgICAgIFZSSEFERCAgICAgIGRBY2NIMSwgZEFjY0gxLCBkU3JjMWQKLSAgICAgICAgVlJIQUREICAgICAgZEFjY0gzLCBkQWNjSDMsIGRTcmMzZAotICAgICAgICBBREQgICAgICAgICBUZW1wLCBwRHN0LCBkc3RTdGVwLCBMU0wgIzEgCi0gICAgICAgIFZTVDEgICAgICAgIGRSZXN1bHRIMFswXSwgW3BEc3RdLCBkc3RTdGVwCi0gICAgICAgIFZTVDEgICAgICAgIGRSZXN1bHRIMlswXSwgW1RlbXBdLCBkc3RTdGVwCi0gICAgICAgIFZTVDEgICAgICAgIGRSZXN1bHRIMVswXSwgW3BEc3RdCi0gICAgICAgIFZTVDEgICAgICAgIGRSZXN1bHRIM1swXSwgW1RlbXBdCi0gICAgICAgIE1fQURSICAgICAgIHBBcmdzLCBwcEFyZ3MKLSAgICAgICAgQiAgICAgICAgICAgQmxvY2s0eDRMb29wRW5kICAgICAgICAKLUNhc2VfNAotICAgICAgICA7Ly8gQ2FzZSBkCi0gICAgICAgIE1fUFJJTlRGICJDYXNlIDQgXG4iCi0KLSAgICAgICAgU1VCICAgICAgICAgcFNyYywgcFNyYywgc3JjU3RlcCwgTFNMICMxCi0gICAgICAgIEJMICAgICAgICAgIGFybVZDTTRQMTBfSW50ZXJwb2xhdGVMdW1hX0hhbGZWZXI0eDRfdW5zYWZlICAgICAgICAKLSAgICAgICAgVlJIQUREICAgICAgZEFjY1YwLCBkQWNjVjAsIGRTcmMwCi0gICAgICAgIFZSSEFERCAgICAgIGRBY2NWMiwgZEFjY1YyLCBkU3JjMgotICAgICAgICBWUkhBREQgICAgICBkQWNjVjEsIGRBY2NWMSwgZFNyYzEKLSAgICAgICAgVlJIQUREICAgICAgZEFjY1YzLCBkQWNjVjMsIGRTcmMzCi0gICAgICAgIEFERCAgICAgICAgIFRlbXAsIHBEc3QsIGRzdFN0ZXAsIExTTCAjMSAKLSAgICAgICAgVlNUMSAgICAgICAgZFJlc3VsdFYwWzBdLCBbcERzdF0sIGRzdFN0ZXAKLSAgICAgICAgVlNUMSAgICAgICAgZFJlc3VsdFYyWzBdLCBbVGVtcF0sIGRzdFN0ZXAKLSAgICAgICAgVlNUMSAgICAgICAgZFJlc3VsdFYxWzBdLCBbcERzdF0KLSAgICAgICAgVlNUMSAgICAgICAgZFJlc3VsdFYzWzBdLCBbVGVtcF0KLSAgICAgICAgTV9BRFIgICAgICAgcEFyZ3MsIHBwQXJncwotICAgICAgICBCICAgICAgICAgICBCbG9jazR4NExvb3BFbmQgICAgICAgIAotQ2FzZV81Ci0gICAgICAgIDsvLyBDYXNlIGUKLSAgICAgICAgTV9QUklOVEYgIkNhc2UgNSBcbiIKLSAgICAgICAgCi0gICAgICAgIE1PViAgICAgICAgIHBTcmNCSywgcFNyYwotICAgICAgICBTVUIgICAgICAgICBwU3JjLCBwU3JjLCBzcmNTdGVwLCBMU0wgIzEKLSAgICAgICAgQkwgICAgICAgICAgYXJtVkNNNFAxMF9JbnRlcnBvbGF0ZUx1bWFfSGFsZlZlcjR4NF91bnNhZmUgICAgICAgIAotICAgICAgICBTVUIgICAgICAgICBwU3JjLCBwU3JjQkssICMyCi0gICAgICAgIEJMICAgICAgICAgIGFybVZDTTRQMTBfSW50ZXJwb2xhdGVMdW1hX0hhbGZIb3I0eDRfdW5zYWZlICAgICAgICAKLSAgICAgICAgVlJIQUREICAgICAgZEFjY0gwLCBkQWNjSDAsIGRBY2NWMAotICAgICAgICBWUkhBREQgICAgICBkQWNjSDIsIGRBY2NIMiwgZEFjY1YyCi0gICAgICAgIFZSSEFERCAgICAgIGRBY2NIMSwgZEFjY0gxLCBkQWNjVjEKLSAgICAgICAgVlJIQUREICAgICAgZEFjY0gzLCBkQWNjSDMsIGRBY2NWMyAgICAgICAgCi0gICAg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ERCAgICAgIGRUQWNjMSwgZFRBY2MxLCBkVFJlc3VsdDEKLSAgICAgICAgVlJIQUREICAgICAgZFRBY2MzLCBkVEFjYzMsIGRUUmVzdWx0MwotICAgICAgICBBREQgICAgICAgICBUZW1wLCBwRHN0LCBkc3RTdGVwLCBMU0wgIzEgCi0gICAgICAgIFZTVDEgICAgICAgIGRUUmVzMFswXSwgW3BEc3RdLCBkc3RTdGVwCi0gICAgICAgIFZTVDEgICAgICAgIGRUUmVzMlswXSwgW1RlbXBdLCBkc3RTdGVwCi0gICAgICAgIFZTVDEgICAgICAgIGRUUmVzMVswXSwgW3BEc3RdCi0gICAgICAgIFZTVDEgICAgICAgIGRUUmVzM1swXSwgW1RlbXBdCi0gICAgICAgIAotICAgICAgICBNX0FEUiAgICAgICBwQXJncywgcHBBcmdzCi0gICAgICAgIEIgICAgICAgQmxvY2s0eDRMb29wRW5kICAgICAgICAKLUNhc2VfNwotICAgICAgICA7Ly8gQ2FzZSBnCi0gICAgICAgIE1fUFJJTlRGICJDYXNlIDcgXG4iCi0gICAgICAgIE1PViAgICAgICAgIHBTcmNCSywgcFNyYwotICAgICAgICBBREQgICAgICAgICBwU3JjLCBwU3JjLCAjMQotICAgICAgICBTVUIgICAgICAgICBwU3JjLCBwU3JjLCBzcmNTdGVwLCBMU0wgIzEKLSAgICAgICAgQkwgICAgICAgICAgYXJtVkNNNFAxMF9JbnRlcnBvbGF0ZUx1bWFfSGFsZlZlcjR4NF91bnNhZmUgICAgICAgIAotICAgICAgICBTVUIgICAgICAgICBwU3JjLCBwU3JjQkssICMyCi0gICAgICAgIEJMICAgICAgICAgIGFybVZDTTRQMTBfSW50ZXJwb2xhdGVMdW1hX0hhbGZIb3I0eDRfdW5zYWZlICAgICAgICAKLSAgICAgICAgVlJIQUREICAgICAgZEFjY0gwLCBkQWNjSDAsIGRBY2NWMAotICAgICAgICBWUkhBREQgICAgICBkQWNjSDIsIGRBY2NIMiwgZEFjY1YyCi0gICAgICAgIFZSSEFERCAgICAgIGRBY2NIMSwgZEFjY0gxLCBkQWNjVjEKLSAgICAgICAgVlJIQUREICAgICAgZEFjY0gzLCBkQWNjSDMsIGRBY2NWMyAgICAgICAgCi0gICAgICAgIEFERCAgICAgICAgIFRlbXAsIHBEc3QsIGRzdFN0ZXAsIExTTCAjMSAKLSAgICAgICAgVlNUMSAgICAgICAgZFJlc3VsdEgwWzBdLCBbcERzdF0sIGRzdFN0ZXAKLSAgICAgICAgVlNUMSAgICAgICAgZFJlc3VsdEgyWzBdLCBbVGVtcF0sIGRzdFN0ZXAKLSAgICAgICAgVlNUMSAgICAgICAgZFJlc3VsdEgxWzBdLCBbcERzdF0KLSAgICAgICAgVlNUMSAgICAgICAgZFJlc3VsdEgzWzBdLCBbVGVtcF0KLSAgICAgICAgCi0gICAgICAgIE1fQURSICAgICAgIHBBcmdzLCBwcEFyZ3MKLSAgICAgICAgQiAgICAgICBCbG9jazR4NExvb3BFbmQKLUNhc2VfOAotICAgICAgICA7Ly8gQ2FzZSBoCi0gICAgICAgIE1fUFJJTlRGICJDYXNlIDggXG4iCi0KLSAgICAgICAgU1VCICAgICAgICAgcFNyYywgcFNyYywgc3JjU3RlcCwgTFNMICMxCi0gICAgICAgIEJMICAgICAgICAgIGFybVZDTTRQMTBfSW50ZXJwb2xhdGVMdW1hX0hhbGZWZXI0eDRfdW5zYWZlICAgICAgICAKLSAgICAgICAgQUREICAgICAgICAgVGVtcCwgcERzdCwgZHN0U3RlcCwgTFNMICMxIAotICAgICAgICBWU1QxICAgICAgICBkUmVzdWx0VjBbMF0sIFtwRHN0XSwgZHN0U3RlcAotICAgICAgICBWU1QxICAgICAgICBkUmVzdWx0VjJbMF0sIFtUZW1wXSwgZHN0U3RlcAotICAgICAgICBWU1QxICAgICAgICBkUmVzdWx0VjFbMF0sIFtwRHN0XQotICAgICAgICBWU1QxICAgICAgICBkUmVzdWx0VjNbMF0sIFtUZW1wXQotICAgICAgICBNX0FEUiAgICAgICBwQXJncywgcHBBcmdzCi0gICAgICAgIEIgICAgICAgICAgIEJsb2NrNHg0TG9vcEVuZAotQ2FzZV85Ci0gICAgICAgIDsvLyBDYXNlIGkKLSAgICAgICAgTV9QUklOVEYgIkNhc2UgOSBcbiIKLSAgICAgICAgU1VCICAgICAgICAgcFNyYywgcFNyYywgc3JjU3RlcCwgTFNMICMxCi0gICAgICAgIFNVQiAgICAgICAgIHBTcmMsIHBTcmMsICMyCi0gICAgICAgIEJMICAgICAgICAgIGFybVZDTTRQMTBfSW50ZXJwb2xhdGVMdW1hX0hhbGZEaWFnVmVySG9yNHg0X3Vuc2FmZQotICAgICAgICBWRVhUICAgICAgICBkVGVtcFAwLCBkVGVtcFAwLCBkVGVtcFAxLCAjMgotICAgICAgICBWRVhUICAgICAgICBkVGVtcFEwLCBkVGVtcFEwLCBkVGVtcFExLCAjMgotICAgICAgICBWRVhUICAgICAgICBkVGVtcFIwLCBkVGVtcFIwLCBkVGVtcFIxLCAjMgotICAgICAgICBWRVhUICAgICAgICBkVGVtcFMwLCBkVGVtcFMwLCBkVGVtcFMxLCAjMgotICAgICAgICAKLSAgICAgICAgVlFSU0hSVU4gICAgZFRSZXN1bHQwLCBxVGVtcFAwMSwgIzUgICAgICAgIAotICAgICAgICBWUVJTSFJVTiAgICBkVFJlc3VsdDEsIHFUZW1wUTAxLCAjNSAgICAgICAgCi0gICAgICAgIFZRUlNIUlVOICAgIGRUUmVzdWx0MiwgcVRlbXBSMDEsICM1ICAgICAgICAKLSAgICAgICAgVlFSU0hSVU4gICAgZFRSZXN1bHQzLCBxVGVtcFMwMSwgIzUgICAgICAgIAotCi0gICAgICAgIFZSSEFERCAgICAgIGRUQWNjMCwgZFRBY2MwLCBkVFJlc3VsdDAKLSAgICAgICAgVlJIQUREICAgICAgZFRBY2MyLCBkVEFjYzIsIGRUUmVzdWx0MgotICAgICAgICBWUkhBREQgICAgICBkVEFjYzEsIGRUQWNjMSwgZFRSZXN1bHQxCi0gICAgICAgIFZSSEFERCAgICAgIGRUQWNjMywgZFRBY2MzLCBkVFJlc3VsdDMKLSAgICAgICAgQUREICAgICAgICAgVGVtcCwgcERzdCwgZHN0U3RlcCwgTFNMICMxIAotICAgICAgICBWU1QxICAgICAgICBkVFJlczBbMF0sIFtwRHN0XSwgZHN0U3RlcAotICAgICAgICBWU1QxICAgICAgICBkVFJlczJbMF0sIFtUZW1wXSwgZHN0U3RlcAotICAgICAgICBWU1QxICAgICAgICBkVFJlczFbMF0sIFtwRHN0XQotICAgICAgICBWU1QxICAgICAgICBkVFJlczNbMF0sIFtUZW1wXQotICAgICAgICBNX0FEUiAgICAgICBwQXJncywgcHBBcmdzCi0gICAgICAgIEIgICAgICAgQmxvY2s0eDRMb29wRW5kCi1DYXNlX2EKLSAgICAgICAgOy8vIENhc2UgagotICAgICAgICBNX1BSSU5URiAiQ2FzZSBhIFxuIgotCi0gICAgICAgIFNVQiAgICAgICAgIHBTcmMsIHBTcmMsIHNyY1N0ZXAsIExTTCAjMQotICAgICAgICBTVUIgICAgICAgICBwU3JjLCBwU3JjLCAjMgotICAgICAgICBCTCAgICAgICAgICBhcm1WQ000UDEwX0ludGVycG9sYXRlTHVtYV9IYWxmRGlhZ0hvclZlcjR4NF91bnNhZmUKLSAgICAgICAgQUREICAgICAgICAgVGVtcCwgcERzdCwgZHN0U3RlcCwgTFNMICMxIAotICAgICAgICBWU1QxICAgICAgICBkVFJlczBbMF0sIFtwRHN0XSwgZHN0U3RlcAotICAgICAgICBWU1QxICAgICAgICBkVFJlczJbMF0sIFtUZW1wXSwgZHN0U3RlcAotICAgICAgICBWU1QxICAgICAgICBkVFJlczFbMF0sIFtwRHN0XQotICAgICAgICBWU1QxICAgICAgICBkVFJlczNbMF0sIFtUZW1wXQotICAgICAgICBNX0FEUiAgICAgICBwQXJncywgcHBBcmdzCi0gICAgICAgIEIgICAgICAgQmxvY2s0eDRMb29wRW5kCi1DYXNlX2IKLSAgICAgICAgOy8vIENhc2UgawotICAgICAgICBNX1BSSU5URiAiQ2FzZSBiIF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ICAgcEFyZ3MsIHBwQXJncwotICAgICAgICBCICAgICAgICAgICBCbG9jazR4NExvb3BFbmQKLUNhc2VfZAotICAgICAgICA7Ly8gQ2FzZSBwCi0gICAgICAgIE1fUFJJTlRGICJDYXNlIGQgXG4iCi0gICAgICAgIAotICAgICAgICBNT1YgICAgICAgICBwU3JjQkssIHBTcmMKLSAgICAgICAgU1VCICAgICAgICAgcFNyYywgcFNyYywgc3JjU3RlcCwgTFNMICMxCi0gICAgICAgIEJMICAgICAgICAgIGFybVZDTTRQMTBfSW50ZXJwb2xhdGVMdW1hX0hhbGZWZXI0eDRfdW5zYWZlICAgICAgICAKLSAgICAgICAgQUREICAgICAgICAgcFNyYywgcFNyY0JLLCBzcmNTdGVwCi0gICAgICAgIFNVQiAgICAgICAgIHBTcmMsIHBTcmMsICMyCi0gICAgICAgIEJMICAgICAgICAgIGFybVZDTTRQMTBfSW50ZXJwb2xhdGVMdW1hX0hhbGZIb3I0eDRfdW5zYWZlICAgICAgICAKLSAgICAgICAgVlJIQUREICAgICAgZEFjY0gwLCBkQWNjSDAsIGRBY2NWMAotICAgICAgICBWUkhBREQgICAgICBkQWNjSDIsIGRBY2NIMiwgZEFjY1YyCi0gICAgICAgIFZSSEFERCAgICAgIGRBY2NIMSwgZEFjY0gxLCBkQWNjVjEKLSAgICAgICAgVlJIQUREICAgICAgZEFjY0gzLCBkQWNjSDMsIGRBY2NWMyAgICAgICAgCi0gICAgICAgIEFERCAgICAgICAgIFRlbXAsIHBEc3QsIGRzdFN0ZXAsIExTTCAjMSAKLSAgICAgICAgVlNUMSAgICAgICAgZFJlc3VsdEgwWzBdLCBbcERzdF0sIGRzdFN0ZXAKLSAgICAgICAgVlNUMSAgICAgICAgZFJlc3VsdEgyWzBdLCBbVGVtcF0sIGRzdFN0ZXAKLSAgICAgICAgVlNUMSAgICAgICAgZFJlc3VsdEgxWzBdLCBbcERzdF0KLSAgICAgICAgVlNUMSAgICAgICAgZFJlc3VsdEgzWzBdLCBbVGVtcF0KLSAgICAgICAgTV9BRFIgICAgICAgcEFyZ3MsIHBwQXJncwotICAgICAgICBCICAgICAgIEJsb2NrNHg0TG9vcEVuZAotQ2FzZV9lCi0gICAgICAgIDsvLyBDYXNlIHEKLSAgICAgICAgTV9QUklOVEYgIkNhc2UgZSBcbiIKLSAgICAgICAgCi0gICAgICAgIFNVQiAgICAgICAgIHBTcmMsIHBTcmMsIHNyY1N0ZXAsIExTTCAjMQotICAgICAgICBTVUIgICAgICAgICBwU3JjLCBwU3JjLCAjMgotICAgICAgICBCTCAgICAgICAgICBhcm1WQ000UDEwX0ludGVycG9sYXRlTHVtYV9IYWxmRGlhZ0hvclZlcjR4NF91bnNhZmUKLSAgICAgICAgVlFSU0hSVU4gICAgZFRSZXN1bHQwLCBxUmVzMywgIzUgICAgICAgIAotICAgICAgICBWUVJTSFJVTiAgICBkVFJlc3VsdDEsIHFSZXM0LCAjNSAgICAgICAgCi0gICAgICAgIFZRUlNIUlVOICAgIGRUUmVzdWx0MiwgcVJlczUsICM1ICAgICAgICAKLSAgICAgICAgVlFSU0hSVU4gICAgZFRSZXN1bHQzLCBxUmVzNiwgIzUgICAgICAgIAotCi0gICAgICAgIFZSSEFERCAgICAgIGRUQWNjMCwgZFRBY2MwLCBkVFJlc3VsdDAKLSAgICAgICAgVlJIQUREICAgICAgZFRBY2MyLCBkVEFjYzIsIGRUUmVzdWx0MgotICAgICAgICBWUkhBREQgICAgICBkVEFjYzEsIGRUQWNjMSwgZFRSZXN1bHQxCi0gICAgICAgIFZSSEFERCAgICAgIGRUQWNjMywgZFRBY2MzLCBkVFJlc3VsdDMKLSAgICAgICAgQUREICAgICAgICAgVGVtcCwgcERzdCwgZHN0U3RlcCwgTFNMICMxIAotICAgICAgICBWU1QxICAgICAgICBkVFJlczBbMF0sIFtwRHN0XSwgZHN0U3RlcAotICAgICAgICBWU1QxICAgICAgICBkVFJlczJbMF0sIFtUZW1wXSwgZHN0U3RlcAotICAgICAgICBWU1QxICAgICAgICBkVFJlczFbMF0sIFtwRHN0XQotICAgICAgICBWU1QxICAgICAgICBkVFJlczNbMF0sIFtUZW1wXQotICAgICAgICBNX0FEUiAgICAgICBwQXJncywgcHBBcmdzCi0gICAgICAgIEIgICAgICAgQmxvY2s0eDRMb29wRW5kCi1DYXNlX2YKLSAgICAgICAgOy8vIENhc2UgcgotICAgICAgICBNX1BSSU5URiAiQ2FzZSBmIFxuIgotICAgICAgICBNT1YgICAgICAgICBwU3JjQkssIHBTcmMKLSAgICAgICAgQUREICAgICAgICAgcFNyYywgcFNyYywgIzEKLSAgICAgICAgU1VCICAgICAgICAgcFNyYywgcFNyYywgc3JjU3RlcCwgTFNMICMxCi0gICAgICAgIEJMICAgICAgICAgIGFybVZDTTRQMTBfSW50ZXJwb2xhdGVMdW1hX0hhbGZWZXI0eDRfdW5zYWZlICAgICAgICAKLSAgICAgICAgQUREICAgICAgICAgcFNyYywgcFNyY0JLLCBzcmNTdGVwCi0gICAgICAgIFNVQiAgICAgICAgIHBTcmMsIHBTcmMsICMyCi0gICAgICAgIEJMICAgICAgICAgIGFybVZDTTRQMTBfSW50ZXJwb2xhdGVMdW1hX0hhbGZIb3I0eDRfdW5zYWZlICAgICAgICAKLSAgICAgICAgVlJIQUREICAgICAgZEFjY0gwLCBkQWNjSDAsIGRBY2NWMAotICAgICAgICBWUkhBREQgICAgICBkQWNjSDIsIGRBY2NIMiwgZEFjY1YyCi0gICAgICAgIFZSSEFERCAgICAgIGRBY2NIMSwgZEFjY0gxLCBkQWNjVjEKLSAgICAgICAgVlJIQUREICAgICAgZEFjY0gzLCBkQWNjSDMsIGRBY2NWMyAgICAgICAgCi0gICAgICAgIEFERCAgICAgICAgIFRlbXAsIHBEc3QsIGRzdFN0ZXAsIExTTCAjMSAKLSAgICAgICAgVlNUMSAgICAgICAgZFJlc3VsdEgwWzBdLCBbcERzdF0sIGRzdFN0ZXAKLSAgICAgICAgVlNUMSAgICAgICAgZFJlc3VsdEgyWzBdLCBbVGVtcF0sIGRzdFN0ZXAKLSAgICAgICAgVlNUMSAgICAgICAgZFJlc3VsdEgxWzBdLCBbcERzdF0KLSAgICAgICAgVlNUMSAgICAgICAgZFJlc3VsdEgzWzBdLCBbVGVtcF0KLSAgICAgICAgTV9BRFIgICAgICAgcEFyZ3MsIHBwQXJncwotCi0KLUJsb2NrNHg0TG9vcEVuZAotCi0gICAgICAgIDsvLyBXaWR0aCBMb29wCi0gICAgICAgIDsvL01fQURSICAgICAgIHBBcmdzLCBwcEFyZ3MKLSAgICAgICAgTERNICAgICAgICAgcEFyZ3MsIHtwU3JjLHNyY1N0ZXAscERzdCxkc3RTdGVwfSAgOy8vIExvYWQgYXJndW1lbnRzCi0gICAgICAgIFNVQlMgICAgICAgIGlXaWR0aCwgaVdpZHRoLCAjNAotICAgICAgICBBREQgICAgICAgICBwU3JjLCBwU3JjLCAjNCAgICAgIAotICAgICAgICBBREQgICAgICAgICBwRHN0LCBwRHN0LCAjNAotICAgICAgICBCR1QgICAgICAgICBCbG9jazR4NFdpZHRoTG9vcAotICAgICAgICAgICAgICAgICAgICAKLSAgICAgICAgOy8vIEhlaWdodCBMb29wCi0gICAgICAgIFNVQlMgICAgICAgIGlIZWlnaHQsIGlIZWlnaHQsICM0Ci0gICAgICAgIE1fTERSICAgICAgIGlXaWR0aCwgcHRyV2lkdGgKLSAgICAgICAgTV9BRFIgICAgICAgcEFyZ3MsIHBwQXJncwotICAgICAgICBBREQgICAgICAgICBwU3JjLCBwU3JjLCBzcmNTdGVwLCBMU0wgIzIgICAgICAKLSAgICAgICAgQUREICAgICAgICAgcERzdCwgcERzdCwgZHN0U3RlcCwgTFNMICMyCi0gICAgICAgIFNVQiAgICAgICAgIHBTcmMsIHBTcmMsIGlXaWR0aAotICAgICAgICBTVUIgICAgICAgICBwRHN0LCBwRHN0LCBpV2lkdGgKLSAgICAgICAgQkdUICAgICAgICAgQmxvY2s0eDRIZWlnaHRMb29wCi0KLUVuZE9mSW50ZXJwb2xhdGlvbgotICAgICAgICBN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gICAgICAgICAgIFFOICBRMC5TMTYKLXFDMSAgICAgICAgICAgICBRTiAgUTEuUzE2Ci1xQzIgICAgICAgICAgICAgUU4gIFE0LlMxNgotcUMzICAgICAgICAgICAgIFFOICBRNS5TMTYKLXFDNCAgICAgICAgICAgICBRTiAgUTYuUzE2Ci1xQzUgICAgICAgICAgICAgUU4gIFE3LlMxNgotcUM2ICAgICAgICAgICAgIFFOICBROC5TMTYKLXFDNyAgICAgICAgICAgICBRTiAgUTkuUzE2Ci1xU3VtMCAgICAgICAgICAgUU4gIFEwLlMxNgotcVN1bTEgICAgICAgICAgIFFOICBRMS5TMTYKLXFTdW0yICAgICAgICAgICBRTiAgUTQuUzE2Ci1xU3VtMyAgICAgICAgICAgUU4gIFE1LlMxNgotcVN1bTQgICAgICAgICAgIFFOICBRNi5TMTYKLXFTdW01ICAgICAgICAgICBRTiAgUTcuUzE2Ci1xU3VtNiAgICAgICAgICAgUU4gIFE4LlMxNgotcVN1bTcgICAgICAgICAgIFFOICBROS5TMTYKLWRTdW0wICAgICAgICAgICBETiAgRDAuVTgKLWRTdW0xICAgICAgICAgICBETiAgRDEuVTgKLWRTdW0yICAgICAgICAgICBETiAgRDIuVTgKLWRTdW0zICAgICAgICAgICBETiAgRDMuVTgKLWRTdW00ICAgICAgICAgICBETiAgRDQuVTgKLWRTdW01ICAgICAgICAgICBETiAgRDUuVTgKLWRTdW02ICAgICAgICAgICBETiAgRDYuVTgKLWRTdW03ICAgICAgICAgICBETiAgRDcuVTgKLQotOy8vLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0KLTsvLyBvbXhWQ000UDEwX1ByZWRpY3RJbnRyYUNocm9tYV84eDggc3RhcnRzCi07Ly8tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t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0ZXBdCi0gICAgICAgIFZMRDEgICAge2RMZWZ0VmFsWzVdfSxbcFRtcF0sc3RlcCAgICAgICAgICAgICAgICAgICA7Ly8gcFNyY0xlZnRbNSpsZWZ0U3RlcF0KLSAgICAgICAgVkxEMSAgICB7ZExlZnRWYWxbNl19LFtwU3JjTGVmdF0sc3RlcCAgICAgICAgICAgICAgIDsvLyBwU3JjTGVmdFs2KmxlZnRTdGVwXQotICAgICAgICBWTEQxICAgIHtkTGVmdFZhbFs3XX0sW3BUbXBdICAgICAgICAgICAgICAgICAgICAgICAgOy8vIHBTcmNMZWZ0WzcqbGVmdFN0ZXBdICAgICAgCi0gICAgICAgIAotICAgICAgICBUU1QgICAgIGF2YWlsYWJpbGl0eSwgI09NWF9WQ19VUFBFUgotICAgICAgICBCRVEgICAgIERDQ2hyb21hOHg4TGVmdE9ubHlBdmFpbGFibGUKLQotICAgICAgICA7Ly8gTG9hZCBVcHBlciBFZGdlIGFsc28KLSAgICAgICAgVkxEMSAgICAgZEFib3ZlVmFsLFtwU3JjQWJvdmVdICAgICAgICAgICAgICAgICAgICAgIDsvLyBwU3JjQWJvdmVbMCB0byA3XSAgCi0gICAgICAgIAotICAgICAgICBNT1YgICAgICByZXR1cm4sICNPTVhfU3RzX05vRXJyICAgICAgICAgICAgICAgICAgICAgOy8vIHJldHVybk5vRXJyb3IKLSAgICAgICAgCi0gICAgICAgIFZQQURETCAgIGRTdW1BYm92ZVZhbFUxNiwgZEFib3ZlVmFsICAgICAgICAgICAgICAgICA7Ly8gcFNyY0Fib3ZlWyA2KzcgfCA0KzUgfCAyKzMgfCAwKzEgXSAgICAgICAgICAgICAKLSAgICAgICAgVlBBRERMICAgZFN1bUFib3ZlVmFsVTMyLCBkU3VtQWJvdmVWYWxVMTYgICAgICAgICAgIDsvLyBwU3JjQWJvdmVbIDQrNSs2KzcgfCAgMCsxKzIrMyBdIAotICAgICAgICAgICAgICAgIAotICAgICAgICBWUEFEREwgICBkU3VtTGVmdFZhbFUxNiwgZExlZnRWYWwgICAgICAgICAgICAgICAgICAgOy8vIHBTcmNMZWZ0WyA2KzcgfCA0KzUgfCAyKzMgfCAwKzEgXSAgICAgICAgICAgICAKLSAgICAgICAgVlBBRERMICAgZFN1bUxlZnRWYWxVMzIsIGRTdW1MZWZ0VmFsVTE2ICAgICAgICAgICAgIDsvLyBwU3JjTGVmdFsgNCs1KzYrNyB8ICAwKzErMiszIF0gICAgICAgICAgICAgCi0gICAgICAgIAotICAgICAgICBWQUREICAgICBkU3VtQWJvdmVMZWZ0LGRTdW1BYm92ZVZhbFUzMixkU3VtTGVmdFZhbFUzMgotICAgICAgICBWUlNIUiAgICBkU3VtQWJvdmVMZWZ0LGRTdW1BYm92ZUxlZnQsIzMgICAgICAgICAgICAgOy8vIFN1bSA9IChTdW0gKyA0KSA+PiAzCi0gICAgICAgIFZSU0hSICAgIGRTdW1BYm92ZVZhbFUzMixkU3VtQWJvdmVWYWxVMzIsIzIgICAgICAgICA7Ly8gU3VtID0gKFN1bSArIDIpID4+IDIKLSAgICAgICAgVlJTSFIgICAgZFN1bUxlZnRWYWxVMzIsZFN1bUxlZnRWYWxVMzIsIzIgICAgICAgICAgIDsvLyBTdW0gPSAoU3VtICsgMikgPj4gMgotICAgICAgICAKLSAgICAgICAgVk1PViAgICAgZEluZGV4Um93MFU4LCMweDBjICAgICAgICAgICAgICAgICAgICAgICAgIAotICAgICAgICBWTU9WICAgICBkSW5kZXhSb3c0VTgsIzB4MDQKLSAgICAgICAgVlNITCAgICAgZEluZGV4Um93MCxkSW5kZXhSb3cwLCMzMiAgICAgICAgICAgICAgICAgIDsvLyBpbmRleDAgPSAweDBjMGMwYzBjMDAwMDAwMDAgCi0gICAgICAgIFZTSFIgICAgIGRJbmRleFJvdzQsZEluZGV4Um93NCwjMzIgICAgICAgICAgICAgICAgICA7Ly8gaW5kZXg0ID0gMHgwMDAwMDAwMDA0MDQwNDA0Ci0gICAgICAgIFZBREQgICAgIGRJbmRleFJvdzRVOCxkSW5k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8vIHBEc3RbNSpkc3RTdGVwK3hdIDowPD0geCA8PSA3Ci0gICAgICAgIFZTVDEgICAgIGREc3RSb3c0LFtwRHN0XSxzdGVwICAgICAgICAgICAgICAgICAgICA7Ly8gcERzdFs2KmRzdFN0ZXAreF0gOjA8PSB4IDw9IDcKLSAgICAgICAgVlNUMSAgICAgZERzdFJvdzQsW3BUbXBdICAgICAgICAgICAgICAgICAgICAgICAgIDsvLyBwRHN0WzcqZHN0U3RlcCt4XSA6MDw9IHggPD0gNwotCi0gICAgICAgIE1fRVhJVAotICAgICAgICAKLQotRENDaHJvbWE4eDhMZWZ0T25seUF2YWlsYWJsZQotCi0gICAgICAgIE1PViAgICAgIHJldHVybiwgI09NWF9TdHNfTm9FcnIKLSAgICAgICAgCi0gICAgICAgIFZQQURETCAgIGRTdW1MZWZ0VmFsVTE2LCBkTGVmdFZhbCAgICAgICAgICAgICAgICAgICA7Ly8gcFNyY0xlZnRbIDYrNyB8IDQrNSB8IDIrMyB8IDArMSBdICAgICAgICAgICAgIAotICAgICAgICBWUEFEREwgICBkU3VtTGVmdFZhbFUzMiwgZFN1bUxlZnRWYWxVMTYgICAgICAgICAgICAgOy8vIHBTcmNMZWZ0WyA0KzUrNis3IHwgIDArMSsyKzMgXSAgIAotICAgICAgICBWUlNIUiAgICBkU3VtTGVmdFZhbFUzMixkU3VtTGVmdFZhbFUzMiwjMiAgICAgICAgICAgOy8vIFN1bSA9IChTdW0gKyAyKSA+PiAyCi0gICAgICAgIAotICAgICAgICBWRFVQICAgICBkRHN0Um93MCxkU3VtTGVmdFZhbFU4WzBdCi0gICAgICAgIFZEVVAgICAgIGREc3RSb3c0LGRTdW1MZWZ0VmFsVThbNF0KLSAgICAgICAgCi0gICAgICAgIEIgICAgICAgIERDQ2hyb21hOHg4TGVmdFN0b3JlICAKLSAgICAgICAgCi0KLURDQ2hyb21hOHg4TGVmdE5vdEF2YWlsYWJsZQotICAgICAgICAgICAgICAgICAKLSAgICAgICAgVFNUICAgICBhdmFpbGFiaWxpdHksICNPTVhfVkNfVVBQRVIKLSAgICAgICAgQkVRICAgICBEQ0Nocm9tYTh4OE5vbmVBdmFpbGFibGUKLQotICAgICAgICA7Ly8gTG9hZCBVcHBlciBFZGdlIAotICAgICAgICBWTEQxICAgICBkQWJvdmVWYWwsW3BTcmNBYm92ZV0gICAgICAgICAgICAgICAgICAgICAgOy8vIHBTcmNBYm92ZVswIHRvIDddICAKLSAgICAgICAgTU9WICAgICAgcmV0dXJuLCAjT01YX1N0c19Ob0VyciAgICAgICAgICAgICAgICAgICAgIDsvLyByZXR1cm5Ob0Vycm9yCi0gICAgICAgIAotICAgICAgICBWUEFEREwgICBkU3VtQWJvdmVWYWxVMTYsIGRBYm92ZVZhbCAgICAgICAgICAgICAgICAgOy8vIHBTcmNBYm92ZVsgNis3IHwgNCs1IHwgMiszIHwgMCsxIF0gICAgICAgICAgICAgCi0gICAgICAgIFZQQURETCAgIGRTdW1BYm92ZVZhbFUzMiwgZFN1bUFib3ZlVmFsVTE2ICAgICAgICAgICA7Ly8gcFNyY0Fib3ZlWyA0KzUrNis3IHwgIDArMSsyKzMgXSAKLSAgICAgICAgVlJTSFIgICAgZFN1bUFib3ZlVmFsVTMyLGRTdW1BYm92ZVZhbFUzMiwjMiAgICAgICAgIDsvLyBTdW0gPSAoU3VtICsgMikgPj4gMgotICAgICAgICBWTU9WICAgICBkSW5kZXhSb3cwVTgsIzB4MDQKLSAgICAgICAgVlNITCAgICAgZEluZGV4Um93MCxkSW5kZXhSb3cwLCMzMiAgICAgICAgICAgICAgICAgIDsvLyBpbmRleCA9IDB4MDQwNDA0MDQwMDAwMDAwMAotICAgICAgICBWVEJMICAgICBkRHN0Um93MCx7ZFN1bUFib3ZlVmFsVTh9LGRJbmRleFJvdzBVOCAKLSAgICAgICAgCi0gICAgICAgIEIgICAgICAgIERDQ2hyb21hOHg4VXBwZXJTdG9yZQotICAgICAgICAKLQotRENDaHJvbWE4eDhOb25lQXZhaWxhYmxlICAgICAgICAKLSAgICAgICAgCi0gICAgICAgIFZNT1YgICAgIGRDb25zdDEyOFU4LCMweDgwICAgICAgICAgICAgICAgICAgICAgICAgICA7Ly8gMHg4MDgwODA4MDgwODA4MDgwIGlmKGNvdW50ID09IDApCi0gICAgICAgIE1PViAgICAgIHJldHVybiwgI09NWF9TdHNfTm9FcnIgICAgICAgICAgICAgICAgICAgICA7Ly8gcmV0dXJuTm9FcnJvcgotCi1EQ0Nocm9tYTh4OFVwcGVyU3RvcmUgICAgICAgIAotICAgICAgICAKLSAgICAgICAgQUREICAgICBwVG1wLCBwRHN0LCBkc3RTdGVwCi0gICAgICAgIEFERCAgICAgc3RlcCwgZHN0U3RlcCwgZHN0U3RlcAotICAgICAgICAKLSAgICAgICAgVlNUMSAgICAgZERzdFJvdzAsW3BEc3RdLHN0ZXAgICAgICAgICAgICAgICAgICAgIDsvLyBwRHN0WzAqZHN0U3RlcCt4XSA6MDw9IHggPD0gNwotICAgICAgICBWU1QxICAgICBkRHN0Um93MCxbcFRtcF0sc3RlcCAgICAgICAgICAgICAgICAgICAgOy8vIHBEc3RbMSpkc3RTdGVwK3hdIDowPD0geCA8PSA3Ci0gICAgICAgIFZTVDEgICAgIGREc3RSb3cwLFtwRHN0XSxzdGVwICAgICAgICAgICAgICAgICAgICA7Ly8gcERzdFsyKmRzdFN0ZXAreF0gOjA8PSB4IDw9IDcKLSAgICAgICAgVlNUMSAgICAgZERzdFJvdzAsW3BUbXBdLHN0ZXAgICAgICAgICAgICAgICAgICAgIDsvLyBwRHN0WzMqZHN0U3RlcCt4XSA6MDw9IHggPD0gNwotICAgICAgICBWU1QxICAgICBkRHN0Um93MCxbcERzdF0sc3RlcCAgICAgICAgICAgICAgICAgICAgOy8vIHBEc3RbNCpkc3RTdGVwK3hdIDowPD0geCA8PSA3Ci0gICAgICAgIFZTVDEgICAgIGREc3RSb3cwLFtwVG1wXSxzdGVwICAgICAgICAgICAgICAgICAgICA7Ly8gcERzdFs1KmRzdFN0ZXAreF0g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ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDsvLyBwU3JjTGVmdFs1XSAtIHBTcmNMZWZ0WzFdCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA7Ly8gcFNyY0xlZnRbNF0gLSBwU3JjTGVmdFsyXQotICAgICAgICAKLSAgICAgICAgTERSICAgICBwTXVsdGlwbGllclRhYmxlLD1hcm1WQ000UDEwX011bHRpcGxpZXJUYWJsZUNocm9tYTh4OCAgIDsvLyBVc2VkIHRvIGNhbGN1bGF0ZSBIdmFsICYgVnZhbCAgCi0gICAgICAgIFZTSEwgICAgZEFib3ZlRGlmZjBVNjQsZEFib3ZlRGlmZjBVNjQsIzE2ICAKLSAgICAgICAgVkVYVCAgICBkRGlmZkFib3ZlVTgsZEFib3ZlRGlmZjBVOCxkQWJvdmU3bWludXMwVTgsIzIgICAgICAgICAgIDsvLyBwU3JjQWJvdmVbIDctMCB8IDQtMiB8IDUtMSB8IDYtMCBdCi0gICAgICAgIFZMRDEgICAgZE11bHRpcGxpZXIsW3BNdWx0aXBsaWVyVGFibGVdISAKLSAgICAgICAgVlNITCAgICBkTGVmdERpZmYwVTY0LGRMZWZ0RGlmZjBVNjQsIzE2ICAKLSAgICAgICAgVkVYVCAgICBkRGlmZkxlZnRVOCxkTGVmdERpZmYwVTgsZExlZnQ3bWludXMwVTgsIzIgICAgICAgICAgICAgIDsvLyBwU3JjTGVmdFsgNy0wIHwgNC0yIHwgNS0xIHwgNi0wIF0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCi0gICAgICAgIAotICAgICAgICBWTVVMICAgIGRIb3JQcmVkLGREaWZmQWJvdmVTMTYsZE11bHRpcGxpZXIgICAgICAgICAgICAgICAgICAgICAgOy8vIHBTcmNBYm92ZVsgNCooNy0wKSB8IDEqKDQtMikgfCAyKig1LTEpIHwgMyooNi0wKSBdCi0gICAgICAgIFZNVUwgICAgZFZlclByZWQsZERpZmZMZWZ0UzE2LGRNdWx0aXBsaWVyCi0gICAgICAgIFZQQUREICAgZEhWVmFsUzE2LGRIb3JQcmVkLGRWZXJQcmVkCi0gICAgICAgIAotICAgICAgICAKLSAgICAgICAgVlBBRERMICBkSFZWYWxTMzIsZEhWVmFsUzE2ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDsvLyBbVnxIXSBpbiAzMiBiaXRzIGVhY2gKLSAgICAgICAgVlNITCAgICBkSFZUZW1wUzMyLGRIVlZhbFMzMiwjNCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDsvLyAxNypIID0gMTYqSCArIEggPSAoSDw8NCkrSAotICAgICAgICBWQUREICAgIGRIVlZhbFMzMixkSFZWYWxTMzIsZEhWVGVtcFMzMiAgICAgICAgICAgICAgICAgICAgICAgICAgOy8vIFsgMTcqViAgfCAxNypIIF1pbiAzMiBiaXRzIGVhY2gKLSAgICAgICAgVkxEMSAgICB7ZE11bHRpcGxpZXIwLGRNdWx0aXBsaWVyMX0sW3BNdWx0aXBsaWVyVGFibGVdICAgICAgICAgIDsvLyBxTXVsdGlwbGllciA9IFsgNHwzfDJ8MXwwfC0xfC0yfC0zIF0gIAotICAgICAgICBWUlNIUiAgIGRIVlZhbFMzMixkSFZWYWxTMzIsIzUgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOy8vIFtjfGJdIGluIDE2Yml0cyBlYWNoCi0gICAgICAgIFZBRERMICAgcUEsZEFib3ZlVmFsLGRMZWZ0VmFsCi0gICAgICAgIFZEVVAgICAgcUEscUFbN10KLSAgICAgICAgVlNITCAgICBxQSxxQSwjNCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDsvLyBbYXxhfGF8YXxhfGF8YXxhXQotICAgICAgICBWRFVQICAgIHFCLGRIVlZhbFMxNlswXSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOy8vIFtifGJ8YnxifGJ8YnxifGJdCi0gICAgICAgIFZEVVAgICAgcUMsZEhWVmFsUzE2WzJdICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA7Ly8gW2N8Y3xjfGN8Y3xjfGN8Y10KLSAgICAgICAgCi0gICAgICAgIAotICAgICAgICBWTVVMICAgIHFCLHFCLHFNdWx0aXBsaWVyCi0gICAgICAgIFZNVUwgICAgcUMscUMscU11bHRpcGxpZXIKLSAgICAgICAgVkFERCAgICBxQixxQixxQSAKLSAgICAgICAgCi0gICAgICAgIFZEVVAgICAgcUMwLHFDWzBdCi0gICAgICAgIFZEVVAgICAgcUMxLHFDWzFdCi0gICAgICAgIFZEVVAgICAgcUMyLHFDWzJdCi0gICAgICAgIFZEVVAgICAgcUMzLHFDWzNdCi0gICAgICAgIFZEVVAgICAgcUM0LHFDWzRdCi0gICAgICAgIFZEVVAgICAgcUM1LHFDWzVdCi0gICAgICAgIFZEVVAgICAgcUM2LHFDWzZdCi0gICAgICAgIFZEVVAgICAgcUM3LHFDWzddCi0gICAgICAgIAotICAgICAgICBWQUREICAgIHFTdW0wLHFCLHFDMAotICAgICAgICBWQUREICAgIHFTdW0xLHFCLHFDMQotICAgICAgICBWQUREICAgIHFTdW0yLHFCLHFDMgotICAgICAgICBWQUREICAgIHFTdW0zLHFCLHFDMwotICAgICAgICBWQUREICAgIHFTdW00LHFCLHFDNAotICAgICAgICBWQUREICAgIHFTdW01LHFCLHFDNQotICAgICAgICBWQUREICAgIHFTdW02LHFCLHFDNgotICAgICAgICBWQUREICAgIHFTdW03LHFCLHFDNwotICAgICAgICAKLSAgICAgICAgVlFSU0hSVU4gZFN1bTAscVN1bTAsIzUgICAgICAgICAgICAgICAgICAgICAgICAgOy8vIChPTVhfVTgpYXJtQ2xpcCgwLDI1NSwoU3VtKzE2KT4+NSkKLSAgICAgICAgVlFSU0hSVU4gZFN1bTEscVN1bTEsIzUKLSAgICAgICAgVlFSU0hSVU4gZFN1bTIscVN1bTIsIzUKLSAgICAgICAgVlFSU0hSVU4gZFN1bTMscVN1bTMsIzUKLSAgICAgICAgVlFSU0hSVU4gZFN1bTQscVN1bTQsIzUKLSAgICAgICAgVlFSU0hSVU4gZFN1bTUscVN1bTUsIzUKLSAgICAgICAgVlFSU0hSVU4gZFN1bTYscVN1bTYsIzUKLSAgICAgICAgVlFSU0hSVU4gZFN1bTcscVN1bTcsIzUgICAgICAKLQotRENDaHJvbWE4eDhQbGFuZVN0b3JlICAgICAgICAKLSAgICAgICAgQUREICAgICBwVG1wLCBwRHN0LCBkc3RTdGVwCi0gICAgICAgIEFERCAgICAgc3RlcCwgZHN0U3RlcCwgZHN0U3RlcAotICAgICAgICAKLSAgICAgICAgVlNUMSAgICBkU3VtMCxbcERzdF0sc3RlcCAgICAgICAgICAgICAgICAgICAgOy8vIHBEc3RbMCpkc3RTdGVwK3hdIDowPD0geCA8PSA3Ci0gICAgICAgIFZTVDEgICAgZFN1bTEsW3BUbXBdLHN0ZXAgICAgICAgICAgICAgICAgICAgIDsvLyBwRHN0WzEqZHN0U3RlcCt4XSA6MDw9IHggPD0gNwotICAgICAgICBWU1QxICAgIGRTdW0yLFtwRHN0XSxzdGVwICAgICAgICAgICAgICAgICAgICA7Ly8gcERzdFsyKmRzdFN0ZXAreF0gOjA8PSB4IDw9IDcKLSAgICAgICAgVlNUMSAgICBkU3VtMyxbcFRtcF0sc3RlcCAgICAgICAgICAgICAgICAgICAgOy8vIHBEc3RbMypkc3RTdGVwK3hdIDowPD0geCA8PSA3Ci0gICAgICAgIFZTVDEgICAgZFN1bTQsW3BEc3RdLHN0ZXAgICAgICAgICAgICAgICAgICAgIDsvLyBwRHN0WzQqZHN0U3RlcCt4XSA6MDw9IHggPD0gNwotICAgICAgICBWU1QxICAgIGRTdW01LFtwVG1wXSxzdGVwICAgICAgICAgICAgICAgICAgICA7Ly8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gICAgUk4gMTEgICAKLXBNdWx0VGFibGUgICAgICBSTiA5Ci07IC0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0KLTsgTmVvbiByZWdpc3RlcnMKLTsgLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLQotcUFib3ZlICAgICAgICAgIFFOIFEwLlU4Ci1xTGVmdCAgICAgICAgICAgUU4gUTEuVTgKLXFTdW04ICAgICAgICAgICBRTiBRMC5VMTYKLWRTdW04MCAgICAgICAgICBETiBEMC5VMTYKLWRTdW04MSAgICAgICAgICBETiBEMS5VMTYKLWRTdW00ICAgICAgICAgICBETiBEMC5VMTYKLWRTdW0yICAgICAgICAgICBETiBEMC5VMzIKLWRTdW0xICAgICAgICAgICBETiBEMC5VNjQKLXFPdXQgICAgICAgICAgICBRTiBRMy5VOAotZFN1bUxlZnQgICAgICAgIEROIEQ2LlU2NAotZFN1bUFib3ZlICAgICAgIEROIEQ3LlU2NAotZFN1bSAgICAgICAgICAgIEROIEQ4LlU2NAotZFN1bTAgICAgICAgICAgIEROIEQ4LlU4WzBdCi0KLXFIICAgICAgICAgICAgICBRTiBRMTEuUzMyCi1xViAgICAgICAgICAgICAgUU4gUTEyLlMzMgotcUEgICAgICAgICAgICAgIFFOIFExMS5TMTYKLXFCICAgICAgICAgICAgICBRTiBRNi5TMTYKLXFDICAgICAgICAgICAgICBRTiBRNy5TMTYKLQotcUIwICAgICAgICAgICAgIFFOIFE1LlMxNgotcUIxICAgICAgICAgICAgIFFOIFE2LlMxNgotZEExICAgICAgICAgICAgIEROIEQyMy5TMTYKLQotZEgwICAgICAgICAgICAgIEROIEQyMi5TMzIKLWRIMSAgICAgICAgICAgICBETiBEMjMuUzMyCi1kVjAgICAgICAgICAgICAgRE4gRDI0LlMzMgotZFYxICAgICAgICAgICAgIEROIEQyNS5TMzIKLQotcUhWICAgICAgICAgICAgIFFOIFEx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BCTkUgICAgICBMb29wSG9yICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDsvLyBMb29wIGZvciAxNiB0aW1lcwotICAgICAgICBNT1YgICAgICByZXR1cm4sICNPTVhfU3RzX05vRXJyCi0gICAgICAgIE1fRVhJVAotICAgICAgICAKLU9NWF9WQ18xNlgxNl9EQwotICAgICAgICBNT1YgICAgICBjb3VudCwgIzAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA7Ly8gY291bnQgPSAwCi0gICAgICAgIFRTVCAgICAgIGF2YWlsYWJpbGl0eSwgI09NWF9WQ19MRUZUCi0gICAgICAgIEJFUSAgICAgIFVwcGVyT3JOb25lQXZhaWxhYmxlICAgICAgICAgICAgICAgICAgICAgIDsvLyBKdW1wIHRvIFVwcGVyIGlmIG5vdCBsZWZ0Ci0KLSAgICAgICAgQUREICAgICBwVG1wLCBwU3JjTGVmdCwgbGVmdFN0ZXAKLSAgICAgICAgQUREICAgICBzdGVwLCBsZWZ0U3RlcCwgbGVmdFN0ZXAKLQotICAgICAgICBWTEQxICAgIHtxTGVmdFswXX0sIFtwU3JjTGVmdF0sc3RlcCAgICAKLSAgICAgICAgVkxEMSAgICB7cUxlZnRbMV19LCBbcFRtcF0sc3RlcCAgIAotICAgICAgICBWTEQxICAgIHtxTGVmdFsyXX0sIFtwU3JjTGVmdF0sc3RlcCAgIAotICAgICAgICBWTEQxICAgIHtxTGVmdFszXX0sIFtwVG1wXSxzdGVwCi0gICAgICAgIFZMRDEgICAge3FMZWZ0WzRdfSwgW3BTcmNMZWZ0XSxzdGVwICAgCi0gICAgICAgIFZMRDEgICAge3FMZWZ0WzVdfSwgW3BUbXBdLHN0ZXAgICAKLSAgICAgICAgVkxEMSAgICB7cUxlZnRbNl19LCBbcFNyY0xlZnRdLHN0ZXAgICAgCi0gICAgICAgIFZMRDEgICAge3FMZWZ0WzddfSwgW3BUbXBdLHN0ZXAKLSAgICAgICAgVkxEMSAgICB7cUxlZnRbOF19LCBbcFNyY0xlZnRdLHN0ZXAgICAgCi0gICAgICAgIFZMRDEgICAge3FMZWZ0WzldfSwgW3BUbXBdLHN0ZXAgICAKLSAgICAgICAgVkxEMSAgICB7cUxlZnRbMTBdfSxbcFNyY0xlZnRdLHN0ZXAgICAKLSAgICAgICAgVkxEMSAgICB7cUxlZnRbMTFdfSxbcFRtcF0sc3RlcCAgICAKLSAgICAgICAgVkxEMSAgICB7cUxlZnRbMTJdfSxbcFNyY0xlZnRdLHN0ZXAgICAKLSAgICAgICAgVkxEMSAgICB7cUxlZnRbMTNdfSxbcFRtcF0sc3RlcCAgIAotICAgICAgICBWTEQxICAgIHtxTGVmdFsxNF19LFtwU3JjTGVmdF0sc3RlcCAgICAKLSAgICAgICAgVkxEMSAgICB7cUxlZnRbMTVdfSxbcFRtcF0gCi0gICAgICAgIAotICAgICAgICBWUEFEREwgICBxU3VtOCwgcUxlZnQKLSAgICAgICAgQUREICAgICBjb3VudCwgY291bnQsICMxICAgIAotICAgICAgICBWUEFERCAgICBkU3VtNCwgZFN1bTgwLCBkU3VtODEKLSAgICAgICAgVlBBRERMICAgZFN1bTIsIGRTdW00Ci0gICAgICAgIFZQQURETCAgIGRTdW1MZWZ0LCBkU3VtMgotICAgICAgICBWUlNIUiAgICBkU3VtLCBkU3VtTGVmdCwgIzQKLSAgICAgICAgCi1VcHBlck9yTm9uZUF2YWlsYWJsZQotICAgICAgICBUU1QgICAgICBhdmFpbGFiaWxpdHksICAjT01YX1ZDX1VQUEVSICAgICAgICAgICAgICA7Ly8gaWYoYXZhaWxhYmlsaXR5ICYgI09NWF9WQ19VUFBFUikKLSAgICAgICAgQkVRICAgICAgQm90aE9yTm9uZUF2YWlsYWJsZSAgICAgICAgICAgICAgICAgICAgICAgOy8vIEp1bXAgdG8gTGVmdCBpZiBub3QgdXBwZXIKLSAgICAgICAgVkxEMSAgICAgcUFib3ZlLCBbcFNyY0Fib3ZlXQotICAgICAgICBBREQgICAgICBjb3VudCwgY291bnQsICMxICAgICAgICAgICAgICAgICAgICAgICAgICA7Ly8gaWYgdXBwZXIgaW5jIGNvdW50IGJ5IDEKLSAgICAgICAgVlBBRERMICAgcVN1bTgsIHFBYm92ZQotICAgICAgICBWUEFERCAgICBkU3VtNCwgZFN1bTgwLCBkU3VtODEKLSAgICAgICAgVlBBRERMICAgZFN1bTIsIGRTdW00Ci0gICAgICAgIFZQQURETCAgIGRTdW1BYm92ZSwgZFN1bTIKLSAgICAgICAgVlJTSFIgICAgZFN1bSwgZFN1bUFib3ZlLCAjNAotICAgICAgICAKLUJvdGhPck5vbmVBdmFpbGFibGUKLSAgICAgICAgQ01QICAgICAgY291bnQsICMyICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDsvLyBjaGVjayBpZiBib3RoIGF2YWlsYWJsZQotICAgICAgICBCTkUgICAgICBOb25lQXZhaWxhYmxlCi0gICAgICAgIFZBREQgICAgIGRTdW0sIGRTdW1BYm92ZSwgZFN1bUxlZnQKLSAgICAgICAgVlJTSFIgICAgZFN1bSwgZFN1bSwgIzUKLSAgICAgICAgCi0KLU5vbmVBdmFpbGFibGUKLSAgICAgICAgVkRVUCAgICAgcU91dCwgZFN1bTAgICAgICAgIAotICAgICAgICBDTVAgICAgICBjb3VudCwgIzAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOy8vIGNoZWNrIGlmIG5vbmUgYXZhaWxhYmxlCi0gICAgICAgIEFERCAgICAgIHBUbXAsIHBEc3QsIGRzdFN0ZXAKLSAgICAgICAgQUREICAgICAgc3RlcCwgZHN0U3RlcCwgZHN0U3RlcAotICAgICAgICBCTkUgICAgICBMb29wREMKLSAgICAgICAgVk1PViAgICAgcU91dCwgIzEyOAotTG9vcERDICAgICAgICAKLSAgICAgICAgVlNUMSAgICBxT3V0LCBbcERzdF0sIHN0ZXAKLSAgICAgICAgVlNUMSAgICBxT3V0LCBbcFRtcF0sIHN0ZXAKLSAgICAgICAgVlNUMSAgICBxT3V0LCBbcERzdF0sIHN0ZXAKL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i0gICAgICAgIFZTVUJMICAgcUxlZnREaWZmLGRSZXZMZWZ0LCBkTGVmdDAgICAgICAgICAgICAgICAgICAKLSAgICAgICAgCi0gICAgICAgIDsvLyBNdWx0aXBsaWVyID0gWzh8MXwyfC4uLnw2fDddCi0gICAgICAgIFZMRDEgICAgcU11bHRpcGxpZXIsIFtwTXVsdFRhYmxlXSEgICAgICAgICAgICAgICAgICAKLSAgICAgICAgCi0gICAgICAgIFZTSEwgICAgZExlZnREaWZmNjQsIGRMZWZ0RGlmZjY0LCAjMTYKLSAgICAgICAgVkVYVCAgICBkRGlmZkxlZnQxLCBkTGVmdERpZmYxLCBkTGVmdDE1bWludXMwLCAjMSAgICAgCi0gICAgICAgIAotICAgICAgICBWTVVMTCAgIHFILGREaWZmQWJvdmUwLCBkTXVsdGlwbGllcjAgICAgICAgICAgICAgICAgCi0gICAgICAgIFZNVUxMICAgcVYsZERpZmZMZWZ0MCwgIGRNdWx0aXBsaWVyMCAgICAgICAgICAgICAgICAKLSAgICAgICAgVk1MQUwgICBxSCxkRGlmZkFib3ZlMSwgZE11bHRpcGxpZXIxIAotICAgICAgICBWTUxBTCAgIHFWLGREaWZmTGVmdDEsICBkTXVsdGlwbGllcjEKLSAgICAgICAgCi0gICAgICAgIFZQQUREICAgZEhWMDAsZEgxLGRIMCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAotICAgICAgICBWUEFERCAgIGRIVjAxLGRWMSxkVjAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKLSAgICAgICAgVlBBRERMICBxSFYsIHFIVjAKLSAgICAgICAgVlNITCAgICBxSFYxLHFIViwjMgotICAgICAgICBWQUREICAgIHFIVixxSFYscUhWMSAKLSAgICAgICAgCi0gICAgICAgIDsvLyBIViA9IFtjID0gKCg1KlYrMzIpPj42KSB8IGIgPSAoKDUqSCszMik+PjYpXQotICAgICAgICBWUlNIUiAgIHFIVixxSFYsIzYKLSAgICAgICAgCi0gICAgICAgIDsvLyBIVjEgPSBbYyo3fGIqN10KLSAgICAgICAgVlNITCAgICBxSFYxLHFIViwjMwotICAgICAgICBWU1VCICAgIHFIVjEscUhWMSxxSFYgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAotICAgICAgICAKLSAgICAgICAgOy8vIE11bHRpcGxpZXIxID0gWzB8MXwyfC4uLnw3XQotICAgICAgICBWTEQxICAgIHFNdWx0aXBsaWVyMCwgW3BNdWx0VGFibGVdISAgICAKLSAgICAgICAgVkRVUCAgICBxQiwgZEhWMCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKLSAgICAgICAgVkRVUCAgICBxQywgZEhWMSAKLSAgICAgICAgCi0gICAgICAgIFZBRERMICAgcUEsZEFib3ZlMSxkTGVmdDEKLSAgICAgICAgVlNITCAgICBxQSxxQSwgIzQKLSAgICAgICAgVkRVUCAgICBxQSxkQTFbM10gIAotICAgICAgICBWQUREICAgIGRCUGx1c0NNdWx0NywgZEhWMTAsIGRIVjExCi0gICAgICAgIAotICAgICAgICA7Ly8gTXVsdGlwbGllcjEgPSBbOHw5fDEwfC4uLnwxNV0KLSAgICAgICAgVkxEMSAgICBxTXVsdGlwbGllcjEsIFtwTXVsdFRhYmxlXQotICAgICAgICA7Ly8gQ29uc3QgPSBhIC0gNyooYitjKQotICAgICAgICBWRFVQICAgIHFDb25zdCwgZEJQbHVzQ011bHQ3UzE2WzBdCi0gICAgICAgIFZTVUIgICAgcUNvbnN0LCBxQSwgcUNvbnN0Ci0gICAgICAgIAotICAgICAgICA7Ly8gQjAgPSBbMCpifDEqYnwyKmJ8MypifC4uLi4uLnw3KmJdCi0gICAgICAgIFZNVUwgICAgcUIwLHFCLHFNdWx0aXBsaWVyMAotICAgICAgICAKLSAgICAgICAgOy8vIEIwID0gWzgqYnw5KmJ8MTAqYnwxMSpifC4uLi58MTUqYl0KLSAgICAgICAgVk1VTCAgICBxQjEscUIscU11bHRpcGxpZXIxCi0gICAgICAgIAotICAgICAgICBWQUREICAgIHFTdW0wLCB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F0sW3BEc3RUbXBdLGRzdGVwICAgICAgICAgICAgIDsvLyBwRHN0WzEqZHN0U3RlcCt4XSA6MDw9IHggPD0gNwotICAgICAgICBWU1QxICAgIGRMZWZ0VmFsMlUzMlswXSxbcERzdF0gICAgICAgICAgICAgICAgICAgICAgOy8vIHBEc3RbMipkc3RTdGVwK3hdIDowPD0geCA8PSA3Ci0gICAgICAgIFZTVDEgICAgZExlZnRWYWwzVTMyWzBdLFtwRHN0VG1wXSAgICAgICAgICAgICAgICAgICA7Ly8gcERzdFszKmRzdFN0ZXAreF0gOjA8PSB4IDw9IDcKLSAgICAgICAgCi0gICAgICAgIEIgICAgICAgIEV4aXRQcmVkaWN0NHg0ICAgICAgICAgICAgICAgICAgICAgICAgICAgICA7Ly8gQnJhbmNoIHRvIGV4aXQgY29kZQotICAgICAgICAKLU9NWF9WQ180eDRfVkVSVAotICAgICAgICAKLSAgICAgICAgOy8vIExvYWQgVXBwZXIgRWRnZQotICAgICAgICBWTEQxICAgICBkQWJvdmVVMzJbMF0sW3BTcmNBYm92ZV0KLSAgICAgICAgQUREICAgICBwRHN0VG1wLCBwRHN0LCBkc3RTdGVwCi0gICAgICAgIEFERCAgICAgZHN0ZXAsIGRzdFN0ZXAsIGRzdFN0ZXAKLSAgICAgICAgCi1EQ1ByZWRpY3Q0eDRWZXJ0U3RvcmUgICAgICAgICAKLSAgICAgICAgCi0gICAgICAgIFZTVDEgICAgIGRBYm92ZVUzMlswXSxbcERzdF0sZHN0ZXAKLSAgICAgICAgVlNUMSAgICAgZEFib3ZlVTMyWzBdLFtwRHN0VG1wXSxkc3RlcAotICAgICAgICBWU1QxICAgICBkQWJvdmVVMzJbMF0sW3BEc3RdCi0gICAgICAgIFZTVDEgICAgIGRBYm92ZVUzMlswXSxbcERzdFRtcF0KLQotICAgICAgICBCICAgICAgICBFeGl0UHJlZGljdDR4NCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOy8vIEJyYW5jaCB0byBleGl0IGNvZGUKLQotT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otICAgICAgICBWUEFEREwgICBkU3VtQWJvdmVWYWxVMzIsIGRTdW1BYm92ZVZhbFUxNiAgICAgICAgICAgOy8vIFsgWFhYWCB8IHBTcmNBYm92ZVsyKzMrMCsxXV0gCi0gICAgICAgIAotICAgICAgICBWUlNIUiAgICBkU3VtQWJvdmVWYWxVMzIsZFN1bUFib3ZlVmFsVTMyLCMyICAgICAgICAgOy8vIFN1bSA9IChTdW0gKyAyKSA+PiAyCi0gICAgICAgIEFERCAgICAgcERzdFRtcCwgcERzdCwgZHN0U3RlcAotICAgICAgICBBREQgICAgIGRzdGVwLCBkc3RTdGVwLCBkc3RTdGVwCi0gICAgICAgIFZEVVAgICAgIGRTdW0sZFN1bUFib3ZlVmFsVThbMF0KLSAgICAgICAgCi0gICAgICAgIEIgICAgICAgIERDUHJlZGljdDR4NFZlcnRTdG9yZSAgIAotICAgICAgICAKLURDUHJlZGljdDR4NE5vbmVBdmFpbGFibGUgICAgICAgIAotICAgICAgICAKLSAgICAgICAgVk1PViAgICAgZENvbnN0MTI4VTgsIzB4ODAgICAgICAgICAgICAgICAgICAgICAgICAgIDsvLyAweDgwODA4MDgwODA4MDgwODAgaWYoY291bnQgPT0gMCkKLSAgICAgICAgTU9WICAgICAgcmV0dXJuLCAjT01YX1N0c19Ob0VycgotICAgICAgICAKLSAgICAgICAgQUREICAgICBwRHN0VG1wLCBwRHN0LCBkc3RTdGVwCi0gICAgICAgIEFERCAgICAgZHN0ZXAsIGRzdFN0ZXAsIGRzdFN0ZXAKLSAgICAgICAgQiAgICAgICAgRENQcmVkaWN0NHg0VmVydFN0b3JlICAgCi0gICAgICAgIAotICAgICAgICAKLSAgICAgICAgCi1PTVhfVkNfNHg0X0RJQUdfREwKLSAgICAgICAgCi0gICAgICAgIFRTVCAgICAgYXZhaWxhYmlsaXR5LCAjT01YX1ZDX1VQUEVSX1JJR0hUCi0gICAgICAgIEJFUSAgICAgRGlhZ0RMVXBwZXJSaWdodE5vdEF2YWlsYWJsZQotICAg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gICAgOy8vIFtVMyBVMyBVMyBVMyBVMyBVMyBVMyBVMl0KLSAgICAgICAKLURpYWdETFByZWRpY3Q0eDRTdG9yZSAgCi0gICAgICAgIAotICAgICAgICBWSEFERCAgIGRUbXAsIGRBYm92ZTAsIGRBYm92ZTIKLSAgICAgICAgVlJIQUREICBkVG1wLCBkVG1wLCBkQWJvdmUxICAgICAgICAgICAgICAgICAgICAgOy8vIChhKzIqYitjKzIpPj4yCi0gICAgICAgIAotCi0gICAgICAgIFZTVDEgICAgZFRtcFUzMlswXSxbcERzdF0sZHN0U3RlcAotICAgICAgICBWRVhUICAgIGRUbXAsZFRtcCxkVG1wLCMxCi0gICAgICAgIFZTVDEgICAgZFRtcFUzMlswXSxbcERzdF0sZHN0U3RlcAotICAgICAgICBWRVhUICAgIGRUbXAsZFRtcCxkVG1wLCMxCi0gICAgICAgIFZTVDEgICAgZFRtcFUzMlswXSxbcERzdF0sZHN0U3RlcAotICAgICAgICBWRVhUICAgIGRUbXAsZFRtcCxkVG1wLCMxCi0gICAgICAgIFZTVDEgICAgZFRtcFUzMlswXSxbcERzdF0KLSAgICAgICAgCi0gICAgICAgIEIgICAgICAgIEV4aXRQcmVkaWN0NHg0ICAgICAgICAgICAgICAgICAgICAgICAgIDsvLyBCcmFuY2ggdG8gZXhpdCBjb2RlCi0gICAgICAgIAotCi1PTVhfVkNfNHg0X0RJQUdfRFIKLSAgICAgICAgCi0gICAgICAgIAotICAgICAgICA7Ly8gTG9hZCBVMCxVMSxVMixVMwotICAgICAgICAKLSAgICAgICAgVkxEMSAgICBkQWJvdmVVMzJbMF0sW3BTcmNBYm92ZV0gICAgICAgICAgICAgICAgOy8vIFtYfFh8WHxYfFUzfFUyfFUxfFUwXQotICAgICAgICAgICAgICAgIAotICAgICAgICA7Ly8gTG9hZCBVTCxMMCxMMSxMMixMMyAgICAgICAgICAgICAgICAgICAgICAgICA7Ly8gZExlZnQgPSBbVUx8TDB8TDF8TDJ8TDN8WHxYfFhdICAgIAotIC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AgICAgICAgICAgICAgICAgOy8vIFsgWHxVM3xVMnxVMXxVMHxVTHxMMHxMMV0gICAKLSAgICAgICAgCi0gICAgICAgIFZIQUREICAgZFRtcCwgZEFib3ZlMCwgZEFib3ZlMgotICAgICAgICBWUkhBREQgIGRUbXAsIGRUbXAsIGRBYm92ZTEgICAgICAgICAgICAgICAgICAgICA7Ly8gKGErMipiK2MrMik+PjIKLSAgICAgICAgCi0gICAgICAgIAotICAgICAgICBWU1QxICAgIGRUbXBVMzJbMF0sW3BEc3QzXSAgICAgICAgICAgICAgICAgICAgICA7Ly8gU3RvcmUgcFRtcFswXSxbMV0sWzJdLFszXSBAIHBEc3QzCi0gICAgICAgIFZFWFQgICAgZFRtcCxkVG1wLGRUbXAsIzEKLSAgICAgICAgVlNUMSAgICBkVG1wVTMyWzBdLFtwRHN0Ml0gICAgICAgICAgICAgICAgICAgICAgOy8vIFN0b3JlIHBUbXBbMV0sWzJdLFszXSxbNF0gQCBwRHN0MgotICAgICAgICBWRVhUICAgIGRUbXAsZFRtcCxkVG1wLCMxCi0gICAgICAgIFZTVDEgICAgZFRtcFUzMlswXSxbcERzdDFdICAgICAgICAgICAgICAgICAgICAgIDsvLyBTdG9yZSBwVG1wWzJdLFszXSxbNF0sWzVdIEAgcERzdDEKLSAgICAgICAgVkVYVCAgICBkVG1wLGRUbXAsZFRtcCwjMQotICAgICAgICBWU1QxICAgIGRUbXBVMzJbMF0sW3BEc3RdICAgICAgICAgICAgICAgICAgICAgICA7Ly8gU3RvcmUgcFRtcFszXSxbNF0sWzVdLFs2XSBAIHBEc3QKLSAgICAgICAgCi0gICAgICAgIEIgICAgICAgIEV4aXRQcmVkaWN0NHg0ICAgICAgICAgICAgICAgICAgICAgICAgIDsvLyBCcmFuY2ggdG8gZXhpdCBjb2RlCi0KLU9NWF9WQ180eDRfVlIKLQotICAgICAgICAKLSAgICAgICAgOy8vIExvYWQgVUwsVTAsVTEsVTIsVTMKLSAgICAgICAgVkxEMSAgICBkQWJvd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ZW4yLGRMZWZ0MCxkQWJvdmUsIzcgICAgICAgICAgICAgICAgIDsvLyBbIHggeCB4IFUzIFUyIFUxIFUwIEwwIF0KLSAgICAgICAgVkVYVCAgICBkT2RkMCxkTGVmdDEsZEFib3ZlLCM3ICAgICAgICAgICAgICAgICAgOy8vIFsgeCB4IHggVTMgVTIgVTEgVTAgTDEgXQotICAgICAgICBWRVhUICAgIGRPZGQxLGRMZWZ0MCxkT2RkMiwjNyAgICAgICAgICAgICAgICAgICA7Ly8gWyB4IHggeCBVMiBVMSBVMCBVTCBMMCBdCi0gICAgICAgIAotICAgICAgICBWSEFERCAgIGRUbXAxLCBkT2RkMCwgZE9kZDIKLSAgICAgICAgVlJIQUREICBkVG1wMSwgZFRtcDEsIGRPZGQxICAgICAgICAgICAgICAgICAgICAgOy8vIFRtcFsgeCB4IHggOSA3IDUgMyAxIF0KLSAgICAgICAgCi0gICAgICAgIFZIQUREICAgZFRtcDAsIGRFdmVuMCwgZEV2ZW4yCi0gICAgICAgIFZSSEFERCAgZFRtcDAsIGRUbXAwLCBkRXZlbjEgICAgICAgICAgICAgICAgICAgIDsvLyBUbXBbIHggeCB4IDggNiA0IDIgMCBdCi0gICAgICAgIAotICAgICAgICAKLSAgICAgICAgVkVYVCAgICBkVG1wMyxkVG1wMSxkVG1wMSwjMSAgICAgICAgICAgICAgICAgICAgOy8vIFRtcFsgeCB4IHggeCA5IDcgNSAzIF0gCi0gICAgICAgIEFERCAgICAgcERzdFRtcCwgcERzdCwgZHN0U3RlcAotICAgICAgICBBREQgICAgIGRzdGVwLCBkc3RTdGVwLCBkc3RTdGVwCi0gICAgICAgIFZFWFQgICAgZFRtcDIsZFRtcDAsZFRtcDAsIzEgICAgICAgICAgICAgICAgICAgIDsvLyBUbXBbIHggeCB4IHggOCA2IDQgMiBdCi0gICAgICAgIAotICAgICAgICAKLSAgICAgICAgVlNUMSAgICBkVG1wM1UzMlswXSxbcERzdF0sZHN0ZXAgICAgICAgICAgICAgICAgOy8v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A7Ly8gVG1wWyAzfDV8IDcgfDkgfCBYIHwgWCB8IFggfCBYIF0KLSAgICAgICAgCi0gICAgICAgIAotICAgICAgICBWU0hMICAgIGRUbXBVNjQsZFRtcDBVNjQsIzE2ICAgICAgICAgICAgICAgICAgICA7Ly8gVG1wWyAyfDR8Nnw4fCBYIHwgWCB8IFggfCBYIF0KLSAgICAgICAgVlpJUCAgICBkVG1wMSxkVG1wICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOy8vIGRUbXAgPSBbIDIgfCAzIHwgNCB8IDUgfCA2IHwgNyB8IDggfCA5IF0KLSAgICAgICAgVkVYVCAgICBkVG1wMCxkVG1wMCxkVG1wMCwjNiAgICAgICAgICAgICAgICAgICAgOy8vIFRtcFsgIFh8IFh8IFh8IFh8IFh8IFh8IDAgfCAxIF0KLSAgICAgICAgVkVYVCAgICBkVG1wMSxkVG1wLGRUbXAwLCMyICAgICAgICAgICAgICAgICAgICAgOy8vIFRtcFsgMCB8IDEgfCAyIHwgMyB8IDQgfCA1IHwgNiB8NyBdCi0gICAgICAgCi0gICAgICAgIEFERCAgICAgcERzdFRtcCwgcERzdCwgZHN0U3RlcAotICAgICAgICBBREQgICAgIGRzdGVwLCBkc3RTdGVwLCBkc3RTdGVwCi0gICAgICAgIAotICAgICAgICBWU1QxICAgIGRUbXAxVTMyWzFdLFtwRHN0XSxkc3RlcCAgICAgICAgICAgICAgICA7Ly8gU3RvcmUgcFRtcFswfDF8MnwzXQotICAgICAgICBWU1QxICAgIGRUbXBVMzJbMV0sW3BEc3RUbXBdLGRzdGVwICAgICAgICAgICAgICA7Ly8gU3RvcmUgcFRtcFsyfDN8NHw1XQotICAgICAgICBWU1QxICAgIGRUbXAxVTMyWzBdLFtwRHN0XSAgICAgICAgICAgICAgICAgICAgICA7Ly8gU3RvcmUgcFRtcFs0fDV8Nnw3XQotICAgICAgICBWU1QxICAgIGRUbXBVMzJbMF0sW3BEc3RUbXBdICAgICAgICAgICAgICAgICAgICA7Ly8gU3RvcmUgcFRtcFs2fDd8OHw5XQotICAgICAgICAKLSAgICAgICAgQiAgICAgICAgRXhpdFByZWRpY3Q0eDQgICAgICAgICAgICAgICAgICAgICAgICAgOy8vIEJyYW5jaCB0byBleGl0IGNvZGUKLSAgICAgICAgCi1PTVhfVkNfNHg0X1ZMCi0KLSAgICAgICAgCi0gICAgICAgIFRTVCAgICAgYXZhaWxhYmlsaXR5LCAjT01YX1ZDX1VQUEVSX1JJR0hUCi0gICAgICAgIEJFUSAgICAgRGlhZ1ZMVXBwZXJSaWdodE5vdEF2YWlsYWJsZQotICAgICAgIAotICAgICAgICBWTEQxICAgIGRBYm92ZTAsW3BTcmNBYm92ZV0gICAgICAgICAgICAgICAgICAgICAgOy8vIFtVN3xVNnxVNXxVNHxVM3xVMnxVMXxVMF0gCi0gICAgICAgIFZFWFQgICAgZEFib3ZlMSxkQWJvdmUwLGRBYm92ZTAsIzEgICAgICAgICAgICAgICA7Ly8gWyBYfFU3fFU2fFU1fFU0fFUzfFUyfFUxXQotICAgICAgICBWRVhUICAgIGRBYm92ZTIsZEFib3ZlMSxkQWJvdmUxLCMxICAgICAgICAgICAgICAgOy8vIFsgWHwgWHxVN3xVNnxVNXxVNHxVM3xVMl0KLSAgICAgICAgCi0gICAgICAgIEIgICAgICAgRGlhZ1ZMUHJlZGljdDR4NFN0b3JlICAgICAgICAgCi0gICAgICAgCi1EaWFnVkxVcHBlclJpZ2h0Tm90QXZhaWxhYmxlCi0gICAgICAgIFZMRDEgICAgZEFib3ZlVTMyWzFdLFtwU3JjQWJvdmVdICAgICAgICAgICAgICAgICA7Ly8gW1UzfFUyfFUxfFUwfC18LXwtfC1dIAotICAgICAgICBWRFVQICAgIGRVMywgZEFib3ZlWzddICAgICAgICAgICAgICAgICAgICAgICAgICAgOy8vIFtVMyBVMyBVMyBVMyBVMyBVMyBVMyBVM10KLQotICAgICAgICBWRVhUICAgIGRBYm92ZTAsIGRBYm92ZSwgZFUzLCAjNCAgICAgICAgICAgICAgICAgOy8vIFtVMyBVMyBVMyBVMyBVMyBVMiBVMSBVMF0KLSAgICAgICAgVkVYVCAgICBkQWJvdmUxLCBkQWJvdmUsIGRVMywgIzUgICAgICAgICAgICAgICAgIDsvLyBbVTMgVTMgVTMgVTMgVTMgVTMgVTIgVTFdCi0gICAgICAgIFZFWFQgICAgZEFib3ZlMiwgZEFib3ZlLCBkVTMsICM2ICAgICAgICAgICAgICAgICA7Ly8gW1UzIFUzIFUzIFUzIFUzIFUzIFUzIFUyXQotICAgICAgIAotRGlhZ1ZMUHJlZGljdDR4NFN0b3JlICAKLSAgICAgICAgCi0gICAgICAgIFZSSEFERCAgZFRtcDAsIGRBYm92ZTEsIGRBYm92ZTAgICAgICAgICAgICAgICAgIDsvLyAoYStiKzEpPj4xCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDsvLyBUbXBbIFh8IFh8IFh8IDh8IDZ8IDR8IDJ8IDAgXQotICAgICAgICAKLSAgICAgICAgVkhBREQgICBkVG1wMywgZEFib3ZlMCwgZEFib3ZlMgotICAgICAgICBWUkhBREQgIGRUbXAzLCBkVG1wMywgZEFib3ZlMSAgICAgICAgICAgICAgICAgICA7Ly8gKGErMipiK2MrMik+PjIKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOy8vIFRtcFsgWHwgWHwgWHwgOXwgN3wgNXwgM3wgMSBdCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKLSAgICAgICAgVkVYVCAgICBkVG1wMSxkVG1wMCxkVG1wMCwjMSAgICAgICAgICAgICAgICAgICAgOy8vIFRtcFsgWHwgWHwgWHwgWHwgOHwgNnwgNHwgMiBdCi0gICAgICAgIEFERCAgICAgcERzdFRtcCwgcERzdCwgZHN0U3RlcAotICAgICAgICBBREQgICAgIGRzdGVwLCBkc3RTdGVwLCBkc3RTdGVwCi0gICAgICAgIFZFWFQgICAgZFRtcDIsZFRtcDMsZFRtcDEsIzEgICAgICAgICAgICAgICAgICAgIDsvLyBUbXBbIFh8IFh8IFh8IFh8IDl8IDd8IDV8IDMgXQotICAgICAgICAKLSAgICAgICAgVlNUMSAgICBkVG1wMFUzMlswXSxbcERzdF0sZHN0ZXAgICAgICAgICAgICAgICAgOy8vIFRtcFs2XSxbNF0sWzJdLFswXQotICAgICAgICBWU1QxICAgIGRUbXAzVTMyWzBdLFtwRHN0VG1wXSxkc3RlcCAgICAgICAgICAgICA7Ly8gVG1wWzddLFs1XSxbM10sWzFdCi0gICAgICAgIFZTVDEgICAgZFRtcDFVMzJbMF0sW3BEc3RdICAgICAgICAgICAgICAgICAgICAgIDsvLyBUbXBbOF0sWzZdLFs0XSxbMl0KLSAgICAgICAgVlNUMSAgICBkVG1wMlUzMlswXSxbcERzdFRtcF0gICAgICAgICAgICAgICAgICAgOy8vIFRtcFs5XSxbN10sWzVdLFszXQotICAgICAgICAKLSAgICAgICAgQiAgICAgICAgRXhpdFByZWRpY3Q0eDQgICAgICAgICAgICAgICAgICAgICAgICAgOy8vIEJyYW5jaCB0byBleGl0IGNvZGUKLSAgICAgICAgCi1PTVhfVkNfNHg0X0hVCi0gICAgICAgIEFERCAgICAgcFNyY1RtcCwgcFNyY0xlZnQsIGxlZnRTdGVwCi0gICAgICAgIEFERCAgICAgc3JjU3RlcCwgbGVmdFN0ZXAsIGxlZnRTdGVwCi0KLSAgICAgICAgOy8vIExvYWQgTGVmdCBFZGdlICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOy8vIFtMM3xMMnxMMXxMMHxYfFh8WHxYXQotICAgICAgICBWTEQxICAgIHtkTGVmdFs0XX0sW3BTcmNMZWZ0XSxzcmNTdGVwICAgICAgICAgICA7Ly8gcFNyY0xlZnRbMCpsZWZ0U3RlcF0KLSAgICAgICAgVkxEMSAgICB7ZExlZnRbNV19LFtwU3JjVG1wXSxzcmNTdGVwICAgICAgICAgICAgOy8vIHBTcmNMZWZ0WzEqbGVmdFN0ZXBdCi0gICAgICAgIFZMRDEgICAge2RMZWZ0WzZdfSxbcFNyY0xlZnRdICAgICAgICAgICAgICAgICAgIDsvLyBwU3JjTGVmdFsyKmxlZnRTdGVwXQotICAgICAgICBWTEQxICAgIHtkTGVmdFs3XX0sW3BTcmNUbXBdICAgICAgICAgICAgICAgICAgICA7Ly8gcFNyY0xlZnRbMypsZWZ0U3RlcF0KLSAgICAgICAgCi0gICAgICAgIFZEVVAgICAgZEwzLGRMZWZ0WzddICAgICAgICAgICAgICAgICAgICAgICAgICAgIDsvLyBbTDN8TDN8TDN8TDN8TDN8TDN8TDN8TDNdCi0gICAgICAgIAotICAgICAgICBWRVhUICAgIGRMZWZ0SFUwLGRMZWZ0LGRMMywjNCAgICAgICAgICAgICAgICAgICA7Ly8gW0wzfEwzfEwzfEwzfEwzfEwyfEwxfEwwXQotICAgICAgICBWRVhUICAgIGRMZWZ0SFUxLGRMZWZ0LGRMMywjNSAgICAgICAgICAgICAgICAgICA7Ly8gW0wzfEwzfEwzfEwzfEwzfEwzfEwyfEwxXQotICAgICAgICBWRVhUICAgIGRMZWZ0SFUyLGRMZWZ0LGRMMywjNiAgICAgICAgICAgICAgICAgICA7Ly8gW0wzfEwzfEwzfEwzfEwzfEwzfEwzfEwyXQotICAgICAgICAKLSAgICAgICAgVkhBREQgICBkVG1wMCwgZExlZnRIVTAsIGRMZWZ0SFUyCi0gICAgICAgIFZSSEFERCAgZFRtcDAsIGRUbXAwLCBkTGVmdEhVMSAgICAgICAgICAgICAgICAgIDsvLyBUbXBbIEwzIHwgTDMgfCBMMyB8IEwzIHwgTDMgfCA1IHwgMyB8IDEgXQotICAgICAgICAKLSAgICAgICAgVlJIQUREICBkVG1wMSwgZExlZnRIVTEsIGRMZWZ0SFUwICAgICAgICAgICAgICAgOy8vIChhK2IrMSk+PjEgCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDsvLyAgVG1wWyBMMyB8IEwzIHwgTDMgfCBMMyB8IEwzIHwgNCB8IDIgfCAwIF0KLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAotICAgICAgICBWWklQICAgIGRUbXAxLGRUbXAwICAgICAgICAgICAgICAgICAgICAgICAgICAgICA7Ly8gZFRtcDEgPSBUbXBbN3wgNnwgNXwgNHwgM3wgMnwgMXwgMF0gIAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA7Ly8gZFRtcDAgPSBbTDN8TDN8TDN8TDN8TDN8TDN8TDN8TDNdCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCi0gICAgICAgIAotICAgICAgICBWU1QxICAgIGRUbXAxVTMyWzBdLFtwRHN0XSxkc3RTdGVwICAgICAgICAgICAgICA7Ly8gWzN8MnwxfDBdIAotICAgICAgICBWRVhUICAgIGRUbXAxLGRUbXAxLGRUbXAxLCMyCi0gICAgICAgIFZTVDEgICAgZFRtcDFVMzJbMF0sW3BEc3RdLGRzdFN0ZXAgICAgICAgICAgICAgIDsvLyBbNXw0fDN8Ml0gCi0gICAgICAgIFZFWFQgICAgZFRtcDEsZFRtcDEsZFRtcDEsIzIKLSAgICAgICAgVlNUMSAgICBkVG1wMVUzMlswXSxbcERzdF0sZHN0U3RlcCAgICAgICAgICAgICAgOy8vIFs3fDZ8NXw0XSAgCi0gICAgICAgIFZTVDEgICAgZFRtcDBVMzJbMF0sW3BEc3RdICAgICAgICAgICAgICAgICAgICAgIDsvLyBbOXw4fDd8Nl0gCi0gICAgICAgIAotICAgICAgICAKLUV4aXRQcmVkaWN0NHg0Ci0gICAgICAgIAotICAgICAgICBNT1YgICAgICByZXR1cm4sICAjT01YX1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SAgKnBTcmMrKwotICAgICAgICBPUlJORSAgICBWYWx1ZSxWYWx1ZSxWYWx1ZTIsIExTTCAjOCAgICAgICAgICA7Ly8gVmFsdWUgPSAoT01YX1UxNikgKnBTcmMrKwotICAgICAgICAKLSAgICAgICAgVFNUICAgICAgRmxhZywgICMweDIwICAgICAgICAgICAgICAgICAgICAgICAgOy8vIENvbXB1dGluZyAoRmxhZyAmIDB4MjApIHRvIGNoZWNrLCBpZiB3ZSdyZSBkb25lCi0gICAgICAgIExEUkJFUSAgIEZsYWcsICBbcFNyY10sICMxICAgICAgICAgICAgICAgICAgIDsvLyBGbGFnICA9IChPTVhfVTgpICpwU3JjKyssIGZvciBuZXh0IGl0ZXJhdGlvbgotICAgICAgICBTVFJIICAgICBWYWx1ZSwgW3BEc3QsIHN0ck9mZnNldF0gICAgICAgICAgICA7Ly8gU3RvcmUgPFZhbHVlPiBhdCBvZmZzZXQgPHN0ck9mZnNldD4KLSAgICAgICAgQkVRICAgICAgdW5wYWNrTG9vcCAgICAgICAgICAgICAgICAgICAgICAgICAgOy8vIEJyYW5jaCB0byB0aGUgbG9vcCBiZWdpbm5pbmcKLSAgICAgICAgCi0gICAgICAgIDsvLy0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tCi0gICAgICAgIDsvL0ludlRyYW5zZm9ybURDMngyOiBJbmxpbmVkIChJbXBsZW1lbnRlZCBpbiBBUk0gVjYpCi0gICAgICAgIDsvLy0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tCi0gICAgICAgIAotICAgICAgICBMRE1JQSAgICBwRHN0LCB7cjB3MCwgcjB3MX0gICAgICAgICAgICAgICAgICA7Ly8gcjB3MCA9IHxjMXxjMHwgJiByMHcxID0gfGMzfGMyfAotCi0gICAgICAgIFNUUiAgICAgIHBTcmMsIFtwcFNyY10gICAgICAgICAgICAgICAgICAgICAgIDsvLyBVcGRhdGUgdGhlIGJpdHN0cmVhbSBwb2ludGVyCi0gICAgICAgIAotICAgICAgICBMRFIgICAgICBwUVBEaXZUYWJsZSwgPWFybVZDTTRQMTBfUVBEaXZUYWJsZSA7Ly8gUVAgRGl2aXNpb24gbG9vay11cC10YWJsZSBiYXNlIHBvaW50ZXIKLSAgICAgICAgTERSICAgICAgcFFQTW9kVGFibGUsID1hcm1WQ000UDEwX1ZNYXRyaXhRUE1vZFRhYmxlIDsvLyBRUCBNb2R1bG8gbG9vay11cC10YWJsZSBiYXNlIHBvaW50ZXIKLSAgICAgICAgCi0gICAgICAgIFNBRERTVUJYIHIwdzAsIHIwdzAsICByMHcwICAgICAgICAgICAgICAgICAgIDsvLyBbIGMwMCtjMDEsIGMwMC1jMDEgXQotICAgICAgICBTQUREU1VCWCByMHcxLCByMHcxLCAgcjB3MSAgICAgICAgICAgICAgICAgICA7Ly8gWyBjMTArYzExLCBjMTAtYzExIF0KLSAgICAgICAgCi0gICAgICAgIExEUlNCICAgIFNoaWZ0LCBbcFFQRGl2VGFibGUsIFFQXSAgICAgICAgICAgIDsvLyBTaGlmdCA9IHBRUERpdlRhYmxlW1FQXQotICAgICAgICBMRFJTQiAgICBTY2FsZSwgW3BRUE1vZFRhYmxlLCBRUF0gICAgICAgICAgICA7Ly8gU2NhbGUgPSBwUVBNb2RUYWJsZVtRUF0KLSAgICAgICAgCi0gICAgICAgIFNBREQxNiAgIGMwdzAsIHIwdzAsIHIwdzEgICAgICAgICAgICAgICAgICAgIDsvLyBbIGQwMCtkMTAsIGQwMStkMTEgXQotICAgICAgICBTU1VCMTYgICBjMXcwLCByMHcwLCByMHcxICAgICAgICAgICAgICAgICAgICA7Ly8gWyBkMDAtZDEwLCBkMDEtZDExIF0KLSAgICAgICAgCi0gICAgICAgIDsvLy0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0KLSAgICAgICAgOy8vRGVxdWFudENocm9tYURDMngyOiBJbmxpbmVkIChOZW9uIEltcGxlbWVudGF0aW9uKQotICAgICAgICA7Ly8tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tCi0gICAgICAgIAotICAgICAgICBMU0wgICAgICBTY2FsZSwgU2NhbGUsIFNoaWZ0ICAgICAgICAgICAgICAgICA7Ly8gU2NhbGUgPSBTY2FsZSA8PCBTaGlmdAotICAgICAgICBWTU9WICAgICBkSW52VHJDb2VmZiwgYzB3MCwgYzF3MCAgCi0gICAgICAgIFZSRVYzMiAgIGRJbnZUckNvZWZmLGRJbnZUckNvZWZmICAKLSAgICAgICAgVkRVUCAgICAgZFNjYWxlLFNjYWxlIAotICAgICAgICAKLSAgICAgICAgVk1VTEwgICAgcURxbnRDb2VmZixkSW52VHJDb2VmZixkU2NhbGUKLSAgICAgICAgVlNIUk4gICAgZERxbnRDb2VmZixxRHFudENvZWZmLCMxCi0gICAgICAgIAotICAgICAgICAKLSAgICAgICAgVlNUMSAgICAgZERxbnRDb2VmZixbcERzdF0gICAgICAgICAgICAgICAgICAgOy8vIFN0b3JpbmcgYWxsIHRoZSBjb2VmZmljaWVudHMgYXQgb25jZQotICAgICAgICAKLSAgICAgICAgTU9WICAgICAgcmV0dXJuLCAjT01YX1N0c19Ob0VycgotICAgICAgICBNX0VORAotICAgICAgICAKLSAgICBFTkRJRiA7Ly8gQ29ydGV4QTgKLSAgICAKLSAgICAKLSAgICBFTkQKZGlmZiAtLWdpdCBhL21lZGlhL2xpYnN0YWdlZnJpZ2h0L2NvZGVjcy9vbjIvaDI2NGRlYy9vbXhkbC9hcm1fbmVvbi92Yy9tNHAxMC9zcmMvb214VkNNNFAxMF9UcmFuc2Zvcm1EZXF1YW50THVtYURDRnJvbVBhaXJfcy5zIGIvbWVkaWEvbGlic3RhZ2VmcmlnaHQvY29kZWNzL29uMi9oMjY0ZGVjL29teGRsL2FybV9uZW9uL3ZjL200cDEwL3Ny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MiAgICAgICAgICAgICAgICBETiAgRDIuUzE2Ci1kSW4zICAgICAgICAgICAgICAgIEROICBEMy5TMTYgICAKLQotOy8vIEludGVybWVkaWF0ZSBjYWxjdWxhdGlvbnMKLWRSb3dTdW0xICAgICAgICAgICAgRE4gIEQ0LlMxNgotZFJvd1N1bTIgICAgICAgICAgICBETiAgRDUuUzE2Ci1kUm93RGlmZjEgICAgICAgICAgIEROICBENi5TMTYKLWRSb3dEaWZmMiAgICAgICAgICAgRE4gIEQ3LlMxNgotCi07Ly8gUm93IG9wZXJhdGVkIHBpeGVscwotZFJvd09wMCAgICAgICAgICAgICBETiAgRDAuUzE2Ci1kUm93T3AxICAgICAgICAgICAgICAgIEROICBEMS5TMTYKLWRSb3dPcDIgICAgICAgICAgICAgICAgRE4gIEQyLlMxNgotZFJvd09wMyAgICAgICAgICAgICAgICBETiAgRDMuUzE2Ci1xUm93T3AwMSAgICAgICAgICAgIFFOICBRMC4zMgotcVJvd09wMjMgICAgICAgICAgICBRTiAgUTEuMzIKLQotOy8vIEludGVybWVkaWF0ZSBjYWxjdWxhdGlvbnMKLWRDb2xTdW0xICAgICAgICAgICAgRE4gIEQ0LlMxNgotZENvbFN1bTIgICAgICAgICAgICBETiAgRDUuUzE2Ci1kQ29sRGlmZjEgICAgICAgICAgIEROICBENi5TMTYKLWRDb2xEaWZmMiAgICAgICAgICAgRE4gIEQ3LlMxNgotCi07Ly8gQ29sb3VtbiBvcGVyYXRlZCBwaXhlbHMKLWRDb2xPcDAgICAgICAgICAgICAgRE4gIEQwLlMxNgotZENvbE9wMSAgICAgICAgICAgICAgICBETiAgRDEuUzE2Ci1kQ29sT3AyICAgICAgICAgICAgICAgIEROICBEMi5TMTYKLWRDb2xPcDMgICAgICAgICAgICAgICAgRE4gIEQzLlMxNgotCi07Ly8gVGVtcG9yYXJ5IHNjcmF0Y2ggdmFyYWlibGVzCi0KLWRTY2FsZSAgICAgICAgICAgICAgRE4gIEQ1LlMxNgotcVJvdW5kMCAgICAgICAgICAgICBRTiAgUTMuUzMyCi1xUm91bmQxICAgICAgICAgICAgIFFOICBRNC5TMzIKLXFSb3VuZDIgICAgICAgICAgICAgUU4gIFE1LlMzMgotcVJvdW5kMyAgICAgICAgICAgICBRTiAgUTYuUzMyCi0KLTsvLyBJbnZUcmFuc2Zvcm1lZCBhbmQgRGVxdWFudGl6ZWQgcGl4ZWxzCi1kT3V0MCAgICAgICAgICAgICAgIEROICBEMC5TMTYKLWRPdXQxICAgICAgICAgICAgICAgIEROICBEMS5TMTYKLWRPdXQyICAgICAgICAgICAgICAgIEROICBEMi5TMTYKLWRPdXQzICAgICAgICAgICAgICAgIEROICBEMy5TMTYKLQotICAgICAgIAotICAgIDsvLyBBbGxvY2F0ZSBzdGFjayBtZW1vcnkgcmVxdWlyZWQgYnkgdGhlIGZ1bmN0aW9uCi0gICAgICAgIAotCi0gICAgOy8vIFdyaXRlIGZ1bmN0aW9uIGhlYWRlcgotICAgIE1fU1RBUlQgYXJtVkNNNFAxMF9JbnZUcmFuc2Zvcm1EZXF1YW50THVtYURDNHg0LHI1LGQxMwotICAgIAotICAgIDsqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKLSAgICA7Ly8gVGhlIHN0cmF0ZWd5IHVzZWQgaW4gaW1wbGVtZW50aW5nIHRoZSB0cmFuc2Zvcm0gaXMgYXMgZm9sbG93czoqCi0gICAgOy8vIExvYWQgdGhlIDR4NCBibG9jayBpbnRvIDQgRC1yZWdpc3RlcnMgICAgICAgICAgICAgICAgICAgICAgICAgKiAgCi0gICAgOy8vIFRyYW5zcG9zZSB0aGUgNHg0IG1hdHJpeCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKiAgCi0gICAgOy8vIFBlcmZvcm0gdGhlIHJvdyBvcGVyYXRpb25zIChvbiBjb2x1bW5zKSB1c2luZyBTSU1EICAgICAgICAgICAgKiAgCi0gICAgOy8vIFRyYW5zcG9zZSB0aGUgNHg0IHJlc3VsdCBtYXRyaXggICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKiAgCi0gICAgOy8vIFBlcmZvcm0gdGhlIGNvbG91bW4gb3BlcmF0aW9ucyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKgotICAgIDsqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKLQotICAgICAgICA7Ly8gTG9hZCBhbGwgdGhlIDR4NCBwaXhlbHMgaW4gVHJhbnNwb3NlZCBmb3JtCi0gICAgICAgIAotICAgICAgICBWTEQ0ICAgIHtkSW4wLGRJbjEsZEluMixkSW4zfSxbcERhdGFdCi0gICAgICAgIExEUiAgICAgcFFQRGl2VGFibGUsID1hcm1WQ000UDEwX1FQRGl2VGFibGUgICAgICAgIDsvLyBRUCBEaXZpc2lvbiBsb29rLXVwLXRhYmxlIGJhc2UgcG9pbnRlcgotICAgICAgICBMRFIgICAgIHBRUE1vZFRhYmxlLCA9YXJtVkNNNFAxMF9WTWF0cml4UVBNb2RUYWJsZSA7Ly8gUVAgTW9kdWxvIGxvb2stdXAtdGFibGUgYmFzZSBwb2ludGVyCi0gICAgICAgIAotICAgICAgICA7KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiAKLSAgICAgICAgOy8vIFJvdyBPcGVyYXRpb25zIChQZXJmb3JtZWQgb24gY29sdW1ucykKLSAgICAgICAgOyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiogCi0gICAgICAgIDsvLyBTY2FsZSBmYWN0b3IgY2FsY3VsYXRpb24gaXMgZG9uZSB1c2luZyBBUk0gaW5zdHJ1Y3Rpb25zCi0gICAgICAgIDsvLyBJbnRlcmxlYXZlZCB3aXRoIE5FT04gaW5zdHJ1Y3Rpb25zIGlub3JkZXIgdG8gRHVhbCBpc3N1ZQotICAgICAgICAKLSAgICAgICAgVkFERCAgICBkUm93U3VtMSxkSW4wLGRJbjEKLSAgICAgICAgVkFERCAgICBkUm93U3VtMixkSW4yLGRJbjMKLSAgICAgICAgVlNVQiAgICBkUm93RGlmZjEsZEluMCxkSW4xCi0gICAgICAgIExEUlNCICAgU2hpZnQsIFtwUVBEaXZUYWJsZSwgUVBdICAgICAgICAgICAgICAgOy8vIEFSTSBDT0RFOiBTaGlmdCA9IHBRUERpdlRhYmxlW1FQXQotICAgICAgICBWU1VCICAgIGRSb3dEaWZmMixkSW4yLGRJbjMKLSAgICAgICAgTERSU0IgICBTY2FsZSwgW3BRUE1vZFRhYmxlLCBRUF0gICAgICAgICAgICAgICA7Ly8gQVJNIENPREU6IFNjYWxlID0gcFFQTW9kVGFibGVbUVBdIAotICAgICAgICBWQUREICAgIGRSb3dPcDAsZFJvd1N1bTEsZFJvd1N1bTIKLSAgICAgICAgVlNVQiAgICBkUm93T3AxLGRSb3dTdW0xLGRSb3dTdW0yCi0gICAgICAgIFZTVUIgICAgZFJvd09wMixkUm93RGlmZjEsZFJvd0RpZmYyCi0gICAgICAgIExTTCAgICAgU2NhbGUsIFNjYWxlLCBTaGlmdCAgICAgICAgICAgICAgICAgICAgOy8vIEFSTSBDT0RFOiBTY2FsZSA9IFNjYWxlIDw8IFNoaWZ0Ci0gICAgICAgIFZBREQgICAgZFJvd09wMyxkUm93RGlmZjEsZFJvd0RpZmYyCi0gICAgICAgIAotICAgICAgICA7KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgotICAgICAgICA7Ly8gVHJhbnNwb3NlIHRoZSByZXN1bHRhbnQgbWF0cml4Ci0gICAgICAgIDsqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCi0gICAgICAgIAotICAgICAgICBWVFJOICAgIGRSb3dPcDAsZFJvd09wMQotICAgICAgICBWVFJOICAgIGRSb3dPcDIsZFJvd09wMwotICAgICAgICBWVFJOICAgIHFSb3dPcDAxLHFSb3dPcDIzIAotICAgICAgICAKLSAgICAgICAgOyo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PcDIsZFNjYWxlCi0gICAgICAgIFZNTEFMICAgcVJvdW5kMyxkQ29sT3AzLGRTY2FsZQotICAgICAgICAKLSAgICAgICAgVlNIUk4gICBkT3V0MCxxUm91bmQwLCMyICAgICAgICAgICAgICAgICAgICAgICAgICA7Ly8gUmlnaHQgc2hpZnQgYnkgMiAmIChPTVhfUzE2KVZhbHVlCi0gICAgICAgIFZTSFJOICAgZE91dDEscVJvdW5kMSwjMgotICAgICAgICBWU0hSTiAgIGRPdXQyLHFSb3VuZDIsIzIKLSAgICAgICAgVlNIUk4gICBkT3V0MyxxUm91bmQzLCMyCi0gICAgICAgIAotICAgICAgICA7KioqKioqKioqKioqKioqKioqKioqKioqKioqCi0gICAgICAgIDsvLyBTdG9yZSBhbGwgdGhlIDR4NCBwaXhlbHMKLSAgICAgICAgOyoqKioqKioqKioqKioqKioqKioqKioqKioqKgotICAgICAgICAKLSAgICAgICAgVlNUMSAge2RPdXQwLGRPdXQxLGRPdXQyLGRPdXQzfSwgW3BEYXRhXQotCi0gICAgICAgIAotICAgICAgICA7Ly8gU2V0IHJldHVybiB2YWx1ZQotICAgICAgICAKLSAgICAgICAgOy8vIFdyaXRlIGZ1bmN0aW9uIHRhaWwKLSAgICAgICAgTV9FTkQgICAgICAgIAotICAgICAgICAKLSAgICBFTkRJRiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOy8vQ09SVEVYQTggICAKLSAgICAgICAgCi0KLQotOy8vIEZ1bmN0aW9uOiBvbXhWQ000UDEwX1RyYW5zZm9ybURlcXVhbnRMdW1hRENGcm9tUGFpcgotICAgIAotOy8vSW5wdXQgUmVnaXN0ZXJzCi1wcFNyYyAgICAgICAgICAgICAgIFJOICAwCi1wRHN0ICAgICAgICAgICAgICAgIFJOICAxCi1RUFIyICAgICAgICAgICAgICAgIFJOICAyCi0KLTsvL091dHB1dCBSZWdpc3RlcnMKLXJlc3VsdCAgICAgICAgICAgICAgUk4gIDAKLQotOy8vTG9jYWwgU2NyYXRjaCBSZWdpc3RlcnMKLXBEc3RSNCAgICAgICAgICAgICAgUk4gIDQKLXBEc3RSMCAgICAgICAgICAgICAgUk4gIDAKLVFQUjEgICAgICAgICAgICAgICAgUk4gIDEKLVFQUjUgICAgICAgICAgICAgICAgUk4gIDUKLQotOy8vIEd1YXJkaW5nIGltcGxlbWVudGF0aW9uIGJ5IHRoZSBwcm9jZXNzb3IgbmFtZQotICAgIAotICAgIElGIENvcnRleEE4Ci0gICAgICAgCi0gICAgOy8vIEFsbG9jYXRlIHN0YWNrIG1lbW9yeSByZXF1aXJlZCBieSB0aGUgZnVuY3Rpb24KLSAgICAgICAgCi0KLSAgICA7Ly8gV3JpdGUgZnVuY3Rpb24gaGVhZGVyCi0gICAgICAgIE1fU1RBUlQgb214VkNNNFAxMF9UcmFuc2Zvcm1EZXF1YW50THVtYURDRnJvbVBhaXIscjUKLSAgICAgICAgCi0gICAgICAgIE1PViAgICAgcERzdFI0LHBEc3QgICAgICAgICAgICAgICAgICAgICAgICAgOy8vIFNhdmluZyByZWdpc3RlciByMQotICAgICAgICBNT1YgICAgIFFQUjUsUVBSMiAgICAgICAgICAgICAgICAgICAgICAgICAgIDsvLyBTYXZpbmcgcmVnaXN0ZXIgcjIKLSAgICAgICAgQkwgICAgICBhcm1WQ000UDEwX1VucGFja0Jsb2NrNHg0Ci0gICAgICAgIAotICAgICAgICBNT1YgICAgIHBEc3RSMCxwRHN0UjQgICAgICAgICAgICAgICAgICAgICAgIDsvLyBTZXR0aW5nIHVwIHJlZ2lzdGVyIHIwCi0gICAgICAgIE1PViAgICAgUVBSMSxRUFI1ICAgICAgICAgICAgICAgICAgICAgICAgICAgOy8vIFNldHRpbmcgdXAgcmVnaXN0ZXIgcjEKLSAgICAgICAgQkwgICAgICBhcm1WQ000UDEwX0ludlRyYW5zZm9ybURlcXVhbnRMdW1hREM0eDQKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKLSAgICAgICA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hdHRyaWJ1dGUgMjUsIDEKLQotICAgIC5hcm0KLSAgICAuZnB1IG5lb24KLSAgICAudGV4dAotCi0gICAgLmdsb2JhbCBhcm1WQ000UDEwX0F2ZXJhZ2VfNHg0X0FsaWduMF91bnNhZmUKLSAgICAuZnVuYyAgIGFybVZDTTRQMTBfQXZlcmFnZV80eDRfQWxpZ24wX3Vuc2FmZQotYXJtVkNNNFAxMF9BdmVyYWdlXzR4NF9BbGlnbjBfdW5zYWZlOgotICAgIFBVU0ggICAgIHtyNC1yNixscn0KLSAgICBMRFIgICAgICByNywgPTB4ODA4MDgwODAKLSAgICBMRFIgICAgICByMTIsW3IyLCMwXQotICAgIExEUiAgICAgIHIxMCxbcjBdLHIxCi0gICAgTERSICAgICAgbHIsW3IyLHIzXQotICAgIExEUiAgICAgIHIxMSxbcjBdLHIxCi0gICAgTVZOICAgICAgcjEyLHIxMgotICAgIE1WTiAgICAgIGxyLGxyCi0gICAgVUhTVUI4ICAgcjUscjEwLHIxMgotICAgIFVIU1VCOCAgIHI0LHIxMSxscgotICAgIEVPUiAgICAgIHI1LHI1LHI3Ci0gICAgU1RSICAgICAgcjUsW3IyXSxyMwotICAgIEVPUiAgICAgIHI0LHI0LHI3Ci0gICAgU1RSICAgICAgcjQsW3IyXSxyMwotICAgIExEUiAgICAgIHIxMCxbcjBdLHIxCi0gICAgTERSICAgICAgcjEyLFtyMiwjMF0KLSAgICBMRFIgICAgICByMTEsW3IwXSxyMQotICAgIExEUiAgICAgIGxyLFtyMixyM10KLSAgICBNVk4gICAgICByMTIscjEyCi0gICAgVUhTVUI4ICAgcjUscjEwLHIxMgotICAgIE1WTiAgICAgIGxyLGxyCi0gICAgVUhTVUI4ICAgcjQscjExLGxyCi0gICAgRU9SICAgICAgcjUscjUscjcKLSAgICBTVFIgICAgICByNSxbcjJdLHIzCi0gICAgRU9SICAgICAgcjQscjQscjcKLSAgICBTVFIgICAgICByNCxbcjJdLHIzCi0gICAgUE9QICAgICAge3I0LXI2LHBjfQotICAgIC5lbmRmdW5jCi0KLSAgICAuZ2xvYmFsIGFybVZDTTRQMTBfQXZlcmFnZV80eDRfQWxpZ24yX3Vuc2FmZQotICAgIC5mdW5jICAgYXJtVkNNNFAxMF9BdmVyYWdlXzR4NF9BbGlnbjJfdW5zYWZlCi1hcm1WQ000UDEwX0F2ZXJhZ2VfNHg0X0FsaWduMl91bnNhZmU6Ci0gICAgUFVTSCAgICAge3I0LXI2LGxyfQotICAgIExEUiAgICAgIHI3LCA9MHg4MDgwODA4MAotICAgIExEUiAgICAgIHI0LFtyMCwjNF0KLSAgICBMRFIgICAgICByMTAsW3IwXSxyMQotICAgIExEUiAgICAgIHIxMixbcjIsIzBdCi0gICAgTERSICAgICAgbHIsW3IyLHIzXQotICAgIExEUiAgICAgIHI1LFtyMCwjNF0KLSAgICBMRFIgICAgICByMTEsW3IwXSxyMQotICAgIE1WTiAgICAgIHIxMixyMTIKLSAgICBNVk4gICAgICBscixscgotICAgIExTUiAgICAgIHIxMCxyMTAsIzE2Ci0gICAgT1JSICAgICAgcjEwLHIxMCxyNCxMU0wgIzE2Ci0gICAgTFNSICAgICAgcjExLHIxMSwjMTYKLSAgICBPUlIgICAgICByMTEscjExLHI1LExTTCAjMTYKLSAgICBVSFNVQjggICByNSxyMTAscjEyCi0gICAgVUhTVUI4ICAgcjQscjExLGxyCi0gICAgRU9SICAgICAgcjUscjUscjcKLSAgICBTVFIgICAgICByNSxbcjJdLHIzCi0gICAgRU9SICAgICAgcjQscjQscjcKLSAgICBTVFIgICAgICByNCxbcjJdLHIzCi0gICAgTERSICAgICAgcjQsW3IwLCM0XQotICAgIExEUiAgICAgIHIxMCxbcjBdLHIxCi0gICAgTERSICAgICAgcjEyLFtyMiwjMF0KLSAgICBMRFIgICAgICBscixbcjIscjNdCi0gICAgTERSICAgICAgcjUsW3IwLCM0XQotICAgIExEUiAgICAgIHIxMSxbcjBdLHIxCi0gICAgTVZOICAgICAgcjEyLHIxMgotICAgIE1WTiAgICAgIGxyLGxyCi0gICAgTFNSICAgICAgcjEwLHIxMCwjMTYKLSAgICBPUlIgICAgICByMTAscjEwLHI0LExTTCAjMTYKLSAgICBMU1IgICAgICByMTEscjExLCMxNgotICAgIE9SUiAgICAgIHIxMSxyMTEscjUsTFNMICMxNgotICAgIFVIU1VCOCAgIHI1LHIxMCxyMTIKLSAgICBVSFNVQjggICByNCxyMTEsbHIKLSAgICBFT1IgICAgICByNSxyNSxyNwotICAgIFNUUiAgICAgIHI1LFtyMl0scjMKLSAgICBFT1IgICAgICByNCxyNCxyNwotICAgIFNUUiAgICAgIHI0LFtyMl0scjMKLSAgICBQT1AgICAgICB7cjQtcjYscGN9Ci0gICAgLmVuZGZ1bmMKLQotICAgIC5nbG9iYWwgYXJtVkNNNFAxMF9BdmVyYWdlXzR4NF9BbGlnbjNfdW5zYWZlCi0gICAgLmZ1bmMgICBhcm1WQ000UDEwX0F2ZXJhZ2VfNHg0X0FsaWduM191bnNhZmUKLWFybVZDTTRQMTBfQXZlcmFnZV80eDRfQWxpZ24zX3Vuc2FmZToKLSAgICBQVVNIICAgICB7cjQtcjYsbHJ9Ci0gICAgTERSICAgICAgcjcsID0weDgwODA4MDgwCi0gICAgTERSICAgICAgcjQsW3IwLCM0XQotICAgIExEUiAgICAgIHIxMCxbcjBdLHIxCi0gICAgTERSICAgICAgcjEyLFtyMiwjMF0KLSAgICBMRFIgICAgICBscixbcjIscjNdCi0gICAgTERSICAgICAgcjUsW3IwLCM0XQotICAgIExEUiAgICAgIHIxMSxbcjBdLHIxCi0gICAgTVZOICAgICAgcjEyLHIxMgotICAgIE1WTiAgICAgIGxyLGxyCi0gICAgTFNSICAgICAgcjEwLHIxMCwjMjQKLSAgICBPUlIgICAgICByMTAscjEwLHI0LExTTCAjOAotICAgIExTUiAgICAgIHIxMSxyMTEsIzI0Ci0gICAgT1JSICAgICAgcjExLHIxMSxyNSxMU0wgIzgKLSAgICBVSFNVQjggICByNSxyMTAscjEyCi0gICAgVUhTVUI4ICAgcjQscjExLGxyCi0gICAgRU9SICAgICAgcjUscjUscjcKLSAgICBTVFIgICAgICByNSxbcjJdLHIzCi0gICAgRU9SICAgICAgcjQscjQscjcKLSAgICBTVFIgICAgICByNCxbcjJdLHIzCi0gICAgTERSICAgICAgcjQsW3IwLCM0XQotICAgIExEUiAgICAgIHIxMCxbcjBdLHIxCi0gICAgTERSICAgICAgcjEyLFtyMiwjMF0KLSAgICBMRFIgICAgICBscixbcjIscjNdCi0gICAgTERSICAgICAgcjUsW3IwLCM0XQotICAgIExEUiAgICAgIHIxMSxbcjBdLHIxCi0gICAgTVZOICAgICAgcjEyLHIxMgotICAgIE1WTiAgICAgIGxyLGxyCi0gICAgTFNSICAgICAgcjEwLHIxMCwjMjQKLSAgICBPUlIgICAgICByMTAscjEwLHI0LExTTCAjOAotICAgIExTUiAgICAgIHIxMSxyMTEsIzI0Ci0gICAgT1JSICAgICAgcjExLHIxMSxyNSxMU0wgIzgKLSAgICBVSFNVQjggICByNSxyMTAscjEyCi0gICAgVUhTVUI4ICAgcjQscjExLGxyCi0gICAgRU9SICAgICAgcjUscjUscjcKLSAgICBTVFIgICAgICByNSxbcjJdLHIzCi0gICAgRU9SICAgICAgcjQscjQscjcKLSAgICBTVFIgICAgICByNCxbcjJdLHIzCi0gICAgUE9QICAgICAge3I0LXI2LHBjfQotICAgIC5lbmRmdW5jCi0KLSAgICAuZW5kCi0KZGlmZiAtLWdpdCBhL21lZGlhL2xpYnN0YWdlZnJpZ2h0L2NvZGVjcy9vbjIvaDI2NGRlYy9vbXhkbC9hcm1fbmVvbi92Yy9tNHAxMC9zcmNfZ2NjL2FybVZDTTRQMTBfRGVibG9ja2luZ0Nocm9tYV91bnNhZmVfcy5TIGIvbWVkaWEvbGlic3RhZ2VmcmlnaHQvY29kZWNzL29uMi9oMjY0ZGVjL29teGRsL2FybV9uZW9uL3ZjL200cDEwL3NyY19nY2MvYXJtVkNNNFAxMF9EZWJsb2NraW5nQ2hyb21hX3Vuc2FmZV9zL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YXJtCi0gICAgLmZwdSBuZW9uCi0gICAgLnRleHQKLQotICAgIC5nbG9iYWwgYXJtVkNNNFAxMF9EZWNvZGVDb2VmZnNUb1BhaXIKLSAgICAuZnVuYyAgIGFybVZDTTRQMTBfRGVjb2RlQ29lZmZzVG9QYWlyCi1hcm1WQ000UDEwX0RlY29kZUNvZWZmc1RvUGFpcjoKLSAgICBQVVNIICAgICB7cjQtcjEyLGxyfQotICAgIFNVQiAgICAgIHNwLHNwLCMweDQwCi0gICAgTERSICAgICAgcjEwLFtyMCwjMF0KLSAgICBMRFIgICAgICByMTIsW3IxLCMwXQotICAgIExEUiAgICAgIHI2LCA9YXJtVkNNNFAxMF9DQVZMQ0NvZWZmVG9rZW5UYWJsZXMKLSAgICBMRFIgICAgICByNCxbc3AsIzB4NjhdCi0gICAgTERSQiAgICAgcjksW3IxMCwjMl0KLSAgICBMRFJCICAgICByOCxbcjEwLCMxXQotICAgIExEUkIgICAgIHIxMSxbcjEwXSwjMwotICAgIEFERCAgICAgIHIxMixyMTIsIzgKLSAgICBMRFIgICAgICByNixbcjYscjQsTFNMICMyXQotICAgIE9SUiAgICAgIHI5LHI5LHI4LExTTCAjOAotICAgIE9SUiAgICAgIHIxMSxyOSxyMTEsTFNMICMxNgotICAgIExTTFMgICAgIHI4LHIxMSxyMTIKLSAgICBNT1ZTICAgICByNywjMHgxZQotICAgIEFORCAgICAgIHI3LHI3LHI4LExTUiAjMjcKLSAgICBTVUJTICAgICByMTIscjEyLCM4Ci1MMHg0NDoKLSAgICBCQ0MgICAgICBMMQotICAgIExEUkIgICAgIHI4LFtyMTBdLCMxCi1MMToKLSAgICBMRFJIICAgICByNyxbcjYscjddCi0gICAgQUREQ0MgICAgcjEyLHIxMiwjOAotICAgIEFERCAgICAgIHIxMixyMTIsIzQKLSAgICBPUlJDUyAgICByMTEscjgscjExLExTTCAjOAotICAgIExTUlMgICAgIHI4LHI3LCMxCi0gICAgQkNTICAgICAgTDB4NzQKLSAgICBMU0xTICAgICByOCxyMTEscjEyCi0gICAgU1VCUyAgICAgcjEyLHIxMiwjMHhhCi0gICAgQUREICAgICAgcjcscjcscjgsTFNSICMyOQotICAgIEJJQyAgICAgIHI3LHI3LCMxCi0gICAgQiAgICAgICAgTDB4NDQKLUwweDc0OgotICAgIFNVQiAgICAgIHIxMixyMTIscjcsTFNSICMxMwotICAgIEJJQyAgICAgIHI3LHI4LCMweGYwMDAKLSAgICBMU1JTICAgICByNSxyNywjMgotICAgIFNUUkIgICAgIHI1LFtyMiwjMF0KLSAgICBCRVEgICAgICBMMHgzNDQKLSAgICBDTVAgICAgICByNywjMHg0NAotICAgIEJHRSAgICAgIEwweDMzYwotICAgIFNUUiAgICAgIHIwLFtzcCwjMF0KLSAgICBTVFIgICAgICByMSxbc3AsIzRdCi0gICAgU1RSICAgICAgcjMsW3NwLCM4XQotICAgIEFORFMgICAgIHIxLHI3LCMzCi0gICAgQUREICAgICAgcjIsc3AsIzB4YwotICAgIEJFUSAgICAgIEwweGQ4Ci0gICAgTU9WICAgICAgcjAscjEKLUwweGFjOgotICAgIExTTFMgICAgIHI3LHIxMSxyMTIKLSAgICBTVUJTICAgICByMTIscjEyLCM3Ci0gICAgQkNDICAgICAgTDIKLSAgICBMRFJCICAgICByOCxbcjEwXSwjMQotTDI6Ci0gICAgQUREQ0MgICAgcjEyLHIxMiwjOAotICAgIExTUiAgICAgIHI3LHI3LCMzMQotICAgIE9SUkNTICAgIHIxMSxyOCxyMTEsTFNMICM4Ci0gICAgU1VCUyAgICAgcjAscjAsIzEKLSAgICBNT1YgICAgICByOCwjMQotICAgIFNVQiAgICAgIHI4LHI4LHI3LExTTCAjMQotICAgIFNUUkggICAgIHI4LFtyMl0sIzIKLSAgICBCR1QgICAgICBMMHhhYwotTDB4ZDg6Ci0gICAgU1VCUyAgICAgcjAscjUscjEKLSAgICBCRVEgICAgICBMMHgxYjgKLSAgICBNT1YgICAgICByNCwjMQotICAgIENNUCAgICAgIHI1LCMweGEKLSAgICBNT1ZMRSAgICByNCwjMAotICAgIENNUCAgICAgIHIxLCMzCi0gICAgTU9WTFQgICAgcjEsIzQKLSAgICBNT1ZHRSAgICByMSwjMgotICAgIE1PVkdFICAgIHI0LCMwCi1MMHhmYzoKLSAgICBMU0xTICAgICByNyxyMTEscjEyCi0gICAgQ0xaICAgICAgcjcscjcKLSAgICBBREQgICAgICByMTIscjEyLHI3Ci0gICAgU1VCUyAgICAgcjEyLHIxMiwjNwotICAgIEJDQyAgICAgIEwzCi0gICAgTERSQiAgICAgcjgsW3IxMF0sIzEKLSAgICBPUlIgICAgICByMTEscjgscjExLExTTCAjOAotICAgIFNVQlMgICAgIHIxMixyMTIsIzgKLSAgICBCQ0MgICAgICBMMwotICAgIExEUkIgICAgIHI4LFtyMTBdLCMxCi1MMzoKLSAgICBBRERDQyAgICByMTIscjEyLCM4Ci0gICAgT1JSQ1MgICAgcjExLHI4LHIxMSxMU0wgIzgKLSAgICBDTVAgICAgICByNywjMHgxMAotICAgIEJHRSAgICAgIEwweDMzYwotICAgIE1PVlMgICAgIGxyLHI0Ci0gICAgVEVRRVEgICAgcjcsIzB4ZQotICAgIE1PVkVRICAgIGxyLCM0Ci0gICAgVEVRICAgICAgcjcsIzB4ZgotICAgIE1PVkVRICAgIGxyLCMweGMKLSAgICBURVFFUSAgICByNCwjMAotICAgIEFEREVRICAgIHI3LHI3LCMweGYKLSAgICBURVEgICAgICBsciwjMAotICAgIEJFUSAgICAgIEwweDE4NAotICAgIExTTCAgICAgIHIzLHIxMSxyMTIKLSAgICBBREQgICAgICByMTIscjEyLGxyCi0gICAgU1VCUyAgICAgcjEyLHIxMiwjOAotICAgIFJTQiAgICAgIHI5LGxyLCMweDIwCi0gICAgQkNDICAgICAgTDQKLSAgICBMRFJCICAgICByOCxbcjEwXSwjMQotICAgIE9SUiAgICAgIHIxMSxyOCxyMTEsTFNMICM4Ci0gICAgU1VCUyAgICAgcjEyLHIxMiwjOAotICAgIEJDQyAgICAgIEw0Ci0gICAgTERSQiAgICAgcjgsW3IxMF0sIzEKLUw0OgotICAgIEFERENDICAgIHIxMixyMTIsIzgKLSAgICBMU1IgICAgICByMyxyMyxyOQotICAgIE9SUkNTICAgIHIxMSxyOCxyMTEsTFNMICM4Ci0gICAgTFNMICAgICAgcjcscjcscjQKLSAgICBBREQgICAgICByNyxyMyxyNwotTDB4MTg0OgotICAgIEFERCAgICAgIHI3LHI3LHIxCi0gICAgTU9WICAgICAgcjEsIzIKLSAgICBMU1JTICAgICByOCxyNywjMQotICAgIFJTQkNTICAgIHI4LHI4LCMwCi0gICAgU1RSSCAgICAgcjgsW3IyXSwjMgotICAgIExEUiAgICAgIHI5LCA9YXJtVkNNNFAxMF9TdWZmaXhUb0xldmVsCi0gICAgTERSU0IgICAgcjgsW3I5LHI0XQotICAgIFRFUSAgICAgIHI0LCMwCi0gICAgTU9WRVEgICAgcjQsIzEKLSAgICBDTVAgICAgICByNyxyOAotICAgIEFERENTICAgIHI0LHI0LCMxCi0gICAgU1VCUyAgICAgcjAscjAsIzEKLSAgICBCR1QgICAgICBMMHhmYwotTDB4MWI4OgotICAgIExEUiAgICAgIHI4LFtzcCwjMHg2Y10KLSAgICBTVUIgICAgICByMCxyNSwjMQotICAgIFNVQlMgICAgIHIxLHI4LHI1Ci0gICAgQUREICAgICAgcjQsc3AsIzB4MmMKLSAgICBNT1YgICAgICBscixyNQotICAgIFNVQiAgICAgIGxyLGxyLCMxCi0gICAgQkVRICAgICAgTDB4MmIwCi0gICAgVEVRICAgICAgcjgsIzQKLSAgICBMRFJFUSAgICByNiwgPShhcm1WQ000UDEwX0NBVkxDVG90YWxaZXJvczJ4MlRhYmxlcyAtIDQpCi0gICAgTERSTkUgICAgcjYsID0oYXJtVkNNNFAxMF9DQVZMQ1RvdGFsWmVyb1RhYmxlcyAtIDQpCi0gICAgTERSICAgICAgcjYsW3I2LHI1LExTTCAjMl0KLSAgICBMU0xTICAgICByOCxyMTEscjEyCi0gICAgTU9WUyAgICAgcjcsIzB4MWUKLSAgICBBTkQgICAgICByNyxyNyxyOCxMU1IgIzI3Ci0gICAgU1VCUyAgICAgcjEyLHIxMiwjOAotTDB4MWY0OgotICAgIEJDQyAgICAgIEw1Ci0gICAgTERSQiAgICAgcjgsW3IxMF0sIzEKLUw1OgotICAgIExEUkggICAgIHI3LFtyNixyN10KLSAgICBBRERDQyAgICByMTIscjEyLCM4Ci0gICAgQUREICAgICAgcjEyLHIxMiwjNAotICAgIE9SUkNTICAgIHIxMSxyOCxyMTEsTFNMICM4Ci0gICAgTFNSUyAgICAgcjgscjcsIzEKLSAgICBCQ1MgICAgICBMMHgyMjQKLSAgICBMU0xTICAgICByOCxyMTEscjEyCi0gICAgU1VCUyAgICAgcjEyLHIxMiwjMHhhCi0gICAgQUREICAgICAgcjcscjcscjgsTFNSICMyOQotICAgIEJJQyAgICAgIHI3LHI3LCMxCi0gICAgQiAgICAgICAgTDB4MWY0Ci1MMHgyMjQ6Ci0gICAgU1VCICAgICAgcjEyLHIxMixyNyxMU1IgIzEzCi0gICAgQklDICAgICAgcjcscjgsIzB4ZjAwMAotICAgIENNUCAgICAgIHI3LCMweDEwCi0gICAgQkdFICAgICAgTDB4MzNjCi0gICAgTERSICAgICAgcjMsID0oYXJtVkNNNFAxMF9DQVZMQ1J1bkJlZm9yZVRhYmxlcyAtIDQpCi0gICAgQUREICAgICAgcjQsc3AsIzB4MmMKLSAgICBNT1ZTICAgICByMSxyNwotICAgIEFERCAgICAgIGxyLGxyLHIxCi0gICAgQkVRICAgICAgTDB4MmIwCi1MMHgyNDg6Ci0gICAgU1VCUyAgICAgcjAscjAsIzEKLSAgICBMRFIgICAgICByNixbcjMscjEsTFNMICMyXQotICAgIEJMVCAgICAgIEwweDJiYwotICAgIExTTFMgICAgIHI4LHIxMSxyMTIKLSAgICBNT1ZTICAgICByNywjMHhlCi0gICAgQU5EICAgICAgcjcscjcscjgsTFNSICMyOAotICAgIFNVQlMgICAgIHIxMixyMTIsIzgKLUwweDI2NDoKLSAgICBCQ0MgICAgICBMNgotICAgIExEUkIgICAgIHI4LFtyMTBdLCMxCi1MNjoKLSAgICBMRFJIICAgICByNyxbcjYscjddCi0gICAgQUREQ0MgICAgcjEyLHIxMiwjOAotICAgIEFERCAgICAgIHIxMixyMTIsIzMKLSAgICBPUlJDUyAgICByMTEscjgscjExLExTTCAjOAotICAgIExTUlMgICAgIHI4LHI3LCMxCi0gICAgQkNTICAgICAgTDB4Mjk0Ci0gICAgTFNMUyAgICAgcjgscjExLHIxMgotICAgIFNVQlMgICAgIHIxMixyMTIsIzkKLSAgICBBREQgICAgICByNyxyNyxyOCxMU1IgIzI5Ci0gICAgQklDICAgICAgcjcscjcsIzEKLSAgICBCICAgICAgICBMMHgyNjQKLUwweDI5NDoKLSAgICBTVUIgICAgICByMTIscjEyLHI3LExTUiAjMTMKLSAgICBCSUMgICAgICByNyxyOCwjMHhmMDAwCi0gICAgQ01QICAgICAgcjcsIzB4ZgotICAgIEJHRSAgICAgIEwweDMzYwotICAgIFNVQlMgICAgIHIxLHIxLHI3Ci0gICAgU1RSQiAgICAgcjcsW3I0XSwjMQotICAgIEJHVCAgICAgIEwweDI0OAotTDB4MmIwOgotICAgIFNVQlMgICAgIHIwLHIwLCMxCi0gICAgQkxUICAgICAgTDcKLSAgICBTVFJCICAgICByMSxbcjRdLCMxCi1MNzoKLSAgICBCR1QgICAgICBMMHgyYjAKLUwweDJiYzoKLSAgICBTVFJCICAgICByMSxbcjRdLCMxCi0gICAgTERSICAgICAgcjgsW3NwLCMweDZjXQotICAgIFRFUSAgICAgIHI4LCMweGYKLSAgICBBRERFUSAgICBscixsciwjMQotICAgIFNVQiAgICAgIHI0LHI0LHI1Ci0gICAgU1VCICAgICAgcjIscjIscjUKLSAgICBTVUIgICAgICByMixyMixyNQotICAgIExEUiAgICAgIHIzLFtzcCwjOF0KLSAgICBMRFIgICAgICByMCxbcjMsIzBdCi0gICAgVEVRICAgICAgcjgsIzQKLSAgICBMRFJFUSAgICByNiwgPWFybVZDTTRQMTBfWmlnWmFnXzJ4MgotICAgIExEUk5FICAgIHI2LCA9YXJtVkNNNFAxMF9aaWdaYWdfNHg0Ci1MMHgyZWM6Ci0gICAgTERSQiAgICAgcjksW3I0XSwjMQotICAgIExEUkIgICAgIHI4LFtyNixscl0KLSAgICBTVUIgICAgICBscixsciwjMQotICAgIFNVQiAgICAgIGxyLGxyLHI5Ci0gICAgTERSU0ggICAgcjksW3IyXSwjMgotICAgIFNVQlMgICAgIHI1LHI1LCMxCi0gICAgT1JSRVEgICAgcjgscjgsIzB4MjAKLSAgICBBREQgICAgICByMSxyOSwjMHg4MAotICAgIENNUCAgICAgIHIxLCMweDEwMAotICAgIE9SUkNTICAgIHI4LHI4LCMweDEwCi0gICAgVEVRICAgICAgcjUsIzAKLSAgICBTVFJCICAgICByOCxbcjBdLCMxCi0gICAgU1RSQiAgICAgcjksW3IwXSwjMQotICAgIExTUiAgICAgIHI5LHI5LCM4Ci0gICAgQkNDICAgICAgTDgKLSAgICBTVFJCICAgICByOSxbcjBdLCMxCi1MODoKLSAgICBCTkUgICAgICBMMHgyZWMKLSAgICBTVFIgICAgICByMCxbcjMsIzBdCi0gICAgTERSICAgICAgcjAsW3NwLCMwXQotICAgIExEUiAgICAgIHIxLFtzcCwjNF0KLSAgICBCICAgICAgICBMMHgzNDQKLUwweDMzYzoKLSAgICBNVk4gICAgICByMCwjMQotICAgIEIgICAgICAgIEwweDM1YwotTDB4MzQ0OgotICAgIEFERCAgICAgIHIxMCxyMTAscjEyLExTUiAjMwotICAgIEFORCAgICAgIHIxMixyMTIsIzcKLSAgICBTVUIgICAgICByMTAscjEwLCM0Ci0gICAgU1RSICAgICAgcjEyLFtyMSwjMF0KLSAgICBTVFIgICAgICByMTAsW3IwLCMwXQotICAgIE1PViAgICAgIHIwLCMwCi1MMHgzNWM6Ci0gICAgQUREICAgICAgc3Asc3AsIzB4NDAKLSAgICBQT1AgICAgICB7cjQtcjEyLHBjfQotICAgIC5lbmRmdW5jCi0KLSAgICAuZW5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9yQWxpZ245eF91bnNhZmUKLSAgICAuZnVuYyAgIGFybVZDTTRQMTBfSW50ZXJwb2xhdGVMdW1hX0hvckFsaWduOXhfdW5zYWZlCi1hcm1WQ000UDEwX0ludGVycG9sYXRlTHVtYV9Ib3JBbGlnbjl4X3Vuc2FmZToKLSAgICBNT1YgICAgICByMTIscjgKLSAgICBBTkQgICAgICByNyxyMCwjMwotICAgIEJJQyAgICAgIHIwLHIwLCMzCi0gICAgQUREICAgICAgcGMscGMscjcsTFNMICMyCi0gICAgTk9QCi0gICAgQiAgICAgICAgQ29weTB0b0FsaWduZWQKLSAgICBCICAgICAgICBDb3B5MXRvQWxpZ25lZAotICAgIEIgICAgICAgIENvcHkydG9BbGlnbmVkCi0gICAgQiAgICAgICAgQ29weTN0b0FsaWduZWQKLUNvcHkwdG9BbGlnbmVkOgotICAgIExETSAgICAgIHIwLHtyNyxyMTAscjExfQotICAgIFNVQlMgICAgIHI5LHI5LCMxCi0gICAgQUREICAgICAgcjAscjAscjEKLSAgICBTVE0gICAgICByOCEse3I3LHIxMCxyMTF9Ci0gICAgQkdUICAgICAgQ29weTB0b0FsaWduZWQKLSAgICBCICAgICAgICBDb3B5RW5kCi1Db3B5MXRvQWxpZ25lZDoKLSAgICBMRE0gICAgICByMCx7cjcscjEwLHIxMX0KLSAgICBTVUJTICAgICByOSxyOSwjMQotICAgIEFERCAgICAgIHIwLHIwLHIxCi0gICAgTFNSICAgICAgcjcscjcsIzgKLSAgICBPUlIgICAgICByNyxyNyxyMTAsTFNMICMyNAotICAgIExTUiAgICAgIHIxMCxyMTAsIzgKLSAgICBPUlIgICAgICByMTAscjEwLHIxMSxMU0wgIzI0Ci0gICAgTFNSICAgICAgcjExLHIxMSwjOAotICAgIFNUTSAgICAgIHI4ISx7cjcscjEwLHIxMX0KLSAgICBCR1QgICAgICBDb3B5MXRvQWxpZ25lZAotICAgIEIgICAgICAgIENvcHlFbmQKLUNvcHkydG9BbGlnbmVkOgotICAgIExETSAgICAgIHIwLHtyNyxyMTAscjExfQotICAgIFNVQlMgICAgIHI5LHI5LCMxCi0gICAgQUREICAgICAgcjAscjAscjEKLSAgICBMU1IgICAgICByNyxyNywjMTYKLSAgICBPUlIgICAgICByNyxyNyxyMTAsTFNMICMxNgotICAgIExTUiAgICAgIHIxMCxyMTAsIzE2Ci0gICAgT1JSICAgICAgcjEwLHIxMCxyMTEsTFNMICMxNgotICAgIExTUiAgICAgIHIxMSxyMTEsIzE2Ci0gICAgU1RNICAgICAgcjghLHtyNyxyMTAscjExfQotICAgIEJHVCAgICAgIENvcHkydG9BbGlnbmVkCi0gICAgQiAgICAgICAgQ29weUVuZAotQ29weTN0b0FsaWduZWQ6Ci0gICAgTERNICAgICAgcjAse3I3LHIxMCxyMTF9Ci0gICAgU1VCUyAgICAgcjkscjksIzEKLSAgICBBREQgICAgICByMCxyMCxyMQotICAgIExTUiAgICAgIHI3LHI3LCMyNAotICAgIE9SUiAgICAgIHI3LHI3LHIxMCxMU0wgIzgKLSAgICBMU1IgICAgICByMTAscjEwLCMyNAotICAgIE9SUiAgICAgIHIxMCxyMTAscjExLExTTCAjOAotICAgIExTUiAgICAgIHIxMSxyMTEsIzI0Ci0gICAgU1RNICAgICAgcjghLHtyNyxyMTAscjExfQotICAgIEJHVCAgICAgIENvcHkzdG9BbGlnbmVkCi1Db3B5RW5kOgotICAgIE1PViAgICAgIHIwLHIxMgotICAgIE1PViAgICAgIHIxLCMweGMKLSAgICBCWCAgICAgICBscgotICAgIC5lbmRmdW5jCi0KLSAgICAuZ2xvYmFsIGFybVZDTTRQMTBfSW50ZXJwb2xhdGVMdW1hX1ZlckFsaWduNHhfdW5zYWZlCi0gICAgLmZ1bmMgICBhcm1WQ000UDEwX0ludGVycG9sYXRlTHVtYV9WZXJBbGlnbjR4X3Vuc2FmZQotYXJtVkNNNFAxMF9JbnRlcnBvbGF0ZUx1bWFfVmVyQWxpZ240eF91bnNhZmU6Ci0gICAgQU5EICAgICAgcjcscjAsIzMKLSAgICBCSUMgICAgICByMCxyMCwjMwotICAgIEFERCAgICAgIHBjLHBjLHI3LExTTCAjMgotICAgIE5PUAotICAgIEIgICAgICAgIENvcHkwdG9WQWxpZ25lZAotICAgIEIgICAgICAgIENvcHkxdG9WQWxpZ25lZAotICAgIEIgICAgICAgIENvcHkydG9WQWxpZ25lZAotICAgIEIgICAgICAgIENvcHkzdG9WQWxpZ25lZAotQ29weTB0b1ZBbGlnbmVkOgotICAgIExEUiAgICAgIHI3LFtyMF0scjEKLSAgICBTVUJTICAgICByOSxyOSwjMQotICAgIFNUUiAgICAgIHI3LFtyOF0sIzQKLSAgICBCR1QgICAgICBDb3B5MHRvVkFsaWduZWQKLSAgICBCICAgICAgICBDb3B5VkVuZAotQ29weTF0b1ZBbGlnbmVkOgotICAgIExEUiAgICAgIHIxMCxbcjAsIzRdCi0gICAgTERSICAgICAgcjcsW3IwXSxyMQotICAgIFNVQlMgICAgIHI5LHI5LCMxCi0gICAgTFNMICAgICAgcjEwLHIxMCwjMjQKLSAgICBPUlIgICAgICByNyxyMTAscjcsTFNSICM4Ci0gICAgU1RSICAgICAgcjcsW3I4XSwjNAotICAgIEJHVCAgICAgIENvcHkxdG9WQWxpZ25lZAotICAgIEIgICAgICAgIENvcHlWRW5kCi1Db3B5MnRvVkFsaWduZWQ6Ci0gICAgTERSICAgICAgcjEwLFtyMCwjNF0KLSAgICBMRFIgICAgICByNyxbcjBdLHIxCi0gICAgU1VCUyAgICAgcjkscjksIzEKLSAgICBMU0wgICAgICByMTAscjEwLCMxNgotICAgIE9SUiAgICAgIHI3LHIxMCxyNyxMU1IgIzE2Ci0gICAgU1RSICAgICAgcjcsW3I4XSwjNAotICAgIEJHVCAgICAgIENvcHkydG9WQWxpZ25lZAotICAgIEIgICAgICAgIENvcHlWRW5kCi1Db3B5M3RvVkFsaWduZWQ6Ci0gICAgTERSICAgICAgcjEwLFtyMCwjNF0KLSAgICBMRFIgICAgICByNyxbcjBdLHIxCi0gICAgU1VCUyAgICAgcjksc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mVvbgotICAgIC50ZXh0Ci0KLSAgICAuZ2xvYmFsIGFybVZDTTRQMTBfSW50ZXJwb2xhdGVMdW1hX0NvcHk0eDRfdW5zYWZlCi0gICAgLmZ1bmMgICBhcm1WQ000UDEwX0ludGVycG9sYXRlTHVtYV9Db3B5NHg0X3Vuc2FmZQotYXJtVkNNNFAxMF9JbnRlcnBvbGF0ZUx1bWFfQ29weTR4NF91bnNhZmU6Ci0gICAgUFVTSCAgICAge3I0LXI2LGxyfQotICAgIEFORCAgICAgIHIxMixyMCwjMwotICAgIEJJQyAgICAgIHIwLHIwLCMzCi0gICAgQUREICAgICAgcGMscGMscjEyLExTTCAjMgotICAgIE5PUAotICAgIEIgICAgICAgIENvcHk0eDRBbGlnbjAKLSAgICBCICAgICAgICBDb3B5NHg0QWxpZ24xCi0gICAgQiAgICAgICAgQ29weTR4NEFsaWduMgotICAgIEIgICAgICAgIENvcHk0eDRBbGlnbjMKLUNvcHk0eDRBbGlnbjA6Ci0gICAgTERSICAgICAgcjQsW3IwXSxyMQotICAgIExEUiAgICAgIHI1LFtyMF0scjEKLSAgICBTVFIgICAgICByNCxbcjJdLHIzCi0gICAgTERSICAgICAgcjgsW3IwXSxyMQotICAgIFNUUiAgICAgIHI1LFtyMl0scjMKLSAgICBMRFIgICAgICByOSxbcjBdLHIxCi0gICAgU1RSICAgICAgcjgsW3IyXSxyMwotICAgIFNUUiAgICAgIHI5LFtyMl0scjMKLSAgICBCICAgICAgICBDb3B5NHg0RW5kCi1Db3B5NHg0QWxpZ24xOgotICAgIExEUiAgICAgIHI1LFtyMCwjNF0KLSAgICBMRFIgICAgICByNCxbcjBdLHIxCi0gICAgTERSICAgICAgcjksW3IwLCM0XQotICAgIExEUiAgICAgIHI4LFtyMF0scjEKLSAgICBMU1IgICAgICByNCxyNCwjOAotICAgIE9SUiAgICAgIHI0LHI0LHI1LExTTCAjMjQKLSAgICBTVFIgICAgICByNCxbcjJdLHIzCi0gICAgTFNSICAgICAgcjgscjgsIzgKLSAgICBPUlIgICAgICByOCxyOCxyOSxMU0wgIzI0Ci0gICAgTERSICAgICAgcjUsW3IwLCM0XQotICAgIExEUiAgICAgIHI0LFtyMF0scjEKLSAgICBTVFIgICAgICByOCxbcjJdLHIzCi0gICAgTERSICAgICAgcjksW3IwLCM0XQotICAgIExEUiAgICAgIHI4LFtyMF0scjEKLSAgICBMU1IgICAgICByNCxyNCwjOAotICAgIE9SUiAgICAgIHI0LHI0LHI1LExTTCAjMjQKLSAgICBTVFIgICAgICByNCxbcjJdLHIzCi0gICAgTFNSICAgICAgcjgscjgsIzgKLSAgICBPUlIgICAgICByOCxyOCxyOSxMU0wgIzI0Ci0gICAgU1RSICAgICAgcjgsW3IyXSxyMwotICAgIEIgICAgICAgIENvcHk0eDRFbmQKLUNvcHk0eDRBbGlnbjI6Ci0gICAgTERSICAgICAgcjUsW3IwLCM0XQotICAgIExEUiAgICAgIHI0LFtyMF0scjEKLSAgICBMRFIgICAgICByOSxbcjAsIzRdCi0gICAgTERSICAgICAgcjgsW3IwXSxyMQotICAgIExTUiAgICAgIHI0LHI0LCMxNgotICAgIE9SUiAgICAgIHI0LHI0LHI1LExTTCAjMTYKLSAgICBTVFIgICAgICByNCxbcjJdLHIzCi0gICAgTFNSICAgICAgcjgscjgsIzE2Ci0gICAgT1JSICAgICAgcjgscjgscjksTFNMICMxNgotICAgIFNUUiAgICAgIHI4LFtyMl0scjMKLSAgICBMRFIgICAgICByNSxbcjAsIzRdCi0gICAgTERSICAgICAgcjQsW3IwXSxyMQotICAgIExEUiAgICAgIHI5LFtyMCwjNF0KLSAgICBMRFIgICAgICByOCxbcjBdLHIxCi0gICAgTFNSICAgICAgcjQscjQsIzE2Ci0gICAgT1JSICAgICAgcjQscjQscjUsTFNMICMxNgotICAgIFNUUiAgICAgIHI0LFtyMl0scjMKLSAgICBMU1IgICAgICByOCxyOCwjMTYKLSAgICBPUlIgICAgICByOCxyOCxyOSxMU0wgIzE2Ci0gICAgU1RSICAgICAgcjgsW3IyXSxyMwotICAgIEIgICAgICAgIENvcHk0eDRFbmQKLUNvcHk0eDRBbGlnbjM6Ci0gICAgTERSICAgICAgcjUsW3IwLCM0XQotICAgIExEUiAgICAgIHI0LFtyMF0scjEKLSAgICBMRFIgICAgICByOSxbcjAsIzRdCi0gICAgTERSICAgICAgcjgsW3IwXSxyMQotICAgIExTUiAgICAgIHI0LHI0LCMyNAotICAgIE9SUiAgICAgIHI0LHI0LHI1LExTTCAjOAotICAgIFNUUiAgICAgIHI0LFtyMl0scjMKLSAgICBMU1IgICAgICByOCxyOCwjMjQKLSAgICBPUlIgICAgICByOCxyOCxyOSxMU0wgIzgKLSAgICBTVFIgICAgICByOCxbcjJdLHIzCi0gICAgTERSICAgICAgcjUsW3IwLCM0XQotICAgIExEUiAgICAgIHI0LFtyMF0scjEKLSAgICBMRFIgICAgICByOSxbcjAsIzRdCi0gICAgTERSICAgICAgcjgsW3IwXSxyMQotICAgIExTUiAgICAgIHI0LHI0LCMyNAotICAgIE9SUiAgICAgIHI0LHI0LHI1LExTTCAjOAotICAgIFNUUiAgICAgIHI0LFtyMl0scjMKLSAgICBMU1IgICAgICByOCxyOCwjMjQKLSAgICBPUlIgICAgICByOCxyOCxyOSxMU0wgIzgKLSAgICBTVFIgICAgICByOCxbcjJdLHIzCi1Db3B5NHg0RW5kOgotICAgIFBPUCAgICAgIHtyNC1yNixwY30KLSAgICAuZW5kZnVuYwotCi0gICAgLmVuZAotCmRpZmYgLS1naXQgYS9tZWRpYS9saWJzdGFnZWZyaWdodC9jb2RlY3Mvb24yL2gyNjRkZWMvb214ZGwvYXJtX25lb24vdmMvbTRwMTAvc3JjX2djYy9hcm1WQ000UDEwX0ludGVycG9sYXRlTHVtYV9EaWFnQ29weV91bnNhZmVfcy5TIGIvbWVkaWEvbGlic3RhZ2VmcmlnaHQvY29kZWNzL29uMi9oMjY0ZGVjL29teGRsL2FybV9uZW9uL3ZjL200cDEwL3NyY19nY2MvYXJtVkNNNFAxMF9JbnRlcn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gICBVUVNVQjE2ICByMTAscjEwLHI2Ci0gICAgVVFTVUIxNiAgcjUscjUscjYKLSAgICBVUVNVQjE2ICByNCxyNCxyNgotICAgIFVTQVQxNiAgIHIxMSwjMTMscjExCi0gICAgVVNBVDE2ICAgcjEwLCMxMyxyMTAKLSAgICBVU0FUMTYgICByNSwjMTMscjUKLSAgICBVU0FUMTYgICByNCwjMTMscjQKLSAgICBBTkQgICAgICByMTEscjEyLHIxMSxMU1IgIzUKLSAgICBBTkQgICAgICByMTAscjEyLHIxMCxMU1IgIzUKLSAgICBBTkQgICAgICByNSxyMTIscjUsTFNSICM1Ci0gICAgQU5EICAgICAgcjQscjEyLHI0LExTUiAjNQotICAgIE9SUiAgICAgIHIxMSxyMTAscjExLExTTCAjOAotICAgIE9SUiAgICAgIHIxMCxyNCxyNSxMU0wgIzgKLSAgICBTVUJTICAgICBscixsciwjMQotICAgIFNUUkQgICAgIHIxMCxyMTEsW3I3XSwjOAotICAgIEJHVCAgICAgIExvb3BTdGFydDEKLSAgICBTVUIgICAgICByMCxyNywjMHgyMAotICAgIE1PViAgICAgIHIxLCM4Ci0gICAgUE9QICAgICAge3I0LXI2LHBjfQotICAgIC5lbmRmdW5jCi0KLSAgICAuZ2xvYmFsIGFybVZDTTRQMTBfSW50ZXJwb2xhdGVMdW1hX1ZlckRpYWdDb3B5X3Vuc2FmZQotICAgIC5mdW5jICAgYXJtVkNNNFAxMF9JbnRlcnBvbGF0ZUx1bWFfVmVyRGlhZ0NvcHlfdW5zYWZlCi1hcm1WQ000UDEwX0ludGVycG9sYXRlTHVtYV9WZXJEaWFnQ29weV91bnNhZmU6Ci0gICAgUFVTSCAgICAge3I0LXI2LGxyfQotICAgIExEUiAgICAgIHI2LCA9MHhmZTAwZmUwCi0gICAgTERSICAgICAgcjEyLCA9MHhmZjAwZmYKLSAgICBNT1YgICAgICBsciwjMgotTG9vcFN0YXJ0OgotICAgIExEUiAgICAgIHIxMSxbcjAsIzB4Y10KLSAgICBMRFIgICAgICByMTAsW3IwLCM4XQotICAgIExEUiAgICAgIHI1LFtyMCwjNF0KLSAgICBMRFIgICAgICByNCxbcjBdLHIxCi0gICAgVVFTVUIxNiAgcjExLHIxMSxyNgotICAgIFVRU1VCMTYgIHIxMCxyMTAscjYKLSAgICBVUVNVQjE2ICByNSxyNSxyNgotICAgIFVRU1VCMTYgIHI0LHI0LHI2Ci0gICAgVVNBVDE2ICAgcjExLCMxMyxyMTEKLSAgICBVU0FUMTYgICByMTAsIzEzLHIxMAotICAgIFVTQVQxNiAgIHI1LCMxMyxyNQotICAgIFVTQVQxNiAgIHI0LCMxMyxyNAotICAgIEFORCAgICAgIHIxMSxyMTIscjExLExTUiAjNQotICAgIEFORCAgICAgIHIxMCxyMTIscjEwLExTUiAjNQotICAgIEFORCAgICAgIHI1LHIxMixyNSxMU1IgIzUKLSAgICBBTkQgICAgICByNCxyMTIscjQsTFNSICM1Ci0gICAgT1JSICAgICAgcjExLHIxMCxyMTEsTFNMICM4Ci0gICAgT1JSICAgICAgcjEwLHI0LHI1LExTTCAjOAotICAgIFBLSEJUICAgIHI0LHIxMCxyMTEsTFNMICMxNgotICAgIFNUUiAgICAgIHI0LFtyN10sIzgKLSAgICBQS0hUQiAgICByNSxyMTEscjEwLEFTUiAjMTYKLSAgICBTVFIgICAgICByNSxbcjddLCMtNAotICAgIExEUiAgICAgIHIxMSxbcjAsIzB4Y10KLSAgICBMRFIgICAgICByMTAsW3IwLCM4XQotICAgIExEUiAgICAgIHI1LFtyMCwjNF0KLSAgICBMRFIgICAgICByNCxbcjBdLHIxCi0gICAgVVFTVUIxNiAgcjExLHIxMSxyNgotICAgIFVRU1VCMTYgIHIxMCxyMTAscjYKLSAgICBVUVNVQjE2ICByNSxyNSxyNgotICAgIFVRU1VCMTYgIHI0LHI0LHI2Ci0gICAgVVNBVDE2ICAgcjExLCMxMyxyMTEKLSAgICBVU0FUMTYgICByMTAsIzEzLHIxMAotICAgIFVTQVQxNiAgIHI1LCMxMyxyNQotIC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QICAgICB7ZDgtZDE1fQotICAgIFBPUCAgICAgIHtyNC1yMTIscGN9Ci0KLVdpZHRoSXM4TVZJc1plcm86Ci0gICAgU1VCICAgICAgcjAscjAscjEKLVdpZHRoSXM4TG9vcE1WSXNaZXJvOgotICAgIFZMRDEuOCAgIHtkMH0sW3IwXSxyMQotICAgIFNVQlMgICAgIHI1LHI1LCMyCi0gICAgVkxEMS44ICAge2QxfSxbcjBdLHIxCi0gICAgVlNUMS42NCAge2QwfSxbcjJdLHIzCi0gICAgVlNUMS42NCAge2QxfSxbcjJdLHIzCi0gICAgQkdUICAgICAgV2lkdGhJczhMb29wTVZJc1plcm8KLSAgICBNT1YgICAgICByMCwjMAotICAgIFZQT1AgICAgIHtkOC1kMTV9Ci0gICAgUE9QICAgICAge3I0LXIxMixwY30KLQotV2lkdGhJczRNVklzWmVybzoKLSAgICBWTEQxLjggICB7ZDF9LFtyMF0scjEKLSAgICBTVUJTICAgICByNSxyNSwjMgotICAgIFZTVDEuMzIgIHtkMFswXX0sW3IyXSxyMwotICAgIFZMRDEuOCAgIHtkMH0sW3IwXSxyMQotICAgIFZTVDEuMzIgIHtkMVswXX0sW3IyXSxyMwotICAgIEJHVCAgICAgIFdpZHRoSXM0TVZJc1plcm8KLSAgICBNT1YgICAgICByMCwjMAotICAgIFZQT1AgICAgIHtkOC1kMTV9Ci0gICAgUE9QICAgICAge3I0LXIxMixwY30KLQotV2lkdGhJczJNVklzWmVybzoKLSAgICBWTEQxLjggICB7ZDF9LFtyMF0scjEKLSAgICBTVUJTICAgICByNSxyNSwjMgotICAgIFZTVDEuMTYgIHtkMFswXX0sW3IyXSxyMwotICAgIFZMRDEuOCAgIHtkMH0sW3IwXSxyMQotICAgIFZTVDEuMTYgIHtkMVswXX0sW3IyXSxyMwotICAgIEJHVCAgICAgIFdpZHRoSXMyTVZJc1plcm8KLSAgICBNT1YgICAgICByMCwjMAotICAgIFZQT1AgICAgIHtkOC1kMTV9Ci0gICAgUE9QICAgICAge3I0L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LSAgICBMRFIgICAgICByNCxbc3AsIzB4MjhdCi0gICAgTERSICAgICAgcjUsW3NwLCMweDJjXQotICAgIEJFUSAgICAgIEwweDU4Ci0gICAgVFNUICAgICAgcjYsIzcKLSAgICBUU1RFUSAgICByOSwjNwotICAgIEJORSAgICAgIEwweDU4Ci0gICAgQ01QICAgICAgcjcsIzAKLSAgICBDTVBORSAgICByOCwjMAotICAgIENNUE5FICAgIHI0LCMwCi0gICAgQkVRICAgICAgTDB4NTgKLSAgICBUU1QgICAgICByNCwjMwotICAgIEJORSAgICAgIEwweDU4Ci0gICAgQ01QICAgICAgcjUsIzAKLSAgICBCRVEgICAgICBMMHg1OAotICAgIFRTVCAgICAgIHI1LCMzCi0gICAgQkVRICAgICAgTDB4NjQKLUwweDU4OgotICAgIE1WTiAgICAgIHIwLCM0Ci1MMHg1YzoKLSAgICBBREQgICAgICBzcCxzcCwjMHhjCi0gICAgUE9QICAgICAge3I0LXI5LHBjfQotTDB4NjQ6Ci0gICAgU1RSICAgICAgcjQsW3NwLCMwXQotICAgIE1PViAgICAgIHIzLHI4Ci0gICAgU1RSICAgICAgcjUsW3NwLCM0XQotICAgIE1PViAgICAgIHIyLHI3Ci0gICAgTU9WICAgICAgcjEscjkKLSAgICBNT1YgICAgICByMCxyNgotICAgIEJMICAgICAgIG9teFZDTTRQMTBfRmlsdGVyRGVibG9ja2luZ0x1bWFfVmVyRWRnZV9JCi0gICAgQ01QICAgICAgcjAsIzAKLSAgICBCTkUgICAgICBMMHg1YwotICAgIEFERCAgICAgIHIzLHI1LCMweDEwCi0gICAgQUREICAgICAgcjIscjQsIzB4MTAKLSAgICBTVFIgICAgICByMyxbc3AsIzRdCi0gICAgU1RSICAgICAgcjIsW3NwLCMwXQotICAgIEFERCAgICAgIHIzLHI4LCMyCi0gICAgQUREICAgICAgcjIscjcsIzIKLSAgICBNT1YgICAgICByMSxyOQotICAgIE1PViAgICAgIHIwLHI2Ci0gICAgQkwgICAgICAgb214VkNNNFAxMF9G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Gcm9tUGFpckFuZEFkZAotICAgIC5mdW5jICAgb214VkNNNFAxMF9EZXF1YW50VHJhbnNmb3JtUmVzaWR1YWxGcm9tUGFpckFuZEFkZAotb214VkNNNFAxMF9EZXF1YW50VHJhbnNmb3JtUmVzaWR1YWxGcm9tUGFpckFuZEFkZDoKLSAgICBQVVNIICAgICB7cjQtcjEyLGxyfQotICAgIFZQVVNIICAgIHtkOC1kOX0KLSAgICBTVUIgICAgICBzcCxzcCwjMHgyMAotICAgIEFERCAgICAgIHI0LHNwLCMwCi0gICAgTERSICAgICAgcjUsW3NwLCMweDY0XQotICAgIE1PViAgICAgIHI3LHIxCi0gICAgTU9WICAgICAgcjgscjIKLSAgICBNT1YgICAgICByOSxyMwotICAgIENNUCAgICAgIHI1LCMwCi0gICAgQkVRICAgICAgTDB4MTE0Ci0gICAgTU9WICAgICAgcjEscjQKLSAgICBCTCAgICAgICBhcm1WQ000UDEwX1VucGFja0Jsb2NrNHg0ICA7Ly8KLSAgICBMRFIgICAgICByMSxbc3AsIzB4NjBdCi0gICAgTERSICAgICAgcjExLCA9YXJtVkNNNFAxMF9RUE1vZHVsb1RhYmxlCi0gICAgTERSICAgICAgcjEwLCA9YXJtVkNNNFAxMF9RUERpdlRhYmxlCi0gICAgTERSICAgICAgcjIsICA9YXJtVkNNNFAxMF9WTWF0cml4VTE2Ci0gICAgTERSU0IgICAgcjEyLFtyMTEscjFdCi0gICAgTERSU0IgICAgbHIsW3IxMCxyMV0KLSAgICBMRFIgICAgICByMTAsID0weDMwMjA1MDQKLSAgICBMRFIgICAgICByMSwgPTB4NTA0MDEwMAotICAgIEFERCAgICAgIHIyLHIyLHIxMgotICAgIFZEVVAuMzIgIGQ3LHIxCi0gICAgVkRVUC4zMiAgZDkscjEwCi0gICAgVkRVUC4xNiAgZDUsbHIKLSAgICBWTEQxLjggICB7ZDZ9LFtyMl0KLSAgICBWVEJMLjggICBkOCx7ZDZ9LGQ3Ci0gICAgVlRCTC44ICAgZDQse2Q2fS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WZlCi0gICAgVkJJVCAgICAgZDI5LGQxMyxkMjYKLSAgICBWQklUICAgICBkMjQsZDMxLGQyNgotICAgIEFERCAgICAgIHIxMCxyMCwjMwotICAgIFZCSUYgICAgIGQyOSxkNCxkMTYKLSAgICBBREQgICAgICByMTIscjEwLHIxCi0gICAgQUREICAgICAgbHIscjEscjEKLSAgICBWQklGICAgICBkMjQsZDgsZDE2Ci0gICAgQUREUyAgICAgcjcscjcscjcKLSAgICBWU1QxLjggICB7ZDI5WzBdfSxbcjEwXSxscgotICAgIFZTVDEuOCAgIHtkMjlbMV19LFtyMTJdLGxyCi0gICAgVlNUMS44ICAge2QyOVsyXX0sW3IxMF0sbHIKLSAgICBWU1QxLjggICB7ZDI5WzNdfSxbcjEyXSxscgotICAgIFZTVDEuOCAgIHtkMjlbNF19LFtyMTBdLGxyCi0gICAgVlNUMS44ICAge2QyOVs1XX0sW3IxMl0sbHIKLSAgICBWU1QxLjggICB7ZDI5WzZdfSxbcjEwXSxscgotICAgIFZTVDEuOCAgIHtkMjlbN119LFtyMTJdLGxyCi0gICAgQUREICAgICAgcjEyLHIwLCM0Ci0gICAgQUREICAgICAgcjEwLHIxMixyMQotICAgIFZTVDEuOCAgIHtkMjRbMF19LFtyMTJdLGxyCi0gICAgVlNUMS44ICAge2QyNFsxXX0sW3IxMF0sbHIKLSAgICBWU1QxLjggICB7ZDI0WzJdfSxbcjEyXSxscgotICAgIFZTVDEuOCAgIHtkMjRbM119LFtyMTBdLGxyCi0gICAgVlNUMS44ICAge2QyNFs0XX0sW3IxMl0sbHIKLSAgICBWU1QxLjggICB7ZDI0WzVdfSxbcjEwXSxscgotICAgIFZTVDEuOCAgIHtkMjRbNl19LFtyMTJdLGxyCi0gICAgVlNUMS44ICAge2QyNFs3XX0sW3IxMF0sbHIKLSAgICBBREQgICAgICByMCxyMCwjNAotICAgIEJORSAgICAgIEwweDM0Ci0gICAgTU9WICAgICAgcjAsIzAKLSAgICBWUE9QICAgICB7ZDgtZDE1fQ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IwXQotICAgIEFERCAgICAgIHIwLHI2LCM4Ci0gICAgQkNDICAgICAgTDB4MzgKLSAgICBCICAgICAgICBMMHgxMzAKLUwweGU0OgotICAgIEFERCAgICAgIHIwLHIwLCM4Ci0gICAgQUREUyAgICAgcjkscjkscjkKLSAgICBBREQgICAgICByNSxyNSwjMgotICAgIEJDQyAgICAgIEwweDM4Ci0gICAgQiAgICAgICAgTDB4MTMwCi1MMHhmODoKLSAgICBTVUIgICAgICByMCxyMCxyMSxMU0wgIzIKLSAgICBTVUIgICAgICByMCxyMCxyMSxMU0wgIzEKLSAgICBCTCAgICAgICBhcm1WQ000UDEwX0RlYmxvY2tpbmdMdW1hYlNHRTRfdW5zYWZlCi0gICAgVlNUMS44ICAge2QzMX0sW3IwXSxyMQotICAgIFZTVDEuOCAgIHtkMzB9LFtyMF0scjEKLSAgICBWU1QxLjggICB7ZDI5fSxbcjBdLHIxCi0gICAgU1VCICAgICAgcjYscjAscjEsTFNMICMyCi0gICAgVlNUMS44ICAge2QyNH0sW3IwXSxyMQotICAgIEFERFMgICAgIHI5LHI5LHI5Ci0gICAgVlNUMS44ICAge2QyNX0sW3IwXSxyMQotICAgIEFERCAgICAgIHI1LHI1LCMyCi0gICAgVlNUMS44ICAge2QyOH0sW3IwXQotICAgIEFERCAgICAgIHIwLHI2LCM4Ci0gICAgQkNDICAgICAgTDB4MzgKLUwweDEzMDoKLSAgICBTVUIgICAgICByMCxyMCwjMHgxMAotICAgIFZMRDEuOCAgIHtkMFtdfSxbcjddCi0gICAgQUREICAgICAgcjAscjAscjEsTFNMICMyCi0gICAgVkxEMS44ICAge2QyW119LFtyOF0KLSAgICBCTkUgICAgICBMMHgzOAotICAgIE1PViAgICAgIHIwLCMwCi0gICAgVlBPUCAgICAge2Q4LWQxNX0KLSAgICBQT1AgICAgICB7cjQtcjEyLHBjfQotICAgIC5lbmRmdW5jCi0KLSAgICAuZW5kCi0KZGlmZiAtLWdpdCBhL21lZGlhL2xpYnN0YWdlZnJpZ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0gICAgQUREICAgICAgcjcscjIsIzEKLSAgICBBREQgICAgICByOCxyMywjMQotICAgIFZMRDEuOCAgIHtkMFtdfSxbcjJdCi0gICAgU1VCICAgICAgcjAscjAsIzQKLSAgICBWTEQxLjggICB7ZDJbXX0sW3IzXQotICAgIExEUiAgICAgIHI0LFtzcCwjMHg2Y10KLSAgICBMRFIgICAgICByNSxbc3AsIzB4NjhdCi0gICAgTU9WICAgICAgcjYsIzAKLSAgICBWTU9WLkk4ICBkMTQsIzAKLSAgICBWTU9WLkk4ICBkMTUsIzB4MQotICAgIE1PViAgICAgIHI5LCMweDExMDAwMDAwCi0gICAgQUREICAgICAgcjExLHIxLHIxCi1MMHgzODoKLSAgICBMRFJIICAgICByMTIsW3I0XSwjNAotICAgIENNUCAgICAgIHIxMiwjMAotICAgIEJFUSAgICAgIEwweDE2MAotICAgIEFERCAgICAgIHIxMCxyMCxyMQotICAgIFZMRDEuOCAgIHtkN30sW3IwXSxyMTEKLSAgICBWTEQxLjggICB7ZDh9LFtyMTBdLHIxMQotICAgIFZMRDEuOCAgIHtkNX0sW3IwXSxyMTEKLSAgICBWWklQLjggICBkNyxkOAotICAgIFZMRDEuOCAgIHtkMTB9LFtyMTBdLHIxMQotICAgIFZMRDEuOCAgIHtkNn0sW3IwXSxyMTEKLSAgICBWWklQLjggICBkNSxkMTAKLSAgICBWTEQxLjggICB7ZDl9LFtyMTBdLHIxMQotICAgIFZMRDEuOCAgIHtkNH0sW3IwXSxyMTEKLSAgICBWTEQxLjggICB7ZDExfSxbcjEwXSxyMTEKLSAgICBWWklQLjggICBkNixkOQotICAgIFZaSVAuMTYgIGQ4LGQxMAotICAgIFZaSVAuOCAgIGQ0LGQxMQotICAgIFNVQiAgICAgIHIwLHIwLHIxLExTTCAjMwotICAgIFZaSVAuMTYgIGQ3LGQ1Ci0gICAgVlpJUC4xNiAgZDksZDExCi0gICAgVlpJUC4xNiAgZDYsZDQKLSAgICBWVFJOLjMyICBkOCxkOQotICAgIFZUUk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AgICBWVFJOLjMyICBkNixkMjUKLSAgICBWVFJOLjMyICBkMjksZDExCi0gICAgVlNUMS44ICAge2Q3fSxbcjBdLHIxMQotICAgIFZTVDEuOCAgIHtkMjR9LFtyMTBdLHIxMQotICAgIFZTVDEuOCAgIHtkMzB9LFtyMF0scjExCi0gICAgVlNUMS44ICAge2QxMH0sW3IxMF0scjExCi0gICAgVlNUMS44ICAge2Q2fSxbcjBdLHIxMQotICAgIFZTVDEuOCAgIHtkMjV9LFtyMTBdLHIxMQotICAgIEFERFMgICAgIHI5LHI5LHI5Ci0gICAgVlNUMS44ICAge2QyOX0sW3IwXSxyMTEKLSAgICBBREQgICAgICByNSxyNSwjMgotICAgIFZTVDEuOCAgIHtkMTF9LFtyMTBdLHIxCi0gICAgU1VCICAgICAgcjAscjAscjEsTFNMICMzCi0gICAgVkxEMS44ICAge2QwW119LFtyN10KLSAgICBBREQgICAgICByMCxyMCwjNAotICAgIFZMRDEuOCAgIHtkMltdfSxbcjhdCi0gICAgQkNDICAgICAgTDB4MzgKLSAgICBCICAgICAgICBMMHgxZjAKLUwweDE2MDoKLSAgICBBREQgICAgICByMCxyMCwjNAotICAgIEFERFMgICAgIHI5LHI5LHI5Ci0gICAgVkxEMS44ICAge2QwW119LFtyN10KLSAgICBBREQgICAgICByNSxyNSwjNAotICAgIFZMRDEuOCAgIHtkMltdfSxbcjhdCi0gICAgQkNDICAgICAgTDB4MzgKLSAgICBCICAgICAgICBMMHgxZjAKLUwweDE3YzoKLSAgICBCTCAgICAgICBhcm1WQ000UDEwX0RlYmxvY2tpbmdMdW1hYlNHRTRfdW5zYWZlCi0gICAgVlpJUC44ICAgZDcsZDMxCi0gICAgVlpJUC44ICAgZDMwLGQyOQotICAgIFZaSVAuOCAgIGQyNCxkMjUKLSAgICBWWklQLjggICBkMjgsZDExCi0gICAgVlpJUC4xNiAgZDcsZDMwCi0gICAgQUREICAgICAgcjEwLHIwLHIxCi0gICAgVlpJUC4xNiAgZDI0LGQyOAotICAgIFZaSVAuMTYgIGQyNSxkMTEKLSAgICBWWklQLjE2ICBkMzEsZDI5Ci0gICAgVlRSTi4zMiAgZDcsZDI0Ci0gICAgVlRSTi4zMiAgZDMwLGQyOAotICAgIFZUUk4uMzIgIGQzMSxkMjUKLSAgICBWVFJOLjMyICBkMjksZDExCi0gICAgVlNUMS44ICAge2Q3fSxbcjBdLHIxMQotICAgIFZTVDEuOCAgIHtkMjR9LFtyMTBdLHIxMQotICAgIFZTVDEuOCAgIHtkMzB9LFtyMF0scjExCi0gICAgVlNUMS44ICAge2QyOH0sW3IxMF0scjExCi0gICAgVlNUMS44ICAge2QzMX0sW3IwXSxyMTEKLSAgICBWU1QxLjggICB7ZDI1fSxbcjEwXSxyMTEKLSAgICBBRERTICAgICByOSxyOSxyOQotICAgIFZTVDEuOCAgIHtkMjl9LFtyMF0scjExCi0gICAgQUREICAgICAgcjUscjUsIzQKLSAgICBWU1QxLjggICB7ZDExfSxbcjEwXSxyMTEKLSAgICBTVUIgICAgICByMCxyMCxyMSxMU0wgIzMKLSAgICBWTEQxLjggICB7ZDBbXX0sW3I3XQotICAgIEFERCAgICAgIHIwLHIwLCM0Ci0gICAgVkxEMS44ICAge2QyW119LFtyOF0KLSAgICBCQ0MgICAgICBMMHgzOAotTDB4MWYwOgotICAgIFNVQiAgICAgIHI0LHI0LCMweGUKLSAgICBTVUIgICAgICByNSxyNSwjMHhlCi0gICAgU1VCICAgICAgcjAscjAsIzB4MTAKLSAgICBWTEQxLjggICB7ZDBbXX0sW3IyXQotICAgIEFERCAgICAgIHIwLHIwLHIxLExTTCAjMwotICAgIFZMRDEuOCAgIHtkMltdfSxbcjNdCi0gICAgQk5FICAgICAgTDB4MzgKLSAgICBNT1YgICAgICByMCwjMAotICAgIFZQT1AgICAgIHtkOC1kMTV9Ci0gICAgUE9QICAgICAge3I0LXIxMixwY30KLSAgICAuZW5kZnVuYwotCi0gICAgLmVuZAotCmRpZmYgLS1naXQgYS9tZWRpYS9saWJzdGFnZWZ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BdCi0gICAgTERSICAgICAgcjQsW3NwLCMweDg0XQotICAgIEFERCAgICAgIHI2LHI2LHI3LExTTCAjMgotICAgIEFERCAgICAgIHIxMSxzcCwjMAotICAgIFZNT1YuSTE2IGQzMSwjMHgxNAotICAgIFZNT1YuSTE2IGQzMCwjMHg1Ci1MMHgyYzoKLSAgICBTVE0gICAgICByMTEse3IwLXIzfQotICAgIEFERCAgICAgIHBjLHBjLHI2LExTTCAjMgotICAgIEIgICAgICAgIEwweDNmMAotICAgIEIgICAgICAgIEwweDc4Ci0gICAgQiAgICAgICAgTDB4YTgKLSAgICBCICAgICAgICBMMHhkYwotICAgIEIgICAgICAgIEwweDEwMAotICAgIEIgICAgICAgIEwweDEzNAotICAgIEIgICAgICAgIEwweDE2OAotICAgIEIgICAgICAgIEwweDFhOAotICAgIEIgICAgICAgIEwweDFmMAotICAgIEIgICAgICAgIEwweDIzNAotICAgIEIgICAgICAgIEwweDI1OAotICAgIEIgICAgICAgIEwweDJiMAotICAgIEIgICAgICAgIEwweDJkOAotICAgIEIgICAgICAgIEwweDMzMAotICAgIEIgICAgICAgIEwweDM2NAotICAgIEIgICAgICAgIEwweDNhOAotICAgIEIgICAgICAgIEwweDNmMAotTDB4Nzg6Ci0gICAgQUREICAgICAgcjEyLHIwLHIxLExTTCAjMQotICAgIFZMRDEuOCAgIHtkOX0sW3IwXSxyMQotICAgIFZMRDEuOCAgIHtkMTF9LFtyMTJdLHIxCi0gICAgVkxEMS44ICAge2QxMH0sW3IwXQotICAgIFZMRDEuOCAgIHtkMTJ9LFtyMTJdCi0gICAgQUREICAgICAgcjEyLHIyLHIzLExTTCAjMQotICAgIFZTVDEuMzIgIHtkOVswXX0sW3IyXSxyMwotICAgIFZTVDEuMzIgIHtkMTFbMF19LFtyMTJdLHIzCi0gICAgVlNUMS4zMiAge2QxMFswXX0sW3IyXQotICAgIFZTVDEuMzIgIHtkMTJbMF19LFtyMTJdCi0gICAgQUREICAgICAgcjExLHNwLCMwCi0gICAgQ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DaHJvbWFfOHg4Ci1vbXhWQ000UDEwX1ByZWRpY3RJbnRyYUNocm9tYV84eDg6Ci0gICAgUFVTSCAgICAge3I0LXIxMCxscn0KLSAgICBWUFVTSCAgICB7ZDgtZDE1fQotICAgIExEUiAgICAgIHI4LCA9YXJtVkNNNFAxMF9wSW5kZXhUYWJsZTh4OAotICAgIExEUiAgICAgIHI2LFtzcCwjMHg2OF0KLSAgICBMRFIgICAgICByNCxbc3AsIzB4NjBdCi0gICAgTERSICAgICAgcjUsW3NwLCMweDY0XQotICAgIExEUiAgICAgIHI3LFtzcCwjMHg2Y10KLSAgICBMRFIgICAgICBwYyxbcjgscjYsTFNMICMyXQotT01YX1ZDX0NIUk9NQV9EQzoKLSAgICBUU1QgICAgICByNywjMgotICAgIEJFUSAgICAgIEwweGU4Ci0gICAgQUREICAgICAgcjkscjAscjQKLSAgICBBREQgICAgICByMTAscjQscjQKLSAgICBWTEQxLjggICB7ZDFbMF19LFtyMF0scjEwCi0gICAgVkxEMS44ICAge2QxWzFdfSxbcjldLHIxMAotICAgIFZMRDEuOCAgIHtkMVsyXX0sW3IwXSxyMTAKLSAgICBWTEQxLjggICB7ZDFbM119LFtyOV0scjEwCi0gICAgVkxEMS44ICAge2QxWzRdfSxbcjBdLHIxMAotICAgIFZMRDEuOCAgIHtkMVs1XX0sW3I5XSxyMTAKLSAgICBWTEQxLjggICB7ZDFbNl19LFtyMF0scjEwCi0gICAgVkxEMS44ICAge2QxWzddfSxbcjldCi0gICAgVFNUICAgICAgcjcsIzEKLSAgICBCRVEgICAgICBMMHhjYwotICAgIFZMRDEuOCAgIHtkMH0sW3IxXQotICAgIE1PViAgICAgIHIwLCMwCi0gICAgVlBBRERMLlU4IGQyLGQwCi0gICAgVlBBRERMLlUxNiBkMyxkMgotICAgIFZQQURETC5VOCBkMixkMQotICAgIFZQQURETC5VMTYgZDEsZDIKLSAgICBWQURELkkzMiBkMixkMyxkMQotICAgIFZSU0hSLlUzMiBkMixkMiwjMwotICAg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ICAge2QwLGQxfSxbcjExXSxyNQotICAgIEJORSAgICAgIEwweDhjCi0gICAgTU9WICAgICAgcjAsIzAKLSAgICBWUE9QICAgICB7ZDgtZDE1fQotICAgIFBPUCAgICAgIHtyNC1yMTIscGN9Ci1PTVhfVkNfMTZYMTZfREM6Ci0gICAgTU9WICAgICAgcjExLCMwCi0gICAgVFNUICAgICAgcjcsIzIKLSAgICBCRVEgICAgICBMMHgxNGMKLSAgICBBREQgICAgICByOCxyMCxyNAotICAgIEFERCAgICAgIHIxMCxyNCxyNAotICAgIFZMRDEuOCAgIHtkMlswXX0sW3IwXSxyMTAKLSAgICBWTEQxLjggICB7ZDJbMV19LFtyOF0scjEwCi0gICAgVkxEMS44ICAge2QyWzJdfSxbcjBdLHIxMAotICAgIFZMRDEuOCAgIHtkMlszXX0sW3I4XSxyMTAKLSAgICBWTEQxLjggICB7ZDJbNF19LFtyMF0scjEwCi0gICAgVkxEMS44ICAge2QyWzVdfSxbcjhdLHIxMAotICAgIFZMRDEuOCAgIHtkMls2XX0sW3IwXSxyMTAKLSAgICBWTEQxLjggICB7ZDJbN119LFtyOF0scjEwCi0gICAgVkxEMS44ICAge2QzWzBdfSxbcjBdLHIxMAotICAgIFZMRDEuOCAgIHtkM1sxXX0sW3I4XSxyMTAKLSAgICBWTEQxLjggICB7ZDNbMl19LFtyMF0scjEwCi0gICAgVkxEMS44ICAge2QzWzNdfSxbcjhdLHIxMAotICAgIFZMRDEuOCAgIHtkM1s0XX0sW3IwXSxyMTAKLSAgICBWTEQxLjggICB7ZDNbNV19LFtyOF0scjEwCi0gICAgVkxEMS44ICAge2QzWzZdfSxbcjBdLHIxMAotICAgIFZMRDEuOCAgIHtkM1s3XX0sW3I4XQotICAgIFZQQURETC5VOCBxMCxxMQotICAgIEFERCAgICAgIHIxMSxyMTEsIzEKLSAgICBWUEFERC5JMTYgZDAsZDAsZDEKLSAgICBWUEFEREwuVTE2IGQwLGQwCi0gICAgVlBBRERMLlUzMiBkNixkMAotICA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scjYsTFNMICMyXQotT01YX1ZDXzR4NF9IT1I6Ci0gICAgQUREICAgICAgcjkscjAscjQKLSAgICBBREQgICAgICByMTAscjQscjQKLSAgICBWTEQxLjggICB7ZDBbXX0sW3IwXSxyMTAKLSAgICBWTEQxLjggICB7ZDFbXX0sW3I5XSxyMTAKLSAgICBWTEQxLjggICB7ZDJbXX0sW3IwXQotICAgIFZMRDEuOCAgIHtkM1tdfSxbcjldCi0gICAgQUREICAgICAgcjExLHIzLHI1Ci0gICAgQUREICAgICAgcjEyLHI1LHI1Ci0gICAgVlNUMS4zMiAge2QwWzBdfSxbcjNdLHIxMgotICAgIFZTVDEuMzIgIHtkMVswXX0sW3IxMV0scjEyCi0gICAgVlNUMS4zMiAge2QyWzBdfSxbcjNdCi0gICAgVlNUMS4zMiAge2QzWzBdfSxbcjExXQotICAgIEIgICAgICAgIEwweDM0OAotT01YX1ZDXzR4NF9WRVJUOgotICAgIFZMRDEuMzIgIHtkMFswXX0sW3IxXQotICAgIEFERCAgICAgIHIxMSxyMyxyNQotICAgIEFERCAgICAgIHIxMixyNSxyNQotTDB4NTg6Ci0gICAgVlNUMS4zMiAge2QwWzBdfSxbcjNdLHIxMgotICAgIFZTVDEuMzIgIHtkMFswXX0sW3IxMV0scjEyCi0gICAgVlNUMS4zMiAge2QwWzBdfSxbcjNdCi0gICAgVlNUMS4zMiAge2QwWzBdfSxbcjExXQotICAgIEIgICAgICAgIEwweDM0OAotT01YX1ZDXzR4NF9EQzoKLSAgICBUU1QgICAgICByNywjMgotICAgIEJFUSAgICAgIEwweGRjCi0gICAgQUREICAgICAgcjkscjAscjQKLSAgICBBREQgICAgICByMTAscjQscjQKLSAgICBWTEQxLjggICB7ZDBbMF19LFtyMF0scjEwCi0gICAgVkxEMS44ICAge2QwWzFdfSxbcjldLHIxMAotICAgIFZMRDEuOCAgIHtkMFsyXX0sW3IwXQotICAgIFZMRDEuOCAgIHtkMFszXX0sW3I5XQotICAgIFRTVCAgICAgIHI3LCMxCi0gICAgQkVRICAgICAgTDB4YmMKLSAgICBWTEQxLjMyICB7ZDBbMV19LFtyMV0KLSAgICBNT1YgICAgICByMCwjMAotICAgIFZQQURETC5VOCBkMSxkMAotICAgIFZQQURETC5VMTYgZDEsZDEKLSAgICBWUEFEREwuVTMyIGQxLGQxCi0gICAgVlJTSFIuVTY0IGQxLGQxLCMzCi0gICAgQUREICAgICAgcjExLHIzLHI1Ci0gICAgQUREICAgICAgcjEyLHI1LHI1Ci0gICAgVkRVUC44ICAgZDAsZDFbMF0KLSAgICBCICAgICAgICBMMHg1OAotTDB4YmM6Ci0gICAgTU9WICAgICAgcjAsIzAKLSAgICBWUEFEREwuVTggZDEsZDAKLSAgICBWUEFEREwuVTE2IGQxLGQxCi0gICAgVlJTSFIuVTMyIGQxLGQxLCMyCi0gICAgQUREICAgICAgcjExLHIzLHI1Ci0gICAgQUREICAgICAgcjEyLHI1LHI1Ci0gICAgVkRVUC44ICAgZDAsZDFbMF0KLSAgICBCICAgICAgICBMMHg1OAotTDB4ZGM6Ci0gICAgVFNUICAgICAgcjcsIzEKLSAgICBCRVEgICAgICBMMHgxMDgKLSAgICBWTEQxLjMyICB7ZDBbMF19LFtyMV0KLSAgICBNT1YgICAgICByMCwjMAotICAgIFZQQURETC5VOCBkMSxkMAotICAgIFZQQURETC5VMTYgZDEsZDEKLSAgICBWUlNIUi5VMzIgZDEsZDEsIzIKLSAgICBBREQgICAgICByMTEscjMscjUKLSAgICBBREQgICAgICByMTIscjUscjUKLSAgICBWRFVQLjggICBkMCxkMVswXQotICAgIEIgICAgICAgIEwweDU4Ci1MMHgxMDg6Ci0gICAgVk1PVi5JOCAgZDAsIzB4ODAKLSAgICBNT1YgICAgICByMCwjMAotICAgIEFERCAgICAgIHIxMSxyMyxyNQotICAgIEFERCAgICAgIHIxMixyNSxyNQotICAgIEIgICAgICAgIEwweDU4Ci1PTVhfVkNfNHg0X0RJQUdfREw6Ci0gICAgVFNUICAgICAgcjcsIzB4NDAKLSAgICBC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SxbcjNdCi0gICAgVlNUMS4zMiAge2Q2WzBdfSxbcjExXQotICAgIEIgICAgICAgIEwweDM0OAotT01YX1ZDXzR4NF9WTDoKLSAgICBUU1QgICAgICByNywjMHg0MAotICAgIEJFUSAgICAgIEwweDJiNAotICAgIFZMRDEuOCAgIHtkM30sW3IxXQotICAgIFZFWFQuOCAgIGQ0LGQzLGQzLCMxCi0gICAgVkVYVC44ICAgZDUsZDQsZDQsIzEKLSAgICBCICAgICAgICBMMHgyYzgKLUwweDJiNDoKLSAgICBWTEQxLjMyICB7ZDBbMV19LFtyMV0KLSAgICBWRFVQLjggICBkMixkMFs3XQotICAgIFZFWFQuOCAgIGQzLGQwLGQyLCM0Ci0gICAgVkVYVC44ICAgZDQsZDAsZDIsIzUKLSAgICBWRVhULjggICBkNSxkMCxkMiwjNgotTDB4MmM4OgotICAgIFZSSEFERC5VOCBkNyxkNCxkMwotICAgIFZIQURELlU4IGQxMCxkMyxkNQotICAgIFZSSEFERC5VOCBkMTAsZDEwLGQ0Ci0gICAgVkVYVC44ICAgZDgsZDcsZDcsIzEKLSAgICBBREQgICAgICByMTEscjMscjUKLSAgICBBREQgICAgICByMTIscjUscjUKLSAgICBWRVhULjggICBkOSxkMTAsZDgsIzEKLSAgICBWU1QxLjMyICB7ZDdbMF19LFtyM10scjEyCi0gICAgVlNUMS4zMiAge2QxMFswXX0sW3IxMV0scjEyCi0gICAgVlNUMS4zMiAge2Q4WzBdfSxbcjNdCi0gICAgVlNUMS4zMiAge2Q5WzBdfSxbcjExXQotICAgIEIgICAgICAgIEwweDM0OAotT01YX1ZDXzR4NF9IVToKLSAgICBBREQgICAgICByOSxyMCxyNAotICAgIEFERCAgICAgIHIxMCxyNCxyNAotICAgIFZMRDEuOCAgIHtkMVs0XX0sW3IwXSxyMTAKLSAgICBWTEQxLjggICB7ZDFbNV19LFtyOV0scjEwCi0gICAgVkxEMS44ICAge2QxWzZdfSxbcjBdCi0gICAgVkxEMS44ICAge2QxWzddfSxbcjld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QuIEFsbCBSaWdodHMgUmVzZXJ2ZWQuCi07ICogCi07ICogCi07ICoKLTsgKiBEZXNjcmlwdGlvbjogCi07ICogQ29udGFpbnMgbW9kdWxlIGZvciBDbGlwcGluZyAxNiBiaXQgdmFsdWUgdG8gWzAsMjU1XSBSYW5nZQotOyAqLyAKLQotICAgICAgSU5DTFVERSBvbXh0eXBlc19zLmgKLSAgICAgIElOQ0xVREUgYXJtQ09NTV9zLmgKLSAgICAgIAotCi0gICAgICBNX1ZBUklBTlRTIENvcnRleEE4Ci0KLSAgICAgIElGIENvcnRleEE4Ci07Ly9JbnB1dCBBcmd1bWVudHMKLQotcFNyYyAgICAgICAgICAgICAgICAgUk4gMAotcERzdCAgICAgICAgICAgICAgICAgUk4gMQotc3RlcCAgICAgICAgICAgICAgICAgUk4gMgotCi07Ly8gTmVvbiBSZWdpc3RlcnMKLQotcXgwICAgICAgICAgICAgICAgICAgUU4gIFEwLlMxNiAgICAgICAgICAgICAgICAgIAotZHgwMCAgICAgICAgICAgICAgICAgRE4gIEQwLlMxNgotZHgwMSAgICAgICAgICAgICAgICAgRE4gIEQxLlMxNgotcXgxICAgICAgICAgICAgICAgICAgUU4gIFExLlMxNgotZHgxMCAgICAgICAgICAgICAgICAgRE4gIEQyLlMxNgotZHgxMSAgICAgICAgICAgICAgICAgRE4gIEQzLlMxNgotCi1xeDIgICAgICAgICAgICAgICAgICBRTiAgUTIuUzE2ICAgICAgICAgICAgICAgICAgCi1keDIwICAgICAgICAgICAgICAgICBETiAgRDQuUzE2Ci1keDIxICAgICAgICAgICAgICAgICBETiAgRDUuUzE2Ci1xeDMgICAgICAgICAgICAgICAgICBRTiAgUTMuUzE2Ci1keDMwICAgICAgICAgICAgICAgICBETiAgRDYuUzE2Ci1keDMxICAgICAgICAgICAgICAgICBETiAgRDcuUzE2Ci0KLQotZGNsaXAwICAgICAgICAgICAgICAgRE4gIEQwLlU4Ci1kY2xpcDEgICAgICAgICAgICAgICBETiAgRDIuVTggCi1kY2xpcDIgICAgICAgICAgICAgICBETiAgRDQuVTgKLWRjbGlwMyAgICAgICAgICAgICAgIEROICBENi5VOAotIAotICAgICAgIE1fU1RBUlQgYXJtVkNNNFAyX0NsaXA4Ci0KLSAgICAgICBWTEQxICAgICAgICAgIHtkeDAwLGR4MDEsZHgxMCxkeDExfSxbcFNyY10hICAgICAgICAgIDsvLyBMb2FkIDE2IGVudHJpZXMgZnJvbSBwU3JjCi0gICAgICAgVkxEMSAgICAgICAgICB7ZHgyMCxkeDIxLGR4MzAsZHgzMX0sW3BTcmNdISAgICAgICAgICA7Ly8gTG9hZCBuZXh0IDE2IGVudHJpZXMgZnJvbSBwU3JjICAKLSAgICAgICBWUVNIUlVOICAgICAgIGRjbGlwMCxxeDAsIzAgICAgICAgICAgICAgICAgICAgICAgICAgIDsvLyBkY2xpcDBbaV09Y2xpcCBxeDBbaV0gdG8gWzAsMjU1XQotICAgICAgIFZRU0hSVU4gICAgICAgZGNsaXAxLHF4MSwjMCAgICAgICAgICAgICAgICAgICAgICAgICAgOy8vIGRjbGlwMVtpXT1jbGlwIHF4MVtpXSB0byBbMCwyNTVdCi0gICAgICAgVlNUMSAgICAgICAgICB7ZGNsaXAwfSxbcERzdF0sc3RlcCAgICAgICAgICAgICAgICAgICA7Ly8gc3RvcmUgOCBieXRlcyBhbmQgcERzdD1wRHN0K3N0ZXAKLSAgICAgICBWU1QxICAgICAgICAgIHtkY2xpcDF9LFtwRHN0XSxzdGVwICAgICAgICAgICAgICAgICAgIDsvLyBzdG9yZSA4IGJ5dGVzIGFuZCBwRHN0PXBEc3Qrc3RlcAotICAgICAgIFZRU0hSVU4gICAgICAgZGNsaXAyLHF4MiwjMAotICAgICAgIFZRU0hSVU4gICAgICAgZGNsaXAzLHF4MywjMAotICAgICAgIFZTVDEgICAgICAgICAge2RjbGlwMn0sW3BEc3RdLHN0ZXAKLSAgICAgICBWU1QxICAgICAgICAgIHtkY2xpcDN9LFtwRHN0XSxzdGVwCi0gICAgICAgCi0gICAgICAgVkxEMSAgICAgICAgICB7ZHgwMCxkeDAxLGR4MTAsZHgxMX0sW3BTcmNdISAgICAgICAgICA7Ly8gTG9hZCAxNiBlbnRyaWVzIGZyb20gcFNyYwotICAgICAgIFZMRDEgICAgICAgICAge2R4MjAsZHgyMSxkeDMwLGR4MzF9LFtwU3JjXSEgICAgICAgICAgOy8vIExvYWQgbmV4dCAxNiBlbnRyaWVzIGZyb20gcFNyYyAgCi0gICAgICAgVlFTSFJVTiAgICAgICBkY2xpcDAscXgwLCMwICAgICAgICAgICAgICAgICAgICAgICAgICA7Ly8gZGNsaXAwW2ldPWNsaXAgcXgwW2ldIHRvIFswLDI1NV0KLSAgICAgICBWUVNIUlVOICAgICAgIGRjbGlwMSxxeDEsIzAgICAgICAgICAgICAgICAgICAgICAgICAgIDsvLyBkY2xpcDFbaV09Y2xpcCBxeDFbaV0gdG8gWzAsMjU1XQotICAgICAgIFZTVDEgICAgICAgICAge2RjbGlwMH0sW3BEc3RdLHN0ZXAgICAgICAgICAgICAgICAgICAgOy8vIHN0b3JlIDggYnl0ZXMgYW5kIHBEc3Q9cERzdCtzdGVwCi0gICAgICAgVlNUMSAgICAgICAgICB7ZGNsaXAxfSxbcERzdF0sc3RlcCAgICAgICAgICAgICAgICAgICA7Ly8gc3RvcmUgOCBieXRlcyBhbmQgcERzdD1wRHN0K3N0ZXAKLSAgICAgICBWUVNIUlVOICAgICAgIGRjbGlwMixxeDIsIzAKLSAgICAgICBWUVNIUlVOICAgICAgIGRjbGlwMyxxeDMsIzAKLSAgICAgICBWU1QxICAgICAgICAgIHtkY2xpcDJ9LFtwRHN0XSxzdGVwCi0gICAgICAgVlNUMSAgICAgICAgICB7ZGNsaXAzfSxbcERzdF0sc3RlcAotCi0KLSAgICAgICAKLSAgICAgICAgTV9FTkQKLSAgICAgICAgRU5ESUYKLSAgICAgICAgCi0gICAgIAotICAgICAgICAKLSAgICAgICAgRU5ECmRpZmYgLS1naXQgYS9tZWRpYS9saWJzdGFnZ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otOyAqIERlc2NyaXB0aW9uOgotOyAqIFBlcmZvcm1zIFZMQyBkZWNvZGluZyBhbmQgaW52ZXJzZSB6aWd6YWcgc2NhbiAKLTsgKgotOyAqIAotOyAqCi07ICogCi07ICovCi0KLQotICAgICAgSU5DTFVERSBvbXh0eXBlc19zLmgKLSAgICAgIElOQ0xVREUgYXJtQ09NTV9zLmgKLSAgICAgIElOQ0xVREUgYXJtQ09NTV9CaXREZWNfcy5oCi0KLQotICAgICAgTV9WQVJJQU5UUyBBUk0xMTM2SlMKLQotICAgICAKLQotCi0KLSAgICAgSUYgQVJNMTEzNkpTCi0gICAgIAotICAgICAgICAKLQotCi0KLTsvL0lucHV0IEFyZ3VtZW50cwotCi1wcEJpdFN0cmVhbSAgICAgICAgICBSTiAwCi1wQml0T2Zmc2V0ICAgICAgICAgICBSTiAxCi1wRHN0ICAgICAgICAgICAgICAgICBSTiAyCi1zaG9ydFZpZGVvSGVhZGVyICAgICBSTiAzCi0KLQotOy8vTG9jYWwgVmFyaWFibGVzCi0KLVJldHVybiAgICAgICAgICAgICAgIFJOIDAKLQotcFZsY1RhYmxlTDBMMSAgICAgICAgUk4gNAotcExNQVhUYWJsZUwwTDEgICAgICAgUk4gNAotcFJNQVhUYWJsZUwwTDEgICAgICAgUk4gNAotcFppZ3phZ1RhYmxlICAgICAgICAgUk4gNAotCi1mdHlwZSAgICAgICAgICAgICAgICBSTiAwCi10ZW1wMyAgICAgICAgICAgICAgICBSTiA0Ci10ZW1wICAgICAgICAgICAgICAgICBSTiA1Ci1Db3VudCAgICAgICAgICAgICAgICBSTiA2Ci1Fc2NhcGUgICAgICAgICAgICAgICBSTiA1Ci0KLTsvLyBhcm1WQ000UDJfRmlsbFZMREJ1ZmZlcgotemlnemFnICAgICAgICAgICAgICAgUk4gMAotc3RvcmVMZXZlbCAgICAgICAgICAgUk4gMQotdGVtcDIgICAgICAgICAgICAgICAgUk4gNAotdGVtcDEgICAgICAgICAgICAgICAgUk4gNQotc2lnbiAgICAgICAgICAgICAgICAgUk4gNQotTGFzdCAgICAgICAgICAgICAgICAgUk4gNwotc3RvcmVSdW4gICAgICAgICAgICAgUk4gMTQKLQotCi1wYWNrUmV0SW5kZXggICAgICAgICBSTiA1Ci0KLQotbWFya2VyYml0ICAgICAgICAgICAgUk4gNQotCi07Ly8gU2NyYXRjaCBSZWdpc3RlcnMKLQotUkJpdFN0cmVhbSAgICAgICAgICAgUk4gOAotUkJpdEJ1ZmZlciAgICAgICAgICAgUk4gOQotUkJpdENvdW50ICAgICAgICAgICAgUk4gMTAKLQotVDEgICAgICAgICAgICAgICAgICAgUk4gMTEKLVQyICAgICAgICAgICAgICAgICAgIFJOIDEyCi1MUiAgICAgICAgICAgICAgICAgICBSTiAxNCAgICAgICAgCi0gICAgICAgIAotCi0KLSAgICAgICAgTV9BTExPQzQgICAgICAgIHBwcEJpdFN0cmVhbSw0Ci0gICAgICAgIE1fQUxMT0M0ICAgICAgICBwcE9mZnNldCw0Ci0gICAgICAgIE1fQUxMT0M0ICAgICAgICBwTGlua1JlZ2lzdGVyLDQgICAgICAgCi0gICAgICAgIAotICAgICAgICBNX1NUQVJUIGFybVZDTTRQMl9EZWNvZGVWTENaaWd6YWdfQUNfdW5zYWZlCi0KLSAgICAgICAgOy8vIGdldCB0aGUgdGFibGUgYWRkcmVzc2VzIGZyb20gc3RhY2sgICAgICAgCi0gICAgICAgIE1fQVJHICAgICAgICAgICBwcFZsY1RhYmxlTDBMMSw0Ci0gICAgICAgIE1fQVJHICAgICAgICAgICBwcExNQVhUYWJsZUwwTDEsNAotICAgICAgICBNX0FSRyAgICAgICAgICAgcHBSTUFYVGFibGVMMEwxLDQKLSAgICAgICAgTV9BUkcgICAgICAgICAgIHBwWmlnemFnVGFibGUsNAotICAgICAgICAKLSAgICAgICAgOy8vIFN0b3JlIEFMTCB6ZXJvcyBhdCBwRHN0Ci0gICAgICAgIAotICAgICAgICBNT1YgICAgICAgICAgICAgdGVtcDEsIzAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOy8vIEluaXRpYWxpemUgQ291bnQgdG8gemVybyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCi0gICAgICAgIE1PViAgICAgICAgICAgICBMYXN0LCMwCi0gICAgICAgIE1fU1RSICAgICAgICAgICBMUixwTGlua1JlZ2lzdGVyICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA7Ly8gU3RvcmUgTGluayBSZWdpc3RlciBvbiBTdGFjawotICAgICAgICBNT1YgICAgICAgICAgICAgdGVtcDIsIzAKLSAgICAgICAgTU9WICAgICAgICAgICAgIExSLCMwICAgICAgICAgIAotICAgICAgICAKLSAgICAgICAgOy8vIEluaXRpYWxpemUgdGhlIE1hY3JvIGFuZCBTdG9yZSBhbGwgemVyb3MgdG8gcERzdCAKLSAgCi0gICAgICAgIFNUTSAgICAgICAgICAgICBwRHN0ISx7dGVtcDIsdGVtcDEsTGFzdCxMUn0gICAgICAgICAgICAgICAgICAgCi0gICAgICAgIE1fQkRfSU5JVDAgICAgICBwcEJpdFN0cmVhbSwgcEJpdE9mZnNldCwgUkJpdFN0cmVhbSwgUkJpdEJ1ZmZlciwgUkJpdENvdW50ICAKLSAgICAgICAgU1RNICAgICAgICAgICAgIHBEc3QhLHt0ZW1wMix0ZW1wMSxMYXN0LExSfQotICAgICAgICBNX0JEX0lOSVQxICAgICAgVDEsIFQyLCBUMgotICAgICAgICBTVE0gICAgICAgICAgICAgcERzdCEse3RlbXAyLHRlbXAxLExhc3QsTFJ9Ci0gICAgICAgIE1fQkRfSU5JVDIgICAgICBUMSwgVDIsIFQyCi0gICAgICAgIFNUTSAgICAgICAgICAgICBwRHN0ISx7dGVtcDIsdGVtcDEsTGFzdCxMUn0KLSAgICAgICAgTV9TVFIgICAgICAgICAgIHBwQml0U3RyZWFtLHBwcEJpdFN0cmVhbSAgICAgICAgICAgICAgICAgICAgICAgIDsvLyBTdG9yZSBwcEJpdHN0cmVhbSBvbiBzdGFjayAgICAgICAgICAgICAgICAgICAgICAgICAKLSAgICAgICAgU1RNICAgICAgICAgICAgIHBEc3QhLHt0ZW1wMix0ZW1wMSxMYXN0LExSfQotICAgICAgICBNX1NUUiAgICAgICAgICAgcEJpdE9mZnNldCxwcE9mZnNldCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOy8vIFN0b3JlIHBCaXRPZmZzZXQgb24gc3RhY2sKLSAgICAgICAgU1RNICAgICAgICAgICAgIHBEc3QhLHt0ZW1wMix0ZW1wMSxMYXN0LExSfQotICAgICAgICAKLSAgICAgICAgU1RNICAgICAgICAgICAgIHBEc3QhLHt0ZW1wMix0ZW1wMSxMYXN0LExSfQotICAgICAgICBTVE0gICAgICAgICAgICAgcERzdCEse3RlbXAyLHRlbXAxLExhc3QsTFJ9Ci0gCi0gICAgICAgIAotICAgICAgICBTVUIgICAgICAgICAgICAgcERzdCxwRHN0LCMxMjggICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOy8vIFJlc3RvcmUgcERzdAotCi0gICAgICAgIDsvLyBUaGUgYXJtVkNNNFAyX0dldFZMQ0JpdHMgYmVnaW5zCi0KLWdldFZMQ2JpdHMKLSAgICAgICAgCi0gICAgICAgIE1fQkRfTE9PSzggICAgICBFc2NhcGUsNyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA7Ly8gTG9hZCBFc2NhcGUgVmFsdWUKLSAgICAgICAgTFNSICAgICAgICAgICAgIEVzY2FwZSxFc2NhcGUsIzI1ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKLSAgICAgICAgQ01QICAgICAgICAgICAgIEVzY2FwZSwjMyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDsvLyBjaGVjayBmb3IgZXNjYXBlIG1vZGUKLSAgICAgICAgTU9WTkUgICAgICAgICAgIGZ0eXBlLCMwCi0gICAgICAgIEJORSAgICAgICAgICAgICBub3RFc2NhcGVtb2RlICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA7Ly8gQnJhbmNoIGlmIG5vdCBpbiBFc2NhcGUgbW9kZSAzCi0KLSAgICAgICAgTV9CRF9WU0tJUDggICAgICM3LFQxCi0gICAgICAgIENNUCAgICAgICAgICAgICBzaG9ydFZpZGVvSGVhZGVyLCMwICAgICAgICAgICAgICAgICAgICAgICAgICAgICA7Ly8gQ2hlY2sgc2hvcnRWaWRlb0hlYWRlciBmbGFnIHRvIGtub3cgdGhlIHR5cGUgb2YgRXNjYXBlIG1vZGUKLSAgICAgICAgQkVRICAgICAgICAgICAgIGVuZEZpbGxWTEQgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKLSAgICAgICAgCi0gICAgICAgIDsvLyBFc2NhcGUgTW9kZSA0Ci0KLSAgICAgICAgTV9CRF9SRUFEOCAgICAgIExhc3QsMSxUMQotICAgICAgICBNX0JEX1JFQUQ4ICAgICAgc3RvcmVSdW4sNixUMQotICAgICAgICBNX0JEX1JFQUQ4ICAgICAgc3RvcmVMZXZlbCw4LFQxCi0KLSAgICAgICAgICAgCi0gICAgICAgIDsvLyBDaGVjayB3aGV0aGVyIHRoZSBSZXNlcnZlZCB2YWx1ZXMgZm9yIExldmVsIGFyZSB1c2VkIGFuZCBFeGl0IHdpdGggYW4gRXJyb3IgTWVzc2FnZSBpZiBpdCBpcyBzbwotCi0gICAgICAgIFRFUSAgICAgICAgICAgICBzdG9yZUxldmVsLCMwCi0gICAgICAgIFRFUU5FICAgICAgICAgICBzdG9yZUxldmVsLCMxMjggICAgICAgICAgICAgICAgICAgIAotICAgICAgICBCRVEgICAgICAgICAgICAgRXhpdEVycm9yCi0KLSAgICAgICAgQUREICAgICAgICAgICAgIHRlbXAyLHN0b3JlUnVuLENvdW50Ci0gICAgICAgIENNUCAgICAgICAgICAgICB0ZW1wMiwjNjQKLSAgICAgICAgQkdFICAgICAgICAgICAgIEV4aXRFcnJvciAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDsvLyBlcnJvciBpZiBDb3VudCtzdG9yZVJ1biA+PSA2NAotICAgICAgICAKLSAgICAgICAgCi0gICAgICAgIDsvLyBMb2FkIGFkZHJlc3Mgb2YgemlnemFnVGFibGUKLSAgICAgICAgCi0gICAgICAgIE1fTERSICAgICAgICAgICBwWmlnemFnVGFibGUscHBaaWd6YWdUYWJsZSAgICAgICAgICAgICAgICAgICAgICA7Ly8gTG9hZGluZyB0aGUgQWRkcmVzcyBvZiBaaWd6YWcgdGFibGUKLSAgICAgICAgICAgICAgIAotICAgICAgICAgICAgICAgIAotICAgICAgICA7Ly8gYXJtVkNNNFAyX0ZpbGxWTERCdWZmZXIKLSAgICAgICAgICAgICAgICAKLSAgICAgICAgU1hUQiAgICAgICAgICAgIHN0b3JlTGV2ZWwsc3RvcmVMZXZlbCAgICAgICAgICAgICAgICAgICAgICAgICAgIDsvLyBTaWduIEV4dGVuZCBzdG9yZUxldmVsIHRvIDMyIGJpdHMKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAotICAgICAgICAKLSAgICAgICAgOy8vIFRvIFJlZmxlY3QgUnVubGVuZ3RoCi0KLSAgICAgICAgQUREICAgICAgICAgICAgIENvdW50LENvdW50LHN0b3JlUnVuCi0gICAgICAgIExEUkIgICAgICAgICAgICB6aWd6YWcsW3BaaWd6YWdUYWJsZSxDb3VudF0KLSAgICAgICAgQUREICAgICAgICAgICAgIENvdW50LENvdW50LCMxCi0gICAgICAgIFNUUkggICAgICAgICAgICBzdG9yZUxldmVsLFtwRHN0LHppZ3phZ10gICAgICAgICAgICAgICAgICAgICAgICA7Ly8gc3RvcmUgTGV2ZWwKLSAgICAgICAgICAgICAgCi0gICAgICAgIEIgICAgICAgICAgICAgICBFeGl0T2sKLSAgICAgICAKLSAgICAgICAgCi0KLWVuZEZpbGxWTEQKLSAgICAgICAgCi0gICAgICAgICAgICAgICAKLSAgICAgICAgOy8vIExvYWQgRnR5cGUoIEVzY2FwZSBNb2RlKSB2YWx1ZSBiYXNlZCBvbiB0aGUgdHdvIHN1Y2Nlc3NpdmUgYml0cyBpbiB0aGUgYml0c3RyZWFtCi0gICAgIAotICAgICAgICBNX0JEX1JFQUQ4ICAgICAgdGVtcDEsMSxUMSAgICAgICAgICAgCi0gICAgICAgIENNUCAgICAgICAgICAgICB0ZW1wMSwjMCAgICAKLSAgICAgICAgTU9WRVEgICAgICAgICAgIGZ0eXBlLCMxCi0gICAgICAgIEJFUSAgICAgICAgICAgICBub3RFc2NhcGVtb2RlCi0gICAgICAgIE1fQkRfUkVBRDggICAgICB0ZW1wMSwxLFQxCi0gICAgICAgIENNUCAgICAgICAgICAgICB0ZW1wMSwjMQotICAgICAgICBNT1ZFUSAgICAgICAgICAgZnR5cGUsIzMKLSAgICAgICAgTU9WTkUgICAgICAgICAgIGZ0eXBlLCMyCi0gICAgICAgIAotCi1ub3RFc2NhcGVtb2RlCi0KLSAgICAgICAgOy8vIExvYWQgb3B0aW1pemVkIHBhY2tlZCBWTEMgdGFibGUgd2l0aCBsYXN0PTAgYW5kIExhc3Q9MQotICAgICAgICAKLSAgICAgICAgTV9MRFIgICAgICAgICAgIHBWbGNUYWJsZUwwTDEscHBWbGNUYWJsZUwwTDEgICAgICAgICAgICAgICAgICAgIDsvLyBMb2FkIENvbWJpbmVkIFZMQyBUYWJsZQotICAgICAgICAgICAgICAgIAotICAgICAgIAotICAgICAgICBDTVAgICAgICAgICAgICAgZnR5cGUsIzMgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOy8vIElmIGZ0eXBlID49MyBnZXQgcGVyZm9ybSBGaXhlZCBMZW5ndGggRGVjb2RpbmcgKEVzY2FwZSBNb2RlIDMpCi0gICAgICAgIEJHRSAgICAgICAgICAgICBFc2NhcGVNb2RlMyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA7Ly8gRWxzZSBjb250aW51ZSBub3JtYWwgVkxDIERlY29kaW5nCi0gICAgICAgIAotICAgICAgICA7Ly8gVmFyaWFibGUgbGVuZ2ggZGVjb2RpbmcsICJhcm1VblBhY2tWTEMzMiIgCi0gICAgICAgIAotICAgICAgICAKLSAgICAgICAgTV9CRF9WTEQgICAgICAgIHBhY2tSZXRJbmRleCxUMSxUMixwVmxjVGFibGVMMEwxLDQsMgotICAgICAgICAKLSAgICAgICAgCi0gICAgICAgIExEUiAgICAgICAgICAgICB0ZW1wMyw9MHhGRkYKLSAgICAgICAgCi0gICAgICAgIENNUCAgICAgICAgICAgICBwYWNrUmV0SW5kZXgsdGVtcDMgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA7Ly8gQ2hlY2sgZm9yIGludmFsaWQgc3ltYm9sCi0gICAgICAgIEJFUSAgICAgICAgICAgICBFeGl0RXJyb3IgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA7Ly8gaWYgaW52YWxpZCBzeW1ib2wgb2NjdXJzIGV4aXQgd2l0aCBhbiBlcnJvciBtZXNzYWdlCi0gICAgICAgIAotICAgICAgICBBTkQgICAgICAgICAgICAgTGFzdCxwYWNrUmV0SW5kZXgsIzIgICAgICAgICAgICAgICAgICAgICAgICAgICAgOy8vIEdldCBMYXN0IGZyb20gcGFja2VkIEluZGV4Ci0gICAgICAgICAgICAgIAotICAgICAgICAgCi0gICAgICAgIAotCi0gICAgICAgIExTUiAgICAgICAgICAgICBzdG9yZVJ1bixwYWNrUmV0SW5kZXgsIzcgICAgICAgICAgICAgICAgICAgICAgICA7Ly8gR2V0IFJ1biBWYWx1ZSBmcm9tIFBhY2tlZCBpbmRleAotICAgICAgICBBTkQgICAgICAgICAgICAgc3RvcmVMZXZlbCxwYWNrUmV0SW5kZXgsIzB4N2MgICAgICAgICAgICAgICAgICAgOy8vIHN0b3JlTGV2ZWw9cGFja1JldEluZGV4WzItNl0sc3RvcmVMZXZlbFswLTFdPTAgCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKLSAgICAgCi0gICAgICAgIE1fTERSICAgICAgICAgICBwTE1BWFRhYmxlTDBMMSxwcExNQVhUYWJsZUwwTDEgICAgICAgICAgICAgICAgICA7Ly8gTG9hZCBMTUFYIHRhYmxlCi0gICAgICAgICAgICAgIAotICAgICAgIAotICAgICAgICBMU1IgICAgICAgICAgICAgc3RvcmVMZXZlbCxzdG9yZUxldmVsLCMyICAgICAgICAgICAgICAgICAgICAgICAgOy8vIExldmVsIHZhbHVlCi0KLSAgICAgICAgQ01QICAgICAgICAgICAgIGZ0eXBlLCMxICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCi0gICAgICAgIEJORSAgICAgICAgICAgICBmdHlwZTIKLSAgICAgICAgCi0gICAgICAgIDsvLyBmdHlwZT09MTsgRXNjYXBlIG1vZGUgPTEKLSAgICAgICAgICAKLSAgICAgICAgCi0gICAgICAgIEFERCAgICAgICAgICAgIHRlbXAxLCBwTE1BWFRhYmxlTDBMMSwgTGFzdCwgTFNMIzQgICAgICAgICAgICAgIDsvLyBJZiB0aGUgTGFzdD0xIGFkZCAzMiB0byB0YWJsZSBhZGRyZXNzCi0gICAgICAgIExEUkIgICAgICAgICAgICB0ZW1wMSxbdGVtcDEsc3RvcmVSdW5dCi0KLSAgICAgICAKLSAgICAgICAgQUREICAgICAgICAgICAgIHN0b3JlTGV2ZWwsdGVtcDEsc3RvcmVMZXZlbCAgICAgICAgICAgICAgICAgICAgIAotCi1mdHlwZTIKLQotICAgICAgICA7Ly8gZnR5cGUgPTI7IEVzY2FwZSBtb2RlID0yCi0gICAgICAgIAotICAgICAgICBNX0xEUiAgICAgICAgICAgcFJNQVhUYWJsZUwwTDEscHBSTUFYVGFibGVMMEwxICAgICAgICAgICAgICAgICAgOy8vIExvYWQgUk1BWCBUYWJsZSAKLSAgICAgICAgICAgICAgICAKLSAgICAgICAgQ01QICAgICAgICAgICAgIGZ0eXBlLCMyCi0gICAgICAgIEJORSAgICAgICAgICAgICBGaWxsVkxETDEKLSAgICAgICAgICAgICAgICAgIAotICAgICAgICBBREQgICAgICAgICAgICB0ZW1wMSwgcFJNQVhUYWJsZUwwTDEsIExhc3QsIExTTCM0ICAgICAgICAgICAgICAgOy8vIElmIExhc3Q9MSBhZGQgMzIgdG8gdGFibGUgYWRkcmVzcwotICAgICAgICBTVUIgICAgICAgICAgICAgdGVtcDIsc3RvcmVMZXZlbCwjMQotICAgICAgICBMRFJCICAgICAgICAgICAgdGVtcDEsW3RlbXAxLHRlbXAyXQotCi0gICAgICAgCi0gICAgICAgIEFERCAgICAgICAgICAgICBzdG9yZVJ1bixzdG9yZVJ1biwjMQotICAgICAgICBBREQgICAgICAgICAgICAgc3RvcmVSdW4sdGVtcDEKLSAgICAgICAgCi1GaWxsVkxETDEgICAgICAgIAotICAgICAgICAgICAgCi0gICAgICAgICAgICAgICAgCi0gICAgICAgIDsvLyBhcm1WQ000UDJfRmlsbFZMREJ1ZmZlcgotCi0gICAgICAgIE1fTERSICAgICAgICAgICBwWmlnemFnVGFibGUscHBaaWd6YWdUYWJsZSAgICAgICAgICAgICAgICAgICAgIDsvLyBMb2FkIGFkZHJlc3Mgb2YgemlnemFnVGFibGUgCi0gICAgICAgICAgICAgICAgCi0gICAgICAgIE1fQkRfUkVBRDggICAgICBzaWduLDEsVDEKLQotICAgICAgICBDTVAgICAgICAgICAgICAgc2lnbiwjMQotICAgICAgICBSU0JFUSAgICAgICAgICAgc3RvcmVMZXZlbCxzdG9yZUxldmVsLCMwCi0gCi0gICAgICAgIEFERCAgICAgICAgICAgICB0ZW1wMSxzdG9yZVJ1bixDb3VudCAgICAgICAgICAgICAgICAgICAgICAgICAgIDsvLyBFeGl0IHdpdGggYW4gZXJyb3IgbWVzc2FnZSBpZiBSdW4gKyBDb3VudCBleGNlZWRzIDYzCi0gICAgICAgIENNUCAgICAgICAgICAgICB0ZW1wMSwjNjQKLSAgICAgICAgQkdFICAgICAgICAgICAgIEV4aXRFcnJvcgotCi0gICAgICAKLSAgICAgICAgCi0gICAgICAgIAotICAgICAgICAgICAgICAKLSAgICAgICAgCi0gICAgICAgIDsvLyBUbyBSZWZsZWN0IFJ1bmxlbmdodAotCi0gICAgICAgIEFERCAgICAgICAgICAgICBDb3VudCxDb3VudCxzdG9yZVJ1bgotIAotc3RvcmVMZXZlbEwxCi0gICAgICAgIAotICAgICAgICBMRFJCICAgICAgICAgICAgemlnemFnLFtwWmlnemFnVGFibGUsQ291bnRdCi0gICAgICAgIENNUCAgICAgICAgICAgICBMYXN0LCMyICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA7Ly8gQ2hlY2sgaWYgdGhlIExldmVsIHZhbCBpcyBMYXN0IG5vbiB6ZXJvIHZhbAotICAgICAgICBBREQgICAgICAgICAgICAgQ291bnQsQ291bnQsIzEKLSAgICAgICAgTFNSICAgICAgICAgICAgIExhc3QsTGFzdCwjMQotICAgICAgICBTVFJIICAgICAgICAgICAgc3RvcmVMZXZlbCxbcERzdCx6aWd6YWddICAgICAgICAgICAgICAgICAgCi0gICAgICAgICAgIAotICAgICAgICBCTkUgICAgICAgICAgICAgZW5kCi0gICAgICAgIAotICAgICAgICBCICAgICAgICAgICAgICAgRXhpdE9rCi0gCi0KLQotICAgICAgICA7Ly8gRml4ZWQgTGVuZ2ggRGVjb2RpbmcgRXNjYXBlIE1vZGUgMwotCi1Fc2NhcGVNb2RlMwotCi0gICAgICAgIE1fQkRfUkVBRDggICAgICBMYXN0LDEsVDEKLSAgICAgICAgTV9CRF9SRUFEOCAgICAgIHN0b3JlUnVuLDYsVDEKLSAgICAgICAgCi0gICAgICAgIEFERCAgICAgICAgICAgICB0ZW1wMixzdG9yZVJ1bixDb3VudCAgICAgICAgICAgICAgICAgICAgICAgICAgICA7Ly8gRXhpdCB3aXRoIGFuIGVycm9yIG1lc3NhZ2UgaWYgUnVuICsgQ291bnQgZXhjZWVkcyA2MwotICAgICAgICBDTVAgICAgICAgICAgICAgdGVtcDIsIzY0Ci0gICAgICAgIEJHRSAgICAgICAgICAgICBFeGl0RXJyb3IKLQotICAgICAgICBNX0JEX1JFQUQ4ICAgICAgbWFya2VyYml0LDEsVDEKLSAgICAgICAgVEVRICAgICAgICAgICAgIG1hcmtlcmJpdCwjMCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDsvLyBFeGl0IHdpdGggYW4gZXJyb3IgbWVzc2FnZSBpZiBtYXJrZXIgYml0IGlzIHplcm8KLSAgICAgICAgQkVRICAgICAgICAgICAgIEV4aXRFcnJvcgotICAgICAgICAKLSAgICAgICAgTV9CRF9SRUFEMTYgICAgIHN0b3JlTGV2ZWwsMTIsVDEKLQotICAgICAgICBUU1QgICAgICAgICAgICAgc3RvcmVMZXZlbCwjMHg4MDAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOy8vIHRlc3QgaWYgdGhlIGxldmVsIGlzIG5lZ2F0aXZlCi0gICAgICAgIFNVQk5FICAgICAgICAgICBzdG9yZUxldmVsLHN0b3JlTGV2ZWwsIzQwOTYKLSAgICAgICAgQ01QICAgICAgICAgICAgIHN0b3JlTGV2ZWwsIzAKLSAgICAgICAgQ01QTkUgICAgICAgICAgIHN0b3JlTGV2ZWwsIy0yMDQ4Ci0gICAgICAgIEJFUSAgICAgICAgICAgICBFeGl0RXJyb3IgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA7Ly8gRXhpdCB3aXRoIGFuIGVycm9yIG1lc3NhZ2UgaWYgTGV2ZWw9PTAgb3IgIC0yMDQ4IAotCi0gICAgICAgIE1fTERSICAgICAgICAgICBwWmlnemFnVGFibGUscHBaaWd6YWdUYWJsZSAgICAgICAgICAgICAgICAgICAgICA7Ly8gTG9hZCBhZGRyZXNzIG9mIHppZ3phZ1RhYmxlCi0gICAgICAgICAgICAgIAotICAgICAgICBNX0JEX1JFQUQ4ICAgICAgbWFya2VyYml0LDEsVDEKLSAgICAgICAgICAgCi0KLSAgICAgICAgOy8vIGFybVZDTTRQMl9GaWxsVkxEQnVmZmVyICggU2lnbiBub3QgdXNlZCBhcyBzdG9yZUxldmVsIGlzIHByZXByb2Nlc3NlZCkKLSAgICAgICAgICAgIAotICAgICAgICAgICAgICAgCi0KLSAgICAgICAgOy8vIFRvIFJlZmxlY3QgUnVuIExlbmd0aAotCi0gICAgICAgIEFERCAgICAgICAgICAgICBDb3VudCxDb3VudCxzdG9yZVJ1bgotCi0KLSAKLXN0b3JlTGV2ZWxMYXN0Ci0gICAgICAgIAotICAgICAgICBMRFJCICAgICAgICAgICAgemlnemFnLFtwWmlnemFnVGFibGUsQ291bnRdCi0gICAgICAgIENNUCAgICAgICAgICAgICBMYXN0LCMxCi0gICAgICAgIEFERCAgICAgICAgICAgICBDb3VudCxDb3VudCwjMQotICAgICAgICBTVFJIICAgICAgICAgICAgc3RvcmVMZXZlbCxbcERzdCx6aWd6YWddICAgICAgICAgICAgICAgICAgICAgICAgICAKLSAgICAgICAgICAgICAgICAKLSAgICAgICAgQk5FICAgICAgICAgICAgIGVuZCAKLSAgICAgIAotICAgICAgICBCICAgICAgICAgICAgICAgRXhpdE9rCi0gICAgICAgIAotZW5kCi0KLSAgICAgICAgQ01QICAgICAgICAgICAgIENvdW50LCM2NCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDsvL1J1biB0aGUgTG9vcCB1bnRpbGwgQ291bnQgcmVhY2hlcyA2NAotCi0gICAgICAgIEJMVCAgICAgICAgICAgICBnZXRWTENiaXRzCi0KLSAgICAgICAgCi1FeGl0T2sKLSAgICAgICAgOy8vIEV4aXQgV2hlbiBWTEMgRGVjb2RpbmcgaXMgZG9uZSBTdWNjZXNzZnVsbHkgCi0gICAKLSAgICAgICAgOy8vIExvYWRpbmcgcHBCaXRTdHJlYW0gYW5kIHBCaXRPZmZzZXQgZnJvbSBzdGFjawotICAgICAgICAKLSAgICAgICAgQ01QICAgICAgICAgICAgIExhc3QsIzEKLSAgICAgICAgTV9MRFIgICAgICAgICAgIHBwQml0U3RyZWFtLHBwcEJpdFN0cmVhbQotICAgICAgICBNX0xEUiAgICAgICAgICAgcEJpdE9mZnNldCxwcE9mZnNldAotCi0gICAgICAgIDsvL0VuZGluZyB0aGUgbWFjcm8KLQotICAgICAgICBNX0JEX0ZJTkkgICAgICAgcHBCaXRTdHJlYW0scEJpdE9mZnNldAotICAgICAgICAgICAgIAotICAgICAgICBNT1ZFUSAgICAgICAgICAgUmV0dXJuLCNPTVhfU3RzX05vRXJyCi0gICAgICAgIE1PVk5FICAgICAgICAgICBSZXR1cm4sI09NWF9TdHNfRXJyCi0gICAgICAgIE1fTERSICAgICAgICAgICBMUixwTGlua1JlZ2lzdGVyICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDsvLyBMb2FkIHRoZSBMaW5rIFJlZ2lzdGVyIEJhY2sKLSAgICAgICAgQiAgICAgICAgICAgICAgIGV4aXQyCi0KLUV4aXRFcnJvcgotICAgICAgICA7Ly8gRXhpdCBXaGVuIGFuIEVycm9yIG9jY3VycyAKLQotICAgICAgICBNX0xEUiAgICAgICAgICAgcHBCaXRTdHJlYW0scHBwQml0U3RyZWFtCi0gICAgICAgIE1fTERSICAgICAgICAgICBwQml0T2Zmc2V0LHBwT2Zmc2V0Ci0gICAgICAgIDsvL0VuZGluZyB0aGUgbWFjcm8KLQotICAgICAgICBNX0JEX0ZJTkkgICAgICAgcHBCaXRTdHJlYW0scEJpdE9mZnNldAotICAgICAgICBNX0xEUiAgICAgICAgICAgTFIscExpbmtSZWdpc3RlcgotICAgICAgICBNT1YgICAgICAgICAgICAgUmV0dXJuLCNPTVhfU3RzX0VycgotCi1leGl0MgotICAgICAgIAotCi0gICAgICAgIE1fRU5ECi0gICAgICAgIEVORElGCi0gICAgICAgIAotICAgICAgICBFTkQKZGlmZiAtLWdpdCBhL21lZGlhL2xpYnN0YWdlZnJpZ2h0L2NvZGVjcy9vbjIvaDI2NGRlYy9vbXhkbC9hcm1fbmVvbi92Yy9tNHAyL3NyYy9hcm1WQ000UDJfSHVmZl9UYWJsZXNf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ZXNlcnZlZC4KLSAqIAotICogCi0gKgotICogRmlsZTogICAgICAgIGFybVZDTTRQMl9Mb29rdXBfVGFibGVzLmMKLSAqIERlc2NyaXB0aW9uOiBDb250YWlucyBhbGwgdGhlIExvb2t1cCB0YWJsZXMgdXNlZCBpbiBNUEVHNCBjb2RlYwotICoKLSAqLwotCi0jaW5jbHVkZSAib214dHlwZXMuaCIKLSNpbmNsdWRlICJhcm1PTVguaCIKLQotICAgIC8qICogVGFibGUgRW50cmllcyBjb250YWluIERjIFNjYWxlciB2YWx1ZXMKLSAgICAgICAqIGFybVZDTTRQMl9EQ1NjYWxlcltpXT0gOCAgICAgICAgICAgZm9yIGk9MSAgdG8gIDQgYW5kIGk9MzMgdG8gMzYKLSAgICAgICAqICAgICAgICAgICAgICAgICAgICAgID0gMippICAgICAgICAgZm9yIGk9NSAgdG8gIDgKLSAgICAgICAqICAgICAgICAgICAgICAgICAgICAgID0gaSs4ICAgICAgICAgZm9yIGk9OSAgdG8gIDI1Ci0gICAgICAgKiAgICAgICAgICAgICAgICAgICAgICA9IDIqaS0xNiAgICAgIGZvciBpPTI2IHRvICAzMQotICAgICAgICogICAgICAgICAgICAgICAgICAgICAgPSAoaS0zMisxMykvMiBmb3IgaT0zNyB0byAgNTkKLSAgICAgICAqICAgICAgICAgICAgICAgICAgICAgID0gaS02LTMyICAgICAgZm9yIGk9NjAgdG8gIDYzCi0gICAgICAgKiAgICAgICAgICAgICAgICAgICAgICA9IDI1NSAgICAgICAgIGZvciBpPTAgYW5kIGk9MzIKLSAgICAgICAqLwotICAgICAgIAotY29uc3QgT01YX1U4IGFybVZDTTRQMl9EQ1NjYWxlcls2NF09ewotCTB4ZmYsIDB4OCwgIDB4OCwgIDB4OCwgIDB4OCwgIDB4YSwgIDB4YywgIDB4ZSwgIAotICAgIDB4MTAsIDB4MTEsIDB4MTIsIDB4MTMsIDB4MTQsIDB4MTUsIDB4MTYsIDB4MTcsIAotICAgIDB4MTgsIDB4MTksIDB4MWEsIDB4MWIsIDB4MWMsIDB4MWQsIDB4MWUsIDB4MWYsCi0gICAgMHgyMCwgMHgyMiwgMHgyNCwgMHgyNiwgMHgyOCwgMHgyYSwgMHgyYywgMHgyZSwKLSAgICAweGZmLCAweDgsICAweDgsICAweDgsICAweDgsICAweDksICAweDksICAweGEsICAKLSAgICAweGEsICAweGIsICAweGIsICAweGMsICAweGMsICAweGQsICAweGQsICAweGUsICAKLSAgICAweGUsICAweGYsICAweGYsICAweDEwLCAweDEwLCAweDExLCAweDExLCAweDEyLCAKLSAgICAweDEyLCAweDEzLCAweDE0LCAweDE1LCAweDE2LCAweDE3LCAweDE4LCAweDE5LAotCi19OwotCi0gICAgICAgICAgICAgIAotICAgICAvKiAgVGFibGUgRW50cmllcyBDb250YWluIHJlY2lwcm9jYWwgb2YgMSB0byA2MwotICAgICAgKiAgYXJtVkNNNFAyX1JlY2lwcm9jYWxfUVBfUzE2W2ldPXJvdW5kKDMyNzY3L2kpCi0gICAgICAqICBhcm1WQ000UDJfUmVjaXByb2NhbF9RUF9TMTZbMF09IDAKLSAgICAgICovCi0KLWNvbnN0IE9NWF9TMTYgYXJtVkNNNFAyX1JlY2lwcm9jYWxfUVBfUzE2WzY0XT17Ci0JMHgwMDAwLDB4N2ZmZiwweDQwMDAsMHgyYWFhLDB4MjAwMCwweDE5OTksMHgxNTU1LDB4MTI0OSwKLSAgICAweDEwMDAsMHgwZTM5LDB4MGNjZCwweDBiYTMsMHgwYWFiLDB4MDlkOSwweDA5MjUsMHgwODg4LAotICAgIDB4MDgwMCwweDA3ODcsMHgwNzFjLDB4MDZiZCwweDA2NjYsMHgwNjE4LDB4MDVkMSwweDA1OTEsCi0gICAgMHgwNTU1LDB4MDUxZiwweDA0ZWMsMHgwNGJlLDB4MDQ5MiwweDA0NmEsMHgwNDQ0LDB4MDQyMSwKLSAgICAweDA0MDAsMHgwM2UxLDB4MDNjNCwweDAzYTgsMHgwMzhlLDB4MDM3NiwweDAzNWUsMHgwMzQ4LAotICAg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Z0ICAgICAgICBSTiA2ICAKLWJsb2NrRENUb3AgICAgICAgICBSTiA3Ci1ibG9ja0RDVG9wTGVmdCAgICAgUk4gOAotdGVtcDEgICAgICAgICAgICAgIFJOIDkKLXRlbXAyICAgICAgICAgICAgICBSTiAxNAotCi0gICAgICAgTV9TVEFSVCAgICBhcm1WQ000UDJfU2V0UHJlZERpcixyOQotCi0gICAgICAgTV9BUkcgICAgICAgcHByZWRRUCw0Ci0gICAgICAgTV9BUkcgICAgICAgcHBRcEJ1Ziw0Ci0gICAgCi0gICAgICAgTERSSCAgICAgICAgYmxvY2tEQ1RvcExlZnQsW3BDb2VmQnVmUm93LCMtMTZdCi0gICAgICAgTERSSCAgICAgICAgYmxvY2tEQ0xlZnQsW3BDb2VmQnVmQ29sXQotICAgICAgIAotICAgICAgIFRFUSAgICAgICAgIEJsb2NrSW5kZXgsIzMKLSAgICAgICBMRFJFUUggICAgICBibG9ja0RDVG9wLFtwQ29lZkJ1ZkNvbCwjLTE2XQotICAgICAgIExEUk5FSCAgICAgIGJsb2NrRENUb3AsW3BDb2VmQnVmUm93XQotICAgICAgICAgICAgIAotICAgICAgIFNVQlMgICAgICAgIHRlbXAxLGJsb2NrRENMZWZ0LGJsb2NrRENUb3BMZWZ0Ci0gICAgICAgUlNCTFQgICAgICAgdGVtcDEsdGVtcDEsIzAKLSAgICAgICBTVUJTICAgICAgICB0ZW1wMixibG9ja0RDVG9wTGVmdCxibG9ja0RDVG9wCi0gICAgICAgUlNCTFQgICAgICAgdGVtcDIsdGVtcDIsIzAKLSAgICAgIAotICAgICAgIE1fTERSICAgICAgIHBRcEJ1ZixwcFFwQnVmCi0gICAgICAgTV9MRFIgICAgICAgcHJlZFFQLHBwcmVkUVAKLSAgICAgICBDTVAgICAgICAgICB0ZW1wMSx0ZW1wMgotICAgICAgIE1PViAgICAgICAgIHRlbXAyLCNPTVhfVkNfVkVSVElDQUwKLSAgICAgICBMRFJMVEIgICAgICB0ZW1wMSxbcFFwQnVmLCM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c2hvcnRWaWRlb0hlYWRlciwKLSAgICAgICAgICAgIHZpZGVvQ29tcCk7Ci0gICAgICAgIGFybVJldERhdGFFcnJJZigoZXJyb3JDb2RlICE9IE9NWF9TdHNfTm9FcnIpLCBlcnJvckNvZGUpOwotICAgIH0KLSAgICBlbHNlCi0gICAgewotICAgICAgICBlcnJvckNvZGUgPSBvbXhWQ000UDJfRGVjb2RlVkxDWmlnemFnX0ludHJhQUNWTEMoCi0gICAgICAgICAgICBwcEJpdFN0cmVhbSwKLSAgICAgICAgICAgIHBCaXRPZmZzZXQsCi0gICAgICAgICAgICBwVGVtcEJ1ZjEsCi0gICAgICAgICAgICBwcmVkQUNEaXIsCi0gICAgICAgICAgICBzaG9ydFZpZGVvSGVhZGVyKTsKLSAgICAgICAgYXJtUmV0RGF0YUVycklmKChlcnJvckNvZGUgIT0gT01YX1N0c19Ob0VyciksIGVycm9yQ29kZSk7Ci0gICAgfQotCi0gICAgLyogQUMgREMgcHJlZGljdGlvbiAqLwotICAgIGVycm9yQ29kZSA9IG9teFZDTTRQMl9QcmVkaWN0UmVjb25Db2VmSW50cmEoCi0gICAgICAgIHBUZW1wQnVmMSwKLSAgICAgICAgcENvZWZCdWZSb3csCi0gICAgICAgIHBDb2VmQnVmQ29sLAotICAgICAgICBjdXJRUCwKLSAgICAgICAgcHJlZFFQLAotICAgICAgICBwcmVkRGlyLAotICAgICAgICBBQ1ByZWRGbGFnLAotICAgICAgICB2aWRlb0NvbXApOwotICAgIGFybVJldERhdGFFcnJJZigoZXJyb3JDb2RlICE9IE9NWF9TdHNfTm9FcnIpLCBlcnJvckNvZGUpOwotICAgIAotICAgIC8qIERlcXVhbnRpemF0aW9uICovCi0gICAgZXJyb3JDb2RlID0gb214VkNNNFAyX1F1YW50SW52SW50cmFfSSgKLSAgICAgcFRlbXBCdWYxLAotICAgICBjdXJRUCwKLSAgICAgdmlkZW9Db21wLAotICAgICBzaG9ydFZpZGVvSGVhZGVyKTsKLSAgICBhcm1SZXREYX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pbgotOyAqICAgICAgICAgICAgICAgICAgICAgICAgICAgIFswLTddLgotOyAqIFtpbl0gICAgcFNyY01WTGVmdE1CICAgICAgIHBvaW50ZXJzIHRvIHRoZSBtb3Rpb24gdmVjdG9yIGJ1ZmZlcnMgb2YgdGhlCi07ICogICAgICAgICAgICAgICAgICAgICAgICAgICBtYWNyb2Jsb2NrcyBzcGVjaWFsbHkgYXQgdGhlIGxlZnQgc2lkZSBvZiB0aGUgY3VycmVudCBtYWNyb2Jsb2NrCi07ICogICAgICAgICAgICAgICAgICAgICByZXNwZWN0aXZlbHkuCi07ICogW2luXSAgICBwU3JjTVZVcHBlck1CICAgICAgcG9pbnRlcnMgdG8gdGhlIG1vdGlvbiB2ZWN0b3IgYnVmZmVycyBvZiB0aGUKLTsgKiAgICAgICAgICAgICAgICAgICAgIG1hY3JvYmxvY2tzIHNwZWNpYWxseSBhdCB0aGUgdXBwZXIgc2lkZSBvZiB0aGUgY3VycmVudCBtYWNyb2Jsb2NrCi07ICogICAgICAgICAgICAgICAgICAgICByZXNwZWN0aXZlbHkuCi07ICogW2luXSAgICBwU3JjTVZVcHBlclJpZ2h0TUIgcG9pbnRlcnMgdG8gdGhlIG1vdGlvbiB2ZWN0b3IgYnVmZmVycyBvZiB0aGUKLTsgKiAgICAgICAgICAgICAgICAgICAgIG1hY3JvYmxvY2tzIHNwZWNpYWxseSBhdCB0aGUgdXBwZXItcmlnaHQgc2lkZSBvZiB0aGUgY3VycmVudCBtYWNyb2Jsb2NrCi07ICogICAgICAgICAgICAgICAgICAgICByZXNwZWN0aXZlbHkuCi07ICogW2luXSAgICBmY29kZUZvcndhcmQgICAgICAgYSBjb2RlIGVxdWFsIHRvIHZvcF9mY29kZV9mb3J3YXJkIGluIE1QRUctNAotOyAqICAgICAgICAgICAgICAgICAgICAgYml0IHN0cmVhbSBzeW50YXgKLTsgKiBbaW5dICAgIE1CVHlwZSAgICAgICAgIHRoZSB0eXBlIG9mIHRoZSBjdXJyZW50IG1hY3JvYmxvY2suIElmIE1CVHlwZQotOyAqICAgICAgICAgICAgICAgICAgICAgaXMgbm90IGVxdWFsIHRvIE9NWF9WQ19JTlRFUjRWLCB0aGUgZGVzdGluYXRpb24KLTsgKiAgICAgICAgICAgICAgICAgICAgIG1vdGlvbiB2ZWN0b3IgYnVmZmVyIGlzIHN0aWxsIGZpbGxlZCB3aXRoIHRoZQotOyAqICAgICAgICAgICAgICAgICAgICAgc2FtZSBkZWNvZGVkIHZlY3Rvci4KLTsgKiBbb3V0XSAgIHBwQml0U3RyZWFtICAgICAgICAgKnBwQml0U3RyZWFtIGlzIHVwZGF0ZWQgYWZ0ZXIgdGhlIGJsb2NrIGlzIGRlY29kZWQsCi07ICogICAgICAgICAgICAgICAgICAgICBzbyB0aGF0IGl0IHBvaW50cyB0byB0aGUgY3VycmVudCBieXRlIGluIHRoZSBiaXQKLTsgKiAgICAgICAgICAgICAgICAgICAgIHN0cmVhbSBidWZmZXIKLTsgKiBbb3V0XSAgIHBCaXRPZmZzZXQgICAgICAgICAqcEJpdE9mZnNldCBpcyB1cGRhdGVkIHNvIHRoYXQgaXQgcG9pbnRzIHRvIHRoZQotOyAqICAgICAgICAgICAgICAgICAgICAgY3VycmVudCBiaXQgcG9zaXRpb24gaW4gdGhlIGJ5dGUgcG9pbnRlZCBieQotOyAqICAgICAgICAgICAgICAgICAgICAgKnBwQml0U3RyZWFtCi07ICogW291dF0gICBwRHN0TVZDdXJNQiAgICAgICAgIHBvaW50ZXIgdG8gdGhlIG1vdGlvbiB2ZWN0b3IgYnVmZmVyIG9mIHRoZSBjdXJyZW50Ci07ICogICAgICAgICAgICAgICAgICAgICBtYWNyb2Jsb2NrIHdoaWNoIGNvbnRhaW5zIGZvdXIgZGVjb2RlZCBtb3Rpb24gdmVjdG9ycwotOyAqCi07ICogUmV0dXJuIFZhbHVlOgotOyAqIE9NWF9TdHNfTm9FcnIgLW5vIGVycm9yCi07ICogCi07ICogICAgICAgICAgICAgICAgICAgICAKLTsgKiBPTVhfU3RzX0VyciAtIHN0YXR1cyBlcnJvcgotOyAqCi07ICoKLSAgICAgCi0gICAgICAgIElOQ0xVREUgb214dHlwZXNfcy5oCi0gICAgICAgIElOQ0xVREUgYXJtQ09NTV9zLmgKLSAgICAgICAgSU5DTFVERSBhcm1DT01NX0JpdERlY19zLmgKLSAgICAgICAgSU5DTFVERSBvbXhWQ19zLmgKLSAgICAgICAgCi0gICAgICAgTV9WQVJJQU5UUyBBUk0xMTM2SlMKLSAgICAgICAKLSAgICAgICAgICAgICAgICAKLQotCi0gICAgICAgIElGIEFSTTExMzZKUwotCi07Ly9JbnB1dCBBcmd1bWVudHMKLQotcHBCaXRTdHJlYW0gICAgICAgICAgIFJOIDAKLXBCaXRPZmZzZXQgICAgICAgICAgICBSTiAxCi1wU3JjTVZMZWZ0TUIgICAgICAgICAgUk4gMgotcFNyY01WVXBwZXJNQiAgICAgICAgIFJOIDMKLXBTcmNNVlVwcGVyUmlnaHRNQiAgICBSTiA0Ci1wRHN0TVZDdXJNQiAgICAgICAgICAgUk4gNQotZmNvZGVGb3J3YXJkICAgICAgICAgIFJOIDYKLU1CVHlwZSAgICAgICAgICAgICAgICBSTiA3Ci0KLTsvL0xvY2FsIFZhcmlhYmxlcwotCi16ZXJvICAgICAgICAgICAgICAgICAgUk4gNAotb25lICAgICAgICAgICAgICAgICAgIFJOIDQKLXNjYWxlRmFjdG9yICAgICAgICAgICBSTiAxCi0KLQotUmV0dXJuICAgICAgICAgICAgICAgIFJOIDAKLQotVmxjTVZEICAgICAgICAgICAgICAgIFJOIDAKLWluZGV4ICAgICAgICAgICAgICAgICBSTiA0Ci1Db3VudCAgICAgICAgICAgICAgICAgUk4gNwotCi1tdkhvckRhdGEgICAgICAgICAgICAgUk4gNAotbXZIb3JSZXNpZHVhbCAgICAgICAgIFJOIDAKLQotbXZWZXJEYXRhICAgICAgICAgICAgIFJOIDQgICAgICAgICAgICAgCi1tdlZlclJlc2lkdWFsICAgICAgICAgUk4gMAotCi10ZW1wICAgICAgICAgICAgICAgICAgUk4gMQotCi10ZW1wMSAgICAgICAgICAgICAgICAgUk4gMwotSGlnaCAgICAgICAgICAgICAgICAgIFJOIDQKLUxvdyAgICAgICAgICAgICAgICAgICBSTiAyCi1SYW5nZSAgICAgICAgICAgICAgICAgUk4gMQotCi1CbGtDb3VudCAgICAgICAgICAgICAgUk4gMTQKLQotZGlmZk1WZHggICAgICAgICAgICAgIFJOIDAKLWRpZmZNVmR5ICAgICAgICAgICAgICBSTiAxCi0KLTsvLyBTY3JhdGNoIFJlZ2lzdGVycwotCi1SQml0U3RyZWFtICAgICAgICAgICAgUk4gOAotUkJpdENvdW50ICAgICAgICAgICAgIFJOIDkKLVJCaXRCdWZmZXIgICAgICAgICAgICBSTiAxMAotCi1UMSAgICAgICAgICAgICAgICAgICAgUk4gMTEKLVQyICAgICAgICAgICAgICAgICAgICBSTiAxMgotTFIgICAgICAgICAgICAgICAgICAgIFJOIDE0Ci0KLSAgICAgICBJTVBPUlQgICAgICAgICAgYXJtVkNNNFAyX2FWbGNNVkQKLSAgICAgICBJTVBPUlQgICAgICAgICAgb214VkNNNFAyX0ZpbmRNVnByZWQKLQotICAgICAgIDsvLyBBbGxvY2F0ZSBzdGFjayBtZW1vcnkgICAgICAgIAotICAgICAgIAotICAgICAgIE1fQUxMT0M0ICAgICAgICBwcERzdE1WQ3VyTUIsNAotICAgICAgIE1fQUxMT0M0ICAgICAgICBwRHN0TVZQcmVkTUUsNAotICAgICAgIE1fQUxMT0M0ICAgICAgICBwQmxrQ291bnQsNAotICAgICAgIAotICAgICAgIE1fQUxMT0M0ICAgICAgICBwcHBCaXRTdHJlYW0sNAotICAgICAgIE1fQUxMT0M0ICAgICAgICBwcEJpdE9mZnNldCw0Ci0gICAgICAgTV9BTExPQzQgICAgICAgIHBwU3JjTVZMZWZ0TUIsNAotICAgICAgIE1fQUxMT0M0ICAgICAgICBwcFNyY01WVXBwZXJNQiw0Ci0gICAgICAgCi0gICAgICAgTV9BTExPQzQgICAgICAgIHBkaWZmTVZkeCw0Ci0gICAgICAgTV9BTExPQzQgICAgICAgIHBkaWZmTVZkeSw0Ci0gICAgICAgTV9BTExPQzQgICAgICAgIHBIaWdoLDQKLSAgICAgICAKLSAgICAgICAgICAgICAgCi0KLQotICAgICAgIE1fU1RBUlQgICBvbXhWQ000UDJfRGVjb2RlUGFkTVZfUFZPUCxyMTEKLSAgICAgICAKLSAgICAgICBNX0FSRyAgICAgICAgICAgcFNyY01WVXBwZXJSaWdodE1Cb25TdGFjayw0ICAgICAgICAgICA7Ly8gcG9pbnRlciB0byAgcFNyY01WVXBwZXJSaWdodE1CIG9uIHN0YWNrCi0gICAgICAgTV9BUkcgICAgICAgICAgIHBEc3RNVkN1ck1Cb25TdGFjayw0ICAgICAgICAgICAgICAgICAgOy8vIHBvaW50ZXIgdG8gcERzdE1WQ3VyTUIgb24gc3RhY2sKLSAgICAgICBNX0FSRyAgICAgICAgICAgZmNvZGVGb3J3YXJkb25TdGFjayw0ICAgICAgICAgICAgICAgICA7Ly8gcG9pbnRlciB0byBmY29kZUZvcndhcmQgb24gc3RhY2sgCi0gICAgICAgTV9BUkcgICAgICAgICAgIE1CVHlwZW9uU3RhY2ssNCAgICAgICAgICAgICAgICAgICAgICAgOy8vIHBvaW50ZXIgdG8gTUJUeXBlIG9uIHN0YWNrCi0KLSAgICAgIAotICAgICAgIAotICAgICAgIAotICAgICAgIAotICAgICAgIDsvLyBJbml0aWFsaXppbmcgdGhlIEJpdFN0cmVhbSBNYWNybwotCi0gICAgICAgTV9CRF9JTklUMCAgICAgIHBwQml0U3RyZWFtLCBwQml0T2Zmc2V0LCBSQml0U3RyZWFtLCBSQml0QnVmZmVyLCBSQml0Q291bnQKLSAgICAgICBNX0xEUiAgICAgICAgICAgTUJUeXBlLE1CVHlwZW9uU3RhY2sgICAgICAgICAgICAgICAgICA7Ly8gTG9hZCBNQlR5cGUgZnJvbSBzdGFjawotICAgICAgIE1fTERSICAgICAgICAgICBwRHN0TVZDdXJNQixwRHN0TVZDdXJNQm9uU3RhY2sgICAgICAgIDsvLyBMb2FkIHBEc3RNVkN1ck1CIGZyb20gc3RhY2sKLSAgICAgICBNT1YgICAgICAgICAgICAgemVybywjMAotCi0gICAgICAgVEVRICAgICAgICAgICAgIE1CVHlwZSwjT01YX1ZDX0lOVFJBICAgICAgICAgICAgICAgICAgOy8vIENoZWNrIGlmIE1CVHlwZT1PTVhfVkNfSU5UUkEKLSAgICAgICBURVFORSAgICAgICAgICAgTUJUeXBlLCNPTVhfVkNfSU5UUkFfUSAgICAgICAgICAgICAgICA7Ly8gY2hlY2sgaWYgTUJUeXBlPU9NWF9WQ19JTlRSQV9RCi0gICAgICAgU1RSRVEgICAgICAgICAgIHplcm8sW3BEc3RNVkN1ck1CXQotICAgICAgIE1fQkRfSU5JVDEgICAgICBUMSwgVDIsIFQyCi0gICAgICAgU1RSRVEgICAgICAgICAgIHplcm8sW3BEc3RNVkN1ck1CLCM0XQotICAgICAgIE1fQkRfSU5JVDIgICAgICBUMSwgVDIsIFQyCi0gICAgICAgU1RSRVEgICAgICAgICAgIHplcm8sW3BEc3RNVkN1ck1CLCM0XQotICAgICAgIE1PVkVRICAgICAgICAgICBSZXR1cm4sI09NWF9TdHNfTm9FcnIKLSAgICAgICBNT1YgICAgICAgICAgICAgQmxrQ291bnQsIzAKLSAgICAgICBTVFJFUSAgICAgICAgICAgemVybyxbcERzdE1WQ3VyTUIsIzRdCi0gICAgICAgCi0gICAgICAgQkVRICAgICAgICAgICAgIEV4aXRPSwotCi0gICAgICAgVEVRICAgICAgICAgICAgIE1CVHlwZSwjT01YX1ZDX0lOVEVSNFYgICAgICAgICAgICAgICAgOy8vIENoZWNrIGlmIE1CVHlwZT1PTVhfVkNfSU5URVI0VgotICAgICAgIFRFUU5FICAgICAgICAgICBNQlR5cGUsI09NWF9WQ19JTlRFUjRWX1EgICAgICAgICAgICAgIDsvLyBDaGVjayBpZiBNQlR5cGU9T01YX1ZDX0lOVEVSNFZfUQotICAgICAgIE1PVkVRICAgICAgICAgICBDb3VudCwjNAotCi0gICAgICAgVEVRICAgICAgICAgICAgIE1CVHlwZSwjT01YX1ZDX0lOVEVSICAgICAgICAgICAgICAgICAgOy8vIENoZWNrIGlmIE1CVHlwZT1PTVhfVkNfSU5URVIKLSAgICAgICBURVFORSAgICAgICAgICAgTUJUeXBlLCNPTVhfVkNfSU5URVJfUSAgICAgICAgICAgICAgICA7Ly8gQ2hlY2sgaWYgTUJUeXBlPU9NWF9WQ19JTlRFUl9RCi0gICAgICAgTU9WRVEgICAgICAgICAgIENvdW50LCMxCi0gICAgICAgCi0gICAgICAgTV9MRFIgICAgICAgICAgIGZjb2RlRm9yd2FyZCxmY29kZUZvcndhcmRvblN0YWNrICAgICAgOy8vIExvYWQgZmNvZGVGb3J3YXJkICBmcm9tIHN0YWNrCi0KLSAgICAgICA7Ly8gU3RvcmluZyB0aGUgdmFsdWVzIHRlbXBvcmFyaWx5IG9uIHN0YWNrCi0KLSAgICAgICBNX1NUUiAgICAgICAgICAgcHBCaXRTdHJlYW0scHBwQml0U3RyZWFtICAgICAgICAgICAgICAKLSAgICAgICBNX1NUUiAgICAgICAgICAgcEJpdE9mZnNldCxwcEJpdE9mZnNldAotICAgICAgICAgICAgCi0KLSAgICAgICBTVUIgICAgICAgICAgICAgdGVtcCxmY29kZUZvcndhcmQsIzEgICAgICAgICAgICAgICAgICA7Ly8gdGVtcD1mY29kZUZvcndhcmQtMQotICAgICAgIE1PViAgICAgICAgICAgICBvbmUsIzEKLSAgICAgICBNX1NUUiAgICAgICAgICAgcFNyY01WTGVmdE1CLHBwU3JjTVZMZWZ0TUIKLSAgICAgICBMU0wgICAgICAgICAgICAgc2NhbGVGYWN0b3Isb25lLHRlbXAgICAgICAgICAgICAgICAgICA7Ly8gc2NhbGVGYWN0b3I9MTw8KGZjb2RlRm9yd2FyZC0xKQotICAgICAgIE1fU1RSICAgICAgICAgICBwU3JjTVZVcHBlck1CLHBwU3JjTVZVcHBlck1CCi0gICAgICAgTFNMICAgICAgICAgICAgIHNjYWxlRmFjdG9yLHNjYWxlRmFjdG9yLCM1ICAgICAgICAgICAgCi0gICAgICAgTV9TVFIgICAgICAgICAgIHNjYWxlRmFjdG9yLHBIaWdoICAgICAgICAgICAgICAgICAgICAgOy8vIFtwSGlnaF09MzIqc2NhbGVGYWN0b3IKLSAgICAgICAgICAgICAgCi0gICAgICAgOy8vIFZMRCBEZWNvZGluZwotCi0KLUxvb3AKLQotICAgICAgIExEUiAgICAgICAgICAgICBWbGNNVkQsID1hcm1WQ000UDJfYVZsY01WRCAgICAgICAgOy8vIExvYWQgdGhlIG9wdGltaXplZCBNVkQgVkxDIHRhYmxlCi0KLSAgICAgICA7Ly8gSG9yaXpvbnRhbCBEYXRhIGFuZCBSZXNpZHVhbCBjYWxjdWxhdGlvbgotCi0gICAgICAgTERSICAgICAgICAgICAgIHRlbXAsPTB4RkZGICAgICAgICAgICAgICAgICAgICAgICAgICAgCi0gICAgICAgTV9CRF9WTEQgICAgICAgIGluZGV4LFQxLFQyLFZsY01WRCwzLDIgICAgICAgICAgICAgICAgOy8vIHZhcmlhYmxlIGxlbmdodCBkZWNvZGluZyB1c2luZyB0aGUgbWFjcm8KLSAgICAgIAotICAgICAgIFRFUSAgICAgICAgICAgICBpbmRleCx0ZW1wCi0gICAgICAgQkVRICAgICAgICAgICAgIEV4aXRFcnJvciAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOy8vIEV4aXQgd2l0aCBhbiBFcnJvciBNZXNzYWdlIGlmIHRoZSBkZWNvZGVkIHN5bWJvbCBpcyBhbiBpbnZhbGllZCBzeW1ib2wgCi0gICAgICAgCi0gICAgICAgU1VCICAgICAgICAgICAgIG12SG9yRGF0YSxpbmRleCwjMzIgICAgICAgICAgICAgICAgICAgOy8vIG12SG9yRGF0YT1pbmRleC0zMiAgICAgICAgICAgICAKLSAgICAgICBNT1YgICAgICAgICAgICAgbXZIb3JSZXNpZHVhbCwjMSAgICAgICAgICAgICAgICAgICAgICA7Ly8gbXZIb3JSZXNpZHVhbD0xCi0gICAgICAgQ01QICAgICAgICAgICAgIGZjb2RlRm9yd2FyZCwjMQotICAgICAgIFRFUU5FICAgICAgICAgICBtdkhvckRhdGEsIzAKLSAgICAgICBNT1ZFUSAgICAgICAgICAgZGlmZk1WZHgsbXZIb3JEYXRhICAgICAgICAgICAgICAgICAgICA7Ly8gaWYgc2NhbGVGYWN0b3I9MShmY29kZUZvcndhcmQ9MSkgb3IgbXZIb3JEYXRhPTAgZGlmZk1WZHg9bXZIb3JEYXRhICAgICAgICAgCi0gICAgICAgQkVRICAgICAgICAgICAgIFZlcnRpY2FsRGF0YQotICAgICAgIAotICAgICAgIFNVQiAgICAgICAgICAgICB0ZW1wLGZjb2RlRm9yd2FyZCwjMQotICAgICAgIE1fQkRfVlJFQUQ4ICAgICBtdkhvclJlc2lkdWFsLHRlbXAsVDEsVDIgICAgICAgICAgICAgIDsvLyBnZXQgbXZIb3JSZXNpZHVhbCBmcm9tIGJpdHN0cmVhbSBpZiBmY29kZUZvcndhcmQ+MSBhbmQgbXZIb3JEYXRhIT0wICAgICAgICAgICAgICAKLSAgICAgICAKLSAgICAgICBDTVAgICAgICAgICAgICAgbXZIb3JEYXRhLCMwCi0gICAgICAgUlNCTFQgICAgICAgICAgIG12SG9yRGF0YSxtdkhvckRhdGEsIzAgICAgICAgICAgICAgICAgOy8vIG12SG9yRGF0YT1hYnMobXZIb3JEYXRhKQotICAgICAgIFNVQiAgICAgICAgICAgICBtdkhvclJlc2lkdWFsLG12SG9yUmVzaWR1YWwsZmNvZGVGb3J3YXJkCi0gICAgICAgU01MQUJCICAgICAgICAgIGRpZmZNVmR4LG12SG9yRGF0YSxmY29kZUZvcndhcmQsbXZIb3JSZXNpZHVhbCA7Ly8gZGlmZk1WZHg9YWJzKG12SG9yRGF0YSkqZmNvZGVGb3J3YXJkK212SG9yUmVzaWR1YWwtZmNvZGVGb3J3YXJkCi0gICAgICAgQUREICAgICAgICAgICAgIGRpZmZNVmR4LGRpZmZNVmR4LCMxCi0gICAgICAgUlNCTFQgICAgICAgICAgIGRpZmZNVmR4LGRpZmZNVmR4LCMwCi0gICAgICAgCi0gICAgICAgOy8vIFZlcnRpY2FsIERhdGEgYW5kIFJlc2lkdWFsIGNhbGN1bGF0aW9uCi0KLVZlcnRpY2FsRGF0YQotCi0gICAgICAgTV9TVFIgICAgICAgICAgIGRpZmZNVmR4LHBkaWZmTVZkeCAgICAgICAgICAgICAgICAgICAgOy8vIFN0b3JlIHRoZSBkaWZmTVZkeCBvbiBzdGFjawotICAgICAgIExEUiAgICAgICAgICAgICBWbGNNVkQsID1hcm1WQ000UDJfYVZsY01WRCAgICAgICAgOy8vIExvYWRpbmcgdGhlIGFkZHJlc3Mgb2Ygb3B0aW1pemVkIFZMQyB0YWJsZXMKLQotICAgICAgIExEUiAgICAgICAgICAgICB0ZW1wLD0weEZGRgotICAgICAgIE1fQkRfVkxEICAgICAgICBpbmRleCxUMSxUMixWbGNNVkQsMywyICAgICAgICAgICAgICAgIDsvLyBWTEMgZGVjb2RpbmcgdXNpbmcgdGhlIG1hY3JvCi0gICAgICAgCi0gICAgICAgVEVRICAgICAgICAgICAgIGluZGV4LHRlbXAKLSAgICAgICBCRVEgICAgICAgICAgICAgRXhpdEVycm9yICAgICAgICAgICAgICAgICAgICAgICAgICAgICA7Ly8gRXhpdCB3aXRoIGFuIEVycm9yIE1lc3NhZ2UgaWYgYW4gSW52YWxpZWQgU3ltYm9sIG9jY3VycwotICAgICAgIAotICAgICAgIFNVQiAgICAgICAgICAgICBtdlZlckRhdGEsaW5kZXgsIzMyICAgICAgICAgICAgICAgICAgIDsvLyBtdlZlckRhdGE9aW5kZXgtMzIgICAgICAgICAgICAgCi0gICAgICAgTU9WICAgICAgICAgICAgIG12VmVyUmVzaWR1YWwsIzEgICAgIAotICAgICAgIENNUCAgICAgICAgICAgICBmY29kZUZvcndhcmQsIzEKLSAgICAgICBURVFORSAgICAgICAgICAgbXZWZXJEYX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ICAgICAgICAgIGRpZmZNVmR5LHBkaWZmTVZkeQotICAgICAgIEFERCAgICAgICAgICAgICB0ZW1wLHBEc3RNVkN1ck1CLEJsa0NvdW50LExTTCAjMiAgICAgIDsvLyB0ZW1wPXBEc3RNVkN1ck1CW0Jsa0NvdW50XQotICAgICAgIE1fU1RSICAgICAgICAgICB0ZW1wLHBwRHN0TVZDdXJNQiAgICAgICAgICAgICAgICAgICAgIDsvLyBzdG9yZSB0ZW1wIG9uIHN0YWNrIGZvciBwYXNzaW5nIGFzIGFuIGFyZ3VtZW50IHRvIEZpbmRNVlByZWQKLSAgICAgICAKLSAgICAgICBNT1YgICAgICAgICAgICAgdGVtcCwjMAotICAgICAgIE1fU1RSICAgICAgICAgICB0ZW1wLHBEc3RNVlByZWRNRSAgICAgICAgICAgICAgICAgICAgIDsvLyBQYXNzIHBEc3RNVlByZWRNRT1OVUxMIGFzIGFuIGFyZ3VtZW50ICAgICAgICAgCi0gICAgICAgTV9TVFIgICAgICAgICAgIEJsa0NvdW50LHBCbGtDb3VudCAgICAgICAgICAgICAgICAgICAgOy8vIFBhc3NzIEJsa0NvdW50IGFzIEFyZ3VtZW50IHRocm91Z2ggc3RhY2sKLQotICAgICAgIE1PViAgICAgICAgICAgICB0ZW1wLHBTcmNNVkxlZnRNQiAgICAgICAgICAgICAgICAgICAgIDsvLyB0ZW1wIChSTiAxKT1wU3JjTVZMZWZ0TUIKLSAgICAgICBNX0xEUiAgICAgICAgICAgcFNyY01WVXBwZXJSaWdodE1CLHBTcmNNVlVwcGVyUmlnaHRNQm9uU3RhY2sKLSAgICAgICBNT1YgICAgICAgICAgICAgcFNyY01WTGVmdE1CLHBTcmNNVlVwcGVyTUIgICAgICAgICAgICA7Ly8gcFNyY01WTGVmdE1CICggUk4gMikgPSBwU3JjTVZVcHBlck1CCi0gICAgICAgTU9WICAgICAgICAgICAgIHBwQml0U3RyZWFtLHBEc3RNVkN1ck1CICAgICAgICAgICAgICAgOy8vIHBwQml0U3RyZWFtICAoIFJOIDApID0gcERzdE1WQ3VyTUIKLSAgICAgICBNT1YgICAgICAgICAgICAgcFNyY01WVXBwZXJNQixwU3JjTVZVcHBlclJpZ2h0TUIgICAgICA7Ly8gcFNyY01WVXBwZXJNQiggUk4gMykgPSBwU3JjTVZVcHBlclJpZ2h0TUIgICAgICAKLSAgICAgICBCTCAgICAgICAgICAgICAgb214VkNNNFAyX0ZpbmRNVnByZWQgICAgICAgICAgICAgIDsvLyBCcmFuY2ggdG8gc3Vicm91dGluZSBvbXhWQ000UDJfRmluZE1WcHJlZAotCi0gICAgICAgOy8vIFN0b3JlIEhvcml6b250YWwgTW90aW9uIFZlY3RvcgotICAgICAKLSAgICAgICBNX0xEUiAgICAgICAgICAgQmxrQ291bnQscEJsa0NvdW50ICAgICAgICAgICAgICAgICAgICA7Ly8gTG9hZCBCbGtDb3VudCBmcm9tIHN0YWNrCi0gICAgICAgTV9MRFIgICAgICAgICAgIEhpZ2gscEhpZ2ggICAgICAgICAgICAgICAgICAgICAgICAgICAgOy8vIEhpZ2g9MzIqc2NhbGVGYWN0b3IKLSAgICAgICBMU0wgICAgICAgICAgICAgdGVtcDEsQmxrQ291bnQsIzIgICAgICAgICAgICAgICAgICAgICA7Ly8gdGVtcD1CbGtDb3VudCo0Ci0gICAgICAgTV9MRFIgICAgICAgICAgIGRpZmZNVmR4LHBkaWZmTVZkeCAgICAgICAgICAgICAgICAgICAgOy8vIExhYWQgZGlmZk1WZHgKLSAgICAgICAKLSAgICAgICBMRFJTSCAgICAgICAgICAgdGVtcCxbcERzdE1WQ3VyTUIsdGVtcDFdICAgICAgICAgICAgICA7Ly8gdGVtcD1wRHN0TVZDdXJNQltCbGtDb3VudF0KLSAgICAgICAKLSAgICAgICAKLSAgICAgICBSU0IgICAgICAgICAgICAgTG93LEhpZ2gsIzAgICAgICAgICAgICAgICAgICAgICAgICAgICA7Ly8gTG93ID0gLTMyKnNjYWxlRmFjdG9yCi0gICAgICAgQUREICAgICAgICAgICAgIGRpZmZNVmR4LHRlbXAsZGlmZk1WZHggICAgICAgICAgICAgICAgOy8vIGRpZmZNVmR4PXBEc3RNVkN1ck1CW0Jsa0NvdW50XStkaWZmTVZkeAotICAgICAgIEFERCAgICAgICAgICAgICBSYW5nZSxIaWdoLEhpZ2ggICAgICAgICAgICAgICAgICAgICAgIDsvLyBSYW5nZT02NCpTY2FsZUZhY3RvcgotICAgICAgIFNVQiAgICAgICAgICAgICBIaWdoLEhpZ2gsIzEgICAgICAgICAgICAgICAgICAgICAgICAgIDsvLyBIaWdoPSAzMipzY2FsZUZhY3Rvci0xCi0KLSAgICAgICBDTVAgICAgICAgICAgICAgZGlmZk1WZHgsTG93ICAgICAgICAgICAgICAgICAgICAgICAgICA7Ly8gSWYgZGlmZk1WZHg8TG93ICAgICAgICAgIAotICAgICAgIEFERExUICAgICAgICAgICBkaWZmTVZkeCxkaWZmTVZkeCxSYW5nZSAgICAgICAgICAgICAgIDsvLyBkaWZmTVZkeCs9UmFuZ2UKLSAgICAgICAgCi0gICAgICAgQ01QICAgICAgICAgICAgIGRpZmZNVmR4LEhpZ2ggICAgICAgICAgICAgICAgICAgICAgICAgCi0gICAgICAgU1VCR1QgICAgICAgICAgIGRpZmZNVmR4LGRpZmZNVmR4LFJhbmdlICAgICAgICAgICAgICAgOy8vIElmIGRpZmZNVmR4ID4gSGlnaCBkaWZmTVZkeC09UmFuZ2UKLSAgICAgICBTVFJIICAgICAgICAgICAgZGlmZk1WZHgsW3BEc3RNVkN1ck1CLHRlbXAxXQotCi0gICAgICAgOy8vIFN0b3JlIFZlcnRpY2FsCi0KLSAgICAgICBBREQgICAgICAgICAgICAgdGVtcDEsdGVtcDEsIzIgICAgICAgICAgICAgICAgICAgICAgICA7Ly8gdGVtcDE9NCpCbGtDb3VudCsyCi0gICAgICAgTV9MRFIgICAgICAgICAgIGRpZmZNVmR4LHBkaWZmTVZkeSAgICAgICAgICAgICAgICAgICAgOy8vIExhYWQgZGlmZk1WZHkKLSAgICAgICBMRFJTSCAgICAgICAgICAgdGVtcCxbcERzdE1WQ3VyTUIsdGVtcDFdICAgICAgICAgICAgICA7Ly8gdGVtcD1wRHN0TVZDdXJNQltCbGtDb3VudF0uZGlmZk1WZHkKLSAgICAgICBBREQgICAgICAgICAgICAgQmxrQ291bnQsQmxrQ291bnQsIzEgICAgICAgICAgICAgICAgICA7Ly8gQmxrQ291bnQ9QmxrQ291bnQrMQotICAgICAgIEFERCAgICAgICAgICAgICBkaWZmTVZkeCx0ZW1wLGRpZmZNVmR4ICAgICAgICAgICAgICAgIAotICAgICAgIENNUCAgICAgICAgICAgICBkaWZmTVZkeCxMb3cKLSAgICAgICBBRERMVCAgICAgICAgICAgZGlmZk1WZHgsZGlmZk1WZHgsUmFuZ2UgICAgICAgICAgICAgICA7Ly8gSWYgZGlmZk1WZHk8TG93ICBkaWZmTVZkeSs9UmFuZ2UgICAgICAgICAgICAgICAgCi0gICAgICAgQ01QICAgICAgICAgICAgIGRpZmZNVmR4LEhpZ2gKLSAgICAgICBTVUJHVCAgICAgICAgICAgZGlmZk1WZHgsZGlmZk1WZHgsUmFuZ2UgICAgICAgICAgICAgICA7Ly8gSWYgZGlmZk1WZHkgPiBIaWdoIGRpZmZNVmR5LT1SYW5nZQotICAgICAgIFNUUkggICAgICAgICAgICBkaWZmTVZkeCxbcERzdE1WQ3VyTUIsdGVtcDFdICAgIAotICAgICAgIAotICAgICAgIENNUCAgICAgICAgICAgICBCbGtDb3VudCxDb3VudAotICAgICAgIE1fTERSICAgICAgICAgICBwU3JjTVZMZWZ0TUIscHBTcmNNVkxlZnRNQgotICAgICAgIE1fTERSICAgICAgICAgICBwU3JjTVZVcHBlck1CLHBwU3JjTVZVcHBlck1CCi0KLSAgICAgICBCTFQgICAgICAgICAgICAgTG9vcCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA7Ly8gSWYgQmxrQ291bnQ8Q291bnQgQ29udGludWUgdGhlIExvb3AKLQotCi0gICAgICAgOy8vIElmIE1CVHlwZT1PTVhfVkNfSU5URVIgb3IgTUJ0eXBlPU9NWF9WQ19JTlRFUl9RIGNvcHkgcERzdE1WQ3VyTUJbMF0gdG8KLSAgICAgICA7Ly8gcERzdE1WQ3VyTUJbMV0sIHBEc3RNVkN1ck1CWzJdLCBwRHN0TVZDdXJNQlszXSAKLQotICAgICAgIE1fTERSICAgICAgICAgICBNQlR5cGUsTUJUeXBlb25TdGFjawotCi0gICAgICAgVEVRICAgICAgICAgICAgIE1CVHlwZSwjT01YX1ZDX0lOVEVSICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCi0gICAgICAgVEVRTkUgICAgICAgICAgIE1CVHlwZSwjT01YX1ZDX0lOVEVSX1EgICAgICAgICAgICAgICAgICAgICAgICAgICAgCi0gICAgICAgTERSRVEgICAgICAgICAgIHRlbXAsW3BEc3RNVkN1ck1CXQotICAgICAgIE1fTERSICAgICAgICAgICBwcEJpdFN0cmVhbSxwcHBCaXRTdHJlYW0KLSAgICAgICBTVFJFUSAgICAgICAgICAgdGVtcCxbcERzdE1WQ3VyTUIsIzRdCi0gICAgICAgCi0gICAgICAgU1RSRVEgICAgICAgICAgIHRlbXAsW3BEc3RNVkN1ck1CLCM4XQotICAgICAgIFNUUkVRICAgICAgICAgICB0ZW1wLFtwRHN0TVZDdXJNQiwjMTJdCi0gICAgICAgCi0gICAgICAgCi0gICAgICAgTV9MRFIgICAgICAgICAgIHBCaXRPZmZzZXQscHBCaXRPZmZzZXQKLSAgICAgICA7Ly9FbmRpbmcgdGhlIG1hY3JvCi0gICAgICAgTV9CRF9GSU5JICAgICAgIHBwQml0U3RyZWFtLHBCaXRPZmZzZXQgICAgICAgICAgICAgICAgIDsvLyBGaW5pc2hpbmcgdGhlIE1hY3JvICAgICAgIAotCi0gICAgICAgCi0gICAgICAgTU9WICAgICAgICAgICAgIFJldHVybiwjT01YX1N0c19Ob0VycgotICAgICAgIEIgICAgICAgICAgICAgICBFeGl0T0sKLSAKLUV4aXRFcnJvcgot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0ICAgICAgICBwcFZsY1RhYmxlTDBMMSw0Ci0gICAgICAgIE1fQUxMT0M0ICAgICAgICBwcExNQVhUYWJsZUwwTDEsNAotICAgICAgICBNX0FMTE9DNCAgICAgICAgcHBSTUFYVGFibGVMMEwxLDQKLSAgICAgICAgTV9BTExPQzQgICAgICAgIHBwWmlnemFnVGFibGUsNAotICAgICAgICAKLSAgICAgICAgCi0gICAgICAgIE1fU1RBUlQgb214VkNNNFAyX0RlY29kZVZMQ1ppZ3phZ19JbnRlcixyMTIKLQotICAgICAgICAKLQotICAgICAgICAKLSAgICAgICAgTERSICAgICAgICAgICAgIHBaaWd6YWdUYWJsZSwgPWFybVZDTTRQMl9hQ2xhc3NpY2FsWmlnemFnU2NhbiAgICAgICA7Ly8gTG9hZCB6aWd6YWcgdGFibGUKLSAgICAgICAgTV9TVFIgICAgICAgICAgIHBaaWd6YWdUYWJsZSxwcFppZ3phZ1RhYmxlICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOy8vIFN0b3JlIHppZ3phZyB0YWJsZSBvbiBzdGFjayB0byBwYXNzIGFzIGFyZ3VtZW50IHRvIHVuc2FmZSBmdW5jdGlvbgotICAgICAgICBMRFIgICAgICAgICAgICAgcFZsY1RhYmxlTDBMMSwgPWFybVZDTTRQMl9JbnRlclZsY0wwTDEgICAgICAgICAgICAgIDsvLyBMb2FkIG9wdGltaXplZCBWTEMgdGFibGUgd2l0aCBib3RoIEw9MCBhbmQgTD0xIGVudHJpZXMKLSAgICAgICAgTV9TVFIgICAgICAgICAgIHBWbGNUYWJsZUwwTDEscHBWbGNUYWJsZUwwTDEgICAgICAgICAgICAgICAgICAgICAgICAgICAgOy8vIFN0b3JlIG9wdGltaXplZCBWTEMgdGFibGUgYWRkcmVzcyBvbiBzdGFjawotICAgICAgICBMRFIgICAgICAgICAgICAgcExNQVhUYWJsZUwwTDEsID1hcm1WQ000UDJfSW50ZXJMMEwxTE1BWCAgICAgICAgICAgIDsvLyBMb2FkIEludGVybGVhdmVkIEw9MCBhbmQgTD0xIExNQVggVGFibGVzCi0gICAgICAgIE1fU1RSICAgICAgICAgICBwTE1BWFRhYmxlTDBMMSxwcExNQVhUYWJsZUwwTDEgICAgICAgICAgICAgICAgICAgICAgICAgIDsvLyBTdG9yZSBMTUFYIHRhYmxlIGFkZHJlc3Mgb24gc3RhY2sKLSAgICAgICAgTERSICAgICAgICAgICAgIHBSTUFYVGFibGVMMEwxLCA9YXJtVkNNNFAyX0ludGVyTDBMMVJNQVggICAgICAgICAgICA7Ly8gTG9hZCBJbnRlcmxlYXZlZCBMPTAgYW5kIEw9MSBSTUFYIFRhYmxlcwotICAgICAgICBNT1YgICAgICAgICAgICAgQ291bnQsIzAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA7Ly8gc2V0IHN0YXJ0PTAKLSAgICAgICAgTV9TVFIgICAgICAgICAgIHBSTUFYVGFibGVMMEwxLHBwUk1BWFRhYmxlTDBMMSAgICAgICAgICAgICAgICAgICAgICAgICAgOy8vIHN0b3JlIFJNQVggdGFibGUgYWRkcmVzcyBvbiBzdGFjawotICAgICAgICAgICAgICAgIAotCi0gICAgICAgIEJMICAgICAgICAgICAgICBhcm1WQ000UDJfRGVjb2RlVkxDWmlnemFnX0FDX3Vuc2FmZSAgICAgICAgICAgICAgICAgOy8vIGNhbGwgVW5zYWZlIEZ1bmN0aW9uIGZvciBWTEMgWmlnemFnIERlY29kaW5nCi0gICAgICAgICAKLSAgICAgICAKLQotICAgICAgICBNX0VORAotICAgICAgICBFTkRJRgotICAgICAgICAKLSAgICAgICAgRU5ECmRpZmYgLS1naXQgYS9tZWRpYS9saWJzdGFnZWZyaWdodC9jb2RlY3Mvb24yL2gyNjRkZWMvb214ZGwvYXJtX25lb24vdmMvbTRwMi9zcmMvb214VkNNNFAyX0RlY29kZVZMQ1ppZ3phZ19JbnRyYUFDVkxDX3MucyBiL21lZGlhL2xpYnN0YWdlZnJpZ2h0L2NvZGVjcy9vbjIv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aXREZWNfcy5oCi0KLQotICAgICAgTV9WQVJJQU5UUyBBUk0xMTM2SlMKLQotICAgICAKLQotCi0KLSAgICAgSUYgQVJNMTEzNkpTCi0gICAgIAotICAgICAgICA7Ly8gSW1wb3J0IHZhcmlvdXMgdGFibGVzIG5lZWRlZCBmb3IgdGhlIGZ1bmN0aW9uCi0KLSAgICAgICAgCi0gICAgICAgIElNUE9SVCAgICAgICAgICBhcm1WQ000UDJfSW50cmFWbGNMMEwxICAgICAgICAgICAgIDsvLyBDb250YWlucyBvcHRpbWl6ZWQgYW5kIHBhY2tlZCBWTEMgVGFibGVzIGZvciBib3RoIExhc3QgPTEgYW5kIGxhc3Q9MAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOy8vIFBhY2tlZCBpbiBSdW46TGV2ZWw6TGFzdCBmb3JtYXQKLSAgICAgICAgSU1QT1JUICAgICAgICAgIGFybVZDTTRQMl9JbnRyYUwwTDFMTUFYICAgICAgICAgICAgOy8vIENvbnRhaW5zIExNQVggdGFibGUgZW50cmllcyB3aXRoIGJvdGggTGFzdD0wIGFuZCBMYXN0PTEKLSAgICAgICAgSU1QT1JUICAgICAgICAgIGFybVZDTTRQMl9JbnRyYUwwTDFSTUFYICAgICAgICAgICAgOy8vIENvbnRhaW5zIFJNQVggdGFibGUgZW50cmllcyB3aXRoIGJvdGggTGFzdD0wIGFuZCBMYXN0PTEKLSAgICAgICAgSU1QT1JUICAgICAgICAgIGFybVZDTTRQMl9hQ2xhc3NpY2FsWmlnemFnU2NhbiAgICAgOy8vIGNvbnRhaW5zIGNsYXNzaWNhbCBaaWd6YWcgdGFibGUgZW50cmllcyB3aXRoIGRvdWJsZSB0aGUgb3JpZ2luYWwgdmFsdWVzCi0gICAgICAgIElNUE9SVCAgICAgICAgICBhcm1WQ000UDJfRGVjb2RlVkxDWmlnemFnX0FDX3Vuc2FmZQotCi07Ly9JbnB1dCBBcmd1bWVudHMKLQotcHBCaXRTdHJlYW0gICAgICAgICAgUk4gMAotcEJpdE9mZnNldCAgICAgICAgICAgUk4gMQotcERzdCAgICAgICAgICAgICAgICAgUk4gMgotUHJlZERpciAgICAgICAgICAgICAgUk4gMwotc2hvcnRWaWRlb0hlYWRlciAgICAgUk4gMwotCi07Ly9Mb2NhbCBWYXJpYWJsZXMKLQotUmV0dXJuICAgICAgICAgICAgICAgUk4gMAotCi1wVmxjVGFibGVMMEwxICAgICAgICBSTiA0Ci1wTE1BWFRhYmxlTDBMMSAgICAgICBSTiA0Ci1wUk1BWFRhYmxlTDBMMSAgICAgICBSTiA0Ci1wWmlnemFnVGFibGUgICAgICAgICBSTiA0Ci1Db3VudCAgICAgICAgICAgICAgICBSTiA2Ci0KLQotICAgICAgICAKLSAgICAgICAgOy8vIEFsbG9jYXRlIHN0YWNrIG1lbW9yeSB0byBzdG9yZSBvcHRpbWl6ZWQgVkxDLFppZ3phZywgUk1BWCwgTE1BWCBUYWJsZSBBZGRyZXNzZXMgCi0gICAgIAotICAgICAgICBNX0FMTE9DNCAgICAgICAgcHBWbGNUYWJsZUwwTDEsNAotICAgICAgICBNX0FMTE9DNCAgICAgICAgcHBMTUFYVGFibGVMMEwxLDQKLSAgICAgICAgTV9BTExPQzQgICAgICAgIHBwUk1BWFRhYmxlTDBMMSw0Ci0gICAgICAgIE1fQUxMT0M0ICAgICAgICBwcFppZ3phZ1RhYmxlLDQKLQotICAgICAgICAKLSAgICAgICAgTV9TVEFSVCBvbXhWQ000UDJfRGVjb2RlVkxDWmlnemFnX0ludHJhQUNWTEMscjEyCi0KLSAgICAgICAgTV9BUkcgICAgICAgICAgIHNob3J0VmlkZW9IZWFkZXJvblN0YWNrLDQgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDsvLyBwb2ludGVyIHRvIElucHV0IEFyZ3VtZW50IG9uIHN0YWNrICAgICAgICAgICAKLQotICAgICAgICBMRFIgICAgICAgICAgICAgcFppZ3phZ1RhYmxlLCA9YXJtVkNNNFAyX2FDbGFzc2ljYWxaaWd6YWdTY2FuICAgICA7Ly8gTG9hZCBBZGRyZXNzIG9mIHRoZSBaaWd6YWcgdGFibGUgICAgCi0gICAgICAgIEFERCAgICAgICAgICAgICBwWmlnemFnVGFibGUsIHBaaWd6YWdUYWJsZSwgUHJlZERpciwgTFNMICM2ICAgICAgICAgICA7Ly8gTG9hZGluZyBEaWZmZXJlbnQgdHlwZSBvZiB6aWd6YWcgdGFibGVzIGJhc2VkIG9uIFByZWREaXIKLSAgICAgICAKLSAgICAgICAgTV9TVFIgICAgICAgICAgIHBaaWd6YWdUYWJsZSxwcFppZ3phZ1RhYmxlICAgICAgICAgICAgICAgICAgICAgICAgICAgIDsvLyBTdG9yZSBaaWd6YWcgdGFibGUgYWRkcmVzcyBvbiBzdGFjawotICAgICAgICBMRFIgICAgICAgICAgICAgcFZsY1RhYmxlTDBMMSwgPWFybVZDTTRQMl9JbnRyYVZsY0wwTDEgICAgICAgICAgICA7Ly8gTG9hZCBvcHRpbWl6ZWQgcGFja2VkIFZMQyBUYWJsZSB3aXRoIGJvdGggTD0wIGFuZCBMPTEgZW50cmllcwotICAgICAgICBNX1NUUiAgICAgICAgICAgcFZsY1RhYmxlTDBMMSxwcFZsY1RhYmxlTDBMMSAgICAgICAgICAgICAgICAgICAgICAgICAgOy8vIFN0b3JlIFZMQyBUYWJsZSBhZGRyZXNzIG9uIHN0YWNrCi0gICAgICAgIExEUiAgICAgICAgICAgICBwTE1BWFRhYmxlTDBMMSwgPWFybVZDTTRQMl9JbnRyYUwwTDFMTUFYICAgICAgICAgIDsvLyBMb2FkIExNQVggVGFibGUKLSAgICAgICAgTV9TVFIgICAgICAgICAgIHBMTUFYVGFibGVMMEwxLHBwTE1BWFRhYmxlTDBMMSAgICAgICAgICAgICAgICAgICAgICAgIDsvLyBTdG9yZSBMTUFYIFRhYmxlIGFkZHJlc3Mgb24gU3RhY2sKLSAgICAgICAgTERSICAgICAgICAgICAgIHBSTUFYVGFibGVMMEwxLCA9YXJtVkNNNFAyX0ludHJhTDBMMVJNQVggICAgICAgICAgOy8vIExvYWQgUk1BWCBUYWJsZQotICAgICAgICBNT1YgICAgICAgICAgICAgQ291bnQsIzAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOy8vIFNldCBTdGFydD0wICAgICAgICAKLSAgICAgICAgCi0gICAgICAgIE1fU1RSICAgICAgICAgICBwUk1BWFRhYmxlTDBMMSxwcFJNQVhUYWJsZUwwTDEgICAgICAgICAgICAgICAgICAgICAgICA7Ly8gU3RvcmUgUk1BWCBUYWJsZSBhZGRyZXNzIG9uIHN0YWNrCi0gICAgICAgICAgICAgIAotCi0gICAgICAgCi0gICAgICAgIE1fTERSICAgICAgICAgICBzaG9ydFZpZGVvSGVhZGVyLHNob3J0VmlkZW9IZWFkZXJvblN0YWNrICAgICAgICAgICAgICA7Ly8gZ2V0IHRoZSBJbnB1dCBBcmd1bWVudCBmcm9tIHN0YWNrCi0KLSAgICAgICAgQkwgICAgICAgICAgICAgIGFybVZDTTRQMl9EZWNvZGVWTENaaWd6YWdfQUNfdW5zYWZlICAgICAgICAgICAgICAgOy8vIENhbGwgVW5zYWZlIEZ1bmN0aW9uCi0KLQotCi0gICAgICAgIAotICAgICAgICBNX0VORAotICAgICAgICBFTkRJRgotICAgICAgICAKLSAgICAgICAgRU5ECmRpZmYgLS1naXQgYS9tZWRpYS9saWJzdGFnZWZyaWdodC9jb2RlY3Mvb24yL2gyNjRkZWMvb214ZGwvYXJtX25lb24vdmMvbTRwMi9zcmMvb214VkNNNFAyX0RlY29kZVZMQ1ppZ3phZ19JbnRyYURDVkxDX3MucyBiL21lZGlhL2xpYnN0YWdlZnJpZ2h0L2NvZGVjcy9vbjIvaDI2NGRlYy9vbXhkbC9hcm1fbmVvbi92Yy9tNHAyL3NyYy9vbXhWQ000UDJfRGVjb2RlVkxDWmlnemFnX0ludHJhRENWTENfcy5zCmRlbGV0ZWQgZmlsZSBtb2RlIDEwMDc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YXJpb3VzIHRhYmxlcyBuZWVkZWQgZm9yIHRoZSBmdW5jdGlvbgotCi0gICAgICAgIAotICAgICAgICBJTVBPUlQgICAgICAgICAgYXJtVkNNNFAyX0ludHJhVmxjTDBMMSAgICAgICAgICAgICA7Ly8gQ29udGFpbnMgb3B0aW1pemVkIGFuZCBwYWNrZWQgVkxDIFRhYmxlcyBmb3IgYm90aCBMYXN0ID0xIGFuZCBsYXN0PTAKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDsvLyBQYWNrZWQgaW4gUnVuOkxldmVsOkxhc3QgZm9ybWF0Ci0gICAgICAgIElNUE9SVCAgICAgICAgICBhcm1WQ000UDJfSW50cmFMMEwxTE1BWCAgICAgICAgICAgIDsvLyBDb250YWlucyBMTUFYIHRhYmxlIGVudHJpZXMgd2l0aCBib3RoIExhc3Q9MCBhbmQgTGFzdD0xCi0gICAgICAgIElNUE9SVCAgICAgICAgICBhcm1WQ000UDJfSW50cmFMMEwxUk1BWCAgICAgICAgICAgIDsvLyBDb250YWlucyBSTUFYIHRhYmxlIGVudHJpZXMgd2l0aCBib3RoIExhc3Q9MCBhbmQgTGFzdD0xCi0gICAgICAgIElNUE9SVCAgICAgICAgICBhcm1WQ000UDJfYUNsYXNzaWNhbFppZ3phZ1NjYW4gICAgIDsvLyBjb250YWlucyBDTGFzc2ljYWwsIEhvcml6b250YWwsIFZlcnRpY2FsIFppZ3phZyB0YWJsZSBlbnRyaWVzIHdpdGggZG91YmxlIHRoZSBvcmlnaW5hbCB2YWx1ZXMKLSAgICAgICAgSU1QT1JUICAgICAgICAgIGFybVZDTTRQMl9hSW50cmFEQ0x1bWFDaHJvbWFJbmRleCAgOy8vIENvbnRhaW5zIE9wdGltaXplZCBEQ0x1bWEgYW5kIERDQ2hyb21hIEluZGV4IHRhYmxlIEVudHJpZXMKLSAgICAgICAgCi0KLSAgICAgICAgSU1QT1JUICAgICAgICAgIGFybVZDT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gCi0gICAgIAotICAgICAgICBNX0FMTE9DNCAgICAgICAgcHBWbGNUYWJsZUwwTDEsNAotICAgICAgICBNX0FMTE9DNCAgICAgICAgcHBMTUFYVGFibGVMMEwxLDQKLSAgICAgICAgTV9BTExPQzQgICAgICAgIHBwUk1BWFRhYmxlTDBMMSw0Ci0gICAgICAgIE1fQUxMT0M0ICAgICAgICBwcFppZ3phZ1RhYmxlLDQKLSAgICAgICAgTV9BTExPQzQgICAgICAgIHBEQ0NvZWZmLDQKLSAgICAgICAgCi0KLSAgICAgICAgCi0gICAgICAgIE1fU1RBUlQgb214VkNNNFAyX0RlY29kZVZMQ1ppZ3phZ19JbnRyYURDVkxDLHIxMgotCi0gICAgICAgIE1fQVJHICAgICAgICAgICBzaG9ydFZpZGVvSGVhZGVyb25TdGFjayw0ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDsvLyBQb2ludGVyIHRvIGFyZ3VtZW50IG9uIHN0YWNrICAKLSAgICAgICAgTV9BUkcgICAgICAgICAgIHZpZGVvQ29tcG9uc3RhY2ssNCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOy8vIFBvaW50ZXIgdG8gYXJndW1lbnQgb24gc3RhY2sKLQotICAgICAgICAKLSAgICAgICAgOy8vIERlY29kZSBEQyBDb2VmZmljaWVudAotCi0gICAgICAgIAotICAgICAgICBMRFIgICAgICAgICAgICAgcERDTHVtYUNocm9tYUluZGV4LCA9YXJtVkNNNFAyX2FJbnRyYURDTHVtYUNocm9tYUluZGV4IDsvLyBMb2FkIE9wdGltaXplZCBWTEMgVGFibGUgZm9yIEx1bWluYW5jZSBhbmQgQ2hyb21pbmFuY2UKLQotICAgICAgICA7Ly8gSW5pdGlhbGl6aW5nIHRoZSBCaXRzdHJlYW0gTWFjcm8KLQotICAgICAgICBNX0JEX0lOSVQwICAgICAgcHBCaXRTdHJlYW0sIHBCaXRPZmZzZXQsIFJCaXRTdHJlYW0sIFJCaXRCdWZmZXIsIFJCaXRDb3VudAotICAgICAgICBNX0xEUiAgICAgICAgICAgdmlkZW9Db21wLHZpZGVvQ29tcG9uc3RhY2sgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKLSAgICAgICAgTV9CRF9JTklUMSAgICAgIFQxLCBUMiwgVDIKLSAgICAgICAgQUREICAgICAgICAgICAgIHBEQ0x1bWFDaHJvbWFJbmRleCxwRENMdW1hQ2hyb21hSW5kZXgsdmlkZW9Db21wLCBMU0wgIzYgICAgICAgICAgICAgCi0gICAgICAgIE1fQkRfSU5JVDIgICAgICBUMSwgVDIsIFQyCi0gICAgCi0gICAgICAgIAotICAgICAgICBNX0JEX1ZMRCAgICAgICAgRENWYWx1ZVNpemUsVDEsVDIscERDTHVtYUNocm9tYUluZGV4LDQsMiAgICAgICAgICAgICAgICAgICAgOy8vIFZMQyBEZWNvZGUgdXNpbmcgb3B0aW1pemVkIEx1bWluYW5jZSBhbmQgQ2hyb21pbmFuY2UgVkxDIFRhYmxlCi0KLSAgICAKLSAgICAgICAKLQotRGVjb2RlREMKLSAgICAgICAgICAgICAgICAgICAgICAgICAKLSAgICAgICAgQ01QICAgICAgICAgICAgIERDVmFsdWVTaXplLCMxMiAgICAgCi0gICAgICAgIEJHVCAgICAgICAgICAgICBFeGl0RXJyb3IKLSAgICAgICAgCi0gICAgICAgIENNUCAgICAgICAgICAgICBEQ1ZhbHVlU2l6ZSwjMAotICAgICAgICBNT1ZFUSAgICAgICAgICAgRENWYWwsIzAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOy8vIElmIERDVmFsdWVTaXplIGlzIHplcm8gdGhlbiBEQyBjb2VmZiA9MAotICAgICAgICBCRVEgICAgICAgICAgICAgQUNEZWNvZGUgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOy8vIEJyYW5jaCB0byBwZXJmb3JtIEFDIENvZWZmIERlY29kaW5nCi0gICAgICAgIAotICAgICAgICBNX0JEX1ZSRUFEMTYgICAgRENWYWwsRENWYWx1ZVNpemUsVDEsVDIgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOy8vIEdldCBEQyBWYWx1ZSBGcm9tIEJpdCBzdHJlYW0KLSAgICAgICAgIAotCi0gICAgICAgIE1PViAgICAgICAgICAgICBwb3dPZlNpemUsIzEgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKLSAgICAgICAgTFNMICAgICAgICAgICAgIHBvd09mU2l6ZSxEQ1ZhbHVlU2l6ZSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDsvLyBwb3dPZlNpemU9cG93KDIsRENWYWx1ZVNpemUpCi0gICAgICAgIENNUCAgICAgICAgICAgICBEQ1ZhbCxwb3dPZlNpemUsTFNSICMxICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA7Ly8gQ29tcGFyZSBEQ1ZhbCB3aXRoIHBvd09mU2l6ZS8yIAotICAgICAgICBBRERMVCAgICAgICAgICAgRENWYWwsRENWYWwsIzEKLSAgICAgICAgU1VCTFQgICAgICAgICAgIERDVmFsLERDVmFsLHBvd09mU2l6ZSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDsvLyBJZiBMZXNzdGhhbiBwb3dPZlNpemUvMiBEQ1ZhbD1EQ1ZhbC1wb3dPZlNpemUrMQotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOy8vIEVsc2UgRENWYWw9IGZldGNoYml0cyBmcm9tIGJpdCBzdHJlYW0KLQotQ2hlY2tEQ1ZhbHVlU2l6ZQotICAgICAgICAKLSAgICAgICAgQ01QICAgICAgICAgICAgIERDVmFsdWVTaXplLCM4ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDsvLyBJZiBEQ1ZhbHVlU2l6ZSBncmVhdGVyIHRoYW4gOCBjaGVjayBtYXJrZXIgYml0Ci0KLSAgICAgICAgQkxFICAgICAgICAgICAgIEFDRGVjb2RlCi0KLSAgICAgICAgTV9CRF9SRUFEOCAgICAgIHRlbXAxLDEsVDEKLSAgICAgICAgVEVRICAgICAgICAgICAgIHRlbXAxLCMwICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDsvLyBJZiBNYXJrZXIgYml0IGlzIHplcm8gRXhpdCB3aXRoIGFuIEVycm9yIE1lc3NhZ2UKLSAgICAgICAgQkVRICAgICAgICAgICAgIEV4aXRFcnJvcgotCi0gICAgICAgIAotCi0gICAgICAgIDsvLyBEZWNvZGUgQUMgQ29lZmZpY2llbnQKLQotQUNEZWNvZGUKLQotICAgICAgICBNX1NUUiAgICAgICAgICAgRENWYWwscERDQ29lZmYgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA7Ly8gU3RvcmUgRGVjb2RlZCBEQyBDb2VmZiBvbiBTdGFjawotICAgICAgICBNX0JEX0ZJTkkgICAgICAgcHBCaXRTdHJlYW0scEJpdE9mZnNldCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA7Ly8gVGVybWluYXRpbmcgdGhlIEJpdCBzdHJlYW0gTWFjcm8KLSAgICAgICAgIAotICAgICAgICBMRFIgICAgICAgICAgICAgcFppZ3phZ1RhYmxlLCA9YXJtVkNNNFAyX2FDbGFzc2ljYWxaaWd6YWdTY2FuICAgICAgICAgIDsvLyBMb2FkIFppZ3phZyB0YWxiZSBhZGRyZXNzICAgCi0gICAgICAgIEFERCAgICAgICAgICAgICBwWmlnemFnVGFibGUsIHBaaWd6YWdUYWJsZSwgUHJlZERpciwgTFNMICM2ICAgICAgICAgICAgICAgIDsvLyBNb2RpZnkgdGhlIFppZ3phZyB0YWJsZSBhZHJlc3MgYmFzZWQgb24gUHJlZERpciAgICAgICAgICAgICAgICAKLSAgICAgICAKLSAgICAgICAgTV9TVFIgICAgICAgICAgIHBaaWd6YWdUYWJsZSxwcFppZ3phZ1RhYmxlICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOy8vIFN0b3JlIHppZ3phZyB0YWJsZSBvbiBzdGFjawotICAgICAgICBMRFIgICAgICAgICAgICAgcFZsY1RhYmxlTDBMMSwgPWFybVZDTTRQMl9JbnRyYVZsY0wwTDEgICAgICAgICAgICAgICAgIDsvLyBMb2FkIE9wdGltaXplZCBWTEMgVGFibGUgV2l0aCBib3RoIExhc3Q9MCBhbmQgTGFzdD0xIEVudHJpZXMKLSAgICAgICAgTV9TVFIgICAgICAgICAgIHBWbGNUYWJsZUwwTDEscHBWbGNUYWJsZUwwTDEgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOy8vIFN0b3JlIE9wdGltaXplZCBWTEMgVGFibGUgb24gc3RhY2sKLSAgICAgICAgTERSICAgICAgICAgICAgIHBMTUFYVGFibGVMMEwxLCA9YXJtVkNNNFAyX0ludHJhTDBMMUxNQVggICAgICAgICAgICAgICA7Ly8gTG9hZCBMTUFYIFRhYmxlCi0gICAgICAgIE1fU1RSICAgICAgICAgICBwTE1BWFRhYmxlTDBMMSxwcExNQVhUYWJsZUwwTDEgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDsvLyBTdG9yZSBMTUFYIHRhYmxlIG9uIHN0YWNrCi0gICAgICAgIExEUiAgICAgICAgICAgICBwUk1BWFRhYmxlTDBMMSwgPWFybVZDTTRQMl9JbnRyYUwwTDFSTUFYICAgICAgICAgICAgICAgOy8vIExvYWQgUk1BWCBUYWJsZQotICAgICAgICBNT1YgICAgICAgICAgICAgQ291bnQsIzEgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA7Ly8gU2V0IFN0YXJ0ID0xICAgICAgICAKLSAgICAgICAgCi0gICAgICAgIE1fU1RSICAgICAgICAgICBwUk1BWFRhYmxlTDBMMSxwcFJNQVhUYWJsZUwwTDEgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDsvLyBTdG9yZSBSTUFYIFRhYmxlIG9uIFN0YWNrCi0gICAgICAgIAotICAgICAgIAotICAgICAgICBNX0xEUiAgICAgICAgICAgc2hvcnRWaWRlb0hlYWRlcixzaG9ydFZpZGVvSGVhZGVyb25TdGFjayAgICAgICAgICAgICAgICAgICA7Ly8gTG9hZCB0aGUgSW5wdXQgQXJndW1lbnQgRnJvbSBTdGFjawotICAgICAgICAKLSAgICAgICAgQkwgICAgICAgICAgICAgIGFybVZDTTRQMl9EZWNvZGVWTENaaWd6YWdfQUNfdW5zYWZlICAgICAgICAgICAgICAgICAgICA7Ly8gQ2FsbCB0aGUgVW5zYWZlIEZ1bmN0aW9uCi0KLSAgICAgICAgTV9MRFIgICAgICAgICAgIERDVmFsLHBEQ0NvZWZmICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOy8vIEdldCB0aGUgRGVjb2RlZCBEQyBWYWx1ZSBGcm9tIFN0YWNrCi0gICAgICAgIFNUUkggICAgICAgICAgICBEQ1ZhbCxbcERzdF0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDsvLyBTdG9yZSB0aGUgREMgVmFsdWUgCi0gICAgICAgIEIgICAgICAgICAgICAgICBFeGl0T0sKLSAgICAgICAgCi0gICAgICAgICAgICAgIAotCi1FeGl0RXJyb3IKLSAKLSAgICAgICAgTV9CRF9GSU5JICAgICAgIHBwQml0U3RyZWFtLHBCaXRPZmZzZXQgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOy8vIFRlcm1pbmF0aW5nIHRoZSBCaXQgU3RyZWFtIE1hY3JvIGluIGNhc2Ugb2YgYW4gRXJyb3IKLSAgICAgICAgTU9WICAgICAgICAgICAgIFJldHVybiwjT01YX1N0c19FcnIgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOy8vIEV4aXQgd2l0aCBhbiBFcnJvci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9zLmgKLSAgICAgICAgSU5DTFVERSBhcm1WQ0NPTU1fcy5oCi0KLSAgICAgICAgOy8vIERlZmluZSBjcHUgdmFyaWFudHMKLSAgICAgICAgTV9WQVJJQU5UUyBDb3J0ZXhBOAotICAgICAgICAKLSAgICAgICAgCi0gICAgICAgIElGIENvcnRleEE4Ci0gICAgICAgIAotICAgICAgICBNX1RBQkxFIGFybVZDTTRQMl9wQmxrSW5kZXhUYWJsZQotICAgICAgICBEQ0QgIE9NWFZDQmxrMCwgT01YVkNCbGsxCi0gICAgICAgIERDRCAgT01YVkNCbGsyLCBPTVhWQ0JsazMKLQotOy8vLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0KLTsvLyBEZWNsYXJlIGlucHV0IHJlZ2lzdGVycwotOy8vLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0KLSAgICAgICAgCi1wU3JjTVZDdXJNQiAgICAgICAgICAgIFJOIDAKLXBTcmNDYW5kTVYxICAgICAgICAgICAgUk4gMQotcFNyY0NhbmRNVjIgICAgICAgICAgICBSTiAyCi1wU3JjQ2FuZE1WMyAgICAgICAgICAgIFJOIDMKLXBEc3RNVlByZWQgICAgICAgICAgICAgUk4gNAotcERzdE1WUHJlZE1FICAgICAgICAgICBSTiA1Ci1pQmxrICAgICAgICAgICAgICAgICAgIFJOIDYKLQotcFRhYmxlICAgICAgICAgICAgICAgICBSTiA0Ci1DYW5kTVYgICAgICAgICAgICAgICAgIFJOIDEyCi0KLXBDYW5kTVYxICAgICAgICAgICAgICAgUk4gNwotcENhbmRNVjIgICAgICAgICAgICAgICBSTiA4Ci1wQ2FuZE1WMyAgICAgICAgICAgICAgIFJOIDkKLQotQ2FuZE1WMWR4ICAgICAgICAgICAgICBSTiAwIAotQ2FuZE1WMWR5ICAgICAgICAgICAgICBSTiAxIAotQ2FuZE1WMmR4ICAgICAgICAgICAgICBSTiAyCi1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YW5kTVYKLSAgICAKLSAgICAgICAgU1RSICAgemVybywgW0NhbmRNVl0KLQotICAgICAgICA7Ly8gQnJhbmNoIHRvIHRoZSBjYXNlIGJhc2VkIG9uIGJsayBudW1iZXIKLSAgICAgICAgTV9TV0lUQ0ggaUJsawotICAgICAgICBNX0NBU0UgICBPTVhWQ0JsazAgICAgICA7Ly8gaUJsaz0wCi0gICAgICAgIE1fQ0FTRSAgIE9NWFZDQmxrMSAgICAgIDsvLyBpQmxrPTAKLSAgICAgICAgTV9DQVNFICAgT01YVkNCbGsyICAgICAgOy8vIGlCbGs9MAotICAgICAgICBNX0NBU0UgICBPTVhWQ0JsazMgICAgICA7Ly8gaUJsaz0wCi0gICAgICAgIE1fRU5EU1dJVENICi0gICAgICAgIAotT01YVkNCbGswCi0gICAgICAgIENNUCAgIHBTcmNDYW5kTVYxLCAjMAotICAgICAgICBBRERORSBwQ2FuZE1WMSwgcFNyY0NhbmRNVjEsICM0Ci0gICAgICAgIAotICAgICAgICBDTVAgICBwU3JjQ2FuZE1WMiwgIzAKLSAgICAgICAgQURETkUgcENhbmRNVjIsIHBTcmNDYW5kTVYyLCAjOAotCi0gICAgICAgIENNUCAgIHBTcmNDYW5kTVYzLCAjMAotICAgICAgICBBRERORSBwQ2FuZE1WMywgcFNyY0NhbmRNVjMsICM4Ci0gICAgICAgIENNUEVRIHBTcmNDYW5kTVYxLCAjMAotICAgIAotICAgICAgICBNT1ZFUSBwQ2FuZE1WMywgcENhbmRNVjIKLSAgICAgICAgTU9WRVEgcENhbmRNVjEsIHBDYW5kTVYyCi0gICAgICAgICAgICAgICAgCi0gICAgICAgIENNUCAgIHBTcmNDYW5kTVYxLCAjMAotICAgICAgICBDTVBFUSBwU3JjQ2FuZE1WMiwgIzAKLSAgICAKLSAgICAgICAgTU9WRVEgcENhbmRNVjEsIHBDYW5kTVYzCi0gICAgICAgIE1PVkVRIHBDYW5kTVYyLCBwQ2FuZE1WMwotICAgICAgICAKLSAgICAgICAgQ01QICA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ZWNzL29uMi9oMjY0ZGVjL29teGRsL2FybV9uZW9uL3ZjL200cDIvc3JjL29teFZDTTRQMl9JRENUOHg4YmxrX3MucworKysgL2Rldi9udWxsCkBAIC0xLDczICswLDAgQEAKLTsvLwotOy8vIAotOy8vIEZpbGUgTmFtZTogIG9teFZDTTRQMl9JRENUOHg4YmxrX3MucwotOy8vIE9wZW5NQVggREw6IHYxLjAuMgotOy8vIFJldmlzaW9uOiAgIDEyMjkwCi07Ly8gRGF0ZTogICAgICAgV2VkbmVzZGF5LCBBcHJpbCA5LCAyMDA4Ci07Ly8gCi07Ly8gKGMpIENvcHlyaWdodCAyMDA3LTIwMDggQVJNIExpbWl0ZWQuIEFsbCBSaWdodHMgUmVzZXJ2ZWQuCi07Ly8gCi07Ly8gCi07Ly8KLQotOy8vIEZ1bmN0aW9uOgotOy8vICAgICBvbXhWQ000UDJfSURDVDh4OGJsawotOy8vCi0gICAgICAgIDsvLyBJbmNsdWRlIGhlYWRlcnMKLSAgICAgICAgSU5DTFVERSBvbXh0eXBlc19zLmgKLSAgICAgICAgSU5DTFVERSBhcm1DT01NX3MuaAotCi0gICAgICAgIDsvLyBEZWZpbmUgY3B1IHZhcmlhbnRzCi0gICAgICAgIE1fVkFSSUFOVFMgQ29ydGV4QTgKLQotICAgICAgICBJTkNMVURFIGFybUNPTU1fSURDVF9zLmggICAgICAgIAotICAgICAgICAKLSAgICAgICAgSU1QT1JUIGFybUNPTU1fSURDVFByZVNjYWxlCi0gICAgICAgIDsvLwotICAgICAgICA7Ly8gRnVuY3Rpb24gcHJvdG90eXBlCi0gICAgICAgIDsvLwotICAgICAgICA7Ly8gICAgIE9NWFJlc3VsdAotICAgICAgICA7Ly8gICAgIG9teFZDTTRQMl9JRENUOHg4YmxrKGNvbnN0IE9NWF9TMTYqIHBTcmMsCi0gICAgICAgIDsvLyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIE9NWF9TMTYqIHBEc3QpCi0gICAgICAgIDsvLyAg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QgaGVhZGVycwotICAgIElOQ0xVREUgb214dHlwZXNfcy5oCi0gICAgSU5DTFVERSBhcm1DT01NX3MuaAotCi07Ly8gSW1wb3J0IHN5bWJvbHMgcmVxdWlyZWQgZnJvbSBvdGhlciBmaWxlcwotCi0gICAgTV9WQVJJQU5UUyBDb3J0ZXhBOAotCi07Ly8gKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCi07Ly8gQVJNMTEzNkpTIGltcGxlbWVudGF0aW9uCi07Ly8gKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCi0KLTsvLyAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKLTsvLyBDb3J0ZXhBOCBpbXBsZW1lbnRhdGlvbgotOy8vICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgotICAgIElGICBDb3J0ZXhBOAotOy8vICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgotOy8vIE1BQ1JPIERFRklOSVRJT05TCi07Ly8gKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCi0gICAgOy8vIERlc2NyaXB0aW9uOgotICAgIDsvLyBEb2VzIGludGVycG9sYXRpb24gZm9yIHRoZSBjYXNlIG9mICJJbnRlZ2VyUGl4ZWwiIHByZWRpY3RUeXBlLiBCb3RoIAotICAgIDsvLyByb3VuZGluZyBjYXNlcyBhcmUgaGFuZGxlZC4gSnVzdCBjb3BpZXMgYSBibG9jayBmcm9tIHBTcmMgdG8gcERzdAotICAgIDsvLwot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GRSb3c3LCBkUm93N1NoZnQsICMxCi0gICAgVlNUMSAgICAgICAgZFJvdzEsIFtwRHN0QDY0XSwgZHN0U3RlcAotICAgIFZFWFQgICAgICAgIGRSb3c4U2hmdCwgZFJvdzgsIGRSb3c4U2hmdCwgIzEKLSAgICBWQUREICAgICAgICBxU3VtNSwgcVN1bTUsIHFSb3VuZAotICAgIFZBREQgICAgICAgIHFTdW0yLCBxU3VtMiwgcVN1bTMKLSAgICBWQUREICAgICAgICBxU3VtMywgcVN1bTMsIHFTdW00Ci0gICAgVkFERCAgICAgICAgcVN1bTQsIHFTdW00LCBxU3VtNQotICAgIFZTSFJOICAgICAgIGRSb3cyLCBxU3VtMiwgIzIKLSAgICBWU0hSTiAgICAgICBkUm93MywgcVN1bTMsICMyCi0gICAgVlNIUk4gICAgICAgZFJvdzQsIHFTdW00LCAjMgotICAgIFZBRERMICAgICAgIHFTdW02LCBkUm93NiwgZFJvdzZTaGZ0Ci0gICAgVkFEREwgICAgICAgcVN1bTcsIGRSb3c3LCBkUm93N1NoZnQKLSAgICBWU1QxICAgICAgICBkUm93MiwgW3BEc3RANjRdLCBkc3RTdGVwCi0gICAgVkFEREwgICAgICAgcVN1bTgsIGRSb3c4LCBkUm93OFNoZnQKLSAgICBWQUREICAgICAgICBxU3VtNywgcVN1bTcsIHFSb3VuZAotICAgIFZTVDEgICAgICAgIGRSb3czLCBbcERzdEA2NF0sIGRzdFN0ZXAKLSAgICBWU1QxICAgICAgICBkUm93NCwgW3BEc3RANjRdLCBkc3RTdGVwCi0gICAgVkFERCAgICAgICAgcVN1bTUsIHFTdW01LCBxU3VtNgotICAgIFZBREQgICAgICAgIHFTdW02LCBxU3VtNiwgcVN1bTcKLSAgICBWQUREICAgICAgICBxU3VtNywgcVN1bTcsIHFTdW04Ci0gICAgVlNIUk4gICAgICAgZFJvdzUsIHFTdW01LCAjMgotICAgIFZTSFJOICAgICAgIGRSb3c2LCBxU3VtNiwgIzIKLSAgICBWU0hSTiAgICAgICBkUm93NywgcVN1bTcsICMyCi0gICAgVlNUMSAgICAgICAgZFJvdzUsIFtwRHN0QDY0XSwgZHN0U3RlcAotICAgIFZTVDEgICAgICAgIGRSb3c2LCBbcERzdEA2NF0sIGRzdFN0ZXAKLSAgICBWU1QxICAgICAgICBkUm93NywgW3BEc3RANjRdLCBkc3RTdGVwCi0KLSAgICBNRU5ECi07Ly8gKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCi0KLTsvLyBJbnB1dC9PdXRwdXQgUmVnaXN0ZXJzCi1wU3JjICAgICAgICAgICAgICAgICAgUk4gMAotc3JjU3RlcCAgICAgICAgICAgICAgIFJOIDEKLXBTcmNSZXNpZHVlICAgICAgICAgICBSTiAyCi1wRHN0ICAgICAgICAgICAgICAgICAgUk4gMwotZHN0U3RlcCAgICAgICAgICAgICAgIFJOIDQKLXByZWRpY3RUeXBlICAgICAgICAgICBSTiA1Ci1ybmRWYWwgICAgICAgICAgICAgICAgUk4gNgotCi07Ly8gTG9jYWwgU2NyYXRjaCBSZWdpc3RlcnMKLXBEc3RDb3B5ICAgICAgICAgICAgICBSTiAwCi1yZXR1cm4gICAgICAgICAgICAgICAgUk4gMAotCi07Ly8gTmVvbiBSZWdpc3RlcnMKLWRSb3cwICAgICAgICAgICAgICAgICBETiBEMC5VOAotZFJvdzBTaGZ0ICAgICAgICAgICAgIEROIEQxLlU4Ci1kUm93MSAgICAgICAgICAgICAgICAgRE4gRDIuVTgKLWRSb3cxU2hmdCAgICAgICAgICAgICBETiBEMy5VOAotZFJvdzIgICAgICAgICAgICAgICAgIEROIEQ0LlU4Ci1kUm93MlNoZnQgICAgICAgICAgICAgRE4gRDUuVTgKLWRSb3czICAgICAgICAgICAgICAgICBETiBENi5VOAotZFJvdzNTaGZ0ICAgICAgICAgICAgIEROIEQ3LlU4Ci1kUm93NCAgICAgICAgICAgICAgICAgRE4gRDguVTgKLWRSb3c0U2hmdCAgICAgICAgICAgICBETiBEOS5VOAotZFJvdzUgICAgICAgICAgICAgICAgIEROIEQxMC5VOAotZFJvdzVTaGZ0ICAgICAgICAgICAgIEROIEQxMS5VOAotZFJvdzYgICAgICAgICAgICAgICAgIEROIEQxMi5VOAotZFJvdzZTaGZ0ICAgICAgICAgICAgIEROIEQxMy5VOAotZFJvdzcgICAgICAgICAgICAgICAgIEROIEQxNC5VOAotZFJvdzdTaGZ0ICAgICAgICAgICAgIEROIEQxNS5VOAotZFJvdzggICAgICAgICAgICAgICAgIEROIEQxNi5VOAotZFJvdzhTaGZ0ICAgICAgICAgICAgIEROIEQxNy5VOAotCi0KLXFTdW0wICAgICAgICAgICAgICAgICBRTiBROS5VMTYKLXFTdW0xICAgICAgICAgICAgICAgICBRTiBRMTAuVTE2Ci1xU3VtMiAgICAgICAgICAgICAgICAgUU4gUTExLlUxNgotcVN1bTMgICAgICAgICAgICAgICAgIFFOIFExMi5VMTYKLXFTdW00ICAgICAgICAgICAgICAgICBRTiBRMTMuVTE2Ci1xU3VtNSAgICAgICAgICAgICAgICAgUU4gUTE0LlUxNgotcVN1bTYgICAgICAgICAgICAgICAgIFFOIFEwLlUxNgotcVN1bTcgICAgICAgICAgICAgICAgIFFOIFExLlUxNgotcVN1bTggICAgICAgICAgICAgICAgIFFOIFEyLlUxNgotCi1xUm91bmQgICAgICAgICAgICAgICAgUU4gUTE1LlUxNgotCi1kRHN0MCAgICAgICAgICAgICAgICAgRE4gRDAuVTgKLWREc3QxICAgICAgICAgICAgICAgICBETiBEMS5VOAotZERzdDIgICAgICAgICAgICAgICAgIEROIEQyLlU4Ci1kRHN0MyAgICAgICAgICAgICAgICAgRE4gRDMuVTgKLWREc3Q0ICAgICAgICAgICAgICAgICBETiBENC5VOAotZERzdDUgICAgICAgICAgICAgICAgIEROIEQ1LlU4Ci1kRHN0NiAgICAgICAgICAgICAgICAgRE4gRDYuVTgKLWREc3Q3ICAgICAgICAgICAgICAgICBETiBENy5VOAotCi1xUmVzMCAgICAgICAgICAgICAgICAgUU4gUTQuUzE2Ci1xUmVzMSAgICAgICAgICAgICAgICAgUU4gUTUuUzE2Ci1xUmVzMiAgICAgICAgICAgICAgICAgUU4gUTYuUzE2Ci1xUmVzMyAgICAgICAgICAgICAgICAgUU4gUTcuUzE2Ci1xUmVzNCAgICAgICAgICAgICAgICAgUU4gUTguUzE2Ci1xUmVzNSAgICAgICAgICAgICAgICAgUU4gUTkuUzE2Ci1xUmVzNiAgICAgICAgICAgICAgICAgUU4gUTEwLlMxNgotcVJlczcgICAgICAgICAgICAgICAgIFFOIFExMS5TMTYKLQotICAgIDsvLyBGdW5jdGlvbiBoZWFkZXIKLSAgICBNX1NUQVJUICAgICBvbXhWQ000UDJfTUNSZWNvbkJsb2NrLCByNiwgZDE1Ci0gICAgOy8vIERlZmluZSBzdGFjayBhcmd1bWVudHMKLSAgICBNX0FSRyAgICAgICBBcmdfZHN0U3RlcCwgICAgICAgIDQKLSAgICBNX0FSRyAgICAgICBBcmdfcHJlZGljdFR5cGUsICAgIDQKLSAgICBNX0FSRyAgICAgICBBcmdfcm5kVmFsLCAgICAgICAgIDQKLSAgICA7Ly8gTG9hZCBhcmd1bWVudCBmcm9tIHRoZSBzdGFjawotICAgIE1fTERSICAgICAgIGRzdFN0ZXAsIEFyZ19kc3RTdGVwCi0gICAgTV9MRFIgICAgICAgcHJlZGljdFR5cGUsIEFyZ19wcmVkaWN0VHlwZQotICAgIE1fTERSICAgICAgIHJuZFZhbCwgQXJnX3JuZFZhbAotICAgIEFERCAgICAgICAgIHByZWRpY3RUeXBlLCBybmRWYWwsIHByZWRpY3RUeXBlLCBMU0wgIzEKLSAgICBSU0IgICAgICAgICBybmRWYWwsIHJuZFZhbCwgIzIgICAgICAgICAgICAgIDsvLyBwcmVwYXJpbmcgcm5kVmFsIGZvciBIYWxmUGl4ZWxYWQotICAgIAotICAgIDsvLyBUaGUgZm9sbG93aW5nIGlzIGltcGxlbWVudGF0aW9uIG9mIHN3aXR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RHN0NywgW3BEc3RDb3B5QDY0XSwgZHN0U3RlcAotICAgIAotcFNyY1Jlc2lkdWVDb25kaXRpb25FbmQKLSAgICBNT1YgICAgICAgICByZXR1cm4sICNPTVhfU3RzX05vRXJyCi0KLSAgICBNX0VORAotICAgIEVORElGIDsvLyBDb3J0ZXhBOAotICAgIEVORAotOy8vICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgotOy8vIG9teFZDTTRQMl9NQ1JlY29uQmxvY2sgZW5kcwotOy8vICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgpkaWZmIC0tZ2l0IGEvbWVkaWEvbGlic3RhZ2VmcmlnaHQvY29kZWNzL29uMi9oMjY0ZGVjL29teGRsL2FybV9uZW9uL3ZjL200cDIvc3JjL29teFZDTTRQMl9QcmVkaWN0UmVjb25Db2VmSW50cmFfcy5zIGIvbWVkaWEvbGlic3RhZ2VmcmlnaHQvY29kZWNzL29uMi9oMjY0ZGVjL29teGRsL2FybV9uZW9uL3ZjL200cDIvc3JjL29teFZDTTRQMl9QcmVkaWN0UmVjb25Db2VmSW50cmFfcy5zCmRlbGV0ZWQgZmlsZSBtb2RlIDEwMDc1NQppbmRleCBhNzNmNjRhLi4wMDAwMDAwCi0tLSBhL21lZGlhL2xpYnN0YWdlZnJpZ2h0L2NvZGVjcy9vbjIvaDI2NGRlYy9vbXhkbC9hcm1fbmVvbi92Yy9tNHAyL3NyYy9vbXhWQ000UDJfUHJlZGljdFJlY29uQ29lZkludHJhX3MucworKysgL2Rldi9udWxsCkBAIC0xLDMyMCArMCwwIEBACi07ICoqKioqKioqKioKLTsgKiAKLTsgKiBGaWxlIE5hbWU6ICBvbXhWQ000UDJfUHJlZGljdFJlY29uQ29lZkludHJhX3MucwotOyAqIE9wZW5NQVggREw6IHYxLjAuMgotOyAqIFJldml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AgICAgRE4gRDMuUzE2Ci1kdGVtcDYgICAgICAgICAgICBETiBENC5TMTYKLWR0ZW1wNyAgICAgICAgICAgIEROIEQ1LlMxNgotIAotcXRlbXBQcmVkMSAgICAgICAgUU4gUTUuUzMyCi1xdGVtcFByZWQgICAgICAgICBRTiBRNS5TMTYKLQotZHRlbXBQcmVkMCAgICAgICAgRE4gRDEwLlMxNgotZHRlbXBQcmVkMSAgICAgICAgRE4gRDExLlMxNgotIAotICAKLQotICAgICAgTV9TVEFSVCAgIG9teFZDTTRQMl9QcmVkaWN0UmVjb25Db2VmSW50cmEscjExLGQxMQotCi0gICAgICA7Ly8gQXNzaWduaW5nIHBvaW50ZXJzIHRvIElucHV0IGFyZ3VtZW50cyBvbiBTdGFjawotICAgIAotICAgICAgTV9BUkcgICAgICAgICAgIHByZWRRUG9uU3RhY2ssNCAgCi0gICAgICBNX0FSRyAgICAgICAgICAgcHJlZERpcm9uU3RhY2ssNAotICAgICAgTV9BUkcgICAgICAgICAgIEFDUHJlZEZsYWdvblN0YWNrLDQKLSAgICAgIE1fQVJHICAgICAgICAgICB2aWRlb0NvbXBvblN0YWNrLDQKLSAgICAgIAotICAgICAgOy8vIERDIFByZWRpY3Rpb24KLQotICAgICAgTV9MRFIgICAgICAgICAgIHZpZGVvQ29tcCx2aWRlb0NvbXBvblN0YWNrICAgICAgICAgICAgICAgICAgICAgOy8vIExvYWQgdmlkZW9Db21wIEZyb20gU3RhY2sgICAgICAgICAgICAgICAKLSAgICAgICAgICAgIAotICAgICAgTV9MRFIgICAgICAgICAgIHByZWREaXIscHJlZERpcm9uU3RhY2sgICAgICAgICAgICAgICAgICAgICAgICAgOy8vIExvYWQgUHJlZGljdGlvbiBkaXJlY3Rpb24KLSAgICAgIDsvLyBEQyBTY2FsZXIgY2FsY3VsYXRpb24gICAKLSAgICAgIExEUiAgICAgICAgICAgICBpbmRleCwgPWFybVZDTTRQMl9EQ1NjYWxlcgotICAgICAgQUREICAgICAgICAgICAgIGluZGV4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Bjb21wYXJpc2lvbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKLSAgICAgIENNUCAgICAgICAgICAgICB0ZW1wMSwjMCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAotICAgICAgUlNCTFQgICAgICAgICAgIGFic0NvZWZmREMsdGVtcDEsIzAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOy8vIGNhbGN1bGF0ZSBhYnNvbHV0ZSB2YWwgb2YgcHJlZGljdGlvbiBjb2VmZgotICAgICAgCi0gICAgICBBREQgICAgICAgICAgICAgdGVtcCxkY1NjYWxlcixkY1NjYWxlcgotICAgICAgTERSSCAgICAgICAgICAgIHRlbXAsW3ByZWRDb2VmZlRhYmxlLHRlbXBdICAgICAgICAgICAgICAgICAgICAgOy8vIExvYWQgdmFsdWUgZnJvbSBjb2VmZiB0YWJsZSBmb3IgcGVyZm9ybWluZyBkaXZpc2lvbiB1c2luZyBtdWx0aXBsaWNhdGlvbgotICAgICAgU01VTEJCICAgICAgICAgIHRlbXBQcmVkLHRlbXAsYWJzQ29lZmZEQyAgICAgICAgICAgICAgICAgICAgICAgOy8vIHRlbXBwZWQ9cFByZWRCdWZSb3coQ29sKVswXSozMjc2Ny9kY1NjYWxlcgotICAgICAgQUREICAgICAgICAgICAgIHRlbXAzLGRjU2NhbGVyLCMxCi0gICAgICBMU1IgICAgICAgICAgICAgdGVtcFByZWQsdGVtcFByZWQsIzE1ICAgICAgICAgICAgICAgICAgICAgICAgICA7Ly8gdGVtcHBlZD1wUHJlZEJ1ZlJvdyhDb2wpWzBdL2RjU2NhbGVyICAgICAgICAgICAgICAgICAgCi0gICAgICBMU1IgICAgICAgICAgICAgdGVtcDMsdGVtcDMsIzEgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA7Ly8gdGVtcDM9cm91bmQoZGNTY2FsZXIvMikgICAgICAgICAgIAotICAgICAgTUxBICAgICAgICAgICAgIFJlbSxuZWdkY1NjYWxlcix0ZW1wUHJlZCxhYnNDb2VmZkRDICAgICAgICAgICAgOy8vIFJlbWFpbmRlciBSZW09YWJzKHBQcmVkQnVmUm93KENvbClbMF0pLXRlbXBQcmVkKmRjU2NhbGVyCi0gICAgICAKLSAgICAgIExEUkggICAgICAgICAgICBkY1Jvd2J1ZkNvZWZmLFtwUHJlZEJ1ZkNvbF0gICAgICAgICAgICAKLSAgICAgIAotICAgICAgQ01QICAgICAgICAgICAgIFJlbSx0ZW1wMyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOy8vIGNvbXBhcmUgUmVtIHdpdGggKGRjU2NhbGVyLzIpCi0gICAgICBBRERHRSAgICAgICAgICAgdGVtcFByZWQsIzEgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA7Ly8gdGVtcFByZWQ9dGVtcFByZWQrMSBpZiBSZW0+PShkY1NjYWxlci8yKQotICAgICAgQ01QICAgICAgICAgICAgIHRlbXAxLCMwCi0gICAgICBSU0JMVCAgICAgICAgICAgdGVtcFByZWQsdGVtcFByZWQsIzAgICAgICAgICAgICAgICAgICAgICAgICAgICA7Ly8gdGVtcFByZWQ9LXRlbXBQcmVkIGlmIAotICAgICAgIAotICAgICAgU1RSSCAgICAgICAgICAgIGRjUm93YnVmQ29lZmYsW3BQcmVkQnVmUm93LCMtMTZdICAgICAgCi0gICAgICAgCi0KLSAgICAgIExEUkggICAgICAgICAgICB0ZW1wLFtwU3JjRHN0XSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDsvLyB0ZW1wPXBTcmNEc3RbMF0KLSAgICAgIEFERCAgICAgICAgICAgICB0ZW1wLHRlbXAsdGVtcFByZWQgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDsvLyB0ZW1wPXBTcmNEc3RbMF0rdGVtcFByZWQKLSAgICAgIFNTQVQxNiAgICAgICAgICB0ZW1wLCMxMix0ZW1wICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDsvLyBjbGlwIHRlbXAgdG8gWy0yMDQ4LDIwNDddCi0gICAgICBTTVVMQkIgICAgICAgICAgZGNDb2xCdWZmQ29lZmYsdGVtcCxkY1NjYWxlciAgICAgICAgICAgICAgICAgICA7Ly8gdGVtcDE9Y2xpcHBlZChwU3JjRHN0WzBdKSpkY1NjYWxlciAgICAgICAgICAgCi0gICAgICBNX0xEUiAgICAgICAgICAgQUNQcmVkRmxhZyxBQ1ByZWRGbGFnb25TdGFjawotICAgICAgU1RSSCAgICAgICAgICAgIGRjQ29sQnVmZkNvZWZmLFtwUHJlZEJ1ZkNvbF0gICAgICAKLSAgICAgIAotCi0gICAgICAgOy8vIEFDIFByZWRpY3Rpb24KLSAgICAgIAotICAgICAgTV9MRFIgICAgICAgICAgIHByZWRRUCxwcmVkUVBvblN0YWNrCi0gICAgICAKLSAgICAgIENNUCAgICAgICAgICAgICBBQ1ByZWRGbGFnLCMxICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDsvLyBDaGVjayBpZiB0aGUgQUMgcHJlZGljdGlvbiBmbGFnIGlzIHNldCBvciBub3QKLSAgICAgIEJORSAgICAgICAgICAgICBFeGl0ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDsvLyBJZiBub3Qgc2V0IEV4aXQKLSAgICAgIENNUCAgICAgICAgICAgICBwcmVkRGlyLCMyICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDsvLyBDaGVjayB0aGUgUHJlZGljdGlvbiBkaXJlY3Rpb24gICAgICAgICAgICAgICAgICAgICAgIAotICAgICAgTERSICAgICAgICAgICAgIHByZWRDb2VmZlRhYmxlLCA9YXJtVkNNNFAyX1JlY2lwcm9jYWxfUVBfUzMyICAgOy8vIExvYWRpbmcgdGhlIHRhYmxlIHdpdGggZW50cmllcyAweDFmZmZmLygxIHRvIDYzKSAKLSAgICAgIE1PViAgICAgICAgICAgICBDb25zdCwjNAotICAgICAgTVVMICAgICAgICAgICAgIGN1clFQLGN1clFQLENvbnN0ICAgICAgIC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T1YgICAgICAgICAgICBkdGVtcFByZWQwLGRQcmVkUVAxCi0gICAgICAKLSAgICAgIDsvL3VwZGF0aW5nIHNvdXJjZSBhbmQgcm93IHByZWRpY3Rpb24gYnVmZmVyIGNvbnRlbnRzICAgICAgCi0gICAgICBWQUREICAgICAgICAgICAgcXRlbXAscXRlbXAscXRlbXBQcmVkICAgICAgICAgICAgICAgICAgICAgICAgICA7Ly9wU3JjRHN0W2ldPXBTcmNEc3RbaV0rcXRlbXBQcmVkW2ldOiBpPTAgdG8gNyAKLSAgICAgIFZRU0hMICAgICAgICAgICBxdGVtcCxxdGVtcCwjNCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDsvL0NsaXAgdG8gWy0yMDQ4LDIwNDddCi0gICAgICBMRFJIICAgICAgICAgICAgZGNSb3didWZDb2VmZixbcFByZWRCdWZSb3ddICAgICAgICAgICAgICAgICAgICA7Ly9Mb2FkaW5nIERjIFZhbHVlIG9mIFJvdyBQcmVkaWN0aW9uIGJ1ZmZlcgotICAgICAgVlNIUiAgICAgICAgICAgIHF0ZW1wLHF0ZW1wLCM0Ci0gICAgICAKLSAgICAgIFZTVDEgICAgICAgICAgICB7ZHRlbXAwLGR0ZW1wMX0sW3BTcmNEc3RdICAgICAgICAgICAgICAgICAgICAgIDsvL3N0b3JpbmcgYmFjayB0aGUgdXBkYXRlZCB2YWx1ZXMgCi0gICAgICBWU1QxICAgICAgICAgICAge2R0ZW1wMCxkdGVtcDF9LFtwUHJlZEJ1ZlJvd10gICAgICAgICAgICAgICAgICA7Ly9zdG9yaW5nIGJhY2sgdGhlIHVwZGF0ZWQgcm93IHByZWRpY3Rpb24gdmFsdWVzICAgICAgICAgICAgICAgICAgICAgIAotICAgICAgU1RSSCAgICAgICAgICAgIGRjUm93YnVmQ29lZmYsW3BQcmVkQnVmUm93XSAgICAgICAgICAgICAgICAgICAgOy8vIHN0b3JpbmcgdGhlIHVwZGF0ZWQgREMgUm93IFByZWRpY3Rpb24gY29lZmYK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XRzCi0gICAgICAKLSAgICAgIAotICAgICAgVk1VTCAgICAgICAgICAgIHF0ZW1wUHJlZDEscXRlbXAxLHFDb2VmZlRhYiAgICAgICAgICAgICAgICAgICAgOy8vcXRlbXBQcmVkMVtpXT1wUHJlZEJ1ZkNvbFtpXSpkUHJlZFFQW2ldKjB4MWZmZmYvY3VyUVAgOiBpPTQgdDAgNwotICAgICAgCi0gICAgICBNT1YgICAgICAgICAgICAgdGVtcHBQcmVkQ29sQnVmLHBQcmVkQnVmQ29sCi0gICAgICBWUlNIUiAgICAgICAgICAgcXRlbXBQcmVkMSxxdGVtcFByZWQxLCMxNyAgICAgICAgICAgICAgICAgICAgICA7Ly9xdGVtcFByZWQxW2ldPXJvdW5kKHBQcmVkQnVmQ29sW2ldKmRQcmVkUVBbaV0vY3VyUVApICA6IGk9NCB0MCA3Ci0gICAgICBWTEQ0ICAgICAgICAgICAge2R0ZW1wMCxkdGVtcDEsZHRlbXAyLGR0ZW1wM30sW3BTcmNEc3RdICAgICAgICA7Ly8gTG9hZGluZyBjb2VmZmljaWVudHMgSW50ZXJsZWF2aW5nIGJ5IDQKLSAgICAgIFZTSFJOICAgICAgICAgICBkdGVtcFByZWQxLHF0ZW1wUHJlZDEsIzAgICAgICAgICAgICAgICAgICAgICAgIDsvLyBuYXJyb3cgcXRlbXBQcmVkMVtpXSB0byAxNiBiaXRzCi0gICAgICBWTU9WICAgICAgICAgICAgZHRlbXBQcmVkMCxkUHJlZFFQMQotICAgICAgCi0gICAgICA7Ly8gVXBkYXRpbmcgc291cmNlIGFuZCBjb2x1bW4gcHJlZGljdGlvbiBidWZmZXIgY29udGVudHMgICAgIAotICAgICAgQUREICAgICAgICAgICAgIHRlbXAyLHBTcmNEc3QsIzMyICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAotICAgICAgVkxENCAgICAgICAgICAgIHtkdGVtcDQsZHRlbXA1LGR0ZW1wNixkdGVtcDd9LFt0ZW1wMl0gICAgICAgICAgOy8vIExvYWRpbmcgbmV4dCAxNiBjb2VmZmljaWVudHMgSW50ZXJsZWF2aW5nIGJ5IDQKLSAgICAgIFZVWlAgICAgICAgICAgICBkdGVtcDAsZHRlbXA0ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDsvLyBJbnRlcmxlYXZpbmcgYnkgOAotICAgICAgVkFERCAgICAgICAgICAgIGR0ZW1wMCxkdGVtcDAsZHRlbXBQcmVkMCAgICAgICAgICAgICAgICAgICAgICAgOy8vIEFkZGluZyB0ZW1wUHJlZCB0byBjb2VmZnMKLSAgICAgIFZRU0hMICAgICAgICAgICBkdGVtcDAsZHRlbXAwLCM0ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDsvLyBDbGlwIHRvIFstMjA0OCwyMDQ3XQotICAgICAgVlNIUiAgICAgICAgICAgIGR0ZW1wMCxkdGVtcDAsIzQKLSAgICAgIFZTVDEgICAgICAgICAgICB7ZHRlbXAwfSxbcFByZWRCdWZDb2xdISAgICAgICAgICAgICAgICAgICAgICAgIDsvLyBVcGRhdGluZyBQcmlkaWN0aW9uIGNvbHVtbiBidWZmZXIKLSAgICAgIFZaSVAgICAgICAgICAgICBkdGVtcDAsZHRlbXA0ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDsvLyBkZWludGVybGVhdmluZwotICAgICAgVlNUNCAgICAgICAgICAgIHtkdGVtcDAsZHRlbXAxLGR0ZW1wMixkdGVtcDN9LFtwU3JjRHN0XSAgICAgICAgOy8vIFVwZGF0aW5nIHNvdXJjZSBjb2VmZnMgICAgICAgICAKLSAgICAgIFZTVDQgICAgICAgICAgICB7ZHRlbXA0LGR0ZW1wNSxkdGVtcDYsZHRlbXA3fSxbdGVtcDJdIQotICAgICAgCi0gICAgICBNT1YgICAgICAgICAgICAgdGVtcDEsdGVtcDIgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCi0gICAgICBWTEQ0ICAgICAgICAgICAge2R0ZW1wMCxkdGVtcDEsZHRlbXAyLGR0ZW1wM30sW3RlbXAyXSEgICAgICAgICA7Ly8gTG9hZGluZyAgY29lZmZpY2llbnRzIEludGVybGVhdmluZyBieSA0Ci0gICAgICAKLSAgICAgIFZMRDQgICAgICAgICAgICB7ZHRlbXA0LGR0ZW1wNSxkdGVtcDYsZHRlbXA3fSxbdGVtcDJdCi0gICAgICBWVVpQICAgICAgICAgICAgZHRlbXAwLGR0ZW1wNCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA7Ly8gSW50ZXJsZWF2aW5nIGJ5IDgKLSAgICAgIFZBREQgICAgICAgICAgICBkdGVtcDAsZHRlbXAwLGR0ZW1wUHJlZDEKLSAgICAgIFZRU0hMICAgICAgICAgICBkdGVtcDAsZHRlbXAwLCM0ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDsvLyBDbGlwIHRvIFstMjA0OCwyMDQ3XQotICAgICAgVlNIUiAgICAgICAgICAgIGR0ZW1wMCxkdGVtcDAsIzQKLSAgICAgIFZTVDEgICAgICAgICAgICB7ZHRlbXAwfSxbcFByZWRCdWZDb2xdIQotICAgICAgVlpJUCAgICAgICAgICAgIGR0ZW1wMCxkdGVtcDQKLSAgICAgIFZTVDQgICAgICAgICAgICB7ZHRlbXAwLGR0ZW1wMSxkdGVtcDIsZHRlbXAzfSxbdGVtcDFdCi0gICAgICBTVFJIICAgICAgICAgICAgZGNDb2xCdWZmQ29lZmYsW3RlbXBwUHJlZENvbEJ1Zl0gCi0gICAgICBWU1Q0ICAgICAgICAgICAge2R0ZW1wNCxkdGVtcDUsZHRlbXA2LGR0ZW1wN30sW3RlbXAyXQotICAgICAgCi1FeGl0Ci0KLSAgICAgIFNUUkggICAgICAgICAgICB0ZW1wLFtwU3JjRHN0XQotICAgICAgICAgIAotIAotICAgICAgTU9WICAgICAgICAgICAgIFJldHVybiwjT01YX1N0c19Ob0VyciAKLSAKLSAgICAgIE1fRU5ECi0gICAgICBFTkRJRgotCi0KLSAgICAgICBFTkQKLQotCi0gICAK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dXJuICAgICAgICAgICAgIFJOIDAKLTsvLyBOZW9uIHJlZ2lzdGVycwotCi0KLWRRUDEwICAgICAgICAgICAgICBETiBEMC5TMzJbMF0KLXFRUDEgICAgICAgICAgICAgICBRTiBRMC5TMzIKLQotZFFQMSAgICAgICAgICAgICAgIEROIEQwLlMxNgotZE1pbnVzUVAxICAgICAgICAgIEROIEQxLlMxNgotCi1kQ29lZmYwICAgICAgICAgICAgRE4gRDIuUzE2Ci1kQ29lZmYxICAgICAgICAgICAgRE4gRDMuUzE2ICAgCi0KLXFSZXN1bHQwICAgICAgICAgICBRTiBRMy5TMzIKLWRSZXN1bHQwICAgICAgICAgICBETiBENy5TMTYKLXFTaWduMCAgICAgICAgICAgICBRTiBRMy5TMzIKLWRTaWduMCAgICAgICAgICAgICBETiBENi5TMTYKLQotcVJlc3VsdDEgICAgICAgICAgIFFOIFE0LlMzMgotZFJlc3VsdDEgICAgICAgICAgIEROIEQ4LlMxNgotcVNpZ24xICAgICAgICAgICAgIFFOIFE0LlMzMgotZFNpZ24xICAgICAgICAgICAgIEROIEQ4LlMxNgotCi1kMlFQMCAgICAgICAgICAgICAgRE4gRDEwLlMzMlswXQotcTJRUDAgICAgICAgICAgICAgIFFOIFE1LlMzMgotZDJRUCAgICAgICAgICAgICAgIEROIEQxMC5TMTYKLQotZFplcm8wICAgICAgICAgICAgIEROIEQxMS5TMTYKLWRaZXJvMSAgICAgICAgICAgICBETiBEMTIuUzE2Ci1kQ29uc3QwICAgICAgICAgICAgRE4gRDEzLlMxNgotCi0gICAgCi0gICAgIE1fU1RBUlQgb214VkNNNFAyX1F1YW50SW52SW50ZXJfSSxyNCxkMTMKLSAgICAgCi0gICAgICAgICAKLSAgICAgICAgIAotICAgICAgICAgQUREICAgICAgZG91YmxlUVAsUVAsUVAgICAgICAgICAgICAgICAgICAgOy8vIGRvdWJsZVFQPSAyKlFQCi0gICAgICAgICBWTU9WICAgICBkMlFQMCxkb3VibGVRUAotICAgICAgICAgVkRVUCAgICAgcTJRUDAsZDJRUDAgICAgICAgICAgICAgICAgICAgICAgOy8vIE1vdmUgZG91YmxlUVAgaW4gdG8gYSBzY2FsYXIKLSAgICAgICAgIFRTVCAgICAgIFFQLCMxICAgICAgICAgICAgICAgICAgIAotICAgICAgICAgVkxEMSAgICAge2RDb2VmZjAsZENvZWZmMX0sW3BTcmNEc3RdICAgICAgOy8vIExvYWQgZmlyc3QgOCB2YWx1ZXMgdG8gQ29lZmYwLENvZWZmMQotICAgICAgICAgU1VCRVEgICAgUVAsUVAsIzEgICAgICAgICAgICAgICAgICAgICAgICAgICAgCi0gICAgICAgICBWTU9WICAgICBkUVAxMCxRUCAgICAgICAgICAgICAgICAgICAgICAgICA7Ly8gSWYgUVAgaXMgZXZlbiB0aGVuIFFQMT1RUC0xIGVsc2UgUVAxPVFQICAgICAKLSAgICAgICAgIE1PViAgICAgIENvdW50LCM2NAotICAgICAgICAgVkRVUCAgICAgcVFQMSxkUVAxMCAgICAgICAgICAgICAgICAgICAgICAgOy8vIER1cGxpY2F0ZSB0ZW1wUmVzdWx0IHdpdGggUVAxCi0gICAgICAgICBWU0hSTiAgICBkMlFQLHEyUVAwLCMwCi0gICAgICAgICBWRU9SICAgICBkQ29uc3QwLGRDb25zdDAsZENvbnN0MAotICAgICAgICAgVlNIUk4gICAgZFFQMSxxUVAxLCMwICAgICAgICAgICAgICAgICAgICAgOy8vIFFQMSB0cnVuY2F0ZWQgdG8gMTYgYml0cwotICAgICAgICAgVlNVQiAgICAgZE1pbnVzUVAxLGRDb25zdDAsZFFQMSAgICAgICAgICAgOy8vIGRNaW51c1FQMT0tUVAxCi0KLUxvb3AgICAgICAgICAgICAgICAgICAgICAgIAotICAgICAgICAgCi0gICAgICAgIDsvL1BlcmZvcm1pbmcgSW52ZXJzZSBRdWFudGl6YXRpb24KLSAgICAgICAgIAotICAgICAgICAgVkNMVCAgICAgZFNpZ24wLGRDb2VmZjAsICMwICAgICAgICAgICAgICAgOy8vIENvbXBhcmUgQ29lZmZpY2llbnQgMCBhZ2FpbnN0IDAKLSAgICAgICAgIFZDTFQgICAgIGRTaWduMSxkQ29lZmYxLCAjMCAgICAgICAgICAgICAgIDsvLyBDb21wYXJlIENvZWZmaWNpZW50IDEgYWdhaW5zdCAwCi0gICAgICAgICBWQ0VRICAgICBkWmVybzAsZENvZWZmMCwjMCAgICAgICAgICAgICAgICA7Ly8gQ29tcGFyZSBDb2VmZmljaWVudCAwIGFnYWluc3QgemVybwotICAgICAgICAgVkJTTCAgICAgZFNpZ24wLGRNaW51c1FQMSxkUVAxICAgICAgICAgICAgOy8vIGRTaWduMCA9IC1RUDEgaWYgQ29lZmYwPCAwIGVsc2UgUVAxCi0gICAgICAgICBWQ0VRICAgICBkWmVybzEsZENvZWZmMSwjMCAgICAgICAgICAgICAgICA7Ly8gQ29tcGFyZSBDb2VmZmljaWVudCAxIGFnYWluc3QgemVybwotICAgICAgICAgVkJTTCAgICAgZFNpZ24xLGRNaW51c1FQMSxkUVAxICAgICAgICAgICAgOy8vIGRTaWduMSA9IC1RUDEgaWYgQ29lZmYxPCAwIGVsc2UgUVAxCi0gICAgICAgICBWTU9WTCAgICBxU2lnbjAsZFNpZ24wICAgICAgICAgICAgICAgICAgICA7Ly8gU2lnbiBleHRlbmQgcVNpZ24wIHRvIDMyIGJpdHMKLSAgICAgICAgIFZNT1ZMICAgIHFTaWduMSxkU2lnbjEKLSAgICAgICAgIFZNTEFMICAgIHFSZXN1bHQwLGRDb2VmZjAsZDJRUCAgICAgICAgICAgIDsvLyBxUmVzdWx0MFtpXT0gcUNvZWZmMFtpXStxQ29lZmYwW2ldKigtMikgaWYgQ29lZmYgPDAgCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA7Ly8gcVJlc3VsdDBbaV09IHFDb2VmZjBbaV0gICAgICAgICAgICAgICAgIGlmIENvZWZmID49MCAKLSAgICAgICAgIFZNTEFMICAgIHFSZXN1bHQxLGRDb2VmZjEsZDJRUCAgICAgICAgICAgIDsvLyBxUmVzdWx0MVtpXT0gcUNvZWZmMVtpXStxQ29lZmYxW2ldKigtMikgaWYgQ29lZmYgPDAgCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA7Ly8gcVJlc3VsdDFbaV09IHFDb2VmZjFbaV0gICAgICAgICAgICAgICAgIGlmIENvZWZmID49MCAKLSAgICAgICAgIDsvLyBDbGlwIFJlc3VsdCB0byBbLTIwNDgsMjA0N10gICAgICAgICAgICAgICAgICAgICAKLSAgICAgICAgIAotICAgICAgICAgVlFTSEwgICAgcVJlc3VsdDAscVJlc3VsdDAsIzIwICAgICAgICAgICAgOy8vIGNsaXAgdG8gWy0yMDQ4LDIwNDddCi0gICAgICAgICBWUVNITCAgICBxUmVzdWx0MSxxUmVzdWx0MSwjMjAKLSAgICAgICAgICAgICAgICAgCi0gICAgICAgICBWU0hSICAgICBxUmVzdWx0MCxxUmVzdWx0MCwjNCAgCi0gICAgICAgICBWU0hSICAgICBxUmVzdWx0MSxxUmVzdWx0MSwjNAotICAgICAgICAgVlNIUk4gICAgZFJlc3VsdDAscVJlc3VsdDAsIzE2ICAgICAgICAgICAgOy8vIE5hcnJvdyB0aGUgY2xpcHBlZCBWYWx1ZSB0byBIYWxmd29yZAotICAgICAgICAgVlNIUk4gICAgZFJlc3VsdDEscVJlc3VsdDEsIzE2IAotICAgICAgICAgVkJJVCAgICAgZFJlc3VsdDAsZENvbnN0MCxkWmVybzAgIAotICAgICAgICAgVkJJVCAgICAgZFJlc3VsdDEsZENvbnN0MCxkWmVybzEgICAgIAotICAgICAgICAgCi0gICAgICAgICBWU1QxICAgICB7ZFJlc3VsdDAsZFJlc3VsdDF9LFtwU3JjRHN0XSEgICA7Ly8gU3RvcmUgdGhlIHJlc3VsdAotICAgICAgICAgU1VCUyAgICAgQ291bnQsQ291bnQsIzgKLSAgICAgICAgIFZMRDEgICAgIHtkQ29lZmYwLGRDb2VmZjF9LFtwU3JjR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JUICAgICAgICBhcm1WQ000UDJfRENTY2FsZXIKLSAKLSAgICAgSUYgQ29ydGV4QTgKLSAgICAgCi0gICAgIAotOy8vSW5wdXQgQXJndW1lbnRzCi1wU3JjRHN0ICAgICAgICAgICAgUk4gMAotUVAgICAgICAgICAgICAgICAgIFJOIDEKLXZpZGVvQ29tcCAgICAgICAgICBSTiAyCi1zaG9ydFZpZGVvSGVhZGVyICAgUk4gMwotICAgICAKLQotOy8vTG9jYWwgVmFyaWFibGVzCi0KLWRjU2NhbGVyICAgICAgICAgICBSTiA0Ci10ZW1wICAgICAgICAgICAgICAgUk4gMTQKLWluZGV4ICAgICAgICAgICAgICBSTiA1Ci0KLQotQ291bnQgICAgICAgICAgICAgIFJOIDUKLWRvdWJsZVFQICAgICAgICAgICBSTiA0Ci1SZXR1cm4gICAgICAgICAgICAgUk4gMAotCi0KLTsvLyBOZW9uIHJlZ2lzdGVycwotCi0KLWRRUDEwICAgICAgICAgICAgICBETiBEMC5TMzJbMF0KLXFRUDEgICAgICAgICAgICAgICBRTiBRMC5TMzIKLQotZFFQMSAgICAgICAgICAgICAgIEROIEQwLlMxNgotZE1pbnVzUVAxICAgICAgICAgIEROIEQxLlMxNgotCi1kQ29lZmYwICAgICAgICAgICAgRE4gRDIuUzE2Ci1kQ29lZmYxICAgICAgICAgICAgRE4gRDMuUzE2ICAgCi0KLXFSZXN1bHQwICAgICAgICAgICBRTiBRMy5TMzIKLWRSZXN1bHQwICAgICAgICAgICBETiBENy5TMTYKLXFTaWduMCAgICAgICAgICAgICBRTiBRMy5TMzIKLWRTaWduMCAgICAgICAgICAgICBETiBENi5TMTYKLQotcVJlc3VsdDEgICAgICAgICAgIFFOIFE0LlMzMgotZFJlc3VsdDEgICAgICAgICAgIEROIEQ4LlMxNgotcVNpZ24xICAgICAgICAgICAgIFFOIFE0LlMzMgotZFNpZ24xICAgICAgICAgICAgIEROIEQ4LlMxNgotCi1kMlFQMCAgICAgICAgICAgICAgRE4gRDEwLlMzMlswXQotcTJRUDAgICAgICAgICAgICAgIFFOIFE1LlMzMgotZDJRUCAgICAgICAgICAgICAgIEROIEQxMC5TMTYKLQotZFplcm8wICAgICAgICAgICAgIEROIEQxMS5TMTYKLWRaZXJvMSAgICAgICAgICAgICBETiBENC5TMTYKLWRDb25zdDAgICAgICAgICAgICBETiBENS5TMTYKLQotCi0KLQotICAgICAKLSAgICAgCi0gICAgIE1fU1RBUlQgb214VkNNNFAyX1F1YW50SW52SW50cmFfSSxyNSxkMTEKLQotCi0gICAgICAgIDsvLyBQZXJmb3JtIEludmVyc2UgUXVhbnRpemF0aW9uIGZvciBEQyBjb2VmZmljaWVudAotCi0gICAgICAgIFRFUSAgICAgICBzaG9ydFZpZGVvSGVhZGVyLCMwICAgICAgOy8vIFRlc3QgaWYgc2hvcnQgVmlkZW8gSGVhZGVyIGZsYWcgPTAgICAgICAgICAgICAgCi0gICAgICAgIE1PVk5FICAgICBkY1NjYWxlciwjOCAgICAgICAgICAgICAgOy8vIGlmIHNob3J0VmlkZW9IZWFkZXIgaXMgbm9uIHplcm8gZGNTY2FsZXI9OAotICAgICAgICBCTkUgICAgICAgY2FsRENWYWwKLSAgICAgICAgCi0gICAgICAgIExEUiAgICAgICBpbmRleCwgPWFybVZDTTRQMl9EQ1NjYWxlcgotICAgICAgQUREICAgICAgIGluZGV4LGluZGV4LHZpZGVvQ29tcCxMU0wgIzUKLSAgICAgIExEUkIgICAgICBkY1NjYWxlcixbaW5kZXgsUVBdCi0KLSAgICAgICAgOy8vTV9DYWxEQ1NjYWxhciAgc2hvcnRWaWRlb0hlYWRlcix2aWRlb0NvbXAsIFFQCi0KLWNhbERDVmFsCi0KLSAgICAgICAgTERSSCAgICAgdGVtcCxbcFNyY0RzdF0KLSAgICAgICAgU01VTEJCICAgdGVtcCx0ZW1wLGRjU2NhbGVyICAgICAgIDsvLyBkY0NvZWZmID0gZGNTY2FsZXIgKiBRdWFudGl6ZWQgREMgY29lZmZpY2llbnQoZnJvbSBtZW1vcnkpCi0gICAgICAgIFNTQVQgICAgIHRlbXAsIzEyLHRlbXAgICAgICAgICAgICA7Ly8gU2F0dXJhdGluZyB0byAxMiBiaXRzCi0gICAgICAKLQotCi0gICAgICAgIDsvLyBQZXJmb3JtIEludmVyc2UgUXVhbnRpemF0aW9uIGZvciBBYyBDb2VmZmljaWVudHMKLSAgICAgCi0gICAgICAgICAKLSAgICAgICAgIAotICAgICAgICAgQUREICAgICAgZG91YmxlUVAsUVAsUVAgICAgICAgICAgICAgICAgICAgOy8vIGRvdWJsZVFQPSAyKlFQCi0gICAgICAgICBWTU9WICAgICBkMlFQMCxkb3VibGVRUAotICAgICAgICAgVkRVUCAgICAgcTJRUDAsZDJRUDAgICAgICAgICAgICAgICAgICAgICAgOy8vIE1vdmUgZG91YmxlUVAgaW4gdG8gYSBzY2FsYXIKLSAgICAgICAgIFRTVCAgICAgIFFQLCMxICAgICAgICAgICAgICAgICAgIAotICAgICAgICAgVkxEMSAgICAge2RDb2VmZjAsZENvZWZmMX0sW3BTcmNEc3RdICAgICAgOy8vIExvYWQgZmlyc3QgOCB2YWx1ZXMgdG8gQ29lZmYwLENvZWZmMQotICAgICAgICAgU1VCRVEgICAgUVAsUVAsIzEgICAgICAgICAgICAgICAgICAgICAgICAgICAgCi0gICAgICAgICBWTU9WICAgICBkUVAxMCxRUCAgICAgICAgICAgICAgICAgICAgICAgICA7Ly8gSWYgUVAgaXMgZXZlbiB0aGVuIFFQMT1RUC0xIGVsc2UgUVAxPVFQICAgICAKLSAgICAgICAgIE1PViAgICAgIENvdW50LCM2NAotICAgICAgICAgVkRVUCAgICAgcVFQMSxkUVAxMCAgICAgICAgICAgICAgICAgICAgICAgOy8vIER1cGxpY2F0ZSB0ZW1wUmVzdWx0IHdpdGggUVAxCi0gICAgICAgICBWU0hSTiAgICBkMlFQLHEyUVAwLCMwCi0gICAgICAgICBWRU9SICAgICBkQ29uc3QwLGRDb25zdDAsZENvbnN0MAotICAgICAgICAgVlNIUk4gICAgZFFQMSxxUVAxLCMwICAgICAgICAgICAgICAgICAgICAgOy8vIFFQMSB0cnVuY2F0ZWQgdG8gMTYgYml0cwotICAgICAgICAgVlNVQiAgICAgZE1pbnVzUVAxLGRDb25zdDAsZFFQMSAgICAgICAgICAgOy8vIGRNaW51c1FQMT0tUVAxCi0KLUxvb3AgICAgICAgICAgICAgICAgICAgICAgIAotICAgICAgICAgCi0gICAgICAgIDsvL1BlcmZvcm1pbmcgSW52ZXJzZSBRdWFudGl6YXRpb24KLSAgICAgICAgIAotICAgICAgICAgVkNMVCAgICAgZFNpZ24wLGRDb2VmZjAsICMwICAgICAgICAgICAgICAgOy8vIENvbXBhcmUgQ29lZmZpY2llbnQgMCBhZ2FpbnN0IDAKLSAgICAgICAgIFZDTFQgICAgIGRTaWduMSxkQ29lZmYxLCAjMCAgICAgICAgICAgICAgIDsvLyBDb21wYXJlIENvZWZmaWNpZW50IDEgYWdhaW5zdCAwCi0gICAgICAgICBWQ0VRICAgICBkWmVybzAsZENvZWZmMCwjMCAgICAgICAgICAgICAgICA7Ly8gQ29tcGFyZSBDb2VmZmljaWVudCAwIGFnYWluc3QgemVybwotICAgICAgICAgVkJTTCAgICAgZFNpZ24wLGRNaW51c1FQMSxkUVAxICAgICAgICAgICAgOy8vIGRTaWduMCA9IC1RUDEgaWYgQ29lZmYwPCAwIGVsc2UgUVAxCi0gICAgICAgICBWQ0VRICAgICBkWmVybzEsZENvZWZmMSwjMCAgICAgICAgICAgICAgICA7Ly8gQ29tcGFyZSBDb2VmZmljaWVudCAxIGFnYWluc3QgemVybwotICAgICAgICAgVkJTTCAgICAgZFNpZ24xLGRNaW51c1FQMSxkUVAxICAgICAgICAgICAgOy8vIGRTaWduMSA9IC1RUDEgaWYgQ29lZmYxPCAwIGVsc2UgUVAxCi0gICAgICAgICBWTU9WTCAgICBxU2lnbjAsZFNpZ24wICAgICAgICAgICAgICAgICAgICA7Ly8gU2lnbiBleHRlbmQgcVNpZ24wIHRvIDMyIGJpdHMKLSAgICAgICAgIFZNT1ZMICAgIHFTaWduMSxkU2lnbjEKLSAgICAgICAgIFZNTEFMICAgIHFSZXN1bHQwLGRDb2VmZjAsZDJRUCAgICAgICAgICAgIDsvLyBxUmVzdWx0MFtpXT0gcUNvZWZmMFtpXStxQ29lZmYwW2ldKigtMikgaWYgQ29lZmYgPDAgCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA7Ly8gcVJlc3VsdDBbaV09IHFDb2VmZjBbaV0gICAgICAgICAgICAgICAgIGlmIENvZWZmID49MCAKLSAgICAgICAgIFZNTEFMICAgIHFSZXN1bHQxLGRDb2VmZjEsZDJRUCAgICAgICAgICAgIDsvLyBxUmVzdWx0MVtpXT0gcUNvZWZmMVtpXStxQ29lZmYxW2ldKigtMikgaWYgQ29lZmYgPDAgCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA7Ly8gcVJlc3VsdDFbaV09IHFDb2VmZjFbaV0gICAgICAgICAgICAgICAgIGlmIENvZWZmID49MCAKLSAgICAgICAgIDsvLyBDbGlwIFJlc3VsdCB0byBbLTIwNDgsMjA0N10gICAgICAgICAgICAgICAgICAgICAKLSAgICAgICAgIAotICAgICAgICAgVlFTSEwgICAgcVJlc3VsdDAscVJlc3VsdDAsIzIwICAgICAgICAgICAgOy8vIGNsaXAgdG8gWy0yMDQ4LDIwNDddCi0gICAgICAgICBWUVNITCAgICBxUmVzdWx0MSxxUmVzdWx0MSwjMjAKLSAgICAgICAgICAgICAgICAgCi0gICAgICAgICBWU0hSICAgICBxUmVzdWx0MCxxUmVzdWx0MCwjNCAgCi0gICAgICAgICBWU0hSICAgICBxUmVzdWx0MSxxUmVzdWx0MSwjNAotICAgICAgICAgVlNIUk4gICAgZFJlc3VsdDAscVJlc3VsdDAsIzE2ICAgICAgICAgICAgOy8vIE5hcnJvdyB0aGUgY2xpcHBlZCBWYWx1ZSB0byBIYWxmd29yZAotICAgICAgICAgVlNIUk4gICAgZFJlc3VsdDEscVJlc3VsdDEsIzE2IAotICAgICAgICAgVkJJVCAgICAgZFJlc3VsdDAsZENvbnN0MCxkWmVybzAgIAotICAgICAgICAgVkJJVCAgICAgZFJlc3VsdDEsZENvbnN0MCxkWmVybzEgICAgIAotICAgICAgICAgCi0gICAgICAgICBWU1QxICAgICB7ZFJlc3VsdDAsZFJlc3VsdDF9LFtwU3JjRHN0XSEgICA7Ly8gU3RvcmUgdGhlIHJlc3VsdAotICAgICAgICAgU1VCUyAgICAgQ291bnQsQ291bnQsIzgKLSAgICAgICAgIFZMRDEgICAgIHtkQ29lZmYwLGRDb2VmZjF9LFtwU3JjRHN0XQotICAgICAgICAgCi0gICAgICAgICAKLSAgICAgICAgIEJHVCAgICAgIExvb3AKLSAgICAgICAgIAotICAgICAgICAgU1VCICAgICAgcFNyY0RzdCxwU3JjRHN0LCMxMjgKLSAgICAgICAgIAotICAgICAgICAgOy8vIFN0b3JlIHRoZSBJbnZlcnNlIHF1YW50aXplZCBEYyBjb2VmZmljaWVudAotICAgICAgICAgCi0gICAgICAgICBTVFJIICAgICB0ZW1wLFtwU3JjRHN0XSwjMgotICAgICAgICAKLSAgICAgICAgIE1PViAgICAgIFJldHVybiwjT01YX1N0c19Ob0VycgotICAgICAgICAgCi0KLQotICAgICAgICAgTV9FTkQKLSAgICAgICAgIEVORElGCi0gICAgICAgICAKLQotICAgICAgICBFTkQKLQpkaWZmIC0tZ2l0IGEvbWVkaWEvbGlic3RhZ2VmcmlnaHQvY29kZWNzL29uMi9oMjY0ZGVjL29teGRsL2FybV9uZW9uL3ZjL3NyYy9hcm1WQ19WZXJzaW9uLmMgYi9tZWRpYS9saWJzdGFnZWZyaWdodC9jb2RlY3Mvb24yL2gyNjRkZWMvb214ZGwvYXJtX25lb24vdmMvc3JjL2FybVZDX1ZlcnNpb24uYwpkZWxldGVkIGZpbGUgbW9kZSAxMDA3NTUKaW5kZXggNWQ5MzY4MS4uMDAwMDAwMAotLS0gYS9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PcGVyYW5kCi0gKiBbaW5dIFZhbHVlMiAgICAgICBTZWNvbmQgT3BlcmFuZAotICoKLSAqIFJldHVybjoKLSAqIFtvdXRdICAgICAgICAgICAgIFJlc3VsdCBvZiBvcGVyYXRpb24KLSAqIAotICogICAgCi0gKiovCi0KLU9NWF9TMzIgYXJtU2F0QWRkX1MzMigKLSAgICAgICAgICAgICAgICBPTVhfUzMyIFZhbHVlMSwKLSAgICAgICAgICAgICAgICBPTVhfUzMyIFZhbHVlMgotICAgICAgICAgICAgICAgICk7Ci0KLS8qKgotICogRnVuY3Rpb24gOmFybVNhdEFkZF9TNjQoKQotICoKLSAqIERlc2NyaXB0aW9uIDoKLSAqICAgUmV0dXJucyB0aGUgcmVzdWx0IG9mIHNhdHVyYXRlZCBhZGRpdGlvbiBvZiB0aGUgdHdvIGlucHV0cyBWYWx1ZTEsIFZhbHVlMgotICoKLSAqIFBhcmFtZXRyczoKLSAqIFtpbl0gVmFsdWUxICAgICAgIEZpcnN0IE9wZXJhbmQKLSAqIFtpbl0gVmFsdWUyICAgICAgIFNlY29uZCBPcGVyYW5kCi0gKgotICogUmV0dXJuOgotICogW291dF0gICAgICAgICAgICAgUmVzdWx0IG9mIG9wZXJhdGlvbgotICogCi0gKiAgICAKLSAqKi8KLQotT01YX1M2NCBhcm1TYXRBZGRfUzY0KAotICAgICAgICAgICAgICAgIE9NWF9TNjQgVmFsdWUxLAotICAgICAgICAgICAgICAgIE9NWF9TNjQgVmFsdWUyCi0gICAgICAgICAgICAgICAgKTsKLQotLyoqIEZ1bmN0aW9uIDphcm1TYXRTdWJfUzMyKCkKLSAqIAotICogRGVzY3JpcHRpb24gOgotICogICAgIFJldHVybnMgdGhlIHJlc3VsdCBvZiBzYXR1cmF0ZWQgc3Vic3RyYWN0aW9uIG9mIHRoZSB0d28gaW5wdXRzIFZhbHVlMSwgVmFsdWUyCi0gKgotICogUGFyYW1ldHJzOgotICogW2luXSBWYWx1ZTEgICAgICAgRmlyc3QgT3BlcmF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gKgotICogRGVzY3JpcHRpb24gOgotICogICAgIFJldHVybnMgdGhlIHJlc3VsdCBvZiBzYXR1cmF0aW5nIGxlZnQtc2hpZnQgb3BlcmF0aW9uIG9uIGlucHV0Ci0gKiAgICAgT3Igcm91bmRlZCBSaWdodCBzaGlmdCBpZiB0aGUgaW5wdXQgU2hpZnQgaXMgbmVnYXRpdmUuCi0gKgotICogUGFyYW1ldHJzOgotICogW2luXSBWYWx1ZSAgICAgICAgT3BlcmFuZAotICogW2luXSBzaGlmdCAgICAgICAgT3BlcmFuZCBmb3Igc2hpZnQgb3BlcmF0aW9uCi0gKgotICogUmV0dXJuOgotICogW291dF0gICAgICAgICAgICAgUmVzdWx0IG9mIG9wZXJhdGlvbgotICogICAgCi0gKiovCi0gCi1PTVhfUzY0IGFybVNhdFJvdW5kTGVmdFNoaWZ0X1M2NCgKLSAgICAgICAgICAgICAgICAgICAgICAgIE9NWF9TNjQgVmFsdWUsCi0gICAgICAgICAgICAgICAgICAgICAgICBPTVhfSU5UIHNoaWZ0Ci0gICAgICAgICAgICAgICAgICAgICAgICApOwotCi0vKioKLSAqIEZ1bmN0aW9uIDphcm1TYXRNdWxTMTZTMzJfUzMyKCkKLSAqCi0gKiBEZXNjcmlwdGlvbiA6Ci0gKiAgICAgUmV0dXJucyB0aGUgcmVzdWx0IG9mIGEgUzE2IGRhdGEgdHlwZSBtdWx0aXBsaWVkIHdpdGggYW4gUzMyIGRhdGEgdHlwZQotICogICAgIGluIGEgUzMyIGNvbnRhaW5lcgotICoKLSAqIFBhcmFtZXRyczoKLSAqIFtpbl0gaW5wdXQxICAgICAgIE9wZXJhbmQgMQotICogW2luXSBpbnB1dDIgICAgICAgT3BlcmFuZCAyCi0gKgotICogUmV0dXJuOgotICogW291dF0gICAgICAgICAgICAgUmVzdWx0IG9mIG9wZXJhdGlvbgotICogICAgCi0gKiovCi0KLQotT01YX1MzMiBhcm1TYXRNdWxTMTZTMzJfUzMyKAotICAgICAgICAgICAgICAgICAgICBP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gICBPcGVyYW5kIDEKLSAqIFtpbl0gRGVubyAgICAgICBPcGVyYW5kIDIKLSAqCi0gKiBSZXR1cm46Ci0gKiBbb3V0XSAgICAgICAgICAgICBSZXN1bHQgb2Ygb3BlcmF0aW9uIGlucHV0MS8vaW5wdXQyCi0gKiAgICAKLSAqKi8KLQotT01YX1MzMiBhcm1JbnREaXZBd2F5RnJvbVplcm8gKE9NWF9TMzIgTnVtLCBPTVhfUzMyIERlbm8pOwotCi0KLS8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLS8qCi0gKiBEZWJ1Z2dpbmcgbWFjcm9zCi0gKgotICovCi0KLQotLyoKLSAqIERlZmluaXRpb24gb2Ygb3V0cHV0IHN0cmVhbSAtIGNoYW5nZSB0byBzdGRlcnIgaWYgbmVjZXNzYXJ5Ci0gKi8KLSNkZWZpbmUgREVCVUdfU1RSRUFNIHN0ZG91dAotCi0vKgotICogRGVidWcgcHJpbnRmIG1hY3Jvcywgb25lIGZvciBlYWNoIGFyZ3VtZW50IGNvdW50LgotICogQWRkIG1vcmUgaWYgbmVlZGVkLgotICovCi0jaWZkZWYgREVCVUdfT04KLSNpbmNsdWRlIDxzdGRpby5oPgotCi0jZGVmaW5lIERFQlVHX1BSSU5URl8wKGEpICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBmcHJpbnRmKERFQlVHX1NUUkVBTSwgYSkKLSNkZWZpbmUgREVCVUdfUFJJTlRGXzEoYSwgYikgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZwcmludGYoREVCVUdfU1RSRUFNLCBhLCBiKQotI2RlZmluZSBERUJVR19QUklOVEZfMihhLCBiLCBjKSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZnByaW50ZihERUJVR19TVFJFQU0sIGEsIGIsIGMpCi0jZGVmaW5lIERFQlVHX1BSSU5URl8zKGEsIGIsIGMsIGQpICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBmcHJpbnRmKERFQlVHX1NUUkVBTSwgYSwgYiwgYywgZCkKLSNkZWZpbmUgREVCVUdfUFJJTlRGXzQoYSwgYiwgYywgZCwgZSkgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZwcmludGYoREVCVUdfU1RSRUFNLCBhLCBiLCBjLCBkLCBlKQotI2RlZmluZSBERUJVR19QUklOVEZfNShhLCBiLCBjLCBkLCBlLCBmKSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZnByaW50ZihERUJVR19TVFJFQU0sIGEsIGIsIGMsIGQsIGUsIGYpCi0jZGVmaW5lIERFQlVHX1BSSU5URl82KGEsIGIsIGMsIGQsIGUsIGYsIGcpICAgICAgICAgICAgICAgICAgICAgICAgICAgICBmcHJpbnRmKERFQlVHX1NUUkVBTSwgYSwgYiwgYywgZCwgZSwgZiwgZykKLSNkZWZpbmUgREVCVUdfUFJJTlRGXzcoYSwgYiwgYywgZCwgZSwgZiwgZywgaCkgICAgICAgICAgICAgICAgICAgICAgICAgIGZwcmludGYoREVCVUdfU1RSRUFNLCBhLCBiLCBjLCBkLCBlLCBmLCBnLCBoKQotI2RlZmluZSBERUJVR19QUklOVEZfOChhLCBiLCBjLCBkLCBlLCBmLCBnLCBoLCBpKSAgICAgICAgICAgICAgICAgICAgICAgZnByaW50ZihERUJVR19TVFJFQU0sIGEsIGIsIGMsIGQsIGUsIGYsIGcsIGgsIGkpCi0jZGVmaW5lIERFQlVHX1BSSU5URl85KGEsIGIsIGMsIGQsIGUsIGYsIGcsIGgsIGksIGopICAgICAgICAgICAgICAgICAgICBmcHJpbnRmKERFQlVHX1NUUkVBTSwgYSwgYiwgYywgZCwgZSwgZiwgZywgaCwgaSwgaikKLSNkZWZpbmUgREVCVUdfUFJJTlRGXzEwKGEsIGIsIGMsIGQsIGUsIGYsIGcsIGgsIGksIGosIGspICAgICAgICAgICAgICAgIGZwcmludGYoREVCVUdfU1RSRUFNLCBhLCBiLCBjLCBkLCBlLCBmLCBnLCBoLCBpLCBqLCBrKQotI2RlZmluZSBERUJVR19QUklOVEZfMTEoYSwgYiwgYywgZCwgZSwgZiwgZywgaCwgaSwgaiwgaywgbCkgICAgICAgICAgICAgZnByaW50ZihERUJVR19TVFJFQU0sIGEsIGIsIGMsIGQsIGUsIGYsIGcsIGgsIGksIGosIGssIGwpCi0jZGVmaW5lIERFQlVHX1BSSU5URl8xMihhLCBiLCBjLCBkLCBlLCBmLCBnLCBoLCBpLCBqLCBrLCBsLCBtKSAgICAgICAgICBmcHJpbnRmKERFQlVHX1NUUkVBTSwgYSwgYiwgYywgZCwgZSwgZiwgZywgaCwgaSwgaiwgaywgbCwgbSkKLSNkZWZpbmUgREVCVUdfUFJJTlRGXzEzKGEsIGIsIGMsIGQsIGUsIGYsIGcsIGgsIGksIGosIGssIGwsIG0sIG4pICAgICAgIGZwcmludGYoREVCVUdfU1RSRUFNLCBhLCBiLCBjLCBkLCBlLCBmLCBnLCBoLCBpLCBqLCBrLCBsLCBtLCBuKQotI2RlZmluZSBERUJVR19QUklOVEZfMTQoYSwgYiwgYywgZCwgZSwgZiwgZywgaCwgaSwgaiwgaywgbCwgbSwgbiwgbykgICAgZnByaW50ZihERUJVR19TVFJFQU0sIGEsIGIsIGMsIGQsIGUsIGYsIGcsIGgsIGksIGosIGssIGwsIG0sIG4sIG8pCi0jZWxzZSAvKiBERUJVR19PTiAqLwotI2RlZmluZSBERUJVR19QUklOVEZfMChhKSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKLSNkZWZpbmUgREVCVUdfUFJJTlRGXzEoYSwgYikgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCi0jZGVmaW5lIERFQlVHX1BSSU5URl8yKGEsIGIsIGMpICAgICAgICAgICAgICAgICAgICAgICAgICAgIAotI2RlZmluZSBERUJVR19QUklOVEZfMyhhLCBiLCBjLCBkKSAgICA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gICAqcE9mZnNldAotICoKLSAqIFJldHVybnMgOiBDb2RlIEJvb2sgSW5kZXggaWYgc3VjY2Vzc2Z1bGwuIAotICogICAgICAgICA6ICJBUk1fTk9fQ09ERUJPT0tfSU5ERVggPSAweEZGRkYiIGlmIHNlYXJjaCBmYWlscy4KLSAqKi8KLQotI2RlZmluZSBBUk1fTk9fQ09ERUJPT0tfSU5ERVggKE9NWF9VMTYpKDB4RkZGRikKLQotT01YX1UxNiBhcm1VblBhY2tWTEMzMigKLSAgICBjb25zdCBPTVhfVTggKipwcEJpdFN0cmVhbSwKLSAgICBPTVhfSU5UICpwT2Zmc2V0LAotICAgIGNvbnN0IEFSTV9WTEMzMiAqcENvZGVCb29rCi0pOwotCi0vKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCi0gKiBGaXhlZCBiaXQgbGVuZ3RoIEVuY29kZQotICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLQotLyoqCi0gKiBGdW5jdGlvbjogYXJtUGFja0JpdHMKLSAqCi0gKiBEZXNjcmlwdGlvbjoKLSAqIFBhY2sgYSBWTEMgY29kZSB3b3JkIGludG8gdGhlIGJpdHN0cmVhbQotICoKLSAqIFJlbWFya3M6Ci0gKgotICogUGFyYW1ldGVyczoKLSAqIFtpbl0JcHBCaXRTdHJlYW0JCXBvaW50ZXIgdG8gdGhlIHBvaW50ZXIgdG8gdGhlIGN1cnJlbnQgYnl0ZSAKLSAqICAgICAgICAgICAgICAgICAgICAgIGluIHRoZSBiaXQgc3RyZWFtLgotICogW2luXQlwT2Zmc2V0CSAgICAgICAgcG9pbnRlciB0byB0aGUgYml0IHBvc2l0aW9uIGluIHRoZSBieXRlIAotICogICAgICAgICAgICAgICAgICAgICAgcG9pbnRlZCBieSAqcHBCaXRTdHJlYW0uIFZhbGlkIHdpdGhpbiAwCi0gKiAgICAgICAgICAgICAgICAgICAgICB0byA3LgotICogW2luXQljb2RlV29yZAkJQ29kZSB3b3Jk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uRGVjb2RlX1MzMiAgICAgICAgICAgICAgICAgICAgICAgIE9NWENBVEJBUihBQ01QM19IdWZmbWFuRGVjb2RlX1MzMiwgT01YQUNNUDNfU1VGRklYKQotI2RlZmluZSBvbXhBQ01QM19IdWZmbWFuRGVjb2RlU2ZiX1MzMiAgICAgICAgICAgICAgICAgICAgIE9NWENBVEJBUihBQ01QM19IdWZmbWFuRGVjb2RlU2ZiX1MzMiwgT01YQUNNUDNfU1VGRklYKQotI2RlZmluZSBvbXhBQ01QM19IdWZmbWFuRGVjb2RlU2ZiTWJwX1MzMiAgICAgICAgICAgICAgICAgIE9NWENBVEJBUihBQ01QM19IdWZmbWFuRGVjb2RlU2ZiTWJwX1MzMiwgT01YQUNNUDNfU1VGRklYKQotI2RlZmluZSBvbXhBQ01QM19NRENUSW52X1MzMiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIE9NWENBVEJBUihBQ01QM19NRENUSW52X1MzMiwgT01YQUNNUDNfU1VGRklYKQotI2RlZmluZSBvbXhBQ01QM19SZVF1YW50aXplX1MzMl9JICAgICAgICAgICAgICAgICAgICAgICAgIE9NWENBVEJBUihBQ01QM19SZVF1YW50aXplX1MzMl9JLCBPTVhBQ01QM19TVUZGSVgpCi0jZGVmaW5lIG9teEFDTVAzX1JlUXVhbnRpemVTZmJfUzMyX0kgICAgICAgICAgICAgICAgICAgICAgT01YQ0FUQkFSKEFDTVAzX1JlUXVhbnRpemVTZmJfUzMyX0ksIE9NWEFDTVAzX1NVRkZJWCkKLSNkZWZpbmUgb214QUNNUDNfU3ludGhQUU1GX1MzMl9TMTYgICAgICAgICAgICAgICAgICAgICAgICBPTVhDQVRCQVIoQUNNUDNfU3ludGhQUU1GX1MzMl9TMTYsIE9NWEFDTVAzX1NVRkZJWCkKLSNkZWZpbmUgb214QUNNUDNfVW5wYWNrRnJhbWVIZWFkZXIgICAgICAgICAgICAgICAgICAgICAgICBPTVhDQVRCQVIoQUNNUDNfVW5wYWNrRnJhbWVIZWFkZX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Ci0jZGVmaW5lIG9teElQUFBfR2V0Q2VudHJhbE1vbWVudF9TNjQgICAgICAgICAgICAgICAgICAgICAgT01YQ0FUQkFSKElQUFBfR2V0Q2VudHJhbE1vbWVudF9TNjQsIE9NWElQUFBfU1VGRklYKQotI2RlZmluZSBvbXhJUFBQX0dldFNwYXRpYWxNb21lbnRfUzY0ICAgICAgICAgICAgICAgICAgICAgIE9NWENBVEJBUihJUFBQX0dldFNwYXRpYWxNb21lbnRfUzY0LCBPTVhJUFBQX1NVRkZJWCkKLSNkZWZpbmUgb214SVBQUF9Nb21lbnRHZXRTdGF0ZVNpemUgICAgICAgICAgICAgICAgICAgICAgICBPTVhDQVRCQVIoSVBQUF9Nb21lbnRHZXRTdGF0ZVNpemUsIE9NWElQUFBfU1VGRklYKQotI2RlZmluZSBvbXhJUFBQX01vbWVudEluaXQgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIE9NWENBVEJBUihJUFBQX01vbWVudEluaXQsIE9NWElQUFBfU1VGRklYKQotI2RlZmluZSBvbXhJUFBQX01vbWVudHNfVThfQzFSICAgICAgICAgICAgICAgICAgICAgICAgICAgIE9NWENBVEJBUihJUFBQX01vbWVudHNfVThfQzFSLCBPTVhJUFBQX1NVRkZJWCkKLSNkZWZpbmUgb214SVBQUF9Nb21lbnRzX1U4X0MzUiAgICAgICAgICAgICAgICAgICAgICAgICAgICBPTVhDQVRCQVIoSVBQUF9Nb21lbnRzX1U4X0MzUiwgT01YSVBQUF9TVUZGSVgpCi0KLSNkZWZpbmUgb214U1BfQmxvY2tFeHBfUzE2ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBPTVhDQVRCQVIoU1BfQmxvY2tFeHBfUzE2LCBPTVhTUF9TVUZGSVgpCi0jZGVmaW5lIG9teFNQX0Jsb2NrRXhwX1MzMiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgT01YQ0FUQkFSKFNQX0Jsb2NrRXhwX1MzMiwgT01YU1BfU1VGRklYKQotI2RlZ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b2NrICAgICAgICAgICAgICAgIE9NWENBVEJBUihWQ0NPTU1fQ29tcHV0ZVRleHR1cmVFcnJvckJsb2NrLCBPTVhWQ0NPTU1fU1VGRklYKQotI2RlZmluZSBvbXhWQ0NPTU1fQ29tcHV0ZVRleHR1cmVFcnJvckJsb2NrX1NBRCAgICAgICAgICAgIE9NWENBVEJBUihWQ0NPTU1fQ29tcHV0ZVRleHR1cmVFcnJvckJsb2NrX1NBRCwgT01YVkNDT01NX1NVRkZJWCkKLSNkZWZpbmUgb214VkNDT01NX0NvcHkxNngxNiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBPTVhDQVRCQVIoVkNDT01NX0NvcHkxNngxNiwgT01YVkNDT01NX1NVRkZJWCkKLSNkZWZpbmUgb214VkNDT01NX0NvcHk4eDggICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBPTVhDQVRCQVIoVkNDT01NX0NvcHk4eDgsIE9NWFZDQ09NTV9TVUZGSVgpCi0jZGVmaW5lIG9teFZDQ09NTV9FeHBhbmRGcmFtZV9JICAgICAgICAgICAgICAgICAgICAgICAgICAgT01YQ0FUQkFSKFZDQ09NTV9FeHBhbmRGcmFtZV9JLCBPTVhWQ0NPTU1fU1VGRklYKQotI2RlZmluZSBvbXhWQ0NPTU1fTGltaXRNVlRvUmVjdCAgICAgICAgICAgICAgICAgICAgICAgICAgIE9NWENBVEJBUihWQ0NPTU1fTGltaXRNVlRvUmVjdCwgT01YVkNDT01NX1NVRkZJWCkKLSNkZWZpbmUgb214VkNDT01NX1NBRF8xNnggICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBPTVhDQVRCQVIoVkNDT01NX1NBRF8xNngsIE9NWFZDQ09NTV9TVUZGSVgpCi0jZGVmaW5lIG9teFZDQ09NTV9TQURfOHggICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgT01YQ0FUQkFSKFZDQ09NTV9TQURfOHgsIE9NWFZDQ09NTV9TVUZGSVgpCi0KLSNkZWZpbmUgb214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FAyX0VuY29kZVZMQ1ppZ3phZ19JbnRlciwgT01YVkNNNFAyX1NVRkZJWCkKLSNkZWZpbmUgb214VkNNNFAyX0VuY29kZVZMQ1ppZ3phZ19JbnRyYUFDVkxDICAgICAgICAgICAgICBPTVhDQVRCQVIoVkNNNFAyX0VuY29kZVZMQ1ppZ3phZ19JbnRyYUFDVkxDLCBPTVhWQ000UDJfU1VGRklYKQotI2RlZmluZSBvbXhWQ000UDJfRW5jb2RlVkxDWmlnemFnX0ludHJhRENWTEMgICAgICAgICAgICAgIE9NWENBVEJBUihWQ000UDJfRW5jb2RlVkxDWmlnemFnX0ludHJhRENWTEMsIE9NWFZDTTRQMl9TVUZGSVgpCi0jZGVmaW5lIG9teFZDTTRQMl9GaW5kTVZwcmVkICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgT01YQ0FUQkFSKFZDTTRQMl9GaW5kTVZwcmVkLCBPTVhWQ000UDJfU1VGRklYKQotI2RlZmluZSBvbXhWQ000UDJfSURDVDh4OGJsayAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIE9NWENBVEJBUihWQ000UDJfSURDVDh4OGJsaywgT01YVkNNNFAyX1NVRkZJWCkKLSNkZWZpbmUgb214VkNNNFAyX01DUmVjb25CbG9jayAgICAgICAgICAgICAgICAgICAgICAgICAgICBPTVhDQVRCQVIoVkNNNFAyX01DUmVjb25CbG9jaywgT01YVkNNNFAyX1NVRkZJWCkKLSNkZWZpbmUgb214VkNNNFAyX01FR2V0QnVmU2l6ZSAgICAgICAgICAgICAgICAgICAgICAgICAgICBPTVhDQVRCQVIoVkNNNFAyX01FR2V0QnVmU2l6ZSwgT01YVkNNNFAyX1NVRkZJWCkKLSNkZWZpbmUgb214VkNNNFAyX01FSW5pdCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBPTVhDQVRCQVIoVkNNNFAyX01FSW5pdCwgT01YVkNNNFAyX1NVRkZJWCkKLSNkZWZpbmUgb214VkNNNFAyX01vdGlvbkVzdGltYXRpb25NQiAgICAgICAgICAgICAgICAgICAgICBPTVhDQVRCQVIoVkNNNFAyX01vdGlvbkVzdGltYXRpb25NQiwgT01YVkNNNFAyX1NVRkZJWCkKLSNkZWZpbmUgb214VkNNNFAyX1ByZWRpY3RSZWNvbkNvZWZJbnRyYSAgICAgICAgICAgICAgICAgICBPTVhDQVRCQVIoVkNNNFAyX1ByZWRpY3RSZWNvbkNvZWZJbnRyYSwgT01YVkNNNFAyX1NVRkZJWCkKLSNkZWZpbmUgb214VkNNNFAyX1F1YW50SW50ZXJfSSAgICAgICAgICAgICAgICAgICAgICAgICAgICBPTVhDQVRCQVIoVkNNNFAyX1F1YW50SW50ZXJfSSwgT01YVkNNNFAyX1NVRkZJWCkKLSNkZWZpbmUgb214VkNNNFAyX1F1YW50SW50cmFfSSAgICAgICAgICAgICAgICAgICAgICAgICAgICBPTVhDQVRCQVIoVkNNNFAyX1F1YW50SW50cmFfSSwgT01YVkNNNFAyX1NVRkZJWCkKLSNkZWZpbmUgb214VkNNNFAyX1F1YW50SW52SW50ZXJfSSAgICAgICAgICAgICAgICAgICAgICAgICBPTVhDQVRCQVIoVkNNNFAyX1F1YW50SW52SW50ZXJfSSwgT01YVkNNNFAyX1NVRkZJWCkKLSNkZWZpbmUgb214VkNNNFAyX1F1YW50SW52SW50cmFfSSAgICAgICAgICAgICAgICAgICAgICAgICBPTVhDQVRCQVIoVkNNNFAyX1F1YW50SW52SW50cmFfSSwgT01YVkNNNFAyX1NVRkZJWCkKLSNkZWZpbmUgb214VkNNNFAyX1RyYW5zUmVjQmxvY2tDb2VmX2ludGVyICAgICAgICAgICAgICAgICBPTVhDQVRCQVIoVkNNNFAyX1RyYW5zUmVjQmxvY2tDb2VmX2ludGVyLCBPTVhWQ000UDJfU1VGRklYKQotI2RlZmluZSBvbXhWQ000UDJfVHJhbnNSZWNCbG9ja0NvZWZfaW50cmEgICAgICAgICAgICAgICAgIE9NWENBVEJBUihWQ000UDJfVHJhbnNSZWNCbG9ja0NvZW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dpb24gbGVuZ3RoICAqLyAgIAotICAgIE9NWF9TdHNBQ0FBQ19UbnNPcmRlckVyciAgICAgICAgID0gLTE1NSwgIC8qIEFBQzogSW52YWxpZCBvcmRlciBvZiBUTlMgZmlsdGVyICAqLyAgICAgICAgICAgICAgICAgIAotICAgIE9NWF9TdHNBQ0FBQ19UbnNDb2VmUmVzRXJyICAgICAgID0gLTE1NCwgIC8qIEFBQzogSW52YWxpZCBiaXQtcmVzb2x1dGlvbiBmb3IgVE5TIGZpbHRlciBjb2VmZmljaWVudHMgICovCi0gICAgT01YX1N0c0FDQUFDX1Ruc0NvZWZFcnIgICAgICAgICAgPSAtMTUzLCAgLyogQUFDOiBJbnZhbGlkIFROUyBmaWx0ZXIgY29lZmZpY2llbnRzICAqLyAgICAgICAgICAgICAgICAgIAotICAgIE9NWF9TdHNBQ0FBQ19UbnNEaXJlY3RFcnIgICAgICAgID0gLTE1MiwgIC8qIEFBQzogSW52YWxpZCBUTlMgZmlsdGVyIGRpcmVjdGlvbiAgKi8gIAotCi0gICAgT01YX1N0c0lDSlBfSlBFR01hcmtlckVyciAgICAgICAgPSAtMTgzLCAgLyogSlBFRyBtYXJrZXIgZW5jb3VudGVyZWQgd2l0aGluIGFuIGVudHJvcHktY29kZWQgYmxvY2s7ICovCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLyogSHVmZm1hbiBkZWNvZGluZyBvcGVyYXRpb24gdGVybWluYXRlZCBlYXJseS4gICAgICAgICAgICovCi0gICAgT01YX1N0c0lDSlBfSlBFR01hcmtlciAgICAgICAgICAgPSAtMTgxLCAgLyogSlBFRyBtYXJrZXIgZW5jb3VudGVyZWQ7IEh1ZmZtYW4gZGVjb2RpbmcgKi8KLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvKiBvcGVyYXRpb24gdGVybWluYXRlZCBlYXJseS4gICAgICAgICAgICAgICAgICAgICAgICAgKi8KLSAgICBPTVhf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ZlZC4KLSAqIAotICogCi0gKgotICogRGVmaW5lcyBDb21tb24gQVBJcyB1c2VkIGFjcm9zcyBPcGVuTUFYIEFQSSdzCi0gKi8KLQotI2luY2x1ZGUgIm9teHR5cGVzLmgiCi0jaW5jbHVkZSAiYXJtQ09NTS5oIgotCi0vKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0gICAgICAgICAgICAgICAgLyogTWlzY2VsbGFuZW91cyBBcml0aG1ldGljIG9wZXJhdGlvbnMgKi8KLQotLyoqCi0gKiBGdW5jdGlvbjogYXJtUm91bmRGbG9hdFRvUzE2Ci0gKgotICogRGVzY3JpcHRpb246Ci0gKiBDb252ZXJ0cyBhIGRvdWJsZSBwcmVjaXNpb24gdmFsdWUgaW50byBhIHNob3J0IGludCBhZnRlciByb3VuZGluZwotICoKLSAqIFBhcmFtZXRlcnM6Ci0gKiBbaW5dICBWYWx1ZSAgICAgICAgICAgICAgICAgRmxvYXQgdmFsdWUgdG8gYmUgY29udmVydGVkCi0gKgotICogUmV0dXJuIFZhbHVlOgotICogW291dF0gY29udmVydGVkIHZhbHVlIGluIE9NWF9TMTYgZm9ybWF0Ci0gKgotICovCi0KLU9NWF9TMTYgYXJtUm91bmRGbG9hdFRvUzE2IChPTVhfRjY0IFZhbHVlKQotewotICAgIGlmIChWYWx1ZSA+IDApCi0gICAgewotICAgICAgICByZXR1cm4gKE9NWF9TMTYpKFZhbHVlICsgLjUpOwotICAgIH0KLSAgICBlbHNlCi0gICAgewotICAgICAgICByZXR1cm4gKE9NWF9TMTYpKFZhbHVlIC0gLjUpOwotICAgIH0KLX0KLQotLyoqCi0gKiBGdW5jdGlvbjogYXJtUm91bmRGbG9hdFRvUzMyCi0gKgotICogRGVzY3JpcHRpb246Ci0gKiBDb252ZXJ0cyBhIGRvdWJsZSBwcmVjaXNpb24gdmFsdWUgaW50byBhIGludCBhZnRlciByb3VuZGluZwotICoKLSAq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sKLSAgICAgICAgfQotICAgICAgICBlbHNlCi0gICAgICAgIHsKLSAgICAgICAgICAgIHJldHVybiAoT01YX1MxNilWYWx1ZTsKLSAgICAgICAgfQotICAgIH0KLSAgICBlbHNlCi0gICAgewotICAgICAgICBWYWx1ZSAtPSAwLjU7Ci0KLSAgICAgICAgaWYoVmFsdWUgPCAoT01YX1MxNilPTVhfTUlOX1MxNiApCi0gICAgICAgIHsKLSAgICAgICAgICAgIHJldHVybiAoT01YX1MxNilPTVhfTUlOX1MxNjsKLSAgICAgICAgfQotICAgICAgICBlbHNlCi0gICAgICAgIHsKLSAgICAgICAgICAgIHJldHVybiAoT01YX1MxNilWYWx1ZTsKLSAgICAgICAgfQotICAgIH0KLX0KLQotLyoqCi0gKiBGdW5jdGlvbjogYXJtU2F0Um91bmRGbG9hdFRvUzMyCi0gKgotICogRGVzY3JpcHRpb246Ci0gKiBDb252ZXJ0cyBhIGRvdWJsZSBwcmVjaXNpb24gdmFsdWUgaW50byBhIGludCBhZnRlciByb3VuZGluZyBhbmQgc2F0dXJhdGlvbgotICoKLSAqIFBhcmFtZXRlcnM6Ci0gKiBbaW5dICBWYWx1ZSAgICAgICAgICAgICAgICAgRmxvYXQgdmFsdWUgdG8gYmUgY29udmVydGVkCi0gKgotICogUmV0dXJuIFZhbHVlOgotICogW291dF0gY29udmVydGVkIHZhbHVlIGluIE9NWF9TMzIgZm9ybWF0Ci0gKgotICovCi0KLU9NWF9TMzIgYXJtU2F0Um91bmRGbG9hdFRvUzMyIChPTVhfRjY0IFZhbHVlKQotewotICAgIGlmIChWYWx1ZSA+IDApCi0gICAgewotICAgICAgICBWYWx1ZSArPSAwLjU7Ci0gICAgICAgIAotICAgICAgICBpZihWYWx1ZSA+IChPTVhfUzMyKU9NWF9NQVhfUzMyICkKLSAgICAgICAgewotICAgICAgICAgICAgcmV0dXJuIChPTVhfUzMyKU9NWF9NQVhfUzMyOwotICAgICAgICB9Ci0gICAgICAgIGVsc2UKLSAgICAgICAgewotIC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YXJtUm91bmRGbG9hdFRvUzY0IChPTVhfRjY0IFZhbHVlKQotewotICAgIGlmIChWYWx1ZSA+IDApCi0gICAgewotICAgICAgICByZXR1cm4gKE9NWF9TNjQpKFZhbHVlICsgLjUpOwotICAgIH0KLSAgICBlbHNlCi0gICAgewotICAgICAgICByZXR1cm4gKE9NWF9TNjQpKFZhbHVlIC0gLjUpOwotICAgIH0KLX0KLQotLyoqCi0gKiBGdW5jdGlvbjogYXJtU2lnbkNoZWNrCi0gKgotICogRGVzY3JpcHRpb246Ci0gKiBDaGVja3MgdGhlIHNpZ24gb2YgYSB2YXJpYWJsZToKLSAqIHJldHVybnMgMSBpZiBpdCBpcyBQb3NpdGl2ZQotICogcmV0dXJucyAwIGlmIGl0IGlzIDAKLSAqIHJldHVybnMgLTEgaWYgaXQgaXMgTmVnYXRpdmUgCi0gKgotICogUmVtYXJrczoKLSAqCi0gKiBQYXJhbWV0ZXJzOgotICogW2luXQkgICAgdmFyICAgICBWYXJpYWJsZSB0byBiZSBjaGVja2VkCi0gKgotICogUmV0dXJuIFZhbHVlOgotICogT01YX0lOVCAtLSAgIHJldHVybnMgMSBpZiBpdCBpcyBQb3NpdGl2ZQotICogICAgICAgICAgICAgIHJldHVybnMgMCBpZiBpdCBpcyAwCi0gKiAgICAgICAgICAgICAgcmV0dXJucyAtMSBpZiBpdCBpcyBOZWdhdGl2ZSAKLSAqLyAKLQotT01YX0lOVCBhcm1TaWduQ2hlY2sgKAotICAgIE9NWF9TMTYgdmFyCi0pCi0KLXsKLSAgICBPTVhfSU5UIFNpZ247Ci0gICAgCi0gICAgaWYgKHZhciA8IDApCi0gICAgewotICAgICAgICBTaWduID0gLTE7Ci0gICAgfQotICAgIGVsc2UgaWYgKCB2YXIgPiAwKQotICAgIHsKLSAgICAgICAgU2lnbiA9IDE7Ci0gICAgfQotICAgIGVsc2UKLSAgICB7Ci0gICAgICAgIFNpZ24gPSAwOwotICAgIH0KLSAgICAKLSAgICByZXR1cm4gU2lnbjs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KLSAgICAgICAgCi0gICAgICAgIH0KLSAgIAotICAgIH0KLSAgICBlbHNlCi0gICAgewotICAgICAgICByZXR1cm4gUmVzdWx0OwotICAgIH0KLSAgICAKLX0KLQotLyoqCi0gKiBGdW5jdGlvbiA6YXJtU2F0QWRkX1M2NCgpCi0gKgotICogRGVzY3JpcHRpb24gOgotICogICBSZXR1cm5zIHRoZSByZXN1bHQgb2Ygc2F0dXJhdGVkIGFkZGl0aW9uIG9mIHRoZSB0d28gaW5wdXRzIFZhbHVlMSwgVmFsdWUyCi0gKgotICogUGFyYW1ldHJzOgotICogW2luXSBWYWx1ZTEgICAgICAgRmlyc3QgT3BlcmFuZAotICogW2luXSBWYWx1ZTIgICAgICAgU2Vjb25kIE9wZXJhbmQKLSAqCi0gKiBSZXR1cm46Ci0gKiBbb3V0XSAgICAgICAgICAgICBSZXN1bHQgb2Ygb3BlcmF0aW9uCi0gKiAKLSAqICAgIAotICoqLwotIAotT01YX1M2NCBhcm1TYXRBZGRfUzY0KE9NWF9TNjQgVmFsdWUxLE9NWF9TNjQgVmFsdWUyKQotewotICAgIE9NWF9TNjQgUmVzdWx0OwotICAgIAotICAgIFJlc3VsdCA9IFZhbHVlMSArIFZhbHVlMjsKLQotICAgIGlmKCAoVmFsdWUxXlZhbHVlMikgPj0gMCkKLSAgICB7Ci0gICAgICAgIC8qU2FtZSBzaWduKi8KLSAgICAgICAgaWYoIChSZXN1bHReVmFsdWUxKSA+PSAwKQotICAgICAgICB7Ci0gICAgICAgICAgICAvKlJlc3VsdCBoYXMgbm90IHNhdHVyYXRlZCovCi0gICAgICAgICAgICByZXR1cm4gUmVzdWx0OwotICAgICAgICB9Ci0gICAgICAgIGVsc2UKLSAgICAgICAgewotICAgICAgICAgICAgaWYoVmFsdWUxID49IDApCi0gICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgLypSZXN1bHQgaGFzIHNhdHVyYXRlZCBpbiBwb3NpdGl2ZSBzaWRlKi8KLSAgICAgICAgICAgICAgIC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gICAgICAgIC8qUmVzdWx0IGhhcyBub3Qgc2F0dXJhdGVkKi8KLSAgICAgICAgICAgIHJldHVybiBSZXN1bHQ7Ci0gICAgICAgIH0KLSAgICAgICAgZWxzZQotICAgICAgICB7Ci0gICAgICAgICAgICBpZihWYWx1ZTEgPj0gMCkKLSAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAvKlJlc3VsdCBoYXMgc2F0dXJhdGVkIGluIHBvc2l0aXZlIHNpZGUqLwotICAgICAgICAgICAgICAgIHJldHVybiBPTVhfTUFYX1MzMjsKLSAgICAgICAgICAgIH0KLSAgICAgICAgICAgIGVsc2UKLSAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAvKlJlc3VsdCBoYXMgc2F0dXJhdGVkIGluIG5lZ2F0aXZlIHNpZGUqLwotICAgICAgICAgICAgICAgIHJldHVybiBPTVhfTUlOX1MzMjsKLSAgICAgICAgICAgIH0KLSAgICAgICAgCi0gICAgICAgIH0KLSAgIAotICAgIH0KLSAgICBlbHNlCi0gICAgewotICAgICAgICByZXR1cm4gUmVzdWx0OwotICAgIH0KLSAgICAKLX0KLQotLyoqCi0gKiBGdW5jdGlvbiA6YXJtU2F0TWFjX1MzMigpCi0gKgotICogRGVzY3JpcHRpb24gOgotICogICAgIFJldHVybnMgdGhlIHJlc3VsdCBvZiBNdWx0aXBsaWNhdGlvbiBvZiBWYWx1ZTEgYW5kIFZhbHVlMiBhbmQgc3ViZXNxdWVudCBzYXR1cmF0ZWQKLSAqICAgICBhY2N1bXVsYXRpb24gd2l0aCBNYWMKLSAqCi0gKiBQYXJhbWV0cnM6Ci0gKiBbaW5dIFZhbHVlMSAgICAgICBGaXJzdCBPcGVyYW5kCi0gKiBbaW5dIFZhbHVlMiAgICAgICBTZWNvbmQgT3BlcmFuZAotICogW2luXSBNYWMgICAgICAgICAgQWNjdW11bGF0b3IKLSAqCi0gKiBSZXR1cm46Ci0gKiBbb3V0XSAgICAgICAgICAgICBSZXN1bHQgb2Ygb3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T5jb2RlTGVuICE9IDA7IEluZGV4KyspCi0gICAgewotICAgICAgICBpZiAocENvZGVCb29rLT5jb2RlV29yZCA9PSAoVmFsdWUgPj4gKDMyIC0gcENvZGVCb29rLT5jb2RlTGVuKSkpCi0gICAgICAgIHsKLSAgICAgICAgICAgIE9mZnNldCAgICAgICA9IE9mZnNldCArIHBDb2RlQm9vay0+Y29kZUxlbjsKLSAgICAgICAgICAgICpwcEJpdFN0cmVhbSA9IHBCaXRTdHJlYW0gKyAoT2Zmc2V0ID4+IDMpIDsKLSAgICAgICAgICAgICpwT2Zmc2V0ICAgICA9IE9mZnNldCAmIDc7Ci0gICAgICAgICAgICAKLSAgICAgICAgICAgIHJldHVybiBJbmRleDsKLSAgICAgICAgfSAgICAgICAgCi0gICAgICAgIHBDb2RlQm9vaysrOwotICAgIH0KLQotICAgIC8qIE5vIGNvZGUgbWF0Y2ggZm91bmQgKi8KLSAgICByZXR1cm4gQVJNX05PX0NPREVCT09LX0lOREVYOwotfQotCi0jZW5kaWYKLQotLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgotICogRml4ZWQgYml0IGxlbmd0aCBFbmNvZGUKLSAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0KLS8qKgotICogRnVuY3Rpb246IGFybVBhY2tCaXRzCi0gKgotICogRGVzY3JpcHRpb246Ci0gKiBQYWNrIGEgVkxDIGNvZGUgd29yZCBpbnRvIHRoZSBiaXRzdHJlYW0KLSAqCi0gKiBSZW1hcmtzOgotICoKLSAqIFBhcmFtZXRlcnM6Ci0gKiBbaW5dIHBwQml0U3RyZWFtICAgICBwb2ludGVyIHRvIHRoZSBwb2ludGVyIHRvIHRoZSBjdXJyZW50IGJ5dGUgCi0gKiAgICAgICAgICAgICAgICAgICAgICBpbiB0aGUgYml0IHN0cmVhbS4KLSAqIFtpbl0gcE9mZnNldCAgICAgICAgIHBvaW50ZXIgdG8gdGhlIGJpdCBwb3NpdGlvbiBp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CAtICg4LU9mZnNldCk7Ci0gICAgICAgIE9mZnNldCA9IDA7Ci0gICAgICAgIFZhbHVlID0gY29kZVdvcmQgPj4gMjQ7Ci0gICAgfQotCi0gICAgLyogV3JpdGUgb3V0IGZpbmFsIHBhcnRpYWwgYnl0ZSAqLwotICAgICpwQml0U3RyZWFtICA9IChPTVhfVTgpVmFsdWU7Ci0gICAgKnBwQml0U3RyZWFtID0gcEJpdFN0cmVhbTsKLSAgICAqcE9mZnNldCA9IE9mZnNldCArIGNvZGVMZW5ndGg7Ci0gICAgCi0gICAgcmV0dXJuICBPTVhfU3RzX05vRXJyOwotfQotIAotLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgotICogVmFyaWFibGUgYml0IGxlbmd0aCBFbmNvZGUKLSAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0KLS8qKgotICogRnVuY3Rpb246IGFybVBhY2tWTEMzMgotICoKLSAqIERlc2NyaXB0aW9uOgotICogUGFjayBhIFZMQyBjb2RlIHdvcmQgaW50byB0aGUgYml0c3RyZWFtCi0gKgotICogUmVtYXJrczoKLSAqCi0gKiBQYXJhbWV0ZXJzOgotICogW2luXQlwcEJpdFN0cmVhbQkJcG9pbnRlciB0byB0aGUgcG9pbnRlciB0byB0aGUgY3VycmVudCBieXRlIAotICogICAgICAgICAgICAgICAgICAgICAgaW4gdGhlIGJpdCBzdHJlYW0uCi0gKiBbaW5dCXBCaXRPZmZzZXQJICAgIHBvaW50ZXIgdG8gdGhlIGJpdCBwb3NpdGlvbiBpbiB0aGUgYnl0ZSAKLSAqICAgICAgICAgICAgICAgICAgICAgIHBvaW50ZWQgYnkgKnBwQml0U3RyZWFtLiBWYWxpZCB3aXRoaW4gMAotICogICAgICAgICAgICAgICAgICAgICAgdG8gNy4KLSAqIFtpbl0JIGNvZGUgICAgIAkJVkxDIGNvZGUgd29yZCB0aGF0IG5lZWQgdG8gYmUgaW5zZXJ0ZWQgaW4gdG8gdG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bnQgYmxvY2suIGN1clFQCi0gKiAgICAgICAgICAgICAgICAgICAgICAgICAgbWF5IGVxdWFsIHRvIHByZWRRUCBlc3BlY2lhbGx5IHdoZW4gdGhlIGN1cnJlbnQKLSAqICAgICAgICAgICAgICAgICAgICAgICAgICBibG9jayBhbmQgdGhlIHByZWRpY3RvciBibG9jayBhcmUgaW4gdGhlIHNhbWUKLSAqICAgICAgICAgICAgICAgICAgICAgICAgICBtYWNyb2Jsb2NrLgotICogW2luXSBwcmVkUVAgICAgICBxdWFudGl6YXRpb24gcGFyYW1ldGVyIG9mIHRoZSBwcmVkaWN0b3IgYmxvY2sKLSAqIFtpbl0gcHJlZERpciAgICAgaW5kaWNhdGVzIHRoZSBwcmVkaWN0aW9uIGRpcmVjdGlvbiB3aGljaCB0YWtlcyBvbmUKLSAqICAgICAgICAgICAgICAgICAgICAgICAgICBvZiB0aGUgZm9sbG93aW5nIHZhbHVlczoKLSAqICAgICAgICAgICAgICAgICAgICAgICAgICBPTVhfVklERU9fSE9SSVpPTlRBTCAgICBwcmVkaWN0IGhvcml6b250YWxseQotICogICAgICAgICAgICAgICAgICAgICAgICAgIE9NWF9WSURFT19WRVJUSUNBTCAgICAgIHByZWRpY3QgdmVydGljYWxseQotICogW2luXSBBQ1ByZWRGbGFnICBhIGZsYWcgaW5kaWNhdGluZyBpZiBBQyBwcmVkaWN0aW9uIHNob3VsZCBiZQotICogICAgICAgICAgICAgICAgICAgICAgICAgIHBlcmZvcm1lZC4gSXQgaXMgZXF1YWwgdG8gYWNfcHJlZF9mbGFnIGluIHRoZSBiaXQKLSAqICAgICAgICAgICAgICAgICAgICAgICAgICBzdHJlYW0gc3ludGF4IG9mIE1QRUctNAotICogW2luXSB2aWRlb0NvbXAgICB2aWRlbyBjb21wb25lbnQgdHlwZSAobHVtaW5hbmNlLCBjaHJvbWluYW5jZSBvcgotICogICAgICAgICAgICAgICAgICAgICAgICAgIGFscGhhKSBvZiB0aGUgY3VycmVudCBibG9jawotICogW2luXSBmbGFnICAgICAgICBUaGlzIGZsYWcgZGVmaW5lcyB0aGUgaWYgb25lIHdhbnRzIHRvIHVzZSB0aGlzIGZ1bmN0aW9ucyB0bwotICogICAgICAgICAgICAgICAgICBjYWxjdWxhdGUgUFFGIChzZXQgMSwgcHJlZGljdGlvbikgb3IgUUYgKHNldCAwLCByZWNvbnN0cnVjdGlvbikKLSAqIFtvdXRdICAgIHBQcmVBQ1ByZWRpY3QgICBwb2ludGVyIHRvIHRoZSBwcmVkaWN0ZWQgY29lZmZpY2llbnRzIGJ1ZmZlci4KLSAqICAgICAgICAgICAgICAgICAgICAgICAgICBGaWxsZWQgT05MWSBpZiBpdCBpcyBub3QgTlVMTAotICogW291dF0gICAgcFNyY0RzdCAgICAgcG9pbnRlciB0byB0aGUgY29lZmZpY2llbnQgYnVmZmVyIHdoaWNoIGNvbnRhaW5zCi0gKiAgICAgICAgICAgICAgICAgICAgICAgICAgdGhlIHF1YW50aXplZCBjb2VmZmljaWVudHMgKFFGKSBvZiB0aGUgY3VycmVudAotICogICAgICAgICAgICAgICAgICAgICAgICAgIGJsb2NrCi0gKiBbb3V0XSAgICBwUHJlZEJ1ZlJvdyBwb2ludGVyIHRvIHRoZSB1cGRhdGVkIGNvZWZmaWNpZW50IHJvdyBidWZmZXIKLSAqIFtvdXRdICAgIHBQcmVkQnVmQ29sIHBvaW50ZXIgdG8gdGhlIHVwZGF0ZWQgY29lZmZpY2llbnQgY29sdW1uIGJ1ZmZlcgotICogW291dF0gICAgcFN1bUVyciAgICAgcG9pbnRlciB0byB0aGUgdXBkYXRlZCBzdW0gb2YgdGhlIGRpZmZlcmVuY2UKLSAqICAgICAgICAgICAgICAgICAgICAgIGJldHdlZW4gcHJlZGljdGVkIGFuZCB1bnByZWRpY3RlZCBjb2VmZmljaWVudHMKLSAqICAgICAgICAgICAgICAgICAgICAgIElmIHRoaXMgaXMgTlVMTCwgZG8gbm90IHVwZGF0ZQotICoKLSAqIFJldHVybiBWYWx1ZToKLSAqI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WQuCi0gKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFBlcmZvcm1zIGNsYXNzaWNhbCB6aWd6YWcKLSAqICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2Nhbi4KLSAqICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgT01YX1ZJREVPX0hPUklaT05UQUwgICAgSG9yaXpvbnRhbCBwcmVkaWN0aW9uLgotICogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBQZXJmb3JtcyBhbHRlcm5hdGUtdmVydGljYWwKLSAqICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgemlnemFnIHNjYW4uCi0gKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIE9NWF9WSURFT19WRVJUSUNBTCAgICAgIFZlcnRpY2FsIHByZWRpY3Rpb24uCi0gKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFBlcmZvcm1zIGFsdGVybmF0ZS1ob3Jpem9udGFsCi0gKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHppZ3phZyBzY2FuLgotICogW2luXSBwYXR0ZXJuICAgICAgICAgYmxvY2sgcGF0dGVybiB3aGljaCBpcyB1c2VkIHRvIGRlY2lkZSB3aGV0aGVyCi0gKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRoaXMgYmxvY2sgaXMgZW5jb2RlZAotICogW2luXSBzdGFydCAgICAgICAgICAgc3RhcnQgaW5kaWNhdGVzIHdoZXRoZXIgdGhlIGVuY29kaW5nIGJlZ2lucyB3aXRoIDB0aCBlbGVtZW50Ci0gKiAgICAgICAgICAgICAgICAgICAgICBvciAxc3QuCi0gKiBbb3V0XSAgICBwcEJpdFN0cmVhbSAgICAgKnBwQml0U3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BzY2FuIGZvciBvbmUgaW50cmEgY29kZWQgYmxvY2suCi0gKgotICogUmVtYXJrczoKLSAqCi0gKiBQYXJhbWV0ZXJzOgotICogW2luXSBwcEJpdFN0cmVhbSAgICAgcG9pbnRlciB0byB0aGUgcG9pbnRlciB0byB0aGUgY3VycmVudCBieXRlIGluCi0gKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRoZSBiaXRzdHJlYW0gYnVmZmVyCi0gKiBbaW5dIHBCaXRPZmZzZXQgICAgICBwb2ludGVyIHRvIHRoZSBiaXQgcG9zaXRpb24gaW4gdGhlIGJ5dGUgcG9pbnRlZAotICogICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0byBieSAqcHBCaXRTdHJlYW0uICpwQml0T2Zmc2V0IGlzIHZhbGlkIHdpdGhpbgotICogICAgICAgICAgICAgICAgICAgICAgICAgICAgICBbMC03XS4KLSAqIFtpbl0gcHJlZERpciAgICAgICAgIEFDIHByZWRpY3Rpb24gZGlyZWN0aW9uIHdoaWNoIGlzIHVzZWQgdG8gZGVjaWRlCi0gKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRoZSB6aWd6YWcgc2NhbiBwYXR0ZXJuLiBJdCB0YWtlcyBvbmUgb2YgdGhlCi0gKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZvbGxvd2luZyB2YWx1ZXM6Ci0gKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIE9NWF9WSURFT19OT05FICBBQyBwcmVkaWN0aW9uIG5vdCB1c2VkOwotICogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcGVyZm9ybSBjbGFzc2ljYWwgemlnemFnIHNjYW47Ci0gKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIE9NWF9WSURFT19IT1JJWk9OVEFMICAgIEhvcml6b250YWwgcHJlZGljdGlvbjsKLSAqICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcGVyZm9ybSBhbHRlcm5hdGUtdmVydGljYWwKLSAqICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgemlnemFnIHNjYW47Ci0gKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIE9NWF9WSURFT19WRVJUSUNBTCAgICAgIFZlcnRpY2FsIHByZWRpY3Rpb247Ci0gKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRodXMgcGVyZm9ybQotICogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBhbHRlcm5hdGUtaG9yaXpvbnRhbAotICogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB6aWd6YWcgc2Nhbi4KLSAqIFtpbl0gdmlkZW9Db21wICAgICAgIHZpZGVvIGNvbXBvbmVudCB0eXBlIChsdW1pbmFuY2UsIGNocm9taW5hbmNlIG9yCi0gKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGFscGhhKSBvZiB0aGUgY3VycmVudCBibG9jawotICogW2luXSBzaG9ydFZpZGVvSGVhZGVyIGJpbmFyeSBmbGFnIGluZGljYXRpbmcgcHJlc2VuY2Ugb2Ygc2hvcnRfdmlkZW9faGVhZGVyOyBlc2NhcGUgbW9kZXMgMC0zIGFyZSB1c2VkIGlmIHNob3J0VmlkZW9IZWFkZXI9PTAsCi0gKiAgICAgICAgICAgICAgICAgICAgICAgICAgIGFuZCBlc2NhcGUgbW9kZSA0IGlzIHVzZWQgd2hlbiBzaG9ydFZpZGVvSGVhZGVyPT0xLgotICogW2luXSBzdGFydCAgICAgICAgICAgc3RhcnQgaW5kaWNhdGVzIHdoZXRoZXIgdGhlIGVuY29kaW5nIGJlZ2lucyB3aXRoIDB0aCBlbGVtZW50Ci0gKiAgICAgICAgICAgICAgICAgICAgICBvciAxc3QuCi0gKiBbb3V0XSAgICBwcEJpdFN0cmVhbSAgICAgKnBwQml0U3RyZWFtIGlzIHVwZGF0ZWQgYWZ0ZXIgdGhlIGJsb2NrIGlzCi0gKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRlY29kZWQsIHNvIHRoYXQgaXQgcG9pbnRzIHRvIHRoZSBjdXJyZW50IGJ5dGUKLSAqICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaW4gdGhlIGJpdCBzdHJlYW0gYnVmZmVyCi0gKiBbb3V0XSAgICBwQml0T2Zmc2V0ICAgICAgKnBCaXRPZmZzZXQgaXMgdXBkYXRlZCBzbyB0aGF0IGl0IHBvaW50cyB0byB0aGUKLSAqICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY3VycmVudCBiaXQgcG9zaXRpb24gaW4gdGhlIGJ5dGUgcG9pbnRlZCBieQotICogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqcHBCaXRTdHJlYW0KLSAqIFtvdXRdICAgIHBEc3QgICAgICAgICAgICBwb2ludGVyIHRvIHRoZSBjb2VmZmljaWVudCBidWZmZXIgb2YgY3VycmVudAotICogICAgICAgICAgICAgICAgICAgICAgICAgICAgICBibG9jay4gU2hvdWxkIGJlIDMyLWJpdCBhbGlnbmVkCi0gKgotICogUmV0dXJuIFZhbHVlOgotICogU3RhbmRhcmQgT01YUmVzdWx0IHJlc3VsdC4gU2VlIGVudW1lcmF0aW9uIGZvciBwb3NzaWJsZSByZXN1bHQgY29kZXMuCi0gKgotICovCi0KLU9NWFJlc3VsdCBhcm1WQ000UDJfRGVjb2RlVkxDWmlnemFnX0ludHJhKAotICAgICBjb25zdCBPTVhfVTggKiogcHBCaXRTdHJlYW0sCi0gICAgIE9NWF9JTlQgKiBwQml0T2Zmc2V0LAotICAgICBPTVhfUzE2ICogcERzdCwKLSAgICAgT01YX1U4IHByZWREaXIsCi0gICAgIE9NWF9JTlQgc2hvcnRWaWRlb0hlYWRlciwgCi0gICAgIE9NWF9VOCAgc3RhcnQKLSk7Ci0KLS8qK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AgICAgIGFuZCBlc2NhcGUgbW9kZSA0IGlzIHVzZWQgd2hlbiBzaG9ydFZpZGVvSGVhZGVyPT0xLgotICogW2luXSBzdGFydCAgICAgICAgICAgc3RhcnQgaW5kaWNhdGVzIHdoZXRoZXIgdGhlIGVuY29kaW5nIGJlZ2lucyB3aXRoIAotICogICAgICAgICAgICAgICAgICAgICAgMHRoIGVsZW1lbnQgb3IgMXN0LgotICogW2luL291dF0gcExhc3QgICAgICAgcG9pbnRlciB0byBsYXN0IHN0YXR1cyBmbGFnCi0gKiBbaW5dIHJ1bkJlZ2luU2luZ2xlTGV2ZWxFbnRyaWVzTDAgICAgICBUaGUgcnVuIHZhbHVlIGZyb20gd2hpY2ggbGV2ZWwgCi0gKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB3aWxsIGJlIGVxdWFsIHRvIDE6IGxhc3QgPT0gMAotICogW2luXSBJbmRleEJlZ2luU2luZ2xlTGV2ZWxFbnRyaWVzTDAgICAgQXJyYXkgaW5kZXggaW4gdGhlIFZMQyB0YWJsZSAKLSAqICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBvaW50aW5nIHRvIHRoZSAgCi0gKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBydW5CZWdpblNpbmdsZUxldmVsRW50cmllc0wwIAotICogW2luXSBydW5CZWdpblNpbmdsZUxldmVsRW50cmllc0wxICAgICAgVGhlIHJ1biB2YWx1ZSBmcm9tIHdoaWNoIGxldmVsIAotICogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgd2lsbCBiZSBlcXVhbCB0byAxOiBsYXN0ID09IDEKLSAqIFtpbl0gSW5kZXhCZWdpblNpbmdsZUxldmVsRW50cmllc0wxICAgIEFycmF5IGluZGV4IGluIHRoZSBWTEMgdGFibGUgCi0gKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwb2ludGluZyB0byB0aGUgIAotICogIC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YWJsZUwxLAotICAgICAgICAgICAgICBjb25zdCBBUk1fVkxDMzIgKnBWbGNUYWJsZUwxLAotICAgICAgICAgICAgICBjb25zdCBPTVhfVTggICogcExNQVhUYWJsZUwwLAotICAgICAgICAgICAgICBjb25zdCBPTVhfVTggICogcExNQVhUYWJsZUwxLAotICAgICAgICAgICAgICBjb25zdCBPTVhfVTggICogcFJNQVhUYWJsZUwwLAotICAgICAgICAgICAgICBjb25zdCBPTVhfVTggICogcFJNQVhUYWJsZUwxLAotICAgICAgICAgICAgICBjb25zdCBPTVhfVTggICogcFppZ3phZ1RhYmxlCi0pOwotCi0vKioKLSAqIEZ1bmN0aW9uOiBhcm1WQ000UDJfUHV0VkxDQml0cwotICoKLSAqIERlc2NyaXB0aW9uOgotICogQ2hlY2tzIHRoZSB0eXBlIG9mIEVzY2FwZSBNb2RlIGFuZCBwdXQgZW5jb2RlZCBiaXRzIGZvciAKLSAqIHF1YW50aXplZCBEQ1QgY29lZmZpY2llbnRzLgotICoKLSAqIFJlbWFya3M6Ci0gKgotICogUGFyYW1ldGVyczoKLSAqIFtpbl0JIHBwQml0U3RyZWFtICAgICAgcG9pbnRlciB0byB0aGUgcG9pbnRlciB0byB0aGUgY3VycmVudCBieXRlIGluCi0gKgkJCQkJCSAgdGhlIGJpdCBzdHJlYW0KLSAqIFtpbl0JIHBCaXRPZmZzZXQgICAgICAgcG9pbnRlciB0byB0aGUgYml0IHBvc2l0aW9uIGluIHRoZSBieXRlIHBvaW50ZWQKLSAqICAgICAgICAgICAgICAgICAgICAgICAgYnkgKnBwQml0U3RyZWFtLiBWYWxpZCB3aXRoaW4gMCB0byA3Ci0gKiBbaW5dIHNob3J0VmlkZW9IZWFkZXIgYmluYXJ5IGZsYWcgaW5kaWNhdGluZyBwcmVzZW5jZSBvZiBzaG9ydF92aWRlb19oZWFkZXI7IGVzY2FwZSBtb2RlcyAwLTMgYXJlIHVzZWQgaWYgc2hvcnRWaWRlb0hlYWRlcj09MCwKLSAqICAgICAgICAgICAgICAgICAgICAgICAgICAgYW5kIGVzY2FwZSBtb2RlIDQgaXMgdXNlZCB3aGVuIHNob3J0VmlkZW9IZWFkZXI9PTEuCi0gKiBbaW5dICBzdGFydCAgICAgICAgICAgIHN0YXJ0IGluZGljYXRlcyB3aGV0aGVyIHRoZSBlbmNvZGluZyBiZWdpbnMgd2l0aCAKLSAqICAgICAgICAgICAgICAgICAgICAgICAgMHRoIGVsZW1lbnQgb3IgMXN0LgotICogW2luXSAgbWF4U3RvcmVSdW5MMCAgICBNYXggc3RvcmUgcG9zc2libGUgKGNvbnNpZGVyaW5nIGxhc3QgYW5kIGludGVyL2ludHJhKQotICogICAgICAgICAgICAgICAgICAgICAgICBmb3IgbGFzdCA9IDAKLSAqIFtpbl0gIG1heFN0b3JlUnVuTDEgICAgTWF4IHN0b3JlIHBvc3NpYmxlIChjb25zaWRlcmluZyBsYXN0IGFuZCBpbnRlci9pbnRyYSkKLSAqICAgICAgICAgICAgICAgICAgICAgICAgZm9yIGxhc3QgPSAxCi0gKiBbaW5dICBtYXhSdW5Gb3JNdWx0aXBsZUVudHJpZXNMMCAKLSAqICAgICAgICAgICAgICAgICAgICAgICAgVGhlIHJ1biB2YWx1ZSBhZnRlciB3aGljaCBsZXZlbCAKLSAqICAgICAgICAgICAgICAgICAgICAgICAgd2lsbCBiZSBlcXVhbCB0byAxOiAKLSAqICAgICAgICAgICAgICAgICAgICAgICAgKGNvbnNpZGVyaW5nIGxhc3QgYW5kIGludGVyL2ludHJhIHN0YXR1cykgZm9yIGxhc3QgPSAwCi0gKiBbaW5dICBtYXhSdW5Gb3JNdWx0aXBsZUVudHJpZXNMMSAKLSAqICAgICAgICAgICAgICAgICAgICAgICAgVGhlIHJ1biB2YWx1ZSBhZnRlciB3aGljaCBsZXZlbCAKLSAqICAgICAgICAgICAgICAgICAgICAgICAgd2lsbCBiZSBlcXVhbCB0byAxOiAKLSAqICAgICAgICAgICAgICAgICAgICAgICAgKGNvbnNpZGVyaW5nIGxh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NNNFAyX0h1ZmZfVGFibGVzX1ZMQy5jIGZvciBsYXN0ID09IDEKLSAqIFtvdXRdIHBRRGN0QmxrQ29lZiAgICAgcG9pbnRlciB0byB0aGUgcXVhbnRpemVkIERDVCBjb2VmZmljaWVudAotICogW291dF0gcHBCaXRTdHJlYW0gICAgICAqcHBCaXRTdHJlYW0gaXMgdXBkYXRlZCBhZnRlciB0aGUgYmxvY2sgaXMgZW5jb2RlZAotICogICAgICAgICAgICAgICAgICAgICAgICBzbyB0aGF0IGl0IHBvaW50cyB0byB0aGUgY3VycmVudCBieXRlIGluIHRoZSBiaXQKLSAqICAgICAgICAgICAgICAgICAgICAgICAgc3RyZWFtIGJ1ZmZlci4KLSAqIFtvdXRdIHBCaXRPZmZzZXQgICAgICAgKnBCaXRPZmZzZXQgaXMgdXBkYXRlZCBzbyB0aGF0IGl0IHBvaW50cyB0byB0aGUKLSAqICAgICAgICAgICAgICAgICAgICAgICAgY3VycmVudCBiaXQgcG9zaXRpb24gaW4gdGhlIGJ5dGUgcG9pbnRlZCBieQotICogICAgICAgICAgICAgICAgICAgICAgICAqcHBCaXRTdHJlYW0uCi0gKgotICogUmV0dXJuIFZhbHVlOgotICogU3RhbmRhcmQgT01YUmVzdWx0IHJlc3VsdC4gU2VlIGVudW1lcmF0aW9uIGZvciBwb3NzaWJsZSByZXN1bHQgY29kZXMuCi0gKgotICovCi0KLQotT01YUmVzdWx0IGFybVZDTTRQMl9QdXRWTENCaXRzICgKLSAgICAgICAgICAgICAgT01YX1U4ICoqcHBCaXRTdHJlYW0sCi0gICAgICAgICAgICAgIE9NWF9JTlQgKiBwQml0T2Zmc2V0LAotICAgICAgICAgICAgICBjb25zdCBPTVhfUzE2ICpwUURjdEJsa0NvZWYsCi0gICAgICAgICAgICAgIE9NWF9JTlQgc2hvcnRWaWRlb0hlYWRlciwKLSAgICAgICAgICAgICAgT01YX1U4IHN0YXJ0LAotICAgICAgICAgICAgICBPTVhfVTggbWF4U3RvcmVSdW5MMCwK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AgICAgICAgICAgIHRoZSBiaXQgc3RyZWFtCi0gKiBbaW5dCSBwQml0T2Zmc2V0ICAgICAgICAgcG9pbnRlciB0byB0aGUgYml0IHBvc2l0aW9uIGluIHRoZSBieXRlIHBvaW50ZWQKLSAqICAgICAgICAgICAgICAgICAgICAgICAgICBieSAqcHBCaXRTdHJlYW0uIFZhbGlkIHdpdGhpbiAwIHRvIDcKLSAqIFtpbl0gIHJ1biAgICAgICAgICAgICAgICBSdW4gdmFsdWUgKGNvdW50IG9mIHplcm9zKSB0byBiZSBlbmNvZGVkICAKLSAqIFtpbl0gIGxldmVsICAgICAgICAgICAgICBMZXZlbCB2YWx1ZSAobm9uLXplcm8gdmFsdWUpIHRvIGJlIGVuY29kZWQKLSAqIFtpbl0gIHJ1blBsdXMgICAgICAgICAgICBDYWxjdWxhdGVkIGFzIHJ1blBsdXMgPSBydW4gLSAoUk1BWCArIDEpICAKLSAqIFtpbl0gIGxldmVsUGx1cyAgICAgICAgICBDYWxjdWxhdGVkIGFzIAotICogICAgICAgICAgICAgICAgICAgICAgICAgIGxldmVsUGx1cyA9IHNpZ24obGV2ZWwpKlthYnMobGV2ZWwpIC0gTE1BWF0KLSAqIFtpbl0gIGZNb2RlICAgICAgICAgICAgICBGbGFnIGluZGljYXRpbmcgdGhlIGVzY2FwZSBtb2RlcwotICogW2luXSAgbGFzdCAgICAgICAgICAgICAgIHN0YXR1cyBvZiB0aGUgbGFzdCBmbGFnCi0gKiBbaW5dICBtYXhSdW5Gb3JNdWx0aXBsZUVudHJpZXMgCi0gKiAgICAgICAgICAgICAgICAgICAgICAgICAgVGhlIHJ1biB2YWx1ZSBhZnRlciB3aGljaCBsZXZlbCB3aWxsIGJlIGVxdWFsIHRvIDE6IAotICogICAgICAgICAgICAgICAgICAgICAgICAgIChjb25zaWRlcmluZyBsYXN0IGFuZCBpbnRlci9pbnRyYSBzdGF0dXMpCi0gKiBbaW5dICBwUnVuSW5kZXhUYWJsZSAgICAgUnVuIEluZGV4IH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dpZHRoIG9mIHRoZSBjdXJyZW50IGJsb2NrCi0gKiAgW2luXSAgICBpSGVpZ2h0ICAgICBIZWlnaHQgb2YgdGhlIGN1cnJlbnQgYmxvY2sKLSAqICBbaW5dICAgIGR4ICAgICAgICAgICAgICBGcmFjdGlvbmFsIHBhcnQgb2YgaG9yaXpvbnRhbCBtb3Rpb24gdmVjdG9yIAotICogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY29tcG9uZW50IGluIDEvOCBwaXhlbCB1bml0ICgwfjcpIAotICogIFtpbl0gICAgZHkgICAgICAgICAgICAgIEZyYWN0aW9uYWwgcGFydCBvZiB2ZXJ0aWNhbCBtb3Rpb24gdmVjdG9yIAotICogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY29tcG9uZW50IGluIDEvOCBwaXhlbCB1bml0ICgwfjcpCi0gKiAgW291dF0gICBwRHN0ICAgICAgICAgICAgUG9pbnRlciB0byB0aGUgaW50ZXJwb2xhdGlvbiBidWZmZXIKLSAqCi0gKiBSZXR1cm4gVmFsdWU6Ci0gKiBTdGFuZGFyZCBPTVhSZXN1bHQgdmFsdWUuCi0gKgotICovCi0gT01YUmVzdWx0IGFybVZDTTRQMTBfSW50ZXJwb2xhdGVfQ2hyb21hKAotICAgICAgICBPTVhfVTggICAgICAqcFNyYywKLSAgICAgICAgT01YX1UzMiAgICAgaVNyY1N0ZXAsCi0gICAgICAgIE9NWF9VOCAgICAgICpwRHN0LAotICAgICAgICBPTVhfVTMyICAgICBpRHN0U3RlcCwKLSAgICAgICAgT01YX1UzMiAgICAgaVdpZHRoLAotICAgICAgICBPTVhfVTMyICAgICBpSGVpZ2h0LAotICAgICAgICBPTVhfVTMyICAgICBkeCwKLSAgICAgICAgT01YX1UzMiAgICAgZHkKLSk7Ci0KLS8qKgotICogRnVuY3Rpb246IGFybVZDTTRQMTBfSW50ZXJwb2xhdGVfTHVtYQotICoKLSAqIERlc2NyaXB0aW9uOgotICogVGhpcyBmdW5jdGlvbiBwZXJmb3JtcyBpbnRlcnBvbGF0aW9uIGZvciBsdW1hIGNvbXBvbmVudHMuCi0gKgotICogUmVtYXJrczoKLSAqCi0gKiAgW2luXSAgICBwU3JjICAgICAgICAgICAgUG9pbnRlciB0byB0b3AtbGVmdCBjb3JuZXIgb2YgYmxvY2sgdXNlZCB0byAKLSAqICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGludGVycG9sYXRlIGluIHRoZSByZWNvbnN0cnVjdGVkIGZyYW1lIHBsYW5lCi0gKiAgW2luXSAgICBpU3JjU3RlcCAgICBTdGVwIG9mIHRoZSBzb3VyY2UgYnVmZmVyLgotICogIFtpbl0gICAgaURzdFN0ZXAgICAgU3RlcCBvZiB0aGUgZGVzdGluYXRpb24oaW50ZXJwb2xhdGlvbikgYnVmZmVyLgotICogIFtpbl0gICAgaVdpZHRoICAgICAgV2lkdGggb2YgdGhlIGN1cnJlbnQgYmxvY2sKLSAqICBbaW5dICAgIGlIZWlnaHQgICAgIEhlaWdodCBvZiB0aGUgY3VycmVudCBibG9jawotICogIFtpbl0gICAgZHggICAgICAgICAgICAgIEZyYWN0aW9uYWwgcGFydCBvZiBob3Jpem9udGFsIG1vdGlvbiB2ZWN0b3IgCi0gKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb21wb25lbnQgaW4gMS80IHBpeGVsIHVuaXQgKDB+MykgCi0gKiAgW2luXSAgICBkeSAgICAgICAgICAgICAgRnJhY3Rpb25hbCBwYXJ0IG9mIHZlcnRpY2FsIG1vdGlvbiB2ZWN0b3IgCi0gKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb21wb25lbnQgaW4gMS80IHBpeGVsIHVuaXQgKDB+MykgCi0gKiAgW291dF0gICBwRHN0ICAgICAgICAgICAgUG9pbnRlciB0byB0aGUgaW50ZXJwb2xhdGlvbiBidWZmZXIK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rIEluZm9ybWF0aW9uICAgKi8KLS8qIEEgZGF0YSBzdHJ1Y3R1cmUgY29udGFpbmluZyBtYWNyb2Jsb2NrIHBhcmFtZXRlcnMgZm9yIAotICogbW90aW9uIGVzdGltYXRpb24gZnVuY3Rpb25zIGlzIGRlZmluZWQgYXMgZm9sbG93czogIAotICovCi0KLXR5cGVkZWYgc3RydWN0IHsKLSAgICBPTVhfUzMyIHNsaWNlSWQ7ICAgICAgICAgICAgICAgICAvKiBzbGljZSBudW1iZXIgKi8KLSAgICBPTVhWQ000UDJNYWNyb2Jsb2NrVHlwZSBtYlR5cGU7ICAvKiBNQiB0eXBlOiBPTVhfVkNfSU5UUkEsIE9NWF9WQ19JTlRFUiwgb3IgT01YX1ZDX0lOVEVSNCAqLwotICAgIE9NWF9TMzIgcXA7ICAgICAgICAgICAgICAgICAgICAgIC8qIHF1YW50aXphdGlvbiBwYXJhbWV0ZXIqLwotICAgIE9NWF9VMzIgY2JweTsgICAgICAgICAgICAgICAgICAgIC8qIENCUCBMdW1hICovCi0gICAgT01YX1UzMiBjYnBjOyAgICAgICAgICAgICAgICAgICAgLyogQ0JQIENocm9tYSAqLwotICAgIE9NWFZDTW90aW9uVmVjdG9yIHBNVjBbMl1bMl07ICAgIC8qIG1vdGlvbiB2ZWN0b3IsIHJlcHJlc2VudGVkIHVzaW5nIDEvMi1wZWwgdW5pdHMsIAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqIHBNVjBbYmxvY2t5XVtibG9ja3hdIChibG9ja3kgPSAwfjEsIGJsb2NreCA9MH4xKSAKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKi8KLSAgICBPTVhWQ01vdGlvblZlY3RvciBwTVZQcmVkWzJdWzJdOyAvKiBtb3Rpb24gdmVjdG9yIHByZWRpY3Rpb24sIHJlcHJlc2VudGVkIHVzaW5nIDEvMi1wZWwgdW5pdHMsIAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC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NvbHVtbiBjb2VmZmljaWVudHMgYXJlIHJldHVybmVkIGluIAotICogdGhlIHVwZGF0ZWQgY29lZmZpY2llbnQgYnVmZmVycy4gCi0gKgotICogSW5wdXQgQXJndW1lbnRzOgotICogICAKLSAqICAgcFNyYyAtIHBvaW50ZXIgdG8gdGhlIHBpeGVscyBvZiBjdXJyZW50IGludHJhIGJsb2NrOyBtdXN0IGJlIGFsaWduZWQgb24gCi0gKiAgICAgICAgICAgIGFuIDgtYnl0ZSBib3VuZGFyeS4gCi0gKiAgIHBQcmVkQnVmUm93IC0gcG9pbnRlciB0byB0aGUgY29lZmZpY2llbnQgcm93IGJ1ZmZlciBjb250YWluaW5nIAotICogICAgICAgICAgICAoKG51bV9tYl9wZXJfcm93ICogMiArIDEpICogOCkgZWxlbWVudHMgb2YgdHlwZSBPTVhfUzE2LiAKLSAqICAgICAgICAgICAgQ29lZmZpY2llbnRzIGFyZSBvcmdhbml6ZWQgaW50byBibG9ja3Mgb2YgZWlnaHQgYXMgZGVzY3JpYmVkIAotICogICAgICAgICAgICBiZWxvdyAoSW50ZXJuYWwgUHJlZGljdGlvbiBDb2VmZmljaWVudCBVcGRhdGUgUHJvY2VkdXJlcykuICBUaGUgCi0gKiAgICAgICAgICAgIERDIGNvZWZmaWNpZW50IGlzIGZpcnN0LCBhbmQgdGhlIHJlbWFpbmluZyBidWZmZXIgbG9jYXRpb25zIAotICogICAgICAgICAgICBjb250YWluIHRoZSBxdWFudGl6ZWQgQUMgY29lZmZpY2llbnRzLiBFYWNoIGdyb3VwIG9mIGVpZ2h0IHJvdyAKLSAqICAgICAgICAgICAgYnVmZmVyIGVsZW1lbnRzIGNvbWJpbmVkIHdpdGggb25lIGVsZW1lbnQgZWlnaHQgZWxlbWVudHMgYWhlYWQgCi0gKiAgICAgICAgICAgIGNvbnRhaW5zIHRoZSBjb2VmZmljaWVudCBwcmVkaWN0b3JzIG9mIHRoZSBuZWlnaGJvcmluZyBibG9jayAKLSAqICAgICAgICAgICAgd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dIHdpdGggdGhlIGZvbGxvd2luZyByZXN0cmljdGlvbnM6IGkpIHBCU1tpXT09IDQgbWF5IAotICogICAgICAgICAgICBvY2N1ciBvbmx5IGZvciAwPD1pPD0zLCBpaSkgcEJTW2ldPT0gNCBpZiBhbmQgb25seSBpZiBwQlNbaV4zXT09IAotICogICAgICAgICAgICA0LiBNdXN0IGJlIDQtYnl0ZSBhbGlnbmVkLiAKLSAqCi0gKiBPdXRwdXQgQXJndW1lbnRzOgotICogICAKLSAqICAgcFNyY0RzdCAtIHBvaW50ZXIgdG8gZmlsdGVyZWQgb3V0cHV0IG1hY3JvYmxvY2suIAotICoKLSAqIFJldHVybiBWYWx1ZToKLSAqICAgIAotICogICAgT01YX1N0c19Ob0VyciAtIG5vIGVycm9yIAotICogICAgT01YX1N0c19CYWRBcmdFcnIgLSBiYWQgYXJndW1lbnRzIAotICogICAgLSAgICAgb25lIG9yIG1vcmUgb2YgdGhlIGZvbGxvd2luZyBwb2ludGVycyBpcyBOVUxMOiBwU3JjRHN0LCBwQWxwaGEsIAotICogICAgICAgICAgICAgIHBCZXRhLCBwVGhyZXNob2xkcyBvciBwQlMuIAotICogICAgLSAgICBwU3JjRHN0IGlzIG5vdCAxNi1ieXRlIGFsaWduZWQuIAotICogICAgLSAgICBlaXRoZXIgcFRocmVzaG9sZHMgb3IgcEJTIGlzIG5vdCBhbGlnbmVkIG9uIGEgNC1ieXRlIGJvdW5kYXJ5LiAKLSAqICAgIC0gICAgb25lIG9yIG1vcmUgZW50cmllcyBpbiB0aGUgdGFibGUgcEFscGhhWzAuLjNdIGlzIG91dHNpZGUgdGhlIHJhbmdlIAotICogICAgICAgICAgICAgIFswLDI1NV0uIAotICogICAgLSAgICBvbmUgb3IgbW9yZSBlbnRyaWVzIGluIHRoZSB0YWJsZSBwQmV0YVswLi4zXSBpcyBvdXRzaWRlIHRoZSByYW5nZSAKLSAqICAgICAgICAgICAgICBbMCwxOF0uIAotICogICAgLSAgICBvbmUgb3IgbW9yZS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AgICAgICAgICAgICAgICAgICAgICAgIHBQcmVkMSBbeSAqIGlQcmVkU3RlcDEgKyB4XSArIDEpID4+IDEpOwotICAgICAgICB9Ci0gICAgfQotCi0gICAgcmV0dXJuIE9NWF9TdHNfTm9FcnI7Ci19Ci0KLS8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgotICogICAgICAgICAgICAgICAgICAgICAgICAgICAgICBFTkQgT0YgRklMRQotICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotCmRpZmYgLS1naXQgYS9tZWRpYS9saWJzdGFnZWZyaWdodC9jb2RlY3Mvb24yL2gyNjRkZWMvb214ZGwvcmVmZXJlbmNlL3ZjL2NvbW0vc3JjL2FybVZDQ09NTV9TQUQuYyBiL21lZGlhL2xpYnN0YWdlZnJpZ2h0L2NvZGVjcy9vbjIvaDI2NGRlYy9vbXhkbC9yZWZlcmVuY2UvdmMvY29tbS9zcmMvYXJtVkNDT01NX1NBRC5jCmRlbGV0ZWQgZmlsZSBtb2RlIDEwMDY0NAppbmRleCBkNDFhYzlhLi4wMDAwMDAwCi0tLSBhL21lZGlhL2xpYnN0YWdlZnJpZ2h0L2NvZGVjcy9vbjIvaDI2NGRlYy9vbXhkbC9yZWZlcmVuY2UvdmMvY29tbS9zcmMvYXJtVkNDT01NX1NBRC5jCisrKyAvZGV2L251bGwKQEAgLTEsNzUgKzAsMCBAQAotLyoqCi0gKiAKLSAqIEZpbGUgTmFtZTogIGFybVZDQ09NTV9TQUQuYwotICogT3Blbk1BWCBETDogdjEuMC4yCi0gKiBSZXZpc2lvbjogICA5NjQxCi0gKiBEYXRlOiAgICAgICBUaHVyc2RheSwgRmVicnVhcnkgNywgMjAwOAotICogCi0gKiAoYykgQ29weXJpZ2h0IDIwMDctMjAwOCBBUk0gTGltaXRlZC4gQWxs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KLQlPTVhfVTMyIAlpU3RlcFJlZiwKLQlPTVhfUzMyKglwRHN0U0FELAotCU9NWF9VMzIJCWlIZWlnaHQsCi0JT01YX1UzMgkJaVdpZHRoCi0pCi17Ci0gICAgT01YX0lOVCAgICAgeCwgeTsKLSAgICAKLSAgICAvKiBjaGVjayBmb3IgYXJndW1lbnQgZXJyb3IgKi8KLSAgICBhcm1SZXRBcmdFcnJJZihwU3JjT3JnID09IE5VTEwsIE9NWF9TdHNfQmFkQXJnRXJyKQotICAgIGFybVJldEFyZ0VycklmKHBTcmNSZWYgPT0gTlVMTCwgT01YX1N0c19CYWRBcmdFcnIpCi0gICAgYXJtUmV0QXJnRXJySWYocERzdFNBRCA9PSBOVUxMLCBPTVhfU3RzX0JhZEFyZ0VycikKLSAgICAKLSAgICAqcERzdFNBRCA9IDA7Ci0gICAgZm9yICh5ID0gMDsgeSA8IGlIZWlnaHQ7IHkrKykKLSAgICB7Ci0gICAgICAgIGZvciAoeCA9IDA7IHggPCBpV2lkdGg7IHgrKykKLSAgICAgICAgewotICAgICAgICAgICAgKnBEc3RTQUQgKz0gYXJtQWJzKHBTcmNPcmcgWyh5ICogaVN0ZXBPcmcpICsgeF0gLSAKLSAgICAgICAgICAgICAgICAgICAgICAgcFNyY1JlZiBbKHkgKiBpU3RlcFJlZikgKyB4XSk7Ci0gICAgICAgIH0KLSAgICB9Ci0gICAgCi0gICAgcmV0dXJuIE9NWF9TdHNfTm9FcnI7Ci19Ci0KLS8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgotICogICAgICAgICAgICAgICAgICAgICAgICAgICAgICBFTkQgT0YgRklMRQotICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotCmRpZmYgLS1naXQgYS9tZWRpYS9saWJzdGFnZWZyaWdodC9jb2RlY3Mvb24y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c19CYWRBcmdFcnIpCi0gICAgYXJtUmV0QXJnRXJySWYocFByZWQxID09IE5VTEwsIE9NWF9TdHNfQmFkQXJnRXJyKQotICAgIGFybVJldEFyZ0VycklmKHBEc3RQcmVkID09IE5VTEwsIE9NWF9TdHNfQmFkQXJnRXJyKQotICAgIGFybVJldEFyZ0VycklmKChpSGVpZ2h0ICE9IDgpICYmIChpSGVpZ2h0ICE9IDE2KSwgT01YX1N0c19CYWRBcmdFcnIpCi0gICAgYXJtUmV0QXJnRXJySWYoYXJtTm90MTZCeXRlQWxpZ25lZChwRHN0UHJlZCksIE9NWF9TdHNfQmFkQXJnRXJyKQotICAgIGFybVJldEFyZ0VycklmKChpUHJlZFN0ZXAwID09IDApIHx8IChpUHJlZFN0ZXAwICYgMTUpLCBPTVhfU3RzX0JhZEFyZ0VycikKLSAgICBhcm1SZXRBcmdFcnJJZigoaVByZWRTdGVwMSA9PSAwKSB8fCAoaVByZWRTdGVwMSAmIDE1KSwgT01YX1N0c19CYWRBcmdFcnIpCi0gICAgYXJtUmV0QXJnRXJySWYoKGlEc3RTdGVwID09IDApIHx8IChpRHN0U3RlcCAmIDE1KSwgT01YX1N0c19CYWRBcmdFcnIpCi0KLSAgICByZXR1cm4gYXJtVkNDT01NX0F2ZXJhZ2UgCi0gICAgICAgIChwUHJlZDAsIHBQcmVkMSwgaVByZWRTdGVwMCwgaVByZWRTdGVwMSwgcERzdFByZWQsIGlEc3RTdGVwLCAxNiwgaUhlaWdodCk7Ci19Ci0KLS8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgotICogICAgICAgICAgICAgICAgICAgICAgICAgICAgICBFTkQgT0YgRklMRQotICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotCmRpZmYgLS1naXQgYS9tZWRpYS9saWJzdGFnZWZyaWdod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gICAgICAgcFNyY0RzdFBsYW5lIFt5ICogaVBsYW5lU3RlcCArIChpRnJhbWVXaWR0aCAtIDEpXTsKLSAgICAgICAgfQotICAgIH0KLQotICAgIHJldHVybiBPTVhfU3RzX05vRXJyOwotfQotCi0vKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKLSAqICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgRU5EIE9GIEZJTEUKLSAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLQpkaWZmIC0tZ2l0IGEvbWVkaWEvbGlic3RhZ2VmcmlnaHQvY29kZWNzL29uMi9oMjY0ZGVjL29teGRsL3JlZmVyZW5jZS92Yy9jb21tL3NyYy9vbXhWQ0NPTU1fTGltaXRNVlRvUmVjdC5jIGIvbWVkaWEvbGlic3RhZ2VmcmlnaHQvY29kZWNzL29uMi9oMjY0ZGVjL29teGRsL3JlZmVyZW5jZS92Yy9jb21tL3NyYy9vbXhWQ0NPTU1fTGltaXRNVlRvUmVjdC5jCmRlbGV0ZWQgZmlsZSBtb2RlIDEwMDY0NAppbmRleCBhZjA0NTgyLi4wMDAwMDAwCi0tLSBhL21lZGlhL2xpYnN0YWdlZnJpZ2h0L2NvZGVjcy9vbjIvaDI2NGRlYy9vbXhkbC9yZWZlcmVuY2UvdmMvY29tbS9zcmMvb214VkNDT01NX0xpbWl0TVZUb1JlY3QuYworKysgL2Rldi9udWxsCkBAIC0xLDgxICswLDAgQEAKLS8qKgotICogCi0gKiBGaWxlIE5hbWU6ICBvbXhWQ0NPTU1fTGltaXRNVlRvUmVjdC5jCi0gKiBPcGVuTUFYIERMOiB2MS4wLjIKLSAqIFJldmlzaW9uOiAgIDk2NDEKLSAqIERhdGU6ICAgICAgIFRodXJzZGF5LCBGZWJydWFyeSA3LCAyMDA4Ci0gKiAKLS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LCBPTVhfU3RzX0JhZEFyZ0VycikKLQotICAgIHJldHVybiBhcm1WQ0NPTU1fU0FEIAotICAgICAgICAocFNyY09yZywgaVN0ZXBPcmcsIHBTcmNSZWYsIGlTdGVwUmVmLCBwRHN0U0FELCBpSGVpZ2h0LCAxNik7Ci19Ci0KLS8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgotICogICAgICAgICAgICAgICAgICAgICAgICAgICAgICBFTkQgT0YgRklMRQotICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotCmRpZmYgLS1naXQgYS9tZWRpYS9saWJzdGFnZWZyaWdodC9jb2RlY3Mvb24yL2gyNjRkZWMvb214ZGwvcmVmZXJlbmNlL3ZjL2NvbW0vc3JjL29teFZDQ09NTV9TQURfOHguYyBiL21lZGlhL2xpYnN0YWdlZnJpZ2h0L2NvZGVjcy9vbjIvaDI2NGRlYy9vbXhkbC9yZWZlcmVuY2UvdmMvY29tbS9zcmMvb214VkNDT01NX1NBRF84eC5jCmRlbGV0ZWQgZmlsZSBtb2RlIDEwMDY0NAppbmRleCAxNDIxZDk5Li4wMDAwMDAwCi0tLSBhL21lZGlhL2xpYnN0YWdlZnJpZ2h0L2NvZGVjcy9vbjIvaDI2NGRlYy9vbXhkbC9yZWZlcmVuY2UvdmMvY29tbS9zcmMvb214VkNDT01NX1NBRF84eC5jCisrKyAvZGV2L251bGwKQEAgLTEsODAgKzAsMCBAQAotLyoqCi0gKiAKLSAqIEZpbGUgTmFtZTogIG9teFZDQ09NTV9TQURfOHguYwotICogT3Blbk1BWCBETDogdjEuMC4yCi0gKiBSZXZpc2lvbjogICA5NjQxCi0gKiBEYXRlOiAgICAgICBUaHVyc2RheSwgRmVicnVhcnkgNywgMjAwOAotICogCi0gKiAoYykgQ29weXJpZ2h0IDIwMDctMjAwO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ldEFyZ0VycklmKChpSGVpZ2h0ICE9IDE2KSAmJiAoaUhlaWdodCAhPSA4KSAmJiAoaUhlaWdodCAhPSA0KSwgT01YX1N0c19CYWRBcmdFcnIpCi0gICAgYXJtUmV0QXJnRXJySWYoYXJtTm90OEJ5dGVBbGlnbmVkKHBTcmNPcmcpLCBPTVhfU3RzX0JhZEFyZ0VycikKLSAgICBhcm1SZXRBcmdFcnJJZigoaVN0ZXBPcmcgPT0gMCkgfHwgKGlTdGVwT3JnICYgNyksIE9NWF9TdHNfQmFkQXJnRXJyKQotICAgIGFybVJldEFyZ0VycklmKChpU3RlcFJlZiA9PSAwKSB8fCAoaVN0ZXBSZWYgJiA3KSwgT01YX1N0c19CYWRBcmdFcnIpCi0KLSAgICByZXR1cm4gYXJtVkNDT01NX1NBRCAKLSAgICAgICAgKHBTcmNPcmcsIGlTdGVwT3JnLCBwU3JjUmVmLCBpU3RlcFJlZiwgcERzdFNBRCwgaUhlaWdodCwgOCk7Ci19Ci0KLS8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgotICogICAgICAgICAgICAgICAgICAgICAgICAgICAgICBFTkQgT0YgRklMRQotICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotCmRpZmYgLS1naXQgYS9tZWRpYS9saWJzdGFnZWZyaWdodC9jb2RlY3Mvb24yL2gyNjRkZWMvb214ZGwvcmVmZXJlbmNlL3ZjL200cDEwL2FwaS9hcm1WQ000UDEwX0NBVkxDVGFibGVzLmggYi9tZWRpYS9saWJzdGFnZWZyaWdodC9jb2RlY3Mvb24yL2gyNjRkZWMvb214ZGwvcmVmZXJlbmNlL3ZjL200cDEwL2FwaS9hcm1WQ000UDEwX0NBVkxDVGFibGVzLmgKZGVsZXRlZCBmaWxlIG1vZGUgMTAwNjQ0CmluZGV4IDhkM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AgICAgICAgICAgICAgdEMrKzsKLSAgICAgICAgICAgIH0KLSAgICAgICAgICAgIGlmIChhcSA8IGJldGEpCi0gICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgdEMrKzsKLSAgICAgICAgICAgIH0KLSAgICAgICAgfQotICAgIAotICAgICAgICBkZWx0YSA9ICgoKHEwLXAwKTw8MikgKyAocDEtcTEpICsgNCkgPj4gMzsKLSAgICAgICAgZGVsdGEgPSBhcm1DbGlwKC10QywgdEMsIGRlbHRhKTsKLQotICAgICAgICBwUTBbLTEqU3RlcF0gPSAoT01YX1U4KWFybUNsaXAoMCwgMjU1LCBwMCArIGRlbHRhKTsKLSAgICAgICAgcFEwWyAwKlN0ZXBdID0gKE9NWF9VOClhcm1DbGlwKDAsIDI1NSwgcTAgLSBkZWx0YSk7Ci0KLSAgICAgICAgaWYgKENocm9tYUZsYWc9PTAgJiYgYXA8YmV0YSkKLSAgICAgICAgewotICAgICAgICAgICAgZGVsdGEgPSAocDIgKyAoKHAwK3EwKzEpPj4xKSAtIChwMTw8MSkpPj4xOwotICAgICAgICAgICAgZGVsdGEgPSBhcm1DbGlwKC10QzAsIHRDMCwgZGVsdGEpOwotICAgICAgICAgICAgcFEwWy0yKlN0ZXBdID0gKE9NWF9VOCkocDEgKyBkZWx0YSk7Ci0gICAgICAgIH0KLQotICAgICAgICBpZiAoQ2hyb21hRmxhZz09MCAmJiBhcTxiZXRhKQotICAgICAgICB7Ci0gICAgICAgICAgICBkZWx0YSA9IChxMiArICgocDArcTArMSk+PjEpIC0gKHExPDwxKSk+PjE7Ci0gICAgICAgICAgICBkZWx0YSA9IGFybUNsaXAoLXRDMCwgdEMwLCBkZWx0YSk7Ci0gICAgICAgICAgICBwUTBbIDEqU3RlcF0gPSAoT01YX1U4KShxMSArIGRlbHRhKTsKLSAgICAgICAgfQotICAgIH0KLSAgICBlbHNlIC8qIGJTPT00ICovCi0gICAgewotICAgICAgICBpZiAoQ2hyb21hRmxhZz09MCAmJiBhcDxiZXRhICYmIGFybUFicyhwMC1xMCk8KChhbHBoYT4+MikrMikpCi0gICAgICAgIHsKLSAgICAgICAgICAgIHBRMFstMSpTdGVwXSA9IChPTVhfVTgpKChwMiArIDIqcDEgKyAyKnAwICsgMipxMCArIHExICsgNCk+PjMpOwotICAgICAgICAgICAgcFEwWy0yKlN0ZXBdID0gKE9NWF9VOCkoKHAyICsgcDEgKyBwMCArIHEwICsgMik+PjIpOwotICAgICAgICAgICAgcFEwWy0zKlN0ZXBdID0gKE9NWF9VOCkoKDIqcDMgKyAzKnAyICsgcDEgKyBwMCArIHEwICsgNCk+PjMpOwotICAgICAgICB9Ci0gICAgICAgIGVsc2UKLSAgICAgICAgewotICAgICAgICAgICAgcFEwWy0xKlN0ZXBdID0gKE9NWF9VOCkoKDIqcDEgKyBwMCArIHExICsgMik+PjIpOwotICAgICAgICB9Ci0KLSAgICAgICAgaWYgKENocm9tYUZsYWc9PTAgJiYgYXE8YmV0YSAmJiBhcm1BYnMocDAtcTApPCgoYWxwaGE+PjIpKzIpKQotICAgICAgICB7Ci0gICAgICAgICAgICBwUTBbIDAqU3RlcF0gPSAoT01YX1U4KSgocTIgKyAyKnExICsgMipxMCArIDIqcDAgKyBwMSArIDQpPj4zKTsKLSAgICAgICAgICAgIHBRMFsgMSpTdGVwXSA9IChPTVhfVTgpKChxMiArIHExICsgcDAgKyBxMCArIDIpPj4yKTsKLSAgICAgICAgICAgIHBRMFsgMipTdGVwXSA9IChPTVhfVTgpKCgyKnEzICsgMypxMiArIHExICsgcTAgKyBwMCArIDQpPj4zKTsKLSAgICAgICAgfQotICAgICAgICBlbHNlCi0gICAgICAgIHsKLSAgICAgICAgICAgIHBRMFsgMCpTdGVwXSA9IChPTVhfVTgpKCgyKnExICsgcTAgKyBwMSArIDIpPj4yKTsKLSAgICAgICAgfQotICAgIH0KLQotICAgIERFQlVHX1BSSU5URl8xMygiRGVCbG9ja1BpeGVsOiAlMDJ4ICUwMnggJTAyeCAlMDJ4IHwgJTA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wgT01YX1N0c19FcnIpOwotCi0gICAgICAgIExldmVsU3VmZml4U2l6ZSA9IFN1ZmZpeExlbmd0aDsKLSAgICAgICAgaWYgKExldmVsUHJlZml4PT0xNCAmJiBTdWZmaXhMZW5ndGg9PTApCi0gICAgICAgIHsKLSAgICAgICAgICAgIExldmVsU3VmZml4U2l6ZSA9IDQ7Ci0gICAgICAgIH0KLSAgICAgICAgaWYgKExldmVsUHJlZml4PT0xNSkKLSAgICAgICAgewotICAgICAgICAgICAgTGV2ZWxTdWZmaXhTaXplID0gMTI7Ci0gICAgICAgIH0KLSAgICAgICAgCi0gICAgICAgIExldmVsU3VmZml4ID0gMDsKLSAgICAgICAgaWYgKExldmVsU3VmZml4U2l6ZSA+IDApCi0gICAgICAgIHsKLSAgICAgICAgICAgIExldmVsU3VmZml4ID0gYXJtR2V0Qml0cyhwcEJpdFN0cmVhbSwgcE9mZnNldCwgTGV2ZWxTdWZmaXhTaXplKTsKLSAgICAgICAgfQotCi0gICAgICAgIExldmVsQ29kZSA9IChMZXZlbFByZWZpeCA8PCBTdWZmaXhMZW5ndGgpICsgTGV2ZWxTdWZmaXg7Ci0KLQotICAgICAgICBpZiAoTGV2ZWxQcmVmaXg9PTE1ICYmIFN1ZmZpeExlbmd0aD09MCkKLSAgICAgICAgewotICAgICAgICAgICAgTGV2ZWxDb2RlICs9IDE1OwotICAgICAgICB9Ci0KLSAgICAgICAgLyogTGV2ZWxDb2RlID0gMioobWFnbml0dWRlLTEpICsgc2lnbiAqLwotCi0gICAgICAgIGlmIChpPT1Ub3RhbENvZWZmLTEtVHJhaWxpbmdPbmVzICYmIFRyYWlsaW5nT25lczwzKQotICAgICAgICB7Ci0gICAgICAgICAgICAvKiBMZXZlbCBtYWduaXR1ZGUgY2FuJ3QgYmUgMSAqLwotICAgICAgICAgICAgTGV2ZWxDb2RlICs9IDI7Ci0gICAgICAgIH0KLSAgICAgICAgaWYgKExldmVsQ29kZSAmIDEpCi0gICAgICAgIHsKLSAgICAgICAgICAgIC8qIDJhKzEgbWFwcyB0byAtYS0xICovCi0gICAgICAgICAgICBMZXZlbCA9ICgtTGV2ZWxDb2RlLTEpPj4xOwotICAgICAgICB9Ci0gICAgICAgIGVsc2UKLSAgICAgICAgewotICAgICAgICAgICAgLyogMmErMCBtYXBzIHRvICthKzEgKi8KLSAgICAgICAgICAgIExldmVsID0gKExldmVsQ29kZSsyKT4+MTsKLSAgICAgICAgfQotICAgICAgICBwTGV2ZWxbaV0gPSAoT01YX1MxNilMZXZlbDsKLQotICAgICAgICBERUJVR19QUklOVEZfMigiTGV2ZWxbJWRdID0gJWRcbiIsIGksIHBMZXZlbFtpXSk7Ci0KLSAgICAgICAgaWYgKFN1ZmZpeExlbmd0aD09MCkKLSAgICAgICAgewotICAgICAgICAgICAgU3VmZml4TGVuZ3RoPTE7Ci0gICAgICAgIH0KLSAgICAgICAgaWYgKCAoKExldmVsQ29kZT4+MSkrMSk+KDM8PChTdWZmaXhMZW5ndGgtMSkpICYmIFN1ZmZpeExlbmd0aDw2ICkKLSAgICAgICAgewotICAgICAgICAgICAgU3VmZml4TGVuZ3RoKys7Ci0gICAgICAgIH0KLSAgICB9Ci0KLSAgICAvKiBEZWNvZGUgcnVuIHZhbHVlcyAqLwotICAgIFplcm9zTGVmdCA9IDA7Ci0gICAgaWYgKFRvdGFsQ29lZmYgPCBzTWF4TnVtQ29lZmYpCi0gICAgewotICAgICAgICAvKiBEZWNvZGUgVG90YWxaZXJvcyBWTEMgKi8KLSAgICAgICAgaWYgKHNNYXhOdW1Db2VmZj09NCkKLSAgICAgICAgewotICAgICAgICAgICAgWmVyb3NMZWZ0ID0gYXJtVW5QYWNrVkxDMzIocHBCaXRTdHJlYW0sIHBPZmZzZXQsIGFybVZDTTRQMTBfQ0FWTENUb3RhbFplcm9zMngyVGFibGVzW1RvdGFsQ29lZmYtMV0pOwotICAgICAgICAgICAgYXJtUmV0RGF0YUVycklmKFplcm9zTGVmdCA9PUFSTV9OT19DT0RFQk9PS19JTk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bltpXSk7Ci0KLSAgICAgICAgWmVyb3NMZWZ0IC09IFJ1bjsKLSAgICB9Ci0gICAgcFJ1blswXSA9IChPTVhfVTgpWmVyb3NMZWZ0OwotCi0gICAgREVCVUdfUFJJTlRGXzEoIlJ1blswXSA9ICVkXG4iLCBwUnVuW2ldKTsKLQotCi0gICAgLyogRmlsbCBpbiBjb2VmZmljaWVudHMgKi8KLQkgICAgCi0gICAgaWYgKHNNYXhOdW1Db2VmZj09MTUpCi0gICAgewotICAgICAgICBDb2VmZk51bSsrOyAvKiBTa2lwIHRoZSBEQyBwb3NpdGlvbiAqLwotICAgIH0KLQkKLQkvKmZvciAoaT0wO2k8VG90YWxDb2VmZjtpKyspCi0JCUNvZWZmTnVtICs9IHBSdW5baV0rMTsqLwotICAgIAotCWZvciAoaT0oVG90YWxDb2VmZi0xKTsgaT49MDsgaS0tKQotICAgIHsKLSAgICAgICAgLypDb2VmZk51bSArPSBwUnVuW2ldKzE7Ki8KLSAgICAgICAgTGV2ZWwgICAgID0gcExldmVsW2ldOwotCi0gICAgICAgIERFQlVHX1BSSU5URl8yKCJDb2VmWyVkXSA9ICVkXG4iLCBDb2VmZk51bSwgTGV2ZWwpOwotCi0gICAgICAgIEZsYWdzID0gQ29lZmZOdW07Ci0JCUNvZWZmTnVtIC09IChwUnVuW2ldKzEpOwotICAgICAgICBpZiAoc01heE51bUNvZWZmPjQpCi0gICAgICAgIHsKLSAgICAgICAgICAgIC8qIFBlcmZvcm0gNHg0IERlWmlnWmFnICovCi0gICAgICAgICAgICBGbGFncyA9IGFybVZDTTRQMTBfWmlnWmFnW0ZsYWdzXTsKLSAgICAgICAgfQotICAgICAgICBpZiAoaT09MCkKLSAgICAgICAgeyAgIAotICAgICAgICAgICAgLyogRW5kIG9mIGJsb2NrIGZsYWcgKi8KLSAgICAgICAgICAgIEZsYWdzICs9IDB4MjA7Ci0gICAgICAgIH0KLSAgICAgICAgaWYgKExldmVsPC0xMjggfHwgTGV2ZWw+MTI3KQotICA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2luY2x1ZGUgImFybUNPTU0uaCIKLQotLyoqCi0gKiBGdW5jdGlvbjogYXJtVkNNNFAxMF9JbnRlcnBvbGF0ZV9DaHJvbWEKLSAqCi0gKiBEZXNjcmlwdGlvbjoKLSAqIFRoaXMgZnVuY3Rpb24gcGVyZm9ybXMgaW50ZXJwb2xhdGlvbiBmb3IgY2hyb21hIGNvbXBvbmVudHMuCi0gKgotICogUmVtYXJrczoKLSAqCi0gKiAgW2luXSAgICBwU3JjICAgICAgICAgICAgUG9pbnRlciB0byB0b3AtbGVmdCBjb3JuZXIgb2YgYmxvY2sgdXNlZCB0byAKLSAqICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGludGVycG9sYXRlIGluIHRoZSByZWNvbnN0cnVjdGVkIGZyYW1lIHBsYW5lCi0gKiAgW2luXSAgICBpU3JjU3RlcCAgICBTdGVwIG9mIHRoZSBzb3VyY2UgYnVmZmVyLgotICogIFtpbl0gICAgaURzdFN0ZXAgICAgU3RlcCBvZiB0aGUgZGVzdGluYXRpb24oaW50ZXJwb2xhdGlvbikgYnVmZmVyLgotICogIFtpbl0gICAgaVdpZHRoICAgICAgV2lkdGggb2YgdGhlIGN1cnJlbnQgYmxvY2sKLSAqICBbaW5dICAgIGlIZWlnaHQgICAgIEhlaWdodCBvZiB0aGUgY3VycmVudCBibG9jawotICogIFtpbl0gICAgZHggICAgICAgICAgICAgIEZyYWN0aW9uYWwgcGFydCBvZiBob3Jpem9udGFsIG1vdGlvbiB2ZWN0b3IgCi0gKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb21wb25lbnQgaW4gMS84IHBpeGVsIHVuaXQgKDB+NykgCi0gKiAgW2luXSAgICBkeSAgICAgICAgICAgICAgRnJhY3Rpb25hbCBwYXJ0IG9mIHZlcnRpY2FsIG1vdGlvbiB2ZWN0b3IgCi0gKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC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ybVJldEFyZ0VycklmKGlTcmNTdGVwID09IDAsIE9NWF9TdHNfQmFkQXJnRXJyKQotICAgIGFybVJldEFyZ0VycklmKGlEc3RTdGVwID09IDAsIE9NWF9TdHNfQmFkQXJnRXJyKQotICAgIGFybVJldEFyZ0VycklmKGlXaWR0aCA9PSAwLCBPTVhfU3RzX0JhZEFyZ0VycikKLSAgICBhcm1SZXRBcmdFcnJJZihpSGVpZ2h0ID09IDAsIE9NWF9TdHNfQmFkQXJnRXJyKQotICAgIAotICAgIC8qIGlmIGZyYWN0aW9ubCBtdiBpcyBub3QgKDAsIDApICovCi0gICAgaWYgKGR4ICE9IDAgfHwgZHkgIT0gMCkKLSAgICB7Ci0gICAgICAgIEFDb2VmZiA9IEVpZ2h0TWludXNkeCAqIEVpZ2h0TWludXNkeTsKLSAgICAgICAgQkNvZWZmID0gZHggKiBFaWdodE1pbnVzZHk7Ci0gICAgICAgIENDb2VmZiA9IEVpZ2h0TWludXNkeCAqIGR5OwotICAgICAgICBEQ29lZmYgPSBkeCAqIGR5OwotCi0gICAgICAgIGZvciAoeSA9IDA7IHkgPCBpSGVpZ2h0OyB5KyspCi0gICAgICAgIHsKLSAgICAgICAgICAgIGZvciAoeCA9IDA7IHggPCBpV2lkdGg7IHgrKykKLSAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICBwRHN0IFt5ICogaURzdFN0ZXAgKyB4XSA9ICgKLSAgICAgICAgICAgICAgICAgICAgQUNvZWZmICogcFNyYyBbeSAqIGlTcmNTdGVwICsgeF0gKwotICAgICAgICAgICAgICAgICAgICBCQ29lZmYgKiBwU3JjIFt5ICogaVNyY1N0ZXAgKyB4ICsgMV0gKwotICAgICAgICAgICAgICAgICAgICBDQ29lZmYgKiBwU3JjIFsoeSArIDEpICogaVNyY1N0ZXAgKyB4XSArCi0gICAgICAgICAgICAgICAgICAgIERDb2VmZiAqIHBTcmMgWyh5ICsgMSkgKiBpU3JjU3RlcCArIHggKyAxXSArCi0gICAgICAgICAgICAgICAgICAgIDMyKSA+PiA2OwotICAgICAgICAgICAgfQotICAgICAgICB9Ci0gICAgfQotICAgIGVsc2UKLSAgICB7Ci0gICAgICAgIGZvciAoeSA9IDA7IHkgPCBpSGVpZ2h0OyB5KyspCi0gICAgICAgIHsKLSAgICAgICAgICAgIGZvciAoeCA9IDA7IHggPCBpV2lkdGg7IHgrKykKLSAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICBwRHN0IFt5ICogaURzdFN0ZXAgKyB4XSA9IHBTcmMgW3kgKiBpU3JjU3RlcCArIHhdOwotICAgICAgICAgICAgfQotICAgICAgICB9Ci0gICAgfQotCi0gICAgcmV0dXJuIE9NWF9TdHNfTm9FcnI7Ci19Ci0KLS8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgotICogICAgICAgICAgICAgICAgICAgICAgICAgICAgICBFTkQgT0YgRklMRQotICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotCmRpZmYgLS1naXQgYS9tZWRpYS9saWJzdGFnZWZyaWdodC9jb2RlY3Mvb24yL2gyNjRkZWMvb214ZGwvcmVmZXJlbmNlL3ZjL200cDEwL3NyYy9hcm1WQ000UDEwX0ludGVycG9sYXRlX0x1bWEuYyBiL21lZGlhL2xpYnN0YWdlZnJpZ2h0L2NvZGVjcy9vbjIvaDI2NGRlYy9vbXhkbC9yZWZlcmVuY2UvdmMvbTRwMTAvc3JjL2FybVZDTTRQMTBfSW50ZXJwb2xhdGVfTHVtYS5jCmRlbGV0ZWQgZmlsZSBtb2RlIDEwMDY0NAppbmRleCA4OTk3OGRkLi4wMDAwMDAwCi0tLSBhL21lZGlhL2xpYnN0YWdlZnJpZ2h0L2NvZGVjcy9vbjIvaDI2NGRlYy9vbXhkbC9yZWZlcmVuY2UvdmMvbTRwMTAvc3JjL2FybVZDT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C1sZWZ0IGNvcm5lciBvZiBibG9jayB1c2VkIHRvIAotICogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaW50ZXJwb2xhdGUgaW4gdGhlIHJlY29uc3RydWN0ZWQgZnJhbWUgcGxhbmUKLSAqICBbaW5dICAgIGlTcmNTdGVwICAgIFN0ZXAgb2YgdGhlIHNvdXJjZSBidWZmZXIuCi0gKiAgW2luXSAgICBpRHN0U3RlcCAgICBTdGVwIG9mIHRoZSBkZXN0aW5hdGlvbihpbnRlcnBvbGF0aW9uKSBidWZmZXIuCi0gKiAgW2luXSAgICBpV2lkdGggICAgICBXaWR0aCBvZiB0aGUgY3VycmVudCBibG9jawotICogIFtpbl0gICAgaUhlaWdodCAgICAgSGVpZ2h0IG9mIHRoZSBjdXJyZW50IGJsb2NrCi0gKiAgW2luXSAgICBkeCAgICAgICAgICAgICAgRnJhY3Rpb25hbCBwYXJ0IG9mIGhvcml6b250YWwgbW90aW9uIHZlY3RvciAKLSAqICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbXBvbmVudCBpbiAxLzQgcGl4ZWwgdW5pdCAoMH4zKSAKLSAqICBbaW5dICAgIGR5ICAgICAgICAgICAgICBGcmFjdGlvbmFsIHBhcnQgb2YgdmVydGljYWwgbW90aW9uIHZlY3RvciAKLSAqICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbXBvbmVudCBpbiAxLzQgcGl4ZWwgdW5pdCAoMH4zKSAKLSAqICBbb3V0XSAgIHBEc3QgICAgICAgICAgICBQb2ludGVyIHRvIHRoZSBpbnRlcnBvbGF0aW9uIGJ1ZmZlcgotICoKLSAqIFJldHVybiBWYWx1ZToKLSAqIFN0YW5kYXJkIE9NWFJlc3VsdCB2YWx1ZS4KLSAqCi0gKi8KLQotIE9NWFJlc3VsdCBhcm1WQ000UDEwX0ludGVycG9sYXRlX0x1bWEoCi0gICAgIGNvbnN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aURzdFN0ZXAsIGlXaWR0aCwgaUhlaWdodCk7Ci0gICAgICAgIH0KLSAgICB9Ci0gICAgZWxzZSAvKiBkeD0xLDMgYW5kIGR5PTEsMyAqLwotICAgIHsKLSAgICAgICAgLyogZSwgZywgcCwgciAqLwotICAgICAgICBhcm1WQ000UDEwX0ludGVycG9sYXRlSGFsZkhvcl9MdW1hCi0gICAgICAgICAgICAocFNyY0hhbGZIb3IsIGlTcmNTdGVwLCBwQnVmMSwgaVdpZHRoLCBpV2lkdGgsIGlIZWlnaHQpOwotCi0gICAgICAgIGFybVZDTTRQMTBfSW50ZXJwb2xhdGVIYWxmVmVyX0x1bWEKLSAgICAgICAgICAgIChwU3JjSGFsZlZlciwgaVNyY1N0ZXAsIHBEc3QsIGlEc3RTdGVwLCBpV2lkdGgsIGlIZWlnaHQpOwotCi0gICAgICAgIGFybVZDQ09NTV9BdmVyYWdlIAotICAgICAgICAgICAgKHBCdWYxLCBwRHN0LCBpV2lkdGgsIGlEc3RTdGVwLCBwRHN0LCBpRHN0U3RlcCwgaVdpZHRoLCBpSGVpZ2h0KTsKLSAgICB9Ci0KLSAgICByZXR1cm4gT01YX1N0c19Ob0VycjsKLX0KLQotLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCi0gKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEVORCBPRiBGSUxFCi0gKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCmRpZmYgLS1naXQgYS9tZWRpYS9saWJzdGFnZWZyaWdodC9jb2RlY3Mvb24yL2gyNjRkZWMvb214ZGwvcmVmZXJlbmNlL3ZjL200cDEwL3NyYy9hcm1WQ000UDEwX1ByZWRpY3RJbnRyYURDNHg0LmMgYi9tZWRpYS9saWJzdGFnZWZyaWdodC9jb2RlY3Mvb24yL2gyNjRkZ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gIGlXaWR0aAotKQotewotICAgIE9NWF9JTlQgICAgIHgsIHk7Ci0gICAgT01YX1MzMiAgICAgU0FEID0gMDsKLQotICAgIC8qIGNoZWNrIGZvciBhcmd1bWVudCBlcnJvciAqLwotICAgIGFybVJldEFyZ0VycklmKHBTcmMgPT0gTlVMTCwgT01YX1N0c19CYWRBcmdFcnIpCi0gICAgYXJtUmV0QXJnRXJySWYocFNyY1JlZjAgPT0gTlVMTCwgT01YX1N0c19CYWRBcmdFcnIpCi0gICAgYXJtUmV0QXJnRXJySWYocFNyY1JlZjEgPT0gTlVMTCwgT01YX1N0c19CYWRBcmdFcnIpCi0gICAgYXJtUmV0QXJnRXJySWYocERzdFNBRCA9PSBOVUxMLCBPTVhfU3RzX0JhZEFyZ0VycikKLQotICAgIGZvciAoeSA9IDA7IHkgPCBpSGVpZ2h0OyB5KyspCi0gICAgewotICAgICAgICBmb3IgKHggPSAwOyB4IDwgaVdpZHRoOyB4KyspCi0gICAgICAgIHsKLSAgICAgICAgICAgIFNBRCArPSBhcm1BYnMocFNyYyBbeSAqIGlTcmNTdGVwICsgeF0gLSAoKAotICAgICAgICAgICAgICAgICAgICBwU3JjUmVmMCBbeSAqIGlSZWZTdGVwMCArIHhdICsgCi0gICAgICAgICAgICAgICAgICAgIHBTcmNSZWYxIFt5ICogaVJlZlN0ZXAxICsgeF0gKyAxKSA+PiAxKSk7Ci0gICAgICAgIH0KLSAgICB9Ci0gICAgICAgIAotICAgICpwRHN0U0FEID0gU0FEOwotCi0gICAgcmV0dXJuIE9NWF9TdHNfTm9FcnI7Ci19Ci0KLS8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgotICogICAgICAgICAgICAgICAgICAgICAgICAgICAgICBFTkQgT0YgRklMRQotICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqL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5jbHVkZSAib214VkMuaCIKLQotI2luY2x1ZGUgImFybUNPTU0uaCIKLSNpbmNsdWRlICJhcm1WQy5oIgotIAotLyoKLSAqIERlc2NyaXB0aW9uOgotICogVHJhbnNmb3JtIFJlc2lkdWFsIDR4NCBDb2VmZmljaWVudHMKLSAqCi0gKiBQYXJhbWV0ZXJzOgotICogW2luXSAgcFNyYwkJU291cmNlIDR4NCBibG9jawotICogW291dF0gcERzdAkJRGVzdGluYXRpb24gNHg0IGJsb2NrCi0gKgotICovCi0KLXZvaWQgYXJtVkNNNFAxMF9UcmFuc2Zvcm1SZXNpZHVhbDR4NChPTVhfUzE2KiBwRHN0LCBPTVhfUzE2ICpwU3JjKQotewotICAgIGludCBpOwotCi0gICAgLyogVHJhbnNmb3JtIHJvd3MgKi8KLSAgICBmb3IgKGk9MDsgaTwxNjsgaSs9NCkKLSAgICB7Ci0gICAgICAgIGludCBkMCA9IHBTcmNbaSswXTsKLSAgICAgICAgaW50IGQxID0gcFNyY1tpKzFdOwotICAgICAgICBpbnQgZDIgPSBwU3JjW2krMl07Ci0gICAgICAgIGludCBkMyA9IHBTcmNbaSszXTsKLSAgICAgICAgaW50IGUwID0gZDAgKyBkMjsKLSAgICAgICAgaW50IGUxID0gZDAgLSBkMjsKLSAgICAgICAgaW50IGUyID0gKGQxPj4xKSAtIGQzOwotICAgICAgICBpbnQgZTMgPSBkMSArIChkMz4+MSk7Ci0gICAgICAgIGludCBmMCA9IGUwICsgZTM7Ci0gICAgICAgIGludCBmMSA9IGUxICsgZTI7Ci0gICAgICAgIGludCBmMiA9IGUxIC0gZTI7Ci0gICAgICAgIGludCBmMyA9IGUwIC0gZTM7Ci0gICAgICAgIHBEc3RbaSswXSA9IChPTVhfUzE2KWYwOwotICAgICAgICBwRHN0W2krMV0gPSAoT01YX1MxNilmMTsKLSAgICAgICAgcERzdFtpKzJdID0gKE9NWF9TMTYpZjI7Ci0gICAgICAgIHBEc3RbaSszXSA9IChPTVhfUzE2KWYzOwotICA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RdCXBwU3JjCSpwcFNyYyBpcyB1cGRhdGVkIHRvIHRoZSBzdGFydCBvZiBuZXh0IG5vbiBlbXB0eSBibG9jawotICogW291dF0JcERzdAlQb2ludGVyIHRvIHVucGFja2VkIDR4NCBibG9jawotICovCi0KLXZvaWQgYXJtVkNNNFAxMF9VbnBhY2tCbG9jazJ4MigKLSAgICAgY29uc3QgT01YX1U4ICoqcHBTcmMsCi0gICAgIE9NWF9TMTYqIHBEc3QKLSkKLXsKLSAgICBjb25zdCBPTVhfVTggKnBTcmMgPSAqcHBTcmM7Ci0gICAgaW50IGk7Ci0gICAgaW50IEZsYWcsIFZhbHVlOwotCi0gICAgZm9yIChpPTA7IGk8NDsgaSsrKQotICAgIHsKLSAgICAgICAgcERzdFtpXSA9IDA7Ci0gICAgfQotCi0gICAgZG8KLSAgICB7Ci0gICAgICAgIEZsYWcgID0gKnBTcmMrKzsKLSAgICAgICAgaWYgKEZsYWcgJiAweDEwKQotICAgICAgICB7Ci0gICAgICAgICAgICAvKiAxNiBiaXQgKi8KLSAgICAgICAgICAgIFZhbHVlID0gKnBTcmMrKzsKLSAgICAgICAgICAgIFZhbHVlID0gVmFsdWUgfCAoKCpwU3JjKyspPDw4KTsKLSAgICAgICAgICAgIGlmIChWYWx1ZSAmIDB4ODAwMCkKLSAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICBWYWx1ZSAtPSAweDEwMDAwOwotICAgICAgICAgICAgfQotICAgICAgICB9Ci0gICAgICAgIGVsc2UKLSAgICAgICAgewotICAgICAgICAgICAgLyogOCBiaXQgKi8KLSAgICAgICAgICAgIFZhbHVlID0gKnBTcmMrKzsKLSAgICAgICAgICAgIGlmIChWYWx1ZSAmIDB4ODApCi0gICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgVmFsdWUgLT0gMHgxMDA7Ci0gICAgICAgICAgICB9Ci0gICAgICAgIH0KLSAgICAgICAgaSA9IEZsYWcgJiAxNTsKLSAgICAgICAgcERzdFtpXSA9IChPT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gZm9yIHZhbGlkIHJlZ2lvbiAqLyAKLSAgICBmcm9tWCA9IDE7Ci0gICAgdG9YICAgPSAxOwotICAgIGZyb21ZID0gMTsKLSAgICB0b1kgICA9IDE7Ci0gICAgCi0gICAgLyogSW5pdGlhbGl6ZSB0byBtYXggdmFsdWUgYXMgYSBzdGFydCBwb2ludCAqLwotICAgICpwQmVzdENvc3QgPSAweDdmZmZmZmZmOwotICAgIAotICAgIGludGVnZXJNVi5keCA9IHBTcmNEc3RCZXN0TVYtPmR4OwotICAgIGludGVnZXJNVi5keSA9IHBTcmNEc3RCZXN0TVYtPmR5OwotICAgIAotICAgIC8qIExvb3Bpbmcgb24geS0gYXhpcyAqLwotICAgIGZvciAoeSA9IC1mcm9tWTsgeSA8PSB0b1k7IHkrKykKLSAgICB7Ci0gICAgICAgIC8qIExvb3Bpbmcgb24geC0gYXhpcyAqLwotICAgICAgICBmb3IgKHggPSAtZnJvbVg7IHggPD0gdG9YOyB4KyspCi0gICAgICAgIHsKLSAgICAgICAgICAgIC8qIFBvc2l0aW9uaW5nIHRoZSBwb2ludGVyICovCi0gICAgICAgICAgICBwVGVtcFNyY1JlZlkgPSBwU3JjUmVmWSArIChuU3JjUmVmU3RlcCAqIChpbnRlZ2VyTVYuZHkvNCkpICsgKGludGVnZXJNVi5keC80KTsKLSAgICAgICAgICAgIGlmICh4IDwgMCkKLSAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICBwVGVtcFNyY1JlZlkgPSBwVGVtcFNyY1JlZlkgKyB4OwotICAgICAgICAgICAgfQotICAgICAgICAgICAgaWYgKHkgPCAwKQotICAgICAgICAgICAgewotICAgICAgICAgICAgICAgIHBUZW1wU3JjUmVmWSA9IHBUZW1wU3JjUmVmWSArICh5ICogblNyY1JlZlN0ZXApOwotICAgICAgICAgICAgfQotICAgICAgICAgICAgcFRlbXBTcmNPcmdZID0gcFNyY09yZ1k7Ci0gICAgICAgICAgICAKLSAgICAgICAgICAgIC8qIFByZXBhcmUgY2FuZCBNViAqLwotICAgICAgICAgICAgY2FuZE1WLmR4ID0gaW50ZWdlck1WLmR4ICsgeCAqIDI7Ci0gICAgICAgICAgICBjYW5kTVYuZHkgPSBpbnRlZ2VyTVYuZHkgKyB5ICogMjsKLSAgICAgICAgICAgIAotICAgICAgICAgICAgLyogSW50ZXJwb2xhdGUgaGFsZiBwZWwgZm9yIHRoZSBjdXJyZW50IHBvc2l0aW9uKi8KLSAgICAgICAgICAgIGFybVZDTTRQMTBfSW50ZXJwb2xhdGVfTHVtYSgKLSAgICAgICAgICAgICAgICAgICAgICAgIHBUZW1wU3JjUmVmWSwKLSAgICAgICAgICAgICAgICAgICAgICAgIG5TcmNSZWZTdGVwLAotICAgICAgICAgICAgICAgICAgICAgICAgaW50ZXJwb2xZLAotICAgICAgICAgICAgICAgICAgICAgICAgaUJsb2NrV2lkdGgsCi0gICAgICAgICAgICAgICAgICAgICAgICBpQmxvY2tXaWR0aCwKLSAgICAgICAgICAgICAgICAgICAgICAgIGlCbG9ja0hlaWdodCwKLSAgICAgICAgICAgICAgICAgICAgICAgIGFybUFicyh4KSAqIDIsCi0gICAgICAgICAgICAgICAgICAgICAgICBhcm1BYnMoeSkgKiAyKTsKLSAgICAgICAgICAgIAotICAgICAgICAgICAgLyogQ2FsY3VsYXRlIHRoZSBTQUQgKi8KLSAgICAgICAgICAgIGFybVZDQ09NTV9TQUQoCQotICAgICAgICAgICAgICAgICAgICAgICAgcFRlbXBTcmNPcmdZLAotICAgICAgICAgICAgICAgICAgICAgICAgblNyY09yZ1N0ZXAsCi0gICAgICAgICAgICAgICAgICAgICAgICBpbnRlcnBvbFksCi0gICAgICAgICAgICAgICAgICAgICAgICBpQmxvY2tXaWR0aCwKLSAgICAgICAgICAgICAgICAgICAgICAgICZjYW5kU0FELAotICAgICAgICAgICAgICAgICAgICAgICAgaUJsb2NrSGVpZ2h0LAotICAgICAgICAgICAgICAgICAgICAgICAgaUJsb2NrV2lkdGgpOwotIAotICAgICAgICAgICAgZGlmZk1WLmR4ID0gY2FuZE1WLmR4IC0gcE1WUHJlZC0+ZHg7Ci0gICAgICAgICAgICBkaWZmTVYuZHkgPSBjYW5kTVYuZHkgLSBwTVZQcmVkLT5keTsKLSAgICAgICAgICAgIAotICAgICAgICAgICAgLyogUmVzdWx0IGNhbGN1bGF0aW9ucyAqLwotICAgICAgICAgICAgYXJtVkNNNFAxMF9Db21wYXJlTW90aW9uQ29zdFRvTVYgKAotICAgICAgICAgICAgICAgICAgICAgICAgY2FuZE1WLmR4LCAKLSAgICAgICAgICAgICAgICAgICAgICAgIGNhbmRNVi5keSwgCi0gICAgICAgICAgICAgICAgICAgICAgICBkaWZmTVYsIAotICAgICAgICAgICAgICAgICAgICAgICAgY2FuZFNBRCwgCi0gICAgICAgICAgICAgICAgICAgICAgICBwU3JjRHN0QmVzdE1WLCAKLSAgICAgICAgICAgICAgICAgICAgICAgIG5MYW1kYSwgCi0gICAgICAgICAgICAgICAgICAgICAgICBwQmVzdENvc3QpOwotCi0gICAgICAgIH0gLyogRW5kIG9mIHgtIGF4aXMgKi8KLSAgICB9IC8qIEVuZCBvZiB5LWF4aXMgKi8KLQotICAgIHJldHVybiBPTVhfU3RzX05vRXJyOwotCi19Ci0KLS8qIEVuZCBvZiBmaWxlICovCmRpZmYgLS1naXQgYS9tZWRpYS9saWJzdGFnZWZyaWdodC9jb2RlY3Mvb24yL2gyNjRkZWMvb214ZGwvcmVmZXJlbmNlL3ZjL200cDEwL3NyYy9vbXhWQ000UDEwX0Jsb2NrTWF0Y2hfSW50ZWdlci5jIGIvbWVkaWEvbGlic3RhZ2VmcmlnaHQvY29kZWNzL29uMi9oMjY0ZGVjL29teGRsL3JlZmVyZW5jZS92Yy9tNHAxMC9zcmMvb214VkNNNFAxMF9CbG9ja01hdGNoX0ludGVnZXIuYwpkZWxldGVkIGZpbGUgbW9kZSAxMDA2NDQKaW5kZXggZjc3NjRlMS4uMDAwMDAwMAotLS0gYS9tZWRpYS9saWJzdGFnZWZyaWdodC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AgICAgICAgICAgLyogUG9zaXRpb25pbmcgdGhlIHBvaW50ZXIgKi8KLSAgICAgICAgICAgIHBUZW1wU3JjUmVmWSA9IHBTcmNSZWZZICsgKG5TcmNSZWZTdGVwICogKGluaXRpYWxNVi5keS80KSkgKyAoaW5pdGlhbE1WLmR4LzQpOwotICAgICAgICAgICAgCi0gICAgICAgICAgICAvKiBDYWxjdWxhdGluZyB0aGUgZnJhY3QgcGVsIHBvc2l0aW9uICovCi0gICAgICAgICAgICBwZWxQb3NYID0gKGluaXRpYWxNVi5keCAlIDQpICsgeDsKLSAgICAgICAgICAgIGlmIChwZWxQb3NYIDwgMCkgCi0gICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgcFRlbXBTcmNSZWZZID0gcFRlbXBTcmNSZWZZIC0gMTsKLSAgICAgICAgICAgICAgICBwZWxQb3NYICs9IDQ7Ci0gICAgICAgICAgICB9Ci0gICAgICAgICAgICBwZWxQb3NZID0gKGluaXRpYWxNVi5keSAlIDQpICsgeTsKLSAgICAgICAgICAgIGlmIChwZWxQb3NZIDwgMCkgCi0gICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgcFRlbXBTcmNSZWZZID0gcFRlbXBTcmNSZWZZIC0gKDEgKiBuU3JjUmVmU3RlcCk7Ci0gICAgICAgICAgICAgICAgcGVsUG9zWSArPSA0OwotICAgICAgICAgICAgfQotICAgICAgICAgICAgCi0gICAgICAgICAgICBwVGVtcFNyY09yZ1kgPSBwU3JjT3JnWTsgCi0gICAgICAgICAgICAKLSAgICAgICAgICAgIC8qIFByZXBhcmUgY2FuZCBNViAqLwotICAgICAgICAgICAgY2FuZE1WLmR4ID0gaW5pdGlhbE1WLmR4ICsgeDsKLSAgICAgICAgICAgIGNhbmRNVi5keSA9IGluaXRpYWxNVi5keSArIHk7Ci0gICAgICAgICAgICAgCi0gICAgICAgICAgICAvKiBJbnRlcnBvbGF0ZSBRdWF0ZXIgcGVsIGZvciB0aGUgY3VycmVudCBwb3NpdGlvbiovCi0gICAgICAgICAgICBhcm1WQ000UDEwX0ludGVycG9sYXRlX0x1bWEoCi0gICAgICAgICAgICAgICAgICAgICAgICBwVGVtcFNyY1JlZlksCi0gICAgICAgICAgICAgICAgICAgICAgICBuU3JjUmVmU3RlcCwKLSAgICAgICAgICAgICAgICAgICAgICAgIGludGVycG9sWSwKLSAgICAgICAgICAgICAgICAgICAgICAgIGlCbG9ja1dpZHRoLAotICAgICAgICAgICAgICAgICAgICAgICAgaUJsb2NrV2lkdGgsCi0gICAgICAgICAgICAgICAgICAgICAgICBpQmxvY2tIZWlnaHQsCi0gICAgICAgICAgICAgICAgICAgICAgICBwZWxQb3NYLAotICAgICAgICAgICAgICAgICAgICAgICAgcGVsUG9zWSk7Ci0gICAgICAgICAgICAKLSAgICAgICAgICAgIC8qIENhbGN1bGF0ZSB0aGUgU0FEICovCi0gICAgICAgICAgICBhcm1WQ0NPTU1fU0FEKAkKLSAgICAgICAgICAgICAgICAgICAgICAgIHBUZW1wU3JjT3JnWSwKLSAgICAgICAgICAgICAgICAgICAgICAgIG5TcmNPcmdTdGVwLAotICAgICAgICAgICAgICAgICAgICAgICAgaW50ZXJwb2xZLAotICAgICAgICAgICAgICAgICAgICAgICAgaUJsb2NrV2lkdGgsCi0gICAgICAgICAgICAgICAgICAgICAgICAmY2FuZFNBRCwKLSAgICAgICAgICAgICAgICAgICAgICAgIGlCbG9ja0hlaWdodCwKLSAgICAgICAgICAgICAgICAgICAgICAgIGlCbG9ja1dpZHRoKTsKLSAKLSAgICAgICAgICAgIGRpZmZNVi5keCA9IGNhbmRNVi5keCAtIHBNVlByZWQtPmR4OwotICAgICAgICAgICAgZGlmZk1WLmR5ID0gY2FuZE1WLmR5IC0gcE1WUHJlZC0+ZHk7Ci0gICAgICAgICAgICAKLSAgICAgICAgICAgIC8qIFJlc3VsdCBjYWxjdWxhdGlvbnMgKi8KLSAgICAgICAgICAgIGFybVZDTTRQMTBfQ29tcGFyZU1vdGlvbkNvc3RUb01WICgKL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AgIE9NWF9TdHNfQmFkQXJnRXJyKTsKLSAgICBhcm1SZXRBcmdFcnJJZihwQmV0YSA9PSBOVUxMLCAgICAgICAgICAgICAgICAgICBPTVhfU3RzX0JhZEFyZ0Vycik7Ci0gICAgYXJtUmV0QXJnRXJySWYocFRocmVzaG9sZHMgPT0gTlVMTCwgICAgICAgICAgICAgT01YX1N0c19CYWRBcmdFcnIpOwotICAgIGFybVJldEFyZ0VycklmKGFybU5vdDRCeXRlQWxpZ25lZChwVGhyZXNob2xkcyksIE9NWF9TdHNfQmFkQXJnRXJyKTsKLSAgICBhcm1SZXRBcmdFcnJJZihwQlMgPT0gTlVMTCwgICAgICAgICAgICAgICAgICAgICBPTVhfU3RzX0JhZEFyZ0Vycik7Ci0gICAgYXJtUmV0QXJnRXJySWYoYXJtTm90NEJ5dGVBbGlnbmVkKHBCUyksICAgICAgICAgT01YX1N0c19CYWRBcmdFcnIpOwotCi0gICAgZm9yIChZPTA7IFk8ODsgWSs9NCwgSW50ZXJuYWw9MSkKLSAgICB7Ci0gICAgICAgIGZvciAoWD0wOyBYPDg7IFgrKykKLSAgICAgICAgewotICAgICAgICAgICAgSSA9IChYPj4xKSs0KihZPj4xKTsKLSAgICAgICAgICAgIAotICAgICAgICAgICAgYXJtUmV0QXJnRXJySWYocEJTW0ldID4gNCwgT01YX1N0c19CYWRBcmdFcnIpCi0gICAgICAgICAgICAKLSAgICAgICAgICAgIGFybVJldEFyZ0VycklmKCAoSSA+IDMpICYmIChwQlNbSV0gPT0gNCksCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgT01YX1N0c19CYWRBcmdFcnIpCi0gICAgICAgICAgICAKLSAgICAgICAgICAgIGFybVJldEFyZ0VycklmKCAoSSA8IDQpICAgICAgICYmIAotICAgICAgICAgICAgICAgICAgICAgICAgICAoIChwQlNbSV0gPT0gNCkgJiYgKHBCU1tJXjFdICE9IDQpICksCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgT01YX1N0c19CYWRBcmdF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EFyZ0Vycik7Ci0gICAgYXJtUmV0QXJnRXJySWYocEJldGFbMV0gPiAxOCwgIE9NWF9TdHNfQmFkQXJnRXJyKTsKLQotICAgIGZvciAoWD0wOyBYPDg7IFgrPTQsIEludGVybmFsPTEpCi0gICAgewotICAgICAgICBmb3IgKFk9MDsgWTw4OyBZKyspCi0gICAgICAgIHsKLSAgICAgICAgICAgIEkgPSAoWT4+MSkrNCooWD4+MSk7Ci0gICAgICAgICAgICAKLSAgICAgICAgICAgIGFybVJldEFyZ0VycklmKHBCU1tJXSA+IDQsIE9NWF9TdHNfQmFkQXJnRXJyKTsKLSAgICAgICAgICAgIAotICAgICAgICAgICAgYXJtUmV0QXJnRXJySWYoIChJID4gMykgJiYgKHBCU1tJXSA9PSA0KSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBPTVhfU3RzX0JhZEFyZ0Vycik7Ci0gICAgICAgICAgICAKLSAgICAgICAgICAgIGFybVJldEFyZ0VycklmKCAoIChwQlNbSV0gPT0gNCkgJiYgKHBCU1tJXjNdICE9IDQpICksCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgT01YX1N0c19CYWRBcmdFcnIpOwotICAgICAgICAgICAgYXJtUmV0QXJnRXJySWYocFRocmVzaG9sZHNbWV0gPiAyNSwgT01YX1N0c19CYWRBcmdFcnIpOwotICAgICAgICAgICAgCi0KLSAgICAgICAgICAgIC8qIEZpbHRlciB2ZXJ0aWNhbCBlZGdlIHdpdGggcTAgYXQgKFgsWSkgKi8KLSAgICAgICAgICAgIGFybVZDTTRQMTBfRGVCbG9ja1BpeGVsKAotICAgICAgICAgICAgICAgIHBTcmNEc3QgKyBZKnNyY2RzdFN0ZXAgKyBYLAotICAgICAgICAgICAgICAgIDEsCi0gICAgICAgICAgICAgICAgcFRocmVzaG9sZHNbKFk+PjEpKzQqKFg+PjIpXSwKLSAgICAgICAgICAgICAgICBwQWxwaGFbSW50ZXJuYWxdLAotICAgICAgICAgICAgICAgIHBCZXRhW0ludGVyb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FyZ0VycklmKHBCZXRhID09IE5VTEwsICAgICAgICAgICAgICAgT01YX1N0c19CYWRBcmdFcnIpOwotICAgIGFybVJldEFyZ0VycklmKHBUaHJlc2hvbGRzID09IE5VTEwsICAgICAgICAgT01YX1N0c19CYWRBcmdFcnIpOwotICAgIGFybVJldEFyZ0VycklmKGFybU5vdDRCeXRlQWxpZ25lZChwVGhyZXNob2xkcyksIE9NWF9TdHNfQmFkQXJnRXJyKTsKLSAgICBhcm1SZXRBcmdFcnJJZihwQlMgPT0gTlVMTCwgICAgICAgICAgICAgICAgICAgICBPTVhfU3RzX0JhZEFyZ0Vycik7Ci0gICAgYXJtUmV0QXJnRXJySWYoYXJtTm90NEJ5dGVBbGlnbmVkKHBCUyksICAgICAgICAgT01YX1N0c19CYWRBcmdFcnIpOwotICAgIAotICAgIGZvciAoWT0wOyBZPDE2OyBZKz00LCBJbnRlcm5hbD0xKQotICAgIHsKLSAgICAgICAgZm9yIChYPTA7IFg8MTY7IFgrKykKLSAgICAgICAgewotICAgICAgICAgICAgSSA9IChYPj4yKSs0KihZPj4yKTsKLSAgICAgICAgICAgIAotICAgICAgICAgICAgYXJtUmV0QXJnRXJySWYocEJTW0ldID4gNCwgT01YX1N0c19CYWRBcmdFcnIpCi0gICAgICAgICAgICAKLSAgICAgICAgICAgIGFybVJldEFyZ0VycklmKCAoSSA+IDMpICYmIChwQlNbSV0gPT0gNCksCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgT01YX1N0c19CYWRBcmdFcnIpCi0gICAgICAgICAgICAKLSAgICAgICAgICAgIGFybVJldEFyZ0VycklmKCAoSSA8IDQpICAgICAgICYmIAotICAgICAgICAgICAgICAgICAgICAgICAgICAoIChwQlNbSV0gPT0gNCkgJiYgKHBCU1tJXjFdICE9IDQpICksCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgT01YX1N0c19CYWRBcmdFcnIpCi0gICAgICAgICAgICAKLSAgICAgICAgICAgIC8qIEZpbHRlciBob3Jpem9udGFs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ChwU3JjRHN0KSxPTVhfU3RzX0JhZEFyZ0Vycik7Ci0gICAgYXJtUmV0QXJnRXJySWYoc3JjZHN0U3RlcCAmIDE1LCAgICAgICAgICAgICBPTVhfU3RzX0JhZEFyZ0Vycik7ICAgIAotICAgIGFybVJldEFyZ0VycklmKHBBbHBoYSA9PSBOVUxMLCAgICAgICAgICAgICAgT01YX1N0c19CYWRBcmdFcnIpOwotICAgIGFybVJldEFyZ0VycklmKHBCZXRhID09IE5VTEwsICAgICAgICAgICAgICAgT01YX1N0c19CYWRBcmdFcnIpOwotICAgIGFybVJldEFyZ0VycklmKHBUaHJlc2hvbGRzID09IE5VTEwsICAgICAgICAgT01YX1N0c19CYWRBcmdFcnIpOwotICAgIGFybVJldEFyZ0VycklmKGFybU5vdDRCeXRlQWxpZ25lZChwVGhyZXNob2xkcyksIE9NWF9TdHNfQmFkQXJnRXJyKTsKLSAgICBhcm1SZXRBcmdFcnJJZihwQlMgPT0gTlVMTCwgICAgICAgICAgICAgICAgICAgICBPTVhfU3RzX0JhZEFyZ0Vycik7Ci0gICAgYXJtUmV0QXJnRXJySWYoYXJtTm90NEJ5dGVBbGlnbmVkKHBCUyksICAgICAgICAgT01YX1N0c19CYWRBcmdFcnIpOwotICAgIGFybVJldEFyZ0VycklmKHBCZXRhWzBdID4gMTgsICBPTVhfU3RzX0JhZEFyZ0Vycik7Ci0gICAgYXJtUmV0QXJnRXJySWYocEJldGFbMV0gPiAxOCwgIE9NWF9TdHNfQmFkQXJnRXJyKTsKLSAgICAKLQotICAgIGZvciAoWD0wOyBYPDE2OyBYKz00LCBJbnRlcm5hbD0xKQotICAgIHsKLSAgICAgICAgZm9yIChZPTA7IFk8MTY7IFkrKykKLSAgICAgICAgewotICAgICAgICAgICAgSSA9IChZPj4yKSs0KihYPj4yKTsKLSAgICAgICAgICAgIAotICAgICAgICAgICAgYXJtUmV0QXJnRXJySWYocEJTW1ldID4gNCwgT01YX1N0c19CYWRBcmdFcnIpOwotICAgICAgICAgICAgCi0gICAgICAgICAgICBhcm1SZXRBcmdFcnJJZigocEJTW1ldID09IDQpICYmIChZID4gMyksCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgT01YX1N0c19CYWRBcmdFcnIpOwotICAgICAgICAgICAgCi0gICAgICAgICAgICBhcm1SZXRBcmdFcnJJZigoIChwQlNbWV0gPT0gNCkgJiYgKHBCU1tZXjNdICE9IDQpICksCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgT01YX1N0c19CYWRBcmdFcnIpOwotICAgICAgICAgICAgICAgICAgICAgICAgICAgIAotICAgICAgICAgICAgYXJtUmV0QXJnRXJySWYocFRocmVzaG9sZHNbWV0gPiAyNSwgT01YX1N0c19CYWRBcmdFcnIpOwotICAgICAgICAgICAgCi0gICAgICAgICAgICAvKiBGaWx0ZXIgdmVydGljYWwgZWRnZSB3aXRoIHEwIGF0IChYLFkpICovCi0gICAgICAgICAgICBhcm1WQ000UDEwX0RlQmxvY2tQaXhlbCgKLSAgICAgICAgICAgICAgICBwU3JjRHN0ICsgWSpzcmNkc3RTdGVwICsgWCwKLSAgICAgICAgICAgICAgICAxLAotICAgICAgICAgICAgICAgIHBUaHJlc2hvbGRzW0ldLAotICAgICAgICAgICAgICAgIHBBbHBoYVtJbnRlcm5hbF0sCi0gICAgICAgICAgICAgICAgcEJldGFbSW50ZXJuYWxdLAotICAgICAgICAgICAgICAgIHBCU1tJXSwKLSAgICAgICAgICAgICAgICAwKTsKLSAgICAgICAgfQotICAgIH0KLQotICAgIHJldHVybiBPTVhfU3RzX05vRXJyOwotfQpkaWZmIC0tZ2l0IGEvbWVkaWEvbGlic3RhZ2VmcmlnaHQvY29kZWNzL29uMi9oMjY0ZGVjL29teGRsL3JlZmVyZW5jZS92Yy9tNHAxMC9zcmMvb214VkNNNFAxMF9HZXRWTENJbmZvLmMgYi9tZWRpYS9saWJzdGFnZWZyaWdodC9jb2RlY3Mvb24yL2gyNjRkZWMvb214ZGwvcmVmZXJlbmNlL3ZjL200cDE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A9IDA7Ci0gICAgICAgIHBEc3RWTENJbmZvLT51UnVucyBbaV0gPSAwOwotICAgIH0KLSAgICAKLSAgICBNaW5JbmRleCA9IChiQUMgPT0gMCAmJiBNYXhOdW1Db2VmID09IDE1KSA/IDEgOiAwOwotICAgIGZvciAoaSA9IE1pbkluZGV4OyBpIDwgKE1heE51bUNvZWYgKyBNaW5JbmRleCk7IGkrKykKLSAgICB7ICAgICAgICAKLSAgICAgICAgLyogU2NhbiAqLwotICAgICAgICBCdWYgW2kgLSBNaW5JbmRleF0gPSBwU3JjQ29lZmYgW3BTY2FuTWF0cml4IFtpXV07Ci0gICAgfQotCi0gICAgLyogc2tpcCB6ZXJvcyBhdCB0aGUgZW5kICovCi0gICAgaSA9IE1heE51bUNvZWYgLSAxOwotICAgIHdoaWxlICghQnVmIFtpXSAmJiBpID49IDApCi0gICAgewotICAgICAgICBpLS07Ci0gICAgfQotICAgIAotICAgIGlmIChpIDwgMCkKLSAgICB7Ci0gICAgICAgIHJldHVybiBPTVhfU3RzX05vRXJyOwotICAgIH0KLQotICAgIC8qIEZpbGwgUkxFIEluZm8gc3RydWN0dXJlICovCi0gICAgcExldmVsID0gcERzdFZMQ0luZm8tPmlMZXZlbHM7Ci0gICAgcFJ1biA9IHBEc3RWTENJbmZvLT51UnVuczsKLSAgICBSdW5CZWZvcmUgPSAwOwotCi0gICAgLyogSGFuZGxlIGZpcnN0IG5vbiB6ZXJvIHNlcGFyYXRlICovCi0gICAgcERzdFZMQ0luZm8tPnVOdW1Db2VmZnMrKzsKLSAgICBWYWx1ZSA9IEJ1ZiBbaV07Ci0gICAgaWYgKFZhbHVlID09IDEgfHwgVmFsdWUgPT0gLTEpCi0gICAgewotICAgICAgICBwRHN0VkxDSW5mby0+dVRyYWlsaW5nX09uZXMrKzsKLSAgICAgICAgCi0gICAgICAgIHBEc3RWTENJbmZvLT51VHJhaWxpbmdfT25lX1NpZ25zIHw9IAotICAgICAgICAgICAgVmFsdWUgPT0gLTEgPyBNYXNrIDogMDsKLSAgICAgICAgTWFzayA+Pj0gMTsKLSAgICB9Ci0gICAgZWxzZQotICAgIHsKLSAgICAgICAgVmFsdWUgLT0gKFZhbHVlID4gMCA/IDEgOiAtMSk7Ci0gICAgICAgICpwTGV2ZWwrKyA9IFZhbHVlOwotICAgICAgICBNYXNrID0gMDsKLSAgICB9Ci0KLSAgICAvKiBSZW1haW5pbmcgbm9uIHplcm8gKi8KLSAgICB3aGlsZSAoLS1pID49IDApCi0gICAgewotICAgICAgICBWYWx1ZSA9IEJ1ZiBbaV07Ci0gICAgICAgIGlmIChWYWx1ZSkKLSAgICAgICAgewotICAgICAgICAgICAgcERzdFZMQ0luZm8tPnVOdW1Db2VmZnMrKzsKLQotICAgICAgICAgICAgLyogTWFzayBiZWNvbWVzIHplcm8gYWZ0ZXIgZW50ZXJpbmcgKi8KLSAgICAgICAgICAgIGlmIChNYXNrICYmCi0gICAgICAgICAgICAgICAgKFZhbHVlID09IDEgfHwgCi0gICAgICAgICAgICAgICAgIFZhbHVlID09IC0xKSkKLSAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICBwRHN0VkxDSW5mby0+dVRyYWlsaW5nX09uZXMrKzsKLSAgICAgICAgICAgICAgICAKLSAgICAgICAgICAgICAgICBwRHN0VkxDSW5mby0+dVRyYWlsaW5nX09uZV9TaWducyB8PSAKLSAgICAgICAgICAgICAgICAgICAgVmFsdWUgPT0gLTEgPyBNYXNrIDogMDsKLSAgICAgICAgICAgICAgICBNYXNrID4+PSAxOwotICAgICAgICAgICAgICAgICpwUnVuKysgPSBSdW5CZWZvcmU7Ci0gICAgICAgICAgICAgICAgUnVuQmVmb3JlID0gMDsKLSAgICAgICAgICAgIH0KLSAgICAgICAgICAgIGVsc2UKLSAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAvKiBJZiAzIHRyYWlsaW5nIG9uZXMgYXJlIG5vdCBjb21wbGV0ZWQgKi8KLSAgICAgICAgICAgICAgICBpZiAoTWFzaykKLSAgICAgICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgICAgIE1hc2sgPSAwOwotICAgICAgICAgICAgICAgICAgICBWYWx1ZSAtPSAoVmFsdWUgPiAwID8gMSA6IC0xKTsKLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgKnBMZXZlbCsrID0gVmFsdWU7Ci0gICAgICAgICAgICAgICAgKnBSdW4rKyA9IFJ1bkJlZm9yZTsKLSAgICAgICAgICAgICAgICBSdW5CZWZvcmUgPSAwOwotICAgICAgICAgICAgfQotICAgICAgICB9Ci0gICAgICAgIGVsc2UKLSAgICAgICAgewotICAgICAgICAgICAgcERzdFZMQ0luZm8tPnVUb3RhbFplcm9zKys7Ci0gICAgICAgICAgICBSdW5CZWZvcmUrKzsKLSAgICAgICAgfSAgICAgICAgCi0gICAgfQotICAgIAotICAgIC8qIFVwZGF0ZSBsYXN0IHJ1biAqLwotICAgIGlmIChSdW5CZWZvcmUpCi0gICAgewotICAgICAgICAqcFJ1bisrID0gUnVuQmVmb3JlOwotICAgIH0KLQotICAgIHJldHVybiBPTVhfU3RzX05vRXJyOwotfQotCi0vKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKLSAqICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgRU5EIE9GIEZJTEUKLSAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLQpkaWZmIC0tZ2l0IGEvbWVkaWEvbGlic3RhZ2VmcmlnaHQvY29kZWNzL29uMi9oMjY0ZGVjL29teGRsL3JlZmVyZW5jZS92Yy9tNHAxMC9zcmMvb214VkNNNFAxMF9JbnRlcnBvbGF0ZUNocm9tYS5jIGIvbWVkaWEvbGlic3RhZ2VmcmlnaHQvY29kZWNzL29uMi9oMjY0ZGVjL29teGRsL3JlZmVyZW5jZS92Yy9tNHAx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pcy9hcmUgbm90IGFsaWduZWQgb24gYSAxNi1ieXRlIGJvdW5kYXJ5IAotICogICAgLSAgICBhbnkgYWxpZ25tZW50IHJlc3RyaWN0aW9ucyBhcmUgdmlvbGF0ZWQgCi0gKgotICovCi0KLU9NWFJlc3VsdCBvbXhWQ000UDEwX0ludGVycG9sYXRlSGFsZkhvcl9MdW1hKAotICAgICAgICBjb25zdCBPTVhfVTgqICAgICBwU3JjLCAKLSAgICAgICAgT01YX1UzMiAgICAgaVNyY1N0ZXAsIAotICAgICAgICBPTVhfVTgqICAgICBwRHN0TGVmdCwgCi0gICAgICAgIE9NWF9VOCogICAgIHBEc3RSaWdodCwgCi0gICAgICAgIE9NWF9VMzIgICAgIGlEc3RTdGVwLCAKLSAgICAgICAgT01YX1UzMiAgICAgaVdpZHRoLCAKLSAgICAgICAgT01YX1UzMiAgICAgaUhlaWdodAotKQotewotICAgIE9NWFJlc3VsdCAgIFJldFZhbHVlOyAgICAKLQotICAgIC8qIGNoZWNrIGZvciBhcmd1bWVudCBlcnJvciAqLwotICAgIGFybVJldEFyZ0VycklmKHBTcmMgPT0gTlVMTCwgT01YX1N0c19CYWRBcmdFcnIpCi0gICAgYXJtUmV0QXJnRXJySWYocERzdExlZnQgPT0gTlVMTCwgT01YX1N0c19CYWRBcmdFcnIpCi0gICAgYXJtUmV0QXJnRXJySWYocERzdFJpZ2h0ID09IE5VTEwsIE9NWF9TdHNfQmFkQXJnRXJyKQotICAgIGFybVJldEFyZ0VycklmKChpV2lkdGggPT0gNCkgJiYgCi0gICAgICAgICAgICAgICAgICAgYXJtTm90NEJ5dGVBbGlnbmVkKHBEc3RMZWZ0KSAmJgotICAgICAgICAgICAgICAgICAgIGFybU5vdDRCeXRlQWxpZ25lZChwRHN0UmlnaHQpLCBPTVhfU3RzX0JhZEFyZ0VycikKLSAgICBhcm1SZXRBcmdFcnJJZigoaVdpZHRoID09IDgpICYmIAotICAgICAgICAgICAgICAgICAgIGFybU5vdDhCeXRlQWxpZ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aCwgICAKLSAgICAgICAgaUhlaWdodCk7Ci0KLSAgICByZXR1cm4gUmV0VmFsdWU7Ci19Ci0KLS8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgotICogICAgICAgICAgICAgICAgICAgICAgICAgICAgICBFTkQgT0YgRklMRQotICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotCmRpZmYgLS1naXQgYS9tZWRpYS9saWJzdGFnZWZyaWdodC9jb2RlY3Mvb24yL2gyNjRkZWMvb214ZGwvcmVmZXJlbmNlL3ZjL200cDEwL3NyYy9vbXhWQ000UDEwX0ludGVycG9sYXRlSGFsZlZlcl9MdW1hLmMgYi9tZWRpYS9saWJzdGFnZWZyaWdodC9jb2RlY3Mvb24yL2gyNjRkZWMvb214ZGwvcmVmZXJlbmNlL3ZjL200cDEwL3NyYy9vbXhWQ000UDEwX0ludGVycG9sYXRlSGFsZlZlcl9MdW1hLmMKZGVsZXRlZCBmaWxlIG1vZGUgMTAwNjQ0CmluZGV4IDM1NjBmZjguLjAwMDAwMDAKLS0tIGEvbWVkaWEvbGlic3RhZ2VmcmlnaHQvY29kZWNzL29uMi9oMjY0ZGVjL29teGRsL3JlZmVyZW5jZS92Yy9tNHAxMC9zcmMvb214VkNNNFAxMF9JbnRlcnBvbGF0ZUhhbGZWZXJfTHVtYS5jCisrKyAvZGV2L251bGwKQEAgLTEsMTIzICswLDAgQEAKLS8qKgotICogCi0gKiBGaWxlIE5hbWU6ICBvbXhWQ000UDEwX0ludGVycG9sYXRlSGFsZlZlcl9MdW1hLmMKLSAqIE9wZW5NQVggREw6IHYxLjAuMgotICogUmV2aXNpb246ICAgOTY0MQotICogRGF0ZTogICAgICAgVGh1cnNkYXksIEZlYnJ1YXJ5IDcsIDIwMDgKLSAqIAotICogKGMpIENvcHlyaWdodCAyMD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naHQKLSkKLXsKLSAgICBPTVhSZXN1bHQgICBSZXRWYWx1ZTsKLQotICAgIC8qIGNoZWNrIGZvciBhcmd1bWVudCBlcnJvciAqLwotICAgIGFybVJldEFyZ0VycklmKHBTcmMgPT0gTlVMTCwgT01YX1N0c19CYWRBcmdFcnIpCi0gICAgYXJtUmV0QXJnRXJySWYocERzdFVwID09IE5VTEwsIE9NWF9TdHNfQmFkQXJnRXJyKQotICAgIGFybVJldEFyZ0VycklmKHBEc3REb3duID09IE5VTEwsIE9NWF9TdHNfQmFkQXJnRXJyKQotICAgIGFybVJldEFyZ0VycklmKChpV2lkdGggPT0gNCkgJiYgCi0gICAgICAgICAgICAgICAgICAgYXJtTm90NEJ5dGVBbGlnbmVkKHBEc3RVcCkgJiYKLSAgICAgICAgICAgICAgICAgICBhcm1Ob3Q0Qnl0ZUFsaWduZWQocERzdERvd24pLCBPTVhfU3RzX0JhZEFyZ0VycikKLSAgICBhcm1SZXRBcmdFcnJJZigoaVdpZHRoID09IDgpICYmIAotICAgICAgICAgICAgICAgICAgIGFybU5vdDhCeXRlQWxpZ25lZChwRHN0VXApICYmCi0gICAgICAgICAgICAgICAgICAgYXJtTm90OEJ5dGVBbGlnbmVkKHBEc3REb3duKSwgT01YX1N0c19CYWRBcmdFcnIpCi0gICAgYXJtUmV0QXJnRXJySWYoKGlXaWR0aCA9PSAxNikgJiYgCi0gICAgICAgICAgICAgICAgICAgYXJtTm90MTZCeXRlQWxpZ25lZChwRHN0VXApICYmCi0gICAgICAgICAgICAgICAgICAgYXJtTm90MTZCeXRlQWxpZ25lZChwRHN0RG93biksIE9NWF9TdHNfQmFkQXJnRXJyKQotCi0gICAgYXJtUmV0QXJnRXJySWYoKGlIZWlnaHQgIT0gMTYpICYmIChpSGVpZ2h0ICE9IDgpJiYgKGlIZWlnaHQgIT0gNCksIE9NWF9TdHNfQmFkQXJnRXJyKQotCWFybVJldEFyZ0VycklmKChpV2lkdGggIT0gMTYpICYmIChpV2lkdGggIT0gOCkmJiAoaVdpZHRoICE9IDQpLCBPTVhfU3RzX0JhZEFyZ0VycikKLQotICAgIFJldFZhbHVlID0gYXJtVkNNNFAxMF9JbnRlcnBvbGF0ZUhhbGZWZXJfTHVtYSggIAotICAgICAgICBwU3JjIC0gaVNyY1N0ZXAsIAotICAgICAgICBpU3JjU3RlcCwgCi0gICAgICAgIHBEc3RVcCwKLSAgICAgICAgaURzdFN0ZXAsIAotICAgICAgICBpV2lkdGgsIAotICAgICAgICBpSGVpZ2h0KTsKLSAgICAKLSAgICBpZiAoUmV0VmFsdWUgIT0gT01YX1N0c19Ob0VycikKLSAgICB7Ci0gICAgICAgIHJldHVybiBSZXRWYWx1ZTsKLSAgICB9Ci0KLSAgICBSZXRWYWx1ZSA9IGFybVZDTTRQMTBfSW50ZXJwb2xhdGVIYWxmVmVyX0x1bWEoICAKLSAgICAgICAgcFNyYywgCi0gICAgICAgIGlTcmNTdGVwLCAKLSAgICAgICAgcERzdERvd24sCi0gICAgICAgIGlEc3RTdGVwLCAKLSAgICAgICAgaVdpZHRoLCAKLSAgICAgICAgaUhlaWdodCk7Ci0gICAgCi0gICAgcmV0dXJuIFJldFZhbHVlOwotfQotCi0vKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKLSAqICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgRU5EIE9GIEZJTEUKLSAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLQpkaWZmIC0tZ2l0IGEvbWVkaWEvbGlic3RhZ2VmcmlnaHQvY29kZWNzL29uMi9oMjY0ZGVjL29teGRsL3JlZmVyZW5jZS92Yy9tNHAxMC9zcmMvb214VkNNNFAxMF9JbnRlcnBvbGF0ZUx1bWEuYyBiL21lZGlhL2xpYnN0YWdlZnJpZ2h0L2NvZGVjcy9vbjIvaDI2NGR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YX1N0c19CYWRBcmdFcnIpCi0gICAgYXJtUmV0QXJnRXJySWYoKHJvaS53aWR0aCA9PSA4KSAmJiBhcm1Ob3Q4Qnl0ZUFsaWduZWQocERzdCksIE9NWF9TdHNfQmFkQXJnRXJyKQotICAgIGFybVJldEFyZ0VycklmKChyb2kud2lkdGggPT0gMTYpICYmIGFybU5vdDE2Qnl0ZUFsaWduZWQocERzdCksIE9NWF9TdHNfQmFkQXJnRXJyKQotICAgIGFybVJldEFyZ0VycklmKHNyY1N0ZXAgJiA3LCBPTVhfU3RzX0JhZEFyZ0VycikKLSAgICBhcm1SZXRBcmdFcnJJZihkc3RTdGVwICYgNywgT01YX1N0c19CYWRBcmdFcnIpIAotCi0gICAgcmV0dXJuIGFybVZDTTRQMTBfSW50ZXJwb2xhdGVfTHVtYSAKLSAgICAgICAgKHBTcmMsIHNyY1N0ZXAsIHBEc3QsIGRzdFN0ZXAsIHJvaS53aWR0aCwgcm9pLmhlaWdodCwgZHgsIGR5KTsKLQotfQotCi0KLS8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgotICogICAgICAgICAgICAgICAgICAgICAgICAgICAgICBFTkQgT0YgRklMRQotICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotCmRpZmYgLS1naXQgYS9tZWRpYS9saWJzdGFnZWZyaWdodC9jb2RlY3Mvb24yL2gyNjRkZWMvb214ZGwvcmVmZXJlbmNlL3ZjL200cDEwL3NyYy9vbXhWQ000UDEwX0ludlRyYW5zZm9ybURlcXVhbnRfQ2hyb21hREMuYyBiL21lZGlhL2xpYnN0YWdlZnJpZ2h0L2NvZGVjcy9vbjIvaDI2NGRlYy9vbXhkbC9yZWZlcmVuY2UvdmMvbTRwMTAvc3JjL29teFZDTTRQMTBfSW52VHJhbnNmb3JtRGVxdWFudF9Da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tVkNNNFAxMF9WTWF0cml4IFtpUVAgJSA2XVswXTsKLQotICAgIGZvciAoaiA9IDA7IGogPCAyOyBqKyspCi0gICAgewotICAgICAgICBmb3IgKGkgPSAwOyBpIDwgMjsgaSsrKQotICAgICAgICB7Ci0gICAgICAgICAgICBpZiAoUVBlciA8IDEpCi0gICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgVmFsdWUgPSAobVtqXVtpXSAqIFYwMCkgPj4gMTsKLSAgICAgICAgICAgIH0KLSAgICAgICAgICAgIGVsc2UKLSAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICBWYWx1ZSA9IChtW2pdW2ldICogVjAwKSA8PCAoUVBlciAtIDEpOwotICAgICAgICAgICAgfQotCi0gICAgICAgICAgICBwRHN0W2ogKiAyICsgaV0gPSAoT01YX1MxNikgVmFsdWU7Ci0gICAgICAgIH0KLSAgICB9Ci0KLSAgICByZXR1cm4gT01YX1N0c19Ob0VycjsKLX0KLQotLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCi0gKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEVORCBPRiBGSUxFCi0gKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0KZGlmZiAtLWdpdCBhL21lZGlhL2xpYnN0YWdlZnJpZ2h0L2NvZGVjcy9vbjIvaDI2NGRlYy9vbXhkbC9yZWZlcmVuY2UvdmMvbTRwMTAvc3JjL29teFZDTTRQMTBfSW52VHJhbnNmb3JtRGVxdWFudF9MdW1hREMuYyBiL21lZGlhL2xpYnN0YWdlZnJpZ2h0L2NvZGVjcy9vbjIvaDI2NGRlYy9vbXhkbC9yZWZlcmVuY2UvdmMvbTRwMTAvc3JjL29teFZDTTRQMTBfSW52VHJhbnNmb3JtRGVxdWFudF9MdW1hREMuYwpkZWxldGVkI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ldWzBdID0gbTFbaV1bMF0gKyBtMVtpXVsxXTsgLyogYStiK2MrZCAqLwotICAgICAgICBtMltpXVsxXSA9IG0xW2ldWzJdICsgbTFbaV1bM107IC8qIGErYi1jLWQgKi8KLSAgICAgICAgbTJbaV1bMl0gPSBtMVtpXVsyXSAtIG0xW2ldWzNdOyAvKiBhLWItYytkICovCi0gICAgICAgIG0yW2ldWzNdID0gbTFbaV1bMF0gLSBtMVtpXVsxXTsgLyogYS1iK2MtZCAqLwotCi0gICAgfQotCi0gICAgLyogVmVydGljYWwgKi8KLSAgICBmb3IgKGkgPSAwOyBpIDwgNDsgaSsrKQotICAgIHsKLSAgICAgICAgbTFbMF1baV0gPSBtMlswXVtpXSArIG0yWzJdW2ldOwotICAgICAgICBtMVsxXVtpXSA9IG0yWzFdW2ldICsgbTJbM11baV07Ci0gICAgICAgIG0xWzJdW2ldID0gbTJbMF1baV0gLSBtMlsyXVtpXTsKLSAgICAgICAgbTFbM11baV0gPSBtMlsxXVtpXSAtIG0yWzNdW2ldOwotCi0gICAgICAgIG0yWzBdW2ldID0gbTFbMF1baV0gKyBtMVsxXVtpXTsKLSAgICAgICAgbTJbMV1baV0gPSBtMVsyXVtpXSArIG0xWzNdW2ldOwotICAgICAgICBtMlsyXVtpXSA9IG0xWzJdW2ldIC0gbTFbM11baV07Ci0gICAgICAgIG0yWzNdW2ldID0gbTFbMF1baV0gLSBtMVsxXVtpXTsKLSAgICB9Ci0KLSAgICAKLSAgICAvKiBTY2FsaW5nICovCi0gICAgUVBlciA9IGlRUCAvIDY7Ci0gICAgViA9IGFybVZDTTRQMTBfVk1hdHJpeCBbaVFQICUgNl1bMF07Ci0KLSAgICBmb3IgKGogPSAwOyBqIDwgNDsgaisrKQotICAgIHsKLSAgICAgICAgZm9yIChpID0gMDsgaSA8IDQ7IGkrKykKLSAgICAgICAgewotICAgICAgICAgICAgaWYgKFFQZXIgPCAyKQotICAgICAgICAgICAgewotICAgICAgICAgICAgICAgIFZhbHVlID0gKG0yW2pdW2ldICogViArICgxIDw8ICgxIC0gUVBlcikpKSA+PiAoMiAtIFFQZXIpOwotICAgICAgICAgICAgfQotICAgICAgICAgICAgZWxzZQotICAgICAgICAgICAgewotICAgICAgICAgICAgICAgIFZhbHVlID0gbTJbal1baV0gKiBWICogKDEgPDwgKFFQZXIgLSAyKSk7Ci0gICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgICAgICAgICAKLSAgICAgICAgICAgIHBEc3RbaiAqIDQgKyBpXSA9IChPTVhfUzE2KSBWYWx1ZTsKLSAgICAgICAgICAgIAotICAgICAgICB9Ci0gICAgfQotICAgIHJldHVybiBPTVhfU3RzX05vRXJyOwotfQotCi0vKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKLSAqICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgRU5EIE9GIEZJTEUKLSAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLQpkaWZmIC0tZ2l0IGEvbWVkaWEvbGlic3RhZ2VmcmlnaHQvY29kZWNzL29uMi9oMjY0ZGVjL29teGRsL3JlZmVyZW5jZS92Yy9tNHAxMC9zcmMvb214VkNNNFAxMF9JbnZUcmFuc2Zvcm1SZXNpZHVhbEFuZEFkZC5jIGIvbWVkaWEvbGlic3RhZ2VmcmlnaHQvY29kZWNzL29uMi9oMjY0ZGVjL29teGRsL3JlZmVyZW5jZS92Yy9tNHAxMC9zcmMvb214VkNNNFAxMF9JbnZUcmFuc2Zvcm1SZXNpZHVhbEFuZEFkZC5jCmRlbGV0ZWQgZmlsZSBtb2RlIDEwMDY0NAppbmRleCAzMzAzOTk3Li4wMDAwMDAwCi0tLSBhL21lZGlhL2xpYnN0YWdlZnJpZ2h0L2NvZGVjcy9vbjIvaDI2NGRlYy9vbXhkbC9yZWZlcmVuY2UvdmMvb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bGlnbmVkKHBEZXF1YW50Q29lZmYpLCBPTVhfU3RzX0JhZEFyZ0VycikKLSAgICBhcm1SZXRBcmdFcnJJZihwRHN0UmVjb24gPT0gTlVMTCwgT01YX1N0c19CYWRBcmdFcnIpCi0gICAgYXJtUmV0QXJnRXJySWYoYXJtTm90NEJ5dGVBbGlnbmVkKHBEc3RSZWNvbiksIE9NWF9TdHNfQmFkQXJnRXJyKQotICAgIGFybVJldEFyZ0VycklmKGJBQyA+IDEsIE9NWF9TdHNfQmFkQXJnRXJyKQotICAgIGFybVJldEFyZ0VycklmKGlTcmNQcmVkU3RlcCA9PSAwIHx8IGlTcmNQcmVkU3RlcCAmIDMsIE9NWF9TdHNfQmFkQXJnRXJyKQotICAgIGFybVJldEFyZ0VycklmKGlEc3RSZWNvblN0ZXAgPT0gMCB8fCBpRHN0UmVjb25TdGVwICYgMywgT01YX1N0c19CYWRBcmdFcnIpCi0KLSAgICBpZiAoYkFDKQotICAgIHsKLSAgICAgICAgZm9yIChpID0gMDsgaSA8IDE2OyBpKyspCi0gICAgICAgIHsKLSAgICAgICAgICAgIEluW2ldID0gcERlcXVhbnRDb2VmZiBbaV07Ci0gICAgICAgIH0KLSAgICB9Ci0gICAgZWxzZQotICAgIHsKLSAgICAgICAgLyogQ29weSBEQyAqLwotICAgICAgICBJblswXSA9IHBEZXF1YW50Q29lZmYgWzBdOwotICAgIAotICAgICAgICBmb3IgKGkgPSAxOyBpIDwgMTY7IGkrKykKLSAgICAgICAgewotICAgICAgICAgICAgSW5baV0gPSAwOwotICAgICAgICB9Ci0gICAgfQotCi0gICAgLyogUmVzaWR1YWwgVHJhbnNmb3JtICovCi0gICAgYXJtVkNNNFAxMF9UcmFuc2Zvcm1SZXNpZHVhbDR4NCAoT3V0LCBJbik7ICAgIAotICAgIAotICAgIGZvciAoaiA9IDA7IGogPCA0OyBqKyspCi0gICAgewotICAgICAgICBmb3IgKGkgPSAwOyBpIDwgNDsgaSsrKQotICAgICAgICB7Ci0gICAgICAgICAgICAvKiBBZGQgcHJlZGl0aW9uICovCi0gICAgICAgICAgICBWYWx1ZSA9IChPTVhfUzMyKSBPdXQgW2ogKiA0ICsgaV0gKyBwU3JjUHJlZCBbaiAqIGlTcmNQcmVkU3RlcCArIGldOwotICAgICAgICAgICAgCi0gICAgICAgICAgICAvKiBTYXR1cmF0ZSBWYWx1ZSB0byBPTVhfVTggKi8KLSAgICAgICAgICAgIFZhbHVlID0gYXJtQ2xpcCAoMCwgMjU1LCBWYWx1ZSk7Ci0KLSAgICAgICAgICAgIHBEc3RSZWNvbltqICogaURzdFJlY29uU3RlcCArIGldID0gKE9NWF9VOCkgVmFsdWU7Ci0gICAgICAgIH0KLSAgICB9Ci0KLSAgICByZXR1cm4gT01YX1N0c19Ob0VycjsKLX0KLQotLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCi0gKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEVORCBPRiBGSUxFCi0gKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCi0KZGlmZiAtLWdpdCBhL21lZGlhL2xpYnN0YWdlZnJpZ2h0L2NvZGVjcy9vbjIvaDI2NGRlYy9vbXhkbC9yZWZlcmVuY2UvdmMvbTRwMTAvc3JjL29teFZDTTRQMTBfTUVHZXRCdWZTaXplLmMgYi9tZWRpYS9saWJzdGFnZWZyaWdodC9jb2RlY3Mvb24yL2gyNjRkZWMvb214ZGwvcmVmZXJlbmNlL3ZjL200cDEwL3NyYy9vbXhWQ000UDEwX01FR2V0QnVmU2l6ZS5jCmRlbGV0ZWQgZmlsZSBtb2RlIDEwMDY0NAppbmRleCA4YzNhNWMzLi4wMDAwMDAwCi0tLSBhL21lZGlhL2xpYnN0YWdlZnJpZ2h0L2NvZGVjcy9vbjIvaDI2NGRlYy9vbXhkbC9yZWZlc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NFNyY1kgKyAKLSAgICAgICAgICAgIFN0ZXBQcmVkSW50cmE0eDRTcmNZICogKEJsb2NrWSA8PCAyKSArIAotICAgICAgICAgICAgKEJsb2NrWCA8PCAyKTsKLSAgICAgICAgICAgIAotICAgIFN0ZXBTcmNZID0gU3RlcFByZWRJbnRyYTR4NFNyY1k7Ci0gICAgICAgICAgICAgIAotICAgIHggPSBCbG9ja1ggKiA0OwotICAgIHkgPSBCbG9ja1kgKiA0OwotCi0gICAgQ29zdCA9IEJlc3RDb3N0ID0gQVJNX1ZDTTRQMTBfTUFYX0NPU1Q7Ci0gICAgCi0gICAgLyogR28gdGhyb3VnaCBlYWNoIG1vZGUgZm9yIG1pbmltIGNvc3QgKi8KLSAgICBmb3IgKG1vZGUgPSAwOyBtb2RlIDwgOTsgbW9kZSsrKQotICAgIHsKLSAgICAgICAgUmV0ID0gb214VkNNNFAxMF9QcmVkaWN0SW50cmFfNHg0KAotICAgICAgICAgICAgIHBTcmNZIC0gMSwKLSAgICAgICAgICAgICBwU3JjWSAtIFN0ZXBTcmNZLAotICAgICAgICAgICAgIHBTcmNZIC0gU3RlcFNyY1kgLSAxLAotICAgICAgICAgICAgIHBQcmVkQmxvY2ssCi0gICAgICAgICAgICAgU3RlcFNyY1ksCi0gICAgICAgICAgICAgNCwKLSAgICAgICAgICAgICAoT01YVkNNNFAxMEludHJhNHg0UHJlZE1vZGUpIG1vZGUsCi0gICAgICAgICAgICAgYXZhaWxhYmlsaXR5KTsKLSAgICAgICAgICAgICAKLSAgICAgICAgaWYgKFJldCA9PSBPTVhfU3RzX05vRXJyKQotICAgICAgICB7ICAgICAgICAgICAgCi0gICAgICAgICAgICBhcm1WQ0NPTU1fU0FEKCAgICAKLSAgICAgICAgICAgICAgICBwU3JjQ3VyckJ1ZiArICh5ICogU3JjQ3VyclN0ZXApICsgeCwKLSAgICAgICAgICAgICAgICBTcmNDdXJyU3RlcCwKLSAgICAgICAgICAgICAgICBwUHJlZEJsb2NrLAotICAgICAgICAgICAgICAgIDQsCi0gICAgICAgICAgICAgICAgJkNvc3QsCi0gICAgICAgICAgICAgICAgNCwKLSAgICAgICAgICAgICAgICA0KTsKLSAgICAgICAgICAgIAotICAgICAgICAgICAgaWYgKENvc3QgPCBCZXN0Q29zdCkKLSAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICBCZXN0Q29zdCA9IENvc3Q7Ci0gICAgICAgICAgICAgICAgCi0gICAgICAgICAgICAgICAgcEludHJhNHg0UHJlZE1vZGUgW0Jsb2NrWSArIDFdW0Jsb2NrWCArIDFdID0gCi0gICAgICAgICAgICAgICAgICAgIChPTVhWQ000UDEwSW50cmE0eDRQcmVkTW9kZSkgbW9kZTsgICAgICAgICAgICAgICAgCi0gICAgICAgICAgICAgICAgcFNyY0RzdE1CQ3Vyci0+cEludHJhNHg0UHJlZE1vZGUgW0Jsb2NrWSAqIDQgKyBCbG9ja1hdID0gCi0gICAgICAgICAgICAgICAgICAgIChPTVhWQ000UDEwSW50cmE0eDRQcmVkTW9kZSkgbW9kZTsKLQotICAgICAgICAgICAgICAgIGZvciAoaiA9IDA7IGogPCA0OyBqKyspCi0gICAgICAgICAgICAgICAgewotICAgICAgICAgICAgICAgICAgICBmb3IgKGkgPSAwOyBpIDwgNDsgaSsrKQotICAgICAgICAgICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgICAgICAgICBwU3JjWSBbU3RlcFNyY1kgKiBqICsgaV0gPSBwUHJlZEJsb2NrIFs0ICogaiArIGldOwotICAgICAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgfQotICAgICAgICB9Ci0gICAgfQotCi0gICAgKnBCZXN0Q29zdCA9IEJlc3RDb3N0OwotICAgIHJldHVybjsKLX0KLQotLyoqCi0gKiBGdW5jdGlvbjogYXJtVkNNNFAxMF9TZXRNb3Rpb25WZWN0b3JQcmVkaWN0b3IKLSAqCi0gKiBEZXNjcmlwdGlvbjoKLSAqICAgIFRoaXMgZnVuY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A4ICYmIEJsb2NrU2l6ZXkgPT0gMTYpCi0gICAgewotICAgICAgICBpZihCbG9ja1N0YXJ0WCA9PSAwKQotICAgICAgICB7Ci0gICAgICAgICAgICBpZihSRnJhbWVMID09IFJlZkZyYW1lKQotICAgICAgICAgICAgewotICAgICAgICAgICAgICAgIE1WUHJlZFR5cGUgPSBBUk1fVkNNNFAxMF9NVlBSRURfTDsKLSAgICAgICAgICAgIH0KLSAgICAgICAgfQotICAgICAgICBlbHNlCi0gICAgICAgIHsKLSAgICAgICAgICAgIGlmIChSRnJhbWVVUiA9PSBSZWZGcmFtZSkKLSAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICBNVlByZWRUeXBlID0gQVJNX1ZDTTRQMTBfTVZQUkVEX1VSOwotICAgICAgICAgICAgfQotICAgICAgICB9Ci0gICAgfQotICAgIGVsc2UgaWYoQmxvY2tTaXpleCA9PSAxNiAmJiBCbG9ja1NpemV5ID09IDgpCi0gICAgewotICAgICAgICBpZihCbG9ja1N0YXJ0WSA9PSAwKQotICAgICAgICB7Ci0gICAgICAgICAgICBpZihSRnJhbWVVID09IFJlZkZyYW1lKQotICAgICAgICAgICAgewotICAgICAgICAgICAgICAgIE1WUHJlZFR5cGUgPSBBUk1fVkNNNFAxMF9NVlBSRURfVTsKLSAgICAgICAgICAgIH0KLSAgICAgICAgfQotICAgICAgICBlbHNlCi0gICAgICAgIHsKLSAgICAgICAgICAgIGlmKFJGcmFtZUwgPT0gUmVmRnJhbWUpCi0gICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgTVZQcmVkVHlwZSA9IEFSTV9WQ000UDEwX01WUFJFRF9MOwotICAgICAgICAgICAgfQotICAgICAgICB9Ci0gICAgfQotCi0gICAgc3dpdGNoIChNVlByZWRUeXBlKQotICAgIHsKLSAgICBjYXNlIEFSTV9WQ000UDEwX01WUFJFRF9NRURJQU46Ci0gICAgICAgIGlmICghKHBSZWZGckFyciBbQmxvY2tZTWluMUZyXVtCbG9ja1hNaW4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VZDYWxjdWxhdGVkLmR5OyovCi0KLSAgICBwTUVQYXJhbXMgPSAoT01YVkNNNFAxME1FUGFyYW1zICopIHBNRVNwZWM7Ci0gICAgCi0gICAgLyogQmxvY2sgTWF0Y2ggSGFsZiBwZWwgKi8KLSAgICBpZiAocE1FUGFyYW1zLT5oYWxmU2VhcmNoRW5hYmxlKQotICAgIHsKLSAgICAgICAgUmV0VmFsdWUgPSBvbXhWQ000UDEwX0Jsb2NrTWF0Y2hfSGFsZigKLSAgICAgICAgICAgIHBTcmNDdXJyQnVmLCAKLSAgICAgICAgICAgIFNyY0N1cnJTdGVwLCAKLSAgICAgICAgICAgIHBTcmNSZWZZLCAKLSAgICAgICAgICAgIG5TcmNSZWZTdGVwLCAKLSAgICAgICAgICAgIEJsb2NrU2l6ZVgsIAotICAgICAgICAgICAgQmxvY2tTaXplWSwgCi0gICAgICAgICAgICBuTGFtZGEsIAotICAgICAgICAgICAgcE1WUHJlZCwgCi0gICAgICAgICAgICAmTVZDYWxjdWxhdGVkLCAgICAgICAgLyogaW5wdXQvb3V0cHV0Ki8KLSAgICAgICAgICAgICZDb3N0KTsKLSAgICB9Ci0KLSAgICAvKiBCbG9jayBNYXRjaCBRdWFydGVyIHBlbCAqLwotICAgIGlmIChwTUVQYXJhbXMtPnF1YXJ0ZXJTZWFyY2hFbmFibGUpCi0gICAgewotICAgICAgICBSZXRWYWx1ZSA9IG9teFZDTTRQMTBfQmxvY2tNYXRjaF9RdWFydGVyKAotICAgICAgICAgICAgcFNyY0N1cnJCdWYsIAotICAgICAgICAgICAgU3JjQ3VyclN0ZXAsIAotICAgICAgICAgICAgcFNyY1JlZlksIAotICAgICAgICAgICAgblNyY1JlZlN0ZXAsIAotICAgICAgICAgICAgQmxvY2tTaXplWCwgCi0gICAgICAgICAgICBCbG9ja1NpemVZLCAKLSAgICAgICAgICAgIG5MYW1kYSwgCi0gICAgICAgICAgICBwTVZQcmVkLCAKLSAgICAgICAgICAgICZNVkNhbGN1bGF0ZW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Qb3MsCi0gICAgICAgICAgICAgICAgICAgIHBNRVNwZWMsIAotCi0gICAgICAgICAgICAgICAgICAgIExhbWJkYSwKLSAgICAgICAgICAgICAgICAgICAgJkJsb2NrQ29zdCwgCi0gICAgICAgICAgICAgICAgICAgICZEc3RNViwKLSAgICAgICAgICAgICAgICAgICAgCi0gICAgICAgICAgICAgICAgICAgIHggKyBQYXJ0U3RhcnRYLCAKLSAgICAgICAgICAgICAgICAgICAgeSArIFBhcnRTdGFydFksCi0gICAgICAgICAgICAgICAgICAgIEJsb2NrV2lkdGgsCi0gICAgICAgICAgICAgICAgICAgIEJsb2NrSGVpZ2h0LAotICAgICAgICAgICAgICAgICAgICByZWYsCi0gICAgICAgICAgICAgICAgICAgIHBSZWZGckFyciwgCi0gICAgICAgICAgICAgICAgICAgIHBNVkFyciwKLSAgICAgICAgICAgICAgICAgICAgJk1WUHJlZCk7Ci0KLSAgICAgICAgICAgICAgICBQYXJ0aXRpb25Db3N0ICs9IEJsb2NrQ29zdDsKLQkJCQkKLQkJCQlPZmZYID0gKFBhcnRTdGFydFggKyB4KSA+PiAyOwotCQkJCU9mZlkgPSAoUGFydFN0YXJ0WSArIHkpID4+IDI7Ci0JCQkJCi0JICAgICAgICAgICAgZm9yIChqID0gMDsgaiA8IChCbG9ja0hlaWdodCA+PiAyKTsgaisrKQotCSAgICAgICAgICAgIHsKLQkgICAgICAgICAgICAgICAgZm9yIChpID0gMDsgaSA8IChCbG9ja1dpZHRoID4+IDIpOyBpKyspCi0JICAgICAgICAgICAgICAgIHsKLQkgICAgICAgICAgICAgICAgICAgIHBNVkFyciBbNCArIE9mZlkgKyBqXVs0ICsgT2ZmWCArIGldLmR4ID0gRHN0TVYuZHg7Ci0JICAgICAgICAgICAgICAgICAgICBwTVZBcnIgWzQgKyBPZmZZICsgal1bNCArIE9mZlggKyBpXS5keSA9IERzdE1WLmR5OwotCSAgICAgICAgICAgICAgICAgICAgcE1WUHJlZEFyciBbT2ZmWSArIGpdW09mZlggKyBpXS5keCA9IE1WUHJlZC5keDsKLQkgICAgICAgICAgICAgICAgICAgIHBNVlByZWRBcnIgW09mZlkgKyBqXVtPZmZYICsgaV0uZHkgPSBNVlByZWQuZHk7Ci0JICAgICAgICAgICAgICAgIH0KLQkgICAgICAgICAgICB9Ci0KLQkJCQlwUmVmRnJBcnIgWzIgKyAoT2ZmWSA+PiAxKV1bMiArIChPZmZYID4+IDEpXSA9IHJlZjsKLQkgICAgICAgICAgICBmb3IgKGogPSAwOyBqIDwgKEJsb2NrSGVpZ2h0ID4+IDMpOyBqKyspCi0JICAgICAgICAgICAgewotCSAgICAgICAgICAgICAgICBmb3IgKGkgPSAwOyBpIDwgKEJsb2NrV2lkdGggPj4gMyk7IGkrKykKLQkgICAgICAgICAgICAgICAgewotCQkJICAgICAgICAgICAgcFJlZkZyQXJyIFsyICsgKE9mZlkgPj4gMSkgKyBqXVsyICsgKE9mZlggPj4gMSkgKyBpXSA9IHJlZjsKLQkgICAgICAgICAgICAgICAgfQotCSAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgfQotICAgICAgICB9Ci0KLQkJLyoKLQkJICogSWYgUGFydGl0aW9uQ29zdCBpcyBsZXNzIGZvciB0aGlzIHJlZmVyZW5jZSBmcmFtZSwgbW90aW9uIHZlY3RvcnMgbmVlZHMgdG8gYmUgYmFja2VkdXAKLQkJICovCi0gICAgICAgIGlmIChQYXJ0aXRpb25Db3N0IDw9IEJlc3RDb3N0KQotICAgICAgICB7Ci0gICAgICAgICAgICBCZXN0Q29zdCA9IFBhcnRpdGlvbkNvc3Q7ICAgICAgICAgICAgCi0gICAgICAgICAgICBCZXN0UmVmRnJhbWUgPSByZWY7Ci0gICAgICAgICAgICAKLSAgICAgICAgICAgIGZvciAoeSA9IDA7IHkgPCAoUGFydEhlaWdodC9CbG9ja0hlaWdodCk7IHkrKykKLSAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICBmb3IgKHggPSAwOyB4IDwgKFBhcnRXaWR0aC9CbG9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pZ2h0ID4+IDIpOyBqKyspCi0gICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgZm9yIChpID0gMDsgaSA8IChCbG9ja1dpZHRoID4+IDIpOyBpKyspCi0gICAgICAgICAgICAgICAgewotICAgICAgICAgICAgICAgICAgICBwTVZBcnIgWzQgKyBPZmZZICsgal1bNCArIE9mZlggKyBpXS5keCA9IEJlc3RNVlt5XVt4XS5keDsKLSAgICAgICAgICAgICAgICAgICAgcE1WQXJyIFs0ICsgT2ZmWSArIGpdWzQgKyBPZmZYICsgaV0uZHkgPSBCZXN0TVZbeV1beF0uZHk7Ci0gICAgICAgICAgICAgICAgICAgIHBNVlByZWRBcnIgW09mZlkgKyBqXVtPZmZYICsgaV0uZHggPSBCZXN0TVZQcmVkW3ldW3hdLmR4OwotICAgICAgICAgICAgICAgICAgICBwTVZQcmVkQXJyIFtPZmZZICsgal1bT2ZmWCArIGldLmR5ID0gQmVzdE1WUHJlZFt5XVt4XS5keTsKLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICB9Ci0gICAgICAgICAgICAKLSAgICAgICAgICAgIGZvciAoaiA9IDA7IGogPCAoQmxvY2tIZWlnaHQgPj4gMyk7IGorKykKLSAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICBmb3IgKGkgPSAwOyBpIDwgKEJsb2NrV2lkdGggPj4gMyk7IGkrKykKLSAgICAgICAgICAgICAgICB7Ci0JCSAgICAgICAgICAgIHBSZWZGckFyciBbMiArIChPZmZZID4+IDEpICsgal1bMiArIChPZmZYID4+IDEpICsgaV0gPSBCZXN0UmVmRnJhbWU7Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgfQotICAgICAgICB9Ci0gICAgfQotCi0JKnBDb3N0ID0gQmVzdENvc3Q7Ci0gICAgcmV0dXJuIE9NWF9TdHNfTm9FcnI7Ci0KLX0KLQotLyoqCi0gKiBGdW5jdGlvbjogYXJtVkNNNFAxMF9JbnRyYTE2eDE2RXN0aW1hdGlvbg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YmlsaXR5IG9mIFVQIE1CICovCi0gICAgaWYgKChNQlBvc1kgIT0gMCkgJiYgKHBNQkludHJhIFsxXSAhPSAwIHx8IHBNQkludGVyIFsxXSAhPSAwKSkKLSAgICB7Ci0gICAgICAgIGF2YWlsYWJpbGl0eSB8PSBPTVhfVkNfVVBQRVI7ICAgICAgICAKLSAgICB9Ci0KLSAgICAvKiBDaGVjayBmb3IgYXZhaWxhYmlsaXR5IG9mIFVQLUxFRlQgTUIgKi8KLSAgICBpZiAoKE1CUG9zWCA+IDApICYmIChNQlBvc1kgPiAwKSAmJiAKLSAgICAgICAgKHBNQkludHJhIFsyXSAhPSAwIHx8IHBNQkludGVyIFsyXSAhPSAwKSkKLSAgICB7Ci0gICAgICAgIGF2YWlsYWJpbGl0eSB8PSBPTVhfVkNfVVBQRVJfTEVGVDsgICAgICAgIAotICAgIH0KLQotICAgICpwQ29zdCA9IEFSTV9WQ000UDEwX01BWF9DT1NUOwotICAgIGZvciAobW9kZSA9IDA7IG1vZGUgPCA0OyBtb2RlKyspCi0gICAgewotICAgICAgICBSZXQgPSBvbXhWQ000UDEwX1ByZWRpY3RJbnRyYV8xNngxNigKLSAgICAgICAgICAgICAgICBwU3JjUmVjQnVmIC0gMSwgCi0gICAgICAgICAgICAgICAgcFNyY1JlY0J1ZiAtIFNyY1JlY1N0ZXAsIAotICAgICAgICAgICAgICAgIHBTcmNSZWNCdWYgLSBTcmNSZWNTdGVwIC0gMSwgCi0gICAgICAgICAgICAgICAgcFByZWQsIAotICAgICAgICAgICAgICAgIFNyY1JlY1N0ZXAsIAotICAgICAgICAgICAgICAgIDE2LCAKLSAgICAgICAgICAgICAgICBJbnRyYU1vZGUxNngxNiBbbW9kZV0sIAotICAgICAgICAgICAgICAgIGF2YWlsYWJpbGl0eSk7Ci0gICAgICAgIGlmIChSZXQgPT0gT01YX1N0c19Ob0VycikgICAgICAgICAgICAgICAgICAgICAgICAgCi0gICAgICAgIHsKLSAgICAgICAgICAgIGFybVZDQ09NTV9TQUQoICAgIAotICAgICAgICAgICAgICAgIHBTcmNDdXJyQnVmLAotICAgICAgICAgICAgICAgIFNyY0N1cnJTdGVwLAotICAgICAgICAgICAgICAgIHBQcmVkLAotICAgICAgICAgICAgICAgIDE2LAotICAgICAgICAgICAgICAgICZDb3N0LAotICAgICAgICAgICAgICAgIDE2LAotICAgICAgICAgICAgICAgIDE2KTsKLSAgICAgICAgICAgIGlmIChDb3N0IDwgKnBDb3N0KQotICAgICAgICAgICAgewotICAgICAgICAgICAgICAgICpwQ29zdCA9IENvc3Q7Ci0gICAgICAgICAgICAgICAgcFNyY0RzdE1CQ3Vyci0+SW50cmExNngxNlByZWRNb2RlID0gSW50cmFNb2RlMTZ4MTYgW21vZGVdOwotICAgICAgICAgICAgfQotICAgICAgICAgICAgCi0gICAgICAgIH0KLSAgICAgICAgCi0gICAgfQotCi0gICAgcmV0dXJuIE9NWF9TdHNfTm9FcnI7Ci19Ci0KLS8qKgotICogRnVuY3Rpb246IGFybVZDTTRQMTBfSW50cmE0eDRFc3RpbWF0aW9uCi0gKgotICogRGVzY3JpcHRpb246Ci0gKiBQZXJmb3JtcyBNQi1sZXZlbCBtb3Rpb24gZXN0aW1hdGlvbiBmb3IgSW50cmEgNHg0IE1CIHR5cGUgYW5kIHNlbGVjdHMKLSAqIHRoZSBiZXN0IHNldCBvZiBtb2RlcyBzdXBwb3J0ZWQgaW4gYmFzZWxpbmUgcHJvZmlsZS4KLSAqCi0gKiBQYXJhbWV0ZXJzOgotICogW2luXSBwU3JjQ3VyckJ1ZiAgICAtIFBvaW50ZXIgdG8gdGhlIHN0YXJ0IG9mIGx1bWEgY29tcG9uZW50IG9mIGN1cnJlbnQgTWFjcm9ibG9jayAKLSAqIFtpbl0gU3JjQ3VyclN0ZXAgLSBTdGVwIHNpemUgZm9yIHRoZSBwb2ludGVyIHBTcmNDdXJyQnVmIAotICogW2luXSBwU3JjUmVjQnVmICAgIC0gUG9pbnRlciB0byB0aGUgc3RhcnQgb2Yg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mb3IgKHggPSAwOyB4IDwgNDsgeCsrKQotICAgIHsKLSAgICAgICAgLyogU3RvcmUgdmFsdWVzIG9mIGIwLCBiMSwgYjIsIGIzICovCi0gICAgICAgIGlmIChwTUJJbnRyYVsxXSAhPSBOVUxMKQotICAgICAgICB7Ci0gICAgICAgICAgICBQcmVkSW50cmE0eDRNb2RlIFswXVt4ICsgMV0gPSAKLSAgICAgICAgICAgICAgICBwTUJJbnRyYVsxXS0+cEludHJhNHg0UHJlZE1vZGVbMyo0ICsgeF07ICAgICAgICAgICAgCi0gICAgICAgIH0KLSAgICAgICAgCi0gICAgICAgIC8qIFN0b3JlIHZhbHVlcyBvZiBkMCwgZDEsIGQyLCBkMyAqLwotICAgICAgICBpZiAocE1CSW50cmFbM10gIT0gTlVMTCkKLSAgICAgICAgewotICAgICAgICAgICAgUHJlZEludHJhNHg0TW9kZSBbMF1beCArIDVdID0gCi0gICAgICAgICAgICAgICAgcE1CSW50cmFbM10tPnBJbnRyYTR4NFByZWRNb2RlWzMqNCArIHhdOwotICAgICAgICB9Ci0gICAgfQotICAgIAotICAgIC8qIFN0b3JlIHZhbHVlcyBvZiBjMyAqLwotICAgIGlmIChwTUJJbnRyYVsyXSAhPSBOVUxMKQotICAgIHsKLSAgICAgICAgUHJlZEludHJhNHg0TW9kZSBbMF1bMF0gPSBwTUJJbnRyYVsyXS0+cEludHJhNHg0UHJlZE1vZGVbMTVdOwotICAgIH0KLSAgICAKLSAgICBmb3IgKHkgPSAwOyB5IDwgNDsgeSsrKQotICAgIHsKLSAgICAgICAgLyogU3RvcmUgdmFsdWVzIG9mIGEwLCBhMSwgYTIsIGEzICovCi0gICAgICAgIGlmIChwTUJJbnRyYVswXSAhPSBOVUxMKQotICAgICAgICB7Ci0gICAgICAgICAgICBQcmVkSW50cmE0eDRNb2RlIFt5ICsgMV1bMF0gPSAKLSAgICAgICAgICAgICAgICBwTUJJbnRyYVswXS0+cEludHJhNHg0UHJlZE1vZGVbeSo0ICsgM107Ci0gICAgICAgIH0KLSAgICB9Ci0gICAgICAgIAotICAgIC8qCi0gICAgICogVXBkYXRlIG5laWdoYm91cmluZyBQcmVkIG1vZGUgYXJyYXkgd2hpY2ggd2lsbCBiZSB1c2VkIGZvcgotICAgICAqIHByZWRpY3Rpb24gb2YgSW50cmE0eDQgbW9kZXMuCi0gICAgICovCi0gICAgCi0gICAgU3RlcFNyY1kgPSAxNiAqIDM7Ci0gICAgZm9yICh5ID0gMDsgeSA8ICgxNiAqIDIpOyB5KyspCi0gICAgewotICAgICAgICBmb3IgKHggPSAwOyB4IDwgKDE2ICogMyk7IHgrKykKLSAgICAgICAgewotICAgICAgICAgICAgcFNyY1kgW1N0ZXBTcmNZICogeSArIHhdID0gCi0gICAgICAgICAgICAgICAgcFNyY1JlY0J1ZiBbU3JjUmVjU3RlcCAqICh5IC0gMTYpICsgeCAtIDE2XTsKLSAgICAgICAgfQotICAgIH0KLSAgICAKLSAgICAvKiBmb3IgZWFjaCA4eDggYmxvY2sgKi8KLSAgICBmb3IgKEJsb2NrOHg4ID0gMDsgQmxvY2s4eDggPCA0OyBCbG9jazh4OCsrKQotICAgIHsKLSAgICAgICAgLyogZm9yIGVhY2ggNHg0IGJsb2NrIGluc2lkZSA4eDggYmxvY2sgKi8KLSAgICAgICAgZm9yIChCbG9jazR4NCA9IDA7IEJsb2NrNHg0IDwgNDsgQmxvY2s0eDQrKykKLSAgICAgICAgewotICAgICAgICAgICAgYXJtVkNNNFAxMF9Nb2RlNHg0RGVjaXNpb24gKAotICAgICAgICAgICAgICAgIHBTcmNDdXJyQnVmLCAgIAotICAgICAgICAgICAgICAgIFNyY0N1cnJTdGVwLAotICAgICAgICAgICAgICAgIHBTcmNEc3RNQkN1cnIsCi0gICAgICAgICAgICAgICAgQmxvY2s4eDgsIAotICAgICAgICAgICAgICAgIEJsb2NrNHg0LAotICAgICAgICAgICAgICAgIHBTcmNZICsgMTYgKiBTdGVwU3JjWSArIDE2LAotICAgICAgICAgICAgICAgIFN0ZX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V1beF0uZHggPSAwOwotICAgICAgICAgICAgICAgIE1WQXJyIFt5XVt4XS5keSA9IDA7Ci0gICAgICAgICAgICB9Ci0gICAgICAgIH0KLSAgICB9ICAgIAotCi0gICAgZm9yICh5ID0gMDsgeSA8IDQ7IHkrKykKLSAgICB7Ci0gICAgICAgIGZvciAoeCA9IDA7IHggPCA2OyB4KyspCi0gICAgICAgIHsKLSAgICAgICAgICAgIGkgPSAzICogKHkgPj4gMSkgKyAoeCA+PiAxKTsKLSAgICAgICAgICAgIGlmICgoeSA8IDIgfHwgeCA8IDIpICYmIChwTUJJbnRlcltJbmRleFRvTG9jW2ldXSAhPSBOVUxMKSkKLSAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICBSZWZGckFyciBbeV1beF0gPSAKLSAgICAgICAgICAgICAgICAgICAgcE1CSW50ZXJbSW5kZXhUb0xvY1tpXV0tPnBSZWZMMElkeCBbKHkgJSAyKSAqIDIgKyAoeCAlIDIpXTsKLSAgICAgICAgICAgIH0KLSAgICAgICAgICAgIGVsc2UKLSAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICBSZWZGckFyciBbeV1beF0gPSBBUk1fVkNNNFAxMF9JTlZBTElEX0JMT0NLOwotICAgICAgICAgICAgfQotICAgICAgICB9Ci0gICAgfSAgICAKLQotICAgIGZvciAoeSA9IDA7IHkgPCA0OyB5KyspCi0gICAgewotICAgICAgICBmb3IgKHggPSAwOyB4IDwgNDsgeCsrKQotICAgICAgICB7Ci0gICAgICAgICAgICBNVlByZWRBcnIgW3ldW3hdLmR4ID0gMDsKLSAgICAgICAgICAgIE1WUHJlZEFyciBbeV1beF0uZHkgPSAwOwotICAgICAgICB9Ci0gICAgfQotICAgIC8qCi0gICAgICogTW90aW9uIEVzdGltYXRpb24gZm9yIDh4OCBNQiBQYXJ0aXRpb24gCi0gICAgICovCi0KLSAgICBmb3IgKGkgPSAwOyBpIDwgNDsgaSsrKQotICAgIHsKLSAgICAgICAgTW90aW9uQ29zdDh4O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ICAgICAgICAgICAgICBhcm1WQ000UDEwX1BhcnRpdGlvbk1FICgKLSAgICAgICAgICAgICAgICAgICAgcFNyY0N1cnJCdWYsICAgCi0gICAgICAgICAgICAgICAgICAgIFNyY0N1cnJTdGVwLAotICAgICAgICAgICAgICAgICAgICBwU3JjUmVmQnVmTGlzdCwgICAKLSAgICAgICAgICAgICAgICAgICAgU3JjUmVmU3RlcCwKLSAgICAgICAgICAgICAgICAgICAgcFJlZlJlY3QsCi0gICAgICAgICAgICAgICAgICAgIHBDdXJyUG9pbnRQb3MsCi0gICAgICAgICAgICAgICAgICAgIHBNRVNwZWMsCi0KLSAgICAgICAgICAgICAgICAgICAgUGFydFdpZHRoLAotICAgICAgICAgICAgICAgICAgICBQYXJ0SGVpZ2h0LAotICAgICAgICAgICAgICAgICAgICBCbG9ja1dpZHRoLAotICAgICAgICAgICAgICAgICAgICBCbG9ja0hlaWdodCwKLSAgICAgICAgICAgICAgICAgICAgUGFydFN0YXJ0WCwKLSAgICAgICAgICAgICAgICAgICAgUGFydFN0YXJ0WSwKLQotICAgICAgICAgICAgICAgICAgICBNVkFyciwKLSAgICAgICAgICAgICAgICAgICAgUmVmRnJBcnIsCi0gICAgICAgICAgICAgICAgICAgIE1WUHJlZEFyciwKLQotICAgICAgICAgICAgICAgICAgICBMYW1iZGEsCi0gICAgICAgICAgICAgICAgICAgICZDb3N0KTsKLSAgICAgICAgICAgICAgICAgICAgCi0gICAgICAgICAgICAgICAgaWYgKENvc3QgPD0gQmVzdENvc3QpCi0gICAgICAgICAgICAgICAgewotICAgICAgICAgICAgICAgICAgICAvKiBVcGRhdGUgY29zdCAqLwotICAgICAgICAgICAgICAgICAgICBCZXN0Q29zdCA9IENvc3Q7Ci0gICAgICAgICAgICAgICAgICAgIAotICAgICAgICAgICAgICAgICAgICAvKiBVcGRhdGUgTUJDdXJyIHN0cnVjdCAqLwotICAgICAgICAgICAgICAgICAgICBwU3JjRHN0TUJDdXJyLT5zdWJNQlR5cGUgW0Jsb2NrOHg4XSA9IE1vZGVTdWJNQlR5cGU0eDQgW21vZGVdOwotICAgICAgICAgICAgICAgICAgICAKLSAgICAgICAgICAgICAgICAgICAgcFNyY0RzdE1CQ3Vyci0+cFJlZkwwSWR4IFtCbG9jazh4OF0gPSBSZWZGckFyciBbMiArIChQYXJ0U3RhcnRZID4+IDMpXVsyICsgKFBhcnRTdGFydFggPj4gMyldOwotCi0gICAgICAgICAgICAgICAgICAgIC8qIFVwZGF0ZSBwTVYwIGFuZCBwTVZQcmVkIG9mIE1CQ3VyciBzdHJ1Y3QgKi8KLSAgICAgICAgICAgICAgICAgICAgZm9yIChqID0gMDsgaiA8IDI7IGorKykKLSAgICAgICAgICAgICAgICAgICAgewotICAgICAgICAgICAgICAgICAgICAgICAgZm9yIChpID0gMDsgaSA8IDI7IGkrKykKLSAgICAgICAgICAgICAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBwU3JjRHN0TUJDdXJyLT5wTVYwIFtCbG9jazJ5ICsgal1bQmxvY2syeCArIGldLmR4ID0KLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTVZBcnIgWzQgKyBCbG9jazJ5ICsgal1bNCArIEJsb2NrMnggKyBpXS5keDsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBwU3JjRHN0TUJDdXJyLT5wTVYwIFtCbG9jazJ5ICsgal1bQmxvY2syeCArIGldLmR5ID0KLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTVZBcnIgWzQgKyBCbG9jazJ5ICsgal1bNCArIEJsb2NrMnggKyBpXS5keTsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBwU3JjRHN0TUJDdXJyLT5wTVZQcmVkIFtCbG9jazJ5ICsgal1bQmxvY2syeCArIGldLmR4ID0KLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTVZQcmVkQXJyIFtCbG9jazJ5ICsgal1bQmxvY2syeCArIGldLmR4OwotICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBTcmNEc3RNQkN1cnItPnBNVlByZWQgW0Jsb2NrMnkgKyBqXVtCbG9jazJ4ICsgaV0uZHkgPQotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBNVlByZWRBcnIgW0Jsb2NrMnkgKyBqXVtCbG9jazJ4ICsgaV0uZHk7Ci0gICAgICAgICAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICB9Ci0gICAgICAgICAgICAKLSAgICAgICAgICAgIC8qIFVwZGF0ZSBjb3N0ICovCi0gICAgICAgICAgICBNb3Rpb25Db3N0OHg4IFtCbG9jazh4OF0gPSBCZXN0Q29zdDsKLSAgICAgICAgfQotICAgICAgICAKLSAgICAgICAgLyogQ29zdCBmb3IgbWJUeXBlIE9NWF9WQ19QXzh4OCAqLwotICAgICAgICBCZXN0Q29zdCA9IDA7Ci0gICAgICAgIGZvciAoaSA9IDA7IGkgPCA0OyBpKyspCi0gICAgICAgIHsKLSAgICAgICAgICAgIEJlc3RDb3N0ICs9IE1vdGlvbkNvc3Q4eDggW2ldOwotICAgICAgICB9Ci0gICAgfQotICAgIGVsc2UKLSAgICB7Ci0gICAgICAgIC8qIFNldCBzdWIgTUIgdHlwZSB0byA4eDggKi8KLSAgICAgICAgZm9yIChpID0gMDsgaSA8IDQ7IGkrKykKLSAgICAgICAgewotICAgICAgICAgICAgcFNyY0RzdE1CQ3Vyci0+c3ViTUJUeXBlIFtpXSA9IE9NWF9WQ19TVUJfUF84eDg7Ci0gICAgICAgIH0KLSAgICB9Ci0KLSAgICAvKgotICAgICAqIE1vdGlvbiBFc3RpbWF0aW9uIGZvciA4eDgsIDh4MTYsIDE2eDggYW5kIDE2eDE2IE1CIFBhcnRpdGlvbgotICAgICAqIElmIHBNQk9wdGlvbnMtPmI4eDhCbG9ja1NwbGl0RW5hYmxlIGlzIDAsIG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sCi0gICAgICAgICAgICAgICAgcEN1cnJQb2ludFBvcywKLSAgICAgICAgICAgICAgICBwTUVTcGVjLAotCi0gICAgICAgICAgICAgICAgUGFydFdpZHRoLAotICAgICAgICAgICAgICAgIFBhcnRIZWlnaHQsCi0gICAgICAgICAgICAgICAgQmxvY2tXaWR0aCwKLSAgICAgICAgICAgICAgICBCbG9ja0hlaWdodCwKLSAgICAgICAgICAgICAgICBQYXJ0U3RhcnRYLAotICAgICAgICAgICAgICAgIFBhcnRTdGFydFksCi0KLSAgICAgICAgICAgICAgICBNVkFyciwKLSAgICAgICAgICAgICAgICBSZWZGckFyciwKLSAgICAgICAgICAgICAgICBNVlByZWRBcnIsCi0KLSAgICAgICAgICAgICAgICBMYW1iZGEsCi0gICAgICAgICAgICAgICAgJkNvc3QpOwotICAgICAgICAgICAgICAgIAotICAgICAgICAgICAgICAgIE1CQ29zdCArPSBDb3N0OwotICAgICAgICB9Ci0KLSAgICAgICAgaWYgKE1CQ29zdCA8PSBCZXN0Q29zdCkKLSAgICAgICAgewotICAgICAgICAgICAgLyogVXBkYXRlIGNvc3QgKi8KLSAgICAgICAgICAgIEJlc3RDb3N0ID0gTUJDb3N0OwotICAgICAgICAgICAgCi0gICAgICAgICAgICAvKiBVcGRhdGUgbWJUeXBlIG9mIE1CQ3VyciBzdHJ1Y3QgKi8KLSAgICAgICAgICAgIHBTcmNEc3RNQkN1cnItPm1iVHlwZSA9IE1vZGVNQlR5cGUgW21vZGVdOwotICAgICAgICAgICAgCi0gICAgICAgICAgICAvKiBVcGRhdGUgcE1WMCBhbmQgcE1WUHJlZCBvZiBNQkN1cnIgc3RydWN0ICovCi0gICAgICAgICAgICBmb3IgKGogPSAwOyBqIDwgNDsgaisrKQotICAgICAgICAgICAgewotICAgICAgICAgICAgICAgIGZvciAoaSA9IDA7IGkgPCA0OyBpKyspCi0gICAgICAgICAgICAgICAgewotICAgICAgICAgICAgICAgICAgICBwU3JjRHN0TUJDdXJyLT5wTVYwIFtqXVtpXS5keCA9IE1WQXJyIFs0K2pdWzQraV0uZHg7Ci0gICAgICAgICAgICAgICAgICAgIHBTcmNEc3RNQkN1cnItPnBNVjAgW2pdW2ldLmR5ID0gTVZBcnIgWzQral1bNCtpXS5keTsKLSAgICAgICAgICAgICAgICAgICAgcFNyY0RzdE1CQ3Vyci0+cE1WUHJlZCBbal1baV0uZHggPSBNVlByZWRBcnIgW2pdW2ldLmR4OwotICAgICAgICAgICAgICAgICAgICBwU3JjRHN0TUJDdXJyLT5wTVZQcmVkIFtqXVtpXS5keSA9IE1WUHJlZEFyciBbal1baV0uZHk7Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgfQotICAgICAgICAgICAgZm9yIChqID0gMDsgaiA8IDI7IGorKykKLSAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICBmb3IgKGkgPSAwOyBpIDwgMjsgaSsrKQotICAgICAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAgICAgcFNyY0RzdE1CQ3Vyci0+cFJlZkwwSWR4IFtqKjIraV0gPSBSZWZGckFyciBbMitqXVsyK2ldOwotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgIH0KLSAgICAgICAgfQotCi0gICAgfQotCi0gICAgLyogVXBkYXRlIEJlc3QgQ29zdCAqLwotICAgICpwRHN0Q29zdCA9IEJlc3RDb3N0OwotICAgIAotICAgIHJldHVybiBPTVhfU3RzX05vRXJyOwotfQotCi0vKioKLSAqIEZ1bmN0aW9uOiAgb214VkNNNFAxMF9Nb3Rpb25Fc3RpbWF0aW9uTUIgICAoNi4zLjUuMy4xKQotICoKLSAqIERlc2NyaXB0aW9uOgotICogUGVyZm9ybXMgTUItbGV2ZWwgbW90aW9uIGVzdGltYXRpb24gYW5kIHNlbGVjdHMgYmVzdCBtb3Rpb24gZXN0aW1hdGlvbiAKLSAqIHN0cmF0ZWd5IGZyb20gdGhlIHNldCBvZiBtb2RlcyBzdXBwb3J0ZWQgaW4gYmFzZWxpbmUgcHJvZm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mFGbGFnID09IDEpCi0gICAgICAgIHsKLSAgICAgICAgICAgIEludHJhRmxhZyA9IDA7Ci0gICAgICAgIH0KLSAgICB9Ci0KLSAgICAqcERzdENvc3QgPSBBUk1fVkNNNFAxMF9NQVhfQ09TVDsKLSAgICAvKgotICAgICAqIEludGVyIGNvc3QgY2FsY3VsYXRpb25zIAotICAgICAqLwotCi0gICAgIC8qIGNoZWNrIHRoaXMgTUIgY2FuIGJlIEludGVyICovCi0gICAgaWYgKEludHJhRmxhZyAhPSAxKQotICAgIHsKLSAgICAgICAgIGFybVZDTTRQMTBfSW50ZXJNRU1CKAotICAgICAgICAgICAgIHBTcmNDdXJyQnVmLCAgIAotICAgICAgICAgICAgIFNyY0N1cnJTdGVwLAotICAgICAgICAgICAgIHBTcmNSZWZCdWZMaXN0LCAgIAotICAgICAgICAgICAgIFNyY1JlZlN0ZXAsCi0gICAgICAgICAgICAgcFJlZlJlY3QsICAgIAotICAgICAgICAgICAgIHBDdXJyUG9pbnRQb3MsCi0gICAgICAgICAgICAgTGFtYmRhLAotICAgICAgICAgICAgIHBNRVNwZWMsCi0gICAgICAgICAgICAgcE1CSW50ZXIsCi0gICAgICAgICAgICAgcFNyY0RzdE1CQ3VyciwKLSAgICAgICAgICAgICAmQ29zdAotICAgICAgICAgICAgICk7Ci0gICAgICAgIAotICAgICAgICAqcERzdENvc3QgPSBDb3N0OwotICAgIH0gICAgIAotCi0gICAgcE1FUGFyYW1zID0gKE9NWFZDTTRQMTBNRVBhcmFtcyAqKXBNRVNwZWM7Ci0gICAgCi0gICAgaWYgKHBNRVBhcmFtcy0+aW50cmFFbmFibGU0eDQgPT0gMSkKLSAgICB7Ci0gICAgICAgIC8qCi0gICAgICAgICAqIEludHJhIDR4NCBjb3N0IGNhbGN1bGF0aW9ucwotICAgICAgICAgKi8KLSAgICAgICAgYXJtVkNNNFAxMF9JbnRyYTR4NEVzdGltYXRpb24oCi0gICAgICAgICAgICBwU3JjQ3VyckJ1ZiwgICAKLSAg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Y0RzdE1CQ3VyciwgCi0gICAgICAgIHBTcmNDdXJyQnVmLCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKLSAgICAJU3JjQ3VyclN0ZXAsIAotICAgIAlwU3JjUmVmQnVmTGlzdCwKLSAgICAJU3JjUmVmU3RlcCwKLSAgICAJcFNyY1JlY0J1ZiwgCi0gICAgCVNyY1JlY1N0ZXAsCi0gICAgCXBSZWZSZWN0LAotICAgIAlwQ3VyclBvaW50UG9zLAotICAgIAlwTUJJbnRlciwgCi0gICAgCXBNQkludHJhLAotICAgIAlwRHN0QmxvY2tTQUQpOwotCi0KLQlyZXR1cm4gT01YX1N0c19Ob0VycjsKLX0KLQotCi0vKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKLSAqICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgRU5EIE9GIEZJTEUKLSAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KZGlmZiAtLWdpdCBhL21lZGlhL2xpYnN0YWdlZnJpZ2h0L2NvZGVjcy9vbjIvaDI2NGRlYy9vbXhkbC9yZWZlcmVuY2UvdmMvbTRwMTAvc3JjL29teFZDTTRQMTBfUHJlZGljdEludHJhQ2hyb21hXzh4OC5jIGIvbWVkaWEvbGlic3RhZ2VmcmlnaHQvY29kZWNzL29uMi9oMjY0ZGVjL29teGRsL3JlZmVyZW5jZS92Yy9tNHAxMC9zcmMvb214VkNNNFAxMF9QcmVkaWN0SW50cmFDaHJvbWFfOHg4LmMKZGVsZXRlZCBmaWxlIG1vZGUgMTAwNjQ0CmluZGV4IGQ2Y2E3ODMuLjAwMDAwMDAKLS0tIGEvbWVkaWEvbGlic3RhZ2VmcmlnaHQvY29kZWNzL29uMi9oMjY0ZGVjL29teGRsL3JlZmVyZW5jZS92Yy9tNHAxMC9zcmMvb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gICAgICAgICAgICAgcERzdFt5KmRzdFN0ZXAreF0gPSBwU3JjTGVmdFt5KmxlZnRTdGVwXTsKLSAgICAgICAgICAgIH0KLSAgICAgICAgfQotICAgICAgICBicmVhazsKLQotICAgIGNhc2UgT01YX1ZDX0NIUk9NQV9WRVJUOgotICAgICAgICBmb3IgKHk9MDsgeTw4OyB5KyspCi0gICAgICAgIHsKLSAgICAgICAgICAgIGZvciAoeD0wOyB4PDg7IHgrKykKLSAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICBwRHN0W3kqZHN0U3RlcCt4XSA9IHBTcmNBYm92ZVt4XTsKLSAgICAgICAgICAgIH0KLSAgICAgICAgfQotICAgICAgICBicmVhazsKLQotICAgIGNhc2UgT01YX1ZDX0NIUk9NQV9QTEFORToKLSAgICAgICAgSCA9IDQqKHBTcmNBYm92ZVs3XSAtIHBTcmNBYm92ZUxlZnRbMF0pOwotICAgICAgICBmb3IgKHg9MjsgeD49MDsgeC0tKQotICAgICAgICB7Ci0gICAgICAgICAgICBIICs9ICh4KzEpKihwU3JjQWJvdmVbNCt4XSAtIHBTcmNBYm92ZVsyLXhdKTsKLSAgICAgICAgfQotICAgICAgICBWID0gNCoocFNyY0xlZnRbNypsZWZ0U3RlcF0gLSBwU3JjQWJvdmVMZWZ0WzBdKTsKLSAgICAgICAgZm9yICh5PTI7IHk+PTA7IHktLSkKLSAgICAgICAgewotICAgICAgICAgICAgViArPSAoeSsxKSoocFNyY0xlZnRbKDQreSkqbGVmdFN0ZXBdIC0gcFNyY0xlZnRbKDIteSkqbGVmdFN0ZXBdKTsKLSAgICAgICAgfQotICAgICAgICBhID0gMTYqKHBTcmNBYm92ZVs3XSArIHBTcmNMZWZ0WzcqbGVmdFN0ZXBdKTsKLSAgICAgICAgYiA9ICgxNypIKzE2KT4+NTsKLSAgICAgICAgYyA9ICgxNypWKzE2KT4+NTsKLSAgICAgICAgZm9yICh5PTA7IHk8ODsgeSsrKQotICAgICAgICB7Ci0gICAgICAgICA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AgICAgICAgICAgICAgICBwRHN0W3kqZHN0U3RlcCt4XSA9IHBTcmNMZWZ0W3kqbGVmdFN0ZXBdOwotICAgICAgICAgICAgfQotICAgICAgICB9Ci0gICAgICAgIGJyZWFrOwotCi0gICAgY2FzZSBPTVhfVkNfMTZYMTZfREM6Ci0gICAgICAgIC8qIFRoaXMgY2FuIGFsd2F5cyBiZSB1c2VkIGV2ZW4gaWYgbm8gYmxvY2tzIGF2YWlsYWJsZSAqLwotICAgICAgICBTdW0gPSAwOwotICAgICAgICBDb3VudCA9IDA7Ci0gICAgICAgIGlmIChhdmFpbGFiaWxpdHkgJiBPTVhfVkNfTEVGVCkKLSAgICAgICAgewotICAgICAgICAgICAgZm9yICh5PTA7IHk8MTY7IHkrKykKLSAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICBTdW0gKz0gcFNyY0xlZnRbeSpsZWZ0U3RlcF07Ci0gICAgICAgICAgICB9Ci0gICAgICAgICAgICBDb3VudCsrOwotICAgICAgICB9Ci0gICAgICAgIGlmIChhdmFpbGFiaWxpdHkgJiBPTVhfVkNfVVBQRVIpCi0gICAgICAgIHsKLSAgICAgICAgICAgIGZvciAoeD0wOyB4PDE2OyB4KyspCi0gICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgU3VtICs9IHBTcmNBYm92ZVt4XTsKLSAgICAgICAgICAgIH0KLSAgICAgICAgICAgIENvdW50Kys7Ci0gICAgICAgIH0KLSAgICAgICAgaWYgKENvdW50PT0wKQotICAgICAgICB7Ci0gICAgICAgICAgICBTdW0gPSAxMjg7Ci0gICAgICAgIH0KLSAgICAgICAgZWxzZSBpZiAoQ291bnQ9PTEpCi0gICAgICAgIHsKLSAgICAgICAgICAgIFN1bSA9IChTdW0gKyA4KSA+PiA0OwotICAgICAgICB9Ci0gICAgICAgIGVsc2UgLyogQ291bnQgPSAyICovCi0gICAgICAgIHsKLSAgICAgICAgICAgIFN1bSA9IChTdW0gKyAxNikgPj4gNTsKLSAgICAgICAgfQotICAgICAgICBmb3IgKHk9MDsgeTwxNjsgeSsrKQotICAgICAgICB7Ci0gICAgICAgICAgICBmb3IgKHg9MDsgeDwxNjsgeCsrKQotICAgICAgICAgICAgewotICAgICAgICAgICAgICAgIHBEc3RbeSpkc3RTdGVwK3hdID0gKE9NWF9VOClTdW07Ci0gICAgICAgICAgICB9Ci0gICAgICAgIH0KLSAgICAgICAgYnJlYWs7Ci0KLSAgICBjYXNlIE9NWF9WQ18xNlgxNl9QTEFORToKLSAgICAgICAgSCA9IDgqKHBTcmNBYm92ZVsxNV0gLSBwU3JjQWJvdmVMZWZ0WzBdKTsKLSAgICAgICAgZm9yICh4PTY7IHg+PTA7IHgtLSkKLSAgICAgICAgewotICAgICAgICAgICAgSCArPSAoeCsxKSoocFNyY0Fib3ZlWzgreF0gLSBwU3JjQWJvdmVbNi14XSk7Ci0gICAgICAgIH0KLSAgICAgICAgViA9IDgqKHBTcmNMZWZ0WzE1KmxlZnRTdGVwXSAtIHBTcmNBYm92ZUxlZnRbMF0pOwotICAgICAgICBmb3IgKHk9NjsgeT49MDsgeS0tKQotICAgICAgICB7Ci0gICAgICAgICAgICBWICs9ICh5KzEpKihwU3JjTGVmdFsoOCt5KSpsZWZ0U3RlcF0gLSBwU3JjTGVmdFsoNi15KSpsZWZ0U3RlcF0pOwotICAgICAgICB9Ci0gICAgICAgIGEgPSAxNioocFNyY0Fib3ZlWzE1XSArIHBTcmNMZWZ0WzE1KmxlZnRTdGVwXSk7Ci0gICAgICAgIGIgPSAoNSpIKzMyKT4+NjsKLSAgICAgICAgYyA9ICg1KlYrMzIpPj42OwotICAgICAgICBmb3IgKHk9MDsgeTwxNjsgeSsrKQotICAgICAgICB7Ci0gICAgICAgICAgICBmb3IgKHg9MDsgeDwxNjsgeCsrKQotICAgICAgICAgICAgewotICAgICAgICAgICAgICAgIFN1bSA9IChhICsgYiooeC03KSArIGMqKHktNykgKyAxNik+PjU7Ci0gICAgICAgICAgICAgICAgcERzdFt5KmRzdFN0Z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0gICAgICAgICAgICBwVG1wWzVdID0gKE9NWF9VOCkoKFU1ICsgMipVNiArIFU3ICsgMik+PjIpOwotICAgICAgICAgICAgcFRtcFs2XSA9IChPTVhfVTgpKChVNiArIDMqVTcgICAgICArIDIpPj4yKTsKLSAgICAgICAgfQotICAgICAgICBlbHNlCi0gICAgICAgIHsKLSAgICAgICAgICAgIHBUbXBbMl0gPSAoT01YX1U4KSgoVTIgKyAzKlUzICAgICAgKyAyKT4+Mik7Ci0gICAgICAgICAgICBwVG1wWzNdID0gVTM7Ci0gICAgICAgICAgICBwVG1wWzRdID0gVTM7Ci0gICAgICAgICAgICBwVG1wWzVdID0gVTM7Ci0gICAgICAgICAgICBwVG1wWzZdID0gVTM7Ci0gICAgICAgIH0KLSAgICAgICAgZm9yICh5PTA7IHk8NDsgeSsrKQotICAgICAgICB7Ci0gICAgICAgICAgICBmb3IgKHg9MDsgeDw0OyB4KyspCi0gICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgcERzdFt5KmRzdFN0ZXAreF0gPSBwVG1wW3greV07Ci0gICAgICAgICAgICB9Ci0gICAgICAgIH0KLSAgICAgICAgYnJlYWs7Ci0KLSAgICBjYXNlIE9NWF9WQ180WDRfRElBR19EUjogICAgICAgIAotICAgICAgICAvKiB4LXkgPSAtMywgLTIsIC0xLCAwLCAxLCAyLCAzICovCi0gICAgICAgIHBUbXBbMF0gPSAoT01YX1U4KSgoTDEgKyAyKkwyICsgTDMgKyAyKT4+Mik7Ci0gICAgICAgIHBUbXBbMV0gPSAoT01YX1U4KSgoTDAgKyAyKkwxICsgTDIgKyAyKT4+Mik7Ci0gICAgICAgIHBUbXBbMl0gPSAoT01YX1U4KSgoVUwgKyAyKkwwICsgTDEgKyAyKT4+Mik7Ci0gICAgICAgIHBUbXBbM10gPSAoT01YX1U4KSgoVTAgKyAyKlVMICsgTDAgKyAyKT4+Mik7Ci0gICAgICAgIHBUbXBbNF0gPSAoT01YX1U4KSgoVTEgKyAyKlUwICsgVUwgKyAyKT4+Mik7Ci0gICAgICAgIHBUbXBbNV0gPSAoT01YX1U4KSgoVTIgKyAyKlUxICsgVTAgKyAyKT4+Mik7Ci0gICAgICAgIHBUbXBbNl0gPSAoT01YX1U4KSgoVTMgKyAyKlUyICsgVTEgKyAyKT4+Mik7Ci0gICAgICAgIGZvciAoeT0wOyB5PDQ7IHkrKykKLSAgICAgICAgewotICAgICAgICAgICAgZm9yICh4PTA7IHg8NDsgeCsrKQotICAgICAgICAgICAgewotICAgICAgICAgICAgICAgIHBEc3RbeSpkc3RTdGVwK3hdID0gcFRtcFszK3gteV07Ci0gICAgICAgICAgICB9Ci0gICAgICAgIH0KLSAgICAgICAgYnJlYWs7Ci0KLSAgICBjYXNlIE9NWF9WQ180WDRfVlI6Ci0gICAgICAgIC8qIHpWUj0yeC15ID0gLTMsIC0yLCAtMSwgMCwgMSwgMiwgMywgNCwgNSwgNgotICAgICAgICAgKiB4LSh5Pj4xKSA9IC0xLCAtMSwgIDAsIDAsIDEsIDEsIDIsIDIsIDMsIDMKLSAgICAgICAgICogeSAgICAgICAgPSAgMywgIDIsICA/LCA/LCA/LCA/LCA/LCA/LCAxLCAwCi0gICAgICAgICAqLwotICAgICAgICBwVG1wWzBdID0gKE9NWF9VOCkoKEwyICsgMipMMSArIEwwICsgMik+PjIpOwotICAgICAgICBwVG1wWzFdID0gKE9NWF9VOCkoKEwxICsgMipMMCArIFVMICsgMik+PjIpOwotICAgICAgICBwVG1wWzJdID0gKE9NWF9VOCkoKEwwICsgMipVTCArIFUwICsgMik+PjIpOwotICAgICAgICBwVG1wWzNdID0gKE9NWF9VOCkoKFVMICsgVTAgKyAxKT4+MSk7Ci0gICAgICAgIHBUbXBbNF0gPSAoT01YX1U4KSgoVUwgKyAyKlUwICsgVTEgKyAyKT4+Mik7Ci0gICAgICAgIHBUbXBbNV0gPSAoT01YX1U4KSgoVTAgKyBVMSArIDEpPj4xKTsKLSAgICAgICAgcFRtcFs2XSA9IChPTVhfVTgpKChVMCArIDIqVTEgKyBVMiArIDIpPj4yKTsKLSAgICAgICAgcFRtcFs3XSA9IChPTVhfVTgpKChVMSArIFUyICsgMSk+PjEpOwotICAgICAgICBwVG1wWzhdID0gKE9NWF9VOCkoKFUxICsgMipVMiArIFUzICsgMik+PjIpOwotICAgICAgICBwVG1wWzldID0gKE9NWF9VOCkoKFUyICsgVTMgKyAxKT4+MSk7Ci0gICAgICAgIGZvciAoeT0wOyB5PDQ7IHkrKykKLSAgICAgICAgewotICAgICAgICAgICAgZm9yICh4PTA7IHg8NDsgeCsrKQotICAgICAgICAgICAgewotICAgICAgICAgICAgICAgIHBEc3RbeSpkc3RTdGVwK3hdID0gcFRtcFszKzIqeC15XTsKLSAgICAgICAgICAgIH0KLSAgICAgICAgfQotICAgICAgICBicmVhazsKLQotICAgIGNhc2UgT01YX1ZDXzRYNF9IRDoKLSAgICAgICAgLyogekhEPTJ5LXggPSAtMyAtMiAtMSAgMCAgMSAgMiAgMyAgNCAgNSAgNgotICAgICAgICAgKiB5LSh4Pj4xKSA9IC0xIC0xICAwICAwICAxICAxICAyICAyICAzICAzCi0gICAgICAgICAqIHggICAgICAgID0gIDMgIDIgICAgICAgICAgICAgICAgICAgIDEgIDAKLSAgICAgICAgICovCi0gICAgICAgIHBUbXBbMF0gPSAoT01YX1U4KSgoVTIgKyAyKlUxICsgVTAgKyAyKT4+Mik7Ci0gICAgICAgIHBUbXBbMV0gPSAoT01YX1U4KSgoVTEgKyAyKlUwICsgVUwgKyAyKT4+Mik7Ci0gICAgICAgIHBUbXBbMl0gPSAoT01YX1U4KSgoVTAgKyAyKlVMICsgTDAgKyAyKT4+Mik7Ci0gICAgICAgIHBUbXBbM10gPSAoT01YX1U4KSgoVUwgKyBMMCArIDEpPj4xKTsKLSAgICAgICAgcFRtcFs0XSA9IChPTVhfVTgpKChVTCArIDIqTDAgKyBMMSArIDIpPj4yKTsKLSAgICAgICAgcFRtcFs1XSA9IChPTVhfVTgpKChMMCArIEwxICsgMSk+PjEpOwotICAgICAgICBwVG1wWzZdID0gKE9NWF9VOCkoKEwwICsgMipMMSArIEwyICsgMik+PjIpOwotICAgICAgICBwVG1wWzddID0gKE9NWF9VOCkoKEwxICsgTDIgKyAxKT4+MSk7Ci0gICAgICAgIHBUbXBbOF0gPSAoT01YX1U4KSgoTDEgKyAyKkwyICsgTDMgKyAyKT4+Mik7Ci0gICAgICAgIHBUbXBbOV0gPSAoT01YX1U4KSgoTDIgKyBMMyArIDEpPj4xKTsKLSAgICAgICAgZm9yICh5PTA7IHk8NDsgeSsrKQotICAgICAgICB7Ci0gICAgICAgICAgICBmb3IgKHg9MDsgeDw0OyB4KyspCi0gICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgcERzdFt5KmRzdFN0ZXAreF0gPSBwVG1wWzMrMip5LXhdOwotICAgICAgICAgICAgfQotICAgICAgICB9Ci0gICAgICAgIGJyZWFrOwotCi0gICAgY2FzZSBPTVhfVkNfNFg0X1ZMOgotICAgICAgICAvKiBOb3RlOiB4Kyh5Pj4xKSA9ICgyKngreSk+PjEKLSAgICAgICAgICogMngreSA9IDAgMSAyIDMgNCA1IDYgNyA4IDkKLSAgICAgICAgICovCi0gICAgICAgIHBUbXBbMF0gPSAoT01YX1U4KSgoVTAgKyBVMSArIDEpPj4xKTsKLSAgICAgICAgcFRtcFsxXSA9IChPTVhfVTgpKChVMCArIDIqVTEgKyBVMiArIDIpPj4yKTsKLSAgICAgICAgcFRtcFsyXSA9IChPTVhfVTgpKChVMSArIFUyICsgMSk+PjEpOwotICAgICAgICBwVG1wWzNdID0gKE9NWF9VOCkoKFUxICsgMipVMiArIFUzICsgMik+PjIpOwotICAgICAgICBwVG1wWzRdID0gKE9NWF9VOCkoKFUyICsgVTMgKyAxKT4+MSk7Ci0gICAgICAgIGlmIChhdmFpbGFiaWxpdHkgJiBPTVhfVkNfVVBQRVJfUklHSFQpCi0gICAgICAgIHsKLSAgICAgICAgICAgIHBUbXBbNV0gPSAoT01YX1U4KSgoVTIgKyAyKlUzICsgVTQgKyAyKT4+Mik7Ci0gICAgICAgICAgICBwVG1wWzZdID0gKE9NWF9VOCkoKFUzICsgVTQgKyAxKT4+MSk7Ci0gICAgICAgICAgICBwVG1wWzddID0gKE9NWF9VOCkoKFUzICsgMipVNCArIFU1ICsgMik+PjIpOwotICAgICAgICAgICAgcFRtcFs4XSA9IChPTVhfVTgpKChVNCArIFU1ICsgMSk+PjEpOwotICAgICAgICAgICAgcFRtcFs5XSA9IChPTVhfVTgpKChVNCArIDIqVTUgKyBVNiArIDIpPj4yKTsKLSAgICAgICAgfQotICAgICAgICBlbHNlCi0gICAgICAgIHsKLSAgICAgICAgICAgIHBUbXBbNV0gPSAoT01YX1U4KSgoVTIgKyAzKlUzICsgMik+PjIpOwotICAgICAgICAgICAgcFRtcFs2XSA9IFUzOwotICAgICAgICAgICAgcFRtcFs3XSA9IFUzOwotICAgICAgICAgICAgcFRtcFs4XSA9IFUzOwotICAgICAgICAgICAgcFRtcFs5XSA9IFUzOwotICAgICAgICB9Ci0gICAgICAgIGZvciAoeT0wOyB5PDQ7IHkrKykKLSAgICAgICAgewotICAgICAgICAgICAgZm9yICh4PTA7IHg8NDsgeCsrKQotICAgICAgICAgICAgewotICAgICAgICAgICAgICAgIHBEc3RbeSpkc3RTdGVwK3hdID0gcFRtcFsyKngreV07Ci0gICAgICAgICAgICB9Ci0gICAgICAgIH0KLSAgICAgICAgYnJlYWs7Ci0KLSAgICBjYXNlIE9NWF9WQ180WDRfSFU6Ci0gICAgICAgIC8qIHpIVSA9IHgrMip5ICovCi0gICAgICAgIHBUbXBbMF0gPSAoT01YX1U4KSgoTDAgKyBMMSArIDEpPj4xKTsKLSAgICAgICAgcFRtcFsxXSA9IChPTVhfVTgpKChMMCArIDIqTDEgKyBMMiArIDIpPj4yKTsKLSAgICAgICAgcFRtcFsyXSA9IChPTVhfVTgpKChMMSArIEwyICsgMSk+PjEpOwotICAgICAgICBwVG1wWzNdID0gKE9NWF9VOCkoKEwxICsgMipM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MsIHBTcmNSZWYwLCBwU3JjUmVmMSwgaVNyY1N0ZXAsIAotICAgICAgICBpUmVmU3RlcDAsIGlSZWZTdGVwMSwgcERzdFNBRCwgaUhlaWdodCwgMTYpOwotfQotCi0vKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKLSAqICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgRU5EIE9GIEZJTEUKLSAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLQpkaWZmIC0tZ2l0IGEvbWVkaWEvbGlic3RhZ2VmcmlnaHQvY29kZWNzL29uMi9oMjY0ZGVjL29teGRsL3JlZmVyZW5jZS92Yy9tNHAxMC9zcmMvb214VkNNNFAxMF9TQURRdWFyXzR4LmMgYi9tZWRpYS9saWJzdGFnZWZyaWdodC9jb2RlY3Mvb24yL2gyNjRkZWMvb214ZGwvcmVmZXJlbmNlL3ZjL200cDEwL3NyYy9vbXhWQ000UDEwX1NBRFF1YXJfNHguYwpkZWxldGVkIGZpbGUgbW9kZSAxMDA2NDQKaW5kZXggNGIzMzBiYS4uMDAwMDAwMAotLS0gYS9tZWRpYS9saWJzdGFnZWZyaWdodC9jb2RlY3Mvb24yL2gyNjRkZWMvb214ZGwvcmVmZXJlbmNlL3ZjL200cDEwL3NyYy9vbXhWQ000UDEwX1NBRFF1YXJfNHguYworKysgL2Rldi9udWxsCkBAIC0xLDg1ICswLDAgQEAKLS8qKgotICogCi0gKiBGaWxlIE5hbWU6ICBvbXhWQ000UDEwX1NBRFF1YXJfNHguYwotICogT3Blbk1BWCBETDogdjEuMC4yCi0gKiBSZXZpc2lvbjogICA5NjQxCi0gKiBEYXRlOiAgICAgICBUaHVyc2RheSwgRmVicnVhcnkgNywgMjAwOAotICogCi0gKiAoYykgQ29weXJpZ2h0IDIwMDctMjAwOCBBUk0gT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ybVJldEFyZ0VycklmKChpU3RlcFJlZiA9PSAwKSB8fCAoaVN0ZXBSZWYgJiAzKSwgT01YX1N0c19CYWRBcmdFcnIpCi0KLSAgICByZXR1cm4gYXJtVkNDT01NX1NBRCAKLSAgICAgICAgKHBTcmNPcmcsIGlTdGVwT3JnLCBwU3JjUmVmLCBpU3RlcFJlZiwgcERzdFNBRCwgaUhlaWdodCwgNCk7Ci19Ci0KLS8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgotICogICAgICAgICAgICAgICAgICAgICAgICAgICAgICBFTkQgT0YgRklMRQotICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotCmRpZmYgLS1naXQgYS9tZWRpYS9saWJzdGFnZWZyaWdodC9jb2RlY3Mvb24yL2gyNjRkZWMvb214ZGwvcmVmZXJlbmNlL3ZjL200cDEwL3NyYy9vbXhWQ000UDEwX1NBVERfNHg0LmMgYi9tZWRpYS9saWJzdGFnZWZyaWdodC9jb2RlY3Mvb24yL2gyNjRkZWMvb214ZGwvcmVmZXJlbmNlL3ZjL200cDEwL3NyYy9vbXhWQ000UDEwX1NBVERfNHg0LmMKZGVsZXRlZCBmaWxlIG1vZGUgMTAwNjQ0CmluZGV4IGE5MWFlNjYuLjAwMDAwMDAKLS0tIGEvbWVkaWEvbGlic3RhZ2VmcmlnaHQvY29kZWNzL29uMi9oMjY0ZGVjL29teGRsL3JlZmVyZW5jZS92Yy9tNHAxMC9zcmMvb214VkNNNFAxMF9TQVREXzR4NC5jCisrKyAvZGV2L251bGwKQEAgLTEsMTMyICswLDAgQEAKLS8qKgotICogCi0gKiBGaWxlIE5hbWU6ICBvbXhWQ000UDEwX1NBVERfNHg0LmMKLSAqIE9wZW5NQVggREw6IHYxLjAuMgotICogUmV2aXNpb246ICAgOTY0MQotICogRGF0ZTog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ICsgbTFbMV1baV07Ci0gICAgICAgIG0yWzFdW2ldID0gbTFbMl1baV0gKyBtMVszXVtpXTsKLSAgICAgICAgbTJbMl1baV0gPSBtMVsyXVtpXSAtIG0xWzNdW2ldOwotICAgICAgICBtMlszXVtpXSA9IG0xWzBdW2ldIC0gbTFbMV1baV07Ci0gICAgfQotICAgIAotICAgIC8qIGNhbGN1bGF0ZSBTQUQgZm9yIFRyYW5zZm9ybWVkIGNvZWZmaWNpZW50cyAqLwotICAgIGZvciAoaiA9IDA7IGogPCA0OyBqKyspCi0gICAgewotICAgICAgICBmb3IgKGkgPSAwOyBpIDwgNDsgaSsrKQotICAgICAgICB7Ci0gICAgICAgICAgICBTQVREICs9IGFybUFicyhtMiBbal1baV0pOwotICAgICAgICB9Ci0gICAgfQotICAgICAgICAKLSAgICAqcERzdFNBRCA9IChTQVREICsgMSkgLyAyOwotCi0gICAgcmV0dXJuIE9NWF9TdHNfTm9FcnI7Ci19Ci0KLS8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgotICogICAgICAgICAgICAgICAgICAgICAgICAgICAgICBFTkQgT0YgRklMRQotICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwotCmRpZmYgLS1naXQgYS9tZWRpYS9saWJzdGFnZWZyaWdodC9jb2RlY3Mvb24yL2gyNjRkZWMvb214ZGwvcmVmZXJlbmNlL3ZjL200cDEwL3NyYy9vbXhWQ000UDEwX1N1YkFuZFRyYW5zZm9ybVFEUVJlc2lkdWFsLmMgYi9tZWRpYS9saWJzdGFnZWZyaWdodC9jb2RlY3Mvb24yL2gyNjRkZWMvb214ZGwvcmVmZXJlbmNlL3ZjL200cDEwL3NyYy9vbXhWQ000UDEwX1N1YkFuZFRyYW5zZm9ybVFEUVJlc2lkdWFsLmMKZGVsZXRlZCBmaWxlI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YXRyaXhbUVBtb2RdWzBdOwotICAgICAgICBpZiAoblRocmVzaFNBRCA8IFRocmVzaERDKQotICAgICAgICB7Ci0gICAgICAgICAgICAvKiBTZXQgYmxvY2sgdG8gemVybyAqLwotICAgICAgICAgICAgaWYgKHBEQ0NvZWZmICE9IE5VTEwpCi0gICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgKnBEQ0NvZWZmID0gMDsKLSAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgZm9yIChqID0gMDsgaiA8IDQ7IGorKykKLSAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICBmb3IgKGkgPSAwOyBpIDwgNDsgaSsrKQotICAgICAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAgICAgcERzdFF1YW50Q29lZmYgWzQgKiBqICsgaV0gPSAwOwotICAgICAgICAgICAgICAgICAgICBpZiAocERzdERlUXVhbnRDb2VmZiAhPSBOVUxMKQotICAgICAgICAgICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgICAgICAgICBwRHN0RGVRdWFudENvZWZmIFs0ICogaiArIGldID0gMDsgICAgCi0gICAgICAgICAgICAgICAgICAgIH0gICAgICAgICAgICAgICAgICAgIAotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgaWYgKHBOdW1Db2VmZiAhPSBOVUxMKQotICAgICAgICAgICAgewotICAgICAgICAgICAgICAgICpwTnVtQ29lZmYgPSAwOwotICAgICAgICAgICAgfQotICAgICAgICAgICAgcmV0dXJuIE9NWF9TdHNfTm9FcnI7Ci0gICAgICAgIH0KLSAgICB9Ci0KLQotICAgLyogQ2FsY3VsYXRlIGRpZmZlcmVuY2UgKi8KLSAgICBmb3IgKGogPSAwOyBqIDwgNDsgaisrKQotICAgIHsKLSAgICAgICAgZm9yIChpID0gMDsgaSA8IDQ7IGkrKykKLSAgICAgICAgewotICAgICAgICAgICAgQnVmIFtqICogNCArIGldID0gCi0gICAgICAgICAgICAgICAgcFNy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XJvIENvZWZmcyAqLwotICAgIGlmIChwTnVtQ29lZmYgIT0gTlVMTCkKLSAgICB7Ci0gICAgICAgICpwTnVtQ29lZmYgPSBOdW1Db2VmZjsKLSAgICB9Ci0gICAgCi0gICAgLyogUmVzaWR1YWwgSW52IFRyYW5zZm9ybSAqLwotICAgIGlmIChwRHN0RGVRdWFudENvZWZmICE9IE5VTEwpCi0gICAgeyAgICAKLSAgICAgICAgLyogUmUgU2NhbGUgKi8KLSAgICAgICAgZm9yIChqID0gMDsgaiA8IDQ7IGorKykKLSAgICAgICAgewotICAgICAgICAgICAgZm9yIChpID0gMDsgaSA8IDQ7IGkrKykKLSAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICBtIFtqICogNCArIGldICA9IEJ1ZiBbaiAqIDQgKyBpXSAqICgxIDw8IFFQcGVyKSAqCi0gICAgICAgICAgICAgICAgICAgIGFybVZDTTRQMTBfVk1hdHJpeFtRUG1vZF1bYXJtVkNNNFAxMF9Qb3NUb1ZDb2w0eDRbaiAqIDQgKyBpXV07Ci0gICAgICAgICAgICB9Ci0gICAgICAgIH0KLSAgICAgICAgYXJtVkNNNFAxMF9UcmFuc2Zvcm1SZXNpZHVhbDR4NCAocERzdERlUXVhbnRDb2VmZiwgbSk7ICAgICAgICAKLSAgICB9Ci0gICAgICAgIAotICAgIHJldHVybiBPTVhfU3RzX05vRXJyOwotfQotCi0vKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKLSAqICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgRU5EIE9GIEZJTEUKLSAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLQpkaWZmIC0tZ2l0IGEvbWVkaWEvbGlic3RhZ2VmcmlnaHQvY29kZWNzL29uMi9oMjY0ZGVjL29teGRsL3JlZmVyZW5jZS92Yy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CBTaGlmdDsKLSAgICAgICAgICAgIHBEc3RbaV0gPSAoT01YX1MxNilWYWx1ZTsKLSAgICAgICAgfQotICAgIH0KLSAgICBlbHNlCi0gICAgewotICAgICAgICBTaGlmdCA9IC1TaGlmdDs7Ci0gICAgICAgIFJvdW5kID0gMTw8KFNoaWZ0LTEpOwotCi0gICAgICAgIGZvciAoaT0wOyBpPDE2OyBpKyspCi0gICAgICAgIHsKLSAgICAgICAgICAgIFZhbHVlID0gKHBEc3RbaV0gKiBTY2FsZSArIFJvdW5kKSA+PiBTaGlmdDsKLSAgICAgICAgICAgIHBEc3RbaV0gPSAoT01YX1MxNilWYWx1ZTsKLSAgICAgICAgfQotICAgIH0KLX0KLQotIAotCi0vKgotICogRGVzY3JpcHRpb246Ci0gKiBJbnZlcnNlIFRyYW5zZm9ybSBEQyA0eDQgQ29lZmZpY2llbnRzCi0gKi8KLXN0YXRpYyB2b2lkIEludlRyYW5zZm9ybURDNHg0KE9NWF9TMTYqIHBEYXRhKQotewotICAgIGludCBpOwotCi0gICAgLyogVHJhbnNmb3JtIHJvd3MgKi8KLSAgICBmb3IgKGk9MDsgaTwxNjsgaSs9NCkKLSAgICB7Ci0gICAgICAgIGludCBjMCA9IHBEYXRhW2krMF07Ci0gICAgICAgIGludCBjMSA9IHBEYXRhW2krMV07Ci0gICAgICAgIGludCBjMiA9IHBEYXRhW2krMl07Ci0gICAgICAgIGludCBjMyA9IHBEYXRhW2krM107Ci0gICAgICAgIHBEYXRhW2krMF0gPSAoT01YX1MxNikoYzArYzErYzIrYzMpOwotICAgICAgICBwRGF0YVtpKzFdID0gKE9NWF9TMTYpKGMwK2MxLWMyLWMzKTsKLSAgICAgICAgcERhdGFbaSsyXSA9IChPTVhfUzE2KShjMC1jMS1jMitjMyk7Ci0gICAgICAgIHBEYXRhW2krM10gPSAoT01YX1MxNikoYzAtYzErYzItYzMpOwotICAgIH0KLQotICAgIC8qIFRyYW5zZm9ybSBjb2x1bW5zICovCi0gICAgZm9yICh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gLyAoYkludHJhID8gMyA6IDYpOyAvKiAzLT5JTlRSQSwgNi0+SU5URVIgKi8KLQotICAgIC8qIFNjYWxpbmcgKi8KLSAgICBmb3IgKGogPSAwOyBqIDwgMjsgaisrKQotICAgIHsKLSAgICAgICAgZm9yIChpID0gMDsgaSA8IDI7IGkrKykKLSAgICAgICAgewotICAgICAgICAgICAgVmFsdWUgPSAoYXJtQWJzKG1bal1baV0pICogTUYwMCArIFR3b19mKSA+PiBRYml0c1BsdXNPbmU7Ci0gICAgICAgICAgICBwU3JjRHN0W2ogKiAyICsgaV0gPSAoT01YX1MxNikoKG1bal1baV0gPCAwKSA/IC1WYWx1ZSA6IFZhbHVlKTsKLSAgICAgICAgfQotICAgIH0KLQotICAgIHJldHVybiBPTVhfU3RzX05vRXJyOwotfQotCi0vKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKLSAqICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgRU5EIE9GIEZJTEUKLSAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLQpkaWZmIC0tZ2l0IGEvbWVkaWEvbGlic3RhZ2VmcmlnaHQvY29kZWNzL29uMi9oMjY0ZGVjL29teGRsL3JlZmVyZW5jZS92Yy9tNHAxMC9zcmMvb214VkNNNFAxMF9UcmFuc2Zvcm1RdWFudF9MdW1hREMuYyBiL21lZGlhL2xpYnN0YWdlZnJpZ2h0L2NvZGVjcy9vbjIvaDI2NGRlYy9vbXhkbC9yZWZlcmVuY2UvdmMvbTRwMTAvc3JjL29teFZDTTRQMTBfVHJhbnNmb3JtUXVhbnRfTHVtYURDLmMKZGVsZXRlZCBmaWxlIG1vZGUgMTAwNjQ0CmluZGV4IDJjY2Y3ZjAuLjAwMDAwMDAKLS0tIGEvbWVkaWEvbGlic3RhZ2VmcmlnaHQvY29k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bMV07IC8qIGEtYitjLWQgKi8KLQotICAgIH0KLQotICAgIC8qIFZlcnRpY2FsICovCi0gICAgZm9yIChpID0gMDsgaSA8IDQ7IGkrKykKLSAgICB7Ci0gICAgICAgIG0xWzBdW2ldID0gbTJbMF1baV0gKyBtMlsyXVtpXTsKLSAgICAgICAgbTFbMV1baV0gPSBtMlsxXVtpXSArIG0yWzNdW2ldOwotICAgICAgICBtMVsyXVtpXSA9IG0yWzBdW2ldIC0gbTJbMl1baV07Ci0gICAgICAgIG0xWzNdW2ldID0gbTJbMV1baV0gLSBtMlszXVtpXTsKLQotICAgICAgICBtMlswXVtpXSA9IG0xWzBdW2ldICsgbTFbMV1baV07Ci0gICAgICAgIG0yWzFdW2ldID0gbTFbMl1baV0gKyBtMVszXVtpXTsKLSAgICAgICAgbTJbMl1baV0gPSBtMVsyXVtpXSAtIG0xWzNdW2ldOwotICAgICAgICBtMlszXVtpXSA9IG0xWzBdW2ldIC0gbTFbMV1baV07Ci0gICAgfQotCi0gICAgCi0gICAgLyogUXVhbnRpemF0aW9uICovCi0gICAgUWJpdHNQbHVzT25lID0gQVJNX000UDEwX1FfT0ZGU0VUICsgMSArIChpUVAgLyA2KTsgLypmbG9vciAoUVAvNikqLwotICAgIFR3b19mID0gKDEgPDwgUWJpdHNQbHVzT25lKSAvIDM7IC8qIDMtPklOVFJBLCA2LT5JTlRFUiAqLwotICAgIE1GID0gYXJtVkNNNFAxMF9NRk1hdHJpeCBbaVFQICUgNl1bMF07Ci0KLSAgICAvKiBTY2FsaW5nICovCi0gICAgZm9yIChqID0gMDsgaiA8IDQ7IGorKykKLSAgICB7Ci0gICAgICAgIGZvciAoaSA9IDA7IGkgPCA0OyBpKyspCi0gICAgICAgIHsKLSAgICAgICAgICAgIFZhbHVlID0gKGFybUFicygobTJbal1baV0vKiArIDEqLykgLyAyKSAqIE1GICsgVHdvX2YpID4+IFFiaXRzUGx1c09uZTsKLSAgICAgICAgICAgIHBTcmNEc3RbaiAqIDQgKyBp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RoZSBwcmVkaWN0aW9uIGRpcmVjdGlvbiB3aGljaCB0YWtlcyBvbmUKLSAqICAgICAgICAgICAgICAgICAgICAgICAgICBvZiB0aGUgZm9sbG93aW5nIHZhbHVlczoKLSAqICAgICAgICAgICAgICAgICAgICAgICAgICBPTVhfVkNfSE9SSVpPTlRBTCAgICBwcmVkaWN0IGhvcml6b250YWxseQotICogICAgICAgICAgICAgICAgICAgICAgICAgIE9NWF9WQ19WRVJUSUNBTCAgICAgIHByZWRpY3QgdmVydGljYWxseQotICogW2luXSBBQ1ByZWRGbGFnICBhIGZsYWcgaW5kaWNhdGluZyBpZiBBQyBwcmVkaWN0aW9uIHNob3VsZCBiZQotICogICAgICAgICAgICAgICAgICAgICAgICAgIHBlcmZvcm1lZC4gSXQgaXMgZXF1YWwgdG8gYWNfcHJlZF9mbGFnIGluIHRoZSBiaXQKLSAqICAgICAgICAgICAgICAgICAgICAgICAgICBzdHJlYW0gc3ludGF4IG9mIE1QRUctNAotICogW2luXSB2aWRlb0NvbXAgICB2aWRlbyBjb21wb25lbnQgdHlwZSAobHVtaW5hbmNlLCBjaHJvbWluYW5jZSBvcgotICogICAgICAgICAgICAgICAgICAgICAgICAgIGFscGhhKSBvZiB0aGUgY3VycmVudCBibG9jawotICogW2luXSBmbGFnICAgICAgICBUaGlzIGZsYWcgZGVmaW5lcyB0aGUgaWYgb25lIHdhbnRzIHRvIHVzZSB0aGlzIGZ1bmN0aW9ucyB0bwotICogICAgICAgICAgICAgICAgICBjYWxjdWxhdGUgUFFGIChzZXQgMSwgcHJlZGljdGlvbikgb3IgUUYgKHNldCAwLCByZWNvbnN0cnVjdGlvbikKLSAqIFtvdXRdICAgIHBQcmVBQ1ByZWRpY3QgICBwb2ludGVyIHRvIHRoZSBwcmVkaWN0ZWQgY29lZmZpY2llbnRzIGJ1ZmZlci4KLSAqICAgICAgICAgICAgICAgICAgICAgICAgICBGaWxsZWQgT05MWSBpZiBpdCBpcyBub3QgTlVMTAotICogW291dF0gICA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YXZvaWQgc29tZSBjb21waWxlcnMgZ2l2aW5nIGEgd2FybmluZy4gKi8KLSAgICBkY1NjYWxlcj0wOwotICAgIAotICAgIC8qIENhbGN1bGF0ZSB0aGUgREMgc2NhbGVyIHZhbHVlICovCi0gICAgaWYgKHZpZGVvQ29tcCA9PSBPTVhfVkNfTFVNSU5BTkNFKQotICAgIHsKLSAgICAgICAgaWYgKGN1clFQID49IDEgJiYgY3VyUVAgPD0gNCkKLSAgICAgICAgewotICAgICAgICAgICAgZGNTY2FsZXIgPSA4OwotICAgICAgICB9Ci0gICAgICAgIGVsc2UgaWYgKGN1clFQID49IDUgJiYgY3VyUVAgPD0gOCkKLSAgICAgICAgewotICAgICAgICAgICAgZGNTY2FsZXIgPSAyICogY3VyUVA7Ci0gICAgICAgIH0KLSAgICAgICAgZWxzZSBpZiAoY3VyUVAgPj0gOSAmJiBjdXJRUCA8PSAyNCkKLSAgICAgICAgewotICAgICAgICAgICAgZGNTY2FsZXIgPSBjdXJRUCArIDg7Ci0gICAgICAgIH0KLSAgICAgICAgZWxzZQotICAgICAgICB7Ci0gICAgICAgICAgICBkY1NjYWxlciA9ICgyICogY3VyUVApIC0gMTY7Ci0gICAgICAgIH0KLSAgICB9Ci0gICAgZWxzZSBpZiAodmlkZW9Db21wID09IE9NWF9WQ19DSFJPTUlOQU5DRSkKLSAgICB7Ci0gICAgICAgIGlmIChjdXJRUCA+PSAxICYmIGN1clFQIDw9IDQpCi0gICAgICAgIHsKLSAgICAgICAgICAgIGRjU2NhbGVyID0gODsKLSAgICAgICAgfQotICAgICAgICBlbHNlIGlmIChjdXJRUCA+PSA1ICYmIGN1clFQIDw9IDI0KQotICAgICAgICB7Ci0gICAgICAgICAgICBkY1NjYWxlciA9IChjdXJRUCArIDEzKS8yOwotICAgICAgICB9Ci0gICAgICAgIGVsc2UKLSAgICAgICAgewotICAgICAgICAgICAgZGNTY2FsZXIgPSBjdXJRUCAtIDY7Ci0gICAgICAgIH0KLSAgICB9Ci0KLS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wICgtMjA0OCwgMjA0NywgcFNyY0RzdFswXSk7Ci0KLSAgICAgICAgLyogQ2FsIGFuZCBzdG9yZSBGWzBdWzBdIGludG8gdGhlIGNvbCBidWZmZXIgKi8KLSAgICAgICAgKnBQcmVkQnVmQ29sID0gcFNyY0RzdFswXSAqIGRjU2NhbGVyOwotICAgIH0KLQotCi0gICAgaWYgKEFDUHJlZEZsYWcgPT0gMSkKLSAgICB7Ci0gICAgICAgIGlmIChwcmVkRGlyID09IE9NWF9WQ19WRVJUSUNBTCkKLSAgICAgICAgewotICAgICAgICAgICAgZm9yIChpID0gMTsgaSA8IDg7IGkrKykKLSAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICB0ZW1wUHJlZCA9IGFybUludERpdkF3YXlGcm9tWmVybyBcCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAocFByZWRCdWZSb3dbaV0gKiBwcmVkUVAsIGN1clFQKTsKLSAgICAgICAgICAgICAgICBpZiAoZmxhZykKLSAgICAgICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgICAgIC8qIFVwZGF0aW5nIFFGIHRvIHRoZSByb3cgYnVmZiAqLwotICAgICAgICAgICAgICAgICAgICBwUHJlZEJ1ZlJvd1tpXSA9IHBTcmNEc3RbaV07Ci0gICAgICAgICAgICAgICAgICAgIC8qUFFGWFt2XVswXSA9IFFGWFt2XVswXSAtIChRRkFbdl1bMF0gKiBRUEEpIC8vIFFQWCAqLwotICAgICAgICAgICAgICAgICAgICBwU3JjRHN0W2ldIC09IHRlbXBQcmVkOwotICAgICAgICAgICAgICAgICAgICAvKiBTdW0gb2YgYWJzb2x1dGUgdmFsdWVzIG9mIEFDIHByZWRpY3Rpb24gZXJyb3IsIHRoaXMgY2FuCi0gICAgICAgICAgICAgICAgICAgIGJlIHVzZWQgYXMgYSByZWZlcmVuY2UgdG8gY2hvb3NlIHdoZXRoZXIgdG8gdXNlCi0gICAgICAgICAgICAgICAgICAgIEFDIHByZWRpY3Rpb24gKi8KLSAgICAgICAgICAgICAgICAgICAgKnBTdW1FcnIgKz0gYXJtQWJzKHBTcmNEc3RbaV0pOwotICAgICAgICAgICAgICAgICAgICAvKiBwUHJlQUNQcmVkaWN0WzF+N10gc3RvcmUgdGhlIGVycm9yIHNpZ25hbAotICAgICAgICAgICAgICAgICAgICBhZnRlciBBQyBwcmVkaWN0aW9uICovCi0gICAgICAgICAgICAgICAgICAgIHBQcmVBQ1ByZWRpY3RbaV0gPSBwU3JjRHN0W2ldOwotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICBlbHNlCi0gICAgICAgICAgICAgICAgewotICAgICAgICAgICAgICAgICAgICAvKlFGWFt2XVswXSA9IFBRRlhbdl1bMF0gKyAoUUZBW3ZdWzBdICogUVBBKSAvLyBRUFggKi8KLSAgICAgICAgICAgICAgICAgICAgcFNyY0RzdFtpXSArPSB0ZW1wUHJlZDsKLSAgICAgICAgICAgICAgICAgICAgCi0gICAgICAgICAgICAgICAgICAgIC8qIFNhdHVyYXRlICovCi0gICAgICAgICAgICAgICAgICAgIHBTcmNEc3RbaV0gPSBhcm1DbGlwICgtMjA0OCwgMjA0NywgcFNyY0RzdFtpXSk7Ci0gICAgICAgICAgICAgICAgICAgIAotICAgICAgICAgICAgICAgICAgICAvKiBVcGRhdGluZyBRRiB0byB0aGUgcm93IGJ1ZmYgKi8KLSAgICAgICAgICAgICAgICAgICAgcFByZWRCdWZSb3dbaV0gPSBwU3JjRHN0W2ldOwotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgIH0KLSAgICAgICAgfQotICAgICAgICBlbHNlCi0gICAgICAgIHsKLSAgICAgICAgICAgIGZvciAoaSA9IDg7IGkgPCA2NDsgaSArPSA4KQotICAgICAgICAgICAgewotICAgICAgICAgICAgICAgIHRlbXBQcmVkID0gYXJtSW50RGl2QXdheUZyb21aZXJvIFwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChwUHJlZEJ1ZkNvbFtpPj4zXSAqIHByZWRRUCwgY3VyUVApOwotICAgICAgICAgICAgICAgIGlmIChmbGFnKQotICAgICAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAgICAgLyogVXBkYXRpbmcgUUYgdG8gY29sIGJ1ZmYgKi8KLSAgICAgICAgICAgICAgICAgICAgcFByZWRCdWZDb2xbaT4+M10gPSBwU3JjRHN0W2ldOwotICAgICAgICAgICAgICAgICAgICAvKlBRRlhbMF1bdV0gPSBRRlhbMF1bdV0gLSAoUUZBWzBdW3VdICogUVBBKSAvLyBRUFggKi8KLSAgICAgICAgICAgICAgICAgICAgcFNyY0RzdFtpXSAtPSB0ZW1wUHJlZDsKLSAgICAgICAgICAgICAgICAgICAgLyogU3VtIG9mIGFic29sdXRlIHZhbHVlcyBvZiBBQyBwcmVkaWN0aW9uIGVycm9yLCB0aGlzIGNhbgotICAgICAgICAgICAgICAgICAgICBiZSB1c2VkIGFzIGEgcmVmZXJlbmNlIHRvIGNob29zZSB3aGV0aGVyIHRvIHVzZSBBQwotICAgICAgICAgICAgICAgICAgICBwcmVkaWN0aW9uICovCi0gICAgICAgICAgICAgICAgICAgICpwU3VtRXJyICs9IGFybUFicyhwU3JjRHN0W2ldKTsKLSAgICAgICAgICAgICAgICAgICAgLyogcFByZUFDUHJlZGljdFsxfjddIHN0b3JlIHRoZSBlcnJvciBzaWduYWwKLSAgICAgICAgICAgICAgICAgICAgYWZ0ZXIgQUMgcHJlZGljdGlvbiAqLwotICAgICAgICAgICAgICAgICAgICBwUHJlQUNQcmVkaWN0W2k+PjNdID0gcFNyY0RzdFtpXTsKLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgZWxzZQotICAgICAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAgICAgLypRRlhbMF1bdV0gPSBQUUZYWzBdW3VdICsgKFFGQVswXVt1XSAqIFFQQSkgLy8gUVBYICovCi0gICAgICAgICAgICAgICAgICAgIHBTcmNEc3RbaV0gKz0gdGVtcFByZWQ7Ci0gICAgIC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mcm9tWCA9IDA7Ci0gICAgfQotCi0gICAgaWYgKChwU2VhcmNoUG9pbnRSZWZQb3MtPnggKyBCbG9ja1NpemUgKyAxKSA+IChwUmVmUmVjdC0+eCArIHBSZWZSZWN0LT53aWR0aCkpCi0gICAgewotICAgICAgICB0b1ggICA9IDA7Ci0gICAgfQotCi0gICAgaWYgKChwU2VhcmNoUG9pbnRSZWZQb3MtPnkgLSAxKSA8IHBSZWZSZWN0LT55KQotICAgIHsKLSAgICAgICAgZnJvbVkgPSAwOwotICAgIH0KLQotICAgIGlmICgocFNlYXJjaFBvaW50UmVmUG9zLT55ICsgQmxvY2tTaXplICsgMSkgPiAocFJlZlJlY3QtPnkgKyBwUmVmUmVjdC0+aGVpZ2h0KSkKLSAgICB7Ci0gICAgICAgIHRvWSAgID0gMDsKLSAgICB9Ci0KLSAgICAvKiBMb29waW5nIG9uIHktIGF4aXMgKi8KLSAgICBmb3IgKHkgPSAtZnJvbVk7IHkgPD0gdG9ZOyB5KyspCi0gICAgewotICAgICAgICAvKiBMb29waW5nIG9uIHgtIGF4aXMgKi8KLSAgICAgICAgZm9yICh4ID0gLWZyb21YOyB4IDw9IHRvWDsgeCsrKQotICAgICAgICB7Ci0gICAgICAgICAgICAvKiBjaGVjayBmb3IgaW50ZWdlciBwb3NpdGlvbiAqLwotICAgICAgICAgICAgaWYgKCB4ID09IDAgJiYgeSA9PSAwKQotICAgICAgICAgICAgewotICAgICAgICAgICAgICAgIGNvbnRpbnVlOwotICAgICAgICAgICAgfQotICAgICAgICAgICAgLyogUG9zaXRpb25pbmcgdGhlIHBvaW50ZXIgKi8KLSAgICAgICAgICAgIHBUZW1wU3JjUmVmQnVmID0gcFNyY1JlZkJ1ZiArIChyZWZXaWR0aCAqIChwU3JjRHN0TVYtPmR5LzIpKQotICAgICAgICAgICAgICAgICAgICAgICAgICAgICArIChwU3JjRHN0TVYtPmR4LzIpOwotCi0gICAgICAgICAgICAvKiBJbnRlcnBvbGF0ZSB0aGUgcGl4ZWwgYW5kIGNhbGN1bGF0ZSB0aGUgU0FEKi8KLSAgICAgICAgICAgIGZvciAob3V0ZXIgPSAwLCBjb3VudCA9IDAsIGNhbmRTQUQgPSAwLGluZGV4ID0gMDsKLSAgICAgICAgICAgICAgICAgb3V0ZXIgPCBCbG9ja1NpemU7Ci0gICAgICAgICAgICAgICAgIG91dGVyKyssIGluZGV4ICs9IHJlZldpZHRoIC0gQmxvY2tTaXplKQotICAgICAgICAgICAgewotICAgICAgICAgICAgICAgIGZvciAoaW5uZXIgPSAwOyBpbm5lciA8IEJsb2NrU2l6ZTsgaW5uZXIrKywgY291bnQrKyxpbmRleCsrKQotICAgICAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAgICAgdGVtcFBlbCA9ICgKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcFRlbXBTcmNSZWZCdWZbaW5kZXhdCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICsgcFRlbXBTcmNSZWZCdWZbaW5kZXggKyB4XSAqIGFybUFicyh4KQotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICArIHBUZW1wU3JjUmVmQnVmW2luZGV4ICsgcmVmV2lkdGggKiB5XSAqIGFybUFicyh5KQotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICArIHBUZW1wU3JjUmVmQnVmW2luZGV4ICsgcmVmV2lkdGggKiB5ICsgeF0KLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqIGFybUFicyh4KnkpCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICsgYXJtQWJzICh4KSArIGFybUFicyAoeSkgLSBybmRWYWwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICkgLyAoMiAqIChhcm1BYnMgKHgpICsgYXJtQWJzICh5KSkpOwotICAgICAgICAgICAgICAgICAgICBjYW5kU0FEICs9IGFybUFicyAodGVtcFBlbCAtIHBTcmNDdXJyQnVmW2NvdW50XSk7Ci0gICAgICAgICAgICAgICA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AgLyogTG9vcGluZyBvbiB5LSBheGlzICovCi0gICAgZm9yICh5ID0gLWZyb21ZOyB5IDw9IHRvWTsgeSsrKQotICAgIHsKLQotICAgICAgICAvKiBMb29waW5nIG9uIHgtIGF4aXMgKi8KLSAgICAgICAgZm9yICh4ID0gLWZyb21YOyB4IDw9IHRvWDsgeCsrKQotICAgICAgICB7Ci0gICAgICAgICAgICAvKiBQb3NpdGlvbmluZyB0aGUgcG9pbnRlciAqLwotICAgICAgICAgICAgcFRlbXBTcmNSZWZCdWYgPSBwU3JjUmVmQnVmICsgKHJlZldpZHRoICogeSkgKyB4OwotCi0gICAgICAgICAgICAvKiBDYWxjdWxhdGUgdGhlIFNBRCAqLwotICAgICAgICAgICAgZm9yIChvdXRlciA9IDAsIGNvdW50ID0gMCwgaW5kZXggPSAwLCBjYW5kU0FEID0gMDsKLSAgICAgICAgICAgICAgICAgb3V0ZXIgPCBCbG9ja1NpemU7Ci0gICAgICAgICAgICAgICAgIG91dGVyKyssIGluZGV4ICs9IHJlZldpZHRoIC0gQmxvY2tTaXplKQotICAgICAgICAgICAgewotICAgICAgICAgICAgICAgIGZvciAoaW5uZXIgPSAwOyBpbm5lciA8IEJsb2NrU2l6ZTsgaW5uZXIrKywgY291bnQrKywgaW5kZXgrKykKLSAgICAgICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgICAgIGNhbmRTQUQgKz0gYXJtQWJzIChwVGVtcFNyY1JlZkJ1ZltpbmRleF0gLSBwU3JjQ3VyckJ1Zltjb3VudF0pOyAgICAgICAgICAgICAgICAgICAgCi0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgfQotCi0gICAgICAgICAgICAvKiBSZXN1bHQgY2FsY3VsYXRpb25zICovCi0gICAgICAgICAgICBpZiAoYXJtVkNNNFAyX0NvbXBhcmVNViAoeCwgeSwgY2FuZFNBRCwgcERzdE1WLT5keC8yLCBwRHN0TVYtPmR5LzIsIG1pblNBRCkpCi0gICAgICAgICAgICB7Ci0gICAgIC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kZvck11bHRpcGxlRW50cmllcywKLSAgICAgT01YX0lOVCBzaG9ydFZpZGVvSGVhZGVyLAotICAgICBjb25zdCBPTVhfVTggICpwUnVuSW5kZXhUYWJsZQotKQotewotICAgIE9NWF9VOCBlc2NhcGUgPSAwLCBmTW9kZSA9IDAsIGVudHJpZXM7Ci0gICAgCi0gICAgbGV2ZWwgPSBhcm1BYnMgKGxldmVsKTsKLSAgICBsZXZlbFBsdXMgPSBhcm1BYnMgKGxldmVsUGx1cyk7Ci0gICAgCi0gICAgLyogQ2hlY2sgZm9yIGEgdmFsaWQgZW50cnkgd2l0aCBydW4sIGxldmVsIGFuZCBMYXN0IGNvbWJpbmF0aW9uIAotICAgICAgIE1vZGUgMCBjaGVjayAqLwotICAgIGlmIChydW4gPD0gbWF4U3RvcmVSdW4pCi0gICAgewotICAgICAgICBlbnRyaWVzID0gcFJ1bkluZGV4VGFibGVbcnVuICsgMV0KLSAgICAgICAgICAgICAgICAgIC0gcFJ1bkluZGV4VGFibGVbcnVuXTsKLSAgICAgICAgaWYgKHJ1biA+IG1heFJ1bkZvck11bHRpcGxlRW50cmllcykKLSAgICAgICAgewotICAgICAgICAgICAgZW50cmllcyA9IDE7Ci0gICAgICAgIH0KLSAgICAgICAgaWYgKGxldmVsID4gZW50cmllcykKLSAgICAgICAgewotICAgICAgICAgICAgZXNjYXBlID0gMTsKLSAgICAgICAgfQotICAgIH0KLSAgICBlbHNlCi0gICAgewotICAgICAgICBlc2NhcGUgPSAxOwotICAgIH0KLSAgICBpZihlc2NhcGUgJiYgc2hvcnRWaWRlb0hlYWRlcikKLSAgICB7Ci0gICAgICAgIGVzY2FwZSA9IDA7Ci0gICAgICAgIGZNb2RlID0gNDsKLSAgICB9Ci0gICAgLyogQ2hlY2sgZm9yIGEgdmFsaWQgZW50cnkgd2l0aCBydW4sIGxldmVsUGx1cyBhbmQgTGFzdCBjb21iaW5hdGlvbiAKLSAgICAgICBNb2RlIDEgY2hlY2sgKi8gICAgCi0gICAgaWYgKGVzY2FwZSkKLSAgICB7Ci0gICAgICAgIGVzY2FwZSA9IDA7Ci0gICAgICAgIGZNb2RlID0gMTsKLSAgICAgICAgaWYgKHJ1biA8PSBtYXhTdG9yZVJ1bikKLSAgICAgICAgewotICAgICAgICAgICAgZW50cmllcyA9IHBSdW5JbmRleFRhYmxlW3J1biArIDFdCi0gICAgICAgICAgICAgICAgICAgICAgLSBwUnVuSW5kZXhUYWJsZVtydW5dOwotICAgICAgICAgICAgaWYgKHJ1biA+IG1heFJ1bkZvck11bHRpcGxlRW50cmllcykKLSAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICBlbnRyaWVzID0gMTsKLSAgICAgICAgICAgIH0KLSAgICAgICAgICAgIGlmIChsZXZlbFBsdXMgPiBlbnRyaWVzKQotICAgICAgICAgICAgewotICAgICAgICAgICAgICAgIGVzY2FwZSA9IDE7Ci0gICAgICAgICAgICB9Ci0gICAgICAgIH0KLSAgICAgICAgZWxzZQotICAgICAgICB7Ci0gICAgICAgICAgICBlc2NhcGUgPSAxOwotICAgICAgICB9Ci0gICAgfQotICAgIAotICAgIC8qIENoZWNrIGZvciBhIHZhbGlkIGVudHJ5IHdpdGggcnVuUGx1cywgbGV2ZWwgYW5kIExhc3QgY29tYmluYXRpb24gCi0gICAgICAgTW9kZSAyIGNoZWNrICovICAgIAotICAgIGlmIChlc2NhcGUpCi0gICAgewotICAgICAgICBlc2NhcGUgPSAwOwotICAgICAgICBmTW9kZSA9IDI7Ci0gICAgICAgIGlmIChydW5QbHVzIDw9IG1heFN0b3JlUnVuKQotICAgICAgICB7Ci0gICAgICAgICAgICBlbnRyaWVzID0gcFJ1bkluZGV4VGFibGVbcnVuUGx1cyArIDFdCi0gICAgICAgICAgICAgICAgICAgICAgLSBwUnVuSW5kZXhUYWJsZVtydW5QbHVzXTsKLSAgICAgICAgICAgIGlmIChydW5QbHVzID4gbWF4UnVuRm9yTXVsdGlwbGVFbnRyaWVzKQotICAgICAgICAgICAgewotICAgICAgIC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ICAgICAgICAwLjM1MzU1MzM5MDU5MzI3Mzc5MCwgCi0gICAgICAgICAgICAgICAgMC4yNzc3ODUxMTY1MDk4MDExNDAsIAotICAgICAgICAgICAgICAgIDAuMTkxMzQxNzE2MTgyNTQ0OTIwLCAKLSAgICAgICAgICAgICAgICAwLjA5NzU0NTE2MTAwODA2NDE1MiAKLSAgICAgICAgfSwKLSAgICAgICAgewotICAgICAgICAgICAgICAgIDAuMzUzNTUzMzkwNTkzMjczNzMwLCAKLSAgICAgICAgICAgICAgICAwLjQxNTczNDgwNjE1MTI3MjYyMCwgCi0gICAgICAgICAgICAgICAgMC4xOTEzNDE3MTYxODI1NDQ5MjAsIAotICAgICAgICAgICAgICAgIC0wLjA5NzU0NTE2MTAwODA2NDA5NiwgCi0gICAgICAgICAgICAgICAgLTAuMzUzNTUzMzkwNTkzMjczNzMwLCAKLSAgICAgICAgICAgICAgICAtMC40OTAzOTI2NDAyMDE2MTUyMjAsIAotICAgICAgICAgICAgICAgIC0wLjQ2MTkzOTc2NjI1NTY0MzQyMCwgCi0gICAgICAgICAgICAgICAgLTAuMjc3Nzg1MTE2NTA5ODAxMDkwCi0gICAgICAgIH0sCi0gICAgICAgIHsKLSAgICAgICAgICAgICAgICAwLjM1MzU1MzM5MDU5MzI3MzczMCwgCi0gICAgICAgICAgICAgICAgMC4yNzc3ODUxMTY1MDk4MDExNDAsIAotICAgICAgICAgICAgICAgIC0wLjE5MTM0MTcxNjE4MjU0NDg2MCwgCi0gICAgICAgICAgICAgICAgLTAuNDkwMzkyNjQwMjAxNjE1MjIwLCAKLSAgICAgICAgICAgICAgICAtMC4zNTM1NTMzOTA1OTMyNzM4NDAsIAotICAgICAgICAgICAgICAgIDAuMDk3NTQ1MTYxMDA4MDY0MTM4LCAKLSAgICAgICAgICAgICAgICAwLjQ2MTkzOTc2NjI1NTY0MzI2MCwgCi0gICAgICAgICAgICAgICAgMC40MTU3MzQ4MDYxNTEyNzI3MzAgCi0gICAgICAgIH0sCi0gICAgICAgIHsKLSAgICAgICAgICAgICAgICAwLjM1MzU1MzM5MDU5MzI3MzczMCwgCi0gICAgICAgICAgICAgICAgMC4wOTc1NDUxNjEwMDgwNjQxNTIsIAotICAgICAgICAgICAgICAgIC0wLjQ2MTkzOTc2NjI1NTY0MzM3MCwgCi0gICAgICAgICAgICAgICAgLTAuMjc3Nzg1MTE2NTA5ODAxMDkwLCAKLSAgICAgICAgICAgICAgICAwLjM1MzU1MzM5MDU5MzI3MzY4MCwgCi0gICAgICAgICAgICAgICAgMC40MTU3MzQ4MDYxNTEyNzI3MzAsIAotICAgICAgICAgICAgICAgIC0wLjE5MTM0MTcxNjE4MjU0NDkyMCwgCi0gICAgICAgICAgICAgICAgLTAuNDkwMzkyNjQwMjAxNjE1MzMwCi0gICAgICAgIH0sCi0gICAgICAgIHsKLSAgICAgICAgICAgICAgICAwLjM1MzU1MzM5MDU5MzI3MzczMCwgCi0gICAgICAgICAgICAgICAgLTAuMDk3NTQ1MTYxMDA4MDY0MDk2LCAKLSAgICAgICAgICAgICAgICAtMC40NjE5Mzk3NjYyNTU2NDM0MjAsIAotICAgICAgICAgICAgICAgIDAuMjc3Nzg1MTE2NTA5ODAwOTIwLCAKLSAgICAgICAgICAgICAgICAwLjM1MzU1MzM5MDU5MzI3Mzg0MCwgCi0gICAgICAgICAgICAgICAgLTAuNDE1NzM0ODA2MTUxMjcyNjIwLCAKLSAgICAgICAgICAgICAgICAtMC4xOTEzNDE3MTYxODI1NDUyODAsIAotICAgICAgICAgICAgICAgIDAuNDkwMzkyNjQwMjAxNjE1MjIwIAotICAgICAgICB9LAotICAgICAgICB7Ci0gICAgICAgICAgICAgICAgMC4zNTM1NTMzOTA1OTMyNzM3MzAsIAotICAgICAgICAgICAgICAgIC0wLjI3Nzc4NTExNjUwOTgwMDk4MCwgCi0gICAgICAgICAgICAgICAgLTAuMTkxMzQxNzE2MTgyNTQ1MTcwLCAKLSAgICAgICAgICAgICAgICAwLjQ5MDM5MjY0MDIwMTYxNTIyMCwgCi0gICAgICAgICAgICAgICAgLTAuMzUzNTUzMzkwNTkzMjczMzQwLCAKLSAgICAgICAgICAgICAgICAtMC4wOTc1NDUxNjEwMDgwNjQwMTMsIAotICAgICAgICAgICAgICAgIDAuNDYxOTM5NzY2MjU1NjQzMzcwLCAKLSAgICAgICAgICAgICAgICAtMC40MTU3MzQ4MDYxNTEyNzI1MTAKLSAgICAgICAgfSwKLSAgICAgICAgewotICAgICAgICAgICAgICAgIDAuMzUzNTUzMzkwNTkzMjczNzMwLCAKLSAgICAgICAgICAgICAgICAtMC40MTU3MzQ4MDYxNTEyNzI2NzAsIAotICAgICAgICAgICAgICAgIDAuMTkxMzQxNzE2MTgyNTQ1MDAwLCAKLSAgICAgICAgICAgICAgICAwLjA5NzU0NTE2MTAwODA2NDM4OCwgCi0gICAgICAgICAgICAgICAgLTAuMzUzNTUzMzkwNTkzMjczNjIwLCAKLSAgICAgICAgICAgICAgICAwLjQ5MDM5MjY0MDIwMTYxNTMzMCwgCi0gICAgICAgICAgICAgICAgLTAuNDYxOTM5NzY2MjU1NjQzMjAwLCAKLSAgICAgICAgICAgICAgICAwLjI3Nzc4NTExNjUwOTgwMDc2MCAKLSAgICAgICAgfSwKLSAgICAgICAgewotICAgICAgICAgICAgICAgIDAuMzUzNTUzMzkwNTkzMjczNzMwLCAKLSAgICAgICAgICAgICAgICAtMC40OTAzOTI2NDAyMDE2MTUyMjAsIAotICAgICAgICAgICAgICAgIDAuNDYxOTM5NzY2MjU1NjQzMjYwLCAKLSAgICAgICAgICAgICAgICAtMC40MTU3MzQ4MDYxNTEyNzI2MjAsIAotICAgICAgICAgICAgICAgIDAuMzUzNTUzMzkwNTkzMjczMjkwLCAKLSAgICAgICAgICAgICAgICAtMC4yNzc3ODUxMTY1MDk4MDA3NjAsIAotICAgICAgICAgICAgICAgIDAuMTkxMzQxNzE2MTgyNTQ0NzgwLCAKLSAgICAgICAgICAgICAgICAtMC4wOTc1NDUxNjEwMDgwNjQyNzcKLS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ZyBzY2FuIHBhdHRlcm4uIEl0IHRha2VzIG9uZSBvZiB0aGUKLSAqICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZm9sbG93aW5nIHZhbHVlczoKLSAqICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgT01YX1ZDX05PTkUgIEFDIHByZWRpY3Rpb24gbm90IHVzZWQ7Ci0gKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwZXJmb3JtIGNsYXNzaWNhbCB6aWd6YWcgc2NhbjsKLSAqICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgT01YX1ZDX0hPUklaT05UQUwgICAgSG9yaXpvbnRhbCBwcmVkaWN0aW9uOwotICogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwZXJmb3JtIGFsdGVybmF0ZS12ZXJ0aWNhbAotICogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB6aWd6YWcgc2NhbjsKLSAqICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgT01YX1ZDX1ZFUlRJQ0FMICAgICAgVmVydGljYWwgcHJlZGljdGlvbjsKLSAqICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdGh1cyBwZXJmb3JtCi0gKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGFsdGVybmF0ZS1ob3Jpem9udGFsCi0gKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHppZ3phZyBzY2FuLgotICogW2luXSBzdGFydCAgICAgICAgICAgc3RhcnQgaW5kaWNhdGVzIHdoZXRoZXIgdGhlIGVuY29kaW5nIGJlZ2lucyB3aXRoIDB0aCBlbGVtZW50Ci0gKiAgICAgICAgICAgICAgICAgICAgICBvciAxc3QuCi0gKiBbb3V0XSAgICBwcEJpdFN0cmVhbSAgICAgKnBwQml0U3RyZWFtIGlzIHVwZGF0ZWQgYWZ0ZXIgdGhlIGJsb2NrIGlzCi0gKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRlY29kZWQsIHNvIHRoYXQgaXQgcG9pbnRzIHRvIHRoZSBjdXJyZW50IGJ5dGUKLSAqICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaW4gdGhlIGJpdCBzdHJlYW0gYnVmZmVyCi0gKiBbb3V0XSAgICBwQml0T2Zmc2V0ICAgICAgKnBCaXRPZmZzZXQgaXMgdXBkYXRlZCBzbyB0aGF0IGl0IHBvaW50cyB0byB0aGUKLSAqICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY3VycmVudCBiaXQgcG9zaXRpb24gaW4gdGhlIGJ5dGUgcG9pbnRlZCBieQotICogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqcHBCaXRTdHJlYW0KLSAqIFtvdXRdICAgIHBEc3QgICAgICAgICAgICBwb2ludGVyIHRvIHRoZSBjb2VmZmljaWVudCBidWZmZXIgb2YgY3VycmVudAotICogICAgICAgICAgICAgICAgICAgICAgICAgICAgICBibG9jay4gU2hvdWxkIGJlIDMyLWJpdCBhbGlnbmVkCi0gKgotICogUmV0dXJuIFZhbHVlOgotICogU3RhbmRhcmQgT01YUmVzdWx0IHJlc3VsdC4gU2VlIGVudW1lcmF0aW9uIGZvciBwb3NzaWJsZSByZXN1bHQgY29kZXMuCi0gKgotICovCi0KLU9NWFJlc3VsdCBhcm1WQ000UDJfRGVjb2RlVkxDWmlnemFnX0ludHJhKAotICAgICBjb25zdCBPTVhfVTggKiogcHBCaXRTdHJlYW0sCi0gICAgIE9NWF9JTlQgKiBwQml0T2Zmc2V0LAotICAgICBPTVhfUzE2ICogcERzdCwKLSAgICAgT01YX1U4IHByZWREaXIsCi0gICAgIE9NWF9JTlQgc2hvcnRWaWRlb0hlYWRlciwKLSAgICAgT01YX1U4ICBzdGFydAotKQotewotICAgIE9NWF9VOCAg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AyX2FWZXJ0aWNhbFppZ3phZ1NjYW47Ci0gICAgICAgICAgICBicmVhazsKLSAgICAgICAgfQotCi0gICAgICAgIGNhc2UgT01YX1ZDX1ZFUlRJQ0FMOgotICAgICAgICB7Ci0gICAgICAgICAgICBwWmlnemFnVGFibGUgPSBhcm1WQ000UDJfYUhvcml6b250YWxaaWd6YWdTY2FuOwotICAgICAgICAgICAgYnJlYWs7Ci0gICAgICAgIH0KLSAgICB9Ci0gICAgCi0gICAgZXJyb3JDb2RlID0gYXJtVkNNNFAyX0dldFZMQ0JpdHMgKAotICAgICAgICAgICAgICBwcEJpdFN0cmVhbSwKLSAgICAgICAgICAgICAgcEJpdE9mZnNldCwKLQkJCSAgcERzdCwKLQkJCSAgc2hvcnRWaWRlb0hlYWRlciwKLQkJCSAgc3RhcnQsCi0JCQkgICZsYXN0LAotCQkJICAxMCwKLQkJCSAgNjIsCi0JCQkgICA3LAotCQkJICAyMSwKLSAgICAgICAgICAgICAgYXJtVkNNNFAyX0ludHJhTDBSdW5JZHgsCi0gICAgICAgICAgICAgIGFybVZDTTRQMl9JbnRyYVZsY0wwLAotCQkJICBhcm1WQ000UDJfSW50cmFMMVJ1bklkeCwKLSAgICAgICAgICAgICAgYXJtVkNNNFAyX0ludHJhVmxjTDEsCi0gICAgICAgICAgICAgIGFybVZDTTRQMl9JbnRyYUwwTE1BWCwKLSAgICAgICAgICAgICAgYXJtVkNNNFAyX0ludHJhTDFMTUFYLAotICAgICAgICAgICAgICBhcm1WQ000UDJfSW50cmFMMFJNQVgsCi0gICAgICAgICAgICAgIGFybVZDTTRQMl9JbnRyYUwxUk1BWCwKLSAgICAgICAgICAgICAgcFppZ3phZ1RhYmxlICk7Ci0gICAgYXJtUmV0RGF0YUVycklmKChlcnJvckNvZGUgIT0gT01YX1N0c19Ob0VyciksIGVycm9yQ29kZSk7Ci0gICAgCi0gICAgaWYgKGxhc3QgPT0gMCkKLSAgICB7Ci0gICAgICAgIHJldHVybiBPTVhfU3RzX0V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gICAgICAgICAgICB0aGUgemlnemFnIHNjYW4gcGF0dGVybi4gVGhpcyB0YWtlcyBvbmUgb2YgdGhlCi0gKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZvbGxvd2luZyB2YWx1ZXM6Ci0gKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIE9NWF9WQ19OT05FICAgICAgICAgIEFDIHByZWRpY3Rpb24gbm90IHVzZWQuCi0gKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFBlcmZvcm1zIGNsYXNzaWNhbCB6aWd6YWcKLSAqICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2Nhbi4KLSAqICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgT01YX1ZDX0hPUklaT05UQUwgICAgSG9yaXpvbnRhbCBwcmVkaWN0aW9uLgotICogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBQZXJmb3JtcyBhbHRlcm5hdGUtdmVydGljYWwKLSAqICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgemlnemFnIHNjYW4uCi0gKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIE9NWF9WQ19WRVJUSUNBTCAgICAgIFZlcnRpY2FsIHByZWRpY3Rpb24uCi0gKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFBlcmZvcm1zIGFsdGVybmF0ZS1ob3Jpem9udGFsCi0gKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHppZ3phZyBzY2FuLgotICogW2luXSBwYXR0ZXJuICAgICAgICAgYmxvY2sgcGF0dGVybiB3aGljaCBpcyB1c2VkIHRvIGRlY2lkZSB3aGV0aGVyCi0gKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRoaXM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gIGNhc2UgT01YX1ZDX0hPUklaT05UQUw6Ci0gICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgcFppZ3phZ1RhYmxlID0gYXJtVkNNNFAyX2FWZXJ0aWNhbFppZ3phZ1NjYW47Ci0gICAgICAgICAgICAgICAgYnJlYWs7Ci0gICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgIGNhc2UgT01YX1ZDX1ZFUlRJQ0FMOgotICAgICAgICAgICAgewotICAgICAgICAgICAgICAgIHBaaWd6YWdUYWJsZSA9IGFybVZDTTRQMl9hSG9yaXpvbnRhbFppZ3phZ1NjYW47Ci0gICAgICAgICAgICAgICAgYnJlYWs7Ci0gICAgICAgICAgICB9Ci0gICAgICAgIH0KLSAgICAgICAgCi0gICAgICAgIGVycm9yQ29kZSA9IGFybVZDTTRQMl9QdXRWTENCaXRzICgKLSAgICAgICAgICAgICAgcHBCaXRTdHJlYW0sCi0gICAgICAgICAgICAgIHBCaXRPZmZzZXQsCi0gICAgICAgICAgICAgIHBRRGN0QmxrQ29lZiwKLSAgICAgICAgICAgICAgc2hvcnRWaWRlb0hlYWRlciwKLSAgICAgICAgICAgICAgc3RhcnQsCi0gICAgICAgICAgICAgIDE0LAotICAgICAgICAgICAgICAyMCwKLSAgICAgICAgICAgICAgOSwKLSAgICAgICAgICAgICAgNiwKLSAgICAgICAgICAgICAgYXJtVkNNNFAyX0ludHJhTDBSdW5JZHgsCi0gICAgICAgICAgICAgIGFybVZDTTRQMl9JbnRyYVZsY0wwLAotCQkJICBhcm1WQ000UDJfSW50cmFMMVJ1bklkeCwKLSAgICAgICAgICAgICAgYXJtVkNNNFAyX0ludHJhVmxjTDEsCi0gICAgICAgICAgICAgIGFybVZDTTRQMl9JbnRyYUwwTE1BWCwKLSAgICAgICAgICAgICAgYXJtVkNNNFAyX0ludHJhTDFMTUFYLAotICAgICAgICAgICAgICBhcm1WQ000UDJfSW50cmFMMFJNQVgsCi0gICAgICAgICAgICAgIGFybVZDTTRQMl9JbnR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AgICAgICAgICBDYWxjdWxhdGVkIGFzIHJ1blBsdXMgPSBydW4gLSAoUk1BWCArIDEpICAKLSAqIFtpbl0gIGxldmVsUGx1cyAgICAgICAgICBDYWxjdWxhdGVkIGFzIAotICogICAgICAgICAgICAgICAgICAgICAgICAgIGxldmVsUGx1cyA9IHNpZ24obGV2ZWwpKlthYnMobGV2ZWwpIC0gTE1BWF0KLSAqIFtpbl0gIGZNb2RlICAgICAgICAgICAgICBGbGFnIGluZGljYXRpbmcgdGhlIGVzY2FwZSBtb2RlcwotICogW2luXSAgbGFzdCAgICAgICAgICAgICAgIHN0YXR1cyBvZiB0aGUgbGFzdCBmbGFnCi0gKiBbaW5dICBtYXhSdW5Gb3JNdWx0aXBsZUVudHJpZXMgCi0gKiAgICAgICAgICAgICAgICAgICAgICAgICAgVGhlIHJ1biB2YWx1ZSBhZnRlciB3aGljaCBsZXZlbCB3aWxsIGJlIGVxdWFsIHRvIDE6IAotICogICAgICAgICAgICAgICAgICAgICAgICAgIChjb25zaWRlcmluZyBsYXN0IGFuZCBpbnRlci9pbnRyYSBzdGF0dXMpCi0gKiBbaW5dICBwUnVuSW5kZXhUYWJsZSAgICAgUnVuIEluZGV4IHRhYmxlIGRlZmluZWQgaW4KLSAqICAgICAgICAgICAgICAgICAgICAgICAgICBhcm1WQ000UDJfSHVmZl9UYWJsZXNfVkxDLmgKLSAqIFtpbl0gIHBWbGNUYWJsZSAgICAgICAgICBWTEMgdGFibGUgZGVmaW5lZCBpbiBhcm1WQ000UDJfSHVmZl9UYWJsZXNfVkxDLmgKLSAqIFtvdXRdIHBwQml0U3RyZWFtCQkqcHBCaXRTdHJlYW0gaXMgdXBkYXRlZCBhZnRlciB0aGUgYmxvY2sgaXMgZW5jb2RlZAotICogICAgICAgICAgICAgICAgICAgICAgICAgIHNvIHRoYXQgaXQgcG9pbnRzIHRvIHRoZSBjdXJyZW50IGJ5dGUgaW4gdGhlIGJpdAotICogICAgICAgICAgICAgICAgICAgICAgICAgIHN0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kaW5nIGJlZ2lucyB3aXRoIAotICogICAgICAgICAgICAgICAgICAgICAgMHRoIGVsZW1lbnQgb3IgMXN0LgotICogW2luL291dF0gcExhc3QgICAgICAgcG9pbnRlciB0byBsYXN0IHN0YXR1cyBmbGFnCi0gKiBbaW5dIHJ1bkJlZ2luU2luZ2xlTGV2ZWxFbnRyaWVzTDAgICAgICBUaGUgcnVuIHZhbHVlIGZyb20gd2hpY2ggbGV2ZWwgCi0gKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB3aWxsIGJlIGVxdWFsIHRvIDE6IGxhc3QgPT0gMAotICogW2luXSBJbmRleEJlZ2luU2luZ2xlTGV2ZWxFbnRyaWVzTDAgICAgQXJyYXkgaW5kZXggaW4gdGhlIFZMQyB0YWJsZSAKLSAqICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBvaW50aW5nIHRvIHRoZSAgCi0gKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBydW5CZWdpblNpbmdsZUxldmVsRW50cmllc0wwIAotICogW2luXSBydW5CZWdpblNpbmdsZUxldmVsRW50cmllc0wxICAgICAgVGhlIHJ1biB2YWx1ZSBmcm9tIHdoaWNoIGxldmVsIAotICogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgd2lsbCBiZSBlcXVhbCB0byAxOiBsYXN0ID09IDEKLSAqIFtpbl0gSW5kZXhCZWdpblNpbmdsZUxldmVsRW50cmllc0wxICAgIEFycmF5IGluZGV4IGluIHRoZSBWTEMgdGFibGUgCi0gKiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwb2ludGluZyB0byB0aGUgIAotICogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcnVuQmVnaW5TaW5nbGVMZXZlbEVudHJpZXNMMCAKLSAqIFtpbl0gcFJ1bkluZGV4VGFibGVMMCAgICBSdW4gSW5kZXggdGFibGUgZGVmaW5lZC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ludGVyIHRvIHRoZSBjb2VmZmljaWVudCBidWZmZXIgb2YgY3VycmVudAotICoJCQkJCQkJYmxvY2suIFNob3VsZCBiZSAzMi1iaXQgYWxpZ25lZAotICoKLSAqIFJldHVybiBWYWx1ZToKLSAqIFN0YW5kYXJkIE9NWFJlc3VsdCByZXN1bHQuIFNlZSBlbnVtZXJhdGlvbiBmb3IgcG9zc2libGUgcmVzdWx0IGNvZGVzLgotICoKLSAqLwotCi1PTVhSZXN1bHQgYXJtVkNNNFAyX0dldFZMQ0JpdHMgKAotICAgICAgICAgICAgICBjb25zdCBPTVhfVTggKipwcEJpdFN0cmVhbSwKLSAgICAgICAgICAgICAgT01YX0lOVCAqIHBCaXRPZmZzZXQsCi0JCQkgIE9NWF9TMTYgKiBwRHN0LAotCQkJICBPTVhfSU5UIHNob3J0VmlkZW9IZWFkZXIsCi0JCQkgIE9NWF9VOCAgICBzdGFydCwJCQkgIAotCQkJICBPTVhfVTggICogcExhc3QsCi0JCQkgIE9NWF9VOCAgICBydW5CZWdpblNpbmdsZUxldmVsRW50cmllc0wwLAotCQkJICBPTVhfVTggICAgbWF4SW5kZXhGb3JNdWx0aXBsZUVudHJpZXNMMCwKLQkJCSAgT01YX1U4ICAgIG1heFJ1bkZvck11bHRpcGxlRW50cmllc0wxLAotCQkJICBPTVhfVTggICAgbWF4SW5kZXhGb3JNdWx0aXBsZUVudHJpZXNMMSwKLSAgICAgICAgICAgICAgY29uc3QgT01YX1U4ICAqIHBSdW5JbmRleFRhYmxlTDAsCi0gICAgICAgICAgICAgIGNvbnN0IEFSTV9WTEMzMiAqcFZsY1RhYmxlTDAsCi0JCQkgIGNvbnN0IE9NWF9VOCAgKiBwUnVuSW5kZXhUYWJsZUwxLAotICAgICAgICAgICAgICBjb25zdCBBUk1fVkxDMzIgKnBWbGNUYWJsZUwxLAotICAgICAgICAgICAgICBjb25zdCBPTVhfVTggICogcExNQVhUYWJsZUwwLAotICAgICAgICAgICAgICBjb25zdCBPTVhfVTggIC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AgICAgezksICAgIDMzfSwKLSAgICAgICAgezEwLCAgIDMzfSwKLSAgICAgICAgezEwLCAgIDMyfSwKLSAgICAgICAgezEwLCAgIDE1fSwKLSAgICAgICAgezEwLCAgIDE0fSwKLSAgICAgICAgezExLCAgICA3fSwKLSAgICAgICAgezExLCAgICA2fSwKLSAgICAgICAgezExLCAgIDMyfSwKLSAgICAgICAgezExLCAgIDMzfSwKLSAgICAgICAgezEyLCAgIDgwfSwKLSAgICAgICAgezEyLCAgIDgxfSwKLSAgICAgICAgezEyLCAgIDgyfSwKLSAgICAgICAgezQsICAgIDE0fSwKLSAgICAgICAgezYsICAgIDIwfSwKLSAgICAgICAgezcsICAgIDIyfSwKLSAgICAgICAgezgsICAgIDI4fSwKLSAgICAgICAgezksICAgIDMyfSwKLSAgICAgICAgezksICAgIDMxfSwKLSAgICAgICAgezEwLCAgIDEzfSwKLSAgICAgICAgezExLCAgIDM0fSwKLSAgICAgICAgezEyLCAgIDgzfSwKLSAgICAgICAgezEyLCAgIDg1fSwKLSAgICAgICAgezUsICAgIDExfSwKLSAgICAgICAgezcsICAgIDIxfSwKLSAgICAgICAgezksICAgIDMwfSwKLSAgICAgICAgezEwLCAgIDEyfSwKLSAgICAgICAgezEyLCAgIDg2fSwKLSAgICAgICAgezYsICAgIDE3fSwKLSAgICAgICAgezgsICAgIDI3fSwKLSAgICAgICAgezksICAgIDI5fSwKLSAgICAgICAgezEwLCAgIDExfSwKLSAgICAgICAgezYsICAgIDE2fSwKLSAgICAgICAgezksICAgIDM0fSwKLSAgICAgICAgezEwLCAgIDEwfSwKLSAgICAgICAgezYsICAgIDEzfSwKLSAgICAgICAgezksICAgIDI4fSwKLSAgICAgICAgezEwLCAgICA4fSwKLSAgICAgICAgezcsICAgIDE4fSwKLSAgICAgICAgezksICAgIDI3fSwKLSAgICAgICAgezEyLCAgIDg0fSwKLSAgICAgICAgezcsICAgIDIwfSwKLSAgICAgICAgezksICAgIDI2fSwKLSAgICAgICAgezEyLCAgIDg3fSwKLSAgICAgICAgezgsICAgIDI1fSwKLSAgICAgICAgezEwLCAgICA5fSwKLSAgICAgICAgezgsICAgIDI0fSwKLSAgICAgICAgezExLCAgIDM1fSwKLSAgICAgICAgezgsICAgIDIzfSwKLSAgICAgICAgezksICAgIDI1fSwKLSAgICAgICAgezksICAgIDI0fSwKLSAgICAgICAgezEwLCAgICA3fSwKLSAgICAgICAgezEyLCAgIDg4fSwKLSAgICAgICAgezAsICAgICAwfQotfTsKLQotLyogCi0qICBGb3IgSW50cmEKLSogIGxhc3QgPSAxIAotKi8KLQotY29uc3QgT01YX1U4IGFybVZDTTRQMl9JbnRyYUwxUnVuSWR4WzhdID0gCi17Ci0gICAgMCwgIDgsIDExLCAxMywgMTUsIDE3LCAxOSwgMjEKLX07Ci0KLS8qIEVudHJ5IGRlZmluZWQgZm9yIGFsbCB2YWx1ZXMgCi0qICBmb3IgcnVuID0gMCB0byAyMAotKiAgKiAgTm90ZTogdGhlIGxhc3QgZW50cnkgaXMgdG8gdGVybWluYXRlIHdoaWxlIGRlY29kaW5nCi0qLwotY29uc3QgQVJNX1ZMQzMyIGFybVZDTTRQMl9JbnRyYVZsY0wxWzM2XSA9IAotewotICAgICAgICB7NCwgICAgIDd9LAotICAgICAgICB7NiwgICAgMTJ9LAotICAgICAgICB7OCwgICAgMjJ9LAotICAgICAgICB7OSwgICAgMjN9LAotICAgICAgICB7MTAsICAgIDZ9LAotICAgICAgICB7MTEsICAgIDV9LAotICAgICAgICB7MTEsICAgIDR9LAotICAgICAgICB7MTIsICAgODl9LAotICAgICAgICB7NiwgICAgMTV9LAotICAgICAgICB7OSwgICAgMjJ9LAotICAgICAgICB7MTAsICAgIDV9LAotICAgICAgICB7NiwgICAgMTR9LAotICAgICAgICB7MTAsICAgIDR9LAotICAgICAgICB7NywgICAgMTd9LAotICAgICAgICB7MTEsICAgMzZ9LAotICAgICAgICB7NywgICAgMTZ9LAotICAgICAgICB7MTEsICAgMzd9LAotICAgICAgICB7NywgICAgMTl9LAotICAgICAgICB7MTIsICAgOTB9LAotICAgICAgICB7OCwgICAgMjF9LAotICAgICAgICB7MTIsICAgOTF9LAotICAgICAgICB7OCwgICAgMjB9LAotICAgICAgICB7OCwgICAgMTl9LAotICAgICAgICB7OCwgICAgMjZ9LAotICAgICAgICB7OSwgICAgMjF9LAotICAgICAgICB7OSwgICAgMjB9LAotICAgICAgICB7OSwgICAgMTl9LAotICAgICAgICB7OSwgICAgMTh9LAotICAgICAgICB7OSwgICAgMTd9LAotICAgICAgICB7MTEsICAgMzh9LAotICAgICAgICB7MTEsICAgMzl9LAotICAgICAgICB7MTIsICAgOTJ9LAotICAgICAgICB7MTIsICAgOTN9LAotICAgICAgICB7MTIsICAgOTR9LAotICAgICAgICB7MTIsICAgOTV9LCAgCi0gICAgICAgIHswLCAgICAgMH0KLX07Ci0KLS8qIExNQVggdGFibGUgZm9yIEludHJhIChMYXN0ID09IDApKi8KLWNvbnN0IE9NWF9VOCBhcm1WQ000UDJfSW50cmFMMExNQVhbMTVdID0gCi17Ci0gICAyNywgMTAsICA1LCAgNCwgIDMsICAzLCAgMywgIAotICAgIDMsICAyLCAgMiwgIDEsICAxLCAgMSwgIDEsICAxCi19OwotCi0vKiBMTUFYIHRhYmxlIGZvciBJbnRyYSAoTGFzdCA9PSAxKSovCi1jb25zdCBPTVhfVTggYXJtVkNNNFAyX0ludHJhTDFMTUFYWzIxXSA9IAotewotICAgIDgsICAzLCAgMiwgIDIsICAyLCAgMiwgIDIsICAxLCAKLQkxLCAgMSwgIDEsICAxLCAgMSwgIDEsICAxLCAgMSwKLQkxLCAgMSwgIDEsICAxLCAgMQotfTsKLQotLyogUk1BWCB0YWJsZSBmb3IgSW50cmEgKExhc3QgPT0gMCkKLSAgIExldmVsIC0gMSBJbmRleGVkIAotKi8KLWNvbnN0IE9NWF9VOCBhcm1WQ000UDJfSW50cmFMMFJNQVhbMjddID0KLXsKLSAgIDE0LCAgOSwgIDcsICAzLCAgMiwgIDEsCTEsICAKLSAgICAxLCAgMSwgIDEsICAwLCAgMCwgIDAsIAkwLCAgCi0gICAgMCwgIDAsICAwLCAgMCwgIDAsICAwLCAgMCwgIAotICAgIDAsICAwLCAgMCwgIDAsICAwLCAgMAotfTsKLQotLyogUk1BWCB0YWJsZSBmb3IgSW50cmEgKExhc3QgPT0gMSkKLSAgIExldmVsIC0gMSBJbmRleGVkIAotKi8KLWNvbnN0IE9NWF9VOCBhcm1WQ000UDJfSW50cmFMMVJNQVhbOF0gPQotewotICAgMjAsICA2LCAgMSwgIDAsICAwLCAgMCwgIDAsICAwCi19OwotCi0vKiAKLSogIEZvciBJbnRlcgotKiAgbGFzdCA9IDAgCi0qLwotY29uc3QgT01YX1U4IGFybVZDTTRQMl9JbnRlckwwUnVuSWR4WzEyXSA9IAoteyAKLSAgICAgMCwgIDEyLCAgMTgsICAyMiwgIDI1LCAgMjgsICAKLSAgICAzMSwgIDM0LCAgMzYsICAzOCwgIDQwLCAgNDIKLX07Ci0KLS8qIEVudHJ5IGRlZmluZWQgZm9yIGFsbCB2YWx1ZXMgCi0qICBmb3IgcnVuID0gMCB0byAyNgotKiAgTm90ZTogdGhlIGxhc3QgZW50cnkgaXMgdG8gdGVybWluYXRlIHdoaWxlIGRlY29kaW5nCi0qLwotY29uc3QgQVJNX1ZMQzMyIGFybVZDTTRQMl9JbnRlclZsY0wwWzU5XSA9IAotewotICAgICAgICB7MiwgICAgIDJ9LAotICAgICAgICB7NCwgICAgMTV9LAotICAgICAgICB7NiwgICAgMjF9LAotICAgICAgICB7NywgICAgMjN9LAotICAgICAgICB7OCwgICAgMzF9LAotICAgICAgICB7OSwgICAgMzd9LAotICAgICAgICB7OSwgICAgMzZ9LAotICAgICAgICB7MTAsICAgMzN9LAotICAgICAgICB7MTAsICAgMzJ9LAotICAgICAgICB7MTEsICAgIDd9LAotICAgICAgICB7MTEsICAgIDZ9LAotICAgICAgICB7MTEsICAgMzJ9LAotICAgICAgICB7MywgICAgIDZ9LAotICAgICAgICB7NiwgICAgMjB9LAotICAgICAgICB7OCwgICAgMzB9LAotICAgICAgICB7MTAsICAgMTV9LAotICAgICAgICB7MTEsICAgMzN9LAotICAgICAgICB7MTIsICAgODB9LAotICAgICAgICB7NCwgICAgMTR9LAotICAgICAgICB7OCwgICAgMjl9LAotICAgICAgICB7MTAsICAgMTR9LAotICAgICAgICB7MTIsICAgODF9LAotICAgICAgICB7NSwgICAgMTN9LAotICAgICAgICB7OSwgICAgMzV9LAotICAgICAgICB7MTAsICAgMTN9LAotICAgICAgICB7NSwgICAgMTJ9LAotICAgICAgICB7OSwgICAgMzR9LAotICAgICAgICB7MTIsICAgODJ9LAotICAgICAgICB7NSwgICAgMTF9LAotICAgICAgICB7MTAsICAgMTJ9LAotICAgICAgICB7MTIsICAgODN9LAotICAgICAgICB7NiwgICAgMTl9LAotICAgICAgICB7MTAsICAgMTF9LAotICAgICAgICB7MTIsICAgODR9LAotICAgICAgICB7NiwgICAgMTh9LAotICAgICAgICB7MTAsICAgMTB9LAotICAgICAgICB7NiwgICAgMTd9LAotICAgICAgICB7MTAsICAgIDl9LAotICAgICAgICB7NiwgICAgMTZ9LAotICAgICAgICB7MTAsICAgIDh9LAotICAgICAgICB7NywgICAgMjJ9LAotICAgICAgICB7MTIsICAgODV9LAotICAgICAgICB7NywgICAgMjF9LAotICAgICAgICB7NywgICAgMjB9LAotICAgICAgICB7OCwgICAgMjh9LAotICAgICAgICB7OCwgICAgMjd9LAotICAgICAgICB7OSwgICAgMzN9LAotICAgICAgICB7OSwgICAgMzJ9LAotICAgICAgICB7OSwgICAgMzF9LAotICAgICAgICB7OSwgICAgMzB9LAotICAgICAgICB7OSwgICAgMjl9LAotICAgICAgICB7OSwgICAgMjh9LAotICAgICAgICB7OSwgICAgMjd9LAotICAgICAgICB7OSwgICAgMjZ9LAotICAgICAgICB7MTEsICAgMzR9LAotICAgICAgICB7MTEsICAgMzV9LAotICAgICAgICB7MTIsICAgODZ9LAotICAgICAgICB7MTIsICAgODd9LAotICAgICAgICB7MCwgICAgIDB9Ci19OwotIAotCi0vKiAKLSogIEZvciBJbnRyYQotKiAgbGFzdCA9IDEgCi0qLwotCi1jb25zdCBPTVhfVTggYXJtVkNNNFAyX0ludGVyTDFSdW5JZHhbM10gPSAKLXsKLSAgICAwLCAzLCA1Ci19OwotCi0vKiBFbnRyeSBkZWZpbmVkIGZvciBhbGwgdmFsdWVzIAotKiAgZm9yIHJ1biA9IDAgdG8gNDAKLSogIE5vdGU6IHRoZSBsYXN0IGVudHJ5IGlzIHRvIHRlcm1pbmF0ZSB3aGlsZSBkZWNvZGluZwotKi8KLWNvbnN0IEFSTV9WTEMzMiBhcm1WQ000UDJfSW50ZXJWbGNMMVs0NV0gPSAKLXsKLSAgICAgICAgezQsICAgICA3fSwKLSAgICAgICAgezksICAgIDI1fSwKLSAgICAgICAgezExLCAgICA1fSwKLSAgICAgICAgezYsICAgIDE1fSwKLSAgICAgICAgezExLCAgICA0fSwKLSAgICAgICAgezYsICAgIDE0fSwKLSAgICAgICAgezYsICAgIDEzfSwKLSAgICAgICAgezYsICAgIDEyfSwKLSAgICAgICAgezcsICAgIDE5fSwKLSAgICAgICAgezcsICAgIDE4fSwKLSAgICAgICAgezcsICAgIDE3fSwKLSAgICAgICAgezcsICAgIDE2fSwKLSAgICAgICAgezgsICAgIDI2fSwKLSAgICAgICAgezgsICAgIDI1fSwKLSAgICAgICAgezgsICAgIDI0fSwKLSAgICAgICAgezgsICAgIDIzfSwKLSAgICAgICAgezgsICAgIDIyfSwKLSAgICAgICAgezgsICAgIDIxfSwKLSAgICAgICAgezgsICAgIDIwfSwKLSAgICAgICAgezgsICAgIDE5fSwKLSAgICAgICAgezksICAgIDI0fSwKLSAgICAgICAgezksICAgIDIzfSwKLSAgICAgICAgezksICAgIDIyfSwKLSAgICAgICAgezksICAgIDIxfSwKLSAgICAgICAgezksICAgIDIwfSwKLSAgICAgICAgezksICAgIDE5fSwKLSAgICAgICAgezksICAgIDE4fSwKLSAgICAgICAgezksICAgIDE3fSwKLSAgICAgICAgezEwLCAgICA3fSwKLSAgICAgICAgezEwLCAgICA2fSwKLSAgICAgICAgezEwLCAgICA1fSwKLSAgICAgICAgezEwLCAgICA0fSwKLSAgICAgICAgezExLCAgIDM2fSwKLSAgICAgICAgezExLCAgIDM3fSwKLSAgICAgICAgezExLCAgIDM4fSwKLSAgICAgICAgezExLCAgIDM5fSwKLSAgICAgICAgezEyLCAgIDg4fSwKLSAgICAgICAgezEyLCAgIDg5fSwKLSAgICAgICAgezEyLCAgIDkwfSwKLSAgICAgICAgezEyLCAgIDkxfSwKLSAgICAgICAgezEyLCAgIDkyfSwKLSAgICAgICAgezEyLCAgIDkzfSwKLSAgICAgICAgezEyLCAgIDk0fSwKLSAgICAgICAgezEyLCAgIDk1fSwKLSAgICAgICAgeyAwLCAgICAwfQotfTsKLQotLyogTE1BWCB0YWJsZSBmb3IgSW50cmEgKExhc3QgPT0gMCkqLwotY29uc3QgT01YX1U4IGFybVZDTTRQMl9JbnRlckwwTE1BWFsyN10gPSAKLXsKLSAgIDEyLCAgNiwgIDQsICAzLCAgMywgIDMsICAzLCAgMiwgCi0gICAgMiwgIDIsICAyLCAgMSwgIDEsICAxLCAgMSwgIDEsCi0gICAgMSwgIDEsICAxLCAgMSwgIDEsICAxLCAgMSwgIDEsCi0gICAgMSwgIDEsICAxLAotfTsKLQotLyogTE1BWCB0YWJsZSBmb3IgSW50cmEgKExhc3QgPT0gMSkqLwotY29uc3QgT01YX1U4IGFybVZDTTRQMl9JbnRlckwxTE1BWFs0MV0gPSAKLXsKLSAgICAzLCAgMiwgIDEsICAxLCAgMSwgIDEsICAxLCAgMSwgCi0JMSwgIDEsICAxLCAgMSwgIDEsICAxLCAgMSwgIDEsCi0JMSwgIDEsICAxLCAgMSwgIDEsICAxLCAgMSwgIDEsCi0JMSwgIDEsICAxLCAgMSwgIDEsICAxLCAgMSwgIDEsCi0JMSwgIDEsICAxLCAgMSwgIDEsICAxLCAgMSwgIDEsCi0JMSwgIAotfTsKLQotLyogUk1BWCB0YWJsZSBmb3IgSW50cmEgKExhc3QgPT0gMCkKLSAgIExldmVsIC0gMSBJbmRleGVkIAotKi8KLWNvbnN0IE9NWF9VOCBhcm1WQ000UDJfSW50ZXJMMFJNQVhbMTJdID0gCi17Ci0gICAyNiwgMTAsICA2LCAgMiwgIDEsICAxLCAgIAotICAgIDAsICAwLCAgMCwgIDAsICAwLCAgMAotfTsKLQotLyogUk1BWCB0YWJsZSBmb3IgSW50cmEgKExhc3QgPT0gMSkKLSAgIExldmVsIC0gMSBJbmRleGVkIAotKi8KLWNvbnN0IE9NWF9VOCBhcm1WQ000UDJfSW50ZXJMMVJNQVhbM10gPSAKLXsKLSAgIDQwLCAgMSwgIDAKLX07Ci0KLS8qIAotKiAgRm9yIEludHJhIC0gTHVtaW5hbmNlCi0qLwotCi1jb25zdCBBUk1fVkxDMzIgYXJtVkNNNFAyX2FJbnRyYURDTHVtYUluZGV4WzE0XSA9IAotewotICAgICAgICB7MywgICAgIDN9LAotICAgICAgICB7MiwgICAgIDN9LAotICAgICAgICB7MiwgICAgIDJ9LAotICAgICAgICB7MywgICAgIDJ9LAotICAgICAgICB7MywgICAgIDF9LAotICAgICAgICB7NCwgICAgIDF9LAotICAgICAgICB7NSwgICAgIDF9LAotICAgICAgICB7NiwgICAgIDF9LAotICAgICAgICB7NywgICAgIDF9LAotICAgICAgICB7OCwgICAgIDF9LAotICAgICAgICB7OSwgICAgIDF9LAotICAgICAgICB7MTAsICAgIDF9LAotICAgICAgICB7MTEsICAgIDF9LAotICAgICAgICB7MCwgICAgIDB9Ci19OwotCi0vKiAKLSogIEZvciBJbnRyYSAtIENocm9taW5hbmNlCi0qLwotIAotY29uc3QgQVJNX1ZMQzMyIGFybVZDTTRQMl9hSW50cmFEQ0Nocm9tYUluZGV4WzE0XSA9IAotewotICAgICAgICB7MiwgICAgIDN9LAotICAgICAgICB7MiwgICAgIDJ9LAotICAgICAgICB7MiwgICAgIDF9LAotICAgICAgICB7MywgICAgIDF9LAotICAgICAgICB7NCwgICAgIDF9LAotICAgICAgICB7NSwgICAgIDF9LAotICAgICAgICB7NiwgICAgIDF9LAotICAgICAgICB7NywgICAgIDF9LAotICAgICAgICB7OCwgICAgIDF9LAotICAgICAgICB7OSwgICAgIDF9LAotICAgICAgICB7MTAsICAgIDF9LAotICAgICAgICB7MTEsICAgIDF9LAotICAgICAgICB7MTIsICAgIDF9LAotICAgICAgICB7MCwgICAgIDB9Ci19OwotCi0vKiAKLSAqICBNb3Rpb24gdmVjdG9yIGRlY29kaW5nIHRhYmxlCi0gKi8KLSAKLWNvbnN0IEFSTV9WTEMzMiBhcm1WQ000UDJfYVZsY01WRFs2Nl0gPQotewotICAgICAgICB7MTMsICAgICA1fSwKLSAgICAgICAgezEzLCAgICAgN30sCi0gICAgICAgIHsxMiwgICAgIDV9LAotICAgICAgICB7MTIsICAgICA3fSwKLSAgICAgICAgezEyLCAgICAgOX0sCi0gICAgICAgIHsxMiwgICAgMTF9LAotICAgICAgICB7MTIsICAgIDEzfSwKLSAgICAgICAgezEyLCAgICAxNX0sCi0gICAgICAgIHsxMSwgICAgIDl9LAotICAgICAgICB7MTEsICAgIDExfSwKLSAgICAgICAgezExLCAgICAxM30sCi0gICAgICAgIHsxMSwgICAgMTV9LAotICAgICAgICB7MTEsICAgIDE3fSwKLSAgICAgICAgezExLCAgICAxOX0sCi0gICAgICAgIHsxMSwgICAgMjF9LAotICAgICAgICB7MTEsICAgIDIzfSwKLSAgICAgICAgezExLCAgICAyNX0sCi0gICAgICAgIHsxMSwgICAgMjd9LAotICAgICAgICB7MTEsICAgIDI5fSwKLSAgICAgICAgezExLCAgICAzMX0sCi0gICAgICAgIHsxMSwgICAgMzN9LAotICAgICAgICB7MTEsICAgIDM1fSwKLSAgICAgICAgezEwLCAgICAxOX0sCi0gICAgICAgIHsxMCwgICAgMjF9LAotICAgICAgICB7MTAsICAgIDIzfSwKLSAgICAgICAgezgsICAgICAgN30sCi0gICAgICAgIHs4LCAgICAgIDl9LAotICAgICAgICB7OCwgICAgIDExfSwKLSAgICAgICAgezcsICAgICAgN30sCi0gICAgICAgIHs1LCAgICAgIDN9LAotICAgICAgICB7NCwgICAgICAzfSwKLSAgICAgICAgezMsICAgICAgM30sCi0gICAgICAgIHsxLCAgICAgIDF9LAotICAgICAgICB7MywgICAgICAyfSwKLSAgICAgICAgezQsICAgICAgMn0sCi0gICAgICAgIHs1LCAgICAgIDJ9LAotICAgICAgICB7NywgICAgICA2fSwKLSAgICAgICAgezgsICAgICAxMH0sCi0gICAgICAgIHs4LCAgICAgIDh9LAotICAgICAgICB7OCwgICAgICA2fSwKLSAgICAgICAgezEwLCAgICAyMn0sCi0gICAgICAgIHsxMCwgICAgMjB9LAotICAgICAgICB7MTAsICAgIDE4fSwKLSAgICAgICAgezExLCAgICAzNH0sCi0gICAgICAgIHsxMSwgICAgMzJ9LAotICAgICAgICB7MTEsICAgIDMwfSwKLSAgICAgICAgezExLCAgICAyOH0sCi0gICAgICAgIHsxMSwgICAgMjZ9LAotICAgICAgICB7MTEsICAgIDI0fSwKLSAgICAgICAgezExLCAgICAyMn0sCi0gICAgICAgIHsxMSwgICAgMjB9LAotICAgICAgICB7MTEsICAgIDE4fSwKLSAgICAgICAgezExLCAgICAxNn0sCi0gICAgICAgIHsxMSwgICAgMTR9LAotICAgICAgICB7MTEsICAgIDEyfSwKLSAgICAgICAgezExLCAgICAxMH0sCi0gICAgICAgIHsxMSwgICAgIDh9LAotICAgICAgICB7MTIsICAgIDE0fSwKLSAgICAgICAgezEyLCAgICAxMn0sCi0gICAgICAgIHsxMiwgICAgMTB9LAotICAgICAgICB7MTIsICAgICA4fSwKLSAgICAgICAgezEyLCAgICAgNn0sCi0gICAgICAgIHsxMiwgICAgIDR9LAotICAgICAgICB7MTMsICAgICA2fSwKLSAgICAgICAgezEzLCAgICAgNH0sCi0gICAgICAgIHsgMCwgICAgIDB9Ci19OwotCi0vKiBFbmQgb2YgZmlsZSAqLwotCi0KLQpkaWZm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ICogW2luXSAgbWF4U3RvcmVSdW5MMCAgICBNYXggc3RvcmUgcG9zc2libGUgKGNvbnNpZGVyaW5nIGxhc3QgYW5kIGludGVyL2ludHJhKQotICogICAgICAgICAgICAgICAgICAgICAgICBmb3IgbGFzdCA9IDAKLSAqIFtpbl0gIG1heFN0b3JlUnVuTDEgICAgTWF4IHN0b3JlIHBvc3NpYmxlIChjb25zaWRlcmluZyBsYXN0IGFuZCBpbnRlci9pbnRyYSkKLSAqICAgICAgICAgICAgICAgICAgICAgICAgZm9yIGxhc3QgPSAxCi0gKiBbaW5dICBtYXhSdW5Gb3JNdWx0aXBsZUVudHJpZXNMMCAKLSAqICAgICAgICAgICAgICAgICAgICAgICAgVGhlIHJ1biB2YWx1ZSBhZnRlciB3aGljaCBsZXZlbCAKLSAqICAgICAgICAgICAgICAgICAgICAgICAgd2lsbCBiZSBlcXVhbCB0byAxOiAKLSAqICAgICAgICAgICAgICAgICAgICAgICAgKGNvbnNpZGVyaW5nIGxhc3QgYW5kIGludGVyL2ludHJhIHN0YXR1cykgZm9yIGxhc3QgPSAwCi0gKiBbaW5dICBtYXhSdW5Gb3JNdWx0aXBsZUVudHJpZXNMMSAKLSAqICAgICAgICAgICAgICAgICAgICAgICAgVGhlIHJ1biB2YWx1ZSBhZnRlciB3aGljaCBsZXZlbCAKLSAqICAgICAgICAgICAgICAgICAgICAgICAgd2lsbCBiZSBlcXVhbCB0byAxOiAKLSAqICAgICAgICAgICAgICAgICAgICAgICAgKGNvbnNpZGVyaW5nIGxhc3QgYW5kIGludGVyL2ludHJhIHN0YXR1cykgZm9yIGxhc3QgPSAxCi0gKiBbaW5dICBwUnVuSW5kZXhUYWJsZUwwIFJ1biBJbmRleCB0YWJsZSBkZWZpbmVkIGluIAotICogICAgICAgICAgICAgICAgICAgICAgICBhcm1WQ000UDJfSHVmZl9UYWJsZXNfVkxDLmMgZm9yIGxhc3QgPT0gMAotICogW2luXSAgcFZsY1RhYmxlTDAgICAgICBWTEMgdGFibGU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AgICAgICAgICAgICBzbyB0aGF0IGl0IHBvaW50cyB0byB0aGUgY3VycmVudCBieXRlIGluIHRoZSBiaXQKLSAqICAgICAgICAgICAgICAgICAgICAgICAgc3RyZWFtIGJ1ZmZlci4KLSAqIFtvdXRdIHBCaXRPZmZzZXQgICAgICAgKnBCaXRPZmZzZXQgaXMgdXBkYXRlZCBzbyB0aGF0IGl0IHBvaW50cyB0byB0aGUKLSAqICAgICAgICAgICAgICAgICAgICAgICAgY3VycmVudCBiaXQgcG9zaXRpb24gaW4gdGhlIGJ5dGUgcG9pbnRlZCBieQotICogICAgICAgICAgICAgICAgICAgICAgICAqcHBCaXRTdHJlYW0uCi0gKgotICogUmV0dXJuIFZhbHVlOgotICogU3RhbmRhcmQgT01YUmVzdWx0IHJlc3VsdC4gU2VlIGVudW1lcmF0aW9uIGZvciBwb3NzaWJsZSByZXN1bHQgY29kZXMuCi0gKgotICovCi0KLQotT01YUmVzdWx0IGFybVZDTTRQMl9QdXRWTENCaXRzICgKLSAgICAgICAgICAgICAgT01YX1U4ICoqcHBCaXRTdHJlYW0sCi0gICAgICAgICAgICAgIE9NWF9JTlQgKiBwQml0T2Zmc2V0LAotICAgICAgICAgICAgICBjb25zdCBPTVhfUzE2ICpwUURjdEJsa0NvZWYsCi0gICAgICAgICAgICAgIE9NWF9JTlQgc2hvcnRWaWRlb0hlYWRlciwKLSAgICAgICAgICAgICAgT01YX1U4IHN0YXJ0LAotICAgICAgICAgICAgICBPTVhfVTggbWF4U3RvcmVSdW5MMCwKLSAgICAgICAgICAgICAgT01YX1U4IG1heFN0b3JlUnVuTDEsCi0gICAgICAgICAgICAgIE9NWF9VOCAgbWF4UnVuRm9yTXVsdGlwbGVFbnRyaWVzTDAsCi0gICAgICAgICAgICAgIE9NWF9VOCAgbWF4UnVuRm9yTXVsdGlwbGVFbnRyaWVzTDEsCi0gICAgICAgICAgICAgIGNvbnN0IE9NWF9VOCAgKiBwUnVuSW5kZXhUYWJsZUwwLAotICAgICAgICAgICAgICBjb25zdCBBUk1fVkxDMzIgKnBWbGNUYWJsZUwwLAotCQkJICBjb25zdCBPTVhfVTggICogcFJ1bkluZGV4VGFibGVMMSwKLSAgICAgICAgICAgICAgY29uc3QgQVJNX1ZMQzMyICpwVmxjVGFibGVMMSwKLSAgICAgICAgICAgICAgY29uc3QgT01YX1U4ICAqIHBMTUFYVGFibGVMMCwKLSAgICAgICAgICAgICAgY29uc3QgT01YX1U4ICAqIHBMTUFYVGFibGVMMSwKLSAgICAgICAgICAgICAgY29uc3QgT01YX1U4ICAqIHBSTUFYVGFibGVMMCwKLSAgICAgICAgICAgICAgY29uc3QgT01YX1U4ICAqIHBSTUFYVGFibGVMMSwKLSAgICAgICAgICAgICAgY29uc3QgT01YX1U4ICAqIHBaaWd6YWdUYWJsZQotKQotewotCi0gICAgT01YX1UzMiBzdG9yZVJ1biA9IDAsIHJ1biwgc3RvcmVSdW5QbHVzOwotICAgIE9NWF9VOCAgbGFzdCA9IDAsIGZpcnN0ID0gMSwgZk1vZGU7Ci0gICAgT01YX1MxNiBsZXZlbCwgc3RvcmVMZXZlbCA9IDAsIHN0b3JlTGV2ZWxQbHVzOwotICAgIE9NWF9JTlQgaTsKLSAgICAKLSAgICAgICAgLyogUkxFIGVuY29kaW5nIGFuZCBwYWNraW5nIHRoZSBiaXRzIGludG8gdGhlIHN0cmVhbXMgKi8KLSAgICAgICAgZm9yIChpID0gc3RhcnQsIHJ1bj0wOyBpIDwgNjQ7IGkrKykKLSAgICAgICAgewotICAgICAgICAgICAgbGV2ZWwgICA9IHBRRGN0QmxrQ29lZltwWmlnemFnVGFibGVbaV1dOwotCi0gICAgICAgICAgICAvKiBDb3VudGluZyB0aGUgcnVuICovCi0gICAgICAgICAgICBpZiAobGV2ZWwgPT0gMCkKLSAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICBydW4rKzsKLSAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgLyogRm91bmQgYSBub24temVybyBjb2VmZiAqLwotICAgICAgICAgICAgZWxzZQotICAgICAgICAgICAgewotICAgICAgICAgICAgICAgIGlmIChmaXJzdCA9PSAwKQotICAgICAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAgICAgbGFzdCA9IDA7Ci0gICAgICAgICAgICAgICAgICAgIAotICAgICAgICAgICAgICAgICAgICAvKiBDaGVjayBmb3IgYSB2YWxpZCBlbnRyeSBpbiB0aGUgVkxDIHRhYmxlICovCi0gICAgICAgICAgICAgICAgICAgIHN0b3JlTGV2ZWxQbHVzID0gYXJtU2lnbkNoZWNrKHN0b3JlTGV2ZWwpICogCi0gICAgICAgICAgICAgICAgICAgICAgKGFybUFicyhzdG9yZUxldmVsKSAtIHBMTUFYVGFibGVMMFtzdG9yZVJ1bl0pOwotICAgICAgICAgICAgICAgICAgICBzdG9yZVJ1blBsdXMgPSBzdG9yZVJ1biAtIAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChwUk1BWFRhYmxlTDBbYXJtQWJzKHN0b3JlTGV2ZWwpIC0gMV0gKyAxKTsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAotICAgICAgICAgICAgICAgICAgICBmTW9kZSA9IGFybVZDTTRQMl9DaGVja1ZMQ0VzY2FwZU1vZGUoCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzdG9yZVJ1biwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHN0b3JlUnVuUGx1cywKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHN0b3JlTGV2ZWwsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzdG9yZUxldmVsUGx1cywKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1heFN0b3JlUnVuTDAsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBtYXhSdW5Gb3JNdWx0aXBsZUVudHJpZXNMMCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNob3J0VmlkZW9IZWFkZXIsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwUnVuSW5kZXhUYWJsZUwwKTsKLSAgICAgICAgICAgICAgICAgICAgCi0gICAgICAgICAgICAgICAgICAgIGFybVZDTTRQMl9GaWxsVkxDQnVmZmVyICgKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcHBCaXRTdHJlYW0sIAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwQml0T2Zmc2V0LAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzdG9yZVJ1biwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc3RvcmVMZXZlbCwgCi0JCQkJCQkJCQkgIHN0b3JlUnVuUGx1cywKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc3RvcmVMZXZlbFBsdXMsIAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBmTW9kZSwKLQkJCQkJCQkJCSAgbGFzdCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbWF4UnVuRm9yTXVsdGlwbGVFbnRyaWVzTDAsIAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwUnVuSW5kZXhUYWJsZUwwLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwVmxjVGFibGVMMCk7ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgc3RvcmVMZXZlbCA9IGxldmVsOwotICAgICAgICAgICAgICAgIHN0b3JlUnVuICAgPSBydW47Ci0gICAgICAgICAgICAgICAgZmlyc3QgPSAwOwotICAgICAgICAgICAgICAgIHJ1biA9IDA7Ci0gICAgICAgICAgICB9Ci0KLSAgICAgICAgfSAvKiBlbmQgb2YgZm9yIGxvb3AgZm9yIDY0IGVsZW1lbnRzICovCi0KLSAgICAgICAgLyogd3JpdGluZyB0aGUgbGFzdCBlbGVtZW50ICovCi0gICAgICAgIGxhc3QgPSAxOwotICAgICAgICAKLSAgICAgICAgLyogQ2hlY2sgZm9yIGEgdmFsaWQgZW50cnkgaW4gdGhlIFZMQyB0YWJsZSAqLwotICAgICAgICBzdG9yZUxldmVsUGx1cyA9IGFybVNpZ25DaGVjayhzdG9yZUxldmVsKSAqIAotICAgICAgICAgICAgICAgICAgICAgICAgKGFybUFicyhzdG9yZUxldmVsKSAtIHBMTUFYVGFibGVMMVtydW5dKTsKLSAgICAgICAgc3RvcmVSdW5QbHVzID0gc3RvcmVSdW4gLSAKLSAgICAgICAgICAgICAgICAgICAgICAocFJNQVhUYWJsZUwxW2FybUFicyhzdG9yZUxldmVsKSAtIDFdICsgMSk7Ci0gICAgICAgIGZNb2RlID0gYXJtVkNNNFAyX0NoZWNrVkxDRXNjYXBlTW9kZSgKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHN0b3JlUnVuLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc3RvcmVSdW5QbHVzLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc3RvcmVMZXZlbCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHN0b3JlTGV2ZWxQbHVzLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbWF4U3RvcmVSdW5MMSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1heFJ1bkZvck11bHRpcGxlRW50cmllc0wxLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2hvcnRWaWRlb0hlYWRlciwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBSdW5JbmRleFRhYmxlTDEpOwotICAgICAgICAKLSAgICAgICAgYXJtVkNNNFAyX0ZpbGxWTENCdWZmZXIgKAotICAgICAgICAgICAgICAgICAgICAgICAgICBwcEJpdFN0cmVhbSwgCi0gICAgICAgICAgICAgICAgICAgICAgICAgIHBCaXRPZmZzZXQsCi0gICAgICAgICAgICAgICAgICAgICAgICAgIHN0b3JlUnVuLAotICAgICAgICAgICAgICAgICAgICAgICAgICBzdG9yZUxldmVsLCAKLQkJCQkJCSAgc3RvcmVSdW5QbHVzLAotICAgICAgICAgICAgICAgICAgICAgICAgICBzdG9yZUxldmVsUGx1cywKLSAgICAgICAgICAgICAgICAgICAgICAgICAgZk1vZGUsCi0JCQkJCQkgIGxhc3QsCi0gICAgICAgICAgICAgICAgICAgICAgICAgIG1heFJ1bkZvck11bHRpcGxlRW50cmllc0wxLAotICAgICAgICAgICAgICAgICAgICAgICAgICBwUnVuSW5kZXhUYWJsZUwxLAotICAgICAgICAgICAgICAgICAgICAgICAgICBwVmxjVGFibGVMMSk7Ci0JcmV0dXJuIE9NWF9TdHNfTm9FcnI7ICAgICAgICAgICAgICAgICAgICAgICAgICAKLX0KLQotLyogRW5kIG9mIEZpbGUgKi8KZGlmZiAtLWdpdCBhL21lZGlhL2xpYnN0YWdlZnJpZ2h0L2NvZGVjcy9vbjIvaDI2NGRlYy9vbXhkbC9yZWZlcmVuY2UvdmMvbTRwMi9zcmMvYXJtVkNNNFAyX1NldFByZWREaXIuYyBiL21lZGlhL2xpYnN0YWdlZnJpZ2h0L2NvZGVjcy9vbjIvaDI2NGRlYy9vbXhkbC9yZWZlcmVuY2UvdmMvbTRwMi9zcmMvYXJtVkNNNFAyX1NldFByZWREaXIuYwpkZWxldGVkIGZpbGUgbW9kZSAxMDA2NDQKaW5kZXggYTljZDAwOC4uMDAwMDAwMAotLS0gYS9tZWRpYS9saWJzdGFnZWZyaWdodC9jb2RlY3Mvb24yL2gyNjRkZWMvb214ZGwvcmVmZXJlbmNl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JnRXJyKTsKLSAgICBhcm1SZXRBcmdFcnJJZighYXJtSXMxNkJ5dGVBbGlnbmVkKHBTcmNDdXJyQnVmKSwgT01YX1N0c19CYWRBcmdFcnIpOwotICAgCi0gICAgcmV0dXJuIChhcm1WQ000UDJfQmxvY2tNYXRjaF9IYWxmKAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwU3JjUmVmQnVmLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZWZXaWR0aCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcFJlZlJlY3QsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBTcmNDdXJyQnVmLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwU2VhcmNoUG9pbnRSZWZQb3MsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJuZFZhbCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcFNyY0RzdE1WLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwRHN0U0FELAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBCbG9ja1NpemUpKTsKLQotCi19Ci0KLS8qIEVuZCBvZiBmaWxlICovCmRpZmYgLS1naXQgYS9tZWRpYS9saWJzdGFnZWZyaWdodC9jb2RlY3Mvb24yL2gyNjRkZWMvb214ZGwvcmVmZXJlbmNlL3ZjL200cDIvc3JjL29teFZDTTRQMl9CbG9ja01hdGNoX0hhbGZfOHg4LmMgYi9tZWRpYS9saWJzdGFnZWZyaWdodC9jb2RlY3Mvb24yL2gyNjRkZWMvb214ZGwvcmVmZXJlbmNlL3ZjL200cDIvc3JjL29teFZDTTRQMl9CbG9ja01hdGNoX0hhbGZfOHg4LmMKZGVsZXRlZCBmaWxlIG1vZGUgMTAwNjQ0CmluZGV4IDY5OTZlNmQuLjAwMDAwMDAKLS0tIGEvbWVkaWEvbGlic3RhZ2VmcmlnaHQvY29kZWNzL29uMi9oMjY0ZGVjL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AgPT0gTlVMTCwgT01YX1N0c19CYWRBcmdFcnIpOwotICAgIGFybVJldEFyZ0VycklmKHBTcmNDdXJyQnVmICAgICAgICA9PSBOVUxMLCBPTVhfU3RzX0JhZEFyZ0Vycik7Ci0gICAgYXJtUmV0QXJnRXJySWYocFNlYXJjaFBvaW50UmVmUG9zID09IE5VTEwsIE9NWF9TdHNfQmFkQXJnRXJyKTsKLSAgICBhcm1SZXRBcmdFcnJJZihwU3JjRHN0TVYgICAgICAgICAgPT0gTlVMTCwgT01YX1N0c19CYWRBcmdFcnIpOwotICAgIGFybVJldEFyZ0VycklmKCFhcm1JczhCeXRlQWxpZ25lZChwU3JjQ3VyckJ1ZiksIE9NWF9TdHNfQmFkQXJnRXJyKTsKLSAgIAotICAgIHJldHVybiAoYXJtVkNNNFAyX0Jsb2NrTWF0Y2hfSGFsZigKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcFNyY1JlZkJ1ZiwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmVmV2lkdGgsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBSZWZSZWN0LAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwU3JjQ3VyckJ1ZiwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcFNlYXJjaFBvaW50UmVmUG9zLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBybmRWYWwsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBTcmNEc3RNViwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcERzdFNBRCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgQmxvY2tTaXplKSk7Ci0KLX0KLQotLyogRW5kIG9mIGZpbGUgKi8KZGlmZiAtLWdpdCBhL21lZGlhL2xpYnN0YWdlZnJpZ2h0L2NvZGVjcy9vbjIvaDI2NGRlYy9vbXhkbC9yZWZlcmVuY2UvdmMvbTRwMi9zcmMvb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gICBhcm1SZXRBcmdFcnJJZihwU3JjID09IE5VTEwsIE9NWF9TdHNfQmFkQXJnRXJyKTsKLSAgICBhcm1SZXRBcmdFcnJJZighYXJtSXMxNkJ5dGVBbGlnbmVkKHBTcmMpLCBPTVhfU3RzX0JhZEFyZ0Vycik7Ci0gICAgYXJtUmV0QXJnRXJySWYocERzdCA9PSBOVUxMLCBPTVhfU3RzX0JhZEFyZ0Vycik7Ci0gICAgYXJtUmV0QXJnRXJySWYoIWFybUlzMTZCeXRlQWxpZ25lZChwRHN0KSwgT01YX1N0c19CYWRBcmdFcnIpOwotCi0KLSAgICBmb3IgKHUgPSAwOyB1IDwgODsgdSsrKQotICAgIHsKLSAgICAgICAgZm9yICh2ID0gMDsgdiA8IDg7IHYrKykKLSAgICAgICAgewotICAgICAgICAgICAgT01YX0Y2NCBzdW0gPSAwLjA7Ci0gICAgICAgICAgICBmb3IgKHggPSAwOyB4IDwgODsgeCsrKQotICAgICAgICAgICAgewotICAgICAgICAgICAgICAgIGZvciAoeSA9IDA7IHkgPCA4OyB5KyspCi0gICAgICAgICAgICAgICAgewotICAgICAgICAgICAgICAgICAgICBzdW0gKz0gcFNyY1soeCAqIDgpICsgeV0gKgotICAgICAgICAgICAgICAgICAgICAgICBhcm1WQ000UDJfcHJlQ2FsY0RDVENvc1t4XVt1XSAqCi0gICAgICAgICAgICAgICAgICAgICAgIGFybVZDTTRQMl9wcmVDYWxjRENUQ29zW3ldW3ZdOwotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgIH0KLSAgICAgICAgICAgIHBEc3RbKHUgKiA4KSArIHZdPSBhcm1Sb3VuZEZsb2F0VG9TMTYgKHN1bSk7ICAgICAgICAgICAgCi0gICAgICAgIH0KLSAgICB9Ci0KLSAgICByZXR1cm4gT01YX1N0c19Ob0VycjsKLX0KLQotCi0KLS8qIEVuZCBvZiBmaWxlICovCi0KLQpkaWZmIC0tZ2l0IGEvbWVkaWEvbGlic3RhZ2VmcmlnaHQvY29kZWN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SFJPTUlOQU5DRTsKLSAgICB9Ci0gICAgCi0KLSAgICAvKiBWTEQgYW5kIHppZ3phZyAqLwotICAgIGlmIChpbnRyYURDVkxDID09IDEpCi0gICAgewotICAgICAgICBlcnJvckNvZGUgPSBvbXhWQ000UDJfRGVjb2RlVkxDWmlnemFnX0ludHJhRENWTEMoCi0gICAgICAgICAgICBwcEJpdFN0cmVhbSwKLSAgICAgICAgICAgIHBCaXRPZmZzZXQsCi0gICAgICAgICAgICBwVGVtcEJ1ZjEsCi0gICAgICAgICAgICBwcmVkQUNEaXIsCi0gICAgICAgICAgICBzaG9ydFZpZGVvSGVhZGVyLAotICAgICAgICAgICAgdmlkZW9Db21wKTsKLSAgICAgICAgYXJtUmV0RGF0YUVycklmKChlcnJvckNvZGUgIT0gT01YX1N0c19Ob0VyciksIGVycm9yQ29kZSk7Ci0gICAgfQotICAgIGVsc2UKLSAgICB7Ci0gICAgICAgIGVycm9yQ29kZSA9IG9teFZDTTRQMl9EZWNvZGVWTENaaWd6YWdfSW50cmFBQ1ZMQygKLSAgICAgICAgICAgIHBwQml0U3RyZWFtLAotICAgICAgICAgICAgcEJpdE9mZnNldCwKLSAgICAgICAgICAgIHBUZW1wQnVmMSwKLSAgICAgICAgICAgIHByZWRBQ0RpciwKLSAgICAgICAgICAgIHNob3J0VmlkZW9IZWFkZXIpOwotICAgICAgICBhcm1SZXREYXRhRXJySWYoKGVycm9yQ29kZSAhPSBPTVhfU3RzX05vRXJyKSwgZXJyb3JDb2RlKTsKLSAgICB9Ci0KLSAgICAvKiBBQyBEQyBwcmVkaWN0aW9uICovCi0gICAgZXJyb3JDb2RlID0gb214VkNNNFAyX1ByZWRpY3RSZWNvbkNvZWZJbnRyYSgKLSAgICAgICAgcFRlbXBCdWYxLAotICAgICAgICBwQ29lZkJ1ZlJvdywKLSAgICAgICAgcENvZWZCdWZDb2wsCi0gICAgICAgIGN1clFQLAotICAgICAgICBwcmVkUVAsCi0gICAgICAgIHByZWREaXIsCi0gICAg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0OwotICAgIH0KLSAgICBlbHNlIGlmICgoTUJUeXBlID09IE9NWF9WQ19JTlRFUikgfHwgKE1CVHlwZSA9PSBPTVhfVkNfSU5URVJfUSkpCi0gICAgewotICAgICAgICBjb3VudCA9IDE7Ci0gICAgfQotCi0gICAgLyogQ2FsY3VsYXRpbmcgdGhlIHNjYWxlIGZhY3RvciAqLwotICAgIHNjYWxlRmFjdG9yID0gMSA8PCAoZmNvZGVGb3J3YXJkIC0xKTsKLSAgICBoaWdoID0gICggMzIgKiBzY2FsZUZhY3RvcikgLSAxOwotICAgIGxvdyA9ICAgKCAoLTMyKSAqIHNjYWxlRmFjdG9yKTsKLSAgICByYW5nZSA9ICggNjQgKiBzY2FsZUZhY3Rvcik7Ci0KLSAgICAvKiBIdWZmbWFuIGRlY29kaW5nIGFuZCBNViByZWNvbnN0cnVjdGlvbiAqLwotICAgIGZvciAoaUJsayA9IDA7IGlCbGsgPCBjb3VudDsgaUJsaysrKQotICAgIHsKLQotICAgICAgICAvKiBIdWZmbWFuIGRlY29kaW5nIHRvIGdldCBIb3Jpem9udGFsIGRhdGEgYW5kIHJlc2lkdWFsICovCi0gICAgICAgIGluZGV4ID0gYXJtVW5QYWNrVkxDMzIocHBCaXRTdHJlYW0sIHBCaXRPZmZzZXQsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGFybVZDTTRQMl9hVmxjTVZEKTsKLSAgICAgICAgYXJtUmV0RGF0YUVycklmKGluZGV4ID09IC0xLCBPTVhfU3RzX0Vycik7Ci0KLSAgICAgICAgbXZIb3JEYXRhID0gaW5kZXggLSAzMjsKLQotICAgICAgICBpZiAoKGZjb2RlRm9yd2FyZCA+IDEpICYmIChtdkhvckRhdGEgIT0gMCkpCi0gICAgICAgIHsKLSAgICAgICAgICAgIG12SG9yUmVzaWR1YWwgPSAoT01YX1MzMikgYXJtR2V0Qml0cyhwcEJpdFN0cmVhbSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcEJpdE9mZnNldCwgKGZjb2RlRm9yd2FyZCAtMSkpOwotICAgICAgICB9Ci0KLSAgICAgICAgLyogSHVmZm1hbiBkZWNvZGluZyB0byBnZXQgVmVydGljYWwgZGF0YSBhbmQgcmVzaWR1YWwgKi8KLSAgICAgICAgaW5kZXggPSBhcm1VblBhY2tWTEMzMihwcEJpdFN0cmVhbSwgcEJpdE9mZnNldCwgYXJtVkNNNFAyX2FWbGNNVkQpOwotICAgICAgICBhcm1SZXREYXRhRXJySWYoaW5kZXggPT0gLTEsIE9NWF9TdHNfRXJyKTsKLQotICAgICAgICBtdlZlckRhdGEgPSBpbmRleCAtIDMyOwotCi0gICAgICAgIGlmICgoZmNvZGVGb3J3YXJkID4gMSkgJiYgKG12VmVyRGF0YSAhPSAwKSkKLSAgICAgICAgewotICAgICAgICAgICAgbXZWZXJSZXNpZHVhbCA9IChPTVhfUzMyKSBhcm1HZXRCaXRzKHBwQml0U3RyZWFtLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwQml0T2Zmc2V0LCAoZmNvZGVGb3J3YXJkIC0xKSk7Ci0gICAgICAgIH0KLQotICAgICAgICAvKiBDYWxjdWxhdGluZyB0aGUgZGlmZmVydGlhbCBNViAqLwotICAgICAgICBpZiAoIChzY2FsZUZhY3RvciA9PSAxKSB8fCAobXZIb3JEYXRhID09IDApICkKLSAgICAgICAgewotICAgICAgICAgICAgZGlmZk1WLmR4ID0gbXZIb3JEYXRhOwotICAgICAgICB9Ci0gICAgICAgIGVsc2UKLSAgICAgICAgewotICAgICAgICAgICAgZGlmZk1WLmR4ID0gKChhcm1BYnMobXZIb3JEYXRhKSAtIDEpICogZmNvZGVGb3J3YXJkKQotICAgICAgICAgICAgICAgICAgICAgICAgICsgbXZIb3JSZXNpZHVhbCArIDE7Ci0gICAgICAgICAgICBpZiAobXZIb3JEYXRhIDwgMCkKLSAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICBkaWZmTVYuZHggPSAtZGlmZk1WLmR4OwotICAgICAgICAgICAgfQotICAgICAgICB9Ci0KLSAgICAgICAgaWYgKCAoc2NhbGVGYWN0b3IgPT0gMSkgfHwgKG12VmVyRGF0YSA9PSAwKSApCi0gICAgICAgIHsKLSAgICAgICAgICAgIGRpZmZNVi5keSA9IG12VmVyRGF0YTsKLSAgICAgICAgfQotICAgICAgICBlbHNlCi0gICAgICAgIHsKLSAgICAgICAgICAgIGRpZmZNVi5keSA9ICgoYXJtQWJzKG12VmVyRGF0YSkgLSAxKSAqIGZjb2RlRm9yd2FyZCkKLSAgICAgICAgICAgICAgICAgICAgICAgICArIG12VmVyUmVzaWR1YWwgKyAxOwotICAgICAgICAgICAgaWYgKG12VmVyRGF0YSA8IDApCi0gICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgZGlmZk1WLmR5ID0gLWRpZmZNVi5keTsKLSAgICAgICAgICAgIH0KLSAgICAgICAgfQotCi0gICAgICAgIC8qIEZpbmQgdGhlIHByZWRpY3RlZCB2ZWN0b3IgKi8KLSAgICAgICAgb214VkNNNFAyX0ZpbmRNVnByZWQgKAotICAgICAgICAgICAgcERzdE1WQ3VyTUIsCi0gICAgICAgICAgICBwU3JjTVZMZWZ0TUIsCi0gICAgICAgICAgICBwU3JjTVZVcHBlck1CLAotICAgICAgICAgICAgcFNyY01WVXBwZXJSaWdodE1CLAotICAgICAgICAgICAgJnBEc3RNVkN1ck1CW2lCbGtdLAotICAgICAgICAgICAgZHN0TVZQcmVkTUUsCi0gICAgICAgICAgICBpQmxrKTsKLQotICAgICAgICAvKiBBZGRpbmcgdGhlIGRpZmZlcmVuY2UgdG8gdGhlIHByZWRpY3RlZCBNViB0byByZWNvbnN0cnVjdCBNViAqLwotICAgICAgICBwRHN0TVZDdXJNQltpQmxrXS5keCArPSBkaWZmTVYuZHg7Ci0gICAgICAgIHBEc3RNVkN1ck1CW2lCbGtdLmR5ICs9IGRpZmZNVi5keTsKLQotICAgICAgICAv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mZnNldCwgYXJtVkNNNFAyX2FJbnRyYURDQ2hyb21hSW5kZXgpOwotICAgIH0KLSAgICBhcm1SZXREYXRhRXJySWYoRENWYWx1ZVNpemUgPT0gLTEsIE9NWF9TdHNfRXJyKTsKLSAgICBhcm1SZXREYXRhRXJySWYoRENWYWx1ZVNpemUgPiAxMiwgT01YX1N0c19FcnIpOwotCi0KLSAgICBpZiAoRENWYWx1ZVNpemUgPT0gMCkKLSAgICB7Ci0gICAgICAgIHBEc3RbMF0gPSAwOwotICAgIH0KLSAgICBlbHNlCi0gICAgewotICAgICAgICBmZXRjaERDYml0cyA9IChPTVhfVTE2KSBhcm1HZXRCaXRzKHBwQml0U3RyZWFtLCBwQml0T2Zmc2V0LCBcCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgRENWYWx1ZVNpemUpOwotCi0gICAgICAgIGlmICggKGZldGNoRENiaXRzID4+IChEQ1ZhbHVlU2l6ZSAtIDEpKSA9PSAwKQotICAgICAgICB7Ci0gICAgICAgICAgICAvKiBjYWx1bGF0ZSBwb3cgKi8KLSAgICAgICAgICAgIHBvd09mU2l6ZSA9ICgxIDw8IERDVmFsdWVTaXplKTsKLQotICAgICAgICAgICAgcERzdFswXSA9ICAoT01YX1MxNikgKGZldGNoRENiaXRzIF4gKHBvd09mU2l6ZSAtIDEpKTsKLSAgICAgICAgICAgIHBEc3RbMF0gPSAtcERzdFswXTsKLSAgICAgICAgfQotICAgICAgICBlbHNlCi0gICAgICAgIHsKLSAgICAgICAgICAgIHBEc3RbMF0gPSBmZXRjaERDYml0czsKLSAgICAgICAgfQotCi0gICAgICAgIGlmIChEQ1ZhbHVlU2l6ZSA+IDgpCi0gICAgICAgIHsKLSAgICAgICAgICAgIC8qIHJlYWRpbmcgYW5kIGNoZWNraW5nIHRoZSBtYXJrZXIgYml0Ki8KLSAgICAgICAgICAgIGFybVJldERhdGFFcnJJZiAoYXJtR2V0Qml0cyhwcEJpdFN0cmVhbSwgcEJp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ICAgewotICAgICAgICBjb3VudCA9IDE7Ci0gICAgfQotCi0gICAgLyogQ2FsY3VsYXRpbmcgdGhlIHNjYWxlIGZhY3RvciAqLwotICAgIHNjYWxlRmFjdG9yID0gMSA8PCAoZmNvZGVGb3J3YXJkIC0xKTsKLQotICAgIGZvciAoaUJsayA9IDA7IGlCbGsgPCBjb3VudDsgaUJsaysrKQotICAgIHsKLQotICAgICAgICAvKiBGaW5kIHRoZSBwcmVkaWN0ZWQgdmVjdG9yICovCi0gICAgICAgIG9teFZDTTRQMl9GaW5kTVZwcmVkICgKLSAgICAgICAgICAgIHBNVkN1ck1CLAotICAgICAgICAgICAgcFNyY01WTGVmdE1CLAotICAgICAgICAgICAgcFNyY01WVXBwZXJNQiwKLSAgICAgICAgICAgIHBTcmNNVlVwcGVyUmlnaHRNQiwKLSAgICAgICAgICAgICZkc3RNVlByZWQsCi0gICAgICAgICAgICBkc3RNVlByZWRNRSwKLSAgICAgICAgICAgIGlCbGsgKTsKLQotICAgICAgICAvKiBDYWxjdWxhdGluZyB0aGUgZGlmZmVyZW50aWFsIG1vdGlvbiB2ZWN0b3IgKGRpZmZNVikgKi8KLSAgICAgICAgZGlmZk1WLmR4ID0gcE1WQ3VyTUJbaUJsa10uZHggLSBkc3RNVlByZWQuZHg7Ci0gICAgICAgIGRpZmZNVi5keSA9IHBNVkN1ck1CW2lCbGtdLmR5IC0gZHN0TVZQcmVkLmR5OwotCi0gICAgICAgIC8qIENhbGN1bGF0aW5nIHRoZSBtdl9kYXRhIGFuZCBtdl9yZXNpZHVhbCBmb3IgSG9yaXphbnRhbCBNViAqLwotICAgICAgICBpZiAoZGlmZk1WLmR4ID09IDApCi0gICAgICAgIHsKLSAgICAgICAgICAgIG12SG9yUmVzaWR1YWwgPSAwOwotICAgICAgICAgICAgbXZIb3JEYXRhID0gMDsKLSAgICAgICAgfQotICAgICAgICBlbHNlCi0gICAgICAgIHsKLSAgICAgICAgICAgIG12SG9yUmVzaWR1YWwgPSAoIGFybUFicyhkaWZmTVYuZHgpIC0gMSkgJSBzY2FsZUZhY3RvcjsKLSAgICAgICAgICAgIG12SG9yRGF0YSA9IChhcm1BYnMoZGlmZk1WLmR4KSAtIG12SG9yUmVzaWR1YWwgKyAoc2NhbGVGYWN0b3IgLSAxKSkKLSAgICAgICAgICAgICAgICAgICAgIC8gc2NhbGVGYWN0b3I7Ci0gICAgICAgICAgICBpZiAoZGlmZk1WLmR4IDwgMCkKLSAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICBtdkhvckRhdGEgPSAtbXZIb3JEYXRhOwotICAgICAgICAgICAgfQotICAgICAgICB9Ci0KLSAgICAgICAgLyogQ2FsY3VsYXRpbmcgdGhlIG12X2RhdGEgYW5kIG12X3Jlc2lkdWFsIGZvciBWZXJ0aWNhbCBNViAqLwotICAgICAgICBpZiAoZGlmZk1WLmR5ID09IDApCi0gICAgICAgIHsKLSAgICAgICAgICAgIG12VmVyUmVzaWR1YWwgPSAwOwotICAgICAgICAgICAgbXZWZXJEYXRhID0gMDsKLSAgICAgICAgfQotICAgICAgICBlbHNlCi0gICAgICAgIHsKLSAgICAgICAgICAgIG12VmVyUmVzaWR1YWwgPSAoIGFybUFicyhkaWZmTVYuZHkpIC0gMSkgJSBzY2FsZUZhY3RvcjsKLSAgICAgICAgICAgIG12VmVyRGF0YSA9IChhcm1BYnMoZGlmZk1WLmR5KSAtIG12VmVyUmVzaWR1YWwgKyAoc2NhbGVGYWN0b3IgLSAxKSkKLSAgICAgICAgICAgICAgICAgICAgIC8gc2NhbGVGYWN0b3I7Ci0gICAgICAgICAgICBpZiAoZGlmZk1WLmR5IDwgMCkKLSAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICBtdlZlckRhdGEgPSAtbXZWZXJEYXRhOwotICAgICAgICAgICAgfQotICAgICAgICB9Ci0KLSAgICAgICAgLyogSHVmZm1hbiBlbmNvZGluZyAqLwotCi0gICAgICAgIC8qIFRoZSBpbmRleCBpcyBhY3R1YWxseSBjYWxj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QgPCAwKSB8fCAoKnBCaXRPZmZzZXQgPjcpLCBPTVhfU3RzX0JhZEFyZ0Vycik7Ci0KLSAgICBpZiAocGF0dGVybikKLSAgICB7Ci0gICAgICAgIGFybVZDTTRQMl9QdXRWTENCaXRzICgKLSAgICAgICAgICAgICAgcHBCaXRTdHJlYW0sCi0gICAgICAgICAgICAgIHBCaXRPZmZzZXQsCi0gICAgICAgICAgICAgIHBRRGN0QmxrQ29lZiwKLSAgICAgICAgICAgICAgc2hvcnRWaWRlb0hlYWRlciwKLSAgICAgICAgICAgICAgc3RhcnQsCi0gICAgICAgICAgICAgIDI2LAotICAgICAgICAgICAgICA0MCwKLSAgICAgICAgICAgICAgMTAsCi0gICAgICAgICAgICAgIDEsCi0gICAgICAgICAgICAgIGFybVZDTTRQMl9JbnRlckwwUnVuSWR4LAotICAgICAgICAgICAgICBhcm1WQ000UDJfSW50ZXJWbGNMMCwKLQkJCSAgYXJtVkNNNFAyX0ludGVyTDFSdW5JZHgsCi0gICAgICAgICAgICAgIGFybVZDTTRQMl9JbnRlclZsY0wxLAotICAgICAgICAgICAgICBhcm1WQ000UDJfSW50ZXJMMExNQVgsCi0gICAgICAgICAgICAgIGFybVZDTTRQMl9JbnRlckwxTE1BWCwKLSAgICAgICAgICAgICAgYXJtVkNNNFAyX0ludGVyTDBSTUFYLAotICAgICAgICAgICAgICBhcm1WQ000UDJfSW50ZXJMMVJNQVgsCi0gICAgICAgICAgICAgIHBaaWd6YWdUYWJsZQotICAgICAgICApOwotICAgIH0gLyogUGF0dGVybiBjaGVjayBlbmRzKi8KLQotICAgIHJldHVybiBPTVhfU3RzX05vRXJyOwotCi19Ci0KLS8qIEVuZCBvZiBmaWxlICovCmRpZmYgLS1naXQgYS9tZWRpYS9saWJzdGFnZWZyaWdodC9jb2RlY3Mvb24yL2gyNjRkZWMvb214ZGwvcmVmZXJlbmNlL3ZjL200cDIvc3JjL29teFZDTTRQMl9FbmNvZGVWTENaaWd6YWdfSW50cmFBQ1ZM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gIGFic0RDVmFsdWUgPSBhcm1BYnMoZGNWYWx1ZSk7Ci0KLSAgICAgICAgLyogSW5zZXJ0IHRoZSBjb2RlIGludG8gdGhlIGJpdHN0cmVhbSAqLwotICAgICAgICBpZiAodmlkZW9Db21wID09IE9NWF9WQ19MVU1JTkFOQ0UpCi0gICAgICAgIHsKLQotICAgICAgICAgICAgYXJtUGFja1ZMQzMyIChwcEJpdFN0cmVhbSwgcEJpdE9mZnNldCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgYXJtVkNNNFAyX2FJbnRyYURDTHVtYUluZGV4W0RDVmFsdWVTaXplXSk7Ci0gICAgICAgIH0KLSAgICAgICAgZWxzZSBpZiAodmlkZW9Db21wID09IE9NWF9WQ19DSFJPTUlOQU5DRSkKLSAgICAgICAgewotCi0gICAgICAgICAgICBhcm1QYWNrVkxDMzIgKHBwQml0U3RyZWFtLCBwQml0T2Zmc2V0LAotICAgICAgICAgICAgICAgICAgICAgICAgICBhcm1WQ000UDJfYUludHJhRENDaHJvbWFJbmRleFtEQ1ZhbHVlU2l6ZV0pOwotICAgICAgICB9Ci0KLSAgICAgICAgLyogQWRkaXRpb25hbCBjb2RlIGdlbmVyYXRpb24gaW4gY2FzZSBvZiBuZWdhdGl2ZQotICAgICAgICAgICBkYyB2YWx1ZSB0aGUgYWRkaXRpb25hbCAqLwotICAgICAgICBpZiAoRENWYWx1ZVNpemUgPiAwKQotICAgICAgICB7Ci0gICAgICAgICAgICBpZiAoZGNWYWx1ZSA8IDApCi0gICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgLyogY2FsdWxhdGUgMiBwb3cgKi8KLSAgICAgICAgICAgICAgICBwb3dPZlNpemUgPSAoMSA8PCBEQ1ZhbHVlU2l6ZSk7Ci0KLSAgICAgICAgICAgICAgICBhYnNEQ1ZhbHVlID0gIGFic0RDVmFsdWUgXiAocG93T2ZTaXplIC0gMSk7Ci0gICAgICAgICAgICB9Ci0gICAgICAgICAgICBhcm1QYWNrQml0cy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WzJdOwotCQkJfQotCQkJaWYgKChwU3JjQ2FuZE1WMSA9PSBOVUxMKSAmJiAocFNyY0NhbmRNVjIgPT0gTlVMTCkpCi0gICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgcENhbmRNVjEgPSBwQ2FuZE1WMiA9IHBDYW5kTVYzOwotICAgICAgICAgICAgfQotICAgICAgICAgICAgZWxzZSBpZigocFNyY0NhbmRNVjEgPT0gTlVMTCkgJiYgKHBTcmNDYW5kTVYzID09IE5VTEwpKQotICAgICAgICAgICAgewotICAgICAgICAgICAgICAgIHBDYW5kTVYxID0gcENhbmRNVjMgPSBwQ2FuZE1WMjsKLSAgICAgICAgICAgIH0KLSAgICAgICAgICAgIGVsc2UgaWYoKHBTcmNDYW5kTVYyID09IE5VTEwpICYmIChwU3JjQ2FuZE1WMyA9PSBOVUxMKSkKLSAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICBwQ2FuZE1WMiA9IHBDYW5kTVYzID0gcENhbmRNVjE7Ci0gICAgICAgICAgICB9Ci0gICAgICAgICAgICBicmVhazsKLSAgICAgICAgfQotICAgICAgICBjYXNlIDE6Ci0gICAgICAgIHsKLSAgICAgICAgICAgIHBDYW5kTVYxID0gJnBTcmNNVkN1ck1CWzBdOwotCQkJaWYocFNyY0NhbmRNVjIgIT0gTlVMTCkKLSAgICAgICAgICAgIHsKLQkJCQlwQ2FuZE1WMiA9ICZwU3JjQ2FuZE1WMlszXTsKLQkJCX0KLQkJCWlmKHBTcmNDYW5kTVYzICE9IE5VTEwpCi0gICAgICAgICAgICB7Ci0JCQkJcENhbmRNVjMgPSAmcFNyY0NhbmRNVjNbMl07Ci0JCQl9Ci0JCQlpZigocFNyY0NhbmRNVjIgPT0gTlVMTCkgJiYgKHBTcmNDYW5kTVYzID09IE5VTEwpKQotICAgICAgICAgICAgewotICAgICAgICAgICAgICAgIHBDYW5kTVYyID0gcENhbmRNVjMgPSBwQ2FuZE1WMTsKLSAgICAgICAgICAgIH0KLSAgICAg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gICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICBmb3IgKHYgPSAwOyB2IDwgODsgdisrKQotICAgICAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAgICAgc3VtICs9IHBTcmNbKHUgKiA4KSArIHZdICoKLSAgICAgICAgICAgICAgICAgICAgICAgIGFybVZDTTRQMl9wcmVDYWxjRENUQ29zW3hdW3VdICoKLSAgICAgICAgICAgICAgICAgICAgICAgIGFybVZDTTRQMl9wcmVDYWxjRENUQ29zW3ldW3ZdOwotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgIH0KLSAgICAgICAgICAgIHBEc3RbKHggKiA4KSArIHldID0gKE9NWF9TMTYpIGZsb29yKHN1bSArIDAuNSk7Ci0KLSAgICAgICAgICAgIC8qIFNhdHVyYXRlIHRvIFstMjU2LCAyNTVdICovCi0gICAgICAgICAgICBwRHN0Wyh4ICogOCkgKyB5XSA9IGFybUNsaXAgKAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAtMjU2LAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAyNTUsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBEc3RbKHggKiA4KSArIHldKTsKLSAgICAgICAgfQotICAgIH0KLQotICAgIHJldHVybiBPTVhfU3RzX05vRXJyOwotfQotCi0vKiBFbmQgb2YgZmlsZSAqLwotCi0KZGlmZiAtLWdpdCBhL21lZGlhL2xpYnN0YWdlZnJpZ2h0L2NvZGVjcy9vbjIvaDI2NGRlYy9vbXhkbC9yZWZlcmVuY2UvdmMvbTRwMi9zcmMvb214VkNNNFAyX01DUmVjb25CbG9jay5jIGIvbWVkaWEvbGlic3RhZ2VmcmlnaHQvY29kZWNzL29uMi9oMjY0ZGVjL29teGRsL3JlZmVyZW5jZS92Yy9tNHAyL3NyYy9vbXhWQ000UDJfTUNSZWNvbkJsb2NrLmMKZGVsZXRlZCBmaWxlIG1v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U5URUdFUl9QSVhFTDoKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYXJtVkNNNFAyX01DUmVjb25CbG9ja19Ob1JlcyhwU3JjLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzcmNTdGVwLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmKHBUZW1wRHN0WzBdKSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOCk7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOwotICAgICAgICBjYXNlIE9NWF9WQ19IQUxGX1BJWEVMX1g6Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGFybVZDTTRQMl9IYWxmUGVsSG9yKHBTcmMsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzcmNTdGVwLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJihwVGVtcERzdFswXSksCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBybmRWYWwpOwotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKLSAgICAgICAgY2FzZSBPTVhfVkNfSEFMRl9QSVhFTF9ZOgotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBhcm1WQ000UDJfSGFsZlBlbFZlcihwU3JjLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc3JjU3RlcCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICYocFRlbXBEc3RbMF0pLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcm5kVmFsKTsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7Ci0gICAgICAgIGNhc2UgT01YX1ZDX0hBTEZfUElYRUxfWFk6Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGFybVZDTTRQMl9IYWxmUGVsVmVySG9yKHBTcmMsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzcmNTdGVwLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJihwVGVtcERzdFswXSksCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBybmRWYWwpOwotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKLSAgICB9Ci0gICAgCi0gICAgaWYocFNyY1Jlc2lkdWUgPT0gTlVMTCkKLSAgICB7Ci0gICAgICBhcm1WQ000UDJfTUNSZWNvbkJsb2NrX05vUmVzKCYocFRlbXBEc3RbMF0pLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA4LAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwRHN0LAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBkc3RTdGVwKTsgICAgCi0gICAgfQotICAgIGVsc2UKLSAgICB7Ci0gICAgICBhcm1WQ000UDJfTUNSZWNvbkJsb2NrX1JlcygmKHBUZW1wRHN0WzBdKSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBTcmNSZXNpZHVlLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcERzdCwKLSAgICAgICAgICAgICAgIC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AgT01YX0lOVCAqcERzdFNBRAotKQotewotICAgIE9NWFZDTTRQMk1FUGFyYW1zICpwTUVQYXJhbXMgPSAoT01YVkNNNFAyTUVQYXJhbXMgKilwTUVTcGVjOwotICAgIE9NWF9JTlQgcm5kVmFsOwotICAgIAotICAgIHJuZFZhbCA9IHBNRVBhcmFtcy0+cm5kVmFsOwotICAgIAotICAgIG9teFZDTTRQMl9CbG9ja01hdGNoX0ludGVnZXJfOHg4KAotICAgICAgICBwU3JjUmVmQnVmLAotICAgICAgICBzcmNSZWZTdGVwLAotICAgICAgICBwUmVmUmVjdCwKLSAgICAgICAgcFNyY0N1cnJCdWYsCi0gICAgICAgIHBDdXJyUG9pbnRQb3MsCi0gICAgICAgIHBTcmNQcmVNViwKLSAgICAgICAgcFNyY1ByZVNBRCwKLSAgICAgICAgcE1FUGFyYW1zLAotICAgICAgICBwU3JjRHN0TVYsCi0gICAgICAgIHBEc3RTQUQpOwotICAgIAotICAgIGlmIChwTUVQYXJhbXMtPmhhbGZQZWxTZWFyY2hFbmFibGUpCi0gICAgewotICAgICAgICBvbXhWQ000UDJfQmxvY2tNYXRjaF9IYWxmXzh4OCgKLSAgICAgICAgICAgIHBTcmNSZWZCdWYsCi0gICAgICAgICAgICBzcmNSZWZTdGVwLAotICAgICAgICAgICAgcFJlZlJlY3QsCi0gICAgICAgICAgICBwU3JjQ3VyckJ1ZiwKLSAgICAgICAgICAgIHBDdXJyUG9pbnRQb3MsCi0gICAgICAgICAgICBybmRWYWwsCi0gICAgICAgICAgICBwU3JjRHN0TVYsCi0gICAgICAgICAgICBwRHN0U0FEKTsKLSAgICB9Ci0gICAgCi0gICAgcmV0dXJuIE9NWF9TdHNfTm9FcnI7ICAgICAgICAKLX0KLQotCi0vKioKLSAqIEZ1bmN0aW9uOiAgb214VkNNNFAyX01vdGlvbkVzdGltYXRpb25NQiAgICg2LjIuNC4zLjEpCi0gKgotICogRGVzY3JpcHRpb246Ci0gKiBQZXJmb3JtcyBtb3Rpb24g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TUJJbmZvWzBdLT5tYlR5cGUgIT0gT01YX1ZDX0lOVFJBKSkKLSAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgIHBTcmNDYW5kTVYxW2luZGV4XSA9ICYocE1CSW5mb1swXS0+cE1WMFt5XVt4XSk7IAotICAgICAgICAgICAgfQotICAgICAgICAgICAgZWxzZQotICAgICAgICAgICAgewotICAgICAgICAgICAgICAgcFNyY0NhbmRNVjFbaW5kZXhdID0gTlVMTDsKLSAgICAgICAgICAgIH0KLSAgICAgICAgICAgIGlmKChwTUJJbmZvWzFdICE9IE5VTEwpICYmIChwTUJJbmZvWzFdLT5tYlR5cGUgIT0gT01YX1ZDX0lOVFJBKSkKLSAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgIHBTcmNDYW5kTVYyW2luZGV4XSA9ICYocE1CSW5mb1sxXS0+cE1WMFt5XVt4XSk7Ci0gICAgICAgICAgICB9Ci0gICAgICAgICAgICBlbHNlCi0gICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICBwU3JjQ2FuZE1WMltpbmRleF0gPSBOVUxMOyAKLSAgICAgICAgICAgIH0KLSAgICAgICAgICAgIGlmKChwTUJJbmZvWzNdICE9IE5VTEwpICYmIChwTUJJbmZvWzNdLT5tYlR5cGUgIT0gT01YX1ZDX0lOVFJBKSkKLSAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgIHBTcmNDYW5kTVYzW2luZGV4XSA9ICYocE1CSW5mb1szXS0+cE1WMFt5XVt4XSk7Ci0gICAgICAgICAgICB9Ci0gICAgICAgICAgICBlbHNlCi0gICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICBwU3JjQ2FuZE1WM1tpbmRleF0gPSBOVUxMOyAKLSAgICAgICAgICAgIH0KLSAgICAgICAgfQotICAgIH0KLQkvKiBDYWxjdWxhdGluZyBTQUQgYXQgTVYoMCwwKSAqLwotCWFybVZDQ09NTV9TQUQocFRlbXBTcmNDdXJyQnVmLAotCQkJCQkgIDE2LAotCQkJCQ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XJyUG9pbnRQb3MsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICYocFNyY0RzdE1CQ3Vyci0+cE1WUHJlZFswXVswXSksIE5VTEwsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBNRVBhcmFtcywgJihwU3JjRHN0TUJDdXJyLT5wTVYwWzBdWzBdKSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJmRzdFNBRDh4OAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICApOwotICAgICAgICBwRHN0QmxvY2tTQURbMF0gPSBkc3RTQUQ4eDg7Ci0gICAgICAgICpwRHN0U0FEID0gZHN0U0FEOHg4OwotICAgICAgICBwVGVtcEN1cnJQb2ludFBvcy0+eCArPSA4OwotICAgICAgICBwU3JjUmVmQnVmICs9IDg7Ci0gICAgICAgIG9teFZDTTRQMl9GaW5kTVZwcmVkKAotICAgICAgICAgICAgICAgICAgICAmKHBTcmNEc3RNQkN1cnItPnBNVjBbMF1bMV0pLAotICAgICAgICAgICAgICAgICAgICBwU3JjQ2FuZE1WMVsxXSwKLSAgICAgICAgICAgICAgICAgICAgcFNyY0NhbmRNVjJbMV0sCi0gICAgICAgICAgICAgICAgICAgIHBTcmNDYW5kTVYzWzFdLAotICAgICAgICAgICAgICAgICAgICAmKHBTcmNEc3RNQkN1cnItPnBNVlByZWRbMF1bMV0pLAotICAgICAgICAgICAgICAgICAgICBOVUxMLAotICAgICAgICAgICAgICAgICAgICAxKTsKLSAgICAgICAgCi0gICAgICAgIGFybVZDTTRQMl9CbG9ja01hdGNoXzh4OCAocFNyY1JlZkJ1ZiwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc3JjUmVmU3RlcCwgcFJlZlJlY3QsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBUZW1wU3JjQ3VyckJ1ZiwgcFRlbXBDdXJyUG9pbnRQb3MsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICYocFNyY0RzdE1CQ3Vyci0+cE1WUHJlZFswXVsxXSksIE5VTEwsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBNRVBhcmFtcywgJihwU3JjRHN0TUJDdXJyLT5wTVYwWzBdWzFdKSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJmRzdFNBRDh4OAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICApOwotICAgICAgICBwRHN0QmxvY2tTQURbMV0gPSBkc3RTQUQ4eDg7Ci0gICAgICAgICpwRHN0U0FEICs9IGRzdFNBRDh4ODsKLSAgICAgICAgcFRlbXBDdXJyUG9pbnRQb3MtPnggLT0gODsKLSAgICAgICAgcFRlbXBDdXJyUG9pbnRQb3MtPnkgKz0gODsKLSAgICAgICAgcFNyY1JlZkJ1ZiArPSAoc3JjUmVmU3RlcCAqIDgpIC0gODsKLSAgICAgICAgCi0gICAgICAgIG9teFZDTTRQMl9GaW5kTVZwcmVkKAotICAgICAgICAgICAgICAgICAgICAmKHBTcmNEc3RNQkN1cnItPnBNVjBbMV1bMF0pLAotICAgICAgICAgICAgICAgICAgICBwU3JjQ2FuZE1WMVsyXSwKLSAgICAgICAgICAgICAgICAgICAgcFNyY0NhbmRNVjJbMl0sCi0gICAgICAgICAgICAgICAgICAgIHBTcmNDYW5kTVYzWzJdLAotICAgICAgICAgICAgICAgICAgICAmKHBTcmNEc3RNQkN1cnItPnBNVlByZWRbMV1bMF0pLAotICAgICAgICAgICAgICAgICAgICBOVUxMLAotICAgICAgICAgICAgICAgICAgICAyKTsKLSAgICAgICAgYXJtVkNNNFAyX0Jsb2NrTWF0Y2hfOHg4IChwU3JjUmVmQnVmLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzcmNSZWZTdGVwLCBwUmVmUmVjdCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcFRlbXBTcmNDdXJyQnVmLCBwVGVtcEN1cnJQb2ludFBvcywKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJihwU3JjRHN0TUJDdXJyLT5wTVZQcmVkWzFdWzBdKSwgTlVMTCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcE1FUGFyYW1zLCAmKHBTcmNEc3RNQkN1cnItPnBNVjBbMV1bMF0pLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmZHN0U0FEOHg4Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICk7Ci0gICAgICAgIHBEc3RCbG9ja1NBRFsyXSA9IGRzdFNBRDh4ODsKLSAgICAgICAgKnBEc3RTQUQgKz0gZHN0U0FEOHg4OwotICAgICAgICBwVGVtcEN1cnJQb2ludFBvcy0+eCArPSA4OwotICAgICAgICBwU3JjUmVmQnVmICs9IDg7Ci0gICAgICAgIG9teFZDTTRQMl9GaW5kTVZwcmVkKAotICAgICAgICAgICAgICAgICAgICAmKHBTcmNEc3RNQkN1cnItPnBNVjBbMV1bMV0pLAotICAgICAgICAgICAgICAgICAgICBwU3JjQ2FuZE1WMVszXSwKLSAgICAgICAgICAgICAgICAgICAgcFNyY0NhbmRNVjJbM10sCi0gICAgICAgICAgICAgICAgICAgIHBTcmNDYW5kTVYzWzNdLAotICAgICAgICAgICAgICAgICAgICAmKHBTcmNEc3RNQkN1cnItPnBNVlByZWRbMV1bMV0pLAotICAgICAgICAgICAgICAgICAgICBOVUxMLAotICAgICAgICAgICAgICAgICAgICAzKTsKLSAgICAgICAgYXJtVkNNNFAyX0Jsb2NrTWF0Y2hfOHg4IChwU3JjUmVmQnVmLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzcmNSZWZTdGVwLCBwUmVmUmVjdCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcFRlbXBTcmNDdXJyQnVmLCBwVGVtcEN1cnJQb2ludFBvcywKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJihwU3JjRHN0TUJDdXJyLT5wTVZQcmVkWzFdWzFdKSwgTlVMTCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcE1FUGFyYW1zLCAmKHBTcmNEc3RNQkN1cnItPnBNVjBbMV1bMV0pLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmZHN0U0FEOHg4Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICk7Ci0gICAgICAgIHBEc3RCbG9ja1NBRFszXSA9IGRzdFNBRDh4ODsKLSAgICAgICAgKnBEc3RTQUQgKz0gZHN0U0FEOHg4OyAgIAotICAgICAgICAKLSAgICAgICAgCi0gICAgICAgIC8qIENoZWNraW5nIGlmIDRNViBpcyBlcXVhbCB0byAxTVYgKi8KLSAgICAgICAgaWYgKAotICAgICAgICAgICAgKHBTcmNEc3RNQkN1cnItPnBNVjBbMF1bMF0uZHggIT0gZHN0TVYxNngxNi5keCkgfHwKLSAgICAgICAgICAgIChwU3JjRHN0TUJDdXJyLT5wTVYwWzBdWzBdLmR5ICE9IGRzdE1WMTZ4MTYuZHkpIHx8Ci0gICAgICAgICAgICAocFNyY0RzdE1CQ3Vyci0+cE1WMFswXVsxXS5keCAhPSBkc3RNVjE2eDE2LmR4KSB8fAotICAgICAgICAgICAgKHBTcmNEc3RNQkN1cnItPnBNVjBbMF1bMV0uZHkgIT0gZHN0TVYxNngxNi5keSkgfHwKLSAgICAgICAgICAgIChwU3JjRHN0TUJDdXJyLT5wTVYwWzFdWzBdLmR4ICE9IGRzdE1WMTZ4MTYuZHgpIHx8Ci0gICAgICAgICAgICAocFNyY0RzdE1CQ3Vyci0+cE1WMFsxXVswXS5keSAhPSBkc3RNVjE2eDE2LmR5KSB8fAotICAgICAgICAgICAgKHBTcmNEc3RNQkN1cnItPnBNVjBbMV1bMV0uZHggIT0gZHN0TVYxNngxNi5keCkgfHwKLSAgICAgICAgICAgIChwU3JjRHN0TUJDdXJyLT5wTVYwWzFdWzFdLmR5ICE9IGRzdE1WMTZ4MTYuZHkpCi0gICAgICAgICAgICkKLSAgICAgICAgewotICAgICAgICAgICAgLyogc2VsZWN0IHRoZSA0IE1WICovCi0gICAgICAgICAgICBwU3JjRHN0TUJDdXJyLT5tYlR5cGUgPSBPTVhfVkNfSU5URVI0VjsKLSAgICAgICAgfSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCi0gICAgfQotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKLSAgICAvKiBmaW5kaW5nIHRoZSBlcnJvciBpbiBpbnRyYSBtb2RlICovCi0gICAgZm9yIChjb3VudCA9IDAsIGF2ZXJhZ2UgPSAwOyBjb3VudCA8IDI1NiA7IGNvdW50KyspCi0gICAgewotICAgICAgICBhdmVyYWdlID0gYXZlcmFnZSArIHBUZW1wU3JjQ3VyckJ1Zltjb3VudF07Ci0gICAgfQotICAgIGF2ZXJhZ2UgPSBhdmVyYWdlLzI1NjsKLSAgICAKLQlpbnRyYVNBRCA9IDA7Ci0KLSAgICAvKiBJbnRyYSBTQUQgY2FsY3VsYXRpb24gKi8KLSAgICBmb3IgKGNvdW50ID0gMDsgY291bnQgPCAyNTYgOyBjb3VudCsrKQotICAgIHsKLSAgICAgICAgaW50cmFTQUQgKz0gYXJtQWJzICgocFRlbXBTcmNDdXJyQnVmW2NvdW50XSkgLSAoYXZlcmFnZSkpOwotICAgIH0KLSAgICAKLQkvKiBVc2luZyB0aGUgTVBFRzQgVk0gZm9ybXVsYSBmb3IgaW50cmEvaW50ZXIgbW9kZSBkZWNpc2lvbiAKLQkgICBWYXIgPCAoU0FEIC0gMipOQikgd2hlcmUgTkIgPSBOXjIgaXMgdGhlIG51bWJlciBvZiBwaXhlbHMKLQkgICBvZiB0aGUgbWFjcm9ibG9jay4qLwotCi0gICAgaWYgKGlud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ICAgICAgICBwcmVkaWN0VHlwZSA9IE9NWF9WQ19JTlRFR0VSX1BJWEVMOwotICAgICAgfQotICAgICAgCi0gICAgICBwRHN0ID0gYXJtQWxpZ25UbzhCeXRlcygmKGFEc3RbMF0pKTsKLSAgICAgIC8qIENhbGN1bGF0aW5nIEJsb2NrIFNBRCBhdCBNVihkc3RNVjE2eDE2LmR4LGRzdE1WMTZ4MTYuZHkpICovCi0JICAvKiBCbG9jayAwICovCi0gICAgICBvbXhWQ000UDJfTUNSZWNvbkJsb2NrKHBUZW1wU3JjUmVmQnVmLAotCSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc3JjUmVmU3RlcCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIE5VTEwsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwRHN0LCAKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRzdFN0ZXAsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwcmVkaWN0VHlwZSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBNRVBhcmFtcy0+cm5kVmFsKTsKLSAgICAKLSAgICAgIGFybVZDQ09NTV9TQUQocFRlbXBTcmNDdXJyQnVmLAotICAgICAgICAgICAgICAgICAgICAgICAgMTYsCi0gICAgICAgICAgICAgICAgICAgICAgICBwRHN0LAotICAgICAgICAgICAgICAgICAgICAgICAgZHN0U3RlcCwKLSAgICAgICAgICAgICAgICAgICAgICAgICZTYWQsCi0gICAgICAgICAgICAgICAgICAgICAgICA4LAotICAgICAgICAgICAgICAgICAgICAgICAgOCk7Ci0gICAgICBwRHN0QmxvY2tTQURbMF0gPSBTYWQ7Ci0gICAKLSAgICAgIC8qIEJsb2NrIDEgKi8KLSAgICAgIG9teFZDTTRQMl9NQ1JlY29uQmxvY2socFRlbXBTcmNSZWZCdWYgKyA4LAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc3JjUmVmU3RlcCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIE5VTEwsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwRHN0LCAKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRzdFN0ZXAsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwcmVkaWN0VHlwZSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBNRVBhcmFtcy0+cm5kVmFsKTsJCQkJCSAgCi0KLSAgICAgIGFybVZDQ09NTV9TQUQocFRlbXBTcmNDdXJyQnVmICsgOCwKLSAgICAgICAgICAgICAgICAgICAgICAgIDE2LAotICAgICAgICAgICAgICAgICAgICAgICAgcERzdCwKLSAgICAgICAgICAgICAgICAgICAgICAgIGRzdFN0ZXAsCi0gICAgICAgICAgICAgICAgICAgICAgICAmU2FkLAotICAgICAgICAgICAgICAgICAgICAgICAgOCwKLSAgICAgICAgICAgICAgICAgICAgICAgIDgpOwotICAgICAgcERzdEJsb2NrU0FEWzFdID0gU2FkOwotCQotICAgICAgLyogQmxvY2sgMiAqLwotICAgICAgb214VkNNNFAyX01DUmVjb25CbG9jayhwVGVtcFNyY1JlZkJ1ZiArIChzcmNSZWZTdGVwKjgpLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc3JjUmVmU3RlcCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIE5VTEwsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwRHN0LCAKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRzdFN0ZXAsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwcmVkaWN0VHlwZSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBNRVBhcmFtcy0+cm5kVmFsKTsKLQotICAgICAgYXJtVkNDT01NX1NBRChwVGVtcFNyY0N1cnJCdWYgKyAoMTYqOCksCi0gICAgICAgICAgICAgICAgICAgICAgICAxNiwKLSAgICAgICAgICAgICAgICAgICAgICAgIHBEc3QsCi0gICAgICAgICAgICAgICAgICAgICAgICBkc3RTdGVwLAotICAgICAgICAgICAgICAgICAgICAgICAgJlNhZCwKLSAgICAgICAgICAgICAgICAgICAgICAgIDgsCi0gICAgICAgICAgICAgICAgICAgICAgICA4KTsKLSAgICAgIHBEc3RCbG9ja1NBRFsyXSA9IFNhZDsKLQotCSAgLyogQmxvY2sgMyAqLwotICAgICAgb214VkNNNFAyX01DUmVjb25CbG9jayhwVGVtcFNyY1JlZkJ1ZiArIChzcmNSZWZTdGVwKjgpICsgOCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNyY1JlZlN0ZXAsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBOVUxMLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcERzdCwgCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBkc3RTdGVwLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcHJlZGljdFR5cGUsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwTUVQYXJhbXMtPnJuZFZhbCk7Ci0KLSAgICAgIGFybVZDQ09NTV9TQUQocFRlbXBTcmNDdXJyQnVmICsgKDE2KjgpICsgOCwKLSAgICAgICAgICAgICAgICAgICAgICAgIDE2LAotICAgICAgICAgICAgICAgICAgICAgICAgcERzdCwKLSAgICAgICAgICAgICAgICAgICAgICAgIGRzdFN0ZXAsCi0gICAgICAgICAgICAgICAgICAgICAgICAmU2FkLAotICAgICAgICAgICAgICAgICAgICAgICAgOCwKLSAgICAgICAgICAgICAgICAgICAgICAgIDgpOwotICAgICAgcERzdEJsb2NrU0FEWzNdID0gU2FkOwotICAgIH0KLSAgICByZXR1cm4gT01YX1N0c19Ob0VycjsKLX0KLQotLyogRW5kIG9mIGZpbGUgKi8KLQpkaWZmIC0tZ2l0IGEvbWVkaWEvbGlic3RhZ2Vmcmln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aXRpb25zIGFuZCBJbml0aWFsaXphdGlvbnMqLwotICAgIE9NWF9JTlQgY29lZmZDb3VudDsKLSAgICBPTVhfSU5UIGZTaWduOwotICAgIE9NWF9JTlQgbWF4Q2xwQUMgPSAwLCBtaW5DbHBBQyA9IDA7Ci0gICAgT01YX0lOVCBtYXhDbHBEQyA9IDAsIG1pbkNscERDID0gMDsKLSAgICAKLSAgICAvKiBBcmd1bWVudCBlcnJvciBjaGVja3MgKi8KLSAgICBhcm1SZXRBcmdFcnJJZihwU3JjRHN0ID09IE5VTEwsIE9NWF9TdHNfQmFkQXJnRXJyKTsKLSAgICBhcm1SZXRBcmdFcnJJZigoKFFQIDw9IDApIHx8IChRUCA+PSAzMikpLCBPTVhfU3RzX0JhZEFyZ0Vycik7Ci0gICAvKiBPbmUgYXJndW1lbnQgY2hlY2sgaXMgZGVsYXllZCB1bnRpbCB3ZSBoYXZlIGFzY2VydGFpbmVkIHRoYXQgICovCi0gICAvKiBwUU1hdHJpeCBpcyBub3QgTlVMTC4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICovCi0gICAgICAgICAgICAgICAgCi0gICAgLyogU2V0IHRoZSBDbGlwIFJhbmdlIGJhc2VkIG9uIFNWSCBvbi9vZmYgKi8KLSAgICBpZihzaG9ydFZpZGVvSGVhZGVyID09IDEpCi0gICAgewotICAgICAgIG1heENscERDID0gMjU0OwotICAgICAgIG1pbkNscERDID0gMTsKLSAgICAgICBtYXhDbHBBQyA9IDEyNzsKLSAgICAgICBtaW5DbHBBQyA9IC0xMjc7ICAgICAgICAKLSAgICB9Ci0gICAgZWxzZQotICAgIHsKLSAgICAgICAgbWF4Q2xwREMgPSAyMDQ3OwotICAgICAgICBtaW5DbHBEQyA9IC0yMDQ3OwotICAgICAgICBtYXhDbHBBQyA9IDIwNDc7Ci0gICAgICAgIG1pbkNscEFDID0gLTIwNDc7ICAgCi0gICAgfQotICAgICAgICAgICAgICAgIAotICAgIC8qIFNlY29uZCBJb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ZXggID4gNSkpCi0gICAgICAgIHsKLSAgICAgICAgICAgIGlmIChRUCA+PSAxICYmIFFQIDw9IDQpCi0gICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgZGNTY2FsZXIgPSA4OwotICAgICAgICAgICAgfQotICAgICAgICAgICAgZWxzZSBpZiAoUVAgPj0gNSAmJiBRUCA8PSA4KQotICAgICAgICAgICAgewotICAgICAgICAgICAgICAgIGRjU2NhbGVyID0gMiAqIFFQOwotICAgICAgICAgICAgfQotICAgICAgICAgICAgZWxzZSBpZiAoUVAgPj0gOSAmJiBRUCA8PSAyNCkKLSAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICBkY1NjYWxlciA9IFFQICsgODsKLSAgICAgICAgICAgIH0KLSAgICAgICAgICAgIGVsc2UKLSAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICBkY1NjYWxlciA9ICgyICogUVApIC0gMTY7Ci0gICAgICAgICAgICB9Ci0gICAgICAgIH0KLSAgICAgICAgZWxzZSBpZiAoYmxvY2tJbmRleCA8IDYpCi0gICAgICAgIHsKLSAgICAgICAgICAgIGlmIChRUCA+PSAxICYmIFFQIDw9IDQpCi0gICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgZGNTY2FsZXIgPSA4OwotICAgICAgICAgICAgfQotICAgICAgICAgICAgZWxzZSBpZiAoUVAgPj0gNSAmJiBRUCA8PSAyNCkKLSAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICBkY1NjYWxlciA9IChRUCArIDEzKS8yOwotICAgICAgICAgICAgfQotICAgICAgICAgICAgZWxzZQotICAgICAgICAgICAgewotICAgICAgICAgICAgICAgIGRjU2NhbGVyID0gUVAgLSA2OwotICAgICAgICAgICAgfQotICAgICAgICB9Ci0gICAgICAgIAotICAgICAgICAvKiBEZXF1YW50IHRoZSBEQyB2YWx1ZSwgdGhpcyBhcHBsaWVzIHRvIGJvdGggdGhlIG1ldGhvZHMgKi8KLSAgICAgICAgcFNyY0RzdFswXSA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0gKi8KLQotT01YUmVzdWx0IG9teFZDTTRQMl9RdWFudEludkludGVyX0koCi0gICAgIE9NWF9TMTYgKiBwU3JjRHN0LAotICAgICBPTVhfSU5UIFFQCi0JICkKLXsKLQotICAgIE9NWF9JTlQgY29lZmZDb3VudCwgU2lnbjsKLSAgICAKLSAgICAvKiBBcmd1bWVudCBlcnJvciBjaGVja3MgKi8KLSAgICBhcm1SZXRBcmdFcnJJZihwU3JjRHN0ID09IE5VTEwsIE9NWF9TdHNfQmFkQXJnRXJyKTsKLSAgICBhcm1SZXRBcmdFcnJJZigoKFFQIDw9IDApIHx8IChRUCA+PSAzMikpLCBPTVhfU3RzX0JhZEFyZ0Vycik7Ci0KLSAgICAvKiBTZWNvbmQgSW52ZXJzZSBxdWFudGlzYXRpb24gbWV0aG9kICovCi0gICAgZm9yIChjb2VmZkNvdW50ID0gMDsgY29lZmZDb3VudCA8IDY0OyBjb2VmZkNvdW50KyspCi0gICAgewotICAgICAgICAvKiBjaGVjayBzaWduICovCi0gICAgICAgIFNpZ24gPSAgYXJtU2lnbkNoZWNrIChwU3JjRHN0W2NvZWZmQ291bnRdKTsKLSAgICAgICAgICAgICAgCi0gICAgICAgIC8qIFF1YW50aXplIHRoZSBjb2VmZiAqLwotICAgICAgICBpZiAoUVAgJiAweDEpCi0gICAgICAgIHsKLSAgICAgICAgICAgIHBTcmNEc3RbY29lZmZDb3VudF0gPSAoMiogYXJtQWJzKHBTcmNEc3RbY29lZmZDb3VudF0pICsgMSkgKiBRUDsKLSAgICAgICAgICAgIHBTcmNEc3RbY29lZmZDb3VudF0gKj0gU2lnbjsKLSAgICAgICAgfQotICAgICAgICBlbHNlCi0gICAgICAgIHsKLSAgICAgICAgICAgIHBTcmNEc3RbY29lZmZDb3VudF0gPSAoMiogYXJtQWJzKHBTcmNEc3RbY29lZmZDb3VudF0pICsgMSkKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqI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hlY2tzICovCi0gICAgYXJtUmV0QXJnRXJySWYocFNyY0RzdCA9PSBOVUxMLCBPTVhfU3RzX0JhZEFyZ0Vycik7Ci0gICAgYXJtUmV0QXJnRXJySWYoKChRUCA8PSAwKSB8fCAoUVAgPj0gMzIpKSwgT01YX1N0c19CYWRBcmdFcnIpOwotCWFybVJldEFyZ0VycklmKCgodmlkZW9Db21wICE9IE9NWF9WQ19MVU1JTkFOQ0UpICYmICh2aWRlb0NvbXAgIT0gT01YX1ZDX0NIUk9NSU5BTkNFKSksIE9NWF9TdHNfQmFkQXJnRXJyKTsKLSAgICAKLSAgICAvKiBDYWxjdWxhdGUgdGhlIERDIHNjYWxlciB2YWx1ZSAqLwotICAgIAotICAgIC8qIGxpbmVhciBpbnRyYSBEQyBtb2RlICovCi0gICAgaWYoc2hvcnRWaWRlb0hlYWRlcikKLSAgICB7Ci0gICAgICAgIGRjU2NhbGVyID0gODsKLSAgICB9Ci0gICAgLyogbm9ubGluZWFyIGludHJhIERDIG1vZGUgKi8KLSAgICBlbHNlCi0gICAgewotICAgIAotICAgICAgICBpZiAodmlkZW9Db21wID09IE9NWF9WQ19MVU1JTkFOQ0UpCi0gICAgICAgIHsKLSAgICAgICAgICAgIGlmIChRUCA+PSAxICYmIFFQIDw9IDQpCi0gICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgZGNTY2FsZXIgPSA4OwotICAgICAgICAgICAgfQotICAgICAgICAgICAgZWxzZSBpZiAoUVAgPj0gNSAmJiBRUCA8PSA4KQotICAgICAgICAgICAgewotICAgICAgICAgICAgICAgIGRjU2NhbGVyID0gMiAqIFFQOwotICAgICAgICAgICAgfQotICAgICAgICAgICAgZWxzZSBpZiAoUVAgPj0gOSAmJiBRUCA8PSAyNCkKLSAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICBkY1NjYWxlciA9IFFQICsgODsKLSAgICAgICAgICAgIH0KLSAgICAgICAgICAgIGVsc2UKLSAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICBkY1NjYWxlciA9ICgyICogUVApIC0gMTY7Ci0gICAgICAgICAgICB9Ci0gICAgICAgIH0KLQotICAgICAgICBlbHNlIGlmICh2aWRlb0NvbXAgPT0gT01YX1ZDX0NIUk9NSU5BTkNFKQotICAgICAgICB7Ci0gICAgICAgICAgICBpZiAoUVAgPj0gMSAmJiBRUCA8PSA0KQotICAgICAgICAgICAgewotICAgICAgICAgICAgICAgIGRjU2NhbGVyID0gODsKLSAgICAgICAgICAgIH0KLSAgICAgICAgICAgIGVsc2UgaWYgKFFQID49IDUgJiYgUVAgPD0gMjQpCi0gICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgZGNTY2FsZXIgPSAoUVAgKyAxMykvMjsKLSAgICAgICAgICAgIH0KLSAgICAgICAgICAgIGVsc2UKLSAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICBkY1NjYWxlciA9IFFQIC0gNjsKLSAgICAgICAgICAgIH0KLSAgICAgICAgfQotICAgIH0KLSAgICAvKiBEZXF1YW50IHRoZSBEQyB2YWx1ZSwgdGhpcyBhcHBsaWVzIHRvIGJvdGggdGhlIG1ldGhvZHMgKi8KLSAgICBwU3JjRHN0WzBdID0gcFNyY0RzdFswXSAqIGRjU2NhbGVyOwotCi0gICAgLyogU2F0dXJhdGUgKi8KLSAgICBwU3JjRHN0WzBdID0gYXJtQ2xpcCAoLTIwNDgsIDIwNDcsIHBTcmNEc3RbMF0pOwotCi0gICAgLyogU2Vjb25kIEludmVyc2UgcXVhbnRpc2F0aW9uIG1ldGhvZCAqLwotICAgIGZvciAoY29lZmZDb3VudCA9IDE7IGNvZWZmQ291bnQgPCA2NDsgY29lZmZDb3VudCsrKQotICAgIHsKLSAgICAgICAgLyogY2hlY2sgc2lnbiAqLwotICAgICAgICBTaWduID0gIGFybVNpZ25DaGVjayAocFNyY0RzdFtjb2VmZkNvdW50XSk7ICAKLQotICAgICAgICBpZiAoUVAgJiAweDEpCi0gICAgICAgIHsKLSAgICAgICAgICA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0aW9uIGRpc2FibGVkKSwgT01YX1ZDX0hPUklaT05UQUwsIG9yIAotICogICAgICAgICAgICBPTVhfVkNfVkVSVElDQUwuICBUaGUgZW50cmllcyAKLSAqICAgICAgICAgICAgcFByZUFDUHJlZGljdFsxXS1wUHJlQUNQcmVkaWN0WzddY29udGFpbiBwcmVkaWN0ZWQgQUMgCi0gKiAgICAgICAgICAgIGNvZWZmaWNpZW50cy4gIElmIHByZWRpY3Rpb24gaXMgZGlzYWJsZWQgKCpwU3VtRXJyPDApIHRoZW4gdGhlIAotICogICAgICAgICAgICBjb250ZW50cyBvZiB0aGlzIGJ1ZmZlciBhcmUgdW5kZWZpbmVkIHVwb24gcmV0dXJuIGZyb20gdGhlIAotICogICAgICAgICAgICBmdW5jdGlvbiAKLSAqICAgcFN1bUVyciAtIHBvaW50ZXIgdG8gdGhlIHZhbHVlIG9mIHRoZSBhY2N1bXVsYXRlZCBBQyBjb2VmZmljaWVudCBlcnJvcnMsIAotICogICAgICAgICAgICBpLmUuLCBzdW0gb2YgdGhlIGFic29sdXRlIGRpZmZlcmVuY2VzIGJldHdlZW4gcHJlZGljdGVkIGFuZCAKLSAqICAgICAgICAgICAgdW5wcmVkaWN0ZWQgQUMgY29lZmZpY2llbnRzIAotICoKLSAqIFJldHVybiBWYWx1ZToKLSAqICAgIAotICogICAgT01YX1N0c19Ob0VyciAtIG5vIGVycm9yIAotICogICAgT01YX1N0c19CYWRBcmdFcnIgLSBCYWQgYXJndW1lbnRzOgotICogICAgLSAgICBBdCBsZWFzdCBvbmUgb2YgdGhlIGZvbGxvd2luZyBwb2ludGVycyBpcyBOVUxMOiBwU3JjLCBwRHN0LCBwUmVjLCAKLSAqICAgICAgICAgcENvZWZCdWZSb3csIHBDb2VmQnVmQ29sLCBwUXBCdWYsIHBQcmVBQ1ByZWRpY3QsIHBTdW1FcnIuIAotICogICAgLSAgICBibG9ja0luZGV4IDwgMCBvciBibG9ja0luZGV4ID49IDEwOyAKLSAqICAgIC0gICAgY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sCi0gICAgICAgICZwcmVkUVAsCi0gICAgICAgIHBRcEJ1Zik7Ci0KLSAgICBhcm1SZXREYXRhRXJySWYoKChwcmVkUVAgPD0gMCkgfHwgKHByZWRRUCA+PSAzMikpLCBPTVhfU3RzX0JhZEFyZ0Vycik7Ci0KLSAgICBmbGFnID0gMTsKLSAgICBpZiAoKnBTdW1FcnIgPCAwKQotICAgIHsKLSAgICAgICAgQUNQcmVkRmxhZyA9IDA7Ci0gICAgfQotICAgIGVsc2UKLSAgICB7Ci0gICAgICAgIEFDUHJlZEZsYWcgPSAxOwotICAgIH0KLQotICAgIGFybVZDTTRQMl9BQ0RDUHJlZGljdCgKLSAgICAgICAgcFRlbXBCdWYyLAotICAgICAgICBwUHJlQUNQcmVkaWN0LAotICAgICAgICBwUHJlZEJ1ZlJvdywKLSAgICAgICAgcFByZWRCdWZDb2wsCi0gICAgICAgIGN1clFwLAotICAgICAgICBwcmVkUVAsCi0gICAgICAgIHByZWREaXIsCi0gICAgICAgIEFDUHJlZEZsYWcsCi0gICAgICAgIHZpZGVvQ29tcCwKLSAgICAgICAgZmxhZywKLSAgICAgICAgcFN1bUVycik7Ci0KLSAgICAvKiBSZWNvbnN0cnVjdGluZyB0aGUgdGV4dHVyZSBkYXRhICovCi0gICAgb214VkNNNFAyX1F1YW50SW52SW50cmFfSSgKLSAgICAgICAgcFRlbXBCdWYxLAotICAgICAgICBjdXJRcCwKLSAgICAgICAgdmlkZW9Db21wLAotICAgICAgICBzaG9ydFZpZGVvSGVhZGVyKTsKLSAgICBvbXhWQ000UDJfSURDVDh4OGJsayAocFRlbXBCdWYxLCBwVGVtcEJ1ZjMpOwotICAgIGZvcihjb3VudCA9IDA7IGNvdW50IDwgNjQ7IGNvdW50KyspCi0gICAgewotICAgICAgICBwUmVjW2NvdW50XSA9IGFybU1heCgwLHBUZW1wQnVmM1tjb3VudF0pOwotICAgIH0KLQotICAgIHJldHVybiBPTVhfU3RzX05vRXJyOwotfQotCi0vKiBFbmQgb2Y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otICAgICAgICAgICAgbWF4TnVtUGljcyA9ICh1MzIpYXRvaShhcmd2W2ldKzIpOwotICAgICAgICB9Ci0gICAgICAgIGVsc2UgaWYgKCBzdHJuY21wKGFyZ3ZbaV0sICItTyIsIDIpID09IDAgKQotICAgICAgICB7Ci0gICAgICAgICAgICBzdHJjcHkob3V0RmlsZU5hbWUsIGFyZ3ZbaV0rMik7Ci0gICAgICAgIH0KLSAgICAgICAgZWxzZSBpZiAoIHN0cmNtcChhcmd2W2ldLCAiLVAiKSA9PSAwICkKLSAgICAgICAgewotICAgICAgICAgICAgcGFja2V0aXplID0gMTsKLSAgICAgICAgfQotICAgICAgICBlbHNlIGlmICggc3RyY21wKGFyZ3ZbaV0sICItVSIpID09IDAgKQotICAgICAgICB7Ci0gICAgICAgICAgICBuYWxVbml0U3RyZWFtID0gMTsKLSAgICAgICAgfQotICAgICAgICBlbHNlIGlmICggc3RyY21wKGFyZ3ZbaV0sICItQyIpID09IDAgKQotICAgICAgICB7Ci0gICAgICAgICAgICBjcm9wRGlzcGxheSA9IDE7Ci0gICAgICAgIH0KLSAgICAgICAgZWxzZSBpZiAoIHN0cmNtcChhcmd2W2ldLCAiLVIiKSA9PSAwICkKLSAgICAgICAgewotICAgICAgICAgICAgZGlzYWJsZU91dHB1dFJlb3JkZXJpbmcgPSAxOwotICAgICAgICB9Ci0gICAgfQotCi0gICAgLyogb3BlbiBpbnB1dCBmaWxlIGZvciByZWFkaW5nLCBmaWxlIG5hbWUgZ2l2ZW4gYnkgdXNlci4gSWYgZmlsZSBvcGVuCi0gICAgICogZmFpbHMgLT4gZXhpdCAqLwotICAgIGZpbnB1dCA9IGZvcGVuKGFyZ3ZbYXJnYy0xXSwicmIiKTsKLSAgICBpZiAoZmlucHV0ID09IE5VTEwpCi0gICAgewotICAgICAgICBERUJVRygoIlVOQUJMRSBUTyBPUEVOIElOUFVUIEZJTEVcbiIpKTsKLSAgICAgICAgcmV0dXJuIC0xOwotICAgIH0KLQotICAgIC8qIGN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YW0gaGVhZGVycyB3ZXJlIHN1Y2Nlc3NmdWxseSBkZWNvZGVkCi0gICAgICAgICAgICAgICAgICogLT4gc3RyZWFtIGluZm9ybWF0aW9uIGlzIGF2YWlsYWJsZSBmb3IgcXVlcnkgbm93ICovCi0KLSAgICAgICAgICAgICAgICByZXQgPSBIMjY0U3dEZWNHZXRJbmZvKGRlY0luc3QsICZkZWNJbmZvKTsKLSAgICAgICAgICAgICAgICBpZiAocmV0ICE9IEgyNjRTV0RFQ19PSykKLSAgICAgICAgICAgICAgICAgICAgcmV0dXJuIC0xOwotCi0gICAgICAgICAgICAgICAgREVCVUcoKCJQcm9maWxlICVkXG4iLCBkZWNJbmZvLnByb2ZpbGUpKTsKLQotICAgICAgICAgICAgICAgIERFQlVHKCgiV2lkdGggJWQgSGVpZ2h0ICVkXG4iLAotICAgICAgICAgICAgICAgICAgICBkZWNJbmZvLnBpY1dpZHRoLCBkZWNJbmZvLnBpY0hlaWdodCkpOwotCi0gICAgICAgICAgICAgICAgaWYgKGNyb3BEaXNwbGF5ICYmIGRlY0luZm8uY3JvcHBpbmdGbGFnKQotICAgICAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAgICAgREVCVUcoKCJDcm9wcGluZyBwYXJhbXM6ICglZCwgJWQpICVkeCVkXG4iLAotICAgICAgICAgICAgICAgICAgICAgICAgZGVjSW5mby5jcm9wUGFyYW1zLmNyb3BMZWZ0T2Zmc2V0LAotICAgICAgICAgICAgICAgICAgICAgICAgZGVjSW5mby5jcm9wUGFyYW1zLmNyb3BUb3BPZmZzZXQsCi0gICAgICAgICAgICAgICAgICAgICAgICBkZWNJbmZvLmNyb3BQYXJhbXMuY3JvcE91dFdpZHRoLAotICAgICAgICAgICAgICAgICAgICAgICAgZGVjSW5mby5jcm9wUGFyYW1zLmNyb3BPdXRIZWlnaHQpKTsKLQotICAgICAgICAgICAgICAgICAgICAvKiBDcm9wcGVkIGZyYW1lIHNpemUgaW4gcGxhbmFyIFlVViA0OjI6MCAqLwotICAgICAgICAgICAgICAgICAgICBwaWNTaXplID0gZGVjSW5mby5jcm9wUGFyYW1zLmNyb3BPdXRXaWR0aCAqCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICBkZWNJbmZvLmNyb3BQYXJhbXMuY3JvcE91dEhlaWdodDsKLSAgICAgICAgICAgICAgICAgICAgcGljU2l6ZSA9ICgzICogcGljU2l6ZSkvMjsKLSAgICAgICAgICAgICAgICAgICAgdG1wSW1hZ2UgPSBtYWxsb2MocGljU2l6ZSk7Ci0gICAgICAgICAgICAgICAgICAgIGlmICh0bXBJbWFnZSA9PSBOVUxMKQotICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIC0xOwotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICBlbHNlCi0gICAgICAgICAgICAgICAgewotICAgICAgICAgICAgICAgICAgICAvKiBEZWNvZGVyIG91dHB1dCBmcmFtZSBzaXplIGluIHBsYW5hciBZVVYgNDoyOjAgKi8KLSAgICAgICAgICAgICAgICAgICAgcGljU2l6ZSA9IGRlY0luZm8ucGljV2lkdGggKiBkZWNJbmZvLnBpY0hlaWdodDsKLSAgICAgICAgICAgICAgICAgICAgcGljU2l6ZSA9ICgzICogcGljU2l6ZSkvMjsKLSAgICAgICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgICAgICBERUJVRygoInZpZGVvUmFuZ2UgJWQsIG1hdHJpeENvZWZmaWNpZW50cyAlZFxuIiwKLSAgICAgICAgICAgICAgICAgICAgZGVjSW5mby52aWRlb1JhbmdlLCBkZWNJbmZvLm1hdHJpeENvZWZmaWNpZW50cykpOwotCi0gICAgICAgICAgICAgICAgLyogdXBkYXRlIEgyNjRTd0RlY0RlY29kZSgpIGlucHV0IHN0cnVjdHVyZSwgbnVtYmVyIG9mIGJ5dGVzCi0gICAgICAgICAgICAgICAgICogImNvbnN1bWVkIiBpcyBjb21wdXRlZCBhcyBkaWZmZXJlbmNlIGJldHdlZW4gdGhlIG5ldyBzdH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AgICAgICAgICAgICBkZWNJbnB1dC5kYXRhTGVuIC09Ci0gICAgICAgICAgICAgICAgICAgICh1MzIpKGRlY091dHB1dC5wU3RybUN1cnJQb3MgLSBkZWNJbnB1dC5wU3RyZWFtKTsKLSAgICAgICAgICAgICAgICBkZWNJbnB1dC5wU3RyZWFtID0gZGVjT3V0cHV0LnBTdHJtQ3VyclBvczsKLSAgICAgICAgICAgICAgICAvKiBmYWxsIHRocm91Z2ggKi8KLQotICAgICAgICAgICAgY2FzZSBIMjY0U1dERUNfUElDX1JEWToKLQotICAgICAgICAgICAgICAgIC8qbGludCAtZXN5bSg2NDQsdG1wSW1hZ2UscGljU2l6ZSkgdmFyaWFibGUgaW5pdGlhbGl6ZWQgYXQKLSAgICAgICAgICAgICAgICAgKiBIMjY0U1dERUNfSERSU19SRFlfQlVGRl9OT1RfRU1QVFkgY2FzZSAqLwotCi0gICAgICAgICAgICAgICAgaWYgKHJldCA9PSBIMjY0U1dERUNfUElDX1JEWSkKLSAgICAgICAgICAgICAgICAgICAgZGVjSW5wdXQuZGF0YUxlbiA9IE5leHRQYWNrZXQoJmRlY0lucHV0LnBTdHJlYW0pOwotCi0gICAgICAgICAgICAgICAgLyogSWYgZW5vdWdoIHBpY3R1cmVzIGRlY29kZWQgLT4gZm9yY2UgZGVjb2RpbmcgdG8gZW5kCi0gICAgICAgICAgICAgICAgICogYnkgc2V0dGluZyB0aGF0IG5vIG1vcmUgc3RyZWFtIGlzIGF2YWlsYWJsZSAqLwotICAgICAgICAgICAgICAgIGlmIChtYXhOdW1QaWNzICYmIHBpY0RlY29kZU51bWJlciA9PSBtYXhOdW1QaWNzKQotICAgICAgICAgICAgICAgICAgICBkZWNJbnB1dC5kYXRhTGVuID0gMDsKLQotICAgICAgICAgICAgICAgIC8qIEluY3JlbWVudCBkZWNvZGluZyBudW1iZXIgZm9yIGV2ZXJ5IGRlY29kZWQgcGljdHVyZSAqLwotICAgICAgICAgICAgICAgIHBpY0RlY29kZU51bWJlcisrOwotCi0gICAgICAgICAgICAgICAgLyogdXNlIGZ1bmN0aW9uIEgyNjRTd0RlY05leHRQaWN0dXJlKCkgdG8gb2J0YWluIG5leHQgcGljdHVyZQotICAgICAgICAgICAgICAgICAqIGluIGRpc3BsYXkgb3JkZXIuIEZ1bmN0aW9uIGlzIGNhbGxlZCB1bnRpbCBubyBtb3JlIGltYWdlcwotICAgICAgICAgICAgICAgICAqIGFyZSByZWFkeSBmb3IgZGlzcGxheSAqLwotICAgICAgICAgICAgICAgIHdoaWxlICggSDI2NFN3RGVjTmV4dFBpY3R1cmUoZGVjSW5zdCwgJmRlY1BpY3R1cmUsIDApID09Ci0gICAgICAgICAgICAgICAgICAgICAgICBIMjY0U1dERUNfUElDX1JEWSApCi0gICAgICAgICAgICAgICAgewotICAgICAgICAgICAgICAgICAgICBERUJVRygoIlBJQyAlZCwgdHlwZSAlcyIsIHBpY0Rpc3BsYXlOdW1iZXIsCi0gICAgICAgICAgICAgICAgICAgICAgICBkZWNQaWN0dXJlLmlzSWRyUGljdHVyZSA/ICJJRFIiIDogIk5PTi1JRFIiKSk7Ci0gICAgICAgICAgICAgICAgICAgIGlmIChwaWNEaXNwbGF5TnVtYmVyICE9IGRlY1BpY3R1cmUucGljSWQpCi0gICAgICAgICAgICAgICAgICAgICAgICBERUJVRygoIiwgZGVjb2RlZCBwaWMgJWQiLCBkZWNQaWN0dXJlLnBpY0lkKSk7Ci0gICAgICAgICAgICAgICAgICAgIGlmIChkZWNQaWN0dXJlLm5ick9mRXJyTUJzKQotICAgICAgICAgICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgICAgICAgICBERUJVRygoIiwgY29uY2VhbGVkICVkXG4iLCBkZWNQaWN0dXJlLm5ick9mRXJyTUJzKSk7Ci0gICAgICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICAgICAgZWxzZQotICAgICAgICAgICAgICAgICAgICAgICAgREVCVUcoKCJcbiIpKTsKLSAgICAgICAgICAgICAgICAgICAgZmZsdXNoKHN0ZG91dCk7Ci0KLSAgICAgICAgICAgICAgICAgICAgbnVtRXJyb3JzICs9IGRlY1BpY3R1cmUubmJyT2ZFcnJNQnM7Ci0KLSAgICAgICAgICAgICAgICAgICAgLyogSW5jcmVtZW50IGRpc3BsYXkgbnVtYmVyIGZvciBldmVyeSBkaXNwbGF5ZWQgcGljdHVyZSAqLwotICAgICAgICAgICAgICAgICAgICBwaWNEaXNwbGF5TnVtYmVyKys7Ci0KLSAgICAgICAgICAgICAgICAgICAgLypsaW50IC1lc3ltKDY0NCxkZWNJbmZvKSBhbHdheXMgaW5pdGlhbGl6ZWQgaWYgcGljdHVyZXMKLSAgICAgICAgICAgICAgICAgICAgICogYXZhaWxhYmxlIGZvciBkaXNwbGF5ICovCi0KLSAgICAgICAgICAgICAgICAgICAgLyogV3JpdGUgb3V0cHV0IHBpY3R1cmUgdG8gZmlsZSAqLwotICAgICAgICAgICAgICAgICAgICBpbWFnZURhdGEgPSAodTgqKWRlY1BpY3R1cmUucE91dHB1dFBpY3R1cmU7Ci0gICAgICAgICAgICAgICAgICAgIGlmIChjcm9wRGlzcGxheSAmJiBkZWNJbmZvLmNyb3BwaW5nRmxhZykKLSAgICAgICAgICAgICAgICAgICAgewotICAgICAgICAgICAgICAgICAgICAgICAgdG1wID0gQ3JvcFBpY3R1cmUodG1wSW1hZ2UsIGltYWdlRGF0YSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBkZWNJbmZvLnBpY1dpZHRoLCBkZWNJbmZvLnBpY0hlaWdodCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAmZGVjSW5mby5jcm9wUGFyYW1zKTsKLSAgICAgICAgICAgICAgICAgICAgICAgIGlmICh0bXApCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIC0xOwotICAgICAgICAgICAgICAgICAgICAgICAgV3JpdGVPdXRwdXQob3V0RmlsZU5hbWUsIHRtcEltYWdlLCBwaWNTaXplKTsKLSAgICAgICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgICAgICBlbHNlCi0gICAgICAgICAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAgICAgICAgIFdyaXRlT3V0cHV0KG91dEZpbGVOYW1lLCBpbWFnZURhdGEsIHBpY1NpemUpOwotICAgICAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgfQotCi0gICAgICAgICAgICAgICAgYnJlYWs7Ci0KLSAgICAgICAgICAgIGNhc2UgSDI2NFNXREVDX1NUUk1fUFJPQ0VTU0VEOgotICAgICAgICAgICAgY2FzZSBIMjY0U1dERUNfU1RSTV9FUlI6Ci0gICAgICAgICAgICAgICAgLyogSW5wdXQgc3RyZWFtIHdhcyBkZWNvZGVkIGJ1dCBubyBwaWN0dXJlIGlzIHJlYWR5Ci0gICAgICAgICAgICAgICAgICogLT4gR2V0IG1vcmUgZGF0YSAqLwotICAgICAgICAgICAgICAgIGRlY0lucHV0LmRhdGFMZW4gPSBOZXh0UGFja2V0KCZkZWNJbnB1dC5wU3RyZWFtKTsKLSAgICAgICAgICAgICAgICBicmVhazsKLQotICAgICAgICAgICAgZGVmYXVsdDoKLSAgICAgICAgICAgICAgICBERUJVRygoIkZBVEFMIEVSUk9SXG4iKSk7Ci0gICAgICAgICAgICAgICAgcmV0dXJuIC0xOwotCi0gICAgICAgIH0KLSAgICAvKiBrZWVwIGRlY29kaW5nIHVudGlsIGFsbCBkYXRhIGZyb20gaW5wdXQgc3RyZWFtIGJ1ZmZlciBjb25zdW1lZCAqLwotICAgIH0gd2hpbGUgKGRlY0lucHV0LmRhdGFMZW4gPiAwKTsKLQotICAgIC8qIGlmIG91dHB1dCBpbiBkaXNwbGF5IG9yZGVyIGlzIHByZWZlcnJlZCwgdGhlIGRlY29kZXIgc2hhbGwgYmUgZm9yY2VkCi0gICAgICogdG8gb3V0cHV0IHBpY3R1cmVzIHJlbWFpbmluZyBpbiBkZWNvZGVkIHBpY3R1cmUgYnVmZmVyLiBVc2UgZnVuY3Rpb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ci0KLSAgICAvKiBsZWFkaW5nIHplcm9zIG9mIGZpcnN0IE5BTCB1bml0ICovCi0gICAgZG8KLSAgICB7Ci0gICAgICAgIGJ5dGUgPSBzdHJlYW1baW5kZXgrK107Ci0gICAgfSB3aGlsZSAoYnl0ZSAhPSAxICYmIGluZGV4IDwgbWF4SW5kZXgpOwotCi0gICAgLyogaW52YWxpZCBzdGFydCBjb2RlIHByZWZpeCAqLwotICAgIGlmIChpbmRleCA9PSBtYXhJbmRleCB8fCBpbmRleCA8IDMpCi0gICAgewotICAgICAgICBERUJVRygoIklOVkFMSUQgQllURSBTVFJFQU1cbiIpKTsKLSAgICAgICAgZXhpdCgxMDApOwotICAgIH0KLQotICAgIC8qIG5hbFVuaXRTdHJlYW0gaXMgd2l0aG91dCBzdGFydCBjb2RlIHByZWZpeCAqLwotICAgIGlmIChuYWxVbml0U3RyZWFtKQotICAgIHsKLSAgICAgICAgc3RyZWFtICs9IGluZGV4OwotICAgICAgICBtYXhJbmRleCAtPSBpbmRleDsKLSAgICAgICAgaW5kZXggPSAwOwotICAgIH0KLQotICAgIHplcm9Db3VudCA9IDA7Ci0KLSAgICAvKiBTZWFyY2ggc3RyZWFtIGZvciBuZXh0IHN0YXJ0IGNvZGUgcHJlZml4ICovCi0gICAgLypsaW50IC1lKDcxNikgd2hpbGUoMSkgdXNlZCBjb25zY2lvdXNseSAqLwotICAgIHdoaWxlICgxKQotICAgIHsKLSAgICAgICAgYnl0ZSA9IHN0cmVhbVtpbmRleCsrXTsKLSAgICAgICAgaWYgKCFieXRlKQotICAgICAgICAgICAgemVyb0NvdW50Kys7Ci0KLSAgICAgICAgaWYgKCAoYnl0ZSA9PSAweDAxKSAmJiAoemVyb0NvdW50ID49IDIpICkKLSAgICAgICAgewotICAgICAgICAgICAgLyogU3RhcnQgY29kZSBwcmVmaXggaGFzIHR3byB6ZXJvcwotICAgICAgICAgICAgICogVGhpcmQgemVybyBpcyBhc3N1bWVkIHRvIGJlIGxlYWRpbmcgemVybyBvZiBuZXh0IHBhY2tldAotICAgICAgICAgICAgICogRm91cnRoIGFuZCBtb3JlIHplcm9zIGFyZSBhc3N1bWVkIHRvIGJlIHRyYWlsaW5nIHplcm9zIG9mIHRoaXMKLSAgICAgICAgICAgICAqIHBhY2tldCAqLwotICAgICAgICAgICAgaWYgKHplcm9Db3VudCA+IDMpCi0gICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgaW5kZXggLT0gNDsKLSAgICAgICAgICAgICAgICB6ZXJvQ291bnQgLT0gMzsKLSAgICAgICAgICAgIH0KLSAgICAgICAgICAgIGVsc2UKLSAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICBpbmRleCAtPSB6ZXJvQ291bnQrMTsKLSAgICAgICAgICAgICAgICB6ZXJvQ291bnQgPSAwOwotICAgICAgICAgICAgfQotICAgICAgICAgICAgYnJlYWs7Ci0gICAgICAgIH0KLSAgICAgICAgZWxzZSBpZiAoYnl0ZSkKLSAgICAgICAgICAgIHplcm9Db3VudCA9IDA7Ci0KLSAgICAgICAgaWYgKGluZGV4ID09IG1heEluZGV4KQotICAgICAgICB7Ci0gICAgICAgICAgICBicmVhazsKLSAgICAgICAgfQotCi0gICAgfQotCi0gICAgLyogU3RvcmUgcG9pbnRlciB0byB0aGUgYmVnaW5uaW5nIG9mIHRoZSBwYWNrZXQgKi8KLSAgICAqcFN0cm0gPSBzdHJlYW07Ci0gICAgcHJldkluZGV4ID0gaW5kZXg7Ci0KLSAgICAvKiBuYWxVbml0U3RyZWFtIGlzIHdpdGhvdXQgdHJhaWxpbmcgemVyb3MgKi8KLSAgICBpZiAobmFsVW5pdFN0cmVhbSkKLSAgICAgICAgaW5kZXggLT0gemVyb0NvdW50OwotCi0gICAgcmV0dXJuKGluZGV4KTsKLQotfQotCi0vKi0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLQot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ljdHVyZSBkaW1lbnNpb25zIGFyZSBhdmFpbGFibGUgZm9yIHF1ZXJ5IG5vdyAqLwotICAgICAgICAgICAgICAgIHJldCA9IEgyNjRTd0RlY0dldEluZm8oZGVjSW5zdCwgJmRlY0luZm8pOwotICAgICAgICAgICAgICAgIGlmIChyZXQgIT0gSDI2NFNXREVDX09LKQotICAgICAgICAgICAgICAgICAgICByZXR1cm4gLTE7Ci0KLSAgICAgICAgICAgICAgICAvKiBwaWN0dXJlIHNpemUgaW4gcGl4ZWxzICovCi0gICAgICAgICAgICAgICAgcGljU2l6ZSA9IGRlY0luZm8ucGljV2lkdGggKiBkZWNJbmZvLnBpY0hlaWdodDsKLSAgICAgICAgICAgICAgICAvKiBtZW1vcnkgbmVlZGVkIGZvciBZQ2JDciA0OjI6MCBwaWN0dXJlIGluIGJ5dGVzICovCi0gICAgICAgICAgICAgICAgcGljU2l6ZSA9ICgzICogcGljU2l6ZSkvMjsKLSAgICAgICAgICAgICAgICAvKiBtZW1vcnkgbmVlZGVkIGZvciAxNi1iaXQgUkdCIHBpY3R1cmUgaW4gYnl0ZXMKLSAgICAgICAgICAgICAgICAgKiBwaWNTaXplID0gKGRlY0luZm8ucGljV2lkdGggKiBkZWNJbmZvLnBpY0hlaWdodCkgKiAyOyAqLwotCi0gICAgICAgICAgICAgICAgcHJpbnRmKCJXaWR0aCAlZCBIZWlnaHQgJWRcbiIsCi0gICAgICAgICAgICAgICAgICAgIGRlY0luZm8ucGljV2lkdGgsIGRlY0luZm8ucGljSGVpZ2h0KTsKLQotICAgICAgICAgICAgICAgIC8qIHVwZGF0ZSBIMjY0U3dEZWNEZWNvZGUoKSBpbnB1dCBzdHJ1Y3R1cmUsIG51bWJlciBvZiBieXRlcwotICAgICAgICAgICAgICAgICAqICJjb25zdW1lZCIgaXMgY29tcHV0ZWQgYXMgZGlmZmVyZW5jZSBiZXR3ZWVuIHRoZSBuZXcgc3RyZWFtCi0gICAgICAgICAgICAgICAgICogcG9pbnRlciBhbm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bWFnZXMKLSAgICAgICAgICAgICAgICAgKiBhcmUgcmVhZHkgZm9yIGRpc3BsYXkgKi8KLSAgICAgICAgICAgICAgICB3aGlsZSAoSDI2NFN3RGVjTmV4dFBpY3R1cmUoZGVjSW5zdCwgJmRlY1BpY3R1cmUsIDApID09Ci0gICAgICAgICAgICAgICAgICAgIEgyNjRTV0RFQ19QSUNfUkRZKSB7IHBpY051bWJlcisrOwotCi0gICAgICAgICAgICAgICAgICAgIHByaW50ZigiUElDICVkLCB0eXBlICVzLCBjb25jZWFsZWQgJWRcbiIsIHBpY051bWJlciwKLSAgICAgICAgICAgICAgICAgICAgICAgIGRlY1BpY3R1cmUuaXNJZHJQaWN0dXJlID8gIklEUiIgOiAiTk9OLUlEUiIsCi0gICAgICAgICAgICAgICAgICAgICAgICBkZWNQaWN0dXJlLm5ick9mRXJyTUJzKTsKLSAgICAgICAgICAgICAgICAgICAgZmZsdXNoKHN0ZG91dCk7Ci0KLSAgICAgICAgICAgICAgICAgICAgLyogRG8gY29sb3IgY29udmVyc2lvbiBpZiBuZWVkZWQgdG8gZ2V0IGRpc3BsYXkgaW1hZ2UKLSAgICAgICAgICAgICAgICAgICAgICogaW4gUkdCLWZvcm1hdAotICAgICAgICAgICAgICAgICAgICAgKgotICAgICAgICAgICAgICAgICAgICAgKiBZdXZUb1JnYiggZGVjUGljdHVyZS5wT3V0cHV0UGljdHVyZSwgcFJnYlBpY3R1cmUgKTsgKi8KLQotICAgICAgICAgICAgICAgICAgICAvKiB3cml0ZSBuZXh0IGRpc3BsYXkgaW1hZ2UgdG8gb3V0cHV0IGZpbGUgKi8KLSAgICAgICAgICAgICAgICAgICAgV3JpdGVPdXRwdXQoZm91dHB1dCwgKHU4KilkZWNQaWN0dXJlLnBPdXRwdXRQaWN0dXJlLAotICAgICAgICAgICAgICAgICAgICAgICAgcGljU2l6ZSk7Ci0gICAgICAgICAgICAgICAgfQotCi0gICAgICAgICAgICAgICAgYnJlYWs7Ci0KLSAgICAgICAgICA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gICAgZGVjSW5zdCAgICAgZGVjb2RlciBpbnN0YW5jZQotICAgICAgICAgICAgcElucHV0ICAgICAgcG9pbnRlciB0byBpbnB1dCBzdHJ1Y3QKLQotICAgICAgICBPdXRwdXRzOgotICAgICAgICAgICAgcE91dHB1dCAgICAgcG9pbnRlciB0byBvdXRwdXQgc3RydWN0Ci0KLSAgICAgICAgUmV0dXJuczoKLSAgICAgICAgICAgIEgyNjRTV0RFQ19OT1RfSU5JVElBTElaRUQgICBkZWNvZGVyIGluc3RhbmNlIG5vdCBpbml0aWFsaXplZCB5ZXQKLSAgICAgICAgICAgIEgyNjRTV0RFQ19QQVJBTV9FUlIgICAgICAgICBpbnZhbGlkIHBhcmFtZXRlcnMKLQotICAgICAgICAgICAgSDI2NFNXREVDX1NUUk1fUFJPQ0VTU0VEICAgIHN0cmVhbSBidWZmZXIgZGVjb2RlZAotICAgICAgICAgICAgSDI2NFNXREVDX0hEUlNfUkRZX0JVRkZfTk9UX0VNUFRZICAgaGVhZGVycyBkZWNvZGVkLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc3RyZWFtIGJ1ZmZlciBub3QgZmluaXNoZWQKLSAgICAgICAgICAgIEgyNjRTV0RFQ19QSUNfUkRZICAgICAgICAgICAgICAgICAgIGRlY29kaW5nIG9mIGEgcGljdHVyZSBmaW5pc2hlZAotICAgICAgICAgICAgSDI2NFNXREVDX1BJQ19SRFlfQlVGRl9OT1RfRU1QVFkgICAgZGVjb2Rpbmcgb2YgYSBwaWN0dXJlIGZpbmlzaGVkLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc3RyZWFtIGJ1ZmZlciBub3QgZmluaXNoZWQKLSAgICAgICAgICAgIEgyNjRTV0RFQ19TVFJNX0VSUiAgICAgICAgICAgICAgICAgIHNlcmlvdXMgZXJyb3IgaW4gZGVjb2RpbmcsIG5vCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgIC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SArPSBudW1SZWFkQnl0ZXM7Ci0gICAgICAgIC8qIGNoZWNrIGlmIHRvbyBtYW55IGJ5dGVzIGFyZSByZWFkIGZyb20gc3RyZWFtICovCi0gICAgICAgIGlmICggKGkzMikoc3RybUxlbiAtIG51bVJlYWRCeXRlcykgPj0gMCApCi0gICAgICAgICAgICBzdHJtTGVuIC09IG51bVJlYWRCeXRlczsKLSAgICAgICAgZWxzZQotICAgICAgICAgICAgc3RybUxlbiA9IDA7Ci0KLSAgICAgICAgcE91dHB1dC0+cFN0cm1DdXJyUG9zID0gdG1wU3RyZWFtOwotCi0gICAgICAgIHN3aXRjaCAoZGVjUmVzdWx0KQotICAgICAgICB7Ci0gICAgICAgICAgICBjYXNlIEgyNjRCU0RfSERSU19SRFk6Ci0KLSAgICAgICAgICAgICAgICBpZihwRGVjQ29udC0+c3RvcmFnZS5kcGItPmZsdXNoZWQgJiYKLSAgICAgICAgICAgICAgICAgICBwRGVjQ29udC0+c3RvcmFnZS5kcGItPm51bU91dCAhPQotICAgICAgICAgICAgICAgICAgIHBEZWNDb250LT5zdG9yYWdlLmRwYi0+b3V0SW5kZXgpCi0gICAgICAgICAgICAgICAgewotICAgICAgICAgICAgICAgICAgICAvKiBvdXRwdXQgZmlyc3QgYWxsIERQQiBzdG9yZWQgcGljdHVyZXMKLSAgICAgICAgICAgICAgICAgICAgICogRFBCIGZsdXNoIGNhdXNlZCBieSBuZXcgU1BTICovCi0gICAgICAgICAgICAgICAgICAgIHBEZWNDb250LT5zdG9yYWdlLmRwYi0+Zmx1c2hlZCA9IDA7Ci0gICAgICAgICAgICAgICAgICAgIHBEZWNDb250LT5kZWNTdGF0ID0gTkVXX0hFQURFUlM7Ci0gICAgICAgICAgICAgICAgICAgIHJldHVyblZhbHVlID0gSDI2NFNXREVDX1BJQ19SRFlfQlVGRl9OT1RfRU1QVFk7Ci0gICAgICAgICAgICAgICAgICAgIHN0cm1MZW4gPSAwOwotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICBlbHNlCi0gICAgICAgICAgICAgICAgewotICAgICAgICAgICAgICAgICAgICByZXR1cm5WYWx1ZSA9IEgyNjRTV0RFQ19IRFJTX1JEWV9CVUZGX05PVF9FTVBUWTsKLSAgICAgICAgICAgICAgICAgICAgc3RybUxlbiA9IDA7Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgIGJyZWFrOwotCi0gICAgICAgICAgICBjYXNlIEgyNjRCU0RfUElDX1JEWToKLSAgICAgICAgICAgICAgICBwRGVjQ29udC0+cGljTnVtYmVyKys7Ci0KLSAgICAgICAgICAgICAgICBpZiAoc3RybUxlbiA9PSAwKQotICAgICAgICAgICAgICAgICAgICByZXR1cm5WYWx1ZSA9IEgyNjRTV0RFQ19QSUNfUkRZOwotICAgICAgICAgICAgICAgIGVsc2UKLSAgICAgICAgICAgICAgICAgICAgcmV0dXJuVmFsdWUgPSBIMjY0U1dERUNfUElDX1JEWV9CVUZGX05PVF9FTVBUWTsKLQotICAgICAgICAgICAgICAgIHN0cm1MZW4gPSAwOwotICAgICAgICAgICAgICAgIGJyZWFrOwotCi0gICAgICAgICAgICBjYXNlIEgyNjRCU0RfUEFSQU1fU0VUX0VSUk9SOgotICAgICAgICAgICAgICAgIGlmICggIWgyNjRic2RDaGVja1ZhbGlkUGFyYW1TZXRzKCZwRGVjQ29udC0+c3RvcmFnZSkgJiYKLSAgICAgICAgICAgICAgICAgICAgIHN0cm1MZW4gPT0gMCApCi0gICAgICAgICAgICAgICAgewotICAgICAgICAgICAgICAgICAgICByZXR1cm5WYWx1ZSA9IEgyNjRTV0RFQ19TVFJNX0VSUjsKLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgYnJlYWs7Ci0gICAgICAgICAgICBjYXNlIEgyNjRCU0RfTUVNQUxMT0NfRVJST1I6Ci0gICAgICAgICAgICAgICAgewotICAgICAgICAgICAgICAgICAgICByZXR1cm5WYWx1ZSA9IEgyNjRTV0RFQ19NRU1GQUlMOwotIC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ICAgIG1heE51bVBpY3MgPSAodTMyKWF0b2koYXJndltpXSsyKTsKLSAgICAgICAgICAgIGluc3RDb3VudC0tOwotICAgICAgICB9Ci0gICAgICAgIGVsc2UgaWYgKCBzdHJuY21wKGFyZ3ZbaV0sICItTyIsIDIpID09IDAgKQotICAgICAgICB7Ci0gICAgICAgICAgICBzdHJjcHkob3V0RmlsZU5hbWUsIGFyZ3ZbaV0rMik7Ci0gICAgICAgICAgICBpbnN0Q291bnQtLTsKLSAgICAgICAgfQotICAgICAgICBlbHNlIGlmICggc3RyY21wKGFyZ3ZbaV0sICItQyIpID09IDAgKQotICAgICAgICB7Ci0gICAgICAgICAgICBjcm9wRGlzcGxheSA9IDE7Ci0gICAgICAgICAgICBpbnN0Q291bnQtLTsKLSAgICAgICAgfQotICAgICAgICBlbHNlIGlmICggc3RyY21wKGFyZ3ZbaV0sICItUiIpID09IDAgKQotICAgICAgICB7Ci0gICAgICAgICAgICBkaXNhYmxlT3V0cHV0UmVvcmRlcmluZyA9IDE7Ci0gICAgICAgICAgICBpbnN0Q291bnQtLTsKLSAgICAgICAgfQotICAgIH0KLQotICAgIGlmIChpbnN0Q291bnQgPCAxKQotICAgIHsKLSAgICAgICAgREVCVUcoKCJObyBpbnB1dCBmaWxlc1xuIikpOwotICAgICAgICBleGl0KDEwMCk7Ci0gICAgfQotCi0gICAgLyogYWxsb2NhdGUgbWVtb3J5IGZvciBtdWx0aXBsZSBkZWNvZGVyIGluc3RhbmNlcwotICAgICAqIG9uZSBpbnN0YW5jZSBmb3IgZXZlcnkgc3RyZWFtIGZpbGUgKi8KLSAgICBkZWNvZGVyID0gKERlY29kZXIgKiopbWFsbG9jKHNpemVvZihEZWNvZGVyKikqKHUzMilpbnN0Q291bnQpOwotICAgIGlmIChkZWNvZGVyID09IE5VTEwpCi0gICAgewotICAgICAgICBERUJVRygoIlVuYWJsZSB0byBhbGxvY2F0ZSBtZW1vcnlcbiIpKTsKLSAgICAgICAgZXhpdCgxMDApOwotICAgI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mcmVhZChkZWNvZGVyW2ldLT5ieXRlU3RybVN0YXJ0LCBzaXplb2YodTgpLCBzdHJtTGVuLCBmaW5wdXQpOwotICAgICAgICBmY2xvc2UoZmlucHV0KTsKLQotICAgICAgICAvKiBvcGVuIG91dHB1dCBmaWxlICovCi0gICAgICAgIGlmIChzdHJjbXAob3V0RmlsZU5hbWUsICJub25lIikgIT0gMCkKLSAgICAgICAgewotI2lmIGRlZmluZWQoX05PX09VVCkKLSAgICAgICAgICAgIGRlY29kZXJbaV0tPmZvdXRwdXQgPSBOVUxMOwotI2Vsc2UKLSAgICAgICAgICAgIHNwcmludGYoZGVjb2RlcltpXS0+b3V0RmlsZU5hbWUsICIlcyVpIiwgb3V0RmlsZU5hbWUsIGkpOwotICAgICAgICAgICAgZGVjb2RlcltpXS0+Zm91dHB1dCA9IGZvcGVuKGRlY29kZXJbaV0tPm91dEZpbGVOYW1lLCAid2IiKTsKLSAgICAgICAgICAgIGlmIChkZWNvZGVyW2ldLT5mb3V0cHV0ID09IE5VTEwpCi0gICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgREVCVUcoKCJVbmFibGUgdG8gb3BlbiBvdXRwdXQgZmlsZVxuIikpOwotICAgICAgICAgICAgICAgIGV4aXQoMTAwKTsKLSAgICAgICAgICAgIH0KLSNlbmRpZgotICAgICAgICB9Ci0KLSAgICAgICAgcmV0ID0gSDI2NFN3RGVjSW5pdCgmKGRlY29kZXJbaV0tPmRlY0luc3QpLCBkaXNhYmxlT3V0cHV0UmVvcmRlcmluZyk7Ci0KLSAgICAgICAgaWYgKHJldCAhPSBIMjY0U1dERUNfT0spCi0gICAgICAgIHsKLSAgICAgICAgICAgIERFQlVHKCgiSW5pdCBmYWlsZWQgJWRcbiIsIHJldCkpOwotICAgICAgICAgICAgZXhpdCgxMDApOwotICAgICAgICB9Ci0KLSAgICAgICAgZGVjb2RlcltpXS0+ZGVjSW5wdXQucFN0cmVhbSA9IGRlY29kZXJbaV0tPmJ5dGVTdHJtU3RhcnQ7Ci0gICAgICAgIGRlY29kZXJbaV0tPmRlY0lucHV0LmRhdGFMZW4gPSBzdHJtTGVuOwotICAgICAgICBkZWNvZGVyW2ldLT5kZWNJbnB1dC5pbnRyYUNvbmNlYWxtZW50TWV0aG9kID0gMDsKLQotICAgIH0KLQotICAgIC8qIG1haW4gZGVjb2RpbmcgbG9vcCAqLwotICAgIGRvCi0gICAgewotICAgICAgICAvKiBkZWNvZGUgb25jZSB1c2luZyBlYWNoIGluc3RhbmNlICovCi0gICAgICAgIGZvciAoaSA9IDA7IGkgPCBpbnN0Q291bnQ7IGkrKykKLSAgICAgICAgewotICAgICAgICAgICAgcmV0ID0gSDI2NFN3RGVjRGVjb2RlKGRlY29kZXJbaV0tPmRlY0luc3QsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICYoZGVjb2RlcltpXS0+ZGVjSW5wdXQpLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmKGRlY29kZXJbaV0tPmRlY091dHB1dCkpOwotCi0gICAgICAgICAgICBzd2l0Y2gocmV0KQotICAgICAgICAgICAgewotCi0gICAgICAgICAgICAgICAgY2FzZSBIMjY0U1dERUNfSERSU19SRFlfQlVGRl9OT1RfRU1QVFk6Ci0KLSAgICAgICAgICAgICAgICAgICAgcmV0ID0gSDI2NFN3RGVjR2V0SW5mbyhkZWNvZGVyW2ldLT5kZWNJbnN0LAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICYoZGVjb2RlcltpXS0+ZGVjSW5mbykpOwotICAgICAgICAgICAgICAgICAgICBpZiAocmV0ICE9IEgyNjRTV0RFQ19PSykKLSAgICAgICAgICAgICAgICAgICAgICAgIGV4aXQoMSk7Ci0KLSAgICAgICAgICAgICAgICAgICAgaWYgKGNyb3BEaXNwbGF5ICYmIGRlY29kZXJbaV0tPmRlY0luZm8uY3JvcHBpbmdGbGFnKQotICAgICAgICAgICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgICAgICAgICBERUJVRygoIkRlY29kZXJbJWRdIENyb3BwaW5nIHBhcmFtczogKCVkLCAlZCkgJWR4JWRcbiIsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgaSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBkZWNvZGVyW2ldLT5kZWNJbmZvLmNyb3BQYXJhbXMuY3JvcExlZnRPZmZzZXQsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgZGVjb2RlcltpXS0+ZGVjSW5mby5jcm9wUGFyYW1zLmNyb3BUb3BPZmZzZXQsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgZGVjb2RlcltpXS0+ZGVjSW5mby5jcm9wUGFyYW1zLmNyb3BPdXRXaWR0aCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBkZWNvZGVyW2ldLT5kZWNJbmZvLmNyb3BQYXJhbXMuY3JvcE91dEhlaWdodCkpOwotICAgICAgICAgICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgICAgICAgICAgREVCVUcoKCJEZWNvZGVyWyVkXSBXaWR0aCAlZCBIZWlnaHQgJWRcbiIsIGksCi0gICAgICAgICAgICAgICAgICAgICAgICBkZWNvZGVyW2ldLT5kZWNJbmZvLnBpY1dpZHRoLAotICAgICAgICAgICAgICAgICAgICAgICAgZGVjb2RlcltpXS0+ZGVjSW5mby5waWNIZWlnaHQpKTsKLQotICAgICAgICAgICAgICAgICAgICBERUJVRygoIkRlY29kZXJbJWRdIHZpZGVvUmFuZ2UgJWQsIG1hdHJpY0NvZWZmaWNpZW50cyAlZFxuIiwKLSAgICAgICAgICAgICAgICAgICAgICAgIGksIGRlY29kZXJbaV0tPmRlY0luZm8udmlkZW9SYW5nZSwKLSAgICAgICAgICAgICAgICAgICAgICAgIGRlY29kZXJbaV0tPmRlY0luZm8ubWF0cml4Q29lZmZpY2llbnRzKSk7Ci0gICAgICAgICAgICAgICAgICAgIGRlY29kZXJbaV0tPmRlY0lucHV0LmRhdGFMZW4gLT0KLSAgICAgICAgICAgICAgICAgICAgICAgICh1MzIpKGRlY29kZXJbaV0tPmRlY091dHB1dC5wU3RybUN1cnJQb3MgLQotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZGVjb2RlcltpXS0+ZGVjSW5wdXQucFN0cmVhbSk7Ci0gICAgICAgICAgICAgICAgICAgIGRlY29kZXJbaV0tPmRlY0lucHV0LnBTdHJlYW0gPQotICAgICAgICAgICAgICAgICAgICAgICAgZGVjb2RlcltpXS0+ZGVjT3V0cHV0LnBTdHJtQ3VyclBvczsKLSAgICAgICAgICAgICAgICAgICAgYnJlYWs7Ci0KLSAgICAgICAgICAgICAgICBjYXNlIEgyNjRTV0RFQ19QSUNfUkRZX0JVRkZfTk9UX0VNUFRZOgotICAgICAgICAgICAgICAgICAgICBkZWNvZGVyW2ldLT5kZWNJbnB1dC5kYXRhTGVuIC09Ci0gICAgICAgICAgICAgICAgICAgICAgICAodTMyKShkZWNvZGVyW2ldLT5kZWNPdXRwdXQucFN0cm1DdXJyUG9zIC0KLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRlY29kZXJbaV0tPmRlY0lucHV0LnBTdHJlYW0pOwotICAgICAgICAgICAgICAgICAgICBkZWNvZGVyW2ldLT5kZWNJbnB1dC5wU3RyZWFtID0KLSAgICAgICAgICAgICAgICAgICAgICAgIGRlY29kZXJbaV0tPmRlY091dHB1dC5wU3RybUN1cnJQb3M7Ci0gICAgICAgICAgICAgICAgICAgIC8qIGZhbGwgdGhyb3VnaCAqLwotICAgICAgICAgICAgICAgIGNhc2UgSDI2NFNXREVDX1BJQ19SRFk6Ci0gICAgICAgICAgICAgICAgICAgIGlmIChyZXQgPT0gSDI2NFNXREVDX1BJQ19SRFkpCi0gICAgICAgICAgICAgICAgICAgICAgICBkZWNvZGVyW2ldLT5kZWNJbnB1dC5kYXRhTGVuID0gMDsKLQotICAgICAgICAgICAgICAgICAgICByZXQgPSBIMjY0U3dEZWNHZXRJbmZvKGRlY29kZXJbaV0tPmRlY0luc3QsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgJihkZWNvZGVyW2ldLT5kZWNJbmZvKSk7Ci0gICAgICAgICAgICAgICAgICAgIGlmIChyZXQgIT0gSDI2NFNXREVDX09LKQotICAgICAgICAgICAgICAgICAgICAgICAgZXhpdCgxKTsKLQotICAgICAgICAgICAgICAgICAgICB3aGlsZSAoSDI2NFN3RGVjTmV4dFBpY3R1cmUoZGVjb2RlcltpXS0+ZGVjSW5zdCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAmKGRlY29kZXJbaV0tPmRlY1BpY3R1cmUpLCAwKSA9PSBIMjY0U1dERUNfUElDX1JEWSkKLSAgICAgICAgICAgICAgICAgICAgewotICAgICAgICAgICAgICAgICAgICAgICAgZGVjb2RlcltpXS0+cGljTnVtYmVyKys7Ci0KLSAgICAgICAgICAgICAgICAgICAgICAgIG51bUVycm9ycyArPSBkZWNvZGVyW2ldLT5kZWNQaWN0dXJlLm5ick9mRXJyTUJzOwotCi0gICAgICAgICAgICAgICAgICAgICAgICBERUJVRygoIkRlY29kZXJbJWRdIFBJQyAlZCwgdHlwZSAlcywgY29uY2VhbGVkICVkXG4iLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgIGksIGRlY29kZXJbaV0tPnBpY051bWJlciwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBkZWNvZGVyW2ldLT5kZWNQaWN0dXJlLmlzSWRyUGljdHVyZQotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA/ICJJRFIiIDogIk5PTi1JRFIiLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRlY29kZXJbaV0tPmRlY1BpY3R1cmUubmJyT2ZFcnJNQnMpKTsKLSAgICAgICAgICAgICAgICAgICAgICAgIGZmbHVzaChzdGRvdXQpOwotCi0gICAgICAgICAgICAgICAgICAgICAgICBDcm9wV3JpdGVPdXRwdXQoZGVjb2RlcltpXS0+Zm91dHB1dCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKHU4KilkZWNvZGVyW2ldLT5kZWNQaWN0dXJlLnBPdXRwdXRQaWN0dXJlLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjcm9wRGlzcGxheSwgJihkZWNvZGVyW2ldLT5kZWNJbmZvKSk7Ci0gICAgICAgICAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgICAgICAgICBpZiAobWF4TnVtUGljcyAmJiBkZWNvZGVyW2ldLT5waWNOdW1iZXIgPT0gbWF4TnVtUGljcykKLSAgICAgICAgICAgICAgICAgICAgICAgIGRlY29kZXJbaV0tPmRlY0lucHV0LmRhdGFMZW4gPSAwOwotICAgICAgICAgICAgICAgICAgICBicmVhazsKLQotICAgICAgICAgICAgICAgIGNhc2UgSDI2NFNXREVDX1NUUk1fUFJPQ0VTU0VEOgotICAgICAgICAgICAgICAgIGNhc2UgSDI2NFNXREVDX1NUUk1fRVJSOgotICAgICAgICAgICAgICAgIGNhc2UgSDI2NFNXREVDX1BBUkFNX0VSUjoKLSAgICAgICAgICAgICAgICAgICAgZGVjb2RlcltpXS0+ZGVjSW5wdXQuZGF0YUxlbiA9IDA7Ci0gICAgICAgICAgICAgICAgICAgIGJyZWFrOwotCi0gICAgICAgICAgICAgICAgZGVmYXVsdDoKLSAgICAgICAgICAgICAgICAgICAgREVCVUcoKCJEZWNvZGVyWyVkXSBGQVRBTCBFUlJPUlxuIiwgaSkpOwotICAgICAgICAgICAgICAgICAgICBleGl0KDEwKTsKLSAgICAgICAgICAgICAgICAgICAgYnJlYWs7Ci0KLSAgICAgICAgICAgIH0KLSAgICAgICAgfQotCi0gICAgICAgIC8qIGNoZWNrIGlmIGFueSBvZiB0aGUgaW5zdGFuY2VzIGlzIHN0aWxsIHJ1bm5pbmcgKD1oYXMgbW9yZSBkYXRhKSAqLwotICAgICAgICBpbnN0UnVubmluZyA9IGluc3RDb3VudDsKLSAgICAgICAgZm9yIChpID0gMDsgaSA8IGluc3RDb3VudDsgaSsrKQotICAgICAgICB7Ci0gICAgICAgICAgICBpZiAoZGVjb2RlcltpXS0+ZGVjSW5wdXQuZGF0YUxlbiA9PSAwKQotICAgICAgICAgICAgICAgIGluc3RSdW5uaW5nLS07Ci0gICAgICAgIH0KLQotICAgIH0gd2hpbGUgKGluc3RSdW5uaW5nKTsKLQotCi0gICAgLyogZ2V0IGxhc3QgZnJhbWVzIGFuZCBjbG9zZSBlYWNoIGluc3RhbmNlICovCi0gICAgZm9yIChpID0gMDsgaSA8IGluc3RDb3VudDsgaSsrKQotICAgIHsKLSAgICAgICAgd2hpbGUgKEgyNjRTd0RlY05leHRQaWN0dXJlKGRlY29kZXJbaV0tPmRlY0luc3QsCi0gICAgICAgICAgICAgICAgJihkZWNvZGVyW2ldLT5kZWNQaWN0dXJlKSwgMSkgPT0gSDI2NFNXREVDX1BJQ19SRFkpCi0gICAgICAgIHsKLSAgICAgICAgICAgIGRlY29kZXJbaV0tPnBpY051bWJlcisrOwotCi0gICAgICAgICAgICBERUJVRygoIkRlY29kZXJbJWRdIFBJQyAlZCwgdHlwZSAlcywgY29uY2VhbGVkICVkXG4iLAotICAgICAgICAgICAgICAgIGksIGRlY29kZXJbaV0tPnBpY051bWJlciwKLSAgICAgICAgICAgICAgICBkZWNvZGVyW2ldLT5kZWNQaWN0dXJlLmlzSWRyUGljdHVyZQotICAgICAgICAgICAgICAgICAgICA/ICJJRFIiIDogIk5PTi1JRFIiLAotICAgICAgICAgICAgICAgIGRlY29kZXJbaV0tPmRlY1BpY3R1cmUubmJyT2ZFcnJNQnMpKTsKLSAgICAgICAgICAgIGZmbHVzaChzdGRvdXQpOwotCi0gICAgICAgICAgICBDcm9wV3JpdGVPdXRwdXQoZGVjb2RlcltpXS0+Zm91dHB1dCwKLSAgICAgICAgICAgICAgICAgICAgKHU4KilkZWNvZGVyW2ldLT5kZWNQaWN0dXJlLnBPdXRwdXRQaWN0dXJlLAotICAgICAgICAgICAgICAgICAgICBjcm9wRGlzcGxheSwgJihkZWNvZGVyW2ldLT5kZWNJbmZvK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IDB4YzQKLTsvLyAgdTggKnByZWRQYXJ0Q2hyb21hLCAgICAgICAgOiAweGM4Ci07Ly8gIGkzMiB4MCwgICAgICAgICAgICAgICAgICAgIDogMHhjYwotOy8vICBpMzIgeTAsICAgICAgICAgICAgICAgICAgICA6IDB4ZDAKLTsvLyAgdTMyIHdpZHRoLCAgICAgICAgICAgICAgICAgOiAweGY4Ci07Ly8gIHUzMiBoZWlnaHQsICAgICAgICAgICAgICAgIDogMHhmYwotOy8vICB1MzIgeEZyYWMsICAgICAgICAgICAgICAgICA6IDB4MTAwCi07Ly8gIHUzMiB5RnJhYywgICAgICAgICAgICAgICAgIDogMHgxMDQKLTsvLyAgdTMyIGNocm9tYVBhcnRXaWR0aCwgICAgICAgOiAweDEwOAotOy8vICB1MzIgY2hyb21hUGFydEhlaWdodCAgICAgICA6IDB4MTBjCi0KLWgyNjRic2RJbnRlcnBvbGF0ZUNocm9tYUhvclZlcgotICAgIFNUTUZEICAgc3AhLCB7cjAtcjExLGxyfQotICAgIFNVQiAgICAgc3AsIHNwLCAjMHhjNAotCi0gICAgTERSICAgICBjaHJQVywgW3NwLCAjMHgxMDhdICAgICA7Ly8gY2hyb21hUGFydFdpZHRoCi0gICAgTERSICAgICB4RnJhYywgW3NwLCAjMHgxMDBdICAgICA7Ly8geEZyYWMKLSAgICBMRFIgICAgIHdpZHRoLCBbc3AsICMweGY4XSAgICAgIDsvLyB3aWR0aAotICAgIENNUCAgICAgeDAsICMwCi0gICAgQkxUICAgICBkb19maWxsCi0KLSAgICBBREQgICAgIHRtcDEsIHgwLCBjaHJQVyAgICAgICAgIDsvLyB0bXAxID0geDArIGNocm9tYVBhcnRXaWR0aAotICAgIEFERCAgICAgdG1wMSwgdG1wMSwgIzEgICAgICAgICAgOy8vIHRtcDEgPSB4MCsgY2hyb21hUGFydFdpZHRoKzEKLSAgICBDTVAgICAgIHRtcDEsIHdpZHRoICAgICAgICAgICAgIDsvLyB4MCtjaHJvbWFQYXJ0V2lkdGgrMS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Y10KLSAgICBMRFIgICAgIHkwLCBbc3AsICMweGQwXQotICAgIExEUiAgICAgcmVmLCBbc3AsICMweGM0XSAgICAgICAgOy8vIHJlZgotICAgIFNUTUlBICAgc3Ase3dpZHRoLGhlaWdodCx0bXAxLHRtcDIsdG1wM30KLSAgICBBREQgICAgIGJsb2NrLCBzcCwgIzB4MWMgICAgICAgIDsvLyBibG9jawotICAgIE1MQSAgICAgcmVmLCBoZWlnaHQsIHdpZHRoLCByZWYgOy8vIHJlZiArPSB3aWR0aCAqIGhlaWdodDsgCi0gICAgTUxBICAgICBibG9jaywgdG1wMiwgdG1wMSwgYmxvY2s7Ly8gYmxvY2sgKyAoY2hyb21hUFcrMSkqKGNocm9tYVBIKzEpCi0gICAgQkwgICAgICBoMjY0YnNkRmlsbEJsb2NrCi0KLSAgICBNT1YgICAgIHgwLCAjMCAgICAgICAgICAgICAgICAgIDsvLyB4MCA9IDAKLSAgICBNT1YgICAgIHkwLCAjMCAgICAgICAgICAgICAgICAgIDsvLyB5MCA9IDAKLSAgICBTVFIgICAgIHgwLCBbc3AsICMweGNjXQotICAgIFNUUiAgICAgeTAsIFtzcCwgIzB4ZDBdCi0gICAgQUREICAgICByZWYsIHNwLCAjMHgxYyAgICAgICAgICA7Ly8gcmVmID0gYmxvY2sKLSAgICBTVFIgICAgIHJlZiwgW3NwLCAjMHhjNF0gICAgICAgIDsvLyByZWYKLQotICAgIFNUUiAgICAgdG1wMiwgW3NwLCAjMHhmY10gICAgICAgOy8vIGhlaWdodAotICAgIFNUUiAgICAgdG1wMSwgW3NwLCAjMHhmOF0gICAgICAgOy8vIHdpZHRoCi0gICAgTU9WICAgICB3aWR0aCwgdG1wMQotCi1za2lwX2ZpbGwKLSAgICBNTEEgICAgIHRtcDMsIHkwLCB3aWR0aCwgeDAgICAgIDsvLyB0bXAzID0geTAqd2lkdGgreDAKLSAgICBMRFIgICAgIHlGcmFjLCBbc3AsICMweDEwNF0gICAgIDsvLyB5RnJhYwotICAgIExEUiA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Oy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLwotICAgIExEUiAgICAgaGVpZ2h0LCBbc3AsIzB4ZmNdICAgICAgICAgIDsvLyBoZWlnaHQKLSAgICBMRFIgICAgIHJlZiwgW3NwLCAjMHhjNF0gICAgICAgICAgICA7Ly8gcmVmCi0gICAgTERSICAgICB0bXAxLCBbc3AsICMweGQwXSAgICAgICAgICAgOy8vIHkwCi0gICAgTERSICAgICB0bXAyLCBbc3AsICMweGNjXSAgICAgICAgICAgOy8vIHgwCi0gICAgTERSICAgICBtYiwgW3NwLCAjMHhjOF0gICAgICAgICAgICAgOy8vIHByZWRQYXJ0Q2hyb21hCi0KLSAgICBBREQgICAgIHRtcDEsIGhlaWdodCwgdG1wMQotICAgIE1MQSAgICAgdG1wMywgdG1wMSwgd2lkdGgsIHRtcDIKLSAgICBBREQgICAgIHB0ckEsIHJlZiwgdG1wMwotICAgIEFERCAgICAgbWIsIG1iLCAjNjQKLQotICAgIEFORCAgICAgY291bnQsIGNvdW50LCAjMHgwMEZGRkZGRgotICAgIEFORCAgICAgdG1wMSwgY291bnQsICMweDAwMEYwMDAwCi0gICAgQUREICAgICBjb3VudCwgY291bnQsIHRtcDEsIExTTCAjOAotICAgIEFORCAgICAgdG1wMiwgY291bnQsICMweDAwRjAwMDAwCi0KLSAgICA7Ly8gMngyIHBlbHMgcGVyIGl0ZXJhdGlvbgotICAgIDsvLyBiaWxpbmVhciB2ZXJ0aWNhbCBpbnRlcnBvbGF0aW9uCi1sb29wMl95Ci0gICAgQUREICAgICBjb3VudCwgY291bnQsIHRtcDIsIExTTCAjOAotbG9vcDJfeAotICAgIDsvLyBQcm9jZXNzIDJ4MiBibG9jawotICAgIExEUkIgICAgdG1wMiwgW3B0ckEsd2lkdGhdICAgICAgICAgIDsvLyAyIHJvdywgMSBjb2wKLSAgICBMRFJCICAgIH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1YgICAgIHRtcDIsIHRtcDIsIExTUiAjNiAgICAgICAgICA7Ly8gc2NhbGUgZG93bgotICAgIFNUUkIgICAgdG1wMiwgW21iXSwjMSAgICAgICAgICAgICAgIDsvLyBzdG9yZSByb3cgMSBjb2wgMQotCi0gICAgTU9WICAgICB0bXA4LCB0bXA4LCBMU1IgIzYgICAgICAgICAgOy8vIHNjYWxlIGRvd24KLSAgICBTVFJCICAgIHRtcDgsIFttYiwjOF0gICAgICAgICAgICAgICA7Ly8gc3RvcmUgcm93IDIgY29sIDIKLSAgICBNT1YgICAgIHRtcDUsIHRtcDUsIExTUiAjNiAgICAgICAgICA7Ly8gc2NhbGUgZG93bgotICAgIFNUUkIgICAgdG1wNSwgW21iXSwjMSAgICAgICAgICAgICAgIDsvLyBzdG9yZSByb3cgMSBjb2wgMgotCi0KLSAgICBTVUJTICAgIGNvdW50LCBjb3VudCwgIzI8PDI4Ci0gICAgQkNTICAgICBsb29wMl94Ci0KLSAgICBBTkQgICAgIHRtcDIsIGNvdW50LCAjMHgwMEYwMDAwMAotCi0gICAgQUREUyAgICBtYiwgbWIsICMxNgotICAgIFNCQyAgICAgbWIsIG1iLCB0bXAyLCBMU1IgIzIwCi0gICAgQUREICAgICBwdHJBLCBwdHJBLCB3aWR0aCwgTFNMICMxCi0gICAgU0JDICAgICBwdHJBLCBwdHJBLCB0bXAyLCBMU1IgIzIwCi0KLSAgICBBRERTICAgIGNvdW50LCBjb3VudCwgIzB4RSA8PCAyNAotICAgIEJHRSAgICAgbG9vcDJfeQotCi0gICAgQUREICAgICBzcCxzcCwjMHhkNAotICAgIExETUZEICAgc3AhLCB7cjQtcjExLHBjfQotCi0gICAgRU5ECmRpZmYgLS1naXQgYS9tZWRpYS9saWJzdGFnZWZyaWdodC9jb2RlY3Mvb24yL2gyNjRkZWMvc291cmNlL2FybTExX2FzbS9oMjY0YnNkX2ludGVycG9sYXRlX2hvcl9oYWxmLnMgYi9tZWRpYS9saWJzdGFnZWZyaWdodC9jb2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hfM18xICAgICB4XzZfNCAgICAgeF83XzUgICAgIHhfMl8wCi07Ly8gICAgICAgWyAgMiAgMCBdIFsgIDMgIDEgXSBbICA2ICA0IF0gWyAgNyAgNSBdIFsgMTAgIDggXSAuLi4KLTsvLyB5XzAgPSAgIDIwICAxICAgICAyMCAtNSAgICAgICAgLTUgICAgICAgICAxCi07Ly8geV8xID0gICAtNSAgICAgICAgMjAgIDEgICAgICAxIDIwICAgICAgICAtNQotOy8vIHlfMiA9ICAgIDEgICAgICAgIC01ICAgICAgICAtNSAyMCAgICAgIDEgMjAKLTsvLyB5XzMgPSAgICAgICAgICAgICAgMSAgICAgICAgMjAgLTUgICAgIC01IDIwICAgICAgICAgMQotCi0KLWgyNjRic2RJbnRlcnBvbGF0ZUhvclF1YXJ0ZXIKLSAgICBTVE1GRCAgIHNwISwge3IwLXIxMSwgbHJ9Ci0gICAgU1VCICAgICBzcCwgc3AsICMweDFlNAotCi0gICAgQ01QICAgICB4MCwgIzAKLSAgICBCTFQgICAgIGRvX2ZpbGwgICAgICAgICAgICAgICAgIDsvLyAoeDAgPCAwKQotICAgIExEUiAgICAgcGFydFcsIFtzcCwjMHgyMjBdICAgICAgOy8vIHBhcnRXaWR0aAotICAgIEFERCAgICAgdG1wNCwgeDAsIHBhcnRXICAgICAgICAgOy8vICh4MCtwYXJ0V2lkdGgpCi0gICAgQUREICAgICB0bXA0LCB0bXA0LCAjNSAgICAgICAgICA7Ly8gKHkwK3BhcnRXKzUpCi0gICAgTERSICAgICB3aWR0aCwgW3NwLCMweDIxOF0gICAgICA7Ly8gd2lkdGgKLSAgICBDTVAgICAgIHRtcDQsIHdpZHRoCi0gICAgQkhJICAgICBkb19maWxsICAgICAgICAgICAgICAgICA7Ly8gKHgwK3BhcnRXKT53aWR0aAotCi0gICAgQ01QICAgICB5MCwgIzAKLSAgICBCTFQgICAgIGRvX2ZpbGwgICAgICAgICAgICAgICAgIDsvLyAoeTAgPCAwKQotICAgIExEUiAgICAgcGFydEgsIF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IGgyNjRic2RJbnRlcnBvbGF0ZUhvclZlclF1YXJ0ZXIKLQotOy8vIEhvcml6b250YWwgZmlsdGVyIGFwcHJvYWNoCi07Ly8KLTsvLyBCYXNpYyBpZGVhIGluIGhvcml6b250YWwgZmlsdGVyaW5nIGlzIHRvIGFkanVzdCBjb2VmZmljaWVudHMKLTsvLyBsaWtlIGJlbG93LiBDYWxjdWxhdGlvbiBpcyBkb25lIHdpdGggMTYtYml0IG1hdGhzLgotOy8vCi07Ly8gUmVnICAgICB4XzJfMCAgICAgeF8zXzEgICAgIHhfNl80ICAgICB4XzdfNSAgICAgeF8yXzAKLTsvLyAgICAgICBbICAyICAwIF0gWyAgMyAgMSBdIFsgIDYgIDQgXSBbICA3ICA1IF0gWyAxMCAgOCBdIC4uLgotOy8vIHlfMCA9ICAgMjAgIDEgICAgIDIwIC01ICAgICAgICAtNSAgICAgICAgIDEKLTsvLyB5XzEgPSAgIC01ICAgICAgICAyMCAgMSAgICAgIDEgMjAgICAgICAgIC01Ci07Ly8geV8yID0gICAgMSAgICAgICAgLTUgICAgICAgIC01IDIwICAgICAgMSAyMAotOy8vIHlfMyA9ICAgICAgICAgICAgICAxICAgICAgICAyMCAtNSAgICAgLTUgMjAgICAgICAgICAxCi0KLQotaDI2NGJzZEludGVycG9sYXRlSG9yVmVyUXVhcnRlcgotICAgIFNUTUZEICAgc3AhLCB7cjAtcjExLCBscn0KLSAgICBTVUIgICAgIHNwLCBzcCwgIzB4MWU0Ci0KLSAgICBDTVAgICAgIHgwLCAjMAotICAgIEJMVCAgICAgZG9fZmlsbCAgICAgICAgICAgICAgICAgOy8vICh4MCA8IDApCi0gICAgTERSICAgICBwYXJ0VywgW3NwLCMweDIyMF0gICAgICA7Ly8gcGFydFdpZHRoCi0gICAgTERSICAgICB3aWR0aCwgW3NwLCMweDIxOF0gICAgICA7Ly8gd2lkdGgKLSAgICBBREQgICAgIHRtcGEsIHgwLCBwYXJ0VyAgICAgICAgIDsvLyAoeDArcGFydFdp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IgICAgIHdpZHRoLCBbc3AsIzB4MjE4XSAgICAgIDsvLyB3aWR0aAotICAgIFNUUiAgICAgd2lkdGgsIFtzcCwjMF0gICAgICAgICAgOy8vIHNwKzAgPSB3aWR0aAotICAgIEFERCAgICAgYnVmZiwgc3AsICMweDI4ICAgICAgICAgOy8vIGJ1ZmYgPSBwMVsyMSoyMS80KzFdCi0gICAgQkwgICAgICBoMjY0YnNkRmlsbEJsb2NrCi0KLSAgICBNT1YgICAgIHgwLCAjMAotICAgIFNUUiAgICAgeDAsW3NwLCMweDFlY10gICAgICAgICAgOy8vIHgwID0gMAotICAgIFNUUiAgICAgeDAsW3NwLCMweDFmMF0gICAgICAgICAgOy8vIHkwID0gMAotICAgIEFERCAgICAgcmVmLHNwLCMweDI4ICAgICAgICAgICAgOy8vIHJlZiA9IHAxCi0gICAgU1RSICAgICBwYXJ0VywgW3NwLCMweDIxOF0KLQotCi1za2lwX2ZpbGwKLSAgICBMRFIgICAgIHgwICxbc3AsIzB4MWVjXSAgICAgICAgIDsvLyB4MAotICAgIExEUiAgICAgeTAgLFtzcCwjMHgxZjBdICAgICAgICAgOy8vIHkwCi0gICAgTERSICAgICB3aWR0aCwgW3NwLCMweDIxOF0gICAgICA7Ly8gd2lkdGgKLSAgICBNTEEgICAgIHRtcDYsIHdpZHRoLCB5MCwgeDAgICAgIDsvLyB5MCp3aWR0aCt4MAotICAgIEFERCAgICAgcmVmLCByZWYsIHRtcDYgICAgICAgICAgOy8vIHJlZiArPSB5MCp3aWR0aCt4MAotICAgIExEUiAgICAgbWIsIFtzcCwgIzB4MWU4XSAgICAgICAgOy8vIG1iCi0KLSAgICBBREQgICAgIGNvdW50LCBwYXJ0VywgcGFydEgsIExTTCAjOCAgICA7Ly8gfHh4fHh4fHBhcnRIfHBhcnRXfAotICAgIExEUiAgICAgdG1wNSwgPSAweDAwMDEwMTAwCi0gICAgUlNCICAgICBjb3VudCwgdG1wNSwgY291bnQsIExTTCAjOCAgICAgIDsvLyB8eHh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Ci07ICAgICAgICBSZXR1cm5zOgotOwotOy0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSovCi0KLWgyNjRic2RGaWxsUm93NwotICAgICAgICBQVVNIICAgICB7cjQtcjYsbHJ9Ci0gICAgICAgIENNUCAgICAgIGxlZnQsICMwCi0gICAgICAgIExEUiAgICAgIHJpZ2h0LCBbc3AsIzB4MTBdCi0gICAgICAgIEJFUSAgICAgIHN3aXRjaF9jZW50ZXIKLSAgICAgICAgTERSQiAgICAgdG1wMSwgW3JlZiwjMF0KLQotbG9vcF9sZWZ0Ci0gICAgICAgIFNVQlMgICAgIGxlZnQsIGxlZnQsICMxCi0gICAgICAgIFNUUkIgICAgIHRtcDEsIFtmaWxsXSwgIzEKLSAgICAgICAgQk5FICAgICAgbG9vcF9sZWZ0Ci0KLXN3aXRjaF9jZW50ZXIKLSAgICAgICAgQVNSICAgICAgdG1wMixjZW50ZXIsIzIKLSAgICAgICAgQ01QICAgICAgdG1wMiwjOQotICAgICAgICBBRERDQyAgICBwYyxwYyx0bXAyLExTTCAjMgotICAgICAgICBCICAgICAgICBsb29wX2NlbnRlcgotICAgICAgICBCICAgICAgICBsb29wX2NlbnRlcgotICAgICAgICBCICAgICAgICBjYXNlXzEKLSAgICAgICAgQiAgICAgICAgY2FzZV8yCi0gICAgICAgIEIgICAgICAgIGNhc2VfMwotICAgICAgICBCICAgICAgICBjYXNlXzQKLSAgICAgICAgQiAgICAgICAgY2FzZV81Ci0gICAgICAgIEIgICAgICAgIGNhc2VfNgotICAgICAgICBCICAgICAgICBjYXNlXzcKLSAgICAgICAgQiAgICAgICAgY2FzZV84Ci07Y2FzZV84Ci07ICAgICAgICBMRFIgICAgICB0bXAyLCBbcmVmXSwgIzQKLTsgICAgICAgIFNVQiAgICAgIGNlbnRlciwgY2VudGVyLCAjNAotOyAgICAgICAgU1RS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bnRlciwgY2VudGVyLCAjMTYKLSAgICAgICAgVlNUMSAgICBxVG1wMCwgW2ZpbGxdIQotICAgICAgICBCICAgICAgIGxvb3BfY2VudGVyCi1jYXNlXzMKLSAgICAgICAgVkxEMSAgICBkVG1wMCwgW3JlZl0hCi0gICAgICAgIFNVQiAgICAgY2VudGVyLCBjZW50ZXIsICMxMgotICAgICAgICBMRFIgICAgIHRtcDIsIFtyZWZdLCAjNAotICAgICAgICBWU1QxICAgIGRUbXAwLCBbZmlsbF0hCi0gICAgICAgIFNUUiAgICAgdG1wMiwgW2ZpbGxdLCM0Ci0gICAgICAgIEIgICAgICAgbG9vcF9jZW50ZXIKLWNhc2VfMgotICAgICAgICBMRFIgICAgICB0bXAyLCBbcmVmXSwjNAotICAgICAgICBTVUIgICAgICBjZW50ZXIsIGNlbnRlciwgIzQKLSAgICAgICAgU1RSICAgICAgdG1wMiwgW2ZpbGxdLCAjNAotY2FzZV8xCi0gICAgICAgIExEUiAgICAgIHRtcDIsIFtyZWZdLCM0Ci0gICAgICAgIFNVQiAgICAgIGNlbnRlciwgY2VudGVyLCAjNAotICAgICAgICBTVFIgICAgICB0bXAyLCBbZmlsbF0sICM0Ci0KLWxvb3BfY2VudGVyCi0gICAgICAgIENNUCAgICAgIGNlbnRlciwgIzAKLSAgICAgICAgTERSQk5FICAgdG1wMiwgW3JlZl0sICMxCi0gICAgICAgIFNVQk5FICAgIGNlbnRlciwgY2VudGVyLCAjMQotICAgICAgICBTVFJCTkUgICB0bXAyLCBbZmlsbF0sICMxCi0gICAgICAgIEJORSAgICAgIGxvb3BfY2VudGVyCi0gICAgICAgIENNUCAgICAgIHJpZ2h0LCMwCi0gICAgICAgIFBPUEVRICAgIHtyNC1yNixwY30KLSAgICAgICAgTERSQiAgICAgdG1wMiwgW3JlZiwjLTFdCi0KLWxvb3BfcmlnaHQKLSAgICAgICAgU1RSQiAgICAgdG1wMiwgW2ZpbGxdLCAjMQotICAgICAgICBTVUJTICAgICByaWdodCwgcm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cDAgICAgIFEwLlU4Ci0jZGVmaW5lIHFUbXAxICAgICBRMS5VOAotI2RlZmluZSBkVG1wMCAgICAgRDAuVTgKLSNkZWZpbmUgZFRtcDEgICAgIEQxLlU4Ci0jZGVmaW5lIGRUbXAyICAgICBEMi5VOAotI2RlZmluZSBkVG1wMyAgICAgRDMuVTgKLQotLyoKLXZvaWQgaDI2NGJzZEZpbGxSb3c3KGNvbnN0IHU4ICogcmVmLCB1OCAqIGZpbGwsIGkzMiBsZWZ0LCBpMzIgY2VudGVyLAotICAgICAgICAgICAgICAgICAgICAgaTMyIHJpZ2h0KTsKLSovCi0KLWZ1bmN0aW9uIGgyNjRic2RGaWxsUm93NywgZXhwb3J0PTEKLQotICAgICAgICBQVVNIICAgICB7cjQtcjYsbHJ9Ci0gICAgICAgIENNUCAgICAgIGxlZnQsICMwCi0gICAgICAgIExEUiAgICAgIHJpZ2h0LCBbc3AsIzB4MTBdCi0gICAgICAgIEJFUSAgICAgIHN3aXRjaF9jZW50ZXIKLSAgICAgICAgTERSQiAgICAgdG1wMSwgW3JlZiwjMF0KLQotbG9vcF9sZWZ0OgotICAgICAgICBTVUJTICAgICBsZWZ0LCBsZWZ0LCAjMQotICAgICAgICBTVFJCICAgICB0bXAxLCBbZmlsbF0sICMxCi0gICAgICAgIEJORSAgICAgIGxvb3BfbGVmdAotCi1zd2l0Y2hfY2VudGVyOgotICAgICAgICBBU1IgICAgICB0bXAyLGNlbnRlciwjMgotICAgICAgICBDTVAgICAgICB0bXAyLCM5Ci0gICAgICAgIEFERENDICAgIHBjLHBjLHRtcDIsTFNMICMyCi0gICAgICAgIEIgICAgICAgIGxvb3BfY2VudGVyCi0gICAgICAgIEIgICAgICAgIGxvb3BfY2VudGVyCi0gICAgICAgIEIgICAgICAgIGNhc2VfMQotICAgICAgICBCICAgICAgICBjYXNlXzIKLSAgICAgICAgQiAgICAgICAgY2FzZV8zCi0gICAgICAgIEIgICAgICAgIGNhc2VfNAotICAgICAgICBCICAgICAgICB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SAgICAgICAgQiAgICAgICBsb29wX2NlbnRlcgotY2FzZV80OgotICAgICAgICBWTEQxICAgIHtxVG1wMH0sIFtyZWZdIQotICAgICAgICBTVUIgICAgIGNlbnRlciwgY2VudGVyLCAjMTYKLSAgICAgICAgVlNUMSAgICB7cVRtcDB9LCBbZmlsbF0hCi0gICAgICAgIEIgICAgICAgbG9vcF9jZW50ZXIKLWNhc2VfMzoKLSAgICAgICAgVkxEMSAgICB7ZFRtcDB9LCBbcmVmXSEKLSAgICAgICAgU1VCICAgICBjZW50ZXIsIGNlbnRlciwgIzEyCi0gICAgICAgIExEUiAgICAgdG1wMiwgW3JlZl0sICM0Ci0gICAgICAgIFZTVDEgICAgZFRtcDAsIFtmaWxsXSEKLSAgICAgICAgU1RSICAgICB0bXAyLCBbZmlsbF0sIzQKLSAgICAgICAgQiAgICAgICBsb29wX2NlbnRlcgotY2FzZV8yOgotICAgICAgICBMRFIgICAgICB0bXAyLCBbcmVmXSwjNAotICAgICAgICBTVUIgICAgICBjZW50ZXIsIGNlbnRlciwgIzQKLSAgICAgICAgU1RSICAgICAgdG1wMiwgW2ZpbGxdLCAjNAotY2FzZV8xOgotICAgICAgICBMRFIgICAgICB0bXAyLCBbcmVmXSwjNAotICAgICAgICBTVUIgICAgICBjZW50ZXIsIGNlbnRlciwgIzQKLSAgICAgICAgU1RSICAgICAgdG1wMiwgW2ZpbGxdLCAjNAotCi1sb29wX2NlbnRlcjoKLSAgICAgICAgQ01QICAgICAgY2VudGVyLCAjMAotICAgICAgICBCRVEgICAgICBqdW1wCi0gICAgICAgIExEUkIgICAgIHRtcDIsIFtyZWZdLCAjMQotICAgICAgICBTVUIgICAgICBjZW50ZXIsIGNlbnRlciwgIzEKLSAgICAgICAgU1RSQiAgICAgdG1wMiwgW2ZpbGxdLCAjMQotICAgICAgICBCTkUgICAgICBsb29wX2NlbnRlcgotanVtcDoKLSAgICAgICAgQ01QICAgICAgcmlnaHQsIzAKLSAgICAgICAgUE9QRVEgICAge3I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SAgICAgICAgKHBCeXRlU3RyZWFtWzJdJjB4RkUpID09IDB4MDApCi0gICAgewotICAgICAgICAvKiBzZWFyY2ggZm9yIE5BTCB1bml0IHN0YXJ0IHBvaW50LCBpLmUuIHBvaW50IGFmdGVyIGZpcnN0IHN0YXJ0IGNvZGUKLSAgICAgICAgICogcHJlZml4IGluIHRoZSBzdHJlYW0gKi8KLSAgICAgICAgemVyb0NvdW50ID0gYnl0ZUNvdW50ID0gMjsKLSAgICAgICAgcmVhZFB0ciA9IHBCeXRlU3RyZWFtICsgMjsKLSAgICAgICAgLypsaW50IC1lKDcxNikgd2hpbGUoMSkgdXNlZCBjb25zY2lvdXNseSAqLwotICAgICAgICB3aGlsZSAoMSkKLSAgICAgICAgewotICAgICAgICAgICAgYnl0ZSA9ICpyZWFkUHRyKys7Ci0gICAgICAgICAgICBieXRlQ291bnQrKzsKLQotICAgICAgICAgICAgaWYgKGJ5dGVDb3VudCA9PSBsZW4pCi0gICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgLyogbm8gc3RhcnQgY29kZSBwcmVmaXggZm91bmQgLT4gZXJyb3IgKi8KLSAgICAgICAgICAgICAgICAqcmVhZEJ5dGVzID0gbGVuOwotICAgICAgICAgICAgICAgIHJldHVybihIQU5UUk9fTk9LKTsKLSAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgaWYgKCFieXRlKQotICAgICAgICAgICAgICAgIHplcm9Db3VudCsrOwotICAgICAgICAgICAgZWxzZSBpZiAoKGJ5dGUgPT0gMHgwMSkgJiYgKHplcm9Db3VudCA+PSAyKSkKLSAgICAgICAgICAgICAgICBicmVhazsKLSAgICAgICAgICAgIGVsc2UKLSAgICAgICAgICAgICAgICB6ZXJvQ291bnQgPSAwOwotICAgICAgICB9Ci0KLSAgICAgICAgaW5pdEJ5dGVDb3VudCA9IGJ5dGVDb3VudDsKLQotICAgICAgICAvKiBkZXRlcm1pbmUgc2l6ZSBvZiB0aGUgTkFMIHVuaXQuIFNlYXJjaCBmb3IgbmV4dCBzdGFydCBjb2RlIHByZWZpeAotICAgICAgICAgKiBvciBlbmQgb2Ygc3RyZWFtIGFuZCBpZ25vcmUgcG9zc2libGUgdHJhaWxpbmcgemVybyBieXRlcyAqLwotICAgICAgICB6ZXJvQ291bnQgPSAwOwotICAgICAgICAvKmxpbnQgLWUoNzE2KSB3aGlsZSgxKSB1c2VkIGNvbnNjaW91c2x5ICovCi0gICAgICAgIHdoaWxlICgxKQotICAgICAgICB7Ci0gICAgICAgICAgICBieXRlID0gKnJlYWRQdHIrKzsKLSAgICAgICAgICAgIGJ5dGVDb3VudCsrOwotICAgICAgICAgICAgaWYgKCFieXRlKQotICAgICAgICAgICAgICAgIHplcm9Db3VudCsrOwotCi0gICAgICAgICAgICBpZiAoIChieXRlID09IDB4MDMpICYmICh6ZXJvQ291bnQgPT0gMikgKQotICAgICAgICAgICAgewotICAgICAgICAgICAgICAgIGhhc0VtdWxhdGlvbiA9IEhBTlRST19UUlVFOwotICAgICAgICAgICAgfQotCi0gICAgICAgICAgICBpZiAoIChieXRlID09IDB4MDEpICYmICh6ZXJvQ291bnQgPj0gMiApICkKLSAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICBwU3RybURhdGEtPnN0cm1CdWZmU2l6ZSA9Ci0gICAgICAgICAgICAgICAgICAgIGJ5dGVDb3VudCAtIGluaXRCeXRlQ291bnQgLSB6ZXJvQ291bnQgLSAxOwotICAgICAgICAgICAgICAgIHplcm9Db3VudCAtPSBNSU4oemVyb0NvdW50LCAzKTsKLSAgICAgICAgICAgICAgICBicmVhazsKLSAgICAgICAgICAgIH0KLSAgICAgICAgICAgIGVsc2UgaWYgKGJ5dGUpCi0gICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgaWYgKHplcm9Db3VudCA+PSAzKQotICAgICAgICAgICAgICAgICAgICBpbnZhbGlkU3RyZWFtID0gSEFOVFJPX1RSVUU7Ci0gICAgICAgICAgICAgICAgemVyb0NvdW50ID0gMDsKLSAgICAgIC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tdWxhdGlvbiBwcmV2ZW50aW9uIGJ5dGVzIGJlZm9yZSByYnNwIHByb2Nlc3NpbmcgKi8KLSAgICBpZiAoaGFzRW11bGF0aW9uKQotICAgIHsKLSAgICAgICAgdG1wID0gcFN0cm1EYXRhLT5zdHJtQnVmZlNpemU7Ci0gICAgICAgIHJlYWRQdHIgPSB3cml0ZVB0ciA9IHBTdHJtRGF0YS0+cFN0cm1CdWZmU3RhcnQ7Ci0gICAgICAgIHplcm9Db3VudCA9IDA7Ci0gICAgICAgIGZvciAoaSA9IHRtcDsgaS0tOykKLSAgICAgICAgewotICAgICAgICAgICAgaWYgKCh6ZXJvQ291bnQgPT0gMikgJiYgKCpyZWFkUHRyID09IDB4MDMpKQotICAgICAgICAgICAgewotICAgICAgICAgICAgICAgIC8qIGVtdWxhdGlvbiBwcmV2ZW50aW9uIGJ5dGUgc2hhbGwgYmUgZm9sbG93ZWQgYnkgb25lIG9mIHRoZQotICAgICAgICAgICAgICAgICAqIGZvbGxvd2luZyBieXRlczogMHgwMCwgMHgwMSwgMHgwMiwgMHgwMy4gVGhpcyBpbXBsaWVzIHRoYXQKLSAgICAgICAgICAgICAgICAgKiBlbXVsYXRpb24gcHJldmVudGlvbiAweDAzIGJ5dGUgc2hhbGwgbm90IGJlIHRoZSBsYXN0IGJ5dGUKLSAgICAgICAgICAgICAgICAgKiBvZiB0aGUgc3RyZWFtLiAqLwotICAgICAgICAgICAgICAgIGlmICggKGkgPT0gMCkgfHwgKCoocmVhZFB0cisxKSA+IDB4MDMpICkKLSAgICAgICAgICAgICAgICAgICAgcmV0dXJuKEhBTlRST19OT0spOwotCi0gICAgICAgICAgICAgICAgLyogZG8gbm90IHdyaXRlIGVtdWxhdGlvbiBwcmV2ZW50aW9uIGJ5dGUgKi8KLSAgICAgICAgICAgICAgICByZWFkUHRyKys7Ci0gICAgICAgICAgICAgICAgemVyb0NvdW50ID0gMDsKLSAgICAgICAgICAgIH0KLSAgICAgICAgICAgIGVsc2UKLSAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAvKiBOQUwgdW5pdCBzaGFsbCBub3QgY29udGFpbiBieXRlIHNlcXVlbmNlcyAweDAwMDAwMCwKLSAgICAgICAgICAgICAgICAgKiAweDAwMDAwMSBvciAweDAwMDAwMiAqLwotICAgICAgICAgICAgICAgIGlmICggKHplcm9Db3VudCA9PSAyKSAmJiAoKnJlYWRQdHIgPD0gMHgwMikgKQotICAgICAgICAgICAgICAgICAgICByZXR1cm4oSEFOVFJPX05PSyk7Ci0KLSAgICAgICAgICAgICAgICBpZiAoKnJlYWRQdHIgPT0gMCkKLSAgICAgICAgICAgICAgICAgICAgemVyb0NvdW50Kys7Ci0gICAgICAgICAgICAgICAgZWxzZQotICAgICAgICAgICAgICAgICAgICB6ZXJvQ291bnQgPSAwOwotCi0gICAgICAgICAgICAgICAgKndyaXRlUHRyKysgPSAqcmVhZFB0cisrOwotICAgICAgICAgICAgfQotICAgICAgICB9Ci0KLSAgICAgICAgLyogKHJlYWRQdHIgLSB3cml0ZVB0cikgaW5kaWNhdGVzIG51bWJlciBvZiAicmVtb3ZlZCIgZW11bGF0aW9uCi0gICAgICAgICAqIHByZXZlbnRpb24gYnl0ZXMgLT4gc3VidHJhY3QgZnJvbSBzdHJlYW0gYnVmZmVyIHNpemUgKi8KLSAgICAgICAgcFN0cm1EYXRhLT5zdHJtQnVmZlNpemUgLT0gKHUzMikocmVhZFB0ciAtIHdyaXRlUHRyKTsKLSAgICB9Ci0KLSAgICByZXR1cm4oSEFOVFJPX09LKTsKLQotfQotCmRpZmYgLS1naXQgYS9tZWRpYS9saWJzdGFnZWZyaWdodC9jb2RlY3Mvb24yL2gyNjRkZWMvc291cmNlL2gyNjRic2RfYnl0ZV9zdHJlYW0uaCBiL21lZGlhL2xpYnN0YWdlZnJpZ2h0L2NvZGVjcy9vbjIvaDI2NGRlYy9zb3VyY2UvaDI2NGJzZF9ieXRlX3N0cmVhbS5oCmRlbGV0ZWQgZmlsZSBtb2RlIDEw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Bjb25zdCB1OCB0b3RhbFplcm9zXzZbNjRdID0gewotICAgIDB4YTYsMHgwNiwweDE1LDB4MTUsMHg4NCwweDg0LDB4ODQsMHg4NCwKLSAgICAweDkzLDB4OTMsMHg5MywweDkzLDB4OTMsMHg5MywweDkzLDB4OTMsCi0gICAgMHg3MywweDczLDB4NzMsMHg3MywweDczLDB4NzMsMHg3MywweDczLAotICAgIDB4NjMsMHg2MywweDYzLDB4NjMsMHg2MywweDYzLDB4NjMsMHg2MywKLSAgICAweDUzLDB4NTMsMHg1MywweDUzLDB4NTMsMHg1MywweDUzLDB4NTMsCi0gICAgMHg0MywweDQzLDB4NDMsMHg0MywweDQzLDB4NDMsMHg0MywweDQzLAotICAgIDB4MzMsMHgzMywweDMzLDB4MzMsMHgzMywweDMzLDB4MzMsMHgzMywKLSAgICAweDIzLDB4MjMsMHgyMywweDIzLDB4MjMsMHgyMywweDIzLDB4MjN9OwotCi1zdGF0aWMgY29uc3QgdTggdG90YWxaZXJvc183WzY0XSA9IHsKLSAgICAweDk2LDB4MDYsMHgxNSwweDE1LDB4NzQsMHg3NCwweDc0LDB4NzQsCi0gICAgMHg4MywweDgzLDB4ODMsMHg4MywweDgzLDB4ODMsMHg4MywweDgzLAotICAgIDB4NjMsMHg2MywweDYzLDB4NjMsMHg2MywweDYzLDB4NjMsMHg2MywKLSAgICAweDQzLDB4NDMsMHg0MywweDQzLDB4NDMsMHg0MywweDQzLDB4NDMsCi0gICAgMHgzMywweDMzLDB4MzMsMHgzMywweDMzLDB4MzMsMHgzMywweDMzLAotICAgIDB4MjMsMHgyMywweDIzLDB4MjMsMHgyMywweDIzLDB4MjMsMHgyMywKLSAgICAweDUyLDB4NTIsMHg1MiwweDUyLDB4NTIsMHg1MiwweDUyLDB4NTIsCi0gICAgMHg1MiwweDUyLDB4NTIsMHg1MiwweDUyLDB4NTIsMHg1MiwweDUyfTsKLQotc3RhdGljIGNvbnN0IHU4IHRvdGFsWmVyb3NfOFs2NF0gPSB7Ci0g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pZiAoYml0cyA+PSAweDA0MDApCi0gICAgICAgIG51bVplcm9zID0gNTsKLSAgICBlbHNlIGlmIChiaXRzID49IDB4MDIwMCkKLSAgICAgICAgbnVtWmVyb3MgPSA2OwotICAgIGVsc2UgaWYgKGJpdHMgPj0gMHgwMTAwKQotICAgICAgICBudW1aZXJvcyA9IDc7Ci0gICAgZWxzZSBpZiAoYml0cyA+PSAweDAwODApCi0gICAgICAgIG51bVplcm9zID0gODsKLSAgICBlbHNlIGlmIChiaXRzID49IDB4MDA0MCkKLSAgICAgICAgbnVtWmVyb3MgPSA5OwotICAgIGVsc2UgaWYgKGJpdHMgPj0gMHgwMDIwKQotICAgICAgICBudW1aZXJvcyA9IDEwOwotICAgIGVsc2UgaWYgKGJpdHMgPj0gMHgwMDEwKQotICAgICAgICBudW1aZXJvcyA9IDExOwotICAgIGVsc2UgaWYgKGJpdHMgPj0gMHgwMDA4KQotICAgICAgICBudW1aZXJvcyA9IDEyOwotICAgIGVsc2UgaWYgKGJpdHMgPj0gMHgwMDA0KQotICAgICAgICBudW1aZXJvcyA9IDEzOwotICAgIGVsc2UgaWYgKGJpdHMgPj0gMHgwMDAyKQotICAgICAgICBudW1aZXJvcyA9IDE0OwotICAgIGVsc2UgaWYgKGJpdHMgPj0gMHgwMDAxKQotICAgICAgICBudW1aZXJvcyA9IDE1OwotICAgIGVsc2UgLyogbW9yZSB0aGFuIDE1IHplcm9zIGVuY291bnRlcmVkIHdoaWNoIGlzIGFuIGVycm9yICovCi0gICAgICAgIHJldHVybihWTENfTk9UX0ZPVU5EKTsKLQotICAgIHJldHVybihudW1aZXJvcyk7Ci0KLX0KLQotLyotLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0KLQotICAgIEZ1bmN0aW9uOiBEZWNvZGVUb3RhbFplcm9zCi0KLSAgICAgICAgRnVuY3Rpb25hbCBk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Vyb3NfMV8wW2JpdHMgPj4gNF07Ci0gICAgICAgICAgICAgICAgaWYgKCF2YWx1ZSkKLSAgICAgICAgICAgICAgICAgICAgdmFsdWUgPSB0b3RhbFplcm9zXzFfMVtiaXRzXTsKLSAgICAgICAgICAgICAgICBicmVhazsKLQotICAgICAgICAgICAgY2FzZSAyOgotICAgICAgICAgICAgICAgIHZhbHVlID0gdG90YWxaZXJvc18yW2JpdHMgPj4gM107Ci0gICAgICAgICAgICAgICAgYnJlYWs7Ci0KLSAgICAgICAgICAgIGNhc2UgMzoKLSAgICAgICAgICAgICAgICB2YWx1ZSA9IHRvdGFsWmVyb3NfM1tiaXRzID4+IDNdOwotICAgICAgICAgICAgICAgIGJyZWFrOwotCi0gICAgICAgICAgICBjYXNlIDQ6Ci0gICAgICAgICAgICAgICAgdmFsdWUgPSB0b3RhbFplcm9zXzRbYml0cyA+PiA0XTsKLSAgICAgICAgICAgICAgICBicmVhazsKLQotICAgICAgICAgICAgY2FzZSA1OgotICAgICAgICAgICAgICAgIHZhbHVlID0gdG90YWxaZXJvc181W2JpdHMgPj4gNF07Ci0gICAgICAgICAgICAgICAgYnJlYWs7Ci0KLSAgICAgICAgICAgIGNhc2UgNjoKLSAgICAgICAgICAgICAgICB2YWx1ZSA9IHRvdGFsWmVyb3NfNltiaXRzID4+IDNdOwotICAgICAgICAgICAgICAgIGJyZWFrOwotCi0gICAgICAgICAgICBjYXNlIDc6Ci0gICAgICAgICAgICAgICAgdmFsdWUgPSB0b3RhbFplcm9zXzdbYml0cyA+PiAzXTsKLSAgICAgICAgICAgICAgICBicmVhazsKLQotICAgICAgICAgICAgY2FzZSA4OgotICAgICAgICAgICAgICAgIHZhbHVlID0gdG90YWxaZXJvc184W2JpdHMgPj4gM107Ci0gICAgICAgICAgICAgICAgYnJlYWs7Ci0KLSAgICAgICAgICAgIGNhc2UgOToKLSAgICAgICAgICAgICAgICB2YWx1ZSA9IHRvdGFsWmVyb3NfOVtiaXRzID4+IDNdOwotICAgICAgICAgICAgICAgIGJyZWFrOwotCi0gICAgICAgICAgICBjYXNlIDEwOgotICAgICAgICAgICAgICAgIHZhbHVlID0gdG90YWxaZXJvc18xMFtiaXRzID4+IDRdOwotICAgICAgICAgICAgICAgIGJyZWFrOwotCi0gICAgICAgICAgICBjYXNlIDExOgotICAgICAgICAgICAgICAgIHZhbHVlID0gdG90YWxaZXJvc18xMVtiaXRzID4+IDVdOwotICAgICAgICAgICAgICAgIGJyZWFrOwotCi0gICAgICAgICAgICBjYXNlIDEyOgotICAgICAgICAgICAgICAgIHZhbHVlID0gdG90YWxaZXJvc18xMltiaXRzID4+IDVdOwotICAgICAgICAgICAgICAgIGJyZWFrOwotCi0gICAgICAgICAgICBjYXNlIDEzOgotICAgICAgICAgICAgICAgIHZhbHVlID0gdG90YWxaZXJvc18xM1tiaXRzID4+IDZdOwotICAgICAgICAgICAgICAgIGJyZWFrOwotCi0gICAgICAgICAgICBjYXNlIDE0OgotICAgICAgICAgICAgICAgIHZhbHVlID0gdG90YWxaZXJvc18xNFtiaXRzID4+IDddOwotICAgICAgICAgICAgICAgIGJyZWFrOwotCi0gICAgICAgICAgICBkZWZhdWx0OiAvKiBjYXNlIDE1ICovCi0gICAgICAgICAgICAgICAgdmFsdWUgPSAoYml0cyA+PiA4KSA/IDB4MTEgOiAweDAxOwotICAgICAgICAgICAgICAgIGJyZWFrOwotICAgICAgICB9Ci0gICAgfQotICAgIGVsc2UKLSAgICB7Ci0gICAgICAgIEFTU0VSVCh0b3RhbENvZWZmIDwgNCk7Ci0gICAgICAgIGJpdHMgPj49IDY7Ci0gICAgICAgIGlmIChiaXRzID4gMykKLSAgICAgICAgICAgIHZhbHVlID0gMHgwMTsKLSAgICAgICAgZWxzZQotICAgICAgICB7Ci0gICAgICAgICAgICBpZiAodG90YWxDb2VmZiA9PSAzKQotICAgICAgICAgICAgICAgIHZhbHVlID0gMHgxMTsKLSAgICAgICAgICAgIGVsc2UgaWYgKGJpdHMgPiAxKQotICAgICAgICAg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lY29kZVJ1bkJlZm9yZSh1MzIgYml0cywgdTMyIHplcm9zTGVmdCkKLXsKLQotLyogVmFyaWFibGVzICovCi0KLSAgICB1MzIgdmFsdWUgPSAweDA7Ci0KLS8qIENvZGUgKi8KLQotICAgIHN3aXRjaCAoemVyb3NMZWZ0KQotICAgIHsKLSAgICAgICAgY2FzZSAxOgotICAgICAgICAgICAgdmFsdWUgPSBydW5CZWZvcmVfMVtiaXRzPj4xMF07Ci0gICAgICAgICAgICBicmVhazsKLQotICAgICAgICBjYXNlIDI6Ci0gICAgICAgICAgICB2YWx1ZSA9IHJ1bkJlZm9yZV8yW2JpdHM+PjldOwotICAgICAgICAgICAgYnJlYWs7Ci0KLSAgICAgICAgY2FzZSAzOgotICAgICAgICAgICAgdmFsdWUgPSBydW5CZWZvcmVfM1tiaXRzPj45XTsKLSAgICAgICAgICAgIGJyZWFrOwotCi0gICAgICAgIGNhc2UgNDoKLSAgICAgICAgICAgIHZhbHVlID0gcnVuQmVmb3JlXzRbYml0cz4+OF07Ci0gICAgICAgICAgICBicmVhazsKLQotICAgICAgICBjYXNlIDU6Ci0gICAgICAgICAgICB2YWx1ZSA9IHJ1bkJlZm9yZV81W2JpdHM+PjhdOwotICAgICAgICAgICAgYnJlYWs7Ci0KLSAgICAgICAgY2FzZSA2OgotICAgICAgICAgICAgdmFsdWUgPSBydW5CZWZvcmVfNltiaXRzPj44XTsKLSAgICAgICAgICAgIGJyZWFrOwotCi0gICAgICAgIGRlZmF1bHQ6Ci0gICAgICAgICAgICBpZiAoYml0cyA+PSAweDEwMCkKLSAgICAgICAgICAgICAgICB2YWx1ZSA9ICgoNy0oYml0cz4+OCkpPDw0KSsweDM7Ci0gICAgICAgICAgICBlbHNlIGlmIChiaXRzID49IDB4ODApCi0gICAgICAgICAgICAgICAgdmFsdWUgPSAweDc0OwotICAgICAgICAgICAgZWxzZSBpZiAoYml0cyA+PSAweDQwKQotICAgICAgICAgICAgICAgIHZhbHVlID0gMHg4NTsKLSAgICAgICAgICAgIGVsc2UgaWYgKGJpdHMgPj0gMHgyMCkKLSAgICAgICAgICAgICAgICB2YWx1ZSA9IDB4OTY7Ci0gICAgICAgICAgICBlbHNlIGlmIChiaXRzID49IDB4MTApCi0gICAgICAgICAgICAgICAgdmFsdWUgPSAweGE3OwotICAgICAgICAgICAgZWxzZSBpZiAoYml0cyA+PSAweDgpCi0gICAgICAgICAgICAgICAgdmFsdWUgPSAweGI4OwotICAgICAgICAgICAgZWxzZSBpZiAoYml0cyA+PSAweDQpCi0gICAgICAgICAgICAgICAgdmFsdWUgPSAweGM5OwotICAgICAgICAgICAgZWxzZSBpZiAoYml0cyA+PSAweDIpCi0gICAgICAgICAgICAgICAgdmFsdWUgPSAweGRBOwotICAgICAgICAgICAgZWxzZSBpZiAoYml0cykKLSAgICAgICAgICAgICAgICB2YWx1ZSA9IDB4ZUI7Ci0gICAgICAgICAgICBpZiAoSU5GTyh2YWx1ZSkgPiB6ZXJvc0xlZnQpCi0gICAgICAgICAgICAgICAgdmFsdWUgPSAwOwotICAgICAgICAgICAgYnJlYWs7Ci0gICAgfQotCi0gICAgcmV0dXJuKHZhbHVlKTsKLQotfQotCi0vKi0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLQotCi0gICAgRnVuY3Rpb246IERlY29kZVJlc2lkdWFsQmxvY2tDYXZsYwotCi0gICAgICAgIEZ1bmN0aW9uYWwgZGVzY3JpcHRpb246Ci0gICAgICAgICAgRnVuY3Rpb24gdG8gZGVjb2RlIG9uZSBDQVZMQyBjb2RlZCBibG9jay4gVGhpcyBjb3JyZXNwb25kcyB0bwotICAgICAgICAgIHN5bnRheCBlbGVtZW50cyByZXNpZHVhbF9ibG9ja19jYXZsYygpIGluIHRoZSBzdGFuZGFyZC4KLQotICAgICAgICBJbnB1dHM6Ci0gICAgICAgICAgcFN0cm1EYXRhICAgICAgICAgICAgIHBvaW50ZXIgdG8gc3RyZWFtIGRhdGEgc3RydWN0dXJlCi0gICAgICAgICAgbmMgICAgICAgICAgICAgICAgICAgIG5DIHZhbHVlCi0gICAgICAgICAgbWF4TnVtQ29lZmYgICAgICAgICAgIG1heGltdW0gbnVtYmVyIG9mIHJlc2lkdWFsIGNvZWZmaWNpZW50cwotCi0gICAgICAgIE91dHB1dHM6Ci0gICAgICAgICAgY29lZmZMZXZlbCAgICAgICAgICAgIHN0b3JlcyBkZWNvZGVkIGNvZWZmaWNpZW50IGxldmVscwotCi0gICAgICAgIFJldHVybnM6Ci0gICAgICAgICAgbnVtQ29lZmZzICAgICAgICAgICAgIG9uIGJpdHMgWzQsMTFdIGlmIHN1Y2Nlc3NmdWwKLSAgICAgICAgICBjb2VmZk1hcCAgICAgICAgICAgICAgb24gYml0cyBbMTYsMzFdIGlmIHN1Y2Nlc3NmdWwsIHRoaXMgaXMgYml0IG1hcAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB3aGVyZSBlYWNoIGJpdCBpbmRpY2F0ZXMgaWYgdGhlIGNvcnJlc3BvbmRpbmcKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY29lZmZpY2llbnQgd2FzIHplcm8gKDApIG9yIG5vbi16ZXJvICgxKQotICAgICAgICAgIEhBTlRST19OT0sgICAgICAgICAgICBlbmQgb2Ygc3RyZWFtIG9yIGVycm9yIGluIHN0cmVhbQotCi0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0qLwotCi11MzIgaDI2NGJzZERlY29kZVJlc2lkdWFsQmxvY2tDYXZsYygKLSAgc3RybURhdGFfdCAqcFN0cm1EYXRhLAotICBpMzIgKmNvZWZmTGV2ZWwsCi0gIGkzMiBuYywKLSAgdTMyIG1heE51bUNvZWZmKQotewotCi0vKiBWYXJpYWJsZXMgK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EhfVEModG1wKSk7Ci0KLSAgICB0b3RhbENvZWZmID0gVE9UQUxfQ09FRkYodG1wKTsKLSAgICBpZiAodG90YWxDb2VmZiA+IG1heE51bUNvZWZmKQotICAgICAgICByZXR1cm4oSEFOVFJPX05PSyk7Ci0gICAgdHJhaWxpbmdPbmVzID0gVFJBSUxJTkdfT05FUyh0bXApOwotCi0gICAgaWYgKHRvdGFsQ29lZmYgIT0gMCkKLSAgICB7Ci0gICAgICAgIGkgPSAwOwotICAgICAgICAvKiBub256ZXJvIGNvZWZmaWNpZW50czogKy8tIDEgKi8KLSAgICAgICAgaWYgKHRyYWlsaW5nT25lcykKLSAgICAgICAgewotICAgICAgICAgICAgQlVGRkVSX0dFVChidWZmZXJWYWx1ZSwgYnVmZmVyQml0cywgYml0LCB0cmFpbGluZ09uZXMpOwotICAgICAgICAgICAgdG1wID0gMSA8PCAodHJhaWxpbmdPbmVzIC0gMSk7Ci0gICAgICAgICAgICBmb3IgKDsgdG1wOyBpKyspCi0gICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgbGV2ZWxbaV0gPSBiaXQgJiB0bXAgPyAtMSA6IDE7Ci0gICAgICAgICAgICAgICAgdG1wID4+PSAxOwotICAgICAgICAgICAgfQotICAgICAgICB9Ci0KLSAgICAgICAgLyogb3RoZXIgbGV2ZWxzICovCi0gICAgICAgIGlmICh0b3RhbENvZWZmID4gMTAgJiYgdHJhaWxpbmdPbmVzIDwgMykKLSAgICAgICAgICAgIHN1ZmZpeExlbmd0aCA9IDE7Ci0gICAgICAgIGVsc2UKLSAgICAgICAgICAgIHN1ZmZpeExlbmd0aCA9IDA7Ci0KLSAgICAgICAgZm9yICg7IGkgPCB0b3RhbENvZWZmOyBpKyspCi0gICAgICAgIHsKLSAgICAgICAgICAgIEJVRkZFUl9TSE9XKGJ1ZmZlclZhbHVlLCBidWZmZXJCaXRzLCBiaXQsIDE2KTsKLSAgICAgICAgICAgIGxldmVsUHJlZml4ID0gRGVjb2RlTGV2ZWxQcmVmaXgoYml0KTsKLSAgICAgICAgICAgIGlmIChsZXZlbFByZWZpeCA9PSBWTENfTk9UX0ZPVU5EKQotICAgICAgICAgICAgICAgIHJldHVybihIQU5UUk9fTk9LKTsKLSAgICAgICAgICAgIEJVRkZFUl9GTFVTSChidWZmZXJWYWx1ZSwgYnVmZmVyQml0cywgbGV2ZWxQcmVmaXgrMSk7Ci0KLSAgICAgICAgICAgIGlmIChsZXZlbFByZWZpeCA8IDE0KQotICAgICAgICAgICAgICAgIHRtcCA9IHN1ZmZpeExlbmd0aDsKLSAgICAgICAgICAgIGVsc2UgaWYgKGxldmVsUHJlZml4ID09IDE0KQotICAgICAgICAgICAgewotICAgICAgICAgICAgICAgIHRtcCA9IHN1ZmZpeExlbmd0aCA/IHN1ZmZpeExlbmd0aCA6IDQ7Ci0gICAgICAgICAgICB9Ci0gICAgICAgICAgICBlbHNlCi0gICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgLyogc2V0dGluZyBzdWZmaXhMZW5ndGggdG8gMSBoZXJlIGNvcnJlc3BvbmRzIHRvIGFkZGluZyAxNQotICAgICAgICAgICAgICAgICAqIHRvIGxldmVsQ29kZSB2YWx1ZSBpZiBsZXZlbFByZWZpeCA9PSAxNSBhbmQKLSAgICAgICAgICAgICAgICAgKiBzdWZmaXhMZW5ndGggPT0gMCAqLwotICAgICAgICAgICAgICAgIGlmICghc3VmZml4TGVuZ3RoKQotICAgICAgICAgICAgICAgICAgICBzdWZmaXhMZW5ndGggPSAxOwotICAgICAgICAgICAgICAgIHRtcCA9IDEyOwotICAgICAgICAgICAgfQotCi0gICAgICAgICAgICBpZiAoc3VmZml4TGVuZ3RoKQotICAgICAgICAgICAgICAgIGxldmVsUHJlZml4IDw8PSBzdWZmaXhMZW5ndGg7Ci0KLSAgICAgICAgICAgIGlmICh0bXApCi0gICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgQlVGRkVSX0dFVChidWZmZXJWYWx1ZSwgYnVmZmVyQml0cywgbGV2ZWxTdWZmaXgsIHRtcCk7Ci0gICAgICAgICAgICAgICAgbGV2ZWxQcmVmaXggKz0gbGV2ZWxTdWZmaXg7Ci0gICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgIHRtcCA9IGxldmVsUHJlZml4OwotCi0gICAgICAgICAgICBpZiAoaSA9PSB0cmFpbGluZ09uZXMgJiYgdHJhaWxpbmdPbmVzIDwgMykKLSAgICAgICAgICAgICAgICB0bXAgKz0gMjsKLQotICAgICAgICAgICAgbGV2ZWxbaV0gPSAodG1wKzIpPj4xOwotCi0gICAgICAgICAgICBpZiAoc3VmZml4TGVuZ3RoID09IDApCi0gICAgICAgICAgICAgICAgc3VmZml4TGVuZ3RoID0gMTsKLQotICAgICAgICAgICAgaWYgKChsZXZlbFtpXSA+ICgzIDw8IChzdWZmaXhMZW5ndGggLSAxKSkpICYmIHN1ZmZpeExlbmd0aCA8IDYpCi0gICAgICAgICAgICAgICAgc3VmZml4TGVuZ3RoKys7Ci0KLSAgICAgICAgICAgIGlmICh0bXAgJiAweDEpCi0gICAgICAgICAgICAgICAgbGV2ZWxbaV0gPSAtbGV2ZWxbaV07Ci0gICAgICAgIH0KLQotICAgICAgICAvKiB6ZXJvIHJ1bnMgKi8KLSAgICAgICAgaWYgKHRvdGFsQ29lZmYgPCBtYXhOdW1Db2VmZikKLSAgICAgICAgewotICAgICAgICAgICAgQlVGRkVSX1NIT1coYnVmZmVyVmFsdWUsIGJ1ZmZlckJpdHMsIGJpdCw5KTsKLSAgICAgICAgICAgIHplcm9zTGVmdCA9IERlY29kZVRvdGFsWmVyb3MoYml0LCB0b3RhbENvZWZmLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICh1MzIpKG1heE51bUNvZWZmID09IDQpKTsKLSAgICAgICAgICAgIGlmICghemVyb3NMZWZ0KQotICAgICAgICAgICAgICAgIHJldHVybihIQU5UUk9fTk9LKTsKLSAgICAgICAgICAgIEJVRkZFUl9GTFVTSChidWZmZXJWYWx1ZSwgYnVmZmVyQml0cywgTEVOR1RIKHplcm9zTGVmdCkpOwotICAgICAgICAgICAgemVyb3NMZWZ0ID0gSU5GTyh6ZXJvc0xlZnQpOwotICAgICAgICB9Ci0gICAgICAgIGVsc2UKLSAgICAgICAgICAgIHplcm9zTGVmdCA9IDA7Ci0KLSAgICAgICAgZm9yIChpID0gMDsgaSA8IHRvdGFsQ29lZmYgLSAxOyBpKyspCi0gICAgICAgIHsKLSAgICAgICAgICAgIGlmICh6ZXJvc0xlZnQgPiAwKQotICAgICAgICAgICAgewotICAgICAgICAgICAgICAgIEJVRkZFUl9TSE9XKGJ1ZmZlclZhbHVlLCBidWZmZXJCaXRzLCBiaXQsMTEpOwotICAgICAgICAgICAgICAgIHRtcCA9IERlY29kZVJ1bkJlZm9yZShiaXQsIHplcm9zTGVmdCk7Ci0gICAgICAgICAgICAgICAgaWYgKCF0bXApCi0gICAgICAgICAgICAgICAgICAgIHJldHVybihIQU5UUk9fTk9LKTsKLSAgICAgICAgICAgICAgICBCVUZGRVJfRkxVU0goYnVmZmVyVmFsdWUsIGJ1ZmZlckJpdHMsIExFTkdUSCh0bXApKTsKLSAgICAgICAgICAgICAgICBydW5baV0gPSBJTkZPKHRtcCk7Ci0gICAgICAgICAgICAgICAgemVyb3NMZWZ0IC09IHJ1bltpXSsrOwotICAgICAgICAgICAgfQotICAgICAgICAgICAgZWxzZQotICAgICAgICAgICAgewotICAgICAgICAgICAgICAgIHJ1bltpXSA9IDE7Ci0gICAgICAgICAgICB9Ci0gICAgICAgIH0KLQotICAgICAgICAvKiBjb21iaW5pbmcgbGV2ZWwgYW5kIHJ1biwgbGV2ZWxTdWZmaXggdmFyaWFibGUgdXNlZCB0byBob2xkIGNvZWZmTWFwLAotICAgICAgICAgKiBpLmUuIGJpdCBtYXAgaW5kaWNhdGluZyB3aGljaCBjb2VmZmljaWVudHMgaGFkIG5vbi16ZXJvIHZhbHVlLiAqLwotCi0gICAgICAgIC8qbGludCAtZXN5bSg3N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SAgICAgICAgZm9yIChqID0gMDsgaiA8IHdpZHRoOyBqKyspCi0gICAgICAgIHsKLSAgICAgICAgICAgIGkgPSByb3cgLSAxOwotICAgICAgICAgICAgbWIgPSBwU3RvcmFnZS0+bWIgKyBpKndpZHRoICsgajsKLSAgICAgICAgICAgIGRvCi0gICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgQ29uY2VhbE1iKG1iLCBjdXJySW1hZ2UsIGksIGosIHNsaWNlVHlwZSwgcmVmRGF0YSk7Ci0gICAgICAgICAgICAgICAgbWItPmRlY29kZWQgPSAxOwotICAgICAgICAgICAgICAgIHBTdG9yYWdlLT5udW1Db25jZWFsZWRNYnMrKzsKLSAgICAgICAgICAgICAgICBtYiAtPSB3aWR0aDsKLSAgICAgICAgICAgIH0gd2hpbGUoaS0tKTsKLSAgICAgICAgfQotICAgIH0KLQotICAgIC8qIHByb2Nlc3Mgcm93cyBiZWxvdyB0aGUgb25lIGNvbnRhaW5pbmcgdGhlIGZpcnN0IGNvcnJlY3QgbWFjcm9ibG9jayAqLwotICAgIGZvciAoaSA9IHJvdyArIDE7IGkgPCBoZWlnaHQ7IGkrKykKLSAgICB7Ci0gICAgICAgIG1iID0gcFN0b3JhZ2UtPm1iICsgaSAqIHdpZHRoOwotCi0gICAgICAgIGZvciAoaiA9IDA7IGogPCB3aWR0aDsgaisrKQotICAgICAgICB7Ci0gICAgICAgICAgICBpZiAoIW1iW2pdLmRlY29kZWQpCi0gICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgQ29uY2VhbE1iKG1iK2osIGN1cnJJbWFnZSwgaSwgaiwgc2xpY2VUeXBlLCByZWZEYXRhKTsKLSAgICAgICAgICAgICAgICBtYltqXS5kZWNvZGVkID0gMTsKLSAgICAgICAgICAgICAgICBwU3RvcmFnZS0+bnVtQ29uY2VhbGVkTWJzKys7Ci0gICAgICAgICAgICB9Ci0gICAgICAgIH0KLSAgICB9Ci0KLSAgICByZXR1cm4oSEFOVFJPX09LKTsKLX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maWVsZHMgKi8KLSAgICBwTWItPm1iVHlwZSA9IElfNHg0OwotICAgIHBNYi0+ZmlsdGVyT2Zmc2V0QSA9IDA7Ci0gICAgcE1iLT5maWx0ZXJPZmZzZXRCID0gMDsKLSAgICBwTWItPmNocm9tYVFwSW5kZXhPZmZzZXQgPSAwOwotCi0gICAgaWYgKElTX0lfU0xJQ0Uoc2xpY2VUeXBlKSkKLSAgICAgICAgSDI2NFN3RGVjTWVtc2V0KGRhdGEsIDAsIHNpemVvZihkYXRhKSk7Ci0gICAgZWxzZQotICAgIHsKLSAgICAgICAgbXZfdCBtdiA9IHswLDB9OwotICAgICAgICBpbWFnZV90IHJlZkltYWdlOwotICAgICAgICByZWZJbWFnZS53aWR0aCA9IHdpZHRoOwotICAgICAgICByZWZJbWFnZS5oZWlnaHQgPSBoZWlnaHQ7Ci0gICAgICAgIHJlZkltYWdlLmRhdGEgPSByZWZEYXRhOwotICAgICAgICBpZiAocmVmSW1hZ2UuZGF0YSkKLSAgICAgICAgewotI2lmbmRlZiBIMjY0REVDX09NWERMCi0gICAgICAgICAgICBoMjY0YnNkUHJlZGljdFNhbXBsZXMoZGF0YSwgJm12LCAmcmVmSW1hZ2UsIGNvbCoxNiwgcm93KjE2LAotICAgICAgICAgICAgICAgIDAsIDAsIDE2LCAxNik7Ci0jZWxzZQotICAgICAgICAgICAgaDI2NGJzZFByZWRpY3RTYW1wbGVzKGRhdGEsICZtdiwgJnJlZkltYWdlLAotICAgICAgICAgICAgICAgICAgICAoKHJvdyoxNikgKyAoKGNvbCoxNik8PDE2KSksCi0gICAgICAgICAgICAgICAgICAgIDB4MDAwMDEwMTAsIHBGaWxsKTsKLSNlbmRpZgotICAgICAgICAgICAgaDI2NGJzZFdyaXRlTWFjcm9ibG9jayhjdXJySW1hZ2UsIGRhdGEpOwotCi0gICAgICAgICAgICByZXR1cm4oSEFOVFJPX09LKTsKLSAgICAgICAgfQotICAgICAgICBlbHNlCi0gICAgICAgICAgICBIMjY0U3dEZW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AgICAgY2FzZSAxOgotICAgICAgICAgICAgZmlyc3RQaGFzZVswXSA+Pj0gNDsKLSAgICAgICAgICAgIGJyZWFrOwotCi0gICAgICAgIGNhc2UgMjoKLSAgICAgICAgICAgIGZpcnN0UGhhc2VbMF0gPj49IDU7Ci0gICAgICAgICAgICBicmVhazsKLQotICAgICAgICBjYXNlIDM6Ci0gICAgICAgICAgICAvKiBhcHByb3hpbWF0ZSAoZmlyc3RQaGFzZVswXSo0LzMpPj42ICovCi0gICAgICAgICAgICBmaXJzdFBoYXNlWzBdID0gKDIxICogZmlyc3RQaGFzZVswXSkgPj4gMTA7Ci0gICAgICAgICAgICBicmVhazsKLQotICAgICAgICBkZWZhdWx0OiAvKiA0ICovCi0gICAgICAgICAgICBmaXJzdFBoYXNlWzBdID4+PSA2OwotICAgICAgICAgICAgYnJlYWs7Ci0KLSAgICB9Ci0KLQotICAgIFRyYW5zZm9ybShmaXJzdFBoYXNlKTsKLQotICAgIGZvciAoaSA9IDAsIHBEYXRhID0gZGF0YSwgcFRtcCA9IGZpcnN0UGhhc2U7IGkgPCAyNTY7KQotICAgIHsKLSAgICAgICAgdG1wID0gcFRtcFsoaSAmIDB4Rik+PjJdOwotICAgICAgICAvKmxpbnQgLWU3MzQgQ0xJUDEgbWFjcm8gcmVzdWx0cyBpbiB2YWx1ZSB0aGF0IGZpdHMgaW50byA4IGJpdHMgKi8KLSAgICAgICAgKnBEYXRhKysgPSBDTElQMSh0bXApOwotICAgICAgICAvKmxpbnQgK2U3MzQgKi8KLQotICAgICAgICBpKys7Ci0gICAgICAgIGlmICghKGkgJiAweDNGKSkKLSAgICAgICAgICAgIHBUbXAgKz0gNDsKLSAgICB9Ci0KLSAgICAvKiBjaHJvbWEgY29tcG9uZW50cyAqLwotICAgIG1iUG9zID0gY3VyckltYWdlLT5kYXRhICsgd2lkdGggKiBoZWlnaHQgKiAyNTYgKwotICAgICAgIHJvdyAqIDggKiB3aWR0aCAqIDggKyBjb2wgKiA4OwotICAgIGZvciAoY29tcCA9IDA7IGNvbXAgPCAyOyBjb21wKyspCi0gICAgewotCi0gICAgICAgIEgyNjRTd0RlY01lbXNldChmaXJzdFBoYXNlLCAwLCBzaXplb2YoZmlyc3RQaGFzZSkpOwotCi0gICAgICAgIC8qIGNvdW50ZXIgZm9yIG51bWJlciBvZiBuZWlnaGJvdXJzIHVzZWQgKi8KLSAgICAgICAgaiA9IDA7Ci0gICAgICAgIGhvciA9IHZlciA9IDA7Ci0gICAgICAgIGlmIChBKQotICAgICAgICB7Ci0gICAgICAgICAgICBwRGF0YSA9IG1iUG9zIC0gd2lkdGgqODsKLSAgICAgICAgICAgIGFbMF0gPSAqcERhdGErKzsgYVswXSArPSAqcERhdGErKzsKLSAgICAgICAgICAgIGFbMV0gPSAqcERhdGErKzsgYVsxXSArPSAqcERhdGErKzsKLSAgICAgICAgICAgIGFbMl0gPSAqcERhdGErKzsgYVsyXSArPSAqcERhdGErKzsKLSAgICAgICAgICAgIGFbM10gPSAqcERhdGErKzsgYVszXSArPSAqcERhdGErKzsKLSAgICAgICAgICAgIGorKzsKLSAgICAgICAgICAgIGhvcisrOwotICAgICAgICAgICAgZmlyc3RQaGFzZVswXSArPSBhWzBdICsgYVsxXSArIGFbMl0gKyBhWzNdOwotICAgICAgICAgICAgZmlyc3RQaGFzZVsxXSArPSBhWzBdICsgYVsxXSAtIGFbMl0gLSBhWzNdOwotICAgICAgICB9Ci0gICAgICAgIGlmIChCKQotICAgICAgICB7Ci0gICAgICAgICAgICBwRGF0YSA9IG1iUG9zICsgOCp3aWR0aCo4OwotICAgICAgICAgICAgYlswXSA9ICpwRGF0YSsrOyBiWzBdICs9ICpwRGF0YSsrOwotICAgICAgICAgICAgYlsxXSA9ICpwRGF0YSsrOyBiWzFdICs9ICpwRGF0YSsrOwotICAgICAgICAgICAgYlsyXSA9ICpwRGF0YSsrOyBiWzJdICs9ICpwRGF0YSsrOwotICAgICAgICAgICAgYlszXSA9ICpwRGF0YSsrOyBiWzNdICs9ICpwRGF0YSsrOwotICAgICAgICAgICAgaisrOwotICAgICAgICAgICAgaG9yKys7Ci0gICAgICAgICAgICBmaXJzdFBoYXNlWzBdICs9IGJbMF0gKyBiWzFdICsgYlsyXSArIGJbM107Ci0gICAgICAgICAgICBmaXJzdFBoYXNlWzFdICs9IGJbMF0gKyBiWzFdIC0gYlsyXSAtIGJbM107Ci0gICAgICAgIH0KLSAgICAgICAgaWYgKEwpCi0gICAgICAgIHsKLSAgICAgICAgICAgIHBEYXRhID0gbWJQb3MgLSAxOwotICAgICAgICAgICAgbFswXSA9IHBEYXRhWzBdOyBsWzBdICs9IHBEYXRhWzgqd2lkdGhdOwotICAgICAgICAgICAgcERhdGEgKz0gMTYqd2lkdGg7Ci0gICAgICAgICAgICBsWzFdID0gcERhdGFbMF07IGxbMV0gKz0gcERhdGFbOCp3aWR0aF07Ci0gICAgICAgICAgICBwRGF0YSArPSAxNip3aWR0aDsKLSAgICAgICAgICAgIGxbMl0gPSBwRGF0YVswXTsgbFsyXSArPSBwRGF0YVs4KndpZHRoXTsKLSAgICAgICAgICAgIHBEYXRhICs9IDE2KndpZHRoOwotICAgICAgICAgICAgbFszXSA9IHBEYXRhWzBdOyBsWzNdICs9IHBEYXRhWzgqd2lkdGhdOwotICAgICAgICAgICAgaisrOwotICAgICAgICAgICAgdmVyKys7Ci0gICAgICAgICAgICBmaXJzdFBoYXNlWzBdICs9IGxbMF0gKyBsWzFdICsgbFsyXSArIGxbM107Ci0gICAgICAgICAgICBmaXJzdFBoYXNlWzRdICs9IGxbMF0gKyBsWzFdIC0gbFsyXSAtIGxbM107Ci0gICAgICAgIH0KLSAgICAgICAgaWYgKFIpCi0gICAgICAgIHsKLSAgICAgICAgICAgIHBEYXRhID0gbWJQb3MgKyA4OwotICAgICAgICAgICAgclswXSA9IHBEYXRhWzBdOyByWzBdICs9IHBEYXRhWzgqd2lkdGhdOwotICAgICAgICAgICAgcERhdGEgKz0gMTYqd2lkdGg7Ci0gICAgICAgICAgICByWzFdID0gcERhdGFbMF07IHJbMV0gKz0gcERhdGFbOCp3aWR0aF07Ci0gICAgICAgICAgICBwRGF0YSArPSAxNip3aWR0aDsKLSAgICAgICAgICAgIHJbMl0gPSBwRGF0YVswXTsgclsyXSArPSBwRGF0YVs4KndpZHRoXTsKLSAgICAgICAgICAgIHBEYXRhICs9IDE2KndpZHRoOwotICAgICAgICAgICAgclszXSA9IHBEYXRhWzBdOyByWzNdICs9IHBEYXRhWzgqd2lkdGhdOwotICAgICAgICAgICAgaisrOwotICAgICAgICAgICAgdmVyKys7Ci0gICAgICAgICAgICBmaXJzdFBoYXNlWzBdICs9IHJbMF0gKyByWzFdICsgclsyXSArIHJbM107Ci0gICAgICAgICAgICBmaXJzdFBoYXNlWzRdICs9IHJbMF0gKyByWzFdIC0gclsyXSAtIHJbM107Ci0gICAgICAgIH0KLSAgICAgICAgaWYgKCFob3IgJiYgTCAmJiBSKQotICAgICAgICAgICAgZmlyc3RQaGFzZVsxXSA9IChsWzBdK2xbMV0rbFsyXStsWzNdLXJbMF0tclsxXS1yWzJdLXJbM10pID4+IDQ7Ci0gICAgICAgIGVsc2UgaWYgKGhvcikKLSAgICAgICAgICAgIGZpcnN0UGhhc2VbMV0gPj49ICgyK2hvcik7Ci0KLSAgICAgICAgaWYgKCF2ZXIgJiYgQSAmJiBCKQotICAgICAgICAgICAgZmlyc3RQaGFzZVs0XSA9IChhWzBdK2FbMV0rYVsyXSthWzNdLWJbMF0tYlsxXS1iWzJdLWJbM10pID4+IDQ7Ci0gICAgICAgIGVsc2UgaWYgKHZlcikKLSAgICAgICAgICAgIGZpcnN0UGhhc2VbNF0gPj49ICgyK3Zlcik7Ci0KLSAgICAgICAgc3dpdGNoIChqKQotICAgICAgICB7Ci0gICAgICAgICAgICBjYXNlIDE6Ci0gICAgICAgICAgICAgICAgZmlyc3RQaGFzZVswXSA+Pj0gMzsKLSAgICAgICAgICAgICAgICBicmVhazsKLQotICAgICAgICAgICAgY2FzZSAyOgotICAgICAgICAgICAgICAgIGZpcnN0UGhhc2VbMF0gPj49IDQ7Ci0gICAgICAgICAgICAgICAgYnJlYWs7Ci0KLSAgICAgICAgICAgIGNhc2UgMzoKLSAgICAgICAgICAgICAgICAvKiBhcHByb3hpbWF0ZSAoZmlyc3RQaGFzZVswXSo0LzMpPj41ICovCi0gICAgICAgICAgICAgICAgZmlyc3RQaGFzZVswXSA9ICgyMSAqIGZpcnN0UGhhc2VbMF0pID4+IDk7Ci0gICAgICAgICAgICAgICAgYnJlYWs7Ci0KLSAgICAgICAgICAgIGRlZmF1bHQ6IC8qIDQgKi8KLSAgICAgICAgICAgICAgICBmaXJzdFBoYXNlWzBdID4+PSA1OwotICAgICAgICAgICAgICAgIGJyZWFrOwotCi0gICAgICAgIH0KLQotICAgICAgICBUcmFuc2Zvcm0oZmlyc3RQaGFzZSk7Ci0KLSAgICAgICAgcERhdGEgPSBkYXRhICsgMjU2ICsgY29tcCo2NDsKLSAgICAgICAgZm9yIChpID0gMCwgcFRtcCA9IGZpcnN0UGhhc2U7IGkgPCA2NDspCi0gICAgICAgIHsKLSAgICAgICAgICAgIHRtcCA9IHBUbXBbKGkgJiAweDcpPj4xXTsKLSAgICAgICAgICAgIC8qbGludCAtZTczNCBDTElQMSBtYWNybyByZXN1bHRzIGluIHZhbHVlIHRoYXQgZml0cyBpbnRvIDggYml0cyAqLwotICAgICAgICAgICAgKnBEYXRhKysgPSBDTElQMSh0bXApOwotICAgICAgICAgICAgLypsaW50ICtlNzM0ICovCi0KLSAgICAgICAgICAgIGkrKzsKLSAgICAgICAgICAgIGlmICghKGkgJiAweEYpKQotICAgICAgICAgICAgICAgIHBUbXAgKz0gNDsKLSAgICAgICAgfQotCi0gICAgICAgIC8qIGluY3JlbWVudCBwb2ludGVycyBmb3IgY3IgKi8KLSAgICAgICAgbWJQb3MgKz0gd2lkdGggKiBoZWlnaHQgKiA2NDsKLSAgICB9Ci0KLSAgICBoMjY0YnNkV3JpdGVNYWNyb2Jsb2NrKGN1cnJJ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AoZmxhZ3MpCi0gICAgICAgIHsKLSAgICAgICAgICAgIC8qIEdldEJvdW5kYXJ5U3RyZW5ndGhzIGZ1bmN0aW9uIHJldHVybnMgbm9uLXplcm8gdmFsdWUgaWYgYW55IG9mCi0gICAgICAgICAgICAgKiB0aGUgYlMgdmFsdWVzIGZvciB0aGUgbWFjcm9ibG9jayBiZWluZyBwcm9jZXNzZWQgd2FzIG5vbi16ZXJvICovCi0gICAgICAgICAgICBpZiAoR2V0Qm91bmRhcnlTdHJlbmd0aHMocE1iLCBiUywgZmxhZ3MpKQotICAgICAgICAgICAgewotICAgICAgICAgICAgICAgIC8qIGx1bWEgKi8KLSAgICAgICAgICAgICAgICBHZXRMdW1hRWRnZVRocmVzaG9sZHModGhyZXNob2xkcywgcE1iLCBmbGFncyk7Ci0gICAgICAgICAgICAgICAgZGF0YSA9IGltYWdlLT5kYXRhICsgbWJSb3cgKiBwaWNXaWR0aEluTWJzICogMjU2ICsgbWJDb2wgKiAxNjsKLQotICAgICAgICAgICAgICAgIEZpbHRlckx1bWEoKHU4KilkYXRhLCBiUywgdGhyZXNob2xkcywgcGljV2lkdGhJbk1icyoxNik7Ci0KLSAgICAgICAgICAgICAgICAvKiBjaHJvbWEgKi8KLSAgICAgICAgICAgICAgICBHZXRDaHJvbWFFZGdlVGhyZXNob2xkcyh0aHJlc2hvbGRzLCBwTWIsIGZsYWdzLAotICAgICAgICAgICAgICAgICAgICBwTWItPmNocm9tYVFwSW5kZXhPZmZzZXQpOwotICAgICAgICAgICAgICAgIGRhdGEgPSBpbWFnZS0+ZGF0YSArIHBpY1NpemVJbk1icyAqIDI1NiArCi0gICAgICAgICAgICAgICAgICAgIG1iUm93ICogcGljV2lkdGhJbk1icyAqIDY0ICsgbWJDb2wgKiA4OwotCi0gICAgICAgICAgICAgICAgRmlsdGVyQ2hyb21hKCh1OCopZGF0YSwgZGF0YSArIDY0KnBpY1NpemVJbk1icywgYlMsCi0gICAgICAgICAgICAgICAgICAgICAgICB0aHJ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AoYlMgPCA0KQotICAgIHsKLSAgICAgICAgdGMgPSB0aHJlc2hvbGRzLT50YzBbYlMtMV07Ci0gICAgICAgIHRtcCA9IHRjOwotICAgICAgICBmb3IgKGkgPSA0OyBpOyBpLS0sIGRhdGEgKz0gaW1hZ2VXaWR0aCkKLSAgICAgICAgewotICAgICAgICAgICAgcDEgPSBkYXRhWy0yXTsgcDAgPSBkYXRhWy0xXTsKLSAgICAgICAgICAgIHEwID0gZGF0YVswXTsgcTEgPSBkYXRhWzFdOwotICAgICAgICAgICAgaWYgKCAoKHVuc2lnbmVkKUFCUyhwMC1xMCkgPCB0aHJlc2hvbGRzLT5hbHBoYSkgJiYKLSAgICAgICAgICAgICAgICAgKCh1bnNpZ25lZClBQlMocDEtcDApIDwgdGhyZXNob2xkcy0+YmV0YSkgICYmCi0gICAgICAgICAgICAgICAgICgodW5zaWduZWQpQUJTKHExLXEwKSA8IHRocmVzaG9sZHMtPmJldGEpICkKLSAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICBwMiA9IGRhdGFbLTNdOwotICAgICAgICAgICAgICAgIHEyID0gZGF0YVsyXTsKLQotICAgICAgICAgICAgICAgIGlmICgodW5zaWduZWQpQUJTKHAyLXAwKSA8IHRocmVzaG9sZHMtPmJldGEpCi0gICAgICAgICAgICAgICAgewotICAgICAgICAgICAgICAgICAgICBkYXRhWy0yXSA9ICh1OCkocDEgKyBDTElQMygtdGMsdGMsCi0gICAgICAgICAgICAgICAgICAgICAgICAocDIgKyAoKHAwICsgcTAgKyAxKSA+PiAxKSAtIChwMSA8PCAxKSkgPj4gMSkpOwotICAgICAgICAgICAgICAgICAgICB0bXArKzsKLSAgICAgICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgICAgICBpZiAoKHVuc2lnbmVkKUFCUyhxMi1xMCkgPCB0aHJlc2hvbGRzLT5iZXRhKQotICAgICAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAgICAgZGF0YVsxXSA9ICh1OCkocTEgKyBDTElQMygtdGMsdGMsCi0gICAgICAgICAgICAgICAgICAgICAgICAocTIgKyAoKHAwICsgcTAgKyAxKSA+PiAxKSAtIChxMSA8PCAxKSkgPj4gMSkpOwotICAgICAgICAgICAgICAgICAgICB0bXArKzsKLSAgICAgICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgICAgICBkZWx0YSA9IENMSVAzKC10bXAsIHRtcCwgKCgoKHEwIC0gcDApIDw8IDIpICsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgKHAxIC0gcTEpICsgNCkgPj4gMykpOwotCi0gICAgICAgICAgICAgICAgcDAgPSBjbHBbcDAgKyBkZWx0YV07Ci0gICAgICAgICAgICAgICAgcTAgPSBjbHBbcTAgLSBkZWx0YV07Ci0gICAgICAgICAgICAgICAgdG1wID0gdGM7Ci0gICAgICAgICAgICAgICAgZGF0YVstMV0gPSBwMDsKLSAgICAgICAgICAgICAgICBkYXRhWyAwXSA9IHEwOwotICAgICAgICAgICAgfQotICAgICAgICB9Ci0gICAgfQotICAgIGVsc2UKLSAgICB7Ci0gICAgICAgIGZvciAoaSA9IDQ7IGk7IGktLSwgZGF0YSArPSBpbWFnZVdpZHRoKQotICAgICAgICB7Ci0gICAgICAgICAgICBwMSA9IGRhdGFbLTJdOyBwMCA9IGRhdGFbLTFdOwotICAgICAgICAgICAgcTAgPSBkYXRhWzBdOyBxMSA9IGRhdGFbMV07Ci0gICAgICAgICAgICBpZiAoICgodW5zaWduZWQpQUJTKHAwLXEwKSA8IHRocmVzaG9sZHMtPmFscGhhKSAmJgotICAgICAgICAgICAgICAgICAoKHVuc2lnbmVkKUFCUyhwMS1wMCkgPCB0aHJlc2hvbGRzLT5iZXRhKSAgJiYKLSAgICAgICAgICAgICAgICAgKCh1bnNpZ25lZClBQlMocTEtcTApIDwgdGhyZXNob2xkcy0+YmV0YSkgKQotICAgICAgICAgICAgewotICAgICAgICAgICAgICAgIHRtcEZsYWcgPQotICAgICAgICAgICAgICAgICAgICAoKHVuc2lnbmVkKUFCUyhwMC1xMCkgPCAoKHRocmVzaG9sZHMtPmFscGhhID4+IDIpICsyKSkgPwotICAgICAgICAgICAgICAgICAgICAgICAgSEFOVFJPX1RSVUUgOiBIQU5UUk9fRkFMU0U7Ci0KLSAgICAgICAgICAgICAgICBwMiA9IGRhdGFbLTNdOwotICAgICAgICAgICAgICAgIHEyID0gZGF0YVsyXTsKLQotICAgICAgICAgICAgICAgIGlmICh0bXBGbGFnICYmICh1bnNpZ25lZClBQlMocDItcDApIDwgdGhyZXNob2xkcy0+YmV0YSkKLSAgICAgICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgICAgIHRtcCA9IHAxICsgcDAgKyBxMDsKLSAgICAgICAgICAgICAgICAgICAgZGF0YVstMV0gPSAodTgpKChwMiArIDIgKiB0bXAgKyBxMSArIDQpID4+IDMpOwotICAgICAgICAgICAgICAgICAgICBkYXRhWy0yXSA9ICh1OCkoKHAyICsgdG1wICsgMikgPj4gMik7Ci0gICAgICAgICAgICAgICAgICAgIGRhdGFbLTNdID0gKHU4KSgoMiAqIGRhdGFbLTRdICsgMyAqIHAyICsgdG1wICsgNCkgPj4gMyk7Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgIGVsc2UKLSAgICAgICAgICAgICAgICAgICAgZGF0YVstMV0gPSAoMiAqIHAxICsgcDAgKyBxMSArIDIpID4+IDI7Ci0KLSAgICAgICAgICAgICAgICBpZiAodG1wRmxhZyAmJiAodW5zaWduZWQpQUJTKHEyLXEwKSA8IHRocmVzaG9sZHMtPmJldGEpCi0gICAgICAgICAgICAgICAgewotICAgICAgICAgICAgICAgICAgICB0bXAgPSBwMCArIHEwICsgcTE7Ci0gICAgICAgICAgICAgICAgICAgIGRhdGFbMF0gPSAodTgpKChwMSArIDIgKiB0bXAgKyBxMiArIDQpID4+IDMpOwotICAgICAgICAgICAgICAgICAgICBkYXRhWzFdID0gKHU4KSgodG1wICsgcTIgKyAyKSA+PiAyKTsKLSAgICAgICAgICAgICAgIC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yA9IHRocmVzaG9sZHMtPnRjMFtiUy0xXTsKLSAgICB0bXAgPSB0YzsKLSAgICBmb3IgKGkgPSA0OyBpOyBpLS0sIGRhdGErKykKLSAgICB7Ci0gICAgICAgIHAxID0gZGF0YVstaW1hZ2VXaWR0aCoyXTsgcDAgPSBkYXRhWy1pbWFnZVdpZHRoXTsKLSAgICAgICAgcTAgPSBkYXRhWzBdOyBxMSA9IGRhdGFbaW1hZ2VXaWR0aF07Ci0gICAgICAgIGlmICggKCh1bnNpZ25lZClBQlMocDAtcTApIDwgdGhyZXNob2xkcy0+YWxwaGEpICYmCi0gICAgICAgICAgICAgKCh1bnNpZ25lZClBQlMocDEtcDApIDwgdGhyZXNob2xkcy0+YmV0YSkgICYmCi0gICAgICAgICAgICAgKCh1bnNpZ25lZClBQlMocTEtcTApIDwgdGhyZXNob2xkcy0+YmV0YSkgKQotICAgICAgICB7Ci0gICAgICAgICAgICBwMiA9IGRhdGFbLWltYWdlV2lkdGgqM107Ci0KLSAgICAgICAgICAgIGlmICgodW5zaWduZWQpQUJTKHAyLXAwKSA8IHRocmVzaG9sZHMtPmJldGEpCi0gICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgZGF0YVstaW1hZ2VXaWR0aCoyXSA9ICh1OCkocDEgKyBDTElQMygtdGMsdGMsCi0gICAgICAgICAgICAgICAgICAgIChwMiArICgocDAgKyBxMCArIDEpID4+IDEpIC0gKHAxIDw8IDEpKSA+PiAxKSk7Ci0gICAgICAgICAgICAgICAgdG1wKys7Ci0gICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgIHEyID0gZGF0YVtpbWFnZVdpZHRoKjJdOwotCi0gICAgICAgICAgICBpZiAoKHVuc2lnbmVkKUFCUyhxMi1xMCkgPCB0aHJlc2hvbGRzLT5iZXRhKQotICAgICAgICAgICAgewotICAgICAgICAgICAgICAgIGRhdGFbaW1hZ2VXaWR0aF0gPSAodTgpKHExICsgQ0xJUDMoLXRjLHRjLAotICAgICAgICAgICAgICA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gICAgICAgICAgZGF0YVstaW1hZ2VXaWR0aCoyXSA9ICh1OCkocDEgKyBDTElQMygtdGMsdGMsCi0gICAgICAgICAgICAgICAgICAgICAgICAocDIgKyAoKHAwICsgcTAgKyAxKSA+PiAxKSAtIChwMSA8PCAxKSkgPj4gMSkpOwotICAgICAgICAgICAgICAgICAgICB0bXArKzsKLSAgICAgICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgICAgICBxMiA9IGRhdGFbaW1hZ2VXaWR0aCoyXTsKLQotICAgICAgICAgICAgICAgIGlmICgodW5zaWduZWQpQUJTKHEyLXEwKSA8IHRocmVzaG9sZHMtPmJldGEpCi0gICAgICAgICAgICAgICAgewotICAgICAgICAgICAgICAgICAgICBkYXRhW2ltYWdlV2lkdGhdID0gKHU4KShxMSArIENMSVAzKC10Yyx0YywKLSAgICAgICAgICAgICAgICAgICAgICAgIChxMiArICgocDAgKyBxMCArIDEpID4+IDEpIC0gKHExIDw8IDEpKSA+PiAxKSk7Ci0gICAgICAgICAgICAgICAgICAgIHRtcCsrOwotICAgICAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgICAgIGRlbHRhID0gQ0xJUDMoLXRtcCwgdG1wLCAoKCgocTAgLSBwMCkgPDwgMikgKwotICAgICAgICAgICAgICAgICAgICAgICAgICAocDEgLSBxMSkgKyA0KSA+PiAzKSk7Ci0KLSAgICAgICAgICAgICAgICBwMCA9IGNscFtwMCArIGRlbHRhXTsKLSAgICAgICAgICAgICAgICBxMCA9IGNscFtxMCAtIGRlbHRhXTsKLSAgICAgICAgICAgICAgICB0bXAgPSB0YzsKLSAgICAgICAgICAgICAgICBkYXRhWy1pbWFnZVdpZHRoXSA9IHAwOwotICAgICAgICAgICAgICAgIGRhdGFbICAwXSA9IHEwOwotICAgICAgICAgICAgfQotICAgICAgICB9Ci0gICAgfQotICAgIGVsc2UKLSAgICB7Ci0gICAgICAgIGZvciAoaSA9IDE2OyBpOyBpLS0sIGRhdGErKykKLSAgICAgICAgewotICAgICAgICAgICAgcDEgPSBkYXRhWy1pbWFnZVdpZHRoKjJdOyBwMCA9IGRhdGFbLWltYWdlV2lkdGhdOwotICAgICAgICAgICAgcTAgPSBkYXRhWzBdOyBxMSA9IGRhdGFbaW1hZ2VXaWR0aF07Ci0gICAgICAgICAgICBpZiAoICgodW5zaWduZWQpQUJTKHAwLXEwKSA8IHRocmVzaG9sZHMtPmFscGhhKSAmJgotICAgICAgICAgICAgICAgICAoKHVuc2lnbmVkKUFCUyhwMS1wMCkgPCB0aHJlc2hvbGRzLT5iZXRhKSAgJiYKLSAgICAgICAgICAgICAgICAgKCh1bnNpZ25lZClBQlMocTEtcTApIDwgdGhyZXNob2xkcy0+YmV0YSkgKQotICAgICAgICAgICAgewotICAgICAgICAgICAgICAgIHRtcEZsYWcgPSAoKHVuc2lnbmVkKUFCUyhwMC1xMCkgPCAoKHRocmVzaG9sZHMtPmFscGhhID4+IDIpICsyKSkKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICA/IEhBTlRST19UUlVFIDogSEFOVFJPX0ZBTFNFOwotCi0gICAgICAgICAgICAgICAgcDIgPSBkYXRhWy1pbWFnZVdpZHRoKjNdOwotICAgICAgICAgICAgICAgIHEyID0gZGF0YVtpbWFnZVdpZHRoKjJdOwotCi0gICAgICAgICAgICAgICAgaWYgKHRtcEZsYWcgJiYgKHVuc2lnbmVkKUFCUyhwMi1wMCkgPCB0aHJlc2hvbGRzLT5iZXRhKQotICAgICAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAgICAgdG1wID0gcDEgKyBwMCArIHEwOwotICAgICAgICAgICAgICAgICAgICBkYXRhWy1pbWFnZVdpZHRoXSA9ICh1OCkoKHAyICsgMiAqIHRtcCArIHExICsgNCkgPj4gMyk7Ci0gICAgICAgICAgICAgICAgICAgIGRhdGFbLWltYWdlV2lkdGgqMl0gPSAodTgpKChwMiArIHRtcCArIDIpID4+IDIpOwotICAgICAgICAgICAgICAgICAgICBkYXRhWy1pbWFnZVdpZHRoKjNdID0gKHU4KSgoMiAqIGRhdGFbLWltYWdlV2lkdGgqNF0gKwotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDMgKiBwMiArIHRtcCArIDQpID4+IDMpOwotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICBlbHNlCi0gICAgICAgICAgICAgICAgICAgIGRhdGFbLWltYWdlV2lkdGhdID0gKHU4KSgoMiAqIHAxICsgcDAgKyBxMSArIDIpID4+IDIpOwotCi0gICAgICAgICAgICAgICAgaWYgKHRtcEZsYWcgJiYgKHVuc2lnbmVkKUFCUyhxMi1xMCkgPCB0aHJlc2hvbGRzLT5iZXRhKQotICAgICAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAgICAgdG1wID0gcDAgKyBxMCArIHExOwotICAgICAgICAgICAgICAgICAgICBkYXRhWyAwXSA9ICh1OCkoKHAxICsgMiAqIHRtcCArIHEyICsgNCkgPj4gMyk7Ci0gICAgICAgICAgICAgICAgICAgIGRhdGFbaW1hZ2VXaWR0aF0gPSAodTgpKCh0bXAgKyBxMiArIDIpID4+IDIpOwotICAgICAgICAgICAgICAgICAgICBkYXRhW2ltYWdlV2lkdGgqMl0gPSAodTgpKCgyICogZGF0YVtpbWFnZVdpZHRoKjNdICsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDMgKiBxMiArIHRtcCArIDQpID4+IDMpOwotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICBlbHNlCi0gICAgICAgICAgICAgICAgICAgIGRhdGFbMF0gPSAoMiAqIHExICsgcTAgKyBwMSArIDIpID4+IDI7Ci0gICAgICAgICAgICB9Ci0gICAgICAgIH0KLSAgICB9Ci0KLX0KLQotLyotLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0KLQotICAgIEZ1bmN0aW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0xJUDMoLXRjLCB0YywgKCgoKHEwIC0gcDApIDw8IDIpICsKLSAgICAgICAgICAgICAgICAgICAgICAocDEgLSBxMSkgKyA0KSA+PiAzKSk7Ci0gICAgICAgICAgICBwMCA9IGNscFtwMCArIGRlbHRhXTsKLSAgICAgICAgICAgIHEwID0gY2xwW3EwIC0gZGVsdGFdOwotICAgICAgICAgICAgZGF0YVstMV0gPSBwMDsKLSAgICAgICAgICAgIGRhdGFbIDBdID0gcTA7Ci0gICAgICAgIH0KLSAgICAgICAgZWxzZQotICAgICAgICB7Ci0gICAgICAgICAgICBkYXRhWy0xXSA9ICgyICogcDEgKyBwMCArIHExICsgMikgPj4gMjsKLSAgICAgICAgICAgIGRhdGFbIDBdID0gKDIgKiBxMSArIHEwICsgcDEgKyAyKSA+PiAyOwotICAgICAgICB9Ci0gICAgfQotICAgIGRhdGEgKz0gd2lkdGg7Ci0gICAgcDEgPSBkYXRhWy0yXTsgcDAgPSBkYXRhWy0xXTsKLSAgICBxMCA9IGRhdGFbMF07IHExID0gZGF0YVsxXTsKLSAgICBpZiAoICgodW5zaWduZWQpQUJTKHAwLXEwKSA8IHRocmVzaG9sZHMtPmFscGhhKSAmJgotICAgICAgICAgKCh1bnNpZ25lZClBQlMocDEtcDApIDwgdGhyZXNob2xkcy0+YmV0YSkgICYmCi0gICAgICAgICAoKHVuc2lnbmVkKUFCUyhxMS1xMCkgPCB0aHJlc2hvbGRzLT5iZXRhKSApCi0gICAgewotICAgICAgICBpZiAoYlMgPCA0KQotICAgICAgICB7Ci0gICAgICAgICAgICB0YyA9IHRocmVzaG9sZHMtPnRjMFtiUy0xXSArIDE7Ci0gICAgICAgICAgICBkZWx0YSA9IENMSVAzKC10YywgdGMsICgoKChxMCAtIHAwKSA8PCAyKSArCi0gICAgICAgICAgICAgICAgICAgICAgKHAxIC0gcTEpICsgNCkgPj4gMykpOwotICAgICAgICAgICAgcDAgPSBjbHBbcDAgKyBkZWx0YV07Ci0gICAgICAgICAgICBxMCA9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xkcyk7Ci0KLSAgICB0YyA9IHRocmVzaG9sZHMtPnRjMFtiUy0xXSArIDE7Ci0gICAgZm9yIChpID0gMjsgaTsgaS0tLCBkYXRhKyspCi0gICAgewotICAgICAgICBwMSA9IGRhdGFbLXdpZHRoKjJdOyBwMCA9IGRhdGFbLXdpZHRoXTsKLSAgICAgICAgcTAgPSBkYXRhWzBdOyBxMSA9IGRhdGFbd2lkdGhdOwotICAgICAgICBpZiAoICgodW5zaWduZWQpQUJTKHAwLXEwKSA8IHRocmVzaG9sZHMtPmFscGhhKSAmJgotICAgICAgICAgICAgICgodW5zaWduZWQpQUJTKHAxLXAwKSA8IHRocmVzaG9sZHMtPmJldGEpICAmJgotICAgICAgICAgICAgICgodW5zaWduZWQpQUJTKHExLXEwKSA8IHRocmVzaG9sZHMtPmJldGEpICkKLSAgICAgICAgewotICAgICAgICAgICAgZGVsdGEgPSBDTElQMygtdGMsIHRjLCAoKCgocTAgLSBwMCkgPDwgMikgKwotICAgICAgICAgICAgICAgICAgICAgIChwMSAtIHExKSArIDQpID4+IDMpKTsKLSAgICAgICAgICAgIHAwID0gY2xwW3AwICsgZGVsdGFdOwotICAgICAgICAgICAgcTAgPSBjbHBbcTAgLSBkZWx0YV07Ci0gICAgICAgICAgICBkYXRhWy13aWR0aF0gPSBwMDsKLSAgICAgICAgICAgIGRhdGFbICAwXSA9IHEwOwotICAgICAgICB9Ci0gICAgfQotfQotCi0vKi0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLQotCi0gICAgRnVuY3Rpb246IEZpbHRlckhvckNocm9tYQotCi0gICAgICAgIEZ1bmN0aW9uYWwgZGVzY3JpcHRpb246Ci0gICAgICAgICAgICBGaWx0ZXIgYWxsIGZvdXIgc3VjY2Vzc2l2ZSBob3Jpem9udGFsIDItcGl4ZWwgY2hyb21hIGVkZ2VzLiBUaGlz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G9sZHMtPmJldGEpICkKLSAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICBkZWx0YSA9IENMSVAzKC10YywgdGMsICgoKChxMCAtIHAwKSA8PCAyKSArCi0gICAgICAgICAgICAgICAgICAgICAgICAgIChwMSAtIHExKSArIDQpID4+IDMpKTsKLSAgICAgICAgICAgICAgICBwMCA9IGNscFtwMCArIGRlbHRhXTsKLSAgICAgICAgICAgICAgICBxMCA9IGNscFtxMCAtIGRlbHRhXTsKLSAgICAgICAgICAgICAgICBkYXRhWy13aWR0aF0gPSBwMDsKLSAgICAgICAgICAgICAgICBkYXRhWyAgMF0gPSBxMDsKLSAgICAgICAgICAgIH0KLSAgICAgICAgfQotICAgIH0KLSAgICBlbHNlCi0gICAgewotICAgICAgICBmb3IgKGkgPSA4OyBpOyBpLS0sIGRhdGErKykKLSAgICAgICAgewotICAgICAgICAgICAgcDEgPSBkYXRhWy13aWR0aCoyXTsgcDAgPSBkYXRhWy13aWR0aF07Ci0gICAgICAgICAgICBxMCA9IGRhdGFbMF07IHExID0gZGF0YVt3aWR0aF07Ci0gICAgICAgICAgICBpZiAoICgodW5zaWduZWQpQUJTKHAwLXEwKSA8IHRocmVzaG9sZHMtPmFscGhhKSAmJgotICAgICAgICAgICAgICAgICAoKHVuc2lnbmVkKUFCUyhwMS1wMCkgPCB0aHJlc2hvbGRzLT5iZXRhKSAgJiYKLSAgICAgICAgICAgICAgICAgKCh1bnNpZ25lZClBQlMocTEtcTApIDwgdGhyZXNob2xkcy0+YmV0YSkgKQotICAgICAgICAgICAgewotICAgICAgICAgICAgICAgICAgICBkYXRhWy13aWR0aF0gPSAoMiAqIHAxICsgcDAgKyBxMSArIDIpID4+IDI7Ci0gICAgICAgICAgICAgICAgICAgIGRhdGFbICAwXSA9ICgyICogcTEgKyBxMCArIHAxICsgMikgPj4gMjsKLSAgICAgICAgICAgIH0KLSAgICAgICAgfQotICAgIH0KLQotfQotCi0KLS8qLS0tLS0tLS0tLS0tLS0tLS0tL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0lOVFJBX01CKCptYikgfHwgSVNfSU5UUkFfTUIoKm1iLT5tYkIpKQotICAgICAgICB7Ci0gICAgICAgICAgICBiU1swXS50b3AgPSBiU1sxXS50b3AgPSBiU1syXS50b3AgPSBiU1szXS50b3AgPSA0OwotICAgICAgICAgICAgbm9uWmVyb0JzID0gSEFOVFJPX1RSVUU7Ci0gICAgICAgIH0KLSAgICAgICAgZWxzZQotICAgICAgICB7Ci0gICAgICAgICAgICBiU1swXS50b3AgPSBFZGdlQm91bmRhcnlTdHJlbmd0aChtYiwgbWItPm1iQiwgMCwgMTApOwotICAgICAgICAgICAgYlNbMV0udG9wID0gRWRnZUJvdW5kYXJ5U3RyZW5ndGgobWIsIG1iLT5tYkIsIDEsIDExKTsKLSAgICAgICAgICAgIGJTWzJdLnRvcCA9IEVkZ2VCb3VuZGFyeVN0cmVuZ3RoKG1iLCBtYi0+bWJCLCA0LCAxNCk7Ci0gICAgICAgICAgICBiU1szXS50b3AgPSBFZGdlQm91bmRhcnlTdHJlbmd0aChtYiwgbWItPm1iQiwgNSwgMTUpOwotICAgICAgICAgICAgaWYgKGJTWzBdLnRvcCB8fCBiU1sxXS50b3AgfHwgYlNbMl0udG9wIHx8IGJTWzNdLnRvcCkKLSAgICAgICAgICAgICAgICBub25aZXJvQnMgPSBIQU5UUk9fVFJVRTsKLSAgICAgICAgfQotICAgIH0KLSAgICBlbHNlCi0gICAgewotICAgICAgICBiU1swXS50b3AgPSBiU1sxXS50b3AgPSBiU1syXS50b3AgPSBiU1szXS50b3AgPSAwOwotICAgIH0KLQotICAgIC8qIGxlZnQgZWRnZXMgKi8KLSAgICBpZiAoZmxhZ3MgJiBGSUxURVJfTEVGVF9FREdFKQotICAgIHsKLSAgICAgICAgaWYgKElTX0lOVFJBX01CKCptYikgfHwgSVNfSU5UUkFfTUIoKm1iLT5tYkEpKQotICAgICAgICB7Ci0gICAgICAgICAgICBiU1swXS5sZWZ0ID0gYlNbNF0ubGVmdCA9IGJTWzhdLmxlZn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gICAgICAgICBJbm5lckJvdW5kYXJ5U3RyZW5ndGgobWIsIG1iNHg0SW5kZXhbNV0sIG1iNHg0SW5kZXhbMV0pOwotICAgICAgICAgICAgYlNbNl0udG9wID0KLSAgICAgICAgICAgICAgICBJbm5lckJvdW5kYXJ5U3RyZW5ndGgobWIsIG1iNHg0SW5kZXhbNl0sIG1iNHg0SW5kZXhbMl0pOwotICAgICAgICAgICAgYlNbN10udG9wID0KLSAgICAgICAgICAgICAgICBJbm5lckJvdW5kYXJ5U3RyZW5ndGgobWIsIG1iNHg0SW5kZXhbN10sIG1iNHg0SW5kZXhbM10pOwotICAgICAgICAgICAgYlNbOF0udG9wID0KLSAgICAgICAgICAgICAgICBJbm5lckJvdW5kYXJ5U3RyZW5ndGgobWIsIG1iNHg0SW5kZXhbOF0sIG1iNHg0SW5kZXhbNF0pOwotICAgICAgICAgICAgYlNbOV0udG9wID0KLSAgICAgICAgICAgICAgICBJbm5lckJvdW5kYXJ5U3RyZW5ndGgobWIsIG1iNHg0SW5kZXhbOV0sIG1iNHg0SW5kZXhbNV0pOwotICAgICAgICAgICAgYlNbMTBdLnRvcCA9Ci0gICAgICAgICAgICAgICAgSW5uZXJCb3VuZGFyeVN0cmVuZ3RoKG1iLCBtYjR4NEluZGV4WzEwXSwgbWI0eDRJbmRleFs2XSk7Ci0gICAgICAgICAgICBiU1sxMV0udG9wID0KLSAgICAgICAgICAgICAgICBJbm5lckJvdW5kYXJ5U3RyZW5ndGgobWIsIG1iNHg0SW5kZXhbMTFdLCBtYjR4NEluZGV4WzddKTsKLSAgICAgICAgICAgIGJTWzEyXS50b3AgPQotICAgICAgICAgICAgICAgIElubmVyQm91bmRhcnlTdHJlbmd0aChtYiwgbWI0eDRJbmRleFsxMl0sIG1iNHg0SW5kZXhbOF0pOwotICAgICAgICAgICAgYlNbMTNdLnRvcCA9Ci0gICAgICAgICAgICAgICAgSW5uZXJCb3VuZGFyeVN0cmVuZ3RoKG1iLCBtYjR4NEluZGV4WzEzX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fQotICAgICAgICBlbHNlCi0gICAgICAgIHsKLSAgICAgICAgICAgIHRocmVzaG9sZHNbVE9QXS5hbHBoYSA9IHRocmVzaG9sZHNbSU5ORVJdLmFscGhhOwotICAgICAgICAgICAgdGhyZXNob2xkc1tUT1BdLmJldGEgPSB0aHJlc2hvbGRzW0lOTkVSXS5iZXRhOwotICAgICAgICAgICAgdGhyZXNob2xkc1tUT1BdLnRjMCA9IHRocmVzaG9sZHNbSU5ORVJdLnRjMDsKLSAgICAgICAgfQotICAgIH0KLSAgICBpZiAoZmlsdGVyaW5nRmxhZ3MgJiBGSUxURVJfTEVGVF9FREdFKQotICAgIHsKLSAgICAgICAgcXBUbXAgPSBtYi0+bWJBLT5xcFk7Ci0gICAgICAgIGlmIChxcFRtcCAhPSBxcCkKLSAgICAgICAgewotICAgICAgICAgICAgcXBBdiA9IChxcCArIHFwVG1wICsgMSkgPj4gMTsKLQotICAgICAgICAgICAgaW5kZXhBID0gKHUzMilDTElQMygwLCA1MSwgKGkzMilxcEF2ICsgbWItPmZpbHRlck9mZnNldEEpOwotICAgICAgICAgICAgaW5kZXhCID0gKHUzMilDTElQMygwLCA1MSwgKGkzMilxcEF2ICsgbWItPmZpbHRlck9mZnNldEIpOwotCi0gICAgICAgICAgICB0aHJlc2hvbGRzW0xFRlRdLmFscGhhID0gYWxwaGFzW2luZGV4QV07Ci0gICAgICAgICAgICB0aHJlc2hvbGRzW0xFRlRdLmJldGEgPSBiZXRhc1tpbmRleEJdOwotICAgICAgICAgICAgdGhyZXNob2xkc1tMRUZUXS50YzAgPSB0YzBbaW5kZXhBXTsKLSAgICAgICAgfQotICAgICAgICBlbHNlCi0gICAgICAgIHsKLSAgICAgICAgICAgIHRocmVzaG9sZHNbTEVGVF0uYWxwaGEgPSB0aHJlc2hvbGRzW0lOTkVSXS5hbHBoYTsKLSAgICAgICAgICAgIHRocmVzaG9sZHNbTEVGVF0uYmV0YSA9IHRocmVzaG9sZHNbSU5ORVJdLmJldGE7Ci0gIC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7Ci0gICAgICAgICAgICB0aHJlc2hvbGRzW1RPUF0uYWxwaGEgPSB0aHJlc2hvbGRzW0lOTkVSXS5hbHBoYTsKLSAgICAgICAgICAgIHRocmVzaG9sZHNbVE9QXS5iZXRhID0gdGhyZXNob2xkc1tJTk5FUl0uYmV0YTsKLSAgICAgICAgICAgIHRocmVzaG9sZHNbVE9QXS50YzAgPSB0aHJlc2hvbGRzW0lOTkVSXS50YzA7Ci0gICAgICAgIH0KLSAgICB9Ci0gICAgaWYgKGZpbHRlcmluZ0ZsYWdzICYgRklMVEVSX0xFRlRfRURHRSkKLSAgICB7Ci0gICAgICAgIHFwVG1wID0gbWItPm1iQS0+cXBZOwotICAgICAgICBpZiAocXBUbXAgIT0gbWItPnFwWSkKLSAgICAgICAgewotICAgICAgICAgICAgcXBUbXAgPSBoMjY0YnNkUXBDW0NMSVAzKDAsIDUxLCAoaTMyKXFwVG1wICsgY2hyb21hUXBJbmRleE9mZnNldCldOwotICAgICAgICAgICAgcXBBdiA9IChxcCArIHFwVG1wICsgMSkgPj4gMTsKLQotICAgICAgICAgICAgaW5kZXhBID0gKHUzMilDTElQMygwLCA1MSwgKGkzMilxcEF2ICsgbWItPmZpbHRlck9mZnNldEEpOwotICAgICAgICAgICAgaW5kZXhCID0gKHUzMilDTElQMygwLCA1MSwgKGkzMilxcEF2ICsgbWItPmZpbHRlck9mZnNldEIpOwotCi0gICAgICAgICAgICB0aHJlc2hvbGRzW0xFRlRdLmFscGhhID0gYWxwaGFzW2luZGV4QV07Ci0gICAgICAgICAgICB0aHJlc2hvbGRzW0xFRlRdLmJldGEgPSBiZXRhc1tpbmRleEJdOwotICAgICAgICAgICAgdGhyZXNob2xkc1tMRUZUXS50YzAgPSB0YzBbaW5kZXhBXTsKLSAgICAgICAgfQotICAgICAgICBlbHNlCi0gICAgICAgIHsKLSAgICAgICAgICAgIHRocmVzaG9sZHNbTEVGVF0uYWxwaGEgPSB0aHJlc2hvbGRzW0lOTkVSXS5hbHBoYTsK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Jpbmcgd2l0aCBGaWx0ZXJIb3JMdW1hLCBvdGhlcndpc2UgdXNlIEZpbHRlckhvckx1bWFFZGdlIGZvcgotICAgICAgICAgKiBlYWNoIGVkZ2Ugc2VwYXJhdGVseS4gb2Zmc2V0IHZhcmlhYmxlIGluZGljYXRlcyB0b3AgbWFjcm9ibG9jayBlZGdlCi0gICAgICAgICAqIG9uIHRoZSBmaXJzdCBsb29wIHJvdW5kLCBpbm5lciBlZGdlIGZvciB0aGUgb3RoZXIgcm91bmRzICovCi0gICAgICAgIGlmICh0bXBbMF0udG9wID09IHRtcFsxXS50b3AgJiYgdG1wWzFdLnRvcCA9PSB0bXBbMl0udG9wICYmCi0gICAgICAgICAgICB0bXBbMl0udG9wID09IHRtcFszXS50b3ApCi0gICAgICAgIHsKLSAgICAgICAgICAgIGlmKHRtcFswXS50b3ApCi0gICAgICAgICAgICAgICAgRmlsdGVySG9yTHVtYShwdHIsIHRtcFswXS50b3AsIHRocmVzaG9sZHMgKyBvZmZzZXQsIChpMzIpd2lkdGgpOwotICAgICAgICB9Ci0gICAgICAgIGVsc2UKLSAgICAgICAgewotICAgICAgICAgICAgaWYodG1wWzBdLnRvcCkKLSAgICAgICAgICAgICAgICBGaWx0ZXJIb3JMdW1hRWRnZShwdHIsIHRtcFswXS50b3AsIHRocmVzaG9sZHMrb2Zmc2V0LAotICAgICAgICAgICAgICAgICAgICAoaTMyKXdpZHRoKTsKLSAgICAgICAgICAgIGlmKHRtcFsxXS50b3ApCi0gICAgICAgICAgICAgICAgRmlsdGVySG9yTHVtYUVkZ2UocHRyKzQsIHRtcFsxXS50b3AsIHRocmVzaG9sZHMrb2Zmc2V0LAotICAgICAgICAgICAgICAgICAgICAoaTMyKXdpZHRoKTsKLSAgICAgICAgICAgIGlmKHRtcFsyXS50b3ApCi0gICAgICAgICAgICAgICAgRmlsdGVySG9yTHVtYUVkZ2UocHRyKzgsIHRtcFsyXS50b3AsIHRocmVzaG9sZHMrb2Zmc2V0LAotICAgICAg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IGlzIGVxdWFsIGZvciBhbGwgaG9yaXpvbnRhbCBlZGdlcyBvZiB0aGUgcm93IC0+IHBlcmZvcm0KLSAgICAgICAgICogZmlsdGVyaW5nIHdpdGggRmlsdGVySG9yQ2hyb21hLCBvdGhlcndpc2UgdXNlIEZpbHRlckhvckNocm9tYUVkZ2UKLSAgICAgICAgICogZm9yIGVhY2ggZWRnZSBzZXBhcmF0ZWx5LiBvZmZzZXQgdmFyaWFibGUgaW5kaWNhdGVzIHRvcCBtYWNyb2Jsb2NrCi0gICAgICAgICAqIGVkZ2Ugb24gdGhlIGZpcnN0IGxvb3Agcm91bmQsIGlubmVyIGVkZ2UgZm9yIHRoZSBzZWNvbmQgKi8KLSAgICAgICAgaWYgKHRtcFswXS50b3AgPT0gdG1wWzFdLnRvcCAmJiB0bXBbMV0udG9wID09IHRtcFsyXS50b3AgJiYKLSAgICAgICAgICAgIHRtcFsyXS50b3AgPT0gdG1wWzNdLnRvcCkKLSAgICAgICAgewotICAgICAgICAgICAgaWYodG1wWzBdLnRvcCkKLSAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICBGaWx0ZXJIb3JDaHJvbWEoZGF0YUNiLCB0bXBbMF0udG9wLCB0aHJlc2hvbGRzK29mZnNldCwKLSAgICAgICAgICAgICAgICAgICAgKGkzMil3aWR0aCk7Ci0gICAgICAgICAgICAgICAgRmlsdGVySG9yQ2hyb21hKGRhdGFDciwgdG1wWzBdLnRvcCwgdGhyZXNob2xkcytvZmZzZXQsCi0gICAgICAgICAgICAgICAgICAgIChpMzIpd2lkdGgpOwotICAgICAgICAgICAgfQotICAgICAgICB9Ci0gICAgICAgIGVsc2UKLSAgICAgICAgewotICAgICAgICAgICAgaWYgKHRtcFswXS50b3ApCi0gICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgRmlsdGVySG9yQ2hyb21hRWRnZShkYXRhQ2IsIHRtcFswXS50b3AsIHRocmVzaG9sZHMrb2Zmc2V0LAotICAgICAgICAgICAgICAgICAgICAoaTMyKXdpZHRoKTsKLSAgICAgICAgICAgICAgICBGaWx0ZXJIb3JDaHJvbWFFZGdlKGRhdGFDciwgdG1wWzBdLnRvcCwgdGhyZXNob2xkcytvZmZzZXQsCi0gICAgICAgICAgICAgICAgICAgIChpMzIpd2lkdGgpOwotICAgICAgICAgICAgfQotICAgICAgICAgICAgaWYgKHRtcFsxXS50b3ApCi0gICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgRmlsdGVySG9yQ2hyb21hRWRnZShkYXRhQ2IrMiwgdG1wWzFdLnRvcCwgdGhyZXNob2xkcytvZmZzZXQsCi0gICAgICAgICAgICAgICAgICAgIChpMzIpd2lkdGgpOwotICAgICAgICAgICAgICAgIEZpbHRlckhvckNocm9tYUVkZ2UoZGF0YUNyKzIsIHRtcFsxXS50b3AsIHRocmVzaG9sZHMrb2Zmc2V0LAotICAgICAgICAgICAgICAgICAgICAoaTMyKXdpZHRoKTsKLSAgICAgICAgICAgIH0KLSAgICAgICAgICAgIGlmICh0bXBbMl0udG9wKQotICAgICAgICAgICAgewotICAgICAgICAgICAgICAgIEZpbHRlckhvckNocm9tYUVkZ2UoZGF0YUNiKzQsIHRtcFsyXS50b3AsIHRocmVzaG9sZHMrb2Zmc2V0LAotICAgICAgICAgICAgICAgICAgICAoaTMyKXdpZHRoKTsKLSAgICAgICAgICAgICAgICBGaWx0ZXJIb3JDaHJvbWFFZGdlKGRhdGFDcis0LCB0bXBbMl0udG9wLCB0aHJlc2hvbGRzK29mZnNldCwKLSAgICAgICAgICAgICAgICAgICAgKGkzMil3aWR0aCk7Ci0gICAgICAgICAgICB9Ci0gICAgICAgICAgICBpZiAodG1wWzNdLnRvcCkKLSAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICBGaWx0ZXJIb3JDaHJvbWFFZGdlKGRhdGFDYis2LCB0bXBbM10udG9wLCB0aHJlc2hvbGRzK29mZnNldCwKLSAgICAgICAgICAgICAgICAgICAgKGkzMil3aWR0aCk7Ci0gICAgIC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ZXMgPSBvbXhWQ000UDEwX0ZpbHRlckRlYmxvY2tpbmdMdW1hX1ZlckVkZ2VfSSggZGF0YSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChPTVhfUzMyKShwaWNXaWR0aEluTWJzKjE2KSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChjb25zdCBPTVhfVTgqKWFscGhhLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKGNvbnN0IE9NWF9VOCopYmV0YSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChjb25zdCBPTVhfVTgqKXRocmVzaG9sZEx1bWEsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoY29uc3QgT01YX1U4KiliUyApOwotCi0gICAgICAgICAgICAgICAgcmVzID0gb214VkNNNFAxMF9GaWx0ZXJEZWJsb2NraW5nTHVtYV9Ib3JFZGdlX0koIGRhdGEsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoT01YX1MzMikocGljV2lkdGhJbk1icyoxNiksCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoY29uc3QgT01YX1U4KilhbHBoYSsyLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKGNvbnN0IE9NWF9VOCopYmV0YSsyLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKGNvbnN0IE9NWF9VOCopdGhyZXNob2xkTHVtYSsxNiwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChjb25zdCBPTVhfVTgqKWJTKzE2ICk7Ci0gICAgICAgICAgICAgICAgLyogQ2IgKi8KLSAgICAgICAgICAgICAgICBHZXRDaHJvbWFFZGdlVGhyZXNob2xkcyhwTWIsIGFscGhhLCBiZXRhLCB0aHJlc2hvbGRDaHJvbWEsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYlMsIGZsYWdzLCBwTWItPmNocm9tYVFwSW5kZXhPZmZzZXQpOwotICAgICAgICAgICAgICAgIGRhdGEgPSBpbWFnZS0+ZGF0YSArIHBpY1NpemVJbk1icyAqIDI1NiArCi0gICAgICAgICAgICAgICAgICAgIG1iUm93ICogcGljV2lkdGhJbk1icyAqIDY0ICsgbWJDb2wgKiA4OwotCi0gICAgICAgICAgICAgICAgcmVzID0gb214VkNNNFAxMF9GaWx0ZXJEZWJsb2NraW5nQ2hyb21hX1ZlckVkZ2VfSSggZGF0YSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoT01YX1MzMikocGljV2lkdGhJbk1icyo4KSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoY29uc3QgT01YX1U4KilhbHBoYSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoY29uc3QgT01YX1U4KiliZXRhLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChjb25zdCBPTVhfVTgqKXRocmVzaG9sZENocm9tYSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoY29uc3QgT01YX1U4KiliUyApOwotICAgICAgICAgICAgICAgIHJlcyA9IG9teFZDTTRQMTBfRmlsdGVyRGVibG9ja2luZ0Nocm9tYV9Ib3JFZGdlX0koIGRhdGEsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKE9NWF9TMzIpKHBpY1dpZHRoSW5NYnMqOCksCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKGNvbnN0IE9NWF9VOCopYWxwaGErMiwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoY29uc3QgT01YX1U4KiliZXRhKzIsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKGNvbnN0IE9NWF9VOCopdGhyZXNob2xkQ2hyb21hKzgsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKGNvbnN0IE9NWF9VOCopYlMrMTYgKTsKLSAgICAgICAgICAgICAgICAvKiBDciAqLwotICAgICAgICAgICAgICAgIGRhdGEgKz0gKHBpY1NpemVJbk1icyAqIDY0KTsKLSAgICAgICAgICAgICAgICByZXMgPSBvbXhWQ000UDEwX0ZpbHRlckRlYmxvY2tpbmdDaHJvbWFfVmVyRWRnZV9JKCBkYXRhLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChPTVhfUzMyKShwaWNXaWR0aEluTWJzKjgpLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChjb25zdCBPTVhfVTgqKWFscGhhLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChjb25zdCBPTVhfVTgqKWJldGEsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKGNvbnN0IE9NWF9VOCopdGhyZXNob2xkQ2hyb21hLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChjb25zdCBPTVhfVTgqKWJTICk7Ci0gICAgICAgICAgICAgICAgcmVzID0gb214VkNNNFAxMF9GaWx0ZXJEZWJsb2NraW5nQ2hyb21hX0hvckVkZ2VfSSggZGF0YSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoT01YX1MzMikocGljV2lkdGhJbk1icyo4KSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoY29uc3QgT01YX1U4KilhbHBoYSsyLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChjb25zdCBPTVhfVTgqKWJldGErMiwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoY29uc3QgT01YX1U4Kil0aHJlc2hvbGRDaHJvbWErOCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoY29uc3QgT01YX1U4KiliUysxNiApOwotICAgICAgICAgICAgfQotICAgICAgICB9Ci0KLSAgICAgICAgbWJDb2wrKzsKLSAgICAgICAgaWYgKG1iQ29sID09IHBpY1dpZHRoSW5NYnMpCi0gICAgICAgIHsKLSAgICAgICAgICAgIG1iQ29sID0gMDsKLSAgICAgICAgICAgIG1iUm93Kys7Ci0gICAgICAgIH0KLSAgICB9Ci0KLX0KLQotLyotLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0KLQotICAgIEZ1bmN0aW9uOiBHZXRCb3VuZGFyeVN0cmVuZ3RocwotCi0gICAgICAgIEZ1bmN0aW9uYWwgZGVzY3JpcHRpb246Ci0gICAgICAgICAgICBGdW5jdGlvbiB0byBjYWxjdWxhdGUgYm91bmRhcnkgc3RyZW5ndGhzIGZvciBhbGwgZWRnZXMgb2YgYQotICAgICAgICAgICAgbWFjcm9ibG9jay4gRnVuY3Rpb24gcmV0dXJucyBIQU5UUk9fVFJVRSBpZiBhbnkgb2YgdGhlIGJTIHZhbHVlcyBmb3IKLSAgICAgICAgICAgIHRoZSBtYWNyb2Jsb2NrIGhhZCBub24temVybyB2YWx1ZSwgSEFOVFJPX0ZBTFNFIG90aGVyd2lzZS4KLQotLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tL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UbXAgPSAwOwotICAgIH0KLQotICAgIC8qIGxlZnQgZWRnZXMgKi8KLSAgICBwVG1wID0gKHUzMiopJmJTWzBdWzBdOwotICAgIGlmIChmbGFncyAmIEZJTFRFUl9MRUZUX0VER0UpCi0gICAgewotICAgICAgICBpZiAoaXNJbnRyYU1iIHx8IElTX0lOVFJBX01CKCptYi0+bWJBKSkKLSAgICAgICAgewotICAgICAgICAgICAgLypiU1swXVswXSA9IGJTWzBdWzFdID0gYlNbMF1bMl0gPSBiU1swXVszXSA9IDQ7Ki8KLSAgICAgICAgICAgICpwVG1wID0gMHgwNDA0MDQwNDsKLSAgICAgICAgICAgIG5vblplcm9CcyA9IEhBTlRST19UUlVFOwotICAgICAgICB9Ci0gICAgICAgIGVsc2UKLSAgICAgICAgewotICAgICAgICAgICAgKnBUbXAgPSBFZGdlQm91bmRhcnlTdHJlbmd0aExlZnQobWIsIG1iLT5tYkEpOwotICAgICAgICAgICAgaWYgKCFub25aZXJvQnMgJiYgKnBUbXApCi0gICAgICAgICAgICAgICAgbm9uWmVyb0JzID0gSEFOVFJPX1RSVUU7Ci0gICAgICAgIH0KLSAgICB9Ci0gICAgZWxzZQotICAgIHsKLSAgICAgICAgKnBUbXAgPSAwOwotICAgIH0KLQotICAgIC8qIGlubmVyIGVkZ2VzICovCi0gICAgaWYgKGlzSW50cmFNYikKLSAgICB7Ci0gICAgICAgIHBUbXArKzsKLSAgICAgICAgKnBUbXArKyA9IDB4MDMwMzAzMDM7Ci0gICAgICAgICpwVG1wKysgPSAweDAzMDMwMzAzOwotICAgICAgICAqcFRtcCsrID0gMHgwMzAzMDMwMzsKLSAgICAgICAgcFRtcCsrOwotICAgICAgICAqcFRtcCsrID0gMHgwMzAzMDMwMzsKLSAgICAgICAgKnBUbXArKyA9IDB4MDMwMzAzMDM7Ci0gICAgICAgICpwVG1wID0gMHgwMzAzMDMwMzsKLQotICAgICAgICBub25aZXJvQnMgPSBIQU5UUk9fVFJVRTsKLSAgICB9Ci0gICAgZWxzZQotICAgIHsKLSAgICAgICAgcFRtcCA9ICh1MzIqKW1iLT50b3RhbENvZWZmOwotCi0gICAgICAgIC8qIDE2eDE2IGludGVyIG1iIC0+IHJlZiBhZGRyZXNzZXMgb3IgbW90aW9uIHZlY3RvcnMgY2Fubm90IGRpZmZlciwKLSAgICAgICAgICogb25seSBjaGVjayBpZiBlaXRoZXIgb2YgdGhlIGJsb2NrcyBjb250YWluIGNvZWZmaWNpZW50cyAqLwotICAgICAgICBpZiAoaDI2NGJzZE51bU1iUGFydChtYi0+bWJUeXBlKSA9PSAxKQotICAgICAgICB7Ci0gICAgICAgICAgICB0bXAxID0gKnBUbXArKzsKLSAgICAgICAgICAgIHRtcDIgPSAqcFRtcCsrOwotICAgICAgICAgICAgYlNbMV1bNF0gID0gKHRtcDEgJiAweDAwRkYwMEZGKSA/IDIgOiAwOyAvKiBbMl0gIHx8IFswXSAqLwotICAgICAgICAgICAgYlNbMV1bNV0gID0gKHRtcDEgJiAweEZGMDBGRjAwKSA/IDIgOiAwOyAvKiBbM10gIHx8IFsxXSAqLwotICAgICAgICAgICAgYlNbMF1bNF0gID0gKHRtcDEgJiAweDAwMDBGRkZGKSA/IDIgOiAwOyAvKiBbMV0gIHx8IFswXSAqLwotICAgICAgICAgICAgYlNbMF1bNV0gID0gKHRtcDEgJiAweEZGRkYwMDAwKSA/IDIgOiAwOyAvKiBbM10gIHx8IFsyXSAqLwotCi0gICAgICAgICAgICB0bXAxID0gKnBUbXArKzsKLSAgICAgICAgICAgIGJTWzFdWzZdICA9ICh0bXAyICYgMHgwMEZGMDBGRikgPyAyIDogMDsgLyogWzZdICB8fCBbNF0gKi8KLSAgICAgICAgICAgIGJTWzFdWzddICA9ICh0bXAyICYgMHhGRjAwRkYwMCkgPyAyIDogMDsgLyogWzddICB8fCBbNV0gKi8KLSAgICAgICAgICAgIGJTWzBdWzEyXSA9ICh0bXAyICYgMHgwMDAwRkZGRikgPyAyIDogMDsgLyogWzVdICB8fCBbNF0gKi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OV07Ci0gICAgICAgICAgICB0bXA0ID0gbWItPnRvdGFsQ29lZmZbM107Ci0KLSAgICAgICAgICAgIGJTWzFdWzhdID0gdG1wMSB8fCB0bXAyID8gMiA6IDA7Ci0gICAgICAgICAgICB0bXAxID0gbWItPnRvdGFsQ29lZmZbMTJdOwotICAgICAgICAgICAgdG1wMiA9IG1iLT50b3RhbENvZWZmWzZdOwotICAgICAgICAgICAgYlNbMV1bOV0gPSB0bXAzIHx8IHRtcDQgPyAyIDogMDsKLSAgICAgICAgICAgIHRtcDMgPSBtYi0+dG90YWxDb2VmZlsxM107Ci0gICAgICAgICAgICB0bXA0ID0gbWItPnRvdGFsQ29lZmZbN107Ci0gICAgICAgICAgICBiU1sxXVsxMF0gPSB0bXAxIHx8IHRtcDIgPyAyIDogMDsKLSAgICAgICAgICAgIHRtcDEgPSBtYi0+dG90YWxDb2VmZls0XTsKLSAgICAgICAgICAgIHRtcDIgPSBtYi0+dG90YWxDb2VmZlsxXTsKLSAgICAgICAgICAgIGJTWzFdWzExXSA9IHRtcDMgfHwgdG1wNCA/IDIgOiAwOwotICAgICAgICAgICAgdG1wMyA9IG1iLT50b3RhbENvZWZmWzZdOwotICAgICAgICAgICAgdG1wNCA9IG1iLT50b3RhbENvZWZmWzNdOwotICAgICAgICAgICAgYlNbMF1bOF0gPSB0bXAxIHx8IHRtcDIgPyAyIDogMDsKLSAgICAgICAgICAgIHRtcDEgPSBtYi0+dG90YWxDb2VmZlsxMl07Ci0gICAgICAgICAgICB0bXAyID0gbWItPnRvdGFsQ29lZmZbOV07Ci0gICAgICAgICAgICBiU1swXVs5XSA9IHRtcDMgfHwgdG1wNCA/IDIgOiAwOwotICAgICAgICAgICAgdG1wMyA9IG1iLT50b3RhbENvZWZmWzE0XTsKLSAgICAgICAgICAgIHRtcDQgPSBtYi0+dG90YWxDb2VmZlsxMV07Ci0gICAgICAgICAgICBiU1swXVsxMF0gPSB0bXAxIHx8IHRtcDIgPyAyIDogMDsKLSAgICAgICAg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8fCBbMTRdICovCi0KLSAgICAgICAgICAgIGJTWzFdWzhdID0gKHU4KUlubmVyQm91bmRhcnlTdHJlbmd0aChtYiwgOCwgMik7Ci0gICAgICAgICAgICBiU1sxXVs5XSA9ICh1OClJbm5lckJvdW5kYXJ5U3RyZW5ndGgobWIsIDksIDMpOwotICAgICAgICAgICAgYlNbMV1bMTBdID0gKHU4KUlubmVyQm91bmRhcnlTdHJlbmd0aChtYiwgMTIsIDYpOwotICAgICAgICAgICAgYlNbMV1bMTFdID0gKHU4KUlubmVyQm91bmRhcnlTdHJlbmd0aChtYiwgMTMsIDcpOwotCi0gICAgICAgICAgICB7Ci0gICAgICAgICAgICB1MzIgdG1wMywgdG1wNDsKLQotICAgICAgICAgICAgdG1wMSA9IG1iLT50b3RhbENvZWZmWzRdOwotICAgICAgICAgICAgdG1wMiA9IG1iLT50b3RhbENvZWZmWzFdOwotICAgICAgICAgICAgdG1wMyA9IG1iLT50b3RhbENvZWZmWzZdOwotICAgICAgICAgICAgdG1wNCA9IG1iLT50b3RhbENvZWZmWzNdOwotICAgICAgICAgICAgYlNbMF1bOF0gPSB0bXAxIHx8IHRtcDIgPyAyIDogMDsKLSAgICAgICAgICAgIHRtcDEgPSBtYi0+dG90YWxDb2VmZlsxMl07Ci0gICAgICAgICAgICB0bXAyID0gbWItPnRvdGFsQ29lZmZbOV07Ci0gICAgICAgICAgICBiU1swXVs5XSA9IHRtcDMgfHwgdG1wNCA/IDIgOiAwOwotICAgICAgICAgICAgdG1wMyA9IG1iLT50b3RhbENvZWZmWzE0XTsKLSAgICAgICAgICAgIHRtcDQgPSBtYi0+dG90YWxDb2VmZlsxMV07Ci0gICAgICAgICAgICBiU1swXVsxMF0gPSB0bXAxIHx8IHRtcDIgPyAyIDogMDsKLSAgICAgICAgICAgIGJTWzBdWzExXSA9IHRtcDMgfHwgdG1wNCA/IDIgOiAwOwotICAgICAgICAgICAgfQotICAgICAgICB9Ci0gICAgICAgIC8qIDh4MTYgaW50ZXIgbW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gIGJTWzBdWzldID0gKHU4KUlubmVyQm91bmRhcnlTdHJlbmd0aChtYiwgNiwgMyk7Ci0gICAgICAgICAgICBiU1swXVsxMF0gPSAodTgpSW5uZXJCb3VuZGFyeVN0cmVuZ3RoKG1iLCAxMiwgOSk7Ci0gICAgICAgICAgICBiU1swXVsxMV0gPSAodTgpSW5uZXJCb3VuZGFyeVN0cmVuZ3RoKG1iLCAxNCwgMTEpOwotCi0gICAgICAgICAgICB7Ci0gICAgICAgICAgICB1MzIgdG1wMywgdG1wNDsKLQotICAgICAgICAgICAgdG1wMSA9IG1iLT50b3RhbENvZWZmWzhdOwotICAgICAgICAgICAgdG1wMiA9IG1iLT50b3RhbENvZWZmWzJdOwotICAgICAgICAgICAgdG1wMyA9IG1iLT50b3RhbENvZWZmWzldOwotICAgICAgICAgICAgdG1wNCA9IG1iLT50b3RhbENvZWZmWzNdOwotICAgICAgICAgICAgYlNbMV1bOF0gPSB0bXAxIHx8IHRtcDIgPyAyIDogMDsKLSAgICAgICAgICAgIHRtcDEgPSBtYi0+dG90YWxDb2VmZlsxMl07Ci0gICAgICAgICAgICB0bXAyID0gbWItPnRvdGFsQ29lZmZbNl07Ci0gICAgICAgICAgICBiU1sxXVs5XSA9IHRtcDMgfHwgdG1wNCA/IDIgOiAwOwotICAgICAgICAgICAgdG1wMyA9IG1iLT50b3RhbENvZWZmWzEzXTsKLSAgICAgICAgICAgIHRtcDQgPSBtYi0+dG90YWxDb2VmZls3XTsKLSAgICAgICAgICAgIGJTWzFdWzEwXSA9IHRtcDEgfHwgdG1wMiA/IDIgOiAwOwotICAgICAgICAgICAgYlNbMV1bMTFdID0gdG1wMyB8fCB0bXA0ID8gMiA6IDA7Ci0gICAgICAgICAgICB9Ci0gICAgICAgIH0KLSAgICAgICAgZWxzZQotICAgICAgICB7Ci0gICAgICAgICAgICB0bXAxID0gKnBUbXArKzsKLSAgICAgICAgICAgIGJTWzFdWzRdID0gKHRtcDEgJiAweDAwRkYwMEZGKSA/IDI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pID4+IDE7Ci0KLSAgICAgICAgICAgIGluZGV4QSA9ICh1MzIpQ0xJUDMoMCwgNTEsIChpMzIpcXBBdiArIG1iLT5maWx0ZXJPZmZzZXRBKTsKLSAgICAgICAgICAgIGluZGV4QiA9ICh1MzIpQ0xJUDMoMCwgNTEsIChpMzIpcXBBdiArIG1iLT5maWx0ZXJPZmZzZXRCKTsKLQotICAgICAgICAgICAgYWxwaGFbMV1bMF0gPSBhbHBoYXNbaW5kZXhBXTsKLSAgICAgICAgICAgIGJldGFbMV1bMF0gPSBiZXRhc1tpbmRleEJdOwotICAgICAgICAgICAgdDEgPSBic1sxXVswXTsKLSAgICAgICAgICAgIHQyID0gYnNbMV1bMV07Ci0gICAgICAgICAgICB0MyA9IGJzWzFdWzJdOwotICAgICAgICAgICAgdDQgPSBic1sxXVszXTsKLSAgICAgICAgICAgIHRocmVzaG9sZFsxXVswXSA9ICh0MSAmJiAodDEgPCA0KSkgPyB0YzBbaW5kZXhBXVt0MV0gOiAwOwotICAgICAgICAgICAgdGhyZXNob2xkWzFdWzFdID0gKHQyICYmICh0MiA8IDQpKSA/IHRjMFtpbmRleEFdW3QyXSA6IDA7Ci0gICAgICAgICAgICB0aHJlc2hvbGRbMV1bMl0gPSAodDMgJiYgKHQzIDwgNCkpID8gdGMwW2luZGV4QV1bdDNdIDogMDsKLSAgICAgICAgICAgIHRocmVzaG9sZFsxXVszXSA9ICh0NCAmJiAodDQgPCA0KSkgPyB0YzBbaW5kZXhBXVt0NF0gOiAwOwotICAgICAgICB9Ci0gICAgfQotICAgIGlmIChmaWx0ZXJpbmdGbGFncyAmIEZJTFRFUl9MRUZUX0VER0UpCi0gICAgewotICAgICAgICBxcFRtcCA9IG1iLT5tYkEtPnFwWTsKLSAgICAgICAgaWYgKHFwVG1wICE9IHFwKQotICAgICAgICB7Ci0gICAgICAgICAgICBxcEF2ID0gKHFwICsgcXBUbXAgKyAxKSA+PiAxOwotCi0gICAgICAgICAgICBpbmRleEEgPSAodTMyKU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KAotICAgICAgJnN0cm0sCi0gICAgICAmbmFsVW5pdCwKLSAgICAgIHBTdG9yYWdlLAotICAgICAgJmFjY2Vzc1VuaXRCb3VuZGFyeUZsYWcpOwotICAgIGlmICh0bXAgIT0gSEFOVFJPX09LKQotICAgIHsKLSAgICAgICAgRVBSSU5UKCJBQ0NFU1MgVU5JVCBCT1VOREFSWSBDSEVDSyIpOwotICAgICAgICBpZiAodG1wID09IFBBUkFNX1NFVF9FUlJPUikKLSAgICAgICAgICAgIHJldHVybihIMjY0QlNEX1BBUkFNX1NFVF9FUlJPUik7Ci0gICAgICAgIGVsc2UKLSAgICAgICAgICAgIHJldHVybihIMjY0QlNEX0VSUk9SKTsKLSAgICB9Ci0KLSAgICBpZiAoIGFjY2Vzc1VuaXRCb3VuZGFyeUZsYWcgKQotICAgIHsKLSAgICAgICAgREVCVUcoKCJBY2Nlc3MgdW5pdCBib3VuZGFyeVxuIikpOwotICAgICAgICAvKiBjb25jZWFsIGlmIHBpY3R1cmUgc3RhcnRlZCBhbmQgcGFyYW0gc2V0cyBhY3RpdmF0ZWQgKi8KLSAgICAgICAgaWYgKHBTdG9yYWdlLT5waWNTdGFydGVkICYmIHBTdG9yYWdlLT5hY3RpdmVTcHMgIT0gTlVMTCkKLSAgICAgICAgewotICAgICAgICAgICAgREVCVUcoKCJDT05DRUFMSU5HLi4uIikpOwotCi0gICAgICAgICAgICAvKiByZXR1cm4gZXJyb3IgaWYgc2Vjb25kIHBoYXNlIG9mCi0gICAgICAgICAgICAgKiBpbml0aWFsaXphdGlvbiBpcyBub3QgY29tcGxldGVkICovCi0gICAgICAgICAgICBpZiAocFN0b3JhZ2UtPnBlbmRpbmdBY3RpdmF0aW9uKQotICAgICAgICAgICAgewotICAgICAgICAgICAgICAgIEVQUklOVCgiUGVuZGluZyBhY3RpdmF0aW9uIG5vdCBjb21wbGV0ZWQiKTsKLSAgICAgICAgICAgICAgICByZXR1cm4gKEgyNjRCU0RfRVJST1IpOwotICAgICAgICAgICAgfQotCi0gICAgICAgICAgICBpZiAoIXBTdG9yYWdlLT52YWxpZFNsaWNlSW5BY2Nlc3NVbml0KQotICAgICAgICAgICAgewotICAgICAgICAgICAgICAgIHBTdG9yYWdlLT5jdXJySW1hZ2UtPmRhdGEgPQotICAgICAgICAgICAgICAgICAgICBoMjY0YnNkQWxsb2NhdGVEcGJJbWFnZShwU3RvcmFnZS0+ZHBiKTsKLSAgICAgICAgICAgICAgICBoMjY0YnNkSW5pdFJlZlBpY0xpc3QocFN0b3JhZ2UtPmRwYik7Ci0gICAgICAgICAgICAgICAgdG1wID0gaDI2NGJzZENvbmNlYWwocFN0b3JhZ2UsIHBTdG9yYWdlLT5jdXJySW1hZ2UsIFBfU0xJQ0UpOwotICAgICAgICAgICAgfQotICAgICAgICAgICAgZWxzZQotICAgICAgICAgICAgICAgIHRtcCA9IGgyNjRic2RDb25jZWFsKHBTdG9yYWdlLCBwU3RvcmFnZS0+Y3VyckltYWdlLAotICAgICAgICAgICAgICAgICAgICBwU3RvcmFnZS0+c2xpY2VIZWFkZXItPnNsaWNlVHlwZSk7Ci0KLSAgICAgICAgICAgIHBpY1JlYWR5ID0gSEFOVFJPX1RSVUU7Ci0KLSAgICAgICAgICAgIC8qIGN1cnJlbnQgTkFMIHVuaXQgc2hvdWxkIGJlIGRlY29kZWQgb24gbmV4dCBhY3RpdmF0aW9uIC0+IHNldAotICAgICAgICAgICAgICogcmVhZEJ5dGVzIHRvIDAgKi8KLSAgICAgICAgICAgICpyZWFkQnl0ZXMgPSAwOwotICAgICAgICAgICAgcFN0b3JhZ2UtPnByZXZCdWZOb3RGaW5pc2hlZCA9IEhBTlRST19UUlVFOwotICAgICAgICAgICAgREVCVUcoKCIuLi5ET05FXG4iKSk7Ci0gICAgICAgIH0KLSAgICAgICAgZWxzZQotICAgICAgICB7Ci0gICAgICAgICAgICBwU3RvcmFnZS0+dmFsaWRTbGljZUluQWNjZXNzVW5pdCA9IEhBTlRST19GQUxTRTsKLSAgICAgICAgfQotICAgICAgICBwU3RvcmFnZS0+c2tpcFJlZHVuZGFudFNsaWNlcyA9IEhBTlRST19GQUxTRTsKLSAgICB9Ci0KLSAgICBpZiAoIXBpY1JlYWR5KQotICAgIHsKLSAgICAgICAgc3dpdGNoIChuYWxVbml0Lm5hbFVuaXRUeXBlKQotICAgICAgICB7Ci0gICAgICAgICAgICBjYXNlIE5BTF9TRVFfUEFSQU1fU0VUOgotICAgICAgICAgICAgICAgIERFQlVHKCgiU0VRIFBBUkFNIFNFVFxuIikpOwotICAgICAgICAgICAgICAgIHRtcCA9IGgyNjRic2REZWNvZGVTZXFQYXJhbVNldCgmc3RybSwgJnNlcVBhcmFtU2V0KTsKLSAgICAgICAgICAgICAgICBpZiAodG1wICE9IEhBTlRST19PSykKLSAgICAgICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgICAgIEVQUklOVCgiU0VRX1BBUkFNX1NFVCIpOwotICAgICAgICAgICAgICAgICAgICBGUkVFKHNlcVBhcmFtU2V0Lm9mZnNldEZvclJlZkZyYW1lKTsKLSAgICAgICAgICAgICAgICAgICAgRlJFRShzZXFQYXJhbVNldC52dWlQYXJhbWV0ZXJzKTsKLSAgICAgICAgICAgICAgICAgICAgcmV0dXJuKEgyNjRCU0RfRVJST1IpOwotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICB0bXAgPSBoMjY0YnNkU3RvcmVTZXFQYXJhbVNldChwU3RvcmFnZSwgJnNlcVBhcmFtU2V0KTsKLSAgICAgICAgICAgICAgICBicmVhazsKLQotICAgICAgICAgICAgY2FzZSBOQUxfUElDX1BBUkFNX1NFVDoKLSAgICAgICAgICAgICAgICBERUJVRygoIlBJQyBQQVJBTSBTRVRcbiIpKTsKLSAgICAgICAgICAgICAgICB0bXAgPSBoMjY0YnNkRGVjb2RlUGljUGFyYW1TZXQoJnN0cm0sICZwaWNQYXJhbVNldCk7Ci0gICAgICAgICAgICAgICAgaWYgKHRtcCAhPSBIQU5UUk9fT0spCi0gICAgICAgICAgICAgICAgewotICAgICAgICAgICAgICAgICAgICBFUFJJTlQoIlBJQ19QQVJBTV9TRVQiKTsKLSAgICAgICAgICAgICAgICAgICAgRlJFRShwaWNQYXJhbVNldC5ydW5MZW5ndGgpOwotICAgICAgICAgICAgICAgICAgICBGUkVFKHBpY1BhcmFtU2V0LnRvcExlZnQpOwotICAgICAgICAgICAgICAgICAgICBGUkVFKHBpY1BhcmFtU2V0LmJvdHRvbVJpZ2h0KTsKLSAgICAgICAgICAgICAgICAgICAgRlJFRShwaWNQYXJhbVNldC5zbGljZUdyb3VwSWQpOwotICAgICAgICAgICAgICAgICAgICByZXR1cm4oSDI2NEJTRF9FUlJPUik7Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgIHRtcCA9IGgyNjRic2RTdG9yZVBpY1BhcmFtU2V0KHBTdG9yYWdlLCAmcGljUGFyYW1TZXQpOwotICAgICAgICAgICAgICAgIGJyZWFrOwotCi0gICAgICAgICAgICBjYXNlIE5BTF9DT0RFRF9TTElDRV9JRFI6Ci0gICAgICAgICAgICAgICAgREVCVUcoKCJJRFIgIikpOwotICAgICAgICAgICAgICAgIC8qIGZhbGwgdGhyb3VnaCAqLwotICAgICAgICAgICAgY2FzZSBOQUxfQ09ERURfU0xJQ0U6Ci0gICAgICAgICAgICAgICAgREVCVUcoKCJTTElDRSBIRUFERVJcbiIpKTsKLQotICAgICAgICAgICAgICAgIC8qIHBpY3R1cmUgc3VjY2Vzc2Z1bGx5IGZpbmlzaGVkIGFuZCBzdGlsbCBkZWNvZGluZyBzYW1lIG9sZAotICAgICAgICAgICAgICAgICAqIGFjY2VzcyB1bml0IC0+IG5vIG5lZWQgdG8gZGVjb2RlIHJlZHVuZGFudCBzbGljZXMgKi8KLSAgICAgICAgICAgICAgICBpZiAocFN0b3JhZ2UtPnNraXBSZWR1bmRhbnRTbGljZXMpCi0gICAgICAgICAgICAgICAgICAgIHJldHVybihIMjY0QlNEX1JEWSk7Ci0KLSAgICAgICAgICAgICAgICBwU3RvcmFnZS0+cGljU3RhcnRlZCA9IEhBTlRST19UUlVFOwotCi0gICAgICAgICAgICAgICAgaWYgKGgyNjRic2RJc1N0YXJ0T2ZQaWN0dXJlKHBTdG9yYWdlKSkKLSAgICAgICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgICAgIHBTdG9yYWdlLT5udW1Db25jZWFsZWRNYnMgPSAwOwotICAgICAgICAgICAgICAgICAgICBwU3RvcmFnZS0+Y3VycmVudFBpY0lkICAgID0gcGljSWQ7Ci0KLSAgICAgICAgICAgICAgICAgICAgdG1wID0gaDI2NGJzZENoZWNrUHBzSWQoJnN0cm0sICZwcHNJZCk7Ci0gICAgICAgICAgICAgICAgICAgIEFTU0VSVCh0bXAgPT0gSEFOVFJPX09LKTsKLSAgICAgICAgICAgICAgICAgICAgLyogc3RvcmUgb2xkIGFjdGl2ZVNwc0lkIGFuZCByZXR1cm4gaGVhZGVycyByZWFkeQotICAgICAgICAgICAgICAgICAgICAgKiBpbmRpY2F0aW9uIGlmIGFjdGl2ZVNwcyBjaGFuZ2VzICovCi0gICAgICAgICAgICAgICAgICAgIHNwc0lkID0gcFN0b3JhZ2UtPmFjdGl2ZVNwc0lkOwotICAgICAgICAgICAgICAgICAgICB0bXAgPSBoMjY0YnNkQWN0aXZhdGVQYXJhbVNldHMocFN0b3JhZ2UsIHBwc0lkLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgIElTX0lEUl9OQUxfVU5JVCgmbmFsVW5pdCkgPwotICAgICAgICAgICAgICAgICAgICAgICAgICAgIEhBTlRST19UUlVFIDogSEFOVFJPX0ZBTFNFKTsKLSAgICAgICAgICAgICAgICAgICAgaWYgKHRtcCAhPSBIQU5UUk9fT0spCi0gICAgICAgICAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAgICAgICAgIEVQUklOVCgiUGFyYW0gc2V0IGFjdGl2YXRpb24iKTsKLSAgICAgICAgICAgICAgICAgICAgICAgIHBTdG9yYWdlLT5hY3RpdmVQcHNJZCA9IE1BWF9OVU1fUElDX1BBUkFNX1NFVFM7Ci0gICAgICAgICAgICAgICAgICAgICAgICBwU3RvcmFnZS0+YWN0aXZlUHBzID0gTlVMTDsKLSAgICAgICAgICAgICAgICAgICAgICAgIHBTdG9yYWdlLT5hY3RpdmVTcHNJZCA9IE1BWF9OVU1fU0VRX1BBUkFNX1NFVFM7Ci0gICAgICAgICAgICAgICAgICAgICAgICBwU3RvcmFnZS0+YWN0aXZlU3BzID0gTlVMTDsKLSAgICAgICAgICAgICAgICAgICAgICAgIHBTdG9yYWdlLT5wZW5kaW5nQWN0aXZhdGlvbiA9IEhBTlRST19GQUxTRTsKLQotICAgICAgICAgICAgICAgICAgICAgICAgaWYodG1wID09IE1FTU9SWV9BTExPQ0FUSU9OX0VSUk9SKQotICAgICAgICAgICAgICAgICAgICAgICAgewotICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBIMjY0QlNEX01FTUFMTE9DX0VSUk9SOwotICAgICAgICAgICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgICAgICAgICAgZWxzZQotICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybihIMjY0QlNEX1BBUkFNX1NFVF9FUlJPUik7Ci0gICAgICAgICAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgICAgICAgICBpZiAoc3BzSWQgIT0gcFN0b3JhZ2UtPmFjdGl2ZVNwc0lkKQotICAgICAgICAgICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgICAgICAgICBzZXFQYXJhbVNldF90ICpvbGRTUFMgPSBOVUxMOwotICAgICAgICAgICAgICAgICAgICAgICAgc2VxUGFyYW1TZXRfdCAqbmV3U1BTID0gcFN0b3JhZ2UtPmFjdGl2ZVNwczsKLSAgICAgICAgICAgICAgICAgICAgICAgIHUzMiBub091dHB1dE9mUHJpb3JQaWNzRmxhZyA9IDE7Ci0KLSAgICAgICAgICAgICAgICAgICAgICAgIGlmKHBTdG9yYWdlLT5vbGRTcHNJZCA8IE1BWF9OVU1fU0VRX1BBUkFNX1NFVFMpCi0gICAgICAgICAgICAgICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgb2xkU1BTID0gcFN0b3JhZ2UtPnNwc1twU3RvcmFnZS0+b2xkU3BzSWRdOwotICAgICAgICAgICAgICAgICAgICAgICAgfQotCi0gICAgICAgICAgICAgICAgICAgICAgICAqcmVhZEJ5dGVzID0gMDsKLSAgICAgICAgICAgICAgICAgICAgICAgIHBTdG9yYWdlLT5wcmV2QnVmTm90RmluaXNoZWQgPSBIQU5UUk9fVFJVRTsKLQotCi0gICAgICAgICAgICAgICAgICAgICAgICBpZihuYWxVbml0Lm5hbFVuaXRUeXBlID09IE5BTF9DT0RFRF9TTElDRV9JRFIpCi0gICAgICAgICAgICAgICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgdG1wID0KLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBoMjY0YnNkQ2hlY2tQcmlvclBpY3NGbGFnKCZub091dHB1dE9mUHJpb3JQaWNzRmxhZywKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmc3RybSwgbmV3U1BTLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBTdG9yYWdlLT5hY3RpdmVQcHMsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbmFsVW5pdC5uYWxVbml0VHlwZSk7Ci0gICAgICAgICAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgICAgICAgICBlbHNlCi0gICAgICAgICAgICAgICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgdG1wID0gSEFOVFJPX05PSzsKLSAgICAgICAgICAgICAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgICAgICAgICAgICAgaWYoKHRtcCAhPSBIQU5UUk9fT0spIHx8Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAobm9PdXRwdXRPZlByaW9yUGljc0ZsYWcgIT0gMCkgfHwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgIChwU3RvcmFnZS0+ZHBiLT5ub1Jlb3JkZXJpbmcpIHx8Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAob2xkU1BTID09IE5VTEwpIHx8Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAob2xkU1BTLT5waWNXaWR0aEluTWJzICE9IG5ld1NQUy0+cGljV2lkdGhJbk1icykgfHwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgIChvbGRTUFMtPnBpY0hlaWdodEluTWJzICE9IG5ld1NQUy0+cGljSGVpZ2h0SW5NYnMpIHx8Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAob2xkU1BTLT5tYXhEcGJTaXplICE9IG5ld1NQUy0+bWF4RHBiU2l6ZSkpCi0gICAgICAgICAgICAgICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgcFN0b3JhZ2UtPmRwYi0+Zmx1c2hlZCA9IDA7Ci0gICAgICAgICAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgICAgICAgICBlbHNlCi0gICAgICAgICAgICAgICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgaDI2NGJzZEZsdXNoRHBiKHBTdG9yYWdlLT5kcGIpOwotICAgICAgICAgICAgICAgICAgICAgICAgfQotCi0gICAgICAgICAgICAgICAgICAgICAgICBwU3RvcmFnZS0+b2xkU3BzSWQgPSBwU3RvcmFnZS0+YWN0aXZlU3BzSWQ7Ci0KLSAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybihIMjY0QlNEX0hEUlNfUkRZKTsKLSAgICAgICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgICAgIC8qIHJldHVybiBlcnJvciBpZiBzZWNvbmQgcGhhc2Ugb2YKLSAgICAgICAgICAgICAgICAgKiBpbml0aWFsaXphdGlvbiBpcyBub3QgY29tcGxldGVkICovCi0gICAgICAgICAgICAgICAgaWYgKHBTdG9yYWdlLT5wZW5kaW5nQWN0aXZhdGlvbikKLSAgICAgICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgICAgIEVQUklOVCgiUGVuZGluZyBhY3RpdmF0aW9uIG5vdCBjb21wbGV0ZWQiKTsKLSAgICAgICAgICAgICAgICAgICAgcmV0dXJuIChIMjY0QlNEX0VSUk9SKTsKLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgdG1wID0gaDI2NGJzZERlY29kZVNsaWNlSGVhZGVyKCZzdHJtLCBwU3RvcmFnZS0+c2xpY2VIZWFkZXIgKyAxLAotICAgICAgICAgICAgICAgICAgICBwU3RvcmFnZS0+YWN0aXZlU3BzLCBwU3RvcmFnZS0+YWN0aXZlUHBzLCAmbmFsVW5pdCk7Ci0gICAgICAgICAgICAgICAgaWYgKHRtcCAhPSBIQU5UUk9fT0spCi0gICAgICAgICAgICAgICAgewotICAgICAgICAgICAgICAgICAgICBFUFJJTlQoIlNMSUNFX0hFQURFUiIpOwotICAgICAgICAgICAgICAgICAgICByZXR1cm4oSDI2NEJTRF9FUlJPUik7Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgIGlmIChoMjY0YnNkSXNTdGFydE9mUGljdHVyZShwU3RvcmFnZSkpCi0gICAgICAgICAgICAgICAgewotICAgICAgICAgICAgICAgICAgICBpZiAoIUlTX0lEUl9OQUxfVU5JVCgmbmFsVW5pdCkpCi0gICAgICAgICAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAgICAgICAgIHRtcCA9IGgyNjRic2RDaGVja0dhcHNJbkZyYW1lTnVtKHBTdG9yYWdlLT5kcGIsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgcFN0b3JhZ2UtPnNsaWNlSGVhZGVyWzFdLmZyYW1lTnVtLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgIG5hbFVuaXQubmFsUmVmSWRjICE9IDAgPwotICAgICAgICAgICAgICAgICAgICAgICAgICAgIEhBTlRST19UUlVFIDogSEFOVFJPX0ZBTFNFLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBTdG9yYWdlLT5hY3RpdmVTcHMtPgotICAgICAgICAgICAgICAgICAgICAgICAgICAgIGdhcHNJbkZyYW1lTnVtVmFsdWVBbGxvd2VkRmxhZyk7Ci0gICAgICAgICAgICAgICAgICAgICAgICBpZiAodG1wICE9IEhBTlRST19PSykKLSAgICAgICAgICAgICAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBFUFJJTlQoIkdhcHMgaW4gZnJhbWUgbnVtIik7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuKEgyNjRCU0RfRVJST1IpOwotICAgICAgICAgICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgICAgIHBTdG9yYWdlLT5jdXJySW1hZ2UtPmRhdGEgPQotICAgICAgICAgICAgICAgICAgICAgICAgaDI2NGJzZEFsbG9jYXRlRHBiSW1hZ2UocFN0b3JhZ2UtPmRwYik7Ci0gICAgICAgICAgICAgICAgfQotCi0gICAgICAgICAgICAgICAgLyogc3RvcmUgc2xpY2UgaGVhZGVyIHRvIHN0b3JhZ2UgaWYgc3VjY2Vzc2Z1bGx5IGRlY29kZWQgKi8KLSAgICAgICAgICAgICAgICBwU3RvcmFnZS0+c2xpY2VIZWFkZXJbMF0gPSBwU3RvcmFnZS0+c2xpY2VIZWFkZXJbMV07Ci0gICAgICAgICAgICAgICAgcFN0b3JhZ2UtPnZhbGlkU2xpY2VJbkFjY2Vzc1VuaXQgPSBIQU5UUk9fVFJVRTsKLSAgICAgICAgICAgICAgICBwU3RvcmFnZS0+cHJldk5hbFVuaXRbMF0gPSBuYWxVbml0OwotCi0gICAgICAgICAgICAgICAgaDI2NGJzZENvbXB1dGVTbGljZUdyb3VwTWFwKHBTdG9yYWdlLAotICAgICAgICAgICAgICAgICAgICBwU3RvcmFnZS0+c2xpY2VIZWFkZXItPnNsaWNlR3JvdXBDaGFuZ2VDeWNsZSk7Ci0KLSAgICAgICAgICAgICAgICBoMjY0YnNkSW5pdFJlZlBpY0xpc3QocFN0b3JhZ2UtPmRwYik7Ci0gICAgICAgICAgICAgICAgdG1wID0gaDI2NGJzZFJlb3JkZXJSZWZQaWNMaXN0KHBTdG9yYWdlLT5kcGIsCi0gICAgICAgICAgICAgICAgICAgICZwU3RvcmFnZS0+c2xpY2VIZWFkZXItPnJlZlBpY0xpc3RSZW9yZGVyaW5nLAotICAgICAgICAgICAgICAgICAgICBwU3RvcmFnZS0+c2xpY2VIZWFkZXItPmZyYW1lTnVtLAotICAgICAgICAgICAgICAgICAgICBwU3RvcmFnZS0+c2xpY2VIZWFkZXItPm51bVJlZklkeEwwQWN0aXZlKTsKLSAgICAgICAgICAgICAgICBpZiAodG1wICE9IEhBTlRST19PSykKLSAgICAgICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgICAgIEVQUklOVCgiUmVvcmRlcmluZyIpOwotICAgICAgICAgICAgICAgICAgICByZXR1cm4oSDI2NEJTRF9FUlJPUik7Ci0gICAgICAgICAgICAgICAgfQotCi0gICAgICAgICAgICAgICAgREVCVUcoKCJTTElDRSBEQVRBLCBGSVJTVCAlZFxuIiwKLSAgICAgICAgICAgICAgICAgICAgICAgIHBTdG9yYWdlLT5zbGljZUhlYWRlci0+Zmlyc3RNYkluU2xpY2UpKTsKLSAgICAgICAgICAgICAgICB0bXAgPSBoMjY0YnNkRGVjb2RlU2xpY2VEYXRhKCZzdHJtLCBwU3RvcmFnZSwKLSAgICAgICAgICAgICAgICAgICAgcFN0b3JhZ2UtPmN1cnJJbWFnZSwgcFN0b3JhZ2UtPnNsaWNlSGVhZGVyKTsKLSAgICAgICAgICAgICAgICBpZiAodG1wICE9IEhBTlRST19PSykKLSAgICAgICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgICAgIEVQUklOVCgiU0xJQ0VfREFUQSIpOwotICAgICAgICAgICAgICAgICAgICBoMjY0YnNkTWFya1NsaWNlQ29ycnVwdGVkKHBTdG9yYWdlLAotICAgICAgICAgICAgICAgICAgICAgICAgcFN0b3JhZ2UtPnNsaWNlSGVhZGVyLT5maXJzdE1iSW5TbGljZSk7Ci0gICAgICAgICAgICAgICAgICAgIHJldHVybihIMjY0QlNEX0VSUk9SKTsKLSAgICAgICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgICAgICBpZiAoaDI2NGJzZElzRW5kT2ZQaWN0dXJlKHBTdG9yYWdlKSkKLSAgICAgICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgICAgIHBpY1JlYWR5ID0gSEFOVFJPX1RSVUU7Ci0gICAgICAgICAgICAgICAgICAgIHBTdG9yYWdlLT5za2lwUmVkdW5kYW50U2xpY2VzID0gSEFOVFJPX1RSVUU7Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgIGJyZWFrOwotCi0gICAgICAgICAgICBjYXNlIE5BTF9TRUk6Ci0gICAgICAgICAgICAgICAgREVCVUcoKCJTRUkgTUVTU0FHRSwgTk9UIERFQ09ERUQiKSk7Ci0gICAgICAgICAgICAgICAgYnJlYWs7Ci0KLSAgICAgICAgICAgIGRlZmF1bHQ6Ci0gICAgICAgICAgICAgICAgREVCVUcoKCJOT1QgSU1QTEVNRU5URUQgWUVUICVkXG4iLG5hbFVuaXQubmFsVW5pdFR5cGUpKTsKLSAgICAgICAgfQotICAgIH0KLQotICAgIGlmIChwaWNSZWFkeSkKLSAgICB7Ci0gICAgICAgIGgyNjRic2RGaWx0ZXJQaWN0dXJlKHBTdG9yYWdlLT5jdXJySW1hZ2UsIHBTdG9yYWdlLT5tYik7Ci0KLSAgICAgICAgaDI2NGJzZFJlc2V0U3RvcmFnZShwU3RvcmFnZSk7Ci0KLSAgICAgICAgcGljT3JkZXJDbnQgPSBoMjY0YnNkRGVjb2RlUGljT3JkZXJDbnQocFN0b3JhZ2UtPnBvYywKLSAgICAgICAgICAgIHBTdG9yYWdlLT5hY3RpdmVTcHMsIHBTdG9yYWdlLT5zbGljZUhlYWRlciwgcFN0b3JhZ2UtPnByZXZOYWxVbml0KTsKLQotICAgICAgICBpZiAocFN0b3JhZ2UtPnZhbGlkU2xpY2VJbkFjY2Vzc1VuaXQpCi0gICAgICAgIHsKLSAgICAgICAgICAgIGlmIChwU3RvcmFnZS0+cHJldk5hbFVuaXQtPm5hbFJlZklkYykKLSAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICB0bXAgPSBoMjY0YnNkTWFya0RlY1JlZlBpYyhwU3RvcmFnZS0+ZHBiLAotICAgICAgICAgICAgICAgICAgICAmcFN0b3JhZ2UtPnNsaWNlSGVhZGVyLT5kZWNSZWZQaWNNYXJraW5nLAotICAgICAgICAgICAgICAgICAgICBwU3RvcmFnZS0+Y3VyckltYWdlLCBwU3RvcmFnZS0+c2xpY2VIZWFkZXItPmZyYW1lTnVtLAotICAgICAgICAgICAgICAgICAgICBwaWNPcmRlckNudCwKLSAgICAgICAgICAgICAgICAgICAgSVNfSURSX05BTF9VTklUKHBTdG9yYWdlLT5wcmV2TmFsVW5pdCkgPwotICAgICAgICAgICAgICAgICAgICBIQU5UUk9fVFJVRSA6IEhBTlRST19GQUxTRSwKLSAgICAgICAgICAgICAgICAgICAgcFN0b3JhZ2UtPmN1cnJlbnRQaWNJZCwgcFN0b3JhZ2UtPm51bUNvbmNlYWxlZE1icyk7Ci0gICAgICAgICAgICB9Ci0gICAgICAgICAgICAvKiBub24tcmVmZXJlbmNlIHBpY3R1cmUsIGp1c3Qgc3RvcmUgZm9yIHBvc3NpYmxlIGRpc3BsYXkKLSAgICAgICAgICAgICAqIHJlb3JkZXJpbmcgKi8KLSAgICAgICAgICAgIGVsc2UKLSAgICAgICAgICAgIHsKLSAgICAgICAgICAgICA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AgICB7Ci0gICAgICAgIHN3aXRjaCAocFN0b3JhZ2UtPmFjdGl2ZVNwcy0+dnVpUGFyYW1ldGVycy0+YXNwZWN0UmF0aW9JZGMpCi0gICAgICAgIHsKLSAgICAgICAgICAgIGNhc2UgQVNQRUNUX1JBVElPX1VOU1BFQ0lGSUVEOiAgdyA9ICAgMDsgaCA9ICAwOyBicmVhazsKLSAgICAgICAgICAgIGNhc2UgQVNQRUNUX1JBVElPXzFfMTogICAgICAgICAgdyA9ICAgMTsgaCA9ICAxOyBicmVhazsKLSAgICAgICAgICAgIGNhc2UgQVNQRUNUX1JBVElPXzEyXzExOiAgICAgICAgdyA9ICAxMjsgaCA9IDExOyBicmVhazsKLSAgICAgICAgICAgIGNhc2UgQVNQRUNUX1JBVElPXzEwXzExOiAgICAgICAgdyA9ICAxMDsgaCA9IDExOyBicmVhazsKLSAgICAgICAgICAgIGNhc2UgQVNQRUNUX1JBVElPXzE2XzExOiAgICAgICAgdyA9ICAxNjsgaCA9IDExOyBicmVhazsKLSAgICAgICAgICAgIGNhc2UgQVNQRUNUX1JBVElPXzQwXzMzOiAgICAgICAgdyA9ICA0MDsgaCA9IDMzOyBicmVhazsKLSAgICAgICAgICAgIGNhc2UgQVNQRUNUX1JBVElPXzI0XzExOiAgICAgICAgdyA9ICAyNDsgaCA9IDExOyBicmVhazsKLSAgICAgICAgICAgIGNhc2UgQVNQRUNUX1JBVElPXzIwXzExOiAgICAgICAgdyA9ICAyMDsgaCA9IDExOyBicmVhazsKLSAgICAgICAgICAgIGNhc2UgQVNQRUNUX1JBVElPXzMyXzExOiAgICAgICAgdyA9ICAzMjsgaCA9IDExOyBicmVhazsKLSAgICAgICAgICAgIGNhc2UgQVNQRUNUX1JBVElPXzgwXzMzOiAgICAgICAgdyA9ICA4MDsgaCA9IDMzOyBicmVhazsKLSAgICAgICAgICAgIGNhc2UgQVNQRUNUX1JBVElPXzE4XzExOiAgICAgICAgdyA9ICAxODsgaCA9IDExOyBicmVhazsKLSAg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gIEZ1bmN0aW9uOiBoMjY0YnNkUmVvcmRlclJlZlBpY0xpc3QKLQotICAgICAgICBGdW5jdGlvbmFsIGRlc2NyaXB0aW9uOgotICAgICAgICAgICAgRnVuY3Rpb24gdG8gcGVyZm9ybSByZWZlcmVuY2UgcGljdHVyZSBsaXN0IHJlb3JkZXJpbmcgYmFzZWQgb24KLSAgICAgICAgICAgIHJlb3JkZXJpbmcgY29tbWFuZHMgcmVjZWl2ZWQgaW4gdGhlIHNsaWNlIGhlYWRlci4gU2VlIGRldGFpbHMKLSAgICAgICAgICAgIG9mIHRoZSBwcm9jZXNzIGluIHRoZSBILjI2NCBzdGFuZGFyZC4KLQotICAgICAgICBJbnB1dHM6Ci0gICAgICAgICAgICBkcGIgICAgICAgICAgICAgcG9pbnRlciB0byBkcGIgc3RvcmFnZSBzdHJ1Y3R1cmUKLSAgICAgICAgICAgIG9yZGVyICAgICAgICAgICBwb2ludGVyIHRvIHJlb3JkZXJpbmcgY29tbWFuZHMKLSAgICAgICAgICAgIGN1cnJGcmFtZU51bSAgICBjdXJyZW50IGZyYW1lIG51bWJlcgotICAgICAgICAgICAgbnVtUmVmSWR4QWN0aXZlIG51bWJlciBvZiBhY3RpdmUgcmVmZXJlbmNlIGluZGljZXMgZm9yIGN1cnJlbnQKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBwaWN0dXJlCi0KLSAgICAgICAgT3V0cHV0czoKLSAgICAgICAgICAgIGRwYiAgICAgICAgICAgICAnbGlzdCcgZmllbGQgb2YgdGhlIHN0cnVjdHVyZSByZW9yZGVyZWQKLQotICAgICAgICBSZXR1cm5zOgotICAgICAgICAgICAgSEFOVFJPX09LICAgICAgc3VjY2VzcwotICAgICAgICAgICAgSEFOVFJPX05PSyAgICAgaWYgbm9uLWV4aXN0aW5nIHBpY3R1cmVzIHJlZmVycmVkIHRvIGluIHRoZQotICAgICAgICAgICAgICAgICAgICAgICAgICAgcmVvcmRlcmluZyBjb21tYW5kcwotCi0tLS0tLS0t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2ldLnJlb3JkZXJpbmdPZlBpY051bXNJZGMgPCAyKQotICAgICAgICB7Ci0gICAgICAgICAgICBpZiAob3JkZXItPmNvbW1hbmRbaV0ucmVvcmRlcmluZ09mUGljTnVtc0lkYyA9PSAwKQotICAgICAgICAgICAgewotICAgICAgICAgICAgICAgIHBpY051bU5vV3JhcCA9Ci0gICAgICAgICAgICAgICAgICAgIChpMzIpcGljTnVtUHJlZCAtIChpMzIpb3JkZXItPmNvbW1hbmRbaV0uYWJzRGlmZlBpY051bTsKLSAgICAgICAgICAgICAgICBpZiAocGljTnVtTm9XcmFwIDwgMCkKLSAgICAgICAgICAgICAgICAgICAgcGljTnVtTm9XcmFwICs9IChpMzIpZHBiLT5tYXhGcmFtZU51bTsKLSAgICAgICAgICAgIH0KLSAgICAgICAgICAgIGVsc2UKLSAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICBwaWNOdW1Ob1dyYXAgPQotICAgICAgICAgICAgICAgICAgICAoaTMyKShwaWNOdW1QcmVkICsgb3JkZXItPmNvbW1hbmRbaV0uYWJzRGlmZlBpY051bSk7Ci0gICAgICAgICAgICAgICAgaWYgKHBpY051bU5vV3JhcCA+PSAoaTMyKWRwYi0+bWF4RnJhbWVOdW0pCi0gICAgICAgICAgICAgICAgICAgIHBpY051bU5vV3JhcCAtPSAoaTMyKWRwYi0+bWF4RnJhbWVOdW07Ci0gICAgICAgICAgICB9Ci0gICAgICAgICAgICBwaWNOdW1QcmVkID0gKHUzMilwaWNOdW1Ob1dyYXA7Ci0gICAgICAgICAgICBwaWNOdW0gPSBwaWNOdW1Ob1dyYXA7Ci0gICAgICAgICAgICBpZiAoKHUzMilwaWNOdW1Ob1dyYXAgPiBjdXJyRnJhbWVOdW0pCi0gICAgICAgICAgICAgICAgcGljTnVtIC09IChpMzIpZHBiLT5tYXhGcmFtZU51bTsKLSAgICAgICAgICAgIGlzU2hvcnRUZXJtID0gSEFOVFJPX1RSVUU7Ci0gICAgICAgIH0KLSAgICAgICAgLyogbG9uZyB0ZXJtICovCi0gICAgICAgIGVsc2UKLSAgICAgICAgewotICAgICAgICAgICAgcGljTnVtID0gKGkzMilvcmRlci0+Y29tbWFuZFtpXS5sb25nVGVybVBpY051bTsKLSAgICAgICAgICAgIGlzU2hvcnRUZXJtID0gSEFOVFJPX0ZBTFNFOwotCi0gICAgICAgIH0KLSAgICAgICAgLyogZmluZCBjb3JyZXNwb25kaW5nIHBpY3R1cmUgZnJvbSBkcGIgKi8KLSAgICAgICAgaW5kZXggPSBGaW5kRHBiUGljKGRwYiwgcGljTnVtLCBpc1Nob3J0VGVybSk7Ci0gICAgICAgIGlmIChpbmRleCA8IDAgfHwgIUlTX0VYSVNUSU5HKGRwYi0+YnVmZmVyW2luZGV4XSkpCi0gICAgICAgICAgICByZXR1cm4oSEFOVFJPX05PSyk7Ci0KLSAgICAgICAgLyogc2hpZnQgcGljdHVyZXMgKi8KLSAgICAgICAgZm9yIChqID0gbnVtUmVmSWR4QWN0aXZlOyBqID4gcmVmSWR4OyBqLS0pCi0gICAgICAgICAgICBkcGItPmxpc3Rbal0gPSBkcGItPmxpc3Rbai0xXTsKLSAgICAgICAgLyogcHV0IHBpY3R1cmUgaW50byB0aGUgbGlzdCAqLwotICAgICAgICBkcGItPmxpc3RbcmVmSWR4KytdID0gJmRwYi0+YnVmZmVyW2luZGV4XTsKLSAgICAgICAgLyogcmVtb3ZlIGxhdGVyIHJlZmVyZW5jZXMgdG8gdGhlIHNhbWUgcGljdHVyZSAqLwotICAgICAgICBmb3IgKGogPSBrID0gcmVmSWR4OyBqIDw9IG51bVJlZklkeEFjdGl2ZTsgaisrKQotICAgICAgICAgICAgaWYoZHBiLT5saXN0W2pdICE9ICZkcGItPmJ1ZmZlcltpbmRleF0pCi0gICAgICAgICAgICAgICAgZHBiLT5saXN0W2srK10gPSBkcGItPmxpc3Rbal07Ci0KLSAgICAgICAgaSsrOwotICAgIH0KLQotICAgIHJldHVybihIQU5UUk9fT0spOwotCi19Ci0KLS8qLS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gY2FsbGVkIGJvdGggZm9yIHJlZmVyZW5jZSBhbmQgbm9uLXJlZmVyZW5jZQotICAgICAgICAgICAgcGljdHVyZXMuICBOb24tcmVmZXJlbmNlIHBpY3R1cmVzIHNoYWxsIGhhdmUgbWFyayBwb2ludGVyIHNldCB0bwotICAgICAgICAgICAgTlVMTC4KLQotICAgICAgICBJbnB1dHM6Ci0gICAgICAgICAgICBkcGIgICAgICAgICBwb2ludGVyIHRvIHRoZSBEUEIgZGF0YSBzdHJ1Y3R1cmUKLSAgICAgICAgICAgIG1hcmsgICAgICAgIHBvaW50ZXIgdG8gcmVmZXJlbmNlIHBpY3R1cmUgbWFya2luZyBjb21tYW5kcwotICAgICAgICAgICAgaW1hZ2UgICAgICAgcG9pbnRlciB0byBjdXJyZW50IHBpY3R1cmUgdG8gYmUgcGxhY2VkIGluIHRoZSBidWZmZXIKLSAgICAgICAgICAgIGZyYW1lTnVtICAgIGZyYW1lIG51bWJlciBvZiB0aGUgY3VycmVudCBwaWN0dXJlCi0gICAgICAgICAgICBwaWNPcmRlckNudCBwaWN0dXJlIG9yZGVyIGNvdW50IGZvciB0aGUgY3VycmVudCBwaWN0dXJlCi0gICAgICAgICAgICBpc0lkciAgICAgICBmbGFnIHRvIGluZGljYXRlIGlmIHRoZSBjdXJyZW50IHBpY3R1cmUgaXMgYW4KLSAgICAgICAgICAgICAgICAgICAgICAgIElEUiBwaWN0dXJlCi0gICAgICAgICAgICBjdXJyZW50UGljSWQgICAgaWRlbnRpZmllciBmb3IgdGhlIGN1cnJlbnQgcGljdHVyZSwgZnJvbSB0aGUKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBhcHBsaWNhdGlvbiwgc3RvcmVkIGFsb25nIHdpdGggdGhlIHBpY3R1cmUKLSAgICAgICAgICAgIG51bUVyck1icyAgICAgICBudW1iZXIgb2YgY29uY2VhbGVkIG1hY3JvYmxvY2tzIGluIHRoZSBjdXJyZW50Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgc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CBhbmQgb3V0SW5kZXggaGVyZSAqLwotICAgICAgICBkcGItPm51bU91dCA9IGRwYi0+b3V0SW5kZXggPSAwOwotCi0gICAgICAgIC8qIGZsdXNoIHRoZSBidWZmZXIgKi8KLSAgICAgICAgTW1jb3A1KGRwYik7Ci0gICAgICAgIC8qIGlmIG5vT3V0cHV0T2ZQcmlvclBpY3NGbGFnIHdhcyBzZXQgLT4gdGhlIHBpY3R1cmVzIHByZWNlZGluZyB0aGUKLSAgICAgICAgICogSURSIHBpY3R1cmUgc2hhbGwgbm90IGJlIG91dHB1dCAtPiBzZXQgb3V0cHV0IGJ1ZmZlciBlbXB0eSAqLwotICAgICAgICBpZiAobWFyay0+bm9PdXRwdXRPZlByaW9yUGljc0ZsYWcgfHwgZHBiLT5ub1Jlb3JkZXJpbmcpCi0gICAgICAgIHsKLSAgICAgICAgICAgIGRwYi0+bnVtT3V0ID0gMDsKLSAgICAgICAgICAgIGRwYi0+b3V0SW5kZXggPSAwOwotICAgICAgICB9Ci0KLSAgICAgICAgaWYgKG1hcmstPmxvbmdUZXJtUmVmZXJlbmNlRmxhZykKLSAgICAgICAgewotICAgICAgICAgICAgZHBiLT5jdXJyZW50T3V0LT5zdGF0dXMgPSBMT05HX1RFUk07Ci0gICAgICAgICAgICBkcGItPm1heExvbmdUZXJtRnJhbWVJZHggPSAwOwotICAgICAgICB9Ci0gICAgICAgIGVsc2UKLSAgICAgICAgewotICAgICAgICAgICAgZHBiLT5jdXJyZW50T3V0LT5zdGF0dXMgPSBTSE9SVF9URVJNOwotICAgICAgICAgICAgZHBiLT5tYXhMb25nVGVybUZyYW1lSWR4ID0gTk9fTE9OR19URVJNX0ZSQU1FX0lORElDRVM7Ci0gICAgICAgIH0KLSAgICAgICAgZHBiLT5jdXJyZW50T3V0LT5mcmFtZU51bSAgPSAwOwotICAgICAgICBkcGItPmN1cnJlbnRPdXQtPnBpY051bSAgICA9IDA7Ci0gICAgICAgIGRwYi0+Y3VycmVudE91dC0+cGljT3JkZXJDbnQgPSAwOwotICAgICAgICBkcGItPmN1cnJlbnRPdXQtPnRvQmVEaXNwbGF5ZWQgPSB0b0JlRGlzcGxheWVkOwotICAgICAgICBkcGItPmZ1bGxuZXNzID0gMTsKLSAgICAgICAgZHBiLT5udW1SZWZGcmFtZXMgPSAxOwotICAgIH0KLSAgICAvKiByZWZlcmVuY2UgcGljdHVyZSAqLwotICAgIGVsc2UKLSAgICB7Ci0gICAgICAgIG1hcmtlZEFzTG9uZ1Rlcm0gPSBIQU5UUk9fRkFMU0U7Ci0gICAgICAgIGlmIChtYXJrLT5hZGFwdGl2ZVJlZlBpY01hcmtpbmdNb2RlRmxhZykKLSAgICAgICAgewotICAgICAgICAgICAgaSA9IDA7Ci0gICAgICAgICAgICB3aGlsZSAobWFyay0+b3BlcmF0aW9uW2ldLm1lbW9yeU1hbmFnZW1lbnRDb250cm9sT3BlcmF0aW9uKQotICAgICAgICAgICAgewotICAgICAgICAgICAgICAgIHN3aXRjaCAobWFyay0+b3BlcmF0aW9uW2ldLm1lbW9yeU1hbmFnZW1lbnRDb250cm9sT3BlcmF0aW9uKQotICAgICAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAgICAgY2FzZSAxOgotICAgICAgICAgICAgICAgICAgICAgICAgc3RhdHVzID0gTW1jb3AxKAotICAgICAgICAgICAgICAgICAgICAgICAgICBkcGIsCi0gICAgICAgICAgICAgICAgICAgICAgICAgIGZyYW1lTnVtLAotICAgICAgICAgICAgICAgICAgICAgICAgICBtYXJrLT5vcGVyYXRpb25baV0uZGlmZmVyZW5jZU9mUGljTnVtcyk7Ci0gICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKLQotICAgICAgICAgICAgICAgICAgICBjYXNlIDI6Ci0gICAgICAgICAgICAgICAgICAgICAgICBzdGF0dXMgPSBNbWNvcDIoZHBiLCBtYXJrLT5vcGVyYXRpb25baV0ubG9uZ1Rlcm1QaWNOdW0pOwotICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7Ci0KLSAgICAgICAgICAgICAgICAgICAgY2FzZSAzOgotICAgICAgICAgICAgICAgICAgICAgICAgc3RhdHVzID0gIE1tY29wMygKLSAgICAgICAgICAgICAgICAgICAgICAgICAgZHBiLAotICAgICAgICAgICAgICAgICAgICAgICAgICBmcmFtZU51bSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgbWFyay0+b3BlcmF0aW9uW2ldLmRpZmZlcmVuY2VPZlBpY051bXMsCi0gICAgICAgICAgICAgICAgICAgICAgICAgIG1hcmstPm9wZXJhdGlvbltpXS5sb25nVGVybUZyYW1lSWR4KTsKLSAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOwotCi0gICAgICAgICAgICAgICAgICAgIGNhc2UgNDoKLSAgICAgICAgICAgICAgICAgICAgICAgIHN0YXR1cyA9IE1tY29wNCgKLSAgICAgICAgICAgICAgICAgICAgICAgICAgZHBiLAotICAgICAgICAgICAgICAgICAgICAgICAgICBtYXJrLT5vcGVyYXRpb25baV0ubWF4TG9uZ1Rlcm1GcmFtZUlkeCk7Ci0gICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKLQotICAgICAgICAgICAgICAgICAgICBjYXNlIDU6Ci0gICAgICAgICAgICAgICAgICAgICAgICBzdGF0dXMgPSBNbWNvcDUoZHBiKTsKLSAgICAgICAgICAgICAgICAgICAgICAgIGRwYi0+bGFzdENvbnRhaW5zTW1jbzUgPSBIQU5UUk9fVFJVRTsKLSAgICAgICAgICAgICAgICAgICAgICAgIGZyYW1lTnVtID0gMDsKLSAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOwotCi0gICAgICAgICAgICAgICAgICAgIGNhc2UgNjoKLSAgICAgICAgICAgICAgICAgICAgICAgIHN0YXR1cyA9IE1tY29wNigKLSAgICAgICAgICAgICAgICAgICAgICAgICAgZHBiLAotICAgICAgICAgICAgICAgICAgICAgICAgICBmcmFtZU51bSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgcGljT3JkZXJDbnQsCi0gICAgICAgICAgICAgICAgICAgICAgICAgIG1hcmstPm9wZXJhdGlvbltpXS5sb25nVGVybUZyYW1lSWR4KTsKLSAgICAgICAgICAgICAgICAgICAgICAgIGlmIChzdGF0dXMgPT0gSEFOVFJPX09LKQotICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1hcmtlZEFzTG9uZ1Rlcm0gPSBIQU5UUk9fVFJVRTsKLSAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOwotCi0gICAgICAgICAgICAgICAgICAgIGRlZmF1bHQ6IC8qIGludmFsaWQgbWVtb3J5IG1hbmFnZW1lbnQgY29udHJvbCBvcGVyYXRpb24gKi8KLSAgICAgICAgICAgICAgICAgICAgICAgIHN0YXR1cyA9IEhBTlRST19OT0s7Ci0gICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgaWYgKHN0YXR1cyAhPSBIQU5UUk9fT0spCi0gICAgICAgICAgICAgICAgewotICAgICAgICAgICAgICAgICAgICBicmVhazsKLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgaSsrOwotICAgICAgICAgICAgfQotICAgICAgICB9Ci0gICAgICAgIGVsc2UKLSAgICAgICAgewotICAgICAgICAgICAgc3RhdHVzID0gU2xpZGluZ1dpbmRvd1JlZlBpY01hcmtpbmcoZHBiKTsKLSAgICAgICAgfQotICAgICAgICAvKiBpZiBjdXJyZW50IHBpY3R1cmUgd2FzIG5vdCBtYXJrZWQgYXMgbG9uZy10ZXJtIHJlZmVyZW5jZSBieQotICAgICAgICAgKiBtZW1vcnkgbWFuYWdlbWVudCBjb250cm9sIG9wZXJhdGlvbiA2IC0+IG1hcmsgY3VycmVudCBhcyBzaG9ydAotICAgICAgICAgKiB0ZXJtIGFuZCBpbnNlcnQgaXQgaW50byBkcGIgKGlmIHRoZXJlIGlzIHJvb20pICovCi0gICAgICAgIGlmICghbWFya2VkQXNMb25nVGVybSkKLSAgICAgICAgewotICAgICAgICAgICAgaWYgKGRwYi0+bnVtUmVmRnJhbWVzIDwgZHBiLT5tYXhSZWZGcmFtZXMpCi0gICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgZHBiLT5jdXJyZW50T3V0LT5mcmFtZU51bSA9IGZyYW1lTnVtOwotICAgICAgICAgICAgICAgIGRwYi0+Y3VycmVudE91dC0+cGljTnVtICAgPSAoaTMyKWZyYW1lTnVtOwotICAgICAgICAgICAgICAgIGRwYi0+Y3VycmVudE91dC0+cGljT3JkZXJDbnQgPSBwaWNPcmRlckNudDsKLSAgICAgICAgICAgICAgICBkcGItPmN1cnJlbnRPdXQtPnN0YXR1cyAgID0gU0hPUlRfVEVSTTsKLSAgICAgICAgICAgICAgICBkcGItPmN1cnJlbnRPdXQtPnRvQmVEaXNwbGF5ZWQgPSB0b0JlRGlzcGxheWVkOwotICAgICAgICAgICAgICAgIGRwYi0+ZnVsbG5lc3MrKzsKLSAgICAgICAgICAgICAgICBkcGItPm51bVJlZkZyYW1lcysrOwotICAgICAgICAgICAgfQotICAgICAgICAgICAgLyogbm8gcm9vbSAqLwotICAgICAgICAgICAgZWxzZQotICAgICAgICAgICAgewotICAgICAgICAgICAgICAgIHN0YXR1cyA9IEhBTlRST19OT0s7Ci0gICAgICAgICAgICB9Ci0gICAgICAgIH0KLSAgICB9Ci0KLSAgICBkcGItPmN1cnJlbnRPdXQtPmlzSWRyID0gaXNJZHI7Ci0gICAgZHBiLT5jdXJyZW50T3V0LT5waWNJZCA9IGN1cnJlbnRQaWNJZDsKLSAgICBkcGItPmN1cnJlbnRPdXQtPm51bUVyck1icyA9IG51bUVyck1iczsKLQotICAgIC8qIGRwYiB3YXMgaW5pdGlhbGl6ZWQgdG8gbm90IHRvIHJlb3JkZXIgdGhlIHBpY3R1cmVzIC0+IG91dHB1dCBjdXJyZW50Ci0gICAgICogcGljdHVyZSBpbW1lZGlhdGVseSAqLwotICAgIGlmIChkcGItPm5vUmVvcmRlcmluZykKLSAgICB7Ci0g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TnVtIDwgcGljTnVtIHx8IGluZGV4ID09IC0xKQotICAgICAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAgICAgaW5kZXggPSAoaTMyKWk7Ci0gICAgICAgICAgICAgICAgICAgIHBpY051bSA9IGRwYi0+YnVmZmVyW2ldLnBpY051bTsKLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgIGlmIChpbmRleCA+PSAwKQotICAgICAgICB7Ci0gICAgICAgICAgICBTRVRfVU5VU0VEKGRwYi0+YnVmZmVyW2luZGV4XSk7Ci0gICAgICAgICAgICBkcGItPm51bVJlZkZyYW1lcy0tOwotICAgICAgICAgICAgaWYgKCFkcGItPmJ1ZmZlcltpbmRleF0udG9CZURpc3BsYXllZCkKLSAgICAgICAgICAgICAgICBkcGItPmZ1bGxuZXNzLS07Ci0KLSAgICAgICAgICAgIHJldHVybihIQU5UUk9fT0spOwotICAgICAgICB9Ci0gICAgfQotCi0gICAgcmV0dXJuKEhBTlRST19OT0spOwotCi19Ci0KLS8qLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tCi0KLSAgICBGdW5jdGlvbjogaDI2NGJzZEluaXREcGIKLQotICAgICAgICBGdW5jdGlvbmFsIGRlc2NyaXB0aW9uOgotICAgICAgICAgICAgRnVuY3Rpb24gdG8gaW5pdGlhbGl6ZSBEUEIuIFJlc2VydmVzIG1lbW9yaWVzIGZvciB0aGUgYnVmZmVyLAotICAgICAgICAgICAgcmVmZXJlbmNlIHBpY3R1cmUgbGlzdCBhbmQgb3V0cHV0IGJ1ZmZlci4gZHBiU2l6ZSBpbmRpY2F0ZXMKLSAgICAgICAgICAgIHRoZSBtYXhpbXVtIERQQiBzaXplIGluZGljYXRlZCBieSB0aGUgbGV2ZWxJZGMgaW4gdGhlIHN0cmVhbS4KLSAgICAgICAgICAgIElmIG5vUmVvcmRlcmluZyBmb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ci0gICAgICAgICAgICBpZiAoSVNfU0hPUlRfVEVSTShkcGItPmJ1ZmZlcltpXSkgJiYKLSAgICAgICAgICAgICAgZHBiLT5idWZmZXJbaV0ucGljTnVtID09IHBpY051bSkKLSAgICAgICAgICAgICAgICBmb3VuZCA9IEhBTlRST19UUlVFOwotICAgICAgICAgICAgZWxzZQotICAgICAgICAgICAgICAgIGkrKzsKLSAgICAgICAgfQotICAgIH0KLSAgICBlbHNlCi0gICAgewotICAgICAgICBBU1NFUlQocGljTnVtID49IDApOwotICAgICAgICB3aGlsZSAoaSA8IGRwYi0+bWF4UmVmRnJhbWVzICYmICFmb3VuZCkKLSAgICAgICAgewotICAgICAgICAgICAgaWYgKElTX0xPTkdfVEVSTShkcGItPmJ1ZmZlcltpXSkgJiYKLSAgICAgICAgICAgICAgZHBiLT5idWZmZXJbaV0ucGljTnVtID09IHBpY051bSkKLSAgICAgICAgICAgICAgICBmb3VuZCA9IEhBTlRST19UUlVFOwotICAgICAgICAgICAgZWxzZQotICAgICAgICAgICAgICAgIGkrKzsKLSAgICAgICAgfQotICAgIH0KLQotICAgIGlmIChmb3VuZCkKLSAgICAgICAgcmV0dXJuKChpMzIpaSk7Ci0gICAgZWxzZQotICAgICAgICByZXR1cm4oLTEpOwotCi19Ci0KLS8qLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tCi0KLSAgICBGdW5jdGlvbjogU2V0UGljTnVtcwotCi0gICAgICAgIEZ1bmN0aW9uYWwgZGVzY3JpcHRpb246Ci0gICAgICAgICAgICBGdW5jdGlvbiB0byBzZXQgcGljTnVtIHZhbHVlcyBmb3Igc2hvcnQtdGVybSBwaWN0dXJlcyBpbiB0aGUKLSAgICAgICAgICAgIGJ1ZmZlci4gTnVtYmVyaW5nIG9mIHBpY3R1cmVzIGlzIGJhc2VkIG9uIGZyYW1lIG51bWJlc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BiZSBvdmVyd3JpdHRlbiBieSB0aGUgY3VycmVudCBwaWN0dXJlKSAqLwotICAgICAgICB0bXAgPSBkcGItPmJ1ZmZlcltkcGItPmRwYlNpemVdLmRhdGE7Ci0gICAgICAgIGRvCi0gICAgICAgIHsKLSAgICAgICAgICAgIFNldFBpY051bXMoZHBiLCB1blVzZWRTaG9ydFRlcm1GcmFtZU51bSk7Ci0KLSAgICAgICAgICAgIGlmIChTbGlkaW5nV2luZG93UmVmUGljTWFya2luZyhkcGIpICE9IEhBTlRST19PSykKLSAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICByZXR1cm4oSEFOVFJPX05PSyk7Ci0gICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgIC8qIG91dHB1dCBwaWN0dXJlcyBpZiBidWZmZXIgZnVsbCAqLwotICAgICAgICAgICAgd2hpbGUgKGRwYi0+ZnVsbG5lc3MgPj0gZHBiLT5kcGJTaXplKQotICAgICAgICAgICAgewotI2lmZGVmIF9BU1NFUlRfVVNFRAotICAgICAgICAgICAgICAgIEFTU0VSVCghZHBiLT5ub1Jlb3JkZXJpbmcpOwotICAgICAgICAgICAgICAgIEFTU0VSVChPdXRwdXRQaWN0dXJlKGRwYikgPT0gSEFOVFJPX09LKTsKLSNlbHNlCi0gICAgICAgICAgICAgICAgT3V0cHV0UGljdHVyZShkcGIpOwotI2VuZGlmCi0gICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgIC8qIGFkZCB0byBlbmQgb2YgbGlzdCAqLwotICAgICAgICAgICAgQVNTRVJUKCAhZHBiLT5idWZmZXJbZHBiLT5kcGJTaXplXS50b0JlRGlzcGxheWVkICYmCi0gICAgICAgICAgICAgICAgICAgICFJU19SRUZFUkVOQ0UoZHBiLT5idWZmZXJbZHBiLT5kcGJTaXplXSkgKTsKLSAgICAgICAgICAgIGRwYi0+YnVmZmVyW2RwYi0+ZHBiU2l6ZV0uc3RhdHVzID0gTk9OX0VYSVNUSU5HOwotICAgICAgICAgICAgZHB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AgKiBwb2ludGVyIHdpdGggdGhlIG9uZSBzdG9yZWQgaW4gdGhlIGJlZ2lubmluZyAqLwotICAgICAgICBpZiAoZHBiLT5udW1PdXQpCi0gICAgICAgIHsKLSAgICAgICAgICAgIHUzMiBpOwotCi0gICAgICAgICAgICBmb3IgKGkgPSAwOyBpIDwgZHBiLT5udW1PdXQ7IGkrKykKLSAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICBpZiAoZHBiLT5vdXRCdWZbaV0uZGF0YSA9PSBkcGItPmJ1ZmZlcltkcGItPmRwYlNpemVdLmRhdGEpCi0gICAgICAgICAgICAgICAgewotICAgICAgICAgICAgICAgICAgICAvKiBmaW5kIGJ1ZmZlciBwb3NpdGlvbiBjb250YWluaW5nIGRhdGEgcG9pbnRlciBzdG9yZWQgaW4KLSAgICAgICAgICAgICAgICAgICAgICogdG1wICovCi0gICAgICAgICAgICAgICAgICAgIGZvciAoaSA9IDA7IGkgPCBkcGItPmRwYlNpemU7IGkrKykKLSAgICAgICAgICAgICAgICAgICAgewotICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGRwYi0+YnVmZmVyW2ldLmRhdGEgPT0gdG1wKQotICAgICAgICAgICAgICAgICAgICAgICAgewotICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRwYi0+YnVmZmVyW2ldLmRhdGEgPQotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBkcGItPmJ1ZmZlcltkcGItPmRwYlNpemVdLmRhdGE7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgZHBiLT5idWZmZXJbZHBiLT5kcGJTaXplXS5kYXRhID0gdG1wOwotICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOwotICAgICAgICAgICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgICAgIEFTU0VSVChpIDwgZHBiLT5kcGJTaXplKTsKLSAgICAgICAgICAgICAgICAgICAgYnJlYWs7Ci0gICAgICAgICA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XRlcyBhdCB0aGUgdGltZSwgZGlzYWJsZQotICAgICAqICJhcmVhIHRvbyBzbWFsbCIgaW5mbyBtZXNzYWdlICovCi0gICAgbHVtID0gKHUzMiopaW1hZ2UtPmx1bWE7Ci0gICAgY2IgPSAodTMyKilpbWFnZS0+Y2I7Ci0gICAgY3IgPSAodTMyKilpbWFnZS0+Y3I7Ci0gICAgQVNTRVJUKCEoKHUzMilsdW0mMHgzKSk7Ci0gICAgQVNTRVJUKCEoKHUzMiljYiYweDMpKTsKLSAgICBBU1NFUlQoISgodTMyKWNyJjB4MykpOwotCi0gICAgcHRyID0gKHUzMiopZGF0YTsKLQotICAgIHdpZHRoICo9IDQ7Ci0gICAgZm9yIChpID0gMTY7IGkgOyBpLS0pCi0gICAgewotICAgICAgICB0bXAxID0gKnB0cisrOwotICAgICAgICB0bXAyID0gKnB0cisrOwotICAgICAgICAqbHVtKysgPSB0bXAxOwotICAgICAgICAqbHVtKysgPSB0bXAyOwotICAgICAgICB0bXAxID0gKnB0cisrOwotICAgICAgICB0bXAyID0gKnB0cisrOwotICAgICAgICAqbHVtKysgPSB0bXAxOwotICAgICAgICAqbHVtKysgPSB0bXAyOwotICAgICAgICBsdW0gKz0gd2lkdGgtNDsKLSAgICB9Ci0KLSAgICB3aWR0aCA+Pj0gMTsKLSAgICBmb3IgKGkgPSA4OyBpIDsgaS0tKQotICAgIHsKLSAgICAgICAgdG1wMSA9ICpwdHIrKzsKLSAgICAgICAgdG1wMiA9ICpwdHIrKzsKLSAgICAgICAgKmNiKysgPSB0bXAxOwotICAgICAgICAqY2IrKyA9IHRtcDI7Ci0gICAgICAgIGNiICs9IHdpZHRoLTI7Ci0gICAgfQotCi0gICAgZm9yIChpID0gODsgaSA7IGktLSkKLSAgICB7Ci0gICAgICAgIHRtcDEgPSAqcHRyKys7Ci0gICAgICAgIHRtcDIgPSAqcHRyKys7Ci0gICAgICAgICpjcisrID0gdG1wMTsKLSAgICAgICAgKmNyKysgPSB0bXAyOwotICAgIC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0OwotICAgIHJvdyA9IG1iTnVtIC8gcGljV2lkdGg7Ci0gICAgY29sID0gbWJOdW0gJSBwaWNXaWR0aDsKLQotICAgIC8qIE91dHB1dCBtYWNyb2Jsb2NrIHBvc2l0aW9uIGluIG91dHB1dCBwaWN0dXJlICovCi0gICAgbHVtID0gKGltYWdlLT5kYXRhICsgcm93ICogcGljV2lkdGggKiAyNTYgKyBjb2wgKiAxNik7Ci0gICAgY2IgPSAoaW1hZ2UtPmRhdGEgKyBwaWNTaXplICogMjU2ICsgcm93ICogcGljV2lkdGggKiA2NCArIGNvbCAqIDgpOwotICAgIGNyID0gKGNiICsgcGljU2l6ZSAqIDY0KTsKLQotICAgIHBpY1dpZHRoICo9IDE2OwotCi0gICAgZm9yIChibG9jayA9IDA7IGJsb2NrIDwgMTY7IGJsb2NrKyspCi0gICAgewotICAgICAgICB4ID0gaDI2NGJzZEJsb2NrWFtibG9ja107Ci0gICAgICAgIHkgPSBoMjY0YnNkQmxvY2tZW2Jsb2NrXTsKLQotICAgICAgICBwUmVzID0gcmVzaWR1YWxbYmxvY2tdOwotCi0gICAgICAgIEFTU0VSVChwUmVzKTsKLQotICAgICAgICB0bXAgPSBkYXRhICsgeSoxNiArIHg7Ci0gICAgICAgIGltYWdlQmxvY2sgPSBsdW0gKyB5KnBpY1dpZHRoICsgeDsKLQotICAgICAgICBBU1NFUlQoISgodTMyKXRtcCYweDMpKTsKLSAgICAgICAgQVNTRVJUKCEoKHUzMilpbWFnZUJsb2NrJjB4MykpOwotCi0gICAgICAgIGlmIChJU19SRVNJRFVBTF9FTVBUWShwUmVzKSkKLSAgICAgICAgewotICAgICAgICAgICAgLypsaW50IC1lODI2ICovCi0gICAgICAgICAgICBpMzIgKmluMzIgPSAoaTMyKil0bXA7Ci0gICAgICAgICAgICBpMzIgKm91dDMyID0gKGkzMiopaW1hZ2VCbG9jazsKLQotICAgICAgICAgICAgLyogUmVzaWR1YWwgaXMgemVybyA9PiBjb3B5IHByZWRpY3Rpb24gYmxvY2sgdG8gb3V0cHV0ICovCi0gICAgICAgICAgICB0bXAxID0gKmluMzI7ICBpbjMyICs9IDQ7Ci0gICAgICAgICAgICB0bXAyID0gKmluMzI7ICBpbjMyICs9IDQ7Ci0gICAgICAgICAgICAqb3V0MzIgPSB0bXAxOyBvdXQzMiArPSBwaWNXaWR0aC80OwotICAgICAgICAgICAgKm91dDMyID0gdG1wMjsgb3V0MzIgKz0gcGljV2lkdGgvNDsKLSAgICAgICAgICAgIHRtcDEgPSAqaW4zMjsgIGluMzIgKz0gNDsKLSAgICAgICAgICAgIHRtcDIgPSAqaW4zMjsKLSAgICAgICAgICAgICpvdXQzMiA9IHRtcDE7IG91dDMyICs9IHBpY1dpZHRoLzQ7Ci0gICAgICAgICAgICAqb3V0MzIgPSB0bXAyOwotICAgICAgICB9Ci0gICAgICAgIGVsc2UKLSAgICAgICAgewotCi0gICAgICAgICAgICBSQU5HRV9DSEVDS19BUlJBWShwUmVzLCAtNTEyLCA1MTEsIDE2KTsKLQotICAgICAgICAgICAgLyogQ2FsY3VsYXRlIGltYWdlID0gcHJlZGljdGlvbiArIHJlc2lkdWFsCi0gICAgICAgICAgICAgKiBQcm9jZXNzIGZvdXIgcGl4ZWxzIGluIGEgbG9vcCAqLwotICAgICAgICAgICAgZm9yIChpID0gNDsgaTsgaS0tKQotICAgICAgICAgICAgewotICAgICAgICAgICAgICAgIHRtcDEgPSB0bXBbMF07Ci0gICAgICAgICAgICAgICAgdG1wMiA9ICpwUmVzKys7Ci0gICAgICAgICAgICAgICAgdG1wMyA9IHRtcFsxXTsKLSAgICAgICAgICAgICAgICB0bXAxID0gY2xwW3RtcDEgKyB0bXAyXTsKLSAgICAgICAgICAgICAgICB0bXA0ID0gKnBSZXMrKzsKLSAgICAgICAgICAgICAgICBpbWFnZUJsb2NrWzBdID0gKHU4KXRtcDE7Ci0gICAgICAgICAgICAgICAgdG1wMyA9IGNscFt0bXAzICsgdG1wNF07Ci0gICAgICAgICAgICAgICAgdG1wMSA9IHRtcFsyXTsKLSAgICAgICAgICAgICAgICB0bXAyID0gKnBSZXMrKzsKLSAgICAgICAgICAgICAgICBpbWFnZUJsb2NrWzFdID0gKHU4KXRtcDM7Ci0gICAgICAgICAgICAgICAgdG1wMSA9IGNscFt0bXAxICsgdG1wMl07Ci0gICAgICAgICAgICAgICAgdG1wMyA9IHRtcFszXTsKLSAgICAgICAgICAgICAgICB0bXA0ID0gKnBSZXMrKzsKLSAgICAgICAgICAgICAgICBpbWFnZUJsb2NrWzJdID0gKHU4KXRtcDE7Ci0gICAgICAgICAgICAgICAgdG1wMyA9IGNscFt0bXAzICsgdG1wNF07Ci0gICAgICAgICAgICAgICAgdG1wICs9IDE2OwotICAgICAgICAgICAgICAgIGltYWdlQmxvY2tbM10gPSAodTgpdG1wMzsKLSAgICAgICAgICAgICAgICBpbWFnZUJsb2NrICs9IHBpY1dpZHRoOwotICAgICAgICAgICAgfQotICAgICAgICB9Ci0KLSAgICB9Ci0KLSAgICBwaWNXaWR0aCAvPSAyOwotCi0gICAgZm9yIChibG9jayA9IDE2OyBibG9jayA8PSAyMzsgYmxvY2srKykKLSAgICB7Ci0gICAgICAgIHggPSBoMjY0YnNkQmxvY2tYW2Jsb2NrICYgMHgzXTsKLSAgICAgICAgeSA9IGgyNjRic2RCbG9ja1lbYmxvY2sgJiAweDNdOwotCi0gICAgICAgIHBSZXMgPSByZXNpZHVhbFtibG9ja107Ci0KLSAgICAgICAgQVNTRVJUKHBSZXMpOwotCi0gICAgICAgIHRtcCA9IGRhdGEgKyAyNTY7Ci0gICAgICAgIGltYWdlQmxvY2sgPSBjYjsKLQotICAgICAgICBpZiAoYmxvY2sgPj0gMjApCi0gICAgICAgIHsKLSAgICAgICAgICAgIGltYWdlQmxvY2sgPSBjcjsKLSAgICAgICAgICAgIHRtcCArPSA2NDsKLSAgICAgICAgfQotCi0gICAgICAgIHRtcCArPSB5KjggKyB4OwotICAgICAgICBpbWFnZUJsb2NrICs9IHkqcGljV2lkdGggKyB4OwotCi0gICAgICAgIEFTU0VSVCghKCh1MzIpdG1wJjB4MykpOwotICAgICAgICBBU1NFUlQoISgodTMyKWltYWdlQmxvY2smMHgzKSk7Ci0KLSAgICAgICAgaWYgKElTX1JFU0lEVUFMX0VNUFRZKHBSZXMpKQotICAgICAgICB7Ci0gICAgICAgICAgICAvKmxpbnQgLWU4MjYgKi8KLSAgICAgICAgICAgIGkzMiAqaW4zMiA9IChpMzIqKXRtcDsKLSAgICAgICAgICAgIGkzMiAqb3V0MzIgPSAoaTMyKilpbWFnZUJsb2NrOwotCi0gICAgICAgICAgICAvKiBSZXNpZHVhbCBpcyB6ZXJvID0+IGNvcHkgcHJlZGljdGlvbiBibG9jayB0byBvdXRwdXQgKi8KLSAgICAgICAgICAgIHRtcDEgPSAqaW4zMjsgIGluMzIgKz0gMjsKLSAgICAgICAgICAgIHRtcDIgPSAqaW4zMjsgIGluMzIgKz0gMjsKLSAgICAgICAgICAgICpvdXQzMiA9IHRtcDE7IG91dDMyICs9IHBpY1dpZHRoLzQ7Ci0gICAgICAgICAgICAqb3V0MzIgPSB0bXAyOyBvdXQzMiArPSBwaWNXaWR0aC80OwotICAgICAgICAgICAgdG1wMSA9ICppbjMyOyAgaW4zMiArPSAyOwotICAgICAgICAgICAgdG1wMiA9ICppbjMyOwotICAgICAgICAgICAgKm91dDMyID0gdG1wMTsgb3V0MzIgKz0gcGljV2lkdGgvNDsKLSAgICAgICAgICAgICpvdXQzMiA9IHRtcDI7Ci0gICAgICAgIH0KLSAgICAgICAgZWxzZQotICAgICAgICB7Ci0KLSAgICAgICAgICAgIFJBTkdFX0NIRUNLX0FSUkFZKHBSZXMsIC01MTIsIDUxMSwgMTYpOwotCi0gICAgICAgICAgICBmb3IgKGkgPSA0OyBpOyBpLS0pCi0gICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgdG1wMSA9IHRtcFswXTsKLSAgICAgICAgICAgICAgICB0bXAyID0gKnBSZXMrKzsKLSAgICAgICAgICAgICAgICB0bXAzID0gdG1wWzFdOwotICAgICAgICAgICAgICAgIHRtcDEgPSBjbHBbdG1wMSArIHRtcDJdOwotICAgICAgICAgICAgICAgIHRtcDQgPSAqcFJlcysrOwotICAgICAgICAgICAgICAgIGltYWdlQmxvY2tbMF0gPSAodTgpdG1wMTsKLSAgICAgICAgICAgICAgICB0bXAzID0gY2xwW3RtcDMgKyB0bXA0XTsKLSAgICAgICAgICAgICAgICB0bXAxID0gdG1wWzJdOwotICAgICAgICAgICAgICAgIHRtcDIgPSAqcFJlcysrOwotICAgICAgICAgICAgICAgIGltYWdlQmxvY2tbMV0gPSAodTgpdG1wMzsKLSAgICAgICAgICAgICAgICB0bXAxID0gY2xwW3RtcDEgKyB0bXAyXTsKLSAgICAgICAgICAgICAgICB0bXAzID0gdG1wWzNdOwotICAgICAgICAgICAgICAgIHRtcDQgPSAqcFJlcysrOwotICAgICAgICAgICAgICAgIGltYWdlQmxvY2tbMl0gPSAodTgpdG1wMTsKLSAgICAgICAgICAgICAgICB0bXAzID0gY2xwW3RtcDMgKyB0bXA0XTsKLSAgICAgICAgICAgICAgICB0bXAgKz0gODsKLSAgICAgICAgICAgICAgICBpbWFnZUJsb2NrWzNdID0gKHU4KXRtcDM7Ci0gICAgICAgICAgICAgICAgaW1hZ2VCbG9jayArPSBwaWNXaWR0aDsKLSAgICAgICAgICAgIH0KLSAgICAgICAgfQotICAgIH0KLQotfQotI2VuZGlmIC8qIEgyNjRERUNfT01YREwgKi8KLQpkaWZmIC0tZ2l0IGEvbWVkaWEvbGlic3RhZ2VmcmlnaHQvY29kZWNzL29uMi9oMjY0ZGVjL3NvdXJjZS9oMjY0YnNkX2ltYWdlLmggYi9tZWRpYS9saWJzdGFnZWZyaWdodC9jb2RlY3Mvb24yL2gyNjRkZWMvc291cmNlL2gyNjRic2RfaW1hZ2UuaApkZWxldGVkIGZpbGUgbW9kZSAxMDA3NTUKaW5kZXggZWQ3YzE4Yy4uMDAwMDAwMAotLS0gYS9tZWRpYS9saWJ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BjdXJySW1hZ2UtPndpZHRoKSA8PCAxNjsKLSAgICBjb2xBbmRSb3cgPDw9IDQ7Ci0KLSAgICByZWZJbWFnZS53aWR0aCA9IGN1cnJJbWFnZS0+d2lkdGg7Ci0gICAgcmVmSW1hZ2UuaGVpZ2h0ID0gY3VyckltYWdlLT5oZWlnaHQ7Ci0KLSAgICBzd2l0Y2ggKHBNYi0+bWJUeXBlKQotICAgIHsKLSAgICAgICAgY2FzZSBQX1NraXA6Ci0gICAgICAgIGNhc2UgUF9MMF8xNngxNjoKLSAgICAgICAgICAgIGlmIChNdlByZWRpY3Rpb24xNngxNihwTWIsICZwTWJMYXllci0+bWJQcmVkLCBkcGIpICE9IEhBTlRST19PSykKLSAgICAgICAgICAgICAgICByZXR1cm4oSEFOVFJPX05PSyk7Ci0gICAgICAgICAgICByZWZJbWFnZS5kYXRhID0gcE1iLT5yZWZBZGRyWzBdOwotICAgICAgICAgICAgdG1wID0gKDA8PDI0KSArICgwPDwxNikgKyAoMTY8PDgpICsgMTY7Ci0gICAgICAgICAgICBoMjY0YnNkUHJlZGljdFNhbXBsZXMoZGF0YSwgcE1iLT5tdiwgJnJlZkltYWdlLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY29sQW5kUm93LCB0bXAsIHBGaWxsKTsKLSAgICAgICAgICAgIGJyZWFrOwotCi0gICAgICAgIGNhc2UgUF9MMF9MMF8xNng4OgotICAgICAgICAgICAgaWYgKCBNdlByZWRpY3Rpb24xNng4KHBNYiwgJnBNYkxheWVyLT5tYlByZWQsIGRwYikgIT0gSEFOVFJPX09LKQotICAgICAgICAgICAgICAgIHJldHVybihIQU5UUk9fTk9LKTsKLSAgICAgICAgICAgIHJlZkltYWdlLmRhdGEgPSBwTWItPnJlZkFkZHJbMF07Ci0gICAgICAgICAgICB0bXAgPSAoMDw8MjQpICsgKDA8PDE2KSArICgxNjw8OCkgKyA4OwotICAgICAgICAgICAgaDI2NGJzZFByZWRpY3RTYW1wbGVzKGRhdGEsIHBNYi0+bXYsICZyZWZJbWFnZSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbEFuZFJvdywgdG1wLCBwRmlsbCk7Ci0KLSAgICAgICAgICAgIHJlZkltYWdlLmRhdGEgPSBwTWItPnJlZkFkZHJbMl07Ci0gICAgICAgICAgICB0bXAgPSAoMDw8MjQpICsgKDg8PDE2KSArICgxNjw8OCkgKyA4OwotICAgICAgICAgICAgaDI2NGJzZFByZWRpY3RTYW1wbGVzKGRhdGEsIHBNYi0+bXYrOCwgJnJlZkltYWdlLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY29sQW5kUm93LCB0bXAsIHBGaWxsKTsKLSAgICAgICAgICAgIGJyZWFrOwotCi0gICAgICAgIGNhc2UgUF9MMF9MMF84eDE2OgotICAgICAgICAgICAgaWYgKCBNdlByZWRpY3Rpb244eDE2KHBNYiwgJnBNYkxheWVyLT5tYlByZWQsIGRwYikgIT0gSEFOVFJPX09LKQotICAgICAgICAgICAgICAgIHJldHVybihIQU5UUk9fTk9LKTsKLSAgICAgICAgICAgIHJlZkltYWdlLmRhdGEgPSBwTWItPnJlZkFkZHJbMF07Ci0gICAgICAgICAgICB0bXAgPSAoMDw8MjQpICsgKDA8PDE2KSArICg4PDw4KSArIDE2OwotICAgICAgICAgICAgaDI2NGJzZFByZWRpY3RTYW1wbGVzKGRhdGEsIHBNYi0+bXYsICZyZWZJbWFnZSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbEFuZFJvdywgdG1wLCBwRmlsbCk7Ci0gICAgICAgICAgICByZWZJbWFnZS5kYXRhID0gcE1iLT5yZWZBZGRyWzFdOwotICAgICAgICAgICAgdG1wID0gKDg8PDI0KSArICgwPDwxNikgKyAoODw8OCkgKyAxNjsKLSAgICAgICAgICAgIGgyNjRic2RQcmVkaWN0U2FtcGxlcyhkYXRhLCBwTWItPm12KzQsICZyZWZJbWFnZSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbEFuZFJvdywgdG1wLCBwRmlsbCk7Ci0gICAgICAgICAgICBicmVhazsKLQotICAgICAgICBkZWZhdWx0OiAvKiBQXzh4OCBhbmQgUF84eDhyZWYwICovCi0gICAgICAgICAgICBpZiAoIE12UHJlZGljdGlvbjh4OChwTWIsICZwTWJMYXllci0+c3ViTWJQcmVkLCBkcGIpICE9IEhBTlRST19PSykKLSAgICAgICAgICAgICAgICByZXR1cm4oSEFOVFJPX05PSyk7Ci0gICAgICAgICAgICBmb3IgKGkgPSAwOyBpIDwgNDsgaSsrKQotICAgICAgICAgICAgewotICAgICAgICAgICAgICAgIHJlZkltYWdlLmRhdGEgPSBwTWItPnJlZkFkZHJbaV07Ci0gICAgICAgICAgICAgICAgc3ViUGFydE1vZGUgPQotICAgICAgICAgICAgICAgICAgICBoMjY0YnNkU3ViTWJQYXJ0TW9kZShwTWJMYXllci0+c3ViTWJQcmVkLnN1Yk1iVHlwZVtpXSk7Ci0gICAgICAgICAgICAgICAgeCA9IGkgJiAweDEgPyA4IDogMDsKLSAgICAgICAgICAgICAgICB5ID0gaSA8IDIgPyAwIDogODsKLSAgICAgICAgICAgICAgICBzd2l0Y2ggKHN1YlBhcnRNb2RlKQotICAgICAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAgICAgY2FzZSBNQl9TUF84eDg6Ci0gICAgICAgICAgICAgICAgICAgICAgICB0bXAgPSAoeDw8MjQpICsgKHk8PDE2KSArICg4PDw4KSArIDg7Ci0gICAgICAgICAgICAgICAgICAgICAgICBoMjY0YnNkUHJlZGljdFNhbXBsZXMoZGF0YSwgcE1iLT5tdis0KmksICZyZWZJbWFnZSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb2xBbmRSb3csIHRtcCwgcEZpbGwpOwotICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7Ci0KLSAgICAgICAgICAgICAgICAgICAgY2FzZSBNQl9TUF84eDQ6Ci0gICAgICAgICAgICAgICAgICAgICAgICB0bXAgPSAoeDw8MjQpICsgKHk8PDE2KSArICg4PDw4KSArIDQ7Ci0gICAgICAgICAgICAgICAgICAgICAgICBoMjY0YnNkUHJlZGljdFNhbXBsZXMoZGF0YSwgcE1iLT5tdis0KmksICZyZWZJbWFnZSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb2xBbmRSb3csIHRtcCwgcEZpbGwpOwotICAgICAgICAgICAgICAgICAgICAgICAgdG1wID0gKHg8PDI0KSArICgoeSs0KTw8MTYpICsgKDg8PDgpICsgNDsKLSAgICAgICAgICAgICAgICAgICAgICAgIGgyNjRic2RQcmVkaWN0U2FtcGxlcyhkYXRhLCBwTWItPm12KzQqaSsyLCAmcmVmSW1hZ2UsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY29sQW5kUm93LCB0bXAsIHBGaWxsKTsKLSAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOwotCi0gICAgICAgICAgICAgICAgICAgIGNhc2UgTUJfU1BfNHg4OgotICAgICAgICAgICAgICAgICAgICAgICAgdG1wID0gKHg8PDI0KSArICh5PDwxNikgKyAoNDw8OCkgKyA4OwotICAgICAgICAgICAgICAgICAgICAgICAgaDI2NGJzZFByZWRpY3RTYW1wbGVzKGRhdGEsIHBNYi0+bXYrNCppLCAmcmVmSW1hZ2UsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY29sQW5kUm93LCB0bXAsIHBGaWxsKTsKLSAgICAgICAgICAgICAgICAgICAgICAgIHRtcCA9ICgoeCs0KTw8MjQpICsgKHk8PDE2KSArICg0PDw4KSArIDg7Ci0gICAgICAgICAgICAgICAgICAgICAgICBoMjY0YnNkUHJlZGljdFNhbXBsZXMoZGF0YSwgcE1iLT5tdis0KmkrMSwgJnJlZkltYWdlLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbEFuZFJvdywgdG1wLCBwRmlsbCk7Ci0gICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKLQotICAgICAgICAgICAgICAgICAgICBkZWZhdWx0OgotICAgICAgICAgICAgICAgICAgICAgICAgdG1wID0gKHg8PDI0KSArICh5PDwxNikgKyAoNDw8OCkgKyA0OwotICAgICAgICAgICAgICAgICAgICAgICAgaDI2NGJzZFByZWRpY3RTYW1wbGVzKGRhdGEsIHBNYi0+bXYrNCppLCAmcmVmSW1hZ2UsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY29sQW5kUm93LCB0bXAsIHBGaWxsKTsKLSAgICAgICAgICAgICAgICAgICAgICAgIHRtcCA9ICgoeCs0KTw8MjQpICsgKHk8PDE2KSArICg0PDw4KSArIDQ7Ci0gICAgICAgICAgICAgICAgICAgICAgICBoMjY0YnNkUHJlZGljdFNhbXBsZXMoZGF0YSwgcE1iLT5tdis0KmkrMSwgJnJlZkltYWdlLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbEFuZFJvdywgdG1wLCBwRmlsbCk7Ci0gICAgICAgICAgICAgICAgICAgICAgICB0bXAgPSAoeDw8MjQpICsgKCh5KzQpPDwxNikgKyAoNDw8OCkgKyA0OwotICAgICAgICAgICAgICAgICAgICAgICAgaDI2NGJzZFByZWRpY3RTYW1wbGVzKGRhdGEsIHBNYi0+bXYrNCppKzIsICZyZWZJbWFnZSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb2xBbmRSb3csIHRtcCwgcEZpbGwpOwotICAgICAgICAgICAgICAgICAgICAgICAgdG1wID0gKCh4KzQpPDwyNCkgKyAoKHkrNCk8PDE2KSArICg0PDw4KSArIDQ7Ci0gICAgICAgICAgICAgICAgICAgICA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cGxlcyhkYXRhLCBwTWItPm12LCAmcmVmSW1hZ2UsIGNvbCwgcm93LCAwLCAwLAotICAgICAgICAgICAgICAgIDE2LCAxNik7Ci0gICAgICAgICAgICBicmVhazsKLQotICAgICAgICBjYXNlIFBfTDBfTDBfMTZ4ODoKLSAgICAgICAgICAgIGlmICggTXZQcmVkaWN0aW9uMTZ4OChwTWIsICZwTWJMYXllci0+bWJQcmVkLCBkcGIpICE9IEhBTlRST19PSykKLSAgICAgICAgICAgICAgICByZXR1cm4oSEFOVFJPX05PSyk7Ci0gICAgICAgICAgICByZWZJbWFnZS5kYXRhID0gcE1iLT5yZWZBZGRyWzBdOwotICAgICAgICAgICAgaDI2NGJzZFByZWRpY3RTYW1wbGVzKGRhdGEsIHBNYi0+bXYsICZyZWZJbWFnZSwgY29sLCByb3csIDAsIDAsCi0gICAgICAgICAgICAgICAgMTYsIDgpOwotICAgICAgICAgICAgcmVmSW1hZ2UuZGF0YSA9IHBNYi0+cmVmQWRkclsyXTsKLSAgICAgICAgICAgIGgyNjRic2RQcmVkaWN0U2FtcGxlcyhkYXRhLCBwTWItPm12KzgsICZyZWZJbWFnZSwgY29sLCByb3csIDAsIDgsCi0gICAgICAgICAgICAgICAgMTYsIDgpOwotICAgICAgICAgICAgYnJlYWs7Ci0KLSAgICAgICAgY2FzZSBQX0wwX0wwXzh4MTY6Ci0gICAgICAgICAgICBpZiAoIE12UHJlZGljdGlvbjh4MTYocE1iLCAmcE1iTGF5ZXItPm1iUHJlZCwgZHBiKSAhPSBIQU5UUk9fT0spCi0gICAgICAgICAgICAgICAgcmV0dXJuKEhBTlRST19OT0spOwotICAgICAgICAgICAgcmVmSW1hZ2UuZGF0YSA9IHBNYi0+cmVmQWRkclswXTsKLSAgICAgICAgICAgIGgyNjRic2RQcmVkaWN0U2FtcGxlcyhkYXRhLCBwTWItPm12LCAmcmVmSW1hZ2UsIGNvbCwgcm93LCAwLCAwLAotICAgICAgICAgICAgICAgIDgsIDE2KTsKLSAgICAgICAgICAgIHJlZkltYWdlLmRhdGEgPSBwTWItPnJlZkFkZHJbMV07Ci0gICAgICAgICAgICBoMjY0YnNkUHJlZGljdFNhbXBsZXMoZGF0YSwgcE1iLT5tdis0LCAmcmVmSW1hZ2UsIGNvbCwgcm93LCA4LCAwLAotICAgICAgICAgICAgICAgIDgsIDE2KTsKLSAgICAgICAgICAgIGJyZWFrOwotCi0gICAgICAgIGRlZmF1bHQ6IC8qIFBfOHg4IGFuZCBQXzh4OHJlZjAgKi8KLSAgICAgICAgICAgIGlmICggTXZQcmVkaWN0aW9uOHg4KHBNYiwgJnBNYkxheWVyLT5zdWJNYlByZWQsIGRwYikgIT0gSEFOVFJPX09LKQotICAgICAgICAgICAgICAgIHJldHVybihIQU5UUk9fTk9LKTsKLSAgICAgICAgICAgIGZvciAoaSA9IDA7IGkgPCA0OyBpKyspCi0gICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgcmVmSW1hZ2UuZGF0YSA9IHBNYi0+cmVmQWRkcltpXTsKLSAgICAgICAgICAgICAgICBzdWJQYXJ0TW9kZSA9Ci0gICAgICAgICAgICAgICAgICAgIGgyNjRic2RTdWJNYlBhcnRNb2RlKHBNYkxheWVyLT5zdWJNYlByZWQuc3ViTWJUeXBlW2ldKTsKLSAgICAgICAgICAgICAgICB4ID0gaSAmIDB4MSA/IDggOiAwOwotICAgICAgICAgICAgICAgIHkgPSBpIDwgMiA/IDAgOiA4OwotICAgICAgICAgICAgICAgIHN3aXRjaCAoc3ViUGFydE1vZGUpCi0gICAgICAgICAgICAgICAgewotICAgICAgICAgICAgICAgICAgICBjYXNlIE1CX1NQXzh4ODoKLSAgICAgICAgICAgICAgICAgICAgICAgIGgyNjRic2RQcmVkaWN0U2FtcGxlcyhkYXRhLCBwTWItPm12KzQqaSwgJnJlZkltYWdlLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbCwgcm93LCB4LCB5LCA4LCA4KTsKLSAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOwotCi0gICAgICAgICAgICAgICAgICAgIGNhc2UgTUJfU1BfOHg0OgotICAgICAgICAgICAgICAgICAgICAgICAgaDI2NGJzZFByZWRpY3RTYW1wbGVzKGRhdGEsIHBNYi0+bXYrNCppLCAmcmVmSW1hZ2UsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgY29sLCByb3csIHgsIHksIDgsIDQpOwotICAgICAgICAgICAgICAgICAgICAgICAgaDI2NGJzZFByZWRpY3RTYW1wbGVzKGRhdGEsIHBNYi0+bXYrNCppKzIsICZyZWZJbWFnZSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb2wsIHJvdywgeCwgeSs0LCA4LCA0KTsKLSAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOwotCi0gICAgICAgICAgICAgICAgICAgIGNhc2UgTUJfU1BfNHg4OgotICAgICAgICAgICAgICAgICAgICAgICAgaDI2NGJzZFByZWRpY3RTYW1wbGVzKGRhdGEsIHBNYi0+bXYrNCppLCAmcmVmSW1hZ2UsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgY29sLCByb3csIHgsIHksIDQsIDgpOwotICAgICAgICAgICAgICAgICAgICAgICAgaDI2NGJzZFByZWRpY3RTYW1wbGVzKGRhdGEsIHBNYi0+bXYrNCppKzEsICZyZWZJbWFnZSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb2wsIHJvdywgeCs0LCB5LCA0LCA4KTsKLSAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOwotCi0gICAgICAgICAgICAgICAgICAgIGRlZmF1bHQ6Ci0gICAgICAgICAgICAgICAgICAgICAgICBoMjY0YnNkUHJlZGljdFNhbXBsZXMoZGF0YSwgcE1iLT5tdis0KmksICZyZWZJbWFnZSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb2wsIHJvdywgeCwgeSwgNCwgNCk7Ci0gICAgICAgICAgICAgICAgICAgICAgICBoMjY0YnNkUHJlZGljdFNhbXBsZXMoZGF0YSwgcE1iLT5tdis0KmkrMSwgJnJlZkltYWdlLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbCwgcm93LCB4KzQsIHksIDQsIDQpOwotICAgICAgICAgICAgICAgICAgICAgICAgaDI2NGJzZFByZWRpY3RTYW1wbGVzKGRhdGEsIHBNYi0+bXYrNCppKzIsICZyZWZJbWFnZSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb2wsIHJvdywgeCwgeSs0LCA0LCA0KTsKLSAgICAgICAgICAgICAgICAgICAgICAgIGgyNjRic2RQcmVkaWN0U2FtcGxlcyhkYXRhLCBwTWItPm12KzQqaSszLCAmcmVmSW1hZ2UsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgY29sLCByb3csIHgrNCwgeSs0LCA0LCA0KTsKLSAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOwotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgIH0KLSAgICAgICAgICAgIGJyZWFrOwotICAgIH0KLQotICAgIC8qIGlmIGRlY29kZWQgZmxhZyA+IDEgLT4gbWIgaGFzIGFscmVhZHkgYmVlbiBzdWNjZXNzZnVsbHkgZGVjb2RlZCBhbmQKLSAgICAgKiB3cml0dGVuIHRvIG91dHB1dCAtPiBkbyBub3Qgd3JpdGUgYWdhaW4gKi8KLSAgICBpZiAocE1iLT5kZWNvZGVkID4gMSkKLSAgICAgICAgcmV0dXJuIEhBTlRST19PSzsKLQotICAgIGlmIChwTWItPm1iVHlwZSAhPSBQX1NraXApCi0gICAgewotICAgICAgICBoMjY0YnNkV3JpdGVPdXRwdXRCbG9ja3MoY3VyckltYWdlLCBtYk51bSwgZGF0YSwKLSAgICAgICAgICAgIHBNYkxheWVyLT5yZXNpZHVhbC5sZXZlbCk7Ci0gICAgfQotICAgIGVsc2UKLSAgICB7Ci0gICAgICAgIGgyNjRic2RXcml0ZU1hY3JvYmxvY2soY3VyckltYWdlLCBkYXRhKTsKLSAgICB9Ci0KLSAgICByZXR1cm4oS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5cGVzKSAqLwotICAgIHRtcE12MSA9ICh1MzIqKSgmYVswXS5tdik7IC8qIHdlIHRlc3QganVzdCB0aGF0IGJvdGggTVZzIGFyZSB6ZXJvICovCi0gICAgLypsaW50IC0tZSg3NDApICovCi0gICAgdG1wTXYyID0gKHUzMiopKCZhWzFdLm12KTsgLyogaS5lLiBhWzBdLm12LmhvciA9PSAwICYmIGFbMF0ubXYudmVyID09IDAgKi8KLSAgICBpZiAocE1iLT5tYlR5cGUgPT0gUF9Ta2lwICYmCi0gICAgICAgICghYVswXS5hdmFpbGFibGUgfHwgIWFbMV0uYXZhaWxhYmxlIHx8Ci0gICAgICAgICAoIGFbMF0ucmVmSW5kZXggPT0gMCAmJiAoKHUzMikoKnRtcE12MSkgPT0gMCkgKSB8fAotICAgICAgICAgKCBhWzFdLnJlZkluZGV4ID09IDAgJiYgKCh1MzIpKCp0bXBNdjIpID09IDApICkpKQotICAgIHsKLSAgICAgICAgICAgIG12LmhvciA9IG12LnZlciA9IDA7Ci0gICAgfQotICAgIGVsc2UKLSAgICB7Ci0gICAgICAgIG12ID0gbWJQcmVkLT5tdmRMMFswXTsKLSAgICAgICAgR2V0SW50ZXJOZWlnaGJvdXIocE1iLT5zbGljZUlkLCBwTWItPm1iQywgYSsyLCAxMCk7Ci0gICAgICAgIGlmICghYVsyXS5hdmFpbGFibGUpCi0gICAgICAgIHsKLSAgICAgICAgICAgIEdldEludGVyTmVpZ2hib3VyKHBNYi0+c2xpY2VJZCwgcE1iLT5tYkQsIGErMiwgMTUpOwotICAgICAgICB9Ci0KLSAgICAgICAgR2V0UHJlZGljdGlvbk12KCZtdlByZWQsIGEsIHJlZkluZGV4KTsKLQotICAgICAgICBtdi5ob3IgKz0gbXZQcmVkLmhvcjsKLSAgICAgICAgbXYudmVyICs9IG12UHJlZC52ZXI7Ci0KLSAgICAgICAgLyogaG9yaXpvbnRhbCBtb3Rpb24gdmVjdG9yIHJhbmdlIFstMjA0OCwgMjA0Ny43NV0gKi8KLSA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QotewotCi0vKiBWYXJpYWJsZXMgKi8KLQotICAgIG12X3QgbXY7Ci0gICAgbXZfdCBtdlByZWQ7Ci0gICAgaW50ZXJOZWlnaGJvdXJfdCBhWzNdOyAvKiBBLCBCLCBDICovCi0gICAgdTMyIHJlZkluZGV4OwotICAgIHU4ICp0bXA7Ci0KLS8qIENvZGUgKi8KLQotICAgIG12ID0gbWJQcmVkLT5tdmRMMFswXTsKLSAgICByZWZJbmRleCA9IG1iUHJlZC0+cmVmSWR4TDBbMF07Ci0KLSAgICBHZXRJbnRlck5laWdoYm91cihwTWItPnNsaWNlSWQsIHBNYi0+bWJBLCBhLCA1KTsKLQotICAgIGlmIChhWzBdLnJlZkluZGV4ID09IHJlZkluZGV4KQotICAgICAgICBtdlByZWQgPSBhWzBdLm12OwotICAgIGVsc2UKLSAgICB7Ci0gICAgICAgIEdldEludGVyTmVpZ2hib3VyKHBNYi0+c2xpY2VJZCwgcE1iLT5tYkIsIGErMSwgMTApOwotICAgICAgICBHZXRJbnRlck5laWdoYm91cihwTWItPnNsaWNlSWQsIHBNYi0+bWJCLCBhKzIsIDE0KTsKLSAgICAgICAgaWYgKCFhWzJdLmF2YWlsYWJsZSkKLSAgICAgICAgewotICAgICAgICAgICAgR2V0SW50ZXJOZWlnaGJvdXIocE1iLT5zbGljZUlkLCBwTWItPm1iRCwgYSsyLCAxNSk7Ci0gICAgICAgIH0KLQotICAgICAgICBHZXRQcmVkaWN0aW9uTXYoJm12UHJlZCwgYSwgcmVmSW5kZXgpOwotCi0gICAgfQotICAgIG12LmhvciArPSBtdlByZWQuaG9yOwotICAgIG12LnZlciArPSBtdlByZWQudmVyOwotCi0gICAgLyogaG9yaXpvbnRhbCBtb3Rpb24gdmVjdG9yIHJhbmdlIFstMjA0OCwgMjA0Ny43NV0gKi8KLSAgICBpZiAoKHUzMikoaTMyKShtdi5ob3IrODE5MikgPj0gKDE2Mzg0KSkKLSAgICAgICAgcmV0dXJuKEhBTlRST19OT0spOwotCi0gICAgL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gYVswXS5yZWZJbmRleCA9IHBNYi0+cmVmUGljWzBdOwotICAgICAgICBhWzBdLm12ID0gcE1iLT5tdlswXTsKLQotICAgICAgICBHZXRJbnRlck5laWdoYm91cihwTWItPnNsaWNlSWQsIHBNYi0+bWJCLCBhKzEsIDE0KTsKLQotICAgICAgICBHZXRQcmVkaWN0aW9uTXYoJm12UHJlZCwgYSwgcmVmSW5kZXgpOwotCi0gICAgfQotICAgIG12LmhvciArPSBtdlByZWQuaG9yOwotICAgIG12LnZlciArPSBtdlByZWQudmVyOwotCi0gICAgLyogaG9yaXpvbnRhbCBtb3Rpb24gdmVjdG9yIHJhbmdlIFstMjA0OCwgMjA0Ny43NV0gKi8KLSAgICBpZiAoKHUzMikoaTMyKShtdi5ob3IrODE5MikgPj0gKDE2Mzg0KSkKLSAgICAgICAgcmV0dXJuKEhBTlRST19OT0spOwotCi0gICAgLyogdmVydGljYWwgbW90aW9uIHZlY3RvciByYW5nZSBbLTUxMiwgNTExLjc1XSAoc21hbGxlciBmb3IgbG93IGxldmVscykgKi8KLSAgICBpZiAoKHUzMikoaTMyKShtdi52ZXIrMjA0OCkgPj0gKDQwOTYpKQotICAgICAgICByZXR1cm4oSEFOVFJPX05PSyk7Ci0KLSAgICB0bXAgPSBoMjY0YnNkR2V0UmVmUGljRGF0YShkcGIsIHJlZkluZGV4KTsKLSAgICBpZiAodG1wID09IE5VTEwpCi0gICAgICAgIHJldHVybihIQU5UUk9fTk9LKTsKLQotICAgIHBNYi0+bXZbNF0gPSBwTWItPm12WzVdID0gcE1iLT5tdls2XSA9IHBNYi0+bXZbN10gPQotICAgIHBNYi0+bXZbMTJdID0gcE1iLT5tdlsxM10gPSBwTWItPm12WzE0XSA9IHBNYi0+bXZbMTVdID0gbXY7Ci0gICAgcE1iLT5yZWZQaWNbMV0gPSByZWZJbmRleDsKLSAgICBwTWItPnJlZlBpY1szXSA9IHJlZkluZGV4OwotICAgIHBNYi0+cmVmQWRkclsxXSA9IHRtcDsKLSAgIC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dXJNYihwTWIsIG4tPm1iKTsKLSAgICAgICAgR2V0SW50ZXJOZWlnaGJvdXIocE1iLT5zbGljZUlkLCBuTWIsIGErMiwgbi0+aW5kZXgpOwotICAgIH0KLQotICAgIEdldFByZWRpY3Rpb25NdigmbXZQcmVkLCBhLCByZWZJbmRleCk7Ci0KLSAgICBtdi5ob3IgKz0gbXZQcmVkLmhvcjsKLSAgICBtdi52ZXIgKz0gbXZQcmVkLnZlcjsKLQotICAgIC8qIGhvcml6b250YWwgbW90aW9uIHZlY3RvciByYW5nZSBbLTIwNDgsIDIwNDcuNzVdICovCi0gICAgaWYgKCgodTMyKShpMzIpKG12Lmhvcis4MTkyKSA+PSAoMTYzODQpKSkKLSAgICAgICAgcmV0dXJuKEhBTlRST19OT0spOwotCi0gICAgLyogdmVydGljYWwgbW90aW9uIHZlY3RvciByYW5nZSBbLTUxMiwgNTExLjc1XSAoc21hbGxlciBmb3IgbG93IGxldmVscykgKi8KLSAgICBpZiAoKCh1MzIpKGkzMikobXYudmVyKzIwNDgpID49ICg0MDk2KSkpCi0gICAgICAgIHJldHVybihIQU5UUk9fTk9LKTsKLQotICAgIHN3aXRjaCAoc3ViTWJQYXJ0TW9kZSkKLSAgICB7Ci0gICAgICAgIGNhc2UgTUJfU1BfOHg4OgotICAgICAgICAgICAgcE1iLT5tdls0Km1iUGFydElkeF0gPSBtdjsKLSAgICAgICAgICAgIHBNYi0+bXZbNCptYlBhcnRJZHggKyAxXSA9IG12OwotICAgICAgICAgICAgcE1iLT5tdls0Km1iUGFydElkeCArIDJdID0gbXY7Ci0gICAgICAgICAgICBwTWItPm12WzQqbWJQYXJ0SWR4ICsgM10gPSBtdjsKLSAgICAgICAgICAgIGJyZWFrOwotCi0gICAgICAgIGNhc2UgTUJfU1BfOHg0OgotICAgICAgICAgICAgcE1iLT5tdls0Km1iUGFydElkeCArIDIqc3ViTWJQYXJ0SWR4XSA9IG12OwotICAgICAgICAgICAgcE1iLT5tdls0Km1iUGFydElkeCArID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gICAgICAgICAgICAgIGRhdGEsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoaTMyKXdpZHRoLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMTYsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoT01YVkNNNFAxMEludHJhMTZ4MTZQcmVkTW9kZSkKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGgyNjRic2RQcmVkTW9kZUludHJhMTZ4MTYocE1iLT5tYlR5cGUpLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKGkzMikoYXZhaWxhYmxlQiArIChhdmFpbGFibGVBPDwxKSArCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKGF2YWlsYWJsZUQ8PDUpKSApOwotICAgIGlmIChvbXhSZXMgIT0gT01YX1N0c19Ob0VycikKLSAgICAgICAgcmV0dXJuIEhBTlRST19OT0s7Ci0gICAgZWxzZQotICAgICAgICByZXR1cm4oSEFOVFJPX09LKTsKLX0KLQotLyotLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0KLQotICAgIEZ1bmN0aW9uOiBoMjY0YnNkSW50cmE0eDRQcmVkaWN0aW9uCi0KLSAgICAgICAgRnVuY3Rpb25hbCBkZXNjcmlwdGlvbjoKLSAgICAgICAgICBQZXJmb3JtIGludHJhIDR4NCBwcmVkaWN0aW9uIGZvciBsdW1hIHBpeGVscyBhbmQgYWRkIHJlc2lkdWFsCi0gICAgICAgICAgaW50byBwcmVkaWN0aW9uLiBUaGUgcmVzdWx0aW5nIGx1bWEgcGl4ZWxzIGFyZSBzdG9yZWQgaW4KLSAgICAgICAgICBtYWNyb2Jsb2NrIGFycmF5ICdkYXRhJy4gVGhlIGludHJhIDR4NCBwcmVkaWN0aW9uIG1vZGUgZm9y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R0aCA9IDE2OwotICAgIH0KLQotICAgIGlmICh4ID09IDApCi0gICAgICAgIGFsID0gbC13aWR0aDsKLSAgICBlbHNlCi0gICAgICAgIGFsID0gYS0xOwotCi0gICAgb214UmVzID0gb214VkNNNFAxMF9QcmVkaWN0SW50cmFfNHg0KCBsLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGFsLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZGF0YSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChpMzIpd2lkdGgsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAxNiwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChPTVhWQ000UDEwSW50cmE0eDRQcmVkTW9kZSltb2RlLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKGkzMikoYXZhaWxhYmxlQiArCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoYXZhaWxhYmxlQTw8MSkgKwotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKGF2YWlsYWJsZUQ8PDUpICsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChhdmFpbGFibGVDPDw2KSkgKTsKLSAgICBpZiAob214UmVzICE9IE9NWF9TdHNfTm9FcnIpCi0gICAgICAgIHJldHVybiBIQU5UUk9fTk9LOwotCi0gICAgcmV0dXJuKEhBTlRST19PSyk7Ci0KLX0KLQotLyotLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0KLQotICAgIEZ1bmN0aW9uOiBoMjY0YnNkSW50cm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cGUpID09IFBSRURfTU9ERV9JTlRFUikpCi0gICAgICAgIGF2YWlsYWJsZUEgPSBIQU5UUk9fRkFMU0U7Ci0gICAgYXZhaWxhYmxlQiA9IGgyNjRic2RJc05laWdoYm91ckF2YWlsYWJsZShwTWIsIHBNYi0+bWJCKTsKLSAgICBpZiAoYXZhaWxhYmxlQiAmJiBjb25zdHJhaW5lZEludHJhUHJlZCAmJgotICAgICAgIChoMjY0YnNkTWJQYXJ0UHJlZE1vZGUocE1iLT5tYkItPm1iVHlwZSkgPT0gUFJFRF9NT0RFX0lOVEVSKSkKLSAgICAgICAgYXZhaWxhYmxlQiA9IEhBTlRST19GQUxTRTsKLSAgICBhdmFpbGFibGVEID0gaDI2NGJzZElzTmVpZ2hib3VyQXZhaWxhYmxlKHBNYiwgcE1iLT5tYkQpOwotICAgIGlmIChhdmFpbGFibGVEICYmIGNvbnN0cmFpbmVkSW50cmFQcmVkICYmCi0gICAgICAgKGgyNjRic2RNYlBhcnRQcmVkTW9kZShwTWItPm1iRC0+bWJUeXBlKSA9PSBQUkVEX01PREVfSU5URVIpKQotICAgICAgICBhdmFpbGFibGVEID0gSEFOVFJPX0ZBTFNFOwotCi0gICAgcHRyID0gaW1hZ2UtPmNiOwotICAgIHdpZHRoID0gaW1hZ2UtPndpZHRoKjg7Ci0KLSAgICBvbXhSZXMgPSBvbXhWQ000UDEwX1ByZWRpY3RJbnRyYUNocm9tYV84eDgoIChwdHItMSksCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAocHRyIC0gd2lkdGgpLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKHB0ciAtIHdpZHRoIC0xKSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRhdGEsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoaTMyKXdpZHRoLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChPTVhWQ000UDEwSW50cmFDaHJvbWFQcmVkTW9kZSkKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHByZWRNb2RlLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKGkzMikoYXZhaWxhYmxlQiArCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKGF2YWlsYWJsZUE8PDEpICsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoYXZhaWxhYmxlRDw8NSkpICk7Ci0gICAgaWYgKG9teFJlcyAhPSBPTVhfU3RzX05vRXJyKQotICAgICAgICByZXR1cm4gSEFOVFJPX05PSzsKLQotICAgIC8qIGFkdmFuY2UgcG9pbnRlcnMgKi8KLSAgICBkYXRhICs9IDY0OwotICAgIHB0ciA9IGltYWdlLT5jcjsKLQotICAgIG9teFJlcyA9IG9teFZDTTRQMTBfUHJlZGljdEludHJhQ2hyb21hXzh4OCggKHB0ci0xKSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChwdHIgLSB3aWR0aCksCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAocHRyIC0gd2lkdGggLTEpLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZGF0YSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChpMzIpd2lkdGgsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA4LAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKE9NWFZDTTRQMTBJbnRyYUNocm9tYVByZWRNb2RlKQotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcHJlZE1vZGUsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoaTMyKShhdmFpbGFibGVCICsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoYXZhaWxhYmxlQTw8MSkgKwotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChhdmFpbGFibGVEPDw1KSkgKTsKLSAgICBpZiAob214UmVzICE9IE9NWF9TdHNfTm9FcnIpCi0gICAgICAgIHJldHVybiBIQU5UUk9fTk9LOwotCi0gICAgcmV0dXJuKEhBTlRST19PSyk7Ci0KLX0KLQotCi0jZWxzZSAvKiBIMjY0REVDX09NWERMICovCi0KLQotLyotLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0KLQotICAgIEZ1bmN0aW9uOiBoMjY0YnNkSW50cmFQcmVkaWN0aW9uCi0KLSAgICAgICAgRnVuY3Rpb25hbCBkZXNjcmlwdGlvbjoKLSAgICAgICAgICBQcm9jZXNzZXMgb25lIGludHJhIG1hY3JvYmxvY2suIFBlcmZvcm1zIGludHJhIHByZWRpY3Rpb24gdXNpbmcKLSAgICAgICAgICBzcGVjaWZpZWQgcHJlZGljdGlvbiBtb2RlLiBXcml0ZXMgdGhlIGZpbmFsIG1hY3JvYmxvY2sKLSAgICAgICAgICAocHJlZGljdGlvbiArIHJlc2lkdWFsKSBpbnRvIHRoZSBvdXRwdXQgaW1hZ2UgKGltYWdlKQotCi0gICAgICAgIElucHV0czoKLSAgICAgICAgICBwTWIgICAgICAgICAgIHBvaW50ZXIgdG8gbWFjcm9ibG9jayBzcGVjaWZpYyBpbmZvcm1hdGlvbgotICAg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ib3VyNHg0QmxvY2tDKGJsb2NrKTsKLSAgICAgICAgbk1iID0gaDI2NGJzZEdldE5laWdoYm91ck1iKHBNYiwgbmVpZ2hib3VyLm1iKTsKLSAgICAgICAgYXZhaWxhYmxlQyA9IGgyNjRic2RJc05laWdoYm91ckF2YWlsYWJsZShwTWIsIG5NYik7Ci0gICAgICAgIGlmIChhdmFpbGFibGVDICYmIGNvbnN0cmFpbmVkSW50cmFQcmVkICYmCi0gICAgICAgICAgICggaDI2NGJzZE1iUGFydFByZWRNb2RlKG5NYi0+bWJUeXBlKSA9PSBQUkVEX01PREVfSU5URVIpICkKLSAgICAgICAgewotICAgICAgICAgICAgYXZhaWxhYmxlQyA9IEhBTlRST19GQUxTRTsKLSAgICAgICAgfQotCi0gICAgICAgIG5laWdoYm91ciA9ICpoMjY0YnNkTmVpZ2hib3VyNHg0QmxvY2tEKGJsb2NrKTsKLSAgICAgICAgbk1iID0gaDI2NGJzZEdldE5laWdoYm91ck1iKHBNYiwgbmVpZ2hib3VyLm1iKTsKLSAgICAgICAgYXZhaWxhYmxlRCA9IGgyNjRic2RJc05laWdoYm91ckF2YWlsYWJsZShwTWIsIG5NYik7Ci0gICAgICAgIGlmIChhdmFpbGFibGVEICYmIGNvbnN0cmFpbmVkSW50cmFQcmVkICYmCi0gICAgICAgICAgICggaDI2NGJzZE1iUGFydFByZWRNb2RlKG5NYi0+bWJUeXBlKSA9PSBQUkVEX01PREVfSU5URVIpICkKLSAgICAgICAgewotICAgICAgICAgICAgYXZhaWxhYmxlRCA9IEhBTlRST19GQUxTRTsKLSAgICAgICAgfQotCi0gICAgICAgIEdldDR4NE5laWdoYm91clBlbHMoYSwgbCwgZGF0YSwgYWJvdmUsIGxlZnQsIGJsb2NrKTsKLQotICAgICAgICBzd2l0Y2gobW9kZSkKLSAgICAgICAgewotICAgICAgICAgICAgY2FzZSAwOiAvKiBJbnRyYV80eDRfVmVydGljYWwgKi8KLSAgICAgICAgICAgICAgICBpZiAoIWF2YWlsYWJsZUIpCi0gICAgICAgICAgICAgICAgICAgIHJldHVybihIQU5UUk9fTk9LKTsKLSAgICAgICAgICAgICAgICBJbnRyYTR4NFZlcnRpY2FsUHJlZGljdGlvbigodTgqKWRhdGE0eDQsIGEgKyAxKTsKLSAgICAgICAgICAgICAgICBicmVhazsKLSAgICAgICAgICAgIGNhc2UgMTogLyogSW50cmFfNHg0X0hvcml6b250YWwgKi8KLSAgICAgICAgICAgICAgICBpZiAoIWF2YWlsYWJsZUEpCi0gICAgICAgICAgICAgICAgICAgIHJldHVybihIQU5UUk9fTk9LKTsKLSAgICAgICAgICAgICAgICBJbnRyYTR4NEhvcml6b250YWxQcmVkaWN0aW9uKCh1OCopZGF0YTR4NCwgbCArIDEpOwotICAgICAgICAgICAgICAgIGJyZWFrOwotICAgICAgICAgICAgY2FzZSAyOiAvKiBJbnRyYV80eDRfREMgKi8KLSAgICAgICAgICAgICAgICBJbnRyYTR4NERjUHJlZGljdGlvbigodTgqKWRhdGE0eDQsIGEgKyAxLCBsICsgMSwKLSAgICAgICAgICAgICAgICAgICAgYXZhaWxhYmxlQSwgYXZhaWxhYmxlQik7Ci0gICAgICAgICAgICAgICAgYnJlYWs7Ci0gICAgICAgICAgICBjYXNlIDM6IC8qIEludHJhXzR4NF9EaWFnb25hbF9Eb3duX0xlZnQgKi8KLSAgICAgICAgICAgICAgICBpZiAoIWF2YWlsYWJsZUIpCi0gICAgICAgICAgICAgICAgICAgIHJldHVybihIQU5UUk9fTk9LKTsKLSAgICAgICAgICAgICAgICBpZiAoIWF2YWlsYWJsZUMpCi0gICAgICAgICAgICAgICAgewotICAgICAgICAgICAgICAgICAgICBhWzVdID0gYVs2XSA9IGFbN10gPSBhWzhdID0gYVs0XTsKLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgSW50cmE0eDREaWFnb25hbERvd25MZWZ0UHJlZGljdGlvbigodTgqKWRhdGE0eDQsIGEgKyAxKTsKLSAgICAgICAgICAgICAgICBicmVhazsKLSAgICAgICAgICAgIGNhc2UgNDogLyogSW50cmFfNHg0X0RpYWdvbmFsX0Rvd25fUmlnaHQgKi8KLSAgICAgICAgICAgICAgICBpZiAoIWF2YWlsYWJsZUEgfHwgIWF2YWlsYWJsZUIgfHwgIWF2YWlsYWJsZUQpCi0gICAgICAgICAgICAgICAgICAgIHJldHVybihIQU5UUk9fTk9LKTsKLSAgICAgICAgICAgICAgICBJbnRyYTR4NERpYWdvbmFsRG93blJpZ2h0UHJlZGljdGlvbigodTgqKWRhdGE0eDQsIGEgKyAxLCBsICsgMSk7Ci0gICAgICAgICAgICAgICAgYnJlYWs7Ci0gICAgICAgICAgICBjYXNlIDU6IC8qIEludHJhXzR4NF9WZXJ0aWNhbF9SaWdodCAqLwotICAgICAgICAgICAgICAgIGlmICghYXZhaWxhYmxlQSB8fCAhYXZhaWxhYmxlQiB8fCAhYXZhaWxhYmxlRCkKLSAgICAgICAgICAgICAgICAgICAgcmV0dXJuKEhBTlRST19OT0spOwotICAgICAgICAgICAgICAgIEludHJhNHg0VmVydGljYWxSaWdodFByZWRpY3Rpb24oKHU4KilkYXRhNHg0LCBhICsgMSwgbCArIDEpOwotICAgICAgICAgICAgICAgIGJyZWFrOwotICAgICAgICAgICAgY2FzZSA2OiAvKiBJbnRyYV80eDRfSG9yaXpvbnRhbF9Eb3duICovCi0gICAgICAgICAgICAgICAgaWYgKCFhdmFpbGFibGVBIHx8ICFhdmFpbGFibGVCIHx8ICFhdmFpbGFibGVEKQotICAgICAgICAgICAgICAgICAgICByZXR1cm4oSEFOVFJPX05PSyk7Ci0gICAgICAgICAgICAgICAgSW50cmE0eDRIb3Jpem9udGFsRG93blByZWRpY3Rpb24oKHU4KilkYXRhNHg0LCBhICsgMSwgbCArIDEpOwotICAgICAgICAgICAgICAgIGJyZWFrOwotICAgICAgICAgICAgY2FzZSA3OiAvKiBJbnRyYV80eDRfVmVydGljYWxfTGVmdCAqLwotICAgICAgICAgICAgICAgIGlmICghYXZhaWxhYmxlQikKLSAgICAgICAgICAgICAgICAgICAgcmV0dXJuKEhBTlRST19OT0spOwotICAgICAgICAgICAgICAgIGlmICghYXZhaWxhYmxlQykKLSAgICAgICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgICAgIGFbNV0gPSBhWzZdID0gYVs3XSA9IGFbOF0gPSBhWzRdOwotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICBJbnRyYTR4NFZlcnRpY2FsTGVmdFByZWRpY3Rpb24oKHU4KilkYXRhNHg0LCBhICsgMSk7Ci0gICAgICAgICAgICAgICAgYnJlYWs7Ci0gICAgICAgICAgICBkZWZhdWx0OiAvKiBjYXNlIDggSW50cmFfNHg0X0hvcml6b250YWxfVXAgKi8KLSAgICAgICAgICAgICAgICBpZiAoIWF2YWlsYWJsZUEpCi0gICAgICAgICAgICAgICAgICAgIHJldHVybihIQU5UUk9fTk9LKTsKLSAgICAgICAgICAgICAgICBJbnRyYTR4NEhvcml6b250YWxVcFByZWRpY3Rpb24oKHU4KilkYXRhNHg0LCBsICsgMSk7Ci0gICAgICAgICAgICAgICAgYnJlYWs7Ci0gICAgICAgIH0KLQotICAgICAgICBXcml0ZTR4NFRvMTZ4MTYoZGF0YSwgKHU4KilkYXRhNHg0LCBibG9jayk7Ci0gICAgICAgIGgyNjRic2RBZGRSZXNpZHVhbChkYXRhLCBtYkxheWVyLT5yZXNpZHVhbC5sZXZlbFtibG9ja10sIGJsb2NrKTsKLSAgICB9Ci0KLSAgICByZXR1cm4oSEFOVFJPX09LKTsKLQotfQotCi0vKi0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLQotCi0gICAgRnVuY3Rpb246IEludHJhQ2hyb21hUHJlZGljdGlvbgotCi0gICAgICAgIEZ1bmN0aW9uYWwgZGVzY3JpcHRpb246Ci0gICAgICAgICAgUGVyZm9ybSBpbnRyYSBwcmV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xhYmxlQiA9IGgyNjRic2RJc05laWdoYm91ckF2YWlsYWJsZShwTWIsIHBNYi0+bWJCKTsKLSAgICBpZiAoYXZhaWxhYmxlQiAmJiBjb25zdHJhaW5lZEludHJhUHJlZCAmJgotICAgICAgIChoMjY0YnNkTWJQYXJ0UHJlZE1vZGUocE1iLT5tYkItPm1iVHlwZSkgPT0gUFJFRF9NT0RFX0lOVEVSKSkKLSAgICAgICAgYXZhaWxhYmxlQiA9IEhBTlRST19GQUxTRTsKLSAgICBhdmFpbGFibGVEID0gaDI2NGJzZElzTmVpZ2hib3VyQXZhaWxhYmxlKHBNYiwgcE1iLT5tYkQpOwotICAgIGlmIChhdmFpbGFibGVEICYmIGNvbnN0cmFpbmVkSW50cmFQcmVkICYmCi0gICAgICAgKGgyNjRic2RNYlBhcnRQcmVkTW9kZShwTWItPm1iRC0+bWJUeXBlKSA9PSBQUkVEX01PREVfSU5URVIpKQotICAgICAgICBhdmFpbGFibGVEID0gSEFOVFJPX0ZBTFNFOwotCi0gICAgZm9yIChjb21wID0gMCwgYmxvY2sgPSAxNjsgY29tcCA8IDI7IGNvbXArKykKLSAgICB7Ci0gICAgICAgIHN3aXRjaChwcmVkTW9kZSkKLSAgICAgICAgewotICAgICAgICAgICAgY2FzZSAwOiAvKiBJbnRyYV9DaHJvbWFfREMgKi8KLSAgICAgICAgICAgICAgICBJbnRyYUNocm9tYURjUHJlZGljdGlvbihkYXRhLCBhYm92ZSsxLCBsZWZ0LCBhdmFpbGFibGVBLAotICAgICAgICAgICAgICAgICAgICBhdmFpbGFibGVCKTsKLSAgICAgICAgICAgICAgICBicmVhazsKLQotICAgICAgICAgICAgY2FzZSAxOiAvKiBJbnRyYV9DaHJvbWFfSG9yaXpvbnRhbCAqLwotICAgICAgICAgICAgICAgIGlmICghYXZhaWxhYmxlQSkKLSAgICAgICAgICAgICAgICAgICAgcmV0dXJuKEhBTlRST19OT0spOwotICAgICAgICAgICAgICAgIEludHJhQ2hyb21hSG9yaXpvbnRhbFByZWRpY3Rpb24oZGF0YSwgbGVmdCk7Ci0gICAgICAgICAgICAgICAgYnJlYWs7Ci0KLSAgICAgICAgICAgIGNhc2UgMjogLyogSW50cmFfQ2hyb21hX1ZlcnRpY2FsICovCi0gICAgICAgICAgICAgICAgaWYgKCFhdmFpbGFibGVCKQotICAgICAgICAgICAgICAgICAgICByZXR1cm4oSEFOVFJPX05PSyk7Ci0gICAgICAgICAgICAgICAgSW50cmFDaHJvbWFWZXJ0aWNhbFByZWRpY3Rpb24oZGF0YSwgYWJvdmUrMSk7Ci0KLSAgICAgICAgICAgICAgICBicmVhazsKLQotICAgICAgICAgICAgZGVmYXVsdDogLyogY2FzZSAzOiBJbnRyYV9DaHJvbWFfUGxhbmUgKi8KLSAgICAgICAgICAgICAgICBpZiAoIWF2YWlsYWJsZUEgfHwgIWF2YWlsYWJsZUIgfHwgIWF2YWlsYWJsZUQpCi0gICAgICAgICAgICAgICAgICAgIHJldHVybihIQU5UUk9fTk9LKTsKLSAgICAgICAgICAgICAgICBJbnRyYUNocm9tYVBsYW5lUHJlZGljdGlvbihkYXRhLCBhYm92ZSsxLCBsZWZ0KTsKLSAgICAgICAgICAgICAgICBicmVhazsKLSAgICAgICAgfQotICAgICAgICBmb3IgKGkgPSAwOyBpIDwgNDsgaSsrLCBibG9jaysrKQotICAgICAgICAgICAgaDI2NGJzZEFkZFJlc2lkdWFsKGRhdGEsIHJlc2lkdWFsW2ldLCBibG9jayk7Ci0KLSAgICAgICAgLyogYWR2YW5jZSBwb2ludGVycyAqLwotICAgICAgICBkYXRhICs9IDY0OwotICAgICAgICBhYm92ZSArPSA5OwotICAgICAgICBsZWZ0ICs9IDg7Ci0gICAgICAgIHJlc2lkdWFsICs9IDQ7Ci0gICAgfQotCi0gICAgcmV0dXJuKEhBTlRST19PSyk7Ci0KLX0KLQotLyotLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS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hYm92ZVt4ICAgIF07Ci0gICAgICAgIHQyID0gYWJvdmVbeCAgICBdOwotICAgICAgICBsWzBdID0gdDE7Ci0gICAgICAgIGFbMF0gPSB0MjsKLSAgICAgICAgdDEgPSBhYm92ZVt4ICsgMV07Ci0gICAgICAgIHQyID0gYWJvdmVbeCArIDJdOwotICAgICAgICBhWzFdID0gdDE7Ci0gICAgICAgIGFbMl0gPSB0MjsKLSAgICAgICAgdDEgPSBhYm92ZVt4ICsgM107Ci0gICAgICAgIHQyID0gYWJvdmVbeCArIDRdOwotICAgICAgICBhWzNdID0gdDE7Ci0gICAgICAgIGFbNF0gPSB0MjsKLSAgICAgICAgdDEgPSBhYm92ZVt4ICsgNV07Ci0gICAgICAgIHQyID0gYWJvdmVbeCArIDZdOwotICAgICAgICBhWzVdID0gdDE7Ci0gICAgICAgIGFbNl0gPSB0MjsKLSAgICAgICAgdDEgPSBhYm92ZVt4ICsgN107Ci0gICAgICAgIHQyID0gYWJvdmVbeCArIDhdOwotICAgICAgICBhWzddID0gdDE7Ci0gICAgICAgIGFbOF0gPSB0MjsKLSAgICB9Ci0gICAgZWxzZQotICAgIHsKLSAgICAgICAgdDEgPSBkYXRhWyh5IC0gMSkgKiAxNiArIHggICAgXTsKLSAgICAgICAgdDIgPSBkYXRhWyh5IC0gMSkgKiAxNiArIHggKyAxXTsKLSAgICAgICAgYVsxXSA9IHQxOwotICAgICAgICBhWzJdID0gdDI7Ci0gICAgICAgIHQxID0gZGF0YVsoeSAtIDEpICogMTYgKyB4ICsgMl07Ci0gICAgICAgIHQyID0gZGF0YVsoeSAtIDEpICogMTYgKyB4ICsgM107Ci0gICAgICAgIGFbM10gPSB0MTsKLSAgICAgICAgYVs0XSA9IHQyOwotICAgICAgICB0MSA9IGRhdGFbKHkgLSAxKSAqIDE2ICsgeCArIDRdOwotICAgICAgICB0MiA9IGRhdGFbKHkgLSAxKSAqIDE2ICsgeCArIDVdOwotICAgICAgICBhWzVdID0gdDE7Ci0gICAgICAgIG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NCkKLSAgICAgICAgewotICAgICAgICAgICAgbW9kZTEgPSBwTWItPmludHJhNHg0UHJlZE1vZGVbbkEtPmluZGV4XTsKLSAgICAgICAgfQotICAgICAgICBlbHNlCi0gICAgICAgICAgICBtb2RlMSA9IDI7Ci0KLSAgICAgICAgcE1iID0gbk1iQjsKLSAgICAgICAgaWYgKGgyNjRic2RNYlBhcnRQcmVkTW9kZShwTWItPm1iVHlwZSkgPT0gUFJFRF9NT0RFX0lOVFJBNHg0KQotICAgICAgICB7Ci0gICAgICAgICAgICBtb2RlMiA9IHBNYi0+aW50cmE0eDRQcmVkTW9kZVtuQi0+aW5kZXhdOwotICAgICAgICB9Ci0gICAgICAgIGVsc2UKLSAgICAgICAgICAgIG1vZGUyID0gMjsKLQotICAgICAgICBtb2RlMSA9IE1JTihtb2RlMSwgbW9kZTIpOwotICAgIH0KLQotICAgIGlmICghcE1iTGF5ZXItPm1iUHJlZC5wcmV2SW50cmE0eDRQcmVkTW9kZUZsYWdbaW5kZXhdKQotICAgIHsKLSAgICAgICAgaWYgKHBNYkxheWVyLT5tYlByZWQucmVtSW50cmE0eDRQcmVkTW9kZVtpbmRleF0gPCBtb2RlMSkKLSAgICAgICAgewotICAgICAgICAgICAgbW9kZTEgPSBwTWJMYXllci0+bWJQcmVkLnJlbUludHJhNHg0UHJlZE1vZGVbaW5kZXhdOwotICAgICAgICB9Ci0gICAgICAgIGVsc2UKLSAgICAgICAgewotICAgICAgICAgICAgbW9kZTEgPSBwTWJMYXllci0+bWJQcmVkLnJlbUludHJhNHg0UHJlZE1vZGVbaW5kZXhdICsgMTsKLSAgICAgICAgfQotICAgIH0KLQotICAgIHJldHVybihtb2RlMSk7Ci19Ci0KLQotLypsaW50ICtlNzAyICovCi0KLQpkaWZmIC0tZ2l0IGEvbWVkaWEvbGlic3RhZ2VmcmlnaHQvY29kZWNzL29uMi9oMjY0ZGVjL3NvdXJjZS9oMjY0YnNkX2ludHJhX3ByZWRpY3Rpb24uaCBiL21lZGlh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ci0gICAgICAgIHdoaWxlKCAhaDI2NGJzZElzQnl0ZUFsaWduZWQocFN0cm1EYXRhKSApCi0gICAgICAgIHsKLSAgICAgICAgICAgIC8qIHBjbV9hbGlnbm1lbnRfemVyb19iaXQgKi8KLSAgICAgICAgICAgIHRtcCA9IGgyNjRic2RHZXRCaXRzKHBTdHJtRGF0YSwgMSk7Ci0gICAgICAgICAgICBpZiAodG1wKQotICAgICAgICAgICAgICAgIHJldHVybihIQU5UUk9fTk9LKTsKLSAgICAgICAgfQotCi0gICAgICAgIGxldmVsID0gcE1iTGF5ZXItPnJlc2lkdWFsLmxldmVsWzBdOwotICAgICAgICBmb3IgKGkgPSAwOyBpIDwgMzg0OyBpKyspCi0gICAgICAgIHsKLSAgICAgICAgICAgIHZhbHVlID0gaDI2NGJzZEdldEJpdHMocFN0cm1EYXRhLCA4KTsKLSAgICAgICAgICAgIGlmICh2YWx1ZSA9PSBFTkRfT0ZfU1RSRUFNKQotICAgICAgICAgICAgICAgIHJldHVybihIQU5UUk9fTk9LKTsKLSAgICAgICAgICAgICpsZXZlbCsrID0gKGkzMil2YWx1ZTsKLSAgICAgICAgfQotICAgIH0KLSAgICBlbHNlCi0gICAgewotICAgICAgICBwYXJ0TW9kZSA9IGgyNjRic2RNYlBhcnRQcmVkTW9kZShwTWJMYXllci0+bWJUeXBlKTsKLSAgICAgICAgaWYgKCAocGFydE1vZGUgPT0gUFJFRF9NT0RFX0lOVEVSKSAmJgotICAgICAgICAgICAgIChoMjY0YnNkTnVtTWJQYXJ0KHBNYkxheWVyLT5tYlR5cGUpID09IDQpICkKLSAgICAgICAgewotICAgICAgICAgICAgdG1wID0gRGVjb2RlU3ViTWJQcmVkKHBTdHJtRGF0YSwgJnBNYkxheWVyLT5zdWJNYlByZWQsCi0gICAgICAgICAgICAgICAgcE1iTGF5ZXItPm1iVHlwZSwgbnVtUmVmSWR4QWN0aXZlKTsKLSAgICAgICAgfQotICAgICAgICBlbHNlCi0gICAgICAgIHsKLSAgICAgICAgICAgIHRtcCA9IERlY29kZU1iUHJlZChwU3RybURhdGEsICZwTWJMYXllci0+bWJQcmVkLAotICAgICAgICAgICAgICAgIHBNYkxheWVyLT5tYlR5cGUsIG51bVJlZklkeEFjdGl2ZSk7Ci0gICAgICAgIH0KLSAgICAgICAgaWYgKHRtcCAhPSBIQU5UUk9fT0spCi0gICAgICAgICAgICByZXR1cm4odG1wKTsKLQotICAgICAgICBpZiAocGFydE1vZGUgIT0gUFJFRF9NT0RFX0lOVFJBMTZ4MTYpCi0gICAgICAgIHsKLSAgICAgICAgICAgIHRtcCA9IGgyNjRic2REZWNvZGVFeHBHb2xvbWJNYXBwZWQocFN0cm1EYXRhLCAmdmFsdWUsCi0gICAgICAgICAgICAgICAgKHUzMikocGFydE1vZGUgPT0gUFJFRF9NT0RFX0lOVFJBNHg0KSk7Ci0gICAgICAgICAgICBpZiAodG1wICE9IEhBTlRST19PSykKLSAgICAgICAgICAgICAgICByZXR1cm4odG1wKTsKLSAgICAgICAgICAgIHBNYkxheWVyLT5jb2RlZEJsb2NrUGF0dGVybiA9IHZhbHVlOwotICAgICAgICB9Ci0gICAgICAgIGVsc2UKLSAgICAgICAgewotICAgICAgICAgICAgcE1iTGF5ZXItPmNvZGVkQmxvY2tQYXR0ZXJuID0gQ2JwSW50cmExNngxNihwTWJMYXllci0+bWJUeXBlKTsKLSAgICAgICAgfQotCi0gICAgICAgIGlmICggcE1iTGF5ZXItPmNvZGVkQmxvY2tQYXR0ZXJuIHx8Ci0gICAgICAgICAgICAgKHBhcnRNb2RlID09IFBSRURfTU9ERV9JTlRSQTE2eDE2KSApCi0gICAgICAgIHsKLSAgICAgICAgICAgIHRtcCA9IGgyNjRic2REZWNvZGVFeHBHb2xvbWJTaWduZWQocFN0cm1EYXRhLCAmaXRtcCk7Ci0gICAgICAgICAgICBpZiAodG1wICE9IEhBTlRST19PSyB8fCAoaXRtcCA8IC0yNikgfHwgKGl0bXAgPiAyNSkgKQotICAgICAgICAgICAgICAgIH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QotICAgICAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAgICAgdG1wID0gaDI2NGJzZERlY29kZUV4cEdvbG9tYlRydW5jYXRlZChwU3RybURhdGEsICZ2YWx1ZSwKLSAgICAgICAgICAgICAgICAgICAgICAgICh1MzIpKG51bVJlZklkeEFjdGl2ZSA+IDIpKTsKLSAgICAgICAgICAgICAgICAgICAgaWYgKHRtcCAhPSBIQU5UUk9fT0sgfHwgdmFsdWUgPj0gbnVtUmVmSWR4QWN0aXZlKQotICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuKEhBTlRST19OT0spOwotCi0gICAgICAgICAgICAgICAgICAgIHBNYlByZWQtPnJlZklkeEwwW2pdID0gdmFsdWU7Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgfQotCi0gICAgICAgICAgICBmb3IgKGkgPSBoMjY0YnNkTnVtTWJQYXJ0KG1iVHlwZSksIGogPSAwOyBpLS07ICBqKyspCi0gICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgdG1wID0gaDI2NGJzZERlY29kZUV4cEdvbG9tYlNpZ25lZChwU3RybURhdGEsICZpdG1wKTsKLSAgICAgICAgICAgICAgICBpZiAodG1wICE9IEhBTlRST19PSykKLSAgICAgICAgICAgICAgICAgICAgcmV0dXJuKHRtcCk7Ci0gICAgICAgICAgICAgICAgcE1iUHJlZC0+bXZkTDBbal0uaG9yID0gKGkxNilpdG1wOwotCi0gICAgICAgICAgICAgICAgdG1wID0gaDI2NGJzZERlY29kZUV4cEdvbG9tYlNpZ25lZChwU3RybURhdGEsICZpdG1wKTsKLSAgICAgICAgICAgICAgICBpZiAodG1wICE9IEhBTlRST19PSykKLSAgICAgICAgICAgICAgICAgICAgcmV0dXJuKHRtcCk7Ci0gICAgICAgICAgICAgICAgcE1iUHJlZC0+bXZkTDBbal0udmVyID0gKGkxNilpdG1wOwotICAgICAgICAgICAgfQotICAgICAgICAgICAgYnJlYWs7Ci0KLSAgICAgICAgY2FzZSBQUkVEX01PREVfSU5UUkE0eDQ6Ci0gICAgICAgICAgICBmb3IgKGl0bXAgPSAwLCBpID0gMDsgaXRtcCA8IDI7IGl0bXArKykKLSAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICB2YWx1ZSA9IGgyNjRic2RTaG93Qml0czMyKHBTdHJtRGF0YSk7Ci0gICAgICAgICAgICAgICAgdG1wID0gMDsKLSAgICAgICAgICAgICAgICBmb3IgKGogPSA4OyBqLS07IGkrKykKLSAgICAgICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgICAgIHBNYlByZWQtPnByZXZJbnRyYTR4NFByZWRNb2RlRmxhZ1tpXSA9Ci0gICAgICAgICAgICAgICAgICAgICAgICB2YWx1ZSAmIDB4ODAwMDAwMDAgPyBIQU5UUk9fVFJVRSA6IEhBTlRST19GQUxTRTsKLSAgICAgICAgICAgICAgICAgICAgdmFsdWUgPDw9IDE7Ci0gICAgICAgICAgICAgICAgICAgIGlmICghcE1iUHJlZC0+cHJldkludHJhNHg0UHJlZE1vZGVGbGFnW2ldKQotICAgICAgICAgICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgICAgICAgICBwTWJQcmVkLT5yZW1JbnRyYTR4NFByZWRNb2RlW2ldID0gdmFsdWU+PjI5OwotICAgICAgICAgICAgICAgICAgICAgICAgdmFsdWUgPDw9IDM7Ci0gICAgICAgICAgICAgICAgICAgICAgICB0bXArKzsKLSAgICAgICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICBpZiAoaDI2NGJzZEZsdXNoQml0cyhwU3RybURhdGEsIDggKyAzKnRtcCkgPT0gRU5EX09GX1NUUkVBTSkKLSAgICAgICAgICAgICAgICAgICAgcmV0dXJuKEhBTlRST19OT0spOwotICAgICAgICAgICAgfQotICAgICAgICAgICAgLyogZmFsbC10aHJvdWdoICovCi0KLSAgICAgICAgY2FzZSBQUkVEX01PREVfSU5UUkExNngxNjoKLSAgICAgICAgICAgIHRtcCA9I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TdWJNYlByZWQpOwotICAgIEFTU0VSVChoMjY0YnNkTWJQYXJ0UHJlZE1vZGUobWJUeXBlKSA9PSBQUkVEX01PREVfSU5URVIpOwotCi0gICAgZm9yIChpID0gMDsgaSA8IDQ7IGkrKykKLSAgICB7Ci0gICAgICAgIHRtcCA9IGgyNjRic2REZWNvZGVFeHBHb2xvbWJVbnNpZ25lZChwU3RybURhdGEsICZ2YWx1ZSk7Ci0gICAgICAgIGlmICh0bXAgIT0gSEFOVFJPX09LIHx8IHZhbHVlID4gMykKLSAgICAgICAgICAgIHJldHVybihIQU5UUk9fTk9LKTsKLSAgICAgICAgcFN1Yk1iUHJlZC0+c3ViTWJUeXBlW2ldID0gKHN1Yk1iVHlwZV9lKXZhbHVlOwotICAgIH0KLQotICAgIGlmICggKG51bVJlZklkeEFjdGl2ZSA+IDEpICYmIChtYlR5cGUgIT0gUF84eDhyZWYwKSApCi0gICAgewotICAgICAgICBmb3IgKGkgPSAwOyBpIDwgNDsgaSsrKQotICAgICAgICB7Ci0gICAgICAgICAgICB0bXAgPSBoMjY0YnNkRGVjb2RlRXhwR29sb21iVHJ1bmNhdGVkKHBTdHJtRGF0YSwgJnZhbHVlLAotICAgICAgICAgICAgICAgICh1MzIpKG51bVJlZklkeEFjdGl2ZSA+IDIpKTsKLSAgICAgICAgICAgIGlmICh0bXAgIT0gSEFOVFJPX09LIHx8IHZhbHVlID49IG51bVJlZklkeEFjdGl2ZSkKLSAgICAgICAgICAgICAgICByZXR1cm4oSEFOVFJPX05PSyk7Ci0gICAgICAgICAgICBwU3ViTWJQcmVkLT5yZWZJZHhMMFtpXSA9IHZhbHVlOwotICAgICAgICB9Ci0gICAgfQotCi0gICAgZm9yIChpID0gMDsgaSA8IDQ7IGkrKykKLSAgICB7Ci0gICAgICAgIGogPSAwOwotICAgICAgICBmb3IgKHZhbHVlID0gaDI2NGJzZE51bVN1Yk1iUGFydChwU3ViTWJQcmVkLT5zdWJNYlR5cGVbaV0pOwotICAgICAgICAgIC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AgICAxNik7Ci0jZWxzZQotICAgICAgICBvbXhSZXMgPSBhcm1WQ000UDEwX0RlY29kZUNvZWZmc1RvUGFpcigKLSAgICAgICAgICAgICAgICAoY29uc3QgT01YX1U4ICoqKSAoJnBTdHJtRGF0YS0+cFN0cm1DdXJyUG9zKSwKLSAgICAgICAgICAgICAgICAoT01YX1MzMiopICgmcFN0cm1EYXRhLT5iaXRQb3NJbldvcmQpLAotICAgICAgICAgICAgICAgICZwUmVzaWR1YWwtPnRvdGFsQ29lZmZbMjRdLAotICAgICAgICAgICAgICAgICZwUG9zQ29lZkJ1ZiwKLSAgICAgICAgICAgICAgICBuYywKLSAgICAgICAgICAgICAgICAxNik7Ci0jZW5kaWYKLSAgICAgICAgaWYgKG9teFJlcyAhPSBPTVhfU3RzX05vRXJyKQotICAgICAgICAgICAgcmV0dXJuKEhBTlRST19OT0spOwotICAgICAgICBpczE2eDE2ID0gSEFOVFJPX1RSVUU7Ci0gICAgfQotICAgIGVsc2UKLSAgICAgICAgaXMxNngxNiA9IEhBTlRST19GQUxTRTsKLQotICAgIGZvciAoaSA9IDQsIGJsb2NrSW5kZXggPSAwOyBpLS07KQotICAgIHsKLSAgICAgICAgLyogbHVtYSBjYnAgaW4gYml0cyAwLTMgKi8KLSAgICAgICAgYmxvY2tDb2RlZCA9IGNvZGVkQmxvY2tQYXR0ZXJuICYgMHgxOwotICAgICAgICBjb2RlZEJsb2NrUGF0dGVybiA+Pj0gMTsKLSAgICAgICAgaWYgKGJsb2NrQ29kZWQpCi0gICAgICAgIHsKLSAgICAgICAgICAgIGZvciAoaiA9IDQ7IGotLTsgYmxvY2tJbmRleCsrKQotICAgICAgICAgICAgewotICAgICAgICAgICAgICAgIG5jID0gKE9NWF9JTlQpRGV0ZXJtaW5lTmMocE1iLGJsb2NrSW5kZXgscFJlc2lkdWFsLT50b3RhbENvZWZmKTsKLSAgICAgICAgICAgICAgICBpZiAoaXMxNngxNikKLSAgICAgICAgICAgICAgICB7Ci0jaWZuZGVmIEgyNjRERUNfTkVPTgotICAgICAgICAgICAgICAgICAgICBvbXhSZXMgPSAgb214VkNNNFAxMF9EZWNvZGVDb2VmZnNUb1BhaXJDQVZMQygKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAoY29uc3QgT01YX1U4ICoqKSAoJnBTdHJtRGF0YS0+cFN0cm1DdXJyUG9zKSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAoT01YX1MzMiopICgmcFN0cm1EYXRhLT5iaXRQb3NJbldvcmQpLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICZwUmVzaWR1YWwtPnRvdGFsQ29lZmZbYmxvY2tJbmRleF0sCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgJnBQb3NDb2VmQnVmLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgIG5jLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgIDE1KTsKLSNlbHNlCi0gICAgICAgICAgICAgICAgICAgIG9teFJlcyA9ICBhcm1WQ000UDEwX0RlY29kZUNvZWZmc1RvUGFpcigKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAoY29uc3QgT01YX1U4ICoqKSAoJnBTdHJtRGF0YS0+cFN0cm1DdXJyUG9zKSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAoT01YX1MzMiopICgmcFN0cm1EYXRhLT5iaXRQb3NJbldvcmQpLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICZwUmVzaWR1YWwtPnRvdGFsQ29lZmZbYmxvY2tJbmRleF0sCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgJnBQb3NDb2VmQnVmLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgIG5jLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgIDE1KTsKLSNlbmRpZgotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICBlbHNlCi0gICAgICAgICAgICAgICAgewotI2lmbmRlZiBIMjY0REVDX05FT04KLSAgICAgICAgICAgICAgICAgICAgb214UmVzID0gIG9teFZDTTRQMTBfRGVjb2RlQ29lZmZzVG9QYWlyQ0FWTEMoCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgKGNvbnN0IE9NWF9VOCAqKikgKCZwU3RybURhdGEtPnBTdHJtQ3VyclBvcyksCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgKE9NWF9TMzIqKSAoJnBTdHJtRGF0YS0+Yml0UG9zSW5Xb3JkKSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAmcFJlc2lkdWFsLT50b3RhbENvZWZmW2Jsb2NrSW5kZXhdLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICZwUG9zQ29lZkJ1ZiwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBuYywKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAxNik7Ci0jZWxzZQotICAgICAgICAgICAgICAgICAgICBvbXhSZXMgPSBhcm1WQ000UDEwX0RlY29kZUNvZWZmc1RvUGFpcigKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAoY29uc3QgT01YX1U4ICoqKSAoJnBTdHJtRGF0YS0+cFN0cm1DdXJyUG9zKSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAoT01YX1MzMiopICgmcFN0cm1EYXRhLT5iaXRQb3NJbldvcmQpLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICZwUmVzaWR1YWwtPnRvdGFsQ29lZmZbYmxvY2tJbmRleF0sCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgJnBQb3NDb2VmQnVmLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgIG5jLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgIDE2KTsKLSNlbmRpZgotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICBpZiAob214UmVzICE9IE9NWF9TdHNfTm9FcnIpCi0gICAgICAgICAgICAgICAgICAgIHJldHVybihIQU5UUk9fTk9LKTsKLSAgICAgICAgICAgIH0KLSAgICAgICAgfQotICAgICAgICBlbHNlCi0gICAgICAgICAgICBibG9ja0luZGV4ICs9IDQ7Ci0gICAgfQotCi0gICAgLyogY2hyb21hIERDIGJsb2NrIGFyZSBhdCBpbmRpY2VzIDI1IGFuZCAyNiAqLwotICAgIGJsb2NrQ29kZWQgPSBjb2RlZEJsb2NrUGF0dGVybiAmIDB4MzsKLSAgICBpZiAoYmxvY2tDb2RlZCkKLSAgICB7Ci0jaWZuZGVmIEgyNjRERUNfTkVPTgotICAgICAgICBvbXhSZXMgPSAgb214VkNNNFAxMF9EZWNvZGVDaHJvbWFEY0NvZWZmc1RvUGFpckNBVkxDKAotICAgICAgICAgICAgICAgIChjb25zdCBPTVhfVTgqKikgKCZwU3RybURhdGEtPnBTdHJtQ3VyclBvcyksCi0gICAgICAgICAgICAgICAgKE9NWF9TMzIqKSAoJnBTdHJtRGF0YS0+Yml0UG9zSW5Xb3JkKSwKLSAgICAgICAgICAgICAgICAmcFJlc2lkdWFsLT50b3RhbENvZWZmWzI1XSwKLSAgICAgICAgICAgICAgICAmcFBvc0NvZWZCdWYpOwotI2Vsc2UKLSAgICAgICAgb214UmVzID0gYXJtVkNNNFAxMF9EZWNvZGVDb2VmZnNUb1BhaXIoCi0gICAgICAgICAgICAgICAgKGNvbnN0IE9NWF9VOCoqKSAoJnBTdHJtRGF0YS0+cFN0cm1DdXJyUG9zKSwKLSAgICAgICAgICAgICAgICAoT01YX1MzMiopICgmcFN0cm1EYXRhLT5iaXRQb3NJbldvcmQpLAotICAgICAgICAgICAgICAgICZwUmVzaWR1YWwtPnRvdGFsQ29lZmZbMjVdLAotICAgICAgICAgICAgICAgICZwUG9zQ29lZkJ1ZiwKLSAgICAgICAgICAgICAgICAxNywKLSAgICAgICAgICAgICAgICA0KTsKLSNlbmRpZgotICAgICAgICBpZiAob214UmVzICE9IE9NWF9TdHNfTm9FcnIpCi0gICAgICAgICAgICByZXR1cm4oSEFOVFJPX05PSyk7Ci0jaWZuZGVmIEgyNjRERUNfTkVPTgotICAgICAgICBvbXhSZXMgPSAgb214VkNNNFAxMF9EZWNvZGVDaHJvbWFEY0NvZWZmc1RvUGFpckNBVkxDKAotICAgICAgICAgICAgICAgIChjb25zdCBPTVhfVTgqKikgKCZwU3RybURhdGEtPnBTdHJtQ3VyclBvcyksCi0gICAgICAgICAgICAgICAgKE9NWF9TMzIqKSAoJnBTdHJtRGF0YS0+Yml0UG9zSW5Xb3JkKSwKLSAgICAgICAgICAgICAgICAmcFJlc2lkdWFsLT50b3RhbENvZWZmWzI2XSwKLSAgICAgICAgICAgICAgICAmcFBvc0NvZWZCdWYpOwotI2Vsc2UKLSAgICAgICAgb214UmVzID0gYXJtVkNNNFAxMF9EZWNvZGVDb2VmZnNUb1BhaXIoCi0gICAgICAgICAgICAgICAgKGNvbnN0IE9NWF9VOCoqKSAoJnBTdHJtRGF0YS0+cFN0cm1DdXJyUG9zKSwKLSAgICAgICAgICAgICAgICAoT01YX1MzMiopICgmcFN0cm1EYXRhLT5iaXRQb3NJbldvcmQpLAotICAgICAgICAgICAgICAgICZwUmVzaWR1YWwtPnRvdGFsQ29lZmZbMjZdLAotICAgICAgICAgICAgICAgICZwUG9zQ29lZkJ1ZiwKLSAgICAgICAgICAgICAgICAxNywKLSAgICAgICAgICAgICAgICA0KTsKLSNlbmRpZgotICAgICAgICBpZiAob214UmVzICE9IE9NWF9TdHNfTm9FcnIpCi0gICAgICAgICAgICByZXR1cm4oSEFOVFJPX05PSyk7Ci0gICAgfQotCi0gICAgLyogY2hyb21hIEFDICovCi0gICAgYmxvY2tDb2RlZCA9IGNvZGVkQmxvY2tQYXR0ZXJuICYgMHgyOwotICAgIGlmIChibG9ja0NvZGVkKQotICAgIHsKLSAgICAgICAgZm9yIChpID0gODsgaS0tO2Jsb2NrSW5kZXgrKykKLSAgICAgICAgewotICAgICAgICAgICAgbmMgPSAoT01YX0lOVClEZXRlcm1pbmVOYyhwTWIsIGJsb2NrSW5kZXgsIHBSZXNpZHVhbC0+dG90YWxDb2VmZik7Ci0jaWZuZGVmIEgyNjRERUNfTkVPTgotICAgICAgICAgICAgb214UmVzID0gIG9teFZDTTRQMTBfRGVjb2RlQ29lZmZzVG9QYWlyQ0FWTEMoCi0gICAgICAgICAgICAgICAgICAgIChjb25zdCBPTVhfVTggKiopICgmcFN0cm1EYXRhLT5wU3RybUN1cnJQb3MpLAotICAgICAgICAgICAgICAgICAgICAoT01YX1MzMiopICgmcFN0cm1EYXRhLT5iaXRQb3NJbldvcmQpLAotICAgICAgICAgICAgICAgICAgICAmcFJlc2lkdWFsLT50b3RhbENvZWZmW2Jsb2NrSW5kZXhdLAotICAgICAgICAgICAgICAgICAgICAmcFBvc0NvZWZCdWYsCi0gICAgICAgICAgICAgICAgICAgIG5jLAotICAgICAgICAgICAgICAgICAgICAxNSk7Ci0jZWxzZQotICAgICAgICAgICAgb214UmVzID0gIGFybVZDTTRQMTBfRGVjb2RlQ29lZmZzVG9QYWlyKAotICAgICAgICAgICAgICAgICAgICAoY29uc3QgT01YX1U4ICoqKSAoJnBTdHJtRGF0YS0+cFN0cm1DdXJyUG9zKSwKLSAgICAgICAgICAgICAgICAgICAgKE9NWF9TMzIqKSAoJnBTdHJtRGF0YS0+Yml0UG9zSW5Xb3JkKSwKLSAgICAgICAgICAgICAgICAgICAgJnBSZXNpZHVhbC0+dG90YWxDb2VmZltibG9ja0luZGV4XSwKLSAgICAgICAgICAgICAgICAgICAgJnBQb3NDb2VmQnVmLAotICAgICAgICAgICAgICAgICAgICBuYywKLSAgICAgICAgICAgICAgICAgICAgMTUpOwotI2VuZGlmCi0gICAgICAgICAgICBpZiAob214UmVzICE9IE9NWF9TdHNfTm9FcnIpCi0gICAgICAgICAgICAgICAgcmV0dXJuKEhBTlRST19OT0spOwotICAgICAgICB9Ci0gICAgfQotCi0gICAgcmV0dXJuKEhBTlRST19PSyk7Ci0KLX0KLQotI2Vsc2UKLS8qLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t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Y0YnNkRGVjb2RlUmVzaWR1YWxCbG9ja0NhdmxjKHBTdHJtRGF0YSwgbGV2ZWxbMjRdLCBuYywgMTYpOwotICAgICAgICBpZiAoKHRtcCAmIDB4RikgIT0gSEFOVFJPX09LKQotICAgICAgICAgICAgcmV0dXJuKHRtcCk7Ci0gICAgICAgIHBSZXNpZHVhbC0+dG90YWxDb2VmZlsyNF0gPSAodG1wID4+IDQpICYgMHhGRjsKLSAgICAgICAgaXMxNngxNiA9IEhBTlRST19UUlVFOwotICAgIH0KLSAgICBlbHNlCi0gICAgICAgIGlzMTZ4MTYgPSBIQU5UUk9fRkFMU0U7Ci0KLSAgICBmb3IgKGkgPSA0LCBibG9ja0luZGV4ID0gMDsgaS0tOykKLSAgICB7Ci0gICAgICAgIC8qIGx1bWEgY2JwIGluIGJpdHMgMC0zICovCi0gICAgICAgIGJsb2NrQ29kZWQgPSBjb2RlZEJsb2NrUGF0dGVybiAmIDB4MTsKLSAgICAgICAgY29kZWRCbG9ja1BhdHRlcm4gPj49IDE7Ci0gICAgICAgIGlmIChibG9ja0NvZGVkKQotICAgICAgICB7Ci0gICAgICAgICAgICBmb3IgKGogPSA0OyBqLS07IGJsb2NrSW5kZXgrKykKLSAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICBuYyA9IChpMzIpRGV0ZXJtaW5lTmMocE1iLCBibG9ja0luZGV4LCBwUmVzaWR1YWwtPnRvdGFsQ29lZmYpOwotICAgICAgICAgICAgICAgIGlmIChpczE2eDE2KQotICAgICAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAgICAgdG1wID0gaDI2NGJzZERlY29kZVJlc2lkdWFsQmxvY2tDYXZsYyhwU3RybURhdGEsCi0gICAgICAgICAgICAgICAgICAgICAgICBsZXZlbFtibG9ja0luZGV4XSArIDEsIG5jLCAxNSk7Ci0gICAgICAgICAgICAgICAgICAgIHBSZXNpZHVhbC0+Y29lZmZNYXBbYmxvY2tJbmRleF0gPSB0bXAgPj4gMTU7Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgIGVsc2UKLSAgICAgICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgICAgIHRtcCA9IGgyNjRic2REZWNvZGVSZXNpZHVhbEJsb2NrQ2F2bGMocFN0cm1EYXRhLAotICAgICAgICAgICAgICAgICAgICAgICAgbGV2ZWxbYmxvY2tJbmRleF0sIG5jLCAxNik7Ci0gICAgICAgICAgICAgICAgICAgIHBSZXNpZHVhbC0+Y29lZmZNYXBbYmxvY2tJbmRleF0gPSB0bXAgPj4gMTY7Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgIGlmICgodG1wICYgMHhGKSAhPSBIQU5UUk9fT0spCi0gICAgICAgICAgICAgICAgICAgIHJldHVybih0bXApOwotICAgICAgICAgICAgICAgIHBSZXNpZHVhbC0+dG90YWxDb2VmZltibG9ja0luZGV4XSA9ICh0bXAgPj4gNCkgJiAweEZGOwotICAgICAgICAgICAgfQotICAgICAgICB9Ci0gICAgICAgIGVsc2UKLSAgICAgICAgICAgIGJsb2NrSW5kZXggKz0gNDsKLSAgICB9Ci0KLSAgICAvKiBjaHJvbWEgREMgYmxvY2sgYXJlIGF0IGluZGljZXMgMjUgYW5kIDI2ICovCi0gICAgYmxvY2tDb2RlZCA9IGNvZGVkQmxvY2tQYXR0ZXJuICYgMHgzOwotICAgIGlmIChibG9ja0NvZGVkKQotICAgIHsKLSAgICAgICAgdG1wID0gaDI2NGJzZERlY29kZVJlc2lkdWFsQmxvY2tDYXZsYyhwU3RybURhdGEsIGxldmVsWzI1XSwgLTEsIDQpOwotICAgICAgICBpZiAoKHRtcCAmIDB4RikgIT0gSEFOVFJPX09LKQotICAgICAgICAgICAgcmV0dXJuKHRtcCk7Ci0gICAgICAgIHBSZXNpZHVhbC0+dG90YWxDb2VmZlsyNV0gPSAodG1wID4+IDQpICYgMHhGRjsKLSAgICAgICAgdG1wID0gaDI2NGJzZERlY29kZVJlc2lkdWFsQmxvY2tDYXZs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gICAgICAgICAgKnRvdCsrID0gMTY7Ci0gICAgICAgICAgICBmb3IgKHRtcCA9IDE2OyB0bXAtLTspCi0gICAgICAgICAgICAgICAgKnBEYXRhKysgPSAodTgpKCpsZXYrKyk7Ci0gICAgICAgIH0KLSAgICAgICAgaDI2NGJzZFdyaXRlTWFjcm9ibG9jayhjdXJySW1hZ2UsICh1OCopZGF0YSk7Ci0KLSAgICAgICAgcmV0dXJuKEhBTlRST19PSyk7Ci0gICAgfQotICAgIGVsc2UKLSAgICB7Ci0jaWZkZWYgSDI2NERFQ19PTVhETAotICAgICAgICBpZiAoaDI2NGJzZE1iUGFydFByZWRNb2RlKG1iVHlwZSkgPT0gUFJFRF9NT0RFX0lOVEVSKQotICAgICAgICB7Ci0gICAgICAgICAgICB0bXAgPSBoMjY0YnNkSW50ZXJQcmVkaWN0aW9uKHBNYiwgcE1iTGF5ZXIsIGRwYiwgbWJOdW0sCi0gICAgICAgICAgICAgICAgY3VyckltYWdlLCAodTgqKWRhdGEpOwotICAgICAgICAgICAgaWYgKHRtcCAhPSBIQU5UUk9fT0spIHJldHVybiAodG1wKTsKLSAgICAgICAgfQotI2VuZGlmCi0gICAgICAgIGlmIChtYlR5cGUgIT0gUF9Ta2lwKQotICAgICAgICB7Ci0gICAgICAgICAgICBIMjY0U3dEZWNNZW1jcHkocE1iLT50b3RhbENvZWZmLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBNYkxheWVyLT5yZXNpZHVhbC50b3RhbENvZWZmLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgIDI3KnNpemVvZigqcE1iLT50b3RhbENvZWZmKSk7Ci0KLSAgICAgICAgICAgIC8qIHVwZGF0ZSBxcFkgKi8KLSAgICAgICAgICAgIGlmIChwTWJMYXllci0+bWJRcERlbHRhKQotICAgICAgICAgICAgewotICAgICAgICAgICAgICAgICpxcFkgPSAqcXBZICsgcE1iTGF5ZXItPm1iUXBEZWx0YTsKLSAgICAgICAgICAgICAgICBpZiAoKnFwWSA8IDApICpxcFkgKz0gNTI7Ci0gICAgICAgICAgICAgICAgZWxzZSBpZiAoKnFwWSA+PSA1MikgKnFwWSAtPSA1MjsKLSAgICAgICAgICAgIH0KLSAgICAgICAgICAgIHBNYi0+cXBZID0gKHUzMikqcXBZOwotCi0jaWZkZWYgSDI2NERFQ19PTVhETAotICAgICAgICAgICAgcFNyYyA9IHBNYkxheWVyLT5yZXNpZHVhbC5wb3NDb2VmQnVmOwotCi0gICAgICAgICAgICBpZiAoaDI2NGJzZE1iUGFydFByZWRNb2RlKG1iVHlwZSkgPT0gUFJFRF9NT0RFX0lOVEVSKQotICAgICAgICAgICAgewotICAgICAgICAgICAgICAgIE9NWFJlc3VsdCByZXM7Ci0gICAgICAgICAgICAgICAgdTggKnA7Ci0gICAgICAgICAgICAgICAgdTggKnRvdGFsQ29lZmYgPSBwTWItPnRvdGFsQ29lZmY7Ci0KLSAgICAgICAgICAgICAgICBmb3IgKGkgPSAwOyBpIDwgMTY7IGkrKywgdG90YWxDb2VmZisrKQotICAgICAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAgICAgcCA9IGRhdGEgKyBsdW1hSW5kZXhbaV07Ci0gICAgICAgICAgICAgICAgICAgIGlmICgqdG90YWxDb2VmZikKLSAgICAgICAgICAgICAgICAgICAgewotICAgICAgICAgICAgICAgICAgICAgICAgcmVzID0gb214VkNNNFAxMF9EZXF1YW50VHJhbnNmb3JtUmVzaWR1YWxGcm9tUGFpckFuZEFkZCgKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJnBTcmMsIHAsIDAsIHAsIDE2LCAxNiwgKnFwWSwgKnRvdGFsQ29lZmYpOwotICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHJlcyAhPSBPTVhfU3RzX05vRXJyKQotICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiAoSEFOVFJPX05PSyk7Ci0gICAgICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgIH0KLSAgICAgICAgICAgIGVsc2UgaWYgKGgyNjRic2RNYlBhcnRQcmVkTW9kZShtYlR5cGUpID09IFBSRURfTU9ERV9JTlRSQTR4NCkKLSAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICB0bXAgPSBQcm9jZXNzSW50cmE0eDRSZXNpZHVhbChwTWIsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZGF0YSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb25zdHJhaW5lZEludHJhUHJlZEZsYWcsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcE1iTGF5ZXIsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJnBTcmMsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY3VyckltYWdlKTsKLSAgICAgICAgICAgICAgICBpZiAodG1wICE9IEhBTlRST19PSykKLSAgICAgICAgICAgICAgICAgICAgcmV0dXJuICh0bXApOwotICAgICAgICAgICAgfQotICAgICAgICAgICAgZWxzZSBpZiAoaDI2NGJzZE1iUGFydFByZWRNb2RlKG1iVHlwZSkgPT0gUFJFRF9NT0RFX0lOVFJBMTZ4MTYpCi0gICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgdG1wID0gUHJvY2Vzc0ludHJhMTZ4MTZSZXNpZHVhbChwTWIsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZGF0YSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb25zdHJhaW5lZEludHJhUHJlZEZsYWcsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcE1iTGF5ZXItPm1iUHJlZC5pbnRyYUNocm9tYVByZWRNb2RlLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICZwU3JjLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGN1cnJJbWFnZSk7Ci0gICAgICAgICAgICAgICAgaWYgKHRtcCAhPSBIQU5UUk9fT0spCi0gICAgICAgICAgICAgICAgICAgIHJldHVybiAodG1wKTsKLSAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgdG1wID0gUHJvY2Vzc0Nocm9tYVJlc2lkdWFsKHBNYiwgZGF0YSwgJnBTcmMpOwotCi0jZWxzZQotICAgICAgICAgICAgdG1wID0gUHJvY2Vzc1Jlc2lkdWFsKHBNYiwgcE1iTGF5ZXItPnJlc2lkdWFsLmxldmVsLAotICAgICAgICAgICAgICAgIHBNYkxheWVyLT5yZXNpZHVhbC5jb2VmZk1hcCk7Ci0jZW5kaWYKLSAgICAgICAgICAgIGlmICh0bXAgIT0gSEFOVFJPX09LKQotICAgICAgICAgICAgICAgIHJldHVybiAodG1wKTsKLSAgICAgICAgfQotICAgICAgICBlbHNlCi0gICAgICAgIHsKLSAgICAgICAgICAgIEgyNjRTd0RlY01lbXNldChwTWItPnRvdGFsQ29lZmYsIDAsIDI3KnNpemVvZigqcE1iLT50b3RhbENvZWZmKSk7Ci0gICAgICAgICAgICBwTWItPnFwWSA9ICh1MzIpKnFwWTsKLSAgICAgICAgfQotI2lmZGVmIEgyNjRERUNfT01YREwKLSAgICAgICAgLyogaWYgZGVjb2RlZCBmbGFnID4gMSAtPiBtYiBoYXMgYWxyZWFkeSBiZWVuIHN1Y2Nlc3NmdWxseSBkZWNvZGVkIGFuZAotICAgICAgICAgKiB3cml0dGVuIHRvIG91dHB1dCAtPiBkbyBub3Qgd3JpdGUgYWdhaW4gKi8KLSAgICAgICAgaWYgKHBNYi0+ZGVjb2RlZCA+IDEpCi0gICAgICAgICAgICByZXR1cm4gSEFOVFJPX09LOwotCi0gICAgICAgIGgyNjRic2RXcml0ZU1hY3JvYmxvY2soY3VyckltYWdlLCBkYXRhKTsKLSNlbHNlCi0gICAgICAg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Ci0gICAgICAgICAgICAgICAgcERjLAotICAgICAgICAgICAgICAgIChpMzIpY2hyb21hUXApOwotICAgICAgICBpZiAocmVzdWx0ICE9IE9NWF9TdHNfTm9FcnIpCi0gICAgICAgICAgICByZXR1cm4gKEhBTlRST19OT0spOwotICAgIH0KLQotICAgIHBEYyA9IGRjOwotICAgIHRvdGFsQ29lZmYgPSBwTWItPnRvdGFsQ29lZmYgKyAxNjsKLSAgICBmb3IgKGkgPSAwOyBpIDwgODsgaSsrLCBwRGMrKywgdG90YWxDb2VmZisrKQotICAgIHsKLSAgICAgICAgLyogY2hyb21hIHByZWRpY3Rpb24gKi8KLSAgICAgICAgaWYgKCp0b3RhbENvZWZmIHx8ICpwRGMpCi0gICAgICAgIHsKLSAgICAgICAgICAgIHAgPSBkYXRhICsgY2hyb21hSW5kZXhbaV07Ci0gICAgICAgICAgICByZXN1bHQgPSBvbXhWQ000UDEwX0RlcXVhbnRUcmFuc2Zvcm1SZXNpZHVhbEZyb21QYWlyQW5kQWRkKAotICAgICAgICAgICAgICAgICAgICBwU3JjLAotICAgICAgICAgICAgICAgICAgICBwLAotICAgICAgICAgICAgICAgICAgICBwRGMsCi0gICAgICAgICAgICAgICAgICAgIHAsCi0gICAgICAgICAgICAgICAgICAgIDgsCi0gICAgICAgICAgICAgICAgICAgIDgsCi0gICAgICAgICAgICAgICAgICAgIChpMzIpY2hyb21hUXAsCi0gICAgICAgICAgICAgICAgICAgICp0b3RhbENvZWZmKTsKLSAgICAgICAgICAgIGlmIChyZXN1bHQgIT0gT01YX1N0c19Ob0VycikKLSAgICAgICAgICAgICAgICByZXR1cm4gKEhBTlRST19OT0spOwotICAgICAgICB9Ci0gICAgfQotCi0gICAgcmV0dXJuKEhBTlRST19PSyk7Ci19Ci0KLS8qLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tCi0KLSAg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bVBhaXIoCi0gICAgICAgICAgICAgICAgICAgIHBTcmMsCi0gICAgICAgICAgICAgICAgICAgIHBEYywKLSAgICAgICAgICAgICAgICAgICAgKGkzMilwTWItPnFwWSk7Ci0gICAgICAgIGlmIChyZXN1bHQgIT0gT01YX1N0c19Ob0VycikKLSAgICAgICAgICAgIHJldHVybiAoSEFOVFJPX05PSyk7Ci0gICAgfQotICAgIC8qIEludHJhIDE2eDE2IHByZWQgKi8KLSAgICBpZiAoaDI2NGJzZEludHJhMTZ4MTZQcmVkaWN0aW9uKHBNYiwgZGF0YSwgaW1hZ2UtPmx1bWEsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgaW1hZ2UtPndpZHRoKjE2LCBjb25zdHJhaW5lZEludHJhUHJlZCkgIT0gSEFOVFJPX09LKQotICAgICAgICByZXR1cm4oSEFOVFJPX05PSyk7Ci0gICAgZm9yIChpID0gMDsgaSA8IDE2OyBpKyssIHRvdGFsQ29lZmYrKykKLSAgICB7Ci0gICAgICAgIHAgPSBkYXRhICsgbHVtYUluZGV4W2ldOwotICAgICAgICBwRGMgPSAmZGNbZGNDb2VmZkluZGV4W2ldXTsKLSAgICAgICAgaWYgKCp0b3RhbENvZWZmIHx8ICpwRGMpCi0gICAgICAgIHsKLSAgICAgICAgICAgIHJlc3VsdCA9IG9teFZDTTRQMTBfRGVxdWFudFRyYW5zZm9ybVJlc2lkdWFsRnJvbVBhaXJBbmRBZGQoCi0gICAgICAgICAgICAgICAgICAgIHBTcmMsCi0gICAgICAgICAgICAgICAgICAgIHAsCi0gICAgICAgICAgICAgICAgICAgIHBEYywKLSAgICAgICAgICAgICAgICAgICAgcCwKLSAgICAgICAgICAgICAgICAgICAgMTYsCi0gICAgICAgICAgICAgICAgICAgIDE2LAotICAgICAgICAgICAgICAgICAgICAoaTMyKXBNYi0+cXBZLAotICAgICAgICAgICAgICAgICAgICAqdG90YWxDb2VmZik7Ci0gICAgICAgICAgICBpZiAocmVzdWx0ICE9IE9NWF9TdHN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AgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbnN0IHU4ICoqcFNyYywKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBpbWFnZV90ICppbWFnZSkKLXsKLSAgICB1MzIgaTsKLSAgICB1OCAqdG90YWxDb2VmZjsKLSAgICBPTVhSZXN1bHQgcmVzdWx0OwotICAgIHU4ICpwOwotCi0gICAgdG90YWxDb2VmZiA9IHBNYi0+dG90YWxDb2VmZjsKLQotICAgIGZvciAoaSA9IDA7IGkgPCAxNjsgaSsrLCB0b3RhbENvZWZmKyspCi0gICAgewotICAgICAgICBwID0gZGF0YSArIGx1bWFJbmRleFtpXTsKLSAgICAgICAgaWYgKGgyNjRic2RJbnRyYTR4NFByZWRpY3Rpb24ocE1iLCBwLCBtYkxheWVyLCBpbWFnZS0+bHVtYSwKLSAgICAgICAgICAgICAgICAgICAgaW1hZ2UtPndpZHRoKjE2LCBjb25zdHJhaW5lZEludHJhUHJlZCwgaSkgIT0gSEFOVFJPX09LKQotICAgICAgICAgICAgcmV0dXJuKEhBTlRST19OT0spOwotCi0gICAgICAgIGlmICgqdG90YWxDb2VmZikKLSAgICAgICAgewotICAgICAgICAgICAgcmVzdWx0ID0gb214VkNNNFAxMF9EZXF1YW50VHJhbnNmb3JtUmVzaWR1YWxGcm9tUGFpckFuZEFkZCgKLSAgICAgICAgICAgICAgICAgICAgcFNyYywKLSAgICAgICAgICAgICAgICAgICAgcCwKLSAgICAgICAgICAgICAgICAgICAgTlVMTCwKLSAgICAgICAgICAgICAgICAgICAgcCwKLSAgICAgICAgICAgICAgICAgICAgMTYsCi0gICAgICAgICAgICAgICAgICAgIDE2LAotICAgICAgICAgICAgICAgICAgICAoaTMyKXBNYi0+cXBZLAotICAgICAgICAgICAgICAgICAgICAqdG90YWxDb2VmZik7Ci0gICAgICAgICAgICBpZiAocmVzdWx0ICE9IE9NWF9TdHNfTm9FcnIpCi0gICAgICAgICAgICAgICAgcmV0dXJuIChIQU5UUk9fTk9LKTsKLSAg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2NrRGMpWzE2XTsKLSAgICBpMTYgKnRvdGFsQ29lZmY7Ci0gICAgaTMyICpjaHJvbWFEYzsKLSAgICBjb25zdCB1MzIgKmRjQ29lZmZJZHg7Ci0KLS8qIENvZGUgKi8KLQotICAgIEFTU0VSVChwTWIpOwotICAgIEFTU0VSVChyZXNpZHVhbExldmVsKTsKLQotICAgIC8qIHNldCBwb2ludGVycyB0byBEQyBjb2VmZmljaWVudCBibG9ja3MgKi8KLSAgICBibG9ja0RjID0gcmVzaWR1YWxMZXZlbCArIDI0OwotCi0gICAgYmxvY2tEYXRhID0gcmVzaWR1YWxMZXZlbDsKLSAgICB0b3RhbENvZWZmID0gcE1iLT50b3RhbENvZWZmOwotICAgIGlmIChoMjY0YnNkTWJQYXJ0UHJlZE1vZGUocE1iLT5tYlR5cGUpID09IFBSRURfTU9ERV9JTlRSQTE2eDE2KQotICAgIHsKLSAgICAgICAgaWYgKHRvdGFsQ29lZmZbMjRdKQotICAgICAgICB7Ci0gICAgICAgICAgICBoMjY0YnNkUHJvY2Vzc0x1bWFEYygqYmxvY2tEYywgcE1iLT5xcFkpOwotICAgICAgICB9Ci0gICAgICAgIGRjQ29lZmZJZHggPSBkY0NvZWZmSW5kZXg7Ci0KLSAgICAgICAgZm9yIChpID0gMTY7IGktLTsgYmxvY2tEYXRhKyssIHRvdGFsQ29lZmYrKywgY29lZmZNYXArKykKLSAgICAgICAgewotICAgICAgICAgICAgLyogc2V0IGRjIGNvZWZmaWNpZW50IG9mIGx1bWEgYmxvY2sgKi8KLSAgICAgICAgICAgICgqYmxvY2tEYXRhKVswXSA9ICgqYmxvY2tEYylbKmRjQ29lZmZJZHgrK107Ci0gICAgICAgICAgICBpZiAoKCpibG9ja0RhdGEpWzBdIHx8ICp0b3RhbENvZWZmKQotICAgICAgICAgICAgewotICAgICAgICAgICAgICAgIGlmIChoMjY0YnNkUHJvY2Vzc0Jsb2NrKCpibG9ja0RhdGEsIHBNYi0+cXBZLCAxLCAqY29lZmZNYXApICE9Ci0gICAgICAgICAgICAgICAgICAgIEhBTlRST19PSykKLSAgICAgICAgICAgICAgICAgICAgcmV0dXJuKEhBTlRST19OT0spOwotICAgICAgICAgICAgfQotICAgICAgICAgICAgZWxzZQotICAgICAgICAgICAgICAgIE1BUktfUkVTSURVQUxfRU1QVFkoKmJsb2NrRGF0YSk7Ci0gICAgICAgIH0KLSAgICB9Ci0gICAgZWxzZQotICAgIHsKLSAgICAgICAgZm9yIChpID0gMTY7IGktLTsgYmxvY2tEYXRhKyssIHRvdGFsQ29lZmYrKywgY29lZmZNYXArKykKLSAgICAgICAgewotICAgICAgICAgICAgaWYgKCp0b3RhbENvZWZmKQotICAgICAgICAgICAgewotICAgICAgICAgICAgICAgIGlmIChoMjY0YnNkUHJvY2Vzc0Jsb2NrKCpibG9ja0RhdGEsIHBNYi0+cXBZLCAwLCAqY29lZmZNYXApICE9Ci0gICAgICAgICAgICAgICAgICAgIEhBTlRST19PSykKLSAgICAgICAgICAgICAgICAgICAgcmV0dXJuKEhBTlRST19OT0spOwotICAgICAgICAgICAgfQotICAgICAgICAgICAgZWxzZQotICAgICAgICAgICAgICAgIE1BUktfUkVTSURVQUxfRU1QVFkoKmJsb2NrRGF0YSk7Ci0gICAgICAgIH0KLSAgICB9Ci0KLSAgICAvKiBjaHJvbWEgREMgcHJvY2Vzc2luZy4gRmlyc3QgY2hyb21hIGRjIGJsb2NrIGlzIGJsb2NrIHdpdGggaW5kZXggMjUgKi8KLSAgICBjaHJvbWFRcCA9Ci0gICAgICAgIGgyNjRic2RRcENbQ0xJUDMoMCwgNTEsIChpMzIpcE1iLT5xcFkgKyBwTWItPmNocm9tYVFwSW5kZXhPZmZzZXQpXTsKLSAgICBpZiAocE1iLT50b3RhbENvZWZmWzI1XSB8fCBwTWItPnRvdGFsQ29lZmZbMjZdKQotICAgICAgICBoMjY0YnNkUHJvY2Vzc0Nocm9tYURjKHJlc2lkdWFsTGV2ZWxbMjVdLCBjaHJvbWFRcCk7Ci0gICAgY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Ci0KLSAgICAgICAgICAgIHBvYy0+cHJldkZyYW1lTnVtT2Zmc2V0ID0gZnJhbWVOdW1PZmZzZXQ7Ci0gICAgICAgICAgICBwb2MtPnByZXZGcmFtZU51bSA9IGk7Ci0KLSAgICAgICAgICAgIGkgPSAoaSArIDEpICUgc3BzLT5tYXhGcmFtZU51bTsKLQotICAgICAgICB9IHdoaWxlIChpICE9IHBTbGljZUhlYWRlci0+ZnJhbWVOdW0pOwotICAgIH0KLSNlbmRpZgotCi0gICAgLyogY2hlY2sgaWYgY3VycmVudCBzbGljZSBpbmNsdWRlcyBtbWNvIGVxdWFsIHRvIDUgKi8KLSAgICBjb250YWluc01tY281ID0gSEFOVFJPX0ZBTFNFOwotICAgIGlmIChwU2xpY2VIZWFkZXItPmRlY1JlZlBpY01hcmtpbmcuYWRhcHRpdmVSZWZQaWNNYXJraW5nTW9kZUZsYWcpCi0gICAgewotICAgICAgICBpID0gMDsKLSAgICAgICAgd2hpbGUgKHBTbGljZUhlYWRlci0+ZGVjUmVmUGljTWFya2luZy5vcGVyYXRpb25baV0uCi0gICAgICAgICAgICBtZW1vcnlNYW5hZ2VtZW50Q29udHJvbE9wZXJhdGlvbikKLSAgICAgICAgewotICAgICAgICAgICAgaWYgKHBTbGljZUhlYWRlci0+ZGVjUmVmUGljTWFya2luZy5vcGVyYXRpb25baV0uCi0gICAgICAgICAgICAgICAgbWVtb3J5TWFuYWdlbWVudENvbnRyb2xPcGVyYXRpb24gPT0gNSkKLSAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICBjb250YWluc01tY281ID0gSEFOVFJPX1RSVUU7Ci0gICAgICAgICAgICAgICAgYnJlYWs7Ci0gICAgICAgICAgICB9Ci0gICAgICAgICAgICBpKys7Ci0gICAgICAgIH0KLSAgICB9Ci0gICAgc3dpdGNoIChzcHMtPnBpY09yZGVyQ250VHlwZSkKLSAgICB7Ci0KLSAgICAgICAgY2FzZSAwOgotICAgICAgICAgICAgLyogc2V0IHByZXZQaWNPcmRlckNudCB2YWx1ZXMgZm9yIElEUiBmcmFtZSAqLwotICAgICAgICAgICAgaWYgKElTX0lEUl9OQUxfVU5JVChwTmFsVW5pdCkpCi0gICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgcG9jLT5wcmV2UGljT3JkZXJDbnRNc2IgPSAwOwotICAgICAgICAgICAgICAgIHBvYy0+cHJldlBpY09yZGVyQ250THNiID0gMDsKLSAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgLyogY29tcHV0ZSBwaWNPcmRlckNudE1zYiAoc3RvcmVkIGluIHBpY09yZGVyQ250IHZhcmlhYmxlKSAqLwotICAgICAgICAgICAgaWYgKCAocFNsaWNlSGVhZGVyLT5waWNPcmRlckNudExzYiA8IHBvYy0+cHJldlBpY09yZGVyQ250THNiKSAmJgotICAgICAgICAgICAgICAgICgocG9jLT5wcmV2UGljT3JkZXJDbnRMc2IgLSBwU2xpY2VIZWFkZXItPnBpY09yZGVyQ250THNiKSA+PQotICAgICAgICAgICAgICAgICBzcHMtPm1heFBpY09yZGVyQ250THNiLzIpICkKLSAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICBwaWNPcmRlckNudCA9IHBvYy0+cHJldlBpY09yZGVyQ250TXNiICsKLSAgICAgICAgICAgICAgICAgICAgKGkzMilzcHMtPm1heFBpY09yZGVyQ250THNiOwotICAgICAgICAgICAgfQotICAgICAgICAgICAgZWxzZSBpZiAoKHBTbGljZUhlYWRlci0+cGljT3JkZXJDbnRMc2IgPiBwb2MtPnByZXZQaWNPcmRlckNudExzYikgJiYKLSAgICAgICAgICAgICAgICAoKHBTbGljZUhlYWRlci0+cGljT3JkZXJDbnRMc2IgLSBwb2MtPnByZXZQaWNPcmRlckNudExzYikgPgotICAgICAgICAgICAgICAgICBzcHMtPm1heFBpY09yZGVyQ250THNiLzIpICkKLSAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICBwaWNPcmRlckNudCA9IHBvYy0+cHJldlBpY09yZGVyQ250TXNiIC0KLSAgICAgICAgICAgICAgICAgICAgKGkzMilzcHMtPm1heFBpY09yZGVyQ250THNiOwotICAgICAgICAgICAgfQotICAgICAgICAgICAgZWxzZQotICAgICAgICAgICAgICAgIHBpY09yZGVyQ250ID0gcG9jLT5wcmV2UGljT3JkZXJDbnRNc2I7Ci0KLSAgICAgICAgICAgIC8qIHN0YW5kYXJkIHNwZWNpZmllcyB0aGF0IHByZXZQaWNPcmRlckNudE1zYiBpcyBmcm9tIHByZXZpb3VzCi0gICAgICAgICAgICAgKiByZXJlcmVuY2UgZnJhbWUgLT4gcmVwbGFjZSBvbGQgdmFsdWUgb25seSBpZiBjdXJyZW50IGZyYW1lIGlzCi0gICAgICAgICAgICAgKiByZXJlcmVuY2UgZnJhbWUgKi8KLSAgICAgICAgICAgIGlmIChwTmFsVW5pdC0+bmFsUmVmSWRjKQotICAgICAgICAgICAgICAgIHBvYy0+cHJldlBpY09yZGVyQ250TXNiID0gcGljT3JkZXJDbnQ7Ci0KLSAgICAgICAgICAgIC8qIGNvbXB1dGUgdG9wIGZpZWxkIG9yZGVyIGNudCAoc3RvcmVkIGluIHBpY09yZGVyQ250KSAqLwotICAgICAgICAgICAgcGljT3JkZXJDbnQgKz0gKGkzMilwU2xpY2VIZWFkZXItPnBpY09yZGVyQ250THNiOwotCi0gICAgICAgICAgICAvKiBpZiBkZWx0YSBmb3IgYm90dG9tIGZpZWxkIGlzIG5lZ2F0aXZlIC0+IGJvdHRvbSB3aWxsIGJlIHRoZQotICAgICAgICAgICAgICogbWluaW11bSBwaWMgb3JkZXIgY291bnQgKi8KLSAgICAgICAgICAgIGlmIChwU2xpY2VIZWFkZXItPmRlbHRhUGljT3JkZXJDbnRCb3R0b20gPCAwKQotICAgICAgICAgICAgICAgIHBpY09yZGVyQ250ICs9IHBTbGljZUhlYWRlci0+ZGVsdGFQaWNPcmRlckNudEJvdHRvbTsKLQotICAgICAgICAgICAgLyogc3RhbmRhcmQgc3BlY2lmaWVzIHRoYXQgcHJldlBpY09yZGVyQ250THNiIGlzIGZyb20gcHJldmlvdXMKLSAgICAgICAgICAgICAqIHJlcmVyZW5jZSBmcmFtZSAtPiByZXBsYWNlIG9sZCB2YWx1ZSBvbmx5IGlmIGN1cnJlbnQgZnJhbWUgaXMKLSAgICAgICAgICAgICAqIHJlcmVyZW5jZSBmcmFtZSAqLwotICAgICAgICAgICAgaWYgKHBOYWxVbml0LT5uYWxSZWZJZGMpCi0gICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgLyogaWYgY3VycmVudCBmcmFtZSBjb250YWlucyBtbWNvNSAtPiBtb2RpZnkgdmFsdWVzIHRvIGJlCi0gICAgICAgICAgICAgICAgICogc3RvcmVkICovCi0gICAgICAgICAgICAgICAgaWYgKGNvbnRhaW5zTW1jbzUpCi0gICAgICAgICAgICAgICAgewotICAgICAgICAgICAgICAgICAgICBwb2MtPnByZXZQaWNPcmRlckNudE1zYiA9IDA7Ci0gICAgICAgICAgICAgICAgICAgIC8qIHByZXZQaWNPcmRlckNudExzYiBzaG91bGQgYmUgdGhlIHRvcCBmaWVsZCBwaWNPcmRlckNudAotICAgICAgICAgICAgICAgICAgICAgKiBpZiBwcmV2aW91cyBmcmFtZSBpbmNsdWRlZCBtbWNvNS4gVG9wIGZpZWxkIHBpY09yZGVyQ250Ci0gICAgICAgICAgICAgICAgICAgICAqIGZvciBmcmFtZXMgY29udGFpbmluZyBtbWNvNSBpcyBvYnRhaW5lZCBieSBzdWJ0cmFjdGluZwotICAgICAgICAgICAgICAgICAgICAgKiB0aGUgcGljT3JkZXJDbnQgZnJvbSBvcmlnaW5hbCB0b3AgZmllbGQgb3JkZXIgY291bnQgLT4KLSAgICAgICAgICAgICAgICAgICAgICogdmFsdWUgaXMgemVybyBpZiB0b3AgZmllbGQgd2FzIHRoZSBtaW5pbXVtLCBpLmUuIGRlbHRhCi0gICAgICAgICAgICAgICAgICAgICAqIGZvciBib3R0b20gd2FzIHBvc2l0aXZlLCBvdGhlcndpc2UgdmFsdWUgaXMKLSAgICAgICAgICAgICAgICAgICAgICogLWRlbHRhUGljT3JkZXJDbnRCb3R0b20gKi8KLSAgICAgICAgICAgICAgICAgICAgaWYgKHBTbGljZUhlYWRlci0+ZGVsdGFQaWNPcmRlckNudEJvdHRvbSA8IDApCi0gICAgICAgICAgICAgICAgICAgICAgICBwb2MtPnByZXZQaWNPcmRlckNudExzYiA9Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgKHUzMikoLXBTbGljZUhlYWRlci0+ZGVsdGFQaWNPcmRlckNudEJvdHRvbSk7Ci0gICAgICAgICAgICAgICAgICAgIGVsc2UKLSAgICAgICAgICAgICAgICAgICAgICAgIHBvYy0+cHJldlBpY09yZGVyQ250THNiID0gMDsKLSAgICAgICAgICAgICAgICAgICAgcGljT3JkZXJDbnQgPSAwOwotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICBlbHNlCi0gICAgICAgICAgICAgICAgewotICAgICAgICAgICAgICAgICAgICBwb2MtPnByZXZQaWNPcmRlckNudExzYiA9IHBTbGljZUhlYWRlci0+cGljT3JkZXJDbnRMc2I7Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgfQotCi0gICAgICAgICAgICBicmVhazsKLQotICAgICAgICBjYXNlIDE6Ci0KLSAgICAgICAgICAgIC8qIHN0ZXAgMSAoaW4gdGhlIGRlc2NyaXB0aW9uIGluIHRoZSBzdGFuZGFyZCkgKi8KLSAgICAgICAgICAgIGlmIChJU19JRFJfTkFMX1VOSVQocE5hbFVuaXQpKQotICAgICAgICAgICAgICAgIGZyYW1lTnVtT2Zmc2V0ID0gMDsKLSAgICAgICAgICAgIGVsc2UgaWYgKHBvYy0+cHJldkZyYW1lTnVtID4gcFNsaWNlSGVhZGVyLT5mcmFtZU51bSkKLSAgICAgICAgICAgICAgICBmcmFtZU51bU9mZnNldCA9IHBvYy0+cHJldkZyYW1lTnVtT2Zmc2V0ICsgc3BzLT5tYXhGcmFtZU51bTsKLSAgICAgICAgICAgIGVsc2UKLSAgICAgICAgICAgICAgICBmcmFtZU51bU9mZnNldCA9IHBvYy0+cHJldkZyYW1lTnVtT2Zmc2V0OwotCi0gICAgICAgICAgICAvKiBzdGVwIDIgKi8KLSAgICAgICAgICAgIGlmIChzcHMtPm51bVJlZkZyYW1lc0luUGljT3JkZXJDbnRDeWNsZSkKLSAgICAgICAgICAgICAgICBhYnNGcmFtZU51bSA9IGZyYW1lTnVtT2Zmc2V0ICsgcFNsaWNlSGVhZGVyLT5mcmFtZU51bTsKLSAgICAgICAgICAgIGVsc2UKLSAgICAgICAgICAgICAgICBhYnNGcmFtZU51bSA9IDA7Ci0KLSAgICAgICAgICAgIGlmIChwTmFsVW5pdC0+bmFsUmVmSWRjID09IDAgJiYgYWJzRnJhbWVOdW0gPiAwKQotICAgICAgICAgICAgICAgIGFic0ZyYW1lTnVtIC09IDE7Ci0KLSAgICAgICAgICAgIC8qIHN0ZXAgMyAqLwotICAgICAgICAgICAgaWYgKGFic0ZyYW1lTnVtID4gMCkKLSAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICBwaWNPcmRlckNudEN5Y2xlQ250ID0KLSAgICAgICAgICAgICAgICAgICAgKGFic0ZyYW1lTnVtIC0gMSkvc3BzLT5udW1SZWZGcmFtZXNJblBpY09yZGVyQ250Q3ljbGU7Ci0gICAgICAgICAgICAgICAgZnJhbWVOdW1JblBpY09yZGVyQ250Q3ljbGUgPQotICAgICAgICAgICAgICAgICAgICAoYWJzRnJhbWVOdW0gLSAxKSVzcHMtPm51bVJlZkZyYW1lc0luUGljT3JkZXJDbnRDeWNsZTsKLSAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgLyogc3RlcCA0ICovCi0gICAgICAgICAgICBleHBlY3RlZERlbHRhUGljT3JkZXJDbnRDeWNsZSA9IDA7Ci0gICAgICAgICAgICBmb3IgKGkgPSAwOyBpIDwgc3BzLT5udW1SZWZGcmFtZXNJblBpY09yZGVyQ250Q3ljbGU7IGkrKykKLSAgICAgICAgICAgICAgICBleHBlY3RlZERlbHRhUGljT3JkZXJDbnRDeWNsZSArPSBzcHMtPm9mZnNldEZvclJlZkZyYW1lW2ldOwotCi0gICAgICAgICAgICAvKiBzdGVwIDUgKHBpY09yZGVyQ250IHVzZWQgdG8gc3RvcmUgZXhwZWN0ZWRQaWNPcmRlckNudCkgKi8KLSAgICAgICAgICAgIC8qbGludCAtZXN5bSg2NDQscGljT3JkZXJDbnRDeWNsZUNudCkgYWx3YXlzIGluaXRpYWxpemVkICovCi0gICAgICAgICAgICAvKmxpbnQgLWVzeW0oNjQ0LGZyYW1lTnVtSW5QaWNPcmRlckNudEN5Y2xlKSBhbHdheXMgaW5pdGlhbGl6ZWQgKi8KLSAgICAgICAgICAgIGlmIChhYnNGcmFtZU51bSA+IDApCi0gICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgcGljT3JkZXJDbnQgPQotICAgICAgICAgICAgICAgICAgICAoaTMyKXBpY09yZGVyQ250Q3ljbGVDbnQgKiBleHBlY3RlZERlbHRhUGljT3JkZXJDbnRDeWNsZTsKLSAgICAgICAgICAgICAgICBmb3IgKGkgPSAwOyBpIDw9IGZyYW1lTnVtSW5QaWNPcmRlckNudEN5Y2xlOyBpKyspCi0gICAgICAgICAgICAgICAgICAgIHBpY09yZGVyQ250ICs9IHNwcy0+b2Zmc2V0Rm9yUmVmRnJhbWVbaV07Ci0gICAgICAgICAgICB9Ci0gICAgICAgICAgICBlbHNlCi0gICAgICAgICAgICAgICAgcGljT3JkZXJDbnQgPSAwOwotCi0gICAgICAgICAgICBpZiAocE5hbFVuaXQtPm5hbFJlZklkYyA9PSAwKQotICAgICAgICAgICAgICAgIHBpY09yZGVyQ250ICs9IHNwcy0+b2Zmc2V0Rm9yTm9uUmVmUGljOwotCi0gICAgICAgICAgICAvKiBzdGVwIDYgKHBpY09yZGVyQ250IGlzIHRvcCBmaWVsZCBvcmRlciBjbnQgaWYgZGVsdGEgZm9yIGJvdHRvbQotICAgICAgICAgICAgICogaXMgcG9zaXRpdmUsIG90aGVyd2lzZSBpdCBpcyBib3R0b20gZmllbGQgb3JkZXIgY250KSAqLwotICAgICAgICAgICAgcGljT3JkZXJDbnQgKz0gcFNsaWNlSGVhZGVyLT5kZWx0YVBpY09yZGVyQ250WzBdOwotCi0gICAgICAgICAgICBpZiAoIChzcHMtPm9mZnNldEZvclRvcFRvQm90dG9tRmllbGQgKwotICAgICAgICAgICAgICAgICAgICBwU2xpY2VIZWFkZXItPmRlbHRhUGljT3JkZXJDbnRbMV0pIDwgMCApCi0gICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgcGljT3JkZXJDbnQgKz0gc3BzLT5vZmZzZXRGb3JUb3BUb0JvdHRvbUZpZWxkICsKLSAgICAgICAgICAgICAgICAgICAgcFNsaWNlSGVhZGVyLT5kZWx0YVBpY09yZGVyQ250WzFdOwotICAgICAgICAgICAgfQotCi0gICAgICAgICAgICAvKiBpZiBjdXJyZW50IHBpY3R1cmUgY29udGFpbnMgbW1jbzUgLT4gc2V0IHByZXZGcmFtZU51bU9mZnNldCBhbmQKLSAgICAgICAgICAgICAqIHByZXZGcmFtZU51bSB0byAwIGZvciBjb21wdXRhdGlvbiBvZiBwaWNPcmRlckNudCBvZiBuZXh0Ci0gICAgICAgICAgICAgKiBmcmFtZSwgb3RoZXJ3aXNlIHN0b3JlIGZyYW1lTnVtIGFuZCBmcmFtZU51bU9mZnNldCB0byBwb2MKLSAgICAgICAgICAgICAqIHN0cnVjdHVyZSAqLwotICAgICAgICAgICAgaWYgKCFjb250YWluc01tY281KQotICAgICAgICAgICAgewotICAgICAgICAgICAgICAgIHBvYy0+cHJldkZyYW1lTnVtT2Zmc2V0ID0gZnJhbWVOdW1PZmZzZXQ7Ci0gICAgICAgICAgICAgICAgcG9jLT5wcmV2RnJhbWVOdW0gPSBwU2xpY2VIZWFkZXItPmZyYW1lTnVtOwotICAgICAgICAgICAgfQotICAgICAgICAgICAgZWxzZQotICAgICAgICAgICAgewotICAgICAgICAgICAgICAgIHBvYy0+cHJldkZyYW1lTnVtT2Zmc2V0ID0gMDsKLSAgICAgICAgICAgICAgICBwb2MtPnByZXZGcmFtZU51bSA9IDA7Ci0gICAgICAgICAgICAgICAgcGljT3JkZXJDbnQgPSAwOwotICAgICAgICAgICAgfQotICAgICAgICAgICAgYnJlYWs7Ci0KLSAgICAgICAgZGVmYXVsdDogLyogY2FzZSAyICovCi0gICAgICAgICAgICAvKiBkZXJpdmUgZnJhbWVOdW1PZmZzZXQgKi8KLSAgICAgICAgICAgIGlmIChJU19JRFJfTkFMX1VOSVQocE5hbFVuaXQpKQotICAgICAgICAgICAgICAgIGZyYW1lTnVtT2Zmc2V0ID0gMDsKLSAgICAgICAgICAgIGVsc2UgaWYgKHBvYy0+cHJldkZyYW1lTnVtID4gcFNsaWNlSGVhZGVyLT5mcmFtZU51bSkKLSAgICAgICAgICAgICAgICBmcmFtZU51bU9mZnNldCA9IHBvYy0+cHJldkZyYW1lTnVtT2Zmc2V0ICsgc3BzLT5tYXhGcmFtZU51bTsKLSAgICAgICAgICAgIGVsc2UKLSAgICAgICAgICAgICAgICBmcmFtZU51bU9mZnNldCA9IHBvYy0+cHJldkZyYW1lTnVtT2Zmc2V0OwotCi0gICAgICAgICAgICAvKiBkZXJpdmUgcGljT3JkZXJDbnQgKHR5cGUgMiBoYXMgc2FtZSB2YWx1ZSBmb3IgdG9wIGFuZCBib3R0b20KLSAgICAgICAgICAgICAqIGZpZWxkIG9yZGVyIGNudHMpICovCi0gICAgICAgICAgICBpZiAoSVNfSURSX05BTF9VTklUKHBOYWxVbml0KSkKLSAgICAgICAgICAgICAgICBwaWNPcmRlckNudCA9IDA7Ci0gICAgICAgICAgICBlbHNlIGlmIChwTmFsVW5pdC0+bmFsUmVmSWRjID09IDApCi0gICAgICAgICAgICAgICAgcGljT3JkZXJDbnQgPQotICAgICAgICAgICAgICAgICAgICAyICogKGkzMikoZnJhbWVOdW1PZmZzZXQgKyBwU2xpY2VIZWFkZXItPmZyYW1lTnVtKSAtIDE7Ci0gICAgICAgICAgICBlbHNlCi0gICAgICAgICAgICAgICAgcGljT3JkZXJDbnQgPQotICAgICAgICAgICAgICAgICAgICAyICogKGkzMikoZnJhbWVOdW1PZmZzZXQgKyBwU2xpY2VIZWFkZXItPmZyYW1lTnVtKTsKLQotICAgICAgICAgICAgLyogaWYgY3VycmVudCBwaWN0dXJlIGNvbnRhaW5zIG1tY281IC0+IHNldCBwcmV2RnJhbWVOdW1PZmZzZXQgYW5kCi0gICAgICAgICAgICAgKiBwcmV2RnJhbWVOdW0gdG8gMCBmb3IgY29tcHV0YXRpb24gb2YgcGljT3JkZXJDbnQgb2YgbmV4dAotICAgICAgICAgICAgICogZnJhbWUsIG90aGVyd2lzZSBzdG9yZSBmcmFtZU51bSBhbmQgZnJhbWVOdW1PZmZzZXQgdG8gcG9jCi0gICAgICAgICAgICAgKiBzdHJ1Y3R1cmUgKi8KLSAgICAgICAgICAgIGlmICghY29udGFpbnNNbWNvNSkKLSAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICBwb2MtPnByZXZGcmFtZU51bU9mZnNldCA9IGZyYW1lTnVtT2Zmc2V0OwotICAgICAgICAgICAgICAgIHBvYy0+cHJldkZyYW1lTnVtID0gcFNsaWNlSGVhZGVyLT5mcmFtZU51bTsKLSAgICAgICAgICAgIH0KLSAgICAgICAgICAgIGVsc2UKLSAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICBwb2MtPnByZXZGcmFtZU51bU9mZnNldCA9IDA7Ci0gICAgICAgICAgICAgICAgcG9jLT5wcmV2RnJhbWVOdW0gPSAwOwotICAgICAgICAgICAgICAgIHBpY09yZGVyQ250ID0gMDsKLSAgICAgICAgICAgIH0KLSAgICAgICAgICAgIGJyZWFrOwotCi0gICAgfQotCi0gICAgLypsaW50IC1lc3ltKDY0NCxwaWNPcmRlckNudCkgYWx3YXlzIGluaXRpYWxpemVkICovCi0gICAgcmV0dXJuKHBpY09yZGVyQ250KTsKLQotfQotCmRpZmY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GhhbiBvbmUgc2xpY2UgZ3JvdXBzICovCi0gICAgaWYgKHBQaWNQYXJhbVNldC0+bnVtU2xpY2VHcm91cHMgPiAxKQotICAgIHsKLSAgICAgICAgdG1wID0gaDI2NGJzZERlY29kZUV4cEdvbG9tYlVuc2lnbmVkKHBTdHJtRGF0YSwKLSAgICAgICAgICAgICZwUGljUGFyYW1TZXQtPnNsaWNlR3JvdXBNYXBUeXBlKTsKLSAgICAgICAgaWYgKHRtcCAhPSBIQU5UUk9fT0spCi0gICAgICAgICAgICByZXR1cm4odG1wKTsKLSAgICAgICAgaWYgKHBQaWNQYXJhbVNldC0+c2xpY2VHcm91cE1hcFR5cGUgPiA2KQotICAgICAgICB7Ci0gICAgICAgICAgICBFUFJJTlQoInNsaWNlX2dyb3VwX21hcF90eXBlIik7Ci0gICAgICAgICAgICByZXR1cm4oSEFOVFJPX05PSyk7Ci0gICAgICAgIH0KLQotICAgICAgICBpZiAocFBpY1BhcmFtU2V0LT5zbGljZUdyb3VwTWFwVHlwZSA9PSAwKQotICAgICAgICB7Ci0gICAgICAgICAgICBBTExPQ0FURShwUGljUGFyYW1TZXQtPnJ1bkxlbmd0aCwKLSAgICAgICAgICAgICAgICBwUGljUGFyYW1TZXQtPm51bVNsaWNlR3JvdXBzLCB1MzIpOwotICAgICAgICAgICAgaWYgKHBQaWNQYXJhbVNldC0+cnVuTGVuZ3RoID09IE5VTEwpCi0gICAgICAgICAgICAgICAgcmV0dXJuKE1FTU9SWV9BTExPQ0FUSU9OX0VSUk9SKTsKLSAgICAgICAgICAgIGZvciAoaSA9IDA7IGkgPCBwUGljUGFyYW1TZXQtPm51bVNsaWNlR3JvdXBzOyBpKyspCi0gICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgdG1wID0gaDI2NGJzZERlY29kZUV4cEdvbG9tYlVuc2lnbmVkKHBTdHJtRGF0YSwgJnZhbHVlKTsKLSAgICAgICAgICAgICAgICBpZiAodG1wICE9IEhBTlRST19PSykKLSAgICAgICAgICAgICAgICAgICAgcmV0dXJuKHRtcCk7Ci0gICAgICAgICAgICAgICAgcFBpY1BhcmFtU2V0LT5ydW5MZW5ndGhbaV0gPSB2YWx1ZSsxOwotICAgICAgICAgICAgICAgIC8qIHBhcmFtIHZhbHVlcyBjaGVja2VkIGluIENoZWNrUHBzKCkgKi8KLSAgICAgICAgICAgIH0KLSAgICAgICAgfQotICAgICAgICBlbHNlIGlmIChwUGljUGFyYW1TZXQtPnNsaWNlR3JvdXBNYXBUeXBlID09IDIpCi0gICAgICAgIHsKLSAgICAgICAgICAgIEFMTE9DQVRFKHBQaWNQYXJhbVNldC0+dG9wTGVmdCwKLSAgICAgICAgICAgICAgICBwUGljUGFyYW1TZXQtPm51bVNsaWNlR3JvdXBzIC0gMSwgdTMyKTsKLSAgICAgICAgICAgIEFMTE9DQVRFKHBQaWNQYXJhbVNldC0+Ym90dG9tUmlnaHQsCi0gICAgICAgICAgICAgICAgcFBpY1BhcmFtU2V0LT5udW1TbGljZUdyb3VwcyAtIDEsIHUzMik7Ci0gICAgICAgICAgICBpZiAocFBpY1BhcmFtU2V0LT50b3BMZWZ0ID09IE5VTEwgfHwKLSAgICAgICAgICAgICAgICBwUGljUGFyYW1TZXQtPmJvdHRvbVJpZ2h0ID09IE5VTEwpCi0gICAgICAgICAgICAgICAgcmV0dXJuKE1FTU9SWV9BTExPQ0FUSU9OX0VSUk9SKTsKLSAgICAgICAgICAgIGZvciAoaSA9IDA7IGkgPCBwUGljUGFyYW1TZXQtPm51bVNsaWNlR3JvdXBzIC0gMTsgaSsrKQotICAgICAgICAgICAgewotICAgICAgICAgICAgICAgIHRtcCA9IGgyNjRic2REZWNvZGVFeHBHb2xvbWJVbnNpZ25lZChwU3RybURhdGEsICZ2YWx1ZSk7Ci0gICAgICAgICAgICAgICAgaWYgKHRtcCAhPSBIQU5UUk9fT0spCi0gICAgICAgICAgICAgICAgICAgIHJldHVybih0bXApOwotICAgICAgICAgICAgICAgIHBQaWNQYXJhbVNldC0+dG9wTGVmdFtpXSA9IHZhbHVlOwotICAgICAgICAgICAgICAgIHRtcCA9IGgyNjRic2REZWNvZGVFeHBHb2xvbWJVbnNpZ25lZChwU3RybURhdGEsICZ2YWx1ZSk7Ci0gICAgICAgICAgICAgICAgaWYgKHRtcCAhPSBIQU5UUk9fT0spCi0gICAgICAgICAgICAgICAgICAgIHJldHVybih0bXApOwotICAgICAgICAgICAgICAgIHBQaWNQYXJhbVNldC0+Ym90dG9tUmlnaHRbaV0gPSB2YWx1ZTsKLSAgICAgICAgICAgICAgICAvKiBwYXJhbSB2YWx1ZXMgY2hlY2tlZCBpbiBDaGVja1BwcygpICovCi0gICAgICAgICAgICB9Ci0gICAgICAgIH0KLSAgICAgICAgZWxzZSBpZiAoIChwUGljUGFyYW1TZXQtPnNsaWNlR3JvdXBNYXBUeXBlID09IDMpIHx8Ci0gICAgICAgICAgICAgICAgICAocFBpY1BhcmFtU2V0LT5zbGljZUdyb3VwTWFwVHlwZSA9PSA0KSB8fAotICAgICAgICAgICAgICAgICAgKHBQaWNQYXJhbVNldC0+c2xpY2VHcm91cE1hcFR5cGUgPT0gNSkgKQotICAgICAgICB7Ci0gICAgICAgICAgICB0bXAgPSBoMjY0YnNkR2V0Qml0cyhwU3RybURhdGEsIDEpOwotICAgICAgICAgICAgaWYgKHRtcCA9PSBFTkRfT0ZfU1RSRUFNKQotICAgICAgICAgICAgICAgIHJldHVybihIQU5UUk9fTk9LKTsKLSAgICAgICAgICAgIHBQaWNQYXJhbVNldC0+c2xpY2VHcm91cENoYW5nZURpcmVjdGlvbkZsYWcgPQotICAgICAgICAgICAgICAgICh0bXAgPT0gMSkgPyBIQU5UUk9fVFJVRSA6IEhBTlRST19GQUxTRTsKLSAgICAgICAgICAgIHRtcCA9IGgyNjRic2REZWNvZGVFeHBHb2xvbWJVbnNpZ25lZChwU3RybURhdGEsICZ2YWx1ZSk7Ci0gICAgICAgICAgICBpZiAodG1wICE9IEhBTlRST19PSykKLSAgICAgICAgICAgICAgICByZXR1cm4odG1wKTsKLSAgICAgICAgICAgIHBQaWNQYXJhbVNldC0+c2xpY2VHcm91cENoYW5nZVJhdGUgPSB2YWx1ZSArIDE7Ci0gICAgICAgICAgICAvKiBwYXJhbSB2YWx1ZSBjaGVja2VkIGluIENoZWNrUHBzKCkgKi8KLSAgICAgICAgfQotICAgICAgICBlbHNlIGlmIChwUGljUGFyYW1TZXQtPnNsaWNlR3JvdXBNYXBUeXBlID09IDYpCi0gICAgICAgIHsKLSAgICAgICAgICAgIHRtcCA9IGgyNjRic2REZWNvZGVFeHBHb2xvbWJVbnNpZ25lZChwU3RybURhdGEsICZ2YWx1ZSk7Ci0gICAgICAgICAgICBpZiAodG1wICE9IEhBTlRST19PSykKLSAgICAgICAgICAgICAgICByZXR1cm4odG1wKTsKLSAgICAgICAgICAgIHBQaWNQYXJhbVNldC0+cGljU2l6ZUluTWFwVW5pdHMgPSB2YWx1ZSArIDE7Ci0KLSAgICAgICAgICAgIEFMTE9DQVRFKHBQaWNQYXJhbVNldC0+c2xpY2VHcm91cElkLAotICAgICAgICAgICAgICAgIHBQaWNQYXJhbVNldC0+cGljU2l6ZUluTWFwVW5pdHMsIHUzMik7Ci0gICAgICAgICAgICBpZiAocFBpY1BhcmFtU2V0LT5zbGljZUdyb3VwSWQgPT0gTlVMTCkKLSAgICAgICAgICAgICAgICByZXR1cm4oTUVNT1JZX0FMTE9DQVRJT05fRVJST1IpOwotCi0gICAgICAgICAgICAvKiBkZXRlcm1pbmUgbnVtYmVyIG9mIGJpdHMgbmVlZGVkIHRvIHJlcHJlc2VudCByYW5nZQotICAgICAgICAgICAgICogWzAsIG51bVNsaWNlR3JvdXBzKSAqLwotICAgICAgICAgICAgdG1wID0gQ2VpbExvZzJOdW1TbGljZUdyb3Vwc1twUGljUGFyYW1TZXQtPm51bVNsaWNlR3JvdXBzLTFdOwotCi0gICAgICAgICAgICBmb3IgKGkgPSAwOyBpIDwgcFBpY1BhcmFtU2V0LT5waWNTaXplSW5NYXBVbml0czsgaSsrKQotICAgICAgICAgICAgewotICAgICAgICAgICAgICAgIHBQaWNQYXJhbVNldC0+c2xpY2VHcm91cElkW2ldID0gaDI2NGJzZEdldEJpdHMocFN0cm1EYXRhLCB0bXApOwotICAgICAgICAgICAgICAgIGlmICggcFBpY1BhcmFtU2V0LT5zbGljZUdyb3VwSWRbaV0gPj0KLSAgICAgICAgICAgICAgICAgICAgIHBQaWNQYXJhbVNldC0+bnVtU2xpY2VHcm91cHMgKQotICAgICAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAgICAgRVBSSU5UKCJzbGljZV9ncm91cF9pZCIpOwotICAgICAgICAgICAgICAgICAgICByZXR1cm4oSEFOVFJPX05PSyk7Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgfQotICAgICAgICB9Ci0gICAgfQotCi0gICAgLyogbnVtX3JlZl9pZHhfbDBfYWN0aXZlX21pbnVzMSAqLwotICAgIHRtcCA9IGgyNjRic2REZWNvZGVFeHBHb2xvbWJVbnNpZ25lZChwU3RybURhdGEsICZ2YWx1ZSk7Ci0gICAgaWYgKHRtcCAhPSBIQU5UUk9fT0spCi0gICAgICAgIHJldHVybih0bXApOwotICAgIGlmICh2YWx1ZSA+IDMxKQotICAgIHsKLSAgICAgICAgRVBSSU5UKCJudW1fcmVmX2lkeF9sMF9hY3RpdmVfbWludXMxIik7Ci0gICAgICAgIHJldHVybihIQU5UUk9fTk9LKTsKLSAgICB9Ci0gICAgcFBpY1BhcmFtU2V0LT5udW1SZWZJZHhMMEFjdGl2ZSA9IHZhbHVlICsgMTsKLQotICAgIC8qIG51bV9yZWZfaWR4X2wxX2FjdGl2ZV9taW51czEgKi8KLSAgICB0bXAgPSBoMjY0YnNkRGVjb2RlRXhwR29sb21iVW5zaWduZWQocFN0cm1EYXRhLCAmdmFsdWUpOwotICAgIGlmICh0bXAgIT0gSEFOVFJPX09LKQotICAgICAgICByZXR1cm4odG1wKTsKLSAgICBpZiAodmFsdWUgPiAzMSkKLSAgICB7Ci0gICAgICAgIEVQUklOVCgibnVtX3JlZl9pZHhfbDFfYWN0aXZlX21pbnVzMSIpOwotICAgICAgICByZXR1cm4oSEFOVFJPX05PSyk7Ci0gICAgfQotCi0gICAgLyogd2VpZ2h0ZWRfcHJlZF9mbGFnLCB0aGlzIHNoYWxsIGJlIDAgZm9yIGJhc2VsaW5lIHByb2ZpbGUgKi8KLSAgICB0bXAgPSBoMjY0YnNkR2V0Qml0cyhwU3RybURhdGEsIDEpOwotICAgIGlmICh0bXApCi0gICAgewotICAgICAgICBFUFJJTlQoIndlaWdodGVkX3ByZWRfZmxhZyIpOwotICAgICAgICByZXR1cm4oSEFOVFJPX05PSyk7Ci0gICAgfQotCi0gICAgLyogd2VpZ2h0ZWRfYmlwcmVkX2lkYyAqLwotICAgIHRtcCA9IGgyNjRic2RHZXRCaXRzKHBTdHJtRGF0YSwgMik7Ci0gICAgaWYgKHRtcCA+IDIpCi0gICAgewotICAgICAgICBFUFJJTlQoIndlaWdodGVkX2JpcHJlZF9pZGMiKTsKLSAgICAgICAgcmV0dXJuKEhBTlRST19OT0spOwotICAgIH0KLQotICAgIC8qIHBpY19pbml0X3FwX21pbnVzMjYgKi8KLSAgICB0bXAgPSBoMjY0YnNkRGVjb2RlRXhwR29sb21iU2lnbmVkKHBTdHJtRGF0YSwgJml0bXApOwotICAgIGlmICh0bXAgIT0gSEFOVFJPX09LKQotICAgICAgICByZXR1cm4odG1wKTsKLSAgICBpZiAoKGl0bXAgPCAtMjYpIHx8IChpdG1wID4gMjUpKQotICAgIHsKLSAgICAgICAgRVBSSU5UKCJwaWNfaW5pdF9xcF9taW51czI2Iik7Ci0gICAgICAgIHJldHVybihIQU5UUk9fTk9LKTsKLSAgICB9Ci0gICAgcFBpY1BhcmFtU2V0LT5waWNJbml0UXAgPSAodTMyKShpdG1wICsgMjYpOwotCi0gICAgLyogcGljX2luaXRfcXNfbWludXMyNiAqLwotICAgIHRtcCA9IGgyNjRic2REZWNvZGVFeHBHb2xvbWJTaWduZWQocFN0cm1EYXRhLCAmaXRtcCk7Ci0gICAgaWYgKHRtcCAhPSBIQU5UUk9fT0spCi0gICAgICAgIHJldHVybih0bXApOwotICAgIGlmICgoaXRtcCA8IC0yNikgfHwgKGl0bXAgPiAyNSkpCi0gICAgewotICAgICAgICBFUFJJTlQoInBpY19pbml0X3FzX21pbnVzMjYiKTsKLSAgICAgICAgcmV0dXJuKEhBTlRST19OT0spOwotICAgIH0KLQotICAgIHRtcCA9IGgyNjRic2REZWNvZGVFeHBHb2xvbWJTaWduZWQocFN0cm1EYXRhLCAmaXRtcCk7Ci0gICAgaWYgKHRtcCAhPSBIQU5UUk9fT0spCi0gICAgICAgIHJldHVybih0bXApOwotICAgIGlmICgoaXRtcCA8IC0xMikgfHwgKGl0bXAgPiAxMikpCi0gICAgewotICAgICAgICBFUFJJTlQoImNocm9tYV9xcF9pbmRleF9vZmZzZXQiKTsKLSAgICAgICAgcmV0dXJuKEhBTlRST19OT0spOwotICAgIH0KLSAgICBwUGljUGFyYW1TZXQtPmNocm9tYVFwSW5kZXhPZmZzZXQgPSBpdG1wOwotCi0gICAgdG1wID0gaDI2NGJzZEdldEJpdHMocFN0cm1EYXRhLCAxKTsKLSAgICBpZiAodG1wID09IEVORF9PRl9TVFJFQU0pCi0gICAgICAgIHJldHVybihIQU5UUk9fTk9LKTsKLSAgICBwUGljUGFyYW1TZXQtPmRlYmxvY2tpbmdGaWx0ZXJDb250cm9sUHJlc2VudEZsYWcgPQotICAgICAgICAodG1wID09IDEpID8gSEFOVFJPX1RSVUUgOiBIQU5UUk9fRkFMU0U7Ci0KLSAgICB0bXAgPSBoMjY0YnNkR2V0Qml0cyhwU3RybURhdGEsIDEpOwotICAgIGlmICh0bXAgPT0gRU5EX09GX1NUUkVBTSkKLSAgICAgICAgcmV0dXJuKEhBTlRST19OT0spOwotICAgIHBQaWNQYXJhbVNldC0+Y29uc3RyYWluZWRJbnRyYVByZWRGbGFnID0gKHRtcCA9PSAxKSA/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ArIGNvbXAgKiA4ICogODsKLQotICAgICAgICAvKiAyeDIgcGVscyBwZXIgaXRlcmF0aW9uCi0gICAgICAgICAqIGJpbGluZWFyIGhvcml6b250YWwgaW50ZXJwb2xhdGlvbiAqLwotICAgICAgICBmb3IgKHkgPSAoY2hyb21hUGFydEhlaWdodCA+PiAxKTsgeTsgeS0tKQotICAgICAgICB7Ci0gICAgICAgICAgICBmb3IgKHggPSAoY2hyb21hUGFydFdpZHRoID4+IDEpOyB4OyB4LS0pCi0gICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgdG1wMSA9IHB0ckFbd2lkdGhdOwotICAgICAgICAgICAgICAgIHRtcDIgPSAqcHRyQSsrOwotICAgICAgICAgICAgICAgIHRtcDMgPSBwdHJBW3dpZHRoXTsKLSAgICAgICAgICAgICAgICB0bXA0ID0gKnB0ckErKzsKLSAgICAgICAgICAgICAgICBjID0gKCh2YWwgKiB0bXAxICsgeEZyYWMgKiB0bXAzKSA8PCAzKSArIDMyOwotICAgICAgICAgICAgICAgIGMgPj49IDY7Ci0gICAgICAgICAgICAgICAgY2JyWzhdID0gKHU4KWM7Ci0gICAgICAgICAgICAgICAgYyA9ICgodmFsICogdG1wMiArIHhGcmFjICogdG1wNCkgPDwgMykgKyAzMjsKLSAgICAgICAgICAgICAgICBjID4+PSA2OwotICAgICAgICAgICAgICAgICpjYnIrKyA9ICh1OCljOwotICAgICAgICAgICAgICAgIHRtcDEgPSBwdHJBW3dpZHRoXTsKLSAgICAgICAgICAgICAgICB0bXAyID0gKnB0ckE7Ci0gICAgICAgICAgICAgICAgYyA9ICgodmFsICogdG1wMyArIHhGcmFjICogdG1wMSkgPDwgMykgKyAzMjsKLSAgICAgICAgICAgICAgICBjID4+PSA2OwotICAgICAgICAgICAgICAgIGNicls4XSA9ICh1OCljOwotICAgICAgICAgICAgICAgIGMgPSAoKHZhbCAqIHRtcDQgKyB4RnJhYyAqIHRtcDIpIDw8IDMpICsgMzI7Ci0gICAgICAgICAgICAgICA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ICAgIHBSZWYgPSBibG9jazsKLSAgICAgICAgeDAgPSAwOwotICAgICAgICB5MCA9IDA7Ci0gICAgICAgIHdpZHRoID0gY2hyb21hUGFydFdpZHRoOwotICAgICAgICBoZWlnaHQgPSBjaHJvbWFQYXJ0SGVpZ2h0KzE7Ci0gICAgfQotCi0gICAgdmFsID0gOCAtIHlGcmFjOwotCi0gICAgZm9yIChjb21wID0gMDsgY29tcCA8PSAxOyBjb21wKyspCi0gICAgewotCi0gICAgICAgIHB0ckEgPSBwUmVmICsgKGNvbXAgKiBoZWlnaHQgKyAodTMyKXkwKSAqIHdpZHRoICsgeDA7Ci0gICAgICAgIGNiciA9IHByZWRQYXJ0Q2hyb21hICsgY29tcCAqIDggKiA4OwotCi0gICAgICAgIC8qIDJ4MiBwZWxzIHBlciBpdGVyYXRpb24KLSAgICAgICAgICogYmlsaW5lYXIgdmVydGljYWwgaW50ZXJwb2xhdGlvbiAqLwotICAgICAgICBmb3IgKHkgPSAoY2hyb21hUGFydEhlaWdodCA+PiAxKTsgeTsgeS0tKQotICAgICAgICB7Ci0gICAgICAgICAgICBmb3IgKHggPSAoY2hyb21hUGFydFdpZHRoID4+IDEpOyB4OyB4LS0pCi0gICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgdG1wMyA9IHB0ckFbd2lkdGgqMl07Ci0gICAgICAgICAgICAgICAgdG1wMiA9IHB0ckFbd2lkdGhdOwotICAgICAgICAgICAgICAgIHRtcDEgPSAqcHRyQSsrOwotICAgICAgICAgICAgICAgIGMgPSAoKHZhbCAqIHRtcDIgKyB5RnJhYyAqIHRtcDMpIDw8IDMpICsgMzI7Ci0gICAgICAgICAgICAgICAgYyA+Pj0gNjsKLSAgICAgICAgICAgICAgICBjYnJbOF0gPSAodTgpYzsKLSAgICAgICAgICAgICAgICBjID0gKCh2YWwgKiB0bXAxICsgeUZyYWMgKiB0bXAyKSA8PCAzKSArIDMyOwotICAgICAgICAgICAgICAgIGMgPj49IDY7Ci0gICAgICAgICAgICAgICAgKmNicisrID0gKHU4KWM7Ci0gICAgICAgICAgICAgICAgdG1wMyA9IHB0ckFbd2lkdGgqMl07Ci0gICAgICAgICAgICAgICAgdG1wMiA9IHB0ckFbd2lkdGhdOwotICAgICAgICAgICAgICAgIHRtcDEgPSAqcHRyQSsrOwotICAgICAgICAgICAgICAgIGMgPSAoKHZhbCAqIHRtcDIgKyB5RnJhYyAqIHRtcDMpIDw8IDMpICsgMzI7Ci0gICAgICAgICAgICAgICAgYyA+Pj0gNjsKLSAgICAgICAgICAgICAgICBjYnJbOF0gPSAodTgpYzsKLSAgICAgICAgICAgICAgICBjID0gKCh2YWwgKiB0bXAxICsgeUZyYWMgKiB0bXAyKSA8PCAzKSArIDMyOwotICAgICAgICAgICAgICAgIGMgPj49IDY7Ci0gICAgICAgICAgICAgICAgKmNicisrID0gKHU4KWM7Ci0gICAgICAgICAgICB9Ci0gICAgICAgICAgICBjYnIgKz0gMio4IC0gY2hyb21hUGFydFdpZHRoOwotICAgICAgICAgICAgcHRyQSArPSAyKndpZHRoIC0gY2hyb21hUGFydFdpZHRoOwotICAgICAgICB9Ci0gICAgfQotCi19Ci0jZW5kaWYKLS8qLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tCi0KLSAgICBGdW5jdGlvbjogaDI2NGJzZEludGVycG9sYXRlQ2hyb21hSG9yVmVyCi0KLSAgICAgICAgRnVuY3Rpb25hbCBkZXNjcmlwdGlvbjoKLSAgICAgICAgICBUaGlzIGZ1bmN0aW9uIHBlcmZvcm1zIGNocm9tYSBpbnRlcnBvbGF0aW9uIGluIGhvcml6b250YWwgYW5kCi0gICAgICAgICAgdmVydGljYWwgZGlyZWN0aW9uLiBPdmVyZmlsbGluZyBpcyBkb25lIG9ubHkgaWYgbmVlZGVkLiBSZWZlcmVuY2UKLSAgICAgICAgICBpbWFnZSAocmVmK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hdGlvbiAqLwotICAgICAgICBmb3IgKHkgPSAoY2hyb21hUGFydEhlaWdodCA+PiAxKTsgeTsgeS0tKQotICAgICAgICB7Ci0gICAgICAgICAgICB0bXAxID0gKnB0ckE7Ci0gICAgICAgICAgICB0bXAzID0gcHRyQVt3aWR0aF07Ci0gICAgICAgICAgICB0bXA1ID0gcHRyQVt3aWR0aCoyXTsKLSAgICAgICAgICAgIHRtcDEgKj0gdmFsWTsKLSAgICAgICAgICAgIHRtcDEgKz0gdG1wMyAqIHlGcmFjOwotICAgICAgICAgICAgdG1wMyAqPSB2YWxZOwotICAgICAgICAgICAgdG1wMyArPSB0bXA1ICogeUZyYWM7Ci0gICAgICAgICAgICBmb3IgKHggPSAoY2hyb21hUGFydFdpZHRoID4+IDEpOyB4OyB4LS0pCi0gICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgdG1wMiA9ICorK3B0ckE7Ci0gICAgICAgICAgICAgICAgdG1wNCA9IHB0ckFbd2lkdGhdOwotICAgICAgICAgICAgICAgIHRtcDYgPSBwdHJBW3dpZHRoKjJdOwotICAgICAgICAgICAgICAgIHRtcDIgKj0gdmFsWTsKLSAgICAgICAgICAgICAgICB0bXAyICs9IHRtcDQgKiB5RnJhYzsKLSAgICAgICAgICAgICAgICB0bXA0ICo9IHZhbFk7Ci0gICAgICAgICAgICAgICAgdG1wNCArPSB0bXA2ICogeUZyYWM7Ci0gICAgICAgICAgICAgICAgdG1wMSA9IHRtcDEgKiB2YWxYICsgcGx1czMyOwotICAgICAgICAgICAgICAgIHRtcDMgPSB0bXAzICogdmFsWCArIHBsdXMzMjsKLSAgICAgICAgICAgICAgICB0bXAxICs9IHRtcDIgKiB4RnJhYzsKLSAgICAgICAgICAgICAgICB0bXAxID4+PSA2OwotICAgICAgICAgICAgICAgIHRtcDMgKz0gdG1wNCAqIHhGcmFjOwotICAgICAgICAgICAgICAgIHRtcDMgPj49IDY7Ci0gICAgICAgICAgICAgICAgY2JyWzhdID0gKHU4KXRtcDM7Ci0gICAgICAgICAgICAgICAgKmNicisrID0gKHU4KXRtcDE7Ci0KLSAgICAgICAgICAgICAgICB0bXAxID0gKisrcHRyQTsKLSAgICAgICAgICAgICAgICB0bXAzID0gcHRyQVt3aWR0aF07Ci0gICAgICAgICAgICAgICAgdG1wNSA9IHB0ckFbd2lkdGgqMl07Ci0gICAgICAgICAgICAgICAgdG1wMSAqPSB2YWxZOwotICAgICAgICAgICAgICAgIHRtcDEgKz0gdG1wMyAqIHlGcmFjOwotICAgICAgICAgICAgICAgIHRtcDMgKj0gdmFsWTsKLSAgICAgICAgICAgICAgICB0bXAzICs9IHRtcDUgKiB5RnJhYzsKLSAgICAgICAgICAgICAgICB0bXAyID0gdG1wMiAqIHZhbFggKyBwbHVzMzI7Ci0gICAgICAgICAgICAgICAgdG1wNCA9IHRtcDQgKiB2YWxYICsgcGx1czMyOwotICAgICAgICAgICAgICAgIHRtcDIgKz0gdG1wMSAqIHhGcmFjOwotICAgICAgICAgICAgICAgIHRtcDIgPj49IDY7Ci0gICAgICAgICAgICAgICAgdG1wNCArPSB0bXAzICogeEZyYWM7Ci0gICAgICAgICAgICAgICAgdG1wNCA+Pj0gNjsKLSAgICAgICAgICAgICAgICBjYnJbOF0gPSAodTgpdG1wNDsKLSAgICAgICAgICAgICAgICAqY2JyKysgPSAodTgpdG1wMjsKLSAgICAgICAgICAgIH0KLSAgICAgICAgICAgIGNiciArPSAyKjggLSBjaHJvbWFQYXJ0V2lkdGg7Ci0gICAgICAgICAgICBwdHJBICs9IDIqd2lkdGggLSBjaHJvbWFQYXJ0V2lkdGg7Ci0gICAgICAgIH0KLSAgICB9Ci0KLX0KLQotLyotLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0KLQotICAgIEZ1bmN0aW9uOiBQcmVkaWN0Q2hyb21hCi0KLSAgICAgICAgRnVuY3Rpb25h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i0gICAgZm9yIChpID0gKHBhcnRIZWlnaHQgPj4gMik7IGk7IGktLSkKLSAgICB7Ci0gICAgICAgIC8qIGgxID0gKDE2ICsgQSArIDE2KEcrTSkgKyA0KEcrTSkgLSA0KEMrUikgLSAoQytSKSArIFQpID4+IDUgKi8KLSAgICAgICAgZm9yIChqID0gcGFydFdpZHRoOyBqOyBqLS0pCi0gICAgICAgIHsKLSAgICAgICAgICAgIHRtcDQgPSBwdHJWWy0oaTMyKXdpZHRoKjJdOwotICAgICAgICAgICAgdG1wNSA9IHB0clZbLShpMzIpd2lkdGhdOwotICAgICAgICAgICAgdG1wMSA9IHB0clZbd2lkdGhdOwotICAgICAgICAgICAgdG1wMiA9IHB0clZbd2lkdGgqMl07Ci0gICAgICAgICAgICB0bXA2ID0gKnB0clYrKzsKLQotICAgICAgICAgICAgdG1wNyA9IHRtcDQgKyB0bXAxOwotICAgICAgICAgICAgdG1wMiAtPSAodG1wNyA8PCAyKTsKLSAgICAgICAgICAgIHRtcDIgLT0gdG1wNzsKLSAgICAgICAgICAgIHRtcDIgKz0gMTY7Ci0gICAgICAgICAgICB0bXA3ID0gdG1wNSArIHRtcDY7Ci0gICAgICAgICAgICB0bXAzID0gcHRyQ1t3aWR0aCoyXTsKLSAgICAgICAgICAgIHRtcDIgKz0gKHRtcDcgPDwgNCk7Ci0gICAgICAgICAgICB0bXAyICs9ICh0bXA3IDw8IDIpOwotICAgICAgICAgICAgdG1wMiArPSB0bXAzOwotICAgICAgICAgICAgdG1wMiA9IGNscFt0bXAyPj41XTsKLSAgICAgICAgICAgIHRtcDEgKz0gMTY7Ci0gICAgICAgICAgICBtYls0OF0gPSAodTgpdG1wMjsKLQotICAgICAgICAgICAgdG1wNyA9IHRtcDMgKyB0bXA2OwotICAgICAgICAgICAgdG1wMSAtPSAodG1wNyA8PCAyKTsKLSAgICAgICAgICAgIHRtcDEgLT0gdG1wNzsKLSAgICAgICAgICAgIHRtcDcgPSB0bXA0ICsgdG1wNTsKLSAgICAgICAgICAgIHRtcDIgPSBwdHJDW3dpZHRoXTsKLSAgICAgICAgICAgIHRtcDEgKz0gKHRtcDcgPDwgNCk7Ci0gICAgICAgICAgICB0bXAxICs9ICh0bXA3IDw8IDIpOwotICAgICAgICAgICAgdG1wMSArPSB0bXAyOwotICAgICAgICAgICAgdG1wMSA9IGNscFt0bXAxPj41XTsKLSAgICAgICAgICAgIHRtcDYgKz0gMTY7Ci0gICAgICAgICAgICBtYlszMl0gPSAodTgpdG1wMTsKLQotICAgICAgICAgICAgdG1wNyA9IHRtcDIgKyB0bXA1OwotICAgICAgICAgICAgdG1wNiAtPSAodG1wNyA8PCAyKTsKLSAgICAgICAgICAgIHRtcDYgLT0gdG1wNzsKLSAgICAgICAgICAgIHRtcDcgPSB0bXA0ICsgdG1wMzsKLSAgICAgICAgICAgIHRtcDEgPSAqcHRyQzsKLSAgICAgICAgICAgIHRtcDYgKz0gKHRtcDcgPDwgNCk7Ci0gICAgICAgICAgICB0bXA2ICs9ICh0bXA3IDw8IDIpOwotICAgICAgICAgICAgdG1wNiArPSB0bXAxOwotICAgICAgICAgICAgdG1wNiA9IGNscFt0bXA2Pj41XTsKLSAgICAgICAgICAgIHRtcDUgKz0gMTY7Ci0gICAgICAgICAgICBtYlsxNl0gPSAodTgpdG1wNjsKLQotICAgICAgICAgICAgdG1wMSArPSB0bXA0OwotICAgICAgICAgICAgdG1wNSAtPSAodG1wMSA8PCAyKTsKLSAgICAgICAgICAgIHRtcDUgLT0gdG1wMTsKLSAgICAgICAgICAgIHRtcDMgKz0gdG1wMjsKLSAgICAgICAgICAgIHRtcDYgPSBwdHJDWy0oaTMyKXdpZHRoXTsKLSAgICAgICAgICAgIHRtcDUgKz0gKHRtcDMgPDwgNCk7Ci0gICAgICAgICAgICB0bXA1ICs9ICh0bXAzIDw8IDIpOwotICAgICAgICAgICAgdG1wNSArPSB0bXA2OwotICAgICAgICAgICAgdG1wNSA9IGNscFt0bXA1Pj41XTsKLSAgICAgICAgICAgICptY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VyT2Zmc2V0KSp3aWR0aDsKLQotICAgIC8qIDQgcGl4ZWxzIHBlciBpdGVyYXRpb24KLSAgICAgKiBpbnRlcnBvbGF0ZSB1c2luZyA1IHZlcnRpY2FsIHNhbXBsZXMgYW5kIGF2ZXJhZ2UgYmV0d2VlbgotICAgICAqIGludGVycG9sYXRlZCB2YWx1ZSBhbmQgaW50ZWdlciBzYW1wbGUgdmFsdWUgKi8KLSAgICBmb3IgKGkgPSAocGFydEhlaWdodCA+PiAyKTsgaTsgaS0tKQotICAgIHsKLSAgICAgICAgLyogaDEgPSAoMTYgKyBBICsgMTYoRytNKSArIDQoRytNKSAtIDQoQytSKSAtIChDK1IpICsgVCkgPj4gNSAqLwotICAgICAgICBmb3IgKGogPSBwYXJ0V2lkdGg7IGo7IGotLSkKLSAgICAgICAgewotICAgICAgICAgICAgdG1wNCA9IHB0clZbLShpMzIpd2lkdGgqMl07Ci0gICAgICAgICAgICB0bXA1ID0gcHRyVlstKGkzMil3aWR0aF07Ci0gICAgICAgICAgICB0bXAxID0gcHRyVlt3aWR0aF07Ci0gICAgICAgICAgICB0bXAyID0gcHRyVlt3aWR0aCoyXTsKLSAgICAgICAgICAgIHRtcDYgPSAqcHRyVisrOwotCi0gICAgICAgICAgICB0bXA3ID0gdG1wNCArIHRtcDE7Ci0gICAgICAgICAgICB0bXAyIC09ICh0bXA3IDw8IDIpOwotICAgICAgICAgICAgdG1wMiAtPSB0bXA3OwotICAgICAgICAgICAgdG1wMiArPSAxNjsKLSAgICAgICAgICAgIHRtcDcgPSB0bXA1ICsgdG1wNjsKLSAgICAgICAgICAgIHRtcDMgPSBwdHJDW3dpZHRoKjJdOwotICAgICAgICAgICAgdG1wMiArPSAodG1wNyA8PCA0KTsKLSAgICAgICAgICAgIHRtcDIgKz0gKHRtcDcgPDwgMik7Ci0gICAgICAgICAgICB0bXAyICs9IHRtcDM7Ci0gICAgICAgICAgICB0bXAyID0gY2xwW3RtcDI+PjVdOwotICAgICAgICAgICAgdG1wNyA9IHB0ckludFt3aWR0aCoyXTsKLSAgICAgICAgICAgIHRtcDEgKz0gMTY7Ci0gICAgICAgICAgICB0bXAyKys7Ci0gICAgICAgICAgICBtYls0OF0gPSAodTgpKCh0bXAyICsgdG1wNykgPj4gMSk7Ci0KLSAgICAgICAgICAgIHRtcDcgPSB0bXAzICsgdG1wNjsKLSAgICAgICAgICAgIHRtcDEgLT0gKHRtcDcgPDwgMik7Ci0gICAgICAgICAgICB0bXAxIC09IHRtcDc7Ci0gICAgICAgICAgICB0bXA3ID0gdG1wNCArIHRtcDU7Ci0gICAgICAgICAgICB0bXAyID0gcHRyQ1t3aWR0aF07Ci0gICAgICAgICAgICB0bXAxICs9ICh0bXA3IDw8IDQpOwotICAgICAgICAgICAgdG1wMSArPSAodG1wNyA8PCAyKTsKLSAgICAgICAgICAgIHRtcDEgKz0gdG1wMjsKLSAgICAgICAgICAgIHRtcDEgPSBjbHBbdG1wMT4+NV07Ci0gICAgICAgICAgICB0bXA3ID0gcHRySW50W3dpZHRoXTsKLSAgICAgICAgICAgIHRtcDYgKz0gMTY7Ci0gICAgICAgICAgICB0bXAxKys7Ci0gICAgICAgICAgICBtYlszMl0gPSAodTgpKCh0bXAxICsgdG1wNykgPj4gMSk7Ci0KLSAgICAgICAgICAgIHRtcDcgPSB0bXAyICsgdG1wNTsKLSAgICAgICAgICAgIHRtcDYgLT0gKHRtcDcgPDwgMik7Ci0gICAgICAgICAgICB0bXA2IC09IHRtcDc7Ci0gICAgICAgICAgICB0bXA3ID0gdG1wNCArIHRtcDM7Ci0gICAgICAgICAgICB0bXAxID0gKnB0ckM7Ci0gICAgICAgICAgICB0bXA2ICs9ICh0bXA3IDw8IDQpOwotICAgICAgICAgICAgdG1wNiArPSAodG1wNyA8PCAyKTsKLSAgICAgICAgICAgIHRtcDYgKz0gdG1wMTsKLSAgICAgICAgICAgIHRtcDYgPSBjbHBbdG1wNj4+NV07Ci0gICAgICAgICAgICB0bXA3ID0gKnB0ckludDsKLSAgICAgICAgICAgIHRtcDUgKz0gMTY7Ci0gICAgICAgICAgICB0bXA2Kys7Ci0gICAgICAgICAgICBtYlsxNl0gPSAodTgpKCh0bXA2ICsgdG1wNykgPj4gMSk7Ci0KLSAgICAgICAgICAgIHRtcDEgKz0gdG1wNDsKLSAgICAgICAgICAgIHRtcDUgLT0gKHRtcDEgPDwgMik7Ci0gICAgICAgICAgICB0bXA1IC09IHRtcDE7Ci0gICAgICAgICAgICB0bXAzICs9IHRtcDI7Ci0gICAgICAgICAgICB0bXA2ID0gcHRyQ1stKGkzMil3aWR0aF07Ci0gICAgICAgICAgICB0bXA1ICs9ICh0bXAzIDw8IDQpOwotICAgICAgICAgICAgdG1wNSArPSAodG1wMyA8PCAyKTsKLSAgICAgICAgICAgIHRtcDUgKz0gdG1wNjsKLSAgICAgICAgICAgIHRtcDUgPSBjbHBbdG1wNT4+NV07Ci0gICAgICAgICAgICB0bXA3ID0gcHRySW50Wy0oaTMyKXdpZHRoXTsKLSAgICAgICAgICAgIHRtcDUrKzsKLSAgICAgICAgICAgICptYisrID0gKHU4KSgodG1wNSArIHRtcDcpID4+IDEpOwotICAgICAgICAgICAgcHRyQysrOwotICAgICAgICAgICAgcHRySW50Kys7Ci0gICAgICAgIH0KLSAgICAgICAgcHRyQyArPSA0KndpZHRoIC0gcGFydFdpZHRoOwotICAgICAgICBwdHJWICs9IDQqd2lkdGggLSBwYXJ0V2lkdGg7Ci0gICAgICAgIHB0ckludCArPSA0KndpZHRoIC0gcGFydFdpZHRoOwotICAgICAgICBtYiArPSA0KjE2IC0gcGFydFdpZHRoOwotICAgIH0KLQotfQotCi0vKi0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLQotCi0gICAgRnVuY3Rpb246IGgyNjRic2RJbnRlcnBvbGF0ZUhvckhhbGYKLQotICAgICAgICBGdW5jdGlvbmFsIGRl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DArcGFydFdpZHRoKzUgPiB3aWR0aCkgfHwKLSAgICAgICAgKHkwIDwgMCkgfHwgKCh1MzIpeTArcGFydEhlaWdodCA+IGhlaWdodCkpCi0gICAgewotICAgICAgICBoMjY0YnNkRmlsbEJsb2NrKHJlZiwgKHU4KilwMSwgeDAsIHkwLCB3aWR0aCwgaGVpZ2h0LAotICAgICAgICAgICAgICAgIHBhcnRXaWR0aCs1LCBwYXJ0SGVpZ2h0LCBwYXJ0V2lkdGgrNSk7Ci0KLSAgICAgICAgeDAgPSAwOwotICAgICAgICB5MCA9IDA7Ci0gICAgICAgIHJlZiA9ICh1OCopcDE7Ci0gICAgICAgIHdpZHRoID0gcGFydFdpZHRoICsgNTsKLSAgICB9Ci0KLSAgICByZWYgKz0gKHUzMil5MCAqIHdpZHRoICsgKHUzMil4MDsKLQotICAgIHB0ckogPSByZWYgKyA1OwotCi0gICAgZm9yICh5ID0gcGFydEhlaWdodDsgeTsgeS0tKQotICAgIHsKLSAgICAgICAgdG1wNiA9ICoocHRySiAtIDUpOwotICAgICAgICB0bXA1ID0gKihwdHJKIC0gNCk7Ci0gICAgICAgIHRtcDQgPSAqKHB0ckogLSAzKTsKLSAgICAgICAgdG1wMyA9ICoocHRySiAtIDIpOwotICAgICAgICB0bXAyID0gKihwdHJKIC0gMSk7Ci0KLSAgICAgICAgLyogY2FsY3VsYXRlIDQgcGVscyBwZXIgaXRlcmF0aW9uICovCi0gICAgICAgIGZvciAoeCA9IChwYXJ0V2lkdGggPj4gMik7IHg7IHgtLSkKLSAgICAgICAgewotICAgICAgICAgICAgLyogRmlyc3QgcGl4ZWwgKi8KLSAgICAgICAgICAgIHRtcDYgKz0gMTY7Ci0gICAgICAgICAgICB0bXA3ID0gdG1wMyArIHRtcDQ7Ci0gICAgICAgICAgICB0bXA2ICs9ICh0bXA3IDw8IDQpOwotICAgICAgICAgICAgdG1wNiArPSAodG1wNyA8PCAyKTsKLSAgICAgICAgICAgIHRtcDcgPSB0bXAyICsgdG1wNTsKLSAgICAgICAgICAgIHRtcDEgPSAqcHRySisrOwotICAgICAgICAgICAgdG1wNiAtPSAodG1wNyA8PCAyKTsKLSAgICAgICAgICAgIHRtcDYgLT0gdG1wNzsKLSAgICAgICAgICAgIHRtcDYgKz0gdG1wMTsKLSAgICAgICAgICAgIHRtcDYgPSBjbHBbdG1wNj4+NV07Ci0gICAgICAgICAgICAvKiBTZWNvbmQgcGl4ZWwgKi8KLSAgICAgICAgICAgIHRtcDUgKz0gMTY7Ci0gICAgICAgICAgICB0bXA3ID0gdG1wMiArIHRtcDM7Ci0gICAgICAgICAgICAqbWIrKyA9ICh1OCl0bXA2OwotICAgICAgICAgICAgdG1wNSArPSAodG1wNyA8PCA0KTsKLSAgICAgICAgICAgIHRtcDUgKz0gKHRtcDcgPDwgMik7Ci0gICAgICAgICAgICB0bXA3ID0gdG1wMSArIHRtcDQ7Ci0gICAgICAgICAgICB0bXA2ID0gKnB0ckorKzsKLSAgICAgICAgICAgIHRtcDUgLT0gKHRtcDcgPDwgMik7Ci0gICAgICAgICAgICB0bXA1IC09IHRtcDc7Ci0gICAgICAgICAgICB0bXA1ICs9IHRtcDY7Ci0gICAgICAgICAgICB0bXA1ID0gY2xwW3RtcDU+PjVdOwotICAgICAgICAgICAgLyogVGhpcmQgcGl4ZWwgKi8KLSAgICAgICAgICAgIHRtcDQgKz0gMTY7Ci0gICAgICAgICAgICB0bXA3ID0gdG1wMSArIHRtcDI7Ci0gICAgICAgICAgICAqbWIrKyA9ICh1OCl0bXA1OwotICAgICAgICAgICAgdG1wNCArPSAodG1wNyA8PCA0KTsKLSAgICAgICAgICAgIHRtcDQgKz0gKHRtcDcgPDwgMik7Ci0gICAgICAgICAgICB0bXA3ID0gdG1wNiArIHRtcDM7Ci0gICAgICAgICAgICB0bXA1ID0gKnB0ckorKzsKLSAgICAgICAgICAgIHRtcDQgLT0gKHRtcDcgPDwgMik7Ci0gICAgICAgICAgICB0bXA0IC09IHRtcDc7Ci0gICAgICAgICAgICB0bXA0ICs9IHRtcDU7Ci0gICAgICAgICAgICB0bXA0ID0gY2xwW3RtcDQ+PjVdOwotICAgICAgICAgICAgLyogRm91cnRoIHBpeGVsICovCi0gICAgICAgICAgICB0bXAzICs9IDE2OwotICAgICAgICAgICAgdG1wNyA9IHRtcDYgKyB0bXAxOwotICAgICAgICAgICAgKm1iKysgPSAodTgpdG1wNDsKLSAgICAgICAgICAgIHRtcDMgKz0gKHRtcDcgPDwgNCk7Ci0gICAgICAgICAgICB0bXAzICs9ICh0bXA3IDw8IDIpOwotICAgICAgICAgICAgdG1wNyA9IHRtcDUgKyB0bXAyOwotICAgICAgICAgICAgdG1wNCA9ICpwdHJKKys7Ci0gICAgICAgICAgICB0bXAzIC09ICh0bXA3IDw8IDIpOwotICAgICAgICAgICAgdG1wMyAtPSB0bXA3OwotICAgICAgICAgICAgdG1wMyArPSB0bXA0OwotICAgICAgICAgICAgdG1wMyA9IGNscFt0bXAzPj41XTsKLSAgICAgICAgICAgIHRtcDcgPSB0bXA0OwotICAgICAgICAgICAgdG1wNCA9IHRtcDY7Ci0gICAgICAgICAgICB0bXA2ID0gdG1wMjsKLSAgICAgICAgICAgIHRtcDIgPSB0bXA3OwotICAgICAgICAgICAgKm1iKysgPSAodTgpdG1wMzsKLSAgICAgICAgICAgIHRtcDMgPSB0bXA1OwotICAgICAgICAgICAgdG1wNSA9IHRtcDE7Ci0gICAgICAgIH0KLSAgICAgICAgcHRySiArPSB3aWR0aCAtIHBhcnRXaWR0aDsKLSAgICAgICAgbWIgKz0gMTYgLSBwYXJ0V2lkdGg7Ci0gICAgfQotCi19Ci0KLS8qLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tCi0KLSAgICBGdW5jdGlvbjogaDI2NGJzZEludGVycG9sYXRlSG9yUXVhcnRlcgotCi0gICAgICAgIEZ1bmN0aW9uYWwgZ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UgPiB3aWR0aCkgfHwKLSAgICAgICAgKHkwIDwgMCkgfHwgKCh1MzIpeTArcGFydEhlaWdodCA+IGhlaWdodCkpCi0gICAgewotICAgICAgICBoMjY0YnNkRmlsbEJsb2NrKHJlZiwgKHU4KilwMSwgeDAsIHkwLCB3aWR0aCwgaGVpZ2h0LAotICAgICAgICAgICAgICAgIHBhcnRXaWR0aCs1LCBwYXJ0SGVpZ2h0LCBwYXJ0V2lkdGgrNSk7Ci0KLSAgICAgICAgeDAgPSAwOwotICAgICAgICB5MCA9IDA7Ci0gICAgICAgIHJlZiA9ICh1OCopcDE7Ci0gICAgICAgIHdpZHRoID0gcGFydFdpZHRoICsgNTsKLSAgICB9Ci0KLSAgICByZWYgKz0gKHUzMil5MCAqIHdpZHRoICsgKHUzMil4MDsKLQotICAgIHB0ckogPSByZWYgKyA1OwotCi0gICAgZm9yICh5ID0gcGFydEhlaWdodDsgeTsgeS0tKQotICAgIHsKLSAgICAgICAgdG1wNiA9ICoocHRySiAtIDUpOwotICAgICAgICB0bXA1ID0gKihwdHJKIC0gNCk7Ci0gICAgICAgIHRtcDQgPSAqKHB0ckogLSAzKTsKLSAgICAgICAgdG1wMyA9ICoocHRySiAtIDIpOwotICAgICAgICB0bXAyID0gKihwdHJKIC0gMSk7Ci0KLSAgICAgICAgLyogY2FsY3VsYXRlIDQgcGVscyBwZXIgaXRlcmF0aW9uICovCi0gICAgICAgIGZvciAoeCA9IChwYXJ0V2lkdGggPj4gMik7IHg7IHgtLSkKLSAgICAgICAgewotICAgICAgICAgICAgLyogRmlyc3QgcGl4ZWwgKi8KLSAgICAgICAgICAgIHRtcDYgKz0gMTY7Ci0gICAgICAgICAgICB0bXA3ID0gdG1wMyArIHRtcDQ7Ci0gICAgICAgICAgICB0bXA2ICs9ICh0bXA3IDw8IDQpOwotICAgICAgICAgICAgdG1wNiArPSAodG1wNyA8PCAyKTsKLSAgICAgICAgICAgIHRtcDcgPSB0bXAyICsgdG1wNTsKLSAgICAgICAgICAgIHRtcDEgPSAqcHRySisrOwotICAgICAgICAgICAgdG1wNiAtPSAodG1wNyA8PCAyKTsKLSAgICAgICAgICAgIHRtcDYgLT0gdG1wNzsKLSAgICAgICAgICAgIHRtcDYgKz0gdG1wMTsKLSAgICAgICAgICAgIHRtcDYgPSBjbHBbdG1wNj4+NV07Ci0gICAgICAgICAgICB0bXA1ICs9IDE2OwotICAgICAgICAgICAgaWYgKCFob3JPZmZzZXQpCi0gICAgICAgICAgICAgICAgdG1wNiArPSB0bXA0OwotICAgICAgICAgICAgZWxzZQotICAgICAgICAgICAgICAgIHRtcDYgKz0gdG1wMzsKLSAgICAgICAgICAgICptYisrID0gKHU4KSgodG1wNiArIDEpID4+IDEpOwotICAgICAgICAgICAgLyogU2Vjb25kIHBpeGVsICovCi0gICAgICAgICAgICB0bXA3ID0gdG1wMiArIHRtcDM7Ci0gICAgICAgICAgICB0bXA1ICs9ICh0bXA3IDw8IDQpOwotICAgICAgICAgICAgdG1wNSArPSAodG1wNyA8PCAyKTsKLSAgICAgICAgICAgIHRtcDcgPSB0bXAxICsgdG1wNDsKLSAgICAgICAgICAgIHRtcDYgPSAqcHRySisrOwotICAgICAgICAgICAgdG1wNSAtPSAodG1wNyA8PCAyKTsKLSAgICAgICAgICAgIHRtcDUgLT0gdG1wNzsKLSAgICAgICAgICAgIHRtcDUgKz0gdG1wNjsKLSAgICAgICAgICAgIHRtcDUgPSBjbHBbdG1wNT4+NV07Ci0gICAgICAgICAgICB0bXA0ICs9IDE2OwotICAgICAgICAgICAgaWYgKCFob3JPZmZzZXQpCi0gICAgICAgICAgICAgICAgdG1wNSArPSB0bXAzOwotICAgICAgICAgICAgZWxzZQotICAgICAgICAgICAgICAgIHRtcDUgKz0gdG1wMjsKLSAgICAgICAgICAgICptYisrID0gKHU4KSgodG1wNSArIDEpID4+IDEpOwotICAgICAgICAgICAgLyogVGhpcmQgcGl4ZWwgKi8KLSAgICAgICAgICAgIHRtcDcgPSB0bXAxICsgdG1wMjsKLSAgICAgICAgICAgIHRtcDQgKz0gKHRtcDcgPDwgNCk7Ci0gICAgICAgICAgICB0bXA0ICs9ICh0bXA3IDw8IDIpOwotICAgICAgICAgICAgdG1wNyA9IHRtcDYgKyB0bXAzOwotICAgICAgICAgICAgdG1wNSA9ICpwdHJKKys7Ci0gICAgICAgICAgICB0bXA0IC09ICh0bXA3IDw8IDIpOwotICAgICAgICAgICAgdG1wNCAtPSB0bXA3OwotICAgICAgICAgICAgdG1wNCArPSB0bXA1OwotICAgICAgICAgICAgdG1wNCA9IGNscFt0bXA0Pj41XTsKLSAgICAgICAgICAgIHRtcDMgKz0gMTY7Ci0gICAgICAgICAgICBpZiAoIWhvck9mZnNldCkKLSAgICAgICAgICAgICAgICB0bXA0ICs9IHRtcDI7Ci0gICAgICAgICAgICBlbHNlCi0gICAgICAgICAgICAgICAgdG1wNCArPSB0bXAxOwotICAgICAgICAgICAgKm1iKysgPSAodTgpKCh0bXA0ICsgMSkgPj4gMSk7Ci0gICAgICAgICAgICAvKiBGb3VydGggcGl4ZWwgKi8KLSAgICAgICAgICAgIHRtcDcgPSB0bXA2ICsgdG1wMTsKLSAgICAgICAgICAgIHRtcDMgKz0gKHRtcDcgPDwgNCk7Ci0gICAgICAgICAgICB0bXAzICs9ICh0bXA3IDw8IDIpOwotICAgICAgICAgICAgdG1wNyA9IHRtcDUgKyB0bXAyOwotICAgICAgICAgICAgdG1wNCA9ICpwdHJKKys7Ci0gICAgICAgICAgICB0bXAzIC09ICh0bXA3IDw8IDIpOwotICAgICAgICAgICAgdG1wMyAtPSB0bXA3OwotICAgICAgICAgICAgdG1wMyArPSB0bXA0OwotICAgICAgICAgICAgdG1wMyA9IGNscFt0bXAzPj41XTsKLSAgICAgICAgICAgIGlmICghaG9yT2Zmc2V0KQotICAgICAgICAgICAgICAgIHRtcDMgKz0gdG1wMTsKLSAgICAgICAgICAgIGVsc2UKLSAgICAgICAgICAgICAgICB0bXAzICs9IHRtcDY7Ci0gICAgICAgICAgICAqb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gdG1wNTsKLSAgICAgICAgICAgIHRtcDEgPSAqcHRySisrOwotICAgICAgICAgICAgdG1wNiAtPSAodG1wNyA8PCAyKTsKLSAgICAgICAgICAgIHRtcDYgLT0gdG1wNzsKLSAgICAgICAgICAgIHRtcDYgKz0gdG1wMTsKLSAgICAgICAgICAgIHRtcDYgPSBjbHBbdG1wNj4+NV07Ci0gICAgICAgICAgICAvKiBTZWNvbmQgcGl4ZWwgKi8KLSAgICAgICAgICAgIHRtcDUgKz0gMTY7Ci0gICAgICAgICAgICB0bXA3ID0gdG1wMiArIHRtcDM7Ci0gICAgICAgICAgICAqbWIrKyA9ICh1OCl0bXA2OwotICAgICAgICAgICAgdG1wNSArPSAodG1wNyA8PCA0KTsKLSAgICAgICAgICAgIHRtcDUgKz0gKHRtcDcgPDwgMik7Ci0gICAgICAgICAgICB0bXA3ID0gdG1wMSArIHRtcDQ7Ci0gICAgICAgICAgICB0bXA2ID0gKnB0ckorKzsKLSAgICAgICAgICAgIHRtcDUgLT0gKHRtcDcgPDwgMik7Ci0gICAgICAgICAgICB0bXA1IC09IHRtcDc7Ci0gICAgICAgICAgICB0bXA1ICs9IHRtcDY7Ci0gICAgICAgICAgICB0bXA1ID0gY2xwW3RtcDU+PjVdOwotICAgICAgICAgICAgLyogVGhpcmQgcGl4ZWwgKi8KLSAgICAgICAgICAgIHRtcDQgKz0gMTY7Ci0gICAgICAgICAgICB0bXA3ID0gdG1wMSArIHRtcDI7Ci0gICAgICAgICAgICAqbWIrKyA9ICh1OCl0bXA1OwotICAgICAgICAgICAgdG1wNCArPSAodG1wNyA8PCA0KTsKLSAgICAgICAgICAgIHRtcDQgKz0gKHRtcDcgPDwgMik7Ci0gICAgICAgICAgICB0bXA3ID0gdG1wNiArIHRtcDM7Ci0gICAgICAgICAgICB0bXA1ID0gKnB0ckorKzsKLSAgICAgICAgICAgIHRtcDQgLT0gKHRtcDcgPDwgMik7Ci0gICAgICAgICAgICB0bXA0IC09IHRtcDc7Ci0gICAgICAgICAgICB0bXA0ICs9IHRtcDU7Ci0gICAgICAgICAgICB0bXA0ID0gY2xwW3RtcDQ+PjVdOwotICAgICAgICAgICAgLyogRm91cnRoIHBpeGVsICovCi0gICAgICAgICAgICB0bXAzICs9IDE2OwotICAgICAgICAgICAgdG1wNyA9IHRtcDYgKyB0bXAxOwotICAgICAgICAgICAgKm1iKysgPSAodTgpdG1wNDsKLSAgICAgICAgICAgIHRtcDMgKz0gKHRtcDcgPDwgNCk7Ci0gICAgICAgICAgICB0bXAzICs9ICh0bXA3IDw8IDIpOwotICAgICAgICAgICAgdG1wNyA9IHRtcDUgKyB0bXAyOwotICAgICAgICAgICAgdG1wNCA9ICpwdHJKKys7Ci0gICAgICAgICAgICB0bXAzIC09ICh0bXA3IDw8IDIpOwotICAgICAgICAgICAgdG1wMyAtPSB0bXA3OwotICAgICAgICAgICAgdG1wMyArPSB0bXA0OwotICAgICAgICAgICAgdG1wMyA9IGNscFt0bXAzPj41XTsKLSAgICAgICAgICAgIHRtcDcgPSB0bXA0OwotICAgICAgICAgICAgdG1wNCA9IHRtcDY7Ci0gICAgICAgICAgICB0bXA2ID0gdG1wMjsKLSAgICAgICAgICAgIHRtcDIgPSB0bXA3OwotICAgICAgICAgICAgKm1iKysgPSAodTgpdG1wMzsKLSAgICAgICAgICAgIHRtcDMgPSB0bXA1OwotICAgICAgICAgICAgdG1wNSA9IHRtcDE7Ci0gICAgICAgIH0KLSAgICAgICAgcHRySiArPSB3aWR0aCAtIHBhcnRXaWR0aDsKLSAgICAgICAgbWIgKz0gMTYgLSBwYXJ0V2lkdGg7Ci0gICAgfQotCi0gICAgbWIgLT0gMTYqcGFydEhlaWdodDsKLSAgICBwdHJWID0gcHRyQyArIDUqd2lkdGg7Ci0KLSAgICBmb3IgKHkgPSAocGFydEhlaWdodCA+PiAyKTsgeTsgeS0tKQotICAgIHsKLSAgICAgICAgLyogVmVydGljYWwgaW50ZXJwb2xhdGlvbiBhbmQgYXZlcmFnaW5nLCA0IHBlbHMgcGVyIGl0ZXJhdGlvbiAqLwotICAgICAgICBmb3IgKHggPSBwYXJ0V2lkdGg7IHg7IHgtLSkKLSAgICAgICAgewotICAgICAgICAgICAgdG1wNCA9IHB0clZbLShpMzIpd2lkdGgqMl07Ci0gICAgICAgICAgICB0bXA1ID0gcHRyVlstKGkzMil3aWR0aF07Ci0gICAgICAgICAgICB0bXAxID0gcHRyVlt3aWR0aF07Ci0gICAgICAgICAgICB0bXAyID0gcHRyVlt3aWR0aCoyXTsKLSAgICAgICAgICAgIHRtcDYgPSAqcHRyVisrOwotCi0gICAgICAgICAgICB0bXA3ID0gdG1wNCArIHRtcDE7Ci0gICAgICAgICAgICB0bXAyIC09ICh0bXA3IDw8IDIpOwotICAgICAgICAgICAgdG1wMiAtPSB0bXA3OwotICAgICAgICAgICAgdG1wMiArPSAxNjsKLSAgICAgICAgICAgIHRtcDcgPSB0bXA1ICsgdG1wNjsKLSAgICAgICAgICAgIHRtcDMgPSBwdHJDW3dpZHRoKjJdOwotICAgICAgICAgICAgdG1wMiArPSAodG1wNyA8PCA0KTsKLSAgICAgICAgICAgIHRtcDIgKz0gKHRtcDcgPDwgMik7Ci0gICAgICAgICAgICB0bXAyICs9IHRtcDM7Ci0gICAgICAgICAgICB0bXA3ID0gY2xwW3RtcDI+PjVdOwotICAgICAgICAgICAgdG1wMiA9IG1iWzQ4XTsKLSAgICAgICAgICAgIHRtcDEgKz0gMTY7Ci0gICAgICAgICAgICB0bXA3Kys7Ci0gICAgICAgICAgICBtYls0OF0gPSAodTgpKCh0bXAyICsgdG1wNykgPj4gMSk7Ci0KLSAgICAgICAgICAgIHRtcDcgPSB0bXAzICsgdG1wNjsKLSAgICAgICAgICAgIHRtcDEgLT0gKHRtcDcgPDwgMik7Ci0gICAgICAgICAgICB0bXAxIC09IHRtcDc7Ci0gICAgICAgICAgICB0bXA3ID0gdG1wNCArIHRtcDU7Ci0gICAgICAgICAgICB0bXAyID0gcHRyQ1t3aWR0aF07Ci0gICAgICAgICAgICB0bXAxICs9ICh0bXA3IDw8IDQpOwotICAgICAgICAgICAgdG1wMSArPSAodG1wNyA8PCAyKTsKLSAgICAgICAgICAgIHRtcDEgKz0gdG1wMjsKLSAgICAgICAgICAgIHRtcDcgPSBjbHBbdG1wMT4+NV07Ci0gICAgICAgICAgICB0bXAxID0gbWJbMzJdOwotICAgICAgICAgICAgdG1wNiArPSAxNjsKLSAgICAgICAgICAgIHRtcDcrKzsKLSAgICAgICAgICAgIG1iWzMyXSA9ICh1OCkoKHRtcDEgKyB0bXA3KSA+PiAxKTsKLQotICAgICAgICAgICAgdG1wMSA9ICpwdHJDOwotICAgICAgICAgICAgdG1wNyA9IHRtcDIgKyB0bXA1OwotICAgICAgICAgICAgdG1wNiAtPSAodG1wNyA8PCAyKTsKLSAgICAgICAgICAgIHRtcDYgLT0gdG1wNzsKLSAgICAgICAgICAgIHRtcDcgPSB0bXA0ICsgdG1wMzsKLSAgICAgICAgICAgIHRtcDYgKz0gKHRtcDcgPDwgNCk7Ci0gICAgICAgICAgICB0bXA2ICs9ICh0bXA3IDw8IDIpOwotICAgICAgICAgICAgdG1wNiArPSB0bXAxOwotICAgICAgICAgICAgdG1wNyA9IGNscFt0bXA2Pj41XTsKLSAgICAgICAgICAgIHRtcDYgPSBtYlsxNl07Ci0gICAgICAgICAgICB0bXA1ICs9IDE2OwotICAgICAgICAgICAgdG1wNysrOwotICAgICAgICAgICAgbWJbMTZdID0gKHU4KSgodG1wNiArIHRtcDcpID4+IDEpOwotCi0gICAgICAgICAgICB0bXA2ID0gcHRyQ1stKGkzMil3aWR0aF07Ci0gICAgICAgICAgICB0bXAxICs9IHRtcDQ7Ci0gICAgICAgICAgICB0bXA1IC09ICh0bXAxIDw8IDIpOwotICAgICAgICAgICAgdG1wNSAtPSB0bXAxOwotICAgICAgICAgICAgdG1wMyArPSB0bXAyOwotICAgICAgICAgICAgdG1wNSArPSAodG1wMyA8PCA0KTsKLSAgICAgICAgICAgIHRtcDUgKz0gKHRtcD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ICAgICAgdG1wNyA9IHRtcDEgKyB0bXA0OwotICAgICAgICAgICAgdG1wNiA9ICpwdHJKKys7Ci0gICAgICAgICAgICB0bXA1IC09ICh0bXA3IDw8IDIpOwotICAgICAgICAgICAgdG1wNSAtPSB0bXA3OwotICAgICAgICAgICAgdG1wNSArPSB0bXA2OwotICAgICAgICAgICAgKmIxKysgPSB0bXA1OwotICAgICAgICAgICAgLyogVGhpcmQgcGl4ZWwgKi8KLSAgICAgICAgICAgIHRtcDcgPSB0bXAxICsgdG1wMjsKLSAgICAgICAgICAgIHRtcDQgKz0gKHRtcDcgPDwgNCk7Ci0gICAgICAgICAgICB0bXA0ICs9ICh0bXA3IDw8IDIpOwotICAgICAgICAgICAgdG1wNyA9IHRtcDYgKyB0bXAzOwotICAgICAgICAgICAgdG1wNSA9ICpwdHJKKys7Ci0gICAgICAgICAgICB0bXA0IC09ICh0bXA3IDw8IDIpOwotICAgICAgICAgICAgdG1wNCAtPSB0bXA3OwotICAgICAgICAgICAgdG1wNCArPSB0bXA1OwotICAgICAgICAgICAgKmIxKysgPSB0bXA0OwotICAgICAgICAgICAgLyogRm91cnRoIHBpeGVsICovCi0gICAgICAgICAgICB0bXA3ID0gdG1wNiArIHRtcDE7Ci0gICAgICAgICAgICB0bXAzICs9ICh0bXA3IDw8IDQpOwotICAgICAgICAgICAgdG1wMyArPSAodG1wNyA8PCAyKTsKLSAgICAgICAgICAgIHRtcDcgPSB0bXA1ICsgdG1wMjsKLSAgICAgICAgICAgIHRtcDQgPSAqcHRySisrOwotICAgICAgICAgICAgdG1wMyAtPSAodG1wNyA8PCAyKTsKLSAgICAgICAgICAgIHRtcDMgLT0gdG1wNzsKLSAgICAgICAgICAgIHRtcDMgKz0gdG1wNDsKLSAgICAgICAgICAgICpiMSsrID0gdG1wMzsKLSAgICAgICAgICAgIHRtcDcgPSB0bXA0OwotICAgICAgICAgICAgdG1wNCA9IHRtcDY7Ci0gICAgICAgICAgICB0bXA2ID0gdG1wMjsKLSAgICAgICAgICAgIHRtcDIgPSB0bXA3OwotICAgICAgICAgICAgdG1wMyA9IHRtcDU7Ci0gICAgICAgICAgICB0bXA1ID0gdG1wMTsKLSAgICAgICAgfQotICAgICAgICBwdHJKICs9IHdpZHRoIC0gcGFydFdpZHRoOwotICAgIH0KLQotICAgIC8qIFNlY29uZCBzdGVwOiBjYWxjdWxhdGUgdmVydGljYWwgaW50ZXJwb2xhdGlvbiAqLwotICAgIHB0ckMgPSB0YWJsZSArIHBhcnRXaWR0aDsKLSAgICBwdHJWID0gcHRyQyArIDUqcGFydFdpZHRoOwotICAgIGZvciAoeSA9IChwYXJ0SGVpZ2h0ID4+IDIpOyB5OyB5LS0pCi0gICAgewotICAgICAgICAvKiA0IHBlbHMgcGVyIGl0ZXJhdGlvbiAqLwotICAgICAgICBmb3IgKHggPSBwYXJ0V2lkdGg7IHg7IHgtLSkKLSAgICAgICAgewotICAgICAgICAgICAgdG1wNCA9IHB0clZbLShpMzIpcGFydFdpZHRoKjJdOwotICAgICAgICAgICAgdG1wNSA9IHB0clZbLShpMzIpcGFydFdpZHRoXTsKLSAgICAgICAgICAgIHRtcDEgPSBwdHJWW3BhcnRXaWR0aF07Ci0gICAgICAgICAgICB0bXAyID0gcHRyVltwYXJ0V2lkdGgqMl07Ci0gICAgICAgICAgICB0bXA2ID0gKnB0clYrKzsKLQotICAgICAgICAgICAgdG1wNyA9IHRtcDQgKyB0bXAxOwotICAgICAgICAgICAgdG1wMiAtPSAodG1wNyA8PCAyKTsKLSAgICAgICAgICAgIHRtcDIgLT0gdG1wNzsKLSAgICAgICAgICAgIHRtcDIgKz0gNTEyOwotICAgICAgICAgICAgdG1wNyA9IHRtcDUgKyB0bXA2OwotICAgICAgICAgICAgdG1wMyA9IHB0ckNbcGFydFdpZHRoKjJdOwotICAgICAgICAgICAgdG1wMiArPSAodG1wNyA8PCA0KTsKLSAgICAgICAgICAgIHRtcDIgKz0gKHRtcDcgPDwgMik7Ci0gICAgICAgICAgICB0bXAyICs9IHRtcDM7Ci0gICAgICAgICAgICB0bXA3ID0gY2xwW3RtcDI+PjEwXTsKLSAgICAgICAgICAgIHRtcDEgKz0gNTEyOwotICAgICAgICAgICAgbWJbNDhdID0gKHU4KXRtcDc7Ci0KLSAgICAgICAgICAgIHRtcDcgPSB0bXAzICsgdG1wNjsKLSAgICAgICAgICAgIHRtcDEgLT0gKHRtcDcgPDwgMik7Ci0gICAgICAgICAgICB0bXAxIC09IHRtcDc7Ci0gICAgICAgICAgICB0bXA3ID0gdG1wNCArIHRtcDU7Ci0gICAgICAgICAgICB0bXAyID0gcHRyQ1twYXJ0V2lkdGhdOwotICAgICAgICAgICAgdG1wMSArPSAodG1wNyA8PCA0KTsKLSAgICAgICAgICAgIHRtcDEgKz0gKHRtcDcgPDwgMik7Ci0gICAgICAgICAgICB0bXAxICs9IHRtcDI7Ci0gICAgICAgICAgICB0bXA3ID0gY2xwW3RtcDE+PjEwXTsKLSAgICAgICAgICAgIHRtcDYgKz0gNTEyOwotICAgICAgICAgICAgbWJbMzJdID0gKHU4KXRtcDc7Ci0KLSAgICAgICAgICAgIHRtcDEgPSAqcHRyQzsKLSAgICAgICAgICAgIHRtcDcgPSB0bXAyICsgdG1wNTsKLSAgICAgICAgICAgIHRtcDYgLT0gKHRtcDcgPDwgMik7Ci0gICAgICAgICAgICB0bXA2IC09IHRtcDc7Ci0gICAgICAgICAgICB0bXA3ID0gdG1wNCArIHRtcDM7Ci0gICAgICAgICAgICB0bXA2ICs9ICh0bXA3IDw8IDQpOwotICAgICAgICAgICAgdG1wNiArPSAodG1wNyA8PCAyKTsKLSAgICAgICAgICAgIHRtcDYgKz0gdG1wMTsKLSAgICAgICAgICAgIHRtcDcgPSBjbHBbdG1wNj4+MTBdOwotICAgICAgICAgICAgdG1wNSArPSA1MTI7Ci0gICAgICAgICAgICBtYlsxNl0gPSAodTgpdG1wNzsKLQotICAgICAgICAgICAgdG1wNiA9IHB0ckNbLShpMzIpcGFydFdpZHRoXTsKLSAgICAgIC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odCs1LCBwYXJ0V2lkdGgrNSk7Ci0KLSAgICAgICAgeDAgPSAwOwotICAgICAgICB5MCA9IDA7Ci0gICAgICAgIHJlZiA9ICh1OCopcDE7Ci0gICAgICAgIHdpZHRoID0gcGFydFdpZHRoKzU7Ci0gICAgfQotCi0gICAgcmVmICs9ICh1MzIpeTAgKiB3aWR0aCArICh1MzIpeDA7Ci0KLSAgICBiMSA9IHRhYmxlOwotICAgIHB0ckogPSByZWYgKyA1OwotCi0gICAgLyogRmlyc3Qgc3RlcDogY2FsY3VsYXRlIGludGVybWVkaWF0ZSB2YWx1ZXMgZm9yCi0gICAgICogaG9yaXpvbnRhbCBpbnRlcnBvbGF0aW9uICovCi0gICAgZm9yICh5ID0gcGFydEhlaWdodCArIDU7IHk7IHktLSkKLSAgICB7Ci0gICAgICAgIHRtcDYgPSAqKHB0ckogLSA1KTsKLSAgICAgICAgdG1wNSA9ICoocHRySiAtIDQpOwotICAgICAgICB0bXA0ID0gKihwdHJKIC0gMyk7Ci0gICAgICAgIHRtcDMgPSAqKHB0ckogLSAyKTsKLSAgICAgICAgdG1wMiA9ICoocHRySiAtIDEpOwotICAgICAgICBmb3IgKHggPSAocGFydFdpZHRoID4+IDIpOyB4OyB4LS0pCi0gICAgICAgIHsKLSAgICAgICAgICAgIC8qIEZpcnN0IHBpeGVsICovCi0gICAgICAgICAgICB0bXA3ID0gdG1wMyArIHRtcDQ7Ci0gICAgICAgICAgICB0bXA2ICs9ICh0bXA3IDw8IDQpOwotICAgICAgICAgICAgdG1wNiArPSAodG1wNyA8PCAyKTsKLSAgICAgICAgICAgIHRtcDcgPSB0bXAyICsgdG1wNTsKLSAgICAgICAgICAgIHRtcDEgPSAqcHRySisrOwotICAgICAgICAgICAgdG1wNiAtPSAodG1wNyA8PCAyKTsKLSAgICAgICAgICAgIHRtcDYgLT0gdG1wNzsKLSAgICAgICAgICAgIHRtcDYgKz0gdG1wMTsKLSAgICAgICAgICAgICpiMSsrID0gdG1wNjsKLSAgICAgICAgICAgIC8qIFNlY29uZCBwaXhlbCAqLwotICAgICAgICAgICAgdG1wNyA9IHRtcDIgKyB0bXAzOwotICAgICAgICAgICAgdG1wNSArPSAodG1wNyA8PCA0KTsKLSAgICAgICAgICAgIHRtcDUgKz0gKHRtcDcgPDwgMik7Ci0gICAgICAgICAgICB0bXA3ID0gdG1wMSArIHRtcDQ7Ci0gICAgICAgICAgICB0bXA2ID0gKnB0ckorKzsKLSAgICAgICAgICAgIHRtcDUgLT0gKHRtcDcgPDwgMik7Ci0gICAgICAgICAgICB0bXA1IC09IHRtcDc7Ci0gICAgICAgICAgICB0bXA1ICs9IHRtcDY7Ci0gICAgICAgICAgICAqYjErKyA9IHRtcDU7Ci0gICAgICAgICAgICAvKiBUaGlyZCBwaXhlbCAqLwotICAgICAgICAgICAgdG1wNyA9IHRtcDEgKyB0bXAyOwotICAgICAgICAgICAgdG1wNCArPSAodG1wNyA8PCA0KTsKLSAgICAgICAgICAgIHRtcDQgKz0gKHRtcDcgPDwgMik7Ci0gICAgICAgICAgICB0bXA3ID0gdG1wNiArIHRtcDM7Ci0gICAgICAgICAgICB0bXA1ID0gKnB0ckorKzsKLSAgICAgICAgICAgIHRtcDQgLT0gKHRtcDcgPDwgMik7Ci0gICAgICAgICAgICB0bXA0IC09IHRtcDc7Ci0gICAgICAgICAgICB0bXA0ICs9IHRtcDU7Ci0gICAgICAgICAgICAqYjErKyA9IHRtcDQ7Ci0gICAgICAgICAgICAvKiBGb3VydGggcGl4ZWwgKi8KLSAgICAgICAgICAgIHRtcDcgPSB0bXA2ICsgdG1wMTsKLSAgICAgICAgICAgIHRtcDMgKz0gKHRtcDcgPDwgNCk7Ci0gICAgICAgICAgICB0bXAzICs9ICh0bXA3IDw8IDIpOwotICAgICAgICAgICAgdG1wNyA9IHRtcDUgKyB0bXAyOwotICAgICAgICAgICAgdG1wNCA9ICpwdHJKKys7Ci0gICAgICAgICAgICB0bXAzIC09ICh0bXA3IDw8IDIpOwotICAgICAgICAgICA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sgdG1wMTsKLSAgICAgICAgICAgIHRtcDIgLT0gKHRtcDcgPDwgMik7Ci0gICAgICAgICAgICB0bXAyIC09IHRtcDc7Ci0gICAgICAgICAgICB0bXAyICs9IDUxMjsKLSAgICAgICAgICAgIHRtcDcgPSB0bXA1ICsgdG1wNjsKLSAgICAgICAgICAgIHRtcDMgPSBwdHJDW3BhcnRXaWR0aCoyXTsKLSAgICAgICAgICAgIHRtcDIgKz0gKHRtcDcgPDwgNCk7Ci0gICAgICAgICAgICB0bXAyICs9ICh0bXA3IDw8IDIpOwotICAgICAgICAgICAgdG1wNyA9IHB0ckludFtwYXJ0V2lkdGgqMl07Ci0gICAgICAgICAgICB0bXAyICs9IHRtcDM7Ci0gICAgICAgICAgICB0bXAyID0gY2xwW3RtcDI+PjEwXTsKLSAgICAgICAgICAgIHRtcDcgKz0gMTY7Ci0gICAgICAgICAgICB0bXA3ID0gY2xwW3RtcDc+PjVdOwotICAgICAgICAgICAgdG1wMSArPSA1MTI7Ci0gICAgICAgICAgICB0bXAyKys7Ci0gICAgICAgICAgICBtYls0OF0gPSAodTgpKCh0bXA3ICsgdG1wMikgPj4gMSk7Ci0KLSAgICAgICAgICAgIHRtcDcgPSB0bXAzICsgdG1wNjsKLSAgICAgICAgICAgIHRtcDEgLT0gKHRtcDcgPDwgMik7Ci0gICAgICAgICAgICB0bXAxIC09IHRtcDc7Ci0gICAgICAgICAgICB0bXA3ID0gdG1wNCArIHRtcDU7Ci0gICAgICAgICAgICB0bXAyID0gcHRyQ1twYXJ0V2lkdGhdOwotICAgICAgICAgICAgdG1wMSArPSAodG1wNyA8PCA0KTsKLSAgICAgICAgICAgIHRtcDEgKz0gKHRtcDcgPDwgMik7Ci0gICAgICAgICAgICB0bXA3ID0gcHRySW50W3BhcnRXaWR0aF07Ci0gICAgICAgICAgICB0bXAxICs9IHRtcDI7Ci0gICAgICAgICAgICB0bXAxID0gY2xwW3RtcDE+PjEwXTsKLSAgICAgICAgICAgIHRtcDcgKz0gMTY7Ci0gICAgICAgICAgICB0bXA3ID0gY2xwW3RtcDc+PjVdOwotICAgICAgICAgICAgdG1wNiArPSA1MTI7Ci0gICAgICAgICAgICB0bXAxKys7Ci0gICAgICAgICAgICBtYlszMl0gPSAodTgpKCh0bXA3ICsgdG1wMSkgPj4gMSk7Ci0KLSAgICAgICAgICAgIHRtcDEgPSAqcHRyQzsKLSAgICAgICAgICAgIHRtcDcgPSB0bXAyICsgdG1wNTsKLSAgICAgICAgICAgIHRtcDYgLT0gKHRtcDcgPDwgMik7Ci0gICAgICAgICAgICB0bXA2IC09IHRtcDc7Ci0gICAgICAgICAgICB0bXA3ID0gdG1wNCArIHRtcDM7Ci0gICAgICAgICAgICB0bXA2ICs9ICh0bXA3IDw8IDQpOwotICAgICAgICAgICAgdG1wNiArPSAodG1wNyA8PCAyKTsKLSAgICAgICAgICAgIHRtcDcgPSAqcHRySW50OwotICAgICAgICAgICAgdG1wNiArPSB0bXAxOwotICAgICAgICAgICAgdG1wNiA9IGNscFt0bXA2Pj4xMF07Ci0gICAgICAgICAgICB0bXA3ICs9IDE2OwotICAgICAgICAgICAgdG1wNyA9IGNscFt0bXA3Pj41XTsKLSAgICAgICAgICAgIHRtcDUgKz0gNTEyOwotICAgICAgICAgICAgdG1wNisrOwotICAgICAgICAgICAgbWJbMTZdID0gKHU4KSgodG1wNyArIHRtcDYpID4+IDEpOwotCi0gICAgICAgICAgICB0bXA2ID0gcHRyQ1stKGkzMilwYXJ0V2lkdGhdOwotICAgICAgICAgICAgdG1wMSArPSB0bXA0OwotICAgICAgICAgICAgdG1wNSAtPSAodG1wMSA8PCAyKTsKLSAgICAgICAgICAgIHRtcDUgLT0gdG1wMTsKLSAgICAgICAgICAgIHRtcDMgKz0gdG1wMjsKLSAgICAgICAgICAgIHRtcDUgKz0gKHRtcDMgPDwgNCk7Ci0gICAgICAgICAgICB0bXA1ICs9ICh0bXAzIDw8IDIpOwotICAgICAgICAgICAgdG1wNyA9IHB0ckludFstKGkzMilwYX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GFydFdpZHRoKzUsIHBhcnRIZWlnaHQrNSwgcGFydFdpZHRoKzUpOwotCi0gICAgICAgIHgwID0gMDsKLSAgICAgICAgeTAgPSAwOwotICAgICAgICByZWYgPSAodTgqKXAxOwotICAgICAgICB3aWR0aCA9IHBhcnRXaWR0aCs1OwotICAgIH0KLQotICAgIHJlZiArPSAodTMyKXkwICogd2lkdGggKyAodTMyKXgwOwotCi0gICAgaDEgPSB0YWJsZSArIHRhYmxlV2lkdGg7Ci0gICAgcHRyQyA9IHJlZiArIHdpZHRoOwotICAgIHB0clYgPSBwdHJDICsgNSp3aWR0aDsKLQotICAgIC8qIEZpcnN0IHN0ZXA6IGNhbGN1bGF0ZSBpbnRlcm1lZGlhdGUgdmFsdWVzIGZvcgotICAgICAqIHZlcnRpY2FsIGludGVycG9sYXRpb24gKi8KLSAgICBmb3IgKHkgPSAocGFydEhlaWdodCA+PiAyKTsgeTsgeS0tKQotICAgIHsKLSAgICAgICAgZm9yICh4ID0gKHUzMil0YWJsZVdpZHRoOyB4OyB4LS0pCi0gICAgICAgIHsKLSAgICAgICAgICAgIHRtcDQgPSBwdHJWWy0oaTMyKXdpZHRoKjJdOwotICAgICAgICAgICAgdG1wNSA9IHB0clZbLShpMzIpd2lkdGhdOwotICAgICAgICAgICAgdG1wMSA9IHB0clZbd2lkdGhdOwotICAgICAgICAgICAgdG1wMiA9IHB0clZbd2lkdGgqMl07Ci0gICAgICAgICAgICB0bXA2ID0gKnB0clYrKzsKLQotICAgICAgICAgICAgdG1wNyA9IHRtcDQgKyB0bXAxOwotICAgICAgICAgICAgdG1wMiAtPSAodG1wNyA8PCAyKTsKLSAgICAgICAgICAgIHRtcDIgLT0gdG1wNzsKLSAgICAgICAgICAgIHRtcDcgPSB0bXA1ICsgdG1wNjsKLSAgICAgICAgICAgIHRtcDMgPSBwdHJDW3dpZHRoKjJdOwotICAgICAgICAgICAgdG1wMiArPSAodG1wNyA8PCA0KTsKLSAgICAgICAgICAgIHRtcDIgKz0gKHRtcDcgPDwgMik7Ci0gICAgICAgICAgICB0bXAyICs9IHRtcDM7Ci0gICAgICAgICAgICBoMVt0YWJsZVdpZHRoKjJdID0gdG1wMjsKLQotICAgICAgICAgICAgdG1wNyA9IHRtcDMgKyB0bXA2OwotICAgICAgICAgICAgdG1wMSAtPSAodG1wNyA8PCAyKTsKLSAgICAgICAgICAgIHRtcDEgLT0gdG1wNzsKLSAgICAgICAgICAgIHRtcDcgPSB0bXA0ICsgdG1wNTsKLSAgICAgICAgICAgIHRtcDIgPSBwdHJDW3dpZHRoXTsKLSAgICAgICAgICAgIHRtcDEgKz0gKHRtcDcgPDwgNCk7Ci0gICAgICAgICAgICB0bXAxICs9ICh0bXA3IDw8IDIpOwotICAgICAgICAgICAgdG1wMSArPSB0bXAyOwotICAgICAgICAgICAgaDFbdGFibGVXaWR0aF0gPSB0bXAxOwotCi0gICAgICAgICAgICB0bXAxID0gKnB0ckM7Ci0gICAgICAgICAgICB0bXA3ID0gdG1wMiArIHRtcDU7Ci0gICAgICAgICAgICB0bXA2IC09ICh0bXA3IDw8IDIpOwotICAgICAgICAgICAgdG1wNiAtPSB0bXA3OwotICAgICAgICAgICAgdG1wNyA9IHRtcDQgKyB0bXAzOwotICAgICAgICAgICAgdG1wNiArPSAodG1wNyA8PCA0KTsKLSAgICAgICAgICAgIHRtcDYgKz0gKHRtcDcgPDwgMik7Ci0gICAgICAgICAgICB0bXA2ICs9IHRtcDE7Ci0gICAgICAgICAgICAqaDEgPSB0bXA2OwotCi0gICAgICAgICAgICB0bXA2ID0gcHRyQ1stKGkzMil3aWR0aF07Ci0gICAgICAgICAgICB0bXAxICs9IHRtcDQ7Ci0gICAgICAgICAgICB0bXA1IC09ICh0bXAxIDw8IDIpOwotICAgICAgICAgICAgdG1wNSAtPSB0bXAxOwotICAgICAgICAgICAgdG1wMyArPSB0bXAyOwotICAgICAgICAgICAgdG1wNSArPSAodG1wMyA8PCA0KTsKLSAgICAgICAgICAgIHRtcDUgKz0gKHRtcDMgPDwgMik7Ci0gICAgICAgICAgICB0bXA1ICs9IHRtcDY7Ci0gICAgICAgICAgICBoMVstdGFibGVXaWR0aF0gPSB0bXA1OwotICAgICAgICAgICAgaDErKzsKLSAgICAgICAgICAgIHB0ckMrKzsKLSAgICAgICAgfQotICAgICAgICBwdHJDICs9IDQqd2lkdGggLSBwYXJ0V2lkdGggLSA1OwotICAgICAgICBwdHJWICs9IDQqd2lkdGggLSBwYXJ0V2lkdGggLSA1OwotICAgICAgICBoMSArPSAzKnRhYmxlV2lkdGg7Ci0gICAgfQotCi0gICAgLyogU2Vjb25kIHN0ZXA6IGNhbGN1bGF0ZSBob3Jpem9udGFsIGludGVycG9sYXRpb24gYW5kIGF2ZXJhZ2UgKi8KLSAgICBwdHJKID0gdGFibGUgKyA1OwotICAgIC8qIFBvaW50ZXIgdG8gaW50ZWdlciBzYW1wbGUgcG9zaXRpb24sIGVpdGhlciBHIG9yIEggKi8KLSAgICBwdHJJbnQgPSB0YWJsZSArIDIgKyBob3JPZmZzZXQ7Ci0gICAgZm9yICh5ID0gcGFydEhlaWdodDsgeTsgeS0tKQotICAgIHsKLSAgICAgICAgdG1wNiA9ICoocHRySiAtIDUpOwotICAgICAgICB0bXA1ID0gKihwdHJKIC0gNCk7Ci0gICAgICAgIHRtcDQgPSAqKHB0ckogLSAzKTsKLSAgICAgICAgdG1wMyA9ICoocHRySiAtIDIpOwotICAgICAgICB0bXAyID0gKihwdHJKIC0gMSk7Ci0gICAgICAgIGZvciAoeCA9IChwYXJ0V2lkdGg+PjIpOyB4OyB4LS0pCi0gICAgICAgIHsKLSAgICAgICAgICAgIC8qIEZpcnN0IHBpeGVsICovCi0gICAgICAgICAgICB0bXA2ICs9IDUxMjsKLSAgICAgICAgICAgIHRtcDcgPSB0bXAzICsgdG1wNDsKLSAgICAgICAgICAgIHRtcDYgKz0gKHRtcDcgPDwgNCk7Ci0gICAgICAgICAgICB0bXA2ICs9ICh0bXA3IDw8IDIpOwotICAgICAgICAgICAgdG1wNyA9IHRtcDIgKyB0bXA1OwotICAgICAgICAgICAgdG1wMSA9ICpwdHJKKys7Ci0gICAgICAgICAgICB0bXA2IC09ICh0bXA3IDw8IDIpOwotICAgICAgICAgICAgdG1wNiAtPSB0bXA3OwotICAgICAgICAgICAgdG1wNyA9ICpwdHJJbnQrKzsKLSAgICAgICAgICAgIHRtcDYgKz0gdG1wMTsKLSAgICAgICAgICAgIHRtcDYgPSBjbHBbdG1wNiA+PiAxMF07Ci0gICAgICAgICAgICB0bXA3ICs9IDE2OwotICAgICAgICAgICAgdG1wNyA9IGNscFt0bXA3ID4+IDVdOwotICAgICAgICAgICAgdG1wNSArPSA1MTI7Ci0gICAgICAgICAgICB0bXA2Kys7Ci0gICAgICAgICAgICAqbWIrKyA9ICh1OCkoKHRtcDYgKyB0bXA3KSA+PiAxKTsKLSAgICAgICAgICAgIC8qIFNlY29uZCBwaXhlbCAqLwotICAgICAgICAgICAgdG1wNyA9IHRtcDIgKyB0bXAzOwotICAgICAgICAgICAgdG1wNSArPSAodG1wNyA8PCA0KTsKLSAgICAgICAgICAgIHRtcDUgKz0gKHRtcDcgPDwgMik7Ci0gICAgICAgICAgICB0bXA3ID0gdG1wMSArIHRtcDQ7Ci0gICAgICAgICAgICB0bXA2ID0gKnB0ckorKzsKLSAgICAgICAgICAgIHRtcDUgLT0gKHRtcDcgPDwgMik7Ci0gICAgICAgICAgICB0bXA1IC09IHRtcDc7Ci0gICAgICAgICAgICB0bXA3ID0gKnB0ckludCsrOwotICAgICAgICAgICAgdG1wNSArPSB0bXA2OwotICAgICAgICAgICAgdG1wNSA9IGNscFt0bXA1ID4+IDEwXTsKLSAgICAgICAgICAgIHRtcDcgKz0gMTY7Ci0gICAgICAgICAgICB0bXA3ID0gY2xwW3RtcDcgPj4gNV07Ci0gICAgICAgICAgICB0bXA0ICs9IDUxMjsKLSAgICAgICAgICAgIHRtcDUrKzsKLSAgICAgICAgICAgICptYisrID0gKHU4KSgodG1wNSArIHRtcDcpID4+IDEpOwotICAgICAgICAgICAgLyogVGhpcmQgcGl4ZWwgKi8KLSAgICAgICAgICAgIHRtcDcgPSB0bXAxICsgdG1wMjsKLSAgICAgICAgICAgIHRtcDQgKz0gKHRtcDcgPDwgNCk7Ci0gICAgICAgICAgICB0bXA0ICs9ICh0bXA3IDw8IDIpOwotICAgICAgICAgICAgdG1wNyA9IHRtcDYgKyB0bXAzOwotICAgICAgICAgICAgdG1wNSA9ICpwdHJKKys7Ci0gICAgICAgICAgICB0bXA0IC09ICh0bXA3IDw8IDIpOwotICAgICAgICAgICAgdG1wNCAtPSB0bXA3OwotICAgICAgICAgICAgdG1wNyA9ICpwdHJJbnQrKzsKLSAgICAgICAgICAgIHRtcDQgKz0gdG1wNTsKLSAgICAgICAgICAgIHRtcDQgPSBjbHBbdG1wNCA+PiAxMF07Ci0gICAgICAgICAgICB0bXA3ICs9IDE2OwotICAgICAgICAgICAgdG1wNyA9IGNscFt0bXA3ID4+IDVdOwotICAgICAgICAgICAgdG1wMyArPSA1MTI7Ci0gICAgICAgICAgICB0bXA0Kys7Ci0gICAgICAgICAgICAqbWIrKyA9ICh1OCkoKHRtcDQgKyB0bXA3KSA+PiAxKTsKLSAgICAgICAgICAgIC8qIEZvdXJ0aCBwaXhlbCAqLwotICAgICAgICAgICAgdG1wNyA9IHRtcDYgKyB0bXAxOwotICAgICAgICAgICAgdG1wMyArPSAodG1wNyA8PCA0KTsKLSAgICAgICAgICAgIHRtcDMgKz0gKHRtcDcgPDwgMik7Ci0gICAgICAgICAgICB0bXA3ID0gdG1wNSArIHRtcDI7Ci0gICAgICAgICAgICB0bXA0ID0gKnB0ckorKzsKLSAgICAgICAgICAgIHRtcDMgLT0gKHRtcDcgPDwgMik7Ci0gICAgICAgICAgICB0bXAzIC09IHRtcDc7Ci0gICAgICAgICAgICB0bXA3ID0gKnB0ckludCsrOwotICAgICAgICAgICAgdG1wMyArPSB0bXA0OwotICAgICAgICAgICAgdG1wMyA9IGNscFt0bXAzID4+IDE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gIHN3aXRjaCAobHVtYUZyYWNQb3NbeEZyYWNdW3lGcmFjXSkKLSAgICB7Ci0gICAgICAgIGNhc2UgMDogLyogRyAqLwotICAgICAgICAgICAgaDI2NGJzZEZpbGxCbG9jayhyZWZQaWMtPmRhdGEsIGx1bWFQYXJ0RGF0YSwKLSAgICAgICAgICAgICAgICAgICAgeEludCx5SW50LHdpZHRoLGhlaWdodCxwYXJ0V2lkdGgscGFydEhlaWdodCwxNik7Ci0gICAgICAgICAgICBicmVhazsKLSAgICAgICAgY2FzZSAxOiAvKiBkICovCi0gICAgICAgICAgICBoMjY0YnNkSW50ZXJwb2xhdGVWZXJRdWFydGVyKHJlZlBpYy0+ZGF0YSwgbHVtYVBhcnREYXRhLAotICAgICAgICAgICAgICAgICAgICB4SW50LCB5SW50LTIsIHdpZHRoLCBoZWlnaHQsIHBhcnRXaWR0aCwgcGFydEhlaWdodCwgMCk7Ci0gICAgICAgICAgICBicmVhazsKLSAgICAgICAgY2FzZSAyOiAvKiBoICovCi0gICAgICAgICAgICBoMjY0YnNkSW50ZXJwb2xhdGVWZXJIYWxmKHJlZlBpYy0+ZGF0YSwgbHVtYVBhcnREYXRhLAotICAgICAgICAgICAgICAgICAgICB4SW50LCB5SW50LTIsIHdpZHRoLCBoZWlnaHQsIHBhcnRXaWR0aCwgcGFydEhlaWdodCk7Ci0gICAgICAgICAgICBicmVhazsKLSAgICAgICAgY2FzZSAzOiAvKiBuICovCi0gICAgICAgICAgICBoMjY0YnNkSW50ZXJwb2xhdGVWZXJRdWFydGVyKHJlZlBpYy0+ZGF0YSwgbHVtYVBhcnREYXRhLAotICAgICAgICAgICAgICAgICAgICB4SW50LCB5SW50LTIsIHdpZHRoLCBoZWlnaHQsIHBhcnRXaWR0aCwgcGFydEhlaWdodCwgMSk7Ci0gICAgICAgICAgICBicmVhazsKLSAgICAgICAgY2FzZSA0OiAvKiBhICovCi0gICAgICAgICAgICBoMjY0YnNkSW50ZXJwb2xhdGVIb3JRdWFydGVyKHJlZlBpYy0+ZGF0YSwgbHVtYVBhcnREYXRhLAotICAgICAgICAgICAgICAgICAgICB4SW50LTIsIHlJbnQsIHdpZHRoLCBoZWlnaHQsIHBhcnRXaWR0aCwgcGFydEhlaWdodCwgMCk7Ci0gICAgICAgICAgICBicmVhazsKLSAgICAgICAgY2FzZSA1OiAvKiBlICovCi0gICAgICAgICAgICBoMjY0YnNkSW50ZXJwb2xhdGVIb3JWZXJRdWFydGVyKHJlZlBpYy0+ZGF0YSwgbHVtYVBhcnREYXRhLAotICAgICAgICAgICAgICAgICAgICB4SW50LTIsIHlJbnQtMiwgd2lkdGgsIGhlaWdodCwgcGFydFdpZHRoLCBwYXJ0SGVpZ2h0LCAwKTsKLSAgICAgICAgICAgIGJyZWFrOwotICAgICAgICBjYXNlIDY6IC8qIGkgKi8KLSAgICAgICAgICAgIGgyNjRic2RJbnRlcnBvbGF0ZU1pZEhvclF1YXJ0ZXIocmVmUGljLT5kYXRhLCBsdW1hUGFydERhdGEsCi0gICAgICAgICAgICAgICAgICAgIHhJbnQtMiwgeUludC0yLCB3aWR0aCwgaGVpZ2h0LCBwYXJ0V2lkdGgsIHBhcnRIZWlnaHQsIDApOwotICAgICAgICAgICAgYnJlYWs7Ci0gICAgICAgIGNhc2UgNzogLyogcCAqLwotICAgICAgICAgICAgaDI2NGJzZEludGVycG9sYXRlSG9yVmVyUXVhcnRlcihyZWZQaWMtPmRhdGEsIGx1bWFQYXJ0RGF0YSwKLSAgICAgICAgICAgICAgICAgICAgeEludC0yLCB5SW50LTIsIHdpZHRoLCBoZWlnaHQsIHBhcnRXaWR0aCwgcGFydEhlaWdodCwgMik7Ci0gICAgICAgICAgICBicmVhazsKLSAgICAgICAgY2FzZSA4OiAvKiBiICovCi0gICAgICAgICAgICBoMjY0YnNkSW50ZXJwb2xhdGVIb3JIYWxmKHJlZlBpYy0+ZGF0YSwgbHVtYVBhcnREYXRhLAotICAgICAgICAgICAgICAgICAgICB4SW50LTIsIHlJbnQsIHdpZHRoLCBoZWlnaHQsIHBhcnRXaWR0aCwgcGFydEhlaWdodCk7Ci0gICAgICAgICAgICBicmVhazsKLSAgICAgICAgY2FzZSA5OiAvKiBmICovCi0gICAgICAgICAgICBoMjY0YnNkSW50ZXJwb2xhdGVNaWRWZXJRdWFydGVyKHJlZlBpYy0+ZGF0YSwgbHVtYVBhcnREYXRhLAotICAgICAgICAgICAgICAgICAgICB4SW50LTIsIHlJbnQtMiwgd2lkdGgsIGhlaWdodCwgcGFydFdpZHRoLCBwYXJ0SGVpZ2h0LCAwKTsKLSAgICAgICAgICAgIGJyZWFrOwotICAgICAgICBjYXNlIDEwOiAvKiBqICovCi0gICAgICAgICAgICBoMjY0YnNkSW50ZXJwb2xhdGVNaWRIYWxmKHJlZlBpYy0+ZGF0YSwgbHVtYVBhcnREYXRhLAotICAgICAgICAgICAgICAgICAgICB4SW50LTIsIHlJbnQtMiwgd2lkdGgsIGhlaWdodCwgcGFydFdpZHRoLCBwYXJ0SGVpZ2h0KTsKLSAgICAgICAgICAgIGJyZWFrOwotICAgICAgICBjYXNlIDExOiAvKiBxICovCi0gICAgICAgICAgICBoMjY0YnNkSW50ZXJwb2xhdGVNaWRWZXJRdWFydGVyKHJlZlBpYy0+ZGF0YSwgbHVtYVBhcnREYXRhLAotICAgICAgICAgICAgICAgICAgICB4SW50LTIsIHlJbnQtMiwgd2lkdGgsIGhlaWdodCwgcGFydFdpZHRoLCBwYXJ0SGVpZ2h0LCAxKTsKLSAgICAgICAgICAgIGJyZWFrOwotICAgICAgICBjYXNlIDEyOiAvKiBjICovCi0gICAgICAgICAgICBoMjY0YnNkSW50ZXJwb2xhdGVIb3JRdWFydGVyKHJlZlBpYy0+ZGF0YSwgbHVtYVBhcnREYXRhLAotICAgICAgICAgICAgICAgICAgICB4SW50LTIsIHlJbnQsIHdpZHRoLCBoZWlnaHQsIHBhcnRXaWR0aCwgcGFydEhlaWdodCwgMSk7Ci0gICAgICAgICAgICBicmVhazsKLSAgICAgICAgY2FzZSAxMzogLyogZyAqLwotICAgICAgICAgICAgaDI2NGJzZEludGVycG9sYXRlSG9yVmVyUXVhcnRlcihyZWZQaWMtPmRhdGEsIGx1bWFQYXJ0RGF0YSwKLSAgICAgICAgICAgICAgICAgICAgeEludC0yLCB5SW50LTIsIHdpZHRoLCBoZWlnaHQsIHBhcnRXaWR0aCwgcGFydEhlaWdodCwgMSk7Ci0gICAgICAgICAgICBicmVhazsKLSAgICAgICAgY2FzZSAxNDogLyogayAqLwotICAgICAgICAgICAgaDI2NGJzZEludGVycG9sYXRlTWlkSG9yUXVhcnRlcihyZWZQaWMtPmRhdGEsIGx1bWFQYXJ0RGF0YSwKLSAgICAgICAgICAgICAgICAgICAgeEludC0yLCB5SW50LTIsIHdpZHRoLCBoZWlnaHQsIHBhcnRXaWR0aCwgcGFydEhlaWdodCwgMSk7Ci0gICAgICAgICAgICBicmVhazsKLSAgICAgICAgZGVmYXVsdDogLyogY2FzZSAxNSwgciAqLwotICAgICAgICAgICAgaDI2NGJzZEludGVycG9sYXRlSG9yVmVyUXVhcnRlcihyZWZQaWMtPmRhdGEsIGx1bWFQYXJ0RGF0YSwKLSAgICAgICAgICAgICAgICAgICAgeEludC0yLCB5SW50LTIsIHdpZHRoLCBoZWlnaHQsIHBhcnRXaWR0aCwgcGFydEhlaWdodCwgMyk7Ci0gICAgICAgICAgICBicmVhazsKLSAgICB9Ci0KLSAgICAvKiBjaHJvbWEgKi8KLSAgICBQcmVkaWN0Q2hyb21hKAotICAgICAgZGF0YSArIDE2KjE2ICsgKHBhcnRZPj4xKSo4ICsgKHBhcnRYPj4xKSwKLSAgICAgIHhBICsgcGFydFgsCi0gICAgICB5QSArIHBhcnRZLAotICAgICAgcGFydFdpZHRoLAotICAgICAgcGFydEhlaWdodCwKLSAgICAgIG12LAotICAgICAgcmVmUGljKTsKLQotfQotCi0jZWxzZSAvKiBIMjY0REVDX09NWERMICovCi0vKi0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS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B5MCA9ICh5RnJhYykgPyB5SW50LTIgOiB5SW50OwotCi0gICAgaWYgKHhGcmFjKQotICAgIHsKLSAgICAgICAgaWYgKHBhcnRXaWR0aCA9PSAxNikKLSAgICAgICAgICAgIGZpbGxXaWR0aCA9IDMyOwotICAgICAgICBlbHNlCi0gICAgICAgICAgICBmaWxsV2lkdGggPSAxNjsKLSAgICB9Ci0gICAgZWxzZQotICAgICAgICBmaWxsV2lkdGggPSAocGFydFdpZHRoKjIpOwotICAgIGlmICh5RnJhYykKLSAgICAgICAgZmlsbEhlaWdodCA9IHBhcnRIZWlnaHQrNTsKLSAgICBlbHNlCi0gICAgICAgIGZpbGxIZWlnaHQgPSBwYXJ0SGVpZ2h0OwotCi0KLSAgICBpZiAoKHgwIDwgMCkgfHwgKCh1MzIpeDArZmlsbFdpZHRoID4gd2lkdGgpIHx8Ci0gICAgICAgICh5MCA8IDApIHx8ICgodTMyKXkwK2ZpbGxIZWlnaHQgPiBoZWlnaHQpKQotICAgIHsKLSAgICAgICAgaDI2NGJzZEZpbGxCbG9jayhyZWZQaWMtPmRhdGEsICh1OCopcEZpbGwsIHgwLCB5MCwgd2lkdGgsIGhlaWdodCwKLSAgICAgICAgICAgICAgICBmaWxsV2lkdGgsIGZpbGxIZWlnaHQsIGZpbGxXaWR0aCk7Ci0KLSAgICAgICAgeDAgPSAwOwotICAgICAgICB5MCA9IDA7Ci0gICAgICAgIHJlZiA9IHBGaWxsOwotICAgICAgICB3aWR0aCA9IGZpbGxXaWR0aDsKLSAgICAgICAgaWYgKHlGcmFjKQotICAgICAgICAgICAgcmVmICs9IDIqd2lkdGg7Ci0gICAgICAgIGlmICh4RnJhYykKLSAgICAgICAgICAgIHJlZiArPSAyOwotICAgIH0KLSAgICBlbHNlCi0gICAgewotICAgICAgICAvKmxpbnQgLS1lKDczNykgTG9zcyBvZiBzaWduICovCi0gICAgICAgIHJlZiA9IHJlZlBpYy0+ZGF0YSArIHlJbnQqd2lkdGggKyB4SW50OwotICAgI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ICAgICAgICBJbnB1dHM6Ci0gICAgICAgICAgcmVmICAgICAgICAgICAgICAgcG9pbnRlciB0byByZWZlcmVuY2UgZnJhbWUKLSAgICAgICAgICB4MCAgICAgICAgICAgICAgICB4LWNvb3JkaW5hdGUgZm9yIGJsb2NrCi0gICAgICAgICAgeTAgICAgICAgICAgICAgICAgeS1jb29yZGluYXRlIGZvciBibG9jawotICAgICAgICAgIHdpZHRoICAgICAgICAgICAgIHdpZHRoIG9mIHJlZmVyZW5jZSBmcmFtZQotICAgICAgICAgIGhlaWdodCAgICAgICAgICAgIGhlaWdodCBvZiByZWZlcmVuY2UgZnJhbWUKLSAgICAgICAgICBibG9ja1dpZHRoICAgICAgICB3aWR0aCBvZiBibG9jawotICAgICAgICAgIGJsb2NrSGVpZ2h0ICAgICAgIGhlaWdodCBvZiBibG9jawotICAgICAgICAgIGZpbGxTY2FuTGVuZ3RoICAgIGxlbmd0aCBvZiBhIGxpbmUgaW4gb3V0cHV0IGFycmF5IChwaXhlbHMpCi0gICAgICAgIE91dHB1dHM6Ci0gICAgICAgICAgZmlsbCAgICAgICAgICAgICAgcG9pbnRlciB0byBhcnJheSB3aGVyZSBvdXRwdXQgYmxvY2sgaXMgd3JpdHRlbgotCi0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0qLwotCi12b2lkIGgyNjRic2RGaWxsQmxvY2soCi0gIHU4ICpyZWYsCi0gIHU4ICpmaWxsLAotICBpMzIgeDAsCi0gIGkzMiB5MCwKLSAgdTMyIHdpZHRoLAotICB1MzIgaGVpZ2h0LAotICB1MzIgYmxvY2tXaWR0aCwKLSAgdTMyIGJsb2NrSGVpZ2h0LAotICB1MzIgZmlsbFNjYW5MZW5ndGgpCi0KLXsKLQotLyogVmFyaWFibGVzICovCi0KLSAgICBpMzIgeHN0b3AsIHlzdG9wOwotICAgIHZvaWQgK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hLCA4KSkgPT0gMHhGRikKLSAgICAgICAgewotICAgICAgICAgICAgcGF5bG9hZFR5cGUgKz0gMjU1OwotICAgICAgICAgICAgICAgICAgICB9Ci0gICAgICAgIGlmICh0bXAgPT0gRU5EX09GX1NUUkVBTSkKLSAgICAgICAgICAgIHJldHVybihIQU5UUk9fTk9LKTsKLSAgICAgICAgcGF5bG9hZFR5cGUgKz0gdG1wOwotCi0gICAgICAgIHBheWxvYWRTaXplID0gMDsKLSAgICAgICAgd2hpbGUoKHRtcCA9IGgyNjRic2RHZXRCaXRzKHBTdHJtRGF0YSwgOCkpID09IDB4RkYpCi0gICAgICAgIHsKLSAgICAgICAgICAgIHBheWxvYWRTaXplICs9IDI1NTsKLSAgICAgICAgfQotICAgICAgICBpZiAodG1wID09IEVORF9PRl9TVFJFQU0pCi0gICAgICAgICAgICByZXR1cm4oSEFOVFJPX05PSyk7Ci0gICAgICAgIHBheWxvYWRTaXplICs9IHRtcDsKLQotICAgICAgICBwU2VpTWVzc2FnZS0+cGF5bG9hZFR5cGUgPSBwYXlsb2FkVHlwZTsKLQotICAgICAgICBzd2l0Y2ggKHBheWxvYWRUeXBlKQotICAgICAgICB7Ci0gICAgICAgICAgICBjYXNlIDA6Ci0gICAgICAgICAgICAgICAgQVNTRVJUKHBTZXFQYXJhbVNldCk7Ci0gICAgICAgICAgICAgICAgc3RhdHVzID0gRGVjb2RlQnVmZmVyaW5nUGVyaW9kKAotICAgICAgICAgICAgICAgICAgcFN0cm1EYXRhLAotICAgICAgICAgICAgICAgICAgJnBTZWlNZXNzYWdlLT5idWZmZXJpbmdQZXJpb2QsCi0gICAgICAgICAgICAgICAgICBwU2VxUGFyYW1TZXQtPnZ1aVBhcmFtZXRlcnMtPnZjbEhyZFBhcmFtZXRlcnMuY3BiQ250LAotICAgICAgICAgICAgICAgICAgcFNlcVBhcmFtU2V0LT52dWlQYXJhbWV0ZXJzLT52Y2xIcmRQYXJhbWV0ZXJzLgotICAgICAgICAgICAgICAgICAgaW5pdGlhbENwYlJlbW92YWxEZWxheUxlbmd0aCwKLSAgICAgICAgICAgICAgICAgIHBTZXFQYXJhbVNldC0+dnVpUGFyYW1ldGVycy0+bmFsSHJkUGFyYW1ldGVyc1ByZXNlbnRGbGFnLAotICAgICAgICAgICAgICAgICAgcFNlcVBhcmFtU2V0LT52dWlQYXJhbWV0ZXJzLT52Y2xIcmRQYXJhbWV0ZXJzUHJlc2VudEZsYWcpOwotICAgICAgICAgICAgICAgIGJyZWFrOwotCi0gICAgICAgICAgICBjYXNlIDE6Ci0gICAgICAgICAgICAgICAgQVNTRVJUKHBTZXFQYXJhbVNldC0+dnVpUGFyYW1ldGVyc1ByZXNlbnRGbGFnKTsKLSAgICAgICAgICAgICAgICBzdGF0dXMgPSBEZWNvZGVQaWN0dXJlVGltaW5nKAotICAgICAgICAgICAgICAgICAgcFN0cm1EYXRhLAotICAgICAgICAgICAgICAgICAgJnBTZWlNZXNzYWdlLT5waWNUaW1pbmcsCi0gICAgICAgICAgICAgICAgICBwU2VxUGFyYW1TZXQtPnZ1aVBhcmFtZXRlcnMtPnZjbEhyZFBhcmFtZXRlcnMuCi0gICAgICAgICAgICAgICAgICAgICAgY3BiUmVtb3ZhbERlbGF5TGVuZ3RoLAotICAgICAgICAgICAgICAgICAgcFNlcVBhcmFtU2V0LT52dWlQYXJhbWV0ZXJzLT52Y2xIcmRQYXJhbWV0ZXJzLgotICAgICAgICAgICAgICAgICAgICAgIGRwYk91dHB1dERlbGF5TGVuZ3RoLAotICAgICAgICAgICAgICAgICAgcFNlcVBhcmFtU2V0LT52dWlQYXJhbWV0ZXJzLT52Y2xIcmRQYXJhbWV0ZXJzLgotICAgICAgICAgICAgICAgICAgICB0aW1lT2Zmc2V0TGVuZ3RoLAotICAgICAgICAgICAgICAgICAgcFNlcVBhcmFtU2V0LT52dWlQYXJhbWV0ZXJzLT5uYWxIcmRQYXJhbWV0ZXJzUHJlc2VudEZsYWcgfHwKLSAgICAgICAgICAgICAgICAgIHBTZXFQYXJhbVNldC0+dnVpUGFyYW1ldGVycy0+dmNsSHJkUGFyYW1ldGVyc1ByZXNlbnRGbGFnID8KLSAgICAgICAgICAgICAgICAgIEhBTlRST19UUlVFIDogSEFOVFJPX0ZBTFNFLAotICAgICAgICAgICAgICAgICAgcFNlcVBhcmFtU2V0LT52dWlQYXJhbWV0ZXJzLT5waWNTdHJ1Y3RQcmVzZW50RmxhZyk7Ci0gICAgICAgICAgICAgICAgYnJlYWs7Ci0KLSAgICAgICAgICAgIGNhc2UgMjoKLSAgICAgICAgICAgICAgICBzdGF0dXMgPSBEZWNvZGVQYW5TY2FuUmVjdGFuZ2xlKAotICAgICAgICAgICAgICAgICAgcFN0cm1EYXRhLAotICAgICAgICAgICAgICAgICAgJnBTZWlNZXNzYWdlLT5wYW5TY2FuUmVjdCk7Ci0gICAgICAgICAgICAgICAgYnJlYWs7Ci0KLSAgICAgICAgICAgIGNhc2UgMzoKLSAgICAgICAgICAgICAgICBzdGF0dXMgPSBEZWNvZGVGaWxsZXJQYXlsb2FkKHBTdHJtRGF0YSwgcGF5bG9hZFNpemUpOwotICAgICAgICAgICAgICAgIGJyZWFrOwotCi0gICAgICAgICAgICBjYXNlIDQ6Ci0gICAgICAgICAgICAgICAgc3RhdHVzID0gRGVjb2RlVXNlckRhdGFSZWdpc3RlcmVkSVR1VFQzNSgKLSAgICAgICAgICAgICAgICAgIHBTdHJtRGF0YSwKLSAgICAgICAgICAgICAgICAgICZwU2VpTWVzc2FnZS0+dXNlckRhdGFSZWdpc3RlcmVkSXR1VFQzNSwKLSAgICAgICAgICAgICAgICAgIHBheWxvYWRTaXplKTsKLSAgICAgICAgICAgICAgICBicmVhazsKLQotICAgICAgICAgICAgY2FzZSA1OgotICAgICAgICAgICAgICAgIHN0YXR1cyA9IERlY29kZVVzZXJEYXRhVW5yZWdpc3RlcmVkKAotICAgICAgICAgICAgICAgICAgcFN0cm1EYXRhLAotICAgICAgICAgICAgICAgICAgJnBTZWlNZXNzYWdlLT51c2VyRGF0YVVucmVnaXN0ZXJlZCwKLSAgICAgICAgICAgICAgICAgIHBheWxvYWRTaXplKTsKLSAgICAgICAgICAgICAgICBicmVhazsKLQotICAgICAgICAgICAgY2FzZSA2OgotICAgICAgICAgICAgICAgIHN0YXR1cyA9IERlY29kZVJlY292ZXJ5UG9pbnQoCi0gICAgICAgICAgICAgICAgICBwU3RybURhdGEsCi0gICAgICAgICAgICAgICAgICAmcFNlaU1lc3NhZ2UtPnJlY292ZXJ5UG9pbnQpOwotICAgICAgICAgICAgICAgIGJyZWFrOwotCi0gICAgICAgICAgICBjYXNlIDc6Ci0gICAgICAgICAgICAgICAgc3RhdHVzID0gRGVjb2RlRGVjUmVmUGljTWFya2luZ1JlcGV0aXRpb24oCi0gICAgICAgICAgICAgICAgICBwU3RybURhdGEsCi0gICAgICAgICAgICAgICAgICAmcFNlaU1lc3NhZ2UtPmRlY1JlZlBpY01hcmtpbmdSZXBldGl0aW9uLAotICAgICAgICAgICAgICAgICAgcFNlcVBhcmFtU2V0LT5udW1SZWZGcmFtZXMpOwotICAgICAgICAgICAgICAgIGJyZWFrOwotCi0gICAgICAgICAgICBjYXNlIDg6Ci0gICAgICAgICAgICAgICAgQVNTRVJUKHBTZXFQYXJhbVNldCk7Ci0gICAgICAgICAgICAgICAgc3RhdHVzID0gRGVjb2RlU3BhcmVQaWMoCi0gICAgICAgICAgICAgICAgICBwU3RybURhdGEsCi0gICAgICAgICAgICAgICAgICAmcFNlaU1lc3NhZ2UtPnNwYXJlUGljLAotICAgICAgICAgICAgICAgICAgcFNlcVBhcmFtU2V0LT5waWNXaWR0aEluTWJzICogcFNlcVBhcmFtU2V0LT5waWNIZWlnaHRJbk1icyk7Ci0gICAgICAgICAgICAgICAgYnJlYWs7Ci0KLSAgICAgICAgICAgIGNhc2UgOToKLSAgICAgICAgICAgICAgICBzdGF0dXMgPSBEZWNvZGVTY2VuZUluZm8oCi0gICAgICAgICAgICAgICAgICBwU3RybURhdGEsCi0gICAgICAgICAgICAgICAgICAmcFNlaU1lc3NhZ2UtPnNjZW5lSW5mbyk7Ci0gICAgICAgICAgICAgICAgYnJlYWs7Ci0KLSAgICAgICAgICAgIGNhc2UgMTA6Ci0gICAgICAgICAgICAgICAgc3RhdHVzID0gRGVjb2RlU3ViU2VxSW5mbygKLSAgICAgICAgICAgICAgICAgIHBTdHJtRGF0YSwKLSAgICAgICAgICAgICAgICAgICZwU2VpTWVzc2FnZS0+c3ViU2VxSW5mbyk7Ci0gICAgICAgICAgICAgICAgYnJlYWs7Ci0KLSAgICAgICAgICAgIGNhc2UgMTE6Ci0gICAgICAgICAgICAgICAgc3RhdHVzID0gRGVjb2RlU3ViU2VxTGF5ZXJDaGFyYWN0ZXJpc3RpY3MoCi0gICAgICAgICAgICAgICAgICBwU3RybURhdGEsCi0gICAgICAgICAgICAgICAgICAmcFNlaU1lc3NhZ2UtPnN1YlNlcUxheWVyQ2hhcmFjdGVyaXN0aWNzKTsKLSAgICAgICAgICAgICAgICBicmVhazsKLQotICAgICAgICAgICAgY2FzZSAxMjoKLSAgICAgICAgICAgICAgICBzdGF0dXMgPSBEZWNvZGVTdWJTZXFDaGFyYWN0ZXJpc3RpY3MoCi0gICAgICAgICAgICAgICAgICBwU3RybURhdGEsCi0gICAgICAgICAgICAgICAgICAmcFNlaU1lc3NhZ2UtPnN1YlNlcUNoYXJhY3RlcmlzdGljcyk7Ci0gICAgICAgICAgICAgICAgYnJlYWs7Ci0KLSAgICAgICAgICAgIGNhc2UgMTM6Ci0gICAgICAgICAgICAgICAgc3RhdHVzID0gRGVjb2RlRnVsbEZyYW1lRnJlZXplKAotICAgICAgICAgICAgICAgICAgcFN0cm1EYXRhLAotICAgICAgICAgICAgICAgICAgJnBTZWlNZXNzYWdlLT5mdWxsRnJhbWVGcmVlemUpOwotICAgICAgICAgICAgICAgIGJyZWFrOwotCi0gICAgICAgICAgICBjYXNlIDE0OiAvKiBUaGlzIFNFSSBkb2VzIG5vdCBjb250YWluIGRhdGEsIHdoYXQgdG8gZG8gPz8/ICovCi0gICAgICAgICAgICAgICAgc3RhdHVzID0gSEFOVFJPX09LOwotICAgICAgICAgICAgICAgIGJyZWFrOwotCi0gICAgICAgICAgICBjYXNlIDE1OgotICAgICAgICAgICAgICAgIHN0YXR1cyA9IERlY29kZUZ1bGxGcmFtZVNuYXBzaG90KAotICAgICAgICAgICAgICAgICAgcFN0cm1EYXRhLAotICAgICAgICAgICAgICAgICAgJnBTZWlNZXNzYWdlLT5mdWxsRnJhbWVTbmFwc2hvdCk7Ci0gICAgICAgICAgICAgICAgYnJlYWs7Ci0KLSAgICAgICAgICAgIGNhc2UgMTY6Ci0gICAgICAgICAgICAgICAgc3RhdHVzID0gRGVjb2RlUHJvZ3Jlc3NpdmVSZWZpbmVtZW50U2VnbWVudFN0YXJ0KAotICAgICAgICAgICAgICAgICAgcFN0cm1EYXRhLAotICAgICAgICAgICAgICAgICAgJnBTZWlNZXNzYWdlLT5wcm9ncmVzc2l2ZVJlZmluZW1lbnRTZWdtZW50U3RhcnQpOwotICAgICAgICAgICAgICAgIGJyZWFrOwotCi0gICAgICAgICAgICBjYXNlIDE3OgotICAgICAgICAgICAgICAgIHN0YXR1cyA9IERlY29kZVByb2dyZXNzaXZlUmVmaW5lbWVudFNlZ21lbnRFbmQoCi0gICAgICAgICAgICAgICAgICBwU3RybURhdGEsCi0gICAgICAgICAgICAgICAgICAmcFNlaU1lc3NhZ2UtPnByb2dyZXNzaXZlUmVmaW5lbWVudFNlZ21lbnRFbmQpOwotICAgICAgICAgICAgICAgIGJyZWFrOwotCi0gICAgICAgICAgICBjYXNlIDE4OgotICAgICAgICAgICAgICAgIEFTU0VSVChudW1TbGljZUdyb3Vwcyk7Ci0gICAgICAgICAgICAgICAgc3RhdHVzID0gRGVjb2RlTW90aW9uQ29uc3RyYWluZWRTbGljZUdyb3VwU2V0KAotICAgICAgICAgICAgICAgICAgcFN0cm1EYXRhLAotICAgICAgICAgICAgICAgICAgJnBTZWlNZXNzYWdlLT5tb3Rpb25Db25zdHJhaW5lZFNsaWNlR3JvdXBTZXQsCi0gICAgICAgICAgICAgICAgICBudW1TbGljZUdyb3Vwcyk7Ci0gICAgICAgICAgICAgICAgYnJlYWs7Ci0KLSAgICAgICAgICAgIGRlZmF1bHQ6Ci0gICAgICAgICAgICAgICAgc3RhdHVzID0gRGVjb2RlUmVzZXJ2ZWRTZWlNZXNzYWdlKAotICAgICAgICAgICAgICAgICAgcFN0cm1EYXRhLAotICAgICAgICAgICAgICAgICAgJnBTZWlNZXNzYWdlLT5yZXNlcnZlZFNlaU1lc3NhZ2UsCi0gICAgICAgICAgICAgICAgICBwYXlsb2FkU2l6ZSk7Ci0gICAgICAgICAgICAgICAgYnJlYWs7Ci0gICAgICAgIH0KLQotICAgICAgICBpZiAoc3RhdHVzICE9IEhBTlRST19PSykKLSAgICAgICAgICAgIHJldHVybihzdGF0dXMpOwotCi0gICAgICAgIHdoaWxlICghaDI2NGJzZElzQnl0ZUFsaWduZWQocFN0cm1EYXRhKSkKLSAgICAgICAgewotICAgICAgICAgICAgaWYgKGgyNjRic2RHZXRCaXRzKHBTdHJtRGF0YSwgMSkgIT0gMSkKLSAgICAgICAgICAgICAgICByZXR1cm4oSEFOVFJPX05PSyk7Ci0gICAgICAgICAgICB3aGlsZSAoIWgyNjRic2RJc0J5dGVBbGlnbmVkKHBTdHJtRGF0YSkpCi0gICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgaWYgKGgyNjRic2RHZXRCaXRzKHBTdHJtRGF0YSwgMSkgIT0gMCkKLSAgICAgICAgICAgICAgICAgICAgcmV0dXJuKEhBTlRST19OT0spOwotICAgICAgICAgICAgfQotICAgICAgICB9Ci0gICAgfSB3aGlsZSAoaDI2NGJzZE1vcmVSYnNwRGF0YShwU3RybURhdGEpKTsKLQotICAgIHJldHVybihoMjY0YnNkUmJzcFRyYWlsaW5nQml0cyhwU3RybURhdGEpKTsKLQotfQotCi0vKi0tLS0tLS0tLS0tLS0tLS0tLS0tLS0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AhPSBIQU5UUk9fT0spCi0gICAgICAgIHJldHVybih0bXApOwotICAgIGlmIChwQnVmZmVyaW5nUGVyaW9kLT5zZXFQYXJhbWV0ZXJTZXRJZCA+IDMxKQotICAgICAgICByZXR1cm4oSEFOVFJPX05PSyk7Ci0KLSAgICBpZiAobmFsSHJkQnBQcmVzZW50RmxhZykKLSAgICB7Ci0gICAgICAgIGZvciAoaSA9IDA7IGkgPCBjcGJDbnQ7IGkrKykKLSAgICAgICAgewotICAgICAgICAgICAgdG1wID0gaDI2NGJzZEdldEJpdHMocFN0cm1EYXRhLCBpbml0aWFsQ3BiUmVtb3ZhbERlbGF5TGVuZ3RoKTsKLSAgICAgICAgICAgIGlmICh0bXAgPT0gRU5EX09GX1NUUkVBTSkKLSAgICAgICAgICAgICAgICByZXR1cm4oSEFOVFJPX05PSyk7Ci0gICAgICAgICAgICBpZiAodG1wID09IDApCi0gICAgICAgICAgICAgICAgcmV0dXJuKEhBTlRST19OT0spOwotICAgICAgICAgICAgcEJ1ZmZlcmluZ1BlcmlvZC0+aW5pdGlhbENwYlJlbW92YWxEZWxheVtpXSA9IHRtcDsKLQotICAgICAgICAgICAgdG1wID0gaDI2NGJzZEdldEJpdHMocFN0cm1EYXRhLCBpbml0aWFsQ3BiUmVtb3ZhbERlbGF5TGVuZ3RoKTsKLSAgICAgICAgICAgIGlmICh0bXAgPT0gRU5EX09GX1NUUkVBTSkKLSAgICAgICAgICAgICAgICByZXR1cm4oSEFOVFJPX05PSyk7Ci0gICAgICAgICAgICBwQnVmZmVyaW5nUGVyaW9kLT5pbml0aWFsQ3BiUmVtb3ZhbERlbGF5T2Zmc2V0W2ldID0gdG1wOwotICAgICAgICB9Ci0gICAgfQotCi0gICAgaWYgKHZjbEhyZEJwUHJlc2VudEZsYWcpCi0gICAgewotICAgICAgICBmb3IgKGkgPSAwOyBpIDwgY3BiQ250OyBpKyspCi0gICAgICAgIHsKLSAgICAgICAgICAgIHRtcCA9IGgyNjRic2RHZXRCaXRzK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AgICAgICAgICByZXR1cm4oSEFOVFJPX05PSyk7Ci0gICAgICAgIGlmICh0bXAgPiA4KQotICAgICAgICAgICAgcmV0dXJuKEhBTlRST19OT0spOwotICAgICAgICBwUGljVGltaW5nLT5waWNTdHJ1Y3QgPSB0bXA7Ci0KLSAgICAgICAgZm9yIChpID0gMDsgaSA8IG51bUNsb2NrVFNbcFBpY1RpbWluZy0+cGljU3RydWN0XTsgaSsrKQotICAgICAgICB7Ci0gICAgICAgICAgICB0bXAgPSBoMjY0YnNkR2V0Qml0cyhwU3RybURhdGEsIDEpOwotICAgICAgICAgICAgaWYgKHRtcCA9PSBFTkRfT0ZfU1RSRUFNKQotICAgICAgICAgICAgICAgIHJldHVybihIQU5UUk9fTk9LKTsKLSAgICAgICAgICAgIHBQaWNUaW1pbmctPmNsb2NrVGltZVN0YW1wRmxhZ1tpXSA9IHRtcCA9PSAxID8KLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEhBTlRST19UUlVFIDogSEFOVFJPX0ZBTFNFOwotCi0gICAgICAgICAgICBpZiAocFBpY1RpbWluZy0+Y2xvY2tUaW1lU3RhbXBGbGFnW2ldKQotICAgICAgICAgICAgewotICAgICAgICAgICAgICAgIHRtcCA9IGgyNjRic2RHZXRCaXRzKHBTdHJtRGF0YSwgMik7Ci0gICAgICAgICAgICAgICAgaWYgKHRtcCA9PSBFTkRfT0ZfU1RSRUFNKQotICAgICAgICAgICAgICAgICAgICByZXR1cm4oSEFOVFJPX05PSyk7Ci0gICAgICAgICAgICAgICAgcFBpY1RpbWluZy0+Y3RUeXBlW2ldID0gdG1wOwotCi0gICAgICAgICAgICAgICAgdG1wID0gaDI2NGJzZEdldEJpdHMocFN0cm1EYXRhLCAxKTsKLSAgICAgICAgICAgICAgICBpZiAodG1wID09IEVORF9PRl9TVFJFQU0pCi0gICAgICAgICAgICAgICAgICAgIHJldHVybihIQU5UUk9fTk9LKTsKLSAgICAgICAgICAgICAgICBwUGljVGltaW5nLT5udWl0RmllbGRCYXNlZEZsYWdbaV0gPSB0bXAgPT0gMSA/Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBIQU5UUk9fVFJVRSA6IEhBTlRST19GQUxTRTsKLQotICAgICAgICAgICAgICAgIHRtcCA9IGgyNjRic2RHZXRCaXRzKHBTdHJtRGF0YSwgNSk7Ci0gICAgICAgICAgICAgICAgaWYgKHRtcCA9PSBFTkRfT0ZfU1RSRUFNKQotICAgICAgICAgICAgICAgICAgICByZXR1cm4oSEFOVFJPX05PSyk7Ci0gICAgICAgICAgICAgICAgaWYgKHRtcCA+IDYpCi0gICAgICAgICAgICAgICAgICAgIHJldHVybihIQU5UUk9fTk9LKTsKLSAgICAgICAgICAgICAgICBwUGljVGltaW5nLT5jb3VudGluZ1R5cGVbaV0gPSB0bXA7Ci0KLSAgICAgICAgICAgICAgICB0bXAgPSBoMjY0YnNkR2V0Qml0cyhwU3RybURhdGEsIDEpOwotICAgICAgICAgICAgICAgIGlmICh0bXAgPT0gRU5EX09GX1NUUkVBTSkKLSAgICAgICAgICAgICAgICAgICAgcmV0dXJuKEhBTlRST19OT0spOwotICAgICAgICAgICAgICAgIHBQaWNUaW1pbmctPmZ1bGxUaW1lU3RhbXBGbGFnW2ldID0gdG1wID09IDEgPwotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgSEFOVFJPX1RSVUUgOiBIQU5UUk9fRkFMU0U7Ci0KLSAgICAgICAgICAgICAgICB0bXAgPSBoMjY0YnNkR2V0Qml0cyhwU3RybURhdGEsIDEpOwotICAgICAgICAgICAgICAgIGlmICh0bXAgPT0gRU5EX09GX1NUUkVBTSkKLSAgICAgICAgICAgICAgICAgICAgcmV0dXJuKEhBTlRST19OT0spOwotICAgICAgICAgICAgICAgIHBQaWNUaW1pbmctPmRpc2NvbnRpbnVpdHlGbGFnW2ldID0gdG1wID09IDEgPwotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgSEFOVFJPX1RSVUUgOiBIQU5UUk9fRkFMU0U7Ci0KLSAgICAgICAgICAgICAgICB0bXAgPSBoMjY0YnNkR2V0Qml0cyhwU3RybURhdGEsIDEpOwotICAgICAgICAgICAgICAgIGlmICh0bXAgPT0gRU5EX09GX1NUUkVBTSkKLSAgICAgICAgICAgICAgICAgICAgcmV0dXJuKEhBTlRST19OT0spOwotICAgICAgICAgICAgICAgIHBQaWNUaW1pbmctPmNudERyb3BwZWRGbGFnW2ldID0gdG1wID09IDEgPwotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgSEFOVFJPX1RSVUUgOiBIQU5UUk9fRkFMU0U7Ci0KLSAgICAgICAgICAgICAgICB0bXAgPSBoMjY0YnNkR2V0Qml0cyhwU3RybURhdGEsIDgpOwotICAgICAgICAgICAgICAgIGlmICh0bXAgPT0gRU5EX09GX1NUUkVBTSkKLSAgICAgICAgICAgICAgICAgICAgcmV0dXJuKEhBTlRST19OT0spOwotICAgICAgICAgICAgICAgIHBQaWNUaW1pbmctPm5GcmFtZXNbaV0gPSB0bXA7Ci0KLSAgICAgICAgICAgICAgICBpZiAocFBpY1RpbWluZy0+ZnVsbFRpbWVTdGFtcEZsYWdbaV0pCi0gICAgICAgICAgICAgICAgewotICAgICAgICAgICAgICAgICAgICB0bXAgPSBoMjY0YnNkR2V0Qml0cyhwU3RybURhdGEsIDYpOwotICAgICAgICAgICAgICAgICAgICBpZiAodG1wID09IEVORF9PRl9TVFJFQU0pCi0gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4oSEFOVFJPX05PSyk7Ci0gICAgICAgICAgICAgICAgICAgIGlmICh0bXAgPiA1OSkKLSAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybihIQU5UUk9fTk9LKTsKLSAgICAgICAgICAgICAgICAgICAgcFBpY1RpbWluZy0+c2Vjb25kc1ZhbHVlW2ldID0gdG1wOwotCi0gICAgICAgICAgICAgICAgICAgIHRtcCA9IGgyNjRic2RHZXRCaXRzKHBTdHJtRGF0YSwgNik7Ci0gICAgICAgICAgICAgICAgICAgIGlmICh0bXAgPT0gRU5EX09GX1NUUkVBTSkKLSAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybihIQU5UUk9fTk9LKTsKLSAgICAgICAgICAgICAgICAgICAgaWYgKHRtcCA+IDU5KQotICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuKEhBTlRST19OT0spOwotICAgICAgICAgICAgICAgICAgICBwUGljVGltaW5nLT5taW51dGVzVmFsdWVbaV0gPSB0bXA7Ci0KLSAgICAgICAgICAgICAgICAgICAgdG1wID0gaDI2NGJzZEdldEJpdHMocFN0cm1EYXRhLCA1KTsKLSAgICAgICAgICAgICAgICAgICAgaWYgKHRtcCA9PSBFTkRfT0ZfU1RSRUFNKQotICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuKEhBTlRST19OT0spOwotICAgICAgICAgICAgICAgICAgICBpZiAodG1wID4gMjMpCi0gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4oSEFOVFJPX05PSyk7Ci0gICAgICAgICAgICAgICAgICAgIHBQaWNUaW1pbmctPmhvdXJzVmFsdWVbaV0gPSB0bXA7Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgIGVsc2UKLSAgICAgICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgICAgIHRtcCA9IGgyNjRic2RHZXRCaXRzKHBTdHJtRGF0YSwgMSk7Ci0gICAgICAgICAgICAgICAgICAgIGlmICh0bXAgPT0gRU5EX09GX1NUUkVBTSkKLSAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybihIQU5UUk9fTk9LKTsKLSAgICAgICAgICAgICAgICAgICAgcFBpY1RpbWluZy0+c2Vjb25kc0ZsYWdbaV0gPSB0bXAgPT0gMSA/Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBIQU5UUk9fVFJVRSA6IEhBTlRST19GQUxTRTsKLQotICAgICAgICAgICAgICAgICAgICBpZiAocFBpY1RpbWluZy0+c2Vjb25kc0ZsYWdbaV0pCi0gICAgICAgICAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAgICAgICAgIHRtcCA9IGgyNjRic2RHZXRCaXRzKHBTdHJtRGF0YSwgNik7Ci0gICAgICAgICAgICAgICAgICAgICAgICBpZiAodG1wID09IEVORF9PRl9TVFJFQU0pCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuKEhBTlRST19OT0spOwotICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHRtcCA+IDU5KQotICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybihIQU5UUk9fTk9LKTsKLSAgICAgICAgICAgICAgICAgICAgICAgIHBQaWNUaW1pbmctPnNlY29uZHNWYWx1ZVtpXSA9IHRtcDsKLQotICAgICAgICAgICAgICAgICAgICAgICAgdG1wID0gaDI2NGJzZEdldEJpdHMocFN0cm1EYXRhLCAxKTsKLSAgICAgICAgICAgICAgICAgICAgICAgIGlmICh0bXAgPT0gRU5EX09GX1NUUkVBTSkKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4oSEFOVFJPX05PSyk7Ci0gICAgICAgICAgICAgICAgICAgICAgICBwUGljVGltaW5nLT5taW51dGVzRmxhZ1tpXSA9IHRtcCA9PSAxID8KLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEhBTlRST19UUlVFIDogSEFOVFJPX0ZBTFNFOwotCi0gICAgICAgICAgICAgICAgICAgICAgICBpZiAocFBpY1RpbWluZy0+bWludXRlc0ZsYWdbaV0pCi0gICAgICAgICAgICAgICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgdG1wID0gaDI2NGJzZEdldEJpdHMocFN0cm1EYXRhLCA2KTsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAodG1wID09IEVORF9PRl9TVFJFQU0pCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybihIQU5UUk9fTk9LKTsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAodG1wID4gNTkpCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybihIQU5UUk9fTk9LKTsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBwUGljVGltaW5nLT5taW51dGVzVmFsdWVbaV0gPSB0bXA7Ci0KLSAgICAgICAgICAgICAgICAgICAgICAgICAgICB0bXAgPSBoMjY0YnNkR2V0Qml0cyhwU3RybURhdGEsIDEpOwotICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICh0bXAgPT0gRU5EX09GX1NUUkVBTSkKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuKEhBTlRST19OT0spOwotICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBQaWNUaW1pbmctPmhvdXJzRmxhZ1tpXSA9IHRtcCA9PSAxID8KLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEhBTlRST19UUlVFIDogSEFOVFJPX0ZBTFNFOwotCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHBQaWNUaW1pbmctPmhvdXJzRmxhZ1tpXSkKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRtcCA9IGgyNjRic2RHZXRCaXRzKHBTdHJtRGF0YSwgNSk7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICh0bXAgPT0gRU5EX09GX1NUUkVBTSkKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybihIQU5UUk9fTk9LKTsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHRtcCA+IDIzKQotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuKEhBTlRST19OT0spOwotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwUGljVGltaW5nLT5ob3Vyc1ZhbHVlW2ldID0gdG1wOwotICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICBpZiAodGltZU9mZnNldExlbmd0aCkKLSAgICAgICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgICAgIHRtcCA9IGgyNjRic2RHZXRCaXRzKHBTdHJtRGF0YSwgdGltZU9mZnNldExlbmd0aCk7Ci0gICAgICAgICAgICAgICAgICAgIGlmICh0bXAgPT0gRU5EX09GX1NUUkVBTSkKLSAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybihIQU5UUk9fTk9LKTsKLSAgICAgICAgICAgICAgICAgICAgaXRtcCA9IChpMzIpdG1wOwotICAgICAgICAgICAgICAgICAgICAvKiBmb2xsb3dpbmcgImNvbnZlcnRzIiB0aW1lT2Zmc2V0TGVuZ3RoLWJpdCBzaWduZWQKLSAgICAgICAgICAgICAgICAgICAgICogaW50ZWdlciBpbnRvIGkzMiAqLwotICAgICAgICAgICAgICAgICAgICAvKmxpbnQgLXNhdmUgLWU3MDEgLWU3MDIgKi8KLSAgICAgICAgICAgICAgICAgICAgaXRtcCA8PD0gKDMyIC0gdGltZU9mZnNldExlbmd0aCk7Ci0gICAgICAgICAgICAgICAgICAgIGl0bXAgPj49ICgzMiAtIHRpbWVPZmZzZXRMZW5ndGgpOwotICAgICAgICAgICAgICAgICAgICAvKmxpbnQgLXJlc3RvcmUgKi8KLSAgICAgICAgICAgICAgICAgICAgcFBpY1RpbWluZy0+dGltZU9mZnNldFtpXSA9IGl0bXA7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgZWxzZQotICAgICAgICAgICAgICAgICAgICBwUGljVGltaW5nLT50aW1lT2Zmc2V0W2ldID0gMDsKLSAgICAgICAgICAgIH0KLSAgICAgICAgfQotICAgIH0KLQotICAgIHJldHVybihIQU5UUk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W5nbGUtPnBhblNjYW5SZWN0Q2FuY2VsRmxhZyA9IHRtcCA9PSAxID8KLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgSEFOVFJPX1RSVUUgOiBIQU5UUk9fRkFMU0U7Ci0KLSAgICBpZiAoIXBQYW5TY2FuUmVjdGFuZ2xlLT5wYW5TY2FuUmVjdENhbmNlbEZsYWcpCi0gICAgewotICAgICAgICB0bXAgPSBoMjY0YnNkRGVjb2RlRXhwR29sb21iVW5zaWduZWQocFN0cm1EYXRhLAotICAgICAgICAgICZwUGFuU2NhblJlY3RhbmdsZS0+cGFuU2NhbkNudCk7Ci0gICAgICAgIGlmICh0bXAgIT0gSEFOVFJPX09LKQotICAgICAgICAgICAgcmV0dXJuKHRtcCk7Ci0gICAgICAgIGlmIChwUGFuU2NhblJlY3RhbmdsZS0+cGFuU2NhbkNudCA+IDIpCi0gICAgICAgICAgICByZXR1cm4oSEFOVFJPX05PSyk7Ci0gICAgICAgIHBQYW5TY2FuUmVjdGFuZ2xlLT5wYW5TY2FuQ250Kys7Ci0KLSAgICAgICAgZm9yIChpID0gMDsgaSA8IHBQYW5TY2FuUmVjdGFuZ2xlLT5wYW5TY2FuQ250OyBpKyspCi0gICAgICAgIHsKLSAgICAgICAgICAgIHRtcCA9IGgyNjRic2REZWNvZGVFeHBHb2xvbWJTaWduZWQocFN0cm1EYXRhLAotICAgICAgICAgICAgICAmcFBhblNjYW5SZWN0YW5nbGUtPnBhblNjYW5SZWN0TGVmdE9mZnNldFtpXSk7Ci0gICAgICAgICAgICBpZiAodG1wICE9IEhBTlRST19PSykKLSAgICAgICAgICAgICAgICByZXR1cm4odG1wKTsKLQotICAgICAgICAgICAgdG1wID0gaDI2NGJzZERlY29kZUV4cEdvbG9tYlNpZ25lZChwU3RybURhdGEsCi0gICAgICAgICAgICAgICZwUGFuU2NhblJlY3RhbmdsZS0+cGFuU2NhblJlY3RSaWdodE9mZnNldFtpXSk7Ci0gICAgICAgICAgICBpZiAodG1wICE9IEhBTlRST19PSykKLSAgICAgICAgICAgICAgICByZXR1cm4odG1wKTsKLQotICAgICAgICAgICAgdG1wID0gaDI2NGJzZERlY29kZUV4cEdvbG9tYlNpZ25lZChwU3RybURhdGEsCi0gICAgICAgICAgICAgICZwUGFuU2NhblJlY3RhbmdsZS0+cGFuU2NhblJlY3RUb3BPZmZzZXRbaV0pOwotICAgICAgICAgICAgaWYgKHRtcCAhPSBIQU5UUk9fT0spCi0gICAgICAgICAgICAgICAgcmV0dXJuKHRtcCk7Ci0KLSAgICAgICAgICAgIHRtcCA9IGgyNjRic2REZWNvZGVFeHBHb2xvbWJTaWduZWQocFN0cm1EYXRhLAotICAgICAgICAgICAgICAmcFBhblNjYW5SZWN0YW5nbGUtPnBhblNjYW5SZWN0Qm90dG9tT2Zmc2V0W2ldKTsKLSAgICAgICAgICAgIGlmICh0bXAgIT0gSEFOVFJPX09LKQotICAgICAgICAgICAgICAgIHJldHVybih0bXApOwotICAgICAgICB9Ci0gICAgICAgIHRtcCA9IGgyNjRic2REZWNvZGVFeHBHb2xvbWJVbnNpZ25lZChwU3RybURhdGEsCi0gICAgICAgICAgJnBQYW5TY2FuUmVjdGFuZ2xlLT5wYW5TY2FuUmVjdFJlcGV0aXRpb25QZXJpb2QpOwotICAgICAgICBpZiAodG1wICE9IEhBTlRST19PSykKLSAgICAgICAgICAgIHJldHVybih0bXApOwotICAgICAgICBpZiAocFBhblNjYW5SZWN0YW5nbGUtPnBhblNjYW5SZWN0UmVwZXRpdGlvblBlcmlvZCA+IDE2Mzg0KQotICAgICAgICAgICAgcmV0dXJuKEhBTlRST19OT0spOwotICAgICAgICBpZiAocFBhblNjYW5SZWN0YW5nbGUtPnBhblNjYW5DbnQgPiAxICYmCi0gICAgICAgICAgcFBhblNjYW5SZWN0YW5nbGUtPnBhblNjYW5SZWN0UmVwZXRpdGlvblBlcmlvZCA+IDEpCi0gICAgICAgICAgICByZXR1cm4oSEFOVFJPX05PSyk7Ci0gICAgfQotCi0gICA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3BhcmVQaWNzKys7Ci0gICAgaWYgKHBTcGFyZVBpYy0+bnVtU3BhcmVQaWNzID4gTUFYX05VTV9TUEFSRV9QSUNTKQotICAgICAgICByZXR1cm4oSEFOVFJPX05PSyk7Ci0KLSAgICBmb3IgKGkgPSAwOyBpIDwgcFNwYXJlUGljLT5udW1TcGFyZVBpY3M7IGkrKykKLSAgICB7Ci0gICAgICAgIHRtcCA9IGgyNjRic2REZWNvZGVFeHBHb2xvbWJVbnNpZ25lZChwU3RybURhdGEsCi0gICAgICAgICAgJnBTcGFyZVBpYy0+ZGVsdGFTcGFyZUZyYW1lTnVtW2ldKTsKLSAgICAgICAgaWYgKHRtcCAhPSBIQU5UUk9fT0spCi0gICAgICAgICAgICByZXR1cm4odG1wKTsKLQotICAgICAgICB0bXAgPSBoMjY0YnNkRGVjb2RlRXhwR29sb21iVW5zaWduZWQocFN0cm1EYXRhLAotICAgICAgICAgICAgJnBTcGFyZVBpYy0+c3BhcmVBcmVhSWRjW2ldKTsKLSAgICAgICAgaWYgKHRtcCAhPSBIQU5UUk9fT0spCi0gICAgICAgICAgICByZXR1cm4odG1wKTsKLSAgICAgICAgaWYgKHBTcGFyZVBpYy0+c3BhcmVBcmVhSWRjW2ldID4gMikKLSAgICAgICAgICAgIHJldHVybihIQU5UUk9fTk9LKTsKLQotICAgICAgICBpZiAocFNwYXJlUGljLT5zcGFyZUFyZWFJZGNbaV0gPT0gMSkKLSAgICAgICAgewotICAgICAgICAgICAgLyogd2hlcmUgY29ycmVzcG9uZGluZyBGUkVFKCkgPz8/ICovCi0gICAgICAgICAgICBBTExPQ0FURShwU3BhcmVQaWMtPnNwYXJlVW5pdEZsYWdbaV0sIHBpY1NpemVJbk1hcFVuaXRzLCB1MzIpOwotICAgICAgICAgICAgaWYgKHBTcGFyZVBpYy0+c3BhcmVVbml0RmxhZ1tpXSA9PSBOVUxMKQotICAgICAgICAgICAgICAgIHJldHVybihNRU1PUllfQUxMT0NBVElPTl9FUlJPUik7Ci0gICAgICAgICAgICBwU3BhcmVQaWMtPnplcm9SdW5MZW5ndGhbaV0gPSBOVUxMOwotCi0gICAgICAgICAgICBmb3IgKGogPSAwOyBqIDwgcGljU2l6ZUluTWFwVW5pdHM7IGorKykKLSAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICB0bXAgPSBoMjY0YnNkR2V0Qml0cyhwU3RybURhdGEsIDEpOwotICAgICAgICAgICAgICAgIGlmICh0bXAgPT0gRU5EX09GX1NUUkVBTSkKLSAgICAgICAgICAgICAgICAgICAgcmV0dXJuKEhBTlRST19OT0spOwotICAgICAgICAgICAgICAgIHBTcGFyZVBpYy0+c3BhcmVVbml0RmxhZ1tpXVtqXSA9IHRtcCA9PSAxID8KLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEhBTlRST19UUlVFIDogSEFOVFJPX0ZBTFNFOwotICAgICAgICAgICAgfQotICAgICAgICB9Ci0gICAgICAgIGVsc2UgaWYgKHBTcGFyZVBpYy0+c3BhcmVBcmVhSWRjW2ldID09IDIpCi0gICAgICAgIHsKLSAgICAgICAgICAgIC8qIHdoZXJlIGNvcnJlc3BvbmRpbmcgRlJFRSgpID8/PyAqLwotICAgICAgICAgICAgQUxMT0NBVEUocFNwYXJlUGljLT56ZXJvUnVuTGVuZ3RoW2ldLCBwaWNTaXplSW5NYXBVbml0cywgdTMyKTsKLSAgICAgICAgICAgIGlmIChwU3BhcmVQaWMtPnplcm9SdW5MZW5ndGhbaV0gPT0gTlVMTCkKLSAgICAgICAgICAgICAgICByZXR1cm4oTUVNT1JZX0FMTE9DQVRJT05fRVJST1IpOwotICAgICAgICAgICAgcFNwYXJlUGljLT5zcGFyZVVuaXRGbGFnW2ldID0gTlVMTDsKLQotICAgICAgICAgICAgZm9yIChqID0gMCwgbWFwVW5pdENudCA9IDA7IG1hcFVuaXRDbnQgPCBwaWNTaXplSW5NYXBVbml0czsgaisrKQotICAgICAgICAgICAgewotICAgICAgICAgICAgICAgIHRtcCA9IGgyN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ZW5lSW5mbygKLSAgc3RybURhdGFfdCAqcFN0cm1EYXRhLAotICBzZWlTY2VuZUluZm9fdCAqcFNjZW5lSW5mbykKLXsKLQotLyogVmFyaWFibGVzICovCi0KLSAgICB1MzIgdG1wOwotCi0vKiBDb2RlICovCi0KLSAgICBBU1NFUlQocFN0cm1EYXRhKTsKLSAgICBBU1NFUlQocFNjZW5lSW5mbyk7Ci0KLQotICAgIHRtcCA9IGgyNjRic2RHZXRCaXRzKHBTdHJtRGF0YSwgMSk7Ci0gICAgaWYgKHRtcCA9PSBFTkRfT0ZfU1RSRUFNKQotICAgICAgICByZXR1cm4oSEFOVFJPX05PSyk7Ci0gICAgcFNjZW5lSW5mby0+c2NlbmVJbmZvUHJlc2VudEZsYWcgPSB0bXAgPT0gMSA/IEhBTlRST19UUlVFIDogSEFOVFJPX0ZBTFNFOwotCi0gICAgaWYgKHBTY2VuZUluZm8tPnNjZW5lSW5mb1ByZXNlbnRGbGFnKQotICAgIHsKLSAgICAgICAgdG1wID0gaDI2NGJzZERlY29kZUV4cEdvbG9tYlVuc2lnbmVkKHBTdHJtRGF0YSwgJnBTY2VuZUluZm8tPnNjZW5lSWQpOwotICAgICAgICBpZiAodG1wICE9IEhBTlRST19PSykKLSAgICAgICAgICAgIHJldHVybih0bXApOwotCi0gICAgICAgIHRtcCA9IGgyNjRic2REZWNvZGVFeHBHb2xvbWJVbnNpZ25lZChwU3RybURhdGEsCi0gICAgICAgICAgJnBTY2VuZUluZm8tPnNjZW5lVHJhbnNpdGlvblR5cGUpOwotICAgICAgICBpZiAodG1wICE9IEhBTlRST19PSykKLSAgICAgICAgICAgIHJldHVybih0bXApOwotICAgICAgICBpZiAocFNjZW5lSW5mby0+c2NlbmVUcmFuc2l0aW9uVHlwZSA+IDYpCi0gICAgICAgICAgICByZXR1cm4oSEFOVFJPX05PSyk7Ci0KLSAgICAgICAgaWYgKHBTY2VuZUluZm8tPnNjZW5lVHJhbnNpdGlvblR5cGUpCi0gICAgICAgIHsK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lcl9jbnRfbHNiX21pbnVzNCAqLwotICAgICAgICB0bXAgPSBoMjY0YnNkRGVjb2RlRXhwR29sb21iVW5zaWduZWQocFN0cm1EYXRhLCAmdmFsdWUpOwotICAgICAgICBpZiAodG1wICE9IEhBTlRST19PSykKLSAgICAgICAgICAgIHJldHVybih0bXApOwotICAgICAgICBpZiAodmFsdWUgPiAxMikKLSAgICAgICAgewotICAgICAgICAgICAgRVBSSU5UKCJsb2cyX21heF9waWNfb3JkZXJfY250X2xzYl9taW51czQiKTsKLSAgICAgICAgICAgIHJldHVybihIQU5UUk9fTk9LKTsKLSAgICAgICAgfQotICAgICAgICAvKiBtYXhQaWNPcmRlckNudExzYiA9IDJeKGxvZzJfbWF4X3BpY19vcmRlcl9jbnRfbHNiX21pbnVzNCArIDQpICovCi0gICAgICAgIHBTZXFQYXJhbVNldC0+bWF4UGljT3JkZXJDbnRMc2IgPSAxIDw8ICh2YWx1ZSs0KTsKLSAgICB9Ci0gICAgZWxzZSBpZiAocFNlcVBhcmFtU2V0LT5waWNPcmRlckNudFR5cGUgPT0gMSkKLSAgICB7Ci0gICAgICAgIHRtcCA9IGgyNjRic2RHZXRCaXRzKHBTdHJtRGF0YSwgMSk7Ci0gICAgICAgIGlmICh0bXAgPT0gRU5EX09GX1NUUkVBTSkKLSAgICAgICAgICAgIHJldHVybihIQU5UUk9fTk9LKTsKLSAgICAgICAgcFNlcVBhcmFtU2V0LT5kZWx0YVBpY09yZGVyQWx3YXlzWmVyb0ZsYWcgPSAodG1wID09IDEpID8KLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBIQU5UUk9fVFJVRSA6IEhBTlRST19GQUxTRTsKLQotICAgICAgICB0bXAgPSBoMjY0YnNkRGVjb2RlRXhwR29sb21iU2lnbmVkKHBTdHJtRGF0YSwKLSAgICAgICAgICAgICZwU2VxUGFyYW1TZXQtPm9mZnNldEZvck5vblJlZlBpYyk7Ci0gICAgICAgIGlmICh0bXAgIT0gSEFOVFJPX09LKQotICAgICAgICAgICAgcmV0dXJuKHRtcCk7Ci0KLSAgICAgICAgdG1wID0gaDI2NGJzZERlY29kZUV4cEdvbG9tYlNpZ25lZChwU3RybURhdGEsCi0gICAgICAgICAgICAmcFNlcVBhcmFtU2V0LT5vZmZzZXRGb3JUb3BUb0JvdHRvbUZpZWxkKTsKLSAgICAgICAgaWYgKHRtcCAhPSBIQU5UUk9fT0spCi0gICAgICAgICAgICByZXR1cm4odG1wKTsKLQotICAgICAgICB0bXAgPSBoMjY0YnNkRGVjb2RlRXhwR29sb21iVW5zaWduZWQocFN0cm1EYXRhLAotICAgICAgICAgICAgJnBTZXFQYXJhbVNldC0+bnVtUmVmRnJhbWVzSW5QaWNPcmRlckNudEN5Y2xlKTsKLSAgICAgICAgaWYgKHRtcCAhPSBIQU5UUk9fT0spCi0gICAgICAgICAgICByZXR1cm4odG1wKTsKLSAgICAgICAgaWYgKHBTZXFQYXJhbVNldC0+bnVtUmVmRnJhbWVzSW5QaWNPcmRlckNudEN5Y2xlID4gMjU1KQotICAgICAgICB7Ci0gICAgICAgICAgICBFUFJJTlQoIm51bV9yZWZfZnJhbWVzX2luX3BpY19vcmRlcl9jbnRfY3ljbGUiKTsKLSAgICAgICAgICAgIHJldHVybihIQU5UUk9fTk9LKTsKLSAgICAgICAgfQotCi0gICAgICAgIGlmIChwU2VxUGFyYW1TZXQtPm51bVJlZkZyYW1lc0luUGljT3JkZXJDbnRDeWNsZSkKLSAgICAgICAgewotICAgICAgICAgICAgLyogTk9URTogVGhpcyBoYXMgdG8gYmUgZnJlZWQgc29tZXdoZXJlISAqLwotICAgICAgICAgICAgQUxMT0NBVEUocFNlcVBhcmFtU2V0LT5vZmZzZXRGb3JSZWZGcmFtZSwKLSAgICAgICAgICAgICAgICAgICAgIHBTZXFQYXJhbVNldC0+bnVtUmVmRnJhbWVzSW5QaWNPcmRlckNudEN5Y2xlLCBpMzIpOwotICAgICAgICAgICAgaWYgKHBTZXFQYXJhbVNldC0+b2Zmc2V0Rm9yUmVmRnJhbWUgPT0gTlVMTCkKLSAgICAgICAgICAgICAgICByZXR1cm4oTUVNT1JZX0FMTE9DQVRJT05fRVJST1IpOwotCi0gICAgICAgICAgICBmb3IgKGkgPSAwOyBpIDwgcFNlcVBhcmFtU2V0LT5udW1SZWZGcmFtZXNJblBpY09yZGVyQ250Q3ljbGU7IGkrKykKLSAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICB0bXAgPSAgaDI2NGJzZERlY29kZUV4cEdvbG9tYlNpZ25lZChwU3RybURhdGEsCi0gICAgICAgICAgICAgICAgICAgIHBTZXFQYXJhbVNldC0+b2Zmc2V0Rm9yUmVmRnJhbWUgKyBpKTsKLSAgICAgICAgICAgICAgICBpZiAodG1wICE9IEhBTlRST19PSykKLSAgICAgICAgICAgICAgICAgICAgcmV0dXJuKHRtcCk7Ci0gICAgICAgICAgICB9Ci0gICAgICAgIH0KLSAgICAgICAgZWxzZQotICAgICAgICB7Ci0gICAgICAgICAgICBwU2VxUGFyYW1TZXQtPm9mZnNldEZvclJlZkZyYW1lID0gTlVMTDsKLSAgICAgICAgfQotICAgIH0KLQotICAgIHRtcCA9IGgyNjRic2REZWNvZGVFeHBHb2xvbWJVbnNpZ25lZChwU3RybURhdGEsCi0gICAgICAgICZwU2VxUGFyYW1TZXQtPm51bVJlZkZyYW1lcyk7Ci0gICAgaWYgKHRtcCAhPSBIQU5UUk9fT0spCi0gICAgICAgIHJldHVybih0bXApOwotICAgIGlmIChwU2VxUGFyYW1TZXQtPm51bVJlZkZyYW1lcyA+IE1BWF9OVU1fUkVGX1BJQ1MpCi0gICAgewotICAgICAgICBFUFJJTlQoIm51bV9yZWZfZnJhbWVzIik7Ci0gICAgICAgIHJldHVybihIQU5UUk9fTk9LKTsKLSAgICB9Ci0KLSAgICB0bXAgPSBoMjY0YnNkR2V0Qml0cyhwU3RybURhdGEsIDEpOwotICAgIGlmICh0bXAgPT0gRU5EX09GX1NUUkVBTSkKLSAgICAgICAgcm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5EX09GX1NUUkVBTSkKLSAgICAgICAgcmV0dXJuKEhBTlRST19OT0spOwotCi0gICAgdG1wID0gaDI2NGJzZEdldEJpdHMocFN0cm1EYXRhLCAxKTsKLSAgICBpZiAodG1wID09IEVORF9PRl9TVFJFQU0pCi0gICAgICAgIHJldHVybihIQU5UUk9fTk9LKTsKLSAgICBwU2VxUGFyYW1TZXQtPmZyYW1lQ3JvcHBpbmdGbGFnID0gKHRtcCA9PSAxKSA/IEhBTlRST19UUlVFIDogSEFOVFJPX0ZBTFNFOwotCi0gICAgaWYgKHBTZXFQYXJhbVNldC0+ZnJhbWVDcm9wcGluZ0ZsYWcpCi0gICAgewotICAgICAgICB0bXAgPSBoMjY0YnNkRGVjb2RlRXhwR29sb21iVW5zaWduZWQocFN0cm1EYXRhLAotICAgICAgICAgICAgJnBTZXFQYXJhbVNldC0+ZnJhbWVDcm9wTGVmdE9mZnNldCk7Ci0gICAgICAgIGlmICh0bXAgIT0gSEFOVFJPX09LKQotICAgICAgICAgICAgcmV0dXJuKHRtcCk7Ci0gICAgICAgIHRtcCA9IGgyNjRic2REZWNvZGVFeHBHb2xvbWJVbnNpZ25lZChwU3RybURhdGEsCi0gICAgICAgICAgICAmcFNlcVBhcmFtU2V0LT5mcmFtZUNyb3BSaWdodE9mZnNldCk7Ci0gICAgICAgIGlmICh0bXAgIT0gSEFOVFJPX09LKQotICAgICAgICAgICAgcmV0dXJuKHRtcCk7Ci0gICAgICAgIHRtcCA9IGgyNjRic2REZWNvZGVFeHBHb2xvbWJVbnNpZ25lZChwU3RybURhdGEsCi0gICAgICAgICAgICAmcFNlcVBhcmFtU2V0LT5mcmFtZUNyb3BUb3BPZmZzZXQpOwotICAgICAgICBpZiAodG1wICE9IEhBTlRST19PSykKLSAgICAgICAgICAgIHJldHVybih0bXApOwotICAgICAgICB0bXAgPSBoMjY0YnNkRGVjb2RlRXhwR29sb21iVW5zaWduZWQocFN0cm1EYXRhLAotICAgICAgICAgICAgJnBTZXFQYXJhbV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AgICAgICAgY2FzZSAxMDoKLSAgICAgICAgICAgIHRtcCA9IDE1MjA2NDsKLSAgICAgICAgICAgIG1heFBpY1NpemVJbk1icyA9IDk5OwotICAgICAgICAgICAgYnJlYWs7Ci0KLSAgICAgICAgY2FzZSAxMToKLSAgICAgICAgICAgIHRtcCA9IDM0NTYwMDsKLSAgICAgICAgICAgIG1heFBpY1NpemVJbk1icyA9IDM5NjsKLSAgICAgICAgICAgIGJyZWFrOwotCi0gICAgICAgIGNhc2UgMTI6Ci0gICAgICAgICAgICB0bXAgPSA5MTIzODQ7Ci0gICAgICAgICAgICBtYXhQaWNTaXplSW5NYnMgPSAzOTY7Ci0gICAgICAgICAgICBicmVhazsKLQotICAgICAgICBjYXNlIDEzOgotICAgICAgICAgICAgdG1wID0gOTEyMzg0OwotICAgICAgICAgICAgbWF4UGljU2l6ZUluTWJzID0gMzk2OwotICAgICAgICAgICAgYnJlYWs7Ci0KLSAgICAgICAgY2FzZSAyMDoKLSAgICAgICAgICAgIHRtcCA9IDkxMjM4NDsKLSAgICAgICAgICAgIG1heFBpY1NpemVJbk1icyA9IDM5NjsKLSAgICAgICAgICAgIGJyZWFrOwotCi0gICAgICAgIGNhc2UgMjE6Ci0gICAgICAgICAgICB0bXAgPSAxODI0NzY4OwotICAgICAgICAgICAgbWF4UGljU2l6ZUluTWJzID0gNzkyOwotICAgICAgICAgICAgYnJlYWs7Ci0KLSAgICAgICAgY2FzZSAyMjoKLSAgICAgICAgICAgIHRtcCA9IDMxMTA0MDA7Ci0gICAgICAgICAgICBtYXhQaWNTaXplSW5NYnMgPSAxNjIwOwotICAgICAgICAgICAgYnJlYWs7Ci0KLSAgICAgICAgY2FzZSAzMDoKLSAgICAgICAgICAgIHRtcCA9IDMxMTA0MDA7Ci0gICAgICAgICAgICBtYXhQaWNTaXplSW5NYnMgPSAxNjIwOwotICAgICAgICAgICAgYnJlYWs7Ci0KLSAgICAgICAgY2FzZSAzMToKLSAgICAgICAgICAgIHRtcCA9IDY5MTIwMDA7Ci0gICAgICAgICAgICBtYXhQaWNTaXplSW5NYnMgPSAzNjAwOwotICAgICAgICAgICAgYnJlYWs7Ci0KLSAgICAgICAgY2FzZSAzMjoKLSAgICAgICAgICAgIHRtcCA9IDc4NjQzMjA7Ci0gICAgICAgICAgICBtYXhQaWNTaXplSW5NYnMgPSA1MTIwOwotICAgICAgICAgICAgYnJlYWs7Ci0KLSAgICAgICAgY2FzZSA0MDoKLSAgICAgICAgICAgIHRtcCA9IDEyNTgyOTEyOwotICAgICAgICAgICAgbWF4UGljU2l6ZUluTWJzID0gODE5MjsKLSAgICAgICAgICAgIGJyZWFrOwotCi0gICAgICAgIGNhc2UgNDE6Ci0gICAgICAgICAgICB0bXAgPSAxMjU4MjkxMjsKLSAgICAgICAgICAgIG1heFBpY1NpemVJbk1icyA9IDgxOTI7Ci0gICAgICAgICAgICBicmVhazsKLQotICAgICAgICBjYXNlIDQyOgotICAgICAgICAgICAgdG1wID0gMzQ4MTYqMzg0OwotICAgICAgICAgICAgbWF4UGljU2l6ZUluTWJzID0gODcwNDsKLSAgICAgICAgICAgIGJyZWFrOwotCi0gICAgICAgIGNhc2UgNTA6Ci0gICAgICAgICAgICAvKiBzdGFuZGFyZCBzYXlzIDQyMzAxNDQwIGhlcmUsIGJ1dCBjb3JyaWdlbmR1bSAiY29ycmVjdHMiIHRoaXMgdG8KLSAgICAgICAgICAgICAqIDQyMzkzNjAwICovCi0gICAgICAgICAgICB0bXAgPSA0MjM5MzYwMDsKLSAgICAgICAgICAgIG1heFBpY1NpemVJbk1icyA9IDIyMDgwOwotICAgICAgICAgICAgYnJlYWs7Ci0KLSAgICAgICAgY2FzZSA1MToKLSAgICAgICAgICAgIHRtcCA9IDcwNzc4ODgwOwotICAgICAgICAgICAgbWF4UGljU2l6ZUluTWJzID0gMzY4NjQ7Ci0gICAgICAgICAgICBicmVhazsKLQotICAgICAgICBkZWZhdWx0OgotICAgICAgICAgICAgcmV0dXJuKElOVkFMSURfRFBCX1NJ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BpY0hlaWdodEluTWJzICAgID09IHBTcHMyLT5waWNIZWlnaHRJbk1icyAmJgotICAgICAgICBwU3BzMS0+ZnJhbWVDcm9wcGluZ0ZsYWcgPT0gcFNwczItPmZyYW1lQ3JvcHBpbmdGbGFnICYmCi0gICAgICAgIHBTcHMxLT52dWlQYXJhbWV0ZXJzUHJlc2VudEZsYWcgPT0gcFNwczItPnZ1aVBhcmFtZXRlcnNQcmVzZW50RmxhZykKLSAgICB7Ci0gICAgICAgIGlmIChwU3BzMS0+cGljT3JkZXJDbnRUeXBlID09IDApCi0gICAgICAgIHsKLSAgICAgICAgICAgIGlmIChwU3BzMS0+bWF4UGljT3JkZXJDbnRMc2IgIT0gcFNwczItPm1heFBpY09yZGVyQ250THNiKQotICAgICAgICAgICAgICAgIHJldHVybiAxOwotICAgICAgICB9Ci0gICAgICAgIGVsc2UgaWYgKHBTcHMxLT5waWNPcmRlckNudFR5cGUgPT0gMSkKLSAgICAgICAgewotICAgICAgICAgICAgaWYgKHBTcHMxLT5kZWx0YVBpY09yZGVyQWx3YXlzWmVyb0ZsYWcgIT0KLSAgICAgICAgICAgICAgICAgICAgcFNwczItPmRlbHRhUGljT3JkZXJBbHdheXNaZXJvRmxhZyB8fAotICAgICAgICAgICAgICAgIHBTcHMxLT5vZmZzZXRGb3JOb25SZWZQaWMgIT0gcFNwczItPm9mZnNldEZvck5vblJlZlBpYyB8fAotICAgICAgICAgICAgICAgIHBTcHMxLT5vZmZzZXRGb3JUb3BUb0JvdHRvbUZpZWxkICE9Ci0gICAgICAgICAgICAgICAgICAgIHBTcHMyLT5vZmZzZXRGb3JUb3BUb0JvdHRvbUZpZWxkIHx8Ci0gICAgICAgICAgICAgICAgcFNwczEtPm51bVJlZkZyYW1lc0luUGljT3JkZXJDbnRDeWNsZSAhPQotICAgICAgICAgICAgICAgICAgICBwU3BzMi0+bnVtUmVmRnJhbWVzSW5QaWNPcmRlckNudEN5Y2xlKQotICAgICAgICAgICAgewotICAgICAgICAgICAgICAgIHJldHVybiAxOwotICAgICAgICAgICAgfQotICAgICAgICAgICAgZWxzZQotICAgICAgICAgICAgewotICAgICAgICAgICAgICAgIGZvciAoaSA9IDA7IGkgPCBwU3BzMS0+bnVtUmVmRnJhbWVzSW5QaWNPcmRlckNudEN5Y2xlOyBpKyspCi0gICAgICAgICAgICAgICAgICAgIGlmIChwU3BzMS0+b2Zmc2V0Rm9yUmVmRnJhbWVbaV0gIT0KLSAgICAgICAgICAgICAgICAgICAgICAgIHBTcHMyLT5vZmZzZXRGb3JSZWZGcmFtZVtpXSkKLSAgICAgICAgICAgICAgICAgICAgewotICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIDE7Ci0gICAgICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgIH0KLSAgICAgICAgfQotICAgICAgICBpZiAocFNwczEtPmZyYW1lQ3JvcHBpbmdGbGFnKQotICAgICAgICB7Ci0gICAgICAgICAgICBpZiAocFNwczEtPmZyYW1lQ3JvcExlZnRPZmZzZXQgICAhPSBwU3BzMi0+ZnJhbWVDcm9wTGVmdE9mZnNldCB8fAotICAgICAgICAgICAgICAgIHBTcHMxLT5mcmFtZUNyb3BSaWdodE9mZnNldCAgIT0gcFNwczItPmZyYW1lQ3JvcFJpZ2h0T2Zmc2V0IHx8Ci0gICAgICAgICAgICAgICAgcFNwczEtPmZyYW1lQ3JvcFRvcE9mZnNldCAgICAhPSBwU3BzMi0+ZnJhbWVDcm9wVG9wT2Zmc2V0IHx8Ci0gICAgICAgICAgICAgICAgcFNwczEtPmZyYW1lQ3JvcEJvdHRvbU9mZnNldCAhPSBwU3BzMi0+ZnJhbWVDcm9wQm90dG9tT2Zmc2V0KQotICAgICAgICAgICAgewotICAgICAgICAgICAgICAgIHJldHVybiAxOwotICAgICAgICAgICAgfQotICAgICAgICB9Ci0KLSAgICAgICAgcmV0dXJuIDA7Ci0gICAgfQotCi0gICAgcmV0dXJuIDE7Ci19Ci0KZGlmZiAtLWdpdCBhL21lZGlhL2x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0gICAgICAgICAgICAgICAgICogbWFjcm9ibG9ja3MgbGVmdCAqLwotICAgICAgICAgICAgICAgIGlmIChza2lwUnVuID4gKHBTdG9yYWdlLT5waWNTaXplSW5NYnMgLSBjdXJyTWJBZGRyKSkKLSAgICAgICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgICAgIEVQUklOVCgic2tpcF9ydW4iKTsKLSAgICAgICAgICAgICAgICAgICAgcmV0dXJuKEhBTlRST19OT0spOwotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICBpZiAoc2tpcFJ1bikKLSAgICAgICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgICAgIHByZXZTa2lwcGVkID0gSEFOVFJPX1RSVUU7Ci0gICAgICAgICAgICAgICAgICAgIEgyNjRTd0RlY01lbXNldCgmbWJMYXllci0+bWJQcmVkLCAwLCBzaXplb2YobWJQcmVkX3QpKTsKLSAgICAgICAgICAgICAgICAgICAgLyogbWFyayBjdXJyZW50IG1hY3JvYmxvY2sgc2tpcHBlZCAqLwotICAgICAgICAgICAgICAgICAgICBtYkxheWVyLT5tYlR5cGUgPSBQX1NraXA7Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgfQotICAgICAgICB9Ci0KLSAgICAgICAgaWYgKHNraXBSdW4pCi0gICAgICAgIHsKLSAgICAgICAgICAgIERFQlVHKCgiU2tpcHBpbmcgbWFjcm9ibG9jayAlZFxuIiwgY3Vyck1iQWRkcikpOwotICAgICAgICAgICAgc2tpcFJ1bi0tOwotICAgICAgICB9Ci0gICAgICAgIGVsc2UKLSAgICAgICAgewotICAgICAgICAgICAgcHJldlNraXBwZWQgPSBIQU5UUk9fRkFMU0U7Ci0gICAgICAgICAgICB0bXAgPSBoMjY0YnNkRGVjb2RlTWFjcm9ibG9ja0xheWVyKHBTdHJtRGF0YSwgbWJMYXllciwKLSAgICAgICAgICAgICAgICBwU3RvcmFnZS0+bWIgKyBjdXJyTWJBZGRyLCBwU2xpY2VIZWFkZXItPnNsaWNlVHlwZSwKLSAgICAgICAgICAgICAgICBwU2xpY2VIZWFkZXItPm51bVJlZklkeEwwQWN0aXZlKTsKLSAgICAgICAgICAgIGlmICh0bXAgIT0gSEFOVFJPX09LKQotICAgICAgICAgICAgewotICAgICAgICAgICAgICAgIEVQUklOVCgibWFjcm9ibG9ja19sYXllciIpOwotICAgICAgICAgICAgICAgIHJldHVybih0bXApOwotICAgICAgICAgICAgfQotICAgICAgICB9Ci0KLSAgICAgICAgdG1wID0gaDI2NGJzZERlY29kZU1hY3JvYmxvY2socFN0b3JhZ2UtPm1iICsgY3Vyck1iQWRkciwgbWJMYXllciwKLSAgICAgICAgICAgIGN1cnJJbWFnZSwgcFN0b3JhZ2UtPmRwYiwgJnFwWSwgY3Vyck1iQWRkciwKLSAgICAgICAgICAgIHBTdG9yYWdlLT5hY3RpdmVQcHMtPmNvbnN0cmFpbmVkSW50cmFQcmVkRmxhZywgZGF0YSk7Ci0gICAgICAgIGlmICh0bXAgIT0gSEFOVFJPX09LKQotICAgICAgICB7Ci0gICAgICAgICAgICBFUFJJTlQoIk1BQ1JPX0JMT0NLIik7Ci0gICAgICAgICAgICByZXR1cm4odG1wKTsKLSAgICAgICAgfQotCi0gICAgICAgIC8qIGluY3JlbWVudCBtYWNyb2Jsb2NrIGNvdW50IG9ubHkgZm9yIG1hY3JvYmxvY2tzIHRoYXQgd2VyZSBkZWNvZGVkCi0gICAgICAgICAqIGZvciB0aGUgZmlyc3QgdGltZSAocmVkdW5kYW50IHNsaWNlcykgKi8KLSAgICAgICAgaWYgKHBTdG9yYWdlLT5tYltjdXJyTWJBZGRyXS5kZWNvZGVkID09IDEpCi0gICAgICAgICAgICBtYkNvdW50Kys7Ci0KLSAgICAgICAgLyoga2VlcCBvbiBwcm9jZXNzaW5nIGFzIGxvbmcgYXMgdGhlcmUgaXMgc3RyZWFtIGRhdGEgbGVmdCBvcgotICAgICAgICAgKiBwcm9jZXNzaW5nIG9mIG1hY3JvYmxvY2tzIHRvIGJlIHNraXBwZWQgYmFzZWQgb24gdGhlIGxhc3Qgc2tpcFJ1biBpcwotICAgICAgICAgKiBub3QgZmluaXNoZWQgKi8KLSAgICAgICAgbW9yZU1icyA9IChoMjY0YnNkTW9yZVJic3BEYXRhKHBTdHJtRGF0YSkgfHwgc2tpcFJ1bikgPwotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEhBTlRST19UUlVFIDogSEFOVFJPX0ZBTFNFOwotCi0gICAgICAgIC8qIGxhc3RNYkFkZHIgaXMgb25seSB1cGRhdGVkIGZvciBpbnRyYSBzbGljZXMgKGFsbCBtYWNyb2Jsb2NrcyBvZgotICAgICAgICAgKiBpbnRlciBzbGljZXMgd2lsbCBiZSBsb3N0IGluIGNhc2Ugb2YgYW4gZXJyb3IpICovCi0gICAgICAgIGlmIChJU19JX1NMSUNFKHBTbGljZUhlYWRlci0+c2xpY2VUeXBlKSkKLSAgICAgICAgICAgIHBTdG9yYWdlLT5zbGljZS0+bGFzdE1iQWRkciA9IGN1cnJNYkFkZHI7Ci0KLSAgICAgICAgY3Vyck1iQWRkciA9IGgyNjRic2ROZXh0TWJBZGRyZXNzKHBTdG9yYWdlLT5zbGljZUdyb3VwTWFwLAotICAgICAgICAgICAgcFN0b3JhZ2UtPnBpY1NpemVJbk1icywgY3Vyck1iQWRkcik7Ci0gICAgICAgIC8qIGRhdGEgbGVmdCBpbiB0aGUgYnVmZmVyIGJ1dCBubyBtb3JlIG1hY3JvYmxvY2tzIGZvciBjdXJyZW50IHNsaWNlCi0gICAgICAgICAqIGdyb3VwIC0+IGVycm9yICovCi0gICAgICAgIGlmIChtb3JlTWJzICYmICFjdXJyTWJBZGRyKQotICAgICAgICB7Ci0gICAgICAgICAgICBFUFJJTlQoIk5leHQgbWIgYWRkcmVzcyIpOwotICAgICAgICAgICAgcmV0dXJuKEhBTlRST19OT0spOwotICAgICAgICB9Ci0KLSAgICB9IHdoaWxlIChtb3JlTWJzKTsKLQotICAgIGlmICg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QotCi0vKi0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLQotCi0gICAgRnVuY3Rpb246IERlY29kZUJveE91dE1hcAotCi0gICAgICAgIEZ1bmN0aW9uYWwgZGVzY3JpcHRpb246Ci0gICAgICAgICAgICBGdW5jdGlvbiB0byBkZWNvZGUgYm94LW91dCBzbGljZSBncm91cCBtYXAgdHlwZSwgaS5lLiBzbGljZSBncm91cAotICAgICAgICAgICAgbWFwIHR5cGUgMy4KLQotICAgICAgICBJbnB1dHM6Ci0gICAgICAgICAgICBtYXAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcG9pbnRlciB0byB0aGUgbWFwCi0gICAgICAgICAgICBzbGljZUdyb3VwQ2hhbmdlRGlyZWN0aW9uRmxhZyAgICAgc2xpY2VfZ3JvdXBfY2hhbmdlX2RpcmVjdGlvbl9mbGFnCi0gICAgICAgICAgICB1bml0c0luU2xpY2VHcm91cDAgICAgICAgICAgICAgICAgbWJzIG9uIHNsaWNlIGdyb3VwIDAKLSAgICAgICAgICAgIHBpY1dpZHRoICAgICAgICAgICAgICAgICAgICAgICAgICBwaWN0dXJlIHdpZHRoIGluIG1hY3JvYmxvY2tzCi0gICAgICAgICAgICBwaWNIZWlnaHQgICAgICAgICAgICAgICAgICAgICAgICAgcGljdHVyZSBoZWlnaHQgaW4gbWFjcm9ibG9ja3MKLQotICAgICAgICBPdXRwdXRzOgotICAgICAgICAgICAgbWFwICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNsaWNlIGdyb3VwIG1hcCBpcyBzdG9yZWQgaGVyZQotCi0gICAgICAgIFJldHVybnM6Ci0gICAgICAgICAgICBub25lCi0KLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0t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ci0gICAgICAgICAgICB0b3BCb3VuZCA9IE1BWCh0b3BCb3VuZCAtIDEsIDApOwotICAgICAgICAgICAgeSA9IHRvcEJvdW5kOwotICAgICAgICAgICAgeERpciA9IDEgLSAyICogKGkzMilzbGljZUdyb3VwQ2hhbmdlRGlyZWN0aW9uRmxhZzsKLSAgICAgICAgICAgIHlEaXIgPSAwOwotICAgICAgICB9Ci0gICAgICAgIGVsc2UgaWYgKHlEaXIgPT0gMSAmJiB5ID09IGJvdHRvbUJvdW5kKQotICAgICAgICB7Ci0gICAgICAgICAgICBib3R0b21Cb3VuZCA9IE1JTihib3R0b21Cb3VuZCArIDEsIChpMzIpcGljSGVpZ2h0IC0gMSk7Ci0gICAgICAgICAgICB5ID0gYm90dG9tQm91bmQ7Ci0gICAgICAgICAgICB4RGlyID0gMiAqIChpMzIpc2xpY2VHcm91cENoYW5nZURpcmVjdGlvbkZsYWcgLSAxOwotICAgICAgICAgICAgeURpciA9IDA7Ci0gICAgICAgIH0KLSAgICAgICAgZWxzZQotICAgICAgICB7Ci0gICAgICAgICAgICB4ICs9IHhEaXI7Ci0gICAgICAgICAgICB5ICs9IHlEaXI7Ci0gICAgICAgIH0KLSAgICB9Ci0KLQotfQotCi0vKi0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLQotCi0gICAgRnVuY3Rpb246IERlY29kZVJhc3RlclNjYW5NYXAKLQotICAgICAgICBGdW5jdGlvbmFsIGRlc2NyaXB0aW9uOgotICAgICAgICAgICAgRnVuY3Rpb24gdG8gZGVjb2RlIHJhc3RlciBzY2FuIHNsaWNlIGdyb3VwIG1hcCB0eXBlLCBpLmUuIHNsaWNlCi0gICAgICAgICAgICBncm91cCBtYXAgdHlwZSA0LgotCi0gICAgICAgIElucHV0czoKLSAgICAgICAgICAgIG1hcCAgICAgICAgICAgICAgICAgICAgICAgICAgICAg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05BTF9VTklUKHBOYWxVbml0KSkKLSAgICB7Ci0gICAgICAgIHRtcCA9IGgyNjRic2REZWNvZGVFeHBHb2xvbWJVbnNpZ25lZChwU3RybURhdGEsICZ2YWx1ZSk7Ci0gICAgICAgIGlmICh0bXAgIT0gSEFOVFJPX09LKQotICAgICAgICAgICAgcmV0dXJuKHRtcCk7Ci0gICAgICAgIHBTbGljZUhlYWRlci0+aWRyUGljSWQgPSB2YWx1ZTsKLSAgICAgICAgaWYgKHZhbHVlID4gNjU1MzUpCi0gICAgICAgIHsKLSAgICAgICAgICAgIEVQUklOVCgiaWRyX3BpY19pZCIpOwotICAgICAgICAgICAgcmV0dXJuKEhBTlRST19OT0spOwotICAgICAgICB9Ci0gICAgfQotCi0gICAgaWYgKHBTZXFQYXJhbVNldC0+cGljT3JkZXJDbnRUeXBlID09IDApCi0gICAgewotICAgICAgICAvKiBsb2cyKG1heFBpY09yZGVyQ250THNiKSAtPiBudW0gYml0cyB0byByZXByZXNlbnQgcGljX29yZGVyX2NudF9sc2IgKi8KLSAgICAgICAgaSA9IDA7Ci0gICAgICAgIHdoaWxlIChwU2VxUGFyYW1TZXQtPm1heFBpY09yZGVyQ250THNiID4+IGkpCi0gICAgICAgICAgICBpKys7Ci0gICAgICAgIGktLTsKLQotICAgICAgICB0bXAgPSBoMjY0YnNkR2V0Qml0cyhwU3RybURhdGEsIGkpOwotICAgICAgICBpZiAodG1wID09IEVORF9PRl9TVFJFQU0pCi0gICAgICAgICAgICByZXR1cm4oSEFOVFJPX05PSyk7Ci0gICAgICAgIHBTbGljZUhlYWRlci0+cGljT3JkZXJDbnRMc2IgPSB0bXA7Ci0KLSAgICAgICAgaWYgKHBQaWNQYXJhbVNldC0+cGljT3JkZXJQcmVzZW50RmxhZykKLSAgICAgICAgewotICAgICAgICAgICAgdG1wID0gaDI2NGJzZERlY29kZUV4cEdvbG9tYlNpZ25lZChwU3RybURhdGEsICZpdG1wKTsKLSAgICAgICAgICAgIGlmICh0bXAgIT0gSEFOVFJPX09LKQotICAgICAgICAgICAgICAgIHJldHVybih0bXApOwotICAgICAgICAgICAgcFNsaWNlSGVhZGVyLT5kZWx0YVBpY09yZGVyQ250Qm90dG9tID0gaXRtcDsKLSAgICAgICAgfQotCi0gICAgICAgIC8qIGNoZWNrIHRoYXQgcGljT3JkZXJDbnQgZm9yIElEUiBwaWN0dXJlIHdpbGwgYmUgemVyby4gU2VlCi0gICAgICAgICAqIERlY29kZVBpY09yZGVyQ250IGZ1bmN0aW9uIHRvIHVuZGVyc3RhbmQgdGhlIGxvZ2ljIGhlcmUgKi8KLSAgICAgICAgaWYgKCBJU19JRFJfTkFMX1VOSVQocE5hbFVuaXQpICYmCi0gICAgICAgICAgICAgKCAocFNsaWNlSGVhZGVyLT5waWNPcmRlckNudExzYiA+Ci0gICAgICAgICAgICAgICAgcFNlcVBhcmFtU2V0LT5tYXhQaWNPcmRlckNudExzYi8yKSB8fAotICAgICAgICAgICAgICAgIE1JTigoaTMyKXBTbGljZUhlYWRlci0+cGljT3JkZXJDbnRMc2IsCi0gICAgICAgICAgICAgICAgICAgIChpMzIpcFNsaWNlSGVhZGVyLT5waWNPcmRlckNudExzYiArCi0gICAgICAgICAgICAgICAgICAgIHBTbGljZUhlYWRlci0+ZGVsdGFQaWNPcmRlckNudEJvdHRvbSkgIT0gMCApICkKLSAgICAgICAgewotICAgICAgICAgICAgcmV0dXJuKEhBTlRST19OT0spOwotICAgICAgICB9Ci0gICAgfQotCi0gICAgaWYgKCAocFNlcVBhcmFtU2V0LT5waWNPcmRlckNudFR5cGUgPT0gMSkgJiYKLSAgICAgICAgICFwU2VxUGFyYW1TZXQtPmRlbHRhUGljT3JkZXJBbHdheXNaZXJvRmxhZyApCi0gICAgewotICAgICAgICB0bXAgPSBoMjY0YnNkRGVjb2RlRXhwR29sb21iU2lnbmVkKHBTdHJtRGF0YSwgJml0bXApOwotICAgICAgICBpZiAodG1wICE9IEhBTlRST19PSykKLSAgICAgICAgICAgIHJldHVybih0bXApOwotICAgICAgICBwU2xpY2VIZWFkZXItPmRlbHRhUGljT3JkZXJDbnRbMF0gPSBpdG1wOwotCi0gICAgICAgIGlmIChwUGljUGFyYW1TZXQtPnBpY09yZGVyUHJlc2VudEZsYWcpCi0gICAgICAgIHsKLSAgICAgICAgICAgIHRtcCA9IGgyNjRic2REZWNvZGVFeHBHb2xvbWJTaWduZWQocFN0cm1EYXRhLCAmaXRtcCk7Ci0gICAgICAgICAgICBpZiAodG1wICE9IEhBTlRST19PSykKLSAgICAgICAgICAgICAgICByZXR1cm4odG1wKTsKLSAgICAgICAgICAgIHBTbGljZUhlYWRlci0+ZGVsdGFQaWNPcmRlckNudFsxXSA9IGl0bXA7Ci0gICAgICAgIH0KLQotICAgICAgICAvKiBjaGVjayB0aGF0IHBpY09yZGVyQ250IGZvciBJRFIgcGljdHVyZSB3aWxsIGJlIHplcm8uIFNlZQotICAgICAgICAgKiBEZWNvZGVQaWNPcmRlckNudCBmdW5jdGlvbiB0byB1bmRlcnN0YW5kIHRoZSBsb2dpYyBoZXJlICovCi0gICAgICAgIGlmICggSVNfSURSX05BTF9VTklUKHBOYWxVbml0KSAmJgotICAgICAgICAgICAgIE1JTihwU2xpY2VIZWFkZXItPmRlbHRhUGljT3JkZXJDbnRbMF0sCi0gICAgICAgICAgICAgICAgIHBTbGljZUhlYWRlci0+ZGVsdGFQaWNPcmRlckNudFswXSArCi0gICAgICAgICAgICAgICAgIHBTZXFQYXJhbVNldC0+b2Zmc2V0Rm9yVG9wVG9Cb3R0b21GaWVsZCArCi0gICAgICAgICAgICAgICAgIHBTbGljZUhlYWRlci0+ZGVsdGFQaWNPcmRlckNudFsxXSkgIT0gMCkKLSAgICAgICAgewotICAgICAgICAgICAgcmV0dXJuKEhBTlRST19OT0spOwotICAgICAgICB9Ci0gICAgfQotCi0gICAgaWYgKHBQaWNQYXJhbVNldC0+cmVkdW5kYW50UGljQ250UHJlc2VudEZsYWcpCi0gICAgewotICAgICAgICB0bXAgPSBoMjY0YnNkRGVjb2RlRXhwR29sb21iVW5zaWduZWQocFN0cm1EYXRhLCAmdmFsdWUpOwotICAgICAgICBpZiAodG1wICE9IEhBTlRST19PSykKLSAgICAgICAgICAgIHJldHVybih0bXApOwotICAgICAgICBwU2xpY2VIZWFkZXItPnJlZHVuZGFudFBpY0NudCA9IHZhbHVlOwotICAgICAgICBpZiAodmFsdWUgPiAxMjcpCi0gICAgICAgIHsKLSAgICAgICAgICAgIEVQUklOVCgicmVkdW5kYW50X3BpY19jbnQiKTsKLSAgICAgICAgICAgIHJldHVybihIQU5UUk9fTk9LKTsKLSAgICAgICAgfQotICAgIH0KLQotICAgIGlmIChJU19QX1NMSUNFKHBTbGljZUhlYWRlci0+c2xpY2VUeXBlKSkKLSAgICB7Ci0gICAgICAgIHRtcCA9IGgyNjRic2RHZXRCaXRzKHBTdHJtRGF0YSwgMSk7Ci0gICAgICAgIGlmICh0bXAgPT0gRU5EX09GX1NUUkVBTSkKLSAgICAgICAgICAgIHJldHVybihIQU5UUk9fTk9LKTsKLSAgICAgICAgcFNsaWNlSGVhZGVyLT5udW1SZWZJZHhBY3RpdmVPdmVycmlkZUZsYWcgPSB0bXA7Ci0KLSAgICAgICAgaWYgKHBTbGljZUhlYWRlci0+bnVtUmVmSWR4QWN0aXZlT3ZlcnJpZGVGbGFnKQotICAgICAgICB7Ci0gICAgICAgICAgICB0bXAgPSBoMjY0YnNkRGVjb2RlRXhwR29sb21iVW5zaWduZWQocFN0cm1EYXRhLCAmdmFsdWUpOwotICAgICAgICAgICAgaWYgKHRtcCAhPSBIQU5UUk9fT0spCi0gICAgICAgICAgICAgICAgcmV0dXJuKHRtcCk7Ci0gICAgICAgICAgICBpZiAodmFsdWUgPiAxNSkKLSAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICBFUFJJTlQoIm51bV9yZWZfaWR4X2wwX2FjdGl2ZV9taW51czEiKTsKLSAgICAgICAgICAgICAgICByZXR1cm4oSEFOVFJPX05PSyk7Ci0gICAgICAgICAgICB9Ci0gICAgICAgICAgICBwU2xpY2VIZWFkZXItPm51bVJlZklkeEwwQWN0aXZlID0gdmFsdWUgKyAxOwotICAgICAgICB9Ci0gICAgICAgIC8qIHNldCBudW1SZWZJZHhMMEFjdGl2ZSBmcm9tIHBpYyBwYXJhbSBzZXQgKi8KLSAgICAgICAgZWxzZQotICAgICAgICB7Ci0gICAgICAgICAgICAvKiBpZiB2YWx1ZSAobWludXMxKSBpbiBwaWN0dXJlIHBhcmFtZXRlciBzZXQgZXhjZWVkcyAxNSBpdCBzaG91bGQKLSAgICAgICAgICAgICAqIGhhdmUgYmVlbiBvdmVycmlkZGVuIGhlcmUgKi8KLSAgICAgICAgICAgIGlmIChwUGljUGFyYW1TZXQtPm51bVJlZklkeEwwQWN0aXZlID4gMTYpCi0gICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgRVBSSU5UKCJudW1fcmVmX2lkeF9hY3RpdmVfb3ZlcnJpZGVfZmxhZyIpOwotICAgICAgICAgICAgICAgIHJldHVybihIQU5UUk9fTk9LKTsKLSAgICAgICAgICAgIH0KLSAgICAgICAgICAgIHBTbGljZUhlYWRlci0+bnVtUmVmSWR4TDBBY3RpdmUgPSBwUGljUGFyYW1TZXQtPm51bVJlZklkeEwwQWN0aXZlOwotICAgICAgICB9Ci0gICAgfQotCi0gICAgaWYgKElTX1BfU0xJQ0UocFNsaWNlSGVhZGVyLT5zbGljZVR5cGUpKQotICAgIHsKLSAgICAgICAgdG1wID0gUmVmUGljTGlzdFJlb3JkZXJpbmcocFN0cm1EYXRhLAotICAgICAgICAgICAgJnBTbGljZUhlYWRlci0+cmVmUGljTGlzdFJlb3JkZXJpbmcsCi0gICAgICAgICAgICBwU2xpY2VIZWFkZXItPm51bVJlZklkeEwwQWN0aXZlLAotICAgICAgICAgICAgcFNlcVBhcmFtU2V0LT5tYXhGcmFtZU51bSk7Ci0gICAgICAgIGlmICh0bXAgIT0gSEFOVFJPX09LKQotICAgICAgICAgICAgcmV0dXJuKHR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IT0gSEFOVFJPX09LKQotICAgICAgICAgICAgcmV0dXJuKHRtcCk7Ci0gICAgICAgIHBTbGljZUhlYWRlci0+ZGlzYWJsZURlYmxvY2tpbmdGaWx0ZXJJZGMgPSB2YWx1ZTsKLSAgICAgICAgaWYgKHBTbGljZUhlYWRlci0+ZGlzYWJsZURlYmxvY2tpbmdGaWx0ZXJJZGMgPiAyKQotICAgICAgICB7Ci0gICAgICAgICAgICBFUFJJTlQoImRpc2FibGVfZGVibG9ja2luZ19maWx0ZXJfaWRjIik7Ci0gICAgICAgICAgICByZXR1cm4oSEFOVFJPX05PSyk7Ci0gICAgICAgIH0KLQotICAgICAgICBpZiAocFNsaWNlSGVhZGVyLT5kaXNhYmxlRGVibG9ja2luZ0ZpbHRlcklkYyAhPSAxKQotICAgICAgICB7Ci0gICAgICAgICAgICB0bXAgPSBoMjY0YnNkRGVjb2RlRXhwR29sb21iU2lnbmVkKHBTdHJtRGF0YSwgJml0bXApOwotICAgICAgICAgICAgaWYgKHRtcCAhPSBIQU5UUk9fT0spCi0gICAgICAgICAgICAgICAgcmV0dXJuKHRtcCk7Ci0gICAgICAgICAgICBpZiAoIChpdG1wIDwgLTYpIHx8IChpdG1wID4gNikgKQotICAgICAgICAgICAgewotICAgICAgICAgICAgICAgRVBSSU5UKCJzbGljZV9hbHBoYV9jMF9vZmZzZXRfZGl2MiIpOwotICAgICAgICAgICAgICAgcmV0dXJuKEhBTlRST19OT0spOwotICAgICAgICAgICAgfQotICAgICAgICAgICAgcFNsaWNlSGVhZGVyLT5zbGljZUFscGhhQzBPZmZzZXQgPSBpdG1wICogMjsKLQotICAgICAgICAgICAgdG1wID0gaDI2NGJzZERlY29kZUV4cEdvbG9tYlNpZ25lZChwU3RybURhdGEsICZpdG1wKTsKLSAgICAgICAgICAgIGlmICh0bXAgIT0gSEFOVFJPX09LKQotICAgICAgICAgICAgICAgIHJldHVybih0bXApOwotICAgICAgICAgICAgaWYgKCAoaXRtcCA8IC02KSB8fCAoaXRt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kZXJpbmctPnJlZlBpY0xpc3RSZW9yZGVyaW5nRmxhZ0wwKQotICAgIHsKLSAgICAgICAgaSA9IDA7Ci0KLSAgICAgICAgZG8KLSAgICAgICAgewotICAgICAgICAgICAgaWYgKGkgPiBudW1SZWZJZHhBY3RpdmUpCi0gICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgRVBSSU5UKCJUb28gbWFueSByZW9yZGVyaW5nIGNvbW1hbmRzIik7Ci0gICAgICAgICAgICAgICAgcmV0dXJuKEhBTlRST19OT0spOwotICAgICAgICAgICAgfQotCi0gICAgICAgICAgICB0bXAgPSBoMjY0YnNkRGVjb2RlRXhwR29sb21iVW5zaWduZWQocFN0cm1EYXRhLCAmY29tbWFuZCk7Ci0gICAgICAgICAgICBpZiAodG1wICE9IEhBTlRST19PSykKLSAgICAgICAgICAgICAgICByZXR1cm4odG1wKTsKLSAgICAgICAgICAgIGlmIChjb21tYW5kID4gMykKLSAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICBFUFJJTlQoInJlb3JkZXJpbmdfb2ZfcGljX251bXNfaWRjIik7Ci0gICAgICAgICAgICAgICAgcmV0dXJuKEhBTlRST19OT0spOwotICAgICAgICAgICAgfQotCi0gICAgICAgICAgICBwUmVmUGljTGlzdFJlb3JkZXJpbmctPmNvbW1hbmRbaV0ucmVvcmRlcmluZ09mUGljTnVtc0lkYyA9IGNvbW1hbmQ7Ci0KLSAgICAgICAgICAgIGlmICgoY29tbWFuZCA9PSAwKSB8fCAoY29tbWFuZCA9PSAxKSkKLSAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICB0bXAgPSBoMjY0YnNkRGVjb2RlRXhwR29sb21iVW5zaWduZWQocFN0cm1EYXRhLCAmdmFsdWUpOwotICAgICAgICAgICAgICAgIGlmICh0bXAgIT0gSEFOVFJPX09LKQotICAgICAgICAgICAgICAgICAgICByZXR1cm4odG1wKTsKLSAgICAgICAgICAgICAgICBpZiAodmFsdWUgPj0gbWF4UGljTnVtKQotICAgICAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAgICAgRVBSSU5UKCJhYnNfZGlmZl9waWNfbnVtX21pbnVzMSIpOwotICAgICAgICAgICAgICAgICAgICByZXR1cm4oSEFOVFJPX05PSyk7Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgIHBSZWZQaWNMaXN0UmVvcmRlcmluZy0+Y29tbWFuZFtpXS5hYnNEaWZmUGljTnVtID0gdmFsdWUgKyAxOwotICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgIGVsc2UgaWYgKGNvbW1hbmQgPT0gMikKLSAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICB0bXAgPSBoMjY0YnNkRGVjb2RlRXhwR29sb21iVW5zaWduZWQocFN0cm1EYXRhLCAmdmFsdWUpOwotICAgICAgICAgICAgICAgIGlmICh0bXAgIT0gSEFOVFJPX09LKQotICAgICAgICAgICAgICAgICAgICByZXR1cm4odG1wKTsKLSAgICAgICAgICAgICAgICBwUmVmUGljTGlzdFJlb3JkZXJpbmctPmNvbW1hbmRbaV0ubG9uZ1Rlcm1QaWNOdW0gPSB2YWx1ZTsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICBpKys7Ci0gICAgICAgIH0gd2hpbGUgKGNvbW1hbmQgIT0gMyk7Ci0KLSAgICAgICAgLyogdGhlcmUgc2hhbGwgYmUgYXQgbGVhc3Qgb25lIHJlb3JkZXJpbmcgY29tbWFuZCBpZgotICAgICAgICAgKiByZWZQaWNMaXN0UmVvcmRlcmluZ0ZsYWdMMCB3YXMgc2V0ICovCi0gICAgICAgIGlmIChpID09IDEpCi0gICAgICAgIHsKLSAgICAgICAgICAgIEVQUklOVCgicmVmX3BpY19saXN0X3Jlb3JkZXJpbmciKTsKLSAgICAgICAgICAgIHJldHVybihIQU5UUk9fTk9LKTsKLSAgICAgICAgfQotICAgIH0KLQotICAgIHJldHVybihIQU5UUk9fT0spOwotC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UZXJtUmVmZXJlbmNlRmxhZyA9IHRtcDsKLSAgICAgICAgaWYgKCFudW1SZWZGcmFtZXMgJiYgcERlY1JlZlBpY01hcmtpbmctPmxvbmdUZXJtUmVmZXJlbmNlRmxhZykKLSAgICAgICAgewotICAgICAgICAgICAgRVBSSU5UKCJsb25nX3Rlcm1fcmVmZXJlbmNlX2ZsYWciKTsKLSAgICAgICAgICAgIHJldHVybihIQU5UUk9fTk9LKTsKLSAgICAgICAgfQotICAgIH0KLSAgICBlbHNlCi0gICAgewotICAgICAgICB0bXAgPSBoMjY0YnNkR2V0Qml0cyhwU3RybURhdGEsIDEpOwotICAgICAgICBpZiAodG1wID09IEVORF9PRl9TVFJFQU0pCi0gICAgICAgICAgICByZXR1cm4oSEFOVFJPX05PSyk7Ci0gICAgICAgIHBEZWNSZWZQaWNNYXJraW5nLT5hZGFwdGl2ZVJlZlBpY01hcmtpbmdNb2RlRmxhZyA9IHRtcDsKLSAgICAgICAgaWYgKHBEZWNSZWZQaWNNYXJraW5nLT5hZGFwdGl2ZVJlZlBpY01hcmtpbmdNb2RlRmxhZykKLSAgICAgICAgewotICAgICAgICAgICAgaSA9IDA7Ci0gICAgICAgICAgICBkbwotICAgICAgICAgICAgewotICAgICAgICAgICAgICAgIC8qIHNlZSBleHBsYW5hdGlvbiBvZiB0aGUgTUFYX05VTV9NTUNfT1BFUkFUSU9OUyBpbgotICAgICAgICAgICAgICAgICAqIHNsaWNlX2hlYWRlci5oICovCi0gICAgICAgICAgICAgICAgaWYgKGkgPiAoMiAqIG51bVJlZkZyYW1lcyArIDIpKQotICAgICAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAgICAgRVBSSU5UKCJUb28gbWFueSBtYW5hZ2VtZW50IG9wZXJhdGlvbnMiKTsKLSAgICAgICAgICAgICAgICAgICAgcmV0dXJuKEhBTlRST19OT0spOwotICAgICAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgICAgIHRtcCA9IGgyNjRic2REZWNvZGVFeHBHb2xvbWJVbnNpZ25lZChwU3RybURhdGEsICZvcGVyYXRpb24pOwotICAgICAgICAgICAgICAgIGlmICh0bXAgIT0gSEFOVFJPX09LKQotICAgICAgICAgICAgICAgICAgICByZXR1cm4odG1wKTsKLSAgICAgICAgICAgICAgICBpZiAob3BlcmF0aW9uID4gNikKLSAgICAgICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgICAgIEVQUklOVCgibWVtb3J5X21hbmFnZW1lbnRfY29udHJvbF9vcGVyYXRpb24iKTsKLSAgICAgICAgICAgICAgICAgICAgcmV0dXJuKEhBTlRST19OT0spOwotICAgICAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgICAgIHBEZWNSZWZQaWNNYXJraW5nLT5vcGVyYXRpb25baV0uCi0gICAgICAgICAgICAgICAgICAgIG1lbW9yeU1hbmFnZW1lbnRDb250cm9sT3BlcmF0aW9uID0gb3BlcmF0aW9uOwotICAgICAgICAgICAgICAgIGlmICgob3BlcmF0aW9uID09IDEpIHx8IChvcGVyYXRpb24gPT0gMykpCi0gICAgICAgICAgICAgICAgewotICAgICAgICAgICAgICAgICAgICB0bXAgPSBoMjY0YnNkRGVjb2RlRXhwR29sb21iVW5zaWduZWQocFN0cm1EYXRhLCAmdmFsdWUpOwotICAgICAgICAgICAgICAgICAgICBpZiAodG1wICE9IEhBTlRST19PSykKLSAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybih0bXApOwotICAgICAgICAgICAgICAgICAgICBwRGVjUmVmUGljTWFya2luZy0+b3BlcmF0aW9uW2ldLmRpZmZlcmVuY2VPZlBpY051bXMgPQotICAgICAgICAgICAgICAgICAgICAgICAgdmFsdWUgKyAxOwotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICBpZiAob3BlcmF0aW9uID09IDIpCi0gICAgICAgICAgICAgICAgewotICAgICAgICAgICAgICAgICAgICB0bXAgPSBoMjY0YnNkRGVjb2RlRXhwR29sb21iVW5zaWduZWQocFN0cm1EYXRhLCAmdmFsdWUpOwotICAgICAgICAgICAgICAgICAgICBpZiAodG1wICE9IEhBTlRST19PSykKLSAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybih0bXApOwotICAgICAgICAgICAgICAgICAgICBwRGVjUmVmUGljTWFya2luZy0+b3BlcmF0aW9uW2ldLmxvbmdUZXJtUGljTnVtID0gdmFsdWU7Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgIGlmICgob3BlcmF0aW9uID09IDMpIHx8IChvcGVyYXRpb24gPT0gNikpCi0gICAgICAgICAgICAgICAgewotICAgICAgICAgICAgICAgICAgICB0bXAgPSBoMjY0YnNkRGVjb2RlRXhwR29sb21iVW5zaWduZWQocFN0cm1EYXRhLCAmdmFsdWUpOwotICAgICAgICAgICAgICAgICAgICBpZiAodG1wICE9IEhBTlRST19PSykKLSAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybih0bXApOwotICAgICAgICAgICAgICAgICAgICBwRGVjUmVmUGljTWFya2luZy0+b3BlcmF0aW9uW2ldLmxvbmdUZXJtRnJhbWVJZHggPQotICAgICAgICAgICAgICAgICAgICAgICAgdmFsdWU7Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgIGlmIChvcGVyYXRpb24gPT0gNCkKLSAgICAgICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgICAgIHRtcCA9IGgyNjRic2REZWNvZGVFeHBHb2xvbWJVbnNpZ25lZChwU3RybURhdGEsICZ2YWx1ZSk7Ci0gICAgICAgICAgICAgICAgICAgIGlmICh0bXAgIT0gSEFOVFJPX09LKQotICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuKHRtcCk7Ci0gICAgICAgICAgICAgICAgICAgIC8qIHZhbHVlIHNoYWxsIGJlIGluIHJhbmdlIFswLCBudW1SZWZGcmFtZXNdICovCi0gICAgICAgICAgICAgICAgICAgIGlmICh2YWx1ZSA+IG51bVJlZkZyYW1lcykKLSAgICAgICAgICAgICAgICAgICAgewotICAgICAgICAgICAgICAgICAgICAgICAgRVBSSU5UKCJtYXhfbG9uZ190ZXJtX2ZyYW1lX2lkeF9wbHVzMSIpOwotICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuKEhBTlRST19OT0spOwotICAgICAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgICAgIGlmICh2YWx1ZSA9PSAwKQotICAgICAgICAgICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgICAgICAgICBwRGVjUmVmUGljTWFya2luZy0+b3BlcmF0aW9uW2ldLgotICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1heExvbmdUZXJtRnJhbWVJZHggPQotICAgICAgICAgICAgICAgICAgICAgICAgICAgIE5PX0xPTkdfVEVSTV9GUkFNRV9JTkRJQ0VTOwotICAgICAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgICAgIGVsc2UKLSAgICAgICAgICAgICAgICAgICAgewotICAgICAgICAgICAgICAgICAgICAgICAgcERlY1JlZlBpY01hcmtpbmctPm9wZXJhdGlvbltpXS4KLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBtYXhMb25nVGVybUZyYW1lSWR4ID0gdmFsdWUgLSAxOwotICAgICAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgICAgIG51bTQrKzsKLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgaWYgKG9wZXJhdGlvbiA9PSA1KQotICAgICAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAgICAgbnVtNSsrOwotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICBpZiAob3BlcmF0aW9uICYmIG9wZXJhdGlvbiA8PSAzKQotICAgICAgICAgICAgICAgICAgICBudW0xdG8zKys7Ci0gICAgICAgICAgICAgICAgaWYgKG9wZXJhdGlvbiA9PSA2KQotICAgICAgICAgICAgICAgICAgICBudW02Kys7Ci0KLSAgICAgICAgICAgICAgICBpKys7Ci0gICAgICAgICAgICB9IHdoaWxlIChvcGVyYXR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DbnRCb3R0b20pOwotICAgIGlmICh0bXAgIT0gSEFOVFJPX09LKQotICAgICAgICByZXR1cm4odG1wKTsKLQotICAgIHJldHVybihIQU5UUk9fT0spOwotCi19Ci0KLS8qLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tCi0KLSAgICBGdW5jdGlvbjogaDI2NGJzZENoZWNrRGVsdGFQaWNPcmRlckNudAotCi0gICAgICAgIEZ1bmN0aW9uYWwgZGVzY3JpcHRpb246Ci0gICAgICAgICAgICBQZWVrIHZhbHVlcyBkZWx0YV9waWNfb3JkZXJfY250WzBdIGFuZCBkZWx0YV9waWNfb3JkZXJfY250WzFdCi0gICAgICAgICAgICBmcm9tIHRoZSBzbGljZSBoZWFkZXIuIEZ1bmN0aW9uIGRvZXMgbm90IG1vZGlmeSBjdXJyZW50IHN0cmVhbQotICAgICAgICAgICAgcG9zaXRpb25zIGJ1dCBjb3BpZXMgdGhlIHN0cmVhbSBkYXRhIHN0cnVjdHVyZSB0byB0bXAgc3RydWN0dXJlCi0gICAgICAgICAgICB3aGljaCBpcyB1c2VkIHdoaWxlIGFjY2Vzc2luZyBzdHJlYW0gZGF0YS4KLQotICAgICAgICBJbnB1dHM6Ci0gICAgICAgICAgICBwU3RybURhdGEgICAgICAgICAgICAgICBwb2ludGVyIHRvIHN0cmVhbSBkYXRhIHN0cnVjdHVyZQotICAgICAgICAgICAgcFNlcVBhcmFtU2V0ICAgICAgICAgICAgcG9pbnRlciB0byBhY3RpdmUgU1BTCi0gICAgICAgICAgICBuYWxVbml0VHlwZSAgICAgICAgICAgICB0eXBlIG9mIHRoZSBjdXJyZW50IE5BTCB1bml0Ci0gICAgICAgICAgICBwaWNPcmRlclByZXNlbnRGbGFnICAgICBmbGFnIGluZGljYXRpbmcgaWYgZGVsdGFfcGljX29yZGVyX2NudFsxXQotICAgICAgICAgICAgICA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aWYgKHBTZXFQYXJhbVNldC0+cGljT3JkZXJDbnRUeXBlID09IDApCi0gICAgewotICAgICAgICAvKiBsb2cyKG1heFBpY09yZGVyQ250THNiKSAtPiBudW0gYml0cyB0byByZXByZXNlbnQgcGljX29yZGVyX2NudF9sc2IgKi8KLSAgICAgICAgaSA9IDA7Ci0gICAgICAgIHdoaWxlIChwU2VxUGFyYW1TZXQtPm1heFBpY09yZGVyQ250THNiID4+IGkpCi0gICAgICAgICAgICBpKys7Ci0gICAgICAgIGktLTsKLQotICAgICAgICAvKiBwaWNfb3JkZXJfY250X2xzYiAqLwotICAgICAgICB0bXAgPSBoMjY0YnNkR2V0Qml0cyh0bXBTdHJtRGF0YSwgaSk7Ci0gICAgICAgIGlmICh0bXAgPT0gRU5EX09GX1NUUkVBTSkKLSAgICAgICAgICAgIHJldHVybihIQU5UUk9fTk9LKTsKLQotICAgICAgICBpZiAocFBpY1BhcmFtU2V0LT5waWNPcmRlclByZXNlbnRGbGFnKQotICAgICAgICB7Ci0gICAgICAgICAgICAvKiBza2lwIGRlbHRhX3BpY19vcmRlcl9jbnRfYm90dG9tICovCi0gICAgICAgICAgICB0bXAgPSBoMjY0YnNkRGVjb2RlRXhwR29sb21iU2lnbmVkKHRtcFN0cm1EYXRhLCAmaXZhbHVlKTsKLSAgICAgICAgICAgIGlmICh0bXAgIT0gSEFOVFJPX09LKQotICAgICAgICAgICAgICAgIHJldHVybih0bXApOwotICAgICAgICB9Ci0gICAgfQotCi0gICAgaWYgKHBTZXFQYXJhbVNldC0+cGljT3JkZXJDbnRUeXBlID09IDEgJiYKLSAgICAgICFwU2VxUGFyYW1TZXQtPmRlbHRhUGljT3JkZXJBbHdheXNaZXJvRmxhZykKLSAgICB7Ci0gICAgICAgIC8qIGRlbHRhX3BpY19vcmRlcl9jbnRbMF0gKi8KLSAgICAgICAgdG1wID0gaDI2NGJzZERlY29kZUV4cEdvbG9tYlNpZ25lZCh0bXBTdHJtRGF0YSwgJml2YWx1ZSk7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ci0KLSAgICAvKiBza2lwIHBpY19wYXJhbWV0ZXJfc2V0X2lkICovCi0gICAgdG1wID0gaDI2NGJzZERlY29kZUV4cEdvbG9tYlVuc2lnbmVkKHRtcFN0cm1EYXRhLCAmdmFsdWUpOwotICAgIGlmKHRtcCAhPSBIQU5UUk9fT0spCi0gICAgICAgIHJldHVybiAodG1wKTsKLQotICAgIC8qIGxvZzIobWF4RnJhbWVOdW0pIC0+IG51bSBiaXRzIHRvIHJlcHJlc2VudCBmcmFtZV9udW0gKi8KLSAgICBpID0gMDsKLSAgICB3aGlsZShwU2VxUGFyYW1TZXQtPm1heEZyYW1lTnVtID4+IGkpCi0gICAgICAgIGkrKzsKLSAgICBpLS07Ci0KLSAgICAvKiBza2lwIGZyYW1lX251bSAqLwotICAgIHRtcCA9IGgyNjRic2RHZXRCaXRzKHRtcFN0cm1EYXRhLCBpKTsKLSAgICBpZih0bXAgPT0gRU5EX09GX1NUUkVBTSkKLSAgICAgICAgcmV0dXJuIChIQU5UUk9fTk9LKTsKLQotICAgIC8qIHNraXAgaWRyX3BpY19pZCAqLwotICAgIHRtcCA9IGgyNjRic2REZWNvZGVFeHBHb2xvbWJVbnNpZ25lZCh0bXBTdHJtRGF0YSwgJnZhbHVlKTsKLSAgICBpZih0bXAgIT0gSEFOVFJPX09LKQotICAgICAgICByZXR1cm4gKHRtcCk7Ci0KLSAgICBpZihwU2VxUGFyYW1TZXQtPnBpY09yZGVyQ250VHlwZSA9PSAwKQotICAgIHsKLSAgICAgICAgLyogbG9nMihtYXhQaWNPcmRlckNudExzYikgLT4gbnVtIGJpdHMgdG8gcmVwcmVzZW50IHBpY19vcmRlcl9jbnRfbHNiICovCi0gICAgICAgIGkgPSAwOwotICAgICAgICB3aGlsZShwU2VxUGFyYW1TZXQtPm1heFBpY09yZGVyQ250THNiID4+IGkpCi0gICAgICAgICAgICBpKys7Ci0gICAgICAgIGktLTsKLQotICAgICAgICAvKiBza2lwIHBpY19vcmRlcl9jbnRfbHNiICovCi0gICAgICAgIHRtcCA9IGgyNjRic2RHZXRCaXRzKHRtcFN0cm1EYXRhLCBpKTsKLSAgICAgICAgaWYodG1wID09IEVORF9PRl9TVFJFQU0pCi0gICAgICAgICAgICByZXR1cm4gKEhBTlRST19OT0spOwotCi0gICAgICAgIGlmKHBQaWNQYXJhbVNldC0+cGljT3JkZXJQcmVzZW50RmxhZykKLSAgICAgICAgewotICAgICAgICAgICAgLyogc2tpcCBkZWx0YV9waWNfb3JkZXJfY250X2JvdHRvbSAqLwotICAgICAgICAgICAgdG1wID0gaDI2NGJzZERlY29kZUV4cEdvbG9tYlNpZ25lZCh0bXBTdHJtRGF0YSwgJml2YWx1ZSk7Ci0gICAgICAgICAgICBpZih0bXAgIT0gSEFOVFJPX09LKQotICAgICAgICAgICAgICAgIHJldHVybiAodG1wKTsKLSAgICAgICAgfQotICAgIH0KLQotICAgIGlmKHBTZXFQYXJhbVNldC0+cGljT3JkZXJDbnRUeXBlID09IDEgJiYKLSAgICAgICAhcFNlcVBhcmFtU2V0LT5kZWx0YVBpY09yZGVyQWx3YXlzWmVyb0ZsYWcpCi0gICAgewotICAgICAgICAvKiBza2lwIGRlbHRhX3BpY19vcmRlcl9jbnRbMF0gKi8KLSAgICAgICAgdG1wID0gaDI2NGJzZERlY29kZUV4cEdvbG9tYlNpZ25lZCh0bXBTdHJtRGF0YSwgJml2YWx1ZSk7Ci0gICAgICAgIGlmKHRtcCAhPSBIQU5UUk9fT0spCi0gICAgICAgICAgICByZXR1cm4gKHRtcCk7Ci0KLSAgICAgICAgLyogc2tpcCBkZWx0YV9waWNfb3JkZXJfY250WzFdIGlmIHByZXNlbnQgKi8KLSAgICAgICAgaWYocFBpY1BhcmFtU2V0LT5waWNPcmRlclByZXNlbnRGbGFnKQotICAgICAgICB7Ci0gICAgICAgICAgICB0bXAgPSBoMjY0YnNkRGVjb2RlRXhwR29sb21iU2lnbmVkKHRtcFN0cm1EYXRhLCAmaXZhbHVlKTsKLSAgICAgICAgICAgIGl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5pdEJvdW5kYXJ5RmxhZyA9IEhBTlRST19UUlVFOwotCi0gICAgICAgIHN0b3JhZ2UtPmF1Yi0+cHJldklkclBpY0lkID0gaWRyUGljSWQ7Ci0gICAgfQotCi0gICAgaWYgKHNwcy0+cGljT3JkZXJDbnRUeXBlID09IDApCi0gICAgewotICAgICAgICB0bXAgPSBoMjY0YnNkQ2hlY2tQaWNPcmRlckNudExzYihzdHJtLCBzcHMsIG51TmV4dC0+bmFsVW5pdFR5cGUsCi0gICAgICAgICAgJnBpY09yZGVyQ250THNiKTsKLSAgICAgICAgaWYgKHRtcCAhPSBIQU5UUk9fT0spCi0gICAgICAgICAgICByZXR1cm4oSEFOVFJPX05PSyk7Ci0KLSAgICAgICAgaWYgKHN0b3JhZ2UtPmF1Yi0+cHJldlBpY09yZGVyQ250THNiICE9IHBpY09yZGVyQ250THNiKQotICAgICAgICB7Ci0gICAgICAgICAgICBzdG9yYWdlLT5hdWItPnByZXZQaWNPcmRlckNudExzYiA9IHBpY09yZGVyQ250THNiOwotICAgICAgICAgICAgKmFjY2Vzc1VuaXRCb3VuZGFyeUZsYWcgPSBIQU5UUk9fVFJVRTsKLSAgICAgICAgfQotCi0gICAgICAgIGlmIChwcHMtPnBpY09yZGVyUHJlc2VudEZsYWcpCi0gICAgICAgIHsKLSAgICAgICAgICAgIHRtcCA9IGgyNjRic2RDaGVja0RlbHRhUGljT3JkZXJDbnRCb3R0b20oc3RybSwgc3BzLAotICAgICAgICAgICAgICAgIG51TmV4dC0+bmFsVW5pdFR5cGUsICZkZWx0YVBpY09yZGVyQ250Qm90dG9tKTsKLSAgICAgICAgICAgIGlmICh0bXAgIT0gSEFOVFJPX09LKQotICAgICAgICAgICAgICAgIHJldHVybih0bXApOwotCi0gICAgICAgICAgICBpZiAoc3RvcmFnZS0+YXViLT5wcmV2RGVsdGFQaWNPcmRlckNudEJvdHRvbSAhPQotICAgICAgICAgICAgICAgIGRlbHRhUGljT3JkZXJDbnRCb3R0b20pCi0gICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgc3RvcmFnZS0+YXViLT5wcmV2RGVsdGFQaWNPcmRlckNudEJvdHRvbSA9Ci0gICAgICAgICAgICAgICAgICAgIGRlbHRhUGljT3JkZXJDbnRCb3R0b207Ci0gICAgICAgICAgICAgICAgKmFjY2Vzc1VuaXRCb3VuZGFyeUZsYWcgPSBIQU5UUk9fVFJVRTsKLSAgICAgICAgICAgIH0KLSAgICAgICAgfQotICAgIH0KLSAgICBlbHNlIGlmIChzcHMtPnBpY09yZGVyQ250VHlwZSA9PSAxICYmICFzcHMtPmRlbHRhUGljT3JkZXJBbHdheXNaZXJvRmxhZykKLSAgICB7Ci0gICAgICAgIHRtcCA9IGgyNjRic2RDaGVja0RlbHRhUGljT3JkZXJDbnQoc3RybSwgc3BzLCBudU5leHQtPm5hbFVuaXRUeXBlLAotICAgICAgICAgIHBwcy0+cGljT3JkZXJQcmVzZW50RmxhZywgZGVsdGFQaWNPcmRlckNudCk7Ci0gICAgICAgIGlmICh0bXAgIT0gSEFOVFJPX09LKQotICAgICAgICAgICAgcmV0dXJuKHRtcCk7Ci0KLSAgICAgICAgaWYgKHN0b3JhZ2UtPmF1Yi0+cHJldkRlbHRhUGljT3JkZXJDbnRbMF0gIT0gZGVsdGFQaWNPcmRlckNudFswXSkKLSAgICAgICAgewotICAgICAgICAgICAgc3RvcmFnZS0+YXViLT5wcmV2RGVsdGFQaWNPcmRlckNudFswXSA9IGRlbHRhUGljT3JkZXJDbnRbMF07Ci0gICAgICAgICAgICAqYWNjZXNzVW5pdEJvdW5kYXJ5RmxhZyA9IEhBTlRST19UUlVFOwotICAgICAgICB9Ci0KLSAgICAgICAgaWYgKHBwcy0+cGljT3JkZXJQcmVzZW50RmxhZykKLSAgICAgICAgICAgIGlmIChzdG9yYWdlLT5hdWItPnByZXZEZWx0YVBpY09yZGVyQ250WzFdICE9IGRlbHRhUGljT3JkZXJDbnRbMV0pCi0gICAgICAgICAgICB7Ci0gICAgICAgICAgIC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BwaWN0dXJlIHBhcmFtZXRlciBzZXQKLQotLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tKi8KLXUzMiBDaGVja1BwcyhwaWNQYXJhbVNldF90ICpwcHMsIHNlcVBhcmFtU2V0X3QgKnNwcykKLXsKLQotICAgIHUzMiBpOwotICAgIHUzMiBwaWNTaXplOwotCi0gICAgcGljU2l6ZSA9IHNwcy0+cGljV2lkdGhJbk1icyAqIHNwcy0+cGljSGVpZ2h0SW5NYnM7Ci0KLSAgICAvKiBjaGVjayBzbGljZSBncm91cCBwYXJhbXMgKi8KLSAgICBpZiAocHBzLT5udW1TbGljZUdyb3VwcyA+IDEpCi0gICAgewotICAgICAgICBpZiAocHBzLT5zbGljZUdyb3VwTWFwVHlwZSA9PSAwKQotICAgICAgICB7Ci0gICAgICAgICAgICBBU1NFUlQocHBzLT5ydW5MZW5ndGgpOwotICAgICAgICAgICAgZm9yIChpID0gMDsgaSA8IHBwcy0+bnVtU2xpY2VHcm91cHM7IGkrKykKLSAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICBpZiAocHBzLT5ydW5MZW5ndGhbaV0gPiBwaWNTaXplKQotICAgICAgICAgICAgICAgICAgICByZXR1cm4oSEFOVFJPX05PSyk7Ci0gICAgICAgICAgICB9Ci0gICAgICAgIH0KLSAgICAgICAgZWxzZSBpZiAocHBzLT5zbGljZUdyb3VwTWFwVHlwZSA9PSAyKQotICAgICAgICB7Ci0gICAgICAgICAgICBBU1NFUlQocHBzLT50b3BMZWZ0KTsKLSAgICAgICAgICAgIEFTU0VSVChwcHMtPmJvdHRvbVJpZ2h0KTsKLSAgICAgICAgICAgIGZvciAoaSA9IDA7IGkgPCBwcHMtPm51bVNsaWNlR3JvdXBzLTE7IGkrKykKLSAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICBpZiAocHBzLT50b3BMZWZ0W2ldID4gcHBzLT5ib3R0b21SaWdodFtpXSB8fAotICAgICAgICAgICAgICAgICAgICBwcHMtPmJvdHRvbVJpZ2h0W2ldID49IHBpY1NpemUpCi0gICAgICAgICAgICAgICAgICAgIHJldHVybihIQU5UUk9fTk9LKTsKLQotICAgICAgICAgICAgICAgIGlmICggKHBwcy0+dG9wTGVmdFtpXSAlIHNwcy0+cGljV2lkdGhJbk1icykgPgotICAgICAgICAgICAgICAgICAgICAgKHBwcy0+Ym90dG9tUmlnaHRbaV0gJSBzcHMtPnBpY1dpZHRoSW5NYnMpICkKLSAgICAgICAgICAgICAgICAgICAgcmV0dXJuKEhBTlRST19OT0spOwotICAgICAgICAgICAgfQotICAgICAgICB9Ci0gICAgICAgIGVsc2UgaWYgKHBwcy0+c2xpY2VHcm91cE1hcFR5cGUgPiAyICYmIHBwcy0+c2xpY2VHcm91cE1hcFR5cGUgPCA2KQotICAgICAgICB7Ci0gICAgICAgICAgICBpZiAocHBzLT5zbGljZUdyb3VwQ2hhbmdlUmF0ZSA+IHBpY1NpemUpCi0gICAgICAgICAgICAgICAgcmV0dXJuKEhBTlRST19OT0spOwotICAgICAgICB9Ci0gICAgICAgIGVsc2UgaWYgKHBwcy0+c2xpY2VHcm91cE1hcFR5cGUgPT0gNiAmJgotICAgICAgICAgICAgICAgICBwcHMtPnBpY1NpemVJbk1hcFVuaXRzIDwgcGljU2l6ZSkKLSAgICAgICAgICAgIHJldHVybihIQU5UUk9fTk9LKTsKLSAgICB9Ci0KLSAgICByZXR1cm4oSEFOVFJPX09LKTsKLX0KLQotLyotLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0KLQotICAgIEZ1bmN0aW9uOiBoMjY0YnNkVmFsaWRQYXJhbVNldHMKLQotICAgICAgICBGdW5jdGlvbmFsIGRlc2NyaXB0aW9uOgotICAgICAgICAgICAg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jY0YnNkUHJvY2Vzc0Jsb2NrCi0KLSAgICAgICAgRnVuY3Rpb25hbCBkZXNjcmlwdGlvbjoKLSAgICAgICAgICAgIEZ1bmN0aW9uIHBlcmZvcm1zIGludmVyc2UgemlnLXphZyBzY2FuLCBpbnZlcnNlIHNjYWxpbmcgYW5kCi0gICAgICAgICAgICBpbnZlcnNlIHRyYW5zZm9ybSBmb3IgYSBsdW1hIG9yIGEgY2hyb21hIHJlc2lkdWFsIGJsb2NrCi0KLSAgICAgICAgSW5wdXRzOgotICAgICAgICAgICAgZGF0YSAgICAgICAgICAgIHBvaW50ZXIgdG8gZGF0YSB0byBiZSBwcm9jZXNzZWQKLSAgICAgICAgICAgIHFwICAgICAgICAgICAgICBxdWFudGl6YXRpb24gcGFyYW1ldGVyCi0gICAgICAgICAgICBza2lwICAgICAgICAgICAgc2tpcCBwcm9jZXNzaW5nIG9mIGRhdGFbMF0sIHNldCB0byBub24temVybyB2YWx1ZQotICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIGRjIGNvZWZmIGhhbmxlZCBzZXBhcmF0ZWx5Ci0gICAgICAgICAgICBjb2VmZk1hcCAgICAgICAgMTYgbHNiJ3MgaW5kaWNhdGUgd2hpY2ggY29lZmZzIGFyZSBub24temVybywKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBiaXQgMCAobHNiKSBmb3IgY29lZmYgMCwgYml0IDEgZm9yIGNvZWZmIDEgZXRjLgotCi0gICAgICAgIE91dHB1dHM6Ci0gICAgICAgICAgICBkYXRhICAgICAgICAgICAgcHJvY2Vzc2VkIGRhdGEKLQotICAgICAgICBSZXR1cm5zOgotICAgICAgICAgICAgSEFOVFJPX09LICAgICAgIHN1Y2Nlc3MKLSAgICAgICAgICAgIEhBTlRST19OT0sgICAgICBwcm9jZXNzZWQgZGF0YSBub3QgaW4gdmFsaWQgcmFuZ2UgWy01MTIsIDUxMV0KLQotLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tL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dG1wMik7Ci0gICAgICAgIGRhdGFbMTVdID0gKGQzICogdG1wMyk7Ci0KLSAgICAgICAgZDEgPSBkYXRhWzJdOwotICAgICAgICBkMiA9IGRhdGFbNV07Ci0gICAgICAgIGQzID0gZGF0YVs0XTsKLSAgICAgICAgZGF0YVs0XSA9IChkMSAqIHRtcDIpOwotICAgICAgICBkYXRhWzJdICA9IChkMiAqIHRtcDEpOwotICAgICAgICBkYXRhWzVdID0gKGQzICogdG1wMyk7Ci0KLSAgICAgICAgZDEgPSBkYXRhWzhdOwotICAgICAgICBkMiA9IGRhdGFbM107Ci0gICAgICAgIGQzID0gZGF0YVs2XTsKLSAgICAgICAgdG1wMCA9IChkMSAqIHRtcDIpOwotICAgICAgICBkYXRhWzhdID0gKGQyICogdG1wMSk7Ci0gICAgICAgIGRhdGFbM10gID0gKGQzICogdG1wMik7Ci0gICAgICAgIGQxID0gZGF0YVs3XTsKLSAgICAgICAgZDIgPSBkYXRhWzEyXTsKLSAgICAgICAgZDMgPSBkYXRhWzldOwotICAgICAgICBkYXRhWzZdICA9IChkMSAqIHRtcDIpOwotICAgICAgICBkYXRhWzddICA9IChkMiAqIHRtcDMpOwotICAgICAgICBkYXRhWzEyXSA9IChkMyAqIHRtcDIpOwotICAgICAgICBkYXRhWzldICA9IHRtcDA7Ci0KLSAgICAgICAgZDEgPSBkYXRhWzEwXTsKLSAgICAgICAgZDIgPSBkYXRhWzExXTsKLSAgICAgICAgZDMgPSBkYXRhWzEzXTsKLSAgICAgICAgZGF0YVsxM10gPSAoZDEgKiB0bXAzKTsKLSAgICAgICAgZGF0YVsxMF0gPSAoZDIgKiB0bXAxKTsKLSAgICAgICAgZGF0YVsxMV0gPSAoZDMgKiB0bXAyKTsKLQotICAgICAgICAvKiBob3Jpem9udGFsIHRyYW5zZm9ybSAqLwotICAgICAgICBmb3IgKHJvdyA9IDQsIHB0ciA9IGRhdGE7IHJvdy0tOyBwdHIgKz0gNCkKLSAgICAgICAgewotICAgICAgICAgICAg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sNTExXSAqLwotICAgICAgICAgICAgaWYgKCgodTMyKShkYXRhWzBdICsgNTEyKSA+IDEwMjMpIHx8Ci0gICAgICAgICAgICAgICAgKCh1MzIpKGRhdGFbNF0gKyA1MTIpID4gMTAyMykgfHwKLSAgICAgICAgICAgICAgICAoKHUzMikoZGF0YVs4XSArIDUxMikgPiAxMDIzKSB8fAotICAgICAgICAgICAgICAgICgodTMyKShkYXRhWzEyXSArIDUxMikgPiAxMDIzKSApCi0gICAgICAgICAgICAgICAgcmV0dXJuKEhBTlRST19OT0spOwotICAgICAgICB9Ci0gICAgfQotICAgIGVsc2UgLyogcm93cyAxLCAyIGFuZCAzIGFyZSB6ZXJvICovCi0gICAgewotICAgICAgICAvKiBvbmx5IGRjLWNvZWZmIGlzIG5vbi16ZXJvLCBpLmUuIGNvZWZmcyBhdCBvcmlnaW5hbCBwb3NpdGlvbnMKLSAgICAgICAgICogMSwgNSBhbmQgNiBhcmUgemVybyAqLwotICAgICAgICBpZiAoKGNvZWZmTWFwICYgMHg2MikgPT0gMCkKLSAgICAgICAgewotICAgICAgICAgICAgdG1wMCA9IChkYXRhWzBdICsgMzIpID4+IDY7Ci0gICAgICAgICAgICAvKiBjaGVjayB0aGF0IHZhbHVlIGlzIGluIHRoZSByYW5nZSBbLTUxMiw1MTFdICovCi0gICAgICAgICAgICBpZiAoKHUzMikodG1wMCArIDUxMikgPiAxMDIzKQotICAgICAgICAgICAgICAgIHJldHVybihIQU5UUk9fTk9LKTsKLSAgICAgICAgICAgIGRhdGFbMF0gPSBkYXRhWzFdICA9IGRhdGFbMl0gID0gZGF0YVszXSAgPSBkYXRhWzRdICA9IGRhdGFbNV0gID0KLSAgICAgICAgICAgICAgICAgICAgICBkYXRhWzZdICA9IGRhdGFbN10gID0gZGF0YVs4XSAgPSBkYXRhWzldICA9IGRhdGFbMTBdID0KLSAgICAgICAgICAgICAgICAgICAgICBkYXRhWzExXSA9IGRhdGFbMTJdID0gZGF0YVsxM10gPSBkYXRhWzE0XSA9IGRhdGFbMTVdID0KLSAgICAgICAgICAgICAgICAgICAgICB0bXAwOwotICAgICAgICB9Ci0gICAgICAgIGVsc2UgLyogYXQgbGVhc3Qgb25lIG9mIHRoZSBjb2VmZnMgMSwgNSBvciA2IGlzIG5vbi16ZXJvICovCi0gICAgICAgIHsKLSAgICAgICAgICAgIGRhdGFbMV0gPSAoZGF0YVsxXSAqIHRtcDIpOwotICAgICAgICAgICAgZGF0YVsyXSA9IChkYXRhWzVdICogdG1wMSk7Ci0gICAgICAgICAgICBkYXRhWzNdID0gKGRhdGFbNl0gKiB0bXAyKTsKLSAgICAgICAgICAgIHRtcDAgPSBkYXRhWzBdICsgZGF0YVsyXTsKLSAgICAgICAgICAgIHRtcDEgPSBkYXRhWzBdIC0gZGF0YVsyXTsKLSAgICAgICAgICAgIHRtcDIgPSAoZGF0YVsxXSA+PiAxKSAtIGRhdGFbM107Ci0gICAgICAgICAgICB0bXAzID0gZGF0YVsxXSArIChkYXRhWzNdID4+IDEpOwotICAgICAgICAgICAgZGF0YVswXSA9ICh0bXAwICsgdG1wMyArIDMyKT4+NjsKLSAgICAgICAgICAgIGRhdGFbMV0gPSAodG1wMSArIHRtcDIgKyAzMik+PjY7Ci0gICAgICAgICAgICBkYXRhWzJdID0gKHRtcDEgLSB0bXAyICsgMzIpPj42OwotICAgICAgICAgICAgZGF0YVszXSA9ICh0bXAwIC0gdG1wMyArIDMyKT4+NjsKLSAgICAgICAgICAgIGRhdGFbNF0gPSBkYXRhWzhdID0gZGF0YVsxMl0gPSBkYXRhWzBdOwotICAgICAgICAgICAgZGF0YVs1XSA9IGRhdGFbOV0gPSBkYXRhWzEzXSA9IGRhdGFbMV07Ci0gICAgICAgICAgICBkYXRhWzZdID0gZGF0YVsxMF0gPSBkYXRhWzE0XSA9IGRhdGFbMl07Ci0gICAgICAgICAgICBkYXRhWzddID0gZGF0YVsxMV0gPSBkYXRhWzE1XSA9IGRhdGFbM107Ci0gICAgICAgICAgICAvKiBjaGVjayB0aGF0IGVhY2ggdmFsdWUgaXMgaW4gdGhlIHJhbmdlIFstNTEyLDUxMV0gKi8KLSAgICAgICAgICAgIGlmICgoKHUzMikoZGF0YVswXSArIDUxMikgPiAxMDIzKSB8fAotICAgICAgICAgICAgICAgICgodTMyKShkYXRhWzFdICsgNTEyKSA+IDEwMjMpIHx8Ci0gICAgICAgICAgICAgICAgKCh1MzIpKGRhdGFbMl0gKyA1MTIpID4gMTAyMykgfHwKLSAgICAgICAgICAgICAgICAoKHUzMikoZGF0YVszXSArIDUxMikgPiAxMDIzKSApCi0gICAgICAgICAgICAgICAgcmV0dXJuKEhBTlRST19OT0spOwotICAgICAgICB9Ci0gICAgfQotCi0gICAgcmV0dXJuKEhBTlRST19PSyk7Ci0KLX0KLQotLyotLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0KLQotICAgIEZ1bmN0aW9uOiBoMjY0YnNkUHJvY2Vzc0x1bWFEYwotCi0gICAgICAgIEZ1bmN0aW9uYWwgZGVzY3JpcHRpb246Ci0gICAgICAgICAgICBGdW5jdGlvbiBwZXJmb3JtcyBpbnZlcnNlIHppZy16YWcgc2NhbiwgaW52ZXJzZSB0cmFuc2Zvcm0gYW5kCi0gICAgICAgICAgICBpbnZlcnNlIHNjYWxpbmcgZm9yIGEgbHVtYSBEQyBjb2VmZmljaWVudHMgYmxvY2sKLQotICAgICAgICBJbnB1dHM6Ci0gICAgICAgICAgICBkYXRhICAgICAgICAgICAgcG9pbnRlciB0byBkYXRhIHRvIGJlIHByb2Nlc3NlZAotICAgICAgICAgICAgcXAgICAgICAgICAgICAgIHF1YW50aXphdGlvbiBwYXJhbWV0ZXIKLQotICAgICAgICBPdXRwdXRzOgotICAgICAgICAgICAgZGF0YSAgICAgICAgICAgIHByb2Nlc3NlZCBkYXRhCi0KLSAgICAgICAgUmV0dXJuczoKLSAgICA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AgbnVtWmVyb3MgPSBoMjY0YnNkQ291bnRMZWFkaW5nWmVyb3MoYml0cyk7Ci0jZW5kaWYKLSAgICAgICAgLyogYWxsIDMyIGJpdHMgYXJlIHplcm8gKi8KLSAgICAgICAgaWYgKG51bVplcm9zID09IDMyKQotICAgICAgICB7Ci0gICAgICAgICAgICAqY29kZU51bSA9IDA7Ci0gICAgICAgICAgICBoMjY0YnNkRmx1c2hCaXRzKHBTdHJtRGF0YSwzMik7Ci0gICAgICAgICAgICBiaXRzID0gaDI2NGJzZEdldEJpdHMocFN0cm1EYXRhLCAxKTsKLSAgICAgICAgICAgIC8qIGNoZWNrIDMzcmQgYml0LCBtdXN0IGJlIDEgKi8KLSAgICAgICAgICAgIGlmIChiaXRzID09IDEpCi0gICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgLyogY2Fubm90IHVzZSBoMjY0YnNkR2V0Qml0cywgbGltaXRlZCB0byAzMSBiaXRzICovCi0gICAgICAgICAgICAgICAgYml0cyA9IGgyNjRic2RTaG93Qml0czMyKHBTdHJtRGF0YSk7Ci0gICAgICAgICAgICAgICAgaWYgKGgyNjRic2RGbHVzaEJpdHMocFN0cm1EYXRhLCAzMikgPT0gRU5EX09GX1NUUkVBTSkKLSAgICAgICAgICAgICAgICAgICAgcmV0dXJuKEhBTlRST19OT0spOwotICAgICAgICAgICAgICAgIC8qIGNvZGUgbnVtIDJeMzIgLSAxLCBuZWVkZWQgZm9yIHVuc2lnbmVkIG1hcHBpbmcgKi8KLSAgICAgICAgICAgICAgICBpZiAoYml0cyA9PSAwKQotICAgICAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAgICAgKmNvZGVOdW0gPSBCSUdfQ09ERV9OVU07Ci0gICAgICAgICAgICAgICAgICAgIHJldHVybihIQU5UUk9fT0spOwotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICAvKiBjb2RlIG51bSAyXjMyLCBuZWVkZWQgZm9yIHVuc2lnbmVkIG1hcHBpbmcKLSAgICAgICAgICAgICAgICAgKiAocmVzdWx0cyBpbiAtMl4zMSkgKi8KLSAgICAgICAgICAgICAgICBlbHNlIGlmIChiaXRzID09IDEpCi0gICAgICAgICAgICAgICAgewotICAgICAgICAgICAgICAgICAgICAqY29kZU51bSA9IEJJR19DT0RFX05VTTsKLSAgICAgICAgICAgICAgICAgICAgcmV0dXJuKEhBTlRST19OT0spOwotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgIH0KLSAgICAgICAgICAgIC8qIGlmIG1vcmUgemVyb3MgdGhhbiAzMiwgaXQgaXMgYW4gZXJyb3IgKi8KLSAgICAgICAgICAgIHJldHVybihIQU5UUk9fTk9LKTsKLSAgICAgICAgfQotICAgICAgICBlbHNlCi0gICAgICAgICAgICBoMjY0YnNkRmx1c2hCaXRzKHBTdHJtRGF0YSxudW1aZXJvcysxKTsKLQotICAgICAgICBiaXRzID0gaDI2NGJzZEdldEJpdHMocFN0cm1EYXRhLCBudW1aZXJvcyk7Ci0gICAgICAgIGlmIChiaXRzID09IEVORF9PRl9TVFJFQU0pCi0gICAgICAgICAgICByZXR1cm4oSEFOVFJPX05PSyk7Ci0KLSAgICAgICAgKmNvZGVOdW0gPSAoMSA8PCBudW1aZXJvcykgLSAxICsgYml0czsKLQotICAgIH0KLQotICAgIHJldHVybihIQU5UUk9fT0spOwotCi19Ci0KLS8qLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tCi0KLSAgIDUuMiAgRnVuY3Rpb246IGgyNjRic2REZWNvZGVFeHBHb2xvbWJTaWduZWQKLQotICAgICAgICBGdW5jdGlvbmFsIGRlc2NyaXB0aW9uOgotICAgICAgICAgICAgRGVjb2RlIHNpZ25lZCBFeHAtR29sb21iIGNvZGUuIENvZGUgbnVtIGlzIGRldGVybWluZWQgYnkKLSAgICAgICAgICAgIGgyNjRic2REZWNvZGV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TsKLSAgICBwVnVpUGFyYW1ldGVycy0+YXNwZWN0UmF0aW9QcmVzZW50RmxhZyA9ICh0bXAgPT0gMSkgPwotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBIQU5UUk9fVFJVRSA6IEhBTlRST19GQUxTRTsKLQotICAgIGlmIChwVnVpUGFyYW1ldGVycy0+YXNwZWN0UmF0aW9QcmVzZW50RmxhZykKLSAgICB7Ci0gICAgICAgIHRtcCA9IGgyNjRic2RHZXRCaXRzKHBTdHJtRGF0YSwgOCk7Ci0gICAgICAgIGlmICh0bXAgPT0gRU5EX09GX1NUUkVBTSkKLSAgICAgICAgICAgIHJldHVybihIQU5UUk9fTk9LKTsKLSAgICAgICAgcFZ1aVBhcmFtZXRlcnMtPmFzcGVjdFJhdGlvSWRjID0gdG1wOwotCi0gICAgICAgIGlmIChwVnVpUGFyYW1ldGVycy0+YXNwZWN0UmF0aW9JZGMgPT0gQVNQRUNUX1JBVElPX0VYVEVOREVEX1NBUikKLSAgICAgICAgewotICAgICAgICAgICAgdG1wID0gaDI2NGJzZEdldEJpdHMocFN0cm1EYXRhLCAxNik7Ci0gICAgICAgICAgICBpZiAodG1wID09IEVORF9PRl9TVFJFQU0pCi0gICAgICAgICAgICAgICAgcmV0dXJuKEhBTlRST19OT0spOwotICAgICAgICAgICAgcFZ1aVBhcmFtZXRlcnMtPnNhcldpZHRoID0gdG1wOwotCi0gICAgICAgICAgICB0bXAgPSBoMjY0YnNkR2V0Qml0cyhwU3RybURhdGEsIDE2KTsKLSAgICAgICAgICAgIGlmICh0bXAgPT0gRU5EX09GX1NUUkVBTSkKLSAgICAgICAgICAgICAgICByZXR1cm4oSEFOVFJPX05PSyk7Ci0gICAgICAgICAgICBwVnVpUGFyYW1ldGVycy0+c2FySGVpZ2h0ID0gdG1wOwotICAgICAgICB9Ci0gICAgfQotCi0gICAgdG1wID0gaDI2NGJzZEdldEJpdHMocFN0cm1EYXRhLCAxKTsKLSAgICBpZiAodG1wID09IEVORF9P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AgcmV0dXJuKEhBTlRST19OT0spOwotICAgICAgICBwVnVpUGFyYW1ldGVycy0+dmlkZW9Gb3JtYXQgPSB0bXA7Ci0KLSAgICAgICAgdG1wID0gaDI2NGJzZEdldEJpdHMocFN0cm1EYXRhLCAxKTsKLSAgICAgICAgaWYgKHRtcCA9PSBFTkRfT0ZfU1RSRUFNKQotICAgICAgICAgICAgcmV0dXJuKEhBTlRST19OT0spOwotICAgICAgICBwVnVpUGFyYW1ldGVycy0+dmlkZW9GdWxsUmFuZ2VGbGFnID0gKHRtcCA9PSAxKSA/Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEhBTlRST19UUlVFIDogSEFOVFJPX0ZBTFNFOwotCi0gICAgICAgIHRtcCA9IGgyNjRic2RHZXRCaXRzKHBTdHJtRGF0YSwgMSk7Ci0gICAgICAgIGlmICh0bXAgPT0gRU5EX09GX1NUUkVBTSkKLSAgICAgICAgICAgIHJldHVybihIQU5UUk9fTk9LKTsKLSAgICAgICAgcFZ1aVBhcmFtZXRlcnMtPmNvbG91ckRlc2NyaXB0aW9uUHJlc2VudEZsYWcgPQotICAgICAgICAgICAgKHRtcCA9PSAxKSA/IEhBTlRST19UUlVFIDogSEFOVFJPX0ZBTFNFOwotCi0gICAgICAgIGlmIChwVnVpUGFyYW1ldGVycy0+Y29sb3VyRGVzY3JpcHRpb25QcmVzZW50RmxhZykKLSAgICAgICAgewotICAgICAgICAgICAgdG1wID0gaDI2NGJzZEdldEJpdHMocFN0cm1EYXRhLCA4KTsKLSAgICAgICAgICAgIGlmICh0bXAgPT0gRU5EX09GX1NUUkVBTSkKLSAgICAgICAgICAgICAgICByZXR1cm4oSEFOVFJPX05PSyk7Ci0gICAgICAgICAgICBwVnVpUGFyYW1ldGVycy0+Y29sb3VyUHJpbWFyaWVzID0gdG1wOwotCi0gICAgICAgICAgICB0bXAgPSBoMjY0YnNkR2V0Qml0cyhwU3RybURhdGEsIDgpOwotICAgICAgICAgICAgaWYgKHRtcCA9PSBFTkRfT0ZfU1RSRUFNKQotICAgICAgICAgICAgICAgIHJldHVybihIQU5UUk9fTk9LKTsKLSAgICAgICAgICAgIHBWdWlQYXJhbWV0ZXJzLT50cmFuc2ZlckNoYXJhY3RlcmlzdGljcyA9IHRtcDsKLQotICAgICAgICAgICAgdG1wID0gaDI2NGJzZEdldEJpdHMocFN0cm1EYXRhLCA4KTsKLSAgICAgICAgICAgIGlmICh0bXAgPT0gRU5EX09GX1NUUkVBTSkKLSAgICAgICAgICAgICAgICByZXR1cm4oSEFOVFJPX05PSyk7Ci0gICAgICAgICAgICBwVnVpUGFyYW1ldGVycy0+bWF0cml4Q29lZmZpY2llbnRzID0gdG1wOwotICAgICAgICB9Ci0gICAgICAgIGVsc2UKLSAgICAgICAgewotICAgICAgICAgICAgcFZ1aVBhcmFtZXRlcnMtPmNvbG91clByaW1hcmllcyAgICAgICAgID0gMjsKLSAgICAgICAgICAgIHBWdWlQYXJhbWV0ZXJzLT50cmFuc2ZlckNoYXJhY3RlcmlzdGljcyA9IDI7Ci0gICAgICAgICAgICBwVnVpUGFyYW1ldGVycy0+bWF0cml4Q29lZmZpY2llbnRzICAgICAgPSAyOwotICAgICAgICB9Ci0gICAgfQotICAgIGVsc2UKLSAgICB7Ci0gICAgICAgIHBWdWlQYXJhbWV0ZXJzLT52aWRlb0Zvcm1hdCAgICAgICAgICAgICA9IDU7Ci0gICAgICAgIHBWdWlQYXJhbWV0ZXJzLT5jb2xvdXJQcmltYXJpZXMgICAgICAgICA9IDI7Ci0gICAgICAgIHBWdWlQYXJhbWV0ZXJzLT50cmFuc2ZlckNoYXJhY3RlcmlzdGljcyA9IDI7Ci0gICAgICAgIHBWdWlQYXJhbWV0ZXJzLT5tYXRyaXhDb2VmZmljaWVudHMgICAgICA9IDI7Ci0gICAgfQotCi0gICAgdG1wID0gaDI2NGJzZEdldEJpdHMocFN0cm1EYXRhLCAxKTsKLSAgICBpZiAodG1wID09IEVORF9PRl9TVFJFQU0pCi0gICAgICAgIHJldHVybihIQU5UUk9fTk9LKTsKLSAgICBwVnVpUGFyYW1ldGVycy0+Y2hyb21hTG9jSW5mb1ByZXNlbnRGbGFnID0KLSAgICAgICAgKHRtcCA9PSAxKSA/IEhBTlRST19UUlVFIDogSEFOVFJPX0ZBTFNFOwotCi0gICAgaWYgKHBWdWlQYXJhbWV0ZXJzLT5jaHJvbWFMb2NJbmZvUHJlc2VudEZsYWcpCi0gICAgewotICAgICAgICB0bXAgPSBoMjY0YnNkRGVjb2RlRXhwR29sb21iVW5zaWduZWQocFN0cm1EYXRhLAotICAgICAgICAgICZwVnVpUGFyYW1ldGVycy0+Y2hyb21hU2FtcGxlTG9jVHlwZVRvcEZpZWxkKTsKLSAgICAgICAgaWYgKHRtcCAhPSBIQU5UUk9fT0spCi0gICAgICAgICAgICByZXR1cm4odG1wKTsKLSAgICAgICAgaWYgKHBWdWlQYXJhbWV0ZXJzLT5jaHJvbWFTYW1wbGVMb2NUeXBlVG9wRmllbGQgPiA1KQotICAgICAgICAgICAgcmV0dXJuKEhBTlRST19OT0spOwotCi0gICAgICAgIHRtcCA9IGgyNjRic2REZWNvZGVFeHBHb2xvbWJVbnNpZ25lZChwU3RybURhdGEsCi0gICAgICAgICAgJnBWdWlQYXJhbWV0ZXJzLT5jaHJvbWFTYW1wbGVMb2NUeXBlQm90dG9tRmllbGQpOwotICAgICAgICBpZiAodG1wICE9IEhBTlRST19PSykKLSAgICAgICAgICAgIHJldHVybih0bXApOwotICAgICAgICBpZiAocFZ1aVBhcmFtZXRlcnMtPmNocm9tYVNhbXBsZUxvY1R5cGVCb3R0b21GaWVsZCA+IDUpCi0gICAgICAgICAgICByZXR1cm4oSEFOVFJPX05PSyk7Ci0gICAgfQotCi0gICAgdG1wID0gaDI2NGJzZEdldEJpdHMocFN0cm1EYXRhLCAxKTsKLSAgICBpZiAodG1wID09IEVORF9PRl9TVFJFQU0pCi0gICAgICAgIHJldHVybihIQU5UUk9fTk9LKTsKLSAgICBwVnVpUGFyYW1ldGVycy0+dGltaW5nSW5mb1ByZXNlbnRGbGFnID0KLSAgICAgICAgKHRtcCA9PSAxKSA/IEhBTlRST19UUlVFIDogSEFOVFJPX0ZBTFNFOwotCi0gICAgaWYgKHBWdWlQYXJhbWV0ZXJzLT50aW1pbmdJbmZvUHJlc2VudEZsYWcpCi0gICAgewotICAgICAgICB0bXAgPSBoMjY0YnNkU2hvd0JpdHMzMihwU3RybURhdGEpOwotICAgICAgICBpZiAoaDI2NGJzZEZsdXNoQml0cyhwU3RybURhdGEsIDMyKSA9PSBFTkRfT0ZfU1RSRUFNKQotICAgICAgICAgICAgcmV0dXJuKEhBTlRST19OT0spOwotICAgICAgICBpZiAodG1wID09IDApCi0gICAgICAgICAgICByZXR1cm4oSEFOVFJPX05PSyk7Ci0gICAgICAgIHBWdWlQYXJhbWV0ZXJzLT5udW1Vbml0c0luVGljayA9IHRtcDsKLQotICAgICAgICB0bXAgPSBoMjY0YnNkU2hvd0JpdHMzMihwU3RybURhdGEpOwotICAgICAgICBpZiAoaDI2NGJzZEZsdXNoQml0cyhwU3RybURhdGEsIDMyKSA9PSBFTkRfT0ZfU1RSRUFNKQotICAgICAgICAgICAgcmV0dXJuKEhBTlRST19OT0spOwotICAgICAgICBpZiAodG1wID09IDApCi0gICAgICAgICAgICByZXR1cm4oSEFOVFJPX05PSyk7Ci0gICAgICAgIHBWdWlQYXJhbWV0ZXJzLT50aW1lU2NhbGUgPSB0bXA7Ci0KLSAgICAgICAgdG1wID0gaDI2NGJzZEdldEJpdHMocFN0cm1EYXRhLCAxKTsKLSAgICAgICAgaWYgKHRtcCA9PSBFTkRfT0ZfU1RSRUFNKQotICAgICAgICAgICAgcmV0dXJuKEhBTlRST19OT0spOwotICAgICAgICBwVnVpUGFyYW1ldGVycy0+Zml4ZWRGcmFtZVJhdGVGbGFnID0KLSAgICAgICAgICAgICh0bXAgPT0gMSkgPyBIQU5UUk9fVFJVRSA6IEhBTlRST19GQUxTRTsKLSAgICB9Ci0KLSAgICB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yYmlzUGFyYW1zLT5uQ2hhbm5lbHMgPSBtVmktPmNoYW5uZWxzOwotICAgICAgICAgICAgICAgIHZvcmJpc1BhcmFtcy0+blNhbXBsZVJhdGUgPSBtVmktPnJhdGU7Ci0gICAgICAgICAgICAgICAgdm9yYmlzUGFyYW1zLT5uQml0UmF0ZSA9IG1WaS0+Yml0cmF0ZV9ub21pbmFsOwotICAgICAgICAgICAgICAgIHZvcmJpc1BhcmFtcy0+bk1pbkJpdFJhdGUgPSBtVmktPmJpdHJhdGVfbG93ZXI7Ci0gICAgICAgICAgICAgICAgdm9yYmlzUGFyYW1zLT5uTWF4Qml0UmF0ZSA9IG1WaS0+Yml0cmF0ZV91cHBlcjsKLSAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgcmV0dXJuIE9NWF9FcnJvck5vbmU7Ci0gICAgICAgIH0KLQotICAgICAgICBjYXNlIE9NWF9JbmRleFBhcmFtQXVkaW9QY206Ci0gICAgICAgIHsKLSAgICAgICAgICAgIE9NWF9BVURJT19QQVJBTV9QQ01NT0RFVFlQRSAqcGNtUGFyYW1zID0KLSAgICAgICAgICAgICAgICAoT01YX0FVRElPX1BBUkFNX1BDTU1PREVUWVBFICopcGFyYW1zOwotCi0gICAgICAgICAgICBpZiAocGNtUGFyYW1zLT5uUG9ydEluZGV4ICE9IDEpIHsKLSAgICAgICAgICAgICAgICByZXR1cm4gT01YX0Vycm9yVW5kZWZpbmVkOwotICAgICAgICAgICAgfQotCi0gICAgICAgICAgICBwY21QYXJhbXMtPmVOdW1EYXRhID0gT01YX051bWVyaWNhbERhdGFTaWduZWQ7Ci0gICAgICAgICAgICBwY21QYXJhbXMtPmVFbmRpYW4gPSBPTVhfRW5kaWFuQmlnOwotICAgICAgICAgICAgcGNtUGFyYW1zLT5iSW50ZXJsZWF2ZWQgPSBPTVhfVFJVRTsKLSAgICAgICAgICAgIHBjbVBhcmFtcy0+bkJpdFBlclNhbXBsZSA9IDE2OwotICAgICAgICAgICAgcGNtUGFyYW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EVUWVBFICpyb2xlUGFyYW1zID0KLSAgICAgICAgICAgICAgICAoY29uc3QgT01YX1BBUkFNX0NPTVBPTkVOVFJPTEVUWVBFICopcGFyYW1zOwotCi0gICAgICAgICAgICBpZiAoc3RybmNtcCgoY29uc3QgY2hhciAqKXJvbGVQYXJhbXMtPmNSb2xlLAotICAgICAgICAgICAgICAgICAgICAgICAgImF1ZGlvX2RlY29kZXIudm9yYmlzIiwKLSAgICAgICAgICAgICAgICAgICAgICAgIE9NWF9NQVhfU1RSSU5HTkFNRV9TSVpFIC0gMSkpIHsKLSAgICAgICAgICAgICAgICByZXR1cm4gT01YX0Vycm9yVW5kZWZpbmVkOwotICAgICAgICAgICAgfQotCi0gICAgICAgICAgICByZXR1cm4gT01YX0Vycm9yTm9uZTsKLSAgICAgICAgfQotCi0gICAgICAgIGNhc2UgT01YX0luZGV4UGFyYW1BdWRpb1ZvcmJpczoKLSAgICAgICAgewotICAgICAgICAgICAgY29uc3QgT01YX0FVRElPX1BBUkFNX1ZPUkJJU1RZUEUgKnZvcmJpc1BhcmFtcyA9Ci0gICAgICAgICAgICAgICAgKGNvbnN0IE9NWF9BVURJT19QQVJBTV9WT1JCSVNUWVBFICopcGFyYW1zOwotCi0gICAgICAgICAgICBpZiAodm9yYmlzUGFyYW1zLT5uUG9ydEluZGV4ICE9IDApIHsKLSAgICAgICAgICAgICAgICByZXR1cm4gT01YX0Vycm9yVW5kZWZpbmVkOwotICAgICAgICAgICAgfQotCi0gICAgICAgICAgICByZXR1cm4gT01YX0Vycm9yTm9uZTsKLSAgICAgICAgfQotCi0gICAgICAgIGRlZmF1bHQ6Ci0gICAgICAgICAgICByZXR1cm4gU2ltcGxlU29mdE9NWENvbXBvbmVudDo6aW50ZXJuYWxTZXRQYXJhbWV0ZXIoaW5kZXgsIHBhcmFtcyk7Ci0gICAgfQotfQotCi1ib29sIFNvZnRWb3JiaXM6OmlzQ29uZmlndXJlZCgpIGNvbnN0IHsKLSAgICByZXR1cm4gbUlucH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mRhdGEgPSBoZWFkZXItPnBCdWZmZXIgKyBoZWFkZXItPm5PZmZzZXQ7Ci0gICAgICAgIHNpemVfdCBzaXplID0gaGVhZGVyLT5uRmlsbGVkTGVuOwotCi0gICAgICAgIG9nZ19idWZmZXIgYnVmOwotICAgICAgICBvZ2dfcmVmZXJlbmNlIHJlZjsKLSAgICAgICAgb2dncGFja19idWZmZXIgYml0czsKLQotICAgICAgICBtYWtlQml0UmVhZGVyKAotICAgICAgICAgICAgICAgIChjb25zdCB1aW50OF90ICopZGF0YSArIDcsIHNpemUgLSA3LAotICAgICAgICAgICAgICAgICZidWYsICZyZWYsICZiaXRzKTsKLQotICAgICAgICBpZiAobUlucHV0QnVmZmVyQ291bnQgPT0gMCkgewotICAgICAgICAgICAgQ0hFQ0sobVZpID09IE5VTEwpOwotICAgICAgICAgICAgbVZpID0gbmV3IHZvcmJpc19pbmZvOwotICAgICAgICAgICAgdm9yYmlzX2luZm9faW5pdChtVmkpOwotCi0gICAgICAgICAgICBDSEVDS19FUSgwLCBfdm9yYmlzX3VucGFja19pbmZvKG1WaSwgJmJpdHMpKTsKLSAgICAgICAgfSBlbHNlIHsKLSAgICAgICAgICAgIENIRUNLX0VRKDAsIF92b3JiaXNfdW5wYWNrX2Jvb2tzKG1WaSwgJmJpdHMpKTsKLQotICAgICAgICAgICAgQ0hFQ0sobVN0YXRlID09IE5VTEwpOwotICAgICAgICAgICAgbVN0YXRlID0gbmV3IHZvcmJpc19kc3Bfc3RhdGU7Ci0gICAgICAgICAgICBDSEVDS19FUSgwLCB2b3JiaXNfZHNwX2luaXQobVN0YXRlLCBtVmkpKTsKLQotICAgICAgICAgICAgbm90aWZ5KE9NWF9FdmVudFBvcnRTZXR0aW5nc0NoYW5nZWQsIDEsIDAsIE5VTEwpOwotICAgICAgICAgICAgbU91dHB1dFBvcnRTZXR0aW5nc0NoYW5nZSA9IEFXQUlUSU5HX0RJU0FCTEVEOwotICAgICAgICB9Ci0KLSAgICAgICAgaW5RdWV1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nVmZmVyRG9uZShvdXRIZWFkZXIpOwotICAgICAgICAgICAgcmV0dXJuOwotICAgICAgICB9Ci0KLSAgICAgICAgaW50MzJfdCBudW1QYWdlU2FtcGxlczsKLSAgICAgICAgQ0hFQ0tfR0UoaW5IZWFkZXItPm5GaWxsZWRMZW4sIHNpemVvZihudW1QYWdlU2FtcGxlcykpOwotICAgICAgICBtZW1jcHkoJm51bVBhZ2VTYW1wbGVzLAotICAgICAgICAgICAgICAgaW5IZWFkZXItPnBCdWZmZXIKLSAgICAgICAgICAgICAgICArIGluSGVhZGVyLT5uT2Zmc2V0ICsgaW5IZWFkZXItPm5GaWxsZWRMZW4gLSA0LAotICAgICAgICAgICAgICAgc2l6ZW9mKG51bVBhZ2VTYW1wbGVzKSk7Ci0KLSAgICAgICAgaWYgKG51bVBhZ2VTYW1wbGVzID49IDApIHsKLSAgICAgICAgICAgIG1OdW1GcmFtZXNMZWZ0T25QYWdlID0gbnVtUGFnZVNhbXBsZXM7Ci0gICAgICAgIH0KLQotICAgICAgICBpZiAoaW5IZWFkZXItPm5PZmZzZXQgPT0gMCkgewotICAgICAgICAgICAgbUFuY2hvclRpbWVVcyA9IGluSGVhZGVyLT5uVGltZVN0YW1wOwotICAgICAgICAgICAgbU51bUZyYW1lc091dHB1dCA9IDA7Ci0gICAgICAgIH0KLQotICAgICAgICBpbkhlYWRlci0+bkZpbGxlZExlbiAtPSBzaXplb2YobnVtUGFnZVNhbXBsZXMpOzsKLQotICAgICAgICBvZ2dfYnVmZmVyIGJ1ZjsKLSAgICAgICAgYnVmLmRhdGEgPSBpbkhlYWRlci0+cEJ1ZmZlciArIGluSGVhZGVyLT5uT2Zmc2V0OwotICAgICAgICBidWYuc2l6ZSA9IGluSGVhZGVyLT5uRmlsbGVkTGVuOwotICAgICAgICBidWYucmVmY291bnQgPSAxOwotICAgICAgICBidWYucHRyLm93bmVyID0gTlVMTDsKLQotICAgICAgICBvZ2dfcmVmZXJlbmNlIHJlZjsKLSAgICAgICAgcmVmLmJ1ZmZlciA9ICZidWY7Ci0gICAgICAgIHJlZi5iZWdpbiA9IDA7Ci0gICAgICAgIHJlZi5sZW5ndGggPSBidWYuc2l6ZTsKLSAgICAgICAgcmVmLm5leHQgPSBOVUxMOwotCi0gICAgICAgIG9nZ19wYWNrZXQgcGFjazsKLSAgICAgICAgcGFjay5wYWNrZXQgPSAmcmVmOwotICAgICAgICBwYWNrLmJ5dGVzID0gcmVmLmxlbmd0aDsKLSAgICAgICAgcGFjay5iX29fcyA9IDA7Ci0gICAgICAgIHBhY2suZV9vX3MgPSAwOwotICAgICAgICBwYWNrLmdyYW51bGVwb3MgPSAwOwotICAgICAgICBwYWNrLnBhY2tldG5vID0gMDsKLQotICAgICAgICBpbnQgbnVtRnJhbWVzID0gMDsKLQotICAgICAgICBpbnQgZXJyID0gdm9yYmlzX2RzcF9zeW50aGVzaXMobVN0YXRlLCAmcGFjaywgMSk7Ci0gICAgICAgIGlmIChlcnIgIT0gMCkgewotICAgICAgICAgICAgQUxPR1coInZvcmJpc19kc3Bfc3ludGhlc2lzIHJldHVybmVkICVkIiwgZXJyKTsKLSAgICAgICAgfSBlbHNlIHsKLSAgICAgICAgICAgIG51bUZyYW1lcyA9IHZvcmJpc19kc3BfcGNtb3V0KAotICAgICAgICAgICAgICAgICAgICBtU3RhdGUsIChpbnQxNl90ICopb3V0SGVhZGVyLT5wQnVmZmVyLAotICAgICAgICAgICAgICAgICAgICBrTWF4TnVtU2FtcGxlc1BlckJ1ZmZlcik7Ci0KLSAgICAgICAgICAgIGlmIChudW1GcmFtZXMgPCAwKSB7Ci0gICAgICAgICAgICAgICAgQUxPR0UoInZvcmJpc19kc3BfcGNtb3V0IHJldHVybmVkICVkIiwgbnVtRnJhbWVzKTsKLSAgICAgICAgICAgICAgICBudW1GcmFtZXMgPSAwOwotICAgICAgICAgICAgfQotICAgICAgICB9Ci0KLSAgICAgICAgaWYgKG1OdW1GcmFtZXNMZWZ0T25QYWdlID49IDApIHsKLSAgICAgIC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wSGVpZ2h0KCk7ICsreSkgewotICAgICAgICBmb3IgKHNpemVfdCB4ID0gMDsgeCA8IHNyYy5jcm9wV2lkdGgoKTsgeCArPSAyKSB7Ci0gICAgICAgICAgICBzaWduZWQgeTEgPSAoc2lnbmVkKXNyY19wdHJbMiAqIHggKyAxXSAtIDE2OwotICAgICAgICAgICAgc2lnbmVkIHkyID0gKHNpZ25lZClzcmNfcHRyWzIgKiB4ICsgM10gLSAxNjsKLSAgICAgICAgICAgIHNpZ25lZCB1ID0gKHNpZ25lZClzcmNfcHRyWzIgKiB4XSAtIDEyODsKLSAgICAgICAgICAgIHNpZ25lZCB2ID0gKHNpZ25lZClzcmNfcHRyWzIgKiB4ICsgMl0gLSAxMjg7Ci0KLSAgICAgICAgICAgIHNpZ25lZCB1X2IgPSB1ICogNTE3OwotICAgICAgICAgICAgc2lnbmVkIHVfZyA9IC11ICogMTAwOwotICAgICAgICAgICAgc2lnbmVkIHZfZyA9IC12ICogMjA4OwotICAgICAgICAgICAgc2lnbmVkIHZfciA9IHYgKiA0MDk7Ci0KLSAgICAgICAgICAgIHNpZ25lZCB0bXAxID0geTEgKiAyOTg7Ci0gICAgICAgICAgICBzaWduZWQgYjEgPSAodG1wMSArIHVfYikgLyAyNTY7Ci0gICAgICAgICAgICBzaWduZWQgZzEgPSAodG1wMSArIHZfZyArIHVfZykgLyAyNTY7Ci0gICAgICAgICAgICBzaWduZWQgcjEgPSAodG1wMSArIHZfcikgLyAyNTY7Ci0KLSAgICAgICAgICAgIHNpZ25lZCB0bXAyID0geTIgKiAyOTg7Ci0gICAgICAgICAgICBzaWduZWQgYjIgPSAodG1wMiArIHVfYikgLyAyNTY7Ci0gICAgICAgICAgICBzaWduZWQgZzIgPSAodG1wMiArIHZfZyArIHVfZykgLyAyNTY7Ci0gICAgICAgICAgICBzaWduZWQgcjIgPSAodG1wMiArIHZfcikgLyAyNTY7Ci0KLSAgICAgICAgICAgIHVpbnQzMl90IHJnYjEgPQotICAgICAgICAgICAg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c3JjX3lbeCArIDFdIC0gMTY7Ci0KLSAgICAgICAgICAgIHNpZ25lZCB1ID0gKHNpZ25lZClzcmNfdVt4IC8gMl0gLSAxMjg7Ci0gICAgICAgICAgICBzaWduZWQgdiA9IChzaWduZWQpc3JjX3ZbeCAvIDJdIC0gMTI4OwotCi0gICAgICAgICAgICBzaWduZWQgdV9iID0gdSAqIDUxNzsKLSAgICAgICAgICAgIHNpZ25lZCB1X2cgPSAtdSAqIDEwMDsKLSAgICAgICAgICAgIHNpZ25lZCB2X2cgPSAtdiAqIDIwODsKLSAgICAgICAgICAgIHNpZ25lZCB2X3IgPSB2ICogNDA5OwotCi0gICAgICAgICAgICBzaWduZWQgdG1wMSA9IHkxICogMjk4OwotICAgICAgICAgICAgc2lnbmVkIGIxID0gKHRtcDEgKyB1X2IpIC8gMjU2OwotICAgICAgICAgICAgc2lnbmVkIGcxID0gKHRtcDEgKyB2X2cgKyB1X2cpIC8gMjU2OwotICAgICAgICAgICAgc2lnbmVkIHIxID0gKHRtcDEgKyB2X3IpIC8gMjU2OwotCi0gICAgICAgICAgICBzaWduZWQgdG1wMiA9IHkyICogMjk4OwotICAgICAgICAgICAgc2lnbmVkIGIyID0gKHRtcDIgKyB1X2IpIC8gMjU2OwotICAgICAgICAgICAgc2lnbmVkIGcyID0gKHRtcDIgKyB2X2cgKyB1X2cpIC8gMjU2OwotICAgICAgICAgICAgc2lnbmVkIHIyID0gKHRtcDIgKyB2X3IpIC8gMjU2OwotCi0gICAgICAgICAgICB1aW50MzJfdCByZ2IxID0KLSAgICAgICAgICAgICAgICAoKGtBZGp1c3RlZENsaXBbcjFdID4+IDMpIDw8IDExKQotICAgICAgICAgICAgICAgIHwgKChrQWRqdXN0ZWRDbGlwW2cxXSA+PiAyKSA8PCA1KQotICAgICAgICAgICAgICAgIHwgKGtBZGp1c3RlZENsaXBbYjFdID4+IDMpOwotCi0gICAgICAgICAgICB1aW50MzJfdCByZ2IyID0KLSAgICAgICAgICAgICAgICAoKGtBZGp1c3RlZENsaXBbcjJdID4+IDMpIDw8IDExKQotICAgICAgICAgICAgICAgIHwgKChrQWRqdXN0ZWRDbGlwW2cyXSA+PiAyKSA8PCA1KQotICAgICAgICAgICAgICAgIHwgKGtBZGp1c3RlZENsaXBbYjJdID4+IDMpOwotCi0gICAgICAgICAgICBpZiAoeCArIDEgPCBzcmMuY3JvcFdpZHRoKCkpIHsKLSAgICAgICAgICAgICAgICAqKHVpbnQzMl90ICopKCZkc3RfcHRyW3hdKSA9IChyZ2IyIDw8IDE2KSB8IHJnYjE7Ci0gICAgICAgICAgICB9IGVsc2UgewotICAgICAgICAgICAgICAgIGRzdF9wdHJbeF0gPSByZ2IxOwotICAgICAgICAgICAgfQotICAgICAgICB9Ci0KLSAgICAgICAgc3JjX3kgKz0gc3JjLm1XaWR0aDsKLQotICAgICAgICBpZiAoeSAmIDEpIHsKLSAgICAgICAgICAgIHNyY191ICs9IHNyYy5tV2lkdGggLyAyOwotICAgICAgICAgICAgc3JjX3YgKz0gc3JjLm1XaWR0aCAvIDI7Ci0gICAgICAgIH0KLQotICAgICAgICBkc3RfcHRyICs9IGRzdC5tV2lkdGg7Ci0gICAgfQotCi0gICAgcmV0dXJuIE9LOwotfQotCi1zdGF0dXNfdCBDb2xvckNvbnZlcnRlcjo6Y29udmVydFFDT01ZVVY0MjBTZW1pUGxhbmFyKAotICAgICAgICBjb25zdCBCaXRtYXBQYXJhbXMgJnNyYywgY29uc3QgQml0bWFwUGFyYW1zICZkc3QpIHsKLSAgICB1aW50OF90ICprQWRqdXN0ZWRDbGlwID0gaW5pdENsaXAoKTsKLQotICAgIGlmICghKChzcmMubUNyb3BMZWZ0ICYgMSkgPT0gMAotICAgICAgICAgICAgJiYgc3JjLmNyb3BXaWR0aCgpID09IGRzdC5jcm9wV2lkdGgoKQotICAgICAgICAgICAgJiYgc3JjLmNyb3BIZWlnaHQoKSA9PSBkc3QuY3JvcEhlaWdodCgpKSkgewotICAgICAgICByZXR1cm4gRVJST1JfV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hfdCAqc3JjX3UgPQotICAgICAgICAoY29uc3QgdWludDhfdCAqKXNyY195ICsgc3JjLm1XaWR0aCAqIHNyYy5tSGVpZ2h0Ci0gICAgICAgICsgc3JjLm1Dcm9wVG9wICogc3JjLm1XaWR0aCArIHNyYy5tQ3JvcExlZnQ7Ci0KLSAgICBmb3IgKHNpemVfdCB5ID0gMDsgeSA8IHNyYy5jcm9wSGVpZ2h0KCk7ICsreSkgewotICAgICAgICBmb3IgKHNpemVfdCB4ID0gMDsgeCA8IHNyYy5jcm9wV2lkdGgoKTsgeCArPSAyKSB7Ci0gICAgICAgICAgICBzaWduZWQgeTEgPSAoc2lnbmVkKXNyY195W3hdIC0gMTY7Ci0gICAgICAgICAgICBzaWduZWQgeTIgPSAoc2lnbmVkKXNyY195W3ggKyAxXSAtIDE2OwotCi0gICAgICAgICAgICBzaWduZWQgdiA9IChzaWduZWQpc3JjX3VbeCAmIH4xXSAtIDEyODsKLSAgICAgICAgICAgIHNpZ25lZCB1ID0gKHNpZ25lZClzcmNfdVsoeCAmIH4xKSArIDFdIC0gMTI4OwotCi0gICAgICAgICAgICBzaWduZWQgdV9iID0gdSAqIDUxNzsKLSAgICAgICAgICAgIHNpZ25lZCB1X2cgPSAtdSAqIDEwMDsKLSAgICAgICAgICAgIHNpZ25lZCB2X2cgPSAtdiAqIDIwODsKLSAgICAgICAgICAgIHNpZ25lZCB2X3IgPSB2ICogNDA5OwotCi0gICAgICAgICAgICBzaWduZWQgdG1wMSA9IHkxICogMjk4OwotICAgICAgICAgICAgc2lnbmVkIGIxID0gKHRtcDEgKyB1X2IpIC8gMjU2OwotICAgICAgICAgICAgc2lnbmVkIGcxID0gKHRtcDEgKyB2X2cgKyB1X2cpIC8gMjU2OwotICAgICAgICAgICAgc2lnbmVkIHIxID0gKHRtcDEgKyB2X3IpIC8gMjU2OwotCi0gICAgICAgICAgICBzaWduZWQgdG1wMiA9IHkyICogMjk4OwotICAgICAgICAgICAgc2lnbmVkIGIyID0gKHRtcDIgKyB1X2IpIC8gMjU2OwotICAgICAgICAgICAgc2lnbmVkIGcyID0gKHRtcDIgKyB2X2cgKyB1X2cpIC8gMjU2OwotICAgICAgICAgICAgc2lnbmVkIHIyID0gKHRtcDIgKyB2X3IpIC8gMjU2OwotCi0gICAgICAgICAgICB1aW50MzJfdCByZ2IxID0KLSAgICAgICAgICAgICAgICAoKGtBZGp1c3RlZENsaXBbYjFdID4+IDMpIDw8IDExKQotICAgICAgICAgICAgICAgIHwgKChrQWRqdXN0ZWRDbGlwW2cxXSA+PiAyKSA8PCA1KQotICAgICAgICAgICAgICAgIHwgKGtBZGp1c3RlZENsaXBbcjFdID4+IDMpOwotCi0gICAgICAgICAgICB1aW50MzJfdCByZ2IyID0KLSAgICAgICAgICAgICAgICAoKGtBZGp1c3RlZENsaXBbYjJdID4+IDMpIDw8IDExKQotICAgICAgICAgICAgICAgIHwgKChrQWRqdXN0ZWRDbGlwW2cyXSA+PiAyKSA8PCA1KQotICAgICAgICAgICAgICAgIHwgKGtBZGp1c3RlZENsaXBbcjJdID4+IDMpOwotCi0gICAgICAgICAgICBpZiAoeCArIDEgPCBzcmMuY3JvcFdpZHRoKCkpIHsKLSAgICAgICAgICAgICAgICAqKHVpbnQzMl90ICopKCZkc3RfcHRyW3hdKSA9IChyZ2IyIDw8IDE2KSB8IHJnYjE7Ci0gICAgICAgICAgICB9IGVsc2UgewotICAgICAgICAgICAgICAgIGRzdF9wdHJbeF0gPSByZ2IxOwotICAgICAgICAgICAgfQotICAgICAgICB9Ci0KLSAgICAgICAgc3JjX3kgKz0gc3JjLm1XaWR0aDsKLQotICAgICAgICBpZiAoeSAmIDEpIHsKLSAgICAgICAgICAgIHNyY191ICs9IHNyYy5tV2lkdGg7Ci0gICAgICAgIH0KLQotICAgICAgICBkc3RfcHRyICs9IGRzdC5tV2lkdGg7Ci0gICAgfQotCi0gICAgcmV0dXJuIE9LOwotfQotCi1zdGF0dXNfdCBDb2xvckNvbnZlcnRlcjo6Y29udmVydF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kKLSAgICAgICAgICAgICAgICB8ICgoa0FkanVzdGVkQ2xpcFtnMl0gPj4gMikgPDwgNSkKLSAgICAgICAgICAgICAgICB8IChrQWRqdXN0ZWRDbGlwW2IyXSA+PiAzKTsKLQotICAgICAgICAgICAgaWYgKHggKyAxIDwgc3JjLmNyb3BXaWR0aCgpKSB7Ci0gICAgICAgICAgICAgICAgKih1aW50MzJfdCAqKSgmZHN0X3B0clt4XSkgPSAocmdiMiA8PCAxNikgfCByZ2IxOwotICAgICAgICAgICAgfSBlbHNlIHsKLSAgICAgICAgICAgICAgICBkc3RfcHRyW3hdID0gcmdiMTsKLSAgICAgICAgICAgIH0KLSAgICAgICAgfQotCi0gICAgICAgIHNyY195ICs9IHNyYy5tV2lkdGg7Ci0KLSAgICAgICAgaWYgKHkgJiAxKSB7Ci0gICAgICAgICAgICBzcmNfdSArPSBzcmMubVdpZHRoOwotICAgICAgICB9Ci0KLSAgICAgICAgZHN0X3B0ciArPSBkc3QubVdpZHRoOwotICAgIH0KLQotICAgIHJldHVybiBPSzsKLX0KLQotdWludDhfdCAqQ29sb3JDb252ZXJ0ZXI6OmluaXRDbGlwKCkgewotICAgIHN0YXRpYyBjb25zdCBzaWduZWQga0NsaXBNaW4gPSAtMjc4OwotICAgIHN0YXRpYyBjb25zdCBzaWduZWQga0NsaXBNYXggPSA1MzU7Ci0KLSAgICBpZiAobUNsaXAgPT0gTlVMTCkgewotICAgICAgICBtQ2xpcCA9IG5ldyB1aW50OF90W2tDbGlwTWF4IC0ga0NsaXBNaW4gKyAxXTsKLQotICAgICAgICBmb3IgKHNpZ25lZCBpID0ga0NsaXBNaW47IGkgPD0ga0NsaXBNYXg7ICsraSkgewotICAgICAgICAgICAgbUNsaXBbaSAtIGtDbGlwTWluXSA9IChpIDwgMCkgPyAwIDogKGkgPiAyNTUpID8gMjU1IDogKHVpbnQ4X3QpaTsKLSAgICAgICAgfQotICAgIH0KLQotICAgIHJldHVybiAmbUNsaXBbLWtDbGlwTWluXTsK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Nyb3BUb3AgLyAyKTsKLQotICAgICAgICB1aW50OF90ICpkc3RfeSA9ICh1aW50OF90ICopZHN0OwotCi0gICAgICAgIHNpemVfdCBkc3RfeV9zaXplID0gYnVmLT5zdHJpZGUgKiBidWYtPmhlaWdodDsKLSAgICAgICAgc2l6ZV90IGRzdF9jX3N0cmlkZSA9IEFMSUdOKGJ1Zi0+c3RyaWRlIC8gMiwgMTYpOwotICAgICAgICBzaXplX3QgZHN0X2Nfc2l6ZSA9IGRzdF9jX3N0cmlkZSAqIGJ1Zi0+aGVpZ2h0IC8gMjsKLSAgICAgICAgdWludDhfdCAqZHN0X3YgPSBkc3RfeSArIGRzdF95X3NpemU7Ci0gICAgICAgIHVpbnQ4X3QgKmRzdF91ID0gZHN0X3YgKyBkc3RfY19zaXplOwotCi0gICAgICAgIGZvciAoaW50IHkgPSAwOyB5IDwgbUNyb3BIZWlnaHQ7ICsreSkgewotICAgICAgICAgICAgbWVtY3B5KGRzdF95LCBzcmNfeSwgbUNyb3BXaWR0aCk7Ci0KLSAgICAgICAgICAgIHNyY195ICs9IG1XaWR0aDsKLSAgICAgICAgICAgIGRzdF95ICs9IGJ1Zi0+c3RyaWRlOwotICAgICAgICB9Ci0KLSAgICAgICAgZm9yIChpbnQgeSA9IDA7IHkgPCAobUNyb3BIZWlnaHQgKyAxKSAvIDI7ICsreSkgewotICAgICAgICAgICAgc2l6ZV90IHRtcCA9IChtQ3JvcFdpZHRoICsgMSkgLyAyOwotICAgICAgICAgICAgZm9yIChzaXplX3QgeCA9IDA7IHggPCB0bXA7ICsreCkgewotICAgICAgICAgICAgICAgIGRzdF91W3hdID0gc3JjX3V2WzIgKiB4XTsKLSAgICAgICAgICAgICAgICBkc3Rfdlt4XSA9IHNyY191dlsyICogeCArIDFdOwotICAgICAgICAgICAgfQotCi0gICAgICAgICAgICBzcmNfdXYgKz0gbVdpZHRoOwotICAgICAgICAgICAgZHN0X3UgKz0gZHN0X2Nfc3RyaWRlOwotICAgICAgICAgICAg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ICAgIGl0ZW0tPm1OYW1lID0gbmFtZTsKLSAgICB9Ci0KLSAgICByZXR1cm4gaXRlbTsKLX0KLQotY29uc3QgQU1lc3NhZ2U6Okl0ZW0gKkFNZXNzYWdlOjpmaW5kSXRlbSgKLSAgICAgICAgY29uc3QgY2hhciAqbmFtZSwgVHlwZSB0eXBlKSBjb25zdCB7Ci0gICAgbmFtZSA9IEFBdG9taXplcjo6QXRvbWl6ZShuYW1lKTsKLQotICAgIGZvciAoc2l6ZV90IGkgPSAwOyBpIDwgbU51bUl0ZW1zOyArK2kpIHsKLSAgICAgICAgY29uc3QgSXRlbSAqaXRlbSA9ICZtSXRlbXNbaV07Ci0KLSAgICAgICAgaWYgKGl0ZW0tPm1OYW1lID09IG5hbWUpIHsKLSAgICAgICAgICAgIHJldHVybiBpdGVtLT5tVHlwZSA9PSB0eXBlID8gaXRlbSA6IE5VTEw7Ci0gICAgICAgIH0KLSAgICB9Ci0KLSAgICByZXR1cm4gTlVMTDsKLX0KLQotI2RlZmluZSBCQVNJQ19UWVBFKE5BTUUsRklFTEROQU1FLFRZUEVOQU1FKSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXAotdm9pZCBBTWVzc2FnZTo6c2V0IyNOQU1FKGNvbnN0IGNoYXIgKm5hbWUsIFRZUEVOQU1FIHZhbHVlKSB7ICAgICAgICAgICAgXAotICAgIEl0ZW0gKml0ZW0gPSBhbGxvY2F0ZUl0ZW0obmFtZSk7ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXAotICAgIGl0ZW0tPm1UeXBlID0ga1R5cGUjI05BTUU7ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXAotICAgIGl0ZW0tPnUuRklFTEROQU1FID0gdmFsdWU7ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXAotfSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXAotYm9vbCBBTWVzc2FnZTo6ZmluZCMjTkFNRShjb25zdCBjaGFyICpuYW1lLCBUWVBFTkFNRSAqdmFsdWUpIGNvbnN0IHsgICAgXAotICAgIGNvbnN0IEl0ZW0gKml0ZW0gPSBmaW5kSXRlbShuYW1lLCBrVHlwZSMjTkFNRSk7ICAgICAgICAgICAgICAgICAgICAgXAotICAgIGlmIChpdGVtKSB7ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXAotICAgICAgICAqdmFsdWUgPSBpdGVtLT51LkZJRUxETkFNRTsgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXAotICAgICAgICByZXR1cm4gdHJ1ZTsgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXAotICAgIH0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXAotICAgIHJldHVybiBmYWxzZTsgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXAotfQotCi1CQVNJQ19UWVBFKEludDMyLGludDMyVmFsdWUsaW50MzJfdCkKLUJBU0lDX1RZUEUoSW50NjQsaW50NjRWYWx1ZSxpbnQ2NF90KQotQkFTSUNfVFlQRShTaXplLHNpemVWYWx1ZSxzaXplX3QpCi1CQVNJQ19UWVBFKEZsb2F0LGZsb2F0VmFsdWUsZmxvYXQpCi1CQVNJQ19UWVBFKERvdWJsZSxkb3VibGVWYWx1ZSxkb3VibGUpCi1CQVNJQ19UWVBFKFBvaW50ZXIscHRyVmFsdWUsdm9pZCAqK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AgICAgfQotCi0gICAgICAgICAgICBjYXNlIGtUeXBlTWVzc2FnZToKLSAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICBzcDxBTWVzc2FnZT4gY29weSA9Ci0gICAgICAgICAgICAgICAgICAgIHN0YXRpY19jYXN0PEFNZXNzYWdlICo+KGZyb20tPnUucmVmVmFsdWUpLT5kdXAoKTsKLQotICAgICAgICAgICAgICAgIHRvLT51LnJlZlZhbHVlID0gY29weS5nZXQoKTsKLSAgICAgICAgICAgICAgICB0by0+dS5yZWZWYWx1ZS0+aW5jU3Ryb25nKG1zZy5nZXQoKSk7Ci0gICAgICAgICAgICAgICAgYnJlYWs7Ci0gICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgIGRlZmF1bHQ6Ci0gICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgdG8tPnUgPSBmcm9tLT51OwotICAgICAgICAgICAgICAgIGJyZWFrOwotICAgICAgICAgICAgfQotICAgICAgICB9Ci0gICAgfQotCi0gICAgcmV0dXJuIG1zZzsKLX0KLQotc3RhdGljIHZvaWQgYXBwZW5kSW5kZW50KEFTdHJpbmcgKnMsIGludDMyX3QgaW5kZW50KSB7Ci0gICAgc3RhdGljIGNvbnN0IGNoYXIga1doaXRlc3BhY2VbXSA9Ci0gICAgICAgICIgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIgotICAgICAgICAiICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICI7Ci0KLSAgICBDSEVDS19MVCgoc2l6ZV90KWluZGVudCwgc2l6ZW9mKGtXaGl0ZXNwYWNlKSk7Ci0KLSAgICBzLT5hcHBlbmQoa1doaXRlc3BhY2UsIGluZGVudCk7Ci19Ci0KLXN0YXRpYyBib29sIGlzRm91cmNjKHVpbnQzMl90IHdoYXQpIHsKLSAgICByZXR1cm4gaXNwcmludCh3aGF0ICYgMHhmZikKLSAgICAgICAgJiYgaXNwcmludCgod2hhdCA+PiA4KSAmIDB4Zm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gotICAgICAgICAgICAgICAgIHRtcCA9IFN0cmluZ1ByaW50ZigKLSAgICAgICAgICAgICAgICAgICAgICAgICJpbnQzMl90ICVzID0gJWQiLCBpdGVtLm1OYW1lLCBpdGVtLnUuaW50MzJWYWx1ZSk7Ci0gICAgICAgICAgICAgICAgYnJlYWs7Ci0gICAgICAgICAgICBjYXNlIGtUeXBlSW50NjQ6Ci0gICAgICAgICAgICAgICAgdG1wID0gU3RyaW5nUHJpbnRmKAotICAgICAgICAgICAgICAgICAgICAgICAgImludDY0X3QgJXMgPSAlbGxkIiwgaXRlbS5tTmFtZSwgaXRlbS51LmludDY0VmFsdWUpOwotICAgICAgICAgICAgICAgIGJyZWFrOwotICAgICAgICAgICAgY2FzZSBrVHlwZVNpemU6Ci0gICAgICAgICAgICAgICAgdG1wID0gU3RyaW5nUHJpbnRmKAotICAgICAgICAgICAgICAgICAgICAgICAgInNpemVfdCAlcyA9ICVkIiwgaXRlbS5tTmFtZSwgaXRlbS51LnNpemVWYWx1ZSk7Ci0gICAgICAgICAgICAgICAgYnJlYWs7Ci0gICAgICAgICAgICBjYXNlIGtUeXBlRmxvYXQ6Ci0gICAgICAgICAgICAgICAgdG1wID0gU3RyaW5nUHJpbnRmKAotICAgICAgICAgICAgICAgICAgICAgICAgImZsb2F0ICVzID0gJWYiLCBpdGVtLm1OYW1lLCBpdGVtLnUuZmxvYXRWYWx1ZSk7Ci0gICAgICAgICAgICAgICAgYnJlYWs7Ci0gICAgICAgICAgICBjYXNlIGtUeXBlRG91YmxlOgotICAgICAgICAgICAgICAgIHRtcCA9IFN0cmluZ1ByaW50ZigKLSAgICAgICAgICAgICAgICAgICAgICAgICJkb3VibGUgJXMgPSAlZiIsIGl0ZW0ubU5hbWUsIGl0ZW0udS5kb3VibGVWYWx1ZSk7Ci0gICAgICAgICAgICAgICAgYnJlYWs7Ci0gICAgICAgICAgICBjYXNlIGtUeXBlUG9pbnRlcjoKLSAgICAgICAgICAgICAgICB0bXAgPSBTdHJpbmdQcmludGYoCi0gICAgICAgICAgICAgICAgICAgICAgICAidm9pZCAqJXMgPSAlcCIsIGl0ZW0ubU5hbWUsIGl0ZW0udS5wdHJWYWx1ZSk7Ci0gICAgICAgICAgICAgICAgYnJlYWs7Ci0gICAgICAgICAgICBjYXNlIGtUeXBlU3RyaW5nOgotICAgICAgICAgICAgICAgIHRtcCA9IFN0cmluZ1ByaW50ZigKLSAgICAgICAgICAgICAgICAgICAgICAgICJzdHJpbmcgJXMgPSBcIiVzXCIiLAotICAgICAgICAgICAgICAgICAgICAgICAgaXRlbS5tTmFtZSwKLSAgICAgICAgICAgICAgICAgICAgICAgIGl0ZW0udS5zdHJpbmdWYWx1ZS0+Y19zdHIoKSk7Ci0gICAgICAgICAgICAgICAgYnJlYWs7Ci0gICAgICAgICAgICBjYXNlIGtUeXBlT2JqZWN0OgotICAgICAgICAgICAgICAgIHRtcCA9IFN0cmluZ1ByaW50ZigKLSAgICAgICAgICAgICAgICAgICAgICAgICJSZWZCYXNlIColcyA9ICVwIiwgaXRlbS5tTmFtZSwgaXRlbS51LnJlZlZhbHVlKTsKLSAgICAgICAgICAgICAgICBicmVhazsKLSAgICAgICAgICAgIGNhc2Uga1R5cGVCdWZmZXI6Ci0gICAgICAgICAgICAgICAgdG1wID0gU3RyaW5nUHJpbnRmKAotICAgICAgICAgICAgICAgICAgICAgICAgIkFCdWZmZXIgKiVzID0gJXAiLCBpdGVtLm1OYW1lLCBpdGVtLnUucmVmVmFsdWUpOwotICAgICAgICAgICAgICAgIGJyZWFrOwotICAgICAgICAgICAgY2FzZSBrVHlwZU1lc3NhZ2U6Ci0gICAgICAgICAgICAgICAgdG1wID0gU3RyaW5nUHJpbnRmKAotICAgICAgICAgICAgICAgICAgICAgICAgIkFNZXNzYWdlICVzID0gJXMiLAotICAgICAgICAgICAgICAgICAgICAgICAgaXRlbS5tTmFtZSwKLSAgICAgICAgICAgICAgICAgICAgICAgIHN0YXRpY19jYXN0PEFNZXNzYWdlICo+KAotICAgICAgICAgICAgICAgICAgICAgICAgICAgIGl0ZW0udS5yZWZWYWx1ZSktPmRlYnVnU3RyaW5nKAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpbmRlbnQgKyBzdHJsZW4oaXRlbS5tTmFtZSkgKyAxNCkuY19zdHIoKSk7Ci0gICAgICAgICAgICAgICAgYnJlYWs7Ci0gICAgICAgICAgICBjYXNlIGtUeXBlUmVjdDoKLSAgICAgICAgICAgICAgICB0bXAgPSBTdHJpbmdQcmludGYoCi0gICAgICAgICAgICAgICAgICAgICAgICAiUmVjdCAlcyglZCwgJWQsICVkLCAlZCkiLAotICAgICAgICAgICAgICAgICAgICAgICAgaXRlbS5tTmFtZSwKLSAgICAgICAgICAgICAgICAgICAgICAgIGl0ZW0udS5yZWN0VmFsdWUubUxlZnQsCi0gICAgICAgICAgICAgICAgICAgICAgICBpdGVtLnUucmVjdFZhbHVlLm1Ub3AsCi0gICAgICAgICAgICAgICAgICAgICAgICBpdGVtLnUucmVjdFZhbHVlLm1SaWdodCwKLSAgICAgICAgICAgICAgICAgICAgICAgIGl0ZW0udS5yZWN0VmFsdWUubUJvdHRvbSk7Ci0gICAgICAgICAgICAgICAgYnJlYWs7Ci0gICAgICAgICAgICBkZWZhdWx0OgotICAgICAgICAgICAgICAgIFRSRVNQQVNTKCk7Ci0gICAgICAgIH0KLQotICAgICAgICBhcHBlbmRJbmRlbnQoJnMsIGluZGVudCk7Ci0gICAgICAgIHMuYXBwZW5kKCIgICIpOwotICAgICAgICBzLmFwcGVuZCh0bXApOwotICAgICAgICBzLmFwcGVuZCgiXG4iKTsKLSAgICB9Ci0KLSAgICBhcHBlbmRJbmRlbnQoJnMsIGluZGVudCk7Ci0gICAgcy5hcHBlbmQoIn0iKTsKLQotICAgIHJldHVybiBzOwotfQotCi0vLyBzdGF0aWMKLXNwPEFNZXNzYWdlPiBBTWVzc2FnZTo6RnJvbVBhcmNlbChjb25zdCBQYXJjZWwgJnBhcmNlbCkgewotICAgIGludDMy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AgIH0KLQotICAgICAgICAgICAgY2FzZSBrVHlwZUZsb2F0OgotICAgICAgICAgICAgewotICAgICAgICAgICAgICAgIGl0ZW0tPnUuZmxvYXRWYWx1ZSA9IHBhcmNlbC5yZWFkRmxvYXQoKTsKLSAgICAgICAgICAgICAgICBicmVhazsKLSAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgY2FzZSBrVHlwZURvdWJsZToKLSAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICBpdGVtLT51LmRvdWJsZVZhbHVlID0gcGFyY2VsLnJlYWREb3VibGUoKTsKLSAgICAgICAgICAgICAgICBicmVhazsKLSAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgY2FzZSBrVHlwZVN0cmluZzoKLSAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICBpdGVtLT51LnN0cmluZ1ZhbHVlID0gbmV3IEFTdHJpbmcocGFyY2VsLnJlYWRDU3RyaW5nKCkpOwotICAgICAgICAgICAgICAgIGJyZWFrOwotICAgICAgICAgICAgfQotCi0gICAgICAgICAgICBjYXNlIGtUeXBlTWVzc2FnZToKLSAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICBzcDxBTWVzc2FnZT4gc3ViTXNnID0gQU1lc3NhZ2U6OkZyb21QYXJjZWwocGFyY2VsKTsKLSAgICAgICAgICAgICAgICBzdWJNc2ctPmluY1N0cm9uZyhtc2cuZ2V0KCkpOwotCi0gICAgICAgICAgICAgICAgaXRlbS0+dS5yZWZWYWx1ZSA9IHN1Yk1zZy5nZXQoKTsKLSAgICAgICAgICAgICAgICBicmVhazsKLSAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgZGVmYXVsdDoKLSAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICBBTE9HRSgiVGhpcyB0eXBlIG9mIG9iamVjdCBjYW5ub3QgY3Jvc3MgcHJvY2VzcyBib3VuZGFyaWVzLiIpOwotICAgICAgICAgICAgICAgIFRSRVNQQVNTKCk7Ci0gICAgICAgICAgICB9Ci0gICAgICAgIH0KLSAgICB9Ci0KLSAgICByZXR1cm4gbXNnOwotfQotCi12b2lkIEFNZXNzYWdlOjp3cml0ZVRvUGFyY2VsKFBhcmNlbCAqcGFyY2VsKSBjb25zdCB7Ci0gICAgcGFyY2VsLT53cml0ZUludDMyKHN0YXRpY19jYXN0PGludDMyX3Q+KG1XaGF0KSk7Ci0gICAgcGFyY2VsLT53cml0ZUludDMyKHN0YXRpY19jYXN0PGludDMyX3Q+KG1OdW1JdGVtcykpOwotCi0gICAgZm9yIChzaXplX3QgaSA9IDA7IGkgPCBtTnVtSXRlbXM7ICsraSkgewotICAgICAgICBjb25zdCBJdGVtICZpdGVtID0gbUl0ZW1zW2ldOwotCi0gICAgICAgIHBhcmNlbC0+d3JpdGVDU3RyaW5nKGl0ZW0ubU5hbWUpOwotICAgICAgICBwYXJjZWwtPndyaXRlSW50MzIoc3RhdGljX2Nhc3Q8aW50MzJfdD4oaXRlbS5tVHlwZSkpOwotCi0gICAgICAgIHN3aXRjaCAoaXRlbS5tVHlwZSkgewotICAgICAgICAgICAgY2FzZSBrVHlwZUludDMyOgotICAgICAgICAgICAgewotICAgICAgICAgICAgICAgIHBhcmNlbC0+d3JpdGVJbnQzMihpdGVtLnUuaW50MzJWYWx1ZSk7Ci0gICAgICAgICAgICAgICAgYnJlYWs7Ci0gICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgIGNhc2Uga1R5cGVJbnQ2NDoKLSAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICBwYXJjZWwtPndyaXRlSW50NjQoaXRlbS51LmludDY0VmFsdWUpOwotICAgICAgICAgICAgICAgIGJyZWFrOwotICAgICAgICAgICAgfQotCi0gICAgICAgICAgICBjYXNlIGtUeXBlU2l6ZToKLSAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICBwYXJjZWwtPndyaXRlSW50MzIoc3RhdGljX2Nhc3Q8aW50MzJfdD4oaXRlbS51LnNpemVWYWx1ZSkpOwotICAgICAgICAgICAgICAgIGJyZWFrOwotICAgICAgICAgICAgfQotCi0gICAgICAgICAgICBjYXNlIGtUeXBlRmxvYXQ6Ci0gICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgcGFyY2VsLT53cml0ZUZsb2F0KGl0ZW0udS5mbG9hdFZhbHVlKTsKLSAgICAgICAgICAgICAgICBicmVhazsKLSAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgY2FzZSBrVHlwZURvdWJsZToKLSAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICBwYXJjZWwtPndyaXRlRG91YmxlKGl0ZW0udS5kb3VibGVWYWx1ZSk7Ci0gICAgICAgICAgICAgICAgYnJlYWs7Ci0gICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgIGNhc2Uga1R5cGVTdHJpbmc6Ci0gICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgcGFyY2VsLT53cml0ZUNTdHJpbmcoaXRlbS51LnN0cmluZ1ZhbHVlLT5jX3N0cigpKTsKLSAgICAgICAgICAgICAgICBicmVhazsKLSAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgY2FzZSBrVHlwZU1lc3NhZ2U6Ci0gICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgc3RhdGljX2Nhc3Q8QU1lc3NhZ2UgKj4oaXRlbS51LnJlZlZhbHVlKS0+d3JpdGVUb1BhcmNlbChwYXJjZWwpOwotICAgICAgICAgICAgICAgIGJyZWFrOwotICAgICAgICAgICAgfQotCi0gICAgICAgICAgICBkZWZhdWx0OgotICAgICAgICAgICAgewotICAgICAgICAgICAgICAgIEFMT0dFKCJUaGlzIHR5cGUgb2Ygb2JqZWN0IGNhbm5vdCBjcm9zcyBwcm9jZXNzIGJvdW5kYXJpZXMuIik7Ci0gICAgICAgICAgICAgICAgVFJFU1BBU1MoKTsKLSAgICAgICAgICAgIH0KLSAgICAgICAgfQotICAgIH0KLX0KLQotc2l6ZV90IEFNZXNzYWdlOjpjb3VudEVudHJpZXMoKSBjb25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ICB1aW50MzJfdCBhY2N1bSA9IDA7Ci0gICAgZm9yIChzaXplX3QgaSA9IDA7IGkgPCBuOyArK2kpIHsKLSAgICAgICAgY2hhciBjID0gcy5jX3N0cigpW2ldOwotICAgICAgICB1bnNpZ25lZCB2YWx1ZTsKLSAgICAgICAgaWYgKGMgPj0gJ0EnICYmIGMgPD0gJ1onKSB7Ci0gICAgICAgICAgICB2YWx1ZSA9IGMgLSAnQSc7Ci0gICAgICAgIH0gZWxzZSBpZiAoYyA+PSAnYScgJiYgYyA8PSAneicpIHsKLSAgICAgICAgICAgIHZhbHVlID0gMjYgKyBjIC0gJ2EnOwotICAgICAgICB9IGVsc2UgaWYgKGMgPj0gJzAnICYmIGMgPD0gJzknKSB7Ci0gICAgICAgICAgICB2YWx1ZSA9IDUyICsgYyAtICcwJzsKLSAgICAgICAgfSBlbHNlIGlmIChjID09ICcrJykgewotICAgICAgICAgICAgdmFsdWUgPSA2MjsKLSAgICAgICAgfSBlbHNlIGlmIChjID09ICcvJykgewotICAgICAgICAgICAgdmFsdWUgPSA2MzsKLSAgICAgICAgfSBlbHNlIGlmIChjICE9ICc9JykgewotICAgICAgICAgICAgcmV0dXJuIE5VTEw7Ci0gICAgICAgIH0gZWxzZSB7Ci0gICAgICAgICAgICBpZiAoaSA8IG4gLSBwYWRkaW5nKSB7Ci0gICAgICAgICAgICAgICAgcmV0dXJuIE5VTEw7Ci0gICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgIHZhbHVlID0gMDsKLSAgICAgICAgfQotCi0gICAgICAgIGFjY3VtID0gKGFjY3VtIDw8IDYpIHwgdmFsdWU7Ci0KLSAgICAgICAgaWYgKCgoaSArIDEpICUgNCkgPT0gMCkgewotICAgICAgICAgICAgb3V0W2orK10gPSAoYWNjdW0gPj4gMTYpOwotCi0gICAgICAgICAgICBpZiAoaiA8IG91dExlbikgeyBvdXRbaisrXSA9IChhY2N1bSA+PiA4KSAmIDB4ZmY7IH0gCi0gICAgICAgICAgICBpZiAoa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ICAgICAgIH0KLQotICAgICAgICBsaW5lLmFwcGVuZCgnICcpOwotCi0gICAgICAgIGZvciAoc2l6ZV90IGkgPSAwOyBpIDwgMTY7ICsraSkgewotICAgICAgICAgICAgaWYgKG9mZnNldCArIGkgPj0gc2l6ZSkgewotICAgICAgICAgICAgICAgIGJyZWFrOwotICAgICAgICAgICAgfQotCi0gICAgICAgICAgICBpZiAoaXNwcmludChkYXRhW29mZnNldCArIGldKSkgewotICAgICAgICAgICAgICAgIGxpbmUuYXBwZW5kKChjaGFyKWRhdGFbb2Zmc2V0ICsgaV0pOwotICAgICAgICAgICAgfSBlbHNlIHsKLSAgICAgICAgICAgICAgICBsaW5lLmFwcGVuZCgnLicpOwotICAgICAgICAgICAgfQotICAgICAgICB9Ci0KLSAgICAgICAgQUxPR0koIiVzIiwgbGluZS5jX3N0cigpKTsKLQotICAgICAgICBvZmZzZXQgKz0gMTY7Ci0gICAgfQotfQotCi19ICAvLyBuYW1lc3BhY2UgYW5kcm9pZAotCmRpZmYgLS1naXQgYS9tZWRpYS9saWJzdGFnZWZyaWdodC9odHRwbGl2ZS9BbmRyb2lkLm1rIGIvbWVkaWEvbGlic3RhZ2VmcmlnaHQvaHR0cGxpdmUvQW5kcm9pZC5tawpkZWxldGVkIGZpbGUgbW9kZSAxMDA2NDQKaW5kZXggOTBjYjQ0OC4uMDAwMDAwMAotLS0gYS9tZWRpYS9saWJzdGFnZWZyaWdodC9odHRwbGl2ZS9BbmRyb2lkLm1rCisrKyAvZGV2L251bGwKQEAgLTEsMjEgKzAsMCBAQAotTE9DQUxfUEFUSDo9ICQoY2FsbCBteS1kaXIpCi0KLWluY2x1ZGUgJChDTEVBUl9WQVJTKQotCi1MT0NBTF9TUkNfRklMRVM6PSAgICAgICAgICAgICAgIFwKLSAgICAgICAgTGl2ZURhdGFTb3VyY2UuY3BwICAgICAgXAotICAgICAgICBMaXZlU2Vzc2lvbi5jcHAgICAgICAgICBcCi0gICAgICAgIE0zVVBhcnNlci5jcHA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KCkgJiYgbUZpbmFsUmVzdWx0ID09IE9LKSB7Ci0gICAgICAgICAgICBtQ29uZGl0aW9uLndhaXQobUxvY2spOwotICAgICAgICB9Ci0KLSAgICAgICAgaWYgKG1CdWZmZXJRdWV1ZS5lbXB0eSgpKSB7Ci0gICAgICAgICAgICBpZiAoc2l6ZURvbmUgPiAwKSB7Ci0gICAgICAgICAgICAgICAgbU9mZnNldCArPSBzaXplRG9uZTsKLSAgICAgICAgICAgICAgICByZXR1cm4gc2l6ZURvbmU7Ci0gICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgIHJldHVybiBtRmluYWxSZXN1bHQ7Ci0gICAgICAgIH0KLQotICAgICAgICBzcDxBQnVmZmVyPiBidWZmZXIgPSAqbUJ1ZmZlclF1ZXVlLmJlZ2luKCk7Ci0KLSAgICAgICAgc2l6ZV90IGNvcHkgPSBzaXplIC0gc2l6ZURvbmU7Ci0KLSAgICAgICAgaWYgKGNvcHkgPiBidWZmZXItPnNpemUoKSkgewotICAgICAgICAgICAgY29weSA9IGJ1ZmZlci0+c2l6ZSgpOwotICAgICAgICB9Ci0KLSAgICAgICAgbWVtY3B5KCh1aW50OF90ICopZGF0YSArIHNpemVEb25lLCBidWZmZXItPmRhdGEoKSwgY29weSk7Ci0KLSAgICAgICAgc2l6ZURvbmUgKz0gY29weTsKLQotICAgICAgICBidWZmZXItPnNldFJhbmdlKGJ1ZmZlci0+b2Zmc2V0KCkgKyBjb3B5LCBidWZmZXItPnNpemUoKSAtIGNvcHkpOwotCi0gICAgICAgIGlmIChidWZmZXItPnNpemUoKSA9PSAwKSB7Ci0gICAgICAgICAgICBtQnVmZmVyUXVldWUuZXJhc2UobUJ1ZmZlclF1ZXVlLmJlZ2luKCkpOwotICAgICAgICB9Ci0gICAgfQotCi0gICAgbU9mZnNldCArPSBzaXplRG9uZTsKLQotICAgIHJldHVybiBzaXplRG9uZTsKLX0KLQotdm9pZCBMaXZlRGF0YVNvdXJjZTo6cXVldWVCdWZmZXIoY29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ly8iLCA4KSkgewotICAgICAgICByZXR1cm4gRVJST1JfVU5TVVBQT1JURUQ7Ci0gICAgfSBlbHNlIHsKLSAgICAgICAgewotICAgICAgICAgICAgTXV0ZXg6OkF1dG9sb2NrIGF1dG9Mb2NrKG1Mb2NrKTsKLQotICAgICAgICAgICAgaWYgKG1EaXNjb25uZWN0UGVuZGluZykgewotICAgICAgICAgICAgICAgIHJldHVybiBFUlJPUl9JTzsKLSAgICAgICAgICAgIH0KLSAgICAgICAgfQotCi0gICAgICAgIEtleWVkVmVjdG9yPFN0cmluZzgsIFN0cmluZzg+IGhlYWRlcnMgPSBtRXh0cmFIZWFkZXJzOwotICAgICAgICBpZiAocmFuZ2Vfb2Zmc2V0ID4gMCB8fCByYW5nZV9sZW5ndGggPj0gMCkgewotICAgICAgICAgICAgaGVhZGVycy5hZGQoCi0gICAgICAgICAgICAgICAgICAgIFN0cmluZzgoIlJhbmdlIiksCi0gICAgICAgICAgICAgICAgICAgIFN0cmluZzgoCi0gICAgICAgICAgICAgICAgICAgICAgICBTdHJpbmdQcmludGYoCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgImJ5dGVzPSVsbGQtJXMiLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJhbmdlX29mZnNldCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICByYW5nZV9sZW5ndGggPCAwCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgID8gIiIgOiBTdHJpbmdQcmludGYoIiVsbGQiLCByYW5nZV9vZmZzZXQgKyByYW5nZV9sZW5ndGggLSAxKS5jX3N0cigpKS5jX3N0cigpKSk7Ci0gICAgICAgIH0KLSAgICAgICAgc3RhdHVzX3QgZXJyID0gbUhUVFBEYXRhU291cmNlLT5jb25uZWN0KHVybCwgJmhlYWRlcnMpOwotCi0gICAgICAgIGlmIChlcnIgIT0gT0spIHsKLSAgICAgICAgICAgIHJldHVybiBlcnI7Ci0gICAgICAgIH0KLQotICAgICAgICBzb3VyY2UgPS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Nfc3RyKCksICZ1bmNoYW5nZWQpOwotICAgICAgICBpZiAocGxheWxpc3QgPT0gTlVMTCkgewotICAgICAgICAgICAgaWYgKHVuY2hhbmdlZCkgewotICAgICAgICAgICAgICAgIC8vIFdlIHN1Y2NlZWRlZCBpbiBmZXRjaGluZyB0aGUgcGxheWxpc3QsIGJ1dCBpdCB3YXMKLSAgICAgICAgICAgICAgICAvLyB1bmNoYW5nZWQgZnJvbSB0aGUgbGFzdCB0aW1lIHdlIHRyaWVkLgotICAgICAgICAgICAgfSBlbHNlIHsKLSAgICAgICAgICAgICAgICBBTE9HRSgiZmFpbGVkIHRvIGxvYWQgcGxheWxpc3QgYXQgdXJsICclcyciLCB1cmwuY19zdHIoKSk7Ci0gICAgICAgICAgICAgICAgbURhdGFTb3VyY2UtPnF1ZXVlRU9TKEVSUk9SX0lPKTsKLSAgICAgICAgICAgICAgICByZXR1cm47Ci0gICAgICAgICAgICB9Ci0gICAgICAgIH0gZWxzZSB7Ci0gICAgICAgICAgICBtUGxheWxpc3QgPSBwbGF5bGlzdDsKLSAgICAgICAgfQotCi0gICAgICAgIGlmIChmaXJzdFRpbWUpIHsKLSAgICAgICAgICAgIE11dGV4OjpBdXRvbG9jayBhdXRvTG9jayhtTG9jayk7Ci0KLSAgICAgICAgICAgIGlmICghbVBsYXlsaXN0LT5pc0NvbXBsZXRlKCkpIHsKLSAgICAgICAgICAgICAgICBtRHVyYXRpb25VcyA9IC0xOwotICAgICAgICAgICAgfSBlbHNlIHsKLSAgICAgICAgICAgICAgICBtRHVyYXRpb25VcyA9IDA7Ci0gICAgICAgICAgICAgICAgZm9yIChzaXplX3QgaSA9IDA7IGkgPCBtUGxheWxpc3QtPnNpemUoKTsgKytpKSB7Ci0gICAgICAgICAgICAgICAgICAgIHNwPEFNZXNzYWdlPiBpdGVtTWV0YTsKLSAgICAgICAgICAgICAgICAgICAgQ0hFQ0sobVBsYXlsaXN0LT5pdGVtQXQoCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGksIE5VTEwgLyogdXJpICovLCAmaXRlbU1ldGEpKTsKLQotICAgICAgICAgICAgICAgICAgICBpbnQ2NF90IGl0ZW1EdXJhdGlvblVzOwotICAgICAgICAgICAgICAgICAgICBDSEVDSyhpdGVtTWV0YS0+ZmluZEludDY0KCJkdXJhdGlvblVzIiwgJml0ZW1EdXJhdGlvblVzKSk7Ci0KLSAgICAgICAgICAgICAgICAgICAgbUR1cmF0aW9uVXMgKz0gaXRlbUR1cmF0aW9uVXM7Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgfQotICAgICAgICB9Ci0KLSAgICAgICAgbUxhc3RQbGF5bGlzdEZldGNoVGltZVVzID0gQUxvb3Blcjo6R2V0Tm93VXMoKTsKLSAgICB9Ci0KLSAgICBpbnQzMl90IGZpcnN0U2VxTnVtYmVySW5QbGF5bGlzdDsKLSAgICBpZiAobVBsYXlsaXN0LT5tZXRhKCkgPT0gTlVMTCB8fCAhbVBsYXlsaXN0LT5tZXRhKCktPmZpbmRJbnQzMigKLSAgICAgICAgICAgICAgICAibWVkaWEtc2VxdWVuY2UiLCAmZmlyc3RTZXFOdW1iZXJJblBsYXlsaXN0KSkgewotICAgICAgICBmaXJzdFNlcU51bWJlckluUGxheWxpc3QgPSAwOwotICAgIH0KLQotICAgIGJvb2wgc2Vla0Rpc2NvbnRpbnVpdHkgPSBmYWxzZTsKLSAgICBib29sIGV4cGxpY2l0RGlzY29udGludWl0eSA9IGZhbHNlOwotICAgIGJvb2wgYmFuZHdpZHRoQ2hhbmdlZCA9IGZhbHNlOwotCi0gICAgaWYgKG1TZWVrVGltZVVzID49IDApIHsKLSAgICAgICAgaWYgKG1QbGF5bGlzdC0+aXNDb21wbGV0ZSgpKSB7Ci0gICAgICAgICAgICBzaXplX3QgaW5kZXggPSAwOwotICAgICAgICAgICAgaW50NjRfdCBzZWdtZW50U3RhcnRVcyA9IDA7Ci0gICAgICAgICAgICB3aGlsZSAoaW5kZXggPCBtUGxheWxpc3QtPnNpemUoKSkgewotICAgICAgICAgICAgICAgIHNwPEFNZXNzYWdlPiBpdGVtTWV0YTsKLSAgICAgICAgICAgICAgICBDSEVDSyhtUGxheWxpc3QtPml0ZW1BdCgKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBpbmRleCwgTlVMTCAvKiB1cmkgKi8sICZpdGVtTWV0YSkpOwotCi0gICAgICAgICAgICAgICAgaW50NjRfdCBpdGVtRHVyYXRpb25VczsKLSAgICAgICAgICAgICAgICBDSEVDSyhpdGVtTWV0YS0+ZmluZEludDY0KCJkdXJhdGlvblVzIiwgJml0ZW1EdXJhdGlvblVzKSk7Ci0KLSAgICAgICAgICAgICAgICBpZiAobVNlZWtUaW1lVXMgPCBzZWdtZW50U3RhcnRVcyArIGl0ZW1EdXJhdGlvblVzKSB7Ci0gICAgICAgICAgICAgICAgICAgIGJyZWFrOwotICAgICAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgICAgIHNlZ21lbnRTdGFydFVzICs9IGl0ZW1EdXJhdGlvblVzOwotICAgICAgICAgICAgICAgICsraW5kZXg7Ci0gICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgIGlmIChpbmRleCA8IG1QbGF5bGlzdC0+c2l6ZSgpKSB7Ci0gICAgICAgICAgICAgICAgaW50MzJfdCBuZXdTZXFOdW1iZXIgPSBmaXJzdFNlcU51bWJlckluUGxheWxpc3QgKyBpbmRleDsKLQotICAgICAgICAgICAgICAgIGlmIChuZXdTZXFOdW1iZXIgIT0gbVNlcU51bWJlcikgewotICAgICAgICAgICAgICAgICAgICBBTE9HSSgic2Vla2luZyB0byBzZXEgbm8gJWQiLCBuZXdTZXFOdW1iZXIpOwotCi0gICAgICAgICAgICAgICAgICAgIG1TZXFOdW1iZXIgPSBuZXdTZXFOdW1iZXI7Ci0KLSAgICAgICAgICAgICAgICAgICAgbURhdGFTb3VyY2UtPnJlc2V0KCk7Ci0KLSAgICAgICAgICAgICAgICAgICAgLy8gcmVzZXRpbmcgdGhlIGRhdGEgc291cmNlIHdpbGwgaGF2ZSBoYWQgdGhlCi0gICAgICAgICAgICAgICAgICAgIC8vIHNpZGUgZWZmZWN0IG9mIGRpc2NhcmRpbmcgYW55IHByZXZpb3VzbHkgcXVldWVkCi0gICAgICAgICAgICAgICAgICAgIC8vIGJhbmR3aWR0aCBjaGFuZ2UgZGlzY29udGludWl0eS4KLSAgICAgICAgICAgICAgICAgICAgLy8gVGhlcmVmb3JlIHdlJ2xsIG5lZWQgdG8gdHJlYXQgdGhlc2Ugc2VlawotICAgICAgICAgICAgICAgICAgICAvLyBkaXNjb250aW51aXRpZXMgYXMgaW52b2x2aW5nIGEgYmFuZHdpZHRoIGNoYW5nZQotICAgICAgICAgICAgICAgICAgICAvLyBldmVuIGlmIHRoZXkgYXJlbid0IGRpcmVjdGx5LgotICAgICAgICAgICAgICAgICAgICBzZWVrRGlzY29udGludWl0eSA9IHRydWU7Ci0gICAgICAgICAgICAgICAgICAgIGJhbmR3aWR0aENoYW5nZWQgPSB0cnVlOwotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgIH0KLSAgICAgICAgfQotCi0gICAgICAgIG1TZWVrVGltZVVzID0gLTE7Ci0KLSAgICAgICAgTXV0ZXg6OkF1dG9sb2NrIGF1dG9Mb2NrKG1Mb2NrKTsKLSAgICAgICAgbVNlZWtEb25lID0gdHJ1ZTsKLSAgICAgICAgbUNvbmRpdGlvbi5icm9hZGNhc3QoKTsKLSAgICB9Ci0KLSAgICBpZiAobVNlcU51bWJlciA8IDApIHsKLSAgICAgICAgbVNlcU51bWJlciA9IGZpcnN0U2VxTnVtYmVySW5QbGF5bGlzdDsKLSAgICB9Ci0KLSAgICBpbnQzMl90IGxhc3RTZXFOdW1iZXJJblBsYXlsaXN0ID0KLSAgICAgICAgZmlyc3RTZXFOdW1iZXJJblBsYXlsaXN0ICsgKGludDMyX3QpbVBsYXlsaXN0LT5zaXplKCkgLSAxOwotCi0gICAgaWYgKG1TZXFOdW1iZXIgPCBmaXJzdFNlcU51bWJlckluUGxheWxpc3QKLSAgICAgICAgICAgIHx8IG1TZXFOdW1iZXIgPiBsYXN0U2VxTnVtYmVySW5QbGF5bGlzdCkgewotICAgICAgICBpZiAobVByZXZCYW5kd2lkdGhJbmRleCAhPSAoc3NpemVfdCliYW5kd2lkdGhJbmRleCkgewotICAgICAgICAgICAgLy8gR28gYmFjayB0byB0aGUgcHJldmlvdXMgYmFuZHdpZHRoLgotCi0gICAgICAgICAgICBBTE9HSSgibmV3IGJhbmR3aWR0aCBkb2VzIG5vdCBoYXZlIHRoZSBzZXF1ZW5jZSBudW1iZXIgIgotICAgICAgICAgICAgICAgICAid2UncmUgbG9va2luZyBmb3IsIHN3aXRjaGluZyBiYWNrIHRvIHByZXZpb3VzIGJhbmR3aWR0aCIpOwotCi0gICAgICAgICAgICBtTGFzdFBsYXlsaXN0RmV0Y2hUaW1lVXMgPSAtMTsKLSAgICAgICAgICAgIGJhbmR3aWR0aEluZGV4ID0gbVByZXZCYW5kd2lkdGhJbmRleDsKLSAgICAgICAgICAgIGdvdG8gcmluc2VfcmVwZWF0OwotICAgICAgICB9Ci0KLSAgICAgICAgaWYgKCFtUGxheWxpc3QtPmlzQ29tcGxldGUoKSAmJiBtTnVtUmV0cmllcyA8IGtNYXhOdW1SZXRyaWVzKSB7Ci0gICAgICAgICAgICArK21OdW1SZXRyaWVzOwotCi0gICAgICAgICAgICBpZiAobVNlcU51bWJlciA+IGxhc3RTZXFOdW1iZXJJblBsYXlsaXN0KSB7Ci0gICAgICAgICAgICAgICAgbUxhc3RQbGF5bGlzdEZldGNoVGltZVVzID0gLTE7Ci0gICAgICAgICAgICAgICAgcG9zdE1vbml0b3JRdWV1ZSgzMDAwMDAwbGwpOwotICAgICAgICAgICAgICAgIHJldHVybjsKLSAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgLy8gd2UndmUgbWlzc2VkIHRoZSBib2F0LCBsZXQncyBzdGFydCBmcm9tIHRoZSBsb3dlc3Qgc2VxdWVuY2UKLSAgICAgICAgICAgIC8vIG51bWJlciBhdmFpbGFibGUgYW5kIHNpZ25hbCBhIGRpc2NvbnRpbnVpdHkuCi0KLSAgICAgICAgICAgIEFMT0dJKCJXZSd2ZSBtaXNzZWQgdGhlIGJvYXQsIHJlc3RhcnRpbmcgcGxheWJhY2suIik7Ci0gICAgICAgICAgICBtU2VxTnVtYmVyID0gbGFzdFNlcU51bWJlckluUGxheWxpc3Q7Ci0gICAgICAgICAgICBleHBsaWNpdERpc2NvbnRpbnVpdHkgPSB0cnVlOwotCi0gICAgICAgICAgICAvLyBmYWxsIHRocm91Z2gKLSAgICAgICAgfSBlbHNlIHsKLSAgICAgICAgICAgIEFMT0dFKCJDYW5ub3QgZmluZCBzZXF1ZW5jZSBudW1iZXIgJWQgaW4gcGxheWxpc3QgIgotICAgICAgICAgICAgICAgICAiKGNvbnRhaW5zICVkIC0gJWQpIiwKLSAgICAgICAgICAgICAgICAgbVNlcU51bWJlciwgZmlyc3RTZXFOdW1iZXJJblBsYXlsaXN0LAotICAgICAgICAgICAgICAgICBmaXJzdFNlcU51bWJlckluUGxheWxpc3QgKyBtUGxheWxpc3QtPnNpemUoKSAtIDEpOwotCi0gICAgICAgICAgICBtRGF0YVNvdXJjZS0+cXVldWVFT1MoRVJST1JfRU5EX09GX1NUUkVBTSk7Ci0gICAgICAgICAgICByZXR1cm47Ci0gICAgICAgIH0KLSAgICB9Ci0KLSAgICBtTnVtUmV0cmllcyA9IDA7Ci0KLSAgICBBU3RyaW5nIHVyaTsKLSAgICBzcDxBTWVzc2FnZT4gaXRlbU1ldGE7Ci0gICAgQ0hFQ0sobVBsYXlsaXN0LT5pdGVtQXQoCi0gICAgICAgICAgICAgICAgbVNlcU51bWJlciAtIGZpcnN0U2VxTnVtYmVySW5QbGF5bGlzdCwKLSAgICAgICAgICAgICAgICAmdXJpLAotICAgICAgICAgICAgICAgICZpdGVtTWV0YSkpOwotCi0gICAgaW50MzJfdCB2YWw7Ci0gICAgaWYgKGl0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ICBBTE9HRSgiVW5zdXBwb3J0ZWQgY2lwaGVyIG1ldGhvZCAnJXMnIiwgbWV0aG9kLmNfc3RyKCkpOwotICAgICAgICByZXR1cm4gRVJST1JfVU5TVVBQT1JURUQ7Ci0gICAgfQotCi0gICAgQVN0cmluZyBrZXlVUkk7Ci0gICAgaWYgKCFpdGVtTWV0YS0+ZmluZFN0cmluZygiY2lwaGVyLXVyaSIsICZrZXlVUkkpKSB7Ci0gICAgICAgIEFMT0dFKCJNaXNzaW5nIGtleSB1cmkiKTsKLSAgICAgICAgcmV0dXJuIEVSUk9SX01BTEZPUk1FRDsKLSAgICB9Ci0KLSAgICBzc2l6ZV90IGluZGV4ID0gbUFFU0tleUZvclVSSS5pbmRleE9mS2V5KGtleVVSSSk7Ci0KLSAgICBzcDxBQnVmZmVyPiBrZXk7Ci0gICAgaWYgKGluZGV4ID49IDApIHsKLSAgICAgICAga2V5ID0gbUFFU0tleUZvclVSSS52YWx1ZUF0KGluZGV4KTsKLSAgICB9IGVsc2UgewotICAgICAgICBrZXkgPSBuZXcgQUJ1ZmZlcigxNik7Ci0KLSAgICAgICAgc3A8SFRUUEJhc2U+IGtleVNvdXJjZSA9Ci0gICAgICAgICAgICAgIEhUVFBCYXNlOjpDcmVhdGUoCi0gICAgICAgICAgICAgICAgICAobUZsYWdzICYga0ZsYWdJbmNvZ25pdG8pCi0gICAgICAgICAgICAgICAgICAgID8gSFRUUEJhc2U6OmtGbGFnSW5jb2duaXRvCi0gICAgICAgICAgICAgICAgICAgIDogMCk7Ci0KLSAgICAgICAgaWYgKG1VSURWYWxpZCkgewotICAgICAgICAgICAga2V5U291cmNlLT5zZXRVSUQobVVJRCk7Ci0gICAgICAgIH0KLQotICAgICAgICBzdGF0dXNfdCBlcnIgPQotICAgICAgICAgICAga2V5U291cmNlLT5jb25uZWN0KAotICAgICAgICAgICAgICAgICAgICBrZXlVUkkuY19zdHIoKSwKLSAgICAgICAgICAgICAgICAgICAgbUV4dHJhSGVhZGVycy5pc0VtcHR5KCkgPyBOVUxMIDogJm1FeHRyYUhlYWRlcnMpOwotCi0gICAgICAgIGlmIChlcnIgPT0gT0spIHsKLSAgICAgICAgICAgIHNpemVfdCBvZmZzZXQgPSAwOwotICAgICAgICAgICAgd2hpbGUgKG9mZnNldCA8IDE2KSB7Ci0gICAgICAgICAgICAgICAgc3NpemVfdCBuID0ga2V5U291cmNlLT5yZWFkQXQoCi0gICAgICAgICAgICAgICAgICAgICAgICBvZmZzZXQsIGtleS0+ZGF0YSgpICsgb2Zmc2V0LCAxNiAtIG9mZnNldCk7Ci0gICAgICAgICAgICAgICAgaWYgKG4gPD0gMCkgewotICAgICAgICAgICAgICAgICAgICBlcnIgPSBFUlJPUl9JTzsKLSAgICAgICAgICAgICAgICAgICAgYnJlYWs7Ci0gICAgICAgICAgICAgICAgfQotCi0gICAgICAgICAgICAgICAgb2Zmc2V0ICs9IG47Ci0gICAgICAgICAgICB9Ci0gICAgICAgIH0KLQotICAgICAgICBpZiAoZXJyICE9IE9LKSB7Ci0gICAgICAgICAgICBBTE9HRSgiZmFpbGVkIHRvIGZldGNoIGNpcGhlciBrZXkgZnJvbSAnJXMnLiIsIGtleVVSSS5jX3N0cigpKTsKLSAgICAgICAgICAgIHJldHVybiBFUlJPUl9JTzsKLSAgICAgICAgfQotCi0gICAgICAgIG1BRVNLZXlGb3JVUkkuYWRkKGtleVVSSSwga2V5KTsKLSAgICB9Ci0KLSAgICBBRVNfS0VZIGFlc19rZXk7Ci0gICAgaWYgKEFFU19zZXRfZGVjcnlwdF9rZXkoa2V5LT5kYXRhKCksIDEyOCwgJmFlc19rZXkpICE9IDApIHsKLSAgICAgICAgQUxPR0UoImZhaWxlZCB0byBzZXQgQUVTIGRlY3J5cHRpb24ga2V5LiIpOwotICAgICAgICByZXR1cm4gVU5LTk9XTl9FUlJPUjsKLSAgICB9Ci0KLSAgICB1bnNpZ25lZCBjaGFyIGFlc19pdmVjWzE2XTsKLQotICAgIEFTdHJpbmcgaXY7Ci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AgICAgfQotICAgICAgICBpZiAob2Zmc2V0TEYgPj0gc2l6ZSkgewotICAgICAgICAgICAgYnJlYWs7Ci0gICAgICAgIH0KLQotICAgICAgICBBU3RyaW5nIGxpbmU7Ci0gICAgICAgIGlmIChvZmZzZXRMRiA+IG9mZnNldCAmJiBkYXRhW29mZnNldExGIC0gMV0gPT0gJ1xyJykgewotICAgICAgICAgICAgbGluZS5zZXRUbygmZGF0YVtvZmZzZXRdLCBvZmZzZXRMRiAtIG9mZnNldCAtIDEpOwotICAgICAgICB9IGVsc2UgewotICAgICAgICAgICAgbGluZS5zZXRUbygmZGF0YVtvZmZzZXRdLCBvZmZzZXRMRiAtIG9mZnNldCk7Ci0gICAgICAgIH0KLQotICAgICAgICAvLyBBTE9HSSgiIyVzIyIsIGxpbmUuY19zdHIoKSk7Ci0KLSAgICAgICAgaWYgKGxpbmUuZW1wdHkoKSkgewotICAgICAgICAgICAgb2Zmc2V0ID0gb2Zmc2V0TEYgKyAxOwotICAgICAgICAgICAgY29udGludWU7Ci0gICAgICAgIH0KLQotICAgICAgICBpZiAobGluZU5vID09IDAgJiYgbGluZSA9PSAiI0VYVE0zVSIpIHsKLSAgICAgICAgICAgIG1Jc0V4dE0zVSA9IHRydWU7Ci0gICAgICAgIH0KLQotICAgICAgICBpZiAobUlzRXh0TTNVKSB7Ci0gICAgICAgICAgICBzdGF0dXNfdCBlcnIgPSBPSzsKLQotICAgICAgICAgICAgaWYgKGxpbmUuc3RhcnRzV2l0aCgiI0VYVC1YLVRBUkdFVERVUkFUSU9OIikpIHsKLSAgICAgICAgICAgICAgICBpZiAobUlzVmFyaWFudFBsYXlsaXN0KSB7Ci0gICAgICAgICAgICAgICAgICAgIHJldHVybiBFUlJPUl9NQUxGT1JNRUQ7Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgIGVyciA9IHBhcnNlTWV0YURhdGEobGluZSwgJm1NZXRhLCAidGFyZ2V0LWR1cmF0aW9uIik7Ci0gICAgICAgICAgICB9IGVsc2UgaWYgKGxpbmUuc3RhcnRzV2l0aCgiI0VYVC1YLU1FRElBLVNFUVVFTkNFIikpIHsKLSAgICAgICAgICAgICAgICBpZiAobUlzVmFyaWFudFBsYXlsaXN0KSB7Ci0gICAgICAgICAgICAgICAgICAgIHJldHVybiBFUlJPUl9NQUxGT1JNRUQ7Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgIGVyciA9IHBhcnNlTWV0YURhdGEobGluZSwgJm1NZXRhLCAibWVkaWEtc2VxdWVuY2UiKTsKLSAgICAgICAgICAgIH0gZWxzZSBpZiAobGluZS5zdGFydHNXaXRoKCIjRVhULVgtS0VZIikpIHsKLSAgICAgICAgICAgICAgICBpZiAobUlzVmFyaWFudFBsYXlsaXN0KSB7Ci0gICAgICAgICAgICAgICAgICAgIHJldHVybiBFUlJPUl9NQUxGT1JNRUQ7Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgIGVyciA9IHBhcnNlQ2lwaGVySW5mbyhsaW5lLCAmaXRlbU1ldGEsIG1CYXNlVVJJKTsKLSAgICAgICAgICAgIH0gZWxzZSBpZiAobGluZS5zdGFydHNXaXRoKCIjRVhULVgtRU5ETElTVCIpKSB7Ci0gICAgICAgICAgICAgICAgbUlzQ29tcGxldGUgPSB0cnVlOwotICAgICAgICAgICAgfSBlbHNlIGlmIChsaW5lLnN0YXJ0c1dpdGgoIiNFWFRJTkYiKSkgewotICAgICAgICAgICAgICAgIGlmIChtSXNWYXJpYW50UGxheWxpc3QpIHsKLSAgICAgICAgICAgICAgICAgICAgcmV0dXJuIEVSUk9SX01BTEZPUk1FRDsKLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgZXJyID0gcGFyc2VNZXRhRGF0YUR1cmF0aW9uKGxpbmUsICZpdGVtTWV0YSwgImR1cmF0aW9uVXMiKTsKLSAgICAgICAgICAgIH0gZWxzZSBpZiAobGluZS5zdGFydHNXaXRoKCIjRVhULVgtRElTQ09OVElOVUlUWSIpKSB7Ci0gICAgICAgICAgICAgICAgaWYgKG1Jc1ZhcmlhbnRQbGF5bGlzdCkgewotICAgICAgICAgICAgICAgICAgICByZXR1cm4gRVJST1JfTUFMRk9STUVEOwotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICBpZiAoaXRlbU1ldGEgPT0gTlVMTCkgewotICAgICAgICAgICAgICAgICAgICBpdGVtTWV0YSA9IG5ldyBBTWVzc2FnZTsKLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgaXRlbU1ldGEtPnNldEludDMyKCJkaXNjb250aW51aXR5IiwgdHJ1ZSk7Ci0gICAgICAgICAgICB9IGVsc2UgaWYgKGxpbmUuc3RhcnRzV2l0aCgiI0VYVC1YLVNUUkVBTS1JTkYiKSkgewotICAgICAgICAgICAgICAgIGlmIChtTWV0YSAhPSBOVUxMKSB7Ci0gICAgICAgICAgICAgICAgICAgIHJldHVybiBFUlJPUl9NQUxGT1JNRUQ7Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgIG1Jc1ZhcmlhbnRQbGF5bGlzdCA9IHRydWU7Ci0gICAgICAgICAgICAgICAgZXJyID0gcGFyc2VTdHJlYW1JbmYobGluZSwgJml0ZW1NZXRhKTsKLSAgICAgICAgICAgIH0gZWxzZSBpZiAobGluZS5zdGFydHNXaXRoKCIjRVhULVgtQllURVJBTkdFIikpIHsKLSAgICAgICAgICAgICAgICBpZiAobUlzVmFyaWFudFBsYXlsaXN0KSB7Ci0gICAgICAgICAgICAgICAgICAgIHJldHVybiBFUlJPUl9NQUxGT1JNRUQ7Ci0gICAgICAgICAgICAgICAgfQotCi0gICAgICAgICAgICAgICAgdWludDY0X3QgbGVuZ3RoLCBvZmZzZXQ7Ci0gICAgICAgICAgICAgICAgZXJyID0gcGFyc2VCeXRlUmFuZ2UobGluZSwgc2VnbWVudFJhbmdlT2Zmc2V0LCAmbGVuZ3RoLCAmb2Zmc2V0KTsKLQotICAgICAgICAgICAgICAgIGlmIChlcnIgPT0gT0spIHsKLSAgICAgICAgICAgICAgICAgICAgaWYgKGl0ZW1NZXRhID09IE5VTEwpIHsKLSAgICAgICAgICAgICAgICAgICAgICAgIGl0ZW1NZXRhID0gbmV3IEFNZXNzYWdlOwotICAgICAgICAgICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgICAgICAgICAgaXRlbU1ldGEtPnNldEludDY0KCJyYW5nZS1vZmZzZXQiLCBvZmZzZXQpOwotICAgICAgICAgICAgICAgICAgICBpdGVtTWV0YS0+c2V0SW50NjQoInJhbmdlLWxlbmd0aCIsIGxlbmd0aCk7Ci0KLSAgICAgICAgICAgICAgICAgICAgc2VnbWVudFJhbmdlT2Zmc2V0ID0gb2Zmc2V0ICsgbGVuZ3RoOwotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgaWYgKGVyciAhPSBPSykgewotICAgICAgICAgICAgICAgIHJldHVybiBlcnI7Ci0gICAgICAgICAgICB9Ci0gICAgICAgIH0KLQotICAgICAgICBpZiAoIWxpbmUuc3RhcnRzV2l0aCgiIyIpKSB7Ci0gICAgICAgICAgICBpZiAoIW1Jc1ZhcmlhbnRQbGF5bGlzdCkgewotICAgICAgICAgICAgICAgIGludDY0X3QgZHVyYXRpb25VczsKLSAgICAgICAgICAgICAgICBpZiAoaXRlbU1ldGEgPT0gTlVMTAotICAgICAgICAgICAgICAgICAgICAgICAgfHwgIWl0ZW1NZXRhLT5maW5kSW50NjQoImR1cmF0aW9uVXMiLCAmZHVyYXRpb25VcykpIHsKLSAgICAgICAgICAgICAgICAgICAgcmV0dXJuIEVSUk9SX01BTEZPUk1FRDsKLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgIG1JdGVtcy5wdXNoKCk7Ci0gICAgICAgICAgICBJdGVtICppdGVtID0gJm1JdGVtcy5lZGl0SXRlbUF0KG1JdGVtcy5zaXplKCkgLSAxKTsKLQotICAg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9mZnNldCk7Ci0gICAgICAgIGF0dHIudHJpbSgpOwotCi0gICAgICAgIG9mZnNldCA9IGVuZCArIDE7Ci0KLSAgICAgICAgc3NpemVfdCBlcXVhbFBvcyA9IGF0dHIuZmluZCgiPSIpOwotICAgICAgICBpZiAoZXF1YWxQb3MgPCAwKSB7Ci0gICAgICAgICAgICBjb250aW51ZTsKLSAgICAgICAgfQotCi0gICAgICAgIEFTdHJpbmcga2V5KGF0dHIsIDAsIGVxdWFsUG9zKTsKLSAgICAgICAga2V5LnRyaW0oKTsKLQotICAgICAgICBBU3RyaW5nIHZhbChhdHRyLCBlcXVhbFBvcyArIDEsIGF0dHIuc2l6ZSgpIC0gZXF1YWxQb3MgLSAxKTsKLSAgICAgICAgdmFsLnRyaW0oKTsKLQotICAgICAgICBBTE9HVigia2V5PSVzIHZhbHVlPSVzIiwga2V5LmNfc3RyKCksIHZhbC5jX3N0cigpKTsKLQotICAgICAgICBpZiAoIXN0cmNhc2VjbXAoImJhbmR3aWR0aCIsIGtleS5jX3N0cigpKSkgewotICAgICAgICAgICAgY29uc3QgY2hhciAqcyA9IHZhbC5jX3N0cigpOwotICAgICAgICAgICAgY2hhciAqZW5kOwotICAgICAgICAgICAgdW5zaWduZWQgbG9uZyB4ID0gc3RydG91bChzLCAmZW5kLCAxMCk7Ci0KLSAgICAgICAgICAgIGlmIChlbmQgPT0gcyB8fCAqZW5kICE9ICdcMCcpIHsKLSAgICAgICAgICAgICAgICAvLyBtYWxmb3JtZWQKLSAgICAgICAgICAgICAgICBjb250aW51ZTsKLSAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgaWYgKG1ldGEtPmdldCgpID09IE5VTEwpIHsKLSAgICAgICAgICAgICAgICAqbWV0YSA9IG5ldyBBTWVzc2FnZTsKLSAgICAgICAgICAgIH0KLSAgICAgICAgICAgICgqbWV0YSktPnNldEludDMyKCJiYW5kd2lkdGgiLCB4KTsKLSAgICAgICAgfQotICAgIH0KLQotICAgIHJldHVybiBPSzsKL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JPUl9NQUxGT1JNRUQ7Ci0gICAgfQotCi0gICAgc2l6ZV90IG9mZnNldCA9IGNvbG9uUG9zICsgMTsKLQotICAgIHdoaWxlIChvZmZzZXQgPCBsaW5lLnNpemUoKSkgewotICAgICAgICBzc2l6ZV90IGVuZCA9IEZpbmROZXh0VW5xdW90ZWQobGluZSwgJywnLCBvZmZzZXQpOwotICAgICAgICBpZiAoZW5kIDwgMCkgewotICAgICAgICAgICAgZW5kID0gbGluZS5zaXplKCk7Ci0gICAgICAgIH0KLQotICAgICAgICBBU3RyaW5nIGF0dHIobGluZSwgb2Zmc2V0LCBlbmQgLSBvZmZzZXQpOwotICAgICAgICBhdHRyLnRyaW0oKTsKLQotICAgICAgICBvZmZzZXQgPSBlbmQgKyAxOwotCi0gICAgICAgIHNzaXplX3QgZXF1YWxQb3MgPSBhdHRyLmZpbmQoIj0iKTsKLSAgICAgICAgaWYgKGVxdWFsUG9zIDwgMCkgewotICAgICAgICAgICAgY29udGludWU7Ci0gICAgICAgIH0KLQotICAgICAgICBBU3RyaW5nIGtleShhdHRyLCAwLCBlcXVhbFBvcyk7Ci0gICAgICAgIGtleS50cmltKCk7Ci0KLSAgICAgICAgQVN0cmluZyB2YWwoYXR0ciwgZXF1YWxQb3MgKyAxLCBhdHRyLnNpemUoKSAtIGVxdWFsUG9zIC0gMSk7Ci0gICAgICAgIHZhbC50cmltKCk7Ci0KLSAgICAgICAgQUxPR1YoImtleT0lcyB2YWx1ZT0lcyIsIGtleS5jX3N0cigpLCB2YWwuY19zdHIoKSk7Ci0KLSAgICAgICAga2V5LnRvbG93ZXIoKTsKLQotICAgICAgICBpZiAoa2V5ID09ICJtZXRob2QiIHx8IGtleSA9PSAidXJpIiB8fCBrZXkgPT0gIml2IikgewotICAgICAgICAgICAgaWYgKG1ldGEtPmdldCgpID09IE5VTEwpIHsKLSAgICAgICAgICAgICAgICAqbWV0YSA9IG5ldyBBTWVzc2FnZTsKLSAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgaWYgKGtleSA9PSAidXJpIikgewotICAgICAgICAgICAgICAgIGlmICh2YWwuc2l6ZSgpID49IDIKLSAgICAgICAgICAgICAgICAgICAgICAgICYmIHZhbC5jX3N0cigpWzBdID09ICciJwotICAgICAgICAgICAgICAgICAgICAgICAgJiYgdmFsLmNfc3RyKClbdmFsLnNpemUoKSAtIDFdID09ICciJykgewotICAgICAgICAgICAgICAgICAgICAvLyBSZW1vdmUgc3Vycm91bmRpbmcgcXVvdGVzLgotICAgICAgICAgICAgICAgICAgICBBU3RyaW5nIHRtcCh2YWwsIDEsIHZhbC5zaXplKCkgLSAyKTsKLSAgICAgICAgICAgICAgICAgICAgdmFsID0gdG1wOwotICAgICAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgICAgIEFTdHJpbmcgYWJzVVJJOwotICAgICAgICAgICAgICAgIGlmIChNYWtlVVJMKGJhc2VVUkkuY19zdHIoKSwgdmFsLmNfc3RyKCksICZhYnNVUkkpKSB7Ci0gICAgICAgICAgICAgICAgICAgIHZhbCA9IGFic1VSSTsKLSAgICAgICAgICAgICAgICB9IGVsc2UgewotICAgICAgICAgICAgICAgICAgICBBTE9HRSgiZmFpbGVkIHRvIG1ha2UgYWJzb2x1dGUgdXJsIGZvciAnJXMnLiIsCi0gICAgICAgICAgICAgICAgICAgICAgICAgdmFsLmNfc3RyKCkpOwotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgIH0KLQotICAgICAgICAgICAga2V5Lmluc2VydChBU3RyaW5nKCJjaXBoZXItIiksIDApOwotCi0gICAgICAgICAgICAoKm1ldGEpLT5zZXRTdHJpbmcoa2V5LmNfc3RyKCksIHZhbC5jX3N0cigpLCB2YWwuc2l6ZSgpKTsKLSAgICAgICAgfQotICAgIH0KLQotICAgIHJldHVybiBPSzsKLX0KLQotLy8gc3RhdGljCi1zdGF0dXNfdCBNM1VQYXJzZXI6OnBhcnNlQnl0ZVJhbmdlKAotICAgICAgICBjb25zdCBBU3RyaW5nICZsaW5lLC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2VyKGNvbnN0IHVpbnQ4X3QgZW5jb2RlZFs0XSwgc2l6ZV90ICp4KSB7Ci0gICAgKnggPSAwOwotICAgIGZvciAoaW50MzJfdCBpID0gMDsgaSA8IDQ7ICsraSkgewotICAgICAgICBpZiAoZW5jb2RlZFtpXSAmIDB4ODApIHsKLSAgICAgICAgICAgIHJldHVybiBmYWxzZTsKLSAgICAgICAgfQotCi0gICAgICAgICp4ID0gKCgqeCkgPDwgNykgfCBlbmNvZGVkW2ldOwotICAgIH0KLQotICAgIHJldHVybiB0cnVlOwotfQotCi1ib29sIElEMzo6cGFyc2VWMihjb25zdCBzcDxEYXRhU291cmNlPiAmc291cmNlKSB7Ci1zdHJ1Y3QgaWQzX2hlYWRlciB7Ci0gICAgY2hhciBpZFszXTsKLSAgICB1aW50OF90IHZlcnNpb25fbWFqb3I7Ci0gICAgdWludDhfdCB2ZXJzaW9uX21pbm9yOwotICAgIHVpbnQ4X3QgZmxhZ3M7Ci0gICAgdWludDhfdCBlbmNfc2l6ZVs0XTsKLSAgICB9OwotCi0gICAgaWQzX2hlYWRlciBoZWFkZXI7Ci0gICAgaWYgKHNvdXJjZS0+cmVhZEF0KAotICAgICAgICAgICAgICAgIDAsICZoZWFkZXIsIHNpemVvZihoZWFkZXIpKSAhPSAoc3NpemVfdClzaXplb2YoaGVhZGVyKSkgewotICAgICAgICByZXR1cm4gZmFsc2U7Ci0gICAgfQotCi0gICAgaWYgKG1lbWNtcChoZWFkZXIuaWQsICJJRDMiLCAzKSkgewotICAgICAgICByZXR1cm4gZmFsc2U7Ci0gICAgfQotCi0gICAgaWYgKGhlYWRlci52ZXJzaW9uX21ham9yID09IDB4ZmYgfHwgaGVhZGVyLnZlcnNpb25fbWlub3IgPT0gMHhmZikgewotICAgICAgICByZXR1cm4gZmFsc2U7Ci0gICAgfQotCi0gICAgaWYgKGhlYWRlci52ZXJzaW9uX21ham9yID09IDIpIHsKLSAgICAgICAgaWYgKGhlYWRlci5mbGFncyAmIDB4M2Yp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MF0pICsgNDsKLQotICAgICAgICBpZiAoZXh0ZW5kZWRIZWFkZXJTaXplID4gbVNpemUpIHsKLSAgICAgICAgICAgIGZyZWUobURhdGEpOwotICAgICAgICAgICAgbURhdGEgPSBOVUxMOwotCi0gICAgICAgICAgICByZXR1cm4gZmFsc2U7Ci0gICAgICAgIH0KLQotICAgICAgICBtRmlyc3RGcmFtZU9mZnNldCA9IGV4dGVuZGVkSGVhZGVyU2l6ZTsKLQotICAgICAgICB1aW50MTZfdCBleHRlbmRlZEZsYWdzID0gMDsKLSAgICAgICAgaWYgKGV4dGVuZGVkSGVhZGVyU2l6ZSA+PSA2KSB7Ci0gICAgICAgICAgICBleHRlbmRlZEZsYWdzID0gVTE2X0FUKCZtRGF0YVs0XSk7Ci0KLSAgICAgICAgICAgIGlmIChleHRlbmRlZEhlYWRlclNpemUgPj0gMTApIHsKLSAgICAgICAgICAgICAgICBzaXplX3QgcGFkZGluZ1NpemUgPSBVMzJfQVQoJm1EYXRhWzZdKTsKLQotICAgICAgICAgICAgICAgIGlmIChtRmlyc3RGcmFtZU9mZnNldCArIHBhZGRpbmdTaXplID4gbVNpemUpIHsKLSAgICAgICAgICAgICAgICAgICAgZnJlZShtRGF0YSk7Ci0gICAgICAgICAgICAgICAgICAgIG1EYXRhID0gTlVMTDsKLQotICAgICAgICAgICAgICAgICAgICByZXR1cm4gZmFsc2U7Ci0gICAgICAgICAgICAgICAgfQotCi0gICAgICAgICAgICAgICAgbVNpemUgLT0gcGFkZGluZ1NpemU7Ci0gICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgIGlmIChleHRlbmRlZEZsYWdzICYgMHg4MDAwKSB7Ci0gICAgICAgICAgICAgICAgQUxPR1YoImhhdmUgY3JjIik7Ci0gICAgICAgICAgICB9Ci0gICAgICAgIH0KLSAgICB9IGVsc2UgaWYgKGhlYWRlci52ZXJzaW9uX21ham9yID09IDQgJiYgKGhlYWRlci5mbGFncyAmIDB4NDApKSB7Ci0gICAgICAgIC8vIFZlcnNpb24gMi40IGhhcyBhbiBvcHRpb25hbCBleHRlbmRlZCBoZWFkZXIsIHRoYXQncyBkaWZmZXJlbnQKLSAgICAgICAgLy8gZnJvbSBWZXJzaW9uIDIuMydzLi4uCi0KLSAgICAgICAgaWYgKG1TaXplIDwgNCkgewotICAgICAgICAgICAgZnJlZShtRGF0YSk7Ci0gICAgICAgICAgICBtRGF0YSA9IE5VTEw7Ci0KLSAgICAgICAgICAgIHJldHVybiBmYWxzZTsKLSAgICAgICAgfQotCi0gICAgICAgIHNpemVfdCBleHRfc2l6ZTsKLSAgICAgICAgaWYgKCFQYXJzZVN5bmNzYWZlSW50ZWdlcihtRGF0YSwgJmV4dF9zaXplKSkgewotICAgICAgICAgICAgZnJlZShtRGF0YSk7Ci0gICAgICAgICAgICBtRGF0YSA9IE5VTEw7Ci0KLSAgICAgICAgICAgIHJldHVybiBmYWxzZTsKLSAgICAgICAgfQotCi0gICAgICAgIGlmIChleHRfc2l6ZSA8IDYgfHwgZXh0X3NpemUgPiBtU2l6ZSkgewotICAgICAgICAgICAgZnJlZShtRGF0YSk7Ci0gICAgICAgICAgICBtRGF0YSA9IE5VTEw7Ci0KLSAgICAgICAgICAgIHJldHVybiBmYWxzZTsKLSAgICAgICAgfQotCi0gICAgICAgIG1GaXJzdEZyYW1lT2Zmc2V0ID0gZXh0X3NpemU7Ci0gICAgfQotCi0gICAgaWYgKGhlYWRlci52ZXJzaW9uX21ham9yID09IDIpIHsKLSAgICAgICAgbVZlcnNpb24gPSBJRDNfVjJfMjsKLSAgICB9IGVsc2UgaWYgKGhlYWRlci52ZXJzaW9uX21ham9yID09IDMpIHsKLSAgICAgICAgbVZlcnNpb24gPSBJRDNfVjJfMzsKLSAgICB9IGVsc2UgewotICAgICAgICBDSEVDS19FUShoZWFkZXIudmVyc2lvbl9tYWpvciwgNCk7Ci0gICAgICAgIG1WZXJzaW9uID0gSUQzX1YyXzQ7Ci0gICAgfQotCi0gICAgcmV0dXJuIHRydWU7Ci19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IHsKLSAgICAgICAgICAgIHJldHVybiBmYWxzZTsKLSAgICAgICAgfQotCi0gICAgICAgIGlmIChvZmZzZXQgKyBkYXRhU2l6ZSArIDEwID4gbVNpemUpIHsKLSAgICAgICAgICAgIHJldHVybiBmYWxzZTsKLSAgICAgICAgfQotCi0gICAgICAgIHVpbnQxNl90IGZsYWdzID0gVTE2X0FUKCZtRGF0YVtvZmZzZXQgKyA4XSk7Ci0gICAgICAgIHVpbnQxNl90IHByZXZGbGFncyA9IGZsYWdzOwotCi0gICAgICAgIGlmIChmbGFncyAmIDEpIHsKLSAgICAgICAgICAgIC8vIFN0cmlwIGRhdGEgbGVuZ3RoIGluZGljYXRvcgotCi0gICAgICAgICAgICBtZW1tb3ZlKCZtRGF0YVtvZmZzZXQgKyAxMF0sICZtRGF0YVtvZmZzZXQgKyAxNF0sIG1TaXplIC0gb2Zmc2V0IC0gMTQpOwotICAgICAgICAgICAgbVNpemUgLT0gNDsKLSAgICAgICAgICAgIGRhdGFTaXplIC09IDQ7Ci0KLSAgICAgICAgICAgIGZsYWdzICY9IH4xOwotICAgICAgICB9Ci0KLSAgICAgICAgaWYgKGZsYWdzICYgMikgewotICAgICAgICAgICAgLy8gVW5zeW5jaHJvbml6YXRpb24gYWRkZWQuCi0KLSAgICAgICAgICAgIGZvciAoc2l6ZV90IGkgPSAwOyBpICsgMSA8IGRhdGFTaXplOyArK2kpIHsKLSAgICAgICAgICAgICAgICBpZiAobURhdGFbb2Zmc2V0ICsgMTAgKyBpXSA9PSAweGZmCi0gICAgICAgICAgICAgICAgICAgICAgICAmJiBtRGF0YVtvZmZzZXQgKyAxMSArIGldID09IDB4MDApIHsKLSAgICAgICAgICAgICAgICAgICAgbWVtbW92ZSgmbURhdGFbb2Zmc2V0ICsgMTEgKyBpXSwgJm1EYXRhW29mZnNldCArIDEyICsgaV0sCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgbVNpemUgLSBvZmZzZXQgLSAxMiAtIGkpOwotICAgICAgICAgICAgICAgICAgICAtLW1TaXplOwotICAgICAgICAgICAgICAgICAgICAtLWRhdGFTaXplOwotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgZmxhZ3MgJj0gfjI7Ci0gICAgICAgIH0KLQotICAgICAgICBpZiAoZmxhZ3MgIT0gcHJldkZsYWdzIHx8IGlUdW5lc0hhY2spIHsKLSAgICAgICAgICAgIFdyaXRlU3luY3NhZmVJbnRlZ2VyKCZtRGF0YVtvZmZzZXQgKyA0XSwgZGF0YVNpemUpOwotICAgICAgICAgICAgbURhdGFbb2Zmc2V0ICsgOF0gPSBmbGFncyA+PiA4OwotICAgICAgICAgICAgbURhdGFbb2Zmc2V0ICsgOV0gPSBmbGFncyAmIDB4ZmY7Ci0gICAgICAgIH0KLQotICAgICAgICBvZmZzZXQgKz0gMTAgKyBkYXRhU2l6ZTsKLSAgICB9Ci0KLSAgICBtZW1zZXQoJm1EYXRhW21TaXplXSwgMCwgb2xkU2l6ZSAtIG1TaXplKTsKLQotICAgIHJldHVybiB0cnVlOwotfQotCi1JRDM6Okl0ZXJhdG9yOjpJdGVyYXRvcihjb25zdCBJRDMgJnBhcmVudCwgY29uc3QgY2hhciAqaWQpCi0gICAgOiBtUGFyZW50KHBhcmVudCksCi0gICAgICBtSUQoTlVMTCksCi0gICAgICBtT2Zmc2V0KG1QYXJlbnQubUZpcnN0RnJhbWVPZmZzZXQpLAotICAgICAgbUZyYW1lRGF0YShOVUxMKSwKLSAgICAgIG1GcmFtZVNpemUoMCkgewotICAgIGlmIChpZCkgewotICAgICAgICBtSUQgPSBzdHJkdXAoaWQpOwotICAgIH0KLQotICAgIGZpbmRGcmFtZSgpOwotfQotCi1JRDM6Okl0ZXJhdG9yOjp+SXRlcmF0b3IoKSB7Ci0gICAgaWYgKG1JRCkgewotICAgICAgICBmcmVlKG1JRCk7Ci0gICAgICAgIG1JRCA9IE5VTEw7Ci0gICAgfQotfQotCi1ib29sIElEMzo6SXRlcmF0b3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ICAgICAgICBicmVhazsKLSAgICAgICAgICAgIGNhc2UgNjM6Ci0gICAgICAgICAgICAgICAgaWQtPnNldFRvKCJUQUwiKTsKLSAgICAgICAgICAgICAgICBicmVhazsKLSAgICAgICAgICAgIGNhc2UgOTM6Ci0gICAgICAgICAgICAgICAgaWQtPnNldFRvKCJUWUUiKTsKLSAgICAgICAgICAgICAgICBicmVhazsKLSAgICAgICAgICAgIGNhc2UgOTc6Ci0gICAgICAgICAgICAgICAgaWQtPnNldFRvKCJDT00iKTsKLSAgICAgICAgICAgICAgICBicmVhazsKLSAgICAgICAgICAgIGNhc2UgMTI2OgotICAgICAgICAgICAgICAgIGlkLT5zZXRUbygiVFJLIik7Ci0gICAgICAgICAgICAgICAgYnJlYWs7Ci0gICAgICAgICAgICBjYXNlIDEyNzoKLSAgICAgICAgICAgICAgICBpZC0+c2V0VG8oIlRDTyIpOwotICAgICAgICAgICAgICAgIGJyZWFrOwotICAgICAgICAgICAgZGVmYXVsdDoKLSAgICAgICAgICAgICAgICBDSEVDSyghInNob3VsZCBub3QgYmUgaGVyZS4iKTsKLSAgICAgICAgICAgICAgICBicmVhazsKLSAgICAgICAgfQotICAgIH0KLX0KLQotc3RhdGljIHZvaWQgY29udmVydElTTzg4NTlUb1N0cmluZzgoCi0gICAgICAgIGNvbnN0IHVpbnQ4X3QgKmRhdGEsIHNpemVfdCBzaXplLAotICAgICAgICBTdHJpbmc4ICpzKSB7Ci0gICAgc2l6ZV90IHV0ZjhsZW4gPSAwOwotICAgIGZvciAoc2l6ZV90IGkgPSAwOyBpIDwgc2l6ZTsgKytpKSB7Ci0gICAgICAgIGlmIChkYXRhW2ldID09ICdcMCcpIHsKLSAgICAgICAgICAgIHNpemUgPSBpOwotICAgICAgICAgICAgYnJlYWs7Ci0gICAgICAgIH0gZWxzZSBpZiAoZGF0YVtpXSA8IDB4ODApIHsKLSAgICAgICAgICAgICsrdXRmOGxlbjsKLSAgICAgICAgfSBlbHNlIHsKLSAgICAgICAgICAgIHV0ZjhsZW4gKz0gMjsKLSAgICAgICAgfQotICAgIH0KLQotICAgIGlmICh1dGY4bGVuID09IHNpemUpIHsKLSAgICAgICAgLy8gT25seSBBU0NJSSBjaGFyYWN0ZXJzIHByZXNlbnQuCi0KLSAgICAgICAgcy0+c2V0VG8oKGNvbnN0IGNoYXIgKilkYXRhLCBzaXplKTsKLSAgICAgICAgcmV0dXJuOwotICAgIH0KLQotICAgIGNoYXIgKnRtcCA9IG5ldyBjaGFyW3V0ZjhsZW5dOwotICAgIGNoYXIgKnB0ciA9IHRtcDsKLSAgICBmb3IgKHNpemVfdCBpID0gMDsgaSA8IHNpemU7ICsraSkgewotICAgICAgICBpZiAoZGF0YVtpXSA9PSAnXDAnKSB7Ci0gICAgICAgICAgICBicmVhazsKLSAgICAgICAgfSBlbHNlIGlmIChkYXRhW2ldIDwgMHg4MCkgewotICAgICAgICAgICAgKnB0cisrID0gZGF0YVtpXTsKLSAgICAgICAgfSBlbHNlIGlmIChkYXRhW2ldIDwgMHhjMCkgewotICAgICAgICAgICAgKnB0cisrID0gMHhjMjsKLSAgICAgICAgICAgICpwdHIrKyA9IGRhdGFbaV07Ci0gICAgICAgIH0gZWxzZSB7Ci0gICAgICAgICAgICAqcHRyKysgPSAweGMzOwotICAgICAgICAgICAgKnB0cisrID0gZGF0YVtpXSAtIDY0OwotICAgICAgICB9Ci0gICAgfQotCi0gICAgcy0+c2V0VG8odG1wLCB1dGY4bGVuKTsKLQotICAgIGRlbGV0ZVtdIHRtcDsKLSAgICB0bXAgPSBOVUxMOwotfQotCi0vLyB0aGUgMm5kIGFyZ3VtZW50IGlzIHVzZWQgdG8gZ2V0IHRoZSBkYXRhIGZvbGxvd2luZyB0aGUgXDAgaW4gYSBjb21tZW50IGZpZWxkCi12b2lkIElEMzo6SXRlcmF0b3I6OmdldFN0cmluZyhTdHJpbmc4ICppZCwgU3RyaW5nOCAqY29tbWVudCkgY29uc3QgewotICAgIGdldHN0cmluZyhpZCwgZmFsc2UpOw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ICAgIHJldHVybiA2OwotICAgIH0gZWxzZSBpZiAobVBhcmVudC5tVmVyc2lvbiA9PSBJRDNfVjJfMyB8fCBtUGFyZW50Lm1WZXJzaW9uID09IElEM19WMl80KSB7Ci0gICAgICAgIHJldHVybiAxMDsKLSAgICB9IGVsc2UgewotICAgICAgICBDSEVDSyhtUGFyZW50Lm1WZXJzaW9uID09IElEM19WMSB8fCBtUGFyZW50Lm1WZXJzaW9uID09IElEM19WMV8xKTsKLSAgICAgICAgcmV0dXJuIDA7Ci0gICAgfQotfQotCi12b2lkIElEMzo6SXRlcmF0b3I6OmZpbmRGcmFtZSgpIHsKLSAgICBmb3IgKDs7KSB7Ci0gICAgICAgIG1GcmFtZURhdGEgPSBOVUxMOwotICAgICAgICBtRnJhbWVTaXplID0gMDsKLQotICAgICAgICBpZiAobVBhcmVudC5tVmVyc2lvbiA9PSBJRDNfVjJfMikgewotICAgICAgICAgICAgaWYgKG1PZmZzZXQgKyA2ID4gbVBhcmVudC5tU2l6ZSkgewotICAgICAgICAgICAgICAgIHJldHVybjsKLSAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgaWYgKCFtZW1jbXAoJm1QYXJlbnQubURhdGFbbU9mZnNldF0sICJcMFwwXDAiLCAzKSkgewotICAgICAgICAgICAgICAgIHJldHVybjsKLSAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgbUZyYW1lU2l6ZSA9Ci0gICAgICAgICAgICAgICAgKG1QYXJlbnQubURhdGFbbU9mZnNldCArIDNdIDw8IDE2KQotICAgICAgICAgICAgICAgIHwgKG1QYXJlbnQubURhdGFbbU9mZnNldCArIDRdIDw8IDgpCi0gICAgICAgICAgICAgICAgfCBtUGFyZW50Lm1EYXRhW21PZmZzZXQgKyA1XTsKLQotICAgICAgICAgICAgbUZyYW1lU2l6ZSArPSA2OwotCi0gICAgICAgICAgICBpZiAobU9mZnNldCArIG1GcmFtZVNpemUgPiBtUGFyZW50Lm1TaXplKSB7Ci0gICAgICAgICAgICAgICAgQUxPR1YoInBhcnRpYWwgZnJhbWUgYXQgb2Zmc2V0ICVkIChzaXplID0gJWQsIGJ5dGVzLXJlbWFpbmluZyA9ICVkKSIsCi0gICAgICAgICAgICAgICAgICAgICBtT2Zmc2V0LCBtRnJhbWVTaXplLCBtUGFyZW50Lm1TaXplIC0gbU9mZnNldCAtIDYpOwotICAgICAgICAgICAgICAgIHJldHVybjsKLSAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgbUZyYW1lRGF0YSA9ICZtUGFyZW50Lm1EYXRhW21PZmZzZXQgKyA2XTsKLQotICAgICAgICAgICAgaWYgKCFtSUQpIHsKLSAgICAgICAgICAgICAgICBicmVhazsKLSAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgY2hhciBpZFs0XTsKLSAgICAgICAgICAgIG1lbWNweShpZCwgJm1QYXJlbnQubURhdGFbbU9mZnNldF0sIDMpOwotICAgICAgICAgICAgaWRbM10gPSAnXDAnOwotCi0gICAgICAgICAgICBpZiAoIXN0cmNtcChpZCwgbUlEKSkgewotICAgICAgICAgICAgICAgIGJyZWFrOwotICAgICAgICAgICAgfQotICAgICAgICB9IGVsc2UgaWYgKG1QYXJlbnQubVZlcnNpb24gPT0gSUQzX1YyXzMKLSAgICAgICAgICAgICAgICB8fCBtUGFyZW50Lm1WZXJzaW9uID09IElEM19WMl80KSB7Ci0gICAgICAgICAgICBpZiAobU9mZnNldCArIDEwID4gbVBhcmVudC5tU2l6ZSkgewotICAgICAgICAgICAgICAgIHJldHVybjsKLSAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgaWYgKCFtZW1jbXAoJm1QYXJlbnQubURhdGFbbU9mZnNldF0sICJcMFwwXDBcMCIsIDQpKSB7Ci0gICAgICAgICAgICAgICAgcmV0dXJuOwotICAgICAgICAgICAgfQotCi0gICAgICAgICAgICBzaXplX3QgYmFzZVNpemU7Ci0gICAgICAgICAgICBpZiAobVBhcmVudC5tVmVyc2lvbiA9PSBJRDNfVjJfNCkgewotICAgICAgICAgICAgICAgIGlmICghUGFyc2VTeW5jc2FmZUludGVnZXIoCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgJm1QYXJlbnQubURhdGFbbU9mZnNldCArIDRdLCAmYmFzZVNpemUpKSB7Ci0gICAgICAgICAgICAgICAgICAgIHJldHVybjsKLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICB9IGVsc2UgewotICAgICAgICAgICAgICAgIGJhc2VTaXplID0gVTMyX0FUKCZtUGFyZW50Lm1EYXRhW21PZmZzZXQgKyA0XSk7Ci0gICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgIG1GcmFtZVNpemUgPSAxMCArIGJhc2VTaXplOwotCi0gICAgICAgICAgICBpZiAobU9mZnNldCArIG1GcmFtZVNpemUgPiBtUGFyZW50Lm1TaXplKSB7Ci0gICAgICAgICAgICAgICAgQUxPR1YoInBhcnRpYWwgZnJhbWUgYXQgb2Zmc2V0ICVkIChzaXplID0gJWQsIGJ5dGVzLXJlbWFpbmluZyA9ICVkKSIsCi0gICAgICAgICAgICAgICAgICAgICBtT2Zmc2V0LCBtRnJhbWVTaXplLCBtUGFyZW50Lm1TaXplIC0gbU9mZnNldCAtIDEwKTsKLSAgICAgICAgICAgICAgICByZXR1cm47Ci0gICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgIHVpbnQxNl90IGZsYWdzID0gVTE2X0FUKCZtUGFyZW50Lm1EYXRhW21PZmZzZXQgKyA4XSk7Ci0KLSAgICAgICAgICAgIGlmICgobVBhcmVudC5tVmVyc2lvbiA9PSBJRDNfVjJfNCAmJiAoZmxhZ3MgJiAweDAwMGMpKQotICAgICAgICAgICAgICAgIHx8IChtUGFyZW50Lm1WZXJzaW9uID09IElEM19WMl8zICYmIChmbGFncyAmIDB4MDBjMCkpKSB7Ci0gICAgICAgICAgICAgICAgLy8gQ29tcHJlc3Npb24gb3IgZW5jcnlwdGlvbiBhcmUgbm90IHN1cHBvcnRlZCBhdCB0aGlzIHRpbWUuCi0gICAgICAgICAgICAgICAgLy8gUGVyLWZyYW1lIHVuc3luY2hyb25pemF0aW9uIGFuZCBkYXRhLWxlbmd0aCBpbmRpY2F0b3IKLSAgICAgICAgICAgICAgICAvLyBoYXZlIGFscmVhZHkgYmVlbiB0YWtlbiBjYXJlIG9mLgotCi0gICAgICAgICAgICAgICAgQUxPR1YoIlNraXBwaW5nIHVuc3VwcG9ydGVkIGZyYW1lIChjb21wcmVzc2lvbiwgZW5jcnlwdGlvbiAiCi0gICAgICAgICAgICAgICAgICAgICAib3IgcGVyLWZyYW1lIHVuc3luY2hyb25pemF0aW9uIGZsYWdnZWQiKTsKLQotICAgICAgICAgICAgICAgIG1PZmZzZXQgKz0gbUZyYW1lU2l6ZTsKLSAgICAgICAgICAgICAgICBjb250aW51ZTsKLSAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgbUZyYW1lRGF0YSA9ICZtUGFyZW50Lm1EYXRhW21PZmZzZXQgKyAxMF07Ci0KLSAgICAgICAgICAgIGlmICghbUlEKSB7Ci0gICAgICAgICAgICAgICAgYnJlYWs7Ci0gICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgIGNoYXIgaWRbNV07Ci0gICAgICAgICAgICBtZW1jcHkoaWQsICZtUGFyZW50Lm1EYXRhW21PZmZzZXRdLCA0KTsKLSAgICAgICAgICAgIGlkWzRdID0gJ1wwJzsKLQotICAgICAgICAgICAgaWYgKCFzdHJjbXAoaWQsIG1JRCkpIHsKLSAgICAgICAgICAgICAgICBicmVhazsKLSAgICAgICAgICAgIH0KLSAgICAgICAgfSBlbHNlIHsKLSAgICAgICAgICAgIENIRUNLKG1QYXJlbnQubVZlcnNpb24gPT0gSUQzX1YxIHx8IG1QYXJlbnQubVZlcnNpb24gPT0gSUQzX1YxXzEpOwotCi0gICAgICAgICAgICBpZiAobU9mZnNldCA+PSBtUGFyZW50Lm1TaXplKSB7Ci0gICAgICAgICAgICAgICAgcmV0dXJuOwotICAgICAgICAgICAgfQotCi0gICAgICAgICAgICBtRnJhbWVEYXRhID0gJm1QYXJlbnQubURhdGFbbU9mZnNldF07Ci0KLSAgICAgICAgICAgIHN3aXRjaCAobU9mZnNldCkgewotICAgICAgICAgICAgICAgIGNhc2UgMzoKLSAgICAgICAgICAgICAgICBjYXNlIDMzOgotICAgICAgICAgICAgICAgIGNhc2UgNjM6Ci0gICAgICAgICAgICAgICAgICAgIG1GcmFtZVNpemUgPSAzMDsKLSAgICAgICAgICAgICAgICAgICAgYnJlYWs7Ci0gICAgICAgICAgICAgICAgY2FzZSA5MzoKLSAgICAgICAgICAgICAgICAgICAgbUZyYW1lU2l6ZSA9IDQ7Ci0gICAgICAgICAgICAgICAgICAgIGJyZWFrOwotICAgICAgICAgICAgICAgIGNhc2UgOTc6Ci0gICAgICAgICAgICAgICAgICAgIGlmIChtUGFyZW50Lm1WZXJzaW9uID09IElEM19WMSkgewotICAgICAgICAgICAgICAgICAgICAgICAgbUZyYW1lU2l6ZSA9IDMwOwotICAgICAgICAgICAgICAgICAgICB9IGVsc2UgewotICAgICAgICAgICAgICAgICAgICAgICAgbUZyYW1lU2l6ZSA9IDI5OwotICAgICAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgICAgIGJyZWFrOwotICAgICAgICAgICAgICAgIGNhc2UgMTI2OgotICAgICAgICAgICAgICAgICAgICBtRnJhbWVTaXplID0gMTsKLSAgICAgICAgICAgICAgICAgICAgYnJlYWs7Ci0gICAgICAgICAgICAgICAgY2FzZSAxMjc6Ci0gICAgICAgICAgICAgICAgICAgIG1GcmFtZVNpemUgPSAxOwotICAgICAgICAgICAgICAgICAgICBicmVhazsKLSAgICAgICAgICAgICAgICBkZWZhdWx0OgotICAgICAgICAgICAgICAgICAgICBDSEVDSyghIlNob3VsZCBub3QgYmUgaGVyZSwgaW52YWxpZCBvZmZzZXQuIik7Ci0gICAgICAgICAgICAgICAgICAgIGJyZWFrOwotICAgICAgICAgICAgfQotCi0gICAgICAgICAgICBpZiAoIW1JRCkgewotICAgICAgICAgICAgICAgIGJyZWFrOwotICAgICAgICAgICAgfQotCi0gICAgICAgICAgICBTdHJpbmc4IGlkOwotICAgICAgICAgICAgZ2V0SUQoJmlkKTsKLQotICAgICAgICAgICAgaWYgKGlkID09IG1JRCkgewotICAgICAgICAgICAgICAgIGJyZWFrOwotICAgICAgICAgICAgfQotICAgICAgICB9Ci0KLSAgICAgICAgbU9mZnNldCArPSBtRnJhbWVTaXplOwotICAgIH0KLX0KLQotc3RhdGljIHNpemVfdCBTdHJpbmdTaXplKGNvbnN0IHVpbnQ4X3QgKnN0YXJ0LCB1aW50OF90IGVuY29kaW5nKSB7Ci0gICAgaWYgKGVuY29kaW5nID09IDB4MDAgfHwgZW5jb2RpbmcgPT0gMHgwMykgewotICAgICAgICAvLyBJU08gODg1OS0xIG9yIFVURi04Ci0gICAgICAgIHJldHVybiBzdHJsZW4oKGNvbnN0IGNoYXIgKilzdGFydCkgKyAxOwotICAgIH0KLQotICAgIC8vIFVDUy0yCi0gICAgc2l6ZV90IG4gPSAwOwotICAgIHdoaWxlIChzdGFydFtuXSAhPSAnXDAnIHx8IHN0YXJ0W24gKyAxXSAhPSAnXDAnKSB7Ci0gICAgICAgIG4gKz0gMjsKLSAgICB9Ci0KLSAgICByZXR1cm4gbjsKLX0KLQotY29uc3Qgdm9pZCAqCi1JRDM6OmdldEFsYnVtQXJ0KHNpemVfdCAqbGVuZ3RoLCBTdHJpbmc4ICptaW1lKSBjb25zdCB7Ci0gICAgKmxlbmd0aCA9IDA7Ci0gICAgbWltZS0+c2V0VG8oIiIpOwotCi0gICAgSXRlcmF0b3IgaXQoCi0gICAgICAgICAgICAqdGhpcywKLSAgICAgICAgICAgIChtVmVyc2lvbiA9PSBJRDNfVjJfMyB8fCBtVmVyc2lvbiA9PSBJRDNfVjJfNCkgPyAiQVBJQyIgOiAiUElDIik7Ci0KLSAgICB3aGlsZSAoIWl0LmRvbmUoKSkgewotICAgICAgICBzaXplX3Qgc2l6ZTsKLSAgICAgICAgY29uc3QgdWludDhfdCAqZGF0YSA9IGl0LmdldERhdGEoJnNpemUpOwotCi0gICAgICAgIGlmIChtVmVyc2lvbiA9PSBJRDNfVjJfMyB8fCBtVmVyc2lvbiA9PSBJRDNfVjJfNCkgewotICAgICAgICAgICAgdWludDhfdCBlbmNvZGluZyA9IGRhdGFbMF07Ci0gICAgICAgICAgICBtaW1lLT5zZXRUbygoY29uc3QgY2hhciAqKSZkYXRhWzFdKTsKLSAgICAgICAgICAgIHNpemVfdCBtaW1lTGVuID0gc3RybGVuKChjb25zdCBjaGFyICopJmRhdGFbMV0pICsgMTsKLQotICAgICAgICAgICAgdWludDhfdCBwaWNUeXBlID0gZGF0YVsxICsgbWltZUxlbl07Ci0jaWYgMAotICAgICAgICAgICAgaWYgKHBpY1R5cGUgIT0gMHgwMykgewotICAgICAgICAgICAgICAgIC8vIEZyb250IENvdmVyIEFydAotICAgICAgICAgICAgICAgIGl0Lm5leHQoKTsKLSAgICAgICAgICAgICAgICBjb250aW51ZTsKLSAgICAgICAgICAgIH0KLSNlbmRpZgotCi0gICAgICAgICAgICBzaXplX3QgZGVzY0xlbiA9IFN0cmluZ1NpemUoJmRhdGFbMiArIG1pbWVMZW5dLCBlbmNvZGluZyk7Ci0KLSAgICAgICAgICAgICpsZW5ndGggPSBzaXplIC0gMiAtIG1pbWVMZW4gLSBkZXNjTGVuOwotCi0gICAgICAgICAgICByZXR1cm4gJmRhdGFbMiArIG1pbWVMZW4gKyBkZXNjTGVuXTsKLSAgICAgICAgfSBlbHNlIHsKLSAgICAgICAgICAgIHVpbnQ4X3QgZW5jb2RpbmcgPSBkYXRhWzBdOwotCi0gICAgICAgICAgICBpZiAoIW1lbWNtcCgmZGF0YVsxXSwgIlBORyIsIDMpKSB7Ci0gICAgICAgICAgICAgICAgbWltZS0+c2V0VG8oImltYWdlL3BuZyIpOwotICAgICAgICAgICAgfSBlbHNlIGlmICghbWVtY21wKCZkYXRhWzFdLCAiSlBHIiwgMykpIHsKLSAgICAgICAgICAgICAgICB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BWFBBVEhMRU4gMjU2Ci0KLXVzaW5nIG5hbWVzcGFjZSBhbmRyb2lkOwotCi1zdGF0aWMgdm9pZCBoZXhkdW1wKGNvbnN0IHZvaWQgKl9kYXRhLCBzaXplX3Qgc2l6ZSkgewotICAgIGNvbnN0IHVpbnQ4X3QgKmRhdGEgPSAoY29uc3QgdWludDhfdCAqKV9kYXRhOwotICAgIHNpemVfdCBvZmZzZXQgPSAwOwotICAgIHdoaWxlIChvZmZzZXQgPCBzaXplKSB7Ci0gICAgICAgIHByaW50ZigiMHglMDR4ICAiLCBvZmZzZXQpOwotCi0gICAgICAgIHNpemVfdCBuID0gc2l6ZSAtIG9mZnNldDsKLSAgICAgICAgaWYgKG4gPiAxNikgewotICAgICAgICAgICAgbiA9IDE2OwotICAgICAgICB9Ci0KLSAgICAgICAgZm9yIChzaXplX3QgaSA9IDA7IGkgPCAxNjsgKytpKSB7Ci0gICAgICAgICAgICBpZiAoaSA9PSA4KSB7Ci0gICAgICAgICAgICAgICAgcHJpbnRmKCIgIik7Ci0gICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgIGlmIChvZmZzZXQgKyBpIDwgc2l6ZSkgewotICAgICAgICAgICAgICAgIHByaW50ZigiJTAyeCAiLCBkYXRhW29mZnNldCArIGldKTsKLSAgICAgICAgICAgIH0gZWxzZSB7Ci0gICAgICAgICAgICAgICAgcHJpbnRmKCIgICAiKTsKLSAgICAgICAgICAgIH0KLSAgICAgICAgfQotCi0gICAgICAgIHByaW50ZigiICIpOwotCi0gICAgICAgIGZvciAoc2l6ZV90IGkgPSAwOyBpIDwgbjsgKytpKSB7Ci0gICAgICAgICAgICBpZiAoaXNwcmludChkYXRhW29mZnNldCArIGldKSkgewotICAgICAgICAgICAgICAgIHByaW50ZigiJWMiLCBkYXRhW29mZnNldCArIGldKTsKLSAgICAgICAgICAgIH0gZWxzZSB7Ci0gICAgICAgICAgICAgICAgcHJpbnRmKCIuIik7Ci0gICAgICAgICAgICB9Ci0gICAgICAgIH0KLQotICAgICAgICBwcmludGYoIlxuIik7Ci0KLSAgICAgICAgb2Zmc2V0ICs9IDE2OwotICAgIH0KLX0KLQotdm9pZCBzY2FuRmlsZShjb25zdCBjaGFyICpwYXRoKSB7Ci0gICAgc3A8RmlsZVNvdXJjZT4gZmlsZSA9IG5ldyBGaWxlU291cmNlKHBhdGgpOwotICAgIENIRUNLX0VRKGZpbGUtPmluaXRDaGVjaygpLCAoc3RhdHVzX3QpT0spOwotCi0gICAgSUQzIHRhZyhmaWxlKTsKLSAgICBpZiAoIXRhZy5pc1ZhbGlkKCkpIHsKLSAgICAgICAgcHJpbnRmKCJGQUlMICVzXG4iLCBwYXRoKTsKLSAgICB9IGVsc2UgewotICAgICAgICBwcmludGYoIlNVQ0NFU1MgJXNcbiIsIHBhdGgpOwotCi0gICAgICAgIElEMzo6SXRlcmF0b3IgaXQodGFnLCBOVUxMKTsKLSAgICAgICAgd2hpbGUgKCFpdC5kb25lKCkpIHsKLSAgICAgICAgICAgIFN0cmluZzggaWQ7Ci0gICAgICAgICAgICBpdC5nZXRJRCgmaWQpOwotCi0gICAgICAgICAgICBDSEVDSyhpZC5sZW5ndGgoKSA+IDApOwotICAgICAgICAgICAgaWYgKGlkWzBdID09ICdUJykgewotICAgICAgICAgICAgICAgIFN0cmluZzggdGV4dDsKLSAgICAgICAgICAgICAgICBpdC5nZXRTdHJpbmcoJnRleHQpOwotCi0gICAgICAgICAgICAgICAgcHJpbnRmKCIgIGZvdW5kIHRleHQgZnJhbWUgJyVzJzogJXNcbiIsIGlkLnN0cmluZygpLCB0ZXh0LnN0cmluZygpKTsKLSAgICAgICAgICAgIH0gZWxzZSB7Ci0gICAgICAgICAgICAgICAgcHJpbnRmKCIgIGZvdW5kIGZyYW1lICclcycuXG4iLCBpZC5zdHJpbmcoKSk7Ci0gICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgIGl0Lm5leHQoKTsKLSAgICAgICAgfQotCi0gICAgICAgIHNpemVfdCBkYXRhU2l6ZTsKLSAgICAgICAgU3RyaW5nOCBtaW1lOwotICAgICAgICBjb25zdCB2b2lkICpkYXRhID0gdGFnLmdldEFsYnVtQXJ0KCZkYXRhU2l6ZSwgJm1pbWUpOwotCi0gICAgICAgIGlmIChkYXRhKSB7Ci0gICAgICAgICAgICBwcmludGYoImZvdW5kIGFsYnVtIGFydDogc2l6ZT0lZCBtaW1lPSclcydcbiIsIGRhdGFTaXplLAotICAgICAgICAgICAgICAgICAgIG1pbWUuc3RyaW5nKCkpOwotCi0gICAgICAgICAgICBoZXhkdW1wKGRhdGEsIGRhdGFTaXplID4gMTI4ID8gMTI4IDogZGF0YVNpemUpOwotICAgICAgICB9Ci0gICAgfQotfQotCi12b2lkIHNjYW4oY29uc3QgY2hhciAqcGF0aCkgewotICAgIHN0cnVjdCBzdGF0IHN0OwotICAgIGlmIChzdGF0KHBhdGgsICZzdCkgPT0gMCAmJiBTX0lTUkVHKHN0LnN0X21vZGUpKSB7Ci0gICAgICAgIHNjYW5GaWxlKHBhdGgpOwotICAgICAgICByZXR1cm47Ci0gICAgfQotCi0gICAgRElSICpkaXIgPSBvcGVuZGlyKHBhdGgpOwotCi0gICAgaWYgKGRpciA9PSBOVUxMKSB7Ci0gICAgICAgIHJldHVybjsKLSAgICB9Ci0KLSAgICByZXdpbmRkaXIoZGlyKTsKLQotICAgIHN0cnVjdCBkaXJlbnQgKmVudDsKLSAgICB3aGlsZSAoKGVudCA9IHJlYWRkaXIoZGlyKSkgIT0gTlVMTCkgewotICAgICAgICBpZiAoIXN0cmNtcCgiLiIsIGVudC0+ZF9uYW1lKSB8fCAhc3RyY21wKCIuLiIsIGVudC0+ZF9uYW1lKSkgewotICAgICAgICAgICAgY29udGludWU7Ci0gICAgICAgIH0KLQotICAgICAgICBjaGFyIG5ld1BhdGhbTUFYUEFUSExFTl07Ci0gICAgICAgIHN0cmNweShuZXdQYXRoLCBwYXRoKTsKLSAgICAgICAgc3RyY2F0KG5ld1BhdGgsICIvIik7Ci0gICAgICA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LSAgICAgICAgUFJFUEFSRUQgICAgICAgICAgICA9IDB4MTAsCi0gICAgICAgIEFUX0VPUyAgICAgICAgICAgICAgPSAweDIwLAotICAgICAgICBQUkVQQVJFX0NBTkNFTExFRCAgID0gMHg0MCwKLSAgICAgICAgQ0FDSEVfVU5ERVJSVU4gICAgICA9IDB4ODAsCi0gICAgICAgIEFVRElPX0FUX0VPUyAgICAgICAgPSAweDAxMDAsCi0gICAgICAgIFZJREVPX0FUX0VPUyAgICAgICAgPSAweDAyMDAsCi0gICAgICAgIEFVVE9fTE9PUElORyAgICAgICAgPSAweDA0MDAsCi0KLSAgICAgICAgLy8gV2UgYXJlIGJhc2ljYWxseSBkb25lIHByZXBhcmluZyBidXQgYXJlIGN1cnJlbnRseSBidWZmZXJpbmcKLSAgICAgICAgLy8gc3VmZmljaWVudCBkYXRhIHRvIGJlZ2luIHBsYXliYWNrIGFuZCBmaW5pc2ggdGhlIHByZXBhcmF0aW9uIHBoYXNlCi0gICAgICAgIC8vIGZvciBnb29kLgotICAgICAgICBQUkVQQVJJTkdfQ09OTkVDVEVEID0gMHgwODAwLAotCi0gICAgICAgIC8vIFdlJ3JlIHRyaWdnZXJpbmcgYSBzaW5nbGUgdmlkZW8gZXZlbnQgdG8gZGlzcGxheSB0aGUgZmlyc3QgZnJhbWUKLSAgICAgICAgLy8gYWZ0ZXIgdGhlIHNlZWtwb2ludC4KLSAgICAgICAgU0VFS19QUkVWSUVXICAgICAgICA9IDB4MTAwMCwKLQotICAgICAgICBBVURJT19SVU5OSU5HICAgICAgID0gMHgyMDAwLAotICAgICAgICBBVURJT1BMQVlFUl9TVEFSVEVEID0gMHg0MDAwLAotCi0gICAgICAgIElOQ09HTklUTyAgICAgICAgICAgPSAweDgwMDAsCi0KLSAgICAgICAgVEVYVF9SVU5OSU5HICAgICAgICA9IDB4MTAwMDAsCi0gICAgICAgIFRFWFRQTEFZRVJfSU5JVElBTElaRUQgID0gMHgyMDAwMCwKLQotICAgICAgICBTTE9XX0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EUgR2V0Q29uZmlnV3JhcHBlcigKLSAgICAgICAgICAgIE9NWF9IQU5ETEVUWVBFIGNvbXBvbmVudCwKLSAgICAgICAgICAgIE9NWF9JTkRFWFRZUEUgaW5kZXgsCi0gICAgICAgICAgICBPTVhfUFRSIHBhcmFtcyk7Ci0KLSAgICBzdGF0aWMgT01YX0VSUk9SVFlQRSBTZXRDb25maWdXcmFwcGVyKAotICAgICAgICAgICAgT01YX0hBTkRMRVRZUEUgY29tcG9uZW50LAotICAgICAgICAgICAgT01YX0lOREVYVFlQRSBpbmRleCwKLSAgICAgICAgICAgIE9NWF9QVFIgcGFyYW1zKTsKLQotICAgIHN0YXRpYyBPTVhfRVJST1JUWVBFIEdldEV4dGVuc2lvbkluZGV4V3JhcHBlcigKLSAgICAgICAgICAgIE9NWF9IQU5ETEVUWVBFIGNvbXBvbmVudCwKLSAgICAgICAgICAgIE9NWF9TVFJJTkcgbmFtZSwKLSAgICAgICAgICAgIE9NWF9JTkRFWFRZUEUgKmluZGV4KTsKLQotICAgIHN0YXRpYyBPTVhfRVJST1JUWVBFIFVzZUJ1ZmZlcldyYXBwZXIoCi0gICAgICAgICAgICBPTVhfSEFORExFVFlQRSBjb21wb25lbnQsCi0gICAgICAgICAgICBPTVhfQlVGRkVSSEVBREVSVFlQRSAqKmJ1ZmZlciwKLSAgICAgICAgICAgIE9NWF9VMzIgcG9ydEluZGV4LAotICAgICAgICAgICAgT01YX1BUUiBhcHBQcml2YXRlLAotICAgICAgICAgICAgT01YX1UzMiBzaXplLAotICAgICAgICAgICAgT01YX1U4ICpwdHIpOwotCi0gICAgc3RhdGljIE9NWF9FUlJPUlRZUEUgQWxsb2NhdGVCdWZmZXJXcmFwcGVyKAotICAgICAgICAgICAgT01YX0hBTkRMRVRZUEUgY29tcG9uZW50LAotICAgICAgICAgICAgT01YX0JVRkZFUkhFQURFUlRZUEUgKipidWZmZXIsCi0gICAgICAgICAgICBPTVhfVTMyIHBvcnRJbmRleCwKLSAgICAgICAgIC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7Ci0gICAgICAgIGxvbmcgcmVzID0gbUNsdXN0ZXItPkdldEVudHJ5KG1CbG9ja0VudHJ5SW5kZXgsIG1CbG9ja0VudHJ5KTsKLSAgICAgICAgQUxPR1YoIkdldEVudHJ5IHJldHVybmVkICVsZCIsIHJlcyk7Ci0KLSAgICAgICAgbG9uZyBsb25nIHBvczsKLSAgICAgICAgbG9uZyBsZW47Ci0gICAgICAgIGlmIChyZXMgPCAwKSB7Ci0gICAgICAgICAgICAvLyBOZWVkIHRvIHBhcnNlIHRoaXMgY2x1c3RlciBzb21lIG1vcmUKLQotICAgICAgICAgICAgQ0hFQ0tfRVEocmVzLCBta3ZwYXJzZXI6OkVfQlVGRkVSX05PVF9GVUxMKTsKLQotICAgICAgICAgICAgcmVzID0gbUNsdXN0ZXItPlBhcnNlKHBvcywgbGVuKTsKLSAgICAgICAgICAgIEFMT0dWKCJQYXJzZSByZXR1cm5lZCAlbGQiLCByZXMpOwotCi0gICAgICAgICAgICBpZiAocmVzIDwgMCkgewotICAgICAgICAgICAgICAgIC8vIEkvTyBlcnJvcgotCi0gICAgICAgICAgICAgICAgQUxPR0UoIkNsdXN0ZXI6OlBhcnNlIHJldHVybmVkIHJlc3VsdCAlbGQiLCByZXMpOwotCi0gICAgICAgICAgICAgICAgbUNsdXN0ZXIgPSBOVUxMOwotICAgICAgICAgICAgICAgIGJyZWFrOwotICAgICAgICAgICAgfQotCi0gICAgICAgICAgICBjb250aW51ZTsKLSAgICAgICAgfSBlbHNlIGlmIChyZXMgPT0gMCkgewotICAgICAgICAgICAgLy8gV2UncmUgZG9uZSB3aXRoIHRoaXMgY2x1c3RlcgotCi0gICAgICAgICAgICBjb25zdCBta3ZwYXJzZXI6OkNsdXN0ZXIgKm5leHRDbHVzdGVyOwotICAgICAgICAgICAgcmVzID0gbUV4dHJhY3Rvci0+bVNlZ21lbnQtPlBhcnNlTmV4dCgKLSAgICAgICAgICAgICAgICAgICAgbUNsdXN0ZXIsIG5leHRDbHVzdGVyLCBwb3MsIGxlbik7Ci0gICAgICAgICAgICBBTE9HVigiUGFyc2VOZXh0IHJldHVybmVkICVsZCIsIHJlcyk7Ci0KLSAgICAgICAgICAgIGlmIChyZXMgPiAwKSB7Ci0gICAgICAgICAgICAgICAgLy8gRU9GCi0KLSAgICAgICAgICAgICAgICBtQ2x1c3RlciA9IE5VTEw7Ci0gICAgICAgICAgICAgICAgYnJlYWs7Ci0gICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgIENIRUNLX0VRKHJlcywgMCk7Ci0gICAgICAgICAgICBDSEVDSyhuZXh0Q2x1c3RlciAhPSBOVUxMKTsKLSAgICAgICAgICAgIENIRUNLKCFuZXh0Q2x1c3Rlci0+RU9TKCkpOwotCi0gICAgICAgICAgICBtQ2x1c3RlciA9IG5leHRDbHVzdGVyOwotCi0gICAgICAgICAgICByZXMgPSBtQ2x1c3Rlci0+UGFyc2UocG9zLCBsZW4pOwotICAgICAgICAgICAgQUxPR1YoIlBhcnNlICgyKSByZXR1cm5lZCAlbGQiLCByZXMpOwotICAgICAgICAgICAgQ0hFQ0tfR0UocmVzLCAwKTsKLQotICAgICAgICAgICAgbUJsb2NrRW50cnlJbmRleCA9IDA7Ci0gICAgICAgICAgICBjb250aW51ZTsKLSAgICAgICAgfQotCi0gICAgICAgIENIRUNLKG1CbG9ja0VudHJ5ICE9IE5VTEwpOwotICAgICAgICBDSEVDSyhtQmxvY2tFbnRyeS0+R2V0QmxvY2soKSAhPSBOVUxMKTsKLSAgICAgICAgKyttQmxvY2tFbnRyeUluZGV4OwotCi0gICAgICAgIGlmIChtQmxvY2tFbnRyeS0+R2V0QmxvY2soKS0+R2V0VHJhY2tOdW1iZXIoKSA9PSBtVHJhY2tOdW0pIHsKLSAgICAgICAgICAgIGJyZWFrOwotICAgICAgICB9Ci0gICAgfQotfQotCi12b2lkIEJsb2NrSXRlcmF0b3I6OnJlc2V0KCkgewotICAgIE11dGV4OjpBdXRvbG9jayBhdXRvTG9jayhtRXh0cmFjdG9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Ci0gICAgICAgIHNwPE1ldGFEYXRhPiBtZXRhID0gbmV3IE1ldGFEYXRhOwotCi0gICAgICAgIHN3aXRjaCAodHJhY2stPkdldFR5cGUoKSkgewotICAgICAgICAgICAgY2FzZSBWSURFT19UUkFDSzoKLSAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICBjb25zdCBta3ZwYXJzZXI6OlZpZGVvVHJhY2sgKnZ0cmFjayA9Ci0gICAgICAgICAgICAgICAgICAgIHN0YXRpY19jYXN0PGNvbnN0IG1rdnBhcnNlcjo6VmlkZW9UcmFjayAqPih0cmFjayk7Ci0KLSAgICAgICAgICAgICAgICBpZiAoIXN0cmNtcCgiVl9NUEVHNC9JU08vQVZDIiwgY29kZWNJRCkpIHsKLSAgICAgICAgICAgICAgICAgICAgbWV0YS0+c2V0Q1N0cmluZyhrS2V5TUlNRVR5cGUsIE1FRElBX01JTUVUWVBFX1ZJREVPX0FWQyk7Ci0gICAgICAgICAgICAgICAgICAgIG1ldGEtPnNldERhdGEoa0tleUFWQ0MsIDAsIGNvZGVjUHJpdmF0ZSwgY29kZWNQcml2YXRlU2l6ZSk7Ci0gICAgICAgICAgICAgICAgfSBlbHNlIGlmICghc3RyY21wKCJWX01QRUc0L0lTTy9BU1AiLCBjb2RlY0lEKSkgewotICAgICAgICAgICAgICAgICAgICBpZiAoY29kZWNQcml2YXRlU2l6ZSA+IDApIHsKLSAgICAgICAgICAgICAgICAgICAgICAgIG1ldGEtPnNldENTdHJpbmcoCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGtLZXlNSU1FVHlwZSwgTUVESUFfTUlNRVRZUEVfVklERU9fTVBFRzQpOwotICAgICAgICAgICAgICAgICAgICAgICAgYWRkRVNEU0Zyb21Db2RlY1ByaXZhdGUoCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1ldGEsIGZhbHNlLCBjb2RlY1ByaXZhdGUsIGNvZGVjUHJpdmF0ZVNpemUpOwotICAgICAgICAgICAgICAgICAgICB9IGVsc2UgewotICAgICAgICAgICAgICAgICAgICAgICAgQUxPR1coIiVzIGlzIGRldGVjdGVkLCBidXQgZG9lcyBub3QgaGF2ZSBjb25maWd1cmF0aW9uLiIsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvZGVjSUQpOwotICAgICAgICAgICAgICAgICAgICAgICAgY29udGludWU7Ci0gICAgICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKCFzdHJjbXAoIlZfVlA4IiwgY29kZWNJRCkpIHsKLSAgICAgICAgICAgICAgICAgICAgbWV0YS0+c2V0Q1N0cmluZyhrS2V5TUlNRVR5cGUsIE1FRElBX01JTUVUWVBFX1ZJREVPX1ZQWCk7Ci0gICAgICAgICAgICAgICAgfSBlbHNlIHsKLSAgICAgICAgICAgICAgICAgICAgQUxPR1coIiVzIGlzIG5vdCBzdXBwb3J0ZWQuIiwgY29kZWNJRCk7Ci0gICAgICAgICAgICAgICAgICAgIGNvbnRpbnVlOwotICAgICAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgICAgIG1ldGEtPnNldEludDMyKGtLZXlXaWR0aCwgdnRyYWNrLT5HZXRXaWR0aCgpKTsKLSAgICAgICAgICAgICAgICBtZXRhLT5zZXRJbnQzMihrS2V5SGVpZ2h0LCB2dHJhY2stPkdldEhlaWdodCgpKTsKLSAgICAgICAgICAgICAgICBicmVhazsKLSAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgY2FzZSBBVURJT19UUkFDSzoKLSAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICBjb25zdCBta3ZwYXJzZXI6OkF1ZGlvVHJhY2sgKmF0cmFjayA9Ci0gICAgICAgICAgICAgICAgICAgIHN0YXRpY19jYXN0PGNvbnN0IG1rdnBhcnNlcjo6QXVkaW9UcmFjayAqPih0cmFjayk7Ci0KLSAgICAgICAgICAgICAgICBpZiAoIXN0cmNtcCgiQV9BQUMiLCBjb2RlY0lEKSkgewotICAgICAgICAgICAgICAgICAgICBtZXRhLT5zZXRDU3RyaW5nKGtLZXlNSU1FVHlwZSwgTUVESUFfTUlNRVRZUEVfQVVESU9fQUFDKTsKLSAgICAgICAgICAgICAgICAgICAgQ0hFQ0soY29kZWNQcml2YXRlU2l6ZSA+PSAyKTsKLQotICAgICAgICAgICAgICAgICAgICBhZGRFU0RTRnJvbUNvZGVjUHJpdmF0ZSgKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBtZXRhLCB0cnVlLCBjb2RlY1ByaXZhdGUsIGNvZGVjUHJpdmF0ZVNpemUpOwotICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAoIXN0cmNtcCgiQV9WT1JCSVMiLCBjb2RlY0lEKSkgewotICAgICAgICAgICAgICAgICAgICBtZXRhLT5zZXRDU3RyaW5nKGtLZXlNSU1FVHlwZSwgTUVESUFfTUlNRVRZUEVfQVVESU9fVk9SQklTKTsKLQotICAgICAgICAgICAgICAgICAgICBhZGRWb3JiaXNDb2RlY0luZm8obWV0YSwgY29kZWNQcml2YXRlLCBjb2RlY1ByaXZhdGVTaXplKTsKLSAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKCFzdHJjbXAoIkFfTVBFRy9MMyIsIGNvZGVjSUQpKSB7Ci0gICAgICAgICAgICAgICAgICAgIG1ldGEtPnNldENTdHJpbmcoa0tleU1JTUVUeXBlLCBNRURJQV9NSU1FVFlQRV9BVURJT19NUEVHKTsKLSAgICAgICAgICAgICAgICB9IGVsc2UgewotICAgICAgICAgICAgICAgICAgICBBTE9HVygiJXMgaXMgbm90IHN1cHBvcnRlZC4iLCBjb2RlY0lEKTsKLSAgICAgICAgICAgICAgICAgICAgY29udGludWU7Ci0gICAgICAgICAgICAgICAgfQotCi0gICAgICAgICAgICAgICAgbWV0YS0+c2V0SW50MzIoa0tleVNhbXBsZVJhdGUsIGF0cmFjay0+R2V0U2FtcGxpbmdSYXRlKCkpOwotICAgICAgICAgICAgICAgIG1ldGEtPnNldEludDMyKGtLZX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ZW5ndGgpOwotCi0gICAgICAgICAgICBici0+c2tpcEJpdHMoZGVzY0xlbmd0aCAqIDgpOwotCi0gICAgICAgICAgICBpbmZvX2J5dGVzX3JlbWFpbmluZyAtPSBkZXNjTGVuZ3RoICsgMjsKLSAgICAgICAgfQotICAgICAgICBDSEVDS19FUShpbmZvX2J5dGVzX3JlbWFpbmluZywgMHUpOwotI2VuZGlmCi0KLSAgICAgICAgU3RyZWFtSW5mbyBpbmZvOwotICAgICAgICBpbmZvLm1UeXBlID0gc3RyZWFtVHlwZTsKLSAgICAgICAgaW5mby5tUElEID0gZWxlbWVudGFyeVBJRDsKLSAgICAgICAgaW5mb3MucHVzaChpbmZvKTsKLQotICAgICAgICBpbmZvQnl0ZXNSZW1haW5pbmcgLT0gNSArIEVTX2luZm9fbGVuZ3RoOwotICAgIH0KLQotICAgIENIRUNLX0VRKGluZm9CeXRlc1JlbWFpbmluZywgMHUpOwotICAgIE1ZX0xPR1YoIiAgQ1JDID0gMHglMDh4IiwgYnItPmdldEJpdHMoMzIpKTsKLQotICAgIGJvb2wgUElEc0NoYW5nZWQgPSBmYWxzZTsKLSAgICBmb3IgKHNpemVfdCBpID0gMDsgaSA8IGluZm9zLnNpemUoKTsgKytpKSB7Ci0gICAgICAgIFN0cmVhbUluZm8gJmluZm8gPSBpbmZvcy5lZGl0SXRlbUF0KGkpOwotCi0gICAgICAgIHNzaXplX3QgaW5kZXggPSBtU3RyZWFtcy5pbmRleE9mS2V5KGluZm8ubVBJRCk7Ci0KLSAgICAgICAgaWYgKGluZGV4ID49IDAgJiYgbVN0cmVhbXMuZWRpdFZhbHVlQXQoaW5kZXgpLT50eXBlKCkgIT0gaW5mby5tVHlwZSkgewotICAgICAgICAgICAgQUxPR0koInVoIG9oLiBzdHJlYW0gUElEcyBoYXZlIGNoYW5nZWQuIik7Ci0gICAgICAgICAgICBQSURzQ2hhbmdlZCA9IHRydWU7Ci0gICAgICAgICAgICBicmVhazsKLSAgICAgICAgfQotICAgIH0KL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lYW0+IHMxID0gbVN0cmVhbXMuZWRpdFZhbHVlQXQoMCk7Ci0gICAgICAgICAgICBzcDxTdHJlYW0+IHMyID0gbVN0cmVhbXMuZWRpdFZhbHVlQXQoMSk7Ci0KLSAgICAgICAgICAgIGJvb2wgY2FzZUEgPQotICAgICAgICAgICAgICAgIGluZm8xLm1QSUQgPT0gczEtPnBpZCgpICYmIGluZm8xLm1UeXBlID09IHMyLT50eXBlKCkKLSAgICAgICAgICAgICAgICAgICAgJiYgaW5mbzIubVBJRCA9PSBzMi0+cGlkKCkgJiYgaW5mbzIubVR5cGUgPT0gczEtPnR5cGUoKTsKLQotICAgICAgICAgICAgYm9vbCBjYXNlQiA9Ci0gICAgICAgICAgICAgICAgaW5mbzEubVBJRCA9PSBzMi0+cGlkKCkgJiYgaW5mbzEubVR5cGUgPT0gczEtPnR5cGUoKQotICAgICAgICAgICAgICAgICAgICAmJiBpbmZvMi5tUElEID09IHMxLT5waWQoKSAmJiBpbmZvMi5tVHlwZSA9PSBzMi0+dHlwZSgpOwotCi0gICAgICAgICAgICBpZiAoY2FzZUEgfHwgY2FzZUIpIHsKLSAgICAgICAgICAgICAgICB1bnNpZ25lZCBwaWQxID0gczEtPnBpZCgpOwotICAgICAgICAgICAgICAgIHVuc2lnbmVkIHBpZDIgPSBzMi0+cGlkKCk7Ci0gICAgICAgICAgICAgICAgczEtPnNldFBJRChwaWQyKTsKLSAgICAgICAgICAgICAgICBzMi0+c2V0UElEKHBpZDEpOwotCi0gICAgICAgICAgICAgICAgbVN0cmVhbXMuY2xlYXIoKTsKLSAgICAgICAgICAgICAgICBtU3RyZWFtcy5hZGQoczEtPnBpZCgpLCBzMSk7Ci0gICAgICAgICAgICAgICAgbVN0cmVhbXMuYWRkKHMyLT5waWQoKSwgczIpOwotCi0gICAgICAgICAgICAgICAgc3VjY2VzcyA9IHRydWU7Ci0gICAgICAgICAgICB9Ci0gICAgICAgIH0KLQotICAgICAgICBpZiAoIXN1Y2Nlc3MpIHsKLS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kgPDwgMzA7Ci0gICAgICAgICAgICAgICAgQ0hFQ0tfRVEoYnItPmdldEJpdHMoMSksIDF1KTsKLSAgICAgICAgICAgICAgICBEVFMgfD0gKCh1aW50NjRfdClici0+Z2V0Qml0cygxNSkpIDw8IDE1OwotICAgICAgICAgICAgICAgIENIRUNLX0VRKGJyLT5nZXRCaXRzKDEpLCAxdSk7Ci0gICAgICAgICAgICAgICAgRFRTIHw9IGJyLT5nZXRCaXRzKDE1KTsKLSAgICAgICAgICAgICAgICBDSEVDS19FUShici0+Z2V0Qml0cygxKSwgMXUpOwotCi0gICAgICAgICAgICAgICAgQUxPR1YoIkRUUyA9ICVsbHUiLCBEVFMpOwotCi0gICAgICAgICAgICAgICAgb3B0aW9uYWxfYnl0ZXNfcmVtYWluaW5nIC09IDU7Ci0gICAgICAgICAgICB9Ci0gICAgICAgIH0KLQotICAgICAgICBpZiAoRVNDUl9mbGFnKSB7Ci0gICAgICAgICAgICBDSEVDS19HRShvcHRpb25hbF9ieXRlc19yZW1haW5pbmcsIDZ1KTsKLQotICAgICAgICAgICAgYnItPmdldEJpdHMoMik7Ci0KLSAgICAgICAgICAgIHVpbnQ2NF90IEVTQ1IgPSAoKHVpbnQ2NF90KWJyLT5nZXRCaXRzKDMpKSA8PCAzMDsKLSAgICAgICAgICAgIENIRUNLX0VRKGJyLT5nZXRCaXRzKDEpLCAxdSk7Ci0gICAgICAgICAgICBFU0NSIHw9ICgodWludDY0X3QpYnItPmdldEJpdHMoMTUpKSA8PCAxNTsKLSAgICAgICAgICAgIENIRUNLX0VRKGJyLT5nZXRCaXRzKDEpLCAxdSk7Ci0gICAgICAgICAgICBFU0NSIHw9IGJyLT5nZXRCaXRzKDE1KTsKLSAgICAgICAgICAgIENIRUNLX0VRKGJyLT5nZXRCaXRzKDEpLCAxdSk7Ci0KLSAgICAgICAgICAgIEFMT0dWKCJFU0NSID0gJWxsdSIsIEVTQ1IpOwotICAgICAgICAgICAgTVlfTE9HVigiRVNDUl9leHRlb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FpbiAiCi0gICAgICAgICAgICAgICAgICAgICAicGF5bG9hZC4gKG51bUJpdHNMZWZ0ID0gJWQsIHJlcXVpcmVkID0gJWQpIiwKLSAgICAgICAgICAgICAgICAgICAgIGJyLT5udW1CaXRzTGVmdCgpLCBkYXRhTGVuZ3RoICogOCk7Ci0KLSAgICAgICAgICAgICAgICByZXR1cm4gRVJST1JfTUFMRk9STUVEOwotICAgICAgICAgICAgfQotCi0gICAgICAgICAgICBDSEVDS19HRShici0+bnVtQml0c0xlZnQoKSwgZGF0YUxlbmd0aCAqIDgpOwotCi0gICAgICAgICAgICBvblBheWxvYWREYXRhKAotICAgICAgICAgICAgICAgICAgICBQVFNfRFRTX2ZsYWdzLCBQVFMsIERUUywgYnItPmRhdGEoKSwgZGF0YUxlbmd0aCk7Ci0KLSAgICAgICAgICAgIGJyLT5za2lwQml0cyhkYXRhTGVuZ3RoICogOCk7Ci0gICAgICAgIH0gZWxzZSB7Ci0gICAgICAgICAgICBvblBheWxvYWREYXRhKAotICAgICAgICAgICAgICAgICAgICBQVFNfRFRTX2ZsYWdzLCBQVFMsIERUUywKLSAgICAgICAgICAgICAgICAgICAgYnItPmRhdGEoKSwgYnItPm51bUJpdHNMZWZ0KCkgLyA4KTsKLQotICAgICAgICAgICAgc2l6ZV90IHBheWxvYWRTaXplQml0cyA9IGJyLT5udW1CaXRzTGVmdCgpOwotICAgICAgICAgICAgQ0hFQ0tfRVEocGF5bG9hZFNpemVCaXRzICUgOCwgMHUpOwotCi0gICAgICAgICAgICBBTE9HVigiVGhlcmUncyAlZCBieXRlcyBvZiBwYXlsb2FkLiIsIHBheWxvYWRTaXplQml0cyAvIDgpOwotICAgICAgICB9Ci0gICAgfSBlbHNlIGlmIChzdHJlYW1faWQgPT0gMHhiZSkgeyAgLy8gcGFkZGluZ19zdHJlYW0KLSAgICAgICAgQ0hFQ0tfTkUoUEVTX3BhY2tldF9sZW5ndGgsIDB1KTsKLSAgICAgICAgYnItPnNraXBCaXRzKFBFU19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IHVudGlsCi0gICAgICAgICAgICAvLyB0aGUgcXVldWUgaGFzIHJlZXN0YWJsaXNoZWQgdGhlIG5ldyBmb3JtYXQuCi0KLSAgICAgICAgICAgIGlmIChtU291cmNlLT5nZXRGb3JtYXQoKSA9PSBOVUxMKSB7Ci0gICAgICAgICAgICAgICAgbVNvdXJjZS0+c2V0Rm9ybWF0KG1RdWV1ZS0+Z2V0Rm9ybWF0KCkpOwotICAgICAgICAgICAgfQotICAgICAgICAgICAgbVNvdXJjZS0+cXVldWVBY2Nlc3NVbml0KGFjY2Vzc1VuaXQpOwotICAgICAgICB9Ci0gICAgfQotfQotCi1zcDxNZWRpYVNvdXJjZT4gQVRTUGFyc2VyOjpTdHJlYW06OmdldFNvdXJjZShTb3VyY2VUeXBlIHR5cGUpIHsKLSAgICBzd2l0Y2ggKHR5cGUpIHsKLSAgICAgICAgY2FzZSBWSURFTzoKLSAgICAgICAgewotICAgICAgICAgICAgaWYgKGlzVmlkZW8oKSkgewotICAgICAgICAgICAgICAgIHJldHVybiBtU291cmNlOwotICAgICAgICAgICAgfQotICAgICAgICAgICAgYnJlYWs7Ci0gICAgICAgIH0KLQotICAgICAgICBjYXNlIEFVRElPOgotICAgICAgICB7Ci0gICAgICAgICAgICBpZiAoaXNBdWRpbygpKSB7Ci0gICAgICAgICAgICAgICAgcmV0dXJuIG1Tb3VyY2U7Ci0gICAgICAgICAgICB9Ci0gICAgICAgICAgICBicmVhazsKLSAgICAgICAgfQotCi0gICAgICAgIGRlZmF1bHQ6Ci0gICAgICAgICAgICBicmVhazsKLSAgICB9Ci0KLSAgICByZXR1cm4gTlVMTDsKLX0KLQotLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8KLQotQVRTUGFyc2VyOjpBVFNQYXJzZXIodWludDMyX3QgZmxhZ3MpCi0gICAgOiBtRmxhZ3MoZmx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mFtLT51cGRhdGVQcm9ncmFtTWFwUElEKHByb2dyYW1NYXBQSUQpOwotICAgICAgICAgICAgICAgICAgICBmb3VuZCA9IHRydWU7Ci0gICAgICAgICAgICAgICAgICAgIGJyZWFrOwotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgaWYgKCFmb3VuZCkgewotICAgICAgICAgICAgICAgIG1Qcm9ncmFtcy5wdXNoKAotICAgICAgICAgICAgICAgICAgICAgICAgbmV3IFByb2dyYW0odGhpcywgcHJvZ3JhbV9udW1iZXIsIHByb2dyYW1NYXBQSUQpKTsKLSAgICAgICAgICAgIH0KLSAgICAgICAgfQotICAgIH0KLQotICAgIE1ZX0xPR1YoIiAgQ1JDID0gMHglMDh4IiwgYnItPmdldEJpdHMoMzIpKTsKLX0KLQotc3RhdHVzX3QgQVRTUGFyc2VyOjpwYXJzZVBJRCgKLSAgICAgICAgQUJpdFJlYWRlciAqYnIsIHVuc2lnbmVkIFBJRCwKLSAgICAgICAgdW5zaWduZWQgcGF5bG9hZF91bml0X3N0YXJ0X2luZGljYXRvcikgewotICAgIGlmIChQSUQgPT0gMCkgewotICAgICAgICBpZiAocGF5bG9hZF91bml0X3N0YXJ0X2luZGljYXRvcikgewotICAgICAgICAgICAgdW5zaWduZWQgc2tpcCA9IGJyLT5nZXRCaXRzKDgpOwotICAgICAgICAgICAgYnItPnNraXBCaXRzKHNraXAgKiA4KTsKLSAgICAgICAgfQotICAgICAgICBwYXJzZVByb2dyYW1Bc3NvY2lhdGlvblRhYmxlKGJyKTsKLSAgICAgICAgcmV0dXJuIE9LOwotICAgIH0KLQotICAgIGJvb2wgaGFuZGxlZCA9IGZhbHNlOwotICAgIGZvciAoc2l6ZV90IGkgPSAwOyBpIDwgbVByb2dyYW1zLnNpemUoKTsgKytpKSB7Ci0gICAgICAgIHN0YXR1c190IGVycjsKLSAgICAgICAgaWYgKG1Qcm9ncmFtcy5lZGl0SXRlbUF0KGkpLT5wYXJzZV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QotICAgICAgICBpbnQzMl90IGRpc2NvbnRpbnVpdHk7Ci0gICAgICAgIGlmIChidWZmZXItPm1ldGEoKS0+ZmluZEludDMyKCJkaXNjb250aW51aXR5IiwgJmRpc2NvbnRpbnVpdHkpKSB7Ci0gICAgICAgICAgICBpZiAod2FzRm9ybWF0Q2hhbmdlKGRpc2NvbnRpbnVpdHkpKSB7Ci0gICAgICAgICAgICAgICAgbUZvcm1hdC5jbGVhcigpOwotICAgICAgICAgICAgfQotCi0gICAgICAgICAgICByZXR1cm4gSU5GT19ESVNDT05USU5VSVRZOwotICAgICAgICB9IGVsc2UgewotICAgICAgICAgICAgaW50NjRfdCB0aW1lVXM7Ci0gICAgICAgICAgICBDSEVDSyhidWZmZXItPm1ldGEoKS0+ZmluZEludDY0KCJ0aW1lVXMiLCAmdGltZVVzKSk7Ci0KLSAgICAgICAgICAgIE1lZGlhQnVmZmVyICptZWRpYUJ1ZmZlciA9IG5ldyBNZWRpYUJ1ZmZlcihidWZmZXIpOwotCi0gICAgICAgICAgICBtZWRpYUJ1ZmZlci0+bWV0YV9kYXRhKCktPnNldEludDY0KGtLZXlUaW1lLCB0aW1lVXMpOwotCi0gICAgICAgICAgICBpbnQzMl90IHNjcmFtYmxpbmc7Ci0gICAgICAgICAgICBpZiAoYnVmZmVyLT5tZXRhKCktPmZpbmRJbnQzMigic2NyYW1ibGluZyIsICZzY3JhbWJsaW5nKQotICAgICAgICAgICAgICAgICAgICAmJiBzY3JhbWJsaW5nICE9IDApIHsKLSAgICAgICAgICAgICAgICBtZWRpYUJ1ZmZlci0+bWV0YV9kYXRhKCktPnNldEludDMyKGtLZXlTY3JhbWJsaW5nLCBzY3JhbWJsaW5nKTsKLSAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgKm91dCA9IG1lZGlhQnVmZmVyOwotICAgICAgICAgICAgcmV0dXJuIE9LOwotICAgICAgICB9Ci0gICAgfQotCi0gICAgcmV0dXJuIG1FT1NSZXN1bHQ7Ci19Ci0KLWJv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ZGF0YSB0byB2ZXJpZnkgaGVhZGVyLgotICAgICAgICByZXR1cm4gZmFsc2U7Ci0gICAgfQotCi0gICAgaWYgKHB0clswXSAhPSAweGZmIHx8IChwdHJbMV0gPj4gNSkgIT0gMHgwNykgewotICAgICAgICByZXR1cm4gZmFsc2U7Ci0gICAgfQotCi0gICAgdW5zaWduZWQgSUQgPSAocHRyWzFdID4+IDMpICYgMzsKLQotICAgIGlmIChJRCA9PSAxKSB7Ci0gICAgICAgIHJldHVybiBmYWxzZTsgIC8vIHJlc2VydmVkCi0gICAgfQotCi0gICAgdW5zaWduZWQgbGF5ZXIgPSAocHRyWzFdID4+IDEpICYgMzsKLQotICAgIGlmIChsYXllciA9PSAwKSB7Ci0gICAgICAgIHJldHVybiBmYWxzZTsgIC8vIHJlc2VydmVkCi0gICAgfQotCi0gICAgdW5zaWduZWQgYml0cmF0ZUluZGV4ID0gKHB0clsyXSA+PiA0KTsKLQotICAgIGlmIChiaXRyYXRlSW5kZXggPT0gMHgwZikgewotICAgICAgICByZXR1cm4gZmFsc2U7ICAvLyByZXNlcnZlZAotICAgIH0KLQotICAgIHVuc2lnbmVkIHNhbXBsaW5nUmF0ZUluZGV4ID0gKHB0clsyXSA+PiAyKSAmIDM7Ci0KLSAgICBpZiAoc2FtcGxpbmdSYXRlSW5kZXggPT0gMykgewotICAgICAgICByZXR1cm4gZmFsc2U7ICAvLyByZXNlcnZlZAotICAgIH0KLQotICAgIHJldHVybiB0cnVlOwotfQotCi1zdGF0dXNfdCBFbGVtZW50YXJ5U3RyZWFtUXVldWU6OmFwcGVuZERhdGEoCi0gICAgICAgIGNvbnN0IHZvaWQgKmRhdGEsIHNpemVfdCBzaXplLCBpbnQ2NF90IHRpbWVVcykgewotICAgIGlmIChtQnVmZmVyID09IE5VTEwgfHwgbUJ1ZmZlci0+c2l6ZSgpID09IDApIHsKLSAgICAgICAgc3dpdGNoIChtTW9kZSkgewotICAgICAgICAgICAgY2FzZSBIMjY0OgotICAgICAgICAgICAgY2FzZSBNUEVHX1ZJREVPOgotICAgICAgICAgICAgewotI2lmIDAKLSAgICAgICAgICAgICAgICBpZiAoc2l6ZSA8IDQgfHwgbWVtY21wKCJceDAwXHgwMFx4MDBceDAxIiwgZGF0YSwgNCkpIHsKLSAgICAgICAgICAgICAgICAgICAgcmV0dXJuIEVSUk9SX01BTEZPUk1FRDsKLSAgICAgICAgICAgICAgICB9Ci0jZWxzZQotICAgICAgICAgICAgICAgIHVpbnQ4X3QgKnB0ciA9ICh1aW50OF90ICopZGF0YTsKLQotICAgICAgICAgICAgICAgIHNzaXplX3Qgc3RhcnRPZmZzZXQgPSAtMTsKLSAgICAgICAgICAgICAgICBmb3IgKHNpemVfdCBpID0gMDsgaSArIDMgPCBzaXplOyArK2kpIHsKLSAgICAgICAgICAgICAgICAgICAgaWYgKCFtZW1jbXAoIlx4MDBceDAwXHgwMFx4MDEiLCAmcHRyW2ldLCA0KSkgewotICAgICAgICAgICAgICAgICAgICAgICAgc3RhcnRPZmZzZXQgPSBpOwotICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7Ci0gICAgICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgICAgICBpZiAoc3RhcnRPZmZzZXQgPCAwKSB7Ci0gICAgICAgICAgICAgICAgICAgIHJldHVybiBFUlJPUl9NQUxGT1JNRUQ7Ci0gICAgICAgICAgICAgICAgfQotCi0gICAgICAgICAgICAgICAgaWYgKHN0YXJ0T2Zmc2V0ID4gMCkgewotICAgICAgICAgICAgICAgICAgICBBTE9HSSgiZm91bmQgc29tZXRoaW5nIHJlc2VtYmxpbmcgYW4gSC4yNjQvTVBFRyBzeW5jd29yZCBhdCAiCi0gICAgICAgICAgICAgICAgICAgICAgICAgIm9mZnNldCAlbGQiLAotICAgICAgICAgICAgICAgICAgICAgICAgIHN0YXJ0T2Zmc2V0KTsKLSAgICAgICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgICAgICBkYXRhID0gJnB0cltzdGFydE9mZnNldF07Ci0gICAgICAgICAgICAgICAgc2l6ZSAtPSBzdGFydE9mZnNldDsKLSNlbmRpZgotICAgICAgICAgICAgICAgIGJyZWFrOwotICAgICAgICAgICAgfQotCi0gICAgICAgICAgICBjYXNlIE1QRUc0X1ZJREVPOgotICAgICAgICAgICAgewotI2lmIDAKLSAgICAgICAgICAgICAgICBpZiAoc2l6ZSA8IDMgfHwgbWVtY21wKCJceDAwXHgwMFx4MDEiLCBkYXRhLCAzKSkgewotICAgICAgICAgICAgICAgICAgICByZXR1cm4gRVJST1JfTUFMRk9STUVEOwotICAgICAgICAgICAgICAgIH0KLSNlbHNlCi0gICAgICAgICAgICAgICAgdWludDhfdCAqcHRyID0gKHVpbnQ4X3QgKilkYXRhOwotCi0gICAgICAgICAgICAgICAgc3NpemVfdCBzdGFydE9mZnNldCA9IC0xOwotICAgICAgICAgICAgICAgIGZvciAoc2l6ZV90IGkgPSAwOyBpICsgMiA8IHNpemU7ICsraSkgewotICAgICAgICAgICAgICAgICAgICBpZiAoIW1lbWNtcCgiXHgwMFx4MDBceDAxIiwgJnB0cltpXSwgMykpIHsKLSAgICAgICAgICAgICAgICAgICAgICAgIHN0YXJ0T2Zmc2V0ID0gaTsKLSAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOwotICAgICAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgfQotCi0gICAgICAgICAgICAgICAgaWYgKHN0YXJ0T2Zmc2V0IDwgMCkgewotICAgICAgICAgICAgICAgICAgICByZXR1cm4gRVJST1JfTUFMRk9STUVEOwotICAgICAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgICAgIGlmIChzdGFydE9mZnNldCA+IDApIHsKLSAgICAgICAgICAgICAgICAgICAgQUxPR0koImZvdW5kIHNvbWV0aGluZyByZXNlbWJsaW5nIGFuIEguMjY0L01QRUcgc3luY3dvcmQgYXQgIgotICAgICAgICAgICAgICAgICAgICAgICAgICJvZmZzZXQgJWxkIiwKLSAgICAgICAgICAgICAgICAgICAgICAgICBzdGFydE9mZnNldCk7Ci0gICAgICAgICAgICAgICAgfQotCi0gICAgICAgICAgICAgICAgZGF0YSA9ICZwdHJbc3RhcnRPZmZzZXRdOwotICAgICAgICAgICAgICAgIHNpemUgLT0gc3RhcnRPZmZzZXQ7Ci0jZW5kaWYKLSAgICAgICAgICAgICAgICBicmVhazsKLSAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgY2FzZSBBQUM6Ci0gICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgdWludDhfdCAqcHRyID0gKHVpbnQ4X3QgKilkYXRhOwotCi0jaWYgMAotICAgICAgICAgICAgICAgIGlmIChzaXplIDwgMiB8fCBwdHJbMF0gIT0gMHhmZiB8fCAocHRyWzFdID4+IDQpICE9IDB4MGYpIHsKLSAgICAgICAgICAgICAgICAgICAgcmV0dXJuIEVSUk9SX01BTEZPUk1FRDsKLSAgICAgICAgICAgICAgICB9Ci0jZWxzZQotICAgICAgICAgICAgICAgIHNzaXplX3Qgc3RhcnRPZmZzZXQgPSAtMTsKLSAgICAgICAgICAgICAgICBmb3IgKHNpemVfdCBpID0gMDsgaSA8IHNpemU7ICsraSkgewotICAgICAgICAgICAgICAgICAgICBpZiAoSXNTZWVtaW5nbHlWYWxpZEFEVFNIZWFkZXIoJnB0cltpXSwgc2l6ZSAtIGkpKSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICBzdGFydE9mZnNldCA9IGk7Ci0gICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKLSAgICAgICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgICAgIGlmIChzdGFydE9mZnNldCA8IDApIHsKLSAgICAgICAgICAgICAgICAgICAgcmV0dXJuIEVSUk9SX01BTEZPUk1FRDsKLSAgICAgICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgICAgICBpZiAoc3RhcnRPZmZzZXQgPiAwKSB7Ci0gICAgICAgICAgICAgICAgICAgIEFMT0dJKCJmb3VuZCBzb21ldGhpbmcgcmVzZW1ibGluZyBhbiBBQUMgc3luY3dvcmQgYXQgb2Zmc2V0ICVsZCIsCi0gICAgICAgICAgICAgICAgICAgICAgICAgc3RhcnRPZmZzZXQpOwotICAgICAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgICAgIGRhdGEgPSAmcHRyW3N0YXJ0T2Zmc2V0XTsKLSAgICAgICAgICAgICAgICBzaXplIC09IHN0YXJ0T2Zmc2V0OwotI2VuZGlmCi0gICAgICAgICAgICAgICAgYnJlYWs7Ci0gICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgIGNhc2UgTVBFR19BVURJTzoKLSAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICB1aW50OF90ICpwdHIgPSAodWludDhfdCAqKWRhdGE7Ci0KLSAgICAgICAgICAgICAgICBzc2l6ZV90IHN0YXJ0T2Zmc2V0ID0gLTE7Ci0gICAgICAgICAgICAgICAgZm9yIChzaXplX3QgaSA9IDA7IGkgPCBzaXplOyArK2kpIHsKLSAgICAgICAgICAgICAgICAgICAgaWYgKElzU2VlbWluZ2x5VmFsaWRNUEVHQXVkaW9IZWFkZXIoJnB0cltpXSwgc2l6ZSAtIGkpKSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICBzdGFydE9mZnNldCA9IGk7Ci0gICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKLSAgICAgICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgICAgIGlmIChzdGFydE9mZnNldCA8IDApIHsKLSAgICAgICAgICAgICAgICAgICAgcmV0dXJuIEVSUk9SX01BTEZPUk1FRDsKLSAgICAgICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgICAgICBpZiAoc3RhcnRPZmZzZXQgPiAwKSB7Ci0gICAgICAgICAgICAgICAgICAgIEFMT0dJKCJmb3VuZCBzb21ldGhpbmcgcmVzZW1ibGluZyBhbiBNUEVHIGF1ZGlvIC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i0gICAgICAgICAgICBBU3RyaW5nIG91dDsKLSNlbmRpZgotCi0gICAgICAgICAgICBzaXplX3QgZHN0T2Zmc2V0ID0gMDsKLSAgICAgICAgICAgIGZvciAoc2l6ZV90IGkgPSAwOyBpIDwgbmFscy5zaXplKCk7ICsraSkgewotICAgICAgICAgICAgICAgIGNvbnN0IE5BTFBvc2l0aW9uICZwb3MgPSBuYWxzLml0ZW1BdChpKTsKLQotICAgICAgICAgICAgICAgIHVuc2lnbmVkIG5hbFR5cGUgPSBtQnVmZmVyLT5kYXRhKClbcG9zLm5hbE9mZnNldF0gJiAweDFmOwotCi0jaWYgIUxPR19OREVCVUcKLSAgICAgICAgICAgICAgICBjaGFyIHRtcFsxMjhdOwotICAgICAgICAgICAgICAgIHNwcmludGYodG1wLCAiMHglMDJ4IiwgbmFsVHlwZSk7Ci0gICAgICAgICAgICAgICAgaWYgKGkgPiAwKSB7Ci0gICAgICAgICAgICAgICAgICAgIG91dC5hcHBlbmQoIiwgIik7Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgIG91dC5hcHBlbmQodG1wKTsKLSNlbmRpZgotCi0gICAgICAgICAgICAgICAgbWVtY3B5KGFjY2Vzc1VuaXQtPmRhdGEoKSArIGRzdE9mZnNldCwgIlx4MDBceDAwXHgwMFx4MDEiLCA0KTsKLQotICAgICAgICAgICAgICAgIG1lbWNweShhY2Nlc3NVbml0LT5kYXRhKCkgKyBkc3RPZmZzZXQgKyA0LAotICAgICAgICAgICAgICAgICAgICAgICBtQnVmZmVyLT5kYXRhKCkgKyBwb3MubmFsT2Zmc2V0LAotICAgICAgICAgICAgICAgICAgICAgICBwb3MubmFsU2l6ZSk7Ci0KLSAgICAgICAgICAgICAgICBkc3RPZmZzZXQgKz0gcG9zLm5hbFNpemUgKyA0OwotICAgICAgICAgICAgfQotCi0gICAgICAgICAgICBBTE9HVigiYWNjZXNzVW5pdCBjb250YWlucyBuYWwgdHlwZXMgJXMiLCBvdXQuY19zdHIoKS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pemUsCi0gICAgICAgICAgICBtQnVmZmVyLT5zaXplKCkgLSBmcmFtZVNpemUpOwotCi0gICAgbUJ1ZmZlci0+c2V0UmFuZ2UoMCwgbUJ1ZmZlci0+c2l6ZSgpIC0gZnJhbWVTaXplKTsKLQotICAgIGludDY0X3QgdGltZVVzID0gZmV0Y2hUaW1lc3RhbXAoZnJhbWVTaXplKTsKLSAgICBDSEVDS19HRSh0aW1lVXMsIDBsbCk7Ci0KLSAgICBhY2Nlc3NVbml0LT5tZXRhKCktPnNldEludDY0KCJ0aW1lVXMiLCB0aW1lVXMpOwotCi0gICAgaWYgKG1Gb3JtYXQgPT0gTlVMTCkgewotICAgICAgICBtRm9ybWF0ID0gbmV3IE1ldGFEYXRhOwotCi0gICAgICAgIHN3aXRjaCAobGF5ZXIpIHsKLSAgICAgICAgICAgIGNhc2UgMToKLSAgICAgICAgICAgICAgICBtRm9ybWF0LT5zZXRDU3RyaW5nKAotICAgICAgICAgICAgICAgICAgICAgICAga0tleU1JTUVUeXBlLCBNRURJQV9NSU1FVFlQRV9BVURJT19NUEVHX0xBWUVSX0kpOwotICAgICAgICAgICAgICAgIGJyZWFrOwotICAgICAgICAgICAgY2FzZSAyOgotICAgICAgICAgICAgICAgIG1Gb3JtYXQtPnNldENTdHJpbmcoCi0gICAgICAgICAgICAgICAgICAgICAgICBrS2V5TUlNRVR5cGUsIE1FRElBX01JTUVUWVBFX0FVRElPX01QRUdfTEFZRVJfSUkpOwotICAgICAgICAgICAgICAgIGJyZWFrOwotICAgICAgICAgICAgY2FzZSAzOgotICAgICAgICAgICAgICAgIG1Gb3JtYXQtPnNldENTdHJpbmcoCi0gICAgICAgICAgICAgICAgICAgICAgICBrS2V5TUlNRVR5cGUsIE1FRElBX01JTUVUWVBFX0FVRElPX01QRUcpOwotICAgICAgICAgICAgICAgIGJyZWFrOwotICAgICAgICAgICAgZGVmYXVsdDoKLSAgICAgICAgICAgICAgICBUUkVTUEFTUygpOwotICAgICAgICB9Ci0KLSAg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b3JtYXQgPT0gTlVMTCkgewotICAgICAgICAgICAgbWVtbW92ZShtQnVmZmVyLT5kYXRhKCksIG1CdWZmZXItPmRhdGEoKSArIG9mZnNldCwgc2l6ZSAtIG9mZnNldCk7Ci0gICAgICAgICAgICBzaXplIC09IG9mZnNldDsKLSAgICAgICAgICAgICh2b2lkKWZldGNoVGltZXN0YW1wKG9mZnNldCk7Ci0gICAgICAgICAgICBvZmZzZXQgPSAwOwotICAgICAgICAgICAgbUJ1ZmZlci0+c2V0UmFuZ2UoMCwgc2l6ZSk7Ci0gICAgICAgIH0KLQotICAgICAgICBpZiAoKHByZXZTdGFydENvZGUgPT0gMHhiMyAmJiBjdXJyZW50U3RhcnRDb2RlICE9IDB4YjUpCi0gICAgICAgICAgICAgICAgfHwgKHBwcmV2U3RhcnRDb2RlID09IDB4YjMgJiYgcHJldlN0YXJ0Q29kZSA9PSAweGI1KSkgewotICAgICAgICAgICAgLy8gc2VxSGVhZGVyIHdpdGhvdXQvd2l0aCBleHRlbnNpb24KLQotICAgICAgICAgICAgaWYgKG1Gb3JtYXQgPT0gTlVMTCkgewotICAgICAgICAgICAgICAgIENIRUNLX0dFKHNpemUsIDd1KTsKLQotICAgICAgICAgICAgICAgIHVuc2lnbmVkIHdpZHRoID0KLSAgICAgICAgICAgICAgICAgICAgKGRhdGFbNF0gPDwgNCkgfCBkYXRhWzVdID4+IDQ7Ci0KLSAgICAgICAgICAgICAgICB1bnNpZ25lZCBoZWlnaHQgPQotICAgICAgICAgICAgICAgICAgICAoKGRhdGFbNV0gJiAweDBmKSA8PCA4KSB8IGRhdGFbNl07Ci0KLSAgICAgICAgICAgICAgICBtRm9ybWF0ID0gbmV3IE1ldGFEYXRhOwotICAgICAgICAgICAgICAgIG1Gb3JtYXQtPnNldENTdHJpbmcoa0tleU1JTUVUeXBlLCBNRURJQV9NSU1FVFlQRV9WSURFT19NUEVHMik7Ci0gICAgICAgICAgICAgICAgbUZvcm1hdC0+c2V0SW50MzIoa0tleVdpZ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gICBzdGF0ZSA9IEVYUEVDVF9WSVNVQUxfT0JKRUNUX1NUQVJUOwotICAgICAgICAgICAgICAgIH0gZWxzZSB7Ci0gICAgICAgICAgICAgICAgICAgIGRpc2NhcmQgPSB0cnVlOwotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICBicmVhazsKLSAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgY2FzZSBFWFBFQ1RfVklTVUFMX09CSkVDVF9TVEFSVDoKLSAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICBDSEVDS19FUShjaHVua1R5cGUsIDB4YjUpOwotICAgICAgICAgICAgICAgIHN0YXRlID0gRVhQRUNUX1ZPX1NUQVJUOwotICAgICAgICAgICAgICAgIGJyZWFrOwotICAgICAgICAgICAgfQotCi0gICAgICAgICAgICBjYXNlIEVYUEVDVF9WT19TVEFSVDoKLSAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICBDSEVDS19MRShjaHVua1R5cGUsIDB4MWYpOwotICAgICAgICAgICAgICAgIHN0YXRlID0gRVhQRUNUX1ZPTF9TVEFSVDsKLSAgICAgICAgICAgICAgICBicmVhazsKLSAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgY2FzZSBFWFBFQ1RfVk9MX1NUQVJUOgotICAgICAgICAgICAgewotICAgICAgICAgICAgICAgIENIRUNLKChjaHVua1R5cGUgJiAweGYwKSA9PSAweDIwKTsKLQotICAgICAgICAgICAgICAgIENIRUNLKEV4dHJhY3REaW1lbnNpb25zRnJvbVZPTEhlYWRlcigKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAmZGF0YVtvZmZzZXRdLCBjaHVua1NpemUsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgJndpZHRoLCAmaGVpZ2h0KSk7Ci0KLSAgICAgICAgICAgICAgICBzdGF0ZSA9IFdBSVRfRk9SX1ZPUF9TVEFSVDsKLSAgICAgICAgICAgICAgICBicmVhazsKLSAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgY2FzZSBXQUlUX0ZPUl9WT1BfU1RBUlQ6Ci0gICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgaWYgKGNodW5rVHlwZSA9PSAweGIzIHx8IGNodW5rVHlwZSA9PSAweGI2KSB7Ci0gICAgICAgICAgICAgICAgICAgIC8vIGdyb3VwIG9mIFZPUCBvciBWT1Agc3RhcnQuCi0KLSAgICAgICAgICAgICAgICAgICAgbUZvcm1hdCA9IG5ldyBNZXRhRGF0YTsKLSAgICAgICAgICAgICAgICAgICAgbUZvcm1hdC0+c2V0Q1N0cmluZygKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBrS2V5TUlNRVR5cGUsIE1FRElBX01JTUVUWVBFX1ZJREVPX01QRUc0KTsKLQotICAgICAgICAgICAgICAgICAgICBtRm9ybWF0LT5zZXRJbnQzMihrS2V5V2lkdGgsIHdpZHRoKTsKLSAgICAgICAgICAgICAgICAgICAgbUZvcm1hdC0+c2V0SW50MzIoa0tleUhlaWdodCwgaGVpZ2h0KTsKLQotICAgICAgICAgICAgICAgICAgICBBTE9HSSgiZm91bmQgTVBFRzQgdmlkZW8gY29kZWMgY29uZmlnICglZCB4ICVkKSIsCi0gICAgICAgICAgICAgICAgICAgICAgICAgd2lkdGgsIGhlaWdodCk7Ci0KLSAgICAgICAgICAgICAgICAgICAgc3A8QUJ1ZmZlcj4gY3NkID0gbmV3IEFCdWZmZXIob2Zmc2V0KTsKLSAgICAgICAgICAgICAgICAgICAgbWVtY3B5KGNzZC0+ZGF0YSgpLCBkYXRhLCBvZmZzZXQpOwotCi0gICAgICAgICAgICAgICAgICAgIC8vIGhleGR1bXAoY3NkLT5kYXRhKCksIGNzZC0+c2l6ZSgpKTsKLQotICAgICAgICAgICAgICAgICAgICBzcDxBQnVmZmVyPiBlc2RzID0gTWFrZU1QRUdWaWRlb0VTRFMoY3NkKTsKLSAgICAgICAgICAgICAgICAgICAgbUZvcm1hdC0+c2V0RGF0YSgKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBrS2V5RVNEUywga1R5cGVFU0RTLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgIGVzZHMtPmRhdGEoKSwgZXNkcy0+c2l6ZSgpKTsKLQotICAgICAgICAgICAgICAgICAgICBkaXNjYXJkID0gdHJ1ZTsKLSAgICAgICAgICAgICAgICAgICAgc3RhdGUgPSBTS0lQX1RPX1ZPUF9TVEFSVDsKLSAgICAgICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgICAgICBicmVhazsKLSAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgY2FzZSBTS0lQX1RPX1ZPUF9TVEFSVDoKLSAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICBpZiAoY2h1bmtUeXBlID09IDB4YjYpIHsKLSAgICAgICAgICAgICAgICAgICAgb2Zmc2V0ICs9IGNodW5rU2l6ZTsKLQotICAgICAgICAgICAgICAgICAgICBzcDxBQnVmZmVyPiBhY2Nlc3NVbml0ID0gbmV3IEFCdWZmZXIob2Zmc2V0KTsKLSAgICAgICAgICAgICAgICAgICAgbWVtY3B5KGFjY2Vzc1VuaXQtPmRhdGEoKSwgZGF0YSwgb2Zmc2V0KTsKLQotICAgICAgICAgICAgICAgICAgICBtZW1tb3ZlKGRhdGEsICZkYXRhW29mZnNldF0sIHNpemUgLSBvZmZzZXQpOwotICAgICAgICAgICAgICAgICAgICBzaXplIC09IG9mZnNldDsKLSAgICAgICAgICAgICAgICAgICAgbUJ1ZmZlci0+c2V0UmFuZ2UoMCwgc2l6ZSk7Ci0KLSAgICAgICAgICAgICAgICAgICAgaW50NjRfdCB0aW1lVXMgPSBmZXRjaFRpbWVzdGFtcChvZmZzZXQpOwotICAgICAgICAgICAgICAgICAgICBDSEVDS19HRSh0aW1lVXMsIDBsbCk7Ci0KLSAgICAgICAgICAgICAgICAgICAgb2Zmc2V0ID0gMDsKLQotICAgICAgICAgICAgICAgICAgICBhY2Nlc3NVbml0LT5tZXRhKCktPnNldEludDY0KCJ0aW1lVXMiLCB0aW1lVXMpOwotCi0gICAgICAgICAgICAgICAgICAgIEFMT0dWKCJyZXR1cm5pbmcgTVBFRzQgdmlkZW8gYWNjZXNzIHVuaXQgYXQgdGltZSAlbGxkIHVzIiwKLSAgICAgICAgICAgICAgICAgICAgICAgICB0aW1lVXMpOwotCi0gICAgICAgICAgICAgICAgICAgIC8vIGhleGR1bXAoYWNjZXNzVW5pdC0+ZGF0YSgpLCBhY2Nlc3NVbml0LT5zaXplKCkpOwotCi0gICAgICAgICAgICAgICAgICAgIHJldHVybiBhY2Nlc3NVbml0OwotICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAoY2h1bmtUeXBlICE9IDB4YjMpIHsKLSAgICAgICAgICAgICAgICAgICAgb2Zmc2V0ICs9IGNodW5rU2l6ZTsKLSAgICAgICAgICAgICAgICAgICAgZGlzY2FyZCA9IHRydWU7Ci0gICAgICAgICAgICAgICAgfQotCi0gICAgICAgICAgICAgICAgYnJlYWs7Ci0gICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgIGRlZmF1bHQ6Ci0gICAgICAgICAgICAgICAgVFJFU1BBU1MoKTsKLSAgICAgICAgfQotCi0gICAgICAgIGlmIChkaXNjYXJkKSB7Ci0gICAgICAgICAgICAodm9pZClmZXRjaFRpbWVzdGFtcChvZmZzZXQpOwotICAgICAgICAgICAgbWVtbW92ZShkYXRhLCAmZGF0YVtvZmZzZXRdLCBzaXplIC0gb2Zmc2V0KTsKLSAgICAgICAgICAgIHNpemUgLT0gb2Zmc2V0OwotICAgICAgICAgICAgb2Zmc2V0ID0gMDsKLSAgICAgICAgICAgIG1CdWZmZXItPnNldFJhbmdlKDAsIHNpemUpOwotICAgICAgICB9IGVsc2UgewotICAgICAgICAgICAgb2Zmc2V0ICs9IGNodW5rU2l6ZTsKLSAgICAgICAgfQotICAgIH0KLQotICAgIHJldHVybiBOVUxMOwotfQotCi19ICAvLyBuYW1lc3BhY2UgYW5kcm9pZApkaWZmIC0tZ2l0IGEvbWVkaWEvbG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CA0KSB7Ci0gICAgICAgIHJldHVybiAtRUFHQUlOOwotICAgIH0KLQotICAgIGlmIChtZW1jbXAoIlx4MDBceDAwXHgwMSIsIG1CdWZmZXItPmRhdGEoKSwgMykpIHsKLSAgICAgICAgcmV0dXJuIEVSUk9SX01BTEZPUk1FRDsKLSAgICB9Ci0KLSAgICB1bnNpZ25lZCBjaHVua1R5cGUgPSBtQnVmZmVyLT5kYXRhKClbM107Ci0KLSAgICBzc2l6ZV90IHJlczsKLQotICAgIHN3aXRjaCAoY2h1bmtUeXBlKSB7Ci0gICAgICAgIGNhc2UgMHhiYToKLSAgICAgICAgewotICAgICAgICAgICAgcmVzID0gZGVxdWV1ZVBhY2soKTsKLSAgICAgICAgICAgIGJyZWFrOwotICAgICAgICB9Ci0KLSAgICAgICAgY2FzZSAweGJiOgotICAgICAgICB7Ci0gICAgICAgICAgICByZXMgPSBkZXF1ZXVlU3lzdGVtSGVhZGVyKCk7Ci0gICAgICAgICAgICBicmVhazsKLSAgICAgICAgfQotCi0gICAgICAgIGRlZmF1bHQ6Ci0gICAgICAgIHsKLSAgICAgICAgICAgIHJlcyA9IGRlcXVldWVQRVMoKTsKLSAgICAgICAgICAgIGJyZWFrOwotICAgICAgICB9Ci0gICAgfQotCi0gICAgaWYgKHJlcyA+IDApIHsKLSAgICAgICAgaWYgKG1CdWZmZXItPnNpemUoKSA8IChzaXplX3QpcmVzKSB7Ci0gICAgICAgICAgICByZXR1cm4gLUVBR0FJTjsKLSAgICAgICAgfQotCi0gICAgICAgIG1CdWZmZXItPnNldFJhbmdlKG1CdWZmZXItPm9mZnNldCgpICsgcmVzLCBtQnVmZmVyLT5zaXplKCkgLSByZXMpOwotICAgICAgICByZXMgPSBPSzsKLSAgICB9Ci0KLSAgICByZXR1cm4gcmVzOwotfQotCi1zc2l6ZV90IE1QRUcyUFNFeHRyYWN0b3I6OmRlcXVldWVQYWNrKCkgewotICAgIC8vIDMyICsgMiArIDMgKyAxICsgMTUgKyAxICsgMTUrI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AgICAgRFRTID0gKCh1aW50NjRfdClici5nZXRCaXRzKDMpKSA8PCAzMDsKLSAgICAgICAgICAgICAgICBDSEVDS19FUShici5nZXRCaXRzKDEpLCAxdSk7Ci0gICAgICAgICAgICAgICAgRFRTIHw9ICgodWludDY0X3QpYnIuZ2V0Qml0cygxNSkpIDw8IDE1OwotICAgICAgICAgICAgICAgIENIRUNLX0VRKGJyLmdldEJpdHMoMSksIDF1KTsKLSAgICAgICAgICAgICAgICBEVFMgfD0gYnIuZ2V0Qml0cygxNSk7Ci0gICAgICAgICAgICAgICAgQ0hFQ0tfRVEoYnIuZ2V0Qml0cygxKSwgMXUpOwotCi0gICAgICAgICAgICAgICAgQUxPR1YoIkRUUyA9ICVsbHUiLCBEVFMpOwotCi0gICAgICAgICAgICAgICAgb3B0aW9uYWxfYnl0ZXNfcmVtYWluaW5nIC09IDU7Ci0gICAgICAgICAgICB9Ci0gICAgICAgIH0KLQotICAgICAgICBpZiAoRVNDUl9mbGFnKSB7Ci0gICAgICAgICAgICBDSEVDS19HRShvcHRpb25hbF9ieXRlc19yZW1haW5pbmcsIDZ1KTsKLQotICAgICAgICAgICAgYnIuZ2V0Qml0cygyKTsKLQotICAgICAgICAgICAgdWludDY0X3QgRVNDUiA9ICgodWludDY0X3QpYnIuZ2V0Qml0cygzKSkgPDwgMzA7Ci0gICAgICAgICAgICBDSEVDS19FUShici5nZXRCaXRzKDEpLCAxdSk7Ci0gICAgICAgICAgICBFU0NSIHw9ICgodWludDY0X3QpYnIuZ2V0Qml0cygxNSkpIDw8IDE1OwotICAgICAgICAgICAgQ0hFQ0tfRVEoYnIuZ2V0Qml0cygxKSwgMXUpOwotICAgICAgICAgICAgRVNDUiB8PSBici5nZXRCaXRzKDE1KTsKLSAgICAgICAgICAgIENIRUNLX0VRKGJyLmdldEJpdHMoMSksIDF1KTsKLQotICAgICAgICAgICAgQUxPR1YoIkVTQ1IgPSAlbGx1IiwgRVNDUik7Ci0gICAgICAgICAgICAvKiB1bnNp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WlyZWQgPSAlZCkiLAotICAgICAgICAgICAgICAgICBici5udW1CaXRzTGVmdCgpLCBkYXRhTGVuZ3RoICogOCk7Ci0KLSAgICAgICAgICAgIHJldHVybiBFUlJPUl9NQUxGT1JNRUQ7Ci0gICAgICAgIH0KLQotICAgICAgICBDSEVDS19HRShici5udW1CaXRzTGVmdCgpLCBkYXRhTGVuZ3RoICogOCk7Ci0KLSAgICAgICAgc3NpemVfdCBpbmRleCA9IG1UcmFja3MuaW5kZXhPZktleShzdHJlYW1faWQpOwotICAgICAgICBpZiAoaW5kZXggPCAwICYmIG1TY2FubmluZykgewotICAgICAgICAgICAgdW5zaWduZWQgc3RyZWFtVHlwZTsKLQotICAgICAgICAgICAgc3NpemVfdCBzdHJlYW1UeXBlSW5kZXg7Ci0gICAgICAgICAgICBpZiAobVByb2dyYW1TdHJlYW1NYXBWYWxpZAotICAgICAgICAgICAgICAgICAgICAmJiAoc3RyZWFtVHlwZUluZGV4ID0KLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBtU3RyZWFtVHlwZUJ5RVNJRC5pbmRleE9mS2V5KHN0cmVhbV9pZCkpID49IDApIHsKLSAgICAgICAgICAgICAgICBzdHJlYW1UeXBlID0gbVN0cmVhbVR5cGVCeUVTSUQudmFsdWVBdChzdHJlYW1UeXBlSW5kZXgpOwotICAgICAgICAgICAgfSBlbHNlIGlmICgoc3RyZWFtX2lkICYgfjB4MWYpID09IDB4YzApIHsKLSAgICAgICAgICAgICAgICAvLyBJU08vSUVDIDEzODE4LTMgb3IgSVNPL0lFQyAxMTE3Mi0zIG9yIElTTy9JRUMgMTM4MTgtNwotICAgICAgICAgICAgICAgIC8vIG9yIElTTy9JRUMgMTQ0OTYtMyBhdWRpbwotICAgICAgICAgICAgICAgIHN0cmVhbVR5cGUgPSBBVFNQYXJzZXI6OlNUUkVBTVRZUEVfTVBFRzJfQVVESU87Ci0gICAgICAgICAgICB9IGVsc2UgaWYgKChzdHJlYW1faWQgJiB+MHgwZikgPT0gMHhlMCkgewotICAgICAgICAgICAgICAgIC8vIElTTy9JRUMgMTM4MTgtMiBvciBJU08vSUVDIDExMTcyLTIgb3IgSVNPL0lFQyAxNDQ5Ni0yIHZpZGVvCi0gICAgICAgICAgICAgICAgc3RyZWFtVHlwZSA9IEFUU1BhcnNlcjo6U1RSRUFNVFlQRV9NUEVHMl9WSURFTzsKLSAgICAgICAgICAgIH0gZWxzZSB7Ci0gICAgICAgICAgICAgICAgc3RyZWFtVHlwZSA9IEFUU1BhcnNlcjo6U1RSRUFNVFlQRV9SRVNFUlZFRDsKLSAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgaW5kZXggPSBtVHJhY2tzLmFkZCgKLSAgICAgICAgICAgICAgICAgICAgc3RyZWFtX2lkLCBuZXcgVHJhY2sodGhpcywgc3RyZWFtX2lkLCBzdHJlYW1UeXBlKSk7Ci0gICAgICAgIH0KLQotICAgICAgICBzdGF0dXNfdCBlcnIgPSBPSzsKLQotICAgICAgICBpZiAoaW5kZXggPj0gMCkgewotICAgICAgICAgICAgZXJyID0KLSAgICAgICAgICAgICAgICBtVHJhY2tzLmVkaXRWYWx1ZUF0KGluZGV4KS0+YXBwZW5kUEVTRGF0YSgKLSAgICAgICAgICAgICAgICAgICAgUFRTX0RUU19mbGFncywgUFRTLCBEVFMsIGJyLmRhdGEoKSwgZGF0YUxlbmd0aCk7Ci0gICAgICAgIH0KLQotICAgICAgICBici5za2lwQml0cyhkYXRhTGVuZ3RoICogOCk7Ci0KLSAgICAgICAgaWYgKGVyciAhPSBPSykgewotICAgICAgICAgICAgcmV0dXJuIGVycjsKLSAgICAgICAgfQotICAgIH0gZWxzZSBpZiAoc3RyZWFtX2lkID09IDB4YmUpIHsgIC8vIHBhZGRpbmdfc3RyZWFtCi0gICAgICAgIENIRUNLX05FKFBFU19wYWNrZXRfbGVuZ3RoLCAwdSk7Ci0gICAgICAgIGJyLnNraXBCaXRzKFBFU19wYWNrZXRfbGVuZ3RoICogOCk7Ci0gICAgfSB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plICogaSwgJmhlYWRlciwgMSkgIT0gMQotICAgICAgICAgICAgICAgIHx8IGhlYWRlciAhPSAweDQ3KSB7Ci0gICAgICAgICAgICByZXR1cm4gZmFsc2U7Ci0gICAgICAgIH0KLSAgICB9Ci0KLSAgICAqY29uZmlkZW5jZSA9IDAuMWY7Ci0gICAgbWltZVR5cGUtPnNldFRvKE1FRElBX01JTUVUWVBFX0NPTlRBSU5FUl9NUEVHMlRTKTsKLQotICAgIHJldHVybiB0cnVlOwotfQotCi19ICAvLyBuYW1lc3BhY2UgYW5kcm9pZApkaWZmIC0tZ2l0IGEvbWVkaWEvbGlic3RhZ2VmcmlnaHQvb214L0FuZHJvaWQubWsgYi9tZWRpYS9saWJzdGFnZWZyaWdodC9vbXgvQW5kcm9pZC5tawpkZWxldGVkIGZpbGUgbW9kZSAxMDA2NDQKaW5kZXggZDIwZWNiNi4uMDAwMDAwMAotLS0gYS9tZWRpYS9saWJzdGFnZWZyaWdodC9vbXgvQW5kcm9pZC5taworKysgL2Rldi9udWxsCkBAIC0xLDMyICswLDAgQEAKLUxPQ0FMX1BBVEg6PSAkKGNhbGwgbXktZGlyKQotaW5jbHVkZSAkKENMRUFSX1ZBUlMpCi0KLUxPQ0FMX1NSQ19GSUxFUzo9ICAgICAgICAgICAgICAgICAgICAgXAotICAgICAgICBPTVguY3BwICAgICAgICAgICAgICAgICAgICAgICBcCi0gICAgICAgIE9NWE1hc3Rlci5jcHAgICAgICAgICAgICAgICAgIFwKLSAgICAgICAgT01YTm9kZUluc3RhbmNlLmNwcCAgICAgICAgICAgXAotICAgICAgICBTaW1wbGVTb2Z0T01YQ29tcG9uZW50LmNwcCAgICBcCi0gICAgICAgIFNvZnRPTVhDb21wb25lbnQuY3BwICAgICAgICAgIFwKLSAgICAgICAgU29mdE9NWFBsdWdpbi5jcHAgICAgICAgICAgICAgXAotCi1MT0NBTF9DX0lOQ0xVREVTICs9IFwKLSAgICAgICAgZnJhbWV3b3Jrcy9iYXNlL21lZGlhL2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gIT0gT01YX1N0YXRlSW52YWxpZCkgewotICAgICAgICAgICAgICAgIGlmICgrK2l0ZXJhdGlvbiA+IGtNYXhOdW1JdGVyYXRpb25zKSB7Ci0gICAgICAgICAgICAgICAgICAgIEFMT0dFKCJjb21wb25lbnQgZmFpbGVkIHRvIGVudGVyIElkbGUgc3RhdGUsIGFib3J0aW5nLiIpOwotICAgICAgICAgICAgICAgICAgICBzdGF0ZSA9IE9NWF9TdGF0ZUludmFsaWQ7Ci0gICAgICAgICAgICAgICAgICAgIGJyZWFrOwotICAgICAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgICAgIHVzbGVlcCgxMDAwMDApOwotICAgICAgICAgICAgfQotICAgICAgICAgICAgQ0hFQ0tfRVEoZXJyLCBPTVhfRXJyb3JOb25lKTsKLQotICAgICAgICAgICAgaWYgKHN0YXRlID09IE9NWF9TdGF0ZUludmFsaWQpIHsKLSAgICAgICAgICAgICAgICBicmVhazsKLSAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgLy8gZmFsbCB0aHJvdWdoCi0gICAgICAgIH0KLQotICAgICAgICBjYXNlIE9NWF9TdGF0ZUlkbGU6Ci0gICAgICAgIHsKLSAgICAgICAgICAgIEFMT0dWKCJmb3JjaW5nIElkbGUtPkxvYWRlZCIpOwotICAgICAgICAgICAgc2VuZENvbW1hbmQoT01YX0NvbW1hbmRTdGF0ZVNldCwgT01YX1N0YXRlTG9hZGVkKTsKLQotICAgICAgICAgICAgZnJlZUFjdGl2ZUJ1ZmZlcnMoKTsKLQotICAgICAgICAgICAgT01YX0VSUk9SVFlQRSBlcnI7Ci0gICAgICAgICAgICBpbnQzMl90IGl0ZXJhdGlvbiA9IDA7Ci0gICAgICAgICAgICB3aGlsZSAoKGVyciA9IE9NWF9HZXRTdGF0ZShtSGFuZGxlLCAmc3RhdGUpKSA9PSBPTVhfRXJyb3JOb25lCi0gICAgICAgICAgICAgICAgICAgJiYgc3RhdGUgIT0gT01YX1N0YXRlTG9hZGVkCi0gICAgICAgICAgICAgICAgICAgJiYgc3RhdGUgIT0gT01YX1N0YXRlSW52YWxpZCkgewotICAgICAgICAgICAgICAgIGlmICgrK2l0ZXJhdGlvbiA+IGtNYXhOdW1JdGVyYXRpb25zKSB7Ci0gICAgICAgICAgICAgICAgICAgIEFMT0dFKCJjb21wb25lbnQgZmFpbGVkIHRvIGVudGVyIExvYWRlZCBzdGF0ZSwgYWJvcnRpbmcuIik7Ci0gICAgICAgICAgICAgICAgICAgIHN0YXRlID0gT01YX1N0YXRlSW52YWxpZDsKLSAgICAgICAgICAgICAgICAgICAgYnJlYWs7Ci0gICAgICAgICAgICAgICAgfQotCi0gICAgICAgICAgICAgICAgQUxPR1YoIndhaXRpbmcgZm9yIExvYWRlZCBzdGF0ZS4uLiIpOwotICAgICAgICAgICAgICAgIHVzbGVlcCgxMDAwMDApOwotICAgICAgICAgICAgfQotICAgICAgICAgICAgQ0hFQ0tfRVEoZXJyLCBPTVhfRXJyb3JOb25lKTsKLQotICAgICAgICAgICAgLy8gZmFsbCB0aHJvdWdoCi0gICAgICAgIH0KLQotICAgICAgICBjYXNlIE9NWF9TdGF0ZUxvYWRlZDoKLSAgICAgICAgY2FzZSBPTVhfU3RhdGVJbnZhbGlkOgotICAgICAgICAgICAgYnJlYWs7Ci0KLSAgICAgICAgZGVmYXVsdDoKLSAgICAgICAgICAgIENIRUNLKCEic2hvdWxkIG5vdCBiZSBoZXJlLCB1bmtub3duIHN0YXRlLiIpOwotICAgICAgICAgICAgYnJlYWs7Ci0gICAgfQotCi0gICAgQUxPR1YoImNhbGxpbmcgZGVzdHJveUNvbXBvbmVudEluc3RhbmNlIik7Ci0gICAgT01YX0VSUk9SVFlQRSBlcnIgPSBtYXN0ZXItPmRlc3Ryb3lDb21wb25lbnRJbnN0YW5jZSgKLSAgICAgICAgICAgIHN0YXRpY19jYXN0PE9NWF9DT01QT05FTlRUWVBFICo+KG1IYW5kbGUpKTsKLSAgICBBTE9HVigiZGVzdHJveUNvbXBvbmVud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hbVBvcnREZWZpbml0aW9uOgotICAgICAgICB7Ci0gICAgICAgICAgICBPTVhfUEFSQU1fUE9SVERFRklOSVRJT05UWVBFICpkZWZQYXJhbXMgPQotICAgICAgICAgICAgICAgIChPTVhfUEFSQU1fUE9SVERFRklOSVRJT05UWVBFICopcGFyYW1zOwotCi0gICAgICAgICAgICBpZiAoZGVmUGFyYW1zLT5uUG9ydEluZGV4ID49IG1Qb3J0cy5zaXplKCkKLSAgICAgICAgICAgICAgICAgICAgfHwgZGVmUGFyYW1zLT5uU2l6ZQotICAgICAgICAgICAgICAgICAgICAgICAgICAgICE9IHNpemVvZihPTVhfUEFSQU1fUE9SVERFRklOSVRJT05UWVBFKSkgewotICAgICAgICAgICAgICAgIHJldHVybiBPTVhfRXJyb3JVbmRlZmluZWQ7Ci0gICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgIGNvbnN0IFBvcnRJbmZvICpwb3J0ID0KLSAgICAgICAgICAgICAgICAmbVBvcnRzLml0ZW1BdChkZWZQYXJhbXMtPm5Qb3J0SW5kZXgpOwotCi0gICAgICAgICAgICBtZW1jcHkoZGVmUGFyYW1zLCAmcG9ydC0+bURlZiwgc2l6ZW9mKHBvcnQtPm1EZWYpKTsKLQotICAgICAgICAgICAgcmV0dXJuIE9NWF9FcnJvck5vbmU7Ci0gICAgICAgIH0KLQotICAgICAgICBkZWZhdWx0OgotICAgICAgICAgICAgcmV0dXJuIE9NWF9FcnJvclVuc3VwcG9ydGVkSW5kZXg7Ci0gICAgfQotfQotCi1PTVhfRVJST1JUWVBFIFNpbXBsZVNvZnRPTVhDb21wb25lbnQ6OmludGVybmFsU2V0UGFyYW1ldGVyKAotICAgICAgICBPTVhfSU5ERVhUWVBFIGluZGV4LCBjb25zdCBPTVhfUFRSIHBhcmFtcykgewotICAgIHN3aXRjaCAoaW5kZXgpIHsKLSAgICAgICAgY2FzZSBPTVhfSW5kZXhQYXJhbVBvcnREZWZpbml0aW9uOgotICAgICAgICB7Ci0gICAgICAgICAgICBPTVhfUEFSQU1fUE9SVERFRklOSVRJT05UWVBFICpkZWZQYXJhbXMgPQotICAgICAgICAgICAgICAgIChPTVhfUEFSQU1fUE9SVERFRklOSVRJT05UWVBFICopcGFyYW1zOwotCi0gICAgICAgICAgICBpZiAoZGVmUGFyYW1zLT5uUG9ydEluZGV4ID49IG1Qb3J0cy5zaXplKCkKLSAgICAgICAgICAgICAgICAgICAgfHwgZGVmUGFyYW1zLT5uU2l6ZQotICAgICAgICAgICAgICAgICAgICAgICAgICAgICE9IHNpemVvZihPTVhfUEFSQU1fUE9SVERFRklOSVRJT05UWVBFKSkgewotICAgICAgICAgICAgICAgIHJldHVybiBPTVhfRXJyb3JVbmRlZmluZWQ7Ci0gICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgIFBvcnRJbmZvICpwb3J0ID0KLSAgICAgICAgICAgICAgICAmbVBvcnRzLmVkaXRJdGVtQXQoZGVmUGFyYW1zLT5uUG9ydEluZGV4KTsKLQotICAgICAgICAgICAgaWYgKGRlZlBhcmFtcy0+bkJ1ZmZlclNpemUgIT0gcG9ydC0+bURlZi5uQnVmZmVyU2l6ZSkgewotICAgICAgICAgICAgICAgIENIRUNLX0dFKGRlZlBhcmFtcy0+bkJ1ZmZlclNpemUsIHBvcnQtPm1EZWYubkJ1ZmZlclNpemUpOwotICAgICAgICAgICAgICAgIHBvcnQtPm1EZWYubkJ1ZmZlclNpemUgPSBkZWZQYXJhbXMtPm5CdWZmZXJTaXplOwotICAgICAgICAgICAgfQotCi0gICAgICAgICAgICBpZiAoZGVmUGFyYW1zLT5uQnVmZmVyQ291bnRBY3R1YWwKLSAgICAgICAgICAgICAgICAgICAgIT0gcG9ydC0+bURlZi5uQnVmZmVyQ291bnRBY3R1YWwpIHsKLSAgICAgICAgICAgICAgICBDSEVDS19HRShkZWZQYXJhbXMtPm5CdWZmZXJDb3VudEFjdHVhbCwKLSAgICAgICAgICAgICAgICAgICAgICAgICBwb3J0LT5tRGVmLm5CdWZmZXJD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mVyOgotICAgICAgICB7Ci0gICAgICAgICAgICBPTVhfQlVGRkVSSEVBREVSVFlQRSAqaGVhZGVyOwotICAgICAgICAgICAgQ0hFQ0sobXNnLT5maW5kUG9pbnRlcigiaGVhZGVyIiwgKHZvaWQgKiopJmhlYWRlcikpOwotCi0gICAgICAgICAgICBDSEVDSyhtU3RhdGUgPT0gT01YX1N0YXRlRXhlY3V0aW5nICYmIG1UYXJnZXRTdGF0ZSA9PSBtU3RhdGUpOwotCi0gICAgICAgICAgICBib29sIGZvdW5kID0gZmFsc2U7Ci0gICAgICAgICAgICBzaXplX3QgcG9ydEluZGV4ID0gKGtXaGF0RW1wdHlUaGlzQnVmZmVyID09IG1zZ1R5cGUpPwotICAgICAgICAgICAgICAgICAgICBoZWFkZXItPm5JbnB1dFBvcnRJbmRleDogaGVhZGVyLT5uT3V0cHV0UG9ydEluZGV4OwotICAgICAgICAgICAgUG9ydEluZm8gKnBvcnQgPSAmbVBvcnRzLmVkaXRJdGVtQXQocG9ydEluZGV4KTsKLQotICAgICAgICAgICAgZm9yIChzaXplX3QgaiA9IDA7IGogPCBwb3J0LT5tQnVmZmVycy5zaXplKCk7ICsraikgewotICAgICAgICAgICAgICAgIEJ1ZmZlckluZm8gKmJ1ZmZlciA9ICZwb3J0LT5tQnVmZmVycy5lZGl0SXRlbUF0KGopOwotCi0gICAgICAgICAgICAgICAgaWYgKGJ1ZmZlci0+bUhlYWRlciA9PSBoZWFkZXIpIHsKLSAgICAgICAgICAgICAgICAgICAgQ0hFQ0soIWJ1ZmZlci0+bU93bmVkQnlVcyk7Ci0KLSAgICAgICAgICAgICAgICAgICAgYnVmZmVyLT5tT3duZWRCeVVzID0gdHJ1ZTsKLQotICAgICAgICAgICAgICAgICAgICBDSEVDSygobXNnVHlwZSA9PSBrV2hhdEVtcHR5VGhpc0J1ZmZlcgotICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIHBvcnQtPm1EZWYuZURpciA9PSBPTVhfRGlySW5wdXQpCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgfHwgKHBvcnQtPm1EZWYuZURpciA9PSBPTVhfRGlyT3V0cHV0KSk7Ci0KLSAgICAgICAgICAgICAgICAgICAgcG9ydC0+bVF1ZXVlLnB1c2hfYmFjayhidWZmZXIpOwotICAgICAgICAgICAgICAgICAgICBvblF1ZXVlRmlsbGVkKHBvcnRJbmRleCk7Ci0KLSAgICAgICAgICAgICAgICAgICAgZm91bmQgPSB0cnVlOwotICAgICAgICAgICAgICAgICAgICBicmVhazsKLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgIENIRUNLKGZvdW5kKTsKLSAgICAgICAgICAgIGJyZWFrOwotICAgICAgICB9Ci0KLSAgICAgICAgZGVmYXVsdDoKLSAgICAgICAgICAgIFRSRVNQQVNTKCk7Ci0gICAgICAgICAgICBicmVhazsKLSAgICB9Ci19Ci0KLXZvaWQgU2ltcGxlU29mdE9NWENvbXBvbmVudDo6b25TZW5kQ29tbWFuZCgKLSAgICAgICAgT01YX0NPTU1BTkRUWVBFIGNtZCwgT01YX1UzMiBwYXJhbSkgewotICAgIHN3aXRjaCAoY21kKSB7Ci0gICAgICAgIGNhc2UgT01YX0NvbW1hbmRTdGF0ZVNldDoKLSAgICAgICAgewotICAgICAgICAgICAgb25DaGFuZ2VTdGF0ZSgoT01YX1NUQVRFVFlQRSlwYXJhbSk7Ci0gICAgICAgICAgICBicmVhazsKLSAgICAgICAgfQotCi0gICAgICAgIGNhc2UgT01YX0NvbW1hbmRQb3J0RW5hYmxlOgotICAgICAgICBjYXNlIE9NWF9Db21tYW5kUG9ydERpc2FibGU6Ci0gICAgICAgIHsKLSAgICAgICAgICAgIG9uUG9ydEVuYWJsZShwYXJhbSwgY21kID09IE9NWF9Db21tYW5kUG9ydEVuYWJsZSk7Ci0gICAgICAgICAgICBicmVhazsKLSAgICAgICAgfQotCi0gICAgICAgIGNhc2UgT01YX0NvbW1hbmRGbHVzaDoKLSAgIC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KLSAgICAgICAgICAgICAgICBidWZmZXItPm1Pd25lZEJ5VXMgPSBmYWxzZTsKLQotICAgICAgICAgICAgICAgIGlmIChwb3J0LT5tRGVmLmVEaXIgPT0gT01YX0RpcklucHV0KSB7Ci0gICAgICAgICAgICAgICAgICAgIG5vdGlmeUVtcHR5QnVmZmVyRG9uZShidWZmZXItPm1IZWFkZXIpOwotICAgICAgICAgICAgICAgIH0gZWxzZSB7Ci0gICAgICAgICAgICAgICAgICAgIENIRUNLX0VRKHBvcnQtPm1EZWYuZURpciwgT01YX0Rpck91dHB1dCk7Ci0gICAgICAgICAgICAgICAgICAgIG5vdGlmeUZpbGxCdWZmZXJEb25lKGJ1ZmZlci0+bUhlYWRlcik7Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgfQotICAgICAgICB9Ci0KLSAgICAgICAgcG9ydC0+bVF1ZXVlLmNsZWFyKCk7Ci0gICAgfSBlbHNlIHsKLSAgICAgICAgcG9ydC0+bVRyYW5zaXRpb24gPSBQb3J0SW5mbzo6RU5BQkxJTkc7Ci0gICAgfQotCi0gICAgY2hlY2tUcmFuc2l0aW9ucygpOwotfQotCi12b2lkIFNpbXBsZVNvZnRPTVhDb21wb25lbnQ6Om9uUG9ydEZsdXNoKAotICAgICAgICBPTVhfVTMyIHBvcnRJbmRleCwgYm9vbCBzZW5kRmx1c2hDb21wbGV0ZSkgewotICAgIGlmIChwb3J0SW5kZXggPT0gT01YX0FMTCkgewotICAgICAgICBmb3IgKHNpemVfdCBpID0gMDsgaSA8IG1Qb3J0cy5zaXplKCk7ICsraSkgewotICAgICAgICAgICAgb25Qb3J0Rmx1c2goaSwgc2VuZEZsdXNoQ29tcGxldGUpOwotICAgICAgICB9Ci0KLSAgICAgICAgaWYgKHNlbmRGbHVzaENvbXBsZXRlKSB7Ci0gICAgICAgICAgICBub3RpZnkoT01YX0V2ZW50Q21kQ29tcGxldGUsIE9NWF9Db21tYW5kRmx1c2gsIE9NWF9BTEwsIE5VTEwpOwotICAgICAgICB9Ci0KLSAgICAgICAgcmV0dXJuOwotICAgIH0KLQotICAgIENIRUNLX0xUKHBvcnRJbmRleCwgbVBvcnRzLnNpemUoKSk7Ci0KLSAgICBQb3J0SW5mbyAqcG9ydCA9ICZtUG9ydHMuZWRpdEl0ZW1BdChwb3J0SW5kZXgpOwotICAgIENIRUNLX0VRKChpbnQpcG9ydC0+bVRyYW5zaXRpb24sIChpbnQpUG9ydEluZm86Ok5PTkUpOwotCi0gICAgZm9yIChzaXplX3QgaSA9IDA7IGkgPCBwb3J0LT5tQnVmZmVycy5zaXplKCk7ICsraSkgewotICAgICAgICBCdWZmZXJJbmZvICpidWZmZXIgPSAmcG9ydC0+bUJ1ZmZlcnMuZWRpdEl0ZW1BdChpKTsKLQotICAgICAgICBpZiAoIWJ1ZmZlci0+bU93bmVkQnlVcykgewotICAgICAgICAgICAgY29udGludWU7Ci0gICAgICAgIH0KLQotICAgICAgICBidWZmZXItPm1IZWFkZXItPm5GaWxsZWRMZW4gPSAwOwotICAgICAgICBidWZmZXItPm1IZWFkZXItPm5PZmZzZXQgPSAwOwotICAgICAgICBidWZmZXItPm1IZWFkZXItPm5GbGFncyA9IDA7Ci0KLSAgICAgICAgYnVmZmVyLT5tT3duZWRCeVVzID0gZmFsc2U7Ci0KLSAgICAgICAgaWYgKHBvcnQtPm1EZWYuZURpciA9PSBPTVhfRGlySW5wdXQpIHsKLSAgICAgICAgICAgIG5vdGlmeUVtcHR5QnVmZmVyRG9uZShidWZmZXItPm1IZWFkZXIpOwotICAgICAgICB9IGVsc2UgewotICAgICAgICAgICAgQ0hFQ0tfRVEocG9ydC0+bURlZi5lRGlyLCBPTVhfRGlyT3V0cHV0KTsKLQotICAgICAgICAgICAgbm90aWZ5RmlsbEJ1ZmZlckRvbmUoYnVmZmVyLT5tSGVhZGVyKTsKLSAgICAgICAgfQotICAgIH0KLQotICAgIHBvcnQtPm1RdWV1ZS5jbGVhcigpOwotCi0gICAgaWYgKHNlbmRGbHVzaENv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19FUSgoaW50KW1TdGF0ZSwgKGludClPTVhfU3RhdGVJZGxlKTsKLQotICAgICAgICAgICAgZm9yIChzaXplX3QgaSA9IDA7IGkgPCBtUG9ydHMuc2l6ZSgpOyArK2kpIHsKLSAgICAgICAgICAgICAgICBjb25zdCBQb3J0SW5mbyAmcG9ydCA9IG1Qb3J0cy5pdGVtQXQoaSk7Ci0gICAgICAgICAgICAgICAgaWYgKHBvcnQubURlZi5iRW5hYmxlZCA9PSBPTVhfRkFMU0UpIHsKLSAgICAgICAgICAgICAgICAgICAgY29udGludWU7Ci0gICAgICAgICAgICAgICAgfQotCi0gICAgICAgICAgICAgICAgc2l6ZV90IG4gPSBwb3J0Lm1CdWZmZXJzLnNpemUoKTsKLQotICAgICAgICAgICAgICAgIGlmIChuID4gMCkgewotICAgICAgICAgICAgICAgICAgICBDSEVDS19MRShuLCBwb3J0Lm1EZWYubkJ1ZmZlckNvdW50QWN0dWFsKTsKLQotICAgICAgICAgICAgICAgICAgICBpZiAobiA9PSBwb3J0Lm1EZWYubkJ1ZmZlckNvdW50QWN0dWFsKSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICBDSEVDS19FUSgoaW50KXBvcnQubURlZi5iUG9wdWxhdGVkLCAoaW50KU9NWF9UUlVFKTsKLSAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHsKLSAgICAgICAgICAgICAgICAgICAgICAgIENIRUNLX0VRKChpbnQpcG9ydC5tRGVmLmJQb3B1bGF0ZWQsIChpbnQpT01YX0ZBTFNFKTsKLSAgICAgICAgICAgICAgICAgICAgfQotCi0gICAgICAgICAgICAgICAgICAgIHRyYW5zaXRpb25Db21wbGV0ZSA9IGZhbHNlOwotICAgICAgICAgICAgICAgICAgICBicmVhazsKLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICB9Ci0gICAgICAgIH0KLQotICAgICAgICBpZiAodHJhbnNpdGlvbkNvbXBsZXRlKSB7Ci0gICAgICAgICAgICBtU3RhdGUgPSBtVGFyZ2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b21wb25lbnQ6OlNlbmRDb21tYW5kV3JhcHBlcigKLSAgICAgICAgT01YX0hBTkRMRVRZUEUgY29tcG9uZW50LAotICAgICAgICBPTVhfQ09NTUFORFRZUEUgY21kLAotICAgICAgICBPTVhfVTMyIHBhcmFtLAotICAgICAgICBPTVhfUFRSIGRhdGEpIHsKLSAgICBTb2Z0T01YQ29tcG9uZW50ICptZSA9Ci0gICAgICAgIChTb2Z0T01YQ29tcG9uZW50ICopCi0gICAgICAgICAgICAoKE9NWF9DT01QT05FTlRUWVBFICopY29tcG9uZW50KS0+cENvbXBvbmVudFByaXZhdGU7Ci0KLSAgICByZXR1cm4gbWUtPnNlbmRDb21tYW5kKGNtZCwgcGFyYW0sIGRhdGEpOwotfQotCi0vLyBzdGF0aWMKLU9NWF9FUlJPUlRZUEUgU29mdE9NWENvbXBvbmVudDo6R2V0UGFyYW1ldGVyV3JhcHBlcigKLSAgICAgICAgT01YX0hBTkRMRVRZUEUgY29tcG9uZW50LAotICAgICAgICBPTVhfSU5ERVhUWVBFIGluZGV4LAotICAgICAgICBPTVhfUFRSIHBhcmFtcykgewotICAgIFNvZnRPTVhDb21wb25lbnQgKm1lID0KLSAgICAgICAgKFNvZnRPTVhDb21wb25lbnQgKikKLSAgICAgICAgICAgICgoT01YX0NPTVBPTkVOVFRZUEUgKiljb21wb25lbnQpLT5wQ29tcG9uZW50UHJpdmF0ZTsKLQotICAgIHJldHVybiBtZS0+Z2V0UGFyYW1ldGVyKGluZGV4LCBwYXJhbXMpOwotfQotCi0vLyBzdGF0aWMKLU9NWF9FUlJPUlRZUEUgU29mdE9NWENvbXBvbmVudDo6U2V0UGFyYW1ldGVyV3JhcHBlcigKLSAgICAgICAgT01YX0hBTkRMRVRZUEUgY29tcG9uZW50LAotICAgICAgICBPTVhfSU5ERVhUWVBFIGluZGV4LAotICAgICAgICBPTVhfUFRSIHBhcmFtcykgewotICAgIFNvZnRPTVhDb21wb25lbnQgKm1lID0KLSAgICAgICAgKFNvZnRPTVhDb21wb25lbnQgKikKLSAgICAgICAgICAgICgoT01YX0NPTVBPTkVOVFRZUEUgKiljb21wb25lbnQpLT5wQ29tcG9uZW50UHJpdmF0ZTsKLQotICAgIHJldHVybiBtZS0+c2V0UGFyYW1ldGVyKGluZGV4LCBwYXJhbXMpOwotfQotCi0vLyBzdGF0aWMKLU9NWF9FUlJPUlRZUEUgU29mdE9NWENvbXBvbmVudDo6R2V0Q29uZmlnV3JhcHBlcigKLSAgICAgICAgT01YX0hBTkRMRVRZUEUgY29tcG9uZW50LAotICAgICAgICBPTVhfSU5ERVhUWVBFIGluZGV4LAotICAgICAgICBPTVhfUFRSIHBhcmFtcykgewotICAgIFNvZnRPTVhDb21wb25lbnQgKm1lID0KLSAgICAgICAgKFNvZnRPTVhDb21wb25lbnQgKikKLSAgICAgICAgICAgICgoT01YX0NPTVBPTkVOVFRZUEUgKiljb21wb25lbnQpLT5wQ29tcG9uZW50UHJpdmF0ZTsKLQotICAgIHJldHVybiBtZS0+Z2V0Q29uZmlnKGluZGV4LCBwYXJhbXMpOwotfQotCi0vLyBzdGF0aWMKLU9NWF9FUlJPUlRZUEUgU29mdE9NWENvbXBvbmVudDo6U2V0Q29uZmlnV3JhcHBlcigKLSAgICAgICAgT01YX0hBTkRMRVRZUEUgY29tcG9uZW50LAotICAgICAgICBPTVhfSU5ERVhUWVBFIGluZGV4LAotICAgICAgICBPTVhfUFRSIHBhcmFtcykgewotICAgIFNvZnRPTVhDb21wb25lbnQgKm1lID0KLSAgICAgICAgKFNvZnRPTVhDb21wb25lbnQgKikKLSAgICAgICAgICAgICgoT01YX0NPTVBPTkVOVFRZUEUgKiljb21wb25lbnQpLT5wQ29tcG9uZW50UHJpdmF0ZTsKLQotICAgIHJldHVybiBtZS0+c2V0Q29uZmlnKGluZGV4LCBwYXJhbXMpOwotfQotCi0vLyBzdGF0aWMKLU9NWF9FUlJPUlRZUEUgU29mdE9NWENvbXBvbmVudDo6R2V0RXh0ZW5zaW9uSW5kZXhXcm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XJyb3JDb21wb25lbnROb3RGb3VuZDsKLSAgICAgICAgfQotCi0gICAgICAgIHR5cGVkZWYgU29mdE9NWENvbXBvbmVudCAqKCpDcmVhdGVTb2Z0T01YQ29tcG9uZW50RnVuYykoCi0gICAgICAgICAgICAgICAgY29uc3QgY2hhciAqLCBjb25zdCBPTVhfQ0FMTEJBQ0tUWVBFICosCi0gICAgICAgICAgICAgICAgT01YX1BUUiwgT01YX0NPTVBPTkVOVFRZUEUgKiopOwotCi0gICAgICAgIENyZWF0ZVNvZnRPTVhDb21wb25lbnRGdW5jIGNyZWF0ZVNvZnRPTVhDb21wb25lbnQgPQotICAgICAgICAgICAgKENyZWF0ZVNvZnRPTVhDb21wb25lbnRGdW5jKWRsc3ltKAotICAgICAgICAgICAgICAgICAgICBsaWJIYW5kbGUsCi0gICAgICAgICAgICAgICAgICAgICJfWjIyY3JlYXRlU29mdE9NWENvbXBvbmVudFBLY1BLMTZPTVhfQ0FMTEJBQ0tUWVBFIgotICAgICAgICAgICAgICAgICAgICAiUHZQUDE3T01YX0NPTVBPTkVOVFRZUEUiKTsKLQotICAgICAgICBpZiAoY3JlYXRlU29mdE9NWENvbXBvbmVudCA9PSBOVUxMKSB7Ci0gICAgICAgICAgICBkbGNsb3NlKGxpYkhhbmRsZSk7Ci0gICAgICAgICAgICBsaWJIYW5kbGUgPSBOVUxMOwotCi0gICAgICAgICAgICByZXR1cm4gT01YX0Vycm9yQ29tcG9uZW50Tm90Rm91bmQ7Ci0gICAgICAgIH0KLQotICAgICAgICBzcDxTb2Z0T01YQ29tcG9uZW50PiBjb2RlYyA9Ci0gICAgICAgICAgICAoKmNyZWF0ZVNvZnRPTVhDb21wb25lbnQpKG5hbWUsIGNhbGxiYWNrcywgYXBwRGF0YSwgY29tcG9uZW50KTsKLQotICAgICAgICBpZiAoY29kZWMgPT0gTlVMTCkgewotICAgICAgICAgICAgZGxjbG9zZShsaWJIYW5kbGUpOwotICAgICAgICAgICAgbGliSGFuZGxlID0gTlVM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5kbGUgPSBOVUxMOwotCi0gICAgcmV0dXJuIE9NWF9FcnJvck5vbmU7Ci19Ci0KLU9NWF9FUlJPUlRZUEUgU29mdE9NWFBsdWdpbjo6ZW51bWVyYXRlQ29tcG9uZW50cygKLSAgICAgICAgT01YX1NUUklORyBuYW1lLAotICAgICAgICBzaXplX3Qgc2l6ZSwKLSAgICAgICAgT01YX1UzMiBpbmRleCkgewotICAgIGlmIChpbmRleCA+PSBrTnVtQ29tcG9uZW50cykgewotICAgICAgICByZXR1cm4gT01YX0Vycm9yTm9Nb3JlOwotICAgIH0KLQotICAgIHN0cmNweShuYW1lLCBrQ29tcG9uZW50c1tpbmRleF0ubU5hbWUpOwotCi0gICAgcmV0dXJuIE9NWF9FcnJvck5vbmU7Ci19Ci0KLU9NWF9FUlJPUlRZUEUgU29mdE9NWFBsdWdpbjo6Z2V0Um9sZXNPZkNvbXBvbmVudCgKLSAgICAgICAgY29uc3QgY2hhciAqbmFtZSwKLSAgICAgICAgVmVjdG9yPFN0cmluZzg+ICpyb2xlcykgewotICAgIGZvciAoc2l6ZV90IGkgPSAwOyBpIDwga051bUNvbXBvbmVudHM7ICsraSkgewotICAgICAgICBpZiAoc3RyY21wKG5hbWUsIGtDb21wb25lbnRzW2ldLm1OYW1lKSkgewotICAgICAgICAgICAgY29udGludWU7Ci0gICAgICAgIH0KLQotICAgICAgICByb2xlcy0+Y2xlYXIoKTsKLSAgICAgICAgcm9sZXMtPnB1c2goU3RyaW5nOChrQ29tcG9uZW50c1tpXS5tUm9sZSkpOwotCi0gICAgICAgIHJldHVybiBPTVhfRXJyb3JOb25lOwotICAgIH0KLQotICAgIHJldHVybiBPTVhfRXJyb3JJbnZhbGlkQ29tcG9uZW50TmFtZTsKLX0KLQotfSAgLy8gbmFtZXNwYWNlIGFuZHJvaWQKZGlmZiAtLWdpdCBhL21lZGlhL2xpYnN0YWdlZnJpZ2h0L29teC9Tb2Z0T01YUGx1Z2luLmggYi9tZWRpYS9saWJzdGFnZWZya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GltZW91dFVzKSB7Ci0gICAgcmV0dXJuIGRlcXVldWVNZXNzYWdlRm9yTm9kZUlnbm9yaW5nQnVmZmVycygKLSAgICAgICAgICAgIG5vZGUsIE5VTEwsIE5VTEwsIG1zZywgdGltZW91dFVzKTsKLX0KLQotLy8gc3RhdGljCi1ib29sIEhhcm5lc3M6OmhhbmRsZUJ1ZmZlck1lc3NhZ2UoCi0gICAgICAgIGNvbnN0IG9teF9tZXNzYWdlICZtc2csCi0gICAgICAgIFZlY3RvcjxCdWZmZXI+ICppbnB1dEJ1ZmZlcnMsCi0gICAgICAgIFZlY3RvcjxCdWZmZXI+ICpvdXRwdXRCdWZmZXJzKSB7Ci0gICAgc3dpdGNoIChtc2cudHlwZSkgewotICAgICAgICBjYXNlIG9teF9tZXNzYWdlOjpFTVBUWV9CVUZGRVJfRE9ORToKLSAgICAgICAgewotICAgICAgICAgICAgaWYgKGlucHV0QnVmZmVycykgewotICAgICAgICAgICAgICAgIGZvciAoc2l6ZV90IGkgPSAwOyBpIDwgaW5wdXRCdWZmZXJzLT5zaXplKCk7ICsraSkgewotICAgICAgICAgICAgICAgICAgICBpZiAoKCppbnB1dEJ1ZmZlcnMpW2ldLm1JRCA9PSBtc2cudS5idWZmZXJfZGF0YS5idWZmZXIpIHsKLSAgICAgICAgICAgICAgICAgICAgICAgIGlucHV0QnVmZmVycy0+ZWRpdEl0ZW1BdChpKS5tRmxhZ3MgJj0gfmtCdWZmZXJCdXN5OwotICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHRydWU7Ci0gICAgICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgQ0hFQ0soISJzaG91bGQgbm90IGJlIGhlcmUiKTsKLSAgICAgICAgICAgIH0KLSAgICAgICAgICAgIGJyZWFrOwotICAgICAgICB9Ci0KLSAgICAgICAgY2FzZSBvbXhfbWVzc2FnZTo6RklMTF9CVUZGRVJfRE9ORToKLSAgICAgICAgewotICAgICAgICAgICAgaWYgKG91dHB1dEJ1ZmZlcnMpIHsKLSAgICAgICAgICAgICAgICBmb3IgKHNpemVfdCBpID0gMDsgaSA8IG91dHB1dEJ1ZmZlcnMtPnNpemUoKTsgKytpKSB7Ci0gICAgICAgICAgICAgICAgICAgIGlmICgoKm91dHB1dEJ1ZmZlcnMpW2ldLm1JRCA9PSBtc2cudS5idWZmZXJfZGF0YS5idWZmZXIpIHsKLSAgICAgICAgICAgICAgICAgICAgICAgIG91dHB1dEJ1ZmZlcnMtPmVkaXRJdGVtQXQoaSkubUZsYWdzICY9IH5rQnVmZmVyQnVzeTsKLSAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiB0cnVlOwotICAgICAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgIENIRUNLKCEic2hvdWxkIG5vdCBiZSBoZXJlIik7Ci0gICAgICAgICAgICB9Ci0gICAgICAgICAgICBicmVhazsKLSAgICAgICAgfQotCi0gICAgICAgIGRlZmF1bHQ6Ci0gICAgICAgICAgICBicmVhazsKLSAgICB9Ci0KLSAgICByZXR1cm4gZmFsc2U7Ci19Ci0KLXN0YXR1c190IEhhcm5lc3M6OmRlcXVldWVNZXNzYWdlRm9yTm9kZUlnbm9yaW5nQnVmZmVycygKLSAgICAgICAgSU9NWDo6bm9kZV9pZCBub2RlLAotICAgICAgICBWZWN0b3I8QnVmZmVyPiAqaW5wdXRCdWZmZXJzLAotICAgICAgICBWZWN0b3I8QnVmZmVyPiAqb3V0cHV0QnVmZmVycywKLSAgICAgICAgb214X21lc3NhZ2UgKm1zZywgaW50NjRfdCB0aW1lb3V0VXMpIHsKLSAgICBpbnQ2NF90IGZpbmlzaEJ5ID0gZ2V0Tm93VXMoKSArIHRpbWVvdXRVczsKLQotICAgIGZvciAoOzspIHsKLSAgICAgICAgTXV0ZXg6OkF1dG9sb2NrIGF1dG9Mb2NrKG1Mb2NrKTsKLSAgICAgICAgTGlzdDxvbXhfbWVzc2FnZT46Oml0ZXJhdG9yIGl0ID0gbU1lc3NhZ2VRdWV1ZS5iZWdpbigpOwotICAgICAgICB3aGlsZSAoaXQgIT0gbU1lc3NhZ2VRdWV1ZS5lbmQoKSkgewotICAgICAgICAgICAgaWYgKCgqaXQpLm5vZGUgPT0gbm9kZSkgewotICAgICAgICAgICAgICAgIGlmIChoYW5kbGVCdWZmZXJNZXNzYWdlKCppdCwgaW5wdXRCdWZmZXJzLCBvdXRwdXRCdWZmZXJzKSkgewotICAgICAgICAgICAgICAgICAgICBpdCA9IG1NZXNzYWdlUXVldWUuZXJhc2UoaXQpOwotICAgICAgICAgICAgICAgICAgICBjb250aW51ZTsKLSAgICAgICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgICAgICAqbXNnID0gKml0OwotICAgICAgICAgICAgICAgIG1NZXNzYWdlUXVldWUuZXJhc2UoaXQpOwotCi0gICAgICAgICAgICAgICAgcmV0dXJuIE9LOwotICAgICAgICAgICAgfQotCi0gICAgICAgICAgICArK2l0OwotICAgICAgICB9Ci0KLSAgICAgICAgc3RhdHVzX3QgZXJyID0gKHRpbWVvdXRVcyA8IDApCi0gICAgICAgICAgICA/IG1NZXNzYWdlQWRkZWRDb25kaXRpb24ud2FpdChtTG9jaykKLSAgICAgICAgICAgIDogbU1lc3NhZ2VBZGRlZENvbmRpdGlvbi53YWl0UmVsYXRpdmUoCi0gICAgICAgICAgICAgICAgICAgIG1Mb2NrLCAoZmluaXNoQnkgLSBnZXROb3dVcygpKSAqIDEwMDApOwotCi0gICAgICAgIGlmIChlcnIgPT0gVElNRURfT1VUKSB7Ci0gICAgICAgICAgICByZXR1cm4gZXJyOwotICAgICAgICB9Ci0gICAgICAgIENIRUNLX0VRKGVyciwgKHN0YXR1c190KU9LKTsKLSAgICB9Ci19Ci0KLXN0YXR1c190IEhhcm5lc3M6OmdldFBvcnREZWZpbml0aW9uKAotICAgICAgICBJT01YOjpub2RlX2lkIG5vZGUsIE9NWF9VMzIgcG9ydEluZGV4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GltZTJVcykgewotI2lmIDAKLSAgICBpbnQ2NF90IGRpZmYgPSB0aW1lMVVzIC0gdGltZTJVczsKLSAgICBpZiAoZGlmZiA8IDApIHsKLSAgICAgICAgZGlmZiA9IC1kaWZmOwotICAgIH0KLQotICAgIHJldHVybiBkaWZmIDw9IDUwMDAwOwotI2Vsc2UKLSAgICByZXR1cm4gdGltZTFVcyA9PSB0aW1lMlVzOwotI2VuZGlmCi19Ci0KLXN0YXR1c190IEhhcm5lc3M6OnRlc3RTZWVrKAotICAgICAgICBjb25zdCBjaGFyICpjb21wb25lbnROYW1lLCBjb25zdCBjaGFyICpjb21wb25lbnRSb2xlKSB7Ci0gICAgYm9vbCBpc0VuY29kZXIgPQotICAgICAgICAhc3RybmNtcChjb21wb25lbnRSb2xlLCAiYXVkaW9fZW5jb2Rlci4iLCAxNCkKLSAgICAgICAgfHwgIXN0cm5jbXAoY29tcG9uZW50Um9sZSwgInZpZGVvX2VuY29kZXIuIiwgMTQpOwotCi0gICAgaWYgKGlzRW5jb2RlcikgewotICAgICAgICAvLyBOb3QgdGVzdGluZyBzZWVrIGJlaGF2aW91ciBmb3IgZW5jb2RlcnMuCi0KLSAgICAgICAgcHJpbnRmKCIgICogTm90IHRlc3Rpbmcgc2VlayBmdW5jdGlvbmFsaXR5IGZvciBlbmNvZGVycy5cbiIpOwotICAgICAgICByZXR1cm4gT0s7Ci0gICAgfQotCi0gICAgY29uc3QgY2hhciAqbWltZSA9IEdldE1pbWVGcm9tQ29tcG9uZW50Um9sZShjb21wb25lbnRSb2xlKTsKLQotICAgIGlmICghbWltZSkgewotICAgICAgICBBTE9HSSgiQ2Fubm90IHBlcmZvcm0gc2VlayB0ZXN0IHdpdGggdGhpcyBjb21wb25lbnRSb2xlICglcykiLAotICAgICAgICAgICAgIGNvbXBvbmVudFJvbGUpOwotCi0gICAgICAgIHJldHVybiBPSzsKLSAgICB9Ci0KLSAgICBzcDxNZWRpYVNvdXJjZT4gc291cmNlID0gQ3JlYXRlU291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ICAgICAgICBBTE9HSSgicmVxdWVzdGluZyBzZWVrIHRvICVsbGQgdXMgKCUuMmYgc2VjcykiLAotICAgICAgICAgICAgICAgICAgICAgcmVxdWVzdGVkU2Vla1RpbWVVcywgcmVxdWVzdGVkU2Vla1RpbWVVcyAvIDFFNik7Ci0gICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgIE1lZGlhQnVmZmVyICpidWZmZXIgPSBOVUxMOwotICAgICAgICAgICAgb3B0aW9ucy5zZXRTZWVrVG8oCi0gICAgICAgICAgICAgICAgICAgIHJlcXVlc3RlZFNlZWtUaW1lVXMsIE1lZGlhU291cmNlOjpSZWFkT3B0aW9uczo6U0VFS19ORVhUX1NZTkMpOwotCi0gICAgICAgICAgICBpZiAoc2Vla1NvdXJjZS0+cmVhZCgmYnVmZmVyLCAmb3B0aW9ucykgIT0gT0spIHsKLSAgICAgICAgICAgICAgICBDSEVDSyhidWZmZXIgPT0gTlVMTCk7Ci0gICAgICAgICAgICAgICAgYWN0dWFsU2Vla1RpbWVVcyA9IC0xOwotICAgICAgICAgICAgfSBlbHNlIHsKLSAgICAgICAgICAgICAgICBDSEVDSyhidWZmZXIgIT0gTlVMTCk7Ci0gICAgICAgICAgICAgICAgQ0hFQ0soYnVmZmVyLT5tZXRhX2RhdGEoKS0+ZmluZEludDY0KGtLZXlUaW1lLCAmYWN0dWFsU2Vla1RpbWVVcykpOwotICAgICAgICAgICAgICAgIENIRUNLKGFjdHVhbFNlZWtUaW1lVXMgPj0gMCk7Ci0KLSAgICAgICAgICAgICAgICBidWZmZXItPnJlbGVhc2UoKTsKLSAgICAgICAgICAgICAgICBidWZmZXIgPSBOVUxMOwotICAgICAgICAgICAgfQotCi0gICAgICAgICAgICBBTE9HSSgibmVhcmVzdCBrZXlmcmFtZSBpcyBhdCAlbGxkIHVzICglLjJmIHNlY3MpIiwKLSAgICAgICAgICAgICAgICAgYWN0dWFsU2Vla1RpbWVVcywgYWN0dWFsU2Vla1RpbWVVcyAvIDFFNik7Ci0gICAgICAgIH0KLQotICAgICAgICBzdGF0dXNfdCBlcnI7Ci0gICAgICAgIE1lZGlhQnVmZmVyICpidWZmZXI7Ci0gICAgICAgIGZvciAoOzspIHsKLSAgICAgICAgICAgIGVyciA9IGNvZGVjLT5yZWFkKCZidWZmZXIsICZvcHRpb25zKTsKLSAgICAgICAgICAgIG9wdGlvbnMuY2xlYXJTZWVrVG8oKTsKLSAgICAgICAgICAgIGlmIChlcnIgPT0gSU5GT19GT1JNQVRfQ0hBTkdFRCkgewotICAgICAgICAgICAgICAgIENIRUNLKGJ1ZmZlciA9PSBOVUxMKTsKLSAgICAgICAgICAgICAgICBjb250aW51ZTsKLSAgICAgICAgICAgIH0KLSAgICAgICAgICAgIGlmIChlcnIgPT0gT0spIHsKLSAgICAgICAgICAgICAgICBDSEVDSyhidWZmZXIgIT0gTlVMTCk7Ci0gICAgICAgICAgICAgICAgaWYgKGJ1ZmZlci0+cmFuZ2VfbGVuZ3RoKCkgPT0gMCkgewotICAgICAgICAgICAgICAgICAgICBidWZmZXItPnJlbGVhc2UoKTsKLSAgICAgICAgICAgICAgICAgICAgYnVmZmVyID0gTlVMTDsKLSAgICAgICAgICAgICAgICAgICAgY29udGludWU7Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgfSBlbHNlIHsKLSAgICAgICAgICAgICAgICBDSEVDSyhidWZmZXIgPT0gTlVMTCk7Ci0gICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgIGJyZWFrOwotICAgICAgICB9Ci0KLSAgICAgICAgaWYgKHJlcXVlc3RlZFNlZWtUaW1lVXMgPCAwKSB7Ci0gICAgICAgICAgICAvLyBMaW5lYXIgcmVhZC4KLSAgICAgICAgICAgIGlmIChlcnIgIT0gT0spIHsKLSAgICAgICAgICAgICAgICBDSEVDSyhidWZmZXIgPT0gTlVMTCk7Ci0gICAgICAgICAgICB9IGVsc2UgewotICAgICAgICAgICAgICAgIENIRUNLKGJ1ZmZlciAhPSBOVUxMKTsKLSAgICAgICAgICAgICAgICBidWZmZXItPnJlbGVhc2UoKTsKLSAgICAgICAgICAgICAgICBidWZmZXIgPSBOVUxMOwotICAgICAgICAgICAgfQotICAgICAgICB9IGVsc2UgaWYgKGFjdHVhbFNlZWtUaW1lVXMgPCAwKSB7Ci0gICAgICAgICAgICBFWFBFQ1QoZXJyICE9IE9LLAotICAgICAgICAgICAgICAgICAgICJXZSBhdHRlbXB0ZWQgdG8gc2VlayBiZXlvbmQgRU9TIGFuZCBleHBlY3RlZCAiCi0gICAgICAgICAgICAgICAgICAgIkVSUk9SX0VORF9PRl9TVFJFQU0gdG8gYmUgcmV0dXJuZWQsIGJ1dCBpbnN0ZWFkICIKLSAgICAgICAgICAgICAgICAgICAid2UgZ290IGEgdmFsaWQgYnVmZmVyLiIpOwotICAgICAgICAgICAgRVhQRUNUKGVyciA9PSBFUlJPUl9FTkRfT0ZfU1RSRUFNLAotICAgICAgICAgICAgICAgICAgICJXZSBhdHRlbXB0ZWQgdG8gc2VlayBiZXlvbmQgRU9TIGFuZCBleHBlY3RlZCAiCi0gICAgICAgICAgICAgICAgICAgIkVSUk9SX0VORF9PRl9TVFJFQU0gdG8gYmUgcmV0dXJuZWQsIGJ1dCBpbnN0ZWFkICIKLSAgICAgICAgICAgICAgICAgICAid2UgZm91bmQgc29tZSBvdGhlciBlcnJvci4iKTsKLSAgICAgICAgICAgIENIRUNLX0VRKGVyciwgKHN0YXR1c190KUVSUk9SX0VORF9PRl9TVFJFQU0pOwotICAgICAgICAgICAgQ0hFQ0soYnVmZmVyID09IE5VTEwpOwotICAgICAgICB9IGVsc2UgewotICAgICAgICAgICAgRVhQRUNUKGVyciA9PSBPSywKLSAgICAgICAgICAgICAgICAgICAiRXhwZWN0ZWQgYSB2YWxpZCBidWZmZXIgdG8gYmUgcmV0dXJuZWQgZnJvbSAiCi0gICAgICAgICAgICAgICAgICAgIk9NWENvZGVjOjpyZWFkLiIpOwotICAgICAgICAgICAgQ0hFQ0soYnVmZmVyICE9IE5VTEwpOwotCi0gICAgICAgICAgICBpbnQ2NF90IGJ1ZmZlclRpbWVVczsKLSAgICAgICAgICAgIENIRUNLKGJ1ZmZlci0+bWV0YV9kYXRhKCktPmZpbmRJbnQ2NChrS2V5VGltZSwgJmJ1ZmZlclRpbWVVcykpOwotICAgICAgICAgICAgaWYgKCFDbG9zZUVub3VnaChidWZmZXJUaW1lVXMsIGFjdHVhbFNlZWtUaW1lVXMpKSB7Ci0gICAgICAgICAgICAgICAgcHJpbnRmKCJcbiAgKiBBdHRlbXB0ZWQgc2Vla2luZyB0byAlbGxkIHVzICglLjJmIHNlY3MpIiwKLSAgICAgICAgICAgICAgICAgICAgICAgcmVxdWVzdGVkU2Vla1RpbWVVcywgcmVxdWVzdGVkU2Vla1RpbWVVcyAvIDFFNik7Ci0gICAgICAgICAgICAgICAgcHJpbnRmKCJcbiAgKiBOZWFyZXN0IGtleWZyYW1lIGlzIGF0ICVsbGQgdXMgKCUuMmYgc2VjcykiLAotICAgICAgICAgICAgICAgICAgICAgICBhY3R1YWxTZWVrVGltZVVzLCBhY3R1YWxTZWVrVGltZVVzIC8gMUU2KTsKLSAgICAgICAgICAgICAgICBwcmludGYoIlxuICAqIFJldHVybmVkIGJ1ZmZlciB3YXMgYXQgJWxsZCB1cyAoJS4yZiBzZWNzKVxuXG4iLAotICAgICAgICAgICAgICAgICAgICAgICBidWZmZXJUaW1lVXMsIGJ1ZmZlclRpbWVVcyAvIDFFNik7Ci0KLSAgICAgICAgICAgICAgICBidWZmZXItPnJlbGVhc2UoKTsKLSAgICAgICAgICAgICAgICBidWZmZXIgPSBOVUxMOwotCi0gICAgICAgICAgICAgICAgQ0hFQ0tfRVEoY29kZWMtPnN0b3AoKSwgKHN0YXR1c190KU9LKTsKLQotICAgICAgICAgICAgICAgIHJldHVybiBVTktOT1dOX0VSUk9SOwotICAgICAgICAgICAgfQotCi0gICAgICAgICAgICBidWZmZXItPnJlbGVhc2UoKTsKLSAgICAgICAgICAgIGJ1ZmZlci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SAgICAgICAgY29uc3QgSU9NWDo6Q29tcG9uZW50SW5mbyAmaW5mbyA9ICppdDsKLSAgICAgICAgY29uc3QgY2hhciAqY29tcG9uZW50TmFtZSA9IGluZm8ubU5hbWUuc3RyaW5nKCk7Ci0KLSAgICAgICAgaWYgKHN0cm5jbXAoY29tcG9uZW50TmFtZSwgIk9NWC5nb29nbGUuIiwgMTEpKSB7Ci0gICAgICAgICAgICBjb250aW51ZTsKLSAgICAgICAgfQotCi0gICAgICAgIGZvciAoTGlzdDxTdHJpbmc4Pjo6Y29uc3RfaXRlcmF0b3Igcm9sZV9pdCA9IGluZm8ubVJvbGVzLmJlZ2luKCk7Ci0gICAgICAgICAgICAgcm9sZV9pdCAhPSBpbmZvLm1Sb2xlcy5lbmQoKTsgKytyb2xlX2l0KSB7Ci0gICAgICAgICAgICBjb25zdCBjaGFyICpjb21wb25lbnRSb2xlID0gKCpyb2xlX2l0KS5zdHJpbmcoKTsKLQotICAgICAgICAgICAgZXJyID0gdGVzdChjb21wb25lbnROYW1lLCBjb21wb25lbnRSb2xlKTsKLQotICAgICAgICAgICAgaWYgKGVyciA9PSBPSykgewotICAgICAgICAgICAgICAgIHByaW50ZigiT0tcbiIpOwotICAgICAgICAgICAgfQotICAgICAgICB9Ci0gICAgfQotCi0gICAgcmV0dXJuIE9LOwotfQotCi19ICAvLyBuYW1lc3BhY2UgYW5kcm9pZAotCi1zdGF0aWMgdm9pZCB1c2FnZShjb25zdCBjaGFyICptZSkgewotICAgIGZwcmludGYoc3RkZXJyLCAidXNhZ2U6ICVzXG4iCi0gICAgICAgICAgICAgICAgICAgICIgIC1oKGVscCkgIFNob3cgdGhpcyBpbmZvcm1hdGlvblxuIgotICAgICAgICAgICAgICAgICAgICAiICAtcyhlZWQpICBTZXQgdGhlIHJhbmRvbSBzZWVkXG4iCi0gICAgICAgICAgICAgICAgICAgICIgICAgWyBjb21wb25lbnQgcm9sZSBdXG5cbiIKLSAgICAgICAgICAgICAgICAgICAgIldoZW4gbGF1bmNoZWQgd2l0aG91dCBzcGVjaWZ5aW5nIGEgc3BlY2lmaWMgY29tcG9uZW50ICIKLSAgICAgICAgICAgICAgICAgICAgImFuZCByb2xlLCB0b29sIHdpbGwgdGVzdCBhbGwgYXZhaWxhYmxlIE9NWCBjb21wb25lbnRzICIKLSAgICAgICAgICAgICAgICAgICAgImluIGFsbCB0aGVpciBzdXBwb3J0ZWQgcm9sZXMuIFRvIGRldGVybWluZSBhdmFpbGFibGUgIgotICAgICAgICAgICAgICAgICAgICAiY29tcG9uZW50IG5hbWVzLCB1c2UgXCJzdGFnZWZyaWdodCAtbFwiXG4iCi0gICAgICAgICAgICAgICAgICAgICJJdCdzIGFsc28gYSBnb29kIGlkZWEgdG8gcnVuIGEgc2VwYXJhdGUgXCJhZGIgbG9nY2F0XCIiCi0gICAgICAgICAgICAgICAgICAgICIgZm9yIGFkZGl0aW9uYWwgZGVidWcgYW5kIHByb2dyZXNzIGluZm9ybWF0aW9uLiIsIG1lKTsKLQotICAgIGV4aXQoMCk7Ci19Ci0KLWludCBtYWluKGludCBhcmdjLCBjaGFyICoqYXJndikgewotICAgIHVzaW5nIG5hbWVzcGFjZSBhbmRyb2lkOwotCi0gICAgYW5kcm9pZDo6UHJvY2Vzc1N0YXRlOjpzZWxmKCktPnN0YXJ0VGhyZWFkUG9vbCgpOwotICAgIERhdGFTb3VyY2U6OlJlZ2lzdGVyRGVmYXVsdFNuaWZmZXJzKCk7Ci0KLSAgICBjb25zdCBjaGFyICptZSA9IGFyZ3ZbMF07Ci0KLSAgICB1bnNpZ25lZCBsb25nIHNlZWQgPSAweGRlYWRiZWVmOwotCi0gICAgaW50IHJlczsKLSAgICB3aGlsZSAoKHJlcyA9IGdldG9wdChhcmdjLCBhcmd2LCAiaHM6IikpID49IDApIHsKLSAgICAgICAgc3dpdGNoIChyZXMpIHsKLSAgICAgICAgICAgIGNhc2UgJ3MnOgotICAgICAgICAgICAgewotICAgICAgICAgICAgICAgIGNoYXIgKmVuZDsKLSAgICAgICAgICAgICAgICB1bnNpZ25lZCBsb25nIHggPSBzdHJ0b3VsKG9wdGFyZywgJmVuZCwgMTApOwotCi0gICAgICAgICAgICAgICAgaWYgKCplbmQgIT0gJ1wwJyB8fCBlbmQgPT0gb3B0YXJnKSB7Ci0gICAgICAgICAgICAgICAgICAgIGZwcmludGYoc3RkZXJyLCAiTWFsZm9ybWVkIHNlZWQuXG4iKTsKLSAgICAgICAgICAgICAgICAgICAgcmV0dXJuIDE7Ci0gICAgICAgICAgICAgICAgfQotCi0gICAgICAgICAgICAgICAgc2VlZCA9IHg7Ci0gICAgICAgICAgICAgICAgYnJlYWs7Ci0gICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgIGNhc2UgJz8nOgotICAgICAgICAgICAgICAgIGZwcmludGYoc3RkZXJyLCAiXG4iKTsKLSAgICAgICAgICAgICAgICAvLyBmYWxsIHRocm91Z2gKLQotICAgICAgICAgICAgY2FzZSAnaCc6Ci0gICAgICAgICAgICBkZWZhdWx0OgotICAgICAgICAgICAgewotICAgICAgICAgICAgICAgIHVzYWdlKG1lKTsKLSAgICAgICAgICAgICAgICBleGl0KDEpOwotICAgICAgICAgICAgICAgIGJyZWFrOwotICAgICAgICAgICAgfQotICAgICAgICB9Ci0gICAgfQotCi0gICAgYXJnYyAtPSBvcHRpbmQ7Ci0gICAgYXJndiArPSBvcHRpbmQ7Ci0KLSAgICBwcmludGYoIlRvIHJlcHJvZHVjZSB0aGUgY29uZGl0aW9ucyBmb3IgdGhpcyB0ZXN0LCBsYXVuY2ggIgotICAgICAgICAgICAid2l0aCBcIiVzIC1zICVsdVwiXG4iLCBtZSwgc2VlZCk7Ci0KLSAgICBzcmFuZChzZWVkKTsKLQotICAgIHNwPEhhcm5lc3M+IGggPSBuZXcgSGFybmVzczsKLSAgICBDSEVDS19FUShoLT5pbml0Q2hlY2soKSwgKHN0YXR1c190KU9LKTsKLQotICAgIGlmIChhcmdjID09IDApIHsKLSAgICAgICAgaC0+dGVzdEF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RVcyA9IC0xKTsKLQotICAgIHN0YXR1c190IGRlcXVldWVNZXNzYWdlRm9yTm9kZUlnbm9yaW5nQnVmZmVycygKLSAgICAgICAgICAgIElPTVg6Om5vZGVfaWQgbm9kZSwKLSAgICAgICAgICAgIFZlY3RvcjxCdWZmZXI+ICppbnB1dEJ1ZmZlcnMsCi0gICAgICAgICAgICBWZWN0b3I8QnVmZmVyPiAqb3V0cHV0QnVmZmVycywKLSAgICAgICAgICAgIG9teF9tZXNzYWdlICptc2csIGludDY0X3QgdGltZW91dFVzID0gLTEpOwotCi0gICAgc3RhdHVzX3QgZ2V0UG9ydERlZmluaXRpb24oCi0gICAgICAgICAgICBJT01YOjpub2RlX2lkIG5vZGUsIE9NWF9VMzIgcG9ydEluZGV4LAotICAgICAgICAgICAgT01YX1BBUkFNX1BPUlRERUZJTklUSU9OVFlQRSAqZGVmKTsKLQotICAgIHN0YXR1c190IGFsbG9jYXRlUG9ydEJ1ZmZlcnMoCi0gICAgICAgICAgICBjb25zdCBzcDxNZW1vcnlEZWFsZXI+ICZkZWFsZXIsCi0gICAgICAgICAgICBJT01YOjpub2RlX2lkIG5vZGUsIE9NWF9VMzIgcG9ydEluZGV4LAotICAgICAgICAgICAgVmVjdG9yPEJ1ZmZlcj4gKmJ1ZmZlcnMpOwotCi0gICAgc3RhdHVzX3Qgc2V0Um9sZShJT01YOjpub2RlX2lkIG5vZGUsIGNvbnN0IGNoYXIgKnJvbGUpOwotCi0gICAgc3RhdHVzX3QgdGVzdFN0YXRlVHJhbnNpdGlvbnMoCi0gICAgICAgICAgICBjb25zdCBjaGFyICpjb21wb25lbnROYW1lLCBjb25zdCBjaGFyICpjb21wb25lbnRSb2xlKTsKLQotICAgIHN0YXR1c190IHRlc3RTZWVrKAotICAgICAgICAgICAgY29uc3QgY2hhciAqY29tcG9uZW50TmFtZSwgY29uc3QgY2hhciAqY29tcG9uZW50Um9sZSk7Ci0KLSAgICBzdGF0dXNfdCB0ZXN0KAotICAgICAgICAgICA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gKCh1aW50MzJfdClidWZmZXItPmludDMyRGF0YSgpICE9IGV4cGVjdGVkU2VxTm8pIHsKLSAgICAgICAgICAgICAgICBBTE9HVigic2VxdWVuY2Ugbm90IGNvbXBsZXRlLCBleHBlY3RlZCBzZXFObyAlZCwgZ290ICVkIiwKLSAgICAgICAgICAgICAgICAgICAgIGV4cGVjdGVkU2VxTm8sICh1aW50MzJfdClidWZmZXItPmludDMyRGF0YSgpKTsKLQotICAgICAgICAgICAgICAgIHJldHVybiBXUk9OR19TRVFVRU5DRV9OVU1CRVI7Ci0gICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgIGlmIChzaXplIDwgMgotICAgICAgICAgICAgICAgICAgICB8fCBkYXRhWzBdICE9IGluZGljYXRvcgotICAgICAgICAgICAgICAgICAgICB8fCAoZGF0YVsxXSAmIDB4MWYpICE9IG5hbFR5cGUKLSAgICAgICAgICAgICAgICAgICAgfHwgKGRhdGFbMV0gJiAweDgwKSkgewotICAgICAgICAgICAgICAgIEFMT0dWKCJJZ25vcmluZyBtYWxmb3JtZWQgRlUgYnVmZmVyLiIpOwotCi0gICAgICAgICAgICAgICAgLy8gRGVsZXRlIHRoZSB3aG9sZSBzdGFydCBvZiB0aGUgRlUuCi0KLSAgICAgICAgICAgICAgICBpdCA9IHF1ZXVlLT5iZWdpbigpOwotICAgICAgICAgICAgICAgIGZvciAoc2l6ZV90IGkgPSAwOyBpIDw9IHRvdGFsQ291bnQ7ICsraSkgewotICAgICAgICAgICAgICAgICAgICBpdCA9IHF1ZXVlLT5lcmFzZShpdCk7Ci0gICAgICAgICAgICAgICAgfQotCi0gICAgICAgICAgICAgICAgbU5leHRFeHBlY3RlZFNlcU5vID0gZXhwZWN0ZWRTZXFObyArIDE7Ci0KLSAgICAgICAgICAgICAgICByZXR1cm4gTUFMRk9STUVEX1BBQ0tFVDsKLSAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgdG90YWxTaXplICs9IHNpemUgLSAyOwotICAgICAgICAgICAgKyt0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amVjdFR5cGUgPD0gMjcpKSB7Ci0gICAgICAgIHVuc2lnbmVkIGVwQ29uZmlnID0gYml0cy0+Z2V0Qml0cygyKTsKLSAgICAgICAgaWYgKGVwQ29uZmlnID09IDIgfHwgZXBDb25maWcgPT0gMykgewotICAgICAgICAgICAgLy8gRXJyb3JQcm90ZWN0aW9uU3BlY2lmaWNDb25maWcKLSAgICAgICAgICAgIHJldHVybiBFUlJPUl9VTlNVUFBPUlRFRDsgIC8vIFhYWCB0byBiZSBpbXBsZW1lbnRlZAotCi0gICAgICAgICAgICBpZiAoZXBDb25maWcgPT0gMykgewotICAgICAgICAgICAgICAgIHVuc2lnbmVkIGRpcmVjdE1hcHBpbmcgPSBiaXRzLT5nZXRCaXRzKDEpOwotICAgICAgICAgICAgICAgIENIRUNLX0VRKGRpcmVjdE1hcHBpbmcsIDF1KTsKLSAgICAgICAgICAgIH0KLSAgICAgICAgfQotICAgIH0KLQotICAgIGlmIChleHRlbnNpb25BdWRpb09iamVjdFR5cGUgIT0gNSAmJiBiaXRzLT5udW1CaXRzTGVmdCgpID49IDE2KSB7Ci0gICAgICAgIHNpemVfdCBudW1CaXRzTGVmdEF0U3RhcnQgPSBiaXRzLT5udW1CaXRzTGVmdCgpOwotCi0gICAgICAgIHVuc2lnbmVkIHN5bmNFeHRlbnNpb25UeXBlID0gYml0cy0+Z2V0Qml0cygxMSk7Ci0gICAgICAgIGlmIChzeW5jRXh0ZW5zaW9uVHlwZSA9PSAweDJiNykgewotICAgICAgICAgICAgQUxPR0koImZvdW5kIHN5bmNFeHRlbnNpb24iKTsKLQotICAgICAgICAgICAgQ0hFQ0tfRVEocGFyc2VBdWRpb09iamVjdFR5cGUoYml0cywgJmV4dGVuc2lvbkF1ZGlvT2JqZWN0VHlwZSksCi0gICAgICAgICAgICAgICAgICAgICAoc3RhdHVzX3QpT0spOwotCi0gICAgICAgICAgICBzYnJQcmVzZW50ID0gYml0cy0+Z2V0Qml0cygxKTsKLQotICAgICAgICAgICAgaWYgKHNiclByZXNlbnQgPT0gMSkgewotICAgICAgICAgICAgICAgIHVuc2lnbmVkIGV4dGVuc2lvblNhbXBsaW5nRnJlcUluZGV4ID0gYml0cy0+Z2V0Qml0cyg0KTsKLSAgICAgICAgICAgICAgICBpZiAoZXh0ZW5zaW9uU2FtcGxpbmdGcmVxSW5kZXggPT0gMHgwZikgewotICAgICAgICAgICAgICAgICAgICAvKiB1bnNpZ25lZCBleHRlbnNpb25TYW1wbGluZ0ZyZXF1ZW5jeSA9ICovYml0cy0+Z2V0Qml0cygyNCk7Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgfQotCi0gICAgICAgICAgICBzaXplX3QgbnVtQml0c0luRXh0ZW5zaW9uID0KLSAgICAgICAgICAgICAgICBudW1CaXRzTGVmdEF0U3RhcnQgLSBiaXRzLT5udW1CaXRzTGVmdCgpOwotCi0gICAgICAgICAgICBpZiAobnVtQml0c0luRXh0ZW5zaW9uICYgNykgewotICAgICAgICAgICAgICAgIC8vIEFwcGFyZW50bHkgYW4gZXh0ZW5zaW9uIGlzIGFsd2F5cyBjb25zaWRlcmVkIGFuIGV2ZW4KLSAgICAgICAgICAgICAgICAvLyBtdWx0aXBsZSBvZiA4IGJpdHMgbG9uZy4KLQotICAgICAgICAgICAgICAgIEFMT0dJKCJTa2lwcGluZyAlZCBiaXRzIGFmdGVyIHN5bmMgZXh0ZW5zaW9uIiwKLSAgICAgICAgICAgICAgICAgICAgIDggLSAobnVtQml0c0luRXh0ZW5zaW9uICYgNykpOwotCi0gICAgICAgICAgICAgICAgYml0cy0+c2tpcEJpdHMoOCAtIChudW1CaXRzSW5FeHRlbnNpb24gJiA3KSk7Ci0gICAgICAgICAgICB9Ci0gICAgICAgIH0gZWxzZSB7Ci0gICAgICAgICAgICBiaXRzLT5wdXRCaXRzKHN5bmNFeHRlbnNpb25UeXBlLCAxMSk7Ci0gICAgICAgIH0KLSAgICB9Ci0KLSAgICBpZiAoYXNjICE9IE5VTEwpIHsKLSAgIC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NvbmZpZyhiaXRzLCBOVUxMIC8qIGFzYyAqLyksIChzdGF0dXNfdClPSyk7Ci0gICAgfSBlbHNlIHsKLSAgICAgICAgVFJFU1BBU1MoKTsgIC8vIFhYWCB0byBiZSBpbXBsZW1lbnRlZAotICAgIH0KLQotICAgICpmcmFtZUxlbmd0aFR5cGUgPSBiaXRzLT5nZXRCaXRzKDMpOwotICAgICpmaXhlZEZyYW1lTGVuZ3RoID0gLTE7Ci0KLSAgICBzd2l0Y2ggKCpmcmFtZUxlbmd0aFR5cGUpIHsKLSAgICAgICAgY2FzZSAwOgotICAgICAgICB7Ci0gICAgICAgICAgICAvKiB1bnNpZ25lZCBidWZmZXJGdWxsbmVzcyA9ICovYml0cy0+Z2V0Qml0cyg4KTsKLQotICAgICAgICAgICAgLy8gVGhlICJjb3JlRnJhbWVPZmZzZXQiIGRvZXMgbm90IGFwcGx5IHNpbmNlIHRoZXJlJ3Mgb25seQotICAgICAgICAgICAgLy8gYSBzaW5nbGUgbGF5ZXIuCi0gICAgICAgICAgICBicmVhazsKLSAgICAgICAgfQotCi0gICAgICAgIGNhc2UgMToKLSAgICAgICAgewotICAgICAgICAgICAgKmZpeGVkRnJhbWVMZW5ndGggPSBiaXRzLT5nZXRCaXRzKDkpOwotICAgICAgICAgICAgYnJlYWs7Ci0gICAgICAgIH0KLQotICAgICAgICBjYXNlIDI6Ci0gICAgICAgIHsKLSAgICAgICAgICAgIC8vIHJlc2VydmVkCi0gICAgICAgICAgICBUUkVTUEFTUygpOwotICAgICAgICAgICAgYnJlYWs7Ci0gICAgICAgIH0KLQotICAgICAgICBjYXNlIDM6Ci0gICAgICAgIGNhc2UgNDoKLSAgICAgICAgY2FzZSA1OgotICAgICAgICB7Ci0gICAgICAgICAgICAvKiB1bnNpZ25lZCBDRUxQZnJhbWVMZW5ndGhUYWJsZUluZGV4ID0gKi9iaXRzLT5nZXRCaXRzKDYpOwotICAgICAgICAgICAgYnJlYWs7Ci0gICAgICAgIH0KLQotICAgICAgICBjYXNlIDY6Ci0gICAgICAgIGNhc2UgNzoKLSAgICAgICAgewotICAgICAgICAgICAgLyogdW5zaWduZWQgSFZYQ2ZyYW1lTGVuZ3RoVGFibGVJbmRleCA9ICovYml0cy0+Z2V0Qml0cygxKTsKLSAgICAgICAgICAgIGJyZWFrOwotICAgICAgICB9Ci0KLSAgICAgICAgZGVmYXVsdDoKLSAgICAgICAgICAgIGJyZWFrOwotICAgIH0KLQotICAgICpvdGhlckRhdGFQcmVzZW50ID0gYml0cy0+Z2V0Qml0cygxKTsKLSAgICAqb3RoZXJEYXRhTGVuQml0cyA9IDA7Ci0gICAgaWYgKCpvdGhlckRhdGFQcmVzZW50KSB7Ci0gICAgICAgIGlmIChhdWRpb011eFZlcnNpb24gPT0gMSkgewotICAgICAgICAgICAgVFJFU1BBU1MoKTsgIC8vIFhYWCB0byBiZSBpbXBsZW1lbnRlZAotICAgICAgICB9IGVsc2UgewotICAgICAgICAgICAgKm90aGVyRGF0YUxlbkJpdHMgPSAwOwotCi0gICAgICAgICAgICB1bnNpZ25lZCBvdGhlckRhdGFMZW5Fc2M7Ci0gICAgICAgICAgICBkbyB7Ci0gICAgICAgICAgICAgICAgKCpvdGhlckRhdGFMZW5CaXRzKSA8PD0gODsKLSAgICAgICAgICAgICAgICBvdGhlckRhdGFMZW5Fc2MgPSBiaXRzLT5nZXRCaXRzKDEpOwotICAgICAgICAgICAgICAgIHVuc2lnbmVkIG90aGVyRGF0YUxlblRtcCA9IGJpdHMtPmdldEJpdHMoOCk7Ci0gICAgICAgICAgICAgICAgKCpvdGhlckRhdGFMZW5CaXRzKSArPSBvdGhlckRhdGFMZW5UbXA7Ci0gICAgICAgICAgICB9IHdoaWxlIChvdGhlckRhdGFMZW5Fc2MpOwotICAgICAgICB9Ci0gICAgfQotCi0gICAgdW5zaWduZWQgY3JjQ2hlY2tQcmVzZW50ID0gYml0cy0+Z2V0Qml0cygxKTsKLSAgICBpZiAoY3JjQ2hlY2tQcmVzZW50KSB7Ci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ICAgICB9IHdoaWxlICh0bXAgPT0gMHhmZik7Ci0KLSAgICAgICAgICAgICAgICBwYXlsb2FkTGVuZ3RoID0gbXV4U2xvdExlbmd0aEJ5dGVzOwotICAgICAgICAgICAgICAgIGJyZWFrOwotICAgICAgICAgICAgfQotCi0gICAgICAgICAgICBjYXNlIDI6Ci0gICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgLy8gcmVzZXJ2ZWQKLQotICAgICAgICAgICAgICAgIFRSRVNQQVNTKCk7Ci0gICAgICAgICAgICAgICAgYnJlYWs7Ci0gICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgIGRlZmF1bHQ6Ci0gICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgQ0hFQ0tfR0UobUZpeGVkRnJhbWVMZW5ndGgsIDApOwotCi0gICAgICAgICAgICAgICAgcGF5bG9hZExlbmd0aCA9IG1GaXhlZEZyYW1lTGVuZ3RoOwotICAgICAgICAgICAgICAgIGJyZWFrOwotICAgICAgICAgICAgfQotICAgICAgICB9Ci0KLSAgICAgICAgQ0hFQ0tfTEUob2Zmc2V0ICsgcGF5bG9hZExlbmd0aCwgYnVmZmVyLT5zaXplKCkpOwotCi0gICAgICAgIG1lbWNweShvdXQtPmRhdGEoKSArIG91dC0+c2l6ZSgpLCAmcHRyW29mZnNldF0sIHBheWxvYWRMZW5ndGgpOwotICAgICAgICBvdXQtPnNldFJhbmdlKDAsIG91dC0+c2l6ZSgpICsgcGF5bG9hZExlbmd0aCk7Ci0KLSAgICAgICAgb2Zmc2V0ICs9IHBheWxvYWRMZW5ndGg7Ci0KLSAgICAgICAgaWYgKG1PdGhlckRhdGFQcmVzZW50KSB7Ci0gICAgICAgICAgICAvLyBXZSB3YW50IHRvIHN0YXkgYnl0ZS1hbGlnbmVkLgotCi0gICAgICAgICAgICBDSEVDSygobU90aGVyRGF0YUxlbkJpdHMgJSA4KSA9PSAwKTsKLSAgICAgICAgICAgIENIRUNLX0xFKG9mZnNldCArIChtT3RoZX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HsKLSAgICB2YWx1ZS0+Y2xlYXIoKTsKLQotICAgIHNpemVfdCBrZXlMZW4gPSBzdHJsZW4oa2V5KTsKLQotICAgIGZvciAoOzspIHsKLSAgICAgICAgd2hpbGUgKGlzc3BhY2UoKnMpKSB7Ci0gICAgICAgICAgICArK3M7Ci0gICAgICAgIH0KLQotICAgICAgICBjb25zdCBjaGFyICpjb2xvblBvcyA9IHN0cmNocihzLCAnOycpOwotCi0gICAgICAgIHNpemVfdCBsZW4gPQotICAgICAgICAgICAgKGNvbG9uUG9zID09IE5VTEwpID8gc3RybGVuKHMpIDogY29sb25Qb3MgLSBzOwotCi0gICAgICAgIGlmIChsZW4gPj0ga2V5TGVuICsgMSAmJiBzW2tleUxlbl0gPT0gJz0nCi0gICAgICAgICAgICAgICAgJiYgIXN0cm5jYXNlY21wKHMsIGtleSwga2V5TGVuKSkgewotICAgICAgICAgICAgdmFsdWUtPnNldFRvKCZzW2tleUxlbiArIDFdLCBsZW4gLSBrZXlMZW4gLSAxKTsKLSAgICAgICAgICAgIHJldHVybiB0cnVlOwotICAgICAgICB9Ci0KLSAgICAgICAgaWYgKGNvbG9uUG9zID09IE5VTEwpIHsKLSAgICAgICAgICAgIHJldHVybiBmYWxzZTsKLSAgICAgICAgfQotCi0gICAgICAgIHMgPSBjb2xvblBvcyArIDE7Ci0gICAgfQotfQotCi1zdGF0aWMgYm9vbCBHZXRJbnRlZ2VyQXR0cmlidXRlKAotICAgICAgICBjb25zdCBjaGFyICpzLCBjb25zdCBjaGFyICprZXksIHVuc2lnbmVkICp4KSB7Ci0gICAgKnggPSAwOwotCi0gICAgQVN0cmluZyB2YWw7Ci0gICAgaWYgKCFHZXRBdHRyaWJ1dGUocywga2V5LCAmdmFsKSkgewotICAgICAgICByZXR1cm4gZmFsc2U7Ci0gICAgfQotCi0gICAgcyA9IHZhbC5jX3N0cigpOwotICAgIGNoYXIgKmVuZDsKLSAgICB1bnNpZ25lZCB5ID0gc3RydG91bChzLCAmZW5kLCAx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9Ci0KLSAgICAgICAgdW5zaWduZWQgeDsKLSAgICAgICAgaWYgKCFHZXRJbnRlZ2VyQXR0cmlidXRlKAotICAgICAgICAgICAgICAgICAgICBwYXJhbXMuY19zdHIoKSwgInJhbmRvbUFjY2Vzc0luZGljYXRpb24iLCAmeCkpIHsKLSAgICAgICAgICAgIG1SYW5kb21BY2Nlc3NJbmRpY2F0aW9uID0gZmFsc2U7Ci0gICAgICAgIH0gZWxzZSB7Ci0gICAgICAgICAgICBDSEVDSyh4ID09IDAgfHwgeCA9PSAxKTsKLSAgICAgICAgICAgIG1SYW5kb21BY2Nlc3NJbmRpY2F0aW9uID0gKHggIT0gMCk7Ci0gICAgICAgIH0KLQotICAgICAgICBpZiAoIUdldEludGVnZXJBdHRyaWJ1dGUoCi0gICAgICAgICAgICAgICAgICAgIHBhcmFtcy5jX3N0cigpLCAic3RyZWFtU3RhdGVJbmRpY2F0aW9uIiwKLSAgICAgICAgICAgICAgICAgICAgJm1TdHJlYW1TdGF0ZUluZGljYXRpb24pKSB7Ci0gICAgICAgICAgICBtU3RyZWFtU3RhdGVJbmRpY2F0aW9uID0gMDsKLSAgICAgICAgfQotCi0gICAgICAgIGlmICghR2V0SW50ZWdlckF0dHJpYnV0ZSgKLSAgICAgICAgICAgICAgICAgICAgcGFyYW1zLmNfc3RyKCksICJhdXhpbGlhcnlEYXRhU2l6ZUxlbmd0aCIsCi0gICAgICAgICAgICAgICAgICAgICZtQXV4aWxpYXJ5RGF0YVNpemVMZW5ndGgpKSB7Ci0gICAgICAgICAgICBtQXV4aWxpYXJ5RGF0YVNpemVMZW5ndGggPSAwOwotICAgICAgICB9Ci0KLSAgICAgICAgbUhhc0FVSGVhZGVyID0KLSAgICAgICAgICAgIG1TaXplTGVuZ3RoID4gMAotICAgICAgICAgICAgfHwgbUluZGV4TGVuZ3RoID4gMAotICAgICAgICAgICAgfHwgbUluZGV4RGVsdGFMZW5ndGggPiAwCi0gICAgICAgICAgICB8fCBtQ1RTRGVsdGF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AgICBBVV9zZXJpYWwgKz0gMSArIEFVX2luZGV4OwotICAgICAgICAgICAgfQotCi0gICAgICAgICAgICBpZiAobUNUU0RlbHRhTGVuZ3RoID4gMCkgewotICAgICAgICAgICAgICAgIGlmIChudW1CaXRzTGVmdCA8IDEpIHsKLSAgICAgICAgICAgICAgICAgICAgYnJlYWs7Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgIC0tbnVtQml0c0xlZnQ7Ci0gICAgICAgICAgICAgICAgaWYgKGJpdHMuZ2V0Qml0cygxKSkgewotICAgICAgICAgICAgICAgICAgICBpZiAobnVtQml0c0xlZnQgPCBtQ1RTRGVsdGFMZW5ndGgpIHsKLSAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOwotICAgICAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgICAgIGJpdHMuc2tpcEJpdHMobUNUU0RlbHRhTGVuZ3RoKTsKLSAgICAgICAgICAgICAgICAgICAgbnVtQml0c0xlZnQgLT0gbUNUU0RlbHRhTGVuZ3RoOwotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgaWYgKG1EVFNEZWx0YUxlbmd0aCA+IDApIHsKLSAgICAgICAgICAgICAgICBpZiAobnVtQml0c0xlZnQgPCAxKSB7Ci0gICAgICAgICAgICAgICAgICAgIGJyZWFrOwotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICAtLW51bUJpdHNMZWZ0OwotICAgICAgICAgICAgICAgIGlmIChiaXRzLmdldEJpdHMoMSkpIHsKLSAgICAgICAgICAgICAgICAgICAgaWYgKG51bUJpdHNMZWZ0IDwgbURUU0RlbHRhTGVuZ3RoKSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKLSAgICAgICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgICAgICBiaXRzLnNraXBCaXRzKG1EVFNEZWx0YUxlbmd0aCk7Ci0gICAgICAgICAgICAgICAgICAgIG51bUJpdHNMZWZ0IC09IG1EVFNEZWx0YUxlbmd0aDsKLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgIGlmIChtUmFuZG9tQWNjZXNzSW5kaWNhdGlvbikgewotICAgICAgICAgICAgICAgIGlmIChudW1CaXRzTGVmdCA8IDEpIHsKLSAgICAgICAgICAgICAgICAgICAgYnJlYWs7Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgIGJpdHMuc2tpcEJpdHMoMSk7Ci0gICAgICAgICAgICAgICAgLS1udW1CaXRzTGVmdDsKLSAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgaWYgKG1TdHJlYW1TdGF0ZUluZGljYXRpb24gPiAwKSB7Ci0gICAgICAgICAgICAgICAgaWYgKG51bUJpdHNMZWZ0IDwgbVN0cmVhbVN0YXRlSW5kaWNhdGlvbikgewotICAgICAgICAgICAgICAgICAgICBicmVhazsKLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgYml0cy5za2lwQml0cyhtU3RyZWFtU3RhdGVJbmRpY2F0aW9uKTsKLSAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgQVVIZWFkZXIgaGVhZGVyOwotICAgICAgICAgICAgaGVhZGVyLm1TaXplID0gQVVfc2l6ZTsKLSAgICAgICAgICAgIGhlYWRlci5tU2VyaWFsID0gQVVfc2VyaWFsOwotICAgICAgICAgICAgaGVhZGVycy5wdXNoX2JhY2soaGVhZGVyKTsKLSAgICAgICAgfQotCi0gICAgICAgIHNpemVfdCBvZmZzZXQgPSAyICsgKEFVX2hlYWRlcnNfbGVuZ3RoICsgNykgLyA4OwotCi0gICAgICAgIGlmIChtQXV4aWxpYXJ5RGF0YVNpemVMZW5ndGggPiAwKSB7Ci0gICAgICAgICAgICBBQml0UmVhZGVyIGJpdHMoYnVmZmVyLT5kYXRhKCkgKyBvZmZzZXQsIGJ1ZmZlci0+c2l6ZSgpIC0gb2Zmc2V0KTsKLQot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R1QobmFsLT5zaXplKCksIDB1KTsKLSAgICAgICAgQ0hFQ0tfTEUobmFsLT5zaXplKCksIDY1NTM1dSk7Ci0KLSAgICAgICAgdWludDhfdCBuYWxUeXBlID0gbmFsLT5kYXRhKClbMF0gJiAweDFmOwotICAgICAgICBpZiAobnVtU2VxUGFyYW1ldGVyU2V0cyA9PSAwKSB7Ci0gICAgICAgICAgICBDSEVDS19FUSgodW5zaWduZWQpbmFsVHlwZSwgN3UpOwotICAgICAgICB9IGVsc2UgaWYgKG51bVBpY1BhcmFtZXRlclNldHMgPiAwKSB7Ci0gICAgICAgICAgICBDSEVDS19FUSgodW5zaWduZWQpbmFsVHlwZSwgOHUpOwotICAgICAgICB9Ci0gICAgICAgIGlmIChuYWxUeXBlID09IDcpIHsKLSAgICAgICAgICAgICsrbnVtU2VxUGFyYW1ldGVyU2V0czsKLSAgICAgICAgICAgIHRvdGFsU2VxUGFyYW1ldGVyU2V0U2l6ZSArPSBuYWwtPnNpemUoKTsKLSAgICAgICAgfSBlbHNlICB7Ci0gICAgICAgICAgICBDSEVDS19FUSgodW5zaWduZWQpbmFsVHlwZSwgOHUpOwotICAgICAgICAgICAgKytudW1QaWNQYXJhbWV0ZXJTZXRzOwotICAgICAgICAgICAgdG90YWxQaWNQYXJhbWV0ZXJTZXRTaXplICs9IG5hbC0+c2l6ZSgpOwotICAgICAgICB9Ci0KLSAgICAgICAgcGFyYW1TZXRzLnB1c2gobmFsKTsKLQotICAgICAgICBpZiAoY29tbWFQb3MgPCAwKSB7Ci0gICAgICAgICAgICBicmVhazsKLSAgICAgICAgfQotCi0gICAgICAgIHN0YXJ0ID0gY29tbWFQb3MgKyAxOwotICAgIH0KLQotICAgIENIRUNLX0xUKG51bVNlcVBhcmFtZXRlclNldHMsIDMydSk7Ci0gICAgQ0hFQ0tfTEUobnVtUGljUGFyYW1ldGVyU2V0cywgMjU1dSk7Ci0KLSAgICBzaXplX3QgY3NkU2l6ZSA9Ci0gICAgICAgIDEgKyAzICs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AtMTsKLQotICAgICAgICAgICAgICAgICAgICAvLyBMT0coVkVSQk9TRSkgPDwgIndhaXRlZCB0b28gbG9uZyBmb3IgcGFja2V0LiI7Ci0gICAgICAgICAgICAgICAgICAgIHBhY2tldExvc3QoKTsKLSAgICAgICAgICAgICAgICAgICAgY29udGludWU7Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgfSBlbHNlIHsKLSAgICAgICAgICAgICAgICBtRmlyc3RGYWlsdXJlVGltZVVzID0gZ2V0Tm93VXMoKTsKLSAgICAgICAgICAgIH0KLSAgICAgICAgICAgIGJyZWFrOwotICAgICAgICB9IGVsc2UgewotICAgICAgICAgICAgbUZpcnN0RmFpbHVyZVRpbWVVcyA9IC0xOwotCi0gICAgICAgICAgICBpZiAoc3RhdHVzID09IE5PVF9FTk9VR0hfREFUQSkgewotICAgICAgICAgICAgICAgIGJyZWFrOwotICAgICAgICAgICAgfQotICAgICAgICB9Ci0gICAgfQotfQotCi0vLyBzdGF0aWMKLXZvaWQgQVJUUEFzc2VtYmxlcjo6Q29weVRpbWVzKGNvbnN0IHNwPEFCdWZmZXI+ICZ0bywgY29uc3Qgc3A8QUJ1ZmZlcj4gJmZyb20pIHsKLSAgICB1aW50MzJfdCBydHBUaW1lOwotICAgIENIRUNLKGZyb20tPm1ldGEoKS0+ZmluZEludDMyKCJydHAtdGltZSIsIChpbnQzMl90ICopJnJ0cFRpbWUpKTsKLQotICAgIHRvLT5tZXRhKCktPnNldEludDMyKCJydHAtdGltZSIsIHJ0cFRpbWUpOwotCi0gICAgLy8gQ29weSB0aGUgc2VxIG51bWJlci4KLSAgICB0by0+c2V0SW50MzJEYXRhKGZyb20tPmludDMyRGF0YSgpKTsKLX0KLQotfSAgLy8gbmFtZXNwYWNlIGFuZHJvaWQKZGlmZiAtLWdpdCBhL21lZGlhL2xpYnN0YWdlZnJpZ2h0L3J0c3AvQVJUUEFzc2VtYmxlci5oIGIvbWVkaWEvbGlic3RhZ2VmcmlnaHQvcnRzc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Gh0b25sKElOQUREUl9BTlkpOwotICAgICAgICBhZGRyLnNpbl9wb3J0ID0gaHRvbnMocG9ydCk7Ci0KLSAgICAgICAgaWYgKGJpbmQoKnJ0cFNvY2tldCwKLSAgICAgICAgICAgICAgICAgKGNvbnN0IHN0cnVjdCBzb2NrYWRkciAqKSZhZGRyLCBzaXplb2YoYWRkcikpIDwgMCkgewotICAgICAgICAgICAgY29udGludWU7Ci0gICAgICAgIH0KLQotICAgICAgICBhZGRyLnNpbl9wb3J0ID0gaHRvbnMocG9ydCArIDEpOwotCi0gICAgICAgIGlmIChiaW5kKCpydGNwU29ja2V0LAotICAgICAgICAgICAgICAgICAoY29uc3Qgc3RydWN0IHNvY2thZGRyICopJmFkZHIsIHNpemVvZihhZGRyKSkgPT0gMCkgewotICAgICAgICAgICAgKnJ0cFBvcnQgPSBwb3J0OwotICAgICAgICAgICAgcmV0dXJuOwotICAgICAgICB9Ci0gICAgfQotCi0gICAgVFJFU1BBU1MoKTsKLX0KLQotdm9pZCBBUlRQQ29ubmVjdGlvbjo6b25NZXNzYWdlUmVjZWl2ZWQoY29uc3Qgc3A8QU1lc3NhZ2U+ICZtc2cpIHsKLSAgICBzd2l0Y2ggKG1zZy0+d2hhdCgpKSB7Ci0gICAgICAgIGNhc2Uga1doYXRBZGRTdHJlYW06Ci0gICAgICAgIHsKLSAgICAgICAgICAgIG9uQWRkU3RyZWFtKG1zZyk7Ci0gICAgICAgICAgICBicmVhazsKLSAgICAgICAgfQotCi0gICAgICAgIGNhc2Uga1doYXRSZW1vdmVTdHJlYW06Ci0gICAgICAgIHsKLSAgICAgICAgICAgIG9uUmVtb3ZlU3RyZWFtKG1zZyk7Ci0gICAgICAgICAgICBicmVhazsKLSAgICAgICAgfQotCi0gICAgICAgIGNhc2Uga1doYXRQb2xsU3RyZWFtczoKLSAgICAgICAgewotICAgICAgICAgICAgb25Qb2xsU3RyZWFtcygpOwotICAgICAgICAgICAgYnJlYWs7Ci0gICAgICAgIH0KLQotICAgIC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V0ID4gbWF4U29ja2V0KSB7Ci0gICAgICAgICAgICBtYXhTb2NrZXQgPSBpdC0+bVJUQ1BTb2NrZXQ7Ci0gICAgICAgIH0KLSAgICB9Ci0KLSAgICBpZiAobWF4U29ja2V0ID09IC0xKSB7Ci0gICAgICAgIHJldHVybjsKLSAgICB9Ci0KLSAgICBpbnQgcmVzID0gc2VsZWN0KG1heFNvY2tldCArIDEsICZycywgTlVMTCwgTlVMTCwgJnR2KTsKLQotICAgIGlmIChyZXMgPiAwKSB7Ci0gICAgICAgIExpc3Q8U3RyZWFtSW5mbz46Oml0ZXJhdG9yIGl0ID0gbVN0cmVhbXMuYmVnaW4oKTsKLSAgICAgICAgd2hpbGUgKGl0ICE9IG1TdHJlYW1zLmVuZCgpKSB7Ci0gICAgICAgICAgICBpZiAoKCppdCkubUlzSW5qZWN0ZWQpIHsKLSAgICAgICAgICAgICAgICArK2l0OwotICAgICAgICAgICAgICAgIGNvbnRpbnVlOwotICAgICAgICAgICAgfQotCi0gICAgICAgICAgICBzdGF0dXNfdCBlcnIgPSBPSzsKLSAgICAgICAgICAgIGlmIChGRF9JU1NFVChpdC0+bVJUUFNvY2tldCwgJnJzKSkgewotICAgICAgICAgICAgICAgIGVyciA9IHJlY2VpdmUoJippdCwgdHJ1ZSk7Ci0gICAgICAgICAgICB9Ci0gICAgICAgICAgICBpZiAoZXJyID09IE9LICYmIEZEX0lTU0VUKGl0LT5tUlRDUFNvY2tldCwgJnJzKSkgewotICAgICAgICAgICAgICAgIGVyciA9IHJlY2VpdmUoJippdCwgZmFsc2UpOwotICAgICAgICAgICAgfQotCi0gICAgICAgICAgICBpZiAoZXJyID09IC1FQ09OTlJFU0VUKSB7Ci0gICAgICAgICAgICAgICAgLy8gc29ja2V0IGZhaWx1cmUsIHRoaXMgc3RyZWFtIGlzIGRlYWQsIEppbS4KLQotICAgICAgICAgICAgICAgIEFMT0dXKCJmYWlsZWQgdG8gcmVjZWl2ZSBSVFAvUlRDUCBkYXRhZ3JhbS4iKTsKLSAgICAgICAgICAgICAgICBpdCA9IG1TdHJlYW1zLmVyYXNlKGl0KTsKLSAgICAgICAgICAgICAgICBjb250aW51ZTsKLSAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgKytpdDsKLSAgICAgICAgfQotICAgIH0KLQotICAgIGludDY0X3Qgbm93VXMgPSBBTG9vcGVyOjpHZXROb3dVcygpOwotICAgIGlmIChtTGFzdFJlY2VpdmVyUmVwb3J0VGltZVVzIDw9IDAKLSAgICAgICAgICAgIHx8IG1MYXN0UmVjZWl2ZXJSZXBvcnRUaW1lVXMgKyA1MDAwMDAwbGwgPD0gbm93VXMpIHsKLSAgICAgICAgc3A8QUJ1ZmZlcj4gYnVmZmVyID0gbmV3IEFCdWZmZXIoa01heFVEUFNpemUpOwotICAgICAgICBMaXN0PFN0cmVhbUluZm8+OjppdGVyYXRvciBpdCA9IG1TdHJlYW1zLmJlZ2luKCk7Ci0gICAgICAgIHdoaWxlIChpdCAhPSBtU3RyZWFtcy5lbmQoKSkgewotICAgICAgICAgICAgU3RyZWFtSW5mbyAqcyA9ICYqaXQ7Ci0KLSAgICAgICAgICAgIGlmIChzLT5tSXNJbmplY3RlZCkgewotICAgICAgICAgICAgICAgICsraXQ7Ci0gICAgICAgICAgICAgICAgY29udGludWU7Ci0gICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgIGlmIChzLT5tTnVtUlRDUFBhY2tldHNSZWNlaXZlZCA9PSAwKSB7Ci0gICAgICAgICAgICAgICAgLy8gV2UgaGF2ZSBuZXZlciByZWNlaXZlZCBhbnkgUlRDUCBwYWNrZXRzIG9uIHRoaXMgc3RyZWFtLAotICAgICAgICAgICAgICAgIC8vIHdlIGRvbid0IGV2ZW4ga25vdyB3aGVyZSB0byBzZW5kIGEgcmVwb3J0LgotICAgICAgICAgICAgICAgICsraXQ7Ci0gICAgICAgICAgICAgICAgY29udGludWU7Ci0gICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgIGJ1ZmZlci0+c2V0UmFuZ2UoMCwgMCk7Ci0KLSAgICAgICAgICAgIGZvciAoc2l6ZV90IGkgPSAwOyBpIDwgcy0+bVNvdXJjZXMuc2l6ZSgpOyArK2kpIHsKLSAgICAgICAgICAgICAgICBzcDxBUlRQU291cmNlPiBzb3VyY2UgPSBzLT5tU291cmNlcy52YWx1ZUF0KGkpOwotCi0gICAgICAgICAgICAgICAgc291cmNlLT5hZGRSZWNlaXZlclJlcG9ydChidWZmZXIpOwotCi0gICAgICAgICAgICAgICAgaWYgKG1GbGFncyAmIGtSZWd1bGFybHlSZXF1ZXN0RklSKSB7Ci0gICAgICAgICAgICAgICAgICAgIHNvdXJjZS0+YWRkRklSKGJ1ZmZlcik7Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgfQotCi0gICAgICAgICAgICBpZiAoYnVmZmVyLT5zaXplKCkgPiAwKSB7Ci0gICAgICAgICAgICAgICAgQUxPR1YoIlNlbmRpbmcgUlIuLi4iKTsKLQotICAgICAgICAgICAgICAgIHNzaXplX3QgbjsKLSAgICAgICAgICAgICAgICBkbyB7Ci0gICAgICAgICAgICAgICAgICAgIG4gPSBzZW5kdG8oCi0gICAgICAgICAgICAgICAgICAgICAgICBzLT5tUlRDUFNvY2tldCwgYnVmZmVyLT5kYXRhKCksIGJ1ZmZlci0+c2l6ZSgpLCAwLAotICAgICAgICAgICAgICAgICAgICAgICAgKGNvbnN0IHN0cnVjdCBzb2NrYWRkciAqKSZzLT5tUmVtb3RlUlRDUEFkZHIsCi0gICAgICAgICAgICAgICAgICAgICAgICBzaXplb2Yocy0+bVJlbW90ZVJUQ1BBZGRyKSk7Ci0gICAgICAgICAgICAgICAgfSB3aGlsZSAobiA8IDAgJiYgZXJybm8gPT0gRUlOVFIpOwotCi0gICAgICAgICAgICAgICAgaWYgKG4gPD0gMCkgewotICAgICAgICAgICAgICAgICAgICBBTE9HVygiZmFpbGVkIHRvIHNlbmQgUlRDUCByZWNlaXZlciByZXBvcnQgKCVzKS4iLAotICAgICAgICAgICAgICAgICAgICAgICAgIG4gPT0gMCA/ICJjb25uZWN0aW9uIGdvbmUiIDogc3RyZXJyb3IoZXJybm8pKTsKLQotICAgICAgICAgICAgICAgICAgICBpdCA9IG1TdHJlYW1zLmVyYXNlKGl0KTsKLSAgICAgICAgICAgICAgICAgICAgY29udGludWU7Ci0gICAgICAgICAgICAgICAgfQotCi0gICAgICAgICAgICAgICAgQ0hFQ0tfRVEobiwgKHNzaXplX3QpYnVmZmVyLT5zaXplKCkpOwotCi0gICAgICAgICAgICAgICAgbUxhc3RSZWNlaXZlclJlcG9ydFRpbWVVcyA9IG5vd1VzOwotICAgICAgICAgICAgfQotCi0gICAgICAgICAgICArK2l0OwotICAgICAgICB9Ci0gICAgfQotCi0gICAgaWYgKCFtU3RyZWFtcy5lbXB0eSgpKSB7Ci0gICAgICAgIHBvc3RQb2xsRXZlbnQoKTsKLSAgICB9Ci19Ci0KLXN0YXR1c190IEFSVFBDb25uZWN0aW9uOjpyZWNlaXZlKFN0cmVhbUluZm8gKnMsIGJvb2wgcmVjZWl2ZVJUUCkgewotICAgIEFMT0dWKCJyZWNlaXZpbmcgJXMiLCByZWNlaXZlUlRQID8gIlJUUCIgOiAiUlRDUCIpOwotCi0gICAgQ0hFQ0soIXMtPm1Jc0luamVjdGVkKTsKLQotICAgIHNwPEFCdWZmZXI+IGJ1ZmZlciA9IG5ldyBBQnVmZmVyKDY1NTM2KTsKLQotICAgIHNvY2tsZW5fdCByZW1vdGVBZGRyTGVuID0KLSAgICAgICAgKCFyZWNlaXZlUlRQICYmIHMtPm1OdW1SVENQUGFja2V0c1JlY2VpdmVkID09IDApCi0gICAgICAgICAgICA/IHNpemVvZihzLT5tUmVtb3RlUlRDUEFkZHIpIDogMDsKLQotICAgIHNzaXplX3QgbmJ5dGVzOwotICAgIGRvIHsKLSAgICAgICAgbmJ5dGVzID0gcmVjdmZyb20oCi0gICAgICAgICAgICByZWNlaXZlUlRQID8gcy0+bVJUUFNvY2tldCA6IHM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BdID4+IDYpICE9IDIpIHsKLSAgICAgICAgICAgIC8vIFVuc3VwcG9ydGVkIHZlcnNpb24uCi0gICAgICAgICAgICByZXR1cm4gLTE7Ci0gICAgICAgIH0KLQotICAgICAgICBpZiAoZGF0YVswXSAmIDB4MjApIHsKLSAgICAgICAgICAgIC8vIFBhZGRpbmcgcHJlc2VudC4KLQotICAgICAgICAgICAgc2l6ZV90IHBhZGRpbmdMZW5ndGggPSBkYXRhW3NpemUgLSAxXTsKLQotICAgICAgICAgICAgaWYgKHBhZGRpbmdMZW5ndGggKyAxMiA+IHNpemUpIHsKLSAgICAgICAgICAgICAgICAvLyBJZiB3ZSByZW1vdmVkIHRoaXMgbXVjaCBwYWRkaW5nIHdlJ2QgZW5kIHVwIHdpdGggc29tZXRoaW5nCi0gICAgICAgICAgICAgICAgLy8gdGhhdCdzIHRvbyBzaG9ydCB0byBiZSBhIHZhbGlkIFJUUCBoZWFkZXIuCi0gICAgICAgICAgICAgICAgcmV0dXJuIC0xOwotICAgICAgICAgICAgfQotCi0gICAgICAgICAgICBzaXplIC09IHBhZGRpbmdMZW5ndGg7Ci0gICAgICAgIH0KLQotICAgICAgICBzaXplX3QgaGVhZGVyTGVuZ3RoID0gNCAqIChkYXRhWzJdIDw8IDggfCBkYXRhWzNdKSArIDQ7Ci0KLSAgICAgICAgaWYgKHNpemUgPCBoZWFkZXJMZW5ndGgpIHsKLSAgICAgICAgICAgIC8vIE9ubHkgcmVjZWl2ZWQgYSBwYXJ0aWFsIHBhY2tldD8KLSAgICAgICAgICAgIHJldHVybiAtMTsKLSAgICAgICAgfQotCi0gICAgICAgIHN3aXRjaCAoZGF0YVsxXSkgewotICAgICAgICAgICAgY2FzZSAyMDA6Ci0gICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgcGFyc2VTUihzLCBkYXRhLCBoZWFkZXJMZW5ndGgpOwotICAgICAgICAgICAgICAgIGJyZWFrOwotICAgICAgICAgICAgfQotCi0gICAgICAgICAgICBjYXNlIDIwMTogIC8vIFJSCi0gICAgICAgICAgICBjYXNlIDIwMjogIC8vIFNERVMKLSAgICAgICAgICAgIGNhc2UgMjA0OiAgLy8gQVBQCi0gICAgICAgICAgICAgICAgYnJlYWs7Ci0KLSAgICAgICAgICAgIGNhc2UgMjA1OiAgLy8gVFNGQiAodHJhbnNwb3J0IGxheWVyIHNwZWNpZmljIGZlZWRiYWNrKQotICAgICAgICAgICAgY2FzZSAyMDY6ICAvLyBQU0ZCIChwYXlsb2FkIHNwZWNpZmljIGZlZWRiYWNrKQotICAgICAgICAgICAgICAgIC8vIGhleGR1bXAoZGF0YSwgaGVhZGVyTGVuZ3RoKTsKLSAgICAgICAgICAgICAgICBicmVhazsKLQotICAgICAgICAgICAgY2FzZSAyMDM6Ci0gICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgcGFyc2VCWUUocywgZGF0YSwgaGVhZGVyTGVuZ3RoKTsKLSAgICAgICAgICAgICAgICBicmVhazsKLSAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgZGVmYXVsdDoKLSAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICBBTE9HVygiVW5rbm93biBSVENQIHBhY2tldCB0eXBlICV1IG9mIHNpemUgJWQiLAotICAgICAgICAgICAgICAgICAgICAgKHVuc2lnbmVkKWRhdGFbMV0sIGhlYWRlckxlbmd0aCk7Ci0gICAgICAgICAgICAgICAgYnJlYWs7Ci0gICAgICAgICAgICB9Ci0gICAgICAgIH0KLQotICAgICAgICBkYXRhICs9IGhlYWRlckxlbmd0aDsKLSAgICAgICAgc2l6ZSAtPSBoZWFkZXJMZW5ndGg7Ci0gICAgfQotCi0gICAgcmV0dXJuIE9LOwotfQotCi1zdGF0dXNfdCBBUlRQQ29ubmVjdGlvbjo6cGFyc2VCWUUoCi0gICAgICAgIFN0cmVhbUluZm8gKnMsIGNvbnN0IHVpbnQ4X3QgKmRhdGEsIHNpemVfdCBzaXplKSB7Ci0gICAgc2l6ZV90IFNDID0gZGF0YVswXSA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DsKLSAgICAgICAgICAgIENIRUNLKG1zZy0+ZmluZFNpemUoInRyYWNrLWluZGV4IiwgJnRyYWNrSW5kZXgpKTsKLQotICAgICAgICAgICAgaW50MzJfdCBlb3M7Ci0gICAgICAgICAgICBpZiAobXNnLT5maW5kSW50MzIoImVvcyIsICZlb3MpICYmIGVvcykgewotICAgICAgICAgICAgICAgIFRyYWNrSW5mbyAqaW5mbyA9ICZtVHJhY2tzLmVkaXRJdGVtQXQodHJhY2tJbmRleCk7Ci0gICAgICAgICAgICAgICAgaW5mby0+bVBhY2tldFNvdXJjZS0+c2lnbmFsRU9TKEVSUk9SX0VORF9PRl9TVFJFQU0pOwotICAgICAgICAgICAgICAgIGJyZWFrOwotICAgICAgICAgICAgfQotCi0gICAgICAgICAgICBzcDxBQnVmZmVyPiBhY2Nlc3NVbml0OwotICAgICAgICAgICAgQ0hFQ0sobXNnLT5maW5kQnVmZmVyKCJhY2Nlc3MtdW5pdCIsICZhY2Nlc3NVbml0KSk7Ci0KLSAgICAgICAgICAgIHVpbnQ2NF90IG50cFRpbWU7Ci0gICAgICAgICAgICBDSEVDSyhhY2Nlc3NVbml0LT5tZXRhKCktPmZpbmRJbnQ2NCgKLSAgICAgICAgICAgICAgICAgICAgICAgICJudHAtdGltZSIsIChpbnQ2NF90ICopJm50cFRpbWUpKTsKLQotI2lmIDAKLSNpZiAwCi0gICAgICAgICAgICBwcmludGYoImFjY2VzcyB1bml0IGNvbXBsZXRlIHNpemU9JWRcdG50cC10aW1lPTB4JTAxNmxseFxuIiwKLSAgICAgICAgICAgICAgICAgICBhY2Nlc3NVbml0LT5zaXplKCksIG50cFRpbWUpOwotI2Vsc2UKLSAgICAgICAgICAgIEFMT0dJKCJhY2Nlc3MgdW5pdCBjb21wbGV0ZSwgc2l6ZT0lZCwgbnRwLXRpbWU9JWxsdSIsCi0gICAgICAgICAgICAgICAgIGFjY2Vzc1VuaXQtPnNpemUoKSwgbnRwVGltZSk7Ci0gICAgICAgICAgICBoZXhk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3N0KCk7Ci0gICAgICAgICAgICBicmVhazsKLSAgICAgICAgfQotCi0gICAgICAgIGNhc2Uga1doYXRTdG9wOgotICAgICAgICB7Ci0gICAgICAgICAgICBDSEVDS19FUShtU291cmNlLT5zdG9wKCksIChzdGF0dXNfdClPSyk7Ci0KLSAgICAgICAgICAgIHNlbmRCeWUoKTsKLQotICAgICAgICAgICAgewotICAgICAgICAgICAgICAgIE11dGV4OjpBdXRvbG9jayBhdXRvTG9jayhtTG9jayk7Ci0gICAgICAgICAgICAgICAgbUZsYWdzICY9IH5rRmxhZ1N0YXJ0ZWQ7Ci0gICAgICAgICAgICAgICAgbUNvbmRpdGlvbi5zaWduYWwoKTsKLSAgICAgICAgICAgIH0KLSAgICAgICAgICAgIGJyZWFrOwotICAgICAgICB9Ci0KLSAgICAgICAgY2FzZSBrV2hhdFJlYWQ6Ci0gICAgICAgIHsKLSAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICBNdXRleDo6QXV0b2xvY2sgYXV0b0xvY2sobUxvY2spOwotICAgICAgICAgICAgICAgIGlmICghKG1GbGFncyAmIGtGbGFnU3RhcnRlZCkpIHsKLSAgICAgICAgICAgICAgICAgICAgYnJlYWs7Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgfQotCi0gICAgICAgICAgICBvblJlYWQobXNnKTsKLSAgICAgICAgICAgIGJyZWFrOwotICAgICAgICB9Ci0KLSAgICAgICAgY2FzZSBrV2hhdFNlbmRTUjoKLSAgICAgICAgewotICAgICAgICAgICAgewotICAgICAgICAgICAgICAgIE11dGV4OjpBdXRvbG9jayBhdXRvTG9jayhtTG9jayk7Ci0gICAgICAgICAgICAgICAgaWYgKCEobUZsYWdzICYga0ZsYWdTdGFydGVkKSkgewotICAgICAgICAgICAgICAgICAgICBicmVhazsKLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgIG9uU2VuZFNSKG1zZyk7Ci0gICAgICAgICAgICBicmVhazsKLSA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bMF0gPSAweDgwOwotICAgICAgICBkYXRhWzFdID0gKDEgPDwgNykgfCBQVDsgIC8vIE0tYml0Ci0gICAgICAgIGRhdGFbMl0gPSAobVNlcU5vID4+IDgpICYgMHhmZjsKLSAgICAgICAgZGF0YVszXSA9IG1TZXFObyAmIDB4ZmY7Ci0gICAgICAgIGRhdGFbNF0gPSBydHBUaW1lID4+IDI0OwotICAgICAgICBkYXRhWzVdID0gKHJ0cFRpbWUgPj4gMTYpICYgMHhmZjsKLSAgICAgICAgZGF0YVs2XSA9IChydHBUaW1lID4+IDgpICYgMHhmZjsKLSAgICAgICAgZGF0YVs3XSA9IHJ0cFRpbWUgJiAweGZmOwotICAgICAgICBkYXRhWzhdID0gbVNvdXJjZUlEID4+IDI0OwotICAgICAgICBkYXRhWzldID0gKG1Tb3VyY2VJRCA+PiAxNikgJiAweGZmOwotICAgICAgICBkYXRhWzEwXSA9IChtU291cmNlSUQgPj4gOCkgJiAweGZmOwotICAgICAgICBkYXRhWzExXSA9IG1Tb3VyY2VJRCAmIDB4ZmY7Ci0KLSAgICAgICAgbWVtY3B5KCZkYXRhWzEyXSwKLSAgICAgICAgICAgICAgIG1lZGlhRGF0YSwgbWVkaWFCdWYtPnJhbmdlX2xlbmd0aCgpKTsKLQotICAgICAgICBidWZmZXItPnNldFJhbmdlKDAsIG1lZGlhQnVmLT5yYW5nZV9sZW5ndGgoKSArIDEyKTsKLQotICAgICAgICBzZW5kKGJ1ZmZlciwgZmFsc2UgLyogaXNSVENQICovKTsKLQotICAgICAgICArK21TZXFObzsKLSAgICAgICAgKyttTnVtUlRQU2VudDsKLSAgICAgICAgbU51bVJUUE9jdGV0c1NlbnQgKz0gYnVmZmVyLT5zaXplKCkgLSAxMjsKLSAgICB9IGVsc2UgewotICAgICAgICAvLyBGVS1BCi0KLSAgICAgICAgdW5zaWduZWQgbmFsVHlwZSA9IG1lZGlhRGF0YVswXTsKLSAgICAgICAgc2l6ZV90IG9mZnNldCA9IDE7Ci0KLSAgIC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gICAgIGRhdGFbMTBdID0gKG1Tb3VyY2VJRCA+PiA4KSAmIDB4ZmY7Ci0gICAgICAgICAgICBkYXRhWzExXSA9IG1Tb3VyY2VJRCAmIDB4ZmY7Ci0KLSAgICAgICAgICAgIGRhdGFbMTJdID0gMjggfCAobmFsVHlwZSAmIDB4ZTApOwotCi0gICAgICAgICAgICBDSEVDSyghZmlyc3RQYWNrZXQgfHwgIWxhc3RQYWNrZXQpOwotCi0gICAgICAgICAgICBkYXRhWzEzXSA9Ci0gICAgICAgICAgICAgICAgKGZpcnN0UGFja2V0ID8gMHg4MCA6IDB4MDApCi0gICAgICAgICAgICAgICAgfCAobGFzdFBhY2tldCA/IDB4NDAgOiAweDAwKQotICAgICAgICAgICAgICAgIHwgKG5hbFR5cGUgJiAweDFmKTsKLQotICAgICAgICAgICAgbWVtY3B5KCZkYXRhWzE0XSwgJm1lZGlhRGF0YVtvZmZzZXRdLCBzaXplKTsKLQotICAgICAgICAgICAgYnVmZmVyLT5zZXRSYW5nZSgwLCAxNCArIHNpemUpOwotCi0gICAgICAgICAgICBzZW5kKGJ1ZmZlciwgZmFsc2UgLyogaXNSVENQICovKTsKLQotICAgICAgICAgICAgKyttU2VxTm87Ci0gICAgICAgICAgICArK21OdW1SVFBTZW50OwotICAgICAgICAgICAgbU51bVJUUE9jdGV0c1NlbnQgKz0gYnVmZmVyLT5zaXplKCkgLSAxMjsKLQotICAgICAgICAgICAgZmlyc3RQYWNrZXQgPSBmYWxzZTsKLSAgICAgICAgICAgIG9mZnNldCArPSBzaXplOwotICAgICAgICB9Ci0gICAgfQotCi0gICAgbUxhc3RSVFBUaW1lID0gcnRwVGltZTsKLSAgICBtTGFzdE5UUFRpbWUgPSBHZXROb3dOVFAoKTsKLX0KLQotdm9pZCBBUlRQV3JpdGVyOjpzZW5kSDI2M0RhdGEoTWVkaWFCdWZmZXIgKm1lZGlhQnVmKSB7Ci0gICAgQ0hFQ0tfR0Uoa01heFBhY2tldFNpemUsIDEydSArIDJ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otICAgICAgICAgICAgb25Db25uZWN0KG1zZyk7Ci0gICAgICAgICAgICBicmVhazsKLQotICAgICAgICBjYXNlIGtXaGF0RGlzY29ubmVjdDoKLSAgICAgICAgICAgIG9uRGlzY29ubmVjdChtc2cpOwotICAgICAgICAgICAgYnJlYWs7Ci0KLSAgICAgICAgY2FzZSBrV2hhdENvbXBsZXRlQ29ubmVjdGlvbjoKLSAgICAgICAgICAgIG9uQ29tcGxldGVDb25uZWN0aW9uKG1zZyk7Ci0gICAgICAgICAgICBicmVhazsKLQotICAgICAgICBjYXNlIGtXaGF0U2VuZFJlcXVlc3Q6Ci0gICAgICAgICAgICBvblNlbmRSZXF1ZXN0KG1zZyk7Ci0gICAgICAgICAgICBicmVhazsKLQotICAgICAgICBjYXNlIGtXaGF0UmVjZWl2ZVJlc3BvbnNlOgotICAgICAgICAgICAgb25SZWNlaXZlUmVzcG9uc2UoKTsKLSAgICAgICAgICAgIGJyZWFrOwotCi0gICAgICAgIGNhc2Uga1doYXRPYnNlcnZlQmluYXJ5RGF0YToKLSAgICAgICAgewotICAgICAgICAgICAgQ0hFQ0sobXNnLT5maW5kTWVzc2FnZSgicmVwbHkiLCAmbU9ic2VydmVCaW5hcnlNZXNzYWdlKSk7Ci0gICAgICAgICAgICBicmVhazsKLSAgICAgICAgfQotCi0gICAgICAgIGRlZmF1bHQ6Ci0gICAgICAgICAgICBUUkVTUEFTUygpOwotICAgICAgICAgICAgYnJlYWs7Ci0gICAgfQotfQotCi0vLyBzdGF0aWMKLWJvb2wgQVJUU1BDb25uZWN0aW9uOjpQYXJzZVVSTCgKLSAgICAgICAgY29uc3QgY2hhciAqdXJsLCBBU3RyaW5nICpob3N0LCB1bnNpZ25lZCAqcG9ydCwgQVN0cmluZyAqcGF0aCwKLSAgICAgICAgQVN0cmluZyAqdXNlciwgQVN0cmluZyAqcGFzcykgewotICAgIGhvc3QtPmNsZWFyKCk7Ci0gICAgKnBvcnQgPSAwOwotICAgIHBhdGgtPmNsZWFyKC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1YoInJlcXVlc3Q6ICclcyciLCByZXF1ZXN0LmNfc3RyKCkpOwotCi0gICAgc2l6ZV90IG51bUJ5dGVzU2VudCA9IDA7Ci0gICAgd2hpbGUgKG51bUJ5dGVzU2VudCA8IHJlcXVlc3Quc2l6ZSgpKSB7Ci0gICAgICAgIHNzaXplX3QgbiA9Ci0gICAgICAgICAgICBzZW5kKG1Tb2NrZXQsIHJlcXVlc3QuY19zdHIoKSArIG51bUJ5dGVzU2VudCwKLSAgICAgICAgICAgICAgICAgcmVxdWVzdC5zaXplKCkgLSBudW1CeXRlc1NlbnQsIDApOwotCi0gICAgICAgIGlmIChuIDwgMCAmJiBlcnJubyA9PSBFSU5UUikgewotICAgICAgICAgICAgY29udGludWU7Ci0gICAgICAgIH0KLQotICAgICAgICBpZiAobiA8PSAwKSB7Ci0gICAgICAgICAgICBwZXJmb3JtRGlzY29ubmVjdCgpOwotCi0gICAgICAgICAgICBpZiAobiA9PSAwKSB7Ci0gICAgICAgICAgICAgICAgLy8gU2VydmVyIGNsb3NlZCB0aGUgY29ubmVjdGlvbi4KLSAgICAgICAgICAgICAgICBBTE9HRSgiU2VydmVyIHVuZXhwZWN0ZWRseSBjbG9zZWQgdGhlIGNvbm5lY3Rpb24uIik7Ci0KLSAgICAgICAgICAgICAgICByZXBseS0+c2V0SW50MzIoInJlc3VsdCIsIEVSUk9SX0lPKTsKLSAgICAgICAgICAgICAgICByZXBseS0+cG9zdCgpOwotICAgICAgICAgICAgfSBlbHNlIHsKLSAgICAgICAgICAgICAgICBBTE9HRSgiRXJyb3Igc2VuZGluZyBydHNwIHJlcXVlc3QuICglcykiLCBzdHJlcnJvcihlcnJubykpOwotICAgICAgICAgICAgICAgIHJlcGx5LT5zZXRJbnQzMigicmVzdWx0IiwgLWVycm5vKTsKLSAgICAgICAgICAgICAgICByZXBseS0+cG9zdCgpOwotICAgICAgICAgICAgfQotCi0gICAgICAgICAgICByZXR1cm47Ci0gICAgICAgIH0KLQotICAgICAgICBudW1Ce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cocmVzcG9uc2UtPm1TdGF0dXNMaW5lLCAwLCBzcGFjZTEpKSkgewotICAgICAgICBDSEVDSyhJc1JUU1BWZXJzaW9uKAotICAgICAgICAgICAgICAgICAgICBBU3RyaW5nKAotICAgICAgICAgICAgICAgICAgICAgICAgcmVzcG9uc2UtPm1TdGF0dXNMaW5lLAotICAgICAgICAgICAgICAgICAgICAgICAgc3BhY2UyICsgMSwKLSAgICAgICAgICAgICAgICAgICAgICAgIHJlc3BvbnNlLT5tU3RhdHVzTGluZS5zaXplKCkgLSBzcGFjZTIgLSAxKSkpOwotCi0gICAgICAgIGlzUmVxdWVzdCA9IHRydWU7Ci0KLSAgICAgICAgcmVzcG9uc2UtPm1TdGF0dXNDb2RlID0gMDsKLSAgICB9IGVsc2UgewotICAgICAgICBBU3RyaW5nIHN0YXR1c0NvZGVTdHIoCi0gICAgICAgICAgICAgICAgcmVzcG9uc2UtPm1TdGF0dXNMaW5lLCBzcGFjZTEgKyAxLCBzcGFjZTIgLSBzcGFjZTEgLSAxKTsKLQotICAgICAgICBpZiAoIVBhcnNlU2luZ2xlVW5zaWduZWRMb25nKAotICAgICAgICAgICAgICAgICAgICBzdGF0dXNDb2RlU3RyLmNfc3RyKCksICZyZXNwb25zZS0+bVN0YXR1c0NvZGUpCi0gICAgICAgICAgICAgICAgfHwgcmVzcG9uc2UtPm1TdGF0dXNDb2RlIDwgMTAwIHx8IHJlc3BvbnNlLT5tU3RhdHVzQ29kZSA+IDk5OSkgewotICAgICAgICAgICAgcmV0dXJuIGZhbHNlOwotICAgICAgICB9Ci0gICAgfQotCi0gICAgQVN0cmluZyBsaW5lOwotICAgIHNzaXplX3QgbGFzdERpY3RJbmRleCA9IC0xOwotICAgIGZvciAoOzspIHsKLSAgICAgICAgaWYgKCFyZWNlaXZlTGluZSgmbGluZSkpIHsKLSAgICAgICAgICAgIGJyZWFrOwotICAgICAgICB9Ci0KLSAgICAgICAgaWYgKGxpbmUuZW1wdHkoKSkgewotICAgICAgICAgICAgYnJlYWs7Ci0gICAgICAgIH0KLQotICAgICAgICBBTE9HVigibGluZTogJyVzJyIsIGxpbmUuY19zdHIoKSk7Ci0KLSAgICAgICAgaWYgKGxpbmUuY19zdHIoKVswXSA9PSAnICcgfHwgbGluZS5jX3N0cigpWzBdID09ICdcdCcpIHsKLSAgICAgICAgICAgIC8vIFN1cHBvcnQgZm9yIGZvbGRlZCBoZWFkZXIgdmFsdWVzLgotCi0gICAgICAgICAgICBpZiAobGFzdERpY3RJbmRleCA8IDApIHsKLSAgICAgICAgICAgICAgICAvLyBGaXJzdCBsaW5lIGNhbm5vdCBiZSBhIGNvbnRpbnVhdGlvbiBvZiB0aGUgcHJldmlvdXMgb25lLgotICAgICAgICAgICAgICAgIHJldHVybiBmYWxzZTsKLSAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgQVN0cmluZyAmdmFsdWUgPSByZXNwb25zZS0+bUhlYWRlcnMuZWRpdFZhbHVlQXQobGFzdERpY3RJbmRleCk7Ci0gICAgICAgICAgICB2YWx1ZS5hcHBlbmQobGluZSk7Ci0KLSAgICAgICAgICAgIGNvbnRpbnVlOwotICAgICAgICB9Ci0KLSAgICAgICAgc3NpemVfdCBjb2xvblBvcyA9IGxpbmUuZmluZCgiOiIpOwotICAgICAgICBpZiAoY29sb25Qb3MgPCAwKSB7Ci0gICAgICAgICAgICAvLyBNYWxmb3JtZWQgaGVhZGVyIGxpbmUuCi0gICAgICAgICAgICByZXR1cm4gZmFsc2U7Ci0gICAgICAgIH0KLQotICAgICAgICBBU3RyaW5nIGtleShsaW5lLCAwLCBjb2xvblBvcyk7Ci0gICAgICAgIGtleS50cmltKCk7Ci0gICAgICAgIGtleS50b2xvd2VyKCk7Ci0KLSAgICAgICAgbGluZS5lcmFzZSgwLCBjb2xvblBvcyArIDEpOwotCi0gICAgICAgIGxhc3REaWN0SW5kZXggPSByZXNwb25zZS0+bUhlYWRlcnMuYWRkKGtleSwgbGluZSk7Ci0gICAgfQotCi0gICAgZm9yIChz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HRoZSAnXHInIGFzIHdlbGwuCi0gICAgICAgICAgICBsaW5lLnNldFRvKGRlc2MsIGksIGVvbFBvcyAtIGkgLSAxKTsKLSAgICAgICAgfSBlbHNlIHsKLSAgICAgICAgICAgIGxpbmUuc2V0VG8oZGVzYywgaSwgZW9sUG9zIC0gaSk7Ci0gICAgICAgIH0KLQotICAgICAgICBpZiAobGluZS5lbXB0eSgpKSB7Ci0gICAgICAgICAgICBpID0gZW9sUG9zICsgMTsKLSAgICAgICAgICAgIGNvbnRpbnVlOwotICAgICAgICB9Ci0KLSAgICAgICAgaWYgKGxpbmUuc2l6ZSgpIDwgMiB8fCBsaW5lLmNfc3RyKClbMV0gIT0gJz0nKSB7Ci0gICAgICAgICAgICByZXR1cm4gZmFsc2U7Ci0gICAgICAgIH0KLQotICAgICAgICBBTE9HSSgiJXMiLCBsaW5lLmNfc3RyKCkpOwotCi0gICAgICAgIHN3aXRjaCAobGluZS5jX3N0cigpWzBdKSB7Ci0gICAgICAgICAgICBjYXNlICd2JzoKLSAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICBpZiAoc3RyY21wKGxpbmUuY19zdHIoKSwgInY9MCIpKSB7Ci0gICAgICAgICAgICAgICAgICAgIHJldHVybiBmYWxzZTsKLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgYnJlYWs7Ci0gICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgIGNhc2UgJ2EnOgotICAgICAgICAgICAgY2FzZSAnYic6Ci0gICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgQVN0cmluZyBrZXksIHZhbHVlOwotCi0gICAgICAgICAgICAgICAgc3NpemVfdCBjb2xvblBvcyA9IGxpbmUuZmluZCgiOiIsIDIpOwotICAgICAgICAgICAgICAgIGlmIChjb2xvblBvcyA8IDApIHsKLSAgICAgICAgICAgICAgICAgICAga2V5ID0gbGluZTsKLSAgICAgICAgICAgICAgICB9IGVsc2UgewotICAgICAgICAgICAgICAgICAgICBrZXkuc2V0VG8obGluZSwgMCwgY29sb25Qb3MpOwotCi0gICAgICAgICAgICAgICAgICAgIGlmIChrZXkgPT0gImE9Zm10cCIgfHwga2V5ID09ICJhPXJ0cG1hcCIKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICB8fCBrZXkgPT0gImE9ZnJhbWVzaXplIikgewotICAgICAgICAgICAgICAgICAgICAgICAgc3NpemVfdCBzcGFjZVBvcyA9IGxpbmUuZmluZCgiICIsIGNvbG9uUG9zICsgMSk7Ci0gICAgICAgICAgICAgICAgICAgICAgICBpZiAoc3BhY2VQb3MgPCAwKSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGZhbHNlOwotICAgICAgICAgICAgICAgICAgICAgICAgfQotCi0gICAgICAgICAgICAgICAgICAgICAgICBrZXkuc2V0VG8obGluZSwgMCwgc3BhY2VQb3MpOwotCi0gICAgICAgICAgICAgICAgICAgICAgICBjb2xvblBvcyA9IHNwYWNlUG9zOwotICAgICAgICAgICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgICAgICAgICAgdmFsdWUuc2V0VG8obGluZSwgY29sb25Qb3MgKyAxLCBsaW5lLnNpemUoKSAtIGNvbG9uUG9zIC0gMSk7Ci0gICAgICAgICAgICAgICAgfQotCi0gICAgICAgICAgICAgICAga2V5LnRyaW0oKTsKLSAgICAgICAgICAgICAgICB2YWx1ZS50cmltKCk7Ci0KLSAgICAgICAgICAgICAgICBBTE9HVigiYWRkaW5nICclcycgPT4gJyVzJyIsIGtleS5jX3N0cigpLCB2YWx1ZS5jX3N0cigpKTsKLQotICAgICAgICAgICAgICAgIG1UcmFja3MuZWRpdEl0ZW1BdChtVHJhY2tzLnNpemUoKSAtIDEpLmFkZChrZXksIHZhbHVlKTsKLSAgICAgICAgICAgICAgICBicmVhazsKLSAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgY2FzZSAnbSc6Ci0gICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgQUxPR1YoIm5ldyBzZWN0aW9uICclcyciLAotICAgICAgICAgICAgICAgICAgICAgQVN0cmluZyhsaW5lLCAyLCBsaW5lLnNpemUoKSAtIDIpLmNfc3RyKCkpOwotCi0gICAgICAgICAgICAgICAgbVRyYWNrcy5wdXNoKEF0dHJpYnMoKSk7Ci0gICAgICAgICAgICAgICAgbUZvcm1hdHMucHVzaChBU3RyaW5nKGxpbmUsIDIsIGxpbmUuc2l6ZSgpIC0gMikpOwotICAgICAgICAgICAgICAgIGJyZWFrOwotICAgICAgICAgICAgfQotCi0gICAgICAgICAgICBkZWZhdWx0OgotICAgICAgICAgICAgewotICAgICAgICAgICAgICAgIEFTdHJpbmcga2V5LCB2YWx1ZTsKLQotICAgICAgICAgICAgICAgIHNzaXplX3QgZXF1YWxQb3MgPSBsaW5lLmZpbmQoIj0iKTsKLQotICAgICAgICAgICAgICAgIGtleSA9IEFTdHJpbmcobGluZSwgMCwgZXF1YWxQb3MgKyAxKTsKLSAgICAgICAgICAgICAgICB2YWx1ZSA9IEFTdHJpbmcobGluZSwgZXF1YWxQb3MgKyAxLCBsaW5lLnNpemUoKSAtIGVxdWFsUG9zIC0gMSk7Ci0KLSAgICAgICAgICAgICAgICBrZXkudHJpbSgpOwotICAgICAgICAgICAgICAgIHZhbHVlLnRyaW0oKTsKLQotICAgICAgICAgICAgICAgIEFMT0dWKCJhZGRpbmcgJyVzJyA9PiAnJXMnIiwga2V5LmNfc3RyKCksIHZhbHVlLmNfc3RyKCkpOwotCi0gICAgICAgICAgICAgICAgbVRyYWNrcy5lZGl0SXRlbUF0KG1UcmFja3Muc2l6ZSgpIC0gMSkuYWRkKGtleSwgdmFsdWUpOwotICAgICAgICAgICAgICAgIGJyZWFrOwotICAgICAgICAgICAgfQotICAgICAgICB9Ci0KLSAgICAgICAgaSA9IGVvbFBvcyArIDE7Ci0gICAgfQotCi0gICAgcmV0dXJuIHRydWU7Ci19Ci0KLWJvb2wgQVNlc3Npb25EZXNjcmlwdGlvbjo6aXNWYWxpZCgp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0dHJpYnV0ZShjb25zdCBjaGFyICpzLCBjb25zdCBjaGFyICprZXksIEFTdHJpbmcgKnZhbHVlKSB7Ci0gICAgdmFsdWUtPmNsZWFyKCk7Ci0KLSAgICBzaXplX3Qga2V5TGVuID0gc3RybGVuKGtleSk7Ci0KLSAgICBmb3IgKDs7KSB7Ci0gICAgICAgIHdoaWxlIChpc3NwYWNlKCpzKSkgewotICAgICAgICAgICAgKytzOwotICAgICAgICB9Ci0KLSAgICAgICAgY29uc3QgY2hhciAqY29sb25Qb3MgPSBzdHJjaHIocywgJzsnKTsKLQotICAgICAgICBzaXplX3QgbGVuID0KLSAgICAgICAgICAgIChjb2xvblBvcyA9PSBOVUxMKSA/IHN0cmxlbihzKSA6IGNvbG9uUG9zIC0gczsKLQotICAgICAgICBpZiAobGVuID49IGtleUxlbiArIDEgJiYgc1trZXlMZW5dID09ICc9JyAmJiAhc3RybmNtcChzLCBrZXksIGtleUxlbikpIHsKLSAgICAgICAgICAgIHZhbHVlLT5zZXRUbygmc1trZXlMZW4gKyAxXSwgbGVuIC0ga2V5TGVuIC0gMSk7Ci0gICAgICAgICAgICByZXR1cm4gdHJ1ZTsKLSAgICAgICAgfQotCi0gICAgICAgIGlmIChjb2xvblBvcyA9PSBOVUxMKSB7Ci0gICAgICAgICAgICByZXR1cm4gZmFsc2U7Ci0gICAgICAgIH0KLQotICAgICAgICBzID0gY29sb25Qb3MgKyAxOwotICAgIH0KLX0KLQotc3RydWN0IE15SGFuZGxlciA6IHB1YmxpYyBBSGFuZGxlciB7Ci0gICAgZW51bSB7Ci0gICAgICAgIGtXaGF0Q29ubmVjdGVkICAgICAgICAgICAgICAgICAgPSAnY29ubicsCi0gICAgICAgIGtXaGF0RGlzY29ubmVjdGVkICAgICAgICAgICAgICAgPSAnZGlzYycsCi0gICAgICAgIGtXaGF0U2Vla0RvbmUgICAgICAgICAgICAgICAgICAgPSAnc2RvbicsCi0KLSAgICAgICAga1doYXRBY2Nlc3NVbml0ICAgICAgICAgICAgICAgICA9ICdhY2NVJywKLSAgICAgICAga1doYXRFT1MgICAgICAgICAgICAgICAgICAgICAgICA9ICdlb3MhJywKLSAgICAgICAga1doYXRTZWVrRGlzY29udGludWl0eSAgICAgICAgICA9ICdzZWVEJywKLSAgICAgICAga1doYXROb3JtYWxQbGF5VGltZU1hcHBpbmcgICAgICA9ICducHRNJywKLSAgICB9OwotCi0gICAgTXlIYW5kbGVyKAotICAgICAgICAgICAgY29uc3QgY2hhciAqdXJsLAotICAgICAgICAgICAgY29uc3Qgc3A8QU1lc3NhZ2U+ICZub3RpZnksCi0gICAgICAgICAgICBib29sIHVpZFZhbGlkID0gZmFsc2UsIHVpZF90IHVpZCA9IDApCi0gICAgICAgIDogbU5vdGlmeShub3RpZnkpLAotICAgICAgICAgIG1VSURWYWxpZCh1aWRWYWxpZCksCi0gICAgICAgICAgbVVJRCh1aWQpLAotICAgICAgICAgIG1OZXRMb29wZXIobmV3IEFMb29wZXIpLAotICAgICAgICAgIG1Db25uKG5ldyBBUlRTUENvbm5lY3Rpb24obVVJRFZhbGlkLCBtVUlEKSksCi0gICAgICAgICAgbVJUUENvbm4obmV3IEFSVFBDb25uZWN0aW9uKSwKLSAgICAgICAgICBtT3JpZ2luYWxTZXNzaW9uVVJMKHVybCksCi0gICAgICAgICAgbVNlc3Npb25VUkwodXJsKSwKLSAgICAgICAgICBtU2V0dXBUcmFja3NTdWNjZXNzZnVsKGZhbHNlKSwKLSAgICAgICAgICBtU2Vla1BlbmRpbmcoZmFsc2UpLAotICAgICAgICAgIG1GaXJzdEFjY2Vzc1VuaXQodHJ1ZSksCi0gICAgICAgICAgbUFsbFRyYWNrc0hhdmVUaW1lKGZhbHNlKSwKLSAgICAgICAgICBtTlRQQW5jaG9yVXMoLTEpLAotICAgICAgICAgIG1NZWRpYUFuY2hvclVzKC0xKSwKLSAgICAgICAgICBtTGFzdE1lZGlhVGltZVVzKDApLAotICAgICAgICAgIG1OdW1BY2Nlc3NVbml0c1JlY2VpdmVkKDApLAotICAgICAgICAgIG1DaGVja1BlbmRpbmcoZmFsc2UpLAotICAgICAgICAgIG1DaGVja0dlbmVyYXRpb24oMCksCi0gICAgICAgICAgbVRyeVRDUEludGVybGVhdmluZyhmYWxzZSksCi0gICAgICAgICAgbVRyeUZha2VSVENQKGZhbHNlKSwKLSAgICAgICAgICBtUmVjZWl2ZWRGaXJzdFJUQ1BQYWNrZXQoZmFsc2UpLAotICAgICAgICAgIG1SZWNlaXZlZEZpcnN0UlRQUGFja2V0KGZhbHNlKSwKLSAgICAgICAgICBtU2Vla2FibGUoZmFsc2UpLAotICAgICAgICAgIG1LZWVwQWxpdmVUaW1lb3V0VXMoa0RlZmF1bHRLZWVwQWxpdmVUaW1lb3V0VXMpLAotICAgICAgICAgIG1LZWVwQWxpdmVHZW5lcmF0aW9uKDApIHsKLSAgICAgICAgbU5ldExvb3Blci0+c2V0TmFtZSgicnRzcCBuZXQiKTsKLSAgICAgICAgbU5ldExvb3Blci0+c3RhcnQoZmFsc2UgLyogcnVuT25DYWxsaW5nVGhyZWFkICovLAotICAgICAgICAgICAgICAgICAgICAgICAgICBmYWxzZSAvKiBjYW5DYWxsSmF2YSAqLywKLSAgICAgICAgICAgICAgICAgICAgICAgICAgUFJJT1JJVFlfSElHSEVTVCk7Ci0KLSAgICAgICAgLy8gU3RyaXAgYW55IGF1dGhlbnRpY2F0aW9uIGluZm8gZnJvbSB0aGUgc2Vzc2lvbiB1cmwsIHdlIGRvbid0Ci0gICAgICAgIC8vIHdhbnQgdG8gdHJhbnNtaXQgdXNlci9wYXNzIGluIGNsZWFydGV4dC4KLSAgICAgICAgQVN0cmluZyBob3N0LCBwYXRoLCB1c2VyLCBwYXNzOwotICAgICAgICB1bnNpZ25lZCBwb3J0OwotICAgICAgICBDSEVDSyhBUlRTUENvbm5lY3Rpb246OlBhcnNlVVJMKAotICAgICAgICAgICAgICAgICAgICBtU2Vzc2lvblVSTC5jX3N0cigpLCAmaG9zdCwgJnBvcnQsICZwYXRoL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AgYWRkci5zaW5fZmFtaWx5ID0gQUZfSU5FVDsKLQotICAgICAgICBBU3RyaW5nIHNvdXJjZTsKLSAgICAgICAgQVN0cmluZyBzZXJ2ZXJfcG9ydDsKLSAgICAgICAgaWYgKCFHZXRBdHRyaWJ1dGUodHJhbnNwb3J0LmNfc3RyKCksCi0gICAgICAgICAgICAgICAgICAgICAgICAgICJzb3VyY2UiLAotICAgICAgICAgICAgICAgICAgICAgICAgICAmc291cmNlKSkgewotICAgICAgICAgICAgQUxPR1coIk1pc3NpbmcgJ3NvdXJjZScgZmllbGQgaW4gVHJhbnNwb3J0IHJlc3BvbnNlLiBVc2luZyAiCi0gICAgICAgICAgICAgICAgICJSVFNQIGVuZHBvaW50IGFkZHJlc3MuIik7Ci0KLSAgICAgICAgICAgIHN0cnVjdCBob3N0ZW50ICplbnQgPSBnZXRob3N0YnluYW1lKG1TZXNzaW9uSG9zdC5jX3N0cigpKTsKLSAgICAgICAgICAgIGlmIChlbnQgPT0gTlVMTCkgewotICAgICAgICAgICAgICAgIEFMT0dFKCJGYWlsZWQgdG8gbG9vayB1cCBhZGRyZXNzIG9mIHNlc3Npb24gaG9zdCAnJXMnIiwKLSAgICAgICAgICAgICAgICAgICAgIG1TZXNzaW9uSG9zdC5jX3N0cigpKTsKLQotICAgICAgICAgICAgICAgIHJldHVybiBmYWxzZTsKLSAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgYWRkci5zaW5fYWRkci5zX2FkZHIgPSAqKGluX2FkZHJfdCAqKWVudC0+aF9hZGRyOwotICAgICAgICB9IGVsc2UgewotICAgICAgICAgICAgYWRkci5zaW5fYWRkci5zX2FkZHIgPSBpbmV0X2FkZHIoc291cmNlLmNfc3RyKCkpOwotICAgICAgICB9Ci0KLSAgICAgICAgaWYgKCFHZXRBdHRyaWJ1dGUodHJhbnNwb3J0LmNfc3RyKCksCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAic2VydmVyX3BvcnQiLAotICAgICAgICAgICAgICA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AgICAgICAgICAgICAgICAgcmVxdWVzdC5hcHBlbmQobVNlc3Npb25VUkwpOwotICAgICAgICAgICAgICAgICAgICByZXF1ZXN0LmFwcGVuZCgiIFJUU1AvMS4wXHJcbiIpOwotICAgICAgICAgICAgICAgICAgICByZXF1ZXN0LmFwcGVuZCgiQWNjZXB0OiBhcHBsaWNhdGlvbi9zZHBcclxuIik7Ci0gICAgICAgICAgICAgICAgICAgIHJlcXVlc3QuYXBwZW5kKCJcclxuIik7Ci0KLSAgICAgICAgICAgICAgICAgICAgc3A8QU1lc3NhZ2U+IHJlcGx5ID0gbmV3IEFNZXNzYWdlKCdkZXNjJywgaWQoKSk7Ci0gICAgICAgICAgICAgICAgICAgIG1Db25uLT5zZW5kUmVxdWVzdChyZXF1ZXN0LmNfc3RyKCksIHJlcGx5KTsKLSAgICAgICAgICAgICAgICB9IGVsc2UgewotICAgICAgICAgICAgICAgICAgICAobmV3IEFNZXNzYWdlKCdkaXNjJywgaWQoKSkpLT5wb3N0KCk7Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgIGJyZWFrOwotICAgICAgICAgICAgfQotCi0gICAgICAgICAgICBjYXNlICdkaXNjJzoKLSAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICArK21LZWVwQWxpdmVHZW5lcmF0aW9uOwotCi0gICAgICAgICAgICAgICAgaW50MzJfdCByZWNvbm5lY3Q7Ci0gICAgICAgICAgICAgICAgaWYgKG1zZy0+ZmluZEludDMyKCJyZWNvbm5lY3QiLCAmcmVjb25uZWN0KSAmJiByZWNvbm5lY3QpIHsKLSAgICAgICAgICAgICAgICAgICAgc3A8QU1lc3NhZ2U+IHJlcGx5ID0gbmV3IEFNZXNzYWdlKCdjb25uJywgaWQoKSk7Ci0gICAgICAgICAgICAgICAgICAgIG1Db25uLT5jb25uZWN0KG1PcmlnaW5hbFNlc3Npb25VUkwuY19zdHIoKSwgcmVwbHkpOwotICAgICAgICAgICAgICAgIH0gZWxzZSB7Ci0gICAgICAgICAgICAgICAgICAgIChuZXcgQU1lc3NhZ2UoJ3F1aXQnLCBpZCgpKSktPnBvc3QoKTsKLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgYnJlYWs7Ci0gICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgIGNhc2UgJ2Rlc2MnOgotICAgICAgICAgICAgewotICAgICAgICAgICAgICAgIGludDMyX3QgcmVzdWx0OwotICAgICAgICAgICAgICAgIENIRUNLKG1zZy0+ZmluZEludDMyKCJyZXN1bHQiLCAmcmVzdWx0KSk7Ci0KLSAgICAgICAgICAgICAgICBBTE9HSSgiREVTQ1JJQkUgY29tcGxldGVkIHdpdGggcmVzdWx0ICVkICglcykiLAotICAgICAgICAgICAgICAgICAgICAgcmVzdWx0LCBzdHJlcnJvcigtcmVzdWx0KSk7Ci0KLSAgICAgICAgICAgICAgICBpZiAocmVzdWx0ID09IE9LKSB7Ci0gICAgICAgICAgICAgICAgICAgIHNwPFJlZkJhc2U+IG9iajsKLSAgICAgICAgICAgICAgICAgICAgQ0hFQ0sobXNnLT5maW5kT2JqZWN0KCJyZXNwb25zZSIsICZvYmopKTsKLSAgICAgICAgICAgICAgICAgICAgc3A8QVJUU1BSZXNwb25zZT4gcmVzcG9uc2UgPQotICAgICAgICAgICAgICAgICAgICAgICAgc3RhdGljX2Nhc3Q8QVJUU1BSZXNwb25zZSAqPihvYmouZ2V0KCkpOwotCi0gICAgICAgICAgICAgICAgICAgIGlmIChyZXNwb25zZS0+bVN0YXR1c0NvZGUgPT0gMzAyKSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICBzc2l6ZV90IGkgPSByZXNwb25zZS0+bUhlYWRlcnMuaW5kZXhPZktleSgibG9jYXRpb24iKTsKLSAgICAgICAgICAgICAgICAgICAgICAgIENIRUNLX0dFKGksIDApOwotCi0gICAgICAgICAgICAgICAgICAgICAgICBtU2Vzc2lvblVSTCA9IHJlc3BvbnNlLT5tSGVhZGVycy52YWx1ZUF0KGkpOwotCi0gICAgICAgICAgICAgICAgICAgICAgICBBU3RyaW5nIHJlcXVlc3Q7Ci0gICAgICAgICAgICAgICAgICAgICAgICByZXF1ZXN0ID0gIkRFU0NSSUJFICI7Ci0gICAgICAgICAgICAgICAgICAgICAgICByZXF1ZXN0LmFwcGVuZChtU2Vzc2lvblVSTCk7Ci0gICAgICAgICAgICAgICAgICAgICAgICByZXF1ZXN0LmFwcGVuZCgiIFJUU1AvMS4wXHJcbiIpOwotICAgICAgICAgICAgICAgICAgICAgICAgcmVxdWVzdC5hcHBlbmQoIkFjY2VwdDogYXBwbGljYXRpb24vc2RwXHJcbiIpOwotICAgICAgICAgICAgICAgICAgICAgICAgcmVxdWVzdC5hcHBlbmQoIlxyXG4iKTsKLQotICAgICAgICAgICAgICAgICAgICAgICAgc3A8QU1lc3NhZ2U+IHJlcGx5ID0gbmV3IEFNZXNzYWdlKCdkZXNjJywgaWQoKSk7Ci0gICAgICAgICAgICAgICAgICAgICAgICBtQ29ubi0+c2VuZFJlcXVlc3QocmVxdWVzdC5jX3N0cigpLCByZXBseSk7Ci0gICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKLSAgICAgICAgICAgICAgICAgICAgfQotCi0gICAgICAgICAgICAgICAgICAgIGlmIChyZXNwb25zZS0+bVN0YXR1c0NvZGUgIT0gMjAwKSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICByZXN1bHQgPSBVTktOT1dOX0VSUk9SOwotICAgICAgICAgICAgICAgICAgICB9IGVsc2UgewotICAgICAgICAgICAgICAgICAgICAgICAgbVNlc3Npb25EZXNjID0gbmV3IEFTZXNzaW9uRGVzY3JpcHRpb247Ci0KLSAgICAgICAgICAgICAgICAgICAgICAgIG1TZXNzaW9uRGVzYy0+c2V0VG8oCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJlc3BvbnNlLT5tQ29udGVudC0+ZGF0YSgpLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXNwb25zZS0+bUNvbnRlbnQtPnNpemUoKSk7Ci0KLSAgICAgICAgICAgICAgICAgICAgICAgIGlmICghbVNlc3Npb25EZXNjLT5pc1ZhbGlkKCkpIHsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBBTE9HRSgiRmFpbGVkIHRvIHBhcnNlIHNlc3Npb24gZGVzY3JpcHRpb24uIik7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgcmVzdWx0ID0gRVJST1JfTUFMRk9STUVEOwotICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBzc2l6ZV90IGkgPSByZXNwb25zZS0+bUhlYWRlcnMuaW5kZXhPZktleSgiY29udGVudC1iYXNlIik7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGkgPj0gMCkgewotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBtQmFzZVVSTCA9IHJlc3BvbnNlLT5tSGVhZGVycy52YWx1ZUF0KGkpOwotICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGkgPSByZXNwb25zZS0+bUhlYWRlcnMuaW5kZXhPZktleSgiY29udGVudC1sb2NhdGlvbiIpOwotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoaSA+PSAwKSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBtQmFzZVVSTCA9IHJlc3BvbnNlLT5tSGVhZGVycy52YWx1ZUF0KGkpOwotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2UgewotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbUJhc2VVUkwgPSBtU2Vzc2lvblVSTDsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICghbUJhc2VVUkwuc3RhcnRzV2l0aCgicnRzcDovLyIpKSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vIFNvbWUgbWlzYmVoYXZpbmcgc2VydmVycyBzcGVjaWZ5IGEgcmVsYXRpdmUKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gVVJMIGluIG9uZSBvZiB0aGUgbG9jYXRpb25zIGFib3ZlLCBjb21iaW5lCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vIGl0IHdpdGggdGhlIGFic29sdXRlIHNlc3Npb24gVVJMIHRvIGdldAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyBzb21ldGhpbmcgdXNhYmxlLi4uCi0KLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgQUxPR1coIlNlcnZlciBzcGVjaWZpZWQgYSBub24tYWJzb2x1dGUgYmFzZSBVUkwiCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIiwgY29tYmluaW5nIGl0IHdpdGggdGhlIHNlc3Npb24gVVJMIHRvICIKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAiZ2V0IHNvbWV0aGluZyB1c2FibGUuLi4iKTsKLQotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBBU3RyaW5nIHRtcDsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgQ0hFQ0soTWFrZVVSTCgKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbVNlc3Npb25VUkwuY19zdHIoKSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbUJhc2VVUkwuY19zdHIoKSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJnRtcCkpOwotCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1CYXNlVVJMID0gdG1wOwotICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChtU2Vzc2lvbkRlc2MtPmNvdW50VHJhY2tzKCkgPCAyKSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vIFRoZXJlJ3Mgbm8gYWN0dWFsIHRyYWNrcyBpbiB0aGlzIHNlc3Npb24uCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vIFRoZSBmaXJzdCAidHJhY2siIGlzIG1lcmVseSBzZXNzaW9uIG1ldGEKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gZGF0YS4KLQotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBBTE9HVygiU2Vzc2lvbiBkb2Vzbid0IGNvbnRhaW4gYW55IHBsYXlhYmxlICIKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAidHJhY2tzLiBBYm9ydGluZy4iKTsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmVzdWx0ID0gRVJST1JfVU5TVVBQT1JURUQ7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2V0dXBUcmFjaygxKTsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgICAgICBpZiAocmVzdWx0ICE9IE9LKSB7Ci0gICAgICAgICAgICAgICAgICAgIHNwPEFNZXNzYWdlPiByZXBseSA9IG5ldyBBTWVzc2FnZSgnZGlzYycsIGlkKCkpOwotICAgICAgICAgICAgICAgICAgICBtQ29ubi0+ZGlzY29ubmVjdChyZXBseSk7Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgIGJyZWFrOwotICAgICAgICAgICAgfQotCi0gICAgICAgICAgICBjYXNlICdzZXR1JzoKLSAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICBzaXplX3QgaW5kZXg7Ci0gICAgICAgICAgICAgICAgQ0hFQ0sobXNnLT5maW5kU2l6ZSgiaW5kZXgiLCAmaW5kZXgpKTsKLQotICAgICAgICAgICAgICAgIFRyYWNrSW5mbyAqdHJhY2sgPSBOVUxMOwotICAgICAgICAgICAgICAgIHNpemVfdCB0cmFja0luZGV4OwotICAgICAgICAgICAgICAgIGlmIChtc2ctPmZpbmRTaXplKCJ0cmFjay1pbmRleCIsICZ0cmFja0luZGV4KSkgewotICAgICAgICAgICAgICAgICAgICB0cmFjayA9ICZtVHJhY2tzLmVkaXRJdGVtQXQodHJhY2tJbmRleCk7Ci0gICAgICAgICAgICAgICAgfQotCi0gICAgICAgICAgICAgICAgaW50MzJfdCByZXN1bHQ7Ci0gICAgICAgICAgICAgICAgQ0hFQ0sobXNnLT5maW5kSW50MzIoInJlc3VsdCIsICZyZXN1bHQpKTsKLQotICAgICAgICAgICAgICAgIEFMT0dJKCJTRVRVUCglZCkgY29tcGxldGVkIHdpdGggcmVzdWx0ICVkICglcykiLAotICAgICAgICAgICAgICAgICAgICAgaW5kZXgsIHJlc3VsdCwgc3RyZXJyb3IoLXJlc3VsdCkpOwotCi0gICAgICAgICAgICAgICAgaWYgKHJlc3VsdCA9PSBPSykgewotICAgICAgICAgICAgICAgICAgICBDSEVDSyh0cmFjayAhPSBOVUxMKTsKLQotICAgICAgICAgICAgICAgICAgICBzcDxSZWZCYXNlPiBvYmo7Ci0gICAgICAgICAgICAgICAgICAgIENIRUNLKG1zZy0+ZmluZE9iamVjdCgicmVzcG9uc2UiLCAmb2JqKSk7Ci0gICAgICAgICAgICAgICAgICAgIHNwPEFSVFNQUmVzcG9uc2U+IHJlc3BvbnNlID0KLSAgICAgICAgICAgICAgICAgICAgICAgIHN0YXRpY19jYXN0PEFSVFNQUmVzcG9uc2UgKj4ob2JqLmdldCgpKTsKLQotICAgICAgICAgICAgICAgICAgICBpZiAocmVzcG9uc2UtPm1TdGF0dXNDb2RlICE9IDIwMCkgewotICAgICAgICAgICAgICAgICAgICAgICAgcmVzdWx0ID0gVU5LTk9XTl9FUlJPUjsKLSAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHsKLSAgICAgICAgICAgICAgICAgICAgICAgIHNzaXplX3QgaSA9IHJlc3BvbnNlLT5tSGVhZGVycy5pbmRleE9mS2V5KCJzZXNzaW9uIik7Ci0gICAgICAgICAgICAgICAgICAgICAgICBDSEVDS19HRShpLCAwKTsKLQotICAgICAgICAgICAgICAgICAgICAgICAgbVNlc3Npb25JRCA9IHJlc3BvbnNlLT5tSGVhZGVycy52YWx1ZUF0KGkpOwotCi0gICAgICAgICAgICAgICAgICAgICAgICBtS2VlcEFsaXZlVGltZW91dFVzID0ga0RlZmF1bHRLZWVwQWxpdmVUaW1lb3V0VXM7Ci0gICAgICAgICAgICAgICAgICAgICAgICBBU3RyaW5nIHRpbWVvdXRTdHI7Ci0gICAgICAgICAgICAgICAgICAgICAgICBpZiAoR2V0QXR0cmlidXRlKAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbVNlc3Npb25JRC5jX3N0cigpLCAidGltZW91dCIsICZ0aW1lb3V0U3RyKSkgewotICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNoYXIgKmVuZDsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICB1bnNpZ25lZCBsb25nIHRpbWVvdXRTZWNzID0KLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc3RydG91bCh0aW1lb3V0U3RyLmNfc3RyKCksICZlbmQsIDEwKTsKLQotICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChlbmQgPT0gdGltZW91dFN0ci5jX3N0cigpIHx8ICplbmQgIT0gJ1wwJykgewotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBBTE9HVygic2VydmVyIHNwZWNpZmllZCBtYWxmb3JtZWQgdGltZW91dCAnJXMnIiwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0aW1lb3V0U3RyLmNfc3RyKCkpOwotCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1LZWVwQWxpdmVUaW1lb3V0VXMgPSBrRGVmYXVsdEtlZXBBbGl2ZVRpbWVvdXRVczsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKHRpbWVvdXRTZWNzIDwgMTUpIHsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgQUxPR1coInNlcnZlciBzcGVjaWZpZWQgdG9vIHNob3J0IGEgdGltZW91dCAiCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIiglbHUgc2VjcyksIHVzaW5nIGRlZmF1bHQuIiwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0aW1lb3V0U2Vjcyk7Ci0KLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbUtlZXBBbGl2ZVRpbWVvdXRVcyA9IGtEZWZhdWx0S2VlcEFsaXZlVGltZW91dFVzOwotICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1LZWVwQWxpdmVUaW1lb3V0VXMgPSB0aW1lb3V0U2VjcyAqIDEwMDAwMDBsbDsKLQotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBBTE9HSSgic2VydmVyIHNwZWNpZmllZCB0aW1lb3V0IG9mICVsdSBzZWNzLiIsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdGltZW91dFNlY3MpOwotICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgICAgICAgICAgICAgaSA9IG1TZXNzaW9uSUQuZmluZCgiOyIpOwotICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGkgPj0gMCkgewotICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vIFJlbW92ZSBvcHRpb25zLCBpLmUuICI7dGltZW91dD05MCIKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBtU2Vzc2lvbklELmVyYXNlKGksIG1TZXNzaW9uSUQuc2l6ZSgpIC0gaSk7Ci0gICAgICAgICAgICAgICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgICAgICAgICAgICAgIHNwPEFNZXNzYWdlPiBub3RpZnkgPSBuZXcgQU1lc3NhZ2UoJ2FjY3UnLCBpZCgpKTsKLSAgICAgICAgICAgICAgICAgICAgICAgIG5vdGlmeS0+c2V0U2l6ZSgidHJhY2staW5kZXgiLCB0cmFja0luZGV4KTsKLQotICAgICAgICAgICAgICAgICAgICAgICAgaSA9IHJlc3BvbnNlLT5tSGVhZGVycy5pbmRleE9mS2V5KCJ0cmFuc3BvcnQiKTsKLSAgICAgICAgICAgICAgICAgICAgICAgIENIRUNLX0dFKGksIDApOwotCi0gICAgICAgICAgICAgICAgICAgICAgICBpZiAoIXRyYWNrLT5tVXNpbmdJbnRlcmxlYXZlZFRDUCkgewotICAgICAgICAgICAgICAgICAgICAgICAgICAgIEFTdHJpbmcgdHJhbnNwb3J0ID0gcmVzcG9uc2UtPm1IZWFkZXJzLnZhbHVlQXQoaSk7Ci0KLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyBXZSBhcmUgZ29pbmcgdG8gY29udGludWUgZXZlbiBpZiB3ZSB3ZXJlCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gdW5hYmxlIHRvIHBva2UgYSBob2xlIGludG8gdGhlIGZpcmV3YWxsLi4uCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgcG9rZUFIb2xlKAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdHJhY2stPm1SVFBTb2NrZXQsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0cmFjay0+bVJUQ1BTb2NrZXQsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0cmFuc3BvcnQpOwotICAgICAgICAgICAgICAgICAgICAgICAgfQotCi0gICAgICAgICAgICAgICAgICAgICAgICBtUlRQQ29ubi0+YWRkU3RyZWFtKAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0cmFjay0+bVJUUFNvY2tldCwgdHJhY2stPm1SVENQU29ja2V0LAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBtU2Vzc2lvbkRlc2MsIGluZGV4LAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBub3RpZnksIHRyYWNrLT5tVXNpbmdJbnRlcmxlYXZlZFRDUCk7Ci0KLSAgICAgICAgICAgICAgICAgICAgICAgIG1TZXR1cFRyYWNrc1N1Y2Nlc3NmdWwgPSB0cnVlOwotICAgICAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgfQotCi0gICAgICAgICAgICAgICAgaWYgKHJlc3VsdCAhPSBPSykgewotICAgICAgICAgICAgICAgICAgICBpZiAodHJhY2spIHsKLSAgICAgICAgICAgICAgICAgICAgICAgIGlmICghdHJhY2stPm1Vc2luZ0ludGVybGVhdmVkVENQKSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gQ2xlYXIgdGhlIHRhZwotICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChtVUlEVmFsaWQpIHsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgSFRUUEJhc2U6OlVuUmVnaXN0ZXJTb2NrZXRVc2VyVGFnKHRyYWNrLT5tUlRQU29ja2V0KTsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgSFRUUEJhc2U6OlVuUmVnaXN0ZXJTb2NrZXRVc2VyVGFnKHRyYWNrLT5tUlRDUFNvY2tldCk7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgfQotCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgY2xvc2UodHJhY2stPm1SVFBTb2NrZXQpOwotICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNsb3NlKHRyYWNrLT5tUlRDUFNvY2tldCk7Ci0gICAgICAgICAgICAgICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgICAgICAgICAgICAgIG1UcmFja3MucmVtb3ZlSXRlbXNBdCh0cmFja0luZGV4KTsKLSAgICAgICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgICAgICsraW5kZXg7Ci0gICAgICAgICAgICAgICAgaWYgKGluZGV4IDwgbVNlc3Npb25EZXNjLT5jb3VudFRyYWNrcygpKSB7Ci0gICAgICAgICAgICAgICAgICAgIHNldHVwVHJhY2soaW5kZXgpOwotICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAobVNldHVwVHJhY2tzU3VjY2Vzc2Z1bCkgewotICAgICAgICAgICAgICAgICAgICArK21LZWVwQWxpdmVHZW5lcmF0aW9uOwotICAgICAgICAgICAgICAgICAgICBwb3N0S2VlcEFsaXZlKCk7Ci0KLSAgICAgICAgICAgICAgICAgICAgQVN0cmluZyByZXF1ZXN0ID0gIlBMQVkgIjsKLSAgICAgICAgICAgICAgICAgICAgcmVxdWVzdC5hcHBlbmQobVNlc3Npb25VUkwpOwotICAgICAgICAgICAgICAgICAgICByZXF1ZXN0LmFwcGVuZCgiIFJUU1AvMS4wXHJcbiIpOwotCi0gICAgICAgICAgICAgICAgICAgIHJlcXVlc3QuYXBwZW5kKCJTZXNzaW9uOiAiKTsKLSAgICAgICAgICAgICAgICAgICAgcmVxdWVzdC5hcHBlbmQobVNlc3Npb25JRCk7Ci0gICAgICAgICAgICAgICAgICAgIHJlcXVlc3QuYXBwZW5kKCJcclxuIik7Ci0KLSAgICAgICAgICAgICAgICAgICAgcmVxdWVzdC5hcHBlbmQoIlxyXG4iKTsKLQotICAgICAgICAgICAgICAgICAgICBzcDxBTWVzc2FnZT4gcmVwbHkgPSBuZXcgQU1lc3NhZ2UoJ3BsYXknLCBpZCgpKTsKLSAgICAgICAgICAgICAgICAgICAgbUNvbm4tPnNlbmRSZXF1ZXN0KHJlcXVlc3QuY19zdHIoKSwgcmVwbHkpOwotICAgICAgICAgICAgICAgIH0gZWxzZSB7Ci0gICAgICAgICAgICAgICAgICAgIHNwPEFNZXNzYWdlPiByZXBseSA9IG5ldyBBTWVzc2FnZSgnZGlzYycsIGlkKCkpOwotICAgICAgICAgICAgICAgICAgICBtQ29ubi0+ZGlzY29ubmVjdChyZXBseSk7Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgIGJyZWFrOwotICAgICAgICAgICAgfQotCi0gICAgICAgICAgICBjYXNlICdwbGF5JzoKLSAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICBpbnQzMl90IHJlc3VsdDsKLSAgICAgICAgICAgICAgICBDSEVDSyhtc2ctPmZpbmRJbnQzMigicmVzdWx0IiwgJnJlc3VsdCkpOwotCi0gICAgICAgICAgICAgICAgQUxPR0koIlBMQVkgY29tcGxldGVkIHdpdGggcmVzdWx0ICVkICglcykiLAotICAgICAgICAgICAgICAgICAgICAgcmVzdWx0LCBzdHJlcnJvcigtcmVzdWx0KSk7Ci0KLSAgICAgICAgICAgICAgICBpZiAocmVzdWx0ID09IE9LKSB7Ci0gICAgICAgICAgICAgICAgICAgIHNwPFJlZkJhc2U+IG9iajsKLSAgICAgICAgICAgICAgICAgICAgQ0hFQ0sobXNnLT5maW5kT2JqZWN0KCJyZXNwb25zZSIsICZvYmopKTsKLSAgICAgICAgICAgICAgICAgICAgc3A8QVJUU1BSZXNwb25zZT4gcmVzcG9uc2UgPQotICAgICAgICAgICAgICAgICAgICAgICAgc3RhdGljX2Nhc3Q8QVJUU1BSZXNwb25zZSAqPihvYmouZ2V0KCkpOwotCi0gICAgICAgICAgICAgICAgICAgIGlmIChyZXNwb25zZS0+bVN0YXR1c0NvZGUgIT0gMjAwKSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICByZXN1bHQgPSBVTktOT1dOX0VSUk9SOwotICAgICAgICAgICAgICAgICAgICB9IGVsc2UgewotICAgICAgICAgICAgICAgICAgICAgICAgcGFyc2VQbGF5UmVzcG9uc2UocmVzcG9uc2UpOwotCi0gICAgICAgICAgICAgICAgICAgICAgICBzcDxBTWVzc2FnZT4gdGltZW91dCA9IG5ldyBBTWVzc2FnZSgndGlvdScsIGlkKCkpOwotICAgICAgICAgICAgICAgICAgICAgICAgdGltZW91dC0+cG9zdChrU3RhcnR1cFRpbWVvdXRVcyk7Ci0gICAgICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgICAgICBpZiAocmVzdWx0ICE9IE9LKSB7Ci0gICAgICAgICAgICAgICAgICAgIHNwPEFNZXNzYWdlPiByZXBseSA9IG5ldyBBTWVzc2FnZSgnZGlzYycsIGlkKCkpOwotICAgICAgICAgICAgICAgICAgICBtQ29ubi0+ZGlzY29ubmVjdChyZXBseSk7Ci0gICAgICAgICAgICAgICAgfQotCi0gICAgICAgICAgICAgICAgYnJlYWs7Ci0gICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgIGNhc2UgJ2FsaXYnOgotICAgICAgICAgICAgewotICAgICAgICAgICAgICAgIGludDMyX3QgZ2VuZXJhdGlvbjsKLSAgICAgICAgICAgICAgICBDSEVDSyhtc2ctPmZpbmRJbnQzMigiZ2VuZXJhdGlvbiIsICZnZW5lcmF0aW9uKSk7Ci0KLSAgICAgICAgICAgICAgICBpZiAoZ2VuZXJhdGlvbiAhPSBtS2VlcEFsaXZlR2VuZXJhdGlvbikgewotICAgICAgICAgICAgICAgICAgICAvLyBvYnNvbGV0ZSBldmVudC4KLSAgICAgICAgICAgICAgICAgICAgYnJlYWs7Ci0gICAgICAgICAgICAgICAgfQotCi0gICAgICAgICAgICAgICAgQVN0cmluZyByZXF1ZXN0OwotICAgICAgICAgICAgICAgIHJlcXVlc3QuYXBwZW5kKCJPUFRJT05TICIpOwotICAgICAgICAgICAgICAgIHJlcXVlc3QuYXBwZW5kKG1TZXNzaW9uVVJMKTsKLSAgICAgICAgICAgICAgICByZXF1ZXN0LmFwcGVuZCgiIFJUU1AvMS4wXHJcbiIpOwotICAgICAgICAgICAgICAgIHJlcXVlc3QuYXBwZW5kKCJTZXNzaW9uOiAiKTsKLSAgICAgICAgICAgICAgICByZXF1ZXN0LmFwcGVuZChtU2Vzc2lvbklEKTsKLSAgICAgICAgICAgICAgICByZXF1ZXN0LmFwcGVuZCgiXHJcbiIpOwotICAgICAgICAgICAgICAgIHJlcXVlc3QuYXBwZW5kKCJcclxuIik7Ci0KLSAgICAgICAgICAgICAgICBzcDxBTWVzc2FnZT4gcmVwbHkgPSBuZXcgQU1lc3NhZ2UoJ29wdHMnLCBpZCgpKTsKLSAgICAgICAgICAgICAgICByZXBseS0+c2V0SW50MzIoImdlbmVyYXRpb24iLCBtS2VlcEFsaXZlR2VuZXJhdGlvbik7Ci0gICAgICAgICAgICAgICAgbUNvbm4tPnNlbmRSZXF1ZXN0KHJlcXVlc3QuY19zdHIoKSwgcmVwbHkpOwotICAgICAgICAgICAgICAgIGJyZWFrOwotICAgICAgICAgICAgfQotCi0gICAgICAgICAgICBjYXNlICdvcHRzJzoKLSAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICBpbnQzMl90IHJlc3VsdDsKLSAgICAgICAgICAgICAgICBDSEVDSyhtc2ctPmZpbmRJbnQzMigicmVzdWx0IiwgJnJlc3VsdCkpOwotCi0gICAgICAgICAgICAgICAgQUxPR0koIk9QVElPTlMgY29tcGxldGVkIHdpdGggcmVzdWx0ICVkICglcykiLAotICAgICAgICAgICAgICAgICAgICAgcmVzdWx0LCBzdHJlcnJvcigtcmVzdWx0KSk7Ci0KLSAgICAgICAgICAgICAgICBpbnQzMl90IGdlbmVyYXRpb247Ci0gICAgICAgICAgICAgICAgQ0hFQ0sobXNnLT5maW5kSW50MzIoImdlbmVyYXRpb24iLCAmZ2VuZXJhdGlvbikpOwotCi0gICAgICAgICAgICAgICAgaWYgKGdlbmVyYXRpb24gIT0gbUtlZXBBbGl2ZUdlbmVyYXRpb24pIHsKLSAgICAgICAgICAgICAgICAgICAgLy8gb2Jzb2xldGUgZXZlbnQuCi0gICAgICAgICAgICAgICAgICAgIGJyZWFrOwotICAgICAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgICAgIHBvc3RLZWVwQWxpdmUoKTsKLSAgICAgICAgICAgICAgICBicmVhazsKLSAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgY2FzZSAnYWJvcic6Ci0gICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgZm9yIChzaXplX3QgaSA9IDA7IGkgPCBtVHJhY2tzLnNpemUoKTsgKytpKSB7Ci0gICAgICAgICAgICAgICAgICAgIFRyYWNrSW5mbyAqaW5mbyA9ICZtVHJhY2tzLmVkaXRJdGVtQXQoaSk7Ci0KLSAgICAgICAgICAgICAgICAgICAgaWYgKCFtRmlyc3RBY2Nlc3NVbml0KSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICBwb3N0UXVldWVFT1MoaSwgRVJST1JfRU5EX09GX1NUUkVBTSk7Ci0gICAgICAgICAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgICAgICAgICBpZiAoIWluZm8tPm1Vc2luZ0ludGVybGVhdmVkVENQKSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICBtUlRQQ29ubi0+cmVtb3ZlU3RyZWFtKGluZm8tPm1SVFBTb2NrZXQsIGluZm8tPm1SVENQU29ja2V0KTsKLQotICAgICAgICAgICAgICAgICAgICAgICAgLy8gQ2xlYXIgdGhlIHRhZwotICAgICAgICAgICAgICAgICAgICAgICAgaWYgKG1VSURWYWxpZCkgewotICAgICAgICAgICAgICAgICAgICAgICAgICAgIEhUVFBCYXNlOjpVblJlZ2lzdGVyU29ja2V0VXNlclRhZyhpbmZvLT5tUlRQU29ja2V0KTsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBIVFRQQmFzZTo6VW5SZWdpc3RlclNvY2tldFVzZXJUYWcoaW5mby0+bVJUQ1BTb2NrZXQpOwotICAgICAgICAgICAgICAgICAgICAgICAgfQotCi0gICAgICAgICAgICAgICAgICAgICAgICBjbG9zZShpbmZvLT5tUlRQU29ja2V0KTsKLSAgICAgICAgICAgICAgICAgICAgICAgIGNsb3NlKGluZm8tPm1SVENQU29ja2V0KTsKLSAgICAgICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICBtVHJhY2tzLmNsZWFyKCk7Ci0gICAgICAgICAgICAgICAgbVNldHVwVHJhY2tzU3VjY2Vzc2Z1bCA9IGZhbHNlOwotICAgICAgICAgICAgICAgIG1TZWVrUGVuZGluZyA9IGZhbHNlOwotICAgICAgICAgICAgICAgIG1GaXJzdEFjY2Vzc1VuaXQgPSB0cnVlOwotICAgICAgICAgICAgICAgIG1BbGxUcmFja3NIYXZlVGltZSA9IGZhbHNlOwotICAgICAgICAgICAgICAgIG1OVFBBbmNob3JVcyA9IC0xOwotICAgICAgICAgICAgICAgIG1NZWRpYUFuY2hvclVzID0gLTE7Ci0gICAgICAgICAgICAgICAgbU51bUFjY2Vzc1VuaXRzUmVjZWl2ZWQgPSAwOwotICAgICAgICAgICAgICAgIG1SZWNlaXZlZEZpcnN0UlRDUFBhY2tldCA9IGZhbHNlOwotICAgICAgICAgICAgICAgIG1SZWNlaXZlZEZpcnN0UlRQUGFja2V0ID0gZmFsc2U7Ci0gICAgICAgICAgICAgICAgbVNlZWthYmxlID0gZmFsc2U7Ci0KLSAgICAgICAgICAgICAgICBzcDxBTWVzc2FnZT4gcmVwbHkgPSBuZXcgQU1lc3NhZ2UoJ3RlYXInLCBpZCgpKTsKLQotICAgICAgICAgICAgICAgIGludDMyX3QgcmVjb25uZWN0OwotICAgICAgICAgICAgICAgIGlmIChtc2ctPmZpbmRJbnQzMigicmVjb25uZWN0IiwgJnJlY29ubmVjdCkgJiYgcmVjb25uZWN0KSB7Ci0gICAgICAgICAgICAgICAgICAgIHJlcGx5LT5zZXRJbnQzMigicmVjb25uZWN0IiwgdHJ1ZSk7Ci0gICAgICAgICAgICAgICAgfQotCi0gICAgICAgICAgICAgICAgQVN0cmluZyByZXF1ZXN0OwotICAgICAgICAgICAgICAgIHJlcXVlc3QgPSAiVEVBUkRPV04gIjsKLQotICAgICAgICAgICAgICAgIC8vIFhYWCBzaG91bGQgdXNlIGFnZ3JlZ2F0ZSB1cmwgZnJvbSBTRFAgaGVyZS4uLgotICAgICAgICAgICAgICAgIHJlcXVlc3QuYXBwZW5kKG1TZXNzaW9uVVJMKTsKLSAgICAgICAgICAgICAgICByZXF1ZXN0LmFwcGVuZCgiIFJUU1AvMS4wXHJcbiIpOwotCi0gICAgICAgICAgICAgICAgcmVxdWVzdC5hcHBlbmQoIlNlc3Npb246ICIpOwotICAgICAgICAgICAgICAgIHJlcXVlc3QuYXBwZW5kKG1TZXNzaW9uSUQpOwotICAgICAgICAgICAgICAgIHJlcXVlc3QuYXBwZW5kKCJcclxuIik7Ci0KLSAgICAgICAgICAgICAgICByZXF1ZXN0LmFwcGVuZCgiXHJcbiIpOwotCi0gICAgICAgICAgICAgICAgbUNvbm4tPnNlbmRSZXF1ZXN0KHJlcXVlc3QuY19zdHIoKSwgcmVwbHkpOwotICAgICAgICAgICAgICAgIGJyZWFrOwotICAgICAgICAgICAgfQotCi0gICAgICAgICAgICBjYXNlICd0ZWFyJzoKLSAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICBpbnQzMl90IHJlc3VsdDsKLSAgICAgICAgICAgICAgICBDSEVDSyhtc2ctPmZpbmRJbnQzMigicmVzdWx0IiwgJnJlc3VsdCkpOwotCi0gICAgICAgICAgICAgICAgQUxPR0koIlRFQVJET1dOIGNvbXBsZXRlZCB3aXRoIHJlc3VsdCAlZCAoJXMpIiwKLSAgICAgICAgICAgICAgICAgICAgIHJlc3VsdCwgc3RyZXJyb3IoLXJlc3VsdCkpOwotCi0gICAgICAgICAgICAgICAgc3A8QU1lc3NhZ2U+IHJlcGx5ID0gbmV3IEFNZXNzYWdlKCdkaXNjJywgaWQoKSk7Ci0KLSAgICAgICAgICAgICAgICBpbnQzMl90IHJlY29ubmVjdDsKLSAgICAgICAgICAgICAgICBpZiAobXNnLT5maW5kSW50MzIoInJlY29ubmVjdCIsICZyZWNvbm5lY3QpICYmIHJlY29ubmVjdCkgewotICAgICAgICAgICAgICAgICAgICByZXBseS0+c2V0SW50MzIoInJlY29ubmVjdCIsIHRydWUpOwotICAgICAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgICAgIG1Db25uLT5kaXNjb25uZWN0KHJlcGx5KTsKLSAgICAgICAgICAgICAgICBicmVhazsKLSAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgY2FzZSAncXVpdCc6Ci0gICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgc3A8QU1lc3NhZ2U+IG1zZyA9IG1Ob3RpZnktPmR1cCgpOwotICAgICAgICAgICAgICAgIG1zZy0+c2V0SW50MzIoIndoYXQiLCBrV2hhdERpc2Nvbm5lY3RlZCk7Ci0gICAgICAgICAgICAgICAgbXNnLT5zZXRJbnQzMigicmVzdWx0IiwgVU5LTk9XTl9FUlJPUik7Ci0gICAgICAgICAgICAgICAgbXNnLT5wb3N0KCk7Ci0gICAgICAgICAgICAgICAgYnJlYWs7Ci0gICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgIGNhc2UgJ2NoZWsnOgotICAgICAgICAgICAgewotICAgICAgICAgICAgICAgIGludDMyX3QgZ2VuZXJhdGlvbjsKLSAgICAgICAgICAgICAgICBDSEVDSyhtc2ctPmZpbmRJbnQzMigiZ2VuZXJhdGlvbiIsICZnZW5lcmF0aW9uKSk7Ci0gICAgICAgICAgICAgICAgaWYgKGdlbmVyYXRpb24gIT0gbUNoZWNrR2VuZXJhdGlvbikgewotICAgICAgICAgICAgICAgICAgICAvLyBUaGlzIGlzIGFuIG91dGRhdGVkIG1lc3NhZ2UuIElnbm9yZS4KLSAgICAgICAgICAgICAgICAgICAgYnJlYWs7Ci0gICAgICAgICAgICAgICAgfQotCi0gICAgICAgICAgICAgICAgaWYgKG1OdW1BY2Nlc3NVbml0c1JlY2VpdmVkID09IDApIHsKLSNpZiAxCi0gICAgICAgICAgICAgICAgICAgIEFMT0dJKCJzdHJlYW0gZW5kZWQ/IGFib3J0aW5nLiIpOwotICAgICAgICAgICAgICAgICAgICAobmV3IEFNZXNzYWdlKCdhYm9yJywgaWQoKSkpLT5wb3N0KCk7Ci0gICAgICAgICAgICAgICAgICAgIGJyZWFrOwotI2Vsc2UKLSAgICAgICAgICAgICAgICAgICAgQUxPR0koImhhdmVuJ3Qgc2VlbiBhbiBBVSBpbiBhIGxvb29uZyB0aW1lLiIpOwotI2VuZGlmCi0gICAgICAgICAgICAgICAgfQotCi0gICAgICAgICAgICAgICAgbU51bUFjY2Vzc1VuaXRzUmVjZWl2ZWQgPSAwOwotICAgICAgICAgICAgICAgIG1zZy0+cG9zdChrQWNjZXNzVW5pdFRpbWVvdXRVcyk7Ci0gICAgICAgICAgICAgICAgYnJlYWs7Ci0gICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgIGNhc2UgJ2FjY3UnOgotICAgICAgICAgICAgewotICAgICAgICAgICAgICAgIGludDMyX3QgdGltZVVwZGF0ZTsKLSAgICAgICAgICAgICAgICBpZiAobXNnLT5maW5kSW50MzIoInRpbWUtdXBkYXRlIiwgJnRpbWVVcGRhdGUpICYmIHRpbWVVcGRhdGUpIHsKLSAgICAgICAgICAgICAgICAgICAgc2l6ZV90IHRyYWNrSW5kZXg7Ci0gICAgICAgICAgICAgICAgICAgIENIRUNLKG1zZy0+ZmluZFNpemUoInRyYWNrLWluZGV4IiwgJnRyYWNrSW5kZXgpKTsKLQotICAgICAgICAgICAgICAgICAgICB1aW50MzJfdCBydHBUaW1lOwotICAgICAgICAgICAgICAgICAgICB1aW50NjRfdCBudHBUaW1lOwotICAgICAgICAgICAgICAgICAgICBDSEVDSyhtc2ctPmZpbmRJbnQzMigicnRwLXRpbWUiLCAoaW50MzJfdCAqKSZydHBUaW1lKSk7Ci0gICAgICAgICAgICAgICAgICAgIENIRUNLKG1zZy0+ZmluZEludDY0KCJudHAtdGltZSIsIChpbnQ2NF90ICopJm50cFRpbWUpKTsKLQotICAgICAgICAgICAgICAgICAgICBvblRpbWVVcGRhdGUodHJhY2tJbmRleCwgcnRwVGltZSwgbnRwVGltZSk7Ci0gICAgICAgICAgICAgICAgICAgIGJyZWFrOwotICAgICAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgICAgIGludDMyX3QgZmlyc3Q7Ci0gICAgICAgICAgICAgICAgaWYgKG1zZy0+ZmluZEludDMyKCJmaXJzdC1ydGNwIiwgJmZpcnN0KSkgewotICAgICAgICAgICAgICAgICAgICBtUmVjZWl2ZWRGaXJzdFJUQ1BQYWNrZXQgPSB0cnVlOwotICAgICAgICAgICAgICAgICAgICBicmVhazsKLSAgICAgICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgICAgICBpZiAobXNnLT5maW5kSW50MzIoImZpcnN0LXJ0cCIsICZmaXJzdCkpIHsKLSAgICAgICAgICAgICAgICAgICAgbVJlY2VpdmVkRmlyc3RSVFBQYWNrZXQgPSB0cnVlOwotICAgICAgICAgICAgICAgICAgICBicmVhazsKLSAgICAgICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgICAgICArK21OdW1BY2Nlc3NVbml0c1JlY2VpdmVkOwotICAgICAgICAgICAgICAgIHBvc3RBY2Nlc3NVbml0VGltZW91dENoZWNrKCk7Ci0KLSAgICAgICAgICAgICAgICBzaXplX3QgdHJhY2tJbmRleDsKLSAgICAgICAgICAgICAgICBDSEVDSyhtc2ctPmZpbmRTaXplKCJ0cmFjay1pbmRleCIsICZ0cmFja0luZGV4KSk7Ci0KLSAgICAgICAgICAgICAgICBpZiAodHJhY2tJbmRleCA+PSBtVHJhY2tzLnNpemUoKSkgewotICAgICAgICAgICAgICAgICAgICBBTE9HVigibGF0ZSBwYWNrZXRzIGlnbm9yZWQuIik7Ci0gICAgICAgICAgICAgICAgICAgIGJyZWFrOwotICAgICAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgICAgIFRyYWNrSW5mbyAqdHJhY2sgPSAmbVRyYWNrcy5lZGl0SXRlbUF0KHRyYWNrSW5kZXgpOwotCi0gICAgICAgICAgICAgICAgaW50MzJfdCBlb3M7Ci0gICAgICAgICAgICAgICAgaWYgKG1zZy0+ZmluZEludDMyKCJlb3MiLCAmZW9zKSkgewotICAgICAgICAgICAgICAgICAgICBBTE9HSSgicmVjZWl2ZWQgQllFIG9uIHRyYWNrIGluZGV4ICVkIiwgdHJhY2tJbmRleCk7Ci0jaWYgMAotICAgICAgICAgICAgICAgICAgICB0cmFjay0+bVBhY2tldFNvdXJjZS0+c2lnbmFsRU9TKEVSUk9SX0VORF9PRl9TVFJFQU0pOwotI2VuZGlmCi0gICAgICAgICAgICAgICAgICAgIHJldHVybjsKLSAgICAgICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgICAgICBzcDxBQnVmZmVyPiBhY2Nlc3NVbml0OwotICAgICAgICAgICAgICAgIENIRUNLKG1zZy0+ZmluZEJ1ZmZlcigiYWNjZXNzLXVuaXQiLCAmYWNjZXNzVW5pdCkpOwotCi0gICAgICAgICAgICAgICAgdWludDMyX3Qgc2VxTnVtID0gKHVpbnQzMl90KWFjY2Vzc1VuaXQtPmludDMyRGF0YSgpOwotCi0gICAgICAgICAgICAgICAgaWYgKG1TZWVrUGVuZGluZykgewotICAgICAgICAgICAgICAgICAgICBBTE9HVigid2UncmUgc2Vla2luZywgZHJvcHBpbmcgc3RhbGUgcGFja2V0LiIpOwotICAgICAgICAgICAgICAgICAgICBicmVhazsKLSAgICAgICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgICAgICBpZiAoc2VxTnVtIDwgdHJhY2stPm1GaXJzdFNlcU51bUluU2VnbWVudCkgewotICAgICAgICAgICAgICAgICAgICBBTE9HVigiZHJvcHBpbmcgc3RhbGUgYWNjZXNzLXVuaXQgKCVkIDwgJWQpIiwKLSAgICAgICAgICAgICAgICAgICAgICAgICBzZXFOdW0sIHRyYWNrLT5tRmlyc3RTZXFOdW1JblNlZ21lbnQpOwotICAgICAgICAgICAgICAgICAgICBicmVhazsKLSAgICAgICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgICAgICBpZiAodHJhY2stPm1OZXdTZWdtZW50KSB7Ci0gICAgICAgICAgICAgICAgICAgIHRyYWNrLT5tTmV3U2VnbWVudCA9IGZhbHNlOwotICAgICAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgICAgIG9uQWNjZXNzVW5pdENvbXBsZXRlKHRyYWNrSW5kZXgsIGFjY2Vzc1VuaXQpOwotICAgICAgICAgICAgICAgIGJyZWFrOwotICAgICAgICAgICAgfQotCi0gICAgICAgICAgICBjYXNlICdzZWVrJzoKLSAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICBpZiAoIW1TZWVrYWJsZSkgewotICAgICAgICAgICAgICAgICAgICBBTE9HVygiVGhpcyBpcyBhIGxpdmUgc3RyZWFtLCBpZ25vcmluZyBzZWVrIHJlcXVlc3QuIik7Ci0KLSAgICAgICAgICAgICAgICAgICAgc3A8QU1lc3NhZ2U+IG1zZyA9IG1Ob3RpZnktPmR1cCgpOwotICAgICAgICAgICAgICAgICAgICBtc2ctPnNldEludDMyKCJ3aGF0Iiwga1doYXRTZWVrRG9uZSk7Ci0gICAgICAgICAgICAgICAgICAgIG1zZy0+cG9zdCgpOwotICAgICAgICAgICAgICAgICAgICBicmVhazsKLSAgICAgICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgICAgICBpbnQ2NF90IHRpbWVVczsKLSAgICAgICAgICAgICAgICBDSEVDSyhtc2ctPmZpbmRJbnQ2NCgidGltZSIsICZ0aW1lVXMpKTsKLQotICAgICAgICAgICAgICAgIG1TZWVrUGVuZGluZyA9IHRydWU7Ci0KLSAgICAgICAgICAgICAgICAvLyBEaXNhYmxlIHRoZSBhY2Nlc3MgdW5pdCB0aW1lb3V0IHVudGlsIHdlIHJlc3VtZWQKLSAgICAgICAgICAgICAgICAvLyBwbGF5YmFjayBhZ2Fpbi4KLSAgICAgICAgICAgICAgICBtQ2hlY2tQZW5kaW5nID0gdHJ1ZTsKLSAgICAgICAgICAgICAgICArK21DaGVja0dlbmVyYXRpb247Ci0KLSAgICAgICAgICAgICAgICBBU3RyaW5nIHJlcXVlc3QgPSAiUEFVU0UgIjsKLSAgICAgICAgICAgICAgICByZXF1ZXN0LmFwcGVuZChtU2Vzc2lvblVSTCk7Ci0gICAgICAgICAgICAgICAgcmVxdWVzdC5hcHBlbmQoIiBSVFNQLzEuMFxyXG4iKTsKLQotICAgICAgICAgICAgICAgIHJlcXVlc3QuYXBwZW5kKCJTZXNzaW9uOiAiKTsKLSAgICAgICAgICAgICAgICByZXF1ZXN0LmFwcGVuZChtU2Vzc2lvbklEKTsKLSAgICAgICAgICAgICAgICByZXF1ZXN0LmFwcGVuZCgiXHJcbiIpOwotCi0gICAgICAgICAgICAgICAgcmVxdWVzdC5hcHBlbmQoIlxyXG4iKTsKLQotICAgICAgICAgICAgICAgIHNwPEFNZXNzYWdlPiByZXBseSA9IG5ldyBBTWVzc2FnZSgnc2VlMScsIGlkKCkpOwotICAgICAgICAgICAgICAgIHJlcGx5LT5zZXRJbnQ2NCgidGltZSIsIHRpbWVVcyk7Ci0gICAgICAgICAgICAgICAgbUNvbm4tPnNlbmRSZXF1ZXN0KHJlcXVlc3QuY19zdHIoKSwgcmVwbHkpOwotICAgICAgICAgICAgICAgIGJyZWFrOwotICAgICAgICAgICAgfQotCi0gICAgICAgICAgICBjYXNlICdzZWUxJzoKLSAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAvLyBTZXNzaW9uIGlzIHBhdXNlZCBub3cuCi0gICAgICAgICAgICAgICAgZm9yIChzaXplX3QgaSA9IDA7IGkgPCBtVHJhY2tzLnNpemUoKTsgKytpKSB7Ci0gICAgICAgICAgICAgICAgICAgIFRyYWNrSW5mbyAqaW5mbyA9ICZtVHJhY2tzLmVkaXRJdGVtQXQoaSk7Ci0KLSAgICAgICAgICAgICAgICAgICAgcG9zdFF1ZXVlU2Vla0Rpc2NvbnRpbnVpdHkoaSk7Ci0KLSAgICAgICAgICAgICAgICAgICAgaW5mby0+bVJUUEFuY2hvciA9IDA7Ci0gICAgICAgICAgICAgICAgICAgIGluZm8tPm1OVFBBbmNob3JVcyA9IC0xOwotICAgICAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgICAgIG1BbGxUcmFja3NIYXZlVGltZSA9IGZhbHNlOwotICAgICAgICAgICAgICAgIG1OVFBBbmNob3JVcyA9IC0xOwotCi0gICAgICAgICAgICAgICAgaW50NjRfdCB0aW1lVXM7Ci0gICAgICAgICAgICAgICAgQ0hFQ0sobXNnLT5maW5kSW50NjQoInRpbWUiLCAmdGltZVVzKSk7Ci0KLSAgICAgICAgICAgICAgICBBU3RyaW5nIHJlcXVlc3QgPSAiUExBWSAiOwotICAgICAgICAgICAgICAgIHJlcXVlc3QuYXBwZW5kKG1TZXNzaW9uVVJMKTsKLSAgICAgICAgICAgICAgICByZXF1ZXN0LmFwcGVuZCgiIFJUU1AvMS4wXHJcbiIpOwotCi0gICAgICAgICAgICAgICAgcmVxdWVzdC5hcHBlbmQoIlNlc3Npb246ICIpOwotICAgICAgICAgICAgICAgIHJlcXVlc3QuYXBwZW5kKG1TZXNzaW9uSUQpOwotICAgICAgICAgICAgICAgIHJlcXVlc3QuYXBwZW5kKCJcclxuIik7Ci0KLSAgICAgICAgICAgICAgICByZXF1ZXN0LmFwcGVuZCgKLSAgICAgICAgICAgICAgICAgICAgICAgIFN0cmluZ1ByaW50ZigKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAiUmFuZ2U6IG5wdD0lbGxkLVxyXG4iLCB0aW1lVXMgLyAxMDAwMDAwbGwpKTsKLQotICAgICAgICAgICAgICAgIHJlcXVlc3QuYXBwZW5kKCJcclxuIik7Ci0KLSAgICAgICAgICAgICAgICBzcDxBTWVzc2FnZT4gcmVwbHkgPSBuZXcgQU1lc3NhZ2UoJ3NlZTInLCBpZCgpKTsKLSAgICAgICAgICAgICAgICBtQ29ubi0+c2VuZFJlcXVlc3QocmVxdWVzdC5jX3N0cigpLCByZXBseSk7Ci0gICAgICAgICAgICAgICAgYnJlYWs7Ci0gICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgIGNhc2UgJ3NlZTInOgotICAgICAgICAgICAgewotICAgICAgICAgICAgICAgIENIRUNLKG1TZWVrUGVuZGluZyk7Ci0KLSAgICAgICAgICAgICAgICBpbnQzMl90IHJlc3VsdDsKLSAgICAgICAgICAgICAgICBDSEVDSyhtc2ctPmZpbmRJbnQzMigicmVzdWx0IiwgJnJlc3VsdCkpOwotCi0gICAgICAgICAgICAgICAgQUxPR0koIlBMQVkgY29tcGxldGVkIHdpdGggcmVzdWx0ICVkICglcykiLAotICAgICAgICAgICAgICAgICAgICAgcmVzdWx0LCBzdHJlcnJvcigtcmVzdWx0KSk7Ci0KLSAgICAgICAgICAgICAgICBtQ2hlY2tQZW5kaW5nID0gZmFsc2U7Ci0gICAgICAgICAgICAgICAgcG9zdEFjY2Vzc1VuaXRUaW1lb3V0Q2hlY2soKTsKLQotICAgICAgICAgICAgICAgIGlmIChyZXN1bHQgPT0gT0spIHsKLSAgICAgICAgICAgICAgICAgICAgc3A8UmVmQmFzZT4gb2JqOwotICAgICAgICAgICAgICAgICAgICBDSEVDSyhtc2ctPmZpbmRPYmplY3QoInJlc3BvbnNlIiwgJm9iaikpOwotICAgICAgICAgICAgICAgICAgICBzcDxBUlRTUFJlc3BvbnNlPiByZXNwb25zZSA9Ci0gICAgICAgICAgICAgICAgICAgICAgICBzdGF0aWNfY2FzdDxBUlRTUFJlc3BvbnNlICo+KG9iai5nZXQoKSk7Ci0KLSAgICAgICAgICAgICAgICAgICAgaWYgKHJlc3BvbnNlLT5tU3RhdHVzQ29kZSAhPSAyMDApIHsKLSAgICAgICAgICAgICAgICAgICAgICAgIHJlc3VsdCA9IFVOS05PV05fRVJST1I7Ci0gICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICBwYXJzZVBsYXlSZXNwb25zZShyZXNwb25zZSk7Ci0KLSAgICAgICAgICAgICAgICAgICAgICAgIHNzaXplX3QgaSA9IHJlc3BvbnNlLT5tSGVhZGVycy5pbmRleE9mS2V5KCJydHAtaW5mbyIpOwotICAgICAgICAgICAgICAgICAgICAgICAgQ0hFQ0tfR0UoaSwgMCk7Ci0KLSAgICAgICAgICAgICAgICAgICAgICAgIEFMT0dWKCJydHAtaW5mbzogJXMiLCByZXNwb25zZS0+bUhlYWRlcnMudmFsdWVBdChpKS5jX3N0cigpKTsKLQotICAgICAgICAgICAgICAgICAgICAgICAgQUxPR0koInNlZWsgY29tcGxldGVkLiIpOwotICAgICAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgfQotCi0gICAgICAgICAgICAgICAgaWYgKHJlc3VsdCAhPSBPSykgewotICAgICAgICAgICAgICAgICAgICBBTE9HRSgic2VlayBmYWlsZWQsIGFib3J0aW5nLiIpOwotICAgICAgICAgICAgICAgICAgICAobmV3IEFNZXNzYWdlKCdhYm9yJywgaWQoKSkpLT5wb3N0KCk7Ci0gICAgICAgICAgICAgICAgfQotCi0gICAgICAgICAgICAgICAgbVNlZWtQZW5kaW5nID0gZmFsc2U7Ci0KLSAgICAgICAgICAgICAgICBzcDxBTWVzc2FnZT4gbXNnID0gbU5vdGlmeS0+ZHVwKCk7Ci0gICAgICAgICAgICAgICAgbXNnLT5zZXRJbnQzMigid2hhdCIsIGtXaGF0U2Vla0RvbmUpOwotICAgICAgICAgICAgICAgIG1zZy0+cG9zdCgpOwotICAgICAgICAgICAgICAgIGJyZWFrOwotICAgICAgICAgICAgfQotCi0gICAgICAgICAgICBjYXNlICdiaW55JzoKLSAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICBzcDxBQnVmZmVyPiBidWZmZXI7Ci0gICAgICAgICAgICAgICAgQ0hFQ0sobXNnLT5maW5kQnVmZmVyKCJidWZmZXIiLCAmYnVmZmVyKSk7Ci0KLSAgICAgICAgICAgICAgICBpbnQzMl90IGluZGV4OwotICAgICAgICAgICAgICAgIENIRUNLKGJ1ZmZlci0+bWV0YSgpLT5maW5kSW50MzIoImluZGV4IiwgJmluZGV4KSk7Ci0KLSAgICAgICAgICAgICAgICBtUlRQQ29ubi0+aW5qZWN0UGFja2V0KGluZGV4LCBidWZmZXIpOwotICAgICAgICAgICAgICAgIGJyZWFrOwotICAgICAgICAgICAgfQotCi0gICAgICAgICAgICBjYXNlICd0aW91JzoKLSAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICBpZiAoIW1SZWNlaXZlZEZpcnN0UlRDUFBhY2tldCkgewotICAgICAgICAgICAgICAgICAgICBpZiAobVJlY2VpdmVkRmlyc3RSVFBQYWNrZXQgJiYgIW1UcnlGYWtlUlRDUCkgewotICAgICAgICAgICAgICAgICAgICAgICAgQUxPR1coIldlIHJlY2VpdmVkIFJUUCBwYWNrZXRzIGJ1dCBubyBSVENQIHBhY2tldHMsICIKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgInVzaW5nIGZha2UgdGltZXN0YW1wcy4iKTsKLQotICAgICAgICAgICAgICAgICAgICAgICAgbVRyeUZha2VSVENQID0gdHJ1ZTsKLQotICAgICAgICAgICAgICAgICAgICAgICAgbVJlY2VpdmVkRmlyc3RSVENQUGFja2V0ID0gdHJ1ZTsKLQotICAgICAgICAgICAgICAgICAgICAgICAgZmFrZVRpbWVzdGFtcHMoKTsKLSAgICAgICAgICAgICAgICAgICAgfSBlbHNlIGlmICghbVJlY2VpdmVkRmlyc3RSVFBQYWNrZXQgJiYgIW1UcnlUQ1BJbnRlcmxlYXZpbmcpIHsKLSAgICAgICAgICAgICAgICAgICAgICAgIEFMT0dXKCJOZXZlciByZWNlaXZlZCBhbnkgZGF0YSwgc3dpdGNoaW5nIHRyYW5zcG9ydHMuIik7Ci0KLSAgICAgICAgICAgICAgICAgICAgICAgIG1UcnlUQ1BJbnRlcmxlYXZpbmcgPSB0cnVlOwotCi0gICAgICAgICAgICAgICAgICAgICAgICBzcDxBTWVzc2FnZT4gbXNnID0gbmV3IEFNZXNzYWdlKCdhYm9yJywgaWQoKSk7Ci0gICAgICAgICAgICAgICAgICAgICAgICBtc2ctPnNldEludDMyKCJyZWNvbm5lY3QiLCB0cnVlKTsKLSAgICAgICAgICAgICAgICAgICAgICAgIG1zZy0+cG9zdCgpOwotICAgICAgICAgICAgICAgICAgICB9IGVsc2UgewotICAgICAgICAgICAgICAgICAgICAgICAgQUxPR1coIk5ldmVyIHJlY2VpdmVkIGFueSBkYXRhLCBkaXNjb25uZWN0aW5nLiIpOwotICAgICAgICAgICAgICAgICAgICAgICAgKG5ldyBBTWVzc2FnZSgnYWJvcicsIGlkKCkpKS0+cG9zdCgpOwotICAgICAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgfSBlbHNlIHsKLSAgICAgICAgICAgICAgICAgICAgaWYgKCFtQWxsVHJhY2tzSGF2ZVRpbWUpIHsKLSAgICAgICAgICAgICAgICAgICAgICAgIEFMT0dXKCJXZSByZWNlaXZlZCBzb21lIFJUQ1AgcGFja2V0cywgYnV0IHRpbWUgIgotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgImNvdWxkIG5vdCBiZSBlc3RhYmxpc2hlZCBvbiBhbGwgdHJhY2tzLCBub3cgIgotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgInVzaW5nIGZha2UgdGltZXN0YW1wcyIpOwotCi0gICAgICAgICAgICAgICAgICAgICAgICBmYWtlVGltZXN0YW1wcygpOwotICAgICAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgIGJyZWFrOwotICAgICAgICAgICAgfQotCi0gICAgICAgICAgICBkZWZhdWx0OgotICAgICAgICAgICAgICAgIFRSRVNQQVNTKCk7Ci0gICAgICAgICAgICAgICAgYnJlYWs7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lTlRQUmFuZ2UodmFsLmNfc3RyKCksICZucHQxLCAmbnB0MikpIHsKLSAgICAgICAgICAgIC8vIFRoaXMgaXMgYSBsaXZlIHN0cmVhbSBhbmQgdGhlcmVmb3JlIG5vdCBzZWVrYWJsZS4KLQotICAgICAgICAgICAgQUxPR0koIlRoaXMgaXMgYSBsaXZlIHN0cmVhbSIpOwotICAgICAgICAgICAgcmV0dXJuOwotICAgICAgICB9Ci0KLSAgICAgICAgaSA9IHJlc3BvbnNlLT5tSGVhZGVycy5pbmRleE9mS2V5KCJydHAtaW5mbyIpOwotICAgICAgICBDSEVDS19HRShpLCAwKTsKLQotICAgICAgICBBU3RyaW5nIHJ0cEluZm8gPSByZXNwb25zZS0+bUhlYWRlcnMudmFsdWVBdChpKTsKLSAgICAgICAgTGlzdDxBU3RyaW5nPiBzdHJlYW1JbmZvczsKLSAgICAgICAgU3BsaXRTdHJpbmcocnRwSW5mbywgIiwiLCAmc3RyZWFtSW5mb3MpOwotCi0gICAgICAgIGludCBuID0gMTsKLSAgICAgICAgZm9yIChMaXN0PEFTdHJpbmc+OjppdGVyYXRvciBpdCA9IHN0cmVhbUluZm9zLmJlZ2luKCk7Ci0gICAgICAgICAgICAgaXQgIT0gc3RyZWFtSW5mb3MuZW5kKCk7ICsraXQpIHsKLSAgICAgICAgICAgICgqaXQpLnRyaW0oKTsKLSAgICAgICAgICAgIEFMT0dWKCJzdHJlYW1JbmZvWyVkXSA9ICVzIiwgbiwgKCppdCkuY19zdHIoKSk7Ci0KLSAgICAgICAgICAgIENIRUNLKEdldEF0dHJpYnV0ZSgoKml0KS5jX3N0cigpLCAidXJsIiwgJnZhbCkpOwotCi0gICAgICAgICAgICBzaXplX3QgdHJhY2tJbmRleCA9IDA7Ci0gICAgICAgICAgICB3aGlsZSAodHJhY2tJbmRleCA8IG1UcmFja3Muc2l6ZSgpCi0gICAgICAgICAgICAgICAgICAgICYmICEodmFsID09IG1UcmFja3MuZWRpdEl0ZW1BdCh0cmFja0luZG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otICAgICAgICAgICAgcmVxdWVzdC5hcHBlbmQoaW50ZXJsZWF2ZUluZGV4ICsgMSk7Ci0gICAgICAgIH0gZWxzZSB7Ci0gICAgICAgICAgICB1bnNpZ25lZCBydHBQb3J0OwotICAgICAgICAgICAgQVJUUENvbm5lY3Rpb246Ok1ha2VQb3J0UGFpcigKLSAgICAgICAgICAgICAgICAgICAgJmluZm8tPm1SVFBTb2NrZXQsICZpbmZvLT5tUlRDUFNvY2tldCwgJnJ0cFBvcnQpOwotCi0gICAgICAgICAgICBpZiAobVVJRFZhbGlkKSB7Ci0gICAgICAgICAgICAgICAgSFRUUEJhc2U6OlJlZ2lzdGVyU29ja2V0VXNlclRhZyhpbmZvLT5tUlRQU29ja2V0LCBtVUlELAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKHVpbnQzMl90KSoodWludDMyX3QqKSAiUlRQXyIpOwotICAgICAgICAgICAgICAgIEhUVFBCYXNlOjpSZWdpc3RlclNvY2tldFVzZXJUYWcoaW5mby0+bVJUQ1BTb2NrZXQsIG1VSUQsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAodWludDMyX3QpKih1aW50MzJfdCopICJSVFBfIik7Ci0gICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgIHJlcXVlc3QuYXBwZW5kKCJUcmFuc3BvcnQ6IFJUUC9BVlAvVURQO3VuaWNhc3Q7Y2xpZW50X3BvcnQ9Iik7Ci0gICAgICAgICAgICByZXF1ZXN0LmFwcGVuZChydHBQb3J0KTsKLSAgICAgICAgICAgIHJlcXVlc3QuYXBwZW5kKCItIik7Ci0gICAgICAgICAgICByZXF1ZXN0LmFwcGVuZChydHBQb3J0ICsgMSk7Ci0gICAgICAgIH0KLQotICAgICAgICByZXF1ZXN0LmFwcGVuZCgiXHJcbiIpOwotCi0gICAgICAgIGlmIChpbmRleCA+IDEpIHsKLSAgICAgICAgICAgIHJlcXVlc3QuYXBw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NjRfdCBudHBUaW1lVXMgPSAoaW50NjRfdCkobnRwVGltZSAqIDFFNiAvICgxbGwgPDwgMzIpKTsKLQotICAgICAgICBUcmFja0luZm8gKnRyYWNrID0gJm1UcmFja3MuZWRpdEl0ZW1BdCh0cmFja0luZGV4KTsKLQotICAgICAgICB0cmFjay0+bVJUUEFuY2hvciA9IHJ0cFRpbWU7Ci0gICAgICAgIHRyYWNrLT5tTlRQQW5jaG9yVXMgPSBudHBUaW1lVXM7Ci0KLSAgICAgICAgaWYgKG1OVFBBbmNob3JVcyA8IDApIHsKLSAgICAgICAgICAgIG1OVFBBbmNob3JVcyA9IG50cFRpbWVVczsKLSAgICAgICAgICAgIG1NZWRpYUFuY2hvclVzID0gbUxhc3RNZWRpYVRpbWVVczsKLSAgICAgICAgfQotCi0gICAgICAgIGlmICghbUFsbFRyYWNrc0hhdmVUaW1lKSB7Ci0gICAgICAgICAgICBib29sIGFsbFRyYWNrc0hhdmVUaW1lID0gdHJ1ZTsKLSAgICAgICAgICAgIGZvciAoc2l6ZV90IGkgPSAwOyBpIDwgbVRyYWNrcy5zaXplKCk7ICsraSkgewotICAgICAgICAgICAgICAgIFRyYWNrSW5mbyAqdHJhY2sgPSAmbVRyYWNrcy5lZGl0SXRlbUF0KGkpOwotICAgICAgICAgICAgICAgIGlmICh0cmFjay0+bU5UUEFuY2hvclVzIDwgMCkgewotICAgICAgICAgICAgICAgICAgICBhbGxUcmFja3NIYXZlVGltZSA9IGZhbHNlOwotICAgICAgICAgICAgICAgICAgICBicmVhazsKLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICB9Ci0gICAgICAgICAgICBpZiAoYWxsVHJhY2tzSGF2ZVRpbWUpIHsKLSAgICAgICAgICAgICAgICBtQWxsVHJhY2tzSGF2ZVRpbWUgPSB0cnVlOwotICAgICAgICAgICAgICAgIEFMT0dJKCJUaW1lIG5vdyBlc3RhYmxpc2hlZCBmb3IgYWxsIHRyYWNrcy4iKTsKLSAgICAgICAgICAgIH0KLSAgICAgICAgfQotICAgIH0KLQotICAgIHZvaWQgb25BY2Nlc3NVbml0Q29tcGxldGUoCi0gICAgICAgICAgICBpbnQzMl90IHRyYWNrSW5kZXgsIGNvbnN0IHNwPEFCdWZmZXI+ICZhY2Nlc3NVbml0KSB7Ci0gICAgICAgIEFMT0dWKCJvbkFjY2Vzc1VuaXRDb21wbGV0ZSB0cmFjayAlZCIsIHRyYWNrSW5kZXgpOwotCi0gICAgICAgIGlmIChtRmlyc3RBY2Nlc3NVbml0KSB7Ci0gICAgICAgICAgICBzcDxBTWVzc2FnZT4gbXNnID0gbU5vdGlmeS0+ZHVwKCk7Ci0gICAgICAgICAgICBtc2ctPnNldEludDMyKCJ3aGF0Iiwga1doYXRDb25uZWN0ZWQpOwotICAgICAgICAgICAgbXNnLT5wb3N0KCk7Ci0KLSAgICAgICAgICAgIGlmIChtU2Vla2FibGUpIHsKLSAgICAgICAgICAgICAgICBmb3IgKHNpemVfdCBpID0gMDsgaSA8IG1UcmFja3Muc2l6ZSgpOyArK2kpIHsKLSAgICAgICAgICAgICAgICAgICAgVHJhY2tJbmZvICppbmZvID0gJm1UcmFja3MuZWRpdEl0ZW1BdChpKTsKLQotICAgICAgICAgICAgICAgICAgICBwb3N0Tm9ybWFsUGxheVRpbWVNYXBwaW5nKAotICAgICAgICAgICAgICAgICAgICAgICAgICAgIGksCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgaW5mby0+bU5vcm1hbFBsYXlUaW1lUlRQLCBpbmZvLT5tTm9ybWFsUGxheVRpbWVVcyk7Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgfQotCi0gICAgICAgICAgICBtRmlyc3RBY2Nlc3NVbml0ID0gZmFsc2U7Ci0gICAgICAgIH0KLQotICAgICAgICBUcmFja0luZm8gKnRyYWNrID0gJm1UcmFja3MuZWRpdEl0ZW1BdCh0cmFja0luZGV4KTsKLQotICAgICAgICBpZiAoIW1BbGxUcmFja3NIYXZlVGltZSkgewotICAgICA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ICAgICAgICAgICAgICAgICAicnRwLXRpbWUiLCAoaW50MzJfdCAqKSZydHBUaW1lKSk7Ci0KLSAgICAgICAgaW50NjRfdCByZWxSdHBUaW1lVXMgPQotICAgICAgICAgICAgKCgoaW50NjRfdClydHBUaW1lIC0gKGludDY0X3QpdHJhY2stPm1SVFBBbmNob3IpICogMTAwMDAwMGxsKQotICAgICAgICAgICAgICAgIC8gdHJhY2stPm1UaW1lU2NhbGU7Ci0KLSAgICAgICAgaW50NjRfdCBudHBUaW1lVXMgPSB0cmFjay0+bU5UUEFuY2hvclVzICsgcmVsUnRwVGltZVVzOwotCi0gICAgICAgIGludDY0X3QgbWVkaWFUaW1lVXMgPSBtTWVkaWFBbmNob3JVcyArIG50cFRpbWVVcyAtIG1OVFBBbmNob3JVczsKLQotICAgICAgICBpZiAobWVkaWFUaW1lVXMgPiBtTGFzdE1lZGlhVGltZVVzKSB7Ci0gICAgICAgICAgICBtTGFzdE1lZGlhVGltZVVzID0gbWVkaWFUaW1lVXM7Ci0gICAgICAgIH0KLQotICAgICAgICBpZiAobWVkaWFUaW1lVXMgPCAwKSB7Ci0gICAgICAgICAgICBBTE9HVigiZHJvcHBpbmcgZWFybHkgYWNjZXNzVW5pdC4iKTsKLSAgICAgICAgICAgIHJldHVybiBmYWxzZTsKLSAgICAgICAgfQotCi0gICAgICAgIEFMT0dWKCJ0cmFjayAlZCBydHBUaW1lPSVkIG1lZGlhVGltZVVzID0gJWxsZCB1cyAoJS4yZiBzZWNzKSIsCi0gICAgICAgICAgICAgdHJhY2tJbmRleCwgcnRwVGltZSwgbWVkaWFUaW1lVXMsIG1lZGlhVGltZVVzIC8gMUU2KTsKLQotICAgICAgICBhY2Nlc3NVbml0LT5tZXRhKCktPnNldEludDY0KCJ0aW1lVXMiLCBtZWRpYVRpbWVVcyk7Ci0KLSAgICAgICAgcmV0dXJuIHRydWU7Ci0gICAgfQotCi0gICAgdm9pZCBwb3N0UXVldWVBY2Nlc3NVbml0KAotICAgICAgICAg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zZXRUbygmc1trZXlMZW4gKyAxXSwgbGVuIC0ga2V5TGVuIC0gMSk7Ci0gICAgICAgICAgICByZXR1cm4gdHJ1ZTsKLSAgICAgICAgfQotCi0gICAgICAgIGlmIChjb2xvblBvcyA9PSBOVUxMKSB7Ci0gICAgICAgICAgICByZXR1cm4gZmFsc2U7Ci0gICAgICAgIH0KLQotICAgICAgICBzID0gY29sb25Qb3MgKyAxOwotICAgIH0KLX0KLQotc3RydWN0IE15VHJhbnNtaXR0ZXIgOiBwdWJsaWMgQUhhbmRsZXIgewotICAgIE15VHJhbnNtaXR0ZXIoY29uc3QgY2hhciAqdXJsLCBjb25zdCBzcDxBTG9vcGVyPiAmbG9vcGVyKQotICAgICAgICA6IG1TZXJ2ZXJVUkwodXJsKSwKLSAgICAgICAgICBtTG9vcGVyKGxvb3BlciksCi0gICAgICAgICAgbUNvbm4obmV3IEFSVFNQQ29ubmVjdGlvbiksCi0gICAgICAgICAgbUNvbm5lY3RlZChmYWxzZSksCi0gICAgICAgICAgbUF1dGhUeXBlKE5PTkUpLAotICAgICAgICAgIG1SVFBTb2NrZXQoLTEpLAotICAgICAgICAgIG1SVENQU29ja2V0KC0xKSwKLSAgICAgICAgICBtU291cmNlSUQocmFuZCgpKSwKLSAgICAgICAgICBtU2VxTm8odW5pZm9ybVJhbmQoNjU1MzYpKSwKLSAgICAgICAgICBtUlRQVGltZUJhc2UocmFuZCgpKSwKLSAgICAgICAgICBtTnVtU2FtcGxlc1NlbnQoMCksCi0gICAgICAgICAgbU51bVJUUFNlbnQoMCksCi0gICAgICAgICAgbU51bVJUUE9jdGV0c1NlbnQoMCksCi0gICAgICAgICAgbUxhc3RSVFBUaW1lKDApLAotICAgICAgICAgIG1MYXN0TlRQVGltZSgwKSB7Ci0gICAgICAgIG1TdHJlYW1VUkwgPSBtU2VydmVyVVJMOwotICAgICAgICBtU3RyZWFtVVJMLmFwcGVuZCgiL2Jhem9uZy5zZHAiKTsKLQotICAgICAgICBtVHJhY2tVUk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cCk7Ci0gICAgICAgIHNkcC5hcHBlbmQoIiAiKTsKLSAgICAgICAgc2RwLmFwcGVuZChudHApOwotICAgICAgICBzZHAuYXBwZW5kKCIgSU4gSVA0IDEyNy4wLjAuMFxyXG4iKTsKLQotICAgICAgICBzZHAuYXBwZW5kKAotICAgICAgICAgICAgICAicz1TYW1wbGVcclxuIgotICAgICAgICAgICAgICAiaT1QbGF5aW5nIGFyb3VuZCB3aXRoIEFOTk9VTkNFXHJcbiIKLSAgICAgICAgICAgICAgImM9SU4gSVA0ICIpOwotCi0gICAgICAgIHN0cnVjdCBpbl9hZGRyIGFkZHI7Ci0gICAgICAgIGFkZHIuc19hZGRyID0gaHRvbmwobVNlcnZlcklQKTsKLQotICAgICAgICBzZHAuYXBwZW5kKGluZXRfbnRvYShhZGRyKSk7Ci0KLSAgICAgICAgc2RwLmFwcGVuZCgKLSAgICAgICAgICAgICAgIlxyXG4iCi0gICAgICAgICAgICAgICJ0PTAgMFxyXG4iCi0gICAgICAgICAgICAgICJhPXJhbmdlOm5wdD1ub3ctXHJcbiIpOwotCi0jaWZkZWYgQU5EUk9JRAotICAgICAgICBzcDxNZXRhRGF0YT4gbWV0YSA9IG1FbmNvZGVyLT5nZXRGb3JtYXQoKTsKLSAgICAgICAgaW50MzJfdCB3aWR0aCwgaGVpZ2h0OwotICAgICAgICBDSEVDSyhtZXRhLT5maW5kSW50MzIoa0tleVdpZHRoLCAmd2lkdGgpKTsKLSAgICAgICAgQ0hFQ0sobWV0YS0+ZmluZEludDMyKGtLZXlIZWlnaHQsICZoZWlnaHQpKTsKLQotICAgICAgICBzZHAuYXBwZW5kKAotICAgICAgICAgICAgICAibT12aWRlbyAwIFJUUC9BVlAgIiBQVF9TVFIgIlxyXG4iCi0gICAgICAgICAgICAgICJiPUFTIDMyMDAwMFxyXG4iCi0gICAgICAgICAgICAgICJhPXJ0cG1hcDoiIFBUX1NUUiAiIEgyNjQvOTAwMDBcclxuIik7Ci0KLSAgICAgICAgc2RwLmF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7Ci0gICAgICAgICAgICBpZiAobmliYmxlIDw9IDkpIHsKLSAgICAgICAgICAgICAgICBuaWJibGUgKz0gJzAnOwotICAgICAgICAgICAgfSBlbHNlIHsKLSAgICAgICAgICAgICAgICBuaWJibGUgKz0gJ2EnIC0gMTA7Ci0gICAgICAgICAgICB9Ci0gICAgICAgICAgICBvdXQtPmFwcGVuZCgmbmliYmxlLCAxKTsKLQotICAgICAgICAgICAgbmliYmxlID0ga2V5W2ldICYgMHgwZjsKLSAgICAgICAgICAgIGlmIChuaWJibGUgPD0gOSkgewotICAgICAgICAgICAgICAgIG5pYmJsZSArPSAnMCc7Ci0gICAgICAgICAgICB9IGVsc2UgewotICAgICAgICAgICAgICAgIG5pYmJsZSArPSAnYScgLSAxMDsKLSAgICAgICAgICAgIH0KLSAgICAgICAgICAgIG91dC0+YXBwZW5kKCZuaWJibGUsIDEpOwotICAgICAgICB9Ci0gICAgfQotCi0gICAgdm9pZCBhdXRoZW50aWNhdGUoY29uc3Qgc3A8QVJUU1BSZXNwb25zZT4gJnJlc3BvbnNlKSB7Ci0gICAgICAgIHNzaXplX3QgaSA9IHJlc3BvbnNlLT5tSGVhZGVycy5pbmRleE9mS2V5KCJ3d3ctYXV0aGVudGljYXRlIik7Ci0gICAgICAgIENIRUNLX0dFKGksIDApOwotCi0gICAgICAgIEFTdHJpbmcgdmFsdWUgPSByZXNwb25zZS0+bUhlYWRlcnMudmFsdWVBdChpKTsKLQotICAgICAgICBpZiAoIXN0cm5jbXAodmFsdWUuY19zdHIoKSwgIkJhc2ljIiwgNSkpIHsKLSAgICAgICAgICAgIG1BdXRoVHlwZSA9IEJBU0lDOwotICAgICAgICB9IGVsc2UgewotICAgICAgICAgICAgQ0hFQ0soIXN0cm5jbXAodmFsdWUuY19zdHIoKSwgIkRpZ2VzdCIsIDYpKTsKLSAgICAgICAgICAgIG1BdXRoVHlwZSA9IERJR0VTVDsKLQotICAgICAgICAgICAgaSA9IHZhbHVlLmZpbmQoIm5vbmNlP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YWdlUmVjZWl2ZWQoY29uc3Qgc3A8QU1lc3NhZ2U+ICZtc2cpIHsKLSAgICAgICAgc3dpdGNoIChtc2ctPndoYXQoKSkgewotICAgICAgICAgICAgY2FzZSAnY29ubic6Ci0gICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgaW50MzJfdCByZXN1bHQ7Ci0gICAgICAgICAgICAgICAgQ0hFQ0sobXNnLT5maW5kSW50MzIoInJlc3VsdCIsICZyZXN1bHQpKTsKLQotICAgICAgICAgICAgICAgIExPRyhJTkZPKSA8PCAiY29ubmVjdGlvbiByZXF1ZXN0IGNvbXBsZXRlZCB3aXRoIHJlc3VsdCAiCi0gICAgICAgICAgICAgICAgICAgICA8PCByZXN1bHQgPDwgIiAoIiA8PCBzdHJlcnJvcigtcmVzdWx0KSA8PCAiKSI7Ci0KLSAgICAgICAgICAgICAgICBpZiAocmVzdWx0ICE9IE9LKSB7Ci0gICAgICAgICAgICAgICAgICAgIChuZXcgQU1lc3NhZ2UoJ3F1aXQnLCBpZCgpKSktPnBvc3QoKTsKLSAgICAgICAgICAgICAgICAgICAgYnJlYWs7Ci0gICAgICAgICAgICAgICAgfQotCi0gICAgICAgICAgICAgICAgbUNvbm5lY3RlZCA9IHRydWU7Ci0KLSAgICAgICAgICAgICAgICBDSEVDSyhtc2ctPmZpbmRJbnQzMigic2VydmVyLWlwIiwgKGludDMyX3QgKikmbVNlcnZlcklQKSk7Ci0KLSAgICAgICAgICAgICAgICBpc3N1ZUFubm91bmNlKCk7Ci0gICAgICAgICAgICAgICAgYnJlYWs7Ci0gICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgIGNhc2UgJ2Fubm8nOgotICAgICAgICAgICAgewotICAgICAgICAgICAgICAgIGludDMyX3QgcmVzdWx0OwotICAgICAgICAgICAgICAgIENIRUNLKG1zZy0+ZmluZEludDMyKCJyZXN1bHQiLCAmcmVzdWx0KSk7Ci0KLSAgICAgICAgICAgICAgICBMT0coSU5GTykgPDwgIkFOTk9VTkNFIGNvbXBsZXRlZCB3aXRoIHJlc3VsdCAiCi0gICAgICAgICAgICAgICAgICAgICA8PCByZXN1bHQgPDwgIiAoIiA8PCBzdHJlcnJvcigtcmVzdWx0KSA8PCAiKSI7Ci0KLSAgICAgICAgICAgICAgICBzcDxSZWZCYXNlPiBvYmo7Ci0gICAgICAgICAgICAgICAgQ0hFQ0sobXNnLT5maW5kT2JqZWN0KCJyZXNwb25zZSIsICZvYmopKTsKLSAgICAgICAgICAgICAgICBzcDxBUlRTUFJlc3BvbnNlPiByZXNwb25zZTsKLQotICAgICAgICAgICAgICAgIGlmIChyZXN1bHQgPT0gT0spIHsKLSAgICAgICAgICAgICAgICAgICAgcmVzcG9uc2UgPSBzdGF0aWNfY2FzdDxBUlRTUFJlc3BvbnNlICo+KG9iai5nZXQoKSk7Ci0gICAgICAgICAgICAgICAgICAgIENIRUNLKHJlc3BvbnNlICE9IE5VTEwpOwotCi0gICAgICAgICAgICAgICAgICAgIGlmIChyZXNwb25zZS0+bVN0YXR1c0NvZGUgPT0gNDAxKSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICBpZiAobUF1dGhUeXBlICE9IE5PTkUpIHsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBMT0coSU5GTykgPDwgIkZBSUxFRCB0byBhdXRoZW50aWNhdGUiOwotICAgICAgICAgICAgICAgICAgICAgICAgICAgIChuZXcgQU1lc3NhZ2UoJ3F1aXQnLCBpZCgpKSktPnBvc3QoKTsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKLSAgICAgICAgICAgICAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgICAgICAgICAgICAgYXV0aGVudGljYXRlKHJlc3BvbnNlKTsKLSAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOwotICAgICAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgfQotCi0gICAgICAgICAgICAgICAgaWYgKHJlc3VsdCAhPSBPSyB8fCByZXNwb25zZS0+bVN0YXR1c0NvZGUgIT0gMjAwKSB7Ci0gICAgICAgICAgICAgICAgICAgIChuZXcgQU1lc3NhZ2UoJ3F1aXQnLCBpZCgpKSktPnBvc3QoKTsKLSAgICAgICAgICAgICAgICAgICAgYnJlYWs7Ci0gICAgICAgICAgICAgICAgfQotCi0gICAgICAgICAgICAgICAgdW5zaWduZWQgcnRwUG9ydDsKLSAgICAgICAgICAgICAgICBBUlRQQ29ubmVjdGlvbjo6TWFrZVBvcnRQYWlyKCZtUlRQU29ja2V0LCAmbVJUQ1BTb2NrZXQsICZydHBQb3J0KTsKLQotICAgICAgICAgICAgICAgIC8vIChuZXcgQU1lc3NhZ2UoJ3BvbGwnLCBpZCgpKSktPnBvc3QoKTsKLQotICAgICAgICAgICAgICAgIEFTdHJpbmcgcmVxdWVzdDsKLSAgICAgICAgICAgICAgICByZXF1ZXN0LmFwcGVuZCgiU0VUVVAgIik7Ci0gICAgICAgICAgICAgICAgcmVxdWVzdC5hcHBlbmQobVRyYWNrVVJMKTsKLSAgICAgICAgICAgICAgICByZXF1ZXN0LmFwcGVuZCgiIFJUU1AvMS4wXHJcbiIpOwotCi0gICAgICAgICAgICAgICAgYWRkQXV0aGVudGljYXRpb24oJnJlcXVlc3QsICJTRVRVUCIsIG1UcmFja1VSTC5jX3N0cigpKTsKLQotICAgICAgICAgICAgICAgIHJlcXVlc3QuYXBwZW5kKCJUcmFuc3BvcnQ6IFJUUC9BVlA7dW5pY2FzdDtjbGllbnRfcG9ydD0iKTsKLSAgICAgICAgICAgICAgICByZXF1ZXN0LmFwcGVuZChydHBQb3J0KTsKLSAgICAgICAgICAgICAgICByZXF1ZXN0LmFwcGVuZCgiLSIpOwotICAgICAgICAgICAgICAgIHJlcXVlc3QuYXBwZW5kKHJ0cFBvcnQgKyAxKTsKLSAgICAgICAgICAgICAgICByZXF1ZXN0LmFwcGVuZCgiO21vZGU9cmVjb3JkXHJcbiIpOwotICAgICAgICAgICAgICAgIHJlcXVlc3QuYXBwZW5kKCJcclxuIik7Ci0KLSAgICAgICAgICAgICAgICBzcDxBTWVzc2FnZT4gcmVwbHkgPSBuZXcgQU1lc3NhZ2UoJ3NldHUnLCBpZCgpKTsKLSAgICAgICAgICAgICAgICBtQ29ubi0+c2VuZFJlcXVlc3QocmVxdWVzdC5jX3N0cigpLCByZXBseSk7Ci0gICAgICAgICAgICAgICAgYnJlYWs7Ci0gICAgICAgICAgICB9Ci0KLSNpZiAwCi0gICAgICAgICAgICBjYXNlICdwb2xsJzoKLSAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICBmZF9zZXQgcnM7Ci0gICAgICAgICAgICAgICAgRkRfWkVSTygmcnMpOwotICAgICAgICAgICAgICAgIEZEX1NFVChtUlRDUFNvY2tldCwgJnJzKTsKLQotICAgICAgICAgICAgICAgIHN0cnVjdCB0aW1ldmFsIHR2OwotICAgICAgICAgICAgICAgIHR2LnR2X3NlYyA9IDA7Ci0gICAgICAgICAgICAgICAgdHYudHZfdXNlYyA9IDA7Ci0KLSAgICAgICAgICAgICAgICBpbnQgcmVzID0gc2VsZWN0KG1SVENQU29ja2V0ICsgMSwgJnJzLCBOVUxMLCBOVUxMLCAmdHYpOwotCi0gICAgICAgICAgICAgICAgaWYgKHJlcyA9PSAxKSB7Ci0gICAgICAgICAgICAgICAgICAgIHNwPEFCdWZmZXI+IGJ1ZmZlciA9IG5ldyBBQnVmZmVyKDY1NTM2KTsKLSAgICAgICAgICAgICAgICAgICAgc3NpemVfdCBuID0gcmVjdihtUlRDUFNvY2tldCwgYnVmZmVyLT5kYXRhKCksIGJ1ZmZlci0+c2l6ZSgpLCAwKTsKLQotICAgICAgICAgICAgICAgICAgICBpZiAobiA8PSAwKSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICBMT0coRVJST1IpIDw8ICJyZWN2IHJldHVybmVkICIgPDwgbjsKLSAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHsKLSAgICAgICAgICAgICAgICAgICAgICAgIExPRyhJTkZPKSA8PCAicmVjdiByZXR1cm5lZCAiIDw8IG4gPDwgIiBieXRlcyBvZiBkYXRhLiI7Ci0KLSAgICAgICAgICAgICAgICAgICAgICAgIGhleGR1bXAoYnVmZmVyLT5kYXRhKCksIG4pOwotICAgICAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgfQotCi0gICAgICAgICAgICAgICAgbXNnLT5wb3N0KDUwMDAwKTsKLSAgICAgICAgICAgICAgICBicmVhazsKLSAgICAgICAgICAgIH0KLSNlbmRpZgotCi0gICAgICAgICAgICBjYXNlICdzZXR1JzoKLSAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICBpbnQzMl90IHJlc3VsdDsKLSAgICAgICAgICAgICAgICBDSEVDSyhtc2ctPmZpbmRJbnQzMigicmVzdWx0IiwgJnJlc3VsdCkpOwotCi0gICAgICAgICAgICAgICAgTE9HKElORk8pIDw8ICJTRVRVUCBjb21wbGV0ZWQgd2l0aCByZXN1bHQgIgotICAgICAgICAgICAgICAgICAgICAgPDwgcmVzdWx0IDw8ICIgKCIgPDwgc3RyZXJyb3IoLXJlc3VsdCkgPDwgIikiOwotCi0gICAgICAgICAgICAgICAgc3A8UmVmQmFzZT4gb2JqOwotICAgICAgICAgICAgICAgIENIRUNLKG1zZy0+ZmluZE9iamVjdCgicmVzcG9uc2UiLCAmb2JqKSk7Ci0gICAgICAgICAgICAgICAgc3A8QVJUU1BSZXNwb25zZT4gcmVzcG9uc2U7Ci0KLSAgICAgICAgICAgICAgICBpZiAocmVzdWx0ID09IE9LKSB7Ci0gICAgICAgICAgICAgICAgICAgIHJlc3BvbnNlID0gc3RhdGljX2Nhc3Q8QVJUU1BSZXNwb25zZSAqPihvYmouZ2V0KCkpOwotICAgICAgICAgICAgICAgICAgICBDSEVDSyhyZXNwb25zZSAhPSBOVUxMKTsKLSAgICAgICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgICAgICBpZiAocmVzdWx0ICE9IE9LIHx8IHJlc3BvbnNlLT5tU3RhdHVzQ29kZSAhPSAyMDApIHsKLSAgICAgICAgICAgICAgICAgICAgKG5ldyBBTWVzc2FnZSgncXVpdCcsIGlkKCkpKS0+cG9zdCgpOwotICAgICAgICAgICAgICAgICAgICBicmVhazsKLSAgICAgICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgICAgICBzc2l6ZV90IGkgPSByZXNwb25zZS0+bUhlYWRlcnMuaW5kZXhPZktleSgic2Vzc2lvbiIpOwotICAgICAgICAgICAgICAgIENIRUNLX0dFKGksIDApOwotICAgICAgICAgICAgICAgIG1TZXNzaW9uSUQgPSByZXNwb25zZS0+bUhlYWRlcnMudmFsdWVBdChpKTsKLSAgICAgICAgICAgICAgICBpID0gbVNlc3Npb25JRC5maW5kKCI7Iik7Ci0gICAgICAgICAgICAgICAgaWYgKGkgPj0gMCkgewotICAgICAgICAgICAgICAgICAgICAvLyBSZW1vdmUgb3B0aW9ucywgaS5lLiAiO3RpbWVvdXQ9OTAiCi0gICAgICAgICAgICAgICAgICAgIG1TZXNzaW9uSUQuZXJhc2UoaSwgbVNlc3Npb25JRC5zaXplKCkgLSBpKTsKLSAgICAgICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgICAgICBpID0gcmVzcG9uc2UtPm1IZWFkZXJzLmluZGV4T2ZLZXkoInRyYW5zcG9ydCIpOwotICAgICAgICAgICAgICAgIENIRUNLX0dFKGksIDApOwotICAgICAgICAgICAgICAgIEFTdHJpbmcgdHJhbnNwb3J0ID0gcmVzcG9uc2UtPm1IZWFkZXJzLnZhbHVlQXQoaSk7Ci0KLSAgICAgICAgICAgICAgICBMT0coSU5GTykgPDwgInRyYW5zcG9ydCA9ICciIDw8IHRyYW5zcG9ydCA8PCAiJyI7Ci0KLSAgICAgICAgICAgICAgICBBU3RyaW5nIHZhbHVlOwotICAgICAgICAgICAgICAgIENIRUNLKEdldEF0dHJpYnV0ZSh0cmFuc3BvcnQuY19zdHIoKSwgInNlcnZlcl9wb3J0IiwgJnZhbHVlKSk7Ci0KLSAgICAgICAgICAgICAgICB1bnNpZ25lZCBydHBQb3J0LCBydGNwUG9ydDsKLSAgICAgICAgICAgICAgICBDSEVDS19FUShzc2NhbmYodmFsdWUuY19zdHIoKSwgIiV1LSV1IiwgJnJ0cFBvcnQsICZydGNwUG9ydCksIDIpOwotCi0gICAgICAgICAgICAgICAgQ0hFQ0soR2V0QXR0cmlidXRlKHRyYW5zcG9ydC5jX3N0cigpLCAic291cmNlIiwgJnZhbHVlKSk7Ci0KLSAgICAgICAgICAgICAgICBtZW1zZXQobVJlbW90ZUFkZHIuc2luX3plcm8sIDAsIHNpemVvZihtUmVtb3RlQWRkci5zaW5femVybykpOwotICAgICAgICAgICAgICAgIG1SZW1vdGVBZGRyLnNpbl9mYW1pbHkgPSBBRl9JTkVUOwotICAgICAgICAgICAgICAgIG1SZW1vdGVBZGRyLnNpbl9hZGRyLnNfYWRkciA9IGluZXRfYWRkcih2YWx1ZS5jX3N0cigpKTsKLSAgICAgICAgICAgICAgICBtUmVtb3RlQWRkci5zaW5fcG9ydCA9IGh0b25zKHJ0cFBvcnQpOwotCi0gICAgICAgICAgICAgICAgbVJlbW90ZVJUQ1BBZGRyID0gbVJlbW90ZUFkZHI7Ci0gICAgICAgICAgICAgICAgbVJlbW90ZVJUQ1BBZGRyLnNpbl9wb3J0ID0gaHRvbnMocnRwUG9ydCArIDEpOwotCi0gICAgICAgICAgICAgICAgQ0hFQ0tfRVEoMCwgY29ubmVjdChtUlRQU29ja2V0LAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKGNvbnN0IHN0cnVjdCBzb2NrYWRkciAqKSZtUmVtb3RlQWRkciwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNpemVvZihtUmVtb3RlQWRkcikpKTsKLQotICAgICAgICAgICAgICAgIENIRUNLX0VRKDAsIGNvbm5lY3QobVJUQ1BTb2NrZXQsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoY29uc3Qgc3RydWN0IHNvY2thZGRyICopJm1SZW1vdGVSVENQQWRkciwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNpemVvZihtUmVtb3RlUlRDUEFkZHIpKSk7Ci0KLSAgICAgICAgICAgICAgICB1aW50MzJfdCB4ID0gbnRvaGwobVJlbW90ZUFkZHIuc2luX2FkZHIuc19hZGRyKTsKLSAgICAgICAgICAgICAgICBMT0coSU5GTykgPDwgInNlbmRpbmcgZGF0YSB0byAiCi0gICAgICAgICAgICAgICAgICAgICA8PCAoeCA+PiAyNCkKLSAgICAgICAgICAgICAgICAgICAgIDw8ICIuIgotICAgICAgICAgICAgICAgICAgICAgPDwgKCh4ID4+IDE2KSAmIDB4ZmYpCi0gICAgICAgICAgICAgICAgICAgICA8PCAiLiIKLSAgICAgICAgICAgICAgICAgICAgIDw8ICgoeCA+PiA4KSAmIDB4ZmYpCi0gICAgICAgICAgICAgICAgICAgICA8PCAiLiIKLSAgICAgICAgICAgICAgICAgICAgIDw8ICh4ICYgMHhmZikKLSAgICAgICAgICAgICAgICAgICAgIDw8ICI6IgotICAgICAgICAgICAgICAgICAgICAgPDwgcnRwUG9ydDsKLQotICAgICAgICAgICAgICAgIEFTdHJpbmcgcmVxdWVzdDsKLSAgICAgICAgICAgICAgICByZXF1ZXN0LmFwcGVuZCgiUkVDT1JEICIpOwotICAgICAgICAgICAgICAgIHJlcXVlc3QuYXBwZW5kKG1TdHJlYW1VUkwpOwotICAgICAgICAgICAgICAgIHJlcXVlc3QuYXBwZW5kKCIgUlRTUC8xLjBcclxuIik7Ci0KLSAgICAgICAgICAgICAgICBhZGRBdXRoZW50aWNhdGlvbigmcmVxdWVzdCwgIlJFQ09SRCIsIG1TdHJlYW1VUkwuY19zdHIoKSk7Ci0KLSAgICAgICAgICAgICAgICByZXF1ZXN0LmFwcGVuZCgiU2Vzc2lvbjogIik7Ci0gICAgICAgICAgICAgICAgcmVxdWVzdC5hcHBlbmQobVNlc3Npb25JRCk7Ci0gICAgICAgICAgICAgICAgcmVxdWVzdC5hcHBlbmQoIlxyXG4iKTsKLSAgICAgICAgICAgICAgICByZXF1ZXN0LmFwcGVuZCgiXHJcbiIpOwotCi0gICAgICAgICAgICAgICAgc3A8QU1lc3NhZ2U+IHJlcGx5ID0gbmV3IEFNZXNzYWdlKCdyZWNvJywgaWQoKSk7Ci0gICAgICAgICAgICAgICAgbUNvbm4tPnNlbmRSZXF1ZXN0KHJlcXVlc3QuY19zdHIoKSwgcmVwbHkpOwotICAgICAgICAgICAgICAgIGJyZWFrOwotICAgICAgICAgICAgfQotCi0gICAgICAgICAgICBjYXNlICdyZWNvJzoKLSAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICBpbnQzMl90IHJlc3VsdDsKLSAgICAgICAgICAgICAgICBDSEVDSyhtc2ctPmZpbmRJbnQzMigicmVzdWx0IiwgJnJlc3VsdCkpOwotCi0gICAgICAgICAgICAgICAgTE9HKElORk8pIDw8ICJSRUNPUkQgY29tcGxldGVkIHdpdGggcmVzdWx0ICIKLSAgICAgICAgICAgICAgICAgICAgIDw8IHJlc3VsdCA8PCAiICgiIDw8IHN0cmVycm9yKC1yZXN1bHQpIDw8ICIpIjsKLQotICAgICAgICAgICAgICAgIHNwPFJlZkJhc2U+IG9iajsKLSAgICAgICAgICAgICAgICBDSEVDSyhtc2ctPmZpbmRPYmplY3QoInJlc3BvbnNlIiwgJm9iaikpOwotICAgICAgICAgICAgICAgIHNwPEFSVFNQUmVzcG9uc2U+IHJlc3BvbnNlOwotCi0gICAgICAgICAgICAgICAgaWYgKHJlc3VsdCA9PSBPSykgewotICAgICAgICAgICAgICAgICAgICByZXNwb25zZSA9IHN0YXRpY19jYXN0PEFSVFNQUmVzcG9uc2UgKj4ob2JqLmdldCgpKTsKLSAgICAgICAgICAgICAgICAgICAgQ0hFQ0socmVzcG9uc2UgIT0gTlVMTCk7Ci0gICAgICAgICAgICAgICAgfQotCi0gICAgICAgICAgICAgICAgaWYgKHJlc3VsdCAhPSBPSykgewotICAgICAgICAgICAgICAgICAgICAobmV3IEFNZXNzYWdlKCdxdWl0JywgaWQoKSkpLT5wb3N0KCk7Ci0gICAgICAgICAgICAgICAgICAgIGJyZWFrOwotICAgICAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgICAgIChuZXcgQU1lc3NhZ2UoJ21vcmUnLCBpZCgpKSktPnBvc3QoKTsKLSAgICAgICAgICAgICAgICAobmV3IEFNZXNzYWdlKCdzciAgJywgaWQoKSkpLT5wb3N0KCk7Ci0gICAgICAgICAgICAgICAgKG5ldyBBTWVzc2FnZSgnYWxpdicsIGlkKCkpKS0+cG9zdCgzMDAwMDAwMGxsKTsKLSAgICAgICAgICAgICAgICBicmVhazsKLSAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgY2FzZSAnYWxpdic6Ci0gICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgaWYgKCFtQ29ubmVjdGVkKSB7Ci0gICAgICAgICAgICAgICAgICAgIGJyZWFrOwotICAgICAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgICAgIEFTdHJpbmcgcmVxdWVzdDsKLSAgICAgICAgICAgICAgICByZXF1ZXN0LmFwcGVuZCgiT1BUSU9OUyAiKTsKLSAgICAgICAgICAgICAgICByZXF1ZXN0LmFwcGVuZChtU3RyZWFtVVJMKTsKLSAgICAgICAgICAgICAgICByZXF1ZXN0LmFwcGVuZCgiIFJUU1AvMS4wXHJcbiIpOwotCi0gICAgICAgICAgICAgICAgYWRkQXV0aGVudGljYXRpb24oJnJlcXVlc3QsICJSRUNPUkQiLCBtU3RyZWFtVVJMLmNfc3RyKCkpOwotCi0gICAgICAgICAgICAgICAgcmVxdWVzdC5hcHBlbmQoIlNlc3Npb246ICIpOwotICAgICAgICAgICAgICAgIHJlcXVlc3QuYXBwZW5kKG1TZXNzaW9uSUQpOwotICAgICAgICAgICAgICAgIHJlcXVlc3QuYXBwZW5kKCJcclxuIik7Ci0gICAgICAgICAgICAgICAgcmVxdWVzdC5hcHBlbmQoIlxyXG4iKTsKLQotICAgICAgICAgICAgICAgIHNwPEFNZXNzYWdlPiByZXBseSA9IG5ldyBBTWVzc2FnZSgnb3B0cycsIGlkKCkpOwotICAgICAgICAgICAgICAgIG1Db25uLT5zZW5kUmVxdWVzdChyZXF1ZXN0LmNfc3RyKCksIHJlcGx5KTsKLSAgICAgICAgICAgICAgICBicmVhazsKLSAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgY2FzZSAnb3B0cyc6Ci0gICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgaW50MzJfdCByZXN1bHQ7Ci0gICAgICAgICAgICAgICAgQ0hFQ0sobXNnLT5maW5kSW50MzIoInJlc3VsdCIsICZyZXN1bHQpKTsKLQotICAgICAgICAgICAgICAgIExPRyhJTkZPKSA8PCAiT1BUSU9OUyBjb21wbGV0ZWQgd2l0aCByZXN1bHQgIgotICAgICAgICAgICAgICAgICAgICAgPDwgcmVzdWx0IDw8ICIgKCIgPDwgc3RyZXJyb3IoLXJlc3VsdCkgPDwgIikiOwotCi0gICAgICAgICAgICAgICAgaWYgKCFtQ29ubmVjdGVkKSB7Ci0gICAgICAgICAgICAgICAgICAgIGJyZWFrOwotICAgICAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgICAgIChuZXcgQU1lc3NhZ2UoJ2FsaXYnLCBpZCgpKSktPnBvc3QoMzAwMDAwMDBsbCk7Ci0gICAgICAgICAgICAgICAgYnJlYWs7Ci0gICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgIGNhc2UgJ21vcmUnOgotICAgICAgICAgICAgewotICAgICAgICAgICAgICAgIGlmICghbUNvbm5lY3RlZCkgewotICAgICAgICAgICAgICAgICAgICBicmVhazsKLSAgICAgICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgICAgICBzcDxBQnVmZmVyPiBidWZmZXIgPSBuZXcgQUJ1ZmZlcig2NTUzNik7Ci0gICAgICAgICAgICAgICAgdWludDhfdCAqZGF0YSA9IGJ1ZmZlci0+ZGF0YSgpOwotICAgICAgICAgICAgICAgIGRhdGFbMF0gPSAweDgwOwotICAgICAgICAgICAgICAgIGRhdGFbMV0gPSAoMSA8PCA3KSB8IFBUOyAgLy8gTS1iaXQKLSAgICAgICAgICAgICAgICBkYXRhWzJdID0gKG1TZXFObyA+PiA4KSAmIDB4ZmY7Ci0gICAgICAgICAgICAgICAgZGF0YVszXSA9IG1TZXFObyAmIDB4ZmY7Ci0gICAgICAgICAgICAgICAgZGF0YVs4XSA9IG1Tb3VyY2VJRCA+PiAyNDsKLSAgICAgICAgICAgICAgICBkYXRhWzldID0gKG1Tb3VyY2VJRCA+PiAxNikgJiAweGZmOwotICAgICAgICAgICAgICAgIGRhdGFbMTBdID0gKG1Tb3VyY2VJRCA+PiA4KSAmIDB4ZmY7Ci0gICAgICAgICAgICAgICAgZGF0YVsxMV0gPSBtU291cmNlSUQgJiAweGZmOwotCi0jaWZkZWYgQU5EUk9JRAotICAgICAgICAgICAgICAgIE1lZGlhQnVmZmVyICptZWRpYUJ1ZiA9IE5VTEw7Ci0gICAgICAgICAgICAgICAgZm9yICg7OykgewotICAgICAgICAgICAgICAgICAgICBDSEVDS19FUShtRW5jb2Rlci0+cmVhZCgmbWVkaWFCdWYpLCAoc3RhdHVzX3QpT0spOwotICAgICAgICAgICAgICAgICAgICBpZiAobWVkaWFCdWYtPnJhbmdlX2xlbmd0aCgpID4gMCkgewotICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7Ci0gICAgICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICAgICAgbWVkaWFCdWYtPnJlbGVhc2UoKTsKLSAgICAgICAgICAgICAgICAgICAgbWVkaWFCdWYgPSBOVUxMOwotICAgICAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgICAgIGludDY0X3QgdGltZVVzOwotICAgICAgICAgICAgICAgIENIRUNLKG1lZGlhQnVmLT5tZXRhX2RhdGEoKS0+ZmluZEludDY0KGtLZXlUaW1lLCAmdGltZVVzKSk7Ci0KLSAgICAgICA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gICAgICBkYXRhWzVdID0gKHJ0cFRpbWUgPj4gMTYpICYgMHhmZjsKLSAgICAgICAgICAgICAgICBkYXRhWzZdID0gKHJ0cFRpbWUgPj4gOCkgJiAweGZmOwotICAgICAgICAgICAgICAgIGRhdGFbN10gPSBydHBUaW1lICYgMHhmZjsKLQotICAgICAgICAgICAgICAgIHNzaXplX3QgbiA9IHNlbmQoCi0gICAgICAgICAgICAgICAgICAgICAgICBtUlRQU29ja2V0LCBkYXRhLCBidWZmZXItPnNpemUoKSwgMCk7Ci0gICAgICAgICAgICAgICAgaWYgKG4gPCAwKSB7Ci0gICAgICAgICAgICAgICAgICAgIExPRyhFUlJPUikgPDwgInNlbmQgZmFpbGVkICgiIDw8IHN0cmVycm9yKGVycm5vKSA8PCAiKSI7Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgIENIRUNLX0VRKG4sIChzc2l6ZV90KWJ1ZmZlci0+c2l6ZSgpKTsKLQotICAgICAgICAgICAgICAgICsrbVNlcU5vOwotCi0gICAgICAgICAgICAgICAgKyttTnVtUlRQU2VudDsKLSAgICAgICAgICAgICAgICBtTnVtUlRQT2N0ZXRzU2VudCArPSBidWZmZXItPnNpemUoKSAtIDEyOwotCi0gICAgICAgICAgICAgICAgbUxhc3RSVFBUaW1lID0gcnRwVGltZTsKLSAgICAgICAgICAgICAgICBtTGFzdE5UUFRpbWUgPSBudHBUaW1lKCk7Ci0KLSNpZmRlZiBBTkRST0lECi0gICAgICAgICAgICAgICAgaWYgKG1OdW1SVFBTZW50IDwgNjAgKiAyNSkgeyAgLy8gNjAgc2VjcyB3b3J0aAotICAgICAgICAgICAgICAgICAgICBtc2ctPnBvc3QoNDAwMDApOwotI2Vsc2UKLSAgICAgICAgICAgICAgICBpZiAobU51bVJUUE9jdGV0c1NlbnQgPCA4MDAwICogNjApIHsKLSAgICAgICAgICAgICAgICAgICAgbXNnLT5wb3N0KDEwMDAwMDBsbCAqIDEyOCAvIDgwMDApOwotI2VuZGlmCi0gICAgICAgICAgICAgICAgfSBlbHNlIHsKLSAgICAgICAgICAgICAgICAgICAgTE9HKElORk8pIDw8ICJUaGF0J3MgZW5vdWdoLCBwYXVzaW5nLiI7Ci0KLSAgICAgICAgICAgICAgICAgICAgQVN0cmluZyByZXF1ZXN0OwotICAgICAgICAgICAgICAgICAgICByZXF1ZXN0LmFwcGVuZCgiUEFVU0UgIik7Ci0gICAgICAgICAgICAgICAgICAgIHJlcXVlc3QuYXBwZW5kKG1TdHJlYW1VUkwpOwotICAgICAgICAgICAgICAgICAgICByZXF1ZXN0LmFwcGVuZCgiIFJUU1AvMS4wXHJcbiIpOwotCi0gICAgICAgICAgICAgICAgICAgIGFkZEF1dGhlbnRpY2F0aW9uKCZyZXF1ZXN0LCAiUEFVU0UiLCBtU3RyZWFtVVJMLmNfc3RyKCkpOwotCi0gICAgICAgICAgICAgICAgICAgIHJlcXVlc3QuYXBwZW5kKCJTZXNzaW9uOiAiKTsKLSAgICAgICAgICAgICAgICAgICAgcmVxdWVzdC5hcHBlbmQobVNlc3Npb25JRCk7Ci0gICAgICAgICAgICAgICAgICAgIHJlcXVlc3QuYXBwZW5kKCJcclxuIik7Ci0gICAgICAgICAgICAgICAgICAgIHJlcXVlc3QuYXBwZW5kKCJcclxuIik7Ci0KLSAgICAgICAgICAgICAgICAgICAgc3A8QU1lc3NhZ2U+IHJlcGx5ID0gbmV3IEFNZXNzYWdlKCdwYXVzJywgaWQoKSk7Ci0gICAgICAgICAgICAgICAgICAgIG1Db25uLT5zZW5kUmVxdWVzdChyZXF1ZXN0LmNfc3RyKCksIHJlcGx5KTsKLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgYnJlYWs7Ci0gICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgIGNhc2UgJ3NyICAnOgotICAgICAgICAgICAgewotICAgICAgICAgICAgICAgIGlmICghbUNvbm5lY3RlZCkgewotICAgICAgICAgICAgICAgICAgICBicmVhazsKLSAgICAgICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgICAgICBzcDxBQnVmZmVyPiBidWZmZXIgPSBuZXcgQUJ1ZmZlcig2NTUzNik7Ci0gICAgICAgICAgICAgICAgYnVmZmVyLT5zZXRSYW5nZSgwLCAwKTsKLQotICAgICAgICAgICAgICAgIGFkZFNSKGJ1ZmZlcik7Ci0gICAgICAgICAgICAgICAgYWRkU0RFUyhidWZmZXIpOwotCi0gICAgICAgICAgICAgICAgdWludDhfdCAqZGF0YSA9IGJ1ZmZlci0+ZGF0YSgpOwotICAgICAgICAgICAgICAgIHNzaXplX3QgbiA9IHNlbmQoCi0gICAgICAgICAgICAgICAgICAgICAgICBtUlRDUFNvY2tldCwgZGF0YSwgYnVmZmVyLT5zaXplKCksIDApOwotICAgICAgICAgICAgICAgIENIRUNLX0VRKG4sIChzc2l6ZV90KWJ1ZmZlci0+c2l6ZSgpKTsKLQotICAgICAgICAgICAgICAgIG1zZy0+cG9zdCgzMDAwMDAwKTsKLSAgICAgICAgICAgICAgICBicmVhazsKLSAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgY2FzZSAncGF1cyc6Ci0gICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgaW50MzJfdCByZXN1bHQ7Ci0gICAgICAgICAgICAgICAgQ0hFQ0sobXNnLT5maW5kSW50MzIoInJlc3VsdCIsICZyZXN1bHQpKTsKLQotICAgICAgICAgICAgICAgIExPRyhJTkZPKSA8PCAiUEFVU0UgY29tcGxldGVkIHdpdGggcmVzdWx0ICIKLSAgICAgICAgICAgICAgICAgICAgIDw8IHJlc3VsdCA8PCAiICgiIDw8IHN0cmVycm9yKC1yZXN1bHQpIDw8ICIpIjsKLQotICAgICAgICAgICAgICAgIHNwPFJlZkJhc2U+IG9iajsKLSAgICAgICAgICAgICAgICBDSEVDSyhtc2ctPmZpbmRPYmplY3QoInJlc3BvbnNlIiwgJm9iaikpOwotICAgICAgICAgICAgICAgIHNwPEFSVFNQUmVzcG9uc2U+IHJlc3BvbnNlOwotCi0gICAgICAgICAgICAgICAgQVN0cmluZyByZXF1ZXN0OwotICAgICAgICAgICAgICAgIHJlcXVlc3QuYXBwZW5kKCJURUFSRE9XTiAiKTsKLSAgICAgICAgICAgICAgICByZXF1ZXN0LmFwcGVuZChtU3RyZWFtVVJMKTsKLSAgICAgICAgICAgICAgICByZXF1ZXN0LmFwcGVuZCgiIFJUU1AvMS4wXHJcbiIpOwotCi0gICAgICAgICAgICAgICAgYWRkQXV0aGVudGljYXRpb24oJnJlcXVlc3QsICJURUFSRE9XTiIsIG1TdHJlYW1VUkwuY19zdHIoKSk7Ci0KLSAgICAgICAgICAgICAgICByZXF1ZXN0LmFwcGVuZCgiU2Vzc2lvbjogIik7Ci0gICAgICAgICAgICAgICAgcmVxdWVzdC5hcHBlbmQobVNlc3Npb25JRCk7Ci0gICAgICAgICAgICAgICAgcmVxdWVzdC5hcHBlbmQoIlxyXG4iKTsKLSAgICAgICAgICAgICAgICByZXF1ZXN0LmFwcGVuZCgiXHJcbiIpOwotCi0gICAgICAgICAgICAgICAgc3A8QU1lc3NhZ2U+IHJlcGx5ID0gbmV3IEFNZXNzYWdlKCd0ZWFyJywgaWQoKSk7Ci0gICAgICAgICAgICAgICAgbUNvbm4tPnNlbmRSZXF1ZXN0KHJlcXVlc3QuY19zdHIoKSwgcmVwbHkpOwotICAgICAgICAgICAgICAgIGJyZWFrOwotICAgICAgICAgICAgfQotCi0gICAgICAgICAgICBjYXNlICd0ZWFyJzoKLSAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICBpbnQzMl90IHJlc3VsdDsKLSAgICAgICAgICAgICAgICBDSEVDSyhtc2ctPmZpbmRJbnQzMigicmVzdWx0IiwgJnJlc3VsdCkpOwotCi0gICAgICAgICAgICAgICAgTE9HKElORk8pIDw8ICJURUFSRE9XTiBjb21wbGV0ZWQgd2l0aCByZXN1bHQgIgotICAgICAgICAgICAgICAgICAgICAgPDwgcmVzdWx0IDw8ICIgKCIgPDwgc3RyZXJyb3IoLXJlc3VsdCkgPDwgIikiOwotCi0gICAgICAgICAgICAgICAgc3A8UmVmQmFzZT4gb2JqOwotICAgICAgICAgICAgICAgIENIRUNLKG1zZy0+ZmluZE9iamVjdCgicmVzcG9uc2UiLCAmb2JqKSk7Ci0gICAgICAgICAgICAgICAgc3A8QVJUU1BSZXNwb25zZT4gcmVzcG9uc2U7Ci0KLSAgICAgICAgICAgICAgICBpZiAocmVzdWx0ID09IE9LKSB7Ci0gICAgICAgICAgICAgICAgICAgIHJlc3BvbnNlID0gc3RhdGljX2Nhc3Q8QVJUU1BSZXNwb25zZSAqPihvYmouZ2V0KCkpOwotICAgICAgICAgICAgICAgICAgICBDSEVDSyhyZXNwb25zZSAhPSBOVUxMKTsKLSAgICAgICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgICAgICAobmV3IEFNZXNzYWdlKCdxdWl0JywgaWQoKSkpLT5wb3N0KCk7Ci0gICAgICAgICAgICAgICAgYnJlYWs7Ci0gICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgIGNhc2UgJ2Rpc2MnOgotICAgICAgICAgICAgewotICAgICAgICAgICAgICAgIExPRyhJTkZPKSA8PCAiZGlzY29ubmVjdCBjb21wbGV0ZWQiOwotCi0gICAgICAgICAgICAgICAgbUNvbm5lY3RlZCA9IGZhbHNlOwotICAgICAgICAgICAgICAgIChuZXcgQU1lc3NhZ2UoJ3F1aXQnLCBpZCgpKSktPnBvc3QoKTsKLSAgICAgICAgICAgICAgICBicmVhazsKLSAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgY2FzZSAncXVpdCc6Ci0gICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgaWYgKG1Db25uZWN0ZWQpIHsKLSAgICAgICAgICAgICAgICAgICAgbUNvbm4tPmRpc2Nvbm5lY3QobmV3IEFNZXNzYWdlKCdkaXNjJywgaWQoKSkpOwotICAgICAgICAgICAgICAgICAgICBicmVhazsKLSAgICAgICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgICAgICBpZiAobVJUUFNvY2tldCA+PSAwKSB7Ci0gICAgICAgICAgICAgICAgICAgIGNsb3NlKG1SVFBTb2NrZXQpOwotICAgICAgICAgICAgICAgICAgICBtUlRQU29ja2V0ID0gLTE7Ci0gICAgICAgICAgICAgICAgfQotCi0gICAgICAgICAgICAgICAgaWYgKG1SVENQU29ja2V0ID49IDApIHsKLSAgICAgICAgICAgICAgICAgICAgY2xvc2UobVJUQ1BTb2NrZXQpOwotICAgICAgICAgICAgICAgICAgICBtUlRDUFNvY2tldCA9IC0xOwotICAgICAgICAgICAgICAgIH0KLQotI2lmZGVmIEFORFJPSUQKLSAgICAgICAgICAgICAgICBtRW5jb2Rlci0+c3RvcCgpOwotICAgICAgICAgICAgICAgIG1FbmNvZGVyLmNsZWFyKCk7Ci0jZW5kaWYKLQotICAgICAgICAgICAgICAgIG1Mb29wZXItPnN0b3AoKTsKLSAgICAgICAgICAgICAgICBicmVhazsKLSAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgZGVmYXVsdDoKLSAgICAgICAgICAgICAgICBUUkVTUEFTUygpOwotICAgICAgICB9Ci0gICAgfQotCi1wcm90ZWN0ZWQ6Ci0gICAgdmlydHVhbCB+TXlUcmFuc21pdHRlcigpIHsKLSAgICB9Ci0KLXByaXZhdGU6Ci0gICAgZW51bSBBdXRoVHlwZSB7Ci0gICAgICAgIE5PTkUsCi0gICAgICAgIEJBU0lDLAotICAgICAgICBESUdFU1QKLSAgICB9OwotCi0gICAgQVN0cmluZyBtU2VydmVyVVJMOwotICAgIEFTdHJpbmcgbVRyYWNrVVJMOwotICAgIEFTdHJpbmcgbVN0cmVhbVVSTDsKLQotICAgIHNwPEFMb29wZXI+IG1Mb29wZXI7Ci0gICAgc3A8QVJUU1BDb25uZWN0aW9uPiBtQ29ubjsKLSAgICBib29sIG1Db25uZWN0ZWQ7Ci0gICAgdWludDMyX3QgbVNlcnZlcklQOwotICAgIEF1dGhUeXBlIG1BdXRoVHlwZTsKLSAgICBBU3RyaW5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5PVEUKLQotICAgICAgICBzdGF0aWMgY29uc3QgY2hhciAqa05PVEUgPSAiSGVsbCdzIGZyb3plbiBvdmVyLiI7Ci0gICAgICAgIGRhdGFbb2Zmc2V0KytdID0gc3RybGVuKGtOT1RFKTsKLQotICAgICAgICBtZW1jcHkoJmRhdGFbb2Zmc2V0XSwga05PVEUsIHN0cmxlbihrTk9URSkpOwotICAgICAgICBvZmZzZXQgKz0gc3RybGVuKGtOT1RFKTsKLQotICAgICAgICBkYXRhW29mZnNldCsrXSA9IDA7Ci0KLSAgICAgICAgaWYgKChvZmZzZXQgJSA0KSA+IDApIHsKLSAgICAgICAgICAgIHNpemVfdCBjb3VudCA9IDQgLSAob2Zmc2V0ICUgNCk7Ci0gICAgICAgICAgICBzd2l0Y2ggKGNvdW50KSB7Ci0gICAgICAgICAgICAgICAgY2FzZSAzOgotICAgICAgICAgICAgICAgICAgICBkYXRhW29mZnNldCsrXSA9IDA7Ci0gICAgICAgICAgICAgICAgY2FzZSAyOgotICAgICAgICAgICAgICAgICAgICBkYXRhW29mZnNldCsrXSA9IDA7Ci0gICAgICAgICAgICAgICAgY2FzZSAxOgotICAgICAgICAgICAgICAgICAgICBkYXRhW29mZnNldCsrXSA9IDA7Ci0gICAgICAgICAgICB9Ci0gICAgICAgIH0KLQotICAgICAgICBzaXplX3QgbnVtV29yZHMgPSAob2Zmc2V0IC8gNCkgLSAxOwotICAgICAgICBkYXRhWzJdID0gbnVtV29yZHMgPj4gODsKLSAgICAgICAgZGF0YVszXSA9IG51bVdvcmRzICYgMHhmZjsKLQotICAgICAgICBidWZmZXItPnNldFJhbmdlKGJ1ZmZlci0+b2Zmc2V0KCksIGJ1ZmZlci0+c2l6ZSgpICsgb2Zmc2V0KTsKLSAgICB9Ci0KLSAgICBESVNBTExPV19FVklMX0NPTlNUUlVDVE9SUyhNeVRyYW5zbWl0dGVyKTsKLX07Ci0KLX0gIC8vIG5hbWVzcGFjZSBhbmRyb2lkCi0KLSNlbmRpZiAgLy8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Mb29wZXI6OkdldE5vd1VzKCk7Ci0gICAgKG5ldyBBTWVzc2FnZShrV2hhdFB1c2gsIGlkKCkpKS0+cG9zdCh3aGVuVXMgLSBub3dVcyk7Ci0KLSAgICByZXR1cm4gdHJ1ZTsKLX0KLQotdm9pZCBVRFBQdXNoZXI6Om9uTWVzc2FnZVJlY2VpdmVkKGNvbnN0IHNwPEFNZXNzYWdlPiAmbXNnKSB7Ci0gICAgc3dpdGNoIChtc2ctPndoYXQoKSkgewotICAgICAgICBjYXNlIGtXaGF0UHVzaDoKLSAgICAgICAgewotICAgICAgICAgICAgaWYgKCFvblB1c2goKSAmJiAhKG50b2hzKG1SZW1vdGVBZGRyLnNpbl9wb3J0KSAmIDEpKSB7Ci0gICAgICAgICAgICAgICAgQUxPR0koImVtdWxhdGluZyBCWUUgcGFja2V0Iik7Ci0KLSAgICAgICAgICAgICAgICBzcDxBQnVmZmVyPiBidWZmZXIgPSBuZXcgQUJ1ZmZlcig4KTsKLSAgICAgICAgICAgICAgICB1aW50OF90ICpkYXRhID0gYnVmZmVyLT5kYXRhKCk7Ci0gICAgICAgICAgICAgICAgKmRhdGErKyA9ICgyIDw8IDYpIHwgMTsKLSAgICAgICAgICAgICAgICAqZGF0YSsrID0gMjAzOwotICAgICAgICAgICAgICAgICpkYXRhKysgPSAwOwotICAgICAgICAgICAgICAgICpkYXRhKysgPSAxOwotICAgICAgICAgICAgICAgICpkYXRhKysgPSAweDhmOwotICAgICAgICAgICAgICAgICpkYXRhKysgPSAweDQ5OwotICAgICAgICAgICAgICAgICpkYXRhKysgPSAweGMwOwotICAgICAgICAgICAgICAgICpkYXRhKysgPSAweGQwOwotICAgICAgICAgICAgICAgIGJ1ZmZlci0+c2V0UmFuZ2UoMCwgOCk7Ci0KLSAgICAgICAgICAgICAgICBzdHJ1Y3Qgc29ja2FkZHJfaW4gdG1wID0gbVJlbW90ZUFkZHI7Ci0gICAgICAgICAgICAgICAgdG1wLnNpbl9wb3J0ID0gaHRvbnMobnR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4wLjBcclxuIgotICAgICAgICAicz1RdWlja1RpbWVcclxuIgotICAgICAgICAidD0wIDBcclxuIgotICAgICAgICAiYT1yYW5nZTpucHQ9MC0zMTVcclxuIgotICAgICAgICAiYT1pc21hLWNvbXBsaWFuY2U6MiwyLjAsMlxyXG4iCi0gICAgICAgICJtPWF1ZGlvIDU0MzQgUlRQL0FWUCA5N1xyXG4iCi0gICAgICAgICJjPUlOIElQNCAxMjcuMC4wLjFcclxuIgotICAgICAgICAiYj1BUzozMFxyXG4iCi0gICAgICAgICJhPXJ0cG1hcDo5NyBBTVIvODAwMC8xXHJcbiIKLSAgICAgICAgImE9Zm10cDo5NyBvY3RldC1hbGlnblxyXG4iOwotI2VsaWYgMQotICAgIC8vIEdUYWxrJ3MgSDI2NCBTRFAKLSAgICBzdGF0aWMgY29uc3QgY2hhciAqcmF3ID0KLSAgICAgICAgInY9MFxyXG4iCi0gICAgICAgICJvPS0gNjQgMjMzNTcyOTQ0IElOIElQNCAxMjcuMC4wLjBcclxuIgotICAgICAgICAicz1RdWlja1RpbWVcclxuIgotICAgICAgICAidD0wIDBcclxuIgotICAgICAgICAiYT1yYW5nZTpucHQ9bm93LVxyXG4iCi0gICAgICAgICJtPXZpZGVvIDU0MzQgUlRQL0FWUCA5NlxyXG4iCi0gICAgICAgICJjPUlOIElQNCAxMjcuMC4wLjFcclxuIgotICAgICAgICAiYj1BUzozMjAwMDBcclxuIgotICAgICAgICAiYT1ydHBtYXA6OTYgSDI2NC85MDAwMFxyXG4iCi0gICAgICAgICJhPWZtdHA6OTYgcGFja2V0aXphdGlvbi1tb2RlPTE7cHJvZmlsZS1sZXZlbC1pZD00MjAwMUU7IgotICAgICAgICAgICJzcHJvcC1wYXJhbWV0ZXItc2V0cz1aMElBSHBaVUJhSG9nQT09LGFNNDRnQT09XHJcbiIKLSAgICAgICAgImE9Y2xpcHJlY3Q6MCwwLDQ4MCwyNzBcclxuIgotICAgICAgICAiYT1mcmFtZXNpemU6OTYgNzIwLTQ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1hdCgpLT5maW5kSW50MzIoa0tleVdpZHRoLCAmd2lkdGgpKTsKLSAgICAgICAgICAgICAgICBDSEVDSyhkZWNvZGVyLT5nZXRGb3JtYXQoKS0+ZmluZEludDMyKGtLZXlIZWlnaHQsICZoZWlnaHQpKTsKLSAgICAgICAgICAgICAgICBwcmludGYoIklORk9fRk9STUFUX0NIQU5HRUQgJWQgeCAlZFxuIiwgd2lkdGgsIGhlaWdodCk7Ci0gICAgICAgICAgICAgICAgY29udGludWU7Ci0gICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgIEFMT0dFKCJkZWNvZGVyIHJldHVybmVkIGVycm9yIDB4JTA4eCIsIGVycik7Ci0gICAgICAgICAgICBicmVhazsKLSAgICAgICAgfQotCi0jaWYgMQotICAgICAgICBpZiAoYnVmZmVyLT5yYW5nZV9sZW5ndGgoKSAhPSAwKSB7Ci0gICAgICAgICAgICBpbnQ2NF90IHRpbWVVczsKLSAgICAgICAgICAgIENIRUNLKGJ1ZmZlci0+bWV0YV9kYXRhKCktPmZpbmRJbnQ2NChrS2V5VGltZSwgJnRpbWVVcykpOwotCi0gICAgICAgICAgICBwcmludGYoImRlY29kZXIgcmV0dXJuZWQgZnJhbWUgb2Ygc2l6ZSAlZCBhdCB0aW1lICUuMmYgc2Vjc1xuIiwKLSAgICAgICAgICAgICAgICAgICBidWZmZXItPnJhbmdlX2xlbmd0aCgpLCB0aW1lVXMgLyAxRTYpOwotICAgICAgICB9Ci0jZW5kaWYKLQotICAgICAgICBidWZmZXItPnJlbGVhc2UoKTsKLSAgICAgICAgYnVmZmVyID0gTlVMTDsKLSAgICB9Ci0KLSAgICBDSEVDS19FUShkZWNvZGVyLT5zdG9wKCksIChzdGF0dXNfdClPSyk7Ci0KLSAgICBsb29wZXItPnN0b3AoKTsKLQotICAgIHJldHVybiAwOwotfQpkaWZmIC0tZ2l0IGEvbWVkaWEvbGlic3RhZ2VmcmlnaHQvdGVzdHMvQW5kcm9pZC5tayBiL21lZGlhL2xpY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Npb24pKTsKLSAgICAgICAgQVNTRVJUX0VRKEVHTF9TVUNDRVNTLCBlZ2xHZXRFcnJvcigpKTsKLSAgICAgICAgUmVjb3JkUHJvcGVydHkoIkVnbFZlcnNpb25NYWpvciIsIG1ham9yVmVyc2lvbik7Ci0gICAgICAgIFJlY29yZFByb3BlcnR5KCJFZ2xWZXJzaW9uTWFqb3IiLCBtaW5vclZlcnNpb24pOwotCi0gICAgICAgIEVHTGludCBudW1Db25maWdzID0gMDsKLSAgICAgICAgRVhQRUNUX1RSVUUoZWdsQ2hvb3NlQ29uZmlnKG1FZ2xEaXNwbGF5LCBnZXRDb25maWdBdHRyaWJzKCksICZtR2xDb25maWcsCi0gICAgICAgICAgICAgICAgMSwgJm51bUNvbmZpZ3MpKTsKLSAgICAgICAgQVNTRVJUX0VRKEVHTF9TVUNDRVNTLCBlZ2xHZXRFcnJvcigpKTsKLQotICAgICAgICBjaGFyKiBkaXNwbGF5U2Vjc0VudiA9IGdldGVudigiR0xURVNUX0RJU1BMQVlfU0VDUyIpOwotICAgICAgICBpZiAoZGlzcGxheVNlY3NFbnYgIT0gTlVMTCkgewotICAgICAgICAgICAgbURpc3BsYXlTZWNzID0gYXRvaShkaXNwbGF5U2Vjc0Vudik7Ci0gICAgICAgICAgICBpZiAobURpc3BsYXlTZWNzIDwgMCkgewotICAgICAgICAgICAgICAgIG1EaXNwbGF5U2VjcyA9IDA7Ci0gICAgICAgICAgICB9Ci0gICAgICAgIH0gZWxzZSB7Ci0gICAgICAgICAgICBtRGlzcGxheVNlY3MgPSAwOwotICAgICAgICB9Ci0KLSAgICAgICAgaWYgKG1EaXNwbGF5U2VjcyA+IDApIHsKLSAgICAgICAgICAgIG1Db21wb3NlckNsaWVudCA9IG5ldyBTdXJmYWNlQ29tcG9zZXJDbGllbnQ7Ci0gICAgICAgICAgICBBU1NFUlRfRVEoTk9fRVJST1IsIG1Db21wb3NlckNsaWVudC0+aW5pdENoZWNrKCkpOwotCi0gICAgICAgICAgICBtU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TGVudW0oR0xfTk9fRVJST1IpLCBnbEdldEVycm9yKCkpOwotICAgICAgICAgICAgR0xpbnQgY29tcGlsZWQgPSAwOwotICAgICAgICAgICAgZ2xHZXRTaGFkZXJpdihzaGFkZXIsIEdMX0NPTVBJTEVfU1RBVFVTLCAmY29tcGlsZWQpOwotICAgICAgICAgICAgQVNTRVJUX0VRKEdMZW51bShHTF9OT19FUlJPUiksIGdsR2V0RXJyb3IoKSk7Ci0gICAgICAgICAgICBpZiAoIWNvbXBpbGVkKSB7Ci0gICAgICAgICAgICAgICAgR0xpbnQgaW5mb0xlbiA9IDA7Ci0gICAgICAgICAgICAgICAgZ2xHZXRTaGFkZXJpdihzaGFkZXIsIEdMX0lORk9fTE9HX0xFTkdUSCwgJmluZm9MZW4pOwotICAgICAgICAgICAgICAgIEFTU0VSVF9FUShHTGVudW0oR0xfTk9fRVJST1IpLCBnbEdldEVycm9yKCkpOwotICAgICAgICAgICAgICAgIGlmIChpbmZvTGVuKSB7Ci0gICAgICAgICAgICAgICAgICAgIGNoYXIqIGJ1ZiA9IChjaGFyKikgbWFsbG9jKGluZm9MZW4pOwotICAgICAgICAgICAgICAgICAgICBpZiAoYnVmKSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICBnbEdldFNoYWRlckluZm9Mb2coc2hhZGVyLCBpbmZvTGVuLCBOVUxMLCBidWYpOwotICAgICAgICAgICAgICAgICAgICAgICAgcHJpbnRmKCJTaGFkZXIgY29tcGlsZSBsb2c6XG4lc1xuIiwgYnVmKTsKLSAgICAgICAgICAgICAgICAgICAgICAgIGZyZWUoYnVmKTsKLSAgICAgICAgICAgICAgICAgICAgICAgIEZBSUwoKTsKLSAgICAgICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgIH0gZWxzZSB7Ci0gICAgICAgICAgICAgICAgICAgIGNoYXIqIGJ1ZiA9IChjaGFyKikgbWFsbG9jKDB4MTAwMCk7Ci0gICAgICAgICAgICAgICAgICAgIGlmIChidWYpIHsKLSAgICAgICAgICAgICAgICAgICAgICAgIGdsR2V0U2hhZGVySW5mb0xvZyhzaGFkZXIsIDB4MTAwMCwgTlVMTCwgYnVmKTsKLSAgICAgICAgICAgICAgICAgICAgICAgIHByaW50ZigiU2hhZGVyIGNvbXBpbGUgbG9nOlxuJXNcbiIsIGJ1Zik7Ci0gICAgICAgICAgICAgICAgICAgICAgICBmcmVlKGJ1Zik7Ci0gICAgICAgICAgICAgICAgICAgICAgICBGQUlMKCk7Ci0gICAgICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgZ2xEZWxldGVTaGFkZXIoc2hhZGVyKTsKLSAgICAgICAgICAgICAgICBzaGFkZXIgPSAwOwotICAgICAgICAgICAgfQotICAgICAgICB9Ci0gICAgICAgIEFTU0VSVF9UUlVFKHNoYWRlciAhPSAwKTsKLSAgICAgICAgKm91dFNoYWRlciA9IHNoYWRlcjsKLSAgICB9Ci0KLSAgICB2b2lkIGNyZWF0ZVByb2dyYW0oY29uc3QgY2hhciogcFZlcnRleFNvdXJjZSwgY29uc3QgY2hhciogcEZyYWdtZW50U291cmNlLAotICAgICAgICAgICAgR0x1aW50KiBvdXRQZ20pIHsKLSAgICAgICAgR0x1aW50IHZlcnRleFNoYWRlciwgZnJhZ21lbnRTaGFkZXI7Ci0gICAgICAgIHsKLSAgICAgICAgICAgIFNDT1BFRF9UUkFDRSgiY29tcGlsaW5nIHZlcnRleCBzaGFkZXIiKTsKLSAgICAgICAgICAgIGxvYWRTaGFkZXIoR0xfVkVSVEVYX1NIQURFUiwgcFZlcnRleFNvdXJjZSwgJnZlcnRleFNoYWRlcik7Ci0gICAgICAgICAgICBpZiAoSGFzRmF0YWxGYWlsdXJlKCkpIHsKLSAgICAgICAgICAgICAgICByZXR1cm47Ci0gICAgICAgICAgICB9Ci0gICAgICAgIH0KLSAgICAgICAgewotICAgICAgICAgICAgU0NPUEVEX1RSQUNFKCJjb21waWxpbmcgZnJhZ21lbnQgc2h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ICAgICAgICBpZiAoYnVmTGVuZ3RoKSB7Ci0gICAgICAgICAgICAgICAgICAgIGNoYXIqIGJ1ZiA9IChjaGFyKikgbWFsbG9jKGJ1Zkxlbmd0aCk7Ci0gICAgICAgICAgICAgICAgICAgIGlmIChidWYpIHsKLSAgICAgICAgICAgICAgICAgICAgICAgIGdsR2V0UHJvZ3JhbUluZm9Mb2cocHJvZ3JhbSwgYnVmTGVuZ3RoLCBOVUxMLCBidWYpOwotICAgICAgICAgICAgICAgICAgICAgICAgcHJpbnRmKCJQcm9ncmFtIGxpbmsgbG9nOlxuJXNcbiIsIGJ1Zik7Ci0gICAgICAgICAgICAgICAgICAgICAgICBmcmVlKGJ1Zik7Ci0gICAgICAgICAgICAgICAgICAgICAgICBGQUlMKCk7Ci0gICAgICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgZ2xEZWxldGVQcm9ncmFtKHByb2dyYW0pOwotICAgICAgICAgICAgICAgIHByb2dyYW0gPSAwOwotICAgICAgICAgICAgfQotICAgICAgICB9Ci0gICAgICAgIGdsRGVsZXRlU2hhZGVyKHZlcnRleFNoYWRlcik7Ci0gICAgICAgIGdsRGVsZXRlU2hhZGVyKGZyYWdtZW50U2hhZGVyKTsKLSAgICAgICAgQVNTRVJUX1RSVUUocHJvZ3JhbSAhPSAwKTsKLSAgICAgICAgKm91dFBnbSA9IHByb2dyYW07Ci0gICAgfQotCi0gICAgc3RhdGljIGludCBhYnMoaW50IHZhbHVlKSB7Ci0gICAgICAgIHJldHVybiB2YWx1ZSA+IDAgPyB2YWx1ZSA6IC12YWx1ZTsKLSAgICB9Ci0KLSAgICA6OnRlc3Rpbmc6OkFzc2VydGlvblJlc3VsdCBjaGVja1BpeGVsKGludCB4LCBpbnQgeSwgaW50IHIsCi0gICAgICAgICAgICBpbnQgZywgaW50IGIsIGludCBhLCBpbnQgdG9sZXJhbmNlPTIpIHsKLSAgICAgICAgR0x1Ynl0ZSBwaXh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fQotICAgICAgICAgICAgbXNnICs9IFN0cmluZzg6OmZvcm1hdCgiZyglZCBpc24ndCAlZCkiLCBwaXhlbFsxXSwgZyk7Ci0gICAgICAgIH0KLSAgICAgICAgaWYgKGIgPj0gMCAmJiBhYnMoYiAtIGludChwaXhlbFsyXSkpID4gdG9sZXJhbmNlKSB7Ci0gICAgICAgICAgICBpZiAoIW1zZy5pc0VtcHR5KCkpIHsKLSAgICAgICAgICAgICAgICBtc2cgKz0gIiAiOwotICAgICAgICAgICAgfQotICAgICAgICAgICAgbXNnICs9IFN0cmluZzg6OmZvcm1hdCgiYiglZCBpc24ndCAlZCkiLCBwaXhlbFsyXSwgYik7Ci0gICAgICAgIH0KLSAgICAgICAgaWYgKGEgPj0gMCAmJiBhYnMoYSAtIGludChwaXhlbFszXSkpID4gdG9sZXJhbmNlKSB7Ci0gICAgICAgICAgICBpZiAoIW1zZy5pc0VtcHR5KCkpIHsKLSAgICAgICAgICAgICAgICBtc2cgKz0gIiAiOwotICAgICAgICAgICAgfQotICAgICAgICAgICAgbXNnICs9IFN0cmluZzg6OmZvcm1hdCgiYSglZCBpc24ndCAlZCkiLCBwaXhlbFszXSwgYSk7Ci0gICAgICAgIH0KLSAgICAgICAgaWYgKCFtc2cuaXNFbXB0eSgpKSB7Ci0gICAgICAgICAgICBmcHJpbnRmKHN0ZGVyciwgInBpeGVsIGNoZWNrIGZhaWx1cmU6ICVzXG4iLCBtc2cuc3RyaW5nKCkpOwotICAgICAgICAgICAgcmV0dXJuIDo6dGVzdGluZzo6QXNzZXJ0aW9uRmFpbHVyZSgKLSAgICAgICAgICAgICAgICAgICAgOjp0ZXN0aW5nOjpNZXNzYWdlKG1zZy5zdHJpbmcoKSkpOwotICAgICAgICB9IGVsc2UgewotICAgICAgICAgICAgcmV0dXJuIDo6dGVzdGluZzo6QXNzZXJ0aW9uU3VjY2VzcygpOwotICAgICAgICB9Ci0gICAgfQotCi0gICAgaW50IG1EaXNwbGF5U2VjczsKLSAgICBzcDx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AgICAgICAgICAgICAgaWYgKHggKiAyIDwgdyAvIDIgJiYgeSAqIDIgPCBoIC8gMikgewotICAgICAgICAgICAgICAgICAgICBidWZbeXV2VGV4T2Zmc2V0ViArICh5KjIgKiB5dXZUZXhTdHJpZGVWKSArIHgqMiArIDBdID0KLSAgICAgICAgICAgICAgICAgICAgYnVmW3l1dlRleE9mZnNldFYgKyAoeSoyICogeXV2VGV4U3RyaWRlVikgKyB4KjIgKyAxXSA9Ci0gICAgICAgICAgICAgICAgICAgIGJ1Zlt5dXZUZXhPZmZzZXRWICsgKCh5KjIrMSkgKiB5dXZUZXhTdHJpZGVWKSArIHgqMiArIDBdID0KLSAgICAgICAgICAgICAgICAgICAgYnVmW3l1dlRleE9mZnNldFYgKyAoKHkqMisxKSAqIHl1dlRleFN0cmlkZVYpICsgeCoyICsgMV0gPQotICAgICAgICAgICAgICAgICAgICAgICAgaW50ZW5zaXR5OwotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgIH0KLSAgICAgICAgfQotICAgIH0KLX0KLQotLy8gRmlsbCBhIFlWMTIgYnVmZmVyIHdpdGggcmVkIG91dHNpZGUgYSBnaXZlbiByZWN0YW5nbGUgYW5kIGdyZWVuIGluc2lkZSBpdC4KLXZvaWQgU3VyZmFjZU1lZGlhU291cmNlVGVzdDo6ZmlsbFlWMTJCdWZmZXJSZWN0KHVpbnQ4X3QqIGJ1ZiwgaW50IHcsCi0gICAgICAgICAgICAgICAgICBpbnQgaCwgaW50IHN0cmlkZSwgY29uc3QgYW5kcm9pZF9uYXRpdmVfcmVjdF90JiByZWN0KSB7Ci0gICAgY29uc3QgaW50IHl1dlRleE9mZnNldFkgPSAwOwotICAgIGludCB5dXZUZXhTdHJpZGVZID0gc3RyaWRlOwotICAgIGludCB5dXZUZXhPZmZzZXRWID0geXV2VGV4U3RyaWRlWSAqIGg7Ci0gICAgaW50IHl1dlRleFN0cmlkZVYgPSAoeXV2VGV4U3RyaWRlWS8yICsgMHhmKSAmIH4weGY7Ci0gICAgaW50IHl1dlRleE9mZnNldFUgPSB5dXZUZXhPZmZzZXRWICsgeXV2VGV4U3RyaWRlViAqIGgvMjsKLSAgICBpbnQgeXV2VGV4U3RyaWRlVSA9IHl1dlRleFN0cmlkZVY7Ci0gICAgZm9yIChpbnQgeCA9IDA7IHggPCB3OyB4KyspIHsKLSAgICAgICAgZm9yIChpbnQgeSA9IDA7IHkgPCBoOyB5KyspIHsKLSAgICAgICAgICAgIGJvb2wgaW5zaWRlID0gcmVjdC5sZWZ0IDw9IHggJiYgeCA8IHJlY3QucmlnaHQgJiYKLSAgICAgICAgICAgICAgICAgICAgcmVjdC50b3AgPD0geSAmJiB5IDwgcmVjdC5ib3R0b207Ci0gICAgICAgICAgICBidWZbeXV2VGV4T2Zmc2V0WSArICh5ICogeXV2VGV4U3RyaWRlWSkgKyB4XSA9IGluc2lkZSA/IDI0MCA6IDY0OwotICAgICAgICAgICAgaWYgKHggPCB3IC8gMiAmJiB5IDwgaCAvIDIpIHsKLSAgICAgICAgICAgICAgICBib29sIGluc2lkZSA9IHJlY3QubGVmdCA8PSAyKnggJiYgMip4IDwgcmVjdC5yaWdodCAmJgotICAgICAgICAgICAgICAgICAgICAgICAgcmVjdC50b3AgPD0gMip5ICYmIDIqeSA8IHJlY3QuYm90dG9tOwotICAgICAgICAgICAgICAgIGJ1Zlt5dXZUZXhPZmZzZXRVICsgKHkgKiB5dXZUZXhTdHJpZGVVKSArIHhdID0gMTY7Ci0gICAgICAgICAgICAgICAgYnVmW3l1dlRleE9mZnNldFYgKyAoeSAqIHl1dlRleFN0cmlkZVYpICsgeF0gPQotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaW5zaWRlID8gMTYgOiAyNTU7Ci0gICAgICAgICAgICB9Ci0gICAgICAgIH0KLSAgICB9Ci19ICAvLy8vLy8vLy8gRW5kIG9mIGNsYXNzIFN1cmZhY2VNZWRpYVNvdXJjZVRlc3QKLQotLy8vLy8vLy8v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NlbGYKLSAgICAgICAgcGFyY2VsLT53cml0ZUludDMyKEtFWV9TVFJVQ1RfVEVYVCk7Ci0gICAgICAgIHBhcmNlbC0+d3JpdGVJbnQzMih0ZXh0TGVuKTsKLSAgICAgICAgcGFyY2VsLT53cml0ZUludDMyKHRleHRMZW4pOwotICAgICAgICBwYXJjZWwtPndyaXRlKGRhdGEgKyAyLCB0ZXh0TGVuKTsKLQotICAgICAgICBpZiAoc2l6ZSA+IHRleHRMZW4pIHsKLSAgICAgICAgICAgIGRhdGEgKz0gKHRleHRMZW4gKyAyKTsKLSAgICAgICAgICAgIHNpemUgLT0gKHRleHRMZW4gKyAyKTsKLSAgICAgICAgfSBlbHNlIHsKLSAgICAgICAgICAgIHJldHVybiBPSzsKLSAgICAgICAgfQotICAgIH0KLQotICAgIGNvbnN0IHVpbnQ4X3QgKnRtcERhdGEgPSBkYXRhOwotICAgIHNzaXplX3QgY2h1bmtTaXplID0gVTMyX0FUKHRtcERhdGEpOwotICAgIHVpbnQzMl90IGNodW5rVHlwZSA9IFUzMl9BVCh0bXBEYXRhICsgNCk7Ci0KLSAgICBpZiAoY2h1bmtTaXplIDw9IDApIHsKLSAgICAgICAgcmV0dXJuIE9LOwotICAgIH0KLQotICAgIHRtcERhdGEgKz0gODsKLQotICAgIHN3aXRjaChjaHVua1R5cGUpIHsKLSAgICAgICAgLy8gJ3N0eWwnIGJveCBzcGVjaWZpZXMgdGhlIHN0eWxlIG9mIHRoZSB0ZXh0LgotICAgICAgICBjYXNlIEZPVVJDQygncycsICd0JywgJ3knLCAnbCcpOgotICAgICAgICB7Ci0gICAgICAgICAgICB1aW50MTZfdCBjb3VudCA9IFUxNl9BVCh0bXBEYXRhKTsKLQotICAgICAgICAgICAgdG1wRGF0YSArPSAyOwotCi0gICAgICAgICAgICBmb3IgKGludCBpID0gMDsgaSA8IGNvdW50OyBpKyspIHsKLSAgICAgICAgICAgICAgICBwYXJjZWwtPndyaXRlSW50MzIoS0VZX1NUUlVDVF9TVFlMRV9MSVNUKTsKLSAgICAgICAgICAgICAgICBwYXJjZWwtPndyaXRlSW50MzIoS0VZX1NUQVJUX0NIQVIpOwotICAgICAgICAgICAgICAgIHBhcmNlbC0+d3JpdGVJbnQzMihVMTZfQVQodG1wRGF0YSkpOwotCi0gICAgICAgICAgICAgICAgcGFyY2VsLT53cml0ZUludDMyKEtFWV9FTkRfQ0hBUik7Ci0gICAgICAgICAgICAgICAgcGFyY2VsLT53cml0ZUludDMyKFUxNl9BVCh0bXBEYXRhICsgMikpOwotCi0gICAgICAgICAgICAgICAgcGFyY2VsLT53cml0ZUludDMyKEtFWV9GT05UX0lEKTsKLSAgICAgICAgICAgICAgICBwYXJjZWwtPndyaXRlSW50MzIoVTE2X0FUKHRtcERhdGEgKyA0KSk7Ci0KLSAgICAgICAgICAgICAgICBwYXJjZWwtPndyaXRlSW50MzIoS0VZX1NUWUxFX0ZMQUdTKTsKLSAgICAgICAgICAgICAgICBwYXJjZWwtPndyaXRlSW50MzIoKih0bXBEYXRhICsgNikpOwotCi0gICAgICAgICAgICAgICAgcGFyY2VsLT53cml0ZUludDMyKEtFWV9GT05UX1NJWkUpOwotICAgICAgICAgICAgICAgIHBhcmNlbC0+d3JpdGVJbnQzMigqKHRtcERhdGEgKyA3KSk7Ci0KLSAgICAgICAgICAgICAgICBwYXJjZWwtPndyaXRlSW50MzIoS0VZX1RFWFRfQ09MT1JfUkdCQSk7Ci0gICAgICAgICAgICAgICAgdWludDMyX3QgcmdiYSA9ICoodG1wRGF0YSArIDgpIDw8IDI0IHwgKih0bXBEYXRhICsgOSkgPDwgMTYKLSAgICAgICAgICAgICAgICAgICAgfCAqKHRtcERhdGEgKyAxMCkgPDwgOCB8ICoodG1wRGF0YSArIDExKTsKLSAgICAgICAgICAgICAgICBwYXJjZWwtPndyaXRlSW50MzIocmdiYSk7Ci0KLSAgICAgICAgICAgICAgICB0bXBEYXRhICs9IDEyOwotICAgICAgICAgICAgfQotCi0gICAgICAgICAgICBicmVhazsKLSAgICAgICAgfQotICAgICAgICAvLyAna3JvaycgYm94LiBUaGUgbnVtYmVyIG9mIGhpZ2hsaWdodCBldmVudHMgaXMgc3BlY2lmaWVkLCBhbmQgZWFjaAotICAgICAgICAvLyBldmVudCBpcyBzcGVjaWZpZWQgYnkgYSBzdGFydGluZyBhbmQgZW5kaW5nIGNoYXIgb2Zmc2V0IGFuZCBhbiBlbmQKLSAgICAgICAgLy8gdGltZSBmb3IgdGhlIGV2ZW50LgotICAgICAgICBjYXNlIEZPVVJDQygnaycsICdyJywgJ28nLCAnaycpOgotICAgICAgICB7Ci0KLSAgICAgICAgICAgIHBhcmNlbC0+d3JpdGVJbnQzMihLRVlfU1RSVUNUX0tBUkFPS0VfTElTVCk7Ci0KLSAgICAgICAgICAgIGludCBzdGFydFRpbWUgPSBVMzJfQVQodG1wRGF0YSk7Ci0gICAgICAgICAgICB1aW50MTZfdCBjb3VudCA9IFUxNl9BVCh0bXBEYXRhICsgNCk7Ci0gICAgICAgICAgICBwYXJjZWwtPndyaXRlSW50MzIoY291bnQpOwotCi0gICAgICAgICAgICB0bXBEYXRhICs9IDY7Ci0gICAgICAgICAgICBpbnQgbGFzdEVuZFRpbWUgPSAwOwotCi0gICAgICAgICAgICBmb3IgKGludCBpID0gMDsgaSA8IGNvdW50OyBpKyspIHsKLSAgICAgICAgICAgICAgICBwYXJjZWwtPndyaXRlSW50MzIoc3RhcnRUaW1lICsgbGFzdEVuZFRpbWUpOwotCi0gICAgICAgICAgICAgICAgbGFzdEVuZFRpbWUgPSBVMzJfQVQodG1wRGF0YSk7Ci0gICAgICAgICAgICAgICAgcGFyY2VsLT53cml0ZUludDMyKGxhc3RFbmRUaW1lKTsKLQotICAgICAgICAgICAgICAgIHBhcmNlbC0+d3JpdGVJbnQzMihVMTZfQVQodG1wRGF0YSArIDQpKTsKLSAgICAgICAgICAgICAgICBwYXJjZWwtPndyaXRlSW50MzIoVTE2X0FUKHRtcERhdGEgKyA2KSk7Ci0KLSAgICAgICAgICAgICAgICB0bXBEYXRhICs9IDg7Ci0gICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgIGJyZWFrOwotICAgICAgICB9Ci0gICAgICAgIC8vICdobGl0JyBib3ggc3BlY2lmaWVzIGhpZ2hsaWdodGVkIHRleHQKLSAgICAgICAgY2FzZSBGT1VSQ0MoJ2gnLCAnbCcsICdpJywgJ3QnKToKLSAgICAgICAgewotICAgICAgICAgICAgcGFyY2VsLT53cml0ZUludDMyKEtFWV9TVFJVQ1RfSElHSExJR0hUX0xJU1QpOwotCi0gICAgICAgICAgICAvLyB0aGUgc3RhcnQgY2hhciBvZmZzZXQgdG8gaGlnaGxpZ2h0Ci0gICAgICAgICAgICBwYXJjZWwtPndyaXRlSW50MzIoVTE2X0FUKHRtcERhdGEpKTsKLSAgICAgICAgICAgIC8vIHRoZSBsYXN0IGNoYXIgb2Zmc2V0IHRvIGhpZ2hsaWdodAotICAgICAgICAgICAgcGFyY2VsLT53cml0ZUludDMyKFUxNl9BVCh0bXBEYXRhICsgMikpOwotCi0gICAgICAgICAgICBicmVhazsKLSAgICAgICAgfQotICAgICAgICAvLyAnaGNscicgYm94IHNwZWNpZmllcyB0aGUgUkdCQSBjb2xvcjogOCBiaXRzIGVhY2ggb2YKLSAgICAgICAgLy8gcmVkLCBncmVlbiwgYmx1ZSwgYW5kIGFuIGFscGhhKHRyYW5zcGFyZW5jeSkgdmFsdWUKLSAgICAgICAgY2FzZSBGT1VSQ0MoJ2gnLCAnYycsICdsJywgJ3InKToKLSAgICAgICAgewotICAgICAgICAgICAgcGFyY2VsLT53cml0ZUludDMyKEtFWV9ISUdITElHSFRfQ09MT1JfUkdCQSk7Ci0KLSAgICAgICAgICAgIHVpbnQzMl90IHJnYmEgPSAqKHRtcERhdGEpIDw8IDI0IHwgKih0bXBEYXRhICsgMSkgPDwgMTYKLSAgICAgICAgICAgICAgICB8ICoodG1wRGF0YSArIDIpIDw8IDggfCAqKHRtcERhdGEgKyAzKTsKLSAgICAgICAgICAgIHBhcmNlbC0+d3JpdGVJbnQzMihyZ2JhKTsKLQotICAgICAgICAgICAgYnJlYWs7Ci0gICAgICAgIH0KLSAgICAgICAgLy8gJ2RsYXknIGJveCBzcGVjaWZpZXMgYSBkZWxheSBhZnRlciBhIHNjcm9sbCBpbiBhbmQvb3IKLSAgICAgICAgLy8gYmVmb3JlIHNjcm9sbCBvdXQuCi0gICAgICAgIGNhc2UgRk9VUkNDKCdkJywgJ2wnLCAnYScsICd5Jyk6Ci0gICAgICAgIHsKLSAgICAgICAgICAgIHBhcmNlbC0+d3JpdGVJbnQzMihLRVlfU0NST0xMX0RFTEFZKTsKLQotICAgICAgICAgICAgdWludDMyX3QgZGVsYXkgPSAqKHRtcERhdGEpIDw8IDI0IHwgKih0bXBEYXRhICsgMSkgPDwgMTYKLSAgICAgICAgICAgICAgICB8ICoodG1wRGF0YSArIDIpIDw8IDggfCAqKHRtcERhdGEgKyAzKTsKLSAgICAgICAgICAgIHBhcmNlbC0+d3JpdGVJbnQzMihkZWxheSk7Ci0KLSAgICAgICAgICAgIGJyZWFrOwotICAgICAgICB9Ci0gICAgICAgIC8vICdocmVmJyBib3ggZm9yIGh5cGVyIHRleHQgbGluawotICAgICAgICBjYXNlIEZPVVJDQygnaCcsICdyJywgJ2UnLCAnZicpOgotICAgICAgICB7Ci0gICAgICAgICAgICBwYXJjZWwtPndyaXRlSW50MzIoS0VZX1NUUlVDVF9IWVBFUl9URVhUX0xJU1QpOwotCi0gICAgICAgICAgICAvLyB0aGUgc3RhcnQgb2Zmc2V0IG9mIHRoZSB0ZXh0IHRvIGJlIGxpbmtlZAotICAgICAgICAgICAgcGFyY2VsLT53cml0ZUludDMyKFUxNl9BVCh0bXBEYXRhKSk7Ci0gICAgICAgICAgICAvLyB0aGUgZW5kIG9mZnNldCBvZiB0aGUgdGV4dAotICAgICAgICAgICAgcGFyY2VsLT53cml0ZUludDMyKFUxNl9BVCh0bXBEYXRhICsgMikpOwotCi0gICAgICAgICAgICAvLyB0aGUgbnVtYmVyIG9mIGJ5dGVzIGluIHRoZSBmb2xsb3dpbmcgVVJMCi0gICAgICAgICAgICBpbnQgbGVuID0gKih0bXBEYXRhICsgNCk7Ci0gICAgICAgICAgICBwYXJjZWwtPndyaXRlSW50MzIobGVuKTsKLQotICAgICAgICAgICAgLy8gdGhlIGxpbmtlZC10byBVUkwKLSAgICAgICAgICAgIHBhcmNlbC0+d3JpdGVJbnQzMihsZW4pOwotICAgICAgICAgICAgcGFyY2VsLT53cml0ZSh0bXBEYXRhICsgNSwgbGVuKTsKLQotICAgICAgICAgICAgdG1wRGF0YSArPSAoNSArIGxlbik7Ci0KLSAgICAgICAgICAgIC8vIHRoZSBudW1iZXIgb2YgYnl0ZXMgaW4gdGhlIGZvbGxvd2luZyAiYWx0IiBzdHJpbmcKLSAgICAgICAgICAgIGxlbiA9ICp0bXBEYXRhOwotICAgICAgICAgICAgcGFyY2VsLT53cml0ZUludDMyKGxlbik7Ci0KLSAgICAgICAgICAgIC8vIGFuICJhbHQiIHN0cmluZyBmb3IgdXNlciBkaXNwbGF5Ci0gICAgICAgICAgICBwYXJjZWwtPndyaXRlSW50MzIobGVuKTsKLSAgICAgICAgICAgIHBhcmNlbC0+d3JpdGUodG1wRGF0YSArIDEsIGxlbik7Ci0KLSAgICAgICAgICAgIGJyZWFrOwotICAgICAgICB9Ci0gICAgICAgIC8vICd0Ym94JyBib3ggdG8gaW5kaWNhdGUgdGhlIHBvc2l0aW9uIG9mIHRoZSB0ZXh0IHdpdGggdmFsdWVzCi0gICAgICAgIC8vIG9mIHRvcCwgbGVmdCwgYm90dG9tIGFuZCByaWdodAotICAgICAgICBjYXNlIEZPVVJDQygndCcsICdiJywgJ28nLCAneCcpOgotICAgICAgICB7Ci0gICAgICAgICAgICBwYXJjZWwtPndyaXRlSW50MzIoS0VZX1NUUlVDVF9URVhUX1BPUyk7Ci0gICAgICAgICAgICBwYXJjZWwtPndyaXRlSW50MzIoVTE2X0FUKHRtcERhdGEpKTsKLSAg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ICAgICAgcGFyY2VsLT53cml0ZUludDMyKEtFWV9HTE9CQUxfU0VUVElORyk7Ci0gICAgfQotICAgIHN3aXRjaChjaHVua1R5cGUpIHsKLSAgICAgICAgY2FzZSBGT1VSQ0MoJ3QnLCAneCcsICczJywgJ2cnKToKLSAgICAgICAgewotICAgICAgICAgICAgdG1wRGF0YSArPSA4OyAvLyBza2lwIHRoZSBmaXJzdCA4IGJ5dGVzCi0gICAgICAgICAgICBwYXJjZWwtPndyaXRlSW50MzIoS0VZX0RJU1BMQVlfRkxBR1MpOwotICAgICAgICAgICAgcGFyY2VsLT53cml0ZUludDMyKFUzMl9BVCh0bXBEYXRhKSk7Ci0KLSAgICAgICAgICAgIHBhcmNlbC0+d3JpdGVJbnQzMihLRVlfU1RSVUNUX0pVU1RJRklDQVRJT04pOwotICAgICAgICAgICAgcGFyY2VsLT53cml0ZUludDMyKHRtcERhdGFbNF0pOwotICAgICAgICAgICAgcGFyY2VsLT53cml0ZUludDMyKHRtcERhdGFbNV0pOwotCi0gICAgICAgICAgICBwYXJjZWwtPndyaXRlSW50MzIoS0VZX0JBQ0tHUk9VTkRfQ09MT1JfUkdCQSk7Ci0gICAgICAgICAgICB1aW50MzJfdCByZ2JhID0gKih0bXBEYXRhICsgNikgPDwgMjQgfCAqKHRtcERhdGEgKyA3KSA8PCAxNgotICAgICAgICAgICAgICAgIHwgKih0bXBEYXRhICsgOCkgPDwgOCB8ICoodG1wRGF0YSArIDkpOwotICAgICAgICAgICAgcGFyY2VsLT53cml0ZUludDMyKHJnYmEpOwotCi0gICAgICAgICAgICB0bXBEYXRhICs9IDEwOwotICAgICAgICAgICAgcGFyY2VsLT53cml0ZUludDMyKEtFWV9TVFJVQ1RfVEVYVF9QT1MpOwotICAgICAgICAgICAgcGFyY2VsLT53cml0ZUludDMyKFUxNl9BVCh0bXBEYXRhKSk7Ci0gICAgICAgICAgICBwYXJjZWwtPndyaXRlSW50MzIoVTE2X0FUKHRtcERhdGEgKyAyKSk7Ci0gICAgICAgICAgICBwYXJjZWwtPndyaXRlSW50MzIoVTE2X0FUKHRtcERhdGEgKyA0KSk7Ci0gICAgICAgICAgICBwYXJjZWwtPndyaXRlSW50MzIoVTE2X0FUKHRtcERhdGEgKyA2KSk7Ci0KLSAgICAgICAgICAgIHRtcERhdGEgKz0gODsKLSAgICAgICAgICAgIHBhcmNlbC0+d3JpdGVJbnQzMihLRVlfU1RSVUNUX1NUWUxFX0xJU1QpOwotICAgICAgICAgICAgcGFyY2VsLT53cml0ZUludDMyKEtFWV9TVEFSVF9DSEFSKTsKLSAgICAgICAgICAgIHBhcmNlbC0+d3JpdGVJbnQzMihVMTZfQVQodG1wRGF0YSkpOwotCi0gICAgICAgICAgICBwYXJjZWwtPndyaXRlSW50MzIoS0VZX0VORF9DSEFSKTsKLSAgICAgICAgICAgIHBhcmNlbC0+d3JpdGVJbnQzMihVMTZfQVQodG1wRGF0YSArIDIpKTsKLQotICAgICAgICAgICAgcGFyY2VsLT53cml0ZUludDMyKEtFWV9GT05UX0lEKTsKLSAgICAgICAgICAgIHBhcmNlbC0+d3JpdGVJbnQzMihVMTZfQVQodG1wRGF0YSArIDQpKTsKLQotICAgICAgICAgICAgcGFyY2VsLT53cml0ZUludDMyKEtFWV9TVFlMRV9GTEFHUyk7Ci0gICAgICAgICAgICBwYXJjZWwtPndyaXRlSW50MzIoKih0bXBEYXRhICsgNikpOwotCi0gICAgICAgICAgICBwYXJjZWwtPndyaXRlSW50MzIoS0VZX0ZPTlRfU0laRSk7Ci0gICAgICAgICAgICBwYXJjZWwtPndyaXRlSW50MzIoKih0bXBEYXRhICsgNykpOwotCi0gICAgICAgICAgICBwYXJjZWwtPndyaXRlSW50MzIoS0VZX1RFWFRfQ09MT1JfUkdCQSk7Ci0gICAgICAgICAgICByZ2JhID0gKih0bXBEYXRhICsgOCkgPDwgMjQgfCAqKHRtcERhdGEgKyA5KSA8PCAxNgotICAgICAgICAgICAgICAgIHwgKih0bXBEYXRhICsgMTApIDw8IDggfCAqKHRtcERhdGEgKyAxMSk7Ci0gICAgICAgICAgICBwYXJjZWwtPndyaXRlSW50MzIocmdiYSk7Ci0KLSAgICAgICAgICAgIHRtcERhdGEgKz0gMTI7Ci0gICAgICAgICAgICBwYXJjZWwtPndyaXRlSW50MzIoS0VZX1NUUlVDVF9GT05UX0xJU1QpOwotICAgICAgICAgICAgdWludDE2X3QgY291bnQgPSBVMTZfQVQodG1wRGF0YSk7Ci0gICAgICAgICAgICBwYXJjZWwtPndyaXRlSW50MzIoY291bnQpOwotCi0gICAgICAgICAgICB0bXBEYXRhICs9IDI7Ci0gICAgICAgICAgICBmb3IgKGludCBpID0gMDsgaSA8IGNvdW50OyBpKyspIHsKLSAgICAgICAgICAgICAgICAvLyBmb250IElECi0gICAgICAgICAgICAgICAgcGFyY2VsLT53cml0ZUludDMyKFUxNl9BVCh0bXBEYXRhKSk7Ci0KLSAgICAgICAgICAgICAgICAvLyBmb250IG5hbWUgbGVuZ3RoCi0gICAgICAgICAgICAgICAgcGFyY2VsLT53cml0ZUludDMyKCoodG1wRGF0YSArIDIpKTsKLQotICAgICAgICAgICAgICAgIGludCBsZW4gPSAqKHRtcERhdGEgKyAyKTsKLQotICAgICAgICAgICAgICAgIHBhcmNlbC0+d3JpdGUodG1wRGF0YSArIDMsIGxlbik7Ci0gICAgICAgICAgICAgICAgdG1wRGF0YSArPSAzICsgbGVuOwotICAgICAgICAgICAgfQotCi0gICAgICAgICAgICBicmVhazsKLSAgICAgICAgfQotICAgICAgICBkZWZhdWx0OgotICAgICAgICB7Ci0gICAgICAgICAgICBicmVhazsKLSAgICAgICAgfQotICAgIH0KLQotICAgIGRhdGEgKz0gY2h1bmtTaXplOwotICAgIHNpemUgLT0gY2h1bmtTaXplOwotCi0gICAgaWYgKHNpemUgPiAwKSB7Ci0gICAgICAgIC8vIGNvbnRpbnVlIHRvIGV4dHJhY3QgbmV4dCAndHgzZycKLSAgICAgICAgcmV0dXJuIGV4dHJhY3QzR1BQR2xvYmFsRGV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biBzeW5jIHdpdGggdGhlIGtleXMgaW4gVGltZWRUZXh0LmphdmEKLSAgICAgICAgS0VZX0RJU1BMQVlfRkxBR1MgICAgICAgICAgICAgICAgID0gMSwgLy8gaW50Ci0gICAgICAgIEtFWV9TVFlMRV9GTEFHUyAgICAgICAgICAgICAgICAgICA9IDIsIC8vIGludAotICAgICAgICBLRVlfQkFDS0dST1VORF9DT0xPUl9SR0JBICAgICAgICAgPSAzLCAvLyBpbnQKLSAgICAgICAgS0VZX0hJR0hMSUdIVF9DT0xPUl9SR0JBICAgICAgICAgID0gNCwgLy8gaW50Ci0gICAgICAgIEtFWV9TQ1JPTExfREVMQVkgICAgICAgICAgICAgICAgICA9IDUsIC8vIGludAotICAgICAgICBLRVlfV1JBUF9URVhUICAgICAgICAgICAgICAgICAgICAgPSA2LCAvLyBpbnQKLSAgICAgICAgS0VZX1NUQVJUX1RJTUUgICAgICAgICAgICAgICAgICAgID0gNywgLy8gaW50Ci0gICAgICAgIEtFWV9TVFJVQ1RfQkxJTktJTkdfVEVYVF9MSVNUICAgICA9IDgsIC8vIExpc3Q8Q2hhclBvcz4KLSAgICAgICAgS0VZX1NUUlVDVF9GT05UX0xJU1QgICAgICAgICAgICAgID0gOSwgLy8gTGlzdDxGb250PgotICAgICAgICBLRVlfU1RSVUNUX0hJR0hMSUdIVF9MSVNUICAgICAgICAgPSAxMCwgLy8gTGlzdDxDaGFyUG9zPgotICAgICAgICBLRVlfU1RSVUNUX0hZUEVSX1RFWFRfTElTVCAgICAgICAgPSAxMSwgLy8gTGlzdDxIeXBlclRleHQ+Ci0gICAgICAgIEtFWV9TVFJVQ1RfS0FSQU9LRV9MSVNUICAgICAgICAgICA9IDEyLCAvLyBMaXN0PEthcmFva2U+Ci0gICAgICAgIEtFWV9TVFJVQ1RfU1RZTEVfTElTVCAgICAgICAgICAgICA9IDEzLCAvLyBMaXN0PFN0eWxlPgotICAgICAgICBLRVlfU1RSVUNUX1RFWFRfUE9TICAgICAgICAgICAgICAgPSAxNCwgLy8gVGV4dFBvcwotICAgICAgICBLRVlfU1RSVUNUX0pVU1RJRklDQVRJT04gICAgICAgICAgPSAxNSwgLy8gSnVzdGlmaWNhdGlvbgotICAgICAgICBLRVlfU1RSVUNUX1RFWFQgICAgICAgICAgICAgICAgICAgPSAxNiwgLy8gVGV4dAotCi0gICAgICAgIEtFWV9HTE9CQUxfU0VUVElORyAgICAgICAgICAgICAgICA9IDEwMSwKLSAgICAgICAgS0VZX0xPQ0FMX1NFVFRJTkcgICAgICAgICAgICAgICAgID0gMTAyLAotICAgICAgICBLRVlfU1RBUlRfQ0hBUiAgICAgICAgICAgICAgICAgICAgPSAxMDMsCi0gICAgICAgIEtFWV9FTkRfQ0hBUiAgICAgICAgICAgICAgICAgICAgICA9IDEwNCwKLSAgICAgICAgS0VZX0ZPTlRfSUQgICAgICAgICAgICAgICAgICAgICAgID0gMTA1LAotICAgICAgICBLRVlfRk9OVF9TSVpFICAgICAgICAgICAgICAgICAgICAgPSAxMDYsCi0gICAgICAgIEtFWV9URVhUX0NPTE9SX1JHQkEgICAgICAgICAgICAgICA9IDEwNywKLSAgICB9OwotCi0gICAgc3RhdGljIHN0YXR1c190IGV4dHJhY3RTUlRMb2NhbERlc2NyaXB0aW9ucygKLSAgICAgICAgICAgIGNvbnN0IHVpbnQ4X3QgKmRhdGEsIHNzaXplX3Qgc2l6ZSwKLSAgICAgICAgICAgIGludCB0aW1lTXMsIFBhcmNlbCAqcGFyY2VsKTsKLSAgICBzdGF0aWMgc3RhdHVzX3QgZXh0cmFjdDNHUFBHbG9iYWxEZXNjcmlwdGlvbnMoCi0gICAgICAgICAgICBjb25zdCB1aW50OF90ICpkYXRhLCBzc2l6ZV90IHNpemUsCi0gICAgICAgICAgICBQYXJjZWwgKnBhcmNlbCwgaW50IGRlcHRoKTsKLSAgICBzdGF0aWMgc3RhdHVzX3QgZXh0cmFjdDNHUFBMb2NhbERlc2NyaXB0aW9ucygKLSAgICAgICAgICAgIGNvbnN0IHV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ICAgICAgIHNlZWtUaW1lVXMgPSBwb3NpdGlvbk1zICogMTAwMGxsOwotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgIH0KLSAgICAgICAgICAgIGRvU2Vla0FuZFJlYWQoc2Vla1RpbWVVcyk7Ci0gICAgICAgICAgICBicmVhazsKLSAgICAgICAgfQotICAgICAgICBjYXNlIGtXaGF0U2VuZFN1YnRpdGxlOiB7Ci0gICAgICAgICAgICBpbnQzMl90IGdlbmVyYXRpb247Ci0gICAgICAgICAgICBDSEVDSyhtc2ctPmZpbmRJbnQzMigiZ2VuZXJhdGlvbiIsICZnZW5lcmF0aW9uKSk7Ci0gICAgICAgICAgICBpZiAoZ2VuZXJhdGlvbiAhPSBtU2VuZFN1YnRpdGxlR2VuZXJhdGlvbikgewotICAgICAgICAgICAgICAvLyBEcm9wIG9ic29sZXRlIG1zZy4KLSAgICAgICAgICAgICAgYnJlYWs7Ci0gICAgICAgICAgICB9Ci0gICAgICAgICAgICBzcDxSZWZCYXNlPiBvYmo7Ci0gICAgICAgICAgICBtc2ctPmZpbmRPYmplY3QoInN1YnRpdGxlIiwgJm9iaik7Ci0gICAgICAgICAgICBpZiAob2JqICE9IE5VTEwpIHsKLSAgICAgICAgICAgICAgICBzcDxQYXJjZWxFdmVudD4gcGFyY2VsRXZlbnQ7Ci0gICAgICAgICAgICAgICAgcGFyY2VsRXZlbnQgPSBzdGF0aWNfY2FzdDxQYXJjZWxFdmVudCo+KG9iai5nZXQoKSk7Ci0gICAgICAgICAgICAgICAgbm90aWZ5TGlzdGVuZXIoJihwYXJjZWxFdmVudC0+cGFyY2VsKSk7Ci0gICAgICAgICAgICB9IGVsc2UgewotICAgICAgICAgICAgICAgIG5vdGlmeUxpc3RlbmVyKCk7Ci0gICAgICAgICAgICB9Ci0gICAgICAgICAgICBkb1JlYWQoKTsKLSAgICAgICAgICAgIGJyZWFrOwotICAgICAgICB9Ci0gICAgICAgIGNhc2Uga1doYXRTZXRTb3VyY2U6IHsKLSAgICAgICAgICAgIHNwPFJlZkJhc2U+IG9iajsKLSAgICAgICAgICAgIG1zZy0+ZmluZE9iamVjdCgic291cmNlIiwgJm9iaik7Ci0gICAgICAgICAgICBpZiAob2JqID09IE5VTEwpIGJyZWFrOwotICAgICAgICAgICAgaWYgKG1Tb3VyY2UgIT0gTlVMTCkgewotICAgICAgICAgICAgICAgIG1Tb3VyY2UtPnN0b3AoKTsKLSAgICAgICAgICAgIH0KLSAgICAgICAgICAgIG1Tb3VyY2UgPSBzdGF0aWNfY2FzdDxUaW1lZFRleHRTb3VyY2UqPihvYmouZ2V0KCkpOwotICAgICAgICAgICAgc3RhdHVzX3QgZXJyID0gbVNvdXJjZS0+c3RhcnQoKTsKLSAgICAgICAgICAgIGlmIChlcnIgIT0gT0spIHsKLSAgICAgICAgICAgICAgICBub3RpZnlFcnJvcihlcnIpOwotICAgICAgICAgICAgICAgIGJyZWFrOwotICAgICAgICAgICAgfQotICAgICAgICAgICAgUGFyY2VsIHBhcmNlbDsKLSAgICAgICAgICAgIGVyciA9IG1Tb3VyY2UtPmV4dHJhY3RHbG9iYWxEZXNjcmlwdGlvbnMoJnBhcmNlbCk7Ci0gICAgICAgICAgICBpZiAoZXJyICE9IE9LKSB7Ci0gICAgICAgICAgICAgICAgbm90aWZ5RXJyb3IoZXJyKTsKLSAgICAgICAgICAgICAgICBicmVhazsKLSAgICAgICAgICAgIH0KLSAgICAgICAgICAgIG5vdGlmeUxpc3RlbmVyKCZwYXJjZWwpOwotICAgICAgICAgICAgYnJlYWs7Ci0gICAgICAgIH0KLSAgICB9Ci19Ci0KLXZvaWQgVGltZWRUZXh0UGxheWVyOjpkb1NlZWtBbmRSZWFkKGludDY0X3Qgc2Vla1RpbWVVcykgewotICAgIE1lZGlhU291cmNlOjpSZWFkT3B0aW9ucyBvcHRpb25zOwotICAgIG9wdGlvbnMuc2V0U2Vla1RvKHNlZWtUaW1lVXMsIE1lZGlhU291cmNlOjpSZWFkT3B0aW9uczo6U0VFS19QUk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UVEOwotICAgIH0KLQotICAgIGluZm8tPm9mZnNldCA9ICpvZmZzZXQ7Ci0gICAgYm9vbCBuZWVkTW9yZURhdGEgPSB0cnVlOwotICAgIHdoaWxlIChuZWVkTW9yZURhdGEpIHsKLSAgICAgICAgaWYgKChlcnIgPSByZWFkTmV4dExpbmUob2Zmc2V0LCAmZGF0YSkpICE9IE9LKSB7Ci0gICAgICAgICAgICBpZiAoZXJyID09IEVSUk9SX0VORF9PRl9TVFJFQU0pIHsKLSAgICAgICAgICAgICAgICBuZWVkTW9yZURhdGEgPSBmYWxzZTsKLSAgICAgICAgICAgIH0gZWxzZSB7Ci0gICAgICAgICAgICAgICAgcmV0dXJuIGVycjsKLSAgICAgICAgICAgIH0KLSAgICAgICAgfQotCi0gICAgICAgIGlmIChuZWVkTW9yZURhdGEpIHsKLSAgICAgICAgICAgIGRhdGEudHJpbSgpOwotICAgICAgICAgICAgaWYgKGRhdGEuZW1wdHkoKSkgewotICAgICAgICAgICAgICAgIC8vIGl0J3MgYW4gZW1wdHkgbGluZSB1c2VkIHRvIHNlcGFyYXRlIHR3byBzdWJ0aXRsZXMKLSAgICAgICAgICAgICAgICBuZWVkTW9yZURhdGEgPSBmYWxzZTsKLSAgICAgICAgICAgIH0KLSAgICAgICAgfQotICAgIH0KLSAgICBpbmZvLT50ZXh0TGVuID0gKm9mZnNldCAtIGluZm8tPm9mZnNldDsKLSAgICByZXR1cm4gT0s7Ci19Ci0KLXN0YXR1c190IFRpbWVkVGV4dFNSVFNvdXJjZTo6cmVhZE5leHRMaW5lKG9mZjY0X3QgKm9mZnNldCwgQVN0cmluZyAqZGF0YSkgewotICAgIGRhdGEtPmNsZWFyKCk7Ci0gICAgd2hpbGUgKHRydWUpIHsKLSAgICAgICAgc3NpemVfdCByZWFkU2l6ZTsKLSAgICAgICAgY2hhciBjaGFyYWN0ZXI7Ci0gICAgICAgIGlmICgocmVhZFNpemUgPSBtU291cmNlLT5yZWFkQXQoKm9mZnNldCwgJmNoYXJhY3RlciwgMSkpIDwgMSkgewotICAgICAgICAgICAgaWYgKHJlYWRTaXplID09IDApIHsKLSAgICAgICAgICAgICAgICByZXR1cm4gRVJST1JfRU5EX09GX1NUUkVBTTsKLSAgICAgICAgICAgIH0KLSAgICAgICAgICAgIHJldHVybiBFUlJPUl9JTzsKLSAgICAgICAgfQotCi0gICAgICAgICgqb2Zmc2V0KSsrOwotCi0gICAgICAgIC8vIGEgbGluZSBjb3VsZCBlbmQgd2l0aCBDUiwgTEYgb3IgQ1IgKyBMRgotICAgICAgICBpZiAoY2hhcmFjdGVyID09IDEwKSB7Ci0gICAgICAgICAgICBicmVhazsKLSAgICAgICAgfSBlbHNlIGlmIChjaGFyYWN0ZXIgPT0gMTMpIHsKLSAgICAgICAgICAgIGlmICgocmVhZFNpemUgPSBtU291cmNlLT5yZWFkQXQoKm9mZnNldCwgJmNoYXJhY3RlciwgMSkpIDwgMSkgewotICAgICAgICAgICAgICAgIGlmIChyZWFkU2l6ZSA9PSAwKSB7ICAvLyBlbmQgb2YgdGhlIHN0cmVhbQotICAgICAgICAgICAgICAgICAgICByZXR1cm4gT0s7Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgIHJldHVybiBFUlJPUl9JTzsKLSAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgKCpvZmZzZXQpKys7Ci0gICAgICAgICAgICBpZiAoY2hhcmFjdGVyICE9IDEwKSB7Ci0gICAgICAgICAgICAgICAgKCpvZmZzZXQpLS07Ci0gICAgICAgICAgICB9Ci0gICAgICAgICAgICBicmVhazsKLSAgICAgICAgfQotICAgICAgICBkYXRhLT5hcHBlbmQoY2hhcmFjdGVyKTsKLSAgICB9Ci0gICAgcmV0dXJuIE9LOwotfQotCi1zdGF0dXNfdCBUaW1lZFRleHRTUlRTb3VyY2U6OmdldFRleHQoCi0gICAgICAgIGNvbnN0IE1lZGlhU291cmNlOjpSZWFkT3B0aW9ucyAqb3B0aW9ucywKLSAgICAgICAgQVN0cmluZyAq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AgICAgICAgICBjdXJyVGltZVVzID0gbVRleHRWZWN0b3Iua2V5QXQobWlkKTsKLSAgICAgICAgICAgICAgICBjb25zdCBpbnQgZGlmZiA9IGN1cnJUaW1lVXMgLSBzZWVrVGltZVVzOwotCi0gICAgICAgICAgICAgICAgaWYgKGRpZmYgPT0gMCkgewotICAgICAgICAgICAgICAgICAgICBicmVhazsKLSAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKGRpZmYgPCAwKSB7Ci0gICAgICAgICAgICAgICAgICAgIGxvdyA9IG1pZCArIDE7Ci0gICAgICAgICAgICAgICAgfSBlbHNlIHsKLSAgICAgICAgICAgICAgICAgICAgaWYgKChoaWdoID09IG1pZCArIDEpCi0gICAgICAgICAgICAgICAgICAgICAgICAmJiAoc2Vla1RpbWVVcyA8IG1UZXh0VmVjdG9yLmtleUF0KGhpZ2gpKSkgewotICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7Ci0gICAgICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICAgICAgaGlnaCA9IG1pZCAtIDE7Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgfQotICAgICAgICAgICAgbUluZGV4ID0gbWlkOwotICAgICAgICB9Ci0gICAgfQotICAgIGNvbnN0IFRleHRJbmZvICZpbmZvID0gbVRleHRWZWN0b3IudmFsdWVBdChtSW5kZXgpOwotICAgICpzdGFydFRpbWVVcyA9IG1UZXh0VmVjdG9yLmtleUF0KG1JbmRleCk7Ci0gICAgKmVuZFRpbWVVcyA9IGluZm8uZW5kVGltZVVzOwotICAgIG1JbmRleCsrOwotCi0gICAgY2hhciAqc3RyID0gbmV3IGNoYXJbaW5mby50ZXh0TGVuXTsKLSAgICBpZiAobVNvdXJjZS0+cmVhZEF0KGluZm8ub2Zmc2V0LCBzdHIsIGluZm8udGV4dExlbikgPCBpbmZvLnRleHRMZW4pIHsKLSAgICAgICAgZGVsZXRlW10gc3RyOwotICAgICAgICByZXR1cm4gRVJST1JfSU87Ci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BtdXN0IG5vIGxvbmdlciB1c2UgdGhlIGNvbnRleHQKKyAgICAgKiBvciBhbnkgb2YgaXRzIGJvdW5kIGVmZmVjdHMgYWZ0ZXIgY2FsbGluZyByZWxlYXNlKCkuPC9wPgorICAgICAqCisgICAgICogPHA+Tm90ZSB0aGF0IHRoaXMgbWV0aG9kIG11c3QgYmUgY2FsbGVkIHdpdGggdGhlIHByb3BlciBFR0wgY29udGV4dCBtYWRlIGN1cnJlbnQsIGFzIHRoZQorICAgICAqIEVmZmVjdENvbnRleHQgYW5kIGl0cyBlZmZlY3RzIG1heSByZWxlYXNlIGludGVybmFsIEdMIHJlc291cmNlcy48L3A+CisgICAgICovCisgICAgcHVibGljIHZvaWQgcmVsZWFzZSgpIHsKKyAgICAgICAgbUZpbHRlckNvbnRleHQudGVhckRvd24oKTsKKyAgICAgICAgbUZpbHRlckNvbnRleHQgPSBudWxsOworICAgIH0KKworICAgIHByaXZhdGUgRWZmZWN0Q29udGV4dCgpIHsKKyAgICAgICAgbUZpbHRlckNvbnRleHQgPSBuZXcgRmlsdGVyQ29udGV4dCgpOworICAgICAgICBtRmlsdGVyQ29udGV4dC5zZXRGcmFtZU1hbmFnZXIobmV3IENhY2hlZEZyYW1lTWFuYWdlcigpKTsKKyAgICAgICAgbUZhY3RvcnkgPSBuZXcgRWZmZWN0RmFjdG9yeSh0aGlzKTsKKyAgICB9CisKKyAgICBwcml2YXRlIHZvaWQgaW5pdEluQ3VycmVudEdsQ29udGV4dCgpIHsKKyAgICAgICAgaWYgKCFHTEVudmlyb25tZW50LmlzQW55Q29udGV4dEFjdGl2ZSgpKSB7CisgICAgICAgICAgICB0aHJvdyBuZXcgUnVudGltZUV4Y2VwdGlvbigiQXR0ZW1wdGluZyB0byBpbml0aWFsaXplIEVmZmVjdENvbnRleHQgd2l0aCBubyBhY3RpdmUgIgorICAgICAgICAgICAgICAgICsgIkdMIGNvbnRleHQhIik7CisgICAgICAgIH0KKyAgICAgICAgR0xFbnZpcm9ubWV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0tBR0VTKSB7CisgICAgICAgICAgICB0cnkgeworICAgICAgICAgICAgICAgIGVmZmVjdENsYXNzID0gY29udGV4dENsYXNzTG9hZGVyLmxvYWRDbGFzcyhwYWNrYWdlTmFtZSArIGNsYXNzTmFtZSk7CisgICAgICAgICAgICB9IGNhdGNoIChDbGFzc05vdEZvdW5kRXhjZXB0aW9uIGUpIHsKKyAgICAgICAgICAgICAgICBjb250aW51ZTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIC8vIEV4aXQgbG9vcCBpZiBjbGFzcyB3YXMgZm91bmQuCisgICAgICAgICAgICBpZiAoZWZmZWN0Q2xhc3MgIT0gbnVsbCkgeworICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgICAgIHJldHVybiBlZmZlY3RDbGFzczsKKyAgICB9CisKKyAgICBwcml2YXRlIEVmZmVjdCBpbnN0YW50aWF0ZUVmZmVjdChDbGFzcyBlZmZlY3RDbGFzcywgU3RyaW5nIG5hbWUpIHsKKyAgICAgICAgLy8gTWFrZSBzdXJlIHRoaXMgaXMgYW4gRWZmZWN0IHN1YmNsYXNzCisgICAgICAgIHRyeSB7CisgICAgICAgICAgICBlZmZlY3RDbGFzcy5hc1N1YmNsYXNzKEVmZmVjdC5jbGFzcyk7CisgICAgICAgIH0gY2F0Y2ggKENsYXNzQ2FzdEV4Y2VwdGlvbiBlKSB7CisgICAgICAgICAgICB0aHJvdyBuZXcgSWxsZWdhbEFyZ3VtZW50RXhjZXB0aW9uKCJBdHRlbXB0aW5nIHRvIGFsbG9jYXRlIGVmZmVjdCAnIiArIGVmZmVjdENsYXNzCisgICAgICAgICAgICAgICAgKyAiJyB3aGljaCBpcyBub3QgYSBzdWJjbGFzcyBvZiBFZmZlY3QhIiwgZSk7CisgICAgICAgIH0KKworICAgICAgICAvLyBMb29rIGZvciB0aGUgY29ycmVjdCBjb25zdHJ1Y3RvcgorICAgICAgICBDb25zdHJ1Y3RvciBlZmZl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yAgICBwcm90ZWN0ZWQgdm9pZCBlbmRHTEVmZmVjdCgpIHsKKyAgICAgICAgbUVmZmVjdENvbnRleHQucmVzdG9yZUdMU3RhdGUoKTsKKyAgICB9CisKKyAgICAvKioKKyAgICAgKiBSZXR1cm5zIHRoZSBhY3RpdmUgZmlsdGVyIGNvbnRleHQgZm9yIHRoaXMgZWZmZWN0LgorICAgICAqLworICAgIHByb3RlY3RlZCBGaWx0ZXJDb250ZXh0IGdldEZpbHRlckNvbnRleHQoKSB7CisgICAgICAgIHJldHVybiBtRWZmZWN0Q29udGV4dC5tRmlsdGVyQ29udGV4dDsKKyAgICB9CisKKyAgICAvKioKKyAgICAgKiBDb252ZXJ0cyBhIHRleHR1cmUgaW50byBhIEZyYW1lLgorICAgICAqLworICAgIHByb3RlY3RlZCBGcmFtZSBmcmFtZUZyb21UZXh0dXJlKGludCB0ZXhJZCwgaW50IHdpZHRoLCBpbnQgaGVpZ2h0KSB7CisgICAgICAgIEZyYW1lTWFuYWdlciBtYW5hZ2VyID0gZ2V0RmlsdGVyQ29udGV4dCgpLmdldEZyYW1lTWFuYWdlcigpOworICAgICAgICBGcmFtZUZvcm1hdCBmb3JtYXQgPSBJbWFnZUZvcm1hdC5jcmVhdGUod2lkdGgsIGhlaWdodCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEltYWdlRm9ybWF0LkNPTE9SU1BBQ0VfUkdCQSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEZyYW1lRm9ybWF0LlRBUkdFVF9HUFUpOworICAgICAgICBGcmFtZSBmcmFtZSA9IG1hbmFnZXIubmV3Qm91bmRGcmFtZShmb3JtYXQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEdMRnJhbWUuRVhJU1RJTkdfVEVYVFVSRV9CSU5ESU5HLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC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ibGljIEZpbHRlckdyYXBoRWZmZWN0KEVmZmVjdENvbnRleHQgY29udGV4dCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFN0cmluZyBuYW1lLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgU3RyaW5nIGdyYXBoU3RyaW5nLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgU3RyaW5nIGlucHV0TmFtZSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFN0cmluZyBvdXRwdXROYW1lLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgQ2xhc3Mgc2NoZWR1bGVyKSB7CisgICAgICAgIHN1cGVyKGNvbnRleHQsIG5hbWUpOworCisgICAgICAgIG1JbnB1dE5hbWUgPSBpbnB1dE5hbWU7CisgICAgICAgIG1PdXRwdXROYW1lID0gb3V0cHV0TmFtZTsKKyAgICAgICAgbVNjaGVkdWxlckNsYXNzID0gc2NoZWR1bGVyOworICAgICAgICBjcmVhdGVHcmFwaChncmFwaFN0cmluZyk7CisKKyAgICB9CisKKyAgICBwcml2YXRlIHZvaWQgY3JlYXRlR3JhcGgoU3RyaW5nIGdyYXBoU3RyaW5nKSB7CisgICAgICAgIEdyYXBoUmVhZGVyIHJlYWRlciA9IG5ldyBUZXh0R3JhcGhSZWFkZXIoKTsKKyAgICAgICAgdHJ5IHsKKyAgICAgICAgICAgIG1HcmFwaCA9IHJlYWRlci5yZWFkR3JhcGhTdHJpbmcoZ3JhcGhTdHJpbmcpOworICAgICAgICB9IGNhdGNoIChHcmFwaElPRXhjZXB0aW9uIGUpIHsKKyAgICAgICAgICAgIHRocm93IG5ldyBSdW50aW1lRXhjZXB0aW9uKCJDb3VsZCBub3Qgc2V0dXAgZWZmZWN0IiwgZSk7CisgICAgICAgIH0KKworICAgICAgICBpZiAobUdyYXBoID09IG51bGwpIHsKKyAgICAgICAgICAgIHRocm93IG5ldyBSdW50aW1lRXhjZXB0aW9uKCJDb3VsZCBub3Qgc2V0dXAgZWZmZWN0Iik7CisgICAgICAgIH0KKyAgICAgICAgbVJ1bm5lciA9IG5ldyBTeW5jUnVubmVyKGdldEZpbHRlckNvbnRleHQoKSwgbUdyYXBoLCBtU2NoZWR1bGVyQ2xhc3MpOworICAgIH0KKworICAgIEBPdmVycmlkZQorICAgIHB1YmxpYyB2b2lkIGFwcGx5KGludCBpbnB1dFRleElkLCBpbnQgd2lkdGgsIGludCBoZWlnaHQsIGludCBvdXRwdXRUZXhJZCkgeworICAgICAgICBiZWdpbkdMRWZmZWN0KCk7CisgICAgICAgIEZpbHRlciBzcmMgPSBtR3JhcGguZ2V0RmlsdGVyKG1JbnB1dE5hbWUpOworICAgICAgICBpZiAoc3JjICE9IG51bGwpIHsKKyAgICAgICAgICAgIHNyYy5zZXRJbnB1dFZhbHVlKCJ0ZXhJZCIsIGlucHV0VGV4SWQpOworICAgICAgICAgICAgc3JjLnNldElucHV0VmFsdWUoIndpZHRoIiwgd2lkdGgpOworICAgICAgICAgICAgc3JjLnNldElucHV0VmFsdWUoImhlaWdodCIsIGhlaWdodCk7CisgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICB0aHJvdyBuZXcgUnVudGltZUV4Y2VwdGlvbigiSW50ZXJuYWwgZXJyb3IgYXBwbHlpbmcgZWZmZWN0Iik7CisgICAgICAgIH0KKyAgICAgICAgRmlsdGVyIGRlc3QgID0gbUdyYXBoLmdldEZpbHRlcihtT3V0cHV0TmFtZSk7CisgICAgICAgIGlmIChkZXN0ICE9IG51bGwpIHsKKyAgICAgICAgICAgIGRlc3Quc2V0SW5wdXRWYWx1ZSgidGV4SWQiLCBvdXRwdXRUZXhJZCk7CisgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICB0aHJvdyBuZXcgUnVudGltZUV4Y2VwdGlvbigiSW50ZXJuYWwgZXJyb3IgYXBwbHlpbmcgZWZmZWN0Iik7CisgICAgICAgIH0KKyAgICAgICAgdHJ5IHsKKyAgICAgICAgICAgIG1SdW5uZXIucnVuKC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VmZmVjdChFZmZlY3RDb250ZXh0IGNvbnRleHQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBTdHJpbmcgbmFtZSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIENsYXNzIGZpbHRlckNsYXNzLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgU3RyaW5nIGlucHV0TmFtZSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFN0cmluZyBvdXRwdXROYW1lLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgT2JqZWN0Li4uIGZpbmFsUGFyYW1ldGVycykgeworICAgICAgICBzdXBlcihjb250ZXh0LCBuYW1lKTsKKworICAgICAgICBtSW5wdXROYW1lID0gaW5wdXROYW1lOworICAgICAgICBtT3V0cHV0TmFtZSA9IG91dHB1dE5hbWU7CisKKyAgICAgICAgU3RyaW5nIGZpbHRlck5hbWUgPSBmaWx0ZXJDbGFzcy5nZXRTaW1wbGVOYW1lKCk7CisgICAgICAgIEZpbHRlckZhY3RvcnkgZmFjdG9yeSA9IEZpbHRlckZhY3Rvcnkuc2hhcmVkRmFjdG9yeSgpOworICAgICAgICBGaWx0ZXIgZmlsdGVyID0gZmFjdG9yeS5jcmVhdGVGaWx0ZXJCeUNsYXNzKGZpbHRlckNsYXNzLCBmaWx0ZXJOYW1lKTsKKyAgICAgICAgZmlsdGVyLmluaXRXaXRoQXNzaWdubWVudExpc3QoZmluYWxQYXJhbWV0ZXJzKTsKKworICAgICAgICBtRnVuY3Rpb24gPSBuZXcgRmlsdGVyRnVuY3Rpb24oZ2V0RmlsdGVyQ29udGV4dCgpLCBmaWx0ZXIpOworICAgIH0KKworICAgIEBPdmVycmlkZQorICAgIHB1YmxpYyB2b2lkIGFwcGx5KGludCBpbnB1dFRleElkLCBpbnQgd2lkdGgsIGludCBoZWlnaHQsIGludCBvdXRwdXRUZXhJZCkgeworICAgICAgICBiZWdpbkdMRWZmZWN0KCk7CisKKyAgICAgICAgRnJhbWUgaW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2lkLmZpbHRlcnBhY2tzLmJhc2U7XG4iICsKKyAgICAgICAgICAgICJAaW1wb3J0IGFuZHJvaWQuZmlsdGVycGFja3MudmlkZW9wcm9jO1xuIiArCisgICAgICAgICAgICAiQGltcG9ydCBhbmRyb2lkLmZpbHRlcnBhY2tzLnZpZGVvc3JjO1xuIiArCisgICAgICAgICAgICAiXG4iICsKKyAgICAgICAgICAgICJAZmlsdGVyIEdMVGV4dHVyZVNvdXJjZSBmb3JlZ3JvdW5kIHtcbiIgKworICAgICAgICAgICAgIiAgdGV4SWQgPSAwO1xuIiArIC8vIFdpbGwgYmUgc2V0IGJ5IGJhc2UgY2xhc3MKKyAgICAgICAgICAgICIgIHdpZHRoID0gMDtcbiIgKworICAgICAgICAgICAgIiAgaGVpZ2h0ID0gMDtcbiIgKworICAgICAgICAgICAgIiAgcmVwZWF0RnJhbWUgPSB0cnVlO1xuIiArCisgICAgICAgICAgICAifVxuIiArCisgICAgICAgICAgICAiXG4iICsKKyAgICAgICAgICAgICJAZmlsdGVyIE1lZGlhU291cmNlIGJhY2tncm91bmQge1xuIiArCisgICAgICAgICAgICAiICBzb3VyY2VVcmwgPSBcIm5vX2ZpbGVfc3BlY2lmaWVkXCI7XG4iICsKKyAgICAgICAgICAgICIgIHdhaXRGb3JOZXdGcmFtZSA9IGZhbHNlO1xuIiArCisgICAgICAgICAgICAiICBzb3VyY2VJc1VybCA9IHRydWU7XG4iICsKKyAgICAgICAgICAgICJ9XG4iICsKKyAgICAgICAgICAgICJcbiIgKworICAgICAgICAgICAgIkBmaWx0ZXIgQmFja0Ryb3BwZXJGaWx0ZXIgcmVwbGFjZXIge1xuIiArCisgICAgICAgICAgICAiICBhdXRvd2JUb2dnbGUgPSAxO1xuIiArCisgICAgICAgICAgICAifVxuIiArCisgICAgICAgICAgICAiXG4iICsKKyAgICAgICAgICAgICJAZmlsdGVyIEdMVGV4dHVyZVRhcmdldCBvdXRwdXQge1xuIiArCisgICAgICAgICAgICAiICB0ZXhJZCA9IDA7XG4iICsKKyAgICAgICAgICAgICJ9XG4iICsKKyAgICAgICAgICAgICJcbiIgKworICAgICAgICAgICAgIkBjb25uZWN0IGZvcmVncm91bmRbZnJhbWVdICA9PiByZXBsYWNlclt2aWRlb107XG4iICsKKyAgICAgICAgICAgICJAY29ubmVjdCBiYWNrZ3JvdW5kW3ZpZGVvXSAgPT4gcmVwbGFjZXJbYmFja2dyb3VuZF07XG4iICsKKyAgICAgICAgICAgICJAY29ubmVjdCByZXBsYWNlclt2aWRlb10gICAgPT4gb3V0cHV0W2ZyYW1lXTtcbiI7CisKKyAgICBwcml2YXRlIEVmZmVjdFVwZGF0ZUxpc3RlbmVyIG1FZmZlY3RMaXN0ZW5lciA9IG51bGw7CisKKyAgICBwcml2YXRlIExlYXJuaW5nRG9uZUxpc3RlbmVyIG1MZWFybmluZ0xpc3RlbmVyID0gbmV3IExlYXJuaW5nRG9uZUxpc3RlbmVyKCkgeworICAgICAgICBwdWJsaWMgdm9pZCBvbkxlYXJuaW5nRG9uZShCYWNrRHJvcHBlckZpbHRlciBmaWx0ZXIpIHsKKyAgICAgICAgICAgIGlmIChtRWZmZWN0TGlzdGVuZXIgIT0gbnVsbCkgeworICAgICAgICAgICAgICAgIG1FZmZlY3RMaXN0ZW5lci5vbkVmZmVjdFVwZGF0ZWQoQmFja0Ryb3BwZXJFZmZlY3QudGhpcywgbnVsbCk7CisgICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICB9OworCisgICAgcHVibGljIEJhY2tEcm9wcGVyRWZmZWN0KEVmZmVjdENvbnRleHQgY29udGV4dCwgU3RyaW5nIG5hbWUpIHsKKyAgICAgICAgc3VwZXIoY29udGV4dCwgbmFtZSwgbUdyYXBoRGVmaW5pdGlvbiwgImZvcmVncm91bmQiLCAib3V0cHV0IiwgT25lU2hvdFNjaGVkdWxlci5jbGFzcyk7CisKKyAgICAgICAgRmlsdGVyIHJlcGxhY2VyID0gbUdyYXBoLmdldEZpbHRlcigicmVwbGFjZXIiK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ZlY3QgeworCisgICAgcHVibGljIElkZW50aXR5RWZmZWN0KEVmZmVjdENvbnRleHQgY29udGV4dCwgU3RyaW5nIG5hbWUpIHsKKyAgICAgICAgc3VwZXIoY29udGV4dCwgbmFtZSk7CisgICAgfQorCisgICAgQE92ZXJyaWRlCisgICAgcHVibGljIHZvaWQgYXBwbHkoaW50IGlucHV0VGV4SWQsIGludCB3aWR0aCwgaW50IGhlaWdodCwgaW50IG91dHB1dFRleElkKSB7CisgICAgICAgIGJlZ2luR0xFZmZlY3QoKTsKKworICAgICAgICBGcmFtZSBpbnB1dEZyYW1lID0gZnJhbWVGcm9tVGV4dHVyZShpbnB1dFRleElkLCB3aWR0aCwgaGVpZ2h0KTsKKyAgICAgICAgRnJhbWUgb3V0cHV0RnJhbWUgPSBmcmFtZUZyb21UZXh0dXJlKG91dHB1dFRleElkLCB3aWR0aCwgaGVpZ2h0KTsKKworICAgICAgICBvdXRwdXRGcmFtZS5zZXREYXRhRnJvbUZyYW1lKGlucHV0RnJhbWUpOworCisgICAgICAgIGlucHV0RnJhbWUucmVsZWFzZSgpOworICAgICAgICBvdXRwdXRGcmFtZS5yZWxlYXNlKCk7CisKKyAgICAgICAgZW5kR0xFZmZlY3QoKTsKKyAgICB9CisKKyAgICBAT3ZlcnJpZGUKKyAgICBwdWJsaWMgdm9pZCBzZXRQYXJhbWV0ZXIoU3RyaW5nIHBhcmFtZXRlcktleSwgT2JqZWN0IHZhbHVlKSB7CisgICAgICAgIHRocm93IG5ldyBJbGxlZ2FsQXJndW1lbnRFeGNlcHRpb24oIlVua25vd24gcGFyYW1ldGVyICIgKyBwYXJhbWV0ZXJLZXkKKyAgICAgICAgICAgICsgIiBmb3IgSWRlbnRpdHlFZmZlY3QhIik7CisgICAgfQorCisgICAgQE92ZXJyaWRlCisgICAgcHVibGljIHZvaWQgcmVsZWFzZSgpIHsKKyAgICB9Cit9CisKZGlmZiAtLWdpdCBhL21lZGlhL21jYS9lZmZlY3QvamF2YS9hbmRyb2l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dyYXBoSGFuZGxlPiBtR3JhcGhzID0gbmV3IEFycmF5TGlzdDxHcmFwaEhhbmRsZT4oKTsKKworICAgIHByaXZhdGUgY2xhc3MgR3JhcGhIYW5kbGUgeworICAgICAgICBwcml2YXRlIEZpbHRlckdyYXBoIG1HcmFwaDsKKyAgICAgICAgcHJpdmF0ZSBBc3luY1J1bm5lciBtQXN5bmNSdW5uZXI7CisgICAgICAgIHByaXZhdGUgU3luY1J1bm5lciBtU3luY1J1bm5lcjsKKworICAgICAgICBwdWJsaWMgR3JhcGhIYW5kbGUoRmlsdGVyR3JhcGggZ3JhcGgpIHsKKyAgICAgICAgICAgIG1HcmFwaCA9IGdyYXBoOworICAgICAgICB9CisKKyAgICAgICAgcHVibGljIEZpbHRlckdyYXBoIGdldEdyYXBoKCkgeworICAgICAgICAgICAgcmV0dXJuIG1HcmFwaDsKKyAgICAgICAgfQorCisgICAgICAgIHB1YmxpYyBBc3luY1J1bm5lciBnZXRBc3luY1J1bm5lcihGaWx0ZXJDb250ZXh0IGVudmlyb25tZW50KSB7CisgICAgICAgICAgICBpZiAobUFzeW5jUnVubmVyID09IG51bGwpIHsKKyAgICAgICAgICAgICAgICBtQXN5bmNSdW5uZXIgPSBuZXcgQXN5bmNSdW5uZXIoZW52aXJvbm1lbnQsIFJvdW5kUm9iaW5TY2hlZHVsZXIuY2xhc3MpOworICAgICAgICAgICAgICAgIG1Bc3luY1J1bm5lci5zZXRHcmFwaChtR3JhcGgpOworICAgICAgICAgICAgfQorICAgICAgICAgICAgcmV0dXJuIG1Bc3luY1J1bm5lcjsKKyAgICAgICAgfQorCisgICAgICAgIHB1YmxpYyBHcmFwaFJ1bm5lciBnZXRTeW5jUnVubmVyKEZpbHRlckNvbnRleHQgZW52aXJvbm1lbnQpIHsKKyAgICAgICAgICAgIGlmIChtU3luY1J1bm5lciA9PSBudWxsKSB7CisgICAgICAgICAgICAgICAgbVN5bmNSdW5uZXIgPSBuZXcgU3luY1J1bm5lcihlbnZpcm9ub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yAgICAgKiBAcGFyYW0gZ3JhcGggVGhlIGdyYXBoIHRvIGFkZCB0byB0aGUgZW52aXJvbm1lbnQuCisgICAgICogQHJldHVybiAgICAgIEEgdW5pcXVlIElEIGZvciB0aGUgYWRkZWQgZ3JhcGguCisgICAgICovCisgICAgcHVibGljIGludCBhZGRHcmFwaChGaWx0ZXJHcmFwaCBncmFwaCkgeworICAgICAgICBHcmFwaEhhbmRsZSBncmFwaEhhbmRsZSA9IG5ldyBHcmFwaEhhbmRsZShncmFwaCk7CisgICAgICAgIG1HcmFwaHMuYWRkKGdyYXBoSGFuZGxlKTsKKyAgICAgICAgcmV0dXJuIG1HcmFwaHMuc2l6ZSgpIC0gMTsKKyAgICB9CisKKyAgICAvKioKKyAgICAgKiBBY2Nlc3MgYSBzcGVjaWZpYyBncmFwaCBvZiB0aGlzIGVudmlyb25tZW50IGdpdmVuIGEgZ3JhcGggSUQgKHByZXZpb3VzbHkgcmV0dXJuZWQgZnJvbQorICAgICAqIGxvYWRHcmFwaCgpIG9yIGFkZEdyYXBoKCkpLiBUaHJvd3MgYW4gSW52YWxpZEFyZ3VtZW50RXhjZXB0aW9uIGlmIG5vIGdyYXBoIHdpdGggdGhlCisgICAgICogc3BlY2lmaWVkIElEIGNvdWxkIGJlIGZvdW5kLgorICAgICAqCisgICAgICogQHBhcmFtIGdyYXBoSWQgICBUaGUgSUQgb2YgdGhlIGdyYXBoIHRvIGdldC4KKyAgICAgKiBAcmV0dXJuICAgICAgICAgIFRoZSBncmFwaCB3aXRoIHRoZSBzcGVjaWZpZWQgSUQuCisgICAgICovCisgICAgcHVibGljIEZpbHRlckdyYXBoIGdldEdyYXBoKGludCBncmFwaElkKSB7CisgICAgICAgIGlmIChncmFwaElkIDwgMCB8fCBncmFwaElkID49IG1HcmFwaHMuc2l6ZSgpKSB7CisgICAgICAgICAgICB0aHJvdyBuZXcgSWxsZWdhbEFyZ3VtZW50RXhjZXB0aW9uKAorICAgICAgICAgICAgICAgICJJbnZhbGlk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AgIC8qKgorICAgICAqIFJldHVybnMgdGhlIGVudmlyb25tZW50J3MgZmlsdGVyLWNvbnRleHQuCisgICAgICovCisgICAgcHVibGljIEZpbHRlckNvbnRleHQgZ2V0Q29udGV4dCgpIHsKKyAgICAgICAgcmV0dXJuIG1Db250ZXh0OworICAgIH0KKworICAgIC8qKgorICAgICAqIFNldCB0aGUgZW52aXJvbm1lbnQncyBHTCBlbnZpcm9ubWVudCB0byB0aGUgc3BlY2lmaWVkIGVudmlyb25tZW50LiBUaGlzIGRvZXMgbm90IGFjdGl2YXRlCisgICAgICogdGhlIGVudmlyb25tZW50LgorICAgICAqLworICAgIHB1YmxpYyB2b2lkIHNldEdMRW52aXJvbm1lbnQoR0xFbnZpcm9ubWVudCBnbEVudmlyb25tZW50KSB7CisgICAgICAgIG1Db250ZXh0LmluaXRHTEVudmlyb25tZW50KGdsRW52aXJvbm1lbnQpOworICAgIH0KKworICAgIC8qKgorICAgICAqIENyZWF0ZSBhbmQgYWN0aXZhdGUgYSBuZXcgR0wgZW52aXJvbm1lbnQgZm9yIHVzZSBpbiB0aGlzIGZpbHRlciBjb250ZXh0LgorICAgICAqLworICAgIHB1YmxpYyB2b2lkIGNyZWF0ZUdMRW52aXJvbm1lbnQoKSB7CisgICAgICAgIEdMRW52aXJvbm1lbnQgZ2xFbnZpcm9ubWVudCA9IG5ldyBHTEVudmlyb25tZW50KCk7CisgICAgICAgIGdsRW52aXJvbm1lbnQuaW5pdFdpdGhOZXdDb250ZXh0KCk7CisgICAgICAgIHNldEdMRW52aXJvbm1lbnQoZ2xFbnZpcm9ubWVudCk7CisgICAgfQorCisgICAgLyoqCisgICAgICogQWN0aXZhdGUgdGhlIEdMIGVudmlyb25tZW50IGZvciB1c2UgaW4gdGhlIGN1cnJlbnQgdGhyZWFkLiBBIEdMIGVudmlyb25tZW50IG11c3QgaGF2ZSBiZWVuCisgICAgICogcHJldmlvdXNseSBzZXQgb3IgY3JlYXRlZCB1c2luZyBzZXRHTEVudmlyb25tZW50KCkgb3IgY3JlYXRlR0xFbnZpcm9ubWVudCgpISBDYWxsIHRoaXMgYWZ0ZXIKKyAgICAgKiBoYXZpbmcgc3dpdGNoZWQgdG8gYSBuZXcgdGhyZWFkIGZvciBHTCBmaWx0ZXIgZXhlY3V0aW9uLgorICAgICAqLworICAgIHB1YmxpYyB2b2lkIGFjdGl2YXRlR0xFbnZpcm9ubWVudCgpIHsKKyAgICAgICAgR0xFbnZpcm9ubWVudCBnbEVudiA9IG1Db250ZXh0LmdldEdMRW52aXJvbm1lbnQoKTsKKyAgICAgICAgaWYgKGdsRW52ICE9IG51bGwpIHsKKyAgICAgICAgICAgIG1Db250ZXh0LmdldEdMRW52aXJvbm1lbnQoKS5hY3RpdmF0ZSgpOworICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgdGhyb3cgbmV3IE51bGxQb2ludGVyRXhjZXB0aW9uKCJObyBHTEVudmlyb25tZW50IGluIHBsYWNlIHRvIGFjdGl2YXRlISIpOworICAgICAgICB9CisgICAgfQorCisgICAgLyoqCisgICAgICogRGVhY3RpdmF0ZSB0aGUgR0wgZW52aXJvbm1lbnQgZnJvbSB1c2UgaW4gdGhlIGN1cnJlbnQgdGhyZWFkLiBBIEdMIGVudmlyb25tZW50IG11c3QgaGF2ZSBiZWVuCisgICAgICogcHJldmlvdXNseSBzZXQgb3IgY3JlYXRlZCB1c2luZyBzZXRHTEVudmlyb25tZW50KCkgb3IgY3JlYXRlR0xFbnZpcm9ubWVudCgpISBDYWxsIHRoaXMgYmVmb3JlCisgICAgICogcnVubmluZyBHTCBmaWx0ZXJzIGluIGFub3RoZXIgdGhyZWFkLgorICAgICAqLworICAgIHB1YmxpYyB2b2lkIGRlYWN0aXZhdGVHTEVudmlyb25tZW50KCkgeworICAgICAgICBHTEVudmlyb25tZW50IGdsRW52ID0gbUNvbnRleHQuZ2V0R0xFbnZpcm9ubWVudCgpOworICAgICAgICBpZiAoZ2xFbnYgIT0gbnVsbCkgeworICAgICAgICAgICA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c3luY1J1bm5lclRhc2sgbVJ1blRhc2s7CisKKyAgICBwcml2YXRlIE9uUnVubmVyRG9uZUxpc3RlbmVyIG1Eb25lTGlzdGVuZXI7CisgICAgcHJpdmF0ZSBib29sZWFuIGlzUHJvY2Vzc2luZzsKKworICAgIHByaXZhdGUgRXhjZXB0aW9uIG1FeGNlcHRpb247CisKKyAgICBwcml2YXRlIGNsYXNzIFJ1bm5lclJlc3VsdCB7CisgICAgICAgIHB1YmxpYyBpbnQgc3RhdHVzID0gUkVTVUxUX1VOS05PV047CisgICAgICAgIHB1YmxpYyBFeGNlcHRpb24gZXhjZXB0aW9uOworICAgIH0KKworICAgIHByaXZhdGUgY2xhc3MgQXN5bmNSdW5uZXJUYXNrIGV4dGVuZHMgQXN5bmNUYXNrPFN5bmNSdW5uZXIsIFZvaWQsIFJ1bm5lclJlc3VsdD4geworCisgICAgICAgIHByaXZhdGUgc3RhdGljIGZpbmFsIFN0cmluZyBUQUcgPSAiQXN5bmNSdW5uZXJUYXNrIjsKKworICAgICAgICBAT3ZlcnJpZGUKKyAgICAgICAgcHJvdGVjdGVkIFJ1bm5lclJlc3VsdCBkb0luQmFja2dyb3VuZChTeW5jUnVubmVyLi4uIHJ1bm5lcikgeworICAgICAgICAgICAgUnVubmVyUmVzdWx0IHJlc3VsdCA9IG5ldyBSdW5uZXJSZXN1bHQoKTsKKyAgICAgICAgICAgIHRyeSB7CisgICAgICAgICAgICAgICAgaWYgKHJ1bm5lci5sZW5ndGggPiAxKSB7CisgICAgICAgICAgICAgICAgICAgIHRocm93IG5ldyBSdW50aW1lRXhjZXB0aW9uKCJNb3JlIHRoYW4gb25lIHJ1bm5lciByZWNlaXZlZCEiKTsKKyAgICAgICAgICAgICAgICB9CisKKyAgICAgICAgICAgICAgICBydW5uZXJbMF0uYXNzZXJ0UmVhZHlUb1N0ZXAoKTsKKworICAgICAgICAgICAgICAgIC8vIFByZXBhcmF0aW9uCisgICAgICAgICAgICAgICAgaWYgKG1Mb2dWZXJib3NlKSBMb2cudihUQUcsICJTdGFydGluZyBiYWNrZ3JvdW5kIGdyYXBoIHByb2Nlc3NpbmcuIik7CisgICAgICAgICAgICAgICAgYWN0aXZhdGVHbENvbnRleHQoKTsKKworICAgICAgICAgICAgICAgIGlmIChtTG9nVmVyYm9zZSkgTG9nLnYoVEFHLCAiUHJlcGFyaW5nIGZpbHRlciBncmFwaCBmb3IgcHJvY2Vzc2luZy4iKTsKKyAgICAgICAgICAgICAgICBydW5uZXJbMF0uYmVnaW5Qcm9jZXNzaW5nKCk7CisKKyAgICAgICAgICAgICAgICBpZiAobUxvZ1ZlcmJvc2UpIExvZy52KFRBRywgIlJ1bm5pbmcgZ3JhcGguIik7CisKKyAgICAgICAgICAgICAgICAvLyBSdW4gbG9vcAorICAgICAgICAgICAgICAgIHJlc3VsdC5zdGF0dXMgPSBSRVNVTFRfUlVOTklORzsKKyAgICAgICAgICAgICAgICB3aGlsZSAoIWlzQ2FuY2VsbGVkKCkgJiYgcmVzdWx0LnN0YXR1cyA9PSBSRVNVTFRfUlVOTklORykgeworICAgICAgICAgICAgICAgICAgICBpZiAoIXJ1bm5lclswXS5wZXJmb3JtU3RlcCgpKSB7CisgICAgICAgICAgICAgICAgICAgICAgICByZXN1bHQuc3RhdHVzID0gcnVubmVyWzBdLmRldGVybWluZVBvc3RSdW5TdGF0ZSgpOworICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHJlc3VsdC5zdGF0dXMgPT0gR3JhcGhSdW5uZXIuUkVTVUxUX1NMRUVQSU5HKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgcnVubmVyWzBdLndhaXRVbnRpbFdha2UoKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXN1bHQuc3RhdHVzID0gUkVTVUxUX1JVTk5JTkc7CisgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICB9CisKKyAgICAgICAgICAgICAgICAvLyBDbGVhbnVwCisgICAgICAgICAgICAgICAgaWYgKGlzQ2FuY2VsbGVkKCkpIHsKKyAgICAgICAgICAgICAgICAgICAgcmVzdWx0LnN0YXR1cyA9IFJFU1VMVF9TVE9QUEVEOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0gY2F0Y2ggKEV4Y2VwdGlvbiBleGNlcHRpb24pIHsKKyAgICAgICAgICAgICAgICByZXN1bHQuZXhjZXB0aW9uID0gZXhjZXB0aW9uOworICAgICAgICAgICAgICAgIHJlc3VsdC5zdGF0dXMgPSBSRVNVTFRfRVJST1I7CisgICAgICAgICAgICB9CisKKyAgICAgICAgICAgIC8vIERlYWN0aXZhdGUgY29udGV4dC4KKyAgICAgICAgICAgIHRyeSB7CisgICAgICAgICAgICAgICAgZGVhY3RpdmF0ZUdsQ29udGV4dCgpOworICAgICAgICAgICAgfSBjYXRjaCAoRXhjZXB0aW9uIGV4Y2VwdGlvbikgeworICAgICAgICAgICAgICAgIHJlc3VsdC5leGNlcHRpb24gPSBleGNlcHRpb247CisgICAgICAgICAgICAgICAgcmVzdWx0LnN0YXR1cyA9IFJFU1VMVF9FUlJPUjsKKyAgICAgICAgICAgIH0KKworICAgICAgICAgICAgaWYgKG1Mb2dWZXJib3NlKSBMb2cudihUQUcsICJEb25lIHdpdGggYmFja2dyb3VuZCBncmFwaCBwcm9jZXNzaW5nLiIpOworICAgICAgICAgICAgcmV0dXJuIHJlc3VsdDsKKyAgICAgICAgfQorCisgICAgICAgIEBPdmVycmlkZQorICAgICAgICBwcm90ZWN0ZWQgdm9pZCBvbkNhbmNlbGxlZChSdW5uZXJSZXN1bHQgcmVzdWx0KSB7CisgICAgICAgICAgICBvblBvc3RFeGVjdXRlKHJlc3VsdCk7CisgICAgICAgIH0KKworICAgICAgICBAT3ZlcnJpZGUKKyAgICAgICAgcHJvdGVjdGVkIHZvaWQgb25Qb3N0RXhlY3V0ZShSdW5uZXJSZXN1bHQgcmVzdWx0KSB7CisgICAgICAgICAgICBpZiAobUxvZ1ZlcmJvc2UpIExvZy52KFRBRywgIlN0YXJ0aW5nIHBvc3QtZXhlY3V0ZS4iKTsKKyAgICAgICAgICAgIHNldFJ1bm5pbmcoZmFsc2UpOworICAgICAgICAgICAgaWYgKHJlc3VsdCA9PSBudWxsKSB7CisgICAgICAgICAgICAgICAgLy8gQ2FuY2VsbGVkIGJlZm9yZSBnb3QgdG8gZG9JbkJhY2tncm91bmQKKyAgICAgICAgICAgICAgICByZXN1bHQgPSBuZXcgUnVubmVyUmVzdWx0KCk7CisgICAgICAgICAgICAgICAgcmVzdWx0LnN0YXR1cyA9IFJFU1VMVF9TVE9QUEVEOworICAgICAgICAgICAgfQorICAgICAgICAgICAgc2V0RXhjZXB0aW9uKHJlc3VsdC5leGNlcHRpb24pOworICAgICAgICAgICAgaWYgKHJlc3VsdC5zdGF0dXMgPT0gUkVTVUxUX1NUT1BQRUQgfHwgcmVzdWx0LnN0YXR1cyA9PSBSRVNVTFRfRVJST1IpIHsKKyAgICAgICAgICAgICAgICBpZiAobUxvZ1ZlcmJvc2UpIExvZy52KFRBRywgIkNsb3NpbmcgZmlsdGVycy4iKTsKKyAgICAgICAgICAgICAgICB0cnkgeworICAgICAgICAgICAgICAgICAgICBtUnVubmVyLmNsb3NlKCk7CisgICAgICAgICAgICAgICAgfSBjYXRjaCAoRXhjZXB0aW9uIGV4Y2VwdGlvbikgeworICAgICAgICAgICAgICAgICAgICByZXN1bHQuc3RhdHVzID0gUkVTVUxUX0VSUk9SOworICAgICAgICAgICAgICAgICAgICBzZXRFeGNlcHRpb24oZXhjZXB0aW9uKTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9CisgICAgICAgICAgICBpZiAobURvbmVMaXN0ZW5lciAhPSBudWxsKSB7CisgICAgICAgICAgICAgICAgaWYgKG1Mb2dWZXJib3NlKSBMb2cudihUQUcsICJDYWxsaW5nIGdyYXBoIGRvbmUgY2FsbGJhY2suIik7CisgICAgICAgICAgICAgICAgbURvbmVMaXN0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0ZXJDb250ZXh0LCBncmFwaCwgbVNjaGVkdWxlckNsYXNzKTsKKyAgICB9CisKKyAgICBAT3ZlcnJpZGUKKyAgICBwdWJsaWMgRmlsdGVyR3JhcGggZ2V0R3JhcGgoKSB7CisgICAgICAgIHJldHVybiBtUnVubmVyICE9IG51bGwgPyBtUnVubmVyLmdldEdyYXBoKCkgOiBudWxsOworICAgIH0KKworICAgIC8qKiBFeGVjdXRlIHRoZSBncmFwaCBpbiBhIGJhY2tncm91bmQgdGhyZWFkLiAqLworICAgIEBPdmVycmlkZQorICAgIHN5bmNocm9uaXplZCBwdWJsaWMgdm9pZCBydW4oKSB7CisgICAgICAgIGlmIChtTG9nVmVyYm9zZSkgTG9nLnYoVEFHLCAiUnVubmluZyBncmFwaC4iKTsKKyAgICAgICAgc2V0RXhjZXB0aW9uKG51bGwpOworCisgICAgICAgIGlmIChpc1J1bm5pbmcoKSkgeworICAgICAgICAgICAgdGhyb3cgbmV3IFJ1bnRpbWVFeGNlcHRpb24oIkdyYXBoIGlzIGFscmVhZHkgcnVubmluZyEiKTsKKyAgICAgICAgfQorICAgICAgICBpZiAobVJ1bm5lciA9PSBudWxsKSB7CisgICAgICAgICAgICB0aHJvdyBuZXcgUnVudGltZUV4Y2VwdGlvbigiQ2Fubm90IHJ1biBiZWZvcmUgYSBncmFwaCBpcyBzZXQhIik7CisgICAgICAgIH0KKyAgICAgICAgbVJ1blRhc2sgPSB0aGlzLm5ldyBBc3luY1J1bm5lclRhc2soKTsKKworICAgICAgICBzZXRSdW5uaW5nKHRydWUpOworICAgICAgICBtUnVuVGFzay5leGVjdXRlKG1SdW5uZXIpOworICAgIH0KKworICAgIC8qKiBTdG9wIGdyYXBoIGV4ZWN1dGlvbi4gVGhpcyBpcyBhbiBhc3luY2hyb25vdXMgY2FsbDsgcmVnaXN0ZXIgYSBjYWxsYmFjaworICAgICAqIHdpdGggc2V0RG9uZUNhbGxiYWNrIHRvIGJlIG5vdGlmaWVkIG9mIHdoZW4gdGh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gICAgfQorICAgICAgICByZXN1bHQuc2V0VGltZXN0YW1wKEZyYW1lLlRJTUVTVEFNUF9OT1RfU0VUKTsKKyAgICAgICAgcmV0dXJuIHJlc3VsdDsKKyAgICB9CisKKyAgICBAT3ZlcnJpZGUKKyAgICBwdWJsaWMgRnJhbWUgcmV0YWluRnJhbWUoRnJhbWUgZnJhbWUpIHsKKyAgICAgICAgcmV0dXJuIHN1cGVyLnJldGFpbkZyYW1lKGZyYW1lKTsKKyAgICB9CisKKyAgICBAT3ZlcnJpZGUKKyAgICBwdWJsaWMgRnJhbWUgcmVsZWFzZUZyYW1lKEZyYW1lIGZyYW1lKSB7CisgICAgICAgIGlmIChmcmFtZS5pc1JldXNhYmxlKCkpIHsKKyAgICAgICAgICAgIGludCByZWZDb3VudCA9IGZyYW1lLmRlY1JlZkNvdW50KCk7CisgICAgICAgICAgICBpZiAocmVmQ291bnQgPT0gMCAmJiBmcmFtZS5oYXNOYXRpdmVBbGxvY2F0aW9uKCkpIHsKKyAgICAgICAgICAgICAgICBpZiAoIXN0b3JlRnJhbWUoZnJhbWUpKSB7CisgICAgICAgICAgICAgICAgICAgIGZyYW1lLnJlbGVhc2VOYXRpdmVBbGxvY2F0aW9uKCk7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIHJldHVybiBudWxsOworICAgICAgICAgICAgfSBlbHNlIGlmIChyZWZDb3VudCA8IDApIHsKKyAgICAgICAgICAgICAgICB0aHJvdyBuZXcgUnVudGltZUV4Y2VwdGlvbigiRnJhbWUgcmVmZXJlbmNlIGNvdW50IGRyb3BwZWQgYmVsb3cgMCEiKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgIHN1cGVyLnJlbGVhc2VGcmFtZShmcmFtZSk7CisgICAgICAgIH0KKyAgICAgICAgcmV0dXJuIGZyYW1lOworICAgIH0KKworICAgIHB1YmxpYyB2b2lkIGNsZWFyQ2FjaGUoKSB7CisgICAgICAgIGZvciAoRnJhbWUgZnJhbWUgOiBtQXZhaWxhYmxlRnJhbWVzLnZhbHVlcygpKSB7CisgICAgICAgICAgICBmcmFtZS5yZWxlYXNlTmF0aXZlQWxsb2NhdGlvbigpOworICAgICAgICB9CisgICAgICAgIG1BdmFpbGFibGVGcmFtZXMuY2xlYXIoKTsKKyAgICB9CisKKyAgICBAT3ZlcnJpZGUKKyAgICBwdWJsaWMgdm9pZCB0ZWFyRG93bigpIHsKKyAgICAgICAgY2xlYXJDYWNoZSgpOworICAgIH0KKworICAgIHByaXZhdGUgYm9vbGVhbiBzdG9yZUZyYW1lKEZyYW1lIGZyYW1lKSB7CisgICAgICAgIHN5bmNocm9uaXplZChtQXZhaWxhYmxlRnJhbWVzKSB7CisgICAgICAgICAgICAvLyBNYWtlIHN1cmUgdGhpcyBmcmFtZSBhbG9uZSBkb2VzIG5vdCBleGNlZWQgY2FwYWNpdHkKKyAgICAgICAgICAgIGludCBmcmFtZVNpemUgPSBmcmFtZS5nZXRGb3JtYXQoKS5nZXRTaXplKCk7CisgICAgICAgICAgICBpZiAoZnJhbWVTaXplID4gbVN0b3JhZ2VDYXBhY2l0eSkgeworICAgICAgICAgICAgICAgIHJldHVybiBmYWxzZTsKKyAgICAgICAgICAgIH0KKworICAgICAgICAgICAgLy8gRHJvcCBmcmFtZXMgaWYgYWRkaW5nIHRoaXMgZnJhbWUgd291bGQgZXhjZWVkIGNhcGFjaXR5CisgICAgICAgICAgICBpbnQgbmV3U3RvcmFnZVNpemUgPSBtU3RvcmFnZVNpemUgKyBmcmFtZVNpemU7CisgICAgICAgICAgICB3aGlsZSAobmV3U3RvcmFnZVNpemUgPiBtU3RvcmFnZUNhcGFjaXR5KSB7CisgICAgICAgICAgICAgICAgZHJvcE9sZGVzdEZyYW1lKCk7CisgICAgICAgICAgICAgICAgbmV3U3RvcmFnZVNpemUgPSBtU3RvcmFnZVNpemUgKyBmcmFtZVNpemU7CisgICAgICAgICAgICB9CisKKyAgICAgICAgICAgIC8vIF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HJ5LmdldFZhbHVlKCk7CisgICAgICAgICAgICAgICAgLy8gQ2hlY2sgdGhhdCBmb3JtYXQgaXMgY29tcGF0aWJsZQorICAgICAgICAgICAgICAgIGlmIChmcmFtZS5nZXRGb3JtYXQoKS5pc1JlcGxhY2VhYmxlQnkoZm9ybWF0KSkgeworICAgICAgICAgICAgICAgICAgICAvLyBDaGVjayB0aGF0IGJpbmRpbmcgaXMgY29tcGF0aWJsZSAoaWYgZnJhbWUgaXMgYm91bmQpCisgICAgICAgICAgICAgICAgICAgIGlmICgoYmluZGluZ1R5cGUgPT0gZnJhbWUuZ2V0QmluZGluZ1R5cGUoKSkKKyAgICAgICAgICAgICAgICAgICAgICAgICYmIChiaW5kaW5nVHlwZSA9PSBGcmFtZS5OT19CSU5ESU5HIHx8IGJpbmRpbmdJZCA9PSBmcmFtZS5nZXRCaW5kaW5nSWQoKSkpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIC8vIFdlIGZvdW5kIG9uZSEgVGFrZSBpdCBvdXQgb2YgdGhlIHNldCBvZiBhdmFpbGFibGUgZnJhbWVzIGFuZCBhdHRhY2ggdGhlCisgICAgICAgICAgICAgICAgICAgICAgICAvLyByZXF1ZXN0ZWQgZm9ybWF0IHRvIGl0LgorICAgICAgICAgICAgICAgICAgICAgICAgc3VwZXIucmV0YWluRnJhbWUoZnJhbWUpOworICAgICAgICAgICAgICAgICAgICAgICAgbUF2YWlsYWJsZUZyYW1lcy5yZW1vdmUoZW50cnkuZ2V0S2V5KCkpOworICAgICAgICAgICAgICAgICAgICAgICAgZnJhbWUub25GcmFtZUZldGNoKCk7CisgICAgICAgICAgICAgICAgICAgICAgICBmcmFtZS5yZXNldChmb3JtYXQpOworICAgICAgICAgICAgICAgICAgICAgICAgbVN0b3JhZ2VTaXplIC09IGZvcm1hdC5nZXRTaXplKCk7CisgICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gZnJhbWU7CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICA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XRGcmFtZShGcmFtZSBmcmFtZSkgeworICAgICAgICBzZXRGaWVsZEZyYW1lKGZyYW1lLCB0cnVlKTsKKyAgICB9CisKKyAgICBAT3ZlcnJpZGUKKyAgICBwdWJsaWMgT2JqZWN0IGdldFRhcmdldCgpIHsKKyAgICAgICAgdHJ5IHsKKyAgICAgICAgICAgIHJldHVybiBtRmllbGQuZ2V0KG1GaWx0ZXIpOworICAgICAgICB9IGNhdGNoIChJbGxlZ2FsQWNjZXNzRXhjZXB0aW9uIGUpIHsKKyAgICAgICAgICAgIHJldHVybiBudWxsOworICAgICAgICB9CisgICAgfQorCisgICAgQE92ZXJyaWRlCisgICAgcHVibGljIHN5bmNocm9uaXplZCB2b2lkIHRyYW5zZmVyKEZpbHRlckNvbnRleHQgY29udGV4dCkgeworICAgICAgICBpZiAobVZhbHVlV2FpdGluZykgeworICAgICAgICAgICAgdHJ5IHsKKyAgICAgICAgICAgICAgICBtRmllbGQuc2V0KG1GaWx0ZXIsIG1WYWx1ZSk7CisgICAgICAgICAgICB9IGNhdGNoIChJbGxlZ2FsQWNjZXNzRXhjZXB0aW9uIGUpIHsKKyAgICAgICAgICAgICAgICB0aHJvdyBuZXcgUnVudGltZUV4Y2VwdGlvbigKKyAgICAgICAgICAgICAgICAgICAgIkFjY2VzcyB0byBmaWVsZCAnIiArIG1GaWVsZC5nZXROYW1lKCkgKyAiJyB3YXMgZGVuaWVkISIpOworICAgICAgICAgICAgfQorICAgICAgICAgICAgbVZhbHVlV2FpdGluZyA9IGZhbHNlOworICAgICAgICAgICAgaWYgKGNvbnRleHQgIT0gbnVsbCkgeworICAgICAgICAgICAgICAgIG1GaWx0ZXIubm90aWZ5RmllbGRQb3J0VmFsdWVVcGRhdGVkKG1OYW1lLCBjb250ZXh0KTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgIH0KKworICAgIEBPdmVycmlkZQorICAgIHB1YmxpYyBzeW5jaHJvbml6ZWQgRnJhbWUgcHVsbEZyYW1lKCkg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KKyAqLworcHVibGljIGFic3RyYWN0IGNsYXNzIEZpbHRlciB7CisKKyAgICBzdGF0aWMgZmluYWwgaW50IFNUQVRVU19QUkVJTklUICAgICAgICAgICAgICAgPSAwOworICAgIHN0YXRpYyBmaW5hbCBpbnQgU1RBVFVTX1VOUFJFUEFSRUQgICAgICAgICAgICA9IDE7CisgICAgc3RhdGljIGZpbmFsIGludCBTVEFUVVNfUFJFUEFSRUQgICAgICAgICAgICAgID0gMjsKKyAgICBzdGF0aWMgZmluYWwgaW50IFNUQVRVU19QUk9DRVNTSU5HICAgICAgICAgICAgPSAzOworICAgIHN0YXRpYyBmaW5hbCBpbnQgU1RBVFVTX1NMRUVQSU5HICAgICAgICAgICAgICA9IDQ7CisgICAgc3RhdGljIGZpbmFsIGludCBTVEFUVVNfRklOSVNIRUQgICAgICAgICAgICAgID0gNTsKKyAgICBzdGF0aWMgZmluYWwgaW50IFNUQVRVU19FUlJPUiAgICAgICAgICAgICAgICAgPSA2OworICAgIHN0YXRpYyBmaW5hbCBpbnQgU1RBVFVTX1JFTEVBU0VEICAgICAgICAgICAgICA9IDc7CisKKyAgICBwcml2YXRlIFN0cmluZyBtTmFtZTsKKworICAgIHByaXZhdGUgaW50IG1JbnB1dENvdW50ID0gLTE7CisgICAgcHJpdmF0ZSBpbnQgbU91dHB1dENvdW50ID0gLTE7CisKKyAgICBwcml2YXRlIEhhc2hNYXA8U3RyaW5nLCBJbnB1dFBvcnQ+IG1JbnB1dFBvcnRzOworICAgIHByaXZhdGUgSGFzaE1hcDxTdHJpbmcsIE91dHB1dFBvcnQ+IG1PdXRwdXRQb3J0czsKKworICAgIHByaXZhdGUgSGFzaFNldDxGcmFtZT4gbUZyYW1lc1RvUmVsZWFzZTsKKyAgICBwcml2YXRlIEhhc2hNYXA8U3RyaW5nLCBGcmFtZT4gbUZyYW1lc1RvU2V0OworCisgICAgcHJpdmF0ZSBpbnQgbVN0YXR1cyA9IDA7CisgICAgcHJpdmF0ZSBib29sZWFuIG1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vcnQgaW5wdXRQb3J0ID0gZ2V0SW5wdXRQb3J0KHBvcnROYW1lKTsKKyAgICAgICAgcmV0dXJuIGlucHV0UG9ydC5nZXRTb3VyY2VGb3JtYXQoKTsKKyAgICB9CisKKyAgICBwdWJsaWMgdm9pZCBvcGVuKEZpbHRlckNvbnRleHQgY29udGV4dCkgeworICAgIH0KKworICAgIHB1YmxpYyBhYnN0cmFjdCB2b2lkIHByb2Nlc3MoRmlsdGVyQ29udGV4dCBjb250ZXh0KTsKKworICAgIHB1YmxpYyBmaW5hbCBpbnQgZ2V0U2xlZXBEZWxheSgpIHsKKyAgICAgICAgcmV0dXJuIDI1MDsKKyAgICB9CisKKyAgICBwdWJsaWMgdm9pZCBjbG9zZShGaWx0ZXJDb250ZXh0IGNvbnRleHQpIHsKKyAgICB9CisKKyAgICBwdWJsaWMgdm9pZCB0ZWFyRG93bihGaWx0ZXJDb250ZXh0IGNvbnRleHQpIHsKKyAgICB9CisKKyAgICBwdWJsaWMgZmluYWwgaW50IGdldE51bWJlck9mQ29ubmVjdGVkSW5wdXRzKCkgeworICAgICAgICBpbnQgYyA9IDA7CisgICAgICAgIGZvciAoSW5wdXRQb3J0IGlucHV0UG9ydCA6IG1JbnB1dFBvcnRzLnZhbHVlcygpKSB7CisgICAgICAgICAgICBpZiAoaW5wdXRQb3J0LmlzQ29ubmVjdGVkKCkpIHsKKyAgICAgICAgICAgICAgICArK2M7CisgICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICAgICAgcmV0dXJuIGM7CisgICAgfQorCisgICAgcHVibGljIGZpbmFsIGludCBnZXROdW1iZXJPZkNvbm5lY3RlZE91dHB1dHMoKSB7CisgICAgICAgIGludCBjID0gMDsKKyAgICAgICAgZm9yIChPdXRwdXRQb3J0IG91dHB1dFBvcnQgOiBtT3V0cHV0UG9ydHMudmFsdWVzKCkpIHsKKyAgICAgICAgICAgIGlmIChvdXRwdXRQb3J0LmlzQ29ubmVjdGVkKCkpIHsKKyAgICAgICAgICAgICAgICArK2M7CisgICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICAgICAgcmV0dXJuIGM7CisgICAgfQorCisgICAgcHVibGljIGZpbmFsIGludCBnZXROdW1iZXJPZklucHV0cygpIHsKKyAgICAgICAgcmV0dXJuIG1PdXRwdXRQb3J0cyA9PSBudWxsID8gMCA6IG1JbnB1dFBvcnRzLnNpemUoKTsKKyAgICB9CisKKyAgICBwdWJsaWMgZmluYWwgaW50IGdldE51bWJlck9mT3V0cHV0cygpIHsKKyAgICAgICAgcmV0dXJuIG1JbnB1dFBvcnRzID09IG51bGwgPyAwIDogbU91dHB1dFBvcnRzLnNpemUoKTsKKyAgICB9CisKKyAgICBwdWJsaWMgZmluYWwgSW5wdXRQb3J0IGdldElucHV0UG9ydChTdHJpbmcgcG9ydE5hbWUpIHsKKyAgICAgICAgaWYgKG1JbnB1dFBvcnRzID09IG51bGwpIHsKKyAgICAgICAgICAgIHRocm93IG5ldyBOdWxsUG9pbnRlckV4Y2VwdGlvbigiQXR0ZW1wdGluZyB0byBhY2Nlc3MgaW5wdXQgcG9ydCAnIiArIHBvcnROYW1lCisgICAgICAgICAgICAgICAgKyAiJyBvZiAiICsgdGhpcyArICIgYmVmb3JlIEZpbHRlciBoYXMgYmVlbiBpbml0aWFsaXplZCEiKTsKKyAgICAgICAgfQorICAgICAgICBJbnB1dFBvcnQgcmVzdWx0ID0gbUlucHV0UG9ydHMuZ2V0KHBvcnROYW1lKTsKKyAgICAgICAgaWYgKHJlc3VsdCA9PSBudWxsKSB7CisgICAgICAgICAgICB0aHJvdyBuZXcgSWxsZWdhbEFyZ3VtZW50RXhjZXB0aW9uKCJVbmtub3duIGlucHV0IHBvcnQgJyIgKyBwb3J0TmFtZSArICInIG9uIGZpbHRlciAiCisgICAgICAgICAgICAgICAgKyB0aGlzICsgIiEiKTsKKyAgICAgICAgfQorICAgICAgICByZXR1cm4gcmVzdWx0OworICAgIH0KKworICAgIHB1YmxpYyBmaW5hbCBPdXRwdXRQb3J0IGdldE91dHB1dFBvcnQoU3RyaW5nIHBvcnROYW1lKSB7CisgICAgICAgIGlmIChtSW5wdXRQb3J0cyA9PSBudWxsKSB7CisgICAgICAgICAgICB0aHJvdyBuZXcgTnVsbFBvaW50ZXJFeGNlcHRpb24oIkF0dGVtcHRpbmcgdG8gYWNjZXNzIG91dHB1dCBwb3J0ICciICsgcG9ydE5hbWUKKyAgICAgICAgICAgICAgICArICInIG9mICIgKyB0aGlzICsgIiBiZWZvcmUgRmlsdGVyIGhhcyBiZWVuIGluaXRpYWxpemVkISIpOworICAgICAgICB9CisgICAgICAgIE91dHB1dFBvcnQgcmVzdWx0ID0gbU91dHB1dFBvcnRzLmdldChwb3J0TmFtZSk7CisgICAgICAgIGlmIChyZXN1bHQgPT0gbnVsbCkgeworICAgICAgICAgICAgdGhyb3cgbmV3IElsbGVnYWxBcmd1bWVudEV4Y2VwdGlvbigiVW5rbm93biBvdXRwdXQgcG9ydCAnIiArIHBvcnROYW1lICsgIicgb24gZmlsdGVyICIKKyAgICAgICAgICAgICAgICArIHRoaXMgKyAiISIpOworICAgICAgICB9CisgICAgICAgIHJldHVybiByZXN1bHQ7CisgICAgfQorCisgICAgcHJvdGVjdGVkIGZpbmFsIHZvaWQgcHVzaE91dHB1dChTdHJpbmcgbmFtZSwgRnJhbWUgZnJhbWUpIHsKKyAgICAgICAgaWYgKGZyYW1lLmdldFRpbWVzdGFtcCgpID09IEZyYW1lLlRJTUVTVEFNUF9OT1RfU0VUKSB7CisgICAgICAgICAgICBpZiAobUxvZ1ZlcmJvc2UpIExvZy52KFRBRywgIkRlZmF1bHQtc2V0dGluZyBvdXRwdXQgRnJhbWUgdGltZXN0YW1wIG9uIHBvcnQgIiArIG5hbWUgKyAiIHRvICIgKyBtQ3VycmVudFRpbWVzdGFtcCk7CisgICAgICAgICAgICBmcmFtZS5zZXRUaW1lc3RhbXAobUN1cnJlbnRUaW1lc3RhbXApOworICAgICAgICB9CisgICAgICAgIGdldE91dHB1dFBvcnQob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llbGQsIGhhc0RlZmF1bHQpCisgICAgICAgICAgICA6IG5ldyBGaWVsZFBvcnQodGhpcywgbmFtZSwgZmllbGQsIGhhc0RlZmF1bHQpOworCisgICAgICAgIC8vIENyZWF0ZSBmb3JtYXQgZm9yIHRoaXMgaW5wdXQKKyAgICAgICAgaWYgKG1Mb2dWZXJib3NlKSBMb2cudihUQUcsICJGaWx0ZXIgIiArIHRoaXMgKyAiIGFkZGluZyAiICsgZmllbGRQb3J0KTsKKyAgICAgICAgTXV0YWJsZUZyYW1lRm9ybWF0IGZvcm1hdCA9IE9iamVjdEZvcm1hdC5mcm9tQ2xhc3MoZmllbGQuZ2V0VHlwZSgpLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBGcmFtZUZvcm1hdC5UQVJHRVRfU0lNUExFKTsKKyAgICAgICAgZmllbGRQb3J0LnNldFBvcnRGb3JtYXQoZm9ybWF0KTsKKworICAgICAgICAvLyBBZGQgcG9ydAorICAgICAgICBtSW5wdXRQb3J0cy5wdXQobmFtZSwgZmllbGRQb3J0KTsKKyAgICB9CisKKyAgICBwcm90ZWN0ZWQgdm9pZCBhZGRQcm9ncmFtUG9ydChTdHJpbmcgbmFtZSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBTdHJpbmcgdmFyTmFtZSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBGaWVsZCBmaWVsZCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBDbGFzcyB2YXJUeXBlLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJvb2xlYW4gaGFzRGVmYXVsdCkgeworICAgICAgICAvLyBNYWtlIHN1cmUgZmllbGQgaXMgYWNjZXNzaWJsZQorICAgICAgICBmaWVsZC5zZXRBY2Nlc3NpYmxlKHRydWUpOworCisgICAgICAgIC8vIENyZWF0ZSBwb3J0IGZvciB0aGlzIGlucHV0CisgICAgICA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UEFSRUQpIHsKKyAgICAgICAgICAgICAgICBpZiAobUxvZ1ZlcmJvc2UpIExvZy52KFRBRywgIk9wZW5pbmcgIiArIHRoaXMpOworICAgICAgICAgICAgICAgIG9wZW4oY29udGV4dCk7CisgICAgICAgICAgICAgICAgbVN0YXR1cyA9IFNUQVRVU19QUk9DRVNTSU5HOworICAgICAgICAgICAgfQorICAgICAgICAgICAgaWYgKG1TdGF0dXMgIT0gU1RBVFVTX1BST0NFU1NJTkcpIHsKKyAgICAgICAgICAgICAgICB0aHJvdyBuZXcgUnVudGltZUV4Y2VwdGlvbigiRmlsdGVyICIgKyB0aGlzICsgIiB3YXMgYnJvdWdodCBpbnRvIGludmFsaWQgc3RhdGUgZHVyaW5nICIKKyAgICAgICAgICAgICAgICAgICAgKyAib3BlbmluZyAoc3RhdGU6ICIgKyBtU3RhdHVzICsgIikhIik7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBtSXNPcGVuID0gdHJ1ZTsKKyAgICAgICAgfQorICAgIH0KKworICAgIGZpbmFsIHN5bmNocm9uaXplZCB2b2lkIHBlcmZvcm1Qcm9jZXNzKEZpbHRlckNvbnRleHQgY29udGV4dCkgeworICAgICAgICBpZiAobVN0YXR1cyA9PSBTVEFUVVNfUkVMRUFTRUQpIHsKKyAgICAgICAgICAgIHRocm93IG5ldyBSdW50aW1lRXhjZXB0aW9uKCJGaWx0ZXIgIiArIHRoaXMgKyAiIGlzIGFscmVhZHkgdG9ybiBkb3duISIpOworICAgICAgICB9CisgICAgICAgIHRyYW5zZmVySW5wdXRGcmFtZXMoY29udGV4dCk7CisgICAgICAgIGlmIChtU3RhdHVzIDwgU1RBVFVTX1BST0NFU1NJTkcpIHsKKyAgICAgICAgICAgIHBlcmZvcm1PcGVuKGNvbnRleHQpOworICAgICAgICB9CisgICAgICAgIGlmIChtTG9nVmVyYm9zZSkgTG9nLnYoVEFHLCAiUHJvY2Vzc2luZyAiICsgdGhpcyk7CisgICAgICAgIG1DdXJyZW50VGltZXN0YW1wID0gRnJhbWUuVElNRVNUQU1QX1VOS05PV047CisgICAgICAgIHByb2Nlc3MoY29udGV4dCk7CisgICAgICAgIHJlbGVhc2VQdWxsZWRGcmFtZXMoY29udGV4dCk7CisgICAgICAgIGlmIChmaWx0ZXJNdXN0Q2xvc2UoKSkgeworICAgICAgICAgICAgcGVyZm9ybUNsb3NlKGNvbnRleHQpOworICAgICAgICB9CisgICAgfQorCisgICAgZmluYWwgc3luY2hyb25pemVkIHZvaWQgcGVyZm9ybUNsb3NlKEZpbHRlckNvbnRleHQgY29udGV4dCkgeworICAgICAgICBpZiAobUlzT3BlbikgeworICAgICAgICAgICAgaWYgKG1Mb2dWZXJib3NlKSBMb2cudihUQUcsICJDbG9zaW5nICIgKyB0aGlzKTsKKyAgICAgICAgICAgIG1Jc09wZW4gPSBmYWxzZTsKKyAgICAgICAgICAgIG1TdGF0dXMgPSBTVEFUVVNfUFJFUEFSRUQ7CisgICAgICAgICAgICBjbG9zZShjb250ZXh0KTsKKyAgICAgICAgICAgIGNsb3NlUG9ydHMoKTsKKyAgICAgICAgfQorICAgIH0KKworICAgIGZpbmFsIHN5bmNocm9uaXplZCB2b2lkIHBlcmZvcm1UZWFyRG93bihGaWx0ZXJDb250ZXh0IGNvbnRleHQpIHsKKyAgICAgICAgcGVyZm9ybUNsb3NlKGNvbnRleHQpOworICAgICAgICBpZiAobVN0YXR1cyAhPSBTVEFUVVNfUkVMRUFTRUQpIHsKKyAgICAgICAgICAgIHRlYXJEb3duKGNvbnRleHQpOworICAgICAgICAgICAgbVN0YXR1cyA9IFNUQVRVU19SRUxFQVNFRDsKKyAgICAgICAgfQorICAgIH0KKworICAgIHN5bmNocm9uaXplZCBmaW5hbCBib29sZWFuIGNhblByb2Nlc3MoKSB7CisgICAgICAgIGlmIChtTG9nVmVyYm9zZSkgTG9nLnYoVEFHLCAiQ2hlY2tpbmcgaWYgY2FuIHByb2Nlc3M6ICIgKyB0aGlzICsgIiAoIiArIG1TdGF0dXMgKyAiKS4iKTsKKyAgICAgICAgaWYgKG1TdGF0dXMgPD0gU1RBVFVTX1BST0NFU1NJTkcpIHsKKyAgICAgICAgICAgIHJldHVybiBpbnB1dENvbmRpdGlvbnNNZXQoKSAmJiBvdXRwdXRDb25kaXRpb25zTWV0KCk7CisgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICByZXR1cm4gZmFsc2U7CisgICAgICAgIH0KKyAgICB9CisKKyAgICBmaW5hbCB2b2lkIG9wZW5PdXRwdXRzKCkgeworICAgICAgICBpZiAobUxvZ1ZlcmJvc2UpIExvZy52KFRBRywgIk9wZW5pbmcgYWxsIG91dHB1dCBwb3J0cyBvbiAiICsgdGhpcyArICIhIik7CisgICAgICAgIGZvciAoT3V0cHV0UG9ydCBvdXRwdXRQb3J0IDogbU91dHB1dFBvcnRzLnZhbHVlcygpKSB7CisgICAgICAgICAgICBpZiAoIW91dHB1dFBvcnQuaXNPcGVuKCkpIHsKKyAgICAgICAgICAgICAgICBvdXRwdXRQb3J0Lm9wZW4oKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgIH0KKworICAgIGZpbmFsIHZvaWQgY2xlYXJJbnB1dHMoKSB7CisgICAgICAgIGZvciAoSW5wdXRQb3J0IGlucHV0UG9ydCA6IG1JbnB1dFBvcnRzLnZhbHVlcygpKSB7CisgICAgICAgICAgICBpbnB1dFBvcnQuY2xlYXIoKTsKKyAgICAgICAgfQorICAgIH0KKworICAgIGZpbmFsIHZvaWQgY2xlYXJPdXRwdXRzKCkgeworICAgICAgICBmb3IgKE91dHB1dFBvcnQgb3V0cHV0UG9ydCA6IG1PdXRwdXRQb3J0cy52YWx1ZXMoKSkgeworICAgICAgICAgICAgb3V0cHV0UG9ydC5jbGVhcigpOworICAgICAgICB9CisgICAgfQorCisgICAgZmluYWwgdm9pZCBub3RpZnlGaWVsZFBvcnRWYWx1ZVVwZGF0ZWQoU3RyaW5nIG5hbWUsIEZpbHRlckNvbnRleHQgY29udGV4dCkgeworICAg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QW5kU2V0RmluYWxQb3J0cyh2YWx1ZXMpOworICAgIH0KKworICAgIHByaXZhdGUgZmluYWwgdm9pZCBpbml0UmVtYWluaW5nUG9ydHMoS2V5VmFsdWVNYXAgdmFsdWVzKSB7CisgICAgICAgIGFkZEFubm90YXRlZFBvcnRzKCk7CisgICAgICAgIHNldHVwUG9ydHMoKTsgICAvLyBUT0RPOiByZW5hbWUgdG8gYWRkRmlsdGVyUG9ydHMoKSA/CisgICAgICAgIHNldEluaXRpYWxJbnB1dFZhbHVlcyh2YWx1ZXMpOworICAgIH0KKworICAgIHByaXZhdGUgZmluYWwgdm9pZCBhZGRBbmRTZXRGaW5hbFBvcnRzKEtleVZhbHVlTWFwIHZhbHVlcykgeworICAgICAgICBDbGFzcyBmaWx0ZXJDbGFzcyA9IGdldENsYXNzKCk7CisgICAgICAgIEFubm90YXRpb24gYW5ub3RhdGlvbjsKKyAgICAgICAgZm9yIChGaWVsZCBmaWVsZCA6IGZpbHRlckNsYXNzLmdldERlY2xhcmVkRmllbGRzKCkpIHsKKyAgICAgICAgICAgIGlmICgoYW5ub3RhdGlvbiA9IGZpZWxkLmdldEFubm90YXRpb24oR2VuZXJhdGVGaW5hbFBvcnQuY2xhc3MpKSAhPSBudWxsKSB7CisgICAgICAgICAgICAgICAgR2VuZXJhdGVGaW5hbFBvcnQgZ2VuZXJhdG9yID0gKEdlbmVyYXRlRmluYWxQb3J0KWFubm90YXRpb247CisgICAgICAgICAgICAgICAgU3RyaW5nIG5hbWUgPSBnZW5lcmF0b3IubmFtZSgpLmlzRW1wdHkoKSA/IGZpZWxkLmdldE5hbWUoKSA6IGdlbmVyYXRvci5uYW1lKCk7CisgICAgICAgICAgICAgICAgYm9vbGVhbiBoYXNEZWZhdWx0ID0gZ2VuZXJhdG9yLmhhc0RlZmF1bHQoKTsKKyAgICAgICAgICAgICAgICBhZGRGaWVsZFBvcnQobmFtZSwgZmllbGQsIGhhc0RlZmF1bHQsIHRydWUpOworICAgICAgICAgICAgICAgIGlmICh2YWx1ZXMuY29udGFpbnNLZXkobmFtZSkpIHsKKyAgICAgICAgICAgICAgICAgICAgc2V0SW1tZWRpYXRlSW5wdXRWYWx1ZShuYW1lLCB2YWx1ZXMuZ2V0KG5hbWUpKTsKKyAgICAgICAgICAgICAgICAgICAgdmFsdWVzLnJlbW92ZShuYW1lKTsKKyAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKCFnZW5lcmF0b3IuaGFzRGVmYXVsdCgpKSB7CisgICAgICAgICAgICAgICAgICAgIHRocm93IG5ldyBSdW50aW1lRXhjZXB0aW9uKCJObyB2YWx1ZSBzcGVjaWZpZWQgZm9yIGZpbmFsIGlucHV0IHBvcnQgJyIKKyAgICAgICAgICAgICAgICAgICAgICAgICsgbmFtZSArICInIG9mIGZpbHRlciAiICsgdGhpcyArICIhIik7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgfQorCisgICAgcHJpdmF0ZSBmaW5hbCB2b2lkIGFkZEFubm90YXRlZFBvcnRzKCkgeworICAgICAgICBDbGFzcyBmaWx0ZXJDbGFzcyA9IGdldENsYXNzKCk7CisgICAgICAgIEFubm90YXRpb24gYW5ub3RhdGlvbjsKKyAgICAgICAgZm9yIChGaWVsZCBmaWVsZCA6IGZpbHRlckNsYXNzLmdldERlY2xhcmVkRmllbGRzKCkpIHsKKyAgICAgICAgICAgIGlmICgoYW5ub3RhdGlvbiA9IGZpZWxkLmdldEFubm90YXRpb24oR2VuZXJhdGVGaWVsZFBvcnQuY2xhc3MpKSAhPSBudWxsKSB7CisgICAgICAgICAgICAgICAgR2VuZXJhdGVGaWVsZFBvcnQgZ2VuZXJhdG9yID0gKEdlbmVyYXRlRmllbGRQb3J0KWFubm90YXRpb247CisgICAgICAgICAgICAgICAgYWRkRmllbGRHZW5lcmF0b3IoZ2VuZXJhdG9yLCBmaWVsZCk7CisgICAgICAgICAgICB9IGVsc2UgaWYgKChhbm5vdGF0aW9uID0gZmllbGQuZ2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ICAgIH0KKyAgICAgICAgbUZyYW1lc1RvUmVsZWFzZS5jbGVhcigpOworICAgIH0KKworICAgIHByaXZhdGUgZmluYWwgYm9vbGVhbiBpbnB1dENvbmRpdGlvbnNNZXQoKSB7CisgICAgICAgIGZvciAoRmlsdGVyUG9ydCBwb3J0IDogbUlucHV0UG9ydHMudmFsdWVzKCkpIHsKKyAgICAgICAgICAgIGlmICghcG9ydC5pc1JlYWR5KCkpIHsKKyAgICAgICAgICAgICAgICBpZiAobUxvZ1ZlcmJvc2UpIExvZy52KFRBRywgIklucHV0IGNvbmRpdGlvbiBub3QgbWV0OiAiICsgcG9ydCArICIhIik7CisgICAgICAgICAgICAgICAgcmV0dXJuIGZhbHNlOworICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgICAgIHJldHVybiB0cnVlOworICAgIH0KKworICAgIHByaXZhdGUgZmluYWwgYm9vbGVhbiBvdXRwdXRDb25kaXRpb25zTWV0KCkgeworICAgICAgICBmb3IgKEZpbHRlclBvcnQgcG9ydCA6IG1PdXRwdXRQb3J0cy52YWx1ZXMoKSkgeworICAgICAgICAgICAgaWYgKCFwb3J0LmlzUmVhZHkoKSkgeworICAgICAgICAgICAgICAgIGlmIChtTG9nVmVyYm9zZSkgTG9nLnYoVEFHLCAiT3V0cHV0IGNvbmRpdGlvbiBub3QgbWV0OiAiICsgcG9ydCArICIhIik7CisgICAgICAgICAgICAgICAgcmV0dXJuIGZhbHNlOworICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgICAgIHJldHVybiB0cnVlOworICAgIH0KKworICAgIHByaXZhdGUgZmluYWwgdm9pZCBjbG9zZVBvcnRzKCkgeworICAgICAgICBpZiAobUxvZ1ZlcmJvc2UpIExvZy52KFRBRywgIkNsb3NpbmcgYWxsIHBvcnRzIG9uICIgKyB0aGlzICsgIiEiKTsKKyAgICAgICAgZm9yIChJbnB1dFBvcnQgaW5wdXRQb3J0IDogbUlucHV0UG9ydHMudmFsdWVzKCkpIHsKKyAgICAgICAgICAgIGlucHV0UG9ydC5jbG9zZSgpOworICAgICAgICB9CisgICAgICAgIGZvciAoT3V0cHV0UG9ydCBvdXRwdXRQb3J0IDogbU91dHB1dFBvcnRzLnZhbHVlcygpKSB7CisgICAgICAgICAgICBvdXRwdXRQb3J0LmNsb3NlKCk7CisgICAgICAgIH0KKyAgICB9CisKKyAgICBwcml2YXRlIGZpbmFsIGJvb2xlYW4gZmlsdGVyTXVzdENsb3NlKCkgeworICAgICAgICBmb3IgKElucHV0UG9ydCBpbnB1dFBvcnQgOiBtSW5wdXRQb3J0cy52YWx1ZXMoKSkgeworICAgICAgICAgICAgaWYgKGlucHV0UG9ydC5maWx0ZXJNdXN0Q2xvc2UoKSkgeworICAgICAgICAgICAgICAgIGlmIChtTG9nVmVyYm9zZSkgTG9nLnYoVEFHLCAiRmlsdGVyICIgKyB0aGlzICsgIiBtdXN0IGNsb3NlIGR1ZSB0byBwb3J0ICIgKyBpbnB1dFBvcnQpOworICAgICAgICAgICAgICAgIHJldHVybiB0cnVlOworICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgICAgIGZvciAoT3V0cHV0UG9ydCBvdXRwdXRQb3J0IDogbU91dHB1dFBvcnRzLnZhbHVlcygpKSB7CisgICAgICAgICAgICBpZiAob3V0cHV0UG9ydC5maWx0ZXJNdXN0Q2xvc2UoKSkgeworICAgICAgICAgICAgICAgIGlmIChtTG9nVmVyYm9zZSkgTG9nLnYoVEFHLCAiRmlsdGVyICIgKyB0aGlzICsgIiBtdXN0IGNsb3NlIGR1ZSB0byBwb3J0ICIgKyBvdXRwdXRQb3J0KTsKKyAgICAgICAgICAgICAgICByZXR1cm4gdHJ1ZTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgICAgICByZXR1cm4gZmFsc2U7CisgICAgfQorfQpkaWZmIC0tZ2l0IGEvbWVkaWEvbWNhL2ZpbHRlcmZ3L2phdmEvYW5kcm9pZC9maWx0ZXJmdy9jb3JlL0ZpbHRlckNvbnRleHQuamF2Y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VwdGlvbigiQXR0ZW1wdGluZyB0byBzZXQgbnVsbCBGcmFtZU1hbmFnZXIhIik7CisgICAgICAgIH0gZWxzZSBpZiAobWFuYWdlci5nZXRDb250ZXh0KCkgIT0gbnVsbCkgeworICAgICAgICAgICAgdGhyb3cgbmV3IElsbGVnYWxBcmd1bWVudEV4Y2VwdGlvbigiQXR0ZW1wdGluZyB0byBzZXQgRnJhbWVNYW5hZ2VyIHdoaWNoIGlzIGFscmVhZHkgIgorICAgICAgICAgICAgICAgICsgImJvdW5kIHRvIGFub3RoZXIgRmlsdGVyQ29udGV4dCEiKTsKKyAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgIG1GcmFtZU1hbmFnZXIgPSBtYW5hZ2VyOworICAgICAgICAgICAgbUZyYW1lTWFuYWdlci5zZXRDb250ZXh0KHRoaXMpOworICAgICAgICB9CisgICAgfQorCisgICAgcHVibGljIEdMRW52aXJvbm1lbnQgZ2V0R0xFbnZpcm9ubWVudCgpIHsKKyAgICAgICAgcmV0dXJuIG1HTEVudmlyb25tZW50OworICAgIH0KKworICAgIHB1YmxpYyB2b2lkIGluaXRHTEVudmlyb25tZW50KEdMRW52aXJvbm1lbnQgZW52aXJvbm1lbnQpIHsKKyAgICAgICAgaWYgKG1HTEVudmlyb25tZW50ID09IG51bGwpIHsKKyAgICAgICAgICAgIG1HTEVudmlyb25tZW50ID0gZW52aXJvbm1lbnQ7CisgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICB0aHJvdyBuZXcgUnVudGltZUV4Y2VwdGlvbigiQXR0ZW1wdGluZyB0byByZS1pbml0aWFsaXplIEdMIEVudmlyb25tZW50IGZvciAiICsKKyAgICAgICAgICAgICAgICAiRmlsdGVyQ29udGV4dCEiKTsKKyAgICAgICAgfQorICAgIH0KKworICAgIHB1YmxpYyBpbnRlcmZhY2UgT25GcmFtZVJlY2VpdmVkTGlzdGVuZXIgeworICAgICAgICBwdWJsaWMgdm9pZCBvbkZyYW1lUmVjZWl2ZWQoRmlsdGVyIGZpbHRlciwgRnJhbWUgZnJhbWUsIE9iamVjdCB1c2VyRGF0YSk7CisgICAgfQorCisgICAgcHVibGljIHN5bmNocm9uaXplZCB2b2lkIHN0b3JlRnJhbWUoU3RyaW5nIGtleSwgRnJhbWUgZnJhbWUpIHsKKyAgICAgICAgRnJhbWUgc3RvcmVkRnJhbWUgPSBmZXRjaEZyYW1lKGtleSk7CisgICAgICAgIGlmIChzdG9yZWRGcmFtZSAhPSBudWxsKSB7CisgICAgICAgICAgICBzdG9yZWRGcmFtZS5yZWxlYXNlKCk7CisgICAgICAgIH0KKyAgICAgICAgZnJhbWUub25GcmFtZVN0b3JlKCk7CisgICAgICAgIG1TdG9yZWRGcmFtZXMucHV0KGtleSwgZnJhbWUucmV0YWluKCkpOworICAgIH0KKworICAgIHB1YmxpYyBzeW5jaHJvbml6ZWQgRnJhbWUgZmV0Y2hGcmFtZShTdHJpbmcga2V5KSB7CisgICAgICAgIEZyYW1lIGZyYW1lID0gbVN0b3JlZEZyYW1lcy5nZXQoa2V5KTsKKyAgICAgICAgaWYgKGZyYW1lICE9IG51bGwpIHsKKyAgICAgICAgICAgIGZyYW1lLm9uRnJhbWVGZXRjaCgpOworICAgICAgICB9CisgICAgICAgIHJldHVybiBmcmFtZTsKKyAgICB9CisKKyAgICBwdWJsaWMgc3luY2hyb25pemVkIHZvaWQgcmVtb3ZlRnJhbWUoU3RyaW5nIGtleSkgeworICAgICAgICBGcmFtZSBmcmFtZSA9IG1TdG9yZWRGcmFtZXMuZ2V0KGtleSk7CisgICAgICAgIGlmIChmcmFtZSAhPSBudWxsKSB7CisgICAgICAgICAgICBtU3RvcmVkRnJhbWVzLnJlbW92ZShrZXkpOworICAgICAgICAgICAgZnJhbWUucmVsZWFzZSgpOworICAgICAgICB9CisgICAgfQorCisgICAgcHVibGljIHN5bmNocm9uaXplZCB2b2lkIHRlYXJEb3duKCkgeworICAgICAgICAvLyBSZWxlYXNlIHN0b3JlZCBmcmFtZXMKKy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ZXJib3NlKSBMb2cudihUQUcsICJMaWJyYXJ5IGFscmVhZHkgYWRkZWQiKTsKKyAgICAgICAgICAgICAgICByZXR1cm47CisgICAgICAgICAgICB9CisgICAgICAgICAgICBtTGlicmFyaWVzLmFkZChsaWJyYXJ5UGF0aCk7CisgICAgICAgICAgICAvLyBDaGFpbiBhbm90aGVyIHBhdGggbG9hZGVyIHRvIHRoZSBjdXJyZW50IGNoYWluCisgICAgICAgICAgICBtQ3VycmVudENsYXNzTG9hZGVyID0gbmV3IFBhdGhDbGFzc0xvYWRlcihsaWJyYXJ5UGF0aCwgbUN1cnJlbnRDbGFzc0xvYWRlcik7CisgICAgICAgIH0KKyAgICB9CisKKyAgICBwdWJsaWMgdm9pZCBhZGRQYWNrYWdlKFN0cmluZyBwYWNrYWdlTmFtZSkgeworICAgICAgICBpZiAobUxvZ1ZlcmJvc2UpIExvZy52KFRBRywgIkFkZGluZyBwYWNrYWdlICIgKyBwYWNrYWdlTmFtZSk7CisgICAgICAgIC8qIFRPRE86IFRoaXMgc2hvdWxkIHVzZSBhIGdldFBhY2thZ2UgY2FsbCBpbiB0aGUgY2FsbGVyJ3MgY29udGV4dCwgYnV0IG5vIHN1Y2ggbWV0aG9kIGV4aXN0cy4KKyAgICAgICAgUGFja2FnZSBwa2cgPSBQYWNrYWdlLmdldFBhY2thZ2UocGFja2FnZU5hbWUpOworICAgICAgICBpZiAocGtnID09IG51bGwpIHsKKyAgICAgICAgICAgIHRocm93IG5ldyBJbGxlZ2FsQXJndW1lbnRFeGNlcHRpb24oIlVua25vd24gZmlsdGVyIHBhY2thZ2UgJyIgKyBwYWNrYWdlTmFtZSArICInISIpOworICAgICAgICB9CisgICAgICAgICovCisgICAgICAgIG1QYWNrYWdlcy5hZGQocGFja2FnZU5hbWUpOworICAgIH0KKworICAgIHB1YmxpYyBGaWx0ZXIgY3JlYXRlRmlsdGVyQnlDbGFzc05hbWUoU3RyaW5nIGNsYXNzTmFtZSwgU3RyaW5nIGZpbHRlck5hbWUpIHsKKyAgICAgICAgaWYgKG1Mb2dWZXJib3NlKSBMb2cudihUQUcsICJMb29raW5nIHVwIGNsYXNzICIgKyBjbGFzc05hbWUpOworICAgICAgICBDbGFzcyBmaWx0ZXJDbGFzcyA9IG51bGw7CisKKyAgICAgICAgLy8gTG9vayBmb3IgdGhlIGNsYXNzIGluIHRoZSBpbXBvcnRlZCBwYWNrYWdlcworICAgICAgICBmb3IgKFN0cmluZyBwYWNrYWdlTmFtZSA6IG1QYWNrYWdlcykgeworICAgICAgICAgICAgdHJ5IHsKKyAgICAgICAgICAgICAgICBpZiAobUxvZ1ZlcmJvc2UpIExvZy52KFRBRywgIlRyeWluZyAiK3BhY2thZ2VOYW1lICsgIi4iICsgY2xhc3NOYW1lKTsKKyAgICAgICAgICAgICAgICBzeW5jaHJvbml6ZWQobUNsYXNzTG9hZGVyR3VhcmQpIHsKKyAgICAgICAgICAgICAgICAgICAgZmlsdGVyQ2xhc3MgPSBtQ3VycmVudENsYXNzTG9hZGVyLmxvYWRDbGFzcyhwYWNrYWdlTmFtZSArICIuIiArIGNsYXNzTmFtZSk7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfSBjYXRjaCAoQ2xhc3NOb3RGb3VuZEV4Y2VwdGlvbiBlKSB7CisgICAgICAgICAgICAgICAgY29udGludWU7CisgICAgICAgICAgICB9CisgICAgICAgICAgICAvLyBFeGl0IGxvb3AgaWYgY2xhc3Mgd2FzIGZvdW5kLgorICAgICAgICAgICAgaWYgKGZpbHRlckNsYXNzICE9IG51bGwpIHsKKyAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgICAgICBpZiAoZmlsdGVyQ2xhc3MgPT0gbnVsbCkgeworICAgICAgICAgICAgdGhyb3cgbmV3IElsbGVnYWxBcmd1bWVudEV4Y2VwdGlvbigiVW5rbm93biBmaWx0ZXIgY2xhc3MgJyIgKyBjbGFzc05hbWUgKyAiJyEiKTsKKyAgICAgICA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IC8vIE1ha2Ugc3VyZSBHTCBlbnZpcm9ubWVudCBpcyBhY3RpdmUKKyAgICAgICAgYm9vbGVhbiBkaWRBY3RpdmF0ZUdMRW52ID0gZmFsc2U7CisgICAgICAgIEdMRW52aXJvbm1lbnQgZ2xFbnYgPSBtRmlsdGVyQ29udGV4dC5nZXRHTEVudmlyb25tZW50KCk7CisgICAgICAgIGlmIChnbEVudiAhPSBudWxsICYmICFnbEVudi5pc0FjdGl2ZSgpKSB7CisgICAgICAgICAgICBnbEVudi5hY3RpdmF0ZSgpOworICAgICAgICAgICAgZGlkQWN0aXZhdGVHTEVudiA9IHRydWU7CisgICAgICAgIH0KKworICAgICAgICAvLyBTZXR1cCB0aGUgaW5wdXRzCisgICAgICAgIGZvciAoRW50cnk8U3RyaW5nLCBPYmplY3Q+IGVudHJ5IDogaW5wdXRNYXAuZW50cnlTZXQoKSkgeworICAgICAgICAgICAgaWYgKGVudHJ5LmdldFZhbHVlKCkgaW5zdGFuY2VvZiBGcmFtZSkgeworICAgICAgICAgICAgICAgIG1GaWx0ZXIucHVzaElucHV0RnJhbWUoZW50cnkuZ2V0S2V5KCksIChGcmFtZSllbnRyeS5nZXRWYWx1ZSgpKTsKKyAgICAgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICAgICAgbUZpbHRlci5wdXNoSW5wdXRWYWx1ZShlbnRyeS5nZXRLZXkoKSwgZW50cnkuZ2V0VmFsdWUoKSk7CisgICAgICAgICAgICB9CisgICAgICAgIH0KKworICAgICAgICAvLyBQcm9jZXNzIHRoZSBmaWx0ZXIKKyAgICAgICAgaWYgKG1GaWx0ZXIuZ2V0U3RhdHVzKCkgIT0gRmlsdGVyLlNUQVRVU19QUk9DRVNTSU5HKSB7CisgICAgICAgICAgICBtRmlsdGVyLm9wZW5PdXRwdXRzKCk7CisgICAgICAgIH0KKworICAgICAgICBtRmlsdGVyLnBlcmZvcm1Qcm9jZXNzKG1GaWx0ZXJDb250ZXh0KTsKKworICAgICAgICAvLyBDcmVhdGUgcmVzdWx0IGhhbmRsZQorICAgICAgICBGcmFtZSByZXN1bHQgPSBudWxsOworICAgICAgICBpZiAoZmlsdGVyT3V0Q291bnQgPT0gMSAmJiBtUmVzdWx0SG9sZGVyc1swXS5oYXNGcmFtZSgpKSB7CisgICAgICAgICAgICByZXN1bHQgPSBtUmVzdWx0SG9sZGVyc1swXS5wdWxsRnJhbWUoKTsKKyAgICAgICAgfQorCisgICAgICAgIC8vIERlYWN0aXZhdGUgR0wgZW52aXJvbm1lbnQgaWYgYWN0aXZhdGVkCisgICAgICAgIGlmIChkaWRBY3RpdmF0ZUdMRW52KSB7CisgICAgICAgICAgICBnbEVudi5kZWFjdGl2YXRlKCk7CisgICAgICAgIH0KKworICAgICAgICByZXR1cm4gcmVzdWx0OworICAgIH0KKworICAgIHB1YmxpYyBGcmFtZSBleGVjdXRlV2l0aEFyZ0xpc3QoT2JqZWN0Li4uIGlucHV0cykgeworICAgICAgICByZXR1cm4gZXhlY3V0ZShLZXlWYWx1ZU1hcC5mcm9tS2V5VmFsdWVzKGlucHV0cykpOworICAgIH0KKworICAgIHB1YmxpYyB2b2lkIGNsb3NlKCkgeworICAgICAgICBtRmlsdGVyLnBlcmZvcm1DbG9zZShtRmlsdGVyQ29udGV4dCk7CisgICAgfQorCisgICAgcHVibGljIEZpbHRlckNvbnRleHQgZ2V0Q29udGV4dCgpIHsKKyAgICAgICAgcmV0dXJuIG1GaWx0ZXJDb250ZXh0OworICAgIH0KKworICAgIHB1YmxpYyBGaWx0ZXIgZ2V0RmlsdGVyKCkgeworICAgICAgICByZXR1cm4gbUZpbHRlcjsKKyAgICB9CisKKyAgICBwdWJsaWMgdm9pZCBzZXRJbnB1dEZyYW1lKFN0cmluZyBpbnB1dCwgRnJhbWUgZnJhbWUpIHsKKyAgICAgICAgbUZpbHRlci5zZXRJbnB1dEZyYW1lKGlucHV0LCBmcmFtZSk7CisgICAgfQorCisgICAgcHVibGljIHZvaWQgc2V0SW5wdXRWYWx1Z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0ZpbHRlcihGaWx0ZXIgZmlsdGVyKSB7CisgICAgICAgIHJldHVybiBtRmlsdGVycy5jb250YWlucyhmaWx0ZXIpOworICAgIH0KKworICAgIHB1YmxpYyBGaWx0ZXIgZ2V0RmlsdGVyKFN0cmluZyBuYW1lKSB7CisgICAgICAgIHJldHVybiBtTmFtZU1hcC5nZXQobmFtZSk7CisgICAgfQorCisgICAgcHVibGljIHZvaWQgY29ubmVjdChGaWx0ZXIgc291cmNlLAorICAgICAgICAgICAgICAgICAgICAgICAgU3RyaW5nIG91dHB1dE5hbWUsCisgICAgICAgICAgICAgICAgICAgICAgICBGaWx0ZXIgdGFyZ2V0LAorICAgICAgICAgICAgICAgICAgICAgICAgU3RyaW5nIGlucHV0TmFtZSkgeworICAgICAgICBpZiAoc291cmNlID09IG51bGwgfHwgdGFyZ2V0ID09IG51bGwpIHsKKyAgICAgICAgICAgIHRocm93IG5ldyBJbGxlZ2FsQXJndW1lbnRFeGNlcHRpb24oIlBhc3NpbmcgbnVsbCBGaWx0ZXIgaW4gY29ubmVjdCgpISIpOworICAgICAgICB9IGVsc2UgaWYgKCFjb250YWluc0ZpbHRlcihzb3VyY2UpIHx8ICFjb250YWluc0ZpbHRlcih0YXJnZXQpKSB7CisgICAgICAgICAgICB0aHJvdyBuZXcgUnVudGltZUV4Y2VwdGlvbigiQXR0ZW1wdGluZyB0byBjb25uZWN0IGZpbHRlciBub3QgaW4gZ3JhcGghIik7CisgICAgICAgIH0KKworICAgICAgICBPdXRwdXRQb3J0IG91dFBvcnQgPSBzb3VyY2UuZ2V0T3V0cHV0UG9ydChvdXRwdXROYW1lKTsKKyAgICAgICAgSW5wdXRQb3J0IGluUG9ydCA9IHRhcmdldC5nZXRJbnB1dFBvcnQoaW5wdXROYW1lKTsKKyAgICAgICAgaWYgKG91dFBvcnQgPT0gbnVsbCkgeworICAgICAgICAgICAgdGhyb3cgbmV3IFJ1bnRpbWVFeGNlcHRpb24oIlVua25vd24gb3V0cHV0IHBvcnQgJyIgKyBvdXRwdXROYW1lICsgIicgb24gRmlsdGVyICIgKworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc291cmNlICsgIiEiKTsKKyAgICAgICAgfSBlbHNlIGlmIChpblBvcnQgPT0gbnVsbCkgeworICAgICAgICAgICAgdGhyb3cgbmV3IFJ1bnRpbWVFeGNlcHRpb24oIlVua25vd24gaW5wdXQgcG9ydCAnIiArIGlucHV0TmFtZSArICInIG9uIEZpbHRlciAiICsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRhcmdldCArICIhIik7CisgICAgICAgIH0KKworICAgICAgICBwcmVjb25uZWN0KG91dFBvcnQsIGluUG9ydCk7CisgICAgfQorCisgICAgcHVibGljIHZvaWQgY29ubmVjdChTdHJpbmcgc291cmNlTmFtZSwKKyAgICAgICAgICAgICAgICAgICAgICAgIFN0cmluZyBvdXRwdXROYW1lLAorICAgICAgICAgICAgICAgICAgICAgICAgU3RyaW5nIHRhcmdldE5hbWUsCisgICAgICAgICAgICAgICAgICAgICAgICBTdHJpbmcgaW5wdXROYW1lKSB7CisgICAgICAgIEZpbHRlciBzb3VyY2UgPSBnZXRGaWx0ZXIoc291cmNlTmFtZSk7CisgICAgICAgIEZpbHRlciB0YXJnZXQgPSBnZXRGaWx0ZXIodGFyZ2V0TmFtZSk7CisgICAgICAgIGlmIChzb3VyY2UgPT0gbnVsbCkgeworICAgICAgICAgICAgdGhyb3cgbmV3IFJ1bnRpbWVFeGNlcHRpb24oCisgICAgICAgICAgICAgICAgIkF0dGVtcHRpbmcgdG8gY29ubmVjdCB1bmtub3duIHNvdXJjZSBmaWx0ZXIgJyIgKyBzb3VyY2VOYW1lICsgIichIik7CisgICAgICAgIH0gZWxzZSBpZiAodGFyZ2V0ID09IG51bGwpIHsKKyAgICAgICAgICAgIHRocm93IG5ldyBSdW50aW1lRXhjZXB0aW9uKAorICAgICAgICAgICAgICAgICJBdHRlbXB0aW5nIHRvIGNvbm5lY3QgdW5rbm93biB0YXJnZXQgZmlsdGVyICciICsgdGFyZ2V0TmFtZSArICInISIpOworICAgICAgICB9CisgICAgICAgIGNvbm5lY3Qoc291cmNlLCBvdXRwdXROYW1lLCB0YXJnZXQsIGlucHV0TmFtZSk7CisgICAgfQorCisgICAgcHVibGljIFNldDxGaWx0ZXI+IGdldEZpbHRlcnMoKSB7CisgICAgICAgIHJldHVybiBtRmlsdGVyczsKKyAgICB9CisKKyAgICBwdWJsaWMgdm9pZCBiZWdpblByb2Nlc3NpbmcoKSB7CisgICAgICAgIGlmIChtTG9nVmVyYm9zZSkgTG9nLnYoVEFHLCAiT3BlbmluZyBhbGwgZmlsdGVyIGNvbm5lY3Rpb25zLi4uIik7CisgICAgICAgIGZvciAoRmlsdGVyIGZpbHRlciA6IG1GaWx0ZXJzKSB7CisgICAgICAgICAgICBmaWx0ZXIub3Blbk91dHB1dHMoKTsKKyAgICAgICAgfQorICAgICAgICBtSXNSZWFkeSA9IHRydWU7CisgICAgfQorCisgICAgcHVibGljIHZvaWQgZmx1c2hGcmFtZXMoKSB7CisgICAgICAgIGZvciAoRmlsdGVyIGZpbHRlciA6IG1GaWx0ZXJzKSB7CisgICAgICAgICAgICBmaWx0ZXIuY2xlYXJPdXRwdXRzKCk7CisgICAgICAgIH0KKyAgICB9CisKKyAgICBwdWJsaWMgdm9pZCBjbG9zZUZpbHRlcnMoRmlsdGVyQ29udGV4dCBjb250ZXh0KSB7CisgICAgICAgIGlmIChtTG9nVmVyYm9zZSkgTG9nLnYoVEFHLCAiQ2xvc2luZyBhbGwgZmlsdGVycy4uLiIpOworICAgICAgICBmb3IgKEZpbHRlciBmaWx0ZXIgOiBtRmlsdGVycykgeworICAgICAgICAgICAgZmlsdGVyLnBlcmZvcm1DbG9zZShjb250ZXh0KTsKKyAgICAgICAgfQorICAgICAgICBtSXNSZWFkeSA9IGZhbHNlOworICAgIH0KKworICAgIHB1YmxpYyBib29sZWFuIGlzUmVhZHkoKSB7CisgICAgICAgIHJldHVybiBtSXNSZWFkeTsKKyAgICB9CisKKyAgICBwdWJsaWMgdm9pZCBzZXRBdXRvQnJhbmNoTW9kZShpbnQgYXV0b0JyYW5jaE1vZGUpIHsKKyAgICAgICAgbUF1dG9CcmFuY2hNb2RlID0gYXV0b0JyYW5jaE1vZGU7CisgICAgfQorCisgICAgcHVibGljIHZvaWQgc2V0RGlzY2FyZFVuY29ubmVjdGVkT3V0cHV0cyhib29sZWFuIGRpc2NhcmQpIHsKKyAgICAgICAgbURpc2NhcmRVbmNvbm5lY3RlZE91dHB1dHMgPSBkaXNjYXJkOworICAgIH0KKworICAgIHB1YmxpYyB2b2lkIHNldFR5cGVDaGVja01vZGUoaW50IHR5cGVDaGVja01vZGUpIHsKKyAgICAgICAgbVR5cGVDaGVja01vZGUgPSB0eXBlQ2hlY2tNb2RlOworICAgIH0KKworICAgIHB1YmxpYyB2b2lkIHRlYXJEb3duKEZpbHRlckNvbnRleHQgY29udGV4dCkgeworICAgICAgICBpZiAoIW1GaWx0ZXJzLmlzRW1wdHkoKSkgeworICAgICAgICAgICAgZmx1c2hGcmFtZXMoKTsKKyAgICAgICAgICAgIGZvciAoRmlsdGVyIGZpbHRlciA6IG1GaWx0ZXJzKSB7CisgICAgICAgICAgICAgICAgZmlsdGVyLnBlcmZvcm1UZWFyRG93bihjb250ZXh0KTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIG1GaWx0ZXJzLmNsZWFyKCk7CisgICAgICAgICAgICBtTmFtZU1hcC5jbGVhcigpOworICAgICAgICAgICAgbUlzUmVhZHkgPSBmYWxzZTsKKyAgICAgICAgfQorICAgIH0KKworICAgIHByaXZhdGUgYm9vbGVhbiByZWFkeUZvclByb2Nlc3NpbmcoRmlsdGVyIGZpbHRlciwgU2V0PEZpbHRlcj4gcHJvY2Vzc2VkKSB7CisgICAgICAgIC8vIENoZWNrIGlmIHRoaXMgaGFzIGJlZW4gYWxyZWFkeSBwcm9jZXNzZWQKKyAgICAgICAgaWYgKHBy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KKyAgICAgICAgICAgIHVwZGF0ZU91dHB1dHMoZmlsdGVyKTsKKworICAgICAgICAgICAgLy8gUGVyZm9ybSB0eXBlIGNoZWNrCisgICAgICAgICAgICBpZiAobUxvZ1ZlcmJvc2UpIExvZy52KFRBRywgIlJ1bm5pbmcgdHlwZSBjaGVjayBvbiAiICsgZmlsdGVyICsgIi4uLiIpOworICAgICAgICAgICAgcnVuVHlwZUNoZWNrT24oZmlsdGVyKTsKKworICAgICAgICAgICAgLy8gUHVzaCBjb25uZWN0ZWQgZmlsdGVycyBvbnRvIHN0YWNrCisgICAgICAgICAgICBmb3IgKE91dHB1dFBvcnQgcG9ydCA6IGZpbHRlci5nZXRPdXRwdXRQb3J0cygpKSB7CisgICAgICAgICAgICAgICAgRmlsdGVyIHRhcmdldCA9IHBvcnQuZ2V0VGFyZ2V0RmlsdGVyKCk7CisgICAgICAgICAgICAgICAgaWYgKHRhcmdldCAhPSBudWxsICYmIHJlYWR5Rm9yUHJvY2Vzc2luZyh0YXJnZXQsIHByb2Nlc3NlZEZpbHRlcnMpKSB7CisgICAgICAgICAgICAgICAgICAgIGZpbHRlclN0YWNrLnB1c2godGFyZ2V0KTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9CisgICAgICAgIH0KKworICAgICAgICAvLyBNYWtlIHN1cmUgYWxsIHBvcnRzIHdlcmUgc2V0dXAKKyAgICAgICAgaWYgKHByb2Nlc3NlZEZpbHRlcnMuc2l6ZSgpICE9IGdldEZpbHRlcnMoKS5zaXplKCkpIHsKKyAgICAgICAgICAgIHRocm93IG5ldyBSdW50aW1lRXhjZXB0aW9uKCJDb3VsZCBub3Qgc2NoZWR1bGUgYWxsIGZpbHRlcnMhIElzIHlvdXIgZ3JhcGggbWFsZm9ybWVkPyIpOworICAgICAgICB9CisgICAgfQorCisgICAgcHJpdmF0ZSB2b2lkIHVwZGF0ZU91dHB1dHMoRmlsdGVyIGZpbHRlcikgeworICAgICAgICBmb3IgKE91dHB1dFBvcnQgb3V0cHV0UG9ydCA6IGZpbHRlci5nZXRPdXRwdXRQb3J0cygpKSB7CisgICAgICAgICAgICBJbnB1dFBvcnQgaW5wdXRQb3J0ID0gb3V0cHV0UG9ydC5nZXRCYXNlUG9ydCgpOworICAgICAgICAgICAgaWYgKGlucHV0UG9ydCAhPSBudWxsKSB7CisgICAgICAgICAgICAgICAgRnJhbWVGb3JtYXQgaW5wdXRGb3JtYXQgPSBpbnB1dFBvcnQuZ2V0U291cmNlRm9ybWF0KCk7CisgICAgICAgICAgICAgICAgRnJhbWVGb3JtYXQgb3V0cHV0Rm9ybWF0ID0gZmlsdGVyLmdldE91dHB1dEZvcm1hdChvdXRwdXRQb3J0LmdldE5hbWUoKSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlucHV0Rm9ybWF0KTsKKyAgICAgICAgICAgICAgICBpZiAob3V0cHV0Rm9ybWF0ID09IG51bGwpIHsKKyAgICAgICAgICAgICAgICAgICAgdGhyb3cgbmV3IFJ1bnRpbWVFeGNlcHRpb24oIkZpbHRlciBkaWQgbm90IHJldHVybiBhbiBvdXRwdXQgZm9ybWF0IGZvciAiCisgICAgICAgICAgICAgICAgICAgICAgICArIG91dHB1dFBvcnQgKyAiISIpOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICBvdXRwdXRQb3J0LnNldFBvcnRGb3JtYXQob3V0cHV0Rm9ybWF0KTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgIH0KKworICAgIHByaXZhdGUgdm9pZCBydW5UeXBlQ2hlY2tPbihGaWx0ZXIgZmlsdGVyKSB7CisgICAgICAgIGZvciAoSW5wdXRQb3J0IGlucHV0UG9ydCA6IGZpbHRlci5nZXRJbnB1dFBvcnRzKCkpIHsKKyAgICAgICAgICAgIGlmIChtTG9nVmVyYm9zZSkgTG9nLnYoVEFHLCAiVHlwZSBjaGVja2luZyBwb3J0ICIgKyBpbnB1dFBvcnQpOworICAgICAgICAgICAgRnJhbWVGb3JtYXQgc291cmNlRm9ybWF0ID0gaW5wdXRQb3J0LmdldFNvdXJjZUZvcm1hdCgpOworICAgICAgICAgICAgRnJhbWVGb3JtYXQgdGFyZ2V0Rm9ybWF0ID0gaW5wdXRQb3J0LmdldFBvcnRGb3JtYXQoKTsKKyAgICAgICAgICAgIGlmIChzb3VyY2VGb3JtYXQgIT0gbnVsbCAmJiB0YXJnZXRGb3JtYXQgIT0gbnVsbCkgeworICAgICAgICAgICAgICAgIGlmIChtTG9nVmVyYm9zZSkgTG9nLnYoVEFHLCAiQ2hlY2tpbmcgIiArIHNvdXJjZUZvcm1hdCArICIgYWdhaW5zdCAiICsgdGFyZ2V0Rm9ybWF0ICsgIi4iKTsKKworICAgICAgICAgICAgICAgIGJvb2xlYW4gY29tcGF0aWJsZSA9IHRydWU7CisgICAgICAgICAgICAgICAgc3dpdGNoIChtVHlwZUNoZWNrTW9kZSkgeworICAgICAgICAgICAgICAgICAgICBjYXNlIFRZUEVDSEVDS19PRkY6CisgICAgICAgICAgICAgICAgICAgICAgICBpbnB1dFBvcnQuc2V0Q2hlY2tzVHlwZShmYWxzZSk7CisgICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICAgICAgY2FzZSBUWVBFQ0hFQ0tfRFlOQU1JQzoKKyAgICAgICAgICAgICAgICAgICAgICAgIGNvbXBhdGlibGUgPSBzb3VyY2VGb3JtYXQubWF5QmVDb21wYXRpYmxlV2l0aCh0YXJnZXRGb3JtYXQpOworICAgICAgICAgICAgICAgICAgICAgICAgaW5wdXRQb3J0LnNldENoZWNrc1R5cGUodHJ1ZSk7CisgICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICAgICAgY2FzZSBUWVBFQ0hFQ0tfU1RSSUNUOgorICAgICAgICAgICAgICAgICAgICAgICAgY29tcGF0aWJsZSA9IHNvdXJjZUZvcm1hdC5pc0NvbXBhdGlibGVXaXRoKHRhcmdldEZvcm1hdCk7CisgICAgICAgICAgICAgICAgICAgICAgICBpbnB1dFBvcnQuc2V0Q2hlY2tzVHlwZShmYWxzZSk7CisgICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICB9CisKKyAgICAgICAgICAgICAgICBpZiAoIWNvbXBhdGlibGUpIHsKKyAgICAgICAgICAgICAgICAgICAgdGhyb3cgbmV3IFJ1bnRpbWVFeGNlcHRpb24oIlR5cGUgbWlzbWF0Y2g6IEZpbHRlciAiICsgZmlsdGVyICsgIiBleHBlY3RzIGEgIgorICAgICAgICAgICAgICAgICAgICAgICAgKyAiZm9ybWF0IG9mIHR5cGUgIiArIHRhcmdldEZvcm1hdCArICIgYnV0IGdvdCBhIGZvcm1hdCBvZiB0eXBlICIKKyAgICAgICAgICAgICAgICAgICAgICAgICsgc291cmNlRm9ybWF0ICsgIiEiKTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICB9CisKKyAgICBwcml2YXRlIHZvaWQgY2hlY2tDb25uZWN0aW9ucygpIHsKKyAgICAgICAgLy8gVE9ETworICAgIH0KKworICAgIHByaXZhdGUgdm9pZCBkaXNjYXJkVW5jb25uZWN0ZWRPdXRwdXRzKCkgeworICAgICAgICAvLyBDb25uZWN0IHVuY29ubmVjdGVkIHBvcnRzIHRvIE51bGwgZmlsdGVycworICAgICAgICBMaW5rZWRMaXN0PEZpbHRlcj4gYWRkZWRGaWx0ZXJzID0gbmV3IExpbmtlZExpc3Q8RmlsdGVyPigpOworICAgICAgICBmb3IgKEZpbHRlciBmaWx0ZXIgOiBtRmlsdGVycykgeworICAgICAgICAgICAgaW50IGlkID0gMDsKKyAgICAgICAgICAgIGZvciAoT3V0cHV0UG9ydCBwb3J0IDogZmlsdGVyLmdldE91dHB1dFBvcnRzKCkpIHsKKyAgICAgICAgICAgICAgICBpZiAoIXBvcnQuaXNDb25uZWN0ZWQoKSkgeworICAgICAgICAgICAgICAgICAgICBpZiAobUxvZ1ZlcmJvc2UpIExvZy52KFRBRywgIkF1dG9jb25uZWN0aW5nIHVuY29ubmVjdGVkICIgKyBwb3J0ICsgIiB0byBOdWxsIGZpbHRlci4iKTsKKyAgICAgICAgICAgICAgICAgICAgTnVsbEZpbHRlciBudWxsRmlsdGVyID0gbmV3IE51bGxGaWx0ZXIoZmlsdGVyLmdldE5hbWUoKSArICJUb051bGwiICsgaWQpOworICAgICAgICAgICAgICAgICAgICBudWxsRmlsdGVyLmluaXQoKTsKKyAgICAgICAgICAgICAgICAgICAgYWRkZWRGaWx0ZXJzLmFkZChudWxsRmlsdGVyKTsKKyAgICAgICAgICAgICAgICAgICAgcG9ydC5jb25uZWN0VG8obnVsbEZpbHRlci5nZXRJbnB1dFBvcnQoImZyYW1lIikpOworICAgICAgICAgICAgICAgICAgICArK2lkOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgICAgICAvLyBBZGQgYWxsIGFkZGVkIGZpbHRlcnMgdG8gdGhpcyBncmFwaAorICAgICAgICBmb3IgKEZpbHRlciBmaWx0ZXIgOiBhZGRlZEZpbHRlcnMpIHsKKyAgICAgICAgICAgIGFkZEZpbHRlcihmaWx0ZXIpOworICAgICAgICB9CisgICAgfQorCisgICAgcHJpdmF0ZSB2b2lkIHJlbW92ZUZpbHRlcihGaWx0ZXIgZmlsdGVyKSB7CisgICAgICAgIG1GaWx0ZXJzLnJlbW92ZShmaWx0ZXIpOworICAgICAgICBtTmFtZU1hcC5yZW1vdmUoZmlsdGVyLmdldE5hbWUoKSk7CisgICAgfQorCisgICAgcHJpdmF0ZSB2b2lkIHByZWNvbm5lY3QoT3V0cHV0UG9ydCBvdXRQb3J0LCBJbnB1dFBvcnQgaW5Qb3J0KSB7CisgICAgICAgIExpbmtlZExpc3Q8SW5wdXRQb3J0PiB0YXJnZXRzOworICAgICAgICB0YXJnZXRzID0gbVByZWNvbm5lY3Rpb25zLmdldChvdXRQb3J0KTsKKyAgICAgICAgaWYgKHRhcmdldHMgPT0gbnVsbCkgeworICAgICAgICAgICAgdGFyZ2V0cyA9IG5ldyBMaW5rZWRMaXN0PElucHV0UG9ydD4oKTsKKyAgICAgICAgICAgIG1QcmVjb25uZWN0aW9ucy5wdXQob3V0UG9ydCwgdGFyZ2V0cyk7CisgICAgICAgIH0KKyAgICAgICAgdGFyZ2V0cy5hZGQoaW5Qb3J0KTsKKyAgICB9CisKKyAgICBwcml2YXRlIHZvaWQgY29ubmVjdFBvcnRzKCkgeworICAgICAgICBpbnQgYnJhbmNoSWQgPSAxOworICAgICAgICBmb3IgKEVudHJ5PE91dHB1dFBvcnQsIExpbmtlZExpc3Q8SW5wdXRQb3J0Pj4gY29ubmVjdGlvbiA6IG1QcmVjb25uZWN0aW9ucy5lbnRyeVNldCgpKSB7CisgICAgICAgICAgICBPdXRwdXRQb3J0IG91dHB1dFBvcnQgPSBjb25uZWN0aW9uLmdldEtleSgpOworICAgICAgICAgICAgTGlua2VkTGlzdDxJbnB1dFBvcnQ+IGlucHV0UG9ydHMgPSBjb25uZWN0aW9uLmdldFZhbHVlKCk7CisgICAgICAgICAgICBpZiAoaW5wdXRQb3J0cy5zaXplKCkgPT0gMSkgeworICAgICAgICAgICAgICAgIG91dHB1dFBvcnQuY29ubmVjdFRvKGlucHV0UG9ydHMuZ2V0KDApKTsKKyAgICAgICAgICAgIH0gZWxzZSBpZiAobUF1dG9CcmFuY2hNb2RlID09IEFVVE9CUkFOQ0hfT0ZGKSB7CisgICAgICAgICAgICAgICAgdGhyb3cgbmV3IFJ1bnRpbWVFeGNlcHRpb24oIkF0dGVtcHRpbmcgdG8gY29ubmVjdCAiICsgb3V0cHV0UG9ydCArICIgdG8gbXVsdGlwbGUgIgorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICArICJmaWx0ZXIgcG9ydHMhIEVuYWJsZSBhdXRvLWJyYW5jaGluZyB0byBhbGxvdyB0aGlzLiIpOworICAgICAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgICAgICBpZiAobUxvZ1ZlcmJvc2UpIExvZy52KFRBRywgIkNyZWF0aW5nIGJyYW5jaCBmb3IgIiArIG91dHB1dFBvcnQgKyAiISIpOworICAgICAgICAgICAgICAgIEZyYW1lQnJhbmNoIGJyYW5jaCA9IG51bGw7CisgICAgICAgICAgICAgICAgaWYgKG1BdXRvQnJhbmNoTW9kZSA9PSBBVVRPQlJBTkNIX1NZTkNFRCkgeworICAgICAgICAgICAgICAgICAgICBicmFuY2ggPSBuZXcgRnJhbWVCcmFuY2goImJyYW5jaCIgKyBicmFuY2hJZCsrKTsKKyAgICAgICAgICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgICAgICAgICB0aHJvdyBuZXcgUnVudGltZUV4Y2VwdGlvbigiVE9ETzogVW5zeW5jZWQgYnJhbmNoZXMgbm90IGltcGxlbWVudGVkIHlldCEiKTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgS2V5VmFsdWVNYXAgYnJhbmNoUGFyYW1zID0gbmV3IEtleVZhbHVlTWFwKCk7CisgICAgICAgICAgICAgICAgYnJhbmNoLmluaXRXaXRoQXNzaWdubWVudExpc3QoIm91dHB1dHMiLCBpbnB1dFBvcnRzLnNpemUoKSk7CisgICAgICAgICAgICAgICAgYWRkRmlsdGVyKGJyYW5jaCk7CisgICAgICAgICAgICAgICAgb3V0cHV0UG9ydC5jb25uZWN0VG8oYnJhbmNoLmdldElucHV0UG9ydCgiaW4iKSk7CisgICAgICAgICAgICAgICAgSXRlcmF0b3I8SW5wdXRQb3J0PiBpbnB1dFBvcnRJdGVyID0gaW5wdXRQb3J0cy5pdGVyYXRvcigpOworICAgICAgICAgICAgICAgIGZvciAoT3V0cHV0UG9ydCBicmFuY2hPdXRQb3J0IDogKChGaWx0ZXIpYnJhbmNoKS5nZXRPdXRwdXRQb3J0cygpKSB7CisgICAgICAgICAgICAgICAgICAgIGJyYW5jaE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mxpYyBib29sZWFuIGlzQXR0YWNoZWQoKSB7CisgICAgICAgIHJldHVybiBtRmlsdGVyICE9IG51bGw7CisgICAgfQorCisgICAgcHVibGljIEZyYW1lRm9ybWF0IGdldFBvcnRGb3JtYXQoKSB7CisgICAgICAgIHJldHVybiBtUG9ydEZvcm1hdDsKKyAgICB9CisKKyAgICBwdWJsaWMgdm9pZCBzZXRQb3J0Rm9ybWF0KEZyYW1lRm9ybWF0IGZvcm1hdCkgeworICAgICAgICBtUG9ydEZvcm1hdCA9IGZvcm1hdDsKKyAgICB9CisKKyAgICBwdWJsaWMgRmlsdGVyIGdldEZpbHRlcigpIHsKKyAgICAgICAgcmV0dXJuIG1GaWx0ZXI7CisgICAgfQorCisgICAgcHVibGljIFN0cmluZyBnZXROYW1lKCkgeworICAgICAgICByZXR1cm4gbU5hbWU7CisgICAgfQorCisgICAgcHVibGljIHZvaWQgc2V0QmxvY2tpbmcoYm9vbGVhbiBibG9ja2luZykgeworICAgICAgICBtSXNCbG9ja2luZyA9IGJsb2NraW5nOworICAgIH0KKworICAgIHB1YmxpYyB2b2lkIHNldENoZWNrc1R5cGUoYm9vbGVhbiBjaGVja3NUeXBlKSB7CisgICAgICAgIG1DaGVja3NUeXBlID0gY2hlY2tzVHlwZTsKKyAgICB9CisKKyAgICBwdWJsaWMgdm9pZCBvcGVuKCkgeworICAgICAgICBpZiAoIW1Jc09wZW4pIHsKKyAgICAgICAgICAgIGlmIChtTG9nVmVyYm9zZSkgTG9nLnYoVEFHLCAiT3BlbmluZyAiICsgdGhpcyk7CisgICAgICAgIH0KKyAgICAgICAgbUlzT3BlbiA9IHRydWU7CisgICAgfQorCisgICAgcHVibGljIHZvaWQgY2xvc2UoKSB7CisgICAgICAgIGlmIChtSXNPcGVuKSB7CisgICAgICAgICAgICBpZiAobUxvZ1ZlcmJvc2UpIExvZy52KFRBRywgIkNsb3NpbmcgIiArIHRoaXMpOworICAgICAgICB9CisgICAgICAgIG1Jc09wZW4gPSBmYWxzZ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AgICAgLy8gQ2hlY2sgaWYgc3VyZmFjZSBoYXMgYmVlbiBjcmVhdGVkIGFscmVhZHkKKyAgICAgICAgaWYgKG1TdGF0ZSA+PSBTVEFURV9DUkVBVEVEKSB7CisgICAgICAgICAgICAvLyBSZWdpc3RlciB3aXRoIGVudiAoZG91YmxlIHJlZ2lzdHJhdGlvbiB3aWxsIGJlIGlnbm9yZWQgYnkgR0xFbnYsIHNvIHdlIGNhbiBzaW1wbHkKKyAgICAgICAgICAgIC8vIHRyeSB0byBkbyBpdCBoZXJlKS4KKyAgICAgICAgICAgIHJlZ2lzdGVyU3VyZmFjZSgpOworCisgICAgICAgICAgICAvLyBGb3J3YXJkIHN1cmZhY2UgY3JlYXRlZCB0byBsaXN0ZW5lcgorICAgICAgICAgICAgbUxpc3RlbmVyLnN1cmZhY2VDcmVhdGVkKGdldEhvbGRlcigpKTsKKworICAgICAgICAgICAgLy8gRm9yd2FyZCBzdXJmYWNlIGNoYW5nZWQgdG8gbGlzdGVuZXIKKyAgICAgICAgICAgIGlmIChtU3RhdGUgPT0gU1RBVEVfSU5JVElBTElaRUQpIHsKKyAgICAgICAgICAgICAgICBtTGlzdGVuZXIuc3VyZmFjZUNoYW5nZWQoZ2V0SG9sZGVyKCksIG1Gb3JtYXQsIG1XaWR0aCwgbUhlaWdodCk7CisgICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICB9CisKKyAgICBwdWJsaWMgc3luY2hyb25pemVkIHZvaWQgdW5iaW5kKCkgeworICAgICAgICBtTGlzdGVuZXIgPSBudWxsOworICAgIH0KKworICAgIHB1YmxpYyBzeW5jaHJvbml6ZWQgaW50IGdldFN1cmZhY2VJZCgpIHsKKyAgICAgICAgcmV0dXJuIG1TdXJmYWNlSWQ7CisgICAgfQorCisgICAgcHVibGljIHN5bmNocm9uaXplZCBHTEVudmlyb25tZW50IGdldEdMRW52KCkgeworICAgICAgICByZXR1cm4gbUdMRW52OworICAgIH0KKworICAgIEBPdmVycmlkZQorICAgIHB1YmxpYyBzeW5jaHJvbml6ZWQgdm9pZCBzdXJmYWNlQ3JlYXRlZChTdXJmYWNlSG9sZGVyIGhvbGRlcikgeworICAgICAgICBtU3RhdGUgPSBTVEFURV9DUkVBVEVEOworCisgICAgICAgIC8vIFJlZ2lzdGVyIHdpdGggR0xFbnZpcm9ubWVudCBpZiB3ZSBoYXZlIGl0IGFscmVhZHkKKyAgICAgICAgaWYgKG1HTEVudiAhPSBudWxsKSB7CisgICAgICAgICAgICByZWdpc3RlclN1cmZhY2UoKTsKKyAgICAgICAgfQorCisgICAgICAgIC8vIEZvcndhcmQgY2FsbGJhY2sgdG8gbGlzdGVuZXIKKyAgICAgICAgaWYgKG1MaXN0ZW5lciAhPSBudWxsKSB7CisgICAgICAgICAgICBtTGlzdGVuZXIuc3VyZmFjZUNyZWF0ZWQoaG9sZGVyKTsKKyAgICAgICAgfQorICAgIH0KKworICAgIEBPdmVycmlkZQorICAgIHB1YmxpYyBzeW5jaHJvbml6ZWQgdm9pZCBzdXJmYWNlQ2hhbmdlZChTdXJmYWNlSG9sZGVyIGhvbGRlciwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaW50IGZvcm1hdCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaW50IHdpZHRoLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpbnQgaGVpZ2h0KSB7CisgICAgICAgIC8vIFJlbWVtYmVyIHRoZXNlIHZhbHVlcworICAgICAgICBtRm9ybWF0ID0gZm9ybWF0OworICAgICAgICBtV2lkdGggPSB3aWR0aDsKKyAgICAgICAgbUhlaWdodCA9IGhlaWdodDsKKyAgICAgICAgbVN0YXRlID0gU1RBVEVfSU5JVElBTElaRUQ7CisKKyAgICAgICAgLy8gRm9yd2FyZCB0byByZW5kZXJlcgorICAgICAgICBpZiAobUxpc3RlbmVyICE9IG51bGwpIHsKKyAgICAgICAgICAgIG1MaXN0ZW5lci5zdXJmYWNlQ2hhbmdlZChob2xkZXIsIGZvcm1hdCwgd2lkdGgsIGhlaWdodCk7CisgICAgICAgIH0KKyAgICB9CisKKyAgICBAT3ZlcnJpZGUKKyAgICBwdWJsaWMgc3luY2hyb25pemVkIHZvaWQgc3VyZmFjZURlc3Ryb3llZChTdXJmYWNlSG9sZGVyIGhvbGRlcikgeworICAgICAgICBtU3RhdGUgPSBTVEFURV9BTExPQ0FURUQ7CisKKyAgICAgICAgLy8gRm9yd2FyZCB0byByZW5kZXJlcgorICAgICAgICBpZiAobUxpc3RlbmVyICE9IG51bGwpIHsKKyAgICAgICAgICAgIG1MaXN0ZW5lci5zdXJmYWNlRGVzdHJveWVkKGhvbGRlcik7CisgICAgICAgIH0KKworICAgICAgICAvLyBHZXQgcmlkIG9mIGludGVybmFsIG9iamVjdHMgYXNzb2NpYXRlZCB3aXRoIHRoaXMgc3VyZmFjZQorICAgICAgICB1bnJlZ2lzdGVyU3VyZmFjZSgpOworICAgIH0KKworICAgIHByaXZhdGUgdm9pZCByZWdpc3RlclN1cmZhY2UoKSB7CisgICAgICAgIG1TdXJmYWNlSWQgPSBtR0xFbnYucmVnaXN0ZXJTdXJmYWNlKGdldEhvbGRlcigpLmdldFN1cmZhY2UoKSk7CisgICAgICAgIGlmIChtU3VyZmFjZUlkIDwgMCkgeworICAgICAgICAgICAgdGhyb3cgbmV3IFJ1bnRpbWVFeGNlcHRpb24oIkNvdWxkIG5vdCByZWdpc3RlciBTdXJmYWNlOiAiICsgZ2V0SG9sZGVyKCkuZ2V0U3VyZmFjZSgpICsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICIgaW4gRmlsdGVyU3VyZmFjZVZpZXchIik7CisgICAgICAgIH0KKyAgICB9CisgICAgcHJpdmF0ZSB2b2lkIHVucmVnaXN0ZXJTdXJmYWNlKCkgeworICAgICAgICBpZiAobUdMRW52ICE9IG51bGwgJiYgbVN1cmZhY2VJZCA+IDApIHsKKyA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kgeworICAgICAgICByZXR1cm4gbUJpbmRpbmdUeXBlOworICAgIH0KKworICAgIHB1YmxpYyBsb25nIGdldEJpbmRpbmdJZCgpIHsKKyAgICAgICAgcmV0dXJuIG1CaW5kaW5nSWQ7CisgICAgfQorCisgICAgcHVibGljIHZvaWQgc2V0T2JqZWN0VmFsdWUoT2JqZWN0IG9iamVjdCkgeworICAgICAgICBhc3NlcnRGcmFtZU11dGFibGUoKTsKKworICAgICAgICAvLyBBdHRlbXB0IHRvIHNldCB0aGUgdmFsdWUgdXNpbmcgYSBzcGVjaWZpYyBzZXR0ZXIgKHdoaWNoIG1heSBiZSBtb3JlIG9wdGltaXplZCksIGFuZAorICAgICAgICAvLyBmYWxsIGJhY2sgdG8gdGhlIHNldEdlbmVyaWNPYmplY3RWYWx1ZSguLi4pIGluIGNhc2Ugb2Ygbm8gbWF0Y2guCisgICAgICAgIGlmIChvYmplY3QgaW5zdGFuY2VvZiBpbnRbXSkgeworICAgICAgICAgICAgc2V0SW50cygoaW50W10pb2JqZWN0KTsKKyAgICAgICAgfSBlbHNlIGlmIChvYmplY3QgaW5zdGFuY2VvZiBmbG9hdFtdKSB7CisgICAgICAgICAgICBzZXRGbG9hdHMoKGZsb2F0W10pb2JqZWN0KTsKKyAgICAgICAgfSBlbHNlIGlmIChvYmplY3QgaW5zdGFuY2VvZiBCeXRlQnVmZmVyKSB7CisgICAgICAgICAgICBzZXREYXRhKChCeXRlQnVmZmVyKW9iamVjdCk7CisgICAgICAgIH0gZWxzZSBpZiAob2JqZWN0IGluc3RhbmNlb2YgQml0bWFwKSB7CisgICAgICAgICAgICBzZXRCaXRtYXAoKEJpdG1hcClvYmplY3QpOworICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgc2V0R2VuZXJpY09iamVjdFZhbHVlKG9iamVjdCk7CisgICAgICAgIH0KKyAgICB9CisKKyAgICBwdWJsaWMgYWJzdHJhY3QgT2JqZWN0IGdldE9iamVjdFZhbHVlKCk7CisKKyAgICBwdWJs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UgZnJhbWUpIHsKKyAgICAgICAgc2V0RGF0YShmcmFtZS5nZXREYXRhKCkpOworICAgIH0KKworICAgIHByb3RlY3RlZCBib29sZWFuIHJlcXVlc3RSZXNpemUoaW50W10gbmV3RGltZW5zaW9ucykgeworICAgICAgICByZXR1cm4gZmFsc2U7CisgICAgfQorCisgICAgcHVibGljIGludCBnZXRSZWZDb3VudCgpIHsKKyAgICAgICAgcmV0dXJuIG1SZWZDb3VudDsKKyAgICB9CisKKyAgICBwdWJsaWMgRnJhbWUgcmVsZWFzZSgpIHsKKyAgICAgICAgaWYgKG1GcmFtZU1hbmFnZXIgIT0gbnVsbCkgeworICAgICAgICAgICAgcmV0dXJuIG1GcmFtZU1hbmFnZXIucmVsZWFzZUZyYW1lKHRoaXMpOworICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgcmV0dXJuIHRoaXM7CisgICAgICAgIH0KKyAgICB9CisKKyAgICBwdWJsaWMgRnJhbWUgcmV0YWluKCkgeworICAgICAgICBpZiAobUZyYW1lTWFuYWdlciAhPSBudWxsKSB7CisgICAgICAgICAgICByZXR1cm4gbUZyYW1lTWFuYWdlci5yZXRhaW5GcmFtZSh0aGlzKTsKKyAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgIHJldHVybiB0aGlzOworICAgICAgICB9CisgICAgfQorCisgICAgcHVibGljIEZyYW1lTWFuYWdlciBnZXRGcmFtZU1hbmFnZXIoKSB7CisgICAgICAgIHJldHVybiBtRnJhbWVNYW5hZ2VyOworICAgIH0KKworICAgIHByb3RlY3RlZCB2b2lkIGFzc2VydEZyYW1lTXV0YWJsZSgpIHsKKyAgICAgICAgaWYgKGlzUmVhZE9ubHkoKSkgeworICAgICAgICAgICAgdGhyb3cgbmV3IFJ1bnRpbWVFeGNlcHRpb24oIkF0dGVtcHRpbmcgdG8gbW9kaWZ5IHJlYWQtb25seSBmcmFtZSEiKTsKKyAgICAgICAgfQorICAgIH0KKworICAgIHByb3RlY3RlZCB2b2lkIHNldF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bigiVW5zdXBwb3J0ZWQgcm93IGJ5dGUgY291bnQgaW4gYml0bWFwISIpOworICAgICAgICAgICAgfQorICAgICAgICAgICAgcmV0dXJuIHJlc3VsdDsKKyAgICAgICAgfQorICAgIH0KKworICAgIHByb3RlY3RlZCB2b2lkIHJlc2V0KEZyYW1lRm9ybWF0IG5ld0Zvcm1hdCkgeworICAgICAgICBtRm9ybWF0ID0gbmV3Rm9ybWF0Lm11dGFibGVDb3B5KCk7CisgICAgICAgIG1SZWFkT25seSA9IGZhbHNlOworICAgICAgICBtUmVmQ291bnQgPSAxOworICAgIH0KKworICAgIC8qKgorICAgICAqIENhbGxlZCBqdXN0IGJlZm9yZSBhIGZyYW1lIGlzIHN0b3JlZCwgc3VjaCBhcyB3aGVuIHN0b3JpbmcgdG8gYSBjYWNoZSBvciBjb250ZXh0LgorICAgICAqLworICAgIHByb3RlY3RlZCB2b2lkIG9uRnJhbWVTdG9yZSgpIHsKKyAgICB9CisKKyAgICAvKioKKyAgICAgKiBDYWxsZWQgd2hlbiBhIGZyYW1lIGlzIGZldGNoZWQgZnJvbSBhbiBpbnRlcm5hbCBzdG9yZSBzdWNoIGFzIGEgY2FjaGUuCisgICAgICovCisgICAgcHJvdGVjdGVkIHZvaWQgb25GcmFtZUZldGNoKCkgeworICAgIH0KKworICAgIC8vIENvcmUgaW50ZXJuYWwgbWV0aG9kcyAvLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLworICAgIHByb3RlY3RlZCBhYnN0cmFjdCBib29sZWFuIGhhc05hdGl2ZUFsbG9jYXRpb24oKTsKKworICAgIHByb3RlY3RlZCBhYnN0cmFjdCB2b2lkIHJlbGVhc2VOYXRpdmVBbGxvY2F0aW9uKCk7CisKKyAgICBmaW5hbCBpbnQgaW5jUmVmQ291bnQoKSB7CisgICAgICAgICsrbVJlZkNvdW50OworICAgICAgICByZXR1cm4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geworICAgICAgICByZXR1cm4gbUJ5dGVzUGVyU2FtcGxlOworICAgIH0KKworICAgIHB1YmxpYyBpbnQgZ2V0VmFsdWVzUGVyU2FtcGxlKCkgeworICAgICAgICByZXR1cm4gbUJ5dGVzUGVyU2FtcGxlIC8gYnl0ZXNQZXJTYW1wbGVPZihtQmFzZVR5cGUpOworICAgIH0KKworICAgIHB1YmxpYyBpbnQgZ2V0VGFyZ2V0KCkgeworICAgICAgICByZXR1cm4gbVRhcmdldDsKKyAgICB9CisKKyAgICBwdWJsaWMgaW50W10gZ2V0RGltZW5zaW9ucygpIHsKKyAgICAgICAgcmV0dXJuIG1EaW1lbnNpb25zOworICAgIH0KKworICAgIHB1YmxpYyBpbnQgZ2V0RGltZW5zaW9uKGludCBpKSB7CisgICAgICAgIHJldHVybiBtRGltZW5zaW9uc1tpXTsKKyAgICB9CisKKyAgICBwdWJsaWMgaW50IGdldERpbWVuc2lvbkNvdW50KCkgeworICAgICAgICByZXR1cm4gbURpbWVuc2lvbnMgPT0gbnVsbCA/IDAgOiBtRGltZW5zaW9ucy5sZW5ndGg7CisgICAgfQorCisgICAgcHVibGljIGJvb2xlYW4gaGFzTWV0YUtleShTdHJpbmcga2V5KSB7CisgICAgICAgIHJldHVybiBtTWV0YURhdGEgIT0gbnVsbCA/IG1NZXRhRGF0YS5jb250YWluc0tleShrZXkpIDogZmFsc2U7CisgICAgfQorCisgICAgcHVibGljIGJvb2xlYW4gaGFzTWV0YUtleShTdHJpbmcga2V5LCBDbGFzcyBleHBlY3RlZENsYXNzKSB7CisgICAgICAgIGlmIChtTWV0YURhdGEgIT0gbnVsbCAmJiBtTWV0YURhdGEuY29udGFpbnNLZXkoa2V5KSkgeworICAgICAgICAgICAgaWYgKCFleHBlY3RlZENsYXNzLmlzQXNzaWduYWJsZUZyb20obU1ldGFEYXRhLmdldChrZXkpLmdldENsYXNzKCkpKSB7CisgICAgICAgICAgICAgICAgdGhyb3cgbmV3IFJ1bnRpbWVFeGNlcHRpb24oCisgICAgICAgICAgICAgICAgICAgICJGcmFtZUZvcm1hdCBtZXRhLWtleSAnIiArIGtleSArICInIGlzIG9mIHR5cGUgIiArCisgICAgICAgICAgICAgICAgICAgIG1NZXRhRGF0YS5nZXQoa2V5KS5nZXRDbGFzcygpICsgIiBidXQgZXhwZWN0ZWQgdG8gYmUgb2YgdHlwZSAiICsKKyAgICAgICAgICAgICAgICAgICAgZXhwZWN0ZWRDbGFzcyArICIhIik7CisgICAgICAgICAgICB9CisgICAgICAgICAgICByZXR1cm4gdHJ1ZTsKKyAgICAgICAgfQorICAgICAgICByZXR1cm4gZmFsc2U7CisgICAgfQorCisgICAgcHVibGljIE9iamVjdCBnZXRNZXRhVmFsdWUoU3RyaW5nIGtleSkgeworICAgICAgICByZXR1cm4gbU1ldGFEYXRhICE9IG51bGwgPyBtTWV0YURhdGEuZ2V0KGtleSkgOiBudWxsOworICAgIH0KKworICAgIHB1YmxpYyBpbnQgZ2V0TnVtYmVyT2ZEaW1lbnNpb25zKCkgeworICAgICAgICByZXR1cm4gbURpbWVuc2lvbnMgIT0gbnVsbCA/IG1EaW1lbnNpb25zLmxlbmd0aCA6IDA7CisgICAgfQorCisgICAgcHVibGljIGludCBnZXRMZW5ndGgoKSB7CisgICAgICAgIHJldHVybiAobURpbWVuc2lvbnMgIT0gbnVsbCAmJiBtRGltZW5zaW9ucy5sZW5ndGggPj0gMSkgPyBtRGltZW5zaW9uc1swXSA6IC0xOworICAgIH0KKworICAgIHB1YmxpYyBpbnQgZ2V0V2lkdGgoKSB7CisgICAgICAgIHJldHVybiBnZXRMZW5ndGgoKTsKKyAgICB9CisKKyAgICBwdWJsaWMgaW50IGdldEhlaWdodCgpIHsKKyAgICAgICAgcmV0dXJuIChtRGltZW5zaW9ucyAhPSBudWxsICYmIG1EaW1lbnNpb25zLmxlbmd0aCA+PSAyKSA/IG1EaW1lbnNpb25zWzFdIDogLTE7CisgICAgfQorCisgICAgcHVibGljIGludCBnZXREZXB0aCgpIHsKKy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WxzZTsKKyAgICAgICAgfQorCisgICAgICAgIC8vIENoZWNrIHRhcmdldAorICAgICAgICBpZiAoc3BlY2lmaWNhdGlvbi5nZXRUYXJnZXQoKSAhPSBUQVJHRVRfVU5TUEVDSUZJRUQKKyAgICAgICAgICAgICYmIGdldFRhcmdldCgpICE9IHNwZWNpZmljYXRpb24uZ2V0VGFyZ2V0KCkpIHsKKyAgICAgICAgICAgIHJldHVybiBmYWxzZTsKKyAgICAgICAgfQorCisgICAgICAgIC8vIENoZWNrIGJ5dGVzIHBlciBzYW1wbGUKKyAgICAgICAgaWYgKHNwZWNpZmljYXRpb24uZ2V0Qnl0ZXNQZXJTYW1wbGUoKSAhPSBCWVRFU19QRVJfU0FNUExFX1VOU1BFQ0lGSUVECisgICAgICAgICAgICAmJiBnZXRCeXRlc1BlclNhbXBsZSgpICE9IHNwZWNpZmljYXRpb24uZ2V0Qnl0ZXNQZXJTYW1wbGUoKSkgeworICAgICAgICAgICAgcmV0dXJuIGZhbHNlOworICAgICAgICB9CisKKyAgICAgICAgLy8gQ2hlY2sgbnVtYmVyIG9mIGRpbWVuc2lvbnMKKyAgICAgICAgaWYgKHNwZWNpZmljYXRpb24uZ2V0RGltZW5zaW9uQ291bnQoKSA+IDAKKyAgICAgICAgICAgICYmIGdldERpbWVuc2lvbkNvdW50KCkgIT0gc3BlY2lmaWNhdGlvbi5nZXREaW1lbnNpb25Db3VudCgpKSB7CisgICAgICAgICAgICByZXR1cm4gZmFsc2U7CisgICAgICAgIH0KKworICAgICAgICAvLyBDaGVjayBkaW1lbnNpb25zCisgICAgICAgIGZvciAoaW50IGkgPSAwOyBpIDwgc3BlY2lmaWNhdGlvbi5nZXREaW1lbnNpb25Db3VudCgpOyArK2kpIHsKKyAgICAgICAgICAgIGludCBzcGVjRGltID0gc3BlY2lmaWNhdGlvbi5nZXREaW1lbnNpb24oaSk7CisgICAgICAgICAgICBpZiAoc3BlY0RpbSAhPSBTSVpFX1VOU1BFQ0lGSUVEICYmIGdldERpbWVuc2lvbihpKSAhPSBzcGVjRGltKSB7CisgICAgICAgICAgICAgICAgcmV0dXJuIGZhbHNlOworICAgICAgICAgICAgfQorICAgICAgICB9CisKKyAgICAgICAgLy8gQ2hlY2sgY2xhc3MKKyAgICAgICAgaWYgKHNwZWNpZmljYXRpb24uZ2V0T2JqZWN0Q2xhc3MoKSAhPSBudWxsKSB7CisgICAgICAgICAgICBpZiAoZ2V0T2JqZWN0Q2xhc3MoKSA9PSBudWxsCisgICAgICAgICAgICAgICAgfHwgIXNwZWNpZmljYXRpb24uZ2V0T2JqZWN0Q2xhc3MoKS5pc0Fzc2lnbmFibGVGcm9tKGdldE9iamVjdENsYXNzKCkpKSB7CisgICAgICAgICAgICAgICAgcmV0dXJuIGZhbHNlOworICAgICAgICAgICAgfQorICAgICAgICB9CisKKyAgICAgICAgLy8gQ2hlY2sgbWV0YS1kYXRhCisgICAgICAgIGlmIChzcGVjaWZpY2F0aW9uLm1NZXRhRGF0YSAhPSBudWxsKSB7CisgICAgICAgICAgICBmb3IgKFN0cmluZyBzcGVjS2V5IDogc3BlY2lmaWNhdGlvbi5tTWV0YURhdGEua2V5U2V0KCkpIHsKKyAgICAgICAgICAgICAgICBpZiAobU1ldGFEYXRhID09IG51bGwKKyAgICAgICAgICAgICAgICB8fCAhbU1ldGFEYXRhLmNvbnRhaW5zS2V5KHNwZWNLZXkpCisgICAgICAgICAgICAgICAgfHwgIW1NZXRhRGF0YS5nZXQoc3BlY0tleSkuZXF1YWxzKHNwZWNpZmljYXRpb24ubU1ldGFEYXRhLmdldChzcGVjS2V5KSkpIHsKKyAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGZhbHNlOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorCisgICAgICAgIC8vIFBhc3NlZCBhbGwgdGhlIHRlc3RzCisgICAgICAgIHJldHVybiB0cnVlOworICAgIH0KKworICAgIHB1YmxpYyBib29sZWFuIG1heUJlQ29tcGF0aWJ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b2YgZGltZW5zaW9ucworICAgICAgICBpZiAoc3BlY2lmaWNhdGlvbi5nZXREaW1lbnNpb25Db3VudCgpID4gMAorICAgICAgICAgICAgJiYgZ2V0RGltZW5zaW9uQ291bnQoKSA+IDAKKyAgICAgICAgICAgICYmIGdldERpbWVuc2lvbkNvdW50KCkgIT0gc3BlY2lmaWNhdGlvbi5nZXREaW1lbnNpb25Db3VudCgpKSB7CisgICAgICAgICAgICByZXR1cm4gZmFsc2U7CisgICAgICAgIH0KKworICAgICAgICAvLyBDaGVjayBkaW1lbnNpb25zCisgICAgICAgIGZvciAoaW50IGkgPSAwOyBpIDwgc3BlY2lmaWNhdGlvbi5nZXREaW1lbnNpb25Db3VudCgpOyArK2kpIHsKKyAgICAgICAgICAgIGludCBzcGVjRGltID0gc3BlY2lmaWNhdGlvbi5nZXREaW1lbnNpb24oaSk7CisgICAgICAgICAgICBpZiAoc3BlY0RpbSAhPSBTSVpFX1VOU1BFQ0lGSUVECisgICAgICAgICAgICAgICAgJiYgZ2V0RGltZW5zaW9uKGkpICE9IFNJWkVfVU5TUEVDSUZJRUQKKyAgICAgICAgICAgICAgICAmJiBnZXREaW1lbnNpb24oaSkgIT0gc3BlY0RpbSkgeworICAgICAgICAgICAgICAgIHJldHVybiBmYWxzZTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorCisgICAgICAgIC8vIENoZWNrIGNsYXNzCisgICAgICAgIGlmIChzcGVjaWZpY2F0aW9uLmdldE9iamVjdENsYXNzKCkgIT0gbnVsbCAmJiBnZXRPYmplY3RDbGFzcygpICE9IG51bGwpIHsKKyAgICAgICAgICAgIGlmICghc3BlY2lmaWNhdGlvbi5nZXRPYmplY3RDbGFzcygpLmlzQXNzaWduYWJsZUZyb20oZ2V0T2JqZWN0Q2xhc3MoKSkpIHsKKyAgICAgICAgICAgICAgICByZXR1cm4gZmFsc2U7CisgICAgICAgICAgICB9CisgICAgICAgIH0KKworICAgICAgICAvLyBDaGVjayBtZXRhLWRhdGEKKyAgICAgICAgaWYgKHNwZWNpZmljYXRpb24ubU1ldGFEYXRhICE9IG51bGwgJiYgbU1ldGFEYXRhICE9IG51bGwpIHsKKyAgICAgICAgICAgIGZvciAoU3RyaW5nIHNwZWNLZXkgOiBzcGVjaWZpY2F0aW9uLm1NZXRhRGF0YS5rZXlTZXQoKSkgeworICAgICAgICAgICAgICAgIGlmIChtTWV0YURhdGEuY29udGFpbnNLZXkoc3BlY0tleSkKKyAgICAgICAgICAgICAgICAgICAgJiYgIW1NZXRhRGF0YS5nZXQoc3BlY0tleSkuZXF1YWxzKHNwZWNpZmljYXRpb24ubU1ldGFEYXRhLmdldChzcGVjS2V5KSkpIHsKKyAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGZhbHNlOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorCisgICAgICAgIC8vIFBhc3NlZCBhbGwgdGhlIHRlc3RzCisgICAgICAgIHJldHVybiB0cnVlOworICAgIH0KKworICAgIHB1YmxpYyBzdGF0aWMgaW50IGJ5dGVzUGVyU2FtcGxlT2YoaW50IGJhc2VUeXBlKSB7CisgICAgICAgIC8vIERlZmF1bHRzIGJhc2VkIG9uIGJhc2UtdHlwZQorICAgICAgICBzd2l0Y2ggKGJhc2VUeXBlKSB7CisgICAgICAgICAgICBjYXNlIFRZUEVfQklUOgorICAgICAgICAgICAgY2FzZSBUWVBFX0JZVEU6CisgICAgICAgICAgICAgICAgcmV0dXJuIDE7CisgICAgICAgICAgICBjYXNlIFRZUEVfSU5UMTY6CisgICAgICAgICAgICAgICAgcmV0dXJuIDI7CisgICAgICAgICAgICBjYXNlIFRZUEVfSU5UMzI6CisgICAgICAgICAgICBjYXNlIFRZUEVfRkxPQVQ6CisgICAgICAgICAgICBjYXNlIFRZUEVfUE9JTlRFUjoKKyAgICAgICAgICAgICAgICByZXR1cm4gNDsKKyAgICAgICAgICAgIGNhc2UgVFlQRV9ET1VCTEU6CisgICAgICAgICAgICAgICAgcmV0dXJuIDg7CisgICAgICAgICAgICBkZWZhdWx0OgorICAgICAgICAgICAgICAgIHJldHVybiAxOworICAgICAgICB9CisgICAgfQorCisgICAgcHVibGljIHN0YXRpYyBTdHJpbmcgZGltZW5zaW9uc1RvU3RyaW5nKGludFtdIGRpbWVuc2lvbnMpIHsKKyAgICAgICAgU3RyaW5nQnVmZmVyIGJ1ZmZlciA9IG5ldyBTdHJpbmdCdWZmZXIoKTsKKyAgICAgICAgaWYgKGRpbWVuc2lvbnMgIT0gbnVsbCkgeworICAgICAgICAgICAgaW50IG4gPSBkaW1lbnNpb25zLmxlbmd0aDsKKyAgICAgICAgICAgIGZvciAoaW50IGkgPSAwOyBpIDwgbjsgKytpKSB7CisgICAgICAgICAgICAgICAgaWYgKGRpbWVuc2lvbnNbaV0gPT0gU0laRV9VTlNQRUNJRklFRCkgeworICAgICAgICAgICAgICAgICAgICBidWZmZXIuYXBwZW5kKCJbXSIpOworICAgICAgICAgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICAgICAgICAgIGJ1ZmZlci5hcHBlbmQoIlsiICsgU3RyaW5nLnZhbHVlT2YoZGltZW5zaW9uc1tpXSkgKyAiXSIpOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgICAgICByZXR1cm4gYnVmZmVyLnRvU3RyaW5nKCk7CisgICAgfQorCisgICAgcHVibGljIHN0YXRpYyBTdHJpbmcgYmFzZVR5cGVUb1N0cmluZyhpbnQgYmFzZVR5cGUpIHsKKyAgICAgICAgc3dpdGNoIChiYXNlVHlwZSkgeworICAgICAgICAgICAgY2FzZSBUWVBFX1VOU1BFQ0lGSUVEOiByZXR1cm4gInVuc3BlY2lmaWVkIjsKKyAgICAgICAgICAgIGNhc2UgVFlQRV9CSVQ6ICAgICAgICAgcmV0dXJuICJiaXQiOworICAgICAgICAgICAgY2FzZSBUWVBFX0JZVEU6ICAgICAgICByZXR1cm4gImJ5dGUiOworICAgICAgICAgICAgY2FzZSBUWVBFX0lOVDE2OiAgICAgICByZXR1cm4gImludCI7CisgICAgICAgICAgICBjYXNlIFRZUEVfSU5UMzI6ICAgICAgIHJldHVybiAiaW50IjsKKyAgICAgICAgICAgIGNhc2UgVFlQRV9GTE9BVDogICAgICAgcmV0dXJuICJmbG9hdCI7CisgICAgICAgICAgICBjYXNlIFRZUEVfRE9VQkxFOiAgICAgIHJldHVybiAiZG91YmxlIjsKKyAgICAgICAgICAgIGNhc2UgVFlQRV9QT0lOVEVSOiAgICAgcmV0dXJuICJwb2ludGVyIjsKKyAgICAgICAgICAgIGNhc2UgVFlQRV9PQkpFQ1Q6ICAgICAgcmV0dXJuICJvYmplY3QiOworICAgICAgICAgICAgZGVmYXVsdDogICAgICAgICAgICAgICByZXR1cm4gInVua25vd24iOworICAgICAgICB9CisgICAgfQorCisgICAgcHVibGljIHN0YXRpYyBTdHJpbmcgdGFyZ2V0VG9TdHJpbmcoaW50IHRhcmdldCkgeworICAgICAgICBzd2l0Y2ggKHRhcmdldCkgeworICAgICAgICAgICAgY2FzZSBUQVJHRVRfVU5TUEVDSUZJRUQ6ICByZXR1cm4gInVuc3BlY2lmaWVkIjsKKyAgICAgICAgICAgIGNhc2UgVEFSR0VUX1NJTVBMRTogICAgICAgcmV0dXJuICJzaW1wbGUiOworICAgICAgICAgICAgY2FzZSBUQVJHRVRfTkFUSVZFOiAgICAgICByZXR1cm4gIm5hdGl2ZSI7CisgICAgICAgICAgICBjYXNlIFRBUkdFVF9HUFU6ICAgICAgICAgIHJldHVybiAiZ3B1IjsKKyAgICAgICAgICAgIGNhc2UgVEFSR0VUX1ZFUlRFWEJVRkZFUjogcmV0dXJuICJ2Ym8iOworICAgICAgICAgICAgY2FzZSBUQVJHRVRfUlM6ICAgICAgICAgICByZXR1cm4gInJlbmRlcnNjcmlwdCI7CisgICAgICAgICAgICBkZWZhdWx0OiAgICAgICAgICAgICAgICAgIHJldHVybiAidW5rbm93biI7CisgICAgICAgIH0KKyAgICB9CisKK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MoIiArIG1PYmplY3RDbGFzcy5nZXRTaW1wbGVOYW1lKCkgKyAiKSAiKTsKKworICAgICAgICByZXR1cm4gdGFyZ2V0U3RyaW5nCisgICAgICAgICAgICArIGJhc2VUeXBlVG9TdHJpbmcobUJhc2VUeXBlKQorICAgICAgICAgICAgKyBzYW1wbGVDb3VudFN0cmluZworICAgICAgICAgICAgKyBkaW1lbnNpb25zVG9TdHJpbmcobURpbWVuc2lvbnMpCisgICAgICAgICAgICArIGNsYXNzU3RyaW5nCisgICAgICAgICAgICArIG1ldGFEYXRhVG9TdHJpbmcobU1ldGFEYXRhKTsKKyAgICB9CisKKyAgICBwcml2YXRlIHZvaWQgaW5pdERlZmF1bHRzKCkgeworICAgICAgICBtQnl0ZXNQZXJTYW1wbGUgPSBieXRlc1BlclNhbXBsZU9mKG1CYXNlVHlwZSk7CisgICAgfQorCisgICAgLy8gQ29yZSBpbnRlcm5hbCBtZXRob2RzIC8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vCisgICAgaW50IGNhbGNTaXplKGludFtdIGRpbWVuc2lvbnMpIHsKKyAgICAgICAgaWYgKGRpbWVuc2lvbnMgIT0gbnVsbCAmJiBkaW1lbnNpb25zLmxlbmd0aCA+IDApIHsKKyAgICAgICAgICAgIGludCBzaXplID0gZ2V0Qnl0ZXNQZXJTYW1wbGUoKTsKKyAgICAgICAgICAgIGZvciAoaW50IGRpbSA6IGRpbWVuc2lvbnMpIHsKKyAgICAgICAgICAgICAgICBzaXplICo9IGRpbTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIHJldHVybiBzaXplOworICAgICAgICB9CisgICAgICAgIHJldHVybiAwOworICAgIH0KKworICAgIGJvb2xlYW4gaXNSZXBsYWNlYWJsZUJ5KEZyYW1lRm9ybWF0IGZvcm1hdCkgeworICAgICAgICByZXR1cm4gbVRhcmdldCA9PSBmb3J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29udGV4dCgpKSB7CisgICAgICAgICAgICB0aHJvdyBuZXcgUnVudGltZUV4Y2VwdGlvbigiQ291bGQgbm90IGluaXRpYWxpemUgR0xFbnZpcm9ubWVudCB3aXRoIG5ldyBjb250ZXh0ISIpOworICAgICAgICB9CisgICAgfQorCisgICAgcHVibGljIHZvaWQgaW5pdFdpdGhDdXJyZW50Q29udGV4dCgpIHsKKyAgICAgICAgaWYgKCFuYXRpdmVJbml0V2l0aEN1cnJlbnRDb250ZXh0KCkpIHsKKyAgICAgICAgICAgIHRocm93IG5ldyBSdW50aW1lRXhjZXB0aW9uKCJDb3VsZCBub3QgaW5pdGlhbGl6ZSBHTEVudmlyb25tZW50IHdpdGggY3VycmVudCBjb250ZXh0ISIpOworICAgICAgICB9CisgICAgfQorCisgICAgcHVibGljIGJvb2xlYW4gaXNBY3RpdmUoKSB7CisgICAgICAgIHJldHVybiBuYXRpdmVJc0FjdGl2ZSgpOworICAgIH0KKworICAgIHB1YmxpYyBib29sZWFuIGlzQ29udGV4dEFjdGl2ZSgpIHsKKyAgICAgICAgcmV0dXJuIG5hdGl2ZUlzQ29udGV4dEFjdGl2ZSgpOworICAgIH0KKworICAgIHB1YmxpYyBzdGF0aWMgYm9vbGVhbiBpc0FueUNvbnRleHRBY3RpdmUoKSB7CisgICAgICAgIHJldHVybiBuYXRpdmVJc0FueUNvbnRleHRBY3RpdmUoKTsKKyAgICB9CisKKyAgICBwdWJsaWMgdm9pZCBhY3RpdmF0ZSgpIHsKKyAgICAgICAgaWYgKExvb3Blci5teUxvb3BlcigpICE9IG51bGwgJiYgTG9vcGVyLm15TG9vcGVyKCkuZXF1YWxzKExvb3Blci5nZXRNYWluTG9vcGVyKCkpKSB7CisgICAgICAgICAgICBMb2cuZSgiRmlsdGVyRnJhbWV3b3JrIiwgIkFjdGl2YXRpbmcgR0wgY29udGV4dCBpbiBVSSB0aHJlYWQhIik7CisgICAgICAgIH0KKyAgICAgICAgaWYgKCFuYXRpdmVBY3RpdmF0Z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dHVyZSk7CisgICAgICAgIGludCByZXN1bHQgPSBuYXRpdmVBZGRTdXJmYWNlV2lkdGhIZWlnaHQoc3VyZmFjZSwgd2lkdGgsIGhlaWdodCk7CisgICAgICAgIHN1cmZhY2UucmVsZWFzZSgpOworICAgICAgICBpZiAocmVzdWx0IDwgMCkgeworICAgICAgICAgICAgdGhyb3cgbmV3IFJ1bnRpbWVFeGNlcHRpb24oIkVycm9yIHJlZ2lzdGVyaW5nIHN1cmZhY2VUZXh0dXJlICIgKyBzdXJmYWNlVGV4dHVyZSArICIhIik7CisgICAgICAgIH0KKyAgICAgICAgcmV0dXJuIHJlc3VsdDsKKyAgICB9CisKKyAgICBwdWJsaWMgaW50IHJlZ2lzdGVyU3VyZmFjZUZyb21NZWRpYVJlY29yZGVyKE1lZGlhUmVjb3JkZXIgbWVkaWFSZWNvcmRlcikgeworICAgICAgICBpbnQgcmVzdWx0ID0gbmF0aXZlQWRkU3VyZmFjZUZyb21NZWRpYVJlY29yZGVyKG1lZGlhUmVjb3JkZXIpOworICAgICAgICBpZiAocmVzdWx0IDwgMCkgeworICAgICAgICAgICAgdGhyb3cgbmV3IFJ1bnRpbWVFeGNlcHRpb24oIkVycm9yIHJlZ2lzdGVyaW5nIHN1cmZhY2UgZnJvbSAiCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICArICJNZWRpYVJlY29yZGVyIiArIG1lZGlhUmVjb3JkZXIgKyAiISIpOworICAgICAgICB9CisgICAgICAgIHJldHVybiByZXN1bHQ7CisgICAgfQorCisgICAgcHVibGljIHZvaWQgYWN0aXZhdGVTdXJmYWNlV2l0aElkKGludCBzdXJmYWNlSWQpIHsKKyAgICAgICAgaWYgKCFuYXRpdmVBY3RpdmF0ZVN1cmZhY2VJZChzdXJmYWNlSWQpKSB7CisgICAgICAgICAgICB0aHJvdyBuZXcgUnVudGltZUV4Y2VwdGlvbigiQ291bGQgbm90IGFjdGl2YXRlIHN1cmZhY2UgIiArIHN1cmZhY2VJZCAr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gICAgICAgfQorCisgICAgICAgIC8vIENyZWF0ZSBjb3JyZWN0IGZyYW1lCisgICAgICAgIGludCBiaW5kaW5nVHlwZSA9IGdldEJpbmRpbmdUeXBlKCk7CisgICAgICAgIGJvb2xlYW4gcmV1c2FibGUgPSB0cnVlOworICAgICAgICBpZiAoYmluZGluZ1R5cGUgPT0gRnJhbWUuTk9fQklORElORykgeworICAgICAgICAgICAgaW5pdE5ldyhmYWxzZSk7CisgICAgICAgIH0gZWxzZSBpZiAoYmluZGluZ1R5cGUgPT0gRVhURVJOQUxfVEVYVFVSRSkgeworICAgICAgICAgICAgaW5pdE5ldyh0cnVlKTsKKyAgICAgICAgICAgIHJldXNhYmxlID0gZmFsc2U7CisgICAgICAgIH0gZWxzZSBpZiAoYmluZGluZ1R5cGUgPT0gRVhJU1RJTkdfVEVYVFVSRV9CSU5ESU5HKSB7CisgICAgICAgICAgICBpbml0V2l0aFRleHR1cmUoKGludClnZXRCaW5kaW5nSWQoKSk7CisgICAgICAgIH0gZWxzZSBpZiAoYmluZGluZ1R5cGUgPT0gRVhJU1RJTkdfRkJPX0JJTkRJTkcpIHsKKyAgICAgICAgICAgIGluaXRXaXRoRmJvKChpbnQpZ2V0QmluZGluZ0lkKCkpOworICAgICAgICB9IGVsc2UgaWYgKGJpbmRpbmdUeXBlID09IE5FV19URVhUVVJFX0JJTkRJTkcpIHsKKyAgICAgICAgICAgIGluaXRXaXRoVGV4dHVyZSgoaW50KWdldEJpbmRpbmdJZCgpKTsKKyAgICAgICAgfSBlbHNlIGlmIChiaW5kaW5nVHlwZSA9PSBORVdfRkJPX0JJTkRJTkcpIHsKKyAgICAgICAgICAgIGluaXRXaXRoRmJvKChpbnQpZ2V0QmluZGluZ0lkKCkpOworICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgdGhyb3cgbmV3IFJ1bnRpbWVFeGNlcHRpb24oIkF0dGVtcHRpbmcgdG8gY3JlYXRlIEdMIGZyYW1lIHdpdGggdW5rbm93biBiaW5ka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sb2NhdGUgdGV4dHVyZSBiYWNrZWQgR0wgZnJhbWUhIik7CisgICAgICAgIH0KKyAgICAgICAgbU93bnNUZXh0dXJlID0gZmFsc2U7CisgICAgICAgIG1hcmtSZWFkT25seSgpOworICAgIH0KKworICAgIHByaXZhdGUgdm9pZCBpbml0V2l0aEZibyhpbnQgZmJvSWQpIHsKKyAgICAgICAgaW50IHdpZHRoID0gZ2V0Rm9ybWF0KCkuZ2V0V2lkdGgoKTsKKyAgICAgICAgaW50IGhlaWdodCA9IGdldEZvcm1hdCgpLmdldEhlaWdodCgpOworICAgICAgICBpZiAoIW5hdGl2ZUFsbG9jYXRlV2l0aEZibyhtR0xFbnZpcm9ubWVudCwgZmJvSWQsIHdpZHRoLCBoZWlnaHQpKSB7CisgICAgICAgICAgICB0aHJvdyBuZXcgUnVudGltZUV4Y2VwdGlvbigiQ291bGQgbm90IGFsbG9jYXRlIEZCTyBiYWNrZWQgR0wgZnJhbWUhIik7CisgICAgICAgIH0KKyAgICB9CisKKyAgICB2b2lkIGZsdXNoR1BVKFN0cmluZyBtZXNzYWdlKSB7CisgICAgICAgIFN0b3BXYXRjaE1hcCB0aW1lciA9IEdMRnJhbWVUaW1lci5nZXQoKTsKKyAgICAgICAgaWYgKHRpbWVyLkxPR19NRkZfUlVOTklOR19USU1FUykgeworICAgICAgICAgIHRpbWVyLnN0YXJ0KCJnbEZpbmlzaCAiICsgbWVzc2FnZSk7CisgICAgICAgICAgR0xFUzIwLmdsRmluaXNoKCk7CisgICAgICAgICAgdGltZXIuc3RvcCgiZ2xGaW5pc2ggIiArIG1lc3NhZ2UpOworICAgICAgICB9CisgICAgfQorCisgICAgQE92ZXJyaWRlCisgICAgcHJvdGVjdGVkIHN5bmNocm9uaXplZCBib29sZWFuIGhhc05hdGl2ZUFsbG9jYXRpb24oKSB7CisgICAgICAgIHJldHVybiBnbEZyYW1lSWQgIT0gLTE7CisgICAgfQorCisgICAgQE92ZXJyaWRlCisgICAgcHJvdGVjdGVkIHN5bmNocm9uaXplZCB2b2lkIHJlbGVhc2VOYXRpdmVBbGxvY2F0aW9uKCkgeworICAgICAgICBuYXRpdmVEZWFsbG9jYXRlKCk7CisgICAgICAgIGdsRnJhbWVJZCA9IC0xOworICAgIH0KKworICAgIHB1YmxpYyBHTEVudmlyb25tZW50IGdldEdMRW52aXJvbm1lbnQoKSB7CisgICAgICAgIHJldHVybiBtR0xFbnZpcm9ubWVudDsKKyAgICB9CisKKyAgICBAT3ZlcnJpZGUKKyAgICBwdWJsaWMgT2JqZWN0IGdldE9iamVjdFZhbHVlKCkgeworICAgICAgICBhc3NlcnRHTEVudlZhbGlkKCk7CisgICAgICAgIHJldHVybiBCeXRlQnVmZmVyLndyYXAoZ2V0TmF0aXZlRGF0YSgpKTsKKyAgICB9CisKKyAgICBAT3ZlcnJpZGUKKyAgICBwdWJsaWMgdm9pZCBzZXRJbnRzKGludFtdIGludHMpIHsKKyAgICAgICAgYXNzZXJ0RnJhbWVNdXRhYmxlKCk7CisgICAgICAgIGFzc2VydEdMRW52VmFsaWQoKTsKKyAgICAgICAgaWYgKCFzZXROYXRpdmVJbnRzKGludHMpKSB7CisgICAgICAgICAgICB0aHJvdyBuZXcgUnVudGltZUV4Y2VwdGlvbigiQ291bGQgbm90IHNldCBpbnQgdmFsdWVzIGZvciBHTCBmcmFtZSEiKTsKKyAgICAgICAgfQorICAgIH0KKworICAgIEBPdmVycmlkZQorICAgIHB1YmxpYyBpbnRbXSBnZXRJbnRzKCkgeworICAgICAgICBhc3NlcnRHTEVudlZhbGlkKCk7CisgICAgICAgIGZsdXNoR1BVKCJnZXRJbnRzIik7CisgICAgICAgIHJldHVybiBnZXROYXRpdmVJbnRzKCk7CisgICAgfQorCisgICAgQE92ZXJyaWRlCisgICAgcHVibGljIHZvaWQgc2V0RmxvYXRzKGZsb2F0W10gZmxvYXRzKSB7CisgICAgICAgIGFzc2VydEZyYW1lTXV0YWJsZSgpOworICAgICAgICBhc3NlcnRHTEVudlZhbGlkKCk7CisgICAgICAgIGlmICghc2V0TmF0aXZlRmxvYXRzKGZsb2F0cykpIHsKKyAgICAgICAgICAgIHRocm93IG5ldyBSdW50aW1lRXhjZXB0aW9uKCJDb3VsZCBub3Qgc2V0IGludCB2YWx1ZXMgZm9yIEdMIGZyYW1lISIpOworICAgICAgICB9CisgICAgfQorCisgICAgQE92ZXJyaWRlCisgICAgcHVibGljIGZsb2F0W10gZ2V0RmxvYXRzKCkgeworICAgICAgICBhc3NlcnRHTEVudlZhbGlkKCk7CisgICAgICAgIGZsdXNoR1BVKCJnZXRGbG9hdHMiKTsKKyAgICAgICAgcmV0dXJuIGdldE5hdGl2ZUZsb2F0cygpOworICAgIH0KKworICAgIEBPdmVycmlkZQorICAgIHB1YmxpYyB2b2lkIHNldERhdGEoQnl0ZUJ1ZmZlciBidWZmZXIsIGludCBvZmZzZXQsIGludCBsZW5ndGgpIHsKKyAgICAgICAgYXNzZXJ0RnJhbWVNdXRhYmxlKCk7CisgICAgICAgIGFzc2VydEdMRW52VmFsaWQoKTsKKyAgICAgICAgYnl0ZVtdIGJ5dGVzID0gYnVmZmVyLmFycmF5KCk7CisgICAgICAgIGlmIChnZXRGb3JtYXQoKS5nZXRTaXplKCkgIT0gYnl0ZXMubGVuZ3RoKSB7CisgICAgICAgICAgICB0aHJvdyBuZXcgUnVudGltZUV4Y2VwdGlvbigiRGF0YSBzaXplIGluIHNldERhdGEgZG9lcyBub3QgbWF0Y2ggR0wgZnJhbWUgc2l6ZSEiKTsKKyAgICAgICAgfSBlbHNlIGlmICghc2V0TmF0aXZlRGF0YShieXRlcywgb2Zmc2V0LCBsZW5ndGgpKSB7CisgICAgICAgICAgICB0aHJvdyBuZXcgUnVudGltZUV4Y2VwdGlvbigiQ291bGQgbm90IHNldCBHTCBmcmFtZSBkYXRhISIpOworICAgICAgICB9CisgICAgfQorCisgICAgQE92ZXJyaWRlCisgICAgcHVibGljIEJ5dGVCdWZmZXIgZ2V0RGF0YSgpIHsKKyAgICAgICAgYXNz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bWFwIHJlc3VsdCA9IEJpdG1hcC5jcmVhdGVCaXRtYXAoZ2V0Rm9ybWF0KCkuZ2V0V2lkdGgoKSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZ2V0Rm9ybWF0KCkuZ2V0SGVpZ2h0KCksCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEJpdG1hcC5Db25maWcuQVJHQl84ODg4KTsKKyAgICAgICAgaWYgKCFnZXROYXRpdmVCaXRtYXAocmVzdWx0KSkgeworICAgICAgICAgICAgdGhyb3cgbmV3IFJ1bnRpbWVFeGNlcHRpb24oIkNvdWxkIG5vdCBnZXQgYml0bWFwIGRhdGEgZnJvbSBHTCBmcmFtZSEiKTsKKyAgICAgICAgfQorICAgICAgICByZXR1cm4gcmVzdWx0OworICAgIH0KKworICAgIEBPdmVycmlkZQorICAgIHB1YmxpYyB2b2lkIHNldERhdGFGcm9tRnJhbWUoRnJhbWUgZnJhbWUpIHsKKyAgICAgICAgYXNzZXJ0R0xFbnZWYWxpZCgpOworCisgICAgICAgIC8vIE1ha2Ugc3VyZSBmcmFtZSBmaXRzCisgICAgICAgIGlmIChnZXRGb3JtYXQoKS5nZXRTaXplKCkgPCBmcmFtZS5nZXRGb3JtYXQoKS5nZXRTaXplKCkpIHsKKyAgICAgICAgICAgIHRocm93IG5ldyBSdW50aW1lRXhjZXB0aW9uKAorICAgICAgICAgICAgICAgICJBdHRlbXB0aW5nIHRvIGFzc2lnbiBmcmFtZSBvZiBzaXplICIgKyBmcmFtZS5nZXRGb3JtYXQoKS5nZXRTaXplKCkgKyAiIHRvICIgKworICAgICAgICAgICAgICAgICJzbWFsbGVyIEdMIGZyYW1lIG9mIHNpemUgIiArIGdldEZvcm1hdCgpLmdldFNpemUoKSArICIhIik7CisgICAgICAgIH0KKworICAgICAgICAvLyBJbnZva2Ugb3B0aW1pemVkIGltcGxlbWVudGF0aW9ucyBpZiBwb3NzaWJsZQorICAg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1pcE1hcCgpKSB7CisgICAgICAgICAgICB0aHJvdyBuZXcgUnVudGltZUV4Y2VwdGlvbigiQ291bGQgbm90IGdlbmVyYXRlIG1pcC1tYXAgZm9yIEdMIGZyYW1lISIpOworICAgICAgICB9CisgICAgfQorCisgICAgcHVibGljIHZvaWQgc2V0VGV4dHVyZVBhcmFtZXRlcihpbnQgcGFyYW0sIGludCB2YWx1ZSkgeworICAgICAgICBhc3NlcnRGcmFtZU11dGFibGUoKTsKKyAgICAgICAgYXNzZXJ0R0xFbnZWYWxpZCgpOworICAgICAgICBpZiAoIXNldE5hdGl2ZVRleHR1cmVQYXJhbShwYXJhbSwgdmFsdWUpKSB7CisgICAgICAgICAgICB0aHJvdyBuZXcgUnVudGltZUV4Y2VwdGlvbigiQ291bGQgbm90IHNldCB0ZXh0dXJlIHZhbHVlICIgKyBwYXJhbSArICIgPSAiICsgdmFsdWUgKyAiICIgKworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgImZvciBHTEZyYW1lISIpOworICAgICAgICB9CisgICAgfQorCisgICAgcHVibGljIGludCBnZXRUZXh0dXJlSWQoKSB7CisgICAgICAgIHJldHVybiBnZXROYXRpdmVUZXh0dXJlSWQoKTsKKyAgICB9CisKKyAgICBwdWJsaWMgaW50IGdldEZib0lkKCkgeworICAgICAgICByZXR1cm4gZ2V0TmF0aXZlRmJvSWQoKTsKKyAgICB9CisKKyAgICBwdWJsaWMgdm9pZCBmb2N1cygpIHsKKyAgICAgICAgaWYgKCFuYXRpdmVGb2N1cygpKSB7CisgICAgICAgICAgICB0aHJvdyBuZXcgUnVudGltZUV4Y2VwdGlvbigiQ291bGQgbm90IGZvY3VzIG9uIEdMRnJhbWUgZm9yIGRyYXdpbmchIik7CisgICAgICAgIH0KKyAgICB9CisKKyAgICBAT3ZlcnJpZGUKKyAgICBwdWJsaWMgU3RyaW5nIHRvU3RyaW5nKCkgeworICAgICAgICByZXR1cm4gIkdMRnJhbWUgaWQ6ICIgKyBnb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AgIH0KKyAgICB9CisKKyAgICBwcml2YXRlIHZvaWQgYXNzZXJ0R0xFbnZWYWxpZCgpIHsKKyAgICAgICAgaWYgKCFtR0xFbnZpcm9ubWVudC5pc0NvbnRleHRBY3RpdmUoKSkgeworICAgICAgICAgICAgaWYgKEdMRW52aXJvbm1lbnQuaXNBbnlDb250ZXh0QWN0aXZlKCkpIHsKKyAgICAgICAgICAgICAgICB0aHJvdyBuZXcgUnVudGltZUV4Y2VwdGlvbigiQXR0ZW1wdGluZyB0byBhY2Nlc3MgIiArIHRoaXMgKyAiIHdpdGggZm9yZWlnbiBHTCAiICsKKyAgICAgICAgICAgICAgICAgICAgImNvbnRleHQgYWN0aXZlISIpOworICAgICAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgICAgICB0aHJvdyBuZXcgUnVudGltZUV4Y2VwdGlvbigiQXR0ZW1wdGluZyB0byBhY2Nlc3MgIiArIHRoaXMgKyAiIHdpdGggbm8gR0wgY29udGV4dCAiICsKKyAgICAgICAgICAgICAgICAgICAgIiBhY3RpdmUhIik7CisgICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICB9CisKKyAgICBzdGF0aWMgeworICAgICAgICBTeXN0ZW0ubG9hZExpYnJhcnkoImZpbHRlcmZ3Iik7CisgICAgfQorCisgICAgcHJpdmF0ZSBuYXRpdmUgYm9vbGVhbiBuYXRpdmVBbGxvY2F0ZShHTEVudmlyb25tZW50IGVudiwgaW50IHdpZHRoLCBpbnQgaGVpZ2h0KTsKKworICAgIHByaXZhdGUgbmF0aXZlIGJvb2xlYW4gbmF0aXZlQWxsb2NhdGVXaXRoVGV4dHVyZShHTEVudmlyb25tZW50IGVudiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaW50IHRleHR1cmVJZCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaW50IHdpZHRoLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpbnQgaGVpZ2h0KTsKKworICAgIHByaXZhdGUgbmF0aXZlIGJvb2xlYW4gbmF0aXZlQWxsb2NhdGVXaXRoRmJvKEdMRW52aXJvbm1lbnQgZW52LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGludCBmYm9JZCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpbnQgd2lkdGgsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaW50IGhlaWdodCk7CisKKyAgICBwcml2YXRlIG5hdGl2ZSBib29sZWFuIG5hdGl2ZUFsbG9jYXRlRXh0ZXJuYWwoR0xFbnZpcm9ubWVudCBlbnYpOworCisgICAgcHJpdmF0ZSBuYXRpdmUgYm9vbGVhbiBuYXRpdmVEZWFsbG9jYXRlKCk7CisKKyAgICBwcml2YXRlIG5hdGl2ZSBib29sZWFuIHNldE5hdGl2ZURhdGEoYnl0ZVtdIGRhdGEsIGludCBvZmZzZXQsIGludCBsZW5ndGgpOworCisgICAgcHJpdmF0ZSBuYXRpdmUgYnl0ZVtdIGdldE5hdGl2ZURhdGEoKTsKKworICAgIHByaXZhdGUgbmF0aXZlIGJvb2xlYW4gc2V0TmF0aXZlSW50cyhpbnRbXSBpbnRzKTsKKworICAgIHByaXZhdGUgbmF0aXZlIGJvb2xlYW4gc2V0TmF0aXZlRmxvYXRzKGZsb2F0W10gZmxvYXRzKTsKKworICAgIHByaXZhdGUgbmF0aXZlIGludFtdIGdldE5hdGl2ZUludHMoKTsKKworICAgIHByaXZhdGUgbmF0aXZlIGZsb2F0W10gZ2V0TmF0aXZlRmxvYXRzKCk7CisKKyAgICBwcml2YXRlIG5hdGl2ZSBib29sZWFuIHNldE5hdGl2ZUJpdG1hcChCaXRtYXAgYml0bWFwLCBpbnQgc2l6ZSk7CisKKyAgICBwcml2YXRlIG5hdGl2ZSBib29sZWFuIGdldE5hdGl2ZUJpdG1hc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N0aXZhdGVHbENvbnRleHQoKSB7CisgICAgICAgIEdMRW52aXJvbm1lbnQgZ2xFbnYgPSBtRmlsdGVyQ29udGV4dC5nZXRHTEVudmlyb25tZW50KCk7CisgICAgICAgIGlmIChnbEVudiAhPSBudWxsICYmICFnbEVudi5pc0FjdGl2ZSgpKSB7CisgICAgICAgICAgICBnbEVudi5hY3RpdmF0ZSgpOworICAgICAgICAgICAgcmV0dXJuIHRydWU7CisgICAgICAgIH0KKyAgICAgICAgcmV0dXJuIGZhbHNlOworICAgIH0KKworICAgIC8qKgorICAgICAqIEhlbHBlciBmdW5jdGlvbiBmb3Igc3ViY2xhc3NlcyB0byBkZWFjdGl2YXRlIHRoZSBHTCBlbnZpcm9ubWVudCBhZnRlciBydW5uaW5nLgorICAgICAqLworICAgIHByb3RlY3RlZCB2b2lkIGRlYWN0aXZhdGVHbENvbnRleHQoKSB7CisgICAgICAgIEdMRW52aXJvbm1lbnQgZ2xFbnYgPSBtRmlsdGVyQ29udGV4dC5nZXRHTEVudmlyb25tZW50KCk7CisgICAgICAgIGlmIChnbEVudiAhPSBudWxsKSB7CisgICAgICAgICAgICBnbEVudi5kZWFjdGl2YXRlKCk7CisgICAgICAgIH0KKyAgICB9CisKKyAgICAvKiogU3RhcnRzIHJ1bm5pbmcgdGhlIGdyYXBoLiBXaWxsIG9wZW4gdGhlIGZpbHRlcnMgaW4gdGhlIGdyYXBoIGlmIHRoZXkgYXJlIG5vdCBhbHJlYWR5IG9wZW4uICovCisgICAgcHVibGljIGFic3RyYWN0IHZvaWQgcnVuKCk7CisKKyAgICBwdWJsaWMgYWJzdHJhY3Qgdm9pZCBzZXREb25lQ2FsbGJhY2soT25SdW5uZXJEb25lTGlzdGVuZXIgbGlzdGVuZXIpOworICAgIHB1YmxpYyBhYnN0cmFjdCBib29sZWFuIGlzUnVubmluZygpOworCisgICAgLyoqIFN0b3BzIGdyYXBoIGV4ZWN1dGlvbi4gQXMgcGFydCBvZiBzdG9wcGluZywgYWxzby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geworICAgICAgICAgICAgdGhyb3cgbmV3IFJ1bnRpbWVFeGNlcHRpb24odGhpcyArICIgYWxyZWFkeSBjb25uZWN0ZWQgdG8gIiArIG1Tb3VyY2VQb3J0ICsgIiEiKTsKKyAgICAgICAgfQorICAgICAgICBtU291cmNlUG9ydCA9IHNvdXJjZTsKKyAgICB9CisKKyAgICBwdWJsaWMgYm9vbGVhbiBpc0Nvbm5lY3RlZCgpIHsKKyAgICAgICAgcmV0dXJuIG1Tb3VyY2VQb3J0ICE9IG51bGw7CisgICAgfQorCisgICAgcHVibGljIHZvaWQgb3BlbigpIHsKKyAgICAgICAgc3VwZXIub3BlbigpOworICAgICAgICBpZiAobVNvdXJjZVBvcnQgIT0gbnVsbCAmJiAhbVNvdXJjZVBvcnQuaXNPcGVuKCkpIHsKKyAgICAgICAgICAgIG1Tb3VyY2VQb3J0Lm9wZW4oKTsKKyAgICAgICAgfQorICAgIH0KKworICAgIHB1YmxpYyB2b2lkIGNsb3NlKCkgeworICAgICAgICBpZiAobVNvdXJjZVBvcnQgIT0gbnVsbCAmJiBtU291cmNlUG9ydC5pc09wZW4oKSkgeworICAgICAgICAgICAgbVNvdXJjZVBvcnQuY2xvc2UoKTsKKyAgICAgICAgfQorICAgICAgICBzdXBlci5jbG9zZSgpOworICAgIH0KKworICAgIHB1YmxpYyBPdXRwdXRQb3J0IGdldFNvdXJjZVBvcnQoKSB7CisgICAgICAgIHJldHVybiBtU291cmNlUG9ydDsKKyAgICB9CisKKyAgICBwdWJsaWMgRmlsdGVyIGdldFNvdXJjZUZpbHRlcigpIHsKKyAgICAgICAgcmV0dXJuIG1Tb3VyY2VQb3J0ID09IG51bGwgPyBudWxsIDogbVNvdXJjZVBvcnQuZ2V0RmlsdGVyKCk7CisgICAgfQorCisgICAgcHVibGljIEZyYW1lRm9ybWF0IGdldFNvdXJjZUZvcm1hdCgpIHsKKyAgICAgICAgcmV0dXJuIG1Tb3VyY2VQb3J0ICE9IG51bGwgPyBtU291cmNlUG9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CisgICAgICAgIGlmIChrZXlWYWx1ZXMubGVuZ3RoICUgMiAhPSAwKSB7CisgICAgICAgICAgICB0aHJvdyBuZXcgUnVudGltZUV4Y2VwdGlvbigiS2V5LVZhbHVlIGFyZ3VtZW50cyBwYXNzZWQgaW50byBzZXRLZXlWYWx1ZXMgbXVzdCBiZSAiCisgICAgICAgICAgICArICJhbiBhbHRlcm5hdGluZyBsaXN0IG9mIGtleXMgYW5kIHZhbHVlcyEiKTsKKyAgICAgICAgfQorICAgICAgICBmb3IgKGludCBpID0gMDsgaSA8IGtleVZhbHVlcy5sZW5ndGg7IGkgKz0gMikgeworICAgICAgICAgICAgaWYgKCEoa2V5VmFsdWVzW2ldIGluc3RhbmNlb2YgU3RyaW5nKSkgeworICAgICAgICAgICAgICAgIHRocm93IG5ldyBSdW50aW1lRXhjZXB0aW9uKCJLZXktdmFsdWUgYXJndW1lbnQgIiArIGkgKyAiIG11c3QgYmUgYSBrZXkgb2YgdHlwZSAiCisgICAgICAgICAgICAgICAgICAgICsgIlN0cmluZywgYnV0IGZvdW5kIGFuIG9iamVjdCBvZiB0eXBlICIgKyBrZXlWYWx1ZXNbaV0uZ2V0Q2xhc3MoKSArICIhIik7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBTdHJpbmcga2V5ID0gKFN0cmluZylrZXlWYWx1ZXNbaV07CisgICAgICAgICAgICBPYmplY3QgdmFsdWUgPSBrZXlWYWx1ZXNbaSsxXTsKKyAgICAgICAgICAgIHB1dChrZXksIHZhbHVlKTsKKyAgICAgICAgfQorICAgIH0KKworICAgIHB1YmxpYyBzdGF0aWMgS2V5VmFsdWVNYXAgZnJvbUtleVZhbHVlcyhPYmplY3QuLi4ga2V5VmFsdWVzKSB7CisgICAgICAgIEtleVZhbHVlTWFwIHJlc3VsdCA9IG5ldyBLZXlWYWx1ZU1hcCgpOworICAgICAgICByZXN1bHQuc2V0S2V5VmFsdWVzKGtleVZhbHVlcyk7CisgICAgICAgIHJldHVybiByZXN1bHQ7CisgICAgfQorCisgICAgcHVibGljIFN0cmluZyBnZXRTdHJpbmcoU3RyaW5nIGtleSkgeworICAgICAgICBPYmplY3QgcmVzdWx0ID0gZ2V0KGtleSk7CisgICAgICAgIHJldHVybiByZXN1bHQgIT0gbnVsbCA/IChTdHJpbmcpcmVzdWx0IDogbnVsbDsKKyAgICB9CisKKyAgICBwdWJsaWMgaW50IGdldEludChTdHJpbmcga2V5KSB7CisgICAgICAgIE9iamVjdCByZXN1bHQgPSBnZXQoa2V5KTsKKyAgICAgICAgcmV0dXJuIHJlc3VsdCAhPSBudWxsID8gKEludGVnZXIpcmVzdWx0IDogbnVsbDsKKyAgICB9CisKKyAgICBwdWJsaWMgZmxvYXQgZ2V0RmxvYXQoU3RyaW5nIGtleSkgeworICAgICAgICBPYmplY3QgcmVzdWx0ID0gZ2V0KGtleSk7CisgICAgICAgIHJldHVybiByZXN1bHQgIT0gbnVsbCA/IChGbG9hdClyZXN1bHQgOiBudWxsOworICAgIH0KKworICAgIEBPdmVycmlkZQorICAgIHB1YmxpYyBTdHJpbmcgdG9TdHJpbmcoKSB7CisgICAgICAgIFN0cmluZ1dyaXRlciB3cml0ZXIgPSBuZXcgU3RyaW5nV3JpdGVyKCk7CisgICAgICAgIGZvciAoTWFwLkVudHJ5PFN0cmluZywgT2JqZWN0PiBlbnRyeSA6IGVudHJ5U2V0KCkpIHsKKyAgICAgICAgICAgIFN0cmluZyB2YWx1ZVN0cmluZzsKKyAgICAgICAgICAgIE9iamVjdCB2YWx1ZSA9IGVudHJ5LmdldFZhbHVlKCk7CisgICAgICAgICAgICBpZiAodmFsdWUgaW5zdGFuY2VvZiBTdHJpbmcpIHsKKyAgICAgICAgICAgICAgICB2YWx1ZVN0cmluZyA9ICJcIiIgKyB2YWx1ZSArICJcIiI7CisgICAgICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgICAgIHZhbHVlU3RyaW5nID0gdmFsdWUudG9TdHJpbmcoKTsKKyAgICAgICAgICAgIH0KKyAgICA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QgdGFyZ2V0KSB7CisgICAgICAgIG1UYXJnZXQgPSB0YXJnZXQ7CisgICAgfQorCisgICAgcHVibGljIHZvaWQgc2V0Qnl0ZXNQZXJTYW1wbGUoaW50IGJ5dGVzUGVyU2FtcGxlKSB7CisgICAgICAgIG1CeXRlc1BlclNhbXBsZSA9IGJ5dGVzUGVyU2FtcGxlOworICAgICAgICBtU2l6ZSA9IFNJWkVfVU5LTk9XTjsKKyAgICB9CisKKyAgICBwdWJsaWMgdm9pZCBzZXREaW1lbnNpb25zKGludFtdIGRpbWVuc2lvbnMpIHsKKyAgICAgICAgbURpbWVuc2lvbnMgPSAoZGltZW5zaW9ucyA9PSBudWxsKSA/IG51bGwgOiBBcnJheXMuY29weU9mKGRpbWVuc2lvbnMsIGRpbWVuc2lvbnMubGVuZ3RoKTsKKyAgICAgICAgbVNpemUgPSBTSVpFX1VOS05PV047CisgICAgfQorCisgICAgcHVibGljIHZvaWQgc2V0RGltZW5zaW9ucyhpbnQgc2l6ZSkgeworICAgICAgICBpbnRbXSBkaW1lbnNpb25zID0gbmV3IGludFsxXTsKKyAgICAgICAgZGltZW5zaW9uc1swXSA9IHNpemU7CisgICAgICAgIG1EaW1lbnNpb25zID0gZGltZW5zaW9uczsKKyAgICAgICAgbVNpemUgPSBTSVpFX1VOS05PV047CisgICAgfQorCisgICAgcHVibGljIHZvaWQgc2V0RGltZW5zaW9ucyhpbnQgd2lkdGgsIGludCBoZWlnaHQpIHsKKyAgICAgICAgaW50W10gZGltZW5zaW9ucyA9IG5ldyBpbnRbMl07CisgICAgICAgIGRpbWVuc2lvbnNbMF0gPSB3aWR0aDsKKyAgICAgICAgZGltZW5zaW9uc1sxXSA9IGhlaWdodDsKKyAgICAgICAgbURpbWVuc2lvbnMgPSBkaW1lbnNpb25zOworICAgICAgICBtU2l6ZSA9IFNJWkVfVU5LTk9XTjsKKyAgICB9CisKKyAgICBwdWJsaWMgdm9pZCBzZXREaW1lbnNpb25zKGludCB3aWR0aCwgaW50IG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YSA9IHRydWU7CisgICAgfQorCisgICAgcHVibGljIE5hdGl2ZUJ1ZmZlciBtdXRhYmxlQ29weSgpIHsKKyAgICAgICAgTmF0aXZlQnVmZmVyIHJlc3VsdCA9IG51bGw7CisgICAgICAgIHRyeSB7CisgICAgICAgICAgICBDbGFzcyBteUNsYXNzID0gZ2V0Q2xhc3MoKTsKKyAgICAgICAgICAgIHJlc3VsdCA9IChOYXRpdmVCdWZmZXIpbXlDbGFzcy5uZXdJbnN0YW5jZSgpOworICAgICAgICB9IGNhdGNoIChFeGNlcHRpb24gZSkgeworICAgICAgICAgICAgdGhyb3cgbmV3IFJ1bnRpbWVFeGNlcHRpb24oIlVuYWJsZSB0byBhbGxvY2F0ZSBhIGNvcHkgb2YgIiArIGdldENsYXNzKCkgKyAiISBNYWtlICIgKworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgInN1cmUgdGhlIGNsYXNzIGhhcyBhIGRlZmF1bHQgY29uc3RydWN0b3IhIik7CisgICAgICAgIH0KKyAgICAgICAgaWYgKG1TaXplID4gMCAmJiAhbmF0aXZlQ29weVRvKHJlc3VsdCkpIHsKKyAgICAgICAgICAgIHRocm93IG5ldyBSdW50aW1lRXhjZXB0aW9uKCJGYWlsZWQgdG8gY29weSBOYXRpdmVCdWZmZXIgdG8gbXV0YWJsZSBpbnN0YW5jZSEiKTsKKyAgICAgICAgfQorICAgICAgICByZXR1cm4gcmVzdWx0OworICAgIH0KKworICAgIHB1YmxpYyBpbnQgc2l6ZSgpIHsKKyAgICAgICAgcmV0dXJuIG1TaXplOworICAgIH0KKworICAgIHB1YmxpYyBpbnQgY291bnQoKSB7CisgICAgICAgIHJldHVybiAobURhdGFQb2ludGVyICE9IDApID8gbVNpemUgLyBnZXRFbGVtZW50U2l6ZSgpIDogMDsKKyAgICB9CisKKyAgICBwdWJsaWMgaW50IGdldEVsZW1lbnRTaXplKCkgeworICAgICAgICByZXR1cm4gMTsKKyAgICB9CisKKyAgICBwdWJsaWMgTmF0aXZlQnVmZmVyIHJldGFpbigpIHsKKyAgICAgICAgaWYgKG1BdHRhY2hlZEZyYW1lICE9IG51bGwpIHsKKyAgICAgICAgICAgIG1BdHRhY2hlZEZyYW1lLnJldGFpbigpOworICAgICAgICB9IGVsc2UgaWYgKG1Pd25zRGF0YSkgeworICAgICAgICAgICAgKyttUmVmQ291bnQ7CisgICAgICAgIH0KKyAgICAgICAgcmV0dXJuIHRoaXM7CisgICAgfQorCisgICAgcHVibGljIE5hdGl2ZUJ1ZmZlciByZWxlYXNlKCkgeworICAgICAgICAvLyBEZWNyZW1lbnQgcmVmY291bnQKKyAgICAgICAgYm9vbGVhbiBkb0RlYWxsb2MgPSBmYWxzZTsKKyAgICAgICAgaWYgKG1BdHRhY2hlZEZyYW1lICE9IG51bGwpIHsKKyAgICAgICAgICAgIGRvRGVhbGxvYyA9IChtQXR0YWNoZWRGcmFtZS5yZWxlYXNlKCkgPT0gbnVsbCk7CisgICAgICAgIH0gZWxzZSBpZiAobU93bnNEYXRhKSB7CisgICAgICAgICAgICAtLW1SZWZDb3VudDsKKyAgICAgICAgICAgIGRvRGVhbGxvYyA9IChtUmVmQ291bnQgPT0gMCk7CisgICAgICAgIH0KKworICAgICAgICAvLyBEZWFsbG9jYXRlIGlmIG5lY2Vzc2FyeQorICAgICAgICBpZiAoZG9EZWFsbG9jKSB7CisgICAgICAgICAgICBkZWFsbG9jYXRlKG1Pd25zRGF0YSk7CisgICAgICAgICAgICByZXR1cm4gbnVsbDsKKyAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgIHJldHVybiB0aGlzOworICAgICAgICB9CisgICAgfQorCisgICAgcHVibGljIGJvb2xlYW4gaXNSZWFkT25seSgpIHsKKyAgICAgICAgcmV0dXJuIChtQXR0YWNoZWRGcmFtZSAhPSBudWxsKSA/IG1BdHRhY2hlZEZyYW1lLmlzUmVhZE9ubHkoKSA6IGZhbHNlOworICAgIH0KKworICAgIHN0YXRpYyB7CisgICAgICAgIFN5c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ICAgICAgICAgICAgICAgICAgICAgICAiTmF0aXZlQnVmZmVyISIpOworICAgICAgICB9CisKKyAgICAgICAgLy8gSW5zdGFudGlhdGUgYSBuZXcgZW1wdHkgaW5zdGFuY2Ugb2YgdGhpcyBjbGFzcworICAgICAgICBOYXRpdmVCdWZmZXIgc3RydWN0RGF0YSA9IG51bGw7CisgICAgICAgIHRyeSB7CisgICAgICAgICAgc3RydWN0RGF0YSA9IChOYXRpdmVCdWZmZXIpc3RydWN0Q2xhc3MubmV3SW5zdGFuY2UoKTsKKyAgICAgICAgfSBjYXRjaCAoRXhjZXB0aW9uIGUpIHsKKyAgICAgICAgICB0aHJvdyBuZXcgUnVudGltZUV4Y2VwdGlvbigiQ291bGQgbm90IGluc3RhbnRpYXRlIG5ldyBzdHJ1Y3R1cmUgaW5zdGFuY2Ugb2YgdHlwZSAnIiArCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc3RydWN0Q2xhc3MgKyAiJyEiKTsKKyAgICAgICAgfQorCisgICAgICAgIC8vIFdyYXAgaXQgYXJvdW5kIG91ciBkYXRhCisgICAgICAgIGlmICghZ2V0TmF0aXZlQnVmZmVyKHN0cnVjdERhdGEpKSB7CisgICAgICAgICAgICB0aHJvdyBuZXcgUnVudGltZUV4Y2VwdGlvbigiQ291bGQgbm90IGdldCB0aGUgbmF0aXZlIHN0cnVjdHVyZWQgZGF0YSBmb3IgZnJhbWUhIik7CisgICAgICAgIH0KKworICAgICAgICAvLyBBdHRhY2ggdGhpcyBmcmFtZSB0byBpdAorICAgICAgICBzdHJ1Y3REYXRhLmF0dGFjaFRvRnJhbWUodGhpcyk7CisKKyAgICAgICAgcmV0dXJuIHN0cnVjdERhdGE7CisgICAgfQorCisgICAgQE92ZXJyaWRlCisgICAgcHVibGljIHZvaWQgc2V0SW50cyhpbnRbXSBpbnRzKSB7CisgICAgICAgIGFzc2VydEZyYW1lTXV0YWJsZSgpOworICAgICAgICBpZiAoaW50cy5sZW5ndGggKiBu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ICAgICAgICAgICAgICAgICAgICAgICAobGVuZ3RoICsgb2Zmc2V0KSArICIgYnl0ZXMgZ2l2ZW4sIGJ1dCBvbmx5ICIgKyBidWZmZXIubGltaXQoKSArCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAiIGJ5dGVzIGF2YWlsYWJsZSEiKTsKKyAgICAgICAgfSBlbHNlIGlmIChnZXRGb3JtYXQoKS5nZXRTaXplKCkgIT0gbGVuZ3RoKSB7CisgICAgICAgICAgICB0aHJvdyBuZXcgUnVudGltZUV4Y2VwdGlvbigiRGF0YSBzaXplIGluIHNldERhdGEgZG9lcyBub3QgbWF0Y2ggbmF0aXZlIGZyYW1lIHNpemU6ICIgKworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIkZyYW1lIHNpemUgaXMgIiArIGdldEZvcm1hdCgpLmdldFNpemUoKSArICIgYnl0ZXMsIGJ1dCAiICsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxlbmd0aCArICIgYnl0ZXMgZ2l2ZW4hIik7CisgICAgICAgIH0gZWxzZSBpZiAoIXNldE5hdGl2ZURhdGEoYnl0ZXMsIG9mZnNldCwgbGVuZ3RoKSkgeworICAgICAgICAgICAgdGhyb3cgbmV3IFJ1bnRpbWVFeGNlcHRpb24oIkNvdWxkIG5vdCBzZXQgbmF0aXZlIGZyYW1lIGRhdGEhIik7CisgICAgICAgIH0KKyAgICB9CisKKyAgICBAT3ZlcnJpZGUKKyAgICBwdWJsaWMgQnl0ZUJ1ZmZlciBnZXREYXRhKCkgeworICAgICAgICBieXRlW10gZGF0YSA9IGdldE5hdGl2ZURhdGEoZ2V0Rm9ybWF0KCkuZ2V0U2l6ZSgpKTsKKyAgICAgICAgcmV0dXJuIGRhdGEgPT0gbnVsbCA/IG51bGwgOiBCeXRlQnVmZmVyLndyYXAoZGF0YSk7CisgICAgfQorCisgICAgQE92ZXJyaWRlCisgICAgcHVibGljIHZvaWQgc2V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gICBAT3ZlcnJpZGUKKyAgICBwdWJsaWMgQml0bWFwIGdldEJpdG1hcCgpIHsKKyAgICAgICAgaWYgKGdldEZvcm1hdCgpLmdldE51bWJlck9mRGltZW5zaW9ucygpICE9IDIpIHsKKyAgICAgICAgICAgIHRocm93IG5ldyBSdW50aW1lRXhjZXB0aW9uKCJBdHRlbXB0aW5nIHRvIGdldCBCaXRtYXAgZm9yIG5vbiAyLWRpbWVuc2lvbmFsIG5hdGl2ZSBmcmFtZSEiKTsKKyAgICAgICAgfQorICAgICAgICBCaXRtYXAgcmVzdWx0ID0gQml0bWFwLmNyZWF0ZUJpdG1hcChnZXRGb3JtYXQoKS5nZXRXaWR0aCgpLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBnZXRGb3JtYXQoKS5nZXRIZWlnaHQoKSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgQml0bWFwLkNvbmZpZy5BUkdCXzg4ODgpOworICAgICAgICBpbnQgYnl0ZUNvdW50ID0gcmVzdWx0LmdldEJ5dGVDb3VudCgpOworICAgICAgICBpbnQgYnBzID0gZ2V0Rm9ybWF0KCkuZ2V0Qnl0ZXNQZXJTYW1wbGUoKTsKKyAgICAgICAgaWYgKCFnZXROYXRpdmVCaXRtYXAocmVzdWx0LCBieXRlQ291bnQsIGJwcykpIHsKKyAgICAgICAgICAgIHRocm93IG5ldyBSdW50aW1lRXhjZXB0aW9uKCJDb3VsZCBub3QgZ2V0IGJpdG1hcCBkYXRhIGZyb20gbmF0aXZlIGZyYW1lISIpOworICAgICAgICB9CisgICAgICAgIHJldHVybiByZXN1bHQ7CisgICAgfQorCisgICAgQE92ZXJyaWRlCisgICAgcHVibGljIHZvaWQgc2V0RGF0YUZyb21GcmFtZShGcmFtZSBmcmFtZSkgeworICAgICAgICAvLyBNYWtlIHN1cmUgZnJhbWUgZml0cworICAgICAgICBpZiAoZ2V0Rm9ybWF0KCkuZ2V0U2l6Z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AgICAgIG1IYXNSZXNldEZ1bmN0aW9uID0gYmluZFJlc2V0RnVuY3Rpb24ocmVzZXRGdW5jTmFtZSk7CisKKyAgICAgICAgLy8gSW5pdGlhbGl6ZSB0aGUgbmF0aXZlIGNvZGUKKyAgICAgICAgaWYgKG1IYXNJbml0RnVuY3Rpb24gJiYgIWNhbGxOYXRpdmVJbml0KCkpIHsKKyAgICAgICAgICAgIHRocm93IG5ldyBSdW50aW1lRXhjZXB0aW9uKCJDb3VsZCBub3QgaW5pdGlhbGl6ZSBOYXRpdmVQcm9ncmFtISIpOworICAgICAgICB9CisgICAgfQorCisgICAgcHVibGljIHZvaWQgdGVhckRvd24oKSB7CisgICAgICAgIGlmIChtVG9ybkRvd24pIHJldHVybjsKKyAgICAgICAgaWYgKG1IYXNUZWFyZG93bkZ1bmN0aW9uICYmICFjYWxsTmF0aXZlVGVhcmRvd24oKSkgeworICAgICAgICAgICAgdGhyb3cgbmV3IFJ1bnRpbWVFeGNlcHRpb24oIkNvdWxkIG5vdCB0ZWFyIGRvd24gTmF0aXZlUHJvZ3JhbSEiKTsKKyAgICAgICAgfQorICAgICAgICBkZWFsbG9jYXRlKCk7CisgICAgICAgIG1Ub3JuRG93biA9IHRydWU7CisgICAgfQorCisgICAgQE92ZXJyaWRlCisgICAgcHVibGljIHZvaWQgcmVzZXQoKSB7CisgICAgICAgIGlmIChtSGFzUmVzZXRGdW5jdGlvbiAmJiAhY2FsbE5hdGl2ZVJlc2V0KCkpIHsKKyAgICAgICAgICAgIHRocm93IG5ldyBSdW50aW1lRXhjZXB0aW9uKCJDb3VsZCBub3QgcmVzZXQgTmF0aXZlUHJvZ3JhbSEiKTsKKyAgICAgICAgfQorICAgIH0KKworICAgIEBPdmVycmlkZQorICAgIHByb3RlY3RlZCB2b2lkIGZpbmFsaXplKCkgdGhyb3dzIFRocm93YWJsZSB7CisgICAgICAgIHRlYXJEb3duKCk7CisgICAgfQorCisgICAgQE92ZXJyaWRlCisgICAgcHVibGljIHZva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xlKFRBRywgTG9nLlZFUkJPU0UpOworICAgIH0KKworICAgIEBPdmVycmlkZQorICAgIHB1YmxpYyB2b2lkIHJlc2V0KCkgeworICAgICAgICBzdXBlci5yZXNldCgpOworICAgICAgICBzY2hlZHVsZWQuY2xlYXIoKTsKKyAgICB9CisKKyAgICBAT3ZlcnJpZGUKKyAgICBwdWJsaWMgRmlsdGVyIHNjaGVkdWxlTmV4dE5vZGUoKSB7CisgICAgICAgIEZpbHRlciBmaXJzdCA9IG51bGw7CisgICAgICAgIC8vIHJldHVybiB0aGUgZmlyc3QgZmlsdGVyIHRoYXQgaXMgbm90IHNjaGVkdWxlZCBiZWZvcmUuCisgICAgICAgIHdoaWxlICh0cnVlKSB7CisgICAgICAgICAgICBGaWx0ZXIgZmlsdGVyID0gc3VwZXIuc2NoZWR1bGVOZXh0Tm9kZSgpOworICAgICAgICAgICAgaWYgKGZpbHRlciA9PSBudWxsKSB7CisgICAgICAgICAgICAgICAgaWYgKG1Mb2dWZXJib3NlKSBMb2cudihUQUcsICJObyBmaWx0ZXJzIGF2YWlsYWJsZSB0byBydW4uIik7CisgICAgICAgICAgICAgICAgcmV0dXJuIG51bGw7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBpZiAoIXNjaGVkdWxlZC5jb250YWluc0tleShmaWx0ZXIuZ2V0TmFtZSgpKSkgeworICAgICAgICAgICAgICAgIGlmIChmaWx0ZXIuZ2V0TnVtYmVyT2ZDb25uZWN0ZWRJbnB1dHMoKSA9PSAwKQorICAgICAgICAgICAgICAgICAgICBzY2hlZHVsZWQucHV0KGZpbHRlci5nZXROYW1lKCksMSk7CisgICAgICAgICAgICAgICAgaWYgKG1Mb2dWZXJib3NlKSBMb2cudihUQUcsICJTY2hlZHVsaW5nIGZpbHRlciBcIiIgKyBmaWx0ZXIuZ2V0TmFtZSgpICsgIlwiIG9mIHR5cGUgIiArIGZpbHRlci5nZXRGaWx0ZXJDbGFzc05hbWUoKSk7CisgICAgICAgICAgICAgICAgcmV0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7CisgICAgICAgICAgICB0aHJvdyBuZXcgUnVudGltZUV4Y2VwdGlvbih0aGlzICsgIiBhbHJlYWR5IGNvbm5lY3RlZCB0byAiICsgbVRhcmdldFBvcnQgKyAiISIpOworICAgICAgICB9CisgICAgICAgIG1UYXJnZXRQb3J0ID0gdGFyZ2V0OworICAgICAgICBtVGFyZ2V0UG9ydC5zZXRTb3VyY2VQb3J0KHRoaXMpOworICAgIH0KKworICAgIHB1YmxpYyBib29sZWFuIGlzQ29ubmVjdGVkKCkgeworICAgICAgICByZXR1cm4gbVRhcmdldFBvcnQgIT0gbnVsbDsKKyAgICB9CisKKyAgICBwdWJsaWMgdm9pZCBvcGVuKCkgeworICAgICAgICBzdXBlci5vcGVuKCk7CisgICAgICAgIGlmIChtVGFyZ2V0UG9ydCAhPSBudWxsICYmICFtVGFyZ2V0UG9ydC5pc09wZW4oKSkgeworICAgICAgICAgICAgbVRhcmdldFBvcnQub3BlbigpOworICAgICAgICB9CisgICAgfQorCisgICAgcHVibGljIHZvaWQgY2xvc2UoKSB7CisgICAgICAgIHN1cGVyLmNsb3NlKCk7CisgICAgICAgIGlmIChtVGFyZ2V0UG9ydCAhPSBudWxsICYmIG1UYXJnZXRQb3J0LmlzT3BlbigpKSB7CisgICAgICAgICAgICBtVGFyZ2V0UG9ydC5jbG9zZSgpOworICAgICAgICB9CisgICAgfQorCisgICAgcHVibGljIElucHV0UG9ydCBnZXRUYXJnZXRQb3J0KCkgeworICAgICAgICByZXR1cm4gbVRhcmdldFBvcnQ7CisgICAgfQorCisgICAgcHVibGljIEZpbHRlciBnZXRUYXJnZXRGaWx0ZXIoKSB7CisgICAgICAgIHJldHVybiBtVGFyZ2V0UG9ydCA9PSBudWxsID8gbnVsbCA6IG1UYXJnZXRQb3J0LmdldEZpbHRlcigpOworICAgIH0KKworICAgIHB1YmxpYyB2b2lkIHNldEJhc2VQb3J0KElucHV0UG9ydCBiYXNlUG9ydCkgeworICAgICAgICBtQmFzZVBvcnQgPSBiYXNlUG9ydDsKKyAgICB9CisKKyAgICBwdWJsaWMgSW5wdXRQb3J0IGdldEJhc2VQb3J0KCkgeworICAgICAgICByZXR1cm4gbUJhc2VQb3J0OworICAgIH0KKworICAgIHB1YmxpYyBib29sZWFuIGZpbHRlck11c3RDbG9zZSgpIHsKKyAgICAgICAgcmV0dXJuICFpc09wZW4oKSAmJiBpc0Jsb2NraW5nKCk7CisgICAgfQorCisgICAgcHVibGljIGJvb2xlYW4gaXNSZWFkeSgpIHsKKyAgICAgICAgcmV0dXJuIChpc09wZW4oKSAmJiBtVGFyZ2V0UG9ydC5hY2NlcHRzRnJhbWUoKSkgfHwgIWlzQmxvY2tpbmcoKTsKKyAgICB9CisKKyAgICBAT3ZlcnJpZGUKKyAgICBwdWJsaWMgdm9pZCBjbGVhcigpIHsKKyAgICAgICAgaWYgKG1UYXJnZXRQb3J0ICE9IG51bGwpIHsKKyAgICAgICAgICAgIG1UYXJnZXRQb3J0LmNsZWFyKCk7CisgICAgICAgIH0KKyAgICB9CisKKyAgICBAT3ZlcnJpZGUKKyAgICBwdWJsaWMgdm9pZCBwdXNoRnJhbWUoRnJhbWUgZnJhbWUpIHsKKyAgICAgICAgaWYgKG1UYXJnZXRQb3J0ID09IG51bGwpIHsKKyAgICAgICAgICAgIHRocm93IG5ldyBSdW50aW1lRXhjZXB0aW9uKAorICAgICAgICAgICAgICAgICJBdHRlbXB0aW5nIHRvIHB1c2ggZnJhbWUgb24gdW5jb25uZWN0ZWQgcG9ydDogIiArIHRoaXMgKyAiISIpOworICAgICAgICB9CisgICAgICAgIG1UYXJnZXRQb3J0LnB1c2hGcmFtZShmcmFtZSk7CisgICAgfQorCisgICAgQE92ZXJyaWRlCisgICAgcHVibGljIHZvaWQgc2V0RnJhbWUoRnJhbWUgZnJhbWUpIHsKKyAgICAgICAgYXNzZXJ0UG9ydElzT3BlbigpOworICAgICAgICBpZiAobVRhcmdldFBvcnQgPT0gbnVsbCkgeworICAgICAgICAgICAgdGhyb3cgbmV3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maWx0ZXIsIG5hbWUsIGZpZWxkLCBoYXNEZWZhdWx0KTsKKyAgICAgICAgbVZhck5hbWUgPSB2YXJOYW1lOworICAgIH0KKworICAgIEBPdmVycmlkZQorICAgIHB1YmxpYyBTdHJpbmcgdG9TdHJpbmcoKSB7CisgICAgICAgIHJldHVybiAiUHJvZ3JhbSAiICsgc3VwZXIudG9TdHJpbmcoKTsKKyAgICB9CisKKyAgICBAT3ZlcnJpZGUKKyAgICBwdWJsaWMgc3luY2hyb25pemVkIHZvaWQgdHJhbnNmZXIoRmlsdGVyQ29udGV4dCBjb250ZXh0KSB7CisgICAgICAgIGlmIChtVmFsdWVXYWl0aW5nKSB7CisgICAgICAgICAgICB0cnkgeworICAgICAgICAgICAgICAgIE9iamVjdCBmaWVsZFZhbHVlID0gbUZpZWxkLmdldChtRmlsdGVyKTsKKyAgICAgICAgICAgICAgICBpZiAoZmllbGRWYWx1ZSAhPSBudWxsKSB7CisgICAgICAgICAgICAgICAgICAgIFByb2dyYW0gcHJvZ3JhbSA9IChQcm9ncmFtKWZpZWxkVmFsdWU7CisgICAgICAgICAgICAgICAgICAgIHByb2dyYW0uc2V0SG9zdFZhbHVlKG1WYXJOYW1lLCBtVmFsdWUpOworICAgICAgICAgICAgICAgICAgICBtVmFsdWVXYWl0aW5nID0gZmFsc2U7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfSBjYXRjaCAoSWxsZWdhbEFjY2Vzc0V4Y2VwdGlvbiBlKSB7CisgICAgICAgICAgICAgICAgdGhyb3cgbmV3IFJ1bnRpbWVFeGNlcHRpb24oCisgICAgICAgICAgICAgICAgICAgICJBY2Nlc3MgdG8gcHJvZ3JhbSBmaWVsZCAnIiArIG1GaWVsZC5nZXROYW1lKCkgKyAiJyB3YXMgZGVuaWVkISIpOworICAgICAgICAgICAgfSBjYXRjaCAoQ2xhc3NDYXN0RXhjZXB0aW9uIGUpIHsKKyAgICAgICAgICAgICAgICB0aHJvdyBuZXcgUnVudGltZUV4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gPj0gYWxsX2ZpbHRlcnMuc2l6ZSgpKSBtTGFzdFBvcyA9IC0xOworICAgICAgICBpbnQgcG9zID0gMDsKKyAgICAgICAgRmlsdGVyIGZpcnN0ID0gbnVsbDsKKyAgICAgICAgaW50IGZpcnN0TmR4ID0gLTE7CisgICAgICAgIGZvciAoRmlsdGVyIGZpbHRlciA6IGFsbF9maWx0ZXJzKSB7CisgICAgICAgICAgICBpZiAoZmlsdGVyLmNhblByb2Nlc3MoKSkgeworICAgICAgICAgICAgICAgIGlmIChwb3MgPD0gbUxhc3RQb3MpIHsKKyAgICAgICAgICAgICAgICAgICAgaWYgKGZpcnN0ID09IG51bGwpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIC8vIHN0b3JlIHRoZSBmaXJzdCBhdmFpbGFibGUgZmlsdGVyCisgICAgICAgICAgICAgICAgICAgICAgICBmaXJzdCA9IGZpbHRlcjsKKyAgICAgICAgICAgICAgICAgICAgICAgIGZpcnN0TmR4ID0gcG9zOworICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgICAgICAgICAgLy8gcmV0dXJuIHRoZSBuZXh0IGF2YWlsYWJsZSBmaWx0ZXIgc2luY2UgbGFzdAorICAgICAgICAgICAgICAgICAgICBtTGFzdFBvcyA9IHBvczsKKyAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGZpbHRlcjsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9CisgICAgICAgICAgICBwb3MgKys7CisgICAgICAgIH0KKyAgICAgICAgLy8gZ29pbmcgYXJvdW5kIGZyb20gdGhlIGJlZ2lubmluZworICAgICAgICBpZiAoZmlyc3QgIT0gbnVsbCApIHsKKyAgICAgICAgICAgIG1MYXN0UG9zID0gZmlyc3ROZHg7CisgICAgICAgICAgICByZXR1cm4gZmlyc3Q7CisgICAgICAgIH0KKyAgICAgICAgLy8gaWYgdGhlcmUgaXMgbm90aGluZyB0byBiZSBzY2hlZ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gICBwcml2YXRlIGludCBtRGF0YU9mZnNldCA9IDA7CisKKyAgICAgICAgcHVibGljIERpcmVjdEJ5dGVPdXRwdXRTdHJlYW0oaW50IHNpemUpIHsKKyAgICAgICAgICAgIG1CdWZmZXIgPSBuZXcgYnl0ZVtzaXplXTsKKyAgICAgICAgfQorCisgICAgICAgIHByaXZhdGUgZmluYWwgdm9pZCBlbnN1cmVGaXQoaW50IGJ5dGVzVG9Xcml0ZSkgeworICAgICAgICAgICAgaWYgKG1PZmZzZXQgKyBieXRlc1RvV3JpdGUgPiBtQnVmZmVyLmxlbmd0aCkgeworICAgICAgICAgICAgICAgIGJ5dGVbXSBvbGRCdWZmZXIgPSBtQnVmZmVyOworICAgICAgICAgICAgICAgIG1CdWZmZXIgPSBuZXcgYnl0ZVtNYXRoLm1heChtT2Zmc2V0ICsgYnl0ZXNUb1dyaXRlLCBtQnVmZmVyLmxlbmd0aCAqIDIpXTsKKyAgICAgICAgICAgICAgICBTeXN0ZW0uYXJyYXljb3B5KG9sZEJ1ZmZlciwgMCwgbUJ1ZmZlciwgMCwgbU9mZnNldCk7CisgICAgICAgICAgICAgICAgb2xkQnVmZmVyID0gbnVsbDsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorCisgICAgICAgIHB1YmxpYyBmaW5hbCB2b2lkIG1hcmtIZWFkZXJFbmQoKSB7CisgICAgICAgICAgICBtRGF0YU9mZnNldCA9IG1PZmZzZXQ7CisgICAgICAgIH0KKworICAgICAgICBwdWJsaWMgZmluYWwgaW50IGdldFNpemUoKSB7CisgICAgICAgICAgICByZXR1cm4gbU9mZnNldDsKKyAgICAgICAgfQorCisgICAgICAgIHB1YmxpYyBieXRlW10gZ2V0Qnl0ZUFycmF5KCkgeworICAgICAgICAgICAgcmV0dXJuIG1CdWZmZXI7CisgICAgICAgIH0KKworICAgICAgICBAT3ZlcnJpZGUKKyAgICAgICAgcHVibGljIGZpbmFsIHZvaWQgd3JpdGUoYnl0ZSBiW10pIHsKKyAgICAgICAgICAgIHdyaXRlKGIsIDAsIGIubGVuZ3RoKTsKKyAgICAgICAgfQorCisgICAgICAgIEBPdmVycmlkZQorICAgICAgICBwdWJsaWMgZmluYWwgdm9pZCB3cml0ZShieXRlIGJbXSwgaW50IG9mZiwgaW50IGxlbikgeworICAgICAgICAgICAgZW5zdXJlRml0KGxlbik7CisgICAgICAgICAgICBTeXN0ZW0uYXJyYXljb3B5KGIsIG9mZiwgbUJ1ZmZlciwgbU9mZnNldCwgbGVuKTsKKyAgICAgICAgICAgIG1PZmZzZXQgKz0gbGVuOworICAgICAgICB9CisKKyAgICAgICAgQE92ZXJyaWRlCisgICAgICAgIHB1YmxpYyBmaW5hbCB2b2lkIHdyaXRlKGludCBiKSB7CisgICAgICAgICAgICBlbnN1cmVGaXQoMSk7CisgICAgICAgICAgICBtQnVmZmVyW21PZmZzZXQrK10gPSAoYnl0ZSliOworICAgICAgICB9CisKKyAgICAgICAgcHVibGljIGZpbmFsIHZvaWQgcmVzZXQoKSB7CisgICAgICAgICAgICBtT2Zmc2V0ID0gbURhdGFPZmZzZXQ7CisgICAgICAgIH0KKworICAgICAgICBwdWJsaWMgZmluYWwgRGlyZWN0Qnl0ZUlucHV0U3RyZWFtIGdldElucHV0U3RyZWFtKCkgeworICAgICAgICAgICAgcmV0dXJuIG5ldyBEaXJlY3RCeXRlSW5wdXRTdHJlYW0obUJ1ZmZlciwgbU9mZnNldCk7CisgICAgICAgIH0KKyAgICB9CisKKyAgICAvKioKKyAgICAgKiBBbiB1bnN5bmNocm9uaXplZCBpbnB1dCBzdHJlYW0gdGhhdCByZWFkcyBkYXRhIGRpcmVjdGx5IGZyb20gYSBwcm92aWRlZCBieXRlIGFycmF5LiBDYWxsZXJzCisgICAgICogYXJlIHJlc3BvbnNpYmxlIGZvciBzeW5jaHJvbml6YXRpb24gYW5kIGVuc3VyaW5nIHRoYXQgdGhlIGJ5dGUgYnVmZmVyIGlzIHZhbGlkLgorICAgICAqLworICAgIHByaXZhdGUgY2xhc3MgRGlyZWN0Qnl0ZUlucHV0U3RyZWFtIGV4dGVuZHMgSW5wdXRTdHJlYW0geworCisgICAgICAgIHByaXZhdGUgYnl0ZVtdIG1CdWZmZXI7CisgICAgICAgIHByaXZhdGUgaW50IG1Qb3MgPSAwOworICAgICAgICBwcml2YXRlIGludCBtU2l6ZTsKKworICAgICAgICBwdWJsaWMgRGlyZWN0Qnl0ZUlucHV0U3RyZWFtKGJ5dGVbXSBidWZmZXIsIGludCBzaXplKSB7CisgICAgICAgICAgICBtQnVmZmVyID0gYnVmZmVyOworICAgICAgICAgICAgbVNpemUgPSBzaXplOworICAgICAgICB9CisKKyAgICAgICAgQE92ZXJyaWRlCisgICAgICAgIHB1YmxpYyBmaW5hbCBpbnQgYXZhaWxhYmxlKCkgeworICAgICAgICAgICAgcmV0dXJuIG1TaXplIC0gbVBvczsKKyAgICAgICAgfQorCisgICAgICAgIEBPdmVycmlkZQorICAgICAgICBwdWJsaWMgZmluYWwgaW50IHJlYWQoKSB7CisgICAgICAgICAgICByZXR1cm4gKG1Qb3MgPCBtU2l6ZSkgPyAobUJ1ZmZlclttUG9zKytdICYgMHhGRikgOiAtMTsKKyAgICAgICAgfQorCisgICAgICAgIEBPdmVycmlkZQorICAgICAgICBwdWJsaWMgZmluYWwgaW50IHJlYWQoYnl0ZVtdIGIsIGludCBvZmYsIGludCBsZW4pIHsKKyAgICAgICAgICAgIGlmIChtUG9zID49IG1TaXplKSB7CisgICAgICAgICAgICAgICAgcmV0dXJuIC0xOworICAgICAgICAgICAgfQorICAgICAgICAgICAgaWYgKChtUG9zICsgbGVuKSA+IG1TaXplKSB7CisgICAgICAgICAgICAgICAgbGVuID0gbVNpemUgLSBtUG9zOworICAgICAgICAgICAgfQorICAgICAgICAgICAgU3lzdGVtLmFycmF5Y29weShtQnVmZmVyLCBtUG9zLCBiLCBvZmYsIGxlbik7CisgICAgICAgICAgICBtUG9zICs9IGxlbjsKKyAgICAgICAgICAgIHJldHVybiBsZW47CisgICAgICAgIH0KKworICAgICAgICBAT3ZlcnJpZGUKKyAgICAgICAgcHVibGljIGZpbmFsIGxvbmcgc2tpcChsb25nIG4pIHsKKyAgICAgICAgICAgIGlmICgobVBvcyArIG4pID4gbVNpemUpIHsKKyAgICAgICAgICAgICAgICBuID0gbVNpemUgLSBtUG9zOworICAgICAgICAgICAgfQorICAgICAgICAgICAgaWYgKG4gPCAwKSB7CisgICAgICAgICAgICAgICAgcmV0dXJuIDA7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBtUG9zICs9IG47CisgICAgICAgICAgICByZXR1cm4gbjsKKyAgICAgICAgfQorICAgIH0KKworICAgIFNlcmlhbGl6ZWRGcmFtZShGcmFtZUZvcm1hdCBmb3JtYXQsIEZyYW1lTWFuYWdlciBmcmFtZU1hbmFnZXIpIHsKKyAgICAgICAgc3VwZXIoZm9ybWF0LCBmcmFtZU1hbmFnZXIpOworICAgICAgICBzZXRSZXVzYWJsZShmYWxzZSk7CisKKyAgICAgICAgLy8gU2V0dXAgc3RyZWFtcworICAgICAgICB0cnkgeworICAgICAgICAgICAgbUJ5dGVPdXRwdXRTdHJlYW0gPSBuZXcgRGlyZWN0Qnl0ZU91dHB1dFN0cmVhbShJTklUSUFMX0NBUEFDSVRZKTsKKyAgICAgICAgICAgIG1PYmplY3RPdXQgPSBuZXcgT2JqZWN0T3V0cHV0U3RyZWFtKG1CeXRlT3V0cHV0U3RyZWFtKTsKKyAgICAgICAgICAgIG1CeXRlT3V0cHV0U3RyZWFtLm1hcmtIZWFkZXJFbmQoKTsKKyAgICAgICAgfSBjYXRjaCAoSU9FeGNlcHRpb24gZSkgeworICAgICAgICAgICAgdGhyb3cgbmV3IFJ1bnRpbWVFeGNlcHRpb24oIkNvdWxkIG5vdCBjcmVhdGUgc2VyaWFsaXphdGlvbiBzdHJlYW1zIGZvciAiCisgICAgICAgICAgICAgICAgKyAiU2VyaWFsaXplZEZyYW1lISIsIGUpOworICAgICAgICB9CisgICAgfQorCisgICAgc3RhdGljI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pdG1hcCkgeworICAgICAgICBhc3NlcnRGcmFtZU11dGFibGUoKTsKKyAgICAgICAgc2V0R2VuZXJpY09iamVjdFZhbHVlKGJpdG1hcCk7CisgICAgfQorCisgICAgQE92ZXJyaWRlCisgICAgcHVibGljIEJpdG1hcCBnZXRCaXRtYXAoKSB7CisgICAgICAgIE9iamVjdCByZXN1bHQgPSBkZXNlcmlhbGl6ZU9iamVjdFZhbHVlKCk7CisgICAgICAgIHJldHVybiAocmVzdWx0IGluc3RhbmNlb2YgQml0bWFwKSA/IChCaXRtYXApcmVzdWx0IDogbnVsbDsKKyAgICB9CisKKyAgICBAT3ZlcnJpZGUKKyAgICBwcm90ZWN0ZWQgdm9pZCBzZXRHZW5lcmljT2JqZWN0VmFsdWUoT2JqZWN0IG9iamVjdCkgeworICAgICAgICBzZXJpYWxpemVPYmplY3RWYWx1ZShvYmplY3QpOworICAgIH0KKworICAgIHByaXZhdGUgZmluYWwgdm9pZCBzZXJpYWxpemVPYmplY3RWYWx1ZShPYmplY3Qgb2JqZWN0KSB7CisgICAgICAgIHRyeSB7CisgICAgICAgICAgICBtQnl0ZU91dHB1dFN0cmVhbS5yZXNldCgpOworICAgICAgICAgICAgbU9iamVjdE91dC53cml0ZU9iamVjdChvYmplY3QpOworICAgICAgICAgICAgbU9iamVjdE91dC5mbHVzaCgpOworICAgICAgICAgICAgbU9iamVjdE91dC5jbG9zZSgpOworICAgICAgICB9IGNhdGNoIChJT0V4Y2VwdGlvbiBlKSB7CisgICAgICAgICAgICB0aHJvdyBuZXcgUnVudGltZUV4Y2VwdGlvbigiQ291bGQgbm90IHNlcmlhbGl6ZSBvYmplY3QgIiArIG9iamVjdCArICIgaW4gIgorICAgICAgICAgICAgICAgICsgdGhpcyArICIhIiwgZSk7CisgICAgICAgIH0KKyAgICB9CisKKyAgICBwcml2YXRlIGZpbmFsIE9iamVjdCBkZXNlcmlhbGl6ZU9iamVjdFZhbHVlKCkgeworICAgICAgICB0cnkgeworICAgICAgICAgICAg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yB0YWcpIHsKKyAgICB9CisKKyAgICBwdWJsaWMgU2hhZGVyUHJvZ3JhbShGaWx0ZXJDb250ZXh0IGNvbnRleHQsIFN0cmluZyBmcmFnbWVudFNoYWRlcikgeworICAgICAgICBtR0xFbnZpcm9ubWVudCA9IGdldEdMRW52aXJvbm1lbnQoY29udGV4dCk7CisgICAgICAgIGFsbG9jYXRlKG1HTEVudmlyb25tZW50LCBudWxsLCBmcmFnbWVudFNoYWRlcik7CisgICAgICAgIGlmICghY29tcGlsZUFuZExpbmsoKSkgeworICAgICAgICAgICAgdGhyb3cgbmV3IFJ1bnRpbWVFeGNlcHRpb24oIkNvdWxkIG5vdCBjb21waWxlIGFuZCBsaW5rIHNoYWRlciEiKTsKKyAgICAgICAgfQorICAgICAgICB0aGlzLnNldFRpbWVyKCk7CisgICAgfQorCisgICAgcHVibGljIFNoYWRlclByb2dyYW0oRmlsdGVyQ29udGV4dCBjb250ZXh0LCBTdHJpbmcgdmVydGV4U2hhZGVyLCBTdHJpbmcgZnJhZ21lbnRTaGFkZXIpIHsKKyAgICAgICAgbUdMRW52aXJvbm1lbnQgPSBnZXRHTEVudmlyb25tZW50KGNvbnRleHQpOworICAgICAgICBhbGxvY2F0ZShtR0xFbnZpcm9ubWVudCwgdmVydGV4U2hhZGVyLCBmcmFnbWVudFNoYWRlcik7CisgICAgICAgIGlmICghY29tcGlsZUFuZExpbmsoKSkgeworICAgICAgICAgICAgdGhyb3cgbmV3IFJ1bnRpbWVFeGNlcHRpb24oIkNvdWxkIG5vdCBjb21waWxlIGFuZCBsaW5rIHNoYWRlciEiKTsKKyAgICAgICAgfQorICAgICAgICB0aGlzLnNldFRpbWVyKCk7CisgICAgfQorCisgICAgcHVibGljIHN0YXRpYyBTaGFkZXJQcm9ncmFtIGNyZWF0ZUlkZW50aXR5KEZpbHRlckNvbnRleHQgY29udGV4dCkgeworICAgICAgICBTaGFkZXJQcm9ncmFtIHByb2dyYW0gPSBuYXRpdmVDcmVhdGVJZGVudGl0eShnZXRHTEVudmlyb25tZW50KGNvbnRleHQpKTsKKyAgICAgICAgcHJvZ3JhbS5zZXRUaW1lcigpOworICAgICAgICByZXR1cm4gcHJvZ3JhbTsKKyAgICB9CisKKyAgICBAT3ZlcnJpZGUKKyAgICBwcm90ZWN0ZWQgdm9pZCBmaW5hbGl6ZSgpIHRocm93cyBUaHJvd2FibGUgeworICAgICAgICBkZWFsbG9jYXRlKCk7CisgICAgfQorCisgICAgcHVibGljIEdMRW52aXJvbm1lbnQgZ2V0R0xFbnZpcm9ubWVudCgpIHsKKyAgICAgICAgcmV0dXJuIG1HTEVudmlyb25tZW50OworICAgIH0KKworICAgIEBPdmVycmlkZQorICAgIHB1YmxpYyB2b2lkIHByb2Nlc3MoRnJhbWVbXSBpbnB1dHMsIEZyYW1lIG91dHB1dCkgeworICAgICAgICBpZiAobVRpbWVyLkxPR19NRkZfUlVOTklOR19USU1FUykgeworICAgICAgICAgIG1UaW1lci5zdGFydCgiZ2xGaW5pc2giKTsKKyAgICAgICAgICBHTEVTMjAuZ2xGaW5pc2goKTsKKyAgICAgICAgICBtVGltZXIuc3RvcCgiZ2xGaW5pc2giKTsKKyAgICAgICAgfQorCisgICAgICAgIC8vIEdldCB0aGUgR0wgaW5wdXQgZnJhbWVzCisgICAgICAgIC8vIFRPRE86IFdlIGRvIHRoZSBzYW1lIGluIHRoZSBOYXRpdmVQcm9ncmFtLi4uIGNhbiB3ZSBmaW5kIGEgYmV0dGVyIHdheT8hCisgICAgICAgIEdMRnJhbWVbXSBnbElucHV0cyA9IG5ldyBHTEZyYW1lW2lucHV0cy5sZW5ndGhdOworICAgICAgICBmb3IgKGludCBpID0gMDsgaSA8IGlucHV0cy5sZW5ndGg7ICsraSkgeworICAgICAgICAgICAgaWYgKGlucHV0c1tpXSBpbnN0YW5jZW9mIEdMRnJhbWUpIHsKKyAgICAgICAgICAgICAgICBnbElucHV0c1tpXSA9IChHTEZyYW1lKWlucHV0c1tpXTsKKyAgICAgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICAgICAgdGhyb3cgbmV3IFJ1bnRpbWVFeGNlcHRpb24oIlNoYWRlclByb2dyYW0gZ290IG5vbi1HTCBmcmFtZSBhcyBpbnB1dCAiICsgaSArICIhIik7CisgICAgICAgICAgICB9CisgICAgICAgIH0KKworICAgICAgICAvLyBHZXQgdGhlIEdMIG91dHB1dCBmcmFtZQorICAgICAgICBHTEZyYW1lIGdsT3V0cHV0ID0gbnVsbDsKKyAgICAgICAgaWYgKG91dHB1dCBpbnN0YW5jZW9mIEdMRnJhbWUpIHsKKyAgICAgICAgICAgIGdsT3V0cHV0ID0gKEdMRnJhbWUpb3V0cHV0OworICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgdGhyb3cgbmV3IFJ1bnRpbWVFeGNlcHRpb24oIlNoYWRlclByb2dyYW0gZ290IG5vbi1HTCBvdXRwdXQgZnJhbWUhIik7CisgICAgICAgIH0KKworICAgICAgICAvLyBBZGp1c3QgdGlsZXMgdG8gbWVldCBtYXhpbXVtIHRpbGUgc2l6ZSByZXF1aXJlbWVudAorICAgICAgICBpZiAobU1heFRpbGVTaXplID4gMCkgeworICAgICAgICAgICAgaW50IHhUaWxlcyA9IChvdXRwdXQuZ2V0Rm9ybWF0KCkuZ2V0V2lkdGgoKSArIG1NYXhUaWxlU2l6ZSAtIDEpIC8gbU1heFRpbGVTaXplOworICAgICAgICAgICAgaW50IHlUaWxlcyA9IChvdXRwdXQuZ2V0Rm9ybWF0KCkuZ2V0SGVpZ2h0KCkgKyBtTWF4VGlsZVNpemUgLSAxKSAvIG1NYXhUaWxlU2l6ZTsKKyAgICAgICAgICAgIHNldFNoYWRlclRpbGVDb3VudHMoeFRpbGVzLCB5VGlsZXMpOworICAgICAgICB9CisKKyAgICAgICAgLy8gUHJvY2VzcyEKKyAgICAgICAgaWYgKCFzaGFkZXJQcm9jZXNzKGdsSW5wdXRzLCBnbE91dHB1dCkpIHsKKyAgICAgICAgICAgIHRocm93IG5ldyBSdW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gZm9yIGF0dHJpYnV0ZSAnIiArCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBhdHRyaWJ1dGVOYW1lICsgIichIik7CisgICAgICAgIH0KKyAgICB9CisKKyAgICBwdWJsaWMgdm9pZCBzZXRBdHRyaWJ1dGVWYWx1ZXMoU3RyaW5nIGF0dHJpYnV0ZU5hbWUsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFZlcnRleEZyYW1lIHZlcnRleERhdGEsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGludCB0eXBlLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpbnQgY29tcG9uZW50Q291bnQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGludCBzdHJpZGVJbkJ5dGVzLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpbnQgb2Zmc2V0SW5CeXRlcywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYm9vbGVhbiBub3JtYWxpemUpIHsKKyAgICAgICAgaWYgKCFzZXRTaGFkZXJBdHRyaWJ1dGVWZXJ0ZXhGcmFtZShhdHRyaWJ1dGVOYW1lLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZlcnRleERhdGEsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdHlwZSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb21wb25lbnRDb3VudCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzdHJpZGVJbkJ5dGVzLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG9mZnNldEluQnl0ZXMsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbm9ybWFsaXplKSkgeworICAgICAgICAgICAgdGhyb3cgbmV3IFJ1bnRpbWVFeGNlcHRpb24oIkVycm9yIHNldHRpbmcgYXR0cmlidXRlIHZhbHVlIGZvciBhdHRyaWJ1dGUgJyIgKworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYXR0cmlidXRlTmFtZSArICInISIpOworICAgICAgICB9CisgICAgfQorCisgICAgcHVibGljIHZvaWQgc2V0U291cmNlUmVnaW9uKFF1YWQgcmVnaW9uKSB7CisgICAgICAgIHNldFNvdXJjZVJlZ2lvbihyZWdpb24ucDAueCwgcmVnaW9uLnAwLnksCisgICAgICAgICAgICAgICAgICAgICAgICByZWdpb24ucDEueCwgcmVnaW9uLnAxLnksCisgICAgICAgICAgICAgICAgICAgICAgICByZWdpb24ucDIueCwgcmVnaW9uLnAyLnksCisgICAgICAgICAgICAgICAgICAgICAgICByZWdpb24ucDMueCwgcmVnaW9uLnAzLnkpOworICAgIH0KKworICAgIHB1YmxpYyB2b2lkIHNldFRhcmdldFJlZ2lvbihRdWFkIHJlZ2lvbikgeworICAgICAgICBzZXRUYXJnZXRSZWdpb24ocmVnaW9uLnAwLngsIHJlZ2lvbi5wMC55LAorICAgICAgICAgICAgICAgICAgICAgICAgcmVnaW9uLnAxLngsIHJlZ2lvbi5wMS55LAorICAgICAgICAgICAgICAgICAgICAgICAgcmVnaW9uLnAyLngsIHJlZ2lvbi5wMi55LAorICAgICAgICAgICAgICAgICAgICAgICAgcmVnaW9uLnAzLngsIHJlZ2lvbi5wMy55KTsKKyAgICB9CisKKyAgICBwdWJsaWMgdm9pZCBzZXRTb3VyY2VSZWN0KGZsb2F0IHgsIGZsb2F0IHksIGZsb2F0IHdpZHRoLCBmbG9hdCBoZWlnaHQpIHsKKyAgICAgICAgc2V0U291cmNlUmVnaW9uKHgsIHksIHggKyB3aWR0aCwgeSwgeCwgeSArIGhlaWdodCwgeCArIHdpZHRoLCB5ICsgaGVpZ2h0KTsKKyAgICB9CisKKyAgICBwdWJsaWMgdm9pZCBzZXRUYXJnZXRSZWN0KGZsb2F0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BkZmFjdG9yKSB7CisgICAgICAgIGlmICghc2V0U2hhZGVyQmxlbmRGdW5jKHNmYWN0b3IsIGRmYWN0b3IpKSB7CisgICAgICAgICAgICB0aHJvdyBuZXcgUnVudGltZUV4Y2VwdGlvbigiQ291bGQgbm90IHNldCBCbGVuZEZ1bmMgIiArIHNmYWN0b3IgKyIsIisgZGZhY3RvciArICIhIik7CisgICAgICAgIH0KKyAgICB9CisKKyAgICBwdWJsaWMgdm9pZCBzZXREcmF3TW9kZShpbnQgZHJhd01vZGUpIHsKKyAgICAgICAgaWYgKCFzZXRTaGFkZXJEcmF3TW9kZShkcmF3TW9kZSkpIHsKKyAgICAgICAgICAgIHRocm93IG5ldyBSdW50aW1lRXhjZXB0aW9uKCJDb3VsZCBub3Qgc2V0IEdMIGRyYXctbW9kZSB0byAiICsgZHJhd01vZGUgKyAiISIpOworICAgICAgICB9CisgICAgfQorCisgICAgcHVibGljIHZvaWQgc2V0VmVydGV4Q291bnQoaW50IGNvdW50KSB7CisgICAgICAgIGlmICghc2V0U2hhZGVyVmVydGV4Q291bnQoY291bnQpKSB7CisgICAgICAgICAgICB0aHJvdyBuZXcgUnVudGltZUV4Y2VwdGlvbigiQ291bGQgbm90IHNldCBHTCB2ZXJ0ZXggY291bnQgdG8gIiArIGNvdW50ICsgIiEiKTsKKyAgICAgICAgfQorICAgIH0KKworICAgIHB1YmxpYyB2b2lkIHNldE1heGltdW1UaWxlU2l6ZShpbnQgc2l6ZSkgeworICAgICAgICBtTWF4VGlsZVNpemUgPSBzaXplOworICAgIH0KKworICAgIHB1YmxpYyB2b2lkIGJlZ2luRHJhd2luZygpIHsKKyAgICAgICAgaWYgKCFiZWdpblNoYWRlckRyYXdpbmcoKSkgeworICAgICAgICAgICAgdGhyb3cgbmV3IFJ1bnRpbWVFeGNlcHRpb24oIkNvdWxkIG5vdCBwcmVwYXJlIHNoYWRlci1wcm9ncmFtIGZvciBkcmF3aW5nISIpOworICAgICAgICB9CisgICAgfQorCisgICAgcHJpdmF0ZSBzdGF0aWMgR0xFbnZpcm9ubWVudCBnZXRHTEVudmlyb25tZW50KEZpbHRlckNvbnRleHQgY29udGV4dCkgeworICAgICAgICBHTEVudmlyb25tZW50IHJlc3VsdCA9IGNvbnRleHQgIT0gbnVsbCA/IGNvbnRleHQuZ2V0R0xFbnZpcm9ubWVudCgpIDogbnVsbDsKKyAgICAgICAgaWYgKHJlc3VsdCA9PSBudWxsKSB7CisgICAgICAgICAgICB0aHJvdyBuZXcgTnVsbFBvaW50ZXJFeGNlcHRpb24oIkF0dGVtcHRpbmcgdG8gY3JlYXRlIFNoYWRlclByb2dyYW0gd2l0aCBubyBHTCAiCisgICAgICAgICAgICAgICAgKyAiZW52aXJvbm1lbnQgaW4gcGxhY2UhIik7CisgICAgICAgIH0KKyAgICAgICAgcmV0dXJuIHJlc3VsdDsKKyAgICB9CisKKyAgICBzdGF0aWMgeworICAgICAgICBTeXN0ZW0ubG9hZExpYnJhcnkoImZpbHRlcmZ3Iik7CisgICAgfQorCisgICAgcHJpdmF0ZSBuYXRpdmUgYm9vbGVhbiBhbGxvY2F0ZShHTEVudmlyb25tZW50IGdsRW52LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgU3RyaW5nIHZlcnRleFNoYWRlciwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFN0cmluZyBmcmFnbWVudFNoYWRlcik7CisKKyAgICBwcml2YXRlIG5hdGl2ZSBib29sZWFuIGRlYWxsb2NhdGUoKTsKKworICAgIHByaXZhdGUgbmF0aXZlIGJvb2xlYW4gY29tcGlsZUFuZExpbmsoKTsKKworICAgIHByaXZhdGUgbmF0aXZlIGJvb2xlYW4gc2hhZGVyUHJvY2VzcyhHTEZyYW1lW10gaW5wdXRzLCBHTEZyYW1lIG91dHB1dCk7CisKKyAgICBwcml2YXRlIG5hdGl2ZSBib29sZWFuIHNldFVuaWZvcm1WYWx1ZShTdHJpbmcgbmFtZSwgT2JqZWN0IHZhbH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VyRHJhd01vZGUoaW50IGRyYXdNb2RlKTsKKworICAgIHByaXZhdGUgbmF0aXZlIGJvb2xlYW4gc2V0U2hhZGVyVGlsZUNvdW50cyhpbnQgeENvdW50LCBpbnQgeUNvdW50KTsKKworICAgIHByaXZhdGUgbmF0aXZlIGJvb2xlYW4gc2V0U2hhZGVyVmVydGV4Q291bnQoaW50IHZlcnRleENvdW50KTsKKworICAgIHByaXZhdGUgbmF0aXZlIGJvb2xlYW4gYmVnaW5TaGFkZXJEcmF3aW5nKCk7CisKKyAgICBwcml2YXRlIG5hdGl2ZSBib29sZWFuIHNldFNoYWRlckF0dHJpYnV0ZVZhbHVlcyhTdHJpbmcgYXR0cmlidXRlTmFtZSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBmbG9hdFtdIGRhdGEsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaW50IGNvbXBvbmVudENvdW50KTsKKworICAgIHByaXZhdGUgbmF0aXZlIGJvb2xlYW4gc2V0U2hhZGVyQXR0cmlidXRlVmVydGV4RnJhbWUoU3RyaW5nIGF0dHJpYnV0ZU5hbWUsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBWZXJ0ZXhGcmFtZSB2ZXJ0ZXhEYXRhLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaW50IHR5cGUsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpbnQgY29tcG9uZW50Q291bnQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpbnQgc3RyaWRlSW5CeXRlcywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGludCBvZmZzZXRJbkJ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ZShmYWxzZSk7CisgICAgfQorCisgICAgc3RhdGljIFNpbXBsZUZyYW1lIHdyYXBPYmplY3QoT2JqZWN0IG9iamVjdCwgRnJhbWVNYW5hZ2VyIGZyYW1lTWFuYWdlcikgeworICAgICAgICBGcmFtZUZvcm1hdCBmb3JtYXQgPSBPYmplY3RGb3JtYXQuZnJvbU9iamVjdChvYmplY3QsIEZyYW1lRm9ybWF0LlRBUkdFVF9TSU1QTEUpOworICAgICAgICBTaW1wbGVGcmFtZSByZXN1bHQgPSBuZXcgU2ltcGxlRnJhbWUoZm9ybWF0LCBmcmFtZU1hbmFnZXIpOworICAgICAgICByZXN1bHQuc2V0T2JqZWN0VmFsdWUob2JqZWN0KTsKKyAgICAgICAgcmV0dXJuIHJlc3VsdDsKKyAgICB9CisKKyAgICBwcml2YXRlIHZvaWQgaW5pdFdpdGhGb3JtYXQoRnJhbWVGb3JtYXQgZm9ybWF0KSB7CisgICAgICAgIGZpbmFsIGludCBjb3VudCA9IGZvcm1hdC5nZXRMZW5ndGgoKTsKKyAgICAgICAgZmluYWwgaW50IGJhc2VUeXBlID0gZm9ybWF0LmdldEJhc2VUeXBlKCk7CisgICAgICAgIHN3aXRjaCAoYmFzZVR5cGUpIHsKKyAgICAgICAgICAgIGNhc2UgRnJhbWVGb3JtYXQuVFlQRV9CWVRFOgorICAgICAgICAgICAgICAgIG1PYmplY3QgPSBuZXcgYnl0ZVtjb3VudF07CisgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICBjYXNlIEZyYW1lRm9ybWF0LlRZUEVfSU5UMTY6CisgICAgICAgICAgICAgICAgbU9iamVjdCA9IG5ldyBzaG9ydFtjb3VudF07CisgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICBjYXNlIEZyYW1lRm9ybWF0LlRZUEVfSU5UMzI6CisgICAgICAgICAgICAgICAgbU9iamVjdCA9IG5ldyBpbnRbY291bnRdOworICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgY2FzZSBGcmFtZUZvcm1hdC5UWVBFX0ZMT0FUOgorICAgICAgICAgICAgICAgIG1PYmplY3QgPSBuZXcgZmxvYXRbY291bnRdOworICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgY2FzZSBGcmFtZUZvcm1hdC5UWVBFX0RPVUJMRToKKyAgICAgICAgICAgICAgICBtT2JqZWN0ID0gbmV3IGRvdWJsZVtjb3VudF07CisgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICBkZWZhdWx0OgorICAgICAgICAgICAgICAgIG1PYmplY3QgPSBudWxsOworICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICB9CisgICAgfQorCisgICAgQE92ZXJyaWRlCisgICAgcHJvdGVjdGVkIGJvb2xlYW4gaGFzTmF0aXZlQWxsb2NhdGlvbigpIHsKKyAgICAgICAgcmV0dXJuIGZhbHNlOworICAgIH0KKworICAgIEBPdmVycmlkZQorICAgIHByb3RlY3RlZCB2b2lkIHJlbGVhc2VOYXRpdmVBbGxvY2F0aW9uKCkgeworICAgIH0KKworICAgIEBPdmVycmlkZQorICAgIHB1YmxpYyBPYmplY3QgZ2V0T2JqZWN0VmFsdWUoKSB7CisgICAgICAgIHJldHVybiBtT2JqZWN0OworICAgIH0KKworICAgIEBPdmVycmlkZQorICAgIHB1YmxpYyB2b2lkIHNldEludHMoaW50W10gaW50cykgeworICAgICAgICBhc3NlcnRGcmFtZU11dGFibGUoKTsKKyAgICAgICAgc2V0R2VuZXJpY09iamVjdFZhbHVlKGludHMpOworICAgIH0KKworICAgIEBPdmVycmlkZQorICAgIHB1YmxpYyBpbnRbXSBnZXRJbnRzKCkgeworICAgICAgICByZXR1cm4gKG1PYmplY3QgaW5zdGFuY2VvZiBpbnRbXSkgPyAoaW50W10pbU9iamVjdCA6IG51bGw7CisgICAgfQorCisgICAgQE92ZXJyaWRlCisgICAgcHVibGljIHZvaWQgc2V0RmxvYXRzKGZsb2F0W10gZmxvYXRzKSB7CisgICAgICAg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udWxsOworICAgICAgICBzd2l0Y2goZm9ybWF0LmdldFRhcmdldCgpKSB7CisgICAgICAgICAgICBjYXNlIEZyYW1lRm9ybWF0LlRBUkdFVF9TSU1QTEU6CisgICAgICAgICAgICAgICAgcmVzdWx0ID0gbmV3IFNpbXBsZUZyYW1lKGZvcm1hdCwgdGhpcyk7CisgICAgICAgICAgICAgICAgYnJlYWs7CisKKyAgICAgICAgICAgIGNhc2UgRnJhbWVGb3JtYXQuVEFSR0VUX05BVElWRToKKyAgICAgICAgICAgICAgICByZXN1bHQgPSBuZXcgTmF0aXZlRnJhbWUoZm9ybWF0LCB0aGlzKTsKKyAgICAgICAgICAgICAgICBicmVhazsKKworICAgICAgICAgICAgY2FzZSBGcmFtZUZvcm1hdC5UQVJHRVRfR1BVOiB7CisgICAgICAgICAgICAgICAgR0xGcmFtZSBnbEZyYW1lID0gbmV3IEdMRnJhbWUoZm9ybWF0LCB0aGlzKTsKKyAgICAgICAgICAgICAgICBnbEZyYW1lLmluaXQoZ2V0R0xFbnZpcm9ubWVudCgpKTsKKyAgICAgICAgICAgICAgICByZXN1bHQgPSBnbEZyYW1lOworICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgfQorCisgICAgICAgICAgICBjYXNlIEZyYW1lRm9ybWF0LlRBUkdFVF9WRVJURVhCVUZGRVI6IHsKKyAgICAgICAgICAgICAgICByZXN1bHQgPSBuZXcgVmVydGV4RnJhbWUoZm9ybWF0LCB0aGlzKTsKKyAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgIH0KKworICAgICAgICAgICAgZGVmYXVsdDoKKyAgICAgICAgICAgICAgICB0aHJvdyBuZXcgUnVudGltZUV4Y2VwdGlvbigiVW5zdXBwb3J0ZWQgZnJhbWUgdGFyZ2V0IHR5cGU6ICIgKworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEZyYW1lRm9ybWF0LnRhcmdldFRvU3RyaW5nKGZvcm1hdC5nZXRUYX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GUgbG9uZyBtU3RhcnRUaW1lOworICAgIHByaXZhdGUgbG9uZyBtVG90YWxUaW1lOworICAgIHByaXZhdGUgaW50IG1OdW1DYWxsczsKKworICAgIHB1YmxpYyBTdG9wV2F0Y2goU3RyaW5nIG5hbWUpIHsKKyAgICAgICAgbU5hbWUgPSBuYW1lOworICAgICAgICBtU3RhcnRUaW1lID0gLTE7CisgICAgICAgIG1Ub3RhbFRpbWUgPSAwOworICAgICAgICBtTnVtQ2FsbHMgPSAwOworICAgIH0KKworICAgIHB1YmxpYyB2b2lkIHN0YXJ0KCkgeworICAgICAgICBpZiAobVN0YXJ0VGltZSAhPSAtMSkgeworICAgICAgICAgICAgIHRocm93IG5ldyBSdW50aW1lRXhjZXB0aW9uKAorICAgICAgICAgICAgICAgICAiQ2FsbGluZyBzdGFydCB3aXRoIFN0b3BXYXRjaCBhbHJlYWR5IHJ1bm5pbmciKTsKKyAgICAgICAgfQorICAgICAgICBtU3RhcnRUaW1lID0gU3lzdGVtQ2xvY2suZWxhcHNlZFJlYWx0aW1lKCk7CisgICAgfQorCisgICAgcHVibGljIHZvaWQgc3RvcCgpIHsKKyAgICAgICAgaWYgKG1TdGFydFRpbWUgPT0gLTEpIHsKKyAgICAgICAgICAgICB0aHJvdyBuZXcgUnVudGltZUV4Y2VwdGlvbigKKyAgICAgICAgICAgICAgICAgIkNhbGxpbmcgc3RvcCB3aXRoIFN0b3BXYXRjaCBhbHJlYWR5IHN0b3BwZWQiKTsKKyAgICAgICAgfQorICAgICAgICBsb25nIHN0b3BUaW1lID0gU3lzdGVtQ2xvY2suZWxhcHNlZFJlYWx0aW1lKCk7CisgICAgICAgIG1Ub3RhbFRpbWUgKz0gc3RvcFRpbWUgLSBtU3RhcnRUaW1lOworICAgICAgICArK21OdW1DYWxsczsKKyAgICAgICAgbVN0YXJ0VGltZSA9IC0xOworICAgICAgICBpZiAobU51bUNhbGxzICUgU1RPUF9XQVRDSF9MT0dHSU5HX1BFUklPRCA9PSAwKSB7CisgICAgICAgICAgICBMb2cuaShUQUcsICJBVkcgbXMvY2FsbCAiICsgbU5hbWUgKyAiOiAiICsKKyAgICAgICAgICAgICAgICAgIFN0cmluZy5mb3JtYXQoIiUuMWYiLCBtVG90YWxUaW1lICogMS4wZiAvIG1OdW1DYWxscykpOworICAgICAgICAgICAgbVRvdGFsVGltZSA9IDA7CisgICAgICAgICAgICBtTnVtQ2FsbHMgPSAwOworICAgICAgICB9CisgICAgfQorCit9CisKK3B1YmxpYyBjbGFzcyBTdG9wV2F0Y2hNYXAgeworCisgICAgcHVibGljIGJvb2xlYW4gTE9HX01GRl9SVU5OSU5HX1RJTUVTID0gZmFsc2U7CisKKyAgICBwcml2YXRlIEhhc2hNYXA8U3RyaW5nLCBTdG9wV2F0Y2g+IG1TdG9wV2F0Y2hlcyA9IG51bGw7CisKKyAgICBwdWJsaWMgU3RvcFdhdGNoTWFwKCkgeworICAgICAgICBtU3RvcFdhdGNoZXMgPSBuZXcgSGFzaE1hcDxTdHJpbmcsIFN0b3BXYXRjaD4oKTsKKyAgICB9CisKKyAgICBwdWJsaWMgdm9pZCBzdGFydChTdHJpbmcgc3RvcFdhdGNoTmFtZSkgeworICAgICAgICBpZiAoIUxPR19NRkZfUlVOTklOR19USU1FUykgeworICAgICAgICAgICAgcmV0dXJuOworICAgICAgICB9CisgICAgICAgIGlmICghbVN0b3BXYXRjaGVzLmNvbnRhaW5zS2V5KHN0b3BXYXRjaE5hbWUpKSB7CisgICAgICAgICAgICBtU3RvcFdhdGNoZXMucHV0KHN0b3BXYXRjaE5hbWUsIG5ldyBTdG9wV2F0Y2goc3RvcFdhdGNoTmFtZSkpOworICAgICAgICB9CisgICAgICAgIG1TdG9wV2F0Y2hlcy5nZXQoc3RvcFdhdGNoTmFtZSkuc3RhcnQoKTsKKyAgICB9CisKKyAgICBwdWJsaWMgdm9pZCBzdG9wKFN0cmluZyBzdG9wV2F0Y2hOYW1lKSB7CisgICAgICAgIGlmICghTE9HX01GRl9SVU5OSU5H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Qgc2V0RnJhbWUoRnJhbWUgZnJhbWUpIHsKKyAgICAgICAgYXNzaWduRnJhbWUoZnJhbWUsIHRydWUpOworICAgIH0KKworICAgIEBPdmVycmlkZQorICAgIHB1YmxpYyB2b2lkIHB1c2hGcmFtZShGcmFtZSBmcmFtZSkgeworICAgICAgICBhc3NpZ25GcmFtZShmcmFtZSwgZmFsc2UpOworICAgIH0KKworICAgIHByb3RlY3RlZCBzeW5jaHJvbml6ZWQgdm9pZCBhc3NpZ25GcmFtZShGcmFtZSBmcmFtZSwgYm9vbGVhbiBwZXJzaXN0ZW50KSB7CisgICAgICAgIGFzc2VydFBvcnRJc09wZW4oKTsKKyAgICAgICAgY2hlY2tGcmFtZVR5cGUoZnJhbWUsIHBlcnNpc3RlbnQpOworCisgICAgICAgIGlmIChwZXJzaXN0ZW50KSB7CisgICAgICAgICAgICBpZiAobUZyYW1lICE9IG51bGwpIHsKKyAgICAgICAgICAgICAgICBtRnJhbWUucmVsZWFzZSgpOworICAgICAgICAgICAgfQorICAgICAgICB9IGVsc2UgaWYgKG1GcmFtZSAhPSBudWxsKSB7CisgICAgICAgICAgICB0aHJvdyBuZXcgUnVudGltZUV4Y2VwdGlvbigKKyAgICAgICAgICAgICAgICAiQXR0ZW1wdGluZyB0byBwdXNoIG1vcmUgdGhhbiBvbmUgZnJhbWUgb24gcG9ydDogIiArIHRoaXMgKyAiISIpOworICAgICAgICB9CisgICAgICAgIG1GcmFtZSA9IGZyYW1lLnJldGFpbigpOworICAgICAgICBtRnJhbWUubWFya1JlYWRPbmx5KCk7CisgICAgICAgIG1QZXJzaXN0ZW50ID0gcGVyc2lzdGVudDsKKyAgICB9CisKKyAgICBAT3ZlcnJpZGUKKyAgICBwdWJsaWMgc3luY2hyb25pemVkIEZyYW1lIHB1bGxGcmFtZSgpIHsKKyAgICAgICAgLy8gTWFrZSBzdXJlIHdlIGhhdmUgYSBmcmFtZQorICAgICAgICBpZiAobUZyYW1lID09IG51bGwpIHsKKyAgICAgICAg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GxlZ2FsQWNjZXNzRXhjZXB0aW9uIGUpIHsKKyAgICAgICAgICAgICAgICB0aHJvdyBuZXcgUnVudGltZUV4Y2VwdGlvbigiQ2Fubm90IGFjY2VzcyBTY2hlZHVsZXIgY29uc3RydWN0b3IhIiwgZSk7CisgICAgICAgICAgICB9IGNhdGNoIChJbnZvY2F0aW9uVGFyZ2V0RXhjZXB0aW9uIGUpIHsKKyAgICAgICAgICAgICAgICB0aHJvdyBuZXcgUnVudGltZUV4Y2VwdGlvbigiU2NoZWR1bGVyIGNvbnN0cnVjdG9yIHRocmV3IGFuIGV4Y2VwdGlvbiIsIGUpOworICAgICAgICAgICAgfSBjYXRjaCAoRXhjZXB0aW9uIGUpIHsKKyAgICAgICAgICAgICAgICB0aHJvdyBuZXcgUnVudGltZUV4Y2VwdGlvbigiQ291bGQgbm90IGluc3RhbnRpYXRlIFNjaGVkdWxlciIsIGUpOworICAgICAgICAgICAgfQorICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgdGhyb3cgbmV3IElsbGVnYWxBcmd1bWVudEV4Y2VwdGlvbigiQ2xhc3MgcHJvdmlkZWQgaXMgbm90IGEgU2NoZWR1bGVyIHN1YmNsYXNzISIpOworICAgICAgICB9CisKKyAgICAgICAgLy8gQXNzb2NpYXRlIHRoaXMgcnVubmVyIGFuZCB0aGUgZ3JhcGggd2l0aCB0aGUgY29udGV4dAorICAgICAgICBtRmlsdGVyQ29udGV4dCA9IGNvbnRleHQ7CisgICAgICAgIG1GaWx0ZXJDb250ZXh0LmFkZEdyYXBoKGdyYXBoKTsKKworICAgICAgICBtVGltZXIgPSBuZXcgU3RvcFdhdGNoTWFwKCk7CisKKyAgICAgICAgaWYgKG1Mb2dWZXJib3NlKSBMb2cudihUQUcsICJTZXR0aW5nIHVwIGZpbHRlcnMiKTsKKworICAgICAgICAvLyBTZXR1cCBncmFwaCBmaWx0ZXJzCisgICAgICAgIGdyYXBoLnNldHVwRmlsdGVycygpOworICAgIH0KKworICAgIEBPdmVycmlkZQorICAgIHB1YmxpYyBGaWx0ZXJHcmFwaCBnZXRHcmFwaCgpIHsKKyAgICAgICAgcmV0dXJuIG1TY2hlZHVsZXIgIT0gbnVsbCA/IG1TY2hlZHVsZXIuZ2V0R3JhcGgoKSA6IG51bGw7CisgICAgfQorCisgICAgcHVibGljIGludCBzdGVwKCkgeworICAgICAgICBhc3NlcnRSZWFkeVRvU3RlcCgpOworICAgICAgICBpZiAoIWdldEdyYXBoKCkuaXNSZWFkeSgpICkgeworICAgICAgICAgICAgdGhyb3cgbmV3IFJ1bnRpbWVFeGNlcHRpb24oIlRyeWluZyB0byBwcm9jZXNzIGdyYXBoIHRoYXQgaXMgbm90IG9wZW4hIik7CisgICAgICAgIH0KKyAgICAgICAgcmV0dXJuIHBlcmZvcm1TdGVwKCkgPyBSRVNVTFRfUlVOTklORyA6IGRldGVybWluZVBvc3RSdW5TdGF0ZSgpOworICAgIH0KKworICAgIHB1YmxpYyB2b2lkIGJlZ2luUHJvY2Vzc2luZygpIHsKKyAgICAgICAgbVNjaGVkdWxlci5yZXNldCgpOworICAgICAgICBnZXRHcmFwaCgpLmJlZ2luUHJvY2Vzc2luZygpOworICAgIH0KKworICAgIHB1YmxpYyB2b2lkIGNsb3NlKCkgeworICAgICAgICAvLyBDbG9zZSBmaWx0ZXJzCisgICAgICAgIGlmIChtTG9nVmVyYm9zZSkgTG9nLnYoVEFHLCAiQ2xvc2luZyBncmFwaC4iKTsKKyAgICAgICAgZ2V0R3JhcGgoKS5jbG9zZUZpbHRlcnMobUZpbHRlckNvbnRleHQpOworICAgICAgICBtU2NoZWR1bGVyLnJlc2V0KCk7CisgICAgfQorCisgICAgQE92ZXJyaWRlCisgICAgcHVibGljIHZvaWQgcnVuKCkgeworICAgICAgICBpZiAobUxvZ1ZlcmJvc2UpIExvZy52KFRBRywgIkJlZ2lubmluZyBydW4uIik7CisKKyAgICAgICAgYXNzZXJ0UmVhZHlUb1N0ZXAoKTsKKworICAgICAgICAvLyBQcmV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vdGVjdGVkIHZvaWQgc2NoZWR1bGVGaWx0ZXJXYWtlKEZpbHRlciBmaWx0ZXIsIGludCBkZWxheSkgeworICAgICAgICAvLyBDbG9zZSB0aGUgd2FrZSBjb25kaXRpb24KKyAgICAgICAgbVdha2VDb25kaXRpb24uY2xvc2UoKTsKKworICAgICAgICAvLyBTY2hlZHVsZSB0aGUgd2FrZS11cAorICAgICAgICBmaW5hbCBGaWx0ZXIgZmlsdGVyVG9TY2hlZHVsZSA9IGZpbHRlcjsKKyAgICAgICAgZmluYWwgQ29uZGl0aW9uVmFyaWFibGUgY29uZGl0aW9uVG9XYWtlID0gbVdha2VDb25kaXRpb247CisKKyAgICAgICAgbVdha2VFeGVjdXRvci5zY2hlZHVsZShuZXcgUnVubmFibGUoKSB7CisgICAgICAgICAgQE92ZXJyaWRlCisgICAgICAgICAgcHVibGljIHZvaWQgcnVuKCkgeworICAgICAgICAgICAgICAgIGZpbHRlclRvU2NoZWR1bGUudW5zZXRTdGF0dXMoRmlsdGVyLlNUQVRVU19TTEVFUElORyk7CisgICAgICAgICAgICAgICAgY29uZGl0aW9uVG9XYWtlLm9wZW4oKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfSwgZGVsYXksIFRpbWVVbml0Lk1JTExJU0VDT05EUyk7CisgICAgfQorCisgICAgcHJvdGVjdGVkIGludCBkZXRlcm1pbmVQb3N0UnVuU3RhdGUoKSB7CisgICAgICAgIGJvb2xlYW4gaXNCbG9ja2VkID0gZmFsc2U7CisgICAgICAgIGZvciAoRmlsdGVyIGZpbHRlciA6IG1TY2hlZHVsZXIuZ2V0R3JhcGgoKS5nZXRGaWx0ZXJzKCkpIHsKKyAgICAgICAgICAgIGlmIChmaWx0ZXIuaXNPcGVuKCkpIHsKKyAgICAgICAgICAgICAgICBpZiAoZmlsdGVyLmdldFN0YXR1cygpID09IEZpbHRlci5TVEFUVVNfU0xFRVBJTkcpIHsKKyAgICAgICAgICAgICAgICAgICAgLy8gSWYgQU5ZIG5vZGUgaXMgc2xlZXBpbmcsIHdlIHJldHVybiBvdXIgc3RhdGUgYXMgc2xlZXBpbmcKKyAgICAgICAgICAgICAgICAgICAgcmV0dXJuIFJFU1VMVF9TTEVFUElORzsKKyAgICAgICAgICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgICAgICAgICAvLyBJZiBhIG5vZGUgaXMgc3RpbGwgb3BlbiwgaXQgaXMgYmxvY2tlZCAoYnkgaW5wdXQgb3Igb3V0cHV0KQorICAgICAgICAgICAgICAgICAgICByZXR1cm4gUkVTVUxUX0JMT0NLRUQ7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgICAgIHJldHVybiBSRVNVTFRfRklOSVNIRUQ7CisgICAgfQorCisgICAgLy8gQ29yZSBpbnRlcm5hbCBtZXRob2RzIC8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vCisgICAgYm9vbGVhbiBwZXJmb3JtU3RlcCgpIHsKKyAgICAgICAgaWYgKG1Mb2dWZXJib3NlKSBMb2cudihUQUcsICJQZXJmb3JtaW5nIG9uZSBzdGVwLiIpOworICAgICAgICBGaWx0ZXIgZmlsdGVyID0gbVNjaGVkdWxlci5zY2hlZHVsZU5leHROb2RlKCk7CisgICAgICAgIGlmIChmaWx0ZXIgIT0gbnVsbCkgeworICAgICAgICAgICAgbVRpbWVyLnN0YXJ0KGZpbHRlci5nZXROYW1lKCkpOworICAgICAgICAgICAgcHJvY2Vzc0ZpbHRlck5vZGUoZmlsdGVyKTsKKyAgICAgICAgICAgIG1UaW1lci5zdG9wKGZpbHRlci5nZXROYW1lKCkpOworICAgICAgICAgICAgcmV0dXJuIHRydWU7CisgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICByZXR1cm4gZmFsc2U7CisgICAgICAgIH0KKyAgICB9CisKKyAgICB2b2lkIGFzc2VydFJlYWR5VG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dGF0aWMgTXV0YWJsZUZyYW1lRm9ybWF0IGNyZWF0ZShpbnQgd2lkdGgsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGludCBoZWlnaHQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGludCBjb2xvcnNwYWNlLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpbnQgYnl0ZXNQZXJTYW1wbGUsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGludCB0YXJnZXQpIHsKKyAgICAgICAgTXV0YWJsZUZyYW1lRm9ybWF0IHJlc3VsdCA9IG5ldyBNdXRhYmxlRnJhbWVGb3JtYXQoRnJhbWVGb3JtYXQuVFlQRV9CWVRFLCB0YXJnZXQpOworICAgICAgICByZXN1bHQuc2V0RGltZW5zaW9ucyh3aWR0aCwgaGVpZ2h0KTsKKyAgICAgICAgcmVzdWx0LnNldEJ5dGVzUGVyU2FtcGxlKGJ5dGVzUGVyU2FtcGxlKTsKKyAgICAgICAgcmVzdWx0LnNldE1ldGFWYWx1ZShDT0xPUlNQQUNFX0tFWSwgY29sb3JzcGFjZSk7CisgICAgICAgIGlmICh0YXJnZXQgPT0gRnJhbWVGb3JtYXQuVEFSR0VUX1NJTVBMRSkgeworICAgICAgICAgICAgcmVzdWx0LnNldE9iamVjdENsYXNzKEJpdG1hcC5jbGFzcyk7CisgICAgICAgIH0KKyAgICAgICAgcmV0dXJuIHJlc3VsdDsKKyAgICB9CisKKyAgICBwdWJsaWMgc3RhdGljIE11dGFibGVGcmFtZUZvcm1hdCBjcmVhdGUoaW50IHdpZHRoLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpbnQgaGVpZ2h0LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpbnQgY29sb3JzcGFjZSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaW50IHRhcmdldCkgeworICAgICAgICByZXR1cm4gY3JlYXRlKHdpZHRoLAorICAgICAgICAgICAgICAgICAgICAgIGhlaWdodCwKKyAgICAgICAgICAgICAgICAgICAgICBjb2xvcnNwYWNlLAorICAgICAgICAgICAgICAgICAgICAgIGJ5dGVzUGVyU2FtcGxlRm9yQ29sb3JzcGFjZShjb2xvcnNwYWNlKSwKKyAgICAgICAgICAgICAgICAgICAgICB0YXJnZXQpOworICAgIH0KKworICAgIHB1YmxpYyBzdGF0aWMgTXV0YWJsZUZyYW1lRm9ybWF0IGNyZWF0ZShpbnQgY29sb3JzcGFjZSwgaW50IHRhcmdldCkgeworICAgICAgICByZXR1cm4gY3JlYXRlKEZyYW1lRm9ybWF0LlNJWkVfVU5TUEVDSUZJRUQsCisgICAgICAgICAgICAgICAgICAgICAgRnJhbWVGb3JtYXQuU0laRV9VTlNQRUNJRklFRCwKKyAgICAgICAgICAgICAgICAgICAgICBjb2xvcnNwYWNlLAorICAgICAgICAgICAgICAgICAgICAgIGJ5dGVzUGVyU2FtcGxlRm9yQ29sb3JzcGFjZShjb2xvcnNwYWNlKSwKKyAgICAgICAgICAgICAgICAgICAgICB0YXJnZXQpOworICAgIH0KKworICAgIHB1YmxpYyBzdGF0aWMgTXV0YWJsZUZyYW1lRm9ybWF0IGNyZWF0ZShpbnQgY29sb3JzcGFjZSkgeworICAgICAgICByZXR1cm4gY3JlYXRlKEZyYW1lRm9ybWF0LlNJWkVfVU5TUEVDSUZJRUQsCisgICAgICAgICAgICAgICAgICAgICAgRnJhbWVGb3JtYXQuU0laRV9VTlNQRUNJRklFRCwKKyAgICAgICAgICAgICAgICAgICAgICBjb2xvcnNwYWNlLAorICAgICAgICAgICAgICAgICAgICAgIGJ5dGVzUGVyU2FtcGxlRm9yQ29sb3JzcGFjZShjb2xvcnNwYWNlKSwKKyAgICAgICAgICAgICAgICAgICAgICBGcmFtZUZvcm1hdC5UQVJHRVRfVU5TU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WJjbGFzcyEgKFJlY2VpdmVkIGNsYXNzOiAiICsgY2xhenogKyAiKS4iKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIHRyeSB7CisgICAgICAgICAgICAgICAgcmV0dXJuICgoTmF0aXZlQnVmZmVyKWNsYXp6Lm5ld0luc3RhbmNlKCkpLmdldEVsZW1lbnRTaXplKCk7CisgICAgICAgICAgICB9IGNhdGNoIChFeGNlcHRpb24gZSkgeworICAgICAgICAgICAgICAgIHRocm93IG5ldyBSdW50aW1lRXhjZXB0aW9uKCJDb3VsZCBub3QgZGV0ZXJtaW5lIHRoZSBzaXplIG9mIGFuIGVsZW1lbnQgaW4gYSAiCisgICAgICAgICAgICAgICAgICAgICsgIm5hdGl2ZSBvYmplY3QtYmFzZWQgZnJhbWUgb2YgdHlwZSAiICsgY2xhenogKyAiISBQZXJoYXBzIGl0IGlzIG1pc3NpbmcgYSAiCisgICAgICAgICAgICAgICAgICAgICsgImRlZmF1bHQgY29uc3RydWN0b3I/Iik7CisgICAgICAgICAgICB9CisgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICByZXR1cm4gRnJhbWVGb3JtYXQuQllURVNfUEVSX1NBTVBMRV9VTlNQRUNJRklFRDsKKyAgICAgICAgfQorICAgIH0KKworICAgIHByaXZhdGUgc3RhdGljIENsYXNzIGdldEJveGVkQ2xhc3MoQ2xhc3MgdHlwZSkgeworICAgICAgICAvLyBDaGVjayBpZiB0eXBlIGlzIHByaW1pdGl2ZQorICAgICAgICBpZiAodHlwZS5pc1ByaW1pdGl2ZSgpKSB7CisgICAgICAgICAgICAvLyBZZXMgLT4gYm94IGl0CisgICAgICAgICAgICBpZiAodHlwZSA9PSBib29sZWFuLmNsYXNzKSB7CisgICAgICAgICAgICAgICAgcmV0dXJuIGphdmEubGFuZy5Cb29sZWFuLmNsYXNzOworICAgICAgICAgICAgfSBlbHNlIGlmICh0eXBlID09IGJ5dGUuY2xhc3MpIHsKKyAgICAgICAgICAgICAgICByZXR1cm4gamF2YS5sYW5nLkJ5dGUuY2xhc3M7CisgICAgICAgICAgICB9IGVsc2UgaWYgKHR5cGUgPT0gY2hhci5jbGFzcykgeworICAgICAgICAgICAgICAgIHJldHVybiBqYXZhLmxhbmcuQ2hhcmFjdGVyLmNsYXNzOworICAgICAgICAgICAgfSBlbHNlIGlmICh0eXBlID09IHNob3J0LmNsYXNzKSB7CisgICAgICAgICAgICAgICAgcmV0dXJuIGphdmEubGFuZy5TaG9ydC5jbGFzczsKKyAgICAgICAgICAgIH0gZWxzZSBpZiAodHlwZSA9PSBpbnQuY2xhc3MpIHsKKyAgICAgICAgICAgICAgICByZXR1cm4gamF2YS5sYW5nLkludGVnZXIuY2xhc3M7CisgICAgICAgICAgICB9IGVsc2UgaWYgKHR5cGUgPT0gbG9uZy5jbGFzcykgeworICAgICAgICAgICAgICAgIHJldHVybiBqYXZhLmxhbmcuTG9uZy5jbGFzczsKKyAgICAgICAgICAgIH0gZWxzZSBpZiAodHlwZSA9PSBmbG9hdC5jbGFzcykgeworICAgICAgICAgICAgICAgIHJldHVybiBqYXZhLmxhbmcuRmxvYXQuY2xhc3M7CisgICAgICAgICAgICB9IGVsc2UgaWYgKHR5cGUgPT0gZG91YmxlLmNsYXNzKSB7CisgICAgICAgICAgICAgICAgcmV0dXJuIGphdmEubGFuZy5Eb3VibGUuY2xhc3M7CisgICAgICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgICAgIHRocm93IG5ldyBJbGxlZ2FsQXJndW1lbnRFeGNlcHRpb24oCisgICAgICAgICAgICAgICAgICAgICJVbmtub3duIHByaW1pdGl2ZSB0eXBlOiAiICsgdHlwZS5nZXRTaW1wbGVOYW1lKCkgKyAiISIpOworICAgICAgICAgICAgfQorICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgLy8gTm8gLT4gcmV0dXJuIGl0CisgICAgICAgICAgICByZXR1cm4gdHlwZTsKKyAgICAgICAgfQorICAgIH0KK30KZGlmZiAtLWdpdCBhL21lZGlhL21j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BQb2ludCh0aGlzLnggKyB4LCB0aGlzLnkgKyB5KTsKKyAgICB9CisKKyAgICBwdWJsaWMgUG9pbnQgcGx1cyhQb2ludCBwb2ludCkgeworICAgICAgICByZXR1cm4gdGhpcy5wbHVzKHBvaW50LngsIHBvaW50LnkpOworICAgIH0KKworICAgIHB1YmxpYyBQb2ludCBtaW51cyhmbG9hdCB4LCBmbG9hdCB5KSB7CisgICAgICAgIHJldHVybiBuZXcgUG9pbnQodGhpcy54IC0geCwgdGhpcy55IC0geSk7CisgICAgfQorCisgICAgcHVibGljIFBvaW50IG1pbnVzKFBvaW50IHBvaW50KSB7CisgICAgICAgIHJldHVybiB0aGlzLm1pbnVzKHBvaW50LngsIHBvaW50LnkpOworICAgIH0KKworICAgIHB1YmxpYyBQb2ludCB0aW1lcyhmbG9hdCBzKSB7CisgICAgICAgIHJldHVybiBuZXcgUG9pbnQodGhpcy54ICogcywgdGhpcy55ICogcyk7CisgICAgfQorCisgICAgcHVibGljIFBvaW50IG11bHQoZmxvYXQgeCwgZmxvYXQgeSkgeworICAgICAgICByZXR1cm4gbmV3IFBvaW50KHRoaXMueCAqIHgsIHRoaXMueSAqIHkpOworICAgIH0KKworICAgIHB1YmxpYyBmbG9hdCBsZW5ndGgoKSB7CisgICAgICAgIHJldHVybiAoZmxvYXQpTWF0aC5zcXJ0KHgqeCArIHkqeSk7CisgICAgfQorCisgICAgcHVibGljIGZsb2F0IGRpc3RhbmNlVG8oUG9pbnQgcCkgeworICAgICAgICByZXR1cm4gcC5taW51cyh0aGlzKS5sZW5ndGgoKTsKKyAgICB9CisKKyAgICBwdWJsaWMgUG9pbnQgc2NhbGVkVG8oZmxvYXQgbGVuZ3RoKSB7CisgICAgICAgIHJldHVybiB0aGlzLnRpbWVzKGxlbmd0aCAvIHRoaXMubGVuZ3RoKCkpOworICAgIH0KKworICAgIHB1YmxpYyBQb2ludCBub3JtYWxpemUoKSB7CisgICAgICAgIHJldHVybiB0aGlzLnNjYWxlZFRvKDEuMGYpOworICAgIH0KKworICAgIHB1YmxpYyBQb2ludCByb3RhdGVkOTAoaW50IGNvdW50KSB7CisgICAgICAgIGZsb2F0IG54ID0gdGhpcy54OworICAgICAgICBmbG9hdCBueSA9IHRoaXMueTsKKyAgICAgICAgZm9yIChpbnQgaSA9IDA7IGkgPCBjb3VudDsgKytpKSB7CisgICAgICAgICAgICBmbG9hdCBveCA9IG54OworICAgICAgICAgICAgbnggPSBueTsKKyAgICAgICAgICAgIG55ID0gLW94OworICAgICAgICB9CisgICAgICAgIHJldHVybiBuZXcgUG9pbnQobngsIG55KTsKKyAgICB9CisKKyAgICBwdWJsaWMgUG9pbnQgcm90YXRlZChmbG9hdCByYWRpYW5zKSB7CisgICAgICAgIC8vIFRPRE8ocmVubik6IE9wdGltaXplOiBLZWVwIGNhY2hlIG9mIGNvcy9zaW4gdmFsdWVzCisgICAgICAgIHJldHVybiBuZXcgUG9pbnQoKGZsb2F0KShNYXRoLmNvcyhyYWRpYW5zKSAqIHggLSBNYXRoLnNpbihyYWRpYW5zKSAqIHkpLAorICAgICAgICAgICAgICAgICAgICAgICAgIChmbG9hdCkoTWF0aC5zaW4ocmFkaWFucykgKiB4ICsgTWF0aC5jb3MocmFkaWFucykgKiB5KSk7CisgICAgfQorCisgICAgcHVibGljIFBvaW50IHJvdGF0ZWRBcm91bmQoUG9pbnQgY2VudGVyLCBmbG9hdCByYWRpYW5zKSB7CisgICAgICAgIHJldHVybiB0aGlzLm1pbnVzKGNlbnRlcikucm90YXRlZChyYWRpYW5zKS5wbHVzKGNlbnRlcik7CisgICAgfQorCisgICAgQE92ZXJyaWRlCisgICAgcHVibGljIFN0cmluZyB0b1N0cmluZygpIHsKKyAgICAgICAgcmV0dXJuICIoIiArIHggKyAiLCAiICsgeSArICIpIjsKKyAgICB9Cit9CmRpZmYgLS1naXQgYS9tZWRpYS9tY2EvZmlsdGVyZncvamF2YS9hbmRyb2lkL2ZpbHRlcmZ3L2dlb21ldHJ5L1F1YWQuamF2YSBi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hdGlvbnMgdW5kZXIgdGhlIExpY2Vuc2UuCisgKi8KKworCitwYWNrYWdlIGFuZHJvaWQuZmlsdGVyZncuZ2VvbWV0cnk7CisKK2ltcG9ydCBhbmRyb2lkLmZpbHRlcmZ3Lmdlb21ldHJ5LlBvaW50OworCitpbXBvcnQgamF2YS5sYW5nLkZsb2F0OworaW1wb3J0IGphdmEudXRpbC5BcnJheXM7CitpbXBvcnQgamF2YS51dGlsLkNvbGxlY3Rpb25zOworaW1wb3J0IGphdmEudXRpbC5MaXN0OworCisvKioKKyAqIEBoaWRlCisgKi8KK3B1YmxpYyBjbGFzcyBRdWFkIHsKKworICAgIHB1YmxpYyBQb2ludCBwMDsKKyAgICBwdWJsaWMgUG9pbnQgcDE7CisgICAgcHVibGljIFBvaW50IHAyOworICAgIHB1YmxpYyBQb2ludCBwMzsKKworICAgIHB1YmxpYyBRdWFkKCkgeworICAgIH0KKworICAgIHB1YmxpYyBRdWFkKFBvaW50IHAwLCBQb2ludCBwMSwgUG9pbnQgcDIsIFBvaW50IHAzKSB7CisgICAgICAgIHRoaXMucDAgPSBwMDsKKyAgICAgICAgdGhpcy5wMSA9IHAxOworICAgICAgICB0aGlzLnAyID0gcDI7CisgICAgICAgIHRoaXMucDMgPSBwMzsKKyAgICB9CisKKyAgICBwdWJsaWMgYm9vbGVhbiBJc0luVW5pdFJhbmdlKCkgeworICAgICAgICByZXR1cm4gcDAuSXNJblVuaXRSYW5nZSgpICYmCisgICAgICAgICAgICAgICBwMS5Jc0luVW5pdFJhbmdlKCkgJiYKKyAgICAgICAgICAgICAgIHAyLklzSW5Vbml0UmFuZ2UoKSAmJgorICAgICAgICAgICAgICAgcDMuSXNJblVuaXRSYW5nZSgpOworICAgIH0KKworICAgIHB1YmxpYyBRdWFkIHRyYW5zbGF0ZWQoUG9pbnQgdCkgeworICAgICAgICByZXR1cm4gbmV3IFF1YWQocDAucGx1cyh0KSwgcDEucGx1cyh0KSwgcDIucGx1cyh0KSwgcDMucGx1cyh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gd2lkdGgsIGZsb2F0IGhlaWdodCkgeworICAgICAgICBzdXBlcihuZXcgUG9pbnQoeCwgeSksCisgICAgICAgICAgICAgIG5ldyBQb2ludCh4ICsgd2lkdGgsIHkpLAorICAgICAgICAgICAgICBuZXcgUG9pbnQoeCwgeSArIGhlaWdodCksCisgICAgICAgICAgICAgIG5ldyBQb2ludCh4ICsgd2lkdGgsIHkgKyBoZWlnaHQpKTsKKyAgICB9CisKKyAgICBwdWJsaWMgUmVjdGFuZ2xlKFBvaW50IG9yaWdpbiwgUG9pbnQgc2l6ZSkgeworICAgICAgICBzdXBlcihvcmlnaW4sCisgICAgICAgICAgICAgIG9yaWdpbi5wbHVzKHNpemUueCwgMC4wZiksCisgICAgICAgICAgICAgIG9yaWdpbi5wbHVzKDAuMGYsIHNpemUueSksCisgICAgICAgICAgICAgIG9yaWdpbi5wbHVzKHNpemUueCwgc2l6ZS55KSk7CisgICAgfQorCisgICAgcHVibGljIHN0YXRpYyBSZWN0YW5nbGUgZnJvbVJvdGF0ZWRSZWN0KFBvaW50IGNlbnRlciwgUG9pbnQgc2l6ZSwgZmxvYXQgcm90YXRpb24pIHsKKyAgICAgICAgUG9pbnQgcDAgPSBuZXcgUG9pbnQoY2VudGVyLnggLSBzaXplLngvMmYsIGNlbnRlci55IC0gc2l6ZS55LzJmKTsKKyAgICAgICAgUG9pbnQgcDEgPSBuZXcgUG9pbnQoY2VudGVyLnggKyBzaXplLngvMmYsIGNlbnRlci55IC0gc2l6ZS55LzJmKTsKKyAgICAgICAgUG9pbnQgcDIgPSBuZXcgUG9pbnQoY2VudGVyLnggLSBzaXplLngvMmYsIGNlbnRlci55ICsgc2l6ZS55LzJmKTsKKyAgICAgICAgUG9pbnQgcDMgPSBuZXcgUG9pbnQoY2VudGVyLnggKyBzaXplLngvMmYsIGNlbnRlci55ICsgc2l6ZS55LzJmKTsKKyAgICAgICAgcmV0dXJuIG5ldyBSZWN0YW5nbGUocDAucm90YXRlZEFyb3VuZChjZW50ZXIsIHJvdGF0aW9uKSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcDEucm90YXRlZEFyb3VuZChjZW50ZXIsIHJvdGF0aW9uKSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcDIucm90YXRlZEFyb3VuZChjZW50ZXIsIHJvdGF0aW9uKSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcDMucm90YXRlZEFyb3VuZChjZW50ZXIsIHJvdGF0aW9uKSk7CisgICAgfQorCisgICAgcHJpdmF0ZSBSZWN0YW5nbGUoUG9pbnQgcDAsIFBvaW50IHAxLCBQb2ludCBwMiwgUG9pbnQgcDMpIHsKKyAgICAgICAgc3VwZXIocDAsIHAxLCBwMiwgcDMpOworICAgIH0KKworICAgIHB1YmxpYyBzdGF0aWMgUmVjdGFuZ2xlIGZyb21DZW50ZXJWZXJ0aWNhbEF4aXMoUG9pbnQgY2VudGVyLCBQb2ludCB2QXhpcywgUG9pbnQgc2l6ZSkgeworICAgICAgICBQb2ludCBkeSA9IHZBeGlzLnNjYWxlZFRvKHNpemUueSAvIDIuMGYpOworICAgICAgICBQb2ludCBkeCA9IHZBeGlzLnJvdGF0ZWQ5MCgxKS5zY2FsZWRUbyhzaXplLnggLyAyLjBmKTsKKyAgICAgICAgcmV0dXJuIG5ldyBSZWN0YW5nbGUoY2VudGVyLm1pbnVzKGR4KS5taW51cyhkeSksCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNlbnRlci5wbHVzKGR4KS5taW51cyhkeSksCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNlbnRlci5taW51cyhkeCkucGx1cyhkeSksCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNlbnRlci5wbHVzKGR4KS5wbHVzKGR5KSk7CisgICAgfQorCisgICAgcHVibGljIGZsb2F0IGdldFdpZHRoKCkgeworICAgICAgICByZXR1cm4gcDEubWludXMocDApLmxlbmd0aCgpOworICAgIH0KKworICAgIHB1YmxpYyBmbG9hdCB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R0ZW1wdCB0byBtYXRjaAorICAgICAgICBTdHJpbmcgcmVzdWx0ID0gbnVsbDsKKyAgICAgICAgaWYgKG1hdGNoZXIubG9va2luZ0F0KCkpIHsKKyAgICAgICAgICAgIHVwZGF0ZUxpbmVDb3VudChtT2Zmc2V0LCBtYXRjaGVyLmVuZCgpKTsKKyAgICAgICAgICAgIG1PZmZzZXQgPSBtYXRjaGVyLmVuZCgpOworICAgICAgICAgICAgcmVzdWx0ID0gbUlucHV0LnN1YnN0cmluZyhtYXRjaGVyLnN0YXJ0KCksIG1hdGNoZXIuZW5kKCkpOworICAgICAgICB9CisKKyAgICAgICAgLy8gU2tpcCBpZ25vcmUgcGF0dGVybgorICAgICAgICBpZiAocmVzdWx0ICE9IG51bGwgJiYgbUlnbm9yZVBhdHRlcm4gIT0gbnVsbCkgeworICAgICAgICAgICAgc2tpcChtSWdub3JlUGF0dGVybik7CisgICAgICAgIH0KKworICAgICAgICByZXR1cm4gcmVzdWx0OworICAgIH0KKworICAgIHB1YmxpYyBTdHJpbmcgZWF0KFBhdHRlcm4gcGF0dGVybiwgU3RyaW5nIHRva2VuTmFtZSkgeworICAgICAgICBTdHJpbmcgcmVzdWx0ID0gdHJ5RWF0KHBhdHRlcm4pOworICAgICAgICBpZiAocmVzdWx0ID09IG51bGwpIHsKKyAgICAgICAgICAgIHRocm93IG5ldyBSdW50aW1lRXhjZXB0aW9uKHVuZXhwZWN0ZWRUb2tlbk1lc3NhZ2UodG9rZW5OYW1lKSk7CisgICAgICAgIH0KKyAgICAgICAgcmV0dXJuIHJlc3VsdDsKKyAgICB9CisKKyAgICBwdWJsaWMgYm9vbGVhbiBwZWVrKFBhdHRlcm4gcGF0dGVybikgeworICAgICAgICAvLyBTa2lwIGlnbm9yZSBwYXR0ZXJuCisgICAgICAgIGlmIChtSWdub3JlUGF0dGVybiAhPSBudWxsKSB7CisgICAgICAgICAgICBza2lwKG1JZ25vcmVQYXR0ZXJuKTsKKyAgICAgICAgfQorCisgICAgICA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aW5nIGNsYXNzTmFtZSwgU3RyaW5nIGZpbHRlck5hbWUpIHsKKyAgICAgICAgICAgIG1DbGFzc05hbWUgPSBjbGFzc05hbWU7CisgICAgICAgICAgICBtRmlsdGVyTmFtZSA9IGZpbHRlck5hbWU7CisgICAgICAgIH0KKworICAgICAgICBwdWJsaWMgdm9pZCBleGVjdXRlKFRleHRHcmFwaFJlYWRlciByZWFkZXIpIHRocm93cyBHcmFwaElPRXhjZXB0aW9uIHsKKyAgICAgICAgICAgIC8vIENyZWF0ZSB0aGUgZmlsdGVyCisgICAgICAgICAgICBGaWx0ZXIgZmlsdGVyID0gbnVsbDsKKyAgICAgICAgICAgIHRyeSB7CisgICAgICAgICAgICAgICAgZmlsdGVyID0gcmVhZGVyLm1GYWN0b3J5LmNyZWF0ZUZpbHRlckJ5Q2xhc3NOYW1lKG1DbGFzc05hbWUsIG1GaWx0ZXJOYW1lKTsKKyAgICAgICAgICAgIH0gY2F0Y2ggKElsbGVnYWxBcmd1bWVudEV4Y2VwdGlvbiBlKSB7CisgICAgICAgICAgICAgICAgdGhyb3cgbmV3IEdyYXBoSU9FeGNlcHRpb24oZS5nZXRNZXNzYWdlKCkpOworICAgICAgICAgICAgfQorCisgICAgICAgICAgICAvLyBTZXQgaXQgYXMgdGhlIGN1cnJlbnQgZmlsdGVyCisgICAgICAgICAgICByZWFkZXIubUN1cnJlbnRGaWx0ZXIgPSBmaWx0ZXI7CisgICAgICAgIH0KKyAgICB9CisKKyAgICBwcml2YXRlIGNsYXNzIEluaXRGaWx0ZXJDb21tYW5kIGltcGxlbWVudHMgQ29tbWFuZCB7CisgICAgICAgIHByaXZhdGUgS2V5VmFsdWVNYXAgbVBhcmFtczsKKworICAgICAgICBwdWJsaWMgSW5pdEZpbHRlckNvbW1hbmQoS2V5VmFsdWVNYXAgcGFyYW1zKSB7CisgICAgICAgICAgICBtUGFyYW1zID0gcGFyYW1zOworICAgICAgICB9CisKKyAgICAgICAgQE92ZXJyaWRlCisgICAgICAgIHB1YmxpYyB2b2lkIGV4ZWN1dGUoVGV4dEdyYXBoUmVhZGVyIHJlYWRlcikgdGhyb3dzIEdyYXBoSU9FeGNlcHRpb24geworICAgICAgICAgICAgRmlsdGVyIGZpbHRlciA9IHJlYWRlci5tQ3VycmVudEZpbHRlcjsKKyAgICAgICAgICAgIHRyeSB7CisgICAgICAgICAgICAgICAgZmlsdGVyLmluaXRXaXRoVmFsdWVNYXAobVBhcmFtcyk7CisgICAgICAgICAgICB9IGNhdGNoIChQcm90b2NvbEV4Y2VwdGlvbiBlKSB7CisgICAgICAgICAgICAgICAgdGhyb3cgbmV3IEdyYXBoSU9FeGNlcHRpb24oZS5nZXRNZXNzYWdlKCkpOworICAgICAgICAgICAgfQorICAgICAgICAgICAgcmVhZGVyLm1DdXJyZW50R3JhcGguYWRkRmlsdGVyKG1DdXJyZW50RmlsdGVyKTsKKyAgICAgICAgfQorICAgIH0KKworICAgIHByaXZhdGUgY2xhc3MgQ29ubmVjdENvbW1hbmQgaW1wbGVtZW50cyBDb21tYW5kIHsKKyAgICAgICAgcHJpdmF0ZSBTdHJpbmcgbVNvdXJjZUZpbHRlcjsKKyAgICAgICAgcHJpdmF0ZSBTdHJpbmcgbVNvdXJjZVBvcnQ7CisgICAgICAgIHByaXZhdGUgU3RyaW5nIG1UYXJnZXRGaWx0ZXI7CisgICAgICAgIHByaXZhdGUgU3RyaW5nIG1UYXJnZXROYW1lOworCisgICAgICAgIHB1YmxpYyBDb25uZWN0Q29tbWFuZChTdHJpbmcgc291cmNlRmlsdGVyLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgU3RyaW5nIHNvdXJjZVBvcnQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBTdHJpbmcgdGFyZ2V0RmlsdGVyLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgU3RyaW5nIHRhcmdldE5hbWUpIHsKKyAgICAgICAgICAgIG1Tb3VyY2VGaWx0ZXIgPSBzb3VyY2VGaWx0ZXI7CisgICAgICAgICAgICBtU291cmNlUG9ydCA9IHNvdXJjZVBvcnQ7CisgICAgICAgICAgICBtVGFyZ2V0RmlsdGVyID0gdGFyZ2V0RmlsdGVyOworICAgICAgICAgICAgbVRhcmdldE5hbWUgPSB0YXJnZXROYW1lOworICAgICAgICB9CisKKyAgICAgICAgQE92ZXJyaWRlCisgICAgICAgIHB1YmxpYyB2b2lkIGV4ZWN1dGUoVGV4dEdyYXBoUmVhZGVyIHJlYWRlcikgeworICAgICAgICAgICAgcmVhZGVyLm1DdXJyZW50R3JhcGguY29ubmVjdChtU291cmNlRmlsdGVyLCBtU291cmNlUG9ydCwgbVRhcmdldEZpbHRlciwgbVRhcmdldE5hbWUpOworICAgICAgICB9CisgICAgfQorCisgICAgQE92ZXJyaWRlCisgICAgcHVibGljIEZpbHRlckdyYXBoIHJlYWRHcmFwaFN0cmluZyhTdHJpbmcgZ3JhcGhTdHJpbmcpIHRocm93cyBHcmFwaElPRXhjZXB0aW9uIHsKKyAgICAgICAgRmlsdGVyR3JhcGggcmVzdWx0ID0gbmV3IEZpbHRlckdyYXBoKCk7CisKKyAgICAgICAgcmVzZXQoKTsKKyAgICAgICAgbUN1cnJlbnRHcmFwaCA9IHJlc3VsdDsKKyAgICAgICAgcGFyc2VTdHJpbmcoZ3JhcGhTdHJpbmcpOworICAgICAgICBhcHBseVNldHRpbmdzKCk7CisgICAgICAgIGV4ZWN1dGVDb21tYW5kcygpOworICAgICAgICByZXNldCgpOworCisgICAgICAgIHJldHVybiByZXN1bHQ7CisgICAgfQorCisgICAgcHJpdmF0ZSB2b2lkIHJlc2V0KCkgeworICAgICAgICBtQ3VycmVudEdyYXBoID0gbnVsbDsKKyAgICAgICAgbUN1cnJlbnRGaWx0ZXIgPSBudWxsOworICAgICAgICBtQ29tbWFuZHMuY2xlYXIoKTsKKyAgICAgICAgbUJvdW5kUmVmZXJlbmNlcyA9IG5ldyBLZXlWYWx1ZU1hcCgpOworICAgICAgICBtU2V0dGluZ3MgPS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XJuID0gUGF0dGVybi5jb21waWxlKCJbYS16QS1aMC05XFwtX10rIik7CisKKyAgICAgICAgZmluYWwgaW50IFNUQVRFX0NPTU1BTkQgICAgICAgICAgID0gMDsKKyAgICAgICAgZmluYWwgaW50IFNUQVRFX0lNUE9SVF9QS0cgICAgICAgID0gMTsKKyAgICAgICAgZmluYWwgaW50IFNUQVRFX0FERF9MSUJSQVJZICAgICAgID0gMjsKKyAgICAgICAgZmluYWwgaW50IFNUQVRFX0ZJTFRFUl9DTEFTUyAgICAgID0gMzsKKyAgICAgICAgZmluYWwgaW50IFNUQVRFX0ZJTFRFUl9OQU1FICAgICAgID0gNDsKKyAgICAgICAgZmluYWwgaW50IFNUQVRFX0NVUkxZX09QRU4gICAgICAgID0gNTsKKyAgICAgICAgZmluYWwgaW50IFNUQVRFX1BBUkFNRVRFUlMgICAgICAgID0gNjsKKyAgICAgICAgZmluYWwgaW50IFNUQVRFX0NVUkxZX0NMT1NFICAgICAgID0gNzsKKyAgICAgICAgZmluYWwgaW50IFNUQVRFX1NPVVJDRV9GSUxURVJOQU1FID0gODsKKyAgICAgICAgZmluYWwgaW50IFNUQVRFX1NPVVJDRV9QT1JUICAgICAgID0gOTsKKyAgICAgICAgZmluYWwgaW50IFNUQVRFX1JJR0hUX0FSUk9XICAgICAgID0gMTA7CisgICAgICAgIGZpbmFsIGludCBTVEFURV9UQVJHRVRfRklMVEVSTkFNRSA9IDExOworICAgICAgICBmaW5hbCBpbnQgU1RBVEVfVEFSR0VUX1BPUlQgICAgICAgPSAxMjsKKyAgICAgICAgZmluYWwgaW50IFNUQVRFX0FTU0lHTk1FTlQgICAgICAgID0gMTM7CisgICAgICAgIGZpbmFsIGludCBTVEFURV9FWFRFUk5BTCAgICAgICAgICA9IDE0OworICAgICAgICBmaW5hbCBpbnQgU1RBVEVfU0VUVElORyAgICAgICAgICAgPSAxNTsKKyAgICAgICAgZmluYWwgaW50IFNUQVRFX1NFTUlDT0xPTiAgICAgICAgID0gMTY7CisKKyAgICAgICAgaW50IHN0YXRlID0gU1RBVEVfQ09NTUFORDsKKyAgICAgICAgUGF0dGVyblNjYW5uZXIgc2Nhbm5lciA9IG5ldyBQYXR0ZXJuU2Nhbm5lcihncmFwaFN0cmluZywgaWdub3JlUGF0dGVybik7CisKKyAgICAgICAgU3RyaW5nIGN1ckNsYXNzTmFtZSA9IG51bGw7CisgICAgICAgIFN0cmluZyBjdXJTb3VyY2VGaWx0ZXJOYW1lID0gbnVsbDsKKyAgICAgICAgU3RyaW5nIGN1clNvdXJjZVBvcnROYW1lID0gbnVsbDsKKyAgICAgICAgU3RyaW5nIGN1clRhcmdldEZpbHRlck5hbWUgPSBudWxsOworICAgICAgICBTdHJpbmcgY3VyVGFyZ2V0UG9ydE5hbWUgPSBudWxsOworCisgICAgICAgIC8vIFN0YXRlIG1hY2hpbmUgbWFpbiBsb29wCisgICAgICAgIHdoaWxlICghc2Nhbm5lci5hdEVuZCgpKSB7CisgICAgICAgICAgICBzd2l0Y2ggKHN0YXRlKSB7CisgICAgICAgICAgICAgICAgY2FzZSBTVEFURV9DT01NQU5EOiB7CisgICAgICAgICAgICAgICAgICAgIFN0cmluZyBjdXJDb21tYW5kID0gc2Nhbm5lci5lYXQoY29tbWFuZFBhdHRlcm4sICI8Y29tbWFuZD4iKTsKKyAgICAgICAgICAgICAgICAgICAgaWYgKGN1ckNvbW1hbmQuZXF1YWxzKCJAaW1wb3J0IikpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIHN0YXRlID0gU1RBVEVfSU1QT1JUX1BLRzsKKyAgICAgICAgICAgICAgICAgICAgfSBlbHNlIGlmIChjdXJDb21tYW5kLmVxdWFscygiQGxpYnJhcnkiKSkgeworICAgICAgICAgICAgICAgICAgICAgICAgc3RhdGUgPSBTVEFURV9BRERfTElCUkFSWTsKKyAgICAgICAgICAgICAgICAgICAgfSBlbHNlIGlmIChjdXJDb21tYW5kLmVxdWFscygiQGZpbHRlciIpKSB7CisgICAgICAgICAgICAgICAgICAgICAgICBzdGF0ZSA9IFNUQVRFX0ZJTFRFUl9DTEFTUzsKKyAgICAgICAgICAgICAgICAgICAgfSBlbHNlIGlmIChjdXJDb21tYW5kLmVxdWFscygiQGNvbm5lY3QiKSkgeworICAgICAgICAgICAgICAgICAgICAgICAgc3RhdGUgPSBTVEFURV9TT1VSQ0VfRklMVEVSTkFNRTsKKyAgICAgICAgICAgICAgICAgICAgfSBlbHNlIGlmIChjdXJDb21tYW5kLmVxdWFscygiQHNldCIpKSB7CisgICAgICAgICAgICAgICAgICAgICAgICBzdGF0ZSA9IFNUQVRFX0FTU0lHTk1FTlQ7CisgICAgICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAoY3VyQ29tbWFuZC5lcXVhbHMoIkBleHRlcm5hbCIpKSB7CisgICAgICAgICAgICAgICAgICAgICAgICBzdGF0ZSA9IFNUQVRFX0VYVEVSTkFMOworICAgICAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKGN1ckNvbW1hbmQuZXF1YWxzKCJAc2V0dGluZyIpKSB7CisgICAgICAgICAgICAgICAgICAgICAgICBzdGF0ZSA9IFNUQVRFX1NFVFRJTkc7CisgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICAgICAgICAgICAgICB0aHJvdyBuZXcgR3JhcGhJT0V4Y2VwdGlvbigiVW5rbm93biBjb21tYW5kICciICsgY3VyQ29tbWFuZCArICInISIpOworICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgIH0KKworICAgICAgICAgICAgICAgIGNhc2UgU1RBVEVfSU1QT1JUX1BLRzogeworICAgICAgICAgICAgICAgICAgICBTdHJpbmcgcGFja2FnZU5hbWUgPSBzY2FubmVyLmVhdChwYWNrYWdlTmFtZVBhdHRlcm4sICI8cGFja2FnZS1uYW1lPiIpOworICAgICAgICAgICAgICAgICAgICBtQ29tbWFuZHMuYWRkKG5ldyBJbXBvcnRQYWNrYWdlQ29tbWFuZChwYWNrYWdlTmFtZSkpOworICAgICAgICAgICAgICAgICAgICBzdGF0ZSA9IFNUQVRFX1NFTUlDT0xPTjsKKyAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgfQorCisgICAgICAgICAgICAgICAgY2FzZSBTVEFURV9BRERfTElCUkFSWTogeworICAgICAgICAgICAgICAgICAgICBTdHJpbmcgbGlicmFyeU5hbWUgPSBzY2FubmVyLmVhdChsaWJyYXJ5TmFtZVBhdHRlcm4sICI8bGlicmFyeS1uYW1lPiIpOworICAgICAgICAgICAgICAgICAgICBtQ29tbWFuZHMuYWRkKG5ldyBBZGRMaWJyYXJ5Q29tbWFuZChsaWJyYXJ5TmFtZSkpOworICAgICAgICAgICAgICAgICAgICBzdGF0ZSA9IFNUQVRFX1NFTUlDT0xPTjsKKyAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgfQorCisgICAgICAgICAgICAgICAgY2FzZSBTVEFURV9GSUxURVJfQ0xBU1M6CisgICAgICAgICAgICAgICAgICAgIGN1ckNsYXNzTmFtZSA9IHNjYW5uZXIuZWF0KHdvcmRQYXR0ZXJuLCAiPGNsYXNzLW5hbWU+Iik7CisgICAgICAgICAgICAgICAgICAgIHN0YXRlID0gU1RBVEVfRklMVEVSX05BTUU7CisgICAgICAgICAgICAgICAgICAgIGJyZWFrOworCisgICAgICAgICAgICAgICAgY2FzZSBTVEFURV9GSUxURVJfTkFNRTogeworICAgICAgICAgICAgICAgICAgICBTdHJpbmcgY3VyRmlsdGVyTmFtZSA9IHNjYW5uZXIuZWF0KHdvcmRQYXR0ZXJuLCAiPGZpbHRlci1uYW1lPiIpOworICAgICAgICAgICAgICAgICAgICBtQ29tbWFuZHMuYWRkKG5ldyBBbGxvY2F0ZUZpbHRlckNvbW1hbmQoY3VyQ2xhc3NOYW1lLCBjdXJGaWx0ZXJOYW1lKSk7CisgICAgICAgICAgICAgICAgICAgIHN0YXRlID0gU1RBVEVfQ1VSTFlfT1BFTjsKKyAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgfQorCisgICAgICAgICAgICAgICAgY2FzZSBTVEFURV9DVVJMWV9PUEVOOgorICAgICAgICAgICAgICAgICAgICBzY2FubmVyLmVhdChjdXJseU9wZW5QYXR0ZXJuLCAieyIpOworICAgICAgICAgICAgICAgICAgICBzdGF0ZSA9IFNUQVRFX1BBUkFNRVRFUlM7CisgICAgICAgICAgICAgICAgICAgIGJyZWFrOworCisgICAgICAgICAgICAgICAgY2FzZSBTVEFURV9QQVJBTUVURVJTOiB7CisgICAgICAgICAgICAgICAgICAgIEtleVZhbHVlTWFwIHBhcmFtcyA9IHJlYWRLZXlWYWx1ZUFzc2lnbm1lbnRzKHNjYW5uZXIsIGN1cmx5Q2xvc2VQYXR0ZXJuKTsKKyAgICAgICAgICAgICAgICAgICAgbUNvbW1hbmRzLmFkZChuZXcgSW5pdEZpbHRlckNvbW1hbmQocGFyYW1zKSk7CisgICAgICAgICAgICAgICAgICAgIHN0YXRlID0gU1RBVEVfQ1VSTFlfQ0xPU0U7CisgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgIH0KKworICAgICAgICAgICAgICAgIGNhc2UgU1RBVEVfQ1VSTFlfQ0xPU0U6CisgICAgICAgICAgICAgICAgICAgIHNjYW5uZXIuZWF0KGN1cmx5Q2xvc2VQYXR0ZXJuLCAifSIpOworICAgICAgICAgICAgICAgICAgICBzdGF0ZSA9IFNUQVRFX0NPTU1BTkQ7CisgICAgICAgICAgICAgICAgICAgIGJyZWFrOworCisgICAgICAgICAgICAgICAgY2FzZSBTVEFURV9TT1VSQ0VfRklMVEVSTkFNRToKKyAgICAgICAgICAgICAgICAgICAgY3VyU291cmNlRmlsdGVyTmFtZSA9IHNjYW5uZXIuZWF0KHdvcmRQYXR0ZXJuLCAiPHNvdXJjZS1maWx0ZXItbmFtZT4iKTsKKyAgICAgICAgICAgICAgICAgICAgc3RhdGUgPSBTVEFURV9TT1VSQ0VfUE9SVDsKKyAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisKKyAgICAgICAgICAgICAgICBjYXNlIFNUQVRFX1NPVVJDRV9QT1JUOiB7CisgICAgICAgICAgICAgICAgICAgIFN0cmluZyBwb3J0U3RyaW5nID0gc2Nhbm5lci5lYXQocG9ydFBhdHRlcm4sICJbPHNvdXJjZS1wb3J0LW5hbWU+XSIpOworICAgICAgICAgICAgICAgICAgICBjdXJTb3VyY2VQb3J0TmFtZSA9IHBvcnRTdHJpbmcuc3Vic3RyaW5nKDEsIHBvcnRTdHJpbmcubGVuZ3RoKCkgLSAxKTsKKyAgICAgICAgICAgICAgICAgICAgc3RhdGUgPSBTVEFURV9SSUdIVF9BUlJPVzsKKyAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgfQorCisgICAgICAgICAgICAgICAgY2FzZSBTVEFURV9SSUdIVF9BUlJPVzoKKyAgICAgICAgICAgICAgICAgICAgc2Nhbm5lci5lYXQocmlnaHRBcnJvd1BhdHRlcm4sICI9PiIpOworICAgICAgICAgICAgICAgICAgICBzdGF0ZSA9IFNUQVRFX1RBUkdFVF9GSUxURVJOQU1FOworICAgICAgICAgICAgICAgICAgICBicmVhazsKKworICAgICAgICAgICAgICAgIGNhc2UgU1RBVEVfVEFSR0VUX0ZJTFRFUk5BTUU6CisgICAgICAgICAgICAgICAgICAgIGN1clRhcmdldEZpbHRlck5hbWUgPSBzY2FubmVyLmVhdCh3b3JkUGF0dGVybiwgIjx0YXJnZXQtZmlsdGVyLW5hbWU+Iik7CisgICAgICAgICAgICAgICAgICAgIHN0YXRlID0gU1RBVEVfVEFSR0VUX1BPUlQ7CisgICAgICAgICAgICAgICAgICAgIGJyZWFrOworCisgICAgICAgICAgICAgICAgY2FzZSBTVEFURV9UQVJHRVRfUE9SVDogeworICAgICAgICAgICAgICAgICAgICBTdHJpbmcgcG9ydFN0cmluZyA9IHNjYW5uZXIuZWF0KHBvcnRQYXR0ZXJuLCAiWzx0YXJnZXQtcG9ydC1uYW1lPl0iKTsKKyAgICAgICAgICAgICAgICAgICAgY3VyVGFyZ2V0UG9ydE5hbWUgPSBwb3J0U3RyaW5nLnN1YnN0cmluZygxLCBwb3J0U3RyaW5nLmxlbmd0aCgpIC0gMSk7CisgICAgICAgICAgICAgICAgICAgIG1Db21tYW5kcy5hZGQobmV3IENvbm5lY3RDb21tYW5kKGN1clNvdXJjZUZpbHRlck5hbWUsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGN1clNvdXJjZVBvcnROYW1lLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjdXJUYXJnZXRGaWx0ZXJOYW1lLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjdXJUYXJnZXRQb3J0TmFtZSkpOworICAgICAgICAgICAgICAgICAgICBzdGF0ZSA9IFNUQVRFX1NFTUlDT0xPTjsKKyAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgfQorCisgICAgICAgICAgICAgICAgY2FzZSBTVEFURV9BU1NJR05NRU5UOiB7CisgICAgICAgICAgICAgICAgICAgIEtleVZhbHVlTWFwIGFzc2lnbm1lbnQgPSByZWFkS2V5VmFsdWVBc3NpZ25tZW50cyhzY2FubmVyLCBzZW1pY29sb25QYXR0ZXJuKTsKKyAgICAgICAgICAgICAgICAgICAgbUJvdW5kUmVmZXJlbmNlcy5wdXRBbGwoYXNzaWdubWVudCk7CisgICAgICAgICAgICAgICAgICAgIHN0YXRlID0gU1RBVEVfU0VNSUNPTE9OOworICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICB9CisKKyAgICAgICAgICAgICAgICBjYXNlIFNUQVRFX0VYVEVSTkFMOiB7CisgICAgICAgICAgICAgICAgICAgIFN0cmluZyBleHRlcm5hbE5hbWUgPSBzY2FubmVyLmVhdCh3b3JkUGF0dGVybiwgIjxleHRlcm5hbC1pZGVudGlmaWVyPiIpOworICAgICAgICAgICAgICAgICAgICBiaW5kRXh0ZXJuYWwoZXh0ZXJuYWxOYW1lKTsKKyAgICAgICAgICAgICAgICAgICAgc3RhdGUgPSBTVEFURV9TRU1JQ09MT047CisgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgIH0KKworICAgICAgICAgICAgICAgIGNhc2UgU1RBVEVfU0VUVElORzogeworICAgICAgICAgICAgICAgICAgICBLZXlWYWx1ZU1hcCBzZXR0aW5nID0gcmVhZEtleVZhbHVlQXNzaWdubWVudHMoc2Nhbm5lciwgc2VtaWNvbG9uUGF0dGVybik7CisgICAgICAgICAgICAgICAgICAgIG1TZXR0aW5ncy5wdXRBbGwoc2V0dGluZyk7CisgICAgICAgICAgICAgICAgICAgIHN0YXRlID0gU1RBVEVfU0VNSUNPTE9OOworICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICB9CisKKyAgICAgICAgICAgICAgICBjYXNlIFNUQVRFX1NFTUlDT0xPTjoKKyAgICAgICAgICAgICAgICAgICAgc2Nhbm5lci5lYXQoc2VtaWNvbG9uUGF0dGVybiwgIjsiKTsKKyAgICAgICAgICAgICAgICAgICAgc3RhdGUgPSBTVEFURV9DT01NQU5EOworICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorCisgICAgICAgIC8vIE1ha2Ugc3VyZSBlbmQgb2YgaW5wdXQgd2FzIGV4cGVjdGVkCisgICAgICAgIGlmIChzdGF0ZSAhPSBTVEFURV9TRU1JQ09MT04gJiYgc3RhdGUgIT0gU1RBVEVfQ09NTUFORCkgeworICAgICAgICAgICAgdGhyb3cgbmV3IEdyYXBoSU9FeGNlcHRpb24oIlVuZXhwZWN0ZWQgZW5kIG9mIGlucHV0ISIpOworICAgICAgICB9CisgICAgfQor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bnRpZmllcj4iKTsKKyAgICAgICAgICAgICAgICAgICAgc3RhdGUgPSBTVEFURV9FUVVBTFM7CisgICAgICAgICAgICAgICAgICAgIGJyZWFrOworCisgICAgICAgICAgICAgICAgY2FzZSBTVEFURV9FUVVBTFM6CisgICAgICAgICAgICAgICAgICAgIHNjYW5uZXIuZWF0KGVxdWFsc1BhdHRlcm4sICI9Iik7CisgICAgICAgICAgICAgICAgICAgIHN0YXRlID0gU1RBVEVfVkFMVUU7CisgICAgICAgICAgICAgICAgICAgIGJyZWFrOworCisgICAgICAgICAgICAgICAgY2FzZSBTVEFURV9WQUxVRToKKyAgICAgICAgICAgICAgICAgICAgaWYgKChjdXJWYWx1ZSA9IHNjYW5uZXIudHJ5RWF0KHN0cmluZ1BhdHRlcm4pKSAhPSBudWxsKSB7CisgICAgICAgICAgICAgICAgICAgICAgICBuZXdWYWxzLnB1dChjdXJLZXksIGN1clZhbHVlLnN1YnN0cmluZygxLCBjdXJWYWx1ZS5sZW5ndGgoKSAtIDEpKTsKKyAgICAgICAgICAgICAgICAgICAgfSBlbHNlIGlmICgoY3VyVmFsdWUgPSBzY2FubmVyLnRyeUVhdChyZWZlcmVuY2VQYXR0ZXJuKSkgIT0gbnVsbCkgeworICAgICAgICAgICAgICAgICAgICAgICAgU3RyaW5nIHJlZk5hbWUgPSBjdXJWYWx1ZS5zdWJzdHJpbmcoMSwgY3VyVmFsdWUubGVuZ3RoKCkpOworICAgICAgICAgICAgICAgICAgICAgICAgT2JqZWN0IHJlZmVyZW5jZWRPYmplY3QgPSBtQm91bmRSZWZlcmVuY2VzICE9IG51bGwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICA/IG1Cb3VuZFJlZmVyZW5jZXMuZ2V0KHJlZk5hbWUpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgOiBudWxsOworICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHJlZmVyZW5jZWRPYmplY3QgPT0gbnVsbCkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRocm93IG5ldyBHcmFwaElPRXhjZXB0aW9uKAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAiVW5rbm93biBvYmplY3QgcmVmZXJlbmNlIHRvICciICsgcmVmTmFtZSArICInISIpOworICAgICAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAgICAgbmV3VmFscy5wdXQoY3VyS2V5LCByZWZlcmVuY2VkT2JqZWN0KTsKKyAgICAgICAgICAgICAgICAgICAgfSBlbHNlIGlmICgoY3VyVmFsdWUgPSBzY2FubmVyLnRyeUVhdChib29sZWFuUGF0dGVybikpICE9IG51bGwpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIG5ld1ZhbHMucHV0KGN1cktleSwgQm9vbGVhbi5wYXJzZUJvb2xlYW4oY3VyVmFsdWUpKTsKKyAgICAgICAgICAgICAgICAgICAgfSBlbHNlIGlmICgoY3VyVmFsdWUgPSBzY2FubmVyLnRyeUVhdChmbG9hdFBhdHRlcm4pKSAhPSBudWxsKSB7CisgICAgICAgICAgICAgICAgICAgICAgICBuZXdWYWxzLnB1dChjdXJLZXksIEZsb2F0LnBhcnNlRmxvYXQoY3VyVmFsdWUpKTsKKyAgICAgICAgICAgICAgICAgICAgfSBlbHNlIGlmICgoY3VyVmFsdWUgPSBzY2FubmVyLnRyeUVhdChpbnRQYXR0ZXJuKSkgIT0gbnVsbCkgeworICAgICAgICAgICAgICAgICAgICAgICAgbmV3VmFscy5wdXQoY3VyS2V5LCBJbnRlZ2VyLnBhcnNlSW50KGN1clZhbHVlKSk7CisgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICAgICAgICAgICAgICB0aHJvdyBuZXcgR3JhcGhJT0V4Y2VwdGlvbihzY2FubmVyLnVuZXhwZWN0ZWRUb2tlbk1lc3NhZ2UoIjx2YWx1ZT4iKSk7CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgc3RhdGUgPSBTVEFURV9QT1NUX1ZBTFVFOworICAgICAgICAgICAgICAgICAgICBicmVhazsKKworICAgICAgICAgICAgICAgIGNhc2UgU1RBVEVfUE9TVF9WQUxVRToKKyAgICAgICAgICAgICAgICAgICAgc2Nhbm5lci5lYXQoc2VtaWNvbG9uUGF0dGVybiwgIjsiKTsKKyAgICAgICAgICAgICAgICAgICAgc3RhdGUgPSBTVEFURV9JREVOVElGSUVSOworICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorCisgICAgICAgIC8vIE1ha2Ugc3VyZSBlbmQgaXMgZXhwZWN0ZWQKKyAgICAgICAgaWYgKHN0YXRlICE9IFNUQVRFX0lERU5USUZJRVIgJiYgc3RhdGUgIT0gU1RBVEVfUE9TVF9WQUxVRSkgeworICAgICAgICAgICAgdGhyb3cgbmV3IEdyYXBoSU9FeGNlcHRpb24oCisgICAgICAgICAgICAgICAgIlVuZXhwZWN0ZWQgZW5kIG9mIGFzc2lnbm1lbnRzIG9uIGxpbmUgIiArIHNjYW5uZXIubGluZU5vKCkgKyAiISIpOworICAgICAgICB9CisKKyAgICAgICAgcmV0dXJuIG5ld1ZhbHM7CisgICAgfQorCisgICAgcHJpdmF0ZSB2b2lkIGJpbmRFeHRlcm5hbChTdHJpbmcgbmFtZSkgdGhyb3dzIEdyYXBoSU9FeGNlcHRpb24geworICAgICAgICBpZiAobVJlZmVyZW5jZXMuY29udGFpbnNLZXkobmFtZSkpIHsKKyAgICAgICAgICAgIE9iamVjdCB2YWx1ZSA9IG1SZWZlcmVuY2VzLmdldChuYW1lKTsKKyAgICAgICAgICAgIG1Cb3VuZFJlZmVyZW5jZXMucHV0KG5hbWUsIHZhbHVlKTsKKyAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgIHRocm93IG5ldyBHcmFwaElPRXhjZXB0aW9uKCJVbmtub3duIGV4dGVybmFsIHZhcmlhYmxlICciICsgbmFtZSArICInISAiCisgICAgICAgICAgICAgICAgKyA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hJT0V4Y2VwdGlvbiB7CisgICAgICAgIGZvciAoU3RyaW5nIHNldHRpbmcgOiBtU2V0dGluZ3Mua2V5U2V0KCkpIHsKKyAgICAgICAgICAgIE9iamVjdCB2YWx1ZSA9IG1TZXR0aW5ncy5nZXQoc2V0dGluZyk7CisgICAgICAgICAgICBpZiAoc2V0dGluZy5lcXVhbHMoImF1dG9CcmFuY2giKSkgeworICAgICAgICAgICAgICAgIGV4cGVjdFNldHRpbmdDbGFzcyhzZXR0aW5nLCB2YWx1ZSwgU3RyaW5nLmNsYXNzKTsKKyAgICAgICAgICAgICAgICBpZiAodmFsdWUuZXF1YWxzKCJzeW5jZWQiKSkgeworICAgICAgICAgICAgICAgICAgICBtQ3VycmVudEdyYXBoLnNldEF1dG9CcmFuY2hNb2RlKEZpbHRlckdyYXBoLkFVVE9CUkFOQ0hfU1lOQ0VEKTsKKyAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKHZhbHVlLmVxdWFscygidW5zeW5jZWQiKSkgeworICAgICAgICAgICAgICAgICAgICBtQ3VycmVudEdyYXBoLnNldEF1dG9CcmFuY2hNb2RlKEZpbHRlckdyYXBoLkFVVE9CUkFOQ0hfVU5TWU5DRUQpOworICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAodmFsdWUuZXF1YWxzKCJvZmYiKSkgeworICAgICAgICAgICAgICAgICAgICBtQ3VycmVudEdyYXBoLnNldEF1dG9CcmFuY2hNb2RlKEZpbHRlckdyYXBoLkFVVE9CUkFOQ0hfT0ZGKTsKKyAgICAgICAgICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgICAgICAgICB0aHJvdyBuZXcgR3JhcGhJT0V4Y2VwdGlvbigiVW5rbm93biBhdXRvYnJhbmNoIHNldHRpbmc6ICIgKyB2YWx1ZSArICIhIik7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfSBlbHNlIGlmIChzZXR0aW5nLmVxdWFscygiZGlzY2FyZFVuY29ubmVjdGVkT3V0cHV0cyIpKSB7CisgICAgICAgICAgICAgICAgZXhwZWN0U2V0dGluZ0NsYXNzKHNldHRpbmcsIHZhbHVlLCBCb29sZWFuLmNsYXNzKTsKKyAgICAgICAgICAgICAgICBtQ3VycmVudEdyYXBoLnNldERpc2NhcmRVbmNvbm5lY3RlZE91dHB1dHMoKEJvb2xlYW4pdmFsdWUpOworICAgICAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgICAgICB0aHJvdyBuZXcgR3JhcGhJT0V4Y2VwdGlvbigiVW5rbm93biBAc2V0dGluZyAnIiArIHNldHRpbmcgKyAiJyEiKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgIH0KKworICAgIHByaXZhdGUgdm9pZCBleHBlY3RTZXR0aW5nQ2xhc3MoU3RyaW5nIHNldHRpbmcsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBPYmplY3QgdmFsdWUsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBDbGFzcyBleHBlY3RlZENsYXNzKSB0aHJvd3MgR3JhcGhJT0V4Y2VwdGlvbiB7CisgICAgICAgIGlmICh2YWx1ZS5nZXRDbGFzcygpICE9IGV4cGVjdGVkQ2xhc3MpIHsKKyAgICAgICAgICAgIHRocm93IG5ldyBHcmFwaElPRXhjZXB0aW9uKCJTZXR0aW5nICciICsgc2V0dGluZyArICInIG11c3QgaGF2ZSBhIHZhbHVlIG9mIHR5cGUgIgorICAgICAgICAgICAgICAgICsgZXhwZWN0ZWRDbGFzcy5nZXRTaW1wbGVOYW1lKCkgKyAiLCBidXQgZm91bmQgYSB2YWx1ZSBvZiB0eXBlICIKKyAgICAgICAgICAgICAgICArIHZhbHVlLmdldENsYXNzKCkuZ2V0U2ltcGxlTmFtZSgpICsgIiEiKTsKKyAgICAgICAgfQorICAgIH0KKworICAgIHByaXZhdGUgdm9pZCBleGVjdXRlQ29tbWFuZHMoKSB0aHJvd3MgR3JhcGhJT0V4Y2VwdGlvbiB7CisgICAgICAgI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V0dXJuIHdpbmRvd187CisgICAgfQorCisgICAgdmlydHVhbCB2b2lkKiBJbnRlcm5hbEhhbmRsZSgpIHsKKyAgICAgIHJldHVybiB3aW5kb3dfOworICAgIH0KKworICBwcml2YXRlOgorICAgIEFOYXRpdmVXaW5kb3cqIHdpbmRvd187Cit9OworCitqYm9vbGVhbiBKYXZhX2FuZHJvaWRfZmlsdGVyZndfY29yZV9HTEVudmlyb25tZW50X25hdGl2ZUFsbG9jYXRlKEpOSUVudiogZW52LCBqb2JqZWN0IHRoaXopIHsKKyAgcmV0dXJuIFRvSkJvb2woV3JhcE9iamVjdEluSmF2YShuZXcgR0xFbnYoKSwgZW52LCB0aGl6LCB0cnVlKSk7Cit9CisKK2pib29sZWFuIEphdmFfYW5kcm9pZF9maWx0ZXJmd19jb3JlX0dMRW52aXJvbm1lbnRfbmF0aXZlRGVhbGxvY2F0ZShKTklFbnYqIGVudiwgam9iamVjdCB0aGl6KSB7CisgIHJldHVybiBUb0pCb29sKERlbGV0ZU5hdGl2ZU9iamVjdDxHTEVudj4oZW52LCB0aGl6KSk7Cit9CisKK2pib29sZWFuIEphdmFfYW5kcm9pZF9maWx0ZXJmd19jb3JlX0dMRW52aXJvbm1lbnRfbmF0aXZlSW5pdFdpdGhOZXdDb250ZXh0KEpOSUVudiogZW52LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgam9iamVjdCB0aGl6KSB7CisgIEdMRW52KiBnbF9lbnYgPSBDb252ZXJ0RnJvbUphdmE8R0xFbnY+KGVudiwgdGhpeik7CisgIHJldHVybiBnbF9lbnYgPyBUb0pCb29sKGdsX2Vudi0+SW5pdFdpdGhOZXdDb250ZXh0KCkpIDogSk5JX0ZBTFNFOworfQorCitqYm9vbGVhbiBKYXZhX2FuZHJvaWRfZmlsdGVyZndfY29yZV9HTEVudmlyb25tZW50X25hdGl2ZUluaXRXaXRoQ3VycmVudENvbnRleHQoSk5JRW52KiBlbnYsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgam9iamVjdCB0aGl6KSB7CisgIEdMRW52KiBnbF9lbnYgPSBDb252ZXJ0RnJvbUphdmE8R0xFbnY+KGVudiwgdGhpeik7CisgIHJldHVybiBnbF9lbnYgPyBUb0pCb29sKGdsX2Vudi0+SW5pdFdpdGhDdXJyZW50Q29udGV4dCgpKSA6IEpOSV9GQUxTRTsKK30KKworamJvb2xlYW4gSmF2YV9hbmRyb2lkX2ZpbHRlcmZ3X2NvcmVfR0xFbnZpcm9ubWVudF9uYXRpdmVJc0FjdGl2ZShKTklFbnYqIGVudiwgam9iamVjdCB0aGl6KSB7CisgIEdMRW52KiBnbF9lbnYgPSBDb252ZXJ0RnJvbUphdmE8R0xFbnY+KGVudiwgdGhpeik7CisgIHJldHVybiBnbF9lbnYgPyBUb0pCb29sKGdsX2Vudi0+SXNBY3RpdmUoKSkgOiBKTklfRkFMU0U7Cit9CisKK2pib29sZWFuIEphdmFfYW5kcm9pZF9maWx0ZXJmd19jb3JlX0dMRW52aXJvbm1lbnRfbmF0aXZlSXNDb250ZXh0QWN0aXZlKEpOSUVudiogZW52LCBqb2JqZWN0IHRoaXopIHsKKyAgR0xFbnYqIGdsX2VudiA9IENvbnZlcnRGcm9tSmF2YTxHTEVudj4oZW52LCB0aGl6KTsKKyAgcmV0dXJuIGdsX2VudiA/IFRvSkJvb2woZ2xfZW52LT5Jc0NvbnRleHRBY3RpdmUoKSkgOiBKTklfRkFMU0U7Cit9CisKK2pib29sZWFuIEphdmFfYW5kcm9pZF9maWx0ZXJmd19jb3JlX0dMRW52aXJvbm1lbnRfbmF0aXZlSXNBbnlDb250ZXh0QWN0aXZlKEpOSUVudiogZW52LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgamN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52KiBlbnYsIGpvYmplY3Qgam1lZGlhcmVjb3JkZXIpIHsKKyAgICBqY2xhc3MgY2xhenogPSBlbnYtPkZpbmRDbGFzcygiYW5kcm9pZC9tZWRpYS9NZWRpYVJlY29yZGVyIik7CisgICAgaWYgKGNsYXp6ID09IE5VTEwpIHsKKyAgICAgICAgcmV0dXJuIE5VTEw7CisgICAgfQorCisgICAgamZpZWxkSUQgY29udGV4dCA9IGVudi0+R2V0RmllbGRJRChjbGF6eiwgIm1OYXRpdmVDb250ZXh0IiwgIkkiKTsKKyAgICBpZiAoY29udGV4dCA9PSBOVUxMKSB7CisgICAgICAgIHJldHVybiBOVUxMOworICAgIH0KKworICAgIE1lZGlhUmVjb3JkZXIqIGNvbnN0IHAgPSAoTWVkaWFSZWNvcmRlciopZW52LT5HZXRJbnRGaWVsZChqbWVkaWFyZWNvcmRlciwgY29udGV4dCk7CisgICAgZW52LT5EZWxldGVMb2NhbFJlZihjbGF6eik7CisgICAgcmV0dXJuIHNwPE1lZGlhUmVjb3JkZXI+KHApOworfQorCisKK2ppbnQgSmF2YV9hbmRyb2lkX2ZpbHRlcmZ3X2NvcmVfR0xFbnZpcm9ubWVudF9uYXRpdmVBZGRTdXJmYWNlKEpOSUVudiogZW52LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgam9iamVjdCB0aGl6LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgam9iamVjdCBzdXJmYWNlKSB7CisgIEdMRW52KiBnbF9lbnYgPSBDb252ZXJ0RnJvbUphdmE8R0xFbnY+KGVudiwgdGhpeik7CisgIGlmICghc3VyZmFjZSkgeworICAgIEFMT0dFKCJHTEVudmlyb25tZW50OiBOdWxsIFN1cmZhY2UgcGFzc2VkISIpOworICAgIHJldHVybiAtMTsKKyAgfSBlbHNlIGlmIChnbF9lbnYpIHsKKyAgICAvLyBHZXQgdGhlIEFOYXRpdmVXaW5kb3cKKyAgICBBTmF0aXZlV2luZG93KiB3aW5kb3cgPSBBTmF0aXZlV2luZG93X2Zyb21TdXJmYWNlKGVudiwgc3VyZmFjZSk7CisgICAgaWYgKCF3aW5kb3cpIHsKKyAgICAgIEFMT0dFKCJHTEVudmlyb25tZW50OiBFcnJvciBjcmVhdGluZyB3aW5kb3chIik7CisgICAgICByZXR1cm4gLTE7CisgICAgfQorCisgICAgTmF0aXZlV2luZG93SGFuZGxlKiB3aW5IYW5kbGUgPSBuZXcgTmF0aXZlV2luZG93SGFuZGxlKHdpbmRvdyk7CisgICAgaW50IHJlc3VsdCA9IGdsX2Vudi0+RmluZFN1cmZhY2VJZEZvcldpbmRvdyh3aW5IYW5kbGUpOworICAgIGlmIChyZXN1bHQgPT0gLTEpIHsKKyAgICAgIC8vIENvbmZpZ3VyZSBzdXJmYWNlCisgICAgICBFR0xDb25maWcgY29uZmlnOworICAgICAgRUdMaW50IG51bUNvbmZpZ3MgPSAtMTsKKyAgICAgIEVHTGludCBjb25maWdBdHRyaWJzW10gPSB7CisgICAgICAgIEVHTF9TVVJGQUNFX1RZUEUsIEVHTF9XSU5ET1dfQklULAorICAgICAgICBFR0xfUkVOREVSQUJMRV9UWVBFLCBFR0xfT1BFTkdMX0VTMl9CSVQsCisgICAgICAgIEVHTF9SRURfU0laRSwgOCwKKyAgICAgICAgRUdMX0dSRUVOX1NJWkUsIDgsCisgICAgICAgIEVHTF9CTFVFX1NJWkUsIDgsCisgICAgICAgIEVHTF9SRUNPUkRBQkxFX0FORFJPSUQsIEVHTF9UUlVFLAorICAgICAgICBFR0xfTk9ORQorICAgICAgfTsKKworCisKKyAgICAgIGVnbENob29zZUNvbmZpZyhnbF9lbnYtPmRpc3BsYXkoKSwgY29uZmlnQXR0cmlicywgJmNvbmZpZywgMSwgJm51bUNvbmZpZ3MpOworICAgICAgaWYgKG51bUNvbmZpZ3MgPCAxKSB7CisgICAgICAgIEFMT0dFKCJHTEVudmlyb25tZW50OiBObyBzdWl0YWJsZSBFR0wgY29uZmlndXJhdGlvbiBmb3VuZCBmb3Igc3VyZmFjZSEiKTsKKyAgICAgICAgcmV0dXJuIC0xOworICAgICAgfQorCisgICAgICAvLyBDcmVhdGUgdGhlIEVHTCBzdXJmYWNlCisgICAgICBFR0xTdXJmYWNlIGVnbF9zdXJmYWNlID0gZWdsQ3JlYXRlV2luZG93U3VyZmFjZShnbF9lbnYtPmRpc3BsYXkoKSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbmZpZywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHdpbmRvdywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIE5VTEwpOworCisgICAgICBpZiAoR0xFbnY6OkNoZWNrRUdMRXJyb3IoImVnbENyZWF0ZVdpbmRvd1N1cmZhY2UiKSkgeworICAgICAgICBBTE9HRSgiR0xFbnZpcm9ubWVudDogRXJyb3IgY3JlYXRpbmcgd2luZG93IHN1cmZhY2UhIik7CisgICAgICAgIHJldHVybiAtMTsKKyAgICAgIH0KKworICAgICAgLy8gQWRkIGl0IHRvIEdMIEVudiBhbmQgYXNzaWduIElECisgICAgICByZXN1bHQgPSBnbF9lbnYtPkFkZFdpbmRvd1N1cmZhY2UoZWdsX3N1cmZhY2UsIHdpbkhhbmRsZSk7CisgICAgfSBlbHNlIHsKKyAgICAgIGRlbGV0ZSB3aW5IYW5kbGU7CisgICAgfQorICAgIHJldHVybiByZXN1bHQ7CisgIH0KKyAgcmV0dXJuIC0xOworfQorCitqaW50IEphdmFfYW5kcm9pZF9maWx0ZXJmd19jb3JlX0dMRW52aXJvbm1lbnRfbmF0aXZlQWRkU3VyZmFjZVdpZHRoSGVpZ2h0KEpOSUVudiogZW52LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGpvYmplY3QgdGhpeiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBqb2JqZWN0IHN1cmZhY2UsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgamludCB3aWR0aCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBqaW50IGhlaWdodCkgeworICBHTEVudiogZ2xfZW52ID0gQ29udmVydEZyb21KYXZhPEdMRW52PihlbnYsIHRoaXopOworICBpZiAoIXN1cmZhY2UpIHsKKyAgICBBTE9HRSgiR0xFbnZpcm9ubWVudDogTnVsbCBTdXJmYWNlVGV4dHVyZSBwYXNzZWQhIik7CisgICAgcmV0dXJuIC0xOworICB9IGVsc2UgaWYgKGdsX2VudikgeworICAgIC8vIEdldCB0aGUgQU5hdGl2ZVdpbmRvdworICAgIEFOYXRpdmVXaW5kb3cqIHdpbmRvdyA9IEFOYXRpdmVXaW5kb3dfZnJvbVN1cmZhY2UoZW52LCBzdXJmYWNlKTsKKyAgICBpZiAoIXdpbmRvdykgeworICAgICAgQUxPR0UoIkdMRW52aXJvbm1lbnQ6IEVycm9yIGNyZWF0aW5nIHdpbmRvdyEiKTsKKyAgICAgIHJldHVybiAtMTsKKyAgICB9CisKKyAgICAvLyBEb24ndCBjYXJlIGFib3V0IGZvcm1hdCAod2lsbCBnZXQgb3ZlcnJpZGRlbiBieSBTdXJmYWNlVGV4dHVyZQorICAgIC8vIGFueXdheSksIGJ1dCBkbyBjYXJlIGFib3V0IHdpZHRoIGFuZCBoZWlnaHQKKyAgICAvLyBUT0RPOiBQcm9iYWJseSwgdGhpcyBzaG91bGQgYmUganVzdCBiZQorICAgIC8vIEFOYXRpdmVXaW5kb3dfc2V0QnVmZmVyc0RpbW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Zm9yIHN1cmZhY2UgdGV4dHVyZSEiKTsKKyAgICAgICAgcmV0dXJuIC0xOworICAgICAgfQorCisgICAgICAvLyBDcmVhdGUgdGhlIEVHTCBzdXJmYWNlCisgICAgICBFR0xTdXJmYWNlIGVnbF9zdXJmYWNlID0gZWdsQ3JlYXRlV2luZG93U3VyZmFjZShnbF9lbnYtPmRpc3BsYXkoKSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbmZpZywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHdpbmRvdywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIE5VTEwpOworCisgICAgICBpZiAoR0xFbnY6OkNoZWNrRUdMRXJyb3IoImVnbENyZWF0ZVdpbmRvd1N1cmZhY2UiKSkgeworICAgICAgICBBTE9HRSgiR0xFbnZpcm9ubWVudDogRXJyb3IgY3JlYXRpbmcgd2luZG93IHN1cmZhY2UhIik7CisgICAgICAgIHJldHVybiAtMTsKKyAgICAgIH0KKworICAgICAgLy8gQWRkIGl0IHRvIEdMIEVudiBhbmQgYXNzaWduIElECisgICAgICByZXN1bHQgPSBnbF9lbnYtPkFkZFdpbmRvd1N1cmZhY2UoZWdsX3N1cmZhY2UsIHdpbkhhbmRsZSk7CisgICAgfSBlbHNlIHsKKyAgICAgIGRlbGV0ZSB3aW5IYW5kbGU7CisgICAgfQorICAgIHJldHVybiByZXN1bHQ7CisgIH0KKyAgcmV0dXJuIC0xOworfQorCisvLyBuYXRpdmVBZGRTdXJmYWNlRnJvbU1lZGlhUmVjb3JkZXIgZ2V0cyBhbiBFR0xTdXJmYWNlCisvLyB1c2luZyBhIE1lZGlhUmVjb3JkZXIgb2JqZWN0LgorLy8gV2hlbiBNZWRpYXJlY29yZGVyIGlzIHVzZWQgZm9yIHJlY29yZGluZyBHTCBGcmFtZXMsIGl0CisvLyB3aWxsIGhhdmUgYSByZWZlcmVuY2UgdG8gYSBOYXRpdmUgSGFuZGxlIChhIFN1cmZhY2VUZXh1cmVDbGllbnQpCisvLyB3aGljaCB0YWxrcyB0byB0aGUgU3RhZ2VGcmlnaHRSZWNvcmRlciBpbiBtZWRpYXNlcnZlciB2aWEKKy8vIGEgYmluZGVyIGludGVyZmFjZS4KK2ppbnQgSmF2YV9hbmRyb2lkX2ZpbHRlcmZ3X2NvcmVfR0xFbnZpcm9ubWVudF9uYXRpdmVBZGRTdXJmYWNlRnJvbU1lZGlhUmVjb3JkZXIoCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBKTklFbnYqIGVudiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGpvYmplY3QgdGhpeiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGpvYmplY3Qgam1lZGlhcmVjb3JkZXIpIHsKKyAgICBBTE9HVigiR0xFbnYgSm5pOiBuYXRpdmVBZGRTdXJmYWNlRnJvbU1lZGlhUmVjb3JkZXIiKTsKKyAgICBHTEVudiogZ2xfZW52ID0gQ29udmVydEZyb21KYXZhPEdMRW52PihlbnYsIHRoaXopOworICAgIGlmICghZ2xfZW52KSB7CisgICAgICAgIHJldHVybiAtMTsKKyAgICB9CisgICAgLy8gZ2V0IGEgbmF0aXZlIG1lZGlhcmVjb3JkZXIgb2JqZWN0IGZyb20gdGhlIGphdmEgb2JqZWN0CisgICAgc3A8TWVkaWFSZWNvcmRlcj4gbXIgPSBnZXRNZWRpYVJlY29yZGVyKGVudiwgam1lZGlhcmVjb3JkZXIpOworICAgIGlmIChtciA9PSBOVUxMKSB7CisgICAgICAgIEFMT0dFKCJHTEVudmlyb25tZW50OiBFcnJvci0gTWVkaWFSZWNvcmRlciBjb3VsZCBub3QgYmUgaW5pdGlhbGl6ZWQhIik7CisgIC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FRF9TSVpFLCA4LAorICAgICAgICAgIEVHTF9HUkVFTl9TSVpFLCA4LAorICAgICAgICAgIEVHTF9CTFVFX1NJWkUsIDgsCisgICAgICAgICAgRUdMX1JFQ09SREFCTEVfQU5EUk9JRCwgRUdMX1RSVUUsCisgICAgICAgICAgRUdMX05PTkUKKyAgICB9OworCisKKyAgICBlZ2xDaG9vc2VDb25maWcoZ2xfZW52LT5kaXNwbGF5KCksIGNvbmZpZ0F0dHJpYnMsICZjb25maWcsIDEsICZudW1Db25maWdzKTsKKyAgICBpZiAobnVtQ29uZmlncyA8IDEpIHsKKyAgICAgIEFMT0dFKCJHTEVudmlyb25tZW50OiBObyBzdWl0YWJsZSBFR0wgY29uZmlndXJhdGlvbiBmb3VuZCBmb3Igc3VyZmFjZSB0ZXh0dXJlISIpOworICAgICAgZGVsZXRlIHdpbkhhbmRsZTsKKyAgICAgIHJldHVybiAtMTsKKyAgICB9CisKKyAgICAvLyBDcmVhdGUgdGhlIEVHTCBzdXJmYWNlCisgICAgRUdMU3VyZmFjZSBlZ2xfc3VyZmFjZSA9IGVnbENyZWF0ZVdpbmRvd1N1cmZhY2UoZ2xfZW52LT5kaXNwbGF5KCksCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY29uZmlnLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHdpbmRvdy5nZXQoKSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBOVUxMKTsKKworICAgIGlmIChHTEVudjo6Q2hlY2tFR0xFcnJvcigiZWdsQ3JlYXRlV2luZG93U3VyZmFjZSIpKSB7CisgICAgICBBTE9HRSgiR0xFbnZpcm9ubWVudDogRXJyb3IgY3JlYXRpbmcgd2luZG93IHN1cmZhY2UhIik7CisgICAgICBkZWxldGUgd2luSGFuZGxlOworICAgICAgcmV0dXJuIC0xOworICAgIH0KKworICAgIC8vIEFkZCBpdCB0byBHTCBFbnYgYW5kIGFzc2lnbiBJRAorICAgIHJlc3VsdCA9IGdsX2Vudi0+QWRkV2luZG93U3VyZmFjZShlZ2xfc3VyZmFjZSwgd2luSGFuZGxlKTsKKyAgICByZXR1cm4gcmVzdWx0OworfQorCitqYm9vbGVhbiBKYXZhX2FuZHJvaWRfZmlsdGVyZndfY29yZV9HTEVudmlyb25tZW50X25hdGl2ZUFjdGl2YXRlU3VyZmFjZUlkKEpOSUVudiogZW52LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBqb2JqZWN0IHRoaXosCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGppbnQgc3VyZmFjZUlkKSB7CisgIEdMRW52KiBnbF9lbnYgPSBDb252ZXJ0RnJvbUphdmE8R0xFbnY+KGVudiwgdGhpeik7CisgIHJldHVybiBnbF9lbnYgPyBUb0pCb29sKGdsX2Vudi0+U3dpdGNoVG9TdXJmYWNlSWQoc3VyZmFjZUlkKSAmJiBnbF9lbnYtPkFjdGl2YXRlKCkpIDogSk5JX0ZBTFNFOworfQorCitqYm9vbGVhbiBKYXZhX2FuZHJvaWRfZmlsdGVyZndfY29yZV9HTEVudmlyb25tZW50X25hdGl2ZVJlbW92ZVN1cmZhY2VJZChKTklFbnYqIGVudiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGpvYmplY3QgdGhpeiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGppbnQgc3VyZmFjZUlkKSB7CisgIEdMRW52KiBnbF9lbnYgPSBDb252ZXJ0RnJvbUphdmE8R0xFbnY+KGVudiwgdGhpeik7CisgIHJldHVybiBnb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EVudmlyb25tZW50X25hdGl2ZUFjdGl2YXRlKEpOSUVudiogZW52LCBqb2JqZWN0IHRoaXopOworCitKTklFWFBPUlQgamJvb2xlYW4gSk5JQ0FMTAorSmF2YV9hbmRyb2lkX2ZpbHRlcmZ3X2NvcmVfR0xFbnZpcm9ubWVudF9uYXRpdmVEZWFjdGl2YXRlKEpOSUVudiogZW52LCBqb2JqZWN0IHRoaXopOworCitKTklFWFBPUlQgamJvb2xlYW4gSk5JQ0FMTAorSmF2YV9hbmRyb2lkX2ZpbHRlcmZ3X2NvcmVfR0xFbnZpcm9ubWVudF9uYXRpdmVTd2FwQnVmZmVycyhKTklFbnYqIGVudiwgam9iamVjdCB0aGl6KTsKKworSk5JRVhQT1JUIGppbnQgSk5JQ0FMTAorSmF2YV9hbmRyb2lkX2ZpbHRlcmZ3X2NvcmVfR0xFbnZpcm9ubWVudF9uYXRpdmVBZGRTdXJmYWNlKEpOSUVudiogZW52LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGpvYmplY3QgdGhpeiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBqb2JqZWN0IHN1cmZhY2UpOworCitKTklFWFBPUlQgamludCBKTklDQUxMCitKYXZhX2FuZHJvaWRfZmlsdGVyZndfY29yZV9HTEVudmlyb25tZW50X25hdGl2ZUFkZFN1cmZhY2VXaWR0aEhlaWdodChKTklFbnYqIGVudiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgam9iamVjdCB0aGl6LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBqb2JqZWN0IHN1cmZhY2UsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGppbnQgd2lkdGgsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGppbnQgaGVpZ2h0KTsKKworLy8gVGhlIGNhbGwgdG8gaG9vayB1cCB0aGUgU3VyZmFjZU1lZGlhU291cmNlIChpbiBNZWRpYVNlcnZlcikgIHRvIHRoZSBHTC4KKy8vIFdlIGdldCBhIHNwPElTdXJmYWNlVGV4dXJlPiBmcm9tIHRoZSBNZWRpYVNlcnZlciBhbmQgdGFsa3MgdG8gTWVkaWFTZXJ2ZXIKKy8vIG92ZXIgYSBiaW5kZXIgaW50ZXJmYWNlLiBHTCBob29rZWQgdXAgdG8gdGhlIE1lZGlhU2VydmVyIGJ5IHVzaW5nIHRoZSBuYXRpdmUKKy8vIHdpbmRvdyBjcmVhdGVkIHVzaW5nIHRoZSA8SVN1cmZhY2VUZXh0dXJlPiBoYW5kbGUKK0pOSUVYUE9SVCBqaW50IEpOSUNBTEwKK0phdmFfYW5kcm9pZF9maWx0ZXJmd19jb3JlX0dMRW52aXJvbm1lbnRfbmF0aXZlQWRkU3VyZmFjZUZyb21NZWRpYVJlY29yZGVyKAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgSk5JRW52KiBlbnYsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBqb2JqZWN0IHRoaXosCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBqb2JqZWN0IG1lZGlhcmVjb3JkZXIpOworCitKTklFWFBPUlQgamJvb2xlYW4gSk5JQ0FMTAorSmF2YV9hbmRyb2lkX2ZpbHRlcmZ3X2NvcmVfR0xFbnZpcm9ubWVudF9uYXRpdmVBY3RpdmF0ZVN1cmZhY2VJZChKTklFbnYqIGVudiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgam9iamVjdCB0aGl6LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBqaW50IHN1cmZhY2VJZCk7CisKK0pOSUVYUE9SVCBqYm9vbGVhbiBKTklDQUxMCitKYXZhX2FuZHJvaWRfZmlsdGVyZndfY29yZV9HTEVudmlyb25tZW50X25hdGl2ZVJlbW92ZVN1cmZhY2VJZChKTklFbnYqIGVudiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGpvYmplY3QgdGhpeiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGppbnQgc3VyZmFjZUlkKTsKKworSk5JRVhQT1JUIGpib29sZWFuIEpOSUNBTEwKK0phdmFfYW5kcm9pZF9maWx0ZXJmd19jb3JlX0dMRW52aXJvbm1lbnRfbmF0aXZlU2V0U3VyZmFjZVRpbWVzdGFtcChKTklFbnYqIGVudiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBqb2JqZWN0IHRoaXosCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgamxvbmcgdGltZXN0YW1wKTsKKworI2lmZGVmIF9fY3BsdXNwbHVzCit9CisjZW5kaWYKKworI2VuZGlmIC8vIEFORFJPSURfRklMVEVSRldfSk5JX0dMX0VOVklST05NRU5UX0gKZGlmZiAtLWdpdCBhL21lZGlhL21jYS9maWx0ZXJmdy9qbmkvam5pX2dsX2ZyYW1lLmNwcCBiL21lZGlhL21jYS9maWx0ZXJmdy9qbmkvam5pX2dsX2ZyYW1lLmNwcApuZXcgZmlsZSBtb2RlIDEwMDY0NAppbmRleCAwMDAwMDAwLi42MTM0MGY5Ci0tLSAvZGV2L251bGwKKysrI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F0ZShKTklFbnYqIGVudiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgam9iamVjdCB0aGl6LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBqb2JqZWN0IGdsX2VudiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgamludCB3aWR0aCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgamludCBoZWlnaHQpIHsKKyAgR0xFbnYqIGdsX2Vudl9wdHIgPSBDb252ZXJ0RnJvbUphdmE8R0xFbnY+KGVudiwgZ2xfZW52KTsKKyAgaWYgKCFnbF9lbnZfcHRyKSByZXR1cm4gSk5JX0ZBTFNFOworICBHTEZyYW1lKiBmcmFtZSA9IG5ldyBHTEZyYW1lKGdsX2Vudl9wdHIpOworICBpZiAoZnJhbWUtPkluaXQod2lkdGgsIGhlaWdodCkpIHsKKyAgICByZXR1cm4gVG9KQm9vbChXcmFwT2JqZWN0SW5KYXZhKGZyYW1lLCBlbnYsIHRoaXosIHRydWUpKTsKKyAgfSBlbHNlIHsKKyAgICBkZWxldGUgZnJhbWU7CisgICAgcmV0dXJuIEpOSV9GQUxTRTsKKyAgfQorfQorCitqYm9vbGVhbiBKYXZhX2FuZHJvaWRfZmlsdGVyZndfY29yZV9HTEZyYW1lX25hdGl2ZUFsbG9jYXRlV2l0aFRleHR1cmUoSk5JRW52KiBlbnYsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgam9iamVjdCB0aGl6LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGpvYmplY3QgZ2xfZW52LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGppbnQgdGV4X2lkLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGppbnQgd2lkdGgsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgamludCBoZWlnaHQpIHsKKyAgR0xFbnYqIGdsX2Vudl9wdHIgPSBDb252ZXJ0RnJvbUphdmE8R0xFbnY+KGVudiwgZ2xfZW52KTsKKyAgaWYgKCFnbF9lbnZfcHRyKSByZXR1cm4gSk5JX0ZBTFNFOworICBHTEZyYW1lKiBmcmFtZSA9IG5ldyBHTEZyYW1lKGdsX2Vudl9wdHIpOworICBpZiAoZnJhbWUtPkluaXRXaXRoVGV4dHVyZSh0ZXhfaWQsIHdpZHRoLCBoZWlnaHQpKSB7CisgICAgcmV0dXJuIFRvSkJvb2woV3JhcE9iamVjdEluSmF2YShmcmFtZSwgZW52LCB0aGl6LCB0cnVlKSk7CisgIH0gZWxzZSB7CisgICAgZGVsZXRlIGZyYW1lOworICAgIHJldHVybiBKTklfRkFMU0U7CisgIH0KK30KKworamJvb2xlYW4gSmF2YV9hbmRyb2lkX2ZpbHRlcmZ3X2NvcmVfR0xGcmFtZV9uYXRpdmVBbGxvY2F0ZVdpdGhGYm8oSk5JRW52KiBlbnYsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBqb2JqZWN0IHRoaXosCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBqb2JqZWN0IGdsX2VudiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGppbnQgZmJvX2lkLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgamludCB3aWR0aCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGppbnQgaGVpZ2h0KSB7CisgIEdMRW52KiBnbF9lbnZfcHRyID0gQ29udmVydEZyb21KYXZhPEdMRW52PihlbnYsIGdsX2Vudik7CisgIGlmICghZ2xfZW52X3B0cikgcmV0dXJuIEpOSV9GQUxTRTsKKyAgR0xGcmFtZSogZnJhbWUgPSBuZXcgR0xGcmFtZShnbF9lbnZfcHRyKTsKKyAgaWYgKGZyYW1lLT5Jbml0V2l0aEZibyhmYm9faWQsIHdpZHRoLCBoZWlnaHQpKSB7CisgICAgcmV0dXJuIFRvSkJvb2woV3JhcE9iamVjdEluSmF2YShmcmFtZSwgZW52LCB0aGl6LCB0cnVlKSk7CisgIH0gZWxzZSB7CisgICAgZGVsZXRlIGZyYW1lOworICAgIHJldHVybiBKTklfRkFMU0U7CisgIH0KK30KKworamJvb2xlYW4gSmF2YV9hbmRyb2lkX2ZpbHRlcmZ3X2NvcmVfR0xGcmFtZV9uYXRpdmVBbGxvY2F0ZUV4dGVybmFsKEpOSUVudiogZW52LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGpvYmplY3QgdGhpeiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBqb2JqZWN0IGdsX2VudikgeworICBHTEVudiogZ2xfZW52X3B0ciA9IENvbnZlcnRGcm9tSmF2YTxHTEVudj4oZW52LCBnbF9lbnYpOworICBpZiAoIWdsX2Vudl9wdHIpIHJldHVybiBKTklfRkFMU0U7CisgIEdMRnJhbWUqIGZyYW1lID0gbmV3IEdMRnJhbWUoZ2xfZW52X3B0cik7CisgIGlmIChmcmFtZS0+SW5pdFdpdGhFeHRlcm5hbFRleHR1cmUoKSkgeworICAgIHJldHVybiBUb0pCb29sKFdyYXBPYmplY3RJbkphdmEoZnJhbWUsIGVudiwgdGhpeiwgdHJ1ZSkpOworICB9IGVsc2UgeworICAgIGRlbGV0ZSBmcmFtZTsKKyAgICByZXR1cm4gSk5JX0ZBTFNFOworICB9Cit9CisKK2pib29sZWFuIEphdmFfYW5kcm9pZF9maWx0ZXJmd19jb3JlX0dMRnJhbWVfbmF0aXZlRGVhbGxvY2F0ZShKTklFbnYqIGVudiwgam9iamVjdCB0aGl6KSB7CisgIHJldHVybiBUb0pCb29sKERlbGV0ZU5hdGl2ZU9iamVjdDxHTEZyYW1lPihlbnYsIHRoaXopKTsKK30KKworamJvb2xlYW4gSmF2YV9hbmRyb2lkX2ZpbHRlcmZ3X2NvcmVfR0xGcmFtZV9zZXROYXRpdmVEYXRhKEpOSUVudiogZW52LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGpvYmplY3QgdGhpeiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBqYnl0ZUFycmF5IGRhdGEsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgamludCBvZmZzZXQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgamludCBsZW5ndGgpIHsKKyAgR0xGcmFtZSogZnJhbWUgPSBDb252ZXJ0RnJvbUphdmE8R0xGcmFtZT4oZW52LCB0aGl6KTsKKyAgaWYgKGZyYW1lICYmIGRhdGEpIHsKKyAgICBqYnl0ZSogYnl0ZXMgPSBlbnYtPkdldEJ5dGVBcnJheUVsZW1lbnRzKGRhdGEsIE5VTEwpOworICAgIGlmIChieXRlcykgeworICAgICAgY29uc3QgYm9vbCBzdWNjZXNzID0gZnJhbWUtPldyaXRlRGF0YSh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ICAgICAgICAgICAgICAgICAgICAgICAgICBqaW50QXJyYXkgaW50cykgeworICBHTEZyYW1lKiBmcmFtZSA9IENvbnZlcnRGcm9tSmF2YTxHTEZyYW1lPihlbnYsIHRoaXopOworICBpZiAoZnJhbWUgJiYgaW50cykgeworICAgIGppbnQqIGludF9wdHIgPSBlbnYtPkdldEludEFycmF5RWxlbWVudHMoaW50cywgTlVMTCk7CisgICAgY29uc3QgaW50IGxlbmd0aCA9IGVudi0+R2V0QXJyYXlMZW5ndGgoaW50cyk7CisgICAgaWYgKGludF9wdHIpIHsKKyAgICAgIGNvbnN0IGJvb2wgc3VjY2VzcyA9IGZyYW1lLT5Xcml0ZURhdGEocmVpbnRlcnByZXRfY2FzdDxjb25zdCB1aW50OF90Kj4oaW50X3B0ciksCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxlbmd0aCAqIHNpemVvZihqaW50KSk7CisgICAgICBlbnYtPlJlbGVhc2VJbnRBcnJheUVsZW1lbnRzKGludHMsIGludF9wdHIsIEpOSV9BQk9SVCk7CisgICAgICByZXR1cm4gVG9KQm9vbChzdWNjZXNzKTsKKyAgICB9CisgIH0KKyAgcmV0dXJuIEpOSV9GQUxTRTsKK30KKworamludEFycmF5IEphdmFfYW5kcm9pZF9maWx0ZXJmd19jb3JlX0dMRnJhbWVfZ2V0TmF0aXZlSW50cyhKTklFbnYqIGVudiwgam9iamVjdCB0aGl6KSB7CisgIEdMRnJhbWUqIGZyYW1lID0gQ29udmVydEZyb21KYXZhPEdMRnJhbWU+KGVudiwgdGhpeik7CisgIGlmIChmcmFtZSAmJiBmcmFtZS0+U2l6ZSgpID4gMCAmJiAoZnJhbWUtPlNpemUoKSAlIHNpemVvZihqaW50KSA9PSAwKSkgeworICAgIGppbnRBcnJheSByZXN1bHQgPSBlbnYtPk5ld0ludEFycmF5KGZyYW1lLT5TaXplKCkgLyBzaXplb2YoamludCkpOworICAgIGppbnQqIGRhdGEgPSBlbnYtPkdldEludEFycmF5RWxlbWVudHMocmVzdWx0LCBOVUxMKTsKKyAgICBmcmFtZS0+Q29weURhdGFUbyhyZWludGVycHJldF9jYXN0PHVpbnQ4X3QqPihkYXRhKSwgZnJhbWUtPlNpemUoKSk7CisgICAgZW52LT5SZWxlYXNlSW50QXJyYXlFbGVtZW50cyhyZXN1bHQsIGRhdGEsIDApOworICAgIHJldHVybiByZXN1bHQ7CisgICB9CisgICByZXR1cm4gTlVMTDsKK30KKworamJvb2xlYW4gSmF2YV9hbmRyb2lkX2ZpbHRlcmZ3X2NvcmVfR0xGcmFtZV9zZXROYXRpdmVGbG9hdHMoSk5JRW52KiBlbnYsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBqb2JqZWN0IHRoaXosCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBqZmxvYXRBcnJheSBmbG9hdHMpIHsKKyAgR0xGcmFtZSogZnJhbWUgPSBDb252ZXJ0RnJvbUphdmE8R0xGcmFtZT4oZW52LCB0aGl6KTsKKyAgaWYgKGZyYW1lICYmIGZsb2F0cykgeworICAgIGpmbG9hdCogZmxvYXRfcHRyID0gZW52LT5HZXRGbG9hdEFycmF5RWxlbWVudHMoZmxvYXRzLCBOVUxMKTsKKyAgICBjb25zdCBpbnQgbGVuZ3RoID0gZW52LT5HZXRBcnJheUxlbmd0aChmbG9hdHMpOworICAgIGlmIChmbG9hdF9wdHIpIHsKKyAgICAgIC8vIENvbnZlcnQgZmxvYXRzIHRvIFJHQkEgYnVmZmVyCisgICAgICB1aW50OF90KiByZ2JhX2J1ZmZlciA9IG5ldyB1aW50OF90W2xlbmd0aF07CisgICAgICBDb252ZXJ0RmxvYXRzVG9SR0JBKGZsb2F0X3B0ciwgbGVuZ3RoLCByZ2JhX2J1ZmZlcik7CisgICAgICBlbnYtPlJlbGVhc2VGbG9hdEFycmF5RWxlbWVudHMoZmxvYX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KworICAgIC8vIENsZWFuLXVwCisgICAgZGVsZXRlW10gcGl4ZWxzOworICAgIGVudi0+UmVsZWFzZUZsb2F0QXJyYXlFbGVtZW50cyhyZXN1bHQsIGZsb2F0X2FycmF5LCAwKTsKKyAgICByZXR1cm4gcmVzdWx0OworICB9CisgIHJldHVybiBOVUxMOworfQorCitqYm9vbGVhbiBKYXZhX2FuZHJvaWRfZmlsdGVyZndfY29yZV9HTEZyYW1lX3NldE5hdGl2ZUJpdG1hcChKTklFbnYqIGVudiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGpvYmplY3QgdGhpeiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGpvYmplY3QgYml0bWFwLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgamludCBzaXplKSB7CisgIEdMRnJhbWUqIGZyYW1lID0gQ29udmVydEZyb21KYXZhPEdMRnJhbWU+KGVudiwgdGhpeik7CisgIGlmIChmcmFtZSAmJiBiaXRtYXApIHsKKyAgICB1aW50OF90KiBwaXhlbHM7CisgICAgY29uc3QgaW50IHJlc3VsdCA9IEFuZHJvaWRCaXRtYXBfbG9ja1BpeGVscyhlbnYsIGJpdG1hcCwgcmVpbnRlcnByZXRfY2FzdDx2b2lkKio+KCZwaXhlbHMpKTsKKyAgICBpZiAocmVzdWx0ID09IEFORFJPSURfQklUTUFQX1JFU1VUX1NVQ0NFU1MpIHsKKyAgICAgIGNvbnN0IGJvb2wgc3VjY2VzcyA9IGZyYW1lLT5Xcml0ZURhdGEocGl4ZWxzLCBzaXplKTsKKyAgICAgIHJldHVybiBUb0pCb29sKHN1Y2Nlc3MgJiYKKyAgICAgICAgICAgICAgICAgICAgIEFuZHJvaWRCaXRtYXBfdW5sb2NrUGl4ZWxzKGVudiwgYml0bWFwKSA9PSBBTkRST0lEX0JJVE1BUF9SRVNVVF9TVUNDRVNTKTsKKyAgICB9CisgIH0KKyAgcmV0dXJuIEpOSV9GQUxTRTsKK30KKworamJvb2xlYW4gSmF2YV9hbmRyb2lkX2ZpbHRlcmZ3X2NvcmVfR0xGcmFtZV9nZXROYXRpdmVCaXRtYXAoSk5JRW52KiBlbnYsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBqb2JqZWN0IHRoaXosCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBqb2JqZWN0IGJpdG1hcCkgeworICBHTEZyYW1lKiBmcmFtZSA9IENvbnZlcnRGcm9tSmF2YTxHTEZyYW1lPihlbnYsIHRoaXopOworICBpZiAoZnJhbWUgJiYgYml0bWFwKSB7CisgICAgdWludDhfdCogcGl4ZWxzOworICAgIGNvbnN0IGludCByZXN1bHQgPSBBbmRyb2lkQml0bWFwX2xvY2tQaXhlbHMoZW52LCBiaXRtYXAsIHJlaW50ZXJwcmV0X2Nhc3Q8dm9pZCoqPigmcGl4ZWxzKSk7CisgICAgaWYgKHJlc3VsdCA9PSBBTkRST0lEX0JJVE1BUF9SRVNVVF9TVUNDRVNTKSB7CisgICAgICBmcmFtZS0+Q29weURhdGFUbyhwaXhlbHMsIGZyYW1lLT5TaXplKCkpOworICAgICAgcmV0dXJuIChBbmRyb2lkQml0bWFwX3VubG9ja1BpeGVscyhlbnYsIGJpdG1hcCkgPT0gQU5EUk9JRF9CSVRNQVBfUkVTVVRfU1VDQ0VTUyk7CisgICAgfQorICB9CisgIHJldHVybiBKTklfRkFMU0U7Cit9CisKK2pib29sZWFuIEphdmFfYW5kcm9pZF9maWx0ZXJmd19jb3JlX0dMRnJhbWVfc2V0TmF0aXZlVmlld3BvcnQoSk5JRW52KiBlbnYsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGpvYmplY3QgdGhpeiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgamludCB4LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBqaW50IHksCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGppbnQgd2lkdGgsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGppbnQgaGVpZ2h0KSB7CisgIEdMRnJhbWUqIGZyYW1lID0gQ29udmVydEZyb21KYXZhPEdMRnJhbWU+KGVudiwgdGhpeik7CisgIHJldHVybiBmcmFtZSA/IFRvSkJvb2woZnJhbWUtPlNldFZpZXdwb3J0KHgsIHksIHdpZHRoLCBoZWlnaHQpKSA6IEpOSV9GQUxTRTsKK30KKworamludCBKYXZhX2FuZHJvaWRfZmlsdGVyZndfY29yZV9HTEZyYW1lX2dldE5hdGl2ZVRleHR1cmVJZChKTklFbnYqIGVudiwgam9iamVjdCB0aGl6KSB7CisgIEdMRnJhbWUqIGZyYW1lID0gQ29udmVydEZyb21KYXZhPEdMRnJhbWU+KGVudiwgdGhpeik7CisgIHJldHVybiBmcmFtZSA/IGZyYW1lLT5HZXRUZXh0dXJlSWQoKSA6IC0xOworfQorCitqaW50IEphdmFfYW5kcm9pZF9maWx0ZXJmd19jb3JlX0dMRnJhbWVfZ2V0TmF0aXZlRmJvSWQoSk5JRW52KiBlbnYsIGpvYmplY3QgdGhpeikgeworICBHTEZyYW1lKiBmcmFtZSA9IENvbnZlcnRGcm9tSmF2YTxHTEZyYW1lPihlbnYsIHRoaXopOworICByZXR1cm4gZnJhbWUgPyBmcmFtZS0+R2V0RmJvSWQoKSA6IC0xOworfQorCitqYm9vbGVhbiBKYXZhX2FuZHJvaWRfZmlsdGVyZndfY29yZV9HTEZyYW1lX2dlbmVyYXRlTmF0aXZlTWlwTWFwKEpOSUVudiogZW52LCBqb2JqZWN0IHRoaXopIHsKKyAgR0xGcmFtZSogZnJhbWUgPSBDb252ZXJ0RnJvbUphdmE8R0xGcmFtZT4oZW52LCB0aGl6KTsKKyAgcmV0dXJuIGZyYW1lID8gVG9KQm9vbChmcmFtZS0+R2VuZXJhdGVNaXBNYXAoKSkgOiBKTklfRkFMU0U7Cit9CisKK2pib29sZWFuIEphdmFfYW5kcm9pZF9maWx0ZXJmd19jb3JlX0dMRnJhbWVfc2V0TmF0aXZlVGV4dHVyZVBhcmFtKEpOSUVudiogZW52LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgam9iamVjdCB0aGl6LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgamludCBwYXJhbSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGppbnQgdmFsdWUpIHsKKyAgR0xGcmFtZSogZnJhbWUgPSBDb252ZXJ0RnJvbUphdmE8R0xGcmFtZT4oZW52LCB0aGl6KTsKKyAgcmV0dXJuIGZyYW1lID8gVG9KQm9vbChmcmFtZS0+U2V0VGV4dHVyZVBhcmFtZXRlcihwYXJhbSwgdmFsdWUpKSA6IEpOSV9GQUxTRTsKK30KKworamJvb2xlYW4gSmF2YV9hbmRyb2lkX2ZpbHRlcmZ3X2NvcmVfR0xGcmFtZV9uYXRpdmVSZXNldFBhcmFtcyhKTklFbnYqIGVudiwgam9iamVjdCB0aGl6KSB7CisgIEdMRnJhbWUqIGZyYW1lID0gQ29udmVydEZyb21KYXZhPEdMRnJhbWU+KGVudiwgdGhpeik7CisgIHJldHVybiBmcmFtZSA/IFRvSkJvb2woZnJhbWUtPlJlc2V0VGV4UGFyYW1ldGVycygpKSA6IEpOSV9GQUxTRTsKK30KKworamJvb2xlYW4gSmF2YV9hbmRyb2lkX2ZpbHRlcmZ3X2NvcmVfR0xGcmFtZV9uYXRpdmVDb3B5RnJvbU5hdGl2ZShKTklFbnYqIGVudiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgam9iamVjdCB0aGl6LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBqb2JqZWN0IGZyYW1lKSB7CisgIEdMRnJhbWUqIHRoaXNfZnJhbWUgPSBDb252ZXJ0RnJvbUphdmE8R0xGcmFtZT4oZW52LCB0aGl6KTsKKyAgTmF0aXZlRnJhbWUqIG90aGVyX2ZyYW1lID0gQ29udmVydEZyb21KYXZhPE5hdGl2ZUZyYW1lPihlbnYsIGZyYW1lKTsKKyAgaWYgKHRoaXNfZnJhbWUgJiYgb3RoZXJfZnJhbWUpIHsKKyAgICByZXR1cm4gVG9KQm9vbCh0aGlzX2ZyYW1lLT5Xcml0ZURhdGEob3RoZXJfZnJhbWUtPkRhdGEoKSwgb3RoZXJfZnJhbWUtPlNpemUoKSkpOworICB9CisgIHJldHVybiBKTklfRkFMU0U7Cit9CisKK2pib29sZWFuIEphdmFfYW5kcm9pZF9maWx0ZXJmd19jb3JlX0dMRnJhbWVfbmF0aXZlQ29weUZyb21HTChKTklFbnYqIGVudiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBqb2JqZWN0IHRoaXosCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgam9iamVjdCBmcmFtZSkgeworICBHTEZyYW1lKiB0aGlzX2ZyYW1lID0gQ29udmVydEZyb21KYXZhPEdMRnJhbWU+KGVudiwgdGhpeik7CisgIEdMRnJhbWUqIG90aGVyX2ZyYW1lID0gQ29udmVydEZyb21KYXZhP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qLworCisjaWZuZGVmIEFORFJPSURfRklMVEVSRldfSk5JX0dMX0ZSQU1FX0gKKyNkZWZpbmUgQU5EUk9JRF9GSUxURVJGV19KTklfR0xfRlJBTUVfSAorCisjaW5jbHVkZSA8am5pLmg+CisKKyNpZmRlZiBfX2NwbHVzcGx1cworZXh0ZXJuICJDIiB7CisjZW5kaWYKKworSk5JRVhQT1JUIGpib29sZWFuIEpOSUNBTEwKK0phdmFfYW5kcm9pZF9maWx0ZXJmd19jb3JlX0dMRnJhbWVfbmF0aXZlQWxsb2NhdGUoSk5JRW52KiBlbnYsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGpvYmplY3QgdGhpeiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgam9iamVjdCBnbF9lbnYsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGppbnQgd2lkdGgsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGppbnQgaGVpZ2h0KTsKKworSk5JRVhQT1JUIGpib29sZWFuIEpOSUNBTEwKK0phdmFfYW5kcm9pZF9maWx0ZXJmd19jb3JlX0dMRnJhbWVfbmF0aXZlQWxsb2NhdGVXaXRoVGV4dHVyZShKTklFbnYqIGVudiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBqb2JqZWN0IHRoaXosCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgam9iamVjdCBnbF9lbnYsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgamludCB0ZXhfaWQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgamludCB3aWR0aCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBqaW50IGhlaWdodCk7CisKK0pOSUVYUE9SVCBqYm9vbGVhbiBKTklDQUxMCitKYXZhX2FuZHJvaWRfZmlsdGVyZndfY29yZV9HTEZyYW1lX25hdGl2ZUFsbG9jYXRlV2l0aEZibyhKTklFbnYqIGVudiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGpvYmplY3QgdGhpeiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGpvYmplY3QgZ2xfZW52LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgamludCBmYm9faWQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBqaW50IHdpZHRoLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgamludCBoZWlnaHQpOworCitKTklFWFBPUlQgamJvb2xlYW4gSk5JQ0FMTAorSmF2YV9hbmRyb2lkX2ZpbHRlcmZ3X2NvcmVfR0xGcmFtZV9uYXRpdmVBbGxvY2F0ZUV4dGVybmFsKEpOSUVudiogZW52LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGpvYmplY3QgdGhpeiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBqb2JqZWN0IGdsX2Vudik7CisKK0pOSUVYUE9SVCBqYm9vbGVhbiBKTklDQUxMCitKYXZhX2FuZHJvaWRfZmlsdGVyZndfY29yZV9HTEZyYW1lX25hdGl2ZURlYWxsb2NhdGUoSk5JRW52KiBlbnYsIGpvYmplY3QgdGhpeik7CisKK0pOSUVYUE9SVCBqYm9vbGVhbiBKTklDQUxMCitKYXZhX2FuZHJvaWRfZmlsdGVyZndfY29yZV9HTEZyYW1lX3NldE5hdGl2ZUludHMoSk5JRW52KiBlbnYsIGpvYmplY3QgdGhpeiwgamludEFycmF5IGludHMpOworCitKTklFWFBPUlQgamludEFycmF5IEpOSUNBTEwKK0phdmFfYW5kcm9pZF9maWx0ZXJmd19jb3JlX0dMRnJhbWVfZ2V0TmF0aXZlSW50cyhKTklFbnYqIGVudiwgam9iamVjdCB0aGl6KTsKKworSk5JRVhQT1JUIGpib29sZWFuIEpOSUNBTEwKK0phdmFfYW5kcm9pZF9maWx0ZXJmd19jb3JlX0dMRnJhbWVfc2V0TmF0aXZlRmxvYXRzKEpOSUVudiogZW52LCBqb2JqZWN0IHRoaXosIGpmbG9hdEFycmF5IGludHMpOworCitKTklFWFBPUlQgamZsb2F0QXJyYXkgSk5JQ0FMTAorSmF2YV9hbmRyb2lkX2ZpbHRlcmZ3X2NvcmVfR0xGcmFtZV9nZXROYXRpdmVGbG9hdHMoSk5JRW52KiBlbnYsIGpvYmplY3QgdGhpeik7CisKK0pOSUVYUE9SVCBqYm9vbGVhbiBKTklDQUxMCitKYXZhX2FuZHJvaWRfZmlsdGVyZndfY29yZV9HTEZyYW1lX3NldE5hdGl2ZURhdGEoSk5JRW52KiBlbnYsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgam9iamVjdCB0aGl6LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGpieXRlQXJyYXkgZGF0YSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBqaW50IG9mZnNldCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBqaW50IGxlbmd0aCk7CisKK0pOSUVYUE9SVCBqYnl0ZUFycmF5IEpOSUNBTEwKK0phdmFfYW5kcm9pZF9maWx0ZXJmd19jb3JlX0dMRnJhbWVfZ2V0TmF0aXZlRGF0YShKTklFbnYqIGVudiwgam9iamVjdCB0aGl6KTsKKworSk5JRVhQT1JUIGpib29sZWFuIEpOSUNBTEwKK0phdmFfYW5kcm9pZF9maWx0ZXJmd19jb3JlX0dMRnJhbWVfc2V0TmF0aXZlQml0bWFwKEpOSUVudiogZW52LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgam9iamVjdCB0aGl6LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgam9iamVjdCBiaXRtYXAsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBqaW50IHNpemUpOworCitKTklFWFBPUlQgamJvb2xlYW4gSk5JQ0FMTAorSmF2YV9hbmRyb2lkX2ZpbHRlcmZ3X2NvcmVfR0xGcmFtZV9nZXROYXRpdmVCaXRtYXAoSk5JRW52KiBlbnYsIGpvYmplY3QgdGhpeiwgam9iamVjdCBiaXRtYXApOworCitKTklFWFBPUlQgamJvb2xlYW4gSk5JQ0FMTAorSmF2YV9hbmRyb2lkX2ZpbHRlcmZ3X2NvcmVfR0xGcmFtZV9zZXROYXRpdmVWaWV3cG9ydChKTklFbnYqIGVudiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgam9iamVjdCB0aGl6LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBqaW50IHgsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGppbnQgeSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgamludCB3aWR0aCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgamludCBoZWlnaHQpOworCitKTklFWFBPUlQgamludCBKTklDQUxMCitKYXZhX2FuZHJvaWRfZmlsdGVyZndfY29yZV9HTEZyYW1lX2dldE5hdGl2ZVRleHR1cmVJZChKTklFbnYqIGVudiwgam9iamVjdCB0aGl6KTsKKworSk5JRVhQT1JUIGppbnQgSk5JQ0FMTAorSmF2YV9hbmRyb2lkX2ZpbHRlcmZ3X2NvcmVfR0xGcmFtZV9nZXROYXRpdmVGYm9JZChKTklFbnYqIGVudiwgam9iamVjdCB0aGl6KTsKKworSk5JRVhQT1JUIGpib29sZWFuIEpOSUNBTEwKK0phdmFfYW5kcm9pZF9maWx0ZXJmd19jb3JlX0dMRnJhbWVfZ2VuZXJhdGVOYXRpdmVNaXBNYXAoSk5JRW52KiBlbnYsIGpvYmplY3QgdGhpeik7CisKK0pOSUVYUE9SVCBqYm9vbGVhbiBKTklDQUxMCitKYXZhX2FuZHJvaWRfZmlsdGVyZndfY29yZV9HTEZyYW1lX3NldE5hdGl2ZVRleHR1cmVQYXJhbShKTklFbnYqIGVudiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGpvYmplY3QgdGhpeiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGppbnQgcGFyYW0sCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBqaW50IHZhbHVlKTsKKworSk5JRVhQT1JUIGpib29sZWFuIEpOSUNBTEwKK0phdmFfYW5kcm9pZF9maWx0ZXJmd19jb3JlX0dMRnJhbWVfbmF0aXZlUmVzZXRQYXJhbXMoSk5JRW52KiBlbnYsIGpvYmplY3QgdGhpeik7CisKK0pOSUVYUE9SVCBqYm9vbGVhbiBKTklDQUxMCitKYXZhX2FuZHJvaWRfZmlsdGVyZndfY29yZV9HTEZyYW1lX25hdGl2ZUNvcHlGcm9tTmF0aXZlKEpOSUVudiogZW52LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBqb2JqZWN0IHRoaXosCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGpvYmplY3QgZnJhbWUpOworCitKTklFWFBPUlQgamJvb2xlYW4gSk5JQ0FMTAorSmF2YV9hbmRyb2lkX2ZpbHRlcmZ3X2NvcmVfR0xGcmFtZV9uYXRpdmVDb3B5RnJvbUdMKEpOSUVudiogZW52LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGpvYmplY3QgdGhpeiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBqb2JqZWN0IGZyYW1lKTsKKworSk5JRVhQT1JUIGpib29sZWFuIEpOSUNBTEwKK0phdmFfYW5kcm9pZF9maWx0ZXJmd19jb3JlX0dMRnJhbWVfbmF0aXZlRm9jdXMoSk5JRW52KiBlbnYsIGpvYmplY3QgdGhpeik7CisKK0pOSUVYUE9SVCBqYm9vbGVhbiBKTklDQUxMCitKYXZhX2FuZHJvaWRfZmlsdGVyZndfY29yZV9HTEZyYW1lX25hdGl2ZVJlYXR0YWNoVGV4VG9GYm8oSk5JRW52KiBlbnYsIGpvYmplY3QgdGhpeik7CisKK0pOSUVYUE9SVCBqYm9vbGVhbiBKTklDQUxMCitKYXZhX2FuZHJvaWRfZmlsdGVyZndfY29yZV9HTEZyYW1lX25hdGl2ZURldGFjaFRleEZyb21GYm8oSk5JRW52KiBlbnYsIGpvYmplY3QgdGhpeik7CisKKyNpZmRlZiBfX2NwbHVzcGx1cworfQorI2VuZGlmCisKKyNlbmRpZiAvKiBBTkRST0lEX0ZJTFRFUkZXX0pOSV9HTF9GUkFNRV9IICovCmRpZmYgLS1naXQgYS9tZWRpYS9tY2EvZmlsdGVyZncvam5pL2puaV9pbml0LmNwcCBiL21lZGlhL21jYS9maWx0ZXJmdy9qbmkvam5pX2lua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GpvYmplY3QgdGhpeiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGpib29sZWFuIG93bnNfZGF0YSkgeworICBpZiAoVG9DcHBCb29sKG93bnNfZGF0YSkpIHsKKyAgICBjaGFyKiBkYXRhID0gR2V0SkJ1ZmZlckRhdGEoZW52LCB0aGl6LCBOVUxMKTsKKyAgICBkZWxldGVbXSBkYXRhOworICB9CisgIHJldHVybiBKTklfVFJVRTsKK30KKworamJvb2xlYW4gSmF2YV9hbmRyb2lkX2ZpbHRlcmZ3X2NvcmVfTmF0aXZlQnVmZmVyX25hdGl2ZUNvcHlUbyhKTklFbnYqIGVudiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgam9iamVjdCB0aGl6LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBqb2JqZWN0IG5ld19idWZmZXIpIHsKKyAgLy8gR2V0IHNvdXJjZSBidWZmZXIKKyAgaW50IHNpemU7CisgIGNoYXIqIHNvdXJjZV9kYXRhID0gR2V0SkJ1ZmZlckRhdGEoZW52LCB0aGl6LCAmc2l6ZSk7CisKKyAgLy8gTWFrZSBjb3B5CisgIGNoYXIqIHRhcmdldF9kYXRhID0gbmV3IGNoYXJbc2l6ZV07CisgIG1lbWNweSh0YXJnZXRfZGF0YSwgc291cmNlX2RhdGEsIHNpemUpOworCisgIC8vIEF0dGFjaCBpdCB0byBuZXcgYnVmZmVyCisgIEF0dGFjaERhdGFUb0pCdWZmZXIoZW52LCBuZXdfYnVmZmVyLCB0YXJnZXRfZGF0YSwgc2l6ZSk7CisKKyAgcmV0dXJuIEpOSV9UUlVFOworfQorCmRpZmYgLS1naXQgYS9tZWRpYS9tY2EvZmlsdGVyZncvam5pL2puaV9uYXRpdmVfYnVmZmVyLmggYi9tZWRpYS9tY2EvZmlsdGVyZnc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jbHVkZSAiam5pL2puaV91dGlsLmgiCisKKyNpbmNsdWRlICJuYXRpdmUvYmFzZS9sb2dnaW5nLmgiCisjaW5jbHVkZSAibmF0aXZlL2NvcmUvZ2xfZnJhbWUuaCIKKyNpbmNsdWRlICJuYXRpdmUvY29yZS9uYXRpdmVfZnJhbWUuaCIKKwordXNpbmcgYW5kcm9pZDo6ZmlsdGVyZnc6Ok5hdGl2ZUZyYW1lOwordXNpbmcgYW5kcm9pZDo6ZmlsdGVyZnc6OkdMRnJhbWU7CisKK3R5cGVkZWYgdW5pb24geworICAgIHVpbnQzMl90IHZhbHVlOworICAgIHVpbnQ4X3QgIHJnYmFbNF07Cit9IFBpeGVsOworCitqYm9vbGVhbiBKYXZhX2FuZHJvaWRfZmlsdGVyZndfY29yZV9OYXRpdmVGcmFtZV9uYXRpdmVBbGxvY2F0ZShKTklFbnYqIGVudiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGpvYmplY3QgdGhpeiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGppbnQgc2l6ZSkgeworICByZXR1cm4gVG9KQm9vbChXcmFwT2JqZWN0SW5KYXZhKG5ldyBOYXRpdmVGcmFtZShzaXplKSwgZW52LCB0aGl6LCB0cnVlKSk7Cit9CisKK2pib29sZWFuIEphdmFfYW5kcm9pZF9maWx0ZXJmd19jb3JlX05hdGl2ZUZyYW1lX25hdGl2ZURlYWxsb2NhdGUoSk5JRW52KiBlbnYsIGpvYmplY3QgdGhpeikgeworICByZXR1cm4gVG9KQm9vbChEZWxldGVOYXRpdmVPYmplY3Q8TmF0aXZlRnJhbWU+KGVudiwgdGhpeikpOworfQorCitqaW50IEphdmFfYW5kcm9pZF9maWx0ZXJmd19jb3JlX05hdGl2ZUZyYW1lX25hdGl2ZUludFNpemUoSk5JRW52KiwgamNsYXNzKSB7CisgIHJldHVybiBzaXplb2YoamludCk7Cit9CisKK2ppbnQgSmF2YV9hbmRyb2lkX2ZpbHRlcmZ3X2NvcmVfTmF0aXZlRnJhbWVfbmF0aXZlRmxvYXRTaXplKEpOSUVudiosIGpjbGFzcykgeworICByZXR1cm4gc2l6ZW9mKGpmbG9hdCk7Cit9CisKK2pib29sZWFuIEphdmFfYW5kcm9pZF9maWx0ZXJmd19jb3JlX05hdGl2ZUZyYW1lX3NldE5hdGl2ZURhdGEoSk5JRW52KiBlbnYsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGpvYmplY3QgdGhpeiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgamJ5dGVBcnJheSBkYXRhLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBqaW50IG9mZnNldCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgamludCBsZW5ndGgpIHsKKyAgTmF0aXZlRnJhbWUqIGZyYW1lID0gQ29udmVydEZyb21KYXZhPE5hdGl2ZUZyYW1lPihlbnYsIHRoaXopOworICBpZiAoZnJhbWUgJiYgZGF0YSkgeworICAgIGpieXRlKiBieXRlcyA9IGVudi0+R2V0Qnl0ZUFycmF5RWxlbWVudHMoZGF0YSwgTlVMTCk7CisgICAgaWYgKGJ5dGVzKSB7CisgICAgICBjb25zdCBib29sIHN1Y2Nlc3MgPSBmcmFtZS0+V3JpdGVEYXRhKHJlaW50ZXJwcmV0X2Nhc3Q8Y29uc3QgdWludDhfdCo+KGJ5dGVzICsgb2Zmc2V0KSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbGVuZ3RoKTsKKyAgICAgIGVudi0+UmVsZWFzZUJ5dGVBcnJheUVsZW1lbnRzKGRhdGEsIGJ5dGVzLCBKTklfQUJPUlQpOworICAgICAgcmV0dXJuIFRvSkJvb2woc3VjY2Vzcyk7CisgICAgfQorICB9CisgIHJldHVybiBKTklfRkFMU0U7Cit9CisKK2pieXRlQXJyYXkgSmF2YV9hbmRyb2lkX2ZpbHRlcmZ3X2NvcmVfTmF0aXZlRnJhbWVfZ2V0TmF0aXZlRGF0YShKTklFbnYqIGVudiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBqb2JqZWN0IHRoaXosCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgamludCBzaXplKSB7CisgIE5hdGl2ZUZyYW1lKiBmcmFtZSA9IENvbnZlcnRGcm9tSmF2YTxOYXRpdmVGcmFtZT4oZW52LCB0aGl6KTsKKyAgaWYgKGZyYW1lKSB7CisgICAgY29uc3QgdWludDhfdCogZGF0YSA9IGZyYW1lLT5EYXRhKCk7CisgICAgaWYgKCFkYXRhIHx8IHNpemUgPiBmcmFtZS0+U2l6ZSgpKQorICAgICAgcmV0dXJuIE5VTEw7CisgICAgamJ5dGVBcnJheSByZXN1bHQgPSBlbnYtPk5ld0J5dGVBcnJheShzaXplKTsKKyAgICBlbnYtPlNldEJ5dGVBcnJheVJlZ2lvbihyZXN1bHQsIDAsIHNpemUsIHJlaW50ZXJwcmV0X2Nhc3Q8Y29uc3QgamJ5dGUqPihkYXRhKSk7CisgICAgcmV0dXJuIHJlc3VsdDsKKyAgfQorICByZXR1cm4gTlVMTDsKK30KKworamJvb2xlYW4gSmF2YV9hbmRyb2lkX2ZpbHRlcmZ3X2NvcmVfTmF0aXZlRnJhbWVfZ2V0TmF0aXZlQnVmZmVyKEpOSUVudiogZW52LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGpvYmplY3QgdGhpeiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBqb2JqZWN0IGJ1ZmZlcikgeworICBOYXRpdmVGcmFtZSogZnJhbWUgPSBDb252ZXJ0RnJvbUphdmE8TmF0aXZlRnJhbWU+KGVudiwgdGhpeik7CisgIGlmIChmcmFtZSkgeworICAgIGNoYXIqIGRhdGEgPSByZWludGVycHJldF9jYXN0PGNoYXIqPihmcmFtZS0+TXV0YWJsZURhdGEoKSk7CisgICAgcmV0dXJuIFRvSkJvb2woQXR0YWNoRGF0YVRvSkJ1ZmZlcihlbnYsIGJ1ZmZlciwgZGF0YSwgZnJhbWUtPlNpemUoKSkpOworICB9CisgIHJldHVybiBKTklfRkFMU0U7Cit9CisKK2pib29sZWFuIEphdmFfYW5kcm9pZF9maWx0ZXJmd19jb3JlX05hdGl2ZUZyYW1lX3NldE5hdGl2ZUludHMoSk5JRW52KiBlbnYsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGpvYmplY3QgdGhpeiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgamludEFycmF5IGludHMpIHsKKyAgTmF0aXZlRnJhbWUqIGZyYW1lID0gQ29udmVydEZyb21KYXZhPE5hdGl2ZUZyYW1lPihlbnYsIHRoaXopOworICBpZiAoZnJhbWUgJiYgaW50cykgeworICAgIGppbnQqIGludF9wdHIgPSBlbnYtPkdldEludEFycmF5RWxlbWVudHMoaW50cywgTlVMTCk7CisgICAgY29uc3QgaW50IGxlbmd0aCA9IGVudi0+R2V0QXJyYXlMZW5ndGgoaW50cyk7CisgICAgaWYgKGludF9wdHIpIHsKKyAgICAgIGNvbnN0IGJvb2wgc3VjY2VzcyA9IGZyYW1lLT5Xcml0ZURhdGEocmVpbnRlcnByZXRfY2FzdDxjb25zdCB1aW50OF90Kj4oaW50X3B0ciksCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDAsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxlbmd0aCAqIHNpemVvZihqaW50KSk7CisgICAgICBlbnYtPlJlbGVhc2VJbnRBcnJheUVsZW1lbnRzKGludHMsIGludF9wdHIsIEpOSV9BQk9SVCk7CisgICAgICByZXR1cm4gVG9KQm9vbChzdWNjZXNzKTsKKyAgICB9CisgIH0KKyAgcmV0dXJuIEpOSV9GQUxTRTsKK30KKworamludEFycmF5IEphdmFfYW5kcm9pZF9maWx0ZXJmd19jb3JlX05hdGl2ZUZyYW1lX2dldE5hdGl2ZUludHMoSk5JRW52KiBlbnYsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBqb2JqZWN0IHRoaXosCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBqaW50IHNpemUpIHsKKyAgTmF0aXZlRnJhbWUqIGZyYW1lID0gQ29udmVydEZyb21KYXZhPE5hdGl2ZUZyYW1lPihlbnYsIHRoaXopOworICBpZiAoZnJhbWUpIHsKKyAgICBjb25zdCB1aW50OF90KiBkYXRhID0gZnJhbWUtPkRhdGEoKTsKKyAgICBpZiAoIWRhdGEgfHwgc2l6ZSA+IGZyYW1lLT5TaXplKCkgfHwgKHNpemUgJSBzaXplb2YoamludCkpICE9IDApCisgICAgICByZXR1cm4gTlVMTDsKKyAgICBjb25zdCBpbnQgY291bnQgPSBzaXplIC8gc2l6ZW9mKGppbnQpOworICAgIGppbnRBcnJheSByZXN1bHQgPSBlbnYtPk5ld0ludEFycmF5KGNvdW50KTsKKyAgICBlbnYtPlNldEludEFycmF5UmVnaW9uKHJlc3VsdCwgMCwgY291bnQsIHJlaW50ZXJwcmV0X2Nhc3Q8Y29uc3QgamludCo+KGRhdGEpKTsKKyAgICByZXR1cm4gcmVzdWx0OworICB9CisgIHJldHVybiBOVUxMOworfQorCitqYm9vbGVhbiBKYXZhX2FuZHJvaWRfZmlsdGVyZndfY29yZV9OYXRpdmVGcmFtZV9zZXROYXRpdmVGbG9hdHMoSk5JRW52KiBlbnYsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgam9iamVjdCB0aGl6LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGpmbG9hdEFycmF5IGZsb2F0cykgeworICBOYXRpdmVGcmFtZSogZnJhbWUgPSBDb252ZXJ0RnJvbUphdmE8TmF0aXZlRnJhbWU+KGVudiwgdGhpeik7CisgIGlmIChmcmFtZSAmJiBmbG9hdHMpIHsKKyAgICBqZmxvYXQqIGZsb2F0X3B0ciA9IGVudi0+R2V0RmxvYXRBcnJheUVsZW1lbnRzKGZsb2F0cywgTlVMTCk7CisgICAgY29uc3QgaW50IGxlbmd0aCA9IGVudi0+R2V0QXJyYXlMZW5ndGgoZmxvYXRzKTsKKyAgICBpZiAoZmxvYXRfcHRyKSB7CisgICAgICBjb25zdCBib29sIHN1Y2Nlc3MgPSBmcmFtZS0+V3JpdGVEYXRhKHJlaW50ZXJwcmV0X2Nhc3Q8Y29uc3QgdWludDhfdCo+KGZsb2F0X3B0ciksCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDAsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxlbmd0aCAqIHNpemVvZihqZmxvYXQpKTsKKyAgICAgIGVudi0+UmVsZWFzZUZsb2F0QXJyYXlFbGVtZW50cyhmbG9hdHMsIGZsb2F0X3B0ciwgSk5JX0FCT1JUKTsKKyAgICAgIHJldHVybiBUb0pCb29sKHN1Y2Nlc3MpOworICAgIH0KKyAgfQorICByZXR1cm4gSk5JX0ZBTFNFOworfQorCitqZmxvYXRBcnJheSBKYXZhX2FuZHJvaWRfZmlsdGVyZndfY29yZV9OYXRpdmVGcmFtZV9nZXROYXRpdmVGbG9hdHMoSk5JRW52KiBlbnYsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgam9iamVjdCB0aGl6LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGppbnQgc2l6ZSkgeworICBOYXRpdmVGcmFtZSogZnJhbWUgPSBDb252ZXJ0RnJvbUphdmE8TmF0aXZlRnJhbWU+KGVudiwgdGhpeik7CisgIGlmIChmcmFtZSkgeworICAgIGNvbnN0IHVpbnQ4X3QqIGRhdGEgPSBmcmFtZS0+RGF0YSgpOworICAgIGlmICghZGF0YSB8fCBzaXplID4gZnJhbWUtPlNpemUoKSB8fCAoc2l6ZSAlIHNpemVvZihqZmxvYXQpKSAhPSAwKQorICAgICAgcmV0dXJuIE5VTEw7CisgICAgY29uc3QgaW50IGNvdW50ID0gc2l6ZSAvIHNpemVvZihqZmxvYXQpOworICAgIGpmbG9hdEFycmF5IHJlc3VsdCA9IGVudi0+TmV3RmxvYXRBcnJheShjb3VudCk7CisgICAgZW52LT5TZXRGbG9hdEFycmF5UmVnaW9uKHJlc3VsdCwgMCwgY291bnQsIHJlaW50ZXJwcmV0X2Nhc3Q8Y29uc3QgamZsb2F0Kj4oZGF0YSkpOworICAgIHJldHVybiByZXN1bHQ7CisgIH0KKyAgcmV0dXJuIE5VTEw7Cit9CisKK2pib29sZWFuIEphdmFfYW5kcm9pZF9maWx0ZXJmd19jb3JlX05hdGl2ZUZyYW1lX3NldE5hdGl2ZUJpdG1hcChKTklFbnYqIGVudiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBqb2JqZWN0IHRoaXosCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgam9iamVjdCBiaXRtYXAsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgamludCBzaXplLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGppbnQgYnl0ZXNfcGVyX3NhbXBsZSkgeworICBOYXRpdmVGcmFtZSogZnJhbWUgPSBDb252ZXJ0RnJvbUphdmE8TmF0aXZlRnJhbWU+KGVudiwgdGhpeik7CisgIGlmIChmcmFtZSAmJiBiaXRtYXApIHsKKyAgICAvLyBNYWtlIHN1cmUgZnJhbWUgc2l6ZSBtYXRjaGVzIGJpdG1hcCBzaXplCisgICAgaWYgKChzaXplIC8gNCkgIT0gKGZyYW1lLT5TaXplKCkgLyBieXRlc19wZXJfc2FtcGxlKSkgeworICAgICAgQUxPR0UoIlNpemUgbWlzbWF0Y2ggaW4gbmF0aXZlIHNldEJpdG1hcCgpISIpOworICAgICAgcmV0dXJuIEpOSV9GQUxTRTsKKyAgICB9CisKKyAgICBQaXhlbCogc3JjX3B0cjsKKyAgICBjb25zdCBpbnQgcmVzdWx0ID0gQW5kcm9pZEJpdG1hcF9sb2NrUGl4ZWxzKGVudiwgYml0bWFwLCByZWludGVycHJldF9jYXN0PHZvaWQqKj4oJnNyY19wdHIpKTsKKyAgICBpZiAocmVzdWx0ID09IEFORFJPSURfQklUTUFQX1JFU1VUX1NVQ0NFU1MpIHsKKyAgICAgIC8vIENyZWF0ZSBkZXN0aW5hdGlvbiBwb2ludGVycworICAgICAgdWludDhfdCogZHN0X3B0ciA9IHJlaW50ZXJwcmV0X2Nhc3Q8dWludDhfdCo+KGZyYW1lLT5NdXRhYmxlRGF0YSgpKTsKKyAgICAgIGNvbnN0IHVpbnQ4X3QqIGVuZF9wdHIgPSBkc3RfcHRyICsgZnJhbWUtPlNpemUoKTsKKyAgICAgIHN3aXRjaCAoYnl0ZXNfcGVyX3NhbXBsZSkgeworICAgICAgICBjYXNlIDE6IHsgLy8gUkdCQSAtPiBHUkFZCisgICAgICAgICAgd2hpbGUgKGRzdF9wdHIgPCBlbmRfcHRyKSB7CisgICAgICAgICAgICBjb25zdCBQaXhlbCBwaXhlbCA9ICooc3JjX3B0cisrKTsKKyAgICAgICAgICAgICooZHN0X3B0cisrKSA9IChwaXhlbC5yZ2JhWzBdICsgcGl4ZWwucmdiYVsxXSArIHBpeGVsLnJnYmFbMl0pIC8gMzsKKyAgICAgICAgICB9CisgICAgICAgICAgYnJlYWs7CisgICAgICAgIH0KKyAgICAgICAgY2FzZSAzOiB7IC8vIFJHQkEgLT4gUkdCCisgICAgICAgICAgd2hpbGUgKGRzdF9wdHIgPCBlbmRfcHRyKSB7CisgICAgICAgICAgICBjb25zdCBQaXhlbCBwaXhlbCA9ICooc3JjX3B0cisrKTsKKyAgICAgICAgICAgICooZHN0X3B0cisrKSA9IHBpeGVsLnJnYmFbMF07CisgICAgICAgICAgICAqKGRzdF9wdHIrKykgPSBwaXhlbC5yZ2JhWzFdOworICAgICAgICAgICAgKihkc3RfcHRyKyspID0gcGl4ZWwucmdiYVsyXTsKKyAgICAgICAgICB9CisgICAgICAgICAgYnJlYWs7CisgICAgICAgIH0KKyAgICAgICAgY2FzZSA0OiB7IC8vIFJHQkEgLT4gUkdCQQorICAgICAgICAgIG1lbWNweShkc3RfcHRyLCBzcmNfcHRyLCBmcmFtZS0+U2l6ZSgpKTsKKyAgICAgICAgICBicmVhazsKKyAgICAgICAgfQorICAgICAgICBkZWZhdWx0OgorICAgICAgICAgIEFMT0dFKCJVbnN1cHBvcnRlZCBieXRlcy1wZXItcGl4ZWwgJWQgaW4gc2V0Qml0bWFwISIsIGJ5dGVzX3Blcl9zYW1wbGUpOworICAgICAgICAgIGJyZWFrOworICAgICAgfQorICAgICAgcmV0dXJuIChBbmRyb2lkQml0bWFwX3VubG9ja1BpeGVscyhlbnYsIGJpdG1hcCkgPT0gQU5EUk9JRF9CSVRNQVBfUkVTVVRfU1VDQ0VTUyk7CisgICAgfQorICB9CisgIHJldHVybiBKTklfRkFMU0U7Cit9CisKK2pib29sZWFuIEphdmFfYW5kcm9pZF9maWx0ZXJmd19jb3JlX05hdGl2ZUZyYW1lX2dldE5hdGl2ZUJpdG1hcChKTklFbnYqIGVudiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBqb2JqZWN0IHRoaXosCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgam9iamVjdCBiaXRtYXAsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgamludCBzaXplLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGppbnQgYnl0ZXNfcGVyX3NhbXBsZSkgeworICBOYXRpdmVGcmFtZSogZnJhbWUgPSBDb252ZXJ0RnJvbUphdmE8TmF0aXZlRnJhbWU+KGVudiwgdGhpeik7CisgIGlmIChmcmFtZSAmJiBiaXRtYXApIHsKKyAgICBQaXhlbCogZHN0X3B0cjsKKyAgICBjb25zdCBpbnQgcmVzdWx0ID0gQW5kcm9pZEJpdG1hcF9sb2NrUGl4ZWxzKGVudiwgYml0bWFwLCByZWludGVycHJldF9jYXN0PHZvaWQqKj4oJmRzdF9wdHIpKTsKKyAgICBpZiAocmVzdWx0ID09IEFORFJPSURfQklUTUFQX1JFU1VUX1NVQ0NFU1MpIHsKKyAgICAgIC8vIE1ha2Ugc3VyZSBmcmFtZSBzaXplIG1hdGNoZXMgYml0bWFwIHNpemUKKyAgICAgIGlmICgoc2l6ZSAvIDQpICE9IChmcmFtZS0+U2l6ZSgpIC8gYnl0ZXNfcGVyX3NhbXBsZSkpIHsKKyAgICAgICAgQUxPR0UoIlNpemUgbWlzbWF0Y2ggaW4gbmF0aXZlIGdldEJpdG1hcCgpISIpOworICAgICAgICByZXR1cm4gSk5JX0ZBTFNFOworICAgICAgfQorCisgICAgICBjb25zdCB1aW50OF90KiBzcmNfcHRyID0gZnJhbWUtPkRhdGEoKTsKKyAgICAgIGNvbnN0IHVpbnQ4X3QqIGVuZF9wdHIgPSBzcmNfcHRyICsgZnJhbWUtPlNpemUoKTsKKyAgICAgIHN3aXRjaCAoYnl0ZXNfcGVyX3NhbXBsZSkgeworICAgICAgICBjYXNlIDE6IHsgLy8gR1JBWSAtPiBSR0JBCisgICAgICAgICAgd2hpbGUgKHNyY19wdHIgPCBlbmRfcHRyKSB7CisgICAgICAgICAgICBjb25zdCB1aW50OF90IHZhbHVlID0gKihzcmNfcHRyKyspOworICAgICAgICAgICAgZHN0X3B0ci0+cmdiYVswXSA9IGRzdF9wdHItPnJnYmFbMV0gPSBkc3RfcHRyLT5yZ2JhWzJdID0gdmFsdWU7CisgICAgICAgICAgICBkc3RfcHRyLT5yZ2JhWzNdID0gMjU1OworICAgICAgICAgICAgKytkc3RfcHRyOworICAgICAgICAgIH0KKyAgICAgICAgICBicmVhazsKKyAgICAgICAgfQorICAgICAgICBjYXNlIDM6IHsgLy8gUkdCIC0+IFJHQkEKKyAgICAgICAgICB3aGlsZSAoc3JjX3B0ciA8IGVuZF9wdHIpIHsKKyAgICAgICAgICAgIGRzdF9wdHItPnJnYmFbMF0gPSAqKHNyY19wdHIrKyk7CisgICAgICAgICAgICBkc3RfcHRyLT5yZ2JhWzFdID0gKihzcmNfcHRyKyspOworICAgICAgICAgICAgZHN0X3B0ci0+cmdiYVsyXSA9ICooc3JjX3B0cisrKTsKKyAgICAgICAgICAgIGRzdF9wdHItPnJnYmFbM10gPSAyNTU7CisgICAgICAgICAgICArK2RzdF9wdHI7CisgICAgICAgICAgfQorICAgICAgICAgIGJyZWFrOworICAgICAgICB9CisgICAgICAgIGNhc2UgNDogeyAvLyBSR0JBIC0+IFJHQkEKKyAgICAgICAgICBtZW1jcHkoZHN0X3B0ciwgc3JjX3B0ciwgZnJhbWUtPlNpemUoKSk7CisgICAgICAgICAgYnJlYWs7CisgICAgICAgIH0KKyAgICAgICAgZGVmYXVsdDoKKyAgICAgICAgICBBTE9HRSgiVW5zdXBwb3J0ZWQgYnl0ZXMtcGVyLXBpeGVsICVkIGluIGdldEJpdG1hcCEiLCBieXRlc19wZXJfc2FtcGxlKTsKKyAgICAgICAgICBicmVhazsKKyAgICAgIH0KKyAgICAgIHJldHVybiAoQW5kcm9pZEJpdG1hcF91bmxvY2tQaXhlbHMoZW52LCBiaXRtYXApID09IEFORFJPSURfQklUTUFQX1JFU1VUX1NVQ0NFU1MpOworICAgIH0KKyAgfQorICByZXR1cm4gSk5JX0ZBTFNFOworfQorCitqaW50IEphdmFfYW5kcm9pZF9maWx0ZXJmd19jb3JlX05hdGl2ZUZyYW1lX2dldE5hdGl2ZUNhcGFjaXR5KEpOSUVudiogZW52LCBqb2JqZWN0IHRoaXopIHsKKyAgTmF0aXZlRnJhbWUqIGZyYW1lID0gQ29udmVydEZyb21KYXZhPE5hdGl2ZUZyYW1lPihlbnYsIHRoaXopOworICByZXR1cm4gZnJhbWUgPyBmcmFtZS0+Q2FwYWNpdHkoKSA6IC0xOworfQorCitqYm9vbGVhbiBKYXZhX2FuZHJvaWRfZmlsdGVyZndfY29yZV9OYXRpdmVGcmFtZV9uYXRpdmVDb3B5RnJvbU5hdGl2ZShKTklFbnYqIGVudiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGpvYmplY3QgdGhpeiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGpvYmplY3QgZnJhbWUpIHsKKyAgTmF0aXZlRnJhbWUqIHRoaXNfZnJhbWUgPSBDb252ZXJ0RnJvbUphdmE8TmF0aXZlRnJhbWU+KGVudiwgdGhpeik7CisgIE5hdGl2ZUZyYW1lKiBvdGhlcl9mcmFtZSA9IENvbnZlcnRGcm9tSmF2YTxOYXRpdmVGcmFtZT4oZW52LCBmcmFtZSk7CisgIGlmICh0aGlzX2ZyYW1lICYmIG90aGVyX2ZyYW1lKSB7CisgICAgcmV0dXJuIFRvSkJvb2wodGhpc19mcmFtZS0+V3JpdGVEYXRhKG90aGVyX2ZyYW1lLT5EYXRhKCksIDAsIG90aGVyX2ZyYW1lLT5TaXplKCkpKTsKKyAgfQorICByZXR1cm4gSk5JX0ZBTFNFOworfQorCitqYm9vbGVhbiBKYXZhX2FuZHJvaWRfZmlsdGVyZndfY29yZV9OYXRpdmVGcmFtZV9uYXRpdmVDb3B5RnJvbUdMKEpOSUVudiogZW52LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBqb2JqZWN0IHRoaXosCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGpvYmplY3QgZnJhbWUpIHsKKyAgTmF0aXZlRnJhbWUqIHRoaXNfZnJhbWUgPSBDb252ZXJ0RnJvbUphdmE8TmF0aXZlRnJhbWU+KGVudiwgdGhpeik7CisgIEdMRnJhbWUqIG90aGVyX2ZyYW1lID0gQ29udmVydEZyb21KYXZhPEdMRnJhbWU+KGVudiwgZnJhbWUpOworICBpZiAodGhpc19mcmFtZSAmJiBvdGhlcl9mcmFtZSkgeworICAgIHJldHVybiBUb0pCb29sKG90aGVyX2ZyYW1lLT5Db3B5RGF0YVRvKHRoaXNfZnJhbWUtPk11dGFibGVEYXRhKCksIHRoaXNfZnJhbWUtPlNpemUoKSkpOworICB9CisgIHJldHVybiBKTklfRkFMU0U7Cit9CmRpZmYgLS1naXQgYS9tZWRpYS9tY2EvZmlsdGVyZncvam5pL2puaV9uYX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EpOSUVudiogZW52LCBqb2JqZWN0IHRoaXosIGppbnQgc2l6ZSk7CisKK0pOSUVYUE9SVCBqYm9vbGVhbiBKTklDQUxMCitKYXZhX2FuZHJvaWRfZmlsdGVyZndfY29yZV9OYXRpdmVGcmFtZV9zZXROYXRpdmVGbG9hdHMoSk5JRW52KiBlbnYsIGpvYmplY3QgdGhpeiwgamZsb2F0QXJyYXkgaW50cyk7CisKK0pOSUVYUE9SVCBqZmxvYXRBcnJheSBKTklDQUxMCitKYXZhX2FuZHJvaWRfZmlsdGVyZndfY29yZV9OYXRpdmVGcmFtZV9nZXROYXRpdmVGbG9hdHMoSk5JRW52KiBlbnYsIGpvYmplY3QgdGhpeiwgamludCBzaXplKTsKKworSk5JRVhQT1JUIGpib29sZWFuIEpOSUNBTEwKK0phdmFfYW5kcm9pZF9maWx0ZXJmd19jb3JlX05hdGl2ZUZyYW1lX3NldE5hdGl2ZURhdGEoSk5JRW52KiBlbnYsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGpvYmplY3QgdGhpeiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgamJ5dGVBcnJheSBkYXRhLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBqaW50IG9mZnNldCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgamludCBsZW5ndGgpOworCitKTklFWFBPUlQgamJ5dGVBcnJheSBKTklDQUxMCitKYXZhX2FuZHJvaWRfZmlsdGVyZndfY29yZV9OYXRpdmVGcmFtZV9nZXROYXRpdmVEYXRhKEpOSUVudiogZW52LCBqb2JqZWN0IHRoaXosIGppbnQgc2l6ZSk7CisKK0pOSUVYUE9SVCBqYm9vbGVhbiBKTklDQUxMCitKYXZhX2FuZHJvaWRfZmlsdGVyZndfY29yZV9OYXRpdmVGcmFtZV9nZXROYXRpdmVCdWZmZXIoSk5JRW52KiBlbnYsIGpvYmplY3QgdGhpeiwgam9iamVjdCBidWZmZXIpOworCitKTklFWFBPUlQgamJvb2xlYW4gSk5JQ0FMTAorSmF2YV9hbmRyb2lkX2ZpbHRlcmZ3X2NvcmVfTmF0aXZlRnJhbWVfc2V0TmF0aXZlQml0bWFwKEpOSUVudiogZW52LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGpvYmplY3QgdGhpeiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBqb2JqZWN0IGJpdG1hcCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBqaW50IHNpemUsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgamludCBieXRlc19wZXJfc2FtcGxlKTsKKworSk5JRVhQT1JUIGpib29sZWFuIEpOSUNBTEwKK0phdmFfYW5kcm9pZF9maWx0ZXJmd19jb3JlX05hdGl2ZUZyYW1lX2dldE5hdGl2ZUJpdG1hcChKTklFbnYqIGVudiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBqb2JqZWN0IHRoaXosCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgam9iamVjdCBiaXRtYXAsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgamludCBzaXplLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGppbnQgYnl0ZXNfcGVyX3NhbXBsZSk7CisKK0pOSUVYUE9SVCBqaW50IEpOSUNBTEwKK0phdmFfYW5kcm9pZF9maWx0ZXJmd19jb3JlX05hdGl2ZUZyYW1lX2dldE5hdGl2ZUNhcGFjaXR5KEpOSUVudiogZW52LCBqb2JqZWN0IHRoaXopOworCitKTklFWFBPUlQgamJvb2xlYW4gSk5JQ0FMTAorSmF2YV9hbmRyb2lkX2ZpbHRlcmZ3X2NvcmVfTmF0aXZlRnJhbWVfbmF0aXZlQ29weUZyb21OYXRpdmUoSk5JRW52KiBlbnYsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBqb2JqZWN0IHRoaXosCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBqb2JqZWN0IGZyYW1lKTsKKworSk5JRVhQT1JUIGpib29sZWFuIEpOSUNBTEwKK0phdmFfYW5kcm9pZF9maWx0ZXJmd19jb3JlX05hdGl2ZUZyYW1lX25hdGl2ZUNvcHlGcm9tR0woSk5JRW52KiBlbnYsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGpvYmplY3QgdGhpeiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgam9iamVjdCBmcmFtZSk7CisKKyNpZmRlZiBfX2NwbHVzcGx1cworfQorI2VuZGlmCisKKyNlbmRpZiAvLyBBTkRST0lEX0ZJTFRFUkZXX0pOSV9OQVRJVkVfRlJBTUVfSApkaWZmIC0tZ2l0IGEvbWVkaWEvbWNhL2ZpbHRlcmZ3L2puaS9qbmlfbmF0aXZlX3Byb2dyYW0uY3BwIGIvbWVkaWEvbWNhL2ZpbHRlcmZ3L2puaS9qbmlfbmF0aXZlX3Byb2dyYW0uY3BwCm5ldyBmaWxlIG1vZGUgMTAwNjQ0CmluZGV4IDAwMDAwMDAuLmIzMGI3NjkKLS0tIC9kZXYvbnVsbAorKysgYi9tZWRpYS9tY2EvZmlsdGVyZncvam5pL2puaV9uYXRpdmVfcHJvZ3JhbS5jcHAKQEAgLTAsMCArMSwxODcgQ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gICBqb2JqZWN0IHRoaXosCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGpzdHJpbmcgbGliX25hbWUpIHsKKyAgTmF0aXZlUHJvZ3JhbSogcHJvZ3JhbSA9IENvbnZlcnRGcm9tSmF2YTxOYXRpdmVQcm9ncmFtPihlbnYsIHRoaXopOworICByZXR1cm4gVG9KQm9vbChwcm9ncmFtICYmIGxpYl9uYW1lICYmIHByb2dyYW0tPk9wZW5MaWJyYXJ5KFRvQ3BwU3RyaW5nKGVudiwgbGliX25hbWUpKSk7Cit9CisKK2pib29sZWFuIEphdmFfYW5kcm9pZF9maWx0ZXJmd19jb3JlX05hdGl2ZVByb2dyYW1fYmluZEluaXRGdW5jdGlvbihKTklFbnYqIGVudiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBqb2JqZWN0IHRoaXosCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAganN0cmluZyBmdW5jX25hbWUpIHsKKyAgTmF0aXZlUHJvZ3JhbSogcHJvZ3JhbSA9IENvbnZlcnRGcm9tSmF2YTxOYXRpdmVQcm9ncmFtPihlbnYsIHRoaXopOworICByZXR1cm4gVG9KQm9vbChwcm9ncmFtICYmIGZ1bmNfbmFtZSAmJiBwcm9ncmFtLT5CaW5kSW5pdEZ1bmN0aW9uKFRvQ3BwU3RyaW5nKGVudiwgZnVuY19uYW1lKSkpOworfQorCitqYm9vbGVhbiBKYXZhX2FuZHJvaWRfZmlsdGVyZndfY29yZV9OYXRpdmVQcm9ncmFtX2JpbmRTZXRWYWx1ZUZ1bmN0aW9uKEpOSUVudiogZW52LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBqb2JqZWN0IHRoaXosCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGpzdHJpbmcgZnVuY19uYW1lKSB7CisgIE5hdGl2ZVByb2dyYW0qIHByb2dyYW0gPSBDb252ZXJ0RnJvbUphdmE8TmF0aXZlUHJvZ3JhbT4oZW52LCB0aGl6KTsKKyAgcmV0dXJuIFRvSkJvb2wocHJvZ3JhbSAmJgorICAgICAgICAgICAgICAgICBmdW5jX25hbWUgJiYKKyAgICAgICAgICAgICAgICAgcHJvZ3JhbS0+QmluZFNldFZhbHVlRnVuY3Rpb24oVG9DcHBTdHJpbmcoZW52LCBmdW5jX25hbWUpKSk7Cit9CisKK2pib29sZWFuIEphdmFfYW5kcm9pZF9maWx0ZXJmd19jb3JlX05hdGl2ZVByb2dyYW1fYmluZEdldFZhbHVlRnVuY3Rpb24oSk5JRW52KiBlbnYsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGpvYmplY3QgdGhpeiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAganN0cmluZyBmdW5jX25hbWUpIHsKKyAgTmF0aXZlUHJvZ3JhbSogcHJvZ3JhbSA9IENvbnZlcnRGcm9tSmF2YTxOYXRpdmVQcm9ncmFtPihlbnYsIHRoaXopOworICByZXR1cm4gVG9KQm9vbChwcm9ncmFtICYmCisgICAgICAgICAgICAgICAgIGZ1bmNfbmFtZSAmJgorICAgICAgICAgICAgICAgICBwcm9ncmFtLT5CaW5kR2V0VmFsdWVGdW5jdGlvbihUb0NwcFN0cmluZyhlbnYsIGZ1bmNfbmFtZSkpKTsKK30KKworamJvb2xlYW4gSmF2YV9hbmRyb2lkX2ZpbHRlcmZ3X2NvcmVfTmF0aXZlUHJvZ3JhbV9iaW5kUHJvY2Vzc0Z1bmN0aW9uKEpOSUVudiogZW52LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGpvYmplY3QgdGhpeiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBqc3RyaW5nIGZ1bmNfbmFtZSkgeworICBOYXRpdmVQcm9ncmFtKiBwcm9ncmFtID0gQ29udmVydEZyb21KYXZhPE5hdGl2ZVByb2dyYW0+KGVudiwgdGhpeik7CisgIHJldHVybiBUb0pCb29sKHByb2dyYW0gJiYgZnVuY19uYW1lICYmIHByb2dyYW0tPkJpbmRQcm9jZXNzRnVuY3Rpb24oVG9DcHBTdHJpbmcoZW52LCBmdW5jX25hbWUpKSk7Cit9CisKK2pib29sZWFuIEphdmFfYW5kcm9pZF9maWx0ZXJmd19jb3JlX05hdGl2ZVByb2dyYW1fYmluZFJlc2V0RnVuY3Rpb24oSk5JRW52KiBlbnYsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGpvYmplY3QgdGhpeiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAganN0cmluZyBmdW5jX25hbWUpIHsKKyAgTmF0aXZlUHJvZ3JhbSogcHJvZ3JhbSA9IENvbnZlcnRGcm9tSmF2YTxOYXRpdmVQcm9ncmFtPihlbnYsIHRoaXopOworICByZXR1cm4gVG9KQm9vbChwcm9ncmFtICYmCisgICAgICAgICAgICAgICAgIGZ1bmNfbmFtZSAmJgorICAgICAgICAgICAgICAgICBwcm9ncmFtLT5CaW5kUmVzZXRGdW5jdGlvbihUb0NwcFN0cmluZyhlbnYsIGZ1bmNfbmFtZSkpKTsKK30KKworamJvb2xlYW4gSmF2YV9hbmRyb2lkX2ZpbHRlcmZ3X2NvcmVfTmF0aXZlUHJvZ3JhbV9iaW5kVGVhcmRvd25GdW5jdGlvbihKTklFbnYqIGVudiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgam9iamVjdCB0aGl6LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBqc3RyaW5nIGZ1bmNfbmFtZSkgeworICBOYXRpdmVQcm9ncmFtKiBwcm9ncmFtID0gQ29udmVydEZyb21KYXZhPE5hdGl2ZVByb2dyYW0+KGVudiwgdGhpeik7CisgIHJldHVybiBUb0pCb29sKHByb2dyYW0gJiYKKyAgICAgICAgICAgICAgICAgZnVuY19uYW1lICYmCisgICAgICAgICAgICAgICAgIHByb2dyYW0tPkJpbmRUZWFyZG93bkZ1bmN0aW9uKFRvQ3BwU3RyaW5nKGVudiwgZnVuY19uYW1lKSkpOworfQorCitqYm9vbGVhbiBKYXZhX2FuZHJvaWRfZmlsdGVyZndfY29yZV9OYXRpdmVQcm9ncmFtX2NhbGxOYXRpdmVJbml0KEpOSUVudiogZW52LCBqb2JqZWN0IHRoaXopIHsKKyAgTmF0aXZlUHJvZ3JhbSogcHJvZ3JhbSA9IENvbnZlcnRGcm9tSmF2YTxOYXRpdmVQcm9ncmFtPihlbnYsIHRoaXopOworICByZXR1cm4gVG9KQm9vbChwcm9ncmFtICYmIHByb2dyYW0tPkNhbGxJbml0KCkpOworfQorCitqYm9vbGVhbiBKYXZhX2FuZHJvaWRfZmlsdGVyZndfY29yZV9OYXRpdmVQcm9ncmFtX2NhbGxOYXRpdmVTZXRWYWx1ZShKTklFbnYqIGVudiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGpvYmplY3QgdGhpeiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGpzdHJpbmcga2V5LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAganN0cmluZyB2YWx1ZSkgeworICBpZiAoIXZhbHVlKSB7CisgICAgQUxPR0UoIk5hdGl2ZSBQcm9ncmFtOiBBdHRlbXB0aW5nIHRvIHNldCBudWxsIHZhbHVlIGZvciBrZXkgJXMhIiwKKyAgICAgICAgIFRvQ3BwU3RyaW5nKGVudiwga2V5KS5jX3N0cigpKTsKKyAgfQorICBOYXRpdmVQcm9ncmFtKiBwcm9ncmFtID0gQ29udmVydEZyb21KYXZhPE5hdGl2ZVByb2dyYW0+KGVudiwgdGhpeik7CisgIGNvbnN0IHN0ZDo6c3RyaW5nIGNfdmFsdWUgPSBUb0NwcFN0cmluZyhlbnYsIHZhbHVlKTsKKyAgY29uc3Qgc3RkOjpzdHJpbmcgY19rZXkgPSBUb0NwcFN0cmluZyhlbnYsIGtleSk7CisgIHJldHVybiBUb0pCb29sKHByb2dyYW0gJiYgcHJvZ3JhbS0+Q2FsbFNldFZhbHVlKGNfa2V5LCBjX3ZhbHVlKSk7Cit9CisKK2pzdHJpbmcgSmF2YV9hbmRyb2lkX2ZpbHRlcmZ3X2NvcmVfTmF0aXZlUHJvZ3JhbV9jYWxsTmF0aXZlR2V0VmFsdWUoSk5JRW52KiBlbnYsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGpvYmplY3QgdGhpeiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAganN0cmluZyBrZXkpIHsKKyAgTmF0aXZlUHJvZ3JhbSogcHJvZ3JhbSA9IENvbnZlcnRGcm9tSmF2YTxOYXRpdmVQcm9ncmFtPihlbnYsIHRoaXopOworICBjb25zdCBzdGQ6OnN0cmluZyBjX2tleSA9IFRvQ3BwU3RyaW5nKGVudiwga2V5KTsKKyAgaWYgKHByb2dyYW0pIHsKKyAgICByZXR1cm4gVG9KU3RyaW5nKGVudiwgcHJvZ3JhbS0+Q2FsbEdldFZhbHVlKGNfa2V5KSk7CisgIH0KKyAgcmV0dXJuIEpOSV9GQUxTRTsKK30KKworamJvb2xlYW4gSmF2YV9hbmRyb2lkX2ZpbHRlcmZ3X2NvcmVfTmF0aXZlUHJvZ3JhbV9jYWxsTmF0aXZlUHJvY2VzcyhKTklFbnYqIGVudiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgam9iamVjdCB0aGl6LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBqb2JqZWN0QXJyYXkgaW5wdXRzLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBqb2JqZWN0IG91dHB1dCkgeworICBOYXRpdmVQcm9ncmFtKiBwcm9ncmFtID0gQ29udmVydEZyb21KYXZhPE5hdGl2ZVByb2dyYW0+KGVudiwgdGhpeik7CisKKyAgLy8gU2FuaXR5IGNoZWNrcworICBpZiAoIXByb2dyYW0gfHwgIWlucHV0cykgeworICAgIHJldHVybiBKTklfRkFMU0U7CisgIH0KKworICAvLyBHZXQgdGhlIGlucHV0IGJ1ZmZlcnMKKyAgY29uc3QgaW50IGlucHV0X2NvdW50ID0gZW52LT5HZXRBcnJheUxlbmd0aChpbnB1dHMpOworICBzdGQ6OnZlY3Rvcjxjb25zdCBjaGFyKj4gaW5wdXRfYnVmZmVycyhpbnB1dF9jb3VudCwgTlVMTCk7CisgIHN0ZDo6dmVjdG9yPGludD4gaW5wdXRfc2l6ZXMoaW5wdXRfY291bnQsIDApOworICBmb3IgKGludCBpID0gMCA7IGkgPCBpbnB1dF9jb3VudDsgKytpKSB7CisgICAgY29uc3QgY2hhciogaW5wdXRfZGF0YSA9IE5VTEw7CisgICAgaW50IGlucHV0X3NpemUgPSAwOworICAgIGpvYmplY3QgaW5wdXQgPSBlbnYtPkdldE9iamVjdEFycmF5RWxlbWVudChpbnB1dHMsIGkpOworICAgIGlmIChpbnB1dCkgeworICAgICAgICBOYXRpdmVGcmFtZSogbmF0aXZlX2ZyYW1lID0gQ29udmVydEZyb21KYXZhPE5hdGl2ZUZyYW1lPihlbnYsIGlucHV0KTsKKyAgICAgICAgaWYgKCFuYXRpdmVfZnJhbWUpIHsKKyAgICAgICAgICBBTE9HRSgiTmF0aXZlUHJvZ3JhbTogQ291bGQgbm90IGdyYWIgTmF0aXZlRnJhbWUgaW5wdXQgJWQhIiwgaSk7CisgICAgICAgICAgcmV0dXJuIEpOSV9GQUxTRTsKKyAgICAgICAgfQorICAgICAgICBpbnB1dF9kYXRhID0gcmVp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xlYW4gSk5JQ0FMTAorSmF2YV9hbmRyb2lkX2ZpbHRlcmZ3X2NvcmVfTmF0aXZlUHJvZ3JhbV9uYXRpdmVJbml0KEpOSUVudiogZW52LCBqb2JqZWN0IHRoaXopOworCitKTklFWFBPUlQgamJvb2xlYW4gSk5JQ0FMTAorSmF2YV9hbmRyb2lkX2ZpbHRlcmZ3X2NvcmVfTmF0aXZlUHJvZ3JhbV9vcGVuTmF0aXZlTGlicmFyeShKTklFbnYqIGVudiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgam9iamVjdCB0aGl6LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBqc3RyaW5nIGxpYl9uYW1lKTsKKworSk5JRVhQT1JUIGpib29sZWFuIEpOSUNBTEwKK0phdmFfYW5kcm9pZF9maWx0ZXJmd19jb3JlX05hdGl2ZVByb2dyYW1fYmluZEluaXRGdW5jdGlvbihKTklFbnYqIGVudiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBqb2JqZWN0IHRoaXosCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAganN0cmluZyBmdW5jX25hbWUpOworCitKTklFWFBPUlQgamJvb2xlYW4gSk5JQ0FMTAorSmF2YV9hbmRyb2lkX2ZpbHRlcmZ3X2NvcmVfTmF0aXZlUHJvZ3JhbV9iaW5kU2V0VmFsdWVGdW5jdGlvbihKTklFbnYqIGVudiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgam9iamVjdCB0aGl6LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBqc3RyaW5nIGZ1bmNfbmFtZSk7CisKK0pOSUVYUE9SVCBqYm9vbGVhbiBKTklDQUxMCitKYXZhX2FuZHJvaWRfZmlsdGVyZndfY29yZV9OYXRpdmVQcm9ncmFtX2JpbmRHZXRWYWx1ZUZ1bmN0aW9uKEpOSUVudiogZW52LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBqb2JqZWN0IHRoaXosCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGpzdHJpbmcgZnVuY19uYW1lKTsKKworSk5JRVhQT1JUIGpib29sZWFuIEpOSUNBTEwKK0phdmFfYW5kcm9pZF9maWx0ZXJmd19jb3JlX05hdGl2ZVByb2dyYW1fYmluZFByb2Nlc3NGdW5jdGlvbihKTklFbnYqIGVudiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBqb2JqZWN0IHRoaXosCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAganN0cmluZyBmdW5jX25hbWUpOworCitKTklFWFBPUlQgamJvb2xlYW4gSk5JQ0FMTAorSmF2YV9hbmRyb2lkX2ZpbHRlcmZ3X2NvcmVfTmF0aXZlUHJvZ3JhbV9iaW5kUmVzZXRGdW5jdGlvbihKTklFbnYqIGVudiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgam9iamVjdCB0aGl6LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBqc3RyaW5nIGZ1bmNfbmFtZSk7CisKK0pOSUVYUE9SVCBqYm9vbGVhbiBKTklDQUxMCitKYXZhX2FuZHJvaWRfZmlsdGVyZndfY29yZV9OYXRpdmVQcm9ncmFtX2JpbmRUZWFyZG93bkZ1bmN0aW9uKEpOSUVudiogZW52LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBqb2JqZWN0IHRoaXosCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGpzdHJpbmcgZnVuY19uYW1lKTsKKworSk5JRVhQT1JUIGpib29sZWFuIEpOSUNBTEwKK0phdmFfYW5kcm9pZF9maWx0ZXJmd19jb3JlX05hdGl2ZVByb2dyYW1fY2FsbE5hdGl2ZUluaXQoSk5JRW52KiBlbnYsIGpvYmplY3QgdGhpeik7CisKK0pOSUVYUE9SVCBqYm9vbGVhbiBKTklDQUxMCitKYXZhX2FuZHJvaWRfZmlsdGVyZndfY29yZV9OYXRpdmVQcm9ncmFtX2NhbGxOYXRpdmVTZXRWYWx1ZShKTklFbnYqIGVudiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGpvYmplY3QgdGhpeiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGpzdHJpbmcga2V5LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAganN0cmluZyB2YWx1ZSk7CisKK0pOSUVYUE9SVCBqc3RyaW5nIEpOSUNBTEwKK0phdmFfYW5kcm9pZF9maWx0ZXJmd19jb3JlX05hdGl2ZVByb2dyYW1fY2FsbE5hdGl2ZUdldFZhbHVlKEpOSUVudiogZW52LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgam9iamVjdCB0aGl6LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAganN0cmluZyBrZXkpOworCitKTklFWFBPUlQgamJvb2xlYW4gSk5JQ0FMTAorSmF2YV9hbmRyb2lkX2ZpbHRlcmZ3X2NvcmVf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Gl2ZS9jb3JlL2dsX2Vudi5oIgorI2luY2x1ZGUgIm5hdGl2ZS9jb3JlL2dsX2ZyYW1lLmgiCisjaW5jbHVkZSAibmF0aXZlL2NvcmUvc2hhZGVyX3Byb2dyYW0uaCIKKyNpbmNsdWRlICJuYXRpdmUvY29yZS92ZXJ0ZXhfZnJhbWUuaCIKKwordXNpbmcgYW5kcm9pZDo6ZmlsdGVyZnc6OkdMRW52OwordXNpbmcgYW5kcm9pZDo6ZmlsdGVyZnc6OkdMRnJhbWU7Cit1c2luZyBhbmRyb2lkOjpmaWx0ZXJmdzo6UG9pbnQ7Cit1c2luZyBhbmRyb2lkOjpmaWx0ZXJmdzo6UHJvZ3JhbVZhcjsKK3VzaW5nIGFuZHJvaWQ6OmZpbHRlcmZ3OjpRdWFkOwordXNpbmcgYW5kcm9pZDo6ZmlsdGVyZnc6OlNoYWRlclByb2dyYW07Cit1c2luZyBhbmRyb2lkOjpmaWx0ZXJmdzo6VmVydGV4RnJhbWU7CisKK2pib29sZWFuIEphdmFfYW5kcm9pZF9maWx0ZXJmd19jb3JlX1NoYWRlclByb2dyYW1fYWxsb2NhdGUoSk5JRW52KiBlbnYsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGpvYmplY3QgdGhpeiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgam9iamVjdCBnbF9lbnYsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGpzdHJpbmcgdmVydGV4X3NoYWRlciwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAganN0cmluZyBmcmFnbWVudF9zaGFkZXIpIHsKKyAgLy8gR2V0IHRoZSBHTEVudiBwb2ludGVyCisgIEdMRW52KiBnbF9lbnZfcHRyID0gQ29udmVydEZyb21KYXZh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yAgcmV0dXJuIHByb2dyYW0gPyBUb0pCb29sKHByb2dyYW0tPkNvbXBpbGVBbmRMaW5rKCkpIDogSk5JX0ZBTFNFOworfQorCitqYm9vbGVhbiBKYXZhX2FuZHJvaWRfZmlsdGVyZndfY29yZV9TaGFkZXJQcm9ncmFtX3NldFVuaWZvcm1WYWx1ZShKTklFbnYqIGVudiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGpvYmplY3QgdGhpeiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGpzdHJpbmcga2V5LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgam9iamVjdCB2YWx1ZSkgeworICBTaGFkZXJQcm9ncmFtKiBwcm9ncmFtID0gQ29udmVydEZyb21KYXZhPFNoYWRlclByb2dyYW0+KGVudiwgdGhpeik7CisgIGNvbnN0IFZhbHVlIGNfdmFsdWUgPSBUb0NWYWx1ZShlbnYsIHZhbHVlKTsKKyAgY29uc3Qgc3RkOjpzdHJpbmcgY19rZXkgPSBUb0NwcFN0cmluZyhlbnYsIGtleSk7CisgIGlmIChjX3ZhbHVlLnZhbHVlKSB7CisgICAgcmV0dXJuIFRvSkJvb2wocHJvZ3JhbSAmJiBwcm9ncmFtLT5TZXRVbmlmb3JtVmFsdWUoY19rZXksIGNfdmFsdWUpKTsKKyAgfSBlbHNlIHsKKyAgICBBTE9HRSgiU2hhZGVyUHJvZ3JhbTogQ291bGQgbm90IGNvbnZlcnQgamF2YSBvYmplY3QgdmFsdWUgcGFzc2VkIGZvciBrZXkgJyVzJyEiLCBjX2tleS5jX3N0cigpKTsKKyAgICByZXR1cm4gSk5JX0ZBTFNFOworICB9Cit9CisKK2pvYmplY3QgSmF2YV9hbmRyb2lkX2ZpbHRlcmZ3X2NvcmVfU2hhZGVyUHJvZ3JhbV9nZXRVbmlmb3JtVmFsdWUoSk5JRW52KiBlbnYsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGpvYmplY3QgdGhpeiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAganN0cmluZyBrZXkpIHsKKyAgU2hhZGVyUHJvZ3JhbSogcHJvZ3JhbSA9IENvbnZlcnRGcm9tSmF2YTxTaGFkZXJQcm9ncmFtPihlbnYsIHRoaXopOworICBjb25zdCBzdGQ6OnN0cmluZyBjX2tleSA9IFRvQ3BwU3RyaW5nKGVudiwga2V5KTsKKyAgcmV0dXJuIHByb2dyYW0gPyBUb0pPYmplY3QoZW52LCBwcm9ncmFtLT5HZXRVbmlmb3JtVmFsdWUoY19rZXkpKSA6IEpOSV9OVUxMOworfQorCitqYm9vbGVhbiBKYXZhX2FuZHJvaWRfZmlsdGVyZndfY29yZV9TaGFkZXJQcm9ncmFtX3NoYWRlclByb2Nlc3MoSk5JRW52KiBlbnYsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgam9iamVjdCB0aGl6LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGpvYmplY3RBcnJheSBpbnB1dHMsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgam9iamVjdCBvdXRwdXQpIHsKKyAgU2hhZGVyUHJvZ3JhbSogcHJvZ3JhbSA9IENvbnZlcnRGcm9tSmF2YTxTaGFkZXJQcm9ncmFtPihlbnYsIHRoaXopOworICBzdGQ6OnZlY3Rvcjxjb25zdCBHTEZyYW1lKj4gaW5wdXRfZnJhbWVzOworICBpZiAocHJvZ3JhbSAmJiBpbnB1dHMgJiY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cm4gSk5JX0ZBTFNFOworICAgIH0KKworICAgIHJldHVybiBKTklfVFJVRTsKKyAgfQorICByZXR1cm4gSk5JX0ZBTFNFOworfQorCitqb2JqZWN0IEphdmFfYW5kcm9pZF9maWx0ZXJmd19jb3JlX1NoYWRlclByb2dyYW1fbmF0aXZlQ3JlYXRlSWRlbnRpdHkoSk5JRW52KiBlbnYsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgamNsYXNzLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGpvYmplY3QgZ2xfZW52KSB7CisgIEdMRW52KiBnbF9lbnZfcHRyID0gQ29udmVydEZyb21KYXZhPEdMRW52PihlbnYsIGdsX2Vudik7CisgIFNoYWRlclByb2dyYW0qIHByb2dyYW0gPSBnbF9lbnZfcHRyID8gU2hhZGVyUHJvZ3JhbTo6Q3JlYXRlSWRlbnRpdHkoZ2xfZW52X3B0cikgOiBOVUxMOworICByZXR1cm4gcHJvZ3JhbSA/IFdyYXBOZXdPYmplY3RJbkphdmEocHJvZ3JhbSwgZW52LCBmYWxzZSkgOiBOVUxMOworfQorCitqYm9vbGVhbiBKYXZhX2FuZHJvaWRfZmlsdGVyZndfY29yZV9TaGFkZXJQcm9ncmFtX3NldFNvdXJjZVJlZ2lvbihKTklFbnYqIGVudiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGpvYmplY3QgdGhpeiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGpmbG9hdCB4MCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGpmbG9hdCB5MCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGpmbG9hdCB4MSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGpmbG9hdCB5MSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGpmbG9hdCB4MiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGpmbG9hdCB5MiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGpmbG9hdCB4MywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGpmbG9hdCB5MykgeworICBTaGFkZXJQcm9ncmFtKiBwcm9ncmFtID0gQ29udmVydEZyb21KYXZhPFNoYWRlclByb2dyYW0+KGVudiwgdGhpeik7CisgIGlmIChwcm9ncmFtKSB7CisgICAgcHJvZ3JhbS0+U2V0U291cmNlUmVnaW9uKFF1YWQoUG9pbnQoeDAsIHkwKSwgUG9pbnQoeDEsIHkxKSwgUG9pbnQoeDIsIHkyKSwgUG9pbnQoeDMsIHkzKSkpOworICAgIHJldHVybiBKTklfVFJVRTsKKyAgfQorICByZXR1cm4gSk5JX0ZBTFNFOworfQorCitqYm9vbGVhbiBKYXZhX2FuZHJvaWRfZmlsdGVyZndfY29yZV9TaGFkZXJQcm9ncmFtX3NldFRhcmdldFJlZ2lvbihKTklFbnYqIGVudiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGpvYmplY3QgdGhpeiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGpmbG9hdCB4MCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGpmbG9hdCB5MCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGpmbG9hdCB4MSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGpmbG9hdCB5MSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGpmbG9hdCB4MiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGpmbG9hdCB5MiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGpmbG9hdCB4MywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGpmbG9hdCB5MykgeworICBTaGFkZXJQcm9ncmFtKiBwcm9ncmFtID0gQ29udmVydEZyb21KYXZhPFNoYWRlclByb2dyYW0+KGVudiwgdGhpeik7CisgIGlmIChwcm9ncmFtKSB7CisgICAgcHJvZ3JhbS0+U2V0VGFyZ2V0UmVnaW9uKFF1YWQoUG9pbnQoeDAsIHkwKSwgUG9pbnQoeDEsIHkxKSwgUG9pbnQoeDIsIHkyKSwgUG9pbnQoeDMsIHkzKSkpOworICAgIHJldHVybiBKTklfVFJVRTsKKyAgfQorICByZXR1cm4gSk5JX0ZBTFNFOworfQorCitqYm9vbGVhbiBKYXZhX2FuZHJvaWRfZmlsdGVyZndfY29yZV9TaGFkZXJQcm9ncmFtX3NldFNoYWRlckNsZWFyc091dHB1dChKTklFbnYqIGVudiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGpvYmplY3QgdGhpeiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGpib29sZWFuIGNsZWFycykgeworICBTaGFkZXJQcm9ncmFtKiBwcm9ncmFtID0gQ29udmVydEZyb21KYXZhPFNoYWRlclByb2dyYW0+KGVudiwgdGhpeik7CisgIGlmIChwcm9ncmFtKSB7CisgICAgcHJvZ3JhbS0+U2V0Q2xlYXJzT3V0cHV0KFRvQ3BwQm9vbChjbGVhcnMpKTsKKyAgICByZXR1cm4gSk5JX1RSVUU7CisgIH0KKyAgcmV0dXJuIEpOSV9GQUxTRTsKK30KKworamJvb2xlYW4gSmF2YV9hbmRyb2lkX2ZpbHRlcmZ3X2NvcmVfU2hhZGVyUHJvZ3JhbV9zZXRTaGFkZXJCbGVuZEVuYWJsZWQoSk5JRW52KiBlbnYsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBqb2JqZWN0IHRoaXosCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBqYm9vbGVhbiBlbmFibGUpIHsKKyAgU2hhZGVyUHJvZ3JhbSogcHJvZ3JhbSA9IENvbnZlcnRGcm9tSmF2YTxTaGFkZXJQcm9ncmFtPihlbnYsIHRoaXopOworICBpZiAocHJvZ3JhbSkgeworICAgIHByb2dyYW0tPlNldEJsZW5kRW5hYmxlZChUb0NwcEJvb2woZW5hYmxlKSk7CisgICAgcmV0dXJuIEpOSV9UUlVFOworICB9CisgIHJldHVybiBKTklfRkFMU0U7Cit9CisKK2pib29sZWFuIEphdmFfYW5kcm9pZF9maWx0ZXJmd19jb3JlX1NoYWRlclByb2dyYW1fc2V0U2hhZGVyQmxlbmRGdW5jKEpOSUVudiogZW52LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgam9iamVjdCB0aGl6LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgamludCBzZmFjdG9yLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgamludCBkZmFjdG9yKSB7CisgIFNoYWRlclByb2dyYW0qIHByb2dyYW0gPSBDb252ZXJ0RnJvbUphdmE8U2hhZGVyUHJvZ3JhbT4oZW52LCB0aGl6KTsKKyAgaWYgKHByb2dyYW0pIHsKKyAgICBwcm9ncmFtLT5TZXRCbGVuZEZ1bmMoc2ZhY3RvciwgZGZhY3Rvcik7CisgICAgcmV0dXJuIEpOSV9UUlVFOworICB9CisgIHJldHVybiBKTklfRkFMU0U7Cit9CisKK2pib29sZWFuIEphdmFfYW5kcm9pZF9maWx0ZXJmd19jb3JlX1NoYWRlclByb2dyYW1fc2V0U2hhZGVyQ2xlYXJDb2xvcihKTklFbnYqIGVudiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBqb2JqZWN0IHRoaXosCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgamZsb2F0IHIsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgamZsb2F0IGcsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgamZsb2F0IGIpIHsKKyAgU2hhZGVyUHJvZ3JhbSogcHJvZ3JhbSA9IENvbnZlcnRGcm9tSmF2YTxTaGFkZXJQcm9ncmFtPihlbnYsIHRoaXopOworICBpZiAocHJvZ3JhbSkgeworICAgIHByb2dyYW0tPlNldENsZWFyQ29sb3IociwgZywgYiwgMS4wZik7CisgICAgcmV0dXJuIEpOSV9UUlVFOworICB9CisgIHJldHVybiBKTklfRkFMU0U7Cit9CisKK2pib29sZWFuIEphdmFfYW5kcm9pZF9maWx0ZXJmd19jb3JlX1NoYWRlclByb2dyYW1fc2V0U2hhZGVyRHJhd01vZGUoSk5JRW52KiBlbnYsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGpvYmplY3QgdGhpeiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgamludCBkcmF3X21vZGUpIHsKKyAgU2hhZGVyUHJvZ3JhbSogcHJvZ3JhbSA9IENvbnZlcnRGcm9tSmF2YTxTaGFkZXJQcm9ncmFtPihlbnYsIHRoaXopOworICBpZiAocHJvZ3JhbSkgeworICAgIHByb2dyYW0tPlNldERyYXdNb2RlKGRyYXdfbW9kZSk7CisgICAgcmV0dXJuIEpOSV9UUlVFOworICB9CisgIHJldHVybiBKTklfRkFMU0U7Cit9CisKK2pib29sZWFuIEphdmFfYW5kcm9pZF9maWx0ZXJmd19jb3JlX1NoYWRlclByb2dyYW1fc2V0U2hhZGVyVGlsZUNvdW50cyhKTklFbnYqIGVudiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBqb2JqZWN0IHRoaXosCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgamludCB4X2NvdW50LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGppbnQgeV9jb3VudCkgeworICBTaGFkZXJQcm9ncmFtKiBwcm9ncmFtID0gQ29udmVydEZyb21KYXZhPFNoYWRlclByb2dyYW0+KGVudiwgdGhpeik7CisgIGlmIChwcm9ncmFtKSB7CisgICAgcHJvZ3JhbS0+U2V0VGlsZUNvdW50cyh4X2NvdW50LCB5X2NvdW50KTsKKyAgICByZXR1cm4gSk5JX1RSVUU7CisgIH0KKyAgcmV0dXJuIEpOSV9GQUxTRTsKK30KKworamJvb2xlYW4gSmF2YV9hbmRyb2lkX2ZpbHRlcmZ3X2NvcmVfU2hhZGVyUHJvZ3JhbV9zZXRTaGFkZXJWZXJ0ZXhDb3VudChKTklFbnYqIGVudiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgam9iamVjdCB0aGl6LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBqaW50IHZlcnRleF9jb3VudCkgeworICBTaGFkZXJQcm9ncmFtKiBwcm9ncmFtID0gQ29udmVydEZyb21KYXZhPFNoYWRlclByb2dyYW0+KGVudiwgdGhpeik7CisgIGlmIChwcm9ncmFtKSB7CisgICAgcHJvZ3JhbS0+U2V0VmVydGV4Q291bnQodmVydGV4X2NvdW50KTsKKyAgICByZXR1cm4gSk5JX1RSVUU7CisgIH0KKyAgcmV0dXJuIEpOSV9GQUxTRTsKK30KKworamJvb2xlYW4gSmF2YV9hbmRyb2lkX2ZpbHRlcmZ3X2NvcmVfU2hhZGVyUHJvZ3JhbV9iZWdpblNoYWRlckRyYXdpbmcoSk5JRW52KiBlbnYsIGpvYmplY3QgdGhpeikgeworICAgIFNoYWRlclByb2dyYW0qIHByb2dyYW0gPSBDb252ZXJ0RnJvbUphdmE8U2hhZGVyUHJvZ3JhbT4oZW52LCB0aGl6KTsKKyAgICByZXR1cm4gVG9KQm9vbChwcm9ncmFtICYmIHByb2dyYW0tPkJlZ2luRHJhdygpKTsKK30K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cmV0X2Nhc3Q8ZmxvYXQqPihmbG9hdF9wdHIpLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxlbmd0aCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb21wb25lbnRfY291bnQpOworICAgICAgZW52LT5SZWxlYXNlRmxvYXRBcnJheUVsZW1lbnRzKHZhbHVlcywgZmxvYXRfcHRyLCBKTklfQUJPUlQpOworICAgICAgcmV0dXJuIFRvSkJvb2woc3VjY2Vzcyk7CisgICAgfQorICB9CisgIHJldHVybiBKTklfRkFMU0U7Cit9CisKK2pib29sZWFuIEphdmFfYW5kcm9pZF9maWx0ZXJmd19jb3JlX1NoYWRlclByb2dyYW1fc2V0U2hhZGVyQXR0cmlidXRlVmVydGV4RnJhbWUoCisgICAgSk5JRW52KiBlbnYsCisgICAgam9iamVjdCB0aGl6LAorICAgIGpzdHJpbmcgYXR0cl9uYW1lLAorICAgIGpvYmplY3QgdmVydGV4X2ZyYW1lLAorICAgIGppbnQgdHlwZSwKKyAgICBqaW50IGNvbXBvbmVudF9jb3VudCwKKyAgICBqaW50IHN0cmlkZSwKKyAgICBqaW50IG9mZnNldCwKKyAgICBqYm9vbGVhbiBub3JtYWxpemUpIHsKKyAgU2hhZGVyUHJvZ3JhbSogcHJvZ3JhbSA9IENvbnZlcnRGcm9tSmF2YTxTaGFkZXJQcm9ncmFtPihlbnYsIHRoaXopOworICBpZiAocHJvZ3JhbSkgeworICAgIC8vIEdldCB0aGUgdmVydGV4IGZyYW1lCisgICAgVmVydGV4RnJhbWUqIHZfZnJhbWUgPSBDb252ZXJ0RnJvbUphdmE8VmVydGV4RnJhbWU+KGVudiwgdmVydGV4X2ZyYW1lKTsKKworICAgIC8vIEdldCB0aGUgcHJvZ3JhbSB2YXJpYWJsZSB0byBzZXQKKyAgICBjb25zdCBzdGQ6OnN0cmluZyBhdHRyX3N0cmluZyA9IFRvQ3BwU3RyaW5nKGVudiwgYXR0cl9uYW1lKTsKKyAgICBQcm9ncmFtVmFyIHByb2dyYW1fdmFyID0gcHJvZ3JhbS0+R2V0QXR0cmlidXRlKGF0dHJfc3RyaW5nKTsKKworICAgIC8vIFNldCB0aGUgdmFyaWFibGUKKyAgICBpZiAodl9mcmFtZSAmJiBTaGFkZXJQcm9ncmFtOjpJc1ZhclZhbGlkKHByb2dyYW1fdmFyKSkgeworICAgICAgY29uc3QgYm9vbCBzdWNjZXNzID0gcHJvZ3JhbS0+U2V0QXR0cmlidXRlVmFsdWVzKHByb2dyYW1fdmFyLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZfZnJhbWUsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdHlwZSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb21wb25lbnRfY291bnQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc3RyaWRlLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG9mZnNldCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBUb0NwcEJvb2wobm9ybWFsaXplKSk7CisgICAgICByZXR1cm4gVG9KQm9vbChzdWNjZXNzKTsKKyAgICB9CisgIH0KKyAgcmV0dXJuIEpOSV9GQUxTRTsKK30KZGlmZiAtLWdpdCBhL21lZGlhL21jYS9maWx0ZXJmdy9qbmkvam5pX3NoYWRlcl9wcm9ncmFtLmggYi9tZWRpYS9tY2EvZmlsdGVyZncvam5pL2puaV9zaGFkZXJfcHJvZ3JhbS5oCm5ldyBmaWxlIG1vZGUgMTAwNjQ0CmluZGV4IDAwMDAwMDAuLjk0YTFkZDQKLS0tIC9kZ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1ZGUgPGpuaS5oPgorCisjaW5jbHVkZSAibmF0aXZlL2NvcmUvdmFsdWUuaCIKKworI2lmZGVmIF9fY3BsdXNwbHVzCitleHRlcm4gIkMiIHsKKyNlbmRpZgorCitKTklFWFBPUlQgamJvb2xlYW4gSk5JQ0FMTAorSmF2YV9hbmRyb2lkX2ZpbHRlcmZ3X2NvcmVfU2hhZGVyUHJvZ3JhbV9hbGxvY2F0ZShKTklFbnYqIGVudiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgam9iamVjdCB0aGl6LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBqb2JqZWN0IGdsX2VudiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAganN0cmluZyB2ZXJ0ZXhfc2hhZGVyLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBqc3RyaW5nIGZyYWdtZW50X3NoYWRlcik7CisKK0pOSUVYUE9SVCBqYm9vbGVhbiBKTklDQUxMCitKYXZhX2FuZHJvaWRfZmlsdGVyZndfY29yZV9TaGFkZXJQcm9ncmFtX2RlYWxsb2NhdGUoSk5JRW52KiBlbnYsIGpvYmplY3QgdGhpeik7CisKK0pOSUVYUE9SVCBqYm9vbGVhbiBKTklDQUxMCitKYXZhX2FuZHJvaWRfZmlsdGVyZndfY29yZV9TaGFkZXJQcm9ncmFtX2NvbXBpbGVBbmRMaW5rKEpOSUVudiogZW52LCBqb2JqZWN0IHRoaXopOworCitKTklFWFBPUlQgamJvb2xlYW4gSk5JQ0FMTAorSmF2YV9hbmRyb2lkX2ZpbHRlcmZ3X2NvcmVfU2hhZGVyUHJvZ3JhbV9zZXRVbmlmb3JtVmFsdWUoSk5JRW52KiBlbnYsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBqb2JqZWN0IHRoaXosCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBqc3RyaW5nIGtleSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGpvYmplY3QgdmFsdWUpOworCitKTklFWFBPUlQgam9iamVjdCBKTklDQUxMCitKYXZhX2FuZHJvaWRfZmlsdGVyZndfY29yZV9TaGFkZXJQcm9ncmFtX2dldFVuaWZvcm1WYWx1ZShKTklFbnYqIGVudiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGpvYmplY3QgdGhpeiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGpzdHJpbmcga2V5KTsKKworSk5JRVhQT1JUIGpib29sZWFuIEpOSUNBTEwKK0phdmFfYW5kcm9pZF9maWx0ZXJmd19jb3JlX1NoYWRlclByb2dyYW1fc2hhZGVyUHJvY2VzcyhKTklFbnYqIGVudiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBqb2JqZWN0IHRoaXosCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgam9iamVjdEFycmF5IGlucHV0cywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBqb2JqZWN0IG91dHB1dCk7CisKK0pOSUVYUE9SVCBqb2JqZWN0IEpOSUNBTEwKK0phdmFfYW5kcm9pZF9maWx0ZXJmd19jb3JlX1NoYWRlclByb2dyYW1fbmF0aXZlQ3JlYXRlSWRlbnRpdHkoSk5JRW52KiBlbnYsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGpjbGFzcyBjbGF6eiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgam9iamVjdCBnbF9lbnYpOworCitKTklFWFBPUlQgamJvb2xlYW4gSk5JQ0FMTAorSmF2YV9hbmRyb2lkX2ZpbHRlcmZ3X2NvcmVfU2hhZGVyUHJvZ3JhbV9zZXRTb3VyY2VSZWdpb24oSk5JRW52KiBlbnYsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBqb2JqZWN0IHRoaXosCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBqZmxvYXQgeDAsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBqZmxvYXQgeTAsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBqZmxvYXQgeDEsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBqZmxvYXQgeTEsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBqZmxvYXQgeDIsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBqZmxvYXQgeTIsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBqZmxvYXQgeDMsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBqZmxvYXQgeTMpOworCitKTklFWFBPUlQgamJvb2xlYW4gSk5JQ0FMTAorSmF2YV9hbmRyb2lkX2ZpbHRlcmZ3X2NvcmVfU2hhZGVyUHJvZ3JhbV9zZXRUYXJnZXRSZWdpb24oSk5JRW52KiBlbnYsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBqb2JqZWN0IHRoaXosCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBqZmxvYXQgeDAsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBqZmxvYXQgeTAsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBqZmxvYXQgeDEsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBqZmxvYXQgeTEsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBqZmxvYXQgeDIsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBqZmxvYXQgeTIsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBqZmxvYXQgeDMsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBqZmxvYXQgeTMpOworCitKTklFWFBPUlQgamJvb2xlYW4gSk5JQ0FMTAorSmF2YV9hbmRyb2lkX2ZpbHRlcmZ3X2NvcmVfU2hhZGVyUHJvZ3JhbV9zZXRTaGFkZXJDbGVhcnNPdXRwdXQoSk5JRW52KiBlbnYsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBqb2JqZWN0IHRoaXosCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBqYm9vbGVhbiBjbGVhcnMpOworCitKTklFWFBPUlQgamJvb2xlYW4gSk5JQ0FMTAorSmF2YV9hbmRyb2lkX2ZpbHRlcmZ3X2NvcmVfU2hhZGVyUHJvZ3JhbV9zZXRTaGFkZXJDbGVhckNvbG9yKEpOSUVudiogZW52LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGpvYmplY3QgdGhpeiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBqZmxvYXQgciwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBqZmxvYXQgZywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBqZmxvYXQgYik7CisKK0pOSUVYUE9SVCBqYm9vbGVhbiBKTklDQUxMCitKYXZhX2FuZHJvaWRfZmlsdGVyZndfY29yZV9TaGFkZXJQcm9ncmFtX3NldFNoYWRlckJsZW5kRW5hYmxlZChKTklFbnYqIGVudiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGpvYmplY3QgdGhpeiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGpib29sZWFuIGVuYWJsZSk7CisKK0pOSUVYUE9SVCBqYm9vbGVhbiBKTklDQUxMCitKYXZhX2FuZHJvaWRfZmlsdGVyZndfY29yZV9TaGFkZXJQcm9ncmFtX3NldFNoYWRlckJsZW5kRnVuYyhKTklFbnYqIGVudiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGpvYmplY3QgdGhpeiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGppbnQgc2ZhY3RvciwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGppbnQgZGZhY3Rvcik7CitKTklFWFBPUlQgamJvb2xlYW4gSk5JQ0FMTAorSmF2YV9hbmRyb2lkX2ZpbHRlcmZ3X2NvcmVfU2hhZGVyUHJvZ3JhbV9zZXRTaGFkZXJEcmF3TW9kZShKTklFbnYqIGVudiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgam9iamVjdCB0aGl6LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBqaW50IGRyYXdfbW9kZSk7CisKK0pOSUVYUE9SVCBqYm9vbGVhbiBKTklDQUxMCitKYXZhX2FuZHJvaWRfZmlsdGVyZndfY29yZV9TaGFkZXJQcm9ncmFtX3NldFNoYWRlclRpbGVDb3VudHMoSk5JRW52KiBlbnYsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgam9iamVjdCB0aGl6LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGppbnQgeF9jb3VudCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBqaW50IHlfY291bnQpOworCitKTklFWFBPUlQgamJvb2xlYW4gSk5JQ0FMTAorSmF2YV9hbmRyb2lkX2ZpbHRlcmZ3X2NvcmVfU2hhZGVyUHJvZ3JhbV9zZXRTaGFkZXJWZXJ0ZXhDb3VudChKTklFbnYqIGVudiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgam9iamVjdCB0aGl6LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBqaW50IHZlcnRleF9jb3VudCk7CisKK0pOSUVYUE9SVCBqYm9vbGVhbiBKTklDQUxMCitKYXZhX2FuZHJvaWRfZmlsdGVyZndfY29yZV9TaGFkZXJQcm9ncmFtX2JlZ2luU2hhZGVyRHJhd2luZyhKTklFbnYqIGVudiwgam9iamVjdCB0aGl6KTsKKworSk5JRVhQT1JUIGpib29sZWFuIEpOSUNBTEwKK0phdmFfYW5kcm9pZF9maWx0ZXJmd19jb3JlX1NoYWRlclByb2dyYW1fc2V0U2hhZGVyQXR0cmlidXRlVmFsdWVzKEpOSUVudiogZW52LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgam9iamVjdCB0aGl6LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAganN0cmluZyBhdHRyX25hbWUsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBqZmxvYXRBcnJheSB2YWx1ZXMsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBqaW50IGNvbXBvbmVudF9jb3VudCk7CisKK0pOSUVYUE9SVCBqYm9vbGVhbiBKTklDQUxMCitKYXZhX2FuZHJvaWRfZmlsdGVyZndfY29yZV9TaGFkZXJQcm9ncmFtX3NldFNoYWRlckF0dHJpYnV0ZVZlcnRleEZyYW1lKEpOSUVudiogZW52LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBqb2JqZWN0IHRoaXosCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGpzdHJpbmcgYXR0cl9uYW1lLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBqb2JqZWN0IHZlcnRleF9mcmFtZSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgamludCB0eXBlLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBqaW50IGNvbXBvbmVudF9jb3VudCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgamludCBzdHJpZGUsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGppbnQgb2Zmc2V0LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBqYm9vbGVhbiBub3JtYWxpemUpOworCisjaWZkZWYgX19jcGx1c3BsdXMKK30KKyNlbmRpZgorCisjZW5kaWYgLy8gQU5EUk9JRF9GSUxURVJGV19KTklfU0hBREVSX1BST0dSQU1fSApkaWZmIC0tZ2l0IGEvbWVkaWEvbWNhL2ZpbHRlcmZ3L2puaS9qbmlfdXRpbC5jcHAgYi9tZWRpYS9tY2EvZmlsdGVyZncvam5pL2puaV91dGlsLmNwcApuZXcgZmlsZSBtb2RlIDEwMDY0NAppbmRleCAwMDAwMDAwLi4zMGMwODk4Ci0tLSAvZGV2L251bGwKKysrIGIvbWVkaWEvbWNhL2ZpbHRlcmZ3L2puaS9qbmlfdXRpbC5jcHAKQEAgLTAsMCArMSwxODggQEAKKy8qCisgKiBDb3B5cmlnaHQgKEMpIDIwMTEgVGhlIEFuZHJvaWQgT3BlbiBTb3VyY2UgUHJvamVjdAorICoKKyAqIExpY2Vuc2VkIHVuZGVyIHRoZSBBcGFjaGUgTGljZW5zZSwgVmVyc2lvbiAyLjAgKHRoZSAiTGljZW5zZSIpOworICogeW91IG1heSBub3QgdXNlIHRoaXMgZmlsZSBleGNlcHQgaW4gY29tcGxpYW5jZSB3aXRo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OVUxMKSwKKyAgICAgIHJlZl9jb3VudF8obmV3IGludCgwKSkgeworICBSZXRhaW4oKTsKKyAgb2JqZWN0XyA9IGVudi0+TmV3R2xvYmFsUmVmKG9iamVjdF8pOworfQorCitKYXZhT2JqZWN0Ojp+SmF2YU9iamVjdCgpIHsKKyAgUmVsZWFzZSgpOworfQorCitKYXZhT2JqZWN0JiBKYXZhT2JqZWN0OjpvcGVyYXRvcj0oY29uc3QgSmF2YU9iamVjdCYgamF2YV9vYmopIHsKKyAgUmVsZWFzZSgpOworICBvYmplY3RfID0gamF2YV9vYmoub2JqZWN0XzsKKyAgcmVmX2NvdW50XyA9IGphdmFfb2JqLnJlZl9jb3VudF87CisgIFJldGFpbigpOworICByZXR1cm4gKnRoaXM7Cit9CisKK3ZvaWQgSmF2YU9iamVjdDo6UmV0YWluKCkgeworICBpZiAocmVmX2NvdW50XykKKyAgICArKygqcmVmX2NvdW50Xyk7CisgIGVsc2UKKyAgICBBTE9HRSgiSmF2YU9iamVjdDogUmVmZXJlbmNlIGNvdW50IGlzIE5VTEwhIEphdmFPYmplY3QgbWF5IGJlIGNvcnJ1cHRlZC4iKTsKK30KKwordm9pZCBKYXZhT2JqZWN0OjpSZWxlYXNlKCkgeworICBpZiAocmVmX2NvdW50XykgeworICAgIGlmICgqcmVmX2NvdW50XyA+IDApCisgICAgICAtLSgqcmVmX2NvdW50Xyk7CisgICAgaWYgKCpyZWZfY291bnRfID09IDApIHsKKyAgICAgIEpOSUVudiogZW52ID0gR2V0Q3VycmVudEpOSUVudigpOworICAgICAgaWYgKCFlbnYpCisgICAgICAgIEFMT0dFKCJKYXZhT2JqZWN0OiBSZWxlYXNpbmcgb3V0c2lkZSBvZiBKYXZhIHRocmVhZC4gV2lsbCBqdXN0IGxlYWshIik7CisgICAgICBlbHNlIGlmIChvYmplY3RfKQorICAgICAgICBlbnYtPkRlbGV0ZUdsb2JhbFJlZihvYmplY3RfKTsKKyAgICAgIGRlbGV0ZSByZWZfY291bnRfOworIC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50QXJyYXk+KHJlc3VsdCksCisgICAgICAgICAgICAgICAgICAgICAgICAgICAwLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgR2V0VmFsdWVDb3VudCh2YWx1ZSksCisgICAgICAgICAgICAgICAgICAgICAgICAgICByZWludGVycHJldF9jYXN0PGNvbnN0IGppbnQqPihHZXRJbnRBcnJheVZhbHVlKHZhbHVlKSkpOworICB9IGVsc2UgaWYgKFZhbHVlSXNGbG9hdEFycmF5KHZhbHVlKSkgeworICAgIHJlc3VsdCA9IGVudi0+TmV3RmxvYXRBcnJheShHZXRWYWx1ZUNvdW50KHZhbHVlKSk7CisgICAgZW52LT5TZXRGbG9hdEFycmF5UmVnaW9uKHN0YXRpY19jYXN0PGpmbG9hdEFycmF5PihyZXN1bHQpLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAwLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICBHZXRWYWx1ZUNvdW50KHZhbHVlKSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmVpbnRlcnByZXRfY2FzdDxjb25zdCBqZmxvYXQqPihHZXRGbG9hdEFycmF5VmFsdWUodmFsdWUpKSk7CisgIH0KKyAgcmV0dXJuIHJlc3VsdDsKK30KZGlmZiAtLWdpdCBhL21lZGlhL21jYS9maWx0ZXJmdy9qbmkvam5pX3V0aWwuaCBiL21lZGlhL21jYS9maWx0ZXJmdy9qbmkvam5pX3V0aWwuaApuZXcgZmlsZSBtb2RlIDEwMDY0NAppbmRleCAwMDAwMDAwLi42OGZmNjUzCi0tLSAvZGV2L251bGwKKysrIGIvbWVkaWEvbWNhL2ZpbHRlcmZ3L2puaS9qbmlfdXRpbC5oCkBAIC0wLDAgKzEsMjgzIEBACisvKgorICogQ29weXJpZ2h0IChDKSAyMDExIFRoZSBBbmRyb2lkIE9wZW4gU291cmNlIFByb2plY3QKKyAqCisgKiBMaWNlbnNlZCB1bmRlciB0aGUgQXBhY2hlIExpY2Vuc2UsIFZlcnNpb24gMi4w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4gdGhlIGdpdmVuIEpOSSBlbnZpcm9ubWVudC4KKyAgICBKYXZhT2JqZWN0KGpvYmplY3Qgb2JqZWN0LCBKTklFbnYqIGVudik7CisKKyAgICAvLyBDb3B5IGNvbnN0cnVjdG9yLgorICAgIEphdmFPYmplY3QoY29uc3QgSmF2YU9iamVjdCYgamF2YV9vYmopOworCisgICAgLy8gRGVzdHJ1Y3Rvci4KKyAgICB+SmF2YU9iamVjdCgpOworCisgICAgLy8gQXNzaWdubWVudCBvcGVyYXRvci4KKyAgICBKYXZhT2JqZWN0JiBvcGVyYXRvcj0oY29uc3QgSmF2YU9iamVjdCYgamF2YV9vYmopOworCisgICAgLy8gQWNjZXNzIHRvIHRoZSBvYmplY3QgKG5vbi1jb25zdCBhcyBKTkkgZnVuY3Rpb25zIGFyZSBub24tY29uc3QpLgorICAgIGpvYmplY3Qgb2JqZWN0KCkgY29uc3QgeworICAgICAgcmV0dXJuIG9iamVjdF87CisgICAgfQorCisgICAgLy8gUmVzZXRzIHRoaXMgb2JqZWN0IHRvIHRoZSBOVUxMIEphdmFPYmplY3QuCisgICAgdm9pZCBSZXNldCgpOworCisgIHByaXZhdGU6CisgICAgLy8gUmV0YWluIHRoZSBpbnN0YW5jZSwgaS5lLiBpbmNyZWFzZSByZWZlcmVuY2UgY291bnQuCisgICAgdm9pZCBSZXRhaW4oKTsKKworICAgIC8vIFJlbGVhc2UgdGhlIGluc3RhbmNlLCBpLmUuIGRlY3JlYXNlIHJlZmVyZW5jZSBjb3VudC4KKyAgICB2b2lkIFJlbGVhc2UoKTsKKworICAgIC8vIFRoZSBvYmplY3QgcG9pbnRlciAobm90IG93bmVkKS4KKyAgICBqb2JqZWN0IG9iamVjdF87CisKKyAgICAvLyBUaGUgcmVmZXJlbmNlIGNvdW50IG9mIHRoaXMgb2JqZWN0CisgICAgaW50KiByZWZfY291bnRfOworfTsKKyNlbmRpZgorCisvLyBPYmplY3RQb29sIHRlbXBsYXRlIGNsYXNzLiBUaGlzIGNsY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YmplY3QuIFRoaXMgSUQgY2FuIGJlIHVzZWQgdG8gbG9vay11cCB0aGUgQysrCisgICAgLy8gb2JqZWN0LgorICAgIGludCBHZXRPYmplY3RJRChKTklFbnYqIGVudiwgam9iamVjdCBqX29iamVjdCkgeworICAgICAgamNsYXNzIGNscyA9IGVudi0+R2V0T2JqZWN0Q2xhc3Moal9vYmplY3QpOworICAgICAgamZpZWxkSUQgaWRfZmllbGQgPSBlbnYtPkdldEZpZWxkSUQoY2xzLCBpZF9maWVsZF9uYW1lXy5jX3N0cigpLCAiSSIpOworICAgICAgY29uc3QgaW50IHJlc3VsdCA9IGVudi0+R2V0SW50RmllbGQoal9vYmplY3QsIGlkX2ZpZWxkKTsKKyAgICAgIGVudi0+RGVsZXRlTG9jYWxSZWYoY2xzKTsKKyAgICAgIHJldHVybiByZXN1bHQ7CisgICAgfQorCisgICAgLy8gVGFrZSBhIEMrKyBvYmplY3QgYW5kIHdyYXAgaXQgd2l0aCBhIGdpdmVuIEphdmEgb2JqZWN0LiBUaGlzIHdpbGwKKyAgICAvLyBlc3NlbnRpYWxseSBzZXQgdGhlIElEIG1lbWJlciBvZiB0aGUgSmF2YSBvYmplY3QgdG8gdGhlIElEIG9mIHRoZSBDKysKKyAgICAvLyBvYmplY3QuIFBhc3MgdHJ1ZSB0byBvd25zIGlmIHRoZSBvYmplY3QgcG9vbCBvd25zIHRoZSBvYmplY3QuCisgICAgYm9vbCBXcmFwT2JqZWN0KFQqIGNfb2JqZWN0LCBKTklFbnYqIGVudiwgam9iamVjdCBqX29iamVjdCwgYm9vbCBvd25zKSB7CisgICAgICBjb25zdCBpbnQgaWQgPSBSZWdpc3Rlck9iamVjdChjX29iamVjdCwgb3ducyk7CisgICAgICBqY2xhc3MgY2xzID0gZW52LT5HZXRPYmplY3RDbGFzcyhqX29iamVjdCk7CisgICAgICBqZmllbGRJRCBpZF9maWVsZCA9IGVudi0+R2V0RmllbGRJRChjbHMsIGlkX2ZpZWxkX25hbWVfLmNfc3R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zLAorICAgICAgICAiPGluaXQ+IiwKKyAgICAgICAgIihMYW5kcm9pZC9maWx0ZXJmdy9jb3JlL05hdGl2ZUFsbG9jYXRvclRhZzspViIpOworICAgICAgam9iamVjdCByZXN1bHQgPSBlbnYtPk5ld09iamVjdChjbHMsIGNvbnN0cnVjdG9yLCBKTklfTlVMTCk7CisgICAgICBlbnYtPkRlbGV0ZUxvY2FsUmVmKGNscyk7CisgICAgICByZXR1cm4gcmVzdWx0OworICAgIH0KKworICAgIGludCBHZXRPYmplY3RDb3VudCgpIGNvbnN0IHsKKyAgICAgIHJldHVybiBvYmplY3RzXy5zaXplKCk7CisgICAgfQorCisgICAgY29uc3Qgc3RkOjpzdHJpbmcmIEdldEphdmFDbGFzc05hbWUoKSBjb25zdCB7CisgICAgICByZXR1cm4gamNsYXNzX25hbWVfOworICAgIH0KKworICBwcml2YXRlOgorICAgIGV4cGxpY2l0IE9iamVjdFBvb2woY29uc3Qgc3RkOjpzdHJpbmcmIGpjbGFzc19uYW1lLAorICAgICAgICAgICAgICAgICAgICAgICAgY29uc3Qgc3RkOjpzdHJpbmcmIGlkX2ZsZF9uYW1lKQorICAgICAgOiBqY2xhc3NfbmFtZV8oamNsYXNzX25hbWUpLAorICAgICAgICBpZF9maWVsZF9uYW1lXyhpZF9mbGRfbmFtZSksCisgICAgICAgIG5leHRfaWRfKDApIHsgfQorCisgICAgdHlwZWRlZiBzdGQ6Omhhc2hfbWFwPGludCwgVCo+ICAgIENPYmpNYXA7CisgICAgdHlwZWRlZiBzdGQ6Omhhc2hfbWFwPGludCwgYm9vbD4gIEZsYWdNYXA7CisgICAgc3RhdGljIE9iamVjdFBvb2wqIGluc3RhbmNlXzsKKyAgICBzdGQ6OnN0cmluZyBqY2xhc3NfbmFtZV87CisgICAgc3RkOjpzdHJpbmcgaWRfZmllbGRfbmFtZV87CisgICAgaW50IG5leHRfaWRfOworICAgIENPYmpNYXAgb2JqZWN0c187CisgICAgRmxhZ01hcCBvd25zXzsKKworICAg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ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgam9iamVjdCB0aGl6LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgamludCBzaXplKSB7CisgIHJldHVybiBUb0pCb29sKFdyYXBPYmplY3RJbkphdmEobmV3IFZlcnRleEZyYW1lKHNpemUpLCBlbnYsIHRoaXosIHRydWUpKTsKK30KKworamJvb2xlYW4gSmF2YV9hbmRyb2lkX2ZpbHRlcmZ3X2NvcmVfVmVydGV4RnJhbWVfbmF0aXZlRGVhbGxvY2F0ZShKTklFbnYqIGVudiwgam9iamVjdCB0aGl6KSB7CisgIHJldHVybiBUb0pCb29sKERlbGV0ZU5hdGl2ZU9iamVjdDxWZXJ0ZXhGcmFtZT4oZW52LCB0aGl6KSk7Cit9CisKK2pib29sZWFuIEphdmFfYW5kcm9pZF9maWx0ZXJmd19jb3JlX1ZlcnRleEZyYW1lX3NldE5hdGl2ZUludHMoSk5JRW52KiBlbnYsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGpvYmplY3QgdGhpeiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgamludEFycmF5IGludHMpIHsKKworICBWZXJ0ZXhGcmFtZSogZnJhbWUgPSBDb252ZXJ0RnJvbUphdmE8VmVydGV4RnJhbWU+KGVudiwgdGhpeik7CisgIGlmIChmcmFtZSAmJiBpbnRzKSB7CisgICAgamludCogaW50X3B0ciA9IGVudi0+R2V0SW50QXJyYXlFbGVtZW50cyhpbnRzLCBOVUxMKTsKKyAgICBjb25zdCBpbnQgbGVuZ3RoID0gZW52LT5HZXRBcnJheUxlbmd0aChpbnRzKTsKKyAgICBpZiAoaW50X3B0cikgeworICAgICAgY29uc3QgYm9vbCBzdWNjZXNzID0gZnJhbWUtPldyaXRlRGF0YShyZWludGVycHJldF9jYXN0PGNvbnN0IHVpbnQ4X3QqPihpbnRfcHRyKSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbGVuZ3RoICogc2l6ZW9mKGppbnQpKTsKKyAgICAgIGVudi0+UmVsZWFzZUludEFycmF5RWxlbWVudHMoaW50cywgaW50X3B0ciwgSk5JX0FCT1JUKTsKKyAgICAgIHJldHVybiBUb0pCb29sKHN1Y2Nlc3MpOworICAgIH0KKyAgfQorICByZXR1cm4gSk5JX0ZBTFNFOworfQorCitqYm9vbGVhbiBKYXZhX2FuZHJvaWRfZmlsdGVyZndfY29yZV9WZXJ0ZXhGcmFtZV9zZXROYXRpdmVGbG9hdHMoSk5JRW52KiBlbnYsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgam9iamVjdCB0aGl6LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGpmbG9hdEFycmF5IGZsb2F0cykgeworICBWZXJ0ZXhGcmFtZSogZnJhbWUgPSBDb252ZXJ0RnJvbUphdmE8VmVydGV4RnJhbWU+KGVudiwgdGhpeik7CisgIGlmIChmcmFtZSAmJiBmbG9hdHMpIHsKKyAgICBqZmxvYXQqIGZsb2F0X3B0ciA9IGVudi0+R2V0RmxvYXRBcnJheUVsZW1lbnRzKGZsb2F0cywgTlVMTCk7CisgICAgY29uc3QgaW50IGxlbmd0aCA9IGVudi0+R2V0QXJyYXlMZW5ndGgoZmxvYXRzKTsKKyAgICBpZiAoZmxvYXRfcHRyKSB7CisgICAgICBjb25zdCBib29sIHN1Y2Nlc3MgPSBmcmFtZS0+V3JpdGVEYXRhKHJlaW50ZXJwcmV0X2Nhc3Q8Y29uc3QgdWludDhfdCo+KGZsb2F0X3B0ciksCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxlbmd0aCAqIHNpemVvZihqZmxvYXQpKTsKKyAgICAgIGVudi0+UmVsZWFzZUZsb2F0QXJyYXlFbGVtZW50cyhmbG9hdHMsIGZsb2F0X3B0ciwgSk5JX0FCT1JUKTsKKyAgICAgIHJldHVybiBUb0pCb29sKHN1Y2Nlc3MpOworICAgIH0KKyAgfQorICByZXR1cm4gSk5JX0ZBTFNFOworfQorCitqYm9vbGVhbiBKYXZhX2FuZHJvaWRfZmlsdGVyZndfY29yZV9WZXJ0ZXhGcmFtZV9zZXROYXRpdmVEYXRhKEpOSUVudiogZW52LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBqb2JqZWN0IHRoaXosCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGpieXRlQXJyYXkgZGF0YSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgamludCBvZmZzZXQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGppbnQgbGVuZ3RoKSB7CisgIFZlcnRleEZyYW1lKiBmcmFtZSA9IENvbnZlcnRGcm9tSmF2YTxWZXJ0ZXhGcmFtZT4oZW52LCB0aGl6KTsKKyAgaWYgKGZyYW1lICYmIGRhdGEpIHsKKyAgICBqYnl0ZSogYnl0ZXMgPSBlbnYtPkdldEJ5dGVBcnJheUVsZW1lbnRzKGRhdGEsIE5VTEwpOworICAgIGlmIChieXRlcykgeworICAgICAgY29uc3QgYm9vbCBzdWNjZXNzID0gZnJhbWUtPldyaXRlRGF0YShyZWludGVycHJldF9jYXN0PGNvbnN0IHVpbnQ4X3QqPihieXRlcyArIG9mZnNldCksCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxlbmd0aCk7CisgICAgICBlbnYtPlJlbGVhc2VCeXRlQXJyY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yYW1lX3NldE5hdGl2ZUludHMoSk5JRW52KiBlbnYsIGpvYmplY3QgdGhpeiwgamludEFycmF5IGludHMpOworCitKTklFWFBPUlQgamJvb2xlYW4gSk5JQ0FMTAorSmF2YV9hbmRyb2lkX2ZpbHRlcmZ3X2NvcmVfVmVydGV4RnJhbWVfc2V0TmF0aXZlRmxvYXRzKEpOSUVudiogZW52LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGpvYmplY3QgdGhpeiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBqZmxvYXRBcnJheSBmbG9hdHMpOworCitKTklFWFBPUlQgamJvb2xlYW4gSk5JQ0FMTAorSmF2YV9hbmRyb2lkX2ZpbHRlcmZ3X2NvcmVfVmVydGV4RnJhbWVfc2V0TmF0aXZlRGF0YShKTklFbnYqIGVudiwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgam9iamVjdCB0aGl6LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBqYnl0ZUFycmF5IGRhdGEsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGppbnQgb2Zmc2V0LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBqaW50IGxlbmd0aCk7CisKK0pOSUVYUE9SVCBqaW50IEpOSUNBTEwKK0phdmFfYW5kcm9pZF9maWx0ZXJmd19jb3JlX1ZlcnRleEZyYW1lX2dldE5hdGl2ZVZib0lkKEpOSUVudiogZW52LCBqb2JqZWN0IHRoaXopOworCisjaWZkZWYgX19jcGx1c3BsdXMKK30KKyNlbmRpZgorCisjZW5kaWYgLy8gQU5EUk9JRF9GSUxURVJGV19KTklfVkVSVEVYX0ZSQU1FX0gKZGlmZiAtLWdpdCBhL21lZ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gICBjb25maWcsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgRUdMX05PX0NPTlRFWFQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY29udGV4dF9hdHRyaWJzKTsKKyAgaWYgKENoZWNrRUdMRXJyb3IoImVnbENyZWF0ZUNvbnRleHQiKSkgcmV0dXJuIGZhbHNlOworCisgIGNyZWF0ZWRfY29udGV4dF8gPSBjcmVhdGVkX3N1cmZhY2VfID0gdHJ1ZTsKKworICByZXR1cm4gdHJ1ZTsKK30KKworYm9vbCBHTEVudjo6SXNBY3RpdmUoKSBjb25zdCB7CisgIEFMT0dWKCJJc0FjdGl2ZSgpIik7CisgIHJldHVybiBjb250ZXh0KCkgPT0gZWdsR2V0Q3VycmVudENvbnRleHQoKQorICAgICYmICAgZGlzcGxheSgpID09IGVnbEdldEN1cnJlbnREaXNwbGF5KCkKKyAgICAmJiAgIHN1cmZhY2UoKSA9PSBlZ2xHZXRDdXJyZW50U3VyZmFjZShFR0xfRFJBVyk7Cit9CisKK2Jvb2wgR0xFbnY6OklzQ29udGV4dEFjdGl2ZSgpIGNvbnN0IHsKKyAgcmV0dXJuIGNvbnRleHQoKSA9PSBlZ2xHZXRDdXJyZW50Q29udGV4dCgpOworfQorCitib29sIEdMRW52OjpJc0FueUNvbnRleHRBY3RpdmUoKSB7CisgIHJldHVybiBlZ2xHZXRDdXJyZW50Q29udGV4dCgpICE9IEVHTF9OT19DT05URVhUOworfQorCitpbnQgR0xFbnY6OkFkZFdpbmRvd1N1cmZhY2UoY29uc3QgRUdMU3VyZmFjZSYgc3VyZmFjZSwgV2luZG93SGFuZGxlKiB3aW5kb3dfaGFuZGxlKSB7CisgIGNvbnN0IGludCBpZCA9ICsrbWF4X3N1cmZhY2VfaWRfOworICBzdXJmYWNlc19baWRdID0gU3VyZmFjZVdpbmRvd1BhaXIoc3VyZmFjZSwgd2luZG93X2hhbmRsZSk7CisgIHJldHVybiBpZDsKK30KKworaW50IEdMRW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vjb25kKSB7CisgICAgICAgIHN1cmZhY2Vfd2luZG93X3BhaXItPnNlY29uZC0+RGVzdHJveSgpOworICAgICAgICBkZWxldGUgc3VyZmFjZV93aW5kb3dfcGFpci0+c2Vjb25kOworICAgICAgfQorICAgICAgc3VyZmFjZXNfLmVyYXNlKHN1cmZhY2VfaWQpOworICAgICAgcmV0dXJuIHRydWU7CisgICAgfQorICB9CisgIHJldHVybiBmYWxzZTsKK30KKworYm9vbCBHTEVudjo6U2V0U3VyZmFjZVRpbWVzdGFtcChpbnQ2NF90IHRpbWVzdGFtcCkgeworICBpZiAoc3VyZmFjZV9pZF8gPiAwKSB7CisgICAgY29uc3QgU3VyZmFjZVdpbmRvd1BhaXIqIHN1cmZhY2Vfd2luZG93X3BhaXIgPSBGaW5kT3JOdWxsKHN1cmZhY2VzXywKKyAgICAgICAgICAgIHN1cmZhY2VfaWRfKTsKKyAgICBpZiAoc3VyZmFjZV93aW5kb3dfcGFpcikgeworICAgICAgQU5hdGl2ZVdpbmRvdyAqd2luZG93ID0gc3RhdGljX2Nhc3Q8QU5hdGl2ZVdpbmRvdyo+KAorICAgICAgICAgICAgICBzdXJmYWNlX3dpbmRvd19wYWlyLT5zZWNvbmQtPkludGVybmFsSGFuZGxlKCkpOworICAgICAgbmF0aXZlX3dpbmRvd19zZXRfYnVmZmVyc190aW1lc3RhbXAod2luZG93LCB0aW1lc3RhbXApOworICAgICAgcmV0dXJuIHRydWU7CisgICAgfQorICB9CisgIHJldHVybiBmYWxzZTsKK30KKworaW50IEdMRW52OjpGaW5kU3VyZmFjZUlkRm9yV2luZG93KGNvbnN0IFdpbmRvd0hhbmRsZSogd2luZG93X2hhbmRsZSkgeworICBmb3IgKHN0ZDo6bWFwPGludCwgU3VyZmFjZVdpbmRvd1BhaXI+OjppdGVyYXRvciBpdCA9IHN1cmZhY2VzXy5iZWdpbigpOworICAgICAgIGl0ICE9IHN1cmZhY2VzXy5lbmQoKTsKKyAgICAgICArK2l0KSB7CisgICAgY29uc3QgV2luZG93SGFuZGxlKiBteV9oYW5kbGUgPSBpdC0+c2Vjb25kLnNlY29uZDsKKyAgICBpZiAobXlfaGFuZGxlICYmIG15X2hhbmRsZS0+RXF1YWxzKHdpbmRvd19oYW5kbGUpKSB7CisgICAgICByZXR1cm4gaXQtPmZpcnN0OworICAgIH0KKyAgfQorICByZXR1cm4gLTE7Cit9CisKKworaW50IEdMRW52OjpBZGRDb250ZXh0KGNvbnN0IEVHTENvbnRleHQmIGNvbnRleHQpIHsKKyAgY29uc3QgaW50IGlkID0gY29udGV4dHNfLnNpemUoKTsKKyAgY29udGV4dHNfW2lkXSA9IGNvbnRleHQ7CisgIHJldHVybiBpZDsKK30KKworYm9vbCBHTEVudjo6U3dpdGNoVG9Db250ZXh0SWQoaW50IGNvbnRleHRfaWQpIHsKKyAgY29uc3QgRUdMQ29udGV4dCogY29udGV4dCA9IEZpbmRPck51bGwoY29udGV4dHNfLCBjb250ZXh0X2lkKTsKKyAgaWYgKGNvbnRleHQpIHsKKyAgICBpZiAoY29udGV4dF9pZF8gIT0gY29udGV4dF9pZCkgeworICAgICAgY29udGV4dF9pZF8gPSBjb250ZXh0X2lkOworICAgICAgcmV0dXJuIEFjdGl2YXRlKCk7CisgICAgfQorICAgIHJldHVybiB0cnVlOworICB9CisgIHJldHVybiBmYWxzZTsKK30KKwordm9pZCBHTEVudjo6UmVsZWFzZUNvbnRleHRJZChpbnQgY29udGV4dF9pZCkgeworICBpZiAoY29udGV4dF9pZCA+IDApIHsKKyAgICBjb25zdCBFR0xDb250ZXh0KiBjb250ZXh0ID0gRmluZE9yTnVsbChjb250ZXh0c18sIGNvbnRleHRfaWQpOworICAgIGlmIChjb250ZXh0KSB7CisgICAgICBjb250ZXh0c18uZXJhc2UoY29udGV4dF9pZCk7CisgICAgICBpZiAoY29udGV4dF9pZF8gPT0gY29udGV4dF9pZCAmJiBJc0FjdGl2ZSgpKQorICAgICAgICBTd2l0Y2hUb0NvbnRleHRJZCgwKTsKKyAgICAgIGVnbERlc3Ryb3lDb250ZXh0KGRpc3BsYXkoKSwgKmNvbnRleHQpOworICAgIH0KKyAgfQorfQorCitib29sIEdMRW52OjpDaGVja0dMRXJyb3IoY29uc3Qgc3RkOjpzdHJpbmcmIG9wKSB7CisgIGJvb2wgZXJyID0gZmFsc2U7CisgIGZvciAoR0xpbnQgZXJyb3IgPSBnbEdldEVycm9yKCk7IGVycm9yOyBlcnJvciA9IGdsR2V0RXJyb3IoKSkgeworICAgIEFMT0dFKCJHTCBFcnJvcjogT3BlcmF0aW9uICclcycgY2F1c2VkIEdMIGVycm9yICgweCV4KVxuIiwKKyAgICAgICAgIG9wLmNfc3RyKCksCisgICAgICAgICBlcnJvcik7CisgICAgZXJyID0gdHJ1ZTsKKyAgfQorICByZXR1cm4gZXJyOworfQorCitib29sIEdMRW52OjpDaGVja0VHTEVycm9yKGNvbnN0IHN0ZDo6c3RyaW5nJiBvcCkgeworICBib29sIGVyciA9IGZhbHNlOworICBmb3IgKEVHTGludCBlcnJvciA9IGVnbEdldEVycm9yKCk7CisgICAgICAgZXJyb3IgIT0gRUdMX1NVQ0NFU1M7CisgICAgICAgZXJyb3IgPSBlZ2xHZXRFcnJvcigpKSB7CisgICAgQUxPR0UoIkVHTCBFcnJvcjogT3BlcmF0aW9uICclcycgY2F1c2VkIEVHTCBlcnJvciAoMHgleClcbiIsCisgICAgICAgICBvcC5jX3N0cigpLAorICAgICAgICAgZXJyb3IpOworICAgIGVyciA9IHRydWU7CisgIH0KKyAgcmV0dXJuIGVycjsKK30KKworYm9vbCBHTEVudjo6Q2hlY2tFR0xNYWtlQ3VycmVudEVycm9yKCkgeworICBib29sIGVyciA9IGZhbHNlOworICBmb3IgKEVHTGludCBlcnJvciA9IGVnbEdldEVycm9yKCk7CisgICAgICAgZXJyb3IgIT0gRUdMX1NVQ0NFU1M7CisgICAgICAgZXJyb3IgPSBlZ2xHZXRFcnJvcigpKSB7CisgICAgc3dpdGNoIChlcnJvcikgeworICAgICAgY2Fz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j4oZGxzeW0obGliX2hhbmRsZV8sIGZ1bmNfbmFtZS5jX3N0cigpKSk7CisgIHJldHVybiB0ZWFyZG93bl9mdW5jdGlvbl8gIT0gTlVMTDsKK30KKworYm9vbCBOYXRpdmVQcm9ncmFtOjpDYWxsUHJvY2Vzcyhjb25zdCBzdGQ6OnZlY3Rvcjxjb25zdCBjaGFyKj4mIGlucHV0cywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY29uc3Qgc3RkOjp2ZWN0b3I8aW50PiYgaW5wdXRfc2l6ZXMsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNoYXIqIG91dHB1dCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaW50IG91dHB1dF9zaXplKSB7CisgIGlmIChwcm9jZXNzX2Z1bmN0aW9uXykgeworICAgIHJldHVybiBwcm9jZXNzX2Z1bmN0aW9uXyhjb25zdF9jYXN0PGNvbnN0IGNoYXIqKj4oJmlucHV0c1swXSksCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICZpbnB1dF9zaXplc1swXSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaW5wdXRzLnNpemUoKSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgb3V0cHV0LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICBvdXRwdXRfc2l6ZSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdXNlcl9kYXRhXykgPT0gMTsKKyAgfQorICByZXR1cm4gZmFsc2U7Cit9CisKK2Jvb2wgTmF0aXZlUHJvZ3JhbTo6Q2FsbEluaXQoKSB7CisgIGlmIChpbml0X2Z1bmN0aW9uXykgeworICAgIGluaXRfZnVuY3Rpb25fKCZ1c2VyX2RhdGFfKTsKKyAgICByZXR1cm4gdHJ1ZTsKKyAgfQorICByZXR1cm4gZmFsc2U7Cit9CisKK2Jvb2wgTmF0aXZlUHJvZ3JhbTo6Q2FsbFNldFZhbHVlKGNvbnN0IHN0ZDo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cGUsIGVycm9yX2xvZyk7CisgICAgICAgICAgZGVsZXRlW10gZXJyb3JfbG9nOworICAgICAgICB9CisgICAgICB9CisgICAgICBnbERlbGV0ZVNoYWRlcihzaGFkZXIpOworICAgICAgc2hhZGVyID0gMDsKKyAgICB9CisgIH0KKyAgcmV0dXJuIHNoYWRlcjsKK30KKworR0x1aW50IFNoYWRlclByb2dyYW06OkxpbmtQcm9ncmFtKEdMdWludCogc2hhZGVycywgR0x1aW50IGNvdW50KSB7CisgIEdMdWludCBwcm9ncmFtID0gZ2xDcmVhdGVQcm9ncmFtKCk7CisgIGlmIChwcm9ncmFtKSB7CisgICAgLy8gQXR0YWNoIGFsbCBjb21waWxlZCBzaGFkZXJzCisgICAgZm9yIChHTHVpbnQgaSA9IDA7IGkgPCBjb3VudDsgKytpKSB7CisgICAgICBnbEF0dGFjaFNoYWRlcihwcm9ncmFtLCBzaGFkZXJzW2ldKTsKKyAgICAgIGlmIChHTEVudjo6Q2hlY2tHTEVycm9yKCJnbEF0dGFjaFNoYWRlciIpKSByZXR1cm4gMDsKKyAgICB9CisKKyAgICAvLyBMaW5rCisgICAgZ2xMaW5rUHJvZ3JhbShwcm9ncmFtKTsKKworICAgIC8vIENoZWNrIGZvciBsaW5raW5nIGVycm9ycworICAgIEdMaW50IGxpbmtlZCA9IDA7CisgICAgZ2xHZXRQcm9ncmFtaXYocHJvZ3JhbSwgR0xfTElOS19TVEFUVVMsICZsaW5rZWQpOworICAgIGlmIChsaW5rZWQgIT0gR0xfVFJVRSkgeworICAgICAgLy8gTG9nIHRoZSBsaW5rZXIgZXJyb3IgbWVzc2FnZXMKKyAgICAgIEdMaW50IGxvZ19sZW5ndGggPSAwOworICAgICAgZ2xHZXRQcm9ncmFtaXYocHJvZ3JhbSwgR0xfSU5GT19MT0dfTEVOR1RILCAmbG9nX2xlbmd0aCk7CisgICAgICBpZiAobG9nX2xlbmd0aCkgeworICAgICAgICBjaGFyKiBlcnJvcl9sb2cgPSBuZXcgY2hhclt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8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8KK2Jvb2wgU2hhZGVyUHJvZ3JhbTo6Q2hlY2tWYWx1ZUNvdW50KGNvbnN0IHN0ZDo6c3RyaW5nJiB2YXJfdHlwZSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbnN0IHN0ZDo6c3RyaW5nJiB2YXJfbmFtZSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGludCBleHBlY3RlZF9jb3VudCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGludCBjb21wb25lbnRzLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaW50IHZhbHVlX3NpemUpIHsKKyAgaWYgKGV4cGVjdGVkX2NvdW50ICE9ICh2YWx1ZV9zaXplIC8gY29tcG9uZW50cykpIHsKKyAgICBBTE9HRSgiU2hhZGVyIFByb2dyYW06ICVzIFZhbHVlIEVycm9yICglcyk6IEV4cGVjdGVkIHZhbHVlIGxlbmd0aCAlZCAiCisgICAgICAgICAiKCVkIGNvbXBvbmVudHMpLCBidXQgcmVjZWl2ZWQgbGVuZ3RoIG9mICVkICglZCBjb21wb25lbnRzKSEiLAorICAgICAgICAgdmFyX3R5cGUuY19zdHIoKSwgdmFyX25hbWUuY19zdHIoKSwKKyAgICAgICAgIGV4cGVjdGVkX2NvdW50LCBjb21wb25lbnRzICogZXhwZWN0ZWRfY291bnQsCisgICAgICAgICB2YWx1ZV9zaXplIC8gY29tcG9uZW50cywgdmFsdWVfc2l6ZSk7CisgICAgcmV0dXJuIGZhbHNlOworICB9CisgIHJldHVybiB0cnVlOworfQorCitib29sIFNoYWRlclByb2dyYW06OkNoZWNrVmFsdWVNdWx0KGNvbnN0IHN0ZDo6c3RyaW5nJiB2YXJfdHlwZSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY29uc3Qgc3RkOjpzdHJpbmcmIHZhcl9uYW1lLAorICAgICAgICAg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50cyh0eXBlKTsKKyAgICBpZiAoIUNoZWNrVmFsdWVDb3VudCgiVW5pZm9ybSAoZmxvYXQpIiwgbmFtZSwgY2FwYWNpdHksIGNvbXBvbmVudHMsIGNvdW50KQorICAgIHx8ICAhQ2hlY2tWYWx1ZU11bHQgKCJVbmlmb3JtIChmbG9hdCkiLCBuYW1lLCBjb21wb25lbnRzLCBjb3VudCkpCisgICAgICByZXR1cm4gZmFsc2U7CisKKyAgICAvLyBTZXQgdmFsdWUgYmFzZWQgb24gdHlwZQorICAgIGNvbnN0IGludCBuID0gY291bnQgLyBjb21wb25lbnRzOworICAgIHN3aXRjaCh0eXBlKSB7CisgICAgICBjYXNlIEdMX0ZMT0FUOgorICAgICAgICBnbFVuaWZvcm0xZnYodmFyLCBuLCB2YWx1ZXMpOworICAgICAgICBicmVhazsKKworICAgICAgY2FzZSBHTF9GTE9BVF9WRUMyOgorICAgICAgICBnbFVuaWZvcm0yZnYodmFyLCBuLCB2YWx1ZXMpOworICAgICAgICBicmVhazsKKworICAgICAgY2FzZSBHTF9GTE9BVF9WRUMzOgorICAgICAgICBnbFVuaWZvcm0zZnYodmFyLCBuLCB2YWx1ZXMpOworICAgICAgICBicmVhazsKKworICAgICAgY2FzZSBHTF9GTE9BVF9WRUM0OgorICAgICAgICBnbFVuaWZvcm00ZnYodmFyLCBuLCB2YWx1ZXMpOworICAgICAgICBicmVhazsKKworICAgICAgY2FzZSBHTF9GTE9BVF9NQVQyOgorICAgICAgICBnbFVuaWZvcm1NYXRyaXgyZnYodmFyLCBuLCBHTF9GQUxTRSwgdmFsdWVzKTsKKyAgICAgICAgYnJlYWs7CisKKyAgICAgIGNhc2UgR0xfRkxPQVRfTUFUMzoKKyAgICAgICAgZ2xVbmlmb3JtTWF0cml4M2Z2KHZhciwgbiwgR0xfRkFMU0UsIHZhbHVlcyk7CisgICAgICAgIGJyZWFrOworCisgICAgICBjYXNlIEdMX0ZMT0FUX01BVDQ6CisgICAgICAgIGdsVW5pZm9ybU1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Vudjo6Q2hlY2tHTEVycm9yKCJHZXRWYXJpYWJsZVZhbHVlIikgPyBNYWtlSW50VmFsdWUodmFsdWUpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOiBNYWtlTnVsbFZhbHVlKCk7CisgICAgICAgIH0gYnJlYWs7CisKKyAgICAgICAgY2FzZSBHTF9JTlRfVkVDMjogeworICAgICAgICAgIGludCB2YWx1ZVsyXTsKKyAgICAgICAgICBnbEdldFVuaWZvcm1pdihwcm9ncmFtXywgdmFyLCAmdmFsdWVbMF0pOworICAgICAgICAgIHJldHVybiAhR0xFbnY6OkNoZWNrR0xFcnJvcigiR2V0VmFyaWFibGVWYWx1ZSIpID8gTWFrZUludEFycmF5VmFsdWUodmFsdWUsIDIpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOiBNYWtlTnVsbFZhbHVlKCk7CisgICAgICAgIH0gYnJlYWs7CisKKyAgICAgICAgY2FzZSBHTF9JTlRfVkVDMzogeworICAgICAgICAgIGludCB2YWx1ZVszXTsKKyAgICAgICAgICBnbEdldFVuaWZvcm1pdihwcm9ncmFtXywgdmFyLCAmdmFsdWVbMF0pOworICAgICAgICAgIHJldHVybiAhR0xFbnY6OkNoZWNrR0xFcnJvcigiR2V0VmFyaWFibGVWYWx1ZSIpID8gTWFrZUludEFycmF5VmFsdWUodmFsdWUsIDMpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOiBNYWtlTnVsbFZhbHVlKCk7CisgICAgICAgIH0gYnJlYWs7CisKKyAgICAgICAgY2FzZSBHTF9JTlRfVkVDNDogeworICAgICAgICAgIGludCB2YWx1ZVs0XTsKKyAgICAgICAgICBnbEdldFVuaWZvcm1pdihwcm9ncmFtXywgdmFyLCAmdmFsdWVbMF0pOworICAgICAgICAgIHJldHVybiAhR0xFbnY6OkNoZWNrR0xFcnJvcigiR2V0VmFyaWFibGVWYWx1ZSIpID8gTWFrZUludEFycmF5VmFsdWUodmFsdWUsIDQpCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOiBNYWtlTnVsbFZhbHVlKCk7CisgICAgICAgIH0gYnJlYWs7CisKKyAgICAgICAgY2FzZSBHTF9GTE9BVDogeworICAgICAgICAgIGZsb2F0IHZhbHVlOworICAgICAgICAgIGdsR2V0VW5pZm9ybWZ2KHByb2dyYW1fLCB2YXIsICZ2YWx1ZSk7CisgICAgICAgICAgcmV0dXJuICFHTEVudjo6Q2hlY2tHTEVycm9yKCJHZXRWYXJpYWJsZVZhbHVlIikgPyBNYWtlRmxvYXRWYWx1ZSh2YWx1ZSkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA6IE1ha2VOdWxsVmFsdWUoKTsKKyAgICAgICAgfSBicmVhazsKKworICAgICAgICBjYXNlIEdMX0ZMT0FUX1ZFQzI6IHsKKyAgICAgICAgICBmbG9hdCB2YWx1ZVsyXTsKKyAgICAgICAgICBnbEdldFVuaWZvcm1mdihwcm9ncmFtXywgdmFyLCAmdmFsdWVbMF0pOworICAgICAgICAgIHJldHVybiAhR0xFbnY6OkNoZWNrR0xFcnJvcigiR2V0VmFyaWFibGVWYWx1ZSIpID8gTWFrZUZsb2F0QXJyYXlWYWx1ZSh2YWx1ZSwgMikKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA6IE1ha2VOdWxsVmFsdWUoKTsKKyAgICAgICAgfSBicmVhazsKKworICAgICAgICBjYXNlIEdMX0ZMT0FUX1ZFQzM6IHsKKyAgICAgICAgICBmbG9hdCB2YWx1ZVszXTsKKyAgICAgICAgICBnbEdldFVuaWZvcm1mdihwcm9ncmFtXywgdmFyLCAmdmFsdWVbMF0pOworICAgICAgICAgIHJldHVybiAhR0xFbnY6OkNoZWNrR0xFcnJvcigiR2V0VmFyaWFibGVWYWx1ZSIpID8gTWFrZUZsb2F0QXJyYXlWYWx1ZSh2YWx1ZSwgMykKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA6IE1ha2VOdWxsVmFsdWUoKTsKKyAgICAgICAgfSBicmVhazsKKworICAgICAgICBjYXNlIEdMX0ZMT0FUX1ZFQzQ6IHsKKyAgICAgICAgICBmbG9hdCB2YWx1ZVs0XTsKKyAgICAgICAgICBnbEdldFVuaWZvcm1mdihwcm9ncmFtXywgdmFyLCAmdmFsdWVbMF0pOworICAgICAgICAgIHJldHVybiAhR0xFbnY6OkNoZWNrR0xFcnJvcigiR2V0VmFyaWFibGVWYWx1ZSIpID8gTWFrZUZsb2F0QXJyYXlWYWx1ZSh2YWx1ZSwgNCkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA6IE1ha2VOdWxsVmFsdWUoKTsKKyAgICAgICAgfSBicmVhazsKKworICAgICAgICBjYXNlIEdMX0ZMT0FUX01BVDI6IHsKKyAgICAgICAgICBmbG9hdCB2YWx1ZVs0XTsKKyAgICAgICAgICBnbEdldFVuaWZvcm1mdihwcm9ncmFtXywgdmFyLCAmdmFsdWVbMF0pOworICAgICAgICAgIHJldHVybiAhR0xFbnY6OkNoZWNrR0xFcnJvcigiR2V0VmFyaWFibGVWYWx1ZSIpID8gTWFrZUZsb2F0QXJyYXlWYWx1ZSh2YWx1ZSwgNCkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA6IE1ha2VOdWxsVmFsdWUoKTsKKyAgICAgICAgfSBicmVhazsKKworICAgICAgICBjYXNlIEdMX0ZMT0FUX01BVDM6IHsKKyAgICAgICAgICBmbG9hdCB2YWx1ZVs5XTsKKyAgICAgICAgICBnbEdldFVuaWZvcm1mdihwcm9ncmFtXywgdmFyLCAmdmFsdWVbMF0pOworICAgICAgICAgIHJldHVybiAhR0xFbnY6OkNoZWNrR0xFcnJvcigiR2V0VmFyaWFibGVWYWx1ZSIpID8gTWFrZUZsb2F0QXJyYXlWYWx1ZSh2YWx1ZSwgOSkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA6IE1ha2VOdWxsVmFsdWUoKTsKKyAgICAgICAgfSBicmVhazsKKworICAgICAgICBjYXNlIEdMX0ZMT0FUX01BVDQ6IHsKKyAgICAgICAgICBmbG9hdCB2YWx1ZVsxNl07CisgICAgICAgICAgZ2xHZXRVbmlmb3JtZnYocHJvZ3JhbV8sIHZhciwgJnZhbHVlWzBdKTsKKyAgICAgICAgICByZXR1cm4gIUdMRW52OjpDaGVja0dMRXJyb3IoIkdldFZhcmlhYmxlVmFsdWUiKSA/IE1ha2VGbG9hdEFycmF5VmFsdWUodmFsdWUsIDE2KQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDogTWFrZU51bGxWYWx1ZSgpOworICAgICAgICB9IGJyZWFrOworICAgICAgfQorICAgIH0KKyAgfQorICByZXR1cm4gTWFrZU51bGxWYWx1ZSgpOworfQorCitHTHVpbnQgU2hhZGVyUHJvZ3JhbTo6SW5kZXhPZlVuaWZvcm0oUHJvZ3JhbVZhciB2YXIpIHsKKyAgcmV0dXJuIHVuaWZvcm1faW5kaWNlc19bdmFyXTsKK30KKworLy8gQXR0cmlidXRlcyAvLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLworaW50IFNoYWRlclByb2dyYW06Ok1heEF0dHJpYnV0ZUNvdW50KCkgeworICBHTGludCByZXN1bHQ7CisgIGdsR2V0SW50ZWdlcnYoR0xfTUFYX1ZFU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AgICAgICAgICAgICAgICAgICAgICAgYm9vbCBub3JtYWxpemUpIHsKKyAgaWYgKCFDaGVja1ZhclZhbGlkKHZhcikpCisgICAgcmV0dXJuIGZhbHNlOworCisgIGlmICh2Ym8pIHsKKyAgICBWZXJ0ZXhBdHRyaWIgYXR0cmliOworICAgIGF0dHJpYi5pc19jb25zdCA9IGZhbHNlOworICAgIGF0dHJpYi5pbmRleCA9IHZhcjsKKyAgICBhdHRyaWIuY29tcG9uZW50cyA9IGNvbXBvbmVudHM7CisgICAgYXR0cmliLm5vcm1hbGl6ZWQgPSBub3JtYWxpemU7CisgICAgYXR0cmliLnN0cmlkZSA9IHN0cmlkZTsKKyAgICBhdHRyaWIudHlwZSA9IHR5cGU7CisgICAgYXR0cmliLnZibyA9IHZiby0+R2V0VmJvSWQoKTsKKyAgICBhdHRyaWIub2Zmc2V0ID0gb2Zmc2V0OworCisgICAgcmV0dXJuIFN0b3JlQXR0cmlidXRlKGF0dHJpYik7CisgIH0KKyAgcmV0dXJuIGZhbHNlOworfQorCitib29sIFNoYWRlclByb2dyYW06OlNldEF0dHJpYnV0ZVZhbHVlcyhQcm9ncmFtVmFyIHZhciwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbnN0IHVpbnQ4X3QqIGRhdGEsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBHTGVudW0gdHlwZSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGludCBjb21wb25lbnRzLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaW50IHN0cmlkZSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGludCBvZmZzZXQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBib29sIG5vcm1hbGl6ZSkgeworICBpZiAoIUNoZWNrVmFyVmFsaWQodmFyKSkKKyAgICByZXR1cm4gZmFsc2U7CisKKyAgaWYgKGRhdGEpIHsKKyAgICBWZXJ0ZXhBdHRyaWIgYXR0cmliOworICAgIGF0dHJpYi5pc19jb25zdCA9IGZhbHNlOworICAgIGF0dHJpYi5pbmRleCA9IHZhcjsKKyAgICBhdHRyaWIuY29tcG9uZW50cyA9IGNvbXBvbmVudHM7CisgICAgYXR0cmliLm5vcm1hbGl6ZWQgPSBub3JtYWxpemU7CisgICAgYXR0cmliLnN0cmlkZSA9IHN0cmlkZTsKKyAgICBhdHRyaWIudHlwZSA9IHR5cGU7CisgICAgYXR0cmliLnZhbHVlcyA9IGRhdGEgKyBvZmZzZXQ7CisKKyAgICByZXR1cm4gU3RvcmVBdHRyaWJ1dGUoYXR0cmliKTsKKyAgfQorICByZXR1cm4gZmFsc2U7Cit9CisKK2Jvb2wgU2hhZGVyUHJvZ3JhbTo6U2V0QXR0cmlidXRlVmFsdWVzKFByb2dyYW1WYXIgdmFyLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY29uc3Qgc3RkOjp2ZWN0b3I8ZmxvYXQ+JiBkYXRhLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaW50IGNvbXBvbmVudHMpIHsKKyAgcmV0dXJuIFNldEF0dHJpYnV0ZVZhbHVlcyh2YXIsICZkYXRhWzBdLCBkYXRhLnNpemUoKSwgY29tcG9uZW50cyk7Cit9CisKK2Jvb2wgU2hhZGVyUHJvZ3JhbTo6U2V0QXR0cmlidXRlVmFsdWVzKFByb2dyYW1WYXIgdmFyLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY29uc3QgZmxvYXQqIGRhdGEsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpbnQgdG90YWwsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpbnQgY29tcG9uZW50cykgeworICBpZiAoIUNoZWNrVmFyVmFsaWQodmFyKSkKKyAgICByZXR1cm4gZmFsc2U7CisKKyAg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ZXMpOyBicmVhazsKKyAgICAgICAgY2FzZSA0OiBnbFZlcnRleEF0dHJpYjRmdihhdHRyaWIuaW5kZXgsIHZhbHVlcyk7IGJyZWFrOworICAgICAgICBkZWZhdWx0OiByZXR1cm4gZmFsc2U7CisgICAgICB9CisgICAgICBnbERpc2FibGVWZXJ0ZXhBdHRyaWJBcnJheShhdHRyaWIuaW5kZXgpOworICAgIH0gZWxzZSB7CisgICAgICAvLyBTZXQgcGVyLXZlcnRleCB2YWx1ZXMKKyAgICAgIGlmIChhdHRyaWIudmFsdWVzKSB7CisgICAgICAgIC8vIE1ha2Ugc3VyZSBubyBidWZmZXIgaXMgYm91bmQgYW5kIHNldCBhdHRyaWJ1dGUKKyAgICAgICAgZ2xCaW5kQnVmZmVyKEdMX0FSUkFZX0JVRkZFUiwgMCk7CisKKyAgICAgICAgZ2xWZXJ0ZXhBdHRyaWJQb2ludGVyKGF0dHJpYi5pbmRleCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGF0dHJpYi5jb21wb25lbnRzLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYXR0cmliLnR5cGUsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBhdHRyaWIubm9ybWFsaXplZCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGF0dHJpYi5zdHJpZGUsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBhdHRyaWIudmFsdWVzKTsKKyAgICAgIH0gZWxzZSBpZiAoYXR0cmliLnZibykgeworICAgICAgICAvLyBCaW5kIFZCTyBhbmQgc2V0IGF0dHJpYnV0ZQorICAgICAgICBnbEJpbmRCdWZmZXIoR0xfQVJSQVlfQlVGRkVSLCBhdHRyaWIudmJvKTsKKworICAgICAgICBnbFZlcnRleEF0dHJpYlBvaW50ZXIoYXR0cmliLmluZGV4LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYXR0cmliLmNvbXBvbmVudHMsCisgICAgICAgICAgICAgICAgICAgICAg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cyhQcm9ncmFtVmFyIHZhciwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb25zdCBWZXJ0ZXhGcmFtZSogZGF0YSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBHTGVudW0gdHlwZSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBpbnQgY29tcG9uZW50cywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBpbnQgc3RyaWRlLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIGludCBvZmZzZXQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgYm9vbCBub3JtYWxpemUpOworCisgICAgLy8gU2V0IGF0dHJpYnV0ZSB2YWx1ZXMgdGhhdCBkaWZmZXIgYWNyb3NzIHZlcnRleGVzLCB1c2luZyBhIGRhdGEgYnVmZmVyLgorICAgIC8vIFRoaXMgaXMgdGhlIHJlY29tbWVuZGVkIG1ldGhvZCBvZiBzcGVjaWZ5aW5nIHZlcnRleCBkYXRhLCBpZiB5b3VyIGRhdGEKKyAgICAvLyBjaGFuZ2VzIG9mdGVuLiBOb3RlIHRoYXQgdGhpcyBkYXRhIG1heSBuZWVkIHRvIGJlIGNvcGllZCB0byBHUFUgbWVtb3J5CisgICAgLy8gZm9yIGVhY2ggcmVuZGVyIHBhc3MuIFBsZWFzZSBzZWUgYWJvdmUgZm9yIGEgZGVzY3JpcHRpb24gb2YgdGhlCisgICAgLy8gcGFyYW1ldGVycy4KKyAgICAvLyBOb3RlOiBUaGUgZGF0YSBwYXNzZWQgaGVyZSBNVVNUIGJlIHZhbGlkIHVudGlsIGFsbCBleGVjdXRpb25zIG9mIHRoaXMKKyAgICAvLyBQcm9ncmFtIGluc3RhbmNlIGhhdmUgYmVlbiBjb21wbGV0ZWQhCisgICAgYm9vbCBTZXRBdHRyaWJ1dGVWYWx1ZXMoUHJvZ3JhbVZhciB2YXIsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgY29uc3QgdWludDhfdCogZGF0YSwKKyAgICAgICA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ShHTHVpbnQqIHNoYWRlcnMsIEdMdWludCBjb3VudCk7CisKKyAgICAvLyBSZXR1cm5zIHRoZSBsb3dlc3QgdGV4dHVyZSB1bml0IHRoYXQgd2lsbCBiZSB1c2VkIHRvIGJpbmQgdGV4dHVyZXMuCisgICAgR0x1aW50IEJhc2VUZXh0dXJlVW5pdCgpIGNvbnN0IHsKKyAgICAgIHJldHVybiBiYXNlX3RleHR1cmVfdW5pdF87CisgICAgfQorCisgICAgLy8gU2V0cyB0aGUgbG93ZXN0IHRleHR1cmUgdW5pdCB0aGF0IHdpbGwgYmUgdXNlZCB0byBiaW5kIHRleHR1cmVzLiBUaGUKKyAgICAvLyBkZWZhdWx0IHZhbHVlIGlzIEdMX1RFWFRVUkUwLgorICAgIHZvaWQgU2V0QmFzZVRleHR1cmVVbml0KEdMdWludCB0ZXh0dXJlX3VuaXQpIHsKKyAgICAgIGJhc2VfdGV4dHVyZV91bml0XyA9IHRleHR1cmVfdW5pdDsKKyAgICB9CisKKyAgcHJpdmF0ZToKKyAgICAvLyBTdHJ1Y3R1cmUgdG8gc3RvcmUgdmVydGV4IGF0dHJpYnV0ZSBkYXRhLgorICAgIHN0cnVjdCBWZXJ0ZXhBdHRyaWIgeworICAgICAgYm9vbCAgICAgICAgICBpc19jb25zdDsKKyAgICAgIGludCAgICAgICAgICAgaW5kZXg7CisgICAgICBib29sICAgICAgICAgIG5vcm1hbGl6ZWQ7CisgICAgICBpbnQgICAgICAgICAgIHN0cmlkZTsKKyAgICAgIGludCAgICAgICAgICAgY29tcG9uZW50czsKKyAgICAgIGludCAgICAgICAgICAgb2Zmc2V0OworICAgICAgR0xlbnVtICAgICAgICB0eXBlOworICAgICAgR0x1aW50ICAgICAgICB2Ym87CisgICAgICBjb25zdCB2b2lkKiAgIHZhbHVlczsKKyAgICAgIGZsb2F0KiAgICAgICAgb3duZWRfZGF0YTsKKworICAgICAgVmVydGV4QXR0cmliKCk7CisgICAgfTsKKyAgICB0eXBlZGVmIHN0ZDo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wgUHVzaENvb3JkcyhQcm9ncmFtVmFyIGF0dHIsIGZsb2F0KiBjb29yZHMpOworCisgICAgLy8gUHVzaGVzIHRoZSBzb3VyY2UgY29vcmRpbmF0ZXMuCisgICAgYm9vbCBQdXNoU291cmNlQ29vcmRzKGZsb2F0KiBjb29yZHMpOworCisgICAgLy8gUHVzaGVzIHRoZSB0YXJnZXQgY29vcmRpbmF0ZXMuCisgICAgYm9vbCBQdXNoVGFyZ2V0Q29vcmRzKGZsb2F0KiBjb29yZHMpOworCisgICAgLy8gUGVyZm9ybXMgKHNpbXBsZSkgR0wgZHJhd2luZy4KKyAgICBib29sIERyYXcoKTsKKworICAgIC8vIFBlcmZvcm1zIHRpbGVkIEdMIGRyYXdpbmcuCisgICAgYm9vbCBEcmF3VGlsZWQoKTsKKworICAgIC8vIFlpZWxkcyB0byBvdGhlciBHUFUgdGhyZWFkcy4KKyAgICB2b2lkIFlpZWxkKCk7CisKKyAgICAvLyBIZWxwZXIgbWV0aG9kIHRvIGFzc2VydCB0aGF0IHRoZSB2YXJpYWJsZSB2YWx1ZSBwYXNzZWQgaGFzIHRoZSBjb3JyZWN0CisgICAgLy8gdG90YWwgc2l6ZS4KKyAgICBzdGF0aWMgYm9vbCBDaGVja1ZhbHVlQ291bnQoY29uc3Qgc3RkOjpzdHJpbmcmIHZhcl90eXBlLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb25zdCBzdGQ6OnN0cmluZyYgdmFyX25hbWUsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGludCBleHBlY3RlZF9jb3VudCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaW50IGNvbXBvbmVudHMsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGludCB2YWx1ZV9zaXplKTsKKworICAgIC8vIEhlbHBlciBtZXRob2QgdG8gYXNzZXJ0IHRoYXQgdGhlIHZhcmlhYmxlIHZhbHVlIHBhc3NlZCBoYXMgYSBzaXplLCB0a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ZyYW1lLnJlbGVhc2UoKTsKKyAgICAgICAgfQorICAgIH0KKworICAgIHB1YmxpYyBDYWxsYmFja0ZpbHRlcihTdHJpbmcgbmFtZSkgeworICAgICAgICBzdXBlcihuYW1lKTsKKyAgICB9CisKKyAgICBAT3ZlcnJpZGUKKyAgICBwdWJsaWMgdm9pZCBzZXR1cFBvcnRzKCkgeworICAgICAgICBhZGRJbnB1dFBvcnQoImZyYW1lIik7CisgICAgfQorCisgICAgcHVibGljIHZvaWQgcHJlcGFyZShGaWx0ZXJDb250ZXh0IGNvbnRleHQpIHsKKyAgICAgICAgaWYgKG1DYWxsYmFja3NPblVpVGhyZWFkKSB7CisgICAgICAgICAgICBtVWlUaHJlYWRIYW5kbGVyID0gbmV3IEhhbmRsZXIoTG9vcGVyLmdldE1haW5Mb29wZXIoKSk7CisgICAgICAgIH0KKyAgICB9CisKKyAgICBwdWJsaWMgdm9pZCBwcm9jZXNzKEZpbHRlckNvbnRleHQgY29udGV4dCkgeworICAgICAgICAvLyBHZXQgZnJhbWUgYW5kIGZvcndhcmQgdG8gbGlzdGVuZXIKKyAgICAgICAgZmluYWwgRnJhbWUgaW5wdXQgPSBwdWxsSW5wdXQoImZyYW1lIik7CisgICAgICAgIGlmIChtTGlzdGVuZXIgIT0gbnVsbCkgeworICAgICAgICAgICAgaWYgKG1DYWxsYmFja3NPblVpVGhyZWFkKSB7CisgICAgICAgICAgICAgICAgaW5wdXQucmV0YWluKCk7CisgICAgICAgICAgICAgICAgQ2FsbGJhY2tSdW5uYWJsZSB1aVJ1bm5hYmxlID0gbmV3IENhbGxiYWNrUnVubmFibGUobUxpc3RlbmVyLCB0aGlzLCBpbnB1dCwgbVVzZXJEYXRhKTsKKyAgICAgICAgICAgICAgICBpZiAoIW1VaVRocmVhZEhhbmRsZXIucG9zdCh1aVJ1bm5hYmxlKSkgeworICAgICAgICAgICAgICAgICAgICB0aHJvdyBuZXcgUnVudGltZUV4Y2VwdGlvbigiVW5hYmxlIHRvIHNlbm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WUgPSAib3V0cHV0cyIsIGhhc0RlZmF1bHQgPSB0cnVlKQorICAgIHByaXZhdGUgaW50IG1OdW1iZXJPZk91dHB1dHMgPSAyOworCisgICAgcHVibGljIEZyYW1lQnJhbmNoKFN0cmluZyBuYW1lKSB7CisgICAgICAgIHN1cGVyKG5hbWUpOworICAgIH0KKworICAgIEBPdmVycmlkZQorICAgIHB1YmxpYyB2b2lkIHNldHVwUG9ydHMoKSB7CisgICAgICAgIGFkZElucHV0UG9ydCgiaW4iKTsKKyAgICAgICAgZm9yIChpbnQgaSA9IDA7IGkgPCBtTnVtYmVyT2ZPdXRwdXRzOyArK2kpIHsKKyAgICAgICAgICAgIGFkZE91dHB1dEJhc2VkT25JbnB1dCgib3V0IiArIGksICJpbiIpOworICAgICAgICB9CisgICAgfQorCisgICAgQE92ZXJyaWRlCisgICAgcHVibGljIEZyYW1lRm9ybWF0IGdldE91dHB1dEZvcm1hdChTdHJpbmcgcG9ydE5hbWUsIEZyYW1lRm9ybWF0IGlucHV0Rm9ybWF0KSB7CisgICAgICAgIHJldHVybiBpbnB1dEZvcm1hdDsKKyAgICB9CisKKyAgICBwdWJsaWMgdm9pZCBwcm9jZXNzKEZpbHRlckNvbnRleHQgY29udGV4dCkgeworICAgICAgICAvLyBHZXQgaW5wdXQgZnJhbWUKKyAgICAgICAgRnJhbWUgaW5wdXQgPSBwdWxsSW5wdXQoImluIik7CisKKyAgICAgICAgLy8gUHVzaCBvdXRwdXQKKyAgICAgICAgZm9yIChpbnQgaSA9IDA7IGkgPCBtTnVtYmVyT2ZPdXRwdXRzOyArK2kpIHsKKyAgICAgICAgICAgIHB1c2hPdXRwdXQoIm91dCIgKyBpLCBpbnB1dCk7CisgICAgICAgIH0KKyAgICB9CisKK30KZGlmZiAtLWdpdCBhL21lZGlhL21jYS9maWx0ZXJwYWNrcy9qYXZhL2FuZHJvaWQvZmlsdGVycGFja3MvYmFzZS9GcmFtZUZldGNoLmphdmEgYi9tZWRpYS9tY2EvZmlsd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XRlKEltYWdlRm9ybWF0LkNPTE9SU1BBQ0VfUkdCQSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgRnJhbWVGb3JtYXQuVEFSR0VUX0dQVSkpOworICAgIH0KKworICAgIEBPdmVycmlkZQorICAgIHB1YmxpYyB2b2lkIGZpZWxkUG9ydFZhbHVlVXBkYXRlZChTdHJpbmcgbmFtZSwgRmlsdGVyQ29udGV4dCBjb250ZXh0KSB7CisgICAgICAgIC8vIFJlbGVhc2UgZnJhbWUsIHNvIHRoYXQgaXQgaXMgcmVjcmVhdGVkIGR1cmluZyB0aGUgbmV4dCBwcm9jZXNzIGNhbGwKKyAgICAgICAgaWYgKG1GcmFtZSAhPSBudWxsKSB7CisgICAgICAgICAgICBtRnJhbWUucmVsZWFzZSgpOworICAgICAgICAgICAgbUZyYW1lID0gbnVsbDsKKyAgICAgICAgfQorICAgIH0KKworICAgIEBPdmVycmlkZQorICAgIHB1YmxpYyB2b2lkIHByb2Nlc3MoRmlsdGVyQ29udGV4dCBjb250ZXh0KSB7CisgICAgICAgIC8vIEdlbmVyYXRlIGZyYW1lIGlmIG5vdCBnZW5lcmF0ZWQgYWxyZWFkeQorICAgICAgICBpZiAobUZyYW1lID09IG51bGwpIHsKKyAgICAgICAgICAgIEZyYW1lRm9ybWF0IG91dHB1dEZvcm1hdCA9IEltYWdlRm9ybWF0LmNyZWF0ZShtV2lkdGgsIG1IZWlnaHQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgSW1hZ2VGb3JtYXQuQ09MT1JTUEFDRV9SR0JBLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEZyYW1lRm9ybWF0LlRBUkdFVF9HUFUpOworICAgICAgICAgICAgbUZyYW1lID0gY29udGV4dC5nZXRGcmFtZU1hbmFnZXIoKS5uZXdCb3VuZEZyYW1lKG91dHB1dEZvcm1hdCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBHTEZyYW1lLkVYSVNUSU5HX1RFWFRVUkVfQklORElORywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBtVGV4SWQpOworICAgICAgICAgICAgbUZyYW1lLnNldFRpbWVzdGFtcChtVGltZXN0YW1wKTsKKyAgICAgICAgfQorCisgICAgICAgIC8vIFB1c2ggb3V0cHV0CisgICAgICAgIHB1c2hPdXRwdXQoImZyYW1lIiwgbUZyYW1lKTsKKworICAgICAgICBpZiAoIW1SZXBlYXRGcmFtZSkgeworICAgICAgICAgICAgLy8gQ2xvc2Ugb3V0cHV0IHBvcnQgYXMgd2UgYXJlIGRvbmUgaGVyZQorICAgICAgICAgICAgY2xvc2VPdXRwdXRQb3J0KCJmcmFtZSIpOworICAgICAgICB9CisgICAgfQorCisgICAgQE92ZXJyaWRlCisgICAgcHVibGljIHZvaWQgdGVhckRvd24oRmlsdGVyQ29udGV4dCBjb250ZXh0KSB7CisgICAgICAgIGlmIChtRnJhbWUgIT0gbnVsbCkgeworICAgICAgICAgICAgbUZyYW1lLnJlbGVhc2UoKTsKKyAgICAgICAgfQorICAgIH0KKworfQpkaWZmIC0tZ2l0IGEvbWVkaWEvbWNhL2ZpbHRlcnBhY2tzL2phdmEvYW5kcm9pZC9maWx0ZXJwYWNrcy9iYXNlL0dMVGV4dHVyZVRhcmdldC5qYXZhIGIvbWVkaWEvbWNhL2ZpbHRlcnBhY2tzL2phdmEvYW5kcm9pZC9maWx0ZXJwYWNrcy9iYXNlL0dMVGV4dHVyZVRhcmdldC5qYXZhCm5ldyBmaWxlIG1vZGUgMTAwNjQ0CmluZGV4IDAwMDAwMDAuLmIyMjg1Y2QKLS0tIC9kZXYvbnVsbAorKysgYi9tZWRpYS9tY2EvZmlsdGVycGFja3MvamF2YS9hbmRyb2lkL2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bnRleHQgY29udGV4dCkgeworICAgICAgICAvLyBJZiBubyBmcmFtZSBoYXMgYmVlbiBjcmVhdGVkLCBjcmVhdGUgb25lIG5vdy4KKyAgICAgICAgaWYgKG1GcmFtZSA9PSBudWxsKSB7CisgICAgICAgICAgICBpZiAobU9iamVjdCA9PSBudWxsKSB7CisgICAgICAgICAgICAgICAgdGhyb3cgbmV3IE51bGxQb2ludGVyRXhjZXB0aW9uKCJPYmplY3RTb3VyY2UgcHJvZHVjaW5nIGZyYW1lIHdpdGggbm8gb2JqZWN0IHNldCEiKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIEZyYW1lRm9ybWF0IG91dHB1dEZvcm1hdCA9IE9iamVjdEZvcm1hdC5mcm9tT2JqZWN0KG1PYmplY3QsIEZyYW1lRm9ybWF0LlRBUkdFVF9TSU1QTEUpOworICAgICAgICAgICAgbUZyYW1lID0gY29udGV4dC5nZXRGcmFtZU1hbmFnZXIoKS5uZXdGcmFtZShvdXRwdXRGb3JtYXQpOworICAgICAgICAgICAgbUZyYW1lLnNldE9iamVjdFZhbHVlKG1PYmplY3QpOworICAgICAgICAgICAgbUZyYW1lLnNldFRpbWVzdGFtcChGcmFtZS5USU1FU1RBTVBfVU5LTk9XTik7CisgICAgICAgIH0KKworICAgICAgICAvLyBQdXNoIG91dHB1dAorICAgICAgICBwdXNoT3V0cHV0KCJmcmFtZSIsIG1GcmFtZSk7CisKKyAgICAgICAgLy8gV2FpdCBmb3IgZnJlZSBvdXRwdXQKKyAgICAgICAgaWYgKCFtUmVwZWF0RnJhbWUpIHsKKyAgICAgICAgICAgIGNsb3NlT3V0cHV0UG9ydCgiZnJhbWUiKTsKKyAgICAgICAgfQorICAgIH0KKworICAgIEBPdmVycmlkZQorICAgIHB1YmxpYyB2b2lkIHRlYXJEb3duKEZpbHRlckNvbnRleHQgY29udGV4dCkgeworICAgICAgICBtRnJhbWUucmVsZWFzZSgpOworICAgIH0KKworICAgIEBPdmVycmlkZQorICAgIHB1Y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IG1heChjb2xvci5nLCBjb2xvci5iKSk7XG4iICsKKyAgICAgICAgICAgICIgIGlmIChkc3RfZW5lcmd5ID4gbWF4X2VuZXJneSkge1xuIiArCisgICAgICAgICAgICAiICAgIGRzdF9lbmVyZ3kgPSBtYXhfZW5lcmd5O1xuIiArCisgICAgICAgICAgICAiICB9XG4iICsKKyAgICAgICAgICAgICIgIGlmIChlbmVyZ3kgPT0gMC4wKSB7XG4iICsKKyAgICAgICAgICAgICIgICAgZ2xfRnJhZ0NvbG9yID0gY29sb3I7XG4iICsKKyAgICAgICAgICAgICIgIH0gZWxzZSB7XG4iICsKKyAgICAgICAgICAgICIgICAgZ2xfRnJhZ0NvbG9yID0gdmVjNChjb2xvci5yZ2IgKiBkc3RfZW5lcmd5IC8gZW5lcmd5LCBjb2xvci5hKTtcbiIgKworICAgICAgICAgICAgIiAgfVxuIiArCisgICAgICAgICAgICAifVxuIjsKKworICAgIHByaXZhdGUgUHJvZ3JhbSBtU2hhZGVyUHJvZ3JhbTsKKyAgICBwcml2YXRlIFByb2dyYW0gbU5hdGl2ZVByb2dyYW07CisKKyAgICBwcml2YXRlIGludCBtV2lkdGggPSAwOworICAgIHByaXZhdGUgaW50IG1IZWlnaHQgPSAwOworICAgIHByaXZhdGUgaW50IG1UYXJnZXQgPSBGcmFtZUZvcm1hdC5UQVJHRVRfVU5TUEVDSUZJRUQ7CisKKyAgICBwcml2YXRlIEZyYW1lIG1IaXN0RnJhbWU7CisgICAgcHJpdmF0ZSBGcmFtZSBtRGVuc2l0eUZyYW1lOworCisgICAgcHVibGljIEF1dG9GaXhGaWx0ZXIoU3RyaW5nIG5hbWUpIHsKKyAgICAgICAgc3VwZXIobmFtZSk7CisgICAgfQorCisgICAgQE92ZXJyaWRlCisgICAgcHVibGljIHZvaWQgc2V0dXBQb3J0cygpIHsKKyAgICAgICAgYWRkTWFza2VkSW5wdXRQb3J0KCJpbWFnZSIsIEltYWdlRm9ybWF0LmNyZWF0ZShJbWFnZUZvcm1hdC5DT0xPUlNQQUNFX1JHQkEpKTsKKyAgICAgICAgYWRkT3V0cHV0QmFzZWRPbklucHV0KCJpbWFnZSIsICJpbWFnZSIpOworICAgIH0KKworICAgIEBPdmVycmlkZQorICAgIHB1YmxpYyBGcmFtZUZvcm1hdCBnZXRPdXRwdXRGb3JtYXQoU3RyaW5nIHBvcnROYW1lLCBGcmFtZUZvcm1hdCBpbnB1dEZvcm1hdCkgeworICAgICAgICByZXR1cm4gaW5wdXRGb3JtYXQ7CisgICAgfQorCisgICAgcHVibGljIHZvaWQgaW5pdFByb2dyYW0oRmlsdGVyQ29udGV4dCBjb250ZXh0LCBpbnQgdGFyZ2V0KSB7CisgICAgICAgIHN3aXRjaCAodGFyZ2V0KSB7CisgICAgICAgICAgICBjYXNlIEZyYW1lRm9ybWF0LlRBUkdFVF9HUFU6CisgICAgICAgICAgICAgICAgU2hhZGVyUHJvZ3JhbSBzaGFkZXJQcm9ncmFtID0gbmV3IFNoYWRlclByb2dyYW0oY29udGV4dCwgbUF1dG9GaXhTaGFkZXIpOworICAgICAgICAgICAgICAgIHNoYWRlclByb2dyYW0uc2V0TWF4aW11bVRpbGVTaXplKG1UaWxlU2l6ZSk7CisgICAgICAgICAgICAgICAgbVNoYWRlclByb2dyYW0gPSBzaGFkZXJQcm9ncmFtOworICAgICAgICAgICAgICAgIGJyZWFrOworCisgICAgICAgICAgICBkZWZhdWx0OgorICAgICAgICAgICAgICAgIHRocm93IG5ldyBSdW50aW1lRXhjZXB0aW9uKCJGaWx0ZXIgU2hhcnBlbiBkb2VzIG5vdCBzdXBwb3J0IGZyYW1lcyBvZiAiICsKKyAgICAgICAgICAgICAgICAgICAgInRhcmdldCAiICsgdGFyZ2V0ICsgIiEiKTsKKyAgICAgICAgfQorICAgICAgICBtVGFyZ2V0ID0gdGFyZ2V0OworICAgIH0KKworICAgIHByaXZhdGUgdm9pZCBpbml0UGFyYW1ldGVycygpIHsKKyAgICAgICAgbVNoYWRlclByb2dyYW0uc2V0SG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GVuc2l0eURpbSwgMSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBJbWFnZUZvcm1hdC5DT0xPUlNQQUNFX1JHQkEsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgRnJhbWVGb3JtYXQuVEFSR0VUX0dQVSk7CisgICAgICAgIG1EZW5zaXR5RnJhbWUgPSBjb250ZXh0LmdldEZyYW1lTWFuYWdlcigpLm5ld0ZyYW1lKGRlbnNpdHlGb3JtYXQpOworICAgICAgICBtRGVuc2l0eUZyYW1lLnNldEludHMoZGVuc2l0eVRhYmxlKTsKKyAgICB9CisKKyAgICBAT3ZlcnJpZGUKKyAgICBwdWJsaWMgdm9pZCB0ZWFyRG93bihGaWx0ZXJDb250ZXh0IGNvbnRleHQpIHsKKyAgICAgICAgaWYgKG1EZW5zaXR5RnJhbWUgIT0gbnVsbCkgeworICAgICAgICAgICAgbURlbnNpdHlGcmFtZS5yZWxlYXNlKCk7CisgICAgICAgICAgICBtRGVuc2l0eUZyYW1lID0gbnVsbDsKKyAgICAgICAgfQorCisgICAgICAgIGlmIChtSGlzdEZyYW1lICE9IG51bGwpIHsKKyAgICAgICAgICAgIG1IaXN0RnJhbWUucmVsZWFzZSgpOworICAgICAgICAgICAgbUhpc3RGcmFtZSA9IG51bGw7CisgICAgICAgIH0KKyAgICB9CisKKyAgICBAT3ZlcnJpZGUKKyAgICBwdWJsaWMgdm9pZCBmaWVsZFBvcnRWYWx1ZVVwZGF0ZWQoU3RyaW5nIG5hbWUsIEZpbHRlckNvbnRleHQgY29udGV4dCkgeworICAgICAgICBpZiAobVNoYWRlclByb2dyYW0gIT0gbnVsbCkgeworICAgICAgICAgICAgbVNoYWRlclByb2dyYW0uc2V0SG9zdFZhbHVlKCJzY2FsZSIsIG1TY2FsZSk7CisgICAgICAgIH0KKyAgICB9CisKKyAgICBAT3ZlcnJpZGUKKyAgICBwdWJsaW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sgKyt5KSB7CisgICAgICAgICAgICBmb3IgKGludCB4ID0geF9ib3JkZXJfdGhpY2tuZXNzOyB4IDwgd2lkdGggLSB4X2JvcmRlcl90aGlja25lc3M7ICsreCkgeworICAgICAgICAgICAgICAgIGludCBpbmRleCA9IHkgKiB3aWR0aCArIHg7CisgICAgICAgICAgICAgICAgaW50IGVuZXJneSA9IChkYXRhW2luZGV4XSAmIDB4RkYpICsgKChkYXRhW2luZGV4XSA+PiA4KSAmIDB4RkYpICsKKyAgICAgICAgICAgICAgICAgICAgKChkYXRhW2luZGV4XSA+PiAxNikgJiAweEZGKTsKKyAgICAgICAgICAgICAgICBoaXN0QXJyYXlbZW5lcmd5XSArKzsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorCisgICAgICAgIGZvciAoaW50IGkgPSAxOyBpIDwgaGlzdERpbXM7IGkrKykgeworICAgICAgICAgICAgaGlzdEFycmF5W2ldICs9IGhpc3RBcnJheVtpLTFdOworICAgICAgICB9CisKKyAgICAgICAgZm9yIChpbnQgaSA9IDA7IGkgPCBoaXN0RGltczsgaSsrKSB7CisgICAgICAgICAgICBsb25nIHRlbXAgPSAoMjU2ICogMjU2IC0gMWwpICogaGlzdEFycmF5W2ldIC8gcGl4ZWxzOworICAgICAgICAgICAgaGlzdEFycmF5W2ldID0gIChpbnQpIHRlbXA7CisgICAgICAgIH0KKworICAgICAgICBGcmFtZUZvcm1hdCBzaGFkZXJIaXN0Rm9ybWF0ID0gSW1hZ2VGb3JtYXQuY3JlYXRlKGhpc3REaW1zLCAxLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEltYWdlRm9ybWF0LkNPTE9SU1BBQ0VfUkdCQSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBGcmFtZUZvcm1hdC5UQVJHRVRfR1BVKTsKKyAgICAgICAgaWYgKG1IaXN0RnJhbWUgIT0gbnV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ICAgICAgICAgICAgICBTaGFkZXJQcm9ncmFtIHNoYWRlclByb2dyYW0gPSBuZXcgU2hhZGVyUHJvZ3JhbShjb250ZXh0LCBtT3ZlcmxheVNoYWRlcik7CisgICAgICAgICAgICAgICAgc2hhZGVyUHJvZ3JhbS5zZXRNYXhpbXVtVGlsZVNpemUobVRpbGVTaXplKTsKKyAgICAgICAgICAgICAgICBtUHJvZ3JhbSA9IHNoYWRlclByb2dyYW07CisgICAgICAgICAgICAgICAgYnJlYWs7CisKKyAgICAgICAgICAgIGRlZmF1bHQ6CisgICAgICAgICAgICAgICAgdGhyb3cgbmV3IFJ1bnRpbWVFeGNlcHRpb24oIkZpbHRlciBGaXNoZXllRmlsdGVyIGRvZXMgbm90IHN1cHBvcnQgZnJhbWVzIG9mICIgKworICAgICAgICAgICAgICAgICAgICAidGFyZ2V0ICIgKyB0YXJnZXQgKyAiISIpOworICAgICAgICB9CisgICAgICAgIG1UYXJnZXQgPSB0YXJnZXQ7CisgICAgfQorCisgICAgQE92ZXJyaWRlCisgICAgcHVibGljIHZvaWQgdGVhckRvd24oRmlsdGVyQ29udGV4dCBjb250ZXh0KSB7CisgICAgICAgIGlmIChtRnJhbWUgIT0gbnVsbCkgeworICAgICAgICAgICAgbUZyYW1lLnJlbGVhc2UoKTsKKyAgICAgICAgICAgIG1GcmFtZSA9IG51bGw7CisgICAgICAgIH0KKyAgICB9CisKKyAgICBAT3ZlcnJpZGUKKyAgICBwdWJsaWMgdm9pZCBwcm9jZXNzKEZpbHRlckNvbnRleHQgY29udGV4dCkgeworICAgICAgICAvLyBHZXQgaW5wdXQgZnJhbWUKKyAgICAgICAgRnJhbWUgaW5wdXQgPSBwdWxsSW5wdXQoImltYWdlIik7CisgICAgICAgIEZyYW1lRm9ybWF0IGlucHV0Rm9ybWF0ID0gaW5wdXQuZ2V0Rm9ybWF0KCk7CisKKyAgICAgICAgLy8gQ3JlYXRlIG91dHB1dCBmcmFtZQorICAgICAgICBGcmFtZSBvdXRwdXQ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ICAgaWYgKG1CaXRtYXAgIT0gbnVsbCkgeworICAgICAgICAgICAgRnJhbWVGb3JtYXQgZm9ybWF0ID0gSW1hZ2VGb3JtYXQuY3JlYXRlKG1CaXRtYXAuZ2V0V2lkdGgoKSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBtQml0bWFwLmdldEhlaWdodCgpLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEltYWdlRm9ybWF0LkNPTE9SU1BBQ0VfUkdCQSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBGcmFtZUZvcm1hdC5UQVJHRVRfR1BVKTsKKworICAgICAgICAgICAgaWYgKG1GcmFtZSAhPSBudWxsKSB7CisgICAgICAgICAgICAgICAgbUZyYW1lLnJlbGVhc2UoKTsKKyAgICAgICAgICAgIH0KKworICAgICAgICAgICAgbUZyYW1lID0gY29udGV4dC5nZXRGcmFtZU1hbmFnZXIoKS5uZXdGcmFtZShmb3JtYXQpOworICAgICAgICAgICAgbUZyYW1lLnNldEJpdG1hcChtQml0bWFwKTsKKworICAgICAgICAgICAgbUJpdG1hcC5yZWN5Y2xlKCk7CisgICAgICAgICAgICBtQml0bWFwID0gbnVsbDsKKyAgICAgICAgfQorICAgIH0KK30KZGlmZiAtLWdpdCBhL21lZGlhL21jYS9maWx0ZXJwYWNrcy9qYXZhL2FuZHJvaWQvZmlsdGVycGFja3MvaW1hZ2Vwcm9jL0JpdG1hcFNvdXJjZS5qYXZhIGIvbWVkaWEvbWNhL2ZpbHRlcnBhY2tzL2phdmEvYW5kcm9pZC9maWx0ZXJwYWNrcy9pbWFnZXByb2MvQml0bWFwU291cmNlLmphdmEKbmV3IGZpbGUgbW9kZSAxMDA2NDQKaW5kZXggMDAwMDAwMC4uOTc4ZmM5NAotLS0gL2Rldi9udWxsCisrKyBiL21lZGlhL21jYS9maWx0ZXJwYWNr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AgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbUJpdG1hcC5nZXRIZWlnaHQoKSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEltYWdlRm9ybWF0LkNPTE9SU1BBQ0VfUkdCQSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1UYXJnZXQpOworICAgICAgICBtSW1hZ2VGcmFtZSA9IGZpbHRlckNvbnRleHQuZ2V0RnJhbWVNYW5hZ2VyKCkubmV3RnJhbWUob3V0cHV0Rm9ybWF0KTsKKyAgICAgICAgbUltYWdlRnJhbWUuc2V0Qml0bWFwKG1CaXRtYXApOworICAgICAgICBtSW1hZ2VGcmFtZS5zZXRUaW1lc3RhbXAoRnJhbWUuVElNRVNUQU1QX1VOS05PV04pOworCisgICAgICAgIC8vIEZyZWUgdXAgc3BhY2UgdXNlZCBieSBiaXRtYXAKKyAgICAgICAgaWYgKG1SZWN5Y2xlQml0bWFwKSB7CisgICAgICAgICAgICBtQml0bWFwLnJlY3ljbGUoKTsKKyAgICAgICAgfQorICAgICAgICBtQml0bWFwID0gbnVsbDsKKyAgICB9CisKKyAgICBAT3ZlcnJpZGUKKyAgICBwdWJsaWMgdm9pZCBmaWVsZFBvcnRWYWx1ZVVwZGF0ZWQoU3RyaW5nIG5hbWUsIEZpbHRlckNvbnRleHQgY29udGV4dCkgeworICAgICAgICAvLyBDbGVhciBpbWFnZSAodG8gdHJpZ2dlciByZWxvYWQpIGluIGNhc2UgcGFyYW1ldGVycyBoYXZlIGJlZW4gY2hhbmdlZAorICAgICAgICBpZiAobmFtZS5lcXVhbHMoImJpdG1hcCIpIHx8IG5hbWUuZXF1YWxzKCJ0YXJnZXQiKSkgeworICAgICAgICAgICAgaWYgKG1JbWFnZUZyYW1lICE9IG51bGwpIHsKKyAgICAgICAgICAgICAgICBtSW1hZ2VGcmFtZS5yZWxlYXNlKCk7CisgICAgICAgICAgICAgICAgbUltYWdlRnJhbWUgPSBudWxsOworICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgfQorCisgICAgQE92ZXJyaWRlCisgICAgcHVibGljIHZvaWQgcHJvY2VzcyhGaWx0ZXJDb250ZXh0IGNvbnRleHQpIHsKKyAgICAgICAgaWYgKG1JbWFnZUZyYW1lID09IG51bGwpIHsKKyAgICAgICAgICAgIGxvYWRJbWFnZShjb250ZXh0KTsKKyAgICAgICAgfQorCisgICAgICAgIHB1c2hPdXRwdXQoImltYWdlIiwgbUltYWdlRnJhbWUpOworCisgICAgICAgIGlmICghbVJlcGVhdEZyYW1lKSB7CisgICAgICAgICAgICBjbG9zZU91dHB1dFBvcnQoImltYWdlIik7CisgICAgICAgIH0KKyAgICB9CisKKyAgICBAT3ZlcnJpZGUKKyAgICBwdWJsaWMgdm9pZCB0ZWFyRG93bihGaWx0ZXJDb250ZXh0IGVudikgeworICAgICAgICBpZiAobUltYWdlRnJhbWUgIT0gbnVsbCkgeworICAgICAgICAgICAgbUltYWdlRnJhbWUucmVsZWFzZSgpOworICAgICAgICAgICAgbUltYWdlRnJhbWUgPSBudWxsOworICAgICAgICB9CisgICAgfQorfQpkaWZmIC0tZ2l0IGEvbWVkaWEvbWNhL2ZpbHRlcnBhY2tzL2phdmEvYW5kcm9pZC9maWx0ZXJwYWNrcy9pbWFnZXByb2MvQmxhY2tXaGl0ZUZpbHRlci5qYXZhIGIvbWVkaWEvbWNhL2ZpbHRlcnBhY2tzL2phdmEvYW5kcm9pZC9maWx0ZXJwYWNrcy9pbWFnZXByb2MvQmxhY2tXaGl0ZUZpbHRlci5qYXZhCm5ldyBmaWxlIG1vZGUgMTAwNjQ0CmluZGV4IDAwMDAwMDAuLmExY2VjMDEKLS0tIC9kZXYvbnVsbAorKysgYi9tZWRpYS9tY2EvZmlsdGVycGFja3MvamF2YS9hbmRyb2lkL2ZpbHRlcnBhY2tzL2ltYWdlcHJvYy9CbGFja1doaXRlRml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VibGljIHZvaWQgaW5pdFByb2dyYW0oRmlsdGVyQ29udGV4dCBjb250ZXh0LCBpbnQgdGFyZ2V0KSB7CisgICAgICAgIHN3aXRjaCAodGFyZ2V0KSB7CisgICAgICAgICAgICBjYXNlIEZyYW1lRm9ybWF0LlRBUkdFVF9HUFU6CisgICAgICAgICAgICAgICAgU2hhZGVyUHJvZ3JhbSBzaGFkZXJQcm9ncmFtID0gbmV3IFNoYWRlclByb2dyYW0oY29udGV4dCwgbUJsYWNrV2hpdGVTaGFkZXIpOworICAgICAgICAgICAgICAgIHNoYWRlclByb2dyYW0uc2V0TWF4aW11bVRpbGVTaXplKG1UaWxlU2l6ZSk7CisgICAgICAgICAgICAgICAgbVByb2dyYW0gPSBzaGFkZXJQcm9ncmFtOworICAgICAgICAgICAgICAgIHVwZGF0ZVBhcmFtZXRlcnMoKTsKKyAgICAgICAgICAgICAgICBicmVhazsKKworICAgICAgICAgICAgZGVmYXVsdDoKKyAgICAgICAgICAgICAgICB0aHJvdyBuZXcgUnVudGltZUV4Y2VwdGlvbigiRmlsdGVyIFNoYXJwZW4gZG9lcyBub3Qgc3VwcG9ydCBmcmFtZXMgb2YgIiArCisgICAgICAgICAgICAgICAgICAgICJ0YXJnZXQgIiArIHRhcmdldCArICIhIik7CisgICAgICAgIH0KKyAgICAgICAgbVRhcmdldCA9IHRhcmdldDsKKyAgICB9CisKKyAgICBwcml2YXRlIHZvaWQgdXBkYXRlUGFyYW1ldGVycygpIHsKKyAgICAgICAgZmxvYXQgc2NhbGUgPSAobUJsYWNrICE9IG1XaGl0ZSkgPyAxLjBmIC8gKG1XaGl0ZSAtIG1CbGFjaykgOiAyMDAwZjsKKyAgICAgICAgZmxvYXQgc3RlcHNpemUgPSAxLjBmIC8gMjU1LjBmOworCisgICAgICAgIG1Qcm9ncmFtLnNldEhvc3RWYWx1ZSgiYmxhY2siLCBtQmxhY2spOworICAgICAgICBtUHJvZ3JhbS5zZXRIb3N0VmFsdWUoInNjYWxlIiwgc2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ZWlnaHQgPSBpbnB1dEZvcm1hdC5nZXRIZWlnaHQoKTsKKworICAgICAgICAgICAgaWYgKG1Ob2lzZUZyYW1lICE9IG51bGwpIHsKKyAgICAgICAgICAgICAgICBtTm9pc2VGcmFtZS5yZWxlYXNlKCk7CisgICAgICAgICAgICB9CisKKyAgICAgICAgICAgIGludFtdIGJ1ZmZlciA9IG5ldyBpbnRbbVdpZHRoICogbUhlaWdodF07CisgICAgICAgICAgICBmb3IgKGludCBpID0gMDsgaSA8IG1XaWR0aCAqIG1IZWlnaHQ7ICsraSkgeworICAgICAgICAgICAgICBidWZmZXJbaV0gPSBtUmFuZG9tLm5leHRJbnQoMjU1KTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIEZyYW1lRm9ybWF0IGZvcm1hdCA9IEltYWdlRm9ybWF0LmNyZWF0ZShtV2lkdGgsIG1IZWlnaHQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgSW1hZ2VGb3JtYXQuQ09MT1JTUEFDRV9SR0JBLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEZyYW1lRm9ybWF0LlRBUkdFVF9HUFUpOworICAgICAgICAgICAgbU5vaXNlRnJhbWUgPSBjb250ZXh0LmdldEZyYW1lTWFuYWdlcigpLm5ld0ZyYW1lKGZvcm1hdCk7CisgICAgICAgICAgICBtTm9pc2VGcmFtZS5zZXRJbnRzKGJ1ZmZlcik7CisgICAgICAgIH0KKworICAgICAgICBpZiAobU5vaXNlRnJhbWUgIT0gbnVsbCAmJiAobU5vaXNlRnJhbWUuZ2V0Rm9ybWF0KCkuZ2V0V2lkdGgoKSAhPSBtV2lkdGggfHwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1Ob2lzZUZyYW1lLmdldEZvcm1hdCgpLmdldEhlaWdodCgpICE9IG1IZWlnaHQpKSB7CisgICAgICAgICAgICB0aHJvdyBuZXcg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ZhdGUgZmluYWwgU3RyaW5nIG1Db2xvclRlbXBlcmF0dXJlU2hhZGVyID0KKyAgICAgICAgICAgICJwcmVjaXNpb24gbWVkaXVtcCBmbG9hdDtcbiIgKworICAgICAgICAgICAgInVuaWZvcm0gc2FtcGxlcjJEIHRleF9zYW1wbGVyXzA7XG4iICsKKyAgICAgICAgICAgICJ1bmlmb3JtIGZsb2F0IHNjYWxlO1xuIiArCisgICAgICAgICAgICAidmFyeWluZyB2ZWMyIHZfdGV4Y29vcmQ7XG4iICsKKyAgICAgICAgICAgICJ2b2lkIG1haW4oKSB7XG4iICsKKyAgICAgICAgICAgICIgIHZlYzQgY29sb3IgPSB0ZXh0dXJlMkQodGV4X3NhbXBsZXJfMCwgdl90ZXhjb29yZCk7XG4iICsKKyAgICAgICAgICAgICIgIHZlYzMgbmV3X2NvbG9yID0gY29sb3IucmdiO1xuIiArCisgICAgICAgICAgICAiICBuZXdfY29sb3IuciA9IGNvbG9yLnIgKyBjb2xvci5yICogKCAxLjAgLSBjb2xvci5yKSAqIHNjYWxlO1xuIiArCisgICAgICAgICAgICAiICBuZXdfY29sb3IuYiA9IGNvbG9yLmIgLSBjb2xvci5iICogKCAxLjAgLSBjb2xvci5iKSAqIHNjYWxlO1xuIiArCisgICAgICAgICAgICAiICBpZiAoc2NhbGUgPiAwLjApIHsgXG4iICsKKyAgICAgICAgICAgICIgICAgY29sb3IuZyA9IGNvbG9yLmcgKyBjb2xvci5nICogKCAxLjAgLSBjb2xvci5nKSAqIHNjYWxlICogMC4yNTtcbiIgKworICAgICAgICAgICAgIiAgfVxuIiArCisgICAgICAgICAgICAiICBmbG9hdCBtYXhfdmFsdWUgPSBtYXgobmV3X2NvbG9yLnIsIG1heChuZXdfY29sb3IuZywgbmV3X2NvbG9yLmIpKTtcbiIgKworICAgICAgICAgICAgIiAgaWYgKG1heF92YWx1ZSA+IDEuMCkgeyBcbiIgKworICAgICAgICAgICAgIiAgICAgbmV3X2NvbG9yIC89IG1heF92YWx1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bklucHV0KCJpbWFnZSIsICJpbWFnZSIpOworICAgIH0KKworICAgIHB1YmxpYyB2b2lkIGluaXRQcm9ncmFtKEZpbHRlckNvbnRleHQgY29udGV4dCwgaW50IHRhcmdldCkgeworICAgICAgICBzd2l0Y2ggKHRhcmdldCkgeworICAgICAgICAgICAgY2FzZSBGcmFtZUZvcm1hdC5UQVJHRVRfR1BVOgorICAgICAgICAgICAgICAgIFNoYWRlclByb2dyYW0gc2hhZGVyUHJvZ3JhbSA9IFNoYWRlclByb2dyYW0uY3JlYXRlSWRlbnRpdHkoY29udGV4dCk7CisgICAgICAgICAgICAgICAgc2hhZGVyUHJvZ3JhbS5zZXRNYXhpbXVtVGlsZVNpemUobVRpbGVTaXplKTsKKyAgICAgICAgICAgICAgICBtUHJvZ3JhbSA9IHNoYWRlclByb2dyYW07CisgICAgICAgICAgICAgICAgYnJlYWs7CisKKyAgICAgICAgICAgIGRlZmF1bHQ6CisgICAgICAgICAgICAgICAgdGhyb3cgbmV3IFJ1bnRpbWVFeGNlcHRpb24oIkZpbHRlciBTaGFycGVuIGRvZXMgbm90IHN1cHBvcnQgZnJhbWVzIG9mICIgKworICAgICAgICAgICAgICAgICAgICAidGFyZ2V0ICIgKyB0YXJnZXQgKyAiISIpOworICAgICAgICB9CisgICAgICAgIG1UYXJnZXQgPSB0YXJnZXQ7CisgICAgfQorCisgICAgQE92ZXJyaWRlCisgICAgcHVibGljIHZvaWQgZmllbGRQb3J0VmFsdWVVcGRhdGVkKFN0cmluZyBuYW1lLCBGaWx0ZXJDb250ZXh0IGNvbnRleHQpIHsKKyAgICAgICAgaWYgKG1Qcm9ncmFtICE9IG51bGwpIHsKKyAgICAgICAgICAgIHVwZGF0ZVNvdXJjZVJlY3QobVdpZHRoLCBtSGVpZ2h0KTsKKyAgICAgICAgfQorICAgIH0KKworICAgIEBPdmVycmlkZQorICAgIHB1YmxpYyB2b2lkIHByb2Nlc3MoRmlsdGVyQ29udGV4dCBjb250ZXh0KSB7CisgICAg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aW5wdXRGb3JtYXQuZ2V0V2lkdGgoKSwgaW5wdXRGb3JtYXQuZ2V0SGVpZ2h0KCkpOworICAgICAgICB9CisKKyAgICAgICAgLy8gUHJvY2VzcworICAgICAgICBtUHJvZ3JhbS5wcm9jZXNzKGlucHV0LCBvdXRwdXQpOworCisgICAgICAgIC8vIFB1c2ggb3V0cHV0CisgICAgICAgIHB1c2hPdXRwdXQoImltYWdlIiwgb3V0cHV0KTsKKworICAgICAgICAvLyBSZWxlYXNlIHB1c2hlZCBmcmFtZQorICAgICAgICBvdXRwdXQucmVsZWFzZSgpOworICAgIH0KKworICAgIHZvaWQgdXBkYXRlU291cmNlUmVjdChpbnQgd2lkdGgsIGludCBoZWlnaHQpIHsKKyAgICAgICAgbVdpZHRoID0gd2lkdGg7CisgICAgICAgIG1IZWlnaHQgPSBoZWlnaHQ7CisKKyAgICAgICAgLyoKKyAgICAgICAgTG9nLmUoIkNyb3BGaWx0ZXIiLCBtV2lkdGggKyAiLCAiICsgbUhlaWdodCArICIsICIgKworICAgICAgICAgICAgICAgICAgICAgICAgICAgIChmbG9hdCkgbVhvcmlnaW4gLyBtV2lkdGggKyAiLCAiICsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAoZmxvYXQpIG1Zb3JpZ2luIC8gbUhlaWdodCArICIsICIgKworICAgICAgICAgICAgICAgICAgICAgICAgICAgIChmbG9hdCkgbU91dHB1dFdpZHRoIC8gbVdpZHRoICsgIiwgIiArCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgKGZsb2F0KSBtT3V0cHV0SGVpZ2h0IC8gbUhlaWdodCk7CisgICAgICAgICovCisKKyAgICAgICAgKChTaGFkZXJQcm9ncmFtKSBtUHJvZ3JhbSkuc2V0U291cmNlUmVjdCgoZmxvYXQpIG1Yb3JpZ2luIC8gbVdpZHRoLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChmbG9hdCkgbVlvcmlnaW4gLyBtSGVpZ2h0L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uMCAtIGNvbG9yLnI7XG4iICsKKyAgICAgICAgICAgICIgIH1cbiIgKworICAgICAgICAgICAgIiAgZmxvYXQgcmVkID0gNC4wICogdmFsdWUgKiB2YWx1ZSAqIHZhbHVlO1xuIiArCisgICAgICAgICAgICAiICBpZiAoY29sb3IuciA8IDAuNSkge1xuIiArCisgICAgICAgICAgICAiICAgIG5jb2xvci5yID0gcmVkO1xuIiArCisgICAgICAgICAgICAiICB9IGVsc2Uge1xuIiArCisgICAgICAgICAgICAiICAgIG5jb2xvci5yID0gMS4wIC0gcmVkO1xuIiArCisgICAgICAgICAgICAiICB9XG4iICsKKyAgICAgICAgICAgICIgIGlmIChjb2xvci5nIDwgMC41KSB7XG4iICsKKyAgICAgICAgICAgICIgICAgdmFsdWUgPSBjb2xvci5nO1xuIiArCisgICAgICAgICAgICAiICB9IGVsc2Uge1xuIiArCisgICAgICAgICAgICAiICAgIHZhbHVlID0gMS4wIC0gY29sb3IuZztcbiIgKworICAgICAgICAgICAgIiAgfVxuIiArCisgICAgICAgICAgICAiICBmbG9hdCBncmVlbiA9IDIuMCAqIHZhbHVlICogdmFsdWU7XG4iICsKKyAgICAgICAgICAgICIgIGlmIChjb2xvci5nIDwgMC41KSB7XG4iICsKKyAgICAgICAgICAgICIgICAgbmNvbG9yLmcgPSBncmVlbjtcbiIgKworICAgICAgICAgICAgIiAgfSBlbHNlIHtcbiIgKworICAgICAgICAgICAgIiAgICBuY29sb3IuZyA9IDEuMCAtIGdyZWVuO1xuIiArCisgICAgICAgICAgICAiICB9XG4iICsKKyAgICAgICAgICAgICIgIG5jb2xvci5iID0gY29sb3IuYiAqIDAuNSArIDAuMjU7XG4iICsKKyAgICAgICAgICAgICIgIGdsX0ZyYWdDb2xvciA9IHZlYzQobmNvbG9yLnJnYiwgY29sb3IuYSk7XG4iICsKKyAgICAgICAgICAgICJ9XG4iOworCisgICAgcHVibGljIENyb3NzUHJvY2Vzc0ZpbHRlcihTdHJpbmcgbmFtZSkgeworICAgICAg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DA7CisKKyAgICBwcml2YXRlIFByb2dyYW0gbVByb2dyYW07CisKKyAgICBwcml2YXRlIGludCBtV2lkdGggPSAwOworICAgIHByaXZhdGUgaW50IG1IZWlnaHQgPSAwOworICAgIHByaXZhdGUgaW50IG1UYXJnZXQgPSBGcmFtZUZvcm1hdC5UQVJHRVRfVU5TUEVDSUZJRUQ7CisKKyAgICBwcml2YXRlIEZyYW1lIG1Ob2lzZUZyYW1lOworICAgIHByaXZhdGUgUmFuZG9tIG1SYW5kb207CisKKyAgICBwcml2YXRlIGZpbmFsIFN0cmluZyBtRG9jdW1lbnRhcnlTaGFkZXIgPQorICAgICAgICAgICAgInByZWNpc2lvbiBtZWRpdW1wIGZsb2F0O1xuIiArCisgICAgICAgICAgICAidW5pZm9ybSBzYW1wbGVyMkQgdGV4X3NhbXBsZXJfMDtcbiIgKworICAgICAgICAgICAgInVuaWZvcm0gc2FtcGxlcjJEIHRleF9zYW1wbGVyXzE7XG4iICsKKyAgICAgICAgICAgICJ1bmlmb3JtIGZsb2F0IHN0ZXBzaXplO1xuIiArCisgICAgICAgICAgICAidW5pZm9ybSBmbG9hdCBpbnZfbWF4X2Rpc3Q7XG4iICsKKyAgICAgICAgICAgICJ1bmlmb3JtIHZlYzIgY2VudGVyO1xuIiArCisgICAgICAgICAgICAidmFyeWluZyB2ZWMyIHZfdGV4Y29vcmQ7XG4iICsKKyAgICAgICAgICAgICJ2b2lkIG1haW4oKSB7XG4iICsKKyAgICAgICAgICAgIC8vIGJsYWNrIHdoaXRlCisgICAgICAgICAgICAiICB2ZWM0IGNvbG9yID0gdGV4dHVyZTJEKHRleF9zYW1wbGVyXzAsIHZfdGV4Y29vcmQpO1xuIiArCisgICAgICAgICAgICAiICBmbG9hdCBkaXRoZXIgPSB0ZXh0dXJlMkQodGV4X3NhbXBsZXJfMSwgdl90ZXhjb29yZCkucjtcbiIgKworICAgICAgICAgICAgIiAgdmVjMyB4Zm9ybSA9IGNsYW1wKDIuMCAqIGNvbG9yLnJnYiwgMC4wLCAxLjApO1xuIiArCisgICAgICAgICAgICAiICB2ZWMzIHRlbXAgPSBjbGFtcCgyLjAgKiAoY29sb3IucmdiICsgc3RlcHNpemUpLCAwLjAsIDEuMCk7XG4iICsKKyAgICAgICAgICAgICIgIHZlYzMgbmV3X2NvbG9yID0gY2xhbXAoeGZvcm0gKyAodGVtcCAtIHhmb3JtKSAqIChkaXRoZXIgLSAwLjUpLCAwLjAsIDEuMCk7XG4iICsKKyAgICAgICAgICAgIC8vIGdyYXlzY2FsZQorICAgICAgICAgICAgIiAgZmxvYXQgZ3JheSA9IGRvdChuZXdfY29sb3IsIHZlYzMoMC4yOTksIDAuNTg3LCAwLjExNCkpO1xuIiArCisgICAgICAgICAgICAiICBuZXdfY29sb3IgPSB2ZWMzKGdyYXksIGdyYXksIGdyYXkpO1xuIiArCisgICAgICAgICAgICAvLyB2aWduZXR0ZQorICAgICAgICAgICAgIiAgZmxvYXQgZGlzdCA9IGRpc3RhbmNlKGdsX0ZyYWdDb29yZC54eSwgY2VudGVyKTtcbiIgKworICAgICAgICAgICAgIiAgZmxvYXQgbHVtZW4gPSAwLjg1IC8gKDEuMCArIGV4cCgoZGlzdCAqIGludl9tYXhfZGlzdCAtIDAuODMpICogMjAuMCkpICsgMC4xNTtcbiIgKworICAgICAgICAgICAgIiAgZ2xfRnJhZ0NvbG9yID0gdmVjNChuZXdfY29sb3IgKiBsdW1lbiwgY29sb3IuYSk7XG4iICsKKyAgICAgICAgICAgICJ9XG4iOworCisgICAgcHVibGljIERvY3VtZW50YXJ5RmlsdGVyKFN0cmluZyBuYW1lKSB7CisgICAgICAgIHN1cGVyKG5hbWUpOworCisgICAgICAgIG1SYW5kb20gPSBuZXcgUmFuZG9tKCk7CisgICAgfQorCisgICAgQE92ZXJyaWRlCisgICAgcHVibGljIHZvaWQgc2V0dXBQb3J0cygpIHsKKyAgICAgICAgYWRkTWFza2VkSW5wdXRQb3J0KCJpbWFnZSIsIEltYWdlRm9ybWF0LmNyZWF0ZShJbWFnZUZvcm1hdC5DT0xPUlNQQUNFX1JHQkEpKTsKKyAgICAgICAgYWRkT3V0cHV0QmFzZWRPbklucHV0KCJpbWFnZSIsICJpbWFnZSIpOworICAgIH0KKworICAgIEBPdmVycmlkZQorICAgIHB1YmxpYyBGcmFtZUZvcm1hdCBnZXRPdXRwdXRGb3JtYXQoU3RyaW5nIHBvcnROYW1lLCBGcmFtZUZvcm1hdCBpbnB1dEZvcm1hdCkgeworICAgICAgICByZXR1cm4gaW5wdXRGb3JtYXQ7CisgICAgfQorCisgICAgQE92ZXJyaWRlCisgICAgcHVibGljIHZvaWQgdGVhckRvd24oRmlsdGVyQ29udGV4dCBjb250ZXh0KSB7CisgICAgICAgIGlmIChtTm9pc2VGcmFtZSAhPSBudWxsKSB7CisgICAgICAgICAgICBtTm9pc2VGcmFtZS5yZWxlYXNlKCk7CisgICAgICAgICAgICBtTm9pc2VGcmFtZSA9IG51bGw7CisgICAgICAgIH0KKyAgICB9CisKKyAgICBwdWJsaWMgdm9pZCBpbml0UHJvZ3JhbShGaWx0ZXJDb250ZXh0IGNvbnRleHQsIGludCB0YXJnZXQpIHsKKyAgICAgICAgc3dpdGNoICh0YXJnZXQpIHsKKyAgICAgICAgICAgIGNhc2UgRnJhbWVGb3JtYXQuVEFSR0VUX0dQVToKKyAgICAgICAgICAgICAgICBTaGFkZXJQcm9ncmFtIHNoYWRlclByb2dyYW0gPSBuZXcgU2hhZGVyUHJvZ3JhbShjb250ZXh0LCBtRG9jdW1lbnRhcnlTaGFkZXIpOworICAgICAgICAgICAgICAgIHNoYWRlclByb2dyYW0uc2V0TWF4aW11bVRpbGVTaXplKG1UaWxlU2l6ZSk7CisgICAgICAgICAgICAgICAgbVByb2dyYW0gPSBzaGFkZXJQcm9ncmFtOworICAgICAgICAgICAgICAgIGJyZWFrOworCisgICAgICAgICAgICBkZWZhdWx0OgorICAgICAgICAgICAgICAgIHRocm93IG5ldyBSdW50aW1lRXhjZXB0aW9uKCJGaW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IGkgPCBtV2lkdGggKiBtSGVpZ2h0OyArK2kpIHsKKyAgICAgICAgICAgICAgYnVmZmVyW2ldID0gbVJhbmRvbS5uZXh0SW50KDI1NSk7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBGcmFtZUZvcm1hdCBmb3JtYXQgPSBJbWFnZUZvcm1hdC5jcmVhdGUobVdpZHRoLCBtSGVpZ2h0LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEltYWdlRm9ybWF0LkNPTE9SU1BBQ0VfUkdCQSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBGcmFtZUZvcm1hdC5UQVJHRVRfR1BVKTsKKyAgICAgICAgICAgIGlmIChtTm9pc2VGcmFtZSAhPSBudWxsKSB7CisgICAgICAgICAgICAgICAgbU5vaXNlRnJhbWUucmVsZWFzZSgpOworICAgICAgICAgICAgfQorICAgICAgICAgICAgbU5vaXNlRnJhbWUgPSBjb250ZXh0LmdldEZyYW1lTWFuYWdlcigpLm5ld0ZyYW1lKGZvcm1hdCk7CisgICAgICAgICAgICBtTm9pc2VGcmFtZS5zZXRJbnRzKGJ1ZmZlcik7CisKKyAgICAgICAgICAgIGluaXRQYXJhbWV0ZXJzKCk7CisgICAgICAgIH0KKworICAgICAgICBpZiAobU5vaXNlRnJhbWUgIT0gbnVsbCAmJiAobU5vaXNlRnJhbWUuZ2V0Rm9ybWF0KCkuZ2V0V2lkdGgoKSAhPSBtV2lkdGggfHwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1Ob2lzZUZyYW1lLmdldEZvcm1hdCgpLmdldEhlaWdodCgpICE9IG1IZWlnaHQpKSB7CisgICAgICAgICAgICB0aHJvdyBuZXcgUnVudGltZUV4Y2VwdGlvbigiUmFuZG9tIG1hcCBhbmQgaW1wdXQgaW1hZ2Ugc2l6ZSBtaXNtYXRjaCEiKTsKKyAgICAgICAgfQorCisgICAg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YXJlKEZpbHRlckNvbnRleHQgY29udGV4dCkgeworICAgICAgICBtUHJvZ3JhbSA9IFNoYWRlclByb2dyYW0uY3JlYXRlSWRlbnRpdHkoY29udGV4dCk7CisgICAgfQorCisgICAgQE92ZXJyaWRlCisgICAgcHVibGljIHZvaWQgcHJvY2VzcyhGaWx0ZXJDb250ZXh0IGVudikgeworICAgICAgICAvLyBHZXQgaW5wdXQgZnJhbWUKKyAgICAgICAgRnJhbWUgc291cmNlRnJhbWUgPSBwdWxsSW5wdXQoInNvdXJjZSIpOworICAgICAgICBGcmFtZSBvdmVybGF5RnJhbWUgPSBwdWxsSW5wdXQoIm92ZXJsYXkiKTsKKyAgICAgICAgRnJhbWUgYm94RnJhbWUgPSBwdWxsSW5wdXQoImJveCIpOworCisgICAgICAgIC8vIEdldCB0aGUgYm94CisgICAgICAgIFF1YWQgYm94ID0gKFF1YWQpYm94RnJhbWUuZ2V0T2JqZWN0VmFsdWUoKTsKKyAgICAgICAgYm94ID0gYm94LnRyYW5zbGF0ZWQoMS4wZiwgMS4wZikuc2NhbGVkKDIuMGYpOworCisgICAgICAgIG1Qcm9ncmFtLnNldFRhcmdldFJlZ2lvbihib3gpOworCisgICAgICAgIC8vIENyZWF0ZSBvdXRwdXQgZnJhbWUgd2l0aCBjb3B5IG9mIGlucHV0CisgICAgICAgIEZyYW1lIG91dHB1dCA9IGVudi5nZXRGcmFtZU1hbmFnZXIoKS5uZXdGcmFtZShzb3VyY2VGcmFtZS5nZXRGb3JtYXQoKSk7CisgICAgICAgIG91dHB1dC5zZXREYXRhRnJvbUZyYW1lKHNvdXJjZUZyYW1lKTsKKworICAgICAgICAvLyBEcmF3IG9udG8gb3V0cHV0CisgICAgICAgIG1Qcm9ncmFtLnByb2Nlc3Mob3ZlcmxheUZyYW1lLCBvdXRwdXQpOworCisgICAgICAgIC8vIFB1c2ggb3V0cHV0CisgICAgICAgIHB1c2hPdXRwdXQoImltYWdlIiwgb3V0cHV0KTsKKworICAgICAgICAvLy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ICAgIC8vIEdldCBpbnB1dCBmcmFtZQorICAgICAgICBGcmFtZSBpbWFnZUZyYW1lID0gcHVsbElucHV0KCJpbWFnZSIpOworICAgICAgICBGcmFtZSBib3hGcmFtZSA9IHB1bGxJbnB1dCgiYm94Iik7CisKKyAgICAgICAgLy8gR2V0IHRoZSBib3gKKyAgICAgICAgUXVhZCBib3ggPSAoUXVhZClib3hGcmFtZS5nZXRPYmplY3RWYWx1ZSgpOworICAgICAgICBib3ggPSBib3guc2NhbGVkKDIuMGYpLnRyYW5zbGF0ZWQoLTEuMGYsIC0xLjBmKTsKKworICAgICAgICAvLyBDcmVhdGUgb3V0cHV0IGZyYW1lIHdpdGggY29weSBvZiBpbnB1dAorICAgICAgICBHTEZyYW1lIG91dHB1dCA9IChHTEZyYW1lKWVudi5nZXRGcmFtZU1hbmFnZXIoKS5kdXBsaWNhdGVGcmFtZShpbWFnZUZyYW1lKTsKKworICAgICAgICAvLyBEcmF3IG9udG8gb3V0cHV0CisgICAgICAgIG91dHB1dC5mb2N1cygpOworICAgICAgICByZW5kZXJCb3goYm94KTsKKworICAgICAgICAvLyBQdXNoIG91dHB1dAorICAgICAgICBwdXNoT3V0cHV0KCJpbWFnZSIsIG91dHB1dCk7CisKKyAgICAgICAgLy8gUmVsZWFzZSBwdXNoZWQgZnJhbWUKKyAgICAgICAgb3V0cHV0LnJlbGVhc2UoKTsKKyAgICB9CisKKyAgICBwcml2YXRlIHZvaWQgcmVuZGVyQm94KFF1YWQgYm94KSB7CisgICAgICAgIGZpbmFsIGludCBGTE9BVF9TSVpFID0gNDsKKworICAgICAgICAvLyBHZXQgY3VycmVudCB2YWx1ZXMKKyAgICAgICAgZmxvYXRbXSBjb2xvciA9IHttQ29sb3JSZWQsIG1Db2xvckdyZWVuLCBtQ29sb3JCbHVlLCAxZn07CisgICAgICAgIGZsb2F0W10gdmVydGV4VmFsdWVzID0geyBib3gucDAueCwgYm94LnAwLnksCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC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1dCgiaW1hZ2UiLCAiaW1hZ2UiKTsKKyAgICB9CisKKyAgICBAT3ZlcnJpZGUKKyAgICBwdWJsaWMgRnJhbWVGb3JtYXQgZ2V0T3V0cHV0Rm9ybWF0KFN0cmluZyBwb3J0TmFtZSwgRnJhbWVGb3JtYXQgaW5wdXRGb3JtYXQpIHsKKyAgICAgICAgcmV0dXJuIGlucHV0Rm9ybWF0OworICAgIH0KKworICAgIHB1YmxpYyB2b2lkIGluaXRQcm9ncmFtKEZpbHRlckNvbnRleHQgY29udGV4dCwgaW50IHRhcmdldCkgeworICAgICAgICBzd2l0Y2ggKHRhcmdldCkgeworICAgICAgICAgICAgY2FzZSBGcmFtZUZvcm1hdC5UQVJHRVRfR1BVOgorICAgICAgICAgICAgICAgIFNoYWRlclByb2dyYW0gc2hhZGVyUHJvZ3JhbSA9IG5ldyBTaGFkZXJQcm9ncmFtKGNvbnRleHQsIG1EdW90b25lU2hhZGVyKTsKKyAgICAgICAgICAgICAgICBzaGFkZXJQcm9ncmFtLnNldE1heGltdW1UaWxlU2l6ZShtVGlsZVNpemUpOworICAgICAgICAgICAgICAgIG1Qcm9ncmFtID0gc2hhZGVyUHJvZ3JhbTsKKyAgICAgICAgICAgICAgICBicmVhazsKKworICAgICAgICAgICAgZGVmYXVsdDoKKyAgICAgICAgICAgICAgICB0aHJvdyBuZXcgUnVudGltZUV4Y2VwdGlvbigiRmlsdGVyIER1b3RvbmUgZG9lcyBub3Qgc3VwcG9ydCBmcmFtZXMgb2YgIiArCisgICAgICAgICAgICAgICAgICAgICJ0YXJnZXQgIiArIHRhcmdldCArICIhIik7CisgICAgICAgIH0KKyAgICAgICAgbVRhcmdldCA9IHRhcmdldDsKKyAgICB9CisKKyAgICBAT3ZlcnJpZGUKKyAgICBwdWJsaWMgdm9pZCBwcm9jZXNzKEZpbHRlckNvbnRleHQgY29udGV4dCkgeworICAgICAgICAvLyBHZXQgaW5wdXQgZnJhbWUKKyAgICAgICAgRnJhbWUgaW5wdXQgP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ntcbiIgKworICAgICAgICAgICAgIiAgY29uc3QgdmVjMyBjb2xvcl93ZWlnaHRzID0gdmVjMygwLjI1LCAwLjUsIDAuMjUpO1xuIiArCisgICAgICAgICAgICAiICB2ZWM0IGNvbG9yID0gdGV4dHVyZTJEKHRleF9zYW1wbGVyXzAsIHZfdGV4Y29vcmQpO1xuIiArCisgICAgICAgICAgICAiICBmbG9hdCBsaWdodG1hc2sgPSBkb3QoY29sb3IucmdiLCBjb2xvcl93ZWlnaHRzKTtcbiIgKworICAgICAgICAgICAgIiAgZmxvYXQgYmFja21hc2sgPSAoMS4wIC0gbGlnaHRtYXNrKTtcbiIgKworICAgICAgICAgICAgIiAgdmVjMyBvbmVzID0gdmVjMygxLjAsIDEuMCwgMS4wKTtcbiIgKworICAgICAgICAgICAgIiAgdmVjMyBkaWZmID0gcG93KG11bHQgKiBjb2xvci5yZ2IsIGlnYW1tYSAqIG9uZXMpIC0gY29sb3IucmdiO1xuIiArCisgICAgICAgICAgICAiICBkaWZmID0gbWluKGRpZmYsIDEuMCk7XG4iICsKKyAgICAgICAgICAgICIgIHZlYzMgbmV3X2NvbG9yID0gbWluKGNvbG9yLnJnYiArIGRpZmYgKiBiYWNrbWFzaywgMS4wKTtcbiIgKworICAgICAgICAgICAgIiAgZ2xfRnJhZ0NvbG9yID0gdmVjNChuZXdfY29sb3IsIGNvbG9yLmEpO1xuIiArCisgICAgICAgICAgICAifVxuIjsKKworICAgIHB1YmxpYyBGaWxsTGlnaHRGaWx0ZXIoU3RyaW5nIG5hbWUpIHsKKyAgICAgIHN1cGVyKG5hbWUpOworICAgIH0KKworICAgIEBPdmVycmlkZQorICAgIHB1YmxpYyB2b2lkIHNldHVwUG9ydHMoKSB7CisgICAgICAgIGFkZE1hc2tlZElucHV0UG9ydCgiaW1hZ2UiLCBJbWFnZUZvcm1hdC5jcmVhdGUoSW1hZ2VGb3JtYXQuQ09MT1JTUEFDRV9SR0JBKSk7CisgICAgICAgIGFkZE91dHB1dEJhc2VkT25JbnB1dCgiaW1hZ2UiLCAiaW1hZ2UiKTsKKyAgICB9CisKKyAgICBAT3ZlcnJpZGUKKyAgICBwdWJsaWMgRnJhbWVGb3JtYXQgZ2V0T3V0cHV0Rm9ybWF0KFN0cmluZyBwb3J0TmFtZSwgRnJhbWVGb3JtYXQgaW5wdXRGb3JtYXQpIHsKKyAgICAgICAgcmV0dXJuIGlucHV0Rm9ybWF0OworICAgIH0KKworICAgIHB1YmxpYyB2b2lkIGluaXRQcm9ncmFtKEZpbHRlckNvbnRleHQgY29udGV4dCwgaW50IHRhcmdldCkgeworICAgICAgICBzd2l0Y2ggKHRhcmdldCkgeworICAgICAgICAgICAgY2FzZSBGcmFtZUZvcm1hdC5UQVJHRVRfR1BVOgorICAgICAgICAgICAgICAgIFNoYWRlclByb2dyYW0gc2hhZGVyUHJvZ3JhbSA9IG5ldyBTaGFkZXJQcm9ncmFtKGNvbnRleHQsIG1GaWxsTGlnaHRTaGFkZXIpOworICAgICAgICAgICAgICAgIExvZy5lKCJGaWxsTGlnaHQiLCAidGlsZSBzaXplOiAiICsgbVRpbGVTaXplKTsKKyAgICAgICAgICAgICAgICBzaGFkZXJQcm9ncmFtLnNldE1heGltdW1UaWxlU2l6ZShtVGlsZVNpemUpOworICAgICAgICAgICAgICAgIG1Qcm9ncmFtID0gc2hhZGVyUHJvZ3JhbTsKKyAgICAgICAgICAgICAgICBicmVhazsKKworICAgICAgICAgICAgZGVmYXVsdDoKKyAgICAgICAgICAgICAgICB0aHJvdyBuZXcgUnVudGltZUV4Y2VwdGlvbigiRmlsdGVyIEZpbGxMaWdodCBkb2VzIG5vdCBzdXBwb3J0IGZyYW1lcyBvZiAiICsKKyAgICAgICAgICAgICAgICAgICAgInRhcmdldCAiICsgdGFyZ2V0ICsgIiEiKTsKKyAgICAgICAgfQorICAgICAgICBtVGFyZ2V0ID0gdGFyZ2V0OworICAgIH0KKworCisgICAgQE92ZXJyaWRlCisgICAgcHVibGljIHZvaWQgcHJvY2Vzcyh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tYXQpIHsKKyAgICAgICAgcmV0dXJuIGlucHV0Rm9ybWF0OworICAgIH0KKworICAgIHB1YmxpYyB2b2lkIGluaXRQcm9ncmFtKEZpbHRlckNvbnRleHQgY29udGV4dCwgaW50IHRhcmdldCkgeworICAgICAgICBzd2l0Y2ggKHRhcmdldCkgeworICAgICAgICAgICAgY2FzZSBGcmFtZUZvcm1hdC5UQVJHRVRfR1BVOgorICAgICAgICAgICAgICAgIFNoYWRlclByb2dyYW0gc2hhZGVyUHJvZ3JhbSA9IG5ldyBTaGFkZXJQcm9ncmFtKGNvbnRleHQsIG1GaXNoZXllU2hhZGVyKTsKKyAgICAgICAgICAgICAgICBzaGFkZXJQcm9ncmFtLnNldE1heGltdW1UaWxlU2l6ZShtVGlsZVNpemUpOworICAgICAgICAgICAgICAgIG1Qcm9ncmFtID0gc2hhZGVyUHJvZ3JhbTsKKyAgICAgICAgICAgICAgICBicmVhazsKKworICAgICAgICAgICAgZGVmYXVsdDoKKyAgICAgICAgICAgICAgICB0aHJvdyBuZXcgUnVudGltZUV4Y2VwdGlvbigiRmlsdGVyIEZpc2hleWVGaWx0ZXIgZG9lcyBub3Qgc3VwcG9ydCBmcmFtZXMgb2YgIiArCisgICAgICAgICAgICAgICAgICAgICJ0YXJnZXQgIiArIHRhcmdldCArICIhIik7CisgICAgICAgIH0KKyAgICAgICAgbVRhcmdldCA9IHRhcmdldDsKKyAgICB9CisKKyAgICBAT3ZlcnJpZGUKKyAgICBwdWJsaWMgdm9pZCBwcm9jZXNzKEZpbHRlckNvbnRleHQgY29udGV4dCkgeworICAgICAgICAvLyBHZXQgaW5wdXQgZnJhbWUKKyAgICAgICAgRnJhbWUgaW5wdXQgPSBwdWxsSW5wdXQoImltYWdlIik7CisgICAgICAgIEZyYW1lRm9ybWF0IGlucHV0Rm9ybWF0ID0gaW5wdXQuZ2V0Rm9ybWF0KCk7CisKKyAgICAgICAgLy8gQ3JlYXRlIG91dHB1dCBmcmFtZQorICAgICAgICBGcmFtZS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DMgPSBuZXcgUG9pbnQoMC4wZiwgMS4wZik7CisgICAgICAgIFBvaW50IHA0ID0gbmV3IFBvaW50KDEuMGYsIDEuMGYpOworICAgICAgICBRdWFkIHNvdXJjZVJlZ2lvbjsKKyAgICAgICAgc3dpdGNoICgoKGludClNYXRoLnJvdW5kKG1Sb3RhdGlvbiAvIDkwZikpICUgNCkgeworICAgICAgICAgICAgY2FzZSAxOgorICAgICAgICAgICAgICAgIHNvdXJjZVJlZ2lvbiA9IG5ldyBRdWFkKHAzLHAxLHA0LHAyKTsKKyAgICAgICAgICAgICAgICBvdXRwdXRGb3JtYXQuc2V0RGltZW5zaW9ucyhoZWlnaHQsIHdpZHRoKTsKKyAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgIGNhc2UgMjoKKyAgICAgICAgICAgICAgICBzb3VyY2VSZWdpb24gPSBuZXcgUXVhZChwNCxwMyxwMixwMSk7CisgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICBjYXNlIDM6CisgICAgICAgICAgICAgICAgc291cmNlUmVnaW9uID0gbmV3IFF1YWQocDIscDQscDEscDMpOworICAgICAgICAgICAgICAgIG91dHB1dEZvcm1hdC5zZXREaW1lbnNpb25zKGhlaWdodCwgd2lkdGgpOworICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgY2FzZSAwOgorICAgICAgICAgICAgZGVmYXVsdDoKKyAgICAgICAgICAgICAgICBzb3VyY2VSZWdpb24gPSBuZXcgUXVhZChwMSxwMixwMyxwNCk7CisgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgIH0KKyAgICAgICAgLy8gQ3JlYXRlIG91dHB1dCBmcmFtZQorICAgICAgICBGcmFtZSBvdXRwdXQgPSBjb250ZXh0LmdldEZyYW1lTWFuYWdlcigpLm5ld0ZyYW1lKG91dHB1dEZvcm1hdCk7CisKKyAgICAgICAgLy8gU2V0IHRoZSBzb3VyY2UgcmVnaW9uCisgICAgICAgIG1Qcm9ncmFtL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TsKKyAgICAgICAgYWRkT3V0cHV0QmFzZWRPbklucHV0KCJpbWFnZSIsICJpbWFnZSIpOworICAgIH0KKworICAgIEBPdmVycmlkZQorICAgIHB1YmxpYyBGcmFtZUZvcm1hdCBnZXRPdXRwdXRGb3JtYXQoU3RyaW5nIHBvcnROYW1lLCBGcmFtZUZvcm1hdCBpbnB1dEZvcm1hdCkgeworICAgICAgICByZXR1cm4gaW5wdXRGb3JtYXQ7CisgICAgfQorCisgICAgcHVibGljIHZvaWQgaW5pdFByb2dyYW0oRmlsdGVyQ29udGV4dCBjb250ZXh0LCBpbnQgdGFyZ2V0KSB7CisgICAgICAgIHN3aXRjaCAodGFyZ2V0KSB7CisgICAgICAgICAgICBjYXNlIEZyYW1lRm9ybWF0LlRBUkdFVF9HUFU6CisgICAgICAgICAgICAgICAgU2hhZGVyUHJvZ3JhbSBzaGFkZXJQcm9ncmFtID0gU2hhZGVyUHJvZ3JhbS5jcmVhdGVJZGVudGl0eShjb250ZXh0KTsKKyAgICAgICAgICAgICAgICBzaGFkZXJQcm9ncmFtLnNldE1heGltdW1UaWxlU2l6ZShtVGlsZVNpemUpOworICAgICAgICAgICAgICAgIG1Qcm9ncmFtID0gc2hhZGVyUHJvZ3JhbTsKKyAgICAgICAgICAgICAgICBicmVhazsKKworICAgICAgICAgICAgZGVmYXVsdDoKKyAgICAgICAgICAgICAgICB0aHJvdyBuZXcgUnVudGltZUV4Y2VwdGlvbigiRmlsdGVyIFNoYXJwZW4gZG9lcyBub3Qgc3VwcG9ydCBmcmFtZXMgb2YgIiArCisgICAgICAgICAgICAgICAgICAgICJ0YXJnZXQgIiArIHRhcmdldCArICIhIik7CisgICAgICAgIH0KKyAgICAgICAgbVRhcmdldCA9IHRhcmdldDsKKyAgICAgICAgdXBkYXRlUGFyYW1ldGVycygpOworICAgIH0KKworICAgIEBPdmVycmlkZQorICAgIHB1YmxpYyB2b2lkIGZpZWxkUG9ydFZhbHVlVXBkYXRlZChTdHJpbmcgbmFtZSw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AgIH0KKworICAgIHB1YmxpYyB2b2lkIGluaXRQcm9ncmFtKEZpbHRlckNvbnRleHQgY29udGV4dCwgaW50IHRhcmdldCkgeworICAgICAgICBzd2l0Y2ggKHRhcmdldCkgeworICAgICAgICAgICAgY2FzZSBGcmFtZUZvcm1hdC5UQVJHRVRfR1BVOgorICAgICAgICAgICAgICAgIFNoYWRlclByb2dyYW0gc2hhZGVyUHJvZ3JhbSA9IG5ldyBTaGFkZXJQcm9ncmFtKGNvbnRleHQsIG1HcmFpblNoYWRlcik7CisgICAgICAgICAgICAgICAgc2hhZGVyUHJvZ3JhbS5zZXRNYXhpbXVtVGlsZVNpemUobVRpbGVTaXplKTsKKyAgICAgICAgICAgICAgICBtUHJvZ3JhbSA9IHNoYWRlclByb2dyYW07CisgICAgICAgICAgICAgICAgYnJlYWs7CisKKyAgICAgICAgICAgIGRlZmF1bHQ6CisgICAgICAgICAgICAgICAgdGhyb3cgbmV3IFJ1bnRpbWVFeGNlcHRpb24oIkZpbHRlciBTaGFycGVuIGRvZXMgbm90IHN1cHBvcnQgZnJhbWVzIG9mICIgKworICAgICAgICAgICAgICAgICAgICAidGFyZ2V0ICIgKyB0YXJnZXQgKyAiISIpOworICAgICAgICB9CisgICAgICAgIG1UYXJnZXQgPSB0YXJnZXQ7CisgICAgfQorCisgICAgcHJpdmF0ZSB2b2lkIHVwZGF0ZVBhcmFtZXRlcnMoKSB7CisgICAgICAgIG1Qcm9ncmFtLnNldEhvc3RWYWx1ZSgic2NhbGUiLCBtU2NhbGUpOworICAgIH0KKworICAgIHByaXZhdGUgdm9pZCB1cGRhdGVGcmFtZVNpemUoaW50IHdpZHRoLCBpbnQgaGVpZ2h0KSB7CisgICAgICAgIG1XaWR0aCA9IHdpZHRoOworICAgICAgICBtSGVpZ2h0ID0gaGVpZ2h0OworCisgICAgICAgIGlmIChtUHJvZ3JhbSAhPSBudWxsKSB7CisgICAgICAgICAgICBtUHJvZ3JhbS5zZXRIb3N0VmFsdWUoInN0ZXBYIiwgMC41ZiAvIG1XaWR0aCk7CisgICAgICAgICAgICBtUHJvZ3JhbS5zZXRIb3N0VmFsdWUoInN0ZXBZIiwgMC41ZiAvIG1IZWlnaHQpOworICAgICAgICAgICAgdXBkYXRlUGFyYW1ldGVycygpOworICAgICAgICB9CisgICAgfQorCisgICAgQE92ZXJyaWRlCisgICAgcHVibGljIHZvaWQgZmllbGRQb3J0VmFsdWVVcGRhdGVkKFN0cmluZyBuYW1lLCBGaWx0ZXJDb250ZXh0IGNvbnRleHQpIHsKKyAgICAgICAgaWYgKG1Qcm9ncmFtICE9IG51bGwpIHsKKyAgICAgICAgICAgIHVwZGF0ZVBhcmFtZXRlcnMoKTsKKyAgICAgICAgfQorICAgIH0KKworICAgIEBPdmVycmlkZQorICAgIHB1YmxpYyB2b2lkIHRlYXJEb3duKEZpbHRlckNvbnRleHQgY29udGV4dCkgeworICAgICAgICBpZiAobU5vaXNlRnJhbWUgIT0gbnVsbCkgeworICAgICAgICAgICAgbU5vaXNlRnJhbWUucmVsZWFzZSgpOworICAgICAgICAgICAgbU5vaXNlRnJhbWUgPSBudWxsOworICAgICAgICB9CisgICAgfQorCisgICAgQE92ZXJyaWRlCisgICAgcHVibGljIHZvaWQgcHJvY2VzcyhGaWx0ZXJDb250ZXh0IGNvbnRleHQpIHsKKyAgICAgICAgLy8gR2V0IGlucHV0IGZyYW1lCisgICAgICAgIEZyYW1lIGlucHV0ID0gcHVsbElucHV0KCJpbWFnZSIpOworICAgICAgICBGcmFtZUZvcm1hdCBpbnB1dEZvcm1hdCA9IGlucHV0LmdldEZvcm1hdCgpOworCisgICAgICAgIC8vIENyZWF0ZSBvdXRwdXQgZnJhbWUKKyAgICAgICAgRnJhbWUgb3V0cHV0ID0gY29udGV4dC5nZXRGcmFtZU1hbmFnZXIoKS5uZXdGcmFtZShpbnB1dEZvcm1hdCk7CisKKyAgICAgICAgLy8gQ3JlYXRlIHByb2dyYW0gaWYgbm90IGNyZWF0ZWQgYWxyZWFkeQorICAgICAgICBpZiAobVByb2dyYW0gPT0gbnVsbCB8fCBpbnB1dEZvcm1hdC5nZXRUYXJnZXQoKSAhPSBtVGFyZ2V0KSB7CisgICAgICAgICAgICBpbml0UHJvZ3JhbShjb250ZXh0LCBpbnB1dEZvcm1hdC5nZXRUYXJnZXQoKSk7CisgICAgICAgICAgICB1cGRhdGVQYXJhbWV0ZXJzKCk7CisgICAgICAgIH0KKworICAgICAgICAvLyBDaGVjayBpZiB0aGUgZnJhbWUgc2l6ZSBoYXMgY2hhbmdlZAorICAgICAgICBpZiAoaW5wdXRGb3JtYXQuZ2V0V2lkdGgoKSAhPSBtV2lkdGggfHwgaW5wdXRGb3JtYXQuZ2V0SGVpZ2h0KCkgIT0gbUhlaWdodCkgeworICAgICAgICAgICAgdXBkYXRlRnJhbWVTaXplKGlucHV0Rm9ybWF0LmdldFdpZHRoKCksIGlucHV0Rm9ybWF0LmdldEhlaWdodCgpKTsKKworICAgICAgICAgICAgaW50W10gYnVmZmVyID0gbmV3IGludFttV2lkdGggKiBtSGVpZ2h0XTsKKyAgICAgICAgICAgIGZvciAoaW50IGkgPSAwOyBpIDwgbVdpZHRoICogbUhlaWdodDsgKytpKSB7CisgICAgICAgICAgICAgICAgYnVmZmVyW2ldID0gKG1SYW5kb20ubmV4dEludCgyNTYpIDwgUkFORF9USFJFU0hPTEQpID8KKyAgICAgICAgICAgICAgICAgICAgbVJhbmRvbS5uZXh0SW50KDI1NikgOiAwOworICAgICAgICAgICAgfQorICAgICAgICAgICAgRnJhbWVGb3JtYXQgZm9ybWF0ID0gSW1hZ2VGb3JtYXQuY3JlYXRlKG1XaWR0aCwgbUhlaWdodCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBJbWFnZUZvcm1hdC5DT0xPUlNQQUNFX1JHQkEsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgRnJhbWVGb3JtYXQuVEFSR0VUX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hbWV0ZXJOYW1lOworICAgIHByb3RlY3RlZCBpbnQgbUN1cnJlbnRUYXJnZXQgPSBGcmFtZUZvcm1hdC5UQVJHRVRfVU5TUEVDSUZJRUQ7CisKKyAgICBwdWJsaWMgSW1hZ2VDb21iaW5lRmlsdGVyKFN0cmluZyBuYW1lLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgU3RyaW5nW10gaW5wdXROYW1lcywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFN0cmluZyBvdXRwdXROYW1lLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgU3RyaW5nIHBhcmFtZXRlck5hbWUpIHsKKyAgICAgICAgc3VwZXIobmFtZSk7CisgICAgICAgIG1JbnB1dE5hbWVzID0gaW5wdXROYW1lczsKKyAgICAgICAgbU91dHB1dE5hbWUgPSBvdXRwdXROYW1lOworICAgICAgICBtUGFyYW1ldGVyTmFtZSA9IHBhcmFtZXRlck5hbWU7CisgICAgfQorCisgICAgQE92ZXJyaWRlCisgICAgcHVibGljIHZvaWQgc2V0dXBQb3J0cygpIHsKKyAgICAgICAgaWYgKG1QYXJhbWV0ZXJOYW1lICE9IG51bGwpIHsKKyAgICAgICAgICAgIHRyeSB7CisgICAgICAgICAgICAgICAgRmllbGQgcHJvZ3JhbUZpZWxkID0gSW1hZ2VDb21iaW5lRmlsdGVyLmNsYXNzLmdldERlY2xhcmVkRmllbGQoIm1Qcm9ncmFtIik7CisgICAgICAgICAgICAgICAgYWRkUHJvZ3JhbVBvcnQobVBhcmFtZXRlck5hbWUsIG1QYXJhbWV0ZXJOYW1lLCBwcm9ncmFtRmllbGQsIGZsb2F0LmNsYXNzLCBmYWxzZSk7CisgICAgICAgICAgICB9IGNhdGNoIChOb1N1Y2hGaWVsZEV4Y2VwdGlvbiBlKSB7CisgICAgICAgICAgICAgICAgdGhyb3cgbmV3IFJ1bnRpbWVFeGNlcHRpb24oIkludGVybmFsIEVycm9yOiBtUHJvZ3JhbSBmaWVsZCBub3Q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AgICAgICBzd2l0Y2ggKHRhcmdldCkgeworICAgICAgICAgICAgICAgIGNhc2UgRnJhbWVGb3JtYXQuVEFSR0VUX05BVElWRToKKyAgICAgICAgICAgICAgICAgICAgbVByb2dyYW0gPSBnZXROYXRpdmVQcm9ncmFtKGNvbnRleHQpOworICAgICAgICAgICAgICAgICAgICBicmVhazsKKworICAgICAgICAgICAgICAgIGNhc2UgRnJhbWVGb3JtYXQuVEFSR0VUX0dQVToKKyAgICAgICAgICAgICAgICAgICAgbVByb2dyYW0gPSBnZXRTaGFkZXJQcm9ncmFtKGNvbnRleHQpOworICAgICAgICAgICAgICAgICAgICBicmVhazsKKworICAgICAgICAgICAgICAgIGRlZmF1bHQ6CisgICAgICAgICAgICAgICAgICAgIG1Qcm9ncmFtID0gbnVsbDsKKyAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBpZiAobVByb2dyYW0gPT0gbnVsbCkgeworICAgICAgICAgICAgICAgIHRocm93IG5ldyBSdW50aW1lRXhjZXB0aW9uKCJDb3VsZCBub3QgY3JlYXRlIGEgcHJvZ3JhbSBmb3IgaW1hZ2UgZmlsdGVyICIKKyAgICAgICAgICAgICAgICAgICAgKyB0aGlzICsgIiEiKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGluaXRQcm9ncmFtSW5wdXRzKG1Qcm9ncmFtLCBjb250ZXh0KTsKKyAgICAgICAgICAgIG1DdXJyZW50VGFyZ2V0ID0gdGFyZ2V0OworICAgICAgICB9CisgICAgfQorCisgICAgcHJvdGVjdGVkIGFic3RyYWN0IFByb2dyYW0gZ2V0TmF0aXZlUHJvZ3JhbShGaWx0ZXJDb250ZXh0IGNvbnRleHQpOworCisgICAgcHJvdGVjdGVkIGFic3RyYWN0IFByb2dyYW0gZ2V0U2hhZGVyUHJvZ3JhbShGaWx0ZXJDb250ZXh0IGNvbnRleHQpOworfQpkaWZmIC0tZ2l0IGEvbWVkaWEvbWNhL2Zp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ICAgICAgICAgICAgICAgICgoZmxvYXQpIG1PdXRwdXRXaWR0aCkgLyBtSW5wdXRXaWR0aCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoKGZsb2F0KSBtT3V0cHV0SGVpZ2h0KSAvIG1JbnB1dEhlaWdodCk7CisKKyAgICAgICAgLy8gUHJvY2VzcworICAgICAgICBtUHJvZ3JhbS5wcm9jZXNzKG1PcmlnaW5hbEZyYW1lLCBvdXRwdXQpOworICAgICAgICBtU2xpY2VJbmRleCsrOworCisgICAgICAgIGlmIChtU2xpY2VJbmRleCA9PSBtWFNsaWNlcyAqIG1ZU2xpY2VzKSB7CisgICAgICAgICAgICBtU2xpY2VJbmRleCA9IDA7CisgICAgICAgICAgICBtT3JpZ2luYWxGcmFtZS5yZWxlYXNlKCk7CisgICAgICAgICAgICBzZXRXYWl0c09uSW5wdXRQb3J0KCJpbWFnZSIsIHRydWUpOworICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgLy8gUmV0YWluIHRoZSBvcmlnaW5hbCBmcmFtZSBzbyBpdCBjYW4gYmUgdXNlZCBuZXh0IHRpbWUuCisgICAgICAgICAgICBtT3JpZ2luYWxGcmFtZS5yZXRhaW4oKTsKKyAgICAgICAgICAgIHNldFdhaXRzT25JbnB1dFBvcnQoImltYWdlIiwgZmFsc2UpOworICAgICAgICB9CisKKyAgICAgICAgLy8gUHVzaCBvdXRwdXQKKyAgICAgICAgcHVzaE91dHB1dCgiaW1hZ2UiLCBvdXRwdXQpOworCisgICAgICAgIC8vIFJlbGVhc2UgcHVzaGVkIGZyYW1lCisgICAgICAgIG91dHB1dC5yZWxlYXNlKCk7CisgICAgfQorfQpkaWZmIC0tZ2l0IGEvbWVkaWEvbWNhL2ZpbHRlcnBhY2tzL2phdmEvYW5kcm9pZC9maWx0ZXJwYWNrcy9pbWFnZXByb2MvSW1hZ2VTdGl0Y2hlci5qYXZhIGIvbWVkaWEvbWNhL2ZpbHRlcnB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uYW1lID0gInBhZFNpemUiKQorICAgIHByaXZhdGUgaW50IG1QYWRTaXplOworCisgICAgcHJpdmF0ZSBQcm9ncmFtIG1Qcm9ncmFtOworICAgIHByaXZhdGUgRnJhbWUgbU91dHB1dEZyYW1lOworCisgICAgcHJpdmF0ZSBpbnQgbUlucHV0V2lkdGg7CisgICAgcHJpdmF0ZSBpbnQgbUlucHV0SGVpZ2h0OworCisgICAgcHJpdmF0ZSBpbnQgbUltYWdlV2lkdGg7CisgICAgcHJpdmF0ZSBpbnQgbUltYWdlSGVpZ2h0OworCisgICAgcHJpdmF0ZSBpbnQgbVNsaWNlV2lkdGg7CisgICAgcHJpdmF0ZSBpbnQgbVNsaWNlSGVpZ2h0OworCisgICAgcHJpdmF0ZSBpbnQgbVNsaWNlSW5kZXg7CisKKyAgICBwdWJsaWMgSW1hZ2VTdGl0Y2hlcihTdHJpbmcgbmFtZSkgeworICAgICAgICBzdXBlcihuYW1lKTsKKyAgICAgICAgbVNsaWNlSW5kZXggPSAwOworICAgIH0KKworICAgIEBPdmVycmlkZQorICAgIHB1YmxpYyB2b2lkIHNldHVwUG9ydHMoKSB7CisgICAgICAgIGFkZE1hc2tlZElucHV0UG9ydCgiaW1hZ2UiLCBJbWFnZUZvcm1hdC5jcmVhdGUoSW1hZ2VGb3JtYXQuQ09MT1JTUEFDRV9SR0JBLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgRnJhbWVGb3JtYXQuVEFSR0VUX0dQVSkpOworICAgICAgICBhZGRPdXRwdXRCYXNlZE9uSW5wdXQoImltYWdlIiwgImltYWdlIik7CisgICAgfQorCisgICAgQE92ZXJyaWRlCisgICAgcHVibGljIEZyYW1lRm9ybWF0IGdldE91dHB1dEZvcm1hdChTdHJpbmcgcG9ydE5hbWUsIEZyYW1lRm9ybWF0IGlucHV0Rm9ybWF0KSB7CisgICAgICAgIHJldHVybiBpbnB1dEZvcm1hdDsKKyAgICB9CisKKyAgIC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oLm1pbihtU2xpY2VXaWR0aCwgbUltYWdlV2lkdGggLSBvdXRwdXRPZmZzZXRYKTsKKyAgICAgICAgZmxvYXQgb3V0cHV0SGVpZ2h0ID0gKGZsb2F0KSBNYXRoLm1pbihtU2xpY2VIZWlnaHQsIG1JbWFnZUhlaWdodCAtIG91dHB1dE9mZnNldFkpOworCisgICAgICAgIC8vIFdlIG5lZWQgdG8gc2V0IHRoZSBzb3VyY2UgcmVjdCBhcyB3ZWxsIGJlY2F1c2UgdGhlIGlucHV0IGFyZSBwYWRkZWQgaW1hZ2VzLgorICAgICAgICAoKFNoYWRlclByb2dyYW0pIG1Qcm9ncmFtKS5zZXRTb3VyY2VSZWN0KHgwLCB5MCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBvdXRwdXRXaWR0aCAvIG1JbnB1dFdpZHRoLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG91dHB1dEhlaWdodCAvIG1JbnB1dEhlaWdodCk7CisKKyAgICAgICAgKChTaGFkZXJQcm9ncmFtKSBtUHJvZ3JhbSkuc2V0VGFyZ2V0UmVjdCgoKGZsb2F0KSBvdXRwdXRPZmZzZXRYKS8gbUltYWdlV2lkdGgsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKChmbG9hdCkgb3V0cHV0T2Zmc2V0WSkgLyBtSW1hZ2VIZWlnaHQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgb3V0cHV0V2lkdGggLyBtSW1hZ2VXaWR0aCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBvdXRwdXRIZWlnaHQgLyBtSW1hZ2VIZWlnaHQpOworCisgICAgICAgIC8vIFByb2Nlc3MgdGhpcyB0aWxlCisgICAgICAgIG1Qcm9ncmFtLnByb2Nlc3MoaW5wdXQsIG1PdX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2ltcGxlSW1hZ2VGaWx0ZXIgeworCisgICAgcHJpdmF0ZSBzdGF0aWMgZmluYWwgU3RyaW5nIG1JbnZlcnRTaGFkZXIgPQorICAgICAgICAgICAgInByZWNpc2lvbiBtZWRpdW1wIGZsb2F0O1xuIiArCisgICAgICAgICAgICAidW5pZm9ybSBzYW1wbGVyMkQgdGV4X3NhbXBsZXJfMDtcbiIgKworICAgICAgICAgICAgInZhcnlpbmcgdmVjMiB2X3RleGNvb3JkO1xuIiArCisgICAgICAgICAgICAidm9pZCBtYWluKCkge1xuIiArCisgICAgICAgICAgICAiICB2ZWM0IGNvbG9yID0gdGV4dHVyZTJEKHRleF9zYW1wbGVyXzAsIHZfdGV4Y29vcmQpO1xuIiArCisgICAgICAgICAgICAiICBnbF9GcmFnQ29sb3IuciA9IDEuMCAtIGNvbG9yLnI7XG4iICsKKyAgICAgICAgICAgICIgIGdsX0ZyYWdDb2xvci5nID0gMS4wIC0gY29sb3IuZztcbiIgKworICAgICAgICAgICAgIiAgZ2xfRnJhZ0NvbG9yLmIgPSAxLjAgLSBjb2xvci5iO1xuIiArCisgICAgICAgICAgICAiICBnbF9GcmFnQ29sb3IuYSA9IGNvbG9yLmE7XG4iICsKKyAgICAgICAgICAgICJ9XG4iOworCisgICAgcHVibGljIEludmVydChTdHJpbmcgbmFtZSkgeworICAgICAgICBzdXBlcihuYW1lLCBudWxsKTsKKyAgICB9CisKKyAgICBAT3ZlcnJpZGUKKyAgICBwcm90ZWN0ZWQgUHJvZ3JhbSBnZXROYXRpdmVQcm9ncmFtKEZpbHRlckNvbnRleHQgY29udGV4dCkgeworICAgICAgICByZXR1cm4gbmV3IE5hdGl2ZVByb2dyYW0oImZpbHRlcnBhY2tfaW1hZ2Vwcm9jIiwgImludmVydCIpOworICAgIH0KKworICAgIEBPdmVycmlkZQorICAgIHByb3RlY3RlZCBQcm9ncmFtIGdldFNoYWRlclByb2dyYW0oRmlsdGVyQ29udGV4dCBjb250ZXh0KSB7CisgICAgICAg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ICAgICAgICAgICAgIiAgdmVjMyBuYnJfY29sb3IgPSB2ZWMzKDAuMCwgMC4wLCAwLjApO1xuIiArCisgICAgICAgICAgICAiICB2ZWMyIGNvb3JkO1xuIiArCisgICAgICAgICAgICAiICB2ZWM0IGNvbG9yID0gdGV4dHVyZTJEKHRleF9zYW1wbGVyXzAsIHZfdGV4Y29vcmQpO1xuIiArCisgICAgICAgICAgICAiICBjb29yZC54ID0gdl90ZXhjb29yZC54IC0gMC41ICogc3RlcHNpemVYO1xuIiArCisgICAgICAgICAgICAiICBjb29yZC55ID0gdl90ZXhjb29yZC55IC0gc3RlcHNpemVZO1xuIiArCisgICAgICAgICAgICAiICBuYnJfY29sb3IgKz0gdGV4dHVyZTJEKHRleF9zYW1wbGVyXzAsIGNvb3JkKS5yZ2IgLSBjb2xvci5yZ2I7XG4iICsKKyAgICAgICAgICAgICIgIGNvb3JkLnggPSB2X3RleGNvb3JkLnggLSBzdGVwc2l6ZVg7XG4iICsKKyAgICAgICAgICAgICIgIGNvb3JkLnkgPSB2X3RleGNvb3JkLnkgKyAwLjUgKiBzdGVwc2l6ZVk7XG4iICsKKyAgICAgICAgICAgICIgIG5icl9jb2xvciArPSB0ZXh0dXJlMkQodGV4X3NhbXBsZXJfMCwgY29vcmQpLnJnYiAtIGNvbG9yLnJnYjtcbiIgKworICAgICAgICAgICAgIiAgY29vcmQueCA9IHZfdGV4Y29vcmQueCArIHN0ZXBzaXplWDtcbiIgKworICAgICAgICAgICAgIiAgY29vcmQueSA9IHZfdGV4Y29vcmQueSAtIDAuNSAqIHN0ZXBzaXplWTtcbiIgKworICAgICAgICAgICAgIiAgbmJyX2NvbG9yICs9IHRleHR1cmUyRCh0ZXhfc2FtcGxlcl8wLCBjb29yZCkucmdiIC0gY29sb3IucmdiO1xuIiArCisgICAgICAgICAgICAiICBjb29yZC54ID0gdl90ZXhjb29yZC54ICsgc3RlcHNpemVYO1xuIiArCisgICAgICAgICAgICAiICBjb29yZC55ID0gdl90ZXhjb29yZC55ICsgMC41ICogc3RlcHNpemVZO1xuIiArCisgICAgICAgICAgICAiICBuYnJfY29sb3IgKz0gdGV4dHVyZTJEKHRleF9zYW1wbGVyXzAsIGNvb3JkKS5yZ2IgLSBjb2xvci5yZ2I7XG4iICsKKyAgICAgICAgICAgICIgIHZlYzMgc19jb2xvciA9IHZlYzMoY29sb3IucmdiICsgMC4zICogbmJyX2NvbG9yKTtcbiIgKworICAgICAgICAgICAgLy8gY3Jvc3MgcHJvY2VzcworICAgICAgICAgICAgIiAgdmVjMyBjX2NvbG9yID0gdmVjMygwLjAsIDAuMCwgMC4wKTtcbiIgKworICAgICAgICAgICAgIiAgZmxvYXQgdmFsdWU7XG4iICsKKyAgICAgICAgICAgICIgIGlmIChzX2NvbG9yLnIgPCAwLjUpIHtcbiIgKworICAgICAgICAgICAgIiAgICB2YWx1ZSA9IHNfY29sb3IucjtcbiIgKworICAgICAgICAgICAgIiAgfSBlbHNlIHtcbiIgKworICAgICAgICAgICAgIiAgICB2YWx1ZSA9IDEuMCAtIHNfY29sb3IucjtcbiIgKworICAgICAgICAgICAgIiAgfVxuIiArCisgICAgICAgICAgICAiICBmbG9hdCByZWQgPSA0LjAgKiB2YWx1ZSAqIHZhbHVlICogdmFsdWU7XG4iICsKKyAgICAgICAgICAgICIgIGlmIChzX2NvbG9yLnIgPCAwLjUpIHtcbiIgKworICAgICAgICAgICAgIiAgICBjX2NvbG9yLnIgPSByZWQ7XG4iICsKKyAgICAgICAgICAgICIgIH0gZWxzZSB7XG4iICsKKyAgICAgICAgICAgICIgICAgY19jb2xvci5yID0gMS4wIC0gcmVkO1xuIiArCisgICAgICAgICAgICAiICB9XG4iICsKKyAgICAgICAgICAgICIgIGlmIChzX2NvbG9yLmcgPCAwLjUpIHtcbiIgKworICAgICAgICAgICAgIiAgICB2YWx1ZSA9IHNfY29sb3IuZztcbiIgKworICAgICAgICAgICAgIiAgfSBlbHNlIHtcbiIgKworICAgICAgICAgICAgIiAgICB2YWx1ZSA9IDEuMCAtIHNfY29sb3IuZztcbiIgKworICAgICAgICAgICAgIiAgfVxuIiArCisgICAgICAgICAgICAiICBmbG9hdCBncmVlbiA9IDIuMCAqIHZhbHVlICogdmFsdWU7XG4iICsKKyAgICAgICAgICAgICIgIGlmIChzX2NvbG9yLmcgPCAwLjUpIHtcbiIgKworICAgICAgICAgICAgIiAgICBjX2NvbG9yLmcgPSBncmVlbjtcbiIgKworICAgICAgICAgICAgIiAgfSBlbHNlIHtcbiIgKworICAgICAgICAgICAgIiAgICBjX2NvbG9yLmcgPSAxLjAgLSBncmVlbjtcbiIgKworICAgICAgICAgICAgIiAgfVxuIiArCisgICAgICAgICAgICAiICBjX2NvbG9yLmIgPSBzX2NvbG9yLmIgKiAwLjUgKyAwLjI1O1xuIiArCisgICAgICAgICAgICAvLyBibGFja3doaXRlCisgICAgICAgICAgICAiICBmbG9hdCBkaXRoZXIgPSB0ZXh0dXJlMkQodGV4X3NhbXBsZXJfMSwgdl90ZXhjb29yZCkucjtcbiIgKworICAgICAgICAgICAgIiAgdmVjMyB4Zm9ybSA9IGNsYW1wKChjX2NvbG9yLnJnYiAtIDAuMTUpICogMS41Mzg0NiwgMC4wLCAxLjApO1xuIiArCisgICAgICAgICAgICAiICB2ZWMzIHRlbXAgPSBjbGFtcCgoY29sb3IucmdiICsgc3RlcHNpemUgLSAwLjE1KSAqIDEuNTM4NDYsIDAuMCwgMS4wKTtcbiIgKworICAgICAgICAgICAgIiAgdmVjMyBid19jb2xvciA9IGNsYW1wKHhmb3JtICsgKHRlbXAgLSB4Zm9ybSkgKiAoZGl0aGVyIC0gMC41KSwgMC4wLCAxLjApO1xuIiArCisgICAgICAgICAgICAvLyB2aWduZXR0ZQorICAgICAgICAgICAgIiAgZmxvYXQgZGlzdCA9IGRpc3RhbmNlKGdsX0ZyYWdDb29yZC54eSwgY2VudGVyKTtcbiIgKworICAgICAgICAgICAgIiAgZmxvYXQgbHVtZW4gPSAwLjg1IC8gKDEuMCArIGV4cCgoZGlzdCAqIGludl9tYXhfZGlzdCAtIDAuNzMpICogMjAuMCkpICsgMC4xNTtcbiIgKworICAgICAgICAgICAgIiAgZ2xfRnJhZ0NvbG9yID0gdmVjNChid19jb2xvciAqIGx1bWVuLCBjb2xvci5hKTtcbiIgKworICAgICAgICAgICAgIn1cbiI7CisKKyAgICBwdWJsaWMgTG9tb2lzaEZpbHRlcihTdHJpbmcgbmFtZSkgeworICAgICAgICBzdXBlcihuYW1lKTsKKworICAgICAgICBtUmFuZG9tID0gbmV3IFJhbmRvbSgpOworICAgIH0KKworICAgIEBPdmVycmlkZQorICAgIHB1YmxpYyB2b2lkIHNldHVwUG9ydHMoKSB7CisgICAgICAgIGFkZE1hc2tlZElucHV0UG9ydCgiaW1hZ2UiLCBJbWFnZUZvcm1hdC5jcmVhdGUoSW1hZ2VGb3JtYXQuQ09MT1JTUEFDRV9SR0JBKSk7CisgICAgICAgIGFkZE91dHB1dEJhc2VkT25JbnB1dCgiaW1hZ2UiLCAiaW1hZ2UiKTsKKyAgICB9CisKKyAgICBAT3ZlcnJpZGUKKyAgICBwdWJsaWMgRnJhbWVGb3JtYXQgZ2V0T3V0cHV0Rm9ybWF0KFN0cmluZyBwb3J0TmFtZSwgRnJhbWVGb3JtYXQgaW5wdXRGb3JtYXQpIHsKKyAgICAgICAgcmV0dXJuIGlucHV0Rm9ybWF0OworICAgIH0KKworICAgIEBPdmVycmlkZQorICAgIHB1YmxpYyB2b2lkIHRlYXJEb3duKEZpbHRlckNvbnRleHQgY29udGV4dCkgeworICAgICAgICBpZiAobU5vaXNlRnJhbWUgIT0gbnVsbCkgeworICAgICAgICAgICAgbU5vaXNlRnJhbWUucmVsZWFzZSgpOworICAgICAgICAgICAgbU5vaXNlRnJhbWUgPSBudWxsOworICAgICAgICB9CisgICAgfQorCisgICAgcHVibGljIHZvaWQgaW5pdFByb2dyYW0oRmlsdGVyQ29udGV4dCBjb250ZXh0LCBpbnQgdGFyZ2V0KSB7CisgICAgICAgIHN3aXRjaCAodGFyZ2V0KSB7CisgICAgICAgICAgICBjYXNlIEZyYW1lRm9ybWF0LlRBUkdFVF9HUFU6CisgICAgICAgICAgICAgICAgU2hhZGVyUHJvZ3JhbSBzaGFkZXJQcm9ncmFtID0gbmV3IFNoYWRlclByb2dyYW0oY29udGV4dCwgbUxvbW9pc2hTaGFkZXIpOworICAgICAgICAgICAgICAgIHNoYWRlclByb2dyYW0uc2V0TWF4aW11bVRpbGVTaXplKG1UaWxlU2l6ZSk7CisgICAgICAgICAgICAgICAgbVByb2dyYW0gPSBzaGFkZXJQcm9ncmFtOworICAgICAgICAgICAgICAgIGJyZWFrOworCisgICAgICAgICAgICBkZWZhdWx0OgorICAgICAgICAgICAgICAgIHRocm93IG5ldyBSdW50aW1lRXhjZXB0aW9uKCJGaWx0ZXIgU2hhcnBlbiBkb2VzIG5vdCBzdXBwb3J0IGZyYW1lcyBvZiAiICsKKyAgICAgICAgICAgICAgICAgICAgInRhcmdldCAiICsgdGFyZ2V0ICsgIiEiKTsKKyAgICAgICAgfQorICAgICAgICBtVGFyZ2V0ID0gdGFyZ2V0OworICAgIH0KKworICAgIHByaXZhdGUgdm9pZCBpbml0UGFyYW1ldGVycygpIHsKKyAgICAgICAgaWYgKG1Qcm9ncmFtICE9bnVsbCkgeworICAgICAgICAgICAgZmxvYXQgY2VudGVyWCA9IChmbG9hdCkgKDAuNSAqIG1XaWR0aCk7CisgICAgICAgICAgICBmbG9hdCBjZW50ZXJZID0gKGZsb2F0KSAoMC41ICogbUhlaWdodCk7CisgICAgICAgICAgICBmbG9hdCBjZW50ZXJbXSA9IHtjZW50ZXJYLCBjZW50ZXJZfTsKKyAgICAgICAgICAgIGZsb2F0IG1heF9kaXN0ID0gKGZsb2F0KSBNYXRoLnNxcnQoY2VudGVyWCAqIGNlbnRlclggKyBjZW50ZXJZICogY2VudGVyWSk7CisKKyAgICAgICAgICAgIG1Qcm9ncmFtLnNldEhvc3RWYWx1ZSgiY2VudGVyIiwgY2VudGVyKTsKK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ybWF0LmdldFdpZHRoKCk7CisgICAgICAgICAgICBtSGVpZ2h0ID0gaW5wdXRGb3JtYXQuZ2V0SGVpZ2h0KCk7CisKKyAgICAgICAgICAgIGludFtdIGJ1ZmZlciA9IG5ldyBpbnRbbVdpZHRoICogbUhlaWdodF07CisgICAgICAgICAgICBmb3IgKGludCBpID0gMDsgaSA8IG1XaWR0aCAqIG1IZWlnaHQ7ICsraSkgeworICAgICAgICAgICAgICBidWZmZXJbaV0gPSBtUmFuZG9tLm5leHRJbnQoMjU1KTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIEZyYW1lRm9ybWF0IGZvcm1hdCA9IEltYWdlRm9ybWF0LmNyZWF0ZShtV2lkdGgsIG1IZWlnaHQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgSW1hZ2VGb3JtYXQuQ09MT1JTUEFDRV9SR0JBLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEZyYW1lRm9ybWF0LlRBUkdFVF9HUFUpOworICAgICAgICAgICAgaWYgKG1Ob2lzZUZyYW1lICE9IG51bGwpIHsKKyAgICAgICAgICAgICAgICBtTm9pc2VGcmFtZS5yZWxlYXNlKCk7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBtTm9pc2VGcmFtZSA9IGNvbnRleHQuZ2V0RnJhbWVNYW5hZ2VyKCkubmV3RnJhbWUoZm9ybWF0KTsKKyAgICAgICAgICAgIG1Ob2lzZUZyYW1lLnNldEludHMoYnVmZmVyKTsKKworICAgICAgICAgICAgaW5pdFBhcmFtZXRlcnMoKTsKKyAgICAgICAgfQorCisgICAgICAgIGlmIChtTm9pc2VGcmFtZSAhPSBudWxsICYmIChtTm9pc2VGcmFtZS5nZXRGb3JtYXQoKS5nZXRXaWR0aCgpICE9IG1XaWR0aCB8fAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbU5vaXNlRnJhbWUuZ2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bGVTaXplKTsKKyAgICAgICAgICAgICAgICBtUHJvZ3JhbSA9IHNoYWRlclByb2dyYW07CisgICAgICAgICAgICAgICAgYnJlYWs7CisKKyAgICAgICAgICAgIGRlZmF1bHQ6CisgICAgICAgICAgICAgICAgdGhyb3cgbmV3IFJ1bnRpbWVFeGNlcHRpb24oIkZpbHRlciBTaGFycGVuIGRvZXMgbm90IHN1cHBvcnQgZnJhbWVzIG9mICIgKworICAgICAgICAgICAgICAgICAgICAidGFyZ2V0ICIgKyB0YXJnZXQgKyAiISIpOworICAgICAgICB9CisgICAgICAgIG1UYXJnZXQgPSB0YXJnZXQ7CisgICAgfQorCisgICAgQE92ZXJyaWRlCisgICAgcHVibGljIHZvaWQgcHJvY2VzcyhGaWx0ZXJDb250ZXh0IGNvbnRleHQpIHsKKyAgICAgICAgLy8gR2V0IGlucHV0IGZyYW1lCisgICAgICAgIEZyYW1lIGlucHV0ID0gcHVsbElucHV0KCJpbWFnZSIpOworICAgICAgICBGcmFtZUZvcm1hdCBpbnB1dEZvcm1hdCA9IGlucHV0LmdldEZvcm1hdCgpOworCisgICAgICAgIC8vIENyZWF0ZSBvdXRwdXQgZnJhbWUKKyAgICAgICAgRnJhbWUgb3V0cHV0ID0gY29udGV4dC5nZXRGcmFtZU1hbmFnZXIoKS5uZXdGcmFtZShpbnB1dEZvcm1hdCk7CisKKyAgICAgICAgLy8gQ3JlYXRlIHByb2dyYW0gaWYgbm90IGNyZWF0ZWQgYWxyZWFkeQorICAgICAgICBpZiAobVByb2dyYW0gPT0gbnVsbCB8fCBpbnB1dEZvcm1hdC5nZXRUYXJnZXQoKSAhPSBtVGFyZ2V0KSB7CisgICAgICAgICAgICBpbml0UHJvZ3JhbShjb250ZXh0LCBpbnB1dEZvcm1hdC5nZXRUYXJnZXQoKSk7CisgICAgICAgIH0KKworICAgICAgICAvLyBQcm9jZXNzCisgICAgICAgIG1Qcm9ncmFtLnByb2Nlc3MoaW5wdXQsIG91dHB1dCk7CisKKyAgICAg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gICAgIn1cbiI7CisKKyAgICBwdWJsaWMgUG9zdGVyaXplRmlsdGVyKFN0cmluZyBuYW1lKSB7CisgICAgICBzdXBlcihuYW1lKTsKKyAgICB9CisKKyAgICBAT3ZlcnJpZGUKKyAgICBwdWJsaWMgdm9pZCBzZXR1cFBvcnRzKCkgeworICAgICAgICBhZGRNYXNrZWRJbnB1dFBvcnQoImltYWdlIiwgSW1hZ2VGb3JtYXQuY3JlYXRlKEltYWdlRm9ybWF0LkNPTE9SU1BBQ0VfUkdCQSkpOworICAgICAgICBhZGRPdXRwdXRCYXNlZE9uSW5wdXQoImltYWdlIiwgImltYWdlIik7CisgICAgfQorCisgICAgQE92ZXJyaWRlCisgICAgcHVibGljIEZyYW1lRm9ybWF0IGdldE91dHB1dEZvcm1hdChTdHJpbmcgcG9ydE5hbWUsIEZyYW1lRm9ybWF0IGlucHV0Rm9ybWF0KSB7CisgICAgICAgIHJldHVybiBpbnB1dEZvcm1hdDsKKyAgICB9CisKKyAgICBwdWJsaWMgdm9pZCBpbml0UHJvZ3JhbShGaWx0ZXJDb250ZXh0IGNvbnRleHQsIGludCB0YXJnZXQpIHsKKyAgICAgICAgc3dpdGNoICh0YXJnZXQpIHsKKyAgICAgICAgICAgIGNhc2UgRnJhbWVGb3JtYXQuVEFSR0VUX0dQVToKKyAgICAgICAgICAgICAgICBTaGFkZXJQcm9ncmFtIHNoYWRlclByb2dyYW0gPSBuZXcgU2hhZGVyUHJvZ3JhbShjb250ZXh0LCBtUG9zdGVyaXplU2hhZGVyKTsKKyAgICAgICAgICAgICAgICBzaGFkZXJQcm9ncmFtLnNldE1heGltdW1UaWxlU2l6ZShtVGlsZVNpemUpOworICAgICAgICAgICAgICAgIG1Qcm9ncmFtID0gc2hhZGVyUHJvZ3JhbTsKKyAgICAgICAgICAgICAgICBicmVhazsKKworICAgICAgICAgICAgZGVmYXVsdDoKKyAgICAgICAgICAgICAgICB0aHJvdyBuZXcgUnVudGltZUV4Y2VwdGlvbigiRmlsdG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XRlIGZpbmFsIFN0cmluZyBtUmVkRXllU2hhZGVyID0KKyAgICAgICAgICAgICJwcmVjaXNpb24gbWVkaXVtcCBmbG9hdDtcbiIgKworICAgICAgICAgICAgInVuaWZvcm0gc2FtcGxlcjJEIHRleF9zYW1wbGVyXzA7XG4iICsKKyAgICAgICAgICAgICJ1bmlmb3JtIHNhbXBsZXIyRCB0ZXhfc2FtcGxlcl8xO1xuIiArCisgICAgICAgICAgICAidW5pZm9ybSBmbG9hdCBpbnRlbnNpdHk7XG4iICsKKyAgICAgICAgICAgICJ2YXJ5aW5nIHZlYzIgdl90ZXhjb29yZDtcbiIgKworICAgICAgICAgICAgInZvaWQgbWFpbigpIHtcbiIgKworICAgICAgICAgICAgIiAgdmVjNCBjb2xvciA9IHRleHR1cmUyRCh0ZXhfc2FtcGxlcl8wLCB2X3RleGNvb3JkKTtcbiIgKworICAgICAgICAgICAgIiAgdmVjNCBtYXNrID0gdGV4dHVyZTJEKHRleF9zYW1wbGVyXzEsIHZfdGV4Y29vcmQpO1xuIiArCisgICAgICAgICAgICAiICBnbF9GcmFnQ29sb3IgPSB2ZWM0KG1hc2suYSwgbWFzay5hLCBtYXNrLmEsIDEuMCkgKiBpbnRlbnNpdHkgKyBjb2xvciAqICgxLjAgLSBpbnRlbnNpdHkpO1xuIiArCisgICAgICAgICAgICAiICBpZiAobWFzay5hID4gMC4wKSB7XG4iICsKKyAgICAgICAgICAgICIgICAgZ2xfRnJhZ0NvbG9yLnIgPSAwLjA7XG4iICsKKyAgICAgICAgICAgICIgICAgZmxvYXQgZ3JlZW5fYmx1ZSA9IGNvbG9yLmcgKyBjb2xvci5iO1xuIiArCisgICAgICAgICAgICAiICAgIGZsb2F0IHJlZF9pbnRlbnNpdHkgPSBjb2xvci5yIC8gZ3JlZW5fYmx1ZTtcbiIgKworICAgICAgICAgICAgIiAgICBpZiAocmVkX2ludGVuc2l0eSA+IGludGVuc2l0eSkge1xuIiArCisgICAgICAgICAgICAiICAgICAgY29sb3IuciA9IDAuNSAqIGdyZWVuX2JsdWU7XG4iICsKKyAgICAgICAgICAgICIgICAgfVxuIiArCisgICAgICAgICAgICAiICB9XG4iICsKKyAgICAgICAgICAgICIgIGdsX0ZyYWdDb2xvciA9IGNvbG9yO1xuIiArCisgICAgICAgICAgICAifVxuIjsKKworICAgIHB1YmxpYyBSZWRFeWVGaWx0ZXIoU3RyaW5nIG5hbWUpIHsKKyAgICAgICAgc3VwZXIobmFtZSk7CisgICAgfQorCisgICAgQE92ZXJyaWRlCisgICAgcHVibGljIHZvaWQgc2V0dXBQb3J0cygpIHsKKyAgICAgICAgYWRkTWFza2VkSW5wdXRQb3J0KCJpbWFnZSIsIEltYWdlRm9ybWF0LmNyZWF0ZShJbWFnZUZvcm1hdC5DT0xPUlNQQUNFX1JHQkEpKTsKKyAgICAgICAgYWRkT3V0cHV0QmFzZWRPbklucHV0KCJpbWFnZSIsICJpbWFnZSIpOworICAgIH0KKworICAgIEBPdmVycmlkZQorICAgIHB1YmxpYyBGcmFtZUZvcm1hdCBnZXRPdXRwdXRGb3JtYXQoU3RyaW5nIHBvcnROYW1lLCBGcmFtZUZvcm1hdCBpbnB1dEZvcm1hdCkgeworICAgICAgICByZXR1cm4gaW5wdXRGb3JtYXQ7CisgICAgfQorCisgICAgcHVibGljIHZvaWQgaW5pdFByb2dyYW0oRmlsdGVyQ29udGV4dCBjb250ZXh0LCBpbnQgdGFyZ2V0KSB7CisgICAgICAgIHN3aXRjaCAodGFyZ2V0KSB7CisgICAgICAgICAgICBjYXNlIEZyYW1lRm9ybWF0LlRBUkdFVF9HUFU6CisgICAgICAgICAgICAgICAgU2hhZGVyUHJvZ3JhbSBzaGFkZXJQcm9ncmFtID0gbmV3IFNoYWRlclByb2dyYW0oY29udGV4dCwgbVJlZEV5ZVNoYWRlcik7CisgICAgICAgICAgICAgICAgc2hhZGVyUHJvZ3JhbS5zZXRNYXhpbXVtVGlsZVNpemUobVRpbGVTaXplKTsKKyAgICAgICAgICAgICAgICBt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WQoU3RyaW5nIG5hbWUsIEZpbHRlckNvbnRleHQgY29udGV4dCkgeworICAgICAgICAgaWYgKG1Qcm9ncmFtICE9IG51bGwpIHsKKyAgICAgICAgICAgIHVwZGF0ZVByb2dyYW1QYXJhbXMoKTsKKyAgICAgICAgfQorICAgIH0KKworICAgIHByaXZhdGUgdm9pZCBjcmVhdGVSZWRFeWVCaXRtYXAoKSB7CisgICAgICAgIGlmIChtUmVkRXllQml0bWFwICE9IG51bGwpIHsKKyAgICAgICAgICAgIG1SZWRFeWVCaXRtYXAucmVjeWNsZSgpOworICAgICAgICB9CisKKyAgICAgICAgaW50IGJpdG1hcFdpZHRoID0gbVdpZHRoIC8gMjsKKyAgICAgICAgaW50IGJpdG1hcEhlaWdodCA9IG1IZWlnaHQgLyAyOworCisgICAgICAgIG1SZWRFeWVCaXRtYXAgPSBCaXRtYXAuY3JlYXRlQml0bWFwKGJpdG1hcFdpZHRoLCBiaXRtYXBIZWlnaHQsIEJpdG1hcC5Db25maWcuQVJHQl84ODg4KTsKKyAgICAgICAgbUNhbnZhcy5zZXRCaXRtYXAobVJlZEV5ZUJpdG1hcCk7CisgICAgICAgIG1QYWludC5zZXRDb2xvcihDb2xvci5XSElURSk7CisgICAgICAgIG1SYWRpdXMgPSBNYXRoLm1heChNSU5fUkFESVVTLCBSQURJVVNfUkFUSU8gKiBNYXRoLm1pbihiaXRtYXBXaWR0aCwgYml0bWFwSGVpZ2h0KSk7CisKKyAgICAgICAgdXBkYXRlUHJvZ3JhbVBhcmFtcygpOworICAgIH0KKworICAgIHByaXZhdGUgdm9pZCBjcmVhdGVSZWRFeWVGcmFtZShGaWx0ZXJDb250ZXh0IGNvbnRleHQpIHsKKyAgICAgICAgRnJhbWVGb3JtYXQgZm9ybWF0ID0gSW1hZ2VGb3JtYXQuY3JlYXRlKG1SZWRFeWVCaXRtYXAuZ2V0V2lkdGgoKSAsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBtUmVkRXllQml0bWFwLmdldEhlaWdodCgpLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgSW1hZ2VGb3JtYXQuQ09MT1JTUEFDRV9SR0JBLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgRnJhbWVGb3JtYXQuVEFSR0VUX0dQVSk7CisgICAgICAgIG1SZWRFeWVGcmFtZSA9IGNvbnRleHQuZ2V0RnJhbWVNYW5hZ2VyKCkubmV3RnJhbWUoZm9ybWF0KTsKKyAgICAgICAgbVJlZEV5ZUZyYW1lLnNldEJpdG1hcChtUmVkRXllQml0bWFwKTsKKyAgICB9CisKKyAgICBwcml2YXRlIHZvaWQgdXBkYXRlUHJvZ3JhbVBhcmFtcygpIHsKKyAgICAgICAgbVByb2dyYW0uc2V0SG9zdFZhbHVlKCJpbnRlbnNpdHkiLCBERUZBVUxUX1JFRF9JTlRFTlNJVFkpOworCisgICAgICAgIGlmICggbUNlbnRlcnMubGVuZ3RoICUgMiA9PSAxKSB7CisgICAgICAgICAgICB0aHJvdyBuZXcgUnVudGltZUV4Y2VwdGlvbigiVGhlIHNpemUgb2YgY2VudGVyIGFycmF5IG11c3QgYmUgZXZlbi4iKTsKKyAgICAgICAgfQorCisgICAgICAgIGlmIChtUmVkRXllQml0bWFwICE9IG51bGwpIHsKKyAgICAgICAgICAgIGZvciAoaW50IGkgPSAwOyBpIDwgbUNlbnRlcnMubGVuZ3RoOyBpICs9IDIpIHsKKyAgICAgICAgICAgICAgICBtQ2FudmFzLmRyYXdDaXJjbGUobUNlbnRlcnNbaV0gKiBtUmVkRXllQml0bWFwLmdldFdpZHRoKCksCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1DZW50ZXJzW2kgKyAxXSAqIG1SZWRFeWVCaXRtYXAuZ2V0SGVpZ2h0KCksCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1SYWRpdXMsIG1QYWludCk7C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kdCQSkpOworICAgICAgICBhZGRPdXRwdXRCYXNlZE9uSW5wdXQoImltYWdlIiwgImltYWdlIik7CisgICAgfQorCisgICAgQE92ZXJyaWRlCisgICAgcHVibGljIEZyYW1lRm9ybWF0IGdldE91dHB1dEZvcm1hdChTdHJpbmcgcG9ydE5hbWUsIEZyYW1lRm9ybWF0IGlucHV0Rm9ybWF0KSB7CisgICAgICAgIHJldHVybiBpbnB1dEZvcm1hdDsKKyAgICB9CisKKyAgICBwcm90ZWN0ZWQgdm9pZCBjcmVhdGVQcm9ncmFtKEZpbHRlckNvbnRleHQgY29udGV4dCwgRnJhbWVGb3JtYXQgZm9ybWF0KSB7CisgICAgICAgIGlmIChtTGFzdEZvcm1hdCAhPSBudWxsICYmIG1MYXN0Rm9ybWF0LmdldFRhcmdldCgpID09IGZvcm1hdC5nZXRUYXJnZXQoKSkgcmV0dXJuOworICAgICAgICBtTGFzdEZvcm1hdCA9IGZvcm1hdDsKKyAgICAgICAgc3dpdGNoIChmb3JtYXQuZ2V0VGFyZ2V0KCkpIHsKKyAgICAgICAgICAgIGNhc2UgRnJhbWVGb3JtYXQuVEFSR0VUX05BVElWRToKKyAgICAgICAgICAgICAgICB0aHJvdyBuZXcgUnVudGltZUV4Y2VwdGlvbigiTmF0aXZlIFJlc2l6ZUZpbHRlciBub3QgaW1wbGVtZW50ZWQgeWV0ISIpOworCisKKyAgICAgICAgICAgIGNhc2UgRnJhbWVGb3JtYXQuVEFSR0VUX0dQVToKKyAgICAgICAgICAgICAgICBTaGFkZXJQcm9ncmFtIHByb2cgPSBTaGFkZXJQcm9ncmFtLmNyZWF0ZUlkZW50aXR5KGNvbnRleHQpOworICAgICAgICAgICAgICAgIG1Qcm9ncmFtID0gcHJvZzsKKyAgICAgICAgICAgICAgICBicmVhazsKKworICAgICAgICAgICAgZGVmYXVsdDoKKyAgICAgICAgICAgICAgICB0aHJvdyBuZXcgUnVudGltZUV4Y2VwdGlvbigiUmVzaXplRmlsdGVyIGNvdWxkI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AwOworICAgIHByaXZhdGUgaW50IG1IZWlnaHQgPSAwOworICAgIHByaXZhdGUgaW50IG1UYXJnZXQgPSBGcmFtZUZvcm1hdC5UQVJHRVRfVU5TUEVDSUZJRUQ7CisKKyAgICBwcml2YXRlIGludCBtT3V0cHV0V2lkdGg7CisgICAgcHJpdmF0ZSBpbnQgbU91dHB1dEhlaWdodDsKKworICAgIHB1YmxpYyBSb3RhdGVGaWx0ZXIoU3RyaW5nIG5hbWUpIHsKKyAgICAgICAgc3VwZXIobmFtZSk7CisgICAgfQorCisgICAgQE92ZXJyaWRlCisgICAgcHVibGljIHZvaWQgc2V0dXBQb3J0cygpIHsKKyAgICAgICAgYWRkTWFza2VkSW5wdXRQb3J0KCJpbWFnZSIsIEltYWdlRm9ybWF0LmNyZWF0ZShJbWFnZUZvcm1hdC5DT0xPUlNQQUNFX1JHQkEpKTsKKyAgICAgICAgYWRkT3V0cHV0QmFzZWRPbklucHV0KCJpbWFnZSIsICJpbWFnZSIpOworICAgIH0KKworICAgIHB1YmxpYyB2b2lkIGluaXRQcm9ncmFtKEZpbHRlckNvbnRleHQgY29udGV4dCwgaW50IHRhcmdldCkgeworICAgICAgICBzd2l0Y2ggKHRhcmdldCkgeworICAgICAgICAgICAgY2FzZSBGcmFtZUZvcm1hdC5UQVJHRVRfR1BVOgorICAgICAgICAgICAgICAgIFNoYWRlclByb2dyYW0gc2hhZGVyUHJvZ3JhbSA9IFNoYWRlclByb2dyYW0uY3JlYXRlSWRlbnRpdHkoY29udGV4dCk7CisgICAgICAgICAgICAgICAgc2hhZGVyUHJvZ3JhbS5zZXRNYXhpbXVtVGlsZVNpemUobVRpbGVTaXplKTsKKyAgICAgICAgICAgICAgICBzaGFkZXJQcm9ncmFtLnNldENsZWFyc091dHB1dCh0cnVlKTsKKyAgICAgICAgICAgICAgICBtUHJvZ3JhbSA9IHNoYWRlclByb2dyYW07CisgICAgICAgICAgICAgICAgYnJlYWs7CisKKyAgICAgICAgICAgIGRlZmF1bHQ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B7CisgICAgICAgICAgICBtV2lkdGggPSBpbnB1dEZvcm1hdC5nZXRXaWR0aCgpOworICAgICAgICAgICAgbUhlaWdodCA9IGlucHV0Rm9ybWF0LmdldEhlaWdodCgpOworICAgICAgICAgICAgbU91dHB1dFdpZHRoID0gbVdpZHRoOworICAgICAgICAgICAgbU91dHB1dEhlaWdodCA9IG1IZWlnaHQ7CisKKyAgICAgICAgICAgIHVwZGF0ZVBhcmFtZXRlcnMoKTsKKyAgICAgICAgfQorCisgICAgICAgIC8vIENyZWF0ZSBvdXRwdXQgZnJhbWUKKyAgICAgICAgRnJhbWVGb3JtYXQgb3V0cHV0Rm9ybWF0ID0gSW1hZ2VGb3JtYXQuY3JlYXRlKG1PdXRwdXRXaWR0aCwgbU91dHB1dEhlaWdodCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEltYWdlRm9ybWF0LkNPTE9SU1BBQ0VfUkdCQSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEZyYW1lRm9ybWF0LlRBUkdFVF9HUFUpOworCisgICAgICAgIEZyYW1lIG91dHB1dCA9IGNvbnRleHQuZ2V0RnJhbWVNYW5hZ2VyKCkubmV3RnJhbWUob3V0cHV0Rm9ybWF0KTsKKworICAgICAgICAvLyBQcm9jZXNzCisgICAgICAgIG1Qcm9ncmFtLnByb2Nlc3MoaW5wdXQsIG91dHB1dCk7CisKKyAgICAgICAgLy8gUHVzaCBvdXRwdXQKKyAgICAgICAgcHVzaE91dHB1dCgiaW1hZ2UiLCBvdXRwdXQpOworCisgICAgICAgIC8vIFJlbGVhc2UgcHVzaGVkIGZyYW1lCisgICAgICAgIG91dHB1dC5yZWxlYXNlKCk7CisgICAgfQorCisgICAgcHJpdmF0ZSB2b2lkIHVwZGF0ZVBhcmFtZXRlcnMoKSB7CisgICAgICAgIGZsb2F0IHNpblRoZXRhOworICAgICAgICBmbG9hdCBjb3NUaGV0YTsKKworICAgICAgICBpZiAobUFuZ2xlICUgOTAgPT0gMCkgeworICAgICAgICAgICAgaWYgKG1BbmdsZSAlIDE4MCA9PSAwKSB7CisgICAgICAgICAgICAgICAgc2luVGhldGEgPSAwZjsKKyAgICAgICAgICAgICAgICBjb3NUaGV0YSA9IChtQW5nbGUgJSAzNjAgPT0gMCkgPyAxZjotMWY7CisgICAgICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgICAgIGNvc1RoZXRhID0gMGY7CisgICAgICAgICAgICAgICAgc2luVGhldGEgPSAoKG1BbmdsZSArIDkwKSAlIDM2MCA9PSAwKSA/IC0xZjoxZjsKKworICAgICAgICAgICAgICAgIG1PdXRwdXRXaWR0aCA9IG1IZWlnaHQ7CisgICAgICAgICAgICAgICAgbU91dHB1dEhlaWdodCA9IG1XaWR0aDsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgIHRocm93IG5ldyBSdW50aW1lRXhjZXB0aW9uKCJkZWdyZWUgaGFzIHRvIGJlIG11bHRpcGx5IG9mIDkwLiIpOworICAgICAgICB9CisKKyAgICAgICAgUG9pbnQgeDAgPSBuZXcgUG9pbnQoMC41ZiAqICgtY29zVGhldGEgKyBzaW5UaGV0YSArIDFmKSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMC41ZiAqICgtc2luVGhldGEgLSBjb3NUaGV0YSArIDFmKSk7CisgICAgICAgIFBvaW50IHgxID0gbmV3IFBvaW50KDAuNWYgKiAoY29zVGhldGEgKyBzaW5UaGV0YSArIDFmKSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMC41ZiAqIChzaW5UaGV0YSAtIGNvc1RoZXRhICsgMWYpKTsKKyAgICAgICAgUG9pbnQgeDIgPSBuZXcgUG9pbnQoMC41ZiAqICgtY29zVGhldGEgLSBzaW5UaGV0YSArIDFmKSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMC41ZiAqICgtc2luVG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ZCBtYWluKCkge1xuIiArCisgICAgICAgICAgICAiICB2ZWM0IGNvbG9yID0gdGV4dHVyZTJEKHRleF9zYW1wbGVyXzAsIHZfdGV4Y29vcmQpO1xuIiArCisgICAgICAgICAgICAiICBmbG9hdCBrdiA9IGRvdChjb2xvci5yZ2IsIHdlaWdodHMpICsgc2hpZnQ7XG4iICsKKyAgICAgICAgICAgICIgIHZlYzMgbmV3X2NvbG9yID0gc2NhbGUgKiBjb2xvci5yZ2IgKyAoMS4wIC0gc2NhbGUpICoga3Y7XG4iICsKKyAgICAgICAgICAgICIgIGdsX0ZyYWdDb2xvciA9IHZlYzQobmV3X2NvbG9yLCBjb2xvci5hKTtcbiIgKworICAgICAgICAgICAgIn1cbiI7CisKKyAgICBwcml2YXRlIGZpbmFsIFN0cmluZyBtSGVyZlNhdHVyYXRlU2hhZGVyID0KKyAgICAgICAgICAgICJwcmVjaXNpb24gbWVkaXVtcCBmbG9hdDtcbiIgKworICAgICAgICAgICAgInVuaWZvcm0gc2FtcGxlcjJEIHRleF9zYW1wbGVyXzA7XG4iICsKKyAgICAgICAgICAgICJ1bmlmb3JtIHZlYzMgd2VpZ2h0cztcbiIgKworICAgICAgICAgICAgInVuaWZvcm0gdmVjMyBleHBvbmVudHM7XG4iICsKKyAgICAgICAgICAgICJ2YXJ5aW5nIHZlYzIgdl90ZXhjb29yZDtcbiIgKworICAgICAgICAgICAgInZvaWQgbWFpbigpIHtcbiIgKworICAgICAgICAgICAgIiAgdmVjNCBjb2xvciA9IHRleHR1cmUyRCh0ZXhfc2FtcGxlcl8wLCB2X3RleGNvb3JkKTtcbiIgKworICAgICAgICAgICAgIiAgZmxvYXQgZGUgPSBkb3QoY29sb3IucmdiLCB3ZWlnaHRzKTtcbiIgKworICAgICAgICAgICAgIiAgZmxvYXQgaW52X2RlID0gMS4wIC8gZGU7XG4iICsKKyAgICAgICAgICAgICIgIHZlYzMgbmV3X2NvbG9yID0gZGUgKiBwb3coY29sb3IucmdiICogaW52X2RlL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kZXIpOworICAgICAgICAgICAgICAgIHNoYWRlclByb2dyYW0uc2V0TWF4aW11bVRpbGVTaXplKG1UaWxlU2l6ZSk7CisgICAgICAgICAgICAgICAgbUJlblByb2dyYW0gPSBzaGFkZXJQcm9ncmFtOworCisgICAgICAgICAgICAgICAgc2hhZGVyUHJvZ3JhbSA9IG5ldyBTaGFkZXJQcm9ncmFtKGNvbnRleHQsIG1IZXJmU2F0dXJhdGVTaGFkZXIpOworICAgICAgICAgICAgICAgIHNoYWRlclByb2dyYW0uc2V0TWF4aW11bVRpbGVTaXplKG1UaWxlU2l6ZSk7CisgICAgICAgICAgICAgICAgbUhlcmZQcm9ncmFtID0gc2hhZGVyUHJvZ3JhbTsKKworICAgICAgICAgICAgICAgIGJyZWFrOworCisgICAgICAgICAgICBkZWZhdWx0OgorICAgICAgICAgICAgICAgIHRocm93IG5ldyBSdW50aW1lRXhjZXB0aW9uKCJGaWx0ZXIgU2hhcnBlbiBkb2VzIG5vdCBzdXBwb3J0IGZyYW1lcyBvZiAiICsKKyAgICAgICAgICAgICAgICAgICAgInRhcmdldCAiICsgdGFyZ2V0ICsgIiEiKTsKKyAgICAgICAgfQorICAgICAgICBtVGFyZ2V0ID0gdGFyZ2V0OworICAgIH0KKworICAgIEBPdmVycmlkZQorICAgIHB1YmxpYyB2b2lkIGZpZWxkUG9ydFZhbHVlVXBkYXRlZChTdHJpbmcgbmFtZSwgRmlsdGVyQ29udGV4dCBjb250ZXh0KSB7CisgICAgICAgIGlmIChtQmVuUHJvZ3JhbSAhPSBudWxsICYmIG1IZXJmUHJvZ3JhbSAhPSBudWxsKSB7CisgICAgICAgICAgICB1cGRhdGVQYXJhbWV0ZXJzKCk7CisgICAgICAgIH0KKyAgICB9CisKKyAgICBAT3ZlcnJpZGUKKyAgICBwdWJsaWMgdm9pZCBwcm9jZXNzKEZpbHRlckNvbnRleHQgY29udGV4dCkgeworICAgICAgICAvLyBHZXQgaW5wdXQgZnJhbWUKKyAgICAgICAgRnJhbW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YmxpYyB2b2lkIGluaXRQcm9ncmFtKEZpbHRlckNvbnRleHQgY29udGV4dCwgaW50IHRhcmdldCkgeworICAgICAgICBzd2l0Y2ggKHRhcmdldCkgeworICAgICAgICAgICAgY2FzZSBGcmFtZUZvcm1hdC5UQVJHRVRfR1BVOgorICAgICAgICAgICAgICAgIFNoYWRlclByb2dyYW0gc2hhZGVyUHJvZ3JhbSA9IG5ldyBTaGFkZXJQcm9ncmFtKGNvbnRleHQsIG1TZXBpYVNoYWRlcik7CisgICAgICAgICAgICAgICAgc2hhZGVyUHJvZ3JhbS5zZXRNYXhpbXVtVGlsZVNpemUobVRpbGVTaXplKTsKKyAgICAgICAgICAgICAgICBtUHJvZ3JhbSA9IHNoYWRlclByb2dyYW07CisgICAgICAgICAgICAgICAgYnJlYWs7CisKKyAgICAgICAgICAgIGRlZmF1bHQ6CisgICAgICAgICAgICAgICAgdGhyb3cgbmV3IFJ1bnRpbWVFeGNlcHRpb24oIkZpbHRlciBTaGFycGVuIGRvZXMgbm90IHN1cHBvcnQgZnJhbWVzIG9mICIgKworICAgICAgICAgICAgICAgICAgICAidGFyZ2V0ICIgKyB0YXJnZXQgKyAiISIpOworICAgICAgICB9CisgICAgICAgIG1UYXJnZXQgPSB0YXJnZXQ7CisgICAgfQorCisgICBAT3ZlcnJpZGUKKyAgICBwdWJsaWMgdm9pZCBwcm9jZXNzKEZpbHRlckNvbnRleHQgY29udGV4dCkgeworICAgICAgICAvLyBHZXQgaW5wdXQgZnJhbWUKKyAgICAgICAgRnJhbWUgaW5wdXQgPSBwdWxsSW5wdXQoImltYWdlIik7CisgICAgICAgIEZyYW1lRm9ybWF0IGlucHV0Rm9ybWF0ID0gaW5wdXQuZ2V0Rm9ybWF0KCk7CisKKyAgICAgICAgLy8gQ3JlYXRlIG91dHB1dCBmcmFtZQorICAgICAgICBGcmFtZSBvdXRwdXQgPSBjb250ZXh0LmdldEZyYW1lTWFuYWdlcigpLm5ld0ZyYW1lKGlucHV0Rm9ybWF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bGRQb3J0KG5hbWUgPSAidGlsZV9zaXplIiwgaGFzRGVmYXVsdCA9IHRydWUpCisgICAgcHJpdmF0ZSBpbnQgbVRpbGVTaXplID0gNjQwOworCisgICAgcHJpdmF0ZSBQcm9ncmFtIG1Qcm9ncmFtOworCisgICAgcHJpdmF0ZSBpbnQgbVdpZHRoID0gMDsKKyAgICBwcml2YXRlIGludCBtSGVpZ2h0ID0gMDsKKyAgICBwcml2YXRlIGludCBtVGFyZ2V0ID0gRnJhbWVGb3JtYXQuVEFSR0VUX1VOU1BFQ0lGSUVEOworCisgICAgcHJpdmF0ZSBmaW5hbCBTdHJpbmcgbVNoYXJwZW5TaGFkZXIgPQorICAgICAgICAgICAgInByZWNpc2lvbiBtZWRpdW1wIGZsb2F0O1xuIiArCisgICAgICAgICAgICAidW5pZm9ybSBzYW1wbGVyMkQgdGV4X3NhbXBsZXJfMDtcbiIgKworICAgICAgICAgICAgInVuaWZvcm0gZmxvYXQgc2NhbGU7XG4iICsKKyAgICAgICAgICAgICJ1bmlmb3JtIGZsb2F0IHN0ZXBzaXplWDtcbiIgKworICAgICAgICAgICAgInVuaWZvcm0gZmxvYXQgc3RlcHNpemVZO1xuIiArCisgICAgICAgICAgICAidmFyeWluZyB2ZWMyIHZfdGV4Y29vcmQ7XG4iICsKKyAgICAgICAgICAgICJ2b2lkIG1haW4oKSB7XG4iICsKKyAgICAgICAgICAgICIgIHZlYzMgbmJyX2NvbG9yID0gdmVjMygwLjAsIDAuMCwgMC4wKTtcbiIgKworICAgICAgICAgICAgIiAgdmVjMiBjb29yZDtcbiIgKworICAgICAgICAgICAgIiAgdmVjNCBjb2xvciA9IHRleHR1cmUyRCh0ZXhfc2FtcGxlcl8wLCB2X3RleGNvb3JkKTtcbiIgKworICAgICAgICAgICAgIiAgY29vcmQueCA9IHZfdGV4Y29vcmQueCAtIDAuNSAqIHN0ZXBzaXplWDtcbiIgKworICAgICAgICAgICAgIiAgY29vcmQueSA9IHZfdGV4Y29vcmQueSAtIHN0ZXBzaXplWTtcbiIgKworICAgICAgICAgICAgIiAgbmJyX2NvbG9yICs9IHRleHR1cmUyRCh0ZXhfc2FtcGxlcl8wLCBjb29yZCkucmdiIC0gY29sb3IucmdiO1xuIiArCisgICAgICAgICAgICAiICBjb29yZC54ID0gdl90ZXhjb29yZC54IC0gc3RlcHNpemVYO1xuIiArCisgICAgICAgICAgICAiICBjb29yZC55ID0gdl90ZXhjb29yZC55ICsgMC41ICogc3RlcHNpemVZO1xuIiArCisgICAgICAgICAgICAiICBuYnJfY29sb3IgKz0gdGV4dHVyZTJEKHRleF9zYW1wbGVyXzAsIGNvb3JkKS5yZ2IgLSBjb2xvci5yZ2I7XG4iICsKKyAgICAgICAgICAgICIgIGNvb3JkLnggPSB2X3RleGNvb3JkLnggKyBzdGVwc2l6ZVg7XG4iICsKKyAgICAgICAgICAgICIgIGNvb3JkLnkgPSB2X3RleGNvb3JkLnkgLSAwLjUgKiBzdGVwc2l6ZVk7XG4iICsKKyAgICAgICAgICAgICIgIG5icl9jb2xvciArPSB0ZXh0dXJlMkQodGV4X3NhbXBsZXJfMCwgY29vcmQpLnJnYiAtIGNvbG9yLnJnYjtcbiIgKworICAgICAgICAgICAgIiAgY29vcmQueCA9IHZfdGV4Y29vcmQueCArIHN0ZXBzaXplWDtcbiIgKworICAgICAgICAgICAgIiAgY29vcmQueSA9IHZfdGV4Y29vcmQueSArIDAuNSAqIHN0ZXBzaXplWTtcbiIgKworICAgICAgICAgICAgIiAgbmJyX2NvbG9yICs9IHRleHR1cmUyRCh0ZXhfc2FtcGxlcl8wLCBjb29yZCkucmdiIC0gY29sb3IucmdiO1xuIiArCisgICAgICAgICAgICAiICBnbF9GcmFnQ29sb3IgPSB2ZWM0KGNvbG9yLnJnYiAtIDIuMCAqIHNjYWxlICogbmJyX2NvbG9yLCBjb2xvci5hKTtcbiIgKworICAgICAgICAgICAgIn1cbiI7CisKKyAgICBwdWJsaWMgU2hhcnBlbkZpbHRlcihTdHJpbmcgbmFtZSkgeworICAgICAgICBzdXBlcihuYW1lKTsKKyAgICB9CisKKyAgICBAT3ZlcnJpZGUKKyAgICBwdWJsaWMgdm9pZCBzZXR1cFBvcnRzKCkgeworICAgICAgICBhZGRNYXNrZWRJbnB1dFBvcnQoImltYWdlIiwgSW1hZ2VGb3JtYXQuY3JlYXRlKEltYWdlRm9ybWF0LkNPTE9SU1BBQ0VfUkdCQSkpOworICAgICAgICBhZGRPdXRwdXRCYXNlZE9uSW5wdXQoImltYWdlIiwgImltYWdlIik7CisgICAgfQorCisgICAgQE92ZXJyaWRlCisgICAgcHVibGljIEZyYW1lRm9ybWF0IGdldE91dHB1dEZvcm1hdChTdHJpbmcgcG9ydE5hbWUsIEZyYW1lRm9ybWF0IGlucHV0Rm9ybWF0KSB7CisgICAgICAgIHJldHVybiBpbnB1dEZvcm1hdDsKKyAgICB9CisKKyAgICBwdWJsaWMgdm9pZCBpbml0UHJvZ3JhbShGaWx0ZXJDb250ZXh0IGNvbnRleHQsIGludCB0YXJnZXQpIHsKKyAgICAgICAgc3dpdGNoICh0YXJnZXQpIHsKKyAgICAgICAgICAgIGNhc2UgRnJhbWVGb3JtYXQuVEFSR0VUX0dQVToKKyAgICAgICAgICAgICAgICBTaGFkZXJQcm9ncmFtIHNoYWRlclByb2dyYW0gPSBuZXcgU2hhZGVyUHJvZ3JhbShjb250ZXh0LCBtU2hhcnBlblNoYWRlcik7CisgICAgICAgICAgICAgICAgc2hhZGVyUHJvZ3JhbS5zZXRNYXhpbXVtVGlsZVNpemUobVRpbGVTaXplKTsKKyAgICAgICAgICAgICAgICBtUHJvZ3JhbSA9IHNoYWRlclByb2dyYW07CisgICAgICAgICAgICAgICAgYnJlYWs7CisKKyAgICAgICAgICAgIGRlZmF1bHQ6CisgICAgICAgICAgICAgICAgdGhyb3cgbmV3IFJ1bnRpbWVFeGNlcHRpb24oIkZpbHRlciBTaGFycGVuIGRvZXMgbm90IHN1cHBvcnQgZnJhbWVzIG9mICIgKworICAgICAgICAg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WYgKHRhcmdldCAhPSBtQ3VycmVudFRhcmdldCkgeworICAgICAgICAgICAgc3dpdGNoICh0YXJnZXQpIHsKKyAgICAgICAgICAgICAgICBjYXNlIEZyYW1lRm9ybWF0LlRBUkdFVF9OQVRJVkU6CisgICAgICAgICAgICAgICAgICAgIG1Qcm9ncmFtID0gZ2V0TmF0aXZlUHJvZ3JhbShjb250ZXh0KTsKKyAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisKKyAgICAgICAgICAgICAgICBjYXNlIEZyYW1lRm9ybWF0LlRBUkdFVF9HUFU6CisgICAgICAgICAgICAgICAgICAgIG1Qcm9ncmFtID0gZ2V0U2hhZGVyUHJvZ3JhbShjb250ZXh0KTsKKyAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisKKyAgICAgICAgICAgICAgICBkZWZhdWx0OgorICAgICAgICAgICAgICAgICAgICBtUHJvZ3JhbSA9IG51bGw7CisgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgfQorICAgICAgICAgICAgaWYgKG1Qcm9ncmFtID09IG51bGwpIHsKKyAgICAgICAgICAgICAgICB0aHJvdyBuZXcgUnVudGltZUV4Y2VwdGlvbigiQ291bGQgbm90IGNyZWF0ZSBhIHByb2dyYW0gZm9yIGltYWdlIGZpbHRlciAiICsgdGhpcyArICIhIik7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBpbml0UHJvZ3JhbUlucHV0cyhtUHJvZ3JhbSwgY29udGV4dCk7CisgICAgICAgICAgICBtQ3VycmVudFRhcmdldCA9IHRhcmdldDsKKyAgICAgICAgfQorICAgIH0KKworICAgIHByb3RlY3RlZCBhYnN0cmFjdCBQcm9ncmFtIGdldE5hdGl2ZVByb2dyYW0oRmlsdGVyQ29udGV4dCBjb250ZXh0KTsKKworICAgIHByb3RlY3RlZCBhYnN0cmFjdCBQcm9ncmFtIGdldFNoYWRlclByb2dyYW0oRmlsdGVyQ29udGV4dCBjb250ZXh0KTsKK30KZGlmZiAtLWdpdC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VGb3JtYXQuQ09MT1JTUEFDRV9SR0JBKSk7CisgICAgICAgIGFkZE91dHB1dEJhc2VkT25JbnB1dCgiaW1hZ2UiLCAiaW1hZ2UiKTsKKyAgICB9CisKKyAgICBwdWJsaWMgdm9pZCBpbml0UHJvZ3JhbShGaWx0ZXJDb250ZXh0IGNvbnRleHQsIGludCB0YXJnZXQpIHsKKyAgICAgICAgc3dpdGNoICh0YXJnZXQpIHsKKyAgICAgICAgICAgIGNhc2UgRnJhbWVGb3JtYXQuVEFSR0VUX0dQVToKKyAgICAgICAgICAgICAgICBTaGFkZXJQcm9ncmFtIHNoYWRlclByb2dyYW0gPSBTaGFkZXJQcm9ncmFtLmNyZWF0ZUlkZW50aXR5KGNvbnRleHQpOworICAgICAgICAgICAgICAgIHNoYWRlclByb2dyYW0uc2V0TWF4aW11bVRpbGVTaXplKG1UaWxlU2l6ZSk7CisgICAgICAgICAgICAgICAgbVByb2dyYW0gPSBzaGFkZXJQcm9ncmFtOworICAgICAgICAgICAgICAgIGJyZWFrOworCisgICAgICAgICAgICBkZWZhdWx0OgorICAgICAgICAgICAgICAgIHRocm93IG5ldyBSdW50aW1lRXhjZXB0aW9uKCJGaWx0ZXIgU2hhcnBlbiBkb2VzIG5vdCBzdXBwb3J0IGZyYW1lcyBvZiAiICsKKyAgICAgICAgICAgICAgICAgICAgInRhcmdldCAiICsgdGFyZ2V0ICsgIiEiKTsKKyAgICAgICAgfQorICAgICAgICBtVGFyZ2V0ID0gdGFyZ2V0OworICAgIH0KKworICAgIEBPdmVycmlkZQorICAgIHB1YmxpYyB2b2lkIGZpZWxkUG9ydFZhbHVlVXBkYXRlZChTdHJpbmcgbmFtZSwgRmlsdGVyQ29udGV4dCBjb250ZXh0KSB7CisgICAgICAgIGlmIChtUHJvZ3JhbSAhPSBudWxsKSB7CisgICAgICAgICAgICB1cGRhdGVQYXJhbWV0ZXJzKCk7CisgICAgICAgIH0KKyAgICB9CisKKyAgICBAT3ZlcnJpZGUKKyAgICBwd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YXNlIHB1c2hlZCBmcmFtZQorICAgICAgICBvdXRwdXQucmVsZWFzZSgpOworICAgIH0KKworICAgIHByaXZhdGUgdm9pZCB1cGRhdGVQYXJhbWV0ZXJzKCkgeworICAgICAgICBmbG9hdCBjb3NUaGV0YSA9IChmbG9hdCkgTWF0aC5jb3MobUFuZ2xlICogREVHUkVFX1RPX1JBRElBTik7CisgICAgICAgIGZsb2F0IHNpblRoZXRhID0gKGZsb2F0KSBNYXRoLnNpbihtQW5nbGUgKiBERUdSRUVfVE9fUkFESUFOKTsKKworICAgICAgICBpZiAobU1heEFuZ2xlIDw9IDApCisgICAgICAgICAgICB0aHJvdyBuZXcgUnVudGltZUV4Y2VwdGlvbigiTWF4IGFuZ2xlIGlzIG91dCBvZiByYW5nZSAoMC0xODApLiIpOworICAgICAgICBtTWF4QW5nbGUgPSAobU1heEFuZ2xlID4gOTApID8gOTAgOiBtTWF4QW5nbGU7CisKKyAgICAgICAgUG9pbnQgcDAgPSBuZXcgUG9pbnQoLWNvc1RoZXRhICogbVdpZHRoICsgc2luVGhldGEgKiBtSGVpZ2h0LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAtc2luVGhldGEgKiBtV2lkdGggLSBjb3NUaGV0YSAqIG1IZWlnaHQpOworCisgICAgICAgIFBvaW50IHAxID0gbmV3IFBvaW50KGNvc1RoZXRhICogbVdpZHRoICsgc2luVGhldGEgKiBtSGVpZ2h0LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzaW5UaGV0YSAqIG1XaWR0aCAtIGNvc1RoZXRhICogbUhlaWdodCk7CisKKyAgICAgICAgUG9pbnQgcDIgPSBuZXcgUG9pbnQoLWNvc1RoZXRhICogbVdpZHRoIC0gc2luVGhldGEgKiBtSGVpZ2h0LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAtc2luVGhldGEgKiBtV2lkdGggKyBjb3NUaGV0YSAqIG1IZWlnaHQpOworCisgICAgICAgIFBvaW50IHAzID0gbmV3IFBvaW50KGNvc1RoZXRhICogbVdpZHRoIC0gc2luVGhldGEgKiBtSGVpZ2h0LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzaW5UaGV0YSAqIG1XaWR0aCArIGNvc1RoZXRhICogbUhlaWdodCk7CisKKyAgICAgICAgZmxvYXQgbWF4V2lkdGggPSAoZmxvYXQpIE1hdGgubWF4KE1hdGguYWJzKHAwLngpLCBNYXRoLmFicyhwMS54KSk7CisgICAgICAgIGZsb2F0IG1heEhlaWdodCA9IChmbG9hdCkgTWF0aC5tYXgoTWF0aC5hYnMocDAueSksIE1hdGguYWJzKHAxLnkpKTsKKworICAgICAgICBmbG9hdCBzY2FsZSA9IDAuNWYgKiBNYXRoLm1pbiggbVdpZHRoIC8gbWF4V2lkdGgsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBtSGVpZ2h0IC8gbWF4SGVpZ2h0KTsKKworICAgICAgICBwMC5zZXQoc2NhbGUgKiBwMC54IC8gbVdpZHRoICsgMC41Ziwgc2NhbGUgKiBwMC55IC8gbUhlaWdodCArIDAuNWYpOworICAgICAgICBwMS5zZXQoc2NhbGUgKiBwMS54IC8gbVdpZHRoICsgMC41Ziwgc2NhbGUgKiBwMS55IC8gbUhlaWdodCArIDAuNWYpOworICAgICAgICBwMi5zZXQoc2NhbGUgKiBwMi54IC8gbVdpZHRoICsgMC41Ziwgc2NhbGUgKiBwMi55IC8gbUhlaWdodCArIDAuNWYpOworICAgICAgICBwMy5zZXQoc2NhbGUgKiBwMy54IC8gbVdpZHRoICsgMC41Ziwgc2NhbGUgKiBwMy55IC8gbUhlaWdodCArIDAuNWYpOworCisgICAgICAgIFF1YWQgcXVhZCA9IG5ldyBRdWFkKHAwLCBwMSwgcDIsIHAzKTsKKyAgICAgICAgKChTaGFkZXJQcm9ncmFtKSBtUHJvZ3JhbSkuc2V0U291cmNlUmVnaW9uKHF1YWQpOworICAgIH0KK30KZGlmZiAtLWdpdCBhL21lZGlhL21jYS9maWx0ZXJwY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DAwMEZGOworCisgICAgQEdlbmVyYXRlRmllbGRQb3J0KG5hbWUgPSAidGlsZV9zaXplIiwgaGFzRGVmYXVsdCA9IHRydWUpCisgICAgcHJpdmF0ZSBpbnQgbVRpbGVTaXplID0gNjQwOworCisgICAgcHJpdmF0ZSBQcm9ncmFtIG1Qcm9ncmFtOworICAgIHByaXZhdGUgaW50IG1UYXJnZXQgPSBGcmFtZUZvcm1hdC5UQVJHRVRfVU5TUEVDSUZJRUQ7CisKKyAgICBwcml2YXRlIGZpbmFsIFN0cmluZyBtVGludFNoYWRlciA9CisgICAgICAgICAgICAicHJlY2lzaW9uIG1lZGl1bXAgZmxvYXQ7XG4iICsKKyAgICAgICAgICAgICJ1bmlmb3JtIHNhbXBsZXIyRCB0ZXhfc2FtcGxlcl8wO1xuIiArCisgICAgICAgICAgICAidW5pZm9ybSB2ZWMzIHRpbnQ7XG4iICsKKyAgICAgICAgICAgICJ1bmlmb3JtIHZlYzMgY29sb3JfcmF0aW87XG4iICsKKyAgICAgICAgICAgICJ2YXJ5aW5nIHZlYzIgdl90ZXhjb29yZDtcbiIgKworICAgICAgICAgICAgInZvaWQgbWFpbigpIHtcbiIgKworICAgICAgICAgICAgIiAgdmVjNCBjb2xvciA9IHRleHR1cmUyRCh0ZXhfc2FtcGxlcl8wLCB2X3RleGNvb3JkKTtcbiIgKworICAgICAgICAgICAgIiAgZmxvYXQgYXZnX2NvbG9yID0gZG90KGNvbG9yX3JhdGlvLCBjb2xvci5yZ2IpO1xuIiArCisgICAgICAgICAgICAiICB2ZWMzIG5ld19jb2xvciA9IG1pbigwLjggKiBhdmdfY29sb3IgKyAwLjIgKiB0aW50LCAxLjApO1xuIiArCisgICAgICAgICAgICAiICBnbF9GcmFnQ29sb3IgPSB2ZWM0KG5ld19jb2xvci5yZ2IsIGNvbG9yLmEpO1xuIiArCisgICAgICAgICAgICAifVxuIjsKKworICAgIHB1YmxpYyBUaW50RmlsdGVyKFN0cmluZyBuYW1lKSB7CisgICAgICBzdXBlcihuYW1lKTsKKyAgICB9CisKKyAgICBAT3ZlcnJpZGUKKyAgICBwdWJsaWMgdm9pZCBzZXR1cFBvcnRzKCkgeworICAgICAgICBhZGRNYXNrZWRJbnB1dFBvcnQoImltYWdlIiwgSW1hZ2VGb3JtYXQuY3JlYXRlKEltYWdlRm9ybWF0LkNPTE9SU1BBQ0VfUkdCQSkpOworICAgICAgICBhZGRPdXRwdXRCYXNlZE9uSW5wdXQoImltYWdlIiwgImltYWdlIik7CisgICAgfQorCisgICAgQE92ZXJyaWRlCisgICAgcHVibGljIEZyYW1lRm9ybWF0IGdldE91dHB1dEZvcm1hdChTdHJpbmcgcG9ydE5hbWUsIEZyYW1lRm9ybWF0IGlucHV0Rm9ybWF0KSB7CisgICAgICAgIHJldHVybiBpbnB1dEZvcm1hdDsKKyAgICB9CisKKyAgICBwdWJsaWMgdm9pZCBpbml0UHJvZ3JhbShGaWx0ZXJDb250ZXh0IGNvbnRleHQsIGludCB0YXJnZXQpIHsKKyAgICAgICAgc3dpdGNoICh0YXJnZXQpIHsKKyAgICAgICAgICAgIGNhc2UgRnJhbWVGb3JtYXQuVEFSR0VUX0dQVToKKyAgICAgICAgICAgICAgICBTaGFkZXJQcm9ncmFtIHNoYWRlclByb2dyYW0gPSBuZXcgU2hhZGVyUHJvZ3JhbShjb250ZXh0LCBtVGludFNoYWRlcik7CisgICAgICAgICAgICAgICAgc2hhZGVyUHJvZ3JhbS5zZXRNYXhpbXVtVGlsZVNpemUobVRpbGVTaXplKTsKKyAgICAgICAgICAgICAgICBtUHJvZ3JhbSA9IHNoYWRlclByb2dyYW07CisgICAgICAgICAgICAgICAgYnJlYWs7CisKKyAgICAgICAgICAgIGRlZmF1bHQ6CisgICAgICAgICAgICAgICAgdGhyb3cgbmV3IFJ1bnRpbWVFeGNlcHRpb24oIkZpbHRlciBTaGFycGVuIGRvZXMgbm90IHN1cHBvcnQgZnJhbWVzIG9mICIgKworICAgICAgICAgICAgICAgICAgICAidGFyZ2V0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ICBwcml2YXRlIGludCBtVGlsZVNpemUgPSA2NDA7CisKKyAgICBwcml2YXRlIE11dGFibGVGcmFtZUZvcm1hdCBtT3V0cHV0Rm9ybWF0OworCisgICAgcHJpdmF0ZSBzdGF0aWMgZmluYWwgU3RyaW5nIG1Db2xvclRvR3JheTRTaGFkZXIgPQorICAgICAgICAgICAgInByZWNpc2lvbiBtZWRpdW1wIGZsb2F0O1xuIiArCisgICAgICAgICAgICAidW5pZm9ybSBzYW1wbGVyMkQgdGV4X3NhbXBsZXJfMDtcbiIgKworICAgICAgICAgICAgInZhcnlpbmcgdmVjMiB2X3RleGNvb3JkO1xuIiArCisgICAgICAgICAgICAidm9pZCBtYWluKCkge1xuIiArCisgICAgICAgICAgICAiICB2ZWM0IGNvbG9yID0gdGV4dHVyZTJEKHRleF9zYW1wbGVyXzAsIHZfdGV4Y29vcmQpO1xuIiArCisgICAgICAgICAgICAiICBmbG9hdCB5ID0gZG90KGNvbG9yLCB2ZWM0KDAuMjk5LCAwLjU4NywgMC4xMTQsIDApKTtcbiIgKworICAgICAgICAgICAgIiAgZ2xfRnJhZ0NvbG9yID0gdmVjNCh5LCB5LCB5LCBjb2xvci5hKTtcbiIgKworICAgICAgICAgICAgIn1cbiI7CisKKyAgICBwdWJsaWMgVG9HcmF5RmlsdGVyKFN0cmluZyBuYW1lKSB7CisgICAgICAgIHN1cGVyKG5hbWUsIG51bGwpOworICAgIH0KKworICAgIEBPdmVycmlkZQorICAgIHB1YmxpYyB2b2lkIHNldHVwUG9ydHMoKSB7CisgICAgICAgIGFkZE1hc2tlZElucHV0UG9ydCgiaW1hZ2UiLCBJbWFnZUZvcm1hdC5jcmVhdGUoSW1hZ2VGb3JtYXQuQ09MT1JTUEFDRV9SR0JBLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEZyYW1lRm9ybWF0LlRBUkdFVF9HUFUpKTsKKyAgICAgICAgYWRkT3V0cHV0QmFzZWRPbklucH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ICAgICIgIH1cbiIgKworICAgICAgICAifVxuIjsKKworICAgIHB1YmxpYyBUb1BhY2tlZEdyYXlGaWx0ZXIoU3RyaW5nIG5hbWUpIHsKKyAgICAgICAgc3VwZXIobmFtZSk7CisgICAgfQorCisgICAgQE92ZXJyaWRlCisgICAgcHVibGljIHZvaWQgc2V0dXBQb3J0cygpIHsKKyAgICAgICAgYWRkTWFza2VkSW5wdXRQb3J0KCJpbWFnZSIsIEltYWdlRm9ybWF0LmNyZWF0ZShJbWFnZUZvcm1hdC5DT0xPUlNQQUNFX1JHQkEsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgRnJhbWVGb3JtYXQuVEFSR0VUX0dQVSkpOworICAgICAgICBhZGRPdXRwdXRCYXNlZE9uSW5wdXQoImltYWdlIiwgImltYWdlIik7CisgICAgfQorCisgICAgQE92ZXJyaWRlCisgICAgcHVibGljIEZyYW1lRm9ybWF0IGdldE91dHB1dEZvcm1hdChTdHJpbmcgcG9ydE5hbWUsIEZyYW1lRm9ybWF0IGlucHV0Rm9ybWF0KSB7CisgICAgICAgIHJldHVybiBjb252ZXJ0SW5wdXRGb3JtYXQoaW5wdXRGb3JtYXQpOworICAgIH0KKworICAgIHByaXZhdGUgdm9pZCBjaGVja091dHB1dERpbWVuc2lvbnMoaW50IG91dHB1dFdpZHRoLCBpbnQgb3V0cHV0SGVpZ2h0KSB7CisgICAgICAgIGlmIChvdXRwdXRXaWR0aCA8PSAwIHx8IG91dHB1dEhlaWdodCA8PSAwKSB7CisgICAgICAgICAgICB0aHJvdyBuZXcgUnVudGltZUV4Y2VwdGlvbigiSW52YWxpZCBvdXRwdXQgZGltZW5zaW9uczogIiArCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBvdXRwdXRXaWR0aCArICIgIiArIG91dHB1dEhlaWdodCk7CisgICAgICAgIH0KKyAgICB9CisKKyAgICBwcml2YXRlIEZyYW1lRm9ybWF0IGNvbnZlcnRJbnB1dEZvcm1hdChGcmFtZUZvcm1hdCBpbnB1dEZvcm1hdCkgeworICAgICAgICBpbnQgb3cgPSBtT1dpZHRoOworICAgICAgICBpbnQgb2ggPSBtT0hlaWdodDsKKyAgICAgICAgaW50IHcgPSBpbnB1dEZvcm1hdC5nZXRXaWR0aCgpOworICAgICAgICBpbnQgaCA9IGlucHV0Rm9ybWF0LmdldEhlaWdodCgpOworICAgICAgICBpZiAobU9XaWR0aCA9PSBGcmFtZUZvcm1hdC5TSVpFX1VOU1BFQ0lGSUVEKSB7CisgICAgICAgICAgICBvdyA9IHc7CisgICAgICAgIH0KKyAgICAgICAgaWYgKG1PSGVpZ2h0ID09IEZyYW1lRm9ybWF0LlNJWkVfVU5TUEVDSUZJRUQpIHsKKyAgICAgICAgICAgIG9oID0gaDsKKyAgICAgICAgfQorICAgICAgICBpZiAobUtlZXBBc3BlY3RSYXRpbykgeworICAgICAgICAgICAgLy8gaWYga2VlcCBhc3BlY3QgcmF0aW8sIHVzZSB0aGUgYmlnZ2VyIGRpbWVuc2lvbiB0byBkZXRlcm1pbmUgdGhlCisgICAgICAgICAgICAvLyBmaW5hbCBvdXRwdXQgc2l6ZQorICAgICAgICAgICAgaWYgKHcgPiBoKSB7CisgICAgICAgICAgICAgICAgb3cgPSBNYXRoLm1heChvdywgb2gpOworICAgICAgICAgICAgICAgIG9oID0gb3cgKiBoIC8gdzsKKyAgICAgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICAgICAgb2ggPSBNYXRoLm1heChvdywgb2gpOworICAgICAgICAgICAgICAgIG93ID0gb2ggKiB3IC8gaDsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgICAgICBvdyA9IChvdyA+IDAgJiYgb3cgPCA0KSA/IDQgOiAob3cgLyA0KSAqIDQ7IC8vIGVuc3VyZSB3aWR0aCBpcyBtdWx0aXBsZSBvZiA0CisgICAgICAgIHJldHVybiBJbWFnZUZvcm1hdC5jcmVhdGUob3csIG9oLAorIC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AgIHN3aXRjaCAobUlucHV0QlBQKSB7CisgICAgICAgICAgICBjYXNlIDE6CisgICAgICAgICAgICAgICAgbVByb2dyYW0gPSBuZXcgTmF0aXZlUHJvZ3JhbSgiZmlsdGVycGFja19pbWFnZXByb2MiLCAiZ3JheV90b19yZ2JhIik7CisgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICBjYXNlIDM6CisgICAgICAgICAgICAgICAgbVByb2dyYW0gPSBuZXcgTmF0aXZlUHJvZ3JhbSgiZmlsdGVycGFja19pbWFnZXByb2MiLCAicmdiX3RvX3JnYmEiKTsKKyAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgIGRlZmF1bHQ6CisgICAgICAgICAgICAgICAgdGhyb3cgbmV3IFJ1bnRpbWVFeGNlcHRpb24oIlVuc3VwcG9ydGVkIEJ5dGVzUGVyUGl4ZWw6ICIgKyBtSW5wdXRCUFAgKyAiISIpOworICAgICAgICB9CisgICAgfQorCisgICAgQE92ZXJyaWRlCisgICAgcHVibGljIHZvaWQgcHJvY2VzcyhGaWx0ZXJDb250ZXh0IGNvbnRleHQpIHsKKyAgICAgICAgLy8gR2V0IGlucHV0IGZyYW1lCisgICAgICAgIEZyYW1lIGlucHV0ID0gcHVsbElucHV0KCJpbWFnZSIpOworICAgICAgICBjcmVhdGVQcm9ncmFtKGNvbnRleHQsIGlucHV0LmdldEZvcm1hdCgpKTsKKworICAgICAgICAvLyBDcmVhdGUgb3V0cHV0IGZyYW1lCisgICAgICAgIEZyYW1lIG91dHB1dCA9IGNvbnRleHQuZ2V0RnJhbWVNYW5hZ2VyKCkubmV3RnJhbWUoZ2V0Q29udmVydGVkRm9ybWF0KGlucHV0LmdldEZvcm1hdCgpKSk7CisKKyAgICAgICAgLy8gUHJvY2VzcworICAgICAgICBtUHJvZ3JhbS5wcm9jZXNzKGlucHV0LCBvdXRwdXQpOworCisgICAgICAgIC8vIFB1c2ggb3V0cHV0CisgICAgICAgIHB1c2hPdXRwdXQoIm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ZjsKKyAgICBwcml2YXRlIGZpbmFsIGZsb2F0IG1TaGFkZSA9IDAuODVmOworCisgICAgcHJpdmF0ZSBmaW5hbCBTdHJpbmcgbVZpZ25ldHRlU2hhZGVyID0KKyAgICAgICAgICAgICJwcmVjaXNpb24gbWVkaXVtcCBmbG9hdDtcbiIgKworICAgICAgICAgICAgInVuaWZvcm0gc2FtcGxlcjJEIHRleF9zYW1wbGVyXzA7XG4iICsKKyAgICAgICAgICAgICJ1bmlmb3JtIGZsb2F0IHJhbmdlO1xuIiArCisgICAgICAgICAgICAidW5pZm9ybSBmbG9hdCBpbnZfbWF4X2Rpc3Q7XG4iICsKKyAgICAgICAgICAgICJ1bmlmb3JtIGZsb2F0IHNoYWRlO1xuIiArCisgICAgICAgICAgICAidW5pZm9ybSB2ZWMyIGNlbnRlcjtcbiIgKworICAgICAgICAgICAgInZhcnlpbmcgdmVjMiB2X3RleGNvb3JkO1xuIiArCisgICAgICAgICAgICAidm9pZCBtYWluKCkge1xuIiArCisgICAgICAgICAgICAiICBjb25zdCBmbG9hdCBzbG9wZSA9IDIwLjA7XG4iICsKKyAgICAgICAgICAgICIgIGZsb2F0IGRpc3QgPSBkaXN0YW5jZShnbF9GcmFnQ29vcmQueHksIGNlbnRlcik7XG4iICsKKyAgICAgICAgICAgICIgIGZsb2F0IGx1bWVuID0gc2hhZGUgLyAoMS4wICsgZXhwKChkaXN0ICogaW52X21heF9kaXN0IC0gcmFuZ2UpICogc2xvcGUpKSArICgxLjAgLSBzaGFkZSk7XG4iICsKKyAgICAgICAgICAgICIgIHZlYzQgY29sb3IgPSB0ZXh0dXJlMkQodGV4X3NhbXBsZXJfMCwgdl90ZXhjb29yZCk7XG4iICsKKyAgICAgICAgICAgICIgIGdsX0ZyYWdDb2xvciA9IHZlYzQoY29sb3IucmdiICogbHVtZW4sIGNvbG9yLmEpO1xuIiArCisgICAgICAgICAgICAifVxuIjsKKworICAgIHB1YmxpYyBWaWduZXR0ZUZpbHRlcihTdHJpbmcgbmFtZSkgeworICAgICAgICBzdXBlcihuYW1lKTsKKyAgICB9CisKKyAgICBAT3ZlcnJpZGUKKyAgICBwdWJsaWMgdm9pZCBzZXR1cFBvcnRzKCkgeworICAgICAgICBhZGRNYXNrZWRJbnB1dFBvcnQoImltYWdlIiwgSW1hZ2VGb3JtYXQuY3JlYXRlKEltYWdlRm9ybWF0LkNPTE9SU1BBQ0VfUkdCQSkpOworICAgICAgICBhZGRPdXRwdXRCYXNlZE9uSW5wdXQoImltYWdlIiwgImltYWdlIik7CisgICAgfQorCisgICAgQE92ZXJyaWRlCisgICAgcHVibGljIEZyYW1lRm9ybWF0IGdldE91dHB1dEZvcm1hdChTdHJpbmcgcG9ydE5hbWUsIEZyYW1lRm9ybWF0IGlucHV0Rm9ybWF0KSB7CisgICAgICAgIHJldHVybiBpbnB1dEZvcm1hdDsKKyAgICB9CisKKyAgICBwdWJsaWMgdm9pZCBpbml0UHJvZ3JhbShGaWx0ZXJDb250ZXh0IGNvbnRleHQsIGludCB0YXJnZXQpIHsKKyAgICAgICAgc3dpdGNoICh0YXJnZXQpIHsKKyAgICAgICAgICAgIGNhc2UgRnJhbWVGb3JtYXQuVEFSR0VUX0dQVToKKyAgICAgICAgICAgICAgICBTaGFkZXJQcm9ncmFtIHNoYWRlclByb2dyYW0gPSBuZXcgU2hhZGVyUHJvZ3JhbShjb250ZXh0LCBtVmlnbmV0dGVTaGFkZXIpOworICAgICAgICAgICAgICAgIHNoYWRlclByb2dyYW0uc2V0TWF4aW11bVRpbGVTaXplKG1UaWxlU2l6ZSk7CisgICAgICAgICAgICAgICAgbVByb2dyYW0gPSBzaGFkZXJQcm9ncmFtOworICAgICAgICAgICAgICAgIGJyZWFrOworCisgICAgICAgICAgICBkZWZhdWx0OgorICAgICAgICAgICAgICAgIHRocm93IG5ldyBSdW50aW1lRXhjZXB0aW9uKCJGaWx0ZXIgU2hhcnBlbiBkb2VzIG5vdCBzdXBwb3J0IGZyYW1lcyBvZiAiICsKKyAgICAgICAgICAgICAgICAgICAgInRhcmdldCAiICsgdGFyZ2V0ICsgIiEiKTsKKyAgICAgICAgfQorICAgICAgICBtVGFyZ2V0ID0gdGFyZ2V0OworICAgIH0KKworICAgIHByaXZhdGUgdm9pZCBpbml0UGFyYW1ldGVycygpIHsKKyAgICAgICAgaWYgKG1Qcm9ncmFtICE9IG51bGwpIHsKKyAgICAgICAgICAgIGZsb2F0IGNlbnRlclggPSAoZmxvYXQpICgwLjUgKiBtV2lkdGgpOworICAgICAgICAgICAgZmxvYXQgY2VudGVyWSA9IChmbG9hdCkgKDAuNSAqIG1IZWlnaHQpOworICAgICAgICAgICAgZmxvYXQgY2VudGVyW10gPSB7Y2VudGVyWCwgY2VudGVyWX07CisgICAgICAgICAgICBmbG9hdCBtYXhfZGlzdCA9IChmbG9hdCkgTWF0aC5zcXJ0KGNlbnRlclggKiBjZW50ZXJYICsgY2VudGVyWSAqIGNlbnRlclkpOworCisgICAgICAgICAgICBtUHJvZ3JhbS5zZXRIb3N0VmFsdWUoImNlbnRlciIsIGNlbnRlcik7CisgICAgICAgICAgICBtUHJvZ3JhbS5zZXRIb3N0VmFsdWUoImludl9tYXhfZGlzdCIsIDEuMGYgLyBtYXhfZGlzdCk7CisgICAgICAgICAgICBtUHJvZ3JhbS5zZXRIb3N0VmFsdWUoInNoYWRlIiwgbVNoYWRlKTsKKworICAgICAgICAgICAgdXBkYXRlUGFyYW1ldGVycygpOworICAgICAgICB9CisgICAgfQorCisgICAgcHJpdmF0ZSB2b2lkIHVwZGF0ZVBhcmFtZXRlcnMoKSB7CisgICAgICAgIC8vIFRoZSAncmFuZ2UnIGlzIGJldHdlZW4gMS4zIHRvIDAuNi4gV2hlbiBzY2FsZSBpcyB6ZXJvIHRoZW4gcmFuZ2UgaXMgMS4zCisgICAgICAgIC8vIHdoaWNoIG1lYW5zIG5vIHZpZ25ldHRlIGF0IGFsbCBiZWNhdXNlIHRoZSBsdW1pbm91c2l0eSBkaWZmZXJlbmNlIGlzCisgICA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GN1clRpbWUgPSBTeXN0ZW1DbG9jay5lbGFwc2VkUmVhbHRpbWUoKTsKKworICAgICAgICAvLyBPdXRwdXQgdGhyb3VnaHB1dCBpbmZvIGlmIHRpbWUgcGVyaW9kIGlzIHVwCisgICAgICAgIGlmICgoY3VyVGltZSAtIG1MYXN0VGltZSkgPj0gKG1QZXJpb2QgKiAxMDAwKSkgeworICAgICAgICAgICAgRnJhbWVGb3JtYXQgaW5wdXRGb3JtYXQgPSBpbnB1dC5nZXRGb3JtYXQoKTsKKyAgICAgICAgICAgIGludCBwaXhlbENvdW50ID0gaW5wdXRGb3JtYXQuZ2V0V2lkdGgoKSAqIGlucHV0Rm9ybWF0LmdldEhlaWdodCgpOworICAgICAgICAgICAgVGhyb3VnaHB1dCB0aHJvdWdocHV0ID0gbmV3IFRocm91Z2hwdXQobVRvdGFsRnJhbWVDb3VudCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1QZXJpb2RGcmFtZUNvdW50LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbVBlcmlvZCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBpeGVsQ291bnQpOworICAgICAgICAgICAgRnJhbWUgdGhyb3VnaHB1dEZyYW1lID0gY29udGV4dC5nZXRGcmFtZU1hbmFnZXIoKS5uZXdGcmFtZShtT3V0cHV0Rm9ybWF0KTsKKyAgICAgICAgICAgIHRocm91Z2hwdXRGcmFtZS5zZXRPYmplY3RWYWx1ZSh0aHJvdWdocHV0KTsKKyAgICAgICAgICAgIHB1c2hPdXRwdXQoInRocm91Z2hwdXQiLCB0aHJvdWdocHV0RnJhbWUpOworICAgICAgICAgICAgbUxhc3RUaW1lID0gY3VyVGltZTsKKyAgICAgICAgICAgIG1QZXJpb2RGcmFtZUNvdW50ID0gMDsKKyAgICAgICAgfQorICAgIH0KKworCit9CmRpZmYg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AgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBtU3VyZmFjZVZpZXcuZ2V0SGVpZ2h0KCksCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgSW1hZ2VGb3JtYXQuQ09MT1JTUEFDRV9SR0JBLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEZyYW1lRm9ybWF0LlRBUkdFVF9HUFUpOworICAgICAgICBtU2NyZWVuID0gKEdMRnJhbWUpY29udGV4dC5nZXRGcmFtZU1hbmFnZXIoKS5uZXdCb3VuZEZyYW1lKHNjcmVlbkZvcm1hdCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBHTEZyYW1lLkVYSVNUSU5HX0ZCT19CSU5ESU5HLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDApOworICAgIH0KKworICAgIEBPdmVycmlkZQorICAgIHB1YmxpYyB2b2lkIG9wZW4oRmlsdGVyQ29udGV4dCBjb250ZXh0KSB7CisgICAgICAgIC8vIEJpbmQgc3VyZmFjZSB2aWV3IHRvIHVzLiBUaGlzIHdpbGwgZW1pdCBhIHN1cmZhY2VDcmVhdGVkIGFuZCBzdXJmYWNlQ2hhbmdlZCBjYWxsIHRoYXQKKyAgICAgICAgLy8gd2lsbCB1cGRhdGUgb3VyIHNjcmVlbiB3aWR0aCBhbmQgaGVpZ2h0LgorICAgICAgICBtU3VyZmFjZVZpZXcudW5iaW5kKCk7CisgICAgICAgIG1TdXJmYWNlVmlldy5iaW5kVG9MaXN0ZW5lcih0aGlzLCBjb250ZXh0LmdldEdMRW52aXJvbm1lbnQoKSk7CisgICAgfQorCisgICAgQE92ZXJyaWRlCisgICAgcHVibGljIHZvaWQgcHJvY2VzcyhGaWx0ZXJDb250ZXh0IGNvbnRleHQpIHsKKyAgICAgICAgLy8gTWFrZSBzdXJlIHdlIGFyZSBib3VuZCB0byBhIHN1cmZhY2UgYmVmb3JlIHJlbmRlcmluZworICAgICAgICBpZiAoIW1Jc0JvdW5kKSB7CisgICAgICAgICAgICBMb2cudygiU3VyZmFjZVJlbmRlckZpbHRlciIsCisgICAgICAgICAgICAgICAgICB0aGlzICsgIjogSWdub3JpbmcgZnJhbWUgYXMgdGhlcmUgaXMgbm8gc3VyZmFjZSB0byByZW5kZXIgdG8hIik7CisgICAgICAgICAgICByZXR1cm47CisgICAgICAgIH0KKworICAgICAgICBpZiAobUxvZ1ZlcmJvc2UpIExvZy52KFRBRywgIlN0YXJ0aW5nIGZyYW1lIHByb2Nlc3NpbmciKTsKKworICAgICAgICBHTEVudmlyb25tZW50IGdsRW52ID0gbVN1cmZhY2VWaWV3LmdldEdMRW52KCk7CisgICAgICAgIGlmIChnbEVudiAhPSBjb250ZXh0LmdldEdMRW52aXJvbm1lbnQoKSkgeworICAgICAgICAgICAgdGhyb3cgbmV3IFJ1bnRpbWVFeGNlcHRpb24oIlN1cmZhY2UgY3JlYXRlZCB1bmRlciBkaWZmZXJlbnQgR0xFbnZpcm9ubWVudCEiKTsKKyAgICAgICAgfQorCisKKyAgICAgICAgLy8gR2V0IGlucHV0IGZyYW1lCisgICAgICAgIEZyYW1lIGlucHV0ID0gcHVsbElucHV0KCJmcmFtZSIpOworICAgICAgICBib29sZWFuIGNyZWF0ZWRGcmFtZSA9IGZhbHNlOworCisgICAgICAgIGZsb2F0IGN1cnJlbnRBc3BlY3RSYXRpbyA9IChmbG9hdClpbnB1dC5nZXRGb3JtYXQoKS5nZXRXaWR0aCgpIC8gaW5wdXQuZ2V0Rm9ybWF0KCkuZ2V0SGVpZ2h0KCk7CisgICAgICAgIGlmIChjdXJyZW50QXNwZWN0UmF0aW8gIT0gbUFzcGVjdFJhdGlvKSB7CisgICAgICAgICAgICBpZiAobUxvZ1ZlcmJvc2UpIExvZy52KFRBRywgIk5ldyBhc3BlY3QgcmF0aW86ICIgKyBjdXJyZW50QXNwZWN0UmF0aW8gKyIsIHByZXZpb3VzbHk6ICIgKyBtQXNwZWN0UmF0aW8pOworICAgICAgICAgICAgbUFzcGVjdFJhdGlvID0gY3VycmVudEFzcGVjdFJhdGlvOworICAgICAgICAgICAgdXBkYXRlVGFyZ2V0UmVjdCgpOworICAgICAgICB9CisKKyAgICAgICAgLy8gU2VlIGlmIHdlIG5lZWQgdG8gY29weSB0byBHUFUKKyAgICAgICAgRnJhbWUgZ3B1RnJhbWUgPSBudWxsOworICAgICAgICBpZiAobUxvZ1ZlcmJvc2UpIExvZy52KCJTdXJmYWNlUmVuZGVyRmlsdGVyIiwgIkdvdCBpbnB1dCBmb3JtYXQ6ICIgKyBpbnB1dC5nZXRGb3JtYXQoKSk7CisgICAgICAgIGludCB0YXJnZXQgPSBpbnB1dC5nZXRGb3JtYXQoKS5nZXRUYXJnZXQoKTsKKyAgICAgICAgaWYgKHRhcmdldCAhPSBGcmFtZUZvcm1hdC5UQVJHRVRfR1BVKSB7CisgICAgICAgICAgICBncHVGcmFtZSA9IGNvbnRleHQuZ2V0RnJhbWVNYW5hZ2VyKCkuZHVwbGljYXRlRnJhbWVUb1RhcmdldChpbnB1dCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEZyYW1lRm9ybWF0LlRBUkdFVF9HUFUpOworICAgICAgICAgICAgY3JlYXRlZEZyYW1lID0gdHJ1ZTsKKyAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgIGdwdUZyYW1lID0gaW5wdXQ7CisgICAgICAgIH0KKworICAgICAgICAvLyBBY3RpdmF0ZSBvdXIgc3VyZmFjZQorICAgICAgICBnbEVudi5hY3RpdmF0ZVN1cmZhY2VXaXRoSWQobVN1cmZhY2VWaWV3LmdldFN1cmZhY2VJZCgpKTsKKworICAgICAgICAvLyBQcm9jZ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0UmF0aW8gPSBzY3JlZW5Bc3BlY3RSYXRpbyAvIG1Bc3BlY3RSYXRpbzsKKworICAgICAgICAgICAgc3dpdGNoIChtUmVuZGVyTW9kZSkgeworICAgICAgICAgICAgICAgIGNhc2UgUkVOREVSTU9ERV9TVFJFVENIOgorICAgICAgICAgICAgICAgICAgICBtUHJvZ3JhbS5zZXRUYXJnZXRSZWN0KDAsIDAsIDEsIDEpOworICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICBjYXNlIFJFTkRFUk1PREVfRklUOgorICAgICAgICAgICAgICAgICAgICBpZiAocmVsYXRpdmVBc3BlY3RSYXRpbyA+IDEuMGYpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIC8vIFNjcmVlbiBpcyB3aWRlciB0aGFuIHRoZSBjYW1lcmEsIHNjYWxlIGRvd24gWAorICAgICAgICAgICAgICAgICAgICAgICAgbVByb2dyYW0uc2V0VGFyZ2V0UmVjdCgwLjVmIC0gMC41ZiAvIHJlbGF0aXZlQXNwZWN0UmF0aW8sIDAuMGYsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDEuMGYgLyByZWxhdGl2ZUFzcGVjdFJhdGlvLCAxLjBmKTsKKyAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIC8vIFNjcmVlbiBpcyB0YWxsZXIgdGhhbiB0aGUgY2FtZXJhLCBzY2FsZSBkb3duIFkKKyAgICAgICAgICAgICAgICAgICAgICAgIG1Qcm9ncmFtLnNldFRhcmdldFJlY3QoMC4wZiwgMC41ZiAtIDAuNWYgKiByZWxhdGl2ZUFzcGVjdFJhdGlvLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAxLjBmLCByZWxhdGl2ZUFzcGVjdFJhdGlvKTsKKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICBjYXNlIFJFTkRFUk1PREVfRklMTF9DUk9QOgorICAgICAgICAgICAgICAgICAgICBpZiAocmVsYXRpdmVBc3BlY3RSYXRpbyA+IDEpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIC8vIFNjcmVlbiBpcyB3aWRlciB0aGFuIHRoZSBjYW1lcmEsIGNyb3AgaW4gWQorICAgICAgICAgICAgICAgICAgICAgICAgbVByb2dyYW0uc2V0VGFyZ2V0UmVjdCgwLjBmLCAwLjVmIC0gMC41ZiAqIHJlbGF0aXZlQXNwZWN0UmF0aW8sCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDEuMGYsIHJlbGF0aXZlQXNwZWN0UmF0aW8pOworICAgICAgICAgICAgICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgICAgICAgICAgICAgLy8gU2NyZWVuIGlzIHRhbGxlciB0aGFuIHRoZSBjYW1lcmEsIGNyb3AgaW4gWAorICAgICAgICAgICAgICAgICAgICAgICAgbVByb2dyYW0uc2V0VGFyZ2V0UmVjdCgwLjVmIC0gMC41ZiAvIHJlbGF0aXZlQXNwZWN0UmF0aW8sIDAuMGYsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDEuMGYgLyByZWxhdGl2ZUFzcGVjdFJhdGlvLCAxLjBmKTsKKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgIH0KK30KZGlmZiAtLWdpdCBhL21lZGlhL21jYS9maWx0ZXJwYWNrcy9qYXZhL2FuZHJvaWQvZmlsdGVycGFja3MvdWkvU3VyZmFjZVRhcmdldEZpbHRlci5qYXZhIGIvbWVkaWEvbWNhL2ZpbHRlcnBhY2tzL2phdmEvYW5kcm9pZC9maWx0ZXJwYWNrcy91aS9TdXJmYWNlVGFyZ2V0RmlsdGVyLmphdmEKbmV3IGZpb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IG1SZW5kZXJNb2RlID0gUkVOREVSTU9ERV9GSUxMX0NST1A7CisgICAgICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgICAgIHRocm93IG5ldyBSdW50aW1lRXhjZXB0aW9uKCJVbmtub3duIHJlbmRlciBtb2RlICciICsgbVJlbmRlck1vZGVTdHJpbmcgKyAiJyEiKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgICAgICB1cGRhdGVUYXJnZXRSZWN0KCk7CisgICAgfQorCisgICAgQE92ZXJyaWRlCisgICAgcHVibGljIHZvaWQgcHJlcGFyZShGaWx0ZXJDb250ZXh0IGNvbnRleHQpIHsKKyAgICAgICAgbUdsRW52ID0gY29udGV4dC5nZXRHTEVudmlyb25tZW50KCk7CisKKyAgICAgICAgLy8gQ3JlYXRlIGlkZW50aXR5IHNoYWRlciB0byByZW5kZXIsIGFuZCBtYWtlIHN1cmUgdG8gcmVuZGVyIHVwc2lkZS1kb3duLCBhcyB0ZXh0dXJlcworICAgICAgICAvLyBhcmUgc3RvcmVkIGludGVybmFsbHkgYm90dG9tLXRvLXRvcC4KKyAgICAgICAgbVByb2dyYW0gPSBTaGFkZXJQcm9ncmFtLmNyZWF0ZUlkZW50aXR5KGNvbnRleHQpOworICAgICAgICBtUHJvZ3JhbS5zZXRTb3VyY2VSZWN0KDAsIDEsIDEsIC0xKTsKKyAgICAgICAgbVByb2dyYW0uc2V0Q2xlYXJzT3V0cHV0KHRydWUpOworICAgICAgICBtUHJvZ3JhbS5zZXRDbGVhckNvbG9yKDAuMGYsIDAuMGYsIDAuMGYpOworCisgICAgICAgIE11dGFibGVGcmFtZUZvcm1hdCBzY3JlZW5Gb3JtYXQgPSBJbWFnZUZvcm1hdC5jcmVhdGUobVNjcmVlbldpZHRoLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1TY3JlZW5IZWlnaHQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgSW1hZ2VGb3JtYXQuQ09MT1JTUEFDRV9SR0JBLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEZyYW1lRm9ybWF0LlRBUkdFVF9HUFUpOworICAgICAgICBtU2NyZWVuID0gKEdMRnJhbWUpY29udGV4dC5nZXRGcmFtZU1hbmFnZXIoKS5uZXdCb3VuZEZyYW1lKHNjcmVlbkZvcm1hdCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBHTEZyYW1lLkVYSVNUSU5HX0ZCT19CSU5ESU5HLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDApOworCisgICAgICAgIC8vIFNldCB1cCBjcm9wcGluZworICAgICAgICB1cGRhdGVSZW5kZXJNb2RlKCk7CisgICAgfQorCisgICAgQE92ZXJyaWRlCisgICAgcHVibGljIHZvaWQgb3BlbihGaWx0ZXJDb250ZXh0IGNvbnRleHQpIHsKKyAgICAgICAgcmVnaXN0ZXJTdXJmYWNlKCk7CisgICAgfQorCisgICAgQE92ZXJyaWRlCisgICAgcHVibGljIHZvaWQgcHJvY2VzcyhGaWx0ZXJDb250ZXh0IGNvbnRleHQpIHsKKyAgICAgICAgaWYgKG1Mb2dWZXJib3NlKSBMb2cudihUQUcsICJTdGFydGluZyBmcmFtZSBwcm9jZXNzaW5nIik7CisKKyAgICAgICAgLy8gR2V0IGlucHV0IGZyYW1lCisgICAgICAgIEZyYW1lIGlucHV0ID0gcHVsbElucHV0KCJmcmFtZSIpOworICAgICAgICBib29sZWFuIGNyZWF0ZWRGcmFtZSA9IGZhbHNlOworCisgICAgICAgIGZsb2F0IGN1cnJlbnRBc3BlY3RSYXRpbyA9IChmbG9hdClpbnB1dC5nZXRGb3JtYXQoKS5nZXRXaWR0a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bkhlaWdodCA+IDAgJiYgbVByb2dyYW0gIT0gbnVsbCkgeworICAgICAgICAgICAgZmxvYXQgc2NyZWVuQXNwZWN0UmF0aW8gPSAoZmxvYXQpbVNjcmVlbldpZHRoIC8gbVNjcmVlbkhlaWdodDsKKyAgICAgICAgICAgIGZsb2F0IHJlbGF0aXZlQXNwZWN0UmF0aW8gPSBzY3JlZW5Bc3BlY3RSYXRpbyAvIG1Bc3BlY3RSYXRpbzsKKworICAgICAgICAgICAgc3dpdGNoIChtUmVuZGVyTW9kZSkgeworICAgICAgICAgICAgICAgIGNhc2UgUkVOREVSTU9ERV9TVFJFVENIOgorICAgICAgICAgICAgICAgICAgICBtUHJvZ3JhbS5zZXRUYXJnZXRSZWN0KDAsIDAsIDEsIDEpOworICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICBjYXNlIFJFTkRFUk1PREVfRklUOgorICAgICAgICAgICAgICAgICAgICBpZiAocmVsYXRpdmVBc3BlY3RSYXRpbyA+IDEuMGYpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIC8vIFNjcmVlbiBpcyB3aWRlciB0aGFuIHRoZSBjYW1lcmEsIHNjYWxlIGRvd24gWAorICAgICAgICAgICAgICAgICAgICAgICAgbVByb2dyYW0uc2V0VGFyZ2V0UmVjdCgwLjVmIC0gMC41ZiAvIHJlbGF0aXZlQXNwZWN0UmF0aW8sIDAuMGYsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDEuMGYgLyByZWxhdGl2ZUFzcGVjdFJhdGlvLCAxLjBmKTsKKyAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIC8vIFNjcmVlbiBpcyB0YWxsZXIgdGhhbiB0aGUgY2FtZXJhLCBzY2FsZSBkb3duIFkKKyAgICAgICAgICAgICAgICAgICAgICAgIG1Qcm9ncmFtLnNldFRhcmdldFJlY3QoMC4wZiwgMC41ZiAtIDAuNWYgKiByZWxhdGl2ZUFzcGVjdFJhdGlvLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAxLjBmLCByZWxhdGl2ZUFzcGVjdFJhdGlvKTsKKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICBjYXNlIFJFTkRFUk1PREVfRklMTF9DUk9QOgorICAgICAgICAgICAgICAgICAgICBpZiAocmVsYXRpdmVBc3BlY3RSYXRpbyA+IDEpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIC8vIFNjcmVlbiBpcyB3aWRlciB0aGFuIHRoZSBjYW1lcmEsIGNyb3AgaW4gWQorICAgICAgICAgICAgICAgICAgICAgICAgbVByb2dyYW0uc2V0VGFyZ2V0UmVjdCgwLjBmLCAwLjVmIC0gMC41ZiAqIHJlbGF0aXZlQXNwZWN0UmF0aW8sCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDEuMGYsIHJlbGF0aXZlQXNwZWN0UmF0aW8pOworICAgICAgICAgICAgICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgICAgICAgICAgICAgLy8gU2NyZWVuIGlzIHRhbGxlciB0aGFuIHRoZSBjYW1lcmEsIGNyb3AgaW4gWAorICAgICAgICAgICAgICAgICAgICAgICAgbVByb2dyYW0uc2V0VGFyZ2V0UmVjdCgwLjVmIC0gMC41ZiAvIHJlbGF0aXZlQXNwZWN0UmF0aW8sIDAuMGYsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDEuMGYgLyByZWxhdGl2ZUFzcGVjdFJhdGlvLCAxLjBmKTsKKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgIH0KKworICAgIHByaXZhdGUgdm9pZCByZWdpc3RlclN1cmZhY2UoKSB7C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CwgIiArCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIjAuNTg3LCAtMC4zMzEyNjQsIC0wLjQxODY4OCwgMC4wMDAsICIgKworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICIwLjExNCwgIDAuNSwgICAgICAtMC4wODEzMTIsIDAuMDAwLCAiICsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAiMC4wMDAsICAwLjUsICAgICAgIDAuNSwgICAgICAxLjAwMCAiOworICAgIC8qKiBTdHJlYW0gbmFtZXMgKi8KKworICAgIHByaXZhdGUgc3RhdGljIGZpbmFsIFN0cmluZ1tdIG1JbnB1dE5hbWVzID0geyJ2aWRlbyIsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgImJhY2tncm91bmQifTsKKworICAgIHByaXZhdGUgc3RhdGljIGZpbmFsIFN0cmluZ1tdIG1PdXRwdXROYW1lcyA9IHsidmlkZW8ifTsKKworICAgIHByaXZhdGUgc3RhdGljIGZpbmFsIFN0cmluZ1tdIG1EZWJ1Z091dHB1dE5hbWVzID0geyJkZWJ1ZzEiLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICJkZWJ1ZzIifTsKKworICAgIC8qKiBPdGhlciBwcml2YXRlIHZhcmlhYmxlcyAqLworCisgICAgcHJpdmF0ZSBGcmFtZUZvcm1hdCBtT3V0cHV0Rm9ybWF0OworICAgIHByaXZhdGUgTXV0YWJsZUZyYW1lRm9ybWF0IG1NZW1vcnlGb3JtYXQ7CisgICAgcHJpdmF0ZSBNdXRhYmxlRnJhbWVGb3JtYXQgbU1hc2tGb3JtYXQ7CisgICAgcHJpdmF0ZSBNdXRhYmxlRnJhbWVGb3JtYXQgbUF2ZXJhZ2VGb3JtYXQ7CisKKyAgICBwcml2YXRlIGZpb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hbGUgPSAiICsgREVGQVVMVF9BVVRPX1dCX1NDQUxFICsgIjtcbiIgKworICAgICAgICAgICAgIlxuIiArCisgICAgICAgICAgICAvLyBWYXJpYW5jZSBkaXN0YW5jZSBpbiBsdW1pbmFuY2UgYmV0d2VlbiBjdXJyZW50IHBpeGVsIGFuZCBiYWNrZ3JvdW5kIG1vZGVsCisgICAgICAgICAgICAiZmxvYXQgZ2F1c3NfZGlzdF95KGZsb2F0IHksIGZsb2F0IG1lYW4sIGZsb2F0IHZhcmlhbmNlKSB7XG4iICsKKyAgICAgICAgICAgICIgIGZsb2F0IGRpc3QgPSAoeSAtIG1lYW4pICogKHkgLSBtZWFuKSAvIHZhcmlhbmNlO1xuIiArCisgICAgICAgICAgICAiICByZXR1cm4gZGlzdDtcbiIgKworICAgICAgICAgICAgIn1cbiIgKworICAgICAgICAgICAgLy8gU3VtIG9mIHZhcmlhbmNlIGRpc3RhbmNlcyBpbiBjaHJvbWEgYmV0d2VlbiBjdXJyZW50IHBpeGVsIGFuZCBiYWNrZ3JvdW5kCisgICAgICAgICAgICAvLyBtb2RlbAorICAgICAgICAgICAgImZsb2F0IGdhdXNzX2Rpc3RfdXYodmVjMiB1diwgdmVjMiBtZWFuLCB2ZWMyIHZhcmlhbmNlKSB7XG4iICsKKyAgICAgICAgICAgICIgIHZlYzIgZGlzdCA9ICh1diAtIG1lYW4pICogKHV2IC0gbWVhbikgLyB2YXJpYW5jZTtcbiIgKworICAgICAgICAgICAgIiAgcmV0dXJuIGRpc3QuciArIGRpc3QuZztcbiIgKworICAgICAgICAgICAgIn1cbiIgKworICAgICAgICAgICAgLy8gU2VsZWN0IGxlYXJuaW5nIHJhdGUgZm9yIHBpeGVsIGJhc2VkIG9uIHNtb290aGVkIGRlY2lzaW9uIG1hc2sgYWxwaGEKKyAgICAgICAgICAgICJmbG9hdCBsb2NhbF9hZGFwdF9yYXRlKGZsb2F0IGFscGhhKSB7XG4iICsKKyAgICAgICAgICAgICIgIHJldHVybiBtaX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JhZ0NvbG9yID0gbWFzay5hIDwgZ2xvd19zdGFydCA/IGJnX3JnYiA6IFxuIiArCisgICAgICAgICAgICAiICAgICAgICAgICAgICAgICBtYXNrLmEgPCBnbG93X21heCA/IG1peChiZ19yZ2IsIHZlYzQoMC45LDAuOSwxLjAsMS4wKSwgXG4iICsKKyAgICAgICAgICAgICIgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKG1hc2suYSAtIGdsb3dfc3RhcnQpIC8gKGdsb3dfbWF4IC0gZ2xvd19zdGFydCkgKSA6IFxuIiArCisgICAgICAgICAgICAiICAgICAgICAgICAgICAgICBtYXNrLmEgPCBtYXNrX2JsZW5kX2ZnID8gbWl4KHZlYzQoMC45LDAuOSwxLjAsMS4wKSwgZ2hvc3RfcmdiLCBcbiIgKworICAgICAgICAgICAgIiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChtYXNrLmEgLSBnbG93X21heCkgLyAobWFza19ibGVuZF9mZyAtIGdsb3dfbWF4KSApIDogXG4iICsKKyAgICAgICAgICAgICIgICAgICAgICAgICAgICAgIGdob3N0X3JnYjtcbiIgKworICAgICAgICAgICAgIn1cbiI7CisKKyAgICAvLyBCYWNrZ3JvdW5kIG1vZGVsIG1lYW4gdXBkYXRlIHNoYWRlci4gU2tld3MgdGhlIGN1cnJlbnQgbW9kZWwgbWVhbiB0b3dhcmQgdGhlIG1vc3QgcmVjZW50IHBpeGVsCisgICAgLy8gICB2YWx1ZSBmb3IgYSBwaXhlbCwgd2VpZ2h0ZWQgYnkgdGhlIGxlYXJuaW5nIHJhdGUgYW5kIGJ5IHdoZXRoZXIgdGhlIHBpeGVsIGlzIGNsYXNzaWZpZWQgYXMKKyAgICAvLyAgIGZvcmVncm91bmQgb3IgYmFja2dyb3VuZC4KKyAgICAvLyBJbnB1dHM6CisgICAgLy8gICB0ZXhfc2FtcGxlcl8wOiBNaXAtbWFwIGZvciBmb3JlZ3JvdW5kIChsaXZlKSB2aWRlbyBmcm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EJhY2tEcm9wcGVyRmlsdGVyIGZpbHRlcik7CisgICAgfQorCisgICAgLyoqIFB1YmxpYyBGaWx0ZXIgbWV0aG9kcyAqLworCisgICAgcHVibGljIEJhY2tEcm9wcGVyRmlsdGVyKFN0cmluZyBuYW1lKSB7CisgICAgICAgIHN1cGVyKG5hbWUpOworCisgICAgICAgIG1Mb2dWZXJib3NlID0gTG9nLmlzTG9nZ2FibGUoVEFHLCBMb2cuVkVSQk9TRSk7CisgICAgfQorCisgICAgQE92ZXJyaWRlCisgICAgcHVibGljIHZvaWQgc2V0dXBQb3J0cygpIHsKKyAgICAgICAgLy8gSW5wdXRzLgorICAgICAgICAvLyBUT0RPOiBUYXJnZXQgc2hvdWxkIGJlIEdQVSwgYnV0IHJlbGF4ZWQgZm9yIG5vdy4KKyAgICAgICAgRnJhbWVGb3JtYXQgaW1hZ2VGb3JtYXQgPSBJbWFnZUZvcm1hdC5jcmVhdGUoSW1hZ2VGb3JtYXQuQ09MT1JTUEFDRV9SR0JBLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBGcmFtZUZvcm1hdC5UQVJHRVRfVU5TUEVDSUZJRUQpOworICAgICAgICBmb3IgKFN0cmluZyBpbnB1dE5hbWUgOiBtSW5wdXROYW1lcykgeworICAgICAgICAgICAgYWRkTWFza2VkSW5wdXRQb3J0KGlucHV0TmFtZSwgaW1hZ2VGb3JtYXQpOworICAgICAgICB9CisgICAgICAgIC8vIE5vcm1hbCBvdXRwdXRzCisgICAgICAgIGZvciAoU3RyaW5nIG91dHB1dE5hbWUgOiBtT3V0cHV0TmFtZXMpIHsKKyAgICAgICAgICAgIGFkZE91dHB1dEJhc2VkT25JbnB1dChvdXRwdXROYW1lLCAidmlkZW8iKTsKKyAgICAgICAgfQorCisgICAgICAgIC8vIERlYnVnIG91dHB1dHMKKyAgICAgICAgaWYgKG1Qcm92aWRlRGVidWdPdXRwdXRzKSB7CisgICAgICAgICAgICBmb3Ig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4KHdpZHRoRXhwLCBoZWlnaHRFeHApOworICAgICAgICBpbnQgbWVtV2lkdGggPSBNYXRoLm1heChtYXNrV2lkdGgsIChpbnQpTWF0aC5wb3coMiwgd2lkdGhFeHApKTsKKyAgICAgICAgaW50IG1lbUhlaWdodCA9IE1hdGgubWF4KG1hc2tIZWlnaHQsIChpbnQpTWF0aC5wb3coMiwgaGVpZ2h0RXhwKSk7CisgICAgICAgIG1NZW1vcnlGb3JtYXQuc2V0RGltZW5zaW9ucyhtZW1XaWR0aCwgbWVtSGVpZ2h0KTsKKyAgICAgICAgbVN1YnNhbXBsZUxldmVsID0gbVB5cmFtaWREZXB0aCAtIE1hdGgubWF4KG1NYXNrV2lkdGhFeHAsIG1NYXNrSGVpZ2h0RXhwKTsKKworICAgICAgICBpZiAobUxvZ1ZlcmJvc2UpIHsKKyAgICAgICAgICAgIExvZy52KFRBRywgIk1hc2sgZnJhbWVzIHNpemUgIiArIG1hc2tXaWR0aCArICIgeCAiICsgbWFza0hlaWdodCk7CisgICAgICAgICAgICBMb2cudihUQUcsICJQeXJhbWlkIGxldmVscyAiICsgd2lkdGhFeHAgKyAiIHggIiArIGhlaWdodEV4cCk7CisgICAgICAgICAgICBMb2cudihUQUcsICJNZW1vcnkgZnJhbWVzIHNpemUgIiArIG1lbVdpZHRoICsgIiB4ICIgKyBtZW1IZWlnaHQpOworICAgICAgICB9CisKKyAgICAgICAgbUF2ZXJhZ2VGb3JtYXQgPSBpbnB1dEZvcm1hdC5tdXRhYmxlQ29weSgpOworICAgICAgICBtQXZlcmFnZUZvcm1hdC5zZXREaW1lbnNpb25zKDEsMSk7CisgICAgICAgIHJldHVybiB0cnVlOworICAgIH0KKworICAgIHB1YmxpYyB2b2lkIHByZXBhcmUoRmlsdGVyQ29udGV4dCBjb250ZXh0KXsKKyAgICAgICAgaWYgKG1Mb2dWZXJib3NlKSBMb2cudihUQUcsICJQcmVwYXJpbmcgQmFja0Ryb3BwZXJGaWx0ZXIhIik7CisKKyAgIC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isKKyAgICAgICAgbUJnSW5wdXQuZ2VuZXJhdGVNaXBNYXAoKTsKKyAgICAgICAgbUJnSW5wdXQuc2V0VGV4dHVyZVBhcmFtZXRlcihHTEVTMjAuR0xfVEVYVFVSRV9NSU5fRklMVEVSLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEdMRVMyMC5HTF9MSU5FQVJfTUlQTUFQX05FQVJFU1QpOworCisgICAgICAgIC8vIFByb2Nlc3Mgc2hhZGVycworICAgICAgICBGcmFtZVtdIGRpc3RJbnB1dHMgPSB7IG1WaWRlb0lucHV0LCBtQmdNZWFuW2lucHV0SW5kZXhdLCBtQmdWYXJpYW5jZVtpbnB1dEluZGV4XSB9OworICAgICAgICBtQmdEaXN0UHJvZ3JhbS5wcm9jZXNzKGRpc3RJbnB1dHMsIG1EaXN0YW5jZSk7CisgICAgICAgIG1EaXN0YW5jZS5nZW5lcmF0ZU1pcE1hcCgpOworICAgICAgICBtRGlzdGFuY2Uuc2V0VGV4dHVyZVBhcmFtZXRlcihHTEVTMjAuR0xfVEVYVFVSRV9NSU5fRklMVEVSLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBHTEVTMjAuR0xfTElORUFSX01JUE1BUF9ORUFSRVNUKTsKKworICAgICAgICBtQmdNYXNrUHJvZ3JhbS5wcm9jZXNzKG1EaXN0YW5jZSwgbU1hc2spOworICAgICAgICBtTWFzay5nZW5lcmF0ZU1pcE1hcCgpOworICAgICAgICBtTWFzay5zZXRUZXh0dXJlUGFyYW1ldGVyKEdMRVMyMC5HTF9URVhUVVJFX01JTl9GSUxURVIsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgR0xFUzIwLkdMX0xJTkVBUl9NSVBNQVBfTkVBUkVTVCk7CisKKyAgICAgICAgRnJhbWVbXSBhdXRvV0JJbnB1dHMgPSB7IG1WaWRlb0lucHV0LCBtQmdJbnB1dCB9OworICAgICAgICBtQXV0b21hdGljV2hpdGVCYWxhb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1NYXNrQXZlcmFnZUJ5dGVCdWZmZXIgPSBtTWFza0F2ZXJhZ2UuZ2V0RGF0YSgpOworICAgICAgICAgICAgICAgIGJ5dGVbXSBtYXNrX2F2ZXJhZ2UgPSBtTWFza0F2ZXJhZ2VCeXRlQnVmZmVyLmFycmF5KCk7CisgICAgICAgICAgICAgICAgaW50IGJpID0gKGludCkobWFza19hdmVyYWdlWzNdICYgMHhGRik7CisgICAgICAgICAgICAgICAgaWYgKG1Mb2dWZXJib3NlKSBMb2cudihUQUcsIFN0cmluZy5mb3JtYXQoIk1hc2tfYXZlcmFnZSBpcyAlZCIsIGJpKSk7CisKKyAgICAgICAgICAgICAgICBpZiAoYmkgPj0gREVGQVVMVF9MRUFSTklOR19ET05FX1RIUkVTSE9MRCkgeworICAgICAgICAgICAgICAgICAgICBtU3RhcnRMZWFybmluZyA9IHRydWU7ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyBSZXN0YXJ0IGxlYXJuaW5nCisgICAgICAgICAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgICAgICAgIGlmIChtTG9nVmVyYm9zZSkgTG9nLnYoVEFHLCAiTGVhcm5pbmcgZG9uZSIpOworICAgICAgICAgICAgICAgICAgaWYgKG1MZWFybmluZ0RvbmVMaXN0ZW5lciAhPSBudWxsKSB7CisgICAgICAgICAgICAgICAgICAgICAgbUxlYXJuaW5nRG9uZUxpc3RlbmVyLm9uTGVhcm5pbmdEb25lKHRoaXMpOworICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9CisgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICBGcmFtZSBvdXRwdXQgPSBjb250ZXh0LmdldEZyYW1lTWFuYWdlcigpLm5ld0ZyYW1lKHZpZGVvLmdldEZvcm1hdCgpKTsKKyAgICAgICAgICAgIEZyYW1lW10gc3VidHJhY3RJbnB1dHMgPSB7IHZpZGVvLCBiYWNrZ3JvdW5kLCBtTWFzaywgbUF1dG9XQiB9OworICAgICAgICAgICAgbUJnU3VidHJhY3RQcm9ncmFtLnByb2Nlc3Moc3VidHJhY3RJbnB1dHMsIG91dHB1dCk7CisgICAgICAgICAgICBwdXNoT3V0cHV0KCJ2aWRlbyIsIG91dHB1dCk7CisgICAgICAgICAgICBvdXRwdXQucmVsZWFzZSgpOworICAgICAgICB9CisKKyAgICAgICAgLy8gQ29tcHV0ZSBtZWFuIGFuZCB2YXJpYW5jZSBvZiB0aGUgYmFja2dyb3VuZAorICAgICAgICBpZiAobUZyYW1lQ291bnQgPCBtTGVhcm5pbmdEdXJhdGlvbiAtIG1MZWFybmluZ1ZlcmlmeUR1cmF0aW9uIHx8CisgICAgICAgICAgICBtQWRhcHRSYXRlQmcgPiAwLjAgfHwgbUFkYXB0UmF0ZUZnID4gMC4wKSB7CisgICAgICAgICAgICBGcmFtZVtdIG1lYW5VcGRhdGVJbnB1dHMgPSB7IG1WaWRlb0lucHV0LCBtQmdNZWFuW2lucHV0SW5kZXhdLCBtTWFzayB9OworICAgICAgICAgICAgbUJnVXBkYXRlTWVhblByb2dyYW0ucHJvY2VzcyhtZWFuVXBkYXRlSW5wdXRzLCBtQmdNZWFuW291dHB1dEluZGV4XSk7CisgICAgICAgICAgICBtQmdNZWFuW291dHB1dEluZGV4XS5nZW5lcmF0ZU1pcE1hcCgpOworICAgICAgICAgICAgbUJnTWVhbltvdXRwdXRJbmRleF0uc2V0VGV4dHVyZVBhcmFtZXRlcihHTEVTMjAuR0xfVEVYVFVSRV9NSU5fRklMVEVSLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBHTEVTMjAuR0xfTElORUFSX01JUE1BUF9ORUFSRVNUKTsKKworICAgICAgICAgICAgRnJhbWVbXSB2YXJpYW5jZVVwZGF0ZUlucHV0cyA9IHsKKyAgICAgICAgICAgICAgbVZpZGVvSW5wdXQsIG1CZ01lYW5baW5wdXRJbmRleF0sIG1CZ1ZhcmlhbmNlW2lucHV0SW5kZXhdLCBtTWFzaworICAgICAgICAgICAgfTsKKyAgICAgICAgICAgIG1CZ1VwZGF0ZVZhcmlhbmNlUHJvZ3JhbS5wcm9jZXNzKHZhcmlhbmNlVXBkYXRlSW5wdXRzLCBtQmdWYXJpYW5jZVtvdXRwdXRJbmRleF0pOworICAgICAgICAgICAgbUJnVmFyaWFuY2Vbb3V0cHV0SW5kZXhdLmdlbmVyYXRlTWlwTWFwKCk7CisgICAgICAgICAgICBtQmdWYXJpYW5jZVtvdXRwdXRJbmRleF0uc2V0VGV4dHVyZVBhcmFtZXRlcihHTEVTMjAuR0xfVEVYVFVSRV9NSU5fRklMVEVSLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgR0xFUzIwLkdMX0xJTkVBUl9NSVBNQVBfTkVBUkVTVCk7CisgICAgICAgIH0KKworICAgICAgICAvLyBQcm92aWRlIGRlYnVnIG91dHB1dCB0byB0d28gc21hbGxlciB2aWV3ZXJzCisgICAgICAgIGlmIChtUHJvdmlkZURlYnVnT3V0cHV0cykgeworICAgICAgICAgICAgRnJhbWUgZGJnMSA9IGNvbnRleHQuZ2V0RnJhbWVNYW5hZ2VyKCkubmV3RnJhbWUodmlkZW8uZ2V0Rm9ybWF0KCkpOworICAgICAgICAgICAgbUNvcHlPdXRQcm9ncmFtLnByb2Nlc3ModmlkZW8sIGRiZzEpOworICAgICAgICAgICAgcHVzaE91dHB1dCgiZGVidWcxIiwgZGJnMSk7CisgICAgICAgICAgICBkYmcxLnJlbGVhc2UoKTsKKworICAgICAgICAgICAgRnJhbWUgZGJnMiA9IGNvbnRleHQuZ2V0RnJhbWVNYW5hZ2VyKCkubmV3RnJhbWUobU1lbW9yeUZvcm1hdCk7CisgICAgICAgICAgICBtQ29weU91dFByb2dyYW0ucHJvY2VzcyhtTWFzaywgZGJnMik7CisgICAgICAgICAgICBwdXNoT3V0cHV0KCJkZWJ1ZzIiLCBkYmcyKTsKKyAgICAgICAgICAgIGRiZzIucmVsZWFzZSgpOworICAgICAgICB9CisKKyAgICAgICAgbUZyYW1lQ291bnQrKzsKKworICAgICAgICBpZiAobUxvZ1ZlcmJvc2UpIHsKKyAgICAgICAgICAgIGlmIChtRnJhbWVDb3VudCAlIDMwID09IDApIHsKKyAgICAgICAgICAgICAgICBpZiAoc3RhcnRUaW1lID09IC0xKSB7CisgICAgICAgICAgICAgICAgICAgIGNvbnRleHQuZ2V0R0xFbnZpcm9ubWVudCgpLmFjdGl2YXRlKCk7CisgICAgICAgICAgICAgICAgICAgIEdMRVMyMC5nbEZpbmlzaCgpOworICAgICAgICAgICAgICAgICAgICBzdGFydFRpbWUgPSBTeXN0ZW1DbG9jay5lbGFwc2VkUmVhbHRpbWUoKTsKKyAgICAgICAgICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgICAgICAgICBjb250ZXh0LmdldEdMRW52aXJvbm1lbnQoKS5hY3RpdmF0ZSgpOworICAgICAgICAgICAgICAgICAgICBHTEVTMjAuZ2xGaW5pc2goKTsKKyAgICAgICAgICAgICAgICAgICAgbG9uZyBlbmRUaW1lID0gU3lzdGVtQ2xvY2suZWxhcHNlZFJlYWx0aW1lKCk7CisgICAgICAgICAgICAgICAgICAgIExvZy52KFRBRywgIkF2Zy4gZnJhbWUgZHVyYXRpb246ICIgKyBTdHJpbmcuZm9ybWF0KCIlLjJmIiwoZW5kVGltZS1zdGFydFRpbWUpLzMwLikgKworICAgICAgICAgICAgICAgICAgICAgICAgICAiIG1zLiBBdmcuIGZwczogIiArIFN0cmluZy5mb3JtYXQoIiUuMmYiLCAxMDAwLi8oKGVuZFRpbWUtc3RhcnRUaW1lKS8zMC4pKSApOworICAgICAgICAgICAgICAgICAgICBzdGFydFRpbWUgPSBlbmRUaW1lOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgIH0KKworICAgIHByaXZhdGUgbG9uZyBzdGFydFRpbWUgPSAtMTsKKworICAgIHB1YmxpYyB2b2lkIGNsb3NlKEZpbHRlckNvbnRleHQgY29udGV4dCkgeworICAgICAgICBpZiAobU1lbW9yeUZvcm1hdCA9PSBudWxsKSB7CisgICAgICAgICAgICByZXR1cm47CisgICAgICAgIH0KKworICAgICAgICBpZiAobUxvZ1ZlcmJvc2UpIExvZy52KFRBRywgIkZpbHRlciBDbG9zaW5nISIpOworICAgICAgICBmb3IgKGludCBpID0gMDsgaSA8IDI7IGkrKykgeworICAgICAgICAgICAgbUJnTWVhbltpXS5yZWxlYXNlKCk7CisgICAgICAgICAgICBtQmdWYXJpYW5jZVtpXS5yZWxlYXNlKCk7CisgICAgICAgICAgICBtTWFza1ZlcmlmeVtpXS5yZWxlYXNlKCk7CisgICAgICAgIH0KKyAgICAgICAgbURpc3RhbmNlLnJlbGVhc2UoKTsKKyAgICAgICAgbU1hc2sucmVsZWFzZSgpOworICAgICAgICBtQXV0b1dCLnJlbGVhc2UoKTsKKyAgICAgICAgbVZpZGVvSW5wdXQucmVsZWFzZSgpOworICAgICAgICBtQmdJbnB1dC5yZWxlYXNlKCk7CisgICAgICAgIG1NYXNrQXZlcmFnZS5yZWxlYXNlKCk7CisKKyAgICAgICAgbU1lbW9yeUZvcm1hdCA9IG51bGw7CisgICAgfQorCisgICAgLy8gUmVsZWFybiBiYWNrZ3JvdW5kIG1vZGVsCisgICAgc3luY2hyb25pemVkIHB1YmxpYyB2b2lkIHJlbGVhcm4oKSB7CisgICAgICAgIC8vIExldCB0aGUgcHJvY2Vzc2luZyB0aHJlYWQga25vdyBhYm91dCBsZWFybmluZyByZXN0YXJ0CisgICAgICAgIG1TdGFydExlYXJuaW5nID0gdHJ1ZTsKKyAgICB9CisKKyAgICBAT3ZlcnJpZGUKKyAgICBwdWJsaWMgdm9pZCBmaWVsZFBvcnRWYWx1ZVVwZGF0ZWQoU3RyaW5nIG5hbWUsIEZpbHRlckNvbnRleHQgY29udGV4dCkgeworICAgICAgICAvLyBUT0RPOiBNYW55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gICAgICAgZmxvYXQgY3VycmVudFJlbGF0aXZlQXNwZWN0ID0gZm9yZWdyb3VuZEFzcGVjdC9iYWNrZ3JvdW5kQXNwZWN0OworICAgICAgICBpZiAoY3VycmVudFJlbGF0aXZlQXNwZWN0ICE9IG1SZWxhdGl2ZUFzcGVjdCB8fCBmaXRNb2RlQ2hhbmdlZCkgeworICAgICAgICAgICAgbVJlbGF0aXZlQXNwZWN0ID0gY3VycmVudFJlbGF0aXZlQXNwZWN0OworICAgICAgICAgICAgZmxvYXQgeE1pbiA9IDAuZiwgeFdpZHRoID0gMS5mLCB5TWluID0gMC5mLCB5V2lkdGggPSAxLmY7CisgICAgICAgICAgICBzd2l0Y2ggKG1CYWNrZ3JvdW5kRml0TW9kZSkgeworICAgICAgICAgICAgICAgIGNhc2UgQkFDS0dST1VORF9TVFJFVENIOgorICAgICAgICAgICAgICAgICAgICAvLyBKdXN0IG1hcCAxOjEKKyAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgY2FzZSBCQUNLR1JPVU5EX0ZJVDoKKyAgICAgICAgICAgICAgICAgICAgaWYgKG1SZWxhdGl2ZUFzcGVjdCA+IDEuMGYpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIC8vIEZvcmVncm91bmQgaXMgd2lkZXIgdGhhbiBiYWNrZ3JvdW5kLCBzY2FsZSBkb3duCisgICAgICAgICAgICAgICAgICAgICAgICAvLyBiYWNrZ3JvdW5kIGluIFgKKyAgICAgICAgICAgICAgICAgICAgICAgIHhNaW4gPSAwLjVmIC0gMC41ZiAqIG1SZWxhdGl2ZUFzcGVjdDsKKyAgICAgICAgICAgICAgICAgICAgICAgIHhXaWR0aCA9IDEuZiAqIG1SZWxhdGl2ZUFzcGVjdDsKKyAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIC8vIEZvcmVncm91bmQgaXMgdGFsbGVyIHRoYW4gYmFja2dyb3VuZCwgc2NhbGUgZG93bgorICAgICAgICAgICAgICAgICAgICAgICAgLy8gYmFja2dyb3VuZCBpbiBZCisgICAgICAgICAgICAgICAgICAgICAgICB5TWluID0gMC41ZiAtIDAuNWYgLyBtUmVsYXRpdmVBc3BlY3Q7CisgICAgICAgICAgICAgICAgICAgICAgICB5V2lkdGggPSAxIC8gbVJlbGF0aXZlQXNwZWN0OworICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgIGNhc2UgQkFDS0dST1VORF9GSUxMX0NST1A6CisgICAgICAgICAgICAgICAgICAgIGlmIChtUmVsYXRpdmVBc3BlY3QgPiAxLjBmKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAvLyBGb3JlZ3JvdW5kIGlzIHdpZGVyIHRoYW4gYmFja2dyb3VuZCwgY3JvcAorICAgICAgICAgICAgICAgICAgICAgICAgLy8gYmFja2dyb3VuZCBpbiBZCisgICAgICAgICAgICAgICAgICAgICAgICB5TWluID0gMC41ZiAtIDAuNWYgLyBtUmVsYXRpdmVBc3BlY3Q7CisgICAgICAgICAgICAgICAgICAgICAgICB5V2lkdGggPSAxLmYgLyBtUmVsYXRpdmVBc3BlY3Q7CisgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICAgICAgICAgICAgICAvLyBGb3JlZ3JvdW5kIGlzIHRhbGxlciB0aGFuIGJhY2tncm91bmQsIGNyb3AKKyAgICAgICAgICAgICAgICAgICAgICAgIC8vIGJhY2tncm91bmQgaW4gWAorICAgICAgICAgICAgICAgICAgICAgICAgeE1pbiA9IDAuNWYgLSAwLjVmICogbVJlbGF0aXZlQXNwZWN0OworICAgICAgICAgICAgICAgICAgICAgICAgeFdpZHRoID0gbVJlbGF0aXZlQXNwZWN0OworICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgfQorICAgICAgICAgICAgLy8gSWYgbWlycm9yaW5nIGlzIHJlcXVpcmVkIChmb3IgZXguIHRoZSBjYW1lcmEgbWlycm9ycyB0aGUgcHJldmlldworICAgICAgICAgICAgLy8gaW4gdGhlIGZyb250IGNhbWVyYSkKKyAgICAgICAgICAgIC8vIFRPRE86IEJhY2tkcm9wcGVyIGRvZXMgbm90IGF0dGVtcHQgdG8gYXBwbHkgYW55IG90aGVyIHRyYW5zZm9ybWF0aW9uCisgICAgICAgICAgICAvLyB0aGFuIGp1c3QgZmxpcHBpbmcuIEhvd2V2ZXIsIGluIHRoZSBjdXJyZW50IHN0YXRlLCBpdCdzICJ4LWF4aXMiIGlzIGFsd2F5cyBhbGlnbmVkCisgICAgICAgICAgICAvLyB3aXRoIHRoZSBDYW1lcmEncyB3aWR0aC4gSGVuY2UsIHdlIG5lZWQgdG8gZGVmaW5lIHRoZSBtaXJyb3JpbmcgYmFzZWQgb24gdGhlIGNhbWVyYQorICAgICAgICAgICAgLy8gb3JpZW50YXRpb24uIEluIHRoZSBmdXR1cmUsIGEgY2xlYW5lciBkZXNpZ24gd291bGQgYmUgdG8gY2FzdCBhd2F5IGFsbCB0aGUgcm90YXRpb24KKyAgICAgICAgICAgIC8vIGluIGEgc2VwYXJhdGUgcGxhY2UuCisgICAgICAgICAgICBpZiAobU1pcnJvckJnKSB7CisgICAgICAgICAgICAgICAgaWYgKG1Mb2dWZXJib3NlKSBMb2cudihUQUcsICJNaXJyb3JpbmcgdGhlIGJhY2tncm91bmQhIik7CisgICAgICAgICAgICAgICAgLy8gTWlycm9yaW5nIGluIHBvcnRyYWl0CisgICAgICAgICAgICAgICAgaWYgKG1PcmllbnRhdGlvbiA9PSAwIHx8IG1PcmllbnRhdGlvbiA9PSAxODApIHsKKyAgICAgICAgICAgICAgICAgICAgeFdpZHRoID0gLXhXaWR0aDsKKyAgICAgICAgICAgICAgICAgICAgeE1pbiA9IDEuMGYgLSB4TWluOworICAgICAgICAgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICAgICAgICAgIC8vIE1pcnJvcmluZyBpbiBsYW5kc2NhcGUKKyAgICAgICAgICAgICAgICAgICAgeVdpZHRoID0gLXlXaWR0aDsKKyAgICAgICAgICAgICAgICAgICAgeU1pbiA9IDEuMGYgLSB5TWluOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGlmIChtTG9nVmVyYm9zZSkgTG9nLnYoVEFHLCAiYmdUcmFuc2Zvcm06IHhNaW4sIHlNaW4sIHhXaWR0aCwgeVdpZHRoIDogIiArCisgICAgICAgICAgICAgICAgICAgIHhNaW4gKyAiLCAiICsgeU1pbiArICIsICIgKyB4V2lkdGggKyAiLCAiICsgeVdpZHRoICsKKyAgICAgICAgICAgICAgICAgICAgIiwgbVJlbEFzcFJhdGlvID0gIiArIG1SZWxhdGl2ZUFzcGVjdCk7CisgICAgICAgICAgICAvLyBUaGUgZm9sbG93aW5nIG1hdHJpeCBpcyB0aGUgdHJhbnNwb3NlIG9mIHRoZSBhY3R1YWwgbWF0cml4CisgICAgICAgICAgICBmbG9hdFtdIGJnVHJhbnNmb3JtID0ge3hXaWR0aCwgMC5mLCAwLmYsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDAuZiwgeVdpZHRoLCAwLmYsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHhNaW4sIHlNaW4sICAxLmZ9OworICAgICAgICAgICAgbUJnU3VidHJhY3RQcm9ncmFtLnNldEhvc3RWYWx1ZSgiYmdfZml0X3RyYW5zZm9ybSIsIGJnVHJhbnNmb3JtKTsKKyAgICAgICAgfQorICAgIH0KKworICAgIHByaXZhdGUgaW50IHB5cmFtaWRMZXZlbChpbnQgc2l6ZSkgeworICAgICAgICByZXR1cm4gKGludClNYXRoLmZsb29yKE1hdGgubG9nMTAoc2l6ZSkgLyBNYXRoLmxvZzEwKDIpKSAtIDE7CisgICAgfQorCit9CmRpZmYgLS1naXQgYS9tZWRpYS9tY2EvZmlsdGVycGFja3MvamF2YS9h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bnRleHQgY29udGV4dCkgeworICAgICAgICBpZiAobUxvZ1ZlcmJvc2UpIExvZy52KFRBRywgIlBvcnQgIiArIG5hbWUgKyAiIGhhcyBiZWVuIHVwZGF0ZWQiKTsKKyAgICAgICAgaWYgKG5hbWUuZXF1YWxzKCJyZWNvcmRpbmciKSkgcmV0dXJuOworICAgICAgICBpZiAobmFtZS5lcXVhbHMoImlucHV0UmVnaW9uIikpIHsKKyAgICAgICAgICAgIGlmIChpc09wZW4oKSkgdXBkYXRlU291cmNlUmVnaW9uKCk7CisgICAgICAgICAgICByZXR1cm47CisgICAgICAgIH0KKyAgICAgICAgLy8gVE9ETzogTm90IHN1cmUgaWYgaXQgaXMgcG9zc2libGUgdG8gdXBkYXRlIHRoZSBtYXhGaWxlU2l6ZQorICAgICAgICAvLyB3aGVuIHRoZSByZWNvcmRpbmcgaXMgZ29pbmcgb24uIEZvciBub3csIG5vdCBkb2luZyB0aGF0LgorICAgICAgICBpZiAoaXNPcGVuKCkgJiYgbVJlY29yZGluZ0FjdGl2ZSkgeworICAgICAgICAgICAgdGhyb3cgbmV3IFJ1bnRpbWVFeGNlcHRpb24oIkNhbm5vdCBjaGFuZ2UgcmVjb3JkaW5nIHBhcmFtZXRlcnMiCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICArICIgd2hlbiB0aGUgZmlsdGVyIGlzIHJlY29yZGluZyEiKTsKKyAgICAgICAgfQorICAgIH0KKworICAgIHByaXZhdGUgdm9pZCB1cGRhdGVTb3VyY2VSZWdpb24oKSB7CisgICAgICAgIC8vIEZsaXAgc291cmNlIHF1YWQgdG8gbWFwIHRvIE9wZW5HTCBvcmlnaW4KKyAgICAgICAgUXVhZCBmbGlwcGVkUmVnaW9uID0gbmV3IFF1YWQoKTsKKyAgICAgICAgZmxpcHBlZFJlZ2lvbi5wMCA9IG1Tb3VyY2VSZWdpb24ucDI7CisgICAgICAgIGZsaXBwZWRSZWdpb24ucDEgPSBtU291cmNlUmVnaW9uL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ZWNvcmRlci5zZXRPdXRwdXRGb3JtYXQobU91dHB1dEZvcm1hdCk7CisgICAgICAgICAgICBtTWVkaWFSZWNvcmRlci5zZXRWaWRlb0VuY29kZXIobVZpZGVvRW5jb2Rlcik7CisgICAgICAgICAgICBtTWVkaWFSZWNvcmRlci5zZXRWaWRlb1NpemUobVdpZHRoLCBtSGVpZ2h0KTsKKyAgICAgICAgICAgIG1NZWRpYVJlY29yZGVyLnNldFZpZGVvRnJhbWVSYXRlKG1GcHMpOworICAgICAgICB9CisgICAgICAgIG1NZWRpYVJlY29yZGVyLnNldE9yaWVudGF0aW9uSGludChtT3JpZW50YXRpb25IaW50KTsKKyAgICAgICAgbU1lZGlhUmVjb3JkZXIuc2V0T25JbmZvTGlzdGVuZXIobUluZm9MaXN0ZW5lcik7CisgICAgICAgIG1NZWRpYVJlY29yZGVyLnNldE9uRXJyb3JMaXN0ZW5lcihtRXJyb3JMaXN0ZW5lcik7CisgICAgICAgIGlmIChtRmQgIT0gbnVsbCkgeworICAgICAgICAgICAgbU1lZGlhUmVjb3JkZXIuc2V0T3V0cHV0RmlsZShtRmQpOworICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgbU1lZGlhUmVjb3JkZXIuc2V0T3V0cHV0RmlsZShtT3V0cHV0RmlsZSk7CisgICAgICAgIH0KKyAgICAgICAgdHJ5IHsKKyAgICAgICAgICAgIG1NZWRpYVJlY29yZGVyLnNldE1heEZpbGVTaXplKG1NYXhGaWxlU2l6ZSk7CisgICAgICAgIH0gY2F0Y2ggKEV4Y2VwdGlvbiBlKSB7CisgICAgICAgICAgICAvLyBGb2xsb3dpbmcgdGhlIGxvZ2ljIGluICBWaWRlb0NhbWVyYS5qYXZhIChpbiBDYW1lcmEgYXBwKQorICAgICAgICAgICAgLy8gV2UgYXJlIGdvaW5nIHRvIGlnbm9yZSBmYWlsdXJlIG9mIHNldE1heEZpbGVTaXplIGhlcmUsIGFzCisgICAgICAgICAgICAvLyBhKSBUaGUgY29tcG9zZ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AgICAgICAgaWYgKG1Mb2dWZXJib3NlKSBMb2cudihUQUcsICJTdGFydGluZyByZWNvcmRpbmciKTsKKworICAgICAgICAvLyBDcmVhdGUgYSBmcmFtZSByZXByZXNlbnRpbmcgdGhlIHNjcmVlbgorICAgICAgICBNdXRhYmxlRnJhbWVGb3JtYXQgc2NyZWVuRm9ybWF0ID0gbmV3IE11dGFibGVGcmFtZUZvcm1hdCgKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEZyYW1lRm9ybWF0LlRZUEVfQllURSwgRnJhbWVGb3JtYXQuVEFSR0VUX0dQVSk7CisgICAgICAgIHNjcmVlbkZvcm1hdC5zZXRCeXRlc1BlclNhbXBsZSg0KTsKKworICAgICAgICBpbnQgd2lkdGgsIGhlaWdodDsKKyAgICAgICAgaWYgKG1Qcm9maWxlICE9IG51bGwpIHsKKyAgICAgICAgICAgIHdpZHRoID0gbVByb2ZpbGUudmlkZW9GcmFtZVdpZHRoOworICAgICAgICAgICAgaGVpZ2h0ID0gbVByb2ZpbGUudmlkZW9GcmFtZUhlaWdodDsKKyAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgIHdpZHRoID0gbVdpZHRoOworICAgICAgICAgICAgaGVpZ2h0ID0gbUhlaWdodDsKKyAgICAgICAgfQorICAgICAgICBzY3JlZW5Gb3JtYXQuc2V0RGltZW5zaW9ucyh3aWR0aCwgaGVpZ2h0KTsKKyAgICAgICAgbVNjcmVlbiA9IChHTEZyYW1lKWNvbnRleHQuZ2V0RnJhbWVNYW5hZ2VyKCkubmV3Qm91bmRGcmFtZSgKKyAgICAgICAgICAgICAgICAgICAgICAgICAgIHNjcmVlbkZvcm1hdCwgR0xGcmFtZS5FWElTVElOR19GQk9fQklORElORywgMCk7CisKKyAgICAgICAgLy8gSW5pdGlhbGl6ZSB0aGUgbWVkaWEgcmVjb3JkZXIKKworICAgICAgICBtTWVkaWFSZWNvcmRlciA9IG5ldyBNZWRpYVJlY29yZGVyKCk7CisgICAgICAgI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3NlKSBMb2cudihUQUcsICJ0aW1lbGFwc2U6IGVuY29kaW5nIGZyYW1lLCBUaW1lc3RhbXAgdCA9ICIgKyB0aW1lc3RhbXBOcyArCisgICAgICAgICAgICAgICAgICAgICIsIGxhc3QgcmVhbCB0PSAiICsgbUxhc3RUaW1lTGFwc2VGcmFtZVJlYWxUaW1lc3RhbXBOcyArCisgICAgICAgICAgICAgICAgICAgICIsIGludGVydmFsID0gIiArIG1UaW1lQmV0d2VlblRpbWVMYXBzZUZyYW1lQ2FwdHVyZVVzKTsKKyAgICAgICAgICAgIG1MYXN0VGltZUxhcHNlRnJhbWVSZWFsVGltZXN0YW1wTnMgPSB0aW1lc3RhbXBOczsKKyAgICAgICAgICAgIG1UaW1lc3RhbXBOcyA9IG1UaW1lc3RhbXBOcyArICgxMDAwMDAwMDAwTCAvIChsb25nKW1GcHMpOworICAgICAgICAgICAgaWYgKG1Mb2dWZXJib3NlKSBMb2cudihUQUcsICJ0aW1lbGFwc2U6IGVuY29kaW5nIGZyYW1lLCBzZXR0aW5nIHQgPSAiCisgICAgICAgICAgICAgICAgICAgICsgbVRpbWVzdGFtcE5zICsgIiwgZGVsdGEgdCA9ICIgKyAoMTAwMDAwMDAwMEwgLyAobG9uZyltRnBzKSArCisgICAgICAgICAgICAgICAgICAgICIsIGZwcyA9ICIgKyBtRnBzICk7CisgICAgICAgICAgICByZXR1cm4gZmFsc2U7CisgICAgICAgIH0KKyAgICB9CisKKyAgICBAT3ZlcnJpZGUKKyAgICBwdWJsaWMgdm9pZCBwcm9jZXNzKEZpbHRlckNvbnRleHQgY29udGV4dCkgeworICAgICAgICBpZiAobUxvZ1ZlcmJvc2UpIExvZy52KFRBRywgIlN0YXJ0aW5nIGZyYW1lIHByb2Nlc3NpbmciKTsKKworICAgICAgICBHTEVudmlyb25tZW50IGdsRW52ID0gY29udGV4dC5nZXRHTEVudmlyb25tZW50KCk7CisgICAgICAgIC8vIEdldCBpbnB1dCBmcmFtZQorICAgICAgICBGcmFtZSBpbnB1dCA9IHB1bGxJbnB1dCgidmlkZW9mcmFtZSIpOworCisgICAgICAgIC8vIENoZWNrIGlmIHJlY29yZGluZyBuZWVkcyB0byBzdGFydAorICAgICAgICBpZiAoIW1SZWNvcmRpbmdBY3RpdmUgJiYgbVJlY29yZGluZykgeworICAgICAgICAgICAgc3RhcnRSZWNvcmRpbmcoY29udGV4dCk7CisgICAgICAgIH0KKyAgICAgICAgLy8gQ2hlY2sgaWYgcmVjb3JkaW5nIG5lZWRzIHRvIHN0b3AKKyAgICAgICAgaWYgKG1SZWNvcmRpbmdBY3RpdmUgJiYgIW1SZWNvcmRpbmcpIHsKKyAgICAgICAgICAgIHN0b3BSZWNvcmRpbmcoY29udGV4dCk7CisgICAgICAgIH0KKworICAgICAgICBpZiAoIW1SZWNvcmRpbmdBY3RpdmUpIHJldHVybjsKKworICAgICAgICBpZiAobUNhcHR1cmVUaW1lTGFwc2UpIHsKKyAgICAgICAgICAgIGlmIChza2lwRnJhbWVBbmRNb2RpZnlUaW1lc3RhbXAoaW5wdXQuZ2V0VGltZXN0YW1wKCkpKSB7CisgICAgICAgICAgICAgICAgcmV0dXJuOworICAgICAgICAgICAgfQorICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgbVRpbWVzdGFtcE5zID0gaW5wdXQuZ2V0VGltZXN0YW1wKCk7CisgICAgICAgIH0KKworICAgICAgICAvLyBBY3RpdmF0ZSBvdXIgc3VyZmFjZQorICAgICAgICBnbEVudi5hY3RpdmF0ZVN1cmZhY2VXaXRoSWQobVN1cmZhY2VJZCk7CisKKyAgICAgICAgLy8gUHJvY2VzcworICAgICAgICBtUHJvZ3JhbS5wcm9jZXNzKGlucHV0LCBtU2NyZWVuKTsKKworICAgICAgICAvLyBTZXQgdGltZXN0YW1wIGZyb20gaW5wdXQKKyAgICAgICAgZ2xFbnYuc2V0U3VyZmFjZVRpbWVzdGFtcChtVGltZXN0YW1wTnMpOworICAgICAgICAvLyBBbmQgc3dhcCBidWZmZXJzC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ybSA9IG5ldyBmbG9hdFsxNl07CisgICAgICAgIG1NYXBwZWRDb29yZHMgPSBuZXcgZmxvYXRbMTZdOworCisgICAgICAgIG1Mb2dWZXJib3NlID0gTG9nLmlzTG9nZ2FibGUoVEFHLCBMb2cuVkVSQk9TRSk7CisgICAgfQorCisgICAgQE92ZXJyaWRlCisgICAgcHVibGljIHZvaWQgc2V0dXBQb3J0cygpIHsKKyAgICAgICAgLy8gQWRkIGlucHV0IHBvcnQKKyAgICAgICAgYWRkT3V0cHV0UG9ydCgidmlkZW8iLCBJbWFnZUZvcm1hdC5jcmVhdGUoSW1hZ2VGb3JtYXQuQ09MT1JTUEFDRV9SR0JBLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBGcmFtZUZvcm1hdC5UQVJHRVRfR1BVKSk7CisgICAgfQorCisgICAgcHJpdmF0ZSB2b2lkIGNyZWF0ZUZvcm1hdHMoKSB7CisgICAgICAgIG1PdXRwdXRGb3JtYXQgPSBJbWFnZUZvcm1hdC5jcmVhdGUobVdpZHRoLCBtSGVpZ2h0LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEltYWdlRm9ybWF0LkNPTE9SU1BBQ0VfUkdCQSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBGcmFtZUZvcm1hdC5UQVJHRVRfR1BVKTsKKyAgICB9CisKKyAgICBAT3ZlcnJpZGUKKyAgICBwdWJsaWMgdm9pZCBwcmVwYXJlKEZpbHRlckNvbnRleHQgY29udGV4dCkgeworICAgICAgICBpZiAobUxvZ1ZlcmJvc2UpIExvZy52KFRBRywgIlByZXBhcmluZyIpOworICAgICAgICAvLyBDb21waWxlIHNoYWRlciBUT0RPOiBNb3ZlIHRvIG9uR0xFbnZTb21ldGhpbmc/CisgICAgICAgIG1GcmFtZUV4dHJhY3RvciA9IG5ldyBTaGFkZXJQcm9ncmFtKGNvbnRleHQsIG1GcmFtZVNoYWRlcik7CisgICAgfQorCisgICAgQE92ZXJyaWRlCisgICAgcHVibGljIHZvaWQgb3BlbihGaWx0ZXJDb250ZXh0IGNvbnRleHQpIHsKKyAgICAgICAgaWYgKG1Mb2dWZXJib3NlKSBMb2cudihUQUcsICJPcGVuaW5nIik7CisgICAgICAgIC8vIE9wZW4gY2FtZXJhCisgICAgICAgIG1DYW1lcmEgPSBDYW1lcmEub3BlbihtQ2FtZXJhSWQpOworCisgICAgICAgIC8vIFNldCBwYXJhbWV0ZXJzCisgICAgICAgIGdldENhbWVyYVBhcmFtZXRlcnMoKTsKKyAgICAgICAgbUNhbWVyYS5zZXRQYXJhbWV0ZXJzKG1DYW1lcmFQYXJhbWV0ZXJzKTsKKworICAgICAgICAvLyBDcmVhdGUgZnJhbWUgZm9ybWF0cworICAgICAgICBjcmVhdGVGb3JtYXRzKCk7CisKKyAgICAgICAgLy8gQmluZCBpdCB0byBvdXIgY2FtZXJhIGZyYW1lCisgICAgICAgIG1DYW1lcmFGcmFtZSA9IChHTEZyYW1lKWNvbnRleHQuZ2V0RnJhbWVNYW5hZ2VyKCkubmV3Qm91bmRGcmFtZShtT3V0cHV0Rm9ybWF0LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgR0xGcmFtZS5FWFRFUk5BTF9URVhUVVJFLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMCk7CisgICAgICAgIG1TdXJmYWNlVGV4dHVyZSA9IG5ldyBTdXJmYWNlVGV4dHVyZShtQ2FtZXJhRnJhbWUuZ2V0VGV4dHVyZUlkKCkpOworICAgICAgICB0cnkgeworICAgICAgICAgICAgbUNhbWVyYS5zZXRQcmV2aWV3VGV4dHVyZShtU3VyZmFjZVRleHR1cmUpOworICAgICAgICB9IGNhdGNoIChJT0V4Y2VwdGlvbiBlKSB7CisgICAgICAgICAgICB0aHJvdyBuZXcgUnVudGltZUV4Y2VwdGlvbigiQ291bGQgbm90IGJpbmQgY2FtZXJhIHN1cmZhY2UgdGV4dHVyZTogIiArCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBlLmdldE1lc3NhZ2UoKSArICIhIik7CisgICAgICAgIH0KKworICAgICAgICAvLyBDb25uZWN0IFN1cmZhY2VUZXh0dXJlIHRvIGNhbGxiYWNrCisgICAgICAgIG1TdXJmYWNlVGV4dHVyZS5zZXRPbkZyYW1lQXZhaWxhYmxlTGlzdGVuZXIob25DYW1lcmFGcmFtZUF2YWlsYWJsZUxpc3RlbmVyKTsKKyAgICAgICAgLy8gU3RhcnQgdGhlIHByZXZpZXcKKyAgICAgICAgbU5ld0ZyYW1lQXZhaWxhYmxlID0gZmFsc2U7CisgICAgICAgIG1DYW1lcmEuc3RhcnRQcmV2aWV3KCk7CisgICAgfQorCisgICAgQE92ZXJyaWRlCisgICAgcHVibGljIHZvaWQgcHJvY2VzcyhGaWx0ZXJDb250ZXh0IGNvbnRleHQpIHsKKyAgICAgICAgaWYgKG1Mb2dWZXJib3NlKSBMb2cudihUQUcsICJQcm9jZXNzaW5nIG5ldyBmcmFtZSIpOworCisgICAgICAgIGlmIChtV2FpdEZvck5ld0ZyYW1lKSB7CisgICAgICAgICAgICBpbnQgd2FpdENvdW50ID0gMDsKKyAgICAgICAgICAgIHdoaWxlICghbU5ld0ZyYW1lQXZhaWxhYmxlKSB7CisgICAgICAgICAgICAgICAgaWYgKHdhaXRDb3VudCA9PSBORVdGUkFNRV9USU1FT1VUX1JFUEVBVCkgeworICAgICAgICAgICAgICAgICAgICB0aHJvdyBuZXcgUnVudGltZUV4Y2VwdGlvbigiVGltZW91dCB3YWl0aW5nIGZvciBuZXcgZnJhbWUiKTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgdHJ5IHsKKyAgICAgICAgICAgICAgICAgICAgdGhpcy53YWl0KE5FV0ZSQU1FX1RJTUVPVVQpOworICAgICAgICAgICAgICAgIH0gY2F0Y2ggKEludGVycnVwdGVkRXhjZXB0aW9uIGUpIHsKKyAgICAgICAgICAgICAgICAgICAgaWYgKG1Mb2dWZXJib3NlKSBMb2cudihUQUcsICJJbnRlcnJ1cHRlZCB3aGlsZSB3YWl0aW5nIGZvciBuZXcgZnJhbWUiKTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9CisgICAgICAgICAgICBtTmV3RnJhbWVBdmFpbGFibGUgPSBmYWxzZTsKKyAgICAgICAgICAgIGlmIChtTG9nVmVyYm9zZSkgTG9nLnYoVEFHLCAiR290IG5ldyBmcmFtZSIpOworICAgICAgICB9CisKKyAgICAgICAgbVN1cmZhY2VUZXh0dXJlLnVwZGF0ZVRleEltYWdlKCk7CisKKyAgICAgICAgaWYgKG1Mb2dWZXJib3NlKSBMb2cudihUQUcsICJVc2luZyBmcmFtZSBleHRyYWN0b3IgaW4gdGhyZWFkOiAiICsgVGhyZWFkLmN1cnJlbnRUaHJlYWQoKSk7CisgICAgICAgIG1TdXJmYWNlVGV4dHVyZS5nZXRUcmFuc2Zvcm1NYXRyaXgobUNhbWVyYVRyYW5zZm9ybSk7CisgICAgICAgIE1hdHJpeC5tdWx0aXBseU1NKG1NYXBwZWRDb29yZHMsIDAsCisgICAgICAgICAgICAgICAgICAgICAgICAgIG1DYW1lcmFUcmFuc2Zvcm0sIDAsCisgICAgICAgICAgICAgICAgICAgICAgICAgIG1Tb3VyY2VDb29yZHMsIDApOworICAgICAgICBtRnJhbWVFeHRyYWN0b3Iuc2V0U291cmNlUmVnaW9uKG1NYXBwZWRDb29yZHNbMF0sIG1NYXBwZWRDb29yZHNbMV0sCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbU1hcHBlZENvb3Jkc1s0XSwgbU1hcHBlZENvb3Jkc1s1XSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBtTWFwcGVkQ29v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PSBudWxsKSB7CisgICAgICAgICAgICBpZiAobUNhbWVyYSA9PSBudWxsKSB7CisgICAgICAgICAgICAgICAgbUNhbWVyYSA9IENhbWVyYS5vcGVuKG1DYW1lcmFJZCk7CisgICAgICAgICAgICAgICAgY2xvc2VDYW1lcmEgPSB0cnVlOworICAgICAgICAgICAgfQorICAgICAgICAgICAgbUNhbWVyYVBhcmFtZXRlcnMgPSBtQ2FtZXJhLmdldFBhcmFtZXRlcnMoKTsKKworICAgICAgICAgICAgaWYgKGNsb3NlQ2FtZXJhKSB7CisgICAgICAgICAgICAgICAgbUNhbWVyYS5yZWxlYXNlKCk7CisgICAgICAgICAgICAgICAgbUNhbWVyYSA9IG51bGw7CisgICAgICAgICAgICB9CisgICAgICAgIH0KKworICAgICAgICBpbnQgY2xvc2VzdFNpemVbXSA9IGZpbmRDbG9zZXN0U2l6ZShtV2lkdGgsIG1IZWlnaHQsIG1DYW1lcmFQYXJhbWV0ZXJzKTsKKyAgICAgICAgbVdpZHRoID0gY2xvc2VzdFNpemVbMF07CisgICAgICAgIG1IZWlnaHQgPSBjbG9zZXN0U2l6ZVsxXTsKKyAgICAgICAgbUNhbWVyYVBhcmFtZXRlcnMuc2V0UHJldmlld1NpemUobVdpZHRoLCBtSGVpZ2h0KTsKKworICAgICAgICBpbnQgY2xvc2VzdFJhbmdlW10gPSBmaW5kQ2xvc2VzdEZwc1JhbmdlKG1GcHMsIG1DYW1lcmFQYXJhbWV0ZXJzKTsKKworICAgICAgICBtQ2FtZXJhUGFyYW1ldGVycy5zZXRQcmV2aWV3RnBzUmFuZ2UoY2xvc2VzdFJhbmdlW0NhbWVyYS5QYXJhbWV0ZXJzLlBSRVZJRVdfRlBTX01JTl9JTkRFWF0sCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjbG9zZXN0UmFuZ2VbQ2FtZXJhLlBhcmFtZXRlcnMuUFJFVklFV19GUFNfTUFYX0lOREVYXSk7CisKKyAgICAgICAgcmV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aGVyIGRpbWVuc2lvbiB0aGFuCisgICAgICAgICAgICAvLyB0aGUgcmVxdWVzdGVkIHNpemUsIGJ1dCBhcyBjbG9zZSBhcyBwb3NzaWJsZS4gVGhlIGJlbG93IGlzbid0IGEKKyAgICAgICAgICAgIC8vIHN0YWJsZSBzZWxlY3Rpb24gKHJlb3JkaW5nIHRoZSBzaXplIGxpc3QgY2FuIGdpdmUgZGlmZmVyZW50CisgICAgICAgICAgICAvLyByZXN1bHRzKSwgYnV0IHNpbmNlIHRoaXMgaXMgYSBmYWxsYmFjayBuaWNldHksIHRoYXQncyBhY2NlcHRhYmxlLgorICAgICAgICAgICAgaWYgKCBzaXplLndpZHRoIDw9IHdpZHRoICYmCisgICAgICAgICAgICAgICAgIHNpemUuaGVpZ2h0IDw9IGhlaWdodCAmJgorICAgICAgICAgICAgICAgICBzaXplLndpZHRoID49IGNsb3Nlc3RXaWR0aCAmJgorICAgICAgICAgICAgICAgICBzaXplLmhlaWdodCA+PSBjbG9zZXN0SGVpZ2h0KSB7CisgICAgICAgICAgICAgICAgY2xvc2VzdFdpZHRoID0gc2l6ZS53aWR0aDsKKyAgICAgICAgICAgICAgICBjbG9zZXN0SGVpZ2h0ID0gc2l6ZS5oZWlnaHQ7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBpZiAoIHNpemUud2lkdGggPCBzbWFsbGVzdFdpZHRoICYmCisgICAgICAgICAgICAgICAgIHNpemUuaGVpZ2h0IDwgc21hbGxlc3RIZWlnaHQpIHsKKyAgICAgICAgICAgICAgICBzbWFsbGVzdFdpZHRoID0gc2l6ZS53aWR0aDsKKyAgICAgICAgICAgICAgICBzbWFsbGVzdEhlaWdodCA9IHNpemUuaGVpZ2h0OworICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgICAgIGlmIChjbG9zZXN0V2lkdGggPT0gLTEpIHsKKyAgICAgICAgICAgIC8vIFJlcXVlc3RlZCBzaXplIGlzIHNtYWxsZXIgdGhhbiBhbnkgbGlzdGVkIHNp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FtZXJhLlBhcmFtZXRlcnMuUFJFVklFV19GUFNfTUFYX0lOREVYXSA+IGZwcyoxMDAwICYmCisgICAgICAgICAgICAgICAgcmFuZ2VbQ2FtZXJhLlBhcmFtZXRlcnMuUFJFVklFV19GUFNfTUlOX0lOREVYXSA+CisgICAgICAgICAgICAgICAgY2xvc2VzdFJhbmdlW0NhbWVyYS5QYXJhbWV0ZXJzLlBSRVZJRVdfRlBTX01JTl9JTkRFWF0gJiYKKyAgICAgICAgICAgICAgICByYW5nZVtDYW1lcmEuUGFyYW1ldGVycy5QUkVWSUVXX0ZQU19NQVhfSU5ERVhdIDwKKyAgICAgICAgICAgICAgICBjbG9zZXN0UmFuZ2VbQ2FtZXJhLlBhcmFtZXRlcnMuUFJFVklFV19GUFNfTUFYX0lOREVYXSkgeworICAgICAgICAgICAgICAgIGNsb3Nlc3RSYW5nZSA9IHJhbmdlOworICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgICAgIGlmIChtTG9nVmVyYm9zZSkgTG9nLnYoVEFHLCAiUmVxdWVzdGVkIGZwczogIiArIGZwcworICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICsgIi5DbG9zZXN0IGZyYW1lIHJhdGUgcmFuZ2U6IFsiCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKyBjbG9zZXN0UmFuZ2VbQ2FtZXJhLlBhcmFtZXRlcnMuUFJFVklFV19GUFNfTUlOX0lOREVYXSAvIDEwMDAuCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKyAiLCIKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICArIGNsb3Nlc3RSYW5nZVtDYW1lcmEuUGFyYW1ldGVycy5QUkVWSUVXX0ZQU19NQVhfSU5ERVhdIC8gMTAwMC4KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICArICJdIik7CisKKyAgICAgICAgcmV0dXJuIGNsb3Nlc3RSYW5nZTsKKyAgICB9CisKKyAgICBwcml2YXRlIFN1cmZhY2VU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gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMCwgMCwgMCwgMSB9OworICAgIHByaXZhdGUgc3RhdGljIGZpbmFsIGZsb2F0W10gbVNvdXJjZUNvb3Jkc18yNzAgPSB7IDAsIDEsIDAsIDEsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAwLCAwLCAwLCAxLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMSwgMSwgMCwgMSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDEsIDAsIDAsIDEgfTsKKyAgICBwcml2YXRlIHN0YXRpYyBmaW5hbCBmbG9hdFtdIG1Tb3VyY2VDb29yZHNfMTgwID0geyAwLCAwLCAwLCAxLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDEsIDAsIDAsIDEsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMCwgMSwgMCwgMSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAxLCAxLCAwLCAxIH07CisgICAgcHJpdmF0ZSBzdGF0aWMgZmluYWwgZmxvYXRbXSBtU291cmNlQ29vcmRzXzkwID0geyAxLCAwLCAwLCAxLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDEsIDEsIDAsIDEsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMCwgMCwgMCwgMSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAwLCAxLCAwLCAxIH07CisKKyAgICBwcml2YXRlIGJvb2xlYW4gbUdvdFNpemU7CisgICAgcHJpdmF0ZSBib29sZWF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ICAgICAgICAgICAgICAgRnJhbWVGb3JtYXQuVEFSR0VUX0dQVSk7CisgICAgfQorCisgICAgQE92ZXJyaWRlCisgICAgcHJvdGVjdGVkIHZvaWQgcHJlcGFyZShGaWx0ZXJDb250ZXh0IGNvbnRleHQpIHsKKyAgICAgICAgaWYgKG1Mb2dWZXJib3NlKSBMb2cudihUQUcsICJQcmVwYXJpbmcgTWVkaWFTb3VyY2UiKTsKKworICAgICAgICBtRnJhbWVFeHRyYWN0b3IgPSBuZXcgU2hhZGVyUHJvZ3JhbShjb250ZXh0LCBtRnJhbWVTaGFkZXIpOworICAgICAgICAvLyBTdXJmYWNlVGV4dHVyZSBkZWZpbmVzICgwLDApIHRvIGJlIGJvdHRvbS1sZWZ0LiBUaGUgZmlsdGVyIGZyYW1ld29yaworICAgICAgICAvLyBkZWZpbmVzICgwLDApIGFzIHRvcC1sZWZ0LCBzbyBkbyB0aGUgZmxpcCBoZXJlLgorICAgICAgICBtRnJhbWVFeHRyYWN0b3Iuc2V0U291cmNlUmVjdCgwLCAxLCAxLCAtMSk7CisKKyAgICAgICAgY3JlYXRlRm9ybWF0cygpOworICAgIH0KKworICAgIEBPdmVycmlkZQorICAgIHB1YmxpYyB2b2lkIG9wZW4oRmlsdGVyQ29udGV4dCBjb250ZXh0KSB7CisgICAgICAgIGlmIChtTG9nVmVyYm9zZSkgeworICAgICAgICAgICAgTG9nLnYoVEFHLCAiT3BlbmluZyBNZWRpYVNvdXJjZSIpOworICAgICAgICAgICAgaWYgKG1TZWxlY3RlZElzVXJsKSB7CisgICAgICAgICAgICAgICAgTG9nLnYoVEFHLCAiQ3VycmVudCBVUkwgaXMgIiArIG1Tb3VyY2VVcmwpOworICAgICAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgICAgICBMb2cudihUQUcsICJDdXJyZW50IHNvdXJjZSBpcyBBc3NldCEiKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorCisgICAgICAgIG1NZWRpYUZyYW1lID0gKEdMRnJhbWUpY29udGV4dC5nZXRGcmFtZU1hbmFnZXIoKS5uZXdCb3VuZEZyYW1lKAorICAgICAgICAgICAgICAgIG1PdXRwdXRGb3JtYXQsCisgICAgICAgICAgICAgICAgR0xGcmFtZS5FWFRFUk5BTF9URVhUVVJFLAorICAgICAgICAgICAgICAgIDApOworCisgICAgICAgIG1TdXJmYWNlVGV4dHVyZSA9IG5ldyBTdXJmYWNlVGV4dHVyZShtTWVkaWFGcmFtZS5nZXRUZXh0dXJlSWQoKSk7CisKKyAgICAgICAgaWYgKCFzZXR1cE1lZGlhUGxheWVyKG1TZWxlY3RlZElzVXJsKSkgeworICAgICAgICAgIHRocm93IG5ldyBSdW50aW1lRXhjZXB0aW9uKCJFcnJvciBzZXR0aW5nIHVwIE1lZGlhUGxheWVyISIpOworICAgICAgICB9CisgICAgfQorCisgICAgQE92ZXJyaWRlCisgICAgcHVibGljIHZvaWQgcHJvY2VzcyhGaWx0ZXJDb250ZXh0IGNvbnRleHQpIHsKKyAgICAgICAgLy8gTm90ZTogcHJvY2VzcyBpcyBzeW5jaHJvbml6ZWQgYnkgaXRzIGNhbGxlciBpbiB0aGUgRmlsdGVyIGJhc2UgY2xhc3MKKyAgICAgICAgaWYgKG1Mb2dWZXJib3NlKSBMb2cudihUQUcsICJQcm9jZXNzaW5nIG5ldyBmcmFtZSIpOworCisgICAgICAgIGlmIChtTWVkaWFQbGF5ZXIgPT0gbnVsbCkgeworICAgICAgICAgICAgLy8gU29tZXRoaW5nIHdlbnQgd3JvbmcgaW4gaW5pdGlhbGl6YXRpb24gb3IgcGFyYW1ldGVyIHVwZGF0ZXMKKyAgICAgICAgICAgIHRocm93IG5ldyBOdWxsUG9pbnRlckV4Y2VwdGlvbigiVW5leHBlY3RlZCBudWxsIG1lZGlhIHBsYXllciEiKTsKKyAgICAgICAgfQorCisgICAgICAgIGlmIChtQ29tcGxldGVkKSB7CisgICAgICAgICAgICAvLyBWaWRlbyBwbGF5YmFjayBpcyBkb25lLCBzbyBjbG9zZSB1cyBkb3duCisgICAgICAgICAgICBjbG9zZU91dHB1dFBvcnQoInZpZGVvIik7CisgICAgICAgICAgICByZXR1cm47CisgICAgICAgIH0KKworICAgICAgICBpZiAoIW1QbGF5aW5nKSB7CisgICAgICAgICAgICBpbnQgd2FpdENvdW50ID0gMDsKKyAgICAgICAgICAgIGlmIChtTG9nVmVyYm9zZSkgTG9nLnYoVEFHLCAiV2FpdGluZyBmb3IgcHJlcGFyYXRpb24gdG8gY29tcGxldGUiKTsKKyAgICAgICAgICAgIHdoaWxlICghbUdvdFNpemUgfHwgIW1QcmVwYXJlZCkgeworICAgICAgICAgICAgICAgIHRyeSB7CisgICAgICAgICAgICAgICAgICAgIHRoaXMud2FpdChQUkVQX1RJTUVPVVQpOworICAgICAgICAgICAgICAgIH0gY2F0Y2ggKEludGVycnVwdGVkRXhjZXB0aW9uIGUpIHsKKyAgICAgICAgICAgICAgICAgICAgLy8gaWdub3JpbmcKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgaWYgKG1Db21wbGV0ZWQpIHsKKyAgICAgICAgICAgICAgICAgICAgLy8gVmlkZW8gcGxheWJhY2sgaXMgZG9uZSwgc28gY2xvc2UgdXMgZG93bgorICAgICAgICAgICAgICAgICAgICBjbG9zZU91dHB1dFBvcnQoInZpZGVvIik7CisgICAgICAgICAgICAgICAgICAgIHJldHVybjsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgd2FpdENvdW50Kys7CisgICAgICAgICAgICAgICAgaWYgKHdhaXRDb3VudCA9PSBQUkVQX1RJTUVPVVRfUkVQRUFUKSB7CisgICAgICAgICAgICAgICAgICAgIG1NZWRpYVBsYXllci5yZWxlYXNlKCk7CisgICAgICAgICAgICAgICAgICAgIHRocm93IG5ldyBSdW50aW1lRXhjZXB0aW9uKCJNZWRpYVBsYXllciB0aW1lZCBvdXQgd2hpbGUgcHJlcGFyaW5nISIpOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGlmIChtTG9nVmVyYm9zZSkgTG9nLnYoVEFHLCAiU3RhcnRpbmcgcGxheWJhY2siKTsKKyAgICAgICAgICAgIG1NZWRpYVBsYXllci5zdGFydCgpOworICAgICAgICB9CisKKyAgICAgICAgLy8gVXNlIGxhc3QgZnJhbWUgaWYgcGF1c2VkLCB1bmxlc3MganVzdCBzdGFydGluZyBwbGF5YmFjaywgaW4gd2hpY2ggY2FzZQorICAgICAgICAvLyB3ZSB3YW50IGF0IGxlYXN0IG9uZSB2YWxpZCBmcmFtZSBiZWZvcmUgcGF1c2luZworICAgICAgICBpZiAoIW1QYXVzZWQgfHwgIW1QbGF5aW5nKSB7CisgICAgICAgICAgICBpZiAobVdhaXRGb3JOZXdGcmFtZSkgeworICAgICAgICAgICAgICAgIGlmIChtTG9nVmVyYm9zZSkgTG9nLnYoVEFHLCAiV2FpdGluZyBmb3IgbmV3IGZyYW1lIik7CisKKyAgICAgICAgICAgICAgICBpbnQgd2FpdENvdW50ID0gMDsKKyAgICAgICAgICAgICAgICB3aGlsZSAoIW1OZXdGcmFtZUF2YWlsYWJsZSkgeworICAgICAgICAgICAgICAgICAgICBpZiAod2FpdENvdW50ID09IE5FV0ZSQU1FX1RJTUVPVVRfUkVQRUFUKSB7CisgICAgICAgICAgICAgICAgICAgICAgICBpZiAobUNvbXBsZXRlZCkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vIFZpZGVvIHBsYXliYWNrIGlzIGRvbmUsIHNvIGNsb3NlIHVzIGRvd24KKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBjbG9zZU91dHB1dFBvcnQoInZpZGVvIik7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuOworICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB0aHJvdyBuZXcgUnVudGltZUV4Y2VwdGlvbigiVGltZW91dCB3YWl0aW5nIGZvciBuZXcgZnJhbWUhIik7CisgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgdHJ5IHsKKyAgICAgICAgICAgICAgICAgICAgICAgIHRoaXMud2FpdChORVdGUkFNRV9USU1FT1VUKTsKKyAgICAgICAgICAgICAgICAgICAgfSBjYXRjaCAoSW50ZXJydXB0ZWRFeGNlcHRpb24gZSkgeworICAgICAgICAgICAgICAgICAgICAgICAgaWYgKG1Mb2dWZXJib3NlKSBMb2cudihUQUcsICJpbnRlcnJ1cHRlZCIpOworICAgICAgICAgICAgICAgICAgICAgICAgLy8gaWdub3JpbmcKKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICB3YWl0Q291bnQrKzsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgbU5ld0ZyYW1lQXZhaWxhYmxlID0gZmFsc2U7CisgICAgICAgICAgICAgICAgaWYgKG1Mb2dWZXJib3NlKSBMb2cudihUQUcsICJHb3QgbmV3IGZyYW1lIik7CisgICAgICAgICAgICB9CisKKyAgICAgICAgICAgIG1TdXJmYWNlVGV4dHVyZS51cGRhdGVUZXhJbWFnZSgpOworICAgICAgICAgICAgbU9yaWVudGF0aW9uVXBkYXRlZCA9IHRydWU7CisgICAgICAgIH0KKyAgICAgICAgaWYgKG1PcmllbnRhdGlvblVwZGF0ZWQpIHsKKyAgICAgICAgICAgIGZsb2F0W10gc3VyZmFjZVRyYW5zZm9ybSA9IG5ldyBmbG9hdFsxNl07CisgICAgICAgICAgICBtU3VyZmFjZVRleHR1cmUuZ2V0VHJhbnNmb3JtTWF0cml4KHN1cmZhY2VUcmFuc2Zvcm0pOworCisgICAgICAgICAgICBmbG9hdFtdIHNvdXJjZUNvb3JkcyA9IG5ldyBmbG9hdFsxNl07CisgICAgICAgICAgICBzd2l0Y2ggKG1PcmllbnRhdGlvbikgeworICAgICAgICAgICAgICAgIGRlZmF1bHQ6CisgICAgICAgICAgICAgICAgY2FzZSAwOgorICAgICAgICAgICAgICAgICAgICBNYXRyaXgubXVsdGlwbHlNTShzb3VyY2VDb29yZHMsIDAsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHN1cmZhY2VUcmFuc2Zvcm0sIDAsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1Tb3VyY2VDb29yZHNfMCwgMCk7CisgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgIGNhc2UgOTA6CisgICAgICAgICAgICAgICAgICAgIE1hdHJpeC5tdWx0aXBseU1NKHNvdXJjZUNvb3JkcywgMCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc3VyZmFjZVRyYW5zZm9ybSwgMCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbVNvdXJjZUNvb3Jkc185MCwgMCk7CisgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgIGNhc2UgMTgwOgorICAgICAgICAgICAgICAgICAgICBNYXRyaXgubXVsdGlwbHlNTShzb3VyY2VDb29yZHMsIDAsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHN1cmZhY2VUcmFuc2Zvcm0sIDAsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1Tb3VyY2VDb29yZHNfMTgwLCAwKTsKKyAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgY2FzZSAyNzA6CisgICAgICAgICAgICAgICAgICAgIE1hdHJpeC5tdWx0aXBseU1NKHNvdXJjZUNvb3JkcywgMCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc3VyZmFjZVRyYW5zZm9ybSwgMCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbVNvdXJjZUNvb3Jkc18yNzAsIDApOworICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIGlmIChtTG9nVmVyYm9zZSkgeworICAgICAgICAgICAgICAgIExvZy52KFRBRywgIk9yaWVudGF0aW9uSGludCA9ICIgKyBtT3JpZW50YXRpb24pOworICAgICAgICAgICAgICAgIFN0cmluZyB0ZW1wID0gU3RyaW5nLmZvcm1hdCgiU2V0U291cmNlUmVnaW9uOiAlLjJmLCAlLjJmLCAlLjJmLCAlLjJmLCAlLjJmLCAlLjJmLCAlLjJmLCAlLjJmIiwKKyAgICAgICAgICAgICAgICAgICAgICAgIHNvdXJjZUNvb3Jkc1s0XSwgc291cmNlQ29vcmRzWzVdLHNvdXJjZUNvb3Jkc1swXSwgc291cmNlQ29vcmRzWzFdLAorICAgICAgICAgICAgICAgICAgICAgICAgc291cmNlQ29vcmRzWzEyXSwgc291cmNlQ29vcmRzWzEzXSxzb3VyY2VDb29yZHNbOF0sIHNvdXJjZUNvb3Jkc1s5XSk7CisgICAgICAgICAgICAgICAgTG9nLnYoVEFHLCB0ZW1wKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIG1GcmFtZUV4dHJhY3Rvci5zZXRTb3VyY2VSZWdpb24oc291cmNlQ29vcmRzWzRdLCBzb3VyY2VDb29yZHNbNV0sCisgICAgICAgICAgICAgICAgICAgIHNvdXJjZUNvb3Jkc1swXSwgc291cmNlQ29vcmRzWzFdLAorICAgICAgICAgICAgICAgICAgICBzb3VyY2VDb29yZHNbMTJdLCBzb3VyY2VDb29yZHNbMTNdLAorICAgICAgICAgICAgICAgICAgICBzb3VyY2VDb29yZHNbOF0sIHNvdXJjZUNvb3Jkc1s5XSk7CisgICAgICAgICAgICBtT3JpZW50YXRpb25VcGRhdGVkID0gZmFsc2U7CisgICAgICAgIH0KKworICAgICAgICBGcmFtZSBvdXRwdXQgPSBjb250ZXh0LmdldEZyYW1lTWFuYWdlcigpLm5ld0ZyYW1lKG1PdXRwdXRGb3JtYXQpOworICAgICAgICBtRnJhbW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ZyBuZXcgc291cmNlIFVSTCIpOworICAgICAgICAgICAgICAgIGlmIChtU2VsZWN0ZWRJc1VybCkgeworICAgICAgICAgICAgICAgICAgICBzZXR1cE1lZGlhUGxheWVyKG1TZWxlY3RlZElzVXJsKTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICB9CisgICAgICAgIH0gZWxzZSBpZiAobmFtZS5lcXVhbHMoInNvdXJjZUFzc2V0IikgKSB7CisgICAgICAgICAgICBpZiAoaXNPcGVuKCkpIHsKKyAgICAgICAgICAgICAgICBpZiAobUxvZ1ZlcmJvc2UpIExvZy52KFRBRywgIk9wZW5pbmcgbmV3IHNvdXJjZSBGRCIpOworICAgICAgICAgICAgICAgIGlmICghbVNlbGVjdGVkSXNVcmwpIHsKKyAgICAgICAgICAgICAgICAgICAgc2V0dXBNZWRpYVBsYXllcihtU2VsZWN0ZWRJc1VybCk7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfQorICAgICAgICB9IGVsc2UgaWYgKG5hbWUuZXF1YWxzKCJsb29wIikpIHsKKyAgICAgICAgICAgIGlmIChpc09wZW4oKSkgeworICAgICAgICAgICAgICAgIG1NZWRpYVBsYXllci5zZXRMb29waW5nKG1Mb29waW5nKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfSBlbHNlIGlmIChuYW1lLmVxdWFscygic291cmNlSXNVcmwiKSkgeworICAgICAgICAgICAgaWYgKGlzT3BlbigpKXsKKyAgICAgICAgICAgICAgICBpZiAobVNlbGVjdGVkSXNVcmwpeworICAgICAgICAgICAgICAgICAgICBpZiAobUxvZ1ZlcmJvc2UpIExvZy52KFRBRywgIk9wZW5pbmcgbmV3IHNvdXJjZSBVUkwiKTsKKyAgICAgICAgICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgICAgICAgICBpZiAobUxvZ1ZlcmJvc2UpIExvZy52KFRBRywgIk9wZW5pbmcgbmV3IHNvdXJjZSBBc3NldCIpOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICBzZXR1cE1lZGlhUGxheWVyKG1TZWxlY3RlZElzVXJsKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfSBlbHNlIGlmIChuYW1lLmVxdWFscygidm9sdW1lIikpIHsKKyAgICAgICAgICAgIGlmIChpc09wZW4oKSkgeworICAgICAgICAgICAgICAgIG1NZWRpYVBsYXllci5zZXRWb2x1bWUobVZvbHVtZSwgbVZvbHVtZSk7CisgICAgICAgICAgICB9CisgICAgICAgIH0gZWxzZSBpZiAobmFtZS5lcXVhbHMoIm9yaWVudGF0aW9uIikgJiYgbUdvdFNpemUpIHsKKyAgICAgICAgICAgIGlmIChtT3JpZW50YXRpb24gPT0gMCB8fCBtT3JpZW50YXRpb24gPT0gMTgwKSB7CisgICAgICAgICAgICAgICAgbU91dHB1dEZvcm1hdC5zZXREaW1lbnNpb25zKG1XaWR0aCwgbUhlaWdodCk7CisgICAgICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgICAgIG1PdXRwdXRGb3JtYXQuc2V0RGltZW5zaW9ucyhtSGVpZ2h0LCBtV2lkdGgpOworICAgICAgICAgICAgfQorICAgICAgICAgICAgbU9yaWVudGF0aW9uVXBkYXRlZCA9IHRydWU7CisgICAgICAgIH0KKyAgICB9CisKKyAgICBzeW5jaHJvbml6ZWQgcHVibGljIHZvaWQgcGF1c2VWaWRlbyhib29sZWFuIHBhdXNlU3RhdGUpIHsKKyAgICAgICAgaWYgKGlzT3BlbigpKSB7CisgICAgICAgICAgICBpZiAocGF1c2VTdGF0ZSAmJiAhbVBhdXNlZCkgeworICAgICAgICAgICAgICAgIG1NZWRpYVBsYXllci5wYXVzZSgpOworICAgICAgICAgICAgfSBlbHNlIGlmICghcGF1c2VTdGF0ZSAmJiBtUGF1c2VkKSB7CisgICAgICAgICAgICAgICAgbU1lZGlhUGxheWVyLnN0YXJ0KCk7CisgICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICAgICAgbVBhdXNlZCA9IHBhdXNlU3RhdGU7CisgICAgfQorCisgICAgLyoqIENyZWF0ZXMgYSBtZWRpYSBwbGF5ZXIsIHNldHMgaXQgdXAsIGFuZCBjYWxscyBwcmVwYXJlICovCisgICAgc3luY2hyb25pemVkIHByaXZhdGUgYm9vbGVhbiBzZXR1cE1lZGlhUGxheWVyKGJvb2xlYW4gdXNlVXJsKSB7CisgICAgICAgIG1QcmVwYXJlZCA9IGZhbHNlOworICAgICAgICBtR290U2l6ZSA9IGZhbHNlOworICAgICAgICBtUGxheWluZyA9IGZhbHNlOworICAgICAgICBtUGF1c2VkID0gZmFsc2U7CisgICAgICAgIG1Db21wbGV0ZWQgPSBmYWxzZTsKKyAgICAgICAgbU5ld0ZyYW1lQXZhaWxhYmxlID0gZmFsc2U7CisKKyAgICAgICAgaWYgKG1Mb2dWZXJib3NlKSBMb2cudihUQUcsICJTZXR0aW5nIHVwIHBsYXliYWNrLiIpOworCisgICAgICAgIGlmIChtTWVkaWFQbGF5ZXIgIT0gbnVsbCkgeworICAgICAgICAgICAgLy8gQ2xlYW4gdXAgZXhpc3RpbmcgbWVkaWEgcGxheWVycworICAgICAgICAgICAgaWYgKG1Mb2dWZXJib3NlKSBMb2cudihUQUcsICJSZXNldHRpbmcgZXhpc3RpbmcgTWVkaWFQbGF5ZXIuIik7CisgICAgICAgICAgICBtTWVkaWFQbGF5ZXIucmVzZXQoKTsKKyAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgIC8vIENyZWF0ZSBuZXcgbWVkaWEgcGxheWVyCisgICAgICAgICAgICBpZiAobUxvZ1ZlcmJvc2UpIExvZy52KFRBRywgIkNyZWF0aW5nIG5ldyBNZWRpYVBsYXllci4iKTsKKyAgICAgICAgICAgIG1NZWRpYVBsYXllciA9IG5ldyBNZWRpYVBsYXllcigpOworICAgICAgICB9CisKKyAgICAgICAgaWYgKG1NZWRpYVBsYXllciA9PSBudWxsKSB7CisgICAgICAgICAgICB0aHJvdyBuZXcgUnVudGltZUV4Y2VwdGlvbigiVW5hYmxlIHRvIGNyZWF0ZSBhIE1lZGlhUGxheWVyISIpOworICAgICAgICB9CisKKyAgICAgICAgLy8gU2V0IHVwIGRhdGEgc291cmNlcywgZXRjCisgICAgICAgIHRyeSB7CisgICAgICAgICAgICBpZiAodXNlVXJsKSB7CisgICAgICAgICAgICAgICAgaWYgKG1Mb2dWZXJib3NlKSBMb2cudihUQUcsICJTZXR0aW5nIE1lZGlhUGxheWVyIHNvdXJjZSB0byBVUkkgIiArIG1Tb3VyY2VVcmwpOworICAgICAgICAgICAgICAgIG1NZWRpYVBsYXllci5zZXREYXRhU291cmNlKG1Tb3VyY2VVcmwpOworICAgICAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgICAgICBpZiAobUxvZ1ZlcmJvc2UpIExvZy52KFRBRywgIlNldHRpbmcgTWVkaWFQbGF5ZXIgc291cmNlIHRvIGFzc2V0ICIgKyBtU291cmNlQXNzZXQpOworICAgICAgICAgICAgICAgIG1NZWRpYVBsYXllci5zZXREYXRhU291cmNlKG1Tb3VyY2VBc3NldC5nZXRGaWxlRGVzY3JpcHRvcigpLCBtU291cmNlQXNzZXQuZ2V0U3RhcnRPZmZzZXQoKSwgbVNvdXJjZUFzc2V0LmdldExlbmd0aCgpKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfSBjYXRjaChJT0V4Y2VwdGlvbiBlKSB7CisgICAgICAgICAgICBtTWVkaWFQbGF5ZXIucmVsZWFzZSgpOworICAgICAgICAgICAgbU1lZGlhUGxheWVyID0gbnVsbDsKKyAgICAgICAgICAgIGlmICh1c2VVcmwpIHsKKyAgICAgICAgICAgICAgICB0aHJvdyBuZXcgUnVudGltZUV4Y2VwdGlvbihTdHJpbmcuZm9ybWF0KCJVbmFibGUgdG8gc2V0IE1lZGlhUGxheWVyIHRvIFVSTCAlcyEiLCBtU291cmNlVXJsKSwgZSk7CisgICAgICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgICAgIHRocm93IG5ldyBSdW50aW1lRXhjZXB0aW9u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7CisgICAgICAgICAgICAgICAgaWYgKG1PcmllbnRhdGlvbiA9PSAwIHx8IG1PcmllbnRhdGlvbiA9PSAxODApIHsKKyAgICAgICAgICAgICAgICAgICAgbU91dHB1dEZvcm1hdC5zZXREaW1lbnNpb25zKHdpZHRoLCBoZWlnaHQpOworICAgICAgICAgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICAgICAgICAgIG1PdXRwdXRGb3JtYXQuc2V0RGltZW5zaW9ucyhoZWlnaHQsIHdpZHRoKTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgbVdpZHRoID0gd2lkdGg7CisgICAgICAgICAgICAgICAgbUhlaWdodCA9IGhlaWdodDsKKyAgICAgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICAgICAgaWYgKG1PdXRwdXRGb3JtYXQuZ2V0V2lkdGgoKSAhPSB3aWR0aCB8fAorICAgICAgICAgICAgICAgICAgICBtT3V0cHV0Rm9ybWF0LmdldEhlaWdodCgpICE9IGhlaWdodCkgeworICAgICAgICAgICAgICAgICAgICBMb2cuZShUQUcsICJNdWx0aXBsZSB2aWRlbyBzaXplIGNoYW5nZSBldmVudHMgcmVjZWl2ZWQhIik7CisgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgfQorICAgICAgICAgICAgc3luY2hyb25pemVkKE1lZGlhU291cmNlLnRoaXMpIHsKKyAgICAgICAgICAgICAgICBtR290U2l6ZSA9IHRydWU7CisgICAgICAgICAgICAgICAgTWVkaWFTb3VyY2UudGhpcy5ub3RpZnkoKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgIH07CisKKyAgICBwcml2YXRlIE1lZGlhUGxheWVyLk9uUHJlcGFyZWRMaXN0ZW5lciBvblByZXBhcmVkTGlzdGVuZXIgPQorICAgICAgICAgICAgbmV3IE1lZGlhUGxheWVyLk9uUHJlcGFyZWRMaXN0ZW5lcigpIHsKKyAgICAgICAgcHVibGljIHZvaWQgb25QcmVwYXJlZChNZWRpYVBsYXllciBtcCkgeworICAgICAgICAgICAgaWYgKG1Mb2dWZXJib3NlKSBMb2cudihUQUcsICJNZWRpYVBsYXllciBpcyBwcmVwYXJlZCIpOworICAgICAgICAgICAgc3luY2hyb25pemVkKE1lZGlhU291cmNlLnRoaXMpIHsKKyAgICAgICAgICAgICAgICBtUHJlcGFyZWQgPSB0cnVlOworICAgICAgICAgICAgICAgIE1lZGlhU291cmNlLnRoaXMubm90aWZ5KCk7CisgICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICB9OworCisgICAgcHJpdmF0ZSBNZWRpYVBsYXllci5PbkNvbXBsZXRpb25MaXN0ZW5lciBvbkNvbXBsZXRpb25MaXN0ZW5lciA9CisgICAgICAgICAgICBuZXcgTWVkaWFQbGF5ZXIuT25Db21wbGV0aW9uTGlzdGVuZXIoKSB7CisgICAgICAgIHB1YmxpYyB2b2lkIG9uQ29tcGxldGlvbihNZWRpYVBsYXllciBtcCkgeworICAgICAgICAgICAgaWYgKG1Mb2dWZXJib3NlKSBMb2cudihUQUcsICJNZWRpYVBsYXllciBoYXMgY29tcGxldGVkIHBsYXliYWNrIik7CisgICAgICAgICAgICBzeW5jaHJvbml6ZWQoTWVkaWFTb3VyY2UudGhpcykgeworICAgICAgICAgICAgICAgIG1Db21wbGV0ZWQgPSB0cnVlOworICAgICAgICAgICAgfQorICAgICAgICB9CisgICAgfTsKKworICAgIHByaXZhdGUgU3VyZmFjZVRleHR1cmUuT25GcmFtZUF2YWlsYWJsZUxpc3RlbmVyIG9uTWVkaWFGcmFtZUF2YWlsYWJsZUxpc3RlbmVyID0KKyAgICAgICAgICAgIG5ldyBTdXJmYWNlVGV4dHVyZS5PbkZyYW1lQXZhaWxhYmxlTGlzdGVuZXIoKSB7CisgICAgICAgIHB1YmxpYyB2b2lkIG9uRnJhbWVBdmFpbGFibGUoU3VyZmFjZVRleHR1cmUgc3VyZmFjZVRleHR1cmUpIHsKKyAgICAgICAgICAgIGlmIChtTG9nVmVyYm9zZSkgTG9n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b3JtYXQ7CisgICAgcHJpdmF0ZSBDb25kaXRpb25WYXJpYWJsZSBtTmV3RnJhbWVBdmFpbGFibGU7CisgICAgcHJpdmF0ZSBib29sZWFuIG1GaXJzdEZyYW1lOworCisgICAgcHJpdmF0ZSBmbG9hdFtdIG1GcmFtZVRyYW5zZm9ybTsKKyAgICBwcml2YXRlIGZsb2F0W10gbU1hcHBlZENvb3JkczsKKyAgICAvLyBUaGVzZSBkZWZhdWx0IHNvdXJjZSBjb29yZGluYXRlcyBwZXJmb3JtIHRoZSBuZWNlc3NhcnkgZmxpcAorICAgIC8vIGZvciBjb252ZXJ0aW5nIGZyb20gTUZGL0JpdG1hcCBvcmlnaW4gdG8gT3BlbkdMIG9yaWdpbi4KKyAgICBwcml2YXRlIHN0YXRpYyBmaW5hbCBmbG9hdFtdIG1Tb3VyY2VDb29yZHMgPSB7IDAsIDEsIDAsIDEsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAxLCAxLCAwLCAxLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMCwgMCwgMCwgMSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDEsIDAsIDAsIDEgfTsKKyAgICAvLyBTaGFkZXIgZm9yIG91dHB1dAorICAgIHByaXZhdGUgZmluYWwgU3RyaW5nIG1SZW5kZXJTaGFkZXIgPQorICAgICAgICAgICAgIiNleHRlbnNpb24gR0xfT0VTX0VHTF9pbWFnZV9leHRlcm5hbCA6IHJlcXVpcmVcbiIgKworICAgICAgICAgICAgInByZWNpc2lvbiBtZWRpdW1wIGZsb2F0O1xuIiArCisgICAgICAgICAgICAidW5pZm9ybSBzYW1wbGVyRXh0ZXJuYWxPRVMgdGV4X3NhbXBsZXJfMDtcbiIgKworICAgICAgICAgICAgInZhcnlpbmcgdmVjMiB2X3RleGNvb3JkO1xuIiArCisgICAgICAgICAgICAidm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IG1IZWlnaHQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgSW1hZ2VGb3JtYXQuQ09MT1JTUEFDRV9SR0JBLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEZyYW1lRm9ybWF0LlRBUkdFVF9HUFUpOworICAgIH0KKworICAgIEBPdmVycmlkZQorICAgIHByb3RlY3RlZCB2b2lkIHByZXBhcmUoRmlsdGVyQ29udGV4dCBjb250ZXh0KSB7CisgICAgICAgIGlmIChtTG9nVmVyYm9zZSkgTG9nLnYoVEFHLCAiUHJlcGFyaW5nIFN1cmZhY2VUZXh0dXJlU291cmNlIik7CisKKyAgICAgICAgY3JlYXRlRm9ybWF0cygpOworCisgICAgICAgIC8vIFByZXBhcmUgaW5wdXQKKyAgICAgICAgbU1lZGlhRnJhbWUgPSAoR0xGcmFtZSljb250ZXh0LmdldEZyYW1lTWFuYWdlcigpLm5ld0JvdW5kRnJhbWUobU91dHB1dEZvcm1hdCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgR0xGcmFtZS5FWFRFUk5BTF9URVhUVVJFLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAwKTsKKworICAgICAgICAvLyBQcmVwYXJlIG91dHB1dAorICAgICAgICBtRnJhbWVFeHRyYWN0b3IgPSBuZXcgU2hhZGVyUHJvZ3JhbShjb250ZXh0LCBtUmVuZGVyU2hhZGVyKTsKKyAgICB9CisKKyAgICBAT3ZlcnJpZGUKKyAgICBwdWJsaWMgdm9pZCBvcGVuKEZpbHRlckNvbnRleHQgY29udGV4dCkgeworICAgICAgICBpZiAobUxvZ1ZlcmJvc2UpIExvZy52KFRBRywgIk9wZW5pbmcgU3VyZmFjZVRleHR1cmVTb3VyY2UiKTsKKyAgICAgICAgLy8gQ3JlYXR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AgICAgICAgICAgICAgIGlmICghbUNsb3NlT25UaW1lb3V0KSB7CisgICAgICAgICAgICAgICAgICAgICAgICB0aHJvdyBuZXcgUnVudGltZUV4Y2VwdGlvbigiVGltZW91dCB3YWl0aW5nIGZvciBuZXcgZnJhbWUiKTsKKyAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIGlmIChtTG9nVmVyYm9zZSkgTG9nLnYoVEFHLCAiVGltZW91dCB3YWl0aW5nIGZvciBhIG5ldyBmcmFtZS4gQ2xvc2luZy4iKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIGNsb3NlT3V0cHV0UG9ydCgidmlkZW8iKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybjsKKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0gZWxzZSB7CisgICAgICAgICAgICAgICAgbU5ld0ZyYW1lQXZhaWxhYmxlLmJsb2NrKCk7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBtTmV3RnJhbWVBdmFpbGFibGUuY2xvc2UoKTsKKyAgICAgICAgICAgIG1GaXJzdEZyYW1lID0gZmFsc2U7CisgICAgICAgIH0KKworICAgICAgICBtU3VyZmFjZVRleHR1cmUudXBkYXRlVGV4SW1hZ2UoKTsKKworICAgICAgICBtU3VyZmFjZVRleHR1cmUuZ2V0VHJhbnNmb3JtTWF0cml4KG1GcmFtZVRyYW5zZm9ybSk7CisgICAgICAgIE1hdHJpeC5tdWx0aXBseU1NKG1NYXBwZWRDb29yZHMsIDAsCisgICAgICAgICAgICAgICAgICAgICAgICAgIG1GcmFtZVRyYW5zZm9ybSwgMCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgbVNvdXJjZUNvb3JkcywgMCk7CisgICAgICAgIG1GcmFtZUV4dHJhY3Rvci5zZXRTb3VyY2VSZWdpb24obU1hcHBlZENvb3Jkc1swXSwgbU1hcHBlZENvb3Jkc1sxXSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBtTWFwcGVkQ29vcmRzWzRdLCBtTWFwcGVkQ29vcmRzWzVdLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1NYXBwZWRDb29yZHNbOF0sIG1NYXBwZWRDb29yZHNbOV0sCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbU1hcHBlZENvb3Jkc1sxMl0sIG1NYXBwZWRDb29yZHNbMTNdKTsKKyAgICAgICAgLy8gTmV4dCwgcmVuZGVyIHRvIG91dHB1dAorICAgICAgICBGcmFtZSBvdXRwdXQgPSBjb250ZXh0LmdldEZyYW1lTWFuYWdlcigpLm5ld0ZyYW1lKG1PdXRwdXRGb3JtYXQpOworICAgICAgICBtRnJhbWVFeHRyYWN0b3IucHJvY2VzcyhtTWVkaWFGcmFtZSwgb3V0cHV0KTsKKworICAgICAgICBvdXRwdXQuc2V0VGltZXN0YW1wKG1TdXJmYWNlVGV4dHVyZS5nZXRUaW1lc3RhbXAoKSk7CisKKyAgICAgICAgcHVzaE91dHB1dCgidmlkZW8iLCBvdXRwdXQpOworICAgICAgICBvdXRwdXQucmVsZWFzZSgpOworICAgIH0KKworICAgIEBPdmVycmlkZQorICAgIHB1YmxpYyB2b2lkIGNsb3NlKEZpbHRlckNvbnRleHQgY29udGV4dCkgeworICAgICAgICBpZiAobUxvZ1ZlcmJvc2UpIExvZy52KFRBRywgIlN1cmZhY2VUZXh0dXJlU291cmNlIGNsb3NlZCIpOworICAgICAgICBtU291cmNlTGlzdGVuZXIub25TdXJmYWNlVGV4dHVyZVNvdXJjZVJlYWR5KG51bGwpOworICAgICAgICBtU3VyZmFjZVRleHR1cmUucmVsZWFzZSgpOworICAgICAgICBtU3VyZmFjZVRleHR1cmUgPSBudWxsOworICAgIH0KKworICAgIEBPdmVycmlkZQorICAgIHB1YmxpYyB2b2lkIHRlYXJEb3duKEZpbHRlckNvbnRleHQgY29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AgICAgICBuZXcgUG9pbnQoMS4wZiwgMS4wZiksCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbmV3IFBvaW50KDAuMGYsIDAuMGYpLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG5ldyBQb2ludCgxLjBmLCAwLjBmKSk7CisKKyAgICBAR2VuZXJhdGVGaWVsZFBvcnQobmFtZSA9ICJ0YXJnZXRRdWFkIiwgaGFzRGVmYXVsdCA9IHRydWUpCisgICAgcHJpdmF0ZSBRdWFkIG1UYXJnZXRRdWFkID0gbmV3IFF1YWQobmV3IFBvaW50KDAuMGYsIDAuMGYpLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG5ldyBQb2ludCgxLjBmLCAwLjBmKSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBuZXcgUG9pbnQoMC4wZiwgMS4wZiksCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbmV3IFBvaW50KDEuMGYsIDEuMGYpKTsKKworICAgIHByaXZhdGUgaW50IG1TdXJmYWNlSWQ7CisKKyAgICBwcml2YXRlIFNoYWRlclByb2dyYW0gbVByb2dyYW07CisgICAgcHJpdmF0ZSBHTEZyYW1lIG1TY3JlZW47CisgICAgcHJpdmF0ZSBpbnQgbVJlbmRlck1vZGUgPSBSRU5ERVJNT0RFX0ZJVDsKKyAgICBwcml2YXRlIGZsb2F0IG1Bc3BlY3RSYXRpbyA9IDEuZjsKKworICAgIHByaXZhdGUgYm9vbGVhbiBtTG9nVmVyYm9zZTsKKyAgICBwcml2YXRlIHN0YXRpYyBmaW5hbCBTdHJpbmcgVEFHID0gIlN1cmZhY2VUZXh0dXJlVGFyZ2V0IjsKKworICAgIHB1YmxpYyBTdXJmYWNlVGV4dHVyZVRhcmdldChTdHJpbmcgbmFtZSkgeworICAgICAgICBzdXBlcihuYW1lKTsKKworICAgICAgICBtTG9nVmVyYm9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tYXQoRnJhbWVGb3JtYXQuVFlQRV9CWVRFLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBGcmFtZUZvcm1hdC5UQVJHRVRfR1BVKTsKKyAgICAgICAgc2NyZWVuRm9ybWF0LnNldEJ5dGVzUGVyU2FtcGxlKDQpOworICAgICAgICBzY3JlZW5Gb3JtYXQuc2V0RGltZW5zaW9ucyhtU2NyZWVuV2lkdGgsIG1TY3JlZW5IZWlnaHQpOworICAgICAgICBtU2NyZWVuID0gKEdMRnJhbWUpY29udGV4dC5nZXRGcmFtZU1hbmFnZXIoKS5uZXdCb3VuZEZyYW1lKHNjcmVlbkZvcm1hdCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBHTEZyYW1lLkVYSVNUSU5HX0ZCT19CSU5ESU5HLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDApOworICAgIH0KKworICAgIEBPdmVycmlkZQorICAgIHB1YmxpYyB2b2lkIG9wZW4oRmlsdGVyQ29udGV4dCBjb250ZXh0KSB7CisgICAgICAgIC8vIFNldCB1cCBTdXJmYWNlVGV4dHVyZSBpbnRlcm5hbHMKKyAgICAgICAgbVN1cmZhY2VJZCA9IGNvbnRleHQuZ2V0R0xFbnZpcm9ubWVudCgpLnJlZ2lzdGVyU3VyZmFjZVRleHR1cmUobVN1cmZhY2VUZXh0dXJlLCBtU2NyZWVuV2lkdGgsIG1TY3JlZW5IZWlnaHQpOworICAgIH0KKworICAgIEBPdmVycmlkZQorICAgIHB1YmxpYyB2b2lkIHByb2Nlc3MoRmlsdGVyQ29udGV4dCBjb250ZXh0KSB7CisgICAgICAgIGlmIChtTG9nVmVyYm9zZSkgTG9nLnYoVEFHLCAiU3RhcnRpbmcgZnJhbWUgcHJvY2Vzc2luZyIpOworCisg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ZyYW1lID0gY29udGV4dC5nZXRGcmFtZU1hbmFnZXIoKS5kdXBsaWNhdGVGcmFtZVRvVGFyZ2V0KGlucHV0LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgRnJhbWVGb3JtYXQuVEFSR0VUX0dQVSk7CisgICAgICAgICAgICBjcmVhdGVkRnJhbWUgPSB0cnVlOworICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgZ3B1RnJhbWUgPSBpbnB1dDsKKyAgICAgICAgfQorCisgICAgICAgIC8vIEFjdGl2YXRlIG91ciBzdXJmYWNlCisgICAgICAgIGdsRW52LmFjdGl2YXRlU3VyZmFjZVdpdGhJZChtU3VyZmFjZUlkKTsKKworICAgICAgICAvLyBQcm9jZXNzCisgICAgICAgIG1Qcm9ncmFtLnByb2Nlc3MoZ3B1RnJhbWUsIG1TY3JlZW4pOworCisgICAgICAgIGdsRW52LnNldFN1cmZhY2VUaW1lc3RhbXAoaW5wdXQuZ2V0VGltZXN0YW1wKCkpOworCisgICAgICAgIC8vIEFuZCBzd2FwIGJ1ZmZlcnMKKyAgICAgICAgZ2xFbnYuc3dhcEJ1ZmZlcnMoKTsKKworICAgICAgICBpZiAoY3JlYXRlZEZyYW1lKSB7CisgICAgICAgICAgICBncHVGcmFtZS5yZWxlYXNlKCk7CisgICAgICAgIH0KKyAgICB9CisKKyAgICBAT3ZlcnJpZGUKKyAgICBwdWJsaWMgdm9pZCBmaWVsZFBvcnRWYWx1ZVVwZGF0ZWQoU3RyaW5nIG5hbWUsIEZpbHRlckNvbnRleHQgY29udGV4dCkgeworICAgICAgICB1cGRhdGVSZW5kZXJNb2RlKCk7CisgICAgfQorCisgICAgQE92ZXJyaWRlCisgICAgcHVibGljIHZvaWQgdGVhckRvd24oRmlsdGVyQ29udGV4dCBjb250ZXh0KSB7CisgICAgICAgIGlmIChtU2NyZWVuICE9IG51bGwpIHsKKyAgICAgICAgICAgIG1TY3JlZW4ucmVsZWFzZSgpOworICAgICAgICB9CisgICAgfQorCisgICAgcHJpdmF0ZSB2b2lkIHVwZGF0ZVRhcmdldFJlY3QoKSB7CisgICAgICAgIGlmIChtU2NyZWVuV2lkdGggPiAwICYmIG1TY3JlZW5IZWlnaHQgPiAwICYmIG1Qcm9ncmFtICE9IG51bGwpIHsKKyAgICAgICAgICAgIGZsb2F0IHNjcmVlbkFzcGVjdFJhdGlvID0gKGZsb2F0KW1TY3JlZW5XaWR0aCAvIG1TY3JlZW5IZWlnaHQ7CisgICAgICAgICAgICBmbG9hdCByZWxhdGl2ZUFzcGVjdFJhdGlvID0gc2NyZWVuQXNwZWN0UmF0aW8gLyBtQXNwZWN0UmF0aW87CisKKyAgICAgICAgICAgIGlmIChyZWxhdGl2ZUFzcGVjdFJhdGlvID09IDEuMGYgJiYgbVJlbmRlck1vZGUgIT0gUkVOREVSTU9ERV9DVVNUT01JWkUpIHsKKyAgICAgICAgICAgICAgICBtUHJvZ3JhbS5zZXRDbGVhcnNPdXRwdXQoZmFsc2UpOworICAgICAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgICAgICBzd2l0Y2ggKG1SZW5kZXJNb2RlKSB7CisgICAgICAgICAgICAgICAgICAgIGNhc2UgUkVOREVSTU9ERV9TVFJFVENIOgorICAgICAgICAgICAgICAgICAgICAgICAgbVByb2dyYW0uc2V0VGFyZ2V0UmVjdCgwLCAwLCAxLCAxKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIG1UYXJnZXRRdWFkLnAwLnNldCgwZiwgMC4wZik7CisgICAgICAgICAgICAgICAgICAgICAgICBtVGFyZ2V0UXVhZC5wMS5zZXQoMWYsIDAuMGYpOworICAgICAgICAgICAgICAgICAgICAgICAgbVRhcmdldFF1YWQucDIuc2V0KDBmLCAxLjBmKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIG1UYXJnZXRRdWFkLnAzLnNldCgxZiwgMS4wZik7CisgICAgICAgICAgICAgICAgICAgICAgICBtUHJvZ3JhbS5zZXRDbGVhcnNPdXRwdXQoZmFsc2UpOworICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgICAgIGNhc2UgUkVOREVSTU9ERV9GSVQ6CisgICAgICAgICAgICAgICAgICAgICAgICBpZiAocmVsYXRpdmVBc3BlY3RSYXRpbyA+IDEuMGYpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyBTY3JlZW4gaXMgd2lkZXIgdGhhbiB0aGUgY2FtZXJhLCBzY2FsZSBkb3duIFgKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBtVGFyZ2V0UXVhZC5wMC5zZXQoMC41ZiAtIDAuNWYgLyByZWxhdGl2ZUFzcGVjdFJhdGlvLCAwLjBmKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBtVGFyZ2V0UXVhZC5wMS5zZXQoMC41ZiArIDAuNWYgLyByZWxhdGl2ZUFzcGVjdFJhdGlvLCAwLjBmKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBtVGFyZ2V0UXVhZC5wMi5zZXQoMC41ZiAtIDAuNWYgLyByZWxhdGl2ZUFzcGVjdFJhdGlvLCAxLjBmKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBtVGFyZ2V0UXVhZC5wMy5zZXQoMC41ZiArIDAuNWYgLyByZWxhdGl2ZUFzcGVjdFJhdGlvLCAxLjBmKTsKKworICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyBTY3JlZW4gaXMgdGFsbGVyIHRoYW4gdGhlIGNhbWVyYSwgc2NhbGUgZG93biBZCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgbVRhcmdldFF1YWQucDAuc2V0KDAuMGYsIDAuNWYgLSAwLjVmICogcmVsYXRpdmVBc3BlY3RSYXRpbyk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgbVRhcmdldFF1YWQucDEuc2V0KDEuMGYsIDAuNWYgLSAwLjVmICogcmVsYXRpdmVBc3BlY3RSYXRpbyk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgbVRhcmdldFF1YWQucDIuc2V0KDAuMGYsIDAuNWYgKyAwLjVmICogcmVsYXRpdmVBc3BlY3RSYXRpbyk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgbVRhcmdldFF1YWQucDMuc2V0KDEuMGYsIDAuNWYgKyAwLjVmICogcmVsYXRpdmVBc3BlY3RSYXRpbyk7CisgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICBtUHJvZ3JhbS5zZXRDbGVhcnNPdXRwdXQodHJ1ZSk7CisgICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICAgICAgY2FzZSBSRU5ERVJNT0RFX0ZJTExfQ1JPUDoKKyAgICAgICAgICAgICAgICAgICAgICAgIGlmIChyZWxhdGl2ZUFzcGVjdFJhdGlvID4gMSkgeworICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vIFNjcmVlbiBpcyB3aWRlciB0aGFuIHRoZSBjYW1lcmEsIGNyb3AgaW4gWQorICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1UYXJnZXRRdWFkLnAwLnNldCgwLjBmLCAwLjVmIC0gMC41ZiAqIHJlbGF0aXZlQXNwZWN0UmF0aW8pOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1UYXJnZXRRdWFkLnAxLnNldCgxLjBmLCAwLjVmIC0gMC41ZiAqIHJlbGF0aXZlQXNwZWN0UmF0aW8pOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1UYXJnZXRRdWFkLnAyLnNldCgwLjBmLCAwLjVmICsgMC41ZiAqIHJlbGF0aXZlQXNwZWN0UmF0aW8pOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1UYXJnZXRRdWFkLnAzLnNldCgxLjBmLCAwLjVmICsgMC41ZiAqIHJlbGF0aXZlQXNwZWN0UmF0aW8pOworICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyBTY3JlZW4gaXMgdGFsbGVyIHRoYW4gdGhlIGNhbWVyYSwgY3JvcCBpbiBYCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgbVRhcmdldFF1YWQucDAuc2V0KDAuNWYgLSAwLjVmIC8gcmVsYXRpdmVBc3BlY3RSYXRpbywgMC4wZik7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgbVRhcmdldFF1YWQucDEuc2V0KDAuNWYgKyAwLjVmIC8gcmVsYXRpdmVBc3BlY3RSYXRpbywgMC4wZik7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgbVRhcmdldFF1YWQucDIuc2V0KDAuNWYgLSAwLjVmIC8gcmVsYXRpdmVBc3BlY3RSYXRpbywgMS4wZik7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgbVRhcmdldFF1YWQucDMuc2V0KDAuNWYgKyAwLjVmIC8gcmVsYXRpdmVBc3BlY3RSYXRpbywgMS4wZik7CisgICAgICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgICAgICBtUHJvZ3JhbS5zZXRDbGVhcnNPdXRwdXQodHJ1ZSk7CisgICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICAgICAgY2FzZSBSRU5ERVJNT0RFX0NVU1RPTUlaRToKKyAgICAgICAgICAgICAgICAgICAgICAgICgoU2hhZGVyUHJvZ3JhbSkgbVByb2dyYW0pLnNldFNvdXJjZVJlZ2lvbihtU291cmNlUXVhZCk7CisgICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgKChTaGFkZXJQcm9ncmFtKSBtUHJvZ3JhbSkuc2V0VGFyZ2V0UmVnaW9uKG1UYXJnZXRRdWFkKTsKKyAgICAgICAgICAgIH0KKyAgICAgICA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ld19sZW5ndGggLyBsZW5ndGg7CisgIHJldHVybiB0cnVlOworfQorCitmbG9hdCBQb2ludDo6RGlzdGFuY2UoY29uc3QgUG9pbnQmIHAwLCBjb25zdCBQb2ludCYgcDEpIHsKKyAgUG9pbnQgZGlmZiA9IHAxIC0gcDA7CisgIHJldHVybiBkaWZmLkxlbmd0aCgpOworfQorCitQb2ludCBQb2ludDo6b3BlcmF0b3IrKGNvbnN0IFBvaW50JiBvdGhlcikgY29uc3QgeworICBQb2ludCBvdXQ7CisgIG91dC54XyA9IHhfICsgb3RoZXIueF87CisgIG91dC55XyA9IHlfICsgb3RoZXIueV87CisgIHJldHVybiBvdXQ7Cit9CisKK1BvaW50IFBvaW50OjpvcGVyYXRvci0oY29uc3QgUG9pbnQmIG90aGVyKSBjb25zdCB7CisgIFBvaW50IG91dDsKKyAgb3V0LnhfID0geF8gLSBvdGhlci54XzsKKyAgb3V0LnlfID0geV8gLSBvdGhlci55XzsKKyAgcmV0dXJuIG91dDsKK30KKworUG9pbnQgUG9pbnQ6Om9wZXJhdG9yKihmbG9hdCBmYWN0b3IpIGNvbnN0IHsKKyAgUG9pbnQgb3V0OworICBvdXQueF8gPSBmYWN0b3IgKiB4XzsKKyAgb3V0LnlfID0gZmFjdG9yICogeV87CisgIHJldHVybiBvdXQ7Cit9CisKK3ZvaWQgUG9pbnQ6OlJvdGF0ZTkwQ2xvY2t3aXNlKCkgeworICBjb25zdCBmbG9hdCB4ID0geF87CisgIHhfID0geV87CisgIHlfID0gLXg7Cit9CisKK2Jvb2wgUmVjdDo6RXhwYW5kVG9Bc3BlY3RSYXRpbyhmbG9hdCByYXRpbykgeworICBpZiAod2lkdGggPD0gMC4wZiB8fCBoZWlnaHQgPD0gMC4wZiB8fCByYXRpbyA8PSAwLjBmKSB7CisgICAgcmV0dXJuIGZhbHNlOworICB9CisKKyAgY29uc3QgZmxvYXQgY3VycmVudF9yYXRpbyA9IHdpZHRoIC8gaGVpZ2h0OworICBpZiAoY3VycmVudF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Hx8IGhlaWdodCA8PSAwLjBmIHx8IGZhY3RvciA8PSAwLjBmKSB7CisgICAgcmV0dXJuIGZhbHNlOworICB9CisKKyAgY29uc3QgZmxvYXQgY3VycmVudF9sZW5ndGggPSB3aWR0aCA+IGhlaWdodCA/IHdpZHRoIDogaGVpZ2h0OworICBpZiAoY3VycmVudF9sZW5ndGggPj0gbWF4X2xlbmd0aCkgeworICAgIHJldHVybiB0cnVlOworICB9CisKKyAgZmxvYXQgZiA9IGZhY3RvcjsKKyAgaWYgKGN1cnJlbnRfbGVuZ3RoICogZiA+IG1heF9sZW5ndGgpIHsKKyAgICBmICo9IG1heF9sZW5ndGggLyAoY3VycmVudF9sZW5ndGggKiBmKTsKKyAgfQorCisgIGNvbnN0IGZsb2F0IGR4ID0gd2lkdGggKiAoZiAtIDEuMGYpOworICB4IC09IGR4IC8gMi4wZjsKKyAgd2lkdGggKz0gZHg7CisgIGNvbnN0IGZsb2F0IGR5ID0gaGVpZ2h0ICogKGYgLSAxLjBmKTsKKyAgeSAtPSBkeSAvIDIuMGY7CisgIGhlaWdodCArPSBkeTsKKyAgcmV0dXJuIHRydWU7Cit9CisKK2NvbnN0IFBvaW50JiBRdWFkOjpwb2ludChpbnQgaXgpIGNvbnN0IHsKKyAgQUxPR19BU1NFUlQoaXggPCBzdGF0aWNfY2FzdDxpbnQ+KHBvaW50c18uc2l6ZSgpKSwgIkFjY2VzcyBvdXQgb2YgYm91bmRzIik7CisgIHJldHVybiBwb2ludHNfW2l4XTsKK30KKworYm9vbCBTbGFudGVkUmVjdDo6RnJvbUNlbnRlckF4aXNBbmRMZW5ndGhzKGNvbnN0IFBvaW50JiBjZW50ZXIsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY29uc3QgUG9pbnQmIHZlcnRfYXhpcywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb25zdCBQb2ludCYgbGVuZ3RocykgeworICBQb2ludCBkeSA9IHZ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bnQ2NF90KTEwMDAwMDAgKworICAgICAgICAgICAgICAodWludDY0X3QpdHYudHZfdXNlYzsKKyAgICByZXR1cm4gbm93dGltZTsKK30KKworY29uc3QgdWludDY0X3QgTmFtZWRTdG9wV2F0Y2g6OmtEZWZhdWx0TG9nZ2luZ1BlcmlvZEluRnJhbWVzID0gMTAwOworCitOYW1lZFN0b3BXYXRjaDo6TmFtZWRTdG9wV2F0Y2goY29uc3Qgc3RkOjpzdHJpbmcmIG5hbWUpCisgICAgICA6IG1OYW1lKG5hbWUpLAorICAgICAgICBtTG9nZ2luZ1BlcmlvZEluRnJhbWVzKGtEZWZhdWx0TG9nZ2luZ1BlcmlvZEluRnJhbWVzKSwKKyAgICAgICAgbVN0YXJ0VVNlYygwKSwKKyAgICAgICAgbU51bUNhbGxzKDApLAorICAgICAgICBtVG90YWxVU2VjKDApIHsKK30KKwordm9pZCBOYW1lZFN0b3BXYXRjaDo6U3RhcnQoKSB7CisgICAgbVN0YXJ0VVNlYyA9IGdldFRpbWVVcygpOworfQorCit2b2lkIE5hbWVkU3RvcFdhdGNoOjpTdG9wKCkgeworICAgIGlmICghbVN0YXJ0VVNlYykgeworICAgICAgICByZXR1cm47CisgICAgfQorICAgIHVpbnQ2NF90IHN0b3BVU2VjID0gZ2V0VGltZVVzKCk7CisgICAgaWYgKHN0b3BVU2VjID4gbVN0YXJ0VVNlYykgeworICAgICAgICArK21OdW1DYWxsczsKKyAgICAgICAgbVRvdGFsVVNlYyArPSBzdG9wVVNlYyAtIG1TdGFydFVTZWM7CisgICAgICAgIGlmIChtTnVtQ2FsbHMgJSBtTG9nZ2luZ1BlcmlvZEluRnJhbWVzID09IDApIHsKKyAgICAgICAgICAgIGNvbnN0IGZsb2F0IG1TZWMgPSBUb3RhbFVTZWMoKSAqIDEuMEUtM2YgLyBOdW1DYWxscygpOworICAgICAgICAgICAgQUxPR0UoIiVzOiAlZiBtcyIsIE5hbWUoKS5jX3N0cigpLCBtU2VjKTsKKyAgICAgICAgf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BUkdTX18pCisjZGVmaW5lICBMT0dFKC4uLikgX19hbmRyb2lkX2xvZ19wcmludChBTkRST0lEX0xPR19FUlJPUiwgIk1DQSIsIF9fVkFfQVJHU19fKQorCit0eXBlZGVmIHN0cnVjdCB7CisgIGZsb2F0IGJyaWdodG5lc3M7Cit9IEJyaWdodG5lc3NQYXJhbWV0ZXJzOworCit0eXBlZGVmIHVuaW9uIHsKKyAgICBpbnQgdmFsdWU7CisgICAgY2hhciByZ2JhWzRdOworfSBQaXhlbDsKKwordm9pZCBicmlnaHRuZXNzX2luaXQodm9pZCoqIHVzZXJfZGF0YSkgeworICAoKnVzZXJfZGF0YSkgPSBtYWxsb2Moc2l6ZW9mKEJyaWdodG5lc3NQYXJhbWV0ZXJzKSk7Cit9CisKK3ZvaWQgYnJpZ2h0bmVzc190ZWFyZG93bih2b2lkKiB1c2VyX2RhdGEpIHsKKyAgZnJlZSh1c2VyX2RhdGEpOworfQorCit2b2lkIGJyaWdodG5lc3Nfc2V0dmFsdWUoY29uc3QgY2hhcioga2V5LCBjb25zdCBjaGFyKiB2YWx1ZSwgdm9pZCogdXNlcl9kYXRhKSB7CisgIGlmIChzdHJjbXAoa2V5LCAiYnJpZ2h0bmVzcyIpID09IDApCisgICAgKChCcmlnaHRuZXNzUGFyYW1ldGVycyopdXNlcl9kYXRhKS0+YnJpZ2h0bmVzcyA9IGF0b2YodmFsdWUpOworICBlbHNlCisgICAgTE9HRSgiVW5rbm93biBwYXJhbWV0ZXI6ICVzISIsIGtleSk7Cit9CisKK2ludCBicmlnaHRuZXNzX3Byb2Nlc3MoY29uc3QgY2hhcioqIGlucHV0cywKKyAgICAgICAgICAgICAgICAgICAgICAgY29uc3QgaW50KiBpbnB1dF9zaXplcywKKyAgICAgICAgICAgICAgICAgICAgICAgaW50IGlucHV0X2NvdW50LAorICAgICAgICAgICAgICAgICAgICAgICBjaGFyKiBvdXRwdXQsCisgICAgICAgICAgICAgICAgICAgICAgIGludCBvdXRwdXRfc2l6ZS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WZpbmUgIExPR0UoLi4uKSBfX2FuZHJvaWRfbG9nX3ByaW50KEFORFJPSURfTE9HX0VSUk9SLCAiTUNBIiwgX19WQV9BUkdTX18pCisKK3R5cGVkZWYgc3RydWN0IHsKKyAgZmxvYXQgY29udHJhc3Q7Cit9IENvbnRyYXN0UGFyYW1ldGVyczsKKwordm9pZCBjb250cmFzdF9pbml0KHZvaWQqKiB1c2VyX2RhdGEpIHsKKyAgKCp1c2VyX2RhdGEpID0gbWFsbG9jKHNpemVvZihDb250cmFzdFBhcmFtZXRlcnMpKTsKK30KKwordm9pZCBjb250cmFzdF90ZWFyZG93bih2b2lkKiB1c2VyX2RhdGEpIHsKKyAgZnJlZSh1c2VyX2RhdGEpOworfQorCit2b2lkIGNvbnRyYXN0X3NldHZhbHVlKGNvbnN0IGNoYXIqIGtleSwgY29uc3QgY2hhciogdmFsdWUsIHZvaWQqIHVzZXJfZGF0YSkgeworICBpZiAoc3RyY21wKGtleSwgImNvbnRyYXN0IikgPT0gMCkKKyAgICAoKENvbnRyYXN0UGFyYW1ldGVycyopdXNlcl9kYXRhKS0+Y29udHJhc3QgPSBhdG9mKHZhbHVlKTsKKyAgZWxzZQorICAgIExPR0UoIlVua25vd24gcGFyYW1ldGVyOiAlcyEiLCBrZXkpOworfQorCitpbnQgY29udHJhc3RfcHJvY2Vzcyhjb25zdCBjaGFyKiogaW5wdXRzLAorICAgICAgICAgICAgICAgICAgICAgY29uc3QgaW50KiBpbnB1dF9zaXplcywKKyAgICAgICAgICAgICAgICAgICAgIGludCBpbnB1dF9jb3VudCwKKyAgICAgICAgICAgICAgICAgICAgIGNoYXIqIG91dHB1dCwKKyAgICAgICAgICAgICAgICAgICAgIGludCBvdXRwdXRfc2l6ZSwKKyAgICAgICAgICAgICAgICAgICAgIHZvaWQqIHVzZXJfZGF0YSkgeworICAvLyBNYWtlIHN1cmUgd2UgaGF2ZSBleGFjdGx5IG9uZSBpbnB1dAorICBpZiAoaW5wdXRfY291bnQgIT0gMSk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VRIT1VUIFdBUlJBTlRJRVMgT1IgQ09ORElUSU9OUyBPRiBBTlkgS0lORCwgZWl0aGVyIGV4cHJlc3Mgb3IgaW1wbGllZC4KKyAqIFNlZSB0aGUgTGljZW5zZSBmb3IgdGhlIHNwZWNpZmljIGxhbmd1YWdlIGdvdmVybmluZyBwZXJtaXNzaW9ucyBhbmQKKyAqIGxpbWl0YXRpb25zIHVuZGVyIHRoZSBMaWNlbnNlLgorICovCisKKyNpbmNsdWRlIDxhbmRyb2lkL2xvZy5oPgorCitpbnQgaW52ZXJ0X3Byb2Nlc3MoY29uc3QgY2hhcioqIGlucHV0cywKKyAgICAgICAgICAgICAgICAgICBjb25zdCBpbnQqIGlucHV0X3NpemVzLAorICAgICAgICAgICAgICAgICAgIGludCBpbnB1dF9jb3VudCwKKyAgICAgICAgICAgICAgICAgICBjaGFyKiBvdXRwdXQsCisgICAgICAgICAgICAgICAgICAgaW50IG91dHB1dF9zaXplLAorICAgICAgICAgICAgICAgICAgIHZvaWQqIHVzZXJfZGF0YSkgeworICAvLyBNYWtlIHN1cmUgd2UgaGF2ZSBleGFjdGx5IG9uZSBpbnB1dAorICBpZiAoaW5wdXRfY291bnQgIT0gMSkKKyAgICByZXR1cm4gMDsKKworICAvLyBNYWtlIHN1cmUgc2l6ZXMgbWF0Y2ggdXAKKyAgaWYgKGlucHV0X3NpemVzWzBdICE9IG91dHB1dF9zaXplKQorICAgIHJldHVybiAwOworCisgIC8vIEdldCB0aGUgaW5wdXQgYW5kIG91dHB1dCBwb2ludGVycworICBjb25zdCBjaGFyKiBpbnB1dF9wdHIgPSBpbnB1dHNbMF07CisgIGNoYXIqIG91dHB1dF9wdHIgPSBvdXRwdXQ7CisgIGlmICghaW5wdXRfcHRyIHx8ICFvdXRwdXRfcHRyKQorICAgIHJldHVybiAwOworCisgIC8vIFJ1biB0aGUgaW52ZXJzaW9uCisgIGludCBpOworICBmb3IgKGkgPSAwOyBpIDwgb3V0cHV0X3NpemU7ICsraSkKKyAg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ZXNzIG9yIGltcGxpZWQuCisgKiBTZWUgdGhlIExpY2Vuc2UgZm9yIHRoZSBzcGVjaWZpYyBsYW5ndWFnZSBnb3Zlcm5pbmcgcGVybWlzc2lvbnMgYW5kCisgKiBsaW1pdGF0aW9ucyB1bmRlciB0aGUgTGljZW5zZS4KKyAqLworCisjaW5jbHVkZSA8c3RkbGliLmg+CisKK2ludCBncmF5X3RvX3JnYl9wcm9jZXNzKGNvbnN0IGNoYXIqKiBpbnB1dHMsCisgICAgICAgICAgICAgICAgICAgICAgICBjb25zdCBpbnQqIGlucHV0X3NpemVzLAorICAgICAgICAgICAgICAgICAgICAgICAgaW50IGlucHV0X2NvdW50LAorICAgICAgICAgICAgICAgICAgICAgICAgY2hhciogb3V0cHV0LAorICAgICAgICAgICAgICAgICAgICAgICAgaW50IG91dHB1dF9zaXplLAorICAgICAgICAgICAgICAgICAgICAgICAgdm9pZCogdXNlcl9kYXRhKSB7CisgIC8vIE1ha2Ugc3VyZSB3ZSBoYXZlIGV4YWN0bHkgb25lIGlucHV0CisgIGlmIChpbnB1dF9jb3VudCAhPSAxKQorICAgIHJldHVybiAwOworCisgIC8vIE1ha2Ugc3VyZSBzaXplcyBtYXRjaCB1cAorICBpZiAoaW5wdXRfc2l6ZXNbMF0gIT0gb3V0cHV0X3NpemUvMykKKyAgICByZXR1cm4gMDsKKworICAvLyBHZXQgdGhlIGlucHV0IGFuZCBvdXRwdXQgcG9pbnRlcnMKKyAgY29uc3QgY2hhciogaW5wdXRfcHRyID0gaW5wdXRzWzBdOworICBjaGFyKiBvdXRwdXRfcHRyID0gb3V0cHV0OworICBpZiAoIWlucHV0X3B0ciB8fCAhb3V0cHV0X3B0cikKKyAgICByZXR1cm4gMDsKKworICAvLyBSdW4gdGhlIGNvbnZlcnNpb24KKyAgaW50IGk7CisgIGZvciAoaSA9IDA7IGkgPCBpbnB1dF9zaXplc1swXTsgKytpKSB7CisgICAgKihvdXRwdXRfcHRyKyspID0gKihpbnB1dF9wdHIpOworICAgICoob3V0cHV0X3B0cisrKSA9ICooaW5wdXRfcHRyKTsKKyAgICAqKG91dHB1dF9wdHIrKykgPSAqKGlucHV0X3B0cisrKTsKKyAgfQorCisgIHJldHVybiAxOworfQorCitpbnQgcmdiYV90b19yZ2JfcHJvY2Vzcyhjb25zdCBjaGFyKiogaW5wdXRzLAorICAgICAgICAgICAgICAgICAgICAgICAgY29uc3QgaW50KiBpbnB1dF9zaXplcywKKyAgICAgICAgICAgICAgICAgICAgICAgIGludCBpbnB1dF9jb3VudCwKKyAgICAgICAgICAgICAgICAgICAgICAgIGNoYXIqIG91dHB1dCwKKyAgICAgICAgICAgICAgICAgICAgICAgIGludCBvdXRwdXRfc2l6ZSwKKyAgICAgICAgICAgICAgICAgICAgICAgIHZvaWQqIHVzZXJfZGF0YSkgeworICAvLyBNYWtlIHN1cmUgd2UgaGF2ZSBleGFjdGx5IG9uZSBpbnB1dAorICBpZiAoaW5wdXRfY291bnQgIT0gMSkKKyAgICByZXR1cm4gMDsKKworICAvLyBNYWtlIHN1cmUgc2l6ZXMgbWF0Y2ggdXAKKyAgaWYgKGlucHV0X3NpemVzWzBdLzQgIT0gb3V0cHV0X3NpemUvMykKKyAgICByZXR1cm4gMDsKKworICAvLyBHZXQgdGhlIGlucHV0IGFuZCBvdXRwdXQgcG9pbnRlcnMKKyAgY29uc3QgY2hhciogaW5wdXRfcHRyID0gaW5wdXRzWzBdOworICBjaGFyKiBvdXRwdXRfcHRyID0gb3V0cHV0OworICBpZiAoIWlucHV0X3B0ciB8fCAhb3V0cHV0X3B0cikKKyAgICByZXR1cm4gMDsKKworICAvLyBSdW4gdGhlIGNvbnZlcnNpb24KKyAgaW50IGk7CisgIGZvciAoaSA9IDA7IGkgPCBpbnB1dF9zaXplc1swXSAvIDQ7ICsraSkgeworICAgICoob3V0cHV0X3B0cisrKSA9ICooaW5wdXRfcHRyKyspOworICAgICoob3V0cHV0X3B0cisrKSA9ICooaW5wdXRfcHRyKyspOworICAgICoob3V0cHV0X3B0cisrKSA9ICooaW5wdXRfcHRyKyspOworICAgICsraW5wdXRfcHRyOworICB9CisKKyAgcmV0dXJuIDE7Cit9CisKK2ludCBncmF5X3RvX3JnYmFfcHJvY2Vzcyhjb25zdCBjaGFyKiogaW5wdXRzLAorICAgICAgICAgICAgICAgICAgICAgICAgIGNvbnN0IGludCogaW5wdXRfc2l6ZXMsCisgICAgICAgICAgICAgICAgICAgICAgICAgaW50IGlucHV0X2NvdW50LAorICAgICAgICAgICAgICAgICAgICAgICAgIGNoYXIqIG91dHB1dCwKKyAgICAgICAgICAgICAgICAgICAgICAgICBpbnQgb3V0cHV0X3NpemUsCisgICAgICAgICAgICAgICAgICAgICAgICAgdm9pZCogdXNlcl9kYXRhKSB7CisgIC8vIE1ha2Ugc3VyZSB3ZSBoYXZlIGV4YWN0bHkgb25lIGlucHV0CisgIGlmIChpbnB1dF9jb3VudCAhPSAxKQorICAgIHJldHVybiAwOworCisgIC8vIE1ha2Ugc3VyZSBzaXplcyBtYXRjaCB1cAorICBpZiAoaW5wdXRfc2l6ZXNbMF0gIT0gb3V0cHV0X3NpemUvNCkKKyAgICByZXR1cm4gMDsKKworICAvLyBHZXQgdGhlIGlucHV0IGFuZCBvdXRwdXQgcG9pbnRlcnMKKyAgY29uc3QgY2hhciogaW5wdXRfcHRyID0gaW5wdXRzWzBdOworICBjaGFyKiBvdXRwdXRfcHRyID0gb3V0cHV0OworICBpZiAoIWlucHV0X3B0ciB8fCAhb3V0cHV0X3B0cikKKyAgICByZXR1cm4gMDsKKworICAvLyBSdW4gdGhlIGNvbnZlcnNpb24KKyAgaW50IGk7CisgIGZvciAoaSA9IDA7IGkgPCBpbnB1dF9zaXplc1swXTsgKytpKSB7CisgICAgKihvdXRwdXRfcHRyKyspID0gKihpbnB1dF9wdHIpOworICAgICoob3V0cHV0X3B0cisrKSA9ICooaW5wdXRfcHRyKTsKKyAgICAqKG91dHB1dF9wdHIrKykgPSAqKGlucHV0X3B0cisrKTsKKyAgICAqKG91dHB1dF9wdHIrKykgPSAyNTU7CisgIH0KKworICByZXR1cm4gMTsKK30KKworaW50IHJnYl90b19yZ2JhX3Byb2Nlc3MoY29uc3QgY2hhcioqIGlucHV0cywKKyAgICAgICAgICAgICAgICAgICAgICAgIGNvbnN0IGludCogaW5wdXRfc2l6ZXMsCisgICAgICAgICAgICAgICAgICAgICAgICBpbnQgaW5wdXRfY291bnQsCisgICAgICAgICAgICAgICAgICAgICAgICBjaGFyKiBvdXRwdXQsCisgICAgICAgICAgICAgICAgICAgICAgICBpbnQgb3V0cHV0X3NpemUsCisgICAgICAgICAgICAgICAgICAgICAgICB2b2lkKiB1c2VyX2RhdGEpIHsKKyAgLy8gTWFrZSBzdXJlIHdlIGhhdmUgZXhhY3RseSBvbmUgaW5wdXQKKyAgaWYgKGlucHV0X2NvdW50ICE9IDEpCisgICAgcmV0dXJuIDA7CisKKyAgLy8gTWFrZSBzdXJlIHNpemVzIG1hdGNoIHVwCisgIGlmIChpbnB1dF9zaXplc1swXS8zICE9IG91dHB1dF9zaXplLzQpCisgICAgcmV0dXJuIDA7CisKKyAgLy8gR2V0IHRoZSBpbnB1dCBhbmQgb3V0cHV0IHBvaW50ZXJzCisgIGNvbnN0IGNoYXIqIGlucHV0X3B0ciA9IGlucHV0c1swXTsKKyAgY2hhciogb3V0cHV0X3B0ciA9IG91dHB1dDsKKyAgaWYgKCFpbnB1dF9wdHIgfHwgIW91dHB1dF9wdHIpCisgICAgcmV0dXJuIDA7CisKKyAgLy8gUnVuIHRoZSBjb252ZXJzaW9uCisgIGludCBpOworICBmb3IgKGkgPSAwOyBpIDwgb3V0cHV0X3NpemUgLyA0OyArK2kpIHsKKyAgICAqKG91dHB1dF9wdHIrKykgPSAqKGlucHV0X3B0cisrKTsKKyAgICAqKG91dHB1dF9wdHIrKykgPSAqKGlucHV0X3B0cisrKTsKKyAgICAqKG91dHB1dF9wdHIrKykgPSAqKGlucHV0X3B0cisrKTsKKyAgICAqKG91dHB1dF9wdHIrK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dmVHZXQlcyhpbmRleCk7XG4iXAorICAgICAgICAgICAiICAgIH0iICUgKHNlbGYuamF2YXR5cGUsIFRvSmF2YU5hbWUoc2VsZi5uYW1lLCAwKSwgVG9KYXZhTmFtZShzZWxmLm5hbWUsIDApKQorCisgIGRlZiBqYXZhU2V0dGVyKHNlbGYpOgorICAgIHJldHVybiAiICAgIHB1YmxpYyB2b2lkIHNldCVzKGludCBpbmRleCwgJXMgdmFsdWUpIHtcbiJcCisgICAgICAgICAgICIgICAgICAgIGFzc2VydFdyaXRhYmxlKCk7XG4iXAorICAgICAgICAgICAiICAgICAgICBuYXRpdmVTZXQlcyhpbmRleCwgdmFsdWUpO1xuIlwKKyAgICAgICAgICAgIiAgICB9IiAlIChUb0phdmFOYW1lKHNlbGYubmFtZSwgMCksIHNlbGYuamF2YXR5cGUsIFRvSmF2YU5hbWUoc2VsZi5uYW1lLCAwKSkKKworICBkZWYgamF2YU5hdGl2ZUdldHRlcihzZWxmKToKKyAgICByZXR1cm4gIiAgICBwcml2YXRlIG5hdGl2ZSAlcyBuYXRpdmVHZXQlcyhpbnQgaW5kZXgpOyJcCisgICAgICAgICAgICUgKHNlbGYuamF2YXR5cGUsIFRvSmF2YU5hbWUoc2VsZi5uYW1lLCAwKSkKKworICBkZWYgamF2YU5hdGl2ZVNldHRlcihzZWxmKToKKyAgICByZXR1cm4gIiAgICBwcml2YXRlIG5hdGl2ZSBib29sZWFuIG5hdGl2ZVNldCVzKGludCBpbmRleCwgJXMgdmFsdWUpOyJcCisgICAgICAgICAgICUgKFRvSmF2YU5hbWUoc2VsZi5uYW1lLCAwKSwgc2VsZi5qYXZhdHlwZSkKKworICBkZWYgam5pR2V0dGVyRGVmU3RyaW5nKHNlbGYpOgorICAgIHJldHVybiAiSk5JRVhQT1JUICVzIEpOSUNBTExcbiIgXAorICAgICAgICAgICAiSmF2YV8lc19uYXRpdmVHZXQlcyhKTklFbnYqIGVudiwgam9iamVjdCB0aGl6LCBqaW50IGluZGV4KTsi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nIG1pc3NpbmchIikKKyAgICBlbGlmIG5vdCBzZWxmLmxpYm5hbWU6CisgICAgICByYWlzZSBQYXJzZUVycm9yKGxpbmVubywgIlJlcXVpcmVkIGZpZWxkICdAbGlibmFtZScgbWlzc2luZyEiKQorCisgICAgIyBOb3JtYWxpemUgdmFsdWVzCisgICAgaWYgc2VsZi5saWJuYW1lWzozXSA9PSAibGliIjoKKyAgICAgIHNlbGYubGlibmFtZSA9IHNlbGYubGlibmFtZVszOl0KKworICBkZWYgY29tbWFuZEFyZ0Fzc2VydChzZWxmLCBsaW5lY29tcHMsIGV4cGVjdGVkY291bnQsIGxpbmVubyk6CisgICAgZm91bmRjb3VudCA9IGxlbihsaW5lY29tcHMpIC0gMQorICAgIGlmIGZvdW5kY291bnQgPCBleHBlY3RlZGNvdW50OgorICAgICAgcmFpc2UgUGFyc2VFcnJvcihsaW5lbm8sICJOb3QgZW5vdWdoIGFyZ3VtZW50cyBzcGVjaWZlZCBmb3IgY29tbWFuZCAnJXMnISBFeHBlY3RlZCAlZCwgIiBcCisgICAgICAgICAgICAgICAgICAgICAgICJidXQgZ290IG9ubHkgJWQhIiAlIChsaW5lY29tcHNbMF0sIGV4cGVjdGVkY291bnQsIGZvdW5kY291bnQpKQorICAgIGVsaWYgZm91bmRjb3VudCA+IGV4cGVjdGVkY291bnQgKyAxOgorICAgICAgcmFpc2UgUGFyc2VFcnJvcihsaW5lbm8sICJUb28gbWFueSBhcmd1bWVudHMgc3BlY2lmZWQgZm9yIGNvbW1hbmQgJyVzJyEgRXhwZWN0ZWQgJWQsICIgXAorICAgICAgICAgICAgICAgICAgICAgICAiYnV0IGdvdCAlZCEiICUgKGxpbmVjb21wc1swXSwgZXhwZWN0ZWRjb3VudCwgZm91bmRjb3VudCkpCisKKworICBkZWYgY1N0cnVjdFN0cmluZyhzZWxmKToKKyAgICBjZmllbGRzID0gW2YuY1N0cmluZygpIGZvciBmIGluIHNlbGYuZmllbGRzXQorICAgIHJldHVybiAidHlwZWRlZiBzdHJ1Y3QgU3RydWN0JXMge1xuJXNcbn0gJXM7XG4iICUgKHNlbGYuc3RydWN0bmFtZSxcCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIlxuIi5qb2luKGNmaWVsZHMpLFwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzZWxmLnN0cnVjdG5hbWUpCisKKyAgZGVmIGphdmFDbGFzc1N0cmluZyhzZWxmKToKKyAgICBqZ2V0dGVycyA9IFtmLmphdmFHZXR0ZXIoKSBmb3IgZiBpbiBzZWxmLmZpZWxkc10KKyAgICBqc2V0dGVycyA9IFtmLmphdmFTZXR0ZXIoKSBmb3IgZiBpbiBzZWxmLmZpZWxkc10KKyAgICBqbmF0aXZlc2V0dGVycyA9IFtmLmphdmFOYXRpdmVTZXR0ZXIoKSBmb3IgZiBpbiBzZWxmLmZpZWxkc10KKyAgICBqbmF0aXZlZ2V0dGVycyA9IFtmLmphdmFOYXRpdmVHZXR0ZXIoKSBmb3IgZiBpbiBzZWxmLmZpZWxkc10KKyAgICByZXR1cm4gInB1YmxpYyBjbGFzcyAlcyBleHRlbmRzIE5hdGl2ZUJ1ZmZlciB7XG5cbiJcCisgICAgICAgICAgICIgICAgcHVibGljICVzKCkge1xuIlwKKyAgICAgICAgICAgIiAgICAgICAgc3VwZXIoKTtcbiJcCisgICAgICAgICAgICIgICAgfVxuIlwKKyAgICAgICAgICAgIlxuIlwKKyAgICAgICAgICAgIiAgICBwdWJsaWMgJXMoaW50IGNvdW50KSB7XG4iXAorICAgICAgICAgICAiICAgICAgICBzdXBlcihjb3VudCk7XG4iXAorICAgICAgICAgICAiICAgIH1cbiJcCisgICAgICAgICAgICJcbiJcCisgICAgICAgICAgICIgICAgcHVibGljIG5hdGl2ZSBpbnQgZ2V0RWxlbWVudFNpemUoKTtcbiJcCisgICAgICAgICAgICJcbiJcCisgICAgICAgICAgICIlc1xuXG4iXAorICAgICAgICAgICAiJXNcblxuIlwKKyAgICAgICAgICAgIiVzXG5cbiJcCisgICAgICAgICAgICIlc1xuXG4iXAorICAgICAgICAgICAiICAgIHN0YXRpYyB7XG4iXAorICAgICAgICAgICAiICAgICAgICBTeXN0ZW0ubG9hZExpYnJhcnkoXCIlc1wiKTtcbiJcCisgICAgICAgICAgICIgICAgfVxuIlwKKyAgICAgICAgICAgIlxuIlwKKyAgICAgICAgICAgIn07XG4iICUgKHNlbGYuamNsYXNzbmFtZSxcCisgICAgICAgICAgICAgICAgICAgICBzZWxmLmpjbGFzc25hbWUsXAorICAgICAgICAgICAgICAgICAgICAgc2VsZi5qY2xhc3NuYW1lLFwKKyAgICAgICAgICAgICAgICAgICAgICJcblxuIi5qb2luKGpnZXR0ZXJzKSxcCisgICAgICAgICAgICAgICAgICAgICAiXG5cbiIuam9pbihqc2V0dGVycyksXAorICAgICAgICAgICAgICAgICAgICAgIlxuXG4iLmpvaW4oam5hdGl2ZWdldHRlcnMpLFwKKyAgICAgICAgICAgICAgICAgICAgICJcblxuIi5qb2luKGpuYXRpdmVzZXR0ZXJzKSxcCisgICAgICAgICAgICAgICAgICAgICBzZWxmLmxpYm5hbWUpCisKKyAgZGVmIGpuaURlY2xTdHJpbmcoc2VsZik6CisgICAgam5pZ2V0dGVycyA9IFtmLmpuaUdldHRlckRlZlN0cmluZygpIGZvciBmIGluIHNlbGYuZmllbGRzXQorICAgIGpuaXNldHRlcnMgPSBbZi5qbmlTZXR0ZXJEZWZTdHJpbmcoKSBmb3IgZiBpbiBzZWxmLmZpZWxkc10KKyAgICByZXR1cm4gIlxuXG4iLmpvaW4oam5pZ2V0dGVycyArIGpuaXNldHRlcnMpCisKKyAgZGVmIGpuaUltcGxTdHJpbmcoc2VsZik6CisgICAgam5pZ2V0dGVycyA9IFtmLmpuaUdldHRlckltcGxTdHJpbmcoKSBmb3IgZiBpbiBzZWxmLmZpZWxkc10KKyAgICBqbmlzZXR0ZXJzID0gW2Yuam5pU2V0dGVySW1wbFN0cmluZygpIGZvciBmIGluIHNlbGYuZmllbGRzXQorICAgIHJldHVybiAiXG5cbiIuam9pbihqbmlnZXR0ZXJzICsgam5pc2V0dGVycykKKworICBkZWYgaEZpbGVTdHJpbmcoc2VsZik6CisgICAgZGVmbmFtZSA9IFRvTWFjcm9EZWZOYW1lKHNlbGYuc3RydWN0bmFtZSwgc2VsZi5wYWNrYWdlKQorICAgIHJldHVybiBoRmlsZVRlbXBsYXRlICUgKGRlZm5hbWUsIGRlZm5hbWUsIHNlbGYuY1N0cnVjdFN0cmluZygpLCBkZWZuYW1lKQorCisgIGRlZiBqYXZhRmlsZVN0cmluZyhzZWxmKToKKyAgICByZXR1cm4gamF2YUZpbGVUZW1wbGF0ZSAlIChzZWxmLnBhY2thZ2UsIHNlbGYuamF2YUNsYXNzU3RyaW5nKCkpCisKKyAgZGVmIGpuaUZpbGVTdHJpbmcoc2VsZik6CisgICAgcmV0dXJuIGpuaUZpbGVUZW1wbGF0ZSAlIChzZWxmLnN0cnVjdG5hbWUubG93ZXIoKSxcCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzZWxmLnN0cnVjdG5hbWUsXAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2VsZi5zdHJ1Y3RuYW1lLFwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNlbGYuc3RydWN0bmFtZSxcCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzZWxmLnN0cnVjdG5hbWUsXAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgVG9KTklQYWNrYWdlKHNlbGYucGFja2FnZSwgc2VsZi5qY2xhc3NuYW1lKSxcCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzZWxmLmpuaURlY2xTdHJpbmcoKSxcCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBUb0pOSVBhY2thZ2Uoc2VsZi5wYWNrYWdlLCBzZWxmLmpjbGFzc25hbWUpLFwKKyAgICAgICAg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VyZVRlc3QiOworICAgIHByaXZhdGUgc3RhdGljIGZpbmFsIGxvbmcgV0FJVF9GT1JfUFJFVklFVyA9IDQgKiAxMDAwOyAvLyA0IHNlY29uZHMKKworICAgIHB1YmxpYyBFZmZlY3RzVmlkZW9DYXB0dXJlKCkgeworICAgICAgICBzdXBlcihDYW1lcmFFZmZlY3RzUmVjb3JkaW5nU2FtcGxlLmNsYXNzKTsKKyAgICB9CisKKyAgICBwcml2YXRlIHZvaWQgY2FwdHVyZVZpZGVvcyhTdHJpbmcgcmVwb3J0VGFnLCBJbnN0cnVtZW50YXRpb24gaW5zdCkgdGhyb3dzIEV4Y2VwdGlvbnsKKyAgICAgICAgaW50IHRvdGFsX251bV9vZl92aWRlb3MgPSAxOworICAgICAgICBpbnQgdmlkZW9fZHVyYXRpb24gPSA0ICogMTAwMDsgLy8gNCBzZWNvbmRzCisKKyAgICAgICAgTG9nLnYoVEFHLCByZXBvcnRUYWcpOworICAgICAgICBmb3IgKGludCBpID0gMDsgaSA8IHRvdGFsX251bV9vZl92aWRlb3M7IGkrKykgeworICAgICAgICAgICAgVGhyZWFkLnNsZWVwKFdBSVRfRk9SX1BSRVZJRVcpOworICAgICAgICAgICAgLy8gcmVjb3JkIGEgdmlkZW8KKyAgICAgICAgICAgIGluc3Quc2VuZENoYXJhY3RlclN5bmMoS2V5RXZlbnQuS0VZQ09ERV9DQU1FUkEpOworICAgICAgICAgICAgVGhyZWFkLnNsZWVwKHZpZGVvX2R1cmF0aW9uKTsKKyAgICAgICAgICAgIGluc3Quc2VuZENoYXJhY3RlclN5bmMoS2V5RXZlbnQuS0VZQ09ERV9DQU1FUkEpOworICAgICAgICB9CisgICAgfQorCisgICAgQExhcmdlVGVzdAorICAgIHB1YmxpYyB2b2lkIHRlc3RCYWNrRWZmZWN0c1ZpZGVvQ2FwdHVyZSgpIHRocm93cyBFeGNlcHRpb24geworICAgICAgICBJbnN0cnVtZW50YXRpb24gaW5zdCA9IGdldEluc3RydW1lbnRhdGl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AgICAgICAgICAgTXRwRXZlbnRQYWNrZXQuY3BwICAgICAgICAgICAgICAgICAgICBcCi0gICAgICAgICAgICAgICAgICBNdHBEZXZpY2VJbmZvLmNwcCAgICAgICAgICAgICAgICAgICAgIFwKLSAgICAgICAgICAgICAgICAgIE10cE9iamVjdEluZm8uY3BwICAgICAgICAgICAgICAgICAgICAgXAotICAgICAgICAgICAgICAgICAgTXRwUGFja2V0LmNwcCAgICAgICAgICAgICAgICAgICAgICAgICBcCi0gICAgICAgICAgICAgICAgICBNdHBQcm9wZXJ0eS5jcHAgICAgICAgICAgICAgICAgICAgICAgIFwKLSAgICAgICAgICAgICAgICAgIE10cFJlcXVlc3RQYWNrZXQuY3BwICAgICAgICAgICAgICAgICAgXAotICAgICAgICAgICAgICAgICAgTXRwUmVzcG9uc2VQYWNrZXQuY3BwICAgICAgICAgICAgICAgICBcCi0gICAgICAgICAgICAgICAgICBNdHBTZXJ2ZXIuY3BwICAgICAgICAgICAgICAgICAgICAgICAgIFwKLSAgICAgICAgICAgICAgICAgIE10cFN0b3JhZ2VJbmZvLmNwcCAgICAgICAgICAgICAgICAgICAgXAotICAgICAgICAgICAgICAgICAgTXRwU3RyaW5nQnVmZmVyLmNwcCAgICAgICAgICAgICAgICAgICBcCi0gICAgICAgICAgICAgICAgICBNdHBTdG9yYWdlLmNwcCAgICAgICAgICAgICAgICAgICAgICAgIFwKLSAgICAgICAgICAgICAgICAgIE10cFV0aWxzLmNwcCAgICAgICAgICAgICAgICAgICAgICAgICAgXAotCi1MT0NBTF9NT0RVTEU6PSBsaWJtdHAKLQotTE9DQUxfQ0ZMQUdTIDo9IC1ETVRQX0RFVklDRSAtRE1UUF9IT1NUCi0KLSMgTmVlZGVkIGZvciA8YmlvbmljX3RpbWUuaD4KLUxPQ0FMX0NfSU5DTFVERVMgOj0gYmlvbmljL2xpYmMvcHJpdmF0ZQotCi1MT0NBTF9TSEFSRURfTElCUkFSSUVTIDo9IGxpYnV0aWxzIGxpYmN1dGlscyBsaWJ1c2Job3N0IGxpYmJpbmRlcgotCi1pbmNsdWRlICQoQlVJTERfU0hBUkVEX0xJQlJBUlkpCi0KLWlmZXEgKCQoSE9TVF9PUyksbGludXgpCi0KLWluY2x1ZGUgJChDTEVBUl9WQVJTKQotCi1MT0NBTF9TUkNfRklMRVM6PSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFwKLSAgICAgICAgICAgICAgICAgIE10cERhdGFQYWNrZXQuY3BwICAgICAgICAgICAgICAgICAgICAgXAotICAgICAgICAgICAgICAgICAgTXRwRGVidWcuY3BwICAgICAgICAgICAgICAgICAgICAgICAgICBcCi0gICAgICAgICAgICAgICAgICBNdHBEZXZpY2UuY3BwICAgICAgICAgICAgICAgICAgICAgICAgIFwKLSAgICAgICAgICAgICAgICAgIE10cEV2ZW50UGFja2V0LmNwcCAgICAgICAgICAgICAgICAgICAgXAotICAgICAgICAgICAgICAgICAgTXRwRGV2aWNlSW5mby5jcHAgICAgICAgICAgICAgICAgICAgICBcCi0gICAgICAgICAgICAgICAgICBNdHBPYmplY3RJbmZvLmNwcCAgICAgICAgICAgICAgICAgICAgIFwKLSAgICAgICAgICAgICAgICAgIE10cFBhY2tldC5jcHAgICAgICAgICAgICAgICAgICAgICAgICAgXAotICAgICAgICAgICAgICAgICAgTXRwUHJvcGVydHkuY3BwICAgICAgICAgICAgICAgICAgICAgICBcCi0gICAgICAgICAgICAgICAgICBNdHBSZXF1ZXN0UGFja2V0LmNwcCAgICAgICAgICAgICAgICAgIFwKLSAgICAgICAgICAgICAgICAgIE10cFJlc3BvbnNlUGFja2V0LmNwcCAgICAgICAgICAgICAgICAgXAotICAgICAgICAgICAgICAgICAgTXRwU3RvcmFnZUluZm8uY3BwICAgICAgICAgICAgICAgICAgICBcCi0gICAgICAgICAgICAgICAgICBNdHBTdHJpbmdCdWZmZXIuY3BwICAgICAgICAgICAgICAgICAgIFwKLSAgICAgICAgICAgICAgICAgIE10cFN0b3JhZ2UuY3BwICAg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KiBNdHBEYXRhUGFja2V0OjpnZXRBVUludDgoKSB7Ci0gICAgVUludDhMaXN0KiByZXN1bHQgPSBuZXcgVUludDhMaXN0OwotICAgIGludCBjb3VudCA9IGdldFVJbnQzMigpOwotICAgIGZvciAoaW50IGkgPSAwOyBpIDwgY291bnQ7IGkrKykKLSAgICAgICAgcmVzdWx0LT5wdXNoKGdldFVJbnQ4KCkpOwotICAgIHJldHVybiByZXN1bHQ7Ci19Ci0KLUludDE2TGlzdCogTXRwRGF0YVBhY2tldDo6Z2V0QUludDE2KCkgewotICAgIEludDE2TGlzdCogcmVzdWx0ID0gbmV3IEludDE2TGlzdDsKLSAgICBpbnQgY291bnQgPSBnZXRVSW50MzIoKTsKLSAgICBmb3IgKGludCBpID0gMDsgaSA8IGNvdW50OyBpKyspCi0gICAgICAgIHJlc3VsdC0+cHVzaChnZXRJbnQxNigpKTsKLSAgICByZXR1cm4gcmVzdWx0OwotfQotCi1VSW50MTZMaXN0KiBNdHBEYXRhUGFja2V0OjpnZXRBVUludDE2KCkgewotICAgIFVJbnQxNkxpc3QqIHJlc3VsdCA9IG5ldyBVSW50MTZMaXN0OwotICAgIGludCBjb3VudCA9IGdldFVJbnQzMigpOwotICAgIGZvciAoaW50IGkgPSAwOyBpIDwgY291bnQ7IGkrKykKLSAgICAgICAgcmVzdWx0LT5wdXNoKGdldFVJbnQxNigpKTsKLSAgICByZXR1cm4gcmVzdWx0OwotfQotCi1JbnQzMkxpc3QqIE10cERhdGFQYWNrZXQ6OmdldEFJbnQzMigpIHsKLSAgICBJbnQzMkxpc3QqIHJlc3VsdCA9IG5ldyBJbnQzMkxpc3Q7Ci0gICAgaW50IGNvdW50ID0gZ2V0VUludDMyKCk7Ci0gICAgZm9yIChpbnQgaSA9IDA7IGkgPCBjb3VudDsgaSsrKQotICAgICAgICByZXN1bHQtPnB1c2goZ2V0SW50MzIoKSk7Ci0gICAgcmV0dXJuIHJlc3VsdDsKLX0KLQotVUludDMyTGlzdCogTXRwRGF0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gICAgcHV0SW50OCgqdmFsdWVzKyspOwotfQotCi12b2lkIE10cERhdGFQYWNrZXQ6OnB1dEFVSW50OChjb25zdCB1aW50OF90KiB2YWx1ZXMsIGludCBjb3VudCkgewotICAgIHB1dFVJbnQzMihjb3VudCk7Ci0gICAgZm9yIChpbnQgaSA9IDA7IGkgPCBjb3VudDsgaSsrKQotICAgICAgICBwdXRVSW50OCgqdmFsdWVzKyspOwotfQotCi12b2lkIE10cERhdGFQYWNrZXQ6OnB1dEFJbnQxNihjb25zdCBpbnQxNl90KiB2YWx1ZXMsIGludCBjb3VudCkgewotICAgIHB1dFVJbnQzMihjb3VudCk7Ci0gICAgZm9yIChpbnQgaSA9IDA7IGkgPCBjb3VudDsgaSsrKQotICAgICAgICBwdXRJbnQxNigqdmFsdWVzKyspOwotfQotCi12b2lkIE10cERhdGFQYWNrZXQ6OnB1dEFVSW50MTYoY29uc3QgdWludDE2X3QqIHZhbHVlcywgaW50IGNvdW50KSB7Ci0gICAgcHV0VUludDMyKGNvdW50KTsKLSAgICBmb3IgKGludCBpID0gMDsgaSA8IGNvdW50OyBpKyspCi0gICAgICAgIHB1dFVJbnQxNigqdmFsdWVzKyspOwotfQotCi12b2lkIE10cERhdGFQYWNrZXQ6OnB1dEFVSW50MTYoY29uc3QgVUludDE2TGlzdCogdmFsdWVzKSB7Ci0gICAgc2l6ZV90IGNvdW50ID0gKHZhbHVlcyA/IHZhbHVlcy0+c2l6ZSgpIDogMCk7Ci0gICAgcHV0VUludDMyKGNvdW50KTsKLSAgICBmb3IgKHNpemVfdCBpID0gMDsgaSA8IGNvdW50OyBpKyspCi0gICAgICAgIHB1dFVJbnQxNigoKnZhbHVlcylbaV0pOwotfQotCi12b2lkIE10cERhdGFQYWNrZXQ6OnB1dEFJbnQzMihjb25zdCBpbnQzMl90KiB2YWx1ZXMsIGludCBjb3VudCkgewotICAgIHB1dFVJbnQzMihjb3VudCk7Ci0gICAgZm9yIChpbnQgaSA9IDA7IGkgPCBjb3VudDsgaSsrKQotICAgICAgICBwdXRJbnQzMigqdmFsdWVzKyspOwotfQotCi12b2lkIE10cERhdGFQYWNrZXQ6OnB1dEFVSW50MzIoY29uc3QgdWludDMyX3QqIHZhbHVlcywgaW50IGNvdW50KSB7Ci0gICAgcHV0VUludDMyKGNvdW50KTsKLSAgICBmb3IgKGludCBpID0gMDsgaSA8IGNvdW50OyBpKyspCi0gICAgICAgIHB1dFVJbnQzMigqdmFsdWVzKyspOwotfQotCi12b2lkIE10cERhdGFQYWNrZXQ6OnB1dEFVSW50MzIoY29uc3QgVUludDMyTGlzdCogbGlzdCkgewotICAgIGlmICghbGlzdCkgewotICAgICAgICBwdXRFbXB0eUFycmF5KCk7Ci0gICAgfSBlbHNlIHsKLSAgICAgICAgc2l6ZV90IHNpemUgPSBsaXN0LT5zaXplKCk7Ci0gICAgICAgIHB1dFVJbnQzMihzaXplKTsKLSAgICAgICAgZm9yIChzaXplX3QgaSA9IDA7IGkgPCBzaXplOyBpKyspCi0gICAgICAgICAgICBwdXRVSW50MzIoKCpsaXN0KVtpXSk7Ci0gICAgfQotfQotCi12b2lkIE10cERhdGFQYWNrZXQ6OnB1dEFJbnQ2NChjb25zdCBpbnQ2NF90KiB2YWx1ZXMsIGludCBjb3VudCkgewotICAgIHB1dFVJbnQzMihjb3VudCk7Ci0gICAgZm9yIChpbnQgaSA9IDA7IGkgPCBjb3VudDsgaSsrKQotICAgICAgICBwdXRJbnQ2NCgqdmFsdWVzKyspOwotfQotCi12b2lkIE10cERhdGFQYWNrZXQ6OnB1dEFVSW50NjQoY29uc3QgdWludDY0X3QqIHZhbHVlcywgaW50IGNvdW50KSB7Ci0gICAgcHV0VUludDMyKGNvdW50KTsKLSAgICBmb3IgKGludCBpID0gMDsgaSA8IGNvdW50OyBpKyspCi0gICAgICAgIHB1dFVJbnQ2NCgqdmFsdWVzKyspOwotfQotCi12b2lkIE10cERhdGFQYWNrZXQ6OnB1dFN0cmluZyhjb25zdCBNdHBTdHJpbmdCdWZm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ByZXNldCgpOwotCi0gICAgdm9pZCAgICAgICAgICAgICAgICBzZXRPcGVyYXRpb25Db2RlKE10cE9wZXJhdGlvbkNvZGUgY29kZSk7Ci0gICAgdm9pZCAgICAgICAgICAgICAgICBzZXRUcmFuc2FjdGlvbklEKE10cFRyYW5zYWN0aW9uSUQgaWQpOwotCi0gICAgaW5saW5lIGNvbnN0IHVpbnQ4X3QqICAgICBnZXREYXRhKCkgY29uc3QgeyByZXR1cm4gbUJ1ZmZlciArIE1UUF9DT05UQUlORVJfSEVBREVSX1NJWkU7IH0KLSAgICBpbmxpbmUgdWludDhfdCAgICAgIGdldFVJbnQ4KCkgeyByZXR1cm4gKHVpbnQ4X3QpbUJ1ZmZlclttT2Zmc2V0KytdOyB9Ci0gICAgaW5saW5lIGludDhfdCAgICAgICBnZXRJbnQ4KCkgeyByZXR1cm4gKGludDhfdCltQnVmZmVyW21PZmZzZXQrK107IH0KLSAgICB1aW50MTZfdCAgICAgICAgICAgIGdldFVJbnQxNigpOwotICAgIGlubGluZSBpbnQxNl90ICAgICAgZ2V0SW50MTYoKSB7IHJldHVybiAoaW50MTZfdClnZXRVSW50MTYoKTsgfQotICAgIHVpbnQzMl90ICAgICAgICAgICAgZ2V0VUludDMyKCk7Ci0gICAgaW5saW5lIGludDMyX3QgICAgICBnZXRJbnQzMigpIHsgcmV0dXJuIChpbnQzMl90KWdldFVJbnQzMigpOyB9Ci0gICAgdWludDY0X3QgICAgICAgICAgICBnZXRVSW50NjQoKTsKLSAgICBpbmxpbmUgaW50NjRfdCAgICAgIGdldEludDY0KCkgeyByZXR1cm4gKGludDY0X3QpZ2V0VUludDY0KCk7IH0KLSAgICB2b2lkICAgICAgICAgICAgICAgIGdldFVJbnQxMjgodWludDEyOF90JiB2YWx1ZSk7Ci0gICAgaW5saW5lIHZvaWQgICAgICAgICBnZXRJbnQxMjgoaW50MTI4X3QmIHZhbHVlKSB7IGdldFVJbnQxMjgoKHVpbnQxMjhfdCYpdmFsdWUpOyB9Ci0gICAgdm9pZCAgICAgICAgICAgICAgICBnZXRTdHJpbmcoTXRwU3RyaW5nQnVmZmVyJiBzdHJpbmcpOwotCi0gICAgSW50OExpc3QqICAgICAgICAgICBnZXRBSW50OCgpOwotICAgIFVJbnQ4TGlzdCogICAgICAgICAgZ2V0QVVJbnQ4KCk7Ci0gICAgSW50MTZMaXN0KiAgICAgICAgICBnZXRBSW50MTYoKTsKLSAgICBVSW50MTZMaXN0KiAgICAgICAgIGdldEFVSW50MTYoKTsKLSAgICBJbnQzMkxpc3QqICAgICAgICAgIGdldEFJbnQzMigpOwotICAgIFVJbnQzMkxpc3QqICAgICAgICAgZ2V0QVVJbnQzMigpOwotICAgIEludDY0TGlzdCogICAgICAgICAgZ2V0QUludDY0KCk7Ci0gICAgVUludDY0TGlzdCogICAgICAgICBnZXRBVUludDY0KCk7Ci0KLSAgICB2b2lkICAgICAgICAgICAgICAgIHB1dEludDgoaW50OF90IHZhbHVlKTsKLSAgICB2b2lkICAgICAgICAgICAgICAgIHB1dFVJbnQ4KHVpbnQ4X3QgdmFsdWUpOwotICAgIHZvaWQgICAgICAgICAgICAgICAgcHV0SW50MTYoaW50MTZfdCB2YWx1ZSk7Ci0gICAgdm9pZCAgICAgICAgICAgICAgICBwdXRVSW50MTYodWludDE2X3QgdmFsdWUpOwotICAgIHZvaWQgICAgICAgICAgICAgICAgcHV0SW50MzIoaW50MzJfdCB2YWx1ZSk7Ci0gICAgdm9pZCAgICAgICAgICAgICAgICBwdXRVSW50MzIodWludDMyX3QgdmFsdWUpOwotICAgIHZvaWQgICAgICAgICAgICAgICAgcHV0SW50NjQoaW50NjRfdCB2YWx1ZSk7Ci0gICAgdm9pZCAgICAgICAgICAgICAgICBwdXRVSW50NjQodWludDY0X3QgdmFsdWUpOwotICAgIHZvaWQgICAgICAgICAgICAgICAgcHV0SW50MTI4KGNvbnN0IGludDEyOF90JiB2YWx1ZSk7Ci0gICAgdm9pZCAgICAgICAgICAgICAgICBwdXRVSW50MTI4KGNvbnN0IHVpbnQxMjhfdCYgdmFsdWUpOwotICAgIHZvaWQgICAgICAgICAgICAgICAgcHV0SW50MTI4KGludDY0X3QgdmFsdWUpOwotICAgIHZvaWQgICAgICAgICAgICAgICAgcHV0VUludDEyOCh1aW50NjRfdCB2YWx1ZSk7Ci0KLSAgICB2b2lkICAgICAgICAgICAgICAgIHB1dEFJbnQ4KGNvbnN0IGludDhfdCogdmFsdWVzLCBpbnQgY291bnQpOwotICAgIHZvaWQgICAgICAgICAgICAgICAgcHV0QVVJbnQ4KGNvbnN0IHVpbnQ4X3QqIHZhbHVlcywgaW50IGNvdW50KTsKLSAgICB2b2lkICAgICAgICAgICAgICAgIHB1dEFJbnQxNihjb25zdCBpbnQxNl90KiB2YWx1ZXMsIGludCBjb3VudCk7Ci0gICAgdm9pZCAgICAgICAgICAgICAgICBwdXRBVUludDE2KGNvbnN0IHVpbnQxNl90KiB2YWx1ZXMsIGludCBjb3VudCk7Ci0gICAgdm9pZCAgICAgICAgICAgICAgICBwdXRBVUludDE2KGNvbnN0IFVJbnQxNkxpc3QqIHZhbHVlcyk7Ci0gICAgdm9pZCAgICAgICAgICAgICAgICBwdXRBSW50MzIoY29uc3QgaW50MzJfdCogdmFsdWVzLCBpbnQgY291bnQpOwotICAgIHZvaWQgICAgICAgICAgICAgICAgcHV0QVVJbnQzMihjb25zdCB1aW50MzJfdCogdmFsdWVzLCBpbnQgY291bnQpOwotICAgIHZvaWQgICAgICAgICAgICAgICAgcHV0QVVJbnQzMihjb25zdCBVSW50MzJMaXN0KiBsaXN0KTsKLSAgICB2b2lkICAgICAgICAgICAgICAgIHB1dEFJbnQ2NChjb25zdCBpbnQ2NF90KiB2YWx1ZXMsIGludCBjb3VudCk7Ci0gICAgdm9pZCAgICAgICAgICAgICAgICBwdXRBVUludDY0KGNvbnN0IHVpbnQ2NF90KiB2YWx1ZXMsIGludCBjb3VudCk7Ci0gICAgdm9pZCAgICAgICAgICAgICAgICBwdXRTdHJpbmcoY29uc3Qg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bmZvOwotCi1jbGFzcyBNdHBEYXRhYmFzZSB7Ci1wdWJsaWM6Ci0gICAgdmlydHVhbCB+TXRwRGF0YWJhc2UoKSB7fQotCi0gICAgLy8gY2FsbGVkIGZyb20gU2VuZE9iamVjdEluZm8gdG8gcmVzZXJ2ZSBhIGRhdGFiYXNlIGVudHJ5IGZvciB0aGUgaW5jb21pbmcgZmlsZQotICAgIHZpcnR1YWwgTXRwT2JqZWN0SGFuZGxlICAgICAgICAgYmVnaW5TZW5kT2JqZWN0KGNvbnN0IGNoYXIqIHBhdGgsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIE10cE9iamVjdEZvcm1hdCBmb3JtYXQsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIE10cE9iamVjdEhhbmRsZSBwYXJlbnQsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIE10cFN0b3JhZ2VJRCBzdG9yYWdlLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB1aW50NjRfdCBzaXplLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0aW1lX3QgbW9kaWZpZWQpID0gMDsKLQotICAgIC8vIGNhbGxlZCB0byByZXBvcnQgc3VjY2VzcyBvciBmYWlsdXJlIG9mIHRoZSBTZW5kT2JqZWN0IGZpbGUgdHJhbnNmZXIKLSAgICAvLyBzdWNjZXNzIHNob3VsZCBzaWduYWwgYSBub3RpZmljYXRpb24gb2YgdGhlIG5ldyBvYmplY3QncyBjcmVhdGlvbiwKLSAgICAvLyBmYWlsdXJlIHNob3VsZCByZW1vdmUgdGhlIGRhdGFiYXNlIGVudHJ5IGNyZWF0ZWQgaW4gYmVnaW5TZW5kT2JqZWN0Ci0gICAgdmlydHVhbCB2b2lkICAgICAgICAgICAgICAgICAgICBlbmRTZW5kT2JqZWN0KGNvbnN0IGNoYXIqIHBhdGgsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIE10cE9iamVjdEhhbmRsZSBoYW5kbGUsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIE10cE9iamVjdEZvcm1hdCBmb3JtYXQsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJvb2wgc3VjY2VlZGVkKSA9IDA7Ci0KLSAgICB2aXJ0dWFsIE10cE9iamVjdEhhbmRsZUxpc3QqICAgIGdldE9iamVjdExpc3QoTXRwU3RvcmFnZUlEIHN0b3JhZ2VJRCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTXRwT2JqZWN0Rm9ybWF0IGZvcm1hdCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTXRwT2JqZWN0SGFuZGxlIHBhcmVudCkgPSAwOwotCi0gICAgdmlydHVhbCBpbnQgICAgICAgICAgICAgICAgICAgICBnZXROdW1PYmplY3RzKE10cFN0b3JhZ2VJRCBzdG9yYWdlSUQsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIE10cE9iamVjdEZvcm1hdCBmb3JtYXQsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIE10cE9iamVjdEhhbmRsZSBwYXJlbnQpID0gMDsKLQotICAgIC8vIGNhbGxlZSBzaG91bGQgZGVsZXRlW10gdGhlIHJlc3VsdHMgZnJvbSB0aGVzZQotICAgIC8vIHJlc3VsdHMgY2FuIGJlIE5VTEwKLSAgICB2aXJ0dWFsIE10cE9iamVjdEZvcm1hdExpc3QqICAgIGdldFN1cHBvcnRlZFBsYXliYWNrRm9ybWF0cygpID0gMDsKLSAgICB2aXJ0dWFsIE10cE9iamVjdEZvcm1hdExpc3QqICAgIGdldFN1cHBvcnRlZENhcHR1cmVGb3JtYXRzKCkgPSAwOwotICAgIHZpcnR1YWwgTXRwT2JqZWN0UHJvcGVydHlMaXN0KiAgZ2V0U3VwcG9ydGVkT2JqZWN0UHJvcGVydGllcyhNdHBPYmplY3RGb3JtYXQgZm9ybWF0KSA9IDA7Ci0gICAgdmlydHVhbCBNdHBEZXZpY2VQcm9wZXJ0eUxpc3QqICBnZXRTdXBwb3J0ZWREZXZpY2VQcm9wZXJ0aWVzKCkgPSAwOwotCi0gICAgdmlydHVhbCBNdHBSZXNwb25zZUNvZGUgICAgICAgICBnZXRPYmplY3RQcm9wZXJ0eVZhbHVlKE10cE9iamVjdEhhbmRsZSBoYW5kbGUsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIE10cE9iamVjdFByb3BlcnR5IHByb3BlcnR5LAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBNdHBEYXRhUGFja2V0JiBwYWNrZXQpID0gMDsKLQotICAgIHZpcnR1YWwgTXRwUmVzcG9uc2VDb2RlICAgICAgICAgc2V0T2JqZWN0UHJvcGVydHlWYWx1ZShNdHBPYmplY3RIYW5kbGUgaGFuZGxlLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBNdHBPYmplY3RQcm9wZXJ0eSBwcm9wZXJ0eSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTXRwRGF0YVBhY2tldCYgcGFja2V0KSA9IDA7Ci0KLSAgICB2aXJ0dWFsIE10cFJlc3BvbnNlQ29kZSAgICAgICAgIGdldERldmljZVByb3BlcnR5VmFsdWUoTXRwRGV2aWNlUHJvcGVydHkgcHJvcGVydHksCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIE10cERhdGFQYWNrZXQmIHBhY2tldCkgPSAwOwotCi0gICAgdmlydHVhbCBNdHBSZXNwb25zZUNvZGUgICAgICAgICBzZXREZXZpY2VQcm9wZXJ0eVZhbHVlKE10cERldmljZVByb3BlcnR5IHByb3BlcnR5LAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBNdHBEYXRhUGFja2V0JiBwYWNrZXQpID0gMDsKLQotICAgIHZpcnR1YWwgTXRwUmVzcG9uc2VDb2RlICAgICAgICAgcmVzZXREZXZpY2VQcm9wZXJ0eShNdHBEZXZpY2VQcm9wZXJ0eSBwcm9wZXJ0eSkgPSAwOwotCi0gICAgdmlydHVhbCBNdHBSZXNwb25zZUNvZGUgICAgICAgICBnZXRPYmplY3RQcm9wZXJ0eUxpc3QoTXRwT2JqZWN0SGFuZGxlIGhhbmRsZSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdWludDMyX3QgZm9ybWF0LCB1aW50MzJfdCBwcm9wZXJ0eSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaW50IGdyb3VwQ29kZSwgaW50IGRlcHRoLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBNdHBEYXRhUGFja2V0JiBwYWNrZXQpID0gMDsKLQotICAgIHZpcnR1YWwgTXRwUmVzcG9uc2VDb2RlICAgICAgICAgZ2V0T2JqZWN0SW5mbyhNdHBPYmplY3RIYW5kbGUgaGFuZGxlLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBNdHBPYmplY3RJbmZvJiBpbmZvKSA9IDA7Ci0KLSAgICB2aXJ0dWFsIHZvaWQqICAgICAgICAgICAgICAgICAgIGdldFRodW1ibmFpbChNdHBPYmplY3RIYW5kbGUgaGFuZGxlLCBzaXplX3QmIG91dFRodW1iU2l6ZSkgPSAwOwotCi0gICAgdmlydHVhbCBNdHBSZXNwb25zZUNvZGUgICAgICAgICBnZXRPYmplY3RGaWxlUGF0aChNdHBPYmplY3RIYW5kbGUgaGFuZGxlLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBNdHBTdHJpbmcmIG91dEZpbGVQYXRoLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpbnQ2NF90JiBvdXRGaWxlTGVuZ3RoLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBNdHBPYmplY3RGb3JtYXQmIG91dEZvcm1hdCkgPSAwOwotCi0gICAgdmlydHVhbCBNdHBSZXNwb25zZUNvZGUgICAgICAgICBkZWxldGVGaWxlKE10cE9iamVjdEhhbmRsZSBoYW5kbGUpID0gMDsKLQotICAgIHZpcnR1YWwgTXRwT2JqZWN0SGFuZGxlTGlzdCogICAgZ2V0T2JqZWN0UmVmZXJlbmNlcyhNdHBPYmplY3RIYW5kbGUgaGFuZGxlKSA9IDA7Ci0KLSAgICB2aXJ0dWFsIE10cFJlc3BvbnNlQ29kZSAgICAgICAgIHNldE9iamVjdFJlZmVyZW5jZXMoTXRwT2JqZWN0SGFuZGxlIGhhbmRsZSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTXRwT2JqZWN0SGFuZGxlTGlzdCogcmVmZXJlbmNlcykgPSAwOwotCi0gICAgdmlydHVhbCBNdHBQcm9wZXJ0eSogICAgICAgICAgICBnZXRPYmplY3RQcm9wZXJ0eURlc2MoTXRwT2JqZWN0UHJvcGVydHkgcHJvcGVydHksCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIE10cE9iamVjdEZvcm1hdCBmb3JtYXQpID0gMDsKLQotICAgIHZpcnR1YWwgTXRwUHJvcGVydHkqICAgICAgICAgICAgZ2V0RGV2aWNlUHJvcGVydHlEZXNjKE10cERldmljZVByb3BlcnR5IHByb3BlcnR5KSA9IDA7Ci0KLSAgICB2aXJ0dWFsIHZvaWQgICAgICAgICAgICAgICAgICAgIHNlc3Npb25TdGFydGVkKCkgPSAwOwotCi0gICAgdmlydHVhbCB2b2lkICAgICAgICAgICAgICAgICAgICBzZXN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IiwgICAgICAgICAgICAgICAgICAgIDB4MTAwQSB9LAotICAgIHsgIk1UUF9PUEVSQVRJT05fREVMRVRFX09CSkVDVCIsICAgICAgICAgICAgICAgIDB4MTAwQiB9LAotICAgIHsgIk1UUF9PUEVSQVRJT05fU0VORF9PQkpFQ1RfSU5GTyIsICAgICAgICAgICAgIDB4MTAwQyB9LAotICAgIHsgIk1UUF9PUEVSQVRJT05fU0VORF9PQkpFQ1QiLCAgICAgICAgICAgICAgICAgIDB4MTAwRCB9LAotICAgIHsgIk1UUF9PUEVSQVRJT05fSU5JVElBVEVfQ0FQVFVSRSIsICAgICAgICAgICAgIDB4MTAwRSB9LAotICAgIHsgIk1UUF9PUEVSQVRJT05fRk9STUFUX1NUT1JFIiwgICAgICAgICAgICAgICAgIDB4MTAwRiB9LAotICAgIHsgIk1UUF9PUEVSQVRJT05fUkVTRVRfREVWSUNFIiwgICAgICAgICAgICAgICAgIDB4MTAxMCB9LAotICAgIHsgIk1UUF9PUEVSQVRJT05fU0VMRl9URVNUIiwgICAgICAgICAgICAgICAgICAgIDB4MTAxMSB9LAotICAgIHsgIk1UUF9PUEVSQVRJT05fU0VUX09CSkVDVF9QUk9URUNUSU9OIiwgICAgICAgIDB4MTAxMiB9LAotICAgIHsgIk1UUF9PUEVSQVRJT05fUE9XRVJfRE9XTiIsICAgICAgICAgICAgICAgICAgIDB4MTAxMyB9LAotICAgIHsgIk1UUF9PUEVSQVRJT05fR0VUX0RFVklDRV9QUk9QX0RFU0MiLCAgICAgICAgIDB4MTAxNCB9LAotICAgIHsgIk1UUF9PUEVSQVRJT05fR0VUX0RFVklDRV9QUk9QX1ZBTFVFIiwgICAgICAgIDB4MTAxNSB9LAotICAgIHsgIk1UUF9PUEVSQVRJT05fU0VUX0RFVklDRV9QUk9QX1ZBTFVFIiwgICAgICAgIDB4MTAxNiB9LAotICAgIHsgIk1UUF9PUEVSQVRJT05fUkVTRVRfREVWSUNFX1BST1BfVkFMVUUiLCAgICAgIDB4MTAx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AgIHsgIk1UUF9PUEVSQVRJT05fR0VUX09CSkVDVF9SRUZFUkVOQ0VTIiwgICAgICAgIDB4OTgxMCB9LAotICAgIHsgIk1UUF9PUEVSQVRJT05fU0VUX09CSkVDVF9SRUZFUkVOQ0VTIiwgICAgICAgIDB4OTgxMSB9LAotICAgIHsgIk1UUF9PUEVSQVRJT05fU0tJUCIsICAgICAgICAgICAgICAgICAgICAgICAgIDB4OTgyMCB9LAotICAgIC8vIGFuZHJvaWQgZXh0ZW5zaW9ucwotICAgIHsgIk1UUF9PUEVSQVRJT05fR0VUX1BBUlRJQUxfT0JKRUNUXzY0IiwgICAgICAgIDB4OTVDMSB9LAotICAgIHsgIk1UUF9PUEVSQVRJT05fU0VORF9QQVJUSUFMX09CSkVDVCIsICAgICAgICAgIDB4OTVDMiB9LAotICAgIHsgIk1UUF9PUEVSQVRJT05fVFJVTkNBVEVfT0JKRUNUIiwgICAgICAgICAgICAgIDB4OTVDMyB9LAotICAgIHsgIk1UUF9PUEVSQVRJT05fQkVHSU5fRURJVF9PQkpFQ1QiLCAgICAgICAgICAgIDB4OTVDNCB9LAotICAgIHsgIk1UUF9PUEVSQVRJT05fRU5EX0VESVRfT0JKRUNUIiwgICAgICAgICAgICAgIDB4OTVDNSB9LAotICAgIHsgMCwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDAgICAgICB9LAotfTsKLQotc3RhdGljIGNvbnN0IENvZGVFbnRyeSBzRm9ybWF0Q29kZXNbXSA9IHsKLSAgICB7ICJNVFBfRk9STUFUX1VOREVGSU5FRCIsICAgICAgICAgICAgICAgICAgICAgICAweDMwMDAgfSwKLSAgICB7ICJNVFBfRk9STUFUX0FTU09DSUFUSU9OIiwgICAgICAgICAgICAgICAgICAgICAweDMwMDEgfSwKLSAgICB7ICJNVFBfRk9STUFUX1NDUklQVCIsICAgICAgICAgICAgICAgICAgICAgICAgICAweDMwMDIgfSwKLSAgICB7ICJNVFBfRk9STUFUX0VYRUNVVEFCTEUiLCAgICAgICAgICAgICAgICAgICAgICAweDMwMDMgfSwKLSAgICB7ICJNVFBfRk9STUFUX1RFWFQiLCAgICAgICAgICAgICAgICAgICAgICAgICAgICAweDMwMDQgfSwKLSAgICB7ICJNVFBfRk9STUFUX0hUTUwiLCAgICAgICAgICAgICAgICAgICAgICAgICAgICAweDMwMDUgfSwKLSAgICB7ICJNVFBfRk9STUFUX0RQT0YiLCAgICAgICAgICAgICAgICAgICAgICAgICAgICAweDMwMDYgfSwKLSAgICB7ICJNVFBfRk9STUFUX0FJRkYiLCAgICAgICAgICAgICAgICAgICAgICAgICAgICAweDMwMDcgfSwKLSAgICB7ICJNVFBfRk9STUFUX1dBViIsICAgICAgICAgICAgICAgICAgICAgICAgICAgICAweDMwMDggfSwKLSAgICB7ICJNVFBfRk9STUFUX01QMyIsICAgICAgICAgICAgICAgICAgICAgICAgICAgICAweDMwMDkgfSwKLSAgICB7ICJNVFBfRk9STUFUX0FWSSIsICAgICAgICAgICAgICAgICAgICAgICAgICAgICAweDMwMEEgfSwKLSAgICB7ICJNVFBfRk9STUFUX01QRUciLCAgICAgICAgICAgICAgICAgICAgICAgICAgICAweDMwMEIgfSwKLSAgICB7ICJNVFBfRk9STUFUX0FTRiIsICAgICAgICAgICAgICAgICAgICAgICAgICAgICAweDMwMEMgfSwKLSAgICB7ICJNVFBfRk9STUFUX0RFRklORUQiLCAgICAgICAgICAgICAgICAgICAgICAgICAweDM4MDAgfSwKLSAgICB7ICJNVFBfRk9STUFUX0VYSUZfSlBFRyIsICAgICAgICAgICAgICAgICAgICAgICAweDM4MDEgfSwKLSAgICB7ICJNVFBfRk9STUFUX1RJRkZfRVAiLCAgICAgICAgICAgICAgICAgICAgICAgICAweDM4MDIgfSwKLSAgICB7ICJNVFBfRk9STUFUX0ZMQVNIUElYIiwgICAgICAgICAgICAgICAgICAgICAgICAweDM4MDMgfSwKLSAgICB7ICJNVFBfRk9STUFUX0JNUCIsICAgICAgICAgICAgICAgICAgICAgICAgICAgICAweDM4MDQgfSwKLSAgICB7ICJNVFBfRk9STUFUX0NJRkYiLCAgICAgICAgICAgICAgICAgICAgICAgICAgICAweDM4MDUgfSwKLSAgICB7ICJNVFBfRk9STUFUX0dJRiIsICAgICAgICAgICAgICAgICAgICAgICAgICAgICAweDM4MDcgfSwKLSAgICB7ICJNVFBfRk9STUFUX0pGSUYiLCAgICAgICAgICAgICAgICAgICAgICAgICAgICAweDM4MDggfSwKLSAgICB7ICJNVFBfRk9STUFUX0NEIiwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAweDM4MDkgfSwKLSAgICB7ICJNVFBfRk9STUFUX1BJQ1QiLCAgICAgICAgICAgICAgICAgICAgICAgICAgICAweDM4MEEgfSwKLSAgICB7ICJNVFBfRk9STUFUX1BORyIsICAgICAgICAgICAgICAgICAgICAgICAgICAgICAweDM4MEIgfSwKLSAgICB7ICJNVFBfRk9STUFUX1RJRkYiLCAgICAgICAgICAgICAgICAgICAgICAgICAgICAweDM4MEQgfSwKLSAgICB7ICJNVFBfRk9STUFUX1RJRkZfSVQiLCAgICAgICAgICAgICAgICAgICAgICAgICAweDM4MEUgfSwKLSAgICB7ICJNVFBfRk9STUFUX0pQMiIsICAgICAgICAgICAgICAgICAgICAgICAgICAgICAweDM4MEYgfSwKLSAgICB7ICJNVFBfRk9STUFUX0pQWCIsICAgICAgICAgICAgICAgICAgICAgICAgICAgICAweDM4MTAgfSwKLSAgICB7ICJNVFBfRk9STUFUX1VOREVGSU5FRF9GSVJNV0FSRSIsICAgICAgICAgICAgICAweEI4MDIgfSwKLSAgICB7ICJNVFBfRk9STUFUX1dJTkRPV1NfSU1BR0VfRk9STUFUIiwgICAgICAgICAgICAweEI4ODEgfSwKLSAgICB7ICJNVFBfRk9STUFUX1VOREVGSU5FRF9BVURJTyIsICAgICAgICAgICAgICAgICAweEI5MDAgfSwKLSAgICB7ICJNVFBfRk9STUFUX1dNQSIsICAgICAgICAgICAgICAgICAgICAgICAgICAgICAweEI5MDEgfSwKLSAgICB7ICJNVFBfRk9STUFUX09HRyIsICAgICAgICAgICAgICAgICAgICAgICAgICAgICAweEI5MDIgfSwKLSAgICB7ICJNVFBfRk9STUFUX0FBQyIsICAgICAgICAgICAgICAgICAgICAgICAgICAgICAweEI5MDMgfSwKLSAgICB7ICJNVFBfRk9STUFUX0FVRElCTEUiLCAgICAgICAgICAgICAgICAgICAgICAgICAweEI5MDQgfSwKLSAgICB7ICJNVFBfRk9STUFUX0ZMQUMiLCAgICAgICAgICAgICAgICAgICAgICAgICAgICAweEI5MDYgfSwKLSAgICB7ICJNVFBfRk9STUFUX1VOREVGSU5FRF9WSURFTyIsICAgICAgICAgICAgICAgICAweEI5ODAgfSwKLSAgICB7ICJNVFBfRk9STUFUX1dNViIsICAgICAgICAgICAgICAgICAgICAgICAgICAgICAweEI5ODEgfSwKLSAgICB7ICJNVFBfRk9STUFUX01QNF9DT05UQUlORVIiLCAgICAgICAgICAgICAgICAgICAweEI5ODIgfSwKLSAgICB7ICJNVFBfRk9STUFUX01QMiIsICAgICAgICAgICAgICAgICAgICAgICAgICAgICAweEI5ODMgfSwKLSAgICB7ICJNVFBfRk9STUFUXzNHUF9DT05UQUlORVIiLCAgICAgICAgICAgICAgICAgICAweEI5ODQgfSwKLSAgICB7ICJNVFBfRk9STUFUX1VOREVGSU5FRF9DT0xMRUNUSU9OIiwgICAgICAgICAgICAweEJBMDAgfSwKLSAgICB7ICJNVFBfRk9STUFUX0FCU1RSQUNUX01VTFRJTUVESUFfQUxCVU0iLCAgICAgICAweEJBMDEgfSwKLSAgICB7ICJNVFBfRk9STUFUX0FCU1RSQUNUX0lNQUdFX0FMQlVNIiwgICAgICAgICAgICAweEJBMDIgfSwKLSAgICB7ICJNVFBfRk9STUFUX0FCU1RSQUNUX0FVRElPX0FMQlVNIiwgICAgICAgICAgICAweEJBMDMgfSwKLSAgICB7ICJNVFBfRk9STUFUX0FCU1RSQUNUX1ZJREVPX0FMQlVNIiwgICAgICAgICAgICAweEJBMDQgfSwKLSAgICB7ICJNVFBfRk9STUFUX0FCU1RSQUNUX0FWX1BMQVlMSVNUIiwgICAgICAgICAgICAweEJBMDUgfSwKLSAgICB7ICJNVFBfRk9STUFUX0FCU1RSQUNUX0NPTlRBQ1RfR1JPVVAiLCAgICAgICAgICAweEJBMDYgfSwKLSAgICB7ICJNVFBfRk9STUFUX0FCU1RSQUNUX01FU1NBR0VfRk9MREVSIiwgICAgICAgICAweEJBMDcgfSwKLSAgICB7ICJNVFBfRk9STUFUX0FCU1RSQUNUX0NIQVBURVJFRF9QUk9EVUNUSU9OIiwgICAweEJBMDggfSwKLSAgICB7ICJNVFBfRk9STUFUX0FCU1RSQUNUX0FVRElPX1BMQVlMSVNUIiwgICAgICAgICAweEJBMDkgfSwKLSAgICB7ICJNVFBfRk9STUFUX0FCU1RSQUNUX1ZJREVPX1BMQVlMSVNUIiwgICAgICAgICAweEJBMEEgfSwKLSAgICB7ICJNVFBfRk9STUFUX0FCU1RSQUNUX01FRElBQ0FTVCIsICAgICAgICAgICAgICAweEJBMEIgfSwKLSAgICB7ICJNVFBfRk9STUFUX1dQTF9QTEFZTElTVCIsICAgICAgICAgICAgICAgICAgICAweEJBMTAgfSwKLSAgICB7ICJNVFBfRk9STUFUX00zVV9QTEFZTElTVCIsICAgICAgICAgICAgICAgICAgICAweEJBMTEgfSwKLSAgICB7ICJNVFBfRk9STUFUX01QTF9QTEFZTElTVCIsICAgICAgICAgICAgICAgICAgICAweEJBMTIgfSwKLSAgICB7ICJNVFBfRk9STUFUX0FTWF9QTEFZTElTVCIsICAgICAgICAgICAgICAgICAgICAweEJBMTMgfSwKLSAgICB7ICJNVFBfRk9STUFUX1BMU19QTEFZTElTVCIsICAgICAgICAgICAgICAgICAgICAweEJBMTQgfSwKLSAgICB7ICJNVFBfRk9STUFUX1VOREVGSU5FRF9ET0NVTUVOVCIsICAgICAgICAgICAgICAweEJBODAgfSwKLSAgICB7ICJNVFBfRk9STUFUX0FCU1RSQUNUX0RPQ1VNRU5UIiwgICAgICAgICAgICAgICAweEJBODEgfSwKLSAgICB7ICJNVFBfRk9STUFUX1hNTF9ET0NVTUVOVCIsICAgICAgICAgICAgICAgICAgICAweEJBODIgfSwKLSAgICB7ICJNVFBfRk9STUFUX01TX1dPUkRfRE9DVU1FTlQiLCAgICAgICAgICAgICAgICAweEJBODMgfSwKLSAgICB7ICJNVFBfRk9STUFUX01IVF9DT01QSUxFRF9IVE1MX0RPQ1VNRU5UIiwgICAgICAweEJBODQgfSwKLSAgICB7ICJNVFBfRk9STUFUX01TX0VYQ0VMX1NQUkVBRFNIRUVUIiwgICAgICAgICAgICAweEJBODUgfSwKLSAgICB7ICJNVFBfRk9STUFUX01TX1BPV0VSUE9JTlRfUFJFU0VOVEFUSU9OIiwgICAgICAweEJBODYgfSwKLSAgICB7ICJNVFBfRk9STUFUX1VOREVGSU5FRF9NRVNTQUdFIiwgICAgICAgICAgICAgICAweEJCMDAgfSwKLSAgICB7ICJNVFBfRk9STUFUX0FCU1RSQUNUX01FU1NTQUdFIiwgICAgICAgICAgICAgICAweEJCMDEgfSwKLSAgICB7ICJNVFBfRk9STUFUX1VOREVGSU5FRF9DT05UQUNUIiwgICAgICAgICAgICAgICAweEJCODAgfSwKLSAgICB7ICJNVFBfRk9STUFUX0FCU1RSQUNUX0NPTlRBQ1QiLCAgICAgICAgICAgICAgICAweEJCODEgfSwKLSAgICB7ICJNVFBfRk9STUFUX1ZDQVJEXzIiLCAgICAgICAgICAgICAgICAgICAgICAgICAweEJCODIgfSwKLSAgICB7IDAsICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAwICAgICAgfSwKLX07Ci0KLXN0YXRpYyBjb25zdCBDb2RlRW50cnkgc09iamVjdFByb3BDb2Rlc1tdID0gewotICAgIHsgIk1UUF9QUk9QRVJUWV9TVE9SQUdFX0lEIiwgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDB4REMwMSB9LAotICAgIHsgIk1UUF9QUk9QRVJUWV9PQkpFQ1RfRk9STUFUIiwgICAgICAgICAgICAgICAgICAgICAgICAgIDB4REMwMiB9LAotICAgIHsgIk1UUF9QUk9QRVJUWV9QUk9URUNUSU9OX1NUQVRVUyIsICAgICAgICAgICAgICAgICAgICAgIDB4REMwMyB9LAotICAgIHsgIk1UUF9QUk9QRVJUWV9PQkpFQ1RfU0laRSIsICAgICAgICAgICAgICAgICAgICAgICAgICAgIDB4REMwNCB9LAotICAgIHsgIk1UUF9QUk9QRVJUWV9BU1NPQ0lBVElPTl9UWVBFIiwgICAgICAgICAgICAgICAgICAgICAgIDB4REMwNSB9LAotICAgIHsgIk1UUF9QUk9QRVJUWV9BU1NPQ0lBVElPTl9ERVNDIiwgICAgICAgICAgICAgICAgICAgICAgIDB4REMwNiB9LAotICAgIHsgIk1UUF9QUk9QRVJUWV9PQkpFQ1RfRklMRV9OQU1FIiwgICAgICAgICAgICAgICAgICAgICAgIDB4REMwNyB9LAotICAgIHsgIk1UUF9QUk9QRVJUWV9EQVRFX0NSRUFURUQiLCAgICAgICAgICAgICAgICAgICAgICAgICAgIDB4REMwOCB9LAotICAgIHsgIk1UUF9QUk9QRVJUWV9EQVRFX01PRElGSUVEIiwgICAgICAgICAgICAgICAgICAgICAgICAgIDB4REMwOSB9LAotICAgIHsgIk1UUF9QUk9QRVJUWV9LRVlXT1JEUyIsICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDB4REMwQSB9LAotICAgIHsgIk1UUF9QUk9QRVJUWV9QQVJFTlRfT0JKRUNUIiwgICAgICAgICAgICAgICAgICAgICAgICAgIDB4REMwQiB9LAotICAgIHsgIk1UUF9QUk9QRVJUWV9BTExPV0VEX0ZPTERFUl9DT05URU5UUyIsICAgICAgICAgICAgICAgIDB4REMwQyB9LAotICAgIHsgIk1UUF9QUk9QRVJUWV9ISURERU4iLCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDB4REMwRCB9LAotICAgIHsgIk1UUF9QUk9QRVJUWV9TWVNURU1fT0JKRUNUIiwgICAgICAgICAgICAgICAgICAgICAgICAgIDB4REMwRSB9LAotICAgIHsgIk1UUF9QUk9QRVJUWV9QRVJTSVNURU5UX1VJRCIsICAgICAgICAgICAgICAgICAgICAgICAgIDB4REM0MSB9LAotICAgIHsgIk1UUF9QUk9QRVJUWV9TWU5DX0lEIiwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDB4REM0MiB9LAotICAgIHsgIk1UUF9QUk9QRVJUWV9QUk9QRVJUWV9CQUciLCAgICAgICAgICAgICAgICAgICAgICAgICAgIDB4REM0MyB9LAotICAgIHsgIk1UUF9QUk9QRVJUWV9OQU1FIiwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDB4REM0NCB9LAotICAgIHsgIk1UUF9QUk9QRVJUWV9DUkVBVEVEX0JZIiwgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDB4REM0NSB9LAotICAgIHsgIk1UUF9QUk9QRVJUWV9BUlRJU1QiLCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDB4REM0NiB9LAotICAgIHsgIk1UUF9QUk9QRVJUWV9EQVRFX0FVVEhPUkVEIiwgICAgICAgICAgICAgICAgICAgICAgICAgIDB4REM0NyB9LAotICAgIHsgIk1UUF9QUk9QRVJUWV9ERVNDUklQVElPTiIsICAgICAgICAgICAgICAgICAgICAgICAgICAgIDB4REM0OCB9LAotICAgIHsgIk1UUF9QUk9QRVJUWV9VUkxfUkVGRVJFTkNFIiwgICAgICAgICAgICAgICAgICAgICAgICAgIDB4REM0OSB9LAotICAgIHsgIk1UUF9QUk9QRVJUWV9MQU5HVUFHRV9MT0NBTEUiLCAgICAgICAgICAgICAgICAgICAgICAgIDB4REM0QSB9LAotICAgIHsgIk1UUF9QUk9QRVJUWV9DT1BZUklHSFRfSU5GT1JNQVRJT04iLCAgICAgICAgICAgICAgICAgIDB4REM0QiB9LAotICAgIHsgIk1UUF9QUk9QRVJUWV9TT1VSQ0UiLCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDB4REM0QyB9LAotICAgIHsgIk1UUF9QUk9QRVJUWV9PUklHSU5fTE9DQVRJT04iLCAgICAgICAgICAgICAgICAgICAgICAgIDB4REM0RCB9LAotICAgIHsgIk1UUF9QUk9QRVJUWV9EQVRFX0FEREVEIiwgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDB4REM0RSB9LAotICAgIHsgIk1UUF9QUk9QRVJUWV9OT05fQ09OU1VNQUJMRSIsICAgICAgICAgICAgICAgICAgICAgICAgIDB4REM0RiB9LAotICAgIHsgIk1UUF9QUk9QRVJUWV9DT1JSVVBUX1VOUExBWUFCTEUiLCAgICAgICAgICAgICAgICAgICAgIDB4REM1MCB9LAotICAgIHsgIk1UUF9QUk9QRVJUWV9QUk9EVUNFUl9TRVJJQUxfTlVNQkVSIiwgICAgICAgICAgICAgICAgIDB4REM1MSB9LAotICAgIHsgIk1UUF9QUk9QRVJUWV9SRVBSRVNFTlRBVElWRV9TQU1QTEVfRk9STUFUIiwgICAgICAgICAgIDB4REM4MSB9LAotICAgIHsgIk1UUF9QUk9QRVJUWV9SRVBSRVNFTlRBVElWRV9TQU1QTEVfU0laRSIsICAgICAgICAgICAgIDB4REM4MiB9LAotICAgIHsgIk1UUF9QUk9QRVJUWV9SRVBSRVNFTlRBVElWRV9TQU1QTEVfSEVJR0hUIiwgICAgICAgICAgIDB4REM4MyB9LAotICAgIHsgIk1UUF9QUk9QRVJUWV9SRVBSRVNFTlRBVElWRV9TQU1QTEVfV0lEVEgiLCAgICAgICAgICAgIDB4REM4NCB9LAotICAgIHsgIk1UUF9QUk9QRVJUWV9SRVBSRVNFTlRBVElWRV9TQU1QTEVfRFVSQVRJT04iLCAgICAgICAgIDB4REM4NSB9LAotICAgIHsgIk1UUF9QUk9QRVJUWV9SRVBSRVNFTlRBVElWRV9TQU1QTEVfREFUQSIsICAgICAgICAgICAgIDB4REM4NiB9LAotICAgIHsgIk1UUF9QUk9QRVJUWV9XSURUSCIsICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDB4REM4NyB9LAotICAgIHsgIk1UUF9QUk9QRVJUWV9IRUlHSFQiLCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDB4REM4OCB9LAotICAgIHsgIk1UUF9QUk9QRVJUWV9EVVJBVElPTiIsICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDB4REM4OSB9LAotICAgIHsgIk1UUF9QUk9QRVJUWV9SQVRJTkciLCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDB4REM4QSB9LAotICAgIHsgIk1UUF9QUk9QRVJUWV9UUkFDSyIsICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDB4REM4QiB9LAotICAgIHsgIk1UUF9QUk9QRVJUWV9HRU5SRSIsICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDB4REM4QyB9LAotICAgIHsgIk1UUF9QUk9QRVJUWV9DUkVESVRTIiwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDB4REM4RCB9LAotICAgIHsgIk1UUF9QUk9QRVJUWV9MWVJJQ1MiLCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDB4REM4RSB9LAotICAgIHsgIk1UUF9QUk9QRVJUWV9TVUJTQ1JJUFRJT05fQ09OVEVOVF9JRCIsICAgICAgICAgICAgICAgIDB4REM4RiB9LAotICAgIHsgIk1UUF9QUk9QRVJUWV9QUk9EVUNFRF9CWSIsICAgICAgICAgICAgICAgICAgICAgICAgICAgIDB4REM5MCB9LAotICAgIHsgIk1UUF9QUk9QRVJUWV9VU0VfQ09VTlQiLCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDB4REM5MSB9LAotICAgIHsgIk1UUF9QUk9QRVJUWV9TS0lQX0NPVU5UIiwgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDB4REM5MiB9LAotICAgIHsgIk1UUF9QUk9QRVJUWV9MQVNUX0FDQ0VTU0VEIiwgICAgICAgICAgICAgICAgICAgICAgICAgIDB4REM5MyB9LAotICAgIHsgIk1UUF9QUk9QRVJUWV9QQVJFTlRBTF9SQVRJTkciLCAgICAgICAgICAgICAgICAgICAgICAgIDB4REM5NCB9LAotICAgIHsgIk1UUF9QUk9QRVJUWV9NRVRBX0dFTlJFIiwgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDB4REM5NSB9LAotICAgIHsgIk1UUF9QUk9QRVJUWV9DT01QT1NFUiIsICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDB4REM5NiB9LAotICAgIHsgIk1UUF9QUk9QRVJUWV9FRkZFQ1RJVkVfUkFUSU5HIiwgICAgICAgICAgICAgICAgICAgICAgIDB4REM5NyB9LAotICAgIHsgIk1UUF9QUk9QRVJUWV9TVUJUSVRMRSIsICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDB4REM5OCB9LAotICAgIHsgIk1UUF9QUk9QRVJUWV9PUklHSU5BTF9SRUxFQVNFX0RBVEUiLCAgICAgICAgICAgICAgICAgIDB4REM5OSB9LAotICAgIHsgIk1UUF9QUk9QRVJUWV9BTEJVTV9OQU1FIiwgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDB4REM5QSB9LAotICAgIHsgIk1UUF9QUk9QRVJUWV9BTEJVTV9BUlRJU1QiLCAgICAgICAgICAgICAgICAgICAgICAgICAgIDB4REM5QiB9LAotICAgIHsgIk1UUF9QUk9QRVJUWV9NT09EIiwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDB4REM5QyB9LAotICAgIHsgIk1UUF9QUk9QRVJUWV9EUk1fU1RBVFVTIiwgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDB4REM5RCB9LAotICAgIHsgIk1UUF9QUk9QRVJUWV9TVUJfREVTQ1JJUFRJT04iLCAgICAgICAgICAgICAgICAgICAgICAgIDB4REM5RSB9LAotICAgIHsgIk1UUF9QUk9QRVJUWV9JU19DUk9QUEVEIiwgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDB4RENEMSB9LAotICAgIHsgIk1UUF9QUk9QRVJUWV9JU19DT0xPVVJfQ09SUkVDVEVEIiwgICAgICAgICAgICAgICAgICAgIDB4RENEMiB9LAotICAgIHsgIk1UUF9QUk9QRVJUWV9JTUFHRV9CSVRfREVQVEgiLCAgICAgICAgICAgICAgICAgICAgICAgIDB4RENEMyB9LAotICAgIHsgIk1UUF9QUk9QRVJUWV9GX05VTUJFUiIsICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDB4RENENCB9LAotICAgIHsgIk1UUF9QUk9QRVJUWV9FWFBPU1VSRV9USU1FIiwgICAgICAgICAgICAgICAgICAgICAgICAgIDB4RENENSB9LAotICAgIHsgIk1UUF9QUk9QRVJUWV9FWFBPU1VSRV9JTkRFWCIsICAgICAgICAgICAgICAgICAgICAgICAgIDB4RENENiB9LAotICAgIHsgIk1UUF9QUk9QRVJUWV9UT1RBTF9CSVRSQVRFIiwgICAgICAgICAgICAgICAgICAgICAgICAgIDB4REU5MSB9LAotICAgIHsgIk1UUF9QUk9QRVJUWV9CSVRSQVRFX1RZUEUiLCAgICAgICAgICAgICAgICAgICAgICAgICAgIDB4REU5MiB9LAotICAgIHsgIk1UUF9QUk9QRVJUWV9TQU1QTEVfUkFURSIsICAgICAgICAgICAgICAgICAgICAgICAgICAgIDB4REU5MyB9LAotICAgIHsgIk1UUF9QUk9QRVJUWV9OVU1CRVJfT0ZfQ0hBTk5FTFMiLCAgICAgICAgICAgICAgICAgICAgIDB4REU5NCB9LAotICAgIHsgIk1UUF9QUk9QRVJUWV9BVURJT19CSVRfREVQVEgiLCAgICAgICAgICAgICAgICAgICAgICAgIDB4REU5NSB9LAotICAgIHsgIk1UUF9QUk9QRVJUWV9TQ0FOX1RZUEUiLCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDB4REU5NyB9LAotICAgIHsgIk1UUF9QUk9QRVJUWV9BVURJT19XQVZFX0NPREVDIiwgICAgICAgICAgICAgICAgICAgICAgIDB4REU5OSB9LAotICAgIHsgIk1UUF9QUk9QRVJUWV9BVURJT19CSVRSQVRFIiwgICAgICAgICAgICAgICAgICAgICAgICAgIDB4REU5QSB9LAotICAgIHsgIk1UUF9QUk9QRVJUWV9WSURFT19GT1VSQ0NfQ09ERUMiLCAgICAgICAgICAgICAgICAgICAgIDB4REU5QiB9LAotICAgIHsgIk1UUF9QUk9QRVJUWV9WSURFT19CSVRSQVRFIiwgICAgICAgICAgICAgICAgICAgICAgICAgIDB4REU5QyB9LAotICAgIHsgIk1UUF9QUk9QRVJUWV9GUkFNRVNfUEVSX1RIT1VTQU5EX1NFQ09ORFMiLCAgICAgICAgICAgIDB4REU5RCB9LAotICAgIHsgIk1UUF9QUk9QRVJUWV9LRVlGUkFNRV9ESVNUQU5DRSIsICAgICAgICAgICAgICAgICAgICAgIDB4REU5RSB9LAotICAgIHsgIk1UUF9QUk9QRVJUWV9CVUZGRVJfU0laRSIsICAgICAgICAgICAgICAgICAgICAgICAgICAgIDB4REU5RiB9LAotICAgIHsgIk1UUF9QUk9QRVJUWV9FTkNPRElOR19RVUFMSVRZIiwgICAgICAgICAgICAgICAgICAgICAgIDB4REVBMCB9LAotICAgIHsgIk1UUF9QUk9QRVJUWV9FTkNPRElOR19QUk9GSUxFIiwgICAgICAgICAgICAgICAgICAgICAgIDB4REVBMSB9LAotICAgIHsgIk1UUF9QUk9QRVJUWV9ESVNQTEFZX05BTUUiLCAgICAgICAgICAgICAgICAgICAgICAgICAgIDB4RENFMCB9LAotICAgIHsgIk1UUF9QUk9QRVJUWV9CT0RZX1RFWFQiLCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDB4RENFMSB9LAotICAgIHsgIk1UUF9QUk9QRVJUWV9TVUJKRUNUIiwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDB4RENFMiB9LAotICAgIHsgIk1UUF9QUk9QRVJUWV9QUklPUklUWSIsICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDB4RENFMyB9LAotICAgIHsgIk1UUF9QUk9QRVJUWV9HSVZFTl9OQU1FIiwgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDB4REQwMCB9LAotICAgIHsgIk1UUF9QUk9QRVJUWV9NSURETEVfTkFNRVMiLCAgICAgICAgICAgICAgICAgICAgICAgICAgIDB4REQwMSB9LAotICAgIHsgIk1UUF9QUk9QRVJUWV9GQU1JTFlfTkFNRSIsICAgICAgICAgICAgICAgICAgICAgICAgICAgIDB4REQwMiB9LAotICAgIHsgIk1UUF9QUk9QRVJUWV9QUkVGSVgiLCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDB4REQwMyB9LAotICAgIHsgIk1UUF9QUk9QRVJUWV9TVUZGSVgiLCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDB4REQwNCB9LAotICAgIHsgIk1UUF9QUk9QRVJUWV9QSE9ORVRJQ19HSVZFTl9OQU1FIiwgICAgICAgICAgICAgICAgICAgIDB4REQwNSB9LAotICAgIHsgIk1UUF9QUk9QRVJUWV9QSE9ORVRJQ19GQU1JTFlfTkFNRSIsICAgICAgICAgICAgICAgICAgIDB4REQwNiB9LAotICAgIHsgIk1UUF9QUk9QRVJUWV9FTUFJTF9QUklNQVJZIiwgICAgICAgICAgICAgICAgICAgICAgICAgIDB4REQwNyB9LAotICAgIHsgIk1UUF9QUk9QRVJUWV9FTUFJTF9QRVJTT05BTF8xIiwgICAgICAgICAgICAgICAgICAgICAgIDB4REQwOCB9LAotICAgIHsgIk1UUF9QUk9QRVJUWV9FTUFJTF9QRVJTT05BTF8yIiwgICAgICAgICAgICAgICAgICAgICAgIDB4REQwOSB9LAotICAgIHsgIk1UUF9QUk9QRVJUWV9FTUFJTF9CVVNJTkVTU18xIiwgICAgICAgICAgICAgICAgICAgICAgIDB4REQwQSB9LAotICAgIHsgIk1UUF9QUk9QRVJUWV9FTUFJTF9CVVNJTkVTU18yIiwgICAgICAgICAgICAgICAgICAgICAgIDB4REQwQiB9LAotICAgIHsgIk1UUF9QUk9QRVJUWV9FTUFJTF9PVEhFUlMiLCAgICAgICAgICAgICAgICAgICAgICAgICAgIDB4REQwQyB9LAotICAgIHsgIk1UUF9QUk9QRVJUWV9QSE9ORV9OVU1CRVJfUFJJTUFSWSIsICAgICAgICAgICAgICAgICAgIDB4REQwRCB9LAotICAgIHsgIk1UUF9QUk9QRVJUWV9QSE9ORV9OVU1CRVJfUEVSU09OQUwiLCAgICAgICAgICAgICAgICAgIDB4REQwRSB9LAotICAgIHsgIk1UUF9QUk9QRVJUWV9QSE9ORV9OVU1CRVJfUEVSU09OQUxfMiIsICAgICAgICAgICAgICAgIDB4REQwRiB9LAotICAgIHsgIk1UUF9QUk9QRVJUWV9QSE9ORV9OVU1CRVJfQlVTSU5FU1MiLCAgICAgICAgICAgICAgICAgIDB4REQxMCB9LAotICAgIHsgIk1UUF9QUk9QRVJUWV9QSE9ORV9OVU1CRVJfQlVTSU5FU1NfMiIsICAgICAgICAgICAgICAgIDB4REQxMSB9LAotICAgIHsgIk1UUF9QUk9QRVJUWV9QSE9ORV9OVU1CRVJfTU9CSUxFIiwgICAgICAgICAgICAgICAgICAgIDB4REQxMiB9LAotICAgIHsgIk1UUF9QUk9QRVJUWV9QSE9ORV9OVU1CRVJfTU9CSUxFXzIiLCAgICAgICAgICAgICAgICAgIDB4REQxMyB9LAotICAgIHsgIk1UUF9QUk9QRVJUWV9GQVhfTlVNQkVSX1BSSU1BUlkiLCAgICAgICAgICAgICAgICAgICAgIDB4REQxNCB9LAotICAgIHsgIk1UUF9QUk9QRVJUWV9GQVhfTlVNQkVSX1BFUlNPTkFMIiwgICAgICAgICAgICAgICAgICAgIDB4REQxNSB9LAotICAgIHsgIk1UUF9QUk9QRVJUWV9GQVhfTlVNQkVSX0JVU0lORVNTIiwgICAgICAgICAgICAgICAgICAgIDB4REQxNiB9LAotICAgIHsgIk1UUF9QUk9QRVJUWV9QQUdFUl9OVU1CRVIiLCAgICAgICAgICAgICAgICAgICAgICAgICAgIDB4REQxNyB9LAotICAgIHsgIk1UUF9QUk9QRVJUWV9QSE9ORV9OVU1CRVJfT1RIRVJTIiwgICAgICAgICAgICAgICAgICAgIDB4REQxOCB9LAotICAgIHsgIk1UUF9QUk9QRVJUWV9QUklNQVJZX1dFQl9BRERSRVNTIiwgICAgICAgICAgICAgICAgICAgIDB4REQxOSB9LAotICAgIHsgIk1UUF9QUk9QRVJUWV9QRVJTT05BTF9XRUJfQUREUkVTUyIsICAgICAgICAgICAgICAgICAgIDB4REQxQSB9LAotICAgIHsgIk1UUF9QUk9QRVJUWV9CVVNJTkVTU19XRUJfQUREUkVTUyIsICAgICAgICAgICAgICAgICAgIDB4REQxQiB9LAotICAgIHsgIk1UUF9QUk9QRVJUWV9JTlNUQU5UX01FU1NBTkdFUl9BRERSRVNTIiwgICAgICAgICAgICAgIDB4REQxQyB9LAotICAgIHsgIk1UUF9QUk9QRVJUWV9JTlNUQU5UX01FU1NBTkdFUl9BRERSRVNTXzIiLCAgICAgICAgICAgIDB4REQxRCB9LAotICAgIHsgIk1UUF9QUk9QRVJUWV9JTlNUQU5UX01FU1NBTkdFUl9BRERSRVNTXzMiLCAgICAgICAgICAgIDB4REQxRSB9LAotICAgIHsgIk1UUF9QUk9QRVJUWV9QT1NUQUxfQUREUkVTU19QRVJTT05BTF9GVUxMIiwgICAgICAgICAgIDB4REQxRiB9LAotICAgIHsgIk1UUF9QUk9QRVJUWV9QT1NUQUxfQUREUkVTU19QRVJTT05BTF9MSU5FXzEiLCAgICAgICAgIDB4REQyMCB9LAotICAgIHsgIk1UUF9QUk9QRVJUWV9QT1NUQUxfQUREUkVTU19QRVJTT05BTF9MSU5FXzIiLCAgICAgICAgIDB4REQyMSB9LAotICAgIHsgIk1UUF9QUk9QRVJUWV9QT1NUQUxfQUREUkVTU19QRVJTT05BTF9DSVRZIiwgICAgICAgICAgIDB4REQyMiB9LAotICAgIHsgIk1UUF9QUk9QRVJUWV9QT1NUQUxfQUREUkVTU19QRVJTT05BTF9SRUdJT04iLCAgICAgICAgID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EhFUl9MSU5FXzIiLCAgICAgICAgICAgIDB4REQyRiB9LAotICAgIHsgIk1UUF9QUk9QRVJUWV9QT1NUQUxfQUREUkVTU19PVEhFUl9DSVRZIiwgICAgICAgICAgICAgIDB4REQzMCB9LAotICAgIHsgIk1UUF9QUk9QRVJUWV9QT1NUQUxfQUREUkVTU19PVEhFUl9SRUdJT04iLCAgICAgICAgICAgIDB4REQzMSB9LAotICAgIHsgIk1UUF9QUk9QRVJUWV9QT1NUQUxfQUREUkVTU19PVEhFUl9QT1NUQUxfQ09ERSIsICAgICAgIDB4REQzMiB9LAotICAgIHsgIk1UUF9QUk9QRVJUWV9QT1NUQUxfQUREUkVTU19PVEhFUl9DT1VOVFJZIiwgICAgICAgICAgIDB4REQzMyB9LAotICAgIHsgIk1UUF9QUk9QRVJUWV9PUkdBTklaQVRJT05fTkFNRSIsICAgICAgICAgICAgICAgICAgICAgIDB4REQzNCB9LAotICAgIHsgIk1UUF9QUk9QRVJUWV9QSE9ORVRJQ19PUkdBTklaQVRJT05fTkFNRSIsICAgICAgICAgICAgIDB4REQzNSB9LAotICAgIHsgIk1UUF9QUk9QRVJUWV9ST0xFIiwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDB4REQzNiB9LAotICAgIHsgIk1UUF9QUk9QRVJUWV9CSVJUSERBVEUiLCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDB4REQzNyB9LAotICAgIHsgIk1UUF9QUk9QRVJUWV9NRVNTQUdFX1RPIiwgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDB4REQ0MCB9LAotICAgIHsgIk1UUF9QUk9QRVJUWV9NRVNTQUdFX0NDIiwgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDB4REQ0MSB9LAotICAgIHsgIk1UUF9QUk9QRVJUWV9NRVNTQUdFX0JDQyIsICAgICAgICAgICAgICAgICAgICAgICAgICAgIDB4REQ0MiB9LAotICAgIHsgIk1UUF9QUk9QRVJUWV9NRVNTQUdFX1JFQ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F9QUk9QRVJUWV9BQ1RJVklUWV9SRU1BSU5ERVJfVElNRSIsICAgICAgICAgICAgICAgIDB4REQ1QSB9LAotICAgIHsgIk1UUF9QUk9QRVJUWV9BQ1RJVklUWV9PV05FUiIsICAgICAgICAgICAgICAgICAgICAgICAgIDB4REQ1QiB9LAotICAgIHsgIk1UUF9QUk9QRVJUWV9BQ1RJVklUWV9TVEFUVVMiLCAgICAgICAgICAgICAgICAgICAgICAgIDB4REQ1QyB9LAotICAgIHsgIk1UUF9QUk9QRVJUWV9PV05FUiIsICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDB4REQ1RCB9LAotICAgIHsgIk1UUF9QUk9QRVJUWV9FRElUT1IiLCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDB4REQ1RSB9LAotICAgIHsgIk1UUF9QUk9QRVJUWV9XRUJNQVNURVIiLCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDB4REQ1RiB9LAotICAgIHsgIk1UUF9QUk9QRVJUWV9VUkxfU09VUkNFIiwgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDB4REQ2MCB9LAotICAgIHsgIk1UUF9QUk9QRVJUWV9VUkxfREVTVElOQVRJT04iLCAgICAgICAgICAgICAgICAgICAgICAgIDB4REQ2MSB9LAotICAgIHsgIk1UUF9QUk9QRVJUWV9USU1FX0JPT0tNQVJLIiwgICAgICAgICAgICAgICAgICAgICAgICAgIDB4REQ2MiB9LAotICAgIHsgIk1UUF9QUk9QRVJUWV9PQkpFQ1RfQk9PS01BUksiLCAgICAgICAgICAgICAgICAgICAgICAgIDB4REQ2MyB9LAotICAgIHsgIk1UUF9QUk9QRVJUWV9CWVRFX0JPT0tNQVJLIiwgICAgICAgICAgICAgICAgICAgICAgICAgIDB4REQ2NCB9LAotICAgIHsgIk1UUF9QUk9QRVJUWV9MQVNUX0JVSUxEX0RBVEUiLCAgICAgICAgICAgICAgICAgICAgICAgIDB4REQ3MCB9LAotICAgIHsgIk1UUF9QUk9QRVJUWV9USU1FX1RPX0xJVkUiLCAgICAgICAgICAgICAgICAgICAgICAgICAgIDB4REQ3MSB9LAotICAgIHsgIk1UUF9QUk9QRVJUWV9NRURJQV9HVUlEIiwgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDB4REQ3MiB9LAotICAgIHsgMCwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDAgICAgICB9LAotfTsKLQotc3RhdGljIGNvbnN0IENvZGVFbnRyeSBzRGV2aWNlUHJvcENvZGVzW10gPSB7Ci0gICAgeyAiTVRQX0RFVklDRV9QUk9QRVJUWV9VTkRFRklORUQiLCAgICAgICAgICAgICAgICAgICAgICAgMHg1MDAwIH0sCi0gICAgeyAiTVRQX0RFVklDRV9QUk9QRVJUWV9CQVRURVJZX0xFVkVMIiwgICAgICAgICAgICAgICAgICAgMHg1MDAxIH0sCi0gICAgeyAiTVRQX0RFVklDRV9QUk9QRVJUWV9GVU5DVElPTkFMX01PREUiLCAgICAgICAgICAgICAgICAgMHg1MDAyIH0sCi0gICAgeyAiTVRQX0RFVklDRV9QUk9QRVJUWV9JTUFHRV9TSVpFIiwgICAgICAgICAgICAgICAgICAgICAgMHg1MDAzIH0sCi0gICAgeyAiTVRQX0RFVklDRV9QUk9QRVJUWV9DT01QUkVTU0lPTl9TRVRUSU5HIiwgICAgICAgICAgICAgMHg1MDA0IH0sCi0gICAgeyAiTVRQX0RFVklDRV9QUk9QRVJUWV9XSElURV9CQUxBTkNFIiwgICAgICAgICAgICAgICAgICAgMHg1MDA1IH0sCi0gICAgeyAiTVRQX0RFVklDRV9QUk9QRVJUWV9SR0JfR0FJTiIsICAgICAgICAgICAgICAgICAgICAgICAgMHg1MDA2IH0sCi0gICAgeyAiTVRQX0RFVklDRV9QUk9QRVJUWV9GX05VTUJFUiIsICAgICAgICAgICAgICAgICAgICAgICAgMHg1MDA3IH0sCi0gICAgeyAiTVRQX0RFVklDRV9QUk9QRVJUWV9GT0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RQX0RFVklDRV9QUk9QRVJUWV9DT05UUkFTVCIsICAgICAgICAgICAgICAgICAgICAgICAgMHg1MDE0IH0sCi0gICAgeyAiTVRQX0RFVklDRV9QUk9QRVJUWV9TSEFSUE5FU1MiLCAgICAgICAgICAgICAgICAgICAgICAgMHg1MDE1IH0sCi0gICAgeyAiTVRQX0RFVklDRV9QUk9QRVJUWV9ESUdJVEFMX1pPT00iLCAgICAgICAgICAgICAgICAgICAgMHg1MDE2IH0sCi0gICAgeyAiTVRQX0RFVklDRV9QUk9QRVJUWV9FRkZFQ1RfTU9ERSIsICAgICAgICAgICAgICAgICAgICAgMHg1MDE3IH0sCi0gICAgeyAiTVRQX0RFVklDRV9QUk9QRVJUWV9CVVJTVF9OVU1CRVIiLCAgICAgICAgICAgICAgICAgICAgMHg1MDE4IH0sCi0gICAgeyAiTVRQX0RFVklDRV9QUk9QRVJUWV9CVVJTVF9JTlRFUlZBTCIsICAgICAgICAgICAgICAgICAgMHg1MDE5IH0sCi0gICAgeyAiTVRQX0RFVklDRV9QUk9QRVJUWV9USU1FTEFQU0VfTlVNQkVSIiwgICAgICAgICAgICAgICAgMHg1MDFBIH0sCi0gICAgeyAiTVRQX0RFVklDRV9QUk9QRVJUWV9USU1FTEFQU0VfSU5URVJWQUwiLCAgICAgICAgICAgICAgMHg1MDFCIH0sCi0gICAgeyAiTVRQX0RFVklDRV9QUk9QRVJUWV9GT0NVU19NRVRFUklOR19NT0RFIiwgICAgICAgICAgICAgMHg1MDFDIH0sCi0gICAgeyAiTVRQX0RFVklDRV9QUk9QRVJUWV9VUExPQURfVVJMIiwgICAgICAgICAgICAgICAgICAgICAgMHg1MDFEIH0sCi0gICAgeyAiTVRQX0RFVklDRV9QUk9QRVJUWV9BUlRJU1QiLCAgICAgICAgICAgICAgICAgICAgICAgICAgMHg1MDFFIH0sCi0gICAgeyAiTVRQX0RFVklDRV9QUk9QRVJUWV9DT1BZUklHSFRfSU5GTyIsICAgICAgICAgICAgICAgICAgMHg1MDFGIH0sCi0gICAgeyAiTVRQX0RFVklDRV9QUk9QRVJUWV9TWU5DSFJPTklaQVRJT05fUEFSVE5FUiIsICAgICAgICAgMHhENDAxIH0sCi0gICAgeyAiTVRQX0RFVklDRV9QUk9QRVJUWV9ERVZJQ0VfRlJJRU5ETFlfTkFNRSIsICAgICAgICAgICAgMHhENDAyIH0sCi0gICAgeyAiTVRQX0RFVklDRV9QUk9QRVJUWV9WT0xVTUUiLCAgICAgICAgICAgICAgICAgICAgICAgICAgMHhENDAzIH0sCi0gICAgeyAiTVRQX0RFVklDRV9QUk9QRVJUWV9TVVBQT1JURURfRk9STUFUU19PUkRFUkVEIiwgICAgICAgMHhENDA0IH0sCi0gICAgeyAiTVRQX0RFVklDRV9QUk9QRVJUWV9ERVZJQ0VfSUNPTiIsICAgICAgICAgICAgICAgICAgICAgMHhENDA1IH0sCi0gICAgeyAiTVRQX0RFVklDRV9QUk9QRVJUWV9QTEFZQkFDS19SQVRFIiwgICAgICAgICAgICAgICAgICAgMHhENDEwIH0sCi0gICAgeyAiTVRQX0RFVklDRV9QUk9QRVJUWV9QTEFZQkFDS19PQkpFQ1QiLCAgICAgICAgICAgICAgICAgMHhENDExIH0sCi0gICAgeyAiTVRQX0RFVklDRV9QUk9QRVJUWV9QTEFZQkFDS19DT05UQUlORVJfSU5ERVgiLCAgICAgICAgMHhENDEyIH0sCi0gICAgeyAiTVRQX0RFVklDRV9QUk9QRVJUWV9TRVNTSU9OX0lOSVRJQVRPUl9WRVJTSU9OX0lORk8iLCAgMHhENDA2IH0sCi0gICAgeyAiTVRQX0RFVklDRV9QUk9QRVJUWV9QRVJDRUlWRURfREVWSUNFX1RZUEUiLCAgICAgICAgICAgMHhENDA3IH0sCi0gICAgeyAwLCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMCAgICAgIH0sCi19OwotCi1zdGF0aWMgY29uc3QgY2hhciogZ2V0Q29kZU5hbWUodWludDE2X3QgY29kZS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YW51ZmFjdHVyZXJOYW1lKTsKLSAgICAgICAgICAgICAgICBmcmVlKHByb2R1Y3ROYW1lKTsKLSAgICAgICAgICAgIH0gZWxzZSBpZiAoaW50ZXJmYWNlLT5iSW50ZXJmYWNlQ2xhc3MgPT0gMHhGRiAmJgotICAgICAgICAgICAgICAgICAgICBpbnRlcmZhY2UtPmJJbnRlcmZhY2VTdWJDbGFzcyA9PSAweEZGICYmCi0gICAgICAgICAgICAgICAgICAgIGludGVyZmFjZS0+YkludGVyZmFjZVByb3RvY29sID09IDApIHsKLSAgICAgICAgICAgICAgICBjaGFyKiBpbnRlcmZhY2VOYW1lID0gdXNiX2RldmljZV9nZXRfc3RyaW5nKGRldmljZSwgaW50ZXJmYWNlLT5pSW50ZXJmYWNlKTsKLSAgICAgICAgICAgICAgICBpZiAoIWludGVyZmFjZU5hbWUpIHsKLSAgICAgICAgICAgICAgICAgICAgY29udGludWU7Ci0gICAgICAgICAgICAgICAgfSBlbHNlIGlmIChzdHJjbXAoaW50ZXJmYWNlTmFtZSwgIk1UUCIpKSB7Ci0gICAgICAgICAgICAgICAgICAgIGZyZWUoaW50ZXJmYWNlTmFtZSk7Ci0gICAgICAgICAgICAgICAgICAgIGNvbnRpbnVlOwotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICBmcmVlKGludGVyZmFjZU5hbWUpOwotCi0gICAgICAgICAgICAgICAgLy8gTG9va3MgbGlrZSBhbiBhbmRyb2lkIHN0eWxlIE1UUCBkZXZpY2UKLSAgICAgICAgICAgICAgICBjaGFyKiBtYW51ZmFjdHVyZXJOYW1lID0gdXNiX2RldmljZV9nZXRfbWFudWZhY3R1cmVyX25hbWUoZGV2aWNlKTsKLSAgICAgICAgICAgICAgICBjaGFyKiBwcm9kdWN0TmFtZSA9IHVzYl9kZXZpY2VfZ2V0X3Byb2R1Y3RfbmFtZShkZXZpY2UpOwotICAgICAgICAgICAgICAgIEFMT0dEKCJGb3VuZCBNVFAgZGV2aWNlOiBcIi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ICAgaW50IHJldCA9IHVzYl9kZXZpY2VfY29udHJvbF90cmFuc2ZlcihkZXZpY2UsCi0gICAgICAgICAgICAgICAgICAgICAgICBVU0JfRElSX0lOfFVTQl9SRUNJUF9ERVZJQ0V8VVNCX1RZUEVfU1RBTkRBUkQsCi0gICAgICAgICAgICAgICAgICAgICAgICBVU0JfUkVRX0dFVF9ERVNDUklQVE9SLCAoVVNCX0RUX1NUUklORyA8PCA4KSB8IDB4RUUsCi0gICAgICAgICAgICAgICAgICAgICAgICAwLCBidWZmZXIsIHNpemVvZihidWZmZXIpLCAwKTsKLSAgICAgICAgICAgICAgICBwcmludGYoInVzYl9kZXZpY2VfY29udHJvbF90cmFuc2ZlciByZXR1cm5lZCAlZCBlcnJubzogJWRcbiIsIHJldCwgZXJybm8pOwotICAgICAgICAgICAgICAgIGlmIChyZXQgPiAwKSB7Ci0gICAgICAgICAgICAgICAgICAgIHByaW50ZigiZ290IE1UUCBzdHJpbmcgJXNcbiIsIGJ1ZmZlcik7Ci0gICAgICAgICAgICAgICAgICAgIHJldCA9IHVzYl9kZXZpY2VfY29udHJvbF90cmFuc2ZlcihkZXZpY2UsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgVVNCX0RJUl9JTnxVU0JfUkVDSVBfREVWSUNFfFVTQl9UWVBFX1ZFTkRPUiwgMSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAwLCA0LCBidWZmZXIsIHNpemVvZihidWZmZXIpLCAwKTsKLSAgICAgICAgICAgICAgICAgICAgcHJpbnRmKCJPUyBkZXNjcmlwdG9yIGdvdCAlZFxuIiwgcmV0KTsKLSAgICAgICAgICAgICAgICB9IGVsc2UgewotICAgICAgICAgICAgICAgICAgICBwcmludGYoIm5vIE1UUCBzdHJpbmdcbiIpOwotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgIH0KLSNlbmRpZgotICAgICAgICAgICAgLy8gaWYgd2UgZ290IGhlcmUsIHRoZW4gd2UgaGF2ZSBhIGxpa2VseSBNVFAgb3IgUFRQIGRldmljZQotCi0gICAgICAgICAgICAvLyBpbnRlcmZhY2Ugc2hvdWxkIGJlIGZvbGxvd2VkIGJ5IHRocmVlIGVuZHBvaW50cwotICAgICAgICAgICAgc3RydWN0IHVzYl9lbmRwb2ludF9kZXNjcmlwdG9yICplcDsKLSAgICAgICAgICAgIHN0cnVjdCB1c2JfZW5kcG9pbnRfZGVzY3JpcHRvciAqZXBfaW5fZGVzYyA9IE5VTEw7Ci0gICAgICAgICAgICBzdHJ1Y3QgdXNiX2VuZHBvaW50X2Rlc2NyaXB0b3IgKmVwX291dF9kZXNjID0gTlVMTDsKLSAgICAgICAgICAgIHN0cnVjdCB1c2JfZW5kcG9pbnRfZGVzY3JpcHRvciAqZXBfaW50cl9kZXNjID0gTlVMTDsKLSAgICAgICAgICAgIGZvciAoaW50IGkgPSAwOyBpIDwgMzsgaSsrKSB7Ci0gICAgICAgICAgICAgICAgZXAgPSAoc3RydWN0IHVzYl9lbmRwb2ludF9kZXNjcmlwdG9yICopdXNiX2Rlc2NyaXB0b3JfaXRlcl9uZXh0KCZpdGVyKTsKLSAgICAgICAgICAgICAgICBpZiAoIWVwIHx8IGVwLT5iRGVzY3JpcHRvclR5cGUgIT0gVVNCX0RUX0VORFBPSU5UKSB7Ci0gICAgICAgICAgICAgICAgICAgIEFMT0dFKCJlbmRwb2ludHMgbm90IGZvdW5kXG4iKTsKLSAgICAgICAgICAgICAgICAgICAgdXNiX2RldmljZV9jbG9zZShkZXZpY2UpOwotICAgICAgICAgICAgICAgICAgICByZXR1cm4gTlVMTDsKLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgaWYgKGVwLT5ibUF0dHJpYnV0ZXMgPT0gVVNCX0VORFBPSU5UX1hGRVJfQlVMSykgewotICAgICAgICAgICAgICAgICAgICBpZiAoZXAtPmJFbmRwb2ludEFkZHJlc3MgJiBVU0JfRU5EUE9JTlRfRElSX01BU0spCi0gICAgICAgICAgICAgICAgICAgICAgICBlcF9pbl9kZXNjID0gZXA7Ci0gICAgICAgICAgICAgICAgICAgIGVsc2UKLSAgICAgICAgICAgICAgICAgICAgICAgIGVwX291dF9kZXNjID0gZXA7Ci0gICAgICAgICAgICAgICAgfSBlbHNlIGlmIChlcC0+Ym1BdHRyaWJ1dGVzID09IFVTQl9FTkRQT0lOVF9YRkVSX0lOVCAmJgotICAgICAgICAgICAgICAgICAgICBlcC0+YkVuZHBvaW50QWRkcmVzcyAmIFVTQl9FTkRQT0lOVF9ESVJfTUFTSykgewotICAgICAgICAgICAgICAgICAgICBlcF9pbnRyX2Rlc2MgPSBlcDsKLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICB9Ci0gICAgICAgICAgICBpZiAoIWVwX2luX2Rlc2MgfHwgIWVwX291dF9kZXNjIHx8ICFlcF9pbnRyX2Rlc2MpIHsKLSAgICAgICAgICAgICAgICBBTE9HRSgiZW5kcG9pbnRzIG5vdCBmb3VuZFxuIik7Ci0gICAgICAgICAgICAgICAgdXNiX2RldmljZV9jbG9zZShkZXZpY2UpOwotICAgICAgICAgICAgICAgIHJldHVybiBOVUxMOwotICAgICAgICAgICAgfQotCi0gICAgICAgICAgICBpZiAodXNiX2RldmljZV9jbGFpbV9pbnRlcmZhY2UoZGV2aWNlLCBpbnRlcmZhY2UtPmJJbnRlcmZhY2VOdW1iZXIpKSB7Ci0gICAgICAgICAgICAgICAgQUxPR0UoInVzYl9kZXZpY2VfY2xhaW1faW50ZXJmYWNlIGZhaWxlZCBlcnJubzogJWRcbiIsIGVycm5vKTsKLSAgICAgICAgICAgICAgICB1c2JfZGV2aWNlX2Nsb3NlKGRldmljZSk7Ci0gICAgICAgICAgICAgICAgcmV0dXJuIE5VTEw7Ci0gICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgIE10cERldmljZSogbXRwRGV2aWNlID0gbmV3IE10cERldmljZShkZXZpY2UsIGludGVyZmFjZS0+YkludGVyZmFjZU51bWJlciwKLSAgICAgICAgICAgICAgICA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F9uZXcoZGV2aWNlLCBlcF9pbik7Ci0gICAgbVJlcXVlc3RPdXQgPSB1c2JfcmVxdWVzdF9uZXcoZGV2aWNlLCBlcF9vdXQpOwotICAgIG1SZXF1ZXN0SW50ciA9IHVzYl9yZXF1ZXN0X25ldyhkZXZpY2UsIGVwX2ludHIpOwotfQotCi1NdHBEZXZpY2U6On5NdHBEZXZpY2UoKSB7Ci0gICAgY2xvc2UoKTsKLSAgICBmb3IgKGludCBpID0gMDsgaSA8IG1EZXZpY2VQcm9wZXJ0aWVzLnNpemUoKTsgaSsrKQotICAgICAgICBkZWxldGUgbURldmljZVByb3BlcnRpZXNbaV07Ci0gICAgdXNiX3JlcXVlc3RfZnJlZShtUmVxdWVzdEluMSk7Ci0gICAgdXNiX3JlcXVlc3RfZnJlZShtUmVxdWVzdEluMik7Ci0gICAgdXNiX3JlcXVlc3RfZnJlZShtUmVxdWVzdE91dCk7Ci0gICAgdXNiX3JlcXVlc3RfZnJlZShtUmVxdWVzdEludHIpOwotfQotCi12b2lkIE10cERldmljZTo6aW5pdGlhbGl6ZSgpIHsKLSAgICBvcGVuU2Vzc2lvbigpOwotICAgIG1EZXZpY2VJbmZvID0gZ2V0RGV2aWNlSW5mbygpOwotICAgIGlmIChtRGV2aWNlSW5mbykgewotICAgICAgICBpZiAobURldmljZUluZm8tPm1EZXZpY2VQcm9wZXJ0aWVzKSB7Ci0gICAgICAgICAgICBpbnQgY291bnQgPSBtRGV2aWNlSW5mby0+bURldmljZVByb3BlcnRpZXMtPnNpemUoKTsKLSAgICAgICAgICAgIGZvciAoaW50IGkgPSAwOyBpIDwgY291bnQ7IGkrKykgewotICAgICAgICAgICAgICAgIE10cERldmljZVByb3BlcnR5IHByb3BDb2RlID0gKCptRGV2aWNlSW5mby0+bURldmljZVByb3BlcnRpZXMpW2ldOwotICAgICAgICAgICAgICAgIE10cFByb3BlcnR5KiBwcm9wZXJ0eSA9IGdldERldmljZVByb3BEZXNjKHByb3BDb2RlKTsKLSAgICAgICAgICAgICAgICBpZiAocHJvcGVydHkpCi0gICAgICAgICAgICAgICAgICAgIG1EZXZpY2VQcm9wZXJ0aWVzLnB1c2gocHJvcGVydHkpOwotICAgICAgICAgICAgfQotICAgICAgICB9Ci0gICAgfQotfQotCi12b2lkIE10cERldmljZTo6Y2xvc2UoKSB7Ci0gICAgaWYgKG1EZXZpY2UpIHsKLSAgICAgICAgdXNiX2RldmljZV9yZWxlYXNlX2ludGVyZmFjZShtRGV2aWNlLCBtSW50ZXJmYWNlKTsKLSAgICAgICAgdXNiX2RldmljZV9jbG9zZShtRGV2aWNlKTsKLSAgICAgICAgbURldmljZSA9IE5VTEw7Ci0gICAgfQotfQotCi12b2lkIE10cERldmljZTo6cHJpbnQoKSB7Ci0gICAgaWYgKG1EZXZpY2VJbmZvKSB7Ci0gICAgICAgIG1EZXZpY2VJbmZvLT5wcmludCgpOwotCi0gICAgICAgIGlmIChtRGV2aWNlSW5mby0+bURldmljZVByb3BlcnRpZXMpIHsKLSAgICAgICAgICAgIEFMT0dJKCIqKioqKiBERVZJQ0UgUFJPUEVSVElFUyAqKioqKlxuIik7Ci0gICAgICAgICAgICBpbnQgY291bnQgPSBtRGV2aWNlSW5mby0+bURldmljZVByb3BlcnRpZXMtPnNpemUoKTsKLSAgICAgICAgICAgIGZvciAoaW50IGkgPSAwOyBpIDwgY291bnQ7IGkrKykgewotICAgICAgICAgICAgICAgIE10cERldmljZVByb3BlcnR5IHByb3BDb2RlID0gKCptRGV2aWNlSW5mby0+bURldmljZVByb3BlcnRpZXMpW2ldOwotICAgICAgICAgICAgICAgIE10cFByb3BlcnR5KiBwcm9wZXJ0eSA9IGdldERldmljZVByb3BEZXNjKHByb3BDb2RlKTsKLSAgICAgICAgICAgICAgICBpZiAocHJvcGVydHkpIHsKLSAgICAgICAgICAgICAgICAgICAgcHJvcGVydHktPnByaW50KCk7Ci0gICAgICAgICAgICAgICAgICAgIGRlbGV0ZSBwcm9wZXJ0eTsKLSAgICAgICAgICAgICAg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F0YUFzeW5jKHJlcSkpIHsKLSAgICAgICAgICAgICAgICAgICAgQUxPR0UoInJlYWREYXRhQXN5bmMgZmFpbGVkIik7Ci0gICAgICAgICAgICAgICAgICAgIGdvdG8gZmFpbDsKLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICB9IGVsc2UgewotICAgICAgICAgICAgICAgIHJlcSA9IE5VTEw7Ci0gICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgIGlmICh3cml0ZUJ1ZmZlcikgewotICAgICAgICAgICAgICAgIC8vIHdyaXRlIHByZXZpb3VzIGJ1ZmZlcgotICAgICAgICAgICAgICAgIGlmICghY2FsbGJhY2sod3JpdGVCdWZmZXIsIG9mZnNldCwgd3JpdGVMZW5ndGgsIGNsaWVudERhdGEpKSB7Ci0gICAgICAgICAgICAgICAgICAgIEFMT0dFKCJ3cml0ZSBmYWlsZWQiKTsKLSAgICAgICAgICAgICAgICAgICAgLy8gd2FpdCBmb3IgcGVuZGluZyByZWFkIGJlZm9yZSBmYWlsaW5nCi0gICAgICAgICAgICAgICAgICAgIGlmIChyZXEpCi0gICAgICAgICAgICAgICAgICAgICAgICBtRGF0YS5yZWFkRGF0YVdhaXQobURldmljZSk7Ci0gICAgICAgICAgICAgICAgICAgIGdvdG8gZmFpbDsKLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgb2Zmc2V0ICs9IHdyaXRlTGVuZ3RoOwotICAgICAgICAgICAgICAgIHdyaXRlQnVmZmVyID0gTlVMTDsKLSAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgLy8gd2FpdCBmb3IgcmVhZCB0byBjb21wbGV0ZQotICAgICAgICAgICAgaWYgKHJlcSkgewotICAgICAgICAgICAgICAgIGludCByZWFkID0gbURhdGEucmVhZERhdGFXYWl0KG1EZXZpY2UpOwotICAgICAgICAgICAgICAgIGlmIChyZWFkIDwgMCkKLSAgICAgICAgICAgICAgICAgICAgZ290byBmYWlsOwotCi0gICAgICAgICAgICAgICAga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lhbERhdGFMZW5ndGgpIHsKLSAgICAgICAgICAgICAgICAgICAgZnJlZShpbml0aWFsRGF0YSk7Ci0gICAgICAgICAgICAgICAgICAgIGdvdG8gZmFpbDsKLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgcmVtYWluaW5nIC09IGluaXRpYWxEYXRhTGVuZ3RoOwotICAgICAgICAgICAgfQotICAgICAgICAgICAgZnJlZShpbml0aWFsRGF0YSk7Ci0gICAgICAgIH0KLQotICAgICAgICAvLyBVU0IgcmVhZHMgZ3JlYXRlciB0aGFuIDE2SyBkb24ndCB3b3JrCi0gICAgICAgIGNoYXIgYnVmZmVyMVsxNjM4NF0sIGJ1ZmZlcjJbMTYzODRdOwotICAgICAgICBtUmVxdWVzdEluMS0+YnVmZmVyID0gYnVmZmVyMTsKLSAgICAgICAgbVJlcXVlc3RJbjItPmJ1ZmZlciA9IGJ1ZmZlcjI7Ci0gICAgICAgIHN0cnVjdCB1c2JfcmVxdWVzdCogcmVxID0gbVJlcXVlc3RJbjE7Ci0gICAgICAgIHZvaWQqIHdyaXRlQnVmZmVyID0gTlVMTDsKLSAgICAgICAgaW50IHdyaXRlTGVuZ3RoID0gMDsKLQotICAgICAgICB3aGlsZSAocmVtYWluaW5nID4gMCB8fCB3cml0ZUJ1ZmZlcikgewotICAgICAgICAgICAgaWYgKHJlbWFpbmluZyA+IDApIHsKLSAgICAgICAgICAgICAgICAvLyBxdWV1ZSB1cCBhIHJlYWQgcmVxdWVzdAotICAgICAgICAgICAgICAgIHJlcS0+YnVmZmVyX2xlbmd0aCA9IChyZW1haW5pbmcgPiBzaXplb2YoYnVmZmVyMSkgPyBzaXplb2YoYnVmZmVyMSkgOiByZW1haW5pbmcpOwotICAgICAgICAgICAgICAgIGlmIChtRGF0YS5yZWFkRGF0YUFzeW5jKHJlcSkpIHsKLSAgICAgICAgICAgICAgICAgICAgQUxPR0UoInJlYWREYXRhQXN5bmMgZmFpbGVkIik7Ci0gICAgICAgICAgICAgICAgICAgIGdvdG8gZmFpbDsKLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICB9IGVsc2UgewotICAgICAgICAgICAgICAgIHJlcSA9IE5VTEw7Ci0gICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgIGlmICh3cml0ZUJ1ZmZlcikgewotICAgICAgICAgICAgICAgIC8vIHdyaXRlIHByZXZpb3VzIGJ1ZmZlcgotICAgICAgICAgICAgICAgIGlmICh3cml0ZShmZCwgd3JpdGVCdWZmZXIsIHdyaXRlTGVuZ3RoKSAhPSB3cml0ZUxlbmd0aCkgewotICAgICAgICAgICAgICAgICAgICBBTE9HRSgid3JpdGUgZmFpbGVkIik7Ci0gICAgICAgICAgICAgICAgICAgIC8vIHdhaXQgZm9yIHBlbmRpbmcgcmVhZCBiZWZvcmUgZmFpbGluZwotICAgICAgICAgICAgICAgICAgICBpZiAocmVxKQotICAgICAgICAgICAgICAgICAgICAgICAgbURhdGEucmVhZERhdGFXYWl0KG1EZXZpY2UpOwotICAgICAgICAgICAgICAgICAgICBnb3RvIGZhaWw7Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgIHdyaXRlQnVmZmVyID0gTlVMTDsKLSAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgLy8gd2FpdCBmb3IgcmVhZCB0byBjb21wbGV0ZQotICAgICAgICAgICAgaWYgKHJlcSkgewotICAgICAgICAgICAgICAgIGludCByZWFkID0gbURhdGEucmVhZERhdGFXYWl0KG1EZXZpY2UpOwotICAgICAgICAgICAgICAgIGlmIChyZWFkIDwgMCkKLSAgICAgICAgICAgICAgICAgICAgZ290byBmYWlsOwotCi0gICAgICAgICAgICAgICAgaWYgKHJlYWQgPiAwKSB7Ci0gICAgICAgICAgICAgICAgICAgIHdyaXRlQnVmZmVyID0gcmVxLT5idWZmZXI7Ci0gICAgICAgICAgICAgICAgICAgIHdyaXRlTGVuZ3RoID0gcmVhZDsKLSAgICAgICAgICAgICAgICAgICAgcmVtYWluaW5nI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wZXJ0eUxpc3QgICAgICAgICBtRGV2aWNlUHJvcGVydGllczsKLQotICAgIC8vIGN1cnJlbnQgc2Vzc2lvbiBJRAotICAgIE10cFNlc3Npb25JRCAgICAgICAgICAgIG1TZXNzaW9uSUQ7Ci0gICAgLy8gY3VycmVudCB0cmFuc2FjdGlvbiBJRAotICAgIE10cFRyYW5zYWN0aW9uSUQgICAgICAgIG1UcmFuc2FjdGlvbklEOwotCi0gICAgTXRwUmVxdWVzdFBhY2tldCAgICAgICAgbVJlcXVlc3Q7Ci0gICAgTXRwRGF0YVBhY2tldCAgICAgICAgICAgbURhdGE7Ci0gICAgTXRwUmVzcG9uc2VQYWNrZXQgICAgICAgbVJlc3BvbnNlOwotICAgIC8vIHNldCB0byB0cnVlIGlmIHdlIHJlY2VpdmVkIGEgcmVzcG9uc2UgcGFja2V0IGluc3RlYWQgb2YgYSBkYXRhIHBhY2tldAotICAgIGJvb2wgICAgICAgICAgICAgICAgICAgIG1SZWNlaXZlZFJlc3BvbnNlOwotCi0gICAgLy8gdG8gZW5zdXJlIG9ubHkgb25lIE1UUCB0cmFuc2FjdGlvbiBhdCBhIHRpbWUKLSAgICBNdXRleCAgICAgICAgICAgICAgICAgICBtTXV0ZXg7Ci0KLXB1YmxpYzoKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBNdHBEZXZpY2Uoc3RydWN0IHVzYl9kZXZpY2UqIGRldmljZSwgaW50IGludGVyZmFjZSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbnN0IHN0cnVjdCB1c2JfZW5kcG9pbnRfZGVzY3JpcHRvciAqZXBfaW4sCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb25zdCBzdHJ1Y3QgdXNiX2VuZHBvaW50X2Rlc2NyaXB0b3IgKmVwX291dCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbnN0IHN0cnVjdCB1c2JfZW5kcG9pbnRfZGVzY3JpcHRvciAqZXBfaW50cik7Ci0KLSAgICBzdGF0aWMgTXRwRGV2aWNlKiAgICAgICBvcGVuKGNvbnN0IGNoYXIqIGRldmljZU5hbWUsIGludCBmZCk7Ci0KLSAgICB2aXJ0dWFsICAgICAgICAgICAgICAgICB+TXRwRGV2aWNlKCk7Ci0KLSAgICB2b2lkICAgICAgICAgICAgICAgICAgICBpbml0aWFsaXplKCk7Ci0gICAgdm9pZCAgICAgICAgICAgICAgICAgICAgY2xvc2UoKTsKLSAgICB2b2lkICAgICAgICAgICAgICAgICAgICBwcmludCgpOwotICAgIGNvbnN0IGNoYXIqICAgICAgICAgICAgIGdldERldmljZU5hbWUoKTsKLQotICAgIGJvb2wgICAgICAgICAgICAgICAgICAgIG9wZW5TZXNzaW9uKCk7Ci0gICAgYm9vbCAgICAgICAgICAgICAgICAgICAgY2xvc2VTZXNzaW9uKCk7Ci0KLSAgICBNdHBEZXZpY2VJbmZvKiAgICAgICAgICBnZXREZXZpY2VJbmZvKCk7Ci0gICAgTXRwU3RvcmFnZUlETGlzdCogICAgICAgZ2V0U3RvcmFnZUlEcygpOwotICAgIE10cFN0b3JhZ2VJbmZvKiAgICAgICAgIGdldFN0b3JhZ2VJbmZvKE10cFN0b3JhZ2VJRCBzdG9yYWdlSUQpOwotICAgIE10cE9iamVjdEhhbmRsZUxpc3QqICAgIGdldE9iamVjdEhhbmRsZXMoTXRwU3RvcmFnZUlEIHN0b3JhZ2VJRCwgTXRwT2JqZWN0Rm9ybWF0IGZvcm1hdCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIE10cE9iamVjdEhhbmRsZSBwYXJlbnQpOwotICAgIE10cE9iamVjdEluZm8qICAgICAgICAgIGdldE9iamVjdEluZm8oTXRwT2JqZWN0SGFuZGxlIGhhbmRsZSk7Ci0gICAgdm9pZCogICAgICAgICAgICAgICAgICAgZ2V0VGh1bWJuYWlsKE10cE9iamVjdEhhbmRsZSBoYW5kbGUsIGludCYgb3V0TGVuZ3RoKTsKLSAgICBNdHBPYmplY3RIYW5kbGUgICAgICAgICBzZW5kT2JqZWN0SW5mbyhNdHBPYmplY3RJbmZvKiBpbmZvKTsKLSAgICBib29sICAgICAgICAgICAgICAgICAgICBzZW5kT2JqZWN0KE10cE9iamVjdEluZm8qIGluZm8sIGludCBzcmNGRCk7Ci0gICAgYm9vbCAgICAgICAgICAgICAgICAgICAgZGVsZXRlT2JqZWN0KE10cE9iamVjdEhhbmRsZSBoYW5kbGUpOwotICAgIE10cE9iamVjdEhhbmRsZSAgICAgICAgIGdldFBhcmVudChNdHBPYmplY3RIYW5kbGUgaGFuZGxlKTsKLSAgICBNdHBPYmplY3RIYW5kbGUgICAgICAgICBnZXRTdG9yYWdlSUQoTXRwT2JqZWN0SGFuZGxlIGhhbmRsZSk7Ci0KLSAgICBNdHBPYmplY3RQcm9wZXJ0eUxpc3QqICBnZXRPYmplY3RQcm9wc1N1cHBvcnRlZChNdHBPYmplY3RGb3JtYXQgZm9ybWF0KTsKLQotICAgIE10cFByb3BlcnR5KiAgICAgICAgICAgIGdldERldmljZVByb3BEZXNjKE10cERldmljZVByb3BlcnR5IGNvZGUpOwotICAgIE10cFByb3BlcnR5KiAgICAgICAgICAgIGdldE9iamVjdFByb3BEZXNjKE10cE9iamVjdFByb3BlcnR5IGNvZGUsIE10cE9iamVjdEZvcm1hdCBmb3JtYXQpOwotCi0gICAgYm9vbCAgICAgICAgICAgICAgICAgICAgcmVhZE9iamVjdChNdHBPYmplY3RIYW5kbGUgaGFuZGxlLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYm9vbCAoKiBjYWxsYmFjaykodm9pZCogZGF0YSwgaW50IG9mZnNldCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaW50IGxlbmd0aCwgdm9pZCogY2xpZW50RGF0YSksCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpbnQgb2JqZWN0U2l6ZSwgdm9pZCogY2xpZ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oYXIqICAgICAgICAgICAgICAgICAgIG1WZW5kb3JFeHRlbnNpb25EZXNjOwotICAgIHVpbnQxNl90ICAgICAgICAgICAgICAgIG1GdW5jdGlvbmFsQ29kZTsKLSAgICBVSW50MTZMaXN0KiAgICAgICAgICAgICBtT3BlcmF0aW9uczsKLSAgICBVSW50MTZMaXN0KiAgICAgICAgICAgICBtRXZlbnRzOwotICAgIE10cERldmljZVByb3BlcnR5TGlzdCogIG1EZXZpY2VQcm9wZXJ0aWVzOwotICAgIE10cE9iamVjdEZvcm1hdExpc3QqICAgIG1DYXB0dXJlRm9ybWF0czsKLSAgICBNdHBPYmplY3RGb3JtYXRMaXN0KiAgICBtUGxheWJhY2tGb3JtYXRzOwotICAgIGNoYXIqICAgICAgICAgICAgICAgICAgIG1NYW51ZmFjdHVyZXI7Ci0gICAgY2hhciogICAgICAgICAgICAgICAgICAgbU1vZGVsOwotICAgIGNoYXIqICAgICAgICAgICAgICAgICAgIG1WZXJzaW9uOwotICAgIGNoYXIqICAgICAgICAgICAgICAgICAgIG1TZXJpYWw7Ci0KLXB1YmxpYzoKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBNdHBEZXZpY2VJbmZvKCk7Ci0gICAgdmlydHVhbCAgICAgICAgICAgICAgICAgfk10cERldmljZUluZm8oKTsKLQotICAgIHZvaWQgICAgICAgICAgICAgICAgICAgIHJlYWQoTXRwRGF0YVBhY2tldCYgcGFja2V0KTsKLQotICAgIHZvaWQgICAgICAgICAgICAgICAgICAgIHByaW50KCk7Ci19OwotCi19OyAvLyBuYW1lc3BhY2UgYW5kcm9pZAotCi0jZW5kaWYgLy8gX01UUF9ERVZJQ0VfSU5GT19ICmRpZmYgLS1naXQgYS9tZWRpYS9tdHAvTXRwRXZlbnRQYWNrZXQuY3BwIGIvbWVkaWEvbXRwL010cEV2ZW50UGFja2V0LmNwcApkZWxldGVkIGZpbGUgbW9kZSAxMDA2NDQKaW5kZXggZDJmY2E0Mi4uMDAwMDAwMAotLS0gYS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BNdHBPYmplY3RJbmZvIHsKLXB1YmxpYzoKLSAgICBNdHBPYmplY3RIYW5kbGUgICAgIG1IYW5kbGU7Ci0gICAgTXRwU3RvcmFnZUlEICAgICAgICBtU3RvcmFnZUlEOwotICAgIE10cE9iamVjdEZvcm1hdCAgICAgbUZvcm1hdDsKLSAgICB1aW50MTZfdCAgICAgICAgICAgIG1Qcm90ZWN0aW9uU3RhdHVzOwotICAgIHVpbnQzMl90ICAgICAgICAgICAgbUNvbXByZXNzZWRTaXplOwotICAgIE10cE9iamVjdEZvcm1hdCAgICAgbVRodW1iRm9ybWF0OwotICAgIHVpbnQzMl90ICAgICAgICAgICAgbVRodW1iQ29tcHJlc3NlZFNpemU7Ci0gICAgdWludDMyX3QgICAgICAgICAgICBtVGh1bWJQaXhXaWR0aDsKLSAgICB1aW50MzJfdCAgICAgICAgICAgIG1UaHVtYlBpeEhlaWdodDsKLSAgICB1aW50MzJfdCAgICAgICAgICAgIG1JbWFnZVBpeFdpZHRoOwotICAgIHVpbnQzMl90ICAgICAgICAgICAgbUltYWdlUGl4SGVpZ2h0OwotICAgIHVpbnQzMl90ICAgICAgICAgICAgbUltYWdlUGl4RGVwdGg7Ci0gICAgTXRwT2JqZWN0SGFuZGxlICAgICBtUGFyZW50OwotICAgIHVpbnQxNl90ICAgICAgICAgICAgbUFzc29jaWF0aW9uVHlwZTsKLSAgICB1aW50MzJfdCAgICAgICAgICAgIG1Bc3NvY2lhdGlvbkRlc2M7Ci0gICAgdWludDMyX3QgICAgICAgICAgICBtU2VxdWVuY2VOdW1iZXI7Ci0gICAgY2hhciogICAgICAgICAgICAgICBtTmFtZTsKLSAgICB0aW1lX3QgICAgICAgICAgICAgIG1EYXRlQ3JlYXRlZDsKLSAgICB0aW1lX3QgICAgICAgICAgICAgIG1EYXRlTW9kaWZpZWQ7Ci0gICAgY2hhciogICAgICAgICAgICAgICBtS2V5d29yZHM7Ci0KLXB1YmxpYzoKLSAgICAgICAgICAgICAgICAgICAgICAgIE10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hY2tldCgpOwotCi0gICAgLy8gc2V0cyBwYWNrZXQgc2l6ZSB0byB0aGUgZGVmYXVsdCBjb250YWluZXIgc2l6ZSBhbmQgc2V0cyBidWZmZXIgdG8gemVybwotICAgIHZpcnR1YWwgdm9pZCAgICAgICAgcmVzZXQoKTsKLQotICAgIHZvaWQgICAgICAgICAgICAgICAgYWxsb2NhdGUoaW50IGxlbmd0aCk7Ci0gICAgdm9pZCAgICAgICAgICAgICAgICBkdW1wKCk7Ci0gICAgdm9pZCAgICAgICAgICAgICAgICBjb3B5RnJvbShjb25zdCBNdHBQYWNrZXQmIHNyYyk7Ci0KLSAgICB1aW50MTZfdCAgICAgICAgICAgIGdldENvbnRhaW5lckNvZGUoKSBjb25zdDsKLSAgICB2b2lkICAgICAgICAgICAgICAgIHNldENvbnRhaW5lckNvZGUodWludDE2X3QgY29kZSk7Ci0KLSAgICB1aW50MTZfdCAgICAgICAgICAgIGdldENvbnRhaW5lclR5cGUoKSBjb25zdDsKLQotICAgIE10cFRyYW5zYWN0aW9uSUQgICAgZ2V0VHJhbnNhY3Rpb25JRCgpIGNvbnN0OwotICAgIHZvaWQgICAgICAgICAgICAgICAgc2V0VHJhbnNhY3Rpb25JRChNdHBUcmFuc2FjdGlvbklEIGlkKTsKLQotICAgIHVpbnQzMl90ICAgICAgICAgICAgZ2V0UGFyYW1ldGVyKGludCBpbmRleCkgY29uc3Q7Ci0gICAgdm9pZCAgICAgICAgICAgICAgICBzZXRQYXJhbWV0ZXIoaW50IGluZGV4LCB1aW50MzJfdCB2YWx1ZSk7Ci0KLSNpZmRlZiBNVFBfSE9TVAotICAgIGludCAgICAgICAgICAgICAgICAgdHJhbnNmZXIoc3RydWN0IHVzYl9yZXF1ZXN0KiByZXF1ZXN0KTsKLSNlbmRpZgotCi1wcm90ZWN0ZWQ6Ci0gICAgdWludDE2X3QgICAgICAgICAgICBnZXRVSW50MTYoaW50IG9mZnNldCkgY29uc3Q7Ci0gICAgdWludDMyX3QgICAgICAgICA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sKLSAgICBtZW1zZXQoJm1NYXhpbXVtVmFsdWUsIDAsIHNpemVvZihtTWF4aW11bVZhbHVlKSk7Ci0KLSAgICBpZiAoZGVmYXVsdFZhbHVlKSB7Ci0gICAgICAgIHN3aXRjaCAodHlwZSkgewotICAgICAgICAgICAgY2FzZSBNVFBfVFlQRV9JTlQ4OgotICAgICAgICAgICAgICAgIG1EZWZhdWx0VmFsdWUudS5pOCA9IGRlZmF1bHRWYWx1ZTsKLSAgICAgICAgICAgICAgICBicmVhazsKLSAgICAgICAgICAgIGNhc2UgTVRQX1RZUEVfVUlOVDg6Ci0gICAgICAgICAgICAgICAgbURlZmF1bHRWYWx1ZS51LnU4ID0gZGVmYXVsdFZhbHVlOwotICAgICAgICAgICAgICAgIGJyZWFrOwotICAgICAgICAgICAgY2FzZSBNVFBfVFlQRV9JTlQxNjoKLSAgICAgICAgICAgICAgICBtRGVmYXVsdFZhbHVlLnUuaTE2ID0gZGVmYXVsdFZhbHVlOwotICAgICAgICAgICAgICAgIGJyZWFrOwotICAgICAgICAgICAgY2FzZSBNVFBfVFlQRV9VSU5UMTY6Ci0gICAgICAgICAgICAgICAgbURlZmF1bHRWYWx1ZS51LnUxNiA9IGRlZmF1bHRWYWx1ZTsKLSAgICAgICAgICAgICAgICBicmVhazsKLSAgICAgICAgICAgIGNhc2UgTVRQX1RZUEVfSU5UMzI6Ci0gICAgICAgICAgICAgICAgbURlZmF1bHRWYWx1ZS51LmkzMiA9IGRlZmF1bHRWYWx1ZTsKLSAgICAgICAgICAgICAgICBicmVhazsKLSAgICAgICAgICAgIGNhc2UgTVRQX1RZUEVfVUlOVDMyOgotICAgICAgICAgICAgICAgIG1EZWZhdWx0VmFsdWUudS51MzIgPSBkZWZhdWx0VmFsdWU7Ci0gICAgICAgICAgICAgICAgYnJlYWs7Ci0gICAgICAgICAgICBjYXNlIE1UUF9UWVBFX0lOVDY0OgotICAgICAgICAgICAgICAgIG1EZWZhdWx0VmFsdWUudS5pNjQgPSBkZWZhdWx0VmFsdWU7Ci0gICAgICAgICAgICAgICAgYnJlYWs7Ci0gICAgICAgICAgICBjYXNlIE1UUF9UWVBFX1VJTlQ2NDoKLSAgICAgICAgICAgICAgICBtRGVmYXVsdFZhbHVlLnUudTY0ID0gZGVmYXVsdFZhbHVlOwotICAgICAgICAgICAgICAgIGJyZWFrOwotICAgICAgICAgICAgZGVmYXVsdDoKLSAgICAgICAgICAgICAgICBBTE9HRSgidW5rbm93biB0eXBlICUwNFggaW4gTXRwUHJvcGVydHk6Ok10cFByb3BlcnR5IiwgdHlwZSk7Ci0gICAgICAgIH0KLSAgICB9Ci19Ci0KLU10cFByb3BlcnR5Ojp+TXRwUHJvcGVydHkoKSB7Ci0gICAgaWYgKG1UeXBlID09IE1UUF9UWVBFX1NUUikgewotICAgICAgICAvLyBmcmVlIGFsbCBzdHJpbmdzCi0gICAgICAgIGZyZWUobURlZmF1bHRWYWx1ZS5zdHIpOwotICAgICAgICBmcmVlKG1DdXJyZW50VmFsdWUuc3RyKTsKLSAgICAgICAgZnJlZShtTWluaW11bVZhbHVlLnN0cik7Ci0gICAgICAgIGZyZWUobU1heGltdW1WYWx1ZS5zdHIpOwotICAgICAgICBpZiAobURlZmF1bHRBcnJheVZhbHVlcykgewotICAgICAgICAgICAgZm9yIChpbnQgaSA9IDA7IGkgPCBtRGVmYXVsdEFycmF5TGVuZ3RoOyBpKyspCi0gICAgICAgICAgICAgICAgZnJlZShtRGVmYXVsdEFycmF5VmFsdWVzW2ldLnN0cik7Ci0gICAgICAgIH0KLSAgICAgICAgaWYgKG1DdXJyZW50QXJyYXlWYWx1ZXMpIHsKLSAgICAgICAgICAgIGZvciAoaW50IGkgPSAwOyBpIDwgbUN1cnJlbnRBcnJheUxlbmd0aDsgaSsrKQotICAgICAgICAgICAgICAgIGZyZWUobUN1cnJlbnRBcnJheVZhbHVlc1tpXS5zdHIpOwotICAgICAgICB9Ci0gICAgICAgIGlmIChtRW51bVZhbHVlcykgewotICAgICAgICAgICAgZ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LnUudTE2ID0gbWluOwotICAgICAgICAgICAgbU1heGltdW1WYWx1ZS51LnUxNiA9IG1heDsKLSAgICAgICAgICAgIG1TdGVwU2l6ZS51LnUxNiA9IHN0ZXA7Ci0gICAgICAgICAgICBicmVhazsKLSAgICAgICAgY2FzZSBNVFBfVFlQRV9JTlQzMjoKLSAgICAgICAgICAgIG1NaW5pbXVtVmFsdWUudS5pMzIgPSBtaW47Ci0gICAgICAgICAgICBtTWF4aW11bVZhbHVlLnUuaTMyID0gbWF4OwotICAgICAgICAgICAgbVN0ZXBTaXplLnUuaTMyID0gc3RlcDsKLSAgICAgICAgICAgIGJyZWFrOwotICAgICAgICBjYXNlIE1UUF9UWVBFX1VJTlQzMjoKLSAgICAgICAgICAgIG1NaW5pbXVtVmFsdWUudS51MzIgPSBtaW47Ci0gICAgICAgICAgICBtTWF4aW11bVZhbHVlLnUudTMyID0gbWF4OwotICAgICAgICAgICAgbVN0ZXBTaXplLnUudTMyID0gc3RlcDsKLSAgICAgICAgICAgIGJyZWFrOwotICAgICAgICBjYXNlIE1UUF9UWVBFX0lOVDY0OgotICAgICAgICAgICAgbU1pbmltdW1WYWx1ZS51Lmk2NCA9IG1pbjsKLSAgICAgICAgICAgIG1NYXhpbXVtVmFsdWUudS5pNjQgPSBtYXg7Ci0gICAgICAgICAgICBtU3RlcFNpemUudS5pNjQgPSBzdGVwOwotICAgICAgICAgICAgYnJlYWs7Ci0gICAgICAgIGNhc2UgTVRQX1RZUEVfVUlOVDY0OgotICAgICAgICAgICAgbU1pbmltdW1WYWx1ZS51LnU2NCA9IG1pbjsKLSAgICAgICAgICAgIG1NYXhpbXVtVmFsdWUudS51NjQgPSBtYXg7Ci0gICAgICAgICAgICBtU3RlcFNpemUudS51NjQgPSBzdGVwOwotICAgICAgICAgICAgYnJlYWs7Ci0gICAgICAgIGRlZmF1bHQ6Ci0gICAgICAgICAgICBBTE9HRSgidW5zdXBwb3J0ZWQgdHlwZSBmb3IgTXRwUHJvcGVydHk6OnNldFJhbmdlIik7Ci0gICAgICAgICAgICBicmVhazsKLSAgICB9Ci19Ci0KLXZvaWQgTXRwUHJvcGVydHk6OnNldEZvcm1FbnVtKGNvbnN0IGludCogdmFsdWVzLCBpbnQgY291bnQpIHsKLSAgICAgbUZvcm1GbGFnID0ga0Zvcm1FbnVtOwotICAgICBkZWxldGVbXSBtRW51bVZhbHVlczsKLSAgICAgbUVudW1WYWx1ZXMgPSBuZXcgTXRwUHJvcGVydHlWYWx1ZVtjb3VudF07Ci0gICAgIG1FbnVtTGVuZ3RoID0gY291bnQ7Ci0KLSAgICBmb3IgKGludCBpID0gMDsgaSA8IGNvdW50OyBpKyspIHsKLSAgICAgICAgaW50IHZhbHVlID0gKnZhbHVlcysrOwotICAgICAgICAgICAgc3dpdGNoIChtVHlwZSkgewotICAgICAgICAgICAgICAgIGNhc2UgTVRQX1RZUEVfSU5UODoKLSAgICAgICAgICAgICAgICAgICAgbUVudW1WYWx1ZXNbaV0udS5pOCA9IHZhbHVlOwotICAgICAgICAgICAgICAgICAgICBicmVhazsKLSAgICAgICAgICAgICAgICBjYXNlIE1UUF9UWVBFX1VJTlQ4OgotICAgICAgICAgICAgICAgICAgICBtRW51bVZhbHVlc1tpXS51LnU4ID0gdmFsdWU7Ci0gICAgICAgICAgICAgICAgICAgIGJyZWFrOwotICAgICAgICAgICAgICAgIGNhc2UgTVRQX1RZUEVfSU5UMTY6Ci0gICAgICAgICAgICAgICAgICAgIG1FbnVtVmFsdWVzW2ldLnUuaTE2ID0gdmFsdWU7Ci0gICAgICAgICAgICAgICAgICAgIGJyZWFrOwotICAgICAgICAgICAgICAgIGNhc2UgTVRQX1RZUEVfVUlOVDE2OgotICAgICAgICAgICAgICAgICAgICBtRW51bVZhbHVlc1tpXS51LnUxNiA9IHZhbHVlOwotICAgICAgICAgICAgICAgICAgICBicmVhazsKLSAgICAgICAgICAgICAgICBjYXNlIE1UUF9UWVBFX0lOVDMyOgotICAgICAgICAgICAgICAgICAgICBtRW51bVZhbHVlc1tpXS51LmkzMiA9IHZhbHVlOwotICAgICAgICAgICAgICAgICAgICBicmVhazsKLSAgICAgICAgICAgICAgICBjYXNlIE1UUF9UWVBFX1VJTlQzMjoKLSAgICAgICAgICAgICAgICAgICAgbUVudW1WYWx1ZXNbaV0udS51MzIgPSB2YWx1ZTsKLSAgICAgICAgICAgICAgICAgICAgYnJlYWs7Ci0gICAgICAgICAgICAgICAgY2FzZSBNVFBfVFlQRV9JTlQ2NDoKLSAgICAgICAgICAgICAgICAgICAgbUVudW1WYWx1ZXNbaV0udS5pNjQgPSB2YWx1ZTsKLSAgICAgICAgICAgICAgICAgICAgYnJlYWs7Ci0gICAgICAgICAgICAgICAgY2FzZSBNVFBfVFlQRV9VSU5UNjQ6Ci0gICAgICAgICAgICAgICAgICAgIG1FbnVtVmFsdWVzW2ldLnUudTY0ID0gdmFsdWU7Ci0gICAgICAgICAgICAgICAgICAgIGJyZWFrOwotICAgICAgICAgICAgICAgIGRlZmF1bHQ6Ci0gICAgICAgICAgICAgICAgICAgIEFMT0dFKCJ1bnN1cHBvcnRlZCB0eXBlIGZvciBNdHBQcm9wZXJ0eTo6c2V0RW51bSIpOwotICAgICAgICAgICAgICAgICAgICBicmVhazsKLSAgICAgICAgfQotICAgIH0KLX0KLQotdm9pZCBNdHBQcm9wZXJ0eTo6c2V0Rm9ybURhdGVUaW1lKCkgewotICAgICBtRm9ybUZsYWcgPSBrRm9ybURhdGVUaW1lOwotfQotCi12b2lkIE10cFByb3BlcnR5OjpwcmludCgpIHsKLSAgICBNdHBTdHJpbmcgYnVmZmVyOwotICAgIGJvb2wgZGV2aWNlUHJvcCA9IGlzRGV2aWNlUHJvcGVydHkoKTsKLSAgICBpZiAoZGV2aWNlUHJvcCkKLSAgICAgICAgQUxPR0koIiAgICAlcyAoJTA0WCkiLCBNdHBEZWJ1Zzo6Z2V0RGV2aWNlUHJvcENvZGVOYW1lKG1Db2RlKSwgbUNvZGUpOwotICAgIGVsc2UKLSAgICAgICAg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AgICAgICAgICAgIGJyZWFrOwotICAgICAgICBjYXNlIGtGb3JtRW51bToKLSAgICAgICAgICAgIGJ1ZmZlciA9ICIgICAgRW51bSB7ICI7Ci0gICAgICAgICAgICBmb3IgKGludCBpID0gMDsgaSA8IG1FbnVtTGVuZ3RoOyBpKyspIHsKLSAgICAgICAgICAgICAgICBwcmludChtRW51bVZhbHVlc1tpXSwgYnVmZmVyKTsKLSAgICAgICAgICAgICAgICBidWZmZXIgKz0gIiAiOwotICAgICAgICAgICAgfQotICAgICAgICAgICAgYnVmZmVyICs9ICJ9IjsKLSAgICAgICAgICAgIEFMT0dJKCIlcyIsIChjb25zdCBjaGFyICopYnVmZmVyKTsKLSAgICAgICAgICAgIGJyZWFrOwotICAgICAgICBjYXNlIGtGb3JtRGF0ZVRpbWU6Ci0gICAgICAgICAgICBBTE9HSSgiICAgIERhdGVUaW1lXG4iKTsKLSAgICAgICAgICAgIGJyZWFrOwotICAgICAgICBkZWZhdWx0OgotICAgICAgICAgICAgQUxPR0koIiAgICBmb3JtICVkXG4iLCBtRm9ybUZsYWcpOwotICAgICAgICAgICAgYnJlYWs7Ci0gICAgfQotfQotCi12b2lkIE10cFByb3BlcnR5OjpwcmludChNdHBQcm9wZXJ0eVZhbHVlJiB2YWx1ZSwgTXRwU3RyaW5nJiBidWZmZXIpIHsKLSAgICBzd2l0Y2ggKG1UeXBlKSB7Ci0gICAgICAgIGNhc2UgTVRQX1RZUEVfSU5UODoKLSAgICAgICAgICAgIGJ1ZmZlci5hcHBlbmRGb3JtYXQoIiVkIiwgdmFsdWUudS5pOCk7Ci0gICAgICAgICAgICBicmVhazsKLSAgICAgICAgY2FzZSBNVFBfVFlQRV9VSU5UODoKLSAgICAgICAgICAgIGJ1ZmZlci5hcHBlbmRGb3JtYXQoIiVkIiwgdmFsdWUudS51OCk7Ci0gICAgICAgICAgICBicmVhazsKLSAgICAgICAgY2FzZSBNVFBfVFlQRV9JTlQxNjoKLSAgICAgICAgICAgIGJ1ZmZl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gIGJyZWFrOwotICAgICAgICBjYXNlIE1UUF9UWVBFX1VJTlQxNjoKLSAgICAgICAgY2FzZSBNVFBfVFlQRV9BVUlOVDE2OgotICAgICAgICAgICAgcGFja2V0LnB1dFVJbnQxNih2YWx1ZS51LnUxNik7Ci0gICAgICAgICAgICBicmVhazsKLSAgICAgICAgY2FzZSBNVFBfVFlQRV9JTlQzMjoKLSAgICAgICAgY2FzZSBNVFBfVFlQRV9BSU5UMzI6Ci0gICAgICAgICAgICBwYWNrZXQucHV0SW50MzIodmFsdWUudS5pMzIpOwotICAgICAgICAgICAgYnJlYWs7Ci0gICAgICAgIGNhc2UgTVRQX1RZUEVfVUlOVDMyOgotICAgICAgICBjYXNlIE1UUF9UWVBFX0FVSU5UMzI6Ci0gICAgICAgICAgICBwYWNrZXQucHV0VUludDMyKHZhbHVlLnUudTMyKTsKLSAgICAgICAgICAgIGJyZWFrOwotICAgICAgICBjYXNlIE1UUF9UWVBFX0lOVDY0OgotICAgICAgICBjYXNlIE1UUF9UWVBFX0FJTlQ2NDoKLSAgICAgICAgICAgIHBhY2tldC5wdXRJbnQ2NCh2YWx1ZS51Lmk2NCk7Ci0gICAgICAgICAgICBicmVhazsKLSAgICAgICAgY2FzZSBNVFBfVFlQRV9VSU5UNjQ6Ci0gICAgICAgIGNhc2UgTVRQX1RZUEVfQVVJTlQ2NDoKLSAgICAgICAgICAgIHBhY2tldC5wdXRVSW50NjQodmFsdWUudS51NjQpOwotICAgICAgICAgICAgYnJlYWs7Ci0gICAgICAgIGNhc2UgTVRQX1RZUEVfSU5UMTI4OgotICAgICAgICBjYXNlIE1UUF9UWVBFX0FJTlQxMjg6Ci0gICAgICAgICAgICBwYWNrZXQucHV0SW50MTI4KHZhbHVlLnUuaTEyOCk7Ci0gICAgICAgICAgICBicmVhazsKLSAgICAgICAgY2FzZSBNVFBfVFlQRV9VSU5UMTI4OgotICAgICAgICBjYXNlIE1UUF9UWVBFX0FVSU5UMTI4OgotICAgICAgICAgICAgcGF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gICAgICAgICAgICAgYm9vbCB3cml0ZWFibGUgPSBmYWxzZSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpbnQgZGVmYXVsdFZhbHVlID0gMCk7Ci0gICAgdmlydHVhbCAgICAgICAgICAgICB+TXRwUHJvcGVydHkoKTsKLQotICAgIGlubGluZSBNdHBQcm9wZXJ0eUNvZGUgZ2V0UHJvcGVydHlDb2RlKCkgY29uc3QgeyByZXR1cm4gbUNvZGU7IH0KLQotICAgIHZvaWQgICAgICAgICAgICAgICAgcmVhZChNdHBEYXRhUGFja2V0JiBwYWNrZXQpOwotICAgIHZvaWQgICAgICAgICAgICAgICAgd3JpdGUoTXRwRGF0YVBhY2tldCYgcGFja2V0KTsKLQotICAgIHZvaWQgICAgICAgICAgICAgICAgc2V0RGVmYXVsdFZhbHVlKGNvbnN0IHVpbnQxNl90KiBzdHJpbmcpOwotICAgIHZvaWQgICAgICAgICAgICAgICAgc2V0Q3VycmVudFZhbHVlKGNvbnN0IHVpbnQxNl90KiBzdHJpbmcpOwotCi0gICAgdm9pZCAgICAgICAgICAgICAgICBzZXRGb3JtUmFuZ2UoaW50IG1pbiwgaW50IG1heCwgaW50IHN0ZXApOwotICAgIHZvaWQgICAgICAgICAgICAgICAgc2V0Rm9ybUVudW0oY29uc3QgaW50KiB2YWx1ZXMsIGludCBjb3VudCk7Ci0gICAgdm9pZCAgICAgICAgICAgICAgICBzZXRGb3JtRGF0ZVRpbWUoKTsKLQotICAgIHZvaWQgICAgICAgICAgICAgICAgcHJpbnQoKTsKLSAgICB2b2lkICAgICAgICAgICAgICAgIHByaW50KE10cFByb3BlcnR5VmFsdWUmIHZhbHVlLCBNdHBTdHJpbmcmIGJ1ZmZlcik7Ci0KLSAgICBpbmxpbmUgYm9vbCAgICAgICAgIGlzRGV2aWNlUHJvcGVydHkoKSBjb25zdCB7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuICggICAoKG1Db2RlICYgMHhGMDAw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wgb3BlcmF0aW9uID09IE1UUF9PUEVSQVRJT05fU0VUX09CSkVDVF9SRUZFUkVOQ0VTCi0gICAgICAgICAgICAgICAgICAgIHx8IG9wZXJhdGlvbiA9PSBNVFBfT1BFUkFUSU9OX1NFVF9PQkpFQ1RfUFJPUF9WQUxVRQotICAgICAgICAgICAgICAgICAgICB8fCBvcGVyYXRpb24gPT0gTVRQX09QRVJBVElPTl9TRVRfREVWSUNFX1BST1BfVkFMVUUpOwotICAgICAgICBpZiAoZGF0YUluKSB7Ci0gICAgICAgICAgICBpbnQgcmV0ID0gbURhdGEucmVhZChmZCk7Ci0gICAgICAgICAgICBpZiAocmV0IDwgMCkgewotICAgICAgICAgICAgICAgIEFMT0dFKCJkYXRhIHJlYWQgcmV0dXJuZWQgJWQsIGVycm5vOiAlZCIsIHJldCwgZXJybm8pOwotICAgICAgICAgICAgICAgIGlmIChlcnJubyA9PSBFQ0FOQ0VMRUQpIHsKLSAgICAgICAgICAgICAgICAgICAgLy8gcmV0dXJuIHRvIHRvcCBvZiBsb29wIGFuZCB3YWl0IGZvciBuZXh0IGNvbW1hbmQKLSAgICAgICAgICAgICAgICAgICAgY29udGludWU7Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgIGJyZWFrOwotICAgICAgICAgICAgfQotICAgICAgICAgICAgQUxPR1YoInJlY2VpdmVkIGRhdGE6Iik7Ci0gICAgICAgICAgICBtRGF0YS5kdW1wKCk7Ci0gICAgICAgIH0gZWxzZSB7Ci0gICAgICAgICAgICBtRGF0YS5yZXNldCgpOwotICAgICAgICB9Ci0KLSAgICAgICAgaWYgKGhhbmRsZVJlcXVlc3QoKSkgewotICAgICAgICAgICAgaWYgKCFkYXRhSW4gJiYgbURhdGEuaGFzRGF0YSgpKSB7Ci0gICAgICAgICAgICAgICAgbURhdGEuc2V0T3BlcmF0aW9uQ29kZShvcGVyYXRpb24pOwotICAgICAgICAgICAgICAgIG1EYXRhLnNldFRyYW5zYWN0aW9uSUQodHJhbnNhY3Rpb24pOwotICAgICAgICAgICAgICAgIEFMT0dWKCJzZW5kaW5nIGRhdGE6Iik7Ci0gICAgICAgICAgICAgICAgbURhdGEuZHVtcCgpOwotICAgICAgICAgICAgICAgIHJldCA9IG1EYXRhLndyaXRlKGZkKTsKLSAgICAgICAgICAgICAgICBpZiAocmV0IDwgMCkgewotICAgICAgICAgICAgICAgICAgICBBTE9HRSgicmVxdWVzdCB3cml0ZSByZXR1cm5lZCAlZCwgZXJybm86ICVkIiwgcmV0LCBlcnJubyk7Ci0gICAgICAgICAgICAgICAgICAgIGlmIChlcnJubyA9PSBFQ0FOQ0VMRUQpIHsKLSAgICAgICAgICAgICAgICAgICAgICAgIC8vIHJldHVybiB0byB0b3Agb2YgbG9vcCBhbmQgd2FpdCBmb3IgbmV4dCBjb21tYW5kCi0gICAgICAgICAgICAgICAgICAgICAgICBjb250aW51ZTsKLSAgICAgICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgICAgICBicmVhazsKLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgIG1SZXNwb25zZS5zZXRUcmFuc2FjdGlvbklEKHRyYW5zYWN0aW9uKTsKLSAgICAgICAgICAgIEFMT0dWKCJzZW5kaW5nIHJlc3BvbnNlICUwNFgiLCBtUmVzcG9uc2UuZ2V0UmVzcG9uc2VDb2RlKCkpOwotICAgICAgICAgICAgcmV0ID0gbVJlc3BvbnNlLndyaXRlKGZkKTsKLSAgICAgICAgICAgIG1SZXNwb25zZS5kdW1wKCk7Ci0gICAgICAgICAgICBpZiAocmV0IDwgMCkgewotICAgICAgICAgICAgICAgIEFMT0dFKCJyZXF1ZXN0IHdyaXRlIHJldHVybmVkICVkLCBlcnJubzogJWQiLCByZXQsIGVycm5vKTsKLSAgICAgICAgICAgICAgICBpZiAoZXJybm8gPT0gRUNBTkNFTEVEKSB7Ci0gICAgICAgICAgICAgICAgICAgIC8vIHJldHVybiB0byB0b3Agb2YgbG9vc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c3BvbnNlID0gZG9HZXRPYmplY3RJbmZvKCk7Ci0gICAgICAgICAgICBicmVhazsKLSAgICAgICAgY2FzZSBNVFBfT1BFUkFUSU9OX0dFVF9PQkpFQ1Q6Ci0gICAgICAgICAgICByZXNwb25zZSA9IGRvR2V0T2JqZWN0KCk7Ci0gICAgICAgICAgICBicmVhazsKLSAgICAgICAgY2FzZSBNVFBfT1BFUkFUSU9OX0dFVF9USFVNQjoKLSAgICAgICAgICAgIHJlc3BvbnNlID0gZG9HZXRUaHVtYigpOwotICAgICAgICAgICAgYnJlYWs7Ci0gICAgICAgIGNhc2UgTVRQX09QRVJBVElPTl9HRVRfUEFSVElBTF9PQkpFQ1Q6Ci0gICAgICAgIGNhc2UgTVRQX09QRVJBVElPTl9HRVRfUEFSVElBTF9PQkpFQ1RfNjQ6Ci0gICAgICAgICAgICByZXNwb25zZSA9IGRvR2V0UGFydGlhbE9iamVjdChvcGVyYXRpb24pOwotICAgICAgICAgICAgYnJlYWs7Ci0gICAgICAgIGNhc2UgTVRQX09QRVJBVElPTl9TRU5EX09CSkVDVF9JTkZPOgotICAgICAgICAgICAgcmVzcG9uc2UgPSBkb1NlbmRPYmplY3RJbmZvKCk7Ci0gICAgICAgICAgICBicmVhazsKLSAgICAgICAgY2FzZSBNVFBfT1BFUkFUSU9OX1NFTkRfT0JKRUNUOgotICAgICAgICAgICAgcmVzcG9uc2UgPSBkb1NlbmRPYmplY3QoKTsKLSAgICAgICAgICAgIGJyZWFrOwotICAgICAgICBjYXNlIE1UUF9PUEVSQVRJT05fREVMRVRFX09CSkVDVDoKLSAgICAgICAgICAgIHJlc3BvbnNlID0gZG9EZWxldGVPYmplY3QoKTsKLSAgICAgICAgICAgIGJyZWFrOwotICAgICAgICBjYXNlIE1UUF9PUEVSQVRJT05fR0VUX09CSkVDVF9QUk9QX0RFU0M6Ci0gICAgICAgICAgICByZXNwb25zZSA9IGRvR2V0T2JqZWN0UHJvcERlc2MoKTsKLSAgICAgICAgICAgIGJyZ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MZW5ndGggLSAxOwotCi0gICAgRElSKiBkaXIgPSBvcGVuZGlyKHBhdGgpOwotICAgIGlmICghZGlyKSB7Ci0gICAgICAgIEFMT0dFKCJvcGVuZGlyICVzIGZhaWxlZDogJXMiLCBwYXRoLCBzdHJlcnJvcihlcnJubykpOwotICAgICAgICByZXR1cm47Ci0gICAgfQotCi0gICAgc3RydWN0IGRpcmVudCogZW50cnk7Ci0gICAgd2hpbGUgKChlbnRyeSA9IHJlYWRkaXIoZGlyKSkpIHsKLSAgICAgICAgY29uc3QgY2hhciogbmFtZSA9IGVudHJ5LT5kX25hbWU7Ci0KLSAgICAgICAgLy8gaWdub3JlICIuIiBhbmQgIi4uIgotICAgICAgICBpZiAobmFtZVswXSA9PSAnLicgJiYgKG5hbWVbMV0gPT0gMCB8fCAobmFtZVsxXSA9PSAnLicgJiYgbmFtZVsyXSA9PSAwKSkpIHsKLSAgICAgICAgICAgIGNvbnRpbnVlOwotICAgICAgICB9Ci0KLSAgICAgICAgaW50IG5hbWVMZW5ndGggPSBzdHJsZW4obmFtZSk7Ci0gICAgICAgIGlmIChuYW1lTGVuZ3RoID4gcGF0aFJlbWFpbmluZykgewotICAgICAgICAgICAgQUxPR0UoInBhdGggJXMvJXMgdG9vIGxvbmdcbiIsIHBhdGgsIG5hbWUpOwotICAgICAgICAgICAgY29udGludWU7Ci0gICAgICAgIH0KLSAgICAgICAgc3RyY3B5KGZpbGVTcG90LCBuYW1lKTsKLQotICAgICAgICBpbnQgdHlwZSA9IGVudHJ5LT5kX3R5cGU7Ci0gICAgICAgIGlmIChlbnRyeS0+ZF90eXBlID09IERUX0RJUikgewotICAgICAgICAgICAgZGVsZXRlUmVjdXJzaXZlKHBhdGhidWYpOwotICAgICAgICAgICAgcm1kaXIocGF0aGJ1Zik7Ci0gICAgICAgIH0gZWxzZSB7Ci0gICAgICAgICAgICB1bmxpbmsocGF0aGJ1Zik7Ci0gICAgICAgIH0KLSAgICB9Ci0gICAgY2xvc2VkaXIoZGly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ZlIHVuYWxsb2NhdGVkCi0gICAgdWludDY0X3QgICAgICAgICAgICAgICAgbVJlc2VydmVTcGFjZTsKLSAgICBib29sICAgICAgICAgICAgICAgICAgICBtUmVtb3ZhYmxlOwotCi1wdWJsaWM6Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgTXRwU3RvcmFnZShNdHBTdG9yYWdlSUQgaWQsIGNvbnN0IGNoYXIqIGZpbGVQYXRoLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY29uc3QgY2hhciogZGVzY3JpcHRpb24sIHVpbnQ2NF90IHJlc2VydmVTcGFjZSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJvb2wgcmVtb3ZhYmxlLCB1aW50NjRfdCBtYXhGaWxlU2l6ZSk7Ci0gICAgdmlydHVhbCAgICAgICAgICAgICAgICAgfk10cFN0b3JhZ2UoKTsKLQotICAgIGlubGluZSBNdHBTdG9yYWdlSUQgICAgIGdldFN0b3JhZ2VJRCgpIGNvbnN0IHsgcmV0dXJuIG1TdG9yYWdlSUQ7IH0KLSAgICBpbnQgICAgICAgICAgICAgICAgICAgICBnZXRUeXBlKCkgY29uc3Q7Ci0gICAgaW50ICAgICAgICAgICAgICAgICAgICAgZ2V0RmlsZVN5c3RlbVR5cGUoKSBjb25zdDsKLSAgICBpbnQgICAgICAgICAgICAgICAgICAgICBnZXRBY2Nlc3NDYXBhYmlsaXR5KCkgY29uc3Q7Ci0gICAgdWludDY0X3QgICAgICAgICAgICAgICAgZ2V0TWF4Q2FwYWNpdHkoKTsKLSAgICB1aW50NjRfdCAgICAgICAgICAgICAgICBnZXRGcmVlU3BhY2UoKTsKLSAgICBjb25zdCBjaGFyKiAgICAgICAgICAgICBnZXREZXNjcmlwdGlvbigpIGNvbnN0OwotICAgIGlubGluZSBjb25zdCBjaGFyKiAgICAgIGdldFBhdGgoKSBjb25zdCB7IHJldHVybiAoY29uc3QgY2hhciAqKW1GaWxlUGF0aDsgfQotICAg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otICAgICAgICB9IGVsc2UgaWYgKChjaCAmIDB4RjApID09IDB4RTApIHsKLSAgICAgICAgICAgIC8vIDMgYnl0ZSBjaGFyCi0gICAgICAgICAgICBpZiAoISAqc3JjKyspIHsKLSAgICAgICAgICAgICAgICAvLyBsYXN0IGNoYXJhY3RlciB3YXMgdHJ1bmNhdGVkLCBzbyBpZ25vcmUgbGFzdCBieXRlCi0gICAgICAgICAgICAgICAgbGVuZ3RoLS07Ci0gICAgICAgICAgICAgICAgYnJlYWs7Ci0gICAgICAgICAgICB9Ci0gICAgICAgICAgICBpZiAoISAqc3JjKyspIHsKLSAgICAgICAgICAgICAgICAvLyBsYXN0IGNoYXJhY3RlciB3YXMgdHJ1bmNhdGVkLCBzbyBpZ25vcmUgbGFzdCB0d28gYnl0ZXMKLSAgICAgICAgICAgICAgICBsZW5ndGggLT0gMjsKLSAgICAgICAgICAgICAgICBicmVhazsKLSAgICAgICAgICAgIH0KLSAgICAgICAgfQotICAgICAgICBjb3VudCsrOwotICAgIH0KLQotICAgIG1CeXRlQ291bnQgPSBsZW5ndGggKyAxOwotICAgIG1CdWZmZXJbbGVuZ3RoXSA9IDA7Ci0gICAgbUNoYXJDb3VudCA9IGNvdW50OwotfQotCi12b2lkIE10cFN0cmluZ0J1ZmZlcjo6c2V0KGNvbnN0IHVpbnQxNl90KiBzcmMpIHsKLSAgICBpbnQgY291bnQgPSAwOwotICAgIHVpbnQxNl90IGNoOwotICAgIHVpbnQ4X3QqIGRlc3QgPSBtQnVmZmVyOwotCi0gICAgd2hpbGUgKChjaCA9ICpzcmMrKykgIT0gMCAmJiBjb3VudCA8IDI1NSkgewotICAgICAgICBpZiAoY2ggPj0gMHgwODAwKSB7Ci0gICAgICAgICAgICAqZGVzdCsrID0gKHVpbnQ4X3QpKDB4RTAgfCAoY2ggPj4gMTIpKTsKLSAgICAgICAgICAgICpkZXN0KysgPSAodWludDhfdCkoMHg4MCB8ICgoY2ggPj4gNikgJiAweDNGKSk7Ci0gICAgICAgICAgICAqZGVzdCsrID0gKHVpbnQ4X3QpKDB4ODAgfCAoY2ggJiAweDNGKSk7Ci0gICAgICAgIH0gZWxzZSBpZiAoY2ggPj0gMHg4MCkgewotICAgICAgICAgICAgKmRlc3QrKyA9ICh1aW50OF90KSgweEMwIHwgKGNoID4+IDYpKTsKLSAgICAgICAgICAgICpkZXN0KysgPSAodWludDhfdCkoMHg4MCB8IChjaCAmIDB4M0YpKTsKLSAgICAgICAgfSBlbHNlIHsKLSAgICAgICAgICAgICpkZXN0KysgPSBjaDsKLSAgICAgICAgfQotICAgICAgICBjb3VudCsrOwotICAgIH0KLSAgICAqZGVzdCsrID0gMDsKLSAgICBtQ2hhckNvdW50ID0gY291bnQ7Ci0gICAgbUJ5dGVDb3VudCA9IGRlc3QgLSBtQnVmZmVyOwotfQotCi12b2lkIE10cFN0cmluZ0J1ZmZlcjo6cmVhZEZyb21QYWNrZXQoTXRwRGF0YVBhY2tldCogcGFja2V0KSB7Ci0gICAgaW50IGNvdW50ID0gcGFja2V0LT5nZXRVSW50OCgpOwotICAgIHVpbnQ4X3QqIGRlc3QgPSBtQnVmZmVyOwotICAgIGZvciAoaW50IGkgPSAwOyBpIDwgY291bnQ7IGkrKykgewotICAgICAgICB1aW50MTZfdCBjaCA9IHBhY2tldC0+Z2V0VUludDE2KCk7Ci0gICAgICAgIGlmIChjaCA+PSAweDA4MDApIHsKLSAgICAgICAgICAgICpkZXN0KysgPSAodWludDhfdCkoMHhFMCB8IChjaCA+PiAxMikpOwotICAgICAgICAgICAgKmRlc3QrKyA9ICh1aW50OF90KSgweDgwIHwgKChjaCA+PiA2KSAmIDB4M0YpKTsKLSAgICAgICAgICAgICpkZXN0KysgPSAodWludDhfdCkoMHg4MCB8IChjaCAmIDB4M0YpKTsKLSAgICAgICAgfSBlbHNlIGlmIChjaCA+PSAweDgwKSB7Ci0gICAgICAgICAgICAqZGVzdCsrID0gKHVpbnQ4X3QpKDB4QzAgfCAoY2ggPj4gNikpOwotICAgICAgICAgICAgKmRlc3QrKyA9ICh1aW50OF90KSgweDgwIHwgKGNoICYgMHgzRikpOwotICAgICAgICB9IGVsc2UgewotICAgICAgICAgICAgKmRlc3QrKyA9IGNoOwotICAgICAgICB9Ci0gICAgfQotICAgICpkZXN0KysgPSAwOwotICAgIG1DaGFyQ291bnQgPSBjb3VudDsKLSAgICBtQnl0ZUNvdW50ID0gZGVzdCAtIG1CdWZmZXI7Ci19Ci0KLXZvaWQgTXRwU3RyaW5nQnVmZmVyOjp3cml0ZVRvUGFja2V0KE10cERhdGFQYWNrZXQqIHBhY2tldCkgY29uc3QgewotICAgIGludCBjb3VudCA9IG1DaGFyQ291bnQ7Ci0gICAgY29uc3QgdWludDhfdCogc3JjID0gbUJ1ZmZlcjsKLSAgICBwYWNrZXQtPnB1dFVJbnQ4KGNvdW50ID4gMCA/IGNvdW50ICsgMSA6IDApOwotCi0gICAgLy8gZXhwYW5kIHV0ZjggdG8gMTYgYml0IGNoYXJzCi0gICAgZm9yIChpbnQgaSA9IDA7IGkgPCBjb3VudDsgaSsrKSB7Ci0gICAgICAgIHVpbnQxNl90IGNoOwotICAgICAgICB1aW50MTZfdCBjaDEgPSAqc3JjKys7Ci0gICAgICAgIGlmICgoY2gxICYgMHg4MCkgPT0gMCkgewotICAgICAgICAgICAgLy8gc2luZ2xlIGJ5dGUgY2hhcmFjdGVyCi0gICAgICAgICAgICBjaCA9IGNoMTsKLSAgICAgICAgfSBlbHNlIGlmICgoY2gxICYgMHhFMCkgPT0gMHhDMCkgewotICAgICAgICAgICAgLy8gdHdvIGJ5dGUgY2hhcmFjdGVyCi0gICAgICAgICAgICB1aW50MTZfdCBjaDIgPSAqc3JjKys7Ci0gICAgICAgICAgICBjaCA9ICgoY2gxICYgMHgxRikgPDwgNikgfCAoY2gyICYgMHgzRik7Ci0gICAgICAgIH0gZWxzZSB7Ci0gICAgICAgICAgICAvLyB0aHJlZSBieXRlIGNoYXJhY3RlcgotICAgICAgICAgICAgdWludDE2X3QgY2g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wMDEgICAvLyBBc3NvY2lhdGlvbiAoZm9yIGV4YW1wbGUsIGEgZm9sZGVyKQotI2RlZmluZSBNVFBfRk9STUFUX1NDUklQVCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAweDMwMDIgICAvLyBEZXZpY2UgbW9kZWwtc3BlY2lmaWMgc2NyaXB0Ci0jZGVmaW5lIE1UUF9GT1JNQVRfRVhFQ1VUQUJMRSAgICAgICAgICAgICAgICAgICAgICAgICAgIDB4MzAwMyAgIC8vIERldmljZSBtb2RlbC1zcGVjaWZpYyBiaW5hcnkgZXhlY3V0YWJsZQotI2RlZmluZSBNVFBfRk9STUFUX1RFWFQgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAweDMwMDQgICAvLyBUZXh0IGZpbGUKLSNkZWZpbmUgTVRQX0ZPUk1BVF9IVE1MICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMHgzMDA1ICAgLy8gSHlwZXJ0ZXh0IE1hcmt1cCBMYW5ndWFnZSBmaWxlICh0ZXh0KQotI2RlZmluZSBNVFBfRk9STUFUX0RQT0YgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAweDMwMDYgICAvLyBEaWdpdGFsIFByaW50IE9yZGVyIEZvcm1hdCBmaWxlICh0ZXh0KQotI2RlZmluZSBNVFBfRk9STUFUX0FJRkYgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAweDMwMDcgICAvLyBBdWRpbyBjbGlwCi0jZGVmaW5lIE1UUF9GT1JNQVRfV0FWICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDB4MzAwOCAgIC8vIEF1ZGlvIGNsaXAKLSNkZWZpbmUgTVRQX0ZPUk1BVF9NUDMgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMHgzMDA5ICAgLy8gQXVkaW8gY2xpcAotI2RlZmluZSBNVFBfRk9STUFUX0FWSSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAweDMwMEEgICAvLyBWaWRlbyBjbGlwCi0jZGVmaW5lIE1UUF9GT1JNQVRfTVBFRyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDB4MzAwQiAgIC8vIFZpZGVvIGNsaXAKLSNkZWZpbmUgTVRQX0ZPUk1BVF9BU0YgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMHgzMDBDICAgLy8gTWljcm9zb2Z0IEFkdmFuY2VkIFN0cmVhbWluZyBGb3JtYXQgKHZpZGVvKQotI2RlZmluZSBNVFBfRk9STUFUX0RFRklORUQgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAweDM4MDAgICAvLyBVbmtub3duIGltYWdlIG9iamVjdAotI2RlZmluZSBNVFBfRk9STUFUX0VYSUZfSlBFRyAgICAgICAgICAgICAgICAgICAgICAgICAgICAweDM4MDEgICAvLyBFeGNoYW5nZWFibGUgRmlsZSBGb3JtYXQsIEpFSURBIHN0YW5kYXJkCi0jZGVmaW5lIE1UUF9GT1JNQVRfVElGRl9FUCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDB4MzgwMiAgIC8vIFRhZyBJbWFnZSBGaWxlIEZvcm1hdCBmb3IgRWxlY3Ryb25pYyBQaG90b2dyYXBoeQotI2RlZmluZSBNVFBfRk9STUFUX0ZMQVNIUElYICAgICAgICAgICAgICAgICAgICAgICAgICAgICAweDM4MDMgICAvLyBTdHJ1Y3R1cmVkIFN0b3JhZ2UgSW1hZ2UgRm9ybWF0Ci0jZGVmaW5lIE1UUF9GT1JNQVRfQk1QICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDB4MzgwNCAgIC8vIE1pY3Jvc29mdCBXaW5kb3dzIEJpdG1hcCBmaWxlCi0jZGVmaW5lIE1UUF9GT1JNQVRfQ0lGRiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDB4MzgwNSAgIC8vIENhbm9uIENhbWVyYSBJbWFnZSBGaWxlIEZvcm1hdAotI2RlZmluZSBNVFBfRk9STUFUX0dJRiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAweDM4MDcgICAvLyBHcmFwaGljcyBJbnRlcmNoYW5nZSBGb3JtYXQKLSNkZWZpbmUgTVRQX0ZPUk1BVF9KRklGICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMHgzODA4ICAgLy8gSlBFRyBGaWxlIEludGVyY2hhbmdlIEZvcm1hdAotI2RlZmluZSBNVFBfRk9STUFUX0NEICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAweDM4MDkgICAvLyBQaG90b0NEIEltYWdlIFBhYwotI2RlZmluZSBNVFBfRk9STUFUX1BJQ1QgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAweDM4MEEgICAvLyBRdWlja2RyYXcgSW1hZ2UgRm9ybWF0Ci0jZGVmaW5lIE1UUF9GT1JNQVRfUE5HICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDB4MzgwQiAgIC8vIFBvcnRhYmxlIE5ldHdvcmsgR3JhcGhpY3MKLSNkZWZpbmUgTVRQX0ZPUk1BVF9USUZGICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMHgzODBEICAgLy8gVGFnIEltYWdlIEZpbGUgRm9ybWF0Ci0jZGVmaW5lIE1UUF9GT1JNQVRfVElGRl9JVCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDB4MzgwRSAgIC8vIFRhZyBJbWFnZSBGaWxlIEZvcm1hdCBmb3IgSW5mb3JtYXRpb24gVGVjaG5vbG9neSAoZ3JhcGhpYyBhcnRzKQotI2RlZmluZSBNVFBfRk9STUFUX0pQMiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAweDM4MEYgICAvLyBKUEVHMjAwMCBCYXNlbGluZSBGaWxlIEZvcm1hdAotI2RlZmluZSBNVFBfRk9STUFUX0pQWCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAweDM4MTAgICAvLyBKUEVHMjAwMCBFeHRlbmRlZCBGaWxlIEZvcm1hdAotI2RlZmluZSBNVFBfRk9STUFUX1VOREVGSU5FRF9GSVJNV0FSRSAgICAgICAgICAgICAgICAgICAweEI4MDIKLSNkZWZpbmUgTVRQX0ZPUk1BVF9XSU5ET1dTX0lNQUdFX0ZPUk1BVCAgICAgICAgICAgICAgICAgMHhCODgxCi0jZGVmaW5lIE1UUF9GT1JNQVRfVU5ERUZJTkVEX0FVRElPICAgICAgICAgICAgICAgICAgICAgIDB4QjkwMAotI2RlZmluZSBNVFBfRk9STUFUX1dNQSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAweEI5MDEKLSNkZWZpbmUgTVRQX0ZPUk1BVF9PR0cgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMHhCOTAyCi0jZGVmaW5lIE1UUF9GT1JNQVRfQUFDICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDB4QjkwMwotI2RlZmluZSBNVFBfRk9STUFUX0FVRElCTEUgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAweEI5MDQKLSNkZWZpbmUgTVRQX0ZPUk1BVF9GTEFDICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMHhCOTA2Ci0jZGVmaW5lIE1UUF9GT1JNQVRfVU5ERUZJTkVEX1ZJREVPICAgICAgICAgICAgICAgICAgICAgIDB4Qjk4MAotI2RlZmluZSBNVFBfRk9STUFUX1dNViAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAweEI5ODEKLSNkZWZpbmUgTVRQX0ZPUk1BVF9NUDRfQ09OVEFJTkVSICAgICAgICAgICAgICAgICAgICAgICAgMHhCOTgyICAvLyBJU08gMTQ0OTYtMQotI2RlZmluZSBNVFBfRk9STUFUX01QMiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAweEI5ODMKLSNkZWZpbmUgTVRQX0ZPUk1BVF8zR1BfQ09OVEFJTkVSICAgICAgICAgICAgICAgICAgICAgICAgMHhCOTg0ICAvLyAzR1BQIGZpbGUgZm9ybWF0LiBEZ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1BVF9BQlNUUkFDVF9WSURFT19QTEFZTElTVCAgICAgICAgICAgICAgMHhCQTBBCi0jZGVmaW5lIE1UUF9GT1JNQVRfQUJTVFJBQ1RfTUVESUFDQVNUICAgICAgICAgICAgICAgICAgIDB4QkEwQiAvLyBGb3IgdXNlIHdpdGggbWVkaWFjYXN0czsgcmVmZXJlbmNlcyBtdWx0aW1lZGlhIGVuY2xvc3VyZXMgb2YgUlNTIGZlZWRzIG9yIGVwaXNvZGljIGNvbnRlbnQKLSNkZWZpbmUgTVRQX0ZPUk1BVF9XUExfUExBWUxJU1QgICAgICAgICAgICAgICAgICAgICAgICAgMHhCQTEwCi0jZGVmaW5lIE1UUF9GT1JNQVRfTTNVX1BMQVlMSVNUICAgICAgICAgICAgICAgICAgICAgICAgIDB4QkExMQotI2RlZmluZSBNVFBfRk9STUFUX01QTF9QTEFZTElTVCAgICAgICAgICAgICAgICAgICAgICAgICAweEJBMTIKLSNkZWZpbmUgTVRQX0ZPUk1BVF9BU1hfUExBWUxJU1QgICAgICAgICAgICAgICAgICAgICAgICAgMHhCQTEzCi0jZGVmaW5lIE1UUF9GT1JNQVRfUExTX1BMQVlMSVNUICAgICAgICAgICAgICAgICAgICAgICAgIDB4QkExNAotI2RlZmluZSBNVFBfRk9STUFUX1VOREVGSU5FRF9ET0NVTUVOVCAgICAgICAgICAgICAgICAgICAweEJBODAKLSNkZWZpbmUgTVRQX0ZPUk1BVF9BQlNUUkFDVF9ET0NVTUVOVCAgICAgICAgICAgICAgICAgICAgMHhCQTgxCi0jZGVmaW5lIE1UUF9GT1JNQVRfWE1MX0RPQ1VNRU5UICAgICAgICAgICAgICAgICAgICAgICAgIDB4QkE4MgotI2RlZmluZSBNVFBfRk9STUFUX01TX1dPUkRfRE9DVU1FTlQgICAgICAgICAgICAgICAgICAgICAweEJBODMKLSNkZWZpbmUgTVRQX0ZPUk1BVF9NSFRfQ09NUElMRURfSFRNTF9ET0NVTUVOVCAgICAgICAgICAgMHhCQTg0Ci0jZGVmaW5lIE1UUF9GT1JNQVRfTVNfRVhDRUxfU1BSRUFEU0hFRVQgICAgICAgICAgICAgICAgIDB4QkE4NQotI2RlZmluZSBNVFBfRk9STUFUX01TX1BPV0VSUE9JTlRfUFJFU0VOVEFUSU9OICAgICAgICAgICAweEJBODYKLSNkZWZpbmUgTVRQX0ZPUk1BVF9VTkRFRklORURfTUVTU0FHRSAgICAgICAgICAgICAgICAgICAgMHhCQjAwCi0jZGVmaW5lIE1UUF9GT1JNQVRfQUJTVFJBQ1RfTUVTU1NBR0UgICAgICAgICAgICAgICAgICAgIDB4QkIwMQotI2RlZmluZSBNVFBfRk9STUFUX1VOREVGSU5FRF9DT05UQUNUICAgICAgICAgICAgICAgICAgICAweEJCODAKLSNkZWZpbmUgTVRQX0ZPUk1BVF9BQlNUUkFDVF9DT05UQUNUICAgICAgICAgICAgICAgICAgICAgMHhCQjgxCi0jZGVmaW5lIE1UUF9GT1JNQVRfVkNBUkRfMiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDB4QkI4MgotCi0vLyBNVFAgT2JqZWN0IFByb3BlcnR5IENvZGVzCi0jZGVmaW5lIE1UUF9QUk9QRVJUWV9TVE9SQUdFX0lEICAgICAgICAgICAgICAgICAgICAgICAgICAgICAweERDMDEKLSNkZWZpbmUgTVRQX1BST1BFUlRZX09CSkVDVF9GT1JNQVQgICAgICAgICAgICAgICAgICAgICAgICAgIDB4REMwMgotI2RlZmluZSBNVFBfUFJPUEVSVFlfUFJPVEVDVElPTl9TVEFUVVMgICAgICAgICAgICAgICAgICAgICAgMHhEQzAzCi0jZGVmaW5lIE1UUF9QUk9QRVJUWV9PQkpFQ1RfU0laRSAgICAgICAgICAgICAgICAgICAgICAgICAgICAweERDMDQKLSNkZWZpbmUgTVRQX1BST1BFUlRZX0FTU09DSUFUSU9OX1RZUEUgICAgICAgICAgICAgICAgICAgICAgIDB4REMwNQotI2RlZmluZSBNVFBfUFJPUEVSVFlfQVNTT0NJQVRJT05fREVTQyAgICAgICAgICAgICAgICAgICAgICAgMHhEQzA2Ci0jZGVmaW5lIE1UUF9QUk9QRVJUWV9PQkpFQ1RfRklMRV9OQU1FICAgICAgICAgICAgICAgICAgICAgICAweERDMDcKLSNkZWZpbmUgTVRQX1BST1BFUlRZX0RBVEVfQ1JFQVRFRCAgICAgICAgICAgICAgICAgICAgICAgICAgIDB4REMwOAotI2RlZmluZSBNVFBfUFJPUEVSVFlfREFURV9NT0RJRklFRCAgICAgICAgICAgICAgICAgICAgICAgICAgMHhEQzA5Ci0jZGVmaW5lIE1UUF9QUk9QRVJUWV9LRVlXT1JEUyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAweERDMEEKLSNkZWZpbmUgTVRQX1BST1BFUlRZX1BBUkVOVF9PQkpFQ1QgICAgICAgICAgICAgICAgICAgICAgICAgIDB4REMwQgotI2RlZmluZSBNVFBfUFJPUEVSVFlfQUxMT1dFRF9GT0xERVJfQ09OVEVOVFMgICAgICAgICAgICAgICAgMHhEQzBDCi0jZGVmaW5lIE1UUF9QUk9QRVJUWV9ISURERU4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAweERDMEQKLSNkZWZpbmUgTVRQX1BST1BFUlRZX1NZU1RFTV9PQkpFQ1QgICAgICAgICAgICAgICAgICAgICAgICAgIDB4REMwRQotI2RlZmluZSBNVFBfUFJPUEVSVFlfUEVSU0lTVEVOVF9VSUQgICAgICAgICAgICAgICAgICAgICAgICAgMHhEQzQxCi0jZGVmaW5lIE1UUF9QUk9QRVJUWV9TWU5DX0lEICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAweERDNDIKLSNkZWZpbmUgTVRQX1BST1BFUlRZX1BST1BFUlRZX0JBRyAgICAgICAgICAgICAgICAgICAgICAgICAgIDB4REM0MwotI2RlZmluZSBNVFBfUFJPUEVSVFlfTkFNRSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMHhEQzQ0Ci0jZGVmaW5lIE1UUF9QUk9QRVJUWV9DUkVBVEVEX0JZICAgICAgICAgICAgICAgICAgICAgICAgICAgICAweERDNDUKLSNkZWZpbmUgTVRQX1BST1BFUlRZX0FSVElTVCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDB4REM0NgotI2RlZmluZSBNVFBfUFJPUEVSVFlfREFURV9BVVRIT1JFRCAgICAgICAgICAgICAgICAgICAgICAgICAgMHhEQzQ3Ci0jZGVmaW5lIE1UUF9QUk9QRVJUWV9ERVNDUklQVElPTiAgICAgICAgICAgICAgICAgICAgICAgICAgICAweERDNDgKLSNkZWZpbmUgTVRQX1BST1BFUlRZX1VSTF9SRUZFUkVOQ0UgICAgICAgICAgICAgICAgICAgICAgICAgIDB4REM0OQotI2RlZmluZSBNVFBfUFJPUEVSVFlfTEFOR1VBR0VfTE9DQUxFICAgICAgICAgICAgICAgICAgICAgICAgMHhEQzRBCi0jZGVmaW5lIE1UUF9QUk9QRVJUWV9DT1BZUklHSFRfSU5GT1JNQVRJT04gICAgICAgICAgICAgICAgICAweERDNEIKLSNkZWZpbmUgTVRQX1BST1BFUlRZX1NPVVJDRSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDB4REM0QwotI2RlZmluZSBNVFBfUFJPUEVSVFlfT1JJR0lOX0xPQ0FUSU9OICAgICAgICAgICAgICAgICAgICAgICAgMHhEQzRECi0jZGVmaW5lIE1UUF9QUk9QRVJUWV9EQVRFX0FEREVEICAgICAgICAgICAgICAgICAgICAgICAgICAgICAweERDNEUKLSNkZWZpbmUgTVRQX1BST1BFUlRZX05PTl9DT05TVU1BQkxFICAgICAgICAgICAgICAgICAgICAgICAgIDB4REM0RgotI2RlZmluZSBNVFBfUFJPUEVSVFlfQ09SUlVQVF9VTlBMQVlBQkxFICAgICAgICAgICAgICAgICAgICAgMHhEQzUwCi0jZGVmaW5lIE1UUF9QUk9QRVJUWV9QUk9EVUNFUl9TRVJJQUxfTlVNQkVSICAgICAgICAgICAgICAgICAweERDNTEKLSNkZWZpbmUgTVRQX1BST1BFUlRZX1JFUFJFU0VOVEFUSVZFX1NBTVBMRV9GT1JNQVQgICAgICAgICAgIDB4REM4MQotI2RlZmluZSBNVFBfUFJPUEVSVFlfUkVQUkVTRU5UQVRJVkVfU0FNUExFX1NJWkUgICAgICAgICAgICAgMHhEQzgyCi0jZGVmaW5lIE1UUF9QUk9QRVJUWV9SRVBSRVNFTlRBVElWRV9TQU1QTEVfSEVJR0hUICAgICAgICAgICAweERDODMKLSNkZWZpbmUgTVRQX1BST1BFUlRZX1JFUFJFU0VOVEFUSVZFX1NBTVBMRV9XSURUSCAgICAgICAgICAgIDB4REM4NAotI2RlZmluZSBNVFBfUFJPUEVSVFlfUkVQUkVTRU5UQVRJVkVfU0FNUExFX0RVUkFUSU9OICAgICAgICAgMHhEQzg1Ci0jZGVmaW5lIE1UUF9QUk9QRVJUWV9SRVBSRVNFTlRBVElWRV9TQU1QTEVfREFUQSAgICAgICAgICAgICAweERDODYKLSNkZWZpbmUgTVRQX1BST1BFUlRZX1dJRFRIICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDB4REM4NwotI2RlZmluZSBNVFBfUFJPUEVSVFlfSEVJR0hUICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMHhEQzg4Ci0jZGVmaW5lIE1UUF9QUk9QRVJUWV9EVVJBVElPTiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAweERDODkKLSNkZWZpbmUgTVRQX1BST1BFUlRZX1JBVElORyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDB4REM4QQotI2RlZmluZSBNVFBfUFJPUEVSVFlfVFJBQ0sgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMHhEQzhCCi0jZGVmaW5lIE1UUF9QUk9QRVJUWV9HRU5SRSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAweERDOEMKLSNkZWZpbmUgTVRQX1BST1BFUlRZX0NSRURJVFMgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDB4REM4RAotI2RlZmluZSBNVFBfUFJPUEVSVFlfTFlSSUNTICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMHhEQzhFCi0jZGVmaW5lIE1UUF9QUk9QRVJUWV9TVUJTQ1JJUFRJT05fQ09OVEVOVF9JRCAgICAgICAgICAgICAgICAweERDOEYKLSNkZWZpbmUgTVRQX1BST1BFUlRZX1BST0RVQ0VEX0JZICAgICAgICAgICAgICAgICAgICAgICAgICAgIDB4REM5MAotI2RlZmluZSBNVFBfUFJPUEVSVFlfVVNFX0NPVU5UICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMHhEQzkxCi0jZGVmaW5lIE1UUF9QUk9QRVJUWV9TS0lQX0NPVU5UICAgICAgICAgICAgICAgICAgICAgICAgICAgICAweERDOTIKLSNkZWZpbmUgTVRQX1BST1BFUlRZX0xBU1RfQUNDRVNTRUQgICAgICAgICAgICAgICAgICAgICAgICAgIDB4REM5MwotI2RlZmluZSBNVFBfUFJPUEVSVFlfUEFSRU5UQUxfUkFUSU5HICAgICAgICAgICAgICAgICAgICAgICAgMHhEQzk0Ci0jZGVmaW5lIE1UUF9QUk9QRVJUWV9NRVRBX0dFTlJFICAgICAgICAgICAgICAgICAgICAgICAgICAgICAweERDOTUKLSNkZWZpbmUgTVRQX1BST1BFUlRZX0NPTVBPU0VSICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDB4REM5NgotI2RlZmluZSBNVFBfUFJPUEVSVFlfRUZGRUNUSVZFX1JBVElORyAgICAgICAgICAgICAgICAgICAgICAgMHhEQzk3Ci0jZGVmaW5lIE1UUF9QUk9QRVJUWV9TVUJUSVRMRSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAweERDOTgKLSNkZWZpbmUgTVRQX1BST1BFUlRZX09SSUdJTkFMX1JFTEVBU0VfREFURSAgICAgICAgICAgICAgICAgIDB4REM5OQotI2RlZmluZSBNVFBfUFJPUEVSVFlfQUxCVU1fTkFNRSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMHhEQzlBCi0jZGVmaW5lIE1UUF9QUk9QRVJUWV9BTEJVTV9BUlRJU1QgICAgICAgICAgICAgICAgICAgICAgICAgICAweERDOUIKLSNkZWZpbmUgTVRQX1BST1BFUlRZX01PT0QgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDB4REM5QwotI2RlZmluZSBNVFBfUFJPUEVSVFlfRFJNX1NUQVRVUyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMHhEQzlECi0jZGVmaW5lIE1UUF9QUk9QRVJUWV9TVUJfREVTQ1JJUFRJT04gICAgICAgICAgICAgICAgICAgICAgICAweERDOUUKLSNkZWZpbmUgTVRQX1BST1BFUlRZX0lTX0NST1BQRUQgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDB4RENEMQotI2RlZmluZSBNVFBfUFJPUEVSVFlfSVNfQ09MT1VSX0NPUlJFQ1RFRCAgICAgICAgICAgICAgICAgICAgMHhEQ0QyCi0jZGVmaW5lIE1UUF9QUk9QRVJUWV9JTUFHRV9CSVRfREVQVEggICAgICAgICAgICAgICAgICAgICAgICAweERDRDMKLSNkZWZpbmUgTVRQX1BST1BFUlRZX0ZfTlVNQkVSICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDB4RENENAotI2RlZmluZSBNVFBfUFJPUEVSVFlfRVhQT1NVUkVfVElNRSAgICAgICAgICAgICAgICAgICAgICAgICAgMHhEQ0Q1Ci0jZGVmaW5lIE1UUF9QUk9QRVJUWV9FWFBPU1VSRV9JTkRFWCAgICAgICAgICAgICAgICAgICAgICAgICAweERDRDYKLSNkZWZpbmUgTVRQX1BST1BFUlRZX1RPVEFMX0JJVFJBVEUgICAgICAgICAgICAgICAgICAgICAgICAgIDB4REU5MQotI2RlZmluZSBNVFBfUFJPUEVSVFlfQklUUkFURV9UWVBFICAgICAgICAgICAgICAgICAgICAgICAgICAgMHhERTkyCi0jZGVmaW5lIE1UUF9QUk9QRVJUWV9TQU1QTEVfUkFURSAgICAgICAgICAgICAgICAgICAgICAgICAgICAweERFOTMKLSNkZWZpbmUgTVRQX1BST1BFUlRZX05VTUJFUl9PRl9DSEFOTkVMUyAgICAgICAgICAgICAgICAgICAgIDB4REU5NAotI2RlZmluZSBNVFBfUFJPUEVSVFlfQVVESU9fQklUX0RFUFRIICAgICAgICAgICAgICAgICAgICAgICAgMHhERTk1Ci0jZGVmaW5lIE1UUF9QUk9QRVJUWV9TQ0FOX1RZUEUgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAweERFOTcKLSNkZWZpbmUgTVRQX1BST1BFUlRZX0FVRElPX1dBVkVfQ09ERUMgICAgICAgICAgICAgICAgICAgICAgIDB4REU5OQotI2RlZmluZSBNVFBfUFJPUEVSVFlfQVVESU9fQklUUkFURSAgICAgICAgICAgICAgICAgICAgICAgICAgMHhERTlBCi0jZGVmaW5lIE1UUF9QUk9QRVJUWV9WSURFT19GT1VSQ0NfQ09ERUMgICAgICAgICAgICAgICAgICAgICAweERFOUIKLSNkZWZpbmUgTVRQX1BST1BFUlRZX1ZJREVPX0JJVFJBVEUgICAgICAgICAgICAgICAgICAgICAgICAgIDB4REU5QwotI2RlZmluZSBNVFBfUFJPUEVSVFlfRlJBTUVTX1BFUl9USE9VU0FORF9TRUNPTkRTICAgICAgICAgICAgMHhERTlECi0jZGVmaW5lIE1UUF9QUk9QRVJUWV9LRVlGUkFNRV9ESVNUQU5DRSAgICAgICAgICAgICAgICAgICAgICAweERFOUUKLSNkZWZpbmUgTVRQX1BST1BFUlRZX0JVRkZFUl9TSVpFICAgICAgICAgICAgICAgICAgICAgICAgICAgIDB4REU5RgotI2RlZmluZSBNVFBfUFJPUEVSVFlfRU5DT0RJTkdfUVVBTElUWSAgICAgICAgICAgICAgICAgICAgICAgMHhERUEwCi0jZGVmaW5lIE1UUF9QUk9QRVJUWV9FTkNPRElOR19QUk9GSUxFICAgICAgICAgICAgICAgICAgICAgICAweERFQTEKLSNkZWZpbmUgTVRQX1BST1BFUlRZX0RJU1BMQVlfTkFNRSAgICAgICAgICAgICAgICAgICAgICAgICAgIDB4RENFMAotI2RlZmluZSBNVFBfUFJPUEVSVFlfQk9EWV9URVhUICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMHhEQ0UxCi0jZGVmaW5lIE1UUF9QUk9QRVJUWV9TVUJKRUNUICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAweERDRTIKLSNkZWZpbmUgTVRQX1BST1BFUlRZX1BSSU9SSVRZICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDB4RENFMwotI2RlZmluZSBNVFBfUFJPUEVSVFlfR0lWRU5fTkFNRSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMHhERDAwCi0jZGVmaW5lIE1UUF9QUk9QRVJUWV9NSURETEVfTkFNRVMgICAgICAgICAgICAgICAgICAgICAgICAgICAweEREMDEKLSNkZWZpbmUgTVRQX1BST1BFUlRZX0ZBTUlMWV9OQU1FICAgICAgICAgICAgICAgICAgICAgICAgICAgIDB4REQwMgotI2RlZmluZSBNVFBfUFJPUEVSVFlfUFJFRklYICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMHhERDAzCi0jZGVmaW5lIE1UUF9QUk9QRVJUWV9TVUZGSVggICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAweEREMDQKLSNkZWZpbmUgTVRQX1BST1BFUlRZX1BIT05FVElDX0dJVkVOX05BTUUgICAgICAgICAgICAgICAgICAgIDB4REQwNQotI2RlZmluZSBNVFBfUFJPUEVSVFlfUEhPTkVUSUNfRkFNSUxZX05BTUUgICAgICAgICAgICAgICAgICAgMHhERDA2Ci0jZGVmaW5lIE1UUF9QUk9QRVJUWV9FTUFJTF9QUklNQVJZICAgICAgICAgICAgICAgICAgICAgICAgICAweEREMDcKLSNkZWZpbmUgTVRQX1BST1BFUlRZX0VNQUlMX1BFUlNPTkFMXzEgICAgICAgICAgICAgICAgICAgICAgIDB4REQwOAotI2RlZmluZSBNVFBfUFJPUEVSVFlfRU1BSUxfUEVSU09OQUxfMiAgICAgICAgICAgICAgICAgICAgICAgMHhERDA5Ci0jZGVmaW5lIE1UUF9QUk9QRVJUWV9FTUFJTF9CVVNJTkVTU18xICAgICAgICAgICAgICAgICAgICAgICAweEREMEEKLSNkZWZpbmUgTVRQX1BST1BFUlRZX0VNQUlMX0JVU0lORVNTXzIgICAgICAgICAgICAgICAgICAgICAgIDB4REQwQgotI2RlZmluZSBNVFBfUFJPUEVSVFlfRU1BSUxfT1RIRVJTICAgICAgICAgICAgICAgICAgICAgICAgICAgMHhERDBDCi0jZGVmaW5lIE1UUF9QUk9QRVJUWV9QSE9ORV9OVU1CRVJfUFJJTUFSWSAgICAgICAgICAgICAgICAgICAweEREMEQKLSNkZWZpbmUgTVRQX1BST1BFUlRZX1BIT05FX05VTUJFUl9QRVJTT05BTCAgICAgICAgICAgICAgICAgIDB4REQwRQotI2RlZmluZSBNVFBfUFJPUEVSVFlfUEhPTkVfTlVNQkVSX1BFUlNPTkFMXzIgICAgICAgICAgICAgICAgMHhERDBGCi0jZGVmaW5lIE1UUF9QUk9QRVJUWV9QSE9ORV9OVU1CRVJfQlVTSU5FU1MgICAgICAgICAgICAgICAgICAweEREMTAKLSNkZWZpbmUgTVRQX1BST1BFUlRZX1BIT05FX05VTUJFUl9CVVNJTkVTU18yICAgICAgICAgICAgICAgIDB4REQxMQotI2RlZmluZSBNVFBfUFJPUEVSVFlfUEhPTkVfTlVNQkVSX01PQklMRSAgICAgICAgICAgICAgICAgICAgMHhERDEyCi0jZGVmaW5lIE1UUF9QUk9QRVJUWV9QSE9ORV9OVU1CRVJfTU9CSUxFXzIgICAgICAgICAgICAgICAgICAweEREMTMKLSNkZWZpbmUgTVRQX1BST1BFUlRZX0ZBWF9OVU1CRVJfUFJJTUFSWSAgICAgICAgICAgICAgICAgICAgIDB4REQxNAotI2RlZmluZSBNVFBfUFJPUEVSVFlfRkFYX05VTUJFUl9QRVJTT05BTCAgICAgICAgICAgICAgICAgICAgMHhERDE1Ci0jZGVmaW5lIE1UUF9QUk9QRVJUWV9GQVhfTlVNQkVSX0JVU0lORVNTICAgICAgICAgICAgICAgICAgICAweEREMTYKLSNkZWZpbmUgTVRQX1BST1BFUlRZX1BBR0VSX05VTUJFUiAgICAgICAgICAgICAgICAgICAgICAgICAgIDB4REQxNwotI2RlZmluZSBNVFBfUFJPUEVSVFlfUEhPTkVfTlVNQkVSX09USEVSUyAgICAgICAgICAgICAgICAgICAgMHhERDE4Ci0jZGVmaW5lIE1UUF9QUk9QRVJUWV9QUklNQVJZX1dFQl9BRERSRVNTICAgICAgICAgICAgICAgICAgICAweEREMTkKLSNkZWZpbmUgTVRQX1BST1BFUlRZX1BFUlNPTkFMX1dFQl9BRERSRVNTICAgICAgICAgICAgICAgICAgIDB4REQxQQotI2RlZmluZSBNVFBfUFJPUEVSVFlfQlVTSU5FU1NfV0VCX0FERFJFU1MgICAgICAgICAgICAgICAgICAgMHhERDFCCi0jZGVmaW5lIE1UUF9QUk9QRVJUWV9JTlNUQU5UX01FU1NBTkdFUl9BRERSRVNTICAgICAgICAgICAgICAweEREMUMKLSNkZWZpbmUgTVRQX1BST1BFUlRZX0lOU1RBTlRfTUVTU0FOR0VSX0FERFJFU1NfMiAgICAgICAgICAgIDB4REQxRAotI2RlZmluZSBNVFBfUFJPUEVSVFlfSU5TVEFOVF9NRVNTQU5HRVJfQUREUkVTU18zICAgICAgICAgICAgMHhERDFFCi0jZGVmaW5lIE1UUF9QUk9QRVJUWV9QT1NUQUxfQUREUkVTU19QRVJTT05BTF9GVUxMICAgICAgICAgICAweEREMUYKLSNkZWZpbmUgTVRQX1BST1BFUlRZX1BPU1RBTF9BRERSRVNTX1BFUlNPTkFMX0xJTkVfMSAgICAgICAgIDB4REQyMAotI2RlZmluZSBNVFBfUFJPUEVSVFlfUE9TVEFMX0FERFJFU1NfUEVSU09OQUxfTElORV8yICAgICAgICAgMHhERDIxCi0jZGVmaW5lIE1UUF9QUk9QRVJUWV9QT1NUQUxfQUREUkVTU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ICAgICAgICAweEREMkUKLSNkZWZpbmUgTVRQX1BST1BFUlRZX1BPU1RBTF9BRERSRVNTX09USEVSX0xJTkVfMiAgICAgICAgICAgIDB4REQyRgotI2RlZmluZSBNVFBfUFJPUEVSVFlfUE9TVEFMX0FERFJFU1NfT1RIRVJfQ0lUWSAgICAgICAgICAgICAgMHhERDMwCi0jZGVmaW5lIE1UUF9QUk9QRVJUWV9QT1NUQUxfQUREUkVTU19PVEhFUl9SRUdJT04gICAgICAgICAgICAweEREMzEKLSNkZWZpbmUgTVRQX1BST1BFUlRZX1BPU1RBTF9BRERSRVNTX09USEVSX1BPU1RBTF9DT0RFICAgICAgIDB4REQzMgotI2RlZmluZSBNVFBfUFJPUEVSVFlfUE9TVEFMX0FERFJFU1NfT1RIRVJfQ09VTlRSWSAgICAgICAgICAgMHhERDMzCi0jZGVmaW5lIE1UUF9QUk9QRVJUWV9PUkdBTklaQVRJT05fTkFNRSAgICAgICAgICAgICAgICAgICAgICAweEREMzQKLSNkZWZpbmUgTVRQX1BST1BFUlRZX1BIT05FVElDX09SR0FOSVpBVElPTl9OQU1FICAgICAgICAgICAgIDB4REQzNQotI2RlZmluZSBNVFBfUFJPUEVSVFlfUk9MRSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMHhERDM2Ci0jZGVmaW5lIE1UUF9QUk9QRVJUWV9CSVJUSERBVEUgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAweEREMzcKLSNkZWZpbmUgTVRQX1BST1BFUlRZX01FU1NBR0VfVE8gICAgICAgICAgICAgICAgICAgICAgICAgICAgIDB4REQ0MAotI2RlZmluZSBNVFBfUFJPUEVSVFlfTUVTU0FHRV9DQyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMHhERDQxCi0jZGVmaW5lIE1UUF9QUk9QRVJUWV9NRVNTQUdFX0JDQyAgICAgICAgICAgICAgICAgICAgICAgICAgICAweERENDIKLSNkZWZpbmUgTVRQX1BST1BFUlRZX01FU1NBR0VfUkVBRCAgICAgICAgICAgICAgICAgICAgICAgICAgIDB4REQ0MwotI2RlZmluZSBNVFBfUFJPUEVSVFlfTUVTU0FHRV9SRUNFSVZFRF9USU1FICAgICAgICAgICAgICAgICAgMHhERDQ0Ci0jZGVmaW5lIE1UUF9QUk9QRVJUWV9NRVNTQUdFX1NFTkRFUiAgICAgICAgICAgICAgICAgICAgICAgICAweERENDUKLSNkZWZpbmUgTVRQX1BST1BFUlRZX0FDVElWSVRZX0JFR0lOX1RJTUUgICAgICAgICAgICAgICAgICAgIDB4REQ1MAotI2RlZmluZSBNVFBfUFJPUEVSVFlfQUNUSVZJVFlfRU5EX1RJTUUgICAgICAgICAgICAgICAgICAgICAgMHhERDUxCi0jZGVmaW5lIE1UUF9QUk9QRVJUWV9BQ1RJVklUWV9MT0NBVElPTiAgICAgICAgICAgICAgICAgICAgICAweERENTIKLSNkZWZpbmUgTVRQX1BST1BFUlRZX0FDVElWSVRZX1JFUVVJUkVEX0FUVEVOREVFUyAgICAgICAgICAgIDB4REQ1NAotI2RlZmluZSBNVFBfUFJPUEVSVFlfQUNUSVZJVFlfT1BUSU9OQUxfQVRURU5ERUVTICAgICAgICAgICAgMHhERDU1Ci0jZGVmaW5lIE1UUF9QUk9QRVJUWV9BQ1RJVklUWV9SRVNPVVJDRVMgICAgICAgICAgICAgICAgICAgICAweERENTYKLSNkZWZpbmUgTVRQX1BST1BFUlRZX0FDVElWSVRZX0FDQ0VQVEVEICAgICAgICAgICAgICAgICAgICAgIDB4REQ1NwotI2RlZmluZSBNVFBfUFJPUEVSVFlfQUNUSVZJVFlfVEVOVEFUSVZFICAgICAgICAgICAgICAgICAgICAgMHhERDU4Ci0jZGVmaW5lIE1UUF9QUk9QRVJUWV9BQ1RJVklUWV9ERUNMSU5FRCAgICAgICAgICAgICAgICAgICAgICAweERENTkKLSNkZWZpbmUgTVRQX1BST1BFUlRZX0FDVElWSVRZX1JFTUFJTkRFUl9USU1FICAgICAgICAgICAgICAgIDB4REQ1QQotI2RlZmluZSBNVFBfUFJPUEVSVFlfQUNUSVZJVFlfT1dORVIgICAgICAgICAgICAgICAgICAgICAgICAgMHhERDVCCi0jZGVmaW5lIE1UUF9QUk9QRVJUWV9BQ1RJVklUWV9TVEFUVVMgICAgICAgICAgICAgICAgICAgICAgICAweERENUMKLSNkZWZpbmUgTVRQX1BST1BFUlRZX09XTkVSICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDB4REQ1RAotI2RlZmluZSBNVFBfUFJPUEVSVFlfRURJVE9SICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMHhERDVFCi0jZGVmaW5lIE1UUF9QUk9QRVJUWV9XRUJNQVNURVIgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAweERENUYKLSNkZWZpbmUgTVRQX1BST1BFUlRZX1VSTF9TT1VSQ0UgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDB4REQ2MAotI2RlZmluZSBNVFBfUFJPUEVSVFlfVVJMX0RFU1RJTkFUSU9OICAgICAgICAgICAgICAgICAgICAgICAgMHhERDYxCi0jZGVmaW5lIE1UUF9QUk9QRVJUWV9USU1FX0JPT0tNQVJLICAgICAgICAgICAgICAgICAgICAgICAgICAweERENjIKLSNkZWZpbmUgTVRQX1BST1BFUlRZX09CSkVDVF9CT09LTUFSSyAgICAgICAgICAgICAgICAgICAgICAgIDB4REQ2MwotI2RlZmluZSBNVFBfUFJPUEVSVFlfQllURV9CT09LTUFSSyAgICAgICAgICAgICAgICAgICAgICAgICAgMHhERDY0Ci0jZGVmaW5lIE1UUF9QUk9QRVJUWV9MQVNUX0JVSUxEX0RBVEUgICAgICAgICAgICAgICAgICAgICAgICAweERENzAKLSNkZWZpbmUgTVRQX1BST1BFUlRZX1RJTUVfVE9fTElWRSAgICAgICAgICAgICAgICAgICAgICAgICAgIDB4REQ3MQotI2RlZmluZSBNVFBfUFJPUEVSVFlfTUVESUFfR1VJRCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMHhERDcyCi0K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Q1RfSEFORExFUyAgICAgICAgICAgICAgICAgICAgMHgxMDA3Ci0jZGVmaW5lIE1UUF9PUEVSQVRJT05fR0VUX09CSkVDVF9JTkZPICAgICAgICAgICAgICAgICAgICAgICAweDEwMDgKLSNkZWZpbmUgTVRQX09QRVJBVElPTl9HRVRfT0JKRUNUICAgICAgICAgICAgICAgICAgICAgICAgICAgIDB4MTAwOQotI2RlZmluZSBNVFBfT1BFUkFUSU9OX0dFVF9USFVNQiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMHgxMDBBCi0jZGVmaW5lIE1UUF9PUEVSQVRJT05fREVMRVRFX09CSkVDVCAgICAgICAgICAgICAgICAgICAgICAgICAweDEwMEIKLSNkZWZpbmUgTVRQX09QRVJBVElPTl9TRU5EX09CSkVDVF9JTkZPICAgICAgICAgICAgICAgICAgICAgIDB4MTAwQwotI2RlZmluZSBNVFBfT1BFUkFUSU9OX1NFTkRfT0JKRUNUICAgICAgICAgICAgICAgICAgICAgICAgICAgMHgxMDBECi0jZGVmaW5lIE1UUF9PUEVSQVRJT05fSU5JVElBVEVfQ0FQVFVSRSAgICAgICAgICAgICAgICAgICAgICAweDEwMEUKLSNkZWZpbmUgTVRQX09QRVJBVElPTl9GT1JNQVRfU1RPUkUgICAgICAgICAgICAgICAgICAgICAgICAgIDB4MTAwRgotI2RlZmluZSBNVFBfT1BFUkFUSU9OX1JFU0VUX0RFVklDRSAgICAgICAgICAgICAgICAgICAgICAgICAgMHgxMDEwCi0jZGVmaW5lIE1UUF9PUEVSQVRJT05fU0VMRl9URVNUICAgICAgICAgICAgICAgICAgICAgICAgICAgICAweDEwMTEKLSNkZWZpbmUgTVRQX09QRVJBVElPTl9TRVRfT0JKRUNUX1BST1RFQ1RJT04gICAgICAgICAgICAgICAgIDB4MTAxMgotI2RlZmluZSBNVFBfT1BFUkFUSU9OX1BPV0VSX0RPV04gICAgICAgICAgICAgICAgICAgICAgICAgICAgMHgxMDEzCi0jZGVmaW5lIE1UUF9PUEVSQ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VFBfT1BFUkFUSU9OX1RSVU5DQVRFX09CSkVDVCAgICAgICAgICAgICAgICAgICAgICAgMHg5NUMzCi0vLyBNdXN0IGJlIGNhbGxlZCBiZWZvcmUgdXNpbmcgU2VuZFBhcnRpYWxPYmplY3QgYW5kIFRydW5jYXRlT2JqZWN0Ci0jZGVmaW5lIE1UUF9PUEVSQVRJT05fQkVHSU5fRURJVF9PQkpFQ1QgICAgICAgICAgICAgICAgICAgICAweDk1QzQKLS8vIENhbGxlZCB0byBjb21taXQgY2hhbmdlcyBtYWRlIGJ5IFNlbmRQYXJ0aWFsT2JqZWN0IGFuZCBUcnVuY2F0ZU9iamVjdAotI2RlZmluZSBNVFBfT1BFUkFUSU9OX0VORF9FRElUX09CSkVDVCAgICAgICAgICAgICAgICAgICAgICAgMHg5NUM1Ci0KLS8vIE1UUCBSZXNwb25zZSBDb2RlcwotI2RlZmluZSBNVFBfUkVTUE9OU0VfVU5ERUZJTkVEICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDB4MjAwMAotI2RlZmluZSBNVFBfUkVTUE9OU0VfT0sgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDB4MjAwMQotI2RlZmluZSBNVFBfUkVTUE9OU0VfR0VORVJBTF9FUlJPUiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDB4MjAwMgotI2RlZmluZSBNVFBfUkVTUE9OU0VfU0VTU0lPTl9OT1RfT1BFTiAgICAgICAgICAgICAgICAgICAgICAgICAgIDB4MjAwMwotI2RlZmluZSBNVFBfUkVTUE9OU0VfSU5WQUxJRF9UUkFOU0FDVElPTl9JRCAgICAgICAgICAgICAgICAgICAgIDB4MjAwNAotI2RlZmluZSBNVFBfUkVTUE9OU0VfT1BFUkFUSU9OX05PVF9TVVBQT1JURUQgICAgICAgICAgICAgICAgICAgIDB4MjAwNQotI2RlZmluZSBNVFBfUkVTUE9OU0VfUEFSQU1FVEVSX05PVF9TVVBQT1JURUQgICAgICAgICAgICAgICAgICAgIDB4MjAwNgotI2RlZmluZSBNVFBfUkVTUE9OU0VfSU5DT01QTEVURV9UUkFOU0ZFUiAgICAgICAgICAgICAgICAgICAgICAgIDB4MjAwNwotI2RlZmluZSBNVFBfUkVTUE9OU0VfSU5WQUxJRF9TVE9SQUdFX0lEICAgICAgICAgICAgICAgICAgICAgICAgIDB4MjAwOAotI2RlZmluZSBNVFBfUkVTUE9OU0VfSU5WQUxJRF9PQkpFQ1RfSEFORExFICAgICAgICAgICAgICAgICAgICAgIDB4MjAwOQotI2RlZmluZSBNVFBfUkVTUE9OU0VfREVWSUNFX1BST1BfTk9UX1NVUFBPUlRFRCAgICAgICAgICAgICAgICAgIDB4MjAwQQotI2RlZmluZSBNVFBfUkVTUE9OU0VfSU5WQUxJRF9PQkpFQ1RfRk9STUFUX0NPREUgICAgICAgICAgICAgICAgIDB4MjAwQgotI2RlZmluZSBNVFBfUkVTUE9OU0VfU1RPUkFHRV9GVUxMICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDB4MjAwQwotI2RlZmluZSBNVFBfUkVTUE9OU0VfT0JKRUNUX1dSSVRFX1BST1RFQ1RFRCAgICAgICAgICAgICAgICAgICAgIDB4MjAwRAotI2RlZmluZSBNVFBfUkVTUE9OU0VfU1RPUkVfUkVBRF9PTkxZICAgICAgICAgICAgICAgICAgICAgICAgICAgIDB4MjAwRQotI2RlZmluZSBNVFBfUkVTUE9OU0VfQUNDRVNTX0RFTklFRCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDB4MjAwRgotI2RlZmluZSBNVFBfUkVTUE9OU0VfTk9fVEhVTUJOQUlMX1BSRVNFTlQgICAgICAgICAgICAgICAgICAgICAgIDB4MjAxMAotI2RlZmluZSBNVFBfUkVTUE9OU0VfU0VMRl9URVNUX0ZBSUxFRCAgICAgICAgICAgICAgICAgICAgICAgICAgIDB4MjAxMQotI2RlZmluZSBNVFBfUkVTUE9OU0VfUEFSVElBTF9ERUxFVElPTiAgICAgICAgICA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TgwOQotI2RlZmluZSBNVFBfUkVTUE9OU0VfT0JKRUNUX1BST1BfTk9UX1NVUFBPUlRFRCAgICAgICAgICAgICAgICAgIDB4QTgwQQotCi0vLyBNVFAgRXZlbnQgQ29kZXMKLSNkZWZpbmUgTVRQX0VWRU5UX1VOREVGSU5FRCAgICAgICAgICAgICAgICAgICAgICAgICAweDQwMDAKLSNkZWZpbmUgTVRQX0VWRU5UX0NBTkNFTF9UUkFOU0FDVElPTiAgICAgICAgICAgICAgICAweDQwMDEKLSNkZWZpbmUgTVRQX0VWRU5UX09CSkVDVF9BRERFRCAgICAgICAgICAgICAgICAgICAgICAweDQwMDIKLSNkZWZpbmUgTVRQX0VWRU5UX09CSkVDVF9SRU1PVkVEICAgICAgICAgICAgICAgICAgICAweDQwMDMKLSNkZWZpbmUgTVRQX0VWRU5UX1NUT1JFX0FEREVEICAgICAgICAgICAgICAgICAgICAgICAweDQwMDQKLSNkZWZpbmUgTVRQX0VWRU5UX1NUT1JFX1JFTU9WRUQgICAgICAgICAgICAgICAgICAgICAweDQwMDUKLSNkZWZpbmUgTVRQX0VWRU5UX0RFVklDRV9QUk9QX0NIQU5HRUQgICAgICAgICAgICAgICAweDQwMDYKLSNkZWZpbmUgTVRQX0VWRU5UX09CSkVDVF9JTkZPX0NIQU5HRUQgICAgICAgICAgICAgICAweDQwMDcKLSNkZWZpbmUgTVRQX0VWRU5UX0RFVklDRV9JTkZPX0NIQU5HRUQgICAgICAgICAgICAgICAweDQwMDgKLSNkZWZpbmUgTVRQX0VWRU5UX1JFUVVFU1RfT0JKRUNUX1RSQU5TRkVSICAgICAgICAgICAweDQwMDkKLSNkZWZpbmUgTVRQX0VWRU5UX1NUT1JFX0ZVTEwgICAgICAgICAgICAgICAgICAgICAgICAweDQwMEEKLSNkZWZpbmUgTVRQX0VWRU5UX0RFVklDRV9SRVNFVCAgICAgICAgICAgICAgICAgICAgICAweDQwMEIKLSNkZWZpbmUgTVRQX0VWRU5UX1NUT1JBR0VfSU5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pb24gZXgpIHsKICAgICAgICAgfQogICAgICAgICBpZiAoRU5BQkxFX0lOVFJVREVSUyAmJiAoCi0gICAgICAgICAgICAgICAgICAgKG5vdGlmaWNhdGlvbi5zY29yZSA+PSBtSW50cnVkZXJJbkltbWVyc2l2ZU1pblNjb3JlKQotICAgICAgICAgICAgICAgIHx8ICghaW1tZXJzaXZlICYmIChub3RpZmljYXRpb24uc2NvcmUgPiBtSW50cnVkZXJNaW5TY29yZSkpKSkgeworICAgICAgICAgICAgICAgICAgIC8vIFRPRE8oZHNhbmRsZXIpOiBPbmx5IGlmIHRoZSBzY3JlZW4gaXMgb24KKyAgICAgICAgICAgICAgICBub3RpZmljYXRpb24ubm90aWZpY2F0aW9uLmludHJ1ZGVyVmlldyAhPSBudWxsKSkgeworLy8gICAgICAgICAgICAgICAgICAgbm90aWZpY2F0aW9uLm5vdGlmaWNhdGlvbi5mdWxsU2NyZWVuSW50ZW50ICE9IG51bGwKKy8vICAgICAgICAgICAgICAgIHx8IChub3RpZmljYXRpb24uc2NvcmUgPj0gbUludHJ1ZGVySW5JbW1lcnNpdmVNaW5TY29yZSkKKy8vICAgICAgICAgICAgICAgIHx8ICghaW1tZXJzaXZlICYmIChub3RpZmljYXRpb24uc2NvcmUgPiBtSW50cnVkZXJNaW5TY29yZSkpKSkgewogICAgICAgICAgICAgU2xvZy5kKFRBRywgIlByZXNlbnRpbmcgaGlnaC1wcmlvcml0eSBub3RpZmljYXRpb24iKTsKICAgICAgICAgICAgIC8vIHNwZWNpYWwgbmV3IHRyYW5zaWVudCB0aWNrZXIgbW9kZQogICAgICAgICAgICAgLy8gMS4gUG9wdWxhdGUgbUludHJ1ZGVyQWxlcnRWaWV3CisgICAgICAgICAgICAKKyAgICAgICAgICAgIGlmIChub3RpZmljYXRpb24ubm90aWZpY2F0aW9uLmludHJ1ZGVyVmlldyA9PSBudWxsKSB7CisgICAgICAgICAgICAgICAgU2xvZy5lKFRBRywgbm90aWZpY2F0aW9uLm5vdGlmaWNhdGlvbi50b1N0cmluZygpICsgIiB3YW50ZWQgdG8gaW50cnVkZSBidXQgaW50cnVkZXJWaWV3IHdhcyBudWxsIik7CisgICAgICAgICAgICAgICAgcmV0dXJuOworICAgICAgICAgICAgfQogCi0gICAgICAgICAgICBJbWFnZVZpZXcgYWxlcnRJY29uID0gKEltYWdlVmlldykgbUludHJ1ZGVyQWxlcnRWaWV3LmZpbmRWaWV3QnlJZChSLmlkLmFsZXJ0SWNvbik7Ci0gICAgICAgICAgICBUZXh0VmlldyBhbGVydFRleHQgPSAoVGV4dFZpZXcpIG1JbnRydWRlckFsZXJ0Vmlldy5maW5kVmlld0J5SWQoUi5pZC5hbGVydFRleHQpOwotICAgICAgICAgICAgYWxlcnRJY29uLnNldEltYWdlRHJhd2FibGUoU3RhdHVzQmFySWNvblZpZXcuZ2V0SWNvbigKLSAgICAgICAgICAgICAgICBhbGVydEljb24uZ2V0Q29udGV4dCgpLAotICAgICAgICAgICAgICAgIGljb25WaWV3LmdldFN0YXR1c0Jhckljb24oKSkpOwotICAgICAgICAgICAgYWxlcnRUZXh0LnNldFRleHQobm90aWZpY2F0aW9uLm5vdGlmaWNhdGlvbi50aWNrZXJUZXh0KTsKKyAgICAgICAgICAgIC8vIGJpbmQgdGhlIGNsaWNrIGV2ZW50IHRvIHRoZSBjb250ZW50IGFyZWEKKyAgICAgICAgICAgIFBlbmRpbmdJbnRlbnQgY29udGVudEludGVudCA9IG5vdGlmaWNhdGlvbi5ub3RpZmljYXRpb24uY29udGVudEludGVudDsKKyAgICAgICAgICAgIGZpbmFsIFZpZXcuT25DbGlja0xpc3RlbmVyIGxpc3RlbmVyID0gKGNvbnRlbnRJbnRlbnQgIT0gbnVsbCkKKyAgICAgICAgICAgICAgICAgICAgPyBuZXcgTm90aWZpY2F0aW9uQ2xpY2tlcihjb250ZW50SW50ZW50LAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIG5vdGlmaWNhdGlvbi5wa2csIG5vdGlmaWNhdGlvbi50YWcsIG5vdGlmaWNhdGlvbi5pZCkKKyAgICAgICAgICAgICAgICAgICAgOiBudWxsOwogCi0gICAgICAgICAgICBWaWV3IGJ1dHRvbiA9IG1JbnRydWRlckFsZXJ0Vmlldy5maW5kVmlld0J5SWQoUi5pZC5pbnRydWRlcl9hbGVydF9jb250ZW50KTsKLSAgICAgICAgICAgIGJ1dHRvbi5zZXRPbkNsaWNrTGlzdGVuZXIoCi0gICAgICAgICAgICAgICAgbmV3IE5vdGlmaWNhdGlvbkNsaWNrZXIobm90aWZpY2F0aW9uLm5vdGlmaWNhdGlvbi5jb250ZW50SW50ZW50LAotICAgICAgICAgICAgICAgICAgICBub3RpZmljYXRpb24ucGtnLCBub3RpZmljYXRpb24udGFnLCBub3RpZmljYXRpb24uaWQpKTsKKyAgICAgICAgICAgIG1JbnRydWRlckFsZXJ0Vmlldy5hcHBseUludHJ1ZGVyQ29udGVudChub3RpZmljYXRpb24ubm90aWZpY2F0aW9uLmludHJ1ZGVyVmlldywgbGlzdGVuZXIpOwogCisgICAgICAgICAgICBtQ3VycmVudGx5SW50cnVkaW5nTm90aWZpY2F0aW9uID0gbm90aWZpY2F0aW9uOworICAgICAgICAgICAgCiAgICAgICAgICAgICAvLyAyLiBBbmltYXRlIG1JbnRydWRlckFsZXJ0VmlldyBpbgogICAgICAgICAgICAgbUhhbmRsZXIuc2VuZEVtcHR5TWVzc2FnZShNU0dfU0hPV19JTlRSVURFUik7CiAKICAgICAgICAgICAgIC8vIDMuIFNldCBhbGFybSB0byBhZ2UgdGhlIG5vdGlmaWNhdGlvbiBvZmYgKFRPRE8pCiAgICAgICAgICAgICBtSGFuZGxlci5yZW1vdmVNZXNzYWdlcyhNU0dfSElERV9JTlRSVURFUik7Ci0gICAgICAgICAgICBtSGFuZGxlci5zZW5kRW1wdHlNZXNzYWdlRGVsYXllZChNU0dfSElERV9JTlRSVURFUiwgSU5UUlVERVJfQUxFUlRfREVDQVlfTVMpOworICAgICAgICAgICAgaWYgKElOVFJVREVSX0FMRVJUX0RFQ0FZX01TID4gMCkgeworICAgICAgICAgICAgICAgIG1IYW5kbGVyLnNlbmRFbXB0eU1lc3NhZ2VEZWxheWVkKE1TR19ISURFX0lOVFJVREVSLCBJTlRSVURFUl9BTEVSVF9ERUNBWV9NUyk7CisgICAgICAgICAgICB9CiAgICAgICAgIH0gZWxzZSBpZiAobm90aWZpY2F0aW9uLm5vdGlmaWNhdGlvbi5mdWxsU2NyZWVuSW50ZW50ICE9IG51bGwpIHsKICAgICAgICAgICAgIC8vIG5vdCBpbW1lcnNpdmUgJiBhIGZ1bGwtc2NyZWVuIGFsZXJ0IHNob3VsZCBiZSBzaG93bgogICAgICAgICAgICAgU2xvZy5kKFRBRywgIk5vdGlmaWNhdGlvbiBoYXMgZnVsbFNjcmVlbkludGVudDsgc2VuZGluZyBmdWxsU2NyZWVuSW50ZW50Iik7CkBAIC01OTYsOCArNjA5LDEwIEBACiAgICAgICAgIH0gZWxzZSB7CiAgICAgICAgICAgICAvLyB1c3VhbCBjYXNlOiBzdGF0dXMgYmFyIHZpc2libGUgJiBub3QgaW1tZXJzaXZlCiAKLSAgICAgICAgICAgIC8vIHNob3cgdGhlIHRpY2tlcgotICAgICAgICAgICAgdGljayhub3RpZmljYXRpb24pOworICAgICAgICAgICAgLy8gc2hvdyB0aGUgdGlja2VyIGlmIHRoZXJlIGlzbid0IGFuIGludHJ1ZGVyIHRvbworICAgICAgICAgICAgaWYgKG1DdXJyZW50bHlJbnRydWRpbmdOb3RpZmljYXRpb24gPT0gbnVsbCkgeworICAgICAgICAgICAgICAgIHRpY2sobm90aWZpY2F0aW9uKTsKKyAgICAgICAgICAgIH0KICAgICAgICAgfQogCiAgICAgICAgIC8vIFJlY2FsY3VsYXRlIHRoZSBwb3NpdGlvbiBvZiB0aGUgc2xpZGluZyB3aW5kb3dzIGFuZCB0aGUgdGl0bGVzLgpAQCAtNzA4LDExICs3MjMsMjIgQEAKICAgICAgICAgLy8gUmVjYWxjdWxhdGUgdGhlIHB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aWZpY2F0aW9uIGtleT0iICsga2V5KTsKICAgICAgICAgU3RhdHVzQmFyTm90aWZpY2F0aW9uIG9sZCA9IHJlbW92ZU5vdGlmaWNhdGlvblZpZXdzKGtleSk7CisgICAgICAgIGlmIChTUEVXKSBTbG9nLmQoVEFHLCAicmVtb3ZlTm90aWZpY2F0aW9uIGtleT0iICsga2V5ICsgIiBvbGQ9IiArIG9sZCk7CiAKICAgICAgICAgaWYgKG9sZCAhPSBudWxsKSB7CiAgICAgICAgICAgICAvLyBDYW5jZWwgdGhlIHRpY2tlciBpZiBpdCdzIHN0aWxsIHJ1bm5pbmcKQEAgLTcyMCw2ICs3NDYsMTAgQEAKIAogICAgICAgICAgICAgLy8gUmVjYWxjdWxhdGUgdGhlIHBvc2l0aW9uIG9mIHRoZSBzbGlkaW5nIHdpbmRvd3MgYW5kIHRoZSB0aXRsZXMuCiAgICAgICAgICAgICB1cGRhdGVFeHBhbmRlZFZpZXdQb3MoRVhQQU5ERURfTEVBVkVfQUxPTkUpOworICAgICAgICAgICAgCisgICAgICAgICAgICBpZiAob2xkID09IG1DdXJyZW50bHlJbnRydWRpbmdOb3RpZmljYXRpb24pIHsKKyAgICAgICAgICAgICAgICBtSGFuZGxlci5zZW5kRW1wdHlNZXNzYWdlKE1TR19ISURFX0lOVFJVREVSKTsKKyAgICAgICAgICAgIH0KIAogICAgICAgICAgICAgaWYgKENMT1NFX1BBTkVMX1dIRU5fRU1QVElFRCAmJiBtTm90aWZpY2F0aW9uRGF0YS5zaXplKCkgPT0gMCAmJiAhbUFuaW1hdGluZykgewogICAgICAgICAgICAgICAgIGFuaW1hdGVDb2xsYXBzZSgpOwpAQCAtMTA4MCw2ICsxMTEwLDcgQEAKICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CiAgICAgICAgICAgICAgICAgY2FzZSBNU0dfSElERV9JTlRSVURFUjoKICAgICAgICAgICAgICAgICAgICAgc2V0SW50cnVkZXJBbGVydFZpc2liaWxpdHkoZmFsc2UpOworICAgICAgICAgICAgICAgICAgICBtQ3VycmVudGx5SW50cnVkaW5nTm90aWZpY2F0aW9uID0gbnVsbDsKICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CiAgICAgICAgICAgICAgICAgY2FzZSBNU0dfT1BFTl9SRUNFTlRTX1BBTkVMOgogICAgICAgICAgICAgICAgICAgICBpZiAoREVCVUcpIFNsb2cuZChUQUcsICJvcGVuaW5nIHJlY2VudHMgcGFuZWwiKTsKQEAgLTE1NzYsNiArMTYwNywxMiBAQAogICAgICAgICB9CiAKICAgICAgICAgcHVibGljIHZvaWQgb25DbGljayhWaWV3IHYpIHsKKyAgICAgICAgICAgIGlmIChERUJVRykgeworICAgICAgICAgICAgICAgIFNsb2cudihUQUcsICJOb3RpZmljYXRpb25DbGlja2VyOiBpbnRlbnQ9IiArIG1JbnRlbnQKKyAgICAgICAgICAgICAgICAgICAgICAgICsgIiBwa2c9IiArIG1Qa2cKKyAgICAgICAgICAgICAgICAgICAgICAgICsgIiB0YWc9IiArIG1UYWcKKyAgICAgICAgICAgICAgICAgICAgICAgICsgIiBpZD0iICsgbUlkKTsKKyAgICAgICAgICAgIH0KICAgICAgICAgICAgIHRyeSB7CiAgICAgICAgICAgICAgICAgLy8gVGhlIGludGVudCB3ZSBhcmUgc2VuZGluZyBpcyBmb3IgdGhlIGFwcGxpY2F0aW9uLCB3aGljaAogICAgICAgICAgICAgICAgIC8vIHdvbid0IGhhdmUgcGVybWlzc2lvbiB0byBpbW1lZGlhdGVseSBzdGFydCBhbiBhY3Rpdml0eSBhZnRlcgpAQCAtMjE4Miw5ICsyMjE5LDI1IEBACiAgICAgfTsKIAogICAgIHByaXZhdGUgdm9pZCBzZXRJbnRydWRlckFsZXJ0VmlzaWJpbGl0eShib29sZWFuIHZpcykgeworICAgICAgICBpZiAoREVCVUcpIHsKKyAgICAgICAgICAgIFNsb2cudihUQUcsICh2aXMgPyAic2hvd2luZyIgOiAiaGlkaW5nIikgKyAiIGludHJ1ZGVyIGFsZXJ0IHdpbmRvdyIpOworICAgICAgICB9CiAgICAgICAgIG1JbnRydWRlckFsZXJ0Vmlldy5zZXRWaXNpYmlsaXR5KHZpcyA/IFZpZXcuVklTSUJMRSA6IFZpZXcuR09ORSk7CiAgICAgfQogCisgICAgcHVibGljIHZvaWQgZGlzbWlzc0ludHJ1ZGVyKCkgeworICAgICAgICBpZiAobUN1cnJlbnRseUludHJ1ZGluZ05vdGlmaWNhdGlvbiA9PSBudWxsKSByZXR1cm47CisKKyAgICAgICAgdHJ5IHsKKyAgICAgICAgICAgIG1CYXJTZXJ2aWNlLm9uTm90aWZpY2F0aW9uQ2xlYXIoCisgICAgICAgICAgICAgICAgICAgIG1DdXJyZW50bHlJbnRydWRpbmdOb3RpZmljYXRpb24ucGtnLAorICAgICAgICAgICAgICAgICAgICBtQ3VycmVudGx5SW50cnVkaW5nTm90aWZpY2F0aW9uLnRhZywgCisgICAgICAgICAgICAgICAgICAgIG1DdXJyZW50bHlJbnRydWRpbmdOb3RpZmljYXRpb24uaWQpOworICAgICAgICB9IGNhdGNoIChhbmRyb2lkLm9zLlJlbW90ZUV4Y2VwdGlvbiBleCkgeworICAgICAgICAgICAgLy8gb2ggd2VsbAorICAgICAgICB9CisgICAgfQorICAgIAogICAgIC8qKgogICAgICAqIFJlbG9hZCBzb21lIG9mIG91ciByZXNvdXJjZXMgd2hlbiB0aGUgY29uZmlndXJhdGlvbiBjaGFuZ2VzLgogICAgICAqCmRpZmYgLS1naXQgYS9wYWNrYWdlcy9TeXN0ZW1VSS9zcmMvY29tL2FuZHJvaWQvc3lzdGVtdWkvc3RhdHVzYmFyL3BvbGljeS9JbnRydWRlckFsZXJ0Vmlldy5qYXZhIGIvcGFja2FnZXMvU3lzdGVtVUkvc3JjL2NvbS9hbmRyb2lkL3N5c3RlbXVpL3N0YXR1c2Jhci9wb2xpY3kvSW50cnVkZXJBbGVydFZpZXcuamF2YQpuZXcgZmlsZSBtb2RlIDEwMDY0NAppbmRleCAwMDAwMDAwLi5l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XB0VG91Y2hFdmVudChldikgfHwKKyAgICAgICAgICAgIHN1cGVyLm9uSW50ZXJjZXB0VG91Y2hFdmVudChldik7CisgICAgfQorCisgICAgQE92ZXJyaWRlCisgICAgcHVibGljIGJvb2xlYW4gb25Ub3VjaEV2ZW50KE1vdGlvbkV2ZW50IGV2KSB7CisgICAgICAgIHJldHVybiBtU3dpcGVIZWxwZXIub25Ub3VjaEV2ZW50KGV2KSB8fAorICAgICAgICAgICAgc3VwZXIub25Ub3VjaEV2ZW50KGV2KTsKKyAgICB9CisKKyAgICBwdWJsaWMgYm9vbGVhbiBjYW5DaGlsZEJlRGlzbWlzc2VkKFZpZXcgdikgeworICAgICAgICByZXR1cm4gdHJ1ZTsKKyAgICB9CisKKyAgICBwdWJsaWMgdm9pZCBvbkNoaWxkRGlzbWlzc2VkKFZpZXcgdikgeworICAgICAgICBTbG9nLnYoVEFHLCAiVXNlciBzd2lwZWQgaW50cnVkZXIgdG8gZGlzbWlzcyIpOworICAgICAgICBtQmFyLmRpc21pc3NJbnRydWRlcigpOworICAgIH0KKworICAgIHB1YmxpYyB2b2lkIG9uQmVnaW5EcmFnKFZpZXcgdikgeworICAgIH0KKworICAgIHB1YmxpYyB2b2lkIG9uRHJhZ0NhbmNlbGxlZChWaWV3IHYpIHsKKyAgICAgICAgbUNvbnRlbnRIb2xkZXIuc2V0QWxwaGEoMWYpOyAvLyBzb21ldGltZXMgdGhpcyBpc24ndCBxdWl0ZSByZXNldAorICAgIH0KKworICAgIHB1YmxpYyBWaWV3IGdldENoaWxkQXRQb3NpdGlvbihNb3Rpb25FdmVudCBldikgeworICAgICAgICByZXR1cm4gbUNvbnRlbnRIb2xkZXI7CisgICAgfQorCisgICAgcHVibGljIFZpZXcgZ2V0Q2hpbGRDb250ZW50VmlldyhWaWV3IHYpIHsKKyAgICAgICAgcmV0dXJuIHY7CisgICAgfQorCisgICAgQE92ZXJyaWRlCisgICAgcHJvdGVjdGVkIHZvaWQgb25Db25maWd1cmF0aW9u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sKKyAgICAgICAgICAgIGMucmVzdG9yZSgpOworICAgICAgICB9CisgICAgfQorCisgICAgcHVibGljIHZvaWQgYXBwbHlJbnRydWRlckNvbnRlbnQoUmVtb3RlVmlld3MgaW50cnVkZXJWaWV3LCBPbkNsaWNrTGlzdGVuZXIgbGlzdGVuZXIpIHsKKyAgICAgICAgaWYgKERFQlVHKSB7CisgICAgICAgICAgICBTbG9nLnYoVEFHLCAiYXBwbHlJbnRydWRlckNvbnRlbnQ6IHZpZXc9IiArIGludHJ1ZGVyVmlldyArICIgbGlzdGVuZXI9IiArIGxpc3RlbmVyKTsKKyAgICAgICAgfQorICAgICAgICBtSW50cnVkZXJSZW1vdGVWaWV3cyA9IGludHJ1ZGVyVmlldzsKKyAgICAgICAgbU9uQ2xpY2tMaXN0ZW5lciA9IGxpc3RlbmVyOworICAgICAgICBpZiAobUNvbnRlbnRIb2xkZXIgPT0gbnVsbCkgeyAKKyAgICAgICAgICAgIC8vIHRvbyBzb29uIQorICAgICAgICAgICAgcmV0dXJuOworICAgICAgICB9CisgICAgICAgIG1Db250ZW50SG9sZGVyLnNldFgoMCk7CisgICAgICAgIG1Db250ZW50SG9sZGVyLnNldFZpc2liaWxpdHkoVmlldy5WSVNJQkxFKTsKKyAgICAgICAgbUNvbnRlbnRIb2xkZXIuc2V0QWxwaGEoMWYpOworICAgICAgICBtQ29udGVudEhvbGRlci5yZW1vdmVBbGxWaWV3cygpOworICAgICAgICBmaW5hbCBWaWV3IGNvbnRlbnQgPSBpbnRydWRlclZpZXcuYXBwbHkoZ2V0Q29udGV4dCgpLCBtQ29udGVudEhvbGRlcik7CisgICAgICAgIGlmIChsaXN0ZW5lciAhPSBudWxsKSB7CisgICAgICAgICAgICBjb250ZW50LnNldE9uQ2xpY2tMaXN0ZW5lcihsaXN0ZW5lcik7CisgICAgICAgICAgICAKKyAgICAgICAgICAgIC8vY29udGVudC5zZXRCYWNrZ3JvdW5kUmVzb3VyY2UoUi5kcmF3YWJsZS5pbnRydWR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AgIH0KIAogICAgICAgICBwcml2YXRlIGludCByaW5nZXJNb2RlVG9JbmRleChpbnQgcmluZ2VyTW9kZSkgewpAQCAtNTY3LDYgKzU4MCw5IEBACiAgICAgICAgICAgICAgICAgLy8gU2V0IHVwIGNsaWNrIGhhbmRsZXIKICAgICAgICAgICAgICAgICBpdGVtVmlldy5zZXRUYWcoaSk7CiAgICAgICAgICAgICAgICAgaXRlbVZpZXcuc2V0T25DbGlja0xpc3RlbmVyKHRoaXMpOworICAgICAgICAgICAgICAgIGlmIChpdGVtVmlldy5nZXRJZCgpID09IFIuaWQub3B0aW9uMiAmJiAhbUhhc1ZpYnJhdG9yKSB7CisgICAgICAgICAgICAgICAgICAgIGl0ZW1WaWV3LnNldFZpc2liaWxpdHkoVmlldy5HT05FKTsKKyAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICB9CiAgICAgICAgICAgICByZXR1cm4gdjsKICAgICAgICAgfQpAQCAtNjY3LDQgKzY4MywxMiBAQAogICAgICAgICBpbnRlbnQucHV0RXh0cmEoInN0YXRlIiwgb24pOwogICAgICAgICBtQ29udGV4dC5zZW5kQnJvYWRjYXN0KGludGVudCk7CiAgICAgfQorCisgICAgcHJpdmF0ZSBJV2luZG93TWFuYWdlciBnZXRXaW5kb3dNYW5hZ2VyKCkgeworICAgICAgICBpZiAobUlXaW5kb3dNYW5hZ2VyID09IG51bGwpIHsKKyAgICAgICAgICAgIElCaW5kZXIgYiA9IFNlcnZpY2VNYW5hZ2VyLmdldFNlcnZpY2UoQ29udGV4dC5XSU5ET1dfU0VSVklDRSk7CisgICAgICAgICAgICBtSVdpbmRvd01hbmFnZXIgPSBJV2luZG93TWFuYWdlci5TdHViLmFzSW50ZXJmYWNlKGIpOworICAgICAgICB9CisgICAgICAgIHJldHVybiBtSVdpbmRvd01hbmFnZXI7CisgICAgfQogfQpkaWZmIC0tZ2l0IGEvc2VydmljZXMvYXVkaW9mbGluZ2VyL0FuZHJvaWQubWsgYi9zZXJ2aWNlcy9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vIHByZXZlbnQgc2FtZSBhdWRpbyBzZXNzaW9uIG9uIGRpZmZlcmVudCBvdXRwdXQgdGhyZWFkcwotICAgICAgICAgICAgICAgICAgICB1aW50MzJfdCBzZXNzaW9ucyA9IHQtPmhhc0F1ZGlvU2Vzc2lvbigqc2Vzc2lvbklkKTsKLSAgICAgICAgICAgICAgICAgICAgaWYgKHNlc3Npb25zICYgUGxheWJhY2tUaHJlYWQ6OlRSQUNLX1NFU1NJT04pIHsKLSAgICAgICAgICAgICAgICAgICAgICAgIEFMT0dFKCJjcmVhdGVUcmFjaygpIHNlc3Npb24gSUQgJWQgYWxyZWFkeSBpbiB1c2UiLCAqc2Vzc2lvbklkKTsKLSAgICAgICAgICAgICAgICAgICAgICAgIGxTdGF0dXMgPSBCQURfVkFMVUU7Ci0gICAgICAgICAgICAgICAgICAgICAgICBnb3RvIEV4aXQ7Ci0gICAgICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICAgICAgLy8gY2hlY2sgaWYgYW4gZWZmZWN0IHdpdGggc2FtZSBzZXNzaW9uIElEIGlzIHdhaXRpbmcgZm9yIGEgdHJhY2sgdG8gYmUgY3JlYXRlZAotICAgICAgICAgICAgICAgICAgICBpZiAoc2Vzc2lvbnMgJiBQbGF5YmFja1RocmVhZDo6RUZGRUNUX1NFU1NJT04pIHsKLSAgICAgICAgICAgICAgICAgICAgICAgIGVmZmVjdFRocmVhZCA9IHQuZ2V0KCk7Ci0gICAgICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICB9Ci0gICAgICAgICAgICBsU2Vzc2lvbklkID0gKnNlc3Npb25JZDsKLSAgICAgICAgfSBlbHNlIHsKLSAgICAgICAgICAgIC8vIGlmIG5vIGF1ZGlvIHNlc3Npb24gaWQgaXMgcHJvdmlkZWQsIGNyZWF0ZSBvbmUgaGVyZQotICAgICAgICAgICAgbFNlc3Npb25JZCA9IG5leHRVbmlxdWVJZCgpOwotICAgICAgICAg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ZWNvcmRUaHJlYWQ6OlJlY29yZFRyYWNrICp0cmFjayA9IHRocmVhZC0+dHJhY2soKTsKLSAgICAgICAgICAgICAgICAgICAgaWYgKHRyYWNrICE9IE5VTEwpIHsKLSAgICAgICAgICAgICAgICAgICAgICAgIGF1ZGlvX2RldmljZXNfdCBkZXZpY2UgPSAoYXVkaW9fZGV2aWNlc190KSgKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdGhyZWFkLT5kZXZpY2UoKSAmIEFVRElPX0RFVklDRV9JTl9BTEwpOwotICAgICAgICAgICAgICAgICAgICAgICAgYm9vbCBzdXNwZW5kID0gYXVkaW9faXNfYmx1ZXRvb3RoX3Njb19kZXZpY2UoZGV2aWNlKSAmJiBidE5yZWNJc09mZjsKLSAgICAgICAgICAgICAgICAgICAgICAgIHRocmVhZC0+c2V0RWZmZWN0U3VzcGVuZGVkKEZYX0lJRF9BRUMsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzdXNwZW5kLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdHJhY2stPnNlc3Npb25JZCgpKTsKLSAgICAgICAgICAgICAgICAgICAgICAgIHRocmVhZC0+c2V0RWZmZWN0U3VzcGVuZGVkKEZYX0lJRF9OUywKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHN1c3BlbmQsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0cmFjay0+c2Vzc2lvbklkKCkpOwotICAgICAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgIG1CdE5yZWNJc09mZiA9IGJ0TnJlY0lzT2ZmOwotICAgICAgICAgICAgfQotICAgICAgICB9Ci0gICAgICAgIHJldHVybiBmaW5hbF9yZXN1bHQ7Ci0gICAgfQotCi0gICAgLy8gaG9sZCBh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nMoa2V5VmFsdWVQYWlycyk7Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgfQotICAgICAgICB9Ci0gICAgfQotICAgIGlmICh0aHJlYWQgIT0gMCkgewotICAgICAgICByZXR1cm4gdGhyZWFkLT5zZXRQYXJhbWV0ZXJzKGtleVZhbHVlUGFpcnMpOwotICAgIH0KLSAgICByZXR1cm4gQkFEX1ZBTFVFOwotfQotCi1TdHJpbmc4IEF1ZGlvRmxpbmdlcjo6Z2V0UGFyYW1ldGVycyhhdWRpb19pb19oYW5kbGVfdCBpb0hhbmRsZSwgY29uc3QgU3RyaW5nOCYga2V5cykgY29uc3QKLXsKLS8vICAgIEFMT0dWKCJnZXRQYXJhbWV0ZXJzKCkgaW8gJWQsIGtleXMgJXMsIHRpZCAlZCwgY2FsbGluZyBwaWQgJWQiLAotLy8gICAgICAgICAgICBpb0hhbmRsZSwga2V5cy5zdHJpbmcoKSwgZ2V0dGlkKCksIElQQ1RocmVhZFN0YXRlOjpzZWxmKCktPmdldENhbGxpbmdQaWQoKSk7Ci0KLSAgICBpZiAoaW9IYW5kbGUgPT0gMCkgewotICAgICAgICBTdHJpbmc4IG91dF9zODsKLQotICAgICAgICBmb3IgKHNpemVfdCBpID0gMDsgaSA8IG1BdWRpb0h3RGV2cy5zaXplKCk7IGkrKykgewotICAgICAgICAgICAgY2hhciAqczsKLSAgICAgICAgICAgIHsKLSAgICAgICAgICAgIEF1dG9NdXRleCBsb2NrKG1IYXJkd2FyZUxvY2spOwotICAgICAgICAgICAgbUhhcmR3YXJlU3RhdHVzID0gQVVESU9fSFdfR0VUX1BBUkFNRVRFUjsKLSAgICAgICAgICAgIGF1ZGlvX2h3X2RldmljZV90ICpkZXYgPSBtQXVkaW9Id0RldnNbaV07Ci0gICAgICAgICAgICBzID0gZGV2LT5nZXRfcGFyYW1ldGVycyhkZXYsIGtleXMuc3RyaW5nKCkpOwotICAgICAgICAgICAgbUhhcmR3YXJlU3RhdHVzID0gQVVESU9fSFdf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b25DbGllbnQgPSBuZXcgTm90aWZpY2F0aW9uQ2xpZW50KHRoaXMsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY2xpZW50LAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBpZCk7Ci0gICAgICAgIEFMT0dWKCJyZWdpc3RlckNsaWVudCgpIGNsaWVudCAlcCwgcGlkICVkIiwgbm90aWZpY2F0aW9uQ2xpZW50LmdldCgpLCBwaWQpOwotCi0gICAgICAgIG1Ob3RpZmljYXRpb25DbGllbnRzLmFkZChwaWQsIG5vdGlmaWNhdGlvbkNsaWVudCk7Ci0KLSAgICAgICAgc3A8SUJpbmRlcj4gYmluZGVyID0gY2xpZW50LT5hc0JpbmRlcigpOwotICAgICAgICBiaW5kZXItPmxpbmtUb0RlYXRoKG5vdGlmaWNhdGlvbkNsaWVudCk7Ci0KLSAgICAgICAgLy8gdGhlIGNvbmZpZyBjaGFuZ2UgaXMgYWx3YXlzIHNlbnQgZnJvbSBwbGF5YmFjayBvciByZWNvcmQgdGhyZWFkcyB0byBhdm9pZCBkZWFkbG9jawotICAgICAgICAvLyB3aXRoIEF1ZGlvU3lzdGVtOjpnTG9jawotICAgICAgICBmb3IgKHNpemVfdCBpID0gMDsgaSA8IG1QbGF5YmFja1RocmVhZHMuc2l6ZSgpOyBpKyspIHsKLSAgICAgICAgICAgIG1QbGF5YmFja1RocmVhZHMudmFsdWVBdChpKS0+c2VuZENvbmZpZ0V2ZW50KEF1ZGlvU3lzdGVtOjpPVVRQVVRfT1BFTkVEKTsKLSAgICAgICAgfQotCi0gICAgICAgIGZvciAoc2l6ZV90IGkgPSAwOyBpIDwgbVJlY29yZFRocmVhZHMuc2l6ZSgpOyBpKyspIHsKLSAgICAgICAgICAgIG1SZWNvcmRUaHJlYWRzLnZhbHVlQXQoaS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2UiLCBtTmFtZSk7Ci0gICAgICAgIH0gZWxzZSB7Ci0gICAgICAgICAgICBtUG93ZXJNYW5hZ2VyID0gaW50ZXJmYWNlX2Nhc3Q8SVBvd2VyTWFuYWdlcj4oYmluZGVyKTsKLSAgICAgICAgICAgIGJpbmRlci0+bGlua1RvRGVhdGgobURlYXRoUmVjaXBpZW50KTsKLSAgICAgICAgfQotICAgIH0KLSAgICBpZiAobVBvd2VyTWFuYWdlciAhPSAwKSB7Ci0gICAgICAgIHNwPElCaW5kZXI+IGJpbmRlciA9IG5ldyBCQmluZGVyKCk7Ci0gICAgICAgIHN0YXR1c190IHN0YXR1cyA9IG1Qb3dlck1hbmFnZXItPmFjcXVpcmVXYWtlTG9jayhQT1dFUk1BTkFHRVJfUEFSVElBTF9XQUtFX0xPQ0ssCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBiaW5kZXIsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBTdHJpbmcxNihtTmFtZSkpOwotICAgICAgICBpZiAoc3RhdHVzID09IE5PX0VSUk9SKSB7Ci0gICAgICAgICAgICBtV2FrZUxvY2tUb2tlbiA9IGJpbmRlcjsKLSAgICAgICAgfQotICAgICAgICBBTE9HVigiYWNxdWlyZVdha2VMb2NrX2woKSAlcyBzdGF0dXMgJWQiLCBtTmFtZSwgc3RhdHVzKTsKLSAgICB9Ci19Ci0KLXZvaWQgQXVkaW9GbGluZ2VyOjpUaHJlYWRCYXNlOjpyZWxlYXNlV2FrZUxvY2soKQotewotICAgIE11dGV4OjpBdXRvbG9jayBfbChtTG9jayk7Ci0gICAgcmVsZWFzZVdha2VMb2NrX2woKTsKLX0KLQotdm9pZCBBdWRpb0ZsaW5nZXI6OlRocmVhZEJhc2U6OnJlbGVhc2VXYWtlTG9ja19sKCkKLXsKLSAgICBpZiAobVdha2VMb2NrVG9rZW4gIT0gMCkgewotICAg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srKSB7Ci0gICAgICAgIHNwPFN1c3BlbmRlZFNlc3Npb25EZXNjPiBkZXNjID0gc2Vzc2lvbkVmZmVjdHMudmFsdWVBdChpKTsKLSAgICAgICAgZm9yIChpbnQgaiA9IDA7IGogPCBkZXNjLT5tUmVmQ291bnQ7IGorKykgewotICAgICAgICAgICAgaWYgKHNlc3Npb25FZmZlY3RzLmtleUF0KGkpID09IEVmZmVjdENoYWluOjprS2V5Rm9yU3VzcGVuZEFsbCkgewotICAgICAgICAgICAgICAgIGNoYWluLT5zZXRFZmZlY3RTdXNwZW5kZWRBbGxfbCh0cnVlKTsKLSAgICAgICAgICAgIH0gZWxzZSB7Ci0gICAgICAgICAgICAgICAgQUxPR1YoImNoZWNrU3VzcGVuZE9uQWRkRWZmZWN0Q2hhaW5fbCgpIHN1c3BlbmRpbmcgZWZmZWN0cyAlMDh4IiwKLSAgICAgICAgICAgICAgICAgICAgZGVzYy0+bVR5cGUudGltZUxvdyk7Ci0gICAgICAgICAgICAgICAgY2hhaW4tPnNldEVmZmVjdFN1c3BlbmRlZF9sKCZkZXNjLT5tVHlwZSwgdHJ1ZSk7Ci0gICAgICAgICAgICB9Ci0gICAgICAgIH0KLSAgICB9Ci19Ci0KLXZvaWQgQXVkaW9GbGluZ2VyOjpUaHJlYWRCYXNlOjp1cGRhdGVTdXNwZW5kZWRTZXNzaW9uc19sKGNvbnN0IGVmZmVjdF91dWlkX3QgKnR5cGUsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBib29sIHN1c3BlbmQsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpbnQgc2Vzc2lvbklkKQotewotICAgIHNzaXplX3QgaW5kZXggPSBtU3VzcGVuZGVkU2Vzc2lvbnMuaW5kZXhPZktleShzZXNzaW9uSWQpOwotCi0gICAgS2V5ZWRWZWN0b3IgPGludCwgc3A8U3VzcGVuZGVkU2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LCBzZXNzaW9uRWZmZWN0cyk7Ci0gICAgfQotfQotCi12b2lkIEF1ZGlvRmxpbmdlcjo6VGhyZWFkQmFzZTo6Y2hlY2tTdXNwZW5kT25FZmZlY3RFbmFibGVkKGNvbnN0IHNwPEVmZmVjdE1vZHVsZT4mIGVmZmVjdCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJvb2wgZW5hYmxlZCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGludCBzZXNzaW9uSWQpCi17Ci0gICAgTXV0ZXg6OkF1dG9sb2NrIF9sKG1Mb2NrKTsKLSAgICBjaGVja1N1c3BlbmRPbkVmZmVjdEVuYWJsZWRfbChlZmZlY3QsIGVuYWJsZWQsIHNlc3Npb25JZCk7Ci19Ci0KLXZvaWQgQXVkaW9GbGluZ2VyOjpUaHJlYWRCYXNlOjpjaGVja1N1c3BlbmRPbkVmZmVjdEVuYWJsZWRfbChjb25zdCBzcDxFZmZlY3RNb2R1bGU+JiBlZmZlY3QsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBib29sIGVuYWJsZWQsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpbnQgc2Vzc2lvbklkKQotewotICAgIGlmIChtVHlwZSAhPSBSRUNPUkQpIHsKLSAgICAgICAgLy8gc3VzcGVuZCBhbGwgZWZmZWN0cyBpbiBBVURJT19TRVNTSU9OX09VVFBVVF9NSVggd2hlbiBlbmFibGluZyBhbnkgZWZmZWN0IG9uCi0gICAgICAgIC8vIGFub3RoZXIgc2Vzc2lvbi4gVGhpcyBnaXZlcyB0aGUgcHJpb3JpdHkgdG8gd2VsbCBiZWhhdmVkIGVmZmVjdCBjb250cm9sIHBhbmVscwotICAgICAgICAvLyBhbmQgYXBw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QtPnNlc3Npb25JZCgpICYmIHN0cmF0ZWd5ICE9IGFjdHVhbCkgewotICAgICAgICAgICAgICAgICAgICBBTE9HRSgiY3JlYXRlVHJhY2tfbCgpIG1pc21hdGNoZWQgc3RyYXRlZ3k7IGV4cGVjdGVkICV1IGJ1dCBmb3VuZCAldSIsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgc3RyYXRlZ3ksIGFjdHVhbCk7Ci0gICAgICAgICAgICAgICAgICAgIGxTdGF0dXMgPSBCQURfVkFMVUU7Ci0gICAgICAgICAgICAgICAgICAgIGdvdG8gRXhpdDsKLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICB9Ci0gICAgICAgIH0KLQotICAgICAgICBpZiAoIWlzVGltZWQpIHsKLSAgICAgICAgICAgIHRyYWNrID0gbmV3IFRyYWNrKHRoaXMsIGNsaWVudCwgc3RyZWFtVHlwZSwgc2FtcGxlUmF0ZSwgZm9ybWF0LAotICAgICAgICAgICAgICAgICAgICBjaGFubmVsTWFzaywgZnJhbWVDb3VudCwgc2hhcmVkQnVmZmVyLCBzZXNzaW9uSWQpOwotICAgICAgICB9IGVsc2UgewotICAgICAgICAgICAgdHJhY2sgPSBUaW1lZFRyYWNrOjpjcmVhdGUodGhpcywgY2xpZW50LCBzdHJlYW1UeXBlLCBzYW1wbGVSYXRlLCBmb3JtYXQsCi0gICAgICAgICAgICAgICAgICAgIGNoYW5uZWxNYXNrLCBmcmFtZUNvdW50LCBzaGFyZWRCdWZmZXIsIHNlc3Npb25JZCk7Ci0gICAgICAgIH0KLSAgICAgICAgaWYgKHRyYWNrID09IE5VTEwgfHwgdHJhY2stPmdldENibGsoKSA9PSBOVUxMIHx8IHRyYWNrLT5uYW1lKCkgPCAwKSB7Ci0gICAgICAgICAgICBsU3RhdHVzID0gTk9fTUVNT1JZOwotICAgICAgICAgICAgZ290byBFeGl0OwotICAgICAgICB9Ci0gICAgICAgIG1UcmFja3MuYWRkKHRyYWNrKTsKLQotICAgICAgICBz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gpOwotICAgICAgICAgICAgQUxPR0QoIkNQVSB1c2FnZSBmb3IgJXMgb3ZlciBwYXN0ICUuMWYgc2Vjc1xuIgotICAgICAgICAgICAgICAgICIgICgldSBtaXhlciBsb29wcyBhdCAlLjFmIG1lYW4gbXMgcGVyIGxvb3ApOlxuIgotICAgICAgICAgICAgICAgICIgIHVzIHBlciBtaXggbG9vcDogbWVhbj0lLjBmIHN0ZGRldj0lLjBmIG1pbj0lLjBmIG1heD0lLjBmXG4iCi0gICAgICAgICAgICAgICAgIiAgJSUgb2Ygd2FsbDogbWVhbj0lLjFmIHN0ZGRldj0lLjFmIG1pbj0lLjFmIG1heD0lLjFmXG4iCi0gICAgICAgICAgICAgICAgIiAgTUh6OiBtZWFuPSUuMWYsIHN0ZGRldj0lLjFmLCBtaW49JS4xZiBtYXg9JS4xZiIsCi0gICAgICAgICAgICAgICAgICAgIHRpdGxlLnN0cmluZygpLAotICAgICAgICAgICAgICAgICAgICBlbGFwc2VkICogLjAwMDAwMDAwMSwgbiwgcGVyTG9vcCAqIC4wMDAwMDEsCi0gICAgICAgICAgICAgICAgICAgIG1lYW4gKiAuMDAxLAotICAgICAgICAgICAgICAgICAgICBzdGRkZXYgKiAuMDAxLAotICAgICAgICAgICAgICAgICAgICBtaW5pbXVtICogLjAwMSwKLSAgICAgICAgICAgICAgICAgICAgbWF4aW11bSAqIC4wMDEsCi0gICAgICAgICAgICAgICAgICAgIG1lYW4gLyBwZXJMb29wMTAwLAotICAgICAgICAgICAgICAgICAgICBzdGRkZXYgLyBwZXJMb29wMTAwLAotICAgICAgICAgICAgICAgICAgICBtaW5pbXVtIC8gcGVyTG9vcDEwMCwKLSAgICAgICAgICAgICAgICAgICAgbWF4aW11bSAvIHBlckxvb3AxMDAsCi0gICAgICAgICAgICAgICAgICAgIG1lYW5DeWNsZXMgLyBwZXJMb29wMWssCi0gICAgICAgICAgICAgICAgICAgIHN0ZGRldkN5Y2xlcyAvIHBlckxvb3AxaywKLSAgICAgICAgICA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gICAgICAgICAgIHNhdmVPdXRwdXRUcmFja3MoKTsKLQotICAgICAgICAgICAgLy8gcHV0IGF1ZGlvIGhhcmR3YXJlIGludG8gc3RhbmRieSBhZnRlciBzaG9ydCBkZWxheQotICAgICAgICAgICAgaWYgKENDX1VOTElLRUxZKCghbUFjdGl2ZVRyYWNrcy5zaXplKCkgJiYgc3lzdGVtVGltZSgpID4gc3RhbmRieVRpbWUpIHx8Ci0gICAgICAgICAgICAgICAgICAgICAgICBtU3VzcGVuZGVkID4gMCkpIHsKLSAgICAgICAgICAgICAgICBpZiAoIW1TdGFuZGJ5KSB7Ci0KLSAgICAgICAgICAgICAgICAgICAgdGhyZWFkTG9vcF9zdGFuZGJ5KCk7Ci0KLSAgICAgICAgICAgICAgICAgICAgbVN0YW5kYnkgPSB0cnVlOwotICAgICAgICAgICAgICAgICAgICBtQnl0ZXNXcml0dGVuID0gMDsKLSAgICAgICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgICAgICBpZiAoIW1BY3RpdmVUcmFja3Muc2l6ZSgpICYmIG1Db25maWdFdmVudHMuaXNFbXB0eSgpKSB7Ci0gICAgICAgICAgICAgICAgICAgIC8vIHdlJ3JlIGFib3V0IHRvIHdhaXQsIGZsdXNoIHRoZSBiaW5kZXIgY29tbWFuZCBidWZmZXIKLSAgICAgICAgICAgICAgICAgICAgSVBDVGhyZWFkU3RhdGU6OnNlbGYoKS0+Zmx1c2hDb21tYW5kcygpOwotCi0gICAgICAgICAgICAgICAgICAgIGNsZWFyT3V0cHV0VHJhY2tzKCk7Ci0KLSAgICAgICAgICAgICAgICAgICAgaWYgKGV4aXRQZW5kaW5nKCkpIGJyZWFrOwotCi0gICAgICAgICAgICAgICAgICAgIHJlbGVhc2VXYWtlTG9ja19sKCk7Ci0gICAgICAgICAgICAgICAgICAgIC8vIHdhaXQgdW50aWwgd2UgaGF2ZSBzb21ldGhpbmcgdG8gZG8uLi4KLSAgICAgICAgICAgICAgICAgICAgQUxPR1YoIiVzIGdvaW5nIHRvIHNsZWVwIiwgbXlOYW1lLnN0cmluZygpKTsKLSAgICAgICAgICAgICAgICAgICAgbVdhaXRXb3JrQ1Yud2FpdChtTG9jayk7Ci0gICAgICAgICAgICAgICAgICAgIEFMT0dWKCIlcyB3YWtpbmcgdXAiLCBteU5hbWUuc3RyaW5nKCkpOwotICAgICAgICAgICAgICAgICAgICBhY3F1aXJlV2FrZUxvY2tfbCgpOwotCi0gICAgICAgICAgICAgICAgICAgIG1QcmV2TWl4ZXJTdGF0dXMgPSBNSVhFUl9JRExFOwotCi0gICAgICAgICAgICAgICAgICAgIGNoZWNrU2lsZW50TW9kZV9sKCk7Ci0KLSAgICAgICAgICAgICAgICAgICAgc3RhbmRieVRpbWUgPSBzeXN0ZW1UaW1lKCkgKyBzdGFuZGJ5RGVsYXk7Ci0gICAgICAgICAgICAgICAgICAgIHNsZWVwVGltZSA9IGlkbGVTbGVlcFRpbWU7Ci0gICAgICAgICAgICAgICAgICAgIGlmIChtVHlwZSA9PSBNSVhFUikgewotICAgICAgICAgICAgICAgICAgICAgICAgc2xlZXBUaW1lU2hpZnQgPSAwOwotICAgICAgICAgICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgICAgICAgICAgY29udGludWU7Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgfQotCi0gICAgICAgICAgICBtaXhlcl9zdGF0ZSBuZXdNaXhlclN0YXR1cyA9IHByZXBhcmVUcmFja3NfbCgmdHJhY2tzVG9SZW1vdmUpOwotICAgICAgICAgICAgLy8gU2hpZnQgaW4gdGhlIG5ldyBzdGF0dXM7IHRoaXMgY291bGQgYmUgYSBxdWV1ZSBpZiBpdCdzCi0gICAgICAgICAgICAvLyB1c2VmdWwgdG8gZmlsdGVyIHRoZSBtaXhlciBzdGF0dXMgb3ZlciBzZXZlcmFsIGN5Y2xlcy4KLSAgICAgICAgICAgIG1QcmV2TWl4ZXJTdGF0dXMgPSBtTWl4ZXJTdGF0dXM7Ci0gICAgICAgICAgICBt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JhY2stPmZyYW1lc1JlYWR5KCkgPj0gbWluRnJhbWVzKSAmJiB0cmFjay0+aXNSZWFkeSgpICYmCi0gICAgICAgICAgICAgICAgIXRyYWNrLT5pc1BhdXNlZCgpICYmICF0cmFjay0+aXNUZXJtaW5hdGVkKCkpCi0gICAgICAgIHsKLSAgICAgICAgICAgIC8vQUxPR1YoInRyYWNrICVkIHU9JTA4eCwgcz0lMDh4IFtPS10gb24gdGhyZWFkICVwIiwgbmFtZSwgY2Jsay0+dXNlciwgY2Jsay0+c2VydmVyLCB0aGlzKTsKLQotICAgICAgICAgICAgbWl4ZWRUcmFja3MrKzsKLQotICAgICAgICAgICAgLy8gdHJhY2stPm1haW5CdWZmZXIoKSAhPSBtTWl4QnVmZmVyIG1lYW5zIHRoZXJlIGlzIGFuIGVmZmVjdCBjaGFpbgotICAgICAgICAgICAgLy8gY29ubmVjdGVkIHRvIHRoZSB0cmFjawotICAgICAgICAgICAgY2hhaW4uY2xlYXIoKTsKLSAgICAgICAgICAgIGlmICh0cmFjay0+bWFpbkJ1ZmZlcigpICE9IG1NaXhCdWZmZXIpIHsKLSAgICAgICAgICAgICAgICBjaGFpbiA9IGdldEVmZmVjdENoYWluX2wodHJhY2stPnNlc3Npb25JZCgpKTsKLSAgICAgICAgICAgICAgICAvLyBEZWxlZ2F0ZSB2b2x1bWUgY29udHJvbCB0byBlZmZlY3QgaW4gdHJhY2sgZWZmZWN0IGNoYWluIGlmIG5lZWRlZAotICAgICAgICAgICAgICAgIGlmIChjaGFpbiAhPSAwKSB7Ci0gICAgICAgICAgICAgICAgICAgIHRyYWNrc1dpdGhFZmZlY3QrKzsKLSAgICAgICAgICAgICAgICB9IGVsc2UgewotICAgICAgICAgICAgICAgICAgICBBTE9HVygicHJlcGFyZVRyYWNrc19sKCk6IHRyYWNrICVkIGF0dGFjaGVkIHRvIGVmZmVjdCBidXQgbm8gY2hhaW4gZm91bmQgb24gc2Vzc2lvbiAlZCIsCi0gICAgICAgICAgICAgICAgICA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W1lIGZvciB0aGlzIHRyYWNrCi0gICAgICAgICAgICB1aW50MzJfdCB2bCwgdnIsIHZhOwotICAgICAgICAgICAgaWYgKHRyYWNrLT5pc011dGVkKCkgfHwgdHJhY2stPmlzUGF1c2luZygpIHx8Ci0gICAgICAgICAgICAgICAgbVN0cmVhbVR5cGVzW3RyYWNrLT5zdHJlYW1UeXBlKCldLm11dGUpIHsKLSAgICAgICAgICAgICAgICB2bCA9IHZyID0gdmEgPSAwOwotICAgICAgICAgICAgICAgIGlmICh0cmFjay0+aXNQYXVzaW5nKCkpIHsKLSAgICAgICAgICAgICAgICAgICAgdHJhY2stPnNldFBhdXNlZCgpOwotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgIH0gZWxzZSB7Ci0KLSAgICAgICAgICAgICAgICAvLyByZWFkIG9yaWdpbmFsIHZvbHVtZXMgd2l0aCB2b2x1bWUgY29udHJvbAotICAgICAgICAgICAgICAgIGZsb2F0IHR5cGVWb2x1bWUgPSBtU3RyZWFtVHlwZXNbdHJhY2stPnN0cmVhbVR5cGUoKV0udm9sdW1lOwotICAgICAgICAgICAgICAgIGZsb2F0IHYgPSBtYXN0ZXJWb2x1bWUgKiB0eXBlVm9sdW1lOwotICAgICAgICAgICAgICAgIHVpbnQzMl90IHZsciA9IGNibGstPmdldFZvbHVtZUxSKCk7Ci0gICAgICAgICAgICAgICAgdmwgPSB2bHIgJiAweEZGRkY7Ci0gICAgICAgICAgICAgICAgdnIgPSB2bHIgPj4gMTY7Ci0gICAgICAgICAgICAgICAgLy8gdHJhY2sgdm9sdW1lcyBjb21lIGZyb20gc2hhcmVkIG1lbW9yeSwgc28gY2FuJ3QgYmUgdHJ1c3RlZCBhbmQgbXVzdCBiZSBjbGFtcGVkCi0gICAgICAgICAgICAgICAgaWYgKHZsID4gTUFYX0dBSU5fSU5UKSB7Ci0gICAgICAgICAgICAgICAgICAgIEFMT0dWKCJUcmFjayBsZWZ0IHZvbHVtZSBvdXQgb2YgcmFuZ2U6ICUwNFgiLCB2bCk7Ci0gICAgICAgICAgICAgICAgICAgIHZsID0gTUFYX0dBSU5fSU5UOwotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICBpZiAodnIgPiBNQVhfR0FJTl9JTlQpIHsKLSAgICAgICAgICAgICAgICAgICAgQUxPR1YoIlRyYWNrIHJpZ2h0IHZvbHVtZSBvdXQgb2YgcmFuZ2U6ICUwNFgiLCB2cik7Ci0gICAgICAgICAgICAgICAgICAgIHZyID0gTUFYX0dBSU5fSU5UOwotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICAvLyBub3cgYXBwbHkgdGhlIG1hc3RlciB2b2x1bWUgYW5kIHN0cmVhbSB0eXBlIHZvbHVtZQotICAgICAgICAgICAgICAgIHZsID0gKHVpbnQzMl90KSh2ICogdmwpIDw8IDEyOwotICAgICAgICAgICAgICAgIHZyID0gKHVpbnQzMl90KSh2ICogdnIpIDw8IDEyOwotICAgICAgICAgICAgICAgIC8vIGFzc3VtaW5nIG1hc3RlciB2b2x1bWUgYW5kIHN0cmVhbSB0eXBlIHZvbHVtZSBlYWNoIGdvIHVwIHRvIDEuMCwKLSAgICAgICAgICAgICAgICAvLyB2bCBhbmQgdnIgYXJlIG5vdyBpbiA4LjI0IGZvcm1hdAotCi0gICAgICAgICAgICAgICAgdWludDE2X3Qgc2VuZExldmVsID0gY2Jsay0+Z2V0U2VuZExldmVsX1U0XzEyKCk7Ci0gICAgICAgICAgICAgICAgLy8gc2VuZCBsZXZlbCBjb21lcyBmcm9tIHNoYXJlZCBtZW1vcnkgYW5kIHNvIG1heSBiZSBjb3JydXB0Ci0gICAgICAgICAgICAgICAgaWYgKHNlbmRMZXZlbCA+IE1BWF9HQUlOX0lOVCkgewotICAgICAgICAgICAgICAgICAgICBBTE9HVigiVHJhY2sgc2VuZCBsZXZlbCBvdXQgb2YgcmFuZ2U6ICUwNFgiLCBzZW5kTGV2ZWwpOwotICAgICAgICAgICAgICAgICAgICBzZW5kTGV2ZWwgPSBNQVhfR0FJTl9JTlQ7Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgIHZhID0gKHVpbnQzMl90KSh2ICogc2VuZExldmVsKTsKLSAgICAgICAgICAgIH0KLSAgICAgICAgICAgIC8vIERlbGVnYXRlIHZvbHVtZSBjb250cm9sIHRvIGVmZmVjdCBpbiB0cmFjayBlZmZlY3QgY2hhaW4gaWYgbmVlZGVkCi0gICAgICAgICAgICBpZiAoY2hhaW4gIT0gMCAmJiBjaGFpbi0+c2V0Vm9sdW1lX2woJnZsLCAmdnIpKSB7Ci0gICAgICAgICAgICAgICAgLy8gRG8gbm90IHJhbXAgdm9sdW1lIGlmIHZvbHVtZSBpcyBjb250cm9sbGVkIGJ5IGVmZmVjdAotICAgICAgICAgICAgICAgIHBhcmFtID0gQXVkaW9NaXhlcjo6Vk9MVU1FOwotICAgICAgICAgICAgICAgIHRyYWNrLT5tSGFzVm9sdW1lQ29udHJvbGxlciA9IHRydWU7Ci0gICAgICAgICAgICB9IGVsc2UgewotICAgICAgICAgICAgICAgIC8vIGZvcmNlIG5vIHZvbHVtZSByYW1wIHdoZW4gdm9sdW1lIGNvbnRyb2xsZXIgd2FzIGp1c3QgZGlzYWJsZWQgb3IgcmVtb3ZlZAotICAgICAgICAgICAgICAgIC8vIGZyb20gZWZmZWN0IGNoYWluIHRvIGF2b2lkIHZvbHVtZSBzcGlrZQotICAgICAgICAgICAgICAgIGlmICh0cmFjay0+bUhhc1ZvbHVtZUNvbnRyb2xsZXIpIHsKLSAgICAgICAgICAgICAgICAgICAgcGFyYW0gPSBBdWRpb01peGVyOjpWT0xVTUU7Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgIHRyYWNrLT5tSGFzVm9sdW1lQ29udHJvbGxlciA9IGZhbHNlOwotICAgICAgICAgICAgfQotCi0gICAgICAgICAgICAvLyBDb252ZXJ0IHZvbHVtZXMgZnJvbSA4LjI0IHRvIDQuMTIgZm9ybWF0Ci0gIC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GlvTWl4ZXItPnNldFBhcmFtZXRlcigKLSAgICAgICAgICAgICAgICBuYW1lLAotICAgICAgICAgICAgICAgIEF1ZGlvTWl4ZXI6OlRSQUNLLAotICAgICAgICAgICAgICAgIEF1ZGlvTWl4ZXI6OkZPUk1BVCwgKHZvaWQgKil0cmFjay0+Zm9ybWF0KCkpOwotICAgICAgICAgICAgbUF1ZGlvTWl4ZXItPnNldFBhcmFtZXRlcigKLSAgICAgICAgICAgICAgICBuYW1lLAotICAgICAgICAgICAgICAgIEF1ZGlvTWl4ZXI6OlRSQUNLLAotICAgICAgICAgICAgICAgIEF1ZGlvTWl4ZXI6OkNIQU5ORUxfTUFTSywgKHZvaWQgKil0cmFjay0+Y2hhbm5lbE1hc2soKSk7Ci0gICAgICAgICAgICBtQXVkaW9NaXhlci0+c2V0UGFyYW1ldGVyKAotICAgICAgICAgICAgICAgIG5hbWUsCi0gICAgICAgICAgICAgICAgQXVkaW9NaXhlcjo6UkVTQU1QTEUsCi0gICAgICAgICAgICAgICAgQXVkaW9NaXhlcjo6U0FNUExFX1JBVEUsCi0gICAgICAgICAgICAgICAgKHZvaWQgKikoY2Jsay0+c2FtcGxlUmF0ZSkpOwotICAgICAgICAgICAgbUF1ZGlvTWl4ZXItPnNldFBhcmFtZXRlcigKLSAgICAgICAgICAgICAgICBuYW1lLAotICAgICAgICAgICAgICAgIEF1ZGlvTWl4ZXI6OlRSQUNLLAotICAgICAgICAgICAgICAgIEF1ZGlvTWl4ZXI6Ok1BSU5fQlVGRkVSLCAodm9pZCAqKXRyYWNrLT5tYWluQnVmZmVyKCkpOwotICAgICAgICAgICAgbUF1ZGlvTWl4ZXItPnNldFBhcmFtZXRlcigKLSAgICAgICAgICAgICAgICBuYW1lLAotICAgICAgICAgICAgICAgIEF1ZGlvTWl4ZXI6OlRSQUNLLAotICAgICAgICAgICAgICAgIEF1ZGlvTWl4ZXI6OkFVWF9CVUZGRVIsICh2b2lkICopdHJhY2stPmF1eEJ1ZmZlcigpKTsKLQotICAgICAgICAgICAgLy8gcmVzZXQgcmV0cnkgY291bnQKLSAgICAgICAgICAgIHRyYWNrLT5tUmV0cnlDb3VudCA9IGtNYXhUcmFja1JldHJpZXM7Ci0KLSAgICAgICAgICAgIC8vIElmIG9uZSB0cmFjayBpcyByZWFkeSwgc2V0IHRoZSBtaXhlciByZWFkeSBpZjoKLSAgICAgICAgICAgIC8vICAtIHRoZSBtaXhlciB3YXMgbm90IHJlYWR5IGR1cmluZyBwcmV2aW91cyByb3VuZCBPUgotICAgICAgICAgICAgLy8gIC0gbm8gb3RoZXIgdHJhY2sgaXMgbm90IHJlYWR5Ci0gICAgICAgICAgICBpZiAobVByZXZNaXhlclN0YXR1cyAhPSBNSVhFUl9UUkFDS1NfUkVBRFkgfHwKLSAgICAgICAgICAgICAgICAgICAgbWl4ZXJTdGF0dXMgIT0gTUlYRVJfVFJBQ0tTX0VOQUJMRUQpIHsKLSAgICAgICAgICAgICAgICBtaXhlclN0YXR1cyA9IE1JWEVSX1RSQUNLU19SRUFEWTsKLSAgICAgICAgICAgIH0KLSAgICAgICAgfSBlbHNlIHsKLSAgICAgICAgICAgIC8vQUxPR1YoInRyYWNrICVkIHU9JTA4eCwgcz0lMDh4IFtOT1QgUkVBRFldIG9uIHRocmVhZCAlcCIsIG5hbWUsIGNibGstPnVzZXIsIGNibGstPnNlcnZlciwgdGhpcyk7Ci0gICAgICAgICAgICBpZiAodHJhY2stPmlzU3RvcHBlZCgpKSB7Ci0gICAgICAgICAgICAgICAgdHJhY2stPnJlc2V0KCk7Ci0gICAgICAgICAgICB9Ci0gICAgICAgICAgICBpZiAodHJhY2stPmlzVGVybWluYXRlZCgpIHx8IHRyYWNrLT5pc1N0b3BwZWQoKSB8fCB0cmFjay0+aXNQYXVzZWQoKSkgewotICAgICAgICAgICAgICAgIC8vIFdlIGhhdmUgY29uc3VtZWQgYWxsIHRoZSBidWZmZXJzIG9mIHRoaXMgdHJhY2suCi0gICAgICAgICAgICAgICAgLy8gUmVt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BlbHNlIGlmIChtUHJldk1peGVyU3RhdHVzID09IE1JWEVSX1RSQUNLU19SRUFEWSB8fAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBtaXhlclN0YXR1cyAhPSBNSVhFUl9UUkFDS1NfUkVBRFkpIHsKLSAgICAgICAgICAgICAgICAgICAgbWl4ZXJTdGF0dXMgPSBNSVhFUl9UUkFDS1NfRU5BQkxFRDsKLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICB9Ci0gICAgICAgICAgICBtQXVkaW9NaXhlci0+ZGlzYWJsZShuYW1lKTsKLSAgICAgICAgfQotICAgIH0KLQotICAgIC8vIHJlbW92ZSBhbGwgdGhlIHRyYWNrcyB0aGF0IG5lZWQgdG8gYmUuLi4KLSAgICBjb3VudCA9IHRyYWNrc1RvUmVtb3ZlLT5zaXplKCk7Ci0gICAgaWYgKENDX1VOTElLRUxZKGNvdW50KSkgewotICAgICAgICBmb3IgKHNpemVfdCBpPTAgOyBpPGNvdW50IDsgaSsrKSB7Ci0gICAgICAgICAgICBjb25zdCBzcDxUcmFjaz4mIHRyYWNrID0gdHJhY2tzVG9SZW1vdmUtPml0ZW1BdChpKTsKLSAgICAgICAgICAgIG1BY3RpdmVUcmFja3MucmVtb3ZlKHRyYWNrKTsKLSAgICAgICAgICAgIGlmICh0cmFjay0+bWFpbkJ1ZmZlcigpICE9IG1NaXhCdWZmZXIpIHsKLSAgICAgICAgICAgICAgICBjaGFpbiA9IGdldEVmZmVjdENoYWluX2wodHJhY2stPnNlc3Npb25JZCgpKTsKLSAgICAgICAgICAgICAgICBpZiAoY2hhaW4gIT0gMCkgewotICAgICAgICAgICAgICAgICAgICBBTE9HVigic3RvcHBpbmcgdHJhY2sgb24gY2hhaW4gJXAgZm9yIHNlc3Npb24gSWQ6ICVkIiwgY2hhaW4uZ2V0KCksIHRyYWNrLT5zZXNzaW9uSWQoKSk7Ci0gICAgICAgICAgICAgICAgICAgIGNoYWluLT5kZWNBY3RpdmVUcmFja0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LSNpZmRlZiBBRERfQkFUVEVSWV9EQVRBCi0gICAgICAgICAgICAvLyB3aGVuIGNoYW5naW5nIHRoZSBhdWRpbyBvdXRwdXQgZGV2aWNlLCBjYWxsIGFkZEJhdHRlcnlEYXRhIHRvIG5vdGlmeQotICAgICAgICAgICAgLy8gdGhlIGNoYW5nZQotICAgICAgICAgICAgaWYgKChpbnQpbURldmljZSAhPSB2YWx1ZSkgewotICAgICAgICAgICAgICAgIHVpbnQzMl90IHBhcmFtcyA9IDA7Ci0gICAgICAgICAgICAgICAgLy8gY2hlY2sgd2hldGhlciBzcGVha2VyIGlzIG9uCi0gICAgICAgICAgICAgICAgaWYgKHZhbHVlICYgQVVESU9fREVWSUNFX09VVF9TUEVBS0VSKSB7Ci0gICAgICAgICAgICAgICAgICAgIHBhcmFtcyB8PSBJTWVkaWFQbGF5ZXJTZXJ2aWNlOjprQmF0dGVyeURhdGFTcGVha2VyT247Ci0gICAgICAgICAgICAgICAgfQotCi0gICAgICAgICAgICAgICAgaW50IGRldmljZVdpdGhvdXRTcGVha2VyCi0gICAgICAgICAgICAgICAgICAgID0gQVVESU9fREVWSUNFX09VVF9BTEwgJiB+QVVESU9fREVWSUNFX09VVF9TUEVBS0VSOwotICAgICAgICAgICAgICAgIC8vIGNoZWNrIGlmIGFueSBvdGhlciBkZXZpY2UgKGV4Y2VwdCBzcGVha2VyKSBpcyBvbgotICAgICAgICAgICAgICAgIGlmICh2YWx1ZSAmIGRldmljZVdpdGhvdXRTcGVha2VyICkgewotICAgICAgICAgICAgICAgICAgICBwYXJhbXMgfD0gSU1lZGlhUGxheWVyU2VydmljZTo6a0JhdHRlcnlEYXRhT3RoZXJBdWRpb0RldmljZU9uOwotICAgICAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgICAgIGlmIChwYXJhbXMgIT0gMCkgewotICAgICAgICAgICAgICAgICAgICBhZGRCYXR0ZXJ5RGF0YShwYXJhbXMpOwotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgIH0KLSNlbmRpZgotCi0gICAgICAgICAgICAvLyBmb3J3YXJkIGRldmljZSBjaGFuZ2UgdG8gZWZmZWN0cyB0aGF0IGhhdmUgcmVxdWVzdGVkIHRvIGJlCi0gICAgICAgICAgICAvLyBhd2FyZSBvZiBhdHRhY2hlZCBhdWRpbyBkZXZpY2UuCi0gICAgICAgICAgICBtRGV2aWNlID0gKHVpbnQzMl90KXZhbHVlOwotICAgICAgICAgICAgZm9yIChzaXplX3QgaSA9IDA7IGkgPCBtRWZmZWN0Q2hhaW5zLnNpemUoKTsgaSsrKSB7Ci0gICAgICAgICAgICAgICAgbUVmZmVjdENoYWluc1tpXS0+c2V0RGV2aWNlX2wobURldmljZSk7Ci0gICAgICAgICAgICB9Ci0gICAgICAgIH0KLQotICAgICAgICBpZiAoc3RhdHVzID09IE5PX0VSUk9SKSB7Ci0gICAgICAgICAgICBzdGF0dXMgPSBtT3V0cHV0LT5zdHJlYW0tPmNvbW1vbi5zZXRfcGFyYW1ldGVycygmbU91dHB1dC0+c3RyZWFtLT5jb21tb24sCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAga2V5VmFsdWVQYWlyLnN0cmluZygpKTsKLSAgICAgICAgICAgIGlmICghbVN0YW5kYnkgJiYgc3RhdHVzID09IElOVkFMSURfT1BFUkFUSU9OKSB7Ci0gICAgICAgICAgICAgICAgbU91dHB1dC0+c3RyZWFtLT5jb21tb24uc3RhbmRieSgmbU91dHB1dC0+c3RyZWFtLT5jb21tb24pOwotICAgICAgICAgICAgICAgIG1TdGFuZGJ5ID0gdHJ1ZTsKLSAgICAgICAgICAgICAgICBtQnl0ZXNXcml0dGVuID0gMDsKLSAgICAgICAgICAgICAgICBzdGF0dXMgPSBtT3V0cHV0LT5zdHJlYW0tPmNvbW1vbi5zZXRfcGFyYW1ldGVycygmbU91dHB1dC0+c3RyZWFtLT5jb21tb24sCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC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ICAgICBpZiAodHJhY2stPm1TdGF0ZSA9PSBUcmFja0Jhc2U6OlJFU1VNSU5HKSB7Ci0gICAgICAgICAgICAgICAgICAgIHRyYWNrLT5tU3RhdGUgPSBUcmFja0Jhc2U6OkFDVElWRTsKLSAgICAgICAgICAgICAgICAgICAgcmFtcFZvbHVtZSA9IHRydWU7Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgfSBlbHNlIGlmIChjYmxrLT5zZXJ2ZXIgIT0gMCkgewotICAgICAgICAgICAgICAgIC8vIElmIHRoZSB0cmFjayBpcyBzdG9wcGVkIGJlZm9yZSB0aGUgZmlyc3QgZnJhbWUgd2FzIG1peGVkLAotICAgICAgICAgICAgICAgIC8vIGRvIG5vdCBhcHBseSByYW1wCi0gICAgICAgICAgICAgICAgcmFtcFZvbHVtZSA9IHRydWU7Ci0gICAgICAgICAgICB9Ci0gICAgICAgICAgICAvLyBjb21wdXRlIHZvbHVtZSBmb3IgdGhpcyB0cmFjawotICAgICAgICAgICAgZmxvYXQgbGVmdCwgcmlnaHQ7Ci0gICAgICAgICAgICBpZiAodHJhY2stPmlzTXV0ZWQoKSB8fCBtTWFzdGVyTXV0ZSB8fCB0cmFjay0+aXNQYXVzaW5nKCkgfHwKLSAgICAgICAgICAgICAgICBtU3RyZWFtVHlwZXNbdHJhY2stPnN0cmVhbVR5cGUoKV0ubXV0ZSkgewotICAgICAgICAgICAgICAgIGxlZnQgPSByaWdodCA9IDA7Ci0gICAgICAgICAgICAgICAgaWYgKHRyYWNrLT5pc1BhdXNpbmcoKSkgewotICAgICAgICAgICAgICAgICAgICB0cmFjay0+c2V0UGF1c2VkKCk7Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgfSBlbHNlIHsKLSAgICAgICAgICAgICAgICBmbG9hdCB0eXBlVm9sdW1lID0gbVN0cmVhbVR5cGVzW3RyYWNrLT5zdHJlYW1UeXBlKCldLnZvbHVtZTsKLSAgICAgICAgICAgICAgICBmbG9hdCB2ID0gb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PSAxLjBmOwotICAgICAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgICAgIC8vIENvbnZlcnQgdm9sdW1lcyBmcm9tIGZsb2F0IHRvIDguMjQKLSAgICAgICAgICAgICAgICB1aW50MzJfdCB2bCA9ICh1aW50MzJfdCkobGVmdCAqICgxIDw8IDI0KSk7Ci0gICAgICAgICAgICAgICAgdWludDMyX3QgdnIgPSAodWludDMyX3QpKHJpZ2h0ICogKDEgPDwgMjQpKTsKLQotICAgICAgICAgICAgICAgIC8vIERlbGVnYXRlIHZvbHVtZSBjb250cm9sIHRvIGVmZmVjdCBpbiB0cmFjayBlZmZlY3QgY2hhaW4gaWYgbmVlZGVkCi0gICAgICAgICAgICAgICAgLy8gb25seSBvbmUgZWZmZWN0IGNoYWluIGNhbiBiZSBwcmVzZW50IG9uIERpcmVjdE91dHB1dFRocmVhZCwgc28gaWYKLSAgICAgICAgICAgICAgICAvLyB0aGVyZSBpcyBvbmUsIHRoZSB0cmFjayBpcyBjb25uZWN0ZWQgdG8gaXQKLSAgICAgICAgICAgICAgICBpZiAoIW1FZmZlY3RDaGFpbnMuaXNFbXB0eSgpKSB7Ci0gICAgICAgICAgICAgICAgICAgIC8vIERvIG5vdCByYW1wIHZvbHVtZSBpZiB2b2x1bWUgaXMgY29udHJvbGxlZCBieSBlZmZlY3QKLSAgICAgICAgICAgICAgICAgICAgaWYgKG1FZmZlY3RDaGFpbnNbMF0tPnNldFZvbHVtZV9sKCZ2bCwgJnZyKSkgewotICAgICAgICAgICAgICAgICAgICAgICAgcmFtcFZvbHVtZSA9IGZhbHNlOwotICAgICAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgfQotCi0gICAgICAgICAgICAgICAgLy8gQ29udmVydCB2b2x1bWVzIGZyb20gOC4yNCB0byA0LjEyIGZvcm1hdAotICAgICAgICAgICAgICAgIHVpbnQzMl90IHZfY2xhbXBlZCA9ICh2bCArICgxIDw8IDExKSkgPj4gMTI7Ci0gICAgICAgICAgICAgICAgaWYgKHZfY2xhbXBlZCA+IE1BWF9HQUlOX0lOVCkgdl9jbGFtcGVkID0gTUFYX0dBSU5fSU5UOwotICAgICAgICAgICAgICAgIGxlZnRWb2wgPSAodWludDE2X3Qpdl9jbGFtcGVkOwotICAgICAgICAgICAgICAgIHZfY2xhbXBlZCA9ICh2ciArICgxIDw8IDExKSkgPj4gMTI7Ci0gICAgICAgICAgICAgICAgaWYgKHZfY2xhbXBlZCA+IE1BWF9HQUlOX0lOVCkgdl9jbGFtcGVkID0gTUFYX0dBSU5fSU5UOwotICAgICAgICAgICAgICAgIHJpZ2h0Vm9sID0gKHVpbnQxNl90KXZfY2xhbXBlZDsKLSAgICAgICAgICAgIH0gZWxzZSB7Ci0gICAgICAgICAgICAgICAgbGVmdFZvbCA9IG1MZWZ0Vm9sU2hvcnQ7Ci0gICAgICAgICAgICAgICAgcmlnaHRWb2wgPSBtUmlnaHRWb2xTaG9ydDsKLSAgICAgICAgICAgICAgICByYW1wVm9sdW1lID0gZmFsc2U7Ci0gICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgIC8vIHJlc2V0IHJldHJ5IGNvdW50Ci0gICAgICAgICAgICB0cmFjay0+bVJldHJ5Q291bnQgPSBrTWF4VHJhY2tSZXRyaWVzRGlyZWN0OwotICAgICAgICAgICAgbUFjdGl2ZVRyYWNrID0gdDsKLSAgICAgICAgICAgIG1peGVyU3RhdHVzID0gTUlYRVJfVFJBQ0tTX1JFQURZOwotICAgICAgICB9IGVsc2UgewotICAgICAgICAgICAgLy9BTE9HVigidHJhY2sgJWQgdT0lMDh4LCBzPSUwOHggW05PVCBSRUFEWV0iLCB0cmFjay0+bmFtZSgpLCBjYmxrLT51c2VyLCBjYmxrLT5zZXJ2ZXIpOwotICAgICAgICAgICAgaWYgKHRyYWNrLT5pc1N0b3BwZWQoKSkgewotICAgICAgICAgICAgICAgIHRyYWNrLT5yZXNldCgpOwotICAgICAgICAgICAgfQotICAgICAgICAgICAgaWYgKHRyYWNrLT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dCAqKW1NaXhCdWZmZXIgKyBjb3VudC0xOwotICAgICAgICBpbnQxNl90ICpkc3QgPSBtTWl4QnVmZmVyICsgY291bnQtMTsKLSAgICAgICAgd2hpbGUgKGNvdW50LS0pIHsKLSAgICAgICAgICAgICpkc3QtLSA9IChpbnQxNl90KSgqc3JjLS1eMHg4MCkgPDwgODsKLSAgICAgICAgfQotICAgIH0KLQotICAgIGZyYW1lQ291bnQgPSBtRnJhbWVDb3VudDsKLSAgICBpbnQxNl90ICpvdXQgPSBtTWl4QnVmZmVyOwotICAgIGlmIChyYW1wVm9sdW1lKSB7Ci0gICAgICAgIGlmIChtQ2hhbm5lbENvdW50ID09IDEpIHsKLSAgICAgICAgICAgIGludDMyX3QgZCA9ICgoaW50MzJfdClsZWZ0Vm9sIC0gKGludDMyX3QpbUxlZnRWb2xTaG9ydCkgPDwgMTY7Ci0gICAgICAgICAgICBpbnQzMl90IHZsSW5jID0gZCAvIChpbnQzMl90KWZyYW1lQ291bnQ7Ci0gICAgICAgICAgICBpbnQzMl90IHZsID0gKChpbnQzMl90KW1MZWZ0Vm9sU2hvcnQgPDwgMTYpOwotICAgICAgICAgICAgZG8gewotICAgICAgICAgICAgICAgIG91dFswXSA9IGNsYW1wMTYobXVsKG91dFswXSwgdmwgPj4gMTYpID4+IDEyKTsKLSAgICAgICAgICAgICAgICBvdXQrKzsKLSAgICAgICAgICAgICAgICB2bCArPSB2bEluYzsKLSAgICAgICAgICAgIH0gd2hpbGUgKC0tZnJhbWVDb3VudCk7Ci0KLSAgICAgICAgfSBlbHNlIHsKLSAgICAgICAgICAgIGludDMyX3QgZCA9ICgoaW50MzJfdClsZWZ0Vm9sIC0gKGludDMyX3QpbUxlZnRWb2xTaG9ydCkgPDwgMTY7Ci0gICAgICAgICAgICBpbnQzMl90IHZsSW5jID0gZCAvIChpbnQzMl90KWZyYW1lQ291bnQ7Ci0gICAgICAgICAgICBkID0gKChpbnQzMl90KXJpZ2h0Vm9sIC0gKGludDMyX3QpbVJpZ2h0Vm9sU2hvcnQpIDw8IDE2OwotICAgICAgICAgICAgaW50MzJfdCB2ckluYyA9IGQgLyAoaW50MzJfdClmcmFtZUNvdW50OwotICAgICAgICAgICAgaW50MzJfdCB2bCA9ICgoaW50MzJfdCltTGVmdFZvbFNob3J0IDw8IDE2KTsKLSAgICAgICAgICAgIGludDMyX3QgdnIgPSAoKGludDMyX3QpbVJpZ2h0Vm9sU2hvcnQgPDwgMTYpOwotICAgICAgICAgICAgZG8gewotICAgICAgICAgICAgICAgIG91dFswXSA9IGNsYW1wMTYobXVsKG91dFswXSwgdmwgPj4gMTYpID4+IDEyKTsKLSAgICAgICAgICAgICAgICBvdXRbMV0gPSBjbGFtcDE2KG11bChvdXRbMV0sIHZyID4+IDE2KSA+PiAxMik7Ci0gICAgICAgICAgICAgICAgb3V0ICs9IDI7Ci0gICAgICAgICAgICAgICAgdmwgKz0gdmxJbmM7Ci0gICAgICAgICAgICAgICAgdnIgKz0gdnJJbmM7Ci0gICAgICAgICAgICB9IHdoaWxlICgtLWZyYW1lQ291bnQpOwotICAgICAgICB9Ci0gICAgfSBlbHNlIHsKLSAgICAgICAgaWYgKG1DaGFubmVsQ291bnQgPT0gMSkgewotICAgICAgICAgICAgZG8gewotICAgICAgICAgICAgICAgIG91dFswXSA9IGNsYW1wMTYobXVsKG91dFswXSwgbGVmdFZvbCkgPj4gMTIpOwotICAgICAgICAgICAgICAgIG91dCsrOwotICAgICAgICAgICAgfSB3aGlsZSAoLS1mcmFtZUNvdW50KTsKLSAgICAgICAgfSBlbHNlIHsKLSAgICAgICAgICAgIGRvIHsKLSAgICAgICAgICAgICAgICBvdXRbMF0gPSBjbGFtcDE2KG11bChvdXRbMF0sIGxlZnRWb2wpID4+IDEyKTsKLSAgICAgICAgICAgICAgICBvdXRbMV0gPSBjbGFtcDE2KG11bChvdXRbMV0sIHJpZ2h0Vm9sKSA+PiAxMik7Ci0gICAgICAgICAgICAgICAgb3V0ICs9IDI7Ci0gICAgICAgICAg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OT19FUlJPUikgewotICAgICAgICAgICAgLy8gZG8gbm90IGFjY2VwdCBmcmFtZSBjb3VudCBjaGFuZ2VzIGlmIHRyYWNrcyBhcmUgb3BlbiBhcyB0aGUgdHJhY2sgYnVmZmVyCi0gICAgICAgICAgICAvLyBzaXplIGRlcGVuZHMgb24gZnJhbWUgY291bnQgYW5kIGNvcnJlY3QgYmVoYXZpb3Igd291bGQgbm90IGJlIGdhcmFudGllZAotICAgICAgICAgICAgLy8gaWYgZnJhbWUgY291bnQgaXMgY2hhbmdlZCBhZnRlciB0cmFjayBjcmVhdGlvbgotICAgICAgICAgICAgaWYgKCFtVHJhY2tzLmlzRW1wdHkoKSkgewotICAgICAgICAgICAgICAgIHN0YXR1cyA9IElOVkFMSURfT1BFUkFUSU9OOwotICAgICAgICAgICAgfSBlbHNlIHsKLSAgICAgICAgICAgICAgICByZWNvbmZpZyA9IHRydWU7Ci0gICAgICAgICAgICB9Ci0gICAgICAgIH0KLSAgICAgICAgaWYgKHN0YXR1cyA9PSBOT19FUlJPUikgewotICAgICAgICAgICAgc3RhdHVzID0gbU91dHB1dC0+c3RyZWFtLT5jb21tb24uc2V0X3BhcmFtZXRlcnMoJm1PdXRwdXQtPnN0cmVhbS0+Y29tbW9uLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGtleVZhbHVlUGFpci5zdHJpbmcoKSk7Ci0gICAgICAgICAgICBpZiAoIW1TdGFuZGJ5ICYmIHN0YXR1cyA9PSBJTlZBTElEX09QRVJBVElPTikgewotICAgICAgICAgICAgICAgIG1PdXRwdXQtPnN0cmVhbS0+Y29tbW9uLnN0YW5kYnkoJm1PdXRwdXQtPnN0cmVhbS0+Y29tbW9uKTsKLSAgICAgICAgICAgICAgICBtU3RhbmRieSA9IHRydWU7Ci0gICAgICAgICAgICAgICAgbUJ5dGVzV3JpdHRlbiA9IDA7Ci0gICAgICAgICAgICAgICAgc3RhdHVzID0gbU91dHB1dC0+c3R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FjayhNaXhlclRocmVhZCAqdGhyZWFkKQotewotICAgIE11dGV4OjpBdXRvbG9jayBfbChtTG9jayk7Ci0gICAgLy8gRklYTUUgZXhwbGFpbiB0aGlzIGZvcm11bGEKLSAgICBpbnQgZnJhbWVDb3VudCA9ICgzICogbUZyYW1lQ291bnQgKiBtU2FtcGxlUmF0ZSkgLyB0aHJlYWQtPnNhbXBsZVJhdGUoKTsKLSAgICBPdXRwdXRUcmFjayAqb3V0cHV0VHJhY2sgPSBuZXcgT3V0cHV0VHJhY2sodGhyZWFkLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0aGlzLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBtU2FtcGxlUmF0ZSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbUZvcm1hdCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbUNoYW5uZWxNYXNrLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBmcmFtZUNvdW50KTsKLSAgICBpZiAob3V0cHV0VHJhY2stPmNibGsoKSAhPSBOVUxMKSB7Ci0gICAgICAgIHRocmVhZC0+c2V0U3RyZWFtVm9sdW1lKEFVRElPX1NUUkVBTV9DTlQsIDEuMGYpOwotICAgICAgICBtT3V0cHV0VHJhY2tzLmFkZChvdXRwdXRUcmFjayk7Ci0gICAgICAgIEFMT0dWKCJhZGRPdXRwdXRUcmFjaygpIHRyYWNrICVwLCBvbiB0aHJlYWQgJXAiLCBvdXRwdXRUcmFjaywgdGhyZWFkKTsKLSAgICAgICAgdXBkYXRlV2FpdFRpbWVfbCgpOwotICAgIH0KLX0KLQotdm9pZCBBdWRpb0ZsaW5nZXI6OkR1cGxpY2F0aW5nVGhyZWFkOjpyZW1vdmVPdXRwdXRUcmFjayhNaXhlclRocmVhZCAqdGhyZWFkKQotewotICAgIE11dGV4Ojp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kgewotICAgICAgICAgICAgbUNibGsgPSBzdGF0aWNfY2FzdDxhdWRpb190cmFja19jYmxrX3QgKj4obUNibGtNZW1vcnktPnBvaW50ZXIoKSk7Ci0gICAgICAgICAgICBpZiAobUNibGsgIT0gTlVMTCkgeyAvLyBjb25zdHJ1Y3QgdGhlIHNoYXJlZCBzdHJ1Y3R1cmUgaW4tcGxhY2UuCi0gICAgICAgICAgICAgICAgbmV3KG1DYmxrKSBhdWRpb190cmFja19jYmxrX3QoKTsKLSAgICAgICAgICAgICAgICAvLyBjbGVhciBhbGwgYnVmZmVycwotICAgICAgICAgICAgICAgIG1DYmxrLT5mcmFtZUNvdW50ID0gZnJhbWVDb3VudDsKLSAgICAgICAgICAgICAgICBtQ2Jsay0+c2FtcGxlUmF0ZSA9IHNhbXBsZVJhdGU7Ci0gICAgICAgICAgICAgICAgbUNoYW5uZWxDb3VudCA9IGNoYW5uZWxDb3VudDsKLSAgICAgICAgICAgICAgICBtQ2hhbm5lbE1hc2sgPSBjaGFubmVsTWFzazsKLSAgICAgICAgICAgICAgICBpZiAoc2hhcmVkQnVmZmVyID09IDApIHsKLSAgICAgICAgICAgICAgICAgICAgbUJ1ZmZlciA9IChjaGFyKiltQ2JsayArIHNpemVvZihhdWRpb190cmFja19jYmxrX3QpOwotICAgICAgICAgICAgICAgICAgICBtZW1zZXQobUJ1ZmZlciwgMCwgZnJhbWVDb3VudCpjaGFubmVsQ291bnQqc2l6ZW9mKGludDE2X3QpKTsKLSAgICAgICAgICAgICAgICAgICAgLy8gRm9yY2UgdW5kZXJydW4gY29uZGl0aW9uIHRvIGF2b2lkIGZhbHNlIHVuZGVycnVuIGNhbGxiYWNrIHVudGlsIGZpcnN0IGRhdGEgaXMKLSAgICAgICAgICAgICAgICAgICAgLy8gd3JpdHRlbiB0byBidWZmZXIgKG90aGVyIGZsYWdzIGFyZSBjbGVhcmVkKQotICAgICAgICAgICAgICAgICAgICBtQ2Jsay0+ZmxhZ3MgPSBDQkxLX1VOREVS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HJpbnRmKGJ1ZmZlciwgc2l6ZSwgIiAgICUwNWQgJTA1ZCAlMDN1ICUwM3UgMHglMDh4ICUwNXUgICAlMDR1ICUxZCAlMWQgJTFkICUwNXUgJTA1dSAlMDV1ICAweCUwOHggMHglMDh4IDB4JTA4eCAweCUwOHhcbiIsCi0gICAgICAgICAgICBtTmFtZSAtIEF1ZGlvTWl4ZXI6OlRSQUNLMCwKLSAgICAgICAgICAgIChtQ2xpZW50ID09IDApID8gZ2V0cGlkX2NhY2hlZCA6IG1DbGllbnQtPnBpZCgpLAotICAgICAgICAgICAgbVN0cmVhbVR5cGUsCi0gICAgICAgICAgICBtRm9ybWF0LAotICAgICAgICAgICAgbUNoYW5uZWxNYXNrLAotICAgICAgICAgICAgbVNlc3Npb25JZCwKLSAgICAgICAgICAgIG1GcmFtZUNvdW50LAotICAgICAgICAgICAgbVN0YXRlLAotICAgICAgICAgICAgbU11dGUsCi0gICAgICAgICAgICBtRmlsbGluZ1VwU3RhdHVzLAotICAgICAgICAgICAgbUNibGstPnNhbXBsZVJhdGUsCi0gICAgICAgICAgICB2bHIgJiAweEZGRkYsCi0gICAgICAgICAgICB2bHIgPj4gMTYsCi0gICAgICAgICAgICBtQ2Jsay0+c2VydmVyLAotICAgICAgICAgICAgbUNibGstPnVzZXIsCi0gICAgICAgICAgICAoaW50KW1NYWluQnVmZmVyLAotICAgICAgICAgICAgKGludCltQXV4QnVmZmVyKTsKLX0KLQotLy8gQXVkaW9CdWZmZXJQcm92aWRlciBpbnRlcmZhY2UKLXN0YXR1c190IEF1ZGlvRmxpbmdlcjo6UGxheWJhY2tUaHJlYWQ6OlRyYWNrOjpnZXROZXh0QnVmZmVyKAotICAgICAgICBBdWRpb0J1ZmZlclByb3ZpZGVyOjpCdWZmZXIqIGJ1ZmZlciwgaW50NjRfdCBwdHMpCi17Ci0gICAgYXVkaW9fdHJhY2tfY2Jsa190KiBjYmxrID0gdGhpcy0+Y2JsaygpOwotICAgIHVpbnQzMl90IGZyYW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wotICAgICAgICAgICAgICAgIHJldHVybiBOT19FUlJPUjsKLSAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgaW50NjRfdCB0cmFuc2Zvcm1lZFBUUzsKLSAgICAgICAgICAgIGlmICghbU1lZGlhVGltZVRyYW5zZm9ybS5kb0ZvcndhcmRUcmFuc2Zvcm0oaGVhZC5wdHMoKSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJnRyYW5zZm9ybWVkUFRTKSkgewotICAgICAgICAgICAgICAgIC8vIHRoZSB0cmFuc2Zvcm0gZmFpbGVkLiAgdGhpcyBzaG91bGRuJ3QgaGFwcGVuLCBidXQgaWYgaXQgZG9lcwotICAgICAgICAgICAgICAgIC8vIHRoZW4ganVzdCBkcm9wIHRoaXMgYnVmZmVyCi0gICAgICAgICAgICAgICAgQUxPR1coInRpbWVkR2V0TmV4dEJ1ZmZlciB0cmFuc2Zvcm0gZmFpbGVkIik7Ci0gICAgICAgICAgICAgICAgYnVmZmVyLT5yYXcgPSAwOwotICAgICAgICAgICAgICAgIGJ1ZmZlci0+ZnJhbWVDb3VudCA9IDA7Ci0gICAgICAgICAgICAgICAgbVRpbWVkQnVmZmVyUXVldWUucmVtb3ZlQXQoMCk7Ci0gICAgICAgICAgICAgICAgcmV0dXJuIE5PX0VSUk9SOwotICAgICAgICAgICAgfQotCi0gICAgICAgICAgICBpZiAobU1lZGlhVGltZVRyYW5zZm9ybVRhcmdldCA9PSBUaW1lZEF1ZGlvVHJhY2s6OkNPTU1PTl9USU1FKSB7Ci0gICAgICAgICAgICAgICAgaWYgKE9LICE9IG1DQ0hlbHBlci5jb21tb25UaW1lVG9Mb2NhbFRpbWUodHJhbnNmb3JtZWRQVFMsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJmhlYWRMb2NhbFBUUykpIHsKLSAgICAgICAgICAgICAgICAgICAgYnVmZmVyLT5yY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IT0gQVVESU9fU0VTU0lPTl9PVVRQVVRfTUlYKSB7Ci0gICAgICAgICAgICBsU2Vzc2lvbklkID0gKnNlc3Npb25JZDsKLSAgICAgICAgfSBlbHNlIHsKLSAgICAgICAgICAgIGxTZXNzaW9uSWQgPSBuZXh0VW5pcXVlSWQoKTsKLSAgICAgICAgICAgIGlmIChzZXNzaW9uSWQgIT0gTlVMTCkgewotICAgICAgICAgICAgICAgICpzZXNzaW9uSWQgPSBsU2Vzc2lvbklkOwotICAgICAgICAgICAgfQotICAgICAgICB9Ci0gICAgICAgIC8vIGNyZWF0ZSBuZXcgcmVjb3JkIHRyYWNrLiBUaGUgcmVjb3JkIHRyYWNrIHVzZXMgb25lIHRyYWNrIGluIG1IYXJkd2FyZU1peGVyVGhyZWFkIGJ5IGNvbnZlbnRpb24uCi0gICAgICAgIHJlY29yZFRyYWNrID0gdGhyZWFkLT5jcmVhdGVSZWNvcmRUcmFja19sKGNsaWVudCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNhbXBsZVJhdGUsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBmb3JtYXQsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjaGFubmVsTWFzaywKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZyYW1lQ291bnQsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBsU2Vzc2lvbklkLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJmxTdGF0dXMpOwotICAgIH0KLSAgICBpZiAobFN0YXR1cyAhPSBOT19FUlJPUikgewotICAgICAgICAvLyByZW1vdmUgbG9jYWwgc3Ryb25nIHJlZmVyZW5jZSB0byBDbGllbnQgYmVmb3JlIGRlbGV0aW5nIHRoZSBSZWNvcmRUcm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5KCZtSW5wdXQtPnN0cmVhbS0+Y29tbW9uKTsKLSAgICAgICAgICAgICAgICAgICAgbVN0YW5kYnkgPSB0cnVlOwotICAgICAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgICAgIGlmIChleGl0UGVuZGluZygpKSBicmVhazsKLQotICAgICAgICAgICAgICAgIHJlbGVhc2VXYWtlTG9ja19sKCk7Ci0gICAgICAgICAgICAgICAgQUxPR1YoIlJlY29yZFRocmVhZDogbG9vcCBzdG9wcGluZyIpOwotICAgICAgICAgICAgICAgIC8vIGdvIHRvIHNsZWVwCi0gICAgICAgICAgICAgICAgbVdhaXRXb3JrQ1Yud2FpdChtTG9jayk7Ci0gICAgICAgICAgICAgICAgQUxPR1YoIlJlY29yZFRocmVhZDogbG9vcCBzdGFydGluZyIpOwotICAgICAgICAgICAgICAgIGFjcXVpcmVXYWtlTG9ja19sKCk7Ci0gICAgICAgICAgICAgICAgY29udGludWU7Ci0gICAgICAgICAgICB9Ci0gICAgICAgICAgICBpZiAobUFjdGl2ZVRyYWNrICE9IDApIHsKLSAgICAgICAgICAgICAgICBpZiAobUFjdGl2ZVRyYWNrLT5tU3RhdGUgPT0gVHJhY2tCYXNlOjpQQVVTSU5HKSB7Ci0gICAgICAgICAgICAgICAgICAgIGlmICghbVN0YW5kYnkpIHsKLSAgICAgICAgICAgICAgICAgICAgICAgIG1JbnB1dC0+c3RyZWFtLT5jb21tb24uc3RhbmRieSgmbUlucHV0LT5zdHJlYW0tPmNvbW1vbik7Ci0gICAgICAgICAgICAgICAgICAgICAgICBtU3RhbmRieSA9IHRydWU7Ci0gICAgICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICAgICAgbUFjdGl2ZVRyYWNrLmNsZWFyKCk7Ci0gICAgICAgICAgICAgICAgICAgIG1TdGFydFN0b3BDb25kLmJyb2FkY2FzdCgpOwotICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAobUFjdGl2ZVRyYWNrLT5tU3RhdGUgPT0gVHJhY2tCYXNlOjpSRVNVTUlORykgewotICAgICAgICAgICAgICAgICAgICBpZiAobVJlcUNoYW5uZWxDb3VudCAhPSBtQWN0aXZlVHJhY2stPmNoYW5uZWxDb3VudCgpKSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICBtQWN0aXZlVHJhY2suY2xlYXIoKTsKLSAgICAgICAgICAgICAgICAgICAgICAgIG1TdGFydFN0b3BDb25kLmJyb2FkY2FzdCgpOwotICAgICAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKG1CeXRlc1JlYWQgIT0gMCkgewotICAgICAgICAgICAgICAgICAgICAgICAgLy8gcmVjb3JkIHN0YXJ0IHN1Y2NlZWRzIG9ubHkgaWYgZmlyc3QgcmVhZCBmcm9tIGF1ZGlvIGlucHV0Ci0gICAgICAgICAgICAgICAgICAgICAgICAvLyBzdWNjZWVkcwotICAgICAgICAgICAgICAgICAgICAgICAgaWYgKG1CeXRlc1JlYWQgPiAwKSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgbUFjdGl2ZVRyYWNrLT5tU3RhdGUgPSBUcmFja0Jhc2U6OkFDVElWRTsKLSAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgbUFjdGl2ZVRyYWNrLmNsZWFyKCk7Ci0gICAgICAgICAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgICAgICAgICBtU3RhcnRTdG9wQ29uZC5icm9hZGNhc3QoKTsKLSAgICAgICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgICAgICBtU3RhbmRieSA9IGZhbHNlOwotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgIH0KLSAgICAgICAgICAgIGxvY2tFZmZlY3RDaGFpbnNfbChlZmZlY3RDaGFpbnMpOwotICAgICAgICB9Ci0KLSAgICAgICAgaWYgKG1BY3RpdmVUcmFjayAhPSAwKSB7Ci0gICAgICAgICAgICBpZiAobUFjdGl2ZVRyYWNrLT5tU3RhdGUgIT0gVHJhY2tCYXNlOjpBQ1RJVkUgJiYKLSAgICAgICAgICAgICAgICBtQWN0aXZlVHJhY2stPm1TdGF0ZSAhPSBUcmFja0Jhc2U6OlJFU1VNSU5HKSB7Ci0gICAgICAgICAgICAgICAgdW5sb2NrRWZmZWN0Q2hhaW5zKGVmZmVjdENoYWlucyk7Ci0gICAgICAgICAgICAgICAgdXNsZWVwKGtSZWNvcmRUaHJlYWRTbGVlcFVzKTsKLSAgICAgICAgICAgICAgICBjb250aW51ZTsKLSAgICAgICAgICAgIH0KLSAgICAgICAgICAgIGZvciAoc2l6ZV90IGkgPSAwOyBpIDwgZWZmZWN0Q2hhaW5zLnNpemUoKTsgaSArKykgewotICAgICAgICAgICAgICAgIGVmZmVjdENoYWluc1tpXS0+cHJvY2Vzc19sKCk7Ci0gICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgIGJ1ZmZlci5mcmFtZUNvdW50ID0gbUZyYW1lQ291bnQ7Ci0gICAgICAgICAgICBpZiAoQ0NfTElLRUxZKG1BY3RpdmVUcmFjay0+Z2V0TmV4dEJ1ZmZlcigmYnVmZmVyKSA9PSBOT19FUlJPUikpIHsKLSAgICAgICAgICAgICAgICBzaXplX3QgZnJhbWVzT3V0ID0gYnVmZmVyLmZyYW1lQ291bnQ7Ci0gICAgICAgICAgICAgICAgaWYgKG1SZXNhbXBsZXIgPT0gTlVMTCkgewotICAgICAgICAgICAgICAgICAgICAvLyBubyByZXNhbXBsaW5nCi0gICAgICAgICAgICAgICAgICAgIHdoaWxlIChmcmFtZXNPdXQpIHsKLSAgICAgICAgICAgICAgICAgICAgICAgIHNpemVfdCBmcmFtZXNJbiA9IG1GcmFtZUNvdW50IC0gbVJzbXBJbkluZGV4OwotICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGZyYW1lc0luKSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgaW50OF90ICpzcmMgPSAoaW50OF90ICopbVJzbXBJbkJ1ZmZlciArIG1Sc21wSW5JbmRleCAqIG1GcmFtZVNpemU7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgaW50OF90ICpkc3QgPSBidWZmZXIuaTggKyAoYnVmZmVyLmZyYW1lQ291bnQgLSBmcmFtZXNPdXQpICogbUFjdGl2ZVRyYWNrLT5tQ2Jsay0+ZnJhbWVTaXplOwotICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChmcmFtZXNJbiA+IGZyYW1lc091dCkKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZnJhbWVzSW4gPSBmcmFtZXNPdXQ7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgbVJzbXBJbkluZGV4ICs9IGZyYW1lc0luOwotICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZyYW1lc091dCAtPSBmcmFtZXNJbjsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoKGludCltQ2hhbm5lbENvdW50ID09IG1SZXFDaGFubmVsQ291bnQgfHwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbUZvcm1hdCAhPSBBVURJT19GT1JNQVRfUENNXzE2X0JJVCkgewotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBtZW1jcHkoZHN0LCBzcmMsIGZyYW1lc0luICogbUZyYW1lU2l6ZSk7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaW50MTZfdCAqc3JjMTYgPSAoaW50MTZfdCAqKXNyYzsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaW50MTZfdCAqZHN0MTYgPSAoaW50MTZfdCAqKWRzdDsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKG1DaGFubmVsQ291bnQgPT0gMSkgewotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgd2hpbGUgKGZyYW1lc0luLS0pIHsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqZHN0MTYrKyA9ICpzcmMxNjsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqZHN0MTYrKyA9ICpzcmMxNisrOwotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2UgewotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgd2hpbGUgKGZyYW1lc0luLS0pIHsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAqZHN0MTYrKyA9IChpbnQxNl90KSgoKGludDMyX3QpKnNyYzE2ICsgKGludDMyX3QpKihzcmMxNiArIDEpKSA+PiAxKTsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzcmMxNiArPSAyOwotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGZyYW1lc091dCAmJiBtRnJhbWVDb3VudCA9PSBtUnNtcEluSW5kZXgpIHsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoZnJhbWVzT3V0ID09IG1GcmFtZUNvdW50ICYmCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICgoaW50KW1DaGFubmVsQ291bnQgPT0gbVJlcUNoYW5uZWxDb3VudCB8fCBtRm9ybWF0ICE9IEFVRElPX0ZPUk1BVF9QQ01fMTZfQklUKSkgewotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBtQnl0ZXNSZWFkID0gbUlucHV0LT5zdHJlYW0tPnJlYWQobUlucHV0LT5zdHJlYW0sIGJ1ZmZlci5yYXcsIG1JbnB1dEJ5dGVzKTsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZnJhbWVzT3V0ID0gMDsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2UgewotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBtQnl0ZXNSZWFkID0gbUlucHV0LT5zdHJlYW0tPnJlYWQobUlucHV0LT5zdHJlYW0sIG1Sc21wSW5CdWZmZXIsIG1JbnB1dEJ5dGVzKTsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbVJzbXBJbkluZGV4ID0gMDsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKG1CeXRlc1JlYWQgPCAwKSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEFMT0dFKCJFcnJvciByZWFkaW5nIGF1ZGlvIGlucHV0Iik7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChtQWN0aXZlVHJhY2stPm1TdGF0ZSA9PSBUcmFja0Jhc2U6OkFDVElWRSkgewotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gRm9yY2UgaW5wdXQgaW50byBzdGFuZGJ5IHNvIHRoYXQgaXQgdHJpZXMgdG8KLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vIHJlY292ZXIgYXQgbmV4dCByZWFkIGF0dGVtcHQKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1JbnB1dC0+c3RyZWFtLT5jb21tb24uc3RhbmRieSgmbUlucHV0LT5zdHJlYW0tPmNvbW1vbik7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB1c2xlZXAoa1JlY29yZFRocmVhZFNsZWVwVXMpOwotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1Sc21wSW5JbmRleCA9IG1GcmFtZUNvdW50OwotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBmcmFtZXNPdXQgPSAwOwotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBidWZmZXIuZnJhbWVDb3VudCA9IDA7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgfSBlbHNlIHsKLSAgICAgICAgICAgICAgICAgICAgLy8gcmVzYW1wbGluZwotCi0gICAgICAgICAgICAgICAgICAgIG1lbXNldChtUnNtcE91dEJ1ZmZlciwgMCwgZnJhbWVzT3V0ICogMiAqIHNpemVvZihpbnQzMl90KSk7Ci0gICAgICAgICAgICAgICAgICAgIC8vIGFsdGVyIG91dHB1dCBmcmFtZSBjb3VudCBhcyBpZiB3ZSB3ZXJlIGV4cGVjdGluZyBzdGVyZW8gc2FtcGxlcwotICAgICAgICAgICAgICAgICAgICBpZiAobUNoYW5uZWxDb3VudCA9PSAxICYmIG1SZXFDaGFubmVsQ291bnQgPT0gMSkgewotICAgICAgICAgICAgICAgICAgICAgICAgZnJhbWVzT3V0ID4+PSAxOwotICAgICAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgICAgIG1SZXNhbXBsZXItPnJlc2FtcGxlKG1Sc21wT3V0QnVmZmVyLCBmcmFtZXNPdXQsIHRoaXMpOwotICAgICAgICAgICAgICAgICAgICAvLyBkaXRoZXJBbmRDbGFtcCgpIHdvcmtzIGFzIGxvbmcgYXMgYWxsIGJ1ZmZlcnMgcmV0dXJuZWQgYnkgbUFjdGl2ZVRyYWNrLT5nZXROZXh0QnVmZmVyKCkKLSAgICAgICAgICAgICAgICAgICAgLy8gYXJlIDMyIGJpdCBhbGlnbmVkIHdoaWNoIHNob3VsZCBiZSBhbHdheXMgdHJ1ZS4KLSAgICAgICAgICAgICAgICAgICAgaWYgKG1DaGFubmVsQ291bnQgPT0gMiAmJiBtUmVxQ2hhbm5lbENvdW50ID09IDEpIHsKLSAgICAgICAgICAgICAgICAgICAgICAgIGRpdGhlckFuZENsYW1wKG1Sc21wT3V0QnVmZmVyLCBtUnNtcE91dEJ1ZmZlciwgZnJhbWVzT3V0KTsKLSAgICAgICAgICAgICAgICAgICAgICAgIC8vIHRoZSByZXNhbXBsZXIgYWx3YXlzIG91dHB1dHMgc3RlcmVvIHNhbXBsZXM6IGRvIHBvc3Qgc3RlcmVvIHRvIG1vbm8gY29udmVyc2lvbgotICAgICAgICAgICAgICAgICAgICAgICAgaW50MTZfdCAqc3JjID0gKGludDE2X3QgKiltUnNtcE91dEJ1ZmZlcjsKLSAgICAgICAgICAgICAgICAgICAgICAgIGludDE2X3QgKmRzdCA9IGJ1ZmZlci5pMTY7Ci0gICAgICAgICAgICAgICAgICAgICAgICB3aGlsZSAoZnJhbWVzT3V0LS0pIHsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAqZHN0KysgPSAoaW50MTZfdCkoKChpbnQzMl90KSpzcmMgKyAoaW50MzJfdCkqKHNyYyArIDEpKSA+PiAxKTsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBzcmMgKz0gMjsKLSAgICAgICAgICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHsKLSAgICAgICAgICAgICAgICAgICAgICAgIGRpdGhlckFuZENsYW1wKChpbnQzMl90ICopYnVmZmVyLnJhdywgbVJzbXBPdXRCdWZmZXIsIGZyYW1lc091dCk7Ci0gICAgICAgICAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICBtQWN0aXZlVHJhY2stPnJlbGVhc2VCdWZmZXIoJmJ1ZmZlcik7Ci0gICAgICAgICAgICAgICAgbUFjdGl2ZVRyYWNrLT5vdmVyZmxvdygpOwotICAgICAgICAgICAgfQotICAgICAgICAgICAgLy8gY2xpZW50IGlzbid0IHJldHJpZXZpbmcgYnVmZmVycyBmYXN0IGVub3VnaAotICAgICAgICAgICAgZWxzZSB7Ci0gICAgICAgICAgICAgICAgaWYgKCFtQWN0aXZlVHJhY2stPnNldE92ZXJmbG93KCkpIHsKLSAgICAgICAgICAgICAgICAgICAgbnNlY3NfdCBub3cgPSBzeXN0ZW1UaW1lKCk7Ci0gICAgICAgICAgICAgICAgICAgIGlmICgobm93IC0gbGFzdFdhcm5pbmcpID4ga1dhcm5pbmdUaHJvdHRsZU5zKSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICBBTE9HVygiUmVjb3JkVGhyZWFkOiBidWZmZXIgb3ZlcmZsb3ciKTsKLSAgICAgICAgICAgICAgICAgICAgICAgIGxhc3RXYXJuaW5nID0gbm93OwotICAgICAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgIC8vIFJlbGVhc2UgdGhlIHByb2Nlc3NvciBmb3IgYSB3aGlsZSBiZWZvcmUgYXNraW5nIGZvciBhIG5ldyBidWZmZXIuCi0gICAgICAgICAgICAgICAgLy8gVGhpcyB3aWxsIGdpdmUgdGhlIGFwcGxpY2F0aW9uIG1vcmUgY2hhbmNlIHRvIHJlYWQgZnJvbSB0aGUgYnVmZmVyIGFuZAotICAgICAgICAgICAgICAgIC8vIGNsZWFyIHRoZSBvdmVyZmxvdy4KLSAgICAgICAgICAgICAgICB1c2xlZXAoa1JlY29yZFRocmVhZFNsZWVwVXMpOwotICAgICAgICAgICAgfQotICAgICAgICB9Ci0gICAgICAgIC8vIGVuYWJsZSBjaGFuZ2VzIGluIGVmZmVjdCBjaGFpbgotICAgICAgICB1bmxvY2tFZmZlY3RDaGFpbnMoZWZmZWN0Q2hhaW5zKTsKLSAgICAgICAgZWZmZWN0Q2hhaW5zLmNsZWFyKCk7Ci0gICAgfQotCi0gICAgaWYgKCFtU3RhbmRieSkgewotICAgICAgICBtSW5wdXQtPnN0cmVhbS0+Y29tbW9uLnN0YW5kYnkoJm1JbnB1dC0+c3RyZWFtLT5jb21tb24pOwotICAgIH0KLSAgICBtQWN0aXZlVHJhY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bmdNZSA9IHRoaXM7Ci0gICAgc3RhdHVzX3Qgc3RhdHVzID0gTk9fRVJST1I7Ci0gICAgewotICAgICAgICBBdXRvTXV0ZXggbG9jayhtTG9jayk7Ci0gICAgICAgIGlmIChtQWN0aXZlVHJhY2sgIT0gMCkgewotICAgICAgICAgICAgaWYgKHJlY29yZFRyYWNrICE9IG1BY3RpdmVUcmFjay5nZXQoKSkgewotICAgICAgICAgICAgICAgIHN0YXR1cyA9IC1FQlVTWTsKLSAgICAgICAgICAgIH0gZWxzZSBpZiAobUFjdGl2ZVRyYWNrLT5tU3RhdGUgPT0gVHJhY2tCYXNlOjpQQVVTSU5HKSB7Ci0gICAgICAgICAgICAgICAgbUFjdGl2ZVRyYWNrLT5tU3RhdGUgPSBUcmFja0Jhc2U6OkFDVElWRTsKLSAgICAgICAgICAgIH0KLSAgICAgICAgICAgIHJldHVybiBzdGF0dXM7Ci0gICAgICAgIH0KLQotICAgICAgICByZWNvcmRUcmFjay0+bVN0YXRlID0gVHJhY2tCYXNlOjpJRExFOwotICAgICAgICBtQWN0aXZlVHJhY2sgPSByZWNvcmRUcmFjazsKLSAgICAgICAgbUxvY2sudW5sb2NrKCk7Ci0gICAgICAgIHN0YXR1c190IHN0YXR1cyA9IEF1ZGlvU3lzdGVtOjpzdGFydElucHV0KG1JZCk7Ci0gICAgICAgIG1Mb2NrLmxvY2soKTsKLSAgICAgICAgaWYgKHN0YXR1cyAhPSBOT19FUlJPUikgewotICAgICAgICAgICAgbUFjdGl2ZVRyYWNrLmNsZWFyKCk7Ci0gICAgICAgICAgICByZXR1cm4gc3RhdHVzOwotICAgICAgICB9Ci0gICAgICAgIG1Sc21wSW5JbmRleCA9IG1GcmFtZUNvdW50OwotICAgICAgICBtQnl0ZXNSZWFkID0gMDsKLSAgICAgICAgaWYgKG1SZXNhbXBsZXIgIT0gTlVMTCkgewotICAgICAgICAgICAgbVJlc2FtcGxlci0+cmVzZXQoKTsKLSAgICAgICAgfQotICAgICAgICBtQWN0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wb3J0aW5nIHRob3NlIHByZSBwcm9jZXNzaW5ncwotICAgICAgICAgICAgICAgIGlmIChtVHJhY2sgIT0gTlVMTCkgewotICAgICAgICAgICAgICAgICAgICBib29sIHN1c3BlbmQgPSBhdWRpb19pc19ibHVldG9vdGhfc2NvX2RldmljZSgKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAoYXVkaW9fZGV2aWNlc190KXZhbHVlKSAmJiBtQXVkaW9GbGluZ2VyLT5idE5yZWNJc09mZigpOwotICAgICAgICAgICAgICAgICAgICBzZXRFZmZlY3RTdXNwZW5kZWRfbChGWF9JSURfQUVDLCBzdXNwZW5kLCBtVHJhY2stPnNlc3Npb25JZCgpKTsKLSAgICAgICAgICAgICAgICAgICAgc2V0RWZmZWN0U3VzcGVuZGVkX2woRlhfSUlEX05TLCBzdXNwZW5kLCBtVHJhY2stPnNlc3Npb25JZCgpKTsKLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICB9Ci0gICAgICAgICAgICBtRGV2aWNlIHw9ICh1aW50MzJfdCl2YWx1ZTsKLSAgICAgICAgfQotICAgICAgICBpZiAoc3RhdHVzID09IE5PX0VSUk9SKSB7Ci0gICAgICAgICAgICBzdGF0dXMgPSBtSW5wdXQtPnN0cmVhbS0+Y29tbW9uLnNldF9wYXJhbWV0ZXJzKCZtSW5wdXQtPnN0cmVhbS0+Y29tbW9uLCBrZXlWYWx1ZVBhaXIuc3RyaW5nKCkpOwotICAgICAgICAgICAgaWYgKHN0YXR1cyA9PSBJTlZBTElEX09QRVJBVElPTikgewotICAgICAgICAgICAgICAgIG1JbnB1dC0+c3RyZWFtLT5jb21tb24uc3RhbmRieSgmbUlucHV0LT5zdHJlYW0tPmNvbW1vbik7Ci0gICAgICAgICAgICAgICAgc3RhdHVzID0gbUlucHV0LT5zdHJlYW0tPmNvbW1vbi5zZXRfcGFyYW1ldGVycygmbUlucHV0LT5zdHJlYW0tPmNvbW1vbiwKLSAgICAgICAgICAgICAgICAgICAgICAgIGtleVZhbHVlUGFpci5zdHJpbmcoKSk7Ci0gICAgICAgICAgICB9Ci0gICAgICAgICAgICBpZiAocmVjb25maWcpIHsKLSAgICAgICAgICAgICAgICBpZiAoc3RhdHVzID09IEJBRF9WQUxVRSAmJgotICAgICAgICAgICAgICAgICAgICByZXFGb3JtYXQgPT0gbUlucHV0LT5zdHJlYW0tPmNvbW1vbi5nZXRfZm9ybWF0KCZtSW5wdXQtPnN0cmVhbS0+Y29tbW9uKSAmJgotICAgICAgICAgICAgICAgICAgICByZXFGb3JtYXQgPT0gQVVESU9fRk9STUFUX1BDTV8xNl9CSVQgJiYKLSAgICAgICAgICAgICAgICAgICAgKChpbnQpbUlucHV0LT5zdHJlYW0tPmNvbW1vbi5nZXRfc2FtcGxlX3JhdGUoJm1JbnB1dC0+c3RyZWFtLT5jb21tb24pIDw9ICgyICogcmVxU2FtcGxpbmdSYXRlKSkgJiYKLSAgICAgICAgICAgICAgICAgICAgcG9wY291bnQobUlucHV0LT5zdHJlYW0tPmNvbW1vbi5nZXRfY2hhbm5lbHMoJm1JbnB1dC0+c3RyZWFtLT5jb21tb24pKSA8PSBGQ0NfMiAmJgotICAgICAgICAgICAgICAgICAgICAocmVxQ2hhbm5lbENvdW50IDw9IEZDQ18yKSkgewotICAgICAgICAgICAgICAgICAgICBzdGF0dXMgPSBOT19FUlJPUjsKLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgaWYgKHN0YXR1cyA9PSBOT19FUlJPUikgewotICAgICAgICAgICAgICAgICAgICByZWFkSW5wdXRQYXJhbWV0ZXJzKCk7Ci0gICAgICAgICAgICAgICAgICAgIHNlbmRDb25maWdFdmVudF9sKEF1ZGlvU3lzdGVtOjpJTlBVVF9DT05GSUdfQ0hBTkdFRCk7Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgfQotICAgICAgICB9Ci0KLSAgICAgICAgbU5ld1BhcmFtZXRlcnMucmVtb3ZlQXQoMCk7Ci0KLSAgICAgICAgbV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lcjo6cmVzdG9yZU91dHB1dChhdWRpb19pb19oYW5kbGVfdCBvdXRwdXQpCi17Ci0gICAgTXV0ZXg6OkF1dG9sb2NrIF9sKG1Mb2NrKTsKLSAgICBQbGF5YmFja1RocmVhZCAqdGhyZWFkID0gY2hlY2tQbGF5YmFja1RocmVhZF9sKG91dHB1dCk7Ci0KLSAgICBpZiAodGhyZWFkID09IE5VTEwpIHsKLSAgICAgICAgcmV0dXJuIEJBRF9WQUxVRTsKLSAgICB9Ci0KLSAgICBBTE9HVigicmVzdG9yZU91dHB1dCgpICVkIiwgb3V0cHV0KTsKLQotICAgIHRocmVhZC0+cmVzdG9yZSgpOwotCi0gICAgcmV0dXJuIE5PX0VSUk9SOwotfQotCi1hdWRpb19pb19oYW5kbGVfdCBBdWRpb0ZsaW5nZXI6Om9wZW5JbnB1dCh1aW50MzJfdCAqcERldmljZXMsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHVpbnQzMl90ICpwU2FtcGxpbmdSYXRlLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBhdWRpb19mb3JtYXRfdCAqcEZvcm1hdCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdWludDMyX3QgKnBDaGFubmVscywKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYXVkaW9faW5fYWNvdXN0aWNzX3QgYWNvdXN0aWNzKQotewotICAgIHN0YXR1c190IHN0YXR1czsKLSAgICBSZWNvcmRUaHJlYWQgKnRocmVhZCA9IE5VTEw7Ci0gICAgdWludDMyX3Qgc2FtcGxpbmdSYXRlID0gcFNhbXBsaW5nUmF0ZSA/ICpwU2FtcGxpbmdSYXRlIDogMDsKLSAgICBhdWRpb19mb3JtYXRfdCBmb3JtYXQgPSBwRm9ybWF0ID8gKnBGb3JtYXQgOiBBVURJT19GT1JNQVRfREVGQVVMVDsKLSAgICB1aW50MzJfdCBjaGFubmVscyA9IHBDaGFubmVscyA/ICpwQ2hhbm5lbHMgOiAwOwotICAgIHVpbnQzMl90IHJlcVNhbXBsaW5nUmF0ZSA9IHNhbXBsaW5nUmF0ZTsKLSAgICBhdWRpb19mb3JtYXRfdCByZXFGb3JtYXQgPSBmb3JtYXQ7Ci0gICAgdWludDMyX3QgcmVxQ2hhbm5lbHMgPSBjaGFubmVsczsKLSAgICBhdWRpb19zdHJlYW1faW5fdCAqaW5TdHJlYW07Ci0gICAgYXVkaW9faHdfZGV2aWNlX3QgKmluSHdEZXY7Ci0KLSAgICBpZiAocERldmljZXMgPT0gTlVMTCB8fCAqcERldmljZXMgPT0gMCkgewotICAgICAgICByZXR1cm4gMDsKLSAgICB9Ci0KLSAgICBNdXRleDo6QXV0b2xvY2sgX2wobUxvY2spOwotCi0gICAgaW5Id0RldiA9IGZpbmRTdWl0YWJsZUh3RGV2X2woKnBEZXZpY2VzKTsKLSAgICBpZiAoaW5Id0RldiA9PSBOVUxMKQotICAgICAgICByZXR1cm4gMDsKLQotICAgIHN0YXR1cyA9IGluSHdEZXYtPm9wZW5faW5wdXRfc3RyZWFtKGluSHdEZXYsICpwRGV2aWNlcywgJmZvcm1hdCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmY2hhbm5lbHMsICZzYW1wbGluZ1JhdGUsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYWNvdXN0aWNzLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICZpblN0cmVhbSk7Ci0gICAgQUxPR1YoIm9wZW5JbnB1dCgpIG9wZW5JbnB1dFN0cmVhbSByZXR1cm5lZCBpbnB1dCAlcCwgU2FtcGxpbmdSYXRlICVkLCBGb3JtYXQgJWQsIENoYW5uZWxzICV4LCBhY291c3RpY3MgJXgsIHN0YXR1cyAlZCIsCi0gICAgICAgICAgICBpblN0cmVhbSwKLSAgICAgICAgICAgIHNhbXBsaW5nUmF0ZSwKLSAgICAgICAgICAgIGZvcm1hdCwKLSAgICAgICAgICA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GUsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGFjb3VzdGljcywKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJmluU3RyZWFtKTsKLSAgICB9Ci0KLSAgICBpZiAoaW5TdHJlYW0gIT0gTlVMTCkgewotICAgICAgICBBdWRpb1N0cmVhbUluICppbnB1dCA9IG5ldyBBdWRpb1N0cmVhbUluKGluSHdEZXYsIGluU3RyZWFtKTsKLQotICAgICAgICBhdWRpb19pb19oYW5kbGVfdCBpZCA9IG5leHRVbmlxdWVJZCgpOwotICAgICAgICAvLyBTdGFydCByZWNvcmQgdGhyZWFkCi0gICAgICAgIC8vIFJlY29yVGhyZWFkIHJlcXVpcmUgYm90aCBpbnB1dCBhbmQgb3V0cHV0IGRldmljZSBpbmRpY2F0aW9uIHRvIGZvcndhcmQgdG8gYXVkaW8KLSAgICAgICAgLy8gcHJlIHByb2Nlc3NpbmcgbW9kdWxlcwotICAgICAgICB1aW50MzJfdCBkZXZpY2UgPSAoKnBEZXZpY2VzKSB8IHByaW1hcnlPdXRwdXREZXZpY2VfbCgpOwotICAgICAgICB0aHJlYWQgPSBuZXcgUmVjb3JkVGhyZWFkKHRoaXMsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaW5wdXQsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmVxU2FtcGxpbmdSYXRlLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJlcUNoYW5uZWxzLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlkLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRldmljZSk7Ci0gICAgICAgIG1SZWNvcmRUaHJlYWRzLmFkZChpZCwgdGhyZWFkKTsKLSAgICAgICAgQUxPR1YoIm9wZW5JbnB1dCgpIGNyZWF0ZWQgcmVjb3JkIHRocmVhZDogSUQgJWQgdGhyZWFkICVwIiw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B0aGUgcmVxdWlyZWQgdHlwZSBpbiBlZmZlY3QgZmFjdG9yeQotICAgICAgICAgICAgaWYgKEVmZmVjdElzTnVsbFV1aWQoJnBEZXNjLT50eXBlKSkgewotICAgICAgICAgICAgICAgIEFMT0dXKCJjcmVhdGVFZmZlY3QoKSBubyBlZmZlY3QgdHlwZSIpOwotICAgICAgICAgICAgICAgIGxTdGF0dXMgPSBCQURfVkFMVUU7Ci0gICAgICAgICAgICAgICAgZ290byBFeGl0OwotICAgICAgICAgICAgfQotICAgICAgICAgICAgdWludDMyX3QgbnVtRWZmZWN0cyA9IDA7Ci0gICAgICAgICAgICBlZmZlY3RfZGVzY3JpcHRvcl90IGQ7Ci0gICAgICAgICAgICBkLmZsYWdzID0gMDsgLy8gcHJldmVudCBjb21waWxlciB3YXJuaW5nCi0gICAgICAgICAgICBib29sIGZvdW5kID0gZmFsc2U7Ci0KLSAgICAgICAgICAgIGxTdGF0dXMgPSBFZmZlY3RRdWVyeU51bWJlckVmZmVjdHMoJm51bUVmZmVjdHMpOwotICAgICAgICAgICAgaWYgKGxTdGF0dXMgPCAwKSB7Ci0gICAgICAgICAgICAgICAgQUxPR1coImNyZWF0ZUVmZmVjdCgpIGVycm9yICVkIGZyb20gRWZmZWN0UXVlcnlOdW1iZXJFZmZlY3RzIiwgbFN0YXR1cyk7Ci0gICAgICAgICAgICAgICAgZ290byBFeGl0OwotICAgICAgICAgICAgfQotICAgICAgICAgICAgZm9yICh1aW50MzJfdCBpID0gMDsgaSA8IG51bUVmZmVjdHM7IGkrKykgewotICAgICAgICAgICAgICAgIGxTdGF0dXMgPSBFZmZlY3RRdWVyeUVmZmVjdChpLCAmZGVzYyk7Ci0gICAgICAgICAgICAgICAgaWYgKGxTdGF0dXMgPCAwKSB7Ci0gICAgICAgICAgICAgICAgICAgIEFMT0dXKCJjcmVhdGVFZmZlY3QoKSBlcnJvciAlZCBmcm9tIEVmZmVjdFF1ZXJ5RWZmZWN0IiwgbFN0YXR1cyk7Ci0gICAgICAgICAgICAgICAgICAgIGNvbnRpbnVlOwotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICBpZiAobWVtY21wKCZkZXNjLnR5cGUsICZwRGVzYy0+dHlwZSwgc2l6ZW9mKGVmZmVjdF91dWlkX3QpKSA9PSAwKSB7Ci0gICAgICAgICAgICAgICAgICAgIC8vIElmIG1hdGNoaW5nIHR5cGUgZm91bmQgc2F2ZSBlZmZlY3QgZGVzY3JpcHRvci4gSWYgdGhlIHNlc3Npb24gaXMKLSAgICAgICAgICAgICAgICAgICAgLy8gMCBhbmQgdGhlIGVmZmVjdCBpcyBub3QgYXV4aWxpYXJ5LCBjb250aW51ZSBlbnVtZXJhdGlvbiBpbiBjYXNlCi0gICAgICAgICAgICAgICAgICAgIC8vIGFuIGF1eGlsaWFyeSB2ZXJzaW9uIG9mIHRoaXMgZWZmZWN0IHR5cGUgaXMgYXZhaWxhYmxlCi0gICAgICAgICAgICAgICAgICAgIGZvdW5kID0gdHJ1ZTsKLSAgICAgICAgICAgICAgICAgICAgbWVtY3B5KCZkLCAmZGVzYywgc2l6ZW9mKGVmZmVjdF9kZXNjcmlwdG9yX3QpKTsKLSAgICAgICAgICAgICAgICAgICAgaWYgKHNlc3Npb25JZCAhPSBBVURJT19TRVNTSU9OX09VVFBVVF9NSVggfHwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAoZGVzYy5mbGFncyAmIEVGRkVDVF9GTEFHX1RZUEVfTUFTSykgPT0gRUZGRUNUX0ZMQUdfVFlQRV9BVVhJTElBUlkpIHsKLSAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOwotICAgICAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgfQotICAgICAgICAgICAgaWYgKCFmb3VuZCkgewotICAgICAgICAgICAgICAgIGxTdGF0dXMgPSBCQURfVkFMVUU7Ci0gICAgICAgICAgICAgICAgQUxPR1coImNyZWF0ZUVmZmVjdCgpIGVmZmV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VhZHMudmFsdWVBdChpKS0+aGFzQXVkaW9TZXNzaW9uKHNlc3Npb25JZCkgIT0gMCkgewotICAgICAgICAgICAgICAgICAgICBpbyA9IG1QbGF5YmFja1RocmVhZHMua2V5QXQoaSk7Ci0gICAgICAgICAgICAgICAgICAgIGJyZWFrOwotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgIH0KLSAgICAgICAgICAgIGlmIChpbyA9PSAwKSB7Ci0gICAgICAgICAgICAgICAgZm9yIChzaXplX3QgaSA9IDA7IGkgPCBtUmVjb3JkVGhyZWFkcy5zaXplKCk7IGkrKykgewotICAgICAgICAgICAgICAgICAgICBpZiAobVJlY29yZFRocmVhZHMudmFsdWVBdChpKS0+aGFzQXVkaW9TZXNzaW9uKHNlc3Npb25JZCkgIT0gMCkgewotICAgICAgICAgICAgICAgICAgICAgICAgaW8gPSBtUmVjb3JkVGhyZWFkcy5rZXlBdChpKTsKLSAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOwotICAgICAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgfQotICAgICAgICAgICAgLy8gSWYgbm8gb3V0cHV0IHRocmVhZCBjb250YWlucyB0aGUgcmVxdWVzdGVkIHNlc3Npb24gSUQsIGRlZmF1bHQgdG8KLSAgICAgICAgICAgIC8vIGZpcnN0IG91dHB1dC4gVGhlIGVmZmVjdCBjaGFpbiB3aWxsIGJlIG1vdmVkIHRvIHRoZSBjb3JyZWN0IG91dHB1dAotICAgICAgICAgICAgLy8gdGhyZWFkIHdoZW4gYSB0cmFjayB3aXRoIHRoZSBzYW1lIHNlc3Npb24gSUQgaXMgY3JlYXRlZAotICAgICAgICAgICAgaWYgKGlvID09IDAgJiYgbVBsYXliYWNrVGhyZWFkcy5zaXplKCkpIHsKLSAgICAgICAgICAgICAgICBpbyA9IG1QbGF5YmFja1RocmVhZHMua2V5QXQoMCk7Ci0gICAgICAgICAgICB9Ci0gICAgICAgICAgICBBTE9HVig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RzdENoYWluLT5zdHJhdGVneSgpOwotICAgICAgICB9Ci0gICAgICAgIGlmIChyZVJlZ2lzdGVyKSB7Ci0gICAgICAgICAgICBBdWRpb1N5c3RlbTo6dW5yZWdpc3RlckVmZmVjdChlZmZlY3QtPmlkKCkpOwotICAgICAgICAgICAgQXVkaW9TeXN0ZW06OnJlZ2lzdGVyRWZmZWN0KCZlZmZlY3QtPmRlc2MoKSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBkc3RPdXRwdXQsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc3RyYXRlZ3ksCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2Vzc2lvbklkLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGVmZmVjdC0+aWQoKSk7Ci0gICAgICAgIH0KLSAgICAgICAgZWZmZWN0ID0gY2hhaW4tPmdldEVmZmVjdEZyb21JZF9sKDApOwotICAgIH0KLQotICAgIHJldHVybiBOT19FUlJPUjsKLX0KLQotCi0vLyBQbGF5YmFja1RocmVhZDo6Y3JlYXRlRWZmZWN0X2woKSBtdXN0IGJlIGNhbGxlZCB3aXRoIEF1ZGlvRmxpbmdlcjo6bUxvY2sgaGVsZAotc3A8QXVkaW9GbGluZ2VyOjpFZmZlY3RIYW5kbGU+IEF1ZGlvRmxpbmdlcjo6VGhyZWFkQmFzZTo6Y3JlYXRlRWZmZWN0X2woCi0gICAgICAgIGNvbnN0IHNwPEF1ZGlvRmxpbmdlcjo6Q2xpZW50PiYgY2xpZW50LAotICAgICAgICBjb25zdCBzcDxJRWZmZWN0Q2xpZW50PiYgZWZmZWN0Q2xpZW50LAotICAgICAgICBpbnQzMl90IHByaW9yaXR5LAotICAgICAgICBpbnQgc2Vzc2lvbklkLAotICAgICAgICBlZmZlY3RfZGVzY3JpcHRvcl90ICpkZXNjLAotICAgICAgICBpbnQgKmVuYWJsZWQsCi0gICAgIC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gICAgIHNpemVvZihlZmZlY3RfY29uZmlnX3QpLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJm1Db25maWcsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmc2l6ZSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICZjbWRTdGF0dXMpOwotICAgIGlmIChzdGF0dXMgPT0gMCkgewotICAgICAgICBzdGF0dXMgPSBjbWRTdGF0dXM7Ci0gICAgfQotCi0gICAgbU1heERpc2FibGVXYWl0Q250ID0gKE1BWF9ESVNBQkxFX1RJTUVfTVMgKiBtQ29uZmlnLm91dHB1dENmZy5zYW1wbGluZ1JhdGUpIC8KLSAgICAgICAgICAgICgxMDAwICogbUNvbmZpZy5vdXRwdXRDZmcuYnVmZmVyLmZyYW1lQ291bnQpOwotCi0gICAgcmV0dXJuIHN0YXR1czsKLX0KLQotc3RhdHVzX3QgQXVkaW9GbGluZ2VyOjpFZmZlY3RNb2R1bGU6OmluaXQoKQotewotICAgIE11dGV4OjpBdXRvbG9jayBfbChtTG9jayk7Ci0gICAgaWYgKG1FZmZlY3RJbnRlcmZhY2UgPT0gTlVMTCkgewotICAgICAgICByZXR1cm4gTk9fSU5JVDsKLSAgICB9Ci0gICAgc3RhdHVzX3QgY21kU3RhdHVzOwotICAgIHVpbnQzMl90IHNpemUgPSBzaXplb2Yoc3RhdHVzX3QpOwotICAgIHN0YXR1c190IHN0YXR1cyA9ICgqbUVmZmVjdEludGVyZmFjZSktPmNvbW1hbmQobUVmZmVjdEludGVyZmFjZSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEVGRkVDVF9DTURfSU5JVCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDAsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBOVUxMLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJnNpemUsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmY21kU3RhdHVzKTsKLSAgICBpZiAoc3RhdHVzID09IDApIHsKLSAgICAgICAgc3RhdHVzID0gY21kU3RhdHVzOwotICAgIH0KLSAgICByZXR1cm4gc3RhdHVzOwotfQotCi1zdGF0dXNfdCBBdWRpb0ZsaW5nZXI6OkVmZmVjdE1vZHVsZTo6c3RhcnQoKQotewotICAgIE11dGV4OjpBdXRvbG9jayBfbChtTG9jayk7Ci0gICAgcmV0dXJuIHN0YXJ0X2woKTsKLX0KLQotc3RhdHVzX3QgQXVkaW9GbGluZ2VyOjpFZmZlY3RNb2R1bGU6OnN0YXJ0X2woKQotewotICAgIGlmIChtRWZmZWN0SW50ZXJmYWNlID09IE5VTEwpIHsKLSAgICAgICAgcmV0dXJuIE5PX0lOSVQ7Ci0gICAgfQotICAgIHN0YXR1c190IGNtZFN0YXR1czsKLSAgICB1aW50MzJfdCBzaXplID0gc2l6ZW9mKHN0YXR1c190KTsKLSAgICBzdGF0dXNfdCBzdGF0dXMgPSAoKm1FZmZlY3RJbnRlcmZhY2UpLT5jb21tYW5kKG1FZmZlY3RJbnRlcmZhY2UsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBFRkZFQ1RfQ01EX0VOQUJMRSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDAsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBOVUxMLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJnNpemUsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmY21kU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NpemUgPSBzaXplb2Yoc3RhdHVzX3QpOwotICAgIHN0YXR1c190IHN0YXR1cyA9ICgqbUVmZmVjdEludGVyZmFjZSktPmNvbW1hbmQobUVmZmVjdEludGVyZmFjZSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEVGRkVDVF9DTURfRElTQUJMRSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDAsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBOVUxMLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJnNpemUsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmY21kU3RhdHVzKTsKLSAgICBpZiAoc3RhdHVzID09IDApIHsKLSAgICAgICAgc3RhdHVzID0gY21kU3RhdHVzOwotICAgIH0KLSAgICBpZiAoc3RhdHVzID09IDAgJiYKLSAgICAgICAgICAgICgobURlc2NyaXB0b3IuZmxhZ3MgJiBFRkZFQ1RfRkxBR19UWVBFX01BU0spID09IEVGRkVDVF9GTEFHX1RZUEVfUFJFX1BST0MgfHwKLSAgICAgICAgICAgICAobURlc2NyaXB0b3IuZmxhZ3MgJiBFRkZFQ1RfRkxBR19UWVBFX01BU0spID09IEVGRkVDVF9GTEFHX1RZUEVfUE9TVF9QUk9DKSkgewotICAgICAgICBzcDxUaHJlYWRCYXNlPiB0aHJlYWQgPSBtVGhyZWFkLnByb21vdGUoKTsKLSAgICAgICAgaWYgKHRocmVhZCAhPSAwKSB7Ci0gICAgICAgICAgICBhdWRpb19zdHJlYW1fdCAqc3RyZWFtID0gdGhyZWFkLT5zdHJlYW0oKTsKLSAgICAgICAgICAgIGlmIChzdHJlYW0gIT0gTlVMTCkgewotICAgICAgICAgICAgICAgIHN0cmVhbS0+cmVtb3ZlX2F1ZGlvX2VmZmVjdChzdHJlYW0sIG1FZmZlY3RJbnRlcmZhY2UpOwotICAgICAgICAgICAgfQotICAgICAgICB9Ci0gICAgfQotICAgIHJldHVybiBzdGF0dXM7Ci19Ci0KLXN0YXR1c190IEF1ZGlvRmxpbmdlcjo6RWZmZWN0TW9kdWxlOjpjb21tYW5kKHVpbnQzMl90IGNtZENvZGUsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB1aW50MzJfdCBjbWRTaXplLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdm9pZCAqcENtZERhdGEsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB1aW50MzJfdCAqcmVwbHlTaXplLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdm9pZCAqcFJlcGx5RGF0YSkKLXsKLSAgICBNdXRleDo6QXV0b2xvY2sgX2wobUxvY2spOwotLy8gICAgQUxPR1YoImNvbW1hbmQoKSwgY21kQ29kZTogJWQsIG1FZmZlY3RJbnRlcmZhY2U6ICVwIiwgY21kQ29kZSwgbUVmZmVjdEludGVyZmFjZSk7Ci0KLSAgICBpZiAobVN0YXRlID09IERFU1RST1lFRCB8fCBtRWZmZWN0SW50ZXJmYWNlID09IE5VTEwpIHsKLSAgICAgICAgcmV0dXJuIE5PX0lOSVQ7Ci0gICAgfQotICAgIHN0YXR1c190IHN0YXR1cyA9ICgqbUVmZmVjdEludGVyZmFjZSktPmNvbW1hbmQobUVmZmVjdEludGVyZmFjZSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNtZENvZGUsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjbWRTaXplLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcENtZERhdGEsCi0gICAgICAgICAgICAgICAgICAgIC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HJldHVybiBzdGF0dXM7Ci0gICAgICAgIH0KLQotICAgICAgICBzd2l0Y2ggKG1TdGF0ZSkgewotICAgICAgICAvLyBnb2luZyBmcm9tIGRpc2FibGVkIHRvIGVuYWJsZWQKLSAgICAgICAgY2FzZSBJRExFOgotICAgICAgICAgICAgbVN0YXRlID0gU1RBUlRJTkc7Ci0gICAgICAgICAgICBicmVhazsKLSAgICAgICAgY2FzZSBTVE9QUEVEOgotICAgICAgICAgICAgbVN0YXRlID0gUkVTVEFSVDsKLSAgICAgICAgICAgIGJyZWFrOwotICAgICAgICBjYXNlIFNUT1BQSU5HOgotICAgICAgICAgICAgbVN0YXRlID0gQUNUSVZFOwotICAgICAgICAgICAgYnJlYWs7Ci0KLSAgICAgICAgLy8gZ29pbmcgZnJvbSBlbmFibGVkIHRvIGRpc2FibGVkCi0gICAgICAgIGNhc2UgUkVTVEFSVDoKLSAgICAgICAgICAgIG1TdGF0ZSA9IFNUT1BQRUQ7Ci0gICAgICAgICAgICBicmVhazsKLSAgICAgICAgY2FzZSBTVEFSVElORzoKLSAgICAgICAgICAgIG1TdGF0ZSA9IElETEU7Ci0gICAgICAgICAgICBicmVhazsKLSAgICAgICAgY2FzZSBBQ1RJVkU6Ci0gICAgICAgICAgICBtU3RhdGUgPSBTVE9QUElORzsKLSAgICAgICAgICAgIGJyZWFrOwotICAgICAgICBjYXNlIERFU1RST1lFRDoKLSAgICAgICAgICAgIHJldHVybiBOT19FUlJPUjsgLy8gc2ltcGx5IGlnbm9yZSBhcyB3ZSBhcmUgYmVpbmcgZGVzdHJveWVkCi0gICAgICAgIH0KLSAgICAgICAgZm9yIChzaXplX3QgaSA9IDE7IGkgPCBtSGFuZGxlcy5zaXplKCk7IGkrKykgewotICAgICAgICAgICAgc3A8RWZmZWN0SGFuZGxlPiBoID0gbUhhbmRsZXNbaV0ucHJvbW90ZSgpOwotICAgICAgICAgICAgaWYgKGggIT0gMCkgewotICAgICAgICAgICAgICAgIGgtPnNldEVuYWJsZWQ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l6ZSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2b2x1bWUsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJnNpemUsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcFZvbHVtZSk7Ci0gICAgICAgIGlmIChjb250cm9sbGVyICYmIHN0YXR1cyA9PSBOT19FUlJPUiAmJiBzaXplID09IHNpemVvZih2b2x1bWUpKSB7Ci0gICAgICAgICAgICAqbGVmdCA9IHZvbHVtZVswXTsKLSAgICAgICAgICAgICpyaWdodCA9IHZvbHVtZVsxXTsKLSAgICAgICAgfQotICAgIH0KLSAgICByZXR1cm4gc3RhdHVzOwotfQotCi1zdGF0dXNfdCBBdWRpb0ZsaW5nZXI6OkVmZmVjdE1vZHVsZTo6c2V0RGV2aWNlKHVpbnQzMl90IGRldmljZSkKLXsKLSAgICBNdXRleDo6QXV0b2xvY2sgX2wobUxvY2spOwotICAgIHN0YXR1c190IHN0YXR1cyA9IE5PX0VSUk9SOwotICAgIGlmIChkZXZpY2UgJiYgKG1EZXNjcmlwdG9yLmZsYWdzICYgRUZGRUNUX0ZMQUdfREVWSUNFX01BU0spID09IEVGRkVDVF9GTEFHX0RFVklDRV9JTkQpIHsKLSAgICAgICAgLy8gYXVkaW8gcHJlIHByb2Nlc3NpbmcgbW9kdWxlcyBvbiBSZWNvcmRUaHJlYWQgY2FuIHJlY2VpdmUgYm90aCBvdXRwdXQgYW5kCi0gICAgICAgIC8vIGlucHV0IGRldmljZSBpbmRpY2F0aW9uIGluIHRoZSBzYW1lIGNhbGwKLSAgICAgICAgdWludDMyX3QgZGV2ID0gZGV2aWNlICYgQVVESU9fREVWSUNFX09VVF9BTEw7Ci0gICAgICAgIGlmIChkZXYpIHsKLSAgICAgICAgICAgIHN0YXR1c190IGNtZFN0YXR1czsKLSAgICAgICAgICAgIHVpbnQzMl90IHNpemUgPSBzaXplb2Yoc3RhdHVzX3QpOwotCi0gICAgICAgICAgICBzdGF0dXMgPSAoKm1FZmZlY3RJbnRlcmZhY2UpLT5jb21tYW5kKG1FZmZlY3RJbnRlcmZhY2UsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEVGRkVDVF9DTURfU0VUX0RFVklDRSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2l6ZW9mKHVpbnQzMl90KSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJmRldiwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJnNpemUsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICZjbWRTdGF0dXMpOwotICAgICAgICAgICAgaWYgKHN0YXR1cyA9PSBOT19FUlJPUikgewotICAgICAgICAgICAgICAgIHN0YXR1cyA9IGNtZFN0YXR1czsKLSAgICAgICAgICAgIH0KLSAgICAgICAgfQotICAgICAgICBkZXYgPSBkZXZpY2UgJiBBVURJT19ERVZJQ0VfSU5fQUxMOwotICAgICAgICBpZiAoZGV2KSB7Ci0gICAgICAgICAgICBzdGF0dXNfdCBjbWRTdGF0dXM7Ci0gICAgICAgICAgICB1aW50MzJfdCBzaXplID0gc2l6ZW9mKHN0YXR1c190KTsKLQotICAgICAgICAgICAgc3RhdHVzX3Qgc3RhdHVzMiA9ICgqbUVmZmVjdEludGVyZmFjZSktPmNvbW1hbmQobUVmZmVjdEludGVyZmFjZSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgRUZGRUNUX0NNRF9TRVRfSU5QVVRfREVWSUNFLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzaXplb2YodWludDMyX3QpLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmZGV2LAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmc2l6ZSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJmNtZFN0YXR1cyk7Ci0gICAgICAgICAgICBpZiAoc3RhdHVzMiA9PSBOT19FUlJPUikgewotICAgICAgICAgICAgICAgIHN0YXR1czIgPSBjbWRTdGF0dXM7Ci0gICAgICAgICAgICB9Ci0gICAgICAgICAgICBpZiAoc3RhdHVzID09IE5PX0VSUk9SKSB7Ci0gICAgICAgICAgICAgICAgc3RhdHVzID0gc3RhdHVzMjsKLSAgICAgICAgICAgIH0KLSAgICAgICAgfQotICAgIH0KLSAgICByZXR1cm4gc3RhdHVzOwotfQotCi1zdGF0dXNfdCBBdWRpb0ZsaW5nZXI6OkVmZmVjdE1vZHVsZTo6c2V0TW9kZShhdWRpb19tb2RlX3QgbW9kZSkKLXsKLSAgICBNdXRleDo6QXV0b2xvY2sgX2wobUxvY2spOwotICAgIHN0YXR1c190IHN0YXR1cyA9IE5PX0VSUk9SOwotICAgIGlmICgobURlc2NyaXB0b3IuZmxhZ3MgJiBFRkZFQ1RfRkxBR19BVURJT19NT0RFX01BU0spID09IEVGRkVDVF9GTEFHX0FVRElPX01PREVfSU5EKSB7Ci0gICAgICAgIHN0YXR1c190IGNtZFN0YXR1czsKLSAgICAgICAgdWludDMyX3Qgc2l6ZSA9IHNpemVvZihzdGF0dXNfdCk7Ci0gICAgICAgIHN0YXR1cyA9ICgqbUVmZmVjdEludGVyZmFjZSktPmNvbW1hbmQobUVmZmVjdEludGVyZmFjZSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBFRkZFQ1RfQ01EX1NFVF9BVURJT19NT0RFLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNpemVvZihhdWRpb19tb2RlX3Q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HMgaXMgd2UgYXJlIHN0dWNrIGhlcmUKLSAgICAgICAgTXV0ZXg6OkF1dG9sb2NrIF9sKG1DYmxrLT5sb2NrKTsKLSAgICAgICAgaWYgKG1DYmxrLT5jbGllbnRJbmRleCA+IEVGRkVDVF9QQVJBTV9CVUZGRVJfU0laRSB8fAotICAgICAgICAgICAgbUNibGstPnNlcnZlckluZGV4ID4gRUZGRUNUX1BBUkFNX0JVRkZFUl9TSVpFKSB7Ci0gICAgICAgICAgICBtQ2Jsay0+c2VydmVySW5kZXggPSAwOwotICAgICAgICAgICAgbUNibGstPmNsaWVudEluZGV4ID0gMDsKLSAgICAgICAgICAgIHJldHVybiBCQURfVkFMVUU7Ci0gICAgICAgIH0KLSAgICAgICAgc3RhdHVzX3Qgc3RhdHVzID0gTk9fRVJST1I7Ci0gICAgICAgIHdoaWxlIChtQ2Jsay0+c2VydmVySW5kZXggPCBtQ2Jsay0+Y2xpZW50SW5kZXgpIHsKLSAgICAgICAgICAgIGludCByZXBseTsKLSAgICAgICAgICAgIHVpbnQzMl90IHJzaXplID0gc2l6ZW9mKGludCk7Ci0gICAgICAgICAgICBpbnQgKnAgPSAoaW50ICopKG1CdWZmZXIgKyBtQ2Jsay0+c2VydmVySW5kZXgpOwotICAgICAgICAgICAgaW50IHNpemUgPSAqcCsrOwotICAgICAgICAgICAgaWYgKCgodWludDhfdCAqKXAgKyBzaXplKSA+IG1CdWZmZXIgKyBtQ2Jsay0+Y2xpZW50SW5kZXgpIHsKLSAgICAgICAgICAgICAgICBBTE9HVygiY29tbWFuZCgpOiBpbnZhbGlkIHBhcmFtZXRlciBibG9jayBzaXplIik7Ci0gICAgICAgICAgICAgICAgYnJlYWs7Ci0gICAgICAgICAgICB9Ci0gICAgICAgICAgICBlZmZlY3RfcGFyYW1fdCAqcGFyYW0gPSAoZWZmZWN0X3BhcmFtX3QgKilwOwotICAgICAgICAgICAgaWYgKHBhcmFtLT5wc2l6ZSA9PSAwIHx8IHBhcmFtLT52c2l6ZSA9PSAwKSB7Ci0gICAgICAgICAgICAgICAgQUxPR1coImNvbW1hbmQoKTogbnVsbCBwYXJhbWV0ZXIgb3IgdmFsdWUgc2l6ZSIpOwotICAgICAgICAgICAgICAgIG1DYmxrLT5zZXJ2ZXJJbmRleCArPSBzaXplOwotICAgICAgICAgICAgICAgIGNvbnRpbnVlOwotICAgICAgICAgICAgfQotICAgICAgICAgICAgdWludDMyX3QgcHNpemUgPSBzaXplb2YoZWZmZWN0X3BhcmFtX3QpICsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKChwYXJhbS0+cHNpemUgLSAxKSAvIHNpemVvZihpbnQpICsgMSkgKiBzaXplb2YoaW50KSArCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBhcmFtLT52c2l6ZTsKLSAgICAgICAgICAgIHN0YXR1c190IHJldCA9IG1FZmZlY3QtPmNvbW1hbmQoRUZGRUNUX0NNRF9TRVRfUEFSQU0sCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBzaXplLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmcnNpemUsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICZyZXBseSk7Ci0gICAgICAgICAgICAvLyBzdG9wIGF0IGZpcnN0IGVycm9yIGVuY291bnRlcmVkCi0gICAgICAgICAgICBpZiAocmV0ICE9IE5PX0VSUk9SKSB7Ci0gICAgICAgICAgICAgICAgc3RhdHVzID0gcmV0OwotICAgICAgICAgICAgICAgICooaW50ICopcFJlcGx5RGF0YSA9IHJlcGx5OwotICAgICAgICAgICAgICAgIGJyZWFrOwotICAgICAgICAgICAgfSBlbHNlIGlmIChyZXBseSAhPSBOT19FUlJPUikgewotICAgICAgICAgICAgICAgICooaW50ICopcFJlcGx5RGF0YSA9IHJlcGx5OwotICAgICAgICAgICA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FuZGxlOjpjb21tYW5kRXhlY3V0ZWQodWludDMyX3QgY21kQ29kZSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB1aW50MzJfdCBjbWRTaXplLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZvaWQgKnBDbWREYXRhLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHVpbnQzMl90IHJlcGx5U2l6ZSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2b2lkICpwUmVwbHlEYXRhKQotewotICAgIGlmIChtRWZmZWN0Q2xpZW50ICE9IDApIHsKLSAgICAgICAgbUVmZmVjdENsaWVudC0+Y29tbWFuZEV4ZWN1dGVkKGNtZENvZGUsIGNtZFNpemUsIHBDbWREYXRhLCByZXBseVNpemUsIHBSZXBseURhdGEpOwotICAgIH0KLX0KLQotCi0KLXZvaWQgQXVkaW9GbGluZ2VyOjpFZmZlY3RIYW5kbGU6OnNldEVuYWJsZWQoYm9vbCBlbmFibGVkKQotewotICAgIGlmIChtRWZmZWN0Q2xpZW50ICE9IDApIHsKLSAgICAgICAgbUVmZmVjdENsaWVudC0+ZW5hYmxlU3RhdHVzQ2hhbmdlZChlbmFibGVkKTsKLSAgICB9Ci19Ci0KLXN0YXR1c190IEF1ZGlvRmxpbmdlcjo6RWZmZWN0SGFuZGxlOjpvblRyYW5zYWN0KAotICAgIHVpbnQzMl90IGNvZGUsIGNvbnN0IFBhcmNlbCYgZGF0YSwgUGFyY2VsKiByZXBseSwgdWludDMyX3QgZmxhZ3MpCi17Ci0gICAgcmV0dXJuIEJuRWZmZWN0OjpvblRyYW5zYWN0KGNvZGUsIGRhdGEsIHJlcGx5LCBmbGFncyk7Ci19Ci0KLQotdm9pZCBBdWRpb0ZsaW5nZXI6OkVmZmVjdEhhbmRsZTo6ZHVtcChjaGFyKiBidWZmZXI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Y2VzcyA9IGZhbHNlOwotICAgICAgICB9Ci0KLSAgICAgICAgaWYgKGFjdGl2ZVRyYWNrQ250KCkgPT0gMCkgewotICAgICAgICAgICAgLy8gaWYgbm8gdHJhY2sgaXMgYWN0aXZlIGFuZCB0aGUgZWZmZWN0IHRhaWwgaGFzIG5vdCBiZWVuIHJlbmRlcmVkLAotICAgICAgICAgICAgLy8gdGhlIGlucHV0IGJ1ZmZlciBtdXN0IGJlIGNsZWFyZWQgaGVyZSBhcyB0aGUgbWl4ZXIgcHJvY2VzcyB3aWxsIG5vdCBkbyBpdAotICAgICAgICAgICAgaWYgKHRyYWNrc09uU2Vzc2lvbiB8fCBtVGFpbEJ1ZmZlckNvdW50ID4gMCkgewotICAgICAgICAgICAgICAgIHNpemVfdCBudW1TYW1wbGVzID0gdGhyZWFkLT5mcmFtZUNvdW50KCkgKiB0aHJlYWQtPmNoYW5uZWxDb3VudCgpOwotICAgICAgICAgICAgICAgIG1lbXNldChtSW5CdWZmZXIsIDAsIG51bVNhbXBsZXMgKiBzaXplb2YoaW50MTZfdCkpOwotICAgICAgICAgICAgICAgIGlmIChtVGFpbEJ1ZmZlckNvdW50ID4gMCkgewotICAgICAgICAgICAgICAgICAgICBtVGFpbEJ1ZmZlckNvdW50LS07Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgfQotICAgICAgICB9Ci0gICAgfQotCi0gICAgc2l6ZV90IHNpemUgPSBtRWZmZWN0cy5zaXplKCk7Ci0gICAgaWYgKGRvUHJvY2VzcykgewotICAgICAgICBmb3IgKHNpemVfdCBpID0gMDsgaSA8IHNpemU7IGkrKykgewotICAgICAgICAgICAgbUVmZmVjdHNbaV0tPnByb2Nlc3MoKTsKLSAgICAgICAgfQotICAgIH0KLSAgICBmb3IgKHNpemVfdCBpID0gMDsgaSA8IHNpemU7IGkrKykgewotICAgICAgICBtRWZmZWN0c1tpXS0+dXBkYXRlU3RhdGUoKTsKLSAgICB9Ci19Ci0KLS8vIGFkZEVmZmV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GVzYygpOwotICAgICAgICAgICAgdWludDMyX3QgaU1vZGUgPSBkLmZsYWdzICYgRUZGRUNUX0ZMQUdfVFlQRV9NQVNLOwotICAgICAgICAgICAgdWludDMyX3QgaVByZWYgPSBkLmZsYWdzICYgRUZGRUNUX0ZMQUdfSU5TRVJUX01BU0s7Ci0gICAgICAgICAgICBpZiAoaU1vZGUgPT0gRUZGRUNUX0ZMQUdfVFlQRV9JTlNFUlQpIHsKLSAgICAgICAgICAgICAgICAvLyBjaGVjayBpbnZhbGlkIGVmZmVjdCBjaGFpbmluZyBjb21iaW5hdGlvbnMKLSAgICAgICAgICAgICAgICBpZiAoaW5zZXJ0UHJlZiA9PSBFRkZFQ1RfRkxBR19JTlNFUlRfRVhDTFVTSVZFIHx8Ci0gICAgICAgICAgICAgICAgICAgIGlQcmVmID09IEVGRkVDVF9GTEFHX0lOU0VSVF9FWENMVVNJVkUpIHsKLSAgICAgICAgICAgICAgICAgICAgQUxPR1coImFkZEVmZmVjdF9sKCkgY291bGQgbm90IGluc2VydCBlZmZlY3QgJXM6IGV4Y2x1c2l2ZSBjb25mbGljdCB3aXRoICVzIiwgZGVzYy5uYW1lLCBkLm5hbWUpOwotICAgICAgICAgICAgICAgICAgICByZXR1cm4gSU5WQUxJRF9PUEVSQVRJT047Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgIC8vIHJlbWVtYmVyIHBvc2l0aW9uIG9mIGZpcnN0IGluc2VydCBlZmZlY3QgYW5kIGJ5IGRlZmF1bHQKLSAgICAgICAgICAgICAgICAvLyBzZWxlY3QgdGhpcyBhcyBpbnNlcnQgcG9zaXRpb24gZm9yIG5ldyBlZmZlY3QKLSAgICAgICAgICAgICAgICBpZiAoaWR4X2luc2VydCA9PSBzaXplKSB7Ci0gICAgICAgICAgICAgICAgICAgIGlkeF9pbnNlcnQgPSBpOwotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICAvLyByZW1lbWJlciBwb3NpdGlvbiBvZiBsYXN0IGluc2VydCBlZmZlY3QgY2xhaW1pbmcKLSAgICAgICAgICAgICAgICAvLyBmaXJzdCBwb3NpdGlvbgotICAgICAgICAgICAgICAgIGlmIChpUHJlZiA9PSBFRkZFQ1RfRkxBR19JTlNFUlRfRklSU1QpIHsKLSAgICAgICAgICAgICAgICAgICAgaWR4X2luc2VydF9maXJzdCA9IGk7Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgIC8vIHJlbWVtYmVyIHBvc2l0aW9uIG9mIGZpcnN0IGluc2VydCBlZmZlY3QgY2xhaW1pbmcKLSAgICAgICAgICAgICAgICAvLyBsYXN0IHBvc2l0aW9uCi0gICAgICAgICAgICAgICAgaWYgKGlQcmVmID09IEVGRkVDVF9GTEFHX0lOU0VSVF9MQVNUICYmCi0gICAgICAgICAgICAgICAgICAgIGlkeF9pbnNlcnRfbGFzdCA9PSAtMSkgewotICAgICAgICAgICAgICAgICAgICBpZHhfaW5zZXJ0X2xhc3QgPSBpOwotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgIH0KLSAgICAgICAgfQotCi0gICAgICAgIC8vIG1vZGlmeSBpZHhfaW5zZXJ0IGZyb20gZmlyc3QgcG9zaXRpb24gaWYgbmVlZGVkCi0gICAgICAgIGlmIChpbnNlcnRQcmVmID09IEVGRkVDVF9GTEFHX0lOU0VSVF9MQVNUKSB7Ci0gICAgICAgICAgICBpZiAoaWR4X2luc2VydF9sYXN0ICE9IC0xKSB7Ci0gICAgICAgICAgICAgICAgaWR4X2luc2VydCA9IGlkeF9pbnNlcnRfbGFzdDsKLSAgICAgICAgICAgIH0gZWxzZSB7Ci0gICAgICAgICAgICAgICAgaWR4X2luc2VydCA9IHNpemU7Ci0gICAgICAgICAgICB9Ci0gICAgICAgIH0gZWxzZSB7Ci0gICAgICAgICAgICBpZiAoaWR4X2luc2VydF9maXJzdCAhPSAtMSkgewotICAgICAgICAgICAgICAgIGlkeF9pbnNlcnQgPSBpZHhfaW5zZXJ0X2Z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5kZXJTZXJ2aWNlPEF1ZGlvRmxpbmdlcj4sCi0gICAgcHVibGljIEJuQXVkaW9GbGluZ2VyCi17Ci0gICAgZnJpZW5kIGNsYXNzIEJpbmRlclNlcnZpY2U8QXVkaW9GbGluZ2VyPjsgICAvLyBmb3IgQXVkaW9GbGluZ2VyKCkKLXB1YmxpYzoKLSAgICBzdGF0aWMgY29uc3QgY2hhciogZ2V0U2VydmljZU5hbWUoKSB7IHJldHVybiAibWVkaWEuYXVkaW9fZmxpbmdlciI7IH0KLQotICAgIHZpcnR1YWwgICAgIHN0YXR1c190ICAgIGR1bXAoaW50IGZkLCBjb25zdCBWZWN0b3I8U3RyaW5nMTY+JiBhcmdzKTsKLQotICAgIC8vIElBdWRpb0ZsaW5nZXIgaW50ZXJmYWNlLCBpbiBiaW5kZXIgb3Bjb2RlIG9yZGVyCi0gICAgdmlydHVhbCBzcDxJQXVkaW9UcmFjaz4gY3JlYXRlVHJhY2soCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBpZF90IHBpZCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYXVkaW9fc3RyZWFtX3R5cGVfdCBzdHJlYW1UeXBlLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB1aW50MzJfdCBzYW1wbGVSYXRlLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBhdWRpb19mb3JtYXRfdCBmb3JtYXQsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHVpbnQzMl90IGNoYW5uZWxNYXNrLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpbnQgZnJhbWVDb3VudCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgSUF1ZGlvRmxpbmdlcjo6dHJhY2tfZmxhZ3NfdCBmbGFncywKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY29uc3Qgc3A8SU1lbW9yeT4mIHNoYXJlZEJ1ZmZlciwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYXVkaW9faW9faGFuZGxlX3Qgb3V0cHV0LAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpbnQgKnNlc3Npb25JZCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc3RhdHVzX3QgKnN0YXR1cyk7Ci0KLSAgICB2aXJ0dWFsIHNwPElBdWRpb1JlY29yZD4gb3BlblJlY29yZCgKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcGlkX3QgcGlkLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBhdWRpb19pb19oYW5kbGVfdCBpbnB1dCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdWludDMyX3Qgc2FtcGxlUmF0ZSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYXVkaW9fZm9ybWF0X3QgZm9ybWF0LAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB1aW50MzJfdCBjaGFubmVsTWFzaywKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaW50IGZyYW1lQ291bnQsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIElBdWRpb0ZsaW5nZXI6OnRyYWNrX2ZsYWdzX3QgZmxhZ3MsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGludCAqc2Vzc2lvbklkLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzdGF0dXNfdCAqc3RhdHVzKTsKLQotICAgIHZpcnR1YWwgICAgIHVpbnQzMl90ICAgIHNhbXBsZVJhdGUoYXVkaW9faW9faGFuZGxlX3Qgb3V0cHV0KSBjb25zdDsKLSAgICB2aXJ0dWFsICAgICBpbnQgICAgICAgICBjaGFubmVsQ291bnQoYXVkaW9faW9faGFuZGxlX3Qgb3V0cHV0KSBjb25zdDsKLSAgICB2aXJ0dWFsICAgICBhdWRpb19mb3JtYXRfdCBmb3JtYXQoYXVkaW9faW9faGFuZGxlX3Q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gICAgICAgICAgICAgICAgICAgdWludDMyX3QgKnBDaGFubmVscywKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHVpbnQzMl90ICpwTGF0ZW5jeU1zLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYXVkaW9fcG9saWN5X291dHB1dF9mbGFnc190IGZsYWdzKTsKLQotICAgIHZpcnR1YWwgYXVkaW9faW9faGFuZGxlX3Qgb3BlbkR1cGxpY2F0ZU91dHB1dChhdWRpb19pb19oYW5kbGVfdCBvdXRwdXQxLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBhdWRpb19pb19oYW5kbGVfdCBvdXRwdXQyKTsKLQotICAgIHZpcnR1YWwgc3RhdHVzX3QgY2xvc2VPdXRwdXQoYXVkaW9faW9faGFuZGxlX3Qgb3V0cHV0KTsKLQotICAgIHZpcnR1YWwgc3RhdHVzX3Qgc3VzcGVuZE91dHB1dChhdWRpb19pb19oYW5kbGVfdCBvdXRwdXQpOwotCi0gICAgdmlydHVhbCBzdGF0dXNfdCByZXN0b3JlT3V0cHV0KGF1ZGlvX2lvX2hhbmRsZV90IG91dHB1dCk7Ci0KLSAgICB2aXJ0dWFsIGF1ZGlvX2lvX2hhbmRsZV90IG9wZW5JbnB1dCh1aW50MzJfdCAqcERldmljZXMsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgdWludDMyX3QgKnBTYW1wbGluZ1JhdGUsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgYXVkaW9fZm9ybWF0X3QgKnBGb3JtYXQsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgdWludDMyX3QgKnBDaGFubmVscywKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBhdWRpb19pbl9hY291c3RpY3NfdCBhY291c3RpY3MpOwotCi0gICAgdmlydHVhbCBzdGF0dXNfdCBjbG9zZUlucHV0KGF1ZGlvX2lvX2hhbmRsZV90IGlucHV0KTsKLQ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AgICAgICAgICAgICAgICBlZmZlY3RfZGVzY3JpcHRvcl90ICpkZXNjcmlwdG9yKSBjb25zdDsKLQotICAgIHZpcnR1YWwgc3A8SUVmZmVjdD4gY3JlYXRlRWZmZWN0KHBpZF90IHBpZCwKLSAgICAgICAgICAgICAgICAgICAgICAgIGVmZmVjdF9kZXNjcmlwdG9yX3QgKnBEZXNjLAotICAgICAgICAgICAgICAgICAgICAgICAgY29uc3Qgc3A8SUVmZmVjdENsaWVudD4mIGVmZmVjdENsaWVudCwKLSAgICAgICAgICAgICAgICAgICAgICAgIGludDMyX3QgcHJpb3JpdHksCi0gICAgICAgICAgICAgICAgICAgICAgICBhdWRpb19pb19oYW5kbGVfdCBpbywKLSAgICAgICAgICAgICAgICAgICAgICAgIGludCBzZXNzaW9uSWQsCi0gICAgICAgICAgICAgICAgICAgICAgICBzdGF0dXNfdCAqc3RhdHVzLAotICAgICAgICAgICAgICAgICAgICAgICAgaW50ICppZCwKLSAgICAgICAgICAgICAgICAgICAgICAgIGludCAqZW5hYmxlZCk7Ci0KLSAgICB2aXJ0dWFsIHN0YXR1c190IG1vdmVFZmZlY3RzKGludCBzZXNzaW9uSWQsIGF1ZGlvX2lvX2hhbmRsZV90IHNyY091dHB1dCwKLSAgICAgICAgICAgICAgICAgICAgICAgIGF1ZGlvX2lvX2hhbmRsZV90IGRzdE91dHB1dCk7Ci0KLSAgICB2aXJ0dWFsICAgICBzdGF0dXNfdCAgICBvblRyYW5zYWN0KAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB1aW50MzJfdCBjb2RlLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb25zdCBQYXJjZWwmIGRhdGEsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFBhcmNlbCogcmVwbHksCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHVpbnQzMl90IGZsYWdzKTsKLQotICAgIC8vIGVuZCBvZiBJQXVkaW9GbGluZ2VyIGludGVyZmF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dWRpb0ZsaW5nZXI+IG1BdWRpb0ZsaW5nZXI7Ci0gICAgICAgIGNvbnN0IHNwPE1lbW9yeURlYWxlcj4gbU1lbW9yeURlYWxlcjsKLSAgICAgICAgY29uc3QgcGlkX3QgICAgICAgICBtUGlkOwotCi0gICAgICAgIE11dGV4ICAgICAgICAgICAgICAgbVRpbWVkVHJhY2tMb2NrOwotICAgICAgICBpbnQgICAgICAgICAgICAgICAgIG1UaW1lZFRyYWNrQ291bnQ7Ci0gICAgfTsKLQotICAgIC8vIC0tLSBOb3RpZmljYXRpb24gQ2xpZW50IC0tLQotICAgIGNsYXNzIE5vdGlmaWNhdGlvbkNsaWVudCA6IHB1YmxpYyBJQmluZGVyOjpEZWF0aFJlY2lwaWVudCB7Ci0gICAgcHVibGljOgotICAgICAgICAgICAgICAgICAgICAgICAgICAgIE5vdGlmaWNhdGlvbkNsaWVudChjb25zdCBzcDxBdWRpb0ZsaW5nZXI+JiBhdWRpb0ZsaW5nZXIsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb25zdCBzcDxJQXVkaW9GbGluZ2VyQ2xpZW50PiYgY2xpZW50LAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcGlkX3QgcGlkKTsKLSAgICAgICAgdmlydHVhbCAgICAgICAgICAgICB+Tm90aWZpY2F0aW9uQ2xpZW50KCk7Ci0KLSAgICAgICAgICAgICAgICBzcDxJQXVkaW9GbGluZ2VyQ2xpZW50PiBhdWRpb0ZsaW5nZXJDbGllbnQoKSBjb25zdCB7IHJldHVybiBtQXVkaW9GbGluZ2VyQ2xpZW50OyB9Ci0KLSAgICAgICAgICAgICAgICAvLyBJQmluZGVyOjpEZWF0aFJlY2lwaWVudAotICAgICAgICAgICAgICAgIHZpcnR1YWwgICAgIHZvaWQgICAgICAgIGJpbmRlckRpZWQoY29uc3Qgd3A8SUJpbmRlcj4mIHdobyk7Ci0KLSAgICBwcml2Y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ZSBvcmRlciB3aXRob3V0IHJldmlld2luZyB0aGUgaW1wYWN0LgotICAgICAgICAgICAgICAgIC8vIEluIHBhcnRpY3VsYXIgdGhlcmUgYXJlIGFzc3VtcHRpb25zIGFib3V0ID4gU1RPUFBFRC4KLSAgICAgICAgICAgICAgICBTVE9QUEVELAotICAgICAgICAgICAgICAgIFJFU1VNSU5HLAotICAgICAgICAgICAgICAgIEFDVElWRSwKLSAgICAgICAgICAgICAgICBQQVVTSU5HLAotICAgICAgICAgICAgICAgIFBBVVNFRAotICAgICAgICAgICAgfTsKLQotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBUcmFja0Jhc2UoVGhyZWFkQmFzZSAqdGhyZWFkLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbnN0IHNwPENsaWVudD4mIGNsaWVudCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB1aW50MzJfdCBzYW1wbGVSYXRlLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGF1ZGlvX2Zvcm1hdF90IGZvcm1hdCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB1aW50MzJfdCBjaGFubmVsTWFzaywKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpbnQgZnJhbWVDb3VudCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb25zdCBzcDxJTWVtb3J5PiYgc2hhcmVkQnVmZmVyLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGludCBzZXNzaW9uSWQpOwotICAgICAgICAgICAgdmlydHVhbCAgICAgICAgICAgICB+VHJhY2tCYXNlKCk7Ci0KLSAgICAgICAgICAgIHZpcnR1YWwgc3RhdHVzX3QgICAgc3RhcnQocGlkX3QgdGlkKSA9IDA7Ci0gICAgICAgICAgICB2aXJ0dWFsIHZvaWQgICAgICAgIHN0b3AoKSA9IDA7Ci0gICAgICAgICAgICAgICAgICAgIHNwPElNZW1vcnk+IGdldENibGsoKSBjb25zdCB7IHJldHVybiBtQ2Jsa01lbW9yeTsgfQotICAgICAgICAgICAgICAgICAgICBhdWRpb190cmFja19jYmxrX3QqIGNibGsoKSBjb25zdCB7IHJldHVybiBtQ2JsazsgfQotICAgICAgICAgICAgICAgICAgICBpbnQgICAgICAgICBzZXNzaW9uSWQoKSBjb25zdCB7IHJldHVybiBtU2Vzc2lvbklkOyB9Ci0KLSAgICAgICAgcHJvdGVjdGVkOgotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBUcmFja0Jhc2UoY29uc3QgVHJhY2tCYXNlJik7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFRyYWNrQmFzZSYgb3BlcmF0b3IgPSAoY29uc3QgVHJhY2tCYXNlJik7Ci0KLSAgICAgICAgICAgIC8vIEF1ZGlvQnVmZmVyUHJvdmlkZXIgaW50ZXJmYWNlCi0gICAgICAgICAgICB2aXJ0dWFsIHN0YXR1c190IGdldE5leHRCdWZmZXIoQXVkaW9CdWZmZXJQcm92aWRlcjo6QnVmZmVyKiBidWZmZXIsIGludDY0X3QgcHRzKSA9IDA7Ci0gICAgICAgICAgICB2aXJ0dWFsIHZvaWQgcmVsZWFzZUJ1ZmZlcihBdWRpb0J1ZmZlclByb3ZpZGVyOjpCdWZmZXIqIGJ1ZmZlcik7Ci0KLSAgICAgICAgICAgIGF1ZGlvX2Zvcm1hdF90IGZvcm1hdCgpIGNvbnN0IHsKLSAgICAgICAgICAgICAgICByZXR1cm4gbUZvcm1hdDsKLSAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgaW50IGNoYW5uZWxDb3VudCgpIGNvbnN0IHsgcmV0dXJuIG1DaGFubmVsQ291bnQ7IH0KLQotICAgICAgICAgICAgdWludDMyX3QgY2hhbm5lbE1hc2soKSBjb25zdCB7IHJldHVybiBtQ2hhbm5lbE1hc2s7IH0KLQotICAgICAgICAgICAgaW50IHNhbXBsZVJhdGUoKSBjb25zdDsgLy8gRklYTUUgaW5saW5lIGFmdGVyIGNibGsgc3IgbW92ZWQKLQotICAgICAgICAgICAgdm9pZCogZ2V0QnVmZmVyKHVpbnQzMl90IG9mZnNldCwgdWludDMyX3QgZnJhbWVzKSBjb25zdDsKLQotICAgICAgICAgICAgYm9vbCBpc1N0b3BwZWQoKSBjb25zdCB7Ci0gICAgICAgICAgICAgICAgcmV0dXJuIG1TdGF0ZSA9PSBTVE9QUEVEOwotICAgICAgICAgICAgfQotCi0gICAgICAgICAgICBib29sIGlzVGVybWluYXRlZCgpIGNvbnN0IHsKLSAgICAgICAgICAgICAgICByZXR1cm4gbVN0YXRlID09IFRFUk1JTkFURUQ7Ci0gICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgIGJvb2wgc3RlcCgpOwotICAgICAgICAgICAgdm9pZCByZXNldCgpOwotCi0gICAgICAgICAgICBjb25zdCB3cDxUaHJlYWRCYXNlPiBtVGhyZWFkOwotICAgICAgICAgICAgLypjb25zdCovIHNwPENsaWVudD4gbUNsaWVudDsgICAvLyBzZWUgZXhwbGFuYXRpb24gYXQgflRyYWNrQmFzZSgpIHdoeSBub3QgY29uc3QKLSAgICAgICAgICAgIHNwPElNZW1vcnk+ICAgICAgICAgbUNibGtNZW1vcnk7Ci0gICAgICAgICAgICBhdWRpb190cmFja19jYmxrX3QqIG1DYmxrOwotICAgICAgICAgICAgdm9pZCogICAgICAgICAgICAgICBtQnVmZmVyOwotICAgICAgICAgICAgdm9pZCogICAgICAgICAgICAgICBtQnVmZmVyRW5kOwotICAgICAgICAgICAgdWludDMyX3QgICAgICAgICAgICBtRnJhbWVDb3VudDsKLSAgICAgICAgICAgIC8vIHdlIGRvbid0IHJlYWxseSBuZWVkIGEgbG9jayBmb3IgdGhlc2UKLSAgICAgICAgICAgIHRyYWNrX3N0YXRlICAgICAgICAgbVN0YXRlOwotICAgICAgICAgICAgY29uc3QgYXVkaW9fZm9ybWF0X3QgbUZvcm1hdDsKLSAgICAgICAgICAgIGJvb2wgICAgICAgICAgICAgICAgbVN0ZXBTZXJ2ZXJGYWlsZWQ7Ci0gICAgICAgICAgICBjb25zdCBpbnQgICAgICAgICAgIG1TZXNzaW9uSWQ7Ci0gICAgICAgICAgICB1aW50OF90ICAgICAgICAgICAgIG1DaGFubmVsQ291bnQ7Ci0gICAgICAgICAgICB1aW50MzJfdCAgICAgICAgICAgIG1DaGFubmVsTWFzazsKLSAgICAgICAgfTsKLQotICAgICAgICBjbGFzcyBDb25maWdFdmVudCB7Ci0gICAgICAgIHB1YmxpYzoKLSAgICAgICAgICAgIENvbmZpZ0V2ZW50KCkgOiBtRXZlbnQoMCksIG1QYXJhbSgwKSB7fQotCi0gICAgICAgICAgICBpbnQgbUV2ZW50OwotICAgICAgICAgICAgaW50IG1QYXJhbTsKLSAgICAgICAgfTsKLQotICAgICAgICBjbGFzcyBQTURlYXRoUmVjaXBpZW50IDogcHVibGljIElCaW5kZXI6OkRlYXRoUmVjaXBpZW50IHsKLSAgICAgICAgcHVibGljOgotICAgICAgICAgICAgICAgICAgICAgICAgUE1EZWF0aFJlY2lwaWVudChjb25zdCB3cDxUaHJlYWRCYXNlPiYgdGhyZWFkKSA6IG1UaHJlYWQodGhyZWFkKSB7fQotICAgICAgICAgICAgdmlydHVhbCAgICAgflBNRGVhdGhSZWNpcGllbnQoKSB7fQotCi0gICAgICAgICAgICAvLyBJQmluZGVyOjpEZWF0aFJlY2lwaWVudAotICAgICAgICAgICAgdmlydHVhbCAgICAgdm9pZCAgICAgICAgYmluZGVyRGllZChjb25zdCB3cDxJQmluZGVyPiYgd2hvKTsKLQotICAgICAgICBwcml2YXRlOgotICAgICAgICAgICAgICAgICAgICAgICAgUE1EZWF0aFJlY2lwaWVudChjb25zdCBQTURlYXRoUmVjaXBpZW50Jik7Ci0gICAgICAgICAgICAgICAgICAgICAgICBQTURlYXRoUmVjaXBpZW50JiBvcGVyYXRvciA9IChjb25zdCBQTURlYXRoUmVjaXBpZW50Jik7Ci0KLSAgICAgICAgICAgIHdwPFRocmVhZEJhc2U+IG1UaHJlYWQ7Ci0gICAgICAgIH07Ci0KLSAgICAgICAgdmlydHVhbCAgICAgc3RhdHVzX3QgICAgaW5pdENoZWNrKCkgY29uc3QgPSAwOwotICAgICAgICAgICAgICAgICAgICB0eXBlX3QgICAgICB0eXBlKCkgY29uc3QgeyByZXR1cm4gbVR5cGU7IH0KLSAgICAgICAgICAgICAgICAgICAgdWludDMyX3QgICAgc2FtcGxlUmF0ZSgpIGNvbnN0IHsgcmV0dXJuIG1TYW1wbGVSYXRlOyB9Ci0gICAgICAgICAgICAgICAgICAgIGludCAgICAgICAgIGNoYW5uZWxDb3VudCgpIGNvbnN0IHsgcmV0dXJuIG1DaGFubmVsQ291bnQ7IH0KLSAgICAgICAgICAgICAgICAgICAgYXVkaW9fZm9ybWF0X3QgZm9ybWF0KCkgY29uc3QgeyByZXR1cm4gbUZvcm1hdDsgfQotICAgICAgICAgICAgICAgICAgICBzaXplX3QgICAgICBmcmFtZUNvdW50KCkgY29uc3QgeyByZXR1cm4gbUZyYW1lQ291bnQ7IH0KLSAgICAgICAgICAgICAgICAgICAgdm9pZCAgICAgICAgd2FrZVVwKCkgICAgeyBtV2FpdFdvcmtDVi5icm9hZGNhc3QoKTsgfQotICAgICAgICAvLyBTaG91bGQgYmUgInZpcnR1YWwgc3RhdHVzX3QgcmVxdWVzdEV4aXRBbmRXYWl0KCkiIGFuZCBvdmVycmlkZSBzYW1lCi0gICAgICAgIC8vIG1ldGhvZCBpbiBUaHJlYWQsIGJ1dCBUaHJlYWQ6OnJlcXVlc3RFeGl0QW5kV2FpdCgpIGlzIG5vdCB5ZXQgdmlydHVhbC4KLSAgICAgICAgICAgICAgICAgICAgdm9pZCAgICAgICAgZXhpdCgpOwotICAgICAgICB2aXJ0dWFsICAgICBib29sICAgICAgICBjaGVja0Zvck5ld1BhcmFtZXRlcnNfbCgpID0gMDsKLSAgICAgICAgdmlydHVhbCAgICAgc3RhdHVzX3QgICAgc2V0UGFyYW1ldGVycyhjb25zdCBTdHJpbmc4JiBrZXlWYWx1ZVBhaXJzKTsKLSAgICAgICAgdmlydHVhbCAgICAgU3RyaW5nOCAgICAgZ2V0UGFyYW1ldGVycyhjb25zdCBTdHJpbmc4JiBrZXlzKSA9IDA7Ci0gICAgICAgIHZpcnR1YWwgICAgIHZvaWQgICAgICAgIGF1ZGlvQ29uZmlnQ2hhbmdlZF9sKGludCBldmVudCwgaW50IHBhcmFtID0gMCkgPSAwOwotICAgICAgICAgICAgICAgICAgICB2b2lkICAgICAgICBzZW5kQ29uZmlnRXZlbnQoaW50IGV2ZW50LCBpbnQgcGFyYW0gPSAwKTsKLSAgICAgICAgICAgICAgICAgICAgdm9pZCAgICAgICAgc2VuZENvbmZpZ0V2ZW50X2woaW50IGV2ZW50LCBpbnQgcGFyYW0gPSAwKTsKLSAgICAgICAgICAgICAgICAgICAgdm9pZCAgICAgICAgcHJvY2Vzc0NvbmZpZ0V2ZW50cygpOwotICAgICAgICAgICAgICAgICAgICBhdWRpb19pb19oYW5kbGVfdCBpZCgpIGNvbnN0IHsgcmV0dXJuIG1JZDt9Ci0gICAgICAgICAgICAgICAgICAgIGJvb2wgICAgICAgIHN0YW5kYnkoKSBjb25zdCB7IHJldHVybiBtU3RhbmRieTsgfQotICAgICAgICAgICAgICAgICAgICB1aW50MzJfdCAgICBkZXZpY2UoKSBjb25zdCB7IHJldHVybiBtRGV2aWNlOyB9Ci0gICAgICAgIHZpcnR1YWwgICAgIGF1ZGlvX3N0cmVhbV90KiBzdHJlYW0oKSA9IDA7Ci0KLSAgICAgICAgICAgICAgICAgICAgc3A8RWZmZWN0SGFuZGxlPiBjcmVhdGVFZmZlY3RfbCgKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb25zdCBzcDxBdWRpb0ZsaW5nZXI6OkNsaWVudD4mIGNsaWVudCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb25zdCBzcDxJRWZmZWN0Q2xpZW50PiYgZWZmZWN0Q2xpZW50LAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGludDMyX3QgcHJpb3JpdHksCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaW50IHNlc3Npb25JZCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBlZmZlY3RfZGVzY3JpcHRvcl90ICpkZXNjLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGludCAqZW5hYmxlZCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzdGF0dXNfdCAqc3RhdHVzKTsKLSAgICAgICAgICAgICAgICAgICAgdm9pZCBkaXNjb25uZWN0RWZmZWN0KGNvbnN0IHNwPCBFZmZlY3RNb2R1bGU+JiBlZmZlY3QsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb25zdCB3cDxFZmZlY3RIYW5kbGU+JiBoYW5kbGUsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBib29sIHVucGluSWZMYXN0KTsKLQotICAgICAgICAgICAgICAgICAgICAvLyByZXR1cm4gdmFsdWVzIGZvciBoYXNBdWRpb1Nlc3Npb24gKGJpdCBmaWVsZCkKLSAgICAgICAgICAgICAgICAgICAgZW51bSBlZmZlY3Rfc3RhdGUgewotICAgICAgICAgICAgICAgICAgICAgICAgRUZGRUNUX1NFU1NJT04gPSAweDEsICAgLy8gdGhlIGF1ZGlvIHNlc3Npb24gY29ycmVzcG9uZHMgdG8gYXQgbGVhc3Qgb25lCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyBlZmZlY3QKLSAgICAgICAgICAgICAgICAgICAgICAgIFRSQUNLX1NFU1NJT04gPSAweDIgICAgIC8vIHRoZSBhdWRpbyBzZXNzaW9uIGNvcnJlc3BvbmRzIHRvIGF0IGxlYXN0IG9uZQotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gdHJhY2sKLSAgICAgICAgICAgICAgICAgICAgfTsKLQotICAgICAgICAgICAgICAgICAgICAvLyBnZXQgZWZmZWN0IGNoYWluIGNvcnJlc3BvbmRpbmcgdG8gc2Vzc2lvbiBJZC4KLSAgICAgICAgICAgICAgICAgICAgc3A8RWZmZWN0Q2hhaW4+IGdldEVmZmVjdENoYWluKGludCBzZXNzaW9uSWQpOwotICAgICAgICAgICAgICAgICAgICAvLyBzYW1lIGFzIGdldEVmZmVjdENoYWluKCkgYnV0IG11c3QgYmUgY2FsbGVkIHdpdGggVGhyZWFkQmFzZSBtdXRleCBsb2NrZWQKLSAgICAgICAgICAgICAgICAgICAgc3A8RWZmZWN0Q2hhaW4+IGdldEVmZmVjdENoYWluX2woaW50IHNlc3Npb25JZCk7Ci0gICAgICAgICAgICAgICAgICAgIC8vIGFkZCBhbiBlZmZlY3QgY2hhaW4gdG8gdGhlIGNoYWluIGxpc3QgKG1FZmZlY3RDaGFpbnMpCi0gICAgICAgIHZpcnR1YWwgICAgIHN0YXR1c190IGFkZEVmZmVjdENoYWluX2woY29uc3Qgc3A8RWZmZWN0Q2hhaW4+JiBjaGFpbikgPSAwOwotICAgICAgICAgICAgICAgICAgICAvLyByZW1vdmUgYW4gZWZmZWN0IGNoYWluIGZyb20gdGhlIGNoYWluIGxpc3QgKG1FZmZlY3RDaGFpbnMpCi0gICAgICAgIHZpcnR1YWwgICAgIHNpemVfdCByZW1vdmVFZmZlY3RDaGFpbl9sKGNvbnN0IHNwPEVmZmVjdENoYWluPiYgY2hhaW4pID0gMDsKLSAgICAgICAgICAgICAgICAgICAgLy8gbG9jayBhbGwgZWZmZWN0IGNoYWlucyBNdXRleGVzLiBNdXN0IGJlIGNhbGxlZCBiZWZvcmUgcmVsZWFzaW5nIHRoZQotICAgICAgICAgICAgICAg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qgc3A8RWZmZWN0TW9kdWxlPiYgZWZmZWN0LAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBib29sIGVuYWJsZWQsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGludCBzZXNzaW9uSWQgPSBBVURJT19TRVNTSU9OX09VVFBVVF9NSVgpOwotICAgICAgICAgICAgICAgICAgICB2b2lkIGNoZWNrU3VzcGVuZE9uRWZmZWN0RW5hYmxlZF9sKGNvbnN0IHNwPEVmZmVjdE1vZHVsZT4mIGVmZmVjdCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBib29sIGVuYWJsZWQsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaW50IHNlc3Npb25JZCA9IEFVRElPX1NFU1NJT05fT1VUUFVUX01JWCk7Ci0gICAgICAgIG11dGFibGUgICAgIE11dGV4ICAgICAgICAgICAgICAgICAgIG1Mb2NrOwotCi0gICAgcHJvdGVjdGVkOgotCi0gICAgICAgICAgICAgICAgICAgIC8vIGVudHJ5IGRlc2NyaWJpbmcgYW4gZWZmZWN0IGJlaW5nIHN1c3BlbmRlZCBpbiBtU3VzcGVuZGVkU2Vzc2lvbnMga2V5ZWQgdmVjdG9yCi0gICAgICAgICAgICAgICAgICAgIGNsYXNzIFN1c3BlbmRlZFNlc3Npb25EZXNjIDogcHVibGljIFJlZkJhc2UgewotICAgICAgICAgICAgICAgICAgICBwdWJsaWM6Ci0gICAgICAgICAgICAgICAgICAgICAgICBTdXNwZW5kZWRTZXNzaW9uRGVzYygpIDogbVJlZkNvdW50KDApIHt9Ci0KLSAgICAgICAgICAgICAgICAgICAgICAgIGludCBtUmVmQ291bnQ7ICAgICAgICAgIC8vIG51bWJlciBvZiBhY3RpdmUgc3VzcGVuZCByZXF1ZXN0cwotICAgICAgICAgICAgICAgICAgICAgICAgZWZmZWN0X3V1aWRfdCBtVHlwZTsgICAgLy8gZWZmZWN0IHR5cGUgVVVJRAotICAgICAgICAgICAgICAgICAgICB9OwotCi0gICAgICAgICAgICAgICAgICAgIHZvaWQgICAgICAgIGFjcXVpcmVXYWtlTG9jaygpOwotICAgICAgICAgICAgICAgICAgICB2b2lkICAgICAgICBhY3F1aXJlV2FrZUxvY2tfbCgpOwotICAgICAgICAgICAgICAgICAgICB2b2lkICAgICAgICByZWxlYXNlV2FrZUxvY2soKTsKLSAgICAgICAgICAgICAgICAgICAgdm9pZCAgICAgICAgcmVsZWFzZVdha2VMb2NrX2woKTsKLSAgICAgICAgICAgICAgICAgICAgdm9pZCBzZXRFZmZlY3RTdXNwZW5kZWRfbChjb25zdCBlZmZlY3RfdXVpZF90ICp0eXBlLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJvb2wgc3VzcGVuZCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpbnQgc2Vzc2lvbklkID0gQVVESU9fU0VTU0lPTl9PVVRQVVRfTUlYKTsKLSAgICAgICAgICAgICAgICAgICAgLy8gdXBkYXRlZCBtU3VzcGVuZGVkU2Vzc2lvbnMgd2hlbiBhbiBlZmZlY3Qgc3VzcGVuZGVkIG9yIHJlc3RvcmVkCi0gICAgICAgICAgICAgICAgICAgIHZvaWQgICAgICAgIHVwZGF0ZVN1c3BlbmRlZFNlc3Npb25zX2woY29uc3QgZWZmZWN0X3V1aWRfdCAqdHlwZSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBib29sIHN1c3BlbmQsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaW50IHNlc3Npb25JZCk7Ci0gICAgICAgICAgICAgICAgICAgIC8vIGNoZWNrIGlmIHNvbWUgZWZmZWN0cyBtdXN0IGJlIHN1c3BlbmRlZCB3aGVuIGFuIGVmZmVjdCBjaGFpbiBpcyBhZGRlZAotICAgICAgICAgICAgICAgICAgICB2b2lkIGNoZWNrU3VzcGVuZE9uQWRkRWZmZWN0Q2hhaW5fbChjb25zdCBzcDxFZmZlY3RDaGFpbj4mIGNoYWluKTsKLQotICAgICAgICBmcmllbmQgY2xhc3MgQXVkaW9GbGluZ2VyOyAgICAgIC8vIGZvciBtRWZmZWN0Q2hhaW5zCi0KLSAgICAgICAgICAgICAgICAgICAgY29uc3QgdHlwZV90ICAgICAgICAgICAgbVR5cGU7Ci0KLSAgICAgICAgICAgICAgICAgICAgLy8gVXNlZCBieSBwYXJhbWV0ZXJzLCBjb25maWcgZXZlbnRzLCBhZGRUcmFja19sLCBleGl0Ci0gICAgICAgICAgICAgICAgICAgIENvbmRpdGlvbiAgICAgICAgICAgICAgIG1XYWl0V29ya0NWOwotCi0gICAgICAgICAgICAgICAgICAgIGNvbnN0IHNwPEF1ZGlvRmxpbmdlcj4gIG1BdWRpb0ZsaW5nZXI7Ci0gICAgICAgICAgICAgICAgICAgIHVpbnQzMl90ICAgICAgICAgICAgICAgIG1TYW1wbGVSYXRlOwotICAgICAgICAgICAgICAgICAgICBzaXplX3QgICAgICAgICAgICAgICAgICBtRnJhbWVDb3VudDsKLSAgICAgICAgICAgICAgICAgICAgdWludDMyX3QgICAgICAgICAgICAgICAgbUNoYW5uZWxNYXNrOwotICAgICAgICAgICAgICAgICAgICB1aW50MTZfdCAgICAgICAgICAgICAgICBtQ2hhbm5lbENvdW50OwotICAgICAgICAgICAgICAgICAgICBzaXplX3QgICAgICAgICAgICAgICAgICBtRnJhbWVTaXplOwotICAgICAgICAgICAgICAgICAgICBhdWRpb19mb3JtYXRfdCAgICAgICAgICBtRm9ybWF0OwotCi0gICAgICAgICAgICAgICAgICAgIC8vIFBhcmFtZXRlciBzZXF1ZW5jZSBieSBjbGllbnQ6IGJpbmRlciB0aHJlYWQgY2FsbGluZyBzZXRQYXJhbWV0ZXJzKCk6Ci0gICAgICAgICAgICAgICAgICAgIC8vICAxLiBMb2NrIG1Mb2NrCi0gICAgICAgICAgICAgICAgICAgIC8vICAyLiBBcHBlbmQgdG8gbU5ld1BhcmFtZXRlcnMKLSAgICAgICAgICAgICAgICAgICAgLy8gIDMuIG1XYWl0V29ya0NWLnNpZ25hbAotICAgICAgICAgICAgICAgICAgICAvLyAgNC4gbVBhcmFtQ29uZC53YWl0UmVsYXRpdmUgd2l0aCB0aW1lb3V0Ci0gICAgICAgICAgICAgICAgICAgIC8vICA1LiByZWFkIG1QYXJhbVN0YXR1cwotICAgICAgICAgICAgICAgICAgICAvLyAgNi4gbVdhaXRXb3JrQ1Yuc2lnbmFsCi0gICAgICAgICAgICAgICAgICAgIC8vICA3LiBVbmxvY2sKLSAgICAgICAgICAgICAgICAgICAgLy8KLSAgICAgICAgICAgICAgICAgICAgLy8gUGFyYW1ldGVyIHNlcXVlbmNlIGJ5IHNlcnZlcjogdGhyZWFkTG9vcCBjYWxsaW5nIGNoZWNrRm9yTmV3UGFyYW1ldGVyc19sKCk6Ci0gICAgICAgICAgICAgICAgICAgIC8vIDEuIExvY2sgbUxvY2sKLSAgICAgICAgICAgICAgICAgICAgLy8gMi4gSWYgdGhlcmUgaXMgYW4gZW50cnkgaW4gbU5ld1BhcmFtZXRlcnMgcHJvY2VlZCAuLi4KLSAgICAgICAgICAgICAgICAgICAgLy8gMi4gUmVhZCBmaXJzdCBlbnRyeSBpbiBtTmV3UGFyYW1ldGVycwotICAgICAgICAgICAgICAgICAgICAvLyAzLiBQcm9jZXNzCi0gICAgICAgICAgICAgICAgICAgIC8vIDQuIFJlbW92ZSBmaXJzdCBlbnRyeSBmcm9tIG1OZXdQYXJhbWV0ZXJzCi0gICAgICAgICAgICAgICAgICAgIC8vIDUuIFNldCBtUGFyYW1TdGF0dXMKLSAgICAgICAgICAgICAgICAgICAgLy8gNi4gbVBhcmFtQ29uZC5zaWduYWwKLSAgICAgICAgICAgICAgICAgICAgLy8gNy4gbVdhaXRXb3JrQ1Yud2FpdCB3aXRoIHRpbWVvdXQgKHRoaXMgaXMgdG8gYXZvaWQgb3ZlcndyaXRpbmcgbVBhcmFtU3RhdHVzKQotICAgICAgICAgICAgICAgICAgICAvLyA4LiBVbmxvY2sKLSAgICAgICAgICAgICAgICAgICAgQ29uZGl0aW9uICAgICAgICAgICAgICAgbVBhcmFtQ29uZDsKLSAgICAgICAgICAgICAgICAgICAgVmVjdG9yPFN0cmluZzg+ICAgICAgICAgbU5ld1BhcmFtZXRlcnM7Ci0gICAgICAgICAgICAgICAgICAgIHN0YXR1c190ICAgICAgICAgICAgICAgIG1QYXJhbVN0YXR1czsKLQotICAgICAgICAgICAgICAgICAgICBWZWN0b3I8Q29uZmlnRXZlbnQ+ICAgICBtQ29uZmlnRXZlbnRzOwotICAgICAgICAgICAgICAgICAgICBib29sICAgICAgICAgICAgICAgICAgICBtU3RhbmRieTsKLSAgICAgICAgICAgICAgICAgICAgY29uc3QgYXVkaW9faW9faGFuZGxlX3QgbUlkOwotICAgICAgICAgICAgICAgICAgICBWZWN0b3I8IHNwPEVmZmVjdENoYWluPiA+IG1FZmZlY3RDaGFpbnM7Ci0gICAgICAgICAgICAgICAgICAgIHVpbnQzMl90ICAgICAgICAgICAgICAgIG1EZXZpY2U7ICAgIC8vIG91dHB1dCBkZXZpY2UgZm9yIFBsYXliYWNrVGhyZWFkCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vIGlucHV0ICsgb3V0cHV0IGRldmljZXMgZm9yIFJlY29yZFRocmVhZAotICAgICAgICAgICAgICAgICAgICBzdGF0aWMgY29uc3QgaW50ICAgICAgICBrTmFtZUxlbmd0aCA9IDE2OyAgIC8vIHByY3RsKFBSX1NFVF9OQU1FKSBsaW1pdAotICAgICAgICAgICAgICAgICAgICBjaGFyICAgICAgICAgICAgICAgICAgICBtTmFtZVtrTmFtZUxlbmd0aF07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AgICAgZW51bSBtaXhlcl9zdGF0ZSB7Ci0gICAgICAgICAgICBNSVhFUl9JRExFLCAgICAgICAgICAgICAvLyBubyBhY3RpdmUgdHJhY2tzCi0gICAgICAgICAgICBNSVhFUl9UUkFDS1NfRU5BQkxFRCwgICAvLyBhdCBsZWFzdCBvbmUgYWN0aXZlIHRyYWNrLCBidXQgbm8gdHJhY2sgaGFzIGFueSBkYXRhIHJlYWR5Ci0gICAgICAgICAgICBNSVhFUl9UUkFDS1NfUkVBRFkgICAgICAvLyBhdCBsZWFzdCBvbmUgYWN0aXZlIHRyYWNrLCBhbmQgYXQgbGVhc3Qgb25lIHRyYWNrIGhhcyBkYXRhCi0gICAgICAgICAgICAvLyBzdGFuZGJ5IG1vZGUgZG9lcyBub3QgaGF2ZSBhbiBlbnVtIHZhbHVlCi0gICAgICAgICAgICAvLyBzdXNwZW5kIGJ5IGF1ZGlvIHBvbGljeSBtYW5hZ2VyIGlzIG9ydGhvZ29uYWwgdG8gbWl4ZXIgc3RhdGUKLSAgICAgICAgfTsKLQotICAgICAgICAvLyBwbGF5YmFjayB0cmFjawotICAgICAgICBjbGFzcyBUcmFjayA6IHB1YmxpYyBUcmFja0Jhc2UgewotICAgICAgICBwdWJsaWM6Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFRyYWNrKCAgUGxheWJhY2tUaHJlYWQgKnRocmVhZCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb25zdCBzcDxDbGllbnQ+JiBjbGllbnQsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYXVkaW9fc3RyZWFtX3R5cGVfdCBzdHJlYW1UeXBlLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHVpbnQzMl90IHNhbXBsZVJhdGUsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYXVkaW9fZm9ybWF0X3QgZm9ybWF0LAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHVpbnQzMl90IGNoYW5uZWxNYXNrLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGludCBmcmFtZUNvdW50LAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbnN0IHNwPElNZW1vcnk+JiBzaGFyZWRCdWZmZXIsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaW50IHNlc3Npb25JZCk7Ci0gICAgICAgICAgICB2aXJ0dWFsICAgICAgICAgICAgIH5UcmFjaygpOwotCi0gICAgICAgICAgICAgICAgICAgIHZvaWQgICAgICAgIGR1bXAoY2hhciogYnVmZmVyLCBzaXplX3Qgc2l6ZSk7Ci0gICAgICAgICAgICB2aXJ0dWFsIHN0YXR1c190ICAgIHN0YXJ0KHBpZF90IHRpZCk7Ci0gICAgICAgICAgICB2aXJ0dWFsIHZvaWQgICAgICAgIHN0b3AoKTsKLSAgICAgICAgICAgICAgICAgICAgdm9pZCAgICAgICAgcGF1c2UoKTsKLQotICAgICAgICAgICAgICAgICAgICB2b2lkICAgICAgICBmbHVzaCgpOwotICAgICAgICAgICAgICAgICAgICB2b2lkICAgICAgICBkZXN0cm95KCk7Ci0gICAgICAgICAgICAgICAgICAgIHZvaWQgICAgICAgIG11dGUoYm9vbCk7Ci0gICAgICAgICAgICAgICAgICAgIGludCBuYW1lKCkgY29uc3QgewotICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIG1OYW1lOwotICAgICAgICAgICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgICAgICAgICAgYXVkaW9fc3RyZWFtX3R5cGVfdCBzdHJlYW1UeXBlKCkgY29uc3QgewotICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIG1TdHJlYW1UeXBlOwotICAgICAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgICAgIHN0YXR1c190ICAgIGF0dGFjaEF1eEVmZmVjdChpbnQgRWZmZWN0SWQpOwotICAgICAgICAgICAgICAgICAgICB2b2lkICAgICAgICBzZXRBdXhCdWZmZXIoaW50IEVmZmVjdElkLCBpbnQzMl90ICpidWZmZXIpOwotICAgICAgICAgICAgICAgICAgICBpbnQzMl90ICAgICAqYXV4QnVmZmVyKCkgY29uc3QgeyByZXR1cm4gbUF1eEJ1ZmZlcjsgfQotICAgICAgICAgICAgICAgICAgICB2b2lkICAgICAgICBzZXRNYWluQnVmZmVyKGludDE2X3QgKmJ1ZmZlcikgeyBtTWFpbkJ1ZmZlciA9IGJ1ZmZlcjsgfQotICAgICAgICAgICAgICAgICAgICBpbnQxNl90ICAgICAqbWFpbkJ1ZmZlcigpIGNvbnN0IHsgcmV0dXJuIG1NYWluQnVmZmVyOyB9Ci0gICAgICAgICAgICAgICAgICAgIGludCAgICAgICAgIGF1eEVmZmVjdElkKCkgY29uc3QgeyByZXR1cm4gbUF1eEVmZmVjdElkOyB9Ci0KLSAgICAgICAgcHJvdGVjdGVkOgotICAgICAgICAgICAgLy8gZm9yIG51bWVyb3VzCi0gICAgICAgICAgICBmcmllbmQgY2xhc3MgUGxheWJhY2tUaHJlYWQ7Ci0gICAgICAgICAgICBmcmllbmQgY2xhc3MgTWl4ZXJUaHJlYWQ7Ci0gICAgICAgICAgICBmcmllbmQgY2xhc3MgRGlyZWN0T3V0cHV0VGhyZWFkOwotCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFRyYWNrKGNvbnN0IFRyYWNrJik7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFRyYWNrJiBvcGVyYXRvciA9IChjb25zdCBUcmFjayYpOwotCi0gICAgICAgICAgICAvLyBBdWRpb0J1ZmZlclByb3ZpZGVyIGludGVyZmFjZQotICAgICAgICAgICAgdmlydHVhbCBzdGF0dXNfdCBnZXROZXh0QnVmZmVyKEF1ZGlvQnVmZmVyUHJvdmlkZXI6OkJ1ZmZlciogYnVmZmVyLCBpbnQ2NF90IHB0cyA9IGtJbnZhbGlkUFRTKTsKLSAgICAgICAgICAgIC8vIHJlbGVhc2VCdWZmZXIoKSBub3Qgb3ZlcnJpZGRlbgotCi0gICAgICAgICAgICB2aXJ0dWFsIHVpbnQzMl90IGZyYW1lc1JlYWR5KCkgY29uc3Q7Ci0KLSAgICAgICAgICAgIGJvb2wgaXNNdXRlZCgpIGNvbnN0IHsgcmV0dXJuIG1NdXRlOyB9Ci0gICAgICAgICAgICBib29sIGlzUGF1c2luZygpIGNvbnN0IHsKLSAgICAgICAgICAgICAgICByZXR1cm4gbVN0YXRlID09IFBBVVNJTkc7Ci0gICAgICAgICAgICB9Ci0gICAgICAgICAgICBib29sIGlzUGF1c2VkKCkgY29uc3QgewotICAgICAgICAgICAgICAgIHJldHVybiBtU3RhdGUgPT0gUEFVU0VEOwotICAgICAgICAgICAgfQotICAgICAgICAgICAgYm9vbCBpc1JlYWR5KCkgY29uc3Q7Ci0gICAgICAgICAgICB2b2lkIHNldFBhdXNlZCgpIHsgbVN0YXRlID0gUEFVU0VEOyB9Ci0gICAgICAgICAgICB2b2lkIHJlc2V0KCk7Ci0KLSAgICAgICAgICAgIGJvb2wgaXNPdXRwdXRUcmFjaygpIGNvbnN0IHsKLSAgICAgICAgICAgICAgICByZXR1cm4gKG1TdHJlYW1UeXBlID09IEFVRElPX1NUUkVBTV9DTlQpOwotICAgICAgICAgICAgfQotCi0gICAgICAgIHB1YmxpYzoKLSAgICAgICAgICAgIHZpcnR1YWwgYm9vbCBpc1RpbWVkVHJhY2soKSBjb25zdCB7IHJldHVybiBmYWxzZTsgfQotICAgICAgICBwcm90ZWN0ZWQ6Ci0KLSAgICAgICAgICAgIC8vIHdlIGRvbid0IHJlYWxseSBuZWVkIGEgbG9jayBmb3IgdGhlc2UKLSAgICAgICAgICAgIHZvbGF0aWxlIGJvb2wgICAgICAgbU11dGU7Ci0gICAgICAgICAgICAvLyBGSUxMRUQgc3RhdGUgaXMgdXNlZCBmb3Igc3VwcHJlc3Npbmcgdm9sdW1lIHJhbXAgYXQgYmVnaW4gb2YgcGxheWluZwotICAgICAgICAgICAgZW51bSB7RlNfRklMTElORywgRlNfRklMTEVELCBGU19BQ1RJVkV9OwotICAgICAgICAgICAgbXV0YWJsZSB1aW50OF90ICAgICBtRmlsbGluZ1VwU3RhdHVzOwotICAgICAgICAgICAgaW50OF90ICAgICAgICAgICAgICBtUmV0cnlDb3VudDsKLSAgICAgICAgICAgIGNvbnN0IHNwPElNZW1vcnk+ICAgbVNoYXJlZEJ1ZmZlcjsKLSAgICAgICAgICAgIGJvb2wgICAgICAgICAgICAgICAgbVJlc2V0RG9uZTsKLSAgICAgICAgICAgIGNvbnN0IGF1ZGlvX3N0cmVhbV90eXBlX3QgbVN0cmVhbVR5cGU7Ci0gICAgICAgICAgICBpbnQgICAgICAgICAgICAgICAgIG1OYW1lOwotICAgICAgICAgICAgaW50MTZfdCAgICAgICAgICAgICAqbU1haW5CdWZmZXI7Ci0gICAgICAgICAgICBpbnQzMl90ICAgICAgICAgICAgICptQXV4QnVmZmVyOwotICAgICAgICAgICAgaW50ICAgICAgICAgICAgICAgICBtQXV4RWZmZWN0SWQ7Ci0gICAgICAgICAgICBib29sICAgICAgICAgICAgICAgIG1IYXNWb2x1bWVDb250cm9sbGVyOwotICAgICAgICB9OyAgLy8gZW5kIG9mIFRyYWNrCi0KLSAgICAgICAgY2xhc3MgVGltZWRUcmFjayA6IHB1YmxpYyBUcmFjayB7Ci0gICAgICAgICAgcHVibGljOgotICAgICAgICAgICAgc3RhdGljIHNwPFRpbWVkVHJhY2s+IGNyZWF0ZShQbGF5YmFja1RocmVhZCAqdGhyZWFkLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb25zdCBzcDxDbGllbnQ+JiBjbGllbnQsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGF1ZGlvX3N0cmVhbV90eXBlX3Qgc3RyZWFtVHlwZSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdWludDMyX3Qgc2FtcGxlUmF0ZSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYXVkaW9fZm9ybWF0X3QgZm9ybWF0LAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB1aW50MzJfdCBjaGFubmVsTWFzaywKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaW50IGZyYW1lQ291bnQsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbnN0IHNwPElNZW1vcnk+JiBzaGFyZWRCdWZmZXIsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGludCBzZXNzaW9uSWQpOwotICAgICAgICAgICAgflRpbWVkVHJhY2soKTsKLQotICAgICAgICAgICAgY2xhc3MgVGltZWRCdWZmZXIgewotICAgICAgICAgICAgICBwdWJsaWM6Ci0gICAgICAgICAgICAgICAgVGltZWRCdWZmZXIoKTsKLSAgICAgICAgICAgICAgICBUaW1lZEJ1ZmZlcihjb25zdCBzcDxJTWVtb3J5PiYgYnVmZmVyLCBpbnQ2NF90IHB0cyk7Ci0gICAgICAgICAgICAgICAgY29uc3Qgc3A8SU1lbW9yeT4mIGJ1ZmZlcigpIGNvbnN0IHsgcmV0dXJuIG1CdWZmZXI7IH0KLSAgICAgICAgICAgICAgICBpbnQ2NF90IHB0cygpIGNvbnN0IHsgcmV0dXJuIG1QVFM7IH0KLSAgICAgICAgICAgICAgICBpbnQgcG9zaXRpb24oKSBjb25zdCB7IHJldHVybiBtUG9zaXRpb247IH0KLSAgICAgICAgICAgICAgICB2b2lkIHNldFBvc2l0aW9uKGludCBwb3MpIHsgbVBvc2l0aW9uID0gcG9zOyB9Ci0gICAgICAgICAgICAgIHByaXZhdGU6Ci0gICAgICAgICAgICAgICAgc3A8SU1lbW9yeT4gbUJ1ZmZlcjsKLSAgICAgICAgICAgICAgICBpbnQ2NF90IG1QVFM7Ci0gICAgICAgICAgICAgICAgaW50IG1Qb3NpdGlvbjsKLSAgICAgICAgICAgIH07Ci0KLSAgICAgICAgICAgIHZpcnR1YWwgYm9vbCBpc1RpbWVkVHJhY2soKSBjb25zdCB7IHJldHVybiB0cnVlOyB9Ci0KLSAgICAgICAgICAgIHZpcnR1YWwgdWludDMyX3QgZnJhbWVzUmVhZHkoKSBjb25zdDsKLQotICAgICAgICAgICAgLy8gQXVkaW9CdWZmZXJQcm92aWRlciBpbnRlcmZhY2UKLSAgICAgICAgICAgIHZpcnR1YWwgc3RhdHVzX3QgZ2V0TmV4dEJ1ZmZlcihBdWRpb0J1ZmZlclByb3ZpZGVyOjpCdWZmZXIqIGJ1ZmZlciwgaW50NjRfdCBwdHMpOwotICAgICAgICAgICAgdmlydHVhbCB2b2lkIHJlbGVhc2VCdWZmZXIoQXVkaW9CdWZmZXJQcm92aWRlcjo6QnVmZmVyKiBidWZmZXIpOwotCi0gICAgICAgICAgICB2b2lkIHRpbWVkWWllbGRTYW1wbGVzKEF1ZGlvQnVmZmVyUHJvdmlkZXI6OkJ1ZmZlciogYnVmZmVyKTsKLSAgICAgICAgICAgIHZvaWQgdGltZWRZaWVsZFNpbGVuY2UodWludDMyX3QgbnVtRnJhbWVzLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBBdWRpb0J1ZmZlclByb3ZpZGVyOjpCdWZmZXIqIGJ1ZmZlcik7Ci0KLSAgICAgICAgICAgIHN0YXR1c190ICAgIGFsbG9jYXRlVGltZWRCdWZmZXIoc2l6ZV90IHNpemUsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNwPElNZW1vcnk+KiBidWZmZXIpOwotICAgICAgICAgICAgc3RhdHVzX3QgICAgcXVldWVUaW1lZEJ1ZmZlcihjb25zdCBzcDxJTWVtb3J5PiYgYnVmZmVyLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpbnQ2NF90IHB0cyk7Ci0gICAgICAgICAgICBzdGF0dXNfdCAgICBzZXRNZWRpYVRpbWVUcmFuc2Zvcm0oY29uc3QgTGluZWFyVHJhbnNmb3JtJiB4Zm9ybSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBUaW1lZEF1ZGlvVHJhY2s6OlRhcmdldFRpbWVsaW5lIHRhcmdldCk7Ci0gICAgICAgICAgICB2b2lkICAgICAgICB0cmltVGltZWRCdWZmZXJRdWV1ZV9sKCk7Ci0KLSAgICAgICAgICBwcml2YXRlOgotICAgICAgICAgICAgVGltZWRUcmFjayhQbGF5YmFja1RocmVhZCAqdGhyZWFkLAotICAgICAgICAgICAgICAgICAgICAgICBjb25zdCBzcDxDbGllbnQ+JiBjbGllbnQsCi0gICAgICAgICAgICAgICAgICAgICAgIGF1ZGlvX3N0cmVhbV90eXBlX3Qgc3RyZWFtVHlwZSwKLSAgICAgICAgICAgICAgICAgICAgICAgdWludDMyX3Qgc2FtcGxlUmF0ZSwKLSAgICAgICAgICAgICAgICAgICAgICAgYXVkaW9fZm9ybWF0X3QgZm9ybWF0LAotICAgICAgICAgICAgICAgICAgICAgICB1aW50MzJfdCBjaGFubmVsTWFzaywKLSAgICAgICAgICAgICAgICAgICAgICAgaW50IGZyYW1lQ291bnQsCi0gICAgICAgICAgICAgICAgICAgICAgIGNvbnN0IHNwPElNZW1vcnk+JiBzaGFyZWRCdWZmZXIsCi0gICAgICAgICAgICAgICAgICAgICAgIGludCBzZXNzaW9uSWQpOwotCi0gICAgICAgICAgICB1aW50NjRfdCAgICAgICAgICAgIG1Mb2NhbFRpbWVGcmVxOwotICAgICAgICAgICAgTGluZWFyVHJhbnNmb3JtICAgICBtTG9jYWxUaW1lVG9TYW1wbGVUcmFuc2Zvcm07Ci0gICAgICAgICAgICBzcDxNZW1vcnlEZWFsZXI+ICAgIG1UaW1lZE1lbW9yeURlYWxlcjsKLSAgICAgICAgICAgIFZlY3RvcjxUaW1lZEJ1ZmZlcj4gbVRpbWVkQnVmZmVyUXVldWU7Ci0gICAgICAgICAgICB1aW50OF90KiAgICAgICAgICAgIG1UaW1lZFNpbGVuY2VCdWZmZXI7Ci0gICAgICAgICAgICB1aW50MzJfdCAgICAgICAgICAgIG1UaW1lZFNpbGVuY2VCdWZmZXJTaXplOwotICAgICAgICAgICAgbXV0YWJsZSBNdXRleCAgICAgICBtVGltZWRCdWZmZXJRdWV1ZUxvY2s7Ci0gICAgICAgICAgICBib29sICAgICAgICAgICAgICAgIG1UaW1lZEF1ZGlvT3V0cHV0T25UaW1lOwotICAgICAgICAgICAgQ0NIZWxwZXIgICAgICAgICAgICBtQ0NIZWxwZXI7Ci0KLSAgICAgICAgICAgIE11dGV4ICAgICAgICAgICAgICAgbU1lZGlhVGltZVRyYW5zZm9ybUxvY2s7Ci0gICAgICAgICAgICBMaW5lYXJUcmFuc2Zvcm0gICAgIG1NZWRpYVRpbWVUcmFuc2Zvcm07Ci0gICAgICAgICAgICBib29sICAgICAgICAgICAgICAgIG1NZWRpYVRpbWVUcmFuc2Zvcm1WYWxpZDsKLSAgICAgICAgICAgIFRpbWVkQXVkaW9UcmFjazo6VGFyZ2V0VGltZWxpbmUgbU1lZGlhVGltZVRyYW5zZm9ybVRhcmdldDsKLSAgICAgICAgfTsKLQotCi0gICAgICAgIC8vIHBsYXliYWNrIHRyYWNrCi0gICAgICAgIGNsYXNzIE91dHB1dFRyYWNrIDogcHVibGljIFRyYWNrIHsKLSAgICAgICAgcHVibGljOgotCi0gICAgICAgICAgICBjbGFzcyBCdWZmZXI6IHB1YmxpYyBBdWRpb0J1ZmZlclByb3ZpZGVyOjpCdWZmZXIgewotICAgICAgICAgICAgcHVibGljOgotICAgICAgICAgICAgICAgIGludDE2X3QgKm1CdWZmZXI7Ci0gICAgICAgICAgICB9OwotCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIE91dHB1dFRyYWNrKFBsYXliYWNrVGhyZWFkICp0aHJlYWQsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgRHVwbGljYXRpbmdUaHJlYWQgKnNvdXJjZVRocmVhZCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB1aW50MzJfdCBzYW1wbGVSYXRlLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGF1ZGlvX2Zvcm1hdF90IGZvcm1hdCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB1aW50MzJfdCBjaGFubmVsTWFzaywKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpbnQgZnJhbWVDb3VudCk7Ci0gICAgICAgICAgICB2aXJ0dWFsICAgICAgICAgICAgIH5PdXRwdXRUcmFjaygpOwotCi0gICAgICAgICAgICB2aXJ0dWFsIHN0YXR1c190ICAgIHN0YXJ0KHBpZF90IHRpZCk7Ci0gICAgICAgICAgICB2aXJ0dWFsIHZvaWQgICAgICAgIHN0b3AoKTsKLSAgICAgICAgICAgICAgICAgICAgYm9vbCAgICAgICAgd3JpdGUoaW50MTZfdCogZGF0YSwgdWludDMyX3QgZnJhbWVzKTsKLSAgICAgICAgICAgICAgICAgICAgYm9vbCAgICAgICAgYnVmZmVyUXVldWVFbXB0eSgpIGNvbnN0IHsgcmV0dXJuIG1CdWZmZXJRdWV1ZS5zaXplKCkgPT0gMDsgfQotICAgICAgICAgICAgICAgICAgICBib29sICAgICAgICBpc0FjdGl2ZSgpIGNvbnN0IHsgcmV0dXJuIG1BY3RpdmU7IH0KLSAgICAgICAgICAgIGNvbnN0IHdwPFRocmVhZEJhc2U+JiB0aHJlYWQoKSBjb25zdCB7IHJldHVybiBtVGhyZWFkOyB9Ci0KLSAgICAgICAgcHJpdmF0ZToKLQotICAgICAgICAgICAgZW51bSB7Ci0gICAgICAgICAgICAgICAgTk9fTU9SRV9CVUZGRVJTID0gMHg4MDAwMDAwMSwgICAvLyBzYW1lIGluIEF1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lKGF1ZGlvX3N0cmVhbV90eXBlX3Qgc3RyZWFtKSBjb25zdDsKLQotICAgICAgICAgICAgICAgICAgICBzcDxUcmFjaz4gICBjcmVhdGVUcmFja19sKAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY29uc3Qgc3A8QXVkaW9GbGluZ2VyOjpDbGllbnQ+JiBjbGllbnQsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBhdWRpb19zdHJlYW1fdHlwZV90IHN0cmVhbVR5cGUsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB1aW50MzJfdCBzYW1wbGVSYXRlLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYXVkaW9fZm9ybWF0X3QgZm9ybWF0LAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdWludDMyX3QgY2hhbm5lbE1hc2ssCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpbnQgZnJhbWVDb3VudCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbnN0IHNwPElNZW1vcnk+JiBzaGFyZWRCdWZmZXIsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpbnQgc2Vzc2lvbklkLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYm9vbCBpc1RpbWVkLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc3RhdHVzX3QgKnN0YXR1cyk7Ci0KLSAgICAgICAgICAgICAgICAgICAgQXVkaW9TdHJlYW1PdXQqIGdldE91dHB1dCgpIGNvbnN0OwotICAgICAgICAgICAgICAgICAgICBBdWRpb1N0cmVhbU91dCogY2xlYXJPdXRwdXQoKTsKLSAgICAgICAgICAgICAgICAgICAgdmlydHVhbCBhdWRpb19zdHJlYW1fdCogc3RyZWFtKCk7Ci0KLSAgICAgICAgICAgICAgICAgICAgdm9pZCAgICAgICAgc3VzcGVuZCg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IGZvciBEVVBMSUNBVElORyBvbmx5Ci0gICAgICAgIHZpcnR1YWwgICAgIHZvaWQgICAgICAgIHNhdmVPdXRwdXRUcmFja3MoKSB7IH0KLSAgICAgICAgdmlydHVhbCAgICAgdm9pZCAgICAgICAgY2xlYXJPdXRwdXRUcmFja3MoKSB7IH0KLQotICAgICAgICAvLyBDYWNoZSB2YXJpb3VzIGNhbGN1bGF0ZWQgdmFsdWVzLCBhdCB0aHJlYWRMb29wKCkgZW50cnkgYW5kIGFmdGVyIGEgcGFyYW1ldGVyIGNoYW5nZQotICAgICAgICB2aXJ0dWFsICAgICB2b2lkICAgICAgICBjYWNoZVBhcmFtZXRlcnNfbCgpOwotCi0gICAgcHJpdmF0ZToKLQotICAgICAgICBmcmllbmQgY2xhc3MgQXVkaW9GbGluZ2VyOyAgICAgIC8vIGZvciBudW1lcm91cwotCi0gICAgICAgIFBsYXliYWNrVGhyZWFkKGNvbnN0IENsaWVudCYpOwotICAgICAgICBQbGF5YmFja1RocmVhZCYgb3BlcmF0b3IgPSAoY29uc3QgUGxheWJhY2tUaHJlYWQmKTsKLQotICAgICAgICBzdGF0dXNfdCAgICBhZGRUcmFja19sKGNvbnN0IHNwPFRyYWNrPiYgdHJhY2spOwotICAgICAgICB2b2lkICAgICAgICBkZXN0cm95VHJhY2tfbChjb25zdCBzcDxUcmFjaz4mIHRyYWNrKTsKLSAgICAgICAgdm9pZCAgICAgICAgcmVtb3ZlVHJhY2tfbChjb25zdCBzcDxUcmFjaz4mIHRyYWNrKTsKLQotICAgICAgICB2b2lkICAgICAgICByZWFkT3V0cHV0UGFyYW1ldGVycygpOwotCi0gICAgICAgIHZpcnR1YWwgc3RhdHVzX3QgICAgZHVtcEludGVybmFscyhpbnQgZmQsIGNvbnN0IFZlY3RvcjxTdHJpbmcxNj4mIGFyZ3MpOwotICAgICAgICBzdGF0dXNfdCAgICBkdW1wVHJhY2tzKGludCBmZCwgY29uc3QgVmVjdG9yPFN0cmluZzE2PiYgYXJncyk7Ci0KLSAgICAgICAgU29ydGVkVmVjdG9yPCBzcDxUcmFjaz4gPiAgICAgICBtVHJhY2tzOwotICAgICAgICAvLyBtU3RyZWFtVHlwZXNbXSB1c2VzIDEgYWRkaXRpb25hbCBzdHJlYW0gdHlwZSBpbnRlcm5hbGx5IGZvciB0aGUgT3V0cHV0VHJhY2sgdXNlZCBieSBEdXBsaWNhdGluZ1RocmVhZAotICAgICAgICBzdHJlYW1fdHlwZV90ICAgICAgICAgICAgICAgICAgIG1TdHJlYW1UeXBlc1tBVURJT19TVFJFQU1fQ05UICsgMV07Ci0gICAgICAgIEF1ZGlvU3RyZWFtT3V0ICAgICAgICAgICAgICAgICAgKm1PdXRwdXQ7Ci0gICAgICAgIGZsb2F0ICAgICAgICAgICAgICAgICAgICAgICAgICAgbU1hc3RlclZvbHVtZTsKLSAgICAgICAgbnNlY3NfdCAgICAgICAgICAgICAgICAgICAgICAgICBtTGFzdFdyaXRlVGltZTsKLSAgICAgICAgaW50ICAgICAgICAgICAgICAgICAgICAgICAgICAgICBtTnVtV3JpdGVzOwotICAgICAgICBpbnQgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1OdW1EZWxheWVkV3JpdGVzOwotICAgICAgICBib29sICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1JbldyaXRlOwotCi0gICAgICAgIC8vIEZJWE1FIHJlbmFtZSB0aGVzZSBmb3JtZXIgbG9jYWwgdmFyaWFibGVzIG9mIHRocmVhZExvb3AgdG8gc3RhbmRhcmQgIm0iIG5hbWVzCi0gICAgICAgIG5zZWNzX3QgICAgICAgICAgICAgICAgICAgICAgICAgc3RhbmRieVRpbWU7Ci0gICAgICAgIHNpemVfdCAgICAgICAgICAgICAgICAgICAgICAgICAgbWl4QnVmZmVyU2l6ZTsKLQotICAgICAgICAvLyBjYWNoZWQgY29waWVzIG9mIGFjdGl2ZVNsZWVwVGltZVVzKCkgYW5kIGlkbGVTbGVlcFRpbWVVcygpIG1hZGUgYnkgY2FjaGVQYXJhbWV0ZXJzX2woKQotICAgICAgICB1aW50MzJfdCAgICAgICAgICAgICAgICAgICAgICAgIGFjdGl2ZVNsZWVwVGltZTsKLSAgICAgICAgdWludDMyX3QgICAgICAgICAgICAgICAgICAgICAgICBpZGxlU2xlZXBUaW1lOwotCi0gICAgICAgIHVpbnQzMl90ICAgICAgICAgICAgICAgICAgICAgICAgc2xlZXBUaW1lOwotCi0gICAgICAgIC8vIG1peGVyIHN0YXR1cyByZXR1cm5lZCBieSBwcmVwYXJlVHJhY2tzX2woKQotICAgICAgICBtaXhlcl9zdGF0ZSAgICAgICAgICAgICAgICAgICAgIG1NaXhlclN0YXR1czsgICAgICAgLy8gY3VycmVudCBjeWNsZQotICAgICAgICBtaXhlcl9zdGF0ZSAgICAgICAgICAgICAgICAgICAgIG1QcmV2TWl4ZXJTdGF0dXM7ICAgLy8gcHJldmlvdXMgY3ljbGUKLQotICAgICAgICAvLyBGSVhNRSBtb3ZlIHRoZXNlIGRlY2xhcmF0aW9ucyBpbnRvIHRoZSBzcGVjaWZpYyBzdWItY2xhc3MgdGhhdCBuZWVkcyB0aGVtCi0gICAgICAgIC8vIE1JWEVSIG9ubHkKLSAgICAgICAgYm9vbCAgICAgICAgICAgICAgICAgICAgICAgICAgICBsb25nU3RhbmRieUV4aXQ7Ci0gICAgICAgIHVpbnQzMl90ICAgICAgICAgICAgICAgICAgICAgICAgc2xlZXBUaW1lU2hpZnQ7Ci0KLSAgICAgICAgLy8gc2FtZSBhcyBBdWRpb0ZsaW5nZXI6Om1TdGFuZGJ5VGltZUluTnNlY3MgZXhjZXB0IGZvciBESVJFQ1Qgd2hpY2ggdXNlcyBhIHNob3J0ZXIgdmFsdWUKLSAgICAgICAgbnNlY3NfdCAgICAgICAgICAgICAgICAgICAgICAgICBzdGFuZGJ5RGVsYXk7Ci0KLSAgICAgICAgLy8gTUlYRVIgb25seQotICAgICAgICBuc2Vjc190ICAgICAgICAgICAgICAgICAgICAgICAgIG1heFBlcmlvZDsKLQot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2woKTsKLSAgICAgICAgdmlydHVhbCAgICAgdm9pZCAgICAgICAgZGVsZXRlVHJhY2tOYW1lX2woaW50IG5hbWUpOwotICAgICAgICB2aXJ0dWFsICAgICB1aW50MzJfdCAgICBpZGxlU2xlZXBUaW1lVXMoKTsKLSAgICAgICAgdmlydHVhbCAgICAgdWludDMyX3QgICAgc3VzcGVuZFNsZWVwVGltZVVzKCk7Ci0gICAgICAgIHZpcnR1YWwgICAgIHZvaWQgICAgICAgIGNhY2hlUGFyYW1ldGVyc19sKCk7Ci0KLSAgICAgICAgLy8gdGhyZWFkTG9vcCBzbmlwcGV0cwotICAgICAgICB2aXJ0dWFsICAgICB2b2lkICAgICAgICB0aHJlYWRMb29wX21peCgpOwotICAgICAgICB2aXJ0dWFsICAgICB2b2lkICAgICAgICB0aHJlYWRMb29wX3NsZWVwVGltZSgpOwotCi0gICAgICAgICAgICAgICAgICAgIEF1ZGlvTWl4ZXIqIG1BdWRpb01peGVyOwotICAgIH07Ci0KLSAgICBjbGFzcyBEaXJlY3RPdXRwdXRUaHJlYWQgOiBwdWJsaWMgUGxheWJhY2tUaHJlYWQgewotICAgIHB1YmxpYzoKLQotICAgICAgICBEaXJlY3RPdXRwdXRUaHJlYWQgKGNvbnN0IHNwPEF1ZGlvRmxpbmdlcj4mIGF1ZGlvRmxpbmdlciwgQXVkaW9TdHJlYW1PdXQqIG91dHB1dCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBhdWRpb19pb19oYW5kbGVfdCBpZCwgdWludDMyX3QgZGV2aWNlKTsKLSAgICAgICAgdmlydHVhbCAgICAgICAgICAgICAgICAgfkRpcmVjdE91dHB1dFRocmVhZCgpOwotCi0gICAgICAgIC8vIFRocmVhZCB2aXJ0dWFscwotCi0gICAgICAgIHZpcnR1YWwgICAgIGJvb2wgICAgICAgIGNoZWNrRm9yTmV3UGFyYW1ldGVyc19sKCk7Ci0KLSAgICBwcm90ZWN0ZWQ6Ci0gICAgICAgIHZpcnR1YWwgICAg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ldHVybiBtV2FpdFRpbWVNczsgfQotICAgIHByb3RlY3RlZDoKLSAgICAgICAgdmlydHVhbCAgICAgdWludDMyX3QgICAgYWN0aXZlU2xlZXBUaW1lVXMoKTsKLQotICAgIHByaXZhdGU6Ci0gICAgICAgICAgICAgICAgICAgIGJvb2wgICAgICAgIG91dHB1dHNSZWFkeShjb25zdCBTb3J0ZWRWZWN0b3I8IHNwPE91dHB1dFRyYWNrPiA+ICZvdXRwdXRUcmFja3MpOwotICAgIHByb3RlY3RlZDoKLSAgICAgICAgLy8gdGhyZWFkTG9vcCBzbmlwcGV0cwotICAgICAgICB2aXJ0dWFsICAgICB2b2lkICAgICAgICB0aHJlYWRMb29wX21peCgpOwotICAgICAgICB2aXJ0dWFsICAgICB2b2lkICAgICAgICB0aHJlYWRMb29wX3NsZWVwVGltZSgpOwotICAgICAgICB2aXJ0dWFsICAgICB2b2lkICAgICAgICB0aHJlYWRMb29wX3dyaXRlKCk7Ci0gICAgICAgIHZpcnR1YWwgICAgIHZvaWQgICAgICAgIHRocmVhZExvb3Bfc3RhbmRieSgpOwotICAgICAgICB2aXJ0dWFsICAgICB2b2lkICAgICAgICBjYWNoZVBhcmFtZXRlcnNfbCgpOwotCi0gICAgcHJpdmF0ZToKLSAgICAgICAgLy8gY2FsbGVkIGZyb20gdGhyZWFkTG9vcCwgYWRkT3V0cHV0VHJhY2ssIHJlbW92ZU91dHB1dFRyYWNrCi0gICAgICAgIHZpcnR1YWwgICAgIHZvaWQgICAgICAgIHVwZGF0ZVdhaXRUaW1lX2woKTsKLSAgICBwcm90ZWN0ZWQ6Ci0gICAgICAgIHZpcnR1YWwgICAgIHZvaWQgICAgICAgIHNhdmVPdXRwdXRUcmFja3MoKTsKLSAgICAgICAgdmlydHVhbCAgICAgdm9pZCAgICAgICAgY2xlYXJPdXRwdXRUcmFja3MoKTsKLSAgICBwcml2YXRlOgotCi0gICAgICAgICAgICAgICAgICAgIHVpbnQzMl90ICAgIG1XYWl0VGltZU1zOwotIC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mZpZ0NoYW5nZWRfbChpbnQgZXZlbnQsIGF1ZGlvX2lvX2hhbmRsZV90IGlvSGFuZGxlLCBjb25zdCB2b2lkICpwYXJhbTIpOwotCi0gICAgICAgICAgICAgIC8vIGFsbG9jYXRlIGFuIGF1ZGlvX2lvX2hhbmRsZV90LCBzZXNzaW9uIElELCBvciBlZmZlY3QgSUQKLSAgICAgICAgICAgICAgdWludDMyX3QgbmV4dFVuaXF1ZUlkKCk7Ci0KLSAgICAgICAgICAgICAgc3RhdHVzX3QgbW92ZUVmZmVjdENoYWluX2woaW50IHNlc3Npb25JZCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBQbGF5YmFja1RocmVhZCAqc3JjVGhyZWFkLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFBsYXliYWNrVGhyZWFkICpkc3RUaHJlYWQsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYm9vbCByZVJlZ2lzdGVyKTsKLSAgICAgICAgICAgICAgLy8gcmV0dXJuIHRocmVhZCBhc3NvY2lhdGVkIHdpdGggcHJpbWFyeSBoYXJkd2FyZSBkZXZpY2UsIG9yIE5VTEwKLSAgICAgICAgICAgICAgUGxheWJhY2tUaHJlYWQgKnByaW1hcnlQbGF5YmFja1RocmVhZF9sKCkgY29uc3Q7Ci0gICAgICAgICAgICAgIHVpbnQzMl90IHByaW1hcnlPdXRwdXREZXZpY2VfbCgpIGNvbnN0OwotCi0gICAgLy8gc2VydmVyIHNpZGUgb2YgdGhlIGNsaWVudCdzIElBdWRpb1RyYWNrCi0gICAgY2xhc3MgVHJhY2tIYW5kbGUgOiBwdWJsaWMgYW5kcm9pZDo6Qm5BdWRpb1RyYWNrIHsKLSAgICBwdWJsaWM6Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgVHJhY2tIYW5kbGUoY29uc3Qgc3A8UGxheWJhY2tUaHJlYWQ6OlRyYWNrPiYgdHJhY2spOwotICAgICAgICB2aXJ0dWFsICAgICAgICAgICAgIH5UcmFja0hhbmRsZSgpOwotICAgICAgICB2aXJ0dWFsIHNwPElNZW1vcnk+IGdldENibGsoKSBjb25zdDsKLSAgICAgICAgdmlydHVhbCBzdGF0dXNfdCAgICBzdGFydChwaWRfdCB0aWQpOwotICAgICAgICB2aXJ0dWFsIHZvaWQgICAgICAgIHN0b3AoKTsKLSAgICAgICAgdmlydHVhbCB2b2lkICAgICAgICBmbHVzaCgpOwotICAgICAgICB2aXJ0dWFsIHZvaWQgICAgICAgIG11dGUoYm9vbCk7Ci0gICAgICAgIHZpcnR1YWwgdm9pZCAgICAgICAgcGF1c2UoKTsKLSAgICAgICAgdmlydHVhbCBzdGF0dXNfdCAgICBhdHRhY2hBdXhFZmZlY3QoaW50IGVmZmVjdElkKTsKLSAgICAgICAgdmlydHVhbCBzdGF0dXNfdCAgICBhbGxvY2F0ZVRpbWVkQnVmZmVyKHNpemVfdCBzaXplLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc3A8SU1lbW9yeT4qIGJ1ZmZlcik7Ci0gICAgICAgIHZpcnR1YWwgc3RhdHVzX3QgICAgcXVldWVUaW1lZEJ1ZmZlcihjb25zdCBzcDxJTWVtb3J5PiYgYnVmZmVyLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaW50NjRfdCBwdHMpOwotICAgICAgICB2aXJ0dWFsIHN0YXR1c190ICAgIHNldE1lZGlhVGltZVRyYW5zZm9ybShjb25zdCBMaW5lYXJUcmFuc2Zvcm0mIHhmb3JtLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpbnQgdGFyZ2V0KTsKLSAgICAgICAgdmlydHVhbCBzdGF0dXNfdCBvblRyYW5zYWN0KAotICAgICAgICAgICAgdWludDMyX3QgY29kZSwgY29uc3QgUGFyY2VsJiBkYXRhLCBQYXJjZWwqIHJlcGx5LCB1aW50MzJfdCBmbGFncyk7Ci0gICAgcHJpdmF0ZToKLSAgICAgICAgY29uc3Qgc3A8UGxheWJhY2tUaHJlYWQ6OlRyYWNrPiBtVHJhY2s7Ci0gICAgfTsKLQotICAgICAgICAgICAgICAgIHZvaWQgICAgICAgIHJlbW92ZUNsaWVudF9sKHBpZF90IHBpZCk7Ci0gICAgICAgICAgICAgICAgdm9pZCAgICAgICAgcmVtb3ZlTm90aWZpY2F0aW9uQ2xpZW50KHBpZF90IHBpZCk7Ci0KLQotICAgIC8vIHJlY29yZCB0aHJlYWQKLSAgICBjbGFzcyBSZWNvcmRUaHJlYWQgOiBwdWJsaWMgVGhyZWFkQmFzZSwgcHVibGljIEF1ZGlvQnVmZmVyUHJvdmlkZXIKLSAgICB7Ci0gICAgcHVibGljOgotCi0gICAgICAgIC8vIHJlY29yZCB0cmFjawotICAgICAgICBjbGFzcyBSZWNvcmRUcmFjayA6IHB1YmxpYyBUcmFja0Jhc2UgewotICAgICAgICBwdWJsaWM6Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFJlY29yZFRyYWNrKFJlY29yZFRocmVhZCAqdGhyZWFkLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbnN0IHNwPENsaWVudD4mIGNsaWVudCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB1aW50MzJfdCBzYW1wbGVSYXRlLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGF1ZGlvX2Zvcm1hdF90IGZvcm1hdCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB1aW50MzJfdCBjaGFubmVsTWFzaywKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpbnQgZnJhbWVDb3VudCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpbnQgc2Vzc2lvbklkKTsKLSAgICAgICAgICAgIHZpcnR1YWwgICAgICAgICAgICAgflJlY29yZFRyYWNrKCk7Ci0KLSAgICAgICAgICAgIHZpcnR1YWwgc3RhdHVzX3QgICAgc3RhcnQocGlkX3QgdGlkKTsKLSAgICAgICAgICAgIHZpcnR1YWwgdm9pZCAgICAgICAgc3RvcCgpOwotCi0gICAgICAgICAgICAgICAgICAgIGJvb2wgICAgICAgIG92ZXJmbG93KCkgeyBib29sIHRtcCA9IG1PdmVyZmxvdzsgbU92ZXJmbG93ID0gZmFsc2U7IHJldHVybiB0bXA7IH0KLSAgICAgICAgICAgICAgICAgICAgYm9vbCAgICAgICAgc2V0T3ZlcmZsb3coKSB7IGJvb2wgdG1wID0gbU92ZXJmbG93OyBtT3ZlcmZsb3cgPSB0cnVlOyByZXR1cm4gdG1wOyB9Ci0KLSAgICAgICAgICAgICAgICAgICAgdm9pZCAgICAgICAgZHVtcChjaGFyKiBidWZmZXIsIHNpemVfdCBzaXplKTsKLQotICAgICAgICBwcml2YXRlOgotICAgICAgICAgICAgZnJpZW5kIGNsYXNzIEF1ZGlvRmxpbmdlcjsgIC8vIGZvciBtU3RhdGUKLQotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBSZWNvcmRUcmFjayhjb25zdCBSZWNvcmRUcmFjayYpOwotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBSZWNvcmRUcmFjayYgb3BlcmF0b3IgPSAoY29uc3QgUmVjb3JkVHJhY2smKTsKLQotICAgICAgICAgICAgLy8gQXVkaW9CdWZmZXJQcm92aWRlciBpbnRlcmZhY2UKLSAgICAgICAgICAgIHZpcnR1YWwgc3RhdHVzX3QgZ2V0TmV4dEJ1ZmZlcihBdWRpb0J1ZmZlclByb3ZpZGVyOjpCdWZmZXIqIGJ1ZmZlciwgaW50NjRfdCBwdHMgPSBrSW52YWxpZFBUUyk7Ci0gICAgICAgICAgICAvLyByZWxlYXNlQnVmZmVyKCkgbm90IG92ZXJyaWRkZW4KLQotICAgICAgICAgICAgYm9vbCAgICAgICAgICAgICAgICBtT3ZlcmZsb3c7Ci0gICAgICAgIH07Ci0KLQotICAgICAgICAgICAgICAgIFJlY29yZFRocmVhZChjb25zdCBzcDxBdWRpb0ZsaW5nZXI+JiBhdWRpb0ZsaW5nZXIsCi0gICAgICAgICAgICAgICAgICAgICAgICBBdWRpb1N0cmVhbUluICppbnB1dCwKLSAgICAgICAgICAgICAgICAgICAgICAgIHVpbnQzMl90IHNhbXBsZVJhdGUsCi0gICAgICAgICAgICAgICAgICAgICAgICB1aW50MzJfdCBjaGFubmVscywKLSAgICAgICAgICAgICAgICAgICAgICAgIGF1ZGlvX2lvX2hhbmRsZV90IGlkLAotICAgICAgICAgICAgICAgICAgICAgICAgdWludDMyX3QgZGV2aWNlKTsKLSAgICAgICAgICAgICAgICB2aXJ0dWFsICAgICB+UmVjb3JkVGhyZWFkKCk7Ci0KLSAgICAgICAgLy8gVGhyZWFkCi0gICAgICAgIHZpcnR1YWwgYm9vbCAgICAgICAgdGhyZWFkTG9vcCgpOwotICAgICAgICB2aXJ0dWFsIHN0YXR1c190ICAgIHJlYWR5VG9SdW4oKTsKLQotICAgICAgICAvLyBSZWZCYXNlCi0gICAgICAgIHZpcnR1YWwgdm9pZCAgICAgICAgb25GaXJzdFJlZigpOwotCi0gICAgICAgIHZpcnR1YWwgc3RhdHVzX3QgICAgaW5pdENoZWNrKCkgY29uc3QgeyByZXR1cm4gKG1JbnB1dCA9PSBOVUxMKSA/IE5PX0lOSVQgOiBOT19FUlJPUjsgfQotICAgICAgICAgICAgICAgIHNwPEF1ZGlvRmxpbmdlcjo6UmVjb3JkVGhyZWFkOjpSZWNvcmRUcmFjaz4gIGNyZWF0ZVJlY29yZFRyYWNrX2woCi0gICAgICAgICAgICAgICAgICAgICAgICBjb25zdCBzcDxBdWRpb0ZsaW5nZXI6OkNsaWVudD4mIGNsaWVudCwKLSAgICAgICAgICAgICAgICAgICAgICAgIHVpbnQzMl90IHNhbXBsZVJhdGUsCi0gICAgICAgICAgICAgICAgICAgICAgICBhdW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ib29sICAgICAgICBjaGVja0Zvck5ld1BhcmFtZXRlcnNfbCgpOwotICAgICAgICB2aXJ0dWFsIFN0cmluZzggICAgIGdldFBhcmFtZXRlcnMoY29uc3QgU3RyaW5nOCYga2V5cyk7Ci0gICAgICAgIHZpcnR1YWwgdm9pZCAgICAgICAgYXVkaW9Db25maWdDaGFuZ2VkX2woaW50IGV2ZW50LCBpbnQgcGFyYW0gPSAwKTsKLSAgICAgICAgICAgICAgICB2b2lkICAgICAgICByZWFkSW5wdXRQYXJhbWV0ZXJzKCk7Ci0gICAgICAgIHZpcnR1YWwgdW5zaWduZWQgaW50ICBnZXRJbnB1dEZyYW1lc0xvc3QoKTsKLQotICAgICAgICB2aXJ0dWFsIHN0YXR1c190IGFkZEVmZmVjdENoYWluX2woY29uc3Qgc3A8RWZmZWN0Q2hhaW4+JiBjaGFpbik7Ci0gICAgICAgIHZpcnR1YWwgc2l6ZV90IHJlbW92ZUVmZmVjdENoYWluX2woY29uc3Qgc3A8RWZmZWN0Q2hhaW4+JiBjaGFpbik7Ci0gICAgICAgIHZpcnR1YWwgdWludDMyX3QgaGFzQXVkaW9TZXNzaW9uKGludCBzZXNzaW9uSWQpOwotICAgICAgICAgICAgICAgIFJlY29yZFRyYWNrKiB0cmFjaygpOwotCi0gICAgcHJpdmF0ZToKLSAgICAgICAgICAgICAgICBSZWNvcmRUaHJlYWQoKTsKLSAgICAgICAgICAgICAgICBBdWRpb1N0cmVhbUluICAgICAgICAgICAgICAgICAgICAgICAqbUlucHV0OwotICAgICAgICAgICAgICAgIFJlY29yZFRyYWNrKiAgICAgICAgICAgICAgICAgICAgICAgIG1UcmFjazsKLSAgICAgICAgICAgICAgICBzcDxSZWNvcmRUcmFjaz4gICAgICAgICAgICAgICAgICAgICBtQWN0aXZlVHJhY2s7Ci0gICAgICAgICAgICAgICAgQ29uZGl0aW9uICAgICAgICAgICAgICAgICAgICAgICAgICAgbVN0YXJ0U3RvcENvbmQ7Ci0gICAgICAgICAgICAgICAgQXVkaW9SZXNhbXBsZXIgICAgICAgICAgICAgICAgICAgICAgKm1SZXNhbXBsZXI7Ci0gICAgICAgICAgICAgICAgaW50MzJfdCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKm1Sc21wT3V0QnVmZmVyOwotICAgICAgICAgICAgICAgIGludDE2X3QgICAgICAgICAgICAgICAgICAgICAgICAgICAgICptUnNtcEluQnVmZmVyOwotICAgICAgICAgICAgICAgIHNpemVfdCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1Sc21wSW5JbmRleDsKLSAgICAgICAgICAgICAgICBzaXplX3QgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBtSW5wdXRCeXRlczsKLSAgICAgICAgICAgICAgICBjb25zdCBpbnQgICAgICAgICAgICAgICAgICAgICAgICAgICBtUmVxQ2hhbm5lbENvdW50OwotICAgICAgICAgICAgICAgIGNvbnN0IHVpbnQzMl90ICAgICAgICAgICAgICAgICAgICAgIG1SZXFTYW1wbGVSYXRlOwotICAgICAgICAgICAgICAgIHNzaXplX3QgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1CeXRlc1JlYWQ7Ci0gICAgfTsKLQotICAgIC8vIHNlcnZlciBzaWRlIG9mIHRoZSBjbGllbnQncyBJQXVkaW9SZWNvcmQKLSAgICBjbGFzcyBSZWNvcmRIYW5kbGUgOiBwdWJsaWMgYW5kcm9pZDo6Qm5BdWRpb1JlY29yZCB7Ci0gICAgcHVibGljOgotICAgICAgICBSZWNvcmRIYW5kbGUoY29uc3Qgc3A8UmVjb3JkVGhyZWFkOjpSZWNvcmRUcmFjaz4mIHJlY29yZFRyYWNrKTsKLSAgICAgICAgdmlydHVhbCAgICAgICAgICAgICB+UmVjb3JkSGFuZGxlKCk7Ci0gICAgICAgIHZpcnR1YWwgc3A8SU1lbW9yeT4gZ2V0Q2JsaygpIGNvbnN0OwotICAgICAgICB2aXJ0dWFsIHN0YXR1c190ICAgIHN0YXJ0KHBpZF90IHRpZCk7Ci0gICAgICAgIH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IHNlc3Npb25JZCk7Ci0gICAgICAgIHZpcnR1YWwgfkVmZmVjdE1vZHVsZSgpOwotCi0gICAgICAgIGVudW0gZWZmZWN0X3N0YXRlIHsKLSAgICAgICAgICAgIElETEUsCi0gICAgICAgICAgICBSRVNUQVJULAotICAgICAgICAgICAgU1RBUlRJTkcsCi0gICAgICAgICAgICBBQ1RJVkUsCi0gICAgICAgICAgICBTVE9QUElORywKLSAgICAgICAgICAgIFNUT1BQRUQsCi0gICAgICAgICAgICBERVNUUk9ZRUQKLSAgICAgICAgfTsKLQotICAgICAgICBpbnQgICAgICAgICBpZCgpIGNvbnN0IHsgcmV0dXJuIG1JZDsgfQotICAgICAgICB2b2lkIHByb2Nlc3MoKTsKLSAgICAgICAgdm9pZCB1cGRhdGVTdGF0ZSgpOwotICAgICAgICBzdGF0dXNfdCBjb21tYW5kKHVpbnQzMl90IGNtZENvZGUsCi0gICAgICAgICAgICAgICAgICAgICAgICAgdWludDMyX3QgY21kU2l6ZSwKLSAgICAgICAgICAgICAgICAgICAgICAgICB2b2lkICpwQ21kRGF0YSwKLSAgICAgICAgICAgICAgICAgICAgICAgICB1aW50MzJfdCAqcmVwbHlTaXplLAotICAgICAgICAgICAgICAgICAgICAgICAgIHZvaWQgKnBSZXBseURhdGEpOwotCi0gICAgICAgIHZvaWQgcmVzZXRfbCgpOwotICAgICAgICBzdGF0dXNfdCBjb25maWd1cmUoKTsKLSAgICAgICAgc3RhdHVzX3QgaW5pdCgpOwotICAgICAgICBlZmZlY3Rfc3RhdGUgc3RhdGUoKSBjb25zdCB7Ci0gICAgICAgICAgICByZXR1cm4gbVN0YXRlOwotICAgICAgICB9Ci0gICAgICAgIHVpbnQzMl90IHN0YXR1cygpIHsKLSAgICAgICAgICAgIHJldHVybiBtU3RhdHVzOwotICAgICAgICB9Ci0gICAgICAgIGludCBzZXNzaW9uSWQoKSBjb25zdCB7Ci0gICAgICAgICAgICByZXR1cm4gbVNlc3Npb25JZDsKLSAgICAgICAgfQotICA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LSAgICAgICAgdmlydHVhbCBzdGF0dXNfdCBjb21tYW5kKHVpbnQzMl90IGNtZENvZGUsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB1aW50MzJfdCBjbWRTaXplLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdm9pZCAqcENtZERhdGEsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB1aW50MzJfdCAqcmVwbHlTaXplLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdm9pZCAqcFJlcGx5RGF0YSk7Ci0gICAgICAgIHZpcnR1YWwgdm9pZCBkaXNjb25uZWN0KCk7Ci0gICAgcHJpdmF0ZToKLSAgICAgICAgICAgICAgICB2b2lkIGRpc2Nvbm5lY3QoYm9vbCB1bnBpbklmTGFzdCk7Ci0gICAgcHVibGljOgotICAgICAgICB2aXJ0dWFsIHNwPElNZW1vcnk+IGdldENibGsoKSBjb25zdCB7IHJldHVybiBtQ2Jsa01lbW9yeTsgfQotICAgICAgICB2aXJ0dWFsIHN0YXR1c190IG9uVHJhbnNhY3QodWludDMyX3QgY29kZSwgY29uc3QgUGFyY2VsJiBkYXRhLAotICAgICAgICAgICAgICAgIFBhcmNlbCogcmVwbHksIHVpbnQzMl90IGZsYWdzKTsKLQotCi0gICAgICAgIC8vIEdpdmUgb3IgdGFrZSBjb250cm9sIG9mIGVmZmVjdCBtb2R1bGUKLSAgICAgICAgLy8gLSBoYXNDb250cm9sOiB0cnVlIGlmIGNvbnRyb2wgaXMgZ2l2ZW4sIGZhbHNlIGlmIHJlbW92ZWQKLSAgICAgICAgLy8gLSBzaWduYWw6IHRydWUgY2xpZW50IGFwcCBzaG91bGQgYmUgc2lnbmFsZWQgb2YgY2hhbmdlLCBmYWxzZSBvdGhlcndpc2UKLSAgICAgICAgLy8gLSBlbmFibGVkOiBzdGF0ZSBvZiB0aGUgZWZmZWN0IHdoZW4gY29udHJvbCBpcyBwYXNzZWQKLSAgICAgICAgdm9pZCBzZXRDb250cm9sKGJvb2wgaGFzQ29udHJvbCwgYm9vbCBzaWduYWwsIGJvb2wgZW5hYmxlZCk7Ci0gICAgICAgIHZvaWQgY29tbWFuZEV4ZWN1dGVkKHVpbnQzMl90IGNtZENvZGUsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgIHVpbnQzMl90IGNtZFNpemUsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZvaWQgKnBDbWREYXRhLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICB1aW50MzJfdCByZXBseVNpemUsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZvaWQgKnBSZXBseURhdGEpOwotICAgICAgICB2b2lkIHNldEVuYWJsZWQoYm9vbCBlbmFibGVkKTsKLSAgICAgICAgYm9vbCBlbmFibGVkKCkgY29uc3QgeyByZXR1cm4gbUVuYWJsZWQ7IH0KLQotICAgICAgICAvLyBHZXR0ZXJzCi0gICAgICAgIGludCBpZCgpIGNvbnN0IHsgcmV0dXJuIG1FZmZlY3QtPmlkKCk7IH0KLSAgICAgICAgaW50IHByaW9yaXR5KCkgY29uc3QgeyByZXR1cm4gbVByaW9yaXR5OyB9Ci0gICAgICAgIGJvb2wgaGFzQ29udHJvbCgpIGNvbnN0IHsgcmV0dXJuIG1IYXNDb250cm9sOyB9Ci0gICAgICAgIHNwPEVmZmVjdE1vZHVsZT4gZWZmZWN0KCkgY29uc3QgeyByZXR1cm4gbUVmZmVjdDsgfQotCi0gICAgICAgIHZvaWQgZHVtcChjaGFyKiBidWZmZXIsIHNpemVfdCBzaXplKTsKLQotICAgIHByb3RlY3RlZDoKLSAgICAgICAgZnJpZW5kIGNsYXNzIEF1ZGlvRmxpbmdlcjsgICAgICAgICAgLy8gZm9yIG1FZmZlY3QsIG1IYXNDb250cm9sLCBtRW5hYmxlZAotICAgICAgICBFZmZlY3RIYW5kbGUoY29uc3QgRWZmZWN0SGFuZGxlJik7Ci0gICAgICAgIEVmZmVjdEhhbmRsZSYgb3B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dGhhdCB3b3VsZCBjbHV0dGVyIHRoZSBjb2RlIHVubmVjZXNzYXJpbHkuCi0KLSAgICBzdHJ1Y3QgQXVkaW9TdHJlYW1PdXQgewotICAgICAgICBhdWRpb19od19kZXZpY2VfdCogIGNvbnN0IGh3RGV2OwotICAgICAgICBhdWRpb19zdHJlYW1fb3V0X3QqIGNvbnN0IHN0cmVhbTsKLQotICAgICAgICBBdWRpb1N0cmVhbU91dChhdWRpb19od19kZXZpY2VfdCAqZGV2LCBhdWRpb19zdHJlYW1fb3V0X3QgKm91dCkgOgotICAgICAgICAgICAgaHdEZXYoZGV2KSwgc3RyZWFtKG91dCkge30KLSAgICB9OwotCi0gICAgc3RydWN0IEF1ZGlvU3RyZWFtSW4gewotICAgICAgICBhdWRpb19od19kZXZpY2VfdCogY29uc3QgaHdEZXY7Ci0gICAgICAgIGF1ZGlvX3N0cmVhbV9pbl90KiBjb25zdCBzdHJlYW07Ci0KLSAgICAgICAgQXVkaW9TdHJlYW1JbihhdWRpb19od19kZXZpY2VfdCAqZGV2LCBhdWRpb19zdHJlYW1faW5fdCAqaW4pIDoKLSAgICAgICAgICAgIGh3RGV2KGRldiksIHN0cmVhbShpbikge30KLSAgICB9OwotCi0gICAgLy8gZm9yIG1BdWRpb1Nlc3Npb25SZWZzIG9ubHkKLSAgICBzdHJ1Y3QgQXVkaW9TZXNzaW9uUmVmIHsKLSAgICAgICAgQXVkaW9TZXNzaW9uUmVmKGludCBzZXNzaW9uaWQsIHBpZF90IHBpZCkgOgotICAgICAgICAgICAgbVNlc3Npb25pZChzZXNzaW9uaWQpLCBtUGlkKHBpZCksIG1DbnQoMSkge30KLSAgICAgICAgY29uc3QgaW50ICAgbVNlc3Npb25pZDsKLSAgICAgICAgY29uc3QgcGlkX3QgbVBpZDsKLSAgICAgICAgaW50ICAgICAgICAgbUNudDsKLSAgICB9OwotCi0gICAgZW51bSBtYXN0ZXJfdm9sdW1lX3N1cHBvcnQgewotICAgICAgICAvLyBNVlNfTk9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ICBNVlNfRlVMTCwKLSAgICB9OwotCi0gICAgbXV0YWJsZSAgICAgTXV0ZXggICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbUxvY2s7Ci0KLSAgICAgICAgICAgICAgICBEZWZhdWx0S2V5ZWRWZWN0b3I8IHBpZF90LCB3cDxDbGllbnQ+ID4gICAgIG1DbGllbnRzOyAgIC8vIHNlZSB+Q2xpZW50KCkKLQotICAgICAgICAgICAgICAgIG11dGFibGUgICAgIE11dGV4ICAgICAgICAgICAgICAgICAgIG1IYXJkd2FyZUxvY2s7Ci0KLSAgICAgICAgICAgICAgICAvLyBUaGVzZSB0d28gZmllbGRzIGFyZSBpbW11dGFibGUgYWZ0ZXIgb25GaXJzdFJlZigpLCBzbyBubyBsb2NrIG5lZWRlZCB0byBhY2Nlc3MKLSAgICAgICAgICAgICAgICBhdWRpb19od19kZXZpY2VfdCogICAgICAgICAgICAgICAgICBtUHJpbWFyeUhhcmR3YXJlRGV2OyAvLyBtQXVkaW9Id0RldnNbMF0gb3IgTlVMTAotICAgICAgICAgICAgICAgIFZlY3RvcjxhdWRpb19od19kZXZpY2VfdCo+ICAgICAgICAgIG1BdWRpb0h3RGV2czsKLQotICAgIC8vIGZvciBkdW1wLCBpbmRpY2F0ZXMgd2hpY2ggaGFyZHdhcmUgb3BlcmF0aW9uIGlzIGN1cnJlbnRseSBpbiBwcm9ncmVzcyAoYnV0IG5vdCBzdHJlYW0gb3BzKQotICAgIGVudW0gaGFyZHdhcmVfY2FsbF9zdGF0ZSB7Ci0gICAgICAgIEFVRElPX0hXX0lETEUgPSAwLCAgICAgICAgICAgICAgLy8gbm8gb3BlcmF0aW9uIGluIHByb2dyZXNzCi0gICAgICAgIEFVRElPX0hXX0lOSVQsICAgICAgICAgICAgICAgICAgLy8gaW5pdF9jaGVjawotICAgICAgICBBVURJT19IV19PVVRQVVRfT1BFTiwgICAgICAgICAgIC8vIG9wZW5fb3V0cHV0X3N0cmVhbQotICAgICAgICBBVURJT19IV19PVVRQVVRfQ0xPU0UsICAgICAgICAgIC8vIHVudXNlZAotICAgICAgICBBVURJT19IV19JTlBVVF9PUEVOLCAgICAgICAgICAgIC8vIHVudXNlZAotICAgICAgICBBVURJT19IV19JTlBVVF9DTE9TRSwgICAgICAgICAgIC8vIHVudXNlZAotICAgICAgICBBVURJT19IV19TVEFOREJZLCAgICAgICAgICAgICAgIC8vIHVudXNlZAotICAgICAgICBBVURJT19IV19TRVRfTUFTVEVSX1ZPTFVNRSwgICAgIC8vIHNldF9tYXN0ZXJfdm9sdW1lCi0gICAgICAgIEFVRElPX0hXX0dFVF9ST1VUSU5HLCAgICAgICAgICAgLy8gdW51c2VkCi0gICAgICAgIEFVRElPX0hXX1NFVF9ST1VUSU5HLCAgICAgICAgICAgLy8gdW51c2VkCi0gICAgICAgIEFVRElPX0hXX0dFVF9NT0RFLCAgICAgICAgICAgICAgLy8gdW51c2VkCi0gICAgICAgIEFVRElPX0hXX1NFVF9NT0RFLCAgICAgICAgICAgICAgLy8gc2V0X21vZGUKLSAgICAgICAgQVVESU9fSFdfR0VUX01JQ19NVVRFLCAgICAgICAgICAvLyBnZXRfbWljX211dGUKLSAgICAgICAgQVVESU9fSFdfU0VUX01JQ19NVVRFLCAgICAgICAgICAvLyBzZXRfbWljX211dGUKLSAgICAgICAgQVVESU9fSFdfU0VUX1ZPSUNFX1ZPTFVNRSwgICAgICAvLyBzZXRfdm9pY2Vfdm9sdW1lCi0gICAgICAgIEFVRElPX0hXX1NFVF9QQVJBTUVURVIsICAgICAgICAgLy8gc2V0X3BhcmFtZXRlcnMKLSAgICAgICAgQVVESU9fSFdfR0VUX0lOUFVUX0JVRkZFUl9TSVpFLCAvLyBnZXRfaW5wdXRfYnVmZmVyX3NpemUKLSAgICAgICAgQVVESU9fSFdfR0VUX01BU1RFUl9WT0xVTUUsICAgICAvLyBnZXRfbWFzdGVyX3ZvbHVtZQotICAgICAgICBBVURJT19IV19HRVRfUEFSQU1FVEVSLCAgICAgICAgIC8vIGdldF9wYXJhbWV0ZXJzCi0gICAgfTsKLQotICAgIG11dGFibGUgICAgIGhhcmR3YXJlX2NhbGxfc3RhdGUgICAgICAgICAgICAgICAgIG1IYXJkd2FyZVN0YXR1czsgICAgLy8gZm9yIGR1bXAgb25seQotCi0KLSAgICAgICAgICAgICAgICBEZWZhdWx0S2V5ZWRWZWN0b3I8IGF1ZGlvX2lvX2hhbmRsZV90LCBzcDxQbGF5YmFja1RocmVhZD4gPiAgbVBsYXliYWNrVGhyZWFkczsKLSAgICAgICAgICAgICAgICBzdHJlYW1fdHlwZV90ICAgICAgICAgICAgICAgICAgICAgICBtU3RyZWFtVHlwZXNbQVVESU9fU1RSRUFNX0NOVF07Ci0KLSAgICAgICAgICAgICAgICAvLyBib3RoIGFyZSBwcm90ZWN0ZWQgYnkgbUxvY2sKLSAgICAgICAgICAgICAgICBmbG9hdCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBtTWFzdGVyVm9sdW1lOwotICAgICAgICAgICAgICAgIGZsb2F0ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1NYXN0ZXJWb2x1bWVTVzsKLSAgICAgICAgICAgICAgICBtYXN0ZXJfdm9sdW1lX3N1cHBvcnQgICAgICAgICAgICAgICBtTWFzdGVyVm9sdW1lU3VwcG9ydEx2bDsKLSAgICAgICAgICAgICAgICBib29sICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBtTWFzdGVyTXV0ZTsKLQotICAgICAgICAgICAgICAgIERlZmF1bHRLZXllZFZlY3RvcjwgYXVkaW9faW9faGFuZGxlX3QsIHNwPFJlY29yZFRocmVhZD4gPiAgICBtUmVjb3JkVGhyZWFkczsKLQotICAgICAgICAgICAgICAgIERlZmF1bHRLZXllZFZlY3RvcjwgcGlkX3QsIHNwPE5vdGlmaWNhdGlvbkNsaWVudD4gPiAgICBtTm90aWZpY2F0aW9uQ2xpZW50czsKLSAgICAgICAgICAgICAgICB2b2xhdGlsZSBpbnQzMl90ICAgICAgICAgICAgIC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ICAgIHVpbnQzMl90IGNoYW5uZWxDb3VudCA9IHBvcGNvdW50KG1hc2spOwotICAgICAgICAgICAgICAgIEFMT0dfQVNTRVJUKChjaGFubmVsQ291bnQgPD0gTUFYX05VTV9DSEFOTkVMUykgJiYgKGNoYW5uZWxDb3VudCksCi0gICAgICAgICAgICAgICAgICAgICAgICAiYmFkIGNoYW5uZWwgY291bnQgJXUiLCBjaGFubmVsQ291bnQpOwotICAgICAgICAgICAgICAgIHRyYWNrLmNoYW5uZWxNYXNrID0gbWFzazsKLSAgICAgICAgICAgICAgICB0cmFjay5jaGFubmVsQ291bnQgPSBjaGFubmVsQ291bnQ7Ci0gICAgICAgICAgICAgICAgQUxPR1YoInNldFBhcmFtZXRlcihUUkFDSywgQ0hBTk5FTF9NQVNLLCAleCkiLCBtYXNrKTsKLSAgICAgICAgICAgICAgICBpbnZhbGlkYXRlU3RhdGUoMSA8PCBuYW1lKTsKLSAgICAgICAgICAgIH0KLSAgICAgICAgICAgIH0gYnJlYWs7Ci0gICAgICAgIGNhc2UgTUFJTl9CVUZGRVI6Ci0gICAgICAgICAgICBpZiAodHJhY2subWFpbkJ1ZmZlciAhPSB2YWx1ZUJ1ZikgewotICAgICAgICAgICAgICAgIHRyYWNrLm1haW5CdWZmZXIgPSB2YWx1ZUJ1ZjsKLSAgICAgICAgICAgICAgICBBTE9HVigic2V0UGFyYW1ldGVyKFRSQUNLLCBNQUlOX0JVRkZFUiwgJXApIiwgdmFsdWVCdWYpOwotICAgICAgICAgICAgICAgIGludmFsaWRhdGVTdGF0ZSgxIDw8IG5hbWUpOwotICAgICAgICAgICAgfQotICAgICAgICAgICAgYnJlYWs7Ci0gICAgICAgIGNhc2UgQVVYX0JVRkZFUjoKLSAgICAgICAgICAgIGlmICh0cmFjay5hdXhCdWZmZXIgIT0gdmFsdWVCdWYpIHsKLSAgICAgICAgICAgICAgICB0cmFjay5hdXhCdWZmZXIgPSB2YWx1ZUJ1ZjsKLSAgICAgICAgICAgICAgICBBTE9HVigic2V0UGFyYW1ldGVyKFRSQUNLLCBBVVhfQlVGRkVSLCAlcCkiLCB2YWx1ZUJ1Zik7Ci0gICAgICAgICAgICAgICAgaW52YWxpZGF0ZVN0YXRlKDEgPDwgbmFtZSk7Ci0gICAgICAgICAgICB9Ci0gICAgICAgICAgICBicmVhazsKLSAgICAgICAgZGVmYXVsdDoKLSAgICAgICAgICAgIExPR19GQVRBTCgiYmFkIHBhcmFtIik7Ci0gICAgICAgIH0KLSAgICAgICAgYnJlYWs7Ci0KLSAgICBjYXNlIFJFU0FNUExFOgotICAgICAgICBzd2l0Y2ggKHBhcmFtKSB7Ci0gICAgICAgIGNhc2UgU0FNUExFX1JBVEU6Ci0gICAgICAgICAgICBBTE9HX0FTU0VSVCh2YWx1ZUludCA+IDAsICJiYWQgc2FtcGxlIHJhdGUgJWQiLCB2YWx1ZUludCk7Ci0gICAgICAgICAgICBpZiAodHJhY2suc2V0UmVzYW1wbGVyKHVpbnQzMl90KHZhbHVlSW50KSwgbVNhbXBsZVJhdGUpKSB7Ci0gICAgICAgICAgICAgICAgQUxPR1YoInNldFBhcmFtZXRlcihSRVNBTVBMRSwgU0FNUExFX1JBVEUsICV1KSIsCi0gICAgICAgICAgICAgICAgICAgICAgICB1aW50MzJfdCh2YWx1ZUludCkpOwotICAgICAgICAgICAgICAgIGludmFsaWRhdGVTdGF0ZSgxIDw8IG5hbWUpOwotICAgICAgICAgICAgfQotICAgICAgICAgICAgYnJlYWs7Ci0gICAgICAgIGNhc2UgUkVTRVQ6Ci0gICAgICAgICAgICB0cmFjay5yZXNldFJlc2FtcGxlcigpOwotICAgICAgICAgICAgaW52YWxpZGF0ZVN0YXRlKDEgPDwgbmFtZSk7Ci0gICAgICAgICAgICBicmVhazsKLSAgICAgICAgZGVmYXVsdDoKLSAgICAgICAgICAgIExPR19GQVRBTCgiYmFkIHBhcmFtIik7Ci0gICAgICAgIH0KLSAgICAgICAgYnJlYWs7Ci0KLSAgICBjYXNlIFJBTVBfVk9MVU1FOgotICAgIGNhc2UgVk9MVU1FOgotICAgICAgICBzd2l0Y2ggKHBhcmFtKSB7Ci0gICAgICAgIGNhc2UgVk9MVU1FMDoKLSAgICAgICAgY2FzZSBWT0xVTUUxOgotICAgICAgICAgICAgaWYgKHRyYWNrLnZvbHVtZVtwYXJhbS1WT0xVTUUwXSAhPSB2YWx1ZUludCkgewotICAgICAgICAgICAgICAgIEFMT0dWKCJzZXRQYXJhbWV0ZXIoVk9MVU1FLCBWT0xVTUUwLzE6ICUwNHgpIiwgdmFsdWVJbnQpOwotICAgICAgICAgICAgICAgIHRyYWNrLnByZXZWb2x1bWVbcGFyYW0tVk9MVU1FMF0gPSB0cmFjay52b2x1bWVbcGFyYW0tVk9MVU1FMF0gPDwgMTY7Ci0gICAgICAgICAgICAgICAgdHJhY2sudm9sdW1lW3BhcmFtLVZPTFVNRTBdID0gdmFsdWVJbnQ7Ci0gICAgICAgICAgICAgICAgaWYgKHRhcmdldCA9PSBWT0xVTUUpIHsKLSAgICAgICAgICAgICAgICAgICAgdHJhY2sucHJldlZvbHVtZVtwYXJhbS1WT0xVTUUwXSA9IHZhbHVlSW50IDw8IDE2OwotICAgICAgICAgICAgICAgICAgICB0cmFjay52b2x1bWVJbmNbcGFyYW0tVk9MVU1FMF0gPSAwOwotICAgICAgICAgICAgICAgIH0gZWxzZSB7Ci0gICAgICAgICAgICAgICAgICAgIGludDMyX3QgZCA9ICh2YWx1ZUludDw8MTYpIC0gdHJhY2sucHJldlZvbHVtZVtwYXJhbS1WT0xVTUUwXTsKLSAgICAgICAgICAgICAgICAgICAgaW50MzJfdCB2b2xJbmMgPSBkIC8gaW50MzJfdChtU3RhdGUuZnJhbWVDb3VudCk7Ci0gICAgICAgICAgICAgICAgICAgIHRyYWNrLnZvbHVtZUluY1twYXJhbS1WT0xVTUUwXSA9IHZvbEluYzsKLSAgICAgICAgICAgICAgICAgICAgaWYgKHZvbEluYyA9PSAwKSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICB0cmFjay5wcmV2Vm9sdW1lW3BhcmFtLVZPTFVNRTBdID0gdmFsdWVJbnQgPDwgMTY7Ci0gICAgICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgaW52YWxpZGF0ZVN0YXRlKDEgPDwgbmFtZSk7Ci0gICAgICAgICAgICB9Ci0gICAgICAgICAgICBicmVhazsKLSAgICAgICAgY2FzZSBBVVhMRVZFTDoKLSAgICAgICAgICAgIC8vQUxPR19BU1NFUlQoMCA8PSB2YWx1ZUludCAmJiB2YWx1ZUludCA8PSBNQVhfR0FJTl9JTlQsICJiYWQgYXV4IGxldmVsICVkIiwgdmFsdWVJbnQpOwotICAgICAgICAgICAgaWYgKHRyYWNrLmF1eExldmVsICE9IHZhbHVlSW50KSB7Ci0gICAgICAgICAgICAgICAgQUxPR1YoInNldFBhcmFtZXRlcihWT0xVTUUsIEFVWExFVkVMOiAlMDR4KSIsIHZhbHVlSW50KTsKLSAgICAgICAgICAgICAgICB0cmFjay5wcmV2QXV4TGV2ZWwgPSB0cmFjay5hdXhMZXZlbCA8PCAxNjsKLSAgICAgICAgICAgICAgICB0cmFjay5hdXhMZXZlbCA9IHZhbHVlSW50OwotICAgICAgICAgICAgICAgIGlmICh0YXJnZXQgPT0gVk9MVU1FKSB7Ci0gICAgICAgICAgICAgICAgICAgIHRyYWNrLnByZXZBdXhMZXZlbCA9IHZhbHVlSW50IDw8IDE2OwotICAgICAgICAgICAgICAgICAgICB0cmFjay5hdXhJbmMgPSAwOwotICAgICAgICAgICAgICAgIH0gZWxzZSB7Ci0gICAgICAgICAgICAgICAgICAgIGludDMyX3QgZCA9ICh2YWx1ZUludDw8MTYpIC0gdHJhY2sucHJldkF1eExldmVsOwotICAgICAgICAgICAgICAgICAgICBpbnQzMl90IHZvbEluYyA9IGQgLyBpbnQzMl90KG1TdGF0ZS5mcmFtZUNvdW50KTsKLSAgICAgICAgICAgICAgICAgICAgdHJhY2suYXV4SW5jID0gdm9sSW5jOwotICAgICAgICAgICAgICAgICAgICBpZiAodm9sSW5jID09IDApIHsKLSAgICAgICAgICAgICAgICAgICAgICAgIHRyYWNrLnByZXZBdXhMZXZlbCA9IHZhbHVlSW50IDw8IDE2OwotICAgICAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgIGludmFsaWRhdGVTdGF0ZSgxIDw8IG5hbWUpOwotICAgICAgICAgICAgfQotICAgICAgICAgICAgYnJlYWs7Ci0gICAgICAgIGRlZmF1bHQ6Ci0gICAgICAgICAgICBMT0dfRkFUQUwoImJhZCBwYXJhbSIpOwotICAgICAgICB9Ci0gICAgICAgIGJyZWFrOwotCi0gICAgZGVmYXVsdDoKLSAgICAgICAgTE9HX0ZBVEFMKCJiYWQgdGFyZ2V0Iik7Ci0gICAgfQotfQotCi1ib29sIEF1ZGlvTWl4ZXI6OnRyYWNrX3Q6OnNldFJlc2FtcGxlcih1aW50MzJfdCB2YWx1ZSwgdWludDMyX3QgZGV2U2FtcGxlUmF0ZSkKLXsKLSAgICBpZiAodmFsdWUhPWRldlNhbXBsZVJhdGUgfHwgcmVzYW1wbGVyKSB7Ci0gICAgICAgIGlmIChzYW1wbGVSYXRlICE9IHZhbHVlKSB7Ci0gICAgICAgICAgICBzYW1wbGVSYXRlID0gdmFsdWU7Ci0gICAgICAgICAgICBpZiAocmVzYW1wbGVyID09IE5VTEwpIHsKLSAgICAgICAgICAgICAgICByZXNhbXBsZXIgPSBBdWRpb1Jlc2FtcGxlcjo6Y3JlYXRlKAotICAgICAgICAgICAgICAgICAgICAgICAgZm9ybWF0LCBjaGFubmVsQ291bnQsIGRldlNhbXBsZVJhdGUpOwotICAgICAgICAgICAgICAgIHJlc2FtcGxlci0+c2V0TG9jYWxUaW1lRnJlcShsb2NhbFRpbWVGcmVxKTsKLSAgICAgICAgICAgIH0KLSAgICAgICAgICAgIHJldHVybiB0cnVlOwotICAgICAgICB9Ci0gICAgfQotICAgIHJld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FCTEVEOwotICAgICAgICBpZiAodC5hdXhMZXZlbCAhPSAwICYmIHQuYXV4QnVmZmVyICE9IE5VTEwpIHsKLSAgICAgICAgICAgIG4gfD0gTkVFRFNfQVVYX0VOQUJMRUQ7Ci0gICAgICAgIH0KLQotICAgICAgICBpZiAodC52b2x1bWVJbmNbMF18dC52b2x1bWVJbmNbMV0pIHsKLSAgICAgICAgICAgIHZvbHVtZVJhbXAgPSB0cnVlOwotICAgICAgICB9IGVsc2UgaWYgKCF0LmRvZXNSZXNhbXBsZSgpICYmIHQudm9sdW1lUkwgPT0gMCkgewotICAgICAgICAgICAgbiB8PSBORUVEU19NVVRFX0VOQUJMRUQ7Ci0gICAgICAgIH0KLSAgICAgICAgdC5uZWVkcyA9IG47Ci0KLSAgICAgICAgaWYgKChuICYgTkVFRFNfTVVURV9fTUFTSykgPT0gTkVFRFNfTVVURV9FTkFCTEVEKSB7Ci0gICAgICAgICAgICB0Lmhvb2sgPSB0cmFja19fbm9wOwotICAgICAgICB9IGVsc2UgewotICAgICAgICAgICAgaWYgKChuICYgTkVFRFNfQVVYX19NQVNLKSA9PSBORUVEU19BVVhfRU5BQkxFRCkgewotICAgICAgICAgICAgICAgIGFsbDE2Qml0c1N0ZXJlb05vUmVzYW1wbGUgPSBmYWxzZTsKLSAgICAgICAgICAgIH0KLSAgICAgICAgICAgIGlmICgobiAmIE5FRURTX1JFU0FNUExFX19NQVNLKSA9PSBORUVEU19SRVNBTVBMRV9FTkFCTEVEKSB7Ci0gICAgICAgICAgICAgICAgYWxsMTZCaXRzU3RlcmVvTm9SZXNhbXBsZSA9IGZhbHNlOwotICAgICAgICAgICAgICAgIHJlc2FtcGxpbmcgPSB0cnVlOwotICAgICAgICAgICAgICAgIHQuaG9vayA9IHRyYWNrX19nZW5lcmljUmVzYW1wbGU7Ci0gICAgICAgICAgICB9IGVsc2UgewotICAgICAgICAgICAgICAgIGlmICgobiAmIE5FRURTX0NIQU5ORUxfQ09VTlRfX01BU0spID09IE5FRURTX0NIQU5ORUxfMSl7Ci0gICAgICAgICAgICAgICAgICAgIHQuaG9vayA9IHRyYWNrX18xNkJpdHNNb25vOwotICAgICAgICAgICAgICAgICAgICBhbGwxNkJpdHNTdGVyZW9Ob1Jlc2FtcGxlID0gZmFsc2U7Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgIGlmICgobiAmIE5FRURTX0NIQU5ORUxfQ09VTlRfX01BU0spID09IE5FRURTX0NIQU5ORUxfMil7Ci0gICAgICAgICAgICAgICAgICAgIHQuaG9vayA9IHRyYWNrX18xNkJpdHNTdGVyZW87Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgfQotICAgICAgICB9Ci0gICAgfQotCi0gICAgLy8gc2VsZWN0IHRoZSBwcm9jZXNzaW5nIGhvb2tzCi0gICAgc3RhdGUtPmhvb2sgPSBwcm9jZXNzX19ub3A7Ci0gICAgaWYgKGNvdW50QWN0aXZlVHJhY2tzKSB7Ci0gICAgICAgIGlmIChyZXNhbXBsaW5nKSB7Ci0gICAgICAgICAgICBpZiAoIXN0YXRlLT5vdXRwdXRUZW1wKSB7Ci0gICAgICAgICAgICAgICAgc3RhdGUtPm91dHB1dFRlbXAgPSBuZXcgaW50MzJfdFtNQVhfTlVNX0NIQU5ORUxTICogc3RhdGUtPmZyYW1lQ291bnRdOwotICAgICAgICAgICAgfQotICAgICAgICAgICAgaWYgKCFzdGF0ZS0+cmVzYW1wbGVUZW1wKSB7Ci0gICAgICAgICAgICAgICAgc3RhdGUtPnJlc2FtcGxlVGVtcCA9IG5ldyBpbnQzMl90W01BWF9OVU1fQ0hBTk5FTFMgKiBzdGF0ZS0+ZnJhbWVDb3VudF07Ci0gICAgICAgICAgICB9Ci0gICAgICAgICAgICBzdGF0ZS0+aG9vayA9IHByb2Nlc3NfX2dlbmVyaWNSZXNhbXBsaW5nOwotICAgICAgICB9IGVsc2UgewotICAgICAgICAgICAgaWYgKHN0YXRlLT5vdXRwdXRUZW1wKSB7Ci0gIC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m9pZCBBdWRpb01peGVyOjp2b2x1bWVSYW1wU3RlcmVvKHRyYWNrX3QqIHQsIGludDMyX3QqIG91dCwgc2l6ZV90IGZyYW1lQ291bnQsIGludDMyX3QqIHRlbXAsIGludDMyX3QqIGF1eCkKLXsKLSAgICBpbnQzMl90IHZsID0gdC0+cHJldlZvbHVtZVswXTsKLSAgICBpbnQzMl90IHZyID0gdC0+cHJldlZvbHVtZVsxXTsKLSAgICBjb25zdCBpbnQzMl90IHZsSW5jID0gdC0+dm9sdW1lSW5jWzBdOwotICAgIGNvbnN0IGludDMyX3QgdnJJbmMgPSB0LT52b2x1bWVJbmNbMV07Ci0KLSAgICAvL0FMT0dEKCJbMF0gJXA6IGluYz0lZiwgdjA9JWYsIHYxPSVkLCBmaW5hbD0lZiwgY291bnQ9JWQiLAotICAgIC8vICAgICAgICB0LCB2bEluYy82NTUzNi4wZiwgdmwvNjU1MzYuMGYsIHQtPnZvbHVtZVswXSwKLSAgICAvLyAgICAgICAodmwgKyB2bEluYypmcmFtZUNvdW50KS82NTUzNi4wZiwgZnJhbWVDb3VudCk7Ci0KLSAgICAvLyByYW1wIHZvbHVtZQotICAgIGlmIChDQ19VTkxJS0VMWShhdXggIT0gTlVMTCkpIHsKLSAgICAgICAgaW50MzJfdCB2YSA9IHQtPnByZXZBdXhMZXZlbDsKLSAgICAgICAgY29uc3QgaW50MzJfdCB2YUluYyA9IHQtPmF1eEluYzsKLSAgICAgICAgaW50MzJfdCBsOwotICAgICAgICBpbnQzMl90IHI7Ci0KLSAgICAgICAgZG8gewotICAgICAgICAgICAgbCA9ICgqdGVtcCsrID4+IDEyKTsKLSAgICAgICAgICAgIHIgPSAoKnRlbXArKyA+PiAxMik7Ci0gICAgICAgICAgICAqb3V0KysgKz0gKHZsID4+IDE2KSAqIGw7Ci0gICAgICAgICAgICAqb3V0KysgKz0gKHZyID4+IDE2KSAqIHI7Ci0gICAgICAgICAgICAqYXV4KysgKz0gKHZhID4+IDE3KSAqIChsICsgcik7Ci0gICAgICAgICAgICB2bCArPSB2bEluYzsKLSAgICAgICAgICAgIHZyICs9IHZySW5jOwotICAgICAgICAgICAgdmEgKz0gdmFJbmM7Ci0gICAgICAgIH0gd2hpbGUgKC0tZnJhbWVDb3VudCk7Ci0gICAgICAgIHQtPnByZXZBdXhMZXZlbCA9IHZhOwotICAgIH0gZWxzZSB7Ci0gICAgICAgIGRvIHsKLSAgICAgICAgICAgICpvdXQrKyArPSAodmwgPj4gMTYpICogKCp0ZW1wKysgPj4gMTIpOwotICAgICAgICAgICAgKm91dCsrICs9ICh2ciA+PiAxNikgKiAoKnRlbXArKyA+PiAxMik7Ci0gICAgICAgICAgICB2bCArPSB2bEluYzsKLSAgICAgICAgICAgIHZyICs9IHZySW5jOwotICAgICAgICB9IHdoaWxlICgtLWZyYW1lQ291bnQpOwotICAgIH0KLSAgICB0LT5wcmV2Vm9sdW1lWzBdID0gdmw7Ci0gICAgdC0+cHJldlZvbHVtZVsxXSA9IHZyOwotICAgIHQtPmFkanVzdFZvbHVtZVJhbXAoYXV4ICE9IE5VTEwpOwotfQotCi12b2lkIEF1ZGlvTWl4ZXI6OnZvbHVtZVN0ZXJlbyh0cmFja190KiB0LCBpbnQzMl90KiBvdXQsIHNpemVfdCBmcmFtZUNvdW50LCBpbnQzMl90KiB0ZW1wLCBpbnQzMl90KiBhdXgpCi17Ci0gICAgY29uc3QgaW50MTZfdCB2bCA9IHQtPnZvbHVtZVswXTsKLSAgICBjb25zdCBpbnQxNl90IHZyID0gdC0+dm9sdW1lWzFdOwotCi0gICAgaWYgKENDX1VOTElLRUxZKGF1eCAhPSBOVUxMKSkgewotICAgICAgICBjb25zdCBpbnQxNl90IHZhID0gdC0+YXV4TGV2ZWw7Ci0gICAgICAgIGRvIHsKLSAgICAgICAgICAgIGludDE2X3QgbCA9IChpbnQxNl90KSgqdGVtcCsrID4+IDEyKTsKLSAgICAgICAgICAgIGludDE2X3QgciA9IChpbnQxNl90KSgqdGVtcCsrID4+IDEyKTsKLSAgICAgICAgICAgIG91dFswXSA9IG11bEFkZChsLCB2bCwgb3V0WzBdKTsKLSAgICAgICAgICAgIGludDE2X3QgYSA9IChpbnQxNl90KSgoKGludDMyX3QpbCArIHIpID4+IDEpOwotICAgICAgICAgICAgb3V0WzFdID0gbXVsQWRkKHIsIHZyLCBvdXRbMV0pOwotICAgICAgICAgICAgb3V0ICs9IDI7Ci0gICAgICAgICAgICBhdXhbMF0gPSBtdWxBZGQoYSwgdmEsIGF1eFswXSk7Ci0gICAgICAgICAgICBhdXgrKzsKLSAgICAgICAgfSB3aGlsZSAoLS1mcmFtZUNvdW50KTsKLSAgICB9IGVsc2UgewotICAgICAgICBkbyB7Ci0gICAgICAgICAgICBpbnQxNl90IGwgPSAoaW50MTZfdCkoKnRlbXArKyA+PiAxMik7Ci0gICAgICAgICAgICBpbnQxNl90IHIgPSAoaW50MTZfdCkoKnRlbXArKyA+PiAxMik7Ci0gICAgICAgICAgICBvdXRbMF0gPSBtdWxBZGQobCwgdmwsIG91dFswXSk7Ci0gICAgICAgICAgICBvdXRbMV0gPSBtdWxBZGQociwgdnIsIG91dFsxXSk7Ci0gICAgICAgICAgICBvdXQgKz0gMjsKLSAgICAgICAgfSB3aGlsZSAoLS1mcmFtZUNvdW50KTsKLSAgICB9Ci19Ci0KLXZvaWQgQXVkaW9NaXhlcjo6dHJhY2tfXzE2Qml0c1N0ZXJlbyh0cmFja190KiB0LCBpbnQzMl90KiBvdXQsIHNpemVfdCBmcmFtZUNvdW50LCBpbnQzMl90KiB0ZW1wLCBpbnQzMl90KiBhdXgpCi17Ci0gICAgY29uc3QgaW50MTZfdCAqaW4gPSBzdGF0aWNfY2FzdDxjb25zdCBpbnQxNl90ICo+KHQtPmluKTsKLQotICAgIGlmIChDQ19VTkxJS0VMWShhdXggIT0gTlVMTCkpIHsKLSAgICAgICAgaW50MzJfdCBsOwotICAgICAgICBpbnQzMl90IHI7Ci0gICAgICAgIC8vIHJhbXAgZ2FpbgotICAgICAgICBpZiAoQ0NfVU5MSUtFTFkodC0+dm9sdW1lSW5jWzBdfHQtPnZvbHVtZUluY1sxXXx0LT5hdXhJbmMpKSB7Ci0gICAgICAgICAgICBpbnQzMl90IHZsID0gdC0+cHJldlZvbHVtZVswXTsKLSAgICAgICAgICAgIGludDMyX3QgdnIgPSB0LT5wcmV2Vm9sdW1lWzFdOwotICAgICAgICAgICAgaW50MzJfdCB2YSA9IHQtPnByZXZBdXhMZXZlbDsKLSAgICAgICAgICAgIGNvbnN0IGludDMyX3QgdmxJbmMgPSB0LT52b2x1bWVJbmNbMF07Ci0gICAgICAgICAgICBjb25zdCBpbnQzMl90IHZySW5jID0gdC0+dm9sdW1lSW5jWzFdOwotICAgICAgICAgICAgY29uc3QgaW50MzJfdCB2YUluYyA9IHQtPmF1eEluYzsKLSAgICAgICAgICAgIC8vIEFMT0dEKCJbMV0gJXA6IGluYz0lZiwgdjA9JWYsIHYxPSVkLCBmaW5hbD0lZiwgY291bnQ9JWQiLAotICAgICAgICAgICAgLy8gICAgICAgIHQsIHZsSW5jLzY1NTM2LjBmLCB2bC82NTUzNi4wZiwgdC0+dm9sdW1lWzBdLAotICAgICAgICAgICAgLy8gICAgICAgICh2bCArIHZsSW5jKmZyYW1lQ291bnQpLzY1NTM2LjBmLCBmcmFtZUNvdW50KTsKLQotICAgICAgICAgICAgZG8gewotICAgICAgICAgICAgICAgIGwgPSAoaW50MzJfdCkqaW4rKzsKLSAgICAgICAgICAgICAgICByID0gKGludDMyX3QpKmluKys7Ci0gICAgICAgICAgICAgICAgKm91dCsrICs9ICh2bCA+PiAxNikgKiBsOwotICAgICAgICAgICAgICAgICpvdXQrKyArPSAodnIgPj4gMTYpICogcjsKLSAgICAgICAgICAgICAgICAqYXV4KysgKz0gKHZhID4+IDE3KSAqIChsICsgcik7Ci0gICAgICAgICAgICAgICAgdmwgKz0gdmxJbmM7Ci0gICAgICAgICAgICAgICAgdnIgKz0gdnJJbmM7Ci0gICAgICAgICAgICAgICAgdmEgKz0gdmFJbmM7Ci0gICAgICAgICAgICB9IHdoaWxlICgtLWZyYW1lQ291bnQpOwotCi0gICAgICAgICAgICB0LT5wcmV2Vm9sdW1lWzBdID0gdmw7Ci0gICAgICAgICAgICB0LT5wcmV2Vm9sdW1lWzFdID0gdnI7Ci0gICAgICAgICAgICB0LT5wcmV2QXV4TGV2ZWwgPSB2YTsKLSAgICAgICAgICAgIHQtPmFkanVzdFZvbHVtZVJhbXAodHJ1ZSk7Ci0gICAgICAgIH0KLQotICAgICAgICAvLyBjb25zdGFudCBnYWluCi0gICAgICAgIGVsc2UgewotICAgICAgICAgICAgY29uc3QgdWludDMyX3QgdnJsID0gdC0+dm9sdW1lUkw7Ci0gICAgICAgICAgICBjb25zdCBpbnQxNl90IHZhID0gKGludDE2X3QpdC0+YXV4TGV2ZWw7Ci0gICAgICAgICAgICBkbyB7Ci0gICAgICAgICAgICAgICAgdWludDMyX3QgcmwgPSAqcmVpbnRlcnByZXRfY2FzdDxjb25zdCB1aW50MzJfdCAqPihpbik7Ci0gICAgICAgICAgICAgICAgaW50MTZfdCBhID0gKGludDE2X3QpKCgoaW50MzJfdClpblswXSArIGluWzFdKSA+PiAxKTsKLSAgICAgICAgICAgICAgICBpbiArPSAyOwotICAgICAgICAgICAgICAgIG91dFswXSA9IG11bEFkZFJMKDEsIHJsLCB2cmwsIG91dFswXSk7Ci0gICAgICAgICAgICAgICAgb3V0WzFdID0gbXVsQWRkUkwoMCwgcmwsIHZybCwgb3V0WzFdKTsKLSAgICAgICAgICAgICAgICBvdXQgKz0gMjsKLSAgICAgICAgICAgICAgICBhdXhbMF0gPSBtdWxBZGQoYSwgdmEsIGF1eFswXSk7Ci0gICAgICAgICAgICAgICAgYXV4Kys7Ci0gICAgICAgICAgICB9IHdoaWxlICgtLWZyYW1lQ291bnQpOwotICAgICAgICB9Ci0gICAgfSBlbHNlIHsKLSAgICAgICAgLy8gcmFtcCBnYWluCi0gICAgICAgIGlmIChDQ19VTkxJS0VMWSh0LT52b2x1bWVJbmNbMF18dC0+dm9sdW1lSW5jWzFdKSkgewotICAgICAgICAgICAgaW50MzJfdCB2bCA9IHQtPnByZXZWb2x1bWVbMF07Ci0gICAgICAgICAgICBpbnQzMl90IHZyID0gdC0+cHJldlZvbHVtZVsxXTsKLSAgICAgICAgICAgIGNvbnN0IGludDMyX3QgdmxJbmMgPSB0LT52b2x1bWVJbmNbMF07Ci0gICAgICAgICAgICBjb25zdCBpbnQzMl90IHZySW5jID0gdC0+dm9sdW1lSW5jWzFdOwotCi0gICAgICAgICAgICAvLyBBTE9HRCgiWzFdICVwOiBpbmM9JWYsIHYwPSVmLCB2MT0lZCwgZmluYWw9JWYsIGNvdW50PSVkIiwKLSAgICAgICAgICAgIC8vICAgICAgICB0LCB2bEluYy82NTUzNi4wZiwgdmwvNjU1MzYuMGYsIHQtPnZvbHVtZVswXSwKLSAgICAgICAgICAgIC8vICAgICAgICAodmwgKyB2bEluYypmcmFtZUNvdW50KS82NTUzNi4wZiwgZnJhbWVDb3VudCk7Ci0KLSAgICAgICAgICAgIGRvIHsKLSAgICAgICAgICAgICAgICAqb3V0KysgKz0gKHZsID4+IDE2KSAqIChpbnQzMl90KSAqaW4rKzsKLSAgICAgICAgICAgICAgICAqb3V0KysgKz0gKHZyID4+IDE2KSAqIChpbnQzMl90KSAqaW4rKzsKLSAgICAgICAgICAgICAgICB2bCArPSB2bEluYzsKLSAgICAgICAgICAgICAgICB2ciArPSB2ckluYzsKLSAgICAgICAgICAgIH0gd2hpbGUgKC0tZnJhbWVDb3VudCk7Ci0KLSAgICAgICAgICAgIHQtPnByZXZWb2x1bWVbMF0gPSB2bDsKLSAgICAgICAgICAgIHQtPnByZXZWb2x1bWVbMV0gPSB2cjsKLSAgICAgICAgICAgIHQtPmFkanVzdFZvbHVtZVJhbXAoZmFsc2UpOwotICAgICAgICB9Ci0KLSAgICAgICAgLy8gY29uc3RhbnQgZ2FpbgotICAgICAgICBlbHNlIHsKLSAgICAgICAgICAgIGNvbnN0IHVpbnQzMl90IHZybCA9IHQtPnZvbHVtZVJMOwotICAgICAgICAgICAgZG8gewotICAgICAgICAgICAgICAgIHVpbnQzMl90IHJsID0gKnJlaW50ZXJwcmV0X2Nhc3Q8Y29uc3QgdWludDMyX3QgKj4oaW4pOwotICAgICAgICAgICAgICAgIGluICs9IDI7Ci0gICAgICAgICAgICAgICAgb3V0WzBdID0gbXVsQWRkUkwoMSwgcmwsIHZybCwgb3V0WzBdKTsKLSAgICAgICAgICAgICAgICBvdXRbMV0gPSBtdWxBZGRSTCgwLCBybCwgdnJsLCBvdXRbMV0pOwotICAgICAgICAgICAgICAgIG91dCArPSAyOwotICAgICAgICAgICAgfSB3aGlsZSAoLS1mcmFtZUNvdW50KTsKLSAgICAgICAgfQotICAgIH0KLSAgICB0LT5pbiA9IGluOwotfQotCi12b2lkIEF1ZGlvTWl4ZXI6OnRyYWNrX18xNkJpdHNNb25vKHRyYWNrX3QqIHQsIGludDMyX3QqIG91dCwgc2l6ZV90IGZyYW1lQ291bnQsIGludDMyX3QqIHRlbXAsIGludDMyX3QqIGF1eCkKLXsKLSAgICBjb25zdCBpbnQxNl90ICppbiA9IHN0YXRpY19jYXN0PGludDE2X3QgY29uc3QgKj4odC0+aW4pOwotCi0gICAgaWYgKENDX1VOTElLRUxZKGF1eCAhPSBOVUxMKSkgewotICAgICAgICAvLyByYW1wIGdhaW4KLSAgICAgICAgaWYgKENDX1VOTElLRUxZKHQtPnZvbHVtZUluY1swXXx0LT52b2x1bWVJbmNbMV18dC0+YXV4SW5jKSkgewotICAgICAgICAgICAgaW50MzJfdCB2bCA9IHQtPnByZXZWb2x1bWVbMF07Ci0gICAgICAgICAgICBpbnQzMl90IHZyID0gdC0+cHJldlZvbHVtZVsxXTsKLSAgICAgICAgICAgIGludDMyX3QgdmEgPSB0LT5wcmV2QXV4TGV2ZWw7Ci0gICAgICAgICAgICBjb25zdCBpbnQzMl90IHZsSW5jID0gdC0+dm9sdW1lSW5jWzBdOwotICAgICAgICAgICAgY29uc3QgaW50MzJfdCB2ckluYyA9IHQtPnZvbHVtZUluY1sxXTsKLSAgICAgICAgICAgIGNvbnN0IGludDMyX3QgdmFJbmMgPSB0LT5hdXhJbmM7Ci0KLSAgICAgICAgICAgIC8vIEFMT0dEKCJbMl0gJXA6IGluYz0lZiwgdjA9JWYsIHYxPSVkLCBmaW5hbD0lZiwgY291bnQ9JWQiLAotICAgICAgICAgICAgLy8gICAgICAgICB0LCB2bEluYy82NTUzNi4wZiwgdmwvNjU1MzYuMGYsIHQtPnZvbHVtZVswXSwKLSAgICAgICAgICAgIC8vICAgICAgICAgKHZsICsgdmxJbmMqZnJhbWVDb3VudCkvNjU1MzYuMGYsIGZyYW1lQ291bnQpOwotCi0gICAgICAgICAgICBkbyB7Ci0gICAgICAgICAgICAgICAgaW50MzJfdCBsID0gKmluKys7Ci0gICAgICAgICAgICAgICAgKm91dCsrICs9ICh2bCA+PiAxNikgKiBsOwotICAgICAgICAgICAgICAgICpvdXQrKyArPSAodnIgPj4gMTYpICogbDsKLSAgICAgICAgICAgICAgICAqYXV4KysgKz0gKHZhID4+IDE2KSAqIGw7Ci0gICAgICAgICAgICAgICAgdmwgKz0gdmxJbmM7Ci0gICAgICAgICAgICAgICAgdnIgKz0gdnJJbmM7Ci0gICAgICAgICAgICAgICAgdmEgKz0gdmFJbmM7Ci0gICAgICAgICAgICB9IHdoaWxlICgtLWZyYW1lQ291bnQpOwotCi0gICAgICAgICAgICB0LT5wcmV2Vm9sdW1lWzBdID0gdmw7Ci0gICAgICAgICAgICB0LT5wcmV2Vm9sdW1lWzFdID0gdnI7Ci0gICAgICAgICAgICB0LT5wcmV2QXV4TGV2ZWwgPSB2YTsKLSAgICAgICAgICAgIHQtPmFkanVzdFZvbHVtZVJhbXAodHJ1ZSk7Ci0gICAgICAgIH0KLSAgICAgICAgLy8gY29uc3RhbnQgZ2FpbgotICAgICAgICBlbHNlIHsKLSAgICAgICAgICAgIGNvbnN0IGludDE2X3QgdmwgPSB0LT52b2x1bWVbMF07Ci0gICAgICAgICAgICBjb25zdCBpbnQxNl90IHZyID0gdC0+dm9sdW1lWzFdOwotICAgICAgICAgICAgY29uc3QgaW50MTZfdCB2YSA9IChpbnQxNl90KXQtPmF1eExldmVsOwotICAgICAgICAgICAgZG8gewotICAgICAgICAgICAgICAgIGludDE2X3QgbCA9ICppbisrOwotICAgICAgICAgICAgICAgIG91dFswXSA9IG11bEFkZChsLCB2bCwgb3V0WzBdKTsKLSAgICAgICAgICAgICAgICBvdXRbMV0gPSBtdWxBZGQobCwgdnIsIG91dFsxXSk7Ci0gICAgICAgICAgICAgICAgb3V0ICs9IDI7Ci0gICAgICAgICAgICAgICAgYXV4WzBdID0gbXVsQWRkKGwsIHZhLCBhdXhbMF0pOwotICAgICAgICAgICAgICAgIGF1eCsrOwotICAgICAgICAgICAgfSB3aGlsZSAoLS1mcmFtZUNvdW50KTsKLSAgICAgICAgfQotICAgIH0gZWxzZSB7Ci0gICAgICAgIC8vIHJhbXAgZ2FpbgotICAgICAgICBpZiAoQ0NfVU5MSUtFTFkodC0+dm9sdW1lSW5jWzBdfHQtPnZvbHVtZUluY1sxXSkpIHsKLSAgICAgICAgICAgIGludDMyX3QgdmwgPSB0LT5wcmV2Vm9sdW1lWzBdOwotICAgICAgICAgICAgaW50MzJfdCB2ciA9IHQtPnByZXZWb2x1bWVbMV07Ci0gICAgICAgICAgICBjb25zdCBpbnQzMl90IHZsSW5jID0gdC0+dm9sdW1lSW5jWzBdOwotICAgICAgICAgICAgY29uc3QgaW50MzJfdCB2ckluYyA9IHQtPnZvbHVtZUluY1sxXTsKLQotICAgICAgICAgICAgLy8gQUxPR0QoIlsyXSAlcDogaW5jPSVmLCB2MD0lZiwgdjE9JWQsIGZpbmFsPSVmLCBjb3VudD0lZCIsCi0gICAgICAgICAgICAvLyAgICAgICAgIHQsIHZsSW5jLzY1NTM2LjBmLCB2bC82NTUzNi4wZiwgdC0+dm9sdW1lWzBdLAotICAgICAgICAgICAgLy8gICAgICAgICAodmwgKyB2bEluYypmcmFtZUNvdW50KS82NTUzNi4wZiwgZnJhbWVDb3VudCk7Ci0KLSAgICAgICAgICAgIGRvIHsKLSAgICAgICAgICAgICAgICBpbnQzMl90IGwgPSAqaW4rKzsKLSAgICAgICAgICAgICAgICAqb3V0KysgKz0gKHZsID4+IDE2KSAqIGw7Ci0gICAgICAgICAgICAgICAgKm91dCsrICs9ICh2ciA+PiAxNikgKiBsOwotICAgICAgICAgICAgICAgIHZsICs9IHZsSW5jOwotICAgICAgICAgICAgICAgIHZyICs9IHZySW5jOwotICAgICAgICAgICAgfSB3aGlsZSAoLS1mcmFtZUNvdW50KTsKLQotICAgICAgICAgICAgdC0+cHJldlZvbHVtZVswXSA9IHZsOwotICAgICAgICAgICAgdC0+cHJldlZvbHVtZVsxXSA9IHZyOwotICAgICAgICAgICAgdC0+YWRqdXN0Vm9sdW1lUmFtcChmYWxzZSk7Ci0gICAgICAgIH0KLSAgICAgICAgLy8gY29uc3RhbnQgZ2FpbgotICAgICAgICBlbHNlIHsKLSAgICAgICAgICAgIGNvbnN0IGludDE2X3QgdmwgPSB0LT52b2x1bWVbMF07Ci0gICAgICAgICAgICBjb25zdCBpbnQxNl90IHZyID0gdC0+dm9sdW1lWzFdOwotICAgICAgICAgICAgZG8gewotICAgICAgICAgICAgICAgIGludDE2X3QgbCA9ICppbisrOwotICAgICAgICAgICAgICAgIG91dFswXSA9IG11bEFkZChsLCB2bCwgb3V0WzBdKTsKLSAgICAgICAgICAgICAgICBvdXRbMV0gPSBtdWxBZGQobCwgdnIsIG91dFsxXSk7Ci0gICAgICAgICAgICAgICAgb3V0ICs9IDI7Ci0gICAgICAgICAgICB9IHdoaWxlICgtLWZyYW1lQ291bnQpOwotICAgICAgICB9Ci0gICAgfQotICAgIHQtPmluID0gaW47Ci19Ci0KLS8vIG5vLW9wIGNhc2UKLXZvaWQgQXVkaW9NaXhlcjo6cHJvY2Vzc19fbm9wKHN0YXRlX3QqIHN0YXRlLCBpbnQ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IChlMikgewotICAgICAgICAgICAgaiA9IDMxIC0gX19idWlsdGluX2NseihlMik7Ci0gICAgICAgICAgICBlMiAmPSB+KDE8PGopOwotICAgICAgICAgICAgdHJhY2tfdCYgdDIgPSBzdGF0ZS0+dHJhY2tzW2pdOwotICAgICAgICAgICAgaWYgKENDX1VOTElLRUxZKHQyLm1haW5CdWZmZXIgIT0gdDEubWFpbkJ1ZmZlcikpIHsKLSAgICAgICAgICAgICAgICBlMSAmPSB+KDE8PGopOwotICAgICAgICAgICAgfQotICAgICAgICB9Ci0gICAgICAgIGUwICY9IH4oZTEpOwotICAgICAgICAvLyB0aGlzIGFzc3VtZXMgb3V0cHV0IDE2IGJpdHMgc3RlcmVvLCBubyByZXNhbXBsaW5nCi0gICAgICAgIGludDMyX3QgKm91dCA9IHQxLm1haW5CdWZmZXI7Ci0gICAgICAgIHNpemVfdCBudW1GcmFtZXMgPSAwOwotICAgICAgICBkbyB7Ci0gICAgICAgICAgICBtZW1zZXQob3V0VGVtcCwgMCwgc2l6ZW9mKG91dFRlbXApKTsKLSAgICAgICAgICAgIGUyID0gZTE7Ci0gICAgICAgICAgICB3aGlsZSAoZTIpIHsKLSAgICAgICAgICAgICAgICBjb25zdCBpbnQgaSA9IDMxIC0gX19idWlsdGluX2NseihlMik7Ci0gICAgICAgICAgICAgICAgZTIgJj0gfigxPDxpKTsKLSAgICAgICAgICAgICAgICB0cmFja190JiB0ID0gc3RhdGUtPnRyYWNrc1tpXTsKLSAgICAgICAgICAgICAgICBzaXplX3Qgb3V0RnJhbWVzID0gQkxPQ0tTSVpFOwotICAgICAgICAgICAgICAgIGludDMyX3QgKmF1eCA9IE5VTEw7Ci0gICAgICAgICAgICAgICAgaWYgKENDX1VOTElLRUxZKCh0Lm5lZWRzICYgTkVFRFNfQVVYX19NQVNLKSA9PSBORUVEU19BVVhfRU5BQkxFRCkpIHsKLSAgICAgICAgICAgICAgICAgICAgYXV4ID0gdC5hdXhCdWZmZXIgKyBudW1GcmFtZXM7Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgIHdoaWxlIChvdXRGcmFtZXMpIHsKLSAgICAgICAgICAgICAgICAgICAgc2l6ZV90IGluRnJhbWVzID0gKHQuZnJhbWVDb3VudCA+IG91dEZyYW1lcyk/b3V0RnJhbWVzOnQuZnJhbWVDb3VudDsKLSAgICAgICAgICAgICAgICAgICAgaWYgKGluRnJhbWVzKSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICB0Lmhvb2soJnQsIG91dFRlbXAgKyAoQkxPQ0tTSVpFLW91dEZyYW1lcykqTUFYX05VTV9DSEFOTkVMUywgaW5GcmFtZXMsIHN0YXRlLT5yZXNhbXBsZVRlbXAsIGF1eCk7Ci0gICAgICAgICAgICAgICAgICAgICAgICB0LmZyYW1lQ291bnQgLT0gaW5GcmFtZXM7Ci0gICAgICAgICAgICAgICAgICAgICAgICBvdXRGcmFtZXMgLT0gaW5GcmFtZXM7Ci0gICAgICAgICAgICAgICAgICAgICAgICBpZiAoQ0NfVU5MSUtFTFkoYXV4ICE9IE5VTEwpKSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgYXV4ICs9IGluRnJhbWVzOwotICAgICAgICAgICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgICAgIGlmICh0LmZyYW1lQ291bnQgPT0gMCAmJiBvdXRGcmFtZXMpIHsKLSAgICAgICAgICAgICAgICAgICAgICAgIHQuYnVmZmVyUHJvdmlkZXItPnJlbGVhc2VCdWZmZXIoJnQuYnVmZmVyKTsKLSAgICAgICAgICAgICAgICAgICAgICAgIHQuYnVmZmVyLmZyYW1lQ291bnQgPSAoc3RhdGUtPmZyYW1lQ291bnQgLSBudW1GcmFtZXMpIC0gKEJMT0NLU0laRSAtIG91dEZyYW1lcyk7Ci0gICAgICAgICAgICAgICAgICAgICAgICBpbnQ2NF90IG91dHB1dFBUUyA9IGNhbGN1bGF0ZU91dHB1dFBUUygKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICB0LCBwdHMsIG51bUZyYW1lcyArIChCTE9DS1NJWkUgLSBvdXRGcmFtZXMpKTsKLSAgICAgICAgICAgICAgICAgICAgICAgIHQuYnVmZmVyUHJvdmlkZXItPmdldE5leHRCdWZmZXIoJnQuYnVmZmVyLCBvdXRwdXRQVFMpOwotICAgICAgICAgICAgICAgICAgICAgICAgdC5pbiA9IHQuYnVmZmVyLnJhdzsKLSAgICAgICAgICAgICAgICAgICAgICAgIGlmICh0LmluID09IE5VTEwpIHsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBlbmFibGVkVHJhY2tzICY9IH4oMTw8aSk7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgZTEgJj0gfigxPDxpKTsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKLSAgICAgICAgICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICAgICAgICAgIHQuZnJhbWVDb3VudCA9IHQuYnVmZmVyLmZyYW1lQ291bnQ7Ci0gICAgICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICB9Ci0gICAgICAgICAgICBkaXRoZXJBbmRDbGFtcChvdXQsIG91dFRlbXAsIEJMT0NLU0laRSk7Ci0gICAgICAgICAgICBvdXQgKz0gQkxPQ0tTSVpFOwotICAgICAgICAgICAgbnVtRnJhbWVzICs9IEJMT0NLU0laRTsKLSAgICAgICAgfSB3aGlsZSAobnVtRnJhbWVzIDwgc3RhdGUtPmZyYW1lQ291bnQpOwotICAgIH0KLQotICAgIC8vIHJlbGVhc2UgZWFjaCB0cmFjaydzIGJ1ZmZlcgotICAgIGUwID0gZW5hYmxlZFRyYWNrczsKLSAgICB3aGlsZSAoZTApIHsKLSAgICAgICAgY29uc3QgaW50IGkgPSAzMSAtIF9fYnVpbHRpbl9jbHooZTApOwotICAgICAgICBlMCAmPSB+KDE8PGkpOwotICAgICAgICB0cmFja190JiB0ID0gc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AgICAgICAgIHQucmVzYW1wbGVyLT5zZXRQVFMocHRzKTsKLSAgICAgICAgICAgICAgICB0Lmhvb2soJnQsIG91dFRlbXAsIG51bUZyYW1lcywgc3RhdGUtPnJlc2FtcGxlVGVtcCwgYXV4KTsKLSAgICAgICAgICAgIH0gZWxzZSB7Ci0KLSAgICAgICAgICAgICAgICBzaXplX3Qgb3V0RnJhbWVzID0gMDsKLQotICAgICAgICAgICAgICAgIHdoaWxlIChvdXRGcmFtZXMgPCBudW1GcmFtZXMpIHsKLSAgICAgICAgICAgICAgICAgICAgdC5idWZmZXIuZnJhbWVDb3VudCA9IG51bUZyYW1lcyAtIG91dEZyYW1lczsKLSAgICAgICAgICAgICAgICAgICAgaW50NjRfdCBvdXRwdXRQVFMgPSBjYWxjdWxhdGVPdXRwdXRQVFModCwgcHRzLCBvdXRGcmFtZXMpOwotICAgICAgICAgICAgICAgICAgICB0LmJ1ZmZlclByb3ZpZGVyLT5nZXROZXh0QnVmZmVyKCZ0LmJ1ZmZlciwgb3V0cHV0UFRTKTsKLSAgICAgICAgICAgICAgICAgICAgdC5pbiA9IHQuYnVmZmVyLnJhdzsKLSAgICAgICAgICAgICAgICAgICAgLy8gdC5pbiA9PSBOVUxMIGNhbiBoYXBwZW4gaWYgdGhlIHRyYWNrIHdhcyBmbHVzaGVkIGp1c3QgYWZ0ZXIgaGF2aW5nCi0gICAgICAgICAgICAgICAgICAgIC8vIGJlZW4gZW5hYmxlZCBmb3IgbWl4aW5nLgotICAgICAgICAgICAgICAgICAgICBpZiAodC5pbiA9PSBOVUxMKSBicmVhazsKLQotICAgICAgICAgICAgICAgICAgICBpZiAoQ0NfVU5MSUtFTFkoYXV4ICE9IE5VTEwpKSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICBhdXggKz0gb3V0RnJhbWVzOwotICAgICAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgICAgIHQuaG9vaygmdCwgb3V0VGVtcCArIG91dEZyYW1lcypNQVhfTlV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c2V0KG91dCwgMCwgbnVtRnJhbWVzKk1BWF9OVU1fQ0hBTk5FTFMqc2l6ZW9mKGludDE2X3QpKTsKLSAgICAgICAgICAgIEFMT0dFX0lGKCgodW5zaWduZWQgbG9uZylpbiAmIDMpLCAicHJvY2VzcyBzdGVyZW8gdHJhY2s6IGlucHV0IGJ1ZmZlciBhbGlnbm1lbnQgcGI6IGJ1ZmZlciAlcCB0cmFjayAlZCwgY2hhbm5lbHMgJWQsIG5lZWRzICUwOHgiLAotICAgICAgICAgICAgICAgICAgICBpbiwgaSwgdC5jaGFubmVsQ291bnQsIHQubmVlZHMpOwotICAgICAgICAgICAgcmV0dXJuOwotICAgICAgICB9Ci0gICAgICAgIHNpemVfdCBvdXRGcmFtZXMgPSBiLmZyYW1lQ291bnQ7Ci0KLSAgICAgICAgaWYgKENDX1VOTElLRUxZKHVpbnQzMl90KHZsKSA+IFVOSVRZX0dBSU4gfHwgdWludDMyX3QodnIpID4gVU5JVFlfR0FJTikpIHsKLSAgICAgICAgICAgIC8vIHZvbHVtZSBpcyBib29zdGVkLCBzbyB3ZSBtaWdodCBuZWVkIHRvIGNsYW1wIGV2ZW4gdGhvdWdoCi0gICAgICAgICAgICAvLyB3ZSBwcm9jZXNzIG9ubHkgb25lIHRyYWNrLgotICAgICAgICAgICAgZG8gewotICAgICAgICAgICAgICAgIHVpbnQzMl90IHJsID0gKnJlaW50ZXJwcmV0X2Nhc3Q8Y29uc3QgdWludDMyX3QgKj4oaW4pOwotICAgICAgICAgICAgICAgIGluICs9IDI7Ci0gICAgICAgICAgICAgICAgaW50MzJfdCBsID0gbXVsUkwoMSwgcmwsIHZybCkgPj4gMTI7Ci0gICAgICAgICAgICAgICAgaW50MzJfdCByID0gbXVsUkwoMCwgcmwsIHZybCkgPj4gMTI7Ci0gICAgICAgICAgICAgICAgLy8gY2xhbXBpbmcuLi4KLSAgICAgICAgICAgICAgICBsID0gY2xhbXAxNihsKTsKLSAgICAgICAgICAgICAgICByID0gY2xhbXAxNihyKTsKLSAgICAgICAgICAgICAgICAqb3V0KysgPSAocjw8MTYpIHwgKGwgJiAweEZGRkYpOwotICAgICAgICAgICAgfSB3aGlsZSAoLS1vdXRGcmFtZXMpOwotICAgICAgICB9IGVsc2UgewotICAgICAgICAgICAgZG8gewotICAgICAgICAgICAgICAgIHVpbnQzMl90IHJsID0gKnJlaW50ZXJwcmV0X2Nhc3Q8Y29uc3QgdWludDMyX3QgKj4oaW4pOwotICAgICAgICAgICAgICAgIGluICs9IDI7Ci0gICAgICAgICAgICAgICAgaW50MzJfdCBsID0gbXVsUkwoMSwgcmwsIHZybCkgPj4gMTI7Ci0gICAgICAgICAgICAgICAgaW50MzJfdCByID0gbXVsUkwoMCwgcmwsIHZybCkgPj4gMTI7Ci0gICAgICAgICAgICAgICAgKm91dCsrID0gKHI8PDE2KSB8IChsICYgMHhGRkZGKTsKLSAgICAgICAgICAgIH0gd2hpbGUgKC0tb3V0RnJhbWVzKTsKLSAgICAgICAgfQotICAgICAgICBudW1GcmFtZXMgLT0gYi5mcmFtZUNvdW50OwotICAgICAgICB0LmJ1ZmZlclByb3ZpZGVyLT5yZWxlYXNlQnVmZmVyKCZiKTsKLSAgICB9Ci19Ci0KLSNpZiAwCi0vLyAyIHRyYWNrcyBpcyBhbHNvIGEgY29tbW9uIGNhc2UKLS8vIE5FVkVSIHVzZWQgaW4gY3VycmVudCBpbXBsZW1lbnRhdGlvbiBvZiBwcm9jZXNzX192YWxpZGF0ZSgpCi0vLyBvbmx5IHVzZSBpZiB0aGUgMiB0cmFja3MgaGF2ZSB0aGUgc2FtZSBvdXRwdXQgYnVmZmVyCi12b2lkIEF1ZGlvTWl4ZXI6OnByb2Nlc3NfX1R3b1RyYWNrczE2Qml0c1N0ZXJlb05vUmVzYW1wbGluZyhzdGF0ZV90KiBzdGF0ZSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGludDY0X3QgcHRzKQotewotICAgIG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cmFtZUNvdW50ID0gbnVtRnJhbWVzOwotICAgICAgICAgICAgaW50NjRfdCBvdXRwdXRQVFMgPSBjYWxjdWxhdGVPdXRwdXRQVFModDAsIHB0cywKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG91dCAtIHQwLm1haW5CdWZmZXIpOwotICAgICAgICAgICAgdDAuYnVmZmVyUHJvdmlkZXItPmdldE5leHRCdWZmZXIoJmIwLCBvdXRwdXRQVFMpOwotICAgICAgICAgICAgaWYgKGIwLmkxNiA9PSBOVUxMKSB7Ci0gICAgICAgICAgICAgICAgaWYgKGJ1ZmYgPT0gTlVMTCkgewotICAgICAgICAgICAgICAgICAgICBidWZmID0gbmV3IGludDE2X3RbTUFYX05VTV9DSEFOTkVMUyAqIHN0YXRlLT5mcmFtZUNvdW50XTsKLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgaW4wID0gYnVmZjsKLSAgICAgICAgICAgICAgICBiMC5mcmFtZUNvdW50ID0gbnVtRnJhbWVzOwotICAgICAgICAgICAgfSBlbHNlIHsKLSAgICAgICAgICAgICAgICBpbjAgPSBiMC5pMTY7Ci0gICAgICAgICAgICB9Ci0gICAgICAgICAgICBmcmFtZUNvdW50MCA9IGIwLmZyYW1lQ291bnQ7Ci0gICAgICAgIH0KLSAgICAgICAgaWYgKGZyYW1lQ291bnQxID09IDApIHsKLSAgICAgICAgICAgIGIxLmZyYW1lQ291bnQgPSBudW1GcmFtZXM7Ci0gICAgICAgICAgICBpbnQ2NF90IG91dHB1dFBUUyA9IGNhbGN1bGF0ZU91dHB1dFBUUyh0MSwgcHRzLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgb3V0IC0gdDAubWFpbkJ1ZmZlcik7Ci0gICAgICAgICAgICB0MS5idWZmZXJQcm92aWRlci0+Z2V0TmV4dEJ1ZmZlcigmYjEsIG91dHB1dFBUUyk7Ci0gICAgICAgICAgICBpZiAoYjEuaTE2ID09IE5VTEwpIHsKLSAgICAgICAgICAgICAgICBpZiAoYnVmZiA9PSBOVUxMKSB7Ci0gICAgICAgICAgICAgICAgICAgIGJ1ZmYgPSBuZXcgaW50MTZfdFtNQVhfTlVNX0NIQU5ORUxTICogc3RhdGUtPmZyYW1lQ291bnRdOwotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICBpbjEgPSBidWZmOwotICAgICAgICAgICAgICAgIGIxLmZyYW1lQ291bnQgPSBudW1GcmFtZXM7Ci0gICAgICAgICAgICB9IGVsc2UgewotICAgICAgICAgICAgICAgIGluMSA9IGIxLmkxNjsKLSAgICAgICAgICAgIH0KLSAgICAgICAgICAgIGZyYW1lQ291bnQxID0gYjEuZnJhbWVDb3VudDsKLSAgICAgICAgfQotCi0gICAgICAgIHNpemVfdCBvdXRGcmFtZXMgPSBmcmFtZUNvdW50MCA8IGZyYW1lQ291bnQxP2ZyYW1lQ291bnQwOmZyYW1lQ291bnQxOwotCi0gICAgICAgIG51bUZyYW1lcyAtPSBvdXRGcmFtZXM7Ci0gICAgICAgIGZyYW1lQ291bnQwIC09IG91dEZyYW1lczsKLSAgICAgICAgZnJhbWVDb3VudDEgLT0gb3V0RnJhbWVzOwotCi0gICAgICAgIGRvIHsKLSAgICAgICAgICAgIGludDMyX3QgbDAgPSAqaW4wKys7Ci0gICAgICAgICAgICBpbnQzMl90IHIwID0gKmluMCsrOwotICAgICAgICAgICAgbDAgPSBtdWwobDAsIHZsMCk7Ci0gICAgICAgICAgICByMCA9IG11bChyMCwgdnIwKTsKLSAgICAgICAgICAgIGludDMyX3QgbCA9ICppbjErKzsKLSAgICAgICAgICAgIGludDMyX3QgciA9ICppbjErKzsKLSAgICAgICAgICAgIGwgPSBtdWxBZGQobCwgdmwxLCBsMCkgPj4gMTI7Ci0gICAgICAgICAgICByID0gbXVsQWRkKHIsIHZyMSwgcjApID4+IDEyOwotICAgICAgICAgICAgLy8gY2xhbXBpbmcuLi4KL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1bml0cykKLSAgICAgICAgVFJBQ0swICAgICAgICAgID0gMHgxMDAwLAotCi0gICAgICAgIC8vIDB4MjAwMCBpcyB1bnVzZWQKLQotICAgICAgICAvLyBzZXRQYXJhbWV0ZXIgdGFyZ2V0cwotICAgICAgICBUUkFDSyAgICAgICAgICAgPSAweDMwMDAsCi0gICAgICAgIFJFU0FNUExFICAgICAgICA9IDB4MzAwMSwKLSAgICAgICAgUkFNUF9WT0xVTUUgICAgID0gMHgzMDAyLCAvLyByYW1wIHRvIG5ldyB2b2x1bWUKLSAgICAgICAgVk9MVU1FICAgICAgICAgID0gMHgzMDAzLCAvLyBkb24ndCByYW1wCi0KLSAgICAgICAgLy8gc2V0IFBhcmFtZXRlciBuYW1lcwotICAgICAgICAvLyBmb3IgdGFyZ2V0IFRSQUNLCi0gICAgICAgIENIQU5ORUxfTUFTSyAgICA9IDB4NDAwMCwKLSAgICAgICAgRk9STUFUICAgICAgICAgID0gMHg0MDAxLAotICAgICAgICBNQUlOX0JVRkZFUiAgICAgPSAweDQwMDIsCi0gICAgICAgIEFVWF9CVUZGRVIgICAgICA9IDB4NDAwMywKLSAgICAgICAgLy8gZm9yIHRhcmdldCBSRVNBTVBMRQotICAgICAgICBTQU1QTEVfUkFURSAgICAgPSAweDQxMDAsCi0gICAgICAgIFJFU0VUICAgICAgICAgICA9IDB4NDEwMSwKLSAgICAgICAgLy8gZm9yIHRhcmdldCBSQU1QX1ZPTFVNRSBhbmQgVk9MVU1FICg4IGNoYW5uZWxzIG1heCkKLSAgICAgICAgVk9MVU1FMCAgICAgICAgID0gMHg0MjAwLAotICAgICAgICBWT0xVTUUxICAgICAgICAgPSAweDQyMDEsCi0gICAgICAgIEFVWExFVkVMICAgICAgICA9IDB4NDIxMCwKLSAgICB9OwotCi0KLSAgICAvLyBGb3IgYWxsIEFQSXMgd2l0aCAibmFtZSI6IFRSQUNLMCA8PSBuYW1lIDwgVFJBQ0swICsgTUFYX05VTV9UUkFDS1MKLQotICAgIC8vIE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5FRURTX1JFU0FNUExFX19NQVNLICAgICAgICA9IDB4MDAwMDEwMDAsCi0gICAgICAgIE5FRURTX0FVWF9fTUFTSyAgICAgICAgICAgICA9IDB4MDAwMTAwMDAsCi0gICAgfTsKLQotICAgIGVudW0gewotICAgICAgICBORUVEU19DSEFOTkVMXzEgICAgICAgICAgICAgPSAweDAwMDAwMDAwLAotICAgICAgICBORUVEU19DSEFOTkVMXzIgICAgICAgICAgICAgPSAweDAwMDAwMDAxLAotCi0gICAgICAgIE5FRURTX0ZPUk1BVF8xNiAgICAgICAgICAgICA9IDB4MDAwMDAwMTAsCi0KLSAgICAgICAgTkVFRFNfTVVURV9ESVNBQkxFRCAgICAgICAgID0gMHgwMDAwMDAwMCwKLSAgICAgICAgTkVFRFNfTVVURV9FTkFCTEVEICAgICAgICAgID0gMHgwMDAwMDEwMCwKLQotICAgICAgICBORUVEU19SRVNBTVBMRV9ESVNBQkxFRCAgICAgPSAweDAwMDAwMDAwLAotICAgICAgICBORUVEU19SRVNBTVBMRV9FTkFCTEVEICAgICAgPSAweDAwMDAxMDAwLAotCi0gICAgICAgIE5FRURTX0FVWF9ESVNBQkxFRCAgICAgPSAweDAwMDAwMDAwLAotICAgICAgICBORUVEU19BVVhfRU5BQkxFRCAgICAgID0gMHgwMDAxMDAwMCwKLSAgICB9OwotCi0gICAgc3RydWN0IHN0YXRlX3Q7Ci0gICAgc3RydWN0IHRyYWNrX3Q7Ci0KLSAgICB0eXBlZGVmIHZvaWQgKCpob29rX3QpKHRyYWNrX3QqIHQsIGludDMyX3QqIG91dHB1dCwgc2l6ZV90IG51bU91dEZyYW1lcywgaW50MzJfdCogdGVtcCwgaW50MzJfdCogYXV4KTsKLSAgICBzdGF0aWMgY29uc3QgaW50IEJMT0NLU0laRSA9IDE2OyAvLyA0IGNhY2hlIGxpbmVzCi0KLSAgICBzdHJ1Y3QgdHJhY2tfdCB7Ci0gICAgICAgIHVpbnQzMl90ICAgIG5lZWRzOwotCi0gICAgICAgIHVuaW9uIHsKLSAgICAgICAgaW50MTZfdCAgICAgdm9sdW1lW01BWF9OVU1fQ0hBTk5FTFNdOyAvLyBbMF0zLjEyIGZpeGVkIHBvaW50Ci0gICAgICAgIGludDMyX3QgICAgIHZvbHVtZVJMOwotICAgICAgICB9OwotCi0gICAgICAgIGludDMyX3QgICAgIHByZXZWb2x1bWVbTUFYX05VTV9DSEFOTkVMU107Ci0KLSAgICAgICAgLy8gMTYtYnl0ZSBib3VuZGFyeQotCi0gICAgICAgIGludDMyX3QgICAgIHZvbHVtZUluY1tNQVhfTlVNX0NIQU5ORUxTXTsKLSAgICAgICAgaW50MzJfdCAgICAgYXV4SW5jOwotICAgICAgICBpbnQzMl90ICAgICBwcmV2QXV4TGV2ZWw7Ci0KLSAgICAgICAgLy8gMTYtYnl0ZSBib3VuZGFyeQotCi0gICAgICAgIGludDE2X3QgICAgIGF1eExldmVsOyAgICAgICAvLyAwIDw9IGF1eExldmVsIDw9IE1BWF9HQUlOX0lOVCwgYnV0IHNpZ25lZCBmb3IgbXVsIHBlcmZvcm1hbmNlCi0gICAgICAgIHVpbnQxNl90ICAgIGZyYW1lQ291bnQ7Ci0KLSAgICAgICAgdWludDhfdCAgICAgY2hhbm5lbENvdW50OyAgIC8vIDEgb3IgMiwgcmVkdW5kYW50IHdpdGggKG5lZWRzICYgTkVFRFNfQ0hBTk5FTF9DT1VOVF9fTUFTSykKLSAgICAgICAgdWludDhfdCAgICAgZm9ybWF0OyAgICAgICAgIC8vIGFsd2F5cyAxNgotICAgICAgICB1aW50MTZfdCAgICBlbmFibGVkOyAgICAgICAgLy8gYWN0dWFsbHkgYm9vbAotICAgICAgICB1aW50MzJfdCAgICBjaGFubmVsTWFzazsgICAgLy8gY3VycmVudGx5IHVuZGVyLXVzZWQKLQotICAgICAgICBBdWRpb0J1ZmZlclByb3ZpZGVyKiAgICAgICAgICAgICAgICBidWZmZXJQcm92aWRlcjsKLQotICAgICAgICAvLyAxNi1ieXRlIGJvdW5kYXJ5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ubmVjdGlvblN0YXRlKGF1ZGlvX2RldmljZXNfdCBkZXZpY2UsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGF1ZGlvX3BvbGljeV9kZXZfc3RhdGVfdCBzdGF0ZSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY29uc3QgY2hhciAqZGV2aWNlX2FkZHJlc3MpCi17Ci0gICAgaWYgKG1wQXVkaW9Qb2xpY3kgPT0gTlVMTCkgewotICAgICAgICByZXR1cm4gTk9fSU5JVDsKLSAgICB9Ci0gICAgaWYgKCFzZXR0aW5nc0FsbG93ZWQoKSkgewotICAgICAgICByZXR1cm4gUEVSTUlTU0lPTl9ERU5JRUQ7Ci0gICAgfQotICAgIGlmICghYXVkaW9faXNfb3V0cHV0X2RldmljZShkZXZpY2UpICYmICFhdWRpb19pc19pbnB1dF9kZXZpY2UoZGV2aWNlKSkgewotICAgICAgICByZXR1cm4gQkFEX1ZBTFVFOwotICAgIH0KLSAgICBpZiAoc3RhdGUgIT0gQVVESU9fUE9MSUNZX0RFVklDRV9TVEFURV9BVkFJTEFCTEUgJiYKLSAgICAgICAgICAgIHN0YXRlICE9IEFVRElPX1BPTElDWV9ERVZJQ0VfU1RBVEVfVU5BVkFJTEFCTEUpIHsKLSAgICAgICAgcmV0dXJuIEJBRF9WQUxVRTsKLSAgICB9Ci0KLSAgICBBTE9HVigic2V0RGV2aWNlQ29ubmVjdGlvblN0YXRlKCkgdGlkICVkIiwgZ2V0dGlkKCkpOwotICAgIE11dGV4OjpBdXRvbG9jayBfbChtTG9jayk7Ci0gICAgcmV0dXJuIG1wQXVkaW9Qb2xpY3ktPnNldF9kZXZpY2VfY29ubmVjdGlvbl9zdGF0ZShtcEF1ZGlvUG9saWN5LCBkZXZpY2UsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzdGF0ZSwgZGV2aWNlX2FkZHJlc3MpOwotfQotCi1hdWRpb19wb2xpY3lfZGV2X3N0YXRlX3QgQXVkaW9Qb2xpY3lTZXJ2aWNlOjpnZXREZXZpY2VDb25uZWN0aW9uU3RhdGUoCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGF1ZGlvX2RldmljZXNfdCBkZXZpY2UsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbnN0IGNoYXIgKmRldmljZV9hZGRyZXNzKQotewotICAgIGlmIChtcEF1ZGlvUG9saWN5ID09IE5VTEwpIHsKLSAgICAgICAgcmV0dXJuIEFVRElPX1BPTElDWV9ERVZJQ0VfU1RBVEVfVU5BVkFJTEFCTEU7Ci0gICAgfQotICAgIHJldHVybiBtcEF1ZGlvUG9saWN5LT5nZXRfZGV2aWNlX2Nvbm5lY3Rpb25fc3RhdGUobXBBdWRpb1BvbGljeSwgZGV2aWNlLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZGV2aWNlX2FkZHJlc3MpOwotfQotCi1zdGF0dXNfdCBBdWRpb1BvbGljeVNlcnZpY2U6OnNldFBob25lU3RhdGUoYXVkaW9fbW9kZV90IHN0YXRlKQotewotICAgIGlmIChtcEF1ZGlvUG9saWN5ID09IE5VTEwpIHsKLSAgICAgICAgcmV0dXJuIE5PX0lOSVQ7Ci0gICAgfQotICAgIGlmICghc2V0dGluZ3NBbGxvd2VkKCkpIHsKLSAgICAgICAgcmV0dXJuIFBFUk1JU1NJT05fREVOSUVEOwotICAgIH0KLSAgICBpZiAodWludDMyX3Qoc3RhdGUpID49IEFVRElPX01PREVfQ05UKSB7Ci0gICAgICAgIHJldHVybiBCQURfVkFMVUU7Ci0gICAgfQotCi0gICAgQUxPR1YoInNldFBob25lU3RhdGUoKSB0aWQgJWQiLCBnZXR0aWQoKSk7Ci0K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IHJldHVybiBOT19JTklUOwotICAgIH0KLSAgICBBTE9HVigic3RvcE91dHB1dCgpIHRpZCAlZCIsIGdldHRpZCgpKTsKLSAgICBNdXRleDo6QXV0b2xvY2sgX2wobUxvY2spOwotICAgIHJldHVybiBtcEF1ZGlvUG9saWN5LT5zdG9wX291dHB1dChtcEF1ZGlvUG9saWN5LCBvdXRwdXQsIHN0cmVhbSwgc2Vzc2lvbik7Ci19Ci0KLXZvaWQgQXVkaW9Qb2xpY3lTZXJ2aWNlOjpyZWxlYXNlT3V0cHV0KGF1ZGlvX2lvX2hhbmRsZV90IG91dHB1dCkKLXsKLSAgICBpZiAobXBBdWRpb1BvbGljeSA9PSBOVUxMKSB7Ci0gICAgICAgIHJldHVybjsKLSAgICB9Ci0gICAgQUxPR1YoInJlbGVhc2VPdXRwdXQoKSB0aWQgJWQiLCBnZXR0aWQoKSk7Ci0gICAgTXV0ZXg6OkF1dG9sb2NrIF9sKG1Mb2NrKTsKLSAgICBtcEF1ZGlvUG9saWN5LT5yZWxlYXNlX291dHB1dChtcEF1ZGlvUG9saWN5LCBvdXRwdXQpOwotfQotCi1hdWRpb19pb19oYW5kbGVfdCBBdWRpb1BvbGljeVNlcnZpY2U6OmdldElucHV0KGF1ZGlvX3NvdXJjZV90IGlucHV0U291cmNlLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdWludDMyX3Qgc2FtcGxpbmdSYXRlLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYXVkaW9fZm9ybWF0X3QgZm9ybWF0LAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdWludDMyX3QgY2hhbm5lbHMsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBhdWRpb19pbl9hY291c3RpY3NfdCBhY291c3RpY3MsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpbnQgYXVkaW9TZXNzaW9uKQotewotICAgIGlmIChtcEF1ZGlvUG9sa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JuOwotICAgIH0KLSAgICBJbnB1dERlc2MgKmlucHV0RGVzYyA9IG1JbnB1dHMudmFsdWVBdChpbmRleCk7Ci0gICAgc2V0UHJlUHJvY2Vzc29yRW5hYmxlZChpbnB1dERlc2MsIGZhbHNlKTsKLSAgICBkZWxldGUgaW5wdXREZXNjOwotICAgIG1JbnB1dHMucmVtb3ZlSXRlbXNBdChpbmRleCk7Ci19Ci0KLXN0YXR1c190IEF1ZGlvUG9saWN5U2VydmljZTo6aW5pdFN0cmVhbVZvbHVtZShhdWRpb19zdHJlYW1fdHlwZV90IHN0cmVhbSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaW50IGluZGV4TWluLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpbnQgaW5kZXhNYXgpCi17Ci0gICAgaWYgKG1wQXVkaW9Qb2xpY3kgPT0gTlVMTCkgewotICAgICAgICByZXR1cm4gTk9fSU5JVDsKLSAgICB9Ci0gICAgaWYgKCFzZXR0aW5nc0FsbG93ZWQoKSkgewotICAgICAgICByZXR1cm4gUEVSTUlTU0lPTl9ERU5JRUQ7Ci0gICAgfQotICAgIGlmICh1aW50MzJfdChzdHJlYW0pID49IEFVRElPX1NUUkVBTV9DTlQpIHsKLSAgICAgICAgcmV0dXJuIEJBRF9WQUxVRTsKLSAgICB9Ci0gICAgbXBBdWRpb1BvbGljeS0+aW5pdF9zdHJlYW1fdm9sdW1lKG1wQXVkaW9Qb2xpY3ksIHN0cmVhbSwgaW5kZXhNaW4sIGluZGV4TWF4KTsKLSAgICByZXR1cm4gTk9fRVJST1I7Ci19Ci0KLXN0YXR1c190IEF1ZGlvUG9saWN5U2VydmljZTo6c2V0U3RyZWFtVm9sdW1lSW5kZXgoYXVkaW9fc3RyZWFtX3R5cGVfdCBzdHJlYW0sCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGludCBpbmRleCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYXVkaW9fZGV2aWNlc190IGRldmljZSkKLXsKLSAgICBpZiAobXBBdWRpb1BvbGljeSA9PSBOVUxMKSB7Ci0gICAgICAgIHJldHVybiBOT19JTklUOwotICAgIH0KLSAgICBpZiAoIXNldHRpbmdzQWxsb3dlZCgpKSB7Ci0gICAgICAgIHJldHVybiBQRVJNSVNTSU9OX0RFTklFRDsKLSAgICB9Ci0gICAgaWYgKHVpbnQzMl90KHN0cmVhbSkgPj0gQVVESU9fU1RSRUFNX0NOVCkgewotICAgICAgICByZXR1cm4gQkFEX1ZBTFVFOwotICAgIH0KLQotICAgIGlmIChtcEF1ZGlvUG9saWN5LT5zZXRfc3RyZWFtX3ZvbHVtZV9pbmRleF9mb3JfZGV2aWNlKSB7Ci0gICAgICAgIHJldHVybiBtcEF1ZGlvUG9saWN5LT5zZXRfc3RyZWFtX3ZvbHVtZV9pbmRleF9mb3JfZGV2aWNlKG1wQXVkaW9Qb2xpY3ksCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc3RyZWFtLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGluZGV4LAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRldmljZSk7Ci0gICAgfSBlbHNlIHsKLSAgICAgICAgcmV0dXJuIG1wQXVkaW9Qb2xpY3ktPnNldF9zdHJlYW1fdm9sdW1lX2luZGV4KG1wQXVkaW9Qb2xpY3ksIHN0cmVhbSwgaW5kZXgpOwotICAgIH0KLX0KLQotc3RhdHVzX3QgQXVkaW9Qb2xpY3lTZXJ2aWNlOjpnZXRTdHJlYW1Wb2x1bWVJbmRleChhdWRpb19zdHJlYW1fdHlwZV90IHN0cmVhbSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaW50ICppbmRleCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYXVkaW9fZGV2aWNlc190IGRldmljZSkKLXsKLSAgICBpZiAobXBBdWRpb1BvbGljeSA9PSBOVUxMKSB7Ci0gICAgICAgIHJldHVybiBOT19JTklUOwotICAgIH0KLSAgICBpZiAodWludDMyX3Qoc3RyZWFtKSA+PSBBVURJT19TVFJFQU1fQ05UKSB7Ci0gICAgICAgIHJldHVybiBCQURfVkFMVUU7Ci0gICAgfQotICAgIGlmIChtcEF1ZGlvUG9saWN5LT5nZXRfc3RyZWFtX3ZvbHVtZV9pbmRleF9mb3JfZGV2aWNlKSB7Ci0gICAgICAgIHJldHVybiBtcEF1ZGlvUG9saWN5LT5nZXRfc3RyZWFtX3ZvbHVtZV9pbmRleF9mb3JfZGV2aWNlKG1wQXVkaW9Qb2xpY3ksCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc3RyZWFtLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGluZGV4LAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRldmljZSk7Ci0gICAgfSBlbHNlIHsKLSAgICAgICAgcmV0dXJuIG1wQXVkaW9Qb2xpY3ktPmdldF9zdHJlYW1fdm9sdW1lX2luZGV4KG1wQXVkaW9Qb2xpY3ksIHN0cmVhbSwgaW5kZXgpOwotICAgIH0KLX0KLQotdWludDMyX3QgQXVkaW9Qb2xpY3lTZXJ2aWNlOjpnZXRTdHJhdGVneUZvclN0cmVhbShhdWRpb19zdHJlYW1fdHlwZV90IHN0cmVhbSkKLXsKLSAgICBpZiAobXBBdWRpb1BvbGljeSA9PSBOVUxMKSB7Ci0gICAgICAgI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gICAgaWYgKG1BdWRpb0NvbW1hbmRzWzBdLT5tVGltZSA8PSBjdXJUaW1lKSB7Ci0gICAgICAgICAgICAgICAgQXVkaW9Db21tYW5kICpjb21tYW5kID0gbUF1ZGlvQ29tbWFuZHNbMF07Ci0gICAgICAgICAgICAgICAgbUF1ZGlvQ29tbWFuZHMucmVtb3ZlQXQoMCk7Ci0gICAgICAgICAgICAgICAgbUxhc3RDb21tYW5kID0gKmNvbW1hbmQ7Ci0KLSAgICAgICAgICAgICAgICBzd2l0Y2ggKGNvbW1hbmQtPm1Db21tYW5kKSB7Ci0gICAgICAgICAgICAgICAgY2FzZSBTVEFSVF9UT05FOiB7Ci0gICAgICAgICAgICAgICAgICAgIG1Mb2NrLnVubG9jaygpOwotICAgICAgICAgICAgICAgICAgICBUb25lRGF0YSAqZGF0YSA9IChUb25lRGF0YSAqKWNvbW1hbmQtPm1QYXJhbTsKLSAgICAgICAgICAgICAgICAgICAgQUxPR1YoIkF1ZGlvQ29tbWFuZFRocmVhZCgpIHByb2Nlc3Npbmcgc3RhcnQgdG9uZSAlZCBvbiBzdHJlYW0gJWQiLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRhdGEtPm1UeXBlLCBkYXRhLT5tU3RyZWFtKTsKLSAgICAgICAgICAgICAgICAgICAgZGVsZXRlIG1wVG9uZUdlbmVyYXRvcjsKLSAgICAgICAgICAgICAgICAgICAgbXBUb25lR2VuZXJhdG9yID0gbmV3IFRvbmVHZW5lcmF0b3IoZGF0YS0+bVN0cmVhbSwgMS4wKTsKLSAgICAgICAgICAgICAgICAgICAgbXBUb25lR2VuZXJhdG9yLT5zdGFydFRvbmUoZGF0YS0+bVR5cGUpOwotICAgICAgICAgICAgICAgICAgICBkZWxldGUgZGF0YTsKLSAgICAgICAgICAgICAgICAgICAgbUxvY2subG9jaygpOwotICAgICAgICAgICAgICAgICAgICB9YnJlYWs7Ci0gICAgICAgICAgICAgICAgY2FzZSBTVE9QX1RPTkU6IHsKLSAgICAgICAgICAgICAgICAgICAgbUxvY2sudW5sb2NrKCk7Ci0gICAgICAgICAgICAgICAgICAgIEFMT0dWKCJBdWRpb0NvbW1hbmRUaHJlYWQoKSBwcm9jZXNzaW5nIHN0b3AgdG9uZSIpOwotICAgICAgICAgICAgICAgICAgICBpZiAobXBUb25lR2VuZXJhdG9yICE9IE5VTEwpIHsKLSAgICAgICAgICAgICAgICAgICAgICAgIG1wVG9uZUdlbmVyYXRvci0+c3RvcFRvbmUoKTsKLSAgICAgICAgICAgICAgICAgICAgICAgIGRlbGV0ZSBtcFRvbmVHZW5lcmF0b3I7Ci0gICAgICAgICAgICAgICAgICAgICAgICBtcFRvbmVHZW5lcmF0b3IgPSBOVUxMOwotICAgICAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgICAgIG1Mb2NrLmxvY2soKTsKLSAgICAgICAgICAgICAgICAgICAgfWJyZWFrOwotICAgICAgICAgICAgICAgIGNhc2UgU0VUX1ZPTFVNRTogewotICAgICAgICAgICAgICAgICAgICBWb2x1bWVEYXRhICpkYXRhID0gKFZvbHVtZURhdGEgKiljb21tYW5kLT5tUGFyYW07Ci0gICAgICAgICAgICAgICAgICAgIEFMT0dWKCJBdWRpb0NvbW1hbmRUaHJlYWQoKSBwcm9jZXNzaW5nIHNldCB2b2x1bWUgc3RyZWFtICVkLCBcCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgdm9sdW1lICVmLCBvdXRwdXQgJWQiLCBkYXRhLT5tU3RyZWFtLCBkYXRhLT5tVm9sdW1lLCBkYXRhLT5tSU8pOwotICAgICAgICAgICAgICAgICAgICBjb21tYW5kLT5tU3RhdHVzID0gQXVkaW9TeXN0ZW06OnNldFN0cmVhbVZvbHVtZShkYXRhLT5tU3RyZWFtLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBkYXRhLT5tVm9sdW1lLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBkYXRhLT5tSU8pOwotICAgICAgICAgICAgICAgICAgICBpZiAoY29tbWFuZC0+bVdhaXRTdGF0dXMpIHsKLSAgICAgICAgICAgICAgICAgICAgICAgIGNvbW1hbmQtPm1Db25kLnNpZ25hbCgpOwotICAgICAgICAgICAgICAgICAgICAgICAgbVdhaXRXb3JrQ1Yud2FpdChtTG9jayk7Ci0gICAgICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICAgICAgZGVsZXRlIGRhdGE7Ci0gICAgICAgICAgICAgICAgICAgIH1icmVhazsKLSAgICAgICAgICAgICAgICBjYXNlIFNFVF9QQVJBTUVURVJTOiB7Ci0gICAgICAgICAgICAgICAgICAgIFBhcmFtZXRlcnNEYXRhICpkYXRhID0gKFBhcmFtZXRlcnNEYXRhICopY29tbWFuZC0+bVBhcmFtOwotICAgICAgICAgICAgICAgICAgICBBTE9HVigiQXVkaW9Db21tYW5kVGhyZWFkKCkgcHJvY2Vzc2luZyBzZXQgcGFyYW1ldGVycyBzdHJpbmcgJXMsIGlvICVkIiwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBkYXRhLT5tS2V5VmFsdWVQYWlycy5zdHJpbmcoKSwgZGF0YS0+bUlPKTsKLSAgICAgICAgICAgICAgICAgICAgY29tbWFuZC0+bVN0YXR1cyA9IEF1ZGlvU3lzdGVtOjpzZXRQYXJhbWV0ZXJzKGRhdGEtPm1JTywgZGF0YS0+bUtleVZhbHVlUGFpcnMpOwotICAgICAgICAgICAgICAgICAgICBpZiAoY29tbWFuZC0+bVdhaXRTdGF0dXMpIHsKLSAgICAgICAgICAgICAgICAgICAgICAgIGNvbW1hbmQtPm1Db25kLnNpZ25hbCgpOwotICAgICAgICAgICAgICAgICAgICAgICAgbVdhaXRXb3JrQ1Yud2FpdChtTG9jayk7Ci0gICAgICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICAgICAgZGVsZXRlIGRhdGE7Ci0gICAgICAgICAgICAgICAgICAgIH1icmVhazsKLSAgICAgICAgICAgICAgICBjYXNlIFNFVF9WT0lDRV9WT0xVTUU6IHsKLSAgICAgICAgICAgICAgICAgICAgVm9pY2VWb2x1bWVEYXRhICpkYXRhID0gKFZvaWNlVm9sdW1lRGF0YSAqKWNvbW1hbmQtPm1QYXJhbTsKLSAgICAgICAgICAgICAgICAgICAgQUxPR1YoIkF1ZGlvQ29tbWFuZFRocmVhZCgpIHByb2Nlc3Npbmcgc2V0IHZvaWNlIHZvbHVtZSB2b2x1bWUgJWYiLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRhdGEtPm1Wb2x1bWUpOwotICAgICAgICAgICAgICAgICAgICBjb21tYW5kLT5tU3RhdHVzID0gQXVkaW9TeXN0ZW06OnNldFZvaWNlVm9sdW1lKGRhdGEtPm1Wb2x1bWUpOwotICAgICAgICAgICAgICAgICAgICBpZiAoY29tbWFuZC0+bVdhaXRTdGF0dXMpIHsKLSAgICAgICAgICAgICAgICAgICAgICAgIGNvbW1hbmQtPm1Db25kLnNpZ25hbCgpOwotICAgICAgICAgICAgICAgICAgICAgICAgbVdhaXRXb3JrQ1Yud2FpdChtTG9jayk7Ci0gICAgICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICAgICAgZGVsZXRlIGRhdGE7Ci0gICAgICAgICAgICAgICAgICAgIH1icmVhazsKLSAgICAgICAgICAgICAgICBkZWZhdWx0OgotICAgICAgICAgICAgICAgICAgICBBTE9HVygiQXVkaW9Db21tYW5kVGhyZWFkKCkgdW5rbm93biBjb21tYW5kICVkIiwgY29tbWFuZC0+bUNvbW1hbmQpOwotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICBkZWxldGUgY29tbWFuZDsKLSAgICAgICAgICAgICAgICB3YWl0VGltZSA9IElOVDY0X01BWDsKLSAgICAgICAgICAgIH0gZWxzZSB7Ci0gICAgICAgICAgICAgICAgd2FpdFRpbWUgPSBtQXVkaW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jb21tYW5kICVzIiwKLSAgICAgICAgICAgICAgICAgICAgZGF0YTItPm1LZXlWYWx1ZVBhaXJzLnN0cmluZygpLCBkYXRhLT5tS2V5VmFsdWVQYWlycy5zdHJpbmcoKSk7Ci0gICAgICAgICAgICBBdWRpb1BhcmFtZXRlciBwYXJhbSA9IEF1ZGlvUGFyYW1ldGVyKGRhdGEtPm1LZXlWYWx1ZVBhaXJzKTsKLSAgICAgICAgICAgIEF1ZGlvUGFyYW1ldGVyIHBhcmFtMiA9IEF1ZGlvUGFyYW1ldGVyKGRhdGEyLT5tS2V5VmFsdWVQYWlycyk7Ci0gICAgICAgICAgICBmb3IgKHNpemVfdCBqID0gMDsgaiA8IHBhcmFtLnNpemUoKTsgaisrKSB7Ci0gICAgICAgICAgICAgICAgU3RyaW5nOCBrZXk7Ci0gICAgICAgICAgICAgICAgU3RyaW5nOCB2YWx1ZTsKLSAgICAgICAgICAgICAgICBwYXJhbS5nZXRBdChqLCBrZXksIHZhbHVlKTsKLSAgICAgICAgICAgICAgICBmb3IgKHNpemVfdCBrID0gMDsgayA8IHBhcmFtMi5zaXplKCk7IGsrKykgewotICAgICAgICAgICAgICAgICAgICBTdHJpbmc4IGtleTI7Ci0gICAgICAgICAgICAgICAgICAgIFN0cmluZzggdmFsdWUyOwotICAgICAgICAgICAgICAgICAgICBwYXJhbTIuZ2V0QXQoaywga2V5MiwgdmFsdWUyKTsKLSAgICAgICAgICAgICAgICAgICAgaWYgKGtleTIgPT0ga2V5KSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICBwYXJhbTIucmVtb3ZlKGtleTIpOwotICAgICAgICAgICAgICAgICAgICAgICAgQUxPR1YoIkZpbHRlcmluZyBvdXQgcGFyYW1ldGVyICVzIiwga2V5Mi5zdHJpbmcoKSk7Ci0gICAgICAgICAgICAgICAgICAgICAgICBicmVhazsKLSAgICAgICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgIH0KLSAgICAgICAgICAg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aXJzLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRlbGF5TXMpOwotfQotCi1pbnQgQXVkaW9Qb2xpY3lTZXJ2aWNlOjpzZXRTdHJlYW1Wb2x1bWUoYXVkaW9fc3RyZWFtX3R5cGVfdCBzdHJlYW0sCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZmxvYXQgdm9sdW1lLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGF1ZGlvX2lvX2hhbmRsZV90IG91dHB1dCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpbnQgZGVsYXlNcykKLXsKLSAgICByZXR1cm4gKGludCltQXVkaW9Db21tYW5kVGhyZWFkLT52b2x1bWVDb21tYW5kKHN0cmVhbSwgdm9sdW1lLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgb3V0cHV0LCBkZWxheU1zKTsKLX0KLQotaW50IEF1ZGlvUG9saWN5U2VydmljZTo6c3RhcnRUb25lKGF1ZGlvX3BvbGljeV90b25lX3QgdG9uZSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBhdWRpb19zdHJlYW1fdHlwZV90IHN0cmVhbSkKLXsKLSAgICBpZiAodG9uZSAhPSBBVURJT19QT0xJQ1lfVE9ORV9JTl9DQUxMX05PVElGSUNBVElPTikKLSAgICAgICAgQUxPR0UoInN0YXJ0VG9uZTogaWxsZWdhbCB0b25lIHJlcXVlc3RlZCAoJWQpIiwgdG9uZSk7Ci0gICAgaWYgKHN0cmVhbSAhPSBBVURJT19TVFJFQU1fVk9JQ0VfQ0FMTCkKLSAgICAgICAgQUxPR0UoInN0YXJ0VG9uZTogaWxsZWdhbCBzdHJlYW0gKCVkKSByZXF1ZXN0ZWQgZm9yIHRvbmUgJWQiLCBzdHJlYW0sCi0gICAgICAgICAgICB0b25lKTsKLSAgICBtVG9uZVBsYX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SAgICBWT0lDRV9SRUNfU1JDX1RBRywKLSAgICBWT0lDRV9DT01NX1NSQ19UQUcKLX07Ci0KLS8vIHJldHVybnMgdGhlIGF1ZGlvX3NvdXJjZV90IGVudW0gY29ycmVzcG9uZGluZyB0byB0aGUgaW5wdXQgc291cmNlIG5hbWUgb3IKLS8vIEFVRElPX1NPVVJDRV9DTlQgaXMgbm8gbWF0Y2ggZm91bmQKLWF1ZGlvX3NvdXJjZV90IEF1ZGlvUG9saWN5U2VydmljZTo6aW5wdXRTb3VyY2VOYW1lVG9FbnVtKGNvbnN0IGNoYXIgKm5hbWUpCi17Ci0gICAgaW50IGk7Ci0gICAgZm9yIChpID0gQVVESU9fU09VUkNFX01JQzsgaSA8IEFVRElPX1NPVVJDRV9DTlQ7IGkrKykgewotICAgICAgICBpZiAoc3RyY21wKG5hbWUsIGtJbnB1dFNvdXJjZU5hbWVzW2kgLSBBVURJT19TT1VSQ0VfTUlDXSkgPT0gMCkgewotICAgICAgICAgICAgQUxPR1YoImlucHV0U291cmNlTmFtZVRvRW51bSBmb3VuZCBzb3VyY2UgJXMgJWQiLCBuYW1lLCBpKTsKLSAgICAgICAgICAgIGJyZWFrOwotICAgICAgICB9Ci0gICAgfQotICAgIHJldHVybiAoYXVkaW9fc291cmNlX3QpaTsKLX0KLQotc2l6ZV90IEF1ZGlvUG9saWN5U2VydmljZTo6Z3Jvd1BhcmFtU2l6ZShjaGFyICpwYXJhbSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2l6ZV90IHNpemUsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNpemVfdCAqY3VyU2l6ZSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2l6ZV90ICp0b3RTaXplKQotewotICAgIC8vICpjdXJTaXplIGlzIGF0IGxlYXN0IHNpemVvZihlZmZlY3RfcGFyYW1fdCkgKyAyICogc2l6ZW9mKGludCkKLSAgICBzaXplX3QgcG9zID0gKCgqY3VyU2l6ZSAtIDEgKSAvIHNpemUgKyAxKSAqIHNpemU7Ci0KLSAgICBpZiAocG9zICsgc2l6ZSA+ICp0b3RTaXplKSB7Ci0gICAgICAgIHdoaWxlIChwb3MgKyBzaXplID4gKnRvdFNpemUpIHsKLSAgICAgICAgICAgICp0b3RTaXplICs9ICgoKnRvdFNpemUgKyA3KSAvIDgpICogNDsKLSAgICAgICAgfQotICAgICAgICBwYXJhbSA9IChjaGFyICopcmVhbGxvYyhwYXJhbSwgKnRvdFNpemUpOwotICAgIH0KLSAgICAqY3VyU2l6ZSA9IHBvcyArIHNpemU7Ci0gICAgcmV0dXJuIHBvczsKLX0KLQotc2l6ZV90IEF1ZGlvUG9saWN5U2VydmljZTo6cmVhZFBhcmFtVmFsdWUoY25vZGUgKm5vZGUsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjaGFyICpwYXJhbSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNpemVfdCAqY3VyU2l6ZSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNpemVfdCAqdG90U2l6ZSkKLXsKLSAgICBpZiAoc3RybmNtcChub2RlLT5uYW1lLCBTSE9SVF9UQUcsIHNpemVvZihTSE9SVF9UQUcpICsgMSkgPT0gMCkgewotICAgICAgICBzaXplX3QgcG9zID0gZ3Jvd1BhcmFtU2l6ZShwYXJhbSwgc2l6ZW9mKHNob3J0KSwgY3VyU2l6ZSwgdG90U2l6ZSk7Ci0gICAgICAgICooc2hvcnQgKikoKGNoYXIgKilwYXJhbSArIHBvcykgPSAoc2hvcnQpYXRvaShub2RlLT52YWx1ZSk7Ci0gICAgICAgIEFMT0dWKCJyZWFkUGFyYW1WYWx1ZSgpIHJlYWRpbmcgc2hvcnQgJWQiLCAqKHNob3J0ICopKChjaGFyICopcGFyYW0gKyBwb3MpKTsKLSAgICAgICAgcmV0d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wYXJhbSA9IGxvYWRFZmZlY3RQYXJhbWV0ZXIobm9kZSk7Ci0gICAgICAgIGlmIChwYXJhbSA9PSBOVUxMKSB7Ci0gICAgICAgICAgICBub2RlID0gbm9kZS0+bmV4dDsKLSAgICAgICAgICAgIGNvbnRpbnVlOwotICAgICAgICB9Ci0gICAgICAgIHBhcmFtcy5hZGQocGFyYW0pOwotICAgICAgICBub2RlID0gbm9kZS0+bmV4dDsKLSAgICB9Ci19Ci0KLUF1ZGlvUG9saWN5U2VydmljZTo6SW5wdXRTb3VyY2VEZXNjICpBdWRpb1BvbGljeVNlcnZpY2U6OmxvYWRJbnB1dFNvdXJjZSgKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNub2RlICpyb290LAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY29uc3QgVmVjdG9yIDxFZmZlY3REZXNjICo+JiBlZmZlY3RzKQotewotICAgIGNub2RlICpub2RlID0gcm9vdC0+Zmlyc3RfY2hpbGQ7Ci0gICAgaWYgKG5vZGUgPT0gTlVMTCkgewotICAgICAgICBBTE9HVygibG9hZElucHV0U291cmNlKCkgZW1wdHkgZWxlbWVudCAlcyIsIHJvb3QtPm5hbWUpOwotICAgICAgICByZXR1cm4gTlVMTDsKLSAgICB9Ci0gICAgSW5wdXRTb3VyY2VEZXNjICpzb3VyY2UgPSBuZXcgSW5wdXRTb3VyY2VEZXNjKCk7Ci0gICAgd2hpbGUgKG5vZGUpIHsKLSAgICAgICAgc2l6ZV90IGk7Ci0gICAgICAgIGZvciAoaSA9IDA7IGkgPCBlZmZlY3RzLnNpemUoKTsgaSsrKSB7Ci0gICAgICAgICAgICBpZiAoc3RybmNtcChlZmZlY3RzW2ldLT5tTmFtZSwgbm9kZS0+bmFtZSwgRUZGRUNUX1NUUklOR19MRU5fTUFYKSA9PSAwKSB7Ci0gICAgICAgICAgICAgICAgQ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gICAgICAgICAgICAgICAgICAgIHVpbnQzMl90ICpwU2FtcGxpbmdSYXRlLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYXVkaW9fZm9ybWF0X3QgKnBGb3JtYXQsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB1aW50MzJfdCAqcENoYW5uZWxzLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdWludDMyX3QgKnBMYXRlbmN5TXMsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBhdWRpb19wb2xpY3lfb3V0cHV0X2ZsYWdzX3QgZmxhZ3MpCi17Ci0gICAgc3A8SUF1ZGlvRmxpbmdlcj4gYWYgPSBBdWRpb1N5c3RlbTo6Z2V0X2F1ZGlvX2ZsaW5nZXIoKTsKLSAgICBpZiAoYWYgPT0gMCkgewotICAgICAgICBBTE9HVygiJXM6IGNvdWxkIG5vdCBnZXQgQXVkaW9GbGluZ2VyIiwgX19mdW5jX18pOwotICAgICAgICByZXR1cm4gMDsKLSAgICB9Ci0KLSAgICByZXR1cm4gYWYtPm9wZW5PdXRwdXQocERldmljZXMsIHBTYW1wbGluZ1JhdGUsIHBGb3JtYXQsIHBDaGFubmVscywKLSAgICAgICAgICAgICAgICAgICAgICAgICAgcExhdGVuY3lNcywgZmxhZ3MpOwotfQotCi1zdGF0aWMgYXVkaW9faW9faGFuZGxlX3QgYXBzX29wZW5fZHVwX291dHB1dCh2b2lkICpzZXJ2aWNlLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGF1ZGlvX2lvX2hhbmRsZV90IG91dHB1dDEsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYXVkaW9faW9faGFuZGxlX3Qgb3V0cHV0MikKLXsKLSAgICBzcDxJQXVkaW9GbGluZ2VyPiBhZiA9IEF1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dHB1dCkKLXsKLSAgICBzcDxJQXVkaW9GbGluZ2VyPiBhZiA9IEF1ZGlvU3lzdGVtOjpnZXRfYXVkaW9fZmxpbmdlcigpOwotICAgIGlmIChhZiA9PSAwKSB7Ci0gICAgICAgIEFMT0dXKCIlczogY291bGQgbm90IGdldCBBdWRpb0ZsaW5nZXIiLCBfX2Z1bmNfXyk7Ci0gICAgICAgIHJldHVybiBQRVJNSVNTSU9OX0RFTklFRDsKLSAgICB9Ci0KLSAgICByZXR1cm4gYWYtPnJlc3RvcmVPdXRwdXQob3V0cHV0KTsKLX0KLQotc3RhdGljIGF1ZGlvX2lvX2hhbmRsZV90IGFwc19vcGVuX2lucHV0KHZvaWQgKnNlcnZpY2UsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHVpbnQzMl90ICpwRGV2aWNlcywKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdWludDMyX3QgKnBTYW1wbGluZ1JhdGUsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGF1ZGlvX2Zvcm1hdF90ICpwRm9ybWF0LAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB1aW50MzJfdCAqcENoYW5uZWxzLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBhdWRpb19pbl9hY291c3RpY3NfdCBhY291c3RpY3MpCi17Ci0gICAgc3A8SUF1ZGlvRmxpbmdlcj4gYWYgPSBBdWRpb1N5c3RlbTo6Z2V0X2F1ZGlvX2ZsaW5nZXIoKTsKLSAgICBpZiAoYWYgPT0gMCkgewotICAgICAgICBBTE9HVygiJXM6IGNvdWxkIG5vdCBnZXQgQXVkaW9GbGluZ2VyIiwgX19mdW5jX18pOwotICAgICAgICByZXR1cm4gMDsKLSAgICB9Ci0KLSAgICByZXR1cm4gYWYtPm9wZW5JbnB1dChwRGV2aWNlcywgcFNhbXB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cmVzcyk7Ci0gICAgdmlydHVhbCBhdWRpb19wb2xpY3lfZGV2X3N0YXRlX3QgZ2V0RGV2aWNlQ29ubmVjdGlvblN0YXRlKAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGF1ZGlvX2RldmljZXNfdCBkZXZpY2UsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY29uc3QgY2hhciAqZGV2aWNlX2FkZHJlc3MpOwotICAgIHZpcnR1YWwgc3RhdHVzX3Qgc2V0UGhvbmVTdGF0ZShhdWRpb19tb2RlX3Qgc3RhdGUpOwotICAgIHZpcnR1YWwgc3RhdHVzX3Qgc2V0Rm9yY2VVc2UoYXVkaW9fcG9saWN5X2ZvcmNlX3VzZV90IHVzYWdlLCBhdWRpb19wb2xpY3lfZm9yY2VkX2NmZ190IGNvbmZpZyk7Ci0gICAgdmlydHVhbCBhdWRpb19wb2xpY3lfZm9yY2VkX2NmZ190IGdldEZvcmNlVXNlKGF1ZGlvX3BvbGljeV9mb3JjZV91c2VfdCB1c2FnZSk7Ci0gICAgdmlydHVhbCBhdWRpb19pb19oYW5kbGVfdCBnZXRPdXRwdXQoYXVkaW9fc3RyZWFtX3R5cGVfdCBzdHJlYW0sCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdWludDMyX3Qgc2FtcGxpbmdSYXRlID0gMCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBhdWRpb19mb3JtYXRfdCBmb3JtYXQgPSBBVURJT19GT1JNQVRfREVGQVVMVCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB1aW50MzJfdCBjaGFubmVscyA9IDAsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYXVkaW9fcG9saWN5X291dHB1dF9mbGFnc190IGZsYWdzID0KLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEFVRElPX1BPTElDWV9PVVRQVVRfRkxBR19OT05FKTsKLSAgICB2aXJ0dWFsIHN0YXR1c190IHN0YXJ0T3V0cHV0KGF1ZGlvX2lvX2hhbmRsZV90IG91dHB1dCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGF1ZGlvX3N0cmVhbV90eXBlX3Qgc3RyZWFtLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaW50IHNlc3Npb24gPSAwKTsKLSAgICB2aXJ0dWFsIHN0YXR1c190IHN0b3BPdXRwdXQoYXVkaW9faW9faGFuZGxlX3Qgb3V0cHV0LAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBhdWRpb19zdHJlYW1fdHlwZV90IHN0cmVhbSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaW50IHNlc3Npb24gPSAwKTsKLSAgICB2aXJ0dWFsIHZvaWQgcmVsZWFzZU91dHB1dChhdWRpb19pb19oYW5kbGVfdCBvdXRwdXQpOwotICAgIHZpcnR1YWwgYXVkaW9faW9faGFuZGxlX3QgZ2V0SW5wdXQoYXVkaW9fc291cmNlX3QgaW5wdXRTb3VyY2UsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB1aW50MzJfdCBzYW1wbGluZ1JhdGUgPSAwLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYXVkaW9fZm9ybWF0X3QgZm9ybWF0ID0gQVVESU9fRk9STUFUX0RFRkFVTFQsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB1aW50MzJfdCBjaGFubmVscyA9IDAsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBhdWRpb19pbl9hY291c3RpY3NfdCBhY291c3RpY3MgPQotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoYXVkaW9faW5fYWNvdXN0aWNzX3QpMCAvKkFVRElPX0lOX0FDT1VTVElDU19OT05FKi8sCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpbnQgYXVkaW9TZXNzaW9uID0gMCk7Ci0gICAgdmlydHVhbCBzdGF0dXNfdCBzdGFydElucHV0KGF1ZGlvX2lvX2hhbmRsZV90IGlucHV0KTsKLSAgICB2aXJ0dWFsIHN0YXR1c190IHN0b3BJbnB1dChhdWRpb19pb19oYW5kbGVfdCBpbnB1dCk7Ci0gICAgdmlydHVhbCB2b2lkIHJlbGVhc2VJbnB1dChhdWRpb19pb19oYW5kbGVfdCBpbnB1dCk7Ci0gICAgdmlydHVhbCBzdGF0dXNfdCBpbml0U3RyZWFtVm9sdW1lKGF1ZGlvX3N0cmVhbV90eXBlX3Qgc3RyZWFtLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpbnQgaW5kZXhNaW4sCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGludCBpbmRleE1heCk7Ci0gICAgdmlydHVhbCBzdGF0dXNfdCBzZXRTdHJlYW1Wb2x1bWVJbmRleChhdWRpb19zdHJlYW1fdHlwZV90IHN0cmVhbSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGludCBpbmRleCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGF1ZGlvX2RldmljZXNfdCBkZXZpY2UpOwotICAgIHZpcnR1YWwgc3RhdHVzX3QgZ2V0U3RyZWFtVm9sdW1lSW5kZXgoYXVkaW9fc3RyZWFtX3R5cGVfdCBzdHJlYW0sCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpbnQgKmluZGV4LAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYXVkaW9fZGV2aWNlc190IGRldmljZSk7Ci0KLSAgICB2aXJ0dWFsIHVpbnQzMl90IGdldFN0cmF0Z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SAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB1aW50MzJfdCAqY291bnQpOwotICAgIHZpcnR1YWwgICAgIHN0YXR1c190ICAgIG9uVHJhbnNhY3QoCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHVpbnQzMl90IGNvZGUsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbnN0IFBhcmNlbCYgZGF0YSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgUGFyY2VsKiByZXBseSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdWludDMyX3QgZmxhZ3MpOwotCi0gICAgLy8gSUJpbmRlcjo6RGVhdGhSZWNpcGllbnQKLSAgICB2aXJ0dWFsICAgICB2b2lkICAgICAgICBiaW5kZXJEaWVkKGNvbnN0IHdwPElCaW5kZXI+JiB3aG8pOwotCi0gICAgLy8KLSAgICAvLyBIZWxwZXJzIGZvciB0aGUgc3RydWN0IGF1ZGlvX3BvbGljeV9zZXJ2aWNlX29wcyBpbXBsZW1lbnRhdGlvbi4KLSAgICAvLyBUaGlzIGlzIHVzZWQgYnkgdGhlIGF1ZGlvIHBvbGljeSBtYW5hZ2VyIGZvciBjZXJ0YWluIG9wZXJhdGlvbnMgdGhhdAotICAgIC8vIGFyZSBpbXBsZW1lbnRlZCBieSB0aGUgcG9saWN5IHNlcnZpY2UuCi0gICAgLy8KLSAgICB2aXJ0dWFsIHZvaWQgc2V0UGFyYW1ldGVycyhhdWRpb19pb19oYW5kbGVfdCBpb0hhbmRsZSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb25zdCBjaGFyICprZXlWYWx1ZVBhaXJzLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGludCBkZWxheU1zKTsKLQotICAgIHZpcnR1YWwgc3RhdHVzX3Qgc2V0U3RyZWFtVm9sdW1lKGF1ZGlvX3N0cmVhbV90eXBlX3Qgc3RyZWFtLAotICAgICAg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AgICAgICAgIHZvaWQgICAgICAgIHN0YXJ0VG9uZUNvbW1hbmQoVG9uZUdlbmVyYXRvcjo6dG9uZV90eXBlIHR5cGUsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYXVkaW9fc3RyZWFtX3R5cGVfdCBzdHJlYW0pOwotICAgICAgICAgICAgICAgICAgICB2b2lkICAgICAgICBzdG9wVG9uZUNvbW1hbmQoKTsKLSAgICAgICAgICAgICAgICAgICAgc3RhdHVzX3QgICAgdm9sdW1lQ29tbWFuZChhdWRpb19zdHJlYW1fdHlwZV90IHN0cmVhbSwgZmxvYXQgdm9sdW1lLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBhdWRpb19pb19oYW5kbGVfdCBvdXRwdXQsIGludCBkZWxheU1zID0gMCk7Ci0gICAgICAgICAgICAgICAgICAgIHN0YXR1c190ICAgIHBhcmFtZXRlcnNDb21tYW5kKGF1ZGlvX2lvX2hhbmRsZV90IGlvSGFuZGxlLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb25zdCBjaGFyICprZXlWYWx1ZVBhaXJzLCBpbnQgZGVsYXlNcyA9IDApOwotICAgICAgICAgICAgICAgICAgICBzdGF0dXNfdCAgICB2b2ljZVZvbHVtZUNvbW1hbmQoZmxvYXQgdm9sdW1lLCBpbnQgZGVsYXlNcyA9IDApOwotICAgICAgICAgICAgICAgICAgICB2b2lkICAgICAgICBpbnNlcnRDb21tYW5kX2woQXVkaW9Db21tYW5kICpjb21tYW5kLCBpbnQgZGVsYXlNcyA9IDApOwotCi0gICAgcHJpdmF0ZToKLSAgICAgICAgLy8gZGVzY3JpcHRvciBmb3IgcmVxdWVzdGVkIHRvbmUgcGxheWJhY2sgZXZlbnQKLSAgICAgICAgY2xhc3MgQXVkaW9Db21tYW5kIHsKLQotICAgICAgICBwdWJsaWM6Ci0gICAgICAgICAgICBBdWRpb0NvbW1hbmQ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VzYyhjb25zdCBFZmZlY3REZXNjJiBvcmlnKSA6Ci0gICAgICAgICAgICAgICAgICAgICAgICBtTmFtZShzdHJkdXAob3JpZy5tTmFtZSkpLAotICAgICAgICAgICAgICAgICAgICAgICAgbVV1aWQob3JpZy5tVXVpZCkgewotICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vIGRlZXAgY29weSBtUGFyYW1zCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgZm9yIChzaXplX3QgayA9IDA7IGsgPCBvcmlnLm1QYXJhbXMuc2l6ZSgpOyBrKyspIHsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZWZmZWN0X3BhcmFtX3QgKm9yaWdQYXJhbSA9IG9yaWcubVBhcmFtc1trXTsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gcHNpemUgYW5kIHZzaXplIGFyZSByb3VuZGVkIHVwIHRvIGFuIGludCBib3VuZGFyeSBmb3IgYWxsb2NhdGlvbgotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzaXplX3Qgb3JpZ1NpemUgPSBzaXplb2YoZWZmZWN0X3BhcmFtX3QpICsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKChvcmlnUGFyYW0tPnBzaXplICsgMykgJiB+MykgKwotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoKG9yaWdQYXJhbS0+dnNpemUgKyAzKSAmIH4zKTsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZWZmZWN0X3BhcmFtX3QgKmR1cFBhcmFtID0gKGVmZmVjdF9wYXJhbV90ICopIG1hbGxvYyhvcmlnU2l6ZSk7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1lbWNweShkdXBQYXJhbSwgb3JpZ1BhcmFtLCBvcmlnU2l6ZSk7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vIFRoaXMgd29ya3MgYmVjYXVzZSB0aGUgcGFyYW0gYnVmZmVyIGFsbG9jYXRpb24gaXMgYWxzbyBkb25lIGJ5Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vIG11bHRpcGxlcyBvZiA0IGJ5dGVzIG9yaWdpbmFsbHkuIEluIHRoZW9yeSB3ZSBzaG91bGQgbWVtY3B5IG9ubHkKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gdGhlIGFjdHVhbCBwYXJhbSBzaXplLCB0aGF0IGlzIHdpdGhvdXQgcm91bmRpbmcgdnNpemUuCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1QYXJhbXMuYWRkKGR1cFBhcmFtKTsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgICAgICAgICB9Ci0gICAgICAgIC8qdmlydHVhbCovIH5FZmZlY3REZXNjKCkgewotICAgICAgICAgICAgZnJlZShtTmFtZSk7Ci0gICAgICAgICAgICBmb3IgKHNpemVfdCBrID0gMDsgayA8IG1QYXJhbXMuc2l6ZSgpOyBrKyspIHsKLSAgICAgICAgICAgICAgICBmcmVlKG1QYXJhbXNba10pOwotICAgICAgICAgICAgfQotICAgICAgICB9Ci0gICAgICAgIGNoYXIgKm1OYW1lOwotICAgICAgICBlZmZlY3RfdXVpZF90IG1VdWlkOwotICAgICAgICBWZWN0b3IgPGVmZmVjdF9wYXJhbV90ICo+IG1QYXJhbXM7Ci0gICAgfTsKLQotICAgIGNsYXNzIElucHV0U291cmNlRGVzYyB7Ci0gICAgcHVibGljOgotICAgICAgICBJbnB1dFNvdXJjZURlc2MoKSB7fQotICAgICAgICAvKnZpcnR1YWwqLyB+SW5wdXRTb3VyY2VEZXNjKCkgewotICAgICAgICAgICAgZm9yIChzaXplX3QgaiA9IDA7IGogPCBtRWZmZWN0cy5zaXplKCk7IGorKykgewotICAgICAgICAgICAgICAgIGRlbGV0ZSBtRWZmZWN0c1tqXTsKLS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RWZmZWN0RGVzYyAqPiYgZWZmZWN0cyk7Ci0gICAgdm9pZCBsb2FkRWZmZWN0UGFyYW1ldGVycyhjbm9kZSAqcm9vdCwgVmVjdG9yIDxlZmZlY3RfcGFyYW1fdCAqPiYgcGFyYW1zKTsKLSAgICBlZmZlY3RfcGFyYW1fdCAqbG9hZEVmZmVjdFBhcmFtZXRlcihjbm9kZSAqcm9vdCk7Ci0gICAgc2l6ZV90IHJlYWRQYXJhbVZhbHVlKGNub2RlICpub2RlLAotICAgICAgICAgICAgICAgICAgICAgICAgICBjaGFyICpwYXJhbSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgc2l6ZV90ICpjdXJTaXplLAotICAgICAgICAgICAgICAgICAgICAgICAgICBzaXplX3QgKnRvdFNpemUpOwotICAgIHNpemVfdCBncm93UGFyYW1TaXplKGNoYXIgKnBhcmFtLAotICAgICAgICAgICAgICAgICAgICAgICAgIHNpemVfdCBzaXplLAotICAgICAgICAgICAgICAgICAgICAgICAgIHNpemVfdCAqY3VyU2l6ZSwKLSAgICAgICAgICAgICAgICAgICAgICAgICBzaXplX3QgKnRvdFNpemUpOwotCi0gICAgLy8gSW50ZXJuYWwgZHVtcCB1dGlsaXRpZXMuCi0gICAgc3RhdHVzX3QgZHVtcFBlcm1pc3Npb25EZW5pYWwoaW50IGZkKTsKLQotCi0gICAgbXV0YWJsZSBNdXRleCBtTG9jazsgICAgLy8gcHJldmVudHMgY29uY3VycmVudCBhY2Nlc3MgdG8gQXVkaW9Qb2xpY3kgbWFuYWdlciBmdW5jdGlvbnMgY2hhbmdpbmcKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyBkZXZpY2UgY29ubmVjdGlvbiBzdGF0ZSAgb3Igcm91dGluZwotICAgIHNwPEF1ZGlvQ29tbWFuZFRocmVhZD4gbUF1ZGlvQ29tbWFuZFRocmVhZDsgICAgIC8vIGF1ZGlvIGNvbW1hbmRzIHRocmVhZAotICAgIHNwPEF1ZGlvQ29tbWFuZFR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mRleCwgb3V0LCBpbnB1dEluZGV4LCB2bCwgdnIsCi0gICAgICAgICAgICAgICAgICAgICAgICBwaGFzZUZyYWN0aW9uLCBwaGFzZUluY3JlbWVudCk7Ci0gICAgICAgIH0KLSNlbmRpZiAgLy8gQVNNX0FSTV9SRVNBTVAxCi0KLSAgICAgICAgd2hpbGUgKG91dHB1dEluZGV4IDwgb3V0cHV0U2FtcGxlQ291bnQgJiYgaW5wdXRJbmRleCA8IG1CdWZmZXIuZnJhbWVDb3VudCkgewotICAgICAgICAgICAgaW50MzJfdCBzYW1wbGUgPSBJbnRlcnAoaW5baW5wdXRJbmRleC0xXSwgaW5baW5wdXRJbmRleF0sCi0gICAgICAgICAgICAgICAgICAgIHBoYXNlRnJhY3Rpb24pOwotICAgICAgICAgICAgb3V0W291dHB1dEluZGV4KytdICs9IHZsICogc2FtcGxlOwotICAgICAgICAgICAgb3V0W291dHB1dEluZGV4KytdICs9IHZyICogc2FtcGxlOwotICAgICAgICAgICAgQWR2YW5jZSgmaW5wdXRJbmRleCwgJnBoYXNlRnJhY3Rpb24sIHBoYXNlSW5jcmVtZW50KTsKLSAgICAgICAgfQotCi0KLSAgICAgICAgLy8gQUxPR0UoImxvb3AgZG9uZSAtIG91dHB1dEluZGV4PSVkLCBpbnB1dEluZGV4PSVkIiwgb3V0cHV0SW5kZXgsIGlucHV0SW5kZXgpOwotCi0gICAgICAgIC8vIGlmIGRvbmUgd2l0aCBidWZmZXIsIHNhdmUgc2FtcGxlcwotICAgICAgICBpZiAoaW5wdXRJbmRleCA+PSBtQnVmZmVyLmZyYW1lQ291bnQpIHsKLSAgICAgICAgICAgIGlucHV0SW5kZXggLT0gbUJ1ZmZlci5mcmFtZUNvdW50OwotCi0gICAgICAgICAgICAvLyBBTE9HRSgiYnVmZmVyIGRvbmUsIG5ldyBpbnB1dCBpbmRleCAlZCIsIGlucHV0SW5kZXgpOwotCi0gICAgICAgICAgICBtWDBMID0gbUJ1ZmZlci5pMTZbbUJ1ZmZl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nQgb3V0cHV0IGluZGV4Ci0qICAgICAgIG91dCA6IHBvaW50ZXIgb24gb3V0cHV0IGJ1ZmZlcgotKiAgICAgICBpbnB1dEluZGV4IDogcG9pbnRlciBvbiBjdXJyZW50IGlucHV0IGluZGV4Ci0qICAgICAgIHZsLCB2ciA6IGxlZnQgYW5kIHJpZ2h0IGdhaW4KLSogICAgICAgcGhhc2VGcmFjdGlvbiA6IHBvaW50ZXIgb24gY3VycmVudCBwaGFzZSBmcmFjdGlvbgotKiAgICAgICBwaGFzZUluY3JlbWVudAotKiAgIE91cHV0OgotKiAgICAgICBvdXRwdXRJbmRleCA6Ci0qICAgICAgIG91dCA6IHVwZGF0ZWQgYnVmZmVyCi0qICAgICAgIGlucHV0SW5kZXggOiBpbmRleCBvZiBuZXh0IHRvIHVzZQotKiAgICAgICBwaGFzZUZyYWN0aW9uIDogcGhhc2UgZnJhY3Rpb24gZm9yIG5leHQgaW50ZXJwb2xhdGlvbgotKgotKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KLV9fYXR0cmlidXRlX18oKG5vaW5saW5lKSkKLXZvaWQgQXVkaW9SZXNhbXBsZXJPcmRlcjE6OkFzbU1vbm8xNkxvb3AoaW50MTZfdCAqaW4sIGludDMyX3QqIG1heE91dFB0LCBpbnQzMl90IG1heEluSWR4LAotICAgICAgICAgICAgc2l6ZV90ICZvdXRwdXRJbmRleCwgaW50MzJfdCogb3V0LCBzaXplX3QgJmlucHV0SW5kZXgsIGludDMyX3QgdmwsIGludDMyX3QgdnIsCi0gICAgICAgICAgICB1aW50MzJfdCAmcGhhc2VGcmFjdGlvbiwgdWludDMyX3QgcGhhc2VJbmNyZW1lbnQpCi17Ci0jZGVmaW5lIE1PX1BBUkFNNSAgICIzNiIgICAgICAgIC8vIG9mZnNldCBvZiBwYXJhbWV0ZXIgNSAob3V0cHV0SW5kZXgpCi0KLSAgICBhc20oCi0gICAgICAgICJzdG1mZCAgc3AhLCB7cjQsIHI1LCByNiwgcjcsIHI4LCByOSwgcjEwLCByMTEsIGxyfVxuIgotICAgICAgICAvLyBnZXQgcGFyYW1ldGVycwotICAgICAgICAiICAgbGRyIHI2LCBbc3AsICMiIE1PX1BBUkFNNSAiICsgMjBdXG4iICAgIC8vICZwaGFzZUZyYWN0aW9uCi0gICAgICAgICIgICBsZHIgcjYsIFtyNl1cbiIgICAgICAgICAgICAgICAgICAgICAgICAgLy8gcGhhc2VGcmFjdGlvbgotICAgICAgICAiICAgbGRyIHI3LCBbc3AsICMiIE1PX1BBUkFNNSAiICsgOF1cbiIgICAgIC8vICZpbnB1dEluZGV4Ci0gICAgICAgICIgICBsZHIgcjcsIFtyN11cbiIgICAgICAgICAgICAgICAgICAgICAgICAgLy8gaW5wdXRJbmRleAotICAgICAgICAiICAgbGRyIHI4LCBbc3AsICMiIE1PX1BBUkFNNSAiICsgNF1cbiIgICAgIC8vIG91dAotICAgICAgICAiICAgbGRyIHIwLCBbc3AsICMiIE1PX1BBUkFNNSAiICsgMF1cbiIgICAgIC8vICZvdXRwdXRJbmRleAotICAgICAgICAiICAgbGRyIHIwLCBbcjBdXG4iICAgICAgICAgICAgICAgICAgICAgICAgIC8vIG91dHB1dEluZGV4Ci0gICAgICAgICIgICBhZGQgcjgsIHIwLCBhc2wgIzJcbiIgICAgICAgICAgICAgICAgICAgLy8gY3VyT3V0Ci0gICAgICAgICIgICBsZHIgcjksIFtzcCwgIyIgTU9fUEFSQU01ICIgKyAyNF1cbiIgICAgLy8gcGhhc2VJbmNyZW1lbnQKLSAgICAgICAgIiAgIGxkciByMTAsIFtzcCwgIyIgTU9fUEFSQU01ICIgKyAxMl1cbiIgICAvLyB2bAotICAgICAgICAiICAgbGRyIHIxMSwgW3NwLCAjIiBNT19QQVJBTTUgIiArIDE2XVxuIiAgIC8vIHZyCi0KLSAgICAgICAgLy8gcjAgcGluLCB4MCwgU2FtcAotCi0gICAgICAgIC8vIHIxIGluCi0gICAgICAgIC8vIHIyIG1heE91dFB0Ci0gICAgICAgIC8vIHIzIG1heEluSWR4Ci0KLSAgICAgICAgLy8gcjQgeDEsIGkxLCBpMywgT3V0MQotICAgICAgICAvLyByNSBvdXQwCi0KLSAgICAgICAgLy8gcjYgZnJhYwotICAgICAgICAvLyByNyBpbnB1dEluZGV4Ci0gICAgICAgIC8vIHI4IGN1ck91dAotCi0gICAgICAgIC8vIHI5IGluYwotICAgICAgICAvLyByMTAgdmwKLSAgICAgICAgLy8gcjExIHZyCi0KLSAgICAgICAgLy8gcjEyCi0gICAgICAgIC8vIHIxMyBzcAotICAgICAgICAvLyByMTQKLQotICAgICAgICAvLyB0aGUgZm9sbG93aW5nIGxvb3Agd29ya3Mgb24gMiBmcmFtZXMKLQotICAgICAgICAiMTpcbiIKLSAgICAgICAgIiAgIGNtcCByOCwgcjJcbiIgICAgICAgICAgICAgICAgICAgLy8gY3VyT3V0IC0gbWF4Q3VyT3V0Ci0gICAgICAgICIgICBiY3MgMmZcbiIKLQotI2RlZmluZSBNT19PTkVfRlJBTUUgXAotICAgICIgICBhZGQgcjAsIHIxLCByNywgYXNsICMxXG4iICAgICAgIC8qIGluICsgaW5wdXRJbmRleCAqL1wKLSAgICAiICAgbGRyc2ggcjQsIFtyMF1cbiIgICAgICAgICAgICAgICAvKiBpbltpbnB1dEluZGV4XSAqL1wKLSAgICAiICAgbGRyIHI1LCBbcjhdXG4iICAgICAgICAgICAgICAgICAvKiBvdXRbb3V0cHV0SW5kZXhdICovXAotICAgICIgICBsZHJzaCByMCwgW3IwLCAjLTJdXG4iICAgICAgICAgIC8qIGluW2lucHV0SW5kZXgtMV0gKi9cCi0gICAgIiAgIGJpYyByNiwgcjYsICMweEMwMDAwMDAwXG4iICAgICAgLyogcGhhc2VGcmFjdGlvbiAmIC4uLiAqL1wKLSAgICAiICAgc3ViIHI0LCByNCwgcjBcbiIgICAgICAgICAgICAgICAvKiBpbltpbnB1dEluZGV4XSAtIGluW2lucHV0SW5kZXgtMV0gKi9cCi0gICAgIiAgIG1vdiByNCwgcjQsIGxzbCAjMlxuIiAgICAgICAgICAgLyogPDwyICovXAotICAgICIgICBzbXVsd3QgcjQsIHI0LCByNlxuIiAgICAgICAgICAgIC8qICh4MS14MCkqLi4gKi9cCi0gICAgIiAgIGFkZCByNiwgcjYsIHI5XG4iICAgICAgICAgICAgICAgLyogcGhhc2VGcmFjdGlvbiArIHBoYXNlSW5jcmVtZW50ICovXAotICAgICIgICBhZGQgcjAsIHIwLCByNFxuIiAgICAgICAgICAgICAgIC8qIHgwIC0gKC4uKSAqL1wKLSAgICAiICAgbWxhIHI1LCByMCwgcjEwLCByNVxuIiAgICAgICAgICAvKiB2bCppbnRlcnAgKyBvdXRbXSAqL1wKLSAgICAiICAgbGRyIHI0LCBbcjgsICM0XVxuIiAgICAgICAgICAgICAvKiBvdXRbb3V0cHV0SW5kZXgrMV0gKi9cCi0gICAgIiAgIHN0ciByNSwgW3I4XSwgIzRcbiIgICAgICAgICAgICAgLyogb3V0W291dHB1dEluZGV4KytdID0gLi4uICovXAotICAgICIgICBtbGEgcjQsIHIwLCByMTEsIHI0XG4iICAgICAgICAgIC8qIHZyKmludGVycCArIG91dFtdICovXAotICAgICIgICBhZGQgcjcsIHI3LCByNiwgbHNyICMzMFxuIiAgICAgIC8qIGlucHV0SW5kZXggKyBwaGFzZUZyYWN0aW9uPj4zMCAqL1wKLSAgICAiICAgc3RyIHI0LCBbcjhdLCAjNFxuIiAgICAgICAgICAgICAvKiBvdXRbb3V0cHV0SW5kZXgrK10gPSAuLi4gKi8KLQotICAgICAgICBNT19PTkVfRlJBTUUgICAgLy8gZnJhbWUgMQotICAgICAgICBNT19PTkVfRlJBTUUgICAgLy8gZnJhbWUgMgotCi0gICAgICAgICIgICBjbXAgcjcsIHIzXG4iICAgICAgICAgICAgICAgICAgIC8vIGlucHV0SW5kZXggLSBtYXhJbklkeAotICAgICAgICAiICAgYmNjIDFiXG4iCi0gICAgICAgICIyOlxuIgotCi0gICAgICAgICIgICBiaWMgcjYsIHI2LCAjMHhDMDAwMDAwMFxuIiAgICAgICAgICAgICAvLyBwaGFzZUZyYWN0aW9uICYgLi4uCi0gICAgICAgIC8vIHNhdmUgbW9kaWZpZWQgdmFsdWVzCi0gICAgICAgICIgICBsZHIgcjAsIFtzcCwgIyIgTU9fUEFSQU01ICIgKyAyMF1cbiIgICAgLy8gJnBoYXNlRnJhY3Rpb24KLSAgICAgICAgIiAgIHN0ciByNiwgW3IwXVxuIiAgICAgICAgICAgICAgICAgICAgICAgICAvLyBwaGFzZUZyYWN0aW9uCi0gICAgICAgICIgICBsZHIgcjAsIFtzcCwgIyIgTU9fUEFSQU01ICIgKyA4XVxuIiAgICAgLy8gJmlucHV0SW5kZXgKLSAgICAgICAgIiAgIHN0ciByNywgW3IwXVxuIiAgICAgICAgICAgICAgICAgICAgICAgICAvLyBpbnB1dEluZGV4Ci0gICAgICAgICIgICBsZHIgcjAsIFtzcCwgIyIgTU9fUEFSQU01ICIgKyA0XVxuIiAgICAgLy8gb3V0Ci0gICAgICAgICIgICBzdWIgcjgsIHIwXG4iICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gY3VyT3V0IC0gb3V0Ci0gICAgICAgICIgICBhc3IgcjgsICMyXG4iICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gbmV3IG91dHB1dEluZGV4Ci0gICAgICAgICIgICBsZHIgcjAsIFtzcCwgIyIgTU9fUEFSQU01ICIgKyAwXVxuIiAgICAgLy8gJm91dHB1dEluZGV4Ci0gICAgICAgICIgICBzdHIgcjgsIFtyMF1cbiIgICAgICAgICAgICAgICAgICAgICAgICAgLy8gc2F2ZSBvdXRwdXRJbmRleAotCi0gICAgICAgICIgICBsZG1mZCAgIHNwISwge3I0LCByNSwgcjYsIHI3LCByOCwgcjksIHIxMCwgcjExLCBwY31cbiIKLSAgICApOwotfQotCi0vKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqK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gICAgIiAgIGFkZCByOCwgcjAsIGFzbCAjMlxuIiAgICAgICAgICAgICAgICAgICAvLyBjdXJPdXQKLSAgICAgICAgIiAgIGxkciByOSwgW3NwLCAjIiBTVF9QQVJBTTUgIiArIDI0XVxuIiAgICAvLyBwaGFzZUluY3JlbWVudAotICAgICAgICAiICAgbGRyIHIxMCwgW3NwLCAjIiBTVF9QQVJBTTUgIiArIDEyXVxuIiAgIC8vIHZsCi0gICAgICAgICIgICBsZHIgcjExLCBbc3AsICMiIFNUX1BBUkFNNSAiICsgMTZdXG4iICAgLy8gdnIKLQotICAgICAgICAvLyByMCBwaW4sIHgwLCBTYW1wCi0KLSAgICAgICAgLy8gcjEgaW4KLSAgICAgICAgLy8gcjIgbWF4T3V0UHQKLSAgICAgICAgLy8gcjMgbWF4SW5JZHgKLQotICAgICAgICAvLyByNCB4MSwgaTEsIGkzLCBvdXQxCi0gICAgICAgIC8vIHI1IG91dDAKLQotICAgICAgICAvLyByNiBmcmFjCi0gICAgICAgIC8vIHI3IGlucHV0SW5kZXgKLSAgICAgICAgLy8gcjggY3VyT3V0Ci0KLSAgICAgICAgLy8gcjkgaW5jCi0gICAgICAgIC8vIHIxMCB2bAotICAgICAgICAvLyByMTEgdnIKLQotICAgICAgICAvLyByMTIgdGVtcG9yYXJ5Ci0gICAgICAgIC8vIHIxMyBzcAotICAgICAgICAvLyByMTQKLQotICAgICAgICAiMzpcbiIKLSAgICAgICAgIiAgIGNtcCByOCwgcjJcbiIgICAgICAgICAgICAgICAgICAgLy8gY3VyT3V0IC0gbWF4Q3VyT3V0Ci0gICAgICAgICIgICBiY3MgNGZcbiIKLQotI2RlZmluZSBTVF9PTkVfRlJBTUUgXAotICAgICIgICBiaWMgcjYsIHI2LCAjMHhDMDAwMDAwMFxuIiAgICAgIC8qIHBoYXNlRnJhY3Rpb24gJiAuLi4gKi9cCi1cCi0gICAgIiAgIGFkZCByMCwgcjEsIHI3LCBhc2wgIzJcbiIgICAgICAgLyogaW4gKyAyKmlucHV0SW5kZXggKi9cCi1cCi0gICAgIiAgIGxkcnNoIHI0LCBbcjBdXG4iICAgICAgICAgICAgICAgLyogaW5bMippbnB1dEluZGV4XSAqL1wKLSAgICAiICAgbGRyIHI1LCBbcjhdXG4iICAgICAgICAgICAgICAgICAvKiBvdXRbb3V0cHV0SW5kZXhdICovXAotICAgICIgICBsZHJzaCByMTIsIFtyMCwgIy00XVxuIiAgICAgICAgIC8qIGluWzIqaW5wdXRJbmRleC0yXSAqL1wKLSAgICAiICAgc3ViIHI0LCByNCwgcjEyXG4iICAgICAgICAgICAgICAvKiBpblsyKklucHV0SW5kZXhdIC0gaW5bMipJbnB1dEluZGV4LTJdICovXAotICAgICIgICBtb3YgcjQsIHI0LCBsc2wgIzJcbiIgICAgICAgICAgIC8qIDw8MiAqL1wKLSAgICAiICAgc211bHd0IHI0LCByNCwgcjZcbiIgICAgICAgICAgICAvKiAoeDEteDApKi4uICovXAotICAgICIgICBhZGQgcjEyLCByMTIsIHI0XG4iICAgICAgICAgICAgIC8qIHgwIC0gKC4uKSAqL1wKLSAgICAiICAgbWxhIHI1LCByMTIsIHIxMCwgcjVcbiIgICAgICAgICAvKiB2bCppbnRlcnAgKyBvdXRbXSAqL1wKLSAgICAiICAgbGRyIHI0LCBbcjgsICM0XVxuIiAgICAgICAgICAgICAvKiBvdXRbb3V0cHV0SW5kZXgrMV0gKi9cCi0gICAgIiAgIHN0ciByNSwgW3I4XSwgIzRcbiIgICAgICAgICAgICAgLyogb3V0W291dHB1dEluZGV4KytdID0gLi4uICovXAotXAotICAgICIgICBsZHJzaCByMTIsIFtyMCwgIysyXVxuIiAgICAgICAgIC8qIGluWzIqaW5wdXRJbmRleCsxXSAqL1wKLSAgICAiICAgbGRyc2ggcjAsIFtyMCwgIy0yXVxuIiAgICAgICAgICAvKiBpblsyKmlucHV0SW5kZXgtMV0gKi9cCi0gICAgIiAgIHN1YiByMTIsIHIxMiwgcjBcbiIgICAgICAgICAgICAgLyogaW5bMipJbnB1dEluZGV4XSAtIGluWzIqSW5wdXRJbmRleC0yXSAqL1wKLSAgICAiICAgbW92IHIxMiwgcjEyLCBsc2wgIzJcbiIgICAgICAgICAvKiA8PDIgKi9cCi0gICAgIiAgIHNtdWx3dCByMTIsIHIxMiwgcjZcbiIgICAgICAgICAgLyogKHgxLXgwKSouLiAqL1wKLSAgICAiICAgYWRkIHIxMiwgcjAsIHIxMlxuIiAgICAgICAgICAgICAvKiB4MCAtICguLikgKi9cCi0gICAgIiAgIG1sYSByNCwgcjEyLCByMTEsIHI0XG4iICAgICAgICAgLyogdnIqaW50ZXJwICsgb3V0W10gKi9cCi0gICAgIiAgIHN0ciByNCwgW3I4XSwgIzRcbiIgICAgICAgICAgICAgLyogb3V0W291dHB1dEluZGV4KytdID0gLi4uICovXAotXAotICAgICIgICBhZGQgcjYsIHI2LCByOVxuIiAgICAgICAgICAgICAgIC8qIHBoYXNlRnJhY3Rpb24gKyBwaGFzZUluY3JlbWVudCAqL1wKLSAgICAiICAgYWRkIHI3LCByNywgcjYsIGxzciAjMzBcbiIgICAgICAvKiBpbnB1dEluZGV4ICsgcGhhc2VGcmFjdGlvbj4+MzAgKi8KLQotICAgIFNUX09ORV9GUkFNRSAgICAvLyBmcmFtZSAxCi0gICAgU1RfT05FX0ZSQU1FICAgIC8vIGZyYW1lIDEKLQotICAgICAgICAiICAgY21wIHI3LCByM1xuIiAgICAgICAgICAgICAgICAgICAgICAgLy8gaW5wdXRJbmRleCAtIG1heEluSWR4Ci0gICAgICAgICIgICBiY2MgM2JcbiIKLSAgICAgICAgIjQ6XG4iCi0KLSAgICAgICAgIiAgIGJpYyByNiwgcjYsICMweEMwMDAwMDAwXG4iICAgICAgICAgICAgICAvLyBwaGFzZUZyYWN0aW9uICYgLi4uCi0gICAgICAgIC8vIHNhdmUgbW9kaWZpZWQgdmFsdWVzCi0gICAgICAgICIgICBsZHIgcjAsIFtzcCwgIyIgU1RfUEFSQU01ICIgKyAyMF1cbiIgICAgLy8gJnBo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XRzKTsKLSAgICAgICAgcGhhc2VGcmFjdGlvbiAmPSBrUGhhc2VNYXNrOwotCi0gICAgICAgIC8vIHRpbWUgdG8gZmV0Y2ggYW5vdGhlciBzYW1wbGUKLSAgICAgICAgd2hpbGUgKGluZGV4SW5jcmVtZW50LS0pIHsKLQotICAgICAgICAgICAgaW5wdXRJbmRleCsrOwotICAgICAgICAgICAgaWYgKGlucHV0SW5kZXggPT0gbUJ1ZmZlci5mcmFtZUNvdW50KSB7Ci0gICAgICAgICAgICAgICAgaW5wdXRJbmRleCA9IDA7Ci0gICAgICAgICAgICAgICAgcHJvdmlkZXItPnJlbGVhc2VCdWZmZXIoJm1CdWZmZXIpOwotICAgICAgICAgICAgICAgIG1CdWZmZXIuZnJhbWVDb3VudCA9IGluRnJhbWVDb3VudDsKLSAgICAgICAgICAgICAgICBwcm92aWRlci0+Z2V0TmV4dEJ1ZmZlcigmbUJ1ZmZlciwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjYWxjdWxhdGVPdXRwdXRQVFMob3V0cHV0SW5kZXggLyAyKSk7Ci0gICAgICAgICAgICAgICAgaWYgKG1CdWZmZXIucmF3ID09IE5VTEwpCi0gICAgICAgICAgICAgICAgICAgIGdvdG8gc2F2ZV9zdGF0ZTsgIC8vIHVnbHksIGJ1dCBlZmZpY2llbnQKLSAgICAgICAgICAgICAgICBpbiA9IG1CdWZmZXIuaTE2OwotICAgICAgICAgICAgICAgIC8vIEFMT0dXKCJOZXcgYnVmZmVyOiBvZmZzZXQ9JXAsIGZyYW1lcz0lZCIsIG1CdWZmZXIucmF3LCBtQnVmZmVyLmZyYW1lQ291bnQpOwotICAgICAgICAgICAgfQotCi0gICAgICAgICAgICAvLyBhZHZhbmNlIHNhbXBsZSBzdGF0ZQotICAgICAgICAgICAgYWR2YW5jZSgmbGVmdCwgaW5baW5wdXRJbmRleCoyXSk7Ci0gICAgICAgICAgICBhZHZhbmNlKCZyaWdodCwgaW5baW5wdXRJb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JMKQotewotI2lmIGRlZmluZWQoX19hcm1fXykgJiYgIWRlZmluZWQoX190aHVtYl9fKQotICAgIGludDMyX3Qgb3V0OwotICAgIGlmIChsZWZ0KSB7Ci0gICAgICAgIGFzbSggInNtdWx0YiAlW291dF0sICVbaW5dLCAlW3ZSTF0gXG4iCi0gICAgICAgICAgICAgOiBbb3V0XSI9ciIob3V0KQotICAgICAgICAgICAgIDogW2luXSIlciIoaW4pLCBbdlJMXSJyIih2UkwpCi0gICAgICAgICAgICAgOiApOwotICAgIH0gZWxzZSB7Ci0gICAgICAgIGFzbSggInNtdWx0dCAlW291dF0sICVbaW5dLCAlW3ZSTF0gXG4iCi0gICAgICAgICAgICAgOiBbb3V0XSI9ciIob3V0KQotICAgICAgICAgICAgIDogW2luXSIlciIoaW4pLCBbdlJMXSJyIih2UkwpCi0gICAgICAgICAgICAgOiApOwotICAgIH0KLSAgICByZXR1cm4gb3V0OwotI2Vsc2UKLSAgICBpZiAobGVmdCkgewotICAgICAgICByZXR1cm4gaW50MTZfdChpbj4+MTYpICogaW50MTZfdCh2UkwmMHhGRkZGKTsKLSAgICB9IGVsc2UgewotICAgICAgICByZXR1cm4gaW50MTZfdChpbj4+MTYpICogaW50MTZfdCh2Ukw+PjE2KTsKLSAgICB9Ci0jZW5kaWYKLX0KLQotc3RhdGljIGlubGluZQotaW50MzJfdCBtdWxBZGQoaW50MTZfdCBpbiwgaW50MzJfdCB2LCBpbnQzMl90IGEpCi17Ci0jaWYgZGVmaW5lZChfX2FybV9fKSAmJiAhZGVmaW5lZChfX3RodW1iX18pCi0gICAgaW50MzJfdCBvdXQ7Ci0gICAgYXNtKCAic21sYXdiICVbb3V0XSwgJVt2XSwgJVtpbl0sICVbYV0gXG4iCi0gICAgICAgICA6IFtvdXRdIj1yIihvdXQpCi0gICAgICAgICA6IFtpbl0iJXIiKGluKSwgW3ZdInIiKHYpLCBbYV0iciIoYSkKLSAgICAgICAgIDogKTsKLSAgICByZXR1cm4gb3V0OwotI2Vsc2UKLSAgICByZXR1cm4gYSArIGluICogKHY+PjE2KTsKLSAgICAvLyBpbXByb3ZlZCBwcmVjaXNpb24KLSAgICAvLyByZXR1cm4gYSArIGluICogKHY+PjE2KSArICgoaW4gKiAodiAmIDB4ZmZmZikpID4+IDE2KTsKLSNlbmRpZgotfQotCi1zdGF0aWMgaW5saW5lCi1pbnQzMl90IG11bEFkZFJMKGludCBsZWZ0LCB1aW50MzJfdCBpblJMLCBpbnQzMl90IHYsIGludDMyX3QgYSkKLXsKLSNpZiBkZWZpbmVkKF9fYXJtX18pICYmICFkZWZpbmVkKF9fdGh1bWJfXykKLSAgICBpbnQzMl90IG91dDsKLSAgICBpZiAobGVmdCkgewotICAgICAgICBhc20oICJzbWxhd2IgJVtvdXRdLCAlW3ZdLCAlW2luUkxdLCAlW2FdIFxuIgotICAgICAgICAgICAgIDogW291dF0iPXIiKG91dCkKLSAgICAgICAgICAgICA6IFtpblJMXSIlciIoaW5STCksIFt2XSJyIih2KSwgW2FdInIiKGEpCi0gICAgICAgICAgICAgOiApOwotICAgIH0gZWxzZSB7Ci0gICAgICAgIGFzbSggInNtbGF3dCAlW291dF0sICVbdl0sICVbaW5STF0sICVbYV0gXG4iCi0gICAgICAgICAgICAgOiBbb3V0XSI9ciIob3V0KQotICAgICAgICAgICAgIDogW2luUkxdIiVyIihpblJMKSwgW3ZdInIiKHYpLCBbYV0iciIoYSkKLSAgICAgICAgICAgICA6ICk7Ci0gICAgfQotICAgIHJldHVybiBvdXQ7Ci0jZWxzZQotICAgIGlmIChsZWZ0KSB7Ci0gICAgICAgIHJldHVybiBhICsgKGludDE2X3QoaW5STCYweEZGRkYpICogKHY+PjE2KSk7Ci0gICAgICAgIC8vaW1wcm92ZWQgcHJlY2lzaW9uCi0gICAgICAgIC8vIHJldHVybiBhICsgKGludDE2X3QoaW5STCYweEZGRkYpICogKHY+PjE2KSkgKyAoKGludDE2X3QoaW5STCYweEZGRkYpICogKHYgJiAweGZmZmYpKSA+PiAxNik7Ci0gICAgfSBlbHNlIHsKLSAgICAgICAgcmV0dXJuIGEgKyAoaW50MTZfdChpblJMPj4xNikgKiAodj4+MTYpKTsKLSAgICB9Ci0jZW5kaWYKLX0KLQotLy8gLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLQotCi1BdWRpb1Jlc2FtcGxlclNpbmM6OkF1ZGlvUmVzYW1wbGVyU2luYyhpbnQgYml0RGVwdGgsCi0gICAgICAgIGludCBpbkNoYW5uZWxDb3VudCwgaW50MzJfdCBzYW1wbGVSYXRlKQotICAgIDogQXVkaW9SZXNhbXBsZXIoYml0RGVwdGgsIGluQ2hhbm5lbENvdW50LCBzYW1wbGVSYXRlKSwKLSAgICBtU3RhdGUoMCkKLXsKLSAgICAvKgotICAgICAqIExheW91dCBvZiB0aGUgc3RhdGUgYnVmZmVyIGZvciAzMiB0YXA6Ci0gICAgICoKLSAgICAgKiAicHJlc2VudCIgc2FtcGxlICAgICAgICAgICAgYmVnaW5uaW5nIG9mIDJuZCBidWZmZXIKLSAgICAgKiAgICAgICAgICAgICAgICAgdiAgICAgICAgICAgICAgICB2Ci0gICAgICogIDAgICAgICAgICAgICAgIDAxICAgICAgICAgICAgICAgMiAgICAgICAgICAgICAgMjMgICAgICAgICAgICAgIDMKLSAgICAgKiAgMCAgICAgICAgICAgICAgRjAgICAgICAgICAgICAgICAwICAgICAgICAgICAgICBGMCAgICAgICAgICAgICAgRgotICAgICAqIFtwcHBwcHBwcHBwcHBwcHBJbm5ubm5ubm5ubm5ubm5ubnBwcHBwcHBwcHBwcHBwcElubm5ubm5ubm5ubm5ubm5uXQotICAgICAqICAgICAgICAgICAgICAgICBeICAgICAgICAgICAgICAgXiBoZWFkCi0gICAgICoKLSAgICAgKiBwID0gcGFzdCBzYW1wbGVzLCBjb252b2x1dGVkIHdpdGggdGhlIChwKW9zaXRpdmUgc2lk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ZmZlci5mcmFtZUNvdW50ID09IDApIHsKLSAgICAgICAgICAgIG1CdWZmZXIuZnJhbWVDb3VudCA9IGluRnJhbWVDb3VudDsKLSAgICAgICAgICAgIHByb3ZpZGVyLT5nZXROZXh0QnVmZmVyKCZtQnVmZmVyLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY2FsY3VsYXRlT3V0cHV0UFRTKG91dHB1dEluZGV4IC8gMikpOwotICAgICAgICAgICAgaWYgKG1CdWZmZXIucmF3ID09IE5VTEwpIHsKLSAgICAgICAgICAgICAgICBnb3RvIHJlc2FtcGxlX2V4aXQ7Ci0gICAgICAgICAgICB9Ci0gICAgICAgICAgICBjb25zdCB1aW50MzJfdCBwaGFzZUluZGV4ID0gcGhhc2VGcmFjdGlvbiA+PiBrTnVtUGhhc2VCaXRzOwotICAgICAgICAgICAgaWYgKHBoYXNlSW5kZXggPT0gMSkgewotICAgICAgICAgICAgICAgIC8vIHJlYWQgb25lIGZyYW1lCi0gICAgICAgICAgICAgICAgcmVhZDxDSEFOTkVMUz4oaW1wdWxzZSwgcGhhc2VGcmFjdGlvbiwgbUJ1ZmZlci5pMTYsIGlucHV0SW5kZXgpOwotICAgICAgICAgICAgfSBlbHNlIGlmIChwaGFzZUluZGV4ID09IDIpIHsKLSAgICAgICAgICAgICAgICAvLyByZWFkIDIgZnJhbWVzCi0gICAgICAgICAgICAgICAgcmVhZDxDSEFOTkVMUz4oaW1wdWxzZSwgcGhhc2VGcmFjdGlvbiwgbUJ1ZmZlci5pMTYsIGlucHV0SW5kZXgpOwotICAgICAgICAgICAgICAgIGlucHV0SW5kZXgrKzsKLSAgICAgICAgICAgICAgICBpZiAoaW5wdXRJbmRleCA+PSBtQnVmZmVyLmZyYW1lQ291bnQpIHsKLSAgICAgICAgICAgICAgICAgICAgaW5wdXRJbmRleCAtPSBtQnVmZmVyLmZyYW1lQ291bnQ7Ci0gICAgICAgICAgICAgICAgICAgIHByb3ZpZGVyLT5yZWxlYXNlQnVmZmVyKCZtQnVmZmVyKTsKLSAgICAgICAgICAgICAgICB9IGVsc2UgewotICAgICAgICAgICAgICAgICAgICByZWFkPENIQU5ORUxTPihpbXB1bHNlLCBwaGFzZUZyYWN0aW9uLCBtQnVmZmVyLmkxNiwgaW5wdXRJbmRleCk7Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgfQotICAgICAgICB9Ci0gICAgICAgIGludDE2X3QgKmluID0gbUJ1ZmZlci5pMTY7Ci0gICAgICAgIGNvbnN0IHNpemVfdCBmcmFtZUNvdW50ID0gbUJ1ZmZlci5mcmFtZUNvdW50OwotCi0gICAgICAgIC8vIEFsd2F5cyByZWFkLWluIHRoZSBmaXJzdCBzYW1wbGVzIGZyb20gdGhlIGlucHV0IGJ1ZmZlcgotICAgICAgICBpbnQxNl90KiBoZWFkID0gaW1wdWxzZSArIGhhbGZOdW1Db2VmcypDSEFOTkVMUzsKLSAgICAgICAgaGVhZFswXSA9IGluW2lucHV0SW5kZXgqQ0hBTk5FTFMgKyAwXTsKLSAgICAgICAgaWYgKENIQU5ORUxTID09IDIpCi0gICAgICAgICAgICBoZWFkWzFdID0gaW5baW5wdXRJbmRleCpDSEFOTkVMUyArIDFdOwotCi0gICAgICAgIC8vIGhhbmRsZSBib3VuZGFyeSBjYXNlCi0gICAgICAgIGludDMyX3QgbCwgcjsKLSAgICAgICAgd2hpbGUgKG91dHB1dEluZGV4IDwgb3V0cHV0U2FtcGxlQ291bnQpIHsKLSAgICAgICAgICAgIGZpbHRlckNvZWZmaWNpZW50PENIQU5ORUxTPihsLCByLCBwaGFzZUZyYWN0aW9uLCBpbXB1bHNlKTsKLSAgICAgICAgICAgIG91dFtvdXRwdXRJbmRleCsrXSArPSAyICogbXVsUkwoMSwgbCwgdlJMKTsKLSAgICAgICAgICAgIG91dFtvdXRwdXRJbmRleCsrXSArPSAyICogbXVsUkwoMCwgciwgdlJMKTsKLQotICAgICAgICAgICAgcGhhc2VGcmFjdGlvbiArPSBwaGFzZUluY3JlbWVudDsKLSAgICAgICAgICAgIGNvbnN0IHVpbnQzMl90IHBoYXNlSW5kZXggPSBwaGFzZUZyYWN0aW9uID4+IGtOdW1QaGFzZUJpdHM7Ci0gICAgICAgICAgICBpZiAocGhhc2VJbmRleCA9PSAxKSB7Ci0gICAgICAgICAgICAgICAgaW5wdXRJbmRleCsrOwotICAgICAgICAgICAgICAgIGlmIChpbnB1dEluZGV4ID49IGZyYW1lQ291bnQpCi0gICAgICAgICAgICAgICAgICAgIGJyZWFrOyAgLy8gbmVlZCBhIG5ldyBidWZmZXIKLSAgICAgICAgICAgICAgICByZWFkPENIQU5ORUxTPihpbXB1bHNlLCBwaGFzZUZyYWN0aW9uLCBpbiwgaW5wdXRJbmRleCk7Ci0gICAgICAgICAgICB9IGVsc2UgaWYgKHBoYXNlSW5kZXggPT0gMikgeyAgICAvLyBtYXhpbXVtIHZhbHVlCi0gICAgICAgICAgICAgICAgaW5wdXRJbmRleCsrOwotICAgICAgICAgICAgICAgIGlmIChpbnB1dEluZGV4ID49IGZyYW1lQ291bnQpCi0gICAgICAgICAgICAgICAgICAgIGJyZWFrOyAgLy8gMCBmcmFtZSBhdmFpbGFibGUsIDIgZnJhbWVzIG5lZWRlZAotICAgICAgICAgICAgICAgIC8vIHJlYWQgZmlyc3QgZnJhbWUKLSAgICAgICAgICAgICAgICByZWFkPENIQU5ORUxTPihpbXB1bHNlLCBwaGFzZUZyYWN0aW9uLCBpbiwgaW5wdXRJbmRleCk7Ci0gICAgICAgICAgICAgICAgaW5wdXRJbmRleCsrOwotICAgICAgICAgICAgICAgIGlmIChpbnB1dEluZGV4ID49IGZyYW1lQ291bnQpCi0gICAgICAgICAgICAgICAgICAgIGJyZWFrOyAgLy8gMCBmcmFtZSBhdmFpbGFibGUsIDEgZnJhbWUgbmVlZGVkCi0gICAgICAgICAgICAgICAgLy8gcmVhZCBzZWNvbmQgZnJhbWUKLSAgICAgICAgICAgICAgICByZWFkPENIQU5ORUxTPihpbXB1bHNl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ICAgICBpbnQzMl90IGV4dDEsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgaW50MzJfdCBleHQyLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZvaWQqIHVzZXIpOwotCi10eXBlZGVmIHZvaWQgKCpkYXRhX2NhbGxiYWNrKShpbnQzMl90IG1zZ1R5cGUsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgY29uc3Qgc3A8SU1lbW9yeT4gJmRhdGFQdHIsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgY2FtZXJhX2ZyYW1lX21ldGFkYXRhX3QgKm1ldGFkYXRhLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZvaWQqIHVzZXIpOwotCi10eXBlZGVmIHZvaWQgKCpkYXRhX2NhbGxiYWNrX3RpbWVzdGFtcCkobnNlY3NfdCB0aW1lc3RhbXAsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgaW50MzJfdCBtc2dUeXBlLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbnN0IHNwPElNZW1vcnk+ICZkYXRhUHRyLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZvaWQgKnVzZXIpOwotCi0vKioKLSAqIENhbWVyYUhhcmR3YXJlSW50ZXJmYWNlLmggZGVmaW5lcyB0aGUgaW50ZXJmYWNlIHRvIHRoZQotICogY2FtZXJhIGhhcmR3YXJlIGFic3RyYWN0aW9uIGxheWVyLCB1c2VkIGZvciBzZXR0aW5nIGFuZCBnZXR0aW5nCi0gKiBwYXJhbWV0ZXJzLCBsaXZlIHByZXZpZXdpbmcsIGFuZCB0YWtpbmcgcGljdHVyZXMuCi0gKgotICogSXQgaXMgYSByZWZlcmVuY2VkIGNvdW50ZWQgaW50ZXJmYWNlIHdpdGggUmVmQmFzZSBhcyBpdHMgYmFzZSBjbGFzcy4KLSAqIENhbWVyYVNlcnZpY2UgY2FsbHMgb3BlbkNhbWVyYUhhcmR3YXJlKCkgdG8gcmV0cmlldmUgYSB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ZUludGVyZmFjZShjb25zdCBjaGFyICpuYW1lKQotICAgIHsKLSAgICAgICAgbURldmljZSA9IDA7Ci0gICAgICAgIG1OYW1lID0gbmFtZTsKLSAgICB9Ci0KLSAgICB+Q2FtZXJhSGFyZHdhcmVJbnRlcmZhY2UoKQotICAgIHsKLSAgICAgICAgQUxPR0koIkRlc3Ryb3lpbmcgY2FtZXJhICVzIiwgbU5hbWUuc3RyaW5nKCkpOwotICAgICAgICBpZihtRGV2aWNlKSB7Ci0gICAgICAgICAgICBpbnQgcmMgPSBtRGV2aWNlLT5jb21tb24uY2xvc2UoJm1EZXZpY2UtPmNvbW1vbik7Ci0gICAgICAgICAgICBpZiAocmMgIT0gT0spCi0gICAgICAgICAgICAgICAgQUxPR0UoIkNvdWxkIG5vdCBjbG9zZSBjYW1lcmEgJXM6ICVkIiwgbU5hbWUuc3RyaW5nKCksIHJjKTsKLSAgICAgICAgfQotICAgIH0KLQotICAgIHN0YXR1c190IGluaXRpYWxpemUoaHdfbW9kdWxlX3QgKm1vZHVsZSkKLSAgICB7Ci0gICAgICAgIEFMT0dJKCJPcGVuaW5nIGNhbWVyYSAlcyIsIG1OYW1lLnN0cmluZygpKTsKLSAgICAgICAgaW50IHJjID0gbW9kdWxlLT5tZXRob2RzLT5vcGVuKG1vZHVsZSwgbU5hbWUuc3RyaW5nKCksCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoaHdfZGV2aWNlX3QgKiopJm1EZXZpY2UpOwotICAgICAgICBpZiAocmMgIT0gT0spIHsKLSAgICAgICAgICAgIEFMT0dFKCJDb3VsZCBub3Qgb3BlbiBjYW1lcmEgJXM6ICVkIiwgbU5hbWUuc3RyaW5nKCksIHJjKTsKLSAgICAgICAgICAgIHJldHVybiByYzsKLSAgICAgICAgfQotICAgICAgICBpbml0SGFsUHJldmlld1dpbmRvdygpOwotICAgICAgICByZXR1cm4gcmM7Ci0gICAgfQotCi0gICAgLyoqIFNldCB0aGUgQU5hdGl2ZVdpbmRvdyB0byB3aGljaCBwcmV2aWV3IGZyYW1lcyBhcmUgc2VudCAqLwotICAgIHN0YXR1c190IHNldFByZXZpZXdXaW5kb3coY29uc3Qgc3A8QU5hdGl2ZVdpbmRvdz4mIGJ1ZikKLSAgICB7Ci0gICAgICAgIEFMT0dWKCIlcyglcykgYnVmICVwIiwgX19GVU5DVElPTl9fLCBtTmFtZS5zdHJpbmcoKSwgYnVmLmdldCgpKTsKLQotICAgICAgICBpZiAobURldmljZS0+b3BzLT5zZXRfcHJldmlld193aW5kb3cpIHsKLSAgICAgICAgICAgIG1QcmV2aWV3V2luZG93ID0gYnVmOwotICAgICAgICAgICAgbUhhbFByZXZpZXdXaW5kb3cudXNlciA9IHRoaXM7Ci0gICAgICAgICAgICBBTE9HVigiJXMgJm1IYWxQcmV2aWV3V2luZG93ICVwIG1IYWxQcmV2aWV3V2luZG93LnVzZXIgJXAiLCBfX0ZVTkNUSU9OX18sCi0gICAgICAgICAgICAgICAgICAgICZtSGFsUHJldmlld1dpbmRvdywgbUhhbFByZXZpZXdXaW5kb3cudXNlcik7Ci0gICAgICAgICAgICByZXR1cm4gbURldmljZS0+b3BzLT5zZXRfcHJldmlld193aW5kb3cobURldmljZSwKLSAgICAgICAgICAgICAgICAgICAgYnVmLmdldCgpID8gJm1IYWxQcmV2aWV3V2luZG93Lm53IDogMCk7Ci0gICAgICAgIH0KLSAgICAgICAgcmV0dXJuIElOVkFMSURfT1BFUkFUSU9OOwotICAgIH0KLQotICAgIC8qKiBTZXQgdGhlIG5vdGlmaWNhdGlvbiBhbmQgZGF0YSBjYWxsYmFja3MgKi8KLSAgICB2b2lkIHNldENhbGxiYWNrcyhub3RpZnlfY2FsbGJhY2sgbm90aWZ5X2NiLAotICAgICAgICAgICAgICAgICAgICAgIGRhdGFfY2FsbGJhY2sgZGF0YV9jYiwKLSAgICAgICAgICAgICAgICAgICAgICBkYXRhX2NhbGxiYWNrX3RpbWVzdGFtcCBkYXRhX2NiX3RpbWVzdGFtcCwKLSAgICAgICAgICAgICAgICAgICAgICB2b2lkKiB1c2VyKQotICAgIHsKLSAgICAgICAgbU5vdGlmeUNiID0gbm90aWZ5X2NiOwotICAgICAgICBtRGF0YUNiID0gZGF0YV9jYjsKLSAgICAgICAgbURhdGFDYlRpbWVzdGFtcCA9IGRhdGFfY2JfdGltZXN0YW1wOwotICAgICAgICBtQ2JVc2VyID0gdXNlcjsKLQotICAgICAgICBBTE9HVigiJXMoJXMpIiwgX19GVU5DVElPTl9fLCBtTmFtZS5zdHJpbmcoKSk7Ci0KLSAgICAgICAgaWYgKG1EZXZpY2UtPm9wcy0+c2V0X2NhbGxiYWNrcykgewotICAgICAgICAgICAgbURldmljZS0+b3BzLT5zZXRfY2FsbGJhY2tzKG1EZXZpY2UsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIF9fbm90aWZ5X2NiLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBfX2RhdGFfY2IsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIF9fZGF0YV9jYl90aW1lc3RhbXAsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIF9fZ2V0X21lbW9yeSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdGhpcyk7Ci0gICAgICAgIH0KLSAgICB9Ci0KLSAgICAvKioKLSAgICAgKiBUaGUgZm9sbG93aW5nIHRocmVlIGZ1bmN0aW9ucyBhbGwgdGFrZSBhIG1zZ3R5cGUsCi0gICAgICogd2hpY2ggaXMgYSBiaXRtYXNrIG9mIHRoZSBtZXNzYWdlcyBkZWZpbmVkIGluCi0gICAgICogaW5jbHVkZS91aS9DYW1lcmEuaAotICAgICAqLwotCi0gICAgLyoqCi0gICAgICogRW5hYmxlIGEgbWVzc2FnZSwgb3Igc2V0IG9mIG1lc3NhZ2VzLgotICAgICAqLwotICAgIHZvaWQgZW5hYmxlTXNnVHlwZShpbnQzMl90IG1zZ1R5cGU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AgICAgICAgaWYgKG1EZXZpY2UtPm9wcy0+c2V0X3BhcmFtZXRlcnMpCi0gICAgICAgICAgICByZXR1cm4gbURldmljZS0+b3BzLT5zZXRfcGFyYW1ldGVycyhtRGV2aWNlLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwYXJhbXMuZmxhdHRlbigpLnN0cmluZygpKTsKLSAgICAgICAgcmV0dXJuIElOVkFMSURfT1BFUkFUSU9OOwotICAgIH0KLQotICAgIC8qKiBSZXR1cm4gdGhlIGNhbWVyYSBwYXJhbWV0ZXJzLiAqLwotICAgIENhbWVyYVBhcmFtZXRlcnMgZ2V0UGFyYW1ldGVycygpIGNvbnN0Ci0gICAgewotICAgICAgICBBTE9HVigiJXMoJXMpIiwgX19GVU5DVElPTl9fLCBtTmFtZS5zdHJpbmcoKSk7Ci0gICAgICAgIENhbWVyYVBhcmFtZXRlcnMgcGFybXM7Ci0gICAgICAgIGlmIChtRGV2aWNlLT5vcHMtPmdldF9wYXJhbWV0ZXJzKSB7Ci0gICAgICAgICAgICBjaGFyICp0ZW1wID0gbURldmljZS0+b3BzLT5nZXRfcGFyYW1ldGVycyhtRGV2aWNlKTsKLSAgICAgICAgICAgIFN0cmluZzggc3RyX3Bhcm1zKHRlbXApOwotICAgICAgICAgICAgaWYgKG1EZXZpY2UtPm9wcy0+cHV0X3BhcmFtZXRlcnMpCi0gICAgICAgICAgICAgICAgbURldmljZS0+b3BzLT5wdXRfcGFyYW1ldGVycyhtRGV2aWNlLCB0ZW1wKTsKLSAgICAgICAgICAgIGVsc2UKLSAgICAgICAgICAgICAgICBmcmVlKHRlbXApOwotICAgICAgICAgICAgcGFybXMudW5mbGF0dGVuKHN0cl9wYXJtcyk7Ci0gICAgICAgIH0KLSAgICAgICAgcmV0dXJuIHBhcm1zOwotICAgIH0KLQotICAgIC8qKgotICAgICAqIFNlbmQgY29tbWFuZCB0byBjYW1lcmEgZHJpdmVyLgotICAgICAqLwotICAgIHN0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gICAgICAgICAgICBtQnVmU2l6ZShidWZfc2l6ZSksCi0gICAgICAgICAgICAgICAgICAgICAgICAgbU51bUJ1ZnMobnVtX2J1ZmZlcnMpCi0gICAgICAgIHsKLSAgICAgICAgICAgIG1IZWFwID0gbmV3IE1lbW9yeUhlYXBCYXNlKGZkLCBidWZfc2l6ZSAqIG51bV9idWZmZXJzKTsKLSAgICAgICAgICAgIGNvbW1vbkluaXRpYWxpemF0aW9uKCk7Ci0gICAgICAgIH0KLQotICAgICAgICBDYW1lcmFIZWFwTWVtb3J5KHNpemVfdCBidWZfc2l6ZSwgdWludF90IG51bV9idWZmZXJzID0gMSkgOgotICAgICAgICAgICAgICAgICAgICAgICAgIG1CdWZTaXplKGJ1Zl9zaXplKSwKLSAgICAgICAgICAgICAgICAgICAgICAgICBtTnVtQnVmcyhudW1fYnVmZmVycykKLSAgICAgICAgewotICAgICAgICAgICAgbUhlYXAgPSBuZXcgTWVtb3J5SGVhcEJhc2UoYnVmX3NpemUgKiBudW1fYnVmZmVycyk7Ci0gICAgICAgICAgICBjb21tb25Jbml0aWFsaXphdGlvbigpOwotICAgICAgICB9Ci0KLSAgICAgICAgdm9pZCBjb21tb25Jbml0aWFsaXphdGlvbigpCi0gICAgICAgIHsKLSAgICAgICAgICAgIGhhbmRsZS5kYXRhID0gbUhlYXAtPmJhc2UoKTsKLSAgICAgICAgICAgIGhhbmRsZS5zaXplID0gbUJ1ZlNpemUgKiBtTnVtQnVmczsKLSAgICAgICAgICAgIGhhbmRsZS5oYW5kbGUgPSB0aGlzOwotCi0gICAgICAgICAgICBtQnVmZmVycyA9IG5ldyBzcDxNZW1vcnlCYXNlPlttTnVtQnVmc107Ci0gICAgICAgICAgICBmb3IgKHVpbnRfdCBpID0gMDsgaSA8IG1OdW1CdWZzOyBpKyspCi0gICAgICAgICAgICAgICAgbUJ1ZmZlcnNbaV0gPSBuZXcgTWVtb3J5QmFzZShtSGVhcCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGkgKiBtQnVmU2l6ZSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1CdWZTaXplKTsKLQotICAgICAgICAgICAgaGFuZGxlLnJlbGVhc2UgPSBfX3B1dF9tZW1vcnk7Ci0gICAgICAgIH0KLQotICAgICAgICB2aXJ0dWFsIH5DYW1lcmFIZWFwTWVtb3J5KCkKLSAgICAgICAgewotICAgICAgICAgICAgZGVsZXRlIFtdIG1CdWZmZXJzOwotICAgICAgICB9Ci0KLSAgICAgICAgc2l6ZV90IG1CdWZTaXplOwotICAgICAgICB1aW50X3QgbU51bUJ1ZnM7Ci0gICAgICAgIHNwPE1lbW9yeUhlYXBCYXNlPiBtSGVhcDsKLSAgICAgICAgc3A8TWVtb3J5QmFzZT4gKm1CdWZmZXJzOwotCi0gICAgICAgIGNhbWVyYV9tZW1vcnlfdCBoYW5kbGU7Ci0gICAgfTsKLQotICAgIHN0YXRpYyBjYW1lcmFfbWVtb3J5X3QqIF9fZ2V0X21lbW9yeShpbnQgZmQsIHNpemVfdCBidWZfc2l6ZSwgdWludF90IG51bV9idWZzLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2b2lkICp1c2VyIF9fYXR0cmlidXRlX18oKHVudXNlZCkpKQotICAgIHsKLSAgICAgICAgQ2FtZXJhSGVhcE1lbW9yeSAqbWVtOwotICAgICAgICBpZiAoZmQgPCAwKQotICAgICAgICAgICAgbWVtID0gbmV3IENhbWVyYUhlYXBNZW1vcnkoYnVmX3NpemUsIG51bV9idWZzKTsKLSAgICAgICAgZWxzZQotICAgICAgICAgICAgbWVtID0gbmV3IENhbWVyYUhlYXBNZW1vcnkoZmQsIGJ1Zl9zaXplLCBudW1fYnVmcyk7Ci0gICAgICAgIG1lbS0+aW5jU3Ryb25nKG1lbSk7Ci0gICAgICAgIHJldHVybiAmbWVtLT5oYW5kbGU7Ci0gICAgfQotCi0gICAgc3RhdGljIHZvaWQgX19wdXRfbWVtb3J5KGNhbWVyYV9tZW1vcnlfdCAqZGF0YSkKLSAgICB7Ci0gICAgICAgIGlmICghZGF0YSkKLSAgICAgICAgICAgIHJldHVybjsKLQotICAgICAgICBDYW1lcmFIZWFwTWVtb3J5ICptZW0gPSBzdGF0aWNfY2FzdDxDYW1lcmFIZWFwTWVtb3J5ICo+KGRhdGEtPmhhbmRsZSk7Ci0gICAgICAgIG1lbS0+ZGVjU3Ryb25nKG1lbSk7Ci0gICAgfQotCi0gICAgc3RhdGljIEFOYXRpdmVXaW5kb3cgKl9fdG9fYW53KHZvaWQgKnVzZXIpCi0gICAgewotICAgICAgICBDYW1lcmFIYXJkd2FyZUludGVyZmFjZSAqX190aGlzID0KLSAgICAgICAgICAgICAgICByZWludGVycHJldF9jYXN0PENhbWVyYUhhcmR3YXJlSW50ZXJmYWNlICo+KHVzZXIpOwotICAgICAgICByZXR1cm4gX190aGlzLT5tUHJldmlld1dpbmRvdy5nZXQoKTsKLSAgICB9Ci0jZGVmaW5lIGFudyhuKSBfX3RvX2FudygoKHN0cnVjdCBjYW1lcmFfcHJldmlld193aW5kb3cgKiluKS0+dXNlcikKLQotICAgIHN0YXRpYyBpbnQgX19kZXF1ZXVlX2J1ZmZlcihzdHJ1Y3QgcHJldmlld19zdHJlYW1fb3BzKiB3LAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBidWZmZXJfaGFuZGxlX3QqKiBidWZmZXIsIGludCAqc3RyaWRlKQotICAgIHsKLSAgICAgICAgaW50IHJjOwotICAgICAgICBBTmF0aXZlV2luZG93ICphID0gYW53KHcpOwotICAgICAgICBBTmF0aXZlV2luZG93QnVmZmVyKiBhbmI7Ci0gICAgICAgIHJjID0gYS0+ZGVxdWV1ZUJ1ZmZlcihhLCAmYW5iKTsKLSAgICAgICAgaWYgKCFyYykgewotICAgICAgICAgICAgKmJ1ZmZlciA9ICZhbmItPmhhbmRsZTsKLSAgICAgICAgICAgICpzdHJpZGUgPSBhbmItPnN0cmlkZTsKLSAgICAgICAgfQotICAgICAgICByZXR1cm4gcmM7Ci0gICAgfQotCi0jaWZuZGVmIGNvbnRhaW5lcl9vZgotI2RlZmluZSBjb250YWluZXJfb2YocHRyLCB0eXBlLCBtZW1iZXIpICh7ICAgICAgICAgICAgICAgICAgICAgIFwKLSAgICAgICAgY29uc3QgdHlwZW9mKCgodHlwZSAqKSAwKS0+bWVtYmVyKSAqX19tcHRyID0gKHB0cik7ICAgICBcCi0gICAgICAgICh0eXBlICopICgoY2hhciAqKSBfX21wdHIgLSAoY2hhciAqKSgmKCh0eXBlICopMCktPm1lbWJlcikpOyB9KQotI2VuZGlmCi0KLSAgICBzdGF0aWMgaW50IF9fbG9ja19idWZmZXIoc3RydWN0IHByZXZpZXdfc3RyZWFtX29wcyogdywKLSAgICAgICAgICAgICAgICAgICAgICBidWZmZXJfaGFuZGxlX3QqIGJ1ZmZlcikKLSAgICB7Ci0gICAgICAgIEFOYXRpdmVXaW5kb3cgKmEgPSBhbncodyk7Ci0gICAgICAgIHJldHVybiBhLT5sb2NrQnVmZmVyKGEsCi0gICAgICAgICAgICAgICAgICBjb250YWluZXJfb2YoYnVmZmVyLCBBTmF0aXZlV2luZG93QnVmZmVyLCBoYW5kbGUpKTsKLSAgICB9Ci0KLSAgICBzdGF0aWMgaW50IF9fZW5xdWV1ZV9idWZmZXIoc3RydWN0IHByZXZpZXdfc3RyZWFtX29wcyogdywKLSAgICAgICAgICAgICAgICAgICAgICBidWZmZXJfaGFuZGxlX3QqIGJ1ZmZlcikKLSAgICB7Ci0gICAgICAgIEFOYXRpdmVXaW5kb3cgKmEgPSBhbncodyk7Ci0gICAgICAgIHJldHVybiBhLT5xdWV1ZUJ1ZmZlcihhLAotICAgICAgICAgICAgICAgICAgY29udGFpbmVyX29mKGJ1ZmZlciwgQU5hdGl2ZVdpbmRvd0J1ZmZlciwgaGFuZGxlKSk7Ci0gICAgfQotCi0gICAgc3RhdGljIGludCBfX2NhbmNlbF9idWZmZXIoc3RydWN0IHByZXZpZXdfc3RyZWFtX29wcyogdywKLSAgICAgICAgICAgICAgICAgICAgICBidWZmZXJfaGFuZGxlX3QqIGJ1ZmZlcikKLSAgICB7Ci0gICAgICAgIEFOYXRpdmVXaW5kb3cgKmEgPSBhbncodyk7Ci0gICAgICAgIHJldHVybiBhLT5jYW5jZWxCdWZmZXIoYSwKLSAgICAgICAgICAgICAgICAgIGNvbnRhaW5lcl9vZihidWZmZXIsIEFOYXRpdmVXaW5kb3dCdWZmZXIsIGhhbmRsZSkpOwotICAgIH0KLQotICAgIHN0YXRpYyBpbnQgX19zZXRfYnVmZmVyX2NvdW50KHN0cnVjdCBwcmV2aWV3X3N0cmVhbV9vcHMqIHcsIGludCBjb3VudCkKLSAgICB7Ci0gICAgICAgIEFOYXRpdmVXaW5kb3cgKmEgPSBhbncodyk7Ci0gICAgICAgIHJldHVybiBuYXRpdmVfd2luZG93X3NldF9idWZmZXJfY291bnQoYSwgY291bnQpOwotICAgIH0KLQotICAgIHN0YXRpYyBpbnQgX19zZXRfYnVmZmVyc19nZW9tZXRyeShzdHJ1Y3QgcHJldmlld19zdHJlYW1fb3BzKiB3LAotICAgICAgICAgICAgICAgICAgICAgIGludCB3aWR0aCwgaW50IGhlaWdodCwgaW50IGZvcm1hdCkKLSAgICB7Ci0gICAgICAgIEFOYXRpdmVXaW5kb3cgKmEgPSBhbncodyk7Ci0gICAgICAgIHJldHVybiBuYXRpdmVfd2luZG93X3NldF9idWZmZXJzX2dlb21ldHJ5KGEsCi0gICAgICAgICAgICAgICAgICAgICAgICAgIHdpZHRoLCBoZWlnaHQsIGZvcm1hdCk7Ci0gICAgfQotCi0gICAgc3RhdGljIGludCBfX3NldF9jcm9wKHN0cnVjdCBwcmV2aWV3X3N0cmVhbV9vcHMgKncsCi0gICAgICAgICAgICAgICAgICAgICAgaW50IGxlZnQsIGludCB0b3AsIGludCByaWdodCwgaW50IGJvdHRvbSkKLSAgICB7Ci0gICAgICAgIEFOYXRpdmVXa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WVkX2J1ZmZlcl9jb3VudCgKLSAgICAgICAgICAgICAgICAgICAgICBjb25zdCBzdHJ1Y3QgcHJldmlld19zdHJlYW1fb3BzICp3LAotICAgICAgICAgICAgICAgICAgICAgIGludCAqY291bnQpCi0gICAgewotICAgICAgICBBTmF0aXZlV2luZG93ICphID0gYW53KHcpOwotICAgICAgICByZXR1cm4gYS0+cXVlcnkoYSwgTkFUSVZFX1dJTkRPV19NSU5fVU5ERVFVRVVFRF9CVUZGRVJTLCBjb3VudCk7Ci0gICAgfQotCi0gICAgdm9pZCBpbml0SGFsUHJldmlld1dpbmRvdygpCi0gICAgewotICAgICAgICBtSGFsUHJldmlld1dpbmRvdy5udy5jYW5jZWxfYnVmZmVyID0gX19jYW5jZWxfYnVmZmVyOwotICAgICAgICBtSGFsUHJldmlld1dpbmRvdy5udy5sb2NrX2J1ZmZlciA9IF9fbG9ja19idWZmZXI7Ci0gICAgICAgIG1IYWxQcmV2aWV3V2luZG93Lm53LmRlcXVldWVfYnVmZmVyID0gX19kZXF1ZXVlX2J1ZmZlcjsKLSAgICAgICAgbUhhbFByZXZpZXdXaW5kb3cubncuZW5xdWV1ZV9idWZmZXIgPSBfX2VucXVldWVfYnVmZmVyOwotICAgICAgICBtSGFsUHJldmlld1dpbmRvdy5udy5zZXRfYnVmZmVyX2NvdW50ID0gX19zZXRfYnVmZmVyX2NvdW50OwotICAgICAgICBtSGFsUHJldmlld1dpbmRvdy5udy5zZXRfYnVmZmVyc19nZW9tZXRyeSA9IF9fc2V0X2J1ZmZlcnNfZ2VvbWV0cnk7Ci0gICAgICAgIG1IYWxQcmV2aWV3V2luZG93Lm53LnNldF9jcm9wID0gX19zZXRfY3JvcDsKLSAgICAgICAgbUhhbFByZXZpZXdXaW5kb3cubncuc2V0X3RpbWVzdGFtcCA9IF9fc2V0X3RpbWVzdGFtcDsKLSAgICAgICAgbUhhbFByZXZpZXdXaW5kb3cubncuc2V0X3VzYWdlID0gX19zZXRfdXNhZ2U7Ci0gICA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I2luY2x1ZGUgPGZjbnRsLmg+Ci0jaW5jbHVkZSA8c3lzL21tYW4uaD4KLQotI2luY2x1ZGUgIkNhbm5lZEpwZWcuaCIKLQotbmFtZXNwYWNlIGFuZHJvaWQgewotCi1DYW1lcmFIYXJkd2FyZVN0dWI6OkNhbWVyYUhhcmR3YXJlU3R1YigpCi0gICAgICAgICAgICAgICAgICA6IG1QYXJhbWV0ZXJzKCksCi0gICAgICAgICAgICAgICAgICAgIG1QcmV2aWV3SGVhcCgwKSwKLSAgICAgICAgICAgICAgICAgICAgbVJhd0hlYXAoMCksCi0gICAgICAgICAgICAgICAgICAgIG1GYWtlQ2FtZXJhKDApLAotICAgICAgICAgICAgICAgICAgICBtUHJldmlld0ZyYW1lU2l6ZSgwKSwKLSAgICAgICAgICAgICAgICAgICAgbU5vdGlmeUNiKDApLAotICAgICAgICAgICAgICAgICAgICBtRGF0YUNiKDApLAotICAgICAgICAgICAgICAgICAgICBtRGF0YUNiVGltZXN0YW1wKDApLAotICAgICAgICAgICAgICAgICAgICBtQ2FsbGJhY2tDb29raWUoMCksCi0gICAgICAgICAgICAgICAgICAgIG1Nc2dFbmFibGVkKDApLAotICAgICAgICAgICAgICAgICAgICBtQ3VycmVudFByZXZpZXdGcmFtZSgwKQotewotICAgIGluaXREZWZhdWx0UGFyYW1ldGVycygpOwotfQotCi12b2lkIENhbWVyYUhhcmR3YXJlU3R1Yjo6aW5pdERlZmF1bHRQYXJhbWV0ZXJzKCkKLXsKLSAgICBDYW1lcmFQYXJhbWV0ZXJzIHA7Ci0KLSAgICBwLnNldChDYW1lcmFQYXJhbWV0ZXJzOjpLRVlfU1VQUE9SVEVEX1BSRVZJRVdfU0laRVMsICIzMjB4MjQwIik7Ci0gICAgcC5zZXRQcmV2aWV3U2l6ZSgzMjAsIDI0MCk7Ci0gICAgcC5zZXRQcmV2aWV3RnJhbWVSYXRlKDE1KTsKLSAgICBwLnNldFByZXZpZXdGb3JtYXQoQ2FtZXJhUGFyYW1ldGV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cgY2xpZW50KS4iLCBjYWxsaW5nUGlkKTsKLSAgICAgICAgICAgIHJldHVybiBOVUxMOwotICAgICAgICB9Ci0gICAgICAgIG1DbGllbnRbY2FtZXJhSWRdLmNsZWFyKCk7Ci0gICAgICAgIGlmIChtQnVzeVtjYW1lcmFJZF0pIHsKLSAgICAgICAgICAgIEFMT0dXKCJjb25uZWN0IFggKHBpZCAlZCkgcmVqZWN0ZWQgKGNhbWVyYSAlZCBpcyBzdGlsbCBidXN5KS4iLAotICAgICAgICAgICAgICAgICAgY2FsbGluZ1BpZCwgY2FtZXJhSWQpOwotICAgICAgICAgICAgcmV0dXJuIE5VTEw7Ci0gICAgICAgIH0KLSAgICB9IGVsc2UgeyAvLyBmb3JjZSA9PSB0cnVlCi0gICAgICAgIGludCBpID0gMDsKLSAgICAgICAgbG9uZyBsb25nIHN0YXJ0X3RpbWUgPSBnZXRUaW1lSW5NcygpOwotICAgICAgICB3aGlsZSAoaSA8IG1OdW1iZXJPZkNhbWVyYXMpIHsKLSAgICAgICAgICAgIGlmIChnZXRUaW1lSW5NcygpIC0gc3RhcnRfdGltZSA+PSAzMDAwTEwpIHsKLSAgICAgICAgICAgICAgICBBTE9HRSgiY29ubmVjdCBYIChwaWQgJWQpIHJlamVjdGVkICh0aW1lb3V0IDNzKSIsIGNhbGxpbmdQaWQpOwotICAgICAgICAgICAgICAgIHJldHVybiBOVUxMOwotICAgICAgICAgICAgfQotCi0gICAgICAgICAgICBjbGllbnQgPSBtQ2xpZW50W2ldLnByb21vdGUoKTsKLSAgICAgICAgICAgIGlmIChjbGllbnQgIT0gMCkgewotICAgICAgICAgICAgICAgIGlmIChjbGllbnQtPmtlZXAoKSkgewotICAgICAgICAgICAgICAgICAgICBBTE9HVygiY29ubmVjdCBYIChwaWQgJWQpIHJlamVjdGVkIChleGlzdGluZyBjbGllbnQgd2FudHMgdG8ga2VlcHMgdGhlIGNhbWVyYSkiLAotICAgICAgICAgICAgICAgICAgICAgICAgICBjYWxsaW5nUGlkKTsKLSAgICAgICAgICAgICAgICAgICAgcmV0dXJuIE5VTEw7Ci0gICAgICAgICAgICAgICAgfSBlbHNlIHsKLSAgICAgICAgICAgICAgICAgICAgQUxPR1coIk5ldyBjbGllbnQgKHBpZCAlZCwgaWQ9JWQpLiBEaXNjb25uZWN0IHRoZSBleGlzdGluZyBjbGllbnQgKGlkPSVkKS4iLAotICAgICAgICAgICAgICAgICAgICAgICAgIGNhbGxpbmdQaWQsIGNhbWVyYUlkLCBpKTsKLSAgICAgICAgICAgICAgICAgICAgLy8gRG8gbm90IGhvbGQgbVNlcnZpY2VMb2NrIGJlY2F1c2UgZGlzY29ubmVjdCB3aWxsIHRyeSB0byBnZXQgaXQuCi0gICAgICAgICAgICAgICAgICAgIG1TZXJ2aWNlTG9jay51bmxvY2soKTsKLSAgICAgICAgICAgICAgICAgICAgY2xpZW50LT5ub3RpZnlDYWxsYmFjayhDQU1FUkFfTVNHX0VSUk9SLCBDQU1FUkFfRVJST1JfUkVMRUFTRUQsIDAsICZpKTsKLSAgICAgICAgICAgICAgICAgICAgY2xpZW50LT53YWl0UmVsZWFzZShXQUlUX1JFTEVBU0VfVElNRU9VVCk7Ci0gICAgICAgICAgICAgICAgICAgIGNsaWVudC0+ZGlzY29ubmVjdEludGVybmFsKGZhbHNlKTsKLSAgICAgICAgICAgICAgICAgICAgbVNlcnZpY2VMb2NrLmxvY2soKTsKLSAgICAgICAgICAgICAgICAgICAgLy8gUmVzdGFydCBmcm9tIHRoZSBmaXJzdCBjbGllbnQgYmVjYXVzZSBhIG5ldyBjbGllbnQgbWF5IGhhdmUgY29ubmVjdGVkCi0gICAgICAgICAgICAgICAgICAgIC8vIHdoZW4gbVNlcnZpY2VMb2NrIGlzIHVubG9ja2VkLgotICAgICAgICAgICAgICAgICAgICBpID0gMDsKLSAgICAgICAgICAgICAgICAgICAgY29udGludWU7Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgfQotCi0gICAgICAgICAgICBpZiAobUJ1c3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NRVJBX1JFQ09SRElOR19NT0RFOgotICAgICAgICAgICAgaWYgKG1TdXJmYWNlID09IDAgJiYgbVByZXZpZXdXaW5kb3cgPT0gMCkgewotICAgICAgICAgICAgICAgIEFMT0dFKCJtU3VyZmFjZSBvciBtUHJldmlld1dpbmRvdyBtdXN0IGJlIHNldCBiZWZvcmUgc3RhcnRSZWNvcmRpbmdNb2RlLiIpOwotICAgICAgICAgICAgICAgIHJldHVybiBJTlZBTElEX09QRVJBVElPTjsKLSAgICAgICAgICAgIH0KLSAgICAgICAgICAgIHJldHVybiBzdGFydFJlY29yZGluZ01vZGUoKTsKLSAgICAgICAgZGVmYXVsdDoKLSAgICAgICAgICAgIHJldHVybiBVTktOT1dOX0VSUk9SOwotICAgIH0KLX0KLQotc3RhdHVzX3QgQ2FtZXJhU2VydmljZTo6Q2xpZW50OjpzdGFydFByZXZpZXdNb2RlKCkgewotICAgIExPRzEoInN0YXJ0UHJldmlld01vZGUiKTsKLSAgICBzdGF0dXNfdCByZXN1bHQgPSBOT19FUlJPUjsKLQotICAgIC8vIGlmIHByZXZpZXcgaGFzIGJlZW4gZW5hYmxlZCwgbm90aGluZyBuZWVkcyB0byBiZSBkb25lCi0gICAgaWYgKG1IYXJkd2FyZS0+cHJldmlld0VuYWJsZWQoKSkgewotICAgICAgICByZXR1cm4gTk9fRVJST1I7Ci0gICAgfQotCi0gICAgaWYgKG1QcmV2aWV3V2luZG93ICE9IDApIHsKLSAgICAgICAgbmF0aXZlX3dpbmRvd19zZXRfc2NhbGluZ19tb2RlKG1QcmV2aWV3V2luZG93LmdldCgpLAotICAgICAgICAgICAgICAgIE5BVElWRV9XSU5ET1dfU0NBTElOR19NT0RFX1NDQUxFX1RPX1dJTkRPVyk7Ci0gICAgICAgIG5hdGl2ZV93aW5kb3dfc2V0X2J1ZmZlcnNfdHJhbnNmb3JtKG1QcmV2aWV3V2luZG93LmdldCgpLAotICAgICAgICAgICAgICAgIG1PcmllbnRhdGlvbik7Ci0gICAgfQot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kFEX1ZBTFVFOwotCi0gICAgICAgIGlmIChtT3JpZW50YXRpb24gIT0gb3JpZW50YXRpb24pIHsKLSAgICAgICAgICAgIG1PcmllbnRhdGlvbiA9IG9yaWVudGF0aW9uOwotICAgICAgICAgICAgaWYgKG1QcmV2aWV3V2luZG93ICE9IDApIHsKLSAgICAgICAgICAgICAgICBuYXRpdmVfd2luZG93X3NldF9idWZmZXJzX3RyYW5zZm9ybShtUHJldmlld1dpbmRvdy5nZXQoKSwKLSAgICAgICAgICAgICAgICAgICAgICAgIG1PcmllbnRhdGlvbik7Ci0gICAgICAgICAgICB9Ci0gICAgICAgIH0KLSAgICAgICAgcmV0dXJuIE9LOwotICAgIH0gZWxzZSBpZiAoY21kID09IENBTUVSQV9DTURfRU5BQkxFX1NIVVRURVJfU09VTkQpIHsKLSAgICAgICAgc3dpdGNoIChhcmcxKSB7Ci0gICAgICAgICAgICBjYXNlIDA6Ci0gICAgICAgICAgICAgICAgZW5hYmxlU2h1dHRlclNvdW5kKGZhbHNlKTsKLSAgICAgICAgICAgICAgICBicmVhazsKLSAgICAgICAgICAgIGNhc2UgMToKLSAgICAgICAgICAgICAgICBlbmFibGVTaHV0dGVyU291bmQodHJ1ZSk7Ci0gICAgICAgICAgICAgICAgYnJlYWs7Ci0gICAgICAgICAgICBkZWZhdWx0OgotICAgICAgICAgICAgICAgIHJldHVybiBCQURfVkFMVUU7Ci0gICAgICAgIH0KLSAgICAgICAgcmV0dXJuIE9LOwotICAgIH0gZWxzZSBpZiAoY21kID09IENBTUVSQV9DTURfUExBWV9SRUNPUkRJTkdfU09VTkQpIHsKLSAgICAgICAgbUNhbWVyYVNlcnZpY2UtPnBsYXlTb3VuZChTT1VORF9SRUNPUkRJTkcpOwotICAgIH0gZWxzZSBpZiAoY21kID09IENBTUVSQV9DTURfUElORykgewotICAgICAgICAvLyBJZiBtSGFyZHdhcmUgaXMgMCwgY2hlY2tQaWRBbmRIYXJkd2FyZSB3aWxsIHJldHVybiBlcnJvci4K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iLAotICAgICAgICAgICAgICAgIGdldENhbGxpbmdQaWQoKSwKLSAgICAgICAgICAgICAgICBnZXRDYWxsaW5nVWlkKCkpOwotICAgICAgICByZXN1bHQuYXBwZW5kKGJ1ZmZlcik7Ci0gICAgICAgIHdyaXRlKGZkLCByZXN1bHQuc3RyaW5nKCksIHJlc3VsdC5zaXplKCkpOwotICAgIH0gZWxzZSB7Ci0gICAgICAgIGJvb2wgbG9ja2VkID0gdHJ5TG9jayhtU2VydmljZUxvY2spOwotICAgICAgICAvLyBmYWlsZWQgdG8gbG9jayAtIENhbWVyYVNlcnZpY2UgaXMgcHJvYmFibHkgZGVhZGxvY2tlZAotICAgICAgICBpZiAoIWxvY2tlZCkgewotICAgICAgICAgICAgU3RyaW5nOCByZXN1bHQoa0RlYWRsb2NrZWRTdHJpbmcpOwotICAgICAgICAgICAgd3JpdGUoZmQsIHJlc3VsdC5zdHJpbmcoKSwgcmVzdWx0LnNpemUoKSk7Ci0gICAgICAgIH0KLQotICAgICAgICBib29sIGhhc0NsaWVudCA9IGZhbHNlOwotICAgICAgICBmb3IgKGludCBpID0gMDsgaSA8IG1OdW1iZXJPZkNhbWVyYXM7IGkrKykgewotICAgICAgICAgICAgc3A8Q2xpZW50PiBjbGllbnQgPSBtQ2xpZW50W2ldLnByb21vdGUoKTsKLSAgICAgICAgICAgIGlmIChjbGllbnQgPT0gMCkgY29udGludWU7Ci0gICAgICAgICAgICBoYXNDbGllbnQgPSB0cnVlOwotICAgICAgICAgICAgc3ByaW50ZihidWZmZXIsICJDbGllbnRbJWRdICglcCkgUElEOiAlZFxuIiwKLSAgICAgICAgICAgICAgICAgICAgaSwKLSAgICAgICAgICAgICAgICAgICAgY2xpZW50LT5nZXRDYW1lcmFDbGllbnQoKS0+YXNCaW5kZXIoKS5nZXQoKSwKLSAgICAgICAgICAgICAgICAgICAgY2xpZW50LT5tQ2xpZW50UGlkKTsKLSAgICAgICAgICAgIHJlc3VsdC5hcHBlbmQoYnVmZmVyKTsKL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bm5lY3QoKTsKLSAgICAgICAgdmlydHVhbCBzdGF0dXNfdCAgICAgICAgY29ubmVjdChjb25zdCBzcDxJQ2FtZXJhQ2xpZW50PiYgY2xpZW50KTsKLSAgICAgICAgdmlydHVhbCBzdGF0dXNfdCAgICAgICAgbG9jaygpOwotICAgICAgICB2aXJ0dWFsIHN0YXR1c190ICAgICAgICB1bmxvY2soKTsKLSAgICAgICAgdmlydHVhbCBzdGF0dXNfdCAgICAgICAgc2V0UHJldmlld0Rpc3BsYXkoY29uc3Qgc3A8U3VyZmFjZT4mIHN1cmZhY2UpOwotICAgICAgICB2aXJ0dWFsIHN0YXR1c190ICAgICAgICBzZXRQcmV2aWV3VGV4dHVyZShjb25zdCBzcDxJU3VyZmFjZVRleHR1cmU+JiBzdXJmYWNlVGV4dHVyZSk7Ci0gICAgICAgIHZpcnR1YWwgdm9pZCAgICAgICAgICAgIHNldFByZXZpZXdDYWxsYmFja0ZsYWcoaW50IGZsYWcpOwotICAgICAgICB2aXJ0dWFsIHN0YXR1c190ICAgICAgICBzdGFydFByZXZpZXcoKTsKLSAgICAgICAgdmlydHVhbCB2b2lkICAgICAgICAgICAgc3RvcFByZXZpZXcoKTsKLSAgICAgICAgdmlydHVhbCBib29sICAgICAgICAgICAgcHJldmlld0VuYWJsZWQoKTsKLSAgICAgICAgdmlydHVhbCBzdGF0dXNfdCAgICAgICAgc3RvcmVNZXRhRGF0YUluQnVmZmVycyhib29sIGVuYWJsZWQpOwotICAgICAgICB2aXJ0dWFsIHN0YXR1c190ICAgICAgICBzdGFydFJlY29yZGluZygpOwotICAgICAgICB2aXJ0dWFsIHZvaWQgICAgICAgICAgICBzdG9wUmVjb3JkaW5nKCk7Ci0gICAgICAgIHZpcnR1YWwgYm9vbCAgICAgICAgICAgIHJlY29yZGluZ0VuYWJsZWQoKTsKLSAgICAgICAgdmlydHVhbCB2b2lkICAgICAgICAgICAgcmVsZWFzZVJlY29yZGluZ0ZyYW1lKGNvbnN0IHNwPElNZW1vcnk+JiBtZW0pOwotICAgICAgICB2aXJ0dWFsIHN0YXR1c190ICAgICAgICBhdXRvRm9jdXMoKTsKLSAgICAgICAgdmlydHVhbCBzdGF0dXNfdCAgICAgICAgY2FuY2VsQXV0b0ZvY3VzKCk7Ci0gICAgICAgIHZpcnR1YWwgc3RhdHVzX3QgICAgICAgIHRha2VQaWN0dXJlKGludCBtc2dUeXBlKTsKLSAgICAgICAgdmlydHVhbCBzdGF0dXNfdCAgICAgICAgc2V0UGFyYW1ldGVycyhjb25zdCBTdHJpbmc4JiBwYXJhbXMpOwotICAgICAgICB2aXJ0dWFsIFN0cmluZzggICAgICAgICBnZXRQYXJhbWV0ZXJzKCkgY29uc3Q7Ci0gICAgICAgIHZpcnR1YWwgc3RhdHVzX3QgICAgICAgIHNlbmRDb21tYW5kKGludDMyX3QgY21kLCBpbnQzMl90IGFyZzEsIGludDMyX3QgYXJnMik7Ci0gICAgcHJpdmF0ZToKLSAgICAgICAgZnJpZW5kIGNsYXNzIENhbWVyYVNlcnZpY2U7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIENsaWVudChjb25zdCBzcDxDYW1lcmFTZXJ2aWNlPiYgY2FtZXJhU2VydmljZSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbnN0IHNwPElDYW1lcmFDbGllbnQ+JiBjYW1lcmFDbGllbnQsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb25zdCBzcDxDYW1lcmFIYXJkd2FyZUludGVyZmFjZT4mIGhhcmR3YXJlLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaW50IGNhbWVyYUlkLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaW50IGNhbWVyYUZhY2luZywKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGludCBjbGllbnRQaWQsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg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cm9tIGNvb2tpZQotICAgICAgICBzdGF0aWMgc3A8Q2xpZW50PiAgICAgICBnZXRDbGllbnRGcm9tQ29va2llKHZvaWQqIHVzZXIpOwotICAgICAgICAvLyBoYW5kbGVycyBmb3IgbWVzc2FnZXMKLSAgICAgICAgdm9pZCAgICAgICAgICAgICAgICAgICAgaGFuZGxlU2h1dHRlcih2b2lkKTsKLSAgICAgICAgdm9pZCAgICAgICAgICAgICAgICAgICAgaGFuZGxlUHJldmlld0RhdGEoaW50MzJfdCBtc2dUeXBlLCBjb25zdCBzcDxJTWVtb3J5PiYgbWVtLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjYW1lcmFfZnJhbWVfbWV0YWRhdGFfdCAqbWV0YWRhdGEpOwotICAgICAgICB2b2lkICAgICAgICAgICAgICAgICAgICBoYW5kbGVQb3N0dmlldyhjb25zdCBzcDxJTWVtb3J5PiYgbWVtKTsKLSAgICAgICAgdm9pZCAgICAgICAgICAgICAgICAgICAgaGFuZGxlUmF3UGljdHVyZShjb25zdCBzcDxJTWVtb3J5PiYgbWVtKTsKLSAgICAgICAgdm9pZCAgICAgICAgICAgICAgICAgICAgaGFuZGxlQ29tcHJlc3NlZFBpY3R1cmUoY29uc3Qgc3A8SU1lbW9yeT4mIG1lbSk7Ci0gICAgICAgIHZvaWQgICAgICAgICAgICAgICAgICAgIGhhbmRsZUdlbmVyaWNOb3RpZnkoaW50MzJfdCBtc2dUeXBlLCBpbnQzMl90IGV4dDEsIGludDMyX3QgZXh0Mik7Ci0gICAgICAgIHZvaWQgICAgICAgICAgICAgICAgICAgIGhhbmRsZUdlbmVyaWNEYXRhKGludDMyX3QgbXNnVHlwZSwgY29uc3Qgc3A8SU1lbW9yeT4mIGRhdGFQdHIsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNhbWVyYV9mcmFtZV9tZXRhZGF0YV90ICptZXRhZGF0YSk7Ci0gICAgICAgIHZvaWQgICAgICAgICAgICAgICAgICAgIGhhbmRsZUdlbmVyaWNEYXRhVGltZXN0YW1wKG5zZWNzX3QgdGltZXN0YW1wLCBpbnQzMl90IG1zZ1R5cGUsIGNvbnN0IHNwPElNZW1vcnk+JiBkYXRhUHRyKTsKLQotICAgICAgICB2b2lkICAgICAgICAgICAgICAgICAgICBjb3B5RnJhbWVBbmRQb3N0Q29waWVkRnJhbWUoCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpbnQzMl90IG1zZ1R5cGUsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb25zdCBzcDxJQ2FtZXJhQ2xpZW50PiYgY2xpZW50LAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY29uc3Qgc3A8SU1lbW9yeUhlYXA+JiBoZWFwLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2l6ZV90IG9mZnNldCwgc2l6ZV90IHNpemUsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjYW1lcmFfZnJhbWVfbWV0YWRhdGFfdCAqbWV0YWRhdGEpOwotCi0gICAgICAgIGludCAgICAgICAgICAgICAgICAgICAgIGdldE9yaWVudGF0aW9uKGludCBvcmllbnRhdGlvbiwgYm9vbCBtaXJyb3IpOwotCi0gICAgICAgIHN0YXR1c190ICAgICAgICAgICAgICAgIHNldFByZXZpZXdXaW5kb3coCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb25zdCBzcDxJQmluZGVyPiYgYmluZGVyLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY29uc3Qgc3A8QU5hdGl2ZVdpbmRvdz4mIHdpbmRvdyk7Ci0KLSAgICAgICAgdm9pZCAgICAgICAgICAgICAgICAgICAgZGlzY29ubmVjdEludGVybmFsKGJvb2wgbmVlZENoZWNrUGlkKTsKLSAgICAgICAgYm9vbCAgICAgICAgICAgICAgICAgICAga2VlcCgpIGNvbnN0OwotICAgICAgICB2b2lkICAgICAgICAgICAgICAgICAgICB3YWl0UmVsZWFzZShpbnQgbXMpOwotCi0KLSAgICAgICAgLy8gdGhlc2UgYXJlIGluaXRpYWxpemVkIGluIHRoZSBjb25zdHJ1Y3Rvci4KLSAgICAgICAgc3A8Q2FtZXJhU2VydmljZT4gICAgICAgICAgICAgICBtQ2FtZXJhU2VydmljZTsgIC8vIGltbXV0YWJsZSBhZnRlciBjb25zdHJ1Y3RvcgotICAgICAgICBzcDxJQ2FtZXJhQ2xpZW50PiAgICAgICAgICAgICAgIG1DYW1lcmFDbGllbnQ7Ci0gICAgICAgIGludCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbUNhbWVyYUlkOyAgICAgICAvLyBpbW11dGFibGUgYWZ0ZXIgY29uc3RydWN0b3IKLSAgICAgICAgaW50ICAgICAgICAgICAgICAgICAgICAgICAgICAgICBtQ2FtZXJhRmFjaW5nOyAgIC8vIGltbXV0YWJsZSBhZnRlciBjb25zdHJ1Y3RvcgotICAgICAgICBwaWRfdCAgICAgICAgICAgICAgICAgICAgICAgICAgIG1DbGllbnRQaWQ7Ci0gICAgICAgIC8vIENsaWVudCB3YW50cyB0byBrZWVwIHRoZSBjYW1lcmEgZnJvbSB0YWtpbmcgYnkgb3RoZXIgY2xpZW50cy4KLSAgICAgICAgYm9vbCAgICAgICAgICAgICAgICAgICAgICAgICAgICBtS2VlcDsKLSAgICAgICAgc3A8Q2FtZXJhSGFyZHdhcmVJbnRlcmZhY2U+ICAgICBtSGFyZHdhcmU7ICAgICAgIC8vIGNsZWFyZWQgYWZ0ZXIgZGlzY29ubmVjdCgpCi0gICAgICAgIGludCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbVByZXZpZXdDYWxsYmFja0ZsYWc7Ci0gICAgICAgIGludCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbU9yaWVudGF0aW9uOyAgICAgLy8gQ3VycmVudCBkaXNwbGF5IG9yaWVudGF0a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ogICBHICsgazEvazMqUiArIGsyL2s0KkIgPSBZKiggMSArIGsxL2szICsgazIvazQgKQotICoKLSAqICAgWSAgPSAoIEcgKyBrMS9rMypSICsgazIvazQqQiApIC8gKDEgKyBrMS9rMyArIGsyL2s0KQotICogICBZMCA9ICggRzAgKyBrMS9rMypSMCArIGsyL2s0KkIwICkgLyAoKDEgKyBrMS9rMyArIGsyL2s0KSprMCkgKyAxNgotICoKLSAqIGxldCBkZWZpbmU6Ci0gKiAgIGtZciA9IGsxL2szCi0gKiAgIGtZYiA9IGsyL2s0Ci0gKiAgIGtZeSA9IGswICogKCAxICsga1lyICsga1liICkKLSAqCi0gKiB3ZSBoYXZlOgotICogICAgWSAgPSAoIEcgKyBrWXIqUiArIGtZYipCICkKLSAqICAgIFkwID0gY2xhbXBbIFkva1l5ICsgMTYgXQotICovCi0KLXN0YXRpYyBjb25zdCBkb3VibGUga1lyID0gazEvazM7Ci1zdGF0aWMgY29uc3QgZG91YmxlIGtZYiA9IGsyL2s0Owotc3RhdGljIGNvbnN0IGRvdWJsZSBrWXkgPSBrMCooIDEuICsga1lyICsga1liICk7Ci0KLXN0YXRpYyB2b2lkCi1pbml0WXRhYiggdm9pZCApCi17Ci0gICAgY29uc3QgIGludCBpbWF4ID0gKGludCkoIChrWXIgKyBrWWIpKigzMSA8PCAyKSArICg2MSA8PCAzKSArIDAuMSApOwotICAgIGludCAgICBpOwotCi0gICAgZ1lUYWJsZSA9ICh1aW50OF90ICopbWFsbG9jKGltYXgpOwotCi0gICAgZm9yKGk9MDsgaTxpbWF4OyBpKyspIHsKLSAgICAgICAgaW50ICB4ID0gKGludCkoaS9rWXkgKyAxNi41KTsKLSAgICAgICAgaWYgKHggPCAxNikgeCA9IDE2OwotICAgICAgICBlbHNlIGlmICh4ID4gMjM1KSB4ID0gMjM1OwotICAgICAgICBnWVRhYmxlW2ldID0gKHVpbnQ4X3QpIHg7Ci0gICAgfQotfQotCi0vKgotICogICB0aGUgc291cmNlIGlzIFJHQjU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3IgLSAoUi1CKQotICoKLSAqICBSLUcgPSAoazErazMpKkNyICsgazIqQ2IKLSAqICAgICAgPSAoazErazMpKkNyICsgazIvazQqKGszKkNyIC0gKFItQikvazApCi0gKiAgICAgID0gKGsxICsgazMgKyBrMiprMy9rNCkqQ3IgLSBrMi9rNCooUi1CKQotICoKLSAqICBrUnIqQ3IgPSAoUi1HKSArIGtZYiooUi1CKQotICoKLSAqICBDciAgPSAoKFItRykgKyBrWWIqKFItQikpL2tScgotICogIENyMCA9IGNsYW1wKENyICsgMTI4KQotICovCi0KLXN0YXRpYyBjb25zdCBkb3VibGUgIGtSciA9IChrMSArIGszICsgazIqazMvazQpOwotCi1zdGF0aWMgdm9pZAotaW5pdENydGFiKCB2b2lkICkKLXsKLSAgICB1aW50OF90ICpwVGFibGU7Ci0gICAgaW50IGk7Ci0KLSAgICBnQ3JUYWJsZSA9ICh1aW50OF90ICopbWFsbG9jKDc2OCoyKTsKLQotICAgIHBUYWJsZSA9IGdDclRhYmxlICsgMzg0OwotICAgIGZvcihpPS0zODQ7IGk8Mzg0OyBpKyspCi0gICAgICAgIHBUYWJsZVtpXSA9ICh1aW50OF90KSBjbGFtcCggaS9rUnIgKyAxMjguNSApOwotfQotCi0vKgotICogIEItRyA9IChrMiArIGs0KSpDYiArIGsxKkNyCi0gKiAgICAgID0gKGsyICsgazQpKkNiICsgazEvazMqKGs0KkNiICsgKFItQikpCi0gKiAgICAgID0gKGsyICsgazQgKyBrMSprNC9rMykqQ2IgKyBrMS9rMyooUi1CKQotICoKLSAqICBrQmIqQ2IgPSAoQi1HKSAtIGtZciooUi1CKQotICoKLSAqICBDYiAgID0gKChCLUcpIC0ga1lyKihSLUIpKS9rQmIKLSAqICBDYjAgID0gY2xhbXAoQ2IgKyAxMjgpCi0gKgotICovCi0KLXN0YXRpYyBjb25zdCBkb3VibGUgIGtCYiA9IChrMiArIGs0ICsgazEqazQvazMpOwotCi1zdGF0aWMgdm9pZAotaW5pdENidGFiKCB2b2lkICk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AgICAgICAgIFJfZHMgICAgKz0gKHBpeGVscz4+NikgJiAweDAzRTA7Ci0KLSAgICAgICAgICAgIHBpeGVscyA9ICBpbnB1dFJHQltpKzFdOwotICAgICAgICAgICAgdGVtcCA9IChCRVRBKihwaXhlbHMgJiAweDAwMUYpICsgQUxQSEEqKHBpeGVscz4+MTEpICk7Ci0gICAgICAgICAgICB5MSAgID0geV90YWJbKHRlbXA+PlNISUZUMSkgKyAoKHBpeGVscz4+MykgJiAweDAwRkMpXTsKLQotICAgICAgICAgICAgR19kcyAgICArPSAocGl4ZWxzPj4xKSAmIDB4MDNFMDsKLSAgICAgICAgICAgIEJfZHMgICAgKz0gKHBpeGVsczw8NSkgJiAweDAzRTA7Ci0gICAgICAgICAgICBSX2RzICAgICs9IChwaXhlbHM+PjYpICYgMHgwM0UwOwotCi0gICAgICAgICAgICBSX2RzID4+PSAxOwotICAgICAgICAgICAgQl9kcyA+Pj0gMTsKLSAgICAgICAgICAgIEdfZHMgPj49IDE7Ci0KLSAgICAgICAgICAgIHRtcCA9IFJfZHMgLSBCX2RzOwotCi0gICAgICAgICAgICB1ID0gY2JfdGFiWygoKEJfZHMtR19kcyk8PFNISUZUMikgLSBHQU1NQSp0bXApPj4oU0hJRlQyKzIpXTsKLSAgICAgICAgICAgIHYgPSBjcl90YWJbKCgoUl9kcy1HX2RzKTw8U0hJRlQyKSArIERFTFRBKnRtcCk+PihTSElGVDIrMildOwotCi0gICAgICAgICAgICB0ZW1wWVswXSA9IHkwOwotICAgICAgICAgICAgdGVtcFlbMV0gPSB5MTsKLSAgICAgICAgICAgIHRlbXBZICs9IDI7Ci0KLSAgICAgICAgICAgIGlmICgoaiYxKSA9PSAwKSB7Ci0gICAgICAgICAgICAgICAgdGVtcFVbMF0gPSB1OwotICAgICAgICAgICAgICAgIHRlbXBWWzBdID0gdjsKLSAgICAgICAgICAgICAgICB0ZW1wVSArPSAyOwotICAgICAgICAgICAgICAgIHRlbXBWICs9IDI7Ci0gICAgICAgICAg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KKyAgICAgICAgbUNvbnRleHQucmVnaXN0ZXJSZWNlaXZlcihuZXcgQnJvYWRjYXN0UmVjZWl2ZXIoKSB7CisgICAgICAgICAgICBAT3ZlcnJpZGUKKyAgICAgICAgICAgIHB1YmxpYyB2b2lkIG9uUmVjZWl2ZShDb250ZXh0IGNvbnRleHQsIEludGVudCBpbnRlbnQpIHsKKyAgICAgICAgICAgICAgICBvblVzZXJSZW1vdmVkKGludGVudC5nZXRJbnRFeHRyYShJbnRlbnQuRVhUUkFfVVNFUklELCAtMSkpOworICAgICAgICAgICAgfQorICAgICAgICB9LCB1c2VyRmlsdGVyKTsKICAgICB9CiAKICAgICBAT3ZlcnJpZGUKQEAgLTE5MiwxOSArMjAxLDYgQEAKICAgICAgICAgZ2V0SW1wbEZvclVzZXIoKS5kZWxldGVBbGxIb3N0cygpOwogICAgIH0KIAotICAgIHZvaWQgY2FuY2VsQnJvYWRjYXN0cyhQcm92aWRlciBwKSB7Ci0gICAgICAgIGlmIChwLmJyb2FkY2FzdCAhPSBudWxsKSB7Ci0gICAgICAgICAgICBtQWxhcm1NYW5hZ2VyLmNhbmNlbChwLmJyb2FkY2FzdCk7Ci0gICAgICAgICAgICBsb25nIHRva2VuID0gQmluZGVyLmNsZWFyQ2FsbGluZ0lkZW50aXR5KCk7Ci0gICAgICAgICAgICB0cnkgewotICAgICAgICAgICAgICAgIHAuYnJvYWRjYXN0LmNhbmNlbCgpOwotICAgICAgICAgICAgfSBmaW5hbGx5IHsKLSAgICAgICAgICAgICAgICBCaW5kZXIucmVzdG9yZUNhbGxpbmdJZGVudGl0eSh0b2tlbik7Ci0gICAgICAgICAgICB9Ci0gICAgICAgICAgICBwLmJyb2FkY2FzdCA9IG51bGw7Ci0gICAgICAgIH0KLSAgICB9Ci0KICAgICBAT3ZlcnJpZGUKICAgICBwdWJsaWMgdm9pZCBiaW5kQXBwV2lkZ2V0SWQoaW50IGFwcFdpZGdldElkLCBDb21wb25lbnROYW1lIHByb3ZpZGVyKSB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YVNjaGVtZSgicGFja2FnZSIpOwogICAgICAgICBtQ29udGV4dC5yZWdpc3RlclJlY2VpdmVyKG1Ccm9hZGNhc3RSZWNlaXZlciwgZmlsdGVyKTsKICAgICAgICAgLy8gUmVnaXN0ZXIgZm9yIGV2ZW50cyByZWxhdGVkIHRvIHNkY2FyZCBpbnN0YWxsYXRpb24uCkBAIC0xMjM5LDEyICsxMjM4LDEzIEBACiAKICAgICAgICAgLy8gRW5xdWV1ZSBhIG5ldyBiYWNrdXAgb2YgZXZlcnkgcGFydGljaXBhbnQKICAgICAgICAgc3luY2hyb25pemVkIChtQmFja3VwUGFydGljaXBhbnRzKSB7Ci0gICAgICAgICAgICBpbnQgTiA9IG1CYWNrdXBQYXJ0aWNpcGFudHMuc2l6ZSgpOworICAgICAgICAgICAgZmluYWwgaW50IE4gPSBtQmFja3VwUGFydGljaXBhbnRzLnNpemUoKTsKICAgICAgICAgICAgIGZvciAoaW50IGk9MDsgaTxOOyBpKyspIHsKLSAgICAgICAgICAgICAgICBpbnQgdWlkID0gbUJhY2t1cFBhcnRpY2lwYW50cy5rZXlBdChpKTsKLSAgICAgICAgICAgICAgICBIYXNoU2V0PEFwcGxpY2F0aW9uSW5mbz4gcGFydGljaXBhbnRzID0gbUJhY2t1cFBhcnRpY2lwYW50cy52YWx1ZUF0KGkpOwotICAgICAgICAgICAgICAgIGZvciAoQXBwbGljYXRpb25JbmZvIGFwcDogcGFydGljaXBhbnRzKSB7Ci0gICAgICAgICAgICAgICAgICAgIGRhdGFDaGFuZ2VkSW1wbChhcHAucGFja2FnZU5hbWUpOworICAgICAgICAgICAgICAgIEhhc2hTZXQ8U3RyaW5nPiBwYXJ0aWNpcGFudHMgPSBtQmFja3VwUGFydGljaXBhbnRzLnZhbHVlQXQoaSk7CisgICAgICAgICAgICAgICAgaWYgKHBhcnRpY2lwYW50cyAhPSBudWxsKSB7CisgICAgICAgICAgICAgICAgICAgIGZvciAoU3RyaW5nIHBhY2thZ2VOYW1lIDogcGFydGljaXBhbnRzKSB7CisgICAgICAgICAgICAgICAgICAgICAgICBkYXRhQ2hhbmdlZEltcGwocGFja2FnZU5hbWUpOworICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgfQogICAgICAgICB9CkBAIC0xMzAyLDggKzEzMDIsNyBAQAogICAgICAgICAgICAgQnVuZGxlIGV4dHJhcyA9IGludGVudC5nZXRFeHRyYXMoKTsKICAgICAgICAgICAgIFN0cmluZyBwa2dMaXN0W10gPSBudWxsOwogICAgICAgICAgICAgaWYgKEludGVudC5BQ1RJT05fUEFDS0FHRV9BRERFRC5lcXVhbHMoYWN0aW9uKSB8fAotICAgICAgICAgICAgICAgICAgICBJbnRlbnQuQUNUSU9OX1BBQ0tBR0VfUkVNT1ZFRC5lcXVhbHMoYWN0aW9uKSB8fAotICAgICAgICAgICAgICAgICAgICBJbnRlbnQuQUNUSU9OX1BBQ0tBR0VfUkVQTEFDRUQuZXF1YWxzKGFjdGlvbikpIHsKKyAgICAgICAgICAgICAgICAgICAgSW50ZW50LkFDVElPTl9QQUNLQUdFX1JFTU9WRUQuZXF1YWxzKGFjdGlvbikpIHsKICAgICAgICAgICAgICAgICBVcmkgdXJpID0gaW50ZW50LmdldERhdGEoKTsKICAgICAgICAgICAgICAgICBpZiAodXJpID09IG51bGwpIHsKICAgICAgICAgICAgICAgICAgICAgcmV0dXJuOwpAQCAtMTMxMiwxNCArMTMxMSw4IEBACiAgICAgICAgICAgICAgICAgaWYgKHBrZ05hbWUgIT0gbnVsbCkgewogICAgICAgICAgICAgICAgICAgICBwa2dMaXN0ID0gbmV3IFN0cmluZ1tdIHsgcGtnTmFtZSB9OwogICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICBpZiAoSW50ZW50LkFDVElPTl9QQUNLQUdFX1JFUExBQ0VELmVxdWFscyhhY3Rpb24pKSB7Ci0gICAgICAgICAgICAgICAgICAgIC8vIHVzZSB0aGUgZXhpc3RpbmcgImFkZCB3aXRoIHJlcGxhY2VtZW50IiBsb2dpYwotICAgICAgICAgICAgICAgICAgICBpZiAoTU9SRV9ERUJVRykgU2xvZy5kKFRBRywgIlBBQ0tBR0VfUkVQTEFDRUQsIHVwZGF0aW5nIHBhY2thZ2UgIiArIHBrZ05hbWUpOwotICAgICAgICAgICAgICAgICAgICBhZGRlZCA9IHJlcGxhY2luZyA9IHRydWU7Ci0gICAgICAgICAgICAgICAgfSBlbHNlIHsKLSAgICAgICAgICAgICAgICAgICAgYWRkZWQgPSBJbnRlbnQuQUNUSU9OX1BBQ0tBR0VfQURERUQuZXF1YWxzKGFjdGlvbik7Ci0gICAgICAgICAgICAgICAgICAgIHJlcGxhY2luZyA9IGV4dHJhcy5nZXRCb29sZWFuKEludGVudC5FWFRSQV9SRVBMQUNJTkcsIGZhbHNlKTsKLSAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgYWRkZWQgPSBJbnRlbnQuQUNUSU9OX1BBQ0tBR0VfQURERUQuZXF1YWxzKGFjdGlvbik7CisgICAgICAgICAgICAgICAgcmVwbGFjaW5nID0gZXh0cmFzLmdldEJvb2xlYW4oSW50ZW50LkVYVFJBX1JFUExBQ0lORywgZmFsc2UpOwogICAgICAgICAgICAgfSBlbHNlIGlmIChJbnRlbnQuQUNUSU9OX0VYVEVSTkFMX0FQUExJQ0FUSU9OU19BVkFJTEFCTEUuZXF1YWxzKGFjdGlvbikpIHsKICAgICAgICAgICAgICAgICBhZGRlZCA9IHRydWU7CiAgICAgICAgICAgICAgICAgcGtnTGlzdCA9IGludGVudC5nZXRTdHJpbmdBcnJheUV4dHJhKEludGVudC5FWFRSQV9DSEFOR0VEX1BBQ0tBR0VfTElTVCk7CkBAIC0xMzMxLDIwICsxMzI0LDIzIEBACiAgICAgICAgICAgICBpZiAocGtnTGlzdCA9PSBudWxsIHx8IHBrZ0xpc3QubGVuZ3RoID09IDApIHsKICAgICAgICAgICAgICAgICByZXR1cm47CiAgICAgICAgICAgICB9CisKKyAgICAgICAgICAgIGZpbmFsIGludCB1aWQgPSBleHRyYXMuZ2V0SW50KEludGVudC5FWFRSQV9VSUQpOwogICAgICAgICAgICAgaWYgKGFkZGVkKSB7CiAgICAgICAgICAgICAgICAgc3luY2hyb25pemVkIChtQmFja3VwUGFydGljaXBhbnRzKSB7CiAgICAgICAgICAgICAgICAgICAgIGlmIChyZXBsYWNpbmcpIHsKLSAgICAgICAgICAgICAgICAgICAgICAgIHVwZGF0ZVBhY2thZ2VQYXJ0aWNpcGFudHNMb2NrZWQocGtnTGlzdCk7Ci0gICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICBhZGRQYWNrYWdlUGFydGljaXBhbnRzTG9ja2VkKHBrZ0xpc3QpOworICAgICAgICAgICAgICAgICAgICAgICAgLy8gVGhpcyBpcyB0aGUgcGFja2FnZS1yZXBsYWNlZCBjYXNlOyB3ZSBqdXN0IHJlbW92ZSB0aGUgZW50cnkKKyAgICAgICAgICAgICAgICAgICAgICAgIC8vIHVuZGVyIHRoZSBvbGQgdWlkIGFuZCBmYWxsIHRocm91Z2ggdG8gcmUtYWRkLgorICAgICAgICAgICAgICAgICAgICAgICAgcmVtb3ZlUGFja2FnZVBhcnRpY2lwYW50c0xvY2tlZChwa2dMaXN0LCB1aWQpOwogICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgIGFkZFBhY2thZ2VQYXJ0aWNpcGFudHNMb2NrZWQocGtnTGlzdCk7CiAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgfSBlbHNlIHsKICAgICAgICAgICAgICAgICBpZiAocmVwbGFjaW5nKSB7CiAgICAgICAgICAgICAgICAgICAgIC8vIFRoZSBwYWNrYWdlIGlzIGJlaW5nIHVwZGF0ZWQuICBXZSdsbCByZWNlaXZlIGEgUEFDS0FHRV9BRERFRCBzaG9ydGx5LgogICAgICAgICAgICAgICAgIH0gZWxzZSB7CiAgICAgICAgICAgICAgICAgICAgIHN5bmNocm9uaXplZCAobUJhY2t1cFBhcnRpY2lwYW50cykgewotICAgICAgICAgICAgICAgICAgICAgICAgcmVtb3ZlUGFja2FnZVBhcnRpY2lwYW50c0xvY2tlZChwa2dMaXN0KTsKKyAgICAgICAgICAgICAgICAgICAgICAgIHJlbW92ZVBhY2thZ2VQYXJ0aWNpcGFudHNMb2NrZWQocGtnTGlzdCwgdWlkKTsKICAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgIH0KQEAgLTEzOTEsMTIgKzEzODcsMTIgQEAKICAgICAgICAgZm9yIChQYWNrYWdlSW5mbyBwa2cgOiB0YXJnZXRQa2dzKSB7CiAgICAgICAgICAgICBpZiAocGFja2FnZU5hbWUgPT0gbnVsbCB8fCBwa2cucGFja2FnZU5hbWUuZXF1YWxzKHBhY2thZ2VOYW1lKSkgewogICAgICAgICAgICAgICAgIGludCB1aWQgPSBwa2cuYXBwbGljYXRpb25JbmZvLnVpZDsKLSAgICAgICAgICAgICAgICBIYXNoU2V0PEFwcGxpY2F0aW9uSW5mbz4gc2V0ID0gbUJhY2t1cFBhcnRpY2lwYW50cy5nZXQodWlkKTsKKyAgICAgICAgICAgICAgICBIYXNoU2V0PFN0cmluZz4gc2V0ID0gbUJhY2t1cFBhcnRpY2lwYW50cy5nZXQodWlkKTsKICAgICAgICAgICAgICAgICBpZiAoc2V0ID09IG51bGwpIHsKLSAgICAgICAgICAgICAgICAgICAgc2V0ID0gbmV3IEhhc2hTZXQ8QXBwbGljYXRpb25JbmZvPigpOworICAgICAgICAgICAgICAgICAgICBzZXQgPSBuZXcgSGFzaFNldDxTdHJpbmc+KCk7CiAgICAgICAgICAgICAgICAgICAgIG1CYWNrdXBQYXJ0aWNpcGFudHMucHV0KHVpZCwgc2V0KTsKICAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgc2V0LmFkZChwa2cuYXBwbGljYXRpb25JbmZvKTsKKyAgICAgICAgICAgICA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IgIyIgKyBwYWNrYWdlTmFtZXMubGVuZ3RoKTsKICAgICAgICAgZm9yIChTdHJpbmcgcGtnIDogcGFja2FnZU5hbWVzKSB7Ci0gICAgICAgICAgICByZW1vdmVQYWNrYWdlUGFydGljaXBhbnRzTG9ja2VkSW5uZXIocGtnLCBrbm93blBhY2thZ2VzKTsKKyAgICAgICAgICAgIC8vIEtub3duIHByZXZpb3VzIFVJRCwgc28gd2Uga25vdyB3aGljaCBwYWNrYWdlIHNldCB0byBjaGVjaworICAgICAgICAgICAgSGFzaFNldDxTdHJpbmc+IHNldCA9IG1CYWNrdXBQYXJ0aWNpcGFudHMuZ2V0KG9sZFVpZCk7CisgICAgICAgICAgICBpZiAoc2V0ICE9IG51bGwgJiYgc2V0LmNvbnRhaW5zKHBrZykpIHsKKyAgICAgICAgICAgICAgICByZW1vdmVQYWNrYWdlRnJvbVNldExvY2tlZChzZXQsIHBrZyk7CisgICAgICAgICAgICAgICAgaWYgKHNldC5pc0VtcHR5KCkpIHsKKyAgICAgICAgICAgICAgICAgICAgaWYgKE1PUkVfREVCVUcpIFNsb2cudihUQUcsICIgIGxhc3Qgb25lIG9mIHRoaXMgdWlkOyBwdXJnaW5nIHNldCIpOworICAgICAgICAgICAgICAgICAgICBtQmFja3VwUGFydGljaXBhbnRzLnJlbW92ZShvbGRVaWQpOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0KICAgICAgICAgfQogICAgIH0KIAotICAgIHByaXZhdGUgdm9pZCByZW1vdmVQYWNrYWdlUGFydGljaXBhbnRzTG9ja2VkSW5uZXIoU3RyaW5nIHBhY2thZ2VOYW1lLAotICAgICAgICAgICAgTGlzdDxQYWNrYWdlSW5mbz4gYWxsUGFja2FnZXMpIHsKLSAgICAgICAgaWYgKE1PUkVfREVCVUcpIHsKLSAgICAgICAgICAgIFNsb2cudihUQUcsICJyZW1vdmVQYWNrYWdlUGFydGljaXBhbnRzTG9ja2VkSW5uZXIgKCIgKyBwYWNrYWdlTmFtZQotICAgICAgICAgICAgICAgICAgICArICIpIHJlbW92aW5nIGZyb20gIiArIGFsbFBhY2thZ2VzLnNpemUoKSArICIgZW50cmllcyIpOwotICAgICAgICAgICAgZm9yIChQYWNrYWdlSW5mbyBwIDogYWxsUGFja2FnZXMpIHsKLSAgICAgICAgICAgICAgICBTbG9nLnYoVEFHLCAiICAgIC0gIiArIHAucGFja2FnZU5hbWUpOwotICAgICAgICAgICAgfQotICAgICAgICB9Ci0gICAgICAgIGZvciAoUGFja2FnZUluZm8gcGtnIDogYWxsUGFja2FnZXMpIHsKLSAgICAgICAgICAgIGlmIChwYWNrYWdlTmFtZSA9PSBudWxsIHx8IHBrZy5wYWNrYWdlTmFtZS5lcXVhbHMocGFja2FnZU5hbWUpKSB7Ci0gICAgICAgICAgICAgICAgLyoKLSAgICAgICAgICAgICAgICBpbnQgdWlkID0gLTE7Ci0gICAgICAgICAgICAgICAgdHJ5IHsKLSAgICAgICAgICAgICAgICAgICAgUGFja2FnZUluZm8gaW5mbyA9IG1QYWNrYWdlTWFuYWdlci5nZXRQYWNrYWdlSW5mbyhwYWNrYWdlTmFtZSwgMCk7Ci0gICAgICAgICAgICAgICAgICAgIHVpZCA9IGluZm8uYXBwbGljYXRpb25JbmZvLnVpZDsKLSAgICAgICAgICAgICAgICB9IGNhdGNoIChOYW1lTm90Rm91bmRFeGNlcHRpb24gZSkgewotICAgICAgICAgICAgICAgICAgICAvLyB3ZSBkb24ndCBrbm93IHRoaXMgcGFja2FnZSBuYW1lLCBzbyBqdXN0IHNraXAgaXQgZm9yIG5vdwotICAgICAgICAgICAgICAgICAgICBjb250aW51ZTsKLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgKi8KLSAgICAgICAgICAgICAgICBmaW5hbCBpbnQgdWlkID0gcGtnLmFwcGxpY2F0aW9uSW5mby51aWQ7Ci0gICAgICAgICAgICAgICAgaWYgKE1PUkVfREVCVUcpIFNsb2cuaShUQUcsICIgICBmb3VuZCBwa2cgIiArIHBhY2thZ2VOYW1lICsgIiB1aWQ9IiArIHVpZCk7Ci0KLSAgICAgICAgICAgICAgICBIYXNoU2V0PEFwcGxpY2F0aW9uSW5mbz4gc2V0ID0gbUJhY2t1cFBhcnRpY2lwYW50cy5nZXQodWlkKTsKLSAgICAgICAgICAgICAgICBpZiAoc2V0ICE9IG51bGwpIHsKLSAgICAgICAgICAgICAgICAgICAgLy8gRmluZCB0aGUgZXhpc3RpbmcgZW50cnkgd2l0aCB0aGUgc2FtZSBwYWNrYWdlIG5hbWUsIGFuZCByZW1vdmUgaXQuCi0gICAgICAgICAgICAgICAgICAgIC8vIFdlIGNhbid0IGp1c3QgcmVtb3ZlKGFwcCkgYmVjYXVzZSB0aGUgaW5zdGFuY2VzIGFyZSBkaWZmZXJlbnQuCi0gICAgICAgICAgICAgICAgICAgIGZvciAoQXBwbGljYXRpb25JbmZvIGVudHJ5OiBzZXQpIHsKLSAgICAgICAgICAgICAgICAgICAgICAgIGlmIChNT1JFX0RFQlVHKSBTbG9nLmkoVEFHLCAiICAgICAgY2hlY2tpbmcgYWdhaW5zdCAiICsgZW50cnkucGFja2FnZU5hbWUpOwotICAgICAgICAgICAgICAgICAgICAgICAgaWYgKGVudHJ5LnBhY2thZ2VOYW1lLmVxdWFscyhwa2cpKSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKE1PUkVfREVCVUcpIFNsb2cudihUQUcsICIgIHJlbW92aW5nIHBhcnRpY2lwYW50ICIgKyBwa2cpOwotICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNldC5yZW1vdmUoZW50cnkpOwotICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJlbW92ZUV2ZXJCYWNrZWRVcChwa2cucGFja2FnZU5hbWUpOwotICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOwotICAgICAgICAgICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgICAgIGlmIChzZXQuc2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0cy5jb250YWlucyhwYWNrYWdlTmFtZSkpIHsKKyAgICAgICAgICAgICAgICAvLyBBZGQgdGhlIGNhbGxlciB0byB0aGUgc2V0IG9mIHBlbmRpbmcgYmFja3Vwcy4gIElmIHRoZXJlIGlzCisgICAgICAgICAgICAgICAgLy8gb25lIGFscmVhZHkgdGhlcmUsIHRoZW4gb3ZlcndyaXRlIGl0LCBidXQgbm8gaGFybSBkb25lLgorICAgICAgICAgICAgICAgIEJhY2t1cFJlcXVlc3QgcmVxID0gbmV3IEJhY2t1cFJlcXVlc3QocGFja2FnZU5hbWUpOworICAgICAgICAgICAgICAgIGlmIChtUGVuZGluZ0JhY2t1cHMucHV0KHBhY2thZ2VOYW1lLCByZXEpID09IG51bGwpIHsKKyAgICAgICAgICAgICAgICAgICAgaWYgKERFQlVHKSBTbG9nLmQoVEFHLCAiTm93IHN0YWdpbmcgYmFja3VwIG9mICIgKyBwYWNrYWdlTmFtZSk7CiAKLSAgICAgICAgICAgICAgICAgICAgICAgIC8vIEpvdXJuYWwgdGhpcyByZXF1ZXN0IGluIGNhc2Ugb2YgY3Jhc2guICBUaGUgcHV0KCkKLSAgICAgICAgICAgICAgICAgICAgICAgIC8vIG9wZXJhdGlvbiByZXR1cm5lZCBudWxsIHdoZW4gdGhpcyBwYWNrYWdlIHdhcyBub3QgYWxyZWFkeQotICAgICAgICAgICAgICAgICAgICAgICAgLy8gaW4gdGhlIHNldDsgd2Ugd2FudCB0byBhdm9pZCB0b3VjaGluZyB0aGUgZGlzayByZWR1bmRhbnRseS4KLSAgICAgICAgICAgICAgICAgICAgICAgIHdyaXRlVG9Kb3VybmFsTG9ja2VkKHBhY2thZ2VOYW1lKTsKKyAgICAgICAgICAgICAgICAgICAgLy8gSm91cm5hbCB0aGlzIHJlcXVlc3QgaW4gY2FzZSBvZiBjcmFzaC4gIFRoZSBwdXQoKQorICAgICAgICAgICAgICAgICAgICAvLyBvcGVyYXRpb24gcmV0dXJuZWQgbnVsbCB3aGVuIHRoaXMgcGFja2FnZSB3YXMgbm90IGFscmVhZHkKKyAgICAgICAgICAgICAgICAgICAgLy8gaW4gdGhlIHNldDsgd2Ugd2FudCB0byBhdm9pZCB0b3VjaGluZyB0aGUgZGlzayByZWR1bmRhbnRseS4KKyAgICAgICAgICAgICAgICAgICAgd3JpdGVUb0pvdXJuYWxMb2NrZWQocGFja2FnZU5hbWUpOwogCi0gICAgICAgICAgICAgICAgICAgICAgICBpZiAoTU9SRV9ERUJVRykgewotICAgICAgICAgICAgICAgICAgICAgICAgICAgIGludCBudW1LZXlzID0gbVBlbmRpbmdCYWNrdXBzLnNpemUoKTsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBTbG9nLmQoVEFHLCAiTm93IGF3YWl0aW5nIGJhY2t1cCBmb3IgIiArIG51bUtleXMgKyAiIHBhcnRpY2lwYW50czoiKTsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBmb3IgKEJhY2t1cFJlcXVlc3QgYiA6IG1QZW5kaW5nQmFja3Vwcy52YWx1ZXMoKSkgewotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBTbG9nLmQoVEFHLCAiICAgICsgIiArIGIpOwotICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgaWYgKE1PUkVfREVCVUcpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIGludCBudW1LZXlzID0gbVBlbmRpbmdCYWNrdXBzLnNpemUoKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIFNsb2cuZChUQUcsICJOb3cgYXdhaXRpbmcgYmFja3VwIGZvciAiICsgbnVtS2V5cyArICIgcGFydGljaXBhbnRzOiIpOworICAgICAgICAgICAgICAgICAgICAgICAgZm9yIChCYWNrdXBSZXF1ZXN0IGIgOiBtUGVuZGluZ0JhY2t1cHMudmFsdWVzKCkpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBTbG9nLmQoVEFHLCAiICAgICsgIiArIGIpOwogICAgICAgICAgICA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ID0gbUJhY2t1cFBhcnRpY2lwYW50cy5zaXplKCk7CiAgICAgICAgICAgICBmb3IgKGludCBpID0gMDsgaSA8IE47IGkrKykgewotICAgICAgICAgICAgICAgIEhhc2hTZXQ8QXBwbGljYXRpb25JbmZvPiBzID0gbUJhY2t1cFBhcnRpY2lwYW50cy52YWx1ZUF0KGkpOworICAgICAgICAgICAgICAgIEhhc2hTZXQ8U3RyaW5nPiBzID0gbUJhY2t1cFBhcnRpY2lwYW50cy52YWx1ZUF0KGkpOwogICAgICAgICAgICAgICAgIGlmIChzICE9IG51bGwpIHsKICAgICAgICAgICAgICAgICAgICAgYXBwcy5hZGRBbGwocyk7CiAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgfQogICAgICAgICB9CiAKLSAgICAgICAgLy8gbm93IGZpbmQgdGhlIGdpdmVuIHBhY2thZ2UgaW4gdGhlIHNldCBvZiBjYW5kaWRhdGUgYXBwcwotICAgICAgICBmb3IgKEFwcGxpY2F0aW9uSW5mbyBhcHAgOiBhcHBzKSB7Ci0gICAgICAgICAgICBpZiAoYXBwLnBhY2thZ2VOYW1lLmVxdWFscyhwYWNrYWdlTmFtZSkpIHsKLSAgICAgICAgICAgICAgICBpZiAoREVCVUcpIFNsb2cudihUQUcsICJGb3VuZCB0aGUgYXBwIC0gcnVubmluZyBjbGVhciBwcm9jZXNzIik7Ci0gICAgICAgICAgICAgICAgLy8gZm91bmQgaXQ7IGZpcmUgb2ZmIHRoZSBjbGVhciByZXF1ZXN0Ci0gICAgICAgICAgICAgICAgc3luY2hyb25pemVkIChtUXVldWVMb2NrKSB7Ci0gICAgICAgICAgICAgICAgICAgIGxvbmcgb2xkSWQgPSBCaW5kZXIuY2xlYXJDYWxsaW5nSWRlbnRpdHkoKTsKLSAgICAgICAgICAgICAgICAgICAgbVdha2Vsb2NrLmFjcXVpcmUoKTsKLSAgICAgICAgICAgICAgICAgICAgTWVzc2FnZSBtc2cgPSBtQmFja3VwSGFuZGxlci5vYnRhaW5NZXNzYWdlKE1TR19SVU5fQ0xFQVIsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgbmV3IENsZWFyUGFyYW1zKGdldFRyYW5zcG9ydChtQ3VycmVudFRyYW5zcG9ydCksIGluZm8pKTsKLSAgICAgICAgICAgICAgICAgICAgbUJhY2t1cEhhbmRsZXIuc2VuZE1lc3NhZ2UobXNnKTsKLSAgICAgICAgICAgICAgICAgICAgQmluZGVyLnJlc3RvcmVDYWxsaW5nSWRlbnRpdHkob2xkSWQpOwotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgLy8gSXMgdGhlIGdpdmVuIGFwcCBhbiBhdmFpbGFibGUgcGFydGljaXBhbnQ/CisgICAgICAgIGlmIChhcHBzLmNvbnRhaW5zKHBhY2thZ2VOYW1lKSkgeworICAgICAgICAgICAgaWYgKERFQlVHKSBTbG9nLnYoVEFHLCAiRm91bmQgdGhlIGFwcCAtIHJ1bm5pbmcgY2xlYXIgcHJvY2VzcyIpOworICAgICAgICAgICAgLy8gZm91bmQgaXQ7IGZpcmUgb2ZmIHRoZSBjbGVhciByZXF1ZXN0CisgICAgICAgICAgICBzeW5jaHJvbml6ZWQgKG1RdWV1ZUxvY2spIHsKKyAgICAgICAgICAgICAgICBsb25nIG9sZElkID0gQmluZGVyLmNsZWFyQ2FsbGluZ0lkZW50aXR5KCk7CisgICAgICAgICAgICAgICAgbVdha2Vsb2NrLmFjcXVpcmUoKTsKKyAgICAgICAgICAgICAgICBNZXNzYWdlIG1zZyA9IG1CYWNrdXBIYW5kbGVyLm9idGFpbk1lc3NhZ2UoTVNHX1JVTl9DTEVBUiwKKyAgICAgICAgICAgICAgICAgICAgICAgIG5ldyBDbGVhclBhcmFtcyhnZXRUcmFuc3BvcnQobUN1cnJlbnRUcmFuc3BvcnQpLCBpbmZvKSk7CisgICAgICAgICAgICAgICAgbUJhY2t1cEhhbmRsZXIuc2VuZE1lc3NhZ2UobXNnKTsKKyAgICAgICAgICAgICAgICBCaW5kZXIucmVzdG9yZUNhbGxpbmdJZGVudGl0eShvbGRJZCk7CiAgICAgICAgICAgICB9CiAgICAgICAgIH0KICAgICB9CkBAIC01ODM4LDkgKzU3ODIsOSBAQAogICAgICAgICAgICAgICAgIGludCB1aWQgPSBtQmFja3VwUGFydGljaXBhbnRzLmtleUF0KGkpOwogICAgICAgICAgICAgICAgIHB3LnByaW50KCIgIHVpZDogIik7CiAgICAgICAgICAgICAgICAgcHcucHJpbnRsbih1aWQpOwotICAgICAgICAgICAgICAgIEhhc2hTZXQ8QXBwbGljYXRpb25JbmZvPiBwYXJ0aWNpcGFudHMgPSBtQmFja3VwUGFydGljaXBhbnRzLnZhbHVlQXQoaSk7Ci0gICAgICAgICAgICAgICAgZm9yIChBcHBsaWNhdGlvbkluZm8gYXBwOiBwYXJ0aWNpcGFudHMpIHsKLSAgICAgICAgICAgICAgICAgICAgcHcucHJpbnRsbigiICAgICIgKyBhcHAucGFja2FnZU5hbWUpOworICAgICAgICAgICAgICAgIEhhc2hTZXQ8U3RyaW5nPiBwYXJ0aWNpcGFudHMgPSBtQmFja3VwUGFydGljaXBhbnRzLnZhbHVlQXQoaSk7CisgICAgICAgICAgICAgICAgZm9yIChTdHJpbmcgYXBwOiBwYXJ0aWNpcGFudHMpIHsKKyAgICAgICAgICAgICAgICAgICAgcHcucHJpbnRsbigiICAgICIgKyBhcHApOwogICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgIH0KIApkaWZmIC0tZ2l0IGEvc2VydmljZXMvamF2YS9jb20vYW5kcm9pZC9zZXJ2ZXIvQ2xpcGJvYXJkU2VydmljZS5qYXZhIGIvc2VydmljZXMvamF2YS9jb20vYW5kcm9pZC9zZXJ2ZXIvQ2xpcGJvYXJkU2VydmljZS5qYXZhCmluZGV4IDA2MmFiNzQuLjJlMmEyNzggMTAwNjQ0Ci0tLSBhL3NlcnZpY2VzL2phdmEvY29tL2FuZHJvaWQvc2VydmVyL0NsaXBib2FyZFNlcn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pdmVyKG5ldyBCcm9hZGNhc3RSZWNlaXZlcigpIHsKICAgICAgICAgICAgIEBPdmVycmlkZQotICAgICAgICAgICAgcHVibGljIHZvaWQgb25Vc2VyQ2hhbmdlZChpbnQgdXNlcklkKSB7Ci0gICAgICAgICAgICAgICAgc3dpdGNoVXNlcih1c2VySWQpOworICAgICAgICAgICAgcHVibGljIHZvaWQgb25SZWNlaXZlKENvbnRleHQgY29udGV4dCwgSW50ZW50IGludGVudCkgeworICAgICAgICAgICAgICAgIFN0cmluZyBhY3Rpb24gPSBpbnRlbnQuZ2V0QWN0aW9uKCk7CisgICAgICAgICAgICAgICAgaWYgKEludGVudC5BQ1RJT05fVVNFUl9TV0lUQ0hFRC5lcXVhbHMoYWN0aW9uKSkgeworICAgICAgICAgICAgICAgICAgICBzd2l0Y2hVc2VyKGludGVudC5nZXRJbnRFeHRyYShJbnRlbnQuRVhUUkFfVVNFUklELCAwKSk7CisgICAgICAgICAgICAgICAgfSBlbHNlIGlmIChJbnRlbnQuQUNUSU9OX1VTRVJfUkVNT1ZFRC5lcXVhbHMoYWN0aW9uKSkgeworICAgICAgICAgICAgICAgICAgICByZW1vdmVVc2VyKGludGVudC5nZXRJbnRFeHRyYShJbnRlbnQuRVhUUkFfVVNFUklELCAwKSk7CisgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgfQotCi0gICAgICAgICAgICBAT3ZlcnJpZGUKLSAgICAgICAgICAgIHB1YmxpYyB2b2lkIG9uVXNlckFkZGVkKGludCB1c2VySWQpIHsKLSAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgQE92ZXJyaWRlCi0gICAgICAgICAgICBwdWJsaWMgdm9pZCBvblVzZXJSZW1vdmVkKGludCB1c2VySWQpIHsKLSAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgQE92ZXJyaWRlCi0gICAgICAgICAgICBwdWJsaWMgdm9pZCBvblVzZXJMb2dnZWRPdXQoaW50IHVzZXJJZCkgewotICAgICAgICAgICAgfQotCi0gICAgICAgIH0pOworICAgICAgICB9LCB1c2VyRmlsdGVyKTsKICAgICB9CiAKICAgICBTdHJpbmcgZ2V0TmFtZSgpIHsKICAgICAgICAgcmV0dXJuIG1XYWxscGFwZXJNYXAuZ2V0KDApLm5hbWU7CiAgICAgfQogCisgICAgdm9pZCByZW1vdmVVc2VyKGludCB1c2VySWQpIHsKKyAgICAgICAgc3luY2hyb25pemVkIChtTG9jaykgeworICAgICAgICAgICAgV2FsbHBhcGVyRGF0YSB3YWxscGFwZXIgPSBtV2FsbHBhcGVyTWFwLmdldCh1c2VySWQpOworICAgICAgICAgICAgaWYgKHdhbGxwYXBlciAhPSBudWxsKSB7CisgICAgICAgICAgICAgICAgd2FsbHBhcGVyLndhbGxwYXBlck9ic2VydmVyLnN0b3BXYXRjaGluZygpOworICAgICAgICAgICAgICAgIG1XYWxscGFwZXJNYXAucmVtb3ZlKHVzZXJJZCk7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBGaWxlIHdhbGxwYXBlckZpbGUgPSBuZXcgRmlsZShnZXRXYWxscGFwZXJEaXIodXNlcklkKSwgV0FMTFBBUEVSKTsKKyAgICAgICAgICAgIHdhbGxwYXBlckZpbGUuZGVsZXRlKCk7CisgICAgICAgICAgICBGaWxlIHdhbGxwYXBlckluZm9GaWxlID0gbmV3IEZpbGUoZ2V0V2FsbHBhcGVyRGlyKHVzZXJJZCksIFdBTExQQVBFUl9JTkZPKTsKKyAgICAgICAgICAgIHdhbGxwYXBlckluZm9GaWxlLmRlbGV0ZSgpOworICAgICAgICB9CisgICAgfQorCiAgICAgdm9pZCBzd2l0Y2hVc2VyKGludCB1c2VySWQpIHsKICAgICAgICAgc3luY2hyb25pemVkIChtTG9jaykgewogICAgICAgICAgICAgbUN1cnJlbnRVc2VySWQgPSB1c2VySWQ7CkBAIC04NjEsNyArODcxLDcgQEAKICAgICB9CiAKICAgICBwcml2YXRlIHN0YXRpYyBKb3VybmFsZWRGaWxlIG1ha2VKb3VybmFsZWRGaWxlKGlud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ICAgICAgICAgICYmIChhcHAucHJvY2Vzc05hbWUuZXF1YWxzKHBhY2thZ2VOYW1lKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8fCBhcHAucHJvY2Vzc05hbWUuc3RhcnRzV2l0aChwcm9jTmFtZVByZWZpeCkpKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgfHwgKHVpZCA8IDAKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiAoYXBwLnByb2Nlc3NOYW1lLmVxdWFscyhwYWNrYWdlTmFtZSkKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHx8IGFwcC5wcm9jZXNzTmFtZS5zdGFydHNXaXRoKHByb2NOYW1lUHJlZml4KSkpKSB7CiAgICAgICAgICAgICAgICAgICAgIGlmIChhcHAuc2V0QWRqID49IG1pbk9vbUFkaikgewogICAgICAgICAgICAgICAgICAgICAgICAgaWYgKCFkb2l0KSB7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHRydWU7CkBAIC0zNjM1LDcgKzM2NDEsOCBAQAogICAgICAgICBmb3IgKGk9MDsgaTxtTWFpblN0YWNrLm1IaXN0b3J5LnNpemUoKTsgaSsrKSB7CiAgICAgICAgICAgICBBY3Rpdml0eVJlY29yZCByID0gKEFjdGl2aXR5UmVjb3JkKW1NYWluU3RhY2subUhpc3RvcnkuZ2V0KGkpOwogICAgICAgICAgICAgZmluYWwgYm9vbGVhbiBzYW1lUGFja2FnZSA9IHIucGFja2FnZU5hbWUuZXF1YWxzKG5hbWUpOwotICAgICAgICAgICAgaWYgKChzYW1lUGFja2FnZSB8fCByLnRhc2sgPT0gbGFzdFRhc2spCisgICAgICAgICAgICBpZiAoci51c2VySWQgPT0gdXNlcklkCisgICAgICAgICAgICAgICAgICAgICYmIChzYW1lUGFja2FnZSB8fCByLnRhc2sgPT0gbGFzdFRhc2spCiAgICAgICAgICAgICAgICAgICAgICYmIChyLmFwcCA9PSBudWxsIHx8IGV2ZW5QZXJzaXN0ZW50IHx8ICFyLmFwcC5wZXJzaXN0ZW50KSkgewogICAgICAgICAgICAgICAgIGlmICghZG9pdCkgewogICAgICAgICAgICAgICAgICAgICBpZiAoci5maW5pc2hpbmcpIHsKQEAgLTM2ODUsNyArMzY5Miw3IEBACiAgICAgICAgIH0KIAogICAgICAgICBBcnJheUxpc3Q8Q29udGVudFByb3ZpZGVyUmVjb3JkPiBwcm92aWRlcnMgPSBuZXcgQXJyYXlMaXN0PENvbnRlbnRQcm92aWRlclJlY29yZD4oKTsKLSAgICAgICAgZm9yIChDb250ZW50UHJvdmlkZXJSZWNvcmQgcHJvdmlkZXIgOiBtUHJvdmlkZXJNYXAuZ2V0UHJvdmlkZXJzQnlDbGFzcygtMSkudmFsdWVzKCkpIHsKKyAgICAgICAgZm9yIChDb250ZW50UHJvdmlkZXJSZWNvcmQgcHJvdmlkZXIgOiBtUHJvdmlkZXJNYXAuZ2V0UHJvdmlkZXJzQnlDbGFzcyh1c2VySWQpLnZhbHVlcygpKSB7CiAgICAgICAgICAgICBpZiAocHJvdmlkZXIuaW5mby5wYWNrYWdlTmFtZS5lcXVhbHMobmFtZSkKICAgICAgICAgICAgICAgICAgICAgJiYgKHByb3ZpZGVyLnByb2MgPT0gbnVsbCB8fCBldmVuUGVyc2lzdGVudCB8fCAhcHJvdmlkZXIucHJvYy5wZXJzaXN0ZW50KSkgewogICAgICAgICAgICAgICAgIGlmICghZG9pdCkgewpAQCAtNDExOCw3ICs0MTI1LDE2IEBACiAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgfQogICAgICAgICB9LCBwa2dGaWx0ZXIpOwotICAgICAgICAKKworICAgICAgICBJbnRlbnRGaWx0ZXIgdXNlckZpbHRlciA9IG5ldyBJbnRlbnRGaWx0ZXIoKTsKKyAgICAgICAgdXNlckZpbHRlci5hZGRBY3Rpb24oSW50ZW50LkFDVElPTl9VU0VSX1JFTU9WRUQpOworICAgICAgICBtQ29udGV4dC5yZWdpc3RlclJlY2VpdmVyKG5ldyBCcm9hZGNhc3RSZWNlaXZlcigpIHsKKyAgICAgICAgICAgIEBPdmVycmlkZQorICAgICAgICAgICAgcHVibGljIHZvaWQgb25SZWNlaXZlKENvbnRleHQgY29udGV4dCwgSW50ZW50IGludGVudCkgeworICAgICAgICAgICAgICAgIG9uVXNlclJlbW92ZWQoaW50ZW50KTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfSwgdXNlckZpbHRlcik7CisKICAgICAgICAgc3luY2hyb25pemVkICh0aGlzKSB7CiAgICAgICAgICAgICAvLyBFbnN1cmUgdGhhdCBhbnkgcHJvY2Vzc2VzIHdlIGhhZCBwdXQgb24gaG9sZCBhcmUgbm93IHN0YXJ0ZWQKICAgICAgICAgICAgIC8vIHVwLgpAQCAtMTI0NjksNyArMTI0ODUsNyBAQAogCiAgICAgICAgIGlmIChERUJVR19CUk9BRENBU1RfTElHSFQpIFNsb2cudigKICAgICAgICAgICAgIFRBRywgKHN0aWNreSA/ICJCcm9hZGNhc3Qgc3RpY2t5OiAiOiAiQnJvYWRjYXN0OiAiKSArIGludGVudAotICAgICAgICAgICAgKyAiIG9yZGVyZWQ9IiArIG9yZGVyZWQpOworICAgICAgICAgICAgKyAiIG9yZGVyZWQ9IiArIG9yZGVyZWQgKyAiIHVzZXJpZD0iICsgdXNlcklkKTsKICAgICAgICAgaWYgKChyZXN1bHRUbyAhPSBudWxsKSAmJiAhb3JkZXJlZCkgewogICAgICAgICAgICAgU2xvZy53KFRBRywgIkJyb2FkY2FzdCAiICsgaW50ZW50ICsgIiBub3Qgb3JkZXJlZCBidXQgcmVzdWx0IGNhbGxiYWNrIHJlcXVlc3RlZCEiKTsKICAgICAgICAgfQpAQCAtMTQ1OTMsMjUgKzE0NjA5LDYgQEAKIAogICAgIHByaXZhdGUgaW50IG1DdXJyZW50VXNlcklkOwogICAgIHByaXZhdGUgU3BhcnNlSW50QXJyYXkgbUxvZ2dlZEluVXNlcnMgPSBuZXcgU3BhcnNlSW50QXJyYXkoNSk7Ci0gICAgcHJpdmF0ZSBBcnJheUxpc3Q8VXNlckxpc3RlbmVyPiBtVXNlckxpc3RlbmVycyA9IG5ldyBBcnJheUxpc3Q8VXNlckxpc3RlbmVyPigzKTsKLQotICAgIHB1YmxpYyBpbnRlcmZhY2UgVXNlckxpc3RlbmVyIHsKLSAgICAgICAgcHVibGljIHZvaWQgb25Vc2VyQ2hhbmdlZChpbnQgdXNlcklkKTsKLQotICAgICAgICBwdWJsaWMgdm9pZCBvblVzZXJBZGRlZChpbnQgdXNlcklkKTsKLQotICAgICAgICBwdWJsaWMgdm9pZCBvblVzZXJSZW1vdmVkKGludCB1c2VySWQpOwotCi0gICAgICAgIHB1YmxpYyB2b2lkIG9uVXNlckxvZ2dlZE91dChpbnQgdXNlcklkKTsKLSAgICB9Ci0KLSAgICBwdWJsaWMgdm9pZCBhZGRVc2VyTGlzdGVuZXIoVXNlckxpc3RlbmVyIGxpc3RlbmVyKSB7Ci0gICAgICAgIHN5bmNocm9uaXplZCAodGhpcykgewotICAgICAgICAgICAgaWYgKCFtVXNlckxpc3RlbmVycy5jb250YWlucyhsaXN0ZW5lcikpIHsKLSAgICAgICAgICAgICAgICBtVXNlckxpc3RlbmVycy5hZGQobGlzdGVuZXIpOwotICAgICAgICAgICAgfQotICAgICAgICB9Ci0gICAgfQogCiAgICAgcHVibGljIGJvb2xlYW4gc3dpdGNoVXNlcihpbnQgdXNlcklkKSB7CiAgICAgICAgIGZpbmFsIGludCBjYWxsaW5nVWlkID0gQmluZGVyLmdldENhbGxpbmdVaWQoKTsKQEAgLTE0NjIyLDggKzE0NjE5LDYgQEAKICAgICAgICAgaWYgKG1DdXJyZW50VXNlcklkID09IHVzZXJJZCkKICAgICAgICAgICAgIHJldHVybiB0cnVlOwogCi0gICAgICAgIEFycmF5TGlzdDxVc2VyTGlzdGVuZXI+IGxpc3RlbmVyczsKLQogICAgICAgICBzeW5jaHJvbml6ZWQgKHRoaXMpIHsKICAgICAgICAgICAgI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dBbmRVaWRzKSB7CisgICAgICAgICAgICAgICAgZm9yY2VTdG9wUGFja2FnZUxvY2tlZChwa2dBbmRVaWQuZmlyc3QsIHBrZ0FuZFVpZC5zZWNvbmQsCisgICAgICAgICAgICAgICAgICAgICAgICBmYWxzZSwgZmFsc2UsIHRydWUsIHRydWUsIGV4dHJhVXNlcklkKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgfQorICAgIH0KKwogICAgIHByaXZhdGUgYm9vbGVhbiB1c2VyRXhpc3RzKGludCB1c2VySWQpIHsKICAgICAgICAgdHJ5IHsKLSAgICAgICAgICAgIExpc3Q8VXNlckluZm8+IHVzZXJzID0gQXBwR2xvYmFscy5nZXRQYWNrYWdlTWFuYWdlcigpLmdldFVzZXJzKCk7Ci0gICAgICAgICAgICBmb3IgKFVzZXJJbmZvIHVzZXIgOiB1c2VycykgewotICAgICAgICAgICAgICAgIGlmICh1c2VyLmlkID09IHVzZXJJZCkgewotICAgICAgICAgICAgICAgICAgICByZXR1cm4gdHJ1ZTsKLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICB9CisgICAgICAgICAgICBVc2VySW5mbyB1c2VyID0gQXBwR2xvYmFscy5nZXRQYWNrYWdlTWFuYWdlcigpLmdldFVzZXIodXNlcklkKTsKKyAgICAgICAgICAgIHJldHVybiB1c2VyICE9IG51bGw7CiAgICAgICAgIH0gY2F0Y2ggKFJlbW90ZUV4Y2VwdGlvbiByZSkgewogICAgICAgICAgICAgLy8gV29uJ3QgaGFwcGVuLCBpbiBzYW1lIHByb2Nlc3MKICAgICAgICAgfQpkaWZmIC0tZ2l0IGEvc2VydmljZXMvamF2YS9jb20vYW5kcm9pZC9zZXJ2ZXIvcG0vUGFja2FnZU1hbmFnZXJTZXJ2aWNlLmphdmEgYi9zZXJ2aWNlcy9qYXZhL2NvbS9hbmRyb2lkL3NlcnZlci9wbS9QYWNrYWdlTWFuYWdlclNlcnZpY2UuamF2YQppbmRleCAwNjdiZjI4Li4xNTkzNzA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ZXRWYWx1ZSgpOwogICAgICAgICAgICAgICAgICAgICAgICAgICAgIFBhY2thZ2VTZXR0aW5nIHBzID0gbVNldHRpbmdzLm1QYWNrYWdlcy5nZXQoZW50LmdldEtleSgpKTsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICB1aWRzW2ldID0gKHBzICE9IG51bGwpID8gcHMudWlkIDogLTE7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgdWlkc1tpXSA9IChwcyAhPSBudWxsKSA/IHBzLmFwcElkIDogLTE7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaSsrOwogICAgICAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgICAgICAgICAgc2l6ZSA9IGk7CkBAIC02NzYsMTQgKzY3NywxNSBAQAogICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzZW5kUGFja2FnZUJyb2FkY2FzdChJbnRlbnQuQUNUSU9OX1BBQ0tBR0VfQURERUQsCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXMucGtnLmFwcGxpY2F0aW9uSW5mby5wYWNrYWdlTmFtZSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGV4dHJhcywgbnVsbCwgbnVsbCk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBleHRyYXMsIG51bGwsIG51bGwsIFVzZXJJZC5VU0VSX0FMTCk7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHVwZGF0ZSkgewogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzZW5kUGFja2FnZUJyb2FkY2FzdChJbnRlbnQuQUNUSU9OX1BBQ0tBR0VfUkVQTEFDRUQsCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmVzLnBrZy5hcHBsaWNhdGlvbkluZm8ucGFja2FnZU5hbWUsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZXh0cmFzLCBudWxsLCBudWxsKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBleHRyYXMsIG51bGwsIG51bGwsIFVzZXJJZC5VU0VSX0FMTCk7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNlbmRQYWNrYWdlQnJvYWRjYXN0KEludGVudC5BQ1RJT05fTVlfUEFDS0FHRV9SRVBMQUNFRCwKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBudWxsLCBudWxsLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJlcy5wa2cuYXBwbGljYXRpb25JbmZvLnBhY2thZ2VOYW1lLCBudWxsKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXMucGtnLmFwcGxpY2F0aW9uSW5mby5wYWNrYWdlTmFtZSwgbnVsbCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBVc2VySWQuVVNFUl9BTEwpOwogICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAocmVzLnJlbW92ZWRJbmZvLmFyZ3MgIT0gbnVsbCkgewogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyBSZW1vdmUgdGhlIHJlcGxhY2VkIHBhY2thZ2UncyBvbGRlciByZXNvdXJjZXMgc2FmZWx5IG5vdwpAQCAtODIwLDYgKzgyMiw3IEBACiAgICAgfQogCiAgICAgdm9pZCBzY2hlZHVsZVdyaXRlUGFja2FnZVJlc3RyaWN0aW9uc0xvY2tlZChpbnQgdXNlcklkKSB7CisgICAgICAgIGlmICghc1VzZXJNYW5hZ2VyLmV4aXN0cyh1c2VySWQpKSByZXR1cm47CiAgICAgICAgIG1EaXJ0eVVzZXJzLmFkZCh1c2VySWQpOwogICAgICAgICBpZiAoIW1IYW5kbGVyLmhhc01lc3NhZ2VzKFdSSVRFX1BBQ0tBR0VfUkVTVFJJQ1RJT05TKSkgewogICAgICAgICAgICAgbUhhbmRsZXIuc2VuZEVtcHR5TWVzc2FnZURlbGF5ZWQoV1JJVEVfUEFDS0FHRV9SRVNUUklDVElPTlMsIFdSSVRFX1NFVFRJTkdTX0RFTEFZKTsKQEAgLTkyMCw3ICs5MjMsNyBAQAogICAgICAgICAgICAgbVVzZXJBcHBEYXRhRGlyID0gbmV3IEZpbGUoZGF0YURpciwgInVzZXIiKTsKICAgICAgICAgICAgIG1Ecm1BcHBQcml2YXRlSW5zdGFsbERpciA9IG5ldyBGaWxlKGRhdGFEaXIsICJhcHAtcHJpdmF0ZSIpOwogCi0gICAgICAgICAgICBtVXNlck1hbmFnZXIgPSBuZXcgVXNlck1hbmFnZXIobUluc3RhbGxlciwgbVVzZXJBcHBEYXRhRGlyKTsKKyAgICAgICAgICAgIHNVc2VyTWFuYWdlciA9IG5ldyBVc2VyTWFuYWdlcihtSW5zdGFsbGVyLCBtVXNlckFwcERhdGFEaXIpOwogCiAgICAgICAgICAgICByZWFkUGVybWlzc2lvbnMoKTsKIApAQCAtMTA4Niw3ICsxMDg5LDcgQEAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKyAiIG5vIGxvbmdlciBleGlzdHM7IHdpcGluZyBpdHMgZGF0YSI7CiAgICAgICAgICAgICAgICAgICAgICAgICByZXBvcnRTZXR0aW5nc1Byb2JsZW0oTG9nLldBUk4sIG1zZyk7CiAgICAgICAgICAgICAgICAgICAgICAgICBtSW5zdGFsbGVyLnJlbW92ZShwcy5uYW1lLCAwKTsKLSAgICAgICAgICAgICAgICAgICAgICAgIG1Vc2VyTWFuYWdlci5yZW1vdmVQYWNrYWdlRm9yQWxsVXNlcnMocHMubmFtZSk7CisgICAgICAgICAgICAgICAgICAgICAgICBzVXNlck1hbmFnZXIucmVtb3ZlUGFja2FnZUZvckFsbFVzZXJzKHBzLm5hbWUpOwogICAgICAgICAgICAgICAgICAgICB9CiA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V0IGhhcyByZXRhaW5lZCBkYXRhIGFuZCByZXNvdXJjZXMuCi0gICAgICAgICAgICByZXR1cm4gUGFja2FnZVBhcnNlci5nZW5lcmF0ZVBhY2thZ2VJbmZvKHAsIG51bGwsIGZsYWdzLCAwLCAwLCBudWxsKTsKKyAgICAgICAgICAgIHBpID0gUGFja2FnZVBhcnNlci5nZW5lcmF0ZVBhY2thZ2VJbmZvKHAsIG51bGwsIGZsYWdzLCAwLCAwLCBudWxsLCBmYWxzZSwgMCwgdXNlcklkKTsKKyAgICAgICAgfSBlbHNlIHsKKyAgICAgICAgICAgIGZpbmFsIFBhY2thZ2VTZXR0aW5nIHBzID0gKFBhY2thZ2VTZXR0aW5nKSBwLm1FeHRyYXM7CisgICAgICAgICAgICBpZiAocHMgPT0gbnVsbCkgeworICAgICAgICAgICAgICAgIHJldHVybiBudWxsOworICAgICAgICAgICAgfQorICAgICAgICAgICAgZmluYWwgR3JhbnRlZFBlcm1pc3Npb25zIGdwID0gcHMuc2hhcmVkVXNlciAhPSBudWxsID8gcHMuc2hhcmVkVXNlciA6IHBzOworICAgICAgICAgICAgcGkgPSBQYWNrYWdlUGFyc2VyLmdlbmVyYXRlUGFja2FnZUluZm8ocCwgZ3AuZ2lkcywgZmxhZ3MsCisgICAgICAgICAgICAgICAgICAgIHBzLmZpcnN0SW5zdGFsbFRpbWUsIHBzLmxhc3RVcGRhdGVUaW1lLCBncC5ncmFudGVkUGVybWlzc2lvbnMsCisgICAgICAgICAgICAgICAgICAgIHBzLmdldFN0b3BwZWQodXNlcklkKSwgcHMuZ2V0RW5hYmxlZCh1c2VySWQpLCB1c2VySWQpOworICAgICAgICAgICAgcGkuYXBwbGljYXRpb25JbmZvLmVuYWJsZWRTZXR0aW5nID0gcHMuZ2V0RW5hYmxlZCh1c2VySWQpOworICAgICAgICAgICAgcGkuYXBwbGljYXRpb25JbmZvLmVuYWJsZWQgPQorICAgICAgICAgICAgICAgICAgICBwaS5hcHBsaWNhdGlvbkluZm8uZ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CisgICAgICAgIGlmICghc1VzZXJNYW5hZ2VyLmV4aXN0cyh1c2VySWQpKSByZXR1cm4gbnVsbDsKICAgICAgICAgUGFja2FnZVNldHRpbmcgcHMgPSBtU2V0dGluZ3MubVBhY2thZ2VzLmdldChwYWNrYWdlTmFtZSk7CiAgICAgICAgIGlmIChwcyAhPSBudWxsKSB7CiAgICAgICAgICAgICBpZiAocHMucGtnID09IG51bGwpIHsKQEAgLTE2ODIsMTUgKzE2OTcsMTggQEAKICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgcmV0dXJuIG51bGw7CiAgICAgICAgICAgICB9Ci0gICAgICAgICAgICByZXR1cm4gUGFja2FnZVBhcnNlci5nZW5lcmF0ZUFwcGxpY2F0aW9uSW5mbyhwcy5wa2csIGZsYWdzKTsKKyAgICAgICAgICAgIHJldHVybiBQYWNrYWdlUGFyc2VyLmdlbmVyYXRlQXBwbGljYXRpb25JbmZvKHBzLnBrZywgZmxhZ3MsIHBzLmdldFN0b3BwZWQodXNlcklkKSwKKyAgICAgICAgICAgICAgICAgICAgcHMuZ2V0RW5hYmxlZCh1c2VySWQpLCB1c2VySWQpOwogICAgICAgICB9CiAgICAgICAgIHJldHVybiBudWxsOwogICAgIH0KIAogICAgIHByaXZhdGUgUGFja2FnZUluZm8gZ2VuZXJhdGVQYWNrYWdlSW5mb0Zyb21TZXR0aW5nc0xQdyhTdHJpbmcgcGFja2FnZU5hbWUsIGludCBmbGFncywKICAgICAgICAgICAgIGludCB1c2VySWQpIHsKKyAgICAgICAgaWYgKCFzVXNlck1hbmFnZXIuZXhpc3RzKHVzZXJJZCkpIHJldHVybiBudWxsOwogICAgICAgICBQYWNrYWdlU2V0dGluZyBwcyA9IG1TZXR0aW5ncy5tUGFja2FnZXMuZ2V0KHBhY2thZ2VOYW1lKTsKICAgICAgICAgaWYgKHBzICE9IG51bGwpIHsKKyAgICAgICAgICAgIFBhY2thZ2VQYXJzZXIuUGFja2FnZSBwa2cgPSBuZXcgUGFja2FnZVBhcnNlci5QYWNrYWdlKHBhY2thZ2VOYW1lKTsKICAgICAgICAgICAgIGlmIChwcy5wa2cgPT0gbnVsbCkgewogICAgICAgICAgICAgICAgIHBzLnBrZyA9IG5ldyBQYWNrYWdlUGFyc2VyLlBhY2thZ2UocGFja2FnZU5hbWUpOwogICAgICAgICAgICAgICAgIHBzLnBrZy5hcHBsaWNhdGlvbkluZm8ucGFja2FnZU5hbWUgPSBwYWNrYWdlTmFtZTsKQEAgLTE3MDEsMTUgKzE3MTksMTYgQEAKICAgICAgICAgICAgICAgICAgICAgICAgIGdldERhdGFQYXRoRm9yUGFja2FnZShwcy5wa2cucGFja2FnZU5hbWUsIDApLmdldFBhdGgoKTsKICAgICAgICAgICAgICAgICBwcy5wa2cuYXBwbGljYXRpb25JbmZvLm5hdGl2ZUxpYnJhcnlEaXIgPSBwcy5uYXRpdmVMaWJyYXJ5UGF0aFN0cmluZzsKICAgICAgICAgICAgIH0KLSAgICAgICAgICAgIHBzLnBrZy5tU2V0RW5hYmxlZCA9IHBzLmdldEVuYWJsZWQodXNlcklkKTsKLSAgICAgICAgICAgIHBzLnBrZy5tU2V0U3RvcHBlZCA9IHBzLmdldFN0b3BwZWQodXNlcklkKTsKLSAgICAgICAgICAgIHJldHVybiBnZW5lcmF0ZVBhY2thZ2VJbmZvKHBzLnBrZywgZmxhZ3MpOworICAgICAgICAgICAgLy8gcHMucGtnLm1TZXRFbmFibGVkID0gcHMuZ2V0RW5hYmxlZCh1c2VySWQpOworICAgICAgICAgICAgLy8gcHMucGtnLm1TZXRTdG9wcGVkID0gcHMuZ2V0U3RvcHBlZCh1c2VySWQpOworICAgICAgICAgICAgcmV0dXJuIGdlbmVyYXRlUGFja2FnZUluZm8ocHMucGtnLCBmbGFncywgdXNlcklkKTsKICAgICAgICAgfQogICAgICAgICByZXR1cm4gbnVsbDsKICAgICB9CiAKICAgICBAT3ZlcnJpZGUKICAgICBwdWJsaWMgQXBwbGljYXRpb25JbmZvIGdldEFwcGxpY2F0aW9uSW5mbyhTdHJpbmcgcGFja2FnZU5hbWUsIGludCBmbGFncywgaW50IHVzZXJJZCkgeworICAgICAgICBpZiAoIXNVc2VyTWFuYWdlci5leGlzdHModXNlcklkKSkgcmV0dXJuIG51bGw7CiAgICAgICAgIC8vIHdyaXRlcgogICAgICAgICBzeW5jaHJvbml6ZWQgKG1QYWNrYWdlcykgewogICAgICAgICAgICAgUGFja2FnZVBhcnNlci5QYWNrYWdlIHAgPSBtUGFja2FnZXMuZ2V0KHBhY2thZ2VOYW1lKTsKQEAgLTE3MTcsOCArMTczNiwxMSBAQAogICAgICAgICAgICAgICAgICAgICBUQUcsICJnZXRBcHBsaWNhdGlvbkluZm8gIiArIHBhY2thZ2VOYW1lCiAgICAgICAgICAgICAgICAgICAgICsgIjogIiArIHApOwogICAgICAgICAgICAgaWYgKHAgIT0gbnVsbCkgeworICAgICAgICAgICAgICAgIFBhY2thZ2VTZXR0aW5nIHBzID0gbVNldHRpbmdzLm1QYWNrYWdlcy5nZXQocGFja2FnZU5hbWUpOworICAgICAgICAgICAgICAgIGlmIChwcyA9PSBudWxsKSByZXR1cm4gbnVsbDsKICAgICAgICAgICAgICAgICAvLyBOb3RlOiBpc0VuYWJsZWRMUCgpIGRvZXMgbm90IGFwcGx5IGhlcmUgLSBhbHdheXMgcmV0dXJuIGluZm8KLSAgICAgICAgICAgICAgICByZXR1cm4gUGFja2FnZVBhcnNlci5nZW5lcmF0ZUFwcGxpY2F0aW9uSW5mbyhwLCBmbGFncyk7CisgICAgICAgICAgICAgICAgcmV0dXJuIFBhY2thZ2VQYXJzZXIuZ2VuZXJhdGVBcHBsaWNhdGlvbkluZm8ocCwgZmxhZ3MsIHBzLmdldFN0b3BwZWQodXNlcklkKSwKKyAgICAgICAgICAgICAgICAgICAgICAgIHBzLmdldEVuYWJsZWQodXNlcklkKSk7CiAgICAgICAgICAgICB9CiAgICAgICAgICAgICBpZiAoImFuZHJvaWQiLmVxdWFscyhwYWNrYWdlT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hZ3MsIHBzLmdldFN0b3BwZWQodXNlcklkKSwKKyAgICAgICAgICAgICAgICAgICAgICAgIHBzLmdldEVuYWJsZWQodXNlcklkKSwgdXNlcklkKTsKICAgICAgICAgICAgIH0KICAgICAgICAgICAgIGlmIChtUmVzb2x2ZUNvbXBvbmVudE5hbWUuZXF1YWxzKGNvbXBvbmVudCkpIHsKICAgICAgICAgICAgICAgICByZXR1cm4gbVJlc29sdmVBY3Rpdml0eTsKQEAgLTE3OTgsMTIgKzE4MjQsMTYgQEAKIAogICAgIEBPdmVycmlkZQogICAgIHB1YmxpYyBBY3Rpdml0eUluZm8gZ2V0UmVjZWl2ZXJJbmZvKENvbXBvbmVudE5hbWUgY29tcG9uZW50LCBpbnQgZmxhZ3MsIGludCB1c2VySWQpIHsKKyAgICAgICAgaWYgKCFzVXNlck1hbmFnZXIuZXhpc3RzKHVzZXJJZCkpIHJldHVybiBudWxsOwogICAgICAgICBzeW5jaHJvbml6ZWQgKG1QYWNrYWdlcykgewogICAgICAgICAgICAgUGFja2FnZVBhcnNlci5BY3Rpdml0eSBhID0gbVJlY2VpdmVycy5tQWN0aXZpdGllcy5nZXQoY29tcG9uZW50KTsKICAgICAgICAgICAgIGlmIChERUJVR19QQUNLQUdFX0lORk8pIExvZy52KAogICAgICAgICAgICAgICAgIFRBRywgImdldFJlY2VpdmVySW5mbyAiICsgY29tcG9uZW50ICsgIjogIiArIGEpOwogICAgICAgICAgICAgaWYgKGEgIT0gbnVsbCAmJiBtU2V0dGluZ3MuaXNFbmFibGVkTFByKGEuaW5mbywgZmxhZ3MsIHVzZXJJZCkpIHsKLSAgICAgICAgICAgICAgICByZXR1cm4gUGFja2FnZVBhcnNlci5nZW5lcmF0ZUFjdGl2aXR5SW5mbyhhLCBmbGFncywgdXNlcklkKTsKKyAgICAgICAgICAgICAgICBQYWNrYWdlU2V0dGluZyBwcyA9IG1TZXR0aW5ncy5tUGFja2FnZXMuZ2V0KGNvbXBvbmVudC5nZXRQYWNrYWdlTmFtZSgpKTsKKyAgICAgICAgICAgICAgICBpZiAocHMgPT0gbnVsbCkgcmV0dXJuIG51bGw7CisgICAgICAgICAgICAgICAgcmV0dXJuIFBhY2thZ2VQYXJzZXIuZ2VuZXJhdGVBY3Rpdml0eUluZm8oYSwgZmxhZ3MsIHBzLmdldFN0b3BwZWQodXNlcklkKSwKKyAgICAgICAgICAgICAgICAgICAgICAgIHBzLmdldEVuYWJsZWQodXNlcklkKSwgdXNlcklkKTsKICAgICAgICAgICAgIH0KICAgICAgICAgfQogICAgICAgICByZXR1cm4gbnVsbDsKQEAgLTE4MTEsMTIgKzE4NDEsMTYgQEAKIAogICAgIEBPdmVycmlkZQogICAgIHB1YmxpYyBTZXJ2aWNlSW5mbyBnZXRTZXJ2aWNlSW5mbyhDb21wb25lbnROYW1lIGNvbXBvbmVudCwgaW50IGZsYWdzLCBpbnQgdXNlcklkKSB7CisgICAgICAgIGlmICghc1VzZXJNYW5hZ2VyLmV4aXN0cyh1c2VySWQpKSByZXR1cm4gbnVsbDsKICAgICAgICAgc3luY2hyb25pemVkIChtUGFja2FnZXMpIHsKICAgICAgICAgICAgIFBhY2thZ2VQYXJzZXIuU2VydmljZSBzID0gbVNlcnZpY2VzLm1TZXJ2aWNlcy5nZXQoY29tcG9uZW50KTsKICAgICAgICAgICAgIGlmIChERUJVR19QQUNLQUdFX0lORk8pIExvZy52KAogICAgICAgICAgICAgICAgIFRBRywgImdldFNlcnZpY2VJbmZvICIgKyBjb21wb25lbnQgKyAiOiAiICsgcyk7CiAgICAgICAgICAgICBpZiAocyAhPSBudWxsICYmIG1TZXR0aW5ncy5pc0VuYWJsZWRMUHIocy5pbmZvLCBmbGFncywgdXNlcklkKSkgewotICAgICAgICAgICAgICAgIHJldHVybiBQYWNrYWdlUGFyc2VyLmdlbmVyYXRlU2VydmljZUluZm8ocywgZmxhZ3MsIHVzZXJJZCk7CisgICAgICAgICAgICAgICAgUGFja2FnZVNldHRpbmcgcHMgPSBtU2V0dGluZ3MubVBhY2thZ2VzLmdldChjb21wb25lbnQuZ2V0UGFja2FnZU5hbWUoKSk7CisgICAgICAgICAgICAgICAgaWYgKHBzID09IG51bGwpIHJldHVybiBudWxsOworICAgICAgICAgICAgICAgIHJldHVybiBQYWNrYWdlUGFyc2VyLmdlbmVyYXRlU2VydmljZUluZm8ocywgZmxhZ3MsIHBzLmdldFN0b3BwZWQodXNlcklkKSwKKyAgICAgICAgICAgICAgICAgICAgICAgIHBzLmdldEVuYWJsZWQodXNlcklkKSwgdXNlcklkKTsKICAgICAgICAgICAgIH0KICAgICAgICAgfQogICAgICAgICByZXR1cm4gbnVsbDsKQEAgLTE4MjQsMTIgKzE4NTgsMTYgQEAKIAogICAgIEBPdmVycmlkZQogICAgIHB1YmxpYyBQcm92aWRlckluZm8gZ2V0UHJvdmlkZXJJbmZvKENvbXBvbmVudE5hbWUgY29tcG9uZW50LCBpbnQgZmxhZ3MsIGludCB1c2VySWQpIHsKKyAgICAgICAgaWYgKCFzVXNlck1hbmFnZXIuZXhpc3RzKHVzZXJJZCkpIHJldHVybiBudWxsOwogICAgICAgICBzeW5jaHJvbml6ZWQgKG1QYWNrYWdlcykgewogICAgICAgICAgICAgUGFja2FnZVBhcnNlci5Qcm92aWRlciBwID0gbVByb3ZpZGVyc0J5Q29tcG9uZW50LmdldChjb21wb25lbnQpOwogICAgICAgICAgICAgaWYgKERFQlVHX1BBQ0tBR0VfSU5GTykgTG9nLnYoCiAgICAgICAgICAgICAgICAgVEFHLCAiZ2V0UHJvdmlkZXJJbmZvICIgKyBjb21wb25lbnQgKyAiOiAiICsgcCk7CiAgICAgICAgICAgICBpZiAocCAhPSBudWxsICYmIG1TZXR0aW5ncy5pc0VuYWJsZWRMUHIocC5pbmZvLCBmbGFncywgdXNlcklkKSkgewotICAgICAgICAgICAgICAgIHJldHVybiBQYWNrYWdlUGFyc2VyLmdlbmVyYXRlUHJvdmlkZXJJbmZvKHAsIGZsYWdzLCB1c2VySWQpOworICAgICAgICAgICAgICAg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vPiBxdWVyeSwgaW50IHByaW9yaXR5LCBpbnQgdXNlcklkKSB7CisgICAgICAgIGlmICghc1VzZXJNYW5hZ2VyLmV4aXN0cyh1c2VySWQpKSByZXR1cm4gbnVsbDsKICAgICAgICAgLy8gd3JpdGVyCiAgICAgICAgIHN5bmNocm9uaXplZCAobVBhY2thZ2VzKSB7CiAgICAgICAgICAgICBpZiAoaW50ZW50LmdldFNlbGVjdG9yKCkgIT0gbnVsbCkgewpAQCAtMjM4OSw2ICsyNDI5LDcgQEAKICAgICBAT3ZlcnJpZGUKICAgICBwdWJsaWMgTGlzdDxSZXNvbHZlSW5mbz4gcXVlcnlJbnRlbnRBY3Rpdml0aWVzKEludGVudCBpbnRlbnQsCiAgICAgICAgICAgICBTdHJpbmcgcmVzb2x2ZWRUeXBlLCBpbnQgZmxhZ3MsIGludCB1c2VySWQpIHsKKyAgICAgICAgaWYgKCFzVXNlck1hbmFnZXIuZXhpc3RzKHVzZXJJZCkpIHJldHVybiBudWxsOwogICAgICAgICBDb21wb25lbnROYW1lIGNvbXAgPSBpbnRlbnQuZ2V0Q29tcG9uZW50KCk7CiAgICAgICAgIGlmIChjb21wID09IG51bGwpIHsKICAgICAgICAgICAgIGlmIChpbnRlbnQuZ2V0U2VsZWN0b3IoKSAhPSBudWxsKSB7CkBAIC0yNDI3LDYgKzI0NjgsNyBAQAogICAgIHB1YmxpYyBMaXN0PFJlc29sdmVJbmZvPiBxdWVyeUludGVudEFjdGl2aXR5T3B0aW9ucyhDb21wb25lbnROYW1lIGNhbGxlciwKICAgICAgICAgICAgIEludGVudFtdIHNwZWNpZmljcywgU3RyaW5nW10gc3BlY2lmaWNUeXBlcywgSW50ZW50IGludGVudCwKICAgICAgICAgICAgIFN0cmluZyByZXNvbHZlZFR5cGUsIGludCBmbGFncywgaW50IHVzZXJJZCkgeworICAgICAgICBpZiAoIXNVc2VyTWFuYWdlci5leGlzdHModXNlcklkKSkgcmV0dXJuIG51bGw7CiAgICAgICAgIGZpbmFs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gPj0gMSkgewogICAgICAgICAgICAgICAgIC8vIElmIHRoZXJlIGlzIG1vcmUgdGhhbiBvbmUgc2VydmljZSB3aXRoIHRoZSBzYW1lIHByaW9yaXR5LApAQCAtMjY0NSw2ICsyNjg5LDcgQEAKICAgICBAT3ZlcnJpZGUKICAgICBwdWJsaWMgTGlzdDxSZXNvbHZlSW5mbz4gcXVlcnlJbnRlbnRTZXJ2aWNlcyhJbnRlbnQgaW50ZW50LCBTdHJpbmcgcmVzb2x2ZWRUeXBlLCBpbnQgZmxhZ3MsCiAgICAgICAgICAgICBpbnQgdXNlcklkKSB7CisgICAgICAgIGlmICghc1VzZXJNYW5hZ2VyLmV4aXN0cyh1c2VySWQpKSByZXR1cm4gbnVsbDsKICAgICAgICAgQ29tcG9uZW50TmFtZSBjb21wID0gaW50ZW50LmdldENvbXBvbmVudCgpOwogICAgICAgICBpZiAoY29tcCA9PSBudWxsKSB7CiAgICAgICAgICAgICBpZiAoaW50ZW50LmdldFNlbGVjdG9yKCkgIT0gbnVsbCkgewpAQCAtMjcyMyw3ICsyNzY4LDcgQEAKICAgICAgICAgICAgICAgICB9IGVsc2UgewogICAgICAgICAgICAgICAgICAgICBmaW5hbCBQYWNrYWdlUGFyc2VyLlBhY2thZ2UgcCA9IG1QYWNrYWdlcy5nZXQocGFja2FnZU5hbWUpOwogICAgICAgICAgICAgICAgICAgICBpZiAocCAhPSBudWxsKSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICBwaSA9IGdlbmVyYXRlUGFja2FnZUluZm8ocCwgZmxhZ3MpOworICAgICAgICAgICAgICAgICAgICAgICAgcGkgPSBnZW5lcmF0ZVBhY2thZ2VJbmZvKHAsIGZsYWdzLCB1c2VySWQpOwogICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgfQogCkBAIC0yNzQzLDYgKzI3ODgsNyBAQAogICAgIEBPdmVycmlkZQogICAgIHB1YmxpYyBQYXJjZWxlZExpc3RTbGljZTxBcHBsaWNhdGlvbkluZm8+IGdldEluc3RhbGxlZEFwcGxpY2F0aW9ucyhpbnQgZmxhZ3MsCiAgICAgICAgICAgICBTdHJpbmcgbGFzdFJlYWQsIGludCB1c2VySWQpIHsKKyAgICAgICAgaWYgKCFzVXNlck1hbmFnZXIuZXhpc3RzKHVzZXJJZCkpIHJldHVybiBudWxsOwogICAgICAgICBmaW5hbCBQYXJjZWxlZExpc3RTbGljZTxBcHBsaWNhdGlvbkluZm8+IGxpc3QgPSBuZXcgUGFyY2VsZWRMaXN0U2xpY2U8QXBwbGljYXRpb25JbmZvPigpOwogICAgICAgICBmaW5hbCBib29sZWFuIGxpc3RVbmluc3RhbGxlZCA9IChmbGFncyAmIFBhY2thZ2VNYW5hZ2VyLkdFVF9VTklOU1RBTExFRF9QQUNLQUdFUykgIT0gMDsKICAgICAgICAgZmluYWwgU3RyaW5nW10ga2V5czsKQEAgLTI3NjMsMTUgKzI4MDksMTYgQEAKICAgICAgICAgICAgICAgICBmaW5hbCBTdHJpbmcgcGFja2FnZU5hbWUgPSBrZXlzW2krK107CiAKICAgICAgICAgICAgICAgICBBcHBsaWNhdGlvbkluZm8gYWkgPSBudWxsOworICAgICAgICAgICAgICAgIGZpbmFsIFBhY2thZ2VTZXR0aW5nIHBzID0gbVNldHRpbmdzLm1QYWNrYWdlcy5nZXQocGFja2FnZU5hbWUpOwogICAgICAgICAgICAgICAgIGlmIChsaXN0VW5pbnN0YWxsZWQpIHsKLSAgICAgICAgICAgICAgICAgICAgZmluYWwgUGFja2FnZVNldHRpbmcgcHMgPSBtU2V0dGluZ3MubVBhY2thZ2VzLmdldChwYWNrYWdlTmFtZSk7CiAgICAgICAgICAgICAgICAgICAgIGlmIChwcyAhPSBudWxsKSB7CiAgICAgICAgICAgICAgICAgICAgICAgICBhaSA9IGdlbmVyYXRlQXBwbGljYXRpb25JbmZvRnJvbVNldHRpbmdzTFB3KHBzLm5hbWUsIGZsYWdzLCB1c2VySWQpOwogICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgfSBlbHNlIHsKICAgICAgICAgICAgICAgICAgICAgZmluYWwgUGFja2FnZVBhcnNlci5QYWNrYWdlIHAgPSBtUGFja2FnZXMuZ2V0KHBhY2thZ2VOYW1lKTsKLSAgICAgICAgICAgICAgICAgICAgaWYgKHAgIT0gbnVsbCkgewotICAgICAgICAgICAgICAgICAgICAgICAgYWkgPSBQYWNrYWdlUGFyc2VyLmdlbmVyYXRlQXBwbGljYXRpb25JbmZvKHAsIGZsYWdzLCB1c2VySWQpOworICAgICAgICAgICAgICAgICAgICBpZiAocCAhPSBudWxsICYmIHBzICE9IG51bGwpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIGFpID0gUGFja2FnZVBhcnNlci5nZW5lcmF0ZUFwcGxpY2F0aW9uSW5mbyhwLCBmbGFncywgcHMuZ2V0U3RvcHBlZCh1c2VySWQpLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwcy5nZXRFbmFibGVkKHVzZXJJZCksIHVzZXJJZCk7CiAgICAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICB9CiAKQEAgLTI3OTQsMTMgKzI4NDEsMTcgQEAKICAgICAgICAgLy8gcmVhZGVyCiAgICAgICAgIHN5bmNocm9uaXplZCAobVBhY2thZ2VzKSB7CiAgICAgICAgICAgICBmaW5hbCBJdGVyYXRvcjxQYWNrYWdlUGFyc2VyLlBhY2thZ2U+IGkgPSBtUGFja2FnZXMudmFsdWVzKCkuaXRlcmF0b3IoKTsKLSAgICAgICAgICAgIGZpbmFsIGludCB1c2VySWQgPSBVc2VySWQuZ2V0VXNlcklkKEJpbmRlci5nZXRDYWxsaW5nVWlkKCkpOworICAgICAgICAgICAgZmluYWwgaW50IHVzZXJJZCA9IFVzZXJJZC5nZXRDYWxsaW5nVXNlcklkKCk7CiAgICAgICAgICAgICB3aGlsZSAoaS5oYXNOZXh0KCkpIHsKICAgICAgICAgICAgICAgICBmaW5hbCBQYWNrYWdlUGFyc2VyLlBhY2thZ2UgcCA9IGkubmV4dCgpOwogICAgICAgICAgICAgICAgIGlmIChwLmFwcGxpY2F0aW9uSW5mbyAhPSBudWxsCiAgICAgICAgICAgICAgICAgICAgICAgICAmJiAocC5hcHBsaWNhdGlvbkluZm8uZmxhZ3MmQXBwbGljYXRpb25JbmZvLkZMQUdfUEVSU0lTVEVOVCkgIT0gMAogICAgICAgICAgICAgICAgICAgICAgICAgJiYgKCFtU2FmZU1vZGUgfHwgaXNTeXN0ZW1BcHAocCkpKSB7Ci0gICAgICAgICAgICAgICAgICAgIGZpbmFsTGlzdC5hZGQoUGFja2FnZVBhcnNlci5nZW5lcmF0ZUFwcGxpY2F0aW9uSW5mbyhwLCBmbGFncywgdXNlcklkKSk7CisgICAgICAgICAgICAgICAgICAgIFBhY2thZ2VTZXR0aW5nIHBzID0gbVNldHRpbmdzLm1QYWNrYWdlcy5nZXQocC5wYWNrYWdlTmFtZSk7CisgICAgICAgICAgICAgICAgICAgIGZpbmFsTGlzdC5hZGQoUGFja2FnZVBhcnNlci5nZW5lcmF0ZUFwcGxpY2F0aW9uSW5mbyhwLCBmbGFncywKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBwcyAhPSBudWxsID8gcHMuZ2V0U3RvcHBlZCh1c2VySWQpIDogZmFsc2UsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgcHMgIT0gbnVsbCA/IHBzLmdldEVuYWJsZWQodXNlcklkKSA6IENPTVBPTkVOVF9FTkFCTEVEX1NUQVRFX0RFRkFVTFQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgdXNlcklkKSk7CiAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgfQogICAgICAgICB9CkBAIC0yODEwLDE0ICsyODYxLDIxIEBACiAKICAgICBAT3ZlcnJpZGUKICAgICBwdWJsaWMgUHJvdmlkZXJJbmZvIHJlc29sdmVDb250ZW50UHJvdmlkZXIoU3RyaW5nIG5hbWUsIGludCBmbGFncywgaW50IHVzZXJJZCkgeworICAgICAgICBpZiAoIXNVc2VyTWFuYWdlci5leGlzdHModXNlcklkKSkgcmV0dXJuIG51bGw7CiAgICAgICAgIC8vIHJlYWRlcgogICAgICAgICBzeW5jaHJvbml6ZWQgKG1QYWNrYWdlcykgewogICAgICAgICAgICAgZmluYWwgUGFja2FnZVBhcnNlci5Qcm92aWRlciBwcm92aWRlciA9IG1Qcm92aWRlcnMuZ2V0KG5hbWUpOworICAgICAgICAgICAgUGFja2FnZVNldHRpbmcgcHMgPSBwcm92aWRlciAhPSBudWxsCisgICAgICAgICAgICAgICAgICAgID8gbVNldHRpbmdzLm1QYWNrYWdlcy5nZXQocHJvdmlkZXIub3duZXIucGFja2FnZU5hbWUpCisgICAgICAgICAgICAgICAgICAgIDogbnVsbDsKICAgICAgICAgICAgIHJldHVybiBwcm92aWRlciAhPSBudWxsCiAgICAgICAgICAgICAgICAgICAgICYmIG1TZXR0aW5ncy5pc0VuYWJsZWRMUHIocHJvdmlkZXIuaW5mbywgZmxhZ3MsIHVzZXJJZCkKICAgICAgICAgICAgICAgICAgICAgJiYgKCFtU2FmZU1vZGUgfHwgKHByb3ZpZGVyLmluZm8uYXBwbGljYXRpb25JbmZvLmZsYWdzCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJkFwcGxpY2F0aW9uSW5mby5GTEFHX1NZU1RFTSkgIT0gMCkKLSAgICAgICAgICAgICAgICAgICAgPyBQYWNrYWdlUGFyc2VyLmdlbmVyYXRlUHJvdmlkZXJJbmZvKHByb3ZpZGVyLCBmbGFncywgdXNlcklkKQorICAgICAgICAgICAgICAgICAgICA/IFBhY2thZ2VQYXJzZXIuZ2VuZXJhdGVQcm92aWRlckluZm8ocHJvdmlkZXIsIGZsYWdzLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBzICE9IG51bGwgPyBwcy5nZXRTdG9wcGVkKHVzZXJJZCkgOiBmYWxzZSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBwcyAhPSBudWxsID8gcHMuZ2V0RW5hYmxlZCh1c2VySWQpIDogQ09NUE9ORU5UX0VOQUJMRURfU1RBVEVfREVGQVVMVCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB1c2VySWQpCiAgICAgICAgICAgICAgICAgICAgIDogbnVsbDsKICAgICAgICAgfQogICAgIH0KQEAgLTI4MzEsMTYgKzI4ODksMjAgQEAKICAgICAgICAgc3luY2hyb25pemVkIChtUGFja2FnZXMpIHsKICAgICAgICAgICAgIGZpbmFsIEl0ZXJhdG9yPE1hcC5FbnRyeTxTdHJpbmcsIFBhY2thZ2VQYXJzZXIuUHJvdmlkZXI+PiBpID0gbVByb3ZpZGVycy5lbnRyeVNldCgpCiAgICAgICAgICAgICAgICAgICAgIC5pdGVyYXRvcigpOwotICAgICAgICAgICAgZmluYWwgaW50IHVzZXJJZCA9IFVzZXJJZC5nZXRVc2VySWQoQmluZGVyLmdldENhbGxpbmdVaWQoKSk7CisgICAgICAgICAgICBmaW5hbCBpbnQgdXNlcklkID0gVXNlcklkLmdldENhbGxpbmdVc2VySWQoKTsKICAgICAgICAgICAgIHdoaWxlIChpLmhhc05leHQoKSkgewogICAgICAgICAgICAgICAgIE1hcC5FbnRyeTxTdHJpbmcsIFBhY2thZ2VQYXJzZXIuUHJvdmlkZXI+IGVudHJ5ID0gaS5uZXh0KCk7CiAgICAgICAgICAgICAgICAgUGFja2FnZVBhcnNlci5Qcm92aWRlciBwID0gZW50cnkuZ2V0VmFsdWUoKTsKKyAgICAgICAgICAgICAgICBQYWNrYWdlU2V0dGluZyBwcyA9IG1TZXR0aW5ncy5tUGFja2FnZXMuZ2V0KHAub3duZXIucGFja2FnZU5hbWUpOwogCiAgICAgICAgICAgICAgICAgaWYgKHAuc3luY2FibGUKICAgICAgICAgICAgICAgICAgICAgICAgICYmICghbVNhZmVNb2RlIHx8IChwLmluZm8uYXBwbGljYXRpb25JbmZvLmZsYWdzCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICZBcHBsaWNhdGlvbkluZm8uRkxBR19TWVNURU0pICE9IDApKSB7CiAgICAgICAgICAgICAgICAgICAgIG91dE5hbWVzLmFkZChlbnRyeS5nZXRLZXkoKSk7Ci0gICAgICAgICAgICAgICAgICAgIG91dEluZm8uYWRkKFBhY2thZ2VQYXJzZXIuZ2VuZXJhdGVQcm92aWRlckluZm8ocCwgMCwgdXNlcklkKSk7CisgICAgICAgICAgICAgICAgICAgIG91dEluZm8uYWRkKFBhY2thZ2VQYXJzZXIuZ2VuZXJhdGVQcm92aWRlckluZm8ocCwgMCwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBwcyAhPSBudWxsID8gcHMuZ2V0U3RvcHBlZCh1c2VySWQpIDogZmFsc2UsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgcHMgIT0gbnVsbCA/IHBzLmdldEVuYWJsZWQodXNlcklkKSA6IENPTVBPTkVOVF9FTkFCTEVEX1NUQVRFX0RFRkFVTFQsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgdXNlcklkKSk7CiAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgfQogICAgICAgICB9CkBAIC0yODU3LDYgKzI5MTksNyBAQAogICAgICAgICAgICAgICAgICAgICBVc2VySWQuZ2V0VXNlcklkKHVpZCkgOiBVc2VySWQuZ2V0Q2FsbGluZ1VzZXJJZCgpOwogICAgICAgICAgICAgd2hpbGUgKGkuaGFzTmV4dCgpKSB7CiAgICAgICAgICAgICAgICAgZmluYWwgUGFja2FnZVBhcnNlci5Qcm92aWRlciBwID0gaS5uZXh0KCk7CisgICAgICAgICAgICAgICAgUGFja2FnZVNldHRpbmcgcHMgPSBtU2V0dGluZ3MubVBhY2thZ2VzLmdldChwLm93bmVyLnBhY2thZ2VOYW1lKTsKICAgICAgICAgICAgICAgICBpZiAocC5pbmZvLmF1dGhvcml0eSAhPSBudWxsCiAgICAgICAgICAgICAgICAgICAgICAgICAmJiAocHJvY2Vzc05hbWUgPT0gbnVsbAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8fCAocC5pbmZvLnByb2Nlc3NOYW1lLmVxdWFscyhwcm9jZXNzTmFtZSkKQEAgLTI4NjcsNyArMjkzMCwxMCBAQAogICAgICAgICAgICAgICAgICAgICBpZiAoZmluYWxMaXN0ID09IG51bGwpIHsKICAgICAgICAgICAgICAgICAgICAgICAgIGZpbmFsTGlzdCA9IG5ldyBBcnJheUxpc3Q8UHJvdmlkZXJJbmZvPigzKTsKICAgICAgICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgICAgICBmaW5hbExpc3QuYWRkKFBhY2thZ2VQYXJzZXIuZ2VuZXJhdGVQcm92aWRlckluZm8ocCwgZmxhZ3MsIHVzZXJJZCkpOworICAgICAgICAgICAgICAgICAgICBmaW5hbExpc3QuYWRkKFBhY2thZ2VQYXJzZXIuZ2VuZXJhdGVQcm92aWRlckluZm8ocCwgZmxhZ3MsCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgcHMgIT0gbnVsbCA/IHBzLmdldFN0b3BwZWQodXNlcklkKSA6IGZhbHNlLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBzICE9IG51bGwgPyBwcy5nZXRFbmFibGVkKHVzZXJJZCkgOiBDT01QT05FTlRfRU5BQkxFRF9TVEFURV9ERUZBVUxULAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIHVzZXJJZCkpOwogICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgIH0KICAgICAgICAgfQpAQCAtMzUxMSw3ICszNTc3LDcgQEAKICAgICAgICAgICAgICAgICBwa2cuYXBwbGljYXRpb25JbmZvLmZsYWdzIHw9IEFwcGxpY2F0aW9uSW5mby5GTEFHX1VQREFURURfU1lTVEVNX0FQUDsKICAgICAgICAgICAgIH0KIAotICAgICAgICAgICAgcGtnLmFwcGxpY2F0aW9uSW5mby51aWQgPSBwa2dTZXR0aW5nLnVpZDsKKyAgICAgICAgICAgIHBrZy5hcHBsaWNhdGlvbkluZm8udWlkID0gcGtnU2V0dGluZy5hcHBJZDsKICAgICAgICAgICAgIHBrZy5tRXh0cmFzID0gcGtnU2V0dGluZzsKIAogICAgICAgICAgICAgaWYgKCF2ZXJpZnlTaWduYXR1cmVzTFAocGtnU2V0dGluZywgcGtnKSkgewpAQCAtMzYxOCw3ICszNjg0LDcgQEAKICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChyZXQgPj0gMCkgewogICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vIFRPRE86IEtpbGwgdGhlIHByb2Nlc3NlcyBmaXJzdAogICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vIFJlbW92ZSB0aGUgZGF0YSBkaXJlY3RvcmllcyBmb3IgYWxsIHVzZXJzCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgbVVzZXJNYW5hZ2VyLnJlbW92ZVBhY2thZ2VGb3JBbGxVc2Vycyhwa2dOYW1lKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBzVXNlck1hbmFnZXIucmVtb3ZlUGFja2FnZUZvckFsbFVzZXJzKHBrZ05hbWUpOwogICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vIE9sZCBkYXRhIGdvbmUhCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgU3RyaW5nIG1zZyA9ICJTeXN0ZW0gcGFja2FnZSAiICsgcGtnLnBhY2thZ2VOYW1lCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICArICIgaGFzIGNoYW5nZWQgZnJvbSB1aWQ6ICIKQEAgLTM2MzksNyArMzcwNSw3IEBACiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBudWxsOwogICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyBDcmVhdGUgZGF0YSBkaXJlY3RvcmllcyBmb3IgYWxsIHVzZXJzCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgbVVzZXJNYW5hZ2VyLmluc3RhbGxQYWNrYWdlRm9yQWxsVXNlcnMocGtnTmFtZSwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBzVXNlck1hbmFnZXIuaW5zdGFsbFBhY2thZ2VGb3JBbGxVc2Vycyhwa2dOYW1lLAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcGtnLmFwcGxpY2F0aW9uSW5mby51aWQpOwogICAgICAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgICAgICAgICAgaWYgKCFyZWNvdmVyZWQpIHsKQEAgLTM2ODEsNyArMzc0Nyw3IEBACiAgICAgICAgICAgICAgICAgICAgIHJldHVybiBudWxsOwogICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICAvLyBDcmVhdGUgZGF0YSBkaXJlY3RvcmllcyBmb3IgYWxsIHVzZXJzCi0gICAgICAgICAgICAgICAgbVVzZXJNYW5hZ2VyLmluc3RhbGxQYWNrYWdlRm9yQWxsVXNlcnMocGtnTmFtZSwgcGtnLmFwcGxpY2F0aW9uSW5mby51aWQpOworICAgICAgICAgICAgICAgIHNVc2VyTWFuYWdlci5pbnN0YWxsUGFja2FnZUZvckFsbFVzZXJzKHBrZ05hbWUsIHBrZy5hcHBsaWNhdGlvbkluZm8udWlkKTsKIAogICAgICAgICAgICAgICAgIGlmIChkYXRhUGF0aC5leGlzdHMoKSkgewogICAgICAgICAgICAgICAgICAgICBwa2cuYXBwbGljYXRpb25JbmZvLmRhdGFEaXIgPSBkYXRhUGF0aC5nZXRQYXRoKCk7CkBAIC00NTEwLDEyICs0NTc2LDE0IEBACiAgICAgICAgICAgICBleHRlbmRzIEludGVudFJlc29sdmVyPFBhY2thZ2VQYXJzZXIuQWN0aXZpdHlJbnRlbnRJbmZvLCBSZXNvbHZlSW5mbz4gewogICAgICAgICBwdWJsaWMgTGlzdDxSZXNvbHZlSW5mbz4gcXVlcnlJbnRlbnQoSW50ZW50IGludGVudCwgU3RyaW5nIHJlc29sdmVkVHlwZSwKICAgICAgICAgICAgICAgICBib29sZWFuIGRlZmF1bHRPbmx5LCBpbnQgdXNlcklkKSB7CisgICAgICAgICAgICBpZiAoIXNVc2VyTWFuYWdlci5leGlzdHModXNlcklkKSkgcmV0dXJuIG51bGw7CiAgICAgICAgICAgICBtRmxhZ3MgPSBkZWZhdWx0T25seSA/IFBhY2thZ2VNYW5hZ2VyLk1BVENIX0RFRkFVTFRfT05MWSA6IDA7CiAgICAgICAgICAgICByZXR1cm4gc3VwZXIucXVlcnlJbnRlbnQoaW50ZW50LCByZXNvbHZlZFR5cGUsIGRlZmF1bHRPbmx5LCB1c2VySWQpOwogICAgICAgICB9CiAKICAgICAgICAgcHVibGljIExpc3Q8UmVzb2x2ZUluZm8+IHF1ZXJ5SW50ZW50KEludGVudCBpbnRlbnQsIFN0cmluZyByZXNvbHZlZFR5cGUsIGludCBmbGFncywKICAgICAgICAgICAgICAgICBpbnQgdXNlcklkKSB7CisgICAgICAgICAgICBpZiAoIXNVc2VyTWFuYWdlci5leGlzdHModXNlcklkKSkgcmV0dXJuIG51bGw7CiAgICAgICAgICAgICBtRmxhZ3MgPSBmbGFnczsKICAgICAgICAgICAgIHJldHVybiBzdXBlci5xdWVyeUludGVudChpbnRlbnQsIHJlc29sdmVkVHlwZSwKICAgICAgICAgICAgICAgICAgICAgKGZsYWdzICYgUGFja2FnZU1hbmFnZXIuTUFUQ0hfREVGQVVMVF9PTkxZKSAhPSAwLCB1c2VySWQpOwpAQCAtNDUyMyw2ICs0NTkxLDcgQEAKIAogICAgICAgICBwdWJsaWMgTGlzdDxSZXNvbHZlSW5mbz4gcXVlcnlJbnRlbnRGb3JQYWNrYWdlKEludGVudCBpbnRlbnQsIFN0cmluZyByZXNvbHZlZFR5cGUsCiAgICAgICAgICAgICAgICAgaW50IGZsYWdzLCBBcnJheUxpc3Q8UGFja2FnZVBhcnNlci5BY3Rpdml0eT4gcGFja2FnZUFjdGl2aXRpZXMsIGludCB1c2VySWQpIHsKKyAgICAgICAgICAgIGlmICghc1VzZXJNYW5hZ2VyLmV4aXN0cyh1c2VySWQpKSByZXR1cm4gbnVsbDsKICAgICAgICAgICAgIGlmIChwYWNrYWdlQWN0aXZpdGllcyA9PSBudWxsKSB7CiAgICAgICAgICAgICAgICAgcmV0dXJuIG51bGw7CiAgICAgICAgICAgICB9CkBAIC00NjA1LDYgKzQ2NzQsNyBAQAogCiAgICAgICAgIEBPdmVycmlkZQogICAgICAgICBwcm90ZWN0ZWQgYm9vbGVhbiBpc0ZpbHRlclN0b3BwZWQoUGFja2FnZVBhcnNlci5BY3Rpdml0eUludGVudEluZm8gZmlsdGVyLCBpbnQgdXNlcklkKSB7CisgICAgICAgICAgICBpZiAoIXNVc2VyTWFuYWdlci5leGlzdHModXNlcklkKSkgcmV0dXJuIHRydWU7CiAgICAgICAgICAgICBQYWNrYWdlUGFyc2VyLlBhY2thZ2UgcCA9IGZpbHRlci5hY3Rpdml0eS5vd25lcjsKICAgICAgICAgICAgIGlmIChwICE9IG51bGwpIHsKICAgICAgICAgICAgICAgICBQYWNrYWdlU2V0dGluZyBwcyA9IChQYWNrYWdlU2V0dGluZylwLm1FeHRyYXM7CkBAIC00NjI2LDYgKzQ2OTYsNyBAQAogICAgICAgICBAT3ZlcnJpZGUKICAgICAgICAgcHJvdGVjdGVkIFJlc29sdmVJbmZvIG5ld1Jlc3VsdChQYWNrYWdlUGFyc2VyLkFjdGl2aXR5SW50ZW50SW5mbyBpbmZvLAogICAgICAgICAgICAgICAgIGludCBtYXRjaCwgaW50IHVzZXJJZCkgeworICAgICAgICAgICAgaWYgKCFzVXNlck1hbmFnZXIuZXhpc3RzKHVzZXJJZCkpIHJldHVybiBudWxsOwogICAgICAgICAgICAgaWYgKCFtU2V0dGluZ3MuaXNFbmFibGVkTFByKGluZm8uYWN0aXZpdHkuaW5mbywgbUZsYWdzLCB1c2VySWQpKSB7CiAgICAgICAgICAgICAgICAgcmV0dXJuIG51bGw7CiAgICAgICAgICAgICB9CkBAIC00NjM1LDcgKzQ3MDYsMTEgQEAKICAgICAgICAgICAgICAgICByZXR1cm4gbnVsbDsKICAgICAgICAgICAgIH0KICAgICAgICAgICAgIGZpbmFsIFJlc29sdmVJbmZvIHJlcyA9IG5ldyBSZXNvbHZlSW5mbygpOwotICAgICAgICAgICAgcmVzLmFjdGl2aXR5SW5mbyA9IFBhY2thZ2VQYXJzZXIuZ2VuZXJhdGVBY3Rpdml0eUluZm8oYWN0aXZpdHksIG1GbGFncywgdXNlcklkKTsKKyAgICAgICAgICAgIFBhY2thZ2VTZXR0aW5nIHBzID0gKFBhY2thZ2VTZXR0aW5nKSBhY3Rpdml0eS5vd25lci5tRXh0cmFzOworICAgICAgICAgICAgcmVzLmFjdGl2aXR5SW5mbyA9IFBhY2thZ2VQYXJzZXIuZ2VuZXJhdGVBY3Rpdml0eUluZm8oYWN0aXZpdHksIG1GbGFncywKKyAgICAgICAgICAgICAgICAgICAgcHMgIT0gbnVsbCA/IHBzLmdldFN0b3BwZWQodXNlcklkKSA6IGZhbHNlLAorICAgICAgICAgICAgICAgICAgICBwcyAhPSBudWxsID8gcHMuZ2V0RW5hYmxlZCh1c2VySWQpIDogQ09NUE9ORU5UX0VOQUJMRURfU1RBVEVfREVGQVVMVCwKKyAgICAgICAgICAgICAgICAgICAgdXNlcklkKTsKICAgICAgICAgICAgIGlmICgobUZsYWdzJlBhY2thZ2VNYW5hZ2VyLkdFVF9SRVNPTFZFRF9GSUxURVIpICE9IDApIHsKICAgICAgICAgICAgICAgICByZXMuZmlsdGVyID0gaW5mbzsKICAgICAgICAgICAgIH0KQEAgLTQ2OTYsNiArNDc3MSw3IEBACiAKICAgICAgICAgcHVibGljIExpc3Q8UmVzb2x2ZUluZm8+IHF1ZXJ5SW50ZW50KEludGVudCBpbnRlbnQsIFN0cmluZyByZXNvbHZlZFR5cGUsIGludCBmbGFncywKICAgICAgICAgICAgICAgICBpbnQgdXNlcklkKSB7CisgICAgICAgICAgICBpZiAoIXNVc2VyTWFuYWdlci5leGlzdHModXNlcklkKSkgcmV0dXJuIG51bGw7CiAgICAgICAgICAgICBtRmxhZ3MgPSBmbGFnczsKICAgICAgICAgICAgIHJldHVybiBzdXBlci5xdWVyeUludGVudChpbnRlbnQsIHJlc29sdmVkVHlwZSwKICAgICAgICAgICAgICAgICAgICAgKGZsYWdzICYgUGFja2FnZU1hbmFnZXIuTUFUQ0hfREVGQVVMVF9PTkxZKSAhPSAwLCB1c2VySWQpOwpAQCAtNDcwMyw2ICs0Nzc5LDcgQEAKIAogICAgICAgICBwdWJsaWMgTGlzdDxSZXNvbHZlSW5mbz4gcXVlcnlJbnRlbnRGb3JQYWNrYWdlKEludGVudCBpbnRlbnQsIFN0cmluZyByZXNvbHZlZFR5cGUsCiAgICAgICAgICAgICAgICAgaW50IGZsYWdzLCBBcnJheUxpc3Q8UGFja2FnZVBhcnNlci5TZXJ2aWNlPiBwYWNrYWdlU2VydmljZXMsIGludCB1c2VySWQpIHsKKyAgICAgICAgICAgIGlmICghc1VzZXJNYW5hZ2VyLmV4aXN0cyh1c2VySWQpKSByZXR1cm4gbnVsbDsKICAgICAgICAgICAgIGlmIChwYWNrYWdlU2VydmljZXMgPT0gbnVsbCkgewogICAgICAgICAgICAgICAgIHJldHVybiBudWxsOwogICAgICAgICAgICAgfQpAQCAtNDc4MCw2ICs0ODU3LDcgQEAKIAogICAgICAgICBAT3ZlcnJpZGUKICAgICAgICAgcHJvdGVjdGVkIGJvb2xlYW4gaXNGaWx0ZXJTdG9wcGVkKFBhY2thZ2VQYXJzZXIuU2VydmljZUludGVudEluZm8gZmlsdGVyLCBpbnQgdXNlcklkKSB7CisgICAgICAgICAgICBpZiAoIXNVc2VyTWFuYWdlci5leGlzdHModXNlcklkKSkgcmV0dXJuIHRydWU7CiAgICAgICAgICAgICBQYWNrYWdlUGFyc2VyLlBhY2thZ2UgcCA9IGZpbHRlci5zZXJ2aWNlLm93bmVyOwogICAgICAgICAgICAgaWYgKHAgIT0gbnVsbCkgewogICAgICAgICAgICAgICAgIFBhY2thZ2VTZXR0aW5nIHBzID0gKFBhY2thZ2VTZXR0aW5nKXAubUV4dHJhczsKQEAgLTQ4MDIsNiArNDg4MCw3IEBACiAgICAgICAgIEBPdmVycmlkZQogICAgICAgICBwcm90ZWN0ZWQgUmVzb2x2ZUluZm8gbmV3UmVzdWx0KFBhY2thZ2VQYXJzZXIuU2VydmljZUludGVudEluZm8gZmlsdGVyLAogICAgICAgICAgICAgICAgIGludCBtYXRjaCwgaW50IHVzZXJJZCkgeworICAgICAgICAgICAgaWYgKCFzVXNlck1hbmFnZXIuZXhpc3RzKHVzZXJJZCkpIHJldHVybiBudWxsOwogICAgICAgICAgICAgZmluYWwgUGFja2FnZVBhcnNlci5TZXJ2aWNlSW50ZW50SW5mbyBpbmZvID0gKFBhY2thZ2VQYXJzZXIuU2VydmljZUludGVudEluZm8pZmlsdGVyOwogICAgICAgICAgICAgaWYgKCFtU2V0dGluZ3MuaXNFbmFibGVkTFByKGluZm8uc2VydmljZS5pbmZvLCBtRmxhZ3MsIHVzZXJJZCkpIHsKICAgICAgICAgICAgICAgICByZXR1cm4gbnVsbDsKQEAgLTQ4MTIsNyArNDg5MSwxMSBAQAogICAgICAgICAgICAgICAgIHJldHVybiBudWxsOwogICAgICAgICAgICAgfQogICAgICAgICAgICAgZmluYWwgUmVzb2x2ZUluZm8gcmVzID0gbmV3IFJlc29sdmVJbmZvKCk7Ci0gICAgICAgICAgICByZXMuc2VydmljZUluZm8gPSBQYWNrYWdlUGFyc2VyLmdlbmVyYXRlU2VydmljZUluZm8oc2VydmljZSwgbUZsYWdzLCB1c2VySWQpOworICAgICAgICAgICAgUGFja2FnZVNldHRpbmcgcHMgPSAoUGFja2FnZVNldHRpbmcpIHNlcnZpY2Uub3duZXIubUV4dHJhczsKKyAgICAgICAgICAgIHJlcy5zZXJ2aWNlSW5mbyA9IFBhY2thZ2VQYXJzZXIuZ2VuZXJhdGVTZXJ2aWNlSW5mbyhzZXJ2aWNlLCBtRmxhZ3MsCisgICAgICAgICAgICAgICAgICAgI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mIChleHRyYXMgIT0gbnVsbCkgewotICAgICAgICAgICAgICAgICAgICBpbnRlbnQucHV0RXh0cmFzKGV4dHJhcyk7CisgICAgICAgICAgICAgICAgaW50W10gdXNlcklkcyA9IHVzZXJJZCA9PSBVc2VySWQuVVNFUl9BTEwKKyAgICAgICAgICAgICAgICAgICAgICAgID8gc1VzZXJNYW5hZ2VyLmdldFVzZXJJZHMoKSAKKyAgICAgICAgICAgICAgICAgICAgICAgIDogbmV3IGludFtdIHt1c2VySWR9OworICAgICAgICAgICAgICAgIGZvciAoaW50IGlkIDogdXNlcklkcykgeworICAgICAgICAgICAgICAgICAgICBmaW5hbCBJbnRlbnQgaW50ZW50ID0gbmV3IEludGVudChhY3Rpb24sCisgICAgICAgICAgICAgICAgICAgICAgICAgICAgcGtnICE9IG51bGwgPyBVcmkuZnJvbVBhcnRzKCJwYWNrYWdlIiwgcGtnLCBudWxsKSA6IG51bGwpOworICAgICAgICAgICAgICAgICAgICBpZiAoZXh0cmFzICE9IG51bGwpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIGludGVudC5wdXRFeHRyYXMoZXh0cmFzKTsKKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICBpZiAodGFyZ2V0UGtnICE9IG51bGwpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIGludGVudC5zZXRQYWNrYWdlKHRhcmdldFBrZyk7CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgLy8gTW9kaWZ5IHRoZSBVSUQgd2hlbiBwb3N0aW5nIHRvIG90aGVyIHVzZXJzCisgICAgICAgICAgICAgICAgICAgIGludCB1aWQgPSBpbnRlbnQuZ2V0SW50RXh0cmEoSW50ZW50LkVYVFJBX1VJRCwgLTEpOworICAgICAgICAgICAgICAgICAgICBpZiAodWlkID4gMCAmJiBpZCA+IDApIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIHVpZCA9IFVzZXJJZC5nZXRVaWQoaWQsIFVzZXJJZC5nZXRBcHBJZCh1aWQpKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIGludGVudC5wdXRFeHRyYShJbnRlbnQuRVhUUkFfVUlELCB1aWQpOworICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICAgIGludGVudC5hZGRGbGFncyhJbnRlbnQuRkxBR19SRUNFSVZFUl9SRUdJU1RFUkVEX09OTFlfQkVGT1JFX0JPT1QpOworICAgICAgICAgICAgICAgICAgICBhbS5icm9hZGNhc3RJbnRlbnQobnVsbCwgaW50ZW50LCBudWxsLCBmaW5pc2hlZFJlY2VpdmVyLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgIDAsIG51bGwsIG51bGwsIG51bGwsIGZpbmlzaGVkUmVjZWl2ZXIgIT0gbnVsbCwgZmFsc2UsIGlkKTsKICAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgaWYgKHRhcmdldFBrZyAhPSBudWxsKSB7Ci0gICAgICAgICAgICAgICAgICAgIGludGVudC5zZXRQYWNrYWdlKHRhcmdldFBrZyk7Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgIGludGVudC5hZGRGbGFncyhJbnRlbnQuRkxBR19SRUNFSVZFUl9SRUdJU1RFUkVEX09OTFlfQkVGT1JFX0JPT1QpOwotICAgICAgICAgICAgICAgIC8vIFRPRE86IEZpeCB0aGUgdXNlcklkIGFyZ3VtZW50Ci0gICAgICAgICAgICAgICAgYW0uYnJvYWRjYXN0SW50ZW50KG51bGwsIGludGVudCwgbnVsbCwgZmluaXNoZWRSZWNlaXZlciwKLSAgICAgICAgICAgICAgICAgICAgICAgIDAsIG51bGwsIG51bGwsIG51bGwsIGZpbmlzaGVkUmVjZWl2ZXIgIT0gbnVsbCwgZmFsc2UsCi0gICAgICAgICAgICAgICAgICAgICAgICBCaW5kZXIuZ2V0T3JpZ0NhbGxpbmdVc2VyKCkpOwogICAgICAgICAgICAgfSBjYXRjaCAoUmVtb3RlRXhjZXB0aW9uIGV4KSB7CiAgICAgICAgICAgICB9CiAgICAgICAgIH0KQEAgLTUwNjIsMTMgKzUxNTQsMTMgQEAKICAgICAgICAgICAgICAgICBleHRyYXMucHV0SW50KEludGVudC5FWFRSQV9VSUQsIHJlbW92ZWRVaWQpOwogICAgICAgICAgICAgICAgIGV4dHJhcy5wdXRCb29sZWFuKEludGVudC5FWFRSQV9EQVRBX1JFTU9WRUQsIGZhbHNlKTsKICAgICAgICAgICAgICAgICBzZW5kUGFja2FnZUJyb2FkY2FzdChJbnRlbnQuQUNUSU9OX1BBQ0tBR0VfUkVNT1ZFRCwgcmVtb3ZlZFBhY2thZ2UsCi0gICAgICAgICAgICAgICAgICAgICAgICBleHRyYXMsIG51bGwsIG51bGwpOworICAgICAgICAgICAgICAgICAgICAgICAgZXh0cmFzLCBudWxsLCBudWxsLCBVc2VySWQuVVNFUl9BTEwpOwogICAgICAgICAgICAgfQogICAgICAgICAgICAgaWYgKGFkZGVkUGFja2FnZSAhPSBudWxsKSB7CiAgICAgICAgICAgICAgICAgQnVuZGxlIGV4dHJhcyA9IG5ldyBCdW5kbGUoMSk7CiAgICAgICAgICAgICAgICAgZXh0cmFzLnB1dEludChJbnRlbnQuRVhUUkFfVUlELCBhZGRlZFVpZCk7CiAgICAgICAgICAgICAgICAgc2VuZFBhY2thZ2VCcm9hZGNhc3QoSW50ZW50LkFDVElPTl9QQUNLQUdFX0FEREVELCBhZGRlZFBhY2thZ2UsCi0gICAgICAgICAgICAgICAgICAgICAgICBleHRyYXMsIG51bGwsIG51bGwpOworICAgICAgICAgICAgICAgICAgICAgICAgZXh0cmFzLCBudWxsLCBudWxsLCBVc2VySWQuVVNFUl9BTEwpOwogICAgICAgICAgICAgfQogICAgICAgICB9CiAKQEAgLTcwOTIsMTEgKzcxODQsMTEgQEAKICAgICAgICAgICAgICAgICBleHRyYXMucHV0Qm9vbGVhbihJbnRlbnQuRVhUUkFfUkVQTEFDSU5HLCB0cnVlKTsKIAogICAgICAgICAgICAgICAgIHNlbmRQYWNrYWdlQnJvYWRjYXN0KEludGVudC5BQ1RJT05fUEFDS0FHRV9BRERFRCwgcGFja2FnZU5hbWUsCi0gICAgICAgICAgICAgICAgICAgICAgICBleHRyYXMsIG51bGwsIG51bGwpOworICAgICAgICAgICAgICAgICAgICAgICAgZXh0cmFzLCBudWxsLCBudWxsLCBVc2VySWQuVVNFUl9BTEwpOwogICAgICAgICAgICAgICAgIHNlbmRQYWNrYWdlQnJvYWRjYXN0KEludGVudC5BQ1RJT05fUEFDS0FHRV9SRVBMQUNFRCwgcGFja2FnZU5hbWUsCi0gICAgICAgICAgICAgICAgICAgICAgICBleHRyYXMsIG51bGwsIG51bGwpOworICAgICAgICAgICAgICAgICAgICAgICAgZXh0cmFzLCBudWxsLCBudWxsLCBVc2VySWQuVVNFUl9BTEwpOwogICAgICAgICAgICAgICAgIHNlbmRQYWNrYWdlQnJvYWRjYXN0KEludGVudC5BQ1RJT05fTVlfUEFDS0FHRV9SRVBMQUNFRCwgbnVsbCwKLSAgICAgICAgICAgICAgICAgICAgICAgIG51bGwsIHBhY2thZ2VOYW1lLCBudWxsKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIG51bGwsIHBhY2thZ2VOYW1lLCBudWxsLCBVc2VySWQuVVNFUl9BTEwpOwogICAgICAgICAgICAgfQogICAgICAgICB9CiAgICAgICAgIC8vIEZvcmNlIGEgZ2MgaGVyZS4KQEAgLTcxMjksMTQgKzcyMjEsMTUgQEAKICAgICAgICAgICAgIH0KICAgICAgICAgICAgIGlmIChyZW1vdmVkUGFja2FnZSAhPSBudWxsKSB7CiAgICAgICAgICAgICAgICAgc2VuZFBhY2thZ2VCcm9hZGNhc3QoSW50ZW50LkFDVElPTl9QQUNLQUdFX1JFTU9WRUQsIHJlbW92ZWRQYWNrYWdlLAotICAgICAgICAgICAgICAgICAgICAgICAgZXh0cmFzLCBudWxsLCBudWxsKTsKKyAgICAgICAgICAgICAgICAgICAgICAgIGV4dHJhcywgbnVsbCwgbnVsbCwgVXNlcklkLlVTRVJfQUxMKTsKICAgICAgICAgICAgICAgICBpZiAoZnVsbFJlbW92ZSAmJiAhcmVwbGFjaW5nKSB7CiAgICAgICAgICAgICAgICAgICAgIHNlbmRQYWNrYWdlQnJvYWRjYXN0KEludGVudC5BQ1RJT05fUEFDS0FHRV9GVUxMWV9SRU1PVkVELCByZW1vdmVkUGFja2FnZSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBleHRyYXMsIG51bGwsIG51bGwpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIGV4dHJhcywgbnVsbCwgbnVsbCwgVXNlcklkLlVTRVJfQUxMKTsKICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICB9CiAgICAgICAgICAgICBpZiAocmVtb3ZlZFVpZCA+PSAwKSB7Ci0gICAgICAgICAgICAgICAgc2VuZFBhY2thZ2VCcm9hZGNhc3QoSW50ZW50LkFDVElPTl9VSURfUkVNT1ZFRCwgbnVsbCwgZXh0cmFzLCBudWxsLCBudWxsKTsKKyAgICAgICAgICAgICAgICBzZW5kUGFja2FnZUJyb2FkY2FzdChJbnRlbnQuQUNUSU9OX1VJRF9SRU1PVkVELCBudWxsLCBleHRyYXMsIG51bGwsIG51bGwsCisgICAgICAgICAgICAgICAgICAgICAgICBVc2VySWQuZ2V0VXNlcklkKHJlbW92ZWRVaWQpKTsKICAgICAgICAgICAgIH0KICAgICAgICAgfQogICAgIH0KQEAgLTcxNjgsNyArNzI2MSw3IEBACiAgICAgICAgICAgICAgICAgLy8gd2UgZG9uJ3QgY29uc2lkZXIgdGhpcyB0byBiZSBhIGZhaWx1cmUgb2YgdGhlIGNvcmUgcGFja2FnZSBkZWxldGlvbgogICAgICAgICAgICAgfSBlbHNlIHsKICAgICAgICAgICAgICAgICAvLyBUT0RPOiBLaWxsIHRoZSBwcm9jZXNzZXMgZmlyc3QKLSAgICAgICAgICAgICAgICBtVXNlck1hbmFnZXIucmVtb3ZlUGFja2FnZUZvckFsbFVzZXJzKHBhY2thZ2VOYW1lKTsKKyAgICAgICAgICAgICAgICBzVXNlck1hbmFnZXIucmVtb3ZlUGFja2FnZUZvckFsbFVzZXJzKHBhY2thZ2VOYW1lKTsKICAgICAgICAgICAgIH0KICAgICAgICAgICAgIHNjaGVkdWxlUGFja2FnZUNsZWFuaW5nKHBhY2thZ2VOYW1lKTsKICAgICAgICAgfQpAQCAtNzczMiwxMiArNzgyNSwxNCBAQAogICAgIEBPdmVycmlkZQogICAgIHB1YmxpYyB2b2lkIHNldEFwcGxpY2F0aW9uRW5hYmxlZFNldHRpbmcoU3RyaW5nIGFwcFBhY2thZ2VOYW1lLAogICAgICAgICAgICAgaW50IG5ld1N0YXRlLCBpbnQgZmxhZ3MsIGludCB1c2VySWQpIHsKKyAgICAgICAgaWYgKCFzVXNlck1hbmFnZXIuZXhpc3RzKHVzZXJJZCkpIHJldHVybjsKICAgICAgICAgc2V0RW5hYmxlZFNldHRpbmcoYXBwUGFja2FnZU5hbWUsIG51bGwsIG5ld1N0YXRlLCBmbGFncywgdXNlcklkKTsKICAgICB9CiAKICAgICBAT3ZlcnJpZGUKICAgICBwdWJsaWMgdm9pZCBzZXRDb21wb25lbnRFbmFibGVkU2V0dGluZyhDb21wb25lbnROYW1lIGNvbXBvbmVudE5hbWUsCiAgICAgICAgICAgICBpbnQgbmV3U3RhdGUsIGludCBmbGFncywgaW50IHVzZXJJZCkgeworICAgICAgICBpZiAoIXNVc2VyTWFuYWdlci5leGlzdHModXNlcklkKSkgcmV0dXJuOwogICAgICAgICBzZXRFbmFibGVkU2V0dGluZyhjb21wb25lbnROYW1lLmdldFBhY2thZ2VOYW1lKCksCiAgICAgICAgICAgICAgICAgY29tcG9uZW50TmFtZS5nZXRDbGFzc05hbWUoKSwgbmV3U3RhdGUsIGZsYWdzLCB1c2VySWQpOwogICAgIH0KQEAgLTc3NzYsMTEgKzc4NzEsMTEgQEAKICAgICAgICAgICAgICAgICAgICAgICAgICsgIi8iICsgY2xhc3NOYW1lKTsKICAgICAgICAgICAgIH0KICAgICAgICAgICAgIC8vIEFsbG93IHJvb3QgYW5kIHZlcmlmeSB0aGF0IHVzZXJJZCBpcyBub3QgYmVpbmcgc3BlY2lmaWVkIGJ5IGEgZGlmZmVyZW50IHVzZXIKLSAgICAgICAgICAgIGlmICghYWxsb3dlZEJ5UGVybWlzc2lvbiAmJiAhVXNlcklkLmlzU2FtZUFwcCh1aWQsIHBrZ1NldHRpbmcudWlkKSkgeworICAgICAgICAgICAgaWYgKCFhbGxvd2VkQnlQZXJtaXNzaW9uICYmICFVc2VySWQuaXNTYW1lQXBwKHVpZCwgcGtnU2V0dGluZy5hcHBJZCkpIHsKICAgICAgICAgICAgICAgICB0aHJvdyBuZXcgU2VjdXJpdHlFeGNlcHRpb24oCiAgICAgICAgICAgICAgICAgICAgICAgICAiUGVybWlzc2lvbiBEZW5pYWw6IGF0dGVtcHQgdG8gY2hhbmdlIGNvbXBvbmVudCBzdGF0ZSBmcm9tIHBpZD0iCiAgICAgICAgICAgICAgICAgICAgICAgICArIEJpbmRlci5nZXRDYWxsaW5nUGlkKCkKLSAgICAgICAgICAgICAgICAgICAgICAgICsgIiwgdWlkPSIgKyB1aWQgKyAiLCBwYWNrYWdlIHVpZD0iICsgcGtnU2V0dGluZy51aWQpOworICAgICAgICAgICAgICAgICAgICAgICAgKyAiLCB1aWQ9IiArIHVpZCArICIsIHBhY2thZ2UgdWlkPSIgKyBwa2dTZXR0aW5nLmFwcElkKTsKICAgICAgICAgICAgIH0KICAgICAgICAgICAgIGlmIChjbGFzc05hbWUgPT0gbnVsbCkgewogICAgICAgICAgICAgICAgIC8vIFdlJ3JlIGRlYWxpbmcgd2l0aCBhbiBhcHBsaWNhdGlvbi9wYWNrYWdlIGxldmVsIHN0YXRlIGNoYW5nZQpAQCAtNzc4OSw3ICs3ODg0LDcgQEAKICAgICAgICAgICAgICAgICAgICAgcmV0dXJuOwogICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICBwa2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pKSByZXR1cm4gQ09NUE9ORU5UX0VOQUJMRURfU1RBVEVfRElTQUJMRUQ7CiAgICAgICAgIGludCB1aWQgPSBCaW5kZXIuZ2V0Q2FsbGluZ1VpZCgpOwogICAgICAgICBjaGVja1ZhbGlkQ2FsbGVyKHVpZCwgdXNlcklkKTsKICAgICAgICAgLy8gcmVhZGVyCkBAIC03OTEwLDYgKzgwMDgsNyBAQAogCiAgICAgQE92ZXJyaWRlCiAgICAgcHVibGljIGludCBnZXRDb21wb25lbnRFbmFibGVkU2V0dGluZyhDb21wb25lbnROYW1lIGNvbXBvbmVudE5hbWUsIGludCB1c2VySWQpIHsKKyAgICAgICAgaWYgKCFzVXNlck1hbmFnZXIuZXhpc3RzKHVzZXJJZCkpIHJldHVybiBDT01QT05FTlRfRU5BQkxFRF9TVEFURV9ESVNBQkxFRDsKICAgICAgICAgaW50IHVpZCA9IEJpbmRlci5nZXRDYWxsaW5nVWlkKCk7CiAgICAgICAgIGNoZWNrVmFsaWRDYWxsZXIodWlkLCB1c2VySWQpOwogICAgICAgICAvLyByZWFkZXIKQEAgLTgzODMsNyArODQ4Miw3IEBACiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICArICIgYXQgY29kZSBwYXRoOiAiICsgcHMuY29kZVBhdGhTdHJpbmcpOwogICAgICAgICAgICAgICAgICAgICAgICAgLy8gV2UgZG8gaGF2ZSBhIHZhbGlkIHBhY2thZ2UgaW5zdGFsbGVkIG9uIHNkY2FyZAogICAgICAgICAgICAgICAgICAgICAgICAgcHJvY2Vzc0NpZHMucHV0KGFyZ3MsIHBzLmNvZGVQYXRoU3RyaW5nKTsKLSAgICAgICAgICAgICAgICAgICAgICAgIGludCB1aWQgPSBwcy51aWQ7CisgICAgICAgICAgICAgICAgICAgICAgICBpbnQgdWlkID0gcHMuYXBwSWQ7CiAgICAgICAgICAgICAgICAgICAgICAgICBpZiAodWlkICE9IC0xKSB7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdWlk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sbCkgeworICAgICAgICAgICAgSW50ZW50IGFkZGVkSW50ZW50ID0gbmV3IEludGVudChJbnRlbnQuQUNUSU9OX1VTRVJfQURERUQpOworICAgICAgICAgICAgYWRkZWRJbnRlbnQucHV0RXh0cmEoSW50ZW50LkVYVFJBX1VTRVJJRCwgdXNlckluZm8uaWQpOworICAgICAgICAgICAgbUNvbnRleHQuc2VuZEJyb2FkY2FzdChhZGRlZEludGVudCwgYW5kcm9pZC5NYW5pZmVzdC5wZXJtaXNzaW9uLk1BTkFHRV9BQ0NPVU5UUyk7CisgICAgICAgIH0KICAgICAgICAgcmV0dXJuIHVzZXJJbmZvOwogICAgIH0KIApAQCAtODg2OSwxMyArODk3MiwzNCBAQAogICAgICAgICAvLyBUT0RPKGtyb290KTogQWRkIGEgcmVhbCBwZXJtaXNzaW9uIGZvciByZW1vdmluZyB1c2VycwogICAgICAgICBlbmZvcmNlU3lzdGVtT3JSb290KCJPbmx5IHRoZSBzeXN0ZW0gY2FuIHJlbW92ZSB1c2VycyIpOwogCi0gICAgICAgIGlmICh1c2VySWQgPT0gMCkgeworICAgICAgICBpZiAodXNlcklkID09IDAgfHwgIXNVc2VyTWFuYWdlci5leGlzdHModXNlcklkKSkgewogICAgICAgICAgICAgcmV0dXJuIGZhbHNlOwogICAgICAgICB9Ci0gICAgICAgIG1Vc2VyTWFuYWdlci5yZW1vdmVVc2VyKHVzZXJJZCk7CisKKyAgICAgICAgY2xlYW5VcFVzZXIodXNlcklkKTsKKworICAgICAgICBpZiAoc1VzZXJNYW5hZ2VyLnJlbW92ZVVzZXIodXNlcklkKSkgeworICAgICAgICAgICAgLy8gTGV0IG90aGVyIHNlcnZpY2VzIHNodXRkb3duIGFueSBhY3Rpdml0eQorICAgICAgICAgICAgSW50ZW50IGFkZGVkSW50ZW50ID0gbmV3IEludGVudChJbnRlbnQuQUNUSU9OX1VTRVJfUkVNT1ZFRCk7CisgICAgICAgICAgICBhZGRlZEludGVudC5wdXRFeHRyYShJbnRlbnQuRVhUUkFfVVNFUklELCB1c2VySWQpOworICAgICAgICAgICAgbUNvbnRleHQuc2VuZEJyb2FkY2FzdChhZGRlZEludGVudCwgYW5kcm9pZC5NYW5pZmVzdC5wZXJtaXNzaW9uLk1BTkFHRV9BQ0NPVU5UUyk7CisgICAgICAgIH0KKyAgICAgICAgc1VzZXJNYW5hZ2VyLnJlbW92ZVBhY2thZ2VGb2xkZXJzKHVzZXJJZCk7CiAgICAgICAgIHJldHVybiB0cnVlOwogICAgIH0KIAorICAgIHByaXZhdGUgdm9pZCBjbGVhblVwVXNlcihpbnQgdXNlcklkKSB7CisgICAgICAgIC8vIERpc2FibGUgYWxsIHRoZSBwYWNrYWdlcyBmb3IgdGhlIHVzZXIgZmlyc3QKKyAgICAgICAgc3luY2hyb25pemVkIChtUGFja2FnZXMpIHsKKyAgICAgICAgICAgIFNldDxFbnRyeTxTdHJpbmcsIFBhY2thZ2VTZXR0aW5nPj4gZW50cmllcyA9IG1TZXR0aW5ncy5tUGFja2FnZXMuZW50cnlTZXQoKTsKKyAgICAgICAgICAgIGZvciAoRW50cnk8U3RyaW5nLCBQYWNrYWdlU2V0dGluZz4gZW50cnkgOiBlbnRyaWVzKSB7CisgICAgICAgICAgICAgICAgZW50cnkuZ2V0VmFsdWUoKS5yZW1vdmVVc2VyKHVzZXJJZCk7CisgICAgICAgICAgICB9CisgICAgICAgICAgICBpZiAobURpcnR5VXNlcnMucmVtb3ZlKHVzZXJJZCkpOworICAgICAgICAgICAgbVNldHRpbmdzLnJlbW92ZVVzZXJMUHIodXNlcklkKTsKKyAgICAgICAgfQorICAgIH0KKwogICAgIEBPdmVycmlkZQogICAgIHB1YmxpYyBWZXJpZmllckRldmljZUlkZW50aXR5IGdldFZlcmlmaWVyRGV2aWNlSWRlbnRpdHkoKSB0aHJvd3MgUmVtb3RlRXhjZXB0aW9uIHsKICAgICAgICAgbUNvbnRleHQuZW5mb3JjZUNhbGxpbmdPclNlbGZQZXJtaXNzaW9uKApAQCAtODg4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IC0yOTMsNyArMjkzLDcgQEAKICAgICAgICAgfQogICAgICAgICBwID0gbmV3IFBhY2thZ2VTZXR0aW5nKG5hbWUsIHJlYWxOYW1lLCBjb2RlUGF0aCwgcmVzb3VyY2VQYXRoLCBuYXRpdmVMaWJyYXJ5UGF0aFN0cmluZywKICAgICAgICAgICAgICAgICB2YywgcGtnRmxhZ3MpOwotICAgICAgICBwLnVpZCA9IHVpZDsKKyAgICAgICAgcC5hcHBJZCA9IHVpZDsKICAgICAgICAgaWYgKGFkZFVzZXJJZExQdyh1aWQsIHAsIG5hbWUpKSB7CiAgICAgICAgICAgICBtUGFja2FnZXMucHV0KG5hbWUsIHApOwogICAgICAgICAgICAgcmV0dXJuIHA7CkBAIC00MDcsNyArNDA3LDcgQEAKICAgICAgICAgICAgICAgICBwLmNvcHlGcm9tKG9yaWdQYWNrYWdlKTsKICAgICAgICAgICAgICAgICBwLnNpZ25hdHVyZXMgPSBzOwogICAgICAgICAgICAgICAgIHAuc2hhcmVkVXNlciA9IG9yaWdQYWNrYWdlLnNoYXJlZFVzZXI7Ci0gICAgICAgICAgICAgICAgcC51aWQgPSBvcmlnUGFja2FnZS51aWQ7CisgICAgICAgICAgICAgICAgcC5hcHBJZCA9IG9yaWdQYWNrYWdlLmFwcElkOwogICAgICAgICAgICAgICAgIHAub3JpZ1BhY2thZ2UgPSBvcmlnUGFja2FnZTsKICAgICAgICAgICAgICAgICBtUmVuYW1lZFBhY2thZ2VzLnB1dChuYW1lLCBvcmlnUGFja2FnZS5uYW1lKTsKICAgICAgICAgICAgICAgICBuYW1lID0gb3JpZ1BhY2thZ2UubmFtZTsKQEAgLTQzNSw3ICs0MzUsNyBAQAogICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgIGlmIChzaGFyZWRVc2VyICE9IG51bGwpIHsKLSAgICAgICAgICAgICAgICAgICAgcC51aWQgPSBzaGFyZWRVc2VyLnVzZXJJZDsKKyAgICAgICAgICAgICAgICAgICAgcC5hcHBJZCA9IHNoYXJlZFVzZXIudXNlcklkOwogICAgICAgICAgICAgICAgIH0gZWxzZSB7CiAgICAgICAgICAgICAgICAgICAgIC8vIENsb25lIHRoZSBzZXR0aW5nIGhlcmUgZm9yIGRpc2FibGVkIHN5c3RlbSBwYWNrYWdlcwogICAgICAgICAgICAgICAgICAgICBQYWNrYWdlU2V0dGluZyBkaXMgPSBtRGlzYWJsZWRTeXNQYWNrYWdlcy5nZXQobmFtZSk7CkBAIC00NDcsNyArNDQ3LDcgQEAKICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChkaXMuc2lnbmF0dXJlcy5tU2lnbmF0dXJlcyAhPSBudWxsKSB7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcC5zaWduYXR1cmVzLm1TaWduYXR1cmVzID0gZGlzLnNpZ25hdHVyZXMubVNpZ25hdHVyZXMuY2xvbmUoKTsKICAgICAgICAgICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICAgICAgICAgIHAudWlkID0gZGlzLnVpZDsKKyAgICAgICAgICAgICAgICAgICAgICAgIHAuYXBwSWQgPSBkaXMuYXBwSWQ7CiAgICAgICAgICAgICAgICAgICAgICAgICAvLyBDbG9uZSBwZXJtaXNzaW9ucwogICAgICAgICAgICAgICAgICAgICAgICAgcC5ncmFudGVkUGVybWlzc2lvbnMgPSBuZXcgSGFzaFNldDxTdHJpbmc+KGRpcy5ncmFudGVkUGVybWlzc2lvbnMpOwogICAgICAgICAgICAgICAgICAgICAgICAgLy8gQ2xvbmUgY29tcG9uZW50IGluZm8KQEAgLTQ2NCwxNCArNDY0LDE0IEBACiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgICAgICAgICAgLy8gQWRkIG5ldyBzZXR0aW5nIHRvIGxpc3Qgb2YgdXNlciBpZHMKLSAgICAgICAgICAgICAgICAgICAgICAgIGFkZFVzZXJJZExQdyhwLnVpZCwgcCwgbmFtZSk7CisgICAgICAgICAgICAgICAgICAgICAgICBhZGRVc2VySWRMUHcocC5hcHBJZCwgcCwgbmFtZSk7CiAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7CiAgICAgICAgICAgICAgICAgICAgICAgICAvLyBBc3NpZ24gbmV3IHVzZXIgaWQKLSAgICAgICAgICAgICAgICAgICAgICAgIHAudWlkID0gbmV3VXNlcklkTFB3KHApOworICAgICAgICAgICAgICAgICAgICAgICAgcC5hcHBJZCA9IG5ld1VzZXJJZExQdyhwKTsKICAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgIH0KLSAgICAgICAgICAgIGlmIChwLnVpZCA8IDApIHsKKyAgICAgICAgICAgIGlmIChwLmFwcElkIDwgMCkgewogICAgICAgICAgICAgICAgIFBhY2thZ2VNYW5hZ2VyU2VydmljZS5yZXBvcnRTZXR0aW5nc1Byb2JsZW0oTG9nLldBUk4sCiAgICAgICAgICAgICAgICAgICAgICAgICAiUGFja2FnZSAiICsgbmFtZSArICIgY291bGQgbm90IGJlIGFzc2lnbmVkIGEgdmFsaWQgdWlkIik7CiAgICAgICAgICAgICAgICAgcmV0dXJuIG51bGw7CkBAIC01MzksOSArNTM5LDkgQEAKICAgICAgICAgICAgICAgICAgICAgICAgICsgcC5zaGFyZWRVc2VyICsgIiBidXQgaXMgbm93ICIgKyBzaGFyZWRVc2VyCiAgICAgICAgICAgICAgICAgICAgICAgICArICI7IEkgYW0gbm90IGNoYW5naW5nIGl0cyBmaWxlcyBzbyBpdCB3aWxsIHByb2JhYmx5IGZhaWwhIik7CiAgICAgICAgICAgICAgICAgcC5zaGFyZWRVc2VyLnBhY2thZ2VzLnJlbW92ZShwKTsKLSAgICAgICAgICAgIH0gZWxzZSBpZiAocC51aWQgIT0gc2hhcmVkVXNlci51c2VySWQpIHsKKyAgICAgICAgICAgIH0gZWxzZSBpZiAocC5hcHBJZCAhPSBzaGFyZWRVc2VyLnVzZXJJZCkgewogICAgICAgICAgICAgICAgIFBhY2thZ2VNYW5hZ2VyU2VydmljZS5yZXBvcnRTZXR0aW5nc1Byb2JsZW0oTG9nLkVSUk9SLAotICAgICAgICAgICAgICAgICAgICAiUGFja2FnZSAiICsgcC5uYW1lICsgIiB3YXMgdXNlciBpZCAiICsgcC51aWQKKyAgICAgICAgICAgICAgICAgICAgIlBhY2thZ2UgIiArIHAubmFtZSArICIgd2FzIHVzZXIgaWQgIiArIHAuYXBwSWQKICAgICAgICAgICAgICAgICAgICAgKyAiIGJ1dCBpcyBub3cgdXNlciAiICsgc2hhcmVkVXNlcgogICAgICAgICAgICAgICAgICAgICArICIgd2l0aCBpZCAiICsgc2hhcmVkVXNlci51c2VySWQKICAgICAgICAgICAgICAgICAgICAgKyAiOyBJIGFtIG5vdCBjaGFuZ2luZyBpdHMgZmlsZXMgc28gaXQgd2lsbCBwcm9iYWJseSBmYWlsISIpOwpAQCAtNTQ5LDcgKzU0OSw3IEBACiAKICAgICAgICAgICAgIHNoYXJlZFVzZXIucGFja2FnZXMuYWRkKHApOwogICAgICAgICAgICAgcC5zaGFyZWRVc2VyID0gc2hhcmVkVXNlcjsKLSAgICAgICAgICAgIHAudWlkID0gc2hhcmVkVXNlci51c2VySWQ7CisgICAgICAgICAgICBwLmFwcElkID0gc2hhcmVkVXNlci51c2VySWQ7CiAgICAgICAgIH0KICAgICB9CiAKQEAgLTYxNCw4ICs2MTQsOCBAQAogICAgICAgICAgICAgICAgICAgICByZXR1cm4gcC5zaGFyZWRVc2VyLnVzZXJJZDsKICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICB9IGVsc2UgewotICAgICAgICAgICAgICAgIHJlbW92ZVVzZXJJZExQdyhwLnVpZCk7Ci0gICAgICAgICAgICAgICAgcmV0dXJuIHAudWlkOworICAgICAgICAgICAgICAgIHJlbW92ZVVzZXJJZExQdyhwLmFwcElkKTsKKyAgICAgICAgICAgICAgICByZXR1cm4gcC5hcHBJZDsKICAgICAgICAgICAgIH0KICAgICAgICAgfQogICAgICAgICByZXR1cm4gLTE7CkBAIC02MjgsNyArNjI4LDcgQEAKICAgICAgICAgICAgICAgICBwLnNoYXJlZFVzZXIucGFja2FnZXMucmVtb3ZlKHApOwogICAgICAgICAgICAgICAgIHAuc2hhcmVkVXNlci5wYWNrYWdlcy5hZGQobmV3cCk7CiAgICAgICAgICAgICB9IGVsc2UgewotICAgICAgICAgICAgICAgIHJlcGxhY2VVc2VySWRMUHcocC51aWQsIG5ld3ApOworICAgICAgICAgICAgICAgIHJlcGxhY2VVc2VySWRMUHcocC5hcHBJZCwgbmV3cCk7CiAgICAgICAgICAgICB9CiAgICAgICAgIH0KICAgICAgICAgbVBhY2thZ2VzLnB1dChuYW1lLCBuZXdwKTsKQEAgLTEzMTcsOSArMTMxNyw5IEBACiAgICAgICAgICAgICBzZXJpYWxpemVyLmF0dHJpYnV0ZShudWxsLCAibmF0aXZlTGlicmFyeVBhdGgiLCBwa2cubmF0aXZlTGlicmFyeVBhdGhTdHJpbmcpOwogICAgICAgICB9CiAgICAgICAgIGlmIChwa2cuc2hhcmVkVXNlciA9PSBudWxsKSB7Ci0gICAgICAgICAgICBzZXJpYWxpemVyLmF0dHJpYnV0ZShudWxsLCAidXNlcklkIiwgSW50ZWdlci50b1N0cmluZyhwa2cudWlkKSk7CisgICAgICAgICAgICBzZXJpYWxpemVyLmF0dHJpYnV0ZShudWxsLCAidXNlcklkIiwgSW50ZWdlci50b1N0cmluZyhwa2cuYXBwSWQpKTsKICAgICAgICAgfSBlbHNlIHsKLSAgICAgICAgICAgIHNlcmlhbGl6ZXIuYXR0cmlidXRlKG51bGwsICJzaGFyZWRVc2VySWQiLCBJbnRlZ2VyLnRvU3RyaW5nKHBrZy51aWQpKTsKKyAgICAgICAgICAgIHNlcmlhbGl6ZXIuYXR0cmlidXRlKG51bGwsICJzaGFyZWRVc2VySWQiLCBJbnRlZ2VyLnRvU3RyaW5nKHBrZy5hcHBJZCkpOwogICAgICAgICB9CiAgICAgICAgIHNlcmlhbGl6ZXIuc3RhcnRUYWcobnVsbCwgInBlcm1zIik7CiAgICAgICAgIGlmIChwa2cuc2hhcmVkVXNlciA9PSBudWxsKSB7CkBAIC0xMzY0LDkgKzEzNjQsOSBAQAogICAgICAgICBzZXJpYWxpemVyLmF0dHJpYnV0ZShudWxsLCAidXQiLCBMb25nLnRvSGV4U3RyaW5nKHBrZy5sYXN0VXBkYXRlVGltZSkpOwogICAgICAgICBzZXJpYWxpemVyLmF0dHJpYnV0ZShudWxsLCAidmVyc2lvbiIsIFN0cmluZy52YWx1ZU9mKHBrZy52ZXJzaW9uQ29kZSkpOwogICAgICAgICBpZiAocGtnLnNoYXJlZFVzZXIgPT0gbnVsbCkgewotICAgICAgICAgICAgc2VyaWFsaXplci5hdHRyaWJ1dGUobnVsbCwgInVzZXJJZCIsIEludGVnZXIudG9TdHJpbmcocGtnLnVpZCkpOworICAgICAgICAgICAgc2VyaWFsaXplci5hdHRyaWJ1dGUobnVsbCwgInVzZXJJZCIsIEludGVnZXIudG9TdHJpbmcocGtnLmFwcElkKSk7CiAgICAgICAgIH0gZWxzZSB7Ci0gICAgICAgICAgICBzZXJpYWxpemVyLmF0dHJpYnV0ZShudWxsLCAic2hhcmVkVXNlcklkIiwgSW50ZWdlci50b1N0cmluZyhwa2cudWlkKSk7CisgICAgICAgICAgICBzZXJpYWxpemVyLmF0dHJpYnV0ZShudWxsLCAic2hhcmVkVXNlcklkIiwgSW50ZWdlci50b1N0cmluZyhwa2cuYXBwSWQpKTsKICAgICAgICAgfQogICAgICAgICBpZiAocGtnLnVpZEVycm9yKSB7CiAgICAgICAgICAgICBzZXJpYWxpemVyLmF0dHJpYnV0ZShudWxsLCAidWlkRXJyb3IiLCAidHJ1ZSIpOwpAQCAtMTYwNyw3ICsxNjA3LDcgQEAKICAgICAgICAgZmluYWwgSXRlcmF0b3I8UGFja2FnZVNldHRpbmc+IGRpc2FibGVkSXQgPSBtRGlzYWJsZWRTe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UGVybWlzc2lvbiAmJiAoYXBwSWQgIT0gcGtnU2V0dGluZy5hcHBJZCkpIHsKICAgICAgICAgICAgIHRocm93IG5ldyBTZWN1cml0eUV4Y2VwdGlvbigKICAgICAgICAgICAgICAgICAgICAgIlBlcm1pc3Npb24gRGVuaWFsOiBhdHRlbXB0IHRvIGNoYW5nZSBzdG9wcGVkIHN0YXRlIGZyb20gcGlkPSIKICAgICAgICAgICAgICAgICAgICAgKyBCaW5kZXIuZ2V0Q2FsbGluZ1BpZCgpCi0gICAgICAgICAgICAgICAgICAgICsgIiwgdWlkPSIgKyB1aWQgKyAiLCBwYWNrYWdlIHVpZD0iICsgcGtnU2V0dGluZy51aWQpOworICAgICAgICAgICAgICAgICAgICArICIsIHVpZD0iICsgdWlkICsgIiwgcGFja2FnZSB1aWQ9IiArIHBrZ1NldHRpbmcuYXBwSWQpOwogICAgICAgICB9CiAgICAgICAgIGlmIChERUJVR19TVE9QUEVEKSB7CiAgICAgICAgICAgICBpZiAoc3RvcHBlZCkgewpAQCAtMjI4NSw3ICsyMjkyLDcgQEAKICAgICAgICAgICAgICAgICBpZiAocGtnU2V0dGluZy5pbnN0YWxsZXJQYWNrYWdlTmFtZSAhPSBudWxsKSB7CiAgICAgICAgICAgICAgICAgICAgIFBhY2thZ2VNYW5hZ2VyU2VydmljZS5zZW5kUGFja2FnZUJyb2FkY2FzdChJbnRlbnQuQUNUSU9OX1BBQ0tBR0VfRklSU1RfTEFVTkNILAogICAgICAgICAgICAgICAgICAgICAgICAgICAgIHBrZ1NldHRpbmcubmFtZSwgbnVsbCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBwa2dTZXR0aW5nLmluc3RhbGxlclBhY2thZ2VOYW1lLCBudWxsKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICBwa2dTZXR0aW5nLmluc3RhbGxlclBhY2thZ2VOYW1lLCBudWxsLCB1c2VySWQpOwogICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICBwa2dTZXR0aW5nLnNldE5vdExhdW5jaGVkKGZhbHNlLCB1c2VySWQpOwogICAgICAgICAgICAgfQpAQCAtMjM2OSw3ICsyMzc2LDcgQEAKICAgICAgICAgICAgICAgICBwdy5wcmludGxuKHBzLm5hbWUpOwogICAgICAgICAgICAgfQogCi0gICAgICAgICAgICBwdy5wcmludCgiICAgIHVzZXJJZD0iKTsgcHcucHJpbnQocHMudWlkKTsKKyAgICAgICAgICAgIHB3LnByaW50KCIgICAgdXNlcklkPSIpOyBwdy5wcmludChwcy5hcHBJZCk7CiAgICAgICAgICAgICBwdy5wcmludCgiIGdpZHM9Iik7IHB3LnByaW50bG4oUGFja2FnZU1hbmFnZXJTZXJ2aWNlLmFycmF5VG9TdHJpbmcocHMuZ2lkcykpOwogICAgICAgICAgICAgcHcucHJpbnQoIiAgICBzaGFyZWRVc2VyPSIpOyBwdy5wcmludGxuKHBzLnNoYXJlZFVzZXIpOwogICAgICAgICAgICAgcHcucHJpbnQoIiAgICBwa2c9Iik7IHB3LnByaW50bG4ocHMucGtnKTsKQEAgLTI1MTMsNyArMjUyMCw3IEBACiAgICAgICAgICAgICAgICAgICAgIHB3LnByaW50bG4ocHMubmFtZSk7CiAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgIHB3LnByaW50KCIgICAgdXNlcklkPSIpOwotICAgICAgICAgICAgICAgIHB3LnByaW50bG4ocHMudWlkKTsKKyAgICAgICAgICAgICAgICBwdy5wcmludGxuKHBzLmFwcElkKTsKICAgICAgICAgICAgICAgICBwdy5wcmludCgiICAgIHNoYXJlZFVzZXI9Iik7CiAgICAgICAgICAgICAgICAgcHcucHJpbnRsbihwcy5zaGFyZWRVc2VyKTsKICAgICAgICAgICAgICAgICBwdy5wcmludCgiICAgIGNvZGVQYXRoPSIpOwpkaWZmIC0tZ2l0IGEvc2VydmljZXMvamF2YS9jb20vYW5kcm9pZC9zZXJ2ZXIvcG0vVXNlck1hbmFnZXIuamF2YSBiL3NlcnZpY2VzL2phdmE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V0VXNlcnMoKSB7Ci0gICAgICAgIEFycmF5TGlzdDxVc2VySW5mbz4gdXNlcnMgPSBuZXcgQXJyYXlMaXN0PFVzZXJJbmZvPihtVXNlcnMuc2l6ZSgpKTsKLSAgICAgICAgZm9yIChpbnQgaSA9IDA7IGkgPCBtVXNlcnMuc2l6ZSgpOyBpKyspIHsKLSAgICAgICAgICAgIHVzZXJzLmFkZChtVXNlcnMudmFsdWVBdChpKSk7CisgICAgICAgIHN5bmNocm9uaXplZCAobVVzZXJzKSB7CisgICAgICAgICAgICBBcnJheUxpc3Q8VXNlckluZm8+IHVzZXJzID0gbmV3IEFycmF5TGlzdDxVc2VySW5mbz4obVVzZXJzLnNpemUoKSk7CisgICAgICAgICAgICBmb3IgKGludCBpID0gMDsgaSA8IG1Vc2Vycy5zaXplKCk7IGkrKykgeworICAgICAgICAgICAgICAgIHVzZXJzLmFkZChtVXNlcnMudmFsdWVBdChpKSk7CisgICAgICAgICAgICB9CisgICAgICAgICAgICByZXR1cm4gdXNlcnM7CiAgICAgICAgIH0KLSAgICAgICAgcmV0dXJuIHVzZXJzOworICAgIH0KKworICAgIHB1YmxpYyBVc2VySW5mbyBnZXRVc2VyKGludCB1c2VySWQpIHsKKyAgICAgICAgc3luY2hyb25pemVkIChtVXNlcnMpIHsKKyAgICAgICAgICAgIFVzZXJJbmZvIGluZm8gPSBtVXNlcnMuZ2V0KHVzZXJJZCk7CisgICAgICAgICAgICByZXR1cm4gaW5mbzsKKyAgICAgICAgfQorICAgIH0KKworICAgIHB1YmxpYyBib29sZWFuIGV4aXN0cyhpbnQgdXNlcklkKSB7CisgICAgICAgIHN5bmNocm9uaXplZCAobVVzZXJzKSB7CisgICAgICAgICAgICByZXR1cm4gQXJyYXlVdGlscy5jb250YWlucyhtVXNlcklkcywgdXNlcklkKTsKKyAgICAgICAgfQorICAgIH0KKworICAgIHB1YmxpYyB2b2lkIHVwZGF0ZVVzZXJOYW1lKGludCB1c2VySWQsIFN0cmluZyBuYW1lKSB7CisgICAgICAgIHN5bmNocm9uaXplZCAobVVzZXJzKSB7CisgICAgICAgICAgICBVc2VySW5mbyBpbmZvID0gbVVzZXJzLmdldCh1c2VySWQpOworICAgICAgICAgICAgaWYgKG5hbWUgIT0gbnVsbCAmJiAhbmFtZS5lcXVhbHMoaW5mby5uYW1lKSkgeworICAgICAgICAgICAgICAgIGluZm8ubmFtZSA9IG5hbWU7CisgICAgICAgICAgICAgICAgd3JpdGVVc2VyTG9ja2VkKGluZm8pOworICAgICAgICAgICAgfQorICAgICAgICB9CiAgICAgfQogCiAgICAgLyoqCkBAIC0xMDgsOSArMTM0LDE0IEBACiAgICAgfQogCiAgICAgcHJpdmF0ZSB2b2lkIHJlYWRVc2VyTGlzdCgpIHsKLSAgICAgICAgbVVzZXJzID0gbmV3IFNwYXJzZUFycmF5PFVzZXJJbmZvPigpOworICAgICAgICBzeW5jaHJvbml6ZWQgKG1Vc2VycykgeworICAgICAgICAgICAgcmVhZFVzZXJMaXN0TG9ja2VkKCk7CisgICAgICAgIH0KKyAgICB9CisKKyAgICBwcml2YXRlIHZvaWQgcmVhZFVzZXJMaXN0TG9ja2VkKCkgewogICAgICAgICBpZiAoIW1Vc2VyTGlzdEZpbGUuZXhpc3RzKCkpIHsKLSAgICAgICAgICAgIGZhbGxiYWNrVG9TaW5nbGVVc2VyKCk7CisgICAgICAgICAgICBmYWxsYmFja1RvU2luZ2xlVXNlckxvY2tlZCgpOwogICAgICAgICAgICAgcmV0dXJuOwogICAgICAgICB9CiAgICAgICAgIEZpbGVJbnB1dFN0cmVhbSBmaXMgPSBudWxsOwpAQCAtMTI2LDcgKzE1Nyw3IEBACiAKICAgICAgICAgICAgIGlmICh0eXBlICE9IFhtbFB1bGxQYXJzZXIuU1RBUlRfVEFHKSB7CiAgICAgICAgICAgICAgICAgU2xvZy5lKExPR19UQUcsICJVbmFibGUgdG8gcmVhZCB1c2VyIGxpc3QiKTsKLSAgICAgICAgICAgICAgICBmYWxsYmFja1RvU2luZ2xlVXNlcigpOworICAgICAgICAgICAgICAgIGZhbGxiYWNrVG9TaW5nbGVVc2VyTG9ja2VkKCk7CiAgICAgICAgICAgICAgICAgcmV0dXJuOwogICAgICAgICAgICAgfQogCkBAIC0xMzksMTEgKzE3MCwxMSBAQAogICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgfQotICAgICAgICAgICAgdXBkYXRlVXNlcklkcygpOworICAgICAgICAgICAgdXBkYXRlVXNlcklkc0xvY2tlZCgpOwogICAgICAgICB9IGNhdGNoIChJT0V4Y2VwdGlvbiBpb2UpIHsKLSAgICAgICAgICAgIGZhbGxiYWNrVG9TaW5nbGVVc2VyKCk7CisgICAgICAgICAgICBmYWxsYmFja1RvU2luZ2xlVXNlckxvY2tlZCgpOwogICAgICAgICB9IGNhdGNoIChYbWxQdWxsUGFyc2VyRXhjZXB0aW9uIHBlKSB7Ci0gICAgICAgICAgICBmYWxsYmFja1RvU2luZ2xlVXNlcigpOworICAgICAgICAgICAgZmFsbGJhY2tUb1NpbmdsZVVzZXJMb2NrZWQoKTsKICAgICAgICAgfSBmaW5hbGx5IHsKICAgICAgICAgICAgIGlmIChmaXMgIT0gbnVsbCkgewogICAgICAgICAgICAgICAgIHRyeSB7CkBAIC0xNTQsMTUgKzE4NSwxNSBAQAogICAgICAgICB9CiAgICAgfQogCi0gICAgcHJpdmF0ZSB2b2lkIGZhbGxiYWNrVG9TaW5nbGVVc2VyKCkgeworICAgIHByaXZhdGUgdm9pZCBmYWxsYmFja1RvU2luZ2xlVXNlckxvY2tlZCgpIHsKICAgICAgICAgLy8gQ3JlYXRlIHRoZSBwcmltYXJ5IHVzZXIKICAgICAgICAgVXNlckluZm8gcHJpbWFyeSA9IG5ldyBVc2VySW5mbygwLCAiUHJpbWFyeSIsCiAgICAgICAgICAgICAgICAgVXNlckluZm8uRkxBR19BRE1JTiB8IFVzZXJJbmZvLkZMQUdfUFJJTUFSWSk7CiAgICAgICAgIG1Vc2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0dXJuIG51bGw7CiAgICAgfQogCi0gICAgcHVibGljIFVzZXJJbmZvIGNyZWF0ZVVzZXIoU3RyaW5nIG5hbWUsIGludCBmbGFncywgTGlzdDxBcHBsaWNhdGlvbkluZm8+IGFwcHMpIHsKKyAgICBwdWJsaWMgVXNlckluZm8gY3JlYXRlVXNlcihTdHJpbmcgbmFtZSwgaW50IGZsYWdzKSB7CiAgICAgICAgIGludCB1c2VySWQgPSBnZXROZXh0QXZhaWxhYmxlSWQoKTsKICAgICAgICAgVXNlckluZm8gdXNlckluZm8gPSBuZXcgVXNlckluZm8odXNlcklkLCBuYW1lLCBmbGFncyk7CiAgICAgICAgIEZpbGUgdXNlclBhdGggPSBuZXcgRmlsZShtQmFzZVVzZXJQYXRoLCBJbnRlZ2VyLnRvU3RyaW5nKHVzZXJJZCkpOwotICAgICAgICBpZiAoIWNyZWF0ZVBhY2thZ2VGb2xkZXJzKHVzZXJJZCwgdXNlclBhdGgsIGFwcHMpKSB7CisgICAgICAgIGlmICghY3JlYXRlUGFja2FnZUZvbGRlcnModXNlcklkLCB1c2VyUGF0aCkpIHsKICAgICAgICAgICAgIHJldHVybiBudWxsOwogICAgICAgICB9Ci0gICAgICAgIG1Vc2Vycy5wdXQodXNlcklkLCB1c2VySW5mbyk7Ci0gICAgICAgIHdyaXRlVXNlckxpc3QoKTsKLSAgICAgICAgd3JpdGVVc2VyKHVzZXJJbmZvKTsKLSAgICAgICAgdXBkYXRlVXNlcklkcygpOworICAgICAgICBzeW5jaHJvbml6ZWQgKG1Vc2VycykgeworICAgICAgICAgICAgbVVzZXJzLnB1dCh1c2VySWQsIHVzZXJJbmZvKTsKKyAgICAgICAgICAgIHdyaXRlVXNlckxpc3RMb2NrZWQoKTsKKyAgICAgICAgICAgIHdyaXRlVXNlckxvY2tlZCh1c2VySW5mbyk7CisgICAgICAgICAgICB1cGRhdGVVc2VySWRzTG9ja2VkKCk7CisgICAgICAgIH0KICAgICAgICAgcmV0dXJuIHVzZXJJbmZvOwogICAgIH0KIApAQCAtMzI4LDcgKzM2MSwxMyBAQAogICAgICAqIGFmdGVyIHRoZSB1c2VyJ3MgcHJvY2Vzc2VzIGhhdmUgYmVlbiB0ZXJtaW5hdGVkLgogICAgICAqIEBwYXJhbSBpZCB0aGUgdXNlcidzIGlkCiAgICAgICovCi0gICAgcHVibGljIHZvaWQgcmVtb3ZlVXNlcihpbnQgaWQpIHsKKyAgICBwdWJsaWMgYm9vbGVhbiByZW1vdmVVc2VyKGludCBpZCkgeworICAgICAgICBzeW5jaHJvbml6ZWQgKG1Vc2VycykgeworICAgICAgICAgICAgcmV0dXJuIHJlbW92ZVVzZXJMb2NrZWQoaWQpOworICAgICAgICB9CisgICAgfQorCisgICAgcHJpdmF0ZSBib29sZWFuIHJlbW92ZVVzZXJMb2NrZWQoaW50IGlkKSB7CiAgICAgICAgIC8vIFJlbW92ZSBmcm9tIHRoZSBsaXN0CiAgICAgICAgIFVzZXJJbmZvIHVzZXJJbmZvID0gbVVzZXJzLmdldChpZCk7CiAgICAgICAgIGlmICh1c2VySW5mbyAhPSBudWxsKSB7CkBAIC0zMzgsMTEgKzM3NywxMSBAQAogICAgICAgICAgICAgRmlsZSB1c2VyRmlsZSA9IG5ldyBGaWxlKG1Vc2Vyc0RpciwgaWQgKyAiLnhtbCIpOwogICAgICAgICAgICAgdXNlckZpbGUuZGVsZXRlKCk7CiAgICAgICAgICAgICAvLyBVcGRhdGUgdGhlIHVzZXIgbGlzdAotICAgICAgICAgICAgd3JpdGVVc2VyTGlzdCgpOwotICAgICAgICAgICAgLy8gUmVtb3ZlIHRoZSBkYXRhIGRpcmVjdG9yaWVzIGZvciBhbGwgcGFja2FnZXMgZm9yIHRoaXMgdXNlcgotICAgICAgICAgICAgcmVtb3ZlUGFja2FnZUZvbGRlcnMoaWQpOwotICAgICAgICAgICAgdXBkYXRlVXNlcklkcygpOworICAgICAgICAgICAgd3JpdGVVc2VyTGlzdExvY2tlZCgpOworICAgICAgICAgICAgdXBkYXRlV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mb3JtYXRpb24uZ2V0QWxwaGEoKQogICAgICAgICAgICAgICAgICsgIiBsYXllcj0iICsgdGh1bWJuYWlsTGF5ZXIKICAgICAgICAgICAgICAgICArICIgbWF0cml4PVsiICsgdG1wRmxvYXRzW01hdHJpeC5NU0NBTEVfWF0KQEAgLTM1OCw3ICszNTgsNyBAQAogCiAgICAgICAgIGZpbmFsIGludCBOID0gd2luZG93cy5zaXplKCk7CiAgICAgICAgIGZvciAoaW50IGk9MDsgaTxOOyBpKyspIHsKLSAgICAgICAgICAgIHdpbmRvd3MuZ2V0KGkpLmZpbmlzaEV4aXQoKTsKKyAgICAgICAgICAgIHdpbmRvd3MuZ2V0KGkpLm1XaW5BbmltYXRvci5maW5pc2hFeGl0KCk7CiAgICAgICAgIH0KICAgICAgICAgdXBkYXRlUmVwb3J0ZWRWaXNpYmlsaXR5TG9ja2VkKCk7CiAKQEAgLTM4OCw3ICszODgsNyBAQAogICAgICAgICAgICAgaWYgKFdpbmRvd01hbmFnZXJTZXJ2aWNlLkRFQlVHX1ZJU0lCSUxJVFkpIHsKICAgICAgICAgICAgICAgICBTbG9nLnYoV2luZG93TWFuYWdlclNlcnZpY2UuVEFHLCAiV2luICIgKyB3aW4gKyAiOiBpc0RyYXduPSIKICAgICAgICAgICAgICAgICAgICAgICAgICsgd2luLmlzRHJhd25MdygpCi0gICAgICAgICAgICAgICAgICAgICAgICArICIsIGlzQW5pbWF0aW5nPSIgKyB3aW4uaXNBbmltYXRpbmcoKSk7CisgICAgICAgICAgICAgICAgICAgICAgICArICIsIGlzQW5pbWF0aW5nPSIgKyB3aW4ubVdpbkFuaW1hdG9yLmlzQW5pbWF0aW5nKCkpOwogICAgICAgICAgICAgICAgIGlmICghd2luLmlzRHJhd25MdygpKSB7CiAgICAgICAgICAgICAgICAgICAgIFNsb2cudihXaW5kb3dNYW5hZ2VyU2VydmljZS5UQUcsICJOb3QgZGlzcGxheWVkOiBzPSIgKyB3aW4ubVN1cmZhY2UKICAgICAgICAgICAgICAgICAgICAgICAgICAgICArICIgcHY9IiArIHdpbi5tUG9saWN5VmlzaWJpbGl0eQpAQCAtMzk4LDE3ICszOTgsMTcgQEAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICArICIgdGg9IgogICAgICAgICAgICAgICAgICAgICAgICAgICAgICsgKHdpbi5tQXBwVG9rZW4gIT0gbnVsbAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPyB3aW4ubUFwcFRva2VuLmhpZGRlblJlcXVlc3RlZCA6IGZhbHNlKQotICAgICAgICAgICAgICAgICAgICAgICAgICAgICsgIiBhPSIgKyB3aW4ubUFuaW1hdGluZyk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgKyAiIGE9IiArIHdpbi5tV2luQW5pbWF0b3IubUFuaW1hdGluZyk7CiAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgfQogICAgICAgICAgICAgbnVtSW50ZXJlc3RpbmcrKzsKICAgICAgICAgICAgIGlmICh3aW4uaXNEcmF3bkx3KCkpIHsKICAgICAgICAgICAgICAgICBudW1EcmF3bisrOwotICAgICAgICAgICAgICAgIGlmICghd2luLmlzQW5pbWF0aW5nKCkpIHsKKyAgICAgICAgICAgICAgICBpZiAoIXdpbi5tV2luQW5pbWF0b3IuaXNBbmltYXRpbmcoKSkgewogICAgICAgICAgICAgICAgICAgICBudW1WaXNpYmxlKys7CiAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgIG5vd0dvbmUgPSBmYWxzZTsKLSAgICAgICAgICAgIH0gZWxzZSBpZiAod2luLmlzQW5pbWF0aW5nKCkpIHsKKyAgICAgICAgICAgIH0gZWxzZSBpZiAod2luLm1XaW5BbmltYXRvci5pc0FuaW1hdGluZygpKSB7CiAgICAgICAgICAgICAgICAgbm93R29uZSA9IGZhbHNlOwogICAgICAgICAgICAgfQogICAgICAgICB9CmRpZmYgLS1naXQgYS9zZXJ2aWNlcy9qYXZhL2NvbS9hbmRyb2lkL3NlcnZlci93bS9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gZHVyYXRpb24gPSAody5tQW5pbWF0aW5nICYmIHcubUFuaW1hdGlvbiAhPSBudWxsKQotICAgICAgICAgICAgICAgICAgICA/IHcubUFuaW1hdGlvbi5jb21wdXRlRHVyYXRpb25IaW50KCkKKyAgICAgICAgICAgIGxvbmcgZHVyYXRpb24gPSAody5tV2luQW5pbWF0b3IubUFuaW1hdGluZyAmJiB3Lm1XaW5BbmltYXRvci5tQW5pbWF0aW9uICE9IG51bGwpCisgICAgICAgICAgICAgICAgICAgID8gdy5tV2luQW5pbWF0b3IubUFuaW1hdGlvbi5jb21wdXRlRHVyYXRpb25IaW50KCkKICAgICAgICAgICAgICAgICAgICAgOiBXaW5kb3dNYW5hZ2VyU2VydmljZS5ERUZBVUxUX0RJTV9EVVJBVElPTjsKICAgICAgICAgICAgIGlmICh0YXJnZXQgPiBtRGltVGFyZ2V0QWxwaGEpIHsKICAgICAgICAgICAgICAgICBUeXBlZFZhbHVlIHR2ID0gbmV3IFR5cGVkVmFsdWUoKTsKICAgICAgICAgICAgICAgICByZXMuZ2V0VmFsdWUoY29tLmFuZHJvaWQuaW50ZXJuYWwuUi5mcmFjdGlvbi5jb25maWdfZGltQmVoaW5kRmFkZUR1cmF0aW9uLAogICAgICAgICAgICAgICAgICAgICAgICAgdHYsIHRydWUpOwogICAgICAgICAgICAgICAgIGlmICh0di50eXBlID09IFR5cGVkVmFsdWUuVFlQRV9GUkFDVElPTikgewotICAgICAgICAgICAgICAgICAgICBkdXJhdGlvbiA9IChsb25nKXR2LmdldEZyYWN0aW9uKChmbG9hdClkdXJhdGlvbiwgKGZsb2F0KWR1cmF0aW9uKTsKKyAgICAgICAgICAgICAgICAgICAgZHVyYXRpb24gPSAobG9uZyl0di5nZXRGcmFjdGlvbihkdXJhdGlvbiwgZHVyYXRpb24pOwogICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAodHYudHlwZSA+PSBUeXBlZFZhbHVlLlRZUEVfRklSU1RfSU5UCiAgICAgICAgICAgICAgICAgICA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pbmFsIFdpbmRvd01hbmFnZXIuTGF5b3V0UGFyYW1zIGF0dHJzID0gdy5tQXR0cnM7CiAKQEAgLTE0Myw3ICsxNDQsNyBAQAogICAgICAgICAgICAgICAgICAgICAvLyBsZXQncyBkbyBzb21ldGhpbmcuCiAgICAgICAgICAgICAgICAgICAgIEFuaW1hdGlvbiBhID0gQW5pbWF0aW9uVXRpbHMubG9hZEFuaW1hdGlvbihtQ29udGV4dCwKICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb20uYW5kcm9pZC5pbnRlcm5hbC5SLmFuaW0ud2luZG93X21vdmVfZnJvbV9kZWNvcik7Ci0gICAgICAgICAgICAgICAgICAgIHcuc2V0QW5pbWF0aW9uKGEpOworICAgICAgICAgICAgICAgICAgICB3aW5BbmltYXRvci5zZXRBbmltYXRpb24oYSk7CiAgICAgICAgICAgICAgICAgICAgIHcubUFuaW1EdyA9IHcubUxhc3RGcmFtZS5sZWZ0IC0gdy5tRnJhbWUubGVmdDsKICAgICAgICAgICAgICAgICAgICAgdy5tQW5pbURoID0gdy5tTGFzdEZyYW1lLnRvcCAtIHcubUZyYW1lLnRvcDsKICAgICAgICAgICAgICAgICB9IGVsc2UgewpAQCAtMTUxLDggKzE1Miw4IEBACiAgICAgICAgICAgICAgICAgICAgIHcubUFuaW1EaCA9IG1Jbm5lckRoOwogICAgICAgICAgICAgICAgIH0KIAotICAgICAgICAgICAgICAgIGZpbmFsIGJvb2xlYW4gd2FzQW5pbWF0aW5nID0gdy5tV2FzQW5pbWF0aW5nOwotICAgICAgICAgICAgICAgIGZpbmFsIGJvb2xlYW4gbm93QW5pbWF0aW5nID0gdy5zdGVwQW5pbWF0aW9uTG9ja2VkKG1DdXJyZW50VGltZSk7CisgICAgICAgICAgICAgICAgZmluYWwgYm9vbGVhbiB3YXNBbmltYXRpbmcgPSB3aW5BbmltYXRvci5tV2FzQW5pbWF0aW5nOworICAgICAgICAgICAgICAgIGZpbmFsIGJvb2xlYW4gbm93QW5pbWF0aW5nID0gd2luQW5pbWF0b3Iuc3RlcEFuaW1hdGlvbkxvY2tlZChtQ3VycmVudFRpbWUpOwogCiAgICAgICAgICAgICAgICAgaWYgKFdpbmRvd01hbmFnZXJTZXJ2aWNlLkRFQlVHX1dBTExQQVBFUikgewogICAgICAgICAgICAgICAgICAgICBTbG9nLnYoVEFHLCB3ICsgIjogd2FzQW5pbWF0aW5nPSIgKyB3YXNBbmltYXRpbmcgKwpAQCAtMTYzLDE3ICsxNjQsMTcgQEAKICAgICAgICAgICAgICAgICAvLyBhbiBhbmltYXRpbmcgd2luZG93IGFuZCB0YWtlIGNhcmUgb2YgYSByZXF1ZXN0IHRvIHJ1bgogICAgICAgICAgICAgICAgIC8vIGEgZGV0YWNoZWQgd2FsbHBhcGVyIGFuaW1hdGlvbi4KICAgICAgICAgICAgICAgICBpZiAobm93QW5pbWF0aW5nKSB7Ci0gICAgICAgICAgICAgICAgICAgIGlmICh3Lm1BbmltYXRpb24gIT0gbnVsbCkgeworICAgICAgICAgICAgICAgICAgICBpZiAod2luQW5pbWF0b3IubUFuaW1hdGlvbiAhPSBudWxsKSB7CiAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoKHcubUF0dHJzLmZsYWdzJkZMQUdfU0hPV19XQUxMUEFQRVIpICE9IDAKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgdy5tQW5pbWF0aW9uLmdldERldGFjaFdhbGxwYXBlcigpKSB7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICYmIHdpbkFuaW1hdG9yLm1BbmltYXRpb24uZ2V0RGV0YWNoV2FsbHBhcGVyKCkpIHsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICBtU2VydmljZS5tSW5uZXJGaWVsZHMubURldGFjaGVkV2FsbHBhcGVyID0gdzsKICAgICAgICAgICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICAgICAgICAgIGlmICh3Lm1BbmltYXRpb24uZ2V0QmFja2dyb3VuZENvbG9yKCkgIT0gMCkgeworICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHdpbkFuaW1hdG9yLm1BbmltYXRpb24uZ2V0QmFja2dyb3VuZENvbG9yKCkgIT0gMCkgewogICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChtV2luZG93QW5pbWF0aW9uQmFja2dyb3VuZCA9PSBudWxsCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8fCAody5tQW5pbUxheWVyIDwgbVdpbmRvd0FuaW1hdGlvbkJhY2tncm91bmQubUFuaW1MYXllcikpIHsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbVdpbmRvd0FuaW1hdGlvbkJhY2tncm91bmQgPSB3OwogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBtV2luZG93QW5pbWF0aW9uQmFja2dyb3VuZENvbG9yID0KLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB3Lm1BbmltYXRpb24uZ2V0QmFja2dyb3VuZENvbG9yKCk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgd2luQW5pbWF0b3IubUFuaW1hdGlvbi5nZXRCYWNrZ3JvdW5kQ29sb3IoKTsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgICAgIH0KQEAgLTIwMCw3ICsyMDEsNyBAQAogICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgfQogCi0gICAgICAgICAgICAgICAgaWYgKHdhc0FuaW1hdGluZyAmJiAhdy5tQW5pbWF0aW5nICYmIG1TZXJ2aWNlLm1XYWxscGFwZXJUYXJnZXQgPT0gdykgeworICAgICAgICAgICAgICAgIGlmICh3YXNBbmltYXRpbmcgJiYgIXdpbkFuaW1hdG9yLm1BbmltYXRpbmcgJiYgbVNlcnZpY2UubVdhbGxwYXBlclRhcmdldCA9PSB3KSB7CiAgICAgICAgICAgICAgICAgICAgIG1TZXJ2aWNlLm1Jbm5lckZpZWxkcy5tV2FsbHBhcGVyTWF5Q2hhbmdlID0gdHJ1ZTsKICAgICAgICAgICAgICAgICAgICAgbVBlbmRpbmdMYXlvdXRDaGFuZ2VzIHw9IFdpbmRvd01hbmFnZXJQb2xpY3kuRklOSVNIX0xBWU9VVF9SRURPX1dBTExQQVBFUjsKICAgICAgICAgICAgICAgICAgICAgaWYgKFdpbmRvd01hbmFnZXJTZXJ2aWNlLkRFQlVHX0xBWU9VVF9SRVBFQVRTKSB7CkBAIC0yMTksNyArMjIwLDcgQEAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICBtU2VydmljZS5kZWJ1Z0xheW91dFJlcGVhdHMoInVwZGF0ZVdpbmRvd3NBbmRXYWxscGFwZXJMb2NrZWQgMyIpOwogICAgICAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgICAgICAgICAgbVNlcnZpY2UubUZvY3VzTWF5Q2hhbmdlID0gdHJ1ZTsKLSAgICAgICAgICAgICAgICAgICAgfSBlbHNlIGlmICh3LmlzUmVhZHlGb3JEaXNwbGF5KCkgJiYgdy5tQW5pbWF0aW9uID09IG51bGwpIHsKKyAgICAgICAgICAgICAgICAgICAgfSBlbHNlIGlmICh3LmlzUmVhZHlGb3JEaXNwbGF5KCkgJiYgd2luQW5pbWF0b3IubUFuaW1hdGlvbiA9PSBudWxsKSB7CiAgICAgICAgICAgICAgICAgICAgICAgICBtRm9yY2VIaWRpbmcgPSB0cnVlOwogICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgfSBlbHNlIGlmIChtUG9saWN5LmNhbkJlRm9yY2VIaWRkZW4odywgYXR0cnMpKSB7CkBAIC0yNDEsNyArMjQyLDcgQEAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gY2xlYW4gdXAgbGF0ZXIuCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEFuaW1hdGlvbiBhID0gbVBvbGljeS5jcmVhdGVGb3JjZUhpZGVFbnRlckFuaW1hdGlvbigpOwogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoYSAhPSBudWxsKSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB3LnNldEFuaW1hdGlvbihhKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHdpbkFuaW1hdG9yLnNldEFuaW1hdGlvbihhKTsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAobUN1cnJlbnRGb2N1cyA9PSBudWxsIHx8IG1DdXJyZW50Rm9jdXMubUxheWVyIDwgdy5tTGF5ZXIpIHsKQEAgLTI3Nyw3ICsyNzgsNyBAQAogICAgICAgICAgICAgICAgICAgICAgICAgICAgIFdpbmRvd01hbmFnZXJTZXJ2aWNlLkRFQlVHX09SSUVOVEFUSU9OKSB7CiAgICAgICAgICAgICAgICAgICAgICAgICBTbG9nLnYoVEFHLCAiRXZhbCB3aW4gIiArIHcgKyAiOiBpc0RyYXduPSIKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKyB3LmlzRHJhd25MdygpCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICsgIiwgaXNBbmltYXRpbmc9IiArIHcuaXNBbmltYXRpbmcoKSk7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICsgIiwgaXNBbmltYXRpbmc9IiArIHdpbkFuaW1hdG9yLmlzQW5pbWF0aW5nKCkpOwogICAgICAgICAgICAgICAgICAgICAgICAgaWYgKCF3LmlzRHJhd25MdygpKSB7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgU2xvZy52KFRBRywgIk5vdCBkaXNwbGF5ZWQ6IHM9IiArIHcubVN1cmZhY2UKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICsgIiBwdj0iICsgdy5tUG9saWN5VmlzaWJpbGl0eQpAQCAtMjg1LDcgKzI4Niw3IEBACiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICArICIgY2RwPSIgKyB3Lm1Db21taXREcmF3UGVuZGluZwogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKyAiIGFoPSIgKyB3Lm1BdHRhY2hlZEhpZGRlbgogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKyAiIHRoPSIgKyBhdG9rZW4uaGlkZGVuUmVxdWVzdGVkCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICArICIgYT0iICsgdy5tQW5pbWF0aW5nKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICsgIiBhPSIgKyB3aW5BbmltYXRvci5tQW5pbWF0aW5nKTsKICAgICAgICAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgICAgICBpZiAodyAhPSBhdG9rZW4uc3RhcnRpbmdXaW5kb3cpIHsKZGlmZiAtLWdpdCBhL3NlcnZpY2VzL2phdmEvY29tL2FuZHJvaWQvc2VydmVyL3dtL1dpbmRvd01hbmFnZXJTZXJ2aWNlLmphdmEgYi9zZXJ2aWNlcy9qYXZhL2NvbS9hbmRyb2lkL3NlcnZlci93bS9XaW5kb3dNYW5hZ2VyU2VydmljZS5qYXZhCmluZGV4IGU0MzA1MjkuLjk2MzViMzMgMTAwNjQ0Ci0tLSBhL3NlcnZpY2VzL2phdmEvY29tL2FuZHJvaWQvc2VydmVyL3dtL1dpbmRvd01hbmFnZXJTZXJ2aWNlLmphdmEKKysrIGIvc2VydmljZXMvamF2YS9jb20vYW5kcm9pZC9zZXJ2ZXIvd20vV2luZG93TWFuYWdlclNlcnZpY2UuamF2YQpAQCAtMTIzOCw3ICsxMjM4LDcgQEAKICAgICAgICAgICAgICAgICBpZiAoaGlnaGVzdFRhcmdldCAhPSBudWxsKSB7CiAgICAgICAgICAgICAgICAgICAgIGlmIChERUJVR19JTlBVVF9NRVRIT0QpIFNsb2cudihUQUcsICJtTmV4dEFwcFRyYW5zaXRpb249IgogICAgICAgICAgICAgICAgICAgICAgICAgICAgICsgbU5leHRBcHBUcmFuc2l0aW9uICsgIiAiICsgaGlnaGVzdFRhcmdldAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICsgIiBhbmltYXRpbmc9IiArIGhpZ2hlc3RUYXJnZXQuaXNBbmltYXRpbmcoKQorICAgICAgICAgICAgICAgICAgICAgICAgICAgICsgIiBhbmltYXRpbmc9IiArIGhpZ2hlc3RUYXJnZXQubVdpbkFuaW1hdG9yLmlzQW5pbWF0aW5nKCkKICAgICAgICAgICAgICAgICAgICAgICAgICAgICArICIgbGF5ZXI9IiArIGhpZ2hlc3RUYXJnZXQubUFuaW1MYXllcgogICAgICAgICAgICAgICAgICAgICAgICAgICAgICsgIiBuZXcgbGF5ZXI9IiArIHcubUFuaW1MYXllcik7CiAKQEAgLTEyNDgsNyArMTI0OCw3IEBACiAgICAgICAgICAgICAgICAgICAgICAgICBtSW5wdXRNZXRob2RUYXJnZXRXYWl0aW5nQW5pbSA9IHRydWU7CiAgICAgICAgICAgICAgICAgICAgICAgICBtSW5wdXRNZXRob2RUYXJnZXQgPSBoaWdoZXN0VGFyZ2V0OwogICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGhpZ2hlc3RQb3MgKyAxOwotICAgICAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKGhpZ2hlc3RUYXJnZXQuaXNBbmltYXRpbmcoKSAmJgorICAgICAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKGhpZ2hlc3RUYXJnZXQubVdpbkFuaW1hdG9yLmlzQW5pbWF0aW5nKCkgJiYKICAgICAgICAgICAgICAgICAgICAgICAgICAgICBoaWdoZXN0VGFyZ2V0Lm1BbmltTGF5ZXIgPiB3Lm1BbmltTGF5ZXIpIHsKICAgICAgICAgICAgICAgICAgICAgICAgIC8vIElmIHRoZSB3aW5kb3cgd2UgYXJlIGN1cnJlbnRseSB0YXJnZXRpbmcgaXMgaW52b2x2ZWQKICAgICAgICAgICAgICAgICAgICAgICAgIC8vIHdpdGggYW4gYW5pbWF0aW9uLCBhbmQgaXQgaXMgb24gdG9wIG9mIHRoZSBuZXh0IHRhcmdldApAQCAtMTYwMSw3ICsxNjAxLDcgQEAKICAgICAgICAgICAgICAgICBmb3VuZEkgPSBpOwogICAgICAgICAgICAgICAgIGlmICh3ID09IG1XYWxscGFwZXJUYXJnZXQgJiYgKCh3Lm1BcHBUb2tlbiAhPSBudWxsCiAgICAgICAgICAgICAgICAgICAgICAgICAmJiB3Lm1BcHBUb2tlbi5hbmltYXRpb24gIT0gbnVsbCkKLSAgICAgICAgICAgICAgICAgICAgICAgIHx8IHcubUFuaW1hdGlvbiAhPSBudWxsKSkgeworICAgICAgICAgICAgICAgICAgICAgICAgfHwgdy5tV2luQW5pbWF0b3IubUFuaW1hdGlvbiAhPSBudWxsKSkgewogICAgICAgICAgICAgICAgICAgICAvLyBUaGUgY3VycmVudCB3YWxscGFwZXIgdGFyZ2V0IGlzIGFuaW1hdGluZywgc28gd2UnbGwKICAgICAgICAgICAgICAgICAgICAgLy8gbG9vayBiZWhpbmQgaXQgZm9yIGFub3RoZXIgcG9zc2libGUgdGFyZ2V0IGFuZCBmaWd1cmUKICAgICAgICAgICAgICAgICAgICAgLy8gb3V0IHdoYXQgaXMgZ29pbmcgb24gYmVsb3cuCkBAIC0xNjU4LDkgKzE2NTgsOSBAQAogICAgICAgICAgICAgLy8gTm93IHdoYXQgaXMgaGFwcGVuaW5nLi4uICBpZiB0aGUgY3VycmVudCBhbmQgbmV3IHRhcmdldHMgYXJlCiAgICAgICAgICAgICAvLyBhbmltYXRpbmcsIHRoZW4gd2UgYXJlIGluIG91ciBzdXBlciBzcGVjaWFsIG1vZGUhCiAgICAgICAgICAgICBpZiAoZm91bmRXICE9IG51bGwgJiYgb2xkVyAhPSBudWxsKSB7Ci0gICAgICAgICAgICAgICAgYm9vbGVhbiBvbGRBbmltID0gb2xkVy5tQW5pbWF0aW9uICE9IG51bGwKKyAgICAgICAgICAgICAgICBib29sZWFuIG9sZEFuaW0gPSBvbGRXLm1XaW5BbmltYXRvci5tQW5pbWF0aW9uICE9IG51bGwKICAgICAgICAgICAgICAgICAgICAgICAgIHx8IChvbGRXLm1BcHBUb2tlbiAhPSBudWxsICYmIG9sZFcubUFwcFRva2VuLmFuaW1hdGlvbiAhPSBudWxsKTsKLSAgICAgICAgICAgICAgICBib29sZWFuIGZvdW5kQW5pbSA9IGZvdW5kVy5tQW5pbWF0aW9uICE9IG51bGwKKyAgICAgICAgICAgICAgICBib29sZWFuIGZvdW5kQW5pbSA9IGZvdW5kVy5tV2luQW5pbWF0b3IubUFuaW1hdGlvbiAhPSBudWxsCiAgICAgICAgICAgICAgICAgICAgICAgICB8fCAoZm91bmRXLm1BcHBUb2tlbiAhPSBudWxsICYmIGZvdW5kVy5tQXBwVG9rZW4uYW5pbWF0aW9uICE9IG51bGwpOwogICAgICAgICAgICAgICAgIGlmIChERUJVR19XQUxMUEFQRVIpIHsKICAgICAgICAgICAgICAgICAgICAgU2xvZy52KFRBRywgIk5ldyBhbmltYXRpb246ICIgKyBmb3VuZEFuaW0KQEAgLTE3MTIsMTAgKzE3MTIsMTAgQEAKIAogICAgICAgICB9IGVsc2UgaWYgKG1Mb3dlcldhbGxwYXBlclRhcmdldCAhPSBudWxsKSB7CiAgICAgICAgICAgICAvLyBJcyBpdCB0aW1lIHRvIHN0b3AgYW5pbWF0aW5nPwotICAgICAgICAgICAgYm9vbGVhbiBsb3dlckFuaW1hdGluZyA9IG1Mb3dlcldhbGxwYXBlclRhcmdldC5tQW5pbWF0aW9uICE9IG51bGwKKyAgICAgICAgICAgIGJvb2xlYW4gbG93ZXJBbmltYXRpbmcgPSBtTG93ZXJXYWxscGFwZXJUYXJnZXQubVdpbkFuaW1hdG9yLm1BbmltYXRpb24gIT0gbnVsbAogICAgICAgICAgICAgICAgICAgICB8fCAobUxvd2VyV2FsbHBhcGVyVGFyZ2V0Lm1BcHBUb2tlbiAhPSBudWxsCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgbUxvd2VyV2FsbHBhcGVyVGFyZ2V0Lm1BcHBUb2tlbi5hbmltYXRpb24gIT0gbnVsbCk7Ci0gICAgICAgICAgICBib29sZWFuIHVwcGVyQW5pbWF0aW5nID0gbVVwcGVyV2FsbHBhcGVyVGFyZ2V0Lm1BbmltYXRpb24gIT0gbnVsbAorICAgICAgICAgICAgYm9vbGVhbiB1cHBlckFuaW1hdGluZyA9IG1VcHBlcldhbGxwYXBlclRhcmdldC5tV2luQW5pbWF0b3IubUFuaW1hdGlvbiAhPSBudWxsCiAgICAgICAgICAgICAgICAgICAgIHx8IChtVXBwZXJXYWxscGFwZXJUYXJnZXQubUFwcFRva2VuICE9IG51bGwKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiBtVXBwZXJXYWxscGFwZXJUYXJnZXQubUFwcFRva2VuLmFuaW1hdGlvbiAhPSBudWxsKTsKICAgICAgICAgICAgIGlmICghbG93ZXJBbmltYXRpbmcgfHwgIXVwcGVyQW5pbWF0aW5nKSB7CkBAIC0yMzAzLDcgKzIzMDMsNyBAQAogICAgICAgICBpZiAoREVCVUdfQVBQX1RSQU5TSVRJT05TKSBTbG9nLnYoCiAgICAgICAgICAgICAgICAgVEFHLCAiUmVtb3ZlICIgKyB3aW4gKyAiOiBtU3VyZmFjZT0iICsgd2luLm1TdXJmYWNlCiAgICAgICAgICAgICAgICAgKyAiIG1FeGl0aW5nPSIgKyB3aW4ubUV4aXRpbmcKLSAgICAgICAgICAgICAgICArICIgaXNBbmltYXRpbmc9IiArIHdpbi5pc0FuaW1hdGluZygpCisgICAgICAgICAgICAgICAgKyAiIGlzQW5pbWF0aW5nPSIgKyB3aW4ubVdpbkFuaW1hdG9yLmlzQW5pbWF0aW5nKCkKICAgICAgICAgICAgICAgICArICIgYXBwLWFuaW1hdGlvbj0iCiAgICAgICAgICAgICAgICAgKyAod2luLm1BcHBUb2tlbiAhPSBudWxsID8gd2luLm1BcHBUb2tlbi5hbmltYXRpb24gOiBudWxsKQogICAgICAgICAgICAgICAgICsgIiBpblBlbmRpbmdUcmFuc2FjdGlvbj0iCkBAIC0yMzMwLDcgKzIzMzAsNyBAQAogICAgICAgICAgICAgICAgICAgICB3aW4ubUV4aXRpbmcgPSB0cnVlOwogICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgIH0KLSAgICAgICAgICAgIGlmICh3aW4ubUV4aXRpbmcgfHwgd2luLmlzQW5pbWF0aW5nKCkpIHsKKyAgICAgICAgICAgIGlmICh3aW4ubUV4aXRpbmcgfHwgd2luLm1XaW5BbmltYXRvci5pc0FuaW1hdGluZygpKSB7CiAgICAgICAgICAgICAgICAgLy8gVGhlIGV4aXQgYW5pbWF0aW9uIGlzIHJ1bm5pbmcuLi4gd2FpdCBmb3IgaXQhCiAgICAgICAgICAgICAgICAgLy9TbG9nLmkoVEFHLCAiKioqIFJ1bm5pbmcgZXhpdCBhbmltYXRpb24uLi4iKTsKICAgICAgICAgICAgICAgICB3aW4ubUV4aXRpbmcgPSB0cnVlOwpAQCAtMjY5OSw3ICsyNjk5LDcgQEAKICAgICAgICAgICAgICAgICAgICAgKHdpbi5tQXBwVG9rZW4gPT0gbnVsbCB8fCAhd2luLm1BcHBUb2tlbi5jbGllbnRIaWRkZW4pKSB7CiAgICAgICAgICAgICAgICAgZGlzcGxheWVkID0gIXdpbi5pc1Zpc2libGVMdygpOwogICAgICAgICAgICAgICAgIGlmICh3aW4ubUV4aXRpbmcpIHsKLSAgICAgICAgICAgICAgICAgICAgd2luLmNhbmNlbEV4aXRBbmltYXRpb25Gb3JOZXh0QW5pbWF0aW9uTG9ja2VkKCk7CisgICAgICAgICAgICAgICAgICAgIHdpbi5tV2luQW5pbWF0b3IuY2FuY2VsRXhpdEFuaW1hdGlvbkZvck5leHRBbmltYXRpb25Mb2NrZWQoKTsKICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgaWYgKHdpbi5tRGVzdHJveWluZykgewogICAgICAgICAgICAgICAgICAgICB3aW4ubURlc3Ryb3lpbmcgPSBmYWxzZTsKQEAgLTI4MDMsNyArMjgwMyw3IEBACiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBhcHBseUFuaW1hdGlvbkxvY2tlZCh3aW4sIHRyYW5zaXQsIGZhbHNlKSkgewogICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZvY3VzTWF5Q2hhbmdlID0gdHJ1ZTsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICB3aW4ubUV4aXRpbmcgPSB0cnVlOwotICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIGlmICh3aW4uaXNBbmltYXRpbmcoKSkgeworICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIGlmICh3aW4ubVdpbkFuaW1hdG9yLmlzQW5pbWF0aW5nKCkpIHsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyBDdXJyZW50bHkgaW4gYSBoaWRlIGFuaW1hdGlvbi4uLiB0dXJuIHRoaXMgaW50bwogICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vIGFuIGV4aXQuCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgd2luLm1FeGl0aW5nID0gdHJ1ZTsKQEAgLTI4MTIsNyArMjgxMiw3IEBACiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gd2luZG93LCB3ZSBuZWVkIHRvIGNoYW5nZSBib3RoIG9mIHRoZW0gaW5zaWRlCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gb2YgYSB0cmFuc2FjdGlvbiB0byBhdm9pZCBhcnRpZmFjdHMuCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgd2luLm1FeGl0aW5nID0gdHJ1ZTsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICB3aW4ubUFuaW1hdGluZyA9IHRydWU7CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgd2luLm1XaW5BbmltYXRvci5tQW5pbWF0aW5nID0gdHJ1ZTsKICAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKG1JbnB1dE1ldGhvZFdpbmRvdyA9PSB3aW4pIHsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbUlucHV0TWV0aG9kV2luZG93ID0gbnVsbDsKQEAgLTMwMjYsNyArMzAyNiw4IEBACiAgICAgICovCiAgICAgYm9vbGVhbiBhcHBseUFuaW1hdGlvbkxvY2tlZChXaW5kb3dTdGF0ZSB3aW4sCiAgICAgICAgICAgICBpbnQgdHJhbnNpdCwgYm9vbGVhbiBpc0VudHJhbmNlKSB7Ci0gICAgICAgIGlmICh3aW4ubUxvY2FsQW5pbWF0aW5nICYmIHdpbi5tQW5pbWF0aW9uSXNFbnRyYW5jZSA9PSBpc0VudHJhbmNlKSB7CisgICAgICAgIGlmICh3aW4ubVdpbkFuaW1hdG9yLm1Mb2NhbEFuaW1hdGluZyAmJgorICAgICAgICAgICAgICAgIHdpbi5tV2luQW5pbWF0b3IubUFuaW1hdGlvbklzRW50cmFuY2UgPT0gaXNFbnRyYW5jZSkgewogICAgICAgICAgICAgLy8gSWYgd2UgYXJlIHRyeWluZyB0byBhcHBseSBhbiBhbmltYXRpb24sIGJ1dCBhbHJlYWR5IHJ1bm5pbmcKICAgICAgICAgICAgIC8vIGFuIGFuaW1hdGlvbiBvZiB0aGUgc2FtZSB0eXBlLCB0aGVuIGp1c3QgbGVhdmUgdGhhdCBvbmUgYWxvbmUuCiAgICAgICAgICAgICByZXR1cm4gdHJ1ZTsKQEAgLTMwNjMsNyArMzA2NCw3IEBACiAgICAgICAgICAgICB9CiAgICAgICAgICAgICBpZiAoREVCVUdfQU5JTSkgU2xvZy52KFRBRywgImFwcGx5QW5pbWF0aW9uOiB3aW49IiArIHdpbgogICAgICAgICAgICAgICAgICAgICArICIgYW5pbT0iICsgYW5pbSArICIgYXR0cj0weCIgKyBJbnRlZ2VyLnRvSGV4U3RyaW5nKGF0dHIpCi0gICAgICAgICAgICAgICAgICAgICsgIiBtQW5pbWF0aW9uPSIgKyB3aW4ubUFuaW1hdGlvbgorICAgICAgICAgICAgICAgICAgICArICIgbUFuaW1hdGlvbj0iICsgd2luLm1XaW5BbmltYXRvci5tQW5pbWF0aW9uCiAgICAgICAgICAgICAgICAgICAgICsgIiBpc0VudHJhbmNlPSIgKyBpc0VudHJhbmNlKTsKICAgICAgICAgICAgIGlmIChhICE9IG51bGwpIHsKICAgICAgICAgICAgICAgICBpZiAoREVCVUdfQU5JTSkgewpAQCAtMzA3NCwxNCArMzA3NSwxNCBAQAogICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgICAgIFNsb2cudihUQUcsICJMb2FkZWQgYW5pbWF0aW9uICIgKyBhICsgIiBmb3IgIiArIHdpbiwgZSk7CiAgICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgIHdpbi5zZXRBbmltYXRpb24oYSk7Ci0gICAgICAgICAgICAgICAgd2luLm1BbmltYXRpb25Jc0VudHJhbmNlID0gaXNFbnRyYW5jZTsKKyAgICAgICAgICAgICAgICB3aW4ubVdpbkFuaW1hdG9yLnNldEFuaW1hdGlvbihhKTsKKyAgICAgICAgICAgICAgICB3aW4ubVdpbkFuaW1hdG9yLm1BbmltYXRpb25Jc0VudHJhbmNlID0gaXNFbnRyYW5jZTsKICAgICAgICAgICAgIH0KICAgICAgICAgfSBlbHNlIHsKLSAgICAgICAgICAgIHdpbi5jbGVhckFuaW1hdGlvbigpOworICAgICAgICAgICAgd2luLm1XaW5BbmltYXRvci5jbGVhckFuaW1hdGlvbigpOwogICAgICAgICB9CiAKLSAgICAgICAgcmV0dXJuIHdpbi5tQW5pbWF0aW9uICE9IG51bGw7CisgICAgICAgIHJldHVybiB3aW4ubVdpbkFuaW1hdG9yLm1BbmltYXRpb24gIT0gbnVsbDsKICAgICB9CiAKICAgICBwcml2YXRlIEFuaW1hdGlvbiBsb2FkQW5pbWF0aW9uKFdpbmRvd01hbmFnZXIuTGF5b3V0UGFyYW1zIGxwLCBpbnQgYW5pbUF0dHIpIHsKQEAgLTMzNzAsNyArMzM3MSw3IEBACiAgICAgICAgICAgICAgICAgICAgIGZvciAoaW50IGk9MDsgaTxOOyBpKyspIHsKICAgICAgICAgICAgICAgICAgICAgICAgIFdpbmRvd1N0YXRlIHdpbiA9IHd0b2tlbi53aW5kb3dzLmdldChpKTsKIAotICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHdpbi5pc0FuaW1hdGluZygpKSB7CisgICAgICAgICAgICAgICAgICAgICAgICBpZiAod2luLm1XaW5BbmltYXRvci5pc0FuaW1hdGluZygpKSB7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZGVsYXllZCA9IHRydWU7CiAgICAgICAgICAgICAgICAgICAgICAgICB9CiAKQEAgLTQwNjMsNyArNDA2NCw3IEBACiAgICAgICAgICAgICAgICAgICAgIGNvbnRpbnVlOwogICAgICAgICAgICAgICAgIH0KIAotICAgICAgICAgICAgICAgIGlmICh3aW4uaXNBbmltYXRpbmcoKSkgeworICAgICAgICAgICAgICAgIGlmICh3aW4ubVdpbkFuaW1hdG9yLmlzQW5pbWF0aW5nKCkpIHsKICAgICAgICAgICAgICAgICAgICAgZGVsYXllZCA9IHRydWU7CiAgICAgICAgICAgICAgICAgfQogCkBAIC04MDk5LDExICs4MTAwLDExIEBACiAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoREVCVUdfRk9DVVMpIFNsb2cuaShUQUcsICJ3aW49IiArIHcgKyAiIGZvcmNlIGhpZGVzIG90aGVyIHdpbmRvd3MiKTsKICAgICAgICAgICAgICAgICAgICAgICAgIG1BbmltYXRvci5tRm9yY2VIaWRpbmcgPSB0cnVlOwogICAgICAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKG1Qb2xpY3kuY2FuQmVGb3JjZUhpZGRlbih3LCBhdHRycykpIHsKLSAgICAgICAgICAgICAgICAgICAgICAgIGlmICghdy5tQW5pbWF0aW5nKSB7CisgICAgICAgICAgICAgICAgICAgICAgICBpZiAoIXcubVdpbkFuaW1hdG9yLm1BbmltYXRpbmcpIHsKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyBXZSBzZXQgdGhlIGFuaW1hdGlvbiBhYm92ZSBzbyBpdAogICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vIGlzIG5vdCB5ZXQgcnVubmluZy4KICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyBUT0RPKGNtYXV0bmVyKTogV2UgbG9zZSB0aGUgZW50ZXIgYW5pbWF0aW9uIHdoZW4gdGhpcyBvY2N1cnMuCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgdy5jbGVhckFuaW1hdGlvbigpOworICAgICAgICAgICAgICAgICAgICAgICAgICAgIHcubVdpbkFuaW1hdG9yLmNsZWFyQW5pbWF0aW9uKCk7CiAgICAgICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICB9CkBAIC05NzcwLDcgKzk3NzEsNyBAQAogICAgIHB1YmxpYyBpbnRlcmZhY2UgT25IYXJkS2V5Ym9hcmRTdGF0dXNDaGFuZ2VMaXN0ZW5lciB7CiAgICAgICAgIHB1YmxpYyB2b2lkIG9uSGFyZEtleWJvYXJkU3RhdHVzQ2hhbmdlKGJvb2xlYW4gYXZhaWxhYmxlLCBib29sZWFuIGVuYWJsZWQpOwogICAgIH0KLSAgICAKKwogICAgIHZvaWQgZGVidWdMYXlvdXRSZXBlYXRzKGZpbmFsIFN0cmluZyBtc2cpIHsKICAgICAgICAgaWYgKG1MYXlvdXRSZXBlYXRDb3VudCA+PSBMQVlPVVRfUkVQRUFUX1RIUkVTSE9MRCkgewogICAgICAgICAgICAgU2xvZy52KFRBRywgIkxheW91dHMgbG9vcGluZzogIiArIG1zZyk7CmR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yBzaG93aW5nIGEgd2FsbHBhcGVyOiB0aGUgcmVxdWVzdGVkIG9mZnNldCBmb3IgdGhlCiAgICAgLy8gd2FsbHBhcGVyOyBpZiBhIHdhbGxwYXBlciB3aW5kb3c6IHRoZSBjdXJyZW50bHkgYXBwbGllZCBvZmZzZXQuCiAgICAgZmxvYXQgbVdhbGxwYXBlclggPSAtMTsKQEAgLTMwNSw2ICsyOTQsOCBAQAogICAgIGludCBtQW5pbUR3OwogICAgIGludCBtQW5pbURoOwogCisgICAgZmluYWwgV2luZG93U3RhdGVBbmltYXRvciBtV2luQW5pbWF0b3I7CisKICAgICBXaW5kb3dTdGF0ZShXaW5kb3dNYW5hZ2VyU2VydmljZSBzZXJ2aWNlLCBTZXNzaW9uIHMsIElXaW5kb3cgYywgV2luZG93VG9rZW4gdG9rZW4sCiAgICAgICAgICAgIFdpbmRvd1N0YXRlIGF0dGFjaGVkV2luZG93LCBpbnQgc2VxLCBXaW5kb3dNYW5hZ2VyLkxheW91dFBhcmFtcyBhLAogICAgICAgICAgICBpbnQgdmlld1Zpc2liaWxpdHkpIHsKQEAgLTMzMyw2ICszMjQsNyBAQAogICAgICAgICAgICAgbUJhc2VMYXllciA9IDA7CiAgICAgICAgICAgICBtU3ViTGF5ZXIgPSAwOwogICAgICAgICAgICAgbUlucHV0V2luZG93SGFuZGxlID0gbnVsbDsKKyAgICAgICAgICAgIG1XaW5BbmltYXRvciA9IG51bGw7CiAgICAgICAgICAgICByZXR1cm47CiAgICAgICAgIH0KICAgICAgICAgbURlYXRoUmVjaXBpZW50ID0gZGVhdGhSZWNpcGllbnQ7CkBAIC0zNjksOSArMzYxLDExIEBACiAgICAgICAgICAgICBtSXNGbG9hdGluZ0xheWVyID0gbUlzSW1XaW5kb3cgfHwgbUlzV2FsbHBhcGVyOwogICAgICAgICB9CiAKKyAgICAgICAgbVdpbkFuaW1hdG9yID0gbmV3IFdpbmRvd1N0YXRlQW5pbWF0b3Ioc2VydmljZSwgdGhpcywgbUF0d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gICAgICAgIHJldHVybiBtQ29udGVudEZyYW1lOwogICAgIH0KIAorICAgIEBPdmVycmlkZQogICAgIHB1YmxpYyBSZWN0IGdldFZpc2libGVGcmFtZUx3KCkgewogICAgICAgICByZXR1cm4gbVZpc2libGVGcmFtZTsKICAgICB9CiAKKyAgICBAT3ZlcnJpZGUKICAgICBwdWJsaWMgYm9vbGVhbiBnZXRHaXZlbkluc2V0c1BlbmRpbmdMdygpIHsKICAgICAgICAgcmV0dXJuIG1HaXZlbkluc2V0c1BlbmRpbmc7CiAgICAgfQogCisgICAgQE92ZXJyaWRlCiAgICAgcHVibGljIFJlY3QgZ2V0R2l2ZW5Db250ZW50SW5zZXRzTHcoKSB7CiAgICAgICAgIHJldHVybiBtR2l2ZW5Db250ZW50SW5zZXRzOwogICAgIH0KIAorICAgIEBPdmVycmlkZQogICAgIHB1YmxpYyBSZWN0IGdldEdpdmVuVmlzaWJsZUluc2V0c0x3KCkgewogICAgICAgICByZXR1cm4gbUdpdmVuVmlzaWJsZUluc2V0czsKICAgICB9CiAKKyAgICBAT3ZlcnJpZGUKICAgICBwdWJsaWMgV2luZG93TWFuYWdlci5MYXlvdXRQYXJhbXMgZ2V0QXR0cnMoKSB7CiAgICAgICAgIHJldHVybiBtQXR0cnM7CiAgICAgfQpAQCAtNjMyLDQxICs2MzYsNiBAQAogICAgICAgICByZXR1cm4gbUFwcFRva2VuICE9IG51bGwgPyBtQXBwVG9rZW4uZmlyc3RXaW5kb3dEcmF3biA6IGZhbHNlOwogICAgIH0KIAotICAgIHB1YmxpYyB2b2lkIHNldEFuaW1hdGlvbihBbmltYXRpb24gYW5pbSkgewotICAgICAgICBpZiAoV2luZG93TWFuYWdlclNlcnZpY2UubG9jYWxMT0dWKSBTbG9nLnYoCi0gICAgICAgICAgICBXaW5kb3dNYW5hZ2VyU2VydmljZS5UQUcsICJTZXR0aW5nIGFuaW1hdGlvbiBpbiAiICsgdGhpcyArICI6ICIgKyBhbmltKTsKLSAgICAgICAgbUFu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gotICAgIHZvaWQgY2FuY2VsRXhpdEFuaW1hdGlvbkZvck5leHRBbmltYXRpb25Mb2NrZWQoKSB7Ci0gICAgICAgIGlmICghbUV4aXRpbmcpIHJldHVybjsKLSAgICAgICAgaWYgKG1BbmltYXRpb24gIT0gbnVsbCkgewotICAgICAgICAgICAgbUFuaW1hdGlvbi5jYW5jZWwoKTsKLSAgICAgICAgICAgIG1BbmltYXRpb24gPSBudWxsOwotICAgICAgICAgICAgZGVzdHJveVN1cmZhY2VMb2NrZWQoKTsKLSAgICAgICAgfQotICAgICAgICBtRXhpdGluZyA9IGZhbHNlOwotICAgIH0KLQogICAgIFN1cmZhY2UgY3JlYXRlU3VyZmFjZUxvY2tlZCgpIHsKICAgICAgICAgaWYgKG1TdXJmYWNlID09IG51bGwpIHsKICAgICAgICAgICAgIG1SZXBvcnREZXN0cm95U3VyZmFjZSA9IGZhbHNlOwpAQCAtOTMxLDcgKzkwMCw3IEBACiAgICAgICAgICAgICAgICAgICAgICsgKG1BcHBUb2tlbiAhPSBudWxsID8gbUFwcFRva2VuLmhpZGRlblJlcXVlc3RlZCA6IGZhbHNlKQogICAgICAgICAgICAgICAgICAgICArICIgdG9rLmhpZGRlbj0iCiAgICAgICAgICAgICAgICAgICAgICsgKG1BcHBUb2tlbiAhPSBudWxsID8gbUFwcFRva2VuLmhpZGRlbiA6IGZhbHNlKQotICAgICAgICAgICAgICAgICAgICArICIgYW5pbWF0aW5nPSIgKyBtQW5pbWF0aW5nCisgICAgICAgICAgICAgICAgICAgICsgIiBhbmltYXRpbmc9IiArIG1XaW5BbmltYXRvci5tQW5pbWF0aW5nCiAgICAgICAgICAgICAgICAgICAgICsgIiB0b2sgYW5pbWF0aW5nPSIKICAgICAgICAgICAgICAgICAgICAgKyAobUFwcFRva2VuICE9IG51bGwgPyBtQXBwVG9rZW4uYW5pbWF0aW5nIDogZmFsc2UpKTsKICAgICAgICAgICAgIGlmICghbVNlcnZpY2Uuc2hvd1N1cmZhY2VSb2J1c3RseUxvY2tlZCh0aGlzKSkgewpAQCAtOTc4LDExICs5NDcsMTEgQEAKICAgICAgICAgICAgICAgICAgICAgLy8gd2lsbCBkbyBhbiBhbmltYXRpb24gdG8gcmV2ZWFsIGl0IGZyb20gYmVoaW5kIHRoZQogICAgICAgICAgICAgICAgICAgICAvLyBzdGFydGluZyB3aW5kb3csIHNvIHRoZXJlIGlzIG5vIG5lZWQgZm9yIGl0IHRvIGFsc28KICAgICAgICAgICAgICAgICAgICAgLy8gYmUgZG9pbmcgaXRzIG93biBzdHVmZi4KLSAgICAgICAgICAgICAgICAgICAgaWYgKG1BbmltYXRpb24gIT0gbnVsbCkgewotICAgICAgICAgICAgICAgICAgICAgICAgbUFuaW1hdGlvbi5jYW5jZWwoKTsKLSAgICAgICAgICAgICAgICAgICAgICAgIG1BbmltYXRpb24gPSBudWxsOworICAgICAgICAgICAgICAgICAgICBpZiAobVdpbkFuaW1hdG9yLm1BbmltYXRpb24gIT0gbnVsbCkgeworICAgICAgICAgICAgICAgICAgICAgICAgbVdpbkFuaW1hdG9yLm1BbmltYXRpb24uY2FuY2VsKCk7CisgICAgICAgICAgICAgICAgICAgICAgICBtV2luQW5pbWF0b3IubUFuaW1hdGlvbiA9IG51bGw7CiAgICAgICAgICAgICAgICAgICAgICAgICAvLyBNYWtlIHN1cmUgd2UgY2xlYW4gdXAgdGhlIGFuaW1hdGlvbi4KLSAgICAgICAgICAgICAgICAgICAgICAgIG1BbmltYXRpbmcgPSB0cnVlOworICAgICAgICAgICAgICAgICAgICAgICAgbVdpbkFuaW1hdG9yLm1BbmltYXRpbmcgPSB0cnVlOwogICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgICAgIG1TZXJ2aWNlLm1GaW5pc2hlZFN0YXJ0aW5nLmFkZChtQXBwVG9rZW4pOwogICAgICAgICAgICAgICAgICAgICBtU2VydmljZS5tSC5zZW5kRW1wdHlNZXNzYWdlKEguRklOSVNIRURfU1RBUlRJTkcpOwpAQCAtO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WQgb3IganVzdCBzdG9wcGVkIGFuaW1hdGluZyBieSBjb21wYXJpbmcgbVdhc0FuaW1hdGluZyB3aXRoIGlzQW5pbWF0aW5nKCkuCi0gICAgICAgIG1XYXNBbmltYXRpbmcgPSBtQW5pbWF0aW5nOwotICAgICAgICBpZiAobVNlcnZpY2Uub2tUb0Rpc3BsYXkoKSkgewotICAgICAgICAgICAgLy8gV2Ugd2lsbCBydW4gYW5pbWF0aW9ucyBhcyBsb25nIGFzIHRoZSBkaXNwbGF5IGlzbid0IGZyb3plbi4KLQotICAgICAgICAgICAgaWYgKGlzRHJhd25MdygpICYmIG1BbmltYXRpb24gIT0gbnVsbCkgewotICAgICAgICAgICAgICAgIG1IYXNUcmFuc2Zvcm1hdGlvbiA9IHRydWU7Ci0gICAgICAgICAgICAgICAgbUhhc0xvY2FsVHJhbnNmb3JtYXRpb24gPSB0cnVlOwotICAgICAgICAgICAgICAgIGlmICghbUxvY2FsQW5pbWF0aW5nKSB7Ci0gICAgICAgICAgICAgICAgICAgIGlmIChXaW5kb3dNYW5hZ2VyU2VydmljZS5ERUJVR19BTklNKSBTbG9nLnYoCi0gICAgICAgICAgICAgICAgICAgICAgICBXaW5kb3dNYW5hZ2VyU2VydmljZS5UQUcsICJTdGFydGluZyBhbmltYXRpb24gaW4gIiArIHRoaXMgKwotICAgICAgICAgICAgICAgICAgICAgICAgIiBAICIgKyBjdXJyZW50VGltZSArICI6IHd3PSIgKyBtRnJhbWUud2lkdGgoKSArCi0gICAgICAgICAgICAgICAgICAgICAgICAiIHdoPSIgKyBtRnJhbWUuaGVpZ2h0KCkgKwotICAgICAgICAgICAgICAgICAgICAgICAgIiBkdz0iICsgbUFuaW1EdyArICIgZGg9IiArIG1BbmltRGggKwotICAgICAgICAgICAgICAgICAgICAgICAgIiBzY2FsZT0iICsgbVNlcnZpY2UubVdpbmRvd0FuaW1hdGlvblNjYWxlKTsKLSAgICAgICAgICAgICAgICAgICAgbUFuaW1hdGlvbi5pbml0aWFsaXplKG1GcmFtZS53aWR0aCgpLCBtRnJhbWUuaGVpZ2h0KCksIG1BbmltRHcsIG1BbmltRGgpOwotICAgICAgICAgICAgICAgICAgICBtQW5pbWF0aW9uLnNldFN0YXJ0VGltZShjdXJyZW50VGltZSk7Ci0gICAgICAgICAgICAgICAgICAgIG1Mb2NhbEFuaW1hdGluZyA9IHRydWU7Ci0gICAgICAgICAgICAgICAgICAgIG1BbmltYXRpbmcgPSB0cnVlOwotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICBpZiAoKG1BbmltYXRpb24gIT0gbnVsbCkgJiYgbUxvY2FsQW5pbWF0aW5nKSB7Ci0gICAgICAgICAgICAgICAgICAgIGlmIChzdGVwQW5pbWF0aW9uKGN1cnJlbnRUaW1lKSkgewotICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHRydWU7Ci0gICAgICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgaWYgKFdpbmRvd01hbmFnZXJTZXJ2aWNlLkRFQlVHX0FOSU0pIFNsb2cudigKLSAgICAgICAgICAgICAgICAgICAgV2luZG93TWFuYWdlclNlcnZpY2UuVEFHLCAiRmluaXNoZWQgYW5pbWF0aW9uIGluICIgKyB0aGlzICsKLSAgICAgICAgICAgICAgICAgICAgIiBAICIgKyBjdXJyZW50VGltZSk7Ci0gICAgICAgICAgICAgICAgLy9XaW5kb3dNYW5hZ2VyU2VydmljZS50aGlzLmR1bXAoKTsKLSAgICAgICAgICAgIH0KLSAgICAgICAgICAgIG1IYXNMb2NhbFRyYW5zZm9ybWF0aW9uID0gZmFsc2U7Ci0gICAgICAgICAgICBpZiAoKCFtTG9jYWxBbmltYXRpbmcgfHwgbUFuaW1hdGlvbklzRW50cmFuY2UpICYmIG1BcHBUb2tlbiAhPSBudWxsCi0gICAgICAgICAgICAgICAgICAgICYmIG1BcHBUb2tlbi5hbmltYXRpb24gIT0gbnVsbCkgewotICAgICAgICAgICAgICA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bmcgPSB0cnVlOwotICAgICAgICAgICAgfSBlbHNlIGlmIChpc0FuaW1hdGluZygpKSB7Ci0gICAgICAgICAgICAgICAgbUFuaW1hdGluZyA9IHRydWU7Ci0gICAgICAgICAgICB9Ci0gICAgICAgIH0gZWxzZSBpZiAobUFuaW1hdGlvbiAhPSBudWxsKSB7Ci0gICAgICAgICAgICAvLyBJZiB0aGUgZGlzcGxheSBpcyBmcm96ZW4sIGFuZCB0aGVyZSBpcyBhIHBlbmRpbmcgYW5pbWF0aW9uLAotICAgICAgICAgICAgLy8gY2xlYXIgaXQgYW5kIG1ha2Ugc3VyZSB3ZSBydW4gdGhlIGNsZWFudXAgY29kZS4KLSAgICAgICAgICAgIG1BbmltYXRpbmcgPSB0cnVlOwotICAgICAgICAgICAgbUxvY2FsQW5pbWF0aW5nID0gdHJ1ZTsKLSAgICAgICAgICAgIG1BbmltYXRpb24uY2FuY2VsKCk7Ci0gICAgICAgICAgICBtQW5pbWF0aW9uID0gbnVsbDsKLSAgICAgICAgfQotCi0gICAgICAgIGlmICghbUFuaW1hdGluZyAmJiAhbUxvY2FsQW5pbWF0aW5nKSB7Ci0gICAgICAgICAgICByZXR1cm4gZmFsc2U7Ci0gICAgICAgIH0KLQotICAgICAgICBpZiAoV2luZG93TWFuYWdlclNlcnZpY2UuREVCVUdfQU5JTSkgU2xvZy52KAotICAgICAgICAgICAgV2luZG93TWFuYWdlclNlcnZpY2UuVEFHLCAiQW5pbWF0aW9uIGRvbmUgaW4gIiArIHRoaXMgKyAiOiBleGl0aW5nPSIgKyBtRXhpdGluZwotICAgICAgICAgICAgKyAiLCByZXBvcnRlZFZpc2libGU9IgotICAgICAgICAgICAgKyAobUFwcFRva2VuICE9IG51bGwgPyBtQXBwVG9rZW4ucmVwb3J0ZWRWaXNpYmxlIDogZmFsc2UpKTsKLQotICAgICAgICBtQW5pbWF0aW5nID0gZmFsc2U7Ci0gICAgICAgIG1Mb2NhbEFuaW1hdGluZyA9IGZhbHNlOwotICAgICAgICBpZiAobUFuaW1hdGlvbiAhPSBudWxsKSB7Ci0gICAgICAgICAgICBtQW5pbWF0aW9uLmNhbmNlbCgpOwotICAgICAgICAgICAgbUFuaW1hdGlvbiA9IG51bGw7Ci0gICAgICAgIH0KLSAgICAgICAgaWYgKG1TZXJ2aWNlLm1XaW5kb3dEZXRhY2hlZFdhbGxwYXBlciA9PSB0aGlzKSB7Ci0gICAgICAgICAgICBtU2VydmljZS5tV2luZG93RGV0YWNoZWRXYWxscGFwZXIgPSBudWxsOwotICAgICAgICB9Ci0gICAgICAgIG1BbmltTGF5ZXIgPSBtTGF5ZXI7Ci0gICAgICAgIGlmIChtSXNJbVdpbmRvdykgewotICAgICAgICAgICAgbUFuaW1MYXllciArPSBtU2VydmljZS5tSW5wdXRNZXRob2RBbmltTGF5ZXJBZGp1c3RtZW50OwotICAgICAgICB9IGVsc2UgaWYgKG1Jc1dhbGxwYXBlcikgewotICAgICAgICAgICAgbUFuaW1MYXllciArPSBtU2VydmljZS5tV2FsbHBhcGVyQW5pbUxheWVyQWRqdXN0bWVudDsKLSAgICAgICAgfQotICAgICAgICBpZiAoV2luZG93TWFuYWdlclNlcnZpY2UuREVCVUdfTEFZRVJTKSBTbG9nLnYoV2luZG93TWFuYWdlclNlcnZpY2UuVEFHLCAiU3RlcHBpbmcgd2luICIgKyB0aGlzCi0gICAgICAgICAgICAgICAgKyAiIGFuaW0gbGF5ZXI6ICIgKyBtQW5pbUxheWVyKTsKLSAgICAgICAgbUhhc1RyYW5zZm9ybWF0aW9uID0gZmFsc2U7Ci0gICAgICAgIG1IYXNMb2NhbFRyYW5zZm9ybWF0aW9uID0gZmFsc2U7Ci0gICAgICAgIGlmIChtUG9saWN5VmlzaWJpbGl0eSAhPSBtUG9saWN5VmlzaWJpbGl0eUFmdGVyQW5pbSkgewotICAgICAgICAgICAgaWYgKERFQlVHX1ZJU0lCSUxJVFkpIHsKLSAgICAgICAgICAgICAgICBTbG9nLnYoV2luZG93TWFuYWdlclNlcn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IHsKLSAgICAgICAgaWYgKFdpbmRvd01hbmFnZXJTZXJ2aWNlLkRFQlVHX0FOSU0pIFNsb2cudigKLSAgICAgICAgICAgICAgICBXaW5kb3dNYW5hZ2VyU2VydmljZS5UQUcsICJmaW5pc2hFeGl0IGluICIgKyB0aGlzCi0gICAgICAgICAgICAgICAgKyAiOiBleGl0aW5nPSIgKyBtRXhpdGluZwotICAgICAgICAgICAgICAgICsgIiByZW1vdmU9IiArIG1SZW1vdmVPbkV4aXQKLSAgICAgICAgICAgICAgICArICIgd2luZG93QW5pbWF0aW5nPSIgKyBpc1dpbmRvd0FuaW1hdGluZygpKTsKLQotICAgICAgICBmaW5hbCBpbnQgTiA9IG1DaGlsZFdpbmRvd3Muc2l6ZSgpOwotICAgICAgICBmb3IgKGludCBpPTA7IGk8TjsgaSsrKSB7Ci0gICAgICAgICAgICBtQ2hpbGRXaW5kb3dzLmdldChpKS5maW5pc2hFeGl0KCk7Ci0gICAgICAgIH0KLQotICAgICAgICBpZiAoIW1FeGl0aW5nKSB7Ci0gICAgICAgICAgICByZXR1cm47Ci0gICAgICAgIH0KLQotICAgICAgICBpZiAoaXNXaW5kb3dBbmltYXRpbmcoKSkgewotICAgICAgICAgICAgcmV0dXJuOwotICAgICAgICB9Ci0KLSAgICAgICAgaWYgKFdpbmRvd01hbmFnZXJTZXJ2aWNlLmxvY2FsTE9HVikgU2xvZy52KAotICAgICAgICAgICAgICAgIFdpbmRvd01hbmFnZXJTZXJ2aWNlLlRBRywgIkV4aXQgYW5pbWF0aW9uIGZpbmlzaGVkIGluICIgKyB0aGlzCi0gICAgICAgICAgICAgICAgKyAiOiByZW1vdmU9IiArIG1SZW1vdmVPbkV4aXQpOwotICAgICAgICBpZiAobVN1cmZhY2UgIT0gbnVsbCkgewotICAgICAgICAgICAgbVNlcnZpY2UubURlc3Ryb3lTdXJmYWNlLmFkZCh0aGlzKTsKLSAgICAgICAgICAgIG1EZXN0cm95aW5nID0gdHJ1ZTsKLSAgICAgICAg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ICJXUCB0YXJnZXQgYXR0YWNoZWQgeGZvcm06ICIgKyBhdHRhY2hlZFRyYW5zZm9ybWF0aW9uKTsKICAgICAgICAgICAgICAgICB9CkBAIC0xMjYwLDcgKzEwNDMsNyBAQAogICAgICAgICAgICAgfQogICAgICAgICAgICAgdG1wTWF0cml4LnBvc3RTY2FsZShtR2xvYmFsU2NhbGUsIG1HbG9iYWxTY2FsZSk7CiAgICAgICAgICAgICBpZiAoc2VsZlRyYW5zZm9ybWF0aW9uKSB7Ci0gICAgICAgICAgICAgICAgdG1wTWF0cml4LnBvc3RDb25jYXQobVRyYW5zZm9ybWF0aW9uLmdldE1hdHJpeCgpKTsKKyAgICAgICAgICAgICAgICB0bXBNYXRyaXgucG9zdENvbmNhdChtV2luQW5pbWF0b3IubVRyYW5zZm9ybWF0aW9uLmdldE1hdHJpeCgpKTsKICAgICAgICAgICAgIH0KICAgICAgICAgICAgIHRtcE1hdHJpeC5wb3N0VHJhbnNsYXRlKGZyYW1lLmxlZnQgKyBtWE9mZnNldCwgZnJhbWUudG9wICsgbVlPZmZzZXQpOwogICAgICAgICAgICAgaWYgKGF0dGFjaGVkVHJhbnNmb3JtYXRpb24gIT0gbnVsbCkgewpAQCAtMTMwNCw3ICsxMDg3LDcgQEAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiB4ID09IGZyYW1lLmxlZnQgJiYgeSA9PSBmcmFtZS50b3ApKSkgewogICAgICAgICAgICAgICAgIC8vU2xvZy5pKFRBRywgIkFwcGx5aW5nIGFscGhhIHRyYW5zZm9ybSIpOwogICAgICAgICAgICAgICAgIGlmIChzZWxmVHJhbnNmb3JtYXRpb24pIHsKLSAgICAgICAgICAgICAgICAgICAgbVNob3duQWxwaGEgKj0gbVRyYW5zZm9ybWF0aW9uLmdldEFscGhhKCk7CisgICAgICAgICAgICAgICAgICAgIG1TaG93bkFscGhhICo9IG1XaW5BbmltYXRvci5tVHJhbnNmb3JtYXRpb24uZ2V0QWxwaGEoKTsKICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgaWYgKGF0dGFjaGVkVHJhbnNmb3JtYXRpb24gIT0gbnVsbCkgewogICAgICAgICAgICAgICAgICAgICBtU2hvd25BbHBoYSAqPSBhdHRhY2hlZFRyYW5zZm9ybWF0aW9uLmdldEFscGhhKCk7CkBAIC0xMzIzLDcgKzExMDYsNyBAQAogICAgICAgICAgICAgaWYgKFdpbmRvd01hbmFnZXJTZXJ2aWNlLmxvY2FsTE9HVikgU2xvZy52KAogICAgICAgICAgICAgICAgIFdpbmRvd01hbmFnZXJTZXJ2aWNlLlRBRywgImNvbXB1dGVTaG93bkZyYW1lTG9ja2VkOiBBbmltYXRpbmcgIiArIHRoaXMgKwogICAgICAgICAgICAgICAgICI6ICIgKyBtU2hvd25GcmFtZSArCi0gICAgICAgICAgICAgICAgIiwgYWxwaGE9IiArIG1UcmFuc2Zvcm1hdGlvbi5nZXRBbHBoYSgpICsgIiwgbVNob3duQWxwaGE9IiArIG1TaG93bkFscGhhKTsKKyAgICAgICAgICAgICAgICAiLCBhbHBoYT0iICsgbVdpbkFuaW1hdG9yLm1UcmFuc2Zvcm1hdGlvbi5nZXRBbHBoYSgpICsgIiwgbVNob3duQWxwaGE9IiArIG1TaG93bkFscGhhKTsKICAgICAgICAgICAgIHJldHVybjsKICAgICAgICAgfQogCkBAIC0xMzc0LDcgKzExNTcsNyBAQAogICAgICAgICAgICAgICAgICYmIChhdG9rZW4gPT0gbnVsbCA/IG1Qb2xpY3lWaXNpYmlsaXR5IDogIWF0b2tlbi5oaWRkZW5SZXF1ZXN0ZWQpCiAgICAgICAgICAgICAgICAgJiYgKCghbUF0dGFjaGVkSGlkZGVuICYmIG1WaWV3VmlzaWJpbGl0eSA9PSBWaWV3LlZJU0lCTEUKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgIW1Sb290VG9rZW4uaGlkZGVuKQotICAgICAgICAgICAgICAgICAgICAgICAgfHwgbUFuaW1hdGlvbiAhPSBudWxsIHx8IGFuaW1hdGluZyk7CisgICAgICAgICAgICAgICAgICAgICAgICB8fCBtV2luQW5pbWF0b3IubUFuaW1hdGlvbiAhPSBudWxsIHx8IGFuaW1hdGluZyk7CiAgICAgfQogCiAgICAgLyoqCkBAIC0xNDMxLDEwICsxMjE0LDEwIEBACiAgICAgICAgIGlmIChhdG9rZW4gIT0gbnVsbCkgewogICAgICAgICAgICAgcmV0dXJuIG1TdXJmYWNlICE9IG51bGwgJiYgbVBvbGljeVZpc2liaWxpdHkgJiYgIW1EZXN0cm95aW5nCiAgICAgICAgICAgICAgICAgICAgICYmICgoIW1BdHRhY2hlZEhpZGRlbiAmJiAhYXRva2VuLmhpZGRlblJlcXVlc3RlZCkKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICB8fCBtQW5pbWF0aW9uICE9IG51bGwgfHwgYXRva2VuLmFuaW1hdGlvbiAhPSBudWxsKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICB8fCBtV2luQW5pbWF0b3IubUFuaW1hdGlvbiAhPSBudWxsIHx8IGF0b2tlbi5hbmltYXRpb24gIT0gbnVsbCk7CiAgICAgICAgIH0gZWxzZSB7CiAgICAgICAgICAgICByZXR1cm4gbVN1cmZhY2UgIT0gbnVsbCAmJiBtUG9saWN5VmlzaWJpbGl0eSAmJiAhbURlc3Ryb3lpbmcKLSAgICAgICAgICAgICAgICAgICAgJiYgKCFtQXR0YWNoZWRIaWRkZW4gfHwgbUFuaW1hdGlvbiAhPSBudWxsKTsKKyAgICAgICAgICAgICAgICAgICAgJiYgKCFtQXR0YWNoZWRIaWRkZW4gfHwgbVdpbkFuaW1hdG9yLm1BbmltYXRpb24gIT0gbnVsbCk7CiAgICAgICAgIH0KICAgICB9CiAKQEAgLTE0NTAsMjYgKzEyMzMsMTAgQEAKICAgICAgICAgcmV0dXJuIG1TdXJmYWNlICE9IG51bGwgJiYgbVBvbGljeVZpc2liaWxpdHkgJiYgIW1EZXN0cm95aW5nCiAgICAgICAgICAgICAgICAgJiYgKCghbUF0dGFjaGVkSGlkZGVuICYmIG1WaWV3VmlzaWJpbGl0eSA9PSBWaWV3LlZJU0lCTEUKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgIW1Sb290VG9rZW4uaGlkZGVuKQotICAgICAgICAgICAgICAgICAgICAgICAgfHwgbUFuaW1hdGlvbiAhPSBudWxsCisgICAgICAgICAgICAgICAgICAgICAgICB8fCBtV2luQW5pbWF0b3IubUFuaW1hdGlvbiAhPSBudWxsCiAgICAgICAgICAgICAgICAgICAgICAgICB8fCAoKG1BcHBUb2tlbiAhPSBudWxsKSAmJiAobUFwcFRva2VuLmFuaW1hdGlvbiAhPSBudWxsKSkpOwogICAgIH0KIAotICAgIC8qKiBJcyB0aGUgd2luZG93IG9yIGl0cyBjb250YWluZXIgY3VycmVudGx5IGFuaW1hdGluZz8gKi8KLSAgICBib29sZWFuIGlzQW5pbWF0aW5nKCkgewotICAgICAgICBmaW5hbCBXaW5kb3dTdGF0ZSBhdHRhY2hlZCA9IG1BdHRhY2hlZFdpbmRvdzsKLSAgICAgICAgZmluYWwgQXBwV2luZG93VG9rZW4gYXRva2VuID0gbUFwcFRva2VuOwotICAgICAgICByZXR1cm4gbUFuaW1hdGlvbiAhPSBudWxsCi0gICAgICAgICAgICAgICAgfHwgKGF0dGFjaGVkICE9IG51bGwgJiYgYXR0YWNoZWQubUFuaW1hdGlvbiAhPSBudWxsKQotICAgICAgICAgICAgICAgIHx8IChhdG9rZW4gIT0gbnVsbCAmJgotICAgICAgICAgICAgICAgICAgICAgICAgKGF0b2tlbi5hbmltYXRpb24gIT0gbnVsbAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8fCBhdG9rZW4uaW5QZW5kaW5nVHJhbnNhY3Rpb24pKTsKLSAgICB9Ci0KLSAgICAvKiogSXMgdGhpcyB3aW5kb3cgY3VycmVudGx5IGFuaW1hdGluZz8gKi8KLSAgICBib29sZWFuIGlzV2luZG93QW5pbWF0aW5nKCkgewotICAgICAgICByZXR1cm4gbUFuaW1hdGlvbiAhPSBudWxsOwotICAgIH0KLQogICAgIC8qKgogICAgICAqIExpa2UgaXNPblNjcmVlbiwgYnV0IHJldHVybnMgZmFsc2UgaWYgdGhlIHN1cmZhY2UgaGFzbid0IHlldAogICAgICAqIGJlZW4gZHJhd24uCkBAIC0xNDc5LDcgKzEyNDYsNyBAQAogICAgICAgICByZXR1cm4gaXNEcmF3bkx3KCkgJiYgbVBvbGljeVZpc2liaWxpdHkKICAgICAgICAgICAgICYmICgoIW1BdHRhY2hlZEhpZGRlbiAmJgogICAgICAgICAgICAgICAgICAgICAoYXRva2VuID09IG51bGwgfHwgIWF0b2tlbi5oaWRkZW5SZXF1ZXN0ZWQpKQotICAgICAgICAgICAgICAgICAgICB8fCBtQW5pbWF0aW5nKTsKKyAgICAgICAgICAgICAgICAgICAgfHwgbVdpbkFuaW1hdG9yLm1BbmltYXRpbmcpOwogICAgIH0KIAogICAgIHB1YmxpYyBib29sZWFuIGlzR29uZUZvckxheW91dEx3KCkgewpAQCAtMTUwOCw3ICsxMjc1LDcgQEAKICAgICBib29sZWFuIGlzT3BhcXVlRHJhd24oKSB7CiAgICAgICAgIHJldHVybiAobUF0dHJzLmZvcm1hdCA9PSBQaXhlbEZvcm1hdC5PUEFRVUUKICAgICAgICAgICAgICAgICAgICAgICAgIHx8IG1BdHRycy50eXBlID09IFRZUEVfV0FMTFBBUEVSKQotICAgICAgICAgICAgICAgICYmIGlzRHJhd25MdygpICYmIG1BbmltYXRpb24gPT0gbnVsbAorICAgICAgICAgICAgICAgICYmIGlzRHJhd25MdygpICYmIG1XaW5BbmltYXRvci5tQW5pbWF0aW9uID09IG51bGwKICAgICAgICAgICAgICAgICAmJiAobUFwcFRva2VuID09IG51bGwgfHwgbUFwcFRva2VuLmFuaW1hdGlvbiA9PSBudWxsKTsKICAgICB9CiAKQEAgLTE2MDcsMTAgKzEzNzQsMTAgQEAKICAgICAgICAgaWYgKERFQlVHX1ZJ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QogICAgICAgICBpZiAoZG9BbmltYXRpb24pIHsKICAgICAgICAgICAgIG1TZXJ2aWNlLmFwcGx5QW5pbWF0aW9uTG9ja2VkKHRoaXMsIFdpbmRvd01hbmFnZXJQb2xpY3kuVFJBTlNJVF9FWElULCBmYWxzZSk7Ci0gICAgICAgICAgICBpZiAobUFuaW1hdGlvbiA9PSBudWxsKSB7CisgICAgICAgICAgICBpZiAobVdpbkFuaW1hdG9yLm1BbmltYXRpb24gPT0gbnVsbCkgewogICAgICAgICAgICAgICAgIGRvQW5pbWF0aW9uID0gZmFsc2U7CiAgICAgICAgICAgICB9CiAgICAgICAgIH0KQEAgLTE4MjEsMjAgKzE1ODgsNyBAQAogICAgICAgICAgICAgICAgICAgICBwdy5wcmludCgiIGxhc3Q9Iik7IG1MYXN0VmlzaWJsZUluc2V0cy5wcmludFNob3J0U3RyaW5nKHB3KTsKICAgICAgICAgICAgICAgICAgICAgcHcucHJpbnRsbigpOwogICAgICAgICB9Ci0gICAgICAgIGlmIChtQW5pbWF0aW5nIHx8IG1Mb2NhbEFuaW1hdGluZyB8fCBtQW5pbWF0aW9uSXNFbnRyYW5jZQotICAgICAgICAgICAgICAgIHx8IG1BbmltYXRpb24gIT0gbnVsbCkgewotICAgICAgICAgICAgcHcucHJpbnQocHJlZml4KTsgcHcucHJpbnQoIm1BbmltYXRpbmc9Iik7IHB3LnByaW50KG1BbmltYXRpbmcpOwotICAgICAgICAgICAgICAgICAgICBwdy5wcmludCgiIG1Mb2NhbEFuaW1hdGluZz0iKTsgcHcucHJpbnQobUxvY2FsQW5pbWF0aW5nKTsKLSAgICAgICAgICAgICAgICAgICAgcHcucHJpbnQoIiBtQW5pbWF0aW9uSXNFbnRyYW5jZT0iKTsgcHcucHJpbnQobUFuaW1hdGlvbklzRW50cmFuY2UpOwotICAgICAgICAgICAgICAgICAgICBwdy5wcmludCgiIG1BbmltYXRpb249Iik7IHB3LnByaW50bG4obUFuaW1hdGlvbik7Ci0gICAgICAgIH0KLSA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IGJvb2xlYW4gbUhhc0xvY2FsVHJhbnNmb3JtYXRpb247CisgICAgZmluYWwgVHJhbnNmb3JtYXRpb24gbVRyYW5zZm9ybWF0aW9uID0gbmV3IFRyYW5zZm9ybWF0aW9uKCk7CisgICAgYm9vbGVhbiBtV2FzQW5pbWF0aW5nOyAgICAgIC8vIFdlcmUgd2UgYW5pbWF0aW5nIGdvaW5nIGludG8gdGhlIG1vc3QgcmVjZW50IGFuaW1hdGlvbiBzdGVwPworCisgICAgcHVibGljIFdpbmRvd1N0YXRlQW5pbWF0b3IoZmluYWwgV2luZG93TWFuYWdlclNlcnZpY2Ugc2VydmljZSwgZmluYWwgV2luZG93U3RhdGUgd2luLAorICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZpbmFsIFdpbmRvd1N0YXRlIGF0dGFjaGVkV2luZG93KSB7CisgICAgICAgIG1TZXJ2aWNlID0gc2VydmljZTsKKyAgICAgICAgbVdpbiA9IHdpbjsKKyAgICAgICAgbUF0dGFjaGVkV2luZG93ID0gYXR0YWNoZWRXaW5kb3c7CisgICAgfQorCisgICAgcHVibGljIHZvaWQgc2V0QW5pbWF0aW9uKEFuaW1hdGlvbiBhbmltKSB7CisgICAgICAgIGlmIChXaW5kb3dNYW5hZ2VyU2VydmljZS5sb2NhbExPR1YpIFNsb2cudigKKyAgICAgICAgICAgIFdpbmRvd01hbmFnZXJTZXJ2aWNlLlRBRywgIlNldHRpbmcgYW5pbWF0aW9uIGluICIgKyB0aGlzICsgIjogIiArIGFuaW0pOworICAgICAgICBtQW5pbWF0aW5nID0gZmFsc2U7CisgICAgICAgIG1Mb2NhbEFuaW1hdGluZyA9IGZhbHNlOworICAgICAgICBtQW5pbWF0aW9uID0gYW5pbTsKKyAgICAgICAgbUFuaW1hdGlvbi5yZXN0cmljdER1cmF0aW9uKFdpbmRvd01hbmFnZXJTZXJ2aWNlLk1BWF9BTklNQVRJT05fRFVSQVRJT04pOworICAgICAgICBtQW5pbWF0aW9uLnNjYWxlQ3VycmVudER1cmF0aW9uKG1TZXJ2aWNlLm1XaW5kb3dBbmltYXRpb25TY2FsZSk7CisgICAgICAgIC8vIFN0YXJ0IG91dCBhbmltYXRpb24gZ29uZSBpZiB3aW5kb3cgaXMgZ29uZSwgb3IgdmlzaWJsZSBpZiB3aW5kb3cgaXMgdmlzaWJsZS4KKyAgICAgICAgbVRyYW5zZm9ybWF0aW9uLmNsZWFyKCk7CisgICAgICAgIG1UcmFuc2Zvcm1hdGlvbi5zZXRBbHBoYShtV2luLm1MYXN0SGlkZGVuID8gMCA6IDEpOworICAgICAgICBtSGFzTG9jYWxUcmFuc2Zvcm1hdGlvbiA9IHRydWU7CisgICAgfQorCisgICAgcHVibGljIHZvaWQgY2xlYXJBbmltYXRpb24oKSB7CisgICAgICAgIGlmIChtQW5pbWF0aW9uICE9IG51bGwpIHsKKyAgICAgICAgICAgIG1BbmltYXRpbmcgPSB0cnVlOworICAgICAgICAgICAgbUxvY2FsQW5pbWF0aW5nID0gZmFsc2U7CisgICAgICAgICAgICBtQW5pbWF0aW9uLmNhbmNlbCgpOworICAgICAgICAgICAgbUFuaW1hdGlvbiA9IG51bGw7CisgICAgICAgIH0KKyAgICB9CisKKyAgICAvKiogSXMgdGhlIHdpbmRvdyBvciBpdHMgY29udGFpbmVyIGN1cnJlbnRseSBhbmltYXRpbmc/ICovCisgICAgYm9vbGVhbiBpc0FuaW1hdGluZygpIHsKKyAgICAgICAgZmluYWwgV2luZG93U3RhdGUgYXR0YWNoZWQgPSBtQXR0YWNoZWRXaW5kb3c7CisgICAgICAgIGZpbmFsIEFwcFdpbmRvd1Rva2VuIGF0b2tlbiA9IG1XaW4ubUFwcFRva2VuOworICAgICAgICByZXR1cm4gbUFuaW1hdGlvbiAhPSBudWxsCisgICAgICAgICAgICAgICAgfHwgKGF0dGFjaGVkICE9IG51bGwgJiYgYXR0YWNoZWQubVdpbkFuaW1hdG9yLm1BbmltYXRpb24gIT0gbnVsbCkKKyAgICAgICAgICAgICAgICB8fCAoYXRva2VuICE9IG51bGwgJiYKKyAgICAgICAgICAgICAgICAgICAgICAgIChhdG9rZW4uYW5pbWF0aW9uICE9IG51bGwKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfHwgYXRva2VuLmluUGVuZGluZ1RyYW5zYWN0aW9uKSk7CisgICAgfQorCisgICAgLyoqIElzIHRoaXMgd2luZG93IGN1cnJlbnRseSBhbmltYXRpbmc/ICovCisgICAgYm9vbGVhbiBpc1dpbmRvd0FuaW1hdGluZygpIHsKKyAgICAgICAgcmV0dXJuIG1BbmltYXRpb24gIT0gbnVsbDsKKyAgICB9CisKKyAgICAvLyBUT0RPOiBGaXggYW5kIGNhbGwgZmluaXNoRXhpdCgpIGluc3RlYWQgb2YgY2FuY2VsRXhpdEFuaW1hdGlvbkZvck5leHRBbmltYXRpb25Mb2NrZWQoKQorICAgIC8vIGZvciBhdm9pZGluZyB0aGUgY29kZSBkdXBsaWNhdGlvbi4KKyAgICB2b2lkIGNhbmNlbEV4aXRBbmltYXRpb25Gb3JOZXh0QW5pbWF0aW9uTG9ja2VkKCkgeworICAgICAgICBpZiAoIW1XaW4ubUV4aXRpbmcpIHJldHVybjsKKyAgICAgICAgaWYgKG1BbmltYXRpb24gIT0gbnVsbCkgeworICAgICAgICAgICAgbUFuaW1hdGlvbi5jYW5jZWwoKTsKKyAgICAgICAgICAgIG1BbmltYXRpb24gPSBudWxsOworICAgICAgICAgICAgbVdpbi5kZXN0cm95U3VyZmFjZUxvY2tlZCgpOworICAgICAgICB9CisgICAgICAgIG1XaW4ubUV4aXRpbmcgPSBmYWxzZTsKKyAgICB9CisKKyAgICBwcml2YXRlIGJvb2xlYW4gc3RlcEFuaW1hdGlvbihsb25nIGN1cnJlbnRUaW1lKSB7CisgICAgICAgIGlmICgobUFuaW1hdGlvbiA9PSBudWxsKSB8fCAhbUxvY2FsQW5pbWF0aW5nKSB7CisgICAgICAgICAgICByZXR1cm4gZmFsc2U7CisgICAgICAgIH0KKyAgICAg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bmcgYXMgdGhlIGRpc3BsYXkgaXNuJ3QgZnJvemVuLgorCisgICAgICAgICAgICBpZiAobVdpbi5pc0RyYXduTHcoKSAmJiBtQW5pbWF0aW9uICE9IG51bGwpIHsKKyAgICAgICAgICAgICAgICBtSGFzVHJhbnNmb3JtYXRpb24gPSB0cnVlOworICAgICAgICAgICAgICAgIG1IYXNMb2NhbFRyYW5zZm9ybWF0aW9uID0gdHJ1ZTsKKyAgICAgICAgICAgICAgICBpZiAoIW1Mb2NhbEFuaW1hdGluZykgeworICAgICAgICAgICAgICAgICAgICBpZiAoV2luZG93TWFuYWdlclNlcnZpY2UuREVCVUdfQU5JTSkgU2xvZy52KAorICAgICAgICAgICAgICAgICAgICAgICAgV2luZG93TWFuYWdlclNlcnZpY2UuVEFHLCAiU3RhcnRpbmcgYW5pbWF0aW9uIGluICIgKyB0aGlzICsKKyAgICAgICAgICAgICAgICAgICAgICAgICIgQCAiICsgY3VycmVudFRpbWUgKyAiOiB3dz0iICsgbVdpbi5tRnJhbWUud2lkdGgoKSArCisgICAgICAgICAgICAgICAgICAgICAgICAiIHdoPSIgKyBtV2luLm1GcmFtZS5oZWlnaHQoKSArCisgICAgICAgICAgICAgICAgICAgICAgICAiIGR3PSIgKyBtV2luLm1BbmltRHcgKyAiIGRoPSIgKyBtV2luLm1BbmltRGggKworICAgICAgICAgICAgICAgICAgICAgICAgIiBzY2FsZT0iICsgbVNlcnZpY2UubVdpbmRvd0FuaW1hdGlvblNjYWxlKTsKKyAgICAgICAgICAgICAgICAgICAgbUFuaW1hdGlvbi5pbml0aWFsaXplKG1XaW4ubUZyYW1lLndpZHRoKCksIG1XaW4ubUZyYW1lLmhlaWdodCgpLCBtV2luLm1BbmltRHcsCisgICAgICAgICAgICAgICAgICAgICAgICBtV2luLm1BbmltRGgpOworICAgICAgICAgICAgICAgICAgICBtQW5pbWF0aW9uLnNldFN0YXJ0VGltZShjdXJyZW50VGltZSk7CisgICAgICAgICAgICAgICAgICAgIG1Mb2NhbEFuaW1hdGluZyA9IHRydWU7CisgICAgICAgICAgICAgICAgICAgIG1BbmltYXRpbmcgPSB0cnVlOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICBpZiAoKG1BbmltYXRpb24gIT0gbnVsbCkgJiYgbUxvY2FsQW5pbWF0aW5nKSB7CisgICAgICAgICAgICAgICAgICAgIGlmIChzdGVwQW5pbWF0aW9uKGN1cnJlbnRUaW1lKSkgeworICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHRydWU7CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgaWYgKFdpbmRvd01hbmFnZXJTZXJ2aWNlLkRFQlVHX0FOSU0pIFNsb2cudigKKyAgICAgICAgICAgICAgICAgICAgV2luZG93TWFuYWdlclNlcnZpY2UuVEFHLCAiRmluaXNoZWQgYW5pbWF0aW9uIGluICIgKyB0aGlzICsKKyAgICAgICAgICAgICAgICAgICAgIiBAICIgKyBjdXJyZW50VGltZSk7CisgICAgICAgICAgICAgICAgLy9XaW5kb3dNYW5hZ2VyU2VydmljZS50aGlzLmR1bXAoKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIG1IYXNMb2NhbFRyYW5zZm9ybWF0aW9uID0gZmFsc2U7CisgICAgICAgICAgICBpZiAoKCFtTG9jYWxBbmltYXRpbmcgfHwgbUFuaW1hdGlvbklzRW50cmFuY2UpICYmIG1XaW4ubUFwcFRva2VuICE9IG51bGwKKyAgICAgICAgICAgICAgICAgICAgJiYgbVdpbi5tQXBwVG9rZW4uYW5pbWF0aW9uICE9IG51bGwpIHsKKyAgICAgICAgICAgICAgICAvLyBXaGVuIG91ciBhcHAgdG9rZW4gaXMgYW5pbWF0aW5nLCB3ZSBraW5kLW9mIHByZXRlbmQgbGlrZQorICAgICAgICAgICAgICAgIC8vIHdlIGFyZSBhcyB3ZWxsLiAgTm90ZSB0aGUgbUxvY2FsQW5pbWF0aW5nIG1BbmltYXRpb25Jc0VudHJhbmNlCisgICAgICAgICAgICAgICAgLy8gcGFydCBvZiB0aGlzIGNoZWNrIG1lYW5zIHRoYXQgd2Ugd2lsbCBvbmx5IGRvIHRoaXMgaWYKKyAgICAgICAgICAgICAgICAvLyBvdXIgd2luZG93IGlzIG5vdCBjdXJyZW50bHkgZXhpdGluZywgb3IgaXQgaXMgbm90CisgICAgICAgICAgICAgICAgLy8gbG9jYWxseSBhbmltYXRpbmcgaXRzZWxmLiAgVGhlIGlkZWEgYmVpbmcgdGhhdCBvbmUgdGhhdAorICAgICAgICAgICAgICAgIC8vIGlzIGV4aXRpbmcgYW5kIGRvaW5nIGEgbG9jYWwgYW5pbWF0aW9uIHNob3VsZCBiZSByZW1vdmVkCisgICAgICAgICAgICAgICAgLy8gb25jZSB0aGF0IGFuaW1hdGlvbiBpcyBkb25lLgorICAgICAgICAgICAgICAgIG1BbmltYXRpbmcgPSB0cnVlOworICAgICAgICAgICAgICAgIG1IYXNUcmFuc2Zvcm1hdGlvbiA9IHRydWU7CisgICAgICAgICAgICAgICAgbVRyYW5zZm9ybWF0aW9uLmNsZWFyKCk7CisgICAgICAgICAgICAgICAgcmV0dXJuIGZhbHNlOworICAgICAgICAgICAgfSBlbHNlIGlmIChtSGFzVHJhbnNmb3JtYXRpb24pIHsKKyAgICAgICAgICAgICAgICAvLyBMaXR0bGUgdHJpY2sgdG8gZ2V0IHRocm91Z2ggdGhlIHBhdGggYmVsb3cgdG8gYWN0IGxpa2UKKyAgICAgICAgICAgICAgICAvLyB3ZSBoYXZlIGZpbmlzaGVkIGFuIGFuaW1hdGlvbi4KKyAgICAgICAgICAgICAgICBtQW5pbWF0aW5nID0gdHJ1ZTsKKyAgICAgICAgICAgIH0gZWxzZSBpZiAoaXNBbmltYXRpbmcoKSkgeworICAgICAgICAgICAgICAgIG1BbmltYXRpbmcgPSB0cnVlOworICAgICAgICAgICAgfQorICAgICAgICB9IGVsc2UgaWYgKG1BbmltYXRpb24gIT0gbnVsbCkgeworICAgICAgICAgICAgLy8gSWYgdGhlIGRpc3BsYXkgaXMgZnJvemVuLCBhbmQgdGhlcmUgaXMgYSBwZW5kaW5nIGFuaW1hdGlvbiwKKyAgICAgICAgICAgIC8vIGNsZWFyIGl0IGFuZCBtYWtlIHN1cmUgd2UgcnVuIHRoZSBjbGVhbnVwIGNvZGUuCisgICAgICAgICAgICBtQW5pbWF0aW5nID0gdHJ1ZTsKKyAgICAgICAgICAgIG1Mb2NhbEFuaW1hdGluZyA9IHRydWU7CisgICAgICAgICAgICBtQW5pbWF0aW9uLmNhbmNlbCgpOworICAgICAgICAgICAgbUFuaW1hdGlvbiA9IG51bGw7CisgICAgICAgIH0KKworICAgICAgICBpZiAoIW1BbmltYXRpbmcgJiYgIW1Mb2NhbEFuaW1hdGluZykgeworICAgICAgICAgICAgcmV0dXJuIGZhbHNlOworICAgICAgICB9CisKKyAgICAgICAgaWYgKFdpbmRvd01hbmFnZXJTZXJ2aWNlLkRFQlVHX0FOSU0pIFNsb2cudigKKyAgICAgICAgICAgIFdpbmRvd01hbmFnZXJTZXJ2aWNlLlRBRywgIkFuaW1hdGlvbiBkb25lIGluICIgKyB0aGlzICsgIjogZXhpdGluZz0iICsgbVdpbi5tRXhpdGluZworICAgICAgICAgICAgKyAiLCByZXBvcnRlZFZpc2libGU9IgorICAgICAgICAgICAgKyAobVdpbi5tQXBwVG9rZW4gIT0gbnVsbCA/IG1XaW4ubUFwcFRva2VuLnJlcG9ydGVkVmlzaWJsZSA6IGZhbHNlKSk7CisKKyAgICAgICAgbUFuaW1hdGluZyA9IGZhbHNlOworICAgICAgICBtTG9jYWxBbmltYXRpbmcgPSBmYWxzZTsKKyAgICAgICAgaWYgKG1BbmltYXRpb24gIT0gbnVsbCkgeworICAgICAgICAgICAgbUFuaW1hdGlvbi5jYW5jZWwoKTsKKyAgICAgICAgICAgIG1BbmltYXRpb24gPSBudWxsOworICAgICAgICB9CisgICAgICAgIGlmIChtU2VydmljZS5tV2luZG93RGV0YW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ICAgICAgICAgICArIG1XaW4ubVBvbGljeVZpc2liaWxpdHlBZnRlckFuaW0pOworICAgICAgICAgICAgfQorICAgICAgICAgICAgbVdpbi5tUG9saWN5VmlzaWJpbGl0eSA9IG1XaW4ubVBvbGljeVZpc2liaWxpdHlBZnRlckFuaW07CisgICAgICAgICAgICBtU2VydmljZS5tTGF5b3V0TmVlZGVkID0gdHJ1ZTsKKyAgICAgICAgICAgIGlmICghbVdpbi5tUG9saWN5VmlzaWJpbGl0eSkgeworICAgICAgICAgICAgICAgIGlmIChtU2VydmljZS5tQ3VycmVudEZvY3VzID09IG1XaW4pIHsKKyAgICAgICAgICAgICAgICAgICAgbVNlcnZpY2UubUZvY3VzTWF5Q2hhbmdlID0gdHJ1ZTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgLy8gV2luZG93IGlzIG5vIGxvbmdlciB2aXNpYmxlIC0tIG1ha2Ugc3VyZSBpZiB3ZSB3ZXJlIHdhaXRpbmcKKyAgICAgICAgICAgICAgICAvLyBmb3IgaXQgdG8gYmUgZGlzcGxheWVkIGJlZm9yZSBlbmFibGluZyB0aGUgZGlzcGxheSwgdGhhdAorICAgICAgICAgICAgICAgIC8vIHdlIGFsbG93IHRoZSBkaXNwbGF5IHRvIGJlIGVuYWJsZWQgbm93LgorICAgICAgICAgICAgICAgIG1TZXJ2aWNlLmVuYWJsZVNjcmVlbklmTmVlZGVkTG9ja2VkKCk7CisgICAgICAgICAgICB9CisgICAgICAgIH0KKyAgICAgICAgbVRyYW5zZm9ybWF0aW9uLmNsZWFyKCk7CisgICAgICAgIGlmIChtV2luLm1IYXNEcmF3bgorICAgICAgICAgICAgICAgICYmIG1XaW4ubUF0dHJzLnR5cGUgPT0gV2luZG93TWFuYWdlci5MYXlvdXRQYXJhbXMuVFlQRV9BUFBMSUNBVElPTl9TVEFSVElORworICAgICAgICAgICAgICAgICYmIG1XaW4ubUFwcFRva2VuICE9IG51bGwKKyAgICAgICAgICAgICAgICAmJiBtV2luLm1BcHBUb2tlbi5maXJzdFdpbmRvd0RyYXduCisgICAgICAgICAgICAgICAgJiYgbVdpbi5tQXBwVG9rZW4uc3RhcnRpbmdEYXRhICE9IG51bGwpIHsKKyAgICAgICAgICAgIGlmIChXaW5kb3dNYW5hZ2VyU2VydmljZS5ERUJVR19TVEFSVElOR19XSU5ET1cpIFNsb2cudihXaW5kb3dNYW5hZ2VyU2VydmljZS5UQUcsICJGaW5pc2ggc3RhcnRpbmcgIgorICAgICAgICAgICAgICAgICAgICArIG1XaW4ubVRva2VuICsgIjogZmlyc3QgcmVhbCB3aW5kb3cgZG9uZSBhbmltYXRpbmciKTsKKyAgICAgICAgICAgIG1TZXJ2aWNlLm1GaW5pc2hlZFN0YXJ0aW5nLmFkZChtV2luLm1BcHBUb2tlbik7CisgICAgICAgICAgICBtU2VydmljZS5tSC5zZW5kRW1wdHlNZXNzYWdlKEguRklOSVNIRURfU1RBUlRJTkcpOworICAgICAgICB9CisKKyAgICAgICAgZmluaXNoRXhpdCgpOworICAgICAgICBtU2VydmljZS5tUGVuZGluZ0xheW91dENoYW5nZXMgfD0gV2luZG93TWFuYWdlclBvbGljeS5GSU5JU0hfTEFZT1VUX1JFRE9fQU5JTTsKKyAgICAgICAgaWYgKFdpbmRvd01hbmFnZXJTZXJ2aWNlLkRFQlVHX0xBWU9VVF9SRVBFQVRTKSBtU2VydmljZS5kZWJ1Z0xheW91dFJlcGVhdHMoIldpbmRvd1N0YXRlIik7CisKKyAgICAgICAgaWYgKG1XaW4ubUFwcFRva2VuICE9IG51bGwpIHsKKyAgICAgICAgICAgIG1XaW4ubUFwcFRva2VuLnVwZGF0ZVJlcG9ydGVkVmlzaWJpbGl0eUxvY2tlZCgpOworICAgICAgICB9CisKKyAgICAgICAgcmV0dXJuIGZhbHNlOworICAgIH0KKworICAgIHZvaWQgZmluaXNoRXhpdCgpIHsKKyAgICAgICAgaWYgKFdpbmRvd01hbmFnZXJTZXJ2aWNlLkRFQlVHX0FOSU0pIFNsb2cudigKKyAgICAgICAgICAgICAgICBXaW5kb3dNYW5hZ2VyU2VydmljZS5UQUcsICJmaW5pc2hFeGl0IGluICIgKyB0aGlzCisgICAgICAgICAgICAgICAgKyAiOiBleGl0aW5nPSIgKyBtV2luLm1FeGl0aW5nCisgICAgICAgICAgICAgICAgKyAiIHJlbW92ZT0iICsgbVdpbi5tUmVtb3ZlT25FeGl0CisgICAgICAgICAgICAgICAgKyAiIHdpbmRvd0FuaW1hdGluZz0iICsgaXNXaW5kb3dBbmltYXRpbmcoKSk7CisKKyAgICAgICAgZmluYWwgaW50IE4gPSBtV2luLm1DaGlsZFdpbmRvd3Muc2l6ZSgpOworICAgICAgICBmb3IgKGludCBpPTA7IGk8TjsgaSsrKSB7CisgICAgICAgICAgICBtV2luLm1DaGlsZFdpbmRvd3MuZ2V0KGkpLm1XaW5BbmltYXRvci5maW5pc2hFeGl0KCk7CisgICAgICAgIH0KKworICAgICAgICBpZiAoIW1XaW4ubUV4aXRpbmcpIHsKKyAgICAgICAgICAgIHJldHVybjsKKyAgICAgICAgfQorCisgICAgICAgIGlmIChpc1dpbmRvd0FuaW1hdGluZygpKSB7CisgICAgICAgICAgICByZXR1cm47CisgICAgICAgIH0KKworICAgICAgICBpZiAoV2luZG93TWFuYWdlclNlcnZpY2UubG9jYWxMT0dWKSBTbG9nLnYoCisgICAgICAgICAgICAgICAgV2luZG93TWFuYWdlclNlcnZpY2UuVEFHLCAiRXhpdCBhbmltYXRpb24gZmluaXNoZWQgaW4gIiArIHRoaXMKKyAgICAgICAgICAgICAgICArICI6IHJlbW92ZT0iICsgbVdpbi5tUmVtb3ZlT25FeGl0KTsKKyAgICAgICAgaWYgKG1XaW4ubVN1cmZhY2UgIT0gbnVsbCkgeworICAgICAgICAgICAgbVNlcnZpY2UubURlc3Ryb3lTdXJmYWNlLmFkZChtV2luKTsKKyAgICAgICAgICAgIG1XaW4ubURlc3Ryb3lpbmcgPSB0cnVlOworICAgICAgICAgICAgaWYgKFdpbmRvd1N0YXRlLlNIT1dfVFJBTlNBQ1RJT05TKSBXaW5kb3dNYW5hZ2VyU2VydmljZS5sb2dTdXJmYWNlKAorICAgICAgICAgICAgICAgIG1XaW4sICJISURFIChmaW5pc2hFeGl0KSIsIG51bGwpOworICAgICAgICAgICAgbVdpbi5tU3VyZmFjZVNob3duID0gZmFsc2U7CisgICAgICAgICAgICB0cnkgeworICAgICAgICAgICAgICAgIG1XaW4ubVN1cmZhY2UuaGlkZSgpOworICAgICAgICAgICAgfSBjYXRjaCAoUnVudGltZUV4Y2VwdGlvbiBlKSB7CisgICAgICAgICAgICAgICAgU2xvZy53KFdpbmRvd01hbmFnZXJTZXJ2aWNlLlRBRywgIkVycm9yIGhpZGluZyBzdXJmYWNlIGluICIgKyB0aGlzLCBlKTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICAgIG1XaW4ubUxhc3RIaWRkZW4gPSB0cnVlOworICAgICAgICB9CisgICAgICAgIG1XaW4ubUV4aXRpbmcgPSBmYWxzZTsKKyAgICAgICAgaWYgKG1XaW4ubVJlbW92ZU9uRXhpdCkgeworICAgICAgICAgICAgbVNlcnZpY2UubVBlbmRpbmdSZW1vdmUuYWRkKG1XaW4pOworICAgICAgICAgICAgbVdpbi5tUmVtb3ZlT25FeGl0ID0gZmFsc2U7CisgICAgICAgIH0KKyAgICB9CisKKyAgICBwdWJsaWMgdm9pZCBkdW1wKFByaW50V3JpdGVyIHB3LCBTdHJpbmcgcHJlZml4LCBib29sZWFuIGR1bXBBbGwpIHsKKyAgICAgICAgaWYgKG1BbmltYXRpbmcgfHwgbUxvY2FsQW5pbWF0aW5nIHx8IG1BbmltYXRpb25Jc0VudHJhbmNlCisgICAgICAgICAgICAgICAgfHwgbUFuaW1hdGlvbiAhPSBudWxsKSB7CisgICAgICAgICAgICBwdy5wcmludChwcmVmaXgpOyBwdy5wcmludCgibUFuaW1hdGluZz0iKTsgcHcucHJpbnQobUFuaW1hdGluZyk7CisgICAgICAgICAgICAgICAgICAgIHB3LnByaW50KCIgbUxvY2FsQW5pbWF0aW5nPSIpOyBwdy5wcmludChtTG9jYWxBbmltYXRpbmcpOworICAgICAgICAgICAgICAgICAgICBwdy5wcmludCgiIG1BbmltYXRpb25Jc0VudHJhbmNlPSIpOyBwdy5wcmludChtQW5pbWF0aW9uSXNFbnRyYW5jZSk7CisgICAgICAgICAgICAgICAgICAgIHB3LnByaW50KCIgbUFuaW1hdGlvbj0iKTsgcHcucHJpbnRsbihtQW5pbWF0aW9uKTsKKyAgICAgICAgfQorICAgICAgICBpZiAobUhhc1RyYW5zZm9ybWF0aW9uIHx8IG1IYXNMb2NhbFRyYW5zZm9ybWF0aW9uKSB7CisgICAgICAgICAgICBwdy5wcmludChwcmVmaXgpOyBwdy5wcmludCgiWEZvcm06IGhhcz0iKTsKKyAgICAgICAgICAgICAgICAgICAgcHcucHJpbnQobUhhc1RyYW5zZm9ybWF0aW9uKTsKKyAgICAgICAgICAgICAgICAgICAgcHcucHJpbnQoIiBoYXNMb2NhbD0iKTsgcHcucHJpbnQobUhhc0xvY2FsVHJhbnNmb3JtYXRpb24pOworICAgICAgICAgICAgICAgICAgICBwdy5wcmludCgiICIpOyBtVHJhbnNmb3JtYXRpb24ucHJpbnRTaG9ydFN0cmluZyhwdyk7CisgICAgICAgICAgICAgICAgICAgIHB3LnByaW50bG4oKTsKKyAgICAgICAgfQorICAgIH0KKworfQpkaWZmIC0tZ2l0IGEvc2VydmljZXMvcG93ZXJtYW5hZ2VyL0FuZHJvaWQubWsgYi9zZXJ2aWNlcy9wb3dlcm1hbmFnZXIvQW5kcm9pZC5tawpkZWxldGVkIGZpbGUgbW9kZSAxMDA2NDQKaW5kZXggZDk4YjJkYS4uMDAwMDAwMAotLS0gYS9zZXJ2aWNlcy9wb3dlcm1hbmFnZXIvQW5kcm9pZC5taworKysgL2Rldi9udWxsCkBAIC0xLDE1ICswLDAgQEAKLUxPQ0FMX1BBVEg6PSAkKGNhbGwgbXktZGlyKQotaW5jbHVkZSAkK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lvbi5Qcm94eVNldHRpbmdzOwpAQCAtMTE0MCw3ICsxMTQxLDcgQEAKICAgICAgICAgICAgICAgICBTdHJpbmcgdmFyTmFtZSA9IGZpZWxkLnZhck5hbWUoKTsKICAgICAgICAgICAgICAgICBTdHJpbmcgdmFsdWUgPSBmaWVsZC52YWx1ZSgpOwogICAgICAgICAgICAgICAgIGlmICh2YWx1ZSAhPSBudWxsKSB7Ci0gICAgICAgICAgICAgICAgICAgIGlmIChmaWVsZCAhPSBjb25maWcuZWFwKSB7CisgICAgICAgICAgICAgICAgICAgIGlmIChmaWVsZCAhPSBjb25maWcuZWFwICYmIGZpZWxkICE9IGNvbmZpZy5lbmdpbmUpIHsKICAgICAgICAgICAgICAgICAgICAgICAgIHZhbHVlID0gKHZhbHVlLmxlbmd0aCgpID09IDApID8gIk5VTEwiIDogY29udmVydFRvUXVvdGVkU3RyaW5nKHZhbHVlKTsKICAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgICAgICBpZiAoIW1XaWZpTmF0aXZlLnNldE5ldHdvcmtWYXJpYWJsZSgKQEAgLTE0NDksMTAgKzE0NTAsNjggQEAKICAgICAgICAgICAgIHZhbHVlID0gbVdpZmlOYXRpdmUuZ2V0TmV0d29ya1ZhcmlhYmxlKG5ldElkLAogICAgICAgICAgICAgICAgICAgICBmaWVsZC52YXJOYW1lKCkpOwogICAgICAgICAgICAgaWYgKCFUZXh0VXRpbHMuaXNFbXB0eSh2YWx1ZSkpIHsKLSAgICAgICAgICAgICAgICBpZiAoZmllbGQgIT0gY29uZmlnLmVhcCkgdmFsdWUgPSByZW1vdmVEb3VibGVRdW90ZXModmFsdWUpOworICAgICAgICAgICAgICAgIGlmIChmaWVsZCAhPSBjb25maWcuZWFwICYmIGZpZWxkICE9IGNvbmZpZy5lbmdpbmUpIHsKKyAgICAgICAgICAgICAgICAgICAgdmFsdWUgPSByZW1vdmVEb3VibGVRdW90ZXModmFsdWUpOworICAgICAgICAgICAgICAgIH0KICAgIC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3Rpb24uZXF1YWxzKEludGVudC5BQ1RJT05fU0NSRUVOX09OKSkgeworICAgICAgICAgICAgICAgICAgICBlbmFibGVSc3NpUG9sbGluZyh0cnVlKTsKKyAgICAgICAgICAgICAgICAgICAgaWYgKG1CYWNrZ3JvdW5kU2NhblN1cHBvcnRlZCkgeworICAgICAgICAgICAgICAgICAgICAgICAgZW5hYmxlQmFja2dyb3VuZFNjYW5Db21tYW5kKGZhbHNlKTsKKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICBlbmFibGVBbGxOZXR3b3JrcygpOworICAgICAgICAgICAgICAgICAgICBzZW5kTWVzc2FnZShDTURfQ0xFQVJfU1VTUEVORF9PUFRJTUlaQVRJT05TKTsKKyAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKGFjdGlvbi5lcXVhbHMoSW50ZW50LkFDVElPTl9TQ1JFRU5fT0ZGKSkgeworICAgICAgICAgICAgICAgICAgICBlbmFibGVSc3NpUG9sbGluZyhmYWxzZSk7CisgICAgICAgICAgICAgICAgICAgIGlmIChtQmFja2dyb3VuZFNjYW5TdXBwb3J0ZWQpIHsKKyAgICAgICAgICAgICAgICAgICAgICAgIGVuYWJsZUJhY2tncm91bmRTY2FuQ29tbWFuZCh0cnVlKTsKKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICAvL0FsbG93IDJzIGZvciBzdXNwZW5kIG9wdGltaXphdGlvbnMgdG8gYmUgc2V0CisgICAgICAgICAgICAgICAgICAgIG1TdXNwZW5kV2FrZUxvY2suYWNxdWlyZSgyMDAwKTsKKyAgICAgICAgICAgICAgICAgICAgc2VuZE1lc3NhZ2UoQ01EX1NFVF9TVVNQRU5EX09QVElNSVpBVElPTlMpOworICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgIH0KKyAgICAgICAgfTsKKwogICAgICAgICBtU2NhblJlc3VsdENhY2hlID0gbmV3IExydUNhY2hlPFN0cmluZywgU2NhblJlc3VsdD4oU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ShQT1dFUl9NT0RFX0FDVElWRSkpIHsKLSAgICAgICAgICAgICAgICBsb2dlKCJzZXQgcG93ZXIgbW9kZSBhY3RpdmUgZmFpbGVkISIpOwotICAgICAgICAgICAgfQotICAgICAgICB9IGVsc2UgewotICAgICAgICAgICAgaWYgKCFtV2lmaU5hdGl2ZS5zZXRQb3dlck1vZGUoUE9XRVJfTU9ERV9BVVRPKSkgewotICAgICAgICAgICAgICAgIGxvZ2UoInNldCBwb3dlciBtb2RlIGF1dG8gZmFpbGVkISIpOwotICAgICAgICAgICAgfQotICAgICAgICB9Ci0gICAgfQotCiAgICAgcHJpdmF0ZSB2b2lkIGNvbmZpZ3VyZUxpbmtQcm9wZXJ0aWVzKCkgewogICAgICAgICBpZiAobVdpZmlDb25maWdTdG9yZS5pc1VzaW5nU3RhdGljSXAobUxhc3ROZXR3b3JrSWQpKSB7CiAgICAgICAgICAgICBtTGlua1Byb3BlcnRpZXMgPSBtV2lmaUNvbmZpZ1N0b3JlLmdldExpbmtQcm9wZXJ0aWVzKG1MYXN0TmV0d29ya0lkKTsKQEAgLTE3ODEsNiArMTgxMiw5IEBACiAgICAgICAgICAgICAgICAgY2FzZSBDTURfRU5BQkxFX0JBQ0tHUk9VTkRfU0NBTjoKICAgICAgICAgICAgICAgICAgICAgbUVuYWJsZUJhY2tncm91bmRTY2FuID0gKG1lc3NhZ2UuYXJnMSA9PSAxKTsKICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICAgICAgY2FzZSBDTURfU0VUX0hJR0hfUEVSRl9NT0RFOgorICAgICAgICAgICAgICAgICAgICBtSGlnaFBlcmZNb2RlID0gKG1lc3NhZ2UuYXJnMSA9PSAxKTsKKyAgICAgICAgICAgICAgICAgICAgYnJlYWs7CiAgICAgICAgICAgICAgICAgICAgIC8qIERpc2NhcmQgKi8KICAgICAgICAgICAgICAgICBjYXNlIENNRF9MT0FEX0RSSVZFUjoKICAgICAgICAgICAgICAgICBjYXNlIENNRF9VTkxPQURfRFJJVkVSOgpAQCAtMTgxMiw3ICsxODQ2LDYgQEAKICAgICAgICAgICAgICAgICBjYXNlIENNRF9DTEVBUl9CTEFDS0xJU1Q6CiAgICAgICAgICAgICAgICAgY2FzZSBDTURfU0VUX1NDQU5fTU9ERToKICAgICAgICAgICAgICAgICBjYXNlIENNRF9TRVRfU0NBTl9UWVBFOgotICAgICAgICAgICAgICAgIGNhc2UgQ01EX1NFVF9ISUdIX1BFUkZfTU9ERToKICAgICAgICAgICAgICAgICBjYXNlIENNRF9TRVRfQ09VTlRSWV9DT0RFOgogICAgICAgICAgICAgICAgIGNhc2UgQ01EX1NFVF9GUkVRVUVOQ1lfQkFORDoKICAgICAgICAgICAgICAgICBjYXNlIENNRF9SU1NJX1BPTEw6CkBAIC0xODI2LDYgKzE4NTksMTAgQEAKICAgICAgICAgICAgICAgICBjYXNlIENNRF9SRVNQT05TRV9BUF9DT05GSUc6CiAgICAgICAgICAgICAgICAgY2FzZSBXaWZpV2F0Y2hkb2dTdGF0ZU1hY2hpbmUuUE9PUl9MSU5LX0RFVEVDVEVEOgogICAgICAgICAgICAgICAgIGNhc2UgV2lmaVdhdGNoZG9nU3RhdGVNYWNoaW5lLkdPT0RfTElOS19ERVRFQ1RFRDoKKyAgICAgICAgICAgICAgICBjYXNlIENNRF9DTEVBUl9TVVNQRU5EX09QVElNSVpBVElPTlM6CisgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgIGNhc2UgQ01EX1NFVF9TVVNQRU5EX09QVElNSVpBVElPTlM6CisgICAgICAgICAgICAgICAgICAgIG1TdXNwZW5kV2FrZUxvY2sucmVsZWFzZSgpOwogICAgICAgICAgICAgICAgICAgICBicmVhazsKICAgICAgICAgICAgICAgICBjYXNlIFdpZmlNb25pdG9yLkRSSVZFUl9IVU5HX0VWRU5UOgogICAgICAgICAgICAgICAgICAgICBzZXRXaWZpRW5hYmxlZChmYWxzZSk7CkBAIC0xOTY5LDcgKzIwMDYsNiBAQAogICAgICAgICAgICAgICAgIGNhc2UgQ01EX1NUT1BfRFJJVkVSOgogICAgICAgICAgICAgICAgIGNhc2UgQ01EX1NFVF9TQ0FOX01PREU6CiAgICAgICAgICAgICAgICAgY2FzZSBDTURfU0VUX1NDQU5fVFlQRToKLSAgICAgICAgICAgICAgICBjYXNlIENNRF9TRVRfSElHSF9QRVJGX01PREU6CiAgICAgICAgICAgICAgICAgY2FzZSBDTURfU0VUX0NPVU5UUllfQ09ERToKICAgICAgICAgICAgICAgICBjYXNlIENNRF9TRVRfRlJFUVVFTkNZX0JBTkQ6CiAgICAgICAgICAgICAgICAgY2FzZSBDTURfU1RBUlRfUEFDS0VUX0ZJTFRFUklORzoKQEAgLTIxMDMsNyArMjEzOSw2IEBACiAgICAgICAgICAgICAgICAgY2FzZSBDTURfU1RPUF9EUklWRVI6CiAgICAgICAgICAgICAgICAgY2FzZSBDTURfU0VUX1NDQU5fTU9ERToKICAgICAgICAgICAgICAgICBjYXNlIENNRF9TRVRfU0NBTl9UWVBFOgotICAgICAgICAgICAgICAgIGNhc2UgQ01EX1NFVF9ISUdIX1BFUkZfTU9ERToKICAgICAgICAgICAgICAgICBjYXNlIENNRF9TRVRfQ09VTlRSWV9DT0RFOgogICAgICAgICAgICAgICAgIGNhc2UgQ01EX1NFVF9GUkVRVUVOQ1lfQkFORDoKICAgICAgICAgICAgICAgICBjYXNlIENNRF9TVEFSVF9QQUNLRVRfRklMVEVSSU5HOgpAQCAtMjIwNiw3ICsyMjQxLDYgQEAKICAgICAgICAgICAgICAgICBjYXNlIENNRF9TVE9QX0RSSVZFUjoKICAgICAgICAgICAgICAgICBjYXNlIENNRF9TRVRfU0NBTl9NT0RFOgogICAgICAgICAgICAgICAgIGNhc2UgQ01EX1NFVF9TQ0FOX1RZUEU6Ci0gICAgICAgICAgICAgICAgY2FzZSBDTURfU0VUX0hJR0hfUEVSRl9NT0RFOgogICAgICAgICAgICAgICAgIGNhc2UgQ01EX1NFVF9DT1VOVFJZX0NPREU6CiAgICAgICAgICAgICAgICAgY2FzZSBDTURfU0VUX0ZSRVFVRU5DWV9CQU5EOgogICAgICAgICAgICAgICAgIGNhc2UgQ01EX1NUQVJUX1BBQ0tFVF9GSUxURVJJTkc6CkBAIC0yNDE2LDcgKzI0NTAsNiBAQAogICAgICAgICAgICAgICAgIGNhc2UgQ01EX1NUT1BfRFJJVkVSOgogICAgICAgICAgICAgICAgIGNhc2UgQ01EX1NFVF9TQ0FOX01PREU6CiAgICAgICAgICAgICAgICAgY2FzZSBDTURfU0VUX1NDQU5fVFlQRToKLSAgICAgICAgICAgICAgICBjYXNlIENNRF9TRVRfSElHSF9QRVJGX01PREU6CiAgICAgICAgICAgICAgICAgY2FzZSBDTURfU0VUX0NPVU5UUllfQ09ERToKICAgICAgICAgICAgICAgICBjYXNlIENNRF9TRVRfRlJFUVVFTkNZX0JBTkQ6CiAgICAgICAgICAgICAgICAgY2FzZSBDTURfU1RBUlRfUEFDS0VUX0ZJTFRFUklORzoKQEAgLTI0NTksNyArMjQ5Miw2IEBACiAgICAgICAgICAgICAgICAgY2FzZSBXaWZpTW9uaXRvci5BVVRIRU5USUNBVElPTl9GQUlMVVJFX0VWRU5UOgogICAgICAgICAgICAgICAgIGNhc2UgV2lmaU1vbml0b3IuV1BTX09WRVJMQVBfRVZFTlQ6CiAgICAgICAgICAgICAgICAgY2FzZSBDTURfU0VUX1NDQU5fVFlQRToKLSAgICAgICAgICAgICAgICBjYXNlIENNRF9TRVRfSElHSF9QRVJGX01PREU6CiAgICAgICAgICAgICAgICAgY2FzZSBDTURfU0VUX0NPVU5UUllfQ09ERToKICAgICAgICAgICAgICAgICBjYXNlIENNRF9TRVRfRlJFUVVFTkNZX0JBTkQ6CiAgICAgICAgICAgICAgICAgY2FzZSBDTURfU1RBUlRfUEFDS0VUX0ZJTFRFUklORzoKQEAgLTI1MjYsNiArMjU1OCw4IEBACiAgICAgICAgICAgICB9CiAKICAgICAgICAgICAgIGlmIChtUDJwU3VwcG9ydGVkKSBtV2lmaVAycENoYW5uZWwuc2VuZE1lc3NhZ2UoV2lmaVN0YXRlTWFjaGluZS5DTURfRU5BQkxFX1AyUCk7CisKKyAgICAgICAgICAgIG1Db250ZXh0LnJlZ2lzdGVyUmVjZWl2ZXIobVNjcmVlblJlY2VpdmVyLCBtU2NyZWVuRmlsdGVyKTsKICAgICAgICAgfQogICAgICAgICBAT3ZlcnJpZGUKICAgICAgICAgcHVibGljIGJvb2xlYW4gcHJvY2Vzc01lc3NhZ2UoTWVzc2FnZSBtZXNzYWdlKSB7CkBAIC0yNTQ4LDkgKzI1ODIsNiBAQAogICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgICAgIG1TY2FuUmVzdWx0SXNQZW5kaW5nID0gdHJ1ZTsKICAgICAgICAgICAgICAgICAgICAgYnJlYWs7Ci0gICAgICAgICAgICAgICAgY2FzZSBDTURfU0VUX0hJR0hfUEVSRl9NT0RFOgotICAgICAgICAgICAgICAgICAgICBzZXRIaWdoUGVyZk1vZGVFbmFibGVkTmF0aXZlKG1lc3NhZ2UuYXJnMSA9PSAxKTsKLSAgICAgICAgICAgICAgICAgICAgYnJlYWs7CiAgICAgICAgICAgICAgICAgY2FzZSBDTURfU0VUX0NPVU5UUllfQ09ERToKICAgICAgICAgICAgICAgICAgICAgU3RyaW5nIGNvdW50cnkgPSAoU3RyaW5nKSBtZXNzYWdlLm9iajsKICAgICAgICAgICAgICAgICAgICAgaWYgKERCRykgbG9nKCJzZXQgY291bnRyeSBjb2RlICIgKyBjb3VudHJ5KTsKQEAgLTI2MzEsNiArMjY2MiwyMiBAQAogICAgICAgICAgICAgICAgICAgICAgICAgbG9nZSgiSWxsZWdhbCBhcnVnbWVudHMgdG8gQ01EX1NUT1BfUEFDS0VUX0ZJTFRFUklORyIpOwogICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgIGNhc2UgQ01EX1NFVF9TVVNQRU5EX09QVElNSVpBVElPTlM6CisgICAgICAgICAgICAgICAgICAgIGlmICghbUhpZ2hQZXJmTW9kZSkgeworICAgICAgICAgICAgICAgICAgICAgICAgbVdpZmlOYXRpdmUuc2V0U3VzcGVuZE9wdGltaXphdGlvbnModHJ1ZSk7CisgICAgICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgICAgbVN1c3BlbmRXYWtlTG9jay5yZWxlYXNlKCk7CisgICAgICAgICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgICAgIGNhc2UgQ01EX0NMRUFSX1NVU1BFTkRfT1BUSU1JWkFUSU9OUzoKKyAgICAgICAgICAgICAgICAgICAgbVdpZmlOYXRpdmUuc2V0U3VzcGVuZE9wdGltaXphdGlvbnMoZmFsc2UpOworICAgICAgICAgICAgICAgICAgICBicmVhazsKKyAgICAgICAgICAgICAgICBjYXNlIENNRF9TRVRfSElHSF9QRVJGX01PREU6CisgICAgICAgICAgICAgICAgICAgIG1IaWdoUGVyZk1vZGUgPSAobWVzc2FnZS5hcmcxID09IDEpOworICAgICAgICAgICAgICAgICAgICBpZiAobUhpZ2hQZXJmTW9kZSkgeworICAgICAgICAgICAgICAgICAgICAgICAgLy9EaXNhYmxlIGFueSBzdXNwZW5kIG9wdGltaXphdGlvbnMKKyAgICAgICAgICAgICAgICAgICAgICAgIG1XaWZpTmF0aXZlLnNldFN1c3BlbmRPcHRpbWl6YXRpb25zKGZhbHNlKTsKKyAgICAgICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgICAgICBicmVhazsKICAgICAgICAgICAgICAgICBkZWZhdWx0OgogICAgICAgICAgICAgICAgICAgICByZXR1cm4gTk9UX0hBTkRMRUQ7CiAgICAgICAgICAgICB9CkBAIC0yNjQ3LDYgKzI2OTQsNyBAQAogICAgICAgICAgICAgbVNjYW5SZXN1bHRzID0gbnVsbDsKIAogICAgICAgICAgICAgaWYgKG1QMnBTdXBwb3J0ZWQpIG1XaWZpUDJwQ2hhbm5lbC5zZW5kTWVzc2FnZShXaWZpU3RhdGVNYWNoaW5lLkNNRF9ESVNBQkxFX1AyUCk7CisgICAgICAgICAgICBtQ29udGV4dC51bnJlZ2lzdGVyUmVjZWl2ZXIobVNjcmVlblJlY2VpdmVyKTsKICAgICAgICAgfQogICAgIH0KIApAQCAtMjY3MCw3ICsyNzE4LDYgQEAKICAgICAgICAgICAgICAgICBjYXNlIENNRF9TVEFSVF9EUklWRVI6CiAgICAgICAgICAgICAgICAgY2FzZSBDTURfU1RPUF9EUklWRVI6CiAgICAgICAgICAgICAgICAgY2FzZSBDTURfU0VUX1NDQU5fVFlQRToKLSAgICAgICAgICAgICAgICBjYXNlIENNRF9TRVRfSElHSF9QRVJGX01PREU6CiAgICAgICAgICAgICAgICAgY2FzZSBDTURfU0VUX0NPVU5UUllfQ09ERToKICAgICAgICAgICAgICAgICBjYXNlIENNRF9TRVRfRlJFUVVFTkNZX0JBTkQ6CiAgICAgICAgICAgICAgICAgY2FzZSBDTURfU1RBUlRfUEFDS0VUX0ZJTFRFUklORzoKQEAgLTM0MzAsNyArMzQ3Nyw2IEBACiAgICAgICAgICAgICAgICAgY2FzZSBDTURfU1RPUF9EUklWRVI6CiAgICAgICAgICAgICAgICAgY2FzZSBDTURfU0VUX1NDQU5fTU9ERToKICAgICAgICAgICAgICAgICBjYXNlIENNRF9TRVRfU0NBTl9UWVBFOgotICAgICAgICAgICAgICAgIGNhc2UgQ01EX1NFVF9ISUdIX1BFUkZfTU9ERToKICAgICAgICAgICAgICAgICBjYXNlIENNRF9TRVRfQ09VTlRSWV9DT0RFOgogICAgICAgICAgICAgICAgIGNhc2UgQ01EX1NFVF9GUkVRVUVOQ1lfQkFORDoKICAgICAgICAgICAgICAgICBjYXNlIENNRF9TVEFSVF9QQUNLRVRfRklMVEVSSU5HOgpAQCAtMzU0Myw3ICszNTg5LDYgQEAKICAgICAgICAgICAgICAgICBjYXNlIENNRF9TVE9QX0RSSVZFUjoKICAgICAgICAgICAgICAgICBjYXN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jdCB0ZWNobmljYWwgc3BlY2lmaWNhdGlvbgpAQCAtMTE3LDYgKzEwNyw0MyBAQAogICAgIC8qKiBEZXZpY2UgY29ubmVjdGlvbiBzdGF0dXMgKi8KICAgICBwdWJsaWMgaW50IHN0YXR1cyA9IFVOQVZBSUxBQkxFOwogCisgICAgLyoqIERldGFpbGVkIGRldmljZSBzdHJpbmcgcGF0dGVybgorICAgICAqIEV4YW1wbGU6CisgICAgICogIFAyUC1ERVZJQ0UtRk9VTkQgZmE6N2I6N2E6NDI6MDI6MTMgcDJwX2Rldl9hZGRyPWZhOjdiOjdhOjQyOjAyOjEzCisgICAgICogIHByaV9kZXZfdHlwZT0xLTAwNTBGMjA0LTEgbmFtZT0ncDJwLVRFU1QxJyBjb25maWdfbWV0aG9kcz0weDE4OCBkZXZfY2FwYWI9MHgyNworICAgICAqICBncm91cF9jYXBhYj0weDAKKyAgICAgKgorICAgICAqLworICAgIHByaXZhdGUgc3RhdGljIGZpbmFsIFBhdHRlcm4gZGV0YWlsZWREZXZpY2VQYXR0ZXJuID0gUGF0dGVybi5jb21waWxlKAorICAgICAgICAiKCg/OlswLTlhLWZdezJ9Oil7NX1bMC05YS1mXXsyfSkgIiArCisgICAgICAgICIoXFxkKyApPyIgKworICAgICAgICAicDJwX2Rldl9hZGRyPSgoPzpbMC05YS1mXXsyfTopezV9WzAtOWEtZl17Mn0pICIgKworICAgICAgICAicHJpX2Rldl90eXBlPShcXGQrLVswLTlhLWZBLUZdKy1cXGQrKSAiICsKKyAgICAgICAgIm5hbWU9JyguKiknICIgKworICAgICAgICAiY29uZmlnX21ldGhvZHM9KDB4WzAtOWEtZkEtRl0rKSAiICsKKyAgICAgICAgImRldl9jYXBhYj0oMHhbMC05YS1mQS1GXSspICIgKworICAgICAgICAiZ3JvdXBfY2FwYWI9KDB4WzAtOWEtZkEtRl0rKSIKKyAgICApOworCisgICAgLyoqIDIgdG9rZW4gZGV2aWNlIGFkZHJlc3MgcGF0dGVybgorICAgICAqIEV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Rldl9hZGRyPTAyOjkwOjRjOmEwOjkyOjU0XQorICAgICAqCisgICAgICogIEFQLVNUQS1ESVNDT05ORUNURUQgNDI6ZmM6ODk6YTg6OTY6MDkgW3AycF9kZXZfYWRkcj0wMjo5MDo0YzphMDo5Mjo1NF0KKyAgICAgKgogICAgICAqICBmYTo3Yjo3YTo0MjowMjoxMwogICAgICAqCiAgICAgICogIE5vdGU6IFRoZSBldmVudHMgZm9ybWF0cyBjYW4gYmUgbG9va2VkIHVwIGluIHRoZSB3cGFfc3VwcGxpY2FudCBjb2RlCkBAIC0xMzUsNTYgKzE2Niw0NCBAQAogICAgICAqLwogICAgIHB1YmxpYyBXaWZpUDJwRGV2aWNlKFN0cmluZyBzdHJpbmcpIHRocm93cyBJbGxlZ2FsQXJndW1lbnRFeGNlcHRpb24gewogICAgICAgICBTdHJpbmdbXSB0b2tlbnMgPSBzdHJpbmcuc3BsaXQoIlsgXG5dIik7CisgICAgICAgIE1hdGNoZXIgbWF0Y2g7CiAKICAgICAgICAgaWYgKHRva2Vucy5sZW5ndGggPCAxKSB7CiAgICAgICAgICAgICB0aHJvdyBuZXcgSWxsZWdhbEFyZ3VtZW50RXhjZXB0aW9uKCJNYWxmb3JtZWQgc3VwcGxpY2FudCBldmVudCIpOwogICAgICAgICB9CiAKLSAgICAgICAgLyogSnVzdCBhIGRldmljZSBhZGRyZXNzICovCi0gICAgICAgIGlmICh0b2tlbnMubGVuZ3RoID09IDEpIHsKLSAgICAgICAgICAgIGRldmljZUFkZHJlc3MgPSBzdHJpbmc7Ci0gICAgICAgICAgICByZXR1cm47Ci0gICAgICAgIH0KLQotICAgICAgICBmb3IgKFN0cmluZyB0b2tlbiA6IHRva2VucykgewotICAgICAgICAgICAgU3RyaW5nW10gbmFtZVZhbHVlID0gdG9rZW4uc3BsaXQoIj0iKTsKLSAgICAgICAgICAgIGlmIChuYW1lVmFsdWUubGVuZ3RoICE9IDIpIHsKLSAgICAgICAgICAgICAgICAvL21hYyBhZGRyZXNzIHdpdGhvdXQga2V5IGlzIGRldmljZSBhZGRyZXNzCi0gICAgICAgICAgICAgICAgaWYgKHRva2VuLm1hdGNoZXMoIigoWzAtOWEtZl17Mn06KXs1fVswLTlhLWZdezJ9KSIpKSB7Ci0gICAgICAgICAgICAgICAgICAgIGRldmljZUFkZHJlc3MgPSB0b2tlbjsKKyAgICAgICAgc3dpdGNoICh0b2tlbnMubGVuZ3RoKSB7CisgICAgICAgICAgICBjYXNlIDE6CisgICAgICAgICAgICAgICAgLyogSnVzdCBhIGRldmljZSBhZGRyZXNzICovCisgICAgICAgICAgICAgICAgZGV2aWNlQWRkcmVzcyA9IHN0cmluZzsKKyAgICAgICAgICAgICAgICByZXR1cm47CisgICAgICAgICAgICBjYXNlIDI6CisgICAgICAgICAgICAgICAgbWF0Y2ggPSB0d29Ub2tlblBhdHRlcm4ubWF0Y2hlcihzdHJpbmcpOworICAgICAgICAgICAgICAgIGlmICghbWF0Y2guZmluZCgpKSB7CisgICAgICAgICAgICAgICAgICAgIHRocm93IG5ldyBJbGxlZ2FsQXJndW1lbnRFeGNlcHRpb24oIk1hbGZvcm1lZCBzdXBwbGljYW50IGV2ZW50Iik7CiAgICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgIGNvbnRpbnVlOwotICAgICAgICAgICAgfQorICAgICAgICAgICAgICAgIGRldmljZUFkZHJlc3MgPSBtYXRjaC5ncm91cCgyKTsKKyAgICAgICAgICAgICAgICByZXR1cm47CisgICAgICAgICAgICBjYXNlIDM6CisgICAgICAgICAgICAgICAgbWF0Y2ggPSB0aHJlZVRva2VuUGF0dGVybi5tYXRjaGVyKHN0cmluZyk7CisgICAgICAgICAgICAgICAgaWYgKCFtYXRjaC5maW5kKCkpIHsKKyAgICAgICAgICAgICAgICAgICAgdGhyb3cgbmV3IElsbGVnYWxBcmd1bWVudEV4Y2VwdGlvbigiTWFsZm9ybWVkIHN1cHBsaWNhbnQgZXZlbnQiKTsKKyAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgZGV2aWNlQWRkcmVzcyA9IG1hdGNoLmdyb3VwKDEpOworICAgICAgICAgICAgICAgIHJldHVybjsKKyAgICAgICAgICAgIGRlZmF1bHQ6CisgICAgICAgICAgICAgICAgbWF0Y2ggPSBkZXRhaWxlZERldmljZVBhdHRlcm4ubWF0Y2hlcihzdHJpbmcpOworICAgICAgICAgICAgICAgIGlmICghbWF0Y2guZmluZCgpKSB7CisgICAgICAgICAgICAgICAgICAgIHRocm93IG5ldyBJbGxlZ2FsQXJndW1lbnRFeGNlcHRpb24oIk1hbGZvcm1lZCBzdXBwbGljYW50IGV2ZW50Iik7CisgICAgICAgICAgICAgICAgfQogCi0gICAgICAgICAgICBpZiAobmFtZVZhbHVlWzBdLmVxdWFscygicDJwX2Rldl9hZGRyIikpIHsKLSAgICAgICAgICAgICAgICBkZXZpY2VBZGRyZXNzID0gbmFtZVZhbHVlWzFdOwotICAgICAgICAgICAgICAgIGNvbnRpbnVlOwotICAgICAgICAgICAgfQotCi0gICAgICAgICAgICBpZiAobmFtZVZhbHVlWzBdLmVxdWFscygicHJpX2Rldl90eXBlIikpIHsKLSAgICAgICAgICAgICAgICBwcmltYXJ5RGV2aWNlVHlwZSA9IG5hbWVWYWx1ZVsxXTsKLSAgICAgICAgICAgICAgICBjb250aW51ZTsKLSAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgaWYgKG5hbWVWYWx1ZVswXS5lcXVhbHMoIm5hbWUiKSB8fCBuYW1lVmFsdWVbMF0uZXF1YWxzKCJkZXZpY2VfbmFtZSIpKSB7Ci0gICAgICAgICAgICAgICAgZGV2aWNlTmFtZSA9IHRyaW1RdW90ZXMobmFtZVZhbHVlWzFdKTsKLSAgICAgICAgICAgICAgICBjb250aW51ZTsKLSAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgaWYgKG5hbWVWYWx1ZVswXS5lcXVhbHMoImNvbmZpZ19tZXRob2RzIikpIHsKLSAgICAgICAgICAgICAgICB3cHNDb25maWdNZXRob2RzU3VwcG9ydGVkID0gcGFyc2VIZXgobmFtZVZhbHVlWzFdKTsKLSAgICAgICAgICAgICAgICBjb250aW51ZTsKLSAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgaWYgKG5hbWVWYWx1ZVswXS5lcXVhbHMoImRldl9jYXBhYiIpKSB7Ci0gICAgICAgICAgICAgICAgZGV2aWNlQ2FwYWJpbGl0eSA9IHBhcnNlSGV4KG5hbWVWYWx1ZVsxXSk7Ci0gICAgICAgICAgICAgICAgY29udGludWU7Ci0gICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgIGlmIChuYW1lVmFsdWVbMF0uZXF1YWxzKCJncm91cF9jYXBhYiIpKSB7Ci0gICAgICAgICAgICAgICAgZ3JvdXBDYXBhYmlsaXR5ID0gcGFyc2VIZXgobmFtZVZhbHVlWzFdKTsKLSAgICAgICAgICAgICAgICBjb250aW51ZTsKLSAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICBkZXZpY2VBZGRyZXNzID0gbWF0Y2guZ3JvdXAoMyk7CisgICAgICAgICAgICAgICAgcHJpbWFyeURldmljZVR5cGUgPSBtYXRjaC5ncm91cCg0KTsKKyAgICAgICAgICAgICAgICBkZXZpY2VOYW1lID0gbWF0Y2guZ3JvdXAoNSk7CisgICAgICAgICAgICAgICAgd3BzQ29uZmlnTWV0aG9kc1N1cHBvcnRlZCA9IHBhcnNlSGV4KG1hdGNoLmdyb3VwKDYpKTsKKyAgICAgICAgICAgICAgICBkZXZpY2VDYXBhYmlsaXR5ID0gcGFyc2VIZXgobWF0Y2guZ3JvdXAoNykpOworICAgICAgICAgICAgICAgIGdyb3VwQ2FwYWJpbGl0eSA9IHBhcnNlSGV4KG1hdGNoLmdyb3VwKDgpKTsKKyAgICAgICAgICAgICAgICBicmVhazsKICAgICAgICAgfQogCiAgICAgICAgIGlmICh0b2tlbnNbMF0uc3RhcnRzV2l0aCgiUDJQLURFVklDRS1GT1VORCIpKSB7CkBAIC0yMzMsNyArMjUy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dXJjZS53cHNDb25maWdNZXRob2RzU3VwcG9ydGVkOwpAQCAtMjY3LDcgKzI4NCw2IEBACiAgICAgcHVibGljIHZvaWQgd3JpdGVUb1BhcmNlbChQYXJjZWwgZGVzdCwgaW50IGZsYWdzKSB7CiAgICAgICAgIGRlc3Qud3JpdGVTdHJpbmcoZGV2aWNlTmFtZSk7CiAgICAgICAgIGRlc3Qud3JpdGVTdHJpbmcoZGV2aWNlQWRkcmVzcyk7Ci0gICAgICAgIGRlc3Qud3JpdGVTdHJpbmcoaW50ZXJmYWNlQWRkcmVzcyk7CiAgICAgICAgIGRlc3Qud3JpdGVTdHJpbmcocHJpbWFyeURldmljZVR5cGUpOwogICAgICAgICBkZXN0LndyaXRlU3RyaW5nKHNlY29uZGFyeURldmljZVR5cGUpOwogICAgICAgICBkZXN0LndyaXRlSW50KHdwc0NvbmZpZ01ldGhvZHNTdXBwb3J0ZWQpOwpAQCAtMjgzLDcgKzI5OSw2IEBACiAgICAgICAgICAgICAgICAgV2lmaVAycERldmljZSBkZXZpY2UgPSBuZXcgV2lmaVAycERldmljZSgpOwogICAgICAgICAgICAgICAgIGRldmljZS5kZXZpY2VOYW1lID0gaW4ucmVhZFN0cmluZygpOwogICAgICAgICAgICAgICAgIGRldmljZS5kZXZpY2VBZGRyZXNzID0gaW4ucmVhZFN0cmluZygpOwotICAgICAgICAgICAgICAgIGRldmljZS5pbnRlcmZhY2VBZGRyZXNzID0gaW4ucmVhZFN0cmluZygpOwogICAgICAgICAgICAgICAgIGRldmljZS5wcmltYXJ5RGV2aWNlVHlwZSA9IGluLnJlYWRTdHJpbmcoKTsKICAgICAgICAgICAgICAgICBkZXZpY2Uuc2Vjb25kYXJ5RGV2aWNlVHlwZSA9IGluLnJlYWRTdHJpbmcoKTsKICAgICAgICAgICAgICAgICBkZXZpY2Uud3BzQ29uZmlnTWV0aG9kc1N1cHBvcnRlZCA9IGluLnJlYWRJbnQoKTsKQEAgLTI5OCwxNSArMzEzLDYgQEAKICAgIC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hdHRlcm47CitpbXBvcnQgamF2YS51dGlsLnJlZ2V4Lk1hdGNoZXI7CiAKIC8qKgogICogQSBjbGFzcyByZXByZXNlbnRpbmcgYSBXaS1GaSBQMnAgZ3JvdXAKQEAgLTQ4LDYgKzUwLDE1IEBACiAKICAgICBwcml2YXRlIFN0cmluZyBtSW50ZXJmYWNlOwogCisgICAgLyoqIFAyUCBncm91cCBzdGFydGVkIHN0cmluZyBwYXR0ZXJuICovCisgICAgcHJpdmF0ZSBzdGF0aWMgZmluYWwgUGF0dGVybiBncm91cFN0YXJ0ZWRQYXR0ZXJuID0gUGF0dGVybi5jb21waWxlKAorICAgICAgICAic3NpZD1cIiguKylcIiAiICsKKyAgICAgICAgImZyZXE9KFxcZCspICIgKworICAgICAgICAiKD86cHNrPSk/KFswLTlhLWZBLUZdezY0fSk/IiArCisgICAgICAgICIoPzpwYXNzcGhyYXNlPSk/KD86XCIoLns4LDYzfSlcIik/ICIgKworICAgICAgICAiZ29fZGV2X2FkZHI9KCg/OlswLTlhLWZdezJ9Oil7NX1bMC05YS1mXXsyfSkiCisgICAgKTsKKwogICAgIHB1YmxpYyBXaWZpUDJwR3JvdXAoKSB7CiAgICAgfQogCkBAIC03OCwyNCArODksMTggQEAKICAgICAgICAgICAgIG1JbnRlcmZhY2UgPSB0b2tlbnNbMV07CiAgICAgICAgICAgICBtSXNHcm91cE93bmVyID0gdG9rZW5zWzJdLmVxdWFscygiR08iKTsKIAotICAgICAgICAgICAgZm9yIChTdHJpbmcgdG9rZW4gOiB0b2tlbnMpIHsKLSAgICAgICAgICAgICAgICBTdHJpbmdbXSBuYW1lVmFsdWUgPSB0b2tlbi5zcGxpdCgiPSIpOwotICAgICAgICAgICAgICAgIGlmIChuYW1lVmFsdWUubGVuZ3RoICE9IDIpIGNvbnRpbnVlOwotCi0gICAgICAgICAgICAgICAgaWYgKG5hbWVWYWx1ZVswXS5lcXVhbHMoInNzaWQiKSkgewotICAgICAgICAgICAgICAgICAgICBtTmV0d29ya05hbWUgPSBuYW1lVmFsdWVbMV07Ci0gICAgICAgICAgICAgICAgICAgIGNvbnRpbnVlOwotICAgICAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgICAgIGlmIChuYW1lVmFsdWVbMF0uZXF1YWxzKCJwYXNzcGhyYXNlIikpIHsKLSAgICAgICAgICAgICAgICAgICAgbVBhc3NwaHJhc2UgPSBuYW1lVmFsdWVbMV07Ci0gICAgICAgICAgICAgICAgICAgIGNvbnRpbnVlOwotICAgICAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgICAgIGlmIChuYW1lVmFsdWVbMF0uZXF1YWxzKCJnb19kZXZfYWRkciIpKSB7Ci0gICAgICAgICAgICAgICAgICAgIG1Pd25lciA9IG5ldyBXaWZpUDJwRGV2aWNlKG5hbWVWYWx1ZVsxXSk7Ci0gICAgICAgICAgICAgICAgfQorICAgICAgICAgICAgTWF0Y2hlciBtYXRjaCA9IGdyb3VwU3RhcnRlZFBhdHRlcm4ubWF0Y2hlcihzdXBwbGljYW50RXZlbnQpOworICAgICAgICAgICAgaWYgKCFtYXRjaC5maW5kKCkpIHsKKyAgICAgICAgICAgICAgICByZXR1cm47CiAgICAgICAgICAgICB9CisKKyAgICAgICAgICAgIG1OZXR3b3JrTmFtZSA9IG1hdGNoLmdyb3VwKDEpOworICAgICAgICAgICAgLy9mcmVxIGFuZCBwc2sgYXJlIHVudXNlZCByaWdodCBub3cKKyAgICAgICAgICAgIC8vaW50IGZyZXEgPSBJbnRlZ2VyLnBhcnNlSW50KG1hdGNoLmdyb3VwKDIpKTsKKyAgICAgICAgICAgIC8vU3RyaW5nIHBzayA9IG1hdGNoLmdyb3VwKDMpOworICAgICAgICAgICAgbVBhc3NwaHJhc2UgPSBtYXRjaC5ncm91cCg0KTsKKyAgICAgICAgICAgIG1Pd25lciA9IG5ldyBXaWZpUDJwRGV2aWNlKG1hdGNoLmdyb3VwKDUpKTsKKwogICAgICAgICB9IGVsc2UgaWYgKHRva2Vuc1swXS5lcXVhb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ICAgICAgIGludCBuZXRJZCA9IGNvbmZpZ3VyZWROZXR3b3JrSWQobVNhdmVkUGVlckNvbmZpZy5kZXZpY2VBZGRyZXNzKTsKICAgICAgICAgICAgICAgICAgICAgaWYgKG5ldElkID49IDApIHsKQEAgLTU1Myw3ICs1NTEsNyBAQAogICAgICAgICAgICAgICAgICAgICAgICAgbVdpZmlOYXRpdmUucDJwU3RvcEZpbmQoKTsKICAgICAgICAgICAgICAgICAgICAgICAgIC8vSWYgcGVlciBpcyBhIEdPLCB3ZSBkbyBub3QgbmVlZCB0byBzZW5kIHByb3Zpc2lvbmFsIGRpc2NvdmVyeSwKICAgICAgICAgICAgICAgICAgICAgICAgIC8vdGhlIHN1cHBsaWNhbnQgdGFrZXMgY2FyZSBvZiBpdC4KLSAgICAgICAgICAgICAgICAgICAgICAgIGlmIChpc0dyb3VwT3duZXIobVNhdmVkUGVlckNvbmZpZy5kZXZpY2VBZGRyZXNzKSkgeworICAgICAgICAgICAgICAgICAgICAgICAgaWYgKG1XaWZpTmF0aXZlLmlzR3JvdXBPd25lcihtU2F2ZWRQZWVyQ29uZmlnLmRldmljZUFkZHJlc3MpKSB7CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcDJwQ29ubmVjdFdpdGhQaW5EaXNwbGF5KG1TYXZlZFBlZXJDb25maWcsIEpPSU5fR1JPVVApOwogICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRyYW5zaXRpb25UbyhtR3JvdXBOZWdvdGlhdGlvblN0YXRlKTsKICAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7CkBAIC02ODMsNyArNjgxLDcgQEAKICAgICAgICAgICAgIHN3aXRjaCAobWVzc2FnZS53aGF0KSB7CiAgICAgICAgICAgICAgICAgY2FzZSBQRUVSX0NPTk5FQ1RJT05fVVNFUl9BQ0NFUFQ6CiAgICAgICAgICAgICAgICAgICAgIC8vVE9ETzogaGFuZGxlIHBlcnNpc3RlbmNlCi0gICAgICAgICAgICAgICAgICAgIGlmIChpc0dyb3VwT3duZXIobVNhdmVkUGVlckNvbmZpZy5kZXZpY2VBZGRyZXNzKSkgeworICAgICAgICAgICAgICAgICAgICBpZiAobVdpZmlOYXRpdmUuaXNHcm91cE93bmVyKG1TYXZlZFBlZXJDb25maWcuZGV2aWNlQWRkcmVzcykpIHsKICAgICAgICAgICAgICAgICAgICAgICAgIHAycENvbm5lY3RXaXRoUGluRGlzcGxheShtU2F2ZWRQZWVyQ29uZmlnLCBKT0lOX0dST1VQKTsKICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHsKICAgICAgICAgICAgICAgICAgICAgICAgIHAycENvbm5lY3RXaXRoUGluRGlzcGxheShtU2F2ZWRQZWVyQ29uZmlnLCBGT1JNX0dST1VQKTsKQEAgLTg0Miw3ICs4NDAsNiBAQAogICAgICAgICAgICAgICAgICAgICBTdHJpbmcgZGV2aWNlQWRkcmVzcyA9IGRldmljZS5kZXZpY2VBZGRyZXNzOwogICAgICAgICAgICAgICAgICAgICBpZiAoZGV2aWNlQWRkcmVzcyAhPSBudWxsKSB7CiAgICAgICAgICAgICAgICAgICAgICAgICBtR3JvdXAuYWRkQ2xpZW50KGRldmljZUFkZHJlc3MpOwotICAgICAgICAgICAgICAgICAgICAgICAgbVBlZXJzLnVwZGF0ZUludGVyZmFjZUFkZHJlc3MoZGV2aWNlKTsKICAgICAgICAgICAgICAgICAgICAgICAgIHVwZGF0ZURldmljZVN0YXR1cyhkZXZpY2VBZGRyZXNzLCBXaWZpUDJwRGV2aWNlLkNPTk5FQ1RFRCk7CiAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoREJHKSBsb2dkKGdldE5hbWUoKSArICIgYXAgc3RhIGNvbm5lY3RlZCIpOwogICAgICAgICAgICAgICAgICAgICAgICAgc2VuZFAycFBlZXJzQ2hhbmdlZEJyb2FkY2FzdCgpOwpAQCAtODUxLDEwICs4NDgsOCBAQAogICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICAgICAgIGJyZWFrOwogICAgICAgICAgICAgICAgIGNhc2UgV2lmaU1vbml0b3IuQVBfU1RBX0RJU0NPTk5FQ1RFRF9FVkVOVDoKLSAgICAgICAgICAgICAgICAgICAgLy9UT0RPOiB0aGUgZGlzY29ubmVjdGlvbiBldmVudCBpcyBzdGlsbCBpbmNvbnNpc3RlbnQgYW5kIHJlcG9ydHMKLSAgICAgICAgICAgICAgICAgICAgLy9pbnRlcmZhY2UgYWRkcmVzcy4gRml4IHRoaXMgYWZ0ZXIgd3BhX3N1cHBsaWNhbnQgaXMgZml4ZWQuCi0gICAgICAgICAgICAgICAgICAgIFN0cmluZyBpbnRlcmZhY2VBZGRyZXNzID0gKFN0cmluZykgbWVzc2FnZS5vYmo7Ci0gICAgICAgICAgICAgICAgICAgIGRldmljZUFkZHJlc3MgPSBnZXREZXZpY2VBZGRyZXNzKGludGVyZmFjZUFkZHJlc3MpOworICAgICAgICAgICAgICAgICAgICBkZXZpY2UgPSAoV2lmaVAycERldmljZSkgbWVzc2FnZS5vYmo7CisgICAgICAgICAgICAgICAgICAgIGRldmljZUFkZHJlc3MgPSBkZXZpY2UuZGV2aWNlQWRkcmVzczsKICAgICAgICAgICAgICAgICAgICAgaWYgKGRldmljZUFkZHJlc3MgIT0gbnVsbCkgewogICAgICAgICAgICAgICAgICAgICAgICAgdXBkYXRlRGV2aWNlU3RhdHVzKGRldmljZUFkZHJlc3MsIFdpZmlQMnBEZXZpY2UuQVZBSUxBQkxFKTsKICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChtR3JvdXAucmVtb3ZlQ2xpZW50KGRldmljZUFkZHJlc3MpKSB7CkBAIC04NzIsNyArODY3LDcgQEAKICAgICAgICAgICAgICAgICAgICAgICAgIHNlbmRQMnBQZWVyc0NoYW5nZWRCcm9hZGNhc3QoKTsKICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChEQkcpIGxvZ2UoZ2V0TmFtZSgpICsgIiBhcCBzdGEgZGlzY29ubmVjdGVkIik7CiAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7Ci0gICAgICAgICAgICAgICAgICAgICAgICBsb2dlKCJEaXNjb25uZWN0IG9uIHVua25vd24gaW50ZXJmYWNlIGFkZHJlc3MgOiAiICsgaW50ZXJmYWNlQWRkcmVzcyk7CisgICAgICAgICAgICAgICAgICAgICAgICBsb2dlKCJEaXNjb25uZWN0IG9uIHVua25vd24gZGV2aWNlOiAiICsgZGV2aWNlKTsKICAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgICAgICBicmVhazsKICAgICAgICAgICAgICAgICBjYXNlIERoY3BTdGF0ZU1hY2hpbmUuQ01EX1BPU1RfREhDUF9BQ1RJT046CkBAIC04ODMsNiArODc4LDcgQEAKICAgICAgICAgICAgICAgICAgICAgICAgIHNldFdpZmlQMnBJbmZvT25Hcm91cEZvcm1hdGlvbihkaGNwSW5mby5zZXJ2ZXJBZGRyZXNzKTsKICAgICAgICAgICAgICAgICAgICAgICAgIHNlbmRQMnBDb25uZWN0aW9uQ2hhbmdlZEJyb2FkY2FzdCgpOwogICAgICAgICAgICAgICAgICAgICB9IGVsc2UgeworICAgICAgICAgICAgICAgICAgICAgICAgbG9nZSgiREhDUCBmYWlsZWQiKTsKICAgICAgICAgICAgICAgICAgICAgICAgIG1XaWZpTmF0aXZlLnAycEdyb3VwUmVtb3ZlKG1Hcm91cC5nZXRJbnRlcmZhY2UoKSk7CiAgICAgICAgICAgICAgICAgICAgIH0KICAgICAgICAgICAgICAgICAgICAgYnJlYWs7CkBAIC05MTYsNiArOTEyLDcgQEAKICAgICAgICAgICAgICAgICAgICAgfQogCiAgICAgICAgICAgICAgICAgICAgIG1Hcm91cCA9IG51bGw7CisgICAgICAgICAgICAgICAgICAgIG1XaWZpTmF0aXZlLnAycEZsdXNoKCk7CiAgICAgICAgICAgICAgICAgICAgIGlmIChjaGFuZ2VkKSBzZW5kUDJwUGVlcnNDaGFuZ2VkQnJvYWRjYXN0KCk7CiAgICAgICAgICAgICAgICAgICAgIHRyYW5zaXRpb25UbyhtSW5hY3RpdmVTdGF0ZSk7CiAgICAgICAgICAgICAgICAgICAgIGJyZWFrOwpAQCAtMTE4MywxNSArMTE4MCw2IEBACiAgICAgICAgIH0KICAgICB9CiAKLSAgICBwcml2YXRlIGJvb2xlYW4gaXNHcm91cE93bmVyKFN0cmluZyBkZXZpY2VBZGRyZXNzKSB7Ci0gICAgICAgIGZvciAoV2lmaVAycERldmljZSBkIDogbVBlZXJzLmdldERldmljZUxpc3QoKSkgewotICAgICAgICAgICAgaWYgKGQuZGV2aWNlQWRkcmVzcy5lcXVhbHMoZGV2aWNlQWRkcmVzcykpIHsKLSAgICAgICAgICAgICAgICByZXR1cm4gZC5pc0dyb3VwT3duZXIoKTsKLSAgICAgICAgICAgIH0KLSAgICAgICAgfQotICAgICAgICByZXR1cm4gZmFsc2U7Ci0gICAgfQotCiAgICAgLy9UT0RPOiBpbXBsZW1lbnQgd2hlbiB3cGFfc3VwcGxpY2FudCBpcyBmaXhlZAogICAgIHByaXZhdGUgaW50IGNvbmZpZ3VyZWROZXR3b3JrSWQoU3RyaW5nIGRldmljZUFkZHJlc3MpIHsKICAgICAgICAgcmV0dXJuIC0xOwpAQCAtMTIxOSwxNSArMTIwNyw2IEBACiAgICAgICAgIHJldHVybiBkZXZpY2VBZGRyZXNzOwogICAgIH0KIAotICAgIHByaXZhdGUgU3RyaW5nIGdldERldmljZUFkZHJlc3MoU3RyaW5nIGludGVyZmFjZUFkZHJlc3MpIHsKLSAgICAgICAgZm9yIChXaWZpUDJwRGV2aWNlIGQgOiBtUGVlcnMuZ2V0RGV2aWNlTGlzdCgpKSB7Ci0gICAgICAgICAgICBpZiAoaW50ZXJmYWNlQWRkcmVzcy5lcXVhbHMoZC5pbnRlcmZhY2VBZGRyZXNzKSkgewotICAgICAgICAgICAgICAgIHJldHVybiBkLmRldmljZUFkZHJlc3M7Ci0gICAgICAgICAgICB9Ci0gICAgICAgIH0KLSAgICAgICAgcmV0dXJuIG51bGw7Ci0gICAgfQotCiAgICAgcHJpdmF0ZSBXaWZpUDJwRGV2aWNlIGdldERldmljZUZyb21QZWVyTGlzdChTdHJpbmcgZGV2aWNlQWRkcmVzcykgewogICAgICAgICBmb3IgKFdpZmlQMnBEZXZpY2UgZCA6IG1QZWVycy5nZXREZXZpY2VMaXN0KCkpIHsKICAgICAgICAgICAgIGlmIChkLmRldmljZUFkZHJlc3MuZXF1YWxzKGRldmljZUFkZHJlc3MpKSB7Cg==